tin-spa 2.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (241) hide show
  1. package/README.md +2 -2
  2. package/{esm2015/lib/classes/Classes.js → esm2020/lib/classes/Classes.mjs} +15 -55
  3. package/esm2020/lib/classes/TinCore.mjs +148 -0
  4. package/esm2020/lib/components/activity/activity.component.mjs +24 -0
  5. package/esm2020/lib/components/attach/attach.component.mjs +105 -0
  6. package/esm2020/lib/components/change-password/change-password.component.mjs +92 -0
  7. package/esm2020/lib/components/check/check.component.mjs +56 -0
  8. package/esm2020/lib/components/chips/chips.component.mjs +58 -0
  9. package/esm2020/lib/components/create-account/create-account.component.mjs +72 -0
  10. package/esm2020/lib/components/date/date.component.mjs +64 -0
  11. package/esm2020/lib/components/datetime/datetime.component.mjs +39 -0
  12. package/esm2020/lib/components/filter/filter.component.mjs +46 -0
  13. package/esm2020/lib/components/form/form.component.mjs +63 -0
  14. package/esm2020/lib/components/label/label.component.mjs +25 -0
  15. package/esm2020/lib/components/loader/loader.component.mjs +24 -0
  16. package/esm2020/lib/components/login/login.component.mjs +113 -0
  17. package/esm2020/lib/components/logs/logs.component.mjs +37 -0
  18. package/esm2020/lib/components/message/messageDialog.component.mjs +32 -0
  19. package/esm2020/lib/components/money/currency-input-mask.directive.mjs +185 -0
  20. package/esm2020/lib/components/money/currency-input-mask.module.mjs +28 -0
  21. package/esm2020/lib/components/money/money.component.mjs +64 -0
  22. package/esm2020/lib/components/nav-menu/nav-menu.component.mjs +49 -0
  23. package/esm2020/lib/components/number/number.component.mjs +86 -0
  24. package/esm2020/lib/components/option/option.component.mjs +59 -0
  25. package/esm2020/lib/components/profile/profile.component.mjs +93 -0
  26. package/esm2020/lib/components/recover-account/recover-account.component.mjs +46 -0
  27. package/esm2020/lib/components/roles/addRoleDialog.component.mjs +61 -0
  28. package/esm2020/lib/components/roles/roles.component.mjs +91 -0
  29. package/esm2020/lib/components/select/select.component.mjs +71 -0
  30. package/esm2020/lib/components/settings/settings.component.mjs +63 -0
  31. package/esm2020/lib/components/signup/signup.component.mjs +50 -0
  32. package/esm2020/lib/components/steps/steps.component.mjs +90 -0
  33. package/esm2020/lib/components/table/detailsDialog.component.mjs +149 -0
  34. package/esm2020/lib/components/table/table.component.mjs +341 -0
  35. package/esm2020/lib/components/text/text.component.mjs +166 -0
  36. package/esm2020/lib/components/tiles/tiles.component.mjs +41 -0
  37. package/esm2020/lib/components/tin-spa.component.mjs +19 -0
  38. package/esm2020/lib/components/users/users.component.mjs +119 -0
  39. package/esm2020/lib/modules/admin/admin-routing.module.mjs +29 -0
  40. package/esm2020/lib/modules/admin/admin.module.mjs +26 -0
  41. package/esm2020/lib/modules/index/index-routing.module.mjs +27 -0
  42. package/esm2020/lib/modules/index/index.module.mjs +26 -0
  43. package/esm2020/lib/modules/spa-admin.module.mjs +73 -0
  44. package/esm2020/lib/modules/spa-index.module.mjs +52 -0
  45. package/esm2020/lib/modules/spa-mat.module.mjs +67 -0
  46. package/esm2020/lib/modules/spa-user.module.mjs +49 -0
  47. package/esm2020/lib/modules/user/user-routing.module.mjs +23 -0
  48. package/esm2020/lib/modules/user/user.module.mjs +26 -0
  49. package/esm2020/lib/pipes/camelToWords.pipe.mjs +23 -0
  50. package/esm2020/lib/services/auth.service.mjs +142 -0
  51. package/esm2020/lib/services/data.service.mjs +125 -0
  52. package/esm2020/lib/services/export.service.mjs +16 -0
  53. package/esm2020/lib/services/http.service.mjs +79 -0
  54. package/esm2020/lib/services/loader-interceptor.service.mjs +77 -0
  55. package/esm2020/lib/services/loader.service.mjs +17 -0
  56. package/esm2020/lib/services/log.service.mjs +77 -0
  57. package/esm2020/lib/services/message.service.mjs +52 -0
  58. package/esm2020/lib/services/storage.service.mjs +34 -0
  59. package/esm2020/lib/services/tin-spa.service.mjs +14 -0
  60. package/esm2020/lib/tin-spa.module.mjs +114 -0
  61. package/esm2020/public-api.mjs +62 -0
  62. package/esm2020/tin-spa.mjs +5 -0
  63. package/fesm2015/tin-spa.mjs +3846 -0
  64. package/fesm2015/tin-spa.mjs.map +1 -0
  65. package/fesm2020/tin-spa.mjs +3829 -0
  66. package/fesm2020/tin-spa.mjs.map +1 -0
  67. package/index.d.ts +5 -0
  68. package/lib/classes/Classes.d.ts +58 -63
  69. package/lib/classes/TinCore.d.ts +1 -0
  70. package/lib/components/activity/activity.component.d.ts +3 -0
  71. package/lib/components/attach/attach.component.d.ts +4 -1
  72. package/lib/components/change-password/change-password.component.d.ts +3 -0
  73. package/lib/components/check/check.component.d.ts +3 -0
  74. package/lib/components/chips/chips.component.d.ts +3 -0
  75. package/lib/components/create-account/create-account.component.d.ts +3 -0
  76. package/lib/components/date/date.component.d.ts +14 -6
  77. package/lib/components/datetime/datetime.component.d.ts +3 -0
  78. package/lib/components/filter/filter.component.d.ts +4 -0
  79. package/lib/components/form/form.component.d.ts +16 -0
  80. package/lib/components/label/label.component.d.ts +3 -0
  81. package/lib/components/loader/loader.component.d.ts +3 -0
  82. package/lib/components/login/login.component.d.ts +6 -0
  83. package/lib/components/logs/logs.component.d.ts +3 -0
  84. package/lib/components/message/messageDialog.component.d.ts +3 -0
  85. package/lib/components/money/currency-input-mask.directive.d.ts +41 -0
  86. package/lib/components/money/currency-input-mask.module.d.ts +9 -0
  87. package/lib/components/money/money.component.d.ts +9 -1
  88. package/lib/components/nav-menu/nav-menu.component.d.ts +3 -0
  89. package/lib/components/number/number.component.d.ts +29 -0
  90. package/lib/components/option/option.component.d.ts +3 -0
  91. package/lib/components/profile/profile.component.d.ts +6 -2
  92. package/lib/components/recover-account/recover-account.component.d.ts +3 -0
  93. package/lib/components/roles/addRoleDialog.component.d.ts +3 -0
  94. package/lib/components/roles/roles.component.d.ts +3 -0
  95. package/lib/components/select/select.component.d.ts +5 -1
  96. package/lib/components/settings/settings.component.d.ts +3 -0
  97. package/lib/components/signup/signup.component.d.ts +3 -0
  98. package/lib/components/steps/steps.component.d.ts +3 -0
  99. package/lib/components/table/detailsDialog.component.d.ts +28 -0
  100. package/lib/components/table/table.component.d.ts +57 -17
  101. package/lib/components/text/text.component.d.ts +13 -9
  102. package/lib/components/tiles/tiles.component.d.ts +3 -0
  103. package/lib/components/tin-spa.component.d.ts +4 -4
  104. package/lib/components/users/users.component.d.ts +4 -0
  105. package/lib/modules/admin/admin-routing.module.d.ts +7 -0
  106. package/lib/modules/admin/admin.module.d.ts +9 -0
  107. package/lib/modules/index/index-routing.module.d.ts +7 -0
  108. package/lib/modules/index/index.module.d.ts +9 -0
  109. package/lib/modules/spa-admin.module.d.ts +13 -0
  110. package/lib/modules/spa-index.module.d.ts +10 -0
  111. package/lib/modules/spa-mat.module.d.ts +31 -0
  112. package/lib/modules/spa-user.module.d.ts +9 -0
  113. package/lib/modules/user/user-routing.module.d.ts +7 -0
  114. package/lib/modules/user/user.module.d.ts +9 -0
  115. package/lib/pipes/camelToWords.pipe.d.ts +7 -0
  116. package/lib/services/auth.service.d.ts +3 -0
  117. package/lib/services/data.service.d.ts +5 -1
  118. package/lib/services/export.service.d.ts +3 -4
  119. package/lib/services/http.service.d.ts +3 -0
  120. package/lib/services/loader-interceptor.service.d.ts +3 -0
  121. package/lib/services/loader.service.d.ts +3 -0
  122. package/lib/services/log.service.d.ts +3 -0
  123. package/lib/services/message.service.d.ts +3 -0
  124. package/lib/services/storage.service.d.ts +3 -0
  125. package/lib/services/tin-spa.service.d.ts +3 -0
  126. package/lib/tin-spa.module.d.ts +30 -0
  127. package/package.json +24 -23
  128. package/public-api.d.ts +7 -2
  129. package/bundles/tin-spa.umd.js +0 -3672
  130. package/bundles/tin-spa.umd.js.map +0 -1
  131. package/bundles/tin-spa.umd.min.js +0 -16
  132. package/bundles/tin-spa.umd.min.js.map +0 -1
  133. package/esm2015/lib/classes/TinCore.js +0 -139
  134. package/esm2015/lib/components/activity/activity.component.js +0 -26
  135. package/esm2015/lib/components/attach/attach.component.js +0 -107
  136. package/esm2015/lib/components/change-password/change-password.component.js +0 -102
  137. package/esm2015/lib/components/check/check.component.js +0 -63
  138. package/esm2015/lib/components/chips/chips.component.js +0 -66
  139. package/esm2015/lib/components/create-account/create-account.component.js +0 -78
  140. package/esm2015/lib/components/date/date.component.js +0 -45
  141. package/esm2015/lib/components/datetime/datetime.component.js +0 -44
  142. package/esm2015/lib/components/filter/filter.component.js +0 -40
  143. package/esm2015/lib/components/label/label.component.js +0 -29
  144. package/esm2015/lib/components/loader/loader.component.js +0 -29
  145. package/esm2015/lib/components/login/login.component.js +0 -114
  146. package/esm2015/lib/components/logs/logs.component.js +0 -39
  147. package/esm2015/lib/components/message/messageDialog.component.js +0 -31
  148. package/esm2015/lib/components/money/money.component.js +0 -52
  149. package/esm2015/lib/components/nav-menu/nav-menu.component.js +0 -51
  150. package/esm2015/lib/components/option/option.component.js +0 -63
  151. package/esm2015/lib/components/profile/profile.component.js +0 -98
  152. package/esm2015/lib/components/recover-account/recover-account.component.js +0 -53
  153. package/esm2015/lib/components/roles/addRoleDialog.component.js +0 -61
  154. package/esm2015/lib/components/roles/roles.component.js +0 -94
  155. package/esm2015/lib/components/select/select.component.js +0 -77
  156. package/esm2015/lib/components/settings/settings.component.js +0 -63
  157. package/esm2015/lib/components/signup/signup.component.js +0 -57
  158. package/esm2015/lib/components/steps/steps.component.js +0 -93
  159. package/esm2015/lib/components/table/table.component.js +0 -107
  160. package/esm2015/lib/components/text/text.component.js +0 -165
  161. package/esm2015/lib/components/tiles/tiles.component.js +0 -41
  162. package/esm2015/lib/components/timeout/timeout.component.js +0 -90
  163. package/esm2015/lib/components/tin-spa.component.js +0 -19
  164. package/esm2015/lib/components/users/users.component.js +0 -120
  165. package/esm2015/lib/dnd.directive.js +0 -51
  166. package/esm2015/lib/modules/spa-admin.module.js +0 -50
  167. package/esm2015/lib/modules/spa-index.module.js +0 -35
  168. package/esm2015/lib/modules/spa-mat.module.js +0 -53
  169. package/esm2015/lib/modules/spa-user.module.js +0 -33
  170. package/esm2015/lib/services/auth.service.js +0 -155
  171. package/esm2015/lib/services/data.service.js +0 -115
  172. package/esm2015/lib/services/export.service.js +0 -29
  173. package/esm2015/lib/services/http.service.js +0 -84
  174. package/esm2015/lib/services/loader-interceptor.service.js +0 -83
  175. package/esm2015/lib/services/loader.service.js +0 -17
  176. package/esm2015/lib/services/log.service.js +0 -76
  177. package/esm2015/lib/services/message.service.js +0 -58
  178. package/esm2015/lib/services/storage.service.js +0 -42
  179. package/esm2015/lib/services/tin-spa.service.js +0 -14
  180. package/esm2015/lib/tin-spa.module.js +0 -91
  181. package/esm2015/public-api.js +0 -56
  182. package/esm2015/tin-spa.js +0 -8
  183. package/esm5/lib/classes/Classes.js +0 -313
  184. package/esm5/lib/classes/TinCore.js +0 -166
  185. package/esm5/lib/components/activity/activity.component.js +0 -27
  186. package/esm5/lib/components/attach/attach.component.js +0 -119
  187. package/esm5/lib/components/change-password/change-password.component.js +0 -104
  188. package/esm5/lib/components/check/check.component.js +0 -64
  189. package/esm5/lib/components/chips/chips.component.js +0 -68
  190. package/esm5/lib/components/create-account/create-account.component.js +0 -80
  191. package/esm5/lib/components/date/date.component.js +0 -46
  192. package/esm5/lib/components/datetime/datetime.component.js +0 -45
  193. package/esm5/lib/components/filter/filter.component.js +0 -41
  194. package/esm5/lib/components/label/label.component.js +0 -30
  195. package/esm5/lib/components/loader/loader.component.js +0 -31
  196. package/esm5/lib/components/login/login.component.js +0 -117
  197. package/esm5/lib/components/logs/logs.component.js +0 -41
  198. package/esm5/lib/components/message/messageDialog.component.js +0 -32
  199. package/esm5/lib/components/money/money.component.js +0 -53
  200. package/esm5/lib/components/nav-menu/nav-menu.component.js +0 -53
  201. package/esm5/lib/components/option/option.component.js +0 -64
  202. package/esm5/lib/components/profile/profile.component.js +0 -102
  203. package/esm5/lib/components/recover-account/recover-account.component.js +0 -55
  204. package/esm5/lib/components/roles/addRoleDialog.component.js +0 -63
  205. package/esm5/lib/components/roles/roles.component.js +0 -100
  206. package/esm5/lib/components/select/select.component.js +0 -79
  207. package/esm5/lib/components/settings/settings.component.js +0 -66
  208. package/esm5/lib/components/signup/signup.component.js +0 -59
  209. package/esm5/lib/components/steps/steps.component.js +0 -105
  210. package/esm5/lib/components/table/table.component.js +0 -109
  211. package/esm5/lib/components/text/text.component.js +0 -168
  212. package/esm5/lib/components/tiles/tiles.component.js +0 -42
  213. package/esm5/lib/components/timeout/timeout.component.js +0 -92
  214. package/esm5/lib/components/tin-spa.component.js +0 -17
  215. package/esm5/lib/components/users/users.component.js +0 -126
  216. package/esm5/lib/dnd.directive.js +0 -52
  217. package/esm5/lib/modules/spa-admin.module.js +0 -53
  218. package/esm5/lib/modules/spa-index.module.js +0 -38
  219. package/esm5/lib/modules/spa-mat.module.js +0 -56
  220. package/esm5/lib/modules/spa-user.module.js +0 -36
  221. package/esm5/lib/services/auth.service.js +0 -157
  222. package/esm5/lib/services/data.service.js +0 -116
  223. package/esm5/lib/services/export.service.js +0 -30
  224. package/esm5/lib/services/http.service.js +0 -85
  225. package/esm5/lib/services/loader-interceptor.service.js +0 -85
  226. package/esm5/lib/services/loader.service.js +0 -18
  227. package/esm5/lib/services/log.service.js +0 -112
  228. package/esm5/lib/services/message.service.js +0 -59
  229. package/esm5/lib/services/storage.service.js +0 -74
  230. package/esm5/lib/services/tin-spa.service.js +0 -16
  231. package/esm5/lib/tin-spa.module.js +0 -94
  232. package/esm5/public-api.js +0 -56
  233. package/esm5/tin-spa.js +0 -8
  234. package/fesm2015/tin-spa.js +0 -3184
  235. package/fesm2015/tin-spa.js.map +0 -1
  236. package/fesm5/tin-spa.js +0 -3422
  237. package/fesm5/tin-spa.js.map +0 -1
  238. package/lib/components/timeout/timeout.component.d.ts +0 -21
  239. package/lib/dnd.directive.d.ts +0 -8
  240. package/tin-spa.d.ts +0 -7
  241. package/tin-spa.metadata.json +0 -1
@@ -0,0 +1,3846 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, Component, Inject, NgModule, EventEmitter, Input, Output, forwardRef, Directive, HostListener, ViewChild, Pipe } from '@angular/core';
3
+ import { __awaiter } from 'tslib';
4
+ import * as i4 from '@angular/material/dialog';
5
+ import { MAT_DIALOG_DATA, MatDialogModule, MAT_DIALOG_DEFAULT_OPTIONS } from '@angular/material/dialog';
6
+ import * as i1 from '@angular/common';
7
+ import { CommonModule, DecimalPipe, LocationStrategy, HashLocationStrategy, CurrencyPipe, DatePipe } from '@angular/common';
8
+ import * as i5 from '@angular/material/button';
9
+ import { MatButtonModule } from '@angular/material/button';
10
+ import * as i3 from '@angular/material/form-field';
11
+ import { MatFormFieldModule, MAT_FORM_FIELD_DEFAULT_OPTIONS } from '@angular/material/form-field';
12
+ import { of, BehaviorSubject, Observable } from 'rxjs';
13
+ import { mergeMap, startWith, map } from 'rxjs/operators';
14
+ import * as i1$1 from '@angular/material/snack-bar';
15
+ import { MatSnackBarModule } from '@angular/material/snack-bar';
16
+ import * as i1$3 from '@angular/router';
17
+ import { RouterModule } from '@angular/router';
18
+ import * as i1$2 from '@angular/common/http';
19
+ import { HttpHeaders, HttpResponse, HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
20
+ import * as i8 from '@angular/material/autocomplete';
21
+ import { MatAutocompleteModule } from '@angular/material/autocomplete';
22
+ import { MatBadgeModule } from '@angular/material/badge';
23
+ import * as i14 from '@angular/material/card';
24
+ import { MatCardModule } from '@angular/material/card';
25
+ import * as i2$1 from '@angular/material/checkbox';
26
+ import { MatCheckboxModule } from '@angular/material/checkbox';
27
+ import * as i4$2 from '@angular/material/chips';
28
+ import { MatChipsModule } from '@angular/material/chips';
29
+ import * as i7 from '@angular/material/core';
30
+ import { MatNativeDateModule, MAT_DATE_LOCALE } from '@angular/material/core';
31
+ import * as i5$1 from '@angular/material/datepicker';
32
+ import { MatDatepickerModule } from '@angular/material/datepicker';
33
+ import * as i3$1 from '@angular/material/icon';
34
+ import { MatIconModule } from '@angular/material/icon';
35
+ import * as i4$1 from '@angular/material/input';
36
+ import { MatInputModule } from '@angular/material/input';
37
+ import { MatListModule } from '@angular/material/list';
38
+ import * as i4$3 from '@angular/material/menu';
39
+ import { MatMenuModule } from '@angular/material/menu';
40
+ import * as i7$1 from '@angular/material/paginator';
41
+ import { MatPaginatorModule } from '@angular/material/paginator';
42
+ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
43
+ import { MatRadioModule } from '@angular/material/radio';
44
+ import * as i3$2 from '@angular/material/select';
45
+ import { MatSelectModule } from '@angular/material/select';
46
+ import { MatSliderModule } from '@angular/material/slider';
47
+ import { MatSortModule } from '@angular/material/sort';
48
+ import * as i2$2 from '@angular/material/stepper';
49
+ import { MatStepperModule } from '@angular/material/stepper';
50
+ import * as i6$1 from '@angular/material/table';
51
+ import { MatTableModule, MatTableDataSource } from '@angular/material/table';
52
+ import { MatTabsModule } from '@angular/material/tabs';
53
+ import * as i6 from '@angular/material/tooltip';
54
+ import { MatTooltipModule } from '@angular/material/tooltip';
55
+ import * as i2 from '@angular/forms';
56
+ import { FormsModule, ReactiveFormsModule, FormControl, Validators, NG_VALUE_ACCESSOR } from '@angular/forms';
57
+ import { STEPPER_GLOBAL_OPTIONS } from '@angular/cdk/stepper';
58
+ import * as i3$3 from '@angular/cdk/layout';
59
+
60
+ class TinSpaService {
61
+ constructor() { }
62
+ }
63
+ TinSpaService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TinSpaService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
64
+ TinSpaService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TinSpaService, providedIn: 'root' });
65
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TinSpaService, decorators: [{
66
+ type: Injectable,
67
+ args: [{
68
+ providedIn: 'root'
69
+ }]
70
+ }], ctorParameters: function () { return []; } });
71
+
72
+ class StorageService {
73
+ constructor() { }
74
+ // Store the value
75
+ store(storageKey, value) {
76
+ return __awaiter(this, void 0, void 0, function* () {
77
+ const encryptedValue = btoa(escape(JSON.stringify(value)));
78
+ // const encryptedValue = JSON.stringify(value);
79
+ yield localStorage.setItem(storageKey, encryptedValue);
80
+ });
81
+ }
82
+ // Get the value
83
+ get(storageKey) {
84
+ return __awaiter(this, void 0, void 0, function* () {
85
+ const ret = yield localStorage.getItem(storageKey);
86
+ return JSON.parse(unescape(atob(ret)));
87
+ // return JSON.parse(ret);
88
+ });
89
+ }
90
+ // Remove
91
+ removeStorageItem(storageKey) {
92
+ return __awaiter(this, void 0, void 0, function* () {
93
+ yield localStorage.removeItem(storageKey);
94
+ });
95
+ }
96
+ // Clear storage
97
+ clear() {
98
+ return __awaiter(this, void 0, void 0, function* () {
99
+ yield localStorage.clear();
100
+ });
101
+ }
102
+ }
103
+ StorageService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: StorageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
104
+ StorageService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: StorageService, providedIn: 'root' });
105
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: StorageService, decorators: [{
106
+ type: Injectable,
107
+ args: [{
108
+ providedIn: 'root'
109
+ }]
110
+ }], ctorParameters: function () { return []; } });
111
+
112
+ class messageDialog {
113
+ constructor(dialogRef, data) {
114
+ this.dialogRef = dialogRef;
115
+ this.data = data;
116
+ }
117
+ ngOnInit() {
118
+ this.messageType = this.data.type;
119
+ this._messageSubject = this.data.subject;
120
+ this._messageDetails = this.data.details;
121
+ }
122
+ response(resp) {
123
+ this.dialogRef.close(resp);
124
+ }
125
+ }
126
+ messageDialog.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: messageDialog, deps: [{ token: i4.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
127
+ messageDialog.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: messageDialog, selector: "lib-app-message", ngImport: i0, template: "\r\n <h2 mat-dialog-title>\r\n\r\n <mat-label *ngIf=\"messageType=='confirm'\">Confirm</mat-label>\r\n <mat-label *ngIf=\"messageType=='info'\">Information</mat-label>\r\n <mat-label *ngIf=\"messageType=='error'\">Error</mat-label>\r\n\r\n </h2>\r\n\r\n <mat-dialog-content class=\"mat-typography\">\r\n\r\n\r\n <!-- Confirm -->\r\n <p *ngIf=\"messageType=='confirm'\">{{_messageDetails}}</p>\r\n\r\n\r\n <!-- Information -->\r\n <div *ngIf=\"messageType=='info'\">\r\n\r\n <h3>{{_messageSubject}}</h3>\r\n <mat-label>{{_messageDetails}}</mat-label>\r\n\r\n </div>\r\n\r\n\r\n <!-- Error -->\r\n <div *ngIf=\"messageType=='error'\">\r\n\r\n <mat-label>{{_messageDetails}}</mat-label>\r\n\r\n </div>\r\n\r\n\r\n </mat-dialog-content>\r\n\r\n<mat-dialog-actions>\r\n\r\n <button id=\"btnYes\" mat-stroked-button *ngIf=\"messageType=='confirm'\" (click)=\"response('yes')\" cdkFocusInitial>Yes</button>\r\n\r\n <button id=\"btnNo\" mat-stroked-button *ngIf=\"messageType=='confirm'\" (click)=\"response('no')\" >No</button>\r\n\r\n <button id=\"btnOK\" mat-stroked-button *ngIf=\"messageType=='info' || messageType=='error'\" (click)=\"response('ok')\" cdkFocusInitial>OK</button>\r\n\r\n</mat-dialog-actions>\r\n\r\n\r\n\r\n", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i4.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i4.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i4.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }] });
128
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: messageDialog, decorators: [{
129
+ type: Component,
130
+ args: [{ selector: 'lib-app-message', template: "\r\n <h2 mat-dialog-title>\r\n\r\n <mat-label *ngIf=\"messageType=='confirm'\">Confirm</mat-label>\r\n <mat-label *ngIf=\"messageType=='info'\">Information</mat-label>\r\n <mat-label *ngIf=\"messageType=='error'\">Error</mat-label>\r\n\r\n </h2>\r\n\r\n <mat-dialog-content class=\"mat-typography\">\r\n\r\n\r\n <!-- Confirm -->\r\n <p *ngIf=\"messageType=='confirm'\">{{_messageDetails}}</p>\r\n\r\n\r\n <!-- Information -->\r\n <div *ngIf=\"messageType=='info'\">\r\n\r\n <h3>{{_messageSubject}}</h3>\r\n <mat-label>{{_messageDetails}}</mat-label>\r\n\r\n </div>\r\n\r\n\r\n <!-- Error -->\r\n <div *ngIf=\"messageType=='error'\">\r\n\r\n <mat-label>{{_messageDetails}}</mat-label>\r\n\r\n </div>\r\n\r\n\r\n </mat-dialog-content>\r\n\r\n<mat-dialog-actions>\r\n\r\n <button id=\"btnYes\" mat-stroked-button *ngIf=\"messageType=='confirm'\" (click)=\"response('yes')\" cdkFocusInitial>Yes</button>\r\n\r\n <button id=\"btnNo\" mat-stroked-button *ngIf=\"messageType=='confirm'\" (click)=\"response('no')\" >No</button>\r\n\r\n <button id=\"btnOK\" mat-stroked-button *ngIf=\"messageType=='info' || messageType=='error'\" (click)=\"response('ok')\" cdkFocusInitial>OK</button>\r\n\r\n</mat-dialog-actions>\r\n\r\n\r\n\r\n" }]
131
+ }], ctorParameters: function () {
132
+ return [{ type: i4.MatDialogRef }, { type: undefined, decorators: [{
133
+ type: Inject,
134
+ args: [MAT_DIALOG_DATA]
135
+ }] }];
136
+ } });
137
+ ;
138
+
139
+ class MessageService {
140
+ constructor(snackBar, dialog) {
141
+ this.snackBar = snackBar;
142
+ this.dialog = dialog;
143
+ }
144
+ toast(msg) {
145
+ this.snackBar.open(msg, "OK", { duration: 5000 });
146
+ }
147
+ info(subject, details) {
148
+ let type = "info";
149
+ const dialogRef = this.dialog.open(messageDialog, {
150
+ width: "600px",
151
+ data: { type, subject, details },
152
+ });
153
+ }
154
+ error(details) {
155
+ let type = "error";
156
+ let subject;
157
+ const dialogRef = this.dialog.open(messageDialog, {
158
+ width: "600px",
159
+ data: { type, subject, details },
160
+ });
161
+ }
162
+ confirm(msg) {
163
+ let type = "confirm";
164
+ let subject = "";
165
+ let details = msg;
166
+ const dialogRef = this.dialog.open(messageDialog, {
167
+ width: "400px",
168
+ data: { type, subject, details },
169
+ });
170
+ return dialogRef.afterClosed().pipe(mergeMap((result) => {
171
+ return of(result);
172
+ }));
173
+ }
174
+ }
175
+ MessageService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MessageService, deps: [{ token: i1$1.MatSnackBar }, { token: i4.MatDialog }], target: i0.ɵɵFactoryTarget.Injectable });
176
+ MessageService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MessageService, providedIn: "root" });
177
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MessageService, decorators: [{
178
+ type: Injectable,
179
+ args: [{
180
+ providedIn: "root",
181
+ }]
182
+ }], ctorParameters: function () { return [{ type: i1$1.MatSnackBar }, { type: i4.MatDialog }]; } });
183
+
184
+ // import * as FileSaver from 'file-saver';
185
+ // import * as XLSX from 'xlsx';
186
+ class ExportService {
187
+ constructor() { }
188
+ }
189
+ ExportService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ExportService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
190
+ ExportService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ExportService, providedIn: 'root' });
191
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ExportService, decorators: [{
192
+ type: Injectable,
193
+ args: [{
194
+ providedIn: 'root'
195
+ }]
196
+ }], ctorParameters: function () { return []; } });
197
+
198
+ class Core {
199
+ static getClone(x) {
200
+ return JSON.parse(JSON.stringify(x));
201
+ }
202
+ static getNumber(value) {
203
+ if (value == null || value == "") {
204
+ return 0;
205
+ }
206
+ const onlyNumbers = value.replace(/[^\d.-]/g, '');
207
+ return onlyNumbers;
208
+ }
209
+ static getFirstDayOfMonth() {
210
+ const date = new Date();
211
+ return new Date(date.getFullYear(), date.getMonth(), 1);
212
+ }
213
+ static emailIsValid(email) {
214
+ // return /\S+@\S+\.\S+/.test(email)
215
+ return false;
216
+ }
217
+ static isValidUNCPath(path) {
218
+ // return /\\\\([a-zA-Z0-9_.$●-]+)\\([a-zA-Z0-9_.$●-]+).*/.test(path)
219
+ return false;
220
+ }
221
+ static isValidDate(date) {
222
+ var parsedDate = Date.parse(date);
223
+ if (isNaN(date) && !isNaN(parsedDate)) {
224
+ return true;
225
+ }
226
+ else {
227
+ return false;
228
+ }
229
+ }
230
+ static isValidEmailList(list) {
231
+ if (list.includes(";")) {
232
+ let emails = list.split(";");
233
+ for (var email of emails) {
234
+ if (this.emailIsValid(email) == false) {
235
+ return false;
236
+ }
237
+ }
238
+ }
239
+ else {
240
+ if (this.emailIsValid(list) == false) {
241
+ return false;
242
+ }
243
+ }
244
+ return true;
245
+ }
246
+ static isNumber(value) {
247
+ return ((value != null) &&
248
+ (value !== '') &&
249
+ !isNaN(Number(value.toString())));
250
+ }
251
+ static getDiff(startDate, endDate = Date()) {
252
+ var eventStartTime = new Date(startDate);
253
+ var eventEndTime = new Date(endDate);
254
+ var milliseconds = eventEndTime.valueOf() - eventStartTime.valueOf();
255
+ function numberEnding(number) {
256
+ if (number.toFixed() == '1') {
257
+ return '';
258
+ }
259
+ else {
260
+ return 's';
261
+ }
262
+ }
263
+ var minutes = (milliseconds / (1000 * 60));
264
+ var hours = (milliseconds / (1000 * 60 * 60));
265
+ var days = (milliseconds / (1000 * 60 * 60 * 24));
266
+ var weeks = (milliseconds / (1000 * 60 * 60 * 24 * 7));
267
+ var months = (milliseconds / (1000 * 60 * 60 * 24 * 7 * 4));
268
+ var years = (milliseconds / (1000 * 60 * 60 * 24 * 365));
269
+ if (years >= 1) {
270
+ return years.toFixed() + ' year' + numberEnding(years);
271
+ }
272
+ else if (months >= 1) {
273
+ return months.toFixed() + ' month' + numberEnding(months);
274
+ }
275
+ else if (weeks >= 1) {
276
+ return weeks.toFixed() + ' week' + numberEnding(weeks);
277
+ }
278
+ else if (days >= 1) {
279
+ return days.toFixed() + ' day' + numberEnding(days);
280
+ }
281
+ else if (hours >= 1) {
282
+ return hours.toFixed() + ' hour' + numberEnding(hours);
283
+ }
284
+ else if (minutes >= 1) {
285
+ return minutes.toFixed() + ' minute' + numberEnding(minutes);
286
+ }
287
+ else if (milliseconds >= (-1000 * 60)) {
288
+ return 'a minute';
289
+ }
290
+ else {
291
+ return 'N/A';
292
+ }
293
+ }
294
+ static nowDate(NoTime = false) {
295
+ if (NoTime) {
296
+ return this.getFormatedDate(Date(), true);
297
+ }
298
+ else {
299
+ return this.getFormatedDate(Date());
300
+ }
301
+ }
302
+ static getFormatedDate(dateString, NoTime = false) {
303
+ let d = new Date(dateString);
304
+ d.setHours(d.getHours() + 2);
305
+ if (NoTime == true) {
306
+ return d.toISOString().split('T')[0];
307
+ }
308
+ else {
309
+ return d.toISOString().split('.')[0];
310
+ }
311
+ }
312
+ static getFormatedDate2(d, NoTime = false) {
313
+ d.setHours(d.getHours() + 2);
314
+ if (NoTime == true) {
315
+ return d.toISOString().split('T')[0];
316
+ }
317
+ else {
318
+ return d.toISOString().split('.')[0];
319
+ }
320
+ }
321
+ static getBusinessDatesCount(startDate, endDate) {
322
+ var count = 0;
323
+ var _startDate = new Date(startDate);
324
+ var _endDate = new Date(endDate);
325
+ var curDate = _startDate;
326
+ while (curDate < _endDate) {
327
+ var dayOfWeek = curDate.getDay();
328
+ if (!(dayOfWeek == 6 || dayOfWeek == 0))
329
+ count++;
330
+ curDate.setDate(curDate.getDate() + 1);
331
+ }
332
+ return count;
333
+ }
334
+ }
335
+ Core.nullDate = "01 Jan 1969";
336
+ class ApiResponse {
337
+ }
338
+ class Constants {
339
+ }
340
+ Constants.AUTH_USER = 'a';
341
+ Constants.AUTH_NAME = 'b';
342
+ Constants.AUTH_ROLES = 'c';
343
+ Constants.AUTH_TOKEN = 'd';
344
+ Constants.AUTH_TOKEN_EXPIRE = 'e';
345
+
346
+ class Action {
347
+ }
348
+ class FormConfig {
349
+ }
350
+ class TableConfig {
351
+ }
352
+ class Tile {
353
+ }
354
+ class Step {
355
+ }
356
+ class ActionResponse {
357
+ }
358
+ class loginConfig {
359
+ constructor() {
360
+ this.appName = "";
361
+ this.selfService = false;
362
+ this.logo = "";
363
+ this.logoSize = "normal";
364
+ }
365
+ }
366
+ class AppConfig {
367
+ constructor() {
368
+ this.appName = "App Name";
369
+ this.logo = "";
370
+ this.logoSize = "normal";
371
+ this.ADAuth = true;
372
+ this.localAuth = true;
373
+ this.selfService = false;
374
+ }
375
+ }
376
+ class CapItem {
377
+ constructor() {
378
+ this.name = "";
379
+ this.display = "New Cap Item";
380
+ this.enabled = false;
381
+ this.type = "";
382
+ this.newLine = false;
383
+ this.showMenu = true;
384
+ this.ignoreSubsDisplay = false;
385
+ this.link = "";
386
+ this.icon = "navigate_next";
387
+ }
388
+ }
389
+ class Account {
390
+ }
391
+ class User {
392
+ constructor() {
393
+ this.userName = "";
394
+ this.password = "";
395
+ this.tries = "0";
396
+ this.locked = "0";
397
+ this.logged = "0";
398
+ this.disabled = "0";
399
+ this.changepassword = "0";
400
+ this.dateCreated = Core.nowDate();
401
+ this.dateUpdated = Core.nowDate();
402
+ this.token = "";
403
+ this.dateExpire = Core.nowDate();
404
+ this.tokenExpire = Core.nowDate();
405
+ this.authType = "";
406
+ }
407
+ }
408
+ class ChangeUserPassword {
409
+ constructor() {
410
+ this.userName = "";
411
+ this.currentPassword = "";
412
+ this.newPassword = "";
413
+ this.confirmPassword = "";
414
+ }
415
+ }
416
+ class Register {
417
+ constructor() {
418
+ this.userName = "";
419
+ this.roleID = 1;
420
+ this.firstName = "";
421
+ this.lastName = "";
422
+ this.email = "";
423
+ this.authType = "";
424
+ this.password = "";
425
+ }
426
+ }
427
+ class Profile {
428
+ constructor() {
429
+ this.profileID = "";
430
+ this.userName = "";
431
+ this.roleID = 1;
432
+ this.firstName = "";
433
+ this.lastName = "";
434
+ this.email = "";
435
+ this.empID = "";
436
+ this.arID = "0";
437
+ this.authType = "";
438
+ this.password = "";
439
+ this.role = new Role();
440
+ }
441
+ }
442
+ class Role {
443
+ constructor() {
444
+ this.roleID = 0;
445
+ this.roleName = "New Role";
446
+ this.cap1 = false;
447
+ this.cap2 = false;
448
+ this.cap3 = false;
449
+ this.cap4 = false;
450
+ this.cap5 = false;
451
+ this.cap6 = false;
452
+ this.cap7 = false;
453
+ this.cap8 = false;
454
+ this.cap9 = false;
455
+ this.cap10 = false;
456
+ this.cap11 = false;
457
+ this.cap12 = false;
458
+ this.cap13 = false;
459
+ this.cap14 = false;
460
+ this.cap15 = false;
461
+ this.cap16 = false;
462
+ this.cap17 = false;
463
+ this.cap18 = false;
464
+ this.cap19 = false;
465
+ this.cap20 = false;
466
+ this.cap21 = false;
467
+ this.cap22 = false;
468
+ this.cap23 = false;
469
+ this.cap24 = false;
470
+ this.cap25 = false;
471
+ this.cap26 = false;
472
+ this.cap27 = false;
473
+ this.cap28 = false;
474
+ this.cap29 = false;
475
+ this.cap30 = false;
476
+ this.cap31 = false;
477
+ this.cap32 = false;
478
+ this.cap33 = false;
479
+ this.cap34 = false;
480
+ this.cap35 = false;
481
+ this.cap36 = false;
482
+ this.cap37 = false;
483
+ this.cap38 = false;
484
+ this.cap39 = false;
485
+ this.cap40 = false;
486
+ this.cap41 = false;
487
+ this.cap42 = false;
488
+ this.cap43 = false;
489
+ this.cap44 = false;
490
+ this.cap45 = false;
491
+ this.cap46 = false;
492
+ this.cap47 = false;
493
+ this.cap48 = false;
494
+ this.cap49 = false;
495
+ this.cap50 = false;
496
+ this.cap51 = false;
497
+ this.cap52 = false;
498
+ this.cap53 = false;
499
+ this.cap54 = false;
500
+ this.cap55 = false;
501
+ this.cap56 = false;
502
+ this.cap57 = false;
503
+ this.cap58 = false;
504
+ this.cap59 = false;
505
+ this.cap60 = false;
506
+ this.cap61 = false;
507
+ this.cap62 = false;
508
+ this.cap63 = false;
509
+ this.cap64 = false;
510
+ this.cap65 = false;
511
+ this.cap66 = false;
512
+ this.cap67 = false;
513
+ this.cap68 = false;
514
+ this.cap69 = false;
515
+ this.cap70 = false;
516
+ this.cap71 = false;
517
+ this.cap72 = false;
518
+ this.cap73 = false;
519
+ this.cap74 = false;
520
+ this.cap75 = false;
521
+ this.cap76 = false;
522
+ this.cap77 = false;
523
+ this.cap78 = false;
524
+ this.cap79 = false;
525
+ this.cap80 = false;
526
+ this.cap81 = false;
527
+ this.cap82 = false;
528
+ this.cap83 = false;
529
+ this.cap84 = false;
530
+ this.cap85 = false;
531
+ this.cap86 = false;
532
+ this.cap87 = false;
533
+ this.cap88 = false;
534
+ this.cap89 = false;
535
+ this.cap90 = false;
536
+ this.cap91 = false;
537
+ this.cap92 = false;
538
+ this.cap93 = false;
539
+ this.cap94 = false;
540
+ this.cap95 = false;
541
+ this.cap96 = false;
542
+ this.cap97 = false;
543
+ this.cap98 = false;
544
+ this.cap99 = false;
545
+ this.cap100 = false;
546
+ }
547
+ }
548
+ var LogLevel;
549
+ (function (LogLevel) {
550
+ LogLevel[LogLevel["All"] = 0] = "All";
551
+ LogLevel[LogLevel["Debug"] = 1] = "Debug";
552
+ LogLevel[LogLevel["Info"] = 2] = "Info";
553
+ LogLevel[LogLevel["Warn"] = 3] = "Warn";
554
+ LogLevel[LogLevel["Error"] = 4] = "Error";
555
+ LogLevel[LogLevel["Fatal"] = 5] = "Fatal";
556
+ LogLevel[LogLevel["Off"] = 6] = "Off";
557
+ })(LogLevel || (LogLevel = {}));
558
+
559
+ class HttpService {
560
+ constructor(httpClient, router) {
561
+ this.httpClient = httpClient;
562
+ this.router = router;
563
+ //----Set apiUrl from the data service of the project---//
564
+ this.apiUrl = "https://api.solinc.co.zw/"; //default
565
+ this.httpOptions_Legacy = {
566
+ headers: new HttpHeaders({
567
+ Accept: "application/json",
568
+ "Content-Type": "application/json",
569
+ Authorization: "Basic " + btoa("emptyUser:emptyToken"),
570
+ }),
571
+ resposeType: "json",
572
+ };
573
+ this.httpOptions_Files = {
574
+ headers: new HttpHeaders({
575
+ Authorization: "Basic " + btoa("tnyagato:j5Toszfr@ys"),
576
+ }),
577
+ resposeType: "json",
578
+ };
579
+ }
580
+ //POST
581
+ Post(service, data) {
582
+ return this.httpClient.post(this.apiUrl + service, data, this.httpOptions_Legacy);
583
+ }
584
+ //PUT
585
+ Put(service, data) {
586
+ return this.httpClient.put(this.apiUrl + service, data, this.httpOptions_Legacy);
587
+ }
588
+ //POST RAW
589
+ Post_Raw(url, data) {
590
+ return this.httpClient.post(url, data, this.httpOptions_Legacy);
591
+ }
592
+ //POST with file
593
+ Post_WithFile(service, data, file) {
594
+ let formData = new FormData();
595
+ if (file) {
596
+ formData.append("uploadFile", file, file.name);
597
+ }
598
+ formData.append("data", JSON.stringify(data));
599
+ return this.httpClient.post(this.apiUrl + service, formData, this.httpOptions_Files);
600
+ }
601
+ // //POST with files
602
+ Post_FormData(service, formData) {
603
+ return this.httpClient.post(this.apiUrl + service, formData, this.httpOptions_Files);
604
+ }
605
+ //GET
606
+ Get(service) {
607
+ return this.httpClient.get(this.apiUrl + service, this.httpOptions_Legacy);
608
+ }
609
+ //Get RAW
610
+ Get_Raw(url) {
611
+ return this.httpClient.get(url, this.httpOptions_Legacy);
612
+ }
613
+ //ERROR
614
+ Error(error) {
615
+ if (error.statusText == "Unauthorized") {
616
+ this.router.navigate(["login"]);
617
+ return "Unauthorized";
618
+ }
619
+ else {
620
+ return "Connection failed";
621
+ }
622
+ }
623
+ }
624
+ HttpService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HttpService, deps: [{ token: i1$2.HttpClient }, { token: i1$3.Router }], target: i0.ɵɵFactoryTarget.Injectable });
625
+ HttpService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HttpService, providedIn: "root" });
626
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HttpService, decorators: [{
627
+ type: Injectable,
628
+ args: [{
629
+ providedIn: "root",
630
+ }]
631
+ }], ctorParameters: function () { return [{ type: i1$2.HttpClient }, { type: i1$3.Router }]; } });
632
+
633
+ // import { Core } from 'tin-core';
634
+ class LogService {
635
+ constructor() {
636
+ this.level = LogLevel.All;
637
+ this.logToConsole = true;
638
+ this.logToApi = false;
639
+ }
640
+ debug(msg, ...optionalParams) {
641
+ this.writeToLog(msg, LogLevel.Debug, optionalParams);
642
+ }
643
+ info(msg, ...optionalParams) {
644
+ this.writeToLog(msg, LogLevel.Info, optionalParams);
645
+ }
646
+ warn(msg, ...optionalParams) {
647
+ this.writeToLog(msg, LogLevel.Warn, optionalParams);
648
+ }
649
+ error(msg, ...optionalParams) {
650
+ this.writeToLog(msg, LogLevel.Error, optionalParams);
651
+ }
652
+ fatal(msg, ...optionalParams) {
653
+ this.writeToLog(msg, LogLevel.Fatal, optionalParams);
654
+ }
655
+ log(msg, ...optionalParams) {
656
+ this.writeToLog(msg, LogLevel.All, optionalParams);
657
+ }
658
+ writeToLog(msg, level, params) {
659
+ if (this.shouldLog(level)) {
660
+ // Build log string
661
+ let value = Core.getFormatedDate(Date(), false).replace("T", " ");
662
+ // value += " - Type: " + LogLevel[this.level];
663
+ value += " - Message: " + msg;
664
+ if (params.length) {
665
+ value += " - Extra Info: " + this.formatParams(params);
666
+ }
667
+ // Log the value
668
+ if (this.logToConsole) {
669
+ console.log(value);
670
+ }
671
+ if (this.logToApi) {
672
+ //Call API post
673
+ }
674
+ }
675
+ }
676
+ formatParams(params) {
677
+ let ret = params.join(",");
678
+ // Is there at least one object in the array?
679
+ if (params.some((p) => typeof p == "object")) {
680
+ ret = "";
681
+ // Build comma-delimited string
682
+ for (let item of params) {
683
+ ret += JSON.stringify(item) + ",";
684
+ }
685
+ }
686
+ return ret;
687
+ }
688
+ shouldLog(level) {
689
+ let ret = false;
690
+ if ((level >= this.level && level !== LogLevel.Off) ||
691
+ this.level === LogLevel.All) {
692
+ ret = true;
693
+ }
694
+ return ret;
695
+ }
696
+ }
697
+ LogService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LogService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
698
+ LogService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LogService, providedIn: "root" });
699
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LogService, decorators: [{
700
+ type: Injectable,
701
+ args: [{
702
+ providedIn: "root",
703
+ }]
704
+ }], ctorParameters: function () { return []; } });
705
+
706
+ class AuthService {
707
+ constructor(_route, storage, router, httpService, messageService, logService) {
708
+ this._route = _route;
709
+ this.storage = storage;
710
+ this.router = router;
711
+ this.httpService = httpService;
712
+ this.messageService = messageService;
713
+ this.logService = logService;
714
+ //Logged in
715
+ this.loggedin = false;
716
+ this.loggedinSource = new BehaviorSubject(this.loggedin);
717
+ this.loggedinObserv = this.loggedinSource.asObservable();
718
+ //Token
719
+ this.token = "";
720
+ this.tokenSource = new BehaviorSubject(this.token);
721
+ this.tokenObserv = this.tokenSource.asObservable();
722
+ //TokenExpire
723
+ this.tokenExpire = "";
724
+ this.tokenExpireSource = new BehaviorSubject(this.tokenExpire);
725
+ this.tokenExpireObserv = this.tokenExpireSource.asObservable();
726
+ //Current User
727
+ this.currentUser = "tnyagato";
728
+ this.currentUserSource = new BehaviorSubject(this.currentUser);
729
+ this.currentUserObserv = this.currentUserSource.asObservable();
730
+ //Line Manager
731
+ this.islineManager = false;
732
+ this.isLineManagerSource = new BehaviorSubject(this.islineManager);
733
+ this.isLineManagerObserv = this.isLineManagerSource.asObservable();
734
+ //Roles
735
+ this.currentRole = new Role;
736
+ this.currentRoleSource = new BehaviorSubject(this.currentRole);
737
+ this.myRoleObserv = this.currentRoleSource.asObservable();
738
+ //Logged in FirstName
739
+ this.loggedUserSource = new BehaviorSubject("tnyagato");
740
+ this.loggedUserFullName = this.loggedUserSource.asObservable();
741
+ }
742
+ Updateloggedin(loggedin) {
743
+ this.loggedinSource.next(loggedin);
744
+ this.loggedin = loggedin;
745
+ }
746
+ UpdateToken(newToken) {
747
+ this.tokenSource.next(newToken);
748
+ }
749
+ UpdateTokenExpire(newTokenExpire) {
750
+ this.tokenExpireSource.next(newTokenExpire);
751
+ }
752
+ UpdateCurrentUser(newUser) {
753
+ this.currentUserSource.next(newUser.toLocaleLowerCase());
754
+ this.currentUser = newUser.toLocaleLowerCase();
755
+ }
756
+ UpdateIsLineManager(manager) {
757
+ this.isLineManagerSource.next(manager);
758
+ }
759
+ UpdateRole(role) {
760
+ this.currentRoleSource.next(role);
761
+ }
762
+ updateLoggedUserFullName(userName) {
763
+ this.loggedUserSource.next(userName);
764
+ }
765
+ //Authorisation
766
+ isAuthorised(capName) {
767
+ if (!this.currentRoleSource.value[capName]) {
768
+ // this.logService.info(`authorise: ${this.currentRoleSource.value.roleName} not authorised for ${capName}`);
769
+ this.router.navigate(["home"]);
770
+ this.messageService.toast(`Unauthorised: ${capName}`);
771
+ return false;
772
+ }
773
+ else {
774
+ return true;
775
+ }
776
+ }
777
+ isValidToken() {
778
+ let tokenExpire = new Date(this.tokenExpireSource.value);
779
+ let nowDate = new Date();
780
+ let valid = tokenExpire > nowDate;
781
+ if (!valid) {
782
+ this.router.navigate(["login"]);
783
+ this.messageService.toast(`Expired Session`);
784
+ }
785
+ return valid;
786
+ }
787
+ canActivate() {
788
+ if (this.loggedin && this.isValidToken()) {
789
+ // this.logService.info("authentication: logged in");
790
+ return true;
791
+ }
792
+ if (localStorage.getItem(Constants.AUTH_USER) === null) {
793
+ // this.logService.info("authentication: not logged and no cache");
794
+ this.Updateloggedin(false);
795
+ let url = new URL(window.location.href);
796
+ let path = url.hash.replace("#/", "");
797
+ this.router.navigate(["login"], {
798
+ relativeTo: this._route,
799
+ queryParams: { redirectTo: path },
800
+ queryParamsHandling: 'merge',
801
+ skipLocationChange: false
802
+ });
803
+ return false;
804
+ }
805
+ else {
806
+ // this.logService.info("authentication: not logged but allowed login");
807
+ this.Updateloggedin(true);
808
+ this.storage.get(Constants.AUTH_USER).then((resp) => {
809
+ this.UpdateCurrentUser(resp);
810
+ });
811
+ this.storage.get(Constants.AUTH_NAME).then((resp) => {
812
+ this.updateLoggedUserFullName(resp);
813
+ });
814
+ this.storage.get(Constants.AUTH_ROLES).then((resp) => {
815
+ let ret = JSON.parse(resp);
816
+ this.UpdateRole(ret);
817
+ });
818
+ this.storage.get(Constants.AUTH_TOKEN).then((resp) => {
819
+ this.UpdateToken(resp);
820
+ });
821
+ this.storage.get(Constants.AUTH_TOKEN_EXPIRE).then((resp) => {
822
+ this.UpdateTokenExpire(resp);
823
+ this.isValidToken();
824
+ });
825
+ return true;
826
+ }
827
+ }
828
+ }
829
+ AuthService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AuthService, deps: [{ token: i1$3.ActivatedRoute }, { token: StorageService }, { token: i1$3.Router }, { token: HttpService }, { token: MessageService }, { token: LogService }], target: i0.ɵɵFactoryTarget.Injectable });
830
+ AuthService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AuthService, providedIn: 'root' });
831
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AuthService, decorators: [{
832
+ type: Injectable,
833
+ args: [{
834
+ providedIn: 'root'
835
+ }]
836
+ }], ctorParameters: function () { return [{ type: i1$3.ActivatedRoute }, { type: StorageService }, { type: i1$3.Router }, { type: HttpService }, { type: MessageService }, { type: LogService }]; } });
837
+
838
+ class DataServiceLib {
839
+ constructor(httpService) {
840
+ this.httpService = httpService;
841
+ this.appConfig = new AppConfig();
842
+ this.appConfigSource = new BehaviorSubject(this.appConfig);
843
+ this.appConfigObserv = this.appConfigSource.asObservable();
844
+ // caps: CapItem[];
845
+ this.capHome = new CapItem;
846
+ this.capAdmin = new CapItem;
847
+ this.capUsers = new CapItem;
848
+ this.capRoles = new CapItem;
849
+ this.capLogs = new CapItem;
850
+ this.capSettings = new CapItem;
851
+ this.tmpProfileuserName = "";
852
+ this.appConfig.appName = "App-Name";
853
+ this.appConfig.logo = "./assets/logo.png";
854
+ this.appConfig.ADAuth = true;
855
+ this.appConfig.capItems = [this.capAdmin, this.capHome];
856
+ this.capHome.name = "cap1";
857
+ this.capHome.display = "Home";
858
+ this.capHome.link = "home";
859
+ this.capAdmin.name = "cap2";
860
+ this.capAdmin.display = "Admin";
861
+ this.capAdmin.capSubItems = [this.capUsers, this.capRoles, this.capLogs, this.capSettings];
862
+ this.capUsers.name = "cap3";
863
+ this.capUsers.display = "Users";
864
+ this.capUsers.link = "home/admin/users";
865
+ this.capRoles.name = "cap4";
866
+ this.capRoles.display = "Roles";
867
+ this.capRoles.link = "home/admin/roles";
868
+ this.capLogs.name = "cap5";
869
+ this.capLogs.display = "Logs";
870
+ this.capLogs.link = "home/admin/logs";
871
+ this.capSettings.name = "cap6";
872
+ this.capSettings.display = "Settings";
873
+ this.capSettings.link = "home/admin/settings";
874
+ }
875
+ UpdateAppConfig(config) {
876
+ this.appConfigSource.next(config);
877
+ this.appConfig = config;
878
+ }
879
+ CallApi(action, data) {
880
+ if (!action.method) {
881
+ return this.httpService.Get(action.url);
882
+ }
883
+ if (action.method == 'get') {
884
+ return this.httpService.Get(action.url);
885
+ }
886
+ else if (action.method == 'post') {
887
+ return this.httpService.Post(action.url, data);
888
+ }
889
+ else {
890
+ return this.httpService.Post(action.url, data);
891
+ }
892
+ }
893
+ //Users
894
+ GetUser() {
895
+ return this.httpService.Get("User/all/x");
896
+ }
897
+ RegisterAccount(u) {
898
+ return this.httpService.Post("User/register", u);
899
+ }
900
+ GetUserByID(val) {
901
+ return this.httpService.Get(`User/id/${val}`);
902
+ }
903
+ UpdateUser(profile) {
904
+ return this.httpService.Post("User/edit", profile);
905
+ }
906
+ UnlockUser(user) {
907
+ return this.httpService.Post("User/unlock", user);
908
+ }
909
+ LockUser(user) {
910
+ return this.httpService.Post("User/lock", user);
911
+ }
912
+ DeleteUser(user) {
913
+ return this.httpService.Post("User/delete", user);
914
+ }
915
+ Login(u) {
916
+ return this.httpService.Post("User/login", u);
917
+ }
918
+ ChangePassword(u) {
919
+ return this.httpService.Post("User/changepassword-self", u);
920
+ }
921
+ ChangePasswordAdmin(u) {
922
+ return this.httpService.Post("User/changepassword-admin", u);
923
+ }
924
+ SelfReset(u) {
925
+ return this.httpService.Post("Basic/SelfReset", u);
926
+ }
927
+ //Roles
928
+ PostRole(role, action) {
929
+ return this.httpService.Post(`Role?action=${action}`, role);
930
+ }
931
+ PutRole(role) {
932
+ return this.httpService.Put("Role", role);
933
+ }
934
+ GetRole(by, val) {
935
+ return this.httpService.Get("Role/all/x");
936
+ }
937
+ //Logs
938
+ GetLog(by, val) {
939
+ return this.httpService.Get("Log/all/x");
940
+ }
941
+ //Settings
942
+ GetSetting(by, val) {
943
+ return this.httpService.Get("Setting/all/x");
944
+ }
945
+ UpdateSetting(setting, action) {
946
+ return this.httpService.Post(`Setting?action=${action}`, setting);
947
+ }
948
+ }
949
+ DataServiceLib.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DataServiceLib, deps: [{ token: HttpService }], target: i0.ɵɵFactoryTarget.Injectable });
950
+ DataServiceLib.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DataServiceLib, providedIn: 'root' });
951
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DataServiceLib, decorators: [{
952
+ type: Injectable,
953
+ args: [{
954
+ providedIn: 'root'
955
+ }]
956
+ }], ctorParameters: function () { return [{ type: HttpService }]; } });
957
+
958
+ class TinSpaComponent {
959
+ }
960
+ TinSpaComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TinSpaComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
961
+ TinSpaComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: TinSpaComponent, selector: "spa-tin-spa", ngImport: i0, template: `
962
+ <p>
963
+ tin-spa works!
964
+ </p>
965
+ `, isInline: true });
966
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TinSpaComponent, decorators: [{
967
+ type: Component,
968
+ args: [{ selector: 'spa-tin-spa', template: `
969
+ <p>
970
+ tin-spa works!
971
+ </p>
972
+ ` }]
973
+ }] });
974
+
975
+ class SpaMatModule {
976
+ }
977
+ SpaMatModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SpaMatModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
978
+ SpaMatModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: SpaMatModule, exports: [CommonModule, FormsModule, ReactiveFormsModule,
979
+ MatMenuModule, MatSliderModule, MatTableModule, MatPaginatorModule,
980
+ MatCheckboxModule, MatBadgeModule, MatButtonModule, MatIconModule, MatDialogModule, MatSnackBarModule,
981
+ MatTabsModule, MatFormFieldModule, MatInputModule, MatCardModule, MatChipsModule, MatSelectModule,
982
+ MatNativeDateModule, MatProgressSpinnerModule, MatListModule, MatAutocompleteModule, MatTooltipModule, MatSortModule,
983
+ MatDatepickerModule, MatStepperModule, MatRadioModule] });
984
+ SpaMatModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SpaMatModule, providers: [
985
+ { provide: MAT_DIALOG_DEFAULT_OPTIONS, useValue: { disableClose: true, hasBackdrop: true } },
986
+ { provide: MAT_DATE_LOCALE, useValue: "en-GB" },
987
+ ], imports: [CommonModule, FormsModule, ReactiveFormsModule,
988
+ MatMenuModule, MatSliderModule, MatTableModule, MatPaginatorModule,
989
+ MatCheckboxModule, MatBadgeModule, MatButtonModule, MatIconModule, MatDialogModule, MatSnackBarModule,
990
+ MatTabsModule, MatFormFieldModule, MatInputModule, MatCardModule, MatChipsModule, MatSelectModule,
991
+ MatNativeDateModule, MatProgressSpinnerModule, MatListModule, MatAutocompleteModule, MatTooltipModule, MatSortModule,
992
+ MatDatepickerModule, MatStepperModule, MatRadioModule] });
993
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SpaMatModule, decorators: [{
994
+ type: NgModule,
995
+ args: [{
996
+ declarations: [],
997
+ imports: [],
998
+ exports: [
999
+ CommonModule, FormsModule, ReactiveFormsModule,
1000
+ MatMenuModule, MatSliderModule, MatTableModule, MatPaginatorModule,
1001
+ MatCheckboxModule, MatBadgeModule, MatButtonModule, MatIconModule, MatDialogModule, MatSnackBarModule,
1002
+ MatTabsModule, MatFormFieldModule, MatInputModule, MatCardModule, MatChipsModule, MatSelectModule,
1003
+ MatNativeDateModule, MatProgressSpinnerModule, MatListModule, MatAutocompleteModule, MatTooltipModule, MatSortModule,
1004
+ MatDatepickerModule, MatStepperModule, MatRadioModule,
1005
+ ],
1006
+ providers: [
1007
+ { provide: MAT_DIALOG_DEFAULT_OPTIONS, useValue: { disableClose: true, hasBackdrop: true } },
1008
+ { provide: MAT_DATE_LOCALE, useValue: "en-GB" },
1009
+ ]
1010
+ }]
1011
+ }] });
1012
+
1013
+ class TextComponent {
1014
+ constructor() {
1015
+ this.multiDimension = false;
1016
+ // options: FormGroup;
1017
+ this.hideRequiredControl = new FormControl(true);
1018
+ this.hide = true; //for password only
1019
+ this.readonly = false;
1020
+ this.hint = "";
1021
+ this.display = "";
1022
+ this.placeholder = "";
1023
+ this.value = "";
1024
+ this.valueChange = new EventEmitter();
1025
+ this.format = "text";
1026
+ this.type = "";
1027
+ this.leave = new EventEmitter();
1028
+ this.enterPress = new EventEmitter();
1029
+ this.rows = "";
1030
+ this.width = "100%";
1031
+ //Autocomplete items
1032
+ this.options = [];
1033
+ this.optionValue = "";
1034
+ //validation input
1035
+ this.required = true;
1036
+ this.min = 0;
1037
+ this.max = 9000000000000000; //Math.max
1038
+ this.regex = ""; //"[a-zA-Z ]*" //"/\S+@\S+\.\S+/";
1039
+ //validation
1040
+ this.myControl = new FormControl('', [Validators.required, Validators.minLength(this.min), Validators.maxLength(this.max), Validators.pattern(this.regex)]);
1041
+ this.control = new FormControl(this.value, [Validators.required, Validators.minLength(this.min), Validators.maxLength(this.max), Validators.pattern(this.regex)]);
1042
+ }
1043
+ ngOnInit() {
1044
+ if (this.options.length > 0) {
1045
+ this.initFilter();
1046
+ }
1047
+ if (this.placeholder == "") {
1048
+ this.placeholder = "Enter " + this.display;
1049
+ }
1050
+ }
1051
+ ngAfterViewInit() {
1052
+ this.initControl(this.control);
1053
+ this.initControl(this.myControl);
1054
+ }
1055
+ initFilter() {
1056
+ const objKeyList = Object.keys(this.options[0]);
1057
+ const firstKey = objKeyList[0];
1058
+ this.multiDimension = !Core.isNumber(firstKey);
1059
+ this.filteredOptions = this.myControl.valueChanges.pipe(startWith(""), map((value) => this._filter(value)));
1060
+ }
1061
+ _filter(value) {
1062
+ if (this.multiDimension) {
1063
+ let filterValue = "";
1064
+ if (value != "" && value) {
1065
+ filterValue = value.toLowerCase();
1066
+ }
1067
+ return this.options.filter((option) => option[`${this.optionValue}`].toLowerCase().includes(filterValue));
1068
+ }
1069
+ else {
1070
+ const filterValue = value.toLowerCase();
1071
+ return this.options.filter(option => option.toLowerCase().includes(filterValue));
1072
+ }
1073
+ }
1074
+ initControl(control) {
1075
+ if (this.readonly) {
1076
+ control.setValidators(null);
1077
+ control.updateValueAndValidity();
1078
+ }
1079
+ if (!this.required && !this.readonly) {
1080
+ control.setValidators([Validators.minLength(this.min), Validators.maxLength(this.max), Validators.pattern(this.regex)]);
1081
+ this.control.updateValueAndValidity();
1082
+ }
1083
+ }
1084
+ //Events
1085
+ changed() {
1086
+ if (this.options.length > 0) {
1087
+ this.valueChange.emit(this.myControl.value);
1088
+ }
1089
+ else {
1090
+ this.valueChange.emit(this.value);
1091
+ }
1092
+ }
1093
+ leaved() {
1094
+ this.leave.emit();
1095
+ }
1096
+ enterPressed() {
1097
+ this.enterPress.emit();
1098
+ }
1099
+ validate(control) {
1100
+ if ((this.required || this.min > 0) && control.hasError('required')) {
1101
+ return `Required`;
1102
+ }
1103
+ if (control.hasError('minlength')) {
1104
+ return `Minimun length is ${this.min}`;
1105
+ }
1106
+ if (control.hasError('maxlength')) {
1107
+ return `Maximum length is ${this.max}`;
1108
+ }
1109
+ if (control.hasError('pattern')) {
1110
+ return `Invalid Input`;
1111
+ }
1112
+ // if (this.regex != ""){
1113
+ // let r = new RegExp(this.regex, "g");
1114
+ // if (!r.test(this.value)){
1115
+ // this.valid = false;
1116
+ // this.errorMessage = "Invalid input";
1117
+ // return this.errorMessage;
1118
+ // }
1119
+ // }
1120
+ return "";
1121
+ }
1122
+ }
1123
+ TextComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TextComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1124
+ TextComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: TextComponent, selector: "spa-text", inputs: { readonly: "readonly", hint: "hint", display: "display", placeholder: "placeholder", value: "value", format: "format", type: "type", rows: "rows", width: "width", options: "options", optionValue: "optionValue", required: "required", min: "min", max: "max", regex: "regex" }, outputs: { valueChange: "valueChange", leave: "leave", enterPress: "enterPress" }, ngImport: i0, template: "\r\n<!-- General Text -->\r\n<mat-form-field *ngIf=\"rows == '' && (format=='text' || format =='date') && options.length==0\" hideRequiredMarker=\"true\" [hintLabel]=\"hint\" [ngStyle]=\"{'width':width}\" style=\"margin-right: 5px;\" >\r\n<mat-label *ngIf=\"format=='text'\">{{display}}</mat-label>\r\n<mat-label *ngIf=\"format=='date'\">{{display | date:'dd/MM/yyyy'}}</mat-label>\r\n<input matInput autocomplete=\"off\" [(ngModel)]=\"value\" (change)=\"changed()\" (blur)=\"leaved()\" (keyup.enter)=\"enterPressed()\" [type]=\"type\" [placeholder]=\"placeholder\" [formControl]=\"control\" [required]=\"required\" [readonly]=\"readonly\"/>\r\n<mat-error *ngIf=\"control.invalid\">{{validate(control)}}</mat-error>\r\n</mat-form-field>\r\n\r\n\r\n<!-- password -->\r\n<mat-form-field *ngIf=\"format=='password'\" hideRequiredMarker=\"true\" [hintLabel]=\"hint\" [ngStyle]=\"{'width':width}\" style=\"margin-right: 5px;\">\r\n <mat-label>{{display}}</mat-label>\r\n <input matInput [type]=\"hide ? 'password' : 'text'\" (keyup.enter)=\"enterPressed()\" (change)=\"changed()\" (blur)=\"leaved()\" [(ngModel)]=\"value\" autocomplete=\"off\" [placeholder]=\"placeholder\" [formControl]=\"control\" [required]=\"required\">\r\n <mat-error *ngIf=\"control.invalid\">{{validate(control)}}</mat-error>\r\n <button mat-icon-button matSuffix (click)=\"hide = !hide\" [attr.aria-label]=\"'Hide password'\" [attr.aria-pressed]=\"hide\">\r\n <mat-icon style=\"font-size: 18px;\">{{hide ? 'visibility_off' : 'visibility'}}</mat-icon>\r\n </button>\r\n</mat-form-field>\r\n\r\n\r\n<!-- TextArea copy - Only change input to textarea and change ngif to not -->\r\n\r\n<mat-form-field *ngIf=\"rows != '' && options.length==0\" hideRequiredMarker=\"true\" [hintLabel]=\"hint\" [ngStyle]=\"{'width':width}\" style=\"margin-right: 5px;\">\r\n<mat-label>{{display}}</mat-label>\r\n<textarea matInput autocomplete=\"off\" [rows]=\"rows\" [(ngModel)]=\"value\" (change)=\"changed()\" (keyup.enter)=\"enterPressed()\" [placeholder]=\"placeholder\" [formControl]=\"control\" [required]=\"required\" [readonly]=\"readonly\"></textarea>\r\n<mat-error *ngIf=\"control.invalid\">{{validate(control)}}</mat-error>\r\n</mat-form-field>\r\n\r\n\r\n\r\n<!-- Auto Complete-->\r\n\r\n <mat-form-field *ngIf=\"rows == '' && format=='text' && options.length>0 \" [hintLabel]=\"hint\" [ngStyle]=\"{'width':width}\" style=\"margin-right: 5px;\">\r\n <mat-label>{{display}}</mat-label>\r\n <input [type]=\"type\" [placeholder]=\"placeholder\" (change)=\"changed()\" matInput [formControl]=\"myControl\" [matAutocomplete]=\"auto\" [required]=\"required\" [readonly]=\"readonly\">\r\n <mat-error *ngIf=\"control.invalid\">{{validate(myControl)}}</mat-error>\r\n <mat-autocomplete #auto=\"matAutocomplete\" (optionSelected)=\"changed()\">\r\n\r\n <ng-container *ngIf=\"!multiDimension\">\r\n <mat-option *ngFor=\"let option of filteredOptions | async\" [value]=\"option\">\r\n {{option}}\r\n </mat-option>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"multiDimension\">\r\n <mat-option *ngFor=\"let row of filteredOptions | async\" [value]=\"row[optionValue]\">\r\n {{row[optionValue]}}\r\n </mat-option>\r\n </ng-container>\r\n\r\n\r\n </mat-autocomplete>\r\n </mat-form-field>\r\n\r\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i3.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix]" }, { kind: "directive", type: i4$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i7.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "component", type: i8.MatAutocomplete, selector: "mat-autocomplete", inputs: ["disableRipple"], exportAs: ["matAutocomplete"] }, { kind: "directive", type: i8.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", exportAs: ["matAutocompleteTrigger"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i1.DatePipe, name: "date" }] });
1125
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TextComponent, decorators: [{
1126
+ type: Component,
1127
+ args: [{ selector: 'spa-text', template: "\r\n<!-- General Text -->\r\n<mat-form-field *ngIf=\"rows == '' && (format=='text' || format =='date') && options.length==0\" hideRequiredMarker=\"true\" [hintLabel]=\"hint\" [ngStyle]=\"{'width':width}\" style=\"margin-right: 5px;\" >\r\n<mat-label *ngIf=\"format=='text'\">{{display}}</mat-label>\r\n<mat-label *ngIf=\"format=='date'\">{{display | date:'dd/MM/yyyy'}}</mat-label>\r\n<input matInput autocomplete=\"off\" [(ngModel)]=\"value\" (change)=\"changed()\" (blur)=\"leaved()\" (keyup.enter)=\"enterPressed()\" [type]=\"type\" [placeholder]=\"placeholder\" [formControl]=\"control\" [required]=\"required\" [readonly]=\"readonly\"/>\r\n<mat-error *ngIf=\"control.invalid\">{{validate(control)}}</mat-error>\r\n</mat-form-field>\r\n\r\n\r\n<!-- password -->\r\n<mat-form-field *ngIf=\"format=='password'\" hideRequiredMarker=\"true\" [hintLabel]=\"hint\" [ngStyle]=\"{'width':width}\" style=\"margin-right: 5px;\">\r\n <mat-label>{{display}}</mat-label>\r\n <input matInput [type]=\"hide ? 'password' : 'text'\" (keyup.enter)=\"enterPressed()\" (change)=\"changed()\" (blur)=\"leaved()\" [(ngModel)]=\"value\" autocomplete=\"off\" [placeholder]=\"placeholder\" [formControl]=\"control\" [required]=\"required\">\r\n <mat-error *ngIf=\"control.invalid\">{{validate(control)}}</mat-error>\r\n <button mat-icon-button matSuffix (click)=\"hide = !hide\" [attr.aria-label]=\"'Hide password'\" [attr.aria-pressed]=\"hide\">\r\n <mat-icon style=\"font-size: 18px;\">{{hide ? 'visibility_off' : 'visibility'}}</mat-icon>\r\n </button>\r\n</mat-form-field>\r\n\r\n\r\n<!-- TextArea copy - Only change input to textarea and change ngif to not -->\r\n\r\n<mat-form-field *ngIf=\"rows != '' && options.length==0\" hideRequiredMarker=\"true\" [hintLabel]=\"hint\" [ngStyle]=\"{'width':width}\" style=\"margin-right: 5px;\">\r\n<mat-label>{{display}}</mat-label>\r\n<textarea matInput autocomplete=\"off\" [rows]=\"rows\" [(ngModel)]=\"value\" (change)=\"changed()\" (keyup.enter)=\"enterPressed()\" [placeholder]=\"placeholder\" [formControl]=\"control\" [required]=\"required\" [readonly]=\"readonly\"></textarea>\r\n<mat-error *ngIf=\"control.invalid\">{{validate(control)}}</mat-error>\r\n</mat-form-field>\r\n\r\n\r\n\r\n<!-- Auto Complete-->\r\n\r\n <mat-form-field *ngIf=\"rows == '' && format=='text' && options.length>0 \" [hintLabel]=\"hint\" [ngStyle]=\"{'width':width}\" style=\"margin-right: 5px;\">\r\n <mat-label>{{display}}</mat-label>\r\n <input [type]=\"type\" [placeholder]=\"placeholder\" (change)=\"changed()\" matInput [formControl]=\"myControl\" [matAutocomplete]=\"auto\" [required]=\"required\" [readonly]=\"readonly\">\r\n <mat-error *ngIf=\"control.invalid\">{{validate(myControl)}}</mat-error>\r\n <mat-autocomplete #auto=\"matAutocomplete\" (optionSelected)=\"changed()\">\r\n\r\n <ng-container *ngIf=\"!multiDimension\">\r\n <mat-option *ngFor=\"let option of filteredOptions | async\" [value]=\"option\">\r\n {{option}}\r\n </mat-option>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"multiDimension\">\r\n <mat-option *ngFor=\"let row of filteredOptions | async\" [value]=\"row[optionValue]\">\r\n {{row[optionValue]}}\r\n </mat-option>\r\n </ng-container>\r\n\r\n\r\n </mat-autocomplete>\r\n </mat-form-field>\r\n\r\n" }]
1128
+ }], ctorParameters: function () { return []; }, propDecorators: { readonly: [{
1129
+ type: Input
1130
+ }], hint: [{
1131
+ type: Input
1132
+ }], display: [{
1133
+ type: Input
1134
+ }], placeholder: [{
1135
+ type: Input
1136
+ }], value: [{
1137
+ type: Input
1138
+ }], valueChange: [{
1139
+ type: Output
1140
+ }], format: [{
1141
+ type: Input
1142
+ }], type: [{
1143
+ type: Input
1144
+ }], leave: [{
1145
+ type: Output
1146
+ }], enterPress: [{
1147
+ type: Output
1148
+ }], rows: [{
1149
+ type: Input
1150
+ }], width: [{
1151
+ type: Input
1152
+ }], options: [{
1153
+ type: Input
1154
+ }], optionValue: [{
1155
+ type: Input
1156
+ }], required: [{
1157
+ type: Input
1158
+ }], min: [{
1159
+ type: Input
1160
+ }], max: [{
1161
+ type: Input
1162
+ }], regex: [{
1163
+ type: Input
1164
+ }] } });
1165
+
1166
+ class CheckComponent {
1167
+ constructor() {
1168
+ this.readonly = false;
1169
+ this.display = "";
1170
+ this.value = false;
1171
+ this.valueChange = new EventEmitter();
1172
+ this.click = new EventEmitter();
1173
+ this.check = new EventEmitter();
1174
+ this.uncheck = new EventEmitter();
1175
+ }
1176
+ ngOnInit() {
1177
+ }
1178
+ changed() {
1179
+ this.valueChange.emit(this.value);
1180
+ }
1181
+ clicked() {
1182
+ this.click.emit();
1183
+ if (!this.value) {
1184
+ this.checked();
1185
+ }
1186
+ else {
1187
+ this.unchecked();
1188
+ }
1189
+ }
1190
+ checked() {
1191
+ this.check.emit();
1192
+ }
1193
+ unchecked() {
1194
+ this.uncheck.emit();
1195
+ }
1196
+ }
1197
+ CheckComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CheckComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1198
+ CheckComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: CheckComponent, selector: "spa-check", inputs: { readonly: "readonly", display: "display", value: "value" }, outputs: { valueChange: "valueChange", click: "click", check: "check", uncheck: "uncheck" }, ngImport: i0, template: " <mat-checkbox color=\"primary\" style=\"margin-right:50px; font-size:14px\" [(ngModel)]=\"value\" (change)=\"changed()\" (click)=\"clicked()\" [disabled]=\"readonly\">{{display}}</mat-checkbox>\r\n", styles: [""], dependencies: [{ 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: i2$1.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }] });
1199
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CheckComponent, decorators: [{
1200
+ type: Component,
1201
+ args: [{ selector: 'spa-check', template: " <mat-checkbox color=\"primary\" style=\"margin-right:50px; font-size:14px\" [(ngModel)]=\"value\" (change)=\"changed()\" (click)=\"clicked()\" [disabled]=\"readonly\">{{display}}</mat-checkbox>\r\n" }]
1202
+ }], ctorParameters: function () { return []; }, propDecorators: { readonly: [{
1203
+ type: Input
1204
+ }], display: [{
1205
+ type: Input
1206
+ }], value: [{
1207
+ type: Input
1208
+ }], valueChange: [{
1209
+ type: Output
1210
+ }], click: [{
1211
+ type: Output
1212
+ }], check: [{
1213
+ type: Output
1214
+ }], uncheck: [{
1215
+ type: Output
1216
+ }] } });
1217
+
1218
+ class DateComponent {
1219
+ constructor() {
1220
+ this.date = new FormControl(new Date());
1221
+ this.value = Core.nowDate(true);
1222
+ this.display = "";
1223
+ this.readonly = false;
1224
+ this.width = "100%";
1225
+ this.min = "1900-01-01";
1226
+ this.max = "9999-01-01";
1227
+ this.valueChange = new EventEmitter();
1228
+ }
1229
+ ngOnInit() {
1230
+ this.minDate = new FormControl(new Date(this.min));
1231
+ this.maxDate = new FormControl(new Date(this.max));
1232
+ if (!this.value || this.value == "") {
1233
+ this.date = new FormControl(new Date());
1234
+ ;
1235
+ }
1236
+ setTimeout(() => { this.onChangeEvent(); }, 5);
1237
+ if (this.readonly) {
1238
+ this.date.disable();
1239
+ }
1240
+ else {
1241
+ this.date.enable();
1242
+ }
1243
+ }
1244
+ ngOnChanges() {
1245
+ this.date = new FormControl(new Date(this.value));
1246
+ }
1247
+ onChangeEvent() {
1248
+ let d = Core.getFormatedDate2(this.date.value, true);
1249
+ this.valueChange.emit(d);
1250
+ }
1251
+ }
1252
+ DateComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DateComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1253
+ DateComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: DateComponent, selector: "spa-date", inputs: { value: "value", display: "display", readonly: "readonly", width: "width", min: "min", max: "max" }, outputs: { valueChange: "valueChange" }, usesOnChanges: true, ngImport: i0, template: "\r\n<mat-form-field [ngStyle]=\"{'width':width}\">\r\n<input [formControl]=\"date\" [min]=\"minDate.value\" [max]=\"maxDate.value\" matInput [matDatepicker]=\"picker_date\" (dateInput)=\"onChangeEvent()\" [placeholder]=\"display\" [readonly]=\"true\" >\r\n<mat-datepicker-toggle matSuffix [for]=\"picker_date\"></mat-datepicker-toggle>\r\n<mat-datepicker #picker_date></mat-datepicker>\r\n</mat-form-field>\r\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix]" }, { kind: "directive", type: i4$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i5$1.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i5$1.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i5$1.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }] });
1254
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DateComponent, decorators: [{
1255
+ type: Component,
1256
+ args: [{ selector: 'spa-date', template: "\r\n<mat-form-field [ngStyle]=\"{'width':width}\">\r\n<input [formControl]=\"date\" [min]=\"minDate.value\" [max]=\"maxDate.value\" matInput [matDatepicker]=\"picker_date\" (dateInput)=\"onChangeEvent()\" [placeholder]=\"display\" [readonly]=\"true\" >\r\n<mat-datepicker-toggle matSuffix [for]=\"picker_date\"></mat-datepicker-toggle>\r\n<mat-datepicker #picker_date></mat-datepicker>\r\n</mat-form-field>\r\n" }]
1257
+ }], ctorParameters: function () { return []; }, propDecorators: { value: [{
1258
+ type: Input
1259
+ }], display: [{
1260
+ type: Input
1261
+ }], readonly: [{
1262
+ type: Input
1263
+ }], width: [{
1264
+ type: Input
1265
+ }], min: [{
1266
+ type: Input
1267
+ }], max: [{
1268
+ type: Input
1269
+ }], valueChange: [{
1270
+ type: Output
1271
+ }] } });
1272
+
1273
+ class DatetimeComponent {
1274
+ constructor() {
1275
+ this.display = "";
1276
+ this.value = "";
1277
+ this.valueChange = new EventEmitter();
1278
+ this.readonly = false;
1279
+ this.min = "01 jan 1900";
1280
+ this.max = "31 dec 9999";
1281
+ }
1282
+ ngOnInit() {
1283
+ }
1284
+ changed() {
1285
+ this.valueChange.emit(this.value);
1286
+ }
1287
+ }
1288
+ DatetimeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DatetimeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1289
+ DatetimeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: DatetimeComponent, selector: "spa-datetime", inputs: { display: "display", value: "value", readonly: "readonly", min: "min", max: "max" }, outputs: { valueChange: "valueChange" }, ngImport: i0, template: "<mat-form-field >\r\n<mat-label>{{display}}</mat-label>\r\n<input matInput autocomplete=\"off\" type=\"datetime-local\" [(ngModel)]=\"value\" [min]=\"min\" [max]=\"max\" (change)=\"changed()\" [placeholder]=\"display\" [readonly]=\"readonly\" />\r\n</mat-form-field>\r\n", styles: [""], dependencies: [{ kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { 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.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }] });
1290
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DatetimeComponent, decorators: [{
1291
+ type: Component,
1292
+ args: [{ selector: 'spa-datetime', template: "<mat-form-field >\r\n<mat-label>{{display}}</mat-label>\r\n<input matInput autocomplete=\"off\" type=\"datetime-local\" [(ngModel)]=\"value\" [min]=\"min\" [max]=\"max\" (change)=\"changed()\" [placeholder]=\"display\" [readonly]=\"readonly\" />\r\n</mat-form-field>\r\n" }]
1293
+ }], ctorParameters: function () { return []; }, propDecorators: { display: [{
1294
+ type: Input
1295
+ }], value: [{
1296
+ type: Input
1297
+ }], valueChange: [{
1298
+ type: Output
1299
+ }], readonly: [{
1300
+ type: Input
1301
+ }], min: [{
1302
+ type: Input
1303
+ }], max: [{
1304
+ type: Input
1305
+ }] } });
1306
+
1307
+ class LabelComponent {
1308
+ constructor() {
1309
+ this.display = "";
1310
+ this.value = "";
1311
+ this.format = "text";
1312
+ }
1313
+ ngOnInit() {
1314
+ }
1315
+ }
1316
+ LabelComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1317
+ LabelComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: LabelComponent, selector: "spa-label", inputs: { display: "display", value: "value", format: "format" }, ngImport: i0, template: "<div *ngIf=\"format=='text'\">\r\n <label style=\"font-weight: 500\">{{display}}: </label> &nbsp; <label>{{value}} </label> &nbsp;\r\n</div>\r\n\r\n<div *ngIf=\"format=='date'\">\r\n <label style=\"font-weight: 500\">{{display}}: </label> &nbsp; <label>{{value | date:'dd/MM/yyyy'}} </label> &nbsp;\r\n</div>\r\n\r\n<div *ngIf=\"format=='datetime'\">\r\n <label style=\"font-weight: 500\">{{display}}: </label> &nbsp; <label>{{value | date:'dd/MM/yyyy HH:mm'}} </label> &nbsp;\r\n</div>\r\n\r\n<div *ngIf=\"format=='money'\">\r\n <label style=\"font-weight: 500\">{{display}}: </label> &nbsp; <label>{{value | currency:'USD':''}} </label> &nbsp;\r\n</div>\r\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1.CurrencyPipe, name: "currency" }, { kind: "pipe", type: i1.DatePipe, name: "date" }] });
1318
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LabelComponent, decorators: [{
1319
+ type: Component,
1320
+ args: [{ selector: 'spa-label', template: "<div *ngIf=\"format=='text'\">\r\n <label style=\"font-weight: 500\">{{display}}: </label> &nbsp; <label>{{value}} </label> &nbsp;\r\n</div>\r\n\r\n<div *ngIf=\"format=='date'\">\r\n <label style=\"font-weight: 500\">{{display}}: </label> &nbsp; <label>{{value | date:'dd/MM/yyyy'}} </label> &nbsp;\r\n</div>\r\n\r\n<div *ngIf=\"format=='datetime'\">\r\n <label style=\"font-weight: 500\">{{display}}: </label> &nbsp; <label>{{value | date:'dd/MM/yyyy HH:mm'}} </label> &nbsp;\r\n</div>\r\n\r\n<div *ngIf=\"format=='money'\">\r\n <label style=\"font-weight: 500\">{{display}}: </label> &nbsp; <label>{{value | currency:'USD':''}} </label> &nbsp;\r\n</div>\r\n" }]
1321
+ }], ctorParameters: function () { return []; }, propDecorators: { display: [{
1322
+ type: Input
1323
+ }], value: [{
1324
+ type: Input
1325
+ }], format: [{
1326
+ type: Input
1327
+ }] } });
1328
+
1329
+ class SelectComponent {
1330
+ constructor() {
1331
+ this.width = "100%";
1332
+ this.readonly = false;
1333
+ this.readonlyMode = "";
1334
+ this.hint = "";
1335
+ this.placeholder = "";
1336
+ this.multiple = false;
1337
+ this.display = "";
1338
+ this.optionValue = "";
1339
+ this.optionDisplay = "";
1340
+ this.optionDisplayExtra = "";
1341
+ this.valueChange = new EventEmitter();
1342
+ }
1343
+ ngOnInit() {
1344
+ // this.displayValue = this.options.filter((m) => m.optionValue == this.value)
1345
+ // this.displayValue = this.value
1346
+ if (this.placeholder == "") {
1347
+ this.placeholder = "Select " + this.display;
1348
+ }
1349
+ }
1350
+ ngOnChanges() {
1351
+ if (this.readonlyMode != "" && this.options.length > 0) {
1352
+ this.displayValue = this.options.filter((m) => m[`${this.optionValue}`] == this.value)[0][`${this.optionDisplay}`];
1353
+ }
1354
+ }
1355
+ changed() {
1356
+ // let v;
1357
+ // v = Core.isNumber(this.value) ? Number(this.value) : this.value;
1358
+ this.valueChange.emit(this.value);
1359
+ }
1360
+ }
1361
+ SelectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1362
+ SelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: SelectComponent, selector: "spa-select", inputs: { width: "width", readonly: "readonly", readonlyMode: "readonlyMode", hint: "hint", placeholder: "placeholder", multiple: "multiple", display: "display", value: "value", options: "options", optionValue: "optionValue", optionDisplay: "optionDisplay", optionDisplayExtra: "optionDisplayExtra" }, outputs: { valueChange: "valueChange" }, usesOnChanges: true, ngImport: i0, template: "\r\n<mat-form-field *ngIf=\"readonlyMode==''\" floatLabel=\"always\" [ngStyle]=\"{'width':width}\">\r\n <mat-label>{{display}}</mat-label>\r\n <mat-select [(value)]=\"value\" (selectionChange)=\"changed()\" [multiple]=\"multiple\" [disabled]=\"readonly\" [placeholder]=\"placeholder\" >\r\n <mat-option *ngFor=\"let row of options\" [value]=\"row[optionValue]\">\r\n {{row[optionDisplay]}} <label *ngIf=\"optionDisplayExtra!='' && row[optionDisplayExtra] && row[optionDisplayExtra] != ''\">({{row[optionDisplayExtra]}})</label>\r\n </mat-option>\r\n </mat-select>\r\n <mat-hint *ngIf=\"hint!=''\">{{hint}}</mat-hint>\r\n</mat-form-field>\r\n\r\n<!-- ReadOnlyModes original, text, label -->\r\n<!-- <spa-text *ngIf=\"readonlyMode=='text' && readonly\" [display]=\"display\" [(value)]=\"displayValue\" [readonly]=\"true\" ></spa-text> -->\r\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "component", type: i3$2.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "component", type: i7.MatOption, selector: "mat-option", exportAs: ["matOption"] }] });
1363
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SelectComponent, decorators: [{
1364
+ type: Component,
1365
+ args: [{ selector: 'spa-select', template: "\r\n<mat-form-field *ngIf=\"readonlyMode==''\" floatLabel=\"always\" [ngStyle]=\"{'width':width}\">\r\n <mat-label>{{display}}</mat-label>\r\n <mat-select [(value)]=\"value\" (selectionChange)=\"changed()\" [multiple]=\"multiple\" [disabled]=\"readonly\" [placeholder]=\"placeholder\" >\r\n <mat-option *ngFor=\"let row of options\" [value]=\"row[optionValue]\">\r\n {{row[optionDisplay]}} <label *ngIf=\"optionDisplayExtra!='' && row[optionDisplayExtra] && row[optionDisplayExtra] != ''\">({{row[optionDisplayExtra]}})</label>\r\n </mat-option>\r\n </mat-select>\r\n <mat-hint *ngIf=\"hint!=''\">{{hint}}</mat-hint>\r\n</mat-form-field>\r\n\r\n<!-- ReadOnlyModes original, text, label -->\r\n<!-- <spa-text *ngIf=\"readonlyMode=='text' && readonly\" [display]=\"display\" [(value)]=\"displayValue\" [readonly]=\"true\" ></spa-text> -->\r\n" }]
1366
+ }], ctorParameters: function () { return []; }, propDecorators: { width: [{
1367
+ type: Input
1368
+ }], readonly: [{
1369
+ type: Input
1370
+ }], readonlyMode: [{
1371
+ type: Input
1372
+ }], hint: [{
1373
+ type: Input
1374
+ }], placeholder: [{
1375
+ type: Input
1376
+ }], multiple: [{
1377
+ type: Input
1378
+ }], display: [{
1379
+ type: Input
1380
+ }], value: [{
1381
+ type: Input
1382
+ }], options: [{
1383
+ type: Input
1384
+ }], optionValue: [{
1385
+ type: Input
1386
+ }], optionDisplay: [{
1387
+ type: Input
1388
+ }], optionDisplayExtra: [{
1389
+ type: Input
1390
+ }], valueChange: [{
1391
+ type: Output
1392
+ }] } });
1393
+
1394
+ class ActivityComponent {
1395
+ constructor() {
1396
+ this.notes = new Array();
1397
+ this.notesMessage = "Empty";
1398
+ this.title = "Notes";
1399
+ }
1400
+ ngOnInit() {
1401
+ }
1402
+ }
1403
+ ActivityComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ActivityComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1404
+ ActivityComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ActivityComponent, selector: "spa-activity", inputs: { notes: "notes", title: "title" }, ngImport: i0, template: "\r\n <div class=\"tin-input-row mt-3\" *ngIf=\"title != ''\">\r\n <mat-label style=\"font-size: 20px; font-weight: 300\" > {{title}}</mat-label >\r\n </div>\r\n\r\n <ul *ngIf=\"notes && notes.length>0\" class=\"list-group list-group-flush\" style=\"max-height:350px; margin-left:5px\">\r\n\r\n <li *ngFor=\"let note of notes\" class=\"list-group-item list-group-item-action flex-column align-items-start\">\r\n <div class=\"d-flex w-100 justify-content-between\">\r\n <div class=\"mb-0\">{{note.createdByName}}</div>\r\n <!-- <small class=\"text-muted\">{{note.expr1}} ago</small> -->\r\n </div>\r\n\r\n <small>{{note.details}} (<em>{{note.createdDate | date: 'dd MMM yyyy HH:mm'}}</em>) </small>\r\n </li>\r\n\r\n\r\n </ul>\r\n\r\n <div *ngIf=\"notes && notes.length==0\" class=\"d-flex justify-content-center row align-items-center\" style=\"max-height:200px\">\r\n\r\n No {{title.toLowerCase()}}\r\n\r\n </div>\r\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "pipe", type: i1.DatePipe, name: "date" }] });
1405
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ActivityComponent, decorators: [{
1406
+ type: Component,
1407
+ args: [{ selector: 'spa-activity', template: "\r\n <div class=\"tin-input-row mt-3\" *ngIf=\"title != ''\">\r\n <mat-label style=\"font-size: 20px; font-weight: 300\" > {{title}}</mat-label >\r\n </div>\r\n\r\n <ul *ngIf=\"notes && notes.length>0\" class=\"list-group list-group-flush\" style=\"max-height:350px; margin-left:5px\">\r\n\r\n <li *ngFor=\"let note of notes\" class=\"list-group-item list-group-item-action flex-column align-items-start\">\r\n <div class=\"d-flex w-100 justify-content-between\">\r\n <div class=\"mb-0\">{{note.createdByName}}</div>\r\n <!-- <small class=\"text-muted\">{{note.expr1}} ago</small> -->\r\n </div>\r\n\r\n <small>{{note.details}} (<em>{{note.createdDate | date: 'dd MMM yyyy HH:mm'}}</em>) </small>\r\n </li>\r\n\r\n\r\n </ul>\r\n\r\n <div *ngIf=\"notes && notes.length==0\" class=\"d-flex justify-content-center row align-items-center\" style=\"max-height:200px\">\r\n\r\n No {{title.toLowerCase()}}\r\n\r\n </div>\r\n" }]
1408
+ }], ctorParameters: function () { return []; }, propDecorators: { notes: [{
1409
+ type: Input
1410
+ }], title: [{
1411
+ type: Input
1412
+ }] } });
1413
+
1414
+ class FilterComponent {
1415
+ constructor() {
1416
+ this.data = new MatTableDataSource();
1417
+ this.refreshClick = new EventEmitter();
1418
+ this._filterText = "";
1419
+ }
1420
+ ngOnInit() {
1421
+ }
1422
+ ngOnChanges() {
1423
+ // console.log("OnChange")
1424
+ this.applyFilter(this._filterText);
1425
+ }
1426
+ ;
1427
+ keyUp(event) {
1428
+ let text = event.target['value'];
1429
+ this.applyFilter(text);
1430
+ }
1431
+ applyFilter(filterValue) {
1432
+ if (this.data) {
1433
+ this.data.filter = filterValue.trim().toLowerCase();
1434
+ }
1435
+ }
1436
+ refreshClicked() {
1437
+ this.refreshClick.emit();
1438
+ }
1439
+ }
1440
+ FilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1441
+ FilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: FilterComponent, selector: "spa-filter", inputs: { data: "data" }, outputs: { refreshClick: "refreshClick" }, usesOnChanges: true, ngImport: i0, template: "<mat-form-field >\r\n <mat-label>Filter</mat-label>\r\n <input id=\"txtFilter\" matInput [(ngModel)]=\"_filterText\" (keyup)=\"keyUp($event)\" placeholder=\"Enter Filter text\" autocomplete=\"off\">\r\n</mat-form-field>\r\n\r\n<button id=\"btnFilter\" mat-mini-fab color=\"primary\" matTooltip=\"Refresh Data\" matTooltipPosition=\"above\" (click)=\"refreshClicked()\" style=\"margin-right:1em;margin-top:5px\">\r\n <mat-icon class=\"refreshIcon\">cached</mat-icon>\r\n</button>\r\n", styles: [".mat-mini-fab{width:32px;height:32px}.mat-mini-fab mat-icon{font-size:16px;margin-top:-3px}.refreshIcon{font-size:22px!important;margin-top:-7px!important}\n"], dependencies: [{ kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { 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: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i6.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }] });
1442
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FilterComponent, decorators: [{
1443
+ type: Component,
1444
+ args: [{ selector: 'spa-filter', template: "<mat-form-field >\r\n <mat-label>Filter</mat-label>\r\n <input id=\"txtFilter\" matInput [(ngModel)]=\"_filterText\" (keyup)=\"keyUp($event)\" placeholder=\"Enter Filter text\" autocomplete=\"off\">\r\n</mat-form-field>\r\n\r\n<button id=\"btnFilter\" mat-mini-fab color=\"primary\" matTooltip=\"Refresh Data\" matTooltipPosition=\"above\" (click)=\"refreshClicked()\" style=\"margin-right:1em;margin-top:5px\">\r\n <mat-icon class=\"refreshIcon\">cached</mat-icon>\r\n</button>\r\n", styles: [".mat-mini-fab{width:32px;height:32px}.mat-mini-fab mat-icon{font-size:16px;margin-top:-3px}.refreshIcon{font-size:22px!important;margin-top:-7px!important}\n"] }]
1445
+ }], ctorParameters: function () { return []; }, propDecorators: { data: [{
1446
+ type: Input
1447
+ }], refreshClick: [{
1448
+ type: Output
1449
+ }] } });
1450
+
1451
+ const CURRENCY_INPUT_MASK_DIRECTIVE_VALUE_ACCESSOR = {
1452
+ provide: NG_VALUE_ACCESSOR,
1453
+ useExisting: forwardRef(() => CurrencyInputMaskDirective),
1454
+ multi: true
1455
+ };
1456
+ class CurrencyInputMaskDirective {
1457
+ constructor(elementRef, decimalPipe) {
1458
+ this.elementRef = elementRef;
1459
+ this.decimalPipe = decimalPipe;
1460
+ this.DECIMAL_MARK = '.';
1461
+ }
1462
+ ngOnInit() {
1463
+ this.el = this.elementRef.nativeElement;
1464
+ }
1465
+ handleFocus(event) {
1466
+ const strVal = this.getInputValue();
1467
+ const unmaskedStr = this.getUnmaskedValue(strVal);
1468
+ this.updateInputValue(unmaskedStr);
1469
+ }
1470
+ handleCut(event) {
1471
+ setTimeout(() => {
1472
+ this.inputUpdated();
1473
+ }, 0);
1474
+ }
1475
+ handleKeypress(event) {
1476
+ // Restrict characters
1477
+ const newChar = String.fromCharCode(event.which);
1478
+ const allowedChars = /^[\d.]+$/;
1479
+ if (!allowedChars.test(newChar)) {
1480
+ event.preventDefault();
1481
+ return;
1482
+ }
1483
+ // Handle decimal mark input
1484
+ const currentValue = event.target.value;
1485
+ const separatorIdx = currentValue.indexOf(this.DECIMAL_MARK);
1486
+ const hasFractionalPart = (separatorIdx >= 0);
1487
+ if (!hasFractionalPart || newChar !== this.DECIMAL_MARK) {
1488
+ return;
1489
+ }
1490
+ const isOutsideSelection = !this.isIdxBetweenSelection(separatorIdx);
1491
+ if (isOutsideSelection) {
1492
+ const positionAfterMark = separatorIdx + 1;
1493
+ this.setCursorPosition(positionAfterMark);
1494
+ event.preventDefault();
1495
+ return;
1496
+ }
1497
+ }
1498
+ handleInput(event) {
1499
+ this.inputUpdated();
1500
+ }
1501
+ handlePaste(event) {
1502
+ setTimeout(() => {
1503
+ this.inputUpdated();
1504
+ }, 1);
1505
+ }
1506
+ handleBlur(event) {
1507
+ const strVal = this.getInputValue();
1508
+ const numVal = this.convertStrToDecimal(strVal);
1509
+ this.maskInput(numVal);
1510
+ this.onModelTouched.apply(event);
1511
+ }
1512
+ registerOnChange(callbackFunction) {
1513
+ this.onModelChange = callbackFunction;
1514
+ }
1515
+ registerOnTouched(callbackFunction) {
1516
+ this.onModelTouched = callbackFunction;
1517
+ }
1518
+ setDisabledState(value) {
1519
+ this.el.disabled = value;
1520
+ }
1521
+ writeValue(numValue) {
1522
+ this.maskInput(numValue);
1523
+ }
1524
+ maskInput(numVal) {
1525
+ if (!this.isNumeric(numVal)) {
1526
+ this.updateInputValue('');
1527
+ return;
1528
+ }
1529
+ const strVal = this.convertDecimalToStr(numVal);
1530
+ const newVal = this.transformWithPipe(strVal);
1531
+ this.updateInputValue(newVal);
1532
+ }
1533
+ inputUpdated() {
1534
+ this.restrictDecimalValue();
1535
+ const strVal = this.getInputValue();
1536
+ const unmaskedVal = this.getUnmaskedValue(strVal);
1537
+ const numVal = this.convertStrToDecimal(unmaskedVal);
1538
+ if (numVal !== this.lastNumVal) {
1539
+ this.lastNumVal = numVal;
1540
+ this.onModelChange(numVal);
1541
+ }
1542
+ }
1543
+ restrictDecimalValue() {
1544
+ const strVal = this.getInputValue();
1545
+ const dotIdx = strVal.indexOf(this.DECIMAL_MARK);
1546
+ const hasFractionalPart = (dotIdx >= 0);
1547
+ if (hasFractionalPart) {
1548
+ const fractionalPart = strVal.substring(dotIdx + 1);
1549
+ if (fractionalPart.length > 2) {
1550
+ const choppedVal = strVal.substring(0, dotIdx + 3);
1551
+ this.updateInputValue(choppedVal, true);
1552
+ return;
1553
+ }
1554
+ }
1555
+ }
1556
+ transformWithPipe(str) {
1557
+ return this.decimalPipe.transform(str, '1.2-2');
1558
+ }
1559
+ getUnmaskedValue(value) {
1560
+ return value.replace(/[^-\d\\.]/g, '');
1561
+ }
1562
+ updateInputValue(value, savePosition = false) {
1563
+ if (savePosition) {
1564
+ this.saveCursorPosition();
1565
+ }
1566
+ this.el.value = value;
1567
+ }
1568
+ getInputValue() {
1569
+ return this.el.value;
1570
+ }
1571
+ convertStrToDecimal(str) {
1572
+ return (this.isNumeric(str)) ? parseFloat(str) : null;
1573
+ }
1574
+ convertDecimalToStr(n) {
1575
+ return (this.isNumeric(n)) ? n + '' : '';
1576
+ }
1577
+ isNumeric(n) {
1578
+ return !isNaN(parseFloat(n)) && isFinite(n);
1579
+ }
1580
+ saveCursorPosition() {
1581
+ const position = this.el.selectionStart;
1582
+ setTimeout(() => {
1583
+ this.setCursorPosition(position);
1584
+ }, 1);
1585
+ }
1586
+ setCursorPosition(position) {
1587
+ this.el.selectionStart = position;
1588
+ this.el.selectionEnd = position;
1589
+ }
1590
+ isIdxBetweenSelection(idx) {
1591
+ if (this.el.selectionStart === this.el.selectionEnd) {
1592
+ return false;
1593
+ }
1594
+ return (idx >= this.el.selectionStart && idx < this.el.selectionEnd);
1595
+ }
1596
+ }
1597
+ CurrencyInputMaskDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CurrencyInputMaskDirective, deps: [{ token: i0.ElementRef }, { token: i1.DecimalPipe }], target: i0.ɵɵFactoryTarget.Directive });
1598
+ CurrencyInputMaskDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.3.0", type: CurrencyInputMaskDirective, selector: "[appCurrencyInputMask]", host: { listeners: { "focus": "handleFocus($event)", "cut": "handleCut($event)", "keypress": "handleKeypress($event)", "input": "handleInput($event)", "paste": "handlePaste($event)", "blur": "handleBlur($event)" } }, providers: [
1599
+ CURRENCY_INPUT_MASK_DIRECTIVE_VALUE_ACCESSOR,
1600
+ DecimalPipe
1601
+ ], ngImport: i0 });
1602
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CurrencyInputMaskDirective, decorators: [{
1603
+ type: Directive,
1604
+ args: [{
1605
+ selector: '[appCurrencyInputMask]',
1606
+ providers: [
1607
+ CURRENCY_INPUT_MASK_DIRECTIVE_VALUE_ACCESSOR,
1608
+ DecimalPipe
1609
+ ]
1610
+ }]
1611
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.DecimalPipe }]; }, propDecorators: { handleFocus: [{
1612
+ type: HostListener,
1613
+ args: ['focus', ['$event']]
1614
+ }], handleCut: [{
1615
+ type: HostListener,
1616
+ args: ['cut', ['$event']]
1617
+ }], handleKeypress: [{
1618
+ type: HostListener,
1619
+ args: ['keypress', ['$event']]
1620
+ }], handleInput: [{
1621
+ type: HostListener,
1622
+ args: ['input', ['$event']]
1623
+ }], handlePaste: [{
1624
+ type: HostListener,
1625
+ args: ['paste', ['$event']]
1626
+ }], handleBlur: [{
1627
+ type: HostListener,
1628
+ args: ['blur', ['$event']]
1629
+ }] } });
1630
+
1631
+ class MoneyComponent {
1632
+ constructor() {
1633
+ this.readonly = false;
1634
+ this.display = "";
1635
+ this.value = "";
1636
+ this.placeholder = "";
1637
+ this.valueChange = new EventEmitter();
1638
+ this.enterPress = new EventEmitter();
1639
+ this.leave = new EventEmitter();
1640
+ this.width = "100%";
1641
+ this.hint = "";
1642
+ this.currency = "";
1643
+ }
1644
+ ngOnInit() {
1645
+ if (this.placeholder == "") {
1646
+ this.placeholder = "Enter " + this.display;
1647
+ }
1648
+ }
1649
+ ngOnChanges() {
1650
+ }
1651
+ changed(x) {
1652
+ this.valueChange.emit(x);
1653
+ }
1654
+ enterPressed() {
1655
+ this.enterPress.emit();
1656
+ }
1657
+ leaved() {
1658
+ this.leave.emit();
1659
+ }
1660
+ }
1661
+ MoneyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MoneyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1662
+ MoneyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: MoneyComponent, selector: "spa-money", inputs: { readonly: "readonly", display: "display", value: "value", placeholder: "placeholder", width: "width", hint: "hint", currency: "currency" }, outputs: { valueChange: "valueChange", enterPress: "enterPress", leave: "leave" }, usesOnChanges: true, ngImport: i0, template: "\r\n\r\n<mat-form-field [hintLabel]=\"hint\" [ngStyle]=\"{'width':width}\" hideRequiredMarker=\"true\" style=\"margin-right: 5px;\">\r\n <mat-label>{{display}}</mat-label>\r\n <input matInput appCurrencyInputMask autocomplete=\"off\" style=\"text-align: right;\"\r\n\r\n [ngModel]=\"value\" (ngModelChange)=\"changed($event)\" (keyup.enter)=\"enterPressed()\" (blur)=\"leaved()\" [placeholder]=\"placeholder\" [readonly]=\"readonly\" />\r\n <span *ngIf=\"currency!=''\" matPrefix>{{currency}}&nbsp;</span>\r\n</mat-form-field>\r\n\r\n", styles: ["input.example-right-align{-moz-appearance:textfield}.example-right-align{text-align:right}input.example-right-align::-webkit-outer-spin-button,input.example-right-align::-webkit-inner-spin-button{display:none}.curr{background-color:red}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { 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.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatPrefix, selector: "[matPrefix]" }, { kind: "directive", type: i4$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: CurrencyInputMaskDirective, selector: "[appCurrencyInputMask]" }] });
1663
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MoneyComponent, decorators: [{
1664
+ type: Component,
1665
+ args: [{ selector: 'spa-money', template: "\r\n\r\n<mat-form-field [hintLabel]=\"hint\" [ngStyle]=\"{'width':width}\" hideRequiredMarker=\"true\" style=\"margin-right: 5px;\">\r\n <mat-label>{{display}}</mat-label>\r\n <input matInput appCurrencyInputMask autocomplete=\"off\" style=\"text-align: right;\"\r\n\r\n [ngModel]=\"value\" (ngModelChange)=\"changed($event)\" (keyup.enter)=\"enterPressed()\" (blur)=\"leaved()\" [placeholder]=\"placeholder\" [readonly]=\"readonly\" />\r\n <span *ngIf=\"currency!=''\" matPrefix>{{currency}}&nbsp;</span>\r\n</mat-form-field>\r\n\r\n", styles: ["input.example-right-align{-moz-appearance:textfield}.example-right-align{text-align:right}input.example-right-align::-webkit-outer-spin-button,input.example-right-align::-webkit-inner-spin-button{display:none}.curr{background-color:red}\n"] }]
1666
+ }], ctorParameters: function () { return []; }, propDecorators: { readonly: [{
1667
+ type: Input
1668
+ }], display: [{
1669
+ type: Input
1670
+ }], value: [{
1671
+ type: Input
1672
+ }], placeholder: [{
1673
+ type: Input
1674
+ }], valueChange: [{
1675
+ type: Output
1676
+ }], enterPress: [{
1677
+ type: Output
1678
+ }], leave: [{
1679
+ type: Output
1680
+ }], width: [{
1681
+ type: Input
1682
+ }], hint: [{
1683
+ type: Input
1684
+ }], currency: [{
1685
+ type: Input
1686
+ }] } });
1687
+
1688
+ class OptionComponent {
1689
+ constructor() {
1690
+ this.optionValue = "";
1691
+ this.optionDisplay = "";
1692
+ this.readonly = false;
1693
+ this.value = "";
1694
+ this.display = "";
1695
+ this.show = false;
1696
+ this.valueChange = new EventEmitter();
1697
+ this.enterPress = new EventEmitter();
1698
+ }
1699
+ ngOnInit() {
1700
+ this.OGValue = this.value;
1701
+ }
1702
+ changed() {
1703
+ this.valueChange.emit(this.value);
1704
+ }
1705
+ enterPressed() {
1706
+ this.valueChange.emit();
1707
+ }
1708
+ resetValue() {
1709
+ this.value = this.OGValue;
1710
+ this.changed();
1711
+ }
1712
+ }
1713
+ OptionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: OptionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1714
+ OptionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: OptionComponent, selector: "spa-option", inputs: { options: "options", optionValue: "optionValue", optionDisplay: "optionDisplay", readonly: "readonly", value: "value", display: "display", show: "show" }, outputs: { valueChange: "valueChange", enterPress: "enterPress" }, ngImport: i0, template: "\r\n<mat-checkbox color=\"primary\" style=\"margin-right:5px\" [(ngModel)]=\"show\" (change)=\"resetValue()\" labelPosition=\"after\">{{display}}</mat-checkbox>\r\n\r\n\r\n<mat-form-field style=\"margin-right:10px;width: 0px;\" >\r\n<input matInput />\r\n</mat-form-field>\r\n\r\n\r\n<mat-form-field style=\"margin-right:30px\" *ngIf=\"show && !options\">\r\n<mat-label>{{display}}</mat-label>\r\n<input matInput [(ngModel)]=\"value\" width=\"100\" (change)=\"changed()\" (keyup.enter)=\"changed()\" [placeholder]=\"'Enter ' + display\" autocomplete=\"off\" />\r\n</mat-form-field>\r\n\r\n\r\n<mat-form-field style=\"margin-right: 20px;\" floatLabel=\"always\" width=\"100\" *ngIf=\"show && options\">\r\n <mat-label>{{display}}</mat-label>\r\n <mat-select [(value)]=\"value\" (selectionChange)=\"changed()\" [placeholder]=\"'Select ' + display\" [disabled]=\"readonly\" >\r\n <mat-option *ngFor=\"let row of options\" [value]=\"row[optionValue]\">\r\n {{row[optionDisplay]}}\r\n </mat-option>\r\n </mat-select>\r\n</mat-form-field>\r\n\r\n<!-- <spa-text *ngIf=\"show\" style=\"margin-right:30px\" [display]=\"'Enter ' + display\" (enterPress)=\"enterPressed()\" (valueChange)=\"changed($event.target.value)\" width=\"100\" [required]=\"false\" [(value)]=\"value\" ></spa-text> -->\r\n\r\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { 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: i2$1.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i3$2.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "component", type: i7.MatOption, selector: "mat-option", exportAs: ["matOption"] }] });
1715
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: OptionComponent, decorators: [{
1716
+ type: Component,
1717
+ args: [{ selector: 'spa-option', template: "\r\n<mat-checkbox color=\"primary\" style=\"margin-right:5px\" [(ngModel)]=\"show\" (change)=\"resetValue()\" labelPosition=\"after\">{{display}}</mat-checkbox>\r\n\r\n\r\n<mat-form-field style=\"margin-right:10px;width: 0px;\" >\r\n<input matInput />\r\n</mat-form-field>\r\n\r\n\r\n<mat-form-field style=\"margin-right:30px\" *ngIf=\"show && !options\">\r\n<mat-label>{{display}}</mat-label>\r\n<input matInput [(ngModel)]=\"value\" width=\"100\" (change)=\"changed()\" (keyup.enter)=\"changed()\" [placeholder]=\"'Enter ' + display\" autocomplete=\"off\" />\r\n</mat-form-field>\r\n\r\n\r\n<mat-form-field style=\"margin-right: 20px;\" floatLabel=\"always\" width=\"100\" *ngIf=\"show && options\">\r\n <mat-label>{{display}}</mat-label>\r\n <mat-select [(value)]=\"value\" (selectionChange)=\"changed()\" [placeholder]=\"'Select ' + display\" [disabled]=\"readonly\" >\r\n <mat-option *ngFor=\"let row of options\" [value]=\"row[optionValue]\">\r\n {{row[optionDisplay]}}\r\n </mat-option>\r\n </mat-select>\r\n</mat-form-field>\r\n\r\n<!-- <spa-text *ngIf=\"show\" style=\"margin-right:30px\" [display]=\"'Enter ' + display\" (enterPress)=\"enterPressed()\" (valueChange)=\"changed($event.target.value)\" width=\"100\" [required]=\"false\" [(value)]=\"value\" ></spa-text> -->\r\n\r\n" }]
1718
+ }], ctorParameters: function () { return []; }, propDecorators: { options: [{
1719
+ type: Input
1720
+ }], optionValue: [{
1721
+ type: Input
1722
+ }], optionDisplay: [{
1723
+ type: Input
1724
+ }], readonly: [{
1725
+ type: Input
1726
+ }], value: [{
1727
+ type: Input
1728
+ }], display: [{
1729
+ type: Input
1730
+ }], show: [{
1731
+ type: Input
1732
+ }], valueChange: [{
1733
+ type: Output
1734
+ }], enterPress: [{
1735
+ type: Output
1736
+ }] } });
1737
+
1738
+ class TilesComponent {
1739
+ constructor() {
1740
+ this.clickable = false;
1741
+ this.tileClick = new EventEmitter();
1742
+ this.selected = "";
1743
+ }
1744
+ ngOnInit() {
1745
+ }
1746
+ clicked(v) {
1747
+ if (!this.clickable)
1748
+ return;
1749
+ if (this.selected == v.tileName) {
1750
+ this.tileClick.emit("");
1751
+ this.selected = "";
1752
+ }
1753
+ else {
1754
+ this.tileClick.emit(v.tileName);
1755
+ this.selected = v.tileName;
1756
+ }
1757
+ }
1758
+ }
1759
+ TilesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TilesComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1760
+ TilesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: TilesComponent, selector: "spa-tiles", inputs: { tiles: "tiles", clickable: "clickable" }, outputs: { tileClick: "tileClick" }, ngImport: i0, template: " <div class=\"row align-items-center\">\r\n\r\n <!-- <div class=\"col\" *ngFor=\"let row of tiles\" >\r\n\r\n <mat-card *ngIf=\"row.visible\">\r\n <div class=\"row d-flex justify-content-center\">\r\n\r\n <mat-label style=\"font-size:30px;font-weight:bold\" [ngStyle]=\"{'color':row.tileColor}\">{{row.tileValue}}</mat-label>\r\n\r\n </div>\r\n\r\n <div class=\"row d-flex justify-content-center\">\r\n\r\n <mat-label [ngStyle]=\"{'color':row.selected == true ? 'darkorange' : 'black' }\" style=\"font-size:12px;padding-left:5px;padding-right:5px\">{{row.tileName}}</mat-label>\r\n <mat-icon style=\"font-size: 17px; color:steelblue;\">info</mat-icon>\r\n\r\n </div>\r\n </mat-card>\r\n\r\n </div> -->\r\n\r\n <ng-container *ngFor=\"let row of tiles\">\r\n\r\n <mat-card class=\"col\" style=\"margin-left: 10px;margin-right: 10px\" *ngIf=\"row.visible\" (click)=\"clicked(row)\">\r\n\r\n <div class=\"row d-flex justify-content-center\">\r\n\r\n <mat-label style=\"font-weight:bold\" [ngStyle]=\"{'color':row.tileColor,'font-size':row.tileName == selected ? '35px' : '30px' }\">{{row.tileValue}}</mat-label>\r\n\r\n </div>\r\n\r\n <div class=\"row d-flex justify-content-center row align-items-center\">\r\n\r\n <mat-label [ngStyle]=\"{'font-size':row.tileName == selected ? '18px' : '12px' }\" style=\"padding-left:5px;padding-right:5px\">{{row.tileName}}</mat-label>\r\n <mat-icon [matTooltip]=\"row.info\" matTooltipPosition=\"above\" [ngStyle]=\"{'font-size':row.tileName == selected ? '20px' : '17px' }\" style=\" color:steelblue;\">info</mat-icon>\r\n\r\n </div>\r\n\r\n </mat-card>\r\n\r\n\r\n </ng-container>\r\n\r\n </div>\r\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "component", type: i14.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { kind: "directive", type: i6.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }] });
1761
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TilesComponent, decorators: [{
1762
+ type: Component,
1763
+ args: [{ selector: 'spa-tiles', template: " <div class=\"row align-items-center\">\r\n\r\n <!-- <div class=\"col\" *ngFor=\"let row of tiles\" >\r\n\r\n <mat-card *ngIf=\"row.visible\">\r\n <div class=\"row d-flex justify-content-center\">\r\n\r\n <mat-label style=\"font-size:30px;font-weight:bold\" [ngStyle]=\"{'color':row.tileColor}\">{{row.tileValue}}</mat-label>\r\n\r\n </div>\r\n\r\n <div class=\"row d-flex justify-content-center\">\r\n\r\n <mat-label [ngStyle]=\"{'color':row.selected == true ? 'darkorange' : 'black' }\" style=\"font-size:12px;padding-left:5px;padding-right:5px\">{{row.tileName}}</mat-label>\r\n <mat-icon style=\"font-size: 17px; color:steelblue;\">info</mat-icon>\r\n\r\n </div>\r\n </mat-card>\r\n\r\n </div> -->\r\n\r\n <ng-container *ngFor=\"let row of tiles\">\r\n\r\n <mat-card class=\"col\" style=\"margin-left: 10px;margin-right: 10px\" *ngIf=\"row.visible\" (click)=\"clicked(row)\">\r\n\r\n <div class=\"row d-flex justify-content-center\">\r\n\r\n <mat-label style=\"font-weight:bold\" [ngStyle]=\"{'color':row.tileColor,'font-size':row.tileName == selected ? '35px' : '30px' }\">{{row.tileValue}}</mat-label>\r\n\r\n </div>\r\n\r\n <div class=\"row d-flex justify-content-center row align-items-center\">\r\n\r\n <mat-label [ngStyle]=\"{'font-size':row.tileName == selected ? '18px' : '12px' }\" style=\"padding-left:5px;padding-right:5px\">{{row.tileName}}</mat-label>\r\n <mat-icon [matTooltip]=\"row.info\" matTooltipPosition=\"above\" [ngStyle]=\"{'font-size':row.tileName == selected ? '20px' : '17px' }\" style=\" color:steelblue;\">info</mat-icon>\r\n\r\n </div>\r\n\r\n </mat-card>\r\n\r\n\r\n </ng-container>\r\n\r\n </div>\r\n" }]
1764
+ }], ctorParameters: function () { return []; }, propDecorators: { tiles: [{
1765
+ type: Input
1766
+ }], clickable: [{
1767
+ type: Input
1768
+ }], tileClick: [{
1769
+ type: Output
1770
+ }] } });
1771
+
1772
+ class StepsComponent {
1773
+ constructor() {
1774
+ this.value = "";
1775
+ }
1776
+ ngOnInit() {
1777
+ }
1778
+ ngAfterViewInit() {
1779
+ }
1780
+ ngOnChanges() {
1781
+ this.pushSteps();
1782
+ }
1783
+ setStepper() {
1784
+ if (this.value == "")
1785
+ return;
1786
+ this.stepper.selectedIndex = 0;
1787
+ switch (this.value) {
1788
+ case "Draft":
1789
+ this.stepper.selectedIndex = 0;
1790
+ break;
1791
+ case "Head Approval":
1792
+ this.pushStepper(1);
1793
+ break;
1794
+ case "CE Approval":
1795
+ this.pushStepper(2);
1796
+ break;
1797
+ case "Booking":
1798
+ this.pushStepper(3);
1799
+ break;
1800
+ case "BTA Approval":
1801
+ this.pushStepper(4);
1802
+ break;
1803
+ case "Travel":
1804
+ this.pushStepper(5);
1805
+ break;
1806
+ case "BTR Approval":
1807
+ this.pushStepper(6);
1808
+ break;
1809
+ case "Travel Closure":
1810
+ this.pushStepper(7);
1811
+ break;
1812
+ }
1813
+ }
1814
+ pushStepper(count) {
1815
+ for (let index = 0; index < count + 1; index++) {
1816
+ // const element = array[index];
1817
+ this.stepper.selectedIndex = index;
1818
+ }
1819
+ }
1820
+ pushSteps() {
1821
+ if (this.steps.length == 0)
1822
+ return;
1823
+ if (this.value == "")
1824
+ return;
1825
+ this.stepper.selectedIndex = 0;
1826
+ let i = 0;
1827
+ for (let step of this.steps) {
1828
+ if (step.name != this.value) {
1829
+ this.stepper.selectedIndex = i;
1830
+ i++;
1831
+ }
1832
+ else {
1833
+ this.stepper.selectedIndex = i;
1834
+ break;
1835
+ }
1836
+ }
1837
+ }
1838
+ }
1839
+ StepsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: StepsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1840
+ StepsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: StepsComponent, selector: "spa-steps", inputs: { value: "value", steps: "steps" }, providers: [{
1841
+ provide: STEPPER_GLOBAL_OPTIONS, useValue: { displayDefaultIndicatorType: false }
1842
+ }], viewQueries: [{ propertyName: "stepper", first: true, predicate: ["stepper"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "\r\n\r\n\r\n<!-- <mat-horizontal-stepper class=\"test\" labelPosition=\"bottom\" #stepper>\r\n <mat-step [editable]=\"false\" label=\"Draft\"> </mat-step>\r\n <mat-step [editable]=\"false\" label=\"Head Approval\" > </mat-step>\r\n <mat-step [editable]=\"false\" label=\"CE Approval\"> </mat-step>\r\n <mat-step [editable]=\"false\" label=\"Booking\" state=\"booking\"> </mat-step>\r\n <mat-step [editable]=\"false\" label=\"BTA Approval\"> </mat-step>\r\n <mat-step [editable]=\"false\" label=\"Travel\"> </mat-step>\r\n <mat-step [editable]=\"false\" label=\"BTR Approval\"> </mat-step>\r\n <mat-step [editable]=\"false\" label=\"Closure\"> </mat-step>\r\n <ng-template matStepperIcon=\"booking\"> <mat-icon>forum</mat-icon> </ng-template>\r\n</mat-horizontal-stepper> -->\r\n\r\n<mat-horizontal-stepper class=\"transparent\" labelPosition=\"bottom\" #stepper>\r\n\r\n <mat-step *ngFor=\"let row of steps\"\r\n [editable]=\"false\" [label]=\"row.name\">\r\n </mat-step>\r\n\r\n <!-- <ng-template *ngFor=\"let row of steps\"\r\n [matStepperIcon]=\"row.name\"> <mat-icon>{{row.icon}}</mat-icon>\r\n </ng-template> -->\r\n\r\n <!-- <ng-template matStepperIcon=\"booking\">\r\n <mat-icon>call_end</mat-icon>\r\n </ng-template> -->\r\n\r\n <!-- <ng-template ngFor let-xb [ngForOf]=\"steps\" matStepperIcon=\"Booking\"> <mat-icon>forum</mat-icon>\r\n\r\n </ng-template> -->\r\n\r\n</mat-horizontal-stepper>\r\n", styles: [".transparent{background-color:#0000}:host ::ng-deep .mat-step-header{padding:5px!important}:host ::ng-deep .mat-stepper-horizontal-line{min-width:5px!important}:host ::ng-deep .mat-horizontal-content-container{padding:0!important}:host ::ng-deep .mat-horizontal-stepper-header{pointer-events:none!important}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: i2$2.MatStep, selector: "mat-step", inputs: ["color"], exportAs: ["matStep"] }, { kind: "component", type: i2$2.MatStepper, selector: "mat-stepper, mat-vertical-stepper, mat-horizontal-stepper, [matStepper]", inputs: ["selectedIndex", "disableRipple", "color", "labelPosition", "headerPosition", "animationDuration"], outputs: ["animationDone"], exportAs: ["matStepper", "matVerticalStepper", "matHorizontalStepper"] }] });
1843
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: StepsComponent, decorators: [{
1844
+ type: Component,
1845
+ args: [{ selector: 'spa-steps', providers: [{
1846
+ provide: STEPPER_GLOBAL_OPTIONS, useValue: { displayDefaultIndicatorType: false }
1847
+ }], template: "\r\n\r\n\r\n<!-- <mat-horizontal-stepper class=\"test\" labelPosition=\"bottom\" #stepper>\r\n <mat-step [editable]=\"false\" label=\"Draft\"> </mat-step>\r\n <mat-step [editable]=\"false\" label=\"Head Approval\" > </mat-step>\r\n <mat-step [editable]=\"false\" label=\"CE Approval\"> </mat-step>\r\n <mat-step [editable]=\"false\" label=\"Booking\" state=\"booking\"> </mat-step>\r\n <mat-step [editable]=\"false\" label=\"BTA Approval\"> </mat-step>\r\n <mat-step [editable]=\"false\" label=\"Travel\"> </mat-step>\r\n <mat-step [editable]=\"false\" label=\"BTR Approval\"> </mat-step>\r\n <mat-step [editable]=\"false\" label=\"Closure\"> </mat-step>\r\n <ng-template matStepperIcon=\"booking\"> <mat-icon>forum</mat-icon> </ng-template>\r\n</mat-horizontal-stepper> -->\r\n\r\n<mat-horizontal-stepper class=\"transparent\" labelPosition=\"bottom\" #stepper>\r\n\r\n <mat-step *ngFor=\"let row of steps\"\r\n [editable]=\"false\" [label]=\"row.name\">\r\n </mat-step>\r\n\r\n <!-- <ng-template *ngFor=\"let row of steps\"\r\n [matStepperIcon]=\"row.name\"> <mat-icon>{{row.icon}}</mat-icon>\r\n </ng-template> -->\r\n\r\n <!-- <ng-template matStepperIcon=\"booking\">\r\n <mat-icon>call_end</mat-icon>\r\n </ng-template> -->\r\n\r\n <!-- <ng-template ngFor let-xb [ngForOf]=\"steps\" matStepperIcon=\"Booking\"> <mat-icon>forum</mat-icon>\r\n\r\n </ng-template> -->\r\n\r\n</mat-horizontal-stepper>\r\n", styles: [".transparent{background-color:#0000}:host ::ng-deep .mat-step-header{padding:5px!important}:host ::ng-deep .mat-stepper-horizontal-line{min-width:5px!important}:host ::ng-deep .mat-horizontal-content-container{padding:0!important}:host ::ng-deep .mat-horizontal-stepper-header{pointer-events:none!important}\n"] }]
1848
+ }], ctorParameters: function () { return []; }, propDecorators: { stepper: [{
1849
+ type: ViewChild,
1850
+ args: ['stepper']
1851
+ }], value: [{
1852
+ type: Input
1853
+ }], steps: [{
1854
+ type: Input
1855
+ }] } });
1856
+
1857
+ class AttachComponent {
1858
+ constructor() {
1859
+ this.message = "Drag and drop files here";
1860
+ this.files = [];
1861
+ this.filesChange = new EventEmitter();
1862
+ this.upload = new EventEmitter();
1863
+ this.enableUpload = false;
1864
+ }
1865
+ ngOnInit() {
1866
+ }
1867
+ /**
1868
+ * on file drop handler
1869
+ */
1870
+ onFileDropped($event) {
1871
+ this.prepareFilesList($event);
1872
+ }
1873
+ /**
1874
+ * handle file from browsing
1875
+ */
1876
+ fileBrowseHandler(event) {
1877
+ let files = event.target.files;
1878
+ this.prepareFilesList(files);
1879
+ }
1880
+ /**
1881
+ * Delete file from files list
1882
+ * @param index (File index)
1883
+ */
1884
+ deleteFile(index) {
1885
+ this.files.splice(index, 1);
1886
+ }
1887
+ /**
1888
+ * Simulate the upload process
1889
+ */
1890
+ // uploadFilesSimulator(index: number) {
1891
+ // setTimeout(() => {
1892
+ // if (index === this.files.length) {
1893
+ // return;
1894
+ // } else {
1895
+ // const progressInterval = setInterval(() => {
1896
+ // if (this.files[index].progress === 100) {
1897
+ // clearInterval(progressInterval);
1898
+ // this.uploadFilesSimulator(index + 1);
1899
+ // } else {
1900
+ // this.files[index].progress += 5;
1901
+ // }
1902
+ // }, 200);
1903
+ // }
1904
+ // }, 1000);
1905
+ // }
1906
+ /**
1907
+ * Convert Files list to normal array list
1908
+ * @param files (Files List)
1909
+ */
1910
+ prepareFilesList(files) {
1911
+ for (const item of files) {
1912
+ item.progress = 0;
1913
+ this.files.push(item);
1914
+ }
1915
+ // this.uploadFilesSimulator(0);
1916
+ }
1917
+ /**
1918
+ * format bytes
1919
+ * @param bytes (File size in bytes)
1920
+ * @param decimals (Decimals point)
1921
+ */
1922
+ formatBytes(bytes, decimals) {
1923
+ if (bytes === 0) {
1924
+ return '0 Bytes';
1925
+ }
1926
+ const k = 1024;
1927
+ const dm = decimals <= 0 ? 0 : decimals || 2;
1928
+ const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
1929
+ const i = Math.floor(Math.log(bytes) / Math.log(k));
1930
+ return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];
1931
+ }
1932
+ uploaded() {
1933
+ this.upload.emit();
1934
+ }
1935
+ filesChanged() {
1936
+ this.filesChange.emit(this.files);
1937
+ }
1938
+ }
1939
+ AttachComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AttachComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1940
+ AttachComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: AttachComponent, selector: "spa-attach", inputs: { message: "message", files: "files", enableUpload: "enableUpload" }, outputs: { filesChange: "filesChange", upload: "upload" }, ngImport: i0, template: "<div class=\"tin-input-row\" style=\"width: 100%;\">\r\n\r\n <div class=\"col\">\r\n <div class=\"container\" appDnd (fileDropped)=\"onFileDropped($event)\">\r\n <input type=\"file\" #fileDropRef id=\"fileDropRef\" multiple (change)=\"fileBrowseHandler($event)\" />\r\n <h4>{{message}}</h4>\r\n <h4>or</h4>\r\n <label for=\"fileDropRef\">Click to Browse</label>\r\n </div>\r\n </div>\r\n\r\n <div class=\"col\">\r\n <div class=\"files-list \">\r\n <div class=\"single-file \" style=\"width: 100%;\" *ngFor=\"let file of files; let i = index\">\r\n\r\n <div class=\"tin-input-row info\" >\r\n <h4 class=\"name\">\r\n {{ file?.name }}\r\n </h4>\r\n <p class=\"size\">\r\n {{ formatBytes(file?.size, 2) }}\r\n </p>\r\n </div>\r\n\r\n <div class=\"delete\" (click)=\"deleteFile(i)\">\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"14\" height=\"18\" viewBox=\"0 0 14 18\">\r\n <path fill=\"#B1B1B1\" fill-rule=\"nonzero\"\r\n d=\"M1 16c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2H3c-1.1 0-2 .9-2 2v10zm3.17-7.83a.996.996 0 0 1 1.41 0L7 9.59l1.42-1.42a.996.996 0 1 1 1.41 1.41L8.41 11l1.42 1.42a.996.996 0 1 1-1.41 1.41L7 12.41l-1.42 1.42a.996.996 0 1 1-1.41-1.41L5.59 11 4.17 9.58a.996.996 0 0 1 0-1.41zM10.5 1L9.79.29C9.61.11 9.35 0 9.09 0H4.91c-.26 0-.52.11-.7.29L3.5 1H1c-.55 0-1 .45-1 1s.45 1 1 1h12c.55 0 1-.45 1-1s-.45-1-1-1h-2.5z\" />\r\n </svg>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div *ngIf=\"files.length > 0 && enableUpload\" class=\"tin-input-row d-flex justify-content-center\" style=\"width: 100%;\" >\r\n <button mat-button color=\"primary\" (click)=\"uploaded()\" matTooltip=\"Upload New Documents\" matTooltipPosition=\"above\" ><mat-icon>file_upload</mat-icon> Upload</button>\r\n </div>\r\n </div>\r\n\r\n</div>\r\n", styles: [".container{width:100%;height:200px;padding:2rem;text-align:center;border:dashed 2px #2a7b94;position:relative;margin:0 auto}.container input{opacity:0;position:absolute;z-index:2;width:100%;height:100%;top:0;left:0}.container label{color:#fff;width:183px;height:44px;border-radius:21.5px;background-color:#db202f;padding:8px 16px}.container h3{font-size:20px;font-weight:600;color:#38424c}.fileover{animation:shake 1s;animation-iteration-count:infinite}.files-list{margin-top:1.5rem}.files-list .single-file{padding:.5rem;justify-content:space-between;align-items:center;border:dashed 1px #1c824d;margin-bottom:1rem;margin-right:1rem;display:flex;flex-grow:1}.files-list .single-file .delete{display:flex;margin-left:.5rem;cursor:pointer;align-self:flex-end}.files-list .single-file .name{font-size:14px;font-weight:500;color:#353f4a;margin:0}.files-list .single-file .size{font-size:12px;font-weight:500;color:#a4a4a4;margin:0;margin-left:1rem}.files-list .single-file .info{width:100%}@keyframes shake{0%{transform:translate(1px,1px) rotate(0)}10%{transform:translate(-1px,-2px) rotate(-1deg)}20%{transform:translate(-3px) rotate(1deg)}30%{transform:translate(3px,2px) rotate(0)}40%{transform:translate(1px,-1px) rotate(1deg)}50%{transform:translate(-1px,2px) rotate(-1deg)}60%{transform:translate(-3px,1px) rotate(0)}70%{transform:translate(3px,1px) rotate(-1deg)}80%{transform:translate(-1px,-1px) rotate(1deg)}90%{transform:translate(1px,2px) rotate(0)}to{transform:translate(1px,-2px) rotate(-1deg)}}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i6.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }] });
1941
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AttachComponent, decorators: [{
1942
+ type: Component,
1943
+ args: [{ selector: 'spa-attach', template: "<div class=\"tin-input-row\" style=\"width: 100%;\">\r\n\r\n <div class=\"col\">\r\n <div class=\"container\" appDnd (fileDropped)=\"onFileDropped($event)\">\r\n <input type=\"file\" #fileDropRef id=\"fileDropRef\" multiple (change)=\"fileBrowseHandler($event)\" />\r\n <h4>{{message}}</h4>\r\n <h4>or</h4>\r\n <label for=\"fileDropRef\">Click to Browse</label>\r\n </div>\r\n </div>\r\n\r\n <div class=\"col\">\r\n <div class=\"files-list \">\r\n <div class=\"single-file \" style=\"width: 100%;\" *ngFor=\"let file of files; let i = index\">\r\n\r\n <div class=\"tin-input-row info\" >\r\n <h4 class=\"name\">\r\n {{ file?.name }}\r\n </h4>\r\n <p class=\"size\">\r\n {{ formatBytes(file?.size, 2) }}\r\n </p>\r\n </div>\r\n\r\n <div class=\"delete\" (click)=\"deleteFile(i)\">\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"14\" height=\"18\" viewBox=\"0 0 14 18\">\r\n <path fill=\"#B1B1B1\" fill-rule=\"nonzero\"\r\n d=\"M1 16c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2H3c-1.1 0-2 .9-2 2v10zm3.17-7.83a.996.996 0 0 1 1.41 0L7 9.59l1.42-1.42a.996.996 0 1 1 1.41 1.41L8.41 11l1.42 1.42a.996.996 0 1 1-1.41 1.41L7 12.41l-1.42 1.42a.996.996 0 1 1-1.41-1.41L5.59 11 4.17 9.58a.996.996 0 0 1 0-1.41zM10.5 1L9.79.29C9.61.11 9.35 0 9.09 0H4.91c-.26 0-.52.11-.7.29L3.5 1H1c-.55 0-1 .45-1 1s.45 1 1 1h12c.55 0 1-.45 1-1s-.45-1-1-1h-2.5z\" />\r\n </svg>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div *ngIf=\"files.length > 0 && enableUpload\" class=\"tin-input-row d-flex justify-content-center\" style=\"width: 100%;\" >\r\n <button mat-button color=\"primary\" (click)=\"uploaded()\" matTooltip=\"Upload New Documents\" matTooltipPosition=\"above\" ><mat-icon>file_upload</mat-icon> Upload</button>\r\n </div>\r\n </div>\r\n\r\n</div>\r\n", styles: [".container{width:100%;height:200px;padding:2rem;text-align:center;border:dashed 2px #2a7b94;position:relative;margin:0 auto}.container input{opacity:0;position:absolute;z-index:2;width:100%;height:100%;top:0;left:0}.container label{color:#fff;width:183px;height:44px;border-radius:21.5px;background-color:#db202f;padding:8px 16px}.container h3{font-size:20px;font-weight:600;color:#38424c}.fileover{animation:shake 1s;animation-iteration-count:infinite}.files-list{margin-top:1.5rem}.files-list .single-file{padding:.5rem;justify-content:space-between;align-items:center;border:dashed 1px #1c824d;margin-bottom:1rem;margin-right:1rem;display:flex;flex-grow:1}.files-list .single-file .delete{display:flex;margin-left:.5rem;cursor:pointer;align-self:flex-end}.files-list .single-file .name{font-size:14px;font-weight:500;color:#353f4a;margin:0}.files-list .single-file .size{font-size:12px;font-weight:500;color:#a4a4a4;margin:0;margin-left:1rem}.files-list .single-file .info{width:100%}@keyframes shake{0%{transform:translate(1px,1px) rotate(0)}10%{transform:translate(-1px,-2px) rotate(-1deg)}20%{transform:translate(-3px) rotate(1deg)}30%{transform:translate(3px,2px) rotate(0)}40%{transform:translate(1px,-1px) rotate(1deg)}50%{transform:translate(-1px,2px) rotate(-1deg)}60%{transform:translate(-3px,1px) rotate(0)}70%{transform:translate(3px,1px) rotate(-1deg)}80%{transform:translate(-1px,-1px) rotate(1deg)}90%{transform:translate(1px,2px) rotate(0)}to{transform:translate(1px,-2px) rotate(-1deg)}}\n"] }]
1944
+ }], ctorParameters: function () { return []; }, propDecorators: { message: [{
1945
+ type: Input
1946
+ }], files: [{
1947
+ type: Input
1948
+ }], filesChange: [{
1949
+ type: Output
1950
+ }], upload: [{
1951
+ type: Output
1952
+ }], enableUpload: [{
1953
+ type: Input
1954
+ }] } });
1955
+
1956
+ class ChipsComponent {
1957
+ constructor(messageService) {
1958
+ this.messageService = messageService;
1959
+ this.icon = "";
1960
+ this.removable = false;
1961
+ this.addable = false;
1962
+ // @Output() chipClick = new EventEmitter();
1963
+ this.click = new EventEmitter();
1964
+ this.remove = new EventEmitter();
1965
+ }
1966
+ ngOnInit() {
1967
+ }
1968
+ clicked(chip) {
1969
+ if (typeof chip != 'string') {
1970
+ return;
1971
+ }
1972
+ if (chip) {
1973
+ this.click.emit(chip);
1974
+ }
1975
+ }
1976
+ removed(chip) {
1977
+ // const index = this.chips.indexOf(chip);
1978
+ // if (index >= 0) {
1979
+ // this.chips.splice(index, 1);
1980
+ // }
1981
+ this.messageService.confirm(`Remove ${chip} ?`).subscribe((result) => {
1982
+ if (result == "yes") {
1983
+ this.remove.emit(chip);
1984
+ }
1985
+ ;
1986
+ });
1987
+ }
1988
+ }
1989
+ ChipsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ChipsComponent, deps: [{ token: MessageService }], target: i0.ɵɵFactoryTarget.Component });
1990
+ ChipsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ChipsComponent, selector: "spa-chips", inputs: { icon: "icon", removable: "removable", addable: "addable", chips: "chips" }, outputs: { click: "click", remove: "remove" }, ngImport: i0, template: "\r\n\r\n\r\n<div class=\"row mt-1\" style=\"margin-left: 1em;\">\r\n <mat-chip-list #chipList>\r\n <mat-chip *ngFor=\"let chip of chips let i = index\" selectable [removable]=\"removable\" style=\"font-size: 12px;\" [ngStyle]=\"{'padding-right': removable ? '5px':'12px'}\" (click)=\"clicked(chip)\">\r\n <mat-icon *ngIf=\"icon != ''\" color=\"primary\" style=\"font-size: 22px;\">{{icon}}</mat-icon>\r\n\r\n {{chip}}\r\n\r\n <mat-icon *ngIf=\"removable\" style=\"font-size: 20px; margin-left: 5px;margin-top: 3px;margin-right: 0px; color: grey;\" (click)=\"removed(chip)\">cancel</mat-icon>\r\n </mat-chip>\r\n </mat-chip-list>\r\n</div>\r\n\r\n\r\n\r\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i4$2.MatChipList, selector: "mat-chip-list", inputs: ["role", "aria-describedby", "errorStateMatcher", "multiple", "compareWith", "value", "required", "placeholder", "disabled", "aria-orientation", "selectable", "tabIndex"], outputs: ["change", "valueChange"], exportAs: ["matChipList"] }, { kind: "directive", type: i4$2.MatChip, selector: "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]", inputs: ["color", "disableRipple", "tabIndex", "role", "selected", "value", "selectable", "disabled", "removable"], outputs: ["selectionChange", "destroyed", "removed"], exportAs: ["matChip"] }] });
1991
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ChipsComponent, decorators: [{
1992
+ type: Component,
1993
+ args: [{ selector: 'spa-chips', template: "\r\n\r\n\r\n<div class=\"row mt-1\" style=\"margin-left: 1em;\">\r\n <mat-chip-list #chipList>\r\n <mat-chip *ngFor=\"let chip of chips let i = index\" selectable [removable]=\"removable\" style=\"font-size: 12px;\" [ngStyle]=\"{'padding-right': removable ? '5px':'12px'}\" (click)=\"clicked(chip)\">\r\n <mat-icon *ngIf=\"icon != ''\" color=\"primary\" style=\"font-size: 22px;\">{{icon}}</mat-icon>\r\n\r\n {{chip}}\r\n\r\n <mat-icon *ngIf=\"removable\" style=\"font-size: 20px; margin-left: 5px;margin-top: 3px;margin-right: 0px; color: grey;\" (click)=\"removed(chip)\">cancel</mat-icon>\r\n </mat-chip>\r\n </mat-chip-list>\r\n</div>\r\n\r\n\r\n\r\n" }]
1994
+ }], ctorParameters: function () { return [{ type: MessageService }]; }, propDecorators: { icon: [{
1995
+ type: Input
1996
+ }], removable: [{
1997
+ type: Input
1998
+ }], addable: [{
1999
+ type: Input
2000
+ }], chips: [{
2001
+ type: Input
2002
+ }], click: [{
2003
+ type: Output
2004
+ }], remove: [{
2005
+ type: Output
2006
+ }] } });
2007
+
2008
+ class LoaderService {
2009
+ constructor() {
2010
+ this.isLoading = new BehaviorSubject(false);
2011
+ }
2012
+ }
2013
+ LoaderService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LoaderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2014
+ LoaderService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LoaderService, providedIn: 'root' });
2015
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LoaderService, decorators: [{
2016
+ type: Injectable,
2017
+ args: [{
2018
+ providedIn: 'root'
2019
+ }]
2020
+ }], ctorParameters: function () { return []; } });
2021
+
2022
+ class LoaderComponent {
2023
+ constructor(loaderService) {
2024
+ this.loaderService = loaderService;
2025
+ this.logo = "";
2026
+ this.loaderService.isLoading.subscribe((v) => {
2027
+ this.loading = v;
2028
+ });
2029
+ }
2030
+ ngOnInit() {
2031
+ }
2032
+ }
2033
+ LoaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LoaderComponent, deps: [{ token: LoaderService }], target: i0.ɵɵFactoryTarget.Component });
2034
+ LoaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: LoaderComponent, selector: "spa-loader", inputs: { logo: "logo" }, ngImport: i0, template: "<div class=\"progress-loader\" style=\"z-index: 9999;\" [hidden]=\"!loading\">\r\n <div class=\"loading-spinner\">\r\n\r\n <img *ngIf=\"logo==''\" style=\"width: 100px;\"\r\n src=\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNTAgMjUwIj4KICAgIDxwYXRoIGZpbGw9IiNERDAwMzEiIGQ9Ik0xMjUgMzBMMzEuOSA2My4ybDE0LjIgMTIzLjFMMTI1IDIzMGw3OC45LTQzLjcgMTQuMi0xMjMuMXoiIC8+CiAgICA8cGF0aCBmaWxsPSIjQzMwMDJGIiBkPSJNMTI1IDMwdjIyLjItLjFWMjMwbDc4LjktNDMuNyAxNC4yLTEyMy4xTDEyNSAzMHoiIC8+CiAgICA8cGF0aCAgZmlsbD0iI0ZGRkZGRiIgZD0iTTEyNSA1Mi4xTDY2LjggMTgyLjZoMjEuN2wxMS43LTI5LjJoNDkuNGwxMS43IDI5LjJIMTgzTDEyNSA1Mi4xem0xNyA4My4zaC0zNGwxNy00MC45IDE3IDQwLjl6IiAvPgogIDwvc3ZnPg==\"\r\n\r\n >\r\n\r\n <img *ngIf=\"logo!=''\" [src]=\"logo\" style=\"width: 100px;\" />\r\n\r\n\r\n <span id=\"loadingMessage\" class=\"loading-message\">Please wait...</span>\r\n </div>\r\n</div>\r\n", styles: [".loading-spinner{background-color:#0000001f;position:absolute;width:100%;top:0;left:0;height:100vh;align-items:center;justify-content:center;display:grid}.loading-spinner img{align-self:end}.loading-message{text-align:center;align-self:start}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
2035
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LoaderComponent, decorators: [{
2036
+ type: Component,
2037
+ args: [{ selector: 'spa-loader', template: "<div class=\"progress-loader\" style=\"z-index: 9999;\" [hidden]=\"!loading\">\r\n <div class=\"loading-spinner\">\r\n\r\n <img *ngIf=\"logo==''\" style=\"width: 100px;\"\r\n src=\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNTAgMjUwIj4KICAgIDxwYXRoIGZpbGw9IiNERDAwMzEiIGQ9Ik0xMjUgMzBMMzEuOSA2My4ybDE0LjIgMTIzLjFMMTI1IDIzMGw3OC45LTQzLjcgMTQuMi0xMjMuMXoiIC8+CiAgICA8cGF0aCBmaWxsPSIjQzMwMDJGIiBkPSJNMTI1IDMwdjIyLjItLjFWMjMwbDc4LjktNDMuNyAxNC4yLTEyMy4xTDEyNSAzMHoiIC8+CiAgICA8cGF0aCAgZmlsbD0iI0ZGRkZGRiIgZD0iTTEyNSA1Mi4xTDY2LjggMTgyLjZoMjEuN2wxMS43LTI5LjJoNDkuNGwxMS43IDI5LjJIMTgzTDEyNSA1Mi4xem0xNyA4My4zaC0zNGwxNy00MC45IDE3IDQwLjl6IiAvPgogIDwvc3ZnPg==\"\r\n\r\n >\r\n\r\n <img *ngIf=\"logo!=''\" [src]=\"logo\" style=\"width: 100px;\" />\r\n\r\n\r\n <span id=\"loadingMessage\" class=\"loading-message\">Please wait...</span>\r\n </div>\r\n</div>\r\n", styles: [".loading-spinner{background-color:#0000001f;position:absolute;width:100%;top:0;left:0;height:100vh;align-items:center;justify-content:center;display:grid}.loading-spinner img{align-self:end}.loading-message{text-align:center;align-self:start}\n"] }]
2038
+ }], ctorParameters: function () { return [{ type: LoaderService }]; }, propDecorators: { logo: [{
2039
+ type: Input
2040
+ }] } });
2041
+
2042
+ class NavMenuComponent {
2043
+ constructor(router, authService) {
2044
+ this.router = router;
2045
+ this.authService = authService;
2046
+ this.isExpanded = false;
2047
+ this.appConfig = new AppConfig();
2048
+ }
2049
+ ngOnInit() {
2050
+ this.authService.loggedUserFullName.subscribe(user => this.loggedUserFullName = user);
2051
+ this.authService.myRoleObserv.subscribe(rol => this.myRole = rol);
2052
+ this.authService.loggedinObserv.subscribe(obj => this.loggedin = obj);
2053
+ }
2054
+ collapse() {
2055
+ this.isExpanded = false;
2056
+ }
2057
+ toggle() {
2058
+ this.isExpanded = !this.isExpanded;
2059
+ }
2060
+ // logoff() {
2061
+ // // this.authService.updateloggedin(false);
2062
+ // // this.authService.updateRole(new Role());
2063
+ // this.router.navigate(["login"]);
2064
+ // // this.storageService.clear();
2065
+ // }
2066
+ redirectTo(link) {
2067
+ this.collapse();
2068
+ if (link != "") {
2069
+ this.router.navigate([link]);
2070
+ }
2071
+ }
2072
+ }
2073
+ NavMenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NavMenuComponent, deps: [{ token: i1$3.Router }, { token: AuthService }], target: i0.ɵɵFactoryTarget.Component });
2074
+ NavMenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: NavMenuComponent, selector: "spa-nav-menu", inputs: { appConfig: "appConfig" }, ngImport: i0, template: "<header *ngIf=\"loggedin\">\r\n\r\n <nav class=\"toolbar navbar navbar-expand-sm navbar-toggleable-sm navbar-light border-bottom box-shadow mb-3 \" style=\"padding-right: 10px;\">\r\n\r\n <div class=\"container-fluid\" style=\"padding-right: 0px;\">\r\n <!--<a class=\"navbar-brand\" [routerLink]=\"['/']\">Orbit</a>-->\r\n\r\n <img *ngIf=\"appConfig.logo!=''\" [src]=\"appConfig.logo\" style=\"height: 50px; margin-right: 2em\" />\r\n\r\n\r\n <div style=\"font-size: 20px;\">\r\n {{appConfig.appName}}\r\n </div>\r\n\r\n\r\n <button class=\"navbar-toggler\" type=\"button\" data-toggle=\"collapse\" data-target=\".navbar-collapse\" aria-label=\"Toggle navigation\" [attr.aria-expanded]=\"isExpanded\" (click)=\"toggle()\">\r\n <span class=\"navbar-toggler-icon\"></span>\r\n </button>\r\n\r\n <div *ngIf=\"myRole\" class=\"navitems navbar-collapse collapse d-sm-inline-flex flex-sm-row-reverse stack-top\" style=\"margin-right: 0px;\" [ngClass]=\"{ show: isExpanded }\" >\r\n\r\n <button mat-icon-button (click)=\"redirectTo('login')\" class=\"d-none d-sm-block\" style=\"margin-right:2em\"> <mat-icon>logout</mat-icon> </button>\r\n\r\n <button id=\"btnUser\" mat-button [matMenuTriggerFor]=\"profileMenu\" ><mat-icon>account_circle</mat-icon> &nbsp;{{loggedUserFullName}}</button>\r\n\r\n <mat-menu #profileMenu=\"matMenu\">\r\n <button id=\"btnProfile\" mat-menu-item (click)=\"redirectTo('home/user/profile')\" >Profile</button>\r\n <button id=\"btnLogOff\" mat-menu-item (click)=\"redirectTo('login')\">Log Off</button>\r\n </mat-menu>\r\n\r\n <div *ngFor=\"let item of appConfig.capItems\">\r\n\r\n <!-- Menu Item -->\r\n <button id=\"btnMenu\" *ngIf=\"myRole[item.name] && !item.capSubItems && item.showMenu\" mat-button (click)=\"redirectTo(item.link)\">{{item.display}}</button>\r\n\r\n <!-- Menu Item with Sub items ignored -->\r\n <button id=\"btnMenu\" *ngIf=\"myRole[item.name] && item.capSubItems && item.showMenu && item.ignoreSubsDisplay\" mat-button (click)=\"redirectTo(item.link)\">{{item.display}}</button>\r\n\r\n <!-- Menu Item with Sub items to display-->\r\n <button id=\"btnMenu\" *ngIf=\"myRole[item.name] && item.capSubItems && item.showMenu && !item.ignoreSubsDisplay\" mat-button [matMenuTriggerFor]=\"adminMenu\">{{item.display}}</button>\r\n\r\n\r\n <!-- Sub Menu Items -->\r\n <mat-menu #adminMenu=\"matMenu\">\r\n\r\n <div *ngFor=\"let subItem of item.capSubItems\">\r\n\r\n <button *ngIf=\"myRole[subItem.name] && subItem.showMenu\" mat-menu-item (click)=\"redirectTo(subItem.link)\">{{subItem.display}}</button>\r\n\r\n </div>\r\n\r\n </mat-menu>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n\r\n </div>\r\n\r\n </nav>\r\n\r\n</header>\r\n", styles: ["a.navbar-brand{white-space:normal;text-align:center;word-break:break-all}html{font-size:14px}.box-shadow{box-shadow:0 .25rem .75rem #0000000d}.toolbar{height:60px;display:flex;align-items:center;background-color:#03a;color:#fff;font-weight:600}.stack-top{z-index:9;margin:20px}.navitems{background-color:#03a}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4$3.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "component", type: i4$3.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i4$3.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
2075
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NavMenuComponent, decorators: [{
2076
+ type: Component,
2077
+ args: [{ selector: 'spa-nav-menu', template: "<header *ngIf=\"loggedin\">\r\n\r\n <nav class=\"toolbar navbar navbar-expand-sm navbar-toggleable-sm navbar-light border-bottom box-shadow mb-3 \" style=\"padding-right: 10px;\">\r\n\r\n <div class=\"container-fluid\" style=\"padding-right: 0px;\">\r\n <!--<a class=\"navbar-brand\" [routerLink]=\"['/']\">Orbit</a>-->\r\n\r\n <img *ngIf=\"appConfig.logo!=''\" [src]=\"appConfig.logo\" style=\"height: 50px; margin-right: 2em\" />\r\n\r\n\r\n <div style=\"font-size: 20px;\">\r\n {{appConfig.appName}}\r\n </div>\r\n\r\n\r\n <button class=\"navbar-toggler\" type=\"button\" data-toggle=\"collapse\" data-target=\".navbar-collapse\" aria-label=\"Toggle navigation\" [attr.aria-expanded]=\"isExpanded\" (click)=\"toggle()\">\r\n <span class=\"navbar-toggler-icon\"></span>\r\n </button>\r\n\r\n <div *ngIf=\"myRole\" class=\"navitems navbar-collapse collapse d-sm-inline-flex flex-sm-row-reverse stack-top\" style=\"margin-right: 0px;\" [ngClass]=\"{ show: isExpanded }\" >\r\n\r\n <button mat-icon-button (click)=\"redirectTo('login')\" class=\"d-none d-sm-block\" style=\"margin-right:2em\"> <mat-icon>logout</mat-icon> </button>\r\n\r\n <button id=\"btnUser\" mat-button [matMenuTriggerFor]=\"profileMenu\" ><mat-icon>account_circle</mat-icon> &nbsp;{{loggedUserFullName}}</button>\r\n\r\n <mat-menu #profileMenu=\"matMenu\">\r\n <button id=\"btnProfile\" mat-menu-item (click)=\"redirectTo('home/user/profile')\" >Profile</button>\r\n <button id=\"btnLogOff\" mat-menu-item (click)=\"redirectTo('login')\">Log Off</button>\r\n </mat-menu>\r\n\r\n <div *ngFor=\"let item of appConfig.capItems\">\r\n\r\n <!-- Menu Item -->\r\n <button id=\"btnMenu\" *ngIf=\"myRole[item.name] && !item.capSubItems && item.showMenu\" mat-button (click)=\"redirectTo(item.link)\">{{item.display}}</button>\r\n\r\n <!-- Menu Item with Sub items ignored -->\r\n <button id=\"btnMenu\" *ngIf=\"myRole[item.name] && item.capSubItems && item.showMenu && item.ignoreSubsDisplay\" mat-button (click)=\"redirectTo(item.link)\">{{item.display}}</button>\r\n\r\n <!-- Menu Item with Sub items to display-->\r\n <button id=\"btnMenu\" *ngIf=\"myRole[item.name] && item.capSubItems && item.showMenu && !item.ignoreSubsDisplay\" mat-button [matMenuTriggerFor]=\"adminMenu\">{{item.display}}</button>\r\n\r\n\r\n <!-- Sub Menu Items -->\r\n <mat-menu #adminMenu=\"matMenu\">\r\n\r\n <div *ngFor=\"let subItem of item.capSubItems\">\r\n\r\n <button *ngIf=\"myRole[subItem.name] && subItem.showMenu\" mat-menu-item (click)=\"redirectTo(subItem.link)\">{{subItem.display}}</button>\r\n\r\n </div>\r\n\r\n </mat-menu>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n\r\n </div>\r\n\r\n </nav>\r\n\r\n</header>\r\n", styles: ["a.navbar-brand{white-space:normal;text-align:center;word-break:break-all}html{font-size:14px}.box-shadow{box-shadow:0 .25rem .75rem #0000000d}.toolbar{height:60px;display:flex;align-items:center;background-color:#03a;color:#fff;font-weight:600}.stack-top{z-index:9;margin:20px}.navitems{background-color:#03a}\n"] }]
2078
+ }], ctorParameters: function () { return [{ type: i1$3.Router }, { type: AuthService }]; }, propDecorators: { appConfig: [{
2079
+ type: Input
2080
+ }] } });
2081
+
2082
+ class LoaderInterceptor {
2083
+ constructor(loaderService, messageService, authService, router, logService) {
2084
+ this.loaderService = loaderService;
2085
+ this.messageService = messageService;
2086
+ this.authService = authService;
2087
+ this.router = router;
2088
+ this.logService = logService;
2089
+ this.requests = [];
2090
+ }
2091
+ removeRequest(req) {
2092
+ const i = this.requests.indexOf(req);
2093
+ if (i >= 0) {
2094
+ this.requests.splice(i, 1);
2095
+ }
2096
+ this.loaderService.isLoading.next(this.requests.length > 0);
2097
+ }
2098
+ intercept(request, next) {
2099
+ let requestClone = request.clone({
2100
+ setHeaders: {
2101
+ Authorization: "Bearer " + this.authService.tokenSource.value
2102
+ }
2103
+ });
2104
+ this.requests.push(requestClone);
2105
+ if (this.requests.length > 1) {
2106
+ this.logService.info("Multiple connections detected >= " + this.requests.length);
2107
+ }
2108
+ this.loaderService.isLoading.next(true);
2109
+ return Observable.create(observer => {
2110
+ const subscription = next.handle(requestClone).subscribe(event => {
2111
+ if (event instanceof HttpResponse) {
2112
+ this.removeRequest(requestClone);
2113
+ observer.next(event);
2114
+ }
2115
+ }, (error) => {
2116
+ this.removeRequest(requestClone);
2117
+ observer.error(error);
2118
+ if (error.status === 401) {
2119
+ this.router.navigate(["login"]);
2120
+ this.messageService.toast('Unauthorised: Please login again');
2121
+ }
2122
+ else if (error.status === 500) {
2123
+ console.log(error.error);
2124
+ this.messageService.toast('System Error');
2125
+ }
2126
+ else if (error.statusText == 'Unknown Error') {
2127
+ this.messageService.toast('Connection Error');
2128
+ }
2129
+ else {
2130
+ this.messageService.toast('Error: ' + error.statusText);
2131
+ }
2132
+ }, () => {
2133
+ this.removeRequest(requestClone);
2134
+ observer.complete();
2135
+ });
2136
+ // remove request from queue when cancelled
2137
+ return () => {
2138
+ this.removeRequest(requestClone);
2139
+ subscription.unsubscribe();
2140
+ };
2141
+ });
2142
+ }
2143
+ }
2144
+ LoaderInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LoaderInterceptor, deps: [{ token: LoaderService }, { token: MessageService }, { token: AuthService }, { token: i1$3.Router }, { token: LogService }], target: i0.ɵɵFactoryTarget.Injectable });
2145
+ LoaderInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LoaderInterceptor });
2146
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LoaderInterceptor, decorators: [{
2147
+ type: Injectable
2148
+ }], ctorParameters: function () { return [{ type: LoaderService }, { type: MessageService }, { type: AuthService }, { type: i1$3.Router }, { type: LogService }]; } });
2149
+
2150
+ class CurrencyInputModule {
2151
+ }
2152
+ CurrencyInputModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CurrencyInputModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2153
+ CurrencyInputModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: CurrencyInputModule, declarations: [CurrencyInputMaskDirective], imports: [CommonModule,
2154
+ FormsModule], exports: [CurrencyInputMaskDirective] });
2155
+ CurrencyInputModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CurrencyInputModule, imports: [CommonModule,
2156
+ FormsModule] });
2157
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CurrencyInputModule, decorators: [{
2158
+ type: NgModule,
2159
+ args: [{
2160
+ imports: [
2161
+ CommonModule,
2162
+ FormsModule
2163
+ ],
2164
+ declarations: [
2165
+ CurrencyInputMaskDirective
2166
+ ],
2167
+ exports: [
2168
+ CurrencyInputMaskDirective
2169
+ ]
2170
+ }]
2171
+ }] });
2172
+
2173
+ class NumberComponent {
2174
+ constructor() {
2175
+ // options: FormGroup;
2176
+ this.hideRequiredControl = new FormControl(true);
2177
+ this.hide = true; //for password only
2178
+ this.readonly = false;
2179
+ this.hint = "";
2180
+ this.display = "";
2181
+ this.placeholder = "";
2182
+ this.value = 0;
2183
+ this.valueChange = new EventEmitter();
2184
+ this.leave = new EventEmitter();
2185
+ this.enterPress = new EventEmitter();
2186
+ this.width = "100%";
2187
+ //validation input
2188
+ this.required = true;
2189
+ this.min = 0;
2190
+ this.max = 9000000000000000; //Math.max
2191
+ this.step = 1;
2192
+ //validation
2193
+ this.control = new FormControl(this.value, [Validators.required, Validators.min(this.min), Validators.max(this.max)]);
2194
+ }
2195
+ ngOnInit() {
2196
+ }
2197
+ changed() {
2198
+ this.valueChange.emit(this.value);
2199
+ }
2200
+ leaved() {
2201
+ this.leave.emit();
2202
+ }
2203
+ enterPressed() {
2204
+ this.enterPress.emit();
2205
+ }
2206
+ validate(control) {
2207
+ if (this.required && control.hasError('required')) {
2208
+ return `Required`;
2209
+ }
2210
+ if (control.hasError('min')) {
2211
+ return `Minimun length is ${this.min}`;
2212
+ }
2213
+ if (control.hasError('max')) {
2214
+ return `Maximum length is ${this.max}`;
2215
+ }
2216
+ return "";
2217
+ }
2218
+ }
2219
+ NumberComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NumberComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2220
+ NumberComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: NumberComponent, selector: "spa-number", inputs: { readonly: "readonly", hint: "hint", display: "display", placeholder: "placeholder", value: "value", width: "width", required: "required", min: "min", max: "max", step: "step" }, outputs: { valueChange: "valueChange", leave: "leave", enterPress: "enterPress" }, ngImport: i0, template: "<!-- <mat-form-field style=\"width:300px\">\n <mat-label>Nostro Balance</mat-label>\n <input matInput autocomplete=\"off\" type=\"number\" min=\"0.00\" step=\"0.01\" [(ngModel)]=\"bid.balance\" placeholder=\"Nostro Balance\" />\n</mat-form-field> -->\n\n\n<mat-form-field hideRequiredMarker=\"true\" [hintLabel]=\"hint\" [ngStyle]=\"{'width':width}\" style=\"margin-right: 5px;\">\n <mat-label>{{display}}</mat-label>\n <input matInput autocomplete=\"off\" type=\"number\" [min]=\"min\" [max]=\"max\" [step]=\"step\" [(ngModel)]=\"value\" (change)=\"changed()\" (blur)=\"leaved()\" (keyup.enter)=\"enterPressed()\" [placeholder]=\"placeholder\" [formControl]=\"control\" [required]=\"required\" [readonly]=\"readonly\" />\n <mat-error *ngIf=\"control.invalid\">{{validate(control)}}</mat-error>\n</mat-form-field>\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i2.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }] });
2221
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NumberComponent, decorators: [{
2222
+ type: Component,
2223
+ args: [{ selector: 'spa-number', template: "<!-- <mat-form-field style=\"width:300px\">\n <mat-label>Nostro Balance</mat-label>\n <input matInput autocomplete=\"off\" type=\"number\" min=\"0.00\" step=\"0.01\" [(ngModel)]=\"bid.balance\" placeholder=\"Nostro Balance\" />\n</mat-form-field> -->\n\n\n<mat-form-field hideRequiredMarker=\"true\" [hintLabel]=\"hint\" [ngStyle]=\"{'width':width}\" style=\"margin-right: 5px;\">\n <mat-label>{{display}}</mat-label>\n <input matInput autocomplete=\"off\" type=\"number\" [min]=\"min\" [max]=\"max\" [step]=\"step\" [(ngModel)]=\"value\" (change)=\"changed()\" (blur)=\"leaved()\" (keyup.enter)=\"enterPressed()\" [placeholder]=\"placeholder\" [formControl]=\"control\" [required]=\"required\" [readonly]=\"readonly\" />\n <mat-error *ngIf=\"control.invalid\">{{validate(control)}}</mat-error>\n</mat-form-field>\n" }]
2224
+ }], ctorParameters: function () { return []; }, propDecorators: { readonly: [{
2225
+ type: Input
2226
+ }], hint: [{
2227
+ type: Input
2228
+ }], display: [{
2229
+ type: Input
2230
+ }], placeholder: [{
2231
+ type: Input
2232
+ }], value: [{
2233
+ type: Input
2234
+ }], valueChange: [{
2235
+ type: Output
2236
+ }], leave: [{
2237
+ type: Output
2238
+ }], enterPress: [{
2239
+ type: Output
2240
+ }], width: [{
2241
+ type: Input
2242
+ }], required: [{
2243
+ type: Input
2244
+ }], min: [{
2245
+ type: Input
2246
+ }], max: [{
2247
+ type: Input
2248
+ }], step: [{
2249
+ type: Input
2250
+ }] } });
2251
+
2252
+ class CamelToWordsPipe {
2253
+ transform(value) {
2254
+ if (!value)
2255
+ return value;
2256
+ if (typeof value !== 'string')
2257
+ return value;
2258
+ if (value.length == 0)
2259
+ return value;
2260
+ let v = value.charAt(0).toUpperCase() + value.substring(1);
2261
+ return v.replace(/([A-Z]+)*([A-Z][a-z])/g, "$1 $2");
2262
+ }
2263
+ }
2264
+ CamelToWordsPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CamelToWordsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
2265
+ CamelToWordsPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: CamelToWordsPipe, name: "camelToWords" });
2266
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CamelToWordsPipe, decorators: [{
2267
+ type: Pipe,
2268
+ args: [{
2269
+ name: 'camelToWords'
2270
+ }]
2271
+ }] });
2272
+
2273
+ class FormComponent {
2274
+ constructor() { }
2275
+ ngOnInit() {
2276
+ if (!this.fields) {
2277
+ this.fields = this.config.fields;
2278
+ }
2279
+ if (this.config.mode == "create" && !this.data) {
2280
+ this.generateObject();
2281
+ }
2282
+ }
2283
+ ngOnChanges() {
2284
+ console.log("changed");
2285
+ }
2286
+ generateObject() {
2287
+ this.data = {};
2288
+ this.fields.forEach(field => {
2289
+ this.data[field.name] = this.getInitialValue(field.type);
2290
+ });
2291
+ }
2292
+ getInitialValue(type) {
2293
+ switch (type) {
2294
+ case 'text':
2295
+ return '';
2296
+ case 'money':
2297
+ return 0;
2298
+ case 'number':
2299
+ return 0;
2300
+ case 'date':
2301
+ return '';
2302
+ case 'checkbox':
2303
+ return false;
2304
+ case 'select':
2305
+ return null;
2306
+ default:
2307
+ return null;
2308
+ }
2309
+ }
2310
+ createClicked() {
2311
+ console.log(this.data);
2312
+ }
2313
+ }
2314
+ FormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2315
+ FormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: FormComponent, selector: "spa-form", inputs: { data: "data", config: "config" }, usesOnChanges: true, ngImport: i0, template: "\n<div class=\"tin-grid\">\n\n <div *ngFor=\"let field of fields\" >\n\n <ng-container [ngSwitch]=\"field.type\">\n\n <spa-text *ngSwitchCase=\"'text'\" [display]=\"field.name | camelToWords\" [(value)]=\"data[field.name]\" [readonly]=\"config.mode =='view'\"></spa-text>\n\n <spa-number *ngSwitchCase=\"'number'\" [display]=\"field.name | camelToWords\" [(value)]=\"data[field.name]\" [readonly]=\"config.mode =='view'\"></spa-number>\n\n <spa-money *ngSwitchCase=\"'money'\" [display]=\"field.name | camelToWords\" [(value)]=\"data[field.name]\" [readonly]=\"config.mode =='view'\"></spa-money>\n\n <spa-check *ngSwitchCase=\"'checkbox'\" [display]=\"field.name | camelToWords\" [(value)]=\"data[field.name]\" [readonly]=\"config.mode =='view'\"></spa-check>\n\n <spa-date *ngSwitchCase=\"'date'\" [display]=\"field.name | camelToWords\" [(value)]=\"data[field.name]\" [readonly]=\"config.mode =='view'\" ></spa-date>\n\n <spa-select *ngSwitchCase=\"'select'\"\n [display]=\"field.name | camelToWords\"\n [options]=\"field.options\" [optionDisplay]=\"field.optionDisplay\" [optionValue]=\"field.optionValue\" [(value)]=\"data[field.name]\" [readonly]=\"config.mode =='view'\" >\n </spa-select>\n\n <spa-text *ngSwitchDefault [display]=\"field.name | camelToWords\" [(value)]=\"data[field.name]\" [readonly]=\"config.mode =='view'\"></spa-text>\n\n </ng-container>\n\n </div>\n\n\n\n\n <div class=\"span-col-center\" *ngIf=\"config.button\">\n <button mat-raised-button color=\"primary\" (click)=\"createClicked()\" cdkFocusInitial>{{config.button.name}}</button>\n </div>\n\n\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i1.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: TextComponent, selector: "spa-text", inputs: ["readonly", "hint", "display", "placeholder", "value", "format", "type", "rows", "width", "options", "optionValue", "required", "min", "max", "regex"], outputs: ["valueChange", "leave", "enterPress"] }, { kind: "component", type: CheckComponent, selector: "spa-check", inputs: ["readonly", "display", "value"], outputs: ["valueChange", "click", "check", "uncheck"] }, { kind: "component", type: DateComponent, selector: "spa-date", inputs: ["value", "display", "readonly", "width", "min", "max"], outputs: ["valueChange"] }, { kind: "component", type: SelectComponent, selector: "spa-select", inputs: ["width", "readonly", "readonlyMode", "hint", "placeholder", "multiple", "display", "value", "options", "optionValue", "optionDisplay", "optionDisplayExtra"], outputs: ["valueChange"] }, { kind: "component", type: MoneyComponent, selector: "spa-money", inputs: ["readonly", "display", "value", "placeholder", "width", "hint", "currency"], outputs: ["valueChange", "enterPress", "leave"] }, { kind: "component", type: NumberComponent, selector: "spa-number", inputs: ["readonly", "hint", "display", "placeholder", "value", "width", "required", "min", "max", "step"], outputs: ["valueChange", "leave", "enterPress"] }, { kind: "pipe", type: CamelToWordsPipe, name: "camelToWords" }] });
2316
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FormComponent, decorators: [{
2317
+ type: Component,
2318
+ args: [{ selector: 'spa-form', template: "\n<div class=\"tin-grid\">\n\n <div *ngFor=\"let field of fields\" >\n\n <ng-container [ngSwitch]=\"field.type\">\n\n <spa-text *ngSwitchCase=\"'text'\" [display]=\"field.name | camelToWords\" [(value)]=\"data[field.name]\" [readonly]=\"config.mode =='view'\"></spa-text>\n\n <spa-number *ngSwitchCase=\"'number'\" [display]=\"field.name | camelToWords\" [(value)]=\"data[field.name]\" [readonly]=\"config.mode =='view'\"></spa-number>\n\n <spa-money *ngSwitchCase=\"'money'\" [display]=\"field.name | camelToWords\" [(value)]=\"data[field.name]\" [readonly]=\"config.mode =='view'\"></spa-money>\n\n <spa-check *ngSwitchCase=\"'checkbox'\" [display]=\"field.name | camelToWords\" [(value)]=\"data[field.name]\" [readonly]=\"config.mode =='view'\"></spa-check>\n\n <spa-date *ngSwitchCase=\"'date'\" [display]=\"field.name | camelToWords\" [(value)]=\"data[field.name]\" [readonly]=\"config.mode =='view'\" ></spa-date>\n\n <spa-select *ngSwitchCase=\"'select'\"\n [display]=\"field.name | camelToWords\"\n [options]=\"field.options\" [optionDisplay]=\"field.optionDisplay\" [optionValue]=\"field.optionValue\" [(value)]=\"data[field.name]\" [readonly]=\"config.mode =='view'\" >\n </spa-select>\n\n <spa-text *ngSwitchDefault [display]=\"field.name | camelToWords\" [(value)]=\"data[field.name]\" [readonly]=\"config.mode =='view'\"></spa-text>\n\n </ng-container>\n\n </div>\n\n\n\n\n <div class=\"span-col-center\" *ngIf=\"config.button\">\n <button mat-raised-button color=\"primary\" (click)=\"createClicked()\" cdkFocusInitial>{{config.button.name}}</button>\n </div>\n\n\n</div>\n" }]
2319
+ }], ctorParameters: function () { return []; }, propDecorators: { data: [{
2320
+ type: Input
2321
+ }], config: [{
2322
+ type: Input
2323
+ }] } });
2324
+
2325
+ class detailsDialog {
2326
+ constructor(dataService, messageService, dialogRef, data) {
2327
+ this.dataService = dataService;
2328
+ this.messageService = messageService;
2329
+ this.dialogRef = dialogRef;
2330
+ this.data = data;
2331
+ this.smallScreen = false;
2332
+ this.isLoadComplete = false;
2333
+ this.isProcessing = false;
2334
+ }
2335
+ ngOnInit() {
2336
+ this.tableConfig = this.data.config;
2337
+ this.formConfig = this.tableConfig.formConfig;
2338
+ this.formConfig.mode = this.data.mode;
2339
+ this.smallScreen = this.data.smallScreen;
2340
+ if (this.formConfig.mode == "create") {
2341
+ this.details = this.generateObject();
2342
+ }
2343
+ else {
2344
+ this.details = this.data.details;
2345
+ }
2346
+ this.isLoadComplete = true;
2347
+ }
2348
+ generateObject() {
2349
+ let d = {};
2350
+ this.formConfig.fields.forEach(property => {
2351
+ d[property.name] = this.getInitialValue(property.type);
2352
+ });
2353
+ return d;
2354
+ }
2355
+ setMode(newMode) {
2356
+ this.formConfig.mode = newMode;
2357
+ }
2358
+ getInitialValue(type) {
2359
+ switch (type) {
2360
+ case 'text':
2361
+ return '';
2362
+ case 'money':
2363
+ return 0;
2364
+ case 'number':
2365
+ return 0;
2366
+ case 'date':
2367
+ return '';
2368
+ case 'checkbox':
2369
+ return false;
2370
+ case 'select':
2371
+ return null;
2372
+ default:
2373
+ return null;
2374
+ }
2375
+ }
2376
+ create() {
2377
+ console.log(this.details);
2378
+ let b = this.tableConfig.buttons.find(x => x.name == "create");
2379
+ if (!b) {
2380
+ this.dialogRef.close({ message: 'success', data: this.details });
2381
+ return;
2382
+ }
2383
+ this.isProcessing = true;
2384
+ this.dataService.CallApi(b.action, this.details).subscribe((apiResponse) => {
2385
+ this.isProcessing = false;
2386
+ if (apiResponse.success) {
2387
+ if (b.action.successMessage) {
2388
+ this.messageService.toast(b.action.successMessage);
2389
+ }
2390
+ else {
2391
+ this.messageService.toast("Created");
2392
+ }
2393
+ this.dialogRef.close({ message: 'success', data: this.details });
2394
+ }
2395
+ else {
2396
+ this.messageService.toast("Error: " + apiResponse);
2397
+ }
2398
+ });
2399
+ }
2400
+ edit() {
2401
+ console.log("Edit");
2402
+ let b = this.tableConfig.buttons.find(x => x.name == "edit");
2403
+ if (!b) {
2404
+ this.dialogRef.close({ message: 'success', data: this.details });
2405
+ return;
2406
+ }
2407
+ this.isProcessing = true;
2408
+ this.dataService.CallApi(b.action, this.details).subscribe((apiResponse) => {
2409
+ this.isProcessing = false;
2410
+ if (apiResponse.success) {
2411
+ if (b.action.successMessage) {
2412
+ this.messageService.toast(b.action.successMessage);
2413
+ }
2414
+ else {
2415
+ this.messageService.toast("Updated");
2416
+ }
2417
+ this.dialogRef.close({ message: 'success', data: this.details });
2418
+ }
2419
+ else {
2420
+ this.messageService.toast("Error: " + apiResponse);
2421
+ }
2422
+ });
2423
+ }
2424
+ delete() {
2425
+ this.messageService.confirm(`DELETE ?`).subscribe((result) => {
2426
+ if (result == "yes") {
2427
+ console.log("Delete");
2428
+ let b = this.tableConfig.buttons.find(x => x.name == "delete");
2429
+ if (!b) {
2430
+ this.dialogRef.close({ message: 'success', data: this.details });
2431
+ return;
2432
+ }
2433
+ this.isProcessing = true;
2434
+ this.dataService.CallApi(b.action, this.details).subscribe((apiResponse) => {
2435
+ this.isProcessing = false;
2436
+ if (apiResponse.success) {
2437
+ if (b.action.successMessage) {
2438
+ this.messageService.toast(b.action.successMessage);
2439
+ }
2440
+ else {
2441
+ this.messageService.toast("Deleted");
2442
+ }
2443
+ this.dialogRef.close({ message: 'success', data: this.details });
2444
+ }
2445
+ else {
2446
+ this.messageService.toast("Error: " + apiResponse);
2447
+ }
2448
+ });
2449
+ }
2450
+ });
2451
+ }
2452
+ }
2453
+ detailsDialog.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: detailsDialog, deps: [{ token: DataServiceLib }, { token: MessageService }, { token: i4.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
2454
+ detailsDialog.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: detailsDialog, selector: "app-viewModel", ngImport: i0, template: "\r\n<div class=\"row d-flex align-items-center mt-0\">\r\n\r\n <div class=\"col\">\r\n <h2 mat-dialog-title>{{formConfig.mode | titlecase}}</h2>\r\n </div>\r\n\r\n <div *ngIf=\"smallScreen && formConfig.mode=='view'\" class=\"col d-flex justify-content-end\">\r\n <button mat-mini-fab color=\"primary\" (click)=\"setMode('edit')\"><mat-icon>edit</mat-icon></button>\r\n </div>\r\n\r\n <div *ngIf=\"smallScreen && formConfig.mode=='edit'\" class=\"col d-flex justify-content-end\">\r\n <button mat-icon-button (click)=\"setMode('view')\"><mat-icon>done</mat-icon></button>\r\n </div>\r\n\r\n</div>\r\n<mat-dialog-content class=\"mat-typography\">\r\n\r\n<div class=\"tin-input\" style=\"font-size:14px\">\r\n\r\n\r\n<spa-form [data]=\"details\" [config]=\"formConfig\"></spa-form>\r\n\r\n</div>\r\n\r\n</mat-dialog-content>\r\n\r\n<mat-dialog-actions>\r\n<div>\r\n<button mat-raised-button [disabled]=\"isProcessing\" color=\"primary\" *ngIf=\"formConfig.mode=='create'\" (click)=\"create()\" cdkFocusInitial>Submit</button>\r\n<button mat-raised-button [disabled]=\"isProcessing\" color=\"primary\" *ngIf=\"formConfig.mode=='edit'\" (click)=\"edit()\" cdkFocusInitial>Submit</button>\r\n<button mat-stroked-button color=\"primary\" mat-dialog-close>Cancel</button>\r\n</div>\r\n<div class=\"col d-flex justify-content-end\">\r\n<button mat-icon-button [disabled]=\"isProcessing\" style=\"color: red;\" (click)=\"delete()\" *ngIf=\"formConfig.mode!='create'\"><mat-icon>delete</mat-icon></button>\r\n</div>\r\n\r\n\r\n</mat-dialog-actions>\r\n\r\n\r\n\r\n", styles: [".top{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between;align-items:center}.mat-mini-fab{width:32px;height:32px}.mat-mini-fab mat-icon{font-size:16px;margin-top:-3px}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i4.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i4.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i4.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i4.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: FormComponent, selector: "spa-form", inputs: ["data", "config"] }, { kind: "pipe", type: i1.TitleCasePipe, name: "titlecase" }] });
2455
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: detailsDialog, decorators: [{
2456
+ type: Component,
2457
+ args: [{ selector: 'app-viewModel', template: "\r\n<div class=\"row d-flex align-items-center mt-0\">\r\n\r\n <div class=\"col\">\r\n <h2 mat-dialog-title>{{formConfig.mode | titlecase}}</h2>\r\n </div>\r\n\r\n <div *ngIf=\"smallScreen && formConfig.mode=='view'\" class=\"col d-flex justify-content-end\">\r\n <button mat-mini-fab color=\"primary\" (click)=\"setMode('edit')\"><mat-icon>edit</mat-icon></button>\r\n </div>\r\n\r\n <div *ngIf=\"smallScreen && formConfig.mode=='edit'\" class=\"col d-flex justify-content-end\">\r\n <button mat-icon-button (click)=\"setMode('view')\"><mat-icon>done</mat-icon></button>\r\n </div>\r\n\r\n</div>\r\n<mat-dialog-content class=\"mat-typography\">\r\n\r\n<div class=\"tin-input\" style=\"font-size:14px\">\r\n\r\n\r\n<spa-form [data]=\"details\" [config]=\"formConfig\"></spa-form>\r\n\r\n</div>\r\n\r\n</mat-dialog-content>\r\n\r\n<mat-dialog-actions>\r\n<div>\r\n<button mat-raised-button [disabled]=\"isProcessing\" color=\"primary\" *ngIf=\"formConfig.mode=='create'\" (click)=\"create()\" cdkFocusInitial>Submit</button>\r\n<button mat-raised-button [disabled]=\"isProcessing\" color=\"primary\" *ngIf=\"formConfig.mode=='edit'\" (click)=\"edit()\" cdkFocusInitial>Submit</button>\r\n<button mat-stroked-button color=\"primary\" mat-dialog-close>Cancel</button>\r\n</div>\r\n<div class=\"col d-flex justify-content-end\">\r\n<button mat-icon-button [disabled]=\"isProcessing\" style=\"color: red;\" (click)=\"delete()\" *ngIf=\"formConfig.mode!='create'\"><mat-icon>delete</mat-icon></button>\r\n</div>\r\n\r\n\r\n</mat-dialog-actions>\r\n\r\n\r\n\r\n", styles: [".top{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between;align-items:center}.mat-mini-fab{width:32px;height:32px}.mat-mini-fab mat-icon{font-size:16px;margin-top:-3px}\n"] }]
2458
+ }], ctorParameters: function () {
2459
+ return [{ type: DataServiceLib }, { type: MessageService }, { type: i4.MatDialogRef }, { type: undefined, decorators: [{
2460
+ type: Inject,
2461
+ args: [MAT_DIALOG_DATA]
2462
+ }] }];
2463
+ } });
2464
+ ;
2465
+
2466
+ class TableComponent {
2467
+ constructor(dataService, messageService, breakpointObserver, dialog) {
2468
+ this.dataService = dataService;
2469
+ this.messageService = messageService;
2470
+ this.breakpointObserver = breakpointObserver;
2471
+ this.dialog = dialog;
2472
+ this.actionsWidth = "50px";
2473
+ this.data = [];
2474
+ this.refreshClick = new EventEmitter();
2475
+ this.createClick = new EventEmitter();
2476
+ this.viewClick = new EventEmitter();
2477
+ this.editClick = new EventEmitter();
2478
+ this.deleteClick = new EventEmitter();
2479
+ this.custom1Click = new EventEmitter();
2480
+ this.custom2Click = new EventEmitter();
2481
+ this.custom3Click = new EventEmitter();
2482
+ this.smallScreen = false;
2483
+ this.options = [];
2484
+ this.displayedColumns = [];
2485
+ // detect screen size changes
2486
+ this.breakpointObserver.observe(["(max-width: 600px)"]).subscribe((result) => {
2487
+ if (result.matches) {
2488
+ this.smallScreen = true;
2489
+ this.setColumns();
2490
+ }
2491
+ else {
2492
+ this.smallScreen = false;
2493
+ this.setColumns();
2494
+ }
2495
+ });
2496
+ }
2497
+ ngOnInit() {
2498
+ this.options = this.config.columns;
2499
+ this.setColumns();
2500
+ this.createButton = this.getButton('create');
2501
+ this.viewButton = this.getButton('view');
2502
+ this.editButton = this.getButton('edit');
2503
+ this.deleteButton = this.getButton('delete');
2504
+ this.custom1Button = this.getButton('custom1');
2505
+ this.custom2Button = this.getButton('custom2');
2506
+ this.custom3Button = this.getButton('custom3');
2507
+ if (this.config.loadAction) {
2508
+ this.loadData();
2509
+ }
2510
+ this.formDefaults();
2511
+ }
2512
+ ngOnChanges() {
2513
+ if (!this.config.loadAction) {
2514
+ console.log("Table data Changed");
2515
+ this.dataSource = this.data;
2516
+ this.tableDataSource = new MatTableDataSource(this.dataSource);
2517
+ setTimeout(() => { this.tableDataSource.paginator = this.tablePaginator; }, 5);
2518
+ }
2519
+ }
2520
+ getButton(name) {
2521
+ if (!this.config.buttons)
2522
+ return null;
2523
+ return this.config.buttons.find(x => x.name == name);
2524
+ }
2525
+ getIcon(buttonName) {
2526
+ let b = this.getButton(buttonName);
2527
+ if (b.icon) {
2528
+ return b.icon.name;
2529
+ }
2530
+ let i = 'pageview';
2531
+ switch (buttonName) {
2532
+ case 'view':
2533
+ i = 'pageview';
2534
+ break;
2535
+ case 'edit':
2536
+ i = 'edit';
2537
+ break;
2538
+ case 'delete':
2539
+ i = 'delete';
2540
+ break;
2541
+ default:
2542
+ break;
2543
+ }
2544
+ return i;
2545
+ }
2546
+ setColumns() {
2547
+ var _a, _b;
2548
+ if (!((_a = this.config) === null || _a === void 0 ? void 0 : _a.columns)) {
2549
+ return;
2550
+ }
2551
+ if (this.smallScreen) {
2552
+ this.displayedColumns = this.config.minColumns;
2553
+ }
2554
+ else {
2555
+ this.displayedColumns = this.config.columns.map(({ name }) => name);
2556
+ }
2557
+ let buttonsCount = (_b = this.config.buttons.filter(x => x.name != 'create').length) !== null && _b !== void 0 ? _b : 0;
2558
+ if (buttonsCount > 0) {
2559
+ if (!this.displayedColumns.find(x => x == 'action') && this.config.buttons) {
2560
+ this.displayedColumns.push("action");
2561
+ }
2562
+ this.actionsWidth = `${buttonsCount * 40 + 20}px`;
2563
+ }
2564
+ }
2565
+ getOptions(column) {
2566
+ let x = this.options.find(opt => opt.name === column);
2567
+ return x;
2568
+ }
2569
+ testIconCondition(column, row) {
2570
+ const option = this.getOptions(column);
2571
+ if (option && option.icon && !option.icon.condition) {
2572
+ return true;
2573
+ }
2574
+ if (option && option.icon && option.icon.condition) {
2575
+ return option.icon.condition(row[column]);
2576
+ }
2577
+ return false;
2578
+ }
2579
+ testDisabled(row, buttonName) {
2580
+ let button = this.getButton(buttonName);
2581
+ if (button.disabled) {
2582
+ return button.disabled(row);
2583
+ }
2584
+ return false;
2585
+ }
2586
+ testVisible(row, buttonName) {
2587
+ let button = this.getButton(buttonName);
2588
+ if (button.visible) {
2589
+ return button.visible(row);
2590
+ }
2591
+ return true;
2592
+ }
2593
+ //Actions
2594
+ refreshClicked() {
2595
+ console.log("Refresh");
2596
+ this.refreshClick.emit();
2597
+ if (this.config.loadAction) {
2598
+ this.loadData();
2599
+ }
2600
+ }
2601
+ view(x) {
2602
+ console.log("View");
2603
+ this.viewClick.emit(x);
2604
+ // this.doAction('view', x);
2605
+ }
2606
+ create(x) {
2607
+ console.log("Create");
2608
+ this.createClick.emit(x);
2609
+ this.doAction('create', x);
2610
+ }
2611
+ edit(x) {
2612
+ console.log("Edit");
2613
+ this.editClick.emit(x);
2614
+ this.doAction('edit', x);
2615
+ }
2616
+ delete(x) {
2617
+ console.log("Delete");
2618
+ this.deleteClick.emit(x);
2619
+ this.doAction('delete', x);
2620
+ }
2621
+ custom1(x) {
2622
+ console.log("Custom 1");
2623
+ this.custom1Click.emit(x);
2624
+ this.doAction('custom1', x);
2625
+ }
2626
+ custom2(x) {
2627
+ console.log("Custom 2");
2628
+ this.custom2Click.emit(x);
2629
+ this.doAction('custom2', x);
2630
+ }
2631
+ custom3(x) {
2632
+ console.log("Custom 3");
2633
+ this.custom3Click.emit(x);
2634
+ this.doAction('custom3', x);
2635
+ }
2636
+ viewModel(row) {
2637
+ let button = this.getButton('view');
2638
+ if (button && !button.dialog) {
2639
+ this.view(row);
2640
+ return;
2641
+ }
2642
+ if (!this.config.formConfig) {
2643
+ this.messageService.toast("Please configure form");
2644
+ return;
2645
+ }
2646
+ const dialogRef = this.dialog.open(detailsDialog, {
2647
+ width: "900px",
2648
+ data: { mode: "view", config: this.config, details: row, smallScreen: this.smallScreen },
2649
+ });
2650
+ dialogRef.afterClosed().subscribe((result) => {
2651
+ if (result.message) {
2652
+ this.refreshClicked();
2653
+ }
2654
+ });
2655
+ }
2656
+ newModel() {
2657
+ let button = this.getButton('create');
2658
+ if (button && !button.dialog) {
2659
+ this.create('');
2660
+ return;
2661
+ }
2662
+ if (!this.config.formConfig) {
2663
+ this.messageService.toast("Please configure form");
2664
+ return;
2665
+ }
2666
+ const dialogRef = this.dialog.open(detailsDialog, {
2667
+ width: "900px",
2668
+ data: { mode: "create", config: this.config, smallScreen: this.smallScreen }
2669
+ });
2670
+ dialogRef.afterClosed().subscribe((result) => {
2671
+ if (result.message) {
2672
+ this.create(result.data);
2673
+ this.refreshClicked();
2674
+ }
2675
+ });
2676
+ }
2677
+ editModel(row) {
2678
+ let button = this.getButton('edit');
2679
+ if (button && !button.dialog) {
2680
+ this.edit(row);
2681
+ return;
2682
+ }
2683
+ if (!this.config.formConfig) {
2684
+ this.messageService.toast("Please configure form");
2685
+ return;
2686
+ }
2687
+ const dialogRef = this.dialog.open(detailsDialog, {
2688
+ width: "900px",
2689
+ data: { mode: "edit", config: this.config, details: row, smallScreen: this.smallScreen },
2690
+ });
2691
+ dialogRef.afterClosed().subscribe((result) => {
2692
+ if (result.message) {
2693
+ this.edit(result.data);
2694
+ this.refreshClicked();
2695
+ }
2696
+ });
2697
+ }
2698
+ deleteModel(row) {
2699
+ let button = this.getButton('delete');
2700
+ if (button && !button.dialog) {
2701
+ this.delete(row);
2702
+ return;
2703
+ }
2704
+ this.messageService.confirm(`DELETE ?`).subscribe((result) => {
2705
+ if (result == "yes") {
2706
+ this.delete(row);
2707
+ this.refreshClicked();
2708
+ }
2709
+ });
2710
+ }
2711
+ doAction(buttonName, row) {
2712
+ let b = this.getButton(buttonName);
2713
+ if (!b)
2714
+ return;
2715
+ if (b.action && buttonName != 'delete')
2716
+ return;
2717
+ this.dataService.CallApi(b.action, row).subscribe((apiResponse) => {
2718
+ if (apiResponse.success) {
2719
+ if (b.action.successMessage) {
2720
+ this.messageService.toast(b.action.successMessage);
2721
+ }
2722
+ else {
2723
+ this.messageService.toast("Updated");
2724
+ }
2725
+ this.refreshClicked();
2726
+ }
2727
+ else {
2728
+ this.messageService.toast("Error: " + apiResponse);
2729
+ }
2730
+ });
2731
+ }
2732
+ loadData() {
2733
+ console.log("loading");
2734
+ if (this.config.loadAction) {
2735
+ this.dataService.CallApi(this.config.loadAction, "").subscribe((apiResponse) => {
2736
+ this.dataSource = apiResponse.data;
2737
+ this.tableDataSource = new MatTableDataSource(apiResponse.data);
2738
+ this.tableDataSource.paginator = this.tablePaginator;
2739
+ // if (apiResponse.success){
2740
+ // this.tableDataSource = new MatTableDataSource(apiResponse.data);
2741
+ // this.tableDataSource.paginator = this.tablePaginator;
2742
+ // }else{
2743
+ // this.messageService.toast("Error: " + JSON.stringify(apiResponse));
2744
+ // }
2745
+ });
2746
+ }
2747
+ }
2748
+ formDefaults() {
2749
+ if (!this.config.formConfig) {
2750
+ let config = new FormConfig;
2751
+ config.fields = [];
2752
+ this.config.columns.forEach(column => {
2753
+ let field = { name: column.name, type: column.type };
2754
+ config.fields.push(field);
2755
+ });
2756
+ this.config.formConfig = config;
2757
+ }
2758
+ }
2759
+ }
2760
+ TableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TableComponent, deps: [{ token: DataServiceLib }, { token: MessageService }, { token: i3$3.BreakpointObserver }, { token: i4.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
2761
+ TableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: TableComponent, selector: "spa-table", inputs: { data: "data", config: "config" }, outputs: { refreshClick: "refreshClick", createClick: "createClick", viewClick: "viewClick", editClick: "editClick", deleteClick: "deleteClick", custom1Click: "custom1Click", custom2Click: "custom2Click", custom3Click: "custom3Click" }, viewQueries: [{ propertyName: "tablePaginator", first: true, predicate: ["tablePaginator"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "\n<div class=\"top\">\n\n <div >\n <!-- <button *ngIf=\"config.newText\" id=\"btnNew\" mat-raised-button color=\"primary\" (click)=\"newModel()\">{{config.newText}}</button> -->\n <button *ngIf=\"createButton\" id=\"btnNew\" mat-raised-button color=\"primary\" (click)=\"newModel()\">{{createButton.display}}</button>\n </div>\n\n <div *ngIf=\"config.showFilter\" class=\"d-flex justify-content-end\">\n <spa-filter [data]=\"tableDataSource\" (refreshClick)=\"refreshClicked()\"></spa-filter>\n </div>\n\n</div>\n\n<div>\n\n <p *ngIf=\"!config\"><em>Configure Table</em></p>\n <p *ngIf=\"!dataSource\"><em>Loading...</em></p>\n\n\n\n <div *ngIf=\"dataSource\">\n\n\n <table mat-table [dataSource]=\"tableDataSource\" class=\"mat-elevation-z8\">\n <ng-container *ngFor=\"let column of config.columns\" [matColumnDef]=\"column.name\">\n <th mat-header-cell *matHeaderCellDef>{{ column.name | camelToWords }}</th>\n <td mat-cell *matCellDef=\"let row;\" >\n\n <ng-container [ngSwitch]=\"column.type\">\n\n <ng-container *ngSwitchCase=\"'checkbox'\">\n <spa-check [value]=\"row[column.name]\" [readonly]=\"true\"></spa-check>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'date'\">\n {{row[column.name] | date : 'dd/MM/yyyy'}}\n <mat-icon *ngIf=\"column.icon && testIconCondition(column.name, row)\" [matTooltip]=\"column.icon?.tip\" matTooltipPosition=\"above\" [ngStyle]=\"{'color':column.icon?.color}\">{{column.icon.name }}</mat-icon>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'money'\">\n {{row[column.name] | currency:'':''}}\n <mat-icon *ngIf=\"column.icon && testIconCondition(column.name, row)\" [matTooltip]=\"column.icon?.tip\" matTooltipPosition=\"above\" [ngStyle]=\"{'color':column.icon?.color}\">{{column.icon.name }}</mat-icon>\n </ng-container>\n\n <ng-container *ngSwitchDefault>\n <label>{{row[column.name]}}</label>\n <mat-icon *ngIf=\"column.icon && testIconCondition(column.name, row)\" [matTooltip]=\"column.icon?.tip\" matTooltipPosition=\"above\" [ngStyle]=\"{'color':column.icon?.color}\">{{column.icon.name }}</mat-icon>\n </ng-container>\n\n </ng-container>\n\n\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"action\">\n <th mat-header-cell *matHeaderCellDef> Action </th>\n <td mat-cell *matCellDef=\"let row\" [ngStyle]=\"{width:smallScreen ? '50px' : actionsWidth}\">\n\n\n <button mat-mini-fab color=\"primary\" [matTooltip]=\"viewButton.tip ?? 'view' \" matTooltipPosition=\"above\" style=\"margin-right:5px\" [ngStyle]=\"{'background-color':viewButton.color}\" [disabled]=\"testDisabled(row,'view')\" *ngIf=\"viewButton && testVisible(row,'view')\" (click)=\"viewModel(row)\">\n <mat-icon>{{getIcon('view')}}</mat-icon>\n </button>\n\n <button mat-mini-fab color=\"primary\" [matTooltip]=\"custom1Button.tip ?? 'custom1' \" matTooltipPosition=\"above\" style=\"margin-right:5px\" [ngStyle]=\"{'background-color':custom1Button.color}\" [disabled]=\"testDisabled(row,'custom1')\" *ngIf=\"!smallScreen && custom1Button && testVisible(row,'custom1')\" (click)=\"custom1(row)\">\n <mat-icon>{{getIcon('custom1')}}</mat-icon>\n </button>\n\n <button mat-mini-fab color=\"primary\" [matTooltip]=\"custom2Button.tip ?? 'custom2' \" matTooltipPosition=\"above\" style=\"margin-right:5px\" [ngStyle]=\"{'background-color':custom2Button.color}\" [disabled]=\"testDisabled(row,'custom2')\" *ngIf=\"!smallScreen && custom2Button && testVisible(row,'custom2')\" (click)=\"custom2(row)\">\n <mat-icon>{{getIcon('custom2')}}</mat-icon>\n </button>\n\n <button mat-mini-fab color=\"primary\" [matTooltip]=\"custom3Button.tip ?? 'custom3' \" matTooltipPosition=\"above\" style=\"margin-right:5px\" [ngStyle]=\"{'background-color':custom3Button.color}\" [disabled]=\"testDisabled(row,'custom3')\" *ngIf=\"!smallScreen && custom3Button && testVisible(row,'custom3')\" (click)=\"custom3(row)\">\n <mat-icon>{{getIcon('custom3')}}</mat-icon>\n </button>\n\n\n <button mat-mini-fab color=\"primary\" [matTooltip]=\"editButton.tip ?? 'edit' \" matTooltipPosition=\"above\" style=\"margin-right:5px\" [ngStyle]=\"{'background-color':editButton.color}\" [disabled]=\"testDisabled(row,'edit')\" *ngIf=\"!smallScreen && editButton && testVisible(row,'edit')\" (click)=\"editModel(row)\">\n <mat-icon>{{getIcon('edit')}}</mat-icon>\n </button>\n\n <button mat-mini-fab color=\"warn\" [matTooltip]=\"deleteButton.tip ?? 'delete' \" matTooltipPosition=\"above\" style=\"margin-right:5px\" [ngStyle]=\"{'background-color':deleteButton.color}\" [disabled]=\"testDisabled(row,'delete')\" *ngIf=\"!smallScreen && deleteButton && testVisible(row,'delete')\" (click)=\"deleteModel(row)\">\n <mat-icon>{{getIcon('delete')}}</mat-icon>\n </button>\n\n </td>\n </ng-container>\n\n\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\"></tr>\n </table>\n\n </div>\n\n <mat-paginator #tablePaginator [pageSizeOptions]=\"[10, 20, 50]\" showFirstLastButtons></mat-paginator>\n\n</div>\n\n<p *ngIf=\"dataSource?.length == 0\"><em>No Data</em></p>\n\n\n", styles: [".top{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between;align-items:center}.mat-mini-fab{width:32px;height:32px}.mat-mini-fab mat-icon{font-size:16px;margin-top:-3px}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i1.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { 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: i7$1.MatPaginator, selector: "mat-paginator", inputs: ["disabled"], exportAs: ["matPaginator"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i6.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "component", type: CheckComponent, selector: "spa-check", inputs: ["readonly", "display", "value"], outputs: ["valueChange", "click", "check", "uncheck"] }, { kind: "component", type: FilterComponent, selector: "spa-filter", inputs: ["data"], outputs: ["refreshClick"] }, { kind: "pipe", type: i1.CurrencyPipe, name: "currency" }, { kind: "pipe", type: i1.DatePipe, name: "date" }, { kind: "pipe", type: CamelToWordsPipe, name: "camelToWords" }] });
2762
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TableComponent, decorators: [{
2763
+ type: Component,
2764
+ args: [{ selector: 'spa-table', template: "\n<div class=\"top\">\n\n <div >\n <!-- <button *ngIf=\"config.newText\" id=\"btnNew\" mat-raised-button color=\"primary\" (click)=\"newModel()\">{{config.newText}}</button> -->\n <button *ngIf=\"createButton\" id=\"btnNew\" mat-raised-button color=\"primary\" (click)=\"newModel()\">{{createButton.display}}</button>\n </div>\n\n <div *ngIf=\"config.showFilter\" class=\"d-flex justify-content-end\">\n <spa-filter [data]=\"tableDataSource\" (refreshClick)=\"refreshClicked()\"></spa-filter>\n </div>\n\n</div>\n\n<div>\n\n <p *ngIf=\"!config\"><em>Configure Table</em></p>\n <p *ngIf=\"!dataSource\"><em>Loading...</em></p>\n\n\n\n <div *ngIf=\"dataSource\">\n\n\n <table mat-table [dataSource]=\"tableDataSource\" class=\"mat-elevation-z8\">\n <ng-container *ngFor=\"let column of config.columns\" [matColumnDef]=\"column.name\">\n <th mat-header-cell *matHeaderCellDef>{{ column.name | camelToWords }}</th>\n <td mat-cell *matCellDef=\"let row;\" >\n\n <ng-container [ngSwitch]=\"column.type\">\n\n <ng-container *ngSwitchCase=\"'checkbox'\">\n <spa-check [value]=\"row[column.name]\" [readonly]=\"true\"></spa-check>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'date'\">\n {{row[column.name] | date : 'dd/MM/yyyy'}}\n <mat-icon *ngIf=\"column.icon && testIconCondition(column.name, row)\" [matTooltip]=\"column.icon?.tip\" matTooltipPosition=\"above\" [ngStyle]=\"{'color':column.icon?.color}\">{{column.icon.name }}</mat-icon>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'money'\">\n {{row[column.name] | currency:'':''}}\n <mat-icon *ngIf=\"column.icon && testIconCondition(column.name, row)\" [matTooltip]=\"column.icon?.tip\" matTooltipPosition=\"above\" [ngStyle]=\"{'color':column.icon?.color}\">{{column.icon.name }}</mat-icon>\n </ng-container>\n\n <ng-container *ngSwitchDefault>\n <label>{{row[column.name]}}</label>\n <mat-icon *ngIf=\"column.icon && testIconCondition(column.name, row)\" [matTooltip]=\"column.icon?.tip\" matTooltipPosition=\"above\" [ngStyle]=\"{'color':column.icon?.color}\">{{column.icon.name }}</mat-icon>\n </ng-container>\n\n </ng-container>\n\n\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"action\">\n <th mat-header-cell *matHeaderCellDef> Action </th>\n <td mat-cell *matCellDef=\"let row\" [ngStyle]=\"{width:smallScreen ? '50px' : actionsWidth}\">\n\n\n <button mat-mini-fab color=\"primary\" [matTooltip]=\"viewButton.tip ?? 'view' \" matTooltipPosition=\"above\" style=\"margin-right:5px\" [ngStyle]=\"{'background-color':viewButton.color}\" [disabled]=\"testDisabled(row,'view')\" *ngIf=\"viewButton && testVisible(row,'view')\" (click)=\"viewModel(row)\">\n <mat-icon>{{getIcon('view')}}</mat-icon>\n </button>\n\n <button mat-mini-fab color=\"primary\" [matTooltip]=\"custom1Button.tip ?? 'custom1' \" matTooltipPosition=\"above\" style=\"margin-right:5px\" [ngStyle]=\"{'background-color':custom1Button.color}\" [disabled]=\"testDisabled(row,'custom1')\" *ngIf=\"!smallScreen && custom1Button && testVisible(row,'custom1')\" (click)=\"custom1(row)\">\n <mat-icon>{{getIcon('custom1')}}</mat-icon>\n </button>\n\n <button mat-mini-fab color=\"primary\" [matTooltip]=\"custom2Button.tip ?? 'custom2' \" matTooltipPosition=\"above\" style=\"margin-right:5px\" [ngStyle]=\"{'background-color':custom2Button.color}\" [disabled]=\"testDisabled(row,'custom2')\" *ngIf=\"!smallScreen && custom2Button && testVisible(row,'custom2')\" (click)=\"custom2(row)\">\n <mat-icon>{{getIcon('custom2')}}</mat-icon>\n </button>\n\n <button mat-mini-fab color=\"primary\" [matTooltip]=\"custom3Button.tip ?? 'custom3' \" matTooltipPosition=\"above\" style=\"margin-right:5px\" [ngStyle]=\"{'background-color':custom3Button.color}\" [disabled]=\"testDisabled(row,'custom3')\" *ngIf=\"!smallScreen && custom3Button && testVisible(row,'custom3')\" (click)=\"custom3(row)\">\n <mat-icon>{{getIcon('custom3')}}</mat-icon>\n </button>\n\n\n <button mat-mini-fab color=\"primary\" [matTooltip]=\"editButton.tip ?? 'edit' \" matTooltipPosition=\"above\" style=\"margin-right:5px\" [ngStyle]=\"{'background-color':editButton.color}\" [disabled]=\"testDisabled(row,'edit')\" *ngIf=\"!smallScreen && editButton && testVisible(row,'edit')\" (click)=\"editModel(row)\">\n <mat-icon>{{getIcon('edit')}}</mat-icon>\n </button>\n\n <button mat-mini-fab color=\"warn\" [matTooltip]=\"deleteButton.tip ?? 'delete' \" matTooltipPosition=\"above\" style=\"margin-right:5px\" [ngStyle]=\"{'background-color':deleteButton.color}\" [disabled]=\"testDisabled(row,'delete')\" *ngIf=\"!smallScreen && deleteButton && testVisible(row,'delete')\" (click)=\"deleteModel(row)\">\n <mat-icon>{{getIcon('delete')}}</mat-icon>\n </button>\n\n </td>\n </ng-container>\n\n\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\"></tr>\n </table>\n\n </div>\n\n <mat-paginator #tablePaginator [pageSizeOptions]=\"[10, 20, 50]\" showFirstLastButtons></mat-paginator>\n\n</div>\n\n<p *ngIf=\"dataSource?.length == 0\"><em>No Data</em></p>\n\n\n", styles: [".top{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between;align-items:center}.mat-mini-fab{width:32px;height:32px}.mat-mini-fab mat-icon{font-size:16px;margin-top:-3px}\n"] }]
2765
+ }], ctorParameters: function () { return [{ type: DataServiceLib }, { type: MessageService }, { type: i3$3.BreakpointObserver }, { type: i4.MatDialog }]; }, propDecorators: { tablePaginator: [{
2766
+ type: ViewChild,
2767
+ args: ['tablePaginator']
2768
+ }], data: [{
2769
+ type: Input
2770
+ }], config: [{
2771
+ type: Input
2772
+ }], refreshClick: [{
2773
+ type: Output
2774
+ }], createClick: [{
2775
+ type: Output
2776
+ }], viewClick: [{
2777
+ type: Output
2778
+ }], editClick: [{
2779
+ type: Output
2780
+ }], deleteClick: [{
2781
+ type: Output
2782
+ }], custom1Click: [{
2783
+ type: Output
2784
+ }], custom2Click: [{
2785
+ type: Output
2786
+ }], custom3Click: [{
2787
+ type: Output
2788
+ }] } });
2789
+
2790
+ class TinSpaModule {
2791
+ }
2792
+ TinSpaModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TinSpaModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2793
+ TinSpaModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: TinSpaModule, declarations: [TinSpaComponent, TextComponent, CheckComponent, DateComponent, DatetimeComponent, LabelComponent, SelectComponent,
2794
+ ActivityComponent, FilterComponent, messageDialog, MoneyComponent, OptionComponent, TilesComponent, StepsComponent,
2795
+ AttachComponent, ChipsComponent, LoaderComponent, NavMenuComponent, TableComponent, detailsDialog, FormComponent, CamelToWordsPipe, NumberComponent], imports: [SpaMatModule,
2796
+ HttpClientModule,
2797
+ CurrencyInputModule], exports: [TinSpaComponent,
2798
+ SpaMatModule,
2799
+ TextComponent,
2800
+ messageDialog,
2801
+ NavMenuComponent,
2802
+ LoaderComponent,
2803
+ TilesComponent,
2804
+ DateComponent,
2805
+ SelectComponent,
2806
+ DatetimeComponent,
2807
+ CheckComponent,
2808
+ AttachComponent,
2809
+ MoneyComponent,
2810
+ ChipsComponent,
2811
+ ActivityComponent,
2812
+ OptionComponent,
2813
+ LabelComponent,
2814
+ StepsComponent,
2815
+ FilterComponent,
2816
+ TableComponent, detailsDialog,
2817
+ FormComponent,
2818
+ NumberComponent] });
2819
+ TinSpaModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TinSpaModule, providers: [
2820
+ { provide: HTTP_INTERCEPTORS, useClass: LoaderInterceptor, multi: true },
2821
+ { provide: LocationStrategy, useClass: HashLocationStrategy },
2822
+ { provide: MAT_FORM_FIELD_DEFAULT_OPTIONS, useValue: { appearance: 'legacy' } },
2823
+ CurrencyPipe, DatePipe
2824
+ ], imports: [SpaMatModule,
2825
+ HttpClientModule,
2826
+ CurrencyInputModule, SpaMatModule] });
2827
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TinSpaModule, decorators: [{
2828
+ type: NgModule,
2829
+ args: [{
2830
+ declarations: [
2831
+ TinSpaComponent, TextComponent, CheckComponent, DateComponent, DatetimeComponent, LabelComponent, SelectComponent,
2832
+ ActivityComponent, FilterComponent, messageDialog, MoneyComponent, OptionComponent, TilesComponent, StepsComponent,
2833
+ AttachComponent, ChipsComponent, LoaderComponent, NavMenuComponent, TableComponent, detailsDialog, FormComponent, CamelToWordsPipe, NumberComponent
2834
+ ],
2835
+ imports: [
2836
+ SpaMatModule,
2837
+ HttpClientModule,
2838
+ CurrencyInputModule
2839
+ ],
2840
+ exports: [
2841
+ TinSpaComponent,
2842
+ SpaMatModule,
2843
+ TextComponent,
2844
+ messageDialog,
2845
+ NavMenuComponent,
2846
+ LoaderComponent,
2847
+ TilesComponent,
2848
+ DateComponent,
2849
+ SelectComponent,
2850
+ DatetimeComponent,
2851
+ CheckComponent,
2852
+ AttachComponent,
2853
+ MoneyComponent,
2854
+ ChipsComponent,
2855
+ ActivityComponent,
2856
+ OptionComponent,
2857
+ LabelComponent,
2858
+ StepsComponent,
2859
+ FilterComponent,
2860
+ TableComponent, detailsDialog,
2861
+ FormComponent,
2862
+ NumberComponent
2863
+ ],
2864
+ providers: [
2865
+ { provide: HTTP_INTERCEPTORS, useClass: LoaderInterceptor, multi: true },
2866
+ { provide: LocationStrategy, useClass: HashLocationStrategy },
2867
+ { provide: MAT_FORM_FIELD_DEFAULT_OPTIONS, useValue: { appearance: 'legacy' } },
2868
+ CurrencyPipe, DatePipe
2869
+ ],
2870
+ }]
2871
+ }] });
2872
+
2873
+ class LoginComponent {
2874
+ constructor(httpService, storageService, router, messageService, dataService, authService, logService, route) {
2875
+ this.httpService = httpService;
2876
+ this.storageService = storageService;
2877
+ this.router = router;
2878
+ this.messageService = messageService;
2879
+ this.dataService = dataService;
2880
+ this.authService = authService;
2881
+ this.logService = logService;
2882
+ this.route = route;
2883
+ this.style = "default";
2884
+ this.email = "";
2885
+ this.password = "";
2886
+ this.user = new User();
2887
+ this.hide = true;
2888
+ this.isProcessing = false;
2889
+ this.appConfig = new AppConfig();
2890
+ }
2891
+ ngOnInit() {
2892
+ this.authService.Updateloggedin(false);
2893
+ this.authService.UpdateRole(null);
2894
+ this.storageService.clear();
2895
+ this.dataService.appConfigObserv.subscribe(x => this.appConfig = x);
2896
+ if (this.route.snapshot.queryParams["redirectTo"] != undefined) {
2897
+ this.redirectPath = this.route.snapshot.queryParams["redirectTo"];
2898
+ }
2899
+ else {
2900
+ this.redirectPath = "home";
2901
+ }
2902
+ }
2903
+ signup() {
2904
+ this.router.navigate(["signup"]);
2905
+ }
2906
+ recoverAccount() {
2907
+ this.router.navigate(["recover-account"]);
2908
+ }
2909
+ login() {
2910
+ if (this.user.userName == "" || this.user.password == "") {
2911
+ this.messageService.toast("Please enter your credentials");
2912
+ return;
2913
+ }
2914
+ this.logService.info("logging in");
2915
+ this.isProcessing = true;
2916
+ this.user.userName = this.user.userName;
2917
+ this.dataService.Login(this.user).subscribe((apiResponse) => {
2918
+ this.isProcessing = false;
2919
+ if (apiResponse.success) {
2920
+ if (apiResponse.data.authType == 'local' && !this.appConfig.localAuth) {
2921
+ this.messageService.toast("Contact Admin: Authentication Type error");
2922
+ return;
2923
+ }
2924
+ if (apiResponse.data.authType == 'AD' && !this.appConfig.ADAuth) {
2925
+ this.messageService.toast("Contact Admin: Authentication Type error");
2926
+ return;
2927
+ }
2928
+ this.authService.Updateloggedin(true);
2929
+ this.authService.UpdateToken(apiResponse.data.token);
2930
+ this.storageService.store(Constants.AUTH_TOKEN, apiResponse.data.token);
2931
+ this.authService.UpdateTokenExpire(apiResponse.data.expiration);
2932
+ this.storageService.store(Constants.AUTH_TOKEN_EXPIRE, apiResponse.data.expiration);
2933
+ this.authService.UpdateCurrentUser(this.user.userName);
2934
+ this.storageService.store(Constants.AUTH_USER, this.user.userName);
2935
+ this.authService.updateLoggedUserFullName(apiResponse.data.firstName);
2936
+ this.storageService.store(Constants.AUTH_NAME, apiResponse.data.firstName);
2937
+ this.authService.UpdateRole(apiResponse.data.role);
2938
+ this.storageService.store(Constants.AUTH_ROLES, JSON.stringify(apiResponse.data.role));
2939
+ this.logService.info("logged in");
2940
+ if (apiResponse.data.changePassword == true && apiResponse.data.authType == 'local') {
2941
+ this.router.navigate(["home/user/change-password"], {
2942
+ queryParams: { redirectTo: this.redirectPath },
2943
+ queryParamsHandling: 'merge',
2944
+ skipLocationChange: false
2945
+ });
2946
+ return;
2947
+ }
2948
+ this.router.navigate([this.redirectPath]);
2949
+ }
2950
+ else {
2951
+ this.messageService.toast("Error: " + apiResponse.message);
2952
+ this.user.password = "";
2953
+ }
2954
+ }, (error) => {
2955
+ this.isProcessing = false;
2956
+ this.messageService.toast(this.httpService.Error(error));
2957
+ });
2958
+ }
2959
+ }
2960
+ LoginComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LoginComponent, deps: [{ token: HttpService }, { token: StorageService }, { token: i1$3.Router }, { token: MessageService }, { token: DataServiceLib }, { token: AuthService }, { token: LogService }, { token: i1$3.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component });
2961
+ LoginComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: LoginComponent, selector: "spa-login", ngImport: i0, template: "\r\n <div *ngIf=\"style=='old'\" class=\"tin-bg-login login-page\">\r\n\r\n <div *ngIf=\"appConfig.logo!=''\" class=\"d-flex justify-content-center row align-items-center\" style=\"margin-top:3em;margin-bottom:1em\">\r\n\r\n <img *ngIf=\"appConfig.logoSize=='normal'\" [src]=\"appConfig.logo\" style=\"width: 100px;margin-right:3em;margin-left:3em\" />\r\n <img *ngIf=\"appConfig.logoSize=='medium'\" [src]=\"appConfig.logo\" style=\"width: 150px;margin-right:3em;margin-left:3em\" />\r\n <img *ngIf=\"appConfig.logoSize=='large'\" [src]=\"appConfig.logo\" style=\"width: 250px; margin-right:3em;margin-left:3em\" />\r\n\r\n </div>\r\n\r\n\r\n <div *ngIf=\"appConfig.logo ==''\" style=\"margin-top:2em\">\r\n <!-- Add margin top when there is no logo -->\r\n </div>\r\n\r\n\r\n <div class=\"d-flex justify-content-center row align-items-center\" style=\"margin-top:3em;\">\r\n\r\n <div class=\"d-none d-sm-block\">\r\n </div>\r\n\r\n <div style=\"margin-left:1em\">\r\n\r\n <mat-card class=\"mat-elevation-z3 login-card\" style=\"width:400px; \">\r\n\r\n <mat-card-header>\r\n <mat-card-title>{{appConfig.appName}}</mat-card-title>\r\n </mat-card-header>\r\n\r\n <mat-card-content>\r\n\r\n <div class=\"tin-input mt-2\">\r\n\r\n <spa-text id=\"txtuserName\" display=\"Username\" [(value)]=\"user.userName\" ></spa-text>\r\n\r\n <mat-form-field >\r\n <mat-label>Password</mat-label>\r\n <input id=\"txtPassword\" matInput [type]=\"hide ? 'password' : 'text'\" (keyup.enter)=\"login()\" [(ngModel)]=\"user.password\" autocomplete=\"off\" >\r\n <button mat-icon-button matSuffix (click)=\"hide = !hide\" [attr.aria-label]=\"'Hide password'\" [attr.aria-pressed]=\"hide\">\r\n <mat-icon style=\"font-size: 18px;\">{{hide ? 'visibility_off' : 'visibility'}}</mat-icon>\r\n </button>\r\n </mat-form-field>\r\n\r\n </div>\r\n\r\n </mat-card-content>\r\n\r\n\r\n <mat-card-actions>\r\n\r\n <div class=\"row \">\r\n\r\n <div class=\"col d-flex justify-content-center\">\r\n <button id=\"btnLogin\" mat-raised-button [disabled]=\"isProcessing\" style=\"width: 100px;\" (click)=\"login()\" color=\"primary\">Login</button>\r\n </div>\r\n\r\n <div class=\"col d-flex justify-content-center\" *ngIf=\"appConfig.selfService\">\r\n <button id=\"btnSignup\" mat-stroked-button color=\"primary\" style=\"width: 100px;\" (click)=\"signup()\">Signup</button>\r\n </div>\r\n\r\n </div>\r\n\r\n </mat-card-actions>\r\n\r\n </mat-card>\r\n\r\n <div *ngIf=\"appConfig.selfService\">\r\n <br />\r\n <a mat-button id=\"lnkRecover\" style=\"margin-left: 1em\" (click)=\"recoverAccount()\">Forgot your password ?</a>\r\n </div>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n\r\n <div *ngIf=\"style=='default'\" class=\"login-page background tin-bg-login\">\r\n\r\n <div class=\"container\" >\r\n\r\n <div class=\"logo\">\r\n <img *ngIf=\"appConfig.logoSize=='normal'\" [src]=\"appConfig.logo\" style=\"width: 100px\" />\r\n <img *ngIf=\"appConfig.logoSize=='medium'\" [src]=\"appConfig.logo\" style=\"width: 150px\" />\r\n <img *ngIf=\"appConfig.logoSize=='large'\" [src]=\"appConfig.logo\" style=\"width: 250px\" />\r\n </div>\r\n\r\n <mat-card class=\"mat-elevation-z3 \" style=\"width:400px; \">\r\n\r\n <mat-card-header>\r\n <mat-card-title>{{appConfig.appName}}</mat-card-title>\r\n </mat-card-header>\r\n\r\n <mat-card-content>\r\n\r\n <div class=\"tin-input mt-2\">\r\n\r\n <spa-text id=\"txtuserName\" display=\"Username\" [(value)]=\"user.userName\"></spa-text>\r\n\r\n <spa-text id=\"txtPassword\" display=\"Password\" format=\"password\" [(value)]=\"user.password\" (enterPress)=\"login()\"></spa-text>\r\n\r\n </div>\r\n\r\n </mat-card-content>\r\n\r\n\r\n <mat-card-actions>\r\n\r\n <div class=\"buttons\">\r\n\r\n <button id=\"btnLogin\" mat-raised-button [disabled]=\"isProcessing\" style=\"width: 100px;\" (click)=\"login()\" color=\"primary\">Login</button>\r\n\r\n <button *ngIf=\"appConfig.selfService\" id=\"btnSignup\" mat-stroked-button color=\"primary\" style=\"width: 100px;\" (click)=\"signup()\">Signup</button>\r\n\r\n </div>\r\n\r\n\r\n\r\n </mat-card-actions>\r\n\r\n </mat-card>\r\n\r\n <a *ngIf=\"appConfig.selfService\" mat-button id=\"lnkRecover\" style=\"margin-top: 1em\" (click)=\"recoverAccount()\">Forgot your password ?</a>\r\n\r\n\r\n\r\n\r\n </div>\r\n </div>\r\n\r\n\r\n <div *ngIf=\"style=='bs'\">\r\n\r\n <div class=\"container\">\r\n\r\n <div class=\"image\">\r\n <img class=\"mb-4\" src=\"c:\\Tinashe\\Code\\Angular\\Junk\\bs-examples\\assets\\brand\\bootstrap-logo.svg\" alt=\"\" width=\"72\" height=\"57\">\r\n </div>\r\n\r\n <div class=\"details\">\r\n <h1 class=\"h3 mb-3 fw-normal\" >Please sign in</h1>\r\n\r\n <div class=\"form-floating\">\r\n <input class=\"form-control\" id=\"floatingInput\" placeholder=\"name@example.com\" [(ngModel)]=\"user.userName\">\r\n <label for=\"floatingInput\">Username</label>\r\n </div>\r\n\r\n <div class=\"form-floating\">\r\n <input type=\"password\" class=\"form-control\" id=\"floatingPassword\" placeholder=\"Password\" [(ngModel)]=\"user.password\">\r\n <label for=\"floatingPassword\">Password</label>\r\n </div>\r\n\r\n <div class=\"form-check text-start my-3\">\r\n <input class=\"form-check-input\" type=\"checkbox\" value=\"remember-me\" id=\"flexCheckDefault\" >\r\n <label class=\"form-check-label\" for=\"flexCheckDefault\">\r\n Remember me\r\n </label>\r\n </div>\r\n\r\n <button class=\"btn btn-primary w-100 py-2\" (click)=\"login()\">Sign in</button>\r\n\r\n </div>\r\n\r\n <p class=\"mt-5 mb-3 text-body-secondary\">&copy; 2017\u20132023</p>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n", styles: [".login-page{position:absolute;inset:0;overflow:auto}.background{min-height:100%}.container{display:flex;flex-direction:column;align-items:center;height:100vh}.logo{margin-top:3em;margin-bottom:1em}.buttons{display:flex;flex-direction:row;justify-content:space-evenly}\n"], dependencies: [{ kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i5.MatAnchor, selector: "a[mat-button], a[mat-raised-button], a[mat-icon-button], a[mat-fab], a[mat-mini-fab], a[mat-stroked-button], a[mat-flat-button]", inputs: ["disabled", "disableRipple", "color", "tabIndex"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix]" }, { kind: "directive", type: i4$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i14.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { kind: "component", type: i14.MatCardHeader, selector: "mat-card-header" }, { kind: "directive", type: i14.MatCardContent, selector: "mat-card-content, [mat-card-content], [matCardContent]" }, { kind: "directive", type: i14.MatCardTitle, selector: "mat-card-title, [mat-card-title], [matCardTitle]" }, { kind: "directive", type: i14.MatCardActions, selector: "mat-card-actions", inputs: ["align"], exportAs: ["matCardActions"] }, { kind: "component", type: TextComponent, selector: "spa-text", inputs: ["readonly", "hint", "display", "placeholder", "value", "format", "type", "rows", "width", "options", "optionValue", "required", "min", "max", "regex"], outputs: ["valueChange", "leave", "enterPress"] }] });
2962
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LoginComponent, decorators: [{
2963
+ type: Component,
2964
+ args: [{ selector: "spa-login", template: "\r\n <div *ngIf=\"style=='old'\" class=\"tin-bg-login login-page\">\r\n\r\n <div *ngIf=\"appConfig.logo!=''\" class=\"d-flex justify-content-center row align-items-center\" style=\"margin-top:3em;margin-bottom:1em\">\r\n\r\n <img *ngIf=\"appConfig.logoSize=='normal'\" [src]=\"appConfig.logo\" style=\"width: 100px;margin-right:3em;margin-left:3em\" />\r\n <img *ngIf=\"appConfig.logoSize=='medium'\" [src]=\"appConfig.logo\" style=\"width: 150px;margin-right:3em;margin-left:3em\" />\r\n <img *ngIf=\"appConfig.logoSize=='large'\" [src]=\"appConfig.logo\" style=\"width: 250px; margin-right:3em;margin-left:3em\" />\r\n\r\n </div>\r\n\r\n\r\n <div *ngIf=\"appConfig.logo ==''\" style=\"margin-top:2em\">\r\n <!-- Add margin top when there is no logo -->\r\n </div>\r\n\r\n\r\n <div class=\"d-flex justify-content-center row align-items-center\" style=\"margin-top:3em;\">\r\n\r\n <div class=\"d-none d-sm-block\">\r\n </div>\r\n\r\n <div style=\"margin-left:1em\">\r\n\r\n <mat-card class=\"mat-elevation-z3 login-card\" style=\"width:400px; \">\r\n\r\n <mat-card-header>\r\n <mat-card-title>{{appConfig.appName}}</mat-card-title>\r\n </mat-card-header>\r\n\r\n <mat-card-content>\r\n\r\n <div class=\"tin-input mt-2\">\r\n\r\n <spa-text id=\"txtuserName\" display=\"Username\" [(value)]=\"user.userName\" ></spa-text>\r\n\r\n <mat-form-field >\r\n <mat-label>Password</mat-label>\r\n <input id=\"txtPassword\" matInput [type]=\"hide ? 'password' : 'text'\" (keyup.enter)=\"login()\" [(ngModel)]=\"user.password\" autocomplete=\"off\" >\r\n <button mat-icon-button matSuffix (click)=\"hide = !hide\" [attr.aria-label]=\"'Hide password'\" [attr.aria-pressed]=\"hide\">\r\n <mat-icon style=\"font-size: 18px;\">{{hide ? 'visibility_off' : 'visibility'}}</mat-icon>\r\n </button>\r\n </mat-form-field>\r\n\r\n </div>\r\n\r\n </mat-card-content>\r\n\r\n\r\n <mat-card-actions>\r\n\r\n <div class=\"row \">\r\n\r\n <div class=\"col d-flex justify-content-center\">\r\n <button id=\"btnLogin\" mat-raised-button [disabled]=\"isProcessing\" style=\"width: 100px;\" (click)=\"login()\" color=\"primary\">Login</button>\r\n </div>\r\n\r\n <div class=\"col d-flex justify-content-center\" *ngIf=\"appConfig.selfService\">\r\n <button id=\"btnSignup\" mat-stroked-button color=\"primary\" style=\"width: 100px;\" (click)=\"signup()\">Signup</button>\r\n </div>\r\n\r\n </div>\r\n\r\n </mat-card-actions>\r\n\r\n </mat-card>\r\n\r\n <div *ngIf=\"appConfig.selfService\">\r\n <br />\r\n <a mat-button id=\"lnkRecover\" style=\"margin-left: 1em\" (click)=\"recoverAccount()\">Forgot your password ?</a>\r\n </div>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n\r\n <div *ngIf=\"style=='default'\" class=\"login-page background tin-bg-login\">\r\n\r\n <div class=\"container\" >\r\n\r\n <div class=\"logo\">\r\n <img *ngIf=\"appConfig.logoSize=='normal'\" [src]=\"appConfig.logo\" style=\"width: 100px\" />\r\n <img *ngIf=\"appConfig.logoSize=='medium'\" [src]=\"appConfig.logo\" style=\"width: 150px\" />\r\n <img *ngIf=\"appConfig.logoSize=='large'\" [src]=\"appConfig.logo\" style=\"width: 250px\" />\r\n </div>\r\n\r\n <mat-card class=\"mat-elevation-z3 \" style=\"width:400px; \">\r\n\r\n <mat-card-header>\r\n <mat-card-title>{{appConfig.appName}}</mat-card-title>\r\n </mat-card-header>\r\n\r\n <mat-card-content>\r\n\r\n <div class=\"tin-input mt-2\">\r\n\r\n <spa-text id=\"txtuserName\" display=\"Username\" [(value)]=\"user.userName\"></spa-text>\r\n\r\n <spa-text id=\"txtPassword\" display=\"Password\" format=\"password\" [(value)]=\"user.password\" (enterPress)=\"login()\"></spa-text>\r\n\r\n </div>\r\n\r\n </mat-card-content>\r\n\r\n\r\n <mat-card-actions>\r\n\r\n <div class=\"buttons\">\r\n\r\n <button id=\"btnLogin\" mat-raised-button [disabled]=\"isProcessing\" style=\"width: 100px;\" (click)=\"login()\" color=\"primary\">Login</button>\r\n\r\n <button *ngIf=\"appConfig.selfService\" id=\"btnSignup\" mat-stroked-button color=\"primary\" style=\"width: 100px;\" (click)=\"signup()\">Signup</button>\r\n\r\n </div>\r\n\r\n\r\n\r\n </mat-card-actions>\r\n\r\n </mat-card>\r\n\r\n <a *ngIf=\"appConfig.selfService\" mat-button id=\"lnkRecover\" style=\"margin-top: 1em\" (click)=\"recoverAccount()\">Forgot your password ?</a>\r\n\r\n\r\n\r\n\r\n </div>\r\n </div>\r\n\r\n\r\n <div *ngIf=\"style=='bs'\">\r\n\r\n <div class=\"container\">\r\n\r\n <div class=\"image\">\r\n <img class=\"mb-4\" src=\"c:\\Tinashe\\Code\\Angular\\Junk\\bs-examples\\assets\\brand\\bootstrap-logo.svg\" alt=\"\" width=\"72\" height=\"57\">\r\n </div>\r\n\r\n <div class=\"details\">\r\n <h1 class=\"h3 mb-3 fw-normal\" >Please sign in</h1>\r\n\r\n <div class=\"form-floating\">\r\n <input class=\"form-control\" id=\"floatingInput\" placeholder=\"name@example.com\" [(ngModel)]=\"user.userName\">\r\n <label for=\"floatingInput\">Username</label>\r\n </div>\r\n\r\n <div class=\"form-floating\">\r\n <input type=\"password\" class=\"form-control\" id=\"floatingPassword\" placeholder=\"Password\" [(ngModel)]=\"user.password\">\r\n <label for=\"floatingPassword\">Password</label>\r\n </div>\r\n\r\n <div class=\"form-check text-start my-3\">\r\n <input class=\"form-check-input\" type=\"checkbox\" value=\"remember-me\" id=\"flexCheckDefault\" >\r\n <label class=\"form-check-label\" for=\"flexCheckDefault\">\r\n Remember me\r\n </label>\r\n </div>\r\n\r\n <button class=\"btn btn-primary w-100 py-2\" (click)=\"login()\">Sign in</button>\r\n\r\n </div>\r\n\r\n <p class=\"mt-5 mb-3 text-body-secondary\">&copy; 2017\u20132023</p>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n", styles: [".login-page{position:absolute;inset:0;overflow:auto}.background{min-height:100%}.container{display:flex;flex-direction:column;align-items:center;height:100vh}.logo{margin-top:3em;margin-bottom:1em}.buttons{display:flex;flex-direction:row;justify-content:space-evenly}\n"] }]
2965
+ }], ctorParameters: function () { return [{ type: HttpService }, { type: StorageService }, { type: i1$3.Router }, { type: MessageService }, { type: DataServiceLib }, { type: AuthService }, { type: LogService }, { type: i1$3.ActivatedRoute }]; } });
2966
+
2967
+ class SignupComponent {
2968
+ constructor(httpService, messageService, dataService, authService) {
2969
+ this.httpService = httpService;
2970
+ this.messageService = messageService;
2971
+ this.dataService = dataService;
2972
+ this.authService = authService;
2973
+ this.isProcessing = false;
2974
+ this.user = new User();
2975
+ this.profile = new Profile();
2976
+ this.account = new Account();
2977
+ }
2978
+ ngOnInit() {
2979
+ this.account.user = this.user;
2980
+ this.account.profile = this.profile;
2981
+ }
2982
+ create() {
2983
+ this.profile.userName = this.user.userName;
2984
+ this.isProcessing = true;
2985
+ this.dataService.RegisterAccount(this.account).subscribe((apiResponse) => {
2986
+ this.isProcessing = false;
2987
+ if (apiResponse.message == "success") {
2988
+ this.messageService.toast("Account Created");
2989
+ this.user = new User();
2990
+ this.profile = new Profile();
2991
+ }
2992
+ else {
2993
+ this.messageService.toast("Error: " + apiResponse.message);
2994
+ }
2995
+ }, (error) => {
2996
+ this.isProcessing = false;
2997
+ this.messageService.toast(this.httpService.Error(error));
2998
+ });
2999
+ }
3000
+ }
3001
+ SignupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SignupComponent, deps: [{ token: HttpService }, { token: MessageService }, { token: DataServiceLib }, { token: AuthService }], target: i0.ɵɵFactoryTarget.Component });
3002
+ SignupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: SignupComponent, selector: "spa-signup", ngImport: i0, template: "\r\n<h4 style=\"padding-top: 30px;\">Signup</h4>\r\n\r\n<hr/>\r\nComplete the form below.\r\n\r\n<div class=\"container tin-grid\" style=\"font-size:14px;\">\r\n\r\n <spa-text display=\"FirstName\" [(value)]=\"account.profile.firstName\" ></spa-text>\r\n\r\n <spa-text display=\"LastName\" [(value)]=\"account.profile.lastName\" ></spa-text>\r\n\r\n <spa-text display=\"Username\" [(value)]=\"account.profile.userName\"></spa-text>\r\n\r\n &nbsp;\r\n\r\n <spa-text display=\"Password\" [(value)]=\"account.profile.password\" format=\"password\" ></spa-text>\r\n\r\n <spa-text display=\"Confirm Password\" [(value)]=\"confirmPassword\" format=\"password\" ></spa-text>\r\n\r\n <div class=\"span-col-center\">\r\n <button mat-raised-button color=\"primary\" (click)=\"create()\" cdkFocusInitial>Create</button>\r\n </div>\r\n\r\n\r\n</div>\r\n\r\n\r\n", styles: [""], dependencies: [{ kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: TextComponent, selector: "spa-text", inputs: ["readonly", "hint", "display", "placeholder", "value", "format", "type", "rows", "width", "options", "optionValue", "required", "min", "max", "regex"], outputs: ["valueChange", "leave", "enterPress"] }] });
3003
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SignupComponent, decorators: [{
3004
+ type: Component,
3005
+ args: [{ selector: 'spa-signup', template: "\r\n<h4 style=\"padding-top: 30px;\">Signup</h4>\r\n\r\n<hr/>\r\nComplete the form below.\r\n\r\n<div class=\"container tin-grid\" style=\"font-size:14px;\">\r\n\r\n <spa-text display=\"FirstName\" [(value)]=\"account.profile.firstName\" ></spa-text>\r\n\r\n <spa-text display=\"LastName\" [(value)]=\"account.profile.lastName\" ></spa-text>\r\n\r\n <spa-text display=\"Username\" [(value)]=\"account.profile.userName\"></spa-text>\r\n\r\n &nbsp;\r\n\r\n <spa-text display=\"Password\" [(value)]=\"account.profile.password\" format=\"password\" ></spa-text>\r\n\r\n <spa-text display=\"Confirm Password\" [(value)]=\"confirmPassword\" format=\"password\" ></spa-text>\r\n\r\n <div class=\"span-col-center\">\r\n <button mat-raised-button color=\"primary\" (click)=\"create()\" cdkFocusInitial>Create</button>\r\n </div>\r\n\r\n\r\n</div>\r\n\r\n\r\n" }]
3006
+ }], ctorParameters: function () { return [{ type: HttpService }, { type: MessageService }, { type: DataServiceLib }, { type: AuthService }]; } });
3007
+
3008
+ class RecoverAccountComponent {
3009
+ constructor(location, dataService, authService, messageService) {
3010
+ this.location = location;
3011
+ this.dataService = dataService;
3012
+ this.authService = authService;
3013
+ this.messageService = messageService;
3014
+ this.userName = "";
3015
+ }
3016
+ ngOnInit() {
3017
+ }
3018
+ recover() {
3019
+ if (this.userName == "") {
3020
+ this.messageService.toast("Please enter your userName");
3021
+ return;
3022
+ }
3023
+ else {
3024
+ let u = new User();
3025
+ u.userName = this.userName;
3026
+ this.dataService.SelfReset(u).subscribe((apiResponse) => {
3027
+ if (apiResponse.message == "success") {
3028
+ this.messageService.toast("The password has been sent to your email");
3029
+ this.location.back();
3030
+ }
3031
+ else {
3032
+ this.messageService.toast("Error: " + apiResponse.message);
3033
+ }
3034
+ });
3035
+ }
3036
+ }
3037
+ }
3038
+ RecoverAccountComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: RecoverAccountComponent, deps: [{ token: i1.Location }, { token: DataServiceLib }, { token: AuthService }, { token: MessageService }], target: i0.ɵɵFactoryTarget.Component });
3039
+ RecoverAccountComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: RecoverAccountComponent, selector: "spa-recover-account", ngImport: i0, template: "\r\n<div class=\"container\" style=\"padding-top: 30px;\">\r\n<h4>Recover Account</h4>\r\n\r\n<hr />\r\n\r\nSubmit your Username and we will send you details to your registered email address.\r\n\r\n<div style=\"font-size: 14px;\">\r\n <spa-text class=\"mt-3\" display=\"Username\" [(value)]=\"userName\"></spa-text>\r\n\r\n <div class=\"tin-center\">\r\n <button class=\"mt-3 w-50\" mat-raised-button color=\"primary\" (click)=\"recover()\" cdkFocusInitial>Submit</button>\r\n </div>\r\n\r\n</div>\r\n\r\n</div>\r\n\r\n", styles: [""], dependencies: [{ kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: TextComponent, selector: "spa-text", inputs: ["readonly", "hint", "display", "placeholder", "value", "format", "type", "rows", "width", "options", "optionValue", "required", "min", "max", "regex"], outputs: ["valueChange", "leave", "enterPress"] }] });
3040
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: RecoverAccountComponent, decorators: [{
3041
+ type: Component,
3042
+ args: [{ selector: 'spa-recover-account', template: "\r\n<div class=\"container\" style=\"padding-top: 30px;\">\r\n<h4>Recover Account</h4>\r\n\r\n<hr />\r\n\r\nSubmit your Username and we will send you details to your registered email address.\r\n\r\n<div style=\"font-size: 14px;\">\r\n <spa-text class=\"mt-3\" display=\"Username\" [(value)]=\"userName\"></spa-text>\r\n\r\n <div class=\"tin-center\">\r\n <button class=\"mt-3 w-50\" mat-raised-button color=\"primary\" (click)=\"recover()\" cdkFocusInitial>Submit</button>\r\n </div>\r\n\r\n</div>\r\n\r\n</div>\r\n\r\n" }]
3043
+ }], ctorParameters: function () { return [{ type: i1.Location }, { type: DataServiceLib }, { type: AuthService }, { type: MessageService }]; } });
3044
+
3045
+ class SpaIndexModule {
3046
+ }
3047
+ SpaIndexModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SpaIndexModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3048
+ SpaIndexModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: SpaIndexModule, declarations: [LoginComponent, SignupComponent, RecoverAccountComponent], imports: [i2.ReactiveFormsModule, CommonModule,
3049
+ FormsModule,
3050
+ ReactiveFormsModule,
3051
+ // SpaMatModule,
3052
+ TinSpaModule], exports: [CommonModule,
3053
+ FormsModule,
3054
+ // SpaMatModule,
3055
+ LoginComponent,
3056
+ SignupComponent,
3057
+ RecoverAccountComponent] });
3058
+ SpaIndexModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SpaIndexModule, imports: [ReactiveFormsModule.withConfig({ warnOnNgModelWithFormControl: "never" }),
3059
+ CommonModule,
3060
+ FormsModule,
3061
+ ReactiveFormsModule,
3062
+ // SpaMatModule,
3063
+ TinSpaModule, CommonModule,
3064
+ FormsModule] });
3065
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SpaIndexModule, decorators: [{
3066
+ type: NgModule,
3067
+ args: [{
3068
+ declarations: [LoginComponent, SignupComponent, RecoverAccountComponent],
3069
+ imports: [
3070
+ ReactiveFormsModule.withConfig({ warnOnNgModelWithFormControl: "never" }),
3071
+ CommonModule,
3072
+ FormsModule,
3073
+ ReactiveFormsModule,
3074
+ // SpaMatModule,
3075
+ TinSpaModule
3076
+ ],
3077
+ exports: [
3078
+ CommonModule,
3079
+ FormsModule,
3080
+ // SpaMatModule,
3081
+ LoginComponent,
3082
+ SignupComponent,
3083
+ RecoverAccountComponent,
3084
+ ],
3085
+ }]
3086
+ }] });
3087
+
3088
+ class ChangePasswordComponent {
3089
+ constructor(router, location, httpService, messageService, dataService, authService, route) {
3090
+ this.router = router;
3091
+ this.location = location;
3092
+ this.httpService = httpService;
3093
+ this.messageService = messageService;
3094
+ this.dataService = dataService;
3095
+ this.authService = authService;
3096
+ this.route = route;
3097
+ this.isProcessing = false;
3098
+ this.changePassword = new ChangeUserPassword();
3099
+ }
3100
+ ngOnInit() {
3101
+ this.myRole = this.authService.currentRoleSource.value;
3102
+ if (this.dataService.tmpProfileuserName == "") {
3103
+ this.changePassword.userName = this.authService.currentUser;
3104
+ }
3105
+ else {
3106
+ this.changePassword.userName = this.dataService.tmpProfileuserName;
3107
+ this.dataService.tmpProfileuserName = "";
3108
+ }
3109
+ if (this.route.snapshot.queryParams["redirectTo"] != undefined) {
3110
+ this.redirectPath = this.route.snapshot.queryParams["redirectTo"];
3111
+ }
3112
+ else {
3113
+ this.redirectPath = "home";
3114
+ }
3115
+ }
3116
+ change() {
3117
+ if (!this.myRole[this.dataService.capUsers.name]) {
3118
+ if (this.changePassword.currentPassword == "") {
3119
+ this.messageService.toast("Please enter current Password");
3120
+ return;
3121
+ }
3122
+ }
3123
+ if (this.changePassword.newPassword == "") {
3124
+ this.messageService.toast("Please enter new Password");
3125
+ return;
3126
+ }
3127
+ if (this.changePassword.confirmPassword == "") {
3128
+ this.messageService.toast("Please confirm new Password");
3129
+ return;
3130
+ }
3131
+ if (this.changePassword.confirmPassword != this.changePassword.newPassword) {
3132
+ this.messageService.toast("Passwords do not match");
3133
+ return;
3134
+ }
3135
+ this.isProcessing = true;
3136
+ if (this.myRole[this.dataService.capUsers.name]) {
3137
+ this.dataService.ChangePasswordAdmin(this.changePassword).subscribe((apiResponse) => {
3138
+ this.isProcessing = false;
3139
+ if (apiResponse.message == "success") {
3140
+ this.messageService.toast("Password Changed");
3141
+ this.router.navigate([this.redirectPath]);
3142
+ }
3143
+ else {
3144
+ this.messageService.toast("Error: " + apiResponse.message);
3145
+ }
3146
+ });
3147
+ }
3148
+ else {
3149
+ this.dataService.ChangePassword(this.changePassword).subscribe((apiResponse) => {
3150
+ this.isProcessing = false;
3151
+ if (apiResponse.message == "success") {
3152
+ this.messageService.toast("Password Changed");
3153
+ this.router.navigate([this.redirectPath]);
3154
+ }
3155
+ else {
3156
+ this.messageService.toast("Error: " + apiResponse.message);
3157
+ }
3158
+ });
3159
+ }
3160
+ }
3161
+ }
3162
+ ChangePasswordComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ChangePasswordComponent, deps: [{ token: i1$3.Router }, { token: i1.Location }, { token: HttpService }, { token: MessageService }, { token: DataServiceLib }, { token: AuthService }, { token: i1$3.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component });
3163
+ ChangePasswordComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ChangePasswordComponent, selector: "spa-change-password", ngImport: i0, template: "<h4>Change Password</h4>\r\n<hr>\r\n\r\n\r\n<div class=\"container tin-grid\" style=\"font-size:14px;\">\r\n\r\n <div class=\"fill\">\r\n\r\n <spa-text id=\"txtuserName\" display=\"Username\" [(value)]=\"changePassword.userName\" [readonly]=\"true\"></spa-text>\r\n <spa-text id=\"txtPassword\" display=\"Current Password\" [(value)]=\"changePassword.currentPassword\" type=\"password\"></spa-text>\r\n <spa-text id=\"txtNewPassword\" display=\"New Password\" [(value)]=\"changePassword.newPassword\" type=\"password\"></spa-text>\r\n <spa-text id=\"txtConfirmPassword\" display=\"Confirm Password\" [(value)]=\"changePassword.confirmPassword\" type=\"password\"></spa-text>\r\n <button id=\"btnChange\" mat-raised-button color=\"primary\" (click)=\"change()\" cdkFocusInitial>Change</button>\r\n\r\n </div>\r\n\r\n <div class=\"alert alert-info\" style=\"font-size: 14px;\" role=\"alert\">\r\n <b>*Please consider these requirements for your new password.</b> <br><br>\r\n\r\n At least 8 characters<br>\r\n At least 1 uppercase letter (A-Z)<br>\r\n At least 2 lowercase letters (a-z)<br>\r\n At least 1 digit (0-9)<br>\r\n At least 1 special character (~`! \u2026)<br>\r\n\r\n </div>\r\n\r\n</div>\r\n\r\n\r\n<!-- <div class=\"container\">\r\n\r\n <div class=\"d-flex justify-content-center row align-items-center\" >\r\n\r\n <div class=\"col\">\r\n\r\n <div class=\"tin-input \" style=\"font-size:14px;\">\r\n\r\n <div class=\"col\" *ngIf=\"changePassword.userName!=''\">\r\n <spa-text id=\"txtuserName\" display=\"Username\" [(value)]=\"changePassword.userName\" width=\"300px\" [readonly]=\"true\"></spa-text>\r\n </div>\r\n\r\n <div class=\"col\" *ngIf=\"!myRole[dataService.capUsers.name]\">\r\n <spa-text id=\"txtPassword\" display=\"Current Password\" [(value)]=\"changePassword.currentPassword\" width=\"300px\" type=\"password\"></spa-text>\r\n </div>\r\n\r\n <div class=\"col\">\r\n <spa-text id=\"txtNewPassword\" display=\"New Password\" [(value)]=\"changePassword.newPassword\" width=\"300px\" type=\"password\"></spa-text>\r\n </div>\r\n\r\n <div class=\"col\">\r\n <spa-text id=\"txtConfirmPassword\" display=\"Confirm Password\" [(value)]=\"changePassword.confirmPassword\" width=\"300px\" type=\"password\"></spa-text>\r\n </div>\r\n\r\n <div class=\"col mt-3\">\r\n <button id=\"btnChange\" mat-raised-button color=\"primary\" (click)=\"change()\" cdkFocusInitial>Change</button>\r\n </div>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n <div class=\"col\">\r\n\r\n <div class=\"alert alert-info\" style=\"font-size: 14px;\" role=\"alert\">\r\n <b>*Please consider these requirements for your new password.</b> <br><br>\r\n\r\n At least 8 characters<br>\r\n At least 1 uppercase letter (A-Z)<br>\r\n At least 2 lowercase letters (a-z)<br>\r\n At least 1 digit (0-9)<br>\r\n At least 1 special character (~`! \u2026)<br>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n\r\n\r\n\r\n\r\n </div>\r\n</div> -->\r\n\r\n", styles: [""], dependencies: [{ kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: TextComponent, selector: "spa-text", inputs: ["readonly", "hint", "display", "placeholder", "value", "format", "type", "rows", "width", "options", "optionValue", "required", "min", "max", "regex"], outputs: ["valueChange", "leave", "enterPress"] }] });
3164
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ChangePasswordComponent, decorators: [{
3165
+ type: Component,
3166
+ args: [{ selector: 'spa-change-password', template: "<h4>Change Password</h4>\r\n<hr>\r\n\r\n\r\n<div class=\"container tin-grid\" style=\"font-size:14px;\">\r\n\r\n <div class=\"fill\">\r\n\r\n <spa-text id=\"txtuserName\" display=\"Username\" [(value)]=\"changePassword.userName\" [readonly]=\"true\"></spa-text>\r\n <spa-text id=\"txtPassword\" display=\"Current Password\" [(value)]=\"changePassword.currentPassword\" type=\"password\"></spa-text>\r\n <spa-text id=\"txtNewPassword\" display=\"New Password\" [(value)]=\"changePassword.newPassword\" type=\"password\"></spa-text>\r\n <spa-text id=\"txtConfirmPassword\" display=\"Confirm Password\" [(value)]=\"changePassword.confirmPassword\" type=\"password\"></spa-text>\r\n <button id=\"btnChange\" mat-raised-button color=\"primary\" (click)=\"change()\" cdkFocusInitial>Change</button>\r\n\r\n </div>\r\n\r\n <div class=\"alert alert-info\" style=\"font-size: 14px;\" role=\"alert\">\r\n <b>*Please consider these requirements for your new password.</b> <br><br>\r\n\r\n At least 8 characters<br>\r\n At least 1 uppercase letter (A-Z)<br>\r\n At least 2 lowercase letters (a-z)<br>\r\n At least 1 digit (0-9)<br>\r\n At least 1 special character (~`! \u2026)<br>\r\n\r\n </div>\r\n\r\n</div>\r\n\r\n\r\n<!-- <div class=\"container\">\r\n\r\n <div class=\"d-flex justify-content-center row align-items-center\" >\r\n\r\n <div class=\"col\">\r\n\r\n <div class=\"tin-input \" style=\"font-size:14px;\">\r\n\r\n <div class=\"col\" *ngIf=\"changePassword.userName!=''\">\r\n <spa-text id=\"txtuserName\" display=\"Username\" [(value)]=\"changePassword.userName\" width=\"300px\" [readonly]=\"true\"></spa-text>\r\n </div>\r\n\r\n <div class=\"col\" *ngIf=\"!myRole[dataService.capUsers.name]\">\r\n <spa-text id=\"txtPassword\" display=\"Current Password\" [(value)]=\"changePassword.currentPassword\" width=\"300px\" type=\"password\"></spa-text>\r\n </div>\r\n\r\n <div class=\"col\">\r\n <spa-text id=\"txtNewPassword\" display=\"New Password\" [(value)]=\"changePassword.newPassword\" width=\"300px\" type=\"password\"></spa-text>\r\n </div>\r\n\r\n <div class=\"col\">\r\n <spa-text id=\"txtConfirmPassword\" display=\"Confirm Password\" [(value)]=\"changePassword.confirmPassword\" width=\"300px\" type=\"password\"></spa-text>\r\n </div>\r\n\r\n <div class=\"col mt-3\">\r\n <button id=\"btnChange\" mat-raised-button color=\"primary\" (click)=\"change()\" cdkFocusInitial>Change</button>\r\n </div>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n <div class=\"col\">\r\n\r\n <div class=\"alert alert-info\" style=\"font-size: 14px;\" role=\"alert\">\r\n <b>*Please consider these requirements for your new password.</b> <br><br>\r\n\r\n At least 8 characters<br>\r\n At least 1 uppercase letter (A-Z)<br>\r\n At least 2 lowercase letters (a-z)<br>\r\n At least 1 digit (0-9)<br>\r\n At least 1 special character (~`! \u2026)<br>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n\r\n\r\n\r\n\r\n </div>\r\n</div> -->\r\n\r\n" }]
3167
+ }], ctorParameters: function () { return [{ type: i1$3.Router }, { type: i1.Location }, { type: HttpService }, { type: MessageService }, { type: DataServiceLib }, { type: AuthService }, { type: i1$3.ActivatedRoute }]; } });
3168
+
3169
+ class ProfileComponent {
3170
+ constructor(dataService, messageService, httpService, router, authService) {
3171
+ this.dataService = dataService;
3172
+ this.messageService = messageService;
3173
+ this.httpService = httpService;
3174
+ this.router = router;
3175
+ this.authService = authService;
3176
+ this.initials = "";
3177
+ this.appConfig = new AppConfig();
3178
+ this.selfProfile = false;
3179
+ }
3180
+ ngOnInit() {
3181
+ this.myRole = this.authService.currentRoleSource.value;
3182
+ if (this.dataService.tmpProfileuserName == "") {
3183
+ this.loadProfile(this.authService.currentUser);
3184
+ }
3185
+ else {
3186
+ this.loadProfile(this.dataService.tmpProfileuserName);
3187
+ this.dataService.tmpProfileuserName = "";
3188
+ }
3189
+ }
3190
+ loadProfile(userName) {
3191
+ let action = "all";
3192
+ this.dataService.GetUserByID(userName).subscribe((apiResponse) => {
3193
+ var _a, _b;
3194
+ this.profile = apiResponse[0];
3195
+ if (this.profile.userName.toLocaleLowerCase() == this.authService.currentUser.toLocaleLowerCase()) {
3196
+ this.selfProfile = true;
3197
+ }
3198
+ this.loadRoles();
3199
+ this.initials = `${(_a = this.profile.firstName) === null || _a === void 0 ? void 0 : _a.toUpperCase().charAt(0)}${(_b = this.profile.lastName) === null || _b === void 0 ? void 0 : _b.toUpperCase().charAt(0)}`;
3200
+ }, (error) => {
3201
+ this.isProcessing = false;
3202
+ this.messageService.toast(this.httpService.Error(error));
3203
+ });
3204
+ }
3205
+ loadRoles() {
3206
+ this.dataService.GetRole("all", "").subscribe((apiResponse) => {
3207
+ this.roles = apiResponse;
3208
+ console.log(this.roles);
3209
+ }, (error) => {
3210
+ this.isProcessing = false;
3211
+ this.messageService.toast(this.httpService.Error(error));
3212
+ });
3213
+ }
3214
+ changePassword() {
3215
+ this.dataService.tmpProfileuserName = this.profile.userName;
3216
+ this.router.navigate(["home/user/change-password"]);
3217
+ }
3218
+ gotoUsers() {
3219
+ this.router.navigate(["home/admin/users"]);
3220
+ }
3221
+ update() {
3222
+ }
3223
+ updateProfile() {
3224
+ this.isProcessing = true;
3225
+ // console.log(this.profile)
3226
+ // return
3227
+ this.dataService.UpdateUser(this.profile).subscribe((apiResponse) => {
3228
+ this.isProcessing = false;
3229
+ if (apiResponse.success) {
3230
+ this.messageService.toast("Profile Updated");
3231
+ }
3232
+ else {
3233
+ this.messageService.toast("Error: " + apiResponse.message);
3234
+ }
3235
+ }, (error) => {
3236
+ this.messageService.toast("Connection failed ");
3237
+ this.isProcessing = false;
3238
+ });
3239
+ }
3240
+ }
3241
+ ProfileComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ProfileComponent, deps: [{ token: DataServiceLib }, { token: MessageService }, { token: HttpService }, { token: i1$3.Router }, { token: AuthService }], target: i0.ɵɵFactoryTarget.Component });
3242
+ ProfileComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ProfileComponent, selector: "spa-profile", inputs: { appConfig: "appConfig" }, ngImport: i0, template: "\r\n<h4>Profile</h4>\r\n<hr>\r\n\r\n<div class=\"container tin-grid-auto\" style=\"font-size:14px;\">\r\n\r\n <div class=\"tin-center centa\">\r\n <div class=\"profileImage\">{{initials}}</div>\r\n <mat-label id=\"lbluserName\" >{{profile?.userName}}</mat-label>\r\n </div>\r\n\r\n <div>\r\n\r\n <spa-text id=\"txtFirstName\" display=\"First Name\" [(value)]=\"profile.firstName\" [readonly]=\"selfProfile\"></spa-text>\r\n <spa-text id=\"txtLastName\" display=\"Last Name\" [(value)]=\"profile.lastName\" [readonly]=\"selfProfile\"></spa-text>\r\n <spa-text id=\"txtAuth\" display=\"Authentication\" [(value)]=\"profile.authType\" [readonly]=\"true\"></spa-text>\r\n <spa-text id=\"txtEmail\" display=\"Email\" [(value)]=\"profile.email\" [readonly]=\"selfProfile\"></spa-text>\r\n <spa-select id=\"cboRole\" display=\"Role\" [options]=\"roles\" optionDisplay=\"roleName\" optionValue=\"roleID\" [(value)]=\"profile.roleID\" [readonly]=\"selfProfile\"></spa-select>\r\n\r\n <button id=\"btnUpdate\" class=\"w-100\" mat-raised-button color=\"primary\" *ngIf=\"!selfProfile\" [disabled]=\"isProcessing\" (click)=\"updateProfile()\">Update Profile</button>\r\n </div>\r\n\r\n\r\n <div class=\"tin-center centa\">\r\n <a mat-button id=\"lnkUserManager\" style=\"margin-left: 1em\" *ngIf=\"!selfProfile\" (click)=\"gotoUsers()\">User Manager</a>\r\n <a mat-button id=\"lnkChangePassword\" style=\"margin-left: 1em\" *ngIf=\"(selfProfile || myRole[dataService.capUsers.name]) && profile.authType=='local'\" (click)=\"changePassword()\">Change Password</a>\r\n </div>\r\n\r\n\r\n</div>\r\n\r\n\r\n\r\n\r\n\r\n", styles: [".centa{display:flex;flex-direction:column}.profileImage{width:150px;height:150px;border-radius:50%;background:#512DA8;font-size:50px;color:#fff;text-align:center;line-height:150px;margin:20px 0 0}#lbluserName{font-size:20px;font-style:italic}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i5.MatAnchor, selector: "a[mat-button], a[mat-raised-button], a[mat-icon-button], a[mat-fab], a[mat-mini-fab], a[mat-stroked-button], a[mat-flat-button]", inputs: ["disabled", "disableRipple", "color", "tabIndex"], exportAs: ["matButton", "matAnchor"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "component", type: TextComponent, selector: "spa-text", inputs: ["readonly", "hint", "display", "placeholder", "value", "format", "type", "rows", "width", "options", "optionValue", "required", "min", "max", "regex"], outputs: ["valueChange", "leave", "enterPress"] }, { kind: "component", type: SelectComponent, selector: "spa-select", inputs: ["width", "readonly", "readonlyMode", "hint", "placeholder", "multiple", "display", "value", "options", "optionValue", "optionDisplay", "optionDisplayExtra"], outputs: ["valueChange"] }] });
3243
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ProfileComponent, decorators: [{
3244
+ type: Component,
3245
+ args: [{ selector: 'spa-profile', template: "\r\n<h4>Profile</h4>\r\n<hr>\r\n\r\n<div class=\"container tin-grid-auto\" style=\"font-size:14px;\">\r\n\r\n <div class=\"tin-center centa\">\r\n <div class=\"profileImage\">{{initials}}</div>\r\n <mat-label id=\"lbluserName\" >{{profile?.userName}}</mat-label>\r\n </div>\r\n\r\n <div>\r\n\r\n <spa-text id=\"txtFirstName\" display=\"First Name\" [(value)]=\"profile.firstName\" [readonly]=\"selfProfile\"></spa-text>\r\n <spa-text id=\"txtLastName\" display=\"Last Name\" [(value)]=\"profile.lastName\" [readonly]=\"selfProfile\"></spa-text>\r\n <spa-text id=\"txtAuth\" display=\"Authentication\" [(value)]=\"profile.authType\" [readonly]=\"true\"></spa-text>\r\n <spa-text id=\"txtEmail\" display=\"Email\" [(value)]=\"profile.email\" [readonly]=\"selfProfile\"></spa-text>\r\n <spa-select id=\"cboRole\" display=\"Role\" [options]=\"roles\" optionDisplay=\"roleName\" optionValue=\"roleID\" [(value)]=\"profile.roleID\" [readonly]=\"selfProfile\"></spa-select>\r\n\r\n <button id=\"btnUpdate\" class=\"w-100\" mat-raised-button color=\"primary\" *ngIf=\"!selfProfile\" [disabled]=\"isProcessing\" (click)=\"updateProfile()\">Update Profile</button>\r\n </div>\r\n\r\n\r\n <div class=\"tin-center centa\">\r\n <a mat-button id=\"lnkUserManager\" style=\"margin-left: 1em\" *ngIf=\"!selfProfile\" (click)=\"gotoUsers()\">User Manager</a>\r\n <a mat-button id=\"lnkChangePassword\" style=\"margin-left: 1em\" *ngIf=\"(selfProfile || myRole[dataService.capUsers.name]) && profile.authType=='local'\" (click)=\"changePassword()\">Change Password</a>\r\n </div>\r\n\r\n\r\n</div>\r\n\r\n\r\n\r\n\r\n\r\n", styles: [".centa{display:flex;flex-direction:column}.profileImage{width:150px;height:150px;border-radius:50%;background:#512DA8;font-size:50px;color:#fff;text-align:center;line-height:150px;margin:20px 0 0}#lbluserName{font-size:20px;font-style:italic}\n"] }]
3246
+ }], ctorParameters: function () { return [{ type: DataServiceLib }, { type: MessageService }, { type: HttpService }, { type: i1$3.Router }, { type: AuthService }]; }, propDecorators: { appConfig: [{
3247
+ type: Input
3248
+ }] } });
3249
+
3250
+ class SpaUserModule {
3251
+ }
3252
+ SpaUserModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SpaUserModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3253
+ SpaUserModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: SpaUserModule, declarations: [ChangePasswordComponent, ProfileComponent], imports: [i2.ReactiveFormsModule, CommonModule,
3254
+ FormsModule,
3255
+ ReactiveFormsModule,
3256
+ // SpaMatModule,
3257
+ TinSpaModule], exports: [CommonModule,
3258
+ FormsModule,
3259
+ // SpaMatModule,
3260
+ ChangePasswordComponent,
3261
+ ProfileComponent] });
3262
+ SpaUserModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SpaUserModule, imports: [ReactiveFormsModule.withConfig({ warnOnNgModelWithFormControl: "never" }),
3263
+ CommonModule,
3264
+ FormsModule,
3265
+ ReactiveFormsModule,
3266
+ // SpaMatModule,
3267
+ TinSpaModule, CommonModule,
3268
+ FormsModule] });
3269
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SpaUserModule, decorators: [{
3270
+ type: NgModule,
3271
+ args: [{
3272
+ declarations: [ChangePasswordComponent, ProfileComponent],
3273
+ imports: [
3274
+ ReactiveFormsModule.withConfig({ warnOnNgModelWithFormControl: "never" }),
3275
+ CommonModule,
3276
+ FormsModule,
3277
+ ReactiveFormsModule,
3278
+ // SpaMatModule,
3279
+ TinSpaModule
3280
+ ],
3281
+ exports: [
3282
+ CommonModule,
3283
+ FormsModule,
3284
+ // SpaMatModule,
3285
+ ChangePasswordComponent,
3286
+ ProfileComponent,
3287
+ ],
3288
+ }]
3289
+ }] });
3290
+
3291
+ // import { ApiResponse } from 'tin-core';
3292
+ class SettingsComponent {
3293
+ constructor(dataService, messageService) {
3294
+ this.dataService = dataService;
3295
+ this.messageService = messageService;
3296
+ this._filterText = "";
3297
+ this.isProcessing = false;
3298
+ }
3299
+ ngOnInit() {
3300
+ this.loadSettings();
3301
+ }
3302
+ applyFilter(filterValue) {
3303
+ this.settings.filter = filterValue.trim().toLowerCase();
3304
+ }
3305
+ loadSettings() {
3306
+ this.dataService.GetSetting("all", "").subscribe((apiResponse) => {
3307
+ this.settings = apiResponse;
3308
+ });
3309
+ }
3310
+ updateSetting(setting) {
3311
+ this.isProcessing = true;
3312
+ this.dataService.UpdateSetting(setting, "edit").subscribe((apiResponse) => {
3313
+ this.isProcessing = false;
3314
+ if (apiResponse.success) {
3315
+ this.messageService.toast(`Setting ${setting.sName} Updated`);
3316
+ this.loadSettings();
3317
+ }
3318
+ else {
3319
+ this.messageService.toast("Error: " + apiResponse.message);
3320
+ }
3321
+ });
3322
+ }
3323
+ ;
3324
+ addSetting() {
3325
+ // const dialogRef = this.dialog.open(addRoleDialog, {
3326
+ // width: "1100px",
3327
+ // data: "",
3328
+ // });
3329
+ // dialogRef.afterClosed().subscribe((result) => {
3330
+ // if (result == "success") {
3331
+ // this.loadRoles();
3332
+ // }
3333
+ // });
3334
+ this.messageService.toast("Feature not Available");
3335
+ }
3336
+ }
3337
+ SettingsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SettingsComponent, deps: [{ token: DataServiceLib }, { token: MessageService }], target: i0.ɵɵFactoryTarget.Component });
3338
+ SettingsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: SettingsComponent, selector: "spa-settings", ngImport: i0, template: "<h4>Settings</h4>\r\n<hr>\r\n\r\n<div class=\"container\">\r\n\r\n <div class=\"row justify-content-between\" style=\"padding-bottom: 10px;padding-left:10px\">\r\n\r\n <div class=\"col-2\">\r\n <!-- <button mat-raised-button (click)=\"addSetting()\">New Setting</button> -->\r\n </div>\r\n <div class=\"col-2\">\r\n <button mat-raised-button (click)=\"loadSettings()\">Refresh</button>\r\n </div>\r\n </div>\r\n\r\n\r\n <div class=\"row mt-1 mb-1\" style=\"margin-left:10px\" *ngFor=\"let setting of settings\">\r\n\r\n <mat-form-field style=\"width: 500px; font-size: 14px;\">\r\n <mat-label>{{setting.sName}}</mat-label>\r\n <input matInput autocomplete=\"off\" [(ngModel)]=\"setting.sValue\" >\r\n </mat-form-field>\r\n\r\n <button mat-mini-fab color=\"primary\" (click)=\"updateSetting(setting)\" style=\"margin-right:150px;\"><mat-icon>done_all</mat-icon></button>\r\n\r\n <mat-label style=\"font-size: small;\">Last Updated by {{setting.updatedBy}} on {{setting.updatedDate | date: 'dd MMM yy HH:mm'}}</mat-label>\r\n\r\n </div>\r\n\r\n\r\n</div>\r\n\r\n", styles: [".mat-mini-fab{width:32px;height:32px}.mat-mini-fab mat-icon{font-size:16px;margin-top:-3px}\n"], dependencies: [{ kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "pipe", type: i1.DatePipe, name: "date" }] });
3339
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SettingsComponent, decorators: [{
3340
+ type: Component,
3341
+ args: [{ selector: 'spa-settings', template: "<h4>Settings</h4>\r\n<hr>\r\n\r\n<div class=\"container\">\r\n\r\n <div class=\"row justify-content-between\" style=\"padding-bottom: 10px;padding-left:10px\">\r\n\r\n <div class=\"col-2\">\r\n <!-- <button mat-raised-button (click)=\"addSetting()\">New Setting</button> -->\r\n </div>\r\n <div class=\"col-2\">\r\n <button mat-raised-button (click)=\"loadSettings()\">Refresh</button>\r\n </div>\r\n </div>\r\n\r\n\r\n <div class=\"row mt-1 mb-1\" style=\"margin-left:10px\" *ngFor=\"let setting of settings\">\r\n\r\n <mat-form-field style=\"width: 500px; font-size: 14px;\">\r\n <mat-label>{{setting.sName}}</mat-label>\r\n <input matInput autocomplete=\"off\" [(ngModel)]=\"setting.sValue\" >\r\n </mat-form-field>\r\n\r\n <button mat-mini-fab color=\"primary\" (click)=\"updateSetting(setting)\" style=\"margin-right:150px;\"><mat-icon>done_all</mat-icon></button>\r\n\r\n <mat-label style=\"font-size: small;\">Last Updated by {{setting.updatedBy}} on {{setting.updatedDate | date: 'dd MMM yy HH:mm'}}</mat-label>\r\n\r\n </div>\r\n\r\n\r\n</div>\r\n\r\n", styles: [".mat-mini-fab{width:32px;height:32px}.mat-mini-fab mat-icon{font-size:16px;margin-top:-3px}\n"] }]
3342
+ }], ctorParameters: function () { return [{ type: DataServiceLib }, { type: MessageService }]; } });
3343
+
3344
+ class LogsComponent {
3345
+ constructor(authService, dataService) {
3346
+ this.authService = authService;
3347
+ this.dataService = dataService;
3348
+ this.isProcessing = false;
3349
+ this.displayedColumns = ["dateLogged", "userName", "fullName", "source", "details"];
3350
+ }
3351
+ ngOnInit() {
3352
+ this.authService.isAuthorised(this.dataService.capLogs.name);
3353
+ this.loadLogs();
3354
+ }
3355
+ loadLogs() {
3356
+ this.dataService.GetLog("all", "").subscribe((apiResponse) => {
3357
+ this.logs = new MatTableDataSource(apiResponse);
3358
+ this.logs.paginator = this.logsPaginator;
3359
+ });
3360
+ }
3361
+ }
3362
+ LogsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LogsComponent, deps: [{ token: AuthService }, { token: DataServiceLib }], target: i0.ɵɵFactoryTarget.Component });
3363
+ LogsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: LogsComponent, selector: "spa-logs", viewQueries: [{ propertyName: "logsPaginator", first: true, predicate: ["logsPaginator"], descendants: true }], ngImport: i0, template: "<h4>Logs</h4>\r\n<hr />\r\n\r\n<div class=\"container-fluid\">\r\n\r\n <div class=\"row justify-content-between\" style=\"padding-bottom: 10px\">\r\n\r\n <div class=\"col-2\">\r\n </div>\r\n\r\n <div class=\"d-flex justify-content-end\">\r\n <spa-filter [data]=\"logs\" (refreshClick)=\"loadLogs()\"></spa-filter>\r\n </div>\r\n </div>\r\n\r\n\r\n\r\n <p *ngIf=\"!logs\"><em>Loading...</em></p>\r\n\r\n\r\n <div class=\"mat-elevation-z8\" *ngIf=\"logs\">\r\n\r\n <table id=\"tblTable\" mat-table [dataSource]=\"logs\">\r\n\r\n\r\n <ng-container matColumnDef=\"userName\">\r\n <th mat-header-cell *matHeaderCellDef> User </th>\r\n <td mat-cell *matCellDef=\"let log\"> {{log.userName}} </td>\r\n </ng-container>\r\n\r\n\r\n <ng-container matColumnDef=\"dateLogged\">\r\n <th mat-header-cell *matHeaderCellDef class=\"datetime\"> Date Logged </th>\r\n <td mat-cell *matCellDef=\"let log\"> {{log.dateLogged | date: 'dd MMM yy HH:mm:ss'}} </td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"source\">\r\n <th mat-header-cell *matHeaderCellDef> Source </th>\r\n <td mat-cell *matCellDef=\"let log\"> {{log.source}} </td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"details\">\r\n <th mat-header-cell *matHeaderCellDef> Details </th>\r\n <td mat-cell *matCellDef=\"let log\"> {{log.details}} </td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"fullName\">\r\n <th mat-header-cell *matHeaderCellDef> Name </th>\r\n <td mat-cell *matCellDef=\"let log\">{{log.user.firstName}} {{log.user.lastName}}</td>\r\n </ng-container>\r\n\r\n\r\n\r\n\r\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\r\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\"></tr>\r\n\r\n\r\n </table>\r\n\r\n </div>\r\n\r\n <mat-paginator #logsPaginator [pageSizeOptions]=\"[50, 100, 200]\" showFirstLastButtons></mat-paginator>\r\n</div>\r\n\r\n", styles: [".mat-mini-fab{width:32px;height:32px}.mat-mini-fab mat-icon{font-size:16px;margin-top:-3px}.refreshIcon{font-size:22px!important;margin-top:-7px!important}\n"], dependencies: [{ kind: "directive", type: i1.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: i7$1.MatPaginator, selector: "mat-paginator", inputs: ["disabled"], exportAs: ["matPaginator"] }, { kind: "component", type: FilterComponent, selector: "spa-filter", inputs: ["data"], outputs: ["refreshClick"] }, { kind: "pipe", type: i1.DatePipe, name: "date" }] });
3364
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LogsComponent, decorators: [{
3365
+ type: Component,
3366
+ args: [{ selector: 'spa-logs', template: "<h4>Logs</h4>\r\n<hr />\r\n\r\n<div class=\"container-fluid\">\r\n\r\n <div class=\"row justify-content-between\" style=\"padding-bottom: 10px\">\r\n\r\n <div class=\"col-2\">\r\n </div>\r\n\r\n <div class=\"d-flex justify-content-end\">\r\n <spa-filter [data]=\"logs\" (refreshClick)=\"loadLogs()\"></spa-filter>\r\n </div>\r\n </div>\r\n\r\n\r\n\r\n <p *ngIf=\"!logs\"><em>Loading...</em></p>\r\n\r\n\r\n <div class=\"mat-elevation-z8\" *ngIf=\"logs\">\r\n\r\n <table id=\"tblTable\" mat-table [dataSource]=\"logs\">\r\n\r\n\r\n <ng-container matColumnDef=\"userName\">\r\n <th mat-header-cell *matHeaderCellDef> User </th>\r\n <td mat-cell *matCellDef=\"let log\"> {{log.userName}} </td>\r\n </ng-container>\r\n\r\n\r\n <ng-container matColumnDef=\"dateLogged\">\r\n <th mat-header-cell *matHeaderCellDef class=\"datetime\"> Date Logged </th>\r\n <td mat-cell *matCellDef=\"let log\"> {{log.dateLogged | date: 'dd MMM yy HH:mm:ss'}} </td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"source\">\r\n <th mat-header-cell *matHeaderCellDef> Source </th>\r\n <td mat-cell *matCellDef=\"let log\"> {{log.source}} </td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"details\">\r\n <th mat-header-cell *matHeaderCellDef> Details </th>\r\n <td mat-cell *matCellDef=\"let log\"> {{log.details}} </td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"fullName\">\r\n <th mat-header-cell *matHeaderCellDef> Name </th>\r\n <td mat-cell *matCellDef=\"let log\">{{log.user.firstName}} {{log.user.lastName}}</td>\r\n </ng-container>\r\n\r\n\r\n\r\n\r\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\r\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\"></tr>\r\n\r\n\r\n </table>\r\n\r\n </div>\r\n\r\n <mat-paginator #logsPaginator [pageSizeOptions]=\"[50, 100, 200]\" showFirstLastButtons></mat-paginator>\r\n</div>\r\n\r\n", styles: [".mat-mini-fab{width:32px;height:32px}.mat-mini-fab mat-icon{font-size:16px;margin-top:-3px}.refreshIcon{font-size:22px!important;margin-top:-7px!important}\n"] }]
3367
+ }], ctorParameters: function () { return [{ type: AuthService }, { type: DataServiceLib }]; }, propDecorators: { logsPaginator: [{
3368
+ type: ViewChild,
3369
+ args: ["logsPaginator"]
3370
+ }] } });
3371
+
3372
+ class UsersComponent {
3373
+ constructor(httpService, router, authService, dataService, dialog, messageService) {
3374
+ this.httpService = httpService;
3375
+ this.router = router;
3376
+ this.authService = authService;
3377
+ this.dataService = dataService;
3378
+ this.dialog = dialog;
3379
+ this.messageService = messageService;
3380
+ this.isProcessing = false;
3381
+ this._filterText = "";
3382
+ this.displayedColumns = ["userName", "fullName", "roleName", "locked", "dateCreated", "Action"];
3383
+ }
3384
+ ngOnInit() {
3385
+ this.authService.isAuthorised(this.dataService.capUsers.name);
3386
+ this.UpdateData();
3387
+ }
3388
+ UpdateData() {
3389
+ this.dataService.GetUser().subscribe((apiResponse) => {
3390
+ console.log(apiResponse);
3391
+ this.usersRaw = apiResponse;
3392
+ this.users = new MatTableDataSource(apiResponse);
3393
+ this.users.paginator = this.usersPaginator;
3394
+ this.applyFilter(this._filterText);
3395
+ }, (error) => {
3396
+ this.isProcessing = false;
3397
+ this.messageService.toast(this.httpService.Error(error));
3398
+ });
3399
+ }
3400
+ applyFilter(filterValue) {
3401
+ this.users.filter = filterValue.trim().toLowerCase();
3402
+ }
3403
+ createAccount() {
3404
+ this.router.navigate(["home/admin/create-account"]);
3405
+ }
3406
+ viewProfile(user) {
3407
+ this.dataService.tmpProfileuserName = user.userName;
3408
+ this.router.navigate(["home/user/profile"]);
3409
+ }
3410
+ lock(u) {
3411
+ let login = { userName: u.userName, password: "Abcdef@123" };
3412
+ this.dataService.LockUser(login).subscribe((apiResponse) => {
3413
+ if (apiResponse.success) {
3414
+ this.messageService.toast("User Locked");
3415
+ this.UpdateData();
3416
+ }
3417
+ else {
3418
+ this.messageService.toast("Error: " + apiResponse);
3419
+ }
3420
+ });
3421
+ }
3422
+ unlock(u) {
3423
+ let login = { userName: u.userName, password: "Abcdef@123" };
3424
+ this.dataService.UnlockUser(login).subscribe((apiResponse) => {
3425
+ if (apiResponse.success) {
3426
+ this.messageService.toast("User Unlocked");
3427
+ this.UpdateData();
3428
+ }
3429
+ else {
3430
+ this.messageService.toast("Error: " + apiResponse);
3431
+ }
3432
+ });
3433
+ }
3434
+ recover(u) {
3435
+ this.dataService.SelfReset(u).subscribe((apiResponse) => {
3436
+ if (apiResponse.message == "success") {
3437
+ this.messageService.toast("The password has been sent on email");
3438
+ }
3439
+ else {
3440
+ this.messageService.toast("Error: " + apiResponse.message);
3441
+ }
3442
+ });
3443
+ }
3444
+ deleteUser(user) {
3445
+ this.messageService.confirm(`Delete ${user.userName} ?`).subscribe((result) => {
3446
+ if (result == "yes") {
3447
+ this.isProcessing = true;
3448
+ this.dataService.DeleteUser(user).subscribe((apiResponse) => {
3449
+ this.isProcessing = false;
3450
+ if (apiResponse.message == "success") {
3451
+ this.messageService.toast("User Deleted");
3452
+ this.UpdateData();
3453
+ }
3454
+ else {
3455
+ this.messageService.toast("Error: " + apiResponse.message);
3456
+ }
3457
+ }, (error) => {
3458
+ this.messageService.toast("Connection failed ");
3459
+ this.isProcessing = false;
3460
+ });
3461
+ }
3462
+ });
3463
+ }
3464
+ }
3465
+ UsersComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: UsersComponent, deps: [{ token: HttpService }, { token: i1$3.Router }, { token: AuthService }, { token: DataServiceLib }, { token: i4.MatDialog }, { token: MessageService }], target: i0.ɵɵFactoryTarget.Component });
3466
+ UsersComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: UsersComponent, selector: "spa-users", viewQueries: [{ propertyName: "usersPaginator", first: true, predicate: ["usersPaginator"], descendants: true }], ngImport: i0, template: "\r\n<h4>Users</h4>\r\n<hr />\r\n\r\n<div class=\"container\">\r\n\r\n <div class=\"row justify-content-between\" style=\"padding-bottom: 10px\">\r\n <div class=\"col-2\">\r\n <button id=\"btnCreateAccount\" mat-raised-button color=\"primary\" (click)=\"createAccount()\">Create Account</button>\r\n </div>\r\n\r\n <div class=\"d-flex justify-content-end\">\r\n <spa-filter [data]=\"users\" (refreshClick)=\"UpdateData()\"></spa-filter>\r\n </div>\r\n </div>\r\n\r\n\r\n <p *ngIf=\"!users\"><em>Loading...</em></p>\r\n\r\n\r\n <div class=\"mat-elevation-z8\" *ngIf=\"users\">\r\n\r\n <table id=\"tblTable\" mat-table [dataSource]=\"users\">\r\n\r\n <ng-container matColumnDef=\"userName\">\r\n <th mat-header-cell *matHeaderCellDef> userName </th>\r\n <td mat-cell *matCellDef=\"let user\"> {{user.userName}} </td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"locked\">\r\n <th mat-header-cell *matHeaderCellDef> Locked </th>\r\n <td mat-cell *matCellDef=\"let user\"> {{user.locked}} </td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"fullName\">\r\n <th mat-header-cell *matHeaderCellDef> Name </th>\r\n <td mat-cell *matCellDef=\"let user\"> {{user.firstName}} {{user.lastName}} </td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"roleName\">\r\n <th mat-header-cell *matHeaderCellDef> Role </th>\r\n <td mat-cell *matCellDef=\"let user\"> {{user.role.roleName}} </td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"disabled\">\r\n <th mat-header-cell *matHeaderCellDef> Disabled </th>\r\n <td mat-cell *matCellDef=\"let user\"> {{user.disabled}} </td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"dateCreated\">\r\n <th mat-header-cell *matHeaderCellDef> Created </th>\r\n <td mat-cell *matCellDef=\"let user\"> {{user.createdDate | date: 'dd/MM/yyyy'}} </td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"dateUpdated\">\r\n <th mat-header-cell *matHeaderCellDef> Updated </th>\r\n <td mat-cell *matCellDef=\"let user\"> {{user.updatedDate | date: 'dd/MM/yyyy'}} </td>\r\n </ng-container>\r\n\r\n\r\n <ng-container matColumnDef=\"Action\">\r\n <th mat-header-cell *matHeaderCellDef> Action </th>\r\n <td mat-cell *matCellDef=\"let user\" style=\"width: 250px;\">\r\n\r\n <button mat-mini-fab color=\"primary\" (click)=\"viewProfile(user)\" style=\"margin-right:30px\" matTooltip=\"View Profile\" matTooltipPosition=\"above\"> <mat-icon>account_circle</mat-icon></button>\r\n\r\n <button *ngIf=\"user.locked=='0'\" mat-mini-fab color=\"warn\" (click)=\"lock(user)\" style=\"margin-right:10px\" matTooltip=\"Lock\" matTooltipPosition=\"above\"> <mat-icon>lock</mat-icon></button>\r\n <button *ngIf=\"user.locked=='1'\" mat-mini-fab (click)=\"unlock(user)\" style=\"margin-right:10px; background-color: green;\" matTooltip=\"Unlock\" matTooltipPosition=\"above\"> <mat-icon >lock_open</mat-icon></button>\r\n\r\n <!-- <button *ngIf=\"user.disabled=='0'\" mat-mini-fab color=\"warn\" (click)=\"disable(user)\" style=\"margin-right:10px\" matTooltip=\"Disable\" matTooltipPosition=\"above\"> <mat-icon>block</mat-icon></button>\r\n <button *ngIf=\"user.disabled=='1'\" mat-mini-fab (click)=\"enable(user)\" style=\"margin-right:10px; background-color: green\" matTooltip=\"Enable\" matTooltipPosition=\"above\"> <mat-icon>done</mat-icon></button> -->\r\n\r\n <button mat-mini-fab color=\"warn\" (click)=\"deleteUser(user)\" style=\"margin-right:10px\" matTooltip=\"Delete\" matTooltipPosition=\"above\"> <mat-icon>delete</mat-icon></button>\r\n <!-- <button mat-mini-fab color=\"primary\" (click)=\"recover(user)\" style=\"margin-right:10px\" matTooltip=\"Reset Password\" matTooltipPosition=\"above\"> <mat-icon>vpn_key</mat-icon></button> -->\r\n\r\n\r\n\r\n </td>\r\n </ng-container>\r\n\r\n\r\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\r\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\" [ngClass]=\"{'make-gray': row.disabled =='1'}\"></tr>\r\n\r\n </table>\r\n\r\n </div>\r\n\r\n <mat-paginator #usersPaginator [pageSizeOptions]=\"[10, 20, 50]\" showFirstLastButtons></mat-paginator>\r\n</div>\r\n\r\n<!-- ------------------ -->\r\n\r\n<!-- <div class=\"container mt-5\" style=\" font-size: 14px;\">\r\n<spa-table [data]=\"usersRaw\" [config]=\"config\" (refreshClick)=\"UpdateData()\" (viewClick)=\"viewProfile($event)\" (createClick)=\"createAccount()\" (deleteClick)=\"deleteUser($event)\"></spa-table>\r\n</div> -->\r\n\r\n", styles: [".mat-mini-fab{width:32px;height:32px}.mat-mini-fab mat-icon{font-size:16px;margin-top:-3px}.refreshIcon{font-size:22px!important;margin-top:-7px!important}.make-gray{background-color:#d3d3d3}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.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: i7$1.MatPaginator, selector: "mat-paginator", inputs: ["disabled"], exportAs: ["matPaginator"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i6.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "component", type: FilterComponent, selector: "spa-filter", inputs: ["data"], outputs: ["refreshClick"] }, { kind: "pipe", type: i1.DatePipe, name: "date" }] });
3467
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: UsersComponent, decorators: [{
3468
+ type: Component,
3469
+ args: [{ selector: "spa-users", template: "\r\n<h4>Users</h4>\r\n<hr />\r\n\r\n<div class=\"container\">\r\n\r\n <div class=\"row justify-content-between\" style=\"padding-bottom: 10px\">\r\n <div class=\"col-2\">\r\n <button id=\"btnCreateAccount\" mat-raised-button color=\"primary\" (click)=\"createAccount()\">Create Account</button>\r\n </div>\r\n\r\n <div class=\"d-flex justify-content-end\">\r\n <spa-filter [data]=\"users\" (refreshClick)=\"UpdateData()\"></spa-filter>\r\n </div>\r\n </div>\r\n\r\n\r\n <p *ngIf=\"!users\"><em>Loading...</em></p>\r\n\r\n\r\n <div class=\"mat-elevation-z8\" *ngIf=\"users\">\r\n\r\n <table id=\"tblTable\" mat-table [dataSource]=\"users\">\r\n\r\n <ng-container matColumnDef=\"userName\">\r\n <th mat-header-cell *matHeaderCellDef> userName </th>\r\n <td mat-cell *matCellDef=\"let user\"> {{user.userName}} </td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"locked\">\r\n <th mat-header-cell *matHeaderCellDef> Locked </th>\r\n <td mat-cell *matCellDef=\"let user\"> {{user.locked}} </td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"fullName\">\r\n <th mat-header-cell *matHeaderCellDef> Name </th>\r\n <td mat-cell *matCellDef=\"let user\"> {{user.firstName}} {{user.lastName}} </td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"roleName\">\r\n <th mat-header-cell *matHeaderCellDef> Role </th>\r\n <td mat-cell *matCellDef=\"let user\"> {{user.role.roleName}} </td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"disabled\">\r\n <th mat-header-cell *matHeaderCellDef> Disabled </th>\r\n <td mat-cell *matCellDef=\"let user\"> {{user.disabled}} </td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"dateCreated\">\r\n <th mat-header-cell *matHeaderCellDef> Created </th>\r\n <td mat-cell *matCellDef=\"let user\"> {{user.createdDate | date: 'dd/MM/yyyy'}} </td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"dateUpdated\">\r\n <th mat-header-cell *matHeaderCellDef> Updated </th>\r\n <td mat-cell *matCellDef=\"let user\"> {{user.updatedDate | date: 'dd/MM/yyyy'}} </td>\r\n </ng-container>\r\n\r\n\r\n <ng-container matColumnDef=\"Action\">\r\n <th mat-header-cell *matHeaderCellDef> Action </th>\r\n <td mat-cell *matCellDef=\"let user\" style=\"width: 250px;\">\r\n\r\n <button mat-mini-fab color=\"primary\" (click)=\"viewProfile(user)\" style=\"margin-right:30px\" matTooltip=\"View Profile\" matTooltipPosition=\"above\"> <mat-icon>account_circle</mat-icon></button>\r\n\r\n <button *ngIf=\"user.locked=='0'\" mat-mini-fab color=\"warn\" (click)=\"lock(user)\" style=\"margin-right:10px\" matTooltip=\"Lock\" matTooltipPosition=\"above\"> <mat-icon>lock</mat-icon></button>\r\n <button *ngIf=\"user.locked=='1'\" mat-mini-fab (click)=\"unlock(user)\" style=\"margin-right:10px; background-color: green;\" matTooltip=\"Unlock\" matTooltipPosition=\"above\"> <mat-icon >lock_open</mat-icon></button>\r\n\r\n <!-- <button *ngIf=\"user.disabled=='0'\" mat-mini-fab color=\"warn\" (click)=\"disable(user)\" style=\"margin-right:10px\" matTooltip=\"Disable\" matTooltipPosition=\"above\"> <mat-icon>block</mat-icon></button>\r\n <button *ngIf=\"user.disabled=='1'\" mat-mini-fab (click)=\"enable(user)\" style=\"margin-right:10px; background-color: green\" matTooltip=\"Enable\" matTooltipPosition=\"above\"> <mat-icon>done</mat-icon></button> -->\r\n\r\n <button mat-mini-fab color=\"warn\" (click)=\"deleteUser(user)\" style=\"margin-right:10px\" matTooltip=\"Delete\" matTooltipPosition=\"above\"> <mat-icon>delete</mat-icon></button>\r\n <!-- <button mat-mini-fab color=\"primary\" (click)=\"recover(user)\" style=\"margin-right:10px\" matTooltip=\"Reset Password\" matTooltipPosition=\"above\"> <mat-icon>vpn_key</mat-icon></button> -->\r\n\r\n\r\n\r\n </td>\r\n </ng-container>\r\n\r\n\r\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\r\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\" [ngClass]=\"{'make-gray': row.disabled =='1'}\"></tr>\r\n\r\n </table>\r\n\r\n </div>\r\n\r\n <mat-paginator #usersPaginator [pageSizeOptions]=\"[10, 20, 50]\" showFirstLastButtons></mat-paginator>\r\n</div>\r\n\r\n<!-- ------------------ -->\r\n\r\n<!-- <div class=\"container mt-5\" style=\" font-size: 14px;\">\r\n<spa-table [data]=\"usersRaw\" [config]=\"config\" (refreshClick)=\"UpdateData()\" (viewClick)=\"viewProfile($event)\" (createClick)=\"createAccount()\" (deleteClick)=\"deleteUser($event)\"></spa-table>\r\n</div> -->\r\n\r\n", styles: [".mat-mini-fab{width:32px;height:32px}.mat-mini-fab mat-icon{font-size:16px;margin-top:-3px}.refreshIcon{font-size:22px!important;margin-top:-7px!important}.make-gray{background-color:#d3d3d3}\n"] }]
3470
+ }], ctorParameters: function () { return [{ type: HttpService }, { type: i1$3.Router }, { type: AuthService }, { type: DataServiceLib }, { type: i4.MatDialog }, { type: MessageService }]; }, propDecorators: { usersPaginator: [{
3471
+ type: ViewChild,
3472
+ args: ["usersPaginator"]
3473
+ }] } });
3474
+
3475
+ class addRoleDialog {
3476
+ constructor(messageService, dataService, authService, dialogRef, data) {
3477
+ this.messageService = messageService;
3478
+ this.dataService = dataService;
3479
+ this.authService = authService;
3480
+ this.dialogRef = dialogRef;
3481
+ this.data = data;
3482
+ this.role = new Role();
3483
+ }
3484
+ ngOnInit() {
3485
+ this.capItems = this.data;
3486
+ }
3487
+ submit() {
3488
+ if (this.role.roleName == "New Role" || this.role.roleName == "") {
3489
+ this.messageService.toast("Please enter Role Name");
3490
+ return;
3491
+ }
3492
+ this.isProcessing = true;
3493
+ this.dataService.PostRole(this.role, "add").subscribe((apiResponse) => {
3494
+ this.isProcessing = false;
3495
+ if (apiResponse.success) {
3496
+ this.messageService.toast("Role Added");
3497
+ this.dialogRef.close("success");
3498
+ }
3499
+ else {
3500
+ this.messageService.toast("Error: " + apiResponse.message);
3501
+ }
3502
+ }, error => {
3503
+ this.messageService.toast("Connection failed");
3504
+ this.isProcessing = false;
3505
+ });
3506
+ }
3507
+ ;
3508
+ }
3509
+ addRoleDialog.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: addRoleDialog, deps: [{ token: MessageService }, { token: DataServiceLib }, { token: AuthService }, { token: i4.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
3510
+ addRoleDialog.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: addRoleDialog, selector: "app-addRole", ngImport: i0, template: "<mat-form-field>\r\n <mat-label>Role Name</mat-label>\r\n <input matInput autocomplete=\"off\" [(ngModel)]=\"role.roleName\" placeholder=\"Enter Role Name\" />\r\n</mat-form-field>\r\n\r\n<mat-dialog-content class=\"mat-typography\">\r\n\r\n <div class=\"row\" >\r\n\r\n <!-- <div class=\" col-4\">\r\n\r\n <div class=\"row\">\r\n <mat-checkbox color=\"primary\" style=\"margin-right:20px; font-size:14px\" [(ngModel)]=\"role.cap1\">Admin</mat-checkbox>\r\n </div>\r\n\r\n </div> -->\r\n\r\n <div class=\"row\" style=\"margin-left: 2em;margin-right: 2em;\">\r\n\r\n <div class=\"row\" style=\"margin-left: 2em;\" *ngFor=\"let capItem of capItems\">\r\n\r\n <mat-checkbox color=\"primary\" style=\"margin-right:20px; font-size:12px; width: 200px;\" [(ngModel)]=\"role[capItem.name]\">{{capItem.display}}</mat-checkbox>\r\n\r\n <div *ngFor=\"let capSubItem of capItem.capSubItems\">\r\n\r\n <mat-checkbox color=\"primary\" style=\"margin-right:20px; font-size:12px; width: 200px;\" [(ngModel)]=\"role[capSubItem.name]\">{{capSubItem.display}}</mat-checkbox>\r\n\r\n </div>\r\n\r\n\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n</mat-dialog-content>\r\n\r\n<mat-dialog-actions>\r\n <button mat-button [disabled]=\"isProcessing\" (click)=\"submit()\" cdkFocusInitial>Submit</button>\r\n <button mat-button mat-dialog-close=\"success\">Cancel</button>\r\n</mat-dialog-actions>\r\n", styles: [".mat-mini-fab{width:32px;height:32px}.mat-mini-fab mat-icon{font-size:16px;margin-top:-3px}.refreshIcon{font-size:22px!important;margin-top:-7px!important}\n"], dependencies: [{ kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i2$1.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i4.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i4.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i4.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }] });
3511
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: addRoleDialog, decorators: [{
3512
+ type: Component,
3513
+ args: [{ selector: 'app-addRole', template: "<mat-form-field>\r\n <mat-label>Role Name</mat-label>\r\n <input matInput autocomplete=\"off\" [(ngModel)]=\"role.roleName\" placeholder=\"Enter Role Name\" />\r\n</mat-form-field>\r\n\r\n<mat-dialog-content class=\"mat-typography\">\r\n\r\n <div class=\"row\" >\r\n\r\n <!-- <div class=\" col-4\">\r\n\r\n <div class=\"row\">\r\n <mat-checkbox color=\"primary\" style=\"margin-right:20px; font-size:14px\" [(ngModel)]=\"role.cap1\">Admin</mat-checkbox>\r\n </div>\r\n\r\n </div> -->\r\n\r\n <div class=\"row\" style=\"margin-left: 2em;margin-right: 2em;\">\r\n\r\n <div class=\"row\" style=\"margin-left: 2em;\" *ngFor=\"let capItem of capItems\">\r\n\r\n <mat-checkbox color=\"primary\" style=\"margin-right:20px; font-size:12px; width: 200px;\" [(ngModel)]=\"role[capItem.name]\">{{capItem.display}}</mat-checkbox>\r\n\r\n <div *ngFor=\"let capSubItem of capItem.capSubItems\">\r\n\r\n <mat-checkbox color=\"primary\" style=\"margin-right:20px; font-size:12px; width: 200px;\" [(ngModel)]=\"role[capSubItem.name]\">{{capSubItem.display}}</mat-checkbox>\r\n\r\n </div>\r\n\r\n\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n</mat-dialog-content>\r\n\r\n<mat-dialog-actions>\r\n <button mat-button [disabled]=\"isProcessing\" (click)=\"submit()\" cdkFocusInitial>Submit</button>\r\n <button mat-button mat-dialog-close=\"success\">Cancel</button>\r\n</mat-dialog-actions>\r\n", styles: [".mat-mini-fab{width:32px;height:32px}.mat-mini-fab mat-icon{font-size:16px;margin-top:-3px}.refreshIcon{font-size:22px!important;margin-top:-7px!important}\n"] }]
3514
+ }], ctorParameters: function () {
3515
+ return [{ type: MessageService }, { type: DataServiceLib }, { type: AuthService }, { type: i4.MatDialogRef }, { type: undefined, decorators: [{
3516
+ type: Inject,
3517
+ args: [MAT_DIALOG_DATA]
3518
+ }] }];
3519
+ } });
3520
+ ;
3521
+
3522
+ class RolesComponent {
3523
+ constructor(httpService, router, authService, dataService, dialog, messageService) {
3524
+ this.httpService = httpService;
3525
+ this.router = router;
3526
+ this.authService = authService;
3527
+ this.dataService = dataService;
3528
+ this.dialog = dialog;
3529
+ this.messageService = messageService;
3530
+ this.isProcessing = false;
3531
+ this.appConfig = new AppConfig();
3532
+ }
3533
+ ngOnInit() {
3534
+ this.authService.isAuthorised(this.dataService.capRoles.name);
3535
+ this.loadRoles();
3536
+ this.dataService.appConfigObserv.subscribe(x => this.appConfig = x);
3537
+ }
3538
+ loadRoles() {
3539
+ this.dataService.GetRole("all", "").subscribe((apiResponse) => {
3540
+ this.roles = apiResponse;
3541
+ });
3542
+ }
3543
+ refresh() {
3544
+ this.loadRoles();
3545
+ }
3546
+ addRole() {
3547
+ const dialogRef = this.dialog.open(addRoleDialog, {
3548
+ width: "1100px",
3549
+ data: this.appConfig.capItems,
3550
+ });
3551
+ dialogRef.afterClosed().subscribe((result) => {
3552
+ if (result == "success") {
3553
+ this.loadRoles();
3554
+ }
3555
+ });
3556
+ }
3557
+ updateRole(role) {
3558
+ this.messageService.confirm(`UPDATE ${role.roleName} ?`).subscribe((result) => {
3559
+ if (result == "yes") {
3560
+ this.dataService.PostRole(role, "edit").subscribe((apiResponse) => {
3561
+ if (apiResponse.success) {
3562
+ this.messageService.toast("Role Updated");
3563
+ this.loadRoles();
3564
+ }
3565
+ else {
3566
+ this.messageService.toast("Error: " + apiResponse);
3567
+ }
3568
+ });
3569
+ }
3570
+ });
3571
+ }
3572
+ ;
3573
+ deleteRole(role) {
3574
+ this.messageService.confirm(`DELETE ${role.roleName} ?`).subscribe((result) => {
3575
+ if (result == "yes") {
3576
+ this.dataService.PostRole(role, "delete").subscribe((apiResponse) => {
3577
+ if (apiResponse.success) {
3578
+ this.messageService.toast("Role Deleted");
3579
+ this.loadRoles();
3580
+ }
3581
+ else {
3582
+ this.messageService.toast("Error: " + apiResponse);
3583
+ }
3584
+ });
3585
+ }
3586
+ });
3587
+ }
3588
+ }
3589
+ RolesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: RolesComponent, deps: [{ token: HttpService }, { token: i1$3.Router }, { token: AuthService }, { token: DataServiceLib }, { token: i4.MatDialog }, { token: MessageService }], target: i0.ɵɵFactoryTarget.Component });
3590
+ RolesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: RolesComponent, selector: "spa-roles", ngImport: i0, template: "<h4> Roles </h4>\r\n<hr />\r\n\r\n<div class=\"container mb-5\">\r\n\r\n <div class=\"row justify-content-between\" style=\"padding-bottom: 10px;padding-left:10px\">\r\n <div class=\"col-2\">\r\n\r\n <button id=\"btnNewRole\" mat-raised-button color=\"primary\" (click)=\"addRole()\">New Role</button>\r\n </div>\r\n <div class=\"col-1\">\r\n\r\n <button id=\"btnRefresh\" mat-mini-fab color=\"primary\" (click)=\"refresh()\" style=\"margin-right:1em;margin-top:5px\" matTooltip=\"refresh data\" matTooltipPosition=\"right\"><mat-icon class=\"refreshIcon\">refresh</mat-icon></button>\r\n\r\n </div>\r\n </div>\r\n\r\n\r\n <div class=\"row mt-2 mb-1\" style=\"margin-left:10px\" *ngFor=\"let role of roles\">\r\n\r\n <mat-card class=\"mat-elevation-z8\" style=\"width:100%;padding-left:2em\">\r\n\r\n <h4>{{role.roleName}}</h4>\r\n <hr />\r\n\r\n <div class=\"row\" style=\"margin-left: 2em;\">\r\n\r\n\r\n <div class=\"row\" style=\"margin-right:20px;\" *ngFor=\"let capItem of appConfig.capItems\">\r\n\r\n <mat-checkbox color=\"primary\" style=\" font-size:12px; width: 200px;\" [(ngModel)]=\"role[capItem.name]\">{{capItem.display}}</mat-checkbox>\r\n\r\n <div class=\"row\" style=\"margin-right:20px;margin-left: 0px; \" *ngFor=\"let capSubItem of capItem.capSubItems\">\r\n\r\n <mat-checkbox color=\"primary\" style=\" font-size:12px; width: 200px;\" [(ngModel)]=\"role[capSubItem.name]\">{{capSubItem.display}}</mat-checkbox>\r\n\r\n <div class=\"row\" style=\"margin-right:20px;margin-left: 0px;\" *ngFor=\"let capSubSubItem of capSubItem.capSubItems\">\r\n\r\n <mat-checkbox color=\"primary\" style=\"font-size:12px; width: 200px;\" [(ngModel)]=\"role[capSubSubItem.name]\">{{capSubSubItem.display}}</mat-checkbox>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n\r\n <mat-card-actions>\r\n\r\n <button mat-mini-fab color=\"primary\" (click)=\"updateRole(role)\" style=\"margin-right:10px;\">\r\n <mat-icon>done_all</mat-icon>\r\n </button>\r\n\r\n <!-- <button mat-mini-fab color=\"warn\" (click)=\"editRole(role)\" style=\"margin-right:10px\">\r\n <mat-icon>edit</mat-icon>\r\n </button> -->\r\n\r\n <button mat-mini-fab color=\"warn\" (click)=\"deleteRole(role)\" style=\"margin-right:10px\">\r\n <mat-icon>delete</mat-icon>\r\n </button>\r\n\r\n </mat-card-actions>\r\n\r\n </mat-card>\r\n\r\n </div>\r\n\r\n\r\n</div>\r\n\r\n", styles: [".mat-mini-fab{width:32px;height:32px}.mat-mini-fab mat-icon{font-size:16px;margin-top:-3px}.refreshIcon{font-size:22px!important;margin-top:-7px!important}\n"], dependencies: [{ kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i2$1.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i14.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { kind: "directive", type: i14.MatCardActions, selector: "mat-card-actions", inputs: ["align"], exportAs: ["matCardActions"] }, { kind: "directive", type: i6.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }] });
3591
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: RolesComponent, decorators: [{
3592
+ type: Component,
3593
+ args: [{ selector: "spa-roles", template: "<h4> Roles </h4>\r\n<hr />\r\n\r\n<div class=\"container mb-5\">\r\n\r\n <div class=\"row justify-content-between\" style=\"padding-bottom: 10px;padding-left:10px\">\r\n <div class=\"col-2\">\r\n\r\n <button id=\"btnNewRole\" mat-raised-button color=\"primary\" (click)=\"addRole()\">New Role</button>\r\n </div>\r\n <div class=\"col-1\">\r\n\r\n <button id=\"btnRefresh\" mat-mini-fab color=\"primary\" (click)=\"refresh()\" style=\"margin-right:1em;margin-top:5px\" matTooltip=\"refresh data\" matTooltipPosition=\"right\"><mat-icon class=\"refreshIcon\">refresh</mat-icon></button>\r\n\r\n </div>\r\n </div>\r\n\r\n\r\n <div class=\"row mt-2 mb-1\" style=\"margin-left:10px\" *ngFor=\"let role of roles\">\r\n\r\n <mat-card class=\"mat-elevation-z8\" style=\"width:100%;padding-left:2em\">\r\n\r\n <h4>{{role.roleName}}</h4>\r\n <hr />\r\n\r\n <div class=\"row\" style=\"margin-left: 2em;\">\r\n\r\n\r\n <div class=\"row\" style=\"margin-right:20px;\" *ngFor=\"let capItem of appConfig.capItems\">\r\n\r\n <mat-checkbox color=\"primary\" style=\" font-size:12px; width: 200px;\" [(ngModel)]=\"role[capItem.name]\">{{capItem.display}}</mat-checkbox>\r\n\r\n <div class=\"row\" style=\"margin-right:20px;margin-left: 0px; \" *ngFor=\"let capSubItem of capItem.capSubItems\">\r\n\r\n <mat-checkbox color=\"primary\" style=\" font-size:12px; width: 200px;\" [(ngModel)]=\"role[capSubItem.name]\">{{capSubItem.display}}</mat-checkbox>\r\n\r\n <div class=\"row\" style=\"margin-right:20px;margin-left: 0px;\" *ngFor=\"let capSubSubItem of capSubItem.capSubItems\">\r\n\r\n <mat-checkbox color=\"primary\" style=\"font-size:12px; width: 200px;\" [(ngModel)]=\"role[capSubSubItem.name]\">{{capSubSubItem.display}}</mat-checkbox>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n\r\n <mat-card-actions>\r\n\r\n <button mat-mini-fab color=\"primary\" (click)=\"updateRole(role)\" style=\"margin-right:10px;\">\r\n <mat-icon>done_all</mat-icon>\r\n </button>\r\n\r\n <!-- <button mat-mini-fab color=\"warn\" (click)=\"editRole(role)\" style=\"margin-right:10px\">\r\n <mat-icon>edit</mat-icon>\r\n </button> -->\r\n\r\n <button mat-mini-fab color=\"warn\" (click)=\"deleteRole(role)\" style=\"margin-right:10px\">\r\n <mat-icon>delete</mat-icon>\r\n </button>\r\n\r\n </mat-card-actions>\r\n\r\n </mat-card>\r\n\r\n </div>\r\n\r\n\r\n</div>\r\n\r\n", styles: [".mat-mini-fab{width:32px;height:32px}.mat-mini-fab mat-icon{font-size:16px;margin-top:-3px}.refreshIcon{font-size:22px!important;margin-top:-7px!important}\n"] }]
3594
+ }], ctorParameters: function () { return [{ type: HttpService }, { type: i1$3.Router }, { type: AuthService }, { type: DataServiceLib }, { type: i4.MatDialog }, { type: MessageService }]; } });
3595
+
3596
+ class CreateAccountComponent {
3597
+ constructor(httpService, messageService, dataService, authService, router) {
3598
+ this.httpService = httpService;
3599
+ this.messageService = messageService;
3600
+ this.dataService = dataService;
3601
+ this.authService = authService;
3602
+ this.router = router;
3603
+ this.appConfig = new AppConfig();
3604
+ this.isProcessing = false;
3605
+ this.register = new Register();
3606
+ this.openProfile = true;
3607
+ this.authTypes = [
3608
+ { name: "Local Authentication", value: "local" },
3609
+ { name: "AD Authentication", value: "AD" }
3610
+ ];
3611
+ }
3612
+ ngOnInit() {
3613
+ this.appConfig = this.dataService.appConfig;
3614
+ }
3615
+ create() {
3616
+ if (this.register.authType == "") {
3617
+ this.messageService.toast("Choose Authentication Type");
3618
+ return;
3619
+ }
3620
+ this.isProcessing = true;
3621
+ this.dataService.RegisterAccount(this.register).subscribe((apiResponse) => {
3622
+ this.isProcessing = false;
3623
+ if (apiResponse.success) {
3624
+ this.messageService.toast("Account Created");
3625
+ if (this.openProfile) {
3626
+ this.viewProfile(this.register.userName);
3627
+ }
3628
+ else {
3629
+ // this.user = new User();
3630
+ this.register = new Register();
3631
+ this.confirmPassword = "";
3632
+ }
3633
+ }
3634
+ else {
3635
+ this.messageService.toast("Error: " + apiResponse.message);
3636
+ }
3637
+ }, (error) => {
3638
+ this.isProcessing = false;
3639
+ this.messageService.toast(this.httpService.Error(error));
3640
+ });
3641
+ }
3642
+ viewProfile(userName) {
3643
+ this.dataService.tmpProfileuserName = userName;
3644
+ this.router.navigate(["home/user/profile"]);
3645
+ }
3646
+ }
3647
+ CreateAccountComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CreateAccountComponent, deps: [{ token: HttpService }, { token: MessageService }, { token: DataServiceLib }, { token: AuthService }, { token: i1$3.Router }], target: i0.ɵɵFactoryTarget.Component });
3648
+ CreateAccountComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: CreateAccountComponent, selector: "spa-create-account", inputs: { appConfig: "appConfig" }, ngImport: i0, template: "<h4>Create Account</h4>\r\n\r\n<hr/>\r\n\r\n<div class=\"container tin-grid\" style=\"font-size:14px;\">\r\n\r\n <spa-text id=\"txtFirstName\" display=\"FirstName\" [(value)]=\"register.firstName\"></spa-text>\r\n <spa-text id=\"txtLastName\" display=\"LastName\" [(value)]=\"register.lastName\"></spa-text>\r\n\r\n\r\n\r\n <spa-text id=\"txtUserName\" display=\"Username\" [(value)]=\"register.userName\"></spa-text>\r\n\r\n <spa-select id=\"cboAuth\" display=\"Authentication Type\" [options]=\"authTypes\" optionDisplay=\"name\" optionValue=\"value\" [(value)]=\"register.authType\"></spa-select>\r\n\r\n <spa-text id=\"txtPassword\" display=\"Password\" format=\"password\" [(value)]=\"register.password\" ></spa-text>\r\n\r\n <spa-text id=\"txtConfirmPassword\" display=\"Confirm Password\" format=\"password\" [(value)]=\"confirmPassword\" ></spa-text>\r\n\r\n <spa-check display=\"Open profile after creation\" [(value)]=\"openProfile\"></spa-check>\r\n\r\n <div class=\"span-col-center\">\r\n <button id=\"btnCreate\" [disabled]=\"register.authType ==''\" mat-raised-button color=\"primary\" (click)=\"create()\" cdkFocusInitial>Create</button>\r\n </div>\r\n\r\n\r\n\r\n</div>\r\n\r\n\r\n", styles: [""], dependencies: [{ kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: TextComponent, selector: "spa-text", inputs: ["readonly", "hint", "display", "placeholder", "value", "format", "type", "rows", "width", "options", "optionValue", "required", "min", "max", "regex"], outputs: ["valueChange", "leave", "enterPress"] }, { kind: "component", type: SelectComponent, selector: "spa-select", inputs: ["width", "readonly", "readonlyMode", "hint", "placeholder", "multiple", "display", "value", "options", "optionValue", "optionDisplay", "optionDisplayExtra"], outputs: ["valueChange"] }, { kind: "component", type: CheckComponent, selector: "spa-check", inputs: ["readonly", "display", "value"], outputs: ["valueChange", "click", "check", "uncheck"] }] });
3649
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CreateAccountComponent, decorators: [{
3650
+ type: Component,
3651
+ args: [{ selector: 'spa-create-account', template: "<h4>Create Account</h4>\r\n\r\n<hr/>\r\n\r\n<div class=\"container tin-grid\" style=\"font-size:14px;\">\r\n\r\n <spa-text id=\"txtFirstName\" display=\"FirstName\" [(value)]=\"register.firstName\"></spa-text>\r\n <spa-text id=\"txtLastName\" display=\"LastName\" [(value)]=\"register.lastName\"></spa-text>\r\n\r\n\r\n\r\n <spa-text id=\"txtUserName\" display=\"Username\" [(value)]=\"register.userName\"></spa-text>\r\n\r\n <spa-select id=\"cboAuth\" display=\"Authentication Type\" [options]=\"authTypes\" optionDisplay=\"name\" optionValue=\"value\" [(value)]=\"register.authType\"></spa-select>\r\n\r\n <spa-text id=\"txtPassword\" display=\"Password\" format=\"password\" [(value)]=\"register.password\" ></spa-text>\r\n\r\n <spa-text id=\"txtConfirmPassword\" display=\"Confirm Password\" format=\"password\" [(value)]=\"confirmPassword\" ></spa-text>\r\n\r\n <spa-check display=\"Open profile after creation\" [(value)]=\"openProfile\"></spa-check>\r\n\r\n <div class=\"span-col-center\">\r\n <button id=\"btnCreate\" [disabled]=\"register.authType ==''\" mat-raised-button color=\"primary\" (click)=\"create()\" cdkFocusInitial>Create</button>\r\n </div>\r\n\r\n\r\n\r\n</div>\r\n\r\n\r\n" }]
3652
+ }], ctorParameters: function () { return [{ type: HttpService }, { type: MessageService }, { type: DataServiceLib }, { type: AuthService }, { type: i1$3.Router }]; }, propDecorators: { appConfig: [{
3653
+ type: Input
3654
+ }] } });
3655
+
3656
+ class SpaAdminModule {
3657
+ }
3658
+ SpaAdminModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SpaAdminModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3659
+ SpaAdminModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: SpaAdminModule, declarations: [UsersComponent,
3660
+ RolesComponent,
3661
+ addRoleDialog,
3662
+ CreateAccountComponent,
3663
+ LogsComponent,
3664
+ SettingsComponent], imports: [i2.ReactiveFormsModule, CommonModule,
3665
+ FormsModule,
3666
+ ReactiveFormsModule,
3667
+ // SpaMatModule,
3668
+ TinSpaModule], exports: [CommonModule,
3669
+ FormsModule,
3670
+ // SpaMatModule,
3671
+ UsersComponent,
3672
+ RolesComponent,
3673
+ addRoleDialog,
3674
+ CreateAccountComponent,
3675
+ LogsComponent,
3676
+ SettingsComponent] });
3677
+ SpaAdminModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SpaAdminModule, imports: [ReactiveFormsModule.withConfig({ warnOnNgModelWithFormControl: "never" }),
3678
+ CommonModule,
3679
+ FormsModule,
3680
+ ReactiveFormsModule,
3681
+ // SpaMatModule,
3682
+ TinSpaModule, CommonModule,
3683
+ FormsModule] });
3684
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SpaAdminModule, decorators: [{
3685
+ type: NgModule,
3686
+ args: [{
3687
+ declarations: [
3688
+ UsersComponent,
3689
+ RolesComponent,
3690
+ addRoleDialog,
3691
+ CreateAccountComponent,
3692
+ LogsComponent,
3693
+ SettingsComponent
3694
+ ],
3695
+ imports: [
3696
+ ReactiveFormsModule.withConfig({ warnOnNgModelWithFormControl: "never" }),
3697
+ CommonModule,
3698
+ FormsModule,
3699
+ ReactiveFormsModule,
3700
+ // SpaMatModule,
3701
+ TinSpaModule
3702
+ ],
3703
+ exports: [
3704
+ CommonModule,
3705
+ FormsModule,
3706
+ // SpaMatModule,
3707
+ UsersComponent,
3708
+ RolesComponent,
3709
+ addRoleDialog,
3710
+ CreateAccountComponent,
3711
+ LogsComponent,
3712
+ SettingsComponent
3713
+ ],
3714
+ }]
3715
+ }] });
3716
+
3717
+ const routes$2 = [
3718
+ { path: "signup", component: SignupComponent },
3719
+ { path: 'recover-account', component: RecoverAccountComponent },
3720
+ { path: 'login', component: LoginComponent },
3721
+ { path: '', redirectTo: 'login', pathMatch: 'full' },
3722
+ { path: '**', redirectTo: '' },
3723
+ ];
3724
+ class IndexRoutingModule {
3725
+ }
3726
+ IndexRoutingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: IndexRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3727
+ IndexRoutingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: IndexRoutingModule, imports: [i1$3.RouterModule], exports: [RouterModule] });
3728
+ IndexRoutingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: IndexRoutingModule, imports: [RouterModule.forChild(routes$2), RouterModule] });
3729
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: IndexRoutingModule, decorators: [{
3730
+ type: NgModule,
3731
+ args: [{
3732
+ imports: [RouterModule.forChild(routes$2)],
3733
+ exports: [RouterModule]
3734
+ }]
3735
+ }] });
3736
+
3737
+ class IndexModule {
3738
+ }
3739
+ IndexModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: IndexModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3740
+ IndexModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: IndexModule, imports: [CommonModule,
3741
+ IndexRoutingModule,
3742
+ SpaIndexModule] });
3743
+ IndexModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: IndexModule, imports: [CommonModule,
3744
+ IndexRoutingModule,
3745
+ SpaIndexModule] });
3746
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: IndexModule, decorators: [{
3747
+ type: NgModule,
3748
+ args: [{
3749
+ declarations: [],
3750
+ imports: [
3751
+ CommonModule,
3752
+ IndexRoutingModule,
3753
+ SpaIndexModule
3754
+ ]
3755
+ }]
3756
+ }] });
3757
+
3758
+ const routes$1 = [
3759
+ { path: "users", component: UsersComponent },
3760
+ { path: "roles", component: RolesComponent },
3761
+ { path: "create-account", component: CreateAccountComponent },
3762
+ { path: "logs", component: LogsComponent },
3763
+ { path: "settings", component: SettingsComponent },
3764
+ ];
3765
+ class AdminRoutingModule {
3766
+ }
3767
+ AdminRoutingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AdminRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3768
+ AdminRoutingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: AdminRoutingModule, imports: [i1$3.RouterModule], exports: [RouterModule] });
3769
+ AdminRoutingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AdminRoutingModule, imports: [RouterModule.forChild(routes$1), RouterModule] });
3770
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AdminRoutingModule, decorators: [{
3771
+ type: NgModule,
3772
+ args: [{
3773
+ imports: [RouterModule.forChild(routes$1)],
3774
+ exports: [RouterModule]
3775
+ }]
3776
+ }] });
3777
+
3778
+ class AdminModule {
3779
+ }
3780
+ AdminModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AdminModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3781
+ AdminModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: AdminModule, imports: [CommonModule,
3782
+ AdminRoutingModule,
3783
+ SpaAdminModule] });
3784
+ AdminModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AdminModule, imports: [CommonModule,
3785
+ AdminRoutingModule,
3786
+ SpaAdminModule] });
3787
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AdminModule, decorators: [{
3788
+ type: NgModule,
3789
+ args: [{
3790
+ declarations: [],
3791
+ imports: [
3792
+ CommonModule,
3793
+ AdminRoutingModule,
3794
+ SpaAdminModule
3795
+ ]
3796
+ }]
3797
+ }] });
3798
+
3799
+ const routes = [
3800
+ { path: "change-password", component: ChangePasswordComponent },
3801
+ { path: "profile", component: ProfileComponent },
3802
+ ];
3803
+ class UserRoutingModule {
3804
+ }
3805
+ UserRoutingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: UserRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3806
+ UserRoutingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: UserRoutingModule, imports: [i1$3.RouterModule], exports: [RouterModule] });
3807
+ UserRoutingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: UserRoutingModule, imports: [RouterModule.forChild(routes), RouterModule] });
3808
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: UserRoutingModule, decorators: [{
3809
+ type: NgModule,
3810
+ args: [{
3811
+ imports: [RouterModule.forChild(routes)],
3812
+ exports: [RouterModule]
3813
+ }]
3814
+ }] });
3815
+
3816
+ class UserModule {
3817
+ }
3818
+ UserModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: UserModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3819
+ UserModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: UserModule, imports: [CommonModule,
3820
+ UserRoutingModule,
3821
+ SpaUserModule] });
3822
+ UserModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: UserModule, imports: [CommonModule,
3823
+ UserRoutingModule,
3824
+ SpaUserModule] });
3825
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: UserModule, decorators: [{
3826
+ type: NgModule,
3827
+ args: [{
3828
+ declarations: [],
3829
+ imports: [
3830
+ CommonModule,
3831
+ UserRoutingModule,
3832
+ SpaUserModule
3833
+ ]
3834
+ }]
3835
+ }] });
3836
+
3837
+ /*
3838
+ * Public API Surface of tin-spa
3839
+ */
3840
+
3841
+ /**
3842
+ * Generated bundle index. Do not edit.
3843
+ */
3844
+
3845
+ export { Account, Action, ActionResponse, ActivityComponent, AdminModule, ApiResponse, AppConfig, AttachComponent, AuthService, CapItem, ChangePasswordComponent, ChangeUserPassword, CheckComponent, ChipsComponent, Constants, Core, CreateAccountComponent, DataServiceLib, DateComponent, DatetimeComponent, ExportService, FilterComponent, FormComponent, FormConfig, HttpService, IndexModule, LabelComponent, LoaderComponent, LogLevel, LogService, LoginComponent, LogsComponent, MessageService, MoneyComponent, NavMenuComponent, NumberComponent, OptionComponent, Profile, ProfileComponent, RecoverAccountComponent, Register, Role, RolesComponent, SelectComponent, SettingsComponent, SignupComponent, SpaAdminModule, SpaIndexModule, SpaMatModule, SpaUserModule, Step, StepsComponent, StorageService, TableComponent, TableConfig, TextComponent, Tile, TilesComponent, TinSpaComponent, TinSpaModule, TinSpaService, User, UserModule, UsersComponent, addRoleDialog, detailsDialog, loginConfig, messageDialog };
3846
+ //# sourceMappingURL=tin-spa.mjs.map