"use strict";(self["webpackChunkcarabi_x2"]=self["webpackChunkcarabi_x2"]||[]).push([[2466],{6433:function(t,e,s){s.r(e),s.d(e,{default:function(){return c}});var n=function(){var t=this,e=t._self._c;return e("div",{staticClass:"uk-inline"},[e("button",{ref:"button",staticClass:"button-menu",class:t.buttonClasses,attrs:{disabled:t.disabled},on:{click:function(e){return e.preventDefault(),t.dropDownClick.apply(null,arguments)}}},[t.icon?e("span",{staticClass:"button-menu-icon",domProps:{innerHTML:t._s(t.icon)}}):t._e(),t.title?e("span",{staticClass:"button-menu-title uk-visible@s uk-margin-small-left uk-margin-small-right"},[t._v(t._s(t.title))]):t._e(),t.showArrow?e("span",{staticClass:"button-menu-arrow"},[e("img",{attrs:{src:"img/icons/icon_arrow__down.svg","uk-svg":"",width:"10",height:"10"}})]):t._e()]),e("Dropdown",{ref:"dropdown"},[t.dropdownTitle?e("div",{staticClass:"button-menu-dropdown-title uk-hidden@l"},[t._v(t._s(t.dropdownTitle))]):t._e(),e("ul",{staticClass:"button-menu-list uk-nav uk-dropdown-nav"},t._l(t.items,(function(s){return e("li",{key:s.id,class:{main:s.main}},[e("a",{attrs:{title:s.descr,href:"#"},on:{click:function(e){return e.preventDefault(),t.itemClick(s)}}},[t.showListIcons?e("span",{staticClass:"bml-icon",domProps:{innerHTML:t._s(s.icon)}}):t._e(),t._v(" "+t._s(s.title)+" ")])])})),0)]),t.showModal?e("Modal",{ref:"modal",attrs:{title:t.dropdownTitle,autoOpen:!0},on:{closed:function(e){t.showModal=!1},opened:t.modalOpened}},[t.showSearch?e("div",{staticClass:"uk-padding-small"},[e("div",{},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.context,expression:"context"}],ref:"search",staticClass:"uk-input",attrs:{type:"text",placeholder:"поиск..."},domProps:{value:t.context},on:{input:function(e){e.target.composing||(t.context=e.target.value)}}})])]):t._e(),e("div",{staticClass:"button-menu-modal",class:{"nopadding-top":t.showSearch}},[e("ul",{staticClass:"button-menu-list uk-nav uk-dropdown-nav"},t._l(t.filtredItems,(function(s){return e("li",{key:s.id,class:{main:s.main}},[e("a",{attrs:{title:s.descr,href:"#"},on:{click:function(e){return e.preventDefault(),t.itemClick(s)}}},[t.showListIcons?e("span",{staticClass:"bml-icon",domProps:{innerHTML:t._s(s.icon)}}):t._e(),t._v(" "+t._s(s.title)+" ")])])})),0)])]):t._e(),t._t("default")],2)},o=[],i=s(1574),a={name:"ButtonMenu",components:{Modal:()=>s.e(8362).then(s.bind(s,2215)),Dropdown:()=>s.e(8472).then(s.bind(s,6338))},props:{title:String,items:Array,icon:String,buttonClasses:Array,dropdownTitle:String,showArrow:{type:Boolean,default:!0},showListIcons:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},computed:{showSearch(){return this.items.length>10},filtredItems(){let t=[...this.items];if(this.context){let e=this.context.toLowerCase();t=t.filter((t=>-1!==t.title.toLowerCase().indexOf(e)))}return t}},data(){return{showModal:!1,context:""}},mounted(){},methods:{dropDownClick(){i.A.compact||this.showSearch?this.showModal=!0:this.$refs.dropdown.open(this.$refs.button)},modalOpened(){this.showSearch&&this.$refs.search.focus()},itemClick(t){this.$refs.dropdown&&this.$refs.dropdown.close(),this.showModal&&this.$refs.modal.close(),this.$emit("select",t)}}},l=a,r=s(1656),d=(0,r.A)(l,n,o,!1,null,null,null),c=d.exports}}]);
//# sourceMappingURL=ButtonMenu.8a5fa58b.js.map