Git Product home page Git Product logo

reblocks-typeahead's Introduction

reblocks-typeahead - A Reblocks widget implementing typeahead search.

REBLOCKS-TYPEAHEAD ASDF System Details

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:

See this example application's code to learn how these methods can be implemented.

API

REBLOCKS-TYPEAHEAD

package reblocks-typeahead

Classes

TYPEAHEAD-RESULTS

class reblocks-typeahead:typeahead-results (ui-widget)

Readers

reader reblocks-typeahead:results-items (typeahead-results) (= nil)

Accessors

accessor reblocks-typeahead:results-items (typeahead-results) (= nil)

TYPEAHEAD-WIDGET

class reblocks-typeahead:typeahead-widget (ui-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

reader reblocks-typeahead:input-value (typeahead-widget) (:value = nil)

reader reblocks-typeahead:placeholder (typeahead-widget) (:placeholder = nil)

reader reblocks-typeahead:typeahead-results (typeahead-widget) (= (make-instance 'typeahead-results))

Accessors

accessor reblocks-typeahead:input-value (typeahead-widget) (:value = nil)

accessor reblocks-typeahead:placeholder (typeahead-widget) (:placeholder = nil)

Generics

generic-function reblocks-typeahead:execute-query widget query

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.

generic-function reblocks-typeahead:hide-results widget

Hides dropdown widget. Call this method from a custom on-select or on-empty-selection methods.

generic-function reblocks-typeahead:on-empty-selection widget query

Called when user entered some query but didn't selected any item, just pressed Enter.

generic-function reblocks-typeahead:on-select widget item

Called when user selected an item in the typeahead results.

generic-function reblocks-typeahead:process-typeahead-choice widget query selected-item-idx

Calls either on-select or on-empty-selection depending on if user has choosen an item from the dropdown.

generic-function reblocks-typeahead:update-results widget query

Calls execute-query generic-function and updates the dropdown widget.

Functions

function reblocks-typeahead:focus-in widget

[generated by 40ANTS-DOC]

reblocks-typeahead's People

Contributors

actions-user avatar svetlyak40wt avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

davidalphafox

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.