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