reblocks-typeahead - A Reblocks widget implementing typeahead search.
REBLOCKS-TYPEAHEAD ASDF System Details
Description: A Reblocks widget implementing typeahead search.
Licence: Unlicense
Author: Alexander Artemenko <svetlyak.40wt@gmail.com>
Homepage: https://40ants.com/reblocks-typeahead/
Bug tracker: https://github.com/40ants/reblocks-typeahead/issues
Source control: GIT
Depends on: parenscript, reblocks, reblocks-lass, reblocks-parenscript, reblocks-ui
Installation
You can install this library from Quicklisp, but you want to receive updates quickly, then install it from Ultralisp.org:
(ql-dist:install-dist "http://dist.ultralisp.org/"
:prompt nil)
(ql:quickload :reblocks-typeahead)
Usage
To use this library, you need to inherit your widget from reblocks-typeahead:typeahead-widget
and to provide at least two methods:
reblocks-typeahead:execute-query
which will respond with data for dropdownreblocks-typeahead:on-select
which will be executed when user has choosen an item from dropdown menu.
See this example application's code to learn how these methods can be implemented.
API
REBLOCKS-TYPEAHEAD
Classes
TYPEAHEAD-RESULTS
Readers
Accessors
TYPEAHEAD-WIDGET
Base class for custom typeahead widgets.
Define you own widget class based on the typeahead-widget
and also define methods for following generic-functions.
Mandatory:
Optional:
Readers
Accessors
Generics
A method for this generic-function should return a list of widgets to be shown in reponse to the given text query.
This method should return a list of widgets.
To make simple widgets out of strings, you can use
reblocks/widgets/string-widget:make-string-widget
function.
Hides dropdown widget. Call this method from a custom on-select
or on-empty-selection
methods.
Called when user entered some query but didn't selected any item, just pressed Enter.
Called when user selected an item in the typeahead results.
Calls either on-select
or on-empty-selection
depending on if user has choosen an item from the dropdown.
Calls execute-query
generic-function and updates the dropdown widget.