Notification class
📖 Description
The Notification
class defines a notification control for the Tripetto builder. It is derived from the Control
class.
📺 Preview
🆕 constructor
Creates a new Notification
instance.
Signature
constructor(
label: string,
type?: "normal" | "info" | "success" | "warning" | "error",
style?: INotificationStyle
): Notification
Parameters
Name | Type | Optional | Description |
---|---|---|---|
label | string | No | Specifies the label to show. |
type | "normal" | "info" | "success" | "warning" | "error" | Yes | Specifies the type. |
style | INotificationStyle | Yes | Specifies the notification style (when omitted the default global style will be used). |
Return value
Returns a reference to the new Notification
instance.
📌 Statics
🏷️ style
Contains the global default style for the notification control.
Type
🗃️ Fields
🏷️ isDisabled
Sets or retrieves if the control is disabled.
Type
boolean
🏷️ isVisible
Sets or retrieves the visibility of the control.
Type
boolean
🏷️ notificationType
Sets or retrieves the notification type.
Type
"normal" | "info" | "success" | "warning" | "error"
🏷️ style
Contains the style for the notification control.
Type
▶️ Methods
🔧 disable
Disables the control.
Signature
disable(): this
Return value
Returns a reference to the Notification
instance to allow chaining.
🔧 disabled
Specifies the state of the control.
Signature
disabled(disabled?: boolean): this
Parameters
Name | Type | Optional | Description |
---|---|---|---|
disabled | boolean | Yes | Specifies if the control is disabled (default is true ). |
Return value
Returns a reference to the Notification
instance to allow chaining.
🔧 enable
Enables the control.
Signature
enable(): this
Return value
Returns a reference to the Notification
instance to allow chaining.
🔧 hide
Hides the control.
Signature
hide(): this
Return value
Returns a reference to the Notification
instance to allow chaining.
🔧 indent
Enables control indentation. This can only be set during construction.
Signature
indent(size: number): this
Parameters
Name | Type | Optional | Description |
---|---|---|---|
size | number | No | Specifies the indent size in pixels. |
Return value
Returns a reference to the Notification
instance to allow chaining.
🔧 show
Shows the control.
Signature
show(): this
Return value
Returns a reference to the Notification
instance to allow chaining.
🔧 type
Specifies the notification type.
Signature
type(type: "normal" | "info" | "success" | "warning" | "error"): this
Parameters
Name | Type | Optional | Description |
---|---|---|---|
type | "normal" | "info" | "success" | "warning" | "error" | No | Specifies the type. |
Return value
Returns a reference to the Notification
instance to allow chaining.
🔧 visible
Specifies the visibility of the control.
Signature
visible(visible?: boolean): this
Parameters
Name | Type | Optional | Description |
---|---|---|---|
visible | boolean | Yes | Specifies if the control is visible (default is true ). |
Return value
Returns a reference to the Notification
instance to allow chaining.
⛓️ Interfaces
🔗 INotificationStyle
Describes the interface for the notification styles.
Type declaration
interface INotificationStyle {
/* Notification appearance. */
appearance?: IStyles;
/* Notification appearance when fused with the form card. */
fused?: IStyles;
/* Normal notification. */
normal?: IStyles;
/* Info notification. */
info?: IStyles;
/* Success notification. */
success?: IStyles;
/* Warning notification. */
warning?: IStyles;
/* Error notification. */
error?: IStyles;
}