@tuki-io/tuki-widgets 0.0.6 → 0.0.8

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 +162 -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 +78 -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 +1235 -0
  59. package/fesm2015/tuki-io-tuki-widgets-user-manage.mjs.map +1 -0
  60. package/fesm2015/tuki-io-tuki-widgets-users-list.mjs +872 -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 +1222 -0
  65. package/fesm2020/tuki-io-tuki-widgets-user-manage.mjs.map +1 -0
  66. package/fesm2020/tuki-io-tuki-widgets-users-list.mjs +869 -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 +21 -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 +32 -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 +21 -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 +35 -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,872 @@
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
+ var _a, _b;
121
+ if (this.editMode) {
122
+ (_a = this.form.get(token)) === null || _a === void 0 ? void 0 : _a.enable();
123
+ }
124
+ else {
125
+ (_b = this.form.get(token)) === null || _b === void 0 ? void 0 : _b.disable();
126
+ }
127
+ });
128
+ }
129
+ getSavableData() {
130
+ const excludedFields = ['form', 'editMode', 'viewMode', 'token', 'hasModifiedCache'];
131
+ return getSavableData(this, excludedFields);
132
+ }
133
+ equal(userToCompare) {
134
+ if (!userToCompare) {
135
+ return false;
136
+ }
137
+ return JSON.stringify(this.getSavableData()) === JSON.stringify(userToCompare.getSavableData());
138
+ }
139
+ }
140
+
141
+ class UtilsService {
142
+ static sortSortArrayByProperty(array, sortBy) {
143
+ if (!array) {
144
+ return null;
145
+ }
146
+ return array.sort((a, b) => {
147
+ if (!a[sortBy] && !b[sortBy]) {
148
+ return 0;
149
+ }
150
+ if (a[sortBy] && !b[sortBy]) {
151
+ return 1;
152
+ }
153
+ if (!a[sortBy] && b[sortBy]) {
154
+ return -1;
155
+ }
156
+ const positionA = a[sortBy];
157
+ const positionB = b[sortBy];
158
+ return (positionA < positionB) ? -1 : (positionA > positionB) ? 1 : 0;
159
+ });
160
+ }
161
+ static diff(origObject, updatedObj, path, keysToIgnore) {
162
+ let result = [];
163
+ if (Object.is(origObject, updatedObj)) {
164
+ return undefined;
165
+ }
166
+ if (!updatedObj || typeof updatedObj !== 'object') {
167
+ return updatedObj;
168
+ }
169
+ const concat = Array.from(new Set([...Object.keys(origObject || {}), ...Object.keys(updatedObj || {})]));
170
+ const filter = keysToIgnore ? concat.filter(key => !keysToIgnore.includes(key)) : concat;
171
+ filter
172
+ .forEach(key => {
173
+ if (typeof updatedObj[key] === 'object' && typeof origObject[key] === 'object') {
174
+ if (UtilsService.differs(updatedObj[key], origObject[key])) {
175
+ const newPath = `${path}${path ? '.' : ''}${key}`;
176
+ const values = UtilsService.diff(origObject[key], updatedObj[key], newPath, keysToIgnore);
177
+ if (values !== undefined) {
178
+ result = [...result, ...values];
179
+ }
180
+ }
181
+ }
182
+ else if (updatedObj && !origObject || updatedObj[key] !== origObject[key] && !Object.is(origObject[key], updatedObj[key])) {
183
+ const value = updatedObj ? UtilsService.formatIfEmpty(updatedObj[key]) : null;
184
+ result.push(`${path}${path ? '.' : ''}${key}=${value}`);
185
+ }
186
+ });
187
+ return result;
188
+ }
189
+ static formatIfEmpty(value) {
190
+ if (value) {
191
+ return value;
192
+ }
193
+ switch (typeof value) {
194
+ case 'boolean':
195
+ return value;
196
+ case 'string':
197
+ return '';
198
+ default:
199
+ return null;
200
+ }
201
+ }
202
+ static differs(obj1, obj2) {
203
+ return JSON.stringify(obj1) !== JSON.stringify(obj2);
204
+ }
205
+ }
206
+ UtilsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UtilsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
207
+ UtilsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UtilsService });
208
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UtilsService, decorators: [{
209
+ type: Injectable
210
+ }] });
211
+
212
+ class APIService {
213
+ constructor(httpClient) {
214
+ this.httpClient = httpClient;
215
+ this.apiUrl = window.location.protocol + '//' + window.location.hostname + '/dcp';
216
+ }
217
+ fetch(url, params = {}, cache) {
218
+ const headers = this.getHeaders(cache);
219
+ return this.httpClient.get(this.apiUrl + url, { params: this.prepareEncodedParams(params), headers });
220
+ }
221
+ post(url, body, params = {}) {
222
+ body = body || null;
223
+ const headers = this.getHeaders();
224
+ return this.httpClient.post(this.apiUrl + url, body, { params: this.prepareEncodedParams(params), headers });
225
+ }
226
+ // use when response extended data is necessary:
227
+ postExtended(url, body = null, params = {}, headers = {}) {
228
+ headers = headers || this.getHeaders();
229
+ return this.httpClient.post(this.apiUrl + url, body, {
230
+ headers,
231
+ observe: 'response',
232
+ params: this.prepareEncodedParams(params)
233
+ });
234
+ }
235
+ put(url, body = null, params = {}) {
236
+ const headers = this.getHeaders();
237
+ return this.httpClient.put(this.apiUrl + url, body, { headers, params: this.prepareEncodedParams(params) });
238
+ }
239
+ delete(url, params = {}) {
240
+ const headers = this.getHeaders();
241
+ return this.httpClient.delete(this.apiUrl + url, { headers, params: this.prepareEncodedParams(params) });
242
+ }
243
+ fetchPagination(url, pageSize, pageNumber, additionalParams = {}, cache) {
244
+ const copyAdditionalParams = JSON.parse(JSON.stringify(additionalParams));
245
+ const params = Object.assign(copyAdditionalParams, { size: pageSize.toString(), page: pageNumber.toString() });
246
+ return this.fetch(url, params, cache);
247
+ }
248
+ prepareEncodedParams(params) {
249
+ const result = {};
250
+ if (!params) {
251
+ return {};
252
+ }
253
+ for (const key of Object.keys(params)) {
254
+ if (params[key]) {
255
+ const stringParam = params[key].toString();
256
+ result[key] = stringParam.includes('+') ? encodeURIComponent(stringParam) : stringParam;
257
+ }
258
+ }
259
+ return result;
260
+ }
261
+ getHeaders(cache) {
262
+ let headers = new HttpHeaders();
263
+ if (cache) {
264
+ headers = headers.append('_Cache', 'true ');
265
+ }
266
+ const token = this.token || this.getParameterByName('token');
267
+ headers = headers.append('Authorization', 'Bearer ' + token);
268
+ return headers;
269
+ }
270
+ getParameterByName(name, url = window.location.href) {
271
+ name = name.replace(/[\[\]]/g, '\\$&');
272
+ var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'), results = regex.exec(url);
273
+ if (!results)
274
+ return null;
275
+ if (!results[2])
276
+ return '';
277
+ return decodeURIComponent(results[2].replace(/\+/g, ' '));
278
+ }
279
+ }
280
+ APIService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: APIService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
281
+ APIService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: APIService });
282
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: APIService, decorators: [{
283
+ type: Injectable
284
+ }], ctorParameters: function () { return [{ type: i1.HttpClient }]; } });
285
+
286
+ class UserService {
287
+ constructor(apiService) {
288
+ this.apiService = apiService;
289
+ this.siteId = -1;
290
+ this.userId = '';
291
+ this.userIdExistPending = false;
292
+ this.hasExistedUserId = false;
293
+ }
294
+ ngOnInit() {
295
+ console.log(this.siteId);
296
+ }
297
+ fetchUserToken(siteId, userId) {
298
+ if (this.siteId === siteId && this.userId === userId && this.user) {
299
+ return of(this.user);
300
+ }
301
+ this.siteId = siteId;
302
+ this.userId = userId;
303
+ return this.apiService.fetch(API.USER_TOKEN.replace(':siteId', String(this.siteId)).replace(':userId', encodeURIComponent(encodeURIComponent(userId))))
304
+ .pipe(map((result) => {
305
+ this.setSimplifiedUser(Object.values(result)[0]);
306
+ }));
307
+ // .pipe(this.handleError(false, true));
308
+ }
309
+ updateUserFields(body) {
310
+ var _a;
311
+ if (!this.userId || !this.siteId || !((_a = this.user) === null || _a === void 0 ? void 0 : _a.token)) {
312
+ return;
313
+ }
314
+ return this.apiService.post(API.UPDATE_USER_FIELDS.replace(':siteId', String(this.siteId)).replace(':token', this.user.token), body);
315
+ // .pipe(this.handleError(false, true));
316
+ }
317
+ fetchUserById(id) {
318
+ this.userIdExistPending = true;
319
+ return this.apiService.fetch(API.USER_BY_ID.replace(':siteId', String(this.siteId)).replace(':userId', encodeURIComponent(encodeURIComponent(id))))
320
+ .pipe(map(result => {
321
+ this.userIdExistPending = false;
322
+ return result;
323
+ }));
324
+ }
325
+ persistCacheChanges() {
326
+ const params = {
327
+ excludeDeviceExtraOptions: true
328
+ };
329
+ return this.processUserChangesToCache()
330
+ .pipe(map((result) => {
331
+ return this.apiService.post(API.PERSIST_USER_CACHE.replace(':siteId', String(this.siteId)).replace(':token', this.user.token), {}, params)
332
+ .subscribe(() => {
333
+ });
334
+ // .pipe(map((user) => {
335
+ // // this.setUser(user, false, this.user.token);
336
+ // this.user.hasModifiedCache = false;
337
+ // }))
338
+ // .pipe(this.handleError(true, true));
339
+ }));
340
+ }
341
+ processUserChangesToCache() {
342
+ const calls = [];
343
+ const body = UtilsService.diff(this.originUser.getSavableData(), this.user.getSavableData(), 'user');
344
+ if (body) {
345
+ calls.push(this.updateUserFields(body));
346
+ }
347
+ if (!(calls === null || calls === void 0 ? void 0 : calls.length)) {
348
+ return of(this.user);
349
+ }
350
+ return forkJoin(calls)
351
+ .pipe(map((responses) => {
352
+ // ApiUserResponse
353
+ this.handleSaveUserResponse(responses);
354
+ }));
355
+ // .pipe(this.handleError(false, true));
356
+ }
357
+ hasUnsavedChanges() {
358
+ return !this.user.equal(this.originUser);
359
+ }
360
+ setSimplifiedUser(user) {
361
+ this.user = new SimplifiedUser(user);
362
+ const copiedUser = JSON.parse(JSON.stringify(user));
363
+ this.originUser = new SimplifiedUser(copiedUser);
364
+ }
365
+ handleSaveUserResponse(responses) {
366
+ if (!(responses === null || responses === void 0 ? void 0 : responses.length)) {
367
+ return;
368
+ }
369
+ for (let len = responses.length, i = len - 1; i >= 0; i--) {
370
+ if (responses[i] && responses[i].currentUpdatedUser) {
371
+ // this.setUser(responses[i].currentUpdatedUser, false, this.user.token);
372
+ this.user.hasModifiedCache = true;
373
+ return;
374
+ }
375
+ }
376
+ }
377
+ }
378
+ UserService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserService, deps: [{ token: APIService }], target: i0.ɵɵFactoryTarget.Injectable });
379
+ UserService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserService });
380
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserService, decorators: [{
381
+ type: Injectable
382
+ }], ctorParameters: function () { return [{ type: APIService }]; } });
383
+
384
+ const TTL_DEFAULT = 30000;
385
+ const TTL_LONG_DEFAULT = 45000;
386
+ var NotificationType;
387
+ (function (NotificationType) {
388
+ NotificationType["info"] = "info";
389
+ NotificationType["error"] = "error";
390
+ NotificationType["success"] = "success";
391
+ NotificationType["warning"] = "warning";
392
+ })(NotificationType || (NotificationType = {}));
393
+ class Notification {
394
+ constructor(data) {
395
+ this.ttl = TTL_DEFAULT;
396
+ Object.assign(this, data || {});
397
+ if (this.ttl === undefined) {
398
+ this.ttl = this.message && this.message.length && this.message.length < 80 ? TTL_DEFAULT : TTL_LONG_DEFAULT;
399
+ }
400
+ }
401
+ isInfo() {
402
+ return this.type === NotificationType.info;
403
+ }
404
+ isError() {
405
+ return this.type === NotificationType.error;
406
+ }
407
+ isSuccess() {
408
+ return this.type === NotificationType.success;
409
+ }
410
+ isWarning() {
411
+ return this.type === NotificationType.warning;
412
+ }
413
+ }
414
+
415
+ const SUCCESS_TIME = 5000;
416
+ const INACTIVE_SESSION_MESSAGE = 'Your session was lost due to inactivity. Please login again';
417
+ const INACTIVE_SESSION = 'SESSION_INACTIVE';
418
+ class NotificationService {
419
+ constructor() {
420
+ this.listChange = new Subject();
421
+ this.max = 0;
422
+ this.list = [];
423
+ }
424
+ error(message, ttl) {
425
+ this.notify('error', message, ttl);
426
+ }
427
+ success(message, ttl) {
428
+ this.notify('success', message, (!ttl) ? SUCCESS_TIME : ttl);
429
+ }
430
+ warning(message, ttl) {
431
+ this.notify('warning', message, ttl);
432
+ }
433
+ info(message, ttl) {
434
+ this.notify('info', message, ttl);
435
+ }
436
+ notify(type, message, ttl) {
437
+ const found = this.list.find((n) => n.message === message);
438
+ if (found) {
439
+ this.remove(found);
440
+ }
441
+ const notification = new Notification({
442
+ id: ++this.max,
443
+ type, message, ttl
444
+ });
445
+ if (notification.ttl > 0) {
446
+ notification.timerId = setTimeout(() => this.remove(notification, true), notification.ttl);
447
+ }
448
+ this.list.push(notification);
449
+ this.listChange.next(this.list);
450
+ }
451
+ remove(notification, auto) {
452
+ if (!auto && notification.timerId) {
453
+ // clear timeout in case of manual remove
454
+ clearInterval(notification.timerId);
455
+ }
456
+ this.list = this.list.filter(n => n.id !== notification.id);
457
+ this.listChange.next(this.list);
458
+ }
459
+ removeInactiveSessionError() {
460
+ if (!this.list || !this.list.length) {
461
+ return;
462
+ }
463
+ this.list = this.list.filter(n => n.message !== INACTIVE_SESSION_MESSAGE && n.message !== INACTIVE_SESSION);
464
+ this.listChange.next(this.list);
465
+ }
466
+ }
467
+ NotificationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: NotificationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
468
+ NotificationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: NotificationService });
469
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: NotificationService, decorators: [{
470
+ type: Injectable
471
+ }], ctorParameters: function () { return []; } });
472
+
473
+ class ListUser {
474
+ constructor(user) {
475
+ this.devices = [];
476
+ this.deviceProfiles = [];
477
+ if (user) {
478
+ Object.assign(this, user);
479
+ }
480
+ }
481
+ }
482
+
483
+ class RemoveKynFromIBMService {
484
+ constructor() {
485
+ }
486
+ removeCUCMS(date, customerId) {
487
+ if (customerId === 8) {
488
+ return date.filter((val) => !CUCMS_TO_IGNORE.includes(Math.round(val.cucmId)));
489
+ }
490
+ return date;
491
+ }
492
+ removeCUCS(date, customerId) {
493
+ if (customerId === 8) {
494
+ return date.filter((val) => !CUCS_TO_IGNORE.includes(Math.round(val.cucId)));
495
+ }
496
+ return date;
497
+ }
498
+ }
499
+ RemoveKynFromIBMService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RemoveKynFromIBMService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
500
+ RemoveKynFromIBMService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RemoveKynFromIBMService });
501
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RemoveKynFromIBMService, decorators: [{
502
+ type: Injectable
503
+ }], ctorParameters: function () { return []; } });
504
+
505
+ class UsersSearchService {
506
+ constructor(apiService, removeKynFromIBMService) {
507
+ this.apiService = apiService;
508
+ this.removeKynFromIBMService = removeKynFromIBMService;
509
+ this.siteId = -1;
510
+ this.userId = '';
511
+ this.userIdExistPending = false;
512
+ this.hasExistedUserId = false;
513
+ this.pageSize = PAGINATION_DEFAULTS.SIZE;
514
+ this.pageIndex = PAGINATION_DEFAULTS.SIZE;
515
+ this.pageSizeOptions = PAGINATION_SIZE_OPTIONS;
516
+ this.foundUsers$ = new BehaviorSubject(null);
517
+ }
518
+ getPagination() {
519
+ return {
520
+ total: this.total,
521
+ pageSizeOptions: this.pageSizeOptions,
522
+ pageSize: this.pageSize,
523
+ pageIndex: this.pageIndex
524
+ };
525
+ }
526
+ quickRegularUsersSearch() {
527
+ this.searchParams = this.searchParams || { customerid: this.customerId };
528
+ return this.apiService.fetchPagination(API.QUICK_USERS_SEARCH, this.pageSize, this.pageIndex, this.searchParams)
529
+ .pipe(map((res) => {
530
+ this.total = res.total;
531
+ // this.totals = this.totals || {};
532
+ // this.totals['users'] = res.total;
533
+ const users = res.pageData && res.pageData.length ? res.pageData.map(user => new ListUser(user)) : [];
534
+ // this.foundUsers$.next(this.removeKynFromIBMService.removeCUCMS(users, this.customerId));
535
+ this.foundUsers$.next(users);
536
+ }));
537
+ // .pipe(this.handleError(true));
538
+ }
539
+ }
540
+ 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 });
541
+ UsersSearchService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UsersSearchService });
542
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UsersSearchService, decorators: [{
543
+ type: Injectable
544
+ }], ctorParameters: function () { return [{ type: APIService }, { type: RemoveKynFromIBMService }]; } });
545
+
546
+ class PaginationComponent {
547
+ constructor() {
548
+ this.pageEmitter = new EventEmitter();
549
+ this.pageNumberChangeEmitter = new EventEmitter();
550
+ this.pageSizeOptions = PAGINATION_SIZE_OPTIONS;
551
+ }
552
+ ngOnInit() {
553
+ }
554
+ pageEvent(event) {
555
+ this.pageEmitter.emit(event);
556
+ }
557
+ changePerPageNumber(event) {
558
+ this.pageNumberChangeEmitter.emit(event.value);
559
+ }
560
+ }
561
+ PaginationComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PaginationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
562
+ 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"] }] });
563
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PaginationComponent, decorators: [{
564
+ type: Component,
565
+ 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"] }]
566
+ }], ctorParameters: function () { return []; }, propDecorators: { pagination: [{
567
+ type: Input
568
+ }], showPageSizeOptions: [{
569
+ type: Input
570
+ }], showRefreshButton: [{
571
+ type: Input
572
+ }], lengthPending: [{
573
+ type: Input
574
+ }], pageEmitter: [{
575
+ type: Output
576
+ }], pageNumberChangeEmitter: [{
577
+ type: Output
578
+ }] } });
579
+
580
+ const DISPLAYED_COLS = ['user-icon', 'name', 'email', 'status', 'role'];
581
+ class UsersListComponent {
582
+ get form() {
583
+ var _a, _b;
584
+ return (_b = (_a = this.userService) === null || _a === void 0 ? void 0 : _a.user) === null || _b === void 0 ? void 0 : _b.form;
585
+ }
586
+ constructor(userService, apiService, notifications, usersSearchService) {
587
+ this.userService = userService;
588
+ this.apiService = apiService;
589
+ this.notifications = notifications;
590
+ this.usersSearchService = usersSearchService;
591
+ this.openUser = new EventEmitter();
592
+ this.displayedColumns = DISPLAYED_COLS;
593
+ console.log('users list 1');
594
+ }
595
+ ngOnInit() {
596
+ console.log('users list 2');
597
+ this.usersSearchService.customerId = this.customerId;
598
+ this.apiService.token = this.token;
599
+ this.apiService.apiUrl = this.apiUrl;
600
+ this.runSearch();
601
+ this.searchSubscription = this.usersSearchService.foundUsers$
602
+ .subscribe((users) => {
603
+ this.initializeDataSource(users);
604
+ this.users = users;
605
+ });
606
+ }
607
+ pageNumberChangeEvent(perPageNumber) {
608
+ this.usersSearchService.pageSize = perPageNumber;
609
+ this.usersSearchService.pageIndex = 0;
610
+ this.runSearch();
611
+ }
612
+ pageEvent(event) {
613
+ this.usersSearchService.pageSize = event.pageSize;
614
+ this.usersSearchService.pageIndex = event.pageIndex;
615
+ this.runSearch();
616
+ }
617
+ onUserClick(user) {
618
+ this.openUser.emit(user);
619
+ }
620
+ initializeDataSource(users) {
621
+ this.dataSource = new MatTableDataSource(users);
622
+ }
623
+ runSearch() {
624
+ this.dataPending = true;
625
+ this.usersSearchService.quickRegularUsersSearch()
626
+ .subscribe(() => {
627
+ this.dataPending = false;
628
+ }, () => {
629
+ this.dataPending = false;
630
+ this.notifications.error('The data can not be received');
631
+ });
632
+ }
633
+ }
634
+ 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 });
635
+ UsersListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: UsersListComponent, selector: "app-users-list", inputs: { token: "token", customerId: "customerId", apiUrl: "apiUrl" }, 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"] }] });
636
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UsersListComponent, decorators: [{
637
+ type: Component,
638
+ 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"] }]
639
+ }], ctorParameters: function () { return [{ type: UserService }, { type: APIService }, { type: NotificationService }, { type: UsersSearchService }]; }, propDecorators: { token: [{
640
+ type: Input
641
+ }], customerId: [{
642
+ type: Input
643
+ }], openUser: [{
644
+ type: Output
645
+ }], apiUrl: [{
646
+ type: Input
647
+ }] } });
648
+
649
+ class EventsCommunicationService {
650
+ constructor() {
651
+ this.onSuccessfulLoginEvent = new Subject();
652
+ }
653
+ }
654
+ EventsCommunicationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: EventsCommunicationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
655
+ EventsCommunicationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: EventsCommunicationService });
656
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: EventsCommunicationService, decorators: [{
657
+ type: Injectable
658
+ }], ctorParameters: function () { return []; } });
659
+
660
+ class MaterialModule {
661
+ }
662
+ MaterialModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MaterialModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
663
+ MaterialModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: MaterialModule, imports: [DragDropModule,
664
+ MatButtonModule,
665
+ MatListModule,
666
+ MatProgressSpinnerModule,
667
+ MatExpansionModule,
668
+ MatInputModule,
669
+ MatInputModule,
670
+ MatListModule,
671
+ MatTreeModule,
672
+ MatTreeModule,
673
+ MatNativeDateModule,
674
+ MatDatepickerModule,
675
+ MatTooltipModule,
676
+ MatAutocompleteModule,
677
+ MatChipsModule,
678
+ MatSidenavModule,
679
+ MatFormFieldModule,
680
+ MatStepperModule,
681
+ MatTabsModule,
682
+ MatCardModule,
683
+ MatSelectModule,
684
+ MatCheckboxModule,
685
+ MatSlideToggleModule,
686
+ MatTableModule,
687
+ MatPaginatorModule], exports: [DragDropModule,
688
+ MatButtonModule,
689
+ MatListModule,
690
+ MatProgressSpinnerModule,
691
+ MatExpansionModule,
692
+ MatInputModule,
693
+ MatInputModule,
694
+ MatListModule,
695
+ MatTreeModule,
696
+ MatTreeModule,
697
+ MatNativeDateModule,
698
+ MatDatepickerModule,
699
+ MatTooltipModule,
700
+ MatAutocompleteModule,
701
+ MatChipsModule,
702
+ MatSidenavModule,
703
+ MatFormFieldModule,
704
+ MatStepperModule,
705
+ MatTabsModule,
706
+ MatCardModule,
707
+ MatCheckboxModule,
708
+ MatSelectModule,
709
+ MatSlideToggleModule,
710
+ MatProgressSpinnerModule,
711
+ MatTableModule,
712
+ MatPaginatorModule] });
713
+ MaterialModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MaterialModule, imports: [DragDropModule,
714
+ MatButtonModule,
715
+ MatListModule,
716
+ MatProgressSpinnerModule,
717
+ MatExpansionModule,
718
+ MatInputModule,
719
+ MatInputModule,
720
+ MatListModule,
721
+ MatTreeModule,
722
+ MatTreeModule,
723
+ MatNativeDateModule,
724
+ MatDatepickerModule,
725
+ MatTooltipModule,
726
+ MatAutocompleteModule,
727
+ MatChipsModule,
728
+ MatSidenavModule,
729
+ MatFormFieldModule,
730
+ MatStepperModule,
731
+ MatTabsModule,
732
+ MatCardModule,
733
+ MatSelectModule,
734
+ MatCheckboxModule,
735
+ MatSlideToggleModule,
736
+ MatTableModule,
737
+ MatPaginatorModule, DragDropModule,
738
+ MatButtonModule,
739
+ MatListModule,
740
+ MatProgressSpinnerModule,
741
+ MatExpansionModule,
742
+ MatInputModule,
743
+ MatInputModule,
744
+ MatListModule,
745
+ MatTreeModule,
746
+ MatTreeModule,
747
+ MatNativeDateModule,
748
+ MatDatepickerModule,
749
+ MatTooltipModule,
750
+ MatAutocompleteModule,
751
+ MatChipsModule,
752
+ MatSidenavModule,
753
+ MatFormFieldModule,
754
+ MatStepperModule,
755
+ MatTabsModule,
756
+ MatCardModule,
757
+ MatCheckboxModule,
758
+ MatSelectModule,
759
+ MatSlideToggleModule,
760
+ MatProgressSpinnerModule,
761
+ MatTableModule,
762
+ MatPaginatorModule] });
763
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MaterialModule, decorators: [{
764
+ type: NgModule,
765
+ args: [{
766
+ imports: [
767
+ DragDropModule,
768
+ MatButtonModule,
769
+ MatListModule,
770
+ MatProgressSpinnerModule,
771
+ MatExpansionModule,
772
+ MatInputModule,
773
+ MatInputModule,
774
+ MatListModule,
775
+ MatTreeModule,
776
+ MatTreeModule,
777
+ MatNativeDateModule,
778
+ MatDatepickerModule,
779
+ MatTooltipModule,
780
+ MatAutocompleteModule,
781
+ MatChipsModule,
782
+ MatSidenavModule,
783
+ MatFormFieldModule,
784
+ MatStepperModule,
785
+ MatTabsModule,
786
+ MatCardModule,
787
+ MatSelectModule,
788
+ MatCheckboxModule,
789
+ MatSlideToggleModule,
790
+ MatTableModule,
791
+ MatPaginatorModule
792
+ ],
793
+ exports: [
794
+ DragDropModule,
795
+ MatButtonModule,
796
+ MatListModule,
797
+ MatProgressSpinnerModule,
798
+ MatExpansionModule,
799
+ MatInputModule,
800
+ MatInputModule,
801
+ MatListModule,
802
+ MatTreeModule,
803
+ MatTreeModule,
804
+ MatNativeDateModule,
805
+ MatDatepickerModule,
806
+ MatTooltipModule,
807
+ MatAutocompleteModule,
808
+ MatChipsModule,
809
+ MatSidenavModule,
810
+ MatFormFieldModule,
811
+ MatStepperModule,
812
+ MatTabsModule,
813
+ MatCardModule,
814
+ MatCheckboxModule,
815
+ MatSelectModule,
816
+ MatSlideToggleModule,
817
+ MatProgressSpinnerModule,
818
+ MatTableModule,
819
+ MatPaginatorModule
820
+ ],
821
+ }]
822
+ }] });
823
+
824
+ class UsersListModule {
825
+ }
826
+ UsersListModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UsersListModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
827
+ UsersListModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: UsersListModule, declarations: [UsersListComponent, PaginationComponent], imports: [BrowserModule,
828
+ FormsModule,
829
+ ReactiveFormsModule,
830
+ HttpClientModule,
831
+ MaterialModule], exports: [UsersListComponent] });
832
+ UsersListModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UsersListModule, providers: [
833
+ UserService,
834
+ APIService,
835
+ EventsCommunicationService,
836
+ UsersSearchService,
837
+ NotificationService,
838
+ RemoveKynFromIBMService
839
+ ], imports: [BrowserModule,
840
+ FormsModule,
841
+ ReactiveFormsModule,
842
+ HttpClientModule,
843
+ MaterialModule] });
844
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UsersListModule, decorators: [{
845
+ type: NgModule,
846
+ args: [{
847
+ declarations: [UsersListComponent, PaginationComponent],
848
+ imports: [
849
+ BrowserModule,
850
+ FormsModule,
851
+ ReactiveFormsModule,
852
+ HttpClientModule,
853
+ MaterialModule
854
+ ],
855
+ providers: [
856
+ UserService,
857
+ APIService,
858
+ EventsCommunicationService,
859
+ UsersSearchService,
860
+ NotificationService,
861
+ RemoveKynFromIBMService
862
+ ],
863
+ exports: [UsersListComponent]
864
+ }]
865
+ }] });
866
+
867
+ /**
868
+ * Generated bundle index. Do not edit.
869
+ */
870
+
871
+ export { APIService, EventsCommunicationService, NotificationService, RemoveKynFromIBMService, UserService, UsersListComponent, UsersListModule, UsersSearchService };
872
+ //# sourceMappingURL=tuki-io-tuki-widgets-users-list.mjs.map