Skip to main content

DisabledReason

Identifies one active cause of a node's disabled state.

Import

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

When to use it

Use when presenting or inspecting why a node is disabled. Preserve the originating node information when distinguishing local and inherited causes.

Declaration

type DisabledReason<TNode extends AnyNode = AnyNode> = {
readonly sourceNode: TNode;
readonly message?: string;
};

Type parameters

ParameterConstraintDefault
TNodeAnyNodeAnyNode

Declared members

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

MemberMeaning
sourceNodeNode on which this reason originated. Descendants retain the original source node.
messageOptional user-facing explanation supplied by the disabled option or disable().