FieldOrganizationWrapper.vue 1.2 KB

1234567891011121314151617181920212223242526272829
  1. <!-- Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/ -->
  2. <script setup lang="ts">
  3. import { defineAsyncComponent, 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 FieldOrganizationOptionIcon from './FieldOrganizationOptionIcon.vue'
  8. const FieldAutoCompleteInput = defineAsyncComponent(
  9. () =>
  10. import(
  11. '#mobile/components/Form/fields/FieldAutoComplete/FieldAutoCompleteInput.vue'
  12. ),
  13. )
  14. const props = defineProps<AutocompleteOrganizationProps>()
  15. Object.assign(props.context, {
  16. optionIconComponent: markRaw(FieldOrganizationOptionIcon),
  17. initialOptionBuilder: useFormFieldOrganizationInitialOptionBuilder(),
  18. gqlQuery: AutocompleteSearchOrganizationDocument,
  19. })
  20. </script>
  21. <template>
  22. <FieldAutoCompleteInput :context="context" v-bind="$attrs" />
  23. </template>