0.1.22 • Published 7 years ago

ember-hell-filters v0.1.22

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

Ember-hell-filters

This README outlines the details of collaborating on this Ember addon.

DEMO

https://lifeart.github.io/ember-hell-filters/demo/

Example

In template:

 {{#filters-group filters=filters values=(hash one=1 two=2) filtersDidChange=(action 'reloadPlots') }}

In component:

Component.extend({

    filters: Ember.computed(function() {
        let store = this.get('store');
        return [{
                componentName: 'hell-filters/select-2',
                name: 'one',
                config: {
                    idKey: 'id',
                    multiple: true,
                    textKey: 'full_name',
                    options: Ember.computed(function() {
                        return store.peekAll('user');
                    }),
                }
            }, {
                componentName: 'hell-filters/select-2',
                name: 'two',
                dependsOn: {
                    name: 'one',
                    value: '@any'
                },
                config: {
                    idKey: 'id',
                    multiple: true,
                    textKey: 'full_name',
                    options: Ember.computed(function() {
                        return store.peekAll('user').filterBy('role', 3);
                    }),
                }
            },

        ];
    }),
    actions: {
        reloadPlots: function(filtersState) {
            console.log(filtersState);
        }
    }
});

Installation

  • git clone <repository-url> this repository
  • cd ember-hell-filters
  • npm install
  • bower install

Running

Running Tests

  • npm test (Runs ember try:each 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://ember-cli.com/.