|
|
|
@ -4,58 +4,56 @@
|
|
|
|
|
<TabPanel header="Documentation">
|
|
|
|
|
<h3>Import</h3>
|
|
|
|
|
<CodeHighlight lang="javascript">
|
|
|
|
|
import Panel from 'primevue/panel';
|
|
|
|
|
import OrderList from 'primevue/orderlist';
|
|
|
|
|
</CodeHighlight>
|
|
|
|
|
|
|
|
|
|
<h3>Getting Started</h3>
|
|
|
|
|
<p>Panel is a container component that accepts content as its children.</p>
|
|
|
|
|
<p>OrderList requires an array as its value bound with the v-model directive and a template for its content.</p>
|
|
|
|
|
<p>Header of the component is defined with the "header" template and to define the content of an item in the list a named templated called "item" needs to be defined which gets the
|
|
|
|
|
<i>item</i> and the <i>index</i> via slotProps.
|
|
|
|
|
</p>
|
|
|
|
|
<CodeHighlight>
|
|
|
|
|
<Panel header="Godfather I">
|
|
|
|
|
The story begins as Don Vito Corleone, the head of a New York Mafia family, oversees his daughter's wedding.
|
|
|
|
|
His beloved son Michael has just come home from the war, but does not intend to become part of his father's business.
|
|
|
|
|
Through Michael's life the nature of the family business becomes clear. The business of the family is just like the head of the family,
|
|
|
|
|
kind and benevolent to those who give respect, but given to ruthless violence whenever anything stands against the good of the family.
|
|
|
|
|
</Panel>
|
|
|
|
|
</CodeHighlight>
|
|
|
|
|
|
|
|
|
|
<h3>Custom Header</h3>
|
|
|
|
|
<p>Header of the panel is either defined with the <i>header</i> property or the header template.</p>
|
|
|
|
|
<CodeHighlight>
|
|
|
|
|
<Panel>
|
|
|
|
|
<template v-pre>
|
|
|
|
|
<OrderList v-model="cars" header="List of Cars" listStyle="height:auto" dataKey="vin">
|
|
|
|
|
<template #header>
|
|
|
|
|
Header Content
|
|
|
|
|
List of Cars
|
|
|
|
|
</template>
|
|
|
|
|
Content
|
|
|
|
|
</Panel>
|
|
|
|
|
<template #item="slotProps">
|
|
|
|
|
<div class="p-caritem">
|
|
|
|
|
<img :src="'demo/images/car/' + slotProps.item.brand + '.png'">
|
|
|
|
|
<div>{{slotProps.item.brand}} - {{slotProps.item.year}} - {{slotProps.item.color}}</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</OrderList>
|
|
|
|
|
</template>
|
|
|
|
|
</CodeHighlight>
|
|
|
|
|
|
|
|
|
|
<h3>Toggleable</h3>
|
|
|
|
|
<p>Content of the panel can be expanded and collapsed using <i>toggleable</i> option.</p>
|
|
|
|
|
<CodeHighlight>
|
|
|
|
|
<Panel header="Godfather I" :toggleable="true">
|
|
|
|
|
The story begins as Don Vito Corleone, the head of a New York Mafia family, oversees his daughter's wedding.
|
|
|
|
|
His beloved son Michael has just come home from the war, but does not intend to become part of his father's business.
|
|
|
|
|
Through Michael's life the nature of the family business becomes clear. The business of the family is just like the head of the family,
|
|
|
|
|
kind and benevolent to those who give respect, but given to ruthless violence whenever anything stands against the good of the family.
|
|
|
|
|
</Panel>
|
|
|
|
|
</CodeHighlight>
|
|
|
|
|
|
|
|
|
|
<p>To control the initial state of the toggleable panel, use the <i>collapsed</i> property.</p>
|
|
|
|
|
<CodeHighlight>
|
|
|
|
|
<Panel header="Header Text" :toggleable="true" :collapsed="true">
|
|
|
|
|
Content
|
|
|
|
|
</Panel>
|
|
|
|
|
</CodeHighlight>
|
|
|
|
|
<h3>Selection</h3>
|
|
|
|
|
<p>In case you'd need to access the selected items in the list, define a binding to the <i>selection</i> property with the sync operator so that
|
|
|
|
|
it gets updated when the user makes a selection. Since it is two-way binding enabled, your changes to the selection will be reflected as well. Note that
|
|
|
|
|
this is optional and only necessary when you need to access the selection.</p>
|
|
|
|
|
|
|
|
|
|
<p>Use the sync operator to enable two-way binding.</p>
|
|
|
|
|
|
|
|
|
|
<CodeHighlight>
|
|
|
|
|
<button type="button" @click="isCollapsed = !isCollapsed">Toggle Programmatically</button>
|
|
|
|
|
<Panel header="Header Text" :toggleable="true" :collapsed.sync="isCollapsed">
|
|
|
|
|
Content
|
|
|
|
|
</Panel>
|
|
|
|
|
<template v-pre>
|
|
|
|
|
<OrderList v-model="cars" header="List of Cars" listStyle="height:auto" dataKey="vin" :dragdrop="true">
|
|
|
|
|
<template #header>
|
|
|
|
|
List of Cars
|
|
|
|
|
</template>
|
|
|
|
|
<template #item="slotProps">
|
|
|
|
|
<div class="p-caritem">
|
|
|
|
|
<img :src="'demo/images/car/' + slotProps.item.brand + '.png'">
|
|
|
|
|
<div>{{slotProps.item.brand}} - {{slotProps.item.year}} - {{slotProps.item.color}}</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</OrderList>
|
|
|
|
|
</template>
|
|
|
|
|
</CodeHighlight>
|
|
|
|
|
|
|
|
|
|
<h3>DataKey</h3>
|
|
|
|
|
<p>It is recommended to provide the name of the field that uniquely identifies the a record in the data via the <i>dataKey</i> property for better performance.</p>
|
|
|
|
|
|
|
|
|
|
<h3>Properties</h3>
|
|
|
|
|
<p>Any attribute such as style and class are passed to the main container element. Following are the additional properties to configure the component.</p>
|
|
|
|
|
<div class="doc-tablewrapper">
|
|
|
|
@ -70,22 +68,37 @@ import Panel from 'primevue/panel';
|
|
|
|
|
</thead>
|
|
|
|
|
<tbody>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>header</td>
|
|
|
|
|
<td>value</td>
|
|
|
|
|
<td>array</td>
|
|
|
|
|
<td>null</td>
|
|
|
|
|
<td>Value of the component.</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>selection</td>
|
|
|
|
|
<td>any</td>
|
|
|
|
|
<td>null</td>
|
|
|
|
|
<td>Selected items in the list.</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>metaKeySelection</td>
|
|
|
|
|
<td>boolean</td>
|
|
|
|
|
<td>true</td>
|
|
|
|
|
<td>Defines whether metaKey is requred or not for the selection. <br/>
|
|
|
|
|
When true metaKey needs to be pressed to select or unselect an item and <br/>
|
|
|
|
|
when set to false selection of each item
|
|
|
|
|
can be toggled individually. On touch enabled devices, metaKeySelection is turned off automatically.</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>dataKey</td>
|
|
|
|
|
<td>string</td>
|
|
|
|
|
<td>null</td>
|
|
|
|
|
<td>Header text of the panel.</td>
|
|
|
|
|
<td>Name of the field that uniquely identifies the a record in the data.</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>toggleable</td>
|
|
|
|
|
<td>boolean</td>
|
|
|
|
|
<td>listStyle</td>
|
|
|
|
|
<td>object</td>
|
|
|
|
|
<td>null</td>
|
|
|
|
|
<td>Defines if content of panel can be expanded and collapsed.</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>collapsed</td>
|
|
|
|
|
<td>boolean</td>
|
|
|
|
|
<td>null</td>
|
|
|
|
|
<td>Defines the initial state of panel content.</td>
|
|
|
|
|
<td>Inline style of the the list element.</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
@ -103,11 +116,12 @@ import Panel from 'primevue/panel';
|
|
|
|
|
</thead>
|
|
|
|
|
<tbody>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>toggle</td>
|
|
|
|
|
<td>reorder</td>
|
|
|
|
|
<td>event.originalEvent: browser event <br />
|
|
|
|
|
event.value: collapsed state as a boolean
|
|
|
|
|
event.value: Ordered list <br />
|
|
|
|
|
event.direction: Direction of the change; "up", "down", "bottom", "top"
|
|
|
|
|
</td>
|
|
|
|
|
<td>Callback to invoke when a tab toggle.</td>
|
|
|
|
|
<td>Callback to invoke when the list is reordered.</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
@ -125,24 +139,16 @@ import Panel from 'primevue/panel';
|
|
|
|
|
</thead>
|
|
|
|
|
<tbody>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>p-panel</td>
|
|
|
|
|
<td>p-orderlist</td>
|
|
|
|
|
<td>Container element.</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>p-panel-titlebar</td>
|
|
|
|
|
<td>Header section.</td>
|
|
|
|
|
<td>p-orderlist-list</td>
|
|
|
|
|
<td>List container.</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>p-panel-title</td>
|
|
|
|
|
<td>Title text of panel.</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>p-panel-titlebar-toggler</td>
|
|
|
|
|
<td>Toggle icon.</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>p-panel-content</td>
|
|
|
|
|
<td>Content of panel.</td>
|
|
|
|
|
<td>p-orderlist-item</td>
|
|
|
|
|
<td>An item in the list</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
@ -158,35 +164,60 @@ import Panel from 'primevue/panel';
|
|
|
|
|
</a>
|
|
|
|
|
<CodeHighlight>
|
|
|
|
|
<template v-pre>
|
|
|
|
|
<template>
|
|
|
|
|
<div>
|
|
|
|
|
<div class="content-section introduction">
|
|
|
|
|
<div class="feature-intro">
|
|
|
|
|
<h1>Panel</h1>
|
|
|
|
|
<p>Panel is a grouping component with the optional content toggle feature.</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="content-section implementation">
|
|
|
|
|
<h3 class="first">Regular</h3>
|
|
|
|
|
<Panel header="Godfather I">
|
|
|
|
|
The story begins as Don Vito Corleone, the head of a New York Mafia family, oversees his daughter's wedding.
|
|
|
|
|
His beloved son Michael has just come home from the war, but does not intend to become part of his father's business.
|
|
|
|
|
Through Michael's life the nature of the family business becomes clear. The business of the family is just like the head of the family,
|
|
|
|
|
kind and benevolent to those who give respect, but given to ruthless violence whenever anything stands against the good of the family.
|
|
|
|
|
</Panel>
|
|
|
|
|
|
|
|
|
|
<h3>Toggleable</h3>
|
|
|
|
|
<Panel header="Godfather I" :toggleable="true">
|
|
|
|
|
The story begins as Don Vito Corleone, the head of a New York Mafia family, oversees his daughter's wedding.
|
|
|
|
|
His beloved son Michael has just come home from the war, but does not intend to become part of his father's business.
|
|
|
|
|
Through Michael's life the nature of the family business becomes clear. The business of the family is just like the head of the family,
|
|
|
|
|
kind and benevolent to those who give respect, but given to ruthless violence whenever anything stands against the good of the family.
|
|
|
|
|
</Panel>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<OrderList v-model="cars" header="List of Cars" listStyle="height:auto" dataKey="vin">
|
|
|
|
|
<template #header>
|
|
|
|
|
List of Cars
|
|
|
|
|
</template>
|
|
|
|
|
<template #item="slotProps">
|
|
|
|
|
<div class="p-caritem">
|
|
|
|
|
<img :src="'demo/images/car/' + slotProps.item.brand + '.png'">
|
|
|
|
|
<div>{{slotProps.item.brand}} - {{slotProps.item.year}} - {{slotProps.item.color}}</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</OrderList>
|
|
|
|
|
</template>
|
|
|
|
|
</CodeHighlight>
|
|
|
|
|
|
|
|
|
|
<CodeHighlight lang="js">
|
|
|
|
|
import CarService from '../../service/CarService';
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
cars: null
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
carService: null,
|
|
|
|
|
created() {
|
|
|
|
|
this.carService = new CarService();
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
this.carService.getCarsSmall().then(data => this.cars = data.slice(0,5));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</CodeHighlight>
|
|
|
|
|
|
|
|
|
|
<CodeHighlight lang="css">
|
|
|
|
|
.p-caritem {
|
|
|
|
|
&:after {
|
|
|
|
|
content: "";
|
|
|
|
|
display: table;
|
|
|
|
|
clear: both;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
img {
|
|
|
|
|
display:inline-block;
|
|
|
|
|
margin:2px 0 2px 2px;
|
|
|
|
|
width: 48px;
|
|
|
|
|
height: 48px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
div {
|
|
|
|
|
font-size:14px;
|
|
|
|
|
float:right;
|
|
|
|
|
margin: 16px 6px 0 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</CodeHighlight>
|
|
|
|
|
</TabPanel>
|
|
|
|
|
</TabView>
|
|
|
|
|