FieldNode #
@furo/furo-data v2.18.0
import '@furo/data/src/lib/FieldNode.js';
exports FieldNode js
superclass EventTreeNode
internal events #
- this-field-became-invalid, when a field gets invalid
- field-became-invalid bubbles, when a field gets invalid
- this-field-became-valid, when a field gets valid
- field-became-valid bubbles, when a field gets valid
- this-field-value-changed, when the value of a field changed
- field-value-changed bubbles, when the value of a field changed
- this-metas-changed, when the metas of a field changed
- metas-changed bubbles, when the meta of a field changed
- oneof-field-cleared, when a field in a oneof group was cleared
- oneof-field-changed, when a field in a oneof group was changed
- this-node-field-added, when a sub field was added to a field
- node-field-added bubbles, when a sub field was added to a field
- this-node-field-deleted, when a sub field was added to a field
- node-field-deleted bubbles, when a sub field was added to a field
- any-type-removed, fired before a node of type any changes its inner type
- any-type-created, fired when a node of type any is created or the type was changed
internal broadcasted events #
- parent-readonly-meta-set, when readonly was set on a parent field
Attributes and Properties #
defaultvalue #
Set the value of the field to the specified defaults.
_spec #
default: {type: vType}
Reference to the current spec definition of the fieldNode
_pristine #
default: true
Pristine state of the fieldNode, this is always set to true when new data is injected and is false if the value itself or the value of a child node gets changed.
_isValid #
default: true
Validity of the fieldNode, this is always set to true when new data is injected and is false if the value itself validates to false or the value of a child node validates to false.
Methods #
createField #
createField(options "fieldName"
) ⟹ void
create a field in a FieldNode, this is useful when using map<string,something> set the value option to init with values
- options :"name","type":"string", "spec":{..}} spec is optional
moveNode #
moveNode(oldIndex *newIndex*
) ⟹ void
- oldIndex
- newIndex
reinit #
reinit() ⟹ void
sets the field to the initial values from the spec default values are applied
_createVendorType #
_createVendorType(type `` ) ⟹ void
- type
_checkConstraints #
_checkConstraints(event `` ) ⟹ void
- event
_createAnyType #
_createAnyType(val `` ) ⟹ void
- val
_updateKeyValueMap #
_updateKeyValueMap(val *spec*
) ⟹ void
- val
- spec
deleteNode #
deleteNode() ⟹ void
deletes the fieldnode
_clearInvalidity #
_clearInvalidity() ⟹ void
_setState #
_setState(state `` ) ⟹ void
- state
toString #
toString() ⟹ void