File

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

Description

Configuration for a dynamic radiobutton group field.

Extends

Omit

Index

Properties

Properties

label
Type string
Description

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

Example :
layout (Optional)
Type VerticalLayout | HorizontalLayout
Description

The layout of the field.

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.
Example :
type
Type unknown
Description

Specifies the type of the field as RADIO.

import { DfInteractiveBaseConfig, DfOptions } from '@allianz/taly-core/dynamic-form';
import type { VerticalLayout, HorizontalLayout } 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' | 'columnSpan'> {
  /**
   * 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;

  /**
   * The layout of the field.
   */
  layout?: VerticalLayout | HorizontalLayout;
}

results matching ""

    No results matching ""