|
|
@ -1,4 +1,6 @@ |
|
|
|
<script setup lang="ts"> |
|
|
|
<script setup lang="ts"> |
|
|
|
|
|
|
|
import { computed } from 'vue' |
|
|
|
|
|
|
|
|
|
|
|
// todo: move to persisted state |
|
|
|
// todo: move to persisted state |
|
|
|
import type ColumnFilter from './ColumnFilter.vue' |
|
|
|
import type ColumnFilter from './ColumnFilter.vue' |
|
|
|
import { useState } from '#app' |
|
|
|
import { useState } from '#app' |
|
|
@ -9,10 +11,18 @@ 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 { $state } = useNuxtApp() |
|
|
|
|
|
|
|
|
|
|
|
// todo: emit from child |
|
|
|
// todo: emit from child |
|
|
|
const filtersLength = ref(0) |
|
|
|
const filtersLength = ref(0) |
|
|
|
// todo: sync with store |
|
|
|
// todo: sync with store |
|
|
|
const autosave = ref(true) |
|
|
|
const autosave = computed({ |
|
|
|
|
|
|
|
get() { |
|
|
|
|
|
|
|
return $state.filterAutoSave.value |
|
|
|
|
|
|
|
}, set(value: boolean) { |
|
|
|
|
|
|
|
$state.filterAutoSave.value = value |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
const filterComp = ref<typeof ColumnFilter>() |
|
|
|
const filterComp = ref<typeof ColumnFilter>() |
|
|
|
|
|
|
|
|
|
|
@ -42,7 +52,8 @@ const applyChanges = async () => { |
|
|
|
@update:filters-length="filtersLength = $event" |
|
|
|
@update:filters-length="filtersLength = $event" |
|
|
|
> |
|
|
|
> |
|
|
|
<div class="d-flex align-end mt-2 min-h-[30px]" @click.stop> |
|
|
|
<div class="d-flex align-end mt-2 min-h-[30px]" @click.stop> |
|
|
|
<a-checkbox id="col-filter-checkbox" v-model:checked="autosave" class="col-filter-checkbox" hide-details dense> |
|
|
|
<a-checkbox id="col-filter-checkbox" v-model:checked="autosave" class="col-filter-checkbox" hide-details |
|
|
|
|
|
|
|
dense> |
|
|
|
<span class="text-grey text-xs"> |
|
|
|
<span class="text-grey text-xs"> |
|
|
|
{{ $t('msg.info.filterAutoApply') }} |
|
|
|
{{ $t('msg.info.filterAutoApply') }} |
|
|
|
<!-- Auto apply --> |
|
|
|
<!-- Auto apply --> |
|
|
|