defaultFieldDefinition.ts 792 B

123456789101112131415161718192021222324
  1. // Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. import type { FormKitTypeDefinition } from '@formkit/core'
  3. import type { FormDefaultProps } from '#shared/types/form.ts'
  4. import hideField from '../features/hideField.ts'
  5. import translateWrapperProps from '../features/translateWrapperProps.ts'
  6. import addBlurEvent from '../features/addBlurEvent.ts'
  7. import formLocaleDir from '../features/formLocaleDir.ts'
  8. const defaultProps: (keyof FormDefaultProps)[] = [
  9. 'formId',
  10. 'labelSrOnly',
  11. 'labelPlaceholder',
  12. 'internal',
  13. ]
  14. const defaulfFieldDefinition: Required<
  15. Pick<FormKitTypeDefinition, 'props' | 'features'>
  16. > = {
  17. features: [translateWrapperProps, hideField, addBlurEvent, formLocaleDir],
  18. props: defaultProps,
  19. }
  20. export default defaulfFieldDefinition