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()

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()

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()

sp-modal

A modal dialog

sp-modal
Example
<sp-modal />
Static Members
new ViewModel()

sp-paginate

A paginate ui component

sp-paginate
Example
<sp-paginate />
Static Members
new ViewModel()

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()

sp-tab-container

A navigation container for navigating between tabbed pages

new sp-tab-container()
Example
<sp-tab-container />
Static Members
new ViewModel()

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()

sp-toast-container

A controller that adds and removes toasts from the dom

sp-toast-container
Example
<sp-toast-container />
Static Members
ViewModel

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()

sp-filter-builder

A component for allowing users to create complex filters

sp-filter-builder
Example
<sp-filter-builder />
Static Members
new Filter()
new FilterList()
new ViewModel()

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()

sp-property-table

A two column table for displaying Field:value object pairs

sp-property-table
Example
<sp-property-table />
Static Members
new ViewModel()

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()

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()

sp-select-field

A select dropdown

sp-select-field
Example
<sp-select-field />
Static Members
new SelectOption()
new ViewModel()

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()

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()

Utilities

Utility functions and classes

Field

Constructs a new field

new Field()
Instance Members
name
alias
error
value
list
detail
edit
filter
sort
inline
placeholder
classes
validate
validate

FieldIteratorMap

FieldIteratorMap
Instance Members
excludeFieldKey
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