Skip to main content

FormNodeUiControl

Optional state inputs and interaction hooks recognized by [formNode] on Angular 21 and 22.

Import

import type { FormNodeUiControl } from '@ngblocks/form-nodes';

When to use it

Use for the optional state inputs and interaction hooks shared by custom controls. It does not by itself supply the required value or checked model.

Declaration

type FormNodeUiControl<TValue, TNode extends AnyNode = FieldNode<TValue>> = {
disabled?: InputSignal<boolean> | InputSignalWithTransform<boolean, unknown>;
readonly?: InputSignal<boolean> | InputSignalWithTransform<boolean, unknown>;
hidden?: InputSignal<boolean> | InputSignalWithTransform<boolean, unknown>;
invalid?: InputSignal<boolean> | InputSignalWithTransform<boolean, unknown>;
pending?: InputSignal<boolean> | InputSignalWithTransform<boolean, unknown>;
touched?: InputSignal<boolean> | InputSignalWithTransform<boolean, unknown>;
dirty?: InputSignal<boolean> | InputSignalWithTransform<boolean, unknown>;
required?: InputSignal<boolean> | InputSignalWithTransform<boolean, unknown>;
errors?: InputSignal<readonly ValidationError[]> | InputSignalWithTransform<readonly ValidationError[], unknown>;
disabledReasons?: InputSignal<readonly DisabledReason[]> | InputSignalWithTransform<readonly DisabledReason[], unknown>;
name?: InputSignal<string> | InputSignalWithTransform<string, unknown>;
min?: InputSignal<NonNullable<TValue> | undefined> | InputSignalWithTransform<NonNullable<TValue> | undefined, unknown>;
max?: InputSignal<NonNullable<TValue> | undefined> | InputSignalWithTransform<NonNullable<TValue> | undefined, unknown>;
minLength?: InputSignal<number | undefined> | InputSignalWithTransform<number | undefined, unknown>;
maxLength?: InputSignal<number | undefined> | InputSignalWithTransform<number | undefined, unknown>;
pattern?: InputSignal<readonly RegExp[]> | InputSignalWithTransform<readonly RegExp[], unknown>;
touch?: OutputRef<void>;
focus?(options?: FocusOptions): void;
reset?(): void;
node?: WritableSignal<TNode | null>;
};

Type parameters

ParameterConstraintDefault
TValueUnconstrainedRequired
TNodeAnyNodeFieldNode<TValue>

Declared members

The declaration above also includes inherited contracts and overloads where applicable.

MemberMeaning
disabledNode disabled state.
readonlyNode readonly state.
hiddenNode hidden state.
invalidNode invalid state.
pendingNode pending state.
touchedNode touched state.
dirtyNode dirty state.
requiredNode required state.
errorsValidation errors on the bound node.
disabledReasonsActive disabled reasons and their originating nodes.
nameName of the bound node.
minActive minimum constraint.
maxActive maximum constraint.
minLengthActive minimum length.
maxLengthActive maximum length.
patternActive pattern constraints.
touchReports blur or another completed user interaction.
focusFocuses the component's interactive element.
resetClears component-owned transient UI state when the node resets.
nodeOptionally receives the bound node for direct state access.