OverlayPanel doc added

pull/12/head
Merve Özçifçi 2019-04-02 11:54:31 +03:00
parent 1b66c2f777
commit 48b09bab5e
3 changed files with 198 additions and 8 deletions

View File

@ -16,15 +16,15 @@ import DomHandler from '../utils/DomHandler';
export default {
props: {
dismissable: {
type: Boolean,
default: true
},
showCloseIcon: {
type: Boolean,
default: false
},
appendTo: String,
showCloseIcon: {
type: Boolean,
default: false
},
dismissable: {
type: Boolean,
default: true
},
baseZIndex: {
type: Number,
default: 0

View File

@ -14,15 +14,22 @@
<img src="/demo/images/nature/nature1.jpg" alt="Nature Image">
</OverlayPanel>
</div>
<OverlayPanelDoc/>
</div>
</template>
<script>
import OverlayPanelDoc from './OverlayPanelDoc';
export default {
methods: {
toggle(event) {
this.$refs.op.toggle(event);
}
},
components: {
'OverlayPanelDoc': OverlayPanelDoc
}
}
</script>

View File

@ -0,0 +1,183 @@
<template>
<div class="content-section documentation">
<TabView>
<TabPanel header="Documentation">
<h3>Import</h3>
<CodeHighlight lang="javascript">
import OverlayPanel from 'primevue/overlaypanel';
</CodeHighlight>
<h3>Getting Started</h3>
<p>OverlayPanel is accessed via its reference where visibility is controlled using toggle, show and hide methods.</p>
<CodeHighlight>
&lt;Button type=&quot;button&quot; label=&quot;Toggle&quot; @click=&quot;toggle&quot; /&gt;
&lt;OverlayPanel ref=&quot;op&quot;&gt;
&lt;img src=&quot;/demo/images/nature/nature1.jpg&quot; alt=&quot;Nature Image&quot;&gt;
&lt;/OverlayPanel&gt;
</CodeHighlight>
<CodeHighlight lang="js">
toggle(event) {
this.$refs.op.toggle(event);
}
}
</CodeHighlight>
<h3>Dismissable and CloseIcon</h3>
<p>Clicking outside the overlay hides the panel, setting dismissable to false disables this behavior.
Additionally enablign showCloseIcon property displays a close icon at the top right corner to close the panel.</p>
<CodeHighlight>
&lt;OverlayPanel ref=&quot;op&quot; :showCloseIcon=&quot;true&quot; :dismissable=&quot;true&quot;&gt;
&lt;img src=&quot;/demo/images/nature/nature1.jpg&quot; alt=&quot;Nature Image&quot;&gt;
&lt;/OverlayPanel&gt;
</CodeHighlight>
<h3>Properties</h3>
<div class="doc-tablewrapper">
<table class="doc-table">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Default</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>dismissable</td>
<td>boolean</td>
<td>true</td>
<td>Enables to hide the overlay when outside is clicked.</td>
</tr>
<tr>
<td>showCloseIcon</td>
<td>boolean</td>
<td>false</td>
<td>When enabled, displays a close icon at top right corner.</td>
</tr>
<tr>
<td>appendTo</td>
<td>string</td>
<td>null</td>
<td>DOM element instance where the dialog should be mounted.</td>
</tr>
<tr>
<td>baseZIndex</td>
<td>number</td>
<td>0</td>
<td>Base zIndex value to use in layering.</td>
</tr>
<tr>
<td>autoZIndex</td>
<td>boolean</td>
<td>true</td>
<td>Whether to automatically manage layering.</td>
</tr>
</tbody>
</table>
</div>
<h3>Methods</h3>
<div class="doc-tablewrapper">
<table class="doc-table">
<thead>
<tr>
<th>Name</th>
<th>Parameters</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>toggle</td>
<td>event: Browser event</td>
<td>Toggles the visiblity of the overlay.</td>
</tr>
<tr>
<td>show</td>
<td>event: Browser event <br />
target: Optional target if event.target should not be used</td>
<td>Shows the overlay.</td>
</tr>
<tr>
<td>hide</td>
<td>-</td>
<td>Hides the overlay.</td>
</tr>
</tbody>
</table>
</div>
<h3>Styling</h3>
<p>Following is the list of structural style classes, for theming classes visit <router-link to="/theming">theming</router-link> page.</p>
<div class="doc-tablewrapper">
<table class="doc-table">
<thead>
<tr>
<th>Name</th>
<th>Element</th>
</tr>
</thead>
<tbody>
<tr>
<td>p-overlaypanel</td>
<td>Container element.</td>
</tr>
<tr>
<td>p-overlaypanel-content</td>
<td>Content of the panel.</td>
</tr>
<tr>
<td>p-overlaypanel-close</td>
<td>Close icon.</td>
</tr>
</tbody>
</table>
</div>
<h3>Dependencies</h3>
<p>None.</p>
</TabPanel>
<TabPanel header="Source">
<a href="https://github.com/primefaces/primevue/tree/master/src/views/overlaypanel" class="btn-viewsource" target="_blank" rel="noopener noreferrer">
<span>View on GitHub</span>
</a>
<CodeHighlight>
<template v-pre>
&lt;template&gt;
&lt;div&gt;
&lt;div class=&quot;content-section introduction&quot;&gt;
&lt;div class=&quot;feature-intro&quot;&gt;
&lt;h1&gt;OverlayPanel&lt;/h1&gt;
&lt;p&gt;OverlayPanel is a container component that can overlay other components on page.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;content-section implementation&quot;&gt;
&lt;Button type=&quot;button&quot; label=&quot;Toggle&quot; @click=&quot;toggle&quot; /&gt;
&lt;OverlayPanel ref=&quot;op&quot; appendTo=&quot;body&quot; :showCloseIcon=&quot;true&quot;&gt;
&lt;img src=&quot;/demo/images/nature/nature1.jpg&quot; alt=&quot;Nature Image&quot;&gt;
&lt;/OverlayPanel&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/template&gt;
</template>
</CodeHighlight>
<CodeHighlight lang="javascript">
export default {
methods: {
toggle(event) {
this.$refs.op.toggle(event);
}
}
}
</CodeHighlight>
</TabPanel>
</TabView>
</div>
</template>