File

libs/core/dynamic-form/switcher/src/switcher.model.ts

Description

Configuration for a dynamic input field.

Extends

DfInteractiveBaseConfig

Index

Properties

Properties

label
Type string
Description

This field's label. It's translatable by default and supports string interpolation.

labelPosition (Optional)
Type SwitcherLabelPosition
Description

Sets the label position to be on the left or right. Default is left.

size (Optional)
Type SwitcherSize
Description

Sets the switcher size to be small or large. Default is small.

type
Description

Specifies the type of the field as SWITCHER.

import { DfInteractiveBaseConfig } from '@allianz/taly-core/dynamic-form';

/**
 * The value to use for the `type` attribute of switcher formfield configs.
 */
export const DfSwitcherTypeName = 'SWITCHER';

/**
 * Configuration for a dynamic input field.
 */
export interface DfSwitcherConfig extends DfInteractiveBaseConfig {
  /**
   * Specifies the type of the field as `SWITCHER`.
   */
  type: typeof DfSwitcherTypeName;

  /**
   * This field's label.
   * It's translatable by default and supports string interpolation.
   * @examples ["My label", "My label {$['bb-pgr-simple'].person.firstName}"]
   */
  label: string;

  /**
   * Sets the label position to be on the left or right. Default is left.
   */
  labelPosition?: SwitcherLabelPosition;

  /**
   * Sets the switcher size to be small or large. Default is small.
   */
  size?: SwitcherSize;
}

export const SwitcherLabelPosition = {
  Left: 'left',
  Right: 'right'
} as const;
type SwitcherLabelPosition = (typeof SwitcherLabelPosition)[keyof typeof SwitcherLabelPosition];

export const SwitcherSize = {
  Small: 'small',
  Large: 'large'
} as const;
type SwitcherSize = (typeof SwitcherSize)[keyof typeof SwitcherSize];

results matching ""

    No results matching ""