core/comboboxsearch/search_combobox

The class that manages the state of the search within a combobox.

Source:
License:
  • http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Members

moveToFirstNode

Source:

Set the focus on the first node within the array.

moveToLastNode

Source:

Set the focus to the final node within the array.

moveToNode

Source:

Set focus on any given specified node within the node array.

selectNode

Source:

Set focus on a given node after parsed through the calling functions.

Methods

(async) clickHandler(e)

Source:

The handler for when a user interacts with the component.

Parameters:
Name Type Description
e MouseEvent

The triggering event that we are working with.

closeSearch(clear)

Source:

When called, close the dropdown and reset the input field attributes.

Parameters:
Name Type Default Description
clear Boolean false

Conditionality clear the input box.

componentSelector()

Source:

Stub out a required function.

Source:

Stub out a required function.

fetchDataset()

Source:

Stub out a required function.

filterDataset(dataset)

Source:

Stub out a required function.

Parameters:
Name Type Description
dataset Array

filterMatchDataset()

Source:

Stub out a required function.

(async) filterrenderpipe() → {Promise.<void>}

Source:

Update any changeable nodes, filter and then render the result.

Returns:
Type
Promise.<void>

(async) getDataset() → {Promise.<null>}

Source:

Return the dataset that we will be searching upon.

Returns:
Type
Promise.<null>

getDatasetSize() → {number}

Source:

Return the size of the dataset.

Returns:
Type
number

getHTMLElements() → {object}

Source:

Return an object containing a handfull of dom nodes that we sometimes need the value of.

Returns:
Type
object

getMatchedResults() → {Array}

Source:

Return the results of the filter upon the dataset.

Returns:
Type
Array

getPreppedSearchTerm() → {string}

Source:

Get the transformed search value.

Returns:
Type
string

getSearchTerm() → {string}

Source:

Get the value that the user entered.

Returns:
Type
string

keyHandler(e)

Source:

The handler for when a user presses a key within the component.

Parameters:
Name Type Description
e KeyboardEvent

The triggering event that we are working with.

keyUpDown(direction, e)

Source:

Set the current focus either on the preceding or next result item.

Parameters:
Name Type Description
direction Number

Is the user moving up or down the resultset?

e KeyboardEvent

The JS event from the event handler.

registerClickHandlers()

Source:

Register clickable event listeners.

registerInputHandlers()

Source:

Register input event listener for the text input area.

registerKeyHandlers()

Source:

Register key event listeners.

(async) renderAndShow() → {Promise.<void>}

Source:

A combo method to take the matching fields and render out the results.

Returns:
Type
Promise.<void>

renderDropdown()

Source:

Stub out a required function.

searchResultsVisible() → {Boolean}

Source:

Check whether search results are currently visible.

Returns:
Type
Boolean

setMatchedResults(result)

Source:

Given a filter has been run across the dataset, store the matched results.

Parameters:
Name Type Description
result Array

setSearchTerms(result)

Source:

When a user searches for something, set our variable to manage it.

Parameters:
Name Type Description
result string

toggleDropdown(on)

Source:

When called, update the dropdown fields.

Parameters:
Name Type Default Description
on Boolean false

Flag to toggle hiding or showing values.

triggerSelector()

Source:

Stub out a required function.

updateNodes()

Source:

These class members change when a new result set is rendered. So update for fresh data.