Socket
Socket
Sign inDemoInstall

complety

Package Overview
Dependencies
1
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    complety

Complety - An Auto Complete Plugin


Version published
Weekly downloads
14
decreased by-33.33%
Maintainers
1
Install size
1.29 MB
Created
Weekly downloads
 

Changelog

Source

v0.6.0

News

  • Adds support to different module loaders;
  • Adds support for deep highlight;

Updates

  • Drops Handlebar dependency since you can use anything you want;

Readme

Source

Complety - An Auto Complete Plugin

CI NPM Version Maintainability Sponsor

Complety is a plugin that generates an autocomplete.

Options

AttributeDefaultDescription
cachetrueenables cache
cacheData{}keeps json results on keys represented by the request url
delay300time in milliseconds to delay the search after user typing
functions.getValueundefinedfunction to choose which attribute of json to use on search
keysundefinedkeys of json that will be highlighted
minChars1minimum of chars typed to trigger the search
params{}literal or function params sent to query
suggestionundefinedan initial suggestion to be shown
templates.noneundefinedcompiled template used to render suggestion of no results
templates.searchundefinedcompiled template used to render suggestion
urlundefinedsearch url
wrappers.field'.complety__field'class used on field
wrappers.item'.complety__item'class used suggestion items
wrappers.itemSelected'.complety__item--selected'class used on selected item of suggestion
wrappers.list'.complety__list'class used on suggestions list
wrappers.loading'.complety__field--loading'class used on field during search
wrappers.none'.complety__none'class used on item that show no result message
wrappers.wrapper'.complety'class used on complety wrapper

Usage

You declare an element with optional data atributes:

<input data-url="/update" type="search">

On JS you can declare attributes too, but data attributes has priority:

$('input').complety({ keys: ['name'] });

Functions

MethodsDescription
complety.abort()aborts all pending requests
complety.hide()hides the last suggestions
complety.loader('startstop')
complety.readonly(truefalse)
complety.search('value')executes a search
complety.show()show the last suggestions
complety.suggest(json)suggest a json result
complety.suggestion()returns the selected suggestion
complety.suggestions()returns suggestions from the last search
complety.url()returns the actual builded url
complety.wrappers()returns the wrappers name

Events

EventsDescription
complety:alwayswhen ajax executes always callback. arguments: json, this
complety:failwhen ajax executes fail callback. arguments: json, this
complety:donewhen ajax executes done callback. arguments: json, this
complety:suggestedwhen some suggestion is displayed: suggestion, this
complety:nonewhen no suggestion result is displayed: arguments: value, this

Keywords

FAQs

Last updated on 07 Jun 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc