/ui/elements/dropdown
The dropdown elements module exports the dropdown method to create a dropdown element group from a params argument.
- Source
Requires
Methods
(inner) dropdown(params) → {HTMLElement}
The dropdown method returns a dropdown element created from the params argument.
Name | Type | Description |
---|---|---|
params | Object | Parameter for the creation of the dropdown element. |
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
params.placeholder | string | <optional> | '' | The placeholder for the list of options. |
params.multi | boolean | <optional> | Allow multiple choice if true. | |
params.dropdown_search | boolean | <optional> | Specify wether a searchbox is supplied in a dropdown filter. | |
params.keepPlaceholder | boolean | <optional> | set this flag to | |
params.entries | Object | <optional> | Array of option elements. Expected format: [{title: 'Title for Option 1', option: 'option1'}, ...]. Add property | |
params.headerOnClick | function | <optional> | Callback to execute when a header is clicked. Overrides default function. | |
params.maxHeight | Number | <optional> | Optional max height property on results unordered list
|
- Source
HTML dropdown element
- Type:
- HTMLElement
(inner) pillsElement(params)
Assign the params.pills property to the be a pills element.
Name | Type | Description |
---|---|---|
params | Object | The dropdown element object. |
Name | Type | Attributes | Description |
---|---|---|---|
params.pills | boolean | <optional> | The pills element will be assigned to the flag property. |
params.selectedTitles | set | A set of titles from currently selected dropdown items. | |
params.selectedOptions | set | A set of options from currently selected dropdown items. |
- Source
(inner) search(params) → {HTMElement}
Assign the params.search property to the be a search element.
Name | Type | Description |
---|---|---|
params | Object | The dropdown element object. |
Name | Type | Attributes | Description |
---|---|---|---|
params.selectedTitles | set | A set of titles from currently selected dropdown items. | |
params.selectedOptions | set | A set of options from currently selected dropdown items. | |
params.entries | Array | The options avialble to the dropdown. | |
params.placeholder | String | THe options avialble to the dropdown. | |
params.search | boolean | <optional> | The search element will be assigned to the flag property. |
params.pills | boolean | <optional> | Pill element for adding the options to when selected. |
- Source
The search element and its datalist.
- Type:
- HTMElement