File

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

Description

Configuration for a dynamic rating field.

Extends

Omit<DfInteractiveBaseConfig, 'hint' | 'note' | 'infoIcon'>

Index

Properties

Properties

endLabel (Optional)
Type string
Description

Option to set the label painted at the end of the rating component.

Defaults to empty

startLabel (Optional)
Type string
Description

Option to set the label painted at the start of the rating component.

Defaults to empty

type
Type typeof DfRatingTypeName
Description

Specifies the type of the field as RATING.

value (Optional)
Type "0" | "1" | "2" | "3" | "4" | "5"
Description

Option to set the selected rating 1 - 5.

Defaults to 0

onBlurEvent (Optional)
Type DfInteractiveEventConfig
Description

Configure either a PFE action or service activator configuration handler for the field's blur event.

onValueChangesEvent (Optional)
Type DfInteractiveEventConfig
Description

Configure either a PFE action or service activator configuration handler for the field's valueChanges event.

validators (Optional)
Type DynamicFormValidationConfig[]
Description

Validators to set on this form field.

acl (Optional)
Type DfFieldAcl[]
Description

ACL rules to be applied to this field.

columnSpan (Optional)
Type number
Description

This field's custom size.

Number of column(s) the element should span. It's only applicable with the "CUSTOM_COLUMN" layout. The value can be 1-12, following the 12-column grid system. The default value is 12.

id
Type string
Description

This field's ID.

The ID will serve as the ACL resource name for the form field. If the field is a form element, it will also be used as a form control name within the FormGroup to which it is added. IDs must be unique within your form.

Example :
infoIcon (Optional)
Type DfInfoIconConfig
Description

Info icon with associated pop-over.

label (Optional)
Type string
Description

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

Example :
onInitEvent (Optional)
Type DfInteractiveEventConfig
Description

Configure either a PFE action or service activator configuration handler when the field's ngOnInit method is triggered.

renderName (Optional)
Type string
Description

The optional renderName is added as the attribute "data-render-name" to the df-formfield elements in the DOM. It can be used to find the rendered element of a specific field of a form.

spacing (Optional)
Type DfFormfieldSpacing
Description

This field's custom spacing.

If defined, it will be used to set the spacing between this field and the next one.

testId (Optional)
Type string
Description

The id used to select the element in the tests (unit test, e2e testing)

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

/**
 * The value to use for the `type` attribute of rating
 * formfield configs.
 */
export const DfRatingTypeName = 'RATING';

/**
 * Configuration for a dynamic rating field.
 */
export interface DfRatingConfig
  extends Omit<DfInteractiveBaseConfig, 'hint' | 'note' | 'infoIcon'> {
  /**
   * Specifies the type of the field as `RATING`.
   */
  type: typeof DfRatingTypeName;

  /**
   * Option to set the label painted at the end of the rating component.
   *
   * Defaults to empty
   */
  endLabel?: string;

  /**
   * Option to set the label painted at the start of the rating component.
   *
   * Defaults to empty
   */
  startLabel?: string;

  /**
   * Option to set the selected rating 1 - 5.
   *
   * Defaults to 0
   */
  value?: 0 | 1 | 2 | 3 | 4 | 5;
}

results matching ""

    No results matching ""