/ui/elements/pills
Exports the pills(component) method as mapp.ui.elements.pills() to create a pills ui component.
- Source
Methods
(inner) add(val)
Adds a pill with the provided value to the pill component (this) and executes the component.addCallback() method if declared.
Name | Type | Description |
---|---|---|
val | string | The pill value. |
- Source
(inner) pills(component) → {Object}
Decorates the component object with add() and remove() methods before returning the component.
Name | Type | Description |
---|---|---|
component | Object | The component object to be decorated. |
Name | Type | Attributes | Description |
---|---|---|---|
component.target | HTMLElement | The target element to append to. | |
component.pills | Object | <optional> | array of values to be initially selected |
component.addCallback | function | <optional> | Function to execute once a pill has been added. Takes as arguments added value and array of selected values. |
component.removeCallback | function | <optional> | Function to execute once a pill has been removed. Takes as arguments removed value and array of selected values. |
- Source
The decorated component object.
- Type:
- Object
(inner) remove(val)
Removes a pill with the provided value to the pill component (this) and executes the component.removeCallback() method if declared.
Name | Type | Description |
---|---|---|
val | string | The pill value. |
- Source