feat(filter): make filter input label configurable
This commit is contained in:
parent
f6485be9e2
commit
b8ff7910b0
@ -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()"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user