CharacterHighlight
Properties
-
0
- (type: string)
the character in the suggestion
-
1
- (type: boolean)
should it be highlighted?
Type
Array
Links
PopulateOptions(options)
Returns
Type
function
Links
Source(query, populateOptions)
Returns
Type
function
Links
MapOptionToSuggestedValue(option)
Returns
-
string
- The string to display as the suggestions for this option
Type
function
Links
onConfirm(option)
Returns
Type
function
Links
AutocompleteOptions
Properties
-
source
- (type: Source)
The function which retrieves the suggestions to display
-
mapOptionToSuggestedValue
- (type: MapOptionToSuggestedValue)
Function which transforms a suggestion before rendering
-
onConfirm
- (type: onConfirm)
Function which is called when the user selects an option
Type
object
Links
highlightSuggestion(suggestion, query)
Global Function
Returns
-
Array.<CharacterHighlight>
- An array of arrays which contain two items, the first is the character in the suggestion, the second is a boolean which indicates whether the character should be highlighted.
Links
createLoadingContainer
Global Function
Create DOM for the loading container.
Returns
-
HTMLDivElement
- The loading container.
Links
showLoadingPane(instance)
Global Function
Show the loading panel
Returns
Links
hideLoadingPane(instance)
Global Function
Hide the loading panel
Returns
Links
new Autocomplete(autocompleteEl, options)
Class constructor.
Methods
Properties
Links
new Drawer(headerEl)
Class constructor.
Methods
Properties
-
enabled
-
Check if the drawer is currently enabled.
If the burger element is visible, the drawer is enabled.
Links
new DropDown(headerEl, drawer)
Class constructor
Methods
-
handleEvent(event)
- (instance) Event Handler
-
isDrawer
- (instance) Checks if primary nav is in a drawer
This boolean will change the drop down behaviour.
-
reset
- (instance) Returns nav items to their original collapsed state,
items which contain links with the attribute `aria-current`
set to true remain expanded.
-
isExpanded(item)
- (static) Checks whether nav menu is expanded
-
expand(item)
- (static) Expands closed nav menu
-
position(item)
- (static) Changes nav menu position relative to the window
-
collapse(item)
- (static) Collapses open nav menu
-
collapseAll(items)
- (static) Collapses all open nav menus
-
expandAll(items)
- (static) Expands all open nav menus
-
getCurrent(items)
- (static) Returns items which contain an anchor
with the attribute `aria-current` set to true or "page".
Links
<anonymous>~customSource
Inner Property
Type
Links
Autocomplete#mapOptionToSuggestedValue
Instance Property
Type
- MapOptionToSuggestedValue
Links
Autocomplete#options.source(query, populateOptions)
Static Method
Returns
Links
Autocomplete#options.source~callback(options)
Inner Function
Returns
Links
templates.suggestion(option)
Static Method
Used when rendering suggestions, the return value of this will be used as the innerHTML for a single suggestion.
Returns
-
string
- HTML string to represent a single suggestion.
Links
Autocomplete#suggestionTemplate(suggestedValue)
Instance Method
Used when rendering suggestions, the return value of this will be used as the innerHTML for a single suggestion.
Returns
-
string
- HTML string to be represent a single suggestion.
Links
<anonymous>~characters
Inner Property
Type
- Array.<CharacterHighlight>
An array of arrays which contain two items, the first is the character in the suggestion, the second is a boolean which indicates whether the character should be highlighted.
Links
Autocomplete.getDataAttributes(autocompleteEl)
Static Method
Get the data attributes from the AutocompleteElement. If the element is being set up
declaratively, this method is used to extract the data attributes from the DOM.
Returns
-
object
- An options object which can be used for configuring the component
Links
Autocomplete.init(rootElement, options)
Static Method
Initialise o-autocomplete component/s.
Returns
-
Autocomplete | Array.<Autocomplete>
- The newly constructed Autocomplete components
Links
Drawer#handleEvent(event)
Instance Method
Event Handler
Returns
Links
Drawer#enabled
Instance Property
Check if the drawer is currently enabled.
If the burger element is visible, the drawer is enabled.
Links
Drawer#render
Instance Method
Drawer rendering
Returns
Links
Drawer#toggleDrawer
Instance Method
Drawer hide/show functionality
Returns
Links
DropDown#handleEvent(event)
Instance Method
Event Handler
Returns
Links
DropDown#isDrawer
Instance Method
Checks if primary nav is in a drawer
This boolean will change the drop down behaviour.
Returns
-
boolean
- - whether the drawer is enabled or not
Links
DropDown#reset
Instance Method
Returns nav items to their original collapsed state,
items which contain links with the attribute aria-current
set to true remain expanded.
Returns
Links
DropDown.isExpanded(item)
Static Method
Checks whether nav menu is expanded
Returns
-
boolean
- - whether the nav menu is expanded
Links
DropDown.expand(item)
Static Method
Expands closed nav menu
Returns
Links
DropDown.position(item)
Static Method
Changes nav menu position relative to the window
Returns
Links
DropDown.collapse(item)
Static Method
Collapses open nav menu
Returns
Links
DropDown.collapseAll(items)
Static Method
Collapses all open nav menus
Returns
Links
DropDown.expandAll(items)
Static Method
Expands all open nav menus
Returns
Links
DropDown.getCurrent(items)
Static Method
Returns items which contain an anchor
with the attribute aria-current
set to true or "page".
Returns
-
HTMLElement
- - The current menu item
Links