File

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

Extends

DfBaseConfig

Index

Properties

Properties

headerType
Type HeaderType
Description

Defines the level of the HTML heading element and the visual appearance of the headline.

label
Type string
Description

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

type
Description

Specifies the type of the field as HEADLINE.

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

/**
 * The value to use for the `type` attribute of headline
 * formfield configs.
 */
export const DfHeadlineTypeName = 'HEADLINE';

export const HeaderType = {
  h1: 'h1',
  h2: 'h2',
  h3: 'h3'
} as const;
export type HeaderType = (typeof HeaderType)[keyof typeof HeaderType];

export type DfHeadlineConfig = HeadlineWithSublineConfig | HeadlineOnlyConfig;

export interface DfHeadlineBaseConfig extends DfBaseConfig {
  /**
   * Specifies the type of the field as `HEADLINE`.
   */
  type: typeof DfHeadlineTypeName;

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

  /**
   * Defines the level of the HTML heading element and the visual appearance of the headline.
   */
  headerType: HeaderType;
}

interface HeadlineWithSublineConfig extends DfHeadlineBaseConfig {
  /**
   * Defines the level of the HTML heading element and the visual appearance of the headline.
   */
  headerType: 'h1';

  /**
   * An optional subline only for headlines with headerType h1
   */
  subline?: string;
}

interface HeadlineOnlyConfig extends DfHeadlineBaseConfig {
  /**
   * Defines the level of the HTML heading element and the visual appearance of the headline.
   */
  headerType: 'h2' | 'h3';

  /**
   * An optional subline only for headlines with headerType h1
   */
  subline?: never;
}

results matching ""

    No results matching ""