Interface: ArrayNode<Shape>
Defined in: core/src/nodes/node-types.ts:322
A node of an array. Errors, touched state and checks belong to items by key, so they move with them.
Extends
Type Parameters
| Type Parameter |
|---|
Shape |
Properties
| Property | Modifier | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|---|
blur | readonly | () => void | Marks the node as touched and starts checks that run on blur. | NodeBase.blur | core/src/nodes/node-types.ts:252 |
clearErrors | readonly | (options?) => void | Removes external errors in this subtree. Schema and rule errors follow their values. | NodeBase.clearErrors | core/src/nodes/node-types.ts:268 |
errorMessage | readonly | string | undefined | The 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.errorMessage | core/src/nodes/node-types.ts:243 |
focus | readonly | () => void | Focuses the element with this node's id, through the form's focusElement. | NodeBase.focus | core/src/nodes/node-types.ts:271 |
handleSubmit | readonly | (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.handleSubmit | core/src/nodes/node-types.ts:262 |
id | readonly | string | DOM id: the form id and the node's path. | NodeBase.id | core/src/nodes/node-types.ts:235 |
insert | readonly | (index, value) => void | - | - | core/src/nodes/node-types.ts:327 |
items | readonly | readonly (NodeOf<ShapeAt<Shape, `${number}`>> & ArrayItem)[] | - | - | core/src/nodes/node-types.ts:325 |
kind | readonly | NodeKind | - | NodeBase.kind | core/src/nodes/node-types.ts:233 |
listErrors | readonly | (options?) => readonly ListedError[] | - | NodeBase.listErrors | core/src/nodes/node-types.ts:269 |
move | readonly | (from, to) => void | - | - | core/src/nodes/node-types.ts:329 |
path | readonly | string | Dotted path from the root. Array items appear by their current index. | NodeBase.path | core/src/nodes/node-types.ts:237 |
push | readonly | (value) => void | - | - | core/src/nodes/node-types.ts:326 |
remove | readonly | (index) => void | - | - | core/src/nodes/node-types.ts:328 |
replace | readonly | (values) => void | - | - | core/src/nodes/node-types.ts:331 |
reset | readonly | (options?) => void | Returns the subtree to its initial value, or makes options.value its new initial value. | NodeBase.reset | core/src/nodes/node-types.ts:264 |
setErrors | readonly | (errors, options?) => void | Sets external errors with paths relative to this node. They are visible at once. | NodeBase.setErrors | core/src/nodes/node-types.ts:266 |
setValue | readonly | (value) => void | Writes a draft value. undefined empties a field and removes its key from the parent's value. | NodeBase.setValue | core/src/nodes/node-types.ts:250 |
state | readonly | NodeState<DraftOf<Shape>> | - | NodeBase.state | core/src/nodes/node-types.ts:238 |
subscribe | readonly | (listener) => () => void | Calls the listener once after a change to this node's state or path, or once per batch. Returns a function that unsubscribes. | NodeBase.subscribe | core/src/nodes/node-types.ts:248 |
summaryId | readonly | string | Id for an error summary element, focused by a submit with shouldFocusError: 'summary'. | - | core/src/nodes/node-types.ts:324 |
swap | readonly | (first, second) => void | - | - | core/src/nodes/node-types.ts:330 |
validate | readonly | () => Promise<ValidationResult<OutputOf<Shape>>> | Validates the subtree, asks its checks again, waiting for any already running, and returns the result without making errors visible. | NodeBase.validate | core/src/nodes/node-types.ts:257 |