import{n,_ as r}from"./index-e4d8863a.js";import{C as i}from"./index-52db1f4a.js";import"./vuedraggable.umd-189fef22.js";const s={components:{ColumnFilterBoolean:()=>r(()=>import("./ColumnFilterBoolean-46c4313e.js"),["./ColumnFilterBoolean-46c4313e.js","./index-52db1f4a.js","./index-e4d8863a.js","./index-ad0d8a78.css","./vuedraggable.umd-189fef22.js","./index-4f019d58.css"],import.meta.url),ColumnFilterDate:()=>r(()=>import("./ColumnFilterDate-6e38d4b9.js"),["./ColumnFilterDate-6e38d4b9.js","./index-52db1f4a.js","./index-e4d8863a.js","./index-ad0d8a78.css","./vuedraggable.umd-189fef22.js","./index-4f019d58.css"],import.meta.url),ColumnFilterNumber:()=>r(()=>import("./ColumnFilterNumber-754b62a1.js"),["./ColumnFilterNumber-754b62a1.js","./index-52db1f4a.js","./index-e4d8863a.js","./index-ad0d8a78.css","./vuedraggable.umd-189fef22.js","./index-4f019d58.css"],import.meta.url),ColumnFilterString:()=>r(()=>import("./ColumnFilterString-f113cb98.js"),["./ColumnFilterString-f113cb98.js","./index-52db1f4a.js","./index-e4d8863a.js","./index-ad0d8a78.css","./vuedraggable.umd-189fef22.js","./index-4f019d58.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",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,null,null);const v=m.exports;export{v as default};
