Giter Club home page Giter Club logo

ractive-autocomplete's Introduction

Ractive AutoComplete

An autocomplete input box built on Ractive

Where to get it?

Racive AutoComplete is available as a giblet, a component, and a pre-assembled UMD module. Each flavor does not declare an explicit dependency on Ractive, but it is expected to be available as a global.

All of the pre-built files live in tags on the build branch.

Development

Ractive AutoComplete uses gobble as its build tool, which makes it easy to build and play around with. The default mode in the gobble file is development, which will automatically pull in the edge version of Ractive and make it available along with the sandbox. There is an example file provided along with the source, which you can access by running gobble and pointing you browser at http://localhost:4567/sandbox/example.html.

Usage

To use AutoComplete, add component reference to your template.

Attributes

  • completeWith - method or parameter - a function that receives the current text and returns either an array of completions or a Promise for an array of completions.

  • displayMember - parameter - Either:

    1. The name of the member of a completion object to use as text.
    2. A function that receives a completion value and returns a string.
  • value - parameter - the current value for the input.

Events

  • comlpete - fires when a completion is selected. Parameters:
    1. text - the text of the selected completion
    2. index - the index of the selected completion
    3. value - the selected completion

Client

A half second after text is entered, the completion function is called for completions. Once the completions are provided, the completion popup is shown for selection. The up and down arrow keys navigate among the available completions. Enter will select one, and escape will close the popup. Typing further will cause the completion function to be called again to refine the completions.

If the input is focused, pressing the down arrow will cause the completion popup to be shown with the last list of completions.

ractive-autocomplete's People

Contributors

evs-chris avatar jondum avatar

Stargazers

Guilherme Aiolfi avatar  avatar Fabien Franzen avatar

Watchers

transtone avatar  avatar Guilherme Aiolfi avatar James Cloos avatar  avatar Hercules avatar

Forkers

jondum

ractive-autocomplete's Issues

Why "private: true"

I would love to use this in my project, but my only option right now is to make a fork, edit the package.json and publish it myself. If you don't want to maintain it on NPM, that's fine, but at least have a proper package.json with a main.

Seems odd to use NPM for your dep management but then not add the component to the registry.

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.