diff --git a/src/AppMenu.vue b/src/AppMenu.vue
index be702fa4e..4bdf92d16 100644
--- a/src/AppMenu.vue
+++ b/src/AppMenu.vue
@@ -60,6 +60,7 @@
● FullCalendar
● OrderList
● Paginator
+ ● PickList
diff --git a/src/components/picklist/PickList.d.ts b/src/components/picklist/PickList.d.ts
new file mode 100644
index 000000000..ccf6a8675
--- /dev/null
+++ b/src/components/picklist/PickList.d.ts
@@ -0,0 +1,14 @@
+import Vue, {VNode} from 'vue';
+
+export declare class PickList extends Vue {
+ value?: any[];
+ dataKey?: string;
+ selection?: any[];
+ metaKeySelection?: boolean;
+ listStyle?: any;
+ $emit(eventName: 'reorder', e: { originalEvent: Event, value: any[]; direction: string}): this;
+ $slots: {
+ header: VNode[];
+ item: VNode[];
+ }
+}
\ No newline at end of file
diff --git a/src/components/picklist/PickList.vue b/src/components/picklist/PickList.vue
new file mode 100644
index 000000000..4ac23d5a1
--- /dev/null
+++ b/src/components/picklist/PickList.vue
@@ -0,0 +1,554 @@
+
+
+
+
+
+
+
diff --git a/src/main.js b/src/main.js
index 8c436c9ea..01cd5248c 100644
--- a/src/main.js
+++ b/src/main.js
@@ -31,6 +31,7 @@ import OverlayPanel from './components/overlaypanel/OverlayPanel';
import Paginator from './components/paginator/Paginator';
import Panel from './components/panel/Panel';
import Password from './components/password/Password';
+import PickList from './components/picklist/PickList';
import ProgressBar from './components/progressbar/ProgressBar';
import Rating from './components/rating/Rating';
import RadioButton from './components/radiobutton/RadioButton';
@@ -93,6 +94,7 @@ Vue.component('OverlayPanel', OverlayPanel);
Vue.component('Paginator', Paginator);
Vue.component('Panel', Panel);
Vue.component('Password', Password);
+Vue.component('PickList', PickList);
Vue.component('ProgressBar', ProgressBar);
Vue.component('RadioButton', RadioButton);
Vue.component('Rating', Rating);
diff --git a/src/router.js b/src/router.js
index 9488b5133..1fa1af77a 100644
--- a/src/router.js
+++ b/src/router.js
@@ -260,6 +260,11 @@ export default new Router({
path: '/panel',
name: 'panel',
component: () => import('./views/panel/PanelDemo.vue')
+ },
+ {
+ path: '/picklist',
+ name: 'picklist',
+ component: () => import('./views/picklist/PickListDemo.vue')
},
{
path: '/password',
diff --git a/src/views/orderlist/OrderListDemo.vue b/src/views/orderlist/OrderListDemo.vue
index f5720ff25..3ef5a78b8 100644
--- a/src/views/orderlist/OrderListDemo.vue
+++ b/src/views/orderlist/OrderListDemo.vue
@@ -8,7 +8,7 @@
-
+
List of Cars
diff --git a/src/views/orderlist/OrderListDoc.vue b/src/views/orderlist/OrderListDoc.vue
index 5fb49a8c8..57771fa65 100644
--- a/src/views/orderlist/OrderListDoc.vue
+++ b/src/views/orderlist/OrderListDoc.vue
@@ -14,7 +14,7 @@ import OrderList from 'primevue/orderlist';
-<OrderList v-model="cars" header="List of Cars" listStyle="height:auto" dataKey="vin">
+<OrderList v-model="cars" listStyle="height:auto" dataKey="vin">
<template #header>
List of Cars
</template>
@@ -37,7 +37,7 @@ import OrderList from 'primevue/orderlist';
-<OrderList v-model="cars" header="List of Cars" listStyle="height:auto" dataKey="vin" :dragdrop="true">
+<OrderList v-model="cars" listStyle="height:auto" dataKey="vin" :dragdrop="true">
<template #header>
List of Cars
</template>
@@ -164,7 +164,7 @@ import OrderList from 'primevue/orderlist';
-<OrderList v-model="cars" header="List of Cars" listStyle="height:auto" dataKey="vin">
+<OrderList v-model="cars" listStyle="height:auto" dataKey="vin">
<template #header>
List of Cars
</template>
diff --git a/src/views/picklist/PickListDemo.vue b/src/views/picklist/PickListDemo.vue
new file mode 100644
index 000000000..d1e31955c
--- /dev/null
+++ b/src/views/picklist/PickListDemo.vue
@@ -0,0 +1,74 @@
+
+
+
+
+
PickList
+
PickList is used to reorder items between different lists.
+
+
+
+
+
+
+ Available
+
+
+ Selected
+
+
+
+
+
{{slotProps.item.brand}} - {{slotProps.item.year}} - {{slotProps.item.color}}
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/views/picklist/PickListDoc.vue b/src/views/picklist/PickListDoc.vue
new file mode 100644
index 000000000..5fb49a8c8
--- /dev/null
+++ b/src/views/picklist/PickListDoc.vue
@@ -0,0 +1,225 @@
+
+
+
+
+ Import
+
+import OrderList from 'primevue/orderlist';
+
+
+ Getting Started
+ OrderList requires an array as its value bound with the v-model directive and a template for its content.
+ 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
+ item and the index via slotProps.
+
+
+
+<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>
+
+
+
+ Selection
+ In case you'd need to access the selected items in the list, define a binding to the selection 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.
+
+ Use the sync operator to enable two-way binding.
+
+
+
+<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>
+
+
+
+ DataKey
+ It is recommended to provide the name of the field that uniquely identifies the a record in the data via the dataKey property for better performance.
+
+ Properties
+ Any attribute such as style and class are passed to the main container element. Following are the additional properties to configure the component.
+
+
+
+
+ Name |
+ Type |
+ Default |
+ Description |
+
+
+
+
+ value |
+ array |
+ null |
+ Value of the component. |
+
+
+ selection |
+ any |
+ null |
+ Selected items in the list. |
+
+
+ metaKeySelection |
+ boolean |
+ true |
+ Defines whether metaKey is requred or not for the selection.
+ When true metaKey needs to be pressed to select or unselect an item and
+ when set to false selection of each item
+ can be toggled individually. On touch enabled devices, metaKeySelection is turned off automatically. |
+
+
+ dataKey |
+ string |
+ null |
+ Name of the field that uniquely identifies the a record in the data. |
+
+
+ listStyle |
+ object |
+ null |
+ Inline style of the the list element. |
+
+
+
+
+
+ Events
+
+
+
+
+ Name |
+ Parameters |
+ Description |
+
+
+
+
+ reorder |
+ event.originalEvent: browser event
+ event.value: Ordered list
+ event.direction: Direction of the change; "up", "down", "bottom", "top"
+ |
+ Callback to invoke when the list is reordered. |
+
+
+
+
+
+ Styling
+ Following is the list of structural style classes, for theming classes visit theming page.
+
+
+
+
+ Name |
+ Element |
+
+
+
+
+ p-orderlist |
+ Container element. |
+
+
+ p-orderlist-list |
+ List container. |
+
+
+ p-orderlist-item |
+ An item in the list |
+
+
+
+
+
+ Dependencies
+ None.
+
+
+
+
+ View on GitHub
+
+
+
+<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>
+
+
+
+
+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));
+ }
+}
+
+
+
+.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;
+ }
+}
+
+
+
+
+
\ No newline at end of file