Constructor Summary
| Public Constructor | ||
| public |
constructor(sourceSchema: Schema, options: Object) |
|
Method Summary
| Public Methods | ||
| public |
[Symbol.iterator](): * |
|
| public |
Returns an Array of the matching items found in the Array according to the provided method |
|
| public |
Finds a matching item in the Array according to the provided method |
|
| public |
Loop through the Array |
|
| public |
Returns the Observable Item by the Index |
|
| public |
getLength(): Integer Returns the length of the Array. |
|
| public |
Determines if the provided item is in the Array |
|
| public |
Returns the index of the provided Observable Item |
|
| public |
Returns a transposed Array |
|
| public |
Moves an item from one index to another |
|
| public |
Removes the last item of the Array and returns that item |
|
| public |
Pushes an item onto the Array |
|
| public |
Removes any matching Items from the Array |
|
| public |
Reverses the Array order |
|
| public |
Sets the internal array of items |
|
| public |
Removes the first item of the Array and returns that item |
|
| public |
Returns a range of items from the Array |
|
| public |
Reorders the Array |
|
| public |
Removes a range of items from the Array and returns them |
|
| public |
Returns the Array of Observable Items |
|
| public |
Returns the Array of Objects |
|
| public |
Update the items within the Array. |
|
| public |
Returns an Array of the parsed values of each item |
|
| Private Methods | ||
| private |
_arrayState(): * |
|
| private |
_assign(values: *) |
|
| private |
_changed() |
|
| private |
_itemProp(): * |
|
| private |
_newItem(props: *): * |
|
Inherited Summary
| From class PropEvents | ||
| public |
|
|
| public |
isObservable: * |
|
| public |
parent: * |
|
| private |
_event: {} |
|
| public |
Unbinds an event listener |
|
| public |
Bind an event listener |
|
| private |
Calls event bubbling on the parent Observable |
|
| private |
async _processEvent(eventName: Event, target: Prop, additional: Object) Calls the listeners for the Event triggered |
|
Public Constructors
public constructor(sourceSchema: Schema, options: Object) source
Override:
PropEvents#constructorParams:
| Name | Type | Attribute | Description |
| sourceSchema | Schema | The Schema to be used as the shape of the items in the Array |
|
| options | Object | ||
| options.values | Object[] | The Array of initial values that will be consumed as Observables according to the Schema |
|
| options.parent | Object | The Parent Object to which this Array is a member of |
|
| options.name | String | The Name/key in the Parent Object to which this Array is assigned |
Public Methods
public filter(method: function(item: Object): Boolean): Boolean source
Returns an Array of the matching items found in the Array according to the provided method
public find(method: function(item: Object): Boolean): Object source
Finds a matching item in the Array according to the provided method
public get(idx: Integer): Object source
Returns the Observable Item by the Index
Params:
| Name | Type | Attribute | Description |
| idx | Integer |
|
The Index of the item to return (if null, all items are returned) |
public getLength(): Integer source
Returns the length of the Array. Used by the virtual property length
Return:
| Integer | length - The number of items in the Array |
public includes(value: Object | String | Number | Boolean): Boolean source
Determines if the provided item is in the Array
public indexOf(item: Object): Integer source
Returns the index of the provided Observable Item
Params:
| Name | Type | Attribute | Description |
| item | Object | The Observable Item to return the index of |
Return:
| Integer | index - The index of the found Observable Item |
public moveItem(indexes: Object, preventDefault: Boolean) source
Moves an item from one index to another
public pop(preventDefault: Boolean): Object source
Removes the last item of the Array and returns that item
Params:
| Name | Type | Attribute | Description |
| preventDefault | Boolean |
|
If true then the Change event is not fired |
public remove(items: Object[], preventDefault: Boolean): Boolean source
Removes any matching Items from the Array
public reverse(preventDefault: Boolean): Object[] source
Reverses the Array order
Params:
| Name | Type | Attribute | Description |
| preventDefault | Boolean |
|
If true then the Change event is not fired |
public set(props: Object[], preventDefault: Boolean): Object[] source
Sets the internal array of items
public shift(preventDefault: Boolean): Object source
Removes the first item of the Array and returns that item
Params:
| Name | Type | Attribute | Description |
| preventDefault | Boolean |
|
If true then the Change event is not fired |
public slice(idxFrom: Integer, idxTo: Integer): Object[] source
Returns a range of items from the Array
Params:
| Name | Type | Attribute | Description |
| idxFrom | Integer | The index of the first item to be selected |
|
| idxTo | Integer | The index of the last item to be selected |
public sort(sortMethod: function(a: Object, b: Object): Integer, preventDefault: Boolean): Object[] source
Reorders the Array
public splice(idx: Integer, toremove: Integer, props: Object[], preventDefault: Boolean): Object[] source
Removes a range of items from the Array and returns them
Params:
| Name | Type | Attribute | Description |
| idx | Integer | The index of the first item to be removed |
|
| toremove | Integer | The number of items to be removed |
|
| props | Object[] |
|
The array of objects (obeying the Schema) to inserted in the resulting gap |
| preventDefault | Boolean |
|
If true then the Change event is not fired |
public update(props: Object[], preventDefault: Boolean): Object[] source
Update the items within the Array. If an item has the same prop _id, then the item reference is preserved and the props are updated
Private Methods
private _assign(values: *) source
Params:
| Name | Type | Attribute | Description |
| values | * |
