(window.webpackJsonp=window.webpackJsonp||[]).push([[159],{870:function(e,t,n){"use strict";n.r(t);n(40);var o={props:{items:{type:Array,default:function(){return[]}}},data:function(){return{clickOutsideObj:{handler:this.clickedOutside,events:["mousedown"],isActive:!0},submenuWidth:144,menuWidth:144,mouseoverItemIndex:null,isOverSubItemMenu:!1,openSubMenuLeft:!1}},computed:{submenuLeftPos:function(){return this.openSubMenuLeft?-this.submenuWidth:this.menuWidth-1.5}},methods:{mouseoverSubItemMenu:function(e){this.isOverSubItemMenu=!0},mouseleaveSubItemMenu:function(e){var t=this;setTimeout((function(){t.isOverSubItemMenu&&t.mouseoverItemIndex===e&&(t.mouseoverItemIndex=null)}),1)},mouseoverItem:function(e){this.isOverSubItemMenu=!1,this.mouseoverItemIndex=e},mouseleaveItem:function(e){var t=this;setTimeout((function(){t.isOverSubItemMenu||t.mouseoverItemIndex===e&&(t.mouseoverItemIndex=null)}),1)},clickAction:function(e,data){this.$emit("action",{func:e,data:data}),this.close()},clickedOutside:function(e){this.close()},close:function(){this.$emit("close"),this.$destroy(),this.$el.parentNode.removeChild(this.$el)}},mounted:function(){var e=this;this.$nextTick((function(){var t,n=null===(t=e.$refs.wrapper)||void 0===t?void 0:t.getBoundingClientRect();n&&(e.openSubMenuLeft=window.innerWidth-n.x<e.menuWidth+e.submenuWidth+5)}))},beforeDestroy:function(){}},r=n(4),component=Object(r.a)(o,(function(){var e=this,t=e._self._c;return t("div",{directives:[{name:"click-outside",rawName:"v-click-outside",value:e.clickOutsideObj,expression:"clickOutsideObj"}],ref:"wrapper",staticClass:"absolute bg-bg rounded-md py-1 border border-black-200 shadow-lg z-50",style:{width:e.menuWidth+"px"}},[e._l(e.items,(function(n,o){return[n.subitems?[t("div",{key:o,staticClass:"flex items-center px-2 py-1.5 hover:bg-white/5 text-white text-xs cursor-default",class:{"bg-white/5":e.mouseoverItemIndex==o},on:{mouseover:function(t){return e.mouseoverItem(o)},mouseleave:function(t){return e.mouseleaveItem(o)},click:function(e){e.stopPropagation()}}},[t("p",[e._v(e._s(n.text))])]),e._v(" "),e.mouseoverItemIndex===o?t("div",{key:"subitems-".concat(o),staticClass:"absolute bg-bg rounded-b-md border border-black-200 py-1 shadow-lg z-50",class:e.openSubMenuLeft?"rounded-l-md":"rounded-r-md",style:{left:e.submenuLeftPos+"px",top:28*o+"px",width:e.submenuWidth+"px"},on:{mouseover:function(t){return e.mouseoverSubItemMenu(o)},mouseleave:function(t){return e.mouseleaveSubItemMenu(o)}}},e._l(n.subitems,(function(n,o){return t("div",{key:"subitem-".concat(o),staticClass:"flex items-center px-2 py-1.5 hover:bg-white/5 text-white text-xs cursor-pointer",on:{click:function(t){return t.stopPropagation(),e.clickAction(n.func,n.data)}}},[t("p",[e._v(e._s(n.text))])])})),0):e._e()]:t("div",{key:o,staticClass:"flex items-center px-2 py-1.5 hover:bg-white/5 text-white text-xs cursor-pointer",on:{mouseover:function(t){return e.mouseoverItem(o)},mouseleave:function(t){return e.mouseleaveItem(o)},click:function(t){return t.stopPropagation(),e.clickAction(n.func)}}},[t("p",[e._v(e._s(n.text))])])]}))],2)}),[],!1,null,null,null);t.default=component.exports}}]);