### spectre-canjs

`1.0.0`
Need help reading this?

## UI Components

Components for building user interfaces

### sp-accordion

A virtical navigation accordion component

sp-accordion

Extends sp-tab-container

Example

    <sp-accordion />

### sp-accordion-page

An accordion page

sp-accordion-page

Extends sp-tab-page

Example

    <sp-accordion-page />

### sp-confirm

A confirm dialog box with options for accepting or rejecting

sp-confirm
Example

    <sp-confirm />

Static Members
▸ new ViewModel()

A `<sp-confirm />` component's ViewModel

new ViewModel()

Extends sp-modal.ViewModel

Instance Members
▸ acceptText

The text to display in the accept confirmation button. The default is `'Ok'`

acceptText
▸ rejectText

The text to display in the reject confirmation button. The default is `'Cancel'`

rejectText
▸ actionPromise

A promise resolved or rejected when the modal is confirmed or rejected.

actionPromise
▸ onAccept()

Called when the accept button is clicked. Resolves the `actionPromise`. In addition, the `accept` event is dispatched on the component element.

onAccept()
▸ onReject()

Called when the reject button is clicked. Rejects the `actionPromise`. In addition, the `reject` event is dispatched on the component element.

onReject()

### sp-dropdown

Inserts a dropdown toggle button into the page. Consider using spectre.css css-only dropdowns instead

new sp-dropdown()
Deprecated: This is deprecated.
Example

    <sp-dropdown />

Static Members
▸ new ViewModel()

Dropdown View Model

new ViewModel()
Static Members
▸ iconClass

The icon class to display next to the dropdown.
The default is a font-awesome caret `fa fa-fw fa-caret-down`

iconClass
Example

    iconClass:from="'fa fa-fw fa-table'"

▸ text

The text to display in the dropdown button

text
▸ visible

The current state of the dropdown menu

visible
▸ buttonClass

The button class to apply to the button dropdown. The default is `btn btn-link`. See the spectre.css styles for details on more button classes available

buttonClass
▸ primaryButtons

An array of buttons to display next to the dropdown button. This creates a split dropdown menu button group

primaryButtons
▸ right

Whether or not to align this dropdown menu on the right hand side of the button.

right
Instance Members
▸ toggle(ev, val)

toggles the display of a sp-dropdown component

toggle(ev: Event, val: Boolean): Boolean
Parameters
ev `(Event)` (event) the click event to cancel
val `(Boolean)` optional - whether or not to display the menu, if undefined the dropdown will toggle the current visibility
Returns
`Boolean`: always returns false to prevent page navigation from occuring
▸ hideAll()

Queries the dom for other sp-dropdown components and hides them. This is used when a dropdown component is visible and another one is clicked, any others will be made invisible

hideAll()
▸ onPrimaryClick(button, event)

When a primary button is clicked, this function dispatches the `primaryclick` event with the button that was clicked as its argument.

onPrimaryClick(button: ButtonObject, event: MouseEvent): Boolean
Parameters
button `(ButtonObject)` the button that was clicked
event `(MouseEvent)` The mouse click event on the button that we should prevent default
Returns
`Boolean`: returns false to prevent event from changing page route

### sp-file-list

A formatted list of files with slots for actions. Images are displayed if available.

sp-file-list
Example

    <sp-file-list />

Static Members
▸ new ViewModel()

A `<sp-file-list />` component's ViewModel

new ViewModel()
Instance Members
▸ files

A list of file objects

files
▸ isImage(file)

Tests a file objects `id` property for image type extension

isImage(file: FileObject): Boolean
Parameters
file `(FileObject)` The file object
Returns
`Boolean`: whether or not the `file.id` name is a file

### sp-modal

A modal dialog

sp-modal
Example

    <sp-modal />

Static Members
▸ new ViewModel()

A `<sp-modal />` component's ViewModel

new ViewModel()
Instance Members
▸ active

Whether or not this modal is currently active. The default is `false`

active
▸ customBody

Whether or not to use a custom body content for the modal. The default is `false`. This overrides the title property and modal-body divs displayed by displaying only the content passed to the `<sp-modal></sp-modal>` component

customBody
▸ small

Flag to make this modal a small (`modal-sm`) modal. The default is `false`

small
▸ backdrop

Whether or not to display this modals backdrop. The default is `true`.

backdrop
▸ show()

Shows this modal

show()
▸ hide()

Hides this modal

hide()
▸ toggle(visible)

Toggles the state of this modal visibility

