@yomotech/view-toolkit 0.0.30 → 0.0.32
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/ng-package.json +7 -0
- package/package.json +38 -49
- package/src/lib/app-version.ts +2 -0
- package/src/lib/components/autocomplete/autocomplete.css +0 -0
- package/src/lib/components/autocomplete/autocomplete.html +23 -0
- package/src/lib/components/autocomplete/autocomplete.ts +71 -0
- package/src/lib/components/button/button.css +0 -0
- package/src/lib/components/button/button.html +1 -0
- package/src/lib/components/button/button.ts +11 -0
- package/src/lib/components/date/date.css +0 -0
- package/src/lib/components/date/date.html +1 -0
- package/src/lib/components/date/date.ts +11 -0
- package/src/lib/components/dropdown/dropdown.css +0 -0
- package/src/lib/components/dropdown/dropdown.html +1 -0
- package/src/lib/components/dropdown/dropdown.ts +11 -0
- package/src/lib/components/error-message/error-message.css +0 -0
- package/src/lib/components/error-message/error-message.html +1 -0
- package/src/lib/components/error-message/error-message.ts +11 -0
- package/src/lib/components/label/label.css +0 -0
- package/src/lib/components/label/label.html +7 -0
- package/src/lib/components/label/label.ts +33 -0
- package/src/lib/components/string/string.css +0 -0
- package/src/lib/components/string/string.html +4 -0
- package/src/lib/components/string/string.ts +22 -0
- package/src/lib/components/textbox/textbox.css +0 -0
- package/src/lib/components/textbox/textbox.html +7 -0
- package/src/lib/components/textbox/textbox.ts +33 -0
- package/src/lib/components/time/time.css +0 -0
- package/src/lib/components/time/time.html +1 -0
- package/src/lib/components/time/time.ts +11 -0
- package/src/lib/containers/card/card.component.css +0 -0
- package/src/lib/containers/card/card.component.html +450 -0
- package/src/lib/containers/card/card.component.ts +474 -0
- package/src/lib/containers/form/form.component.css +101 -0
- package/src/lib/containers/form/form.component.html +305 -0
- package/src/lib/containers/form/form.component.ts +333 -0
- package/src/lib/containers/grid/grid.component.css +0 -0
- package/src/lib/containers/grid/grid.component.html +212 -0
- package/src/lib/containers/grid/grid.component.ts +228 -0
- package/src/lib/containers/header-menu/header-menu.component.css +0 -0
- package/src/lib/containers/header-menu/header-menu.component.html +72 -0
- package/src/lib/containers/header-menu/header-menu.component.ts +105 -0
- package/src/lib/containers/logs/logs.component.css +160 -0
- package/src/lib/containers/logs/logs.component.html +89 -0
- package/src/lib/containers/logs/logs.component.ts +29 -0
- package/src/lib/containers/model/model.component.css +0 -0
- package/src/lib/containers/model/model.component.html +351 -0
- package/src/lib/containers/model/model.component.ts +436 -0
- package/src/lib/containers/pagination/pagination.component.css +0 -0
- package/src/lib/containers/pagination/pagination.component.html +41 -0
- package/src/lib/containers/pagination/pagination.component.ts +100 -0
- package/src/lib/containers/side-menu/side-menu.component.css +173 -0
- package/src/lib/containers/side-menu/side-menu.component.html +126 -0
- package/src/lib/containers/side-menu/side-menu.component.ts +458 -0
- package/src/lib/services/app-version-reset.service.ts +59 -0
- package/src/lib/services/config.service.ts +144 -0
- package/src/lib/services/couchdb.ts +275 -0
- package/src/lib/services/mobile-keycloak.service.ts +116 -0
- package/src/lib/services/network-log.service.ts +27 -0
- package/src/lib/services/notification.service.ts +26 -0
- package/src/lib/services/request.service.ts +125 -0
- package/src/lib/services/utility.service.ts +600 -0
- package/src/lib/view-toolkit.module.ts +57 -0
- package/src/lib/view-toolkit.spec.ts +23 -0
- package/src/lib/view-toolkit.ts +15 -0
- package/src/public-api.ts +25 -0
- package/tsconfig.lib.json +17 -0
- package/tsconfig.lib.prod.json +11 -0
- package/tsconfig.spec.json +15 -0
- package/fesm2022/yomotech-view-toolkit.mjs +0 -3538
- package/fesm2022/yomotech-view-toolkit.mjs.map +0 -1
- package/types/yomotech-view-toolkit.d.ts +0 -644
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
.menu-separator {
|
|
2
|
+
height: 1px;
|
|
3
|
+
margin: 15px 0 6px;
|
|
4
|
+
background-color: rgba(255, 255, 255, 0.15);
|
|
5
|
+
list-style: none;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.side-menu {
|
|
9
|
+
background-color: #0d1b2a;
|
|
10
|
+
color: #fff;
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
height: 100%;
|
|
14
|
+
transition: width 0.3s ease;
|
|
15
|
+
/* position: relative; */
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.side-menu ul[nz-menu] {
|
|
19
|
+
flex: 1; /* fill remaining space */
|
|
20
|
+
overflow-y: auto; /* ✅ ENABLE SCROLL */
|
|
21
|
+
overflow-x: hidden;
|
|
22
|
+
scrollbar-width: thin; /* Firefox */
|
|
23
|
+
scroll-behavior: smooth;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/* user profile */
|
|
27
|
+
.user-profile {
|
|
28
|
+
text-align: center;
|
|
29
|
+
padding: 20px 10px;
|
|
30
|
+
margin-top: 40px;
|
|
31
|
+
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.user-profile.collapsed {
|
|
35
|
+
padding: 10px;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.user-profile .avatar {
|
|
39
|
+
width: 64px;
|
|
40
|
+
height: 64px;
|
|
41
|
+
border-radius: 50%;
|
|
42
|
+
border: 2px solid #fff;
|
|
43
|
+
margin-bottom: 8px;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.user-profile.collapsed .avatar {
|
|
47
|
+
width: 40px;
|
|
48
|
+
height: 40px;
|
|
49
|
+
margin-bottom: 0;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.user-profile .name {
|
|
53
|
+
font-weight: 600;
|
|
54
|
+
font-size: 14px;
|
|
55
|
+
color: #fff;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.user-profile .email {
|
|
59
|
+
font-size: 12px;
|
|
60
|
+
color: #aaa;
|
|
61
|
+
margin-bottom: 8px;
|
|
62
|
+
word-break: break-word;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.user-profile .actions button {
|
|
66
|
+
margin: 0 4px;
|
|
67
|
+
color: #fff;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/* projects pinned at bottom */
|
|
71
|
+
.projects {
|
|
72
|
+
position: absolute;
|
|
73
|
+
bottom: 0;
|
|
74
|
+
width: 100%;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/* responsive tweaks for mobile */
|
|
78
|
+
@media (max-width: 768px) {
|
|
79
|
+
.side-menu {
|
|
80
|
+
height: calc(100dvh - var(--header-height));
|
|
81
|
+
top: var(--header-height);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.side-menu.open {
|
|
85
|
+
width: 250px;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.user-profile .details {
|
|
89
|
+
display: none; /* only avatar on mobile collapsed */
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.user-profile .avatar {
|
|
93
|
+
width: 40px;
|
|
94
|
+
height: 40px;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.collapse-btn {
|
|
99
|
+
position: absolute;
|
|
100
|
+
z-index: 10001;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
@media (max-width: 768px) {
|
|
104
|
+
.collapse-btn {
|
|
105
|
+
top: calc(var(--header-height) + 8px); /* BELOW header */
|
|
106
|
+
left: 10px;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
@media (max-width: 768px) {
|
|
111
|
+
.left-wrap.sidemenu.collapsed .user-profile {
|
|
112
|
+
max-height: 0;
|
|
113
|
+
opacity: 0;
|
|
114
|
+
overflow: hidden;
|
|
115
|
+
padding: 0;
|
|
116
|
+
transition: all 0.2s ease;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.menu-row {
|
|
121
|
+
display: flex;
|
|
122
|
+
align-items: center;
|
|
123
|
+
justify-content: space-between;
|
|
124
|
+
width: 100%;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.menu-text {
|
|
128
|
+
white-space: nowrap;
|
|
129
|
+
overflow: hidden;
|
|
130
|
+
text-overflow: ellipsis;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.delete-icon {
|
|
134
|
+
margin-left: auto;
|
|
135
|
+
cursor: pointer;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.side-toggle-handle {
|
|
139
|
+
position: absolute;
|
|
140
|
+
right: -14px;
|
|
141
|
+
width: 28px;
|
|
142
|
+
height: 48px;
|
|
143
|
+
background: #0d1b2a;
|
|
144
|
+
border-radius: 0 6px 6px 0;
|
|
145
|
+
display: flex;
|
|
146
|
+
align-items: center;
|
|
147
|
+
justify-content: center;
|
|
148
|
+
cursor: pointer;
|
|
149
|
+
z-index: 10000;
|
|
150
|
+
transition: all 0.25s ease;
|
|
151
|
+
box-shadow: 2px 0 6px rgba(0, 0, 0, 0.25);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.side-toggle-handle span {
|
|
155
|
+
color: #fff;
|
|
156
|
+
font-size: 14px;
|
|
157
|
+
transition: transform 0.25s ease;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/* Mobile adjustments */
|
|
161
|
+
@media (max-width: 768px) {
|
|
162
|
+
.side-toggle-handle {
|
|
163
|
+
top: calc(var(--header-height) + -56px) !important;
|
|
164
|
+
padding-left: 10px;
|
|
165
|
+
transform: none !important;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
@media (min-width: 769px) {
|
|
170
|
+
.left-wrap.sidemenu.collapsed:hover {
|
|
171
|
+
transform: translateX(0);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
<div class="left-wrap sidemenu" [class.collapsed]="isCollapsed"
|
|
2
|
+
[ngStyle]="{ 'z-index': !isCollapsed && isMobile ? 999999 : 'auto' }" #sideMenu>
|
|
3
|
+
<!-- Move toggle button OUTSIDE menu container -->
|
|
4
|
+
<div class="side-toggle-handle" id="toggle-id" (click)="toggleCollapsed()" [class.collapsed]="isCollapsed">
|
|
5
|
+
<span id="toggle-icon" nz-icon [nzType]="isCollapsed ? 'caret-right' : 'caret-left'"></span>
|
|
6
|
+
</div>
|
|
7
|
+
<div class="side-menu h-screen" id="sidemenuwrap" *ngIf="setLanguage"
|
|
8
|
+
[ngStyle]="{ width: (isMobile && isCollapsed) ? '1px' : isCollapsed ? '60px' : '' }">
|
|
9
|
+
<!-- user content -->
|
|
10
|
+
<ng-container *ngIf="loginedUserInfo && loginedUserInfo?.name">
|
|
11
|
+
<div class="user-profile" [class.collapsed]="isCollapsed">
|
|
12
|
+
<img class="avatar" [src]="loginedUserInfo?.image" alt="User" />
|
|
13
|
+
<div [class]="isMobile ? '' : 'details'" *ngIf="!isCollapsed">
|
|
14
|
+
<div class="name">{{ loginedUserInfo.name }}</div>
|
|
15
|
+
<div class="email">{{ loginedUserInfo?.email }}</div>
|
|
16
|
+
<div class="actions" *ngIf="loginedUserInfo?.actions?.length">
|
|
17
|
+
<button *ngFor="let action of loginedUserInfo?.actions" nz-button nzType="link" nzSize="small"
|
|
18
|
+
(click)="invokeNavigate(action)">
|
|
19
|
+
<span>{{ action?.label?.caption }}</span>
|
|
20
|
+
<span nz-icon [nzType]="action.icon"></span>
|
|
21
|
+
</button>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
</ng-container>
|
|
26
|
+
<!-- dynamic menu -->
|
|
27
|
+
<ul nz-menu nzMode="inline" nzTheme="dark" [nzInlineCollapsed]="isCollapsed">
|
|
28
|
+
<ng-container *ngFor="let item of menuItems">
|
|
29
|
+
<ng-container *ngIf="!item.submenu && item?.options?.action != 'logout'; else submenu">
|
|
30
|
+
<span
|
|
31
|
+
[class]="environment?.login?.type === 'oktaAuth' || environment?.login?.type === 'keycloak' ? item.options?.login === true ? loginedUserInfo?.name ? '' : 'hidden' : item.options?.login === false ? loginedUserInfo?.name ? 'hidden' : '' : '' : userInfo?.userId ? item.options?.login ? item.options.role ? item.options.role == userInfo.userRole ? '' : 'hidden' : '' : 'hidden' : !item.options?.login ? '' : 'hidden' ">
|
|
32
|
+
<li (click)="invokeNavigate(item)" nz-menu-item nz-tooltip nzTooltipPlacement="right"
|
|
33
|
+
[nzTooltipTitle]="isCollapsed && !isMobile ? item?.label?.caption : ''">
|
|
34
|
+
<span nz-icon [nzType]="item.icon"></span>
|
|
35
|
+
<span>{{ item?.label?.caption }}</span>
|
|
36
|
+
</li>
|
|
37
|
+
</span>
|
|
38
|
+
</ng-container>
|
|
39
|
+
<ng-template #submenu>
|
|
40
|
+
<span
|
|
41
|
+
[class]="item.options?.login === true && (environment?.login?.type === 'oktaAuth' || environment?.login?.type === 'keycloak') ? loginedUserInfo?.name ? '' : 'hidden' : item.options?.login === false ? loginedUserInfo?.name ? 'hidden' : '' : ''">
|
|
42
|
+
<li nz-submenu *ngIf="item?.options?.action != 'logout'" [nzTitle]="item?.label?.caption"
|
|
43
|
+
[nzIcon]="item.icon">
|
|
44
|
+
<ul>
|
|
45
|
+
<ng-container *ngFor="let child of item.submenu">
|
|
46
|
+
<li (click)="invokeNavigate(child)" *ngIf="!child.submenu" nz-menu-item nz-tooltip
|
|
47
|
+
nzTooltipPlacement="right" [nzTooltipTitle]="isCollapsed && !isMobile ? child?.label?.caption : ''">
|
|
48
|
+
<span nz-icon [nzType]="child?.icon"></span>
|
|
49
|
+
<span>{{ child?.label?.caption }}</span>
|
|
50
|
+
</li>
|
|
51
|
+
<ng-container *ngIf="child.submenu">
|
|
52
|
+
<li nz-submenu [nzTitle]="child?.label?.caption" [nzIcon]="child?.icon">
|
|
53
|
+
<ul>
|
|
54
|
+
<ng-container *ngFor="let subChild of child.submenu">
|
|
55
|
+
<li (click)="invokeNavigate(subChild)" nz-menu-item>
|
|
56
|
+
<ng-container *ngIf="subChild?.options?.setImageUrl; else antIcon">
|
|
57
|
+
<img *ngIf="isUrl(subChild?.icon)" [src]="subChild?.icon" alt="icon"
|
|
58
|
+
style="width: 16px; height: 16px; margin-right: 8px;" />
|
|
59
|
+
</ng-container>
|
|
60
|
+
<ng-template #antIcon>
|
|
61
|
+
<span nz-icon [nzType]="subChild?.icon"></span>
|
|
62
|
+
</ng-template>
|
|
63
|
+
<span>{{ subChild?.label?.caption }}</span>
|
|
64
|
+
</li>
|
|
65
|
+
</ng-container>
|
|
66
|
+
</ul>
|
|
67
|
+
</li>
|
|
68
|
+
</ng-container>
|
|
69
|
+
</ng-container>
|
|
70
|
+
</ul>
|
|
71
|
+
</li>
|
|
72
|
+
</span>
|
|
73
|
+
</ng-template>
|
|
74
|
+
</ng-container>
|
|
75
|
+
|
|
76
|
+
<!-- separator -->
|
|
77
|
+
<li *ngIf="settingMenu.submenu" class="menu-separator"></li>
|
|
78
|
+
|
|
79
|
+
<!-- settings menu -->
|
|
80
|
+
<ng-container *ngIf="!settingMenu.submenu; else settingSubmenu" style="position: absolute; bottom: 0;">
|
|
81
|
+
<li (click)="invokeNavigate(settingMenu)" nz-menu-item nz-tooltip nzTooltipPlacement="right"
|
|
82
|
+
[nzTooltipTitle]="isCollapsed && !isMobile ? settingMenu?.label?.caption : ''">
|
|
83
|
+
<span nz-icon [nzType]="settingMenu.icon"></span>
|
|
84
|
+
<span>{{ settingMenu?.label?.caption }}</span>
|
|
85
|
+
</li>
|
|
86
|
+
</ng-container>
|
|
87
|
+
<ng-template #settingSubmenu>
|
|
88
|
+
<li nz-submenu [nzTitle]="settingMenu?.label?.caption" [nzIcon]="settingMenu.icon">
|
|
89
|
+
<ul>
|
|
90
|
+
<ng-container *ngFor="let child of settingMenu.submenu">
|
|
91
|
+
<li (click)="invokeNavigate(child)" *ngIf="!child.submenu" nz-menu-item nz-tooltip
|
|
92
|
+
nzTooltipPlacement="right" [nzTooltipTitle]="isCollapsed && !isMobile ? child?.label?.caption : ''">
|
|
93
|
+
<span nz-icon [nzType]="child?.icon"></span>
|
|
94
|
+
<span>{{ child?.label?.caption }}</span>
|
|
95
|
+
</li>
|
|
96
|
+
<ng-container *ngIf="child.submenu">
|
|
97
|
+
<li nz-submenu [nzTitle]="child?.label?.caption" [nzIcon]="child?.icon">
|
|
98
|
+
<ul style="width: 260px;">
|
|
99
|
+
<ng-container *ngFor="let subChild of child.submenu; let i = index">
|
|
100
|
+
<li (click)="invokeNavigate(subChild, child)" nz-menu-item>
|
|
101
|
+
<span [class]="child?.label?.caption === 'Languages' ? '' : 'menu-row'">
|
|
102
|
+
<ng-container *ngIf="subChild?.options?.setImageUrl; else antIcon">
|
|
103
|
+
<img *ngIf="isUrl(subChild?.icon)" [src]="subChild?.icon" alt="icon"
|
|
104
|
+
style="width: 16px; height: 16px; margin-right: 8px;" />
|
|
105
|
+
</ng-container>
|
|
106
|
+
<ng-template #antIcon>
|
|
107
|
+
<span nz-icon [nzType]="subChild?.icon"></span>
|
|
108
|
+
</ng-template>
|
|
109
|
+
<span>{{ subChild?.label?.caption }}</span>
|
|
110
|
+
<!-- Delete icon (prevent click bubbling) -->
|
|
111
|
+
<span *ngIf="child?.label?.caption != 'Languages'" nz-icon nzType="delete" class="delete-icon"
|
|
112
|
+
style="padding-left: 5%;" (click)="deleteMenuItem(subChild, i, $event)"></span>
|
|
113
|
+
</span>
|
|
114
|
+
</li>
|
|
115
|
+
</ng-container>
|
|
116
|
+
</ul>
|
|
117
|
+
</li>
|
|
118
|
+
</ng-container>
|
|
119
|
+
</ng-container>
|
|
120
|
+
</ul>
|
|
121
|
+
</li>
|
|
122
|
+
</ng-template>
|
|
123
|
+
|
|
124
|
+
</ul>
|
|
125
|
+
</div>
|
|
126
|
+
</div>
|