diff --git a/src/AppMenu.vue b/src/AppMenu.vue
index 4694c243a..bc33ede69 100644
--- a/src/AppMenu.vue
+++ b/src/AppMenu.vue
@@ -128,6 +128,7 @@
● MenuModel
● Breadcrumb
+
● ContextMenu
● Menu
● Menubar
● TieredMenu
diff --git a/src/components/contextmenu/ContextMenu.d.ts b/src/components/contextmenu/ContextMenu.d.ts
new file mode 100644
index 000000000..e69de29bb
diff --git a/src/components/contextmenu/ContextMenu.vue b/src/components/contextmenu/ContextMenu.vue
new file mode 100644
index 000000000..bda2f403d
--- /dev/null
+++ b/src/components/contextmenu/ContextMenu.vue
@@ -0,0 +1,260 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/contextmenu/ContextMenuSub.vue b/src/components/contextmenu/ContextMenuSub.vue
new file mode 100644
index 000000000..28f4aaba4
--- /dev/null
+++ b/src/components/contextmenu/ContextMenuSub.vue
@@ -0,0 +1,121 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main.js b/src/main.js
index ce0f97e4b..2c3103fb6 100644
--- a/src/main.js
+++ b/src/main.js
@@ -14,6 +14,7 @@ import Checkbox from './components/checkbox/Checkbox';
import Chips from './components/chips/Chips';
import Column from './components/column/Column';
import ColumnGroup from './components/columngroup/ColumnGroup';
+import ContextMenu from './components/contextmenu/ContextMenu';
import DataTable from './components/datatable/DataTable';
import DataView from './components/dataview/DataView';
import DataViewLayoutOptions from './components/dataviewlayoutoptions/DataViewLayoutOptions';
@@ -89,6 +90,8 @@ Vue.component('Chart', Chart);
Vue.component('Checkbox', Checkbox);
Vue.component('Chips', Chips);
Vue.component('Column', Column);
+Vue.component('ColumnGroup', ColumnGroup);
+Vue.component('ContextMenu', ContextMenu);
Vue.component('DataTable', DataTable);
Vue.component('DataView', DataView);
Vue.component('DataViewLayoutOptions', DataViewLayoutOptions);
@@ -99,7 +102,6 @@ Vue.component('Editor', Editor);
Vue.component('Fieldset', Fieldset);
Vue.component('FileUpload', FileUpload);
Vue.component('FullCalendar', FullCalendar);
-Vue.component('ColumnGroup', ColumnGroup);
Vue.component('Inplace', Inplace);
Vue.component('InputSwitch', InputSwitch);
Vue.component('InputText', InputText);
diff --git a/src/router.js b/src/router.js
index 25a4b8262..a28e3f99a 100644
--- a/src/router.js
+++ b/src/router.js
@@ -116,6 +116,11 @@ export default new Router({
name: 'chips',
component: () => import('./views/chips/ChipsDemo.vue')
},
+ {
+ path: '/contextmenu',
+ name: 'contextmenu',
+ component: () => import('./views/contextmenu/ContextMenuDemo.vue')
+ },
{
path: '/datatable',
name: 'datatable',
diff --git a/src/views/contextmenu/ContextMenuDemo.vue b/src/views/contextmenu/ContextMenuDemo.vue
new file mode 100644
index 000000000..365adee18
--- /dev/null
+++ b/src/views/contextmenu/ContextMenuDemo.vue
@@ -0,0 +1,167 @@
+
+
+
+
+
ContextMenu
+
ContextMenu displays an overlay menu on right click of its target. Note that components like DataTable has special integration with ContextMenu. Refer to documentation of the individual documentation of the components having a special integration.
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/views/contextmenu/ContextMenuDoc.vue b/src/views/contextmenu/ContextMenuDoc.vue
new file mode 100644
index 000000000..978f0be53
--- /dev/null
+++ b/src/views/contextmenu/ContextMenuDoc.vue
@@ -0,0 +1,456 @@
+
+
+
+
+ Import
+
+import TieredMenu from 'primevue/tieredmenu';
+
+
+ MenuModel
+ TieredMenu uses the common MenuModel API to define the items, visit MenuModel API for details.
+
+ Getting Started
+ TieredMenu requires a collection of menuitems as its model.
+
+<TieredMenu :model="items" />
+
+
+
+export default {
+ data() {
+ return {
+ items: [
+ {
+ label:'File',
+ icon:'pi pi-fw pi-file',
+ items:[
+ {
+ label:'New',
+ icon:'pi pi-fw pi-plus',
+ items:[
+ {
+ label:'Bookmark',
+ icon:'pi pi-fw pi-bookmark'
+ },
+ {
+ label:'Video',
+ icon:'pi pi-fw pi-video'
+ },
+
+ ]
+ },
+ {
+ label:'Delete',
+ icon:'pi pi-fw pi-trash'
+ },
+ {
+ separator:true
+ },
+ {
+ label:'Export',
+ icon:'pi pi-fw pi-external-link'
+ }
+ ]
+ },
+ {
+ label:'Edit',
+ icon:'pi pi-fw pi-pencil',
+ items:[
+ {
+ label:'Left',
+ icon:'pi pi-fw pi-align-left'
+ },
+ {
+ label:'Right',
+ icon:'pi pi-fw pi-align-right'
+ },
+ {
+ label:'Center',
+ icon:'pi pi-fw pi-align-center'
+ },
+ {
+ label:'Justify',
+ icon:'pi pi-fw pi-align-justify'
+ },
+
+ ]
+ },
+ {
+ label:'Users',
+ icon:'pi pi-fw pi-user',
+ items:[
+ {
+ label:'New',
+ icon:'pi pi-fw pi-user-plus',
+
+ },
+ {
+ label:'Delete',
+ icon:'pi pi-fw pi-user-minus',
+
+ },
+ {
+ label:'Search',
+ icon:'pi pi-fw pi-users',
+ items:[
+ {
+ label:'Filter',
+ icon:'pi pi-fw pi-filter',
+ items:[
+ {
+ label:'Print',
+ icon:'pi pi-fw pi-print'
+ }
+ ]
+ },
+ {
+ icon:'pi pi-fw pi-bars',
+ label:'List'
+ }
+ ]
+ }
+ ]
+ },
+ {
+ label:'Events',
+ icon:'pi pi-fw pi-calendar',
+ items:[
+ {
+ label:'Edit',
+ icon:'pi pi-fw pi-pencil',
+ items:[
+ {
+ label:'Save',
+ icon:'pi pi-fw pi-calendar-plus'
+ },
+ {
+ label:'Delete',
+ icon:'pi pi-fw pi-calendar-minus'
+ },
+
+ ]
+ },
+ {
+ label:'Archieve',
+ icon:'pi pi-fw pi-calendar-times',
+ items:[
+ {
+ label:'Remove',
+ icon:'pi pi-fw pi-calendar-minus'
+ }
+ ]
+ }
+ ]
+ },
+ {
+ separator:true
+ },
+ {
+ label:'Quit',
+ icon:'pi pi-fw pi-power-off'
+ }
+ ]
+ }
+ }
+}
+
+
+ Popup Mode
+ TieredMenu is inline by default whereas popup mode is supported by enabling popup property and calling toggle method with an event of the target.
+
+
+<Button type="button" label="Toggle" @click="toggle" />
+<TieredMenu ref="menu" :model="items" :popup="true" />
+
+
+
+toggle(event) {
+ this.$refs.menu.toggle(event);
+}
+
+
+ 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 |
+
+
+
+
+ model |
+ array |
+ null |
+ An array of menuitems. |
+
+
+ popup |
+ boolean |
+ false |
+ Defines if menu would displayed as a popup. |
+
+
+ appendTo |
+ string |
+ null |
+ DOM element instance where the dialog should be mounted. |
+
+
+ baseZIndex |
+ number |
+ 0 |
+ Base zIndex value to use in layering. |
+
+
+ autoZIndex |
+ boolean |
+ true |
+ Whether to automatically manage layering. |
+
+
+
+
+
+ Methods
+
+
+
+
+ Name |
+ Parameters |
+ Description |
+
+
+
+
+ toggle |
+ event: Browser event |
+ Toggles the visiblity of the overlay. |
+
+
+ show |
+ event: Browser event
+ target: Optional target if event.target would not be used |
+ Shows the overlay. |
+
+
+ hide |
+ - |
+ Hides the overlay. |
+
+
+
+
+
+ Styling
+ Following is the list of structural style classes, for theming classes visit theming page.
+
+
+
+
+ Name |
+ Element |
+
+
+
+
+ p-tieredmenu |
+ Container element. |
+
+
+ p-submenu-list |
+ Submenu list element. |
+
+
+ p-menuitem |
+ Menuitem element. |
+
+
+ p-menuitem-text |
+ Label of a menuitem. |
+
+
+ p-menuitem-icon |
+ Icon of a menuitem. |
+
+
+ p-submenu-icon |
+ Arrow icon of a submenu. |
+
+
+
+
+
+ Dependencies
+ None.
+
+
+
+
+ View on GitHub
+
+
+
+<h3>Inline</h3>
+<TieredMenu :model="items" />
+
+<h3>Overlay</h3>
+<Button type="button" label="Toggle" @click="toggle" />
+<TieredMenu ref="menu" :model="items" :popup="true" />
+
+
+
+
+export default {
+ data() {
+ return {
+ items: [
+ {
+ label:'File',
+ icon:'pi pi-fw pi-file',
+ items:[
+ {
+ label:'New',
+ icon:'pi pi-fw pi-plus',
+ items:[
+ {
+ label:'Bookmark',
+ icon:'pi pi-fw pi-bookmark'
+ },
+ {
+ label:'Video',
+ icon:'pi pi-fw pi-video'
+ },
+
+ ]
+ },
+ {
+ label:'Delete',
+ icon:'pi pi-fw pi-trash'
+ },
+ {
+ separator:true
+ },
+ {
+ label:'Export',
+ icon:'pi pi-fw pi-external-link'
+ }
+ ]
+ },
+ {
+ label:'Edit',
+ icon:'pi pi-fw pi-pencil',
+ items:[
+ {
+ label:'Left',
+ icon:'pi pi-fw pi-align-left'
+ },
+ {
+ label:'Right',
+ icon:'pi pi-fw pi-align-right'
+ },
+ {
+ label:'Center',
+ icon:'pi pi-fw pi-align-center'
+ },
+ {
+ label:'Justify',
+ icon:'pi pi-fw pi-align-justify'
+ },
+
+ ]
+ },
+ {
+ label:'Users',
+ icon:'pi pi-fw pi-user',
+ items:[
+ {
+ label:'New',
+ icon:'pi pi-fw pi-user-plus',
+
+ },
+ {
+ label:'Delete',
+ icon:'pi pi-fw pi-user-minus',
+
+ },
+ {
+ label:'Search',
+ icon:'pi pi-fw pi-users',
+ items:[
+ {
+ label:'Filter',
+ icon:'pi pi-fw pi-filter',
+ items:[
+ {
+ label:'Print',
+ icon:'pi pi-fw pi-print'
+ }
+ ]
+ },
+ {
+ icon:'pi pi-fw pi-bars',
+ label:'List'
+ }
+ ]
+ }
+ ]
+ },
+ {
+ label:'Events',
+ icon:'pi pi-fw pi-calendar',
+ items:[
+ {
+ label:'Edit',
+ icon:'pi pi-fw pi-pencil',
+ items:[
+ {
+ label:'Save',
+ icon:'pi pi-fw pi-calendar-plus'
+ },
+ {
+ label:'Delete',
+ icon:'pi pi-fw pi-calendar-minus'
+ },
+
+ ]
+ },
+ {
+ label:'Archieve',
+ icon:'pi pi-fw pi-calendar-times',
+ items:[
+ {
+ label:'Remove',
+ icon:'pi pi-fw pi-calendar-minus'
+ }
+ ]
+ }
+ ]
+ },
+ {
+ separator:true
+ },
+ {
+ label:'Quit',
+ icon:'pi pi-fw pi-power-off'
+ }
+ ]
+ }
+ },
+ methods: {
+ toggle(event) {
+ this.$refs.menu.toggle(event);
+ }
+ }
+}
+
+
+
+
+
\ No newline at end of file