primevue 3.8.2 → 3.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/api/Api.d.ts +70 -36
- package/api/api.cjs.js +66 -32
- package/api/api.cjs.min.js +1 -1
- package/api/api.esm.js +66 -32
- package/api/api.esm.min.js +1 -1
- package/api/api.js +66 -32
- package/api/api.min.js +1 -1
- package/autocomplete/AutoComplete.vue +16 -9
- package/autocomplete/autocomplete.cjs.js +19 -11
- package/autocomplete/autocomplete.cjs.min.js +1 -1
- package/autocomplete/autocomplete.esm.js +19 -11
- package/autocomplete/autocomplete.esm.min.js +1 -1
- package/autocomplete/autocomplete.js +19 -11
- package/autocomplete/autocomplete.min.js +1 -1
- package/breadcrumb/BreadcrumbItem.vue +5 -2
- package/breadcrumb/breadcrumb.cjs.js +5 -2
- package/breadcrumb/breadcrumb.cjs.min.js +1 -1
- package/breadcrumb/breadcrumb.esm.js +5 -2
- package/breadcrumb/breadcrumb.esm.min.js +1 -1
- package/breadcrumb/breadcrumb.js +5 -2
- package/breadcrumb/breadcrumb.min.js +1 -1
- package/calendar/Calendar.d.ts +6 -0
- package/calendar/Calendar.vue +362 -67
- package/calendar/calendar.cjs.js +459 -168
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.esm.js +461 -170
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +459 -168
- package/calendar/calendar.min.js +1 -1
- package/carousel/Carousel.vue +2 -2
- package/carousel/carousel.cjs.js +6 -6
- package/carousel/carousel.cjs.min.js +1 -1
- package/carousel/carousel.esm.js +6 -6
- package/carousel/carousel.esm.min.js +1 -1
- package/carousel/carousel.js +6 -6
- package/carousel/carousel.min.js +1 -1
- package/cascadeselect/CascadeSelect.d.ts +8 -4
- package/chart/Chart.vue +9 -2
- package/chart/chart.cjs.js +9 -2
- package/chart/chart.cjs.min.js +1 -1
- package/chart/chart.esm.js +9 -2
- package/chart/chart.esm.min.js +1 -1
- package/chart/chart.js +9 -2
- package/chart/chart.min.js +1 -1
- package/colorpicker/ColorPicker.d.ts +3 -0
- package/colorpicker/ColorPicker.vue +6 -1
- package/colorpicker/colorpicker.cjs.js +6 -1
- package/colorpicker/colorpicker.cjs.min.js +1 -1
- package/colorpicker/colorpicker.esm.js +6 -1
- package/colorpicker/colorpicker.esm.min.js +1 -1
- package/colorpicker/colorpicker.js +6 -1
- package/colorpicker/colorpicker.min.js +1 -1
- package/confirmdialog/ConfirmDialog.vue +8 -2
- package/confirmdialog/confirmdialog.cjs.js +11 -4
- package/confirmdialog/confirmdialog.cjs.min.js +1 -1
- package/confirmdialog/confirmdialog.esm.js +11 -4
- package/confirmdialog/confirmdialog.esm.min.js +1 -1
- package/confirmdialog/confirmdialog.js +11 -4
- package/confirmdialog/confirmdialog.min.js +1 -1
- package/confirmpopup/ConfirmPopup.d.ts +7 -0
- package/confirmpopup/ConfirmPopup.vue +7 -4
- package/confirmpopup/confirmpopup.cjs.js +13 -5
- package/confirmpopup/confirmpopup.cjs.min.js +1 -1
- package/confirmpopup/confirmpopup.esm.js +14 -6
- package/confirmpopup/confirmpopup.esm.min.js +1 -1
- package/confirmpopup/confirmpopup.js +13 -5
- package/confirmpopup/confirmpopup.min.js +1 -1
- package/contextmenu/ContextMenuSub.vue +7 -4
- package/contextmenu/contextmenu.cjs.js +7 -4
- package/contextmenu/contextmenu.cjs.min.js +1 -1
- package/contextmenu/contextmenu.esm.js +7 -4
- package/contextmenu/contextmenu.esm.min.js +1 -1
- package/contextmenu/contextmenu.js +7 -4
- package/contextmenu/contextmenu.min.js +1 -1
- package/core/core.js +132 -65
- package/core/core.min.js +14 -11
- package/datatable/BodyCell.vue +1 -0
- package/datatable/ColumnFilter.vue +17 -6
- package/datatable/DataTable.d.ts +5 -4
- package/datatable/DataTable.vue +34 -21
- package/datatable/TableBody.vue +5 -1
- package/datatable/TableFooter.vue +15 -1
- package/datatable/TableHeader.vue +15 -1
- package/datatable/datatable.cjs.js +175 -106
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.esm.js +175 -106
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +175 -106
- package/datatable/datatable.min.js +1 -1
- package/dataview/DataView.d.ts +2 -2
- package/dataview/DataView.vue +8 -8
- package/dataview/dataview.cjs.js +12 -12
- package/dataview/dataview.cjs.min.js +1 -1
- package/dataview/dataview.esm.js +12 -12
- package/dataview/dataview.esm.min.js +1 -1
- package/dataview/dataview.js +12 -12
- package/dataview/dataview.min.js +1 -1
- package/dropdown/Dropdown.d.ts +10 -5
- package/inputnumber/InputNumber.vue +19 -3
- package/inputnumber/inputnumber.cjs.js +19 -3
- package/inputnumber/inputnumber.cjs.min.js +1 -1
- package/inputnumber/inputnumber.esm.js +19 -3
- package/inputnumber/inputnumber.esm.min.js +1 -1
- package/inputnumber/inputnumber.js +19 -3
- package/inputnumber/inputnumber.min.js +1 -1
- package/inputtext/InputText.vue +1 -1
- package/inputtext/inputtext.cjs.js +2 -2
- package/inputtext/inputtext.cjs.min.js +1 -1
- package/inputtext/inputtext.esm.js +3 -3
- package/inputtext/inputtext.esm.min.js +1 -1
- package/inputtext/inputtext.js +2 -2
- package/inputtext/inputtext.min.js +1 -1
- package/listbox/Listbox.d.ts +10 -5
- package/megamenu/MegaMenu.vue +10 -7
- package/megamenu/megamenu.cjs.js +10 -7
- package/megamenu/megamenu.cjs.min.js +1 -1
- package/megamenu/megamenu.esm.js +10 -7
- package/megamenu/megamenu.esm.min.js +1 -1
- package/megamenu/megamenu.js +10 -7
- package/megamenu/megamenu.min.js +1 -1
- package/menu/Menu.vue +6 -3
- package/menu/Menuitem.vue +5 -2
- package/menu/menu.cjs.js +11 -5
- package/menu/menu.cjs.min.js +1 -1
- package/menu/menu.esm.js +11 -5
- package/menu/menu.esm.min.js +1 -1
- package/menu/menu.js +11 -5
- package/menu/menu.min.js +1 -1
- package/menubar/MenubarSub.vue +7 -4
- package/menubar/menubar.cjs.js +7 -4
- package/menubar/menubar.cjs.min.js +1 -1
- package/menubar/menubar.esm.js +7 -4
- package/menubar/menubar.esm.min.js +1 -1
- package/menubar/menubar.js +7 -4
- package/menubar/menubar.min.js +1 -1
- package/message/Message.d.ts +1 -0
- package/message/Message.vue +6 -2
- package/message/message.cjs.js +6 -2
- package/message/message.cjs.min.js +1 -1
- package/message/message.esm.js +6 -2
- package/message/message.esm.min.js +1 -1
- package/message/message.js +6 -2
- package/message/message.min.js +1 -1
- package/multiselect/MultiSelect.d.ts +10 -5
- package/orderlist/OrderList.d.ts +2 -0
- package/orderlist/OrderList.vue +2 -0
- package/orderlist/orderlist.cjs.js +3 -1
- package/orderlist/orderlist.cjs.min.js +1 -1
- package/orderlist/orderlist.esm.js +3 -1
- package/orderlist/orderlist.esm.min.js +1 -1
- package/orderlist/orderlist.js +3 -1
- package/orderlist/orderlist.min.js +1 -1
- package/package.json +5 -1
- package/paginator/Paginator.vue +4 -4
- package/paginator/paginator.cjs.js +4 -4
- package/paginator/paginator.cjs.min.js +1 -1
- package/paginator/paginator.esm.js +4 -4
- package/paginator/paginator.esm.min.js +1 -1
- package/paginator/paginator.js +4 -4
- package/paginator/paginator.min.js +1 -1
- package/panel/Panel.d.ts +1 -0
- package/panel/Panel.vue +1 -1
- package/panelmenu/PanelMenu.vue +6 -3
- package/panelmenu/PanelMenuSub.vue +8 -5
- package/panelmenu/panelmenu.cjs.js +14 -8
- package/panelmenu/panelmenu.cjs.min.js +1 -1
- package/panelmenu/panelmenu.esm.js +14 -8
- package/panelmenu/panelmenu.esm.min.js +1 -1
- package/panelmenu/panelmenu.js +14 -8
- package/panelmenu/panelmenu.min.js +1 -1
- package/picklist/PickList.d.ts +8 -2
- package/picklist/PickList.vue +10 -4
- package/picklist/picklist.cjs.js +13 -7
- package/picklist/picklist.cjs.min.js +1 -1
- package/picklist/picklist.esm.js +13 -7
- package/picklist/picklist.esm.min.js +1 -1
- package/picklist/picklist.js +13 -7
- package/picklist/picklist.min.js +1 -1
- package/progressbar/ProgressBar.vue +13 -12
- package/progressbar/progressbar.cjs.js +13 -12
- package/progressbar/progressbar.cjs.min.js +1 -1
- package/progressbar/progressbar.esm.js +14 -13
- package/progressbar/progressbar.esm.min.js +1 -1
- package/progressbar/progressbar.js +13 -12
- package/progressbar/progressbar.min.js +1 -1
- package/rating/Rating.vue +1 -1
- package/rating/rating.cjs.js +1 -1
- package/rating/rating.cjs.min.js +1 -1
- package/rating/rating.esm.js +1 -1
- package/rating/rating.esm.min.js +1 -1
- package/rating/rating.js +1 -1
- package/rating/rating.min.js +1 -1
- package/resources/primevue.css +5 -0
- package/resources/primevue.min.css +1 -1
- package/resources/themes/arya-blue/theme.css +56 -15
- package/resources/themes/arya-green/theme.css +56 -15
- package/resources/themes/arya-orange/theme.css +56 -15
- package/resources/themes/arya-purple/theme.css +56 -15
- package/resources/themes/bootstrap4-dark-blue/theme.css +53 -19
- package/resources/themes/bootstrap4-dark-purple/theme.css +53 -19
- package/resources/themes/bootstrap4-light-blue/theme.css +53 -19
- package/resources/themes/bootstrap4-light-purple/theme.css +53 -19
- package/resources/themes/fluent-light/theme.css +56 -15
- package/resources/themes/lara-dark-blue/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-dark-blue/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-dark-blue/theme.css +5414 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-dark-indigo/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-dark-indigo/theme.css +5414 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-dark-purple/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-dark-purple/theme.css +5414 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-dark-teal/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-dark-teal/theme.css +5414 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-light-blue/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-light-blue/theme.css +5414 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-light-indigo/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-light-indigo/theme.css +5414 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-light-purple/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-light-purple/theme.css +5414 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Light.woff +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Light.woff2 +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/lara-light-teal/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/lara-light-teal/theme.css +5414 -0
- package/resources/themes/luna-amber/theme.css +53 -19
- package/resources/themes/luna-blue/theme.css +53 -19
- package/resources/themes/luna-green/theme.css +53 -19
- package/resources/themes/luna-pink/theme.css +53 -19
- package/resources/themes/md-dark-deeppurple/theme.css +244 -47
- package/resources/themes/md-dark-indigo/theme.css +244 -47
- package/resources/themes/md-light-deeppurple/theme.css +244 -47
- package/resources/themes/md-light-indigo/theme.css +244 -47
- package/resources/themes/mdc-dark-deeppurple/theme.css +244 -47
- package/resources/themes/mdc-dark-indigo/theme.css +244 -47
- package/resources/themes/mdc-light-deeppurple/theme.css +244 -47
- package/resources/themes/mdc-light-indigo/theme.css +244 -47
- package/resources/themes/nova/theme.css +53 -19
- package/resources/themes/nova-accent/theme.css +53 -19
- package/resources/themes/nova-alt/theme.css +53 -19
- package/resources/themes/nova-vue/theme.css +53 -19
- package/resources/themes/rhea/theme.css +53 -19
- package/resources/themes/saga-blue/theme.css +56 -15
- package/resources/themes/saga-green/theme.css +56 -15
- package/resources/themes/saga-orange/theme.css +56 -15
- package/resources/themes/saga-purple/theme.css +56 -15
- package/resources/themes/tailwind-light/theme.css +67 -18
- package/resources/themes/vela-blue/theme.css +56 -15
- package/resources/themes/vela-green/theme.css +56 -15
- package/resources/themes/vela-orange/theme.css +56 -15
- package/resources/themes/vela-purple/theme.css +56 -15
- package/selectbutton/SelectButton.d.ts +8 -3
- package/selectbutton/SelectButton.vue +8 -2
- package/selectbutton/selectbutton.cjs.js +14 -9
- package/selectbutton/selectbutton.cjs.min.js +1 -1
- package/selectbutton/selectbutton.esm.js +14 -9
- package/selectbutton/selectbutton.esm.min.js +1 -1
- package/selectbutton/selectbutton.js +14 -9
- package/selectbutton/selectbutton.min.js +1 -1
- package/steps/Steps.vue +5 -2
- package/steps/steps.cjs.js +5 -2
- package/steps/steps.cjs.min.js +1 -1
- package/steps/steps.esm.js +5 -2
- package/steps/steps.esm.min.js +1 -1
- package/steps/steps.js +5 -2
- package/steps/steps.min.js +1 -1
- package/tabmenu/TabMenu.vue +6 -3
- package/tabmenu/tabmenu.cjs.js +6 -3
- package/tabmenu/tabmenu.cjs.min.js +1 -1
- package/tabmenu/tabmenu.esm.js +6 -3
- package/tabmenu/tabmenu.esm.min.js +1 -1
- package/tabmenu/tabmenu.js +6 -3
- package/tabmenu/tabmenu.min.js +1 -1
- package/terminalservice/TerminalService.d.ts +9 -6
- package/tieredmenu/TieredMenuSub.vue +7 -4
- package/tieredmenu/tieredmenu.cjs.js +7 -4
- package/tieredmenu/tieredmenu.cjs.min.js +1 -1
- package/tieredmenu/tieredmenu.esm.js +7 -4
- package/tieredmenu/tieredmenu.esm.min.js +1 -1
- package/tieredmenu/tieredmenu.js +7 -4
- package/tieredmenu/tieredmenu.min.js +1 -1
- package/tree/TreeNode.vue +4 -1
- package/tree/tree.cjs.js +4 -1
- package/tree/tree.cjs.min.js +1 -1
- package/tree/tree.esm.js +4 -1
- package/tree/tree.esm.min.js +1 -1
- package/tree/tree.js +4 -1
- package/tree/tree.min.js +1 -1
- package/treeselect/TreeSelect.vue +9 -0
- package/treeselect/treeselect.cjs.js +9 -0
- package/treeselect/treeselect.cjs.min.js +1 -1
- package/treeselect/treeselect.esm.js +9 -0
- package/treeselect/treeselect.esm.min.js +1 -1
- package/treeselect/treeselect.js +9 -0
- package/treeselect/treeselect.min.js +1 -1
- package/treetable/TreeTable.d.ts +2 -2
- package/treetable/TreeTable.vue +8 -8
- package/treetable/treetable.cjs.js +12 -12
- package/treetable/treetable.cjs.min.js +1 -1
- package/treetable/treetable.esm.js +12 -12
- package/treetable/treetable.esm.min.js +1 -1
- package/treetable/treetable.js +12 -12
- package/treetable/treetable.min.js +1 -1
- package/vetur-attributes.json +8 -0
- package/vetur-tags.json +3 -1
- package/web-types.json +143 -9
package/menu/menu.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primevue=this.primevue||{},this.primevue.menu=function(e,t,i,n){"use strict";function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=l(t),r={name:"Menuitem",inheritAttrs:!1,emits:["click"],props:{item:null,template:null,exact:null},methods:{onClick(e,t){this.$emit("click",{originalEvent:e,item:this.item,navigate:t})},linkClass(e,t){return["p-menuitem-link",{"p-disabled":this.disabled(e),"router-link-active":t&&t.isActive,"router-link-active-exact":this.exact&&t&&t.isExactActive}]},visible(){return"function"==typeof this.item.visible?this.item.visible():!1!==this.item.visible},disabled:e=>"function"==typeof e.disabled?e.disabled():e.disabled},computed:{containerClass(){return["p-menuitem",this.item.class]}},directives:{ripple:l(i).default}};const o={class:"p-menuitem-text"},a={class:"p-menuitem-text"};r.render=function(e,t,i,l,s,r){const c=n.resolveComponent("router-link"),d=n.resolveDirective("ripple");return r.visible()?(n.openBlock(),n.createBlock("li",{key:0,class:r.containerClass,role:"none",style:i.item.style},[i.template?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(i.template),{key:1,item:i.item},null,8,["item"])):(n.openBlock(),n.createBlock(n.Fragment,{key:0},[i.item.to&&!r.disabled(i.item)?(n.openBlock(),n.createBlock(c,{key:0,to:i.item.to,custom:""},{default:n.withCtx((({navigate:e,href:t,isActive:l,isExactActive:s})=>[n.withDirectives(n.createVNode("a",{href:t,onClick:t=>r.onClick(t,e),class:r.linkClass(i.item,{isActive:l,isExactActive:s}),role:"menuitem"},[n.createVNode("span",{class:["p-menuitem-icon",i.item.icon]},null,2),n.createVNode("span",o,n.toDisplayString(
|
|
1
|
+
this.primevue=this.primevue||{},this.primevue.menu=function(e,t,i,n){"use strict";function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=l(t),r={name:"Menuitem",inheritAttrs:!1,emits:["click"],props:{item:null,template:null,exact:null},methods:{onClick(e,t){this.$emit("click",{originalEvent:e,item:this.item,navigate:t})},linkClass(e,t){return["p-menuitem-link",{"p-disabled":this.disabled(e),"router-link-active":t&&t.isActive,"router-link-active-exact":this.exact&&t&&t.isExactActive}]},visible(){return"function"==typeof this.item.visible?this.item.visible():!1!==this.item.visible},disabled:e=>"function"==typeof e.disabled?e.disabled():e.disabled,label(){return"function"==typeof this.item.label?this.item.label():this.item.label}},computed:{containerClass(){return["p-menuitem",this.item.class]}},directives:{ripple:l(i).default}};const o={class:"p-menuitem-text"},a={class:"p-menuitem-text"};r.render=function(e,t,i,l,s,r){const c=n.resolveComponent("router-link"),d=n.resolveDirective("ripple");return r.visible()?(n.openBlock(),n.createBlock("li",{key:0,class:r.containerClass,role:"none",style:i.item.style},[i.template?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(i.template),{key:1,item:i.item},null,8,["item"])):(n.openBlock(),n.createBlock(n.Fragment,{key:0},[i.item.to&&!r.disabled(i.item)?(n.openBlock(),n.createBlock(c,{key:0,to:i.item.to,custom:""},{default:n.withCtx((({navigate:e,href:t,isActive:l,isExactActive:s})=>[n.withDirectives(n.createVNode("a",{href:t,onClick:t=>r.onClick(t,e),class:r.linkClass(i.item,{isActive:l,isExactActive:s}),role:"menuitem"},[n.createVNode("span",{class:["p-menuitem-icon",i.item.icon]},null,2),n.createVNode("span",o,n.toDisplayString(r.label()),1)],10,["href","onClick"]),[[d]])])),_:1},8,["to"])):n.withDirectives((n.openBlock(),n.createBlock("a",{key:1,href:i.item.url,class:r.linkClass(i.item),onClick:t[1]||(t[1]=(...e)=>r.onClick&&r.onClick(...e)),target:i.item.target,role:"menuitem",tabindex:r.disabled(i.item)?null:"0"},[n.createVNode("span",{class:["p-menuitem-icon",i.item.icon]},null,2),n.createVNode("span",a,n.toDisplayString(r.label()),1)],10,["href","target","tabindex"])),[[d]])],64))],6)):n.createCommentVNode("",!0)};var c={name:"Menu",emits:["show","hide"],inheritAttrs:!1,props:{popup:{type:Boolean,default:!1},model:{type:Array,default:null},appendTo:{type:String,default:"body"},autoZIndex:{type:Boolean,default:!0},baseZIndex:{type:Number,default:0},exact:{type:Boolean,default:!0}},data:()=>({overlayVisible:!1}),target:null,outsideClickListener:null,scrollHandler:null,resizeListener:null,container:null,beforeUnmount(){this.unbindResizeListener(),this.unbindOutsideClickListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.target=null,this.container&&this.autoZIndex&&e.ZIndexUtils.clear(this.container),this.container=null},methods:{itemClick(e){const t=e.item;t.disabled||(t.command&&t.command(e),t.to&&e.navigate&&e.navigate(e.originalEvent),this.hide())},toggle(e){this.overlayVisible?this.hide():this.show(e)},show(e){this.overlayVisible=!0,this.target=e.currentTarget},hide(){this.overlayVisible=!1,this.target=null},onEnter(t){this.alignOverlay(),this.bindOutsideClickListener(),this.bindResizeListener(),this.bindScrollListener(),this.autoZIndex&&e.ZIndexUtils.set("menu",t,this.baseZIndex+this.$primevue.config.zIndex.menu),this.$emit("show")},onLeave(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.unbindScrollListener(),this.$emit("hide")},onAfterLeave(t){this.autoZIndex&&e.ZIndexUtils.clear(t)},alignOverlay(){e.DomHandler.absolutePosition(this.container,this.target),this.container.style.minWidth=e.DomHandler.getOuterWidth(this.target)+"px"},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{this.overlayVisible&&this.container&&!this.container.contains(e.target)&&!this.isTargetClicked(e)&&this.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new e.ConnectedOverlayScrollHandler(this.target,(()=>{this.overlayVisible&&this.hide()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&this.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},isTargetClicked(){return this.target&&(this.target===event.target||this.target.contains(event.target))},visible:e=>"function"==typeof e.visible?e.visible():!1!==e.visible,label:e=>"function"==typeof e.label?e.label():e.label,containerRef(e){this.container=e},onOverlayClick(e){s.default.emit("overlay-click",{originalEvent:e,target:this.target})}},computed:{containerClass(){return["p-menu p-component",{"p-menu-overlay":this.popup,"p-input-filled":"filled"===this.$primevue.config.inputStyle,"p-ripple-disabled":!1===this.$primevue.config.ripple}]}},components:{Menuitem:r}};const d={class:"p-menu-list p-reset",role:"menu"},m={key:0,class:"p-submenu-header"};return function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],l=document.createElement("style");l.type="text/css","top"===i&&n.firstChild?n.insertBefore(l,n.firstChild):n.appendChild(l),l.styleSheet?l.styleSheet.cssText=e:l.appendChild(document.createTextNode(e))}}("\n.p-menu-overlay {\n position: absolute;\n top: 0;\n left: 0;\n}\n.p-menu ul {\n margin: 0;\n padding: 0;\n list-style: none;\n}\n.p-menu .p-menuitem-link {\n cursor: pointer;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n text-decoration: none;\n overflow: hidden;\n position: relative;\n}\n.p-menu .p-menuitem-text {\n line-height: 1;\n}\n"),c.render=function(e,t,i,l,s,r){const o=n.resolveComponent("Menuitem");return n.openBlock(),n.createBlock(n.Teleport,{to:i.appendTo,disabled:!i.popup},[n.createVNode(n.Transition,{name:"p-connected-overlay",onEnter:r.onEnter,onLeave:r.onLeave,onAfterLeave:r.onAfterLeave},{default:n.withCtx((()=>[!i.popup||s.overlayVisible?(n.openBlock(),n.createBlock("div",n.mergeProps({key:0,ref:r.containerRef,class:r.containerClass},e.$attrs,{onClick:t[1]||(t[1]=(...e)=>r.onOverlayClick&&r.onOverlayClick(...e))}),[n.createVNode("ul",d,[(n.openBlock(!0),n.createBlock(n.Fragment,null,n.renderList(i.model,((t,l)=>(n.openBlock(),n.createBlock(n.Fragment,{key:r.label(t)+l.toString()},[t.items&&r.visible(t)&&!t.separator?(n.openBlock(),n.createBlock(n.Fragment,{key:0},[t.items?(n.openBlock(),n.createBlock("li",m,[n.renderSlot(e.$slots,"item",{item:t},(()=>[n.createTextVNode(n.toDisplayString(r.label(t)),1)]))])):n.createCommentVNode("",!0),(n.openBlock(!0),n.createBlock(n.Fragment,null,n.renderList(t.items,((t,s)=>(n.openBlock(),n.createBlock(n.Fragment,{key:t.label+l+s},[r.visible(t)&&!t.separator?(n.openBlock(),n.createBlock(o,{key:0,item:t,onClick:r.itemClick,template:e.$slots.item,exact:i.exact},null,8,["item","onClick","template","exact"])):r.visible(t)&&t.separator?(n.openBlock(),n.createBlock("li",{class:["p-menu-separator",t.class],style:t.style,key:"separator"+l+s,role:"separator"},null,6)):n.createCommentVNode("",!0)],64)))),128))],64)):r.visible(t)&&t.separator?(n.openBlock(),n.createBlock("li",{class:["p-menu-separator",t.class],style:t.style,key:"separator"+l.toString(),role:"separator"},null,6)):(n.openBlock(),n.createBlock(o,{key:r.label(t)+l.toString(),item:t,onClick:r.itemClick,template:e.$slots.item,exact:i.exact},null,8,["item","onClick","template","exact"]))],64)))),128))])],16)):n.createCommentVNode("",!0)])),_:3},8,["onEnter","onLeave","onAfterLeave"])],8,["to","disabled"])},c}(primevue.utils,primevue.overlayeventbus,primevue.ripple,Vue);
|
package/menubar/MenubarSub.vue
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<ul :class="containerClass" :role="root ? 'menubar' : 'menu'">
|
|
3
|
-
<template v-for="(item, i) of model" :key="item
|
|
3
|
+
<template v-for="(item, i) of model" :key="label(item) + i.toString()">
|
|
4
4
|
<li role="none" :class="getItemClass(item)" :style="item.style" v-if="visible(item) && !item.separator"
|
|
5
5
|
@mouseenter="onItemMouseEnter($event, item)">
|
|
6
6
|
<template v-if="!template">
|
|
7
7
|
<router-link v-if="item.to && !disabled(item)" :to="item.to" custom v-slot="{navigate, href, isActive, isExactActive}">
|
|
8
8
|
<a :href="href" @click="onItemClick($event, item, navigate)" :class="linkClass(item, {isActive, isExactActive})" v-ripple @keydown="onItemKeyDown($event, item)" role="menuitem">
|
|
9
9
|
<span :class="['p-menuitem-icon', item.icon]"></span>
|
|
10
|
-
<span class="p-menuitem-text">{{item
|
|
10
|
+
<span class="p-menuitem-text">{{label(item)}}</span>
|
|
11
11
|
</a>
|
|
12
12
|
</router-link>
|
|
13
13
|
<a v-else :href="item.url" :class="linkClass(item)" :target="item.target" :aria-haspopup="item.items != null" :aria-expanded="item === activeItem"
|
|
14
14
|
@click="onItemClick($event, item)" @keydown="onItemKeyDown($event, item)" role="menuitem" :tabindex="disabled(item) ? null : '0'" v-ripple>
|
|
15
15
|
<span :class="['p-menuitem-icon', item.icon]"></span>
|
|
16
|
-
<span class="p-menuitem-text">{{item
|
|
16
|
+
<span class="p-menuitem-text">{{label(item)}}</span>
|
|
17
17
|
<span :class="getSubmenuIcon()" v-if="item.items"></span>
|
|
18
18
|
</a>
|
|
19
19
|
</template>
|
|
20
20
|
<component v-else :is="template" :item="item"></component>
|
|
21
|
-
<MenubarSub :model="item.items" v-if="visible(item) && item.items" :key="item
|
|
21
|
+
<MenubarSub :model="item.items" v-if="visible(item) && item.items" :key="label(item) + '_sub_'" :mobileActive="mobileActive"
|
|
22
22
|
@leaf-click="onLeafClick" @keydown-item="onChildItemKeyDown" :parentActive="item === activeItem" :template="template" :exact="exact" />
|
|
23
23
|
</li>
|
|
24
24
|
<li :class="['p-menu-separator', item.class]" :style="item.style" v-if="visible(item) && item.separator" :key="'separator' + i.toString()" role="separator"></li>
|
|
@@ -289,6 +289,9 @@ export default {
|
|
|
289
289
|
},
|
|
290
290
|
disabled(item) {
|
|
291
291
|
return (typeof item.disabled === 'function' ? item.disabled() : item.disabled);
|
|
292
|
+
},
|
|
293
|
+
label(item) {
|
|
294
|
+
return (typeof item.label === 'function' ? item.label() : item.label);
|
|
292
295
|
}
|
|
293
296
|
},
|
|
294
297
|
computed: {
|
package/menubar/menubar.cjs.js
CHANGED
|
@@ -264,6 +264,9 @@ var script$1 = {
|
|
|
264
264
|
},
|
|
265
265
|
disabled(item) {
|
|
266
266
|
return (typeof item.disabled === 'function' ? item.disabled() : item.disabled);
|
|
267
|
+
},
|
|
268
|
+
label(item) {
|
|
269
|
+
return (typeof item.label === 'function' ? item.label() : item.label);
|
|
267
270
|
}
|
|
268
271
|
},
|
|
269
272
|
computed: {
|
|
@@ -290,7 +293,7 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
290
293
|
}, [
|
|
291
294
|
(vue.openBlock(true), vue.createBlock(vue.Fragment, null, vue.renderList($props.model, (item, i) => {
|
|
292
295
|
return (vue.openBlock(), vue.createBlock(vue.Fragment, {
|
|
293
|
-
key:
|
|
296
|
+
key: $options.label(item) + i.toString()
|
|
294
297
|
}, [
|
|
295
298
|
($options.visible(item) && !item.separator)
|
|
296
299
|
? (vue.openBlock(), vue.createBlock("li", {
|
|
@@ -319,7 +322,7 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
319
322
|
vue.createVNode("span", {
|
|
320
323
|
class: ['p-menuitem-icon', item.icon]
|
|
321
324
|
}, null, 2),
|
|
322
|
-
vue.createVNode("span", _hoisted_1$1, vue.toDisplayString(
|
|
325
|
+
vue.createVNode("span", _hoisted_1$1, vue.toDisplayString($options.label(item)), 1)
|
|
323
326
|
], 42, ["href", "onClick", "onKeydown"]), [
|
|
324
327
|
[_directive_ripple]
|
|
325
328
|
])
|
|
@@ -341,7 +344,7 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
341
344
|
vue.createVNode("span", {
|
|
342
345
|
class: ['p-menuitem-icon', item.icon]
|
|
343
346
|
}, null, 2),
|
|
344
|
-
vue.createVNode("span", _hoisted_2$1, vue.toDisplayString(
|
|
347
|
+
vue.createVNode("span", _hoisted_2$1, vue.toDisplayString($options.label(item)), 1),
|
|
345
348
|
(item.items)
|
|
346
349
|
? (vue.openBlock(), vue.createBlock("span", {
|
|
347
350
|
key: 0,
|
|
@@ -359,7 +362,7 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
359
362
|
($options.visible(item) && item.items)
|
|
360
363
|
? (vue.openBlock(), vue.createBlock(_component_MenubarSub, {
|
|
361
364
|
model: item.items,
|
|
362
|
-
key:
|
|
365
|
+
key: $options.label(item) + '_sub_',
|
|
363
366
|
mobileActive: $props.mobileActive,
|
|
364
367
|
onLeafClick: $options.onLeafClick,
|
|
365
368
|
onKeydownItem: $options.onChildItemKeyDown,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("primevue/utils"),t=require("primevue/ripple"),n=require("vue");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l={name:"MenubarSub",emits:["keydown-item","leaf-click"],props:{model:{type:Array,default:null},root:{type:Boolean,default:!1},popup:{type:Boolean,default:!1},parentActive:{type:Boolean,default:!1},mobileActive:{type:Boolean,default:!1},template:{type:Function,default:null},exact:{type:Boolean,default:!0}},documentClickListener:null,watch:{parentActive(e){e||(this.activeItem=null)}},data:()=>({activeItem:null}),updated(){this.root&&this.activeItem&&this.bindDocumentClickListener()},beforeUnmount(){this.unbindDocumentClickListener()},methods:{onItemMouseEnter(e,t){this.disabled(t)||this.mobileActive?e.preventDefault():this.root?(this.activeItem||this.popup)&&(this.activeItem=t):this.activeItem=t},onItemClick(e,t,n){this.disabled(t)?e.preventDefault():(t.command&&t.command({originalEvent:e,item:t}),t.items&&(this.activeItem&&t===this.activeItem?this.activeItem=null:this.activeItem=t),t.items||this.onLeafClick(),t.to&&n&&n(e))},onLeafClick(){this.activeItem=null,this.$emit("leaf-click")},onItemKeyDown(e,t){let n=e.currentTarget.parentElement;switch(e.which){case 40:this.root?t.items&&this.expandSubmenu(t,n):this.navigateToNextItem(n),e.preventDefault();break;case 38:this.root||this.navigateToPrevItem(n),e.preventDefault();break;case 39:if(this.root){var i=this.findNextItem(n);i&&i.children[0].focus()}else t.items&&this.expandSubmenu(t,n);e.preventDefault();break;case 37:this.root&&this.navigateToPrevItem(n),e.preventDefault()}this.$emit("keydown-item",{originalEvent:e,element:n})},onChildItemKeyDown(e){this.root?38===e.originalEvent.which&&null==e.element.previousElementSibling&&this.collapseMenu(e.element):37===e.originalEvent.which&&this.collapseMenu(e.element)},findNextItem(t){let n=t.nextElementSibling;return n?e.DomHandler.hasClass(n,"p-disabled")||!e.DomHandler.hasClass(n,"p-menuitem")?this.findNextItem(n):n:null},findPrevItem(t){let n=t.previousElementSibling;return n?e.DomHandler.hasClass(n,"p-disabled")||!e.DomHandler.hasClass(n,"p-menuitem")?this.findPrevItem(n):n:null},expandSubmenu(e,t){this.activeItem=e,setTimeout((()=>{t.children[1].children[0].children[0].focus()}),50)},collapseMenu(e){this.activeItem=null,e.parentElement.previousElementSibling.focus()},navigateToNextItem(e){var t=this.findNextItem(e);t&&t.children[0].focus()},navigateToPrevItem(e){var t=this.findPrevItem(e);t&&t.children[0].focus()},getItemClass(e){return["p-menuitem",e.class,{"p-menuitem-active":this.activeItem===e}]},linkClass(e,t){return["p-menuitem-link",{"p-disabled":this.disabled(e),"router-link-active":t&&t.isActive,"router-link-active-exact":this.exact&&t&&t.isExactActive}]},bindDocumentClickListener(){this.documentClickListener||(this.documentClickListener=e=>{this.$el&&!this.$el.contains(e.target)&&(this.activeItem=null,this.unbindDocumentClickListener())},document.addEventListener("click",this.documentClickListener))},unbindDocumentClickListener(){this.documentClickListener&&(document.removeEventListener("click",this.documentClickListener),this.documentClickListener=null)},getSubmenuIcon(){return["p-submenu-icon pi",{"pi-angle-right":!this.root,"pi-angle-down":this.root}]},visible:e=>"function"==typeof e.visible?e.visible():!1!==e.visible,disabled:e=>"function"==typeof e.disabled?e.disabled():e.disabled},computed:{containerClass(){return{"p-submenu-list":!this.root,"p-menubar-root-list":this.root}}},directives:{ripple:i(t).default}};const o={class:"p-menuitem-text"},s={class:"p-menuitem-text"};l.render=function(e,t,i,l,a,r){const c=n.resolveComponent("router-link"),m=n.resolveComponent("MenubarSub",!0),u=n.resolveDirective("ripple");return n.openBlock(),n.createBlock("ul",{class:r.containerClass,role:i.root?"menubar":"menu"},[(n.openBlock(!0),n.createBlock(n.Fragment,null,n.renderList(i.model,((e,t)=>(n.openBlock(),n.createBlock(n.Fragment,{key:e.label+t.toString()},[r.visible(e)&&!e.separator?(n.openBlock(),n.createBlock("li",{key:0,role:"none",class:r.getItemClass(e),style:e.style,onMouseenter:t=>r.onItemMouseEnter(t,e)},[i.template?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(i.template),{key:1,item:e},null,8,["item"])):(n.openBlock(),n.createBlock(n.Fragment,{key:0},[e.to&&!r.disabled(e)?(n.openBlock(),n.createBlock(c,{key:0,to:e.to,custom:""},{default:n.withCtx((({navigate:t,href:i,isActive:l,isExactActive:s})=>[n.withDirectives(n.createVNode("a",{href:i,onClick:n=>r.onItemClick(n,e,t),class:r.linkClass(e,{isActive:l,isExactActive:s}),onKeydown:t=>r.onItemKeyDown(t,e),role:"menuitem"},[n.createVNode("span",{class:["p-menuitem-icon",e.icon]},null,2),n.createVNode("span",o,n.toDisplayString(e.label),1)],42,["href","onClick","onKeydown"]),[[u]])])),_:2},1032,["to"])):n.withDirectives((n.openBlock(),n.createBlock("a",{key:1,href:e.url,class:r.linkClass(e),target:e.target,"aria-haspopup":null!=e.items,"aria-expanded":e===a.activeItem,onClick:t=>r.onItemClick(t,e),onKeydown:t=>r.onItemKeyDown(t,e),role:"menuitem",tabindex:r.disabled(e)?null:"0"},[n.createVNode("span",{class:["p-menuitem-icon",e.icon]},null,2),n.createVNode("span",s,n.toDisplayString(e.label),1),e.items?(n.openBlock(),n.createBlock("span",{key:0,class:r.getSubmenuIcon()},null,2)):n.createCommentVNode("",!0)],42,["href","target","aria-haspopup","aria-expanded","onClick","onKeydown","tabindex"])),[[u]])],64)),r.visible(e)&&e.items?(n.openBlock(),n.createBlock(m,{model:e.items,key:e.label+"_sub_",mobileActive:i.mobileActive,onLeafClick:r.onLeafClick,onKeydownItem:r.onChildItemKeyDown,parentActive:e===a.activeItem,template:i.template,exact:i.exact},null,8,["model","mobileActive","onLeafClick","onKeydownItem","parentActive","template","exact"])):n.createCommentVNode("",!0)],46,["onMouseenter"])):n.createCommentVNode("",!0),r.visible(e)&&e.separator?(n.openBlock(),n.createBlock("li",{class:["p-menu-separator",e.class],style:e.style,key:"separator"+t.toString(),role:"separator"},null,6)):n.createCommentVNode("",!0)],64)))),128))],10,["role"])};var a={name:"Menubar",props:{model:{type:Array,default:null},exact:{type:Boolean,default:!0}},outsideClickListener:null,data:()=>({mobileActive:!1}),beforeUnmount(){this.mobileActive=!1,this.unbindOutsideClickListener(),this.$refs.rootmenu&&this.$refs.rootmenu.$el&&e.ZIndexUtils.clear(this.$refs.rootmenu.$el)},methods:{toggle(t){this.mobileActive?(this.mobileActive=!1,e.ZIndexUtils.clear(this.$refs.rootmenu.$el)):(this.mobileActive=!0,e.ZIndexUtils.set("menu",this.$refs.rootmenu.$el,this.$primevue.config.zIndex.menu)),this.bindOutsideClickListener(),t.preventDefault()},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{!this.mobileActive||this.$refs.rootmenu.$el===e.target||this.$refs.rootmenu.$el.contains(e.target)||this.$refs.menubutton===e.target||this.$refs.menubutton.contains(e.target)||(this.mobileActive=!1)},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},onLeafClick(){this.mobileActive=!1}},computed:{containerClass(){return["p-menubar p-component",{"p-menubar-mobile-active":this.mobileActive}]}},components:{MenubarSub:l}};const r={key:0,class:"p-menubar-start"},c=n.createVNode("i",{class:"pi pi-bars"},null,-1),m={key:1,class:"p-menubar-end"};!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],l=document.createElement("style");l.type="text/css","top"===n&&i.firstChild?i.insertBefore(l,i.firstChild):i.appendChild(l),l.styleSheet?l.styleSheet.cssText=e:l.appendChild(document.createTextNode(e))}}("\n.p-menubar {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n}\n.p-menubar ul {\n margin: 0;\n padding: 0;\n list-style: none;\n}\n.p-menubar .p-menuitem-link {\n cursor: pointer;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n text-decoration: none;\n overflow: hidden;\n position: relative;\n}\n.p-menubar .p-menuitem-text {\n line-height: 1;\n}\n.p-menubar .p-menuitem {\n position: relative;\n}\n.p-menubar-root-list {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n}\n.p-menubar-root-list > li ul {\n display: none;\n z-index: 1;\n}\n.p-menubar-root-list > .p-menuitem-active > .p-submenu-list {\n display: block;\n}\n.p-menubar .p-submenu-list {\n display: none;\n position: absolute;\n z-index: 1;\n}\n.p-menubar .p-submenu-list > .p-menuitem-active > .p-submenu-list {\n display: block;\n left: 100%;\n top: 0;\n}\n.p-menubar .p-submenu-list .p-menuitem-link .p-submenu-icon {\n margin-left: auto;\n}\n.p-menubar .p-menubar-custom,\n.p-menubar .p-menubar-end {\n margin-left: auto;\n -ms-flex-item-align: center;\n align-self: center;\n}\n.p-menubar-button {\n display: none;\n cursor: pointer;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n}\n"),a.render=function(e,t,i,l,o,s){const a=n.resolveComponent("MenubarSub");return n.openBlock(),n.createBlock("div",{class:s.containerClass},[e.$slots.start?(n.openBlock(),n.createBlock("div",r,[n.renderSlot(e.$slots,"start")])):n.createCommentVNode("",!0),n.createVNode("a",{ref:"menubutton",tabindex:"0",class:"p-menubar-button",onClick:t[1]||(t[1]=e=>s.toggle(e))},[c],512),n.createVNode(a,{ref:"rootmenu",model:i.model,root:!0,mobileActive:o.mobileActive,onLeafClick:s.onLeafClick,template:e.$slots.item,exact:i.exact},null,8,["model","mobileActive","onLeafClick","template","exact"]),e.$slots.end?(n.openBlock(),n.createBlock("div",m,[n.renderSlot(e.$slots,"end")])):n.createCommentVNode("",!0)],2)},module.exports=a;
|
|
1
|
+
"use strict";var e=require("primevue/utils"),t=require("primevue/ripple"),n=require("vue");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l={name:"MenubarSub",emits:["keydown-item","leaf-click"],props:{model:{type:Array,default:null},root:{type:Boolean,default:!1},popup:{type:Boolean,default:!1},parentActive:{type:Boolean,default:!1},mobileActive:{type:Boolean,default:!1},template:{type:Function,default:null},exact:{type:Boolean,default:!0}},documentClickListener:null,watch:{parentActive(e){e||(this.activeItem=null)}},data:()=>({activeItem:null}),updated(){this.root&&this.activeItem&&this.bindDocumentClickListener()},beforeUnmount(){this.unbindDocumentClickListener()},methods:{onItemMouseEnter(e,t){this.disabled(t)||this.mobileActive?e.preventDefault():this.root?(this.activeItem||this.popup)&&(this.activeItem=t):this.activeItem=t},onItemClick(e,t,n){this.disabled(t)?e.preventDefault():(t.command&&t.command({originalEvent:e,item:t}),t.items&&(this.activeItem&&t===this.activeItem?this.activeItem=null:this.activeItem=t),t.items||this.onLeafClick(),t.to&&n&&n(e))},onLeafClick(){this.activeItem=null,this.$emit("leaf-click")},onItemKeyDown(e,t){let n=e.currentTarget.parentElement;switch(e.which){case 40:this.root?t.items&&this.expandSubmenu(t,n):this.navigateToNextItem(n),e.preventDefault();break;case 38:this.root||this.navigateToPrevItem(n),e.preventDefault();break;case 39:if(this.root){var i=this.findNextItem(n);i&&i.children[0].focus()}else t.items&&this.expandSubmenu(t,n);e.preventDefault();break;case 37:this.root&&this.navigateToPrevItem(n),e.preventDefault()}this.$emit("keydown-item",{originalEvent:e,element:n})},onChildItemKeyDown(e){this.root?38===e.originalEvent.which&&null==e.element.previousElementSibling&&this.collapseMenu(e.element):37===e.originalEvent.which&&this.collapseMenu(e.element)},findNextItem(t){let n=t.nextElementSibling;return n?e.DomHandler.hasClass(n,"p-disabled")||!e.DomHandler.hasClass(n,"p-menuitem")?this.findNextItem(n):n:null},findPrevItem(t){let n=t.previousElementSibling;return n?e.DomHandler.hasClass(n,"p-disabled")||!e.DomHandler.hasClass(n,"p-menuitem")?this.findPrevItem(n):n:null},expandSubmenu(e,t){this.activeItem=e,setTimeout((()=>{t.children[1].children[0].children[0].focus()}),50)},collapseMenu(e){this.activeItem=null,e.parentElement.previousElementSibling.focus()},navigateToNextItem(e){var t=this.findNextItem(e);t&&t.children[0].focus()},navigateToPrevItem(e){var t=this.findPrevItem(e);t&&t.children[0].focus()},getItemClass(e){return["p-menuitem",e.class,{"p-menuitem-active":this.activeItem===e}]},linkClass(e,t){return["p-menuitem-link",{"p-disabled":this.disabled(e),"router-link-active":t&&t.isActive,"router-link-active-exact":this.exact&&t&&t.isExactActive}]},bindDocumentClickListener(){this.documentClickListener||(this.documentClickListener=e=>{this.$el&&!this.$el.contains(e.target)&&(this.activeItem=null,this.unbindDocumentClickListener())},document.addEventListener("click",this.documentClickListener))},unbindDocumentClickListener(){this.documentClickListener&&(document.removeEventListener("click",this.documentClickListener),this.documentClickListener=null)},getSubmenuIcon(){return["p-submenu-icon pi",{"pi-angle-right":!this.root,"pi-angle-down":this.root}]},visible:e=>"function"==typeof e.visible?e.visible():!1!==e.visible,disabled:e=>"function"==typeof e.disabled?e.disabled():e.disabled,label:e=>"function"==typeof e.label?e.label():e.label},computed:{containerClass(){return{"p-submenu-list":!this.root,"p-menubar-root-list":this.root}}},directives:{ripple:i(t).default}};const o={class:"p-menuitem-text"},s={class:"p-menuitem-text"};l.render=function(e,t,i,l,a,r){const c=n.resolveComponent("router-link"),m=n.resolveComponent("MenubarSub",!0),u=n.resolveDirective("ripple");return n.openBlock(),n.createBlock("ul",{class:r.containerClass,role:i.root?"menubar":"menu"},[(n.openBlock(!0),n.createBlock(n.Fragment,null,n.renderList(i.model,((e,t)=>(n.openBlock(),n.createBlock(n.Fragment,{key:r.label(e)+t.toString()},[r.visible(e)&&!e.separator?(n.openBlock(),n.createBlock("li",{key:0,role:"none",class:r.getItemClass(e),style:e.style,onMouseenter:t=>r.onItemMouseEnter(t,e)},[i.template?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(i.template),{key:1,item:e},null,8,["item"])):(n.openBlock(),n.createBlock(n.Fragment,{key:0},[e.to&&!r.disabled(e)?(n.openBlock(),n.createBlock(c,{key:0,to:e.to,custom:""},{default:n.withCtx((({navigate:t,href:i,isActive:l,isExactActive:s})=>[n.withDirectives(n.createVNode("a",{href:i,onClick:n=>r.onItemClick(n,e,t),class:r.linkClass(e,{isActive:l,isExactActive:s}),onKeydown:t=>r.onItemKeyDown(t,e),role:"menuitem"},[n.createVNode("span",{class:["p-menuitem-icon",e.icon]},null,2),n.createVNode("span",o,n.toDisplayString(r.label(e)),1)],42,["href","onClick","onKeydown"]),[[u]])])),_:2},1032,["to"])):n.withDirectives((n.openBlock(),n.createBlock("a",{key:1,href:e.url,class:r.linkClass(e),target:e.target,"aria-haspopup":null!=e.items,"aria-expanded":e===a.activeItem,onClick:t=>r.onItemClick(t,e),onKeydown:t=>r.onItemKeyDown(t,e),role:"menuitem",tabindex:r.disabled(e)?null:"0"},[n.createVNode("span",{class:["p-menuitem-icon",e.icon]},null,2),n.createVNode("span",s,n.toDisplayString(r.label(e)),1),e.items?(n.openBlock(),n.createBlock("span",{key:0,class:r.getSubmenuIcon()},null,2)):n.createCommentVNode("",!0)],42,["href","target","aria-haspopup","aria-expanded","onClick","onKeydown","tabindex"])),[[u]])],64)),r.visible(e)&&e.items?(n.openBlock(),n.createBlock(m,{model:e.items,key:r.label(e)+"_sub_",mobileActive:i.mobileActive,onLeafClick:r.onLeafClick,onKeydownItem:r.onChildItemKeyDown,parentActive:e===a.activeItem,template:i.template,exact:i.exact},null,8,["model","mobileActive","onLeafClick","onKeydownItem","parentActive","template","exact"])):n.createCommentVNode("",!0)],46,["onMouseenter"])):n.createCommentVNode("",!0),r.visible(e)&&e.separator?(n.openBlock(),n.createBlock("li",{class:["p-menu-separator",e.class],style:e.style,key:"separator"+t.toString(),role:"separator"},null,6)):n.createCommentVNode("",!0)],64)))),128))],10,["role"])};var a={name:"Menubar",props:{model:{type:Array,default:null},exact:{type:Boolean,default:!0}},outsideClickListener:null,data:()=>({mobileActive:!1}),beforeUnmount(){this.mobileActive=!1,this.unbindOutsideClickListener(),this.$refs.rootmenu&&this.$refs.rootmenu.$el&&e.ZIndexUtils.clear(this.$refs.rootmenu.$el)},methods:{toggle(t){this.mobileActive?(this.mobileActive=!1,e.ZIndexUtils.clear(this.$refs.rootmenu.$el)):(this.mobileActive=!0,e.ZIndexUtils.set("menu",this.$refs.rootmenu.$el,this.$primevue.config.zIndex.menu)),this.bindOutsideClickListener(),t.preventDefault()},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{!this.mobileActive||this.$refs.rootmenu.$el===e.target||this.$refs.rootmenu.$el.contains(e.target)||this.$refs.menubutton===e.target||this.$refs.menubutton.contains(e.target)||(this.mobileActive=!1)},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},onLeafClick(){this.mobileActive=!1}},computed:{containerClass(){return["p-menubar p-component",{"p-menubar-mobile-active":this.mobileActive}]}},components:{MenubarSub:l}};const r={key:0,class:"p-menubar-start"},c=n.createVNode("i",{class:"pi pi-bars"},null,-1),m={key:1,class:"p-menubar-end"};!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],l=document.createElement("style");l.type="text/css","top"===n&&i.firstChild?i.insertBefore(l,i.firstChild):i.appendChild(l),l.styleSheet?l.styleSheet.cssText=e:l.appendChild(document.createTextNode(e))}}("\n.p-menubar {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n}\n.p-menubar ul {\n margin: 0;\n padding: 0;\n list-style: none;\n}\n.p-menubar .p-menuitem-link {\n cursor: pointer;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n text-decoration: none;\n overflow: hidden;\n position: relative;\n}\n.p-menubar .p-menuitem-text {\n line-height: 1;\n}\n.p-menubar .p-menuitem {\n position: relative;\n}\n.p-menubar-root-list {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n}\n.p-menubar-root-list > li ul {\n display: none;\n z-index: 1;\n}\n.p-menubar-root-list > .p-menuitem-active > .p-submenu-list {\n display: block;\n}\n.p-menubar .p-submenu-list {\n display: none;\n position: absolute;\n z-index: 1;\n}\n.p-menubar .p-submenu-list > .p-menuitem-active > .p-submenu-list {\n display: block;\n left: 100%;\n top: 0;\n}\n.p-menubar .p-submenu-list .p-menuitem-link .p-submenu-icon {\n margin-left: auto;\n}\n.p-menubar .p-menubar-custom,\n.p-menubar .p-menubar-end {\n margin-left: auto;\n -ms-flex-item-align: center;\n align-self: center;\n}\n.p-menubar-button {\n display: none;\n cursor: pointer;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n}\n"),a.render=function(e,t,i,l,o,s){const a=n.resolveComponent("MenubarSub");return n.openBlock(),n.createBlock("div",{class:s.containerClass},[e.$slots.start?(n.openBlock(),n.createBlock("div",r,[n.renderSlot(e.$slots,"start")])):n.createCommentVNode("",!0),n.createVNode("a",{ref:"menubutton",tabindex:"0",class:"p-menubar-button",onClick:t[1]||(t[1]=e=>s.toggle(e))},[c],512),n.createVNode(a,{ref:"rootmenu",model:i.model,root:!0,mobileActive:o.mobileActive,onLeafClick:s.onLeafClick,template:e.$slots.item,exact:i.exact},null,8,["model","mobileActive","onLeafClick","template","exact"]),e.$slots.end?(n.openBlock(),n.createBlock("div",m,[n.renderSlot(e.$slots,"end")])):n.createCommentVNode("",!0)],2)},module.exports=a;
|
package/menubar/menubar.esm.js
CHANGED
|
@@ -258,6 +258,9 @@ var script$1 = {
|
|
|
258
258
|
},
|
|
259
259
|
disabled(item) {
|
|
260
260
|
return (typeof item.disabled === 'function' ? item.disabled() : item.disabled);
|
|
261
|
+
},
|
|
262
|
+
label(item) {
|
|
263
|
+
return (typeof item.label === 'function' ? item.label() : item.label);
|
|
261
264
|
}
|
|
262
265
|
},
|
|
263
266
|
computed: {
|
|
@@ -284,7 +287,7 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
284
287
|
}, [
|
|
285
288
|
(openBlock(true), createBlock(Fragment, null, renderList($props.model, (item, i) => {
|
|
286
289
|
return (openBlock(), createBlock(Fragment, {
|
|
287
|
-
key:
|
|
290
|
+
key: $options.label(item) + i.toString()
|
|
288
291
|
}, [
|
|
289
292
|
($options.visible(item) && !item.separator)
|
|
290
293
|
? (openBlock(), createBlock("li", {
|
|
@@ -313,7 +316,7 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
313
316
|
createVNode("span", {
|
|
314
317
|
class: ['p-menuitem-icon', item.icon]
|
|
315
318
|
}, null, 2),
|
|
316
|
-
createVNode("span", _hoisted_1$1, toDisplayString(
|
|
319
|
+
createVNode("span", _hoisted_1$1, toDisplayString($options.label(item)), 1)
|
|
317
320
|
], 42, ["href", "onClick", "onKeydown"]), [
|
|
318
321
|
[_directive_ripple]
|
|
319
322
|
])
|
|
@@ -335,7 +338,7 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
335
338
|
createVNode("span", {
|
|
336
339
|
class: ['p-menuitem-icon', item.icon]
|
|
337
340
|
}, null, 2),
|
|
338
|
-
createVNode("span", _hoisted_2$1, toDisplayString(
|
|
341
|
+
createVNode("span", _hoisted_2$1, toDisplayString($options.label(item)), 1),
|
|
339
342
|
(item.items)
|
|
340
343
|
? (openBlock(), createBlock("span", {
|
|
341
344
|
key: 0,
|
|
@@ -353,7 +356,7 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
353
356
|
($options.visible(item) && item.items)
|
|
354
357
|
? (openBlock(), createBlock(_component_MenubarSub, {
|
|
355
358
|
model: item.items,
|
|
356
|
-
key:
|
|
359
|
+
key: $options.label(item) + '_sub_',
|
|
357
360
|
mobileActive: $props.mobileActive,
|
|
358
361
|
onLeafClick: $options.onLeafClick,
|
|
359
362
|
onKeydownItem: $options.onChildItemKeyDown,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DomHandler as e,ZIndexUtils as t}from"primevue/utils";import n from"primevue/ripple";import{resolveComponent as i,resolveDirective as l,openBlock as s,createBlock as o,Fragment as a,renderList as r,withCtx as m,withDirectives as c,createVNode as u,toDisplayString as p,createCommentVNode as d,resolveDynamicComponent as b,renderSlot as h}from"vue";var v={name:"MenubarSub",emits:["keydown-item","leaf-click"],props:{model:{type:Array,default:null},root:{type:Boolean,default:!1},popup:{type:Boolean,default:!1},parentActive:{type:Boolean,default:!1},mobileActive:{type:Boolean,default:!1},template:{type:Function,default:null},exact:{type:Boolean,default:!0}},documentClickListener:null,watch:{parentActive(e){e||(this.activeItem=null)}},data:()=>({activeItem:null}),updated(){this.root&&this.activeItem&&this.bindDocumentClickListener()},beforeUnmount(){this.unbindDocumentClickListener()},methods:{onItemMouseEnter(e,t){this.disabled(t)||this.mobileActive?e.preventDefault():this.root?(this.activeItem||this.popup)&&(this.activeItem=t):this.activeItem=t},onItemClick(e,t,n){this.disabled(t)?e.preventDefault():(t.command&&t.command({originalEvent:e,item:t}),t.items&&(this.activeItem&&t===this.activeItem?this.activeItem=null:this.activeItem=t),t.items||this.onLeafClick(),t.to&&n&&n(e))},onLeafClick(){this.activeItem=null,this.$emit("leaf-click")},onItemKeyDown(e,t){let n=e.currentTarget.parentElement;switch(e.which){case 40:this.root?t.items&&this.expandSubmenu(t,n):this.navigateToNextItem(n),e.preventDefault();break;case 38:this.root||this.navigateToPrevItem(n),e.preventDefault();break;case 39:if(this.root){var i=this.findNextItem(n);i&&i.children[0].focus()}else t.items&&this.expandSubmenu(t,n);e.preventDefault();break;case 37:this.root&&this.navigateToPrevItem(n),e.preventDefault()}this.$emit("keydown-item",{originalEvent:e,element:n})},onChildItemKeyDown(e){this.root?38===e.originalEvent.which&&null==e.element.previousElementSibling&&this.collapseMenu(e.element):37===e.originalEvent.which&&this.collapseMenu(e.element)},findNextItem(t){let n=t.nextElementSibling;return n?e.hasClass(n,"p-disabled")||!e.hasClass(n,"p-menuitem")?this.findNextItem(n):n:null},findPrevItem(t){let n=t.previousElementSibling;return n?e.hasClass(n,"p-disabled")||!e.hasClass(n,"p-menuitem")?this.findPrevItem(n):n:null},expandSubmenu(e,t){this.activeItem=e,setTimeout((()=>{t.children[1].children[0].children[0].focus()}),50)},collapseMenu(e){this.activeItem=null,e.parentElement.previousElementSibling.focus()},navigateToNextItem(e){var t=this.findNextItem(e);t&&t.children[0].focus()},navigateToPrevItem(e){var t=this.findPrevItem(e);t&&t.children[0].focus()},getItemClass(e){return["p-menuitem",e.class,{"p-menuitem-active":this.activeItem===e}]},linkClass(e,t){return["p-menuitem-link",{"p-disabled":this.disabled(e),"router-link-active":t&&t.isActive,"router-link-active-exact":this.exact&&t&&t.isExactActive}]},bindDocumentClickListener(){this.documentClickListener||(this.documentClickListener=e=>{this.$el&&!this.$el.contains(e.target)&&(this.activeItem=null,this.unbindDocumentClickListener())},document.addEventListener("click",this.documentClickListener))},unbindDocumentClickListener(){this.documentClickListener&&(document.removeEventListener("click",this.documentClickListener),this.documentClickListener=null)},getSubmenuIcon(){return["p-submenu-icon pi",{"pi-angle-right":!this.root,"pi-angle-down":this.root}]},visible:e=>"function"==typeof e.visible?e.visible():!1!==e.visible,disabled:e=>"function"==typeof e.disabled?e.disabled():e.disabled},computed:{containerClass(){return{"p-submenu-list":!this.root,"p-menubar-root-list":this.root}}},directives:{ripple:n}};const f={class:"p-menuitem-text"},k={class:"p-menuitem-text"};v.render=function(e,t,n,h,v,y){const x=i("router-link"),C=i("MenubarSub",!0),g=l("ripple");return s(),o("ul",{class:y.containerClass,role:n.root?"menubar":"menu"},[(s(!0),o(a,null,r(n.model,((e,t)=>(s(),o(a,{key:
|
|
1
|
+
import{DomHandler as e,ZIndexUtils as t}from"primevue/utils";import n from"primevue/ripple";import{resolveComponent as i,resolveDirective as l,openBlock as s,createBlock as o,Fragment as a,renderList as r,withCtx as m,withDirectives as c,createVNode as u,toDisplayString as p,createCommentVNode as d,resolveDynamicComponent as b,renderSlot as h}from"vue";var v={name:"MenubarSub",emits:["keydown-item","leaf-click"],props:{model:{type:Array,default:null},root:{type:Boolean,default:!1},popup:{type:Boolean,default:!1},parentActive:{type:Boolean,default:!1},mobileActive:{type:Boolean,default:!1},template:{type:Function,default:null},exact:{type:Boolean,default:!0}},documentClickListener:null,watch:{parentActive(e){e||(this.activeItem=null)}},data:()=>({activeItem:null}),updated(){this.root&&this.activeItem&&this.bindDocumentClickListener()},beforeUnmount(){this.unbindDocumentClickListener()},methods:{onItemMouseEnter(e,t){this.disabled(t)||this.mobileActive?e.preventDefault():this.root?(this.activeItem||this.popup)&&(this.activeItem=t):this.activeItem=t},onItemClick(e,t,n){this.disabled(t)?e.preventDefault():(t.command&&t.command({originalEvent:e,item:t}),t.items&&(this.activeItem&&t===this.activeItem?this.activeItem=null:this.activeItem=t),t.items||this.onLeafClick(),t.to&&n&&n(e))},onLeafClick(){this.activeItem=null,this.$emit("leaf-click")},onItemKeyDown(e,t){let n=e.currentTarget.parentElement;switch(e.which){case 40:this.root?t.items&&this.expandSubmenu(t,n):this.navigateToNextItem(n),e.preventDefault();break;case 38:this.root||this.navigateToPrevItem(n),e.preventDefault();break;case 39:if(this.root){var i=this.findNextItem(n);i&&i.children[0].focus()}else t.items&&this.expandSubmenu(t,n);e.preventDefault();break;case 37:this.root&&this.navigateToPrevItem(n),e.preventDefault()}this.$emit("keydown-item",{originalEvent:e,element:n})},onChildItemKeyDown(e){this.root?38===e.originalEvent.which&&null==e.element.previousElementSibling&&this.collapseMenu(e.element):37===e.originalEvent.which&&this.collapseMenu(e.element)},findNextItem(t){let n=t.nextElementSibling;return n?e.hasClass(n,"p-disabled")||!e.hasClass(n,"p-menuitem")?this.findNextItem(n):n:null},findPrevItem(t){let n=t.previousElementSibling;return n?e.hasClass(n,"p-disabled")||!e.hasClass(n,"p-menuitem")?this.findPrevItem(n):n:null},expandSubmenu(e,t){this.activeItem=e,setTimeout((()=>{t.children[1].children[0].children[0].focus()}),50)},collapseMenu(e){this.activeItem=null,e.parentElement.previousElementSibling.focus()},navigateToNextItem(e){var t=this.findNextItem(e);t&&t.children[0].focus()},navigateToPrevItem(e){var t=this.findPrevItem(e);t&&t.children[0].focus()},getItemClass(e){return["p-menuitem",e.class,{"p-menuitem-active":this.activeItem===e}]},linkClass(e,t){return["p-menuitem-link",{"p-disabled":this.disabled(e),"router-link-active":t&&t.isActive,"router-link-active-exact":this.exact&&t&&t.isExactActive}]},bindDocumentClickListener(){this.documentClickListener||(this.documentClickListener=e=>{this.$el&&!this.$el.contains(e.target)&&(this.activeItem=null,this.unbindDocumentClickListener())},document.addEventListener("click",this.documentClickListener))},unbindDocumentClickListener(){this.documentClickListener&&(document.removeEventListener("click",this.documentClickListener),this.documentClickListener=null)},getSubmenuIcon(){return["p-submenu-icon pi",{"pi-angle-right":!this.root,"pi-angle-down":this.root}]},visible:e=>"function"==typeof e.visible?e.visible():!1!==e.visible,disabled:e=>"function"==typeof e.disabled?e.disabled():e.disabled,label:e=>"function"==typeof e.label?e.label():e.label},computed:{containerClass(){return{"p-submenu-list":!this.root,"p-menubar-root-list":this.root}}},directives:{ripple:n}};const f={class:"p-menuitem-text"},k={class:"p-menuitem-text"};v.render=function(e,t,n,h,v,y){const x=i("router-link"),C=i("MenubarSub",!0),g=l("ripple");return s(),o("ul",{class:y.containerClass,role:n.root?"menubar":"menu"},[(s(!0),o(a,null,r(n.model,((e,t)=>(s(),o(a,{key:y.label(e)+t.toString()},[y.visible(e)&&!e.separator?(s(),o("li",{key:0,role:"none",class:y.getItemClass(e),style:e.style,onMouseenter:t=>y.onItemMouseEnter(t,e)},[n.template?(s(),o(b(n.template),{key:1,item:e},null,8,["item"])):(s(),o(a,{key:0},[e.to&&!y.disabled(e)?(s(),o(x,{key:0,to:e.to,custom:""},{default:m((({navigate:t,href:n,isActive:i,isExactActive:l})=>[c(u("a",{href:n,onClick:n=>y.onItemClick(n,e,t),class:y.linkClass(e,{isActive:i,isExactActive:l}),onKeydown:t=>y.onItemKeyDown(t,e),role:"menuitem"},[u("span",{class:["p-menuitem-icon",e.icon]},null,2),u("span",f,p(y.label(e)),1)],42,["href","onClick","onKeydown"]),[[g]])])),_:2},1032,["to"])):c((s(),o("a",{key:1,href:e.url,class:y.linkClass(e),target:e.target,"aria-haspopup":null!=e.items,"aria-expanded":e===v.activeItem,onClick:t=>y.onItemClick(t,e),onKeydown:t=>y.onItemKeyDown(t,e),role:"menuitem",tabindex:y.disabled(e)?null:"0"},[u("span",{class:["p-menuitem-icon",e.icon]},null,2),u("span",k,p(y.label(e)),1),e.items?(s(),o("span",{key:0,class:y.getSubmenuIcon()},null,2)):d("",!0)],42,["href","target","aria-haspopup","aria-expanded","onClick","onKeydown","tabindex"])),[[g]])],64)),y.visible(e)&&e.items?(s(),o(C,{model:e.items,key:y.label(e)+"_sub_",mobileActive:n.mobileActive,onLeafClick:y.onLeafClick,onKeydownItem:y.onChildItemKeyDown,parentActive:e===v.activeItem,template:n.template,exact:n.exact},null,8,["model","mobileActive","onLeafClick","onKeydownItem","parentActive","template","exact"])):d("",!0)],46,["onMouseenter"])):d("",!0),y.visible(e)&&e.separator?(s(),o("li",{class:["p-menu-separator",e.class],style:e.style,key:"separator"+t.toString(),role:"separator"},null,6)):d("",!0)],64)))),128))],10,["role"])};var y={name:"Menubar",props:{model:{type:Array,default:null},exact:{type:Boolean,default:!0}},outsideClickListener:null,data:()=>({mobileActive:!1}),beforeUnmount(){this.mobileActive=!1,this.unbindOutsideClickListener(),this.$refs.rootmenu&&this.$refs.rootmenu.$el&&t.clear(this.$refs.rootmenu.$el)},methods:{toggle(e){this.mobileActive?(this.mobileActive=!1,t.clear(this.$refs.rootmenu.$el)):(this.mobileActive=!0,t.set("menu",this.$refs.rootmenu.$el,this.$primevue.config.zIndex.menu)),this.bindOutsideClickListener(),e.preventDefault()},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{!this.mobileActive||this.$refs.rootmenu.$el===e.target||this.$refs.rootmenu.$el.contains(e.target)||this.$refs.menubutton===e.target||this.$refs.menubutton.contains(e.target)||(this.mobileActive=!1)},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},onLeafClick(){this.mobileActive=!1}},computed:{containerClass(){return["p-menubar p-component",{"p-menubar-mobile-active":this.mobileActive}]}},components:{MenubarSub:v}};const x={key:0,class:"p-menubar-start"},C=u("i",{class:"pi pi-bars"},null,-1),g={key:1,class:"p-menubar-end"};!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],l=document.createElement("style");l.type="text/css","top"===n&&i.firstChild?i.insertBefore(l,i.firstChild):i.appendChild(l),l.styleSheet?l.styleSheet.cssText=e:l.appendChild(document.createTextNode(e))}}("\n.p-menubar {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n}\n.p-menubar ul {\n margin: 0;\n padding: 0;\n list-style: none;\n}\n.p-menubar .p-menuitem-link {\n cursor: pointer;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n text-decoration: none;\n overflow: hidden;\n position: relative;\n}\n.p-menubar .p-menuitem-text {\n line-height: 1;\n}\n.p-menubar .p-menuitem {\n position: relative;\n}\n.p-menubar-root-list {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n}\n.p-menubar-root-list > li ul {\n display: none;\n z-index: 1;\n}\n.p-menubar-root-list > .p-menuitem-active > .p-submenu-list {\n display: block;\n}\n.p-menubar .p-submenu-list {\n display: none;\n position: absolute;\n z-index: 1;\n}\n.p-menubar .p-submenu-list > .p-menuitem-active > .p-submenu-list {\n display: block;\n left: 100%;\n top: 0;\n}\n.p-menubar .p-submenu-list .p-menuitem-link .p-submenu-icon {\n margin-left: auto;\n}\n.p-menubar .p-menubar-custom,\n.p-menubar .p-menubar-end {\n margin-left: auto;\n -ms-flex-item-align: center;\n align-self: center;\n}\n.p-menubar-button {\n display: none;\n cursor: pointer;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n}\n"),y.render=function(e,t,n,l,a,r){const m=i("MenubarSub");return s(),o("div",{class:r.containerClass},[e.$slots.start?(s(),o("div",x,[h(e.$slots,"start")])):d("",!0),u("a",{ref:"menubutton",tabindex:"0",class:"p-menubar-button",onClick:t[1]||(t[1]=e=>r.toggle(e))},[C],512),u(m,{ref:"rootmenu",model:n.model,root:!0,mobileActive:a.mobileActive,onLeafClick:r.onLeafClick,template:e.$slots.item,exact:n.exact},null,8,["model","mobileActive","onLeafClick","template","exact"]),e.$slots.end?(s(),o("div",g,[h(e.$slots,"end")])):d("",!0)],2)};export default y;
|
package/menubar/menubar.js
CHANGED
|
@@ -262,6 +262,9 @@ this.primevue.menubar = (function (utils, Ripple, vue) {
|
|
|
262
262
|
},
|
|
263
263
|
disabled(item) {
|
|
264
264
|
return (typeof item.disabled === 'function' ? item.disabled() : item.disabled);
|
|
265
|
+
},
|
|
266
|
+
label(item) {
|
|
267
|
+
return (typeof item.label === 'function' ? item.label() : item.label);
|
|
265
268
|
}
|
|
266
269
|
},
|
|
267
270
|
computed: {
|
|
@@ -288,7 +291,7 @@ this.primevue.menubar = (function (utils, Ripple, vue) {
|
|
|
288
291
|
}, [
|
|
289
292
|
(vue.openBlock(true), vue.createBlock(vue.Fragment, null, vue.renderList($props.model, (item, i) => {
|
|
290
293
|
return (vue.openBlock(), vue.createBlock(vue.Fragment, {
|
|
291
|
-
key:
|
|
294
|
+
key: $options.label(item) + i.toString()
|
|
292
295
|
}, [
|
|
293
296
|
($options.visible(item) && !item.separator)
|
|
294
297
|
? (vue.openBlock(), vue.createBlock("li", {
|
|
@@ -317,7 +320,7 @@ this.primevue.menubar = (function (utils, Ripple, vue) {
|
|
|
317
320
|
vue.createVNode("span", {
|
|
318
321
|
class: ['p-menuitem-icon', item.icon]
|
|
319
322
|
}, null, 2),
|
|
320
|
-
vue.createVNode("span", _hoisted_1$1, vue.toDisplayString(
|
|
323
|
+
vue.createVNode("span", _hoisted_1$1, vue.toDisplayString($options.label(item)), 1)
|
|
321
324
|
], 42, ["href", "onClick", "onKeydown"]), [
|
|
322
325
|
[_directive_ripple]
|
|
323
326
|
])
|
|
@@ -339,7 +342,7 @@ this.primevue.menubar = (function (utils, Ripple, vue) {
|
|
|
339
342
|
vue.createVNode("span", {
|
|
340
343
|
class: ['p-menuitem-icon', item.icon]
|
|
341
344
|
}, null, 2),
|
|
342
|
-
vue.createVNode("span", _hoisted_2$1, vue.toDisplayString(
|
|
345
|
+
vue.createVNode("span", _hoisted_2$1, vue.toDisplayString($options.label(item)), 1),
|
|
343
346
|
(item.items)
|
|
344
347
|
? (vue.openBlock(), vue.createBlock("span", {
|
|
345
348
|
key: 0,
|
|
@@ -357,7 +360,7 @@ this.primevue.menubar = (function (utils, Ripple, vue) {
|
|
|
357
360
|
($options.visible(item) && item.items)
|
|
358
361
|
? (vue.openBlock(), vue.createBlock(_component_MenubarSub, {
|
|
359
362
|
model: item.items,
|
|
360
|
-
key:
|
|
363
|
+
key: $options.label(item) + '_sub_',
|
|
361
364
|
mobileActive: $props.mobileActive,
|
|
362
365
|
onLeafClick: $options.onLeafClick,
|
|
363
366
|
onKeydownItem: $options.onChildItemKeyDown,
|
package/menubar/menubar.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primevue=this.primevue||{},this.primevue.menubar=function(e,t,n){"use strict";function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l={name:"MenubarSub",emits:["keydown-item","leaf-click"],props:{model:{type:Array,default:null},root:{type:Boolean,default:!1},popup:{type:Boolean,default:!1},parentActive:{type:Boolean,default:!1},mobileActive:{type:Boolean,default:!1},template:{type:Function,default:null},exact:{type:Boolean,default:!0}},documentClickListener:null,watch:{parentActive(e){e||(this.activeItem=null)}},data:()=>({activeItem:null}),updated(){this.root&&this.activeItem&&this.bindDocumentClickListener()},beforeUnmount(){this.unbindDocumentClickListener()},methods:{onItemMouseEnter(e,t){this.disabled(t)||this.mobileActive?e.preventDefault():this.root?(this.activeItem||this.popup)&&(this.activeItem=t):this.activeItem=t},onItemClick(e,t,n){this.disabled(t)?e.preventDefault():(t.command&&t.command({originalEvent:e,item:t}),t.items&&(this.activeItem&&t===this.activeItem?this.activeItem=null:this.activeItem=t),t.items||this.onLeafClick(),t.to&&n&&n(e))},onLeafClick(){this.activeItem=null,this.$emit("leaf-click")},onItemKeyDown(e,t){let n=e.currentTarget.parentElement;switch(e.which){case 40:this.root?t.items&&this.expandSubmenu(t,n):this.navigateToNextItem(n),e.preventDefault();break;case 38:this.root||this.navigateToPrevItem(n),e.preventDefault();break;case 39:if(this.root){var i=this.findNextItem(n);i&&i.children[0].focus()}else t.items&&this.expandSubmenu(t,n);e.preventDefault();break;case 37:this.root&&this.navigateToPrevItem(n),e.preventDefault()}this.$emit("keydown-item",{originalEvent:e,element:n})},onChildItemKeyDown(e){this.root?38===e.originalEvent.which&&null==e.element.previousElementSibling&&this.collapseMenu(e.element):37===e.originalEvent.which&&this.collapseMenu(e.element)},findNextItem(t){let n=t.nextElementSibling;return n?e.DomHandler.hasClass(n,"p-disabled")||!e.DomHandler.hasClass(n,"p-menuitem")?this.findNextItem(n):n:null},findPrevItem(t){let n=t.previousElementSibling;return n?e.DomHandler.hasClass(n,"p-disabled")||!e.DomHandler.hasClass(n,"p-menuitem")?this.findPrevItem(n):n:null},expandSubmenu(e,t){this.activeItem=e,setTimeout((()=>{t.children[1].children[0].children[0].focus()}),50)},collapseMenu(e){this.activeItem=null,e.parentElement.previousElementSibling.focus()},navigateToNextItem(e){var t=this.findNextItem(e);t&&t.children[0].focus()},navigateToPrevItem(e){var t=this.findPrevItem(e);t&&t.children[0].focus()},getItemClass(e){return["p-menuitem",e.class,{"p-menuitem-active":this.activeItem===e}]},linkClass(e,t){return["p-menuitem-link",{"p-disabled":this.disabled(e),"router-link-active":t&&t.isActive,"router-link-active-exact":this.exact&&t&&t.isExactActive}]},bindDocumentClickListener(){this.documentClickListener||(this.documentClickListener=e=>{this.$el&&!this.$el.contains(e.target)&&(this.activeItem=null,this.unbindDocumentClickListener())},document.addEventListener("click",this.documentClickListener))},unbindDocumentClickListener(){this.documentClickListener&&(document.removeEventListener("click",this.documentClickListener),this.documentClickListener=null)},getSubmenuIcon(){return["p-submenu-icon pi",{"pi-angle-right":!this.root,"pi-angle-down":this.root}]},visible:e=>"function"==typeof e.visible?e.visible():!1!==e.visible,disabled:e=>"function"==typeof e.disabled?e.disabled():e.disabled},computed:{containerClass(){return{"p-submenu-list":!this.root,"p-menubar-root-list":this.root}}},directives:{ripple:i(t).default}};const o={class:"p-menuitem-text"},s={class:"p-menuitem-text"};l.render=function(e,t,i,l,a,r){const c=n.resolveComponent("router-link"),m=n.resolveComponent("MenubarSub",!0),u=n.resolveDirective("ripple");return n.openBlock(),n.createBlock("ul",{class:r.containerClass,role:i.root?"menubar":"menu"},[(n.openBlock(!0),n.createBlock(n.Fragment,null,n.renderList(i.model,((e,t)=>(n.openBlock(),n.createBlock(n.Fragment,{key:e.label+t.toString()},[r.visible(e)&&!e.separator?(n.openBlock(),n.createBlock("li",{key:0,role:"none",class:r.getItemClass(e),style:e.style,onMouseenter:t=>r.onItemMouseEnter(t,e)},[i.template?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(i.template),{key:1,item:e},null,8,["item"])):(n.openBlock(),n.createBlock(n.Fragment,{key:0},[e.to&&!r.disabled(e)?(n.openBlock(),n.createBlock(c,{key:0,to:e.to,custom:""},{default:n.withCtx((({navigate:t,href:i,isActive:l,isExactActive:s})=>[n.withDirectives(n.createVNode("a",{href:i,onClick:n=>r.onItemClick(n,e,t),class:r.linkClass(e,{isActive:l,isExactActive:s}),onKeydown:t=>r.onItemKeyDown(t,e),role:"menuitem"},[n.createVNode("span",{class:["p-menuitem-icon",e.icon]},null,2),n.createVNode("span",o,n.toDisplayString(e.label),1)],42,["href","onClick","onKeydown"]),[[u]])])),_:2},1032,["to"])):n.withDirectives((n.openBlock(),n.createBlock("a",{key:1,href:e.url,class:r.linkClass(e),target:e.target,"aria-haspopup":null!=e.items,"aria-expanded":e===a.activeItem,onClick:t=>r.onItemClick(t,e),onKeydown:t=>r.onItemKeyDown(t,e),role:"menuitem",tabindex:r.disabled(e)?null:"0"},[n.createVNode("span",{class:["p-menuitem-icon",e.icon]},null,2),n.createVNode("span",s,n.toDisplayString(e.label),1),e.items?(n.openBlock(),n.createBlock("span",{key:0,class:r.getSubmenuIcon()},null,2)):n.createCommentVNode("",!0)],42,["href","target","aria-haspopup","aria-expanded","onClick","onKeydown","tabindex"])),[[u]])],64)),r.visible(e)&&e.items?(n.openBlock(),n.createBlock(m,{model:e.items,key:e.label+"_sub_",mobileActive:i.mobileActive,onLeafClick:r.onLeafClick,onKeydownItem:r.onChildItemKeyDown,parentActive:e===a.activeItem,template:i.template,exact:i.exact},null,8,["model","mobileActive","onLeafClick","onKeydownItem","parentActive","template","exact"])):n.createCommentVNode("",!0)],46,["onMouseenter"])):n.createCommentVNode("",!0),r.visible(e)&&e.separator?(n.openBlock(),n.createBlock("li",{class:["p-menu-separator",e.class],style:e.style,key:"separator"+t.toString(),role:"separator"},null,6)):n.createCommentVNode("",!0)],64)))),128))],10,["role"])};var a={name:"Menubar",props:{model:{type:Array,default:null},exact:{type:Boolean,default:!0}},outsideClickListener:null,data:()=>({mobileActive:!1}),beforeUnmount(){this.mobileActive=!1,this.unbindOutsideClickListener(),this.$refs.rootmenu&&this.$refs.rootmenu.$el&&e.ZIndexUtils.clear(this.$refs.rootmenu.$el)},methods:{toggle(t){this.mobileActive?(this.mobileActive=!1,e.ZIndexUtils.clear(this.$refs.rootmenu.$el)):(this.mobileActive=!0,e.ZIndexUtils.set("menu",this.$refs.rootmenu.$el,this.$primevue.config.zIndex.menu)),this.bindOutsideClickListener(),t.preventDefault()},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{!this.mobileActive||this.$refs.rootmenu.$el===e.target||this.$refs.rootmenu.$el.contains(e.target)||this.$refs.menubutton===e.target||this.$refs.menubutton.contains(e.target)||(this.mobileActive=!1)},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},onLeafClick(){this.mobileActive=!1}},computed:{containerClass(){return["p-menubar p-component",{"p-menubar-mobile-active":this.mobileActive}]}},components:{MenubarSub:l}};const r={key:0,class:"p-menubar-start"},c=n.createVNode("i",{class:"pi pi-bars"},null,-1),m={key:1,class:"p-menubar-end"};return function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],l=document.createElement("style");l.type="text/css","top"===n&&i.firstChild?i.insertBefore(l,i.firstChild):i.appendChild(l),l.styleSheet?l.styleSheet.cssText=e:l.appendChild(document.createTextNode(e))}}("\n.p-menubar {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n}\n.p-menubar ul {\n margin: 0;\n padding: 0;\n list-style: none;\n}\n.p-menubar .p-menuitem-link {\n cursor: pointer;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n text-decoration: none;\n overflow: hidden;\n position: relative;\n}\n.p-menubar .p-menuitem-text {\n line-height: 1;\n}\n.p-menubar .p-menuitem {\n position: relative;\n}\n.p-menubar-root-list {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n}\n.p-menubar-root-list > li ul {\n display: none;\n z-index: 1;\n}\n.p-menubar-root-list > .p-menuitem-active > .p-submenu-list {\n display: block;\n}\n.p-menubar .p-submenu-list {\n display: none;\n position: absolute;\n z-index: 1;\n}\n.p-menubar .p-submenu-list > .p-menuitem-active > .p-submenu-list {\n display: block;\n left: 100%;\n top: 0;\n}\n.p-menubar .p-submenu-list .p-menuitem-link .p-submenu-icon {\n margin-left: auto;\n}\n.p-menubar .p-menubar-custom,\n.p-menubar .p-menubar-end {\n margin-left: auto;\n -ms-flex-item-align: center;\n align-self: center;\n}\n.p-menubar-button {\n display: none;\n cursor: pointer;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n}\n"),a.render=function(e,t,i,l,o,s){const a=n.resolveComponent("MenubarSub");return n.openBlock(),n.createBlock("div",{class:s.containerClass},[e.$slots.start?(n.openBlock(),n.createBlock("div",r,[n.renderSlot(e.$slots,"start")])):n.createCommentVNode("",!0),n.createVNode("a",{ref:"menubutton",tabindex:"0",class:"p-menubar-button",onClick:t[1]||(t[1]=e=>s.toggle(e))},[c],512),n.createVNode(a,{ref:"rootmenu",model:i.model,root:!0,mobileActive:o.mobileActive,onLeafClick:s.onLeafClick,template:e.$slots.item,exact:i.exact},null,8,["model","mobileActive","onLeafClick","template","exact"]),e.$slots.end?(n.openBlock(),n.createBlock("div",m,[n.renderSlot(e.$slots,"end")])):n.createCommentVNode("",!0)],2)},a}(primevue.utils,primevue.ripple,Vue);
|
|
1
|
+
this.primevue=this.primevue||{},this.primevue.menubar=function(e,t,n){"use strict";function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l={name:"MenubarSub",emits:["keydown-item","leaf-click"],props:{model:{type:Array,default:null},root:{type:Boolean,default:!1},popup:{type:Boolean,default:!1},parentActive:{type:Boolean,default:!1},mobileActive:{type:Boolean,default:!1},template:{type:Function,default:null},exact:{type:Boolean,default:!0}},documentClickListener:null,watch:{parentActive(e){e||(this.activeItem=null)}},data:()=>({activeItem:null}),updated(){this.root&&this.activeItem&&this.bindDocumentClickListener()},beforeUnmount(){this.unbindDocumentClickListener()},methods:{onItemMouseEnter(e,t){this.disabled(t)||this.mobileActive?e.preventDefault():this.root?(this.activeItem||this.popup)&&(this.activeItem=t):this.activeItem=t},onItemClick(e,t,n){this.disabled(t)?e.preventDefault():(t.command&&t.command({originalEvent:e,item:t}),t.items&&(this.activeItem&&t===this.activeItem?this.activeItem=null:this.activeItem=t),t.items||this.onLeafClick(),t.to&&n&&n(e))},onLeafClick(){this.activeItem=null,this.$emit("leaf-click")},onItemKeyDown(e,t){let n=e.currentTarget.parentElement;switch(e.which){case 40:this.root?t.items&&this.expandSubmenu(t,n):this.navigateToNextItem(n),e.preventDefault();break;case 38:this.root||this.navigateToPrevItem(n),e.preventDefault();break;case 39:if(this.root){var i=this.findNextItem(n);i&&i.children[0].focus()}else t.items&&this.expandSubmenu(t,n);e.preventDefault();break;case 37:this.root&&this.navigateToPrevItem(n),e.preventDefault()}this.$emit("keydown-item",{originalEvent:e,element:n})},onChildItemKeyDown(e){this.root?38===e.originalEvent.which&&null==e.element.previousElementSibling&&this.collapseMenu(e.element):37===e.originalEvent.which&&this.collapseMenu(e.element)},findNextItem(t){let n=t.nextElementSibling;return n?e.DomHandler.hasClass(n,"p-disabled")||!e.DomHandler.hasClass(n,"p-menuitem")?this.findNextItem(n):n:null},findPrevItem(t){let n=t.previousElementSibling;return n?e.DomHandler.hasClass(n,"p-disabled")||!e.DomHandler.hasClass(n,"p-menuitem")?this.findPrevItem(n):n:null},expandSubmenu(e,t){this.activeItem=e,setTimeout((()=>{t.children[1].children[0].children[0].focus()}),50)},collapseMenu(e){this.activeItem=null,e.parentElement.previousElementSibling.focus()},navigateToNextItem(e){var t=this.findNextItem(e);t&&t.children[0].focus()},navigateToPrevItem(e){var t=this.findPrevItem(e);t&&t.children[0].focus()},getItemClass(e){return["p-menuitem",e.class,{"p-menuitem-active":this.activeItem===e}]},linkClass(e,t){return["p-menuitem-link",{"p-disabled":this.disabled(e),"router-link-active":t&&t.isActive,"router-link-active-exact":this.exact&&t&&t.isExactActive}]},bindDocumentClickListener(){this.documentClickListener||(this.documentClickListener=e=>{this.$el&&!this.$el.contains(e.target)&&(this.activeItem=null,this.unbindDocumentClickListener())},document.addEventListener("click",this.documentClickListener))},unbindDocumentClickListener(){this.documentClickListener&&(document.removeEventListener("click",this.documentClickListener),this.documentClickListener=null)},getSubmenuIcon(){return["p-submenu-icon pi",{"pi-angle-right":!this.root,"pi-angle-down":this.root}]},visible:e=>"function"==typeof e.visible?e.visible():!1!==e.visible,disabled:e=>"function"==typeof e.disabled?e.disabled():e.disabled,label:e=>"function"==typeof e.label?e.label():e.label},computed:{containerClass(){return{"p-submenu-list":!this.root,"p-menubar-root-list":this.root}}},directives:{ripple:i(t).default}};const o={class:"p-menuitem-text"},s={class:"p-menuitem-text"};l.render=function(e,t,i,l,a,r){const c=n.resolveComponent("router-link"),m=n.resolveComponent("MenubarSub",!0),u=n.resolveDirective("ripple");return n.openBlock(),n.createBlock("ul",{class:r.containerClass,role:i.root?"menubar":"menu"},[(n.openBlock(!0),n.createBlock(n.Fragment,null,n.renderList(i.model,((e,t)=>(n.openBlock(),n.createBlock(n.Fragment,{key:r.label(e)+t.toString()},[r.visible(e)&&!e.separator?(n.openBlock(),n.createBlock("li",{key:0,role:"none",class:r.getItemClass(e),style:e.style,onMouseenter:t=>r.onItemMouseEnter(t,e)},[i.template?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(i.template),{key:1,item:e},null,8,["item"])):(n.openBlock(),n.createBlock(n.Fragment,{key:0},[e.to&&!r.disabled(e)?(n.openBlock(),n.createBlock(c,{key:0,to:e.to,custom:""},{default:n.withCtx((({navigate:t,href:i,isActive:l,isExactActive:s})=>[n.withDirectives(n.createVNode("a",{href:i,onClick:n=>r.onItemClick(n,e,t),class:r.linkClass(e,{isActive:l,isExactActive:s}),onKeydown:t=>r.onItemKeyDown(t,e),role:"menuitem"},[n.createVNode("span",{class:["p-menuitem-icon",e.icon]},null,2),n.createVNode("span",o,n.toDisplayString(r.label(e)),1)],42,["href","onClick","onKeydown"]),[[u]])])),_:2},1032,["to"])):n.withDirectives((n.openBlock(),n.createBlock("a",{key:1,href:e.url,class:r.linkClass(e),target:e.target,"aria-haspopup":null!=e.items,"aria-expanded":e===a.activeItem,onClick:t=>r.onItemClick(t,e),onKeydown:t=>r.onItemKeyDown(t,e),role:"menuitem",tabindex:r.disabled(e)?null:"0"},[n.createVNode("span",{class:["p-menuitem-icon",e.icon]},null,2),n.createVNode("span",s,n.toDisplayString(r.label(e)),1),e.items?(n.openBlock(),n.createBlock("span",{key:0,class:r.getSubmenuIcon()},null,2)):n.createCommentVNode("",!0)],42,["href","target","aria-haspopup","aria-expanded","onClick","onKeydown","tabindex"])),[[u]])],64)),r.visible(e)&&e.items?(n.openBlock(),n.createBlock(m,{model:e.items,key:r.label(e)+"_sub_",mobileActive:i.mobileActive,onLeafClick:r.onLeafClick,onKeydownItem:r.onChildItemKeyDown,parentActive:e===a.activeItem,template:i.template,exact:i.exact},null,8,["model","mobileActive","onLeafClick","onKeydownItem","parentActive","template","exact"])):n.createCommentVNode("",!0)],46,["onMouseenter"])):n.createCommentVNode("",!0),r.visible(e)&&e.separator?(n.openBlock(),n.createBlock("li",{class:["p-menu-separator",e.class],style:e.style,key:"separator"+t.toString(),role:"separator"},null,6)):n.createCommentVNode("",!0)],64)))),128))],10,["role"])};var a={name:"Menubar",props:{model:{type:Array,default:null},exact:{type:Boolean,default:!0}},outsideClickListener:null,data:()=>({mobileActive:!1}),beforeUnmount(){this.mobileActive=!1,this.unbindOutsideClickListener(),this.$refs.rootmenu&&this.$refs.rootmenu.$el&&e.ZIndexUtils.clear(this.$refs.rootmenu.$el)},methods:{toggle(t){this.mobileActive?(this.mobileActive=!1,e.ZIndexUtils.clear(this.$refs.rootmenu.$el)):(this.mobileActive=!0,e.ZIndexUtils.set("menu",this.$refs.rootmenu.$el,this.$primevue.config.zIndex.menu)),this.bindOutsideClickListener(),t.preventDefault()},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{!this.mobileActive||this.$refs.rootmenu.$el===e.target||this.$refs.rootmenu.$el.contains(e.target)||this.$refs.menubutton===e.target||this.$refs.menubutton.contains(e.target)||(this.mobileActive=!1)},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},onLeafClick(){this.mobileActive=!1}},computed:{containerClass(){return["p-menubar p-component",{"p-menubar-mobile-active":this.mobileActive}]}},components:{MenubarSub:l}};const r={key:0,class:"p-menubar-start"},c=n.createVNode("i",{class:"pi pi-bars"},null,-1),m={key:1,class:"p-menubar-end"};return function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],l=document.createElement("style");l.type="text/css","top"===n&&i.firstChild?i.insertBefore(l,i.firstChild):i.appendChild(l),l.styleSheet?l.styleSheet.cssText=e:l.appendChild(document.createTextNode(e))}}("\n.p-menubar {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n}\n.p-menubar ul {\n margin: 0;\n padding: 0;\n list-style: none;\n}\n.p-menubar .p-menuitem-link {\n cursor: pointer;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n text-decoration: none;\n overflow: hidden;\n position: relative;\n}\n.p-menubar .p-menuitem-text {\n line-height: 1;\n}\n.p-menubar .p-menuitem {\n position: relative;\n}\n.p-menubar-root-list {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n}\n.p-menubar-root-list > li ul {\n display: none;\n z-index: 1;\n}\n.p-menubar-root-list > .p-menuitem-active > .p-submenu-list {\n display: block;\n}\n.p-menubar .p-submenu-list {\n display: none;\n position: absolute;\n z-index: 1;\n}\n.p-menubar .p-submenu-list > .p-menuitem-active > .p-submenu-list {\n display: block;\n left: 100%;\n top: 0;\n}\n.p-menubar .p-submenu-list .p-menuitem-link .p-submenu-icon {\n margin-left: auto;\n}\n.p-menubar .p-menubar-custom,\n.p-menubar .p-menubar-end {\n margin-left: auto;\n -ms-flex-item-align: center;\n align-self: center;\n}\n.p-menubar-button {\n display: none;\n cursor: pointer;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n}\n"),a.render=function(e,t,i,l,o,s){const a=n.resolveComponent("MenubarSub");return n.openBlock(),n.createBlock("div",{class:s.containerClass},[e.$slots.start?(n.openBlock(),n.createBlock("div",r,[n.renderSlot(e.$slots,"start")])):n.createCommentVNode("",!0),n.createVNode("a",{ref:"menubutton",tabindex:"0",class:"p-menubar-button",onClick:t[1]||(t[1]=e=>s.toggle(e))},[c],512),n.createVNode(a,{ref:"rootmenu",model:i.model,root:!0,mobileActive:o.mobileActive,onLeafClick:s.onLeafClick,template:e.$slots.item,exact:i.exact},null,8,["model","mobileActive","onLeafClick","template","exact"]),e.$slots.end?(n.openBlock(),n.createBlock("div",m,[n.renderSlot(e.$slots,"end")])):n.createCommentVNode("",!0)],2)},a}(primevue.utils,primevue.ripple,Vue);
|
package/message/Message.d.ts
CHANGED
package/message/Message.vue
CHANGED
|
@@ -36,7 +36,11 @@ export default {
|
|
|
36
36
|
life: {
|
|
37
37
|
type: Number,
|
|
38
38
|
default: 3000
|
|
39
|
-
}
|
|
39
|
+
},
|
|
40
|
+
icon: {
|
|
41
|
+
type: String,
|
|
42
|
+
default: null
|
|
43
|
+
},
|
|
40
44
|
},
|
|
41
45
|
timeout: null,
|
|
42
46
|
data() {
|
|
@@ -62,7 +66,7 @@ export default {
|
|
|
62
66
|
return 'p-message p-component p-message-' + this.severity;
|
|
63
67
|
},
|
|
64
68
|
iconClass() {
|
|
65
|
-
return ['p-message-icon pi', {
|
|
69
|
+
return ['p-message-icon pi', this.icon ? this.icon : {
|
|
66
70
|
'pi-info-circle': this.severity === 'info',
|
|
67
71
|
'pi-check': this.severity === 'success',
|
|
68
72
|
'pi-exclamation-triangle': this.severity === 'warn',
|
package/message/message.cjs.js
CHANGED
|
@@ -26,7 +26,11 @@ var script = {
|
|
|
26
26
|
life: {
|
|
27
27
|
type: Number,
|
|
28
28
|
default: 3000
|
|
29
|
-
}
|
|
29
|
+
},
|
|
30
|
+
icon: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: null
|
|
33
|
+
},
|
|
30
34
|
},
|
|
31
35
|
timeout: null,
|
|
32
36
|
data() {
|
|
@@ -52,7 +56,7 @@ var script = {
|
|
|
52
56
|
return 'p-message p-component p-message-' + this.severity;
|
|
53
57
|
},
|
|
54
58
|
iconClass() {
|
|
55
|
-
return ['p-message-icon pi', {
|
|
59
|
+
return ['p-message-icon pi', this.icon ? this.icon : {
|
|
56
60
|
'pi-info-circle': this.severity === 'info',
|
|
57
61
|
'pi-check': this.severity === 'success',
|
|
58
62
|
'pi-exclamation-triangle': this.severity === 'warn',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("primevue/ripple"),t=require("vue");function
|
|
1
|
+
"use strict";var e=require("primevue/ripple"),t=require("vue");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s={name:"Message",emits:["close"],props:{severity:{type:String,default:"info"},closable:{type:Boolean,default:!0},sticky:{type:Boolean,default:!0},life:{type:Number,default:3e3},icon:{type:String,default:null}},timeout:null,data:()=>({visible:!0}),mounted(){this.sticky||setTimeout((()=>{this.visible=!1}),this.life)},methods:{close(e){this.visible=!1,this.$emit("close",e)}},computed:{containerClass(){return"p-message p-component p-message-"+this.severity},iconClass(){return["p-message-icon pi",this.icon?this.icon:{"pi-info-circle":"info"===this.severity,"pi-check":"success"===this.severity,"pi-exclamation-triangle":"warn"===this.severity,"pi-times-circle":"error"===this.severity}]}},directives:{ripple:i(e).default}};const n={class:"p-message-wrapper"},a={class:"p-message-text"},o=t.createVNode("i",{class:"p-message-close-icon pi pi-times"},null,-1);!function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var s=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===i&&s.firstChild?s.insertBefore(n,s.firstChild):s.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}}("\n.p-message-wrapper {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n}\n.p-message-close {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n}\n.p-message-close.p-link {\n margin-left: auto;\n overflow: hidden;\n position: relative;\n}\n.p-message-enter-from {\n opacity: 0;\n}\n.p-message-enter-active {\n -webkit-transition: opacity .3s;\n transition: opacity .3s;\n}\n.p-message.p-message-leave-from {\n max-height: 1000px;\n}\n.p-message.p-message-leave-to {\n max-height: 0;\n opacity: 0;\n margin: 0 !important;\n}\n.p-message-leave-active {\n overflow: hidden;\n -webkit-transition: max-height .3s cubic-bezier(0, 1, 0, 1), opacity .3s, margin .15s;\n transition: max-height .3s cubic-bezier(0, 1, 0, 1), opacity .3s, margin .15s;\n}\n.p-message-leave-active .p-message-close {\n display: none;\n}\n"),s.render=function(e,i,s,l,r,c){const p=t.resolveDirective("ripple");return t.openBlock(),t.createBlock(t.Transition,{name:"p-message",appear:""},{default:t.withCtx((()=>[t.withDirectives(t.createVNode("div",{class:c.containerClass,role:"alert"},[t.createVNode("div",n,[t.createVNode("span",{class:c.iconClass},null,2),t.createVNode("div",a,[t.renderSlot(e.$slots,"default")]),s.closable?t.withDirectives((t.openBlock(),t.createBlock("button",{key:0,class:"p-message-close p-link",onClick:i[1]||(i[1]=e=>c.close(e)),type:"button"},[o],512)),[[p]]):t.createCommentVNode("",!0)])],2),[[t.vShow,r.visible]])])),_:3})},module.exports=s;
|
package/message/message.esm.js
CHANGED
|
@@ -20,7 +20,11 @@ var script = {
|
|
|
20
20
|
life: {
|
|
21
21
|
type: Number,
|
|
22
22
|
default: 3000
|
|
23
|
-
}
|
|
23
|
+
},
|
|
24
|
+
icon: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: null
|
|
27
|
+
},
|
|
24
28
|
},
|
|
25
29
|
timeout: null,
|
|
26
30
|
data() {
|
|
@@ -46,7 +50,7 @@ var script = {
|
|
|
46
50
|
return 'p-message p-component p-message-' + this.severity;
|
|
47
51
|
},
|
|
48
52
|
iconClass() {
|
|
49
|
-
return ['p-message-icon pi', {
|
|
53
|
+
return ['p-message-icon pi', this.icon ? this.icon : {
|
|
50
54
|
'pi-info-circle': this.severity === 'info',
|
|
51
55
|
'pi-check': this.severity === 'success',
|
|
52
56
|
'pi-exclamation-triangle': this.severity === 'warn',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"primevue/ripple";import{resolveDirective as s,openBlock as t,createBlock as i,Transition as n,withCtx as a,withDirectives as l,createVNode as o,renderSlot as p,createCommentVNode as r,vShow as c}from"vue";var m={name:"Message",emits:["close"],props:{severity:{type:String,default:"info"},closable:{type:Boolean,default:!0},sticky:{type:Boolean,default:!0},life:{type:Number,default:3e3}},timeout:null,data:()=>({visible:!0}),mounted(){this.sticky||setTimeout((()=>{this.visible=!1}),this.life)},methods:{close(e){this.visible=!1,this.$emit("close",e)}},computed:{containerClass(){return"p-message p-component p-message-"+this.severity},iconClass(){return["p-message-icon pi",{"pi-info-circle":"info"===this.severity,"pi-check":"success"===this.severity,"pi-exclamation-triangle":"warn"===this.severity,"pi-times-circle":"error"===this.severity}]}},directives:{ripple:e}};const d={class:"p-message-wrapper"},g={class:"p-message-text"},
|
|
1
|
+
import e from"primevue/ripple";import{resolveDirective as s,openBlock as t,createBlock as i,Transition as n,withCtx as a,withDirectives as l,createVNode as o,renderSlot as p,createCommentVNode as r,vShow as c}from"vue";var m={name:"Message",emits:["close"],props:{severity:{type:String,default:"info"},closable:{type:Boolean,default:!0},sticky:{type:Boolean,default:!0},life:{type:Number,default:3e3},icon:{type:String,default:null}},timeout:null,data:()=>({visible:!0}),mounted(){this.sticky||setTimeout((()=>{this.visible=!1}),this.life)},methods:{close(e){this.visible=!1,this.$emit("close",e)}},computed:{containerClass(){return"p-message p-component p-message-"+this.severity},iconClass(){return["p-message-icon pi",this.icon?this.icon:{"pi-info-circle":"info"===this.severity,"pi-check":"success"===this.severity,"pi-exclamation-triangle":"warn"===this.severity,"pi-times-circle":"error"===this.severity}]}},directives:{ripple:e}};const d={class:"p-message-wrapper"},g={class:"p-message-text"},u=o("i",{class:"p-message-close-icon pi pi-times"},null,-1);!function(e,s){void 0===s&&(s={});var t=s.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===t&&i.firstChild?i.insertBefore(n,i.firstChild):i.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}}("\n.p-message-wrapper {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n}\n.p-message-close {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n}\n.p-message-close.p-link {\n margin-left: auto;\n overflow: hidden;\n position: relative;\n}\n.p-message-enter-from {\n opacity: 0;\n}\n.p-message-enter-active {\n -webkit-transition: opacity .3s;\n transition: opacity .3s;\n}\n.p-message.p-message-leave-from {\n max-height: 1000px;\n}\n.p-message.p-message-leave-to {\n max-height: 0;\n opacity: 0;\n margin: 0 !important;\n}\n.p-message-leave-active {\n overflow: hidden;\n -webkit-transition: max-height .3s cubic-bezier(0, 1, 0, 1), opacity .3s, margin .15s;\n transition: max-height .3s cubic-bezier(0, 1, 0, 1), opacity .3s, margin .15s;\n}\n.p-message-leave-active .p-message-close {\n display: none;\n}\n"),m.render=function(e,m,f,y,h,v){const b=s("ripple");return t(),i(n,{name:"p-message",appear:""},{default:a((()=>[l(o("div",{class:v.containerClass,role:"alert"},[o("div",d,[o("span",{class:v.iconClass},null,2),o("div",g,[p(e.$slots,"default")]),f.closable?l((t(),i("button",{key:0,class:"p-message-close p-link",onClick:m[1]||(m[1]=e=>v.close(e)),type:"button"},[u],512)),[[b]]):r("",!0)])],2),[[c,h.visible]])])),_:3})};export default m;
|
package/message/message.js
CHANGED
|
@@ -25,7 +25,11 @@ this.primevue.message = (function (Ripple, vue) {
|
|
|
25
25
|
life: {
|
|
26
26
|
type: Number,
|
|
27
27
|
default: 3000
|
|
28
|
-
}
|
|
28
|
+
},
|
|
29
|
+
icon: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: null
|
|
32
|
+
},
|
|
29
33
|
},
|
|
30
34
|
timeout: null,
|
|
31
35
|
data() {
|
|
@@ -51,7 +55,7 @@ this.primevue.message = (function (Ripple, vue) {
|
|
|
51
55
|
return 'p-message p-component p-message-' + this.severity;
|
|
52
56
|
},
|
|
53
57
|
iconClass() {
|
|
54
|
-
return ['p-message-icon pi', {
|
|
58
|
+
return ['p-message-icon pi', this.icon ? this.icon : {
|
|
55
59
|
'pi-info-circle': this.severity === 'info',
|
|
56
60
|
'pi-check': this.severity === 'success',
|
|
57
61
|
'pi-exclamation-triangle': this.severity === 'warn',
|
package/message/message.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primevue=this.primevue||{},this.primevue.message=function(e,t){"use strict";function
|
|
1
|
+
this.primevue=this.primevue||{},this.primevue.message=function(e,t){"use strict";function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s={name:"Message",emits:["close"],props:{severity:{type:String,default:"info"},closable:{type:Boolean,default:!0},sticky:{type:Boolean,default:!0},life:{type:Number,default:3e3},icon:{type:String,default:null}},timeout:null,data:()=>({visible:!0}),mounted(){this.sticky||setTimeout((()=>{this.visible=!1}),this.life)},methods:{close(e){this.visible=!1,this.$emit("close",e)}},computed:{containerClass(){return"p-message p-component p-message-"+this.severity},iconClass(){return["p-message-icon pi",this.icon?this.icon:{"pi-info-circle":"info"===this.severity,"pi-check":"success"===this.severity,"pi-exclamation-triangle":"warn"===this.severity,"pi-times-circle":"error"===this.severity}]}},directives:{ripple:i(e).default}};const n={class:"p-message-wrapper"},a={class:"p-message-text"},o=t.createVNode("i",{class:"p-message-close-icon pi pi-times"},null,-1);return function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var s=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===i&&s.firstChild?s.insertBefore(n,s.firstChild):s.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}}("\n.p-message-wrapper {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n}\n.p-message-close {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n}\n.p-message-close.p-link {\n margin-left: auto;\n overflow: hidden;\n position: relative;\n}\n.p-message-enter-from {\n opacity: 0;\n}\n.p-message-enter-active {\n -webkit-transition: opacity .3s;\n transition: opacity .3s;\n}\n.p-message.p-message-leave-from {\n max-height: 1000px;\n}\n.p-message.p-message-leave-to {\n max-height: 0;\n opacity: 0;\n margin: 0 !important;\n}\n.p-message-leave-active {\n overflow: hidden;\n -webkit-transition: max-height .3s cubic-bezier(0, 1, 0, 1), opacity .3s, margin .15s;\n transition: max-height .3s cubic-bezier(0, 1, 0, 1), opacity .3s, margin .15s;\n}\n.p-message-leave-active .p-message-close {\n display: none;\n}\n"),s.render=function(e,i,s,l,r,c){const p=t.resolveDirective("ripple");return t.openBlock(),t.createBlock(t.Transition,{name:"p-message",appear:""},{default:t.withCtx((()=>[t.withDirectives(t.createVNode("div",{class:c.containerClass,role:"alert"},[t.createVNode("div",n,[t.createVNode("span",{class:c.iconClass},null,2),t.createVNode("div",a,[t.renderSlot(e.$slots,"default")]),s.closable?t.withDirectives((t.openBlock(),t.createBlock("button",{key:0,class:"p-message-close p-link",onClick:i[1]||(i[1]=e=>c.close(e)),type:"button"},[o],512)),[[p]]):t.createCommentVNode("",!0)])],2),[[t.vShow,r.visible]])])),_:3})},s}(primevue.ripple,Vue);
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import { VNode } from 'vue';
|
|
2
2
|
import VirtualScrollerProps from '../virtualscroller';
|
|
3
3
|
|
|
4
|
+
type MultiSelectOptionLabelType = string | ((data: any) => string) | undefined;
|
|
5
|
+
type MultiSelectOptionValueType = string | ((data: any) => any) | undefined;
|
|
6
|
+
type MultiSelectOptionDisabledType = string | ((data: any) => boolean) | undefined;
|
|
7
|
+
type MultiSelectOptionChildrenType = string | ((data: any) => any[]) | undefined;
|
|
8
|
+
|
|
4
9
|
interface MultiSelectProps {
|
|
5
10
|
modelValue?: any;
|
|
6
11
|
options?: any[];
|
|
7
|
-
optionLabel?:
|
|
8
|
-
optionValue?:
|
|
9
|
-
optionDisabled?:
|
|
10
|
-
optionGroupLabel?:
|
|
11
|
-
optionGroupChildren?:
|
|
12
|
+
optionLabel?: MultiSelectOptionLabelType;
|
|
13
|
+
optionValue?: MultiSelectOptionValueType;
|
|
14
|
+
optionDisabled?: MultiSelectOptionDisabledType;
|
|
15
|
+
optionGroupLabel?: MultiSelectOptionLabelType;
|
|
16
|
+
optionGroupChildren?: MultiSelectOptionChildrenType;
|
|
12
17
|
scrollHeight?: string;
|
|
13
18
|
placeholder?: string;
|
|
14
19
|
disabled?: boolean;
|
package/orderlist/OrderList.d.ts
CHANGED
package/orderlist/OrderList.vue
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="p-orderlist p-component">
|
|
3
3
|
<div class="p-orderlist-controls">
|
|
4
|
+
<slot name="controlsstart"></slot>
|
|
4
5
|
<OLButton type="button" icon="pi pi-angle-up" @click="moveUp"></OLButton>
|
|
5
6
|
<OLButton type="button" icon="pi pi-angle-double-up" @click="moveTop"></OLButton>
|
|
6
7
|
<OLButton type="button" icon="pi pi-angle-down" @click="moveDown"></OLButton>
|
|
7
8
|
<OLButton type="button" icon="pi pi-angle-double-down" @click="moveBottom"></OLButton>
|
|
9
|
+
<slot name="controlsend"></slot>
|
|
8
10
|
</div>
|
|
9
11
|
<div class="p-orderlist-list-container">
|
|
10
12
|
<div class="p-orderlist-header" v-if="$slots.header">
|