UNPKG

primevue

Version:

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![npm version](https://badge.fury.io/js/primevue.svg)](https://badge.fury.io/js/primevue) [![Discord Chat](https://img.shields.io/discord/55794023

2 lines (1 loc) 21.5 kB
import e from"primevue/basecomponent";import{ObjectUtils as t,UniqueComponentId as i,DomHandler as s}from"primevue/utils";import n from"primevue/icons/angledown";import o from"primevue/icons/angleright";import m from"primevue/ripple";import{resolveComponent as a,resolveDirective as r,openBlock as l,createElementBlock as d,normalizeProps as c,guardReactiveProps as u,mergeProps as I,toDisplayString as h,createCommentVNode as p,Fragment as f,renderList as g,createElementVNode as y,createBlock as b,withCtx as v,withDirectives as x,resolveDynamicComponent as k,normalizeClass as P,renderSlot as L,createVNode as C}from"vue";var K={name:"MegaMenuSub",extends:e,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.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.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.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:o,AngleDownIcon:n},directives:{ripple:m}};const E=["id","aria-label","aria-disabled","aria-expanded","aria-haspopup","aria-level","aria-setsize","aria-posinset"],w=["onClick","onMouseenter"],S=["href","onClick"],F=["href","target"],A=["id"];K.render=function(e,t,i,s,n,o){const m=a("router-link"),L=a("MegaMenuSub",!0),C=r("ripple");return l(),d("ul",c(u(e.ptm("menu"))),[i.submenu?(l(),d("li",I({key:0,class:o.getSubmenuHeaderClass(i.submenu),style:o.getItemProp(i.submenu,"style"),role:"presentation"},e.ptm("submenuHeader")),h(o.getItemLabel(i.submenu)),17)):p("",!0),(l(!0),d(f,null,g(i.items,((s,n)=>(l(),d(f,{key:o.getItemKey(s)},[o.isItemVisible(s)&&!o.getItemProp(s,"separator")?(l(),d("li",I({key:0,id:o.getItemId(s),style:o.getItemProp(s,"style"),class:o.getItemClass(s),role:"menuitem","aria-label":o.getItemLabel(s),"aria-disabled":o.isItemDisabled(s)||void 0,"aria-expanded":o.isItemGroup(s)?o.isItemActive(s):void 0,"aria-haspopup":o.isItemGroup(s)&&!o.getItemProp(s,"to")?"menu":void 0,"aria-level":i.level+1,"aria-setsize":o.getAriaSetSize(),"aria-posinset":o.getAriaPosInset(n)},o.getPTOptions(s,"menuitem")),[y("div",I({class:"p-menuitem-content",onClick:e=>o.onItemClick(e,s),onMouseenter:e=>o.onItemMouseEnter(e,s)},o.getPTOptions(s,"content")),[i.templates.item?(l(),b(k(i.templates.item),{key:1,item:s.item},null,8,["item"])):(l(),d(f,{key:0},[o.getItemProp(s,"to")&&!o.isItemDisabled(s)?(l(),b(m,{key:0,to:o.getItemProp(s,"to"),custom:""},{default:v((({navigate:e,href:t,isActive:n,isExactActive:m})=>[x((l(),d("a",I({href:t,class:o.getItemActionClass(s,{isActive:n,isExactActive:m}),tabindex:"-1","aria-hidden":"true",onClick:t=>o.onItemActionClick(t,e)},o.getPTOptions(s,"action")),[i.templates.itemicon?(l(),b(k(i.templates.itemicon),{key:0,item:s.item,class:P(o.getItemIconClass(s))},null,8,["item","class"])):o.getItemProp(s,"icon")?(l(),d("span",I({key:1,class:o.getItemIconClass(s)},o.getPTOptions(s,"icon")),null,16)):p("",!0),y("span",I({class:"p-menuitem-text"},o.getPTOptions(s,"label")),h(o.getItemLabel(s)),17)],16,S)),[[C]])])),_:2},1032,["to"])):x((l(),d("a",I({key:1,href:o.getItemProp(s,"url"),class:o.getItemActionClass(s),target:o.getItemProp(s,"target"),tabindex:"-1","aria-hidden":"true"},o.getPTOptions(s,"action")),[i.templates.itemicon?(l(),b(k(i.templates.itemicon),{key:0,item:s.item,class:P(o.getItemIconClass(s))},null,8,["item","class"])):o.getItemProp(s,"icon")?(l(),d("span",I({key:1,class:o.getItemIconClass(s)},o.getPTOptions(s,"icon")),null,16)):p("",!0),y("span",I({class:"p-menuitem-text"},o.getPTOptions(s,"label")),h(o.getItemLabel(s)),17),o.isItemGroup(s)?(l(),d(f,{key:2},[i.templates.submenuicon?(l(),b(k(i.templates.submenuicon),I({key:0,active:o.isItemActive(s),class:"p-submenu-icon"},o.getPTOptions(s,"submenuIcon")),null,16,["active"])):(l(),b(k(i.horizontal?"AngleDownIcon":"AngleRightIcon"),I({key:1,class:"p-submenu-icon"},o.getPTOptions(s,"submenuIcon")),null,16))],64)):p("",!0)],16,F)),[[C]])],64))],16,w),o.isItemVisible(s)&&o.isItemGroup(s)?(l(),d("div",I({key:0,class:"p-megamenu-panel"},e.ptm("panel")),[y("div",I({class:"p-megamenu-grid"},e.ptm("grid")),[(l(!0),d(f,null,g(s.items,(n=>(l(),d("div",I({key:o.getItemKey(n),class:o.getColumnClass(s)},e.ptm("column")),[(l(!0),d(f,null,g(n,(s=>(l(),b(L,{key:o.getSubListKey(s),id:o.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)):p("",!0)],16,E)):p("",!0),o.isItemVisible(s)&&o.getItemProp(s,"separator")?(l(),d("li",I({key:1,id:o.getItemId(s),style:o.getItemProp(s,"style"),class:o.getSeparatorItemClass(s),role:"separator"},e.ptm("separator")),null,16,A)):p("",!0)],64)))),128))],16)};var V={name:"MegaMenu",extends:e,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||i()},activeItem(e){t.isNotEmpty(e)?(this.bindOutsideClickListener(),this.bindResizeListener()):(this.unbindOutsideClickListener(),this.unbindResizeListener())}},mounted(){this.id=this.id||i()},beforeUnmount(){this.unbindOutsideClickListener(),this.unbindResizeListener()},methods:{getItemProp:(e,i)=>e?t.getItemValue(e[i]):void 0,getItemLabel(e){return this.getItemProp(e,"label")},isItemDisabled(e){return this.getItemProp(e,"disabled")},isItemGroup(e){return t.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.isNotEmpty(e.items),hide(e,t){this.activeItem=null,this.focusedItemInfo={index:-1,key:"",parentKey:""},t&&s.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.isPrintableCharacter(e.key)&&this.searchItems(e,e.key)}},onItemChange(e){const{processedItem:i,isFocus:n}=e;if(t.isEmpty(i))return;const{index:o,key:m,parentKey:a,items:r}=i,l=t.isNotEmpty(r);l&&(this.activeItem=i),this.focusedItemInfo={index:o,key:m,parentKey:a},l&&(this.dirty=!0),n&&s.focus(this.menubar)},onItemClick(e){const{originalEvent:i,processedItem:n}=e,o=this.isProccessedItemGroup(n),m=t.isEmpty(n.parent);if(this.isSelected(n)){const{index:e,key:t,parentKey:i}=n;this.activeItem=null,this.focusedItemInfo={index:e,key:t,parentKey:i},this.dirty=!m,s.focus(this.menubar)}else if(o)this.onItemChange(e);else{const e=m?n:this.activeItem;this.hide(i),this.changeFocusedItemInfo(i,e?e.index:-1),s.focus(this.menubar)}},onItemMouseEnter(e){this.dirty&&this.onItemChange(e)},onArrowDownKey(e){if(this.horizontal)if(t.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.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.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.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 t=s.findSingle(this.menubar,`li[id="${this.focusedItemId}"]`),i=t&&s.findSingle(t,".p-menuitem-link");i?i.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(e){t.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=>{s.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.isNotEmpty(this.activeItem)&&this.activeItem.key===e.key},findFirstItemIndex(){return this.visibleItems.findIndex((e=>this.isValidItem(e)))},findLastItemIndex(){return t.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.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.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.isNotEmpty(s)?s.key:"",this.scrollInView()},scrollInView(e=-1){const t=-1!==e?`${this.id}_${e}`:this.focusedItemId,i=s.findSingle(this.menubar,`li[id="${t}"]`);i&&i.scrollIntoView&&i.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.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.isNotEmpty(this.focusedItemInfo.key)?`${this.id}_${this.focusedItemInfo.key}`:null}},components:{MegaMenuSub:K}};const z=["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"),V.render=function(e,t,i,s,n,o){const m=a("MegaMenuSub");return l(),d("div",I({ref:o.containerRef,id:n.id,class:o.containerClass},e.ptm("root")),[e.$slots.start?(l(),d("div",I({key:0,class:"p-megamenu-start"},e.ptm("start")),[L(e.$slots,"start")],16)):p("",!0),C(m,{ref:o.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?o.focusedItemId:void 0,menuId:n.id,focusedItemId:n.focused?o.focusedItemId:void 0,items:o.processedItems,horizontal:o.horizontal,templates:e.$slots,activeItem:n.activeItem,exact:i.exact,level:0,pt:e.pt,onFocus:o.onFocus,onBlur:o.onBlur,onKeydown:o.onKeyDown,onItemClick:o.onItemClick,onItemMouseenter:o.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?(l(),d("div",I({key:1,class:"p-megamenu-end"},e.ptm("end")),[L(e.$slots,"end")],16)):p("",!0)],16,z)};export{V as default};