toggle(visible: Boolean)
Parameters
visible `(Boolean)` An optional property to set the visible state to

### sp-paginate

A paginate ui component

sp-paginate
Example

    <sp-paginate />

Static Members
▸ new ViewModel()

A `<sp-paginate />` component's ViewModel

new ViewModel()
Instance Members
▸ pages

The number of pages to show in the widget

pages
▸ activePageIndex

The active page index

activePageIndex
▸ activeOffset

The number of pages to show on either side of the currently selected page. The default is 3. For example, if the selected page is 5, the visible pages should be 2,3,4,5,6,7,8.

activeOffset
▸ hasNext

A virtual property used by the template to indicate whether or not there is a next page

hasNext
▸ hasPrevious

A virtual property used by the template to indicate whether or not there is a previous page

hasPrevious
▸ visiblePages

The array of currently shown pages in the widget

visiblePages
▸ pageArray

The array of numbers 0 through number of pages. This is a helper for the visiblePages getter

pageArray
▸ hideFirst

Hides the first button

hideFirst
▸ hideLast

Hides the last button

hideLast
▸ hidePrevious

Hides the previous button

hidePrevious
▸ hideNext

Hides the next button

hideNext
▸ hidePages

Hides the list of pages

hidePages
▸ gotoNext()

Navigates to the next page

gotoNext(): Boolean
Returns
`Boolean`: returns false to prevent the link from navigating to the next page
▸ gotoPrevious()

Navigates to the previous page

gotoPrevious(): Boolean
Returns
`Boolean`: returns false to prevent the link from navigating to the next page
▸ gotoFirst()

Navigates to the first page

gotoFirst(): Boolean
Returns
`Boolean`: returns false to prevent the link from navigating to the next page
▸ gotoLast()

Navigates to the last page

gotoLast(): Boolean
Returns
`Boolean`: returns false to prevent the link from navigating to the next page
▸ gotoPage(p)

Navigates to the page

gotoPage(p: Number): Boolean
Parameters
p `(Number)` The page index to navigate to
Returns
`Boolean`: returns false to prevent the link from navigating to the next page
▸ isActive(p)

Checks to see if the passed page is the active page index

isActive(p: Number): Boolean
Parameters
p `(Number)` The page to check
Returns
`Boolean`: Returns a boolean value that tells the template whether or not the passed page is the active page

### sp-tab-page

Tab page component used in the sp-tab-container for navigation

sp-tab-page
Example

    <sp-tab-page />

Static Members
▸ new ViewModel()

A `<sp-tab-page />` component's ViewModel

new ViewModel()
Instance Members
▸ active

The display state of the page. If true, the page content will be shown

active
▸ classes

Add custom classes to the navigation containers nav tab.

classes
▸ label

The label to display in the memberof container tab

label
▸ loading

Whether or not this page is currently loading

loading
▸ pageId

A unique id to identify this page. The default is automatically provided.

pageId
▸ parent

The parent containers view model

parent

### sp-tab-container

A navigation container for navigating between tabbed pages

new sp-tab-container()
Example

    <sp-tab-container />

Static Members
▸ new ViewModel()

A `<sp-tab-container />` component's ViewModel

new ViewModel()
Instance Members
▸ pages

An array of pages currently displayed in this sp-tab-container

pages
▸ activePage

The currently active page

activePage
▸ activeId

The id of the page that is currently active. This value should be set to change the activePage

activeId
▸ addPage(page)

When a `<sp-tab-page>` element is inserted into the document, it calls this method to add the page's scope to thepages array.

addPage(page: sp-tab-page.ViewModel)
Parameters
page `(sp-tab-page.ViewModel)` the page view model that was added
▸ removePage(page)

When a `<page>` element is removed from the document, it calls this method to remove the page's scope from the pages array.

removePage(page: sp-tab-page.ViewModel)
Parameters
page `(sp-tab-page.ViewModel)` the page view model to remove
▸ makeActive(page)

Sets a page to the currently selected/active page

makeActive(page: sp-tab-page.ViewModel)
Parameters
page `(sp-tab-page.ViewModel)` The page to set as the active page
▸ toggle(page)

Used by nav containers that might need to toggle pages, rather than just activate them (accordion)

toggle(page: sp-tab-page.ViewModel)
Parameters
page `(sp-tab-page.ViewModel)` the page to toggle
▸ isActive(page)

Used to check whether the current page is the active page

isActive(page: sp-tab-page.ViewModel): Boolean
Parameters
page `(sp-tab-page.ViewModel)` The page to check whether is active
Returns
`Boolean`: whether or not the page is active

