@tuki-io/tuki-widgets 0.0.0
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/.editorconfig +16 -0
- package/.vscode/extensions.json +4 -0
- package/.vscode/launch.json +20 -0
- package/.vscode/tasks.json +42 -0
- package/README.md +27 -0
- package/angular.json +41 -0
- package/package.json +42 -0
- package/projects/tuki/widgets/README.md +24 -0
- package/projects/tuki/widgets/karma.conf.js +44 -0
- package/projects/tuki/widgets/ng-package.json +7 -0
- package/projects/tuki/widgets/package.json +13 -0
- package/projects/tuki/widgets/src/lib/widgets.component.spec.ts +23 -0
- package/projects/tuki/widgets/src/lib/widgets.component.ts +20 -0
- package/projects/tuki/widgets/src/lib/widgets.module.ts +16 -0
- package/projects/tuki/widgets/src/lib/widgets.service.spec.ts +16 -0
- package/projects/tuki/widgets/src/lib/widgets.service.ts +9 -0
- package/projects/tuki/widgets/src/public-api.ts +7 -0
- package/projects/tuki/widgets/src/test.ts +27 -0
- package/projects/tuki/widgets/styles/_variables.scss +90 -0
- package/projects/tuki/widgets/styles/form.scss +231 -0
- package/projects/tuki/widgets/styles/icons.scss +32 -0
- package/projects/tuki/widgets/styles/styles.scss +110 -0
- package/projects/tuki/widgets/styles/tables.scss +30 -0
- package/projects/tuki/widgets/tsconfig.lib.json +36 -0
- package/projects/tuki/widgets/tsconfig.lib.prod.json +10 -0
- package/projects/tuki/widgets/tsconfig.spec.json +17 -0
- package/projects/tuki/widgets/user-manage/ng-package.json +7 -0
- package/projects/tuki/widgets/user-manage/public-api.ts +6 -0
- package/projects/tuki/widgets/user-manage/src/app.constants.ts +38 -0
- package/projects/tuki/widgets/user-manage/src/classes/device.ts +225 -0
- package/projects/tuki/widgets/user-manage/src/classes/line.ts +117 -0
- package/projects/tuki/widgets/user-manage/src/classes/notification.ts +39 -0
- package/projects/tuki/widgets/user-manage/src/classes/pagination.ts +18 -0
- package/projects/tuki/widgets/user-manage/src/classes/simplified-user.ts +128 -0
- package/projects/tuki/widgets/user-manage/src/classes/table-data.ts +6 -0
- package/projects/tuki/widgets/user-manage/src/classes/user-interface.ts +225 -0
- package/projects/tuki/widgets/user-manage/src/classes/user-list.ts +40 -0
- package/projects/tuki/widgets/user-manage/src/classes/user.ts +8 -0
- package/projects/tuki/widgets/user-manage/src/common-functions.ts +16 -0
- package/projects/tuki/widgets/user-manage/src/environments/environment.prod.ts +9 -0
- package/projects/tuki/widgets/user-manage/src/environments/environment.ts +10 -0
- package/projects/tuki/widgets/user-manage/src/interseptors/auth.interceptor.ts +36 -0
- package/projects/tuki/widgets/user-manage/src/lazy-loading-select/lazy-loading-select.component.html +50 -0
- package/projects/tuki/widgets/user-manage/src/lazy-loading-select/lazy-loading-select.component.scss +3 -0
- package/projects/tuki/widgets/user-manage/src/lazy-loading-select/lazy-loading-select.component.ts +81 -0
- package/projects/tuki/widgets/user-manage/src/material.module.ts +85 -0
- package/projects/tuki/widgets/user-manage/src/notifications/notification.component.html +33 -0
- package/projects/tuki/widgets/user-manage/src/notifications/notification.component.scss +84 -0
- package/projects/tuki/widgets/user-manage/src/notifications/notification.component.ts +46 -0
- package/projects/tuki/widgets/user-manage/src/removeKynFromIBM.service.ts +25 -0
- package/projects/tuki/widgets/user-manage/src/services/api.service.ts +89 -0
- package/projects/tuki/widgets/user-manage/src/services/notification.service.ts +68 -0
- package/projects/tuki/widgets/user-manage/src/services/removeKynFromIBM.service.ts +25 -0
- package/projects/tuki/widgets/user-manage/src/services/site-settings.service.ts +35 -0
- package/projects/tuki/widgets/user-manage/src/services/user.service.ts +120 -0
- package/projects/tuki/widgets/user-manage/src/services/users-search.service.ts +58 -0
- package/projects/tuki/widgets/user-manage/src/services/utils.service.ts +71 -0
- package/projects/tuki/widgets/user-manage/src/styles/_variables.scss +90 -0
- package/projects/tuki/widgets/user-manage/src/styles/form.scss +231 -0
- package/projects/tuki/widgets/user-manage/src/styles/icons.scss +32 -0
- package/projects/tuki/widgets/user-manage/src/styles/styles.scss +110 -0
- package/projects/tuki/widgets/user-manage/src/styles/tables.scss +30 -0
- package/projects/tuki/widgets/user-manage/src/user-details/notification.service.ts +68 -0
- package/projects/tuki/widgets/user-manage/src/user-info/user-info.component.html +32 -0
- package/projects/tuki/widgets/user-manage/src/user-info/user-info.component.scss +53 -0
- package/projects/tuki/widgets/user-manage/src/user-info/user-info.component.ts +19 -0
- package/projects/tuki/widgets/user-manage/src/user-manage-widget.component.html +291 -0
- package/projects/tuki/widgets/user-manage/src/user-manage-widget.component.scss +461 -0
- package/projects/tuki/widgets/user-manage/src/user-manage-widget.component.ts +163 -0
- package/projects/tuki/widgets/user-manage/src/user-manage.module.ts +53 -0
- package/projects/tuki/widgets/user-manage/src/utils/app-loader/app-loader.component.html +6 -0
- package/projects/tuki/widgets/user-manage/src/utils/app-loader/app-loader.component.scss +11 -0
- package/projects/tuki/widgets/user-manage/src/utils/app-loader/app-loader.ts +13 -0
- package/projects/tuki/widgets/user-manage/src/utils/pagination/pagination.component.html +26 -0
- package/projects/tuki/widgets/user-manage/src/utils/pagination/pagination.component.scss +41 -0
- package/projects/tuki/widgets/user-manage/src/utils/pagination/pagination.component.ts +41 -0
- package/projects/tuki/widgets/users-list/ng-package.json +6 -0
- package/projects/tuki/widgets/users-list/public-api.ts +8 -0
- package/projects/tuki/widgets/users-list/src/app.constants.ts +35 -0
- package/projects/tuki/widgets/users-list/src/classes/device.ts +225 -0
- package/projects/tuki/widgets/users-list/src/classes/line.ts +117 -0
- package/projects/tuki/widgets/users-list/src/classes/notification.ts +38 -0
- package/projects/tuki/widgets/users-list/src/classes/pagination.ts +18 -0
- package/projects/tuki/widgets/users-list/src/classes/simlified-user.ts +74 -0
- package/projects/tuki/widgets/users-list/src/classes/table-data.ts +6 -0
- package/projects/tuki/widgets/users-list/src/classes/user-interface.ts +225 -0
- package/projects/tuki/widgets/users-list/src/classes/user-list.ts +40 -0
- package/projects/tuki/widgets/users-list/src/classes/user.ts +8 -0
- package/projects/tuki/widgets/users-list/src/material.module.ts +84 -0
- package/projects/tuki/widgets/users-list/src/services/api.service.ts +87 -0
- package/projects/tuki/widgets/users-list/src/services/events-communication.service.ts +11 -0
- package/projects/tuki/widgets/users-list/src/services/notification.service.ts +68 -0
- package/projects/tuki/widgets/users-list/src/services/removeKynFromIBM.service.ts +25 -0
- package/projects/tuki/widgets/users-list/src/services/user.service.ts +117 -0
- package/projects/tuki/widgets/users-list/src/services/users-search.service.ts +58 -0
- package/projects/tuki/widgets/users-list/src/users-list.component.css +4 -0
- package/projects/tuki/widgets/users-list/src/users-list.component.css.map +1 -0
- package/projects/tuki/widgets/users-list/src/users-list.component.html +39 -0
- package/projects/tuki/widgets/users-list/src/users-list.component.scss +9 -0
- package/projects/tuki/widgets/users-list/src/users-list.component.ts +85 -0
- package/projects/tuki/widgets/users-list/src/users-list.module.ts +36 -0
- package/projects/tuki/widgets/users-list/src/utils/app-loader/app-loader.component.css +11 -0
- package/projects/tuki/widgets/users-list/src/utils/app-loader/app-loader.component.css.map +1 -0
- package/projects/tuki/widgets/users-list/src/utils/app-loader/app-loader.component.html +6 -0
- package/projects/tuki/widgets/users-list/src/utils/app-loader/app-loader.component.scss +11 -0
- package/projects/tuki/widgets/users-list/src/utils/app-loader/app-loader.ts +13 -0
- package/projects/tuki/widgets/users-list/src/utils/common-functions.ts +16 -0
- package/projects/tuki/widgets/users-list/src/utils/notifications/notification.component.html +33 -0
- package/projects/tuki/widgets/users-list/src/utils/notifications/notification.component.scss +84 -0
- package/projects/tuki/widgets/users-list/src/utils/notifications/notification.component.ts +46 -0
- package/projects/tuki/widgets/users-list/src/utils/pagination/pagination.component.css +45 -0
- package/projects/tuki/widgets/users-list/src/utils/pagination/pagination.component.css.map +1 -0
- package/projects/tuki/widgets/users-list/src/utils/pagination/pagination.component.html +26 -0
- package/projects/tuki/widgets/users-list/src/utils/pagination/pagination.component.scss +41 -0
- package/projects/tuki/widgets/users-list/src/utils/pagination/pagination.component.ts +41 -0
- package/projects/tuki/widgets/users-list/src/utils/utils.service.ts +71 -0
- package/tsconfig.json +46 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Injectable()
|
|
4
|
+
export class UtilsService {
|
|
5
|
+
|
|
6
|
+
static sortSortArrayByProperty(array: [], sortBy: string) {
|
|
7
|
+
if (!array) {
|
|
8
|
+
return null;
|
|
9
|
+
}
|
|
10
|
+
return array.sort((a, b) => {
|
|
11
|
+
if (!a[sortBy] && !b[sortBy]) {
|
|
12
|
+
return 0;
|
|
13
|
+
}
|
|
14
|
+
if (a[sortBy] && !b[sortBy]) {
|
|
15
|
+
return 1;
|
|
16
|
+
}
|
|
17
|
+
if (!a[sortBy] && b[sortBy]) {
|
|
18
|
+
return -1;
|
|
19
|
+
}
|
|
20
|
+
const positionA = a[sortBy];
|
|
21
|
+
const positionB = b[sortBy];
|
|
22
|
+
return (positionA < positionB) ? -1 : (positionA > positionB) ? 1 : 0;
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
static diff(origObject: any, updatedObj: any, path: string, keysToIgnore?: string[]) {
|
|
27
|
+
let result: any = [];
|
|
28
|
+
if (Object.is(origObject, updatedObj)) {
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
31
|
+
if (!updatedObj || typeof updatedObj !== 'object') {
|
|
32
|
+
return updatedObj;
|
|
33
|
+
}
|
|
34
|
+
const concat = Array.from(new Set([...Object.keys(origObject || {}), ...Object.keys(updatedObj || {})]));
|
|
35
|
+
const filter = keysToIgnore ? concat.filter(key => !keysToIgnore.includes(key)) : concat;
|
|
36
|
+
filter
|
|
37
|
+
.forEach(key => {
|
|
38
|
+
if (typeof updatedObj[key] === 'object' && typeof origObject[key] === 'object') {
|
|
39
|
+
if (UtilsService.differs(updatedObj[key], origObject[key])) {
|
|
40
|
+
const newPath = `${path}${path ? '.' : ''}${key}`;
|
|
41
|
+
const values = UtilsService.diff(origObject[key], updatedObj[key], newPath, keysToIgnore);
|
|
42
|
+
if (values !== undefined) {
|
|
43
|
+
result = [...result, ...values];
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
} else if (updatedObj && !origObject || updatedObj[key] !== origObject[key] && !Object.is(origObject[key], updatedObj[key])) {
|
|
47
|
+
const value = updatedObj ? UtilsService.formatIfEmpty(updatedObj[key]) : null;
|
|
48
|
+
result.push(`${path}${path ? '.' : ''}${key}=${value}`);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
return result;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
static formatIfEmpty(value: any) {
|
|
55
|
+
if (value) {
|
|
56
|
+
return value;
|
|
57
|
+
}
|
|
58
|
+
switch (typeof value) {
|
|
59
|
+
case 'boolean':
|
|
60
|
+
return value;
|
|
61
|
+
case 'string':
|
|
62
|
+
return '';
|
|
63
|
+
default:
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
static differs(obj1: any, obj2: any): boolean {
|
|
69
|
+
return JSON.stringify(obj1) !== JSON.stringify(obj2);
|
|
70
|
+
}
|
|
71
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
|
2
|
+
{
|
|
3
|
+
"compileOnSave": false,
|
|
4
|
+
"build": {
|
|
5
|
+
"builder": "@angular-devkit/build-ng-packagr:build",
|
|
6
|
+
"options": {
|
|
7
|
+
"preserveSymlinks": true,
|
|
8
|
+
"tsConfig": "projects/button/tsconfig.lib.json",
|
|
9
|
+
"project": "projects/button/ng-package.json"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"compilerOptions": {
|
|
13
|
+
"preserveSymlinks": true,
|
|
14
|
+
"paths": {
|
|
15
|
+
"@tuki/widgets": [
|
|
16
|
+
"dist/tuki/widgets"
|
|
17
|
+
]
|
|
18
|
+
},
|
|
19
|
+
"baseUrl": "./",
|
|
20
|
+
"outDir": "./dist/out-tsc",
|
|
21
|
+
"forceConsistentCasingInFileNames": true,
|
|
22
|
+
"strict": true,
|
|
23
|
+
"noImplicitOverride": true,
|
|
24
|
+
"noPropertyAccessFromIndexSignature": true,
|
|
25
|
+
"noImplicitReturns": true,
|
|
26
|
+
"noFallthroughCasesInSwitch": true,
|
|
27
|
+
"sourceMap": true,
|
|
28
|
+
"declaration": false,
|
|
29
|
+
"downlevelIteration": true,
|
|
30
|
+
"experimentalDecorators": true,
|
|
31
|
+
"moduleResolution": "node",
|
|
32
|
+
"importHelpers": true,
|
|
33
|
+
"target": "es2020",
|
|
34
|
+
"module": "es2020",
|
|
35
|
+
"lib": [
|
|
36
|
+
"es2020",
|
|
37
|
+
"dom"
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
"angularCompilerOptions": {
|
|
41
|
+
"enableI18nLegacyMessageIdFormat": false,
|
|
42
|
+
"strictInjectionParameters": true,
|
|
43
|
+
"strictInputAccessModifiers": true,
|
|
44
|
+
"strictTemplates": true
|
|
45
|
+
}
|
|
46
|
+
}
|