FieldOrganizationWrapper.vue 1.1 KB

123456789101112131415161718192021222324
  1. <!-- Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/ -->
  2. <script setup lang="ts">
  3. import { markRaw } from 'vue'
  4. import { AutocompleteSearchOrganizationDocument } from '#shared/components/Form/fields/FieldOrganization/graphql/queries/autocompleteSearch/organization.api.ts'
  5. import type { AutocompleteOrganizationProps } from '#shared/components/Form/fields/FieldOrganization/types.ts'
  6. import { useFormFieldOrganizationInitialOptionBuilder } from '#shared/components/Form/fields/FieldOrganization/useFieldOrganizationInitialOptionBuilder.ts'
  7. import FieldAutoCompleteInput from '../FieldAutoComplete/FieldAutoCompleteInput.vue'
  8. import FieldOrganizationOptionIcon from './FieldOrganizationOptionIcon.vue'
  9. const props = defineProps<AutocompleteOrganizationProps>()
  10. Object.assign(props.context, {
  11. optionIconComponent: markRaw(FieldOrganizationOptionIcon),
  12. initialOptionBuilder: useFormFieldOrganizationInitialOptionBuilder(),
  13. gqlQuery: AutocompleteSearchOrganizationDocument,
  14. })
  15. </script>
  16. <template>
  17. <FieldAutoCompleteInput :context="context" v-bind="$attrs" />
  18. </template>