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
-
defaultValue
- (type: string)
Specify a string to prefill the autocomplete with
-
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 Banner(bannerElement, options)
Represents a banner.
Class constructor.
Methods
Links
new Overlay(...)
Represents an Overlay.
Construct an overlay.
Methods
-
show
- (instance) Show the overlay
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 | undefined
- 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
Banner#render
Instance Method
Render the banner.
Returns
Links
Banner#open
Instance Method
Open the banner.
Returns
Links
Banner#close
Instance Method
Close the banner.
Returns
Links
Banner#buildBannerElement(bannerElement)
Instance Method
Build a full banner element. This is used when no banner or a partial banner exists in the DOM.
Returns
-
HTMLElement
- Returns the new banner element
Links
Banner.getOptionsFromDom(bannerElement)
Static Method
Get the data attributes from the bannerElement. If the banner is being set up
declaratively, this method is used to extract the data attributes from the DOM.
Returns
-
Object.<string, any>
- - The options
Links
Banner#destroy
Instance Method
Undo the init method
Links
Banner.init(rootElement, options)
Static Method
Initialise banner components.
Returns
-
Banner | Array.<Banner>
- - The newly instantiated Banner (or Banners, if rootElement was not a banner)
Links
Overlay#show
Instance Method
Show the overlay
Fires Event
Links
oOverlay#event:ready
Type: object
Ready event
Links
new Banner(bannerElement, options)
Represents a banner.
Class constructor.
Methods
Links