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

multiselect-search

v0.0.7

Published

MultiSelect plugin help you with multi slections. It has Seach input

Downloads

5

Readme

MultiSelect

MultiSelect jQuery Plugin. [Search] [Checkbox] [Public Methods]

The basic structure is on index.html

Getting Start

With the demo structure, you can simply add this to your script:

new multiSelect($('.dropdown-container')).init();

Configurations

The basic options object has:

Search input: searcher: $('.dropdown-search')

The dropdown button: dropButton: $('.dropdown-button')

The dropdown list: dropList: $('.dropdown-list')

The counter element: counter: $('.quantity')

The checkall input: checkAll: $('#check-all')

Below attributes is to generated input, that present in data object

The generated input name attribute from data object: inputName: 'multiselect'

The generated input value attribute from data object: inputValue: 'id'

The generated label text attribute from data object: inputText: 'name'

The max value length on dropdown: countMax: 3

Data example: [ {id: 1,name: 'Demo data 1'}, {id: 2,name: 'Demo data 2'} ]

Default options

All default options is the exemple above.

Methods

First of all, to use public metods, this plugin return a instance of it self, so you need to assign to a variable, i recoment to make this:

``const myVariable = new multiSelect($('.dropdown-container')).init();```

With above code, you can access public methods like myVariable.reset(), myVariable.check(3), or what you want.

This methods are available:

reset(): Reset all options of plugin. Uncheck all, remove filters and hide dropdown list. Is userfull when you have multiple instances in your page.

recount(): Recount checked inputs and change counter element with the information;

check(id): Receive a element value attribute and check that element.

uncheck(id): Receive a element value attribute and uncheck that element.

checkAll(): Check all elements.

uncheckAll(): Uncheck all elements.

getCheckeds(): It takes all checkeds elements and return.

getChecks(): Takes all elements and return.

getCheckedsAsArray(): It takes the value of all checked elements and returns as array.

TODO:

  • [ ] Remove jQuery dependency.
  • [ ] Pass CSS to javascript module.
  • [ ] Minify JS.
  • [ ] Convert to TDD.
  • [ ] Create default html structure inside JS module.