Skip to content
This repository was archived by the owner on Nov 20, 2018. It is now read-only.

Commit 9fdd0bb

Browse files
authored
Merge pull request #13 from qjon/develop
v2.3.0
2 parents 20818d6 + 7f38f91 commit 9fdd0bb

26 files changed

+514
-112
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,6 @@ testem.log
4040
.DS_Store
4141
Thumbs.db
4242
proxy.config.json
43+
44+
45+
.rpt2_cache

README.md

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
1+
# angular2-tree
2+
3+
Simple component to display tree structure
4+
15
[![npm (scoped)](https://img.shields.io/npm/v/@rign/angular2-tree.svg)]()
26
[![Build Status](https://travis-ci.org/qjon/angular2-tree.svg?branch=master)](https://travis-ci.org/qjon/angular2-tree)
37
[![npm version](https://badge.fury.io/js/%40rign%2Fangular2-tree.svg)](https://badge.fury.io/js/%40rign%2Fangular2-tree.svg)
48
[![npm](https://img.shields.io/npm/dm/@rign\/angular2-tree.svg)](https://img.shields.io/npm/dm/@rign\/angular2-tree.svg)
59
[![npm](https://img.shields.io/npm/l/@rign\/angular2-tree.svg)](https://github.com/qjon/angular2-tree/blob/master/LICENSE)
610

7-
# angular2-tree
8-
911
## Installation
1012

1113
npm i @rign/angular2-tree
1214

1315

1416
## Usage
1517

16-
Include _TreeModule_ in your application module and create Store with empty state and initialize Effects
18+
Include _TreeModule_ in your application module and create Store with empty state and initialize Effects.
1719

18-
import {TreeModule} from '@rign/angular2-tree/main';
20+
import {TreeModule} from '@rign/angular2-tree';
1921

2022
@NgModule({
2123
declarations: [
@@ -29,14 +31,15 @@ Include _TreeModule_ in your application module and create Store with empty sta
2931
]
3032
})
3133

32-
You need also init translations module, because Tree needs it to translate all labels.
34+
You need also init translations and animations module, because Tree needs it to translate all labels and animate expanding and collapsing.
3335

3436
@NgModule({
3537
declarations: [
3638
...
3739
],
3840
imports: [
3941
...
42+
BrowserAnimationsModule,
4043
TranslationModule.forRoot(),
4144
TreeModule.forRoot()
4245
]
@@ -103,6 +106,18 @@ In component where you create tree, you should register _tree store_, create _Tr
103106
}
104107
}
105108

109+
### CSS Styles
110+
111+
To load default CSS styles and makes our tree looks nice you have to add 2 CSS files to your _angular-cli.json_ file:
112+
113+
...
114+
"styles": [
115+
"../node_modules/bootstrap/dist/css/bootstrap.css",
116+
"../node_modules/font-awesome/css/font-awesome.css",
117+
"../node_modules/@rign/angular2-tree/styles.css",
118+
"styles.css"
119+
],
120+
106121

107122
### Create own item template
108123

@@ -233,6 +248,10 @@ At the end do not forget to add this effects to your app.
233248

234249
## Changes
235250

251+
### v2.3.0
252+
* fix problem with building tree component in AOT
253+
* fix few small issues
254+
236255
### v2.2.0
237256
* add _forRoot_ static method
238257
* change translation module to _ng2-translate_
@@ -302,6 +321,9 @@ At the end do not forget to add this effects to your app.
302321
## Demo
303322

304323
Working demo with _local storage_ you can find [here](https://qjon.github.io/angular2-tree/).
324+
To run Demo locally clone this repository and run
325+
326+
npm start
305327

306328
## License
307329

config/inlineAssets.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
const vfs = require('vinyl-fs');
2+
const inlineNg2Template = require('gulp-inline-ng2-template');
3+
4+
const src = './src';
5+
const dest = './tmp/src';
6+
7+
8+
vfs
9+
.src([`${src}/**/*.ts`, `!${src}/**/*.spec.ts`])
10+
.pipe(
11+
inlineNg2Template({
12+
base: `${src}`,
13+
useRelativePaths: true
14+
})
15+
)
16+
.pipe(
17+
vfs.dest(`${dest}`)
18+
);

config/package.json

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"name": "@rign/angular2-tree",
3+
"version": "2.3.0",
4+
"license": "MIT",
5+
"angular-cli": {},
6+
"scripts": {
7+
"start": "ng serve",
8+
"build": "ng build",
9+
"lint": "ng lint",
10+
"e2e": "ng e2e",
11+
"test": "./node_modules/.bin/karma --config karma.conf.js start"
12+
},
13+
"repository": {
14+
"type": "git",
15+
"url": "git+ssh://[email protected]/qjon/angular2-tree.git"
16+
},
17+
"main": "./bundles/angular2-teee.umd.min.js",
18+
"module": "./esm5/angular2-tree.es5.js",
19+
"es2015": "./esm2015/angular2-tree.es2015.js",
20+
"typings": "./angular2-tree.d.ts",
21+
"author": "Rafal Ignaszewski <[email protected]> http://ignaszewski.pl",
22+
"dependencies": {
23+
"@angular/animations": "^5.2.0",
24+
"@angular/cdk": "^2.0.0-beta.12",
25+
"@angular/common": "^5.2.0",
26+
"@angular/compiler": "^5.2.0",
27+
"@angular/core": "^5.2.0",
28+
"@angular/forms": "^5.2.0",
29+
"@angular/http": "^5.2.0",
30+
"@angular/platform-browser": "^5.2.0",
31+
"@angular/platform-browser-dynamic": "^5.2.0",
32+
"@angular/router": "^5.0.0",
33+
"@ngrx/core": "^1.2.0",
34+
"@ngrx/effects": "^5.1.0",
35+
"@ngrx/store": "^5.1.0",
36+
"@ngrx/store-devtools": "^4.0.0",
37+
"angular2-uuid": "^1.1.1",
38+
"bootstrap": "^3.3.7",
39+
"core-js": "^2.4.1",
40+
"font-awesome": "^4.6.3",
41+
"ng2-dnd": "^2.2.2",
42+
"ng2-translate": "^5.0.0",
43+
"ngx-contextmenu": "^2.0.0-beta.6",
44+
"rxjs": "^5.5.6",
45+
"zone.js": "^0.8.4"
46+
},
47+
"devDependencies": {
48+
}
49+
}

config/rollup-esm2015.conf.js

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
//rollup.config.ts
2+
3+
import alias from 'rollup-plugin-alias';
4+
import resolve from 'rollup-plugin-node-resolve';
5+
import typescript from 'rollup-plugin-typescript2';
6+
import angular from 'rollup-plugin-angular-aot';
7+
8+
export default {
9+
input: 'tmp/esm2015/main.js',
10+
output: {
11+
format: 'es',
12+
file: 'dist/esm2015/angular2-tree.es2015.js',
13+
name: 'angular2tree',
14+
sourcemap: false,
15+
globals: {
16+
'@angular/common': 'vendor._angular_common',
17+
'@angular/compiler': 'vendor._angular_compiler',
18+
'@angular/core': 'vendor._angular_core',
19+
'@angular/http': 'vendor._angular_http',
20+
'@angular/platform-browser': 'vendor._angular_platformBrowser',
21+
'@angular/platform-browser-dynamic': 'vendor._angular_platformBrowserDynamic',
22+
'@angular/router': 'vendor._angular_router',
23+
'@angular/forms': 'vendor._angular_forms',
24+
// '@ngrx/core': 'vendor._ngrx_core',
25+
// '@ngrx/store': 'vendor._ngrx_store',
26+
// '@ngrx/effects': 'vendor._ngrx_effects',
27+
// 'ngx-contextmenu': 'vendor._ng_contextmenu',
28+
'rxjs/BehaviorSubject': 'vendor:rxjs_BehaviorSubject',
29+
'rxjs/Observable': 'vendor:rxjs_Observable',
30+
'ng2-translate': 'vendor._ng_translate',
31+
'ng2-dnd': 'vendor._ng_dnd',
32+
}
33+
},
34+
context: 'this',
35+
plugins: [
36+
angular(),
37+
typescript(),
38+
alias({
39+
rxjs: __dirname + '/node_modules/rxjs/_esm2015'
40+
}),
41+
resolve({
42+
jsnext: true,
43+
main: true,
44+
browser: true
45+
})
46+
],
47+
external: [
48+
'@angular/animations',
49+
'@angular/animations/browser',
50+
'@angular/cdk',
51+
'@angular/core',
52+
'@angular/common',
53+
'@angular/common/http',
54+
'@angular/compiler',
55+
'@angular/core',
56+
'@angular/core/testing',
57+
'@angular/http',
58+
'@angular/forms',
59+
'@angular/platform-browser',
60+
'@angular/platform-browser/animations',
61+
'@angular/platform-browser-dynamic',
62+
'@angular/router',
63+
'@angular/router-deprecated',
64+
'@ngrx/core',
65+
'@ngrx/store',
66+
'@ngrx/store/src/selector',
67+
'@ngrx/effects',
68+
'@ngrx/store-devtools',
69+
'ng2-translate',
70+
'ng2-dnd',
71+
'rxjs/add/observable/of',
72+
'rxjs/add/operator/withLatestFrom',
73+
'rxjs/add/observable/merge',
74+
'rxjs/operators',
75+
'rxjs/operator/map',
76+
'rxjs/operator/filter',
77+
'rxjs/BehaviorSubject',
78+
'rxjs/Subject',
79+
'rxjs/Observable',
80+
'rxjs/Subscription',
81+
'ngx-contextmenu'
82+
],
83+
}

config/rollup-esm5.conf.js

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
//rollup.config.ts
2+
3+
import alias from 'rollup-plugin-alias';
4+
import resolve from 'rollup-plugin-node-resolve';
5+
import typescript from 'rollup-plugin-typescript2';
6+
import angular from 'rollup-plugin-angular-aot';
7+
8+
export default {
9+
input: 'tmp/esm5/main.js',
10+
output: {
11+
format: 'es',
12+
file: 'dist/esm5/angular2-tree.es5.js',
13+
name: 'angular2tree',
14+
sourcemap: false,
15+
globals: {}
16+
},
17+
context: 'this',
18+
plugins: [
19+
angular(),
20+
typescript(),
21+
alias({
22+
rxjs: __dirname + '/node_modules/rxjs-es'
23+
}),
24+
resolve({
25+
jsnext: true,
26+
main: true,
27+
browser: true,
28+
modulesOnly: true
29+
})
30+
],
31+
external: [
32+
'@angular/animations',
33+
'@angular/animations/browser',
34+
'@angular/cdk',
35+
'@angular/core',
36+
'@angular/common',
37+
'@angular/common/http',
38+
'@angular/compiler',
39+
'@angular/core',
40+
'@angular/core/testing',
41+
'@angular/http',
42+
'@angular/forms',
43+
'@angular/platform-browser',
44+
'@angular/platform-browser/animations',
45+
'@angular/platform-browser-dynamic',
46+
'@angular/router',
47+
'@angular/router-deprecated',
48+
'@ngrx/core',
49+
'@ngrx/store',
50+
'@ngrx/store/src/selector',
51+
'@ngrx/effects',
52+
'@ngrx/store-devtools',
53+
'ng2-translate',
54+
'ng2-dnd',
55+
'rxjs/add/observable/of',
56+
'rxjs/add/operator/withLatestFrom',
57+
'rxjs/add/observable/merge',
58+
'rxjs/operators',
59+
'rxjs/operator/map',
60+
'rxjs/operator/filter',
61+
'rxjs/BehaviorSubject',
62+
'rxjs/Subject',
63+
'rxjs/Observable',
64+
'rxjs/Subscription',
65+
'ngx-contextmenu'
66+
],
67+
}

0 commit comments

Comments
 (0)