### body

The content displayed in the toast. The default is an empty string.

body

### sp-toast

A hideable notification component

sp-toast
Static Members
▸ new ViewModel()

A `<sp-toast />` component's ViewModel

new ViewModel()
Instance Members
▸ fade

whether or not to fade the sp-toast out using animate.css

fade
▸ autoHide

the time to autohide this sp-toast. Set to 0 to disable auto hide

autoHide
▸ useContentTag

Whether or not to use the content tag, that will display whatever is inside the `<sp-toast></sp-toast>` tags. This overrides the body property of this sp-toast

useContentTag
▸ severity

The class that gives the sp-toast context. Must be either info, success, warning, or danger.

severity
▸ dismissable

Marks the sp-toast as dismissable, which adds a "close" icon to the sp-toast. The default is true

dismissable
▸ iconClass

Displays a helpful icon next to the toast text Set to `null` or empty string to exclude icon completely. The default is `icon icon-error_outline`

iconClass
▸ visible

Toggles visiblity of the sp-toast. The default is false.

visible
▸ heading

Optional. The title of the sp-toast. The default is an empty string.

heading
▸ fadeTime

Time in miliseconds to fade out this sp-toast

fadeTime
▸ hide()

Hide this sp-toast

hide()

### sp-toast-container

A controller that adds and removes toasts from the dom

sp-toast-container
Example

    <sp-toast-container />

Static Members
▸ ViewModel

A `<sp-toast-container />` component's ViewModel

ViewModel
Instance Members
▸ toasts

An array of alert toasts

toasts
▸ addToast(toast)

adds a new toast

addToast(toast: sp-toast.ViewModel)
Parameters
toast `(sp-toast.ViewModel)` the toast options or toast object to add
▸ removeToast(toast)

Removes a toast

removeToast(toast: sp-toast.ViewModel)
Parameters
toast `(sp-toast.ViewModel)` the toast object to remove

## Data components

Components for managing and viewing data

### sp-filter

A filter component for creating complex filters

sp-filter
Example

    <sp-filter />

Static Members
▸ new ViewModel()

A `<sp-filter />` component's ViewModel

new ViewModel()
Instance Members
▸ filter

The filter object to modify

filter
▸ noOp(event)

A no operation function

noOp(event: Event): False
Parameters
event `(Event)` the event to preventDefault on
Returns
`False`: return false to prevent page navigation from occuring
▸ dispatchEvent(event)

Dispatches an event with the filter object

dispatchEvent(event: String)
Parameters
event `(String)` The event name to dispatch

### sp-filter-builder

A component for allowing users to create complex filters

sp-filter-builder
Example

    <sp-filter-builder />

Static Members
▸ new Filter()

Creates a new filter

new Filter()
Instance Members
▸ value

A value to filter on. Can be any primitive type. If the [sp-filter-builder.Filter.props.field `field`] property is set, the `field.type` property will be used to coerce the value.

value
▸ name

The name of the field to filter on

name
▸ operator

The operator to filter with. The default is `like`.

operator
▸ operatorField

A field object that defines the available operator options and properties. This is used to create the dropdown choice for each filter in the sp-filter-builder. This field is generated automatically. If the [sp-filter-builder.Filter.props.field `field`] property is set, the `field.type` property will be used to filter the operator options.

operatorField
▸ visible

A property to show or hide this filter in the picker. The default is `true`

visible
▸ pinned

A property to disable this filter's remove button. This filter will not be removable. In addition, the operator field will be fixed. The default is `false`.

pinned
▸ alias

A virtual property to provide the field alias. If the [sp-filter-builder.Filter.props.field `field`] property is set, this alias will match the `field.alias`

alias
▸ valueField

A field object that defines the value field properties. This is used to create the value field for each filter in the sp-filter-builder. If the [sp-filter-builder.Filter.props.field `field`] property is set, the valueField will be a customized field based off of the set field.

valueField
▸ field

The field object used to initialize this filter. When this value is provided, the custom field will be used in place of the regular text field. This allows the user to interract with a different type of field, like a checkbox when setting filters.

field
▸ object

A virtual property that creates a dummmy form object for use with the field template

object
▸ setField(field, dom, scope, props)

a setter for the value field for use with the field template

setField(field: util/field/Field, dom: domElement, scope: Object, props: any)
Parameters
field `(util/field/Field)` the field object
dom `(domElement)` the input element
scope `(Object)` the view model scope
props `(any)` the object with the value set on the form
▸ new FilterList()

Creates a new filter list

new FilterList()
▸ new ViewModel()

A `<sp-filter-builder />` component's ViewModel.

new ViewModel()
Instance Members
▸ disableCreate

Disabled the add new form if true

disableCreate
▸ excludeFieldKey

A string referencing a field type that will exclude that field from this classes fields. The default is 'list'.

excludeFieldKey
▸ filters

A list of filterObjects currently used in this widget

filters
▸ nameField

The field properties for the field name dropdown

nameField
▸ fieldOptions

An array of field options to display for the field selection dropdown.

fieldOptions
▸ fieldValue

The selected field dropdown value

fieldValue
▸ removeFilter(obj)

Removes a filter from the list of filters

removeFilter(obj: sp-filter-builder.Filter): undefined
Parameters
obj `(sp-filter-builder.Filter)` The object to remove. This is the only argument used by the function, the rest may be null.
Returns
`undefined`:
▸ removeFilters()

Replaces the filter array with an empty array, clearing all existing filters

removeFilters(): undefined
Returns
`undefined`:
▸ addFilter(args)

Adds a new filter or set of filters to the list of filters in this widget.
TODO: A `filterFactory` may be defined on the field which may return one filter or an array of filters.

addFilter(args: string): Boolean
Parameters
args `(string)` the array of arguments from the fieldchange event
Returns
`Boolean`: returns false to prevent event propagation from links

### sp-list-table

A table to hold an array of objects - one object per row

sp-list-table
Example

    <sp-list-table />

Static Members
▸ new ViewModel()

A `<sp-list-table />` component's ViewModel.

new ViewModel()
Instance Members
▸ excludeFieldKey

A string referencing a field type that will exclude that field from this classes fields. The default is 'list'.

excludeFieldKey
▸ promise

Optional promise or deferred object that will resolve to an object. Once the promise resolves, the objects list will be replaced with the promise result

promise
▸ objects

A list of objects to display. These objects should generally be can.Model objects but may be an javascript object.

objects
▸ object

A virtual type that retrieves this table's first object

object
▸ idProp

Id type name for the rows of objects. The default is `id`. This value is used to determine whether objects are selected or not. For a built in unique ID, `_cid` may be used. _cid is automatically generatted by `can-define` and should be guaranteed to be unique accross all DefineMaps

idProp
▸ selectable

Whether rows can be selectable using a checkbox

selectable
▸ selectedObjects

A list of the currently selected objects in the table

selectedObjects
▸ selectedIds

An array of ids for the selected objects. This is a virtual type and cannot be set.

selectedIds
▸ _allSelected

A virtual type that helps the template determine whether all objects are selected

_allSelected
▸ currentSort

The current sort field

currentSort
▸ dispatchEvent(event)

Dispatches an event with the name of the passed argument. Any additional arguments will be passed to the event handler

dispatchEvent(event: String)
Parameters
event `(String)` The name of the event to dispatch
▸ setSort(field, event)

Helps the template the currentSort value

setSort(field: String, event: Event)
Parameters
field `(String)` the field to set the sort on
event `(Event)` the event to cancel
▸ toggleSelected(obj)

Toggles a row as selected or not selected

toggleSelected(obj: Object)
Parameters
obj `(Object)` The row to toggle
▸ toggleSelectAll()

Selects or unselects all of the objects in the table

toggleSelectAll()
▸ isSelected(obj)

Determines whether or not the provided object is selected by comparing it to the list of currently selected objects

isSelected(obj: Object): Boolean
Parameters
obj `(Object)` The object to check if is selected
Returns
`Boolean`: Whether or not it is selected
▸ sort(sortInfo)

A function that sorts the list. It is called with the scope of the view model.

sort(sortInfo: Object)
Parameters
sortInfo `(Object)` The sorting object which contains `field` and `type`

### sp-property-table

A two column table for displaying Field:value object pairs

sp-property-table
Example

    <sp-property-table />

Static Members
▸ new ViewModel()

A `<sp-property-table />` component's ViewModel. This viewmodel extends the [util/field/ ]'s properties

new ViewModel()
Instance Members
▸ excludeFieldKey

A string referencing a field property that will exclude that field from this classes fields. The default is 'detail'.

excludeFieldKey
▸ edit

A flag to allow editing (Not yet implemented) TODO: implement editing

edit
▸ delete

A flag to allow deleting (Not yet implemented) TODO: implement deleting

delete
▸ objectId

The ID value of the object that should be retrieved. This value along with the connection object will be used to retrieve an object from a RESTful service

objectId
▸ connection

The connection object that should be used to retrieve an object. This value along with the objectId value will be used to retrieve an object from a RESTful service

connection
▸ object

A generic object to display in a tabular format. This can be used instead of providing a connection and objectId property

object
▸ objectPromise

A promise that resolves to the object. Used to determine state of current fetching operations

objectPromise
▸ fetchObject(con, id)

Asynchronously fetches an object using a can-connect model and an id

fetchObject(con: can-connect, id: Number): Promise
Parameters
con `(can-connect)` The connection object to an api resource. The model must have a `get(id)` method.
id `(Number)` The id number of the object to retrieve
Returns
`Promise`: A promise that is resolved once the object is retreived

## Field/Form Components

Field components for modifying and creating data. Use with sp-form.

### sp-form

A form component useful for validation, data updating, and dirty checking

new sp-form()
Deprecated: This is deprecated.
Example

    <sp-dropdown />

Static Members
▸ new ViewModel()

Form View Model

new ViewModel()
Static Members
▸ excludeFieldKey

A string referencing a field type that will exclude that field from this classes fields. The default is `'edit'`.

excludeFieldKey
▸ showSaving

Whether or not to show the saving icon when the submit button is clickered.

showSaving
▸ inline

Whether or not this form should be an inline (horizontal) form

inline
▸ connection

The connection info for this form's data. If this is provided, the object will be fetched using the objectId type

connection
▸ objectId

The object id of the item to retrieve. If this and [sp-form.ViewModel.connection] is provided, a request will be made to the connection object with the specified id.

objectId
▸ promise

The pending promise if the object is being retrieved or null

promise
▸ object

An object representing the current state of the values passed to the form. If the fields have changed, this object will be updated when the submit button is pressed and the validations have passed. To capture current state of the form, use [sp-form.ViewModel.dirtyObject].

object
▸ dirtyObject

An object set with current form values

dirtyObject
▸ validationErrors

An object consisting of validation error strings

    {
       field: 'error message',
       otherfield: 'another error message'
    }

validationErrors
▸ isValid

Whether or not this form is valid and can be submitted. If this is false, the form will not dispatch the `submit` event when it is submitted. Instead, it will dispatch a `submit-fail` event

isValid
▸ isSaving

This type is set to true when the save button is clicked. It sets the save button to a loading state

isSaving
Instance Members
▸ fetchObject(con, id)

Fetches and replaces the object with a new object

fetchObject(con: connection, id: Number): Promise
Parameters
con `(connection)` The supermap connection to the api service
id `(Number)` The id number of the object to fetch
Returns
`Promise`: A promise resolved when the object is fetched from can-connect
▸ submitForm(vm, form, event)

Called when the form is submitted. The object is updated by calling it's `save` method. The event `submit` is dispatched.

submitForm(vm: Object, form: Form, event: Event): Boolean
Parameters
vm `(Object)` The scope of the form (this view model)
form `(Form)` the dom form
event `(Event)` the dom form event
Returns
`Boolean`: returns false to prevent form submissions
▸ dispatchEvent(eventName)

Dispatches an event from this viewmodel passing the form object

dispatchEvent(eventName: String)
Parameters
eventName `(String)` The event name to dispatch
▸ checkField(args)

Runs the field validation and updates the validation object. If the validation succeeds (returns no validation error) then a fieldchange event is dispatched

checkField(args: Array)
Parameters
args `(Array)` an array with 3 arguments, event, value (field value) and field object
▸ getValidationError(field, value)

Validates a field with a value if the field has a [util/field/Field.props.validate] type

getValidationError(field: Object, value: value): String
Parameters
field `(Object)` The field object to validate
value `(value)` The value of the field to validate
Returns
`String`: The validation error or null

### sp-check-field

A boolean field that can be used as a switch or a checkbox

sp-check-field
Example

    <sp-check-field />

Static Members
▸ new ViewModel()

A `<sp-check-field />` component's ViewModel

new ViewModel()

Extends Field

Instance Members
▸ value

The current value of the checkbox field

value

### sp-select-field

A select dropdown

sp-select-field
Example

    <sp-select-field />

Static Members
▸ new SelectOption()

the select option type - used to display tags values/labels

new SelectOption()

Extends Field

Instance Members
▸ value

The value to set when option is selected

value
▸ label

The label to display to the user

label
▸ new ViewModel()

A `<sp-select-field />` component's ViewModel

new ViewModel()
Instance Members
▸ defaultLabel

The default label when no items are selected

defaultLabel
▸ options

The array of options to display in the dropdown

options
▸ optionsPromise

A promise that resolves to the array of options

optionsPromise
▸ isSelected(value)

Determines whether a value is the currently selected value

isSelected(value: String): Boolean
Parameters
value `(String)` The value to check
Returns
`Boolean`: whether or not it is selected

### sp-subform-field

A fieldset to display a set of fields in a nested pattern

sp-subform-field
Example

    <sp-subform-field />

Static Members
▸ new ViewModel()

A component's ViewModel

new ViewModel()

Extends Field

Instance Members
▸ value

The current value of the field. This is a json serialized value paths.

value
▸ formFields

The field properties to set up the form fields functionality, this is set up automatically from the `fields` property or the `subobject` if `fields` is not provided.

formFields
▸ saveField(args)

Called whenever a field changes its value to update this form's json string value. Dispatches the `fieldchange` event with the serialized form object

saveField(args: Array)
Parameters
args `(Array)` the arguments dispatched from the event

### sp-text-field

A basic text field configureable to be formatted as different HTML5 input types or HTML textarea elements

sp-text-field
Example

    <sp-text-field />

Static Members
▸ new ViewModel()

A `<sp-text-field />` component's ViewModel

new ViewModel()

Extends Field

Instance Members
▸ textType

The type of input to create. The default is 'text'

textType
Example

    textType="number"

▸ beforeSubmit(element, event)

Checks for the enter keypress and triggers a change event on the input The enter key press triggers a submit event on the form, but before the submit event, we need to trigger a change on the field value

beforeSubmit(element: domElement, event: KeyDownEvent): Boolean
Parameters
element `(domElement)` The form input element
event `(KeyDownEvent)` The form submit event
Returns
`Boolean`:

## Utilities

Utility functions and classes

### Field

Constructs a new field

new Field()
Instance Members
▸ name

The name of the type on the object, this field's name

name
▸ alias

A friendly name for the field used to display to the user The default is to capitalize the name and remove underscores

alias
▸ error

The field error string

error
▸ value

The current field value

value
▸ list

Includes this field in the list view in the data-admin

list
▸ detail

Includes this field in the details view in the data-admin

detail
▸ edit

Includes this field in the edit view in the data-admin

edit
▸ filter

Includes this field in the filter widget's fields.

filter
▸ sort

Includes this field in the sorting capability

sort
▸ inline

A boolean flag to display form field inline with others and hide labels

inline
▸ placeholder

Text to display when the field is empty (like a textbox). Doesn't apply to some fields, like select or date fields.

placeholder
▸ classes

Adds css classes to the table cells and headings. Selectors should use `th.classname` and `td.classname`

classes
▸ validate

If field component implements this method, it will be called when the component is inserted, with the input element It can be used to customize the input, like adding a date picker

validate
▸ validate

Validates a type and returns a string if the field is invalid

validate
Parameters
props `(ValidationObject)` A special object consisting of information about the current value and dirty state of the form object
Returns
`(String | falsey)`: a string error message if the value is not valid or undefined if there is no error message

### FieldIteratorMap

FieldIteratorMap
Instance Members
▸ excludeFieldKey

A string referencing a field property that will exclude that field from this classes fields.

excludeFieldKey
▸ fields

A getter for an array of fields

fields

### parseFieldArray

Converts an array of strings or field json objects into Field objects

parseFieldArray(fields: Array<(Field | String)>): Array<Field>
Parameters
fields `(Array<(Field | String)>)` An array of either strings or JSON like objects representing Field object properties
Returns
`Array<Field>`: The array of fields

### ValidationObject

ValidationObject
Properties
object `(Object)` : the form object that was set on the form
dirty `(Object)` : the updated object currently set by the user in the form
value `(any)` : the current field's value (dirty). Same as `dirty[field.name]` but provided for easy access

### makeSentenceCase

Formats the field by replacing underscores with spaces and capitalizing the first letter

makeSentenceCase(text: String): String
Parameters
text `(String)` The name of the field
Returns
`String`: The formatted field string. Example: `my_field_name` will become `My field name` .

### mapToFields

Converts a DefineMap to an array of Field objects using the property definitions property or the keys

mapToFields(defineMap: Constructor): Array<util/field/Field>
Parameters
defineMap `(Constructor)` The extended map/constructor to parse
Returns
`Array<util/field/Field>`: The array of fields