From 4a43b45a990f74bb00d5deb064e19b86b5d99dfe Mon Sep 17 00:00:00 2001 From: Erb3 <49862976+Erb3@users.noreply.github.com> Date: Tue, 27 Aug 2024 21:48:44 +0200 Subject: [PATCH] fix(web): lint #2306 (#2309) --- .../ui/src/components/base/ManySelect.vue | 56 ++++++++++++------- 1 file changed, 37 insertions(+), 19 deletions(-) diff --git a/packages/ui/src/components/base/ManySelect.vue b/packages/ui/src/components/base/ManySelect.vue index 796873b64..85671398e 100644 --- a/packages/ui/src/components/base/ManySelect.vue +++ b/packages/ui/src/components/base/ManySelect.vue @@ -6,9 +6,11 @@ :disabled="disabled" :position="position" :direction="direction" - @open="() => { - searchQuery = '' - }" + @open=" + () => { + searchQuery = '' + } + " > @@ -16,12 +18,20 @@
- + -
+
@@ -63,12 +78,12 @@ type Option = string | number | object const props = withDefaults( defineProps<{ - modelValue: Option[], + modelValue: Option[] options: Option[] disabled?: boolean position?: string - direction?: string, - displayName?: (option: Option) => string, + direction?: string + displayName?: (option: Option) => string search?: boolean }>(), { @@ -80,9 +95,9 @@ const props = withDefaults( }, ) -const emit = defineEmits(['update:modelValue', 'change']); +const emit = defineEmits(['update:modelValue', 'change']) const selectedValues = ref(props.modelValue || []) -const searchInput = ref(); +const searchInput = ref() const searchQuery = ref('') @@ -98,7 +113,11 @@ const manyValues = computed({ }) const filteredOptions = computed(() => { - return props.options.filter((x) => !searchQuery.value || props.displayName(x).toLowerCase().includes(searchQuery.value.toLowerCase())) + return props.options.filter( + (x) => + !searchQuery.value || + props.displayName(x).toLowerCase().includes(searchQuery.value.toLowerCase()), + ) }) defineOptions({ @@ -112,5 +131,4 @@ function toggleOption(id: Option) { manyValues.value = [...manyValues.value, id] } } -