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

ember-cli-mdc-chips

v3.0.17

Published

ember-cli addon for @material/chips.

Downloads

300

Readme

ember-cli-mdc-chips

ember-cli addon for @material/chips.

Installation

ember install ember-cli-mdc-chips

Components

This package contains the following top-level components.

MdcChipSet

Description

Add a chip set (a list of chips) to the page.

Usage

The inline (and recommended) version:

<MdcChipSet @label={{label}} @chips={{chips}} />

or the block version:

<MdcChipSet @interaction={{this.interaction}} 
            @selection={{this.selection}}
            @removal={{this.removal}}
            @navigation={{this.navigation}}>
  <MdcChip @text='John' @leadingIcon="person" @trailingIcon="cancel" />
</MdcChipSet>

Attributes

ChipSet

  • @chips - an array of objects that defines the chips in the chip set
  • @label - a label that is covered to the class name mdc-chip-set--${label}
  • @interation - callback action for the chip interaction event
  • @selection - callback action for chip selection
  • @removal - callback action for chip removal
  • @navigation - callback action for chip navigation

Chip

  • @text - The text displayed in the chip.
  • @leadingIcon - The leading icon displayed on the chip.
  • @trailingIcon - The trailing icon displayed on the chip.

Using adapter keys to display data as chips

A feature of the inline MdcChipSet (and the other chip sets) is the ability to use adapter keys to display any array as a chip set without having to convert the items in the array to the expected attributes of a chip. The following are the adapter key attributes on MdcChipSet:

  • @idKey - The id property name (default is 'id')
  • @textKey - The text property name (default is 'text')
  • @leadingIconKey - The leading icon property name (default is 'leadingIcon')
  • @trailingIconKey - The trailing icon property name (default is 'trailingIcon')

Here is an example.

<MdcChipSet @label='names' @chips={{@model}} @textKey='name' />

MdcChoiceChipSet

Description

Add a choice (i.e., single select) chip set to the page.

Usage

<MdcChoiceChipSet @chips={{chips}} @choice={{this.choice}} @change={{this.change}} />

Attributes

MdcChoiceChipSet

  • @chips - an array of objects that defines the chips in the choice chip set
  • @choice - the initial choice; must be a chip from @chips
  • @change - callback action(chip) for when the choice changes; null if no choice

MdcFilterChipSet

Description

Add a filter (i.e., multi-select) chip set to the page.

Usage

<MdcFilterChipSet @chips={{this.chips}} @filtered={{this.filtered}} />

Attributes

MdcFilterChipSet

  • @chips - an array of objects that defines the chips in the filter chip set
  • @filtered - the array of filtered chips