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

ractive-ez-combobox

v2.0.11

Published

Ractive Ez UI Combobox

Downloads

7

Readme

Ractive Ez ComboBox

ComboBox component for ractive.js

Demo

Install

npm i ractive-ez-combobox
import 'ractive-ez-combobox';
import 'ractive-ez-combobox/themes/blue.less';

Usage

Both combobox and multibox support following properties:

  • items: List of items to choose from
  • placeholder: Placeholder text if no value is selected
  • disabled: True if input is disabled
  • required: True if input is required
  • button: If true, renders a button that shows all items when clicked
  • typeahead: True if the input text is automatically suffixed with the full text of the current option. This option should only be used with a prefix filter function, and not combined with searchOnInput.
  • path: The item keypath to filter on
  • compare: Function(item1, item2) that returns true if the two items are equal. This is used to determine if an item is selected.
  • filter: Function(text, value) that returns true if the value matches the filter text. The value that is passed to this function is the value of the property at path (e.g. if path = "code" then this component will call filter(text, item.code)). This function defaults to a prefix filter (that matches at the start of the string).
  • search: If the items are not known at initialization, you can provide a search function to populate the items asynchronously. function(text, callback) => callback(error, items).
  • searchOnInput: Automatically refresh your items when the user inputs new text (for full asynchronous search).
  • searchDelay: When searchOnInput is enabled, this value defines the time (in ms) to wait before searching after detecting a keystroke.

The content of the component is the view template of an option.

ComboBox

The combobox selects a single value.

<EzComboBox
    value="{{ value }}"
    items="{{ countries }}"
    path="code">

    <b>{{ code }}</b> - {{ name }}
</EzComboBox>

Properties

  • value: The item that is currently selected

Events

  • change(value): Dispatched when the value is changed

MultiBox

The multibox selects a list of values.

<EzMultiBox
    values="{{ values }}"
    items="{{ countries }}"
    path="code">

    {{ code }} ({{ name }})
</EzMultiBox>

Properties

  • values: An array of selected values

Events

  • change(values): Dispatched when the array of selected values changes
  • add(value): Dispatched when a value is added to the list of selected values
  • remove(value): Dispatched when a value is removed from the list of selected values