A sorting component to sort collections
ember install ember-frost-sort
Attribute | Type | Value | Description |
---|---|---|---|
properties |
array |
[{"label: "foo", "value": "bar"}] |
Array of sortable attributes. |
sortOrder |
array |
[{"direction: "asc/desc", "value": <attr-name>}] |
Array that specifies the sort order. |
onChange |
string |
<action-name> |
The action to call when the value of the select item changes. |
The sort component is accessible using ember-hook with the top level hook name or you can access the internal components as well -
- Default top level hook -
$hook('sort')
- Add sort button hook -
$hook('<hook-name>-add')
- Remove sort button hook -
$hook('<hook-name>-remove-<index>')
- For each sort -
$hook('<hook-name>-<index>')'
- Sort direction for each filter -
$hook('<hook-name>-<index>-direction')'
- Each sort's select element -
$hook('<hook-name>-<index>-select')'
git clone git@github.com:ciena-frost/ember-frost-sort.git
cd ember-frost-sort
npm install && bower install
A dummy application for development is available under ember-frost-sort/tests/dummy
.
To run the server run ember server
(or npm start
) from the root of the repository and
visit the app at http://localhost:4200.
Run npm test
from the root of the project to run linting checks as well as execute the test suite
and output code coverage.