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) 22.8 kB
this.primevue=this.primevue||{},this.primevue.megamenu=function(e,t,i,n,s,o,r){"use strict";function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=c(t),m=c(i),l=c(n),u={name:"BaseMegaMenu",extends:a.default,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}},style:m.default,provide:function(){return{$parentInstance:this}}},d={name:"MegaMenuSub",hostName:"MegaMenu",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},tabindex:{type:Number,default:0}},methods:{getSubListId:function(e){return"".concat(this.getItemId(e),"_list")},getSubListKey:function(e){return this.getSubListId(e)},getItemId:function(e){return"".concat(this.menuId,"_").concat(e.key)},getItemKey:function(e){return this.getItemId(e)},getItemProp:function(t,i,n){return t&&t.item?e.ObjectUtils.getItemValue(t.item[i],n):void 0},getItemLabel:function(e){return this.getItemProp(e,"label")},getPTOptions:function(e,t,i){return this.ptm(i,{context:{item:e,index:t,active:this.isItemActive(e),focused:this.isItemFocused(e)}})},isItemActive:function(t){return!!e.ObjectUtils.isNotEmpty(this.activeItem)&&this.activeItem.key===t.key},isItemVisible:function(e){return!1!==this.getItemProp(e,"visible")},isItemDisabled:function(e){return this.getItemProp(e,"disabled")},isItemFocused:function(e){return this.focusedItemId===this.getItemId(e)},isItemGroup:function(t){return e.ObjectUtils.isNotEmpty(t.items)},onItemClick:function(e,t){this.getItemProp(t,"command",{originalEvent:e,item:t.item}),this.$emit("item-click",{originalEvent:e,processedItem:t,isFocus:!0})},onItemMouseEnter:function(e,t){this.$emit("item-mouseenter",{originalEvent:e,processedItem:t})},onItemActionClick:function(e,t){t&&t(e)},getAriaSetSize:function(){var e=this;return this.items.filter((function(t){return e.isItemVisible(t)&&!e.getItemProp(t,"separator")})).length},getAriaPosInset:function(e){var t=this;return e-this.items.slice(0,e).filter((function(e){return t.isItemVisible(e)&&t.getItemProp(e,"separator")})).length+1},getMenuItemProps:function(e,t){return{action:r.mergeProps({class:this.cx("action"),tabindex:-1,"aria-hidden":!0},this.getPTOptions(e,t,"action")),icon:r.mergeProps({class:[this.cx("icon"),this.getItemProp(e,"icon")]},this.getPTOptions(e,t,"icon")),label:r.mergeProps({class:this.cx("label")},this.getPTOptions(e,t,"label")),submenuicon:r.mergeProps({class:this.cx("submenuIcon")},this.getPTOptions(e,t,"submenuIcon"))}}},components:{AngleRightIcon:c(s).default,AngleDownIcon:l.default},directives:{ripple:c(o).default}},I=["tabindex"],h=["id","aria-label","aria-disabled","aria-expanded","aria-haspopup","aria-level","aria-setsize","aria-posinset","data-p-highlight","data-p-focused","data-p-disabled"],f=["onClick","onMouseenter"],p=["href","onClick"],v=["href","target"],b=["id"];d.render=function(e,t,i,n,s,o){var c=r.resolveComponent("router-link"),a=r.resolveComponent("MegaMenuSub",!0),m=r.resolveDirective("ripple");return r.openBlock(),r.createElementBlock("ul",r.mergeProps({class:e.cx(0===i.level?"menu":"submenu"),tabindex:i.tabindex},e.ptm(0===i.level?"menu":"submenu")),[i.submenu?(r.openBlock(),r.createElementBlock("li",r.mergeProps({key:0,class:[e.cx("submenuHeader",{submenu:i.submenu}),o.getItemProp(i.submenu,"class")],style:o.getItemProp(i.submenu,"style"),role:"presentation"},e.ptm("submenuHeader")),r.toDisplayString(o.getItemLabel(i.submenu)),17)):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.items,(function(n,s){return r.openBlock(),r.createElementBlock(r.Fragment,{key:o.getItemKey(n)},[o.isItemVisible(n)&&!o.getItemProp(n,"separator")?(r.openBlock(),r.createElementBlock("li",r.mergeProps({key:0,id:o.getItemId(n),style:o.getItemProp(n,"style"),class:[e.cx("menuitem",{processedItem:n}),o.getItemProp(n,"class")],role:"menuitem","aria-label":o.getItemLabel(n),"aria-disabled":o.isItemDisabled(n)||void 0,"aria-expanded":o.isItemGroup(n)?o.isItemActive(n):void 0,"aria-haspopup":o.isItemGroup(n)&&!o.getItemProp(n,"to")?"menu":void 0,"aria-level":i.level+1,"aria-setsize":o.getAriaSetSize(),"aria-posinset":o.getAriaPosInset(s)},o.getPTOptions(n,s,"menuitem"),{"data-p-highlight":o.isItemActive(n),"data-p-focused":o.isItemFocused(n),"data-p-disabled":o.isItemDisabled(n)}),[r.createElementVNode("div",r.mergeProps({class:e.cx("content"),onClick:function(e){return o.onItemClick(e,n)},onMouseenter:function(e){return o.onItemMouseEnter(e,n)}},o.getPTOptions(n,s,"content")),[i.templates.item?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(i.templates.item),{key:1,item:n.item,hasSubmenu:o.isItemGroup(n),label:o.getItemLabel(n),props:o.getMenuItemProps(n,s)},null,8,["item","hasSubmenu","label","props"])):(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[o.getItemProp(n,"to")&&!o.isItemDisabled(n)?(r.openBlock(),r.createBlock(c,{key:0,to:o.getItemProp(n,"to"),custom:""},{default:r.withCtx((function(t){var c=t.navigate,a=t.href,l=t.isActive,u=t.isExactActive;return[r.withDirectives((r.openBlock(),r.createElementBlock("a",r.mergeProps({href:a,class:e.cx("action",{isActive:l,isExactActive:u}),tabindex:"-1","aria-hidden":"true",onClick:function(e){return o.onItemActionClick(e,c)}},o.getPTOptions(n,s,"action")),[i.templates.itemicon?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(i.templates.itemicon),{key:0,item:n.item,class:r.normalizeClass([e.cx("icon"),o.getItemProp(n,"icon")])},null,8,["item","class"])):o.getItemProp(n,"icon")?(r.openBlock(),r.createElementBlock("span",r.mergeProps({key:1,class:[e.cx("icon"),o.getItemProp(n,"icon")]},o.getPTOptions(n,s,"icon")),null,16)):r.createCommentVNode("",!0),r.createElementVNode("span",r.mergeProps({class:e.cx("label")},o.getPTOptions(n,s,"label")),r.toDisplayString(o.getItemLabel(n)),17)],16,p)),[[m]])]})),_:2},1032,["to"])):r.withDirectives((r.openBlock(),r.createElementBlock("a",r.mergeProps({key:1,href:o.getItemProp(n,"url"),class:e.cx("action"),target:o.getItemProp(n,"target"),tabindex:"-1","aria-hidden":"true"},o.getPTOptions(n,s,"action")),[i.templates.itemicon?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(i.templates.itemicon),{key:0,item:n.item,class:r.normalizeClass([e.cx("icon"),o.getItemProp(n,"icon")])},null,8,["item","class"])):o.getItemProp(n,"icon")?(r.openBlock(),r.createElementBlock("span",r.mergeProps({key:1,class:[e.cx("icon"),o.getItemProp(n,"icon")]},o.getPTOptions(n,s,"icon")),null,16)):r.createCommentVNode("",!0),r.createElementVNode("span",r.mergeProps({class:e.cx("label")},o.getPTOptions(n,s,"label")),r.toDisplayString(o.getItemLabel(n)),17),o.isItemGroup(n)?(r.openBlock(),r.createElementBlock(r.Fragment,{key:2},[i.templates.submenuicon?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(i.templates.submenuicon),r.mergeProps({key:0,active:o.isItemActive(n),class:e.cx("submenuIcon")},o.getPTOptions(n,s,"submenuIcon")),null,16,["active","class"])):(r.openBlock(),r.createBlock(r.resolveDynamicComponent(i.horizontal?"AngleDownIcon":"AngleRightIcon"),r.mergeProps({key:1,class:e.cx("submenuIcon")},o.getPTOptions(n,s,"submenuIcon")),null,16,["class"]))],64)):r.createCommentVNode("",!0)],16,v)),[[m]])],64))],16,f),o.isItemVisible(n)&&o.isItemGroup(n)?(r.openBlock(),r.createElementBlock("div",r.mergeProps({key:0,class:e.cx("panel")},e.ptm("panel")),[r.createElementVNode("div",r.mergeProps({class:e.cx("grid")},e.ptm("grid")),[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.items,(function(s){return r.openBlock(),r.createElementBlock("div",r.mergeProps({key:o.getItemKey(s),class:e.cx("column",{processedItem:n})},e.ptm("column")),[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s,(function(s){return r.openBlock(),r.createBlock(a,{key:o.getSubListKey(s),id:o.getSubListId(s),style:r.normalizeStyle(e.sx("submenu",!0,{processedItem:n})),role:"menu",menuId:i.menuId,focusedItemId:i.focusedItemId,submenu:s,items:s.items,templates:i.templates,exact:i.exact,level:i.level+1,pt:e.pt,unstyled:e.unstyled,onItemClick:t[0]||(t[0]=function(t){return e.$emit("item-click",t)}),onItemMouseenter:t[1]||(t[1]=function(t){return e.$emit("item-mouseenter",t)})},null,8,["id","style","menuId","focusedItemId","submenu","items","templates","exact","level","pt","unstyled"])})),128))],16)})),128))],16)],16)):r.createCommentVNode("",!0)],16,h)):r.createCommentVNode("",!0),o.isItemVisible(n)&&o.getItemProp(n,"separator")?(r.openBlock(),r.createElementBlock("li",r.mergeProps({key:1,id:o.getItemId(n),class:[e.cx("separator"),o.getItemProp(n,"class")],style:o.getItemProp(n,"style"),role:"separator"},e.ptm("separator")),null,16,b)):r.createCommentVNode("",!0)],64)})),128))],16,I)};var g={name:"MegaMenu",extends:u,emits:["focus","blur"],outsideClickListener:null,resizeListener:null,container:null,menubar:null,searchTimeout:null,searchValue:null,data:function(){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:function(t){e.ObjectUtils.isNotEmpty(t)?(this.bindOutsideClickListener(),this.bindResizeListener()):(this.unbindOutsideClickListener(),this.unbindResizeListener())}},beforeMount:function(){this.$slots.item||console.warn("In future versions, vue-router support will be removed. Item templating should be used.")},mounted:function(){this.id=this.id||e.UniqueComponentId()},beforeUnmount:function(){this.unbindOutsideClickListener(),this.unbindResizeListener()},methods:{getItemProp:function(t,i){return t?e.ObjectUtils.getItemValue(t[i]):void 0},getItemLabel:function(e){return this.getItemProp(e,"label")},isItemDisabled:function(e){return this.getItemProp(e,"disabled")},isItemGroup:function(t){return e.ObjectUtils.isNotEmpty(this.getItemProp(t,"items"))},isItemSeparator:function(e){return this.getItemProp(e,"separator")},getProccessedItemLabel:function(e){return e?this.getItemLabel(e.item):void 0},isProccessedItemGroup:function(t){return t&&e.ObjectUtils.isNotEmpty(t.items)},hide:function(t,i){this.activeItem=null,this.focusedItemInfo={index:-1,key:"",parentKey:""},i&&e.DomHandler.focus(this.menubar),this.dirty=!1},onFocus:function(e){if(this.focused=!0,-1===this.focusedItemInfo.index){var t=this.findFirstFocusedItemIndex(),i=this.findVisibleItem(t);this.focusedItemInfo={index:t,key:i.key,parentKey:i.parentKey}}this.$emit("focus",e)},onBlur:function(e){this.focused=!1,this.focusedItemInfo={index:-1,key:"",parentKey:""},this.searchValue="",this.dirty=!1,this.$emit("blur",e)},onKeyDown:function(t){if(this.disabled)t.preventDefault();else{var 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:function(t){var i=t.processedItem,n=t.isFocus;if(!e.ObjectUtils.isEmpty(i)){var s=i.index,o=i.key,r=i.parentKey,c=e.ObjectUtils.isNotEmpty(i.items);c&&(this.activeItem=i),this.focusedItemInfo={index:s,key:o,parentKey:r},c&&(this.dirty=!0),n&&e.DomHandler.focus(this.menubar)}},onItemClick:function(t){var i=t.originalEvent,n=t.processedItem,s=this.isProccessedItemGroup(n),o=e.ObjectUtils.isEmpty(n.parent);if(this.isSelected(n)){var r=n.index,c=n.key,a=n.parentKey;this.activeItem=null,this.focusedItemInfo={index:r,key:c,parentKey:a},this.dirty=!o,e.DomHandler.focus(this.menubar)}else if(s)this.onItemChange(t);else{var m=o?n:this.activeItem;this.hide(i),this.changeFocusedItemInfo(i,m?m.index:-1),e.DomHandler.focus(this.menubar)}},onItemMouseEnter:function(e){this.dirty&&this.onItemChange(e)},onArrowDownKey:function(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{var i=this.findVisibleItem(this.focusedItemInfo.index);this.isProccessedItemGroup(i)&&(this.onItemChange({originalEvent:t,processedItem:i}),this.focusedItemInfo={index:-1,key:i.key,parentKey:i.parentKey},this.searchValue="")}var n=-1!==this.focusedItemInfo.index?this.findNextItemIndex(this.focusedItemInfo.index):this.findFirstFocusedItemIndex();this.changeFocusedItemInfo(t,n),t.preventDefault()},onArrowUpKey:function(t){if(t.altKey&&this.horizontal){if(-1!==this.focusedItemInfo.index){var 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{var n=-1!==this.focusedItemInfo.index?this.findPrevItemIndex(this.focusedItemInfo.index):this.findLastFocusedItemIndex();this.changeFocusedItemInfo(t,n),t.preventDefault()}},onArrowLeftKey:function(t){var i=this.findVisibleItem(this.focusedItemInfo.index);if(this.isProccessedItemGroup(i)){if(this.horizontal){var n=-1!==this.focusedItemInfo.index?this.findPrevItemIndex(this.focusedItemInfo.index):this.findLastFocusedItemIndex();this.changeFocusedItemInfo(t,n)}}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);var s=i.columnIndex-1,o=this.visibleItems.findIndex((function(e){return e.columnIndex===s}));-1!==o&&this.changeFocusedItemInfo(t,o)}t.preventDefault()},onArrowRightKey:function(t){var 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{var n=this.findVisibleItem(this.focusedItemInfo.index);this.isProccessedItemGroup(n)&&(this.onItemChange({originalEvent:t,processedItem:n}),this.focusedItemInfo={index:-1,key:n.key,parentKey:n.parentKey},this.searchValue="")}var s=-1!==this.focusedItemInfo.index?this.findNextItemIndex(this.focusedItemInfo.index):this.findFirstFocusedItemIndex();this.changeFocusedItemInfo(t,s)}else{var o=i.columnIndex+1,r=this.visibleItems.findIndex((function(e){return e.columnIndex===o}));-1!==r&&this.changeFocusedItemInfo(t,r)}t.preventDefault()},onHomeKey:function(e){this.changeFocusedItemInfo(e,this.findFirstItemIndex()),e.preventDefault()},onEndKey:function(e){this.changeFocusedItemInfo(e,this.findLastItemIndex()),e.preventDefault()},onEnterKey:function(t){if(-1!==this.focusedItemInfo.index){var i=e.DomHandler.findSingle(this.menubar,'li[id="'.concat("".concat(this.focusedItemId),'"]')),n=i&&e.DomHandler.findSingle(i,'a[data-pc-section="action"]');n?n.click():i&&i.click(),!this.isProccessedItemGroup(this.visibleItems[this.focusedItemInfo.index])&&this.changeFocusedItemInfo(t,this.findFirstFocusedItemIndex())}t.preventDefault()},onSpaceKey:function(e){this.onEnterKey(e)},onEscapeKey:function(t){e.ObjectUtils.isNotEmpty(this.activeItem)&&(this.focusedItemInfo={index:this.activeItem.index,key:this.activeItem.key},this.activeItem=null),t.preventDefault()},onTabKey:function(e){if(-1!==this.focusedItemInfo.index){var t=this.findVisibleItem(this.focusedItemInfo.index);!this.isProccessedItemGroup(t)&&this.onItemChange({originalEvent:e,processedItem:t})}this.hide()},bindOutsideClickListener:function(){var e=this;this.outsideClickListener||(this.outsideClickListener=function(t){var i=e.container&&!e.container.contains(t.target),n=!e.popup||!(e.target&&(e.target===t.target||e.target.contains(t.target)));i&&n&&e.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener:function(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindResizeListener:function(){var t=this;this.resizeListener||(this.resizeListener=function(i){e.DomHandler.isTouchDevice()||t.hide(i,!0)},window.addEventListener("resize",this.resizeListener))},unbindResizeListener:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},isItemMatched:function(e){return this.isValidItem(e)&&this.getProccessedItemLabel(e).toLocaleLowerCase().startsWith(this.searchValue.toLocaleLowerCase())},isValidItem:function(e){return!!e&&!this.isItemDisabled(e.item)&&!this.isItemSeparator(e.item)},isValidSelectedItem:function(e){return this.isValidItem(e)&&this.isSelected(e)},isSelected:function(t){return!!e.ObjectUtils.isNotEmpty(this.activeItem)&&this.activeItem.key===t.key},findFirstItemIndex:function(){var e=this;return this.visibleItems.findIndex((function(t){return e.isValidItem(t)}))},findLastItemIndex:function(){var t=this;return e.ObjectUtils.findLastIndex(this.visibleItems,(function(e){return t.isValidItem(e)}))},findNextItemIndex:function(e){var t=this,i=e<this.visibleItems.length-1?this.visibleItems.slice(e+1).findIndex((function(e){return t.isValidItem(e)})):-1;return i>-1?i+e+1:e},findPrevItemIndex:function(t){var i=this,n=t>0?e.ObjectUtils.findLastIndex(this.visibleItems.slice(0,t),(function(e){return i.isValidItem(e)})):-1;return n>-1?n:t},findSelectedItemIndex:function(){var e=this;return this.visibleItems.findIndex((function(t){return e.isValidSelectedItem(t)}))},findFirstFocusedItemIndex:function(){var e=this.findSelectedItemIndex();return e<0?this.findFirstItemIndex():e},findLastFocusedItemIndex:function(){var e=this.findSelectedItemIndex();return e<0?this.findLastItemIndex():e},findVisibleItem:function(t){return e.ObjectUtils.isNotEmpty(this.visibleItems)?this.visibleItems[t]:null},searchItems:function(e,t){var i=this;this.searchValue=(this.searchValue||"")+t;var n=-1,s=!1;return-1!==(n=-1!==this.focusedItemInfo.index?-1===(n=this.visibleItems.slice(this.focusedItemInfo.index).findIndex((function(e){return i.isItemMatched(e)})))?this.visibleItems.slice(0,this.focusedItemInfo.index).findIndex((function(e){return i.isItemMatched(e)})):n+this.focusedItemInfo.index:this.visibleItems.findIndex((function(e){return i.isItemMatched(e)})))&&(s=!0),-1===n&&-1===this.focusedItemInfo.index&&(n=this.findFirstFocusedItemIndex()),-1!==n&&this.changeFocusedItemInfo(e,n),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((function(){i.searchValue="",i.searchTimeout=null}),500),s},changeFocusedItemInfo:function(t,i){var n=this.findVisibleItem(i);this.focusedItemInfo.index=i,this.focusedItemInfo.key=e.ObjectUtils.isNotEmpty(n)?n.key:"",this.scrollInView()},scrollInView:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,i=-1!==t?"".concat(this.id,"_").concat(t):this.focusedItemId,n=e.DomHandler.findSingle(this.menubar,'li[id="'.concat(i,'"]'));n&&n.scrollIntoView&&n.scrollIntoView({block:"nearest",inline:"start"})},createProcessedItems:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",o=arguments.length>4?arguments[4]:void 0,r=[];return e&&e.forEach((function(e,c){var a=(""!==s?s+"_":"")+(void 0!==o?o+"_":"")+c,m={item:e,index:c,level:i,key:a,parent:n,parentKey:s,columnIndex:void 0!==o?o:void 0!==n.columnIndex?n.columnIndex:c};m.items=0===i&&e.items&&e.items.length>0?e.items.map((function(e,n){return t.createProcessedItems(e,i+1,m,a,n)})):t.createProcessedItems(e.items,i+1,m,a),r.push(m)})),r},containerRef:function(e){this.container=e},menubarRef:function(e){this.menubar=e?e.$el:void 0}},computed:{processedItems:function(){return this.createProcessedItems(this.model||[])},visibleItems:function(){var t=e.ObjectUtils.isNotEmpty(this.activeItem)?this.activeItem:null;return t&&t.key===this.focusedItemInfo.parentKey?t.items.reduce((function(e,t){return t.forEach((function(t){t.items.forEach((function(t){e.push(t)}))})),e}),[]):this.processedItems},horizontal:function(){return"horizontal"===this.orientation},vertical:function(){return"vertical"===this.orientation},focusedItemId:function(){return e.ObjectUtils.isNotEmpty(this.focusedItemInfo.key)?"".concat(this.id,"_").concat(this.focusedItemInfo.key):null}},components:{MegaMenuSub:d}},y=["id"];return g.render=function(e,t,i,n,s,o){var c=r.resolveComponent("MegaMenuSub");return r.openBlock(),r.createElementBlock("div",r.mergeProps({ref:o.containerRef,id:s.id,class:e.cx("root")},e.ptm("root"),{"data-pc-name":"megamenu"}),[e.$slots.start?(r.openBlock(),r.createElementBlock("div",r.mergeProps({key:0,class:e.cx("start")},e.ptm("start")),[r.renderSlot(e.$slots,"start")],16)):r.createCommentVNode("",!0),r.createVNode(c,{ref:o.menubarRef,id:s.id+"_list",tabindex:e.disabled?-1:e.tabindex,role:"menubar","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-disabled":e.disabled||void 0,"aria-orientation":e.orientation,"aria-activedescendant":s.focused?o.focusedItemId:void 0,menuId:s.id,focusedItemId:s.focused?o.focusedItemId:void 0,items:o.processedItems,horizontal:o.horizontal,templates:e.$slots,activeItem:s.activeItem,exact:e.exact,level:0,pt:e.pt,unstyled:e.unstyled,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","unstyled","onFocus","onBlur","onKeydown","onItemClick","onItemMouseenter"]),e.$slots.end?(r.openBlock(),r.createElementBlock("div",r.mergeProps({key:1,class:e.cx("end")},e.ptm("end")),[r.renderSlot(e.$slots,"end")],16)):r.createCommentVNode("",!0)],16,y)},g}(primevue.utils,primevue.basecomponent,primevue.megamenu.style,primevue.icons.angledown,primevue.icons.angleright,primevue.ripple,Vue);