/
tabLayoutTest.component.ts
99 lines (93 loc) · 3.25 KB
/
tabLayoutTest.component.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
import { Component, OnInit, Input } from '@angular/core';
import { ShellService, ParameterService, ResourceService } from 'plotter-shell-angular2';
@Component({
selector: 'v-tab-layout-test',
template: `
<p-tab-layout [state]="state" [p-parent-visible]="pParentVisible"></p-tab-layout>
`,
styles: [`
:host {
display: flex;
flex-direction: column;
background-color: white;
padding: 10px;
width: 100%;
height: 100%;
}
:host > p-tab-layout {
position: relative;
flex: 1 0 auto;
}
h1 { background-color: cadetblue; }
p { background-color: lightsalmon; }
`]
})
export class TabLayoutTestComponent implements OnInit {
@Input('p-parent-visible') pParentVisible: boolean = true;
public reuseTab: boolean = true;
constructor(
private shellService: ShellService,
public parameterService: ParameterService,
public resourceService: ResourceService) {
let that = this;
}
state = {
layout: {
title: '--- Tab Layout Test :) ---',
header: {
upHeight: 180,
uniqueId: 'x7',
cmodule: "plotter-view-samples-angular2/views/viewSamples.module",
component: "WindFarmDetailsComponent",
state: { "name": 'Solano County' }
},
activeTab: <any>null,
tabs: [{
title: '--- Tab One ---',
header: {
upHeight: 180,
uniqueId: 'x7',
cmodule: "plotter-view-samples-angular2/views/viewSamples.module",
component: "WindFarmDetailsComponent",
state: { "name": 'Zond-PanAero Windsystems' }
},
tabs: [{
title: '--- Tab a ---',
header: {
upHeight: 180,
uniqueId: 'x7',
cmodule: "plotter-view-samples-angular2/views/viewSamples.module",
component: "WindFarmDetailsComponent",
state: { "name": 'Zond-PanAero Windsystems' }
}
}
, {
title: '--- Tab b ---',
header: {
upHeight: 180,
uniqueId: 'x7',
cmodule: "plotter-view-samples-angular2/views/viewSamples.module",
component: "WindFarmDetailsComponent",
state: { "name": 'Radial Wind Farm' }
}
}]
}
, {
title: '--- Tab Two ---',
header: {
upHeight: 180,
uniqueId: 'x7',
cmodule: "plotter-view-samples-angular2/views/viewSamples.module",
component: "WindFarmDetailsComponent",
state: { "name": 'Radial Wind Farm' }
}
}
]
}
}
ngOnInit() {
if (this.state.layout.tabs && this.state.layout.tabs.length > 0) {
this.state.layout.activeTab = this.state.layout.tabs[0];
}
}
}