(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d229d6c"],{dec8:function(e,t,a){"use strict";a.r(t);var s=a("8336"),l=a("b0af"),n=a("ce7e"),o=a("132d"),i=a("8860"),r=a("f774"),c=a("2fa4"),m=function(){var e=this,t=e._self._c;return t(r["a"],{attrs:{app:"",right:"",light:"",temporary:"","hide-overlay":"",width:"280"},model:{value:e.columnNavbar,callback:function(t){e.columnNavbar=t},expression:"columnNavbar"}},[e.getColumnsByTableName(e.tableName)?t(i["a"],{staticClass:"px-3"},[t("div",{staticClass:"d-flex align-center"},[t("div",{staticClass:"d-flex flex-column"},[t("span",{staticClass:"text-h5"},[e._v("Customize columns")]),t("span",{staticClass:"text-xs mt-n1"},[e._v(" Drag columns to change order. Use checkbox to show or hide columns from the table. ")])]),t(c["a"]),t(s["a"],{attrs:{icon:"",small:""},on:{click:function(t){e.columnNavbar=!1}}},[t(o["a"],{attrs:{small:""}},[e._v("mdi-close")])],1)],1),t("draggable",{on:{end:e.dragEnd},model:{value:e.updatedCols,callback:function(t){e.updatedCols=t},expression:"updatedCols"}},e._l(e.editableCols,(function(a){return t(l["a"],{key:a.value,staticClass:"py-4 px-3 ma-2 bg-white draggable-card d-flex align-center",attrs:{outlined:""},on:{click:function(t){return t.stopPropagation(),e.toggleCol(a)}}},[a.show?t(o["a"],{attrs:{color:"primary"}},[e._v("mdi-checkbox-marked")]):t(o["a"],{attrs:{color:"secondary"}},[e._v("mdi-checkbox-blank-outline")]),t("span",{staticClass:"ml-2"},[e._v(e._s(a.text))]),t(c["a"]),t(o["a"],{staticClass:"drag-icon"},[e._v("mdi-drag-vertical")])],1)})),1)],1):e._e(),e.permanentCols.length?t("div",{staticClass:"px-3"},[t("div",{staticClass:"d-flex align-center w-100"},[t(n["a"]),t("div",{staticClass:"text-caption mx-2"},[e._v("Permanent column")]),t(n["a"])],1),e._l(e.permanentCols,(function(a,s){var n;return t(l["a"],{key:s,staticClass:"py-4 px-3 ma-2 bg-white draggable-card d-flex align-center",attrs:{outlined:""},on:{click:function(t){return t.stopPropagation(),e.togglePermanentCol(a)}}},[e._v(" "+e._s(a.text)+" "),t(c["a"]),t("div",{staticClass:"text-caption font-weight-medium black--text"},[e._v(" "+e._s(null!==(n=a.class)&&void 0!==n&&n.includes("fixed-column")?"Fixed":"Not fixed")+" ")])],1)}))],2):e._e(),t(l["a"],{staticClass:"mx-5 mb-5 px-3 py-2 d-flex justify-center white--text border-primary",attrs:{color:"primary",outlined:""},on:{click:e.resetCols}},[t(o["a"],{staticClass:"mr-2 ml-n3",attrs:{color:"white"}},[e._v("mdi-refresh")]),t("span",[e._v("Reset")])],1)],1)},u=[],d=a("1bcb"),h=a("2f62"),C=a("5a50"),b=a("b76a"),g=a.n(b),p={data:()=>({updatedCols:[],tableName:"",columnNavbar:!1,columnsWhenDrawerOpened:[]}),components:{draggable:g.a},computed:{...Object(h["c"])("columnsManager",["getColumnsByTableName","getAllTableColumns"]),...Object(h["c"])("user",["getSettingByKey","user"]),currentTableCols(){return this.getColumnsByTableName(this.tableName)||[]},editableCols(){return this.currentTableCols.filter(e=>!e.permanent)},permanentCols(){return this.currentTableCols.filter(e=>e.permanent)}},methods:{...Object(h["b"])("user",["updateSetting"]),...Object(h["b"])("columnsManager",["saveCurrentConfig"]),...Object(h["d"])("columnsManager",["setColumnsByTableName","fixColumnAsSticky","toggleColumn"]),resetCols(){d["a"].$emit("reset-cols"),this.columnNavbar=!1},togglePermanentCol(e){this.fixColumnAsSticky({tableName:this.tableName,columnValue:e.value}),d["a"].$emit("cols-updated")},toggleCol(e){this.toggleColumn({tableName:this.tableName,columnValue:e.value}),d["a"].$emit("cols-updated")},dragEnd(){this.setColumnsByTableName({tableName:this.tableName,columns:[...this.updatedCols,...this.permanentCols]}),this.saveCurrentConfig(),d["a"].$emit("cols-updated")},openColumnsNavbar(e){this.tableName=e,this.columnNavbar=!0},isConfigChanged(){const e=this.getColumnsByTableName(this.tableName);return this.columnsWhenDrawerOpened&&e.some((e,t)=>e.show!==this.columnsWhenDrawerOpened[t].show||e.cellClass!==this.columnsWhenDrawerOpened[t].cellClass||e.class!==this.columnsWhenDrawerOpened[t].class)}},watch:{columnNavbar(e,t){if(e){const e=this.getColumnsByTableName(this.tableName);e&&(this.columnsWhenDrawerOpened=e.map(e=>({...e})))}else!e&&t&&this.isConfigChanged()&&this.updateSetting({userId:this.user.id,settings:{settings_key:C["n"].TABLE_COLUMNS_CONFIG,settings_value:this.getAllTableColumns}})},editableCols(e){this.updatedCols=e}},created(){this.$store.commit("columnsManager/setColumns",this.getSettingByKey(C["n"].TABLE_COLUMNS_CONFIG)),this.updatedCols=this.editableCols,d["a"].$on("open-columns-navbar",this.openColumnsNavbar)}},v=p,f=a("2877"),x=Object(f["a"])(v,m,u,!1,null,null,null);t["default"]=x.exports}}]);
//# sourceMappingURL=chunk-2d229d6c.03c5c5da.js.map