npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

uncomplete

v0.0.3-alpha

Published

A jQuery autocomplete plugin

Downloads

4

Readme

UnComplete

A simple pure JavaScript HTML5 autofill to bridge the gap between inputs and DataList elements. Compatible with the latest versions of Chrome, FireFox, Safari and Edge browsers and IE 11+

Basic Usage

You can initialize an UnComplete object with or without a DataList the application will create a DataList with an ID of the input name appended with 'List'. For example the below the example code will create a DataList with the id="nameList" . If you create a DataList and link it to the input using the list="nameList" attribute the list will be added to the UnComplete object.

    <label for="name">NAME</label>
    <input id="name" name="name" type="text"></input>
    var name = new Uncomplete('name');

This will initialize a default single select UnComplete object. The name object will have several useful properties, methods and events.

UnComplete Object Options

Methods

Events

Examples

HTML

<form id="demoform">
  <div class="form-group">
    <label for="name">NAME</label>
    <input id="name" name="name" class="form-control" type="text"></input>
  </div>

  <div class="form-group">
    <label for="address">ADDRESS</label>
    <input multiple id="address" name="address" class="form-control" type="text"></input>
  </div>

  <div class="form-group">
    <label for="language">LANGUAGES</label>
    <input multiple id="language" name="language" list="languageDL" class="form-control" type="text"></input>
    <datalist id="languageDL" name="languageDL" class="datalist-name">
        <option id='eng' value='english' label='English (eng)'></option>
        <option id='spn' value='spainish' label='Spanish (spn)'></option>
        <option id='fre' value='french' label='French (fre)'></option>
        <option id='por' value='portuguese' label='Portuguese (por'></option>
        <option id='pol' value='polish' label='Polish (pol)'></option>
    </datalist>
  </div>
</form>

JavaScript

var names = new Uncomplete('name');
var addresses = new Uncomplete('address', { multiple: true, autocomplete: true });

new Uncomplete('language', { multiple: true, duplicates: true });

$.ajax({
  url: '/names.json',
  method: 'GET',
  timeout: 10000
})
  .done(function(data) {
    data.forEach(function(item) {
      names.addOption(names, {
        value: item.code,
        label: item.name + ' (' + item.username + ')',
        id: item.code
      });
    });
  })
  .fail(function(error) {
    console.log('Handle your errors here!');
  });

$.ajax({
  url: '/addresses.json',
  method: 'GET',
  timeout: 10000
})
  .done(function(data) {
    data.forEach(function(item) {
      names.addOption(addresses, {
        value: item.code,
        label: item.street + ' ' + item.state + ' ' + item.zip,
        id: item.code
      });
    });
  })
  .fail(function() {
    console.log('Handle your errors here!');
  });

// jQuery and JavaScript listener examples
});document.querySelector('#name').addEventListener('uncomplete-selected', function(e) {
  console.log('Do your awesome logic here! Using this JavaScript listener to uncomplete-seleted');
});

$('#name').on('uncomplete-selected', function(e) {
  console.log('Do your awesome logic here! Using this jQuery listener to uncomplete-seleted');
});

document.querySelector('#name').addEventListener('uncomplete-cleared', function(e) {
  console.log('Do your awesome logic here! Using this JavaScript listener to uncomplete-cleared');
});

$('#name').on('uncomplete-cleared', function(e) {
  console.log('Do your awesome logic here! Using this jQuery listener to uncomplete-cleared');
});

document.querySelector('#language').addEventListener('swiggle-added', function(e) {
  console.log('Do your awesome logic here! Using this JavaScript listener to Add', e.detail);
});

$('#language').on('swiggle-added', function(e) {
  console.log(
    'Do your awesome logic here! Using this jQuery listener to add',
    e.originalEvent.detail
  );
});

document.querySelector('#language').addEventListener('swiggle-deleted', function(e) {
  console.log('Do your awesome logic here! Using this JavaScript listener to delete', e.detail);
});

$('#language').on('swiggle-deleted', function(e) {
  console.log(
    'Do your awesome logic here! Using this jQuery listener to delete',
    e.originalEvent.detail
  );
});