Line data Source code
1 : <script setup lang="ts">
2 : import type { ComponentProps } from 'vue-component-type-helpers'
3 :
4 : import AsyncSearchInput from '@comfyorg/design-system/search-input/AsyncSearchInput'
5 :
6 : type AsyncSearchInputProps = ComponentProps<typeof AsyncSearchInput>
7 :
8 : const { searcher, updateKey } = defineProps<{
9 : searcher?: AsyncSearchInputProps['searcher']
10 : updateKey?: AsyncSearchInputProps['updateKey']
11 : }>()
12 :
13 2355 : const emit = defineEmits<{
14 : enter: [event: KeyboardEvent]
15 : }>()
16 :
17 295 : const query = defineModel<string>({ default: '' })
18 295 :
19 : defineOptions({ inheritAttrs: false })
20 : </script>
21 :
22 : <template>
23 355 : <div class="flex items-center border-b px-4 pt-1 pb-4">
24 : <AsyncSearchInput
25 : v-model="query"
26 : :clear-label="$t('g.clear')"
27 : :placeholder="$t('g.searchPlaceholder', { subject: '' })"
28 : :accessible-label="$t('g.search')"
29 : :searcher
30 : :update-key="updateKey"
31 : @enter="emit('enter', $event)"
32 : />
33 : <slot />
34 : </div>
35 : </template>
|