sgh-navbar 0.0.37 → 0.0.39
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/esm2020/lib/sgh-navbar.component.mjs +22 -0
- package/esm2020/lib/sgh-navbar.module.mjs +77 -0
- package/esm2020/lib/sgh-navbar.service.mjs +36 -0
- package/esm2020/lib/sidenav/helper.mjs +12 -0
- package/esm2020/lib/sidenav/menu-list-item/menu-list-item.component.mjs +46 -0
- package/esm2020/lib/sidenav/nav-data.mjs +97 -0
- package/esm2020/lib/sidenav/sidenav-data.mjs +3 -0
- package/esm2020/lib/sidenav/sidenav.component.mjs +92 -0
- package/esm2020/lib/sidenav/sublevel-menu.component.mjs +168 -0
- package/esm2020/lib/toolbar/noftification-list/noftification-list.component.mjs +14 -0
- package/esm2020/lib/toolbar/search.pipe.mjs +21 -0
- package/esm2020/lib/toolbar/sub-client-dialog/sub-client-dialog.component.mjs +47 -0
- package/esm2020/lib/toolbar/toolbar-data.mjs +9 -0
- package/esm2020/lib/toolbar/toolbar.component.mjs +214 -0
- package/esm2020/public-api.mjs +10 -0
- package/esm2020/sgh-navbar.mjs +5 -0
- package/fesm2015/sgh-navbar.mjs +817 -0
- package/fesm2015/sgh-navbar.mjs.map +1 -0
- package/fesm2020/sgh-navbar.mjs +809 -0
- package/fesm2020/sgh-navbar.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/sgh-navbar.component.d.ts +8 -0
- package/lib/sgh-navbar.module.d.ts +21 -0
- package/lib/sgh-navbar.service.d.ts +15 -0
- package/lib/sidenav/helper.d.ts +9 -0
- package/lib/sidenav/menu-list-item/menu-list-item.component.d.ts +16 -0
- package/lib/sidenav/nav-data.d.ts +2 -0
- package/lib/sidenav/sidenav-data.d.ts +11 -0
- package/lib/sidenav/sidenav.component.d.ts +24 -0
- package/lib/sidenav/sublevel-menu.component.d.ts +18 -0
- package/lib/toolbar/noftification-list/noftification-list.component.d.ts +8 -0
- package/lib/toolbar/search.pipe.d.ts +7 -0
- package/lib/toolbar/sub-client-dialog/sub-client-dialog.component.d.ts +19 -0
- package/lib/toolbar/toolbar-data.d.ts +32 -0
- package/lib/toolbar/toolbar.component.d.ts +41 -0
- package/package.json +31 -11
- package/{src/public-api.ts → public-api.d.ts} +0 -6
- package/karma.conf.js +0 -44
- package/ng-package.json +0 -7
- package/src/lib/sgh-navbar.component.spec.ts +0 -23
- package/src/lib/sgh-navbar.component.ts +0 -20
- package/src/lib/sgh-navbar.module.ts +0 -48
- package/src/lib/sgh-navbar.service.spec.ts +0 -16
- package/src/lib/sgh-navbar.service.ts +0 -34
- package/src/lib/sidenav/helper.ts +0 -25
- package/src/lib/sidenav/menu-list-item/item1/item1.component.html +0 -1
- 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 +0 -25
- package/src/lib/sidenav/menu-list-item/item1/item1.component.ts +0 -15
- package/src/lib/sidenav/menu-list-item/item1/sub-item1/sub-item1.component.html +0 -1
- 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 +0 -25
- package/src/lib/sidenav/menu-list-item/item1/sub-item1/sub-item1.component.ts +0 -15
- package/src/lib/sidenav/menu-list-item/item2/item2.component.html +0 -1
- 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 +0 -25
- package/src/lib/sidenav/menu-list-item/item2/item2.component.ts +0 -15
- package/src/lib/sidenav/menu-list-item/item3/item3.component.html +0 -1
- 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 +0 -25
- package/src/lib/sidenav/menu-list-item/item3/item3.component.ts +0 -15
- package/src/lib/sidenav/menu-list-item/menu-list-item.component.html +0 -17
- package/src/lib/sidenav/menu-list-item/menu-list-item.component.scss +0 -128
- package/src/lib/sidenav/menu-list-item/menu-list-item.component.spec.ts +0 -25
- package/src/lib/sidenav/menu-list-item/menu-list-item.component.ts +0 -42
- package/src/lib/sidenav/nav-data.ts +0 -98
- package/src/lib/sidenav/sidenav-data.ts +0 -12
- package/src/lib/sidenav/sidenav.component.html +0 -34
- package/src/lib/sidenav/sidenav.component.scss +0 -173
- package/src/lib/sidenav/sidenav.component.ts +0 -84
- package/src/lib/sidenav/sublevel-menu.component.ts +0 -106
- package/src/lib/toolbar/assets/Synergen_Logo-Large2.png +0 -0
- package/src/lib/toolbar/noftification-list/noftification-list.component.html +0 -18
- package/src/lib/toolbar/noftification-list/noftification-list.component.scss +0 -67
- package/src/lib/toolbar/noftification-list/noftification-list.component.spec.ts +0 -25
- package/src/lib/toolbar/noftification-list/noftification-list.component.ts +0 -14
- package/src/lib/toolbar/search.pipe.ts +0 -18
- package/src/lib/toolbar/sub-client-dialog/sub-client-dialog.component.html +0 -14
- package/src/lib/toolbar/sub-client-dialog/sub-client-dialog.component.scss +0 -40
- package/src/lib/toolbar/sub-client-dialog/sub-client-dialog.component.spec.ts +0 -23
- package/src/lib/toolbar/sub-client-dialog/sub-client-dialog.component.ts +0 -41
- package/src/lib/toolbar/toolbar-data.ts +0 -35
- package/src/lib/toolbar/toolbar.component.html +0 -79
- package/src/lib/toolbar/toolbar.component.scss +0 -493
- package/src/lib/toolbar/toolbar.component.ts +0 -218
- package/src/test.ts +0 -15
- package/tsconfig.lib.json +0 -15
- package/tsconfig.lib.prod.json +0 -10
- package/tsconfig.spec.json +0 -17
|
@@ -1,218 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AfterViewInit,
|
|
3
|
-
Component,
|
|
4
|
-
EventEmitter,
|
|
5
|
-
HostListener,
|
|
6
|
-
Input,
|
|
7
|
-
Output,
|
|
8
|
-
ViewChild
|
|
9
|
-
} from '@angular/core';
|
|
10
|
-
import {fadeInOut} from '../sidenav/helper';
|
|
11
|
-
import {MatDialog} from "@angular/material/dialog";
|
|
12
|
-
import {MatMenuTrigger} from "@angular/material/menu";
|
|
13
|
-
import {ClientListItem, SubClientListItem, ToolbarData} from "./toolbar-data";
|
|
14
|
-
import {SubClientDialogComponent} from "./sub-client-dialog/sub-client-dialog.component";
|
|
15
|
-
import {SghNavbarService} from "../sgh-navbar.service";
|
|
16
|
-
|
|
17
|
-
@Component({
|
|
18
|
-
selector: 'app-toolbar',
|
|
19
|
-
templateUrl: './toolbar.component.html',
|
|
20
|
-
styleUrls: ['./toolbar.component.scss'],
|
|
21
|
-
animations: [
|
|
22
|
-
fadeInOut
|
|
23
|
-
]
|
|
24
|
-
})
|
|
25
|
-
export class ToolbarComponent implements AfterViewInit {
|
|
26
|
-
@Input() expanded: boolean;
|
|
27
|
-
@Output() toggleSidebarEvent = new EventEmitter<boolean>();
|
|
28
|
-
@Input() toolbarData: ToolbarData = {
|
|
29
|
-
themeOptions: [{
|
|
30
|
-
name: 'Sgh-default-theme',
|
|
31
|
-
value: 'sgh-default-theme',
|
|
32
|
-
checked: true
|
|
33
|
-
}, {
|
|
34
|
-
name: 'Sgh-light-theme',
|
|
35
|
-
value: 'sgh-light-theme',
|
|
36
|
-
checked: false
|
|
37
|
-
}, {
|
|
38
|
-
name: 'Sgh-blue-theme',
|
|
39
|
-
value: 'sgh-blue-theme',
|
|
40
|
-
checked: false
|
|
41
|
-
}],
|
|
42
|
-
bgColor: '#fff',
|
|
43
|
-
img: '../assets/images/Synergen_Logo-new.svg',
|
|
44
|
-
profileView: false,
|
|
45
|
-
isNotifNavCollapsed: false,
|
|
46
|
-
searchEnable: true,
|
|
47
|
-
notificationEnable: true,
|
|
48
|
-
profileEnable: true,
|
|
49
|
-
settingsEnable: true,
|
|
50
|
-
clientList: [{
|
|
51
|
-
text: 'Client 1',
|
|
52
|
-
value: 'CLIENT_1',
|
|
53
|
-
selected: true,
|
|
54
|
-
subClientList: [
|
|
55
|
-
{text: 'Sub Client 1', value: 'SUB_CLIENT_1', checked: true},
|
|
56
|
-
{text: 'Sub Client 2', value: 'SUB_CLIENT_2', checked: false},
|
|
57
|
-
{text: 'Sub Client 3', value: 'SUB_CLIENT_3', checked: false}
|
|
58
|
-
]
|
|
59
|
-
}, {
|
|
60
|
-
text: 'Client 2',
|
|
61
|
-
value: 'CLIENT_2',
|
|
62
|
-
selected: false,
|
|
63
|
-
subClientList: [
|
|
64
|
-
{text: 'Sub Client 1', value: 'SUB_CLIENT_1', checked: true},
|
|
65
|
-
{text: 'Sub Client 2', value: 'SUB_CLIENT_2', checked: false}
|
|
66
|
-
]
|
|
67
|
-
}, {
|
|
68
|
-
text: 'Client 3',
|
|
69
|
-
value: 'CLIENT_3',
|
|
70
|
-
selected: false
|
|
71
|
-
}],
|
|
72
|
-
profileContent: '<div>profile content</div>',
|
|
73
|
-
clientConfigurationEnable: true,
|
|
74
|
-
applicationConfigurationEnable: true,
|
|
75
|
-
};
|
|
76
|
-
@Output() searchInputEvent = new EventEmitter<string>();
|
|
77
|
-
@Output() client = new EventEmitter<any>();
|
|
78
|
-
@Output() subClient = new EventEmitter<any>();
|
|
79
|
-
|
|
80
|
-
searchInput = "";
|
|
81
|
-
private prev: any;
|
|
82
|
-
selected: any = 'sgh-default-theme';
|
|
83
|
-
private wasInside = false;
|
|
84
|
-
selectedClient;
|
|
85
|
-
|
|
86
|
-
@ViewChild('clientMenuTrigger') clientMenuTrigger: MatMenuTrigger;
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
@HostListener('click')
|
|
90
|
-
clickInside() {
|
|
91
|
-
this.wasInside = true;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
@HostListener('document:click')
|
|
95
|
-
clickOut() {
|
|
96
|
-
if (!this.wasInside) {
|
|
97
|
-
this.toolbarData.profileView = false;
|
|
98
|
-
this.toolbarData.isThemeCollapsed = false;
|
|
99
|
-
this.toolbarData.isNotifNavCollapsed = false;
|
|
100
|
-
}
|
|
101
|
-
this.wasInside = false;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
constructor(private dialog: MatDialog, private sghNavbarSvc: SghNavbarService) {
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
toggleSidebar(): boolean {
|
|
109
|
-
this.toggleSidebarEvent.emit(this.expanded);
|
|
110
|
-
return this.expanded;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
toggleNotificationList() {
|
|
114
|
-
this.toolbarData.isNotifNavCollapsed = !this.toolbarData.isNotifNavCollapsed
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
clickProfile() {
|
|
118
|
-
this.toolbarData.profileView = !this.toolbarData.profileView
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
onSearchInput() {
|
|
122
|
-
this.searchInputEvent.emit(this.searchInput);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
ngAfterViewInit(): void {
|
|
126
|
-
// initially set client and subclients
|
|
127
|
-
setTimeout(() => {
|
|
128
|
-
this.toolbarData.clientList?.forEach((client: ClientListItem,index) => {
|
|
129
|
-
// select the first client
|
|
130
|
-
if(index == 0){
|
|
131
|
-
client.selected = true;
|
|
132
|
-
this.sghNavbarSvc.setClient(client);
|
|
133
|
-
this.selectedClient = client;
|
|
134
|
-
} else {
|
|
135
|
-
client.selected = false;
|
|
136
|
-
}
|
|
137
|
-
this.initSelectedSubClient(client);
|
|
138
|
-
});
|
|
139
|
-
},100)
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
setClass(selected: any) {
|
|
143
|
-
this.selected = selected;
|
|
144
|
-
window.document.body.classList.remove(this.prev);
|
|
145
|
-
window.document.body.classList.add(selected);
|
|
146
|
-
this.prev = selected;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
protected readonly event = event;
|
|
150
|
-
selectedTheme: string = ''; // To store the selected radio button value
|
|
151
|
-
searchText: any;
|
|
152
|
-
|
|
153
|
-
onRadioClick(themeValue: string) {
|
|
154
|
-
this.selected = themeValue;
|
|
155
|
-
this.setClass(themeValue);
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
toggleSelect(event, clientItem: ClientListItem) { // event on client selection
|
|
159
|
-
// at least one subclient should exist
|
|
160
|
-
if (clientItem.subClientList && clientItem.subClientList.length > 0) { // if sub clients exist open sub client dialog
|
|
161
|
-
const subClientDialogRef = this.dialog.open(SubClientDialogComponent, {
|
|
162
|
-
data: {
|
|
163
|
-
client: clientItem
|
|
164
|
-
},
|
|
165
|
-
minWidth: 400,
|
|
166
|
-
disableClose: true
|
|
167
|
-
});
|
|
168
|
-
|
|
169
|
-
this.selectedClient = clientItem;
|
|
170
|
-
// unselect current selected client
|
|
171
|
-
this.unselectClientItems();
|
|
172
|
-
// select current client
|
|
173
|
-
clientItem.selected = true;
|
|
174
|
-
// select first item of each subclient
|
|
175
|
-
this.selectFirstSubclient();
|
|
176
|
-
|
|
177
|
-
subClientDialogRef.afterClosed().subscribe((event) => {
|
|
178
|
-
this.clientMenuTrigger.focus();
|
|
179
|
-
this.sghNavbarSvc.setClient(clientItem);
|
|
180
|
-
this.sghNavbarSvc.setSubclient(event.data.selectedSubClient);
|
|
181
|
-
|
|
182
|
-
// set the selected subclient item as checked, search by name comparison
|
|
183
|
-
let selectedObj = clientItem.subClientList?.find((scItem) => scItem.text == event.data.selectedSubClient.text);
|
|
184
|
-
selectedObj!.checked = true;
|
|
185
|
-
});
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
initSelectedSubClient(client: ClientListItem) {
|
|
190
|
-
client.subClientList?.forEach((subclient: SubClientListItem,index) => {
|
|
191
|
-
if(index == 0) {
|
|
192
|
-
subclient.checked = true;
|
|
193
|
-
if (client.selected) { // set the first subclient of the first client as selected
|
|
194
|
-
this.sghNavbarSvc.setSubclient(subclient);
|
|
195
|
-
}
|
|
196
|
-
} else { subclient.checked = false; }
|
|
197
|
-
|
|
198
|
-
});
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
unselectClientItems() {
|
|
202
|
-
this.toolbarData.clientList?.forEach((client: ClientListItem) => {
|
|
203
|
-
if (client.selected) {
|
|
204
|
-
client.selected = false;
|
|
205
|
-
}
|
|
206
|
-
});
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
selectFirstSubclient() {
|
|
210
|
-
this.toolbarData.clientList?.forEach((client) => {
|
|
211
|
-
if(client !== this.selectedClient) {
|
|
212
|
-
client.subClientList?.forEach((scItem,index) => {
|
|
213
|
-
index == 0 ? scItem.checked = true: scItem.checked = false;
|
|
214
|
-
});
|
|
215
|
-
}
|
|
216
|
-
})
|
|
217
|
-
}
|
|
218
|
-
}
|
package/src/test.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
|
|
2
|
-
|
|
3
|
-
import 'zone.js';
|
|
4
|
-
import 'zone.js/testing';
|
|
5
|
-
import { getTestBed } from '@angular/core/testing';
|
|
6
|
-
import {
|
|
7
|
-
BrowserDynamicTestingModule,
|
|
8
|
-
platformBrowserDynamicTesting
|
|
9
|
-
} from '@angular/platform-browser-dynamic/testing';
|
|
10
|
-
|
|
11
|
-
// First, initialize the Angular testing environment.
|
|
12
|
-
getTestBed().initTestEnvironment(
|
|
13
|
-
BrowserDynamicTestingModule,
|
|
14
|
-
platformBrowserDynamicTesting(),
|
|
15
|
-
);
|
package/tsconfig.lib.json
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
|
2
|
-
{
|
|
3
|
-
"extends": "../../tsconfig.json",
|
|
4
|
-
"compilerOptions": {
|
|
5
|
-
"outDir": "../../out-tsc/lib",
|
|
6
|
-
"declaration": true,
|
|
7
|
-
"declarationMap": true,
|
|
8
|
-
"inlineSources": true,
|
|
9
|
-
"types": []
|
|
10
|
-
},
|
|
11
|
-
"exclude": [
|
|
12
|
-
"src/test.ts",
|
|
13
|
-
"**/*.spec.ts"
|
|
14
|
-
]
|
|
15
|
-
}
|
package/tsconfig.lib.prod.json
DELETED
package/tsconfig.spec.json
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
|
2
|
-
{
|
|
3
|
-
"extends": "../../tsconfig.json",
|
|
4
|
-
"compilerOptions": {
|
|
5
|
-
"outDir": "../../out-tsc/spec",
|
|
6
|
-
"types": [
|
|
7
|
-
"jasmine"
|
|
8
|
-
]
|
|
9
|
-
},
|
|
10
|
-
"files": [
|
|
11
|
-
"src/test.ts"
|
|
12
|
-
],
|
|
13
|
-
"include": [
|
|
14
|
-
"**/*.spec.ts",
|
|
15
|
-
"**/*.d.ts"
|
|
16
|
-
]
|
|
17
|
-
}
|