primevue 3.27.0 → 3.28.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 +1 -1
- package/autocomplete/AutoComplete.d.ts +10 -1
- package/autocomplete/AutoComplete.vue +1 -1
- package/autocomplete/autocomplete.cjs.js +4 -1
- package/autocomplete/autocomplete.cjs.min.js +1 -1
- package/autocomplete/autocomplete.esm.js +4 -1
- package/autocomplete/autocomplete.esm.min.js +1 -1
- package/autocomplete/autocomplete.js +4 -1
- package/autocomplete/autocomplete.min.js +1 -1
- package/avatar/Avatar.d.ts +44 -0
- package/avatar/Avatar.vue +10 -8
- package/avatar/avatar.cjs.js +36 -34
- package/avatar/avatar.cjs.min.js +1 -1
- package/avatar/avatar.esm.js +33 -35
- package/avatar/avatar.esm.min.js +1 -1
- package/avatar/avatar.js +37 -36
- package/avatar/avatar.min.js +1 -1
- package/avatargroup/AvatarGroup.d.ts +27 -1
- package/avatargroup/AvatarGroup.vue +5 -2
- package/avatargroup/avatargroup.cjs.js +9 -5
- package/avatargroup/avatargroup.cjs.min.js +1 -1
- package/avatargroup/avatargroup.esm.js +6 -6
- package/avatargroup/avatargroup.esm.min.js +1 -1
- package/avatargroup/avatargroup.js +10 -7
- package/avatargroup/avatargroup.min.js +1 -1
- package/badge/Badge.d.ts +32 -0
- package/badge/Badge.vue +3 -1
- package/badge/badge.cjs.js +8 -4
- package/badge/badge.cjs.min.js +1 -1
- package/badge/badge.esm.js +5 -5
- package/badge/badge.esm.min.js +1 -1
- package/badge/badge.js +9 -6
- package/badge/badge.min.js +1 -1
- package/basecomponent/BaseComponent.vue +10 -3
- package/basecomponent/basecomponent.cjs.js +10 -3
- package/basecomponent/basecomponent.cjs.min.js +1 -1
- package/basecomponent/basecomponent.esm.js +10 -3
- package/basecomponent/basecomponent.esm.min.js +1 -1
- package/basecomponent/basecomponent.js +10 -3
- package/basecomponent/basecomponent.min.js +1 -1
- package/baseicon/BaseIcon.vue +2 -2
- package/baseicon/baseicon.cjs.js +2 -2
- package/baseicon/baseicon.cjs.min.js +1 -1
- package/baseicon/baseicon.esm.js +2 -2
- package/baseicon/baseicon.esm.min.js +1 -1
- package/baseicon/baseicon.js +2 -2
- package/baseicon/baseicon.min.js +1 -1
- package/blockui/BlockUI.d.ts +44 -0
- package/blockui/BlockUI.vue +3 -1
- package/blockui/blockui.cjs.js +9 -3
- package/blockui/blockui.cjs.min.js +1 -1
- package/blockui/blockui.esm.js +6 -4
- package/blockui/blockui.esm.min.js +1 -1
- package/blockui/blockui.js +10 -5
- package/blockui/blockui.min.js +1 -1
- package/breadcrumb/Breadcrumb.d.ts +60 -0
- package/breadcrumb/Breadcrumb.vue +8 -6
- package/breadcrumb/BreadcrumbItem.vue +14 -10
- package/breadcrumb/breadcrumb.cjs.js +53 -51
- package/breadcrumb/breadcrumb.cjs.min.js +1 -1
- package/breadcrumb/breadcrumb.esm.js +53 -52
- package/breadcrumb/breadcrumb.esm.min.js +1 -1
- package/breadcrumb/breadcrumb.js +54 -53
- package/breadcrumb/breadcrumb.min.js +1 -1
- package/button/Button.d.ts +48 -0
- package/button/Button.vue +10 -9
- package/button/button.cjs.js +43 -44
- package/button/button.cjs.min.js +1 -1
- package/button/button.esm.js +43 -45
- package/button/button.esm.min.js +1 -1
- package/button/button.js +44 -46
- package/button/button.min.js +1 -1
- package/chart/Chart.d.ts +36 -0
- package/chart/Chart.vue +5 -2
- package/chart/chart.cjs.js +10 -5
- package/chart/chart.cjs.min.js +1 -1
- package/chart/chart.esm.js +7 -6
- package/chart/chart.esm.min.js +1 -1
- package/chart/chart.js +11 -7
- package/chart/chart.min.js +1 -1
- package/chip/Chip.d.ts +60 -0
- package/chip/Chip.vue +10 -9
- package/chip/chip.cjs.js +35 -36
- package/chip/chip.cjs.min.js +1 -1
- package/chip/chip.esm.js +35 -37
- package/chip/chip.esm.min.js +1 -1
- package/chip/chip.js +36 -38
- package/chip/chip.min.js +1 -1
- package/config/PrimeVue.d.ts +8 -0
- package/config/config.cjs.js +3 -1
- package/config/config.cjs.min.js +1 -1
- package/config/config.esm.js +3 -2
- package/config/config.esm.min.js +1 -1
- package/config/config.js +3 -1
- package/config/config.min.js +1 -1
- package/confirmdialog/ConfirmDialog.d.ts +88 -0
- package/confirmdialog/ConfirmDialog.vue +9 -6
- package/confirmdialog/confirmdialog.cjs.js +22 -18
- package/confirmdialog/confirmdialog.cjs.min.js +1 -1
- package/confirmdialog/confirmdialog.esm.js +22 -19
- package/confirmdialog/confirmdialog.esm.min.js +1 -1
- package/confirmdialog/confirmdialog.js +23 -20
- package/confirmdialog/confirmdialog.min.js +1 -1
- package/confirmpopup/ConfirmPopup.d.ts +75 -0
- package/confirmpopup/ConfirmPopup.vue +11 -9
- package/confirmpopup/confirmpopup.cjs.js +27 -25
- package/confirmpopup/confirmpopup.cjs.min.js +1 -1
- package/confirmpopup/confirmpopup.esm.js +27 -26
- package/confirmpopup/confirmpopup.esm.min.js +1 -1
- package/confirmpopup/confirmpopup.js +28 -27
- package/confirmpopup/confirmpopup.min.js +1 -1
- package/contextmenu/ContextMenu.d.ts +135 -0
- package/contextmenu/ContextMenu.vue +4 -1
- package/contextmenu/ContextMenuSub.vue +46 -10
- package/contextmenu/contextmenu.cjs.js +57 -46
- package/contextmenu/contextmenu.cjs.min.js +1 -1
- package/contextmenu/contextmenu.esm.js +57 -47
- package/contextmenu/contextmenu.esm.min.js +1 -1
- package/contextmenu/contextmenu.js +58 -48
- package/contextmenu/contextmenu.min.js +1 -1
- package/core/core.js +278 -246
- package/core/core.min.js +11 -11
- package/dialog/Dialog.d.ts +87 -0
- package/dialog/Dialog.vue +23 -10
- package/dialog/dialog.cjs.js +31 -30
- package/dialog/dialog.cjs.min.js +1 -1
- package/dialog/dialog.esm.js +31 -31
- package/dialog/dialog.esm.min.js +1 -1
- package/dialog/dialog.js +32 -32
- package/dialog/dialog.min.js +1 -1
- package/dock/Dock.d.ts +94 -0
- package/dock/Dock.vue +4 -2
- package/dock/DockSub.vue +30 -6
- package/dock/dock.cjs.js +52 -39
- package/dock/dock.cjs.min.js +1 -1
- package/dock/dock.esm.js +52 -40
- package/dock/dock.esm.min.js +1 -1
- package/dock/dock.js +53 -41
- package/dock/dock.min.js +1 -1
- package/dropdown/Dropdown.vue +1 -1
- package/dropdown/dropdown.cjs.js +1 -1
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.esm.js +1 -1
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +1 -1
- package/dropdown/dropdown.min.js +1 -1
- package/dynamicdialog/DynamicDialog.vue +3 -1
- package/dynamicdialog/dynamicdialog.cjs.js +5 -1
- package/dynamicdialog/dynamicdialog.cjs.min.js +1 -1
- package/dynamicdialog/dynamicdialog.esm.js +4 -1
- package/dynamicdialog/dynamicdialog.esm.min.js +1 -1
- package/dynamicdialog/dynamicdialog.js +6 -3
- package/dynamicdialog/dynamicdialog.min.js +1 -1
- package/fileupload/FileContent.vue +11 -9
- package/fileupload/FileUpload.d.ts +154 -0
- package/fileupload/FileUpload.vue +26 -24
- package/fileupload/fileupload.cjs.js +100 -97
- package/fileupload/fileupload.cjs.min.js +1 -1
- package/fileupload/fileupload.esm.js +100 -98
- package/fileupload/fileupload.esm.min.js +1 -1
- package/fileupload/fileupload.js +101 -99
- package/fileupload/fileupload.min.js +1 -1
- package/inlinemessage/InlineMessage.d.ts +52 -0
- package/inlinemessage/InlineMessage.vue +7 -3
- package/inlinemessage/inlinemessage.cjs.js +12 -11
- package/inlinemessage/inlinemessage.cjs.min.js +1 -1
- package/inlinemessage/inlinemessage.esm.js +12 -12
- package/inlinemessage/inlinemessage.esm.min.js +1 -1
- package/inlinemessage/inlinemessage.js +13 -13
- package/inlinemessage/inlinemessage.min.js +1 -1
- package/inplace/Inplace.d.ts +59 -0
- package/inplace/Inplace.vue +7 -5
- package/inplace/inplace.cjs.js +17 -16
- package/inplace/inplace.cjs.min.js +1 -1
- package/inplace/inplace.esm.js +17 -17
- package/inplace/inplace.esm.min.js +1 -1
- package/inplace/inplace.js +18 -18
- package/inplace/inplace.min.js +1 -1
- package/listbox/Listbox.d.ts +1 -1
- package/megamenu/MegaMenu.d.ts +149 -0
- package/megamenu/MegaMenu.vue +6 -3
- package/megamenu/MegaMenuSub.vue +43 -15
- package/megamenu/megamenu.cjs.js +83 -75
- package/megamenu/megamenu.cjs.min.js +1 -1
- package/megamenu/megamenu.esm.js +83 -76
- package/megamenu/megamenu.esm.min.js +1 -1
- package/megamenu/megamenu.js +84 -77
- package/megamenu/megamenu.min.js +1 -1
- package/menu/Menu.d.ts +113 -0
- package/menu/Menu.vue +11 -8
- package/menu/Menuitem.vue +20 -8
- package/menu/menu.cjs.js +73 -62
- package/menu/menu.cjs.min.js +1 -1
- package/menu/menu.esm.js +73 -63
- package/menu/menu.esm.min.js +1 -1
- package/menu/menu.js +74 -64
- package/menu/menu.min.js +1 -1
- package/menubar/Menubar.d.ts +146 -0
- package/menubar/Menubar.vue +8 -5
- package/menubar/MenubarSub.vue +38 -10
- package/menubar/menubar.cjs.js +70 -60
- package/menubar/menubar.cjs.min.js +1 -1
- package/menubar/menubar.esm.js +70 -61
- package/menubar/menubar.esm.min.js +1 -1
- package/menubar/menubar.js +71 -62
- package/menubar/menubar.min.js +1 -1
- package/message/Message.d.ts +64 -1
- package/message/Message.vue +9 -7
- package/message/message.cjs.js +22 -21
- package/message/message.cjs.min.js +1 -1
- package/message/message.esm.js +22 -22
- package/message/message.esm.min.js +1 -1
- package/message/message.js +23 -23
- package/message/message.min.js +1 -1
- package/multiselect/MultiSelect.d.ts +1 -1
- package/overlaypanel/OverlayPanel.d.ts +56 -0
- package/overlaypanel/OverlayPanel.vue +6 -4
- package/overlaypanel/overlaypanel.cjs.js +13 -10
- package/overlaypanel/overlaypanel.cjs.min.js +1 -1
- package/overlaypanel/overlaypanel.esm.js +13 -11
- package/overlaypanel/overlaypanel.esm.min.js +1 -1
- package/overlaypanel/overlaypanel.js +14 -12
- package/overlaypanel/overlaypanel.min.js +1 -1
- package/package.json +1 -1
- package/panel/Panel.d.ts +10 -1
- package/panel/Panel.vue +1 -1
- package/panel/panel.cjs.js +4 -1
- package/panel/panel.cjs.min.js +1 -1
- package/panel/panel.esm.js +4 -1
- package/panel/panel.esm.min.js +1 -1
- package/panel/panel.js +4 -1
- package/panel/panel.min.js +1 -1
- package/panelmenu/PanelMenu.d.ts +133 -0
- package/panelmenu/PanelMenu.vue +36 -13
- package/panelmenu/PanelMenuList.vue +3 -0
- package/panelmenu/PanelMenuSub.vue +33 -12
- package/panelmenu/panelmenu.cjs.js +115 -96
- package/panelmenu/panelmenu.cjs.min.js +1 -1
- package/panelmenu/panelmenu.esm.js +115 -97
- package/panelmenu/panelmenu.esm.min.js +1 -1
- package/panelmenu/panelmenu.js +116 -98
- package/panelmenu/panelmenu.min.js +1 -1
- package/password/Password.vue +2 -2
- package/password/password.cjs.js +2 -2
- package/password/password.cjs.min.js +1 -1
- package/password/password.esm.js +2 -2
- package/password/password.esm.min.js +1 -1
- package/password/password.js +2 -2
- package/password/password.min.js +1 -1
- package/progressbar/ProgressBar.d.ts +40 -0
- package/progressbar/ProgressBar.vue +8 -5
- package/progressbar/progressbar.cjs.js +25 -23
- package/progressbar/progressbar.cjs.min.js +1 -1
- package/progressbar/progressbar.esm.js +22 -24
- package/progressbar/progressbar.esm.min.js +1 -1
- package/progressbar/progressbar.js +26 -25
- package/progressbar/progressbar.min.js +1 -1
- package/progressspinner/ProgressSpinner.d.ts +40 -0
- package/progressspinner/ProgressSpinner.vue +6 -3
- package/progressspinner/progressspinner.cjs.js +18 -13
- package/progressspinner/progressspinner.cjs.min.js +1 -1
- package/progressspinner/progressspinner.esm.js +15 -14
- package/progressspinner/progressspinner.esm.min.js +1 -1
- package/progressspinner/progressspinner.js +19 -15
- package/progressspinner/progressspinner.min.js +1 -1
- package/resources/themes/arya-blue/theme.css +1 -1
- package/resources/themes/arya-green/theme.css +1 -1
- package/resources/themes/arya-orange/theme.css +1 -1
- package/resources/themes/arya-purple/theme.css +1 -1
- package/resources/themes/bootstrap4-dark-blue/theme.css +1 -1
- package/resources/themes/bootstrap4-dark-purple/theme.css +1 -1
- package/resources/themes/bootstrap4-light-blue/theme.css +1 -1
- package/resources/themes/bootstrap4-light-purple/theme.css +1 -1
- package/resources/themes/fluent-light/theme.css +1 -1
- package/resources/themes/lara-dark-blue/theme.css +1 -1
- package/resources/themes/lara-dark-indigo/theme.css +1 -1
- package/resources/themes/lara-dark-purple/theme.css +1 -1
- package/resources/themes/lara-dark-teal/theme.css +1 -1
- package/resources/themes/lara-light-blue/theme.css +1 -1
- package/resources/themes/lara-light-indigo/theme.css +1 -1
- package/resources/themes/lara-light-purple/theme.css +1 -1
- package/resources/themes/lara-light-teal/theme.css +1 -1
- package/resources/themes/luna-amber/theme.css +1 -1
- package/resources/themes/luna-blue/theme.css +1 -1
- package/resources/themes/luna-green/theme.css +1 -1
- package/resources/themes/luna-pink/theme.css +1 -1
- package/resources/themes/md-dark-deeppurple/theme.css +4 -1
- package/resources/themes/md-dark-indigo/theme.css +4 -1
- package/resources/themes/md-light-deeppurple/theme.css +4 -1
- package/resources/themes/md-light-indigo/theme.css +4 -1
- package/resources/themes/mdc-dark-deeppurple/theme.css +4 -1
- package/resources/themes/mdc-dark-indigo/theme.css +4 -1
- package/resources/themes/mdc-light-deeppurple/theme.css +4 -1
- package/resources/themes/mdc-light-indigo/theme.css +4 -1
- package/resources/themes/mira/theme.css +1 -1
- package/resources/themes/nano/theme.css +1 -1
- package/resources/themes/nova/theme.css +1 -1
- package/resources/themes/nova-accent/theme.css +1 -1
- package/resources/themes/nova-alt/theme.css +1 -1
- package/resources/themes/nova-vue/theme.css +1 -1
- package/resources/themes/rhea/theme.css +1 -1
- package/resources/themes/saga-blue/theme.css +1 -1
- package/resources/themes/saga-green/theme.css +1 -1
- package/resources/themes/saga-orange/theme.css +1 -1
- package/resources/themes/saga-purple/theme.css +1 -1
- package/resources/themes/soho-dark/theme.css +1 -1
- package/resources/themes/soho-light/theme.css +1 -1
- package/resources/themes/tailwind-light/theme.css +1 -1
- package/resources/themes/vela-blue/theme.css +1 -1
- package/resources/themes/vela-green/theme.css +1 -1
- package/resources/themes/vela-orange/theme.css +1 -1
- package/resources/themes/vela-purple/theme.css +1 -1
- package/resources/themes/viva-dark/theme.css +1 -1
- package/resources/themes/viva-light/theme.css +1 -1
- package/scrolltop/ScrollTop.d.ts +48 -0
- package/scrolltop/ScrollTop.vue +5 -2
- package/scrolltop/scrolltop.cjs.js +10 -7
- package/scrolltop/scrolltop.cjs.min.js +1 -1
- package/scrolltop/scrolltop.esm.js +10 -8
- package/scrolltop/scrolltop.esm.min.js +1 -1
- package/scrolltop/scrolltop.js +11 -9
- package/scrolltop/scrolltop.min.js +1 -1
- package/sidebar/Sidebar.d.ts +68 -0
- package/sidebar/Sidebar.vue +9 -7
- package/sidebar/sidebar.cjs.js +26 -24
- package/sidebar/sidebar.cjs.min.js +1 -1
- package/sidebar/sidebar.esm.js +26 -25
- package/sidebar/sidebar.esm.min.js +1 -1
- package/sidebar/sidebar.js +27 -26
- package/sidebar/sidebar.min.js +1 -1
- package/skeleton/Skeleton.d.ts +32 -0
- package/skeleton/Skeleton.vue +4 -1
- package/skeleton/skeleton.cjs.js +10 -4
- package/skeleton/skeleton.cjs.min.js +1 -1
- package/skeleton/skeleton.esm.js +7 -5
- package/skeleton/skeleton.esm.min.js +1 -1
- package/skeleton/skeleton.js +11 -6
- package/skeleton/skeleton.min.js +1 -1
- package/speeddial/SpeedDial.d.ts +101 -0
- package/speeddial/SpeedDial.vue +31 -8
- package/speeddial/speeddial.cjs.js +47 -33
- package/speeddial/speeddial.cjs.min.js +1 -1
- package/speeddial/speeddial.esm.js +47 -34
- package/speeddial/speeddial.esm.min.js +1 -1
- package/speeddial/speeddial.js +48 -35
- package/speeddial/speeddial.min.js +1 -1
- package/splitbutton/SplitButton.d.ts +64 -0
- package/splitbutton/SplitButton.vue +8 -5
- package/splitbutton/splitbutton.cjs.js +23 -18
- package/splitbutton/splitbutton.cjs.min.js +1 -1
- package/splitbutton/splitbutton.esm.js +23 -19
- package/splitbutton/splitbutton.esm.min.js +1 -1
- package/splitbutton/splitbutton.js +24 -20
- package/splitbutton/splitbutton.min.js +1 -1
- package/steps/Steps.d.ts +52 -0
- package/steps/Steps.vue +11 -8
- package/steps/steps.cjs.js +34 -33
- package/steps/steps.cjs.min.js +1 -1
- package/steps/steps.esm.js +31 -34
- package/steps/steps.esm.min.js +1 -1
- package/steps/steps.js +35 -35
- package/steps/steps.min.js +1 -1
- package/tabmenu/TabMenu.d.ts +79 -0
- package/tabmenu/TabMenu.vue +20 -10
- package/tabmenu/tabmenu.cjs.js +47 -41
- package/tabmenu/tabmenu.cjs.min.js +1 -1
- package/tabmenu/tabmenu.esm.js +47 -42
- package/tabmenu/tabmenu.esm.min.js +1 -1
- package/tabmenu/tabmenu.js +48 -43
- package/tabmenu/tabmenu.min.js +1 -1
- package/tag/Tag.d.ts +40 -0
- package/tag/Tag.vue +7 -4
- package/tag/tag.cjs.js +14 -12
- package/tag/tag.cjs.min.js +1 -1
- package/tag/tag.esm.js +11 -13
- package/tag/tag.esm.min.js +1 -1
- package/tag/tag.js +15 -14
- package/tag/tag.min.js +1 -1
- package/terminal/Terminal.d.ts +79 -0
- package/terminal/Terminal.vue +12 -10
- package/terminal/terminal.cjs.js +23 -28
- package/terminal/terminal.cjs.min.js +1 -1
- package/terminal/terminal.esm.js +23 -29
- package/terminal/terminal.esm.min.js +1 -1
- package/terminal/terminal.js +24 -30
- package/terminal/terminal.min.js +1 -1
- package/tieredmenu/TieredMenu.d.ts +130 -0
- package/tieredmenu/TieredMenu.vue +4 -1
- package/tieredmenu/TieredMenuSub.vue +39 -11
- package/tieredmenu/tieredmenu.cjs.js +53 -41
- package/tieredmenu/tieredmenu.cjs.min.js +1 -1
- package/tieredmenu/tieredmenu.esm.js +53 -42
- package/tieredmenu/tieredmenu.esm.min.js +1 -1
- package/tieredmenu/tieredmenu.js +54 -43
- package/tieredmenu/tieredmenu.min.js +1 -1
- package/toast/Toast.d.ts +79 -0
- package/toast/Toast.vue +4 -1
- package/toast/ToastMessage.vue +12 -10
- package/toast/toast.cjs.js +31 -31
- package/toast/toast.cjs.min.js +1 -1
- package/toast/toast.esm.js +31 -32
- package/toast/toast.esm.min.js +1 -1
- package/toast/toast.js +32 -33
- package/toast/toast.min.js +1 -1
- package/treeselect/TreeSelect.d.ts +1 -2
- package/vetur-attributes.json +160 -0
- package/vetur-tags.json +79 -34
- package/web-types.json +404 -2
package/menu/menu.js
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
this.primevue = this.primevue || {};
|
|
2
|
-
this.primevue.menu = (function (OverlayEventBus, Portal, utils, Ripple, vue) {
|
|
2
|
+
this.primevue.menu = (function (BaseComponent, OverlayEventBus, Portal, utils, Ripple, vue) {
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
5
5
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
6
6
|
|
|
7
|
+
var BaseComponent__default = /*#__PURE__*/_interopDefaultLegacy(BaseComponent);
|
|
7
8
|
var OverlayEventBus__default = /*#__PURE__*/_interopDefaultLegacy(OverlayEventBus);
|
|
8
9
|
var Portal__default = /*#__PURE__*/_interopDefaultLegacy(Portal);
|
|
9
10
|
var Ripple__default = /*#__PURE__*/_interopDefaultLegacy(Ripple);
|
|
10
11
|
|
|
11
12
|
var script$1 = {
|
|
12
13
|
name: 'Menuitem',
|
|
14
|
+
extends: BaseComponent__default["default"],
|
|
13
15
|
inheritAttrs: false,
|
|
14
16
|
emits: ['item-click'],
|
|
15
17
|
props: {
|
|
@@ -23,6 +25,16 @@ this.primevue.menu = (function (OverlayEventBus, Portal, utils, Ripple, vue) {
|
|
|
23
25
|
getItemProp(processedItem, name) {
|
|
24
26
|
return processedItem && processedItem.item ? utils.ObjectUtils.getItemValue(processedItem.item[name]) : undefined;
|
|
25
27
|
},
|
|
28
|
+
getPTOptions(key) {
|
|
29
|
+
return this.ptm(key, {
|
|
30
|
+
context: {
|
|
31
|
+
focused: this.isItemFocused()
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
},
|
|
35
|
+
isItemFocused() {
|
|
36
|
+
return this.focusedOptionId === this.id;
|
|
37
|
+
},
|
|
26
38
|
onItemActionClick(event, navigate) {
|
|
27
39
|
navigate && navigate(event);
|
|
28
40
|
},
|
|
@@ -66,28 +78,26 @@ this.primevue.menu = (function (OverlayEventBus, Portal, utils, Ripple, vue) {
|
|
|
66
78
|
|
|
67
79
|
const _hoisted_1$1 = ["id", "aria-label", "aria-disabled"];
|
|
68
80
|
const _hoisted_2$1 = ["href", "onClick"];
|
|
69
|
-
const _hoisted_3$1 =
|
|
70
|
-
const _hoisted_4$1 = ["href", "target"];
|
|
71
|
-
const _hoisted_5$1 = { class: "p-menuitem-text" };
|
|
81
|
+
const _hoisted_3$1 = ["href", "target"];
|
|
72
82
|
|
|
73
83
|
function render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
74
84
|
const _component_router_link = vue.resolveComponent("router-link");
|
|
75
85
|
const _directive_ripple = vue.resolveDirective("ripple");
|
|
76
86
|
|
|
77
87
|
return ($options.visible())
|
|
78
|
-
? (vue.openBlock(), vue.createElementBlock("li", {
|
|
88
|
+
? (vue.openBlock(), vue.createElementBlock("li", vue.mergeProps({
|
|
79
89
|
key: 0,
|
|
80
90
|
id: $props.id,
|
|
81
|
-
class:
|
|
91
|
+
class: $options.containerClass(),
|
|
82
92
|
role: "menuitem",
|
|
83
|
-
style:
|
|
93
|
+
style: $props.item.style,
|
|
84
94
|
"aria-label": $options.label(),
|
|
85
95
|
"aria-disabled": $options.disabled()
|
|
86
|
-
}, [
|
|
87
|
-
vue.createElementVNode("div", {
|
|
96
|
+
}, $options.getPTOptions('menuitem')), [
|
|
97
|
+
vue.createElementVNode("div", vue.mergeProps({
|
|
88
98
|
class: "p-menuitem-content",
|
|
89
99
|
onClick: _cache[0] || (_cache[0] = $event => ($options.onItemClick($event)))
|
|
90
|
-
}, [
|
|
100
|
+
}, $options.getPTOptions('content')), [
|
|
91
101
|
(!$props.templates.item)
|
|
92
102
|
? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|
|
93
103
|
($props.item.to && !$options.disabled())
|
|
@@ -97,13 +107,13 @@ this.primevue.menu = (function (OverlayEventBus, Portal, utils, Ripple, vue) {
|
|
|
97
107
|
custom: ""
|
|
98
108
|
}, {
|
|
99
109
|
default: vue.withCtx(({ navigate, href, isActive, isExactActive }) => [
|
|
100
|
-
vue.withDirectives((vue.openBlock(), vue.createElementBlock("a", {
|
|
110
|
+
vue.withDirectives((vue.openBlock(), vue.createElementBlock("a", vue.mergeProps({
|
|
101
111
|
href: href,
|
|
102
|
-
class:
|
|
112
|
+
class: $options.linkClass({ isActive, isExactActive }),
|
|
103
113
|
tabindex: "-1",
|
|
104
114
|
"aria-hidden": "true",
|
|
105
115
|
onClick: $event => ($options.onItemActionClick($event, navigate))
|
|
106
|
-
}, [
|
|
116
|
+
}, $options.getPTOptions('action')), [
|
|
107
117
|
($props.templates.itemicon)
|
|
108
118
|
? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent($props.templates.itemicon), {
|
|
109
119
|
key: 0,
|
|
@@ -111,26 +121,26 @@ this.primevue.menu = (function (OverlayEventBus, Portal, utils, Ripple, vue) {
|
|
|
111
121
|
class: vue.normalizeClass($options.iconClass)
|
|
112
122
|
}, null, 8, ["item", "class"]))
|
|
113
123
|
: ($props.item.icon)
|
|
114
|
-
? (vue.openBlock(), vue.createElementBlock("span", {
|
|
124
|
+
? (vue.openBlock(), vue.createElementBlock("span", vue.mergeProps({
|
|
115
125
|
key: 1,
|
|
116
|
-
class:
|
|
117
|
-
}, null,
|
|
126
|
+
class: $options.iconClass
|
|
127
|
+
}, $options.getPTOptions('icon')), null, 16))
|
|
118
128
|
: vue.createCommentVNode("", true),
|
|
119
|
-
vue.createElementVNode("span",
|
|
120
|
-
],
|
|
129
|
+
vue.createElementVNode("span", vue.mergeProps({ class: "p-menuitem-text" }, $options.getPTOptions('label')), vue.toDisplayString($options.label()), 17)
|
|
130
|
+
], 16, _hoisted_2$1)), [
|
|
121
131
|
[_directive_ripple]
|
|
122
132
|
])
|
|
123
133
|
]),
|
|
124
134
|
_: 1
|
|
125
135
|
}, 8, ["to"]))
|
|
126
|
-
: vue.withDirectives((vue.openBlock(), vue.createElementBlock("a", {
|
|
136
|
+
: vue.withDirectives((vue.openBlock(), vue.createElementBlock("a", vue.mergeProps({
|
|
127
137
|
key: 1,
|
|
128
138
|
href: $props.item.url,
|
|
129
|
-
class:
|
|
139
|
+
class: $options.linkClass(),
|
|
130
140
|
target: $props.item.target,
|
|
131
141
|
tabindex: "-1",
|
|
132
142
|
"aria-hidden": "true"
|
|
133
|
-
}, [
|
|
143
|
+
}, $options.getPTOptions('action')), [
|
|
134
144
|
($props.templates.itemicon)
|
|
135
145
|
? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent($props.templates.itemicon), {
|
|
136
146
|
key: 0,
|
|
@@ -138,13 +148,13 @@ this.primevue.menu = (function (OverlayEventBus, Portal, utils, Ripple, vue) {
|
|
|
138
148
|
class: vue.normalizeClass($options.iconClass)
|
|
139
149
|
}, null, 8, ["item", "class"]))
|
|
140
150
|
: ($props.item.icon)
|
|
141
|
-
? (vue.openBlock(), vue.createElementBlock("span", {
|
|
151
|
+
? (vue.openBlock(), vue.createElementBlock("span", vue.mergeProps({
|
|
142
152
|
key: 1,
|
|
143
|
-
class:
|
|
144
|
-
}, null,
|
|
153
|
+
class: $options.iconClass
|
|
154
|
+
}, $options.getPTOptions('icon')), null, 16))
|
|
145
155
|
: vue.createCommentVNode("", true),
|
|
146
|
-
vue.createElementVNode("span",
|
|
147
|
-
],
|
|
156
|
+
vue.createElementVNode("span", vue.mergeProps({ class: "p-menuitem-text" }, $options.getPTOptions('label')), vue.toDisplayString($options.label()), 17)
|
|
157
|
+
], 16, _hoisted_3$1)), [
|
|
148
158
|
[_directive_ripple]
|
|
149
159
|
])
|
|
150
160
|
], 64))
|
|
@@ -152,8 +162,8 @@ this.primevue.menu = (function (OverlayEventBus, Portal, utils, Ripple, vue) {
|
|
|
152
162
|
key: 1,
|
|
153
163
|
item: $props.item
|
|
154
164
|
}, null, 8, ["item"]))
|
|
155
|
-
])
|
|
156
|
-
],
|
|
165
|
+
], 16)
|
|
166
|
+
], 16, _hoisted_1$1))
|
|
157
167
|
: vue.createCommentVNode("", true)
|
|
158
168
|
}
|
|
159
169
|
|
|
@@ -161,6 +171,7 @@ this.primevue.menu = (function (OverlayEventBus, Portal, utils, Ripple, vue) {
|
|
|
161
171
|
|
|
162
172
|
var script = {
|
|
163
173
|
name: 'Menu',
|
|
174
|
+
extends: BaseComponent__default["default"],
|
|
164
175
|
inheritAttrs: false,
|
|
165
176
|
emits: ['show', 'hide', 'focus', 'blur'],
|
|
166
177
|
props: {
|
|
@@ -524,16 +535,8 @@ this.primevue.menu = (function (OverlayEventBus, Portal, utils, Ripple, vue) {
|
|
|
524
535
|
};
|
|
525
536
|
|
|
526
537
|
const _hoisted_1 = ["id"];
|
|
527
|
-
const _hoisted_2 =
|
|
528
|
-
|
|
529
|
-
class: "p-menu-start"
|
|
530
|
-
};
|
|
531
|
-
const _hoisted_3 = ["id", "tabindex", "aria-activedescendant", "aria-label", "aria-labelledby"];
|
|
532
|
-
const _hoisted_4 = ["id"];
|
|
533
|
-
const _hoisted_5 = {
|
|
534
|
-
key: 1,
|
|
535
|
-
class: "p-menu-end"
|
|
536
|
-
};
|
|
538
|
+
const _hoisted_2 = ["id", "tabindex", "aria-activedescendant", "aria-label", "aria-labelledby"];
|
|
539
|
+
const _hoisted_3 = ["id"];
|
|
537
540
|
|
|
538
541
|
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
539
542
|
const _component_PVMenuitem = vue.resolveComponent("PVMenuitem");
|
|
@@ -556,16 +559,18 @@ this.primevue.menu = (function (OverlayEventBus, Portal, utils, Ripple, vue) {
|
|
|
556
559
|
key: 0,
|
|
557
560
|
ref: $options.containerRef,
|
|
558
561
|
id: $data.id,
|
|
559
|
-
class: $options.containerClass
|
|
560
|
-
}, _ctx.$attrs, {
|
|
562
|
+
class: $options.containerClass,
|
|
561
563
|
onClick: _cache[3] || (_cache[3] = (...args) => ($options.onOverlayClick && $options.onOverlayClick(...args)))
|
|
562
|
-
}), [
|
|
564
|
+
}, { ..._ctx.$attrs, ..._ctx.ptm('root') }), [
|
|
563
565
|
(_ctx.$slots.start)
|
|
564
|
-
? (vue.openBlock(), vue.createElementBlock("div",
|
|
566
|
+
? (vue.openBlock(), vue.createElementBlock("div", vue.mergeProps({
|
|
567
|
+
key: 0,
|
|
568
|
+
class: "p-menu-start"
|
|
569
|
+
}, _ctx.ptm('start')), [
|
|
565
570
|
vue.renderSlot(_ctx.$slots, "start")
|
|
566
|
-
]))
|
|
571
|
+
], 16))
|
|
567
572
|
: vue.createCommentVNode("", true),
|
|
568
|
-
vue.createElementVNode("ul", {
|
|
573
|
+
vue.createElementVNode("ul", vue.mergeProps({
|
|
569
574
|
ref: $options.listRef,
|
|
570
575
|
id: $data.id + '_list',
|
|
571
576
|
class: "p-menu-list p-reset",
|
|
@@ -577,7 +582,7 @@ this.primevue.menu = (function (OverlayEventBus, Portal, utils, Ripple, vue) {
|
|
|
577
582
|
onFocus: _cache[0] || (_cache[0] = (...args) => ($options.onListFocus && $options.onListFocus(...args))),
|
|
578
583
|
onBlur: _cache[1] || (_cache[1] = (...args) => ($options.onListBlur && $options.onListBlur(...args))),
|
|
579
584
|
onKeydown: _cache[2] || (_cache[2] = (...args) => ($options.onListKeyDown && $options.onListKeyDown(...args)))
|
|
580
|
-
}, [
|
|
585
|
+
}, _ctx.ptm('menu')), [
|
|
581
586
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($props.model, (item, i) => {
|
|
582
587
|
return (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
|
|
583
588
|
key: $options.label(item) + i.toString()
|
|
@@ -585,16 +590,16 @@ this.primevue.menu = (function (OverlayEventBus, Portal, utils, Ripple, vue) {
|
|
|
585
590
|
(item.items && $options.visible(item) && !item.separator)
|
|
586
591
|
? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|
|
587
592
|
(item.items)
|
|
588
|
-
? (vue.openBlock(), vue.createElementBlock("li", {
|
|
593
|
+
? (vue.openBlock(), vue.createElementBlock("li", vue.mergeProps({
|
|
589
594
|
key: 0,
|
|
590
595
|
id: $data.id + '_' + i,
|
|
591
596
|
class: "p-submenu-header",
|
|
592
597
|
role: "none"
|
|
593
|
-
}, [
|
|
598
|
+
}, _ctx.ptm('submenuHeader')), [
|
|
594
599
|
vue.renderSlot(_ctx.$slots, "item", { item: item }, () => [
|
|
595
600
|
vue.createTextVNode(vue.toDisplayString($options.label(item)), 1)
|
|
596
601
|
])
|
|
597
|
-
],
|
|
602
|
+
], 16, _hoisted_3))
|
|
598
603
|
: vue.createCommentVNode("", true),
|
|
599
604
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(item.items, (child, j) => {
|
|
600
605
|
return (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
|
|
@@ -608,26 +613,27 @@ this.primevue.menu = (function (OverlayEventBus, Portal, utils, Ripple, vue) {
|
|
|
608
613
|
templates: _ctx.$slots,
|
|
609
614
|
exact: $props.exact,
|
|
610
615
|
focusedOptionId: $options.focusedOptionId,
|
|
611
|
-
onItemClick: $options.itemClick
|
|
612
|
-
|
|
616
|
+
onItemClick: $options.itemClick,
|
|
617
|
+
pt: _ctx.pt
|
|
618
|
+
}, null, 8, ["id", "item", "templates", "exact", "focusedOptionId", "onItemClick", "pt"]))
|
|
613
619
|
: ($options.visible(child) && child.separator)
|
|
614
|
-
? (vue.openBlock(), vue.createElementBlock("li", {
|
|
620
|
+
? (vue.openBlock(), vue.createElementBlock("li", vue.mergeProps({
|
|
615
621
|
key: 'separator' + i + j,
|
|
616
|
-
class:
|
|
617
|
-
style:
|
|
622
|
+
class: $options.separatorClass(item),
|
|
623
|
+
style: child.style,
|
|
618
624
|
role: "separator"
|
|
619
|
-
}, null,
|
|
625
|
+
}, _ctx.ptm('separator')), null, 16))
|
|
620
626
|
: vue.createCommentVNode("", true)
|
|
621
627
|
], 64))
|
|
622
628
|
}), 128))
|
|
623
629
|
], 64))
|
|
624
630
|
: ($options.visible(item) && item.separator)
|
|
625
|
-
? (vue.openBlock(), vue.createElementBlock("li", {
|
|
631
|
+
? (vue.openBlock(), vue.createElementBlock("li", vue.mergeProps({
|
|
626
632
|
key: 'separator' + i.toString(),
|
|
627
|
-
class:
|
|
628
|
-
style:
|
|
633
|
+
class: $options.separatorClass(item),
|
|
634
|
+
style: item.style,
|
|
629
635
|
role: "separator"
|
|
630
|
-
}, null,
|
|
636
|
+
}, _ctx.ptm('separator')), null, 16))
|
|
631
637
|
: (vue.openBlock(), vue.createBlock(_component_PVMenuitem, {
|
|
632
638
|
key: $options.label(item) + i.toString(),
|
|
633
639
|
id: $data.id + '_' + i,
|
|
@@ -635,15 +641,19 @@ this.primevue.menu = (function (OverlayEventBus, Portal, utils, Ripple, vue) {
|
|
|
635
641
|
templates: _ctx.$slots,
|
|
636
642
|
exact: $props.exact,
|
|
637
643
|
focusedOptionId: $options.focusedOptionId,
|
|
638
|
-
onItemClick: $options.itemClick
|
|
639
|
-
|
|
644
|
+
onItemClick: $options.itemClick,
|
|
645
|
+
pt: _ctx.pt
|
|
646
|
+
}, null, 8, ["id", "item", "templates", "exact", "focusedOptionId", "onItemClick", "pt"]))
|
|
640
647
|
], 64))
|
|
641
648
|
}), 128))
|
|
642
|
-
],
|
|
649
|
+
], 16, _hoisted_2),
|
|
643
650
|
(_ctx.$slots.end)
|
|
644
|
-
? (vue.openBlock(), vue.createElementBlock("div",
|
|
651
|
+
? (vue.openBlock(), vue.createElementBlock("div", vue.mergeProps({
|
|
652
|
+
key: 1,
|
|
653
|
+
class: "p-menu-end"
|
|
654
|
+
}, _ctx.ptm('end')), [
|
|
645
655
|
vue.renderSlot(_ctx.$slots, "end")
|
|
646
|
-
]))
|
|
656
|
+
], 16))
|
|
647
657
|
: vue.createCommentVNode("", true)
|
|
648
658
|
], 16, _hoisted_1))
|
|
649
659
|
: vue.createCommentVNode("", true)
|
|
@@ -689,4 +699,4 @@ this.primevue.menu = (function (OverlayEventBus, Portal, utils, Ripple, vue) {
|
|
|
689
699
|
|
|
690
700
|
return script;
|
|
691
701
|
|
|
692
|
-
})(primevue.overlayeventbus, primevue.portal, primevue.utils, primevue.ripple, Vue);
|
|
702
|
+
})(primevue.basecomponent, primevue.overlayeventbus, primevue.portal, primevue.utils, primevue.ripple, Vue);
|
package/menu/menu.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primevue=this.primevue||{},this.primevue.menu=function(e,t,i,n,s){"use strict";function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=l(e),a=l(t),r={name:"Menuitem",inheritAttrs:!1,emits:["item-click"],props:{item:null,templates:null,exact:null,id:null,focusedOptionId:null},methods:{getItemProp:(e,t)=>e&&e.item?i.ObjectUtils.getItemValue(e.item[t]):void 0,onItemActionClick(e,t){t&&t(e)},onItemClick(e){const t=this.getItemProp(this.item,"command");t&&t({originalEvent:e,item:this.item.item}),this.$emit("item-click",{originalEvent:e,item:this.item,id:this.id})},containerClass(){return["p-menuitem",this.item.class,{"p-focus":this.id===this.focusedOptionId,"p-disabled":this.disabled()}]},linkClass(e){return["p-menuitem-link",{"router-link-active":e&&e.isActive,"router-link-active-exact":this.exact&&e&&e.isExactActive}]},visible(){return"function"==typeof this.item.visible?this.item.visible():!1!==this.item.visible},disabled(){return"function"==typeof this.item.disabled?this.item.disabled():this.item.disabled},label(){return"function"==typeof this.item.label?this.item.label():this.item.label}},computed:{iconClass(){return["p-menuitem-icon",this.item.icon]}},directives:{ripple:l(n).default}};const c=["id","aria-label","aria-disabled"],d=["href","onClick"],m={class:"p-menuitem-text"},p=["href","target"],u={class:"p-menuitem-text"};r.render=function(e,t,i,n,l,o){const a=s.resolveComponent("router-link"),r=s.resolveDirective("ripple");return o.visible()?(s.openBlock(),s.createElementBlock("li",{key:0,id:i.id,class:s.normalizeClass(o.containerClass()),role:"menuitem",style:s.normalizeStyle(i.item.style),"aria-label":o.label(),"aria-disabled":o.disabled()},[s.createElementVNode("div",{class:"p-menuitem-content",onClick:t[0]||(t[0]=e=>o.onItemClick(e))},[i.templates.item?(s.openBlock(),s.createBlock(s.resolveDynamicComponent(i.templates.item),{key:1,item:i.item},null,8,["item"])):(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[i.item.to&&!o.disabled()?(s.openBlock(),s.createBlock(a,{key:0,to:i.item.to,custom:""},{default:s.withCtx((({navigate:e,href:t,isActive:n,isExactActive:l})=>[s.withDirectives((s.openBlock(),s.createElementBlock("a",{href:t,class:s.normalizeClass(o.linkClass({isActive:n,isExactActive:l})),tabindex:"-1","aria-hidden":"true",onClick:t=>o.onItemActionClick(t,e)},[i.templates.itemicon?(s.openBlock(),s.createBlock(s.resolveDynamicComponent(i.templates.itemicon),{key:0,item:i.item,class:s.normalizeClass(o.iconClass)},null,8,["item","class"])):i.item.icon?(s.openBlock(),s.createElementBlock("span",{key:1,class:s.normalizeClass(o.iconClass)},null,2)):s.createCommentVNode("",!0),s.createElementVNode("span",m,s.toDisplayString(o.label()),1)],10,d)),[[r]])])),_:1},8,["to"])):s.withDirectives((s.openBlock(),s.createElementBlock("a",{key:1,href:i.item.url,class:s.normalizeClass(o.linkClass()),target:i.item.target,tabindex:"-1","aria-hidden":"true"},[i.templates.itemicon?(s.openBlock(),s.createBlock(s.resolveDynamicComponent(i.templates.itemicon),{key:0,item:i.item,class:s.normalizeClass(o.iconClass)},null,8,["item","class"])):i.item.icon?(s.openBlock(),s.createElementBlock("span",{key:1,class:s.normalizeClass(o.iconClass)},null,2)):s.createCommentVNode("",!0),s.createElementVNode("span",u,s.toDisplayString(o.label()),1)],10,p)),[[r]])],64))])],14,c)):s.createCommentVNode("",!0)};var h={name:"Menu",inheritAttrs:!1,emits:["show","hide","focus","blur"],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},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},data(){return{id:this.$attrs.id,overlayVisible:!1,focused:!1,focusedOptionIndex:-1,selectedOptionIndex:-1}},watch:{"$attrs.id":function(e){this.id=e||i.UniqueComponentId()}},target:null,outsideClickListener:null,scrollHandler:null,resizeListener:null,container:null,list:null,mounted(){this.id=this.id||i.UniqueComponentId(),this.popup||(this.bindResizeListener(),this.bindOutsideClickListener())},beforeUnmount(){this.unbindResizeListener(),this.unbindOutsideClickListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.target=null,this.container&&this.autoZIndex&&i.ZIndexUtils.clear(this.container),this.container=null},methods:{itemClick(e){const t=e.item;this.disabled(t)||(t.command&&t.command(e),t.to&&e.navigate&&e.navigate(e.originalEvent),this.overlayVisible&&this.hide(),this.popup||this.focusedOptionIndex===e.id||(this.focusedOptionIndex=e.id))},onListFocus(e){this.focused=!0,this.popup||(-1!==this.selectedOptionIndex?(this.changeFocusedOptionIndex(this.selectedOptionIndex),this.selectedOptionIndex=-1):this.changeFocusedOptionIndex(0)),this.$emit("focus",e)},onListBlur(e){this.focused=!1,this.focusedOptionIndex=-1,this.$emit("blur",e)},onListKeyDown(e){switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"Enter":this.onEnterKey(e);break;case"Space":this.onSpaceKey(e);break;case"Escape":this.popup&&(i.DomHandler.focus(this.target),this.hide());case"Tab":this.overlayVisible&&this.hide()}},onArrowDownKey(e){const t=this.findNextOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t),e.preventDefault()},onArrowUpKey(e){if(e.altKey&&this.popup)i.DomHandler.focus(this.target),this.hide(),e.preventDefault();else{const t=this.findPrevOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t),e.preventDefault()}},onHomeKey(e){this.changeFocusedOptionIndex(0),e.preventDefault()},onEndKey(e){this.changeFocusedOptionIndex(i.DomHandler.find(this.container,"li.p-menuitem:not(.p-disabled)").length-1),e.preventDefault()},onEnterKey(e){const t=i.DomHandler.findSingle(this.list,`li[id="${this.focusedOptionIndex}"]`),n=t&&i.DomHandler.findSingle(t,".p-menuitem-link");this.popup&&i.DomHandler.focus(this.target),n?n.click():t&&t.click(),e.preventDefault()},onSpaceKey(e){this.onEnterKey(e)},findNextOptionIndex(e){const t=[...i.DomHandler.find(this.container,"li.p-menuitem:not(.p-disabled)")].findIndex((t=>t.id===e));return t>-1?t+1:0},findPrevOptionIndex(e){const t=[...i.DomHandler.find(this.container,"li.p-menuitem:not(.p-disabled)")].findIndex((t=>t.id===e));return t>-1?t-1:0},changeFocusedOptionIndex(e){const t=i.DomHandler.find(this.container,"li.p-menuitem:not(.p-disabled)");let n=e>=t.length?t.length-1:e<0?0:e;n>-1&&(this.focusedOptionIndex=t[n].getAttribute("id"))},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(e){this.alignOverlay(),this.bindOutsideClickListener(),this.bindResizeListener(),this.bindScrollListener(),this.autoZIndex&&i.ZIndexUtils.set("menu",e,this.baseZIndex+this.$primevue.config.zIndex.menu),this.popup&&(i.DomHandler.focus(this.list),this.changeFocusedOptionIndex(0)),this.$emit("show")},onLeave(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.unbindScrollListener(),this.$emit("hide")},onAfterLeave(e){this.autoZIndex&&i.ZIndexUtils.clear(e)},alignOverlay(){i.DomHandler.absolutePosition(this.container,this.target),this.container.style.minWidth=i.DomHandler.getOuterWidth(this.target)+"px"},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{const t=this.container&&!this.container.contains(e.target),i=!(this.target&&(this.target===e.target||this.target.contains(e.target)));this.overlayVisible&&t&&i?this.hide():!this.popup&&t&&i&&(this.focusedOptionIndex=-1)},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new i.ConnectedOverlayScrollHandler(this.target,(()=>{this.overlayVisible&&this.hide()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&!i.DomHandler.isTouchDevice()&&this.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},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,separatorClass:e=>["p-menuitem-separator",e.class],onOverlayClick(e){o.default.emit("overlay-click",{originalEvent:e,target:this.target})},containerRef(e){this.container=e},listRef(e){this.list=e}},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}]},focusedOptionId(){return-1!==this.focusedOptionIndex?this.focusedOptionIndex:null}},components:{PVMenuitem:r,Portal:a.default}};const k=["id"],b={key:0,class:"p-menu-start"},f=["id","tabindex","aria-activedescendant","aria-label","aria-labelledby"],v=["id"],y={key:1,class:"p-menu-end"};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],s=document.createElement("style");s.type="text/css","top"===i&&n.firstChild?n.insertBefore(s,n.firstChild):n.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.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: flex;\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"),h.render=function(e,t,i,n,l,o){const a=s.resolveComponent("PVMenuitem"),r=s.resolveComponent("Portal");return s.openBlock(),s.createBlock(r,{appendTo:i.appendTo,disabled:!i.popup},{default:s.withCtx((()=>[s.createVNode(s.Transition,{name:"p-connected-overlay",onEnter:o.onEnter,onLeave:o.onLeave,onAfterLeave:o.onAfterLeave},{default:s.withCtx((()=>[!i.popup||l.overlayVisible?(s.openBlock(),s.createElementBlock("div",s.mergeProps({key:0,ref:o.containerRef,id:l.id,class:o.containerClass},e.$attrs,{onClick:t[3]||(t[3]=(...e)=>o.onOverlayClick&&o.onOverlayClick(...e))}),[e.$slots.start?(s.openBlock(),s.createElementBlock("div",b,[s.renderSlot(e.$slots,"start")])):s.createCommentVNode("",!0),s.createElementVNode("ul",{ref:o.listRef,id:l.id+"_list",class:"p-menu-list p-reset",role:"menu",tabindex:i.tabindex,"aria-activedescendant":l.focused?o.focusedOptionId:void 0,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,onFocus:t[0]||(t[0]=(...e)=>o.onListFocus&&o.onListFocus(...e)),onBlur:t[1]||(t[1]=(...e)=>o.onListBlur&&o.onListBlur(...e)),onKeydown:t[2]||(t[2]=(...e)=>o.onListKeyDown&&o.onListKeyDown(...e))},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.model,((t,n)=>(s.openBlock(),s.createElementBlock(s.Fragment,{key:o.label(t)+n.toString()},[t.items&&o.visible(t)&&!t.separator?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[t.items?(s.openBlock(),s.createElementBlock("li",{key:0,id:l.id+"_"+n,class:"p-submenu-header",role:"none"},[s.renderSlot(e.$slots,"item",{item:t},(()=>[s.createTextVNode(s.toDisplayString(o.label(t)),1)]))],8,v)):s.createCommentVNode("",!0),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.items,((r,c)=>(s.openBlock(),s.createElementBlock(s.Fragment,{key:r.label+n+"_"+c},[o.visible(r)&&!r.separator?(s.openBlock(),s.createBlock(a,{key:0,id:l.id+"_"+n+"_"+c,item:r,templates:e.$slots,exact:i.exact,focusedOptionId:o.focusedOptionId,onItemClick:o.itemClick},null,8,["id","item","templates","exact","focusedOptionId","onItemClick"])):o.visible(r)&&r.separator?(s.openBlock(),s.createElementBlock("li",{key:"separator"+n+c,class:s.normalizeClass(o.separatorClass(t)),style:s.normalizeStyle(r.style),role:"separator"},null,6)):s.createCommentVNode("",!0)],64)))),128))],64)):o.visible(t)&&t.separator?(s.openBlock(),s.createElementBlock("li",{key:"separator"+n.toString(),class:s.normalizeClass(o.separatorClass(t)),style:s.normalizeStyle(t.style),role:"separator"},null,6)):(s.openBlock(),s.createBlock(a,{key:o.label(t)+n.toString(),id:l.id+"_"+n,item:t,templates:e.$slots,exact:i.exact,focusedOptionId:o.focusedOptionId,onItemClick:o.itemClick},null,8,["id","item","templates","exact","focusedOptionId","onItemClick"]))],64)))),128))],40,f),e.$slots.end?(s.openBlock(),s.createElementBlock("div",y,[s.renderSlot(e.$slots,"end")])):s.createCommentVNode("",!0)],16,k)):s.createCommentVNode("",!0)])),_:3},8,["onEnter","onLeave","onAfterLeave"])])),_:3},8,["appendTo","disabled"])},h}(primevue.overlayeventbus,primevue.portal,primevue.utils,primevue.ripple,Vue);
|
|
1
|
+
this.primevue=this.primevue||{},this.primevue.menu=function(e,t,i,n,s,o){"use strict";function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=l(e),a=l(t),d=l(i),c=l(s),p={name:"Menuitem",extends:r.default,inheritAttrs:!1,emits:["item-click"],props:{item:null,templates:null,exact:null,id:null,focusedOptionId:null},methods:{getItemProp:(e,t)=>e&&e.item?n.ObjectUtils.getItemValue(e.item[t]):void 0,getPTOptions(e){return this.ptm(e,{context:{focused:this.isItemFocused()}})},isItemFocused(){return this.focusedOptionId===this.id},onItemActionClick(e,t){t&&t(e)},onItemClick(e){const t=this.getItemProp(this.item,"command");t&&t({originalEvent:e,item:this.item.item}),this.$emit("item-click",{originalEvent:e,item:this.item,id:this.id})},containerClass(){return["p-menuitem",this.item.class,{"p-focus":this.id===this.focusedOptionId,"p-disabled":this.disabled()}]},linkClass(e){return["p-menuitem-link",{"router-link-active":e&&e.isActive,"router-link-active-exact":this.exact&&e&&e.isExactActive}]},visible(){return"function"==typeof this.item.visible?this.item.visible():!1!==this.item.visible},disabled(){return"function"==typeof this.item.disabled?this.item.disabled():this.item.disabled},label(){return"function"==typeof this.item.label?this.item.label():this.item.label}},computed:{iconClass(){return["p-menuitem-icon",this.item.icon]}},directives:{ripple:c.default}};const m=["id","aria-label","aria-disabled"],u=["href","onClick"],h=["href","target"];p.render=function(e,t,i,n,s,l){const r=o.resolveComponent("router-link"),a=o.resolveDirective("ripple");return l.visible()?(o.openBlock(),o.createElementBlock("li",o.mergeProps({key:0,id:i.id,class:l.containerClass(),role:"menuitem",style:i.item.style,"aria-label":l.label(),"aria-disabled":l.disabled()},l.getPTOptions("menuitem")),[o.createElementVNode("div",o.mergeProps({class:"p-menuitem-content",onClick:t[0]||(t[0]=e=>l.onItemClick(e))},l.getPTOptions("content")),[i.templates.item?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(i.templates.item),{key:1,item:i.item},null,8,["item"])):(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[i.item.to&&!l.disabled()?(o.openBlock(),o.createBlock(r,{key:0,to:i.item.to,custom:""},{default:o.withCtx((({navigate:e,href:t,isActive:n,isExactActive:s})=>[o.withDirectives((o.openBlock(),o.createElementBlock("a",o.mergeProps({href:t,class:l.linkClass({isActive:n,isExactActive:s}),tabindex:"-1","aria-hidden":"true",onClick:t=>l.onItemActionClick(t,e)},l.getPTOptions("action")),[i.templates.itemicon?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(i.templates.itemicon),{key:0,item:i.item,class:o.normalizeClass(l.iconClass)},null,8,["item","class"])):i.item.icon?(o.openBlock(),o.createElementBlock("span",o.mergeProps({key:1,class:l.iconClass},l.getPTOptions("icon")),null,16)):o.createCommentVNode("",!0),o.createElementVNode("span",o.mergeProps({class:"p-menuitem-text"},l.getPTOptions("label")),o.toDisplayString(l.label()),17)],16,u)),[[a]])])),_:1},8,["to"])):o.withDirectives((o.openBlock(),o.createElementBlock("a",o.mergeProps({key:1,href:i.item.url,class:l.linkClass(),target:i.item.target,tabindex:"-1","aria-hidden":"true"},l.getPTOptions("action")),[i.templates.itemicon?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(i.templates.itemicon),{key:0,item:i.item,class:o.normalizeClass(l.iconClass)},null,8,["item","class"])):i.item.icon?(o.openBlock(),o.createElementBlock("span",o.mergeProps({key:1,class:l.iconClass},l.getPTOptions("icon")),null,16)):o.createCommentVNode("",!0),o.createElementVNode("span",o.mergeProps({class:"p-menuitem-text"},l.getPTOptions("label")),o.toDisplayString(l.label()),17)],16,h)),[[a]])],64))],16)],16,m)):o.createCommentVNode("",!0)};var b={name:"Menu",extends:r.default,inheritAttrs:!1,emits:["show","hide","focus","blur"],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},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},data(){return{id:this.$attrs.id,overlayVisible:!1,focused:!1,focusedOptionIndex:-1,selectedOptionIndex:-1}},watch:{"$attrs.id":function(e){this.id=e||n.UniqueComponentId()}},target:null,outsideClickListener:null,scrollHandler:null,resizeListener:null,container:null,list:null,mounted(){this.id=this.id||n.UniqueComponentId(),this.popup||(this.bindResizeListener(),this.bindOutsideClickListener())},beforeUnmount(){this.unbindResizeListener(),this.unbindOutsideClickListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.target=null,this.container&&this.autoZIndex&&n.ZIndexUtils.clear(this.container),this.container=null},methods:{itemClick(e){const t=e.item;this.disabled(t)||(t.command&&t.command(e),t.to&&e.navigate&&e.navigate(e.originalEvent),this.overlayVisible&&this.hide(),this.popup||this.focusedOptionIndex===e.id||(this.focusedOptionIndex=e.id))},onListFocus(e){this.focused=!0,this.popup||(-1!==this.selectedOptionIndex?(this.changeFocusedOptionIndex(this.selectedOptionIndex),this.selectedOptionIndex=-1):this.changeFocusedOptionIndex(0)),this.$emit("focus",e)},onListBlur(e){this.focused=!1,this.focusedOptionIndex=-1,this.$emit("blur",e)},onListKeyDown(e){switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"Enter":this.onEnterKey(e);break;case"Space":this.onSpaceKey(e);break;case"Escape":this.popup&&(n.DomHandler.focus(this.target),this.hide());case"Tab":this.overlayVisible&&this.hide()}},onArrowDownKey(e){const t=this.findNextOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t),e.preventDefault()},onArrowUpKey(e){if(e.altKey&&this.popup)n.DomHandler.focus(this.target),this.hide(),e.preventDefault();else{const t=this.findPrevOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t),e.preventDefault()}},onHomeKey(e){this.changeFocusedOptionIndex(0),e.preventDefault()},onEndKey(e){this.changeFocusedOptionIndex(n.DomHandler.find(this.container,"li.p-menuitem:not(.p-disabled)").length-1),e.preventDefault()},onEnterKey(e){const t=n.DomHandler.findSingle(this.list,`li[id="${this.focusedOptionIndex}"]`),i=t&&n.DomHandler.findSingle(t,".p-menuitem-link");this.popup&&n.DomHandler.focus(this.target),i?i.click():t&&t.click(),e.preventDefault()},onSpaceKey(e){this.onEnterKey(e)},findNextOptionIndex(e){const t=[...n.DomHandler.find(this.container,"li.p-menuitem:not(.p-disabled)")].findIndex((t=>t.id===e));return t>-1?t+1:0},findPrevOptionIndex(e){const t=[...n.DomHandler.find(this.container,"li.p-menuitem:not(.p-disabled)")].findIndex((t=>t.id===e));return t>-1?t-1:0},changeFocusedOptionIndex(e){const t=n.DomHandler.find(this.container,"li.p-menuitem:not(.p-disabled)");let i=e>=t.length?t.length-1:e<0?0:e;i>-1&&(this.focusedOptionIndex=t[i].getAttribute("id"))},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(e){this.alignOverlay(),this.bindOutsideClickListener(),this.bindResizeListener(),this.bindScrollListener(),this.autoZIndex&&n.ZIndexUtils.set("menu",e,this.baseZIndex+this.$primevue.config.zIndex.menu),this.popup&&(n.DomHandler.focus(this.list),this.changeFocusedOptionIndex(0)),this.$emit("show")},onLeave(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.unbindScrollListener(),this.$emit("hide")},onAfterLeave(e){this.autoZIndex&&n.ZIndexUtils.clear(e)},alignOverlay(){n.DomHandler.absolutePosition(this.container,this.target),this.container.style.minWidth=n.DomHandler.getOuterWidth(this.target)+"px"},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{const t=this.container&&!this.container.contains(e.target),i=!(this.target&&(this.target===e.target||this.target.contains(e.target)));this.overlayVisible&&t&&i?this.hide():!this.popup&&t&&i&&(this.focusedOptionIndex=-1)},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new n.ConnectedOverlayScrollHandler(this.target,(()=>{this.overlayVisible&&this.hide()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&!n.DomHandler.isTouchDevice()&&this.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},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,separatorClass:e=>["p-menuitem-separator",e.class],onOverlayClick(e){a.default.emit("overlay-click",{originalEvent:e,target:this.target})},containerRef(e){this.container=e},listRef(e){this.list=e}},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}]},focusedOptionId(){return-1!==this.focusedOptionIndex?this.focusedOptionIndex:null}},components:{PVMenuitem:p,Portal:d.default}};const f=["id"],k=["id","tabindex","aria-activedescendant","aria-label","aria-labelledby"],v=["id"];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],s=document.createElement("style");s.type="text/css","top"===i&&n.firstChild?n.insertBefore(s,n.firstChild):n.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.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: flex;\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"),b.render=function(e,t,i,n,s,l){const r=o.resolveComponent("PVMenuitem"),a=o.resolveComponent("Portal");return o.openBlock(),o.createBlock(a,{appendTo:i.appendTo,disabled:!i.popup},{default:o.withCtx((()=>[o.createVNode(o.Transition,{name:"p-connected-overlay",onEnter:l.onEnter,onLeave:l.onLeave,onAfterLeave:l.onAfterLeave},{default:o.withCtx((()=>[!i.popup||s.overlayVisible?(o.openBlock(),o.createElementBlock("div",o.mergeProps({key:0,ref:l.containerRef,id:s.id,class:l.containerClass,onClick:t[3]||(t[3]=(...e)=>l.onOverlayClick&&l.onOverlayClick(...e))},{...e.$attrs,...e.ptm("root")}),[e.$slots.start?(o.openBlock(),o.createElementBlock("div",o.mergeProps({key:0,class:"p-menu-start"},e.ptm("start")),[o.renderSlot(e.$slots,"start")],16)):o.createCommentVNode("",!0),o.createElementVNode("ul",o.mergeProps({ref:l.listRef,id:s.id+"_list",class:"p-menu-list p-reset",role:"menu",tabindex:i.tabindex,"aria-activedescendant":s.focused?l.focusedOptionId:void 0,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,onFocus:t[0]||(t[0]=(...e)=>l.onListFocus&&l.onListFocus(...e)),onBlur:t[1]||(t[1]=(...e)=>l.onListBlur&&l.onListBlur(...e)),onKeydown:t[2]||(t[2]=(...e)=>l.onListKeyDown&&l.onListKeyDown(...e))},e.ptm("menu")),[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.model,((t,n)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:l.label(t)+n.toString()},[t.items&&l.visible(t)&&!t.separator?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[t.items?(o.openBlock(),o.createElementBlock("li",o.mergeProps({key:0,id:s.id+"_"+n,class:"p-submenu-header",role:"none"},e.ptm("submenuHeader")),[o.renderSlot(e.$slots,"item",{item:t},(()=>[o.createTextVNode(o.toDisplayString(l.label(t)),1)]))],16,v)):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.items,((a,d)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:a.label+n+"_"+d},[l.visible(a)&&!a.separator?(o.openBlock(),o.createBlock(r,{key:0,id:s.id+"_"+n+"_"+d,item:a,templates:e.$slots,exact:i.exact,focusedOptionId:l.focusedOptionId,onItemClick:l.itemClick,pt:e.pt},null,8,["id","item","templates","exact","focusedOptionId","onItemClick","pt"])):l.visible(a)&&a.separator?(o.openBlock(),o.createElementBlock("li",o.mergeProps({key:"separator"+n+d,class:l.separatorClass(t),style:a.style,role:"separator"},e.ptm("separator")),null,16)):o.createCommentVNode("",!0)],64)))),128))],64)):l.visible(t)&&t.separator?(o.openBlock(),o.createElementBlock("li",o.mergeProps({key:"separator"+n.toString(),class:l.separatorClass(t),style:t.style,role:"separator"},e.ptm("separator")),null,16)):(o.openBlock(),o.createBlock(r,{key:l.label(t)+n.toString(),id:s.id+"_"+n,item:t,templates:e.$slots,exact:i.exact,focusedOptionId:l.focusedOptionId,onItemClick:l.itemClick,pt:e.pt},null,8,["id","item","templates","exact","focusedOptionId","onItemClick","pt"]))],64)))),128))],16,k),e.$slots.end?(o.openBlock(),o.createElementBlock("div",o.mergeProps({key:1,class:"p-menu-end"},e.ptm("end")),[o.renderSlot(e.$slots,"end")],16)):o.createCommentVNode("",!0)],16,f)):o.createCommentVNode("",!0)])),_:3},8,["onEnter","onLeave","onAfterLeave"])])),_:3},8,["appendTo","disabled"])},b}(primevue.basecomponent,primevue.overlayeventbus,primevue.portal,primevue.utils,primevue.ripple,Vue);
|
package/menubar/Menubar.d.ts
CHANGED
|
@@ -11,6 +11,147 @@ import { ButtonHTMLAttributes, VNode } from 'vue';
|
|
|
11
11
|
import { MenuItem } from '../menuitem';
|
|
12
12
|
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
|
|
13
13
|
|
|
14
|
+
export declare type MenubarPassThroughOptionType = MenubarPassThroughAttributes | ((options: MenubarPassThroughMethodOptions) => MenubarPassThroughAttributes) | null | undefined;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Custom passthrough(pt) option method.
|
|
18
|
+
*/
|
|
19
|
+
export interface MenubarPassThroughMethodOptions {
|
|
20
|
+
props: MenubarProps;
|
|
21
|
+
state: MenubarState;
|
|
22
|
+
context: MenubarContext;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Custom passthrough(pt) options.
|
|
27
|
+
* @see {@link MenubarProps.pt}
|
|
28
|
+
*/
|
|
29
|
+
export interface MenubarPassThroughOptions {
|
|
30
|
+
/**
|
|
31
|
+
* Uses to pass attributes to the root's DOM element.
|
|
32
|
+
*/
|
|
33
|
+
root?: MenubarPassThroughOptionType;
|
|
34
|
+
/**
|
|
35
|
+
* Uses to pass attributes to the list's DOM element.
|
|
36
|
+
*/
|
|
37
|
+
menu?: MenubarPassThroughOptionType;
|
|
38
|
+
/**
|
|
39
|
+
* Uses to pass attributes to the list item's DOM element.
|
|
40
|
+
*/
|
|
41
|
+
menuitem?: MenubarPassThroughOptionType;
|
|
42
|
+
/**
|
|
43
|
+
* Uses to pass attributes to the content's DOM element.
|
|
44
|
+
*/
|
|
45
|
+
content?: MenubarPassThroughOptionType;
|
|
46
|
+
/**
|
|
47
|
+
* Uses to pass attributes to the action's DOM element.
|
|
48
|
+
*/
|
|
49
|
+
action?: MenubarPassThroughOptionType;
|
|
50
|
+
/**
|
|
51
|
+
* Uses to pass attributes to the icon's DOM element.
|
|
52
|
+
*/
|
|
53
|
+
icon?: MenubarPassThroughOptionType;
|
|
54
|
+
/**
|
|
55
|
+
* Uses to pass attributes to the label's DOM element.
|
|
56
|
+
*/
|
|
57
|
+
label?: MenubarPassThroughOptionType;
|
|
58
|
+
/**
|
|
59
|
+
* Uses to pass attributes to the submenu icon's DOM element.
|
|
60
|
+
*/
|
|
61
|
+
submenuicon?: MenubarPassThroughOptionType;
|
|
62
|
+
/**
|
|
63
|
+
* Uses to pass attributes to the separator's DOM element.
|
|
64
|
+
*/
|
|
65
|
+
separator?: MenubarPassThroughOptionType;
|
|
66
|
+
/**
|
|
67
|
+
* Uses to pass attributes to the mobile popup menu button's DOM element.
|
|
68
|
+
*/
|
|
69
|
+
button?: MenubarPassThroughOptionType;
|
|
70
|
+
/**
|
|
71
|
+
* Uses to pass attributes to the mobile popup menu button icon's DOM element.
|
|
72
|
+
*/
|
|
73
|
+
popupIcon?: MenubarPassThroughOptionType;
|
|
74
|
+
/**
|
|
75
|
+
* Uses to pass attributes to the start of the component.
|
|
76
|
+
*/
|
|
77
|
+
start?: MenubarPassThroughOptionType;
|
|
78
|
+
/**
|
|
79
|
+
* Uses to pass attributes to the end of the component.
|
|
80
|
+
*/
|
|
81
|
+
end?: MenubarPassThroughOptionType;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Custom passthrough attributes for each DOM elements
|
|
86
|
+
*/
|
|
87
|
+
export interface MenubarPassThroughAttributes {
|
|
88
|
+
[key: string]: any;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Defines focused item info
|
|
93
|
+
*/
|
|
94
|
+
export interface MenubarFocusedItemInfo {
|
|
95
|
+
/**
|
|
96
|
+
* Active item index
|
|
97
|
+
*/
|
|
98
|
+
index: number;
|
|
99
|
+
/**
|
|
100
|
+
* Active item level
|
|
101
|
+
*/
|
|
102
|
+
level: number;
|
|
103
|
+
/**
|
|
104
|
+
* Parent key info
|
|
105
|
+
*/
|
|
106
|
+
parentKey: string;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Defines current inline state in Menubar component.
|
|
111
|
+
*/
|
|
112
|
+
export interface MenubarState {
|
|
113
|
+
/**
|
|
114
|
+
* Current id state as a string.
|
|
115
|
+
*/
|
|
116
|
+
id: string;
|
|
117
|
+
/**
|
|
118
|
+
* Current mobile menu active state as a boolean.
|
|
119
|
+
* @defaultValue false
|
|
120
|
+
*/
|
|
121
|
+
mobileActive: boolean;
|
|
122
|
+
/**
|
|
123
|
+
* Current focus state as a boolean.
|
|
124
|
+
* @defaultValue false
|
|
125
|
+
*/
|
|
126
|
+
focused: boolean;
|
|
127
|
+
/**
|
|
128
|
+
* Current focused item info.
|
|
129
|
+
* @type {MenubarFocusedItemInfo}
|
|
130
|
+
*/
|
|
131
|
+
focusedItemInfo: MenubarFocusedItemInfo;
|
|
132
|
+
/**
|
|
133
|
+
* Active item path.
|
|
134
|
+
* @type {MenubarFocusedItemInfo}
|
|
135
|
+
*/
|
|
136
|
+
activeItemPath: MenubarFocusedItemInfo[];
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Defines current options in Menubar component.
|
|
141
|
+
*/
|
|
142
|
+
export interface MenubarContext {
|
|
143
|
+
/**
|
|
144
|
+
* Current active state of menuitem as a boolean.
|
|
145
|
+
* @defaultValue false
|
|
146
|
+
*/
|
|
147
|
+
active: boolean;
|
|
148
|
+
/**
|
|
149
|
+
* Current focused state of menuitem as a boolean.
|
|
150
|
+
* @defaultValue false
|
|
151
|
+
*/
|
|
152
|
+
focused: boolean;
|
|
153
|
+
}
|
|
154
|
+
|
|
14
155
|
/**
|
|
15
156
|
* Defines valid properties in Menubar component.
|
|
16
157
|
*/
|
|
@@ -36,6 +177,11 @@ export interface MenubarProps {
|
|
|
36
177
|
* Identifier of the underlying input element.
|
|
37
178
|
*/
|
|
38
179
|
'aria-labelledby'?: string | undefined;
|
|
180
|
+
/**
|
|
181
|
+
* Uses to pass attributes to DOM elements inside the component.
|
|
182
|
+
* @type {MenubarPassThroughOptions}
|
|
183
|
+
*/
|
|
184
|
+
pt?: MenubarPassThroughOptions;
|
|
39
185
|
}
|
|
40
186
|
|
|
41
187
|
/**
|
package/menubar/Menubar.vue
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div :ref="containerRef" :class="containerClass">
|
|
3
|
-
<div v-if="$slots.start" class="p-menubar-start">
|
|
2
|
+
<div :ref="containerRef" :class="containerClass" v-bind="ptm('root')">
|
|
3
|
+
<div v-if="$slots.start" class="p-menubar-start" v-bind="ptm('start')">
|
|
4
4
|
<slot name="start"></slot>
|
|
5
5
|
</div>
|
|
6
6
|
<a
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
:aria-label="$primevue.config.locale.aria.navigation"
|
|
16
16
|
@click="menuButtonClick($event)"
|
|
17
17
|
@keydown="menuButtonKeydown($event)"
|
|
18
|
-
v-bind="buttonProps"
|
|
18
|
+
v-bind="{ ...buttonProps, ...ptm('button') }"
|
|
19
19
|
>
|
|
20
20
|
<slot name="popupicon">
|
|
21
|
-
<BarsIcon />
|
|
21
|
+
<BarsIcon v-bind="ptm('popupIcon')" />
|
|
22
22
|
</slot>
|
|
23
23
|
</a>
|
|
24
24
|
<MenubarSub
|
|
@@ -39,25 +39,28 @@
|
|
|
39
39
|
:level="0"
|
|
40
40
|
:aria-labelledby="ariaLabelledby"
|
|
41
41
|
:aria-label="ariaLabel"
|
|
42
|
+
:pt="pt"
|
|
42
43
|
@focus="onFocus"
|
|
43
44
|
@blur="onBlur"
|
|
44
45
|
@keydown="onKeyDown"
|
|
45
46
|
@item-click="onItemClick"
|
|
46
47
|
@item-mouseenter="onItemMouseEnter"
|
|
47
48
|
/>
|
|
48
|
-
<div v-if="$slots.end" class="p-menubar-end">
|
|
49
|
+
<div v-if="$slots.end" class="p-menubar-end" v-bind="ptm('end')">
|
|
49
50
|
<slot name="end"></slot>
|
|
50
51
|
</div>
|
|
51
52
|
</div>
|
|
52
53
|
</template>
|
|
53
54
|
|
|
54
55
|
<script>
|
|
56
|
+
import BaseComponent from 'primevue/basecomponent';
|
|
55
57
|
import BarsIcon from 'primevue/icons/bars';
|
|
56
58
|
import { DomHandler, ObjectUtils, UniqueComponentId, ZIndexUtils } from 'primevue/utils';
|
|
57
59
|
import MenubarSub from './MenubarSub.vue';
|
|
58
60
|
|
|
59
61
|
export default {
|
|
60
62
|
name: 'Menubar',
|
|
63
|
+
extends: BaseComponent,
|
|
61
64
|
emits: ['focus', 'blur'],
|
|
62
65
|
props: {
|
|
63
66
|
model: {
|