From b50c00a59580da15b2e2dc46608f5d9dcbda0fb5 Mon Sep 17 00:00:00 2001 From: Gaelle Date: Fri, 13 Oct 2023 17:13:52 +0200 Subject: [PATCH] add empty prop to tags into bcf filter --- src/components/bcf-filters/BcfFilters.vue | 25 +++++++++++++---------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/components/bcf-filters/BcfFilters.vue b/src/components/bcf-filters/BcfFilters.vue index 442a130..965acf4 100644 --- a/src/components/bcf-filters/BcfFilters.vue +++ b/src/components/bcf-filters/BcfFilters.vue @@ -86,9 +86,11 @@ v-model="filters.labels" > @@ -120,6 +122,7 @@ import { } from "@bimdata/design-system/src/BIMDataComponents/BIMDataIcon/BIMDataIconStandalone/index.js"; import BIMDataInput from "@bimdata/design-system/src/BIMDataComponents/BIMDataInput/BIMDataInput.vue"; import BIMDataSelect from "@bimdata/design-system/src/BIMDataComponents/BIMDataSelect/BIMDataSelect.vue"; +import BIMDataText from "@bimdata/design-system/src/BIMDataComponents/BIMDataText/BIMDataText.vue"; function getSelectOptions(list) { return Array.from(new Set(list)).sort((a, b) => @@ -135,6 +138,7 @@ export default { BIMDataIconSearch, BIMDataInput, BIMDataSelect, + BIMDataText }, props: { topics: { @@ -143,7 +147,7 @@ export default { }, initFilters: { type: Object, - } + }, }, emits: ["submit"], setup(props, { emit }) { @@ -154,20 +158,19 @@ export default { const { filters, filteredTopics, reset, apply } = useBcfFilter(computed(() => props.topics)); watch( - () => props.initFilters, + () => props.initFilters, () => { - if(props.initFilters) { + if (props.initFilters) { apply(props.initFilters); } else { - filters + filters; } }, { deep: true } - ) + ); - const priorityOptions = computed( - () => - getSelectOptions(props.topics.map((topic) => topic.priority)), + const priorityOptions = computed(() => + getSelectOptions(props.topics.map((topic) => topic.priority)) ); const statusOptions = computed(() =>