/ember-frost-select

the drop-down select widget to rule them all

Primary LanguageJavaScriptMIT LicenseMIT

Travis Coveralls NPM

ember-frost-select

the drop-down select widget to rule them all

Installation

ember install ember-frost-select

API

Attribute Type Value Description
selected number or array 1 or [1, 2] The indices of the pre-selected values corresponding to values in the passed-in data.
data array [{"label: "foo", "value": "bar"}] An array of "label"/"value" key/value pairs representing the rows in the select drop-down.
on-change string <action-name> The action callback to call when the value of the select component changes
on-input string <action-name> The action callback to call when the value of the filter changes as the user types

Examples

Assuming the following data is available in the consuming context:

data = [
  {
    "label": "foo",
    "value": "bar"
  },
  {
    "label": "fizz",
    "value": "buzz"
  }
]

singleSelected = 1
multipleSelected = [1, 2]

Simple single select

{{frost-select
  data=data
  selected=singleSelected
  on-change=(action 'yourCallbackAction')
}}}

Multi select

{{frost-multi-select
  data=data
  on-change=(action 'yourCallbackAction')
  selected=multipleSelected
}}}

Simple single select w/ external filtering

{{frost-select
  data=data
  on-change=(action 'yourCallbackAction')
  on-input=(action 'yourInputFilterCallbackAction')
}}}

##Contributing This following outlines the details of collaborating on this Ember addon:

Installation

  • git clone this repository
  • npm install
  • bower install

Running

Running Tests

  • npm test (Runs ember try:testall to test your addon against multiple Ember versions)
  • ember test
  • ember test --server

Building

  • ember build

For more information on using ember-cli, visit http://www.ember-cli.com/.