11<template >
2- <v-row class =" align-start" >
3- <v-col cols =" 10" >
4- <v-row >
5- <v-col v-for =" section in sections" :key =" section.key" cols =" 6" >
6- <FilterSection
7- :title =" section.title"
8- :options =" section.options"
9- :model-value =" modelValue[section.key] ?? null"
10- @update:model-value ="
11- onSectionChange(section.key, $event)
12- "
13- />
14- </v-col >
15- </v-row >
16- </v-col >
17-
18- <v-col cols =" 2" class =" d-flex justify-end align-center" >
19- <v-btn
20- variant =" outlined"
21- size =" small"
22- color =" primary"
23- class =" text-none text-caption font-weight-medium"
24- :style =" {
25- visibility: hasActiveFilters ? 'visible' : 'hidden',
26- }"
27- @click =" emit('clear')"
28- >
29- <v-icon start size =" small" >mdi-close</v-icon >
30- {{ translate("general.clearFilters") }}
31- </v-btn >
32- </v-col >
33- </v-row >
2+ <div class =" d-flex flex-column ga-4" >
3+ <FilterSection
4+ v-for =" section in sections"
5+ :key =" section.key"
6+ :title =" section.title"
7+ :options =" section.options"
8+ :model-value =" modelValue[section.key] ?? null"
9+ @update:model-value =" onSectionChange(section.key, $event)"
10+ />
11+ </div >
3412</template >
3513
3614<script setup lang="ts">
37- import { computed } from " vue" ;
38- import { translate } from " @/utils/generalUtils.ts" ;
3915import FilterSection from " ./FilterSection.vue" ;
4016import type { FilterSectionDef } from " ./filterTypes.ts" ;
4117
@@ -46,13 +22,8 @@ const props = defineProps<{
4622
4723const emit = defineEmits <{
4824 " update:modelValue" : [value : Record <string , string | null >];
49- clear: [];
5025}>();
5126
52- const hasActiveFilters = computed (() =>
53- props .sections .some ((s ) => !! props .modelValue [s .key ]),
54- );
55-
5627function onSectionChange(key : string , value : string | null ) {
5728 emit (" update:modelValue" , { ... props .modelValue , [key ]: value });
5829}
0 commit comments