File

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

Description

Configuration for a dynamic radiobutton group field.

Extends

Omit

Index

Properties

Properties

horizontalLayout (Optional)
Type boolean
Description

Option to enable horizontal layout via configuration

label
Type string
Description

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

options
Type DfOptions[] | string
Description

The "options" property can take one of two forms:

  1. A hardcoded array of objects for direct display in a radio group. Each object must have a "label" to display and a corresponding "value".
  2. A string that represents an expression. This expression is used by an option provider service to dynamically fetch the radio options.
type
Description

Specifies the type of the field as RADIO.

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

/**
 * The value to use for the `type` attribute of radiobutton group
 * formfield configs.
 */
export const DfRadioTypeName = 'RADIO';

/**
 * Configuration for a dynamic radiobutton group field.
 */
export interface DfRadioConfig extends Omit<DfInteractiveBaseConfig, 'hint'> {
  /**
   * Specifies the type of the field as `RADIO`.
   */
  type: typeof DfRadioTypeName;

  /**
   * 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;

  /**
   * The "options" property can take one of two forms:
   * 1. A hardcoded array of objects for direct display in a radio group. Each object must have a "label" to display and a corresponding "value".
   * 2. A string that represents an expression. This expression is used by an option provider service to dynamically fetch the radio options.
   *
   * @examples [[{"label": "The first option", "value": "1"}], "$.myExpression"]
   */
  options: DfOptions[] | string;

  /**
   * Option to enable horizontal layout via configuration
   */
  horizontalLayout?: boolean;
}

results matching ""

    No results matching ""