index.ts 853 B

12345678910111213141516171819202122232425262728
  1. // Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. import createInput from '#shared/form/core/createInput.ts'
  3. import formUpdaterTrigger from '#shared/form/features/formUpdaterTrigger.ts'
  4. import FieldPermissionsInput from './FieldPermissionsInput.vue'
  5. import type { PermissionsProps } from './types.ts'
  6. import type { FormKitBaseSlots, FormKitInputs } from '@formkit/inputs'
  7. declare module '@formkit/inputs' {
  8. interface FormKitInputProps<Props extends FormKitInputs<Props>> {
  9. permissions: PermissionsProps
  10. }
  11. interface FormKitInputSlots<Props extends FormKitInputs<Props>> {
  12. permissions: FormKitBaseSlots<Props>
  13. }
  14. }
  15. const fieldDefinition = createInput(FieldPermissionsInput, ['options'], {
  16. features: [formUpdaterTrigger()],
  17. })
  18. export default {
  19. fieldType: 'permissions',
  20. definition: fieldDefinition,
  21. }