Module: childApplicators

Containers conceived to represent JSON Schema child applicators, as they are described by the JSON Schema RFC Draft.

Source:

Classes

AdditionalItems
AdditionalProperties
ArrayHandler
ChildrenHandler
Items
ObjectHandler
Properties

Interfaces

ChildApplicator

Methods

(inner) addChildToApplicator(index, child, childApplicator)

Adds a child form element to a child applicator container, updating the buttons state.

Parameters:
Name Type Description
index number

The key identifying the child form element in the child applicator container.

child module:formElement~FormElement

The child form element to add to the child applicator container.

childApplicator module:childApplicators~ChildApplicator

The child applicator container which the child form element will be added to.

Source:
Modifies:

(inner) additionalItemsMinimumChildren(parent) → {number}

Returns the minimum number of children that the module:childApplicators.AdditionalItems container of a given JSON Schema form element must have at initialization.

Parameters:
Name Type Description
parent module:formElement~FormElement

The parent JSON Schema form element.

Source:
Returns:

The minimum number of children that the container must have at initialization.

Type
number

(inner) additionalPropertiesMinimumChildren(parent) → {number}

Returns the minimum number of children that the module:childApplicators.AdditionalProperties container of a given JSON Schema form element must have at initialization.

Parameters:
Name Type Description
parent module:formElement~FormElement

The parent JSON Schema form element.

Source:
Returns:

The minimum number of children that the container must have at initialization.

Type
number

(inner) createAdditionalItem(parent, index, removeCallback) → {module:formElement~FormElement}

Creates a JSON Schema form element to be added into the additionalItems child applicator.

Parameters:
Name Type Description
parent module:formElement~FormElement

The parent JSON Schema form element.

index number

The key identifying the child form element.

removeCallback function

The callback function to be called if the newly created element is removed.

Source:
Returns:

The child JSON Schema form element.

Type
module:formElement~FormElement

(inner) createAdditionalProperty(parent, index, removeCallback) → {module:formElement~FormElement}

Creates a JSON Schema form element to be added into the additionalProperties child applicator.

Parameters:
Name Type Description
parent module:formElement~FormElement

The parent JSON Schema form element.

index number

The key identifying the child form element.

removeCallback function

The callback function to be called if the newly created element is removed.

Source:
Returns:

The child JSON Schema form element.

Type
module:formElement~FormElement

(inner) createItem(parent, index, removeCallback) → {module:formElement~FormElement}

Creates a JSON Schema form element to be added into the items child applicator.

Parameters:
Name Type Description
parent module:formElement~FormElement

The parent JSON Schema form element.

index number

The key identifying the child form element.

removeCallback function

The callback function to be called if the newly created element is removed.

Source:
Returns:

The child JSON Schema form element.

Type
module:formElement~FormElement

(inner) createProperty(schema, propertyKey, parent, index) → {module:formElement~FormElement}

Creates a JSON Schema form element to be added into the properties child applicator.

Parameters:
Name Type Description
schema object

The JSON Schema of the property to be expressed by the child form element.

propertyKey string

The key of the property to be expressed by the child form element.

parent module:formElement~FormElement

The parent JSON Schema form element.

index number

The key identifying the child form element.

Source:
Returns:

The child JSON Schema form element.

Type
module:formElement~FormElement

(inner) removeChildFromApplicator(index, childApplicator)

Removes a child form element from a child applicator container, updating the buttons state.

Parameters:
Name Type Description
index number

The key identifying the child form element in the child applicator container.

childApplicator module:childApplicators~ChildApplicator

The child applicator container which the child form element will be removed from.

Source:
Modifies:

(inner) updateAddButtons(handler)

Updates the state of the add buttons associated to the child applicator containers of a handler.

Parameters:
Name Type Description
handler module:childApplicators~ChildrenHandler

The handler whose buttons are to be updated.

Source:
Modifies:

(inner) updateButtons(handler)

Updates the state of add and remove buttons associated to child applicator containers and form elements of a handler.

Parameters:
Name Type Description
handler module:childApplicators~ChildrenHandler

The handler whose buttons are to be updated.

Source:
Modifies:

(inner) updateRemoveButtons(handler)

Updates the state of the add buttons associated to the child form elements of a handler.

Parameters:
Name Type Description
handler module:childApplicators~ChildrenHandler

The handler whose buttons are to be updated.

Source:
Modifies:

(inner) yieldNewAdditionalItemState(parent) → {module:formElementDefinitions~State}

Returns the state that should hold a newly created child of a given module:childApplicators.AdditionalItems container.

Parameters:
Name Type Description
parent module:formElement~FormElement

The parent JSON Schema form element.

Source:
Returns:

An object indicating the state to be hold by a newly created child.

Type
module:formElementDefinitions~State

(inner) yieldNewAdditionalPropertyState(parent) → {module:formElementDefinitions~State}

Returns the state that should hold a newly created child of a given module:childApplicators.AdditionalProperties container.

Parameters:
Name Type Description
parent module:formElement~FormElement

The parent JSON Schema form element.

Source:
Returns:

An object indicating the state to be hold by a newly created child.

Type
module:formElementDefinitions~State

(inner) yieldNewItemState(parent) → {module:formElementDefinitions~State}

Returns the state that should hold a newly created child of a given module:childApplicators.Items container.

Parameters:
Name Type Description
parent module:jsonSchema.JsonSchema

The parent JSON Schema form element.

Source:
Returns:

An object indicating the state to be hold by a newly created child.

Type
module:formElementDefinitions~State

(inner) yieldNewPropertyState(parent, childElementType) → {module:formElementDefinitions~State}

Returns the state that should hold a newly created child of a given module:childApplicators.Properties container.

Parameters:
Name Type Description
parent module:formElement~FormElement

The parent JSON Schema form element.

childElementType string

The module:formElementDefinitions.ElementType of the newly created child.

Source:
Returns:

An object indicating the state to be hold by a newly created child.

Type
module:formElementDefinitions~State