The attributes passed into the component.
The root DOM element for the component.
ProtectedhasWhether or not the search input has focus.
ProtectedindexThe index of the currently-selected
ProtectedloadingThe number of sources that are still loading results.
ProtectednavigatorProtectedsearchThe instance of SearchState for this component.
Protected OptionalsearchProtected OptionalsourcesAn array of SearchSources.
Class component state that is persisted between redraws.
Updating this will not automatically trigger a redraw, unlike other frameworks.
This is different to Vnode state, which is always an instance of your class component.
This is undefined by default.
Protected StaticMIN_The minimum query length before sources are searched.
Returns a jQuery object for this component's element. If you pass in a selector string, this method will return a jQuery object, using the current element as its buffer.
For example, calling component.$('li') will return a jQuery object
containing all of the li elements inside the DOM element of this
component.
Optionalselector: stringa jQuery-compatible selector string
the jQuery object for the DOM node
Clear the search
Get the position of the currently selected search result item. Returns zero if not found.
Get the
Get all of the search result items that are selectable.
Navigate to the currently selected search result and close the list.
Set the currently-selected search result item to the one with the given index.
Build an item list of SearchSources.
StaticcomponentConvenience method to attach a component without JSX.
Has the same effect as calling m(THIS_CLASS, attrs, children).
StaticinitInitialize the component's attrs.
This can be used to assign default values for missing, optional attrs.
@todo: 2.0 refactored the global search UI and no longer uses this component, now we use the GlobalSearch component. The component was kept to support extension usage of it on a local scope. We need to extract this component into a separate UI package instead as it is no longer needed by core.
The
Searchcomponent displays a menu of as-you-type results from a variety of sources.The search box will be 'activated' if the app's search state's getInitialSearch() value is a truthy value. If this is the case, an 'x' button will be shown next to the search field, and clicking it will clear the search.
ATTRS: