Skip to content

Veams/veams-utility-type-ahead

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bower version Gitter Chat

TypeAhead

This utility offers a type-ahead function that can be applied to input elements.

It generates a list with keywords fetched from a server.


Requirements

  • Veams >= v5.0.0 - Veams Framework.

Installation

Installation with Veams

veams install vu type-ahead

Installation with Bower

bower install veams-utility-type-ahead --save


Fields

u-type-ahead.hbs

Settings

  • settings.typeAheadClasses {String} - Modifier classes.
  • settings.typeAheadJsOptions {Object} - Options object which gets stringified.
  • settings.height {Number} - Height of suggestion list.

JavaScript Options

The module gives you the possibility to override default options:

  • currentValueClass {String} ['type-ahead__current-value'] - Current value class.
  • inputSel {String} [[data-js-item="type-ahead__input"]] - Element selector for input.
  • minLength {Number} [2] - Minimal length of input value before suggestions will be shown.
  • minLoadTime {Number} [0] - Minimal time that must have passed before new request is sent to server.
  • suggestionItemSel {String} [[data-js-item="suggestion-item"]] - Element selector for suggestion item.
  • suggestionItemSel {String} [[data-js-item="type-ahead__list"]] - Element selector for type-ahead list.
  • templates.tplSuggestionsA11y {String} ['SUGGESTIONS__A11Y'] - Template name for suggestion (list item).
  • templates.tplSuggestionsOpt {String} ['SUGGESTIONS__OPTIONS'] - Template name for option.