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