ember-bundle-select
Bundle select primitive for Ember.
Demo
Install
ember install https://github.com/storyful/ember-bundle-select.git
Usage
Component
{{ #bundle-select-group as |bundle |}}
<table class =" table" >
{{ #each models as |model |}}
{{ #bundle-select-option tagName =" tr" option =model bundle =bundle as |bundleOption |}}
<td >
<input type =" checkbox"
checked ={{ bundleOption.selected }}
onclick ={{ action bundleOption.toggleAction }} />
</td >
<td >{{ model.name }} </td >
{{ /bundle-select-option }}
{{ /each }}
</table >
{{ /bundle-select-group }}
{{!-- With children options --}}
{{ #bundle-select-group as |bundle |}}
<ul class =" table" >
{{ #each models as |model |}}
{{ #bundle-select-option tagName =" li" option =model bundle =bundle as |bundleOption |}}
...
{{ #bundle-select-option option =model.child
parentOption =model
bundle =bundle as |bundleOption |}}
<div >
<input type =" checkbox"
checked ={{ bundleOption.selected }}
onclick ={{ action bundleOption.toggleAction }} />
</div >
<div >{{ model.child.name }} </div >
{{ /bundle-select-option }}
{{ /bundle-select-option }}
{{ /each }}
</ul >
{{ /bundle-select-group }}
Actions
bundle.selectAll
bundle.selectNone
bundleOption.toggleAction
Collaborating
Installation
git clone <repository-url>
this repository
cd ember-bundle-select
npm install
Running
Running Tests
npm test
(Runs ember try:each
to test your addon against multiple Ember versions)
ember test
ember test --server
Building
For more information on using ember-cli, visit https://ember-cli.com/ .