Permalink
Browse files

feat(project): switch to npm:homefront.

  • Loading branch information...
doktordirk committed Aug 10, 2016
1 parent 8dd3a23 commit 724fdd128027af4c9cad9d10528aa7d4333b4b4c
Showing with 135 additions and 24 deletions.
  1. +67 −12 README.md
  2. +1 −1 bower.json
  3. +2 −2 config.js
  4. +56 −3 doc/installation.md
  5. +7 −4 package.json
  6. +2 −2 src/datatable.js
@@ -3,7 +3,7 @@
[![Build Status](https://travis-ci.org/SpoonX/aurelia-datatable.svg)](https://travis-ci.org/SpoonX/aurelia-datatable)
[![Gitter](https://img.shields.io/gitter/room/nwjs/nw.js.svg?maxAge=2592000?style=plastic)](https://gitter.im/SpoonX/Dev)
A data-table using [aurelia-orm](https://github.com/SpoonX/aurelia-orm) and [aurelia-pager](https://github.com/SpoonX/aurelia-pager)
A data-table using [aurelia-orm](https://github.com/SpoonX/aurelia-orm) and [aurelia-datatable](https://github.com/SpoonX/aurelia-datatable)
Features:
@@ -16,21 +16,76 @@ Features:
* Custom valueConverters
* And more
## Uses
Aurelia-datatable needs following plugins installed and configured:
* [aurelia-view-manager](https://www.npmjs.com/package/aurelia-view-manager)
* [aurelia-pager](https://www.npmjs.com/package/aurelia-pager)
* [aurelia-orm](https://www.npmjs.com/package/aurelia-orm).
## Documentation
You can find usage examples and the documentation [here](http://aurelia-datatable.spoonx.org/).
The [changelog](doc/changelog.md) provides you with information about important changes.
## Installation
### Jspm/SytemJs
### Aureli-Cli
Run `npm i aurelia-datatable --save` from your project root.
Aurelia-view-manager uses [homefront](https://www.npmjs.com/package/homefront), so add following to the `build.bundles.dependencies` section of `aurelia-project/aurelia.json`:
```js
"dependencies": [
{
"name": "homefront",
"path": "../node_modules/homefront/dist",
"main": "index"
},
{
"name": "aurelia-datatable",
"path": "../node_modules/aurelia-datatable/dist/amd",
"main": "aurelia-datatable",
"resources": [
"bootstrap/datatable.html"
]
},
// ...
],
```
### Jspm
Run `jspm i aurelia-datatable` from your project root.
Aurelia-view-manager uses [homefront](https://www.npmjs.com/package/homefront), so add following to the `bundles.dist.aurelia.includes` section of `build/bundles.js`:
```js
"homefront",
"aurelia-datatable",
"[aurelia-datatable/**/*.js]",
"aurelia-datatable/**/*.html!text",
```
If the installation results in having forks, try resolving them by running:
```sh
jspm inspect --forks
jspm resolve --only registry:package-name@version
```
### Webpack
Run `npm i aurelia-datatable --save` from your project root.
## Documentation
And add `aurelia-datatable` in the `coreBundles.aurelia` section of your `webpack.config.js`.
You can find usage examples and the documentation [here](http://aurelia-datatable.spoonx.org/).
### Typescript
The [changelog](doc/changelog.md) provides you with information about important changes.
Npm-based installations pick up the typings automatically. For Jspm-based installations, run `typings i github:spoonx/aurelia-datatable` or add `"aurelia-datatable": "github:spoonx/aurelia-datatable",` to your `typings.json` and run `typings i`.
## Example
@@ -41,13 +96,13 @@ this.repository = entityManager.getRepository('users');
```
```html
<data-table
<data-table
destroy.delegate="myEventCallback($event)" // or without the function to let ORM take care of it
edit.delegate="myEventCallback($event)"
columns="id,name as 'username', createdAt | dateFormat: 'yyyy-mm-dd'"
repository.bind="repository"
search-column="name"
searchable
sortable
edit.delegate="myEventCallback($event)"
columns="id,name as 'username', createdAt | dateFormat: 'yyyy-mm-dd'"
repository.bind="repository"
search-column="name"
searchable
sortable
></data-table>
```
@@ -31,7 +31,7 @@
"aurelia-router": "^1.0.0-rc.1.0.0",
"aurelia-templating": "^1.0.0-rc.1.0.0",
"aurelia-view-manager": "^0.0.7",
"json-statham": "^2.0.5",
"homefront": "^1.0.0",
"typer": "^1.1.0"
}
}
@@ -18,7 +18,7 @@ System.config({
"aurelia-templating": "npm:aurelia-templating@1.0.0",
"aurelia-view-manager": "npm:aurelia-view-manager@0.0.7",
"fetch": "github:github/fetch@1.0.0",
"json-statham": "npm:json-statham@2.0.5",
"homefront": "npm:homefront@1.0.0",
"typer": "npm:typer@1.1.0",
"npm:aurelia-api@3.0.0-rc8": {
"aurelia-dependency-injection": "npm:aurelia-dependency-injection@1.0.0",
@@ -106,7 +106,7 @@ System.config({
"aurelia-templating": "npm:aurelia-templating@1.0.0",
"extend": "npm:extend@3.0.0"
},
"npm:json-statham@2.0.5": {
"npm:homefront@1.0.0": {
"extend": "npm:extend@3.0.0"
}
}
@@ -1,11 +1,64 @@
# Installing
# Installation
Install aurelia-datatable.
## Uses
## Jspm/SytemJs
Aurelia-datatable needs following plugins installed and configured:
* [aurelia-view-manager](https://www.npmjs.com/package/aurelia-view-manager)
* [aurelia-pager](https://www.npmjs.com/package/aurelia-pager)
* [aurelia-orm](https://www.npmjs.com/package/aurelia-orm).
## Aureli-Cli
Run `npm i aurelia-datatable --save` from your project root.
Aurelia-view-manager uses [homefront](https://www.npmjs.com/package/homefront), so add following to the `build.bundles.dependencies` section of `aurelia-project/aurelia.json`:
```js
"dependencies": [
{
"name": "homefront",
"path": "../node_modules/homefront/dist",
"main": "index"
},
{
"name": "aurelia-datatable",
"path": "../node_modules/aurelia-datatable/dist/amd",
"main": "aurelia-datatable",
"resources": [
"bootstrap/datatable.html"
]
},
// ...
],
```
## Jspm
Run `jspm i aurelia-datatable` from your project root.
Aurelia-view-manager uses [homefront](https://www.npmjs.com/package/homefront), so add following to the `bundles.dist.aurelia.includes` section of `build/bundles.js`:
```js
"homefront",
"aurelia-datatable",
"[aurelia-datatable/**/*.js]",
"aurelia-datatable/**/*.html!text",
```
If the installation results in having forks, try resolving them by running:
```sh
jspm inspect --forks
jspm resolve --only registry:package-name@version
```
## Webpack
Run `npm i aurelia-datatable --save` from your project root.
And add `aurelia-datatable` in the `coreBundles.aurelia` section of your `webpack.config.js`.
## Typescript
Npm-based installations pick up the typings automatically. For Jspm-based installations, run `typings i github:spoonx/aurelia-datatable` or add `"aurelia-datatable": "github:spoonx/aurelia-datatable",` to your `typings.json` and run `typings i`.
@@ -19,7 +19,7 @@
"VMBindraban <vijay@spoonx.nl>",
"jeremyvergnas <jeremy@sweebr.com"
],
"main": "dist/commonjs/datatable.js",
"main": "dist/commonjs/aurelia-datatable.js",
"typings": "dist/aurelia-datatable.d.ts",
"repository": {
"type": "git",
@@ -45,7 +45,7 @@
"aurelia-router": "^1.0.0-rc.1.0.0",
"aurelia-templating": "^1.0.0-rc.1.0.0",
"aurelia-view-manager": "^0.0.7",
"json-statham": "^2.0.5",
"homefront": "^1.0.0",
"typer": "^1.1.0"
},
"peerDependencies": {
@@ -57,7 +57,7 @@
"aurelia-router": "^1.0.0-rc.1.0.0",
"aurelia-templating": "^1.0.0-rc.1.0.0",
"aurelia-view-manager": "^0.0.7",
"json-statham": "^2.0.5",
"homefront": "^1.0.0",
"typer": "^1.1.0"
},
"devDependencies": {
@@ -75,7 +75,7 @@
"aurelia-router": "^1.0.0-rc.1.0.0",
"aurelia-templating": "^1.0.0-rc.1.0.0",
"aurelia-view-manager": "^0.0.7",
"json-statham": "^2.0.5",
"homefront": "^1.0.0",
"typer": "^1.1.0"
},
"devDependencies": {
@@ -134,6 +134,9 @@
"aurelia": {
"build": {
"resources": [
"aurelia-datatable/columns-filter",
"aurelia-datatable/convert-manager",
"aurelia-datatable/datatable",
"aurelia-datatable/bootstrap/datatable.html"
]
}
@@ -4,7 +4,7 @@ import {bindable, customElement} from 'aurelia-templating';
import {resolvedView} from 'aurelia-view-manager';
import {EntityManager} from 'aurelia-orm';
import {Router} from 'aurelia-router';
import {Statham} from 'json-statham';
import {Homefront} from 'homefront';
@customElement('datatable')
@resolvedView('spoonx/datatable', 'datatable')
@@ -245,6 +245,6 @@ export class DataTable {
}
displayValue(row, propertyName) {
return new Statham(row, Statham.MODE_NESTED).fetch(propertyName);
return new Homefront(row, Homefront.MODE_NESTED).fetch(propertyName);
}
}

0 comments on commit 724fdd1

Please sign in to comment.