feat(filter): make filter input label configurable

This commit is contained in:
kolaente 2024-03-18 12:10:28 +01:00
parent f6485be9e2
commit b8ff7910b0
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 10 additions and 1 deletions

View File

@ -21,13 +21,18 @@ import {
LABEL_FIELDS,
} from '@/helpers/filters'
import {useDebounceFn} from '@vueuse/core'
import {useI18n} from 'vue-i18n'
const {t} = useI18n()
const {
modelValue,
projectId,
inputLabel = undefined,
} = defineProps<{
modelValue: string,
projectId?: number,
inputLabel?: string,
}>()
const emit = defineEmits(['update:modelValue', 'blur'])
@ -246,7 +251,11 @@ const blurDebounced = useDebounceFn(() => emit('blur'), 500)
<template>
<div class="field">
<label class="label">{{ $t('filters.query.title') }}</label>
<label
class="label"
>
{{ inputLabel ?? $t('filters.query.title') }}
</label>
<AutocompleteDropdown
:options="autocompleteResults"
@blur="filterInput?.blur()"