FieldSearch.vue 895 B

123456789101112131415161718192021222324252627282930
  1. <!-- Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/ -->
  2. <script setup lang="ts">
  3. import CommonInputSearch, {
  4. type CommonInputSearchProps,
  5. } from '@shared/components/CommonInputSearch/CommonInputSearch.vue'
  6. import { toRef } from 'vue'
  7. import useValue from '../../composables/useValue'
  8. import type { FormFieldContext } from '../../types/field'
  9. export interface FieldSearchProps {
  10. context: FormFieldContext<CommonInputSearchProps>
  11. }
  12. const props = defineProps<FieldSearchProps>()
  13. const { localValue } = useValue(toRef(props, 'context'))
  14. </script>
  15. <template>
  16. <CommonInputSearch
  17. :id="props.context.id"
  18. v-model="localValue"
  19. :disabled="props.context.disabled"
  20. :placeholder="props.context.placeholder || props.context.attrs.placeholder"
  21. :wrapper-class="props.context.wrapperClass"
  22. no-border
  23. @blur="context.handlers.blur"
  24. />
  25. </template>