File

form-field/src/abstracts/form-field-control.ts

Description

Abstract class defining the requirements for a control implemented by a FormFieldComponent instance.

Index

Properties

Properties

Readonly clearValue
Type : function
Default value : () => {...}

clearValue is triggered when the user clicks the clear button in the FormField. It is the responsibility of the control to clear its value and take any other necessary actions.

Readonly dirty
Type : boolean
Default value : false

Determines whether the control is dirty. A control is considered dirty after the user has changed its value in the UI.

Readonly disabled
Type : boolean
Default value : false

Determines whether the control is disabled.

Readonly Optional formField
Type : FormFieldComponent

Reference to the enclosing FormField if available

Readonly Optional hasControlContainer
Type : boolean
Default value : false

Determines whether the control (Input, Date, Select, etc.) includes its own ControlContainer. Most controls are ok to use the FormField's ControlContainer, but some controls (e.g. Date) require their own ControlContainer, like Date, which has two separate input fields for date and time.

true → The FormField will not display a label, read-only icon (padlock), clear button etc. false → The FormField will display a label, read-only icon, clear button etc.

see DateComponent

Readonly hasFocus
Type : boolean
Default value : false

Determines whether the control has focus.

hasFocusWithin
Type : boolean
Default value : false

Determines whether the control or any element within has focus. Used to toggle clear button visibility.

Readonly hasScroll
Type : unknown
Default value : signal<boolean>(false)

Determines whether the control's content has scroll offset.

Readonly id
Type : string
Default value : ''

The control's id (the value used in the HTML element's id attribute).

Readonly invalid
Type : boolean
Default value : false

Determines whether the control's value is invalid.

Readonly isEmpty
Type : boolean
Default value : true

Determines whether the control contains a value.

Readonly readonlyState
Type : unknown
Default value : signal<boolean>(false).asReadonly()

Readonly state is typically set by the consuming app through a control's readonly input. In some cases we want to be able to control readonly state internally. For these cases we use a synchronized readonly state which reflects both, the value passed from the consuming app and the internal state.

Example :
// Implementation example
public readonlyState = computed(() => this.readonly() || myInternalReadonlyState());
Readonly required
Type : boolean
Default value : false

Determines whether the control's value is required.

Readonly showResetUi
Type : unknown
Default value : signal<boolean>(false).asReadonly()

Determines whether reset UI (tooltip and reset button) are displayed

Readonly stateChanges
Type : Observable<void>
Default value : new Observable<void>()

Observable, pushes an empty notification whenever the state of the control changes (e.g. when it gets focus).

Readonly touched
Type : boolean
Default value : false

Determines whether the control is touched. A control is considered touched after the user has triggered a 'blur' event on the control.

results matching ""

    No results matching ""