primevue 3.22.4 → 3.24.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/LICENSE.md +1 -1
- package/README.md +13 -13
- package/accordion/Accordion.d.ts +53 -21
- package/accordiontab/AccordionTab.d.ts +33 -12
- package/autocomplete/AutoComplete.d.ts +111 -84
- package/avatar/Avatar.d.ts +38 -25
- package/avatar/Avatar.vue +1 -1
- package/avatar/avatar.cjs.js +2 -1
- package/avatar/avatar.cjs.min.js +1 -1
- package/avatar/avatar.esm.js +2 -1
- package/avatar/avatar.esm.min.js +1 -1
- package/avatar/avatar.js +2 -1
- package/avatar/avatar.min.js +1 -1
- package/avatargroup/AvatarGroup.d.ts +30 -14
- package/badge/Badge.d.ts +34 -20
- package/badge/Badge.vue +16 -5
- package/badge/badge.cjs.js +15 -5
- package/badge/badge.cjs.min.js +1 -1
- package/badge/badge.esm.js +15 -5
- package/badge/badge.esm.min.js +1 -1
- package/badge/badge.js +16 -7
- package/badge/badge.min.js +1 -1
- package/badgedirective/BadgeDirective.d.ts +60 -1
- package/blockui/BlockUI.d.ts +36 -16
- package/breadcrumb/Breadcrumb.d.ts +37 -20
- package/breadcrumb/Breadcrumb.vue +1 -1
- package/breadcrumb/breadcrumb.cjs.js +2 -1
- package/breadcrumb/breadcrumb.cjs.min.js +1 -1
- package/breadcrumb/breadcrumb.esm.js +2 -1
- package/breadcrumb/breadcrumb.esm.min.js +1 -1
- package/breadcrumb/breadcrumb.js +2 -1
- package/breadcrumb/breadcrumb.min.js +1 -1
- package/button/Button.d.ts +74 -17
- package/button/Button.vue +51 -8
- package/button/button.cjs.js +51 -8
- package/button/button.cjs.min.js +1 -1
- package/button/button.esm.js +51 -8
- package/button/button.esm.min.js +1 -1
- package/button/button.js +51 -8
- package/button/button.min.js +1 -1
- package/calendar/Calendar.d.ts +112 -77
- package/calendar/Calendar.vue +4 -4
- package/calendar/calendar.cjs.js +4 -4
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.esm.js +4 -4
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +4 -4
- package/calendar/calendar.min.js +1 -1
- package/card/Card.d.ts +35 -15
- package/carousel/Carousel.d.ts +47 -29
- package/cascadeselect/CascadeSelect.d.ts +70 -59
- package/chart/Chart.d.ts +41 -23
- package/checkbox/Checkbox.d.ts +39 -15
- package/checkbox/Checkbox.vue +1 -1
- package/checkbox/checkbox.cjs.js +1 -1
- package/checkbox/checkbox.cjs.min.js +1 -1
- package/checkbox/checkbox.esm.js +1 -1
- package/checkbox/checkbox.esm.min.js +1 -1
- package/checkbox/checkbox.js +1 -1
- package/checkbox/checkbox.min.js +1 -1
- package/chip/Chip.d.ts +35 -14
- package/chips/Chips.d.ts +45 -20
- package/colorpicker/ColorPicker.d.ts +46 -28
- package/column/Column.d.ts +81 -65
- package/columngroup/ColumnGroup.d.ts +29 -13
- package/config/PrimeVue.d.ts +1 -2
- package/config/config.cjs.js +20 -2
- package/config/config.cjs.min.js +1 -1
- package/config/config.esm.js +20 -2
- package/config/config.esm.min.js +1 -1
- package/config/config.js +20 -2
- package/config/config.min.js +1 -1
- package/confirmationoptions/ConfirmationOptions.d.ts +15 -6
- package/confirmationservice/ConfirmationService.d.ts +11 -0
- package/confirmdialog/ConfirmDialog.d.ts +35 -17
- package/confirmpopup/ConfirmPopup.d.ts +32 -17
- package/contextmenu/ContextMenu.d.ts +51 -35
- package/core/core.js +368 -121
- package/core/core.min.js +8 -8
- package/datatable/DataTable.d.ts +248 -205
- package/datatable/DataTable.vue +78 -117
- package/datatable/TableBody.vue +3 -17
- package/datatable/datatable.cjs.js +73 -67
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.esm.js +73 -67
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +73 -67
- package/datatable/datatable.min.js +1 -1
- package/dataview/DataView.d.ts +65 -47
- package/dataviewlayoutoptions/DataViewLayoutOptions.d.ts +33 -13
- package/deferredcontent/DeferredContent.d.ts +30 -13
- package/dialog/Dialog.d.ts +67 -46
- package/dialog/Dialog.vue +1 -1
- package/dialog/dialog.cjs.js +1 -1
- package/dialog/dialog.cjs.min.js +1 -1
- package/dialog/dialog.esm.js +1 -1
- package/dialog/dialog.esm.min.js +1 -1
- package/dialog/dialog.js +1 -1
- package/dialog/dialog.min.js +1 -1
- package/dialogservice/DialogService.d.ts +13 -2
- package/divider/Divider.d.ts +35 -30
- package/dock/Dock.d.ts +49 -36
- package/dropdown/Dropdown.d.ts +90 -82
- 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.d.ts +30 -10
- package/dynamicdialog/DynamicDialog.vue +2 -2
- package/dynamicdialog/dynamicdialog.cjs.js +3 -3
- package/dynamicdialog/dynamicdialog.cjs.min.js +1 -1
- package/dynamicdialog/dynamicdialog.esm.js +2 -2
- package/dynamicdialog/dynamicdialog.esm.min.js +1 -1
- package/dynamicdialog/dynamicdialog.js +3 -3
- package/dynamicdialog/dynamicdialog.min.js +1 -1
- package/dynamicdialogoptions/DynamicDialogOptions.d.ts +28 -8
- package/editor/Editor.d.ts +48 -17
- package/fieldset/Fieldset.d.ts +43 -16
- package/fileupload/FileUpload.d.ts +101 -47
- package/focustrap/FocusTrap.d.ts +42 -3
- package/fullcalendar/FullCalendar.d.ts +1 -1
- package/galleria/Galleria.d.ts +64 -40
- package/image/Image.d.ts +33 -14
- package/inlinemessage/InlineMessage.d.ts +31 -17
- package/inplace/Inplace.d.ts +41 -18
- package/inputmask/InputMask.d.ts +41 -17
- package/inputnumber/InputNumber.d.ts +60 -41
- package/inputswitch/InputSwitch.d.ts +35 -15
- package/inputswitch/InputSwitch.vue +1 -0
- package/inputswitch/inputswitch.cjs.js +1 -1
- package/inputswitch/inputswitch.cjs.min.js +1 -1
- package/inputswitch/inputswitch.esm.js +1 -1
- package/inputswitch/inputswitch.esm.min.js +1 -1
- package/inputswitch/inputswitch.js +1 -1
- package/inputswitch/inputswitch.min.js +1 -1
- package/inputtext/InputText.d.ts +32 -12
- package/knob/Knob.d.ts +47 -21
- package/listbox/Listbox.d.ts +81 -60
- package/megamenu/MegaMenu.d.ts +42 -27
- package/megamenu/MegaMenu.vue +17 -0
- package/megamenu/megamenu.cjs.js +1 -1
- package/megamenu/megamenu.cjs.min.js +1 -1
- package/megamenu/megamenu.esm.js +1 -1
- package/megamenu/megamenu.esm.min.js +1 -1
- package/megamenu/megamenu.js +1 -1
- package/megamenu/megamenu.min.js +1 -1
- package/menu/Menu.d.ts +57 -28
- package/menu/Menu.vue +6 -0
- package/menu/menu.cjs.js +26 -8
- package/menu/menu.cjs.min.js +1 -1
- package/menu/menu.esm.js +27 -9
- package/menu/menu.esm.min.js +1 -1
- package/menu/menu.js +26 -8
- package/menu/menu.min.js +1 -1
- package/menubar/Menubar.d.ts +36 -19
- package/menuitem/MenuItem.d.ts +22 -10
- package/message/Message.d.ts +40 -21
- package/multiselect/MultiSelect.d.ts +111 -90
- package/orderlist/OrderList.d.ts +51 -23
- package/organizationchart/OrganizationChart.d.ts +43 -26
- package/overlaypanel/OverlayPanel.d.ts +46 -26
- package/package.json +2 -2
- package/paginator/Paginator.d.ts +49 -24
- package/panel/Panel.d.ts +39 -14
- package/panelmenu/PanelMenu.d.ts +49 -21
- package/password/Password.d.ts +47 -28
- package/picklist/PickList.d.ts +74 -33
- package/progressbar/ProgressBar.d.ts +34 -17
- package/progressspinner/ProgressSpinner.d.ts +32 -13
- package/radiobutton/RadioButton.d.ts +32 -14
- package/rating/Rating.d.ts +51 -25
- package/resources/themes/arya-blue/theme.css +34 -11
- package/resources/themes/arya-green/theme.css +34 -11
- package/resources/themes/arya-orange/theme.css +34 -11
- package/resources/themes/arya-purple/theme.css +34 -11
- package/resources/themes/bootstrap4-dark-blue/theme.css +34 -11
- package/resources/themes/bootstrap4-dark-purple/theme.css +34 -11
- package/resources/themes/bootstrap4-light-blue/theme.css +34 -11
- package/resources/themes/bootstrap4-light-purple/theme.css +34 -11
- package/resources/themes/fluent-light/theme.css +34 -11
- package/resources/themes/lara-dark-blue/theme.css +34 -11
- package/resources/themes/lara-dark-indigo/theme.css +34 -11
- package/resources/themes/lara-dark-purple/theme.css +34 -11
- package/resources/themes/lara-dark-teal/theme.css +34 -11
- package/resources/themes/lara-light-blue/theme.css +34 -11
- package/resources/themes/lara-light-indigo/theme.css +34 -11
- package/resources/themes/lara-light-purple/theme.css +34 -11
- package/resources/themes/lara-light-teal/theme.css +34 -11
- package/resources/themes/luna-amber/theme.css +34 -11
- package/resources/themes/luna-blue/theme.css +34 -11
- package/resources/themes/luna-green/theme.css +34 -11
- package/resources/themes/luna-pink/theme.css +34 -11
- package/resources/themes/md-dark-deeppurple/theme.css +34 -11
- package/resources/themes/md-dark-indigo/theme.css +34 -11
- package/resources/themes/md-light-deeppurple/theme.css +34 -11
- package/resources/themes/md-light-indigo/theme.css +34 -11
- package/resources/themes/mdc-dark-deeppurple/theme.css +34 -11
- package/resources/themes/mdc-dark-indigo/theme.css +34 -11
- package/resources/themes/mdc-light-deeppurple/theme.css +34 -11
- package/resources/themes/mdc-light-indigo/theme.css +34 -11
- package/resources/themes/mira/fonts/Inter-Bold.woff +0 -0
- package/resources/themes/mira/fonts/Inter-Bold.woff2 +0 -0
- package/resources/themes/mira/fonts/Inter-Medium.woff +0 -0
- package/resources/themes/mira/fonts/Inter-Medium.woff2 +0 -0
- package/resources/themes/mira/fonts/Inter-Regular.woff +0 -0
- package/resources/themes/mira/fonts/Inter-Regular.woff2 +0 -0
- package/resources/themes/mira/fonts/Inter-SemiBold.woff +0 -0
- package/resources/themes/mira/fonts/Inter-SemiBold.woff2 +0 -0
- package/resources/themes/mira/theme.css +6089 -0
- package/resources/themes/nano/theme.css +5861 -0
- package/resources/themes/nova/theme.css +34 -11
- package/resources/themes/nova-accent/theme.css +34 -11
- package/resources/themes/nova-alt/theme.css +34 -11
- package/resources/themes/nova-vue/theme.css +34 -11
- package/resources/themes/rhea/theme.css +34 -11
- package/resources/themes/saga-blue/theme.css +34 -11
- package/resources/themes/saga-green/theme.css +34 -11
- package/resources/themes/saga-orange/theme.css +34 -11
- package/resources/themes/saga-purple/theme.css +34 -11
- package/resources/themes/soho-dark/fonts/lato-v17-latin-ext_latin-300.woff +0 -0
- package/resources/themes/soho-dark/fonts/lato-v17-latin-ext_latin-300.woff2 +0 -0
- package/resources/themes/soho-dark/fonts/lato-v17-latin-ext_latin-700.woff +0 -0
- package/resources/themes/soho-dark/fonts/lato-v17-latin-ext_latin-700.woff2 +0 -0
- package/resources/themes/soho-dark/fonts/lato-v17-latin-ext_latin-regular.woff +0 -0
- package/resources/themes/soho-dark/fonts/lato-v17-latin-ext_latin-regular.woff2 +0 -0
- package/resources/themes/soho-dark/theme.css +5854 -0
- package/resources/themes/soho-light/fonts/lato-v17-latin-ext_latin-300.woff +0 -0
- package/resources/themes/soho-light/fonts/lato-v17-latin-ext_latin-300.woff2 +0 -0
- package/resources/themes/soho-light/fonts/lato-v17-latin-ext_latin-700.woff +0 -0
- package/resources/themes/soho-light/fonts/lato-v17-latin-ext_latin-700.woff2 +0 -0
- package/resources/themes/soho-light/fonts/lato-v17-latin-ext_latin-regular.woff +0 -0
- package/resources/themes/soho-light/fonts/lato-v17-latin-ext_latin-regular.woff2 +0 -0
- package/resources/themes/soho-light/theme.css +5908 -0
- package/resources/themes/tailwind-light/theme.css +34 -11
- package/resources/themes/vela-blue/theme.css +34 -11
- package/resources/themes/vela-green/theme.css +34 -11
- package/resources/themes/vela-orange/theme.css +34 -11
- package/resources/themes/vela-purple/theme.css +34 -11
- package/resources/themes/viva-dark/fonts/poppins-v15-latin-ext_latin-300.woff +0 -0
- package/resources/themes/viva-dark/fonts/poppins-v15-latin-ext_latin-300.woff2 +0 -0
- package/resources/themes/viva-dark/fonts/poppins-v15-latin-ext_latin-600.woff +0 -0
- package/resources/themes/viva-dark/fonts/poppins-v15-latin-ext_latin-600.woff2 +0 -0
- package/resources/themes/viva-dark/fonts/poppins-v15-latin-ext_latin-700.woff +0 -0
- package/resources/themes/viva-dark/fonts/poppins-v15-latin-ext_latin-700.woff2 +0 -0
- package/resources/themes/viva-dark/fonts/poppins-v15-latin-ext_latin-regular.woff +0 -0
- package/resources/themes/viva-dark/fonts/poppins-v15-latin-ext_latin-regular.woff2 +0 -0
- package/resources/themes/viva-dark/theme.css +6016 -0
- package/resources/themes/viva-light/fonts/poppins-v15-latin-ext_latin-300.woff +0 -0
- package/resources/themes/viva-light/fonts/poppins-v15-latin-ext_latin-300.woff2 +0 -0
- package/resources/themes/viva-light/fonts/poppins-v15-latin-ext_latin-600.woff +0 -0
- package/resources/themes/viva-light/fonts/poppins-v15-latin-ext_latin-600.woff2 +0 -0
- package/resources/themes/viva-light/fonts/poppins-v15-latin-ext_latin-700.woff +0 -0
- package/resources/themes/viva-light/fonts/poppins-v15-latin-ext_latin-700.woff2 +0 -0
- package/resources/themes/viva-light/fonts/poppins-v15-latin-ext_latin-regular.woff +0 -0
- package/resources/themes/viva-light/fonts/poppins-v15-latin-ext_latin-regular.woff2 +0 -0
- package/resources/themes/viva-light/theme.css +6016 -0
- package/ripple/Ripple.d.ts +24 -1
- package/row/Row.d.ts +28 -10
- package/scrollpanel/ScrollPanel.d.ts +29 -11
- package/scrolltop/ScrollTop.d.ts +35 -18
- package/selectbutton/SelectButton.d.ts +47 -27
- package/sidebar/Sidebar.d.ts +46 -27
- package/skeleton/Skeleton.d.ts +36 -22
- package/slider/Slider.d.ts +46 -23
- package/speeddial/SpeedDial.d.ts +64 -51
- package/splitbutton/SplitButton.d.ts +73 -24
- package/splitbutton/SplitButton.vue +41 -1
- package/splitbutton/splitbutton.cjs.js +43 -3
- package/splitbutton/splitbutton.cjs.min.js +1 -1
- package/splitbutton/splitbutton.esm.js +43 -3
- package/splitbutton/splitbutton.esm.min.js +1 -1
- package/splitbutton/splitbutton.js +43 -3
- package/splitbutton/splitbutton.min.js +1 -1
- package/splitter/Splitter.d.ts +49 -30
- package/splitterpanel/SplitterPanel.d.ts +28 -10
- package/steps/Steps.d.ts +36 -15
- package/styleclass/StyleClass.d.ts +72 -1
- package/tabmenu/TabMenu.d.ts +41 -16
- package/tabmenu/TabMenu.vue +1 -1
- package/tabmenu/tabmenu.cjs.js +1 -0
- package/tabmenu/tabmenu.cjs.min.js +1 -1
- package/tabmenu/tabmenu.esm.js +1 -0
- package/tabmenu/tabmenu.esm.min.js +1 -1
- package/tabmenu/tabmenu.js +1 -0
- package/tabmenu/tabmenu.min.js +1 -1
- package/tabpanel/TabPanel.d.ts +29 -11
- package/tabview/TabView.d.ts +47 -19
- package/tag/Tag.d.ts +33 -15
- package/tag/Tag.vue +1 -1
- package/tag/tag.cjs.js +4 -2
- package/tag/tag.cjs.min.js +1 -1
- package/tag/tag.esm.js +5 -3
- package/tag/tag.esm.min.js +1 -1
- package/tag/tag.js +4 -2
- package/tag/tag.min.js +1 -1
- package/terminal/Terminal.d.ts +30 -14
- package/terminalservice/TerminalService.d.ts +24 -5
- package/textarea/Textarea.d.ts +33 -11
- package/tieredmenu/TieredMenu.d.ts +45 -31
- package/timeline/Timeline.d.ts +41 -32
- package/toast/Toast.d.ts +63 -35
- package/toast/Toast.vue +4 -2
- package/toast/ToastMessage.vue +4 -4
- package/toast/toast.cjs.js +8 -6
- package/toast/toast.cjs.min.js +1 -1
- package/toast/toast.esm.js +8 -6
- package/toast/toast.esm.min.js +1 -1
- package/toast/toast.js +8 -6
- package/toast/toast.min.js +1 -1
- package/toastservice/ToastService.d.ts +16 -3
- package/togglebutton/ToggleButton.d.ts +42 -22
- package/toolbar/Toolbar.d.ts +34 -14
- package/tooltip/Tooltip.d.ts +99 -1
- package/tree/Tree.d.ts +55 -36
- package/treeselect/TreeSelect.d.ts +63 -55
- package/treetable/TreeTable.d.ts +121 -107
- package/tristatecheckbox/TriStateCheckbox.d.ts +35 -12
- package/ts-helpers.d.ts +2 -2
- package/utils/utils.cjs.js +20 -22
- package/utils/utils.cjs.min.js +1 -1
- package/utils/utils.esm.js +20 -22
- package/utils/utils.esm.min.js +1 -1
- package/utils/utils.js +20 -22
- package/utils/utils.min.js +1 -1
- package/vetur-attributes.json +62 -2
- package/vetur-tags.json +17 -2
- package/virtualscroller/VirtualScroller.d.ts +99 -43
- package/virtualscroller/VirtualScroller.vue +248 -72
- package/virtualscroller/virtualscroller.cjs.js +234 -72
- package/virtualscroller/virtualscroller.cjs.min.js +1 -1
- package/virtualscroller/virtualscroller.esm.js +234 -72
- package/virtualscroller/virtualscroller.esm.min.js +1 -1
- package/virtualscroller/virtualscroller.js +235 -74
- package/virtualscroller/virtualscroller.min.js +1 -1
- package/web-types.json +1930 -1742
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ObjectUtils as e,UniqueComponentId as t,DomHandler as i}from"primevue/utils";import s from"primevue/ripple";import{resolveComponent as n,resolveDirective as o,openBlock as a,createElementBlock as m,normalizeClass as r,normalizeStyle as d,toDisplayString as l,createCommentVNode as c,Fragment as u,renderList as I,createElementVNode as h,createBlock as p,withCtx as f,withDirectives as g,resolveDynamicComponent as y,renderSlot as b,createVNode as v}from"vue";var x={name:"MegaMenuSub",emits:["item-click","item-mouseenter"],props:{menuId:{type:String,default:null},focusedItemId:{type:String,default:null},horizontal:{type:Boolean,default:!1},submenu:{type:Object,default:null},items:{type:Array,default:null},level:{type:Number,default:0},template:{type:Function,default:null},activeItem:{type:Object,default:null},exact:{type:Boolean,default:!0}},methods:{getSubListId(e){return`${this.getItemId(e)}_list`},getSubListKey(e){return this.getSubListId(e)},getItemId(e){return`${this.menuId}_${e.key}`},getItemKey(e){return this.getItemId(e)},getItemProp:(t,i,s)=>t&&t.item?e.getItemValue(t.item[i],s):void 0,getItemLabel(e){return this.getItemProp(e,"label")},isItemActive(t){return!!e.isNotEmpty(this.activeItem)&&this.activeItem.key===t.key},isItemVisible(e){return!1!==this.getItemProp(e,"visible")},isItemDisabled(e){return this.getItemProp(e,"disabled")},isItemFocused(e){return this.focusedItemId===this.getItemId(e)},isItemGroup:t=>e.isNotEmpty(t.items),onItemClick(e,t){this.getItemProp(t,"command",{originalEvent:e,item:t.item}),this.$emit("item-click",{originalEvent:e,processedItem:t,isFocus:!0})},onItemMouseEnter(e,t){this.$emit("item-mouseenter",{originalEvent:e,processedItem:t})},onItemActionClick(e,t){t&&t(e)},getAriaSetSize(){return this.items.filter((e=>this.isItemVisible(e)&&!this.getItemProp(e,"separator"))).length},getAriaPosInset(e){return e-this.items.slice(0,e).filter((e=>this.isItemVisible(e)&&this.getItemProp(e,"separator"))).length+1},getSubmenuHeaderClass(e){return["p-megamenu-submenu-header p-submenu-header",this.getItemProp(e,"class"),{"p-disabled":this.isItemDisabled(e)}]},getColumnClass(e){let t;switch(this.isItemGroup(e)?e.items.length:0){case 2:t="p-megamenu-col-6";break;case 3:t="p-megamenu-col-4";break;case 4:t="p-megamenu-col-3";break;case 6:t="p-megamenu-col-2";break;default:t="p-megamenu-col-12"}return t},getItemClass(e){return["p-menuitem",this.getItemProp(e,"class"),{"p-menuitem-active p-highlight":this.isItemActive(e),"p-focus":this.isItemFocused(e),"p-disabled":this.isItemDisabled(e)}]},getItemActionClass(e,t){return["p-menuitem-link",{"router-link-active":t&&t.isActive,"router-link-active-exact":this.exact&&t&&t.isExactActive}]},getItemIconClass(e){return["p-menuitem-icon",this.getItemProp(e,"icon")]},getItemToggleIconClass(){return["p-submenu-icon",this.horizontal?"pi pi-angle-down":"pi pi-angle-right"]},getSeparatorItemClass(e){return["p-menuitem-separator",this.getItemProp(e,"class")]}},directives:{ripple:s}};const k=["id","aria-label","aria-disabled","aria-expanded","aria-haspopup","aria-level","aria-setsize","aria-posinset"],L=["onClick","onMouseenter"],C=["href","onClick"],K={class:"p-menuitem-text"},E=["href","target"],P={class:"p-menuitem-text"},w={key:0,class:"p-megamenu-panel"},S={class:"p-megamenu-grid"},F=["id"];x.render=function(e,t,i,s,b,v){const x=n("router-link"),V=n("MegaMenuSub",!0),z=o("ripple");return a(),m("ul",null,[i.submenu?(a(),m("li",{key:0,class:r(v.getSubmenuHeaderClass(i.submenu)),style:d(v.getItemProp(i.submenu,"style")),role:"presentation"},l(v.getItemLabel(i.submenu)),7)):c("",!0),(a(!0),m(u,null,I(i.items,((s,n)=>(a(),m(u,{key:v.getItemKey(s)},[v.isItemVisible(s)&&!v.getItemProp(s,"separator")?(a(),m("li",{key:0,id:v.getItemId(s),style:d(v.getItemProp(s,"style")),class:r(v.getItemClass(s)),role:"menuitem","aria-label":v.getItemLabel(s),"aria-disabled":v.isItemDisabled(s)||void 0,"aria-expanded":v.isItemGroup(s)?v.isItemActive(s):void 0,"aria-haspopup":v.isItemGroup(s)&&!v.getItemProp(s,"to")?"menu":void 0,"aria-level":i.level+1,"aria-setsize":v.getAriaSetSize(),"aria-posinset":v.getAriaPosInset(n)},[h("div",{class:"p-menuitem-content",onClick:e=>v.onItemClick(e,s),onMouseenter:e=>v.onItemMouseEnter(e,s)},[i.template?(a(),p(y(i.template),{key:1,item:s.item},null,8,["item"])):(a(),m(u,{key:0},[v.getItemProp(s,"to")&&!v.isItemDisabled(s)?(a(),p(x,{key:0,to:v.getItemProp(s,"to"),custom:""},{default:f((({navigate:e,href:t,isActive:i,isExactActive:n})=>[g((a(),m("a",{href:t,class:r(v.getItemActionClass(s,{isActive:i,isExactActive:n})),tabindex:"-1","aria-hidden":"true",onClick:t=>v.onItemActionClick(t,e)},[v.getItemProp(s,"icon")?(a(),m("span",{key:0,class:r(v.getItemIconClass(s))},null,2)):c("",!0),h("span",K,l(v.getItemLabel(s)),1)],10,C)),[[z]])])),_:2},1032,["to"])):g((a(),m("a",{key:1,href:v.getItemProp(s,"url"),class:r(v.getItemActionClass(s)),target:v.getItemProp(s,"target"),tabindex:"-1","aria-hidden":"true"},[v.getItemProp(s,"icon")?(a(),m("span",{key:0,class:r(v.getItemIconClass(s))},null,2)):c("",!0),h("span",P,l(v.getItemLabel(s)),1),v.isItemGroup(s)?(a(),m("span",{key:1,class:r(v.getItemToggleIconClass())},null,2)):c("",!0)],10,E)),[[z]])],64))],40,L),v.isItemVisible(s)&&v.isItemGroup(s)?(a(),m("div",w,[h("div",S,[(a(!0),m(u,null,I(s.items,(n=>(a(),m("div",{key:v.getItemKey(n),class:r(v.getColumnClass(s))},[(a(!0),m(u,null,I(n,(s=>(a(),p(V,{key:v.getSubListKey(s),id:v.getSubListId(s),role:"menu",class:"p-submenu-list p-megamenu-submenu",menuId:i.menuId,focusedItemId:i.focusedItemId,submenu:s,items:s.items,template:i.template,exact:i.exact,level:i.level+1,onItemClick:t[0]||(t[0]=t=>e.$emit("item-click",t)),onItemMouseenter:t[1]||(t[1]=t=>e.$emit("item-mouseenter",t))},null,8,["id","menuId","focusedItemId","submenu","items","template","exact","level"])))),128))],2)))),128))])])):c("",!0)],14,k)):c("",!0),v.isItemVisible(s)&&v.getItemProp(s,"separator")?(a(),m("li",{key:1,id:v.getItemId(s),style:d(v.getItemProp(s,"style")),class:r(v.getSeparatorItemClass(s)),role:"separator"},null,14,F)):c("",!0)],64)))),128))])};var V={name:"MegaMenu",emits:["focus","blur"],props:{model:{type:Array,default:null},orientation:{type:String,default:"horizontal"},exact:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},tabindex:{type:Number,default:0},"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},outsideClickListener:null,resizeListener:null,container:null,menubar:null,searchTimeout:null,searchValue:null,data(){return{id:this.$attrs.id,focused:!1,focusedItemInfo:{index:-1,key:"",parentKey:""},activeItem:null,dirty:!1}},watch:{"$attrs.id":function(e){this.id=e||t()},activeItem(t){e.isNotEmpty(t)?(this.bindOutsideClickListener(),this.bindResizeListener()):(this.unbindOutsideClickListener(),this.unbindResizeListener())}},mounted(){this.id=this.id||t()},beforeUnmount(){this.unbindOutsideClickListener(),this.unbindResizeListener()},methods:{getItemProp:(t,i)=>t?e.getItemValue(t[i]):void 0,getItemLabel(e){return this.getItemProp(e,"label")},isItemDisabled(e){return this.getItemProp(e,"disabled")},isItemGroup(t){return e.isNotEmpty(this.getItemProp(t,"items"))},isItemSeparator(e){return this.getItemProp(e,"separator")},getProccessedItemLabel(e){return e?this.getItemLabel(e.item):void 0},isProccessedItemGroup:t=>t&&e.isNotEmpty(t.items),hide(e,t){this.activeItem=null,this.focusedItemInfo={index:-1,key:"",parentKey:""},t&&i.focus(this.menubar),this.dirty=!1},onFocus(e){if(this.focused=!0,-1===this.focusedItemInfo.index){const e=this.findFirstFocusedItemIndex(),t=this.findVisibleItem(e);this.focusedItemInfo={index:e,key:t.key,parentKey:t.parentKey}}this.$emit("focus",e)},onBlur(e){this.focused=!1,this.focusedItemInfo={index:-1,key:"",parentKey:""},this.searchValue="",this.dirty=!1,this.$emit("blur",e)},onKeyDown(t){if(this.disabled)return void t.preventDefault();const i=t.metaKey||t.ctrlKey;switch(t.code){case"ArrowDown":this.onArrowDownKey(t);break;case"ArrowUp":this.onArrowUpKey(t);break;case"ArrowLeft":this.onArrowLeftKey(t);break;case"ArrowRight":this.onArrowRightKey(t);break;case"Home":this.onHomeKey(t);break;case"End":this.onEndKey(t);break;case"Space":this.onSpaceKey(t);break;case"Enter":this.onEnterKey(t);break;case"Escape":this.onEscapeKey(t);break;case"Tab":this.onTabKey(t);break;case"PageDown":case"PageUp":case"Backspace":case"ShiftLeft":case"ShiftRight":break;default:!i&&e.isPrintableCharacter(t.key)&&this.searchItems(t,t.key)}},onItemChange(t){const{processedItem:s,isFocus:n}=t;if(e.isEmpty(s))return;const{index:o,key:a,parentKey:m,items:r}=s,d=e.isNotEmpty(r);d&&(this.activeItem=s),this.focusedItemInfo={index:o,key:a,parentKey:m},d&&(this.dirty=!0),n&&i.focus(this.menubar)},onItemClick(t){const{originalEvent:s,processedItem:n}=t,o=this.isProccessedItemGroup(n),a=e.isEmpty(n.parent);if(this.isSelected(n)){const{index:e,key:t,parentKey:s}=n;this.activeItem=null,this.focusedItemInfo={index:e,key:t,parentKey:s},this.dirty=!a,i.focus(this.menubar)}else if(o)this.onItemChange(t);else{const e=a?n:this.activeItem;this.hide(s),this.changeFocusedItemInfo(s,e?e.index:-1),i.focus(this.menubar)}},onItemMouseEnter(e){this.dirty&&this.onItemChange(e)},onArrowDownKey(t){if(this.horizontal)if(e.isNotEmpty(this.activeItem)&&this.activeItem.key===this.focusedItemInfo.key)this.focusedItemInfo={index:-1,key:"",parentKey:this.activeItem.key};else{const e=this.findVisibleItem(this.focusedItemInfo.index);this.isProccessedItemGroup(e)&&(this.onItemChange({originalEvent:t,processedItem:e}),this.focusedItemInfo={index:-1,key:e.key,parentKey:e.parentKey},this.searchValue="")}const i=-1!==this.focusedItemInfo.index?this.findNextItemIndex(this.focusedItemInfo.index):this.findFirstFocusedItemIndex();this.changeFocusedItemInfo(t,i),t.preventDefault()},onArrowUpKey(t){if(t.altKey&&this.horizontal){if(-1!==this.focusedItemInfo.index){const i=this.findVisibleItem(this.focusedItemInfo.index);!this.isProccessedItemGroup(i)&&e.isNotEmpty(this.activeItem)&&(0===this.focusedItemInfo.index?(this.focusedItemInfo={index:this.activeItem.index,key:this.activeItem.key,parentKey:this.activeItem.parentKey},this.activeItem=null):this.changeFocusedItemInfo(t,this.findFirstItemIndex()))}t.preventDefault()}else{const e=-1!==this.focusedItemInfo.index?this.findPrevItemIndex(this.focusedItemInfo.index):this.findLastFocusedItemIndex();this.changeFocusedItemInfo(t,e),t.preventDefault()}},onArrowLeftKey(t){const i=this.findVisibleItem(this.focusedItemInfo.index);if(this.isProccessedItemGroup(i)){if(this.horizontal){const e=-1!==this.focusedItemInfo.index?this.findPrevItemIndex(this.focusedItemInfo.index):this.findLastFocusedItemIndex();this.changeFocusedItemInfo(t,e)}}else{this.vertical&&e.isNotEmpty(this.activeItem)&&0===i.columnIndex&&(this.focusedItemInfo={index:this.activeItem.index,key:this.activeItem.key,parentKey:this.activeItem.parentKey},this.activeItem=null);const s=i.columnIndex-1,n=this.visibleItems.findIndex((e=>e.columnIndex===s));-1!==n&&this.changeFocusedItemInfo(t,n)}t.preventDefault()},onArrowRightKey(t){const i=this.findVisibleItem(this.focusedItemInfo.index);if(this.isProccessedItemGroup(i)){if(this.vertical)if(e.isNotEmpty(this.activeItem)&&this.activeItem.key===i.key)this.focusedItemInfo={index:-1,key:"",parentKey:this.activeItem.key};else{const e=this.findVisibleItem(this.focusedItemInfo.index);this.isProccessedItemGroup(e)&&(this.onItemChange({originalEvent:t,processedItem:e}),this.focusedItemInfo={index:-1,key:e.key,parentKey:e.parentKey},this.searchValue="")}const s=-1!==this.focusedItemInfo.index?this.findNextItemIndex(this.focusedItemInfo.index):this.findFirstFocusedItemIndex();this.changeFocusedItemInfo(t,s)}else{const e=i.columnIndex+1,s=this.visibleItems.findIndex((t=>t.columnIndex===e));-1!==s&&this.changeFocusedItemInfo(t,s)}t.preventDefault()},onHomeKey(e){this.changeFocusedItemInfo(e,this.findFirstItemIndex()),e.preventDefault()},onEndKey(e){this.changeFocusedItemInfo(e,this.findLastItemIndex()),e.preventDefault()},onEnterKey(e){if(-1!==this.focusedItemInfo.index){const t=i.findSingle(this.menubar,`li[id="${this.focusedItemId}"]`),s=t&&i.findSingle(t,".p-menuitem-link");s?s.click():t&&t.click();const n=this.visibleItems[this.focusedItemInfo.index];!this.isProccessedItemGroup(n)&&this.changeFocusedItemInfo(e,this.findFirstFocusedItemIndex())}e.preventDefault()},onSpaceKey(e){this.onEnterKey(e)},onEscapeKey(t){e.isNotEmpty(this.activeItem)&&(this.focusedItemInfo={index:this.activeItem.index,key:this.activeItem.key},this.activeItem=null),t.preventDefault()},onTabKey(e){if(-1!==this.focusedItemInfo.index){const t=this.findVisibleItem(this.focusedItemInfo.index);!this.isProccessedItemGroup(t)&&this.onItemChange({originalEvent:e,processedItem:t})}this.hide()},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{const t=this.container&&!this.container.contains(e.target),i=!this.popup||!(this.target&&(this.target===e.target||this.target.contains(e.target)));t&&i&&this.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindResizeListener(){this.resizeListener||(this.resizeListener=e=>{i.isTouchDevice()||this.hide(e,!0)},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},isItemMatched(e){return this.isValidItem(e)&&this.getProccessedItemLabel(e).toLocaleLowerCase().startsWith(this.searchValue.toLocaleLowerCase())},isValidItem(e){return!!e&&!this.isItemDisabled(e.item)&&!this.isItemSeparator(e.item)},isValidSelectedItem(e){return this.isValidItem(e)&&this.isSelected(e)},isSelected(t){return!!e.isNotEmpty(this.activeItem)&&this.activeItem.key===t.key},findFirstItemIndex(){return this.visibleItems.findIndex((e=>this.isValidItem(e)))},findLastItemIndex(){return e.findLastIndex(this.visibleItems,(e=>this.isValidItem(e)))},findNextItemIndex(e){const t=e<this.visibleItems.length-1?this.visibleItems.slice(e+1).findIndex((e=>this.isValidItem(e))):-1;return t>-1?t+e+1:e},findPrevItemIndex(t){const i=t>0?e.findLastIndex(this.visibleItems.slice(0,t),(e=>this.isValidItem(e))):-1;return i>-1?i:t},findSelectedItemIndex(){return this.visibleItems.findIndex((e=>this.isValidSelectedItem(e)))},findFirstFocusedItemIndex(){const e=this.findSelectedItemIndex();return e<0?this.findFirstItemIndex():e},findLastFocusedItemIndex(){const e=this.findSelectedItemIndex();return e<0?this.findLastItemIndex():e},findVisibleItem(t){return e.isNotEmpty(this.visibleItems)?this.visibleItems[t]:null},searchItems(e,t){this.searchValue=(this.searchValue||"")+t;let i=-1,s=!1;return-1!==this.focusedItemInfo.index?(i=this.visibleItems.slice(this.focusedItemInfo.index).findIndex((e=>this.isItemMatched(e))),i=-1===i?this.visibleItems.slice(0,this.focusedItemInfo.index).findIndex((e=>this.isItemMatched(e))):i+this.focusedItemInfo.index):i=this.visibleItems.findIndex((e=>this.isItemMatched(e))),-1!==i&&(s=!0),-1===i&&-1===this.focusedItemInfo.index&&(i=this.findFirstFocusedItemIndex()),-1!==i&&this.changeFocusedItemInfo(e,i),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((()=>{this.searchValue="",this.searchTimeout=null}),500),s},changeFocusedItemInfo(t,i){const s=this.findVisibleItem(i);this.focusedItemInfo.index=i,this.focusedItemInfo.key=e.isNotEmpty(s)?s.key:"",this.scrollInView()},scrollInView(e=-1){const t=-1!==e?`${this.id}_${e}`:this.focusedItemId,s=i.findSingle(this.menubar,`li[id="${t}"]`);s&&s.scrollIntoView&&s.scrollIntoView({block:"nearest",inline:"start"})},createProcessedItems(e,t=0,i={},s="",n){const o=[];return e&&e.forEach(((e,a)=>{const m=(""!==s?s+"_":"")+(void 0!==n?n+"_":"")+a,r={item:e,index:a,level:t,key:m,parent:i,parentKey:s,columnIndex:void 0!==n?n:void 0!==i.columnIndex?i.columnIndex:a};r.items=0===t&&e.items&&e.items.length>0?e.items.map(((e,i)=>this.createProcessedItems(e,t+1,r,m,i))):this.createProcessedItems(e.items,t+1,r,m),o.push(r)})),o},containerRef(e){this.container=e},menubarRef(e){this.menubar=e?e.$el:void 0}},computed:{containerClass(){return["p-megamenu p-component",{"p-megamenu-horizontal":this.horizontal,"p-megamenu-vertical":this.vertical}]},processedItems(){return this.createProcessedItems(this.model||[])},visibleItems(){const t=e.isNotEmpty(this.activeItem)?this.activeItem:null;return t&&t.key===this.focusedItemInfo.parentKey?t.items.reduce(((e,t)=>(t.forEach((t=>{t.items.forEach((t=>{e.push(t)}))})),e)),[]):this.processedItems},horizontal(){return"horizontal"===this.orientation},vertical(){return"vertical"===this.orientation},focusedItemId(){return e.isNotEmpty(this.focusedItemInfo.key)?`${this.id}_${this.focusedItemInfo.key}`:null}},components:{MegaMenuSub:x}};const z=["id"],A={key:0,class:"p-megamenu-start"},D={key:1,class:"p-megamenu-end"};!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-megamenu-root-list {\n margin: 0;\n padding: 0;\n list-style: none;\n}\n.p-megamenu-root-list > .p-menuitem {\n position: relative;\n}\n.p-megamenu .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-megamenu .p-menuitem-text {\n line-height: 1;\n}\n.p-megamenu-panel {\n display: none;\n position: absolute;\n width: auto;\n z-index: 1;\n}\n.p-megamenu-root-list > .p-menuitem-active > .p-megamenu-panel {\n display: block;\n}\n.p-megamenu-submenu {\n margin: 0;\n padding: 0;\n list-style: none;\n}\n\n/* Horizontal */\n.p-megamenu-horizontal .p-megamenu-root-list {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n}\n\n/* Vertical */\n.p-megamenu-vertical .p-megamenu-root-list {\n flex-direction: column;\n}\n.p-megamenu-vertical .p-megamenu-root-list > .p-menuitem-active > .p-megamenu-panel {\n left: 100%;\n top: 0;\n}\n.p-megamenu-vertical .p-megamenu-root-list > .p-menuitem > .p-menuitem-content > .p-menuitem-link > .p-submenu-icon {\n margin-left: auto;\n}\n.p-megamenu-grid {\n display: flex;\n}\n.p-megamenu-col-2,\n.p-megamenu-col-3,\n.p-megamenu-col-4,\n.p-megamenu-col-6,\n.p-megamenu-col-12 {\n flex: 0 0 auto;\n padding: 0.5rem;\n}\n.p-megamenu-col-2 {\n width: 16.6667%;\n}\n.p-megamenu-col-3 {\n width: 25%;\n}\n.p-megamenu-col-4 {\n width: 33.3333%;\n}\n.p-megamenu-col-6 {\n width: 50%;\n}\n.p-megamenu-col-12 {\n width: 100%;\n}\n"),V.render=function(e,t,i,s,o,d){const l=n("MegaMenuSub");return a(),m("div",{ref:d.containerRef,id:o.id,class:r(d.containerClass)},[e.$slots.start?(a(),m("div",A,[b(e.$slots,"start")])):c("",!0),v(l,{ref:d.menubarRef,id:o.id+"_list",class:"p-megamenu-root-list",tabindex:i.disabled?-1:i.tabindex,role:"menubar","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-disabled":i.disabled||void 0,"aria-orientation":i.orientation,"aria-activedescendant":o.focused?d.focusedItemId:void 0,menuId:o.id,focusedItemId:o.focused?d.focusedItemId:void 0,items:d.processedItems,horizontal:d.horizontal,template:e.$slots.item,activeItem:o.activeItem,exact:i.exact,level:0,onFocus:d.onFocus,onBlur:d.onBlur,onKeydown:d.onKeyDown,onItemClick:d.onItemClick,onItemMouseenter:d.onItemMouseEnter},null,8,["id","tabindex","aria-label","aria-labelledby","aria-disabled","aria-orientation","aria-activedescendant","menuId","focusedItemId","items","horizontal","template","activeItem","exact","onFocus","onBlur","onKeydown","onItemClick","onItemMouseenter"]),e.$slots.end?(a(),m("div",D,[b(e.$slots,"end")])):c("",!0)],10,z)};export{V as default};
|
|
1
|
+
import{ObjectUtils as e,UniqueComponentId as t,DomHandler as i}from"primevue/utils";import s from"primevue/ripple";import{resolveComponent as n,resolveDirective as o,openBlock as a,createElementBlock as m,normalizeClass as r,normalizeStyle as l,toDisplayString as d,createCommentVNode as c,Fragment as u,renderList as I,createElementVNode as h,createBlock as p,withCtx as f,withDirectives as g,resolveDynamicComponent as y,renderSlot as b,createVNode as v}from"vue";var x={name:"MegaMenuSub",emits:["item-click","item-mouseenter"],props:{menuId:{type:String,default:null},focusedItemId:{type:String,default:null},horizontal:{type:Boolean,default:!1},submenu:{type:Object,default:null},items:{type:Array,default:null},level:{type:Number,default:0},template:{type:Function,default:null},activeItem:{type:Object,default:null},exact:{type:Boolean,default:!0}},methods:{getSubListId(e){return`${this.getItemId(e)}_list`},getSubListKey(e){return this.getSubListId(e)},getItemId(e){return`${this.menuId}_${e.key}`},getItemKey(e){return this.getItemId(e)},getItemProp:(t,i,s)=>t&&t.item?e.getItemValue(t.item[i],s):void 0,getItemLabel(e){return this.getItemProp(e,"label")},isItemActive(t){return!!e.isNotEmpty(this.activeItem)&&this.activeItem.key===t.key},isItemVisible(e){return!1!==this.getItemProp(e,"visible")},isItemDisabled(e){return this.getItemProp(e,"disabled")},isItemFocused(e){return this.focusedItemId===this.getItemId(e)},isItemGroup:t=>e.isNotEmpty(t.items),onItemClick(e,t){this.getItemProp(t,"command",{originalEvent:e,item:t.item}),this.$emit("item-click",{originalEvent:e,processedItem:t,isFocus:!0})},onItemMouseEnter(e,t){this.$emit("item-mouseenter",{originalEvent:e,processedItem:t})},onItemActionClick(e,t){t&&t(e)},getAriaSetSize(){return this.items.filter((e=>this.isItemVisible(e)&&!this.getItemProp(e,"separator"))).length},getAriaPosInset(e){return e-this.items.slice(0,e).filter((e=>this.isItemVisible(e)&&this.getItemProp(e,"separator"))).length+1},getSubmenuHeaderClass(e){return["p-megamenu-submenu-header p-submenu-header",this.getItemProp(e,"class"),{"p-disabled":this.isItemDisabled(e)}]},getColumnClass(e){let t;switch(this.isItemGroup(e)?e.items.length:0){case 2:t="p-megamenu-col-6";break;case 3:t="p-megamenu-col-4";break;case 4:t="p-megamenu-col-3";break;case 6:t="p-megamenu-col-2";break;default:t="p-megamenu-col-12"}return t},getItemClass(e){return["p-menuitem",this.getItemProp(e,"class"),{"p-menuitem-active p-highlight":this.isItemActive(e),"p-focus":this.isItemFocused(e),"p-disabled":this.isItemDisabled(e)}]},getItemActionClass(e,t){return["p-menuitem-link",{"router-link-active":t&&t.isActive,"router-link-active-exact":this.exact&&t&&t.isExactActive}]},getItemIconClass(e){return["p-menuitem-icon",this.getItemProp(e,"icon")]},getItemToggleIconClass(){return["p-submenu-icon",this.horizontal?"pi pi-angle-down":"pi pi-angle-right"]},getSeparatorItemClass(e){return["p-menuitem-separator",this.getItemProp(e,"class")]}},directives:{ripple:s}};const k=["id","aria-label","aria-disabled","aria-expanded","aria-haspopup","aria-level","aria-setsize","aria-posinset"],L=["onClick","onMouseenter"],C=["href","onClick"],K={class:"p-menuitem-text"},E=["href","target"],P={class:"p-menuitem-text"},w={key:0,class:"p-megamenu-panel"},S={class:"p-megamenu-grid"},F=["id"];x.render=function(e,t,i,s,b,v){const x=n("router-link"),V=n("MegaMenuSub",!0),z=o("ripple");return a(),m("ul",null,[i.submenu?(a(),m("li",{key:0,class:r(v.getSubmenuHeaderClass(i.submenu)),style:l(v.getItemProp(i.submenu,"style")),role:"presentation"},d(v.getItemLabel(i.submenu)),7)):c("",!0),(a(!0),m(u,null,I(i.items,((s,n)=>(a(),m(u,{key:v.getItemKey(s)},[v.isItemVisible(s)&&!v.getItemProp(s,"separator")?(a(),m("li",{key:0,id:v.getItemId(s),style:l(v.getItemProp(s,"style")),class:r(v.getItemClass(s)),role:"menuitem","aria-label":v.getItemLabel(s),"aria-disabled":v.isItemDisabled(s)||void 0,"aria-expanded":v.isItemGroup(s)?v.isItemActive(s):void 0,"aria-haspopup":v.isItemGroup(s)&&!v.getItemProp(s,"to")?"menu":void 0,"aria-level":i.level+1,"aria-setsize":v.getAriaSetSize(),"aria-posinset":v.getAriaPosInset(n)},[h("div",{class:"p-menuitem-content",onClick:e=>v.onItemClick(e,s),onMouseenter:e=>v.onItemMouseEnter(e,s)},[i.template?(a(),p(y(i.template),{key:1,item:s.item},null,8,["item"])):(a(),m(u,{key:0},[v.getItemProp(s,"to")&&!v.isItemDisabled(s)?(a(),p(x,{key:0,to:v.getItemProp(s,"to"),custom:""},{default:f((({navigate:e,href:t,isActive:i,isExactActive:n})=>[g((a(),m("a",{href:t,class:r(v.getItemActionClass(s,{isActive:i,isExactActive:n})),tabindex:"-1","aria-hidden":"true",onClick:t=>v.onItemActionClick(t,e)},[v.getItemProp(s,"icon")?(a(),m("span",{key:0,class:r(v.getItemIconClass(s))},null,2)):c("",!0),h("span",K,d(v.getItemLabel(s)),1)],10,C)),[[z]])])),_:2},1032,["to"])):g((a(),m("a",{key:1,href:v.getItemProp(s,"url"),class:r(v.getItemActionClass(s)),target:v.getItemProp(s,"target"),tabindex:"-1","aria-hidden":"true"},[v.getItemProp(s,"icon")?(a(),m("span",{key:0,class:r(v.getItemIconClass(s))},null,2)):c("",!0),h("span",P,d(v.getItemLabel(s)),1),v.isItemGroup(s)?(a(),m("span",{key:1,class:r(v.getItemToggleIconClass())},null,2)):c("",!0)],10,E)),[[z]])],64))],40,L),v.isItemVisible(s)&&v.isItemGroup(s)?(a(),m("div",w,[h("div",S,[(a(!0),m(u,null,I(s.items,(n=>(a(),m("div",{key:v.getItemKey(n),class:r(v.getColumnClass(s))},[(a(!0),m(u,null,I(n,(s=>(a(),p(V,{key:v.getSubListKey(s),id:v.getSubListId(s),role:"menu",class:"p-submenu-list p-megamenu-submenu",menuId:i.menuId,focusedItemId:i.focusedItemId,submenu:s,items:s.items,template:i.template,exact:i.exact,level:i.level+1,onItemClick:t[0]||(t[0]=t=>e.$emit("item-click",t)),onItemMouseenter:t[1]||(t[1]=t=>e.$emit("item-mouseenter",t))},null,8,["id","menuId","focusedItemId","submenu","items","template","exact","level"])))),128))],2)))),128))])])):c("",!0)],14,k)):c("",!0),v.isItemVisible(s)&&v.getItemProp(s,"separator")?(a(),m("li",{key:1,id:v.getItemId(s),style:l(v.getItemProp(s,"style")),class:r(v.getSeparatorItemClass(s)),role:"separator"},null,14,F)):c("",!0)],64)))),128))])};var V={name:"MegaMenu",emits:["focus","blur"],props:{model:{type:Array,default:null},orientation:{type:String,default:"horizontal"},exact:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},tabindex:{type:Number,default:0},"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},outsideClickListener:null,resizeListener:null,container:null,menubar:null,searchTimeout:null,searchValue:null,data(){return{id:this.$attrs.id,focused:!1,focusedItemInfo:{index:-1,key:"",parentKey:""},activeItem:null,dirty:!1}},watch:{"$attrs.id":function(e){this.id=e||t()},activeItem(t){e.isNotEmpty(t)?(this.bindOutsideClickListener(),this.bindResizeListener()):(this.unbindOutsideClickListener(),this.unbindResizeListener())}},mounted(){this.id=this.id||t()},beforeUnmount(){this.unbindOutsideClickListener(),this.unbindResizeListener()},methods:{getItemProp:(t,i)=>t?e.getItemValue(t[i]):void 0,getItemLabel(e){return this.getItemProp(e,"label")},isItemDisabled(e){return this.getItemProp(e,"disabled")},isItemGroup(t){return e.isNotEmpty(this.getItemProp(t,"items"))},isItemSeparator(e){return this.getItemProp(e,"separator")},getProccessedItemLabel(e){return e?this.getItemLabel(e.item):void 0},isProccessedItemGroup:t=>t&&e.isNotEmpty(t.items),hide(e,t){this.activeItem=null,this.focusedItemInfo={index:-1,key:"",parentKey:""},t&&i.focus(this.menubar),this.dirty=!1},onFocus(e){if(this.focused=!0,-1===this.focusedItemInfo.index){const e=this.findFirstFocusedItemIndex(),t=this.findVisibleItem(e);this.focusedItemInfo={index:e,key:t.key,parentKey:t.parentKey}}this.$emit("focus",e)},onBlur(e){this.focused=!1,this.focusedItemInfo={index:-1,key:"",parentKey:""},this.searchValue="",this.dirty=!1,this.$emit("blur",e)},onKeyDown(t){if(this.disabled)return void t.preventDefault();const i=t.metaKey||t.ctrlKey;switch(t.code){case"ArrowDown":this.onArrowDownKey(t);break;case"ArrowUp":this.onArrowUpKey(t);break;case"ArrowLeft":this.onArrowLeftKey(t);break;case"ArrowRight":this.onArrowRightKey(t);break;case"Home":this.onHomeKey(t);break;case"End":this.onEndKey(t);break;case"Space":this.onSpaceKey(t);break;case"Enter":this.onEnterKey(t);break;case"Escape":this.onEscapeKey(t);break;case"Tab":this.onTabKey(t);break;case"PageDown":case"PageUp":case"Backspace":case"ShiftLeft":case"ShiftRight":break;default:!i&&e.isPrintableCharacter(t.key)&&this.searchItems(t,t.key)}},onItemChange(t){const{processedItem:s,isFocus:n}=t;if(e.isEmpty(s))return;const{index:o,key:a,parentKey:m,items:r}=s,l=e.isNotEmpty(r);l&&(this.activeItem=s),this.focusedItemInfo={index:o,key:a,parentKey:m},l&&(this.dirty=!0),n&&i.focus(this.menubar)},onItemClick(t){const{originalEvent:s,processedItem:n}=t,o=this.isProccessedItemGroup(n),a=e.isEmpty(n.parent);if(this.isSelected(n)){const{index:e,key:t,parentKey:s}=n;this.activeItem=null,this.focusedItemInfo={index:e,key:t,parentKey:s},this.dirty=!a,i.focus(this.menubar)}else if(o)this.onItemChange(t);else{const e=a?n:this.activeItem;this.hide(s),this.changeFocusedItemInfo(s,e?e.index:-1),i.focus(this.menubar)}},onItemMouseEnter(e){this.dirty&&this.onItemChange(e)},onArrowDownKey(t){if(this.horizontal)if(e.isNotEmpty(this.activeItem)&&this.activeItem.key===this.focusedItemInfo.key)this.focusedItemInfo={index:-1,key:"",parentKey:this.activeItem.key};else{const e=this.findVisibleItem(this.focusedItemInfo.index);this.isProccessedItemGroup(e)&&(this.onItemChange({originalEvent:t,processedItem:e}),this.focusedItemInfo={index:-1,key:e.key,parentKey:e.parentKey},this.searchValue="")}const i=-1!==this.focusedItemInfo.index?this.findNextItemIndex(this.focusedItemInfo.index):this.findFirstFocusedItemIndex();this.changeFocusedItemInfo(t,i),t.preventDefault()},onArrowUpKey(t){if(t.altKey&&this.horizontal){if(-1!==this.focusedItemInfo.index){const i=this.findVisibleItem(this.focusedItemInfo.index);!this.isProccessedItemGroup(i)&&e.isNotEmpty(this.activeItem)&&(0===this.focusedItemInfo.index?(this.focusedItemInfo={index:this.activeItem.index,key:this.activeItem.key,parentKey:this.activeItem.parentKey},this.activeItem=null):this.changeFocusedItemInfo(t,this.findFirstItemIndex()))}t.preventDefault()}else{const e=-1!==this.focusedItemInfo.index?this.findPrevItemIndex(this.focusedItemInfo.index):this.findLastFocusedItemIndex();this.changeFocusedItemInfo(t,e),t.preventDefault()}},onArrowLeftKey(t){const i=this.findVisibleItem(this.focusedItemInfo.index);if(this.isProccessedItemGroup(i)){if(this.horizontal){const e=-1!==this.focusedItemInfo.index?this.findPrevItemIndex(this.focusedItemInfo.index):this.findLastFocusedItemIndex();this.changeFocusedItemInfo(t,e)}}else{this.vertical&&e.isNotEmpty(this.activeItem)&&0===i.columnIndex&&(this.focusedItemInfo={index:this.activeItem.index,key:this.activeItem.key,parentKey:this.activeItem.parentKey},this.activeItem=null);const s=i.columnIndex-1,n=this.visibleItems.findIndex((e=>e.columnIndex===s));-1!==n&&this.changeFocusedItemInfo(t,n)}t.preventDefault()},onArrowRightKey(t){const i=this.findVisibleItem(this.focusedItemInfo.index);if(this.isProccessedItemGroup(i)){if(this.vertical)if(e.isNotEmpty(this.activeItem)&&this.activeItem.key===i.key)this.focusedItemInfo={index:-1,key:"",parentKey:this.activeItem.key};else{const e=this.findVisibleItem(this.focusedItemInfo.index);this.isProccessedItemGroup(e)&&(this.onItemChange({originalEvent:t,processedItem:e}),this.focusedItemInfo={index:-1,key:e.key,parentKey:e.parentKey},this.searchValue="")}const s=-1!==this.focusedItemInfo.index?this.findNextItemIndex(this.focusedItemInfo.index):this.findFirstFocusedItemIndex();this.changeFocusedItemInfo(t,s)}else{const e=i.columnIndex+1,s=this.visibleItems.findIndex((t=>t.columnIndex===e));-1!==s&&this.changeFocusedItemInfo(t,s)}t.preventDefault()},onHomeKey(e){this.changeFocusedItemInfo(e,this.findFirstItemIndex()),e.preventDefault()},onEndKey(e){this.changeFocusedItemInfo(e,this.findLastItemIndex()),e.preventDefault()},onEnterKey(e){if(-1!==this.focusedItemInfo.index){const t=i.findSingle(this.menubar,`li[id="${this.focusedItemId}"]`),s=t&&i.findSingle(t,".p-menuitem-link");s?s.click():t&&t.click();const n=this.visibleItems[this.focusedItemInfo.index];!this.isProccessedItemGroup(n)&&this.changeFocusedItemInfo(e,this.findFirstFocusedItemIndex())}e.preventDefault()},onSpaceKey(e){this.onEnterKey(e)},onEscapeKey(t){e.isNotEmpty(this.activeItem)&&(this.focusedItemInfo={index:this.activeItem.index,key:this.activeItem.key},this.activeItem=null),t.preventDefault()},onTabKey(e){if(-1!==this.focusedItemInfo.index){const t=this.findVisibleItem(this.focusedItemInfo.index);!this.isProccessedItemGroup(t)&&this.onItemChange({originalEvent:e,processedItem:t})}this.hide()},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{const t=this.container&&!this.container.contains(e.target),i=!this.popup||!(this.target&&(this.target===e.target||this.target.contains(e.target)));t&&i&&this.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindResizeListener(){this.resizeListener||(this.resizeListener=e=>{i.isTouchDevice()||this.hide(e,!0)},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},isItemMatched(e){return this.isValidItem(e)&&this.getProccessedItemLabel(e).toLocaleLowerCase().startsWith(this.searchValue.toLocaleLowerCase())},isValidItem(e){return!!e&&!this.isItemDisabled(e.item)&&!this.isItemSeparator(e.item)},isValidSelectedItem(e){return this.isValidItem(e)&&this.isSelected(e)},isSelected(t){return!!e.isNotEmpty(this.activeItem)&&this.activeItem.key===t.key},findFirstItemIndex(){return this.visibleItems.findIndex((e=>this.isValidItem(e)))},findLastItemIndex(){return e.findLastIndex(this.visibleItems,(e=>this.isValidItem(e)))},findNextItemIndex(e){const t=e<this.visibleItems.length-1?this.visibleItems.slice(e+1).findIndex((e=>this.isValidItem(e))):-1;return t>-1?t+e+1:e},findPrevItemIndex(t){const i=t>0?e.findLastIndex(this.visibleItems.slice(0,t),(e=>this.isValidItem(e))):-1;return i>-1?i:t},findSelectedItemIndex(){return this.visibleItems.findIndex((e=>this.isValidSelectedItem(e)))},findFirstFocusedItemIndex(){const e=this.findSelectedItemIndex();return e<0?this.findFirstItemIndex():e},findLastFocusedItemIndex(){const e=this.findSelectedItemIndex();return e<0?this.findLastItemIndex():e},findVisibleItem(t){return e.isNotEmpty(this.visibleItems)?this.visibleItems[t]:null},searchItems(e,t){this.searchValue=(this.searchValue||"")+t;let i=-1,s=!1;return-1!==this.focusedItemInfo.index?(i=this.visibleItems.slice(this.focusedItemInfo.index).findIndex((e=>this.isItemMatched(e))),i=-1===i?this.visibleItems.slice(0,this.focusedItemInfo.index).findIndex((e=>this.isItemMatched(e))):i+this.focusedItemInfo.index):i=this.visibleItems.findIndex((e=>this.isItemMatched(e))),-1!==i&&(s=!0),-1===i&&-1===this.focusedItemInfo.index&&(i=this.findFirstFocusedItemIndex()),-1!==i&&this.changeFocusedItemInfo(e,i),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((()=>{this.searchValue="",this.searchTimeout=null}),500),s},changeFocusedItemInfo(t,i){const s=this.findVisibleItem(i);this.focusedItemInfo.index=i,this.focusedItemInfo.key=e.isNotEmpty(s)?s.key:"",this.scrollInView()},scrollInView(e=-1){const t=-1!==e?`${this.id}_${e}`:this.focusedItemId,s=i.findSingle(this.menubar,`li[id="${t}"]`);s&&s.scrollIntoView&&s.scrollIntoView({block:"nearest",inline:"start"})},createProcessedItems(e,t=0,i={},s="",n){const o=[];return e&&e.forEach(((e,a)=>{const m=(""!==s?s+"_":"")+(void 0!==n?n+"_":"")+a,r={item:e,index:a,level:t,key:m,parent:i,parentKey:s,columnIndex:void 0!==n?n:void 0!==i.columnIndex?i.columnIndex:a};r.items=0===t&&e.items&&e.items.length>0?e.items.map(((e,i)=>this.createProcessedItems(e,t+1,r,m,i))):this.createProcessedItems(e.items,t+1,r,m),o.push(r)})),o},containerRef(e){this.container=e},menubarRef(e){this.menubar=e?e.$el:void 0}},computed:{containerClass(){return["p-megamenu p-component",{"p-megamenu-horizontal":this.horizontal,"p-megamenu-vertical":this.vertical}]},processedItems(){return this.createProcessedItems(this.model||[])},visibleItems(){const t=e.isNotEmpty(this.activeItem)?this.activeItem:null;return t&&t.key===this.focusedItemInfo.parentKey?t.items.reduce(((e,t)=>(t.forEach((t=>{t.items.forEach((t=>{e.push(t)}))})),e)),[]):this.processedItems},horizontal(){return"horizontal"===this.orientation},vertical(){return"vertical"===this.orientation},focusedItemId(){return e.isNotEmpty(this.focusedItemInfo.key)?`${this.id}_${this.focusedItemInfo.key}`:null}},components:{MegaMenuSub:x}};const z=["id"],A={key:0,class:"p-megamenu-start"},D={key:1,class:"p-megamenu-end"};!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-megamenu {\n display: flex;\n}\n.p-megamenu-root-list {\n margin: 0;\n padding: 0;\n list-style: none;\n}\n.p-megamenu-root-list > .p-menuitem {\n position: relative;\n}\n.p-megamenu .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-megamenu .p-menuitem-text {\n line-height: 1;\n}\n.p-megamenu-panel {\n display: none;\n position: absolute;\n width: auto;\n z-index: 1;\n}\n.p-megamenu-root-list > .p-menuitem-active > .p-megamenu-panel {\n display: block;\n}\n.p-megamenu-submenu {\n margin: 0;\n padding: 0;\n list-style: none;\n}\n\n/* Horizontal */\n.p-megamenu-horizontal {\n align-items: center;\n}\n.p-megamenu-horizontal .p-megamenu-root-list {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n}\n.p-megamenu-horizontal .p-megamenu-end {\n margin-left: auto;\n align-self: center;\n}\n\n/* Vertical */\n.p-megamenu-vertical {\n flex-direction: column;\n}\n.p-megamenu-vertical .p-megamenu-root-list {\n flex-direction: column;\n}\n.p-megamenu-vertical .p-megamenu-root-list > .p-menuitem-active > .p-megamenu-panel {\n left: 100%;\n top: 0;\n}\n.p-megamenu-vertical .p-megamenu-root-list > .p-menuitem > .p-menuitem-content > .p-menuitem-link > .p-submenu-icon {\n margin-left: auto;\n}\n.p-megamenu-grid {\n display: flex;\n}\n.p-megamenu-col-2,\n.p-megamenu-col-3,\n.p-megamenu-col-4,\n.p-megamenu-col-6,\n.p-megamenu-col-12 {\n flex: 0 0 auto;\n padding: 0.5rem;\n}\n.p-megamenu-col-2 {\n width: 16.6667%;\n}\n.p-megamenu-col-3 {\n width: 25%;\n}\n.p-megamenu-col-4 {\n width: 33.3333%;\n}\n.p-megamenu-col-6 {\n width: 50%;\n}\n.p-megamenu-col-12 {\n width: 100%;\n}\n"),V.render=function(e,t,i,s,o,l){const d=n("MegaMenuSub");return a(),m("div",{ref:l.containerRef,id:o.id,class:r(l.containerClass)},[e.$slots.start?(a(),m("div",A,[b(e.$slots,"start")])):c("",!0),v(d,{ref:l.menubarRef,id:o.id+"_list",class:"p-megamenu-root-list",tabindex:i.disabled?-1:i.tabindex,role:"menubar","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-disabled":i.disabled||void 0,"aria-orientation":i.orientation,"aria-activedescendant":o.focused?l.focusedItemId:void 0,menuId:o.id,focusedItemId:o.focused?l.focusedItemId:void 0,items:l.processedItems,horizontal:l.horizontal,template:e.$slots.item,activeItem:o.activeItem,exact:i.exact,level:0,onFocus:l.onFocus,onBlur:l.onBlur,onKeydown:l.onKeyDown,onItemClick:l.onItemClick,onItemMouseenter:l.onItemMouseEnter},null,8,["id","tabindex","aria-label","aria-labelledby","aria-disabled","aria-orientation","aria-activedescendant","menuId","focusedItemId","items","horizontal","template","activeItem","exact","onFocus","onBlur","onKeydown","onItemClick","onItemMouseenter"]),e.$slots.end?(a(),m("div",D,[b(e.$slots,"end")])):c("",!0)],10,z)};export{V as default};
|
package/megamenu/megamenu.js
CHANGED
|
@@ -991,7 +991,7 @@ this.primevue.megamenu = (function (utils, Ripple, vue) {
|
|
|
991
991
|
}
|
|
992
992
|
}
|
|
993
993
|
|
|
994
|
-
var css_248z = "\n.p-megamenu-root-list {\n margin: 0;\n padding: 0;\n list-style: none;\n}\n.p-megamenu-root-list > .p-menuitem {\n position: relative;\n}\n.p-megamenu .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-megamenu .p-menuitem-text {\n line-height: 1;\n}\n.p-megamenu-panel {\n display: none;\n position: absolute;\n width: auto;\n z-index: 1;\n}\n.p-megamenu-root-list > .p-menuitem-active > .p-megamenu-panel {\n display: block;\n}\n.p-megamenu-submenu {\n margin: 0;\n padding: 0;\n list-style: none;\n}\n\n/* Horizontal */\n.p-megamenu-horizontal .p-megamenu-root-list {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n}\n\n/* Vertical */\n.p-megamenu-vertical .p-megamenu-root-list {\n flex-direction: column;\n}\n.p-megamenu-vertical .p-megamenu-root-list > .p-menuitem-active > .p-megamenu-panel {\n left: 100%;\n top: 0;\n}\n.p-megamenu-vertical .p-megamenu-root-list > .p-menuitem > .p-menuitem-content > .p-menuitem-link > .p-submenu-icon {\n margin-left: auto;\n}\n.p-megamenu-grid {\n display: flex;\n}\n.p-megamenu-col-2,\n.p-megamenu-col-3,\n.p-megamenu-col-4,\n.p-megamenu-col-6,\n.p-megamenu-col-12 {\n flex: 0 0 auto;\n padding: 0.5rem;\n}\n.p-megamenu-col-2 {\n width: 16.6667%;\n}\n.p-megamenu-col-3 {\n width: 25%;\n}\n.p-megamenu-col-4 {\n width: 33.3333%;\n}\n.p-megamenu-col-6 {\n width: 50%;\n}\n.p-megamenu-col-12 {\n width: 100%;\n}\n";
|
|
994
|
+
var css_248z = "\n.p-megamenu {\n display: flex;\n}\n.p-megamenu-root-list {\n margin: 0;\n padding: 0;\n list-style: none;\n}\n.p-megamenu-root-list > .p-menuitem {\n position: relative;\n}\n.p-megamenu .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-megamenu .p-menuitem-text {\n line-height: 1;\n}\n.p-megamenu-panel {\n display: none;\n position: absolute;\n width: auto;\n z-index: 1;\n}\n.p-megamenu-root-list > .p-menuitem-active > .p-megamenu-panel {\n display: block;\n}\n.p-megamenu-submenu {\n margin: 0;\n padding: 0;\n list-style: none;\n}\n\n/* Horizontal */\n.p-megamenu-horizontal {\n align-items: center;\n}\n.p-megamenu-horizontal .p-megamenu-root-list {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n}\n.p-megamenu-horizontal .p-megamenu-end {\n margin-left: auto;\n align-self: center;\n}\n\n/* Vertical */\n.p-megamenu-vertical {\n flex-direction: column;\n}\n.p-megamenu-vertical .p-megamenu-root-list {\n flex-direction: column;\n}\n.p-megamenu-vertical .p-megamenu-root-list > .p-menuitem-active > .p-megamenu-panel {\n left: 100%;\n top: 0;\n}\n.p-megamenu-vertical .p-megamenu-root-list > .p-menuitem > .p-menuitem-content > .p-menuitem-link > .p-submenu-icon {\n margin-left: auto;\n}\n.p-megamenu-grid {\n display: flex;\n}\n.p-megamenu-col-2,\n.p-megamenu-col-3,\n.p-megamenu-col-4,\n.p-megamenu-col-6,\n.p-megamenu-col-12 {\n flex: 0 0 auto;\n padding: 0.5rem;\n}\n.p-megamenu-col-2 {\n width: 16.6667%;\n}\n.p-megamenu-col-3 {\n width: 25%;\n}\n.p-megamenu-col-4 {\n width: 33.3333%;\n}\n.p-megamenu-col-6 {\n width: 50%;\n}\n.p-megamenu-col-12 {\n width: 100%;\n}\n";
|
|
995
995
|
styleInject(css_248z);
|
|
996
996
|
|
|
997
997
|
script.render = render;
|
package/megamenu/megamenu.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primevue=this.primevue||{},this.primevue.megamenu=function(e,t,i){"use strict";function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n={name:"MegaMenuSub",emits:["item-click","item-mouseenter"],props:{menuId:{type:String,default:null},focusedItemId:{type:String,default:null},horizontal:{type:Boolean,default:!1},submenu:{type:Object,default:null},items:{type:Array,default:null},level:{type:Number,default:0},template:{type:Function,default:null},activeItem:{type:Object,default:null},exact:{type:Boolean,default:!0}},methods:{getSubListId(e){return`${this.getItemId(e)}_list`},getSubListKey(e){return this.getSubListId(e)},getItemId(e){return`${this.menuId}_${e.key}`},getItemKey(e){return this.getItemId(e)},getItemProp:(t,i,s)=>t&&t.item?e.ObjectUtils.getItemValue(t.item[i],s):void 0,getItemLabel(e){return this.getItemProp(e,"label")},isItemActive(t){return!!e.ObjectUtils.isNotEmpty(this.activeItem)&&this.activeItem.key===t.key},isItemVisible(e){return!1!==this.getItemProp(e,"visible")},isItemDisabled(e){return this.getItemProp(e,"disabled")},isItemFocused(e){return this.focusedItemId===this.getItemId(e)},isItemGroup:t=>e.ObjectUtils.isNotEmpty(t.items),onItemClick(e,t){this.getItemProp(t,"command",{originalEvent:e,item:t.item}),this.$emit("item-click",{originalEvent:e,processedItem:t,isFocus:!0})},onItemMouseEnter(e,t){this.$emit("item-mouseenter",{originalEvent:e,processedItem:t})},onItemActionClick(e,t){t&&t(e)},getAriaSetSize(){return this.items.filter((e=>this.isItemVisible(e)&&!this.getItemProp(e,"separator"))).length},getAriaPosInset(e){return e-this.items.slice(0,e).filter((e=>this.isItemVisible(e)&&this.getItemProp(e,"separator"))).length+1},getSubmenuHeaderClass(e){return["p-megamenu-submenu-header p-submenu-header",this.getItemProp(e,"class"),{"p-disabled":this.isItemDisabled(e)}]},getColumnClass(e){let t;switch(this.isItemGroup(e)?e.items.length:0){case 2:t="p-megamenu-col-6";break;case 3:t="p-megamenu-col-4";break;case 4:t="p-megamenu-col-3";break;case 6:t="p-megamenu-col-2";break;default:t="p-megamenu-col-12"}return t},getItemClass(e){return["p-menuitem",this.getItemProp(e,"class"),{"p-menuitem-active p-highlight":this.isItemActive(e),"p-focus":this.isItemFocused(e),"p-disabled":this.isItemDisabled(e)}]},getItemActionClass(e,t){return["p-menuitem-link",{"router-link-active":t&&t.isActive,"router-link-active-exact":this.exact&&t&&t.isExactActive}]},getItemIconClass(e){return["p-menuitem-icon",this.getItemProp(e,"icon")]},getItemToggleIconClass(){return["p-submenu-icon",this.horizontal?"pi pi-angle-down":"pi pi-angle-right"]},getSeparatorItemClass(e){return["p-menuitem-separator",this.getItemProp(e,"class")]}},directives:{ripple:s(t).default}};const o=["id","aria-label","aria-disabled","aria-expanded","aria-haspopup","aria-level","aria-setsize","aria-posinset"],a=["onClick","onMouseenter"],m=["href","onClick"],r={class:"p-menuitem-text"},l=["href","target"],c={class:"p-menuitem-text"},d={key:0,class:"p-megamenu-panel"},u={class:"p-megamenu-grid"},I=["id"];n.render=function(e,t,s,n,h,p){const f=i.resolveComponent("router-link"),g=i.resolveComponent("MegaMenuSub",!0),y=i.resolveDirective("ripple");return i.openBlock(),i.createElementBlock("ul",null,[s.submenu?(i.openBlock(),i.createElementBlock("li",{key:0,class:i.normalizeClass(p.getSubmenuHeaderClass(s.submenu)),style:i.normalizeStyle(p.getItemProp(s.submenu,"style")),role:"presentation"},i.toDisplayString(p.getItemLabel(s.submenu)),7)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.items,((n,h)=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:p.getItemKey(n)},[p.isItemVisible(n)&&!p.getItemProp(n,"separator")?(i.openBlock(),i.createElementBlock("li",{key:0,id:p.getItemId(n),style:i.normalizeStyle(p.getItemProp(n,"style")),class:i.normalizeClass(p.getItemClass(n)),role:"menuitem","aria-label":p.getItemLabel(n),"aria-disabled":p.isItemDisabled(n)||void 0,"aria-expanded":p.isItemGroup(n)?p.isItemActive(n):void 0,"aria-haspopup":p.isItemGroup(n)&&!p.getItemProp(n,"to")?"menu":void 0,"aria-level":s.level+1,"aria-setsize":p.getAriaSetSize(),"aria-posinset":p.getAriaPosInset(h)},[i.createElementVNode("div",{class:"p-menuitem-content",onClick:e=>p.onItemClick(e,n),onMouseenter:e=>p.onItemMouseEnter(e,n)},[s.template?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(s.template),{key:1,item:n.item},null,8,["item"])):(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[p.getItemProp(n,"to")&&!p.isItemDisabled(n)?(i.openBlock(),i.createBlock(f,{key:0,to:p.getItemProp(n,"to"),custom:""},{default:i.withCtx((({navigate:e,href:t,isActive:s,isExactActive:o})=>[i.withDirectives((i.openBlock(),i.createElementBlock("a",{href:t,class:i.normalizeClass(p.getItemActionClass(n,{isActive:s,isExactActive:o})),tabindex:"-1","aria-hidden":"true",onClick:t=>p.onItemActionClick(t,e)},[p.getItemProp(n,"icon")?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass(p.getItemIconClass(n))},null,2)):i.createCommentVNode("",!0),i.createElementVNode("span",r,i.toDisplayString(p.getItemLabel(n)),1)],10,m)),[[y]])])),_:2},1032,["to"])):i.withDirectives((i.openBlock(),i.createElementBlock("a",{key:1,href:p.getItemProp(n,"url"),class:i.normalizeClass(p.getItemActionClass(n)),target:p.getItemProp(n,"target"),tabindex:"-1","aria-hidden":"true"},[p.getItemProp(n,"icon")?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass(p.getItemIconClass(n))},null,2)):i.createCommentVNode("",!0),i.createElementVNode("span",c,i.toDisplayString(p.getItemLabel(n)),1),p.isItemGroup(n)?(i.openBlock(),i.createElementBlock("span",{key:1,class:i.normalizeClass(p.getItemToggleIconClass())},null,2)):i.createCommentVNode("",!0)],10,l)),[[y]])],64))],40,a),p.isItemVisible(n)&&p.isItemGroup(n)?(i.openBlock(),i.createElementBlock("div",d,[i.createElementVNode("div",u,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.items,(o=>(i.openBlock(),i.createElementBlock("div",{key:p.getItemKey(o),class:i.normalizeClass(p.getColumnClass(n))},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o,(n=>(i.openBlock(),i.createBlock(g,{key:p.getSubListKey(n),id:p.getSubListId(n),role:"menu",class:"p-submenu-list p-megamenu-submenu",menuId:s.menuId,focusedItemId:s.focusedItemId,submenu:n,items:n.items,template:s.template,exact:s.exact,level:s.level+1,onItemClick:t[0]||(t[0]=t=>e.$emit("item-click",t)),onItemMouseenter:t[1]||(t[1]=t=>e.$emit("item-mouseenter",t))},null,8,["id","menuId","focusedItemId","submenu","items","template","exact","level"])))),128))],2)))),128))])])):i.createCommentVNode("",!0)],14,o)):i.createCommentVNode("",!0),p.isItemVisible(n)&&p.getItemProp(n,"separator")?(i.openBlock(),i.createElementBlock("li",{key:1,id:p.getItemId(n),style:i.normalizeStyle(p.getItemProp(n,"style")),class:i.normalizeClass(p.getSeparatorItemClass(n)),role:"separator"},null,14,I)):i.createCommentVNode("",!0)],64)))),128))])};var h={name:"MegaMenu",emits:["focus","blur"],props:{model:{type:Array,default:null},orientation:{type:String,default:"horizontal"},exact:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},tabindex:{type:Number,default:0},"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},outsideClickListener:null,resizeListener:null,container:null,menubar:null,searchTimeout:null,searchValue:null,data(){return{id:this.$attrs.id,focused:!1,focusedItemInfo:{index:-1,key:"",parentKey:""},activeItem:null,dirty:!1}},watch:{"$attrs.id":function(t){this.id=t||e.UniqueComponentId()},activeItem(t){e.ObjectUtils.isNotEmpty(t)?(this.bindOutsideClickListener(),this.bindResizeListener()):(this.unbindOutsideClickListener(),this.unbindResizeListener())}},mounted(){this.id=this.id||e.UniqueComponentId()},beforeUnmount(){this.unbindOutsideClickListener(),this.unbindResizeListener()},methods:{getItemProp:(t,i)=>t?e.ObjectUtils.getItemValue(t[i]):void 0,getItemLabel(e){return this.getItemProp(e,"label")},isItemDisabled(e){return this.getItemProp(e,"disabled")},isItemGroup(t){return e.ObjectUtils.isNotEmpty(this.getItemProp(t,"items"))},isItemSeparator(e){return this.getItemProp(e,"separator")},getProccessedItemLabel(e){return e?this.getItemLabel(e.item):void 0},isProccessedItemGroup:t=>t&&e.ObjectUtils.isNotEmpty(t.items),hide(t,i){this.activeItem=null,this.focusedItemInfo={index:-1,key:"",parentKey:""},i&&e.DomHandler.focus(this.menubar),this.dirty=!1},onFocus(e){if(this.focused=!0,-1===this.focusedItemInfo.index){const e=this.findFirstFocusedItemIndex(),t=this.findVisibleItem(e);this.focusedItemInfo={index:e,key:t.key,parentKey:t.parentKey}}this.$emit("focus",e)},onBlur(e){this.focused=!1,this.focusedItemInfo={index:-1,key:"",parentKey:""},this.searchValue="",this.dirty=!1,this.$emit("blur",e)},onKeyDown(t){if(this.disabled)return void t.preventDefault();const i=t.metaKey||t.ctrlKey;switch(t.code){case"ArrowDown":this.onArrowDownKey(t);break;case"ArrowUp":this.onArrowUpKey(t);break;case"ArrowLeft":this.onArrowLeftKey(t);break;case"ArrowRight":this.onArrowRightKey(t);break;case"Home":this.onHomeKey(t);break;case"End":this.onEndKey(t);break;case"Space":this.onSpaceKey(t);break;case"Enter":this.onEnterKey(t);break;case"Escape":this.onEscapeKey(t);break;case"Tab":this.onTabKey(t);break;case"PageDown":case"PageUp":case"Backspace":case"ShiftLeft":case"ShiftRight":break;default:!i&&e.ObjectUtils.isPrintableCharacter(t.key)&&this.searchItems(t,t.key)}},onItemChange(t){const{processedItem:i,isFocus:s}=t;if(e.ObjectUtils.isEmpty(i))return;const{index:n,key:o,parentKey:a,items:m}=i,r=e.ObjectUtils.isNotEmpty(m);r&&(this.activeItem=i),this.focusedItemInfo={index:n,key:o,parentKey:a},r&&(this.dirty=!0),s&&e.DomHandler.focus(this.menubar)},onItemClick(t){const{originalEvent:i,processedItem:s}=t,n=this.isProccessedItemGroup(s),o=e.ObjectUtils.isEmpty(s.parent);if(this.isSelected(s)){const{index:t,key:i,parentKey:n}=s;this.activeItem=null,this.focusedItemInfo={index:t,key:i,parentKey:n},this.dirty=!o,e.DomHandler.focus(this.menubar)}else if(n)this.onItemChange(t);else{const t=o?s:this.activeItem;this.hide(i),this.changeFocusedItemInfo(i,t?t.index:-1),e.DomHandler.focus(this.menubar)}},onItemMouseEnter(e){this.dirty&&this.onItemChange(e)},onArrowDownKey(t){if(this.horizontal)if(e.ObjectUtils.isNotEmpty(this.activeItem)&&this.activeItem.key===this.focusedItemInfo.key)this.focusedItemInfo={index:-1,key:"",parentKey:this.activeItem.key};else{const e=this.findVisibleItem(this.focusedItemInfo.index);this.isProccessedItemGroup(e)&&(this.onItemChange({originalEvent:t,processedItem:e}),this.focusedItemInfo={index:-1,key:e.key,parentKey:e.parentKey},this.searchValue="")}const i=-1!==this.focusedItemInfo.index?this.findNextItemIndex(this.focusedItemInfo.index):this.findFirstFocusedItemIndex();this.changeFocusedItemInfo(t,i),t.preventDefault()},onArrowUpKey(t){if(t.altKey&&this.horizontal){if(-1!==this.focusedItemInfo.index){const i=this.findVisibleItem(this.focusedItemInfo.index);!this.isProccessedItemGroup(i)&&e.ObjectUtils.isNotEmpty(this.activeItem)&&(0===this.focusedItemInfo.index?(this.focusedItemInfo={index:this.activeItem.index,key:this.activeItem.key,parentKey:this.activeItem.parentKey},this.activeItem=null):this.changeFocusedItemInfo(t,this.findFirstItemIndex()))}t.preventDefault()}else{const e=-1!==this.focusedItemInfo.index?this.findPrevItemIndex(this.focusedItemInfo.index):this.findLastFocusedItemIndex();this.changeFocusedItemInfo(t,e),t.preventDefault()}},onArrowLeftKey(t){const i=this.findVisibleItem(this.focusedItemInfo.index);if(this.isProccessedItemGroup(i)){if(this.horizontal){const e=-1!==this.focusedItemInfo.index?this.findPrevItemIndex(this.focusedItemInfo.index):this.findLastFocusedItemIndex();this.changeFocusedItemInfo(t,e)}}else{this.vertical&&e.ObjectUtils.isNotEmpty(this.activeItem)&&0===i.columnIndex&&(this.focusedItemInfo={index:this.activeItem.index,key:this.activeItem.key,parentKey:this.activeItem.parentKey},this.activeItem=null);const s=i.columnIndex-1,n=this.visibleItems.findIndex((e=>e.columnIndex===s));-1!==n&&this.changeFocusedItemInfo(t,n)}t.preventDefault()},onArrowRightKey(t){const i=this.findVisibleItem(this.focusedItemInfo.index);if(this.isProccessedItemGroup(i)){if(this.vertical)if(e.ObjectUtils.isNotEmpty(this.activeItem)&&this.activeItem.key===i.key)this.focusedItemInfo={index:-1,key:"",parentKey:this.activeItem.key};else{const e=this.findVisibleItem(this.focusedItemInfo.index);this.isProccessedItemGroup(e)&&(this.onItemChange({originalEvent:t,processedItem:e}),this.focusedItemInfo={index:-1,key:e.key,parentKey:e.parentKey},this.searchValue="")}const s=-1!==this.focusedItemInfo.index?this.findNextItemIndex(this.focusedItemInfo.index):this.findFirstFocusedItemIndex();this.changeFocusedItemInfo(t,s)}else{const e=i.columnIndex+1,s=this.visibleItems.findIndex((t=>t.columnIndex===e));-1!==s&&this.changeFocusedItemInfo(t,s)}t.preventDefault()},onHomeKey(e){this.changeFocusedItemInfo(e,this.findFirstItemIndex()),e.preventDefault()},onEndKey(e){this.changeFocusedItemInfo(e,this.findLastItemIndex()),e.preventDefault()},onEnterKey(t){if(-1!==this.focusedItemInfo.index){const i=e.DomHandler.findSingle(this.menubar,`li[id="${this.focusedItemId}"]`),s=i&&e.DomHandler.findSingle(i,".p-menuitem-link");s?s.click():i&&i.click();const n=this.visibleItems[this.focusedItemInfo.index];!this.isProccessedItemGroup(n)&&this.changeFocusedItemInfo(t,this.findFirstFocusedItemIndex())}t.preventDefault()},onSpaceKey(e){this.onEnterKey(e)},onEscapeKey(t){e.ObjectUtils.isNotEmpty(this.activeItem)&&(this.focusedItemInfo={index:this.activeItem.index,key:this.activeItem.key},this.activeItem=null),t.preventDefault()},onTabKey(e){if(-1!==this.focusedItemInfo.index){const t=this.findVisibleItem(this.focusedItemInfo.index);!this.isProccessedItemGroup(t)&&this.onItemChange({originalEvent:e,processedItem:t})}this.hide()},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{const t=this.container&&!this.container.contains(e.target),i=!this.popup||!(this.target&&(this.target===e.target||this.target.contains(e.target)));t&&i&&this.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindResizeListener(){this.resizeListener||(this.resizeListener=t=>{e.DomHandler.isTouchDevice()||this.hide(t,!0)},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},isItemMatched(e){return this.isValidItem(e)&&this.getProccessedItemLabel(e).toLocaleLowerCase().startsWith(this.searchValue.toLocaleLowerCase())},isValidItem(e){return!!e&&!this.isItemDisabled(e.item)&&!this.isItemSeparator(e.item)},isValidSelectedItem(e){return this.isValidItem(e)&&this.isSelected(e)},isSelected(t){return!!e.ObjectUtils.isNotEmpty(this.activeItem)&&this.activeItem.key===t.key},findFirstItemIndex(){return this.visibleItems.findIndex((e=>this.isValidItem(e)))},findLastItemIndex(){return e.ObjectUtils.findLastIndex(this.visibleItems,(e=>this.isValidItem(e)))},findNextItemIndex(e){const t=e<this.visibleItems.length-1?this.visibleItems.slice(e+1).findIndex((e=>this.isValidItem(e))):-1;return t>-1?t+e+1:e},findPrevItemIndex(t){const i=t>0?e.ObjectUtils.findLastIndex(this.visibleItems.slice(0,t),(e=>this.isValidItem(e))):-1;return i>-1?i:t},findSelectedItemIndex(){return this.visibleItems.findIndex((e=>this.isValidSelectedItem(e)))},findFirstFocusedItemIndex(){const e=this.findSelectedItemIndex();return e<0?this.findFirstItemIndex():e},findLastFocusedItemIndex(){const e=this.findSelectedItemIndex();return e<0?this.findLastItemIndex():e},findVisibleItem(t){return e.ObjectUtils.isNotEmpty(this.visibleItems)?this.visibleItems[t]:null},searchItems(e,t){this.searchValue=(this.searchValue||"")+t;let i=-1,s=!1;return-1!==this.focusedItemInfo.index?(i=this.visibleItems.slice(this.focusedItemInfo.index).findIndex((e=>this.isItemMatched(e))),i=-1===i?this.visibleItems.slice(0,this.focusedItemInfo.index).findIndex((e=>this.isItemMatched(e))):i+this.focusedItemInfo.index):i=this.visibleItems.findIndex((e=>this.isItemMatched(e))),-1!==i&&(s=!0),-1===i&&-1===this.focusedItemInfo.index&&(i=this.findFirstFocusedItemIndex()),-1!==i&&this.changeFocusedItemInfo(e,i),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((()=>{this.searchValue="",this.searchTimeout=null}),500),s},changeFocusedItemInfo(t,i){const s=this.findVisibleItem(i);this.focusedItemInfo.index=i,this.focusedItemInfo.key=e.ObjectUtils.isNotEmpty(s)?s.key:"",this.scrollInView()},scrollInView(t=-1){const i=-1!==t?`${this.id}_${t}`:this.focusedItemId,s=e.DomHandler.findSingle(this.menubar,`li[id="${i}"]`);s&&s.scrollIntoView&&s.scrollIntoView({block:"nearest",inline:"start"})},createProcessedItems(e,t=0,i={},s="",n){const o=[];return e&&e.forEach(((e,a)=>{const m=(""!==s?s+"_":"")+(void 0!==n?n+"_":"")+a,r={item:e,index:a,level:t,key:m,parent:i,parentKey:s,columnIndex:void 0!==n?n:void 0!==i.columnIndex?i.columnIndex:a};r.items=0===t&&e.items&&e.items.length>0?e.items.map(((e,i)=>this.createProcessedItems(e,t+1,r,m,i))):this.createProcessedItems(e.items,t+1,r,m),o.push(r)})),o},containerRef(e){this.container=e},menubarRef(e){this.menubar=e?e.$el:void 0}},computed:{containerClass(){return["p-megamenu p-component",{"p-megamenu-horizontal":this.horizontal,"p-megamenu-vertical":this.vertical}]},processedItems(){return this.createProcessedItems(this.model||[])},visibleItems(){const t=e.ObjectUtils.isNotEmpty(this.activeItem)?this.activeItem:null;return t&&t.key===this.focusedItemInfo.parentKey?t.items.reduce(((e,t)=>(t.forEach((t=>{t.items.forEach((t=>{e.push(t)}))})),e)),[]):this.processedItems},horizontal(){return"horizontal"===this.orientation},vertical(){return"vertical"===this.orientation},focusedItemId(){return e.ObjectUtils.isNotEmpty(this.focusedItemInfo.key)?`${this.id}_${this.focusedItemInfo.key}`:null}},components:{MegaMenuSub:n}};const p=["id"],f={key:0,class:"p-megamenu-start"},g={key:1,class:"p-megamenu-end"};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-megamenu-root-list {\n margin: 0;\n padding: 0;\n list-style: none;\n}\n.p-megamenu-root-list > .p-menuitem {\n position: relative;\n}\n.p-megamenu .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-megamenu .p-menuitem-text {\n line-height: 1;\n}\n.p-megamenu-panel {\n display: none;\n position: absolute;\n width: auto;\n z-index: 1;\n}\n.p-megamenu-root-list > .p-menuitem-active > .p-megamenu-panel {\n display: block;\n}\n.p-megamenu-submenu {\n margin: 0;\n padding: 0;\n list-style: none;\n}\n\n/* Horizontal */\n.p-megamenu-horizontal .p-megamenu-root-list {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n}\n\n/* Vertical */\n.p-megamenu-vertical .p-megamenu-root-list {\n flex-direction: column;\n}\n.p-megamenu-vertical .p-megamenu-root-list > .p-menuitem-active > .p-megamenu-panel {\n left: 100%;\n top: 0;\n}\n.p-megamenu-vertical .p-megamenu-root-list > .p-menuitem > .p-menuitem-content > .p-menuitem-link > .p-submenu-icon {\n margin-left: auto;\n}\n.p-megamenu-grid {\n display: flex;\n}\n.p-megamenu-col-2,\n.p-megamenu-col-3,\n.p-megamenu-col-4,\n.p-megamenu-col-6,\n.p-megamenu-col-12 {\n flex: 0 0 auto;\n padding: 0.5rem;\n}\n.p-megamenu-col-2 {\n width: 16.6667%;\n}\n.p-megamenu-col-3 {\n width: 25%;\n}\n.p-megamenu-col-4 {\n width: 33.3333%;\n}\n.p-megamenu-col-6 {\n width: 50%;\n}\n.p-megamenu-col-12 {\n width: 100%;\n}\n"),h.render=function(e,t,s,n,o,a){const m=i.resolveComponent("MegaMenuSub");return i.openBlock(),i.createElementBlock("div",{ref:a.containerRef,id:o.id,class:i.normalizeClass(a.containerClass)},[e.$slots.start?(i.openBlock(),i.createElementBlock("div",f,[i.renderSlot(e.$slots,"start")])):i.createCommentVNode("",!0),i.createVNode(m,{ref:a.menubarRef,id:o.id+"_list",class:"p-megamenu-root-list",tabindex:s.disabled?-1:s.tabindex,role:"menubar","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-disabled":s.disabled||void 0,"aria-orientation":s.orientation,"aria-activedescendant":o.focused?a.focusedItemId:void 0,menuId:o.id,focusedItemId:o.focused?a.focusedItemId:void 0,items:a.processedItems,horizontal:a.horizontal,template:e.$slots.item,activeItem:o.activeItem,exact:s.exact,level:0,onFocus:a.onFocus,onBlur:a.onBlur,onKeydown:a.onKeyDown,onItemClick:a.onItemClick,onItemMouseenter:a.onItemMouseEnter},null,8,["id","tabindex","aria-label","aria-labelledby","aria-disabled","aria-orientation","aria-activedescendant","menuId","focusedItemId","items","horizontal","template","activeItem","exact","onFocus","onBlur","onKeydown","onItemClick","onItemMouseenter"]),e.$slots.end?(i.openBlock(),i.createElementBlock("div",g,[i.renderSlot(e.$slots,"end")])):i.createCommentVNode("",!0)],10,p)},h}(primevue.utils,primevue.ripple,Vue);
|
|
1
|
+
this.primevue=this.primevue||{},this.primevue.megamenu=function(e,t,i){"use strict";function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n={name:"MegaMenuSub",emits:["item-click","item-mouseenter"],props:{menuId:{type:String,default:null},focusedItemId:{type:String,default:null},horizontal:{type:Boolean,default:!1},submenu:{type:Object,default:null},items:{type:Array,default:null},level:{type:Number,default:0},template:{type:Function,default:null},activeItem:{type:Object,default:null},exact:{type:Boolean,default:!0}},methods:{getSubListId(e){return`${this.getItemId(e)}_list`},getSubListKey(e){return this.getSubListId(e)},getItemId(e){return`${this.menuId}_${e.key}`},getItemKey(e){return this.getItemId(e)},getItemProp:(t,i,s)=>t&&t.item?e.ObjectUtils.getItemValue(t.item[i],s):void 0,getItemLabel(e){return this.getItemProp(e,"label")},isItemActive(t){return!!e.ObjectUtils.isNotEmpty(this.activeItem)&&this.activeItem.key===t.key},isItemVisible(e){return!1!==this.getItemProp(e,"visible")},isItemDisabled(e){return this.getItemProp(e,"disabled")},isItemFocused(e){return this.focusedItemId===this.getItemId(e)},isItemGroup:t=>e.ObjectUtils.isNotEmpty(t.items),onItemClick(e,t){this.getItemProp(t,"command",{originalEvent:e,item:t.item}),this.$emit("item-click",{originalEvent:e,processedItem:t,isFocus:!0})},onItemMouseEnter(e,t){this.$emit("item-mouseenter",{originalEvent:e,processedItem:t})},onItemActionClick(e,t){t&&t(e)},getAriaSetSize(){return this.items.filter((e=>this.isItemVisible(e)&&!this.getItemProp(e,"separator"))).length},getAriaPosInset(e){return e-this.items.slice(0,e).filter((e=>this.isItemVisible(e)&&this.getItemProp(e,"separator"))).length+1},getSubmenuHeaderClass(e){return["p-megamenu-submenu-header p-submenu-header",this.getItemProp(e,"class"),{"p-disabled":this.isItemDisabled(e)}]},getColumnClass(e){let t;switch(this.isItemGroup(e)?e.items.length:0){case 2:t="p-megamenu-col-6";break;case 3:t="p-megamenu-col-4";break;case 4:t="p-megamenu-col-3";break;case 6:t="p-megamenu-col-2";break;default:t="p-megamenu-col-12"}return t},getItemClass(e){return["p-menuitem",this.getItemProp(e,"class"),{"p-menuitem-active p-highlight":this.isItemActive(e),"p-focus":this.isItemFocused(e),"p-disabled":this.isItemDisabled(e)}]},getItemActionClass(e,t){return["p-menuitem-link",{"router-link-active":t&&t.isActive,"router-link-active-exact":this.exact&&t&&t.isExactActive}]},getItemIconClass(e){return["p-menuitem-icon",this.getItemProp(e,"icon")]},getItemToggleIconClass(){return["p-submenu-icon",this.horizontal?"pi pi-angle-down":"pi pi-angle-right"]},getSeparatorItemClass(e){return["p-menuitem-separator",this.getItemProp(e,"class")]}},directives:{ripple:s(t).default}};const o=["id","aria-label","aria-disabled","aria-expanded","aria-haspopup","aria-level","aria-setsize","aria-posinset"],a=["onClick","onMouseenter"],m=["href","onClick"],r={class:"p-menuitem-text"},l=["href","target"],c={class:"p-menuitem-text"},d={key:0,class:"p-megamenu-panel"},u={class:"p-megamenu-grid"},I=["id"];n.render=function(e,t,s,n,h,p){const f=i.resolveComponent("router-link"),g=i.resolveComponent("MegaMenuSub",!0),y=i.resolveDirective("ripple");return i.openBlock(),i.createElementBlock("ul",null,[s.submenu?(i.openBlock(),i.createElementBlock("li",{key:0,class:i.normalizeClass(p.getSubmenuHeaderClass(s.submenu)),style:i.normalizeStyle(p.getItemProp(s.submenu,"style")),role:"presentation"},i.toDisplayString(p.getItemLabel(s.submenu)),7)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.items,((n,h)=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:p.getItemKey(n)},[p.isItemVisible(n)&&!p.getItemProp(n,"separator")?(i.openBlock(),i.createElementBlock("li",{key:0,id:p.getItemId(n),style:i.normalizeStyle(p.getItemProp(n,"style")),class:i.normalizeClass(p.getItemClass(n)),role:"menuitem","aria-label":p.getItemLabel(n),"aria-disabled":p.isItemDisabled(n)||void 0,"aria-expanded":p.isItemGroup(n)?p.isItemActive(n):void 0,"aria-haspopup":p.isItemGroup(n)&&!p.getItemProp(n,"to")?"menu":void 0,"aria-level":s.level+1,"aria-setsize":p.getAriaSetSize(),"aria-posinset":p.getAriaPosInset(h)},[i.createElementVNode("div",{class:"p-menuitem-content",onClick:e=>p.onItemClick(e,n),onMouseenter:e=>p.onItemMouseEnter(e,n)},[s.template?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(s.template),{key:1,item:n.item},null,8,["item"])):(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[p.getItemProp(n,"to")&&!p.isItemDisabled(n)?(i.openBlock(),i.createBlock(f,{key:0,to:p.getItemProp(n,"to"),custom:""},{default:i.withCtx((({navigate:e,href:t,isActive:s,isExactActive:o})=>[i.withDirectives((i.openBlock(),i.createElementBlock("a",{href:t,class:i.normalizeClass(p.getItemActionClass(n,{isActive:s,isExactActive:o})),tabindex:"-1","aria-hidden":"true",onClick:t=>p.onItemActionClick(t,e)},[p.getItemProp(n,"icon")?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass(p.getItemIconClass(n))},null,2)):i.createCommentVNode("",!0),i.createElementVNode("span",r,i.toDisplayString(p.getItemLabel(n)),1)],10,m)),[[y]])])),_:2},1032,["to"])):i.withDirectives((i.openBlock(),i.createElementBlock("a",{key:1,href:p.getItemProp(n,"url"),class:i.normalizeClass(p.getItemActionClass(n)),target:p.getItemProp(n,"target"),tabindex:"-1","aria-hidden":"true"},[p.getItemProp(n,"icon")?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass(p.getItemIconClass(n))},null,2)):i.createCommentVNode("",!0),i.createElementVNode("span",c,i.toDisplayString(p.getItemLabel(n)),1),p.isItemGroup(n)?(i.openBlock(),i.createElementBlock("span",{key:1,class:i.normalizeClass(p.getItemToggleIconClass())},null,2)):i.createCommentVNode("",!0)],10,l)),[[y]])],64))],40,a),p.isItemVisible(n)&&p.isItemGroup(n)?(i.openBlock(),i.createElementBlock("div",d,[i.createElementVNode("div",u,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.items,(o=>(i.openBlock(),i.createElementBlock("div",{key:p.getItemKey(o),class:i.normalizeClass(p.getColumnClass(n))},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o,(n=>(i.openBlock(),i.createBlock(g,{key:p.getSubListKey(n),id:p.getSubListId(n),role:"menu",class:"p-submenu-list p-megamenu-submenu",menuId:s.menuId,focusedItemId:s.focusedItemId,submenu:n,items:n.items,template:s.template,exact:s.exact,level:s.level+1,onItemClick:t[0]||(t[0]=t=>e.$emit("item-click",t)),onItemMouseenter:t[1]||(t[1]=t=>e.$emit("item-mouseenter",t))},null,8,["id","menuId","focusedItemId","submenu","items","template","exact","level"])))),128))],2)))),128))])])):i.createCommentVNode("",!0)],14,o)):i.createCommentVNode("",!0),p.isItemVisible(n)&&p.getItemProp(n,"separator")?(i.openBlock(),i.createElementBlock("li",{key:1,id:p.getItemId(n),style:i.normalizeStyle(p.getItemProp(n,"style")),class:i.normalizeClass(p.getSeparatorItemClass(n)),role:"separator"},null,14,I)):i.createCommentVNode("",!0)],64)))),128))])};var h={name:"MegaMenu",emits:["focus","blur"],props:{model:{type:Array,default:null},orientation:{type:String,default:"horizontal"},exact:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},tabindex:{type:Number,default:0},"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},outsideClickListener:null,resizeListener:null,container:null,menubar:null,searchTimeout:null,searchValue:null,data(){return{id:this.$attrs.id,focused:!1,focusedItemInfo:{index:-1,key:"",parentKey:""},activeItem:null,dirty:!1}},watch:{"$attrs.id":function(t){this.id=t||e.UniqueComponentId()},activeItem(t){e.ObjectUtils.isNotEmpty(t)?(this.bindOutsideClickListener(),this.bindResizeListener()):(this.unbindOutsideClickListener(),this.unbindResizeListener())}},mounted(){this.id=this.id||e.UniqueComponentId()},beforeUnmount(){this.unbindOutsideClickListener(),this.unbindResizeListener()},methods:{getItemProp:(t,i)=>t?e.ObjectUtils.getItemValue(t[i]):void 0,getItemLabel(e){return this.getItemProp(e,"label")},isItemDisabled(e){return this.getItemProp(e,"disabled")},isItemGroup(t){return e.ObjectUtils.isNotEmpty(this.getItemProp(t,"items"))},isItemSeparator(e){return this.getItemProp(e,"separator")},getProccessedItemLabel(e){return e?this.getItemLabel(e.item):void 0},isProccessedItemGroup:t=>t&&e.ObjectUtils.isNotEmpty(t.items),hide(t,i){this.activeItem=null,this.focusedItemInfo={index:-1,key:"",parentKey:""},i&&e.DomHandler.focus(this.menubar),this.dirty=!1},onFocus(e){if(this.focused=!0,-1===this.focusedItemInfo.index){const e=this.findFirstFocusedItemIndex(),t=this.findVisibleItem(e);this.focusedItemInfo={index:e,key:t.key,parentKey:t.parentKey}}this.$emit("focus",e)},onBlur(e){this.focused=!1,this.focusedItemInfo={index:-1,key:"",parentKey:""},this.searchValue="",this.dirty=!1,this.$emit("blur",e)},onKeyDown(t){if(this.disabled)return void t.preventDefault();const i=t.metaKey||t.ctrlKey;switch(t.code){case"ArrowDown":this.onArrowDownKey(t);break;case"ArrowUp":this.onArrowUpKey(t);break;case"ArrowLeft":this.onArrowLeftKey(t);break;case"ArrowRight":this.onArrowRightKey(t);break;case"Home":this.onHomeKey(t);break;case"End":this.onEndKey(t);break;case"Space":this.onSpaceKey(t);break;case"Enter":this.onEnterKey(t);break;case"Escape":this.onEscapeKey(t);break;case"Tab":this.onTabKey(t);break;case"PageDown":case"PageUp":case"Backspace":case"ShiftLeft":case"ShiftRight":break;default:!i&&e.ObjectUtils.isPrintableCharacter(t.key)&&this.searchItems(t,t.key)}},onItemChange(t){const{processedItem:i,isFocus:s}=t;if(e.ObjectUtils.isEmpty(i))return;const{index:n,key:o,parentKey:a,items:m}=i,r=e.ObjectUtils.isNotEmpty(m);r&&(this.activeItem=i),this.focusedItemInfo={index:n,key:o,parentKey:a},r&&(this.dirty=!0),s&&e.DomHandler.focus(this.menubar)},onItemClick(t){const{originalEvent:i,processedItem:s}=t,n=this.isProccessedItemGroup(s),o=e.ObjectUtils.isEmpty(s.parent);if(this.isSelected(s)){const{index:t,key:i,parentKey:n}=s;this.activeItem=null,this.focusedItemInfo={index:t,key:i,parentKey:n},this.dirty=!o,e.DomHandler.focus(this.menubar)}else if(n)this.onItemChange(t);else{const t=o?s:this.activeItem;this.hide(i),this.changeFocusedItemInfo(i,t?t.index:-1),e.DomHandler.focus(this.menubar)}},onItemMouseEnter(e){this.dirty&&this.onItemChange(e)},onArrowDownKey(t){if(this.horizontal)if(e.ObjectUtils.isNotEmpty(this.activeItem)&&this.activeItem.key===this.focusedItemInfo.key)this.focusedItemInfo={index:-1,key:"",parentKey:this.activeItem.key};else{const e=this.findVisibleItem(this.focusedItemInfo.index);this.isProccessedItemGroup(e)&&(this.onItemChange({originalEvent:t,processedItem:e}),this.focusedItemInfo={index:-1,key:e.key,parentKey:e.parentKey},this.searchValue="")}const i=-1!==this.focusedItemInfo.index?this.findNextItemIndex(this.focusedItemInfo.index):this.findFirstFocusedItemIndex();this.changeFocusedItemInfo(t,i),t.preventDefault()},onArrowUpKey(t){if(t.altKey&&this.horizontal){if(-1!==this.focusedItemInfo.index){const i=this.findVisibleItem(this.focusedItemInfo.index);!this.isProccessedItemGroup(i)&&e.ObjectUtils.isNotEmpty(this.activeItem)&&(0===this.focusedItemInfo.index?(this.focusedItemInfo={index:this.activeItem.index,key:this.activeItem.key,parentKey:this.activeItem.parentKey},this.activeItem=null):this.changeFocusedItemInfo(t,this.findFirstItemIndex()))}t.preventDefault()}else{const e=-1!==this.focusedItemInfo.index?this.findPrevItemIndex(this.focusedItemInfo.index):this.findLastFocusedItemIndex();this.changeFocusedItemInfo(t,e),t.preventDefault()}},onArrowLeftKey(t){const i=this.findVisibleItem(this.focusedItemInfo.index);if(this.isProccessedItemGroup(i)){if(this.horizontal){const e=-1!==this.focusedItemInfo.index?this.findPrevItemIndex(this.focusedItemInfo.index):this.findLastFocusedItemIndex();this.changeFocusedItemInfo(t,e)}}else{this.vertical&&e.ObjectUtils.isNotEmpty(this.activeItem)&&0===i.columnIndex&&(this.focusedItemInfo={index:this.activeItem.index,key:this.activeItem.key,parentKey:this.activeItem.parentKey},this.activeItem=null);const s=i.columnIndex-1,n=this.visibleItems.findIndex((e=>e.columnIndex===s));-1!==n&&this.changeFocusedItemInfo(t,n)}t.preventDefault()},onArrowRightKey(t){const i=this.findVisibleItem(this.focusedItemInfo.index);if(this.isProccessedItemGroup(i)){if(this.vertical)if(e.ObjectUtils.isNotEmpty(this.activeItem)&&this.activeItem.key===i.key)this.focusedItemInfo={index:-1,key:"",parentKey:this.activeItem.key};else{const e=this.findVisibleItem(this.focusedItemInfo.index);this.isProccessedItemGroup(e)&&(this.onItemChange({originalEvent:t,processedItem:e}),this.focusedItemInfo={index:-1,key:e.key,parentKey:e.parentKey},this.searchValue="")}const s=-1!==this.focusedItemInfo.index?this.findNextItemIndex(this.focusedItemInfo.index):this.findFirstFocusedItemIndex();this.changeFocusedItemInfo(t,s)}else{const e=i.columnIndex+1,s=this.visibleItems.findIndex((t=>t.columnIndex===e));-1!==s&&this.changeFocusedItemInfo(t,s)}t.preventDefault()},onHomeKey(e){this.changeFocusedItemInfo(e,this.findFirstItemIndex()),e.preventDefault()},onEndKey(e){this.changeFocusedItemInfo(e,this.findLastItemIndex()),e.preventDefault()},onEnterKey(t){if(-1!==this.focusedItemInfo.index){const i=e.DomHandler.findSingle(this.menubar,`li[id="${this.focusedItemId}"]`),s=i&&e.DomHandler.findSingle(i,".p-menuitem-link");s?s.click():i&&i.click();const n=this.visibleItems[this.focusedItemInfo.index];!this.isProccessedItemGroup(n)&&this.changeFocusedItemInfo(t,this.findFirstFocusedItemIndex())}t.preventDefault()},onSpaceKey(e){this.onEnterKey(e)},onEscapeKey(t){e.ObjectUtils.isNotEmpty(this.activeItem)&&(this.focusedItemInfo={index:this.activeItem.index,key:this.activeItem.key},this.activeItem=null),t.preventDefault()},onTabKey(e){if(-1!==this.focusedItemInfo.index){const t=this.findVisibleItem(this.focusedItemInfo.index);!this.isProccessedItemGroup(t)&&this.onItemChange({originalEvent:e,processedItem:t})}this.hide()},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{const t=this.container&&!this.container.contains(e.target),i=!this.popup||!(this.target&&(this.target===e.target||this.target.contains(e.target)));t&&i&&this.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindResizeListener(){this.resizeListener||(this.resizeListener=t=>{e.DomHandler.isTouchDevice()||this.hide(t,!0)},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},isItemMatched(e){return this.isValidItem(e)&&this.getProccessedItemLabel(e).toLocaleLowerCase().startsWith(this.searchValue.toLocaleLowerCase())},isValidItem(e){return!!e&&!this.isItemDisabled(e.item)&&!this.isItemSeparator(e.item)},isValidSelectedItem(e){return this.isValidItem(e)&&this.isSelected(e)},isSelected(t){return!!e.ObjectUtils.isNotEmpty(this.activeItem)&&this.activeItem.key===t.key},findFirstItemIndex(){return this.visibleItems.findIndex((e=>this.isValidItem(e)))},findLastItemIndex(){return e.ObjectUtils.findLastIndex(this.visibleItems,(e=>this.isValidItem(e)))},findNextItemIndex(e){const t=e<this.visibleItems.length-1?this.visibleItems.slice(e+1).findIndex((e=>this.isValidItem(e))):-1;return t>-1?t+e+1:e},findPrevItemIndex(t){const i=t>0?e.ObjectUtils.findLastIndex(this.visibleItems.slice(0,t),(e=>this.isValidItem(e))):-1;return i>-1?i:t},findSelectedItemIndex(){return this.visibleItems.findIndex((e=>this.isValidSelectedItem(e)))},findFirstFocusedItemIndex(){const e=this.findSelectedItemIndex();return e<0?this.findFirstItemIndex():e},findLastFocusedItemIndex(){const e=this.findSelectedItemIndex();return e<0?this.findLastItemIndex():e},findVisibleItem(t){return e.ObjectUtils.isNotEmpty(this.visibleItems)?this.visibleItems[t]:null},searchItems(e,t){this.searchValue=(this.searchValue||"")+t;let i=-1,s=!1;return-1!==this.focusedItemInfo.index?(i=this.visibleItems.slice(this.focusedItemInfo.index).findIndex((e=>this.isItemMatched(e))),i=-1===i?this.visibleItems.slice(0,this.focusedItemInfo.index).findIndex((e=>this.isItemMatched(e))):i+this.focusedItemInfo.index):i=this.visibleItems.findIndex((e=>this.isItemMatched(e))),-1!==i&&(s=!0),-1===i&&-1===this.focusedItemInfo.index&&(i=this.findFirstFocusedItemIndex()),-1!==i&&this.changeFocusedItemInfo(e,i),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((()=>{this.searchValue="",this.searchTimeout=null}),500),s},changeFocusedItemInfo(t,i){const s=this.findVisibleItem(i);this.focusedItemInfo.index=i,this.focusedItemInfo.key=e.ObjectUtils.isNotEmpty(s)?s.key:"",this.scrollInView()},scrollInView(t=-1){const i=-1!==t?`${this.id}_${t}`:this.focusedItemId,s=e.DomHandler.findSingle(this.menubar,`li[id="${i}"]`);s&&s.scrollIntoView&&s.scrollIntoView({block:"nearest",inline:"start"})},createProcessedItems(e,t=0,i={},s="",n){const o=[];return e&&e.forEach(((e,a)=>{const m=(""!==s?s+"_":"")+(void 0!==n?n+"_":"")+a,r={item:e,index:a,level:t,key:m,parent:i,parentKey:s,columnIndex:void 0!==n?n:void 0!==i.columnIndex?i.columnIndex:a};r.items=0===t&&e.items&&e.items.length>0?e.items.map(((e,i)=>this.createProcessedItems(e,t+1,r,m,i))):this.createProcessedItems(e.items,t+1,r,m),o.push(r)})),o},containerRef(e){this.container=e},menubarRef(e){this.menubar=e?e.$el:void 0}},computed:{containerClass(){return["p-megamenu p-component",{"p-megamenu-horizontal":this.horizontal,"p-megamenu-vertical":this.vertical}]},processedItems(){return this.createProcessedItems(this.model||[])},visibleItems(){const t=e.ObjectUtils.isNotEmpty(this.activeItem)?this.activeItem:null;return t&&t.key===this.focusedItemInfo.parentKey?t.items.reduce(((e,t)=>(t.forEach((t=>{t.items.forEach((t=>{e.push(t)}))})),e)),[]):this.processedItems},horizontal(){return"horizontal"===this.orientation},vertical(){return"vertical"===this.orientation},focusedItemId(){return e.ObjectUtils.isNotEmpty(this.focusedItemInfo.key)?`${this.id}_${this.focusedItemInfo.key}`:null}},components:{MegaMenuSub:n}};const p=["id"],f={key:0,class:"p-megamenu-start"},g={key:1,class:"p-megamenu-end"};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-megamenu {\n display: flex;\n}\n.p-megamenu-root-list {\n margin: 0;\n padding: 0;\n list-style: none;\n}\n.p-megamenu-root-list > .p-menuitem {\n position: relative;\n}\n.p-megamenu .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-megamenu .p-menuitem-text {\n line-height: 1;\n}\n.p-megamenu-panel {\n display: none;\n position: absolute;\n width: auto;\n z-index: 1;\n}\n.p-megamenu-root-list > .p-menuitem-active > .p-megamenu-panel {\n display: block;\n}\n.p-megamenu-submenu {\n margin: 0;\n padding: 0;\n list-style: none;\n}\n\n/* Horizontal */\n.p-megamenu-horizontal {\n align-items: center;\n}\n.p-megamenu-horizontal .p-megamenu-root-list {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n}\n.p-megamenu-horizontal .p-megamenu-end {\n margin-left: auto;\n align-self: center;\n}\n\n/* Vertical */\n.p-megamenu-vertical {\n flex-direction: column;\n}\n.p-megamenu-vertical .p-megamenu-root-list {\n flex-direction: column;\n}\n.p-megamenu-vertical .p-megamenu-root-list > .p-menuitem-active > .p-megamenu-panel {\n left: 100%;\n top: 0;\n}\n.p-megamenu-vertical .p-megamenu-root-list > .p-menuitem > .p-menuitem-content > .p-menuitem-link > .p-submenu-icon {\n margin-left: auto;\n}\n.p-megamenu-grid {\n display: flex;\n}\n.p-megamenu-col-2,\n.p-megamenu-col-3,\n.p-megamenu-col-4,\n.p-megamenu-col-6,\n.p-megamenu-col-12 {\n flex: 0 0 auto;\n padding: 0.5rem;\n}\n.p-megamenu-col-2 {\n width: 16.6667%;\n}\n.p-megamenu-col-3 {\n width: 25%;\n}\n.p-megamenu-col-4 {\n width: 33.3333%;\n}\n.p-megamenu-col-6 {\n width: 50%;\n}\n.p-megamenu-col-12 {\n width: 100%;\n}\n"),h.render=function(e,t,s,n,o,a){const m=i.resolveComponent("MegaMenuSub");return i.openBlock(),i.createElementBlock("div",{ref:a.containerRef,id:o.id,class:i.normalizeClass(a.containerClass)},[e.$slots.start?(i.openBlock(),i.createElementBlock("div",f,[i.renderSlot(e.$slots,"start")])):i.createCommentVNode("",!0),i.createVNode(m,{ref:a.menubarRef,id:o.id+"_list",class:"p-megamenu-root-list",tabindex:s.disabled?-1:s.tabindex,role:"menubar","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-disabled":s.disabled||void 0,"aria-orientation":s.orientation,"aria-activedescendant":o.focused?a.focusedItemId:void 0,menuId:o.id,focusedItemId:o.focused?a.focusedItemId:void 0,items:a.processedItems,horizontal:a.horizontal,template:e.$slots.item,activeItem:o.activeItem,exact:s.exact,level:0,onFocus:a.onFocus,onBlur:a.onBlur,onKeydown:a.onKeyDown,onItemClick:a.onItemClick,onItemMouseenter:a.onItemMouseEnter},null,8,["id","tabindex","aria-label","aria-labelledby","aria-disabled","aria-orientation","aria-activedescendant","menuId","focusedItemId","items","horizontal","template","activeItem","exact","onFocus","onBlur","onKeydown","onItemClick","onItemMouseenter"]),e.$slots.end?(i.openBlock(),i.createElementBlock("div",g,[i.renderSlot(e.$slots,"end")])):i.createCommentVNode("",!0)],10,p)},h}(primevue.utils,primevue.ripple,Vue);
|
package/menu/Menu.d.ts
CHANGED
|
@@ -1,9 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Menu is a navigation / command component that supports dynamic and static positioning.
|
|
4
|
+
*
|
|
5
|
+
* [Live Demo](https://www.primevue.org/menu/)
|
|
6
|
+
*
|
|
7
|
+
* @module menu
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
1
10
|
import { VNode } from 'vue';
|
|
2
11
|
import { MenuItem } from '../menuitem';
|
|
3
12
|
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
|
|
4
13
|
|
|
5
|
-
|
|
6
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Defines valid properties in Menu component.
|
|
16
|
+
*/
|
|
7
17
|
export interface MenuProps {
|
|
8
18
|
/**
|
|
9
19
|
* An array of menuitems.
|
|
@@ -11,27 +21,27 @@ export interface MenuProps {
|
|
|
11
21
|
model?: MenuItem[] | undefined;
|
|
12
22
|
/**
|
|
13
23
|
* Defines if menu would displayed as a popup.
|
|
24
|
+
* @defaultValue false
|
|
14
25
|
*/
|
|
15
26
|
popup?: boolean | undefined;
|
|
16
27
|
/**
|
|
17
28
|
* A valid query selector or an HTMLElement to specify where the overlay gets attached.
|
|
18
|
-
* @
|
|
19
|
-
* Default value is 'body'.
|
|
29
|
+
* @defaultValue body
|
|
20
30
|
*/
|
|
21
|
-
appendTo?:
|
|
31
|
+
appendTo?: 'body' | 'self' | string | undefined | HTMLElement;
|
|
22
32
|
/**
|
|
23
33
|
* Whether to automatically manage layering.
|
|
24
|
-
*
|
|
34
|
+
* @defaultValue true
|
|
25
35
|
*/
|
|
26
36
|
autoZIndex?: boolean | undefined;
|
|
27
37
|
/**
|
|
28
38
|
* Base zIndex value to use in layering.
|
|
29
|
-
*
|
|
39
|
+
* @defaultValue 0
|
|
30
40
|
*/
|
|
31
41
|
baseZIndex?: number | undefined;
|
|
32
42
|
/**
|
|
33
43
|
* Whether to apply 'router-link-active-exact' class if route exactly matches the item path.
|
|
34
|
-
*
|
|
44
|
+
* @defaultValue true
|
|
35
45
|
*/
|
|
36
46
|
exact?: boolean | undefined;
|
|
37
47
|
/**
|
|
@@ -48,27 +58,58 @@ export interface MenuProps {
|
|
|
48
58
|
'aria-labelledby'?: string | undefined;
|
|
49
59
|
}
|
|
50
60
|
|
|
61
|
+
/**
|
|
62
|
+
* Defines valid slots in Menu component.
|
|
63
|
+
*/
|
|
51
64
|
export interface MenuSlots {
|
|
65
|
+
/**
|
|
66
|
+
* Custom start template.
|
|
67
|
+
*/
|
|
68
|
+
start(): VNode[];
|
|
69
|
+
/**
|
|
70
|
+
* Custom end template.
|
|
71
|
+
*/
|
|
72
|
+
end(): VNode[];
|
|
52
73
|
/**
|
|
53
74
|
* Custom item template.
|
|
54
75
|
* @param {Object} scope - item slot's params.
|
|
55
76
|
*/
|
|
56
|
-
item
|
|
77
|
+
item(scope: {
|
|
78
|
+
/**
|
|
79
|
+
* Menuitem instance
|
|
80
|
+
*/
|
|
81
|
+
item: MenuItem;
|
|
82
|
+
}): VNode[];
|
|
57
83
|
}
|
|
58
84
|
|
|
59
|
-
|
|
85
|
+
/**
|
|
86
|
+
* Defines valid emits in Menu component.
|
|
87
|
+
*/
|
|
88
|
+
export interface MenuEmits {
|
|
60
89
|
/**
|
|
61
90
|
* Callback to invoke when the component receives focus.
|
|
62
91
|
* @param {Event} event - Browser event.
|
|
63
92
|
*/
|
|
64
|
-
focus
|
|
93
|
+
focus(event: Event): void;
|
|
65
94
|
/**
|
|
66
95
|
* Callback to invoke when the component loses focus.
|
|
67
96
|
* @param {Event} event - Browser event.
|
|
68
97
|
*/
|
|
69
|
-
blur
|
|
70
|
-
}
|
|
98
|
+
blur(event: Event): void;
|
|
99
|
+
}
|
|
71
100
|
|
|
101
|
+
/**
|
|
102
|
+
* **PrimeVue - Menu**
|
|
103
|
+
*
|
|
104
|
+
* _Menu is a navigation / command component that supports dynamic and static positioning._
|
|
105
|
+
*
|
|
106
|
+
* [Live Demo](https://www.primevue.org/menu/)
|
|
107
|
+
* --- ---
|
|
108
|
+
* 
|
|
109
|
+
*
|
|
110
|
+
* @group Component
|
|
111
|
+
*
|
|
112
|
+
*/
|
|
72
113
|
declare class Menu extends ClassComponent<MenuProps, MenuSlots, MenuEmits> {
|
|
73
114
|
/**
|
|
74
115
|
* Toggles the visibility of the overlay.
|
|
@@ -76,14 +117,15 @@ declare class Menu extends ClassComponent<MenuProps, MenuSlots, MenuEmits> {
|
|
|
76
117
|
*
|
|
77
118
|
* @memberof Menu
|
|
78
119
|
*/
|
|
79
|
-
toggle
|
|
120
|
+
toggle(event: Event): void;
|
|
80
121
|
/**
|
|
81
122
|
* Shows the overlay.
|
|
82
123
|
* @param {Event} event - Browser event.
|
|
124
|
+
* @param {*} [target] - Target element
|
|
83
125
|
*
|
|
84
126
|
* @memberof Menu
|
|
85
127
|
*/
|
|
86
|
-
show
|
|
128
|
+
show(event: Event, target?: any): void;
|
|
87
129
|
/**
|
|
88
130
|
* Hides the overlay.
|
|
89
131
|
*
|
|
@@ -98,17 +140,4 @@ declare module '@vue/runtime-core' {
|
|
|
98
140
|
}
|
|
99
141
|
}
|
|
100
142
|
|
|
101
|
-
/**
|
|
102
|
-
*
|
|
103
|
-
* Menu is a navigation / command component that supports dynamic and static positioning.
|
|
104
|
-
*
|
|
105
|
-
* Helper API:
|
|
106
|
-
*
|
|
107
|
-
* - [MenuItem](https://www.primefaces.org/primevue/menumodel)
|
|
108
|
-
*
|
|
109
|
-
* Demos:
|
|
110
|
-
*
|
|
111
|
-
* - [Menu](https://www.primefaces.org/primevue/menu)
|
|
112
|
-
*
|
|
113
|
-
*/
|
|
114
143
|
export default Menu;
|
package/menu/Menu.vue
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
<Portal :appendTo="appendTo" :disabled="!popup">
|
|
3
3
|
<transition name="p-connected-overlay" @enter="onEnter" @leave="onLeave" @after-leave="onAfterLeave">
|
|
4
4
|
<div v-if="popup ? overlayVisible : true" :ref="containerRef" :id="id" :class="containerClass" v-bind="$attrs" @click="onOverlayClick">
|
|
5
|
+
<div v-if="$slots.start" class="p-menu-start">
|
|
6
|
+
<slot name="start"></slot>
|
|
7
|
+
</div>
|
|
5
8
|
<ul
|
|
6
9
|
:ref="listRef"
|
|
7
10
|
:id="id + '_list'"
|
|
@@ -29,6 +32,9 @@
|
|
|
29
32
|
<PVMenuitem v-else :key="label(item) + i.toString()" :id="id + '_' + i" :item="item" :template="$slots.item" :exact="exact" :focusedOptionId="focusedOptionId" @item-click="itemClick" />
|
|
30
33
|
</template>
|
|
31
34
|
</ul>
|
|
35
|
+
<div v-if="$slots.end" class="p-menu-end">
|
|
36
|
+
<slot name="end"></slot>
|
|
37
|
+
</div>
|
|
32
38
|
</div>
|
|
33
39
|
</transition>
|
|
34
40
|
</Portal>
|
package/menu/menu.cjs.js
CHANGED
|
@@ -66,8 +66,8 @@ var script$1 = {
|
|
|
66
66
|
const _hoisted_1$1 = ["id", "aria-label", "aria-disabled"];
|
|
67
67
|
const _hoisted_2$1 = ["href", "onClick"];
|
|
68
68
|
const _hoisted_3$1 = { class: "p-menuitem-text" };
|
|
69
|
-
const _hoisted_4 = ["href", "target"];
|
|
70
|
-
const _hoisted_5 = { class: "p-menuitem-text" };
|
|
69
|
+
const _hoisted_4$1 = ["href", "target"];
|
|
70
|
+
const _hoisted_5$1 = { class: "p-menuitem-text" };
|
|
71
71
|
|
|
72
72
|
function render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
73
73
|
const _component_router_link = vue.resolveComponent("router-link");
|
|
@@ -130,8 +130,8 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
130
130
|
class: vue.normalizeClass(['p-menuitem-icon', $props.item.icon])
|
|
131
131
|
}, null, 2))
|
|
132
132
|
: vue.createCommentVNode("", true),
|
|
133
|
-
vue.createElementVNode("span", _hoisted_5, vue.toDisplayString($options.label()), 1)
|
|
134
|
-
], 10, _hoisted_4)), [
|
|
133
|
+
vue.createElementVNode("span", _hoisted_5$1, vue.toDisplayString($options.label()), 1)
|
|
134
|
+
], 10, _hoisted_4$1)), [
|
|
135
135
|
[_directive_ripple]
|
|
136
136
|
])
|
|
137
137
|
], 64))
|
|
@@ -511,8 +511,16 @@ var script = {
|
|
|
511
511
|
};
|
|
512
512
|
|
|
513
513
|
const _hoisted_1 = ["id"];
|
|
514
|
-
const _hoisted_2 =
|
|
515
|
-
|
|
514
|
+
const _hoisted_2 = {
|
|
515
|
+
key: 0,
|
|
516
|
+
class: "p-menu-start"
|
|
517
|
+
};
|
|
518
|
+
const _hoisted_3 = ["id", "tabindex", "aria-activedescendant", "aria-label", "aria-labelledby"];
|
|
519
|
+
const _hoisted_4 = ["id"];
|
|
520
|
+
const _hoisted_5 = {
|
|
521
|
+
key: 1,
|
|
522
|
+
class: "p-menu-end"
|
|
523
|
+
};
|
|
516
524
|
|
|
517
525
|
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
518
526
|
const _component_PVMenuitem = vue.resolveComponent("PVMenuitem");
|
|
@@ -539,6 +547,11 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
539
547
|
}, _ctx.$attrs, {
|
|
540
548
|
onClick: _cache[3] || (_cache[3] = (...args) => ($options.onOverlayClick && $options.onOverlayClick(...args)))
|
|
541
549
|
}), [
|
|
550
|
+
(_ctx.$slots.start)
|
|
551
|
+
? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, [
|
|
552
|
+
vue.renderSlot(_ctx.$slots, "start")
|
|
553
|
+
]))
|
|
554
|
+
: vue.createCommentVNode("", true),
|
|
542
555
|
vue.createElementVNode("ul", {
|
|
543
556
|
ref: $options.listRef,
|
|
544
557
|
id: $data.id + '_list',
|
|
@@ -568,7 +581,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
568
581
|
vue.renderSlot(_ctx.$slots, "item", { item: item }, () => [
|
|
569
582
|
vue.createTextVNode(vue.toDisplayString($options.label(item)), 1)
|
|
570
583
|
])
|
|
571
|
-
], 8,
|
|
584
|
+
], 8, _hoisted_4))
|
|
572
585
|
: vue.createCommentVNode("", true),
|
|
573
586
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(item.items, (child, j) => {
|
|
574
587
|
return (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
|
|
@@ -613,7 +626,12 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
613
626
|
}, null, 8, ["id", "item", "template", "exact", "focusedOptionId", "onItemClick"]))
|
|
614
627
|
], 64))
|
|
615
628
|
}), 128))
|
|
616
|
-
], 40,
|
|
629
|
+
], 40, _hoisted_3),
|
|
630
|
+
(_ctx.$slots.end)
|
|
631
|
+
? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5, [
|
|
632
|
+
vue.renderSlot(_ctx.$slots, "end")
|
|
633
|
+
]))
|
|
634
|
+
: vue.createCommentVNode("", true)
|
|
617
635
|
], 16, _hoisted_1))
|
|
618
636
|
: vue.createCommentVNode("", true)
|
|
619
637
|
]),
|
package/menu/menu.cjs.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("primevue/overlayeventbus"),t=require("primevue/portal"),i=require("primevue/utils"),n=require("primevue/ripple"),s=require("vue");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,template: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}},directives:{ripple:l(n).default}};const d=["id","aria-label","aria-disabled"],c=["href","onClick"],u={class:"p-menuitem-text"},p=["href","target"],m={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.template?(s.openBlock(),s.createBlock(s.resolveDynamicComponent(i.template),{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.item.icon?(s.openBlock(),s.createElementBlock("span",{key:0,class:s.normalizeClass(["p-menuitem-icon",i.item.icon])},null,2)):s.createCommentVNode("",!0),s.createElementVNode("span",u,s.toDisplayString(o.label()),1)],10,c)),[[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.item.icon?(s.openBlock(),s.createElementBlock("span",{key:0,class:s.normalizeClass(["p-menuitem-icon",i.item.icon])},null,2)):s.createCommentVNode("",!0),s.createElementVNode("span",m,s.toDisplayString(o.label()),1)],10,p)),[[r]])],64))])],14,d)):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 b=["id"],f=["id","tabindex","aria-activedescendant","aria-label","aria-labelledby"],k=["id"];!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))}),[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,k)):s.createCommentVNode("",!0),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.items,((r,d)=>(s.openBlock(),s.createElementBlock(s.Fragment,{key:r.label+n+"_"+d},[o.visible(r)&&!r.separator?(s.openBlock(),s.createBlock(a,{key:0,id:l.id+"_"+n+"_"+d,item:r,template:e.$slots.item,exact:i.exact,focusedOptionId:o.focusedOptionId,onItemClick:o.itemClick},null,8,["id","item","template","exact","focusedOptionId","onItemClick"])):o.visible(r)&&r.separator?(s.openBlock(),s.createElementBlock("li",{key:"separator"+n+d,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,template:e.$slots.item,exact:i.exact,focusedOptionId:o.focusedOptionId,onItemClick:o.itemClick},null,8,["id","item","template","exact","focusedOptionId","onItemClick"]))],64)))),128))],40,f)],16,b)):s.createCommentVNode("",!0)])),_:3},8,["onEnter","onLeave","onAfterLeave"])])),_:3},8,["appendTo","disabled"])},module.exports=h;
|
|
1
|
+
"use strict";var e=require("primevue/overlayeventbus"),t=require("primevue/portal"),i=require("primevue/utils"),n=require("primevue/ripple"),s=require("vue");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,template: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}},directives:{ripple:l(n).default}};const d=["id","aria-label","aria-disabled"],c=["href","onClick"],u={class:"p-menuitem-text"},p=["href","target"],m={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.template?(s.openBlock(),s.createBlock(s.resolveDynamicComponent(i.template),{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.item.icon?(s.openBlock(),s.createElementBlock("span",{key:0,class:s.normalizeClass(["p-menuitem-icon",i.item.icon])},null,2)):s.createCommentVNode("",!0),s.createElementVNode("span",u,s.toDisplayString(o.label()),1)],10,c)),[[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.item.icon?(s.openBlock(),s.createElementBlock("span",{key:0,class:s.normalizeClass(["p-menuitem-icon",i.item.icon])},null,2)):s.createCommentVNode("",!0),s.createElementVNode("span",m,s.toDisplayString(o.label()),1)],10,p)),[[r]])],64))])],14,d)):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 b=["id"],f={key:0,class:"p-menu-start"},k=["id","tabindex","aria-activedescendant","aria-label","aria-labelledby"],v=["id"],y={key:1,class:"p-menu-end"};!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",f,[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,d)=>(s.openBlock(),s.createElementBlock(s.Fragment,{key:r.label+n+"_"+d},[o.visible(r)&&!r.separator?(s.openBlock(),s.createBlock(a,{key:0,id:l.id+"_"+n+"_"+d,item:r,template:e.$slots.item,exact:i.exact,focusedOptionId:o.focusedOptionId,onItemClick:o.itemClick},null,8,["id","item","template","exact","focusedOptionId","onItemClick"])):o.visible(r)&&r.separator?(s.openBlock(),s.createElementBlock("li",{key:"separator"+n+d,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,template:e.$slots.item,exact:i.exact,focusedOptionId:o.focusedOptionId,onItemClick:o.itemClick},null,8,["id","item","template","exact","focusedOptionId","onItemClick"]))],64)))),128))],40,k),e.$slots.end?(s.openBlock(),s.createElementBlock("div",y,[s.renderSlot(e.$slots,"end")])):s.createCommentVNode("",!0)],16,b)):s.createCommentVNode("",!0)])),_:3},8,["onEnter","onLeave","onAfterLeave"])])),_:3},8,["appendTo","disabled"])},module.exports=h;
|