index.ts 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. import createInput from '#shared/form/core/createInput.ts'
  3. import addLink from '#shared/form/features/addLink.ts'
  4. import formUpdaterTrigger from '#shared/form/features/formUpdaterTrigger.ts'
  5. import FieldAutoCompleteInput from './FieldAutoCompleteInput.vue'
  6. export const autoCompleteProps = [
  7. 'action',
  8. 'actionIcon',
  9. 'actionLabel',
  10. 'additionalQueryParams',
  11. 'allowUnknownValues',
  12. 'clearable',
  13. 'debounceInterval',
  14. 'defaultFilter',
  15. 'alwaysApplyDefaultFilter',
  16. 'filterInputPlaceholder',
  17. 'filterInputValidation',
  18. 'limit',
  19. 'multiple',
  20. 'noOptionsLabelTranslation',
  21. 'belongsToObjectField',
  22. 'optionIcon',
  23. 'dialogNotFoundMessage',
  24. 'dialogEmptyMessage',
  25. 'options',
  26. 'initialOptionBuilder',
  27. 'sorting',
  28. 'complexValue',
  29. 'clearValue',
  30. ]
  31. const fieldDefinition = createInput(
  32. FieldAutoCompleteInput,
  33. [...autoCompleteProps, 'gqlQuery'],
  34. { features: [addLink, formUpdaterTrigger()] },
  35. { addArrow: true },
  36. )
  37. export default {
  38. fieldType: 'autocomplete',
  39. definition: fieldDefinition,
  40. }