active.ts 617 B

1234567891011121314151617181920212223242526
  1. // Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. import type { FieldResolverModule } from '#shared/entities/object-attributes/types/resolver.ts'
  3. import FieldResolver from '../FieldResolver.ts'
  4. export class FieldResolverActive extends FieldResolver {
  5. fieldType = 'toggle'
  6. // eslint-disable-next-line class-methods-use-this
  7. public fieldTypeAttributes() {
  8. return {
  9. props: {
  10. variants: {
  11. true: __('yes'),
  12. false: __('no'),
  13. },
  14. },
  15. }
  16. }
  17. }
  18. export default <FieldResolverModule>{
  19. type: 'active',
  20. resolver: FieldResolverActive,
  21. }