"use strict";(self["webpackChunkcarabi_x2"]=self["webpackChunkcarabi_x2"]||[]).push([[7967],{3322:function(t,e,s){function r(t){if(!t)return t;var e,s=[Number,String,Boolean];if(s.forEach((function(s){t instanceof s&&(e=s(t))})),"undefined"==typeof e)if("[object Array]"===Object.prototype.toString.call(t))e=[],t.forEach((function(t,s,a){e[s]=r(t)}));else if("object"==typeof t)if(t.nodeType&&"function"==typeof t.cloneNode)e=t.cloneNode(!0);else if(t.prototype)e=t;else if(t instanceof Date)e=new Date(t);else for(var a in e={},t)e[a]=r(t[a]);else e=t;return e}s.d(e,{A:function(){return r}})},7901:function(t,e,s){s.r(e),s.d(e,{default:function(){return m}});var r=function(){var t=this,e=t._self._c;return t.opened?e("div",{attrs:{"uk-modal":""}},[e("div",{staticClass:"uk-modal-dialog uk-flex uk-flex-column"},[e("button",{staticClass:"uk-modal-close-default",attrs:{type:"button","uk-close":""}}),t._m(0),e("div",{staticClass:"uk-padding-small",staticStyle:{flex:"1","min-height":"1px",overflow:"auto",position:"relative"}},[e("div",{staticClass:"uk-margin-bottom"},[e("label",{staticClass:"uk-text-truncate uk-text-bold"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.showFilters,expression:"showFilters"}],staticClass:"pos-checkbox",attrs:{type:"checkbox"},domProps:{checked:Array.isArray(t.showFilters)?t._i(t.showFilters,null)>-1:t.showFilters},on:{change:function(e){var s=t.showFilters,r=e.target,a=!!r.checked;if(Array.isArray(s)){var i=null,l=t._i(s,i);r.checked?l<0&&(t.showFilters=s.concat([i])):l>-1&&(t.showFilters=s.slice(0,l).concat(s.slice(l+1)))}else t.showFilters=a}}}),t._v(" Показать фильтры под колонками")])]),e("div",{staticClass:"uk-text-bold"},[t._v("Показать колонки:")]),e("div",{staticClass:"uk-text-muted uk-text-small"},[t._v("Порядок колонок изменяется перетаскиванием")]),e("div",{staticClass:"uk-textarea"},[e("draggable",{on:{start:function(e){t.drag=!0},end:t.dragEnd},model:{value:t.mutableStructure,callback:function(e){t.mutableStructure=e},expression:"mutableStructure"}},t._l(t.mutableStructure,(function(s){return e("div",{key:s.PROP_SYS_NAME},[e("label",{staticClass:"uk-text-truncate"},[e("input",{directives:[{name:"model",rawName:"v-model",value:s.VISIBLE,expression:"col.VISIBLE"}],staticClass:"pos-checkbox",attrs:{type:"checkbox"},domProps:{checked:Array.isArray(s.VISIBLE)?t._i(s.VISIBLE,null)>-1:s.VISIBLE},on:{change:[function(e){var r=s.VISIBLE,a=e.target,i=!!a.checked;if(Array.isArray(r)){var l=null,o=t._i(r,l);a.checked?o<0&&t.$set(s,"VISIBLE",r.concat([l])):o>-1&&t.$set(s,"VISIBLE",r.slice(0,o).concat(r.slice(o+1)))}else t.$set(s,"VISIBLE",i)},function(e){return t.checkboxChange(s)}]}}),t._v(" "+t._s(s.DOCPROP_NAME)+" ")])])})),0)],1),t._m(1)])])]):t._e()},a=[function(){var t=this,e=t._self._c;return e("div",{staticClass:"uk-padding-small"},[e("h4",{staticClass:"uk-margin-remove"},[t._v(" Настройка колонок таблицы ")])])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"uk-text-center uk-margin-top"},[e("button",{staticClass:"uk-modal-close uk-button uk-button-small uk-button-primary"},[t._v("Закрыть")])])}],i=s(3322),l=s(1527),o=s.n(l),n=s(2779),c={name:"ModalColumns",components:{draggable:o()},props:{},data(){return{opened:!1,drag:!1,showFilters:!1,structure:[],mutableStructure:[]}},computed:{},methods:{async open(t){this.opened=!0,this.structure=(0,i.A)(t.structure),this.mutableStructure=this.structure.filter((t=>!t.SYS_COLUMN)),this.showFilters=t.showFilters,await this.$nextTick(),n.util.on(this.$el,"hide",(()=>{this.close()})),n.util.on(this.$el,"hidden",(()=>{this.opened=!1})),n.modal(this.$el,{stack:!0}).show()},dragEnd(t){this.drag=!1;let e=this.mutableStructure[t.newIndex].PROP_SYS_NAME,s=t.newIndex+1<this.mutableStructure.length?this.mutableStructure[t.newIndex+1].PROP_SYS_NAME:"";console.log("dragEnd",e,s),this.$emit("order",{column:e,nextColumn:s})},checkboxChange(t){this.$emit("change",t)},close(){let t=this.mutableStructure.concat(this.structure.filter((t=>t.SYS_COLUMN)));console.log("finalStructure",t),this.$emit("close",{showFilters:this.showFilters,structure:t})}}},u=c,d=s(1656),h=(0,d.A)(u,r,a,!1,null,null,null),m=h.exports}}]);
//# sourceMappingURL=ModalColumns.8c7e288e.js.map