|
|
|
@ -1,21 +1,26 @@
|
|
|
|
|
<script setup lang="ts"> |
|
|
|
|
import type ColumnFilter from './ColumnFilter.vue' |
|
|
|
|
import { useState } from '#app' |
|
|
|
|
import { IsLockedInj } from '~/context' |
|
|
|
|
import { ActiveViewInj, IsLockedInj } from '~/context' |
|
|
|
|
import MdiFilterIcon from '~icons/mdi/filter-outline' |
|
|
|
|
import MdiMenuDownIcon from '~icons/mdi/menu-down' |
|
|
|
|
|
|
|
|
|
const autoApplyFilter = useState('autoApplyFilter', () => false) |
|
|
|
|
const isLocked = inject(IsLockedInj) |
|
|
|
|
const activeView = inject(ActiveViewInj) |
|
|
|
|
|
|
|
|
|
const { filterAutoSave } = useGlobal() |
|
|
|
|
|
|
|
|
|
// todo: emit from child |
|
|
|
|
const filtersLength = ref(0) |
|
|
|
|
|
|
|
|
|
// todo: avoid duplicate api call by keeping a filter store |
|
|
|
|
const { filters, loadFilters } = useViewFilters( |
|
|
|
|
activeView, |
|
|
|
|
undefined, |
|
|
|
|
computed(() => false), |
|
|
|
|
) |
|
|
|
|
await loadFilters() |
|
|
|
|
const filtersLength = ref(filters?.value?.length ?? 0) |
|
|
|
|
const filterComp = ref<typeof ColumnFilter>() |
|
|
|
|
|
|
|
|
|
// todo: implement |
|
|
|
|
const applyChanges = async () => { |
|
|
|
|
await filterComp?.value?.applyChanges() |
|
|
|
|
} |
|
|
|
|