OptionalacAfter AbstractAutocompleteAdapter#setupAutocomplete is run, holds a reference to the autocomplete widget used by this instance.
CSS prefix for the autocomplete widget.
Delay in milliseconds before performing a search.
Key (into the row objects retrieved via the request handler)
that determines which value is used as the main text in the autocomplete
widget.
'label' corresponds to what the main application expects, but if you
want to show something different than what gets passed to the
application, you may want to change it.
Default row key for the optional secondary, smaller text shown in the autocomplete widget below each result.
OptionalsourceIDCanonical identifier for this source. Lower-case string, no whitespace.
OptionalsupportedRegExp for URLs this adapter can handle.
Callback to run after a successful lookup
Protected_extractTransform a result from the Wikidata item into a row that can be rendered by the autocomplete widget.
a query result returned by the SPARQL query service (member
of bindings array)
the original (unescaped) query string is used for highlighting the match in a composite title that includes both the label and the alias against which the query matched
plain object that only contains the data we can use inside the
application, plus a derived title property for rendering this row in
the autocomplete widget.
Protected_renderRender next/previous navigation within the autocomplete widget.
Navigation settings
Protected_renderRender "No search results" text row at the bottom with default styles.
Protected Optional Abstract_renderCallback for rendering a row within the autocomplete widget, overriding default rendering.
The row object to render
Protected_requestSend an autocomplete request to the Wikidata query service and render the result using the autocomplete widget.
the query string
Optionaloffset: numberthe offset from which to continue a previous query.
Protected_selectPass along row data we can handle to the main application. Will also query lib.reviews itself (through the native adapter) for the URL, so we can give preferential treatment to an existing native record for the review subject.
row data object. All properties except "url" are only used for display purposes, since the server performs its own lookup on the URL.
the click or keyboard event which triggered this row selection.
Does this adapter support the given URL? By default, performs a simple regex check.
the URL to test
true if supported
Hide activity indicator in the input widget. Must be called in handler code via this.adapter.
Show activity indicator in the input widget. Must be called in handler code via this.adapter.
Return the canonical source identifier for this adapter
the source ID
Look up a single item in Wikidata given its URL. Uses the MediaWiki API.
the URL to look up
resolves to a LookupResult if successful, rejects with error if not.
Remove the autocomplete widget including all its event listeners.
Run the autocomplete widget on the current input.
Initialize the autocomplete widget. You can add additional callbacks /
custom properties in the inherited class; just remember to call
super.setupAutocomplete() first.
This module performs shallow lookups on Wikidata. They are shallow in that they only load the information that needs to be displayed to the user in their current language. The backend version of this adapter performs the actual deep lookup for all languages.