- Description:
The class that manages the state of the search within a combobox.
- Source:
- Copyright:
- 2023 Mathew May
- 2023 Mathew May
- License:
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
The class that manages the state of the search within a combobox.
Methods
changeHandler(e)
- Description:
The handler for when a user changes the value of the component (selects an option from the dropdown).
- Source:
Parameters:
Name | Type | Description |
---|---|---|
e |
Event | The change event. |
(async) clickHandler(e)
- Description:
The handler for when a user interacts with the component.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
e |
MouseEvent | The triggering event that we are working with. |
closeSearch(clear)
- Description:
When called, close the dropdown and reset the input field attributes.
- Source:
Parameters:
Name | Type | Default | Description |
---|---|---|---|
clear |
Boolean |
false
|
Conditionality clear the input box. |
componentSelector()
- Description:
Stub out a required function.
- Source:
dropdownSelector()
- Description:
Stub out a required function.
- Source:
fetchDataset()
- Description:
Stub out a required function.
- Source:
filterDataset(dataset)
- Description:
Stub out a required function.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
dataset |
Array |
filterMatchDataset()
- Description:
Stub out a required function.
- Source:
(async) filterrenderpipe() → {Promise.<void>}
- Description:
Update any changeable nodes, filter and then render the result.
- Source:
Returns:
- Type
- Promise.<void>
(async) getDataset() → {Promise.<null>}
- Description:
Return the dataset that we will be searching upon.
- Source:
Returns:
- Type
- Promise.<null>
getDatasetSize() → {number}
- Description:
Return the size of the dataset.
- Source:
Returns:
- Type
- number
getHTMLElements() → {object}
- Description:
Return an object containing a handfull of dom nodes that we sometimes need the value of.
- Source:
Returns:
- Type
- object
getMatchedResults() → {Array}
- Description:
Return the results of the filter upon the dataset.
- Source:
Returns:
- Type
- Array
getPreppedSearchTerm() → {string}
- Description:
Get the transformed search value.
- Source:
Returns:
- Type
- string
getSearchTerm() → {string}
- Description:
Get the value that the user entered.
- Source:
Returns:
- Type
- string
registerChangeHandlers()
- Description:
Register change event listeners.
- Source:
registerClickHandlers()
- Description:
Register clickable event listeners.
- Source:
registerInputHandlers()
- Description:
Register input event listener for the text input area.
- Source:
(async) renderAndShow() → {Promise.<void>}
- Description:
A combo method to take the matching fields and render out the results.
- Source:
Returns:
- Type
- Promise.<void>
renderDropdown()
- Description:
Stub out a required function.
- Source:
searchResultsVisible() → {Boolean}
- Description:
Check whether search results are currently visible.
- Source:
Returns:
- Type
- Boolean
setMatchedResults(result)
- Description:
Given a filter has been run across the dataset, store the matched results.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
result |
Array |
setSearchTerms(result)
- Description:
When a user searches for something, set our variable to manage it.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
result |
string |
toggleDropdown(on)
- Description:
When called, update the dropdown fields.
- Source:
Parameters:
Name | Type | Default | Description |
---|---|---|---|
on |
Boolean |
false
|
Flag to toggle hiding or showing values. |
triggerSelector()
- Description:
Stub out a required function.
- Source:
- Deprecated:
- since Moodle 4.4
updateNodes()
- Description:
These class members change when a new result set is rendered. So update for fresh data.
- Source: