Skip to content

Latest commit

 

History

History
98 lines (74 loc) · 2.99 KB

api.md

File metadata and controls

98 lines (74 loc) · 2.99 KB

Functions

collectValues(node, context, keyFieldName)

Looks for elements with the "ref" (or whatever other attribute then returns a map with the values inside those elements, with the string in the "ref" as the name. It also mark invalid values with Invalid symbol.

refs(node, keyFieldName)
refNodes(node, keyFieldName)
getFieldAndValue(event, context, keyFieldName)

Utility method that let you get the field name and value of the input field that is associated with an event

populateField(node, value)

Populate a single field in a normalized way

populateFields(baseNode, values)

Populate a whole form from a map of field names and values

collectValues(node, context, keyFieldName) ⇒

Looks for elements with the "ref" (or whatever other attribute then returns a map with the values inside those elements, with the string in the "ref" as the name. It also mark invalid values with Invalid symbol.

Kind: global function
Returns: the fields and _errors field with the list of erroneous values

Param Description
node start node to look within
context an optional context object that will be injected into a custom validator
keyFieldName optional alternative reference field name

refs(node, keyFieldName) ⇒

Kind: global function
Returns: array of elements that have the "ref" attribute

Param Description
node start search node
keyFieldName optional alternative reference field name

refNodes(node, keyFieldName) ⇒

Kind: global function
Returns: elements map by the ref name

Param Description
node
keyFieldName optional alternative reference field name

getFieldAndValue(event, context, keyFieldName)

Utility method that let you get the field name and value of the input field that is associated with an event

Kind: global function

Param Description
event the event
context optional context for the collectValue inner call
keyFieldName optional alternative to the "ref" attribute name

populateField(node, value)

Populate a single field in a normalized way

Kind: global function

Param Description
node the field's node
value the value

populateFields(baseNode, values)

Populate a whole form from a map of field names and values

Kind: global function

Param Description
baseNode the base of the form (doesn't have to be a Form element)
values the values