sgh-navbar 0.0.35 → 0.0.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/karma.conf.js +44 -0
- package/ng-package.json +7 -0
- package/package.json +11 -31
- package/src/lib/sgh-navbar.component.spec.ts +23 -0
- package/src/lib/sgh-navbar.component.ts +20 -0
- package/src/lib/sgh-navbar.module.ts +48 -0
- package/src/lib/sgh-navbar.service.spec.ts +16 -0
- package/src/lib/sgh-navbar.service.ts +34 -0
- package/src/lib/sidenav/helper.ts +25 -0
- package/src/lib/sidenav/menu-list-item/item1/item1.component.html +1 -0
- package/src/lib/sidenav/menu-list-item/item1/item1.component.scss +0 -0
- package/src/lib/sidenav/menu-list-item/item1/item1.component.spec.ts +25 -0
- package/src/lib/sidenav/menu-list-item/item1/item1.component.ts +15 -0
- package/src/lib/sidenav/menu-list-item/item1/sub-item1/sub-item1.component.html +1 -0
- package/src/lib/sidenav/menu-list-item/item1/sub-item1/sub-item1.component.scss +0 -0
- package/src/lib/sidenav/menu-list-item/item1/sub-item1/sub-item1.component.spec.ts +25 -0
- package/src/lib/sidenav/menu-list-item/item1/sub-item1/sub-item1.component.ts +15 -0
- package/src/lib/sidenav/menu-list-item/item2/item2.component.html +1 -0
- package/src/lib/sidenav/menu-list-item/item2/item2.component.scss +0 -0
- package/src/lib/sidenav/menu-list-item/item2/item2.component.spec.ts +25 -0
- package/src/lib/sidenav/menu-list-item/item2/item2.component.ts +15 -0
- package/src/lib/sidenav/menu-list-item/item3/item3.component.html +1 -0
- package/src/lib/sidenav/menu-list-item/item3/item3.component.scss +0 -0
- package/src/lib/sidenav/menu-list-item/item3/item3.component.spec.ts +25 -0
- package/src/lib/sidenav/menu-list-item/item3/item3.component.ts +15 -0
- package/src/lib/sidenav/menu-list-item/menu-list-item.component.html +17 -0
- package/src/lib/sidenav/menu-list-item/menu-list-item.component.scss +128 -0
- package/src/lib/sidenav/menu-list-item/menu-list-item.component.spec.ts +25 -0
- package/src/lib/sidenav/menu-list-item/menu-list-item.component.ts +42 -0
- package/src/lib/sidenav/nav-data.ts +98 -0
- package/src/lib/sidenav/sidenav-data.ts +12 -0
- package/src/lib/sidenav/sidenav.component.html +34 -0
- package/src/lib/sidenav/sidenav.component.scss +173 -0
- package/src/lib/sidenav/sidenav.component.ts +84 -0
- package/src/lib/sidenav/sublevel-menu.component.ts +106 -0
- package/src/lib/toolbar/assets/Synergen_Logo-Large2.png +0 -0
- package/src/lib/toolbar/noftification-list/noftification-list.component.html +18 -0
- package/src/lib/toolbar/noftification-list/noftification-list.component.scss +67 -0
- package/src/lib/toolbar/noftification-list/noftification-list.component.spec.ts +25 -0
- package/src/lib/toolbar/noftification-list/noftification-list.component.ts +14 -0
- package/src/lib/toolbar/search.pipe.ts +18 -0
- package/src/lib/toolbar/sub-client-dialog/sub-client-dialog.component.html +14 -0
- package/src/lib/toolbar/sub-client-dialog/sub-client-dialog.component.scss +40 -0
- package/src/lib/toolbar/sub-client-dialog/sub-client-dialog.component.spec.ts +23 -0
- package/src/lib/toolbar/sub-client-dialog/sub-client-dialog.component.ts +41 -0
- package/src/lib/toolbar/toolbar-data.ts +35 -0
- package/src/lib/toolbar/toolbar.component.html +79 -0
- package/src/lib/toolbar/toolbar.component.scss +493 -0
- package/src/lib/toolbar/toolbar.component.ts +218 -0
- package/{public-api.d.ts → src/public-api.ts} +6 -0
- package/src/test.ts +15 -0
- package/tsconfig.lib.json +15 -0
- package/tsconfig.lib.prod.json +10 -0
- package/tsconfig.spec.json +17 -0
- package/esm2020/lib/sgh-navbar.component.mjs +0 -22
- package/esm2020/lib/sgh-navbar.module.mjs +0 -77
- package/esm2020/lib/sgh-navbar.service.mjs +0 -36
- package/esm2020/lib/sidenav/helper.mjs +0 -12
- package/esm2020/lib/sidenav/menu-list-item/menu-list-item.component.mjs +0 -46
- package/esm2020/lib/sidenav/nav-data.mjs +0 -97
- package/esm2020/lib/sidenav/sidenav-data.mjs +0 -3
- package/esm2020/lib/sidenav/sidenav.component.mjs +0 -92
- package/esm2020/lib/sidenav/sublevel-menu.component.mjs +0 -168
- package/esm2020/lib/toolbar/noftification-list/noftification-list.component.mjs +0 -14
- package/esm2020/lib/toolbar/search.pipe.mjs +0 -21
- package/esm2020/lib/toolbar/sub-client-dialog/sub-client-dialog.component.mjs +0 -47
- package/esm2020/lib/toolbar/toolbar-data.mjs +0 -9
- package/esm2020/lib/toolbar/toolbar.component.mjs +0 -214
- package/esm2020/public-api.mjs +0 -10
- package/esm2020/sgh-navbar.mjs +0 -5
- package/fesm2015/sgh-navbar.mjs +0 -817
- package/fesm2015/sgh-navbar.mjs.map +0 -1
- package/fesm2020/sgh-navbar.mjs +0 -809
- package/fesm2020/sgh-navbar.mjs.map +0 -1
- package/index.d.ts +0 -5
- package/lib/sgh-navbar.component.d.ts +0 -8
- package/lib/sgh-navbar.module.d.ts +0 -21
- package/lib/sgh-navbar.service.d.ts +0 -15
- package/lib/sidenav/helper.d.ts +0 -9
- package/lib/sidenav/menu-list-item/menu-list-item.component.d.ts +0 -16
- package/lib/sidenav/nav-data.d.ts +0 -2
- package/lib/sidenav/sidenav-data.d.ts +0 -10
- package/lib/sidenav/sidenav.component.d.ts +0 -24
- package/lib/sidenav/sublevel-menu.component.d.ts +0 -18
- package/lib/toolbar/noftification-list/noftification-list.component.d.ts +0 -8
- package/lib/toolbar/search.pipe.d.ts +0 -7
- package/lib/toolbar/sub-client-dialog/sub-client-dialog.component.d.ts +0 -19
- package/lib/toolbar/toolbar-data.d.ts +0 -32
- package/lib/toolbar/toolbar.component.d.ts +0 -41
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { INavbarData } from "./helper";
|
|
2
|
+
|
|
3
|
+
export const navbarData: INavbarData[] = [
|
|
4
|
+
{
|
|
5
|
+
"label": "Dashboard",
|
|
6
|
+
"icon": "home",
|
|
7
|
+
"routeLink": "dashboard",
|
|
8
|
+
"visible": true,
|
|
9
|
+
"items": [
|
|
10
|
+
{
|
|
11
|
+
"label": "Cards",
|
|
12
|
+
"icon": "home",
|
|
13
|
+
"routeLink": "dashboard/cards",
|
|
14
|
+
"visible": true,
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"label": "Charts",
|
|
18
|
+
"icon": "home",
|
|
19
|
+
"routeLink": "dashboard/charts",
|
|
20
|
+
"visible": true,
|
|
21
|
+
"items": [
|
|
22
|
+
{
|
|
23
|
+
"label": "Vertical bar chart",
|
|
24
|
+
"icon": "",
|
|
25
|
+
"routeLink": "dashboard/charts/pages/vertical-bar-chart",
|
|
26
|
+
"visible": true
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"label": "Horizontal bar chart",
|
|
30
|
+
"icon": "",
|
|
31
|
+
"routeLink": "dashboard/charts/pages/horizontal-bar-chart",
|
|
32
|
+
"visible": true
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"label": "Grouped horizontal bar chart",
|
|
36
|
+
"icon": "",
|
|
37
|
+
"routeLink": "dashboard/charts/pages/grouped-horizontal-bar-chart",
|
|
38
|
+
"visible": true
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"label": "Grouped vertical bar chart",
|
|
42
|
+
"icon": "",
|
|
43
|
+
"routeLink": "dashboard/charts/pages/grouped-vertical-bar-chart",
|
|
44
|
+
"visible": true
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"label": "Pie chart",
|
|
48
|
+
"icon": "",
|
|
49
|
+
"routeLink": "dashboard/charts/pages/pie-chart",
|
|
50
|
+
"visible": true
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"label": "Advanced pie chart",
|
|
54
|
+
"icon": "",
|
|
55
|
+
"routeLink": "dashboard/charts/pages/advanced-pie-chart",
|
|
56
|
+
"visible": true
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"label": "Pie grid chart",
|
|
60
|
+
"icon": "",
|
|
61
|
+
"routeLink": "dashboard/charts/pages/pie-grid-chart",
|
|
62
|
+
"visible": true
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"label": "Line chart",
|
|
66
|
+
"icon": "",
|
|
67
|
+
"routeLink": "dashboard/charts/pages/line-chart",
|
|
68
|
+
"visible": true
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"label": "Number card chart",
|
|
72
|
+
"icon": "",
|
|
73
|
+
"routeLink": "dashboard/charts/pages/number-card-chart",
|
|
74
|
+
"visible": true
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"label": "Linear gauge chart",
|
|
78
|
+
"icon": "",
|
|
79
|
+
"routeLink": "dashboard/charts/pages/linear-gauge-chart",
|
|
80
|
+
"visible": true
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"label": "Combo chart",
|
|
84
|
+
"icon": "",
|
|
85
|
+
"routeLink": "dashboard/charts/pages/combo-chart",
|
|
86
|
+
"visible": true
|
|
87
|
+
}
|
|
88
|
+
]
|
|
89
|
+
}
|
|
90
|
+
]
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"label": "Form elements",
|
|
94
|
+
"icon": "home",
|
|
95
|
+
"routeLink": "main",
|
|
96
|
+
"visible": true,
|
|
97
|
+
},
|
|
98
|
+
];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {INavbarData} from "./helper";
|
|
2
|
+
import {ClientListItem, SubClientListItem} from "../toolbar/toolbar-data";
|
|
3
|
+
|
|
4
|
+
export class SidenavData {
|
|
5
|
+
navData:INavbarData[];
|
|
6
|
+
bgColor:string;
|
|
7
|
+
imgSm:string;
|
|
8
|
+
imgLg:string;
|
|
9
|
+
client?: ClientListItem;
|
|
10
|
+
subclient?: SubClientListItem;
|
|
11
|
+
activeRole?: string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<div class="close sidenav-overlay" *ngIf="expanded"></div>
|
|
2
|
+
<aside class="sgh-sidebar" *ngIf="expanded" [@slideInOut]>
|
|
3
|
+
<div class="menu-wrapper">
|
|
4
|
+
<div class="sidebar_div " *ngFor="let data of sidenavData.navData">
|
|
5
|
+
<a (click)="onItemSelected(data)"
|
|
6
|
+
[routerLink]="[data.routeLink]" routerLinkActive="item-active" *ngIf="data.visible">
|
|
7
|
+
<div class="text-wrap">
|
|
8
|
+
<div class="icon-wrapper">
|
|
9
|
+
<i class="fa-size fa fa-{{data.icon}}"></i>
|
|
10
|
+
</div>
|
|
11
|
+
<div>
|
|
12
|
+
{{data.label}}
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
<i class="fa-size fa fa-angle-down" *ngIf="!(data.items == undefined)"
|
|
16
|
+
[@indicatorRotate]="data.expanded ? 'expanded': 'collapsed'"></i>
|
|
17
|
+
</a>
|
|
18
|
+
<div class="sub-link-wrapper" *ngIf="data.expanded">
|
|
19
|
+
<app-menu-list-item [items]="data.items">
|
|
20
|
+
</app-menu-list-item>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
<div class="auth-info-wrp">
|
|
24
|
+
<div *ngIf="client && subclient" class="client-info-wrp">
|
|
25
|
+
<div>{{client?.text}}</div>
|
|
26
|
+
<i class="fa fa-angle-right"></i>
|
|
27
|
+
<div>{{subclient?.text}}</div>
|
|
28
|
+
</div>
|
|
29
|
+
<div *ngIf="sidenavData.activeRole" class="role-info-wrp">
|
|
30
|
+
<span class="role-info-text">Logged in as </span>
|
|
31
|
+
<span class="role-info-text role">{{sidenavData.activeRole}}</span></div>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
</aside>
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
.sidebar_div a > div > i {
|
|
2
|
+
padding-right: 10px;
|
|
3
|
+
}
|
|
4
|
+
.menu-wrapper{
|
|
5
|
+
min-height: calc(100vh - 70px);
|
|
6
|
+
overflow: auto;
|
|
7
|
+
position: relative;
|
|
8
|
+
.auth-info-wrp{
|
|
9
|
+
position: absolute;
|
|
10
|
+
bottom: 0;
|
|
11
|
+
width: 100%;
|
|
12
|
+
padding-top: 5px;
|
|
13
|
+
border-top: 1px solid lightgrey;
|
|
14
|
+
color: #005860;
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
.client-info-wrp {
|
|
18
|
+
display: flex;
|
|
19
|
+
gap: 10px;
|
|
20
|
+
font-size: 12px;
|
|
21
|
+
font-weight: bold;
|
|
22
|
+
}
|
|
23
|
+
.role-info-wrp {
|
|
24
|
+
font-size: 12px;
|
|
25
|
+
.role-info-text{
|
|
26
|
+
font-weight: normal;
|
|
27
|
+
&.role{
|
|
28
|
+
font-weight: bold;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
.fa-size {
|
|
35
|
+
font-size: 1.6em;
|
|
36
|
+
line-height: .75em;
|
|
37
|
+
vertical-align: -15%;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.sgh-sidebar {
|
|
41
|
+
height: auto;
|
|
42
|
+
min-height: 100% !important;
|
|
43
|
+
max-height: calc(100vh - 60px);
|
|
44
|
+
box-shadow: 0 1px 0 -1px rgba(0, 0, 0, 0), 0 1px 1px rgba(0, 0, 0, 0.2), 0 1px 3px rgba(0, 0, 0, 0.1215686275);
|
|
45
|
+
border-right: none;
|
|
46
|
+
overflow-y: auto;
|
|
47
|
+
padding: 5px 0;
|
|
48
|
+
font-size: 12px;
|
|
49
|
+
margin-right: 10px;
|
|
50
|
+
background: white;
|
|
51
|
+
width: 240px;
|
|
52
|
+
display: flex;
|
|
53
|
+
flex-direction: column;
|
|
54
|
+
align-items: center !important;
|
|
55
|
+
z-index: 1;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.sidebar_div {
|
|
59
|
+
margin: 0;
|
|
60
|
+
padding: 0;
|
|
61
|
+
width: 220px;
|
|
62
|
+
overflow: hidden !important;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/* sidebar_div links */
|
|
66
|
+
.sidebar_div a {
|
|
67
|
+
color: #005860;
|
|
68
|
+
padding: 10px 14px;
|
|
69
|
+
text-decoration: none;
|
|
70
|
+
margin: 0 5px;
|
|
71
|
+
display: flex;
|
|
72
|
+
align-items: center;
|
|
73
|
+
justify-content: space-between;
|
|
74
|
+
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/* Active/current link */
|
|
78
|
+
.sidebar_div a.active {
|
|
79
|
+
background-color: #006068;
|
|
80
|
+
border-radius: 13px;
|
|
81
|
+
|
|
82
|
+
.text-wrap , .text-wrapper{
|
|
83
|
+
color: white !important;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.text-wrap{
|
|
88
|
+
display: flex;
|
|
89
|
+
justify-content: flex-start;
|
|
90
|
+
width: 100%;
|
|
91
|
+
.icon-wrapper{
|
|
92
|
+
width: 15%;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
/* Links on mouse-over */
|
|
96
|
+
.sidebar_div a:hover:not(.active) {
|
|
97
|
+
background-color: #26787f !important;
|
|
98
|
+
color: white;
|
|
99
|
+
border-radius: 12px;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/* Page content. The value of the margin-left property should match the value of the sidebar_div's width property */
|
|
103
|
+
div.content {
|
|
104
|
+
margin-left: 200px;
|
|
105
|
+
padding: 1px 16px;
|
|
106
|
+
height: 1000px;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/* On screens that are less than 700px wide, make the sidebar_div into a topbar */
|
|
110
|
+
@media screen and (max-width: 700px) {
|
|
111
|
+
.sidebar_div {
|
|
112
|
+
//width: 100%;
|
|
113
|
+
height: auto;
|
|
114
|
+
position: relative;
|
|
115
|
+
}
|
|
116
|
+
div.content {
|
|
117
|
+
margin-left: 0;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/* On screens that are less than 400px, display the bar vertically, instead of horizontally */
|
|
122
|
+
@media screen and (max-width: 400px) {
|
|
123
|
+
.sidebar_div a {
|
|
124
|
+
text-align: center;
|
|
125
|
+
float: none;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
.nav-list li a {
|
|
131
|
+
text-decoration: none;
|
|
132
|
+
display: block;
|
|
133
|
+
padding: 10px;
|
|
134
|
+
cursor: pointer;
|
|
135
|
+
border-bottom: 1px solid #515151 !important;
|
|
136
|
+
color: #9d9d9d;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.nav-list > li > a {
|
|
140
|
+
color: #C4C4C4;
|
|
141
|
+
font-size: 14px;
|
|
142
|
+
padding-left: 15px !important;
|
|
143
|
+
border-bottom: 1px solid #585858;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.nav-list > li > a:hover {
|
|
147
|
+
background-color: #444444;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.sidenav-overlay {
|
|
151
|
+
display: none;
|
|
152
|
+
position: fixed;
|
|
153
|
+
width: 100%;
|
|
154
|
+
height: 100%;
|
|
155
|
+
background-color: #00000063 !important;
|
|
156
|
+
left: 0%;
|
|
157
|
+
top: 0;
|
|
158
|
+
z-index: 1;
|
|
159
|
+
cursor: default;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
@media screen and (max-width: 600px) {
|
|
163
|
+
.sidebar_div{
|
|
164
|
+
margin: 0 0 !important;
|
|
165
|
+
}
|
|
166
|
+
.sgh-sidebar {
|
|
167
|
+
position: fixed !important;
|
|
168
|
+
background: white !important;
|
|
169
|
+
}
|
|
170
|
+
.sidenav-overlay {
|
|
171
|
+
display: block;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import {animate, keyframes, state, style, transition, trigger} from '@angular/animations';
|
|
2
|
+
import {
|
|
3
|
+
Component,
|
|
4
|
+
Output,
|
|
5
|
+
EventEmitter,
|
|
6
|
+
OnInit,
|
|
7
|
+
Input,
|
|
8
|
+
} from '@angular/core';
|
|
9
|
+
import {Router} from '@angular/router';
|
|
10
|
+
import {navbarData} from './nav-data';
|
|
11
|
+
import {SghNavbarService} from "../sgh-navbar.service";
|
|
12
|
+
import {SidenavData} from "./sidenav-data";
|
|
13
|
+
|
|
14
|
+
interface SideNavToggle {
|
|
15
|
+
screenWidth: number;
|
|
16
|
+
collapsed: boolean;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@Component({
|
|
20
|
+
selector: 'app-sidenav',
|
|
21
|
+
templateUrl: './sidenav.component.html',
|
|
22
|
+
styleUrls: ['./sidenav.component.scss'],
|
|
23
|
+
animations: [
|
|
24
|
+
trigger('rotate', [
|
|
25
|
+
transition(':enter', [
|
|
26
|
+
animate('1000ms',
|
|
27
|
+
keyframes([
|
|
28
|
+
style({transform: 'rotate(0deg)', offset: '0'}),
|
|
29
|
+
style({transform: 'rotate(2turn)', offset: '1'})
|
|
30
|
+
])
|
|
31
|
+
)
|
|
32
|
+
])
|
|
33
|
+
]),
|
|
34
|
+
trigger('indicatorRotate', [
|
|
35
|
+
state('collapsed', style({transform: 'rotate(0deg)'})),
|
|
36
|
+
state('expanded', style({transform: 'rotate(180deg)'})),
|
|
37
|
+
transition('expanded <=> collapsed',
|
|
38
|
+
animate('225ms cubic-bezier(0.4,0.0,0.2,1)')
|
|
39
|
+
),
|
|
40
|
+
]),
|
|
41
|
+
trigger('slideInOut', [
|
|
42
|
+
transition(':enter', [style({transform: 'translateX(-100px)'}), animate('.5s ease-out', style({transform: 'translateX(0%)'}))]),
|
|
43
|
+
transition(':leave', [
|
|
44
|
+
style({ transform: 'translateX(0%)' }),
|
|
45
|
+
animate('.5s ease-out', style({ transform: 'translateX(-100%)' }))
|
|
46
|
+
])
|
|
47
|
+
])
|
|
48
|
+
]
|
|
49
|
+
})
|
|
50
|
+
export class SidenavComponent implements OnInit {
|
|
51
|
+
|
|
52
|
+
@Output() onToggleSideNav: EventEmitter<SideNavToggle> = new EventEmitter();
|
|
53
|
+
@Input() expanded:boolean;
|
|
54
|
+
@Input() sidenavData: SidenavData = {
|
|
55
|
+
navData: navbarData,
|
|
56
|
+
bgColor: '#fff',
|
|
57
|
+
imgSm: '',
|
|
58
|
+
imgLg: ''
|
|
59
|
+
}
|
|
60
|
+
client;
|
|
61
|
+
subclient;
|
|
62
|
+
|
|
63
|
+
constructor(public router: Router, private sidebarService: SghNavbarService) {
|
|
64
|
+
this.sidebarService.getClient().subscribe((client) => {
|
|
65
|
+
this.client = client;
|
|
66
|
+
});
|
|
67
|
+
this.sidebarService.getSubclient().subscribe((subclient) => {
|
|
68
|
+
this.subclient = subclient;
|
|
69
|
+
})
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
ngOnInit(): void {
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
onItemSelected(item: any) {
|
|
77
|
+
if (!item.items || !item.items.length) {
|
|
78
|
+
this.router.navigate([item.routeLink]).then();
|
|
79
|
+
}
|
|
80
|
+
if (item.items && item.items.length) {
|
|
81
|
+
item.expanded = !item.expanded;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { animate, state, style, transition, trigger } from '@angular/animations';
|
|
2
|
+
import { Component, Input, OnInit } from '@angular/core';
|
|
3
|
+
import { Router } from '@angular/router';
|
|
4
|
+
import { fadeInOut, INavbarData } from './helper';
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
selector: 'app-sublevel-menu',
|
|
8
|
+
template: `
|
|
9
|
+
<ul *ngIf="collapsed && data.items && data.items.length > 0"
|
|
10
|
+
[@submenu]="expanded
|
|
11
|
+
? {value: 'visible',
|
|
12
|
+
params: {transitionParams: '400ms cubic-bezier(0.86, 0, 0.07, 1)', height: '*'}}
|
|
13
|
+
: {value: 'hidden',
|
|
14
|
+
params: {transitionParams: '400ms cubic-bezier(0.86, 0, 0.07, 1)', height: '0'}}"
|
|
15
|
+
class="sublevel-nav"
|
|
16
|
+
>
|
|
17
|
+
<li *ngFor="let item of data.items" class="sublevel-nav-item">
|
|
18
|
+
<a class="sublevel-nav-link"
|
|
19
|
+
(click)="handleClick(item)"
|
|
20
|
+
*ngIf="item.items && item.items.length > 0 && item.visible"
|
|
21
|
+
[ngClass]="getActiveClass(item)"
|
|
22
|
+
>
|
|
23
|
+
<i class="sublevel-link-icon fa fa-circle"></i>
|
|
24
|
+
<span class="sublevel-link-text" @fadeInOut
|
|
25
|
+
*ngIf="collapsed">{{item.label}}</span>
|
|
26
|
+
<i *ngIf="item.items && collapsed" class="menu-collapse-icon"
|
|
27
|
+
[ngClass]="!item.expanded ? 'fal fa-angle-right' : 'fal fa-angle-down'"
|
|
28
|
+
></i>
|
|
29
|
+
</a>
|
|
30
|
+
<a class="sublevel-nav-link"
|
|
31
|
+
*ngIf="(!item.items || (item.items && item.items.length === 0)) && item.visible"
|
|
32
|
+
[routerLink]="[item.routeLink]"
|
|
33
|
+
routerLinkActive="active-sublevel"
|
|
34
|
+
[routerLinkActiveOptions]="{exact: true}"
|
|
35
|
+
>
|
|
36
|
+
<i class="sublevel-link-icon fa fa-circle"></i>
|
|
37
|
+
<span class="sublevel-link-text" @fadeInOut
|
|
38
|
+
*ngIf="collapsed">{{item.label}}</span>
|
|
39
|
+
</a>
|
|
40
|
+
<div *ngIf="item.items && item.items.length > 0">
|
|
41
|
+
<app-sublevel-menu
|
|
42
|
+
[data]="item"
|
|
43
|
+
[collapsed]="collapsed"
|
|
44
|
+
[multiple]="multiple"
|
|
45
|
+
[expanded]="item.expanded"
|
|
46
|
+
></app-sublevel-menu>
|
|
47
|
+
</div>
|
|
48
|
+
</li>
|
|
49
|
+
</ul>
|
|
50
|
+
`,
|
|
51
|
+
styleUrls: ['./sidenav.component.scss'],
|
|
52
|
+
animations: [
|
|
53
|
+
fadeInOut,
|
|
54
|
+
trigger('submenu', [
|
|
55
|
+
state('hidden', style({
|
|
56
|
+
height: '0',
|
|
57
|
+
overflow: 'hidden'
|
|
58
|
+
})),
|
|
59
|
+
state('visible', style({
|
|
60
|
+
height: '*'
|
|
61
|
+
})),
|
|
62
|
+
transition('visible <=> hidden', [style({overflow: 'hidden'}),
|
|
63
|
+
animate('{{transitionParams}}')]),
|
|
64
|
+
transition('void => *', animate(0))
|
|
65
|
+
])
|
|
66
|
+
]
|
|
67
|
+
})
|
|
68
|
+
export class SublevelMenuComponent implements OnInit {
|
|
69
|
+
|
|
70
|
+
@Input() data: INavbarData = {
|
|
71
|
+
routeLink: '',
|
|
72
|
+
icon: '',
|
|
73
|
+
label: '',
|
|
74
|
+
visible: true,
|
|
75
|
+
items: []
|
|
76
|
+
}
|
|
77
|
+
@Input() collapsed = false;
|
|
78
|
+
@Input() animating: boolean | undefined;
|
|
79
|
+
@Input() expanded: boolean | undefined;
|
|
80
|
+
@Input() multiple: boolean = false;
|
|
81
|
+
|
|
82
|
+
constructor(public router: Router) {}
|
|
83
|
+
|
|
84
|
+
ngOnInit(): void {
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
handleClick(item: any): void {
|
|
88
|
+
if (!this.multiple) {
|
|
89
|
+
if (this.data.items && this.data.items.length > 0) {
|
|
90
|
+
for(let modelItem of this.data.items) {
|
|
91
|
+
if (item !==modelItem && modelItem.expanded) {
|
|
92
|
+
modelItem.expanded = false;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
item.expanded = !item.expanded;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
getActiveClass(item: INavbarData): string {
|
|
101
|
+
return item.expanded && this.router.url.includes(item.routeLink)
|
|
102
|
+
? 'active-sublevel'
|
|
103
|
+
: '';
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<div class="notifications-list-wrapper">
|
|
2
|
+
<div class="notifications-list">
|
|
3
|
+
<div class="notifications-title">
|
|
4
|
+
<span class="title mat-h3">Notifications</span>
|
|
5
|
+
</div>
|
|
6
|
+
<div class="notifications-list-item">
|
|
7
|
+
<span class="item-title mat-h4">David James</span>
|
|
8
|
+
<span class="item-description mat-h5">A notification box show message</span>
|
|
9
|
+
</div>
|
|
10
|
+
<div class="notifications-list-item">
|
|
11
|
+
<span class="item-title mat-h4">David James</span>
|
|
12
|
+
<span class="item-description mat-h5">A notification box show message</span>
|
|
13
|
+
</div>
|
|
14
|
+
<div class="notifications-title">
|
|
15
|
+
<span class="see-all mat-h4">See all</span>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
$border-bottom-color: #f1f1f3;
|
|
2
|
+
$sgh-color-palette-50:#e0eced;
|
|
3
|
+
$sgh-color-palette-500:#006068;
|
|
4
|
+
$text-color: rgba(0,0,0,0.87);
|
|
5
|
+
.notifications-list-wrapper {
|
|
6
|
+
padding: 10px;
|
|
7
|
+
position: absolute;
|
|
8
|
+
right: 10px;
|
|
9
|
+
top: 45px;
|
|
10
|
+
z-index: 2;
|
|
11
|
+
color: $text-color;
|
|
12
|
+
width: 400px;
|
|
13
|
+
.notifications-list {
|
|
14
|
+
box-shadow: 0 2px 10px rgba(0,0,0,0.15);
|
|
15
|
+
position: relative;
|
|
16
|
+
.notifications-title {
|
|
17
|
+
background-color: #ffffff;
|
|
18
|
+
text-align: center;
|
|
19
|
+
padding: 20px 10px;
|
|
20
|
+
border-bottom: 1px solid $border-bottom-color;
|
|
21
|
+
}
|
|
22
|
+
.notifications-list-item {
|
|
23
|
+
padding: 10px 10px 10px 30px;
|
|
24
|
+
background-color: $sgh-color-palette-50;
|
|
25
|
+
border-bottom: 1px solid $border-bottom-color;
|
|
26
|
+
.item-title {
|
|
27
|
+
margin: 0;
|
|
28
|
+
white-space: normal;
|
|
29
|
+
margin-right: 5px;
|
|
30
|
+
}
|
|
31
|
+
.item-description {
|
|
32
|
+
margin: 0;
|
|
33
|
+
color: $text-color;
|
|
34
|
+
opacity: 0.5;
|
|
35
|
+
white-space: normal;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
.see-all {
|
|
39
|
+
background-color: #ffffff;
|
|
40
|
+
color: $sgh-color-palette-500;
|
|
41
|
+
font-weight: 500;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
@media screen and (max-width: 599px) {
|
|
46
|
+
.notifications-list-wrapper {
|
|
47
|
+
width: auto;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.notifications-list-wrapper {
|
|
52
|
+
-webkit-animation: cardAnim 1s cubic-bezier(0.33, 1, 0.68, 1) 0s 1 normal none;
|
|
53
|
+
animation: cardAnim 1s cubic-bezier(0.33, 1, 0.68, 1) 0s 1 normal none;
|
|
54
|
+
}
|
|
55
|
+
@keyframes cardAnim {
|
|
56
|
+
0% {
|
|
57
|
+
opacity: 0;
|
|
58
|
+
transform: rotateX(-100deg);
|
|
59
|
+
transform-origin: top;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
100% {
|
|
63
|
+
opacity: 1;
|
|
64
|
+
transform: rotateX(0deg);
|
|
65
|
+
transform-origin: top;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { NoftificationListComponent } from './noftification-list.component';
|
|
4
|
+
|
|
5
|
+
describe('NoftificationListComponent', () => {
|
|
6
|
+
let component: NoftificationListComponent;
|
|
7
|
+
let fixture: ComponentFixture<NoftificationListComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
declarations: [ NoftificationListComponent ]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
beforeEach(() => {
|
|
17
|
+
fixture = TestBed.createComponent(NoftificationListComponent);
|
|
18
|
+
component = fixture.componentInstance;
|
|
19
|
+
fixture.detectChanges();
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('should create', () => {
|
|
23
|
+
expect(component).toBeTruthy();
|
|
24
|
+
});
|
|
25
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Component, OnInit } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Component({
|
|
4
|
+
selector: 'app-noftification-list',
|
|
5
|
+
templateUrl: './noftification-list.component.html',
|
|
6
|
+
styleUrls: ['./noftification-list.component.scss']
|
|
7
|
+
})
|
|
8
|
+
export class NoftificationListComponent implements OnInit {
|
|
9
|
+
|
|
10
|
+
constructor() { }
|
|
11
|
+
|
|
12
|
+
ngOnInit(): void {
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Pipe, PipeTransform } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Pipe({
|
|
4
|
+
name: 'search'
|
|
5
|
+
})
|
|
6
|
+
export class SearchPipe implements PipeTransform {
|
|
7
|
+
|
|
8
|
+
transform(values: any, args?: any): any {
|
|
9
|
+
if (args === undefined) {
|
|
10
|
+
return values;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
return values.filter(value => {
|
|
14
|
+
return value.text.toLowerCase().includes(args.toLowerCase());
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<div class="subclientlist-wrapper dialog-wrapper">
|
|
2
|
+
<h4 class="subclientlist-header">Select Sub Client</h4>
|
|
3
|
+
<div class="subclientlist-body">
|
|
4
|
+
<div>
|
|
5
|
+
<mat-radio-group class="subclientlist-radiogrp" aria-label="Select an option">
|
|
6
|
+
<mat-radio-button [value]="item.value" *ngFor="let item of subClientList;index as i" (click)="onSubClientSelect(item)" [checked]="item.checked">{{item.text}}</mat-radio-button>
|
|
7
|
+
</mat-radio-group>
|
|
8
|
+
</div>
|
|
9
|
+
</div>
|
|
10
|
+
<div class="subclientlist-btns">
|
|
11
|
+
<button class="sgh-btn-primary" (click)="onSelectBtnClick()">Select</button>
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
|