primevue
Version:
[](https://opensource.org/licenses/MIT) [](https://badge.fury.io/js/primevue) [ • 23.2 kB
JavaScript
"use strict";var e=require("primevue/basecomponent"),t=require("primevue/utils"),i=require("primevue/icons/angledown"),s=require("primevue/icons/angleright"),n=require("primevue/ripple"),o=require("vue");function m(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=m(e),r=m(i),l=m(s),c=m(n),d={name:"MegaMenuSub",extends:a.default,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},templates:{type:Object,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:(e,i,s)=>e&&e.item?t.ObjectUtils.getItemValue(e.item[i],s):void 0,getItemLabel(e){return this.getItemProp(e,"label")},getPTOptions(e,t){return this.ptm(t,{context:{active:this.isItemActive(e),focused:this.isItemFocused(e)}})},isItemActive(e){return!!t.ObjectUtils.isNotEmpty(this.activeItem)&&this.activeItem.key===e.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:e=>t.ObjectUtils.isNotEmpty(e.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")]},getSeparatorItemClass(e){return["p-menuitem-separator",this.getItemProp(e,"class")]}},components:{AngleRightIcon:l.default,AngleDownIcon:r.default},directives:{ripple:c.default}};const u=["id","aria-label","aria-disabled","aria-expanded","aria-haspopup","aria-level","aria-setsize","aria-posinset"],I=["onClick","onMouseenter"],h=["href","onClick"],p=["href","target"],f=["id"];d.render=function(e,t,i,s,n,m){const a=o.resolveComponent("router-link"),r=o.resolveComponent("MegaMenuSub",!0),l=o.resolveDirective("ripple");return o.openBlock(),o.createElementBlock("ul",o.normalizeProps(o.guardReactiveProps(e.ptm("menu"))),[i.submenu?(o.openBlock(),o.createElementBlock("li",o.mergeProps({key:0,class:m.getSubmenuHeaderClass(i.submenu),style:m.getItemProp(i.submenu,"style"),role:"presentation"},e.ptm("submenuHeader")),o.toDisplayString(m.getItemLabel(i.submenu)),17)):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.items,((s,n)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:m.getItemKey(s)},[m.isItemVisible(s)&&!m.getItemProp(s,"separator")?(o.openBlock(),o.createElementBlock("li",o.mergeProps({key:0,id:m.getItemId(s),style:m.getItemProp(s,"style"),class:m.getItemClass(s),role:"menuitem","aria-label":m.getItemLabel(s),"aria-disabled":m.isItemDisabled(s)||void 0,"aria-expanded":m.isItemGroup(s)?m.isItemActive(s):void 0,"aria-haspopup":m.isItemGroup(s)&&!m.getItemProp(s,"to")?"menu":void 0,"aria-level":i.level+1,"aria-setsize":m.getAriaSetSize(),"aria-posinset":m.getAriaPosInset(n)},m.getPTOptions(s,"menuitem")),[o.createElementVNode("div",o.mergeProps({class:"p-menuitem-content",onClick:e=>m.onItemClick(e,s),onMouseenter:e=>m.onItemMouseEnter(e,s)},m.getPTOptions(s,"content")),[i.templates.item?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(i.templates.item),{key:1,item:s.item},null,8,["item"])):(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[m.getItemProp(s,"to")&&!m.isItemDisabled(s)?(o.openBlock(),o.createBlock(a,{key:0,to:m.getItemProp(s,"to"),custom:""},{default:o.withCtx((({navigate:e,href:t,isActive:n,isExactActive:a})=>[o.withDirectives((o.openBlock(),o.createElementBlock("a",o.mergeProps({href:t,class:m.getItemActionClass(s,{isActive:n,isExactActive:a}),tabindex:"-1","aria-hidden":"true",onClick:t=>m.onItemActionClick(t,e)},m.getPTOptions(s,"action")),[i.templates.itemicon?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(i.templates.itemicon),{key:0,item:s.item,class:o.normalizeClass(m.getItemIconClass(s))},null,8,["item","class"])):m.getItemProp(s,"icon")?(o.openBlock(),o.createElementBlock("span",o.mergeProps({key:1,class:m.getItemIconClass(s)},m.getPTOptions(s,"icon")),null,16)):o.createCommentVNode("",!0),o.createElementVNode("span",o.mergeProps({class:"p-menuitem-text"},m.getPTOptions(s,"label")),o.toDisplayString(m.getItemLabel(s)),17)],16,h)),[[l]])])),_:2},1032,["to"])):o.withDirectives((o.openBlock(),o.createElementBlock("a",o.mergeProps({key:1,href:m.getItemProp(s,"url"),class:m.getItemActionClass(s),target:m.getItemProp(s,"target"),tabindex:"-1","aria-hidden":"true"},m.getPTOptions(s,"action")),[i.templates.itemicon?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(i.templates.itemicon),{key:0,item:s.item,class:o.normalizeClass(m.getItemIconClass(s))},null,8,["item","class"])):m.getItemProp(s,"icon")?(o.openBlock(),o.createElementBlock("span",o.mergeProps({key:1,class:m.getItemIconClass(s)},m.getPTOptions(s,"icon")),null,16)):o.createCommentVNode("",!0),o.createElementVNode("span",o.mergeProps({class:"p-menuitem-text"},m.getPTOptions(s,"label")),o.toDisplayString(m.getItemLabel(s)),17),m.isItemGroup(s)?(o.openBlock(),o.createElementBlock(o.Fragment,{key:2},[i.templates.submenuicon?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(i.templates.submenuicon),o.mergeProps({key:0,active:m.isItemActive(s),class:"p-submenu-icon"},m.getPTOptions(s,"submenuIcon")),null,16,["active"])):(o.openBlock(),o.createBlock(o.resolveDynamicComponent(i.horizontal?"AngleDownIcon":"AngleRightIcon"),o.mergeProps({key:1,class:"p-submenu-icon"},m.getPTOptions(s,"submenuIcon")),null,16))],64)):o.createCommentVNode("",!0)],16,p)),[[l]])],64))],16,I),m.isItemVisible(s)&&m.isItemGroup(s)?(o.openBlock(),o.createElementBlock("div",o.mergeProps({key:0,class:"p-megamenu-panel"},e.ptm("panel")),[o.createElementVNode("div",o.mergeProps({class:"p-megamenu-grid"},e.ptm("grid")),[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(s.items,(n=>(o.openBlock(),o.createElementBlock("div",o.mergeProps({key:m.getItemKey(n),class:m.getColumnClass(s)},e.ptm("column")),[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n,(s=>(o.openBlock(),o.createBlock(r,{key:m.getSubListKey(s),id:m.getSubListId(s),role:"menu",class:"p-submenu-list p-megamenu-submenu",menuId:i.menuId,focusedItemId:i.focusedItemId,submenu:s,items:s.items,templates:i.templates,exact:i.exact,level:i.level+1,pt:e.pt,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","templates","exact","level","pt"])))),128))],16)))),128))],16)],16)):o.createCommentVNode("",!0)],16,u)):o.createCommentVNode("",!0),m.isItemVisible(s)&&m.getItemProp(s,"separator")?(o.openBlock(),o.createElementBlock("li",o.mergeProps({key:1,id:m.getItemId(s),style:m.getItemProp(s,"style"),class:m.getSeparatorItemClass(s),role:"separator"},e.ptm("separator")),null,16,f)):o.createCommentVNode("",!0)],64)))),128))],16)};var g={name:"MegaMenu",extends:a.default,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.UniqueComponentId()},activeItem(e){t.ObjectUtils.isNotEmpty(e)?(this.bindOutsideClickListener(),this.bindResizeListener()):(this.unbindOutsideClickListener(),this.unbindResizeListener())}},mounted(){this.id=this.id||t.UniqueComponentId()},beforeUnmount(){this.unbindOutsideClickListener(),this.unbindResizeListener()},methods:{getItemProp:(e,i)=>e?t.ObjectUtils.getItemValue(e[i]):void 0,getItemLabel(e){return this.getItemProp(e,"label")},isItemDisabled(e){return this.getItemProp(e,"disabled")},isItemGroup(e){return t.ObjectUtils.isNotEmpty(this.getItemProp(e,"items"))},isItemSeparator(e){return this.getItemProp(e,"separator")},getProccessedItemLabel(e){return e?this.getItemLabel(e.item):void 0},isProccessedItemGroup:e=>e&&t.ObjectUtils.isNotEmpty(e.items),hide(e,i){this.activeItem=null,this.focusedItemInfo={index:-1,key:"",parentKey:""},i&&t.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(e){if(this.disabled)return void e.preventDefault();const i=e.metaKey||e.ctrlKey;switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"ArrowLeft":this.onArrowLeftKey(e);break;case"ArrowRight":this.onArrowRightKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"Space":this.onSpaceKey(e);break;case"Enter":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e);break;case"PageDown":case"PageUp":case"Backspace":case"ShiftLeft":case"ShiftRight":break;default:!i&&t.ObjectUtils.isPrintableCharacter(e.key)&&this.searchItems(e,e.key)}},onItemChange(e){const{processedItem:i,isFocus:s}=e;if(t.ObjectUtils.isEmpty(i))return;const{index:n,key:o,parentKey:m,items:a}=i,r=t.ObjectUtils.isNotEmpty(a);r&&(this.activeItem=i),this.focusedItemInfo={index:n,key:o,parentKey:m},r&&(this.dirty=!0),s&&t.DomHandler.focus(this.menubar)},onItemClick(e){const{originalEvent:i,processedItem:s}=e,n=this.isProccessedItemGroup(s),o=t.ObjectUtils.isEmpty(s.parent);if(this.isSelected(s)){const{index:e,key:i,parentKey:n}=s;this.activeItem=null,this.focusedItemInfo={index:e,key:i,parentKey:n},this.dirty=!o,t.DomHandler.focus(this.menubar)}else if(n)this.onItemChange(e);else{const e=o?s:this.activeItem;this.hide(i),this.changeFocusedItemInfo(i,e?e.index:-1),t.DomHandler.focus(this.menubar)}},onItemMouseEnter(e){this.dirty&&this.onItemChange(e)},onArrowDownKey(e){if(this.horizontal)if(t.ObjectUtils.isNotEmpty(this.activeItem)&&this.activeItem.key===this.focusedItemInfo.key)this.focusedItemInfo={index:-1,key:"",parentKey:this.activeItem.key};else{const t=this.findVisibleItem(this.focusedItemInfo.index);this.isProccessedItemGroup(t)&&(this.onItemChange({originalEvent:e,processedItem:t}),this.focusedItemInfo={index:-1,key:t.key,parentKey:t.parentKey},this.searchValue="")}const i=-1!==this.focusedItemInfo.index?this.findNextItemIndex(this.focusedItemInfo.index):this.findFirstFocusedItemIndex();this.changeFocusedItemInfo(e,i),e.preventDefault()},onArrowUpKey(e){if(e.altKey&&this.horizontal){if(-1!==this.focusedItemInfo.index){const i=this.findVisibleItem(this.focusedItemInfo.index);!this.isProccessedItemGroup(i)&&t.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(e,this.findFirstItemIndex()))}e.preventDefault()}else{const t=-1!==this.focusedItemInfo.index?this.findPrevItemIndex(this.focusedItemInfo.index):this.findLastFocusedItemIndex();this.changeFocusedItemInfo(e,t),e.preventDefault()}},onArrowLeftKey(e){const i=this.findVisibleItem(this.focusedItemInfo.index);if(this.isProccessedItemGroup(i)){if(this.horizontal){const t=-1!==this.focusedItemInfo.index?this.findPrevItemIndex(this.focusedItemInfo.index):this.findLastFocusedItemIndex();this.changeFocusedItemInfo(e,t)}}else{this.vertical&&t.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(e,n)}e.preventDefault()},onArrowRightKey(e){const i=this.findVisibleItem(this.focusedItemInfo.index);if(this.isProccessedItemGroup(i)){if(this.vertical)if(t.ObjectUtils.isNotEmpty(this.activeItem)&&this.activeItem.key===i.key)this.focusedItemInfo={index:-1,key:"",parentKey:this.activeItem.key};else{const t=this.findVisibleItem(this.focusedItemInfo.index);this.isProccessedItemGroup(t)&&(this.onItemChange({originalEvent:e,processedItem:t}),this.focusedItemInfo={index:-1,key:t.key,parentKey:t.parentKey},this.searchValue="")}const s=-1!==this.focusedItemInfo.index?this.findNextItemIndex(this.focusedItemInfo.index):this.findFirstFocusedItemIndex();this.changeFocusedItemInfo(e,s)}else{const t=i.columnIndex+1,s=this.visibleItems.findIndex((e=>e.columnIndex===t));-1!==s&&this.changeFocusedItemInfo(e,s)}e.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 i=t.DomHandler.findSingle(this.menubar,`li[id="${this.focusedItemId}"]`),s=i&&t.DomHandler.findSingle(i,".p-menuitem-link");s?s.click():i&&i.click();const n=this.visibleItems[this.focusedItemInfo.index];!this.isProccessedItemGroup(n)&&this.changeFocusedItemInfo(e,this.findFirstFocusedItemIndex())}e.preventDefault()},onSpaceKey(e){this.onEnterKey(e)},onEscapeKey(e){t.ObjectUtils.isNotEmpty(this.activeItem)&&(this.focusedItemInfo={index:this.activeItem.index,key:this.activeItem.key},this.activeItem=null),e.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=>{t.DomHandler.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(e){return!!t.ObjectUtils.isNotEmpty(this.activeItem)&&this.activeItem.key===e.key},findFirstItemIndex(){return this.visibleItems.findIndex((e=>this.isValidItem(e)))},findLastItemIndex(){return t.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(e){const i=e>0?t.ObjectUtils.findLastIndex(this.visibleItems.slice(0,e),(e=>this.isValidItem(e))):-1;return i>-1?i:e},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(e){return t.ObjectUtils.isNotEmpty(this.visibleItems)?this.visibleItems[e]: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(e,i){const s=this.findVisibleItem(i);this.focusedItemInfo.index=i,this.focusedItemInfo.key=t.ObjectUtils.isNotEmpty(s)?s.key:"",this.scrollInView()},scrollInView(e=-1){const i=-1!==e?`${this.id}_${e}`:this.focusedItemId,s=t.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,m)=>{const a=(""!==s?s+"_":"")+(void 0!==n?n+"_":"")+m,r={item:e,index:m,level:t,key:a,parent:i,parentKey:s,columnIndex:void 0!==n?n:void 0!==i.columnIndex?i.columnIndex:m};r.items=0===t&&e.items&&e.items.length>0?e.items.map(((e,i)=>this.createProcessedItems(e,t+1,r,a,i))):this.createProcessedItems(e.items,t+1,r,a),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 e=t.ObjectUtils.isNotEmpty(this.activeItem)?this.activeItem:null;return e&&e.key===this.focusedItemInfo.parentKey?e.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 t.ObjectUtils.isNotEmpty(this.focusedItemInfo.key)?`${this.id}_${this.focusedItemInfo.key}`:null}},components:{MegaMenuSub:d}};const b=["id"];!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"),g.render=function(e,t,i,s,n,m){const a=o.resolveComponent("MegaMenuSub");return o.openBlock(),o.createElementBlock("div",o.mergeProps({ref:m.containerRef,id:n.id,class:m.containerClass},e.ptm("root")),[e.$slots.start?(o.openBlock(),o.createElementBlock("div",o.mergeProps({key:0,class:"p-megamenu-start"},e.ptm("start")),[o.renderSlot(e.$slots,"start")],16)):o.createCommentVNode("",!0),o.createVNode(a,{ref:m.menubarRef,id:n.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":n.focused?m.focusedItemId:void 0,menuId:n.id,focusedItemId:n.focused?m.focusedItemId:void 0,items:m.processedItems,horizontal:m.horizontal,templates:e.$slots,activeItem:n.activeItem,exact:i.exact,level:0,pt:e.pt,onFocus:m.onFocus,onBlur:m.onBlur,onKeydown:m.onKeyDown,onItemClick:m.onItemClick,onItemMouseenter:m.onItemMouseEnter},null,8,["id","tabindex","aria-label","aria-labelledby","aria-disabled","aria-orientation","aria-activedescendant","menuId","focusedItemId","items","horizontal","templates","activeItem","exact","pt","onFocus","onBlur","onKeydown","onItemClick","onItemMouseenter"]),e.$slots.end?(o.openBlock(),o.createElementBlock("div",o.mergeProps({key:1,class:"p-megamenu-end"},e.ptm("end")),[o.renderSlot(e.$slots,"end")],16)):o.createCommentVNode("",!0)],16,b)},module.exports=g;