const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ColumnFilterBoolean-BGoX6G9V.js","./index-BS9jO9ks.js","./index-Ms_1iFoB.js","./index-2j-kvxFz.css","./vuedraggable.umd-BPF4oUW7.js","./index-BV77wOsY.css","./ColumnFilterDate-B4oCTQeZ.js","./ColumnFilterNumber-DmxJvXLN.js","./ColumnFilterString-ZsIZGrD_.js"])))=>i.map(i=>d[i]);
import{n,_ as r}from"./index-Ms_1iFoB.js";import{C as i}from"./index-BS9jO9ks.js";import"./vuedraggable.umd-BPF4oUW7.js";const s={components:{ColumnFilterBoolean:()=>r(()=>import("./ColumnFilterBoolean-BGoX6G9V.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url),ColumnFilterDate:()=>r(()=>import("./ColumnFilterDate-B4oCTQeZ.js"),__vite__mapDeps([6,1,2,3,4,5]),import.meta.url),ColumnFilterNumber:()=>r(()=>import("./ColumnFilterNumber-DmxJvXLN.js"),__vite__mapDeps([7,1,2,3,4,5]),import.meta.url),ColumnFilterString:()=>r(()=>import("./ColumnFilterString-ZsIZGrD_.js"),__vite__mapDeps([8,1,2,3,4,5]),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",i.filterSpec(this.column.type,t))},confirm(){this.hideOptions()},resetToDefaults(){const t=i.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:o}){return[l("v-icon",e._g(e._b({staticStyle:{"padding-right":"2px","padding-bottom":"3px"},attrs:{small:"",title:"Filter options..."},on:{click:e.showOptions}},"v-icon",o,!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);const v=m.exports;export{v as default};
