import{n,_ as r}from"./index-009d300e.js";import{C as o}from"./index-058acbdf.js";import"./vuedraggable.umd-b2447fd7.js";const s={components:{ColumnFilterBoolean:()=>r(()=>import("./ColumnFilterBoolean-1576e084.js"),["./ColumnFilterBoolean-1576e084.js","./index-058acbdf.js","./index-009d300e.js","./index-fe507b7b.css","./vuedraggable.umd-b2447fd7.js","./index-0af0068b.css"],import.meta.url),ColumnFilterDate:()=>r(()=>import("./ColumnFilterDate-6e35a4cf.js"),["./ColumnFilterDate-6e35a4cf.js","./index-058acbdf.js","./index-009d300e.js","./index-fe507b7b.css","./vuedraggable.umd-b2447fd7.js","./index-0af0068b.css"],import.meta.url),ColumnFilterNumber:()=>r(()=>import("./ColumnFilterNumber-a01c2124.js"),["./ColumnFilterNumber-a01c2124.js","./index-058acbdf.js","./index-009d300e.js","./index-fe507b7b.css","./vuedraggable.umd-b2447fd7.js","./index-0af0068b.css"],import.meta.url),ColumnFilterString:()=>r(()=>import("./ColumnFilterString-49abfa9b.js"),["./ColumnFilterString-49abfa9b.js","./index-058acbdf.js","./index-009d300e.js","./index-fe507b7b.css","./vuedraggable.umd-b2447fd7.js","./index-0af0068b.css"],import.meta.url)},props:{value:{type:Object,default:()=>{},required:!0},column:{type:Object,default:()=>{},required:!0},items:{type:Array,default:()=>[],required:!0},groupBy:{type:Boolean,default:()=>!1,required:!1}},data(){return{valid:!0,show:!1}},computed:{hasFilter(){return this.hasDeepValue(this.value)}},methods:{hasDeepValue(t){return t!=null&&Object.keys(t).some(e=>!!t[e]&&!!Object.keys(t[e]).length||typeof t[e]=="boolean")},showOptions(){this.show=!0},hideOptions(){this.show=!1},change(t,e){this.valid=e,e===!0&&this.$emit("change",o.filterSpec(this.column.type,t))},confirm(){this.hideOptions()},resetToDefaults(){const t=o.defaultFilter(this.column.type);Object.assign(this.value,t);for(const e in this.value)Object.hasOwnProperty.call(this.value,e)&&Object.keys(this.value).forEach(()=>{Object.keys(t).includes(e)||delete this.value.key})},clearFilter(){this.resetToDefaults(),this.change(this.value,!0)}}};var u=function(){var e=this,l=e._self._c;return l("v-menu",{attrs:{value:e.show,"close-on-content-click":!1,"offset-y":!0},scopedSlots:e._u([{key:"activator",fn:function({on:a,attrs:i}){return[l("v-icon",e._g(e._b({attrs:{small:"",title:"Filter options..."},on:{click:e.showOptions}},"v-icon",i,!1),a),[e._v(" "+e._s(e.hasFilter?"filter_list_alt":"filter_list")+" ")])]}}])},[l("v-card",[l("v-icon",{attrs:{small:"",right:""},on:{click:e.hideOptions}},[e._v("close")]),e.column.type=="boolean"?l("column-filter-boolean",{attrs:{value:e.value},on:{change:e.change}}):e._e(),e.column.type=="date"?l("column-filter-date",{attrs:{value:e.value},on:{change:e.change}}):e._e(),e.column.type=="number"?l("column-filter-number",{attrs:{value:e.value,items:e.items},on:{change:e.change}}):e._e(),e.column.type=="string"?l("column-filter-string",{attrs:{value:e.value,items:e.items},on:{change:e.change}}):e._e(),e.column.groupable!=!1?l("v-checkbox",{staticClass:"ml-4",attrs:{label:"Group values",value:e.groupBy},on:{change:function(a){return e.$emit("update:group-by",a?[e.column.value]:[])}}}):e._e(),l("v-card-actions",[l("v-btn",{on:{click:e.clearFilter}},[e._v("Clear")]),l("v-btn",{attrs:{color:"primary",disabled:!e.valid},on:{click:e.confirm}},[e._v("Ok")])],1)],1)],1)},c=[],m=n(s,u,c,!1,null,null,null,null);const v=m.exports;export{v as default};
