@tuki-io/tuki-widgets 0.0.6 → 0.0.7

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 (238) hide show
  1. package/README.md +9 -10
  2. package/esm2020/lib/widgets.component.mjs +22 -0
  3. package/esm2020/lib/widgets.module.mjs +21 -0
  4. package/esm2020/lib/widgets.service.mjs +14 -0
  5. package/esm2020/public-api.mjs +7 -0
  6. package/esm2020/tuki-io-tuki-widgets.mjs +5 -0
  7. package/esm2020/user-manage/public-api.mjs +7 -0
  8. package/esm2020/user-manage/src/app.constants.mjs +38 -0
  9. package/esm2020/user-manage/src/classes/device.mjs +7 -0
  10. package/esm2020/user-manage/src/classes/line.mjs +9 -0
  11. package/esm2020/user-manage/src/classes/notification.mjs +32 -0
  12. package/esm2020/user-manage/src/classes/pagination.mjs +8 -0
  13. package/esm2020/user-manage/src/classes/simplified-user.mjs +82 -0
  14. package/esm2020/user-manage/src/classes/table-data.mjs +2 -0
  15. package/esm2020/user-manage/src/classes/user-list.mjs +10 -0
  16. package/esm2020/user-manage/src/common-functions.mjs +19 -0
  17. package/esm2020/user-manage/src/environments/environment.mjs +11 -0
  18. package/esm2020/user-manage/src/interseptors/auth.interceptor.mjs +37 -0
  19. package/esm2020/user-manage/src/lazy-loading-select/lazy-loading-select.component.mjs +74 -0
  20. package/esm2020/user-manage/src/material.module.mjs +188 -0
  21. package/esm2020/user-manage/src/notifications/notification.component.mjs +35 -0
  22. package/esm2020/user-manage/src/removeKynFromIBM.service.mjs +25 -0
  23. package/esm2020/user-manage/src/services/api.service.mjs +79 -0
  24. package/esm2020/user-manage/src/services/notification.service.mjs +62 -0
  25. package/esm2020/user-manage/src/services/removeKynFromIBM.service.mjs +25 -0
  26. package/esm2020/user-manage/src/services/site-settings.service.mjs +36 -0
  27. package/esm2020/user-manage/src/services/user.service.mjs +108 -0
  28. package/esm2020/user-manage/src/services/users-search.service.mjs +49 -0
  29. package/esm2020/user-manage/src/services/utils.service.mjs +73 -0
  30. package/esm2020/user-manage/src/user-info/user-info.component.mjs +20 -0
  31. package/esm2020/user-manage/src/user-manage-widget.component.mjs +159 -0
  32. package/esm2020/user-manage/src/user-manage.module.mjs +84 -0
  33. package/esm2020/user-manage/src/utils/app-loader/app-loader.mjs +14 -0
  34. package/esm2020/user-manage/src/utils/pagination/pagination.component.mjs +43 -0
  35. package/esm2020/user-manage/tuki-io-tuki-widgets-user-manage.mjs +5 -0
  36. package/esm2020/users-list/public-api.mjs +9 -0
  37. package/esm2020/users-list/src/app.constants.mjs +35 -0
  38. package/esm2020/users-list/src/classes/device.mjs +7 -0
  39. package/esm2020/users-list/src/classes/line.mjs +9 -0
  40. package/esm2020/users-list/src/classes/notification.mjs +31 -0
  41. package/esm2020/users-list/src/classes/pagination.mjs +8 -0
  42. package/esm2020/users-list/src/classes/simlified-user.mjs +50 -0
  43. package/esm2020/users-list/src/classes/table-data.mjs +2 -0
  44. package/esm2020/users-list/src/classes/user-list.mjs +10 -0
  45. package/esm2020/users-list/src/material.module.mjs +188 -0
  46. package/esm2020/users-list/src/services/api.service.mjs +78 -0
  47. package/esm2020/users-list/src/services/events-communication.service.mjs +14 -0
  48. package/esm2020/users-list/src/services/notification.service.mjs +62 -0
  49. package/esm2020/users-list/src/services/removeKynFromIBM.service.mjs +25 -0
  50. package/esm2020/users-list/src/services/user.service.mjs +105 -0
  51. package/esm2020/users-list/src/services/users-search.service.mjs +49 -0
  52. package/esm2020/users-list/src/users-list.component.mjs +75 -0
  53. package/esm2020/users-list/src/users-list.module.mjs +58 -0
  54. package/esm2020/users-list/src/utils/common-functions.mjs +19 -0
  55. package/esm2020/users-list/src/utils/pagination/pagination.component.mjs +43 -0
  56. package/esm2020/users-list/src/utils/utils.service.mjs +73 -0
  57. package/esm2020/users-list/tuki-io-tuki-widgets-users-list.mjs +5 -0
  58. package/fesm2015/tuki-io-tuki-widgets-user-manage.mjs +1232 -0
  59. package/fesm2015/tuki-io-tuki-widgets-user-manage.mjs.map +1 -0
  60. package/fesm2015/tuki-io-tuki-widgets-users-list.mjs +869 -0
  61. package/fesm2015/tuki-io-tuki-widgets-users-list.mjs.map +1 -0
  62. package/fesm2015/tuki-io-tuki-widgets.mjs +63 -0
  63. package/fesm2015/tuki-io-tuki-widgets.mjs.map +1 -0
  64. package/fesm2020/tuki-io-tuki-widgets-user-manage.mjs +1219 -0
  65. package/fesm2020/tuki-io-tuki-widgets-user-manage.mjs.map +1 -0
  66. package/fesm2020/tuki-io-tuki-widgets-users-list.mjs +866 -0
  67. package/fesm2020/tuki-io-tuki-widgets-users-list.mjs.map +1 -0
  68. package/fesm2020/tuki-io-tuki-widgets.mjs +63 -0
  69. package/fesm2020/tuki-io-tuki-widgets.mjs.map +1 -0
  70. package/index.d.ts +5 -0
  71. package/lib/widgets.component.d.ts +8 -0
  72. package/lib/widgets.module.d.ts +7 -0
  73. package/lib/widgets.service.d.ts +6 -0
  74. package/package.json +44 -36
  75. package/{projects/tuki/widgets/src/public-api.ts → public-api.d.ts} +0 -4
  76. package/user-manage/index.d.ts +5 -0
  77. package/user-manage/src/app.constants.d.ts +20 -0
  78. package/user-manage/src/classes/device.d.ts +224 -0
  79. package/user-manage/src/classes/line.d.ts +116 -0
  80. package/user-manage/src/classes/notification.d.ts +18 -0
  81. package/user-manage/src/classes/pagination.d.ts +13 -0
  82. package/user-manage/src/classes/simplified-user.d.ts +41 -0
  83. package/user-manage/src/classes/table-data.d.ts +5 -0
  84. package/user-manage/src/classes/user-list.d.ts +32 -0
  85. package/user-manage/src/common-functions.d.ts +1 -0
  86. package/user-manage/src/environments/environment.d.ts +9 -0
  87. package/user-manage/src/interseptors/auth.interceptor.d.ts +9 -0
  88. package/user-manage/src/lazy-loading-select/lazy-loading-select.component.d.ts +35 -0
  89. package/user-manage/src/material.module.d.ts +28 -0
  90. package/user-manage/src/notifications/notification.component.d.ts +19 -0
  91. package/user-manage/src/removeKynFromIBM.service.d.ts +8 -0
  92. package/user-manage/src/services/api.service.d.ts +20 -0
  93. package/user-manage/src/services/notification.service.d.ts +18 -0
  94. package/user-manage/src/services/removeKynFromIBM.service.d.ts +8 -0
  95. package/user-manage/src/services/site-settings.service.d.ts +9 -0
  96. package/user-manage/src/services/user.service.d.ts +26 -0
  97. package/user-manage/src/services/users-search.service.d.ts +25 -0
  98. package/user-manage/src/services/utils.service.d.ts +9 -0
  99. package/user-manage/src/user-info/user-info.component.d.ts +9 -0
  100. package/user-manage/src/user-manage-widget.component.d.ts +31 -0
  101. package/user-manage/src/user-manage.module.d.ts +18 -0
  102. package/user-manage/src/utils/app-loader/app-loader.d.ts +6 -0
  103. package/user-manage/src/utils/pagination/pagination.component.d.ts +18 -0
  104. package/users-list/index.d.ts +5 -0
  105. package/users-list/src/app.constants.d.ts +17 -0
  106. package/users-list/src/classes/device.d.ts +224 -0
  107. package/users-list/src/classes/line.d.ts +116 -0
  108. package/users-list/src/classes/notification.d.ts +18 -0
  109. package/users-list/src/classes/pagination.d.ts +13 -0
  110. package/users-list/src/classes/simlified-user.d.ts +25 -0
  111. package/users-list/src/classes/table-data.d.ts +5 -0
  112. package/users-list/src/classes/user-list.d.ts +32 -0
  113. package/users-list/src/material.module.d.ts +28 -0
  114. package/users-list/src/services/api.service.d.ts +20 -0
  115. package/users-list/src/services/events-communication.service.d.ts +8 -0
  116. package/users-list/src/services/notification.service.d.ts +18 -0
  117. package/users-list/src/services/removeKynFromIBM.service.d.ts +8 -0
  118. package/users-list/src/services/user.service.d.ts +26 -0
  119. package/users-list/src/services/users-search.service.d.ts +25 -0
  120. package/users-list/src/users-list.component.d.ts +34 -0
  121. package/users-list/src/users-list.module.d.ts +12 -0
  122. package/users-list/src/utils/common-functions.d.ts +1 -0
  123. package/users-list/src/utils/pagination/pagination.component.d.ts +18 -0
  124. package/users-list/src/utils/utils.service.d.ts +9 -0
  125. package/.editorconfig +0 -16
  126. package/.vscode/extensions.json +0 -4
  127. package/.vscode/launch.json +0 -20
  128. package/.vscode/tasks.json +0 -42
  129. package/angular.json +0 -41
  130. package/projects/tuki/widgets/README.md +0 -24
  131. package/projects/tuki/widgets/karma.conf.js +0 -44
  132. package/projects/tuki/widgets/ng-package.json +0 -7
  133. package/projects/tuki/widgets/package.json +0 -13
  134. package/projects/tuki/widgets/src/lib/widgets.component.spec.ts +0 -23
  135. package/projects/tuki/widgets/src/lib/widgets.component.ts +0 -20
  136. package/projects/tuki/widgets/src/lib/widgets.module.ts +0 -16
  137. package/projects/tuki/widgets/src/lib/widgets.service.spec.ts +0 -16
  138. package/projects/tuki/widgets/src/lib/widgets.service.ts +0 -9
  139. package/projects/tuki/widgets/src/test.ts +0 -27
  140. package/projects/tuki/widgets/styles/_variables.scss +0 -90
  141. package/projects/tuki/widgets/styles/form.scss +0 -231
  142. package/projects/tuki/widgets/styles/icons.scss +0 -32
  143. package/projects/tuki/widgets/styles/styles.scss +0 -110
  144. package/projects/tuki/widgets/styles/tables.scss +0 -30
  145. package/projects/tuki/widgets/tsconfig.lib.json +0 -36
  146. package/projects/tuki/widgets/tsconfig.lib.prod.json +0 -10
  147. package/projects/tuki/widgets/tsconfig.spec.json +0 -17
  148. package/projects/tuki/widgets/user-manage/ng-package.json +0 -7
  149. package/projects/tuki/widgets/user-manage/src/app.constants.ts +0 -38
  150. package/projects/tuki/widgets/user-manage/src/classes/device.ts +0 -225
  151. package/projects/tuki/widgets/user-manage/src/classes/line.ts +0 -117
  152. package/projects/tuki/widgets/user-manage/src/classes/notification.ts +0 -39
  153. package/projects/tuki/widgets/user-manage/src/classes/pagination.ts +0 -18
  154. package/projects/tuki/widgets/user-manage/src/classes/simplified-user.ts +0 -128
  155. package/projects/tuki/widgets/user-manage/src/classes/table-data.ts +0 -6
  156. package/projects/tuki/widgets/user-manage/src/classes/user-interface.ts +0 -225
  157. package/projects/tuki/widgets/user-manage/src/classes/user-list.ts +0 -40
  158. package/projects/tuki/widgets/user-manage/src/classes/user.ts +0 -8
  159. package/projects/tuki/widgets/user-manage/src/common-functions.ts +0 -16
  160. package/projects/tuki/widgets/user-manage/src/environments/environment.prod.ts +0 -9
  161. package/projects/tuki/widgets/user-manage/src/environments/environment.ts +0 -10
  162. package/projects/tuki/widgets/user-manage/src/interseptors/auth.interceptor.ts +0 -36
  163. package/projects/tuki/widgets/user-manage/src/lazy-loading-select/lazy-loading-select.component.html +0 -50
  164. package/projects/tuki/widgets/user-manage/src/lazy-loading-select/lazy-loading-select.component.scss +0 -3
  165. package/projects/tuki/widgets/user-manage/src/lazy-loading-select/lazy-loading-select.component.ts +0 -81
  166. package/projects/tuki/widgets/user-manage/src/material.module.ts +0 -85
  167. package/projects/tuki/widgets/user-manage/src/notifications/notification.component.html +0 -33
  168. package/projects/tuki/widgets/user-manage/src/notifications/notification.component.scss +0 -84
  169. package/projects/tuki/widgets/user-manage/src/notifications/notification.component.ts +0 -46
  170. package/projects/tuki/widgets/user-manage/src/removeKynFromIBM.service.ts +0 -25
  171. package/projects/tuki/widgets/user-manage/src/services/api.service.ts +0 -89
  172. package/projects/tuki/widgets/user-manage/src/services/notification.service.ts +0 -68
  173. package/projects/tuki/widgets/user-manage/src/services/removeKynFromIBM.service.ts +0 -25
  174. package/projects/tuki/widgets/user-manage/src/services/site-settings.service.ts +0 -35
  175. package/projects/tuki/widgets/user-manage/src/services/user.service.ts +0 -120
  176. package/projects/tuki/widgets/user-manage/src/services/users-search.service.ts +0 -58
  177. package/projects/tuki/widgets/user-manage/src/services/utils.service.ts +0 -71
  178. package/projects/tuki/widgets/user-manage/src/styles/_variables.scss +0 -90
  179. package/projects/tuki/widgets/user-manage/src/styles/form.scss +0 -231
  180. package/projects/tuki/widgets/user-manage/src/styles/icons.scss +0 -32
  181. package/projects/tuki/widgets/user-manage/src/styles/styles.scss +0 -110
  182. package/projects/tuki/widgets/user-manage/src/styles/tables.scss +0 -30
  183. package/projects/tuki/widgets/user-manage/src/user-details/notification.service.ts +0 -68
  184. package/projects/tuki/widgets/user-manage/src/user-info/user-info.component.html +0 -32
  185. package/projects/tuki/widgets/user-manage/src/user-info/user-info.component.scss +0 -53
  186. package/projects/tuki/widgets/user-manage/src/user-info/user-info.component.ts +0 -19
  187. package/projects/tuki/widgets/user-manage/src/user-manage-widget.component.html +0 -291
  188. package/projects/tuki/widgets/user-manage/src/user-manage-widget.component.scss +0 -461
  189. package/projects/tuki/widgets/user-manage/src/user-manage-widget.component.ts +0 -163
  190. package/projects/tuki/widgets/user-manage/src/user-manage.module.ts +0 -53
  191. package/projects/tuki/widgets/user-manage/src/utils/app-loader/app-loader.component.html +0 -6
  192. package/projects/tuki/widgets/user-manage/src/utils/app-loader/app-loader.component.scss +0 -11
  193. package/projects/tuki/widgets/user-manage/src/utils/app-loader/app-loader.ts +0 -13
  194. package/projects/tuki/widgets/user-manage/src/utils/pagination/pagination.component.html +0 -26
  195. package/projects/tuki/widgets/user-manage/src/utils/pagination/pagination.component.scss +0 -41
  196. package/projects/tuki/widgets/user-manage/src/utils/pagination/pagination.component.ts +0 -41
  197. package/projects/tuki/widgets/users-list/ng-package.json +0 -6
  198. package/projects/tuki/widgets/users-list/src/app.constants.ts +0 -35
  199. package/projects/tuki/widgets/users-list/src/classes/device.ts +0 -225
  200. package/projects/tuki/widgets/users-list/src/classes/line.ts +0 -117
  201. package/projects/tuki/widgets/users-list/src/classes/notification.ts +0 -38
  202. package/projects/tuki/widgets/users-list/src/classes/pagination.ts +0 -18
  203. package/projects/tuki/widgets/users-list/src/classes/simlified-user.ts +0 -74
  204. package/projects/tuki/widgets/users-list/src/classes/table-data.ts +0 -6
  205. package/projects/tuki/widgets/users-list/src/classes/user-interface.ts +0 -225
  206. package/projects/tuki/widgets/users-list/src/classes/user-list.ts +0 -40
  207. package/projects/tuki/widgets/users-list/src/classes/user.ts +0 -8
  208. package/projects/tuki/widgets/users-list/src/material.module.ts +0 -84
  209. package/projects/tuki/widgets/users-list/src/services/api.service.ts +0 -87
  210. package/projects/tuki/widgets/users-list/src/services/events-communication.service.ts +0 -11
  211. package/projects/tuki/widgets/users-list/src/services/notification.service.ts +0 -68
  212. package/projects/tuki/widgets/users-list/src/services/removeKynFromIBM.service.ts +0 -25
  213. package/projects/tuki/widgets/users-list/src/services/user.service.ts +0 -117
  214. package/projects/tuki/widgets/users-list/src/services/users-search.service.ts +0 -58
  215. package/projects/tuki/widgets/users-list/src/users-list.component.css +0 -4
  216. package/projects/tuki/widgets/users-list/src/users-list.component.css.map +0 -1
  217. package/projects/tuki/widgets/users-list/src/users-list.component.html +0 -39
  218. package/projects/tuki/widgets/users-list/src/users-list.component.scss +0 -9
  219. package/projects/tuki/widgets/users-list/src/users-list.component.ts +0 -85
  220. package/projects/tuki/widgets/users-list/src/users-list.module.ts +0 -36
  221. package/projects/tuki/widgets/users-list/src/utils/app-loader/app-loader.component.css +0 -11
  222. package/projects/tuki/widgets/users-list/src/utils/app-loader/app-loader.component.css.map +0 -1
  223. package/projects/tuki/widgets/users-list/src/utils/app-loader/app-loader.component.html +0 -6
  224. package/projects/tuki/widgets/users-list/src/utils/app-loader/app-loader.component.scss +0 -11
  225. package/projects/tuki/widgets/users-list/src/utils/app-loader/app-loader.ts +0 -13
  226. package/projects/tuki/widgets/users-list/src/utils/common-functions.ts +0 -16
  227. package/projects/tuki/widgets/users-list/src/utils/notifications/notification.component.html +0 -33
  228. package/projects/tuki/widgets/users-list/src/utils/notifications/notification.component.scss +0 -84
  229. package/projects/tuki/widgets/users-list/src/utils/notifications/notification.component.ts +0 -46
  230. package/projects/tuki/widgets/users-list/src/utils/pagination/pagination.component.css +0 -45
  231. package/projects/tuki/widgets/users-list/src/utils/pagination/pagination.component.css.map +0 -1
  232. package/projects/tuki/widgets/users-list/src/utils/pagination/pagination.component.html +0 -26
  233. package/projects/tuki/widgets/users-list/src/utils/pagination/pagination.component.scss +0 -41
  234. package/projects/tuki/widgets/users-list/src/utils/pagination/pagination.component.ts +0 -41
  235. package/projects/tuki/widgets/users-list/src/utils/utils.service.ts +0 -71
  236. package/tsconfig.json +0 -46
  237. /package/{projects/tuki/widgets/user-manage/public-api.ts → user-manage/public-api.d.ts} +0 -0
  238. /package/{projects/tuki/widgets/users-list/public-api.ts → users-list/public-api.d.ts} +0 -0
@@ -0,0 +1,866 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, EventEmitter, Component, Input, Output, NgModule } from '@angular/core';
3
+ import * as i6$1 from '@angular/material/table';
4
+ import { MatTableDataSource, MatTableModule } from '@angular/material/table';
5
+ import { of, forkJoin, Subject, BehaviorSubject } from 'rxjs';
6
+ import * as i2 from '@angular/forms';
7
+ import { FormBuilder, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
8
+ import { map } from 'rxjs/operators';
9
+ import * as i1 from '@angular/common/http';
10
+ import { HttpHeaders, HttpClientModule } from '@angular/common/http';
11
+ import * as i1$1 from '@angular/common';
12
+ import * as i3 from '@angular/material/progress-spinner';
13
+ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
14
+ import * as i4 from '@angular/material/core';
15
+ import { MatNativeDateModule } from '@angular/material/core';
16
+ import * as i5 from '@angular/material/select';
17
+ import { MatSelectModule } from '@angular/material/select';
18
+ import * as i6 from '@angular/material/paginator';
19
+ import { MatPaginatorModule } from '@angular/material/paginator';
20
+ import { BrowserModule } from '@angular/platform-browser';
21
+ import { MatExpansionModule } from '@angular/material/expansion';
22
+ import { MatDatepickerModule } from '@angular/material/datepicker';
23
+ import { MatAutocompleteModule } from '@angular/material/autocomplete';
24
+ import { MatChipsModule } from '@angular/material/chips';
25
+ import { MatListModule } from '@angular/material/list';
26
+ import { MatSidenavModule } from '@angular/material/sidenav';
27
+ import { MatTreeModule } from '@angular/material/tree';
28
+ import { DragDropModule } from '@angular/cdk/drag-drop';
29
+ import { MatButtonModule } from '@angular/material/button';
30
+ import { MatInputModule } from '@angular/material/input';
31
+ import { MatTooltipModule } from '@angular/material/tooltip';
32
+ import { MatFormFieldModule } from '@angular/material/form-field';
33
+ import { MatStepperModule } from '@angular/material/stepper';
34
+ import { MatTabsModule } from '@angular/material/tabs';
35
+ import { MatCardModule } from '@angular/material/card';
36
+ import { MatCheckboxModule } from '@angular/material/checkbox';
37
+ import { MatSlideToggleModule } from '@angular/material/slide-toggle';
38
+
39
+ const getSavableData = (model, exclude) => {
40
+ let result = Object.keys(model);
41
+ if (exclude && exclude.length) {
42
+ result = result.filter(key => !exclude.some(item => item === key));
43
+ }
44
+ return result.reduce((result, key) => {
45
+ if (model[key] instanceof Array && model[key].length && model[key][0].getSavableData) {
46
+ result[key] = model[key].map((item) => item.getSavableData());
47
+ }
48
+ else if (model[key] instanceof Object && model[key].getSavableData) {
49
+ result[key] = model[key].getSavableData();
50
+ }
51
+ else {
52
+ result[key] = model[key];
53
+ }
54
+ return result;
55
+ }, {});
56
+ };
57
+
58
+ const API = {
59
+ USER_TOKEN: '/api/provision/:siteId/users/:userId/token',
60
+ UPDATE_USER_FIELDS: '/api/provision/:siteId/userFields/:token',
61
+ PERSIST_USER_CACHE: '/api/provision/:siteId/saveUser/:token',
62
+ USER_BY_ID: '/api/provision/:siteId/users/:userId',
63
+ QUICK_USERS_SEARCH: "/api/search/quickusers"
64
+ };
65
+ const REGEX_PATTERN = {
66
+ EMAIL: '^(([^<>()\\[\\]\\\\.,;:\\s@"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@"]+)*)|(".+"))' +
67
+ '@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,62}[a-zA-Z0-9])' +
68
+ '?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,62}[a-zA-Z0-9])?)*$'
69
+ };
70
+ const PAGINATION_DEFAULTS = {
71
+ SIZE: 10,
72
+ INDEX: 0
73
+ };
74
+ const PAGINATION_SIZE_OPTIONS = [
75
+ 10,
76
+ 50,
77
+ 100,
78
+ 500
79
+ ];
80
+ const CUCS_TO_IGNORE = [
81
+ 189,
82
+ 194,
83
+ 191,
84
+ 190
85
+ ];
86
+ const CUCMS_TO_IGNORE = [
87
+ 249,
88
+ 255,
89
+ 251,
90
+ 250
91
+ ];
92
+
93
+ class SimplifiedUser {
94
+ constructor(user) {
95
+ if (user) {
96
+ this.userid = user.userid;
97
+ this.email = user.email;
98
+ this.firstName = user.firstName;
99
+ this.lastName = user.lastName;
100
+ this.token = user.token;
101
+ }
102
+ this.initForm();
103
+ }
104
+ initForm() {
105
+ const formBuilder = new FormBuilder();
106
+ const formSettings = {
107
+ userid: [{ value: this.userid || '', disabled: true }, [Validators.required, Validators.maxLength(128)]],
108
+ email: [{ value: this.email || '', disabled: true }, [
109
+ Validators.pattern(REGEX_PATTERN.EMAIL),
110
+ Validators.required
111
+ ]],
112
+ firstName: [{ value: this.firstName || '', disabled: true }],
113
+ lastName: [{ value: this.lastName || '', disabled: true }, Validators.required],
114
+ };
115
+ this.form = formBuilder.group(formSettings);
116
+ }
117
+ toggleEditMode() {
118
+ this.editMode = !this.editMode;
119
+ ['userid', 'email', 'firstName', 'lastName'].forEach(token => {
120
+ if (this.editMode) {
121
+ this.form.get(token)?.enable();
122
+ }
123
+ else {
124
+ this.form.get(token)?.disable();
125
+ }
126
+ });
127
+ }
128
+ getSavableData() {
129
+ const excludedFields = ['form', 'editMode', 'viewMode', 'token', 'hasModifiedCache'];
130
+ return getSavableData(this, excludedFields);
131
+ }
132
+ equal(userToCompare) {
133
+ if (!userToCompare) {
134
+ return false;
135
+ }
136
+ return JSON.stringify(this.getSavableData()) === JSON.stringify(userToCompare.getSavableData());
137
+ }
138
+ }
139
+
140
+ class UtilsService {
141
+ static sortSortArrayByProperty(array, sortBy) {
142
+ if (!array) {
143
+ return null;
144
+ }
145
+ return array.sort((a, b) => {
146
+ if (!a[sortBy] && !b[sortBy]) {
147
+ return 0;
148
+ }
149
+ if (a[sortBy] && !b[sortBy]) {
150
+ return 1;
151
+ }
152
+ if (!a[sortBy] && b[sortBy]) {
153
+ return -1;
154
+ }
155
+ const positionA = a[sortBy];
156
+ const positionB = b[sortBy];
157
+ return (positionA < positionB) ? -1 : (positionA > positionB) ? 1 : 0;
158
+ });
159
+ }
160
+ static diff(origObject, updatedObj, path, keysToIgnore) {
161
+ let result = [];
162
+ if (Object.is(origObject, updatedObj)) {
163
+ return undefined;
164
+ }
165
+ if (!updatedObj || typeof updatedObj !== 'object') {
166
+ return updatedObj;
167
+ }
168
+ const concat = Array.from(new Set([...Object.keys(origObject || {}), ...Object.keys(updatedObj || {})]));
169
+ const filter = keysToIgnore ? concat.filter(key => !keysToIgnore.includes(key)) : concat;
170
+ filter
171
+ .forEach(key => {
172
+ if (typeof updatedObj[key] === 'object' && typeof origObject[key] === 'object') {
173
+ if (UtilsService.differs(updatedObj[key], origObject[key])) {
174
+ const newPath = `${path}${path ? '.' : ''}${key}`;
175
+ const values = UtilsService.diff(origObject[key], updatedObj[key], newPath, keysToIgnore);
176
+ if (values !== undefined) {
177
+ result = [...result, ...values];
178
+ }
179
+ }
180
+ }
181
+ else if (updatedObj && !origObject || updatedObj[key] !== origObject[key] && !Object.is(origObject[key], updatedObj[key])) {
182
+ const value = updatedObj ? UtilsService.formatIfEmpty(updatedObj[key]) : null;
183
+ result.push(`${path}${path ? '.' : ''}${key}=${value}`);
184
+ }
185
+ });
186
+ return result;
187
+ }
188
+ static formatIfEmpty(value) {
189
+ if (value) {
190
+ return value;
191
+ }
192
+ switch (typeof value) {
193
+ case 'boolean':
194
+ return value;
195
+ case 'string':
196
+ return '';
197
+ default:
198
+ return null;
199
+ }
200
+ }
201
+ static differs(obj1, obj2) {
202
+ return JSON.stringify(obj1) !== JSON.stringify(obj2);
203
+ }
204
+ }
205
+ UtilsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UtilsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
206
+ UtilsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UtilsService });
207
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UtilsService, decorators: [{
208
+ type: Injectable
209
+ }] });
210
+
211
+ const apiUrl = 'http://192.168.0.191:8080';
212
+ class APIService {
213
+ constructor(httpClient) {
214
+ this.httpClient = httpClient;
215
+ }
216
+ fetch(url, params = {}, cache) {
217
+ const headers = this.getHeaders(cache);
218
+ return this.httpClient.get(apiUrl + url, { params: this.prepareEncodedParams(params), headers });
219
+ }
220
+ post(url, body, params = {}) {
221
+ body = body || null;
222
+ const headers = this.getHeaders();
223
+ return this.httpClient.post(apiUrl + url, body, { params: this.prepareEncodedParams(params), headers });
224
+ }
225
+ // use when response extended data is necessary:
226
+ postExtended(url, body = null, params = {}, headers = {}) {
227
+ headers = headers || this.getHeaders();
228
+ return this.httpClient.post(apiUrl + url, body, {
229
+ headers,
230
+ observe: 'response',
231
+ params: this.prepareEncodedParams(params)
232
+ });
233
+ }
234
+ put(url, body = null, params = {}) {
235
+ const headers = this.getHeaders();
236
+ return this.httpClient.put(apiUrl + url, body, { headers, params: this.prepareEncodedParams(params) });
237
+ }
238
+ delete(url, params = {}) {
239
+ const headers = this.getHeaders();
240
+ return this.httpClient.delete(apiUrl + url, { headers, params: this.prepareEncodedParams(params) });
241
+ }
242
+ fetchPagination(url, pageSize, pageNumber, additionalParams = {}, cache) {
243
+ const copyAdditionalParams = JSON.parse(JSON.stringify(additionalParams));
244
+ const params = Object.assign(copyAdditionalParams, { size: pageSize.toString(), page: pageNumber.toString() });
245
+ return this.fetch(url, params, cache);
246
+ }
247
+ prepareEncodedParams(params) {
248
+ const result = {};
249
+ if (!params) {
250
+ return {};
251
+ }
252
+ for (const key of Object.keys(params)) {
253
+ if (params[key]) {
254
+ const stringParam = params[key].toString();
255
+ result[key] = stringParam.includes('+') ? encodeURIComponent(stringParam) : stringParam;
256
+ }
257
+ }
258
+ return result;
259
+ }
260
+ getHeaders(cache) {
261
+ let headers = new HttpHeaders();
262
+ if (cache) {
263
+ headers = headers.append('_Cache', 'true ');
264
+ }
265
+ const token = this.token || this.getParameterByName('token');
266
+ headers = headers.append('Authorization', 'Bearer ' + token);
267
+ return headers;
268
+ }
269
+ getParameterByName(name, url = window.location.href) {
270
+ name = name.replace(/[\[\]]/g, '\\$&');
271
+ var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'), results = regex.exec(url);
272
+ if (!results)
273
+ return null;
274
+ if (!results[2])
275
+ return '';
276
+ return decodeURIComponent(results[2].replace(/\+/g, ' '));
277
+ }
278
+ }
279
+ APIService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: APIService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
280
+ APIService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: APIService });
281
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: APIService, decorators: [{
282
+ type: Injectable
283
+ }], ctorParameters: function () { return [{ type: i1.HttpClient }]; } });
284
+
285
+ class UserService {
286
+ constructor(apiService) {
287
+ this.apiService = apiService;
288
+ this.siteId = -1;
289
+ this.userId = '';
290
+ this.userIdExistPending = false;
291
+ this.hasExistedUserId = false;
292
+ }
293
+ ngOnInit() {
294
+ console.log(this.siteId);
295
+ }
296
+ fetchUserToken(siteId, userId) {
297
+ if (this.siteId === siteId && this.userId === userId && this.user) {
298
+ return of(this.user);
299
+ }
300
+ this.siteId = siteId;
301
+ this.userId = userId;
302
+ return this.apiService.fetch(API.USER_TOKEN.replace(':siteId', String(this.siteId)).replace(':userId', encodeURIComponent(encodeURIComponent(userId))))
303
+ .pipe(map((result) => {
304
+ this.setSimplifiedUser(Object.values(result)[0]);
305
+ }));
306
+ // .pipe(this.handleError(false, true));
307
+ }
308
+ updateUserFields(body) {
309
+ if (!this.userId || !this.siteId || !this.user?.token) {
310
+ return;
311
+ }
312
+ return this.apiService.post(API.UPDATE_USER_FIELDS.replace(':siteId', String(this.siteId)).replace(':token', this.user.token), body);
313
+ // .pipe(this.handleError(false, true));
314
+ }
315
+ fetchUserById(id) {
316
+ this.userIdExistPending = true;
317
+ return this.apiService.fetch(API.USER_BY_ID.replace(':siteId', String(this.siteId)).replace(':userId', encodeURIComponent(encodeURIComponent(id))))
318
+ .pipe(map(result => {
319
+ this.userIdExistPending = false;
320
+ return result;
321
+ }));
322
+ }
323
+ persistCacheChanges() {
324
+ const params = {
325
+ excludeDeviceExtraOptions: true
326
+ };
327
+ return this.processUserChangesToCache()
328
+ .pipe(map((result) => {
329
+ return this.apiService.post(API.PERSIST_USER_CACHE.replace(':siteId', String(this.siteId)).replace(':token', this.user.token), {}, params)
330
+ .subscribe(() => {
331
+ });
332
+ // .pipe(map((user) => {
333
+ // // this.setUser(user, false, this.user.token);
334
+ // this.user.hasModifiedCache = false;
335
+ // }))
336
+ // .pipe(this.handleError(true, true));
337
+ }));
338
+ }
339
+ processUserChangesToCache() {
340
+ const calls = [];
341
+ const body = UtilsService.diff(this.originUser.getSavableData(), this.user.getSavableData(), 'user');
342
+ if (body) {
343
+ calls.push(this.updateUserFields(body));
344
+ }
345
+ if (!calls?.length) {
346
+ return of(this.user);
347
+ }
348
+ return forkJoin(calls)
349
+ .pipe(map((responses) => {
350
+ // ApiUserResponse
351
+ this.handleSaveUserResponse(responses);
352
+ }));
353
+ // .pipe(this.handleError(false, true));
354
+ }
355
+ hasUnsavedChanges() {
356
+ return !this.user.equal(this.originUser);
357
+ }
358
+ setSimplifiedUser(user) {
359
+ this.user = new SimplifiedUser(user);
360
+ const copiedUser = JSON.parse(JSON.stringify(user));
361
+ this.originUser = new SimplifiedUser(copiedUser);
362
+ }
363
+ handleSaveUserResponse(responses) {
364
+ if (!responses?.length) {
365
+ return;
366
+ }
367
+ for (let len = responses.length, i = len - 1; i >= 0; i--) {
368
+ if (responses[i] && responses[i].currentUpdatedUser) {
369
+ // this.setUser(responses[i].currentUpdatedUser, false, this.user.token);
370
+ this.user.hasModifiedCache = true;
371
+ return;
372
+ }
373
+ }
374
+ }
375
+ }
376
+ UserService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserService, deps: [{ token: APIService }], target: i0.ɵɵFactoryTarget.Injectable });
377
+ UserService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserService });
378
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserService, decorators: [{
379
+ type: Injectable
380
+ }], ctorParameters: function () { return [{ type: APIService }]; } });
381
+
382
+ const TTL_DEFAULT = 30000;
383
+ const TTL_LONG_DEFAULT = 45000;
384
+ var NotificationType;
385
+ (function (NotificationType) {
386
+ NotificationType["info"] = "info";
387
+ NotificationType["error"] = "error";
388
+ NotificationType["success"] = "success";
389
+ NotificationType["warning"] = "warning";
390
+ })(NotificationType || (NotificationType = {}));
391
+ class Notification {
392
+ constructor(data) {
393
+ this.ttl = TTL_DEFAULT;
394
+ Object.assign(this, data || {});
395
+ if (this.ttl === undefined) {
396
+ this.ttl = this.message && this.message.length && this.message.length < 80 ? TTL_DEFAULT : TTL_LONG_DEFAULT;
397
+ }
398
+ }
399
+ isInfo() {
400
+ return this.type === NotificationType.info;
401
+ }
402
+ isError() {
403
+ return this.type === NotificationType.error;
404
+ }
405
+ isSuccess() {
406
+ return this.type === NotificationType.success;
407
+ }
408
+ isWarning() {
409
+ return this.type === NotificationType.warning;
410
+ }
411
+ }
412
+
413
+ const SUCCESS_TIME = 5000;
414
+ const INACTIVE_SESSION_MESSAGE = 'Your session was lost due to inactivity. Please login again';
415
+ const INACTIVE_SESSION = 'SESSION_INACTIVE';
416
+ class NotificationService {
417
+ constructor() {
418
+ this.listChange = new Subject();
419
+ this.max = 0;
420
+ this.list = [];
421
+ }
422
+ error(message, ttl) {
423
+ this.notify('error', message, ttl);
424
+ }
425
+ success(message, ttl) {
426
+ this.notify('success', message, (!ttl) ? SUCCESS_TIME : ttl);
427
+ }
428
+ warning(message, ttl) {
429
+ this.notify('warning', message, ttl);
430
+ }
431
+ info(message, ttl) {
432
+ this.notify('info', message, ttl);
433
+ }
434
+ notify(type, message, ttl) {
435
+ const found = this.list.find((n) => n.message === message);
436
+ if (found) {
437
+ this.remove(found);
438
+ }
439
+ const notification = new Notification({
440
+ id: ++this.max,
441
+ type, message, ttl
442
+ });
443
+ if (notification.ttl > 0) {
444
+ notification.timerId = setTimeout(() => this.remove(notification, true), notification.ttl);
445
+ }
446
+ this.list.push(notification);
447
+ this.listChange.next(this.list);
448
+ }
449
+ remove(notification, auto) {
450
+ if (!auto && notification.timerId) {
451
+ // clear timeout in case of manual remove
452
+ clearInterval(notification.timerId);
453
+ }
454
+ this.list = this.list.filter(n => n.id !== notification.id);
455
+ this.listChange.next(this.list);
456
+ }
457
+ removeInactiveSessionError() {
458
+ if (!this.list || !this.list.length) {
459
+ return;
460
+ }
461
+ this.list = this.list.filter(n => n.message !== INACTIVE_SESSION_MESSAGE && n.message !== INACTIVE_SESSION);
462
+ this.listChange.next(this.list);
463
+ }
464
+ }
465
+ NotificationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: NotificationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
466
+ NotificationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: NotificationService });
467
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: NotificationService, decorators: [{
468
+ type: Injectable
469
+ }], ctorParameters: function () { return []; } });
470
+
471
+ class ListUser {
472
+ constructor(user) {
473
+ this.devices = [];
474
+ this.deviceProfiles = [];
475
+ if (user) {
476
+ Object.assign(this, user);
477
+ }
478
+ }
479
+ }
480
+
481
+ class RemoveKynFromIBMService {
482
+ constructor() {
483
+ }
484
+ removeCUCMS(date, customerId) {
485
+ if (customerId === 8) {
486
+ return date.filter((val) => !CUCMS_TO_IGNORE.includes(Math.round(val.cucmId)));
487
+ }
488
+ return date;
489
+ }
490
+ removeCUCS(date, customerId) {
491
+ if (customerId === 8) {
492
+ return date.filter((val) => !CUCS_TO_IGNORE.includes(Math.round(val.cucId)));
493
+ }
494
+ return date;
495
+ }
496
+ }
497
+ RemoveKynFromIBMService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RemoveKynFromIBMService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
498
+ RemoveKynFromIBMService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RemoveKynFromIBMService });
499
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RemoveKynFromIBMService, decorators: [{
500
+ type: Injectable
501
+ }], ctorParameters: function () { return []; } });
502
+
503
+ class UsersSearchService {
504
+ constructor(apiService, removeKynFromIBMService) {
505
+ this.apiService = apiService;
506
+ this.removeKynFromIBMService = removeKynFromIBMService;
507
+ this.siteId = -1;
508
+ this.userId = '';
509
+ this.userIdExistPending = false;
510
+ this.hasExistedUserId = false;
511
+ this.pageSize = PAGINATION_DEFAULTS.SIZE;
512
+ this.pageIndex = PAGINATION_DEFAULTS.SIZE;
513
+ this.pageSizeOptions = PAGINATION_SIZE_OPTIONS;
514
+ this.foundUsers$ = new BehaviorSubject(null);
515
+ }
516
+ getPagination() {
517
+ return {
518
+ total: this.total,
519
+ pageSizeOptions: this.pageSizeOptions,
520
+ pageSize: this.pageSize,
521
+ pageIndex: this.pageIndex
522
+ };
523
+ }
524
+ quickRegularUsersSearch() {
525
+ this.searchParams = this.searchParams || { customerid: this.customerId };
526
+ return this.apiService.fetchPagination(API.QUICK_USERS_SEARCH, this.pageSize, this.pageIndex, this.searchParams)
527
+ .pipe(map((res) => {
528
+ this.total = res.total;
529
+ // this.totals = this.totals || {};
530
+ // this.totals['users'] = res.total;
531
+ const users = res.pageData && res.pageData.length ? res.pageData.map(user => new ListUser(user)) : [];
532
+ // this.foundUsers$.next(this.removeKynFromIBMService.removeCUCMS(users, this.customerId));
533
+ this.foundUsers$.next(users);
534
+ }));
535
+ // .pipe(this.handleError(true));
536
+ }
537
+ }
538
+ UsersSearchService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UsersSearchService, deps: [{ token: APIService }, { token: RemoveKynFromIBMService }], target: i0.ɵɵFactoryTarget.Injectable });
539
+ UsersSearchService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UsersSearchService });
540
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UsersSearchService, decorators: [{
541
+ type: Injectable
542
+ }], ctorParameters: function () { return [{ type: APIService }, { type: RemoveKynFromIBMService }]; } });
543
+
544
+ class PaginationComponent {
545
+ constructor() {
546
+ this.pageEmitter = new EventEmitter();
547
+ this.pageNumberChangeEmitter = new EventEmitter();
548
+ this.pageSizeOptions = PAGINATION_SIZE_OPTIONS;
549
+ }
550
+ ngOnInit() {
551
+ }
552
+ pageEvent(event) {
553
+ this.pageEmitter.emit(event);
554
+ }
555
+ changePerPageNumber(event) {
556
+ this.pageNumberChangeEmitter.emit(event.value);
557
+ }
558
+ }
559
+ PaginationComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PaginationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
560
+ PaginationComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: PaginationComponent, selector: "app-pagination", inputs: { pagination: "pagination", showPageSizeOptions: "showPageSizeOptions", showRefreshButton: "showRefreshButton", lengthPending: "lengthPending" }, outputs: { pageEmitter: "pageEmitter", pageNumberChangeEmitter: "pageNumberChangeEmitter" }, ngImport: i0, template: "<div class=\"flex-box pagination\">\n <div class=\"page-indexes-box\">\n <mat-paginator\n [id]=\"'commonPagination'\"\n [hidePageSize]=\"true\"\n [length]=\"pagination.total\"\n [pageIndex]=\"pagination.pageIndex\"\n [pageSize]=\"pagination.pageSize\"\n [pageSizeOptions]=\"pagination.pageSizeOptions\"\n (page)=\"pageEvent($event)\">\n </mat-paginator>\n <mat-spinner class=\"length-spinner\" [diameter]=\"20\" mode=\"indeterminate\" *ngIf=\"lengthPending\">\n </mat-spinner>\n </div>\n\n <div class=\"flex-box per-page-block\" *ngIf=\"showPageSizeOptions\">\n <div class=\"item_per_page\">Items per page:</div>\n <div class=\"select-box select-page-size\">\n <mat-select [(ngModel)]=\"pagination.pageSize\" (selectionChange)=\"changePerPageNumber($event)\" #page\n [id]=\"'commonPaginationSelect'\">\n <mat-option *ngFor=\"let option of pageSizeOptions; let i = index;\" [id]=\"'paginationSelectOpt_' + i\" [value]=\"option\">{{option}}</mat-option>\n </mat-select>\n </div>\n\n </div>\n</div>\n", styles: [".search-header-refresh-icon{align-items:center;line-height:54px;margin-left:10px}button[mat-icon-button] i{font-size:18px}mat-spinner.length-spinner{position:absolute;right:120px}h3,.search-header-refresh-icon{float:left}.page-options,.mat-paginator{float:right}.per-page-block mat-form-field{width:70px!important}.per-page-block span{margin-right:20px}.pagination{display:flex;justify-content:flex-end}.select-page-size{width:60px;margin:0 0 0 15px;padding:0 10px}.item_per_page{line-height:35px}\n"], dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "diameter", "strokeWidth", "mode", "value"], exportAs: ["matProgressSpinner"] }, { kind: "component", type: i4.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "component", type: i5.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "component", type: i6.MatPaginator, selector: "mat-paginator", inputs: ["disabled"], exportAs: ["matPaginator"] }] });
561
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PaginationComponent, decorators: [{
562
+ type: Component,
563
+ args: [{ selector: 'app-pagination', template: "<div class=\"flex-box pagination\">\n <div class=\"page-indexes-box\">\n <mat-paginator\n [id]=\"'commonPagination'\"\n [hidePageSize]=\"true\"\n [length]=\"pagination.total\"\n [pageIndex]=\"pagination.pageIndex\"\n [pageSize]=\"pagination.pageSize\"\n [pageSizeOptions]=\"pagination.pageSizeOptions\"\n (page)=\"pageEvent($event)\">\n </mat-paginator>\n <mat-spinner class=\"length-spinner\" [diameter]=\"20\" mode=\"indeterminate\" *ngIf=\"lengthPending\">\n </mat-spinner>\n </div>\n\n <div class=\"flex-box per-page-block\" *ngIf=\"showPageSizeOptions\">\n <div class=\"item_per_page\">Items per page:</div>\n <div class=\"select-box select-page-size\">\n <mat-select [(ngModel)]=\"pagination.pageSize\" (selectionChange)=\"changePerPageNumber($event)\" #page\n [id]=\"'commonPaginationSelect'\">\n <mat-option *ngFor=\"let option of pageSizeOptions; let i = index;\" [id]=\"'paginationSelectOpt_' + i\" [value]=\"option\">{{option}}</mat-option>\n </mat-select>\n </div>\n\n </div>\n</div>\n", styles: [".search-header-refresh-icon{align-items:center;line-height:54px;margin-left:10px}button[mat-icon-button] i{font-size:18px}mat-spinner.length-spinner{position:absolute;right:120px}h3,.search-header-refresh-icon{float:left}.page-options,.mat-paginator{float:right}.per-page-block mat-form-field{width:70px!important}.per-page-block span{margin-right:20px}.pagination{display:flex;justify-content:flex-end}.select-page-size{width:60px;margin:0 0 0 15px;padding:0 10px}.item_per_page{line-height:35px}\n"] }]
564
+ }], ctorParameters: function () { return []; }, propDecorators: { pagination: [{
565
+ type: Input
566
+ }], showPageSizeOptions: [{
567
+ type: Input
568
+ }], showRefreshButton: [{
569
+ type: Input
570
+ }], lengthPending: [{
571
+ type: Input
572
+ }], pageEmitter: [{
573
+ type: Output
574
+ }], pageNumberChangeEmitter: [{
575
+ type: Output
576
+ }] } });
577
+
578
+ const DISPLAYED_COLS = ['user-icon', 'name', 'email', 'status', 'role'];
579
+ class UsersListComponent {
580
+ get form() {
581
+ return this.userService?.user?.form;
582
+ }
583
+ constructor(userService, apiService, notifications, usersSearchService) {
584
+ this.userService = userService;
585
+ this.apiService = apiService;
586
+ this.notifications = notifications;
587
+ this.usersSearchService = usersSearchService;
588
+ this.openUser = new EventEmitter();
589
+ this.displayedColumns = DISPLAYED_COLS;
590
+ console.log('users list 1');
591
+ }
592
+ ngOnInit() {
593
+ console.log('users list 2');
594
+ this.usersSearchService.customerId = this.customerId;
595
+ this.apiService.token = this.token;
596
+ this.runSearch();
597
+ this.searchSubscription = this.usersSearchService.foundUsers$
598
+ .subscribe((users) => {
599
+ this.initializeDataSource(users);
600
+ this.users = users;
601
+ });
602
+ }
603
+ pageNumberChangeEvent(perPageNumber) {
604
+ this.usersSearchService.pageSize = perPageNumber;
605
+ this.usersSearchService.pageIndex = 0;
606
+ this.runSearch();
607
+ }
608
+ pageEvent(event) {
609
+ this.usersSearchService.pageSize = event.pageSize;
610
+ this.usersSearchService.pageIndex = event.pageIndex;
611
+ this.runSearch();
612
+ }
613
+ onUserClick(user) {
614
+ this.openUser.emit(user);
615
+ }
616
+ initializeDataSource(users) {
617
+ this.dataSource = new MatTableDataSource(users);
618
+ }
619
+ runSearch() {
620
+ this.dataPending = true;
621
+ this.usersSearchService.quickRegularUsersSearch()
622
+ .subscribe(() => {
623
+ this.dataPending = false;
624
+ }, () => {
625
+ this.dataPending = false;
626
+ this.notifications.error('The data can not be received');
627
+ });
628
+ }
629
+ }
630
+ UsersListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UsersListComponent, deps: [{ token: UserService }, { token: APIService }, { token: NotificationService }, { token: UsersSearchService }], target: i0.ɵɵFactoryTarget.Component });
631
+ UsersListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: UsersListComponent, selector: "app-users-list", inputs: { token: "token", customerId: "customerId" }, outputs: { openUser: "openUser" }, ngImport: i0, template: "<app-pagination\n [pagination]=\"usersSearchService.getPagination()\"\n [showPageSizeOptions]=\"true\"\n (pageNumberChangeEmitter)=\"pageNumberChangeEvent($event)\"\n (pageEmitter)=\"pageEvent($event)\">\n</app-pagination>\n\n<table class=\"webex-table\" mat-table *ngIf=\"users?.length\" #table [dataSource]=\"dataSource\">\n\n <ng-container matColumnDef=\"user-icon\">\n <th mat-header-cell *matHeaderCellDef class=\"webex-table-th\"></th>\n <td class=\"user-site\" mat-cell *matCellDef=\"let user\" (click)=\"onUserClick(user)\">\n <span class=\"icon-webex-box\"><span class=\"icon-webex icon-webex-user\"></span></span>\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"name\">\n <th mat-header-cell *matHeaderCellDef class=\"webex-table-th\">First Name/Last Name</th>\n <td class=\"user-site\" mat-cell *matCellDef=\"let user\" (click)=\"onUserClick(user)\"> {{ user.firstName }} {{ user.lastName }}</td>\n </ng-container>\n\n <ng-container matColumnDef=\"email\">\n <th mat-header-cell *matHeaderCellDef class=\"webex-table-th\">Email</th>\n <td class=\"user-site\" mat-cell *matCellDef=\"let user\" (click)=\"onUserClick(user)\"> {{ user.email }}</td>\n </ng-container>\n\n <ng-container matColumnDef=\"status\">\n <th mat-header-cell *matHeaderCellDef class=\"webex-table-th\">Status</th>\n <td class=\"user-site\" mat-cell *matCellDef=\"let user\" (click)=\"onUserClick(user)\"></td>\n </ng-container>\n\n <ng-container matColumnDef=\"role\">\n <th mat-header-cell *matHeaderCellDef class=\"webex-table-th\">Administrator Role</th>\n <td class=\"user-site\" mat-cell *matCellDef=\"let user\" (click)=\"onUserClick(user)\"></td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns; sticky: true\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\"></tr>\n</table>\n", styles: ["table{border-collapse:collapse;border-spacing:0}table.mat-table{border-spacing:0;width:100%}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i6$1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i6$1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i6$1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i6$1.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { kind: "directive", type: i6$1.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i6$1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i6$1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i6$1.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i6$1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i6$1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: PaginationComponent, selector: "app-pagination", inputs: ["pagination", "showPageSizeOptions", "showRefreshButton", "lengthPending"], outputs: ["pageEmitter", "pageNumberChangeEmitter"] }] });
632
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UsersListComponent, decorators: [{
633
+ type: Component,
634
+ args: [{ selector: 'app-users-list', template: "<app-pagination\n [pagination]=\"usersSearchService.getPagination()\"\n [showPageSizeOptions]=\"true\"\n (pageNumberChangeEmitter)=\"pageNumberChangeEvent($event)\"\n (pageEmitter)=\"pageEvent($event)\">\n</app-pagination>\n\n<table class=\"webex-table\" mat-table *ngIf=\"users?.length\" #table [dataSource]=\"dataSource\">\n\n <ng-container matColumnDef=\"user-icon\">\n <th mat-header-cell *matHeaderCellDef class=\"webex-table-th\"></th>\n <td class=\"user-site\" mat-cell *matCellDef=\"let user\" (click)=\"onUserClick(user)\">\n <span class=\"icon-webex-box\"><span class=\"icon-webex icon-webex-user\"></span></span>\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"name\">\n <th mat-header-cell *matHeaderCellDef class=\"webex-table-th\">First Name/Last Name</th>\n <td class=\"user-site\" mat-cell *matCellDef=\"let user\" (click)=\"onUserClick(user)\"> {{ user.firstName }} {{ user.lastName }}</td>\n </ng-container>\n\n <ng-container matColumnDef=\"email\">\n <th mat-header-cell *matHeaderCellDef class=\"webex-table-th\">Email</th>\n <td class=\"user-site\" mat-cell *matCellDef=\"let user\" (click)=\"onUserClick(user)\"> {{ user.email }}</td>\n </ng-container>\n\n <ng-container matColumnDef=\"status\">\n <th mat-header-cell *matHeaderCellDef class=\"webex-table-th\">Status</th>\n <td class=\"user-site\" mat-cell *matCellDef=\"let user\" (click)=\"onUserClick(user)\"></td>\n </ng-container>\n\n <ng-container matColumnDef=\"role\">\n <th mat-header-cell *matHeaderCellDef class=\"webex-table-th\">Administrator Role</th>\n <td class=\"user-site\" mat-cell *matCellDef=\"let user\" (click)=\"onUserClick(user)\"></td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns; sticky: true\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\"></tr>\n</table>\n", styles: ["table{border-collapse:collapse;border-spacing:0}table.mat-table{border-spacing:0;width:100%}\n"] }]
635
+ }], ctorParameters: function () { return [{ type: UserService }, { type: APIService }, { type: NotificationService }, { type: UsersSearchService }]; }, propDecorators: { token: [{
636
+ type: Input
637
+ }], customerId: [{
638
+ type: Input
639
+ }], openUser: [{
640
+ type: Output
641
+ }] } });
642
+
643
+ class EventsCommunicationService {
644
+ constructor() {
645
+ this.onSuccessfulLoginEvent = new Subject();
646
+ }
647
+ }
648
+ EventsCommunicationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: EventsCommunicationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
649
+ EventsCommunicationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: EventsCommunicationService });
650
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: EventsCommunicationService, decorators: [{
651
+ type: Injectable
652
+ }], ctorParameters: function () { return []; } });
653
+
654
+ class MaterialModule {
655
+ }
656
+ MaterialModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MaterialModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
657
+ MaterialModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: MaterialModule, imports: [DragDropModule,
658
+ MatButtonModule,
659
+ MatListModule,
660
+ MatProgressSpinnerModule,
661
+ MatExpansionModule,
662
+ MatInputModule,
663
+ MatInputModule,
664
+ MatListModule,
665
+ MatTreeModule,
666
+ MatTreeModule,
667
+ MatNativeDateModule,
668
+ MatDatepickerModule,
669
+ MatTooltipModule,
670
+ MatAutocompleteModule,
671
+ MatChipsModule,
672
+ MatSidenavModule,
673
+ MatFormFieldModule,
674
+ MatStepperModule,
675
+ MatTabsModule,
676
+ MatCardModule,
677
+ MatSelectModule,
678
+ MatCheckboxModule,
679
+ MatSlideToggleModule,
680
+ MatTableModule,
681
+ MatPaginatorModule], exports: [DragDropModule,
682
+ MatButtonModule,
683
+ MatListModule,
684
+ MatProgressSpinnerModule,
685
+ MatExpansionModule,
686
+ MatInputModule,
687
+ MatInputModule,
688
+ MatListModule,
689
+ MatTreeModule,
690
+ MatTreeModule,
691
+ MatNativeDateModule,
692
+ MatDatepickerModule,
693
+ MatTooltipModule,
694
+ MatAutocompleteModule,
695
+ MatChipsModule,
696
+ MatSidenavModule,
697
+ MatFormFieldModule,
698
+ MatStepperModule,
699
+ MatTabsModule,
700
+ MatCardModule,
701
+ MatCheckboxModule,
702
+ MatSelectModule,
703
+ MatSlideToggleModule,
704
+ MatProgressSpinnerModule,
705
+ MatTableModule,
706
+ MatPaginatorModule] });
707
+ MaterialModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MaterialModule, imports: [DragDropModule,
708
+ MatButtonModule,
709
+ MatListModule,
710
+ MatProgressSpinnerModule,
711
+ MatExpansionModule,
712
+ MatInputModule,
713
+ MatInputModule,
714
+ MatListModule,
715
+ MatTreeModule,
716
+ MatTreeModule,
717
+ MatNativeDateModule,
718
+ MatDatepickerModule,
719
+ MatTooltipModule,
720
+ MatAutocompleteModule,
721
+ MatChipsModule,
722
+ MatSidenavModule,
723
+ MatFormFieldModule,
724
+ MatStepperModule,
725
+ MatTabsModule,
726
+ MatCardModule,
727
+ MatSelectModule,
728
+ MatCheckboxModule,
729
+ MatSlideToggleModule,
730
+ MatTableModule,
731
+ MatPaginatorModule, DragDropModule,
732
+ MatButtonModule,
733
+ MatListModule,
734
+ MatProgressSpinnerModule,
735
+ MatExpansionModule,
736
+ MatInputModule,
737
+ MatInputModule,
738
+ MatListModule,
739
+ MatTreeModule,
740
+ MatTreeModule,
741
+ MatNativeDateModule,
742
+ MatDatepickerModule,
743
+ MatTooltipModule,
744
+ MatAutocompleteModule,
745
+ MatChipsModule,
746
+ MatSidenavModule,
747
+ MatFormFieldModule,
748
+ MatStepperModule,
749
+ MatTabsModule,
750
+ MatCardModule,
751
+ MatCheckboxModule,
752
+ MatSelectModule,
753
+ MatSlideToggleModule,
754
+ MatProgressSpinnerModule,
755
+ MatTableModule,
756
+ MatPaginatorModule] });
757
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MaterialModule, decorators: [{
758
+ type: NgModule,
759
+ args: [{
760
+ imports: [
761
+ DragDropModule,
762
+ MatButtonModule,
763
+ MatListModule,
764
+ MatProgressSpinnerModule,
765
+ MatExpansionModule,
766
+ MatInputModule,
767
+ MatInputModule,
768
+ MatListModule,
769
+ MatTreeModule,
770
+ MatTreeModule,
771
+ MatNativeDateModule,
772
+ MatDatepickerModule,
773
+ MatTooltipModule,
774
+ MatAutocompleteModule,
775
+ MatChipsModule,
776
+ MatSidenavModule,
777
+ MatFormFieldModule,
778
+ MatStepperModule,
779
+ MatTabsModule,
780
+ MatCardModule,
781
+ MatSelectModule,
782
+ MatCheckboxModule,
783
+ MatSlideToggleModule,
784
+ MatTableModule,
785
+ MatPaginatorModule
786
+ ],
787
+ exports: [
788
+ DragDropModule,
789
+ MatButtonModule,
790
+ MatListModule,
791
+ MatProgressSpinnerModule,
792
+ MatExpansionModule,
793
+ MatInputModule,
794
+ MatInputModule,
795
+ MatListModule,
796
+ MatTreeModule,
797
+ MatTreeModule,
798
+ MatNativeDateModule,
799
+ MatDatepickerModule,
800
+ MatTooltipModule,
801
+ MatAutocompleteModule,
802
+ MatChipsModule,
803
+ MatSidenavModule,
804
+ MatFormFieldModule,
805
+ MatStepperModule,
806
+ MatTabsModule,
807
+ MatCardModule,
808
+ MatCheckboxModule,
809
+ MatSelectModule,
810
+ MatSlideToggleModule,
811
+ MatProgressSpinnerModule,
812
+ MatTableModule,
813
+ MatPaginatorModule
814
+ ],
815
+ }]
816
+ }] });
817
+
818
+ class UsersListModule {
819
+ }
820
+ UsersListModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UsersListModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
821
+ UsersListModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: UsersListModule, declarations: [UsersListComponent, PaginationComponent], imports: [BrowserModule,
822
+ FormsModule,
823
+ ReactiveFormsModule,
824
+ HttpClientModule,
825
+ MaterialModule], exports: [UsersListComponent] });
826
+ UsersListModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UsersListModule, providers: [
827
+ UserService,
828
+ APIService,
829
+ EventsCommunicationService,
830
+ UsersSearchService,
831
+ NotificationService,
832
+ RemoveKynFromIBMService
833
+ ], imports: [BrowserModule,
834
+ FormsModule,
835
+ ReactiveFormsModule,
836
+ HttpClientModule,
837
+ MaterialModule] });
838
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UsersListModule, decorators: [{
839
+ type: NgModule,
840
+ args: [{
841
+ declarations: [UsersListComponent, PaginationComponent],
842
+ imports: [
843
+ BrowserModule,
844
+ FormsModule,
845
+ ReactiveFormsModule,
846
+ HttpClientModule,
847
+ MaterialModule
848
+ ],
849
+ providers: [
850
+ UserService,
851
+ APIService,
852
+ EventsCommunicationService,
853
+ UsersSearchService,
854
+ NotificationService,
855
+ RemoveKynFromIBMService
856
+ ],
857
+ exports: [UsersListComponent]
858
+ }]
859
+ }] });
860
+
861
+ /**
862
+ * Generated bundle index. Do not edit.
863
+ */
864
+
865
+ export { APIService, EventsCommunicationService, NotificationService, RemoveKynFromIBMService, UserService, UsersListComponent, UsersListModule, UsersSearchService };
866
+ //# sourceMappingURL=tuki-io-tuki-widgets-users-list.mjs.map