FieldSearch.vue 939 B

12345678910111213141516171819202122232425262728293031323334
  1. <!-- Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/ -->
  2. <script setup lang="ts">
  3. import { toRef } from 'vue'
  4. import CommonInputSearch, {
  5. type CommonInputSearchProps,
  6. } from '#shared/components/CommonInputSearch/CommonInputSearch.vue'
  7. import useValue from '../../composables/useValue.ts'
  8. import type { FormFieldContext } from '../../types/field.ts'
  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. :class="context.classes.input"
  24. @blur="context.handlers.blur"
  25. />
  26. </template>