Skip to content

Interface: FieldNode<Value, Output> ​

Defined in: core/src/nodes/node-types.ts:279

A node that holds one value.

Extends ​

  • NodeBase<Value, Output>

Type Parameters ​

Type ParameterDefault type
Value-
OutputValue

Properties ​

PropertyModifierTypeDescriptionInherited fromDefined in
attributesreadonlyFieldAttributes--core/src/nodes/node-types.ts:284
blurreadonly() => voidMarks the node as touched and starts checks that run on blur.NodeBase.blurcore/src/nodes/node-types.ts:252
clearErrorsreadonly(options?) => voidRemoves external errors in this subtree. Schema and rule errors follow their values.NodeBase.clearErrorscore/src/nodes/node-types.ts:268
descriptionIdreadonlystringId for a description element.-core/src/nodes/node-types.ts:283
errorIdreadonlystringId for the error message element. aria-describedby points at it while an error is visible.-core/src/nodes/node-types.ts:281
errorMessagereadonlystring | undefinedThe node's first visible error as text, from the form's formatError; undefined while none is visible. It is not cached, so a message translated in formatError follows the current language where it is read.NodeBase.errorMessagecore/src/nodes/node-types.ts:243
focusreadonly() => voidFocuses the element with this node's id, through the form's focusElement.NodeBase.focuscore/src/nodes/node-types.ts:271
handleSubmitreadonly(onValid, options?) => () => Promise<SubmitOutcome>Returns a submit function for this node. It skips while a submit runs, validates the subtree as validate does and either shows and focuses its errors and the checks that threw, or calls onValid with the output.NodeBase.handleSubmitcore/src/nodes/node-types.ts:262
idreadonlystringDOM id: the form id and the node's path.NodeBase.idcore/src/nodes/node-types.ts:235
kindreadonlyNodeKind-NodeBase.kindcore/src/nodes/node-types.ts:233
listErrorsreadonly(options?) => readonly ListedError[]-NodeBase.listErrorscore/src/nodes/node-types.ts:269
pathreadonlystringDotted path from the root. Array items appear by their current index.NodeBase.pathcore/src/nodes/node-types.ts:237
resetreadonly(options?) => voidReturns the subtree to its initial value, or makes options.value its new initial value.NodeBase.resetcore/src/nodes/node-types.ts:264
setErrorsreadonly(errors, options?) => voidSets external errors with paths relative to this node. They are visible at once.NodeBase.setErrorscore/src/nodes/node-types.ts:266
setValuereadonly(value) => voidWrites a draft value. undefined empties a field and removes its key from the parent's value.NodeBase.setValuecore/src/nodes/node-types.ts:250
statereadonlyNodeState<Value>-NodeBase.statecore/src/nodes/node-types.ts:238
subscribereadonly(listener) => () => voidCalls the listener once after a change to this node's state or path, or once per batch. Returns a function that unsubscribes.NodeBase.subscribecore/src/nodes/node-types.ts:248
validatereadonly() => Promise<ValidationResult<Output>>Validates the subtree, asks its checks again, waiting for any already running, and returns the result without making errors visible.NodeBase.validatecore/src/nodes/node-types.ts:257

Released under the MIT License.