@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.
Files changed (117) hide show
  1. package/.editorconfig +16 -0
  2. package/.vscode/extensions.json +4 -0
  3. package/.vscode/launch.json +20 -0
  4. package/.vscode/tasks.json +42 -0
  5. package/README.md +27 -0
  6. package/angular.json +41 -0
  7. package/package.json +42 -0
  8. package/projects/tuki/widgets/README.md +24 -0
  9. package/projects/tuki/widgets/karma.conf.js +44 -0
  10. package/projects/tuki/widgets/ng-package.json +7 -0
  11. package/projects/tuki/widgets/package.json +13 -0
  12. package/projects/tuki/widgets/src/lib/widgets.component.spec.ts +23 -0
  13. package/projects/tuki/widgets/src/lib/widgets.component.ts +20 -0
  14. package/projects/tuki/widgets/src/lib/widgets.module.ts +16 -0
  15. package/projects/tuki/widgets/src/lib/widgets.service.spec.ts +16 -0
  16. package/projects/tuki/widgets/src/lib/widgets.service.ts +9 -0
  17. package/projects/tuki/widgets/src/public-api.ts +7 -0
  18. package/projects/tuki/widgets/src/test.ts +27 -0
  19. package/projects/tuki/widgets/styles/_variables.scss +90 -0
  20. package/projects/tuki/widgets/styles/form.scss +231 -0
  21. package/projects/tuki/widgets/styles/icons.scss +32 -0
  22. package/projects/tuki/widgets/styles/styles.scss +110 -0
  23. package/projects/tuki/widgets/styles/tables.scss +30 -0
  24. package/projects/tuki/widgets/tsconfig.lib.json +36 -0
  25. package/projects/tuki/widgets/tsconfig.lib.prod.json +10 -0
  26. package/projects/tuki/widgets/tsconfig.spec.json +17 -0
  27. package/projects/tuki/widgets/user-manage/ng-package.json +7 -0
  28. package/projects/tuki/widgets/user-manage/public-api.ts +6 -0
  29. package/projects/tuki/widgets/user-manage/src/app.constants.ts +38 -0
  30. package/projects/tuki/widgets/user-manage/src/classes/device.ts +225 -0
  31. package/projects/tuki/widgets/user-manage/src/classes/line.ts +117 -0
  32. package/projects/tuki/widgets/user-manage/src/classes/notification.ts +39 -0
  33. package/projects/tuki/widgets/user-manage/src/classes/pagination.ts +18 -0
  34. package/projects/tuki/widgets/user-manage/src/classes/simplified-user.ts +128 -0
  35. package/projects/tuki/widgets/user-manage/src/classes/table-data.ts +6 -0
  36. package/projects/tuki/widgets/user-manage/src/classes/user-interface.ts +225 -0
  37. package/projects/tuki/widgets/user-manage/src/classes/user-list.ts +40 -0
  38. package/projects/tuki/widgets/user-manage/src/classes/user.ts +8 -0
  39. package/projects/tuki/widgets/user-manage/src/common-functions.ts +16 -0
  40. package/projects/tuki/widgets/user-manage/src/environments/environment.prod.ts +9 -0
  41. package/projects/tuki/widgets/user-manage/src/environments/environment.ts +10 -0
  42. package/projects/tuki/widgets/user-manage/src/interseptors/auth.interceptor.ts +36 -0
  43. package/projects/tuki/widgets/user-manage/src/lazy-loading-select/lazy-loading-select.component.html +50 -0
  44. package/projects/tuki/widgets/user-manage/src/lazy-loading-select/lazy-loading-select.component.scss +3 -0
  45. package/projects/tuki/widgets/user-manage/src/lazy-loading-select/lazy-loading-select.component.ts +81 -0
  46. package/projects/tuki/widgets/user-manage/src/material.module.ts +85 -0
  47. package/projects/tuki/widgets/user-manage/src/notifications/notification.component.html +33 -0
  48. package/projects/tuki/widgets/user-manage/src/notifications/notification.component.scss +84 -0
  49. package/projects/tuki/widgets/user-manage/src/notifications/notification.component.ts +46 -0
  50. package/projects/tuki/widgets/user-manage/src/removeKynFromIBM.service.ts +25 -0
  51. package/projects/tuki/widgets/user-manage/src/services/api.service.ts +89 -0
  52. package/projects/tuki/widgets/user-manage/src/services/notification.service.ts +68 -0
  53. package/projects/tuki/widgets/user-manage/src/services/removeKynFromIBM.service.ts +25 -0
  54. package/projects/tuki/widgets/user-manage/src/services/site-settings.service.ts +35 -0
  55. package/projects/tuki/widgets/user-manage/src/services/user.service.ts +120 -0
  56. package/projects/tuki/widgets/user-manage/src/services/users-search.service.ts +58 -0
  57. package/projects/tuki/widgets/user-manage/src/services/utils.service.ts +71 -0
  58. package/projects/tuki/widgets/user-manage/src/styles/_variables.scss +90 -0
  59. package/projects/tuki/widgets/user-manage/src/styles/form.scss +231 -0
  60. package/projects/tuki/widgets/user-manage/src/styles/icons.scss +32 -0
  61. package/projects/tuki/widgets/user-manage/src/styles/styles.scss +110 -0
  62. package/projects/tuki/widgets/user-manage/src/styles/tables.scss +30 -0
  63. package/projects/tuki/widgets/user-manage/src/user-details/notification.service.ts +68 -0
  64. package/projects/tuki/widgets/user-manage/src/user-info/user-info.component.html +32 -0
  65. package/projects/tuki/widgets/user-manage/src/user-info/user-info.component.scss +53 -0
  66. package/projects/tuki/widgets/user-manage/src/user-info/user-info.component.ts +19 -0
  67. package/projects/tuki/widgets/user-manage/src/user-manage-widget.component.html +291 -0
  68. package/projects/tuki/widgets/user-manage/src/user-manage-widget.component.scss +461 -0
  69. package/projects/tuki/widgets/user-manage/src/user-manage-widget.component.ts +163 -0
  70. package/projects/tuki/widgets/user-manage/src/user-manage.module.ts +53 -0
  71. package/projects/tuki/widgets/user-manage/src/utils/app-loader/app-loader.component.html +6 -0
  72. package/projects/tuki/widgets/user-manage/src/utils/app-loader/app-loader.component.scss +11 -0
  73. package/projects/tuki/widgets/user-manage/src/utils/app-loader/app-loader.ts +13 -0
  74. package/projects/tuki/widgets/user-manage/src/utils/pagination/pagination.component.html +26 -0
  75. package/projects/tuki/widgets/user-manage/src/utils/pagination/pagination.component.scss +41 -0
  76. package/projects/tuki/widgets/user-manage/src/utils/pagination/pagination.component.ts +41 -0
  77. package/projects/tuki/widgets/users-list/ng-package.json +6 -0
  78. package/projects/tuki/widgets/users-list/public-api.ts +8 -0
  79. package/projects/tuki/widgets/users-list/src/app.constants.ts +35 -0
  80. package/projects/tuki/widgets/users-list/src/classes/device.ts +225 -0
  81. package/projects/tuki/widgets/users-list/src/classes/line.ts +117 -0
  82. package/projects/tuki/widgets/users-list/src/classes/notification.ts +38 -0
  83. package/projects/tuki/widgets/users-list/src/classes/pagination.ts +18 -0
  84. package/projects/tuki/widgets/users-list/src/classes/simlified-user.ts +74 -0
  85. package/projects/tuki/widgets/users-list/src/classes/table-data.ts +6 -0
  86. package/projects/tuki/widgets/users-list/src/classes/user-interface.ts +225 -0
  87. package/projects/tuki/widgets/users-list/src/classes/user-list.ts +40 -0
  88. package/projects/tuki/widgets/users-list/src/classes/user.ts +8 -0
  89. package/projects/tuki/widgets/users-list/src/material.module.ts +84 -0
  90. package/projects/tuki/widgets/users-list/src/services/api.service.ts +87 -0
  91. package/projects/tuki/widgets/users-list/src/services/events-communication.service.ts +11 -0
  92. package/projects/tuki/widgets/users-list/src/services/notification.service.ts +68 -0
  93. package/projects/tuki/widgets/users-list/src/services/removeKynFromIBM.service.ts +25 -0
  94. package/projects/tuki/widgets/users-list/src/services/user.service.ts +117 -0
  95. package/projects/tuki/widgets/users-list/src/services/users-search.service.ts +58 -0
  96. package/projects/tuki/widgets/users-list/src/users-list.component.css +4 -0
  97. package/projects/tuki/widgets/users-list/src/users-list.component.css.map +1 -0
  98. package/projects/tuki/widgets/users-list/src/users-list.component.html +39 -0
  99. package/projects/tuki/widgets/users-list/src/users-list.component.scss +9 -0
  100. package/projects/tuki/widgets/users-list/src/users-list.component.ts +85 -0
  101. package/projects/tuki/widgets/users-list/src/users-list.module.ts +36 -0
  102. package/projects/tuki/widgets/users-list/src/utils/app-loader/app-loader.component.css +11 -0
  103. package/projects/tuki/widgets/users-list/src/utils/app-loader/app-loader.component.css.map +1 -0
  104. package/projects/tuki/widgets/users-list/src/utils/app-loader/app-loader.component.html +6 -0
  105. package/projects/tuki/widgets/users-list/src/utils/app-loader/app-loader.component.scss +11 -0
  106. package/projects/tuki/widgets/users-list/src/utils/app-loader/app-loader.ts +13 -0
  107. package/projects/tuki/widgets/users-list/src/utils/common-functions.ts +16 -0
  108. package/projects/tuki/widgets/users-list/src/utils/notifications/notification.component.html +33 -0
  109. package/projects/tuki/widgets/users-list/src/utils/notifications/notification.component.scss +84 -0
  110. package/projects/tuki/widgets/users-list/src/utils/notifications/notification.component.ts +46 -0
  111. package/projects/tuki/widgets/users-list/src/utils/pagination/pagination.component.css +45 -0
  112. package/projects/tuki/widgets/users-list/src/utils/pagination/pagination.component.css.map +1 -0
  113. package/projects/tuki/widgets/users-list/src/utils/pagination/pagination.component.html +26 -0
  114. package/projects/tuki/widgets/users-list/src/utils/pagination/pagination.component.scss +41 -0
  115. package/projects/tuki/widgets/users-list/src/utils/pagination/pagination.component.ts +41 -0
  116. package/projects/tuki/widgets/users-list/src/utils/utils.service.ts +71 -0
  117. 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
+ }