File

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

Extends

Omit<DfBaseConfig, 'infoIcon' | 'columnSpan'>

Index

Properties

Properties

closable (Optional)
Type boolean
Description

Whether the notification can be closed by the user. Defaults to true if not specified.

closeButtonLabel (Optional)
Type string
Description

Custom label for the close button. If not provided, a default label based on the context will be used.

context
Type "info" | "error" | "success" | "warning"
Description

The styling context of the notification (e.g., info, success, warning, error).

message
Type string
Description

The message of the notification. It can be fully static or a string containing a jsonPath expression. The static content will be translatable. Use Markdown for formatting:

  • Italic: *text* or _text_
  • Bold: **text**
  • Bold Italic: ***text***
  • Strikethrough: ~~text~~
  • Underline: :u[text]
  • Links: [text](url)
Example :
 "My Message",
 "Text with *italic*, **bold**, ~~strikethrough~~, :u[underline]",
 "First name: {$['bb-pgr-simple'].person.firstName}. Full name: {$['bb-pgr-simple'].person.firstName} {$['bb-pgr-simple'].person.lastName}.",
 "text with [link](http://example.com) and list\n- item 1\n- [list link](http://example.com). Also supports dynamic data like: {$['bb-pgr-simple'].person.firstName}",
 "You can also link to internal pages by using the 'page://' prefix and the `pageId` inside a Markdown link, e.g. `[internal link](page://second-page)`"
]
title (Optional)
Type string
Description

The title of the notification. It can be fully static or a string containing a jsonPath expression. The static content will be translatable.

Example :
type
Type typeof DfNotificationTypeName
Description

Specifies the type of the field as NOTIFICATION.

visibleIf (Optional)
Type string
Description

An optional jsonPath expression or PFE_EXPRESSION condition that dictates whether this notification will be visible

Example :
acl (Optional)
Type DfFieldAcl[]
Description

ACL rules to be applied to this field.

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 :
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 { DfBaseConfig } from '@allianz/taly-core/dynamic-form';

/**
 * The value to use for the `type` attribute of notification
 * formfield configs.
 */
export const DfNotificationTypeName = 'NOTIFICATION';

export interface DfNotificationConfig extends Omit<DfBaseConfig, 'infoIcon' | 'columnSpan'> {
  /**
   * Specifies the type of the field as `NOTIFICATION`.
   */
  type: typeof DfNotificationTypeName;

  /**
   * The title of the notification. It can be fully static or a string containing a jsonPath expression. The static content will be translatable.
   * @examples ["My Title", "Note about postal addresses in {$.country}"]
   */
  title?: string;

  /**
   * The message of the notification. It can be fully static or a string containing a jsonPath expression. The static content will be translatable. Use Markdown for formatting:
   * - Italic: `*text*` or `_text_`
   * - Bold: `**text**`
   * - Bold Italic: `***text***`
   * - Strikethrough: `~~text~~`
   * - Underline: `:u[text]`
   * - Links: `[text](url)`
   *
   * @examples [
   *  "My Message",
   *  "Text with *italic*, **bold**, ~~strikethrough~~, :u[underline]",
   *  "First name: {$['bb-pgr-simple'].person.firstName}. Full name: {$['bb-pgr-simple'].person.firstName} {$['bb-pgr-simple'].person.lastName}.",
   *  "text with [link](http://example.com) and list\n- item 1\n- [list link](http://example.com). Also supports dynamic data like: {$['bb-pgr-simple'].person.firstName}",
   *  "You can also link to internal pages by using the 'page://' prefix and the `pageId` inside a Markdown link, e.g. `[internal link](page://second-page)`"
   * ]
   */
  message: string;

  /**
   * The styling context of the notification (e.g., info, success, warning, error).
   */
  context: 'info' | 'error' | 'success' | 'warning';

  /**
   * Whether the notification can be closed by the user.
   * Defaults to true if not specified.
   */
  closable?: boolean;

  /**
   * Custom label for the close button.
   * If not provided, a default label based on the context will be used.
   */
  closeButtonLabel?: string;

  /**
   * An optional jsonPath expression or PFE_EXPRESSION condition that dictates whether this notification will be visible
   * @examples ["$.section1.visible", "{$.bb1.person.firstName} == {$.bb2.person.firstName}"]
   */
  visibleIf?: string;
}

results matching ""

    No results matching ""