feat(app\components): create tree view component

This commit is contained in:
tibing 2016-07-04 17:07:51 +03:00
parent e7d21b2239
commit 070cec726e
11 changed files with 117 additions and 0 deletions

View file

@ -0,0 +1,25 @@
import {Component} from '@angular/core';
import {RouteConfig} from '@angular/router-deprecated';
import {TreeView} from "./components/treeView";
@Component({
selector: 'components',
pipes: [],
providers: [],
styles: [],
template: `<router-outlet></router-outlet>`
})
@RouteConfig([
{
name: 'TreeView',
component: TreeView,
path: '/tree-view',
useAsDefault: true
}
])
export class Components {
constructor() {
}
}

View file

@ -0,0 +1 @@
@import '../../theme/sass/treeView';

View file

@ -0,0 +1 @@
export * from './treeView.component';

View file

@ -0,0 +1,37 @@
import {Component} from '@angular/core';
import {BranchyComponent, TreeModel} from 'ng2-branchy';
import {BaCard} from "../../../../theme/components/baCard/baCard.component";
@Component({
selector: 'tree-view',
directives: [BranchyComponent, BaCard],
template: require('./treeView.html'),
})
export class TreeView {
constructor() {
}
private tree: TreeModel = {
value: 'Programming languages by programming paradigm',
children: [
{
value: 'Object-oriented programming',
children: [
{value: 'Java'},
{value: 'C++'},
{value: 'C#'},
]
},
{
value: 'Prototype-based programming',
children: [
{value: 'JavaScript'},
{value: 'CoffeeScript'},
{value: 'Lua'},
]
}
]
};
}

View file

@ -0,0 +1,5 @@
<div class="col-md-6">
<ba-card title="basic">
<branchy id="tree-view" [tree]="tree"></branchy>
</ba-card>
</div>

View file

@ -0,0 +1 @@
export * from './components.component';

View file

@ -10,6 +10,7 @@ import {Charts} from './charts';
import {Forms} from './forms';
import {Tables} from './tables';
import {Editors} from "./editors";
import {Components} from "./components/components.component";
@Component({
selector: 'pages',
@ -52,6 +53,11 @@ import {Editors} from "./editors";
path: '/dashboard',
useAsDefault: true,
},
{
name: 'Components',
component: Components,
path: '/components/...'
},
{
name: 'Ui',
component: Ui,