@retalia/sidebar-navigation 21.1.13 → 21.1.14
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/README.md +42 -42
- package/karma.conf.js +44 -0
- package/ng-package.json +8 -0
- package/package.json +14 -26
- package/{lib → src}/assets/fonts/Effra_Std_It.svg +5123 -5123
- package/{lib → src}/assets/fonts/Effra_Std_Md.svg +4128 -4128
- package/{lib → src}/assets/fonts/Effra_Std_Rg.svg +4690 -4690
- package/{lib → src}/assets/icons/sidebar-burger.svg +3 -3
- package/{lib → src}/assets/icons/sidebar-cross.svg +3 -3
- package/{lib → src}/assets/icons/subItem-arrow.svg +3 -3
- package/{lib → src}/assets/icons/topbar-info.svg +3 -3
- package/{lib → src}/assets/icons/topbar-logout.svg +4 -4
- package/{lib → src}/assets/icons/topbar-menu-burger.svg +5 -5
- package/{lib → src}/assets/icons/topbar-menu-close.svg +3 -3
- package/{lib → src}/assets/icons/topbar-notification.svg +3 -3
- package/{lib → src}/assets/icons/topbar-profile.svg +4 -4
- package/{lib → src}/assets/icons/topbar-settings.svg +3 -3
- package/{lib → src}/assets/icons/topmenu-arrow.svg +3 -3
- package/{lib → src}/assets/logo/_K3_imagine_White.svg +14 -14
- package/src/lib/data/support-routes.ts +56 -0
- package/src/lib/data/test-data.ts +628 -0
- package/src/lib/data/test-data2.ts +1742 -0
- package/src/lib/models/cookie-names.ts +12 -0
- package/src/lib/models/environment.ts +4 -0
- package/src/lib/models/http-response.ts +3 -0
- package/src/lib/models/module.ts +39 -0
- package/src/lib/navigation-lib.component.html +20 -0
- package/src/lib/navigation-lib.component.scss +30 -0
- package/src/lib/navigation-lib.component.ts +26 -0
- package/src/lib/navigation-lib.module.ts +26 -0
- package/src/lib/navigation-lib.service.ts +9 -0
- package/src/lib/services/auth.service.ts +39 -0
- package/src/lib/services/cookie.service.ts +33 -0
- package/src/lib/services/http.service.ts +26 -0
- package/src/lib/services/module.service.ts +153 -0
- package/src/lib/services/sub-item.service.ts +56 -0
- package/src/lib/sidebar/shop-modal/shop-modal.component.html +17 -0
- package/src/lib/sidebar/shop-modal/shop-modal.component.scss +73 -0
- package/src/lib/sidebar/shop-modal/shop-modal.component.ts +36 -0
- package/src/lib/sidebar/sidebar.component.html +86 -0
- package/src/lib/sidebar/sidebar.component.scss +260 -0
- package/src/lib/sidebar/sidebar.component.ts +267 -0
- package/src/lib/sidebar/sub-item/sub-item.component.html +18 -0
- package/src/lib/sidebar/sub-item/sub-item.component.scss +154 -0
- package/src/lib/sidebar/sub-item/sub-item.component.ts +61 -0
- package/src/lib/topbar/topbar.component.html +29 -0
- package/src/lib/topbar/topbar.component.scss +176 -0
- package/src/lib/topbar/topbar.component.ts +76 -0
- package/src/public-api.ts +14 -0
- package/src/styles/app.scss +53 -0
- package/src/test.ts +15 -0
- package/tsconfig.lib.json +21 -0
- package/tsconfig.lib.prod.json +11 -0
- package/tsconfig.spec.json +17 -0
- package/fesm2022/retalia-sidebar-navigation.mjs +0 -1388
- package/fesm2022/retalia-sidebar-navigation.mjs.map +0 -1
- package/production-0.0.2.tgz +0 -0
- package/types/retalia-sidebar-navigation.d.ts +0 -232
- /package/{lib → src}/assets/fonts/Effra_Std_It.eot +0 -0
- /package/{lib → src}/assets/fonts/Effra_Std_It.ttf +0 -0
- /package/{lib → src}/assets/fonts/Effra_Std_It.woff +0 -0
- /package/{lib → src}/assets/fonts/Effra_Std_It.woff2 +0 -0
- /package/{lib → src}/assets/fonts/Effra_Std_Md.eot +0 -0
- /package/{lib → src}/assets/fonts/Effra_Std_Md.ttf +0 -0
- /package/{lib → src}/assets/fonts/Effra_Std_Md.woff +0 -0
- /package/{lib → src}/assets/fonts/Effra_Std_Md.woff2 +0 -0
- /package/{lib → src}/assets/fonts/Effra_Std_Rg.eot +0 -0
- /package/{lib → src}/assets/fonts/Effra_Std_Rg.ttf +0 -0
- /package/{lib → src}/assets/fonts/Effra_Std_Rg.woff +0 -0
- /package/{lib → src}/assets/fonts/Effra_Std_Rg.woff2 +0 -0
- /package/{lib → src}/assets/fonts/Poppins-Black.ttf +0 -0
- /package/{lib → src}/assets/fonts/Poppins-BlackItalic.ttf +0 -0
- /package/{lib → src}/assets/fonts/Poppins-Bold.ttf +0 -0
- /package/{lib → src}/assets/fonts/Poppins-BoldItalic.ttf +0 -0
- /package/{lib → src}/assets/fonts/Poppins-ExtraBold.ttf +0 -0
- /package/{lib → src}/assets/fonts/Poppins-ExtraBoldItalic.ttf +0 -0
- /package/{lib → src}/assets/fonts/Poppins-ExtraLight.ttf +0 -0
- /package/{lib → src}/assets/fonts/Poppins-ExtraLightItalic.ttf +0 -0
- /package/{lib → src}/assets/fonts/Poppins-Italic.ttf +0 -0
- /package/{lib → src}/assets/fonts/Poppins-Light.ttf +0 -0
- /package/{lib → src}/assets/fonts/Poppins-LightItalic.ttf +0 -0
- /package/{lib → src}/assets/fonts/Poppins-Medium.ttf +0 -0
- /package/{lib → src}/assets/fonts/Poppins-MediumItalic.ttf +0 -0
- /package/{lib → src}/assets/fonts/Poppins-Regular.ttf +0 -0
- /package/{lib → src}/assets/fonts/Poppins-SemiBold.ttf +0 -0
- /package/{lib → src}/assets/fonts/Poppins-SemiBoldItalic.ttf +0 -0
- /package/{lib → src}/assets/fonts/Poppins-Thin.ttf +0 -0
- /package/{lib → src}/assets/fonts/Poppins-ThinItalic.ttf +0 -0
- /package/{lib → src}/assets/icons/topbar-avatar.png +0 -0
- /package/{lib → src}/assets/logo/full-white.png +0 -0
- /package/{lib → src}/assets/logo/full.png +0 -0
- /package/{lib → src}/assets/logo/mobile-white.png +0 -0
- /package/{lib → src}/assets/logo/mobile.png +0 -0
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
@import url('https://fonts.googleapis.com/css?family=Chakra+Petch:400,700&display=swap');
|
|
2
|
+
@import "../../../styles/app.scss";
|
|
3
|
+
|
|
4
|
+
.sub-item,
|
|
5
|
+
.item-group {
|
|
6
|
+
position: relative;
|
|
7
|
+
list-style: none;
|
|
8
|
+
pointer-events: all;
|
|
9
|
+
text-transform: capitalize;
|
|
10
|
+
font-family: "Chakra Petch", Arial, sans-serif;
|
|
11
|
+
color: imagine-color(nav-inactive-text-color); // module text colour
|
|
12
|
+
transition: color 0.15s ease-in-out;
|
|
13
|
+
width: 258px;
|
|
14
|
+
text-indent: 40px;
|
|
15
|
+
white-space: nowrap;
|
|
16
|
+
text-overflow: ellipsis;
|
|
17
|
+
overflow: hidden;
|
|
18
|
+
font-weight: 400;
|
|
19
|
+
|
|
20
|
+
@include responsive(mobileonly) {
|
|
21
|
+
width: 100%;
|
|
22
|
+
line-height: 45px;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.item-group > * {
|
|
28
|
+
text-indent: 30px;
|
|
29
|
+
white-space: nowrap;
|
|
30
|
+
text-overflow: ellipsis;
|
|
31
|
+
overflow: hidden;
|
|
32
|
+
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.sub-item {
|
|
36
|
+
font-style: normal;
|
|
37
|
+
font-weight: 700;
|
|
38
|
+
font-size: 14px;
|
|
39
|
+
line-height: 200%;
|
|
40
|
+
letter-spacing: 0;
|
|
41
|
+
|
|
42
|
+
&:hover {
|
|
43
|
+
font-weight: 700;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.item-label {
|
|
48
|
+
display: block;
|
|
49
|
+
position: relative;
|
|
50
|
+
transition: background-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out,
|
|
51
|
+
transform 0.15s ease-in-out;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.item-icon {
|
|
55
|
+
width: 14px;
|
|
56
|
+
height: 14px;
|
|
57
|
+
margin-right: 8px;
|
|
58
|
+
vertical-align: middle;
|
|
59
|
+
object-fit: contain;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.item {
|
|
63
|
+
display: inline-block;
|
|
64
|
+
position: relative;
|
|
65
|
+
list-style: none;
|
|
66
|
+
text-indent: 12px;
|
|
67
|
+
align-items: center;
|
|
68
|
+
font-family: "Chakra Petch", Arial, sans-serif;
|
|
69
|
+
line-height: 35px;
|
|
70
|
+
border: 0px;
|
|
71
|
+
cursor: pointer;
|
|
72
|
+
font-weight: 400;
|
|
73
|
+
font-size: 18px;
|
|
74
|
+
color: imagine-color(nav-active-text-color); // module text colour
|
|
75
|
+
transition: color 0.15s ease-in-out;
|
|
76
|
+
padding: 6px 0px;
|
|
77
|
+
padding-right: 15px !important;
|
|
78
|
+
width: 245px;
|
|
79
|
+
white-space: nowrap;
|
|
80
|
+
text-overflow: ellipsis;
|
|
81
|
+
overflow: hidden;
|
|
82
|
+
|
|
83
|
+
@include responsive(mobileonly) {
|
|
84
|
+
width: 100%;
|
|
85
|
+
padding: 10px 0px !important;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.item:hover > .item-label,
|
|
91
|
+
.sub-item:hover > .item-label,
|
|
92
|
+
.item-group:hover > .item-label {
|
|
93
|
+
background: rgba(imagine-color(retalia-purple), 0.08); // softer branded hover state
|
|
94
|
+
// box-shadow: inset 2px 0 0 rgba(imagine-color(retalia-purple), 0.28);
|
|
95
|
+
transform: translateX(2px);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.sub-item-arrow {
|
|
99
|
+
position: absolute !important;
|
|
100
|
+
all: initial;
|
|
101
|
+
pointer-events: none; // Forces click on module row, not icon
|
|
102
|
+
height: 5px;
|
|
103
|
+
right: 10px;
|
|
104
|
+
padding: 12px 0px;
|
|
105
|
+
transition: 0.1s linear all;
|
|
106
|
+
user-select: none; // Prevent user from highlighting arrow
|
|
107
|
+
-moz-user-select: none;
|
|
108
|
+
-khtml-user-select: none;
|
|
109
|
+
-webkit-user-select: none;
|
|
110
|
+
-o-user-select: none;
|
|
111
|
+
transform: rotate(180deg);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.rotated {
|
|
115
|
+
transform: rotate(0deg);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.active > .item-label {
|
|
119
|
+
color: imagine-color(retalia-blue); // brighter text for the active parent row
|
|
120
|
+
background: rgba(imagine-color(nav-active-background), 0.8); // active row background only
|
|
121
|
+
font-weight: 600; // bolder text
|
|
122
|
+
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); // subtle text shadow
|
|
123
|
+
transform: scale(1.02); // slight zoom effect
|
|
124
|
+
|
|
125
|
+
&::before {
|
|
126
|
+
content: "";
|
|
127
|
+
position: absolute;
|
|
128
|
+
top: 0;
|
|
129
|
+
bottom: 0;
|
|
130
|
+
left: 0;
|
|
131
|
+
width: 6px;
|
|
132
|
+
background: imagine-color(retalia-blue);
|
|
133
|
+
border-radius: 0 6px 6px 0;
|
|
134
|
+
pointer-events: none;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.selected-sub-item > .item-label {
|
|
139
|
+
padding-left: 14px;
|
|
140
|
+
|
|
141
|
+
&::before {
|
|
142
|
+
content: "\2022";
|
|
143
|
+
position: absolute;
|
|
144
|
+
left: 0;
|
|
145
|
+
top: 50%;
|
|
146
|
+
transform: translateY(-50%);
|
|
147
|
+
font-size: 14px;
|
|
148
|
+
line-height: 1;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Component, Input } from '@angular/core';
|
|
2
|
+
import { ModuleItem, SidebarEntry } from '../../models/module';
|
|
3
|
+
import { SubItemService } from '../../services/sub-item.service';
|
|
4
|
+
|
|
5
|
+
@Component({
|
|
6
|
+
selector: 'sub-item',
|
|
7
|
+
templateUrl: './sub-item.component.html',
|
|
8
|
+
styleUrls: ['./sub-item.component.scss'],
|
|
9
|
+
standalone: false
|
|
10
|
+
})
|
|
11
|
+
export class SubItemComponent {
|
|
12
|
+
@Input() items: ModuleItem[] | SidebarEntry[];
|
|
13
|
+
activeItem = 'Yes';
|
|
14
|
+
constructor(private subItemService: SubItemService) {}
|
|
15
|
+
|
|
16
|
+
getClass = (item, items) => {
|
|
17
|
+
let className = `item ${item.name}`;
|
|
18
|
+
if (item.children.length > 0 && !items[0].authorizationId) {
|
|
19
|
+
className = `item-group ${item.name}`;
|
|
20
|
+
} else if (!item.authorizationId) {
|
|
21
|
+
className = `sub-item ${item.name}`;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (
|
|
25
|
+
item.children.length > 0 &&
|
|
26
|
+
(item.active || this.checkVisibleSubItems(item))
|
|
27
|
+
) {
|
|
28
|
+
className += ' active';
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if (item.active && item.children.length === 0) {
|
|
32
|
+
className += ' selected-sub-item';
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return className;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
subItemClicked(e, item): void {
|
|
39
|
+
e.stopPropagation();
|
|
40
|
+
item.children.length > 0
|
|
41
|
+
? this.toggleSubItems(item)
|
|
42
|
+
: this.onSubItemClick(item);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
onSubItemClick(item: ModuleItem): void {
|
|
46
|
+
this.subItemService.subItemclicked(item);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
toggleSubItems(item: ModuleItem): void {
|
|
50
|
+
item.children.map((si) => {
|
|
51
|
+
si.visible = !si.visible;
|
|
52
|
+
if (si.children && !si.visible) {
|
|
53
|
+
si.children.map((si2) => (si2.visible = false)); // ensure nested items close with parent
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
checkVisibleSubItems(item: ModuleItem | SidebarEntry): boolean {
|
|
59
|
+
return item && item.visible && item.children.some((se) => se.visible);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<nav class="top-menu">
|
|
2
|
+
|
|
3
|
+
<div id="profile">
|
|
4
|
+
|
|
5
|
+
<div id="avatar" (click)="showDropdownOptions('profile')" data-testid="nav-profile">
|
|
6
|
+
<svg class="profile-icon" width="24" height="24" viewBox="0 0 32 32" fill="#213244"
|
|
7
|
+
xmlns="http://www.w3.org/2000/svg">
|
|
8
|
+
<path
|
|
9
|
+
d="M16 20C20.4183 20 24 16.4183 24 12C24 7.58172 20.4183 4 16 4C11.5817 4 8 7.58172 8 12C8 16.4183 11.5817 20 16 20Z"
|
|
10
|
+
stroke="white" stroke-width="2" stroke-miterlimit="10" />
|
|
11
|
+
<path
|
|
12
|
+
d="M3.87354 26.9988C5.10299 24.8708 6.8708 23.1037 8.99939 21.8752C11.128 20.6467 13.5424 20 16.0001 20C18.4577 20 20.8721 20.6468 23.0007 21.8754C25.1292 23.1039 26.897 24.871 28.1264 26.9991"
|
|
13
|
+
stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
|
14
|
+
</svg>
|
|
15
|
+
</div>
|
|
16
|
+
@if (showProfileDropdown) {
|
|
17
|
+
<div class="dropdown-items">
|
|
18
|
+
<div class="option-text" (click)="clickDetails($event)" data-testid="nav-profile-settings">
|
|
19
|
+
<img class="dropdown-icon" src="assets/icons/topbar-settings.svg" />
|
|
20
|
+
Update details
|
|
21
|
+
</div>
|
|
22
|
+
<div class="option-text" (click)="logout()" data-testid="nav-profile-logout">
|
|
23
|
+
<img class="dropdown-icon" src="assets/icons/topbar-logout.svg" />
|
|
24
|
+
Logout
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
}
|
|
28
|
+
</div>
|
|
29
|
+
</nav>
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
@import "../../styles/app.scss";
|
|
2
|
+
|
|
3
|
+
@font-face {
|
|
4
|
+
font-family: 'Poppins';
|
|
5
|
+
src: url('../../assets/fonts/Poppins-Regular.ttf') format('truetype');
|
|
6
|
+
font-weight: 400;
|
|
7
|
+
font-style: normal;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
@font-face {
|
|
11
|
+
font-family: 'Poppins';
|
|
12
|
+
src: url('../../assets/fonts/Poppins-Bold.ttf') format('truetype');
|
|
13
|
+
font-weight: 700;
|
|
14
|
+
font-style: normal;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@font-face {
|
|
18
|
+
font-family: 'Poppins';
|
|
19
|
+
src: url('../../assets/fonts/Poppins-Italic.ttf') format('truetype');
|
|
20
|
+
font-weight: 400;
|
|
21
|
+
font-style: italic;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@font-face {
|
|
25
|
+
font-family: 'Poppins';
|
|
26
|
+
src: url('../../assets/fonts/Poppins-SemiBold.ttf') format('truetype');
|
|
27
|
+
font-weight: 600;
|
|
28
|
+
font-style: normal;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
#item-name {
|
|
32
|
+
font-family: "Poppins", sans-serif;
|
|
33
|
+
font-size: 24px;
|
|
34
|
+
font-weight: 700;
|
|
35
|
+
padding-left: 20px;
|
|
36
|
+
overflow: hidden;
|
|
37
|
+
white-space: nowrap;
|
|
38
|
+
text-overflow: ellipsis;
|
|
39
|
+
text-transform: capitalize;
|
|
40
|
+
|
|
41
|
+
@include responsive(mobileonly) {
|
|
42
|
+
padding-left: 70px;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.top-menu {
|
|
47
|
+
z-index: 20;
|
|
48
|
+
margin: 0;
|
|
49
|
+
top: 0;
|
|
50
|
+
position: fixed;
|
|
51
|
+
display: flex;
|
|
52
|
+
align-items: center;
|
|
53
|
+
height: 67px;
|
|
54
|
+
width: 100vw;
|
|
55
|
+
overflow: hidden;
|
|
56
|
+
background-color: none;
|
|
57
|
+
|
|
58
|
+
@include responsive(mobileonly) {
|
|
59
|
+
min-height: 60px;
|
|
60
|
+
height: 60px;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.dropdown-items {
|
|
64
|
+
position: fixed;
|
|
65
|
+
list-style-type: none;
|
|
66
|
+
white-space: nowrap;
|
|
67
|
+
padding: 0;
|
|
68
|
+
min-width: 120px;
|
|
69
|
+
border-radius: 10px;
|
|
70
|
+
border: 1px solid #d8dde6;
|
|
71
|
+
background-color: white;
|
|
72
|
+
box-shadow: 0 2px 3px 0 imagine-color(shadow-gray);
|
|
73
|
+
text-align-last: center;
|
|
74
|
+
|
|
75
|
+
@include responsive(mobileonly) {
|
|
76
|
+
top: 110px;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.option-text {
|
|
80
|
+
cursor: pointer;
|
|
81
|
+
font-family: "Poppins", sans-serif;
|
|
82
|
+
font-size: 12px;
|
|
83
|
+
text-align: left;
|
|
84
|
+
margin: 0;
|
|
85
|
+
padding: 10px 0px;
|
|
86
|
+
color: black;
|
|
87
|
+
|
|
88
|
+
&:hover {
|
|
89
|
+
background-color: #f5f5f5;
|
|
90
|
+
border-radius: 10px;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.dropdown-icon {
|
|
96
|
+
pointer-events: none; /* Forces click on item row, not icon */
|
|
97
|
+
float: left;
|
|
98
|
+
margin-top: 2px;
|
|
99
|
+
padding: 0px 8px;
|
|
100
|
+
height: 10px;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
#profile {
|
|
104
|
+
position: fixed;
|
|
105
|
+
right: 20px;
|
|
106
|
+
display: flex;
|
|
107
|
+
align-items: center;
|
|
108
|
+
|
|
109
|
+
@include responsive(mobileonly) {
|
|
110
|
+
height: 60px;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
img {
|
|
114
|
+
margin-left: 0px;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
#avatar {
|
|
118
|
+
cursor: pointer;
|
|
119
|
+
position: relative;
|
|
120
|
+
height: 30px;
|
|
121
|
+
width: 30px;
|
|
122
|
+
transition: 0.2s linear;
|
|
123
|
+
border-radius: 50%;
|
|
124
|
+
padding: 5px;
|
|
125
|
+
background-color: #213244;
|
|
126
|
+
|
|
127
|
+
&:hover {
|
|
128
|
+
background-color: imagine-color(nav-active-text-color);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.profile-icon {
|
|
132
|
+
margin: 0;
|
|
133
|
+
position: absolute;
|
|
134
|
+
top: 50%;
|
|
135
|
+
left: 50%;
|
|
136
|
+
-ms-transform: translate(-50%, -50%);
|
|
137
|
+
transform: translate(-50%, -50%);
|
|
138
|
+
pointer-events: none;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
#info {
|
|
143
|
+
cursor: pointer;
|
|
144
|
+
height: 30px;
|
|
145
|
+
transition: 0.2s linear all;
|
|
146
|
+
|
|
147
|
+
&:hover {
|
|
148
|
+
transform: scale(1.1);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.admin-group {
|
|
153
|
+
right: 110px !important;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.info-group {
|
|
157
|
+
right: 10px !important;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.dropdown-items {
|
|
161
|
+
position: fixed;
|
|
162
|
+
top: 70px;
|
|
163
|
+
right: 30px;
|
|
164
|
+
|
|
165
|
+
@include responsive(mobileonly) {
|
|
166
|
+
top: 70px;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
@media print {
|
|
173
|
+
.top-menu {
|
|
174
|
+
display: none;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { Component, HostListener, Input } from '@angular/core';
|
|
2
|
+
import { Environment } from '../models/environment';
|
|
3
|
+
import { AuthService } from '../services/auth.service';
|
|
4
|
+
import { ModuleService } from '../services/module.service';
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
selector: 'topbar',
|
|
8
|
+
templateUrl: './topbar.component.html',
|
|
9
|
+
styleUrls: ['./topbar.component.scss'],
|
|
10
|
+
standalone: false
|
|
11
|
+
})
|
|
12
|
+
export class TopbarComponent {
|
|
13
|
+
@Input() environment: Environment;
|
|
14
|
+
currentRouteName: string;
|
|
15
|
+
isTenantAdmin = false;
|
|
16
|
+
showProfileDropdown = false;
|
|
17
|
+
|
|
18
|
+
constructor(
|
|
19
|
+
private moduleService: ModuleService,
|
|
20
|
+
private authService: AuthService
|
|
21
|
+
) {
|
|
22
|
+
this.moduleService.storedModuleFlagsChange.subscribe((value) => {
|
|
23
|
+
value ? (this.isTenantAdmin = value.includes('TenantAdmin')) : '';
|
|
24
|
+
});
|
|
25
|
+
this.moduleService.currentRouteName.subscribe((value) => {
|
|
26
|
+
this.currentRouteName = value;
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@HostListener('document:click', ['$event'])
|
|
31
|
+
clickout(event: Event): void {
|
|
32
|
+
this.closeDropdown(event);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
public showDropdownOptions(dropdownName: string): void {
|
|
36
|
+
if (dropdownName === 'profile') {
|
|
37
|
+
this.showProfileDropdown = true;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
public closeDropdown(event: Event): void {
|
|
42
|
+
if (!(event.target instanceof Element)) {
|
|
43
|
+
this.showProfileDropdown = false;
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const element = event.composedPath()[0];
|
|
48
|
+
if (!(element instanceof Element)) {
|
|
49
|
+
this.showProfileDropdown = false;
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (event.target.id !== 'avatar' && element.id !== 'avatar') {
|
|
54
|
+
this.showProfileDropdown = false;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
public clickDetails(e: Event): void {
|
|
59
|
+
if (this.environment.portalUrl.slice(-1) !== `/`) {
|
|
60
|
+
this.environment.portalUrl += `/`;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const detailsUrl = this.environment.portalUrl + 'profile/general';
|
|
64
|
+
window.location.href = detailsUrl;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
public logout(): void {
|
|
68
|
+
if (this.environment.portalUrl.slice(-1) !== `/`) {
|
|
69
|
+
this.environment.portalUrl += `/`;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
this.authService.logout();
|
|
73
|
+
const loginUrl = this.environment.portalUrl + 'auth/login';
|
|
74
|
+
window.location.href = loginUrl;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Public API Surface of sidebar-navigation
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export * from './lib/navigation-lib.service';
|
|
6
|
+
export * from './lib/navigation-lib.component';
|
|
7
|
+
export * from './lib/navigation-lib.module';
|
|
8
|
+
|
|
9
|
+
export * from './lib/models/module';
|
|
10
|
+
|
|
11
|
+
export * from './lib/services/auth.service';
|
|
12
|
+
export * from './lib/services/http.service';
|
|
13
|
+
export * from './lib/services/module.service';
|
|
14
|
+
export * from './lib/services/sub-item.service';
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
@import url('https://fonts.googleapis.com/css2?family=Source+Sans+Pro:ital,wght@0,300;0,400;1,300;1,400;1,600&display=swap');
|
|
2
|
+
@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@400;700&display=swap');
|
|
3
|
+
@mixin responsive($point) {
|
|
4
|
+
@if $point == desktop {
|
|
5
|
+
@media (min-width: 70em) {
|
|
6
|
+
@content;
|
|
7
|
+
}
|
|
8
|
+
} @else if $point == laptop {
|
|
9
|
+
@media (min-width: 64em) {
|
|
10
|
+
@content;
|
|
11
|
+
}
|
|
12
|
+
} @else if $point == tablet {
|
|
13
|
+
@media (min-width: 50em) {
|
|
14
|
+
@content;
|
|
15
|
+
}
|
|
16
|
+
} @else if $point == phablet {
|
|
17
|
+
@media (min-width: 37.5em) {
|
|
18
|
+
@content;
|
|
19
|
+
}
|
|
20
|
+
} @else if $point == mobileonly {
|
|
21
|
+
@media (max-width: 37.5em) {
|
|
22
|
+
@content;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@mixin rotate($degrees) {
|
|
28
|
+
-webkit-transform: rotate($degrees);
|
|
29
|
+
-moz-transform: rotate($degrees);
|
|
30
|
+
-ms-transform: rotate($degrees);
|
|
31
|
+
-o-transform: rotate($degrees);
|
|
32
|
+
transform: rotate($degrees);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
$imagine-colors: (
|
|
36
|
+
nav-active-background: #FBF9FF,
|
|
37
|
+
nav-inactive-background: #ffffff,
|
|
38
|
+
nav-active-text-color: #545454,
|
|
39
|
+
nav-inactive-text-color: #A5A5A5,
|
|
40
|
+
nav-hover: #17293a,
|
|
41
|
+
sidebar-border: #d4d6e4,
|
|
42
|
+
bg-color: #fafbfc,
|
|
43
|
+
retalia-blue: #B27BFB,
|
|
44
|
+
retalia-purple: #5B02C7
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
@function imagine-color($key) {
|
|
48
|
+
@return map-get($imagine-colors, $key);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.imagine-body {
|
|
52
|
+
background-color: imagine-color(bg-color);
|
|
53
|
+
}
|
package/src/test.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
|
|
2
|
+
|
|
3
|
+
import 'zone.js/dist/zone';
|
|
4
|
+
import 'zone.js/dist/zone-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
|
+
);
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
"angularCompilerOptions": {
|
|
12
|
+
"skipTemplateCodegen": true,
|
|
13
|
+
"strictMetadataEmit": true,
|
|
14
|
+
"enableResourceInlining": true,
|
|
15
|
+
"fullTemplateTypeCheck": true
|
|
16
|
+
},
|
|
17
|
+
"exclude": [
|
|
18
|
+
"src/test.ts",
|
|
19
|
+
"**/*.spec.ts"
|
|
20
|
+
]
|
|
21
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
}
|