tin-spa 2.0.0 → 2.1.1

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 (242) hide show
  1. package/README.md +2 -2
  2. package/esm2020/lib/classes/Classes.mjs +214 -0
  3. package/esm2020/lib/classes/TinCore.mjs +213 -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 +82 -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 +107 -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 +108 -0
  22. package/esm2020/lib/components/nav-menu/nav-menu.component.mjs +49 -0
  23. package/esm2020/lib/components/number/number.component.mjs +102 -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 +137 -0
  34. package/esm2020/lib/components/table/table.component.mjs +350 -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 +4026 -0
  64. package/fesm2015/tin-spa.mjs.map +1 -0
  65. package/fesm2020/tin-spa.mjs +4008 -0
  66. package/fesm2020/tin-spa.mjs.map +1 -0
  67. package/index.d.ts +5 -0
  68. package/lib/classes/Classes.d.ts +69 -62
  69. package/lib/classes/TinCore.d.ts +6 -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 +19 -7
  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 +23 -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 +19 -3
  88. package/lib/components/nav-menu/nav-menu.component.d.ts +3 -0
  89. package/lib/components/number/number.component.d.ts +31 -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 +26 -0
  100. package/lib/components/table/table.component.d.ts +57 -17
  101. package/lib/components/text/text.component.d.ts +14 -10
  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/Classes.js +0 -254
  134. package/esm2015/lib/classes/TinCore.js +0 -139
  135. package/esm2015/lib/components/activity/activity.component.js +0 -26
  136. package/esm2015/lib/components/attach/attach.component.js +0 -107
  137. package/esm2015/lib/components/change-password/change-password.component.js +0 -102
  138. package/esm2015/lib/components/check/check.component.js +0 -63
  139. package/esm2015/lib/components/chips/chips.component.js +0 -66
  140. package/esm2015/lib/components/create-account/create-account.component.js +0 -78
  141. package/esm2015/lib/components/date/date.component.js +0 -45
  142. package/esm2015/lib/components/datetime/datetime.component.js +0 -44
  143. package/esm2015/lib/components/filter/filter.component.js +0 -40
  144. package/esm2015/lib/components/label/label.component.js +0 -29
  145. package/esm2015/lib/components/loader/loader.component.js +0 -29
  146. package/esm2015/lib/components/login/login.component.js +0 -114
  147. package/esm2015/lib/components/logs/logs.component.js +0 -39
  148. package/esm2015/lib/components/message/messageDialog.component.js +0 -31
  149. package/esm2015/lib/components/money/money.component.js +0 -52
  150. package/esm2015/lib/components/nav-menu/nav-menu.component.js +0 -51
  151. package/esm2015/lib/components/option/option.component.js +0 -63
  152. package/esm2015/lib/components/profile/profile.component.js +0 -98
  153. package/esm2015/lib/components/recover-account/recover-account.component.js +0 -53
  154. package/esm2015/lib/components/roles/addRoleDialog.component.js +0 -61
  155. package/esm2015/lib/components/roles/roles.component.js +0 -94
  156. package/esm2015/lib/components/select/select.component.js +0 -77
  157. package/esm2015/lib/components/settings/settings.component.js +0 -63
  158. package/esm2015/lib/components/signup/signup.component.js +0 -57
  159. package/esm2015/lib/components/steps/steps.component.js +0 -93
  160. package/esm2015/lib/components/table/table.component.js +0 -107
  161. package/esm2015/lib/components/text/text.component.js +0 -165
  162. package/esm2015/lib/components/tiles/tiles.component.js +0 -41
  163. package/esm2015/lib/components/timeout/timeout.component.js +0 -90
  164. package/esm2015/lib/components/tin-spa.component.js +0 -19
  165. package/esm2015/lib/components/users/users.component.js +0 -120
  166. package/esm2015/lib/dnd.directive.js +0 -51
  167. package/esm2015/lib/modules/spa-admin.module.js +0 -50
  168. package/esm2015/lib/modules/spa-index.module.js +0 -35
  169. package/esm2015/lib/modules/spa-mat.module.js +0 -53
  170. package/esm2015/lib/modules/spa-user.module.js +0 -33
  171. package/esm2015/lib/services/auth.service.js +0 -155
  172. package/esm2015/lib/services/data.service.js +0 -115
  173. package/esm2015/lib/services/export.service.js +0 -29
  174. package/esm2015/lib/services/http.service.js +0 -84
  175. package/esm2015/lib/services/loader-interceptor.service.js +0 -83
  176. package/esm2015/lib/services/loader.service.js +0 -17
  177. package/esm2015/lib/services/log.service.js +0 -76
  178. package/esm2015/lib/services/message.service.js +0 -58
  179. package/esm2015/lib/services/storage.service.js +0 -42
  180. package/esm2015/lib/services/tin-spa.service.js +0 -14
  181. package/esm2015/lib/tin-spa.module.js +0 -91
  182. package/esm2015/public-api.js +0 -56
  183. package/esm2015/tin-spa.js +0 -8
  184. package/esm5/lib/classes/Classes.js +0 -313
  185. package/esm5/lib/classes/TinCore.js +0 -166
  186. package/esm5/lib/components/activity/activity.component.js +0 -27
  187. package/esm5/lib/components/attach/attach.component.js +0 -119
  188. package/esm5/lib/components/change-password/change-password.component.js +0 -104
  189. package/esm5/lib/components/check/check.component.js +0 -64
  190. package/esm5/lib/components/chips/chips.component.js +0 -68
  191. package/esm5/lib/components/create-account/create-account.component.js +0 -80
  192. package/esm5/lib/components/date/date.component.js +0 -46
  193. package/esm5/lib/components/datetime/datetime.component.js +0 -45
  194. package/esm5/lib/components/filter/filter.component.js +0 -41
  195. package/esm5/lib/components/label/label.component.js +0 -30
  196. package/esm5/lib/components/loader/loader.component.js +0 -31
  197. package/esm5/lib/components/login/login.component.js +0 -117
  198. package/esm5/lib/components/logs/logs.component.js +0 -41
  199. package/esm5/lib/components/message/messageDialog.component.js +0 -32
  200. package/esm5/lib/components/money/money.component.js +0 -53
  201. package/esm5/lib/components/nav-menu/nav-menu.component.js +0 -53
  202. package/esm5/lib/components/option/option.component.js +0 -64
  203. package/esm5/lib/components/profile/profile.component.js +0 -102
  204. package/esm5/lib/components/recover-account/recover-account.component.js +0 -55
  205. package/esm5/lib/components/roles/addRoleDialog.component.js +0 -63
  206. package/esm5/lib/components/roles/roles.component.js +0 -100
  207. package/esm5/lib/components/select/select.component.js +0 -79
  208. package/esm5/lib/components/settings/settings.component.js +0 -66
  209. package/esm5/lib/components/signup/signup.component.js +0 -59
  210. package/esm5/lib/components/steps/steps.component.js +0 -105
  211. package/esm5/lib/components/table/table.component.js +0 -109
  212. package/esm5/lib/components/text/text.component.js +0 -168
  213. package/esm5/lib/components/tiles/tiles.component.js +0 -42
  214. package/esm5/lib/components/timeout/timeout.component.js +0 -92
  215. package/esm5/lib/components/tin-spa.component.js +0 -17
  216. package/esm5/lib/components/users/users.component.js +0 -126
  217. package/esm5/lib/dnd.directive.js +0 -52
  218. package/esm5/lib/modules/spa-admin.module.js +0 -53
  219. package/esm5/lib/modules/spa-index.module.js +0 -38
  220. package/esm5/lib/modules/spa-mat.module.js +0 -56
  221. package/esm5/lib/modules/spa-user.module.js +0 -36
  222. package/esm5/lib/services/auth.service.js +0 -157
  223. package/esm5/lib/services/data.service.js +0 -116
  224. package/esm5/lib/services/export.service.js +0 -30
  225. package/esm5/lib/services/http.service.js +0 -85
  226. package/esm5/lib/services/loader-interceptor.service.js +0 -85
  227. package/esm5/lib/services/loader.service.js +0 -18
  228. package/esm5/lib/services/log.service.js +0 -112
  229. package/esm5/lib/services/message.service.js +0 -59
  230. package/esm5/lib/services/storage.service.js +0 -74
  231. package/esm5/lib/services/tin-spa.service.js +0 -16
  232. package/esm5/lib/tin-spa.module.js +0 -94
  233. package/esm5/public-api.js +0 -56
  234. package/esm5/tin-spa.js +0 -8
  235. package/fesm2015/tin-spa.js +0 -3184
  236. package/fesm2015/tin-spa.js.map +0 -1
  237. package/fesm5/tin-spa.js +0 -3422
  238. package/fesm5/tin-spa.js.map +0 -1
  239. package/lib/components/timeout/timeout.component.d.ts +0 -21
  240. package/lib/dnd.directive.d.ts +0 -8
  241. package/tin-spa.d.ts +0 -7
  242. package/tin-spa.metadata.json +0 -1
@@ -0,0 +1,4026 @@
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 generateObject(fields) {
200
+ let data = {};
201
+ fields.forEach(field => {
202
+ data[field.name] = this.getInitialValue(field);
203
+ });
204
+ return data;
205
+ }
206
+ static resetObject(fields, data) {
207
+ fields.forEach(field => {
208
+ data[field.name] = this.getInitialValue(field);
209
+ });
210
+ }
211
+ static validateObject(fields, data) {
212
+ console.log("Validations");
213
+ for (let field of fields) {
214
+ let name = field.name;
215
+ let d = data[field.name];
216
+ console.log(name);
217
+ if (field.required) {
218
+ if (!d)
219
+ return `${name} is required`;
220
+ if (field.type == 'text') {
221
+ if (d == '')
222
+ return `Please enter ${name}`;
223
+ if (field.min && d.length < field.min)
224
+ return `Minimum ${name} length is ${field.min}`;
225
+ if (field.max && d.length > field.max)
226
+ return `Maximum ${name} length is ${field.max}`;
227
+ }
228
+ else if (field.type == 'number' || field.type == 'money' || field.type == 'date') {
229
+ if (field.min && d < field.min)
230
+ return `Minimum ${name} is ${field.min}`;
231
+ if (field.max && d > field.max)
232
+ return `Maximum ${name} is ${field.max}`;
233
+ }
234
+ else if (field.type == 'select') {
235
+ if (d == '')
236
+ return `Please select ${name}`;
237
+ }
238
+ }
239
+ }
240
+ ;
241
+ return '';
242
+ }
243
+ static getInitialValue(field) {
244
+ if (field.defaultValue) {
245
+ return field.defaultValue;
246
+ }
247
+ switch (field.type) {
248
+ case 'text':
249
+ return '';
250
+ case 'money':
251
+ return 0;
252
+ case 'number':
253
+ return 0;
254
+ case 'date':
255
+ return '';
256
+ case 'checkbox':
257
+ return false;
258
+ case 'select':
259
+ return null;
260
+ default:
261
+ return null;
262
+ }
263
+ }
264
+ static getClone(x) {
265
+ return JSON.parse(JSON.stringify(x));
266
+ }
267
+ static getNumber(value) {
268
+ if (value == null || value == "") {
269
+ return 0;
270
+ }
271
+ const onlyNumbers = value.replace(/[^\d.-]/g, '');
272
+ return onlyNumbers;
273
+ }
274
+ static getFirstDayOfMonth() {
275
+ const date = new Date();
276
+ return new Date(date.getFullYear(), date.getMonth(), 1);
277
+ }
278
+ static emailIsValid(email) {
279
+ // return /\S+@\S+\.\S+/.test(email)
280
+ return false;
281
+ }
282
+ static isValidUNCPath(path) {
283
+ // return /\\\\([a-zA-Z0-9_.$●-]+)\\([a-zA-Z0-9_.$●-]+).*/.test(path)
284
+ return false;
285
+ }
286
+ static isValidDate(date) {
287
+ var parsedDate = Date.parse(date);
288
+ if (isNaN(date) && !isNaN(parsedDate)) {
289
+ return true;
290
+ }
291
+ else {
292
+ return false;
293
+ }
294
+ }
295
+ static isValidEmailList(list) {
296
+ if (list.includes(";")) {
297
+ let emails = list.split(";");
298
+ for (var email of emails) {
299
+ if (this.emailIsValid(email) == false) {
300
+ return false;
301
+ }
302
+ }
303
+ }
304
+ else {
305
+ if (this.emailIsValid(list) == false) {
306
+ return false;
307
+ }
308
+ }
309
+ return true;
310
+ }
311
+ static isNumber(value) {
312
+ return ((value != null) &&
313
+ (value !== '') &&
314
+ !isNaN(Number(value.toString())));
315
+ }
316
+ static getDiff(startDate, endDate = Date()) {
317
+ var eventStartTime = new Date(startDate);
318
+ var eventEndTime = new Date(endDate);
319
+ var milliseconds = eventEndTime.valueOf() - eventStartTime.valueOf();
320
+ function numberEnding(number) {
321
+ if (number.toFixed() == '1') {
322
+ return '';
323
+ }
324
+ else {
325
+ return 's';
326
+ }
327
+ }
328
+ var minutes = (milliseconds / (1000 * 60));
329
+ var hours = (milliseconds / (1000 * 60 * 60));
330
+ var days = (milliseconds / (1000 * 60 * 60 * 24));
331
+ var weeks = (milliseconds / (1000 * 60 * 60 * 24 * 7));
332
+ var months = (milliseconds / (1000 * 60 * 60 * 24 * 7 * 4));
333
+ var years = (milliseconds / (1000 * 60 * 60 * 24 * 365));
334
+ if (years >= 1) {
335
+ return years.toFixed() + ' year' + numberEnding(years);
336
+ }
337
+ else if (months >= 1) {
338
+ return months.toFixed() + ' month' + numberEnding(months);
339
+ }
340
+ else if (weeks >= 1) {
341
+ return weeks.toFixed() + ' week' + numberEnding(weeks);
342
+ }
343
+ else if (days >= 1) {
344
+ return days.toFixed() + ' day' + numberEnding(days);
345
+ }
346
+ else if (hours >= 1) {
347
+ return hours.toFixed() + ' hour' + numberEnding(hours);
348
+ }
349
+ else if (minutes >= 1) {
350
+ return minutes.toFixed() + ' minute' + numberEnding(minutes);
351
+ }
352
+ else if (milliseconds >= (-1000 * 60)) {
353
+ return 'a minute';
354
+ }
355
+ else {
356
+ return 'N/A';
357
+ }
358
+ }
359
+ static nowDate(NoTime = false) {
360
+ if (NoTime) {
361
+ return this.getFormatedDate(Date(), true);
362
+ }
363
+ else {
364
+ return this.getFormatedDate(Date());
365
+ }
366
+ }
367
+ static getFormatedDate(dateString, NoTime = false) {
368
+ let d = new Date(dateString);
369
+ d.setHours(d.getHours() + 2);
370
+ if (NoTime == true) {
371
+ return d.toISOString().split('T')[0];
372
+ }
373
+ else {
374
+ return d.toISOString().split('.')[0];
375
+ }
376
+ }
377
+ static getFormatedDate2(d, NoTime = false) {
378
+ d.setHours(d.getHours() + 2);
379
+ if (NoTime == true) {
380
+ return d.toISOString().split('T')[0];
381
+ }
382
+ else {
383
+ return d.toISOString().split('.')[0];
384
+ }
385
+ }
386
+ static getBusinessDatesCount(startDate, endDate) {
387
+ var count = 0;
388
+ var _startDate = new Date(startDate);
389
+ var _endDate = new Date(endDate);
390
+ var curDate = _startDate;
391
+ while (curDate < _endDate) {
392
+ var dayOfWeek = curDate.getDay();
393
+ if (!(dayOfWeek == 6 || dayOfWeek == 0))
394
+ count++;
395
+ curDate.setDate(curDate.getDate() + 1);
396
+ }
397
+ return count;
398
+ }
399
+ }
400
+ Core.nullDate = "01 Jan 1969";
401
+ class ApiResponse {
402
+ }
403
+ class Constants {
404
+ }
405
+ Constants.AUTH_USER = 'a';
406
+ Constants.AUTH_NAME = 'b';
407
+ Constants.AUTH_ROLES = 'c';
408
+ Constants.AUTH_TOKEN = 'd';
409
+ Constants.AUTH_TOKEN_EXPIRE = 'e';
410
+
411
+ class Action {
412
+ }
413
+ class FormConfig {
414
+ }
415
+ class TableConfig {
416
+ }
417
+ class Tile {
418
+ }
419
+ class Step {
420
+ }
421
+ class ActionResponse {
422
+ }
423
+ class loginConfig {
424
+ constructor() {
425
+ this.appName = "";
426
+ this.selfService = false;
427
+ this.logo = "";
428
+ this.logoSize = "normal";
429
+ }
430
+ }
431
+ class AppConfig {
432
+ constructor() {
433
+ this.appName = "App Name";
434
+ this.logo = "";
435
+ this.logoSize = "normal";
436
+ this.ADAuth = true;
437
+ this.localAuth = true;
438
+ this.selfService = false;
439
+ }
440
+ }
441
+ class CapItem {
442
+ constructor() {
443
+ this.name = "";
444
+ this.display = "New Cap Item";
445
+ this.enabled = false;
446
+ this.type = "";
447
+ this.newLine = false;
448
+ this.showMenu = true;
449
+ this.ignoreSubsDisplay = false;
450
+ this.link = "";
451
+ this.icon = "navigate_next";
452
+ }
453
+ }
454
+ class Account {
455
+ }
456
+ class User {
457
+ constructor() {
458
+ this.userName = "";
459
+ this.password = "";
460
+ this.tries = "0";
461
+ this.locked = "0";
462
+ this.logged = "0";
463
+ this.disabled = "0";
464
+ this.changepassword = "0";
465
+ this.dateCreated = Core.nowDate();
466
+ this.dateUpdated = Core.nowDate();
467
+ this.token = "";
468
+ this.dateExpire = Core.nowDate();
469
+ this.tokenExpire = Core.nowDate();
470
+ this.authType = "";
471
+ }
472
+ }
473
+ class ChangeUserPassword {
474
+ constructor() {
475
+ this.userName = "";
476
+ this.currentPassword = "";
477
+ this.newPassword = "";
478
+ this.confirmPassword = "";
479
+ }
480
+ }
481
+ class Register {
482
+ constructor() {
483
+ this.userName = "";
484
+ this.roleID = 1;
485
+ this.firstName = "";
486
+ this.lastName = "";
487
+ this.email = "";
488
+ this.authType = "";
489
+ this.password = "";
490
+ }
491
+ }
492
+ class Profile {
493
+ constructor() {
494
+ this.profileID = "";
495
+ this.userName = "";
496
+ this.roleID = 1;
497
+ this.firstName = "";
498
+ this.lastName = "";
499
+ this.email = "";
500
+ this.empID = "";
501
+ this.arID = "0";
502
+ this.authType = "";
503
+ this.password = "";
504
+ this.role = new Role();
505
+ }
506
+ }
507
+ class Role {
508
+ constructor() {
509
+ this.roleID = 0;
510
+ this.roleName = "New Role";
511
+ this.cap1 = false;
512
+ this.cap2 = false;
513
+ this.cap3 = false;
514
+ this.cap4 = false;
515
+ this.cap5 = false;
516
+ this.cap6 = false;
517
+ this.cap7 = false;
518
+ this.cap8 = false;
519
+ this.cap9 = false;
520
+ this.cap10 = false;
521
+ this.cap11 = false;
522
+ this.cap12 = false;
523
+ this.cap13 = false;
524
+ this.cap14 = false;
525
+ this.cap15 = false;
526
+ this.cap16 = false;
527
+ this.cap17 = false;
528
+ this.cap18 = false;
529
+ this.cap19 = false;
530
+ this.cap20 = false;
531
+ this.cap21 = false;
532
+ this.cap22 = false;
533
+ this.cap23 = false;
534
+ this.cap24 = false;
535
+ this.cap25 = false;
536
+ this.cap26 = false;
537
+ this.cap27 = false;
538
+ this.cap28 = false;
539
+ this.cap29 = false;
540
+ this.cap30 = false;
541
+ this.cap31 = false;
542
+ this.cap32 = false;
543
+ this.cap33 = false;
544
+ this.cap34 = false;
545
+ this.cap35 = false;
546
+ this.cap36 = false;
547
+ this.cap37 = false;
548
+ this.cap38 = false;
549
+ this.cap39 = false;
550
+ this.cap40 = false;
551
+ this.cap41 = false;
552
+ this.cap42 = false;
553
+ this.cap43 = false;
554
+ this.cap44 = false;
555
+ this.cap45 = false;
556
+ this.cap46 = false;
557
+ this.cap47 = false;
558
+ this.cap48 = false;
559
+ this.cap49 = false;
560
+ this.cap50 = false;
561
+ this.cap51 = false;
562
+ this.cap52 = false;
563
+ this.cap53 = false;
564
+ this.cap54 = false;
565
+ this.cap55 = false;
566
+ this.cap56 = false;
567
+ this.cap57 = false;
568
+ this.cap58 = false;
569
+ this.cap59 = false;
570
+ this.cap60 = false;
571
+ this.cap61 = false;
572
+ this.cap62 = false;
573
+ this.cap63 = false;
574
+ this.cap64 = false;
575
+ this.cap65 = false;
576
+ this.cap66 = false;
577
+ this.cap67 = false;
578
+ this.cap68 = false;
579
+ this.cap69 = false;
580
+ this.cap70 = false;
581
+ this.cap71 = false;
582
+ this.cap72 = false;
583
+ this.cap73 = false;
584
+ this.cap74 = false;
585
+ this.cap75 = false;
586
+ this.cap76 = false;
587
+ this.cap77 = false;
588
+ this.cap78 = false;
589
+ this.cap79 = false;
590
+ this.cap80 = false;
591
+ this.cap81 = false;
592
+ this.cap82 = false;
593
+ this.cap83 = false;
594
+ this.cap84 = false;
595
+ this.cap85 = false;
596
+ this.cap86 = false;
597
+ this.cap87 = false;
598
+ this.cap88 = false;
599
+ this.cap89 = false;
600
+ this.cap90 = false;
601
+ this.cap91 = false;
602
+ this.cap92 = false;
603
+ this.cap93 = false;
604
+ this.cap94 = false;
605
+ this.cap95 = false;
606
+ this.cap96 = false;
607
+ this.cap97 = false;
608
+ this.cap98 = false;
609
+ this.cap99 = false;
610
+ this.cap100 = false;
611
+ }
612
+ }
613
+ var LogLevel;
614
+ (function (LogLevel) {
615
+ LogLevel[LogLevel["All"] = 0] = "All";
616
+ LogLevel[LogLevel["Debug"] = 1] = "Debug";
617
+ LogLevel[LogLevel["Info"] = 2] = "Info";
618
+ LogLevel[LogLevel["Warn"] = 3] = "Warn";
619
+ LogLevel[LogLevel["Error"] = 4] = "Error";
620
+ LogLevel[LogLevel["Fatal"] = 5] = "Fatal";
621
+ LogLevel[LogLevel["Off"] = 6] = "Off";
622
+ })(LogLevel || (LogLevel = {}));
623
+
624
+ class HttpService {
625
+ constructor(httpClient, router) {
626
+ this.httpClient = httpClient;
627
+ this.router = router;
628
+ //----Set apiUrl from the data service of the project---//
629
+ this.apiUrl = "https://api.solinc.co.zw/"; //default
630
+ this.httpOptions_Legacy = {
631
+ headers: new HttpHeaders({
632
+ Accept: "application/json",
633
+ "Content-Type": "application/json",
634
+ Authorization: "Basic " + btoa("emptyUser:emptyToken"),
635
+ }),
636
+ resposeType: "json",
637
+ };
638
+ this.httpOptions_Files = {
639
+ headers: new HttpHeaders({
640
+ Authorization: "Basic " + btoa("tnyagato:j5Toszfr@ys"),
641
+ }),
642
+ resposeType: "json",
643
+ };
644
+ }
645
+ //POST
646
+ Post(service, data) {
647
+ return this.httpClient.post(this.apiUrl + service, data, this.httpOptions_Legacy);
648
+ }
649
+ //PUT
650
+ Put(service, data) {
651
+ return this.httpClient.put(this.apiUrl + service, data, this.httpOptions_Legacy);
652
+ }
653
+ //POST RAW
654
+ Post_Raw(url, data) {
655
+ return this.httpClient.post(url, data, this.httpOptions_Legacy);
656
+ }
657
+ //POST with file
658
+ Post_WithFile(service, data, file) {
659
+ let formData = new FormData();
660
+ if (file) {
661
+ formData.append("uploadFile", file, file.name);
662
+ }
663
+ formData.append("data", JSON.stringify(data));
664
+ return this.httpClient.post(this.apiUrl + service, formData, this.httpOptions_Files);
665
+ }
666
+ // //POST with files
667
+ Post_FormData(service, formData) {
668
+ return this.httpClient.post(this.apiUrl + service, formData, this.httpOptions_Files);
669
+ }
670
+ //GET
671
+ Get(service) {
672
+ return this.httpClient.get(this.apiUrl + service, this.httpOptions_Legacy);
673
+ }
674
+ //Get RAW
675
+ Get_Raw(url) {
676
+ return this.httpClient.get(url, this.httpOptions_Legacy);
677
+ }
678
+ //ERROR
679
+ Error(error) {
680
+ if (error.statusText == "Unauthorized") {
681
+ this.router.navigate(["login"]);
682
+ return "Unauthorized";
683
+ }
684
+ else {
685
+ return "Connection failed";
686
+ }
687
+ }
688
+ }
689
+ 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 });
690
+ HttpService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HttpService, providedIn: "root" });
691
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HttpService, decorators: [{
692
+ type: Injectable,
693
+ args: [{
694
+ providedIn: "root",
695
+ }]
696
+ }], ctorParameters: function () { return [{ type: i1$2.HttpClient }, { type: i1$3.Router }]; } });
697
+
698
+ // import { Core } from 'tin-core';
699
+ class LogService {
700
+ constructor() {
701
+ this.level = LogLevel.All;
702
+ this.logToConsole = true;
703
+ this.logToApi = false;
704
+ }
705
+ debug(msg, ...optionalParams) {
706
+ this.writeToLog(msg, LogLevel.Debug, optionalParams);
707
+ }
708
+ info(msg, ...optionalParams) {
709
+ this.writeToLog(msg, LogLevel.Info, optionalParams);
710
+ }
711
+ warn(msg, ...optionalParams) {
712
+ this.writeToLog(msg, LogLevel.Warn, optionalParams);
713
+ }
714
+ error(msg, ...optionalParams) {
715
+ this.writeToLog(msg, LogLevel.Error, optionalParams);
716
+ }
717
+ fatal(msg, ...optionalParams) {
718
+ this.writeToLog(msg, LogLevel.Fatal, optionalParams);
719
+ }
720
+ log(msg, ...optionalParams) {
721
+ this.writeToLog(msg, LogLevel.All, optionalParams);
722
+ }
723
+ writeToLog(msg, level, params) {
724
+ if (this.shouldLog(level)) {
725
+ // Build log string
726
+ let value = Core.getFormatedDate(Date(), false).replace("T", " ");
727
+ // value += " - Type: " + LogLevel[this.level];
728
+ value += " - Message: " + msg;
729
+ if (params.length) {
730
+ value += " - Extra Info: " + this.formatParams(params);
731
+ }
732
+ // Log the value
733
+ if (this.logToConsole) {
734
+ console.log(value);
735
+ }
736
+ if (this.logToApi) {
737
+ //Call API post
738
+ }
739
+ }
740
+ }
741
+ formatParams(params) {
742
+ let ret = params.join(",");
743
+ // Is there at least one object in the array?
744
+ if (params.some((p) => typeof p == "object")) {
745
+ ret = "";
746
+ // Build comma-delimited string
747
+ for (let item of params) {
748
+ ret += JSON.stringify(item) + ",";
749
+ }
750
+ }
751
+ return ret;
752
+ }
753
+ shouldLog(level) {
754
+ let ret = false;
755
+ if ((level >= this.level && level !== LogLevel.Off) ||
756
+ this.level === LogLevel.All) {
757
+ ret = true;
758
+ }
759
+ return ret;
760
+ }
761
+ }
762
+ LogService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LogService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
763
+ LogService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LogService, providedIn: "root" });
764
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LogService, decorators: [{
765
+ type: Injectable,
766
+ args: [{
767
+ providedIn: "root",
768
+ }]
769
+ }], ctorParameters: function () { return []; } });
770
+
771
+ class AuthService {
772
+ constructor(_route, storage, router, httpService, messageService, logService) {
773
+ this._route = _route;
774
+ this.storage = storage;
775
+ this.router = router;
776
+ this.httpService = httpService;
777
+ this.messageService = messageService;
778
+ this.logService = logService;
779
+ //Logged in
780
+ this.loggedin = false;
781
+ this.loggedinSource = new BehaviorSubject(this.loggedin);
782
+ this.loggedinObserv = this.loggedinSource.asObservable();
783
+ //Token
784
+ this.token = "";
785
+ this.tokenSource = new BehaviorSubject(this.token);
786
+ this.tokenObserv = this.tokenSource.asObservable();
787
+ //TokenExpire
788
+ this.tokenExpire = "";
789
+ this.tokenExpireSource = new BehaviorSubject(this.tokenExpire);
790
+ this.tokenExpireObserv = this.tokenExpireSource.asObservable();
791
+ //Current User
792
+ this.currentUser = "tnyagato";
793
+ this.currentUserSource = new BehaviorSubject(this.currentUser);
794
+ this.currentUserObserv = this.currentUserSource.asObservable();
795
+ //Line Manager
796
+ this.islineManager = false;
797
+ this.isLineManagerSource = new BehaviorSubject(this.islineManager);
798
+ this.isLineManagerObserv = this.isLineManagerSource.asObservable();
799
+ //Roles
800
+ this.currentRole = new Role;
801
+ this.currentRoleSource = new BehaviorSubject(this.currentRole);
802
+ this.myRoleObserv = this.currentRoleSource.asObservable();
803
+ //Logged in FirstName
804
+ this.loggedUserSource = new BehaviorSubject("tnyagato");
805
+ this.loggedUserFullName = this.loggedUserSource.asObservable();
806
+ }
807
+ Updateloggedin(loggedin) {
808
+ this.loggedinSource.next(loggedin);
809
+ this.loggedin = loggedin;
810
+ }
811
+ UpdateToken(newToken) {
812
+ this.tokenSource.next(newToken);
813
+ }
814
+ UpdateTokenExpire(newTokenExpire) {
815
+ this.tokenExpireSource.next(newTokenExpire);
816
+ }
817
+ UpdateCurrentUser(newUser) {
818
+ this.currentUserSource.next(newUser.toLocaleLowerCase());
819
+ this.currentUser = newUser.toLocaleLowerCase();
820
+ }
821
+ UpdateIsLineManager(manager) {
822
+ this.isLineManagerSource.next(manager);
823
+ }
824
+ UpdateRole(role) {
825
+ this.currentRoleSource.next(role);
826
+ }
827
+ updateLoggedUserFullName(userName) {
828
+ this.loggedUserSource.next(userName);
829
+ }
830
+ //Authorisation
831
+ isAuthorised(capName) {
832
+ if (!this.currentRoleSource.value[capName]) {
833
+ // this.logService.info(`authorise: ${this.currentRoleSource.value.roleName} not authorised for ${capName}`);
834
+ this.router.navigate(["home"]);
835
+ this.messageService.toast(`Unauthorised: ${capName}`);
836
+ return false;
837
+ }
838
+ else {
839
+ return true;
840
+ }
841
+ }
842
+ isValidToken() {
843
+ let tokenExpire = new Date(this.tokenExpireSource.value);
844
+ let nowDate = new Date();
845
+ let valid = tokenExpire > nowDate;
846
+ if (!valid) {
847
+ this.router.navigate(["login"]);
848
+ this.messageService.toast(`Expired Session`);
849
+ }
850
+ return valid;
851
+ }
852
+ canActivate() {
853
+ if (this.loggedin && this.isValidToken()) {
854
+ // this.logService.info("authentication: logged in");
855
+ return true;
856
+ }
857
+ if (localStorage.getItem(Constants.AUTH_USER) === null) {
858
+ // this.logService.info("authentication: not logged and no cache");
859
+ this.Updateloggedin(false);
860
+ let url = new URL(window.location.href);
861
+ let path = url.hash.replace("#/", "");
862
+ this.router.navigate(["login"], {
863
+ relativeTo: this._route,
864
+ queryParams: { redirectTo: path },
865
+ queryParamsHandling: 'merge',
866
+ skipLocationChange: false
867
+ });
868
+ return false;
869
+ }
870
+ else {
871
+ // this.logService.info("authentication: not logged but allowed login");
872
+ this.Updateloggedin(true);
873
+ this.storage.get(Constants.AUTH_USER).then((resp) => {
874
+ this.UpdateCurrentUser(resp);
875
+ });
876
+ this.storage.get(Constants.AUTH_NAME).then((resp) => {
877
+ this.updateLoggedUserFullName(resp);
878
+ });
879
+ this.storage.get(Constants.AUTH_ROLES).then((resp) => {
880
+ let ret = JSON.parse(resp);
881
+ this.UpdateRole(ret);
882
+ });
883
+ this.storage.get(Constants.AUTH_TOKEN).then((resp) => {
884
+ this.UpdateToken(resp);
885
+ });
886
+ this.storage.get(Constants.AUTH_TOKEN_EXPIRE).then((resp) => {
887
+ this.UpdateTokenExpire(resp);
888
+ this.isValidToken();
889
+ });
890
+ return true;
891
+ }
892
+ }
893
+ }
894
+ 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 });
895
+ AuthService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AuthService, providedIn: 'root' });
896
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AuthService, decorators: [{
897
+ type: Injectable,
898
+ args: [{
899
+ providedIn: 'root'
900
+ }]
901
+ }], ctorParameters: function () { return [{ type: i1$3.ActivatedRoute }, { type: StorageService }, { type: i1$3.Router }, { type: HttpService }, { type: MessageService }, { type: LogService }]; } });
902
+
903
+ class DataServiceLib {
904
+ constructor(httpService) {
905
+ this.httpService = httpService;
906
+ this.appConfig = new AppConfig();
907
+ this.appConfigSource = new BehaviorSubject(this.appConfig);
908
+ this.appConfigObserv = this.appConfigSource.asObservable();
909
+ // caps: CapItem[];
910
+ this.capHome = new CapItem;
911
+ this.capAdmin = new CapItem;
912
+ this.capUsers = new CapItem;
913
+ this.capRoles = new CapItem;
914
+ this.capLogs = new CapItem;
915
+ this.capSettings = new CapItem;
916
+ this.tmpProfileuserName = "";
917
+ this.appConfig.appName = "App-Name";
918
+ this.appConfig.logo = "./assets/logo.png";
919
+ this.appConfig.ADAuth = true;
920
+ this.appConfig.capItems = [this.capAdmin, this.capHome];
921
+ this.capHome.name = "cap1";
922
+ this.capHome.display = "Home";
923
+ this.capHome.link = "home";
924
+ this.capAdmin.name = "cap2";
925
+ this.capAdmin.display = "Admin";
926
+ this.capAdmin.capSubItems = [this.capUsers, this.capRoles, this.capLogs, this.capSettings];
927
+ this.capUsers.name = "cap3";
928
+ this.capUsers.display = "Users";
929
+ this.capUsers.link = "home/admin/users";
930
+ this.capRoles.name = "cap4";
931
+ this.capRoles.display = "Roles";
932
+ this.capRoles.link = "home/admin/roles";
933
+ this.capLogs.name = "cap5";
934
+ this.capLogs.display = "Logs";
935
+ this.capLogs.link = "home/admin/logs";
936
+ this.capSettings.name = "cap6";
937
+ this.capSettings.display = "Settings";
938
+ this.capSettings.link = "home/admin/settings";
939
+ }
940
+ UpdateAppConfig(config) {
941
+ this.appConfigSource.next(config);
942
+ this.appConfig = config;
943
+ }
944
+ CallApi(action, data) {
945
+ if (!action.method) {
946
+ return this.httpService.Get(action.url);
947
+ }
948
+ if (action.method == 'get') {
949
+ return this.httpService.Get(action.url);
950
+ }
951
+ else if (action.method == 'post') {
952
+ return this.httpService.Post(action.url, data);
953
+ }
954
+ else {
955
+ return this.httpService.Post(action.url, data);
956
+ }
957
+ }
958
+ //Users
959
+ GetUser() {
960
+ return this.httpService.Get("User/all/x");
961
+ }
962
+ RegisterAccount(u) {
963
+ return this.httpService.Post("User/register", u);
964
+ }
965
+ GetUserByID(val) {
966
+ return this.httpService.Get(`User/id/${val}`);
967
+ }
968
+ UpdateUser(profile) {
969
+ return this.httpService.Post("User/edit", profile);
970
+ }
971
+ UnlockUser(user) {
972
+ return this.httpService.Post("User/unlock", user);
973
+ }
974
+ LockUser(user) {
975
+ return this.httpService.Post("User/lock", user);
976
+ }
977
+ DeleteUser(user) {
978
+ return this.httpService.Post("User/delete", user);
979
+ }
980
+ Login(u) {
981
+ return this.httpService.Post("User/login", u);
982
+ }
983
+ ChangePassword(u) {
984
+ return this.httpService.Post("User/changepassword-self", u);
985
+ }
986
+ ChangePasswordAdmin(u) {
987
+ return this.httpService.Post("User/changepassword-admin", u);
988
+ }
989
+ SelfReset(u) {
990
+ return this.httpService.Post("Basic/SelfReset", u);
991
+ }
992
+ //Roles
993
+ PostRole(role, action) {
994
+ return this.httpService.Post(`Role?action=${action}`, role);
995
+ }
996
+ PutRole(role) {
997
+ return this.httpService.Put("Role", role);
998
+ }
999
+ GetRole(by, val) {
1000
+ return this.httpService.Get("Role/all/x");
1001
+ }
1002
+ //Logs
1003
+ GetLog(by, val) {
1004
+ return this.httpService.Get("Log/all/x");
1005
+ }
1006
+ //Settings
1007
+ GetSetting(by, val) {
1008
+ return this.httpService.Get("Setting/all/x");
1009
+ }
1010
+ UpdateSetting(setting, action) {
1011
+ return this.httpService.Post(`Setting?action=${action}`, setting);
1012
+ }
1013
+ }
1014
+ DataServiceLib.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DataServiceLib, deps: [{ token: HttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1015
+ DataServiceLib.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DataServiceLib, providedIn: 'root' });
1016
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DataServiceLib, decorators: [{
1017
+ type: Injectable,
1018
+ args: [{
1019
+ providedIn: 'root'
1020
+ }]
1021
+ }], ctorParameters: function () { return [{ type: HttpService }]; } });
1022
+
1023
+ class TinSpaComponent {
1024
+ }
1025
+ TinSpaComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TinSpaComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1026
+ TinSpaComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: TinSpaComponent, selector: "spa-tin-spa", ngImport: i0, template: `
1027
+ <p>
1028
+ tin-spa works!
1029
+ </p>
1030
+ `, isInline: true });
1031
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TinSpaComponent, decorators: [{
1032
+ type: Component,
1033
+ args: [{ selector: 'spa-tin-spa', template: `
1034
+ <p>
1035
+ tin-spa works!
1036
+ </p>
1037
+ ` }]
1038
+ }] });
1039
+
1040
+ class SpaMatModule {
1041
+ }
1042
+ SpaMatModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SpaMatModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1043
+ SpaMatModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: SpaMatModule, exports: [CommonModule, FormsModule, ReactiveFormsModule,
1044
+ MatMenuModule, MatSliderModule, MatTableModule, MatPaginatorModule,
1045
+ MatCheckboxModule, MatBadgeModule, MatButtonModule, MatIconModule, MatDialogModule, MatSnackBarModule,
1046
+ MatTabsModule, MatFormFieldModule, MatInputModule, MatCardModule, MatChipsModule, MatSelectModule,
1047
+ MatNativeDateModule, MatProgressSpinnerModule, MatListModule, MatAutocompleteModule, MatTooltipModule, MatSortModule,
1048
+ MatDatepickerModule, MatStepperModule, MatRadioModule] });
1049
+ SpaMatModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SpaMatModule, providers: [
1050
+ { provide: MAT_DIALOG_DEFAULT_OPTIONS, useValue: { disableClose: true, hasBackdrop: true } },
1051
+ { provide: MAT_DATE_LOCALE, useValue: "en-GB" },
1052
+ ], imports: [CommonModule, FormsModule, ReactiveFormsModule,
1053
+ MatMenuModule, MatSliderModule, MatTableModule, MatPaginatorModule,
1054
+ MatCheckboxModule, MatBadgeModule, MatButtonModule, MatIconModule, MatDialogModule, MatSnackBarModule,
1055
+ MatTabsModule, MatFormFieldModule, MatInputModule, MatCardModule, MatChipsModule, MatSelectModule,
1056
+ MatNativeDateModule, MatProgressSpinnerModule, MatListModule, MatAutocompleteModule, MatTooltipModule, MatSortModule,
1057
+ MatDatepickerModule, MatStepperModule, MatRadioModule] });
1058
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SpaMatModule, decorators: [{
1059
+ type: NgModule,
1060
+ args: [{
1061
+ declarations: [],
1062
+ imports: [],
1063
+ exports: [
1064
+ CommonModule, FormsModule, ReactiveFormsModule,
1065
+ MatMenuModule, MatSliderModule, MatTableModule, MatPaginatorModule,
1066
+ MatCheckboxModule, MatBadgeModule, MatButtonModule, MatIconModule, MatDialogModule, MatSnackBarModule,
1067
+ MatTabsModule, MatFormFieldModule, MatInputModule, MatCardModule, MatChipsModule, MatSelectModule,
1068
+ MatNativeDateModule, MatProgressSpinnerModule, MatListModule, MatAutocompleteModule, MatTooltipModule, MatSortModule,
1069
+ MatDatepickerModule, MatStepperModule, MatRadioModule,
1070
+ ],
1071
+ providers: [
1072
+ { provide: MAT_DIALOG_DEFAULT_OPTIONS, useValue: { disableClose: true, hasBackdrop: true } },
1073
+ { provide: MAT_DATE_LOCALE, useValue: "en-GB" },
1074
+ ]
1075
+ }]
1076
+ }] });
1077
+
1078
+ class TextComponent {
1079
+ constructor() {
1080
+ this.multiDimension = false;
1081
+ // options: FormGroup;
1082
+ this.hideRequiredControl = new FormControl(true);
1083
+ this.hide = true; //for password only
1084
+ this.readonly = false;
1085
+ this.hint = "";
1086
+ this.display = "";
1087
+ this.placeholder = "";
1088
+ this.value = "";
1089
+ this.valueChange = new EventEmitter();
1090
+ this.format = "text";
1091
+ this.type = "";
1092
+ this.leave = new EventEmitter();
1093
+ this.enterPress = new EventEmitter();
1094
+ this.rows = 1;
1095
+ this.width = "100%";
1096
+ //Autocomplete items
1097
+ this.options = [];
1098
+ this.optionValue = "";
1099
+ //validation input
1100
+ this.required = true;
1101
+ this.min = 0;
1102
+ this.max = 9000000000000000; //Math.max
1103
+ this.regex = ""; //"[a-zA-Z ]*" //"/\S+@\S+\.\S+/";
1104
+ //validation
1105
+ this.myControl = new FormControl('', [Validators.required, Validators.minLength(this.min), Validators.maxLength(this.max), Validators.pattern(this.regex)]);
1106
+ this.control = new FormControl(this.value, [Validators.required, Validators.minLength(this.min), Validators.maxLength(this.max), Validators.pattern(this.regex)]);
1107
+ }
1108
+ ngOnInit() {
1109
+ if (this.options.length > 0) {
1110
+ this.initFilter();
1111
+ }
1112
+ if (this.placeholder == "") {
1113
+ this.placeholder = "Enter " + this.display;
1114
+ }
1115
+ }
1116
+ ngAfterViewInit() {
1117
+ this.initControl(this.control);
1118
+ this.initControl(this.myControl);
1119
+ }
1120
+ initFilter() {
1121
+ const objKeyList = Object.keys(this.options[0]);
1122
+ const firstKey = objKeyList[0];
1123
+ this.multiDimension = !Core.isNumber(firstKey);
1124
+ this.filteredOptions = this.myControl.valueChanges.pipe(startWith(""), map((value) => this._filter(value)));
1125
+ }
1126
+ _filter(value) {
1127
+ if (this.multiDimension) {
1128
+ let filterValue = "";
1129
+ if (value != "" && value) {
1130
+ filterValue = value.toLowerCase();
1131
+ }
1132
+ return this.options.filter((option) => option[`${this.optionValue}`].toLowerCase().includes(filterValue));
1133
+ }
1134
+ else {
1135
+ const filterValue = value.toLowerCase();
1136
+ return this.options.filter(option => option.toLowerCase().includes(filterValue));
1137
+ }
1138
+ }
1139
+ initControl(control) {
1140
+ if (this.readonly) {
1141
+ control.setValidators(null);
1142
+ control.updateValueAndValidity();
1143
+ }
1144
+ if (!this.required && !this.readonly) {
1145
+ control.setValidators([Validators.minLength(this.min), Validators.maxLength(this.max), Validators.pattern(this.regex)]);
1146
+ this.control.updateValueAndValidity();
1147
+ }
1148
+ }
1149
+ //Events
1150
+ changed() {
1151
+ if (this.options.length > 0) {
1152
+ this.valueChange.emit(this.myControl.value);
1153
+ }
1154
+ else {
1155
+ this.valueChange.emit(this.value);
1156
+ }
1157
+ }
1158
+ leaved() {
1159
+ this.leave.emit();
1160
+ }
1161
+ enterPressed() {
1162
+ this.enterPress.emit();
1163
+ }
1164
+ validate(control) {
1165
+ if ((this.required || this.min > 0) && control.hasError('required')) {
1166
+ return `Required`;
1167
+ }
1168
+ if (control.hasError('minlength')) {
1169
+ return `Minimun length is ${this.min}`;
1170
+ }
1171
+ if (control.hasError('maxlength')) {
1172
+ return `Maximum length is ${this.max}`;
1173
+ }
1174
+ if (control.hasError('pattern')) {
1175
+ return `Invalid Input`;
1176
+ }
1177
+ // if (this.regex != ""){
1178
+ // let r = new RegExp(this.regex, "g");
1179
+ // if (!r.test(this.value)){
1180
+ // this.valid = false;
1181
+ // this.errorMessage = "Invalid input";
1182
+ // return this.errorMessage;
1183
+ // }
1184
+ // }
1185
+ return "";
1186
+ }
1187
+ }
1188
+ TextComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TextComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1189
+ 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 || rows == 1) && (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 > 1 && 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 || rows == 1) && 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" }] });
1190
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TextComponent, decorators: [{
1191
+ type: Component,
1192
+ args: [{ selector: 'spa-text', template: "\r\n<!-- General Text -->\r\n<mat-form-field *ngIf=\"(!rows || rows == 1) && (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 > 1 && 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 || rows == 1) && 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" }]
1193
+ }], ctorParameters: function () { return []; }, propDecorators: { readonly: [{
1194
+ type: Input
1195
+ }], hint: [{
1196
+ type: Input
1197
+ }], display: [{
1198
+ type: Input
1199
+ }], placeholder: [{
1200
+ type: Input
1201
+ }], value: [{
1202
+ type: Input
1203
+ }], valueChange: [{
1204
+ type: Output
1205
+ }], format: [{
1206
+ type: Input
1207
+ }], type: [{
1208
+ type: Input
1209
+ }], leave: [{
1210
+ type: Output
1211
+ }], enterPress: [{
1212
+ type: Output
1213
+ }], rows: [{
1214
+ type: Input
1215
+ }], width: [{
1216
+ type: Input
1217
+ }], options: [{
1218
+ type: Input
1219
+ }], optionValue: [{
1220
+ type: Input
1221
+ }], required: [{
1222
+ type: Input
1223
+ }], min: [{
1224
+ type: Input
1225
+ }], max: [{
1226
+ type: Input
1227
+ }], regex: [{
1228
+ type: Input
1229
+ }] } });
1230
+
1231
+ class CheckComponent {
1232
+ constructor() {
1233
+ this.readonly = false;
1234
+ this.display = "";
1235
+ this.value = false;
1236
+ this.valueChange = new EventEmitter();
1237
+ this.click = new EventEmitter();
1238
+ this.check = new EventEmitter();
1239
+ this.uncheck = new EventEmitter();
1240
+ }
1241
+ ngOnInit() {
1242
+ }
1243
+ changed() {
1244
+ this.valueChange.emit(this.value);
1245
+ }
1246
+ clicked() {
1247
+ this.click.emit();
1248
+ if (!this.value) {
1249
+ this.checked();
1250
+ }
1251
+ else {
1252
+ this.unchecked();
1253
+ }
1254
+ }
1255
+ checked() {
1256
+ this.check.emit();
1257
+ }
1258
+ unchecked() {
1259
+ this.uncheck.emit();
1260
+ }
1261
+ }
1262
+ CheckComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CheckComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1263
+ 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"] }] });
1264
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CheckComponent, decorators: [{
1265
+ type: Component,
1266
+ 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" }]
1267
+ }], ctorParameters: function () { return []; }, propDecorators: { readonly: [{
1268
+ type: Input
1269
+ }], display: [{
1270
+ type: Input
1271
+ }], value: [{
1272
+ type: Input
1273
+ }], valueChange: [{
1274
+ type: Output
1275
+ }], click: [{
1276
+ type: Output
1277
+ }], check: [{
1278
+ type: Output
1279
+ }], uncheck: [{
1280
+ type: Output
1281
+ }] } });
1282
+
1283
+ class DateComponent {
1284
+ constructor() {
1285
+ this.required = true;
1286
+ this.min = "2023-11-05";
1287
+ this.max = "9999-01-01";
1288
+ this.readonly = false;
1289
+ this.hint = "";
1290
+ this.value = Core.nowDate(true);
1291
+ this.display = "";
1292
+ this.placeholder = "";
1293
+ this.width = "100%";
1294
+ this.valueChange = new EventEmitter();
1295
+ this.control = new FormControl(new Date());
1296
+ }
1297
+ ngOnInit() {
1298
+ this.minDate = new FormControl(new Date(this.min));
1299
+ this.maxDate = new FormControl(new Date(this.max));
1300
+ if (!this.value || this.value == "") {
1301
+ this.control = new FormControl(new Date());
1302
+ ;
1303
+ }
1304
+ setTimeout(() => { this.onChangeEvent(); }, 5);
1305
+ if (this.readonly) {
1306
+ this.control.disable();
1307
+ }
1308
+ else {
1309
+ this.control.enable();
1310
+ }
1311
+ }
1312
+ ngOnChanges() {
1313
+ this.control = new FormControl(new Date(this.value));
1314
+ }
1315
+ onChangeEvent() {
1316
+ let d = Core.getFormatedDate2(this.control.value, true);
1317
+ this.valueChange.emit(d);
1318
+ }
1319
+ validate(control) {
1320
+ if (control.hasError('matDatepickerMin')) {
1321
+ return `Minimun date is ${this.min}`;
1322
+ }
1323
+ if (control.hasError('matDatepickerMax')) {
1324
+ return `Maximum date is ${this.max}`;
1325
+ }
1326
+ return "";
1327
+ }
1328
+ }
1329
+ DateComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DateComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1330
+ DateComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: DateComponent, selector: "spa-date", inputs: { required: "required", min: "min", max: "max", readonly: "readonly", hint: "hint", value: "value", display: "display", placeholder: "placeholder", width: "width" }, outputs: { valueChange: "valueChange" }, usesOnChanges: true, ngImport: i0, template: "\r\n<mat-form-field [ngStyle]=\"{'width':width}\">\r\n<input [formControl]=\"control\" [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-error *ngIf=\"control.invalid\">{{validate(control)}}</mat-error>\r\n</mat-form-field>\r\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.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { 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.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"] }] });
1331
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DateComponent, decorators: [{
1332
+ type: Component,
1333
+ args: [{ selector: 'spa-date', template: "\r\n<mat-form-field [ngStyle]=\"{'width':width}\">\r\n<input [formControl]=\"control\" [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-error *ngIf=\"control.invalid\">{{validate(control)}}</mat-error>\r\n</mat-form-field>\r\n" }]
1334
+ }], ctorParameters: function () { return []; }, propDecorators: { required: [{
1335
+ type: Input
1336
+ }], min: [{
1337
+ type: Input
1338
+ }], max: [{
1339
+ type: Input
1340
+ }], readonly: [{
1341
+ type: Input
1342
+ }], hint: [{
1343
+ type: Input
1344
+ }], value: [{
1345
+ type: Input
1346
+ }], display: [{
1347
+ type: Input
1348
+ }], placeholder: [{
1349
+ type: Input
1350
+ }], width: [{
1351
+ type: Input
1352
+ }], valueChange: [{
1353
+ type: Output
1354
+ }] } });
1355
+
1356
+ class DatetimeComponent {
1357
+ constructor() {
1358
+ this.display = "";
1359
+ this.value = "";
1360
+ this.valueChange = new EventEmitter();
1361
+ this.readonly = false;
1362
+ this.min = "01 jan 1900";
1363
+ this.max = "31 dec 9999";
1364
+ }
1365
+ ngOnInit() {
1366
+ }
1367
+ changed() {
1368
+ this.valueChange.emit(this.value);
1369
+ }
1370
+ }
1371
+ DatetimeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DatetimeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1372
+ 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"] }] });
1373
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DatetimeComponent, decorators: [{
1374
+ type: Component,
1375
+ 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" }]
1376
+ }], ctorParameters: function () { return []; }, propDecorators: { display: [{
1377
+ type: Input
1378
+ }], value: [{
1379
+ type: Input
1380
+ }], valueChange: [{
1381
+ type: Output
1382
+ }], readonly: [{
1383
+ type: Input
1384
+ }], min: [{
1385
+ type: Input
1386
+ }], max: [{
1387
+ type: Input
1388
+ }] } });
1389
+
1390
+ class LabelComponent {
1391
+ constructor() {
1392
+ this.display = "";
1393
+ this.value = "";
1394
+ this.format = "text";
1395
+ }
1396
+ ngOnInit() {
1397
+ }
1398
+ }
1399
+ LabelComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1400
+ 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" }] });
1401
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LabelComponent, decorators: [{
1402
+ type: Component,
1403
+ 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" }]
1404
+ }], ctorParameters: function () { return []; }, propDecorators: { display: [{
1405
+ type: Input
1406
+ }], value: [{
1407
+ type: Input
1408
+ }], format: [{
1409
+ type: Input
1410
+ }] } });
1411
+
1412
+ class SelectComponent {
1413
+ constructor() {
1414
+ this.width = "100%";
1415
+ this.readonly = false;
1416
+ this.readonlyMode = "";
1417
+ this.hint = "";
1418
+ this.placeholder = "";
1419
+ this.multiple = false;
1420
+ this.display = "";
1421
+ this.optionValue = "";
1422
+ this.optionDisplay = "";
1423
+ this.optionDisplayExtra = "";
1424
+ this.valueChange = new EventEmitter();
1425
+ }
1426
+ ngOnInit() {
1427
+ // this.displayValue = this.options.filter((m) => m.optionValue == this.value)
1428
+ // this.displayValue = this.value
1429
+ if (this.placeholder == "") {
1430
+ this.placeholder = "Select " + this.display;
1431
+ }
1432
+ }
1433
+ ngOnChanges() {
1434
+ if (this.readonlyMode != "" && this.options.length > 0) {
1435
+ this.displayValue = this.options.filter((m) => m[`${this.optionValue}`] == this.value)[0][`${this.optionDisplay}`];
1436
+ }
1437
+ }
1438
+ changed() {
1439
+ // let v;
1440
+ // v = Core.isNumber(this.value) ? Number(this.value) : this.value;
1441
+ this.valueChange.emit(this.value);
1442
+ }
1443
+ }
1444
+ SelectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1445
+ 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"] }] });
1446
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SelectComponent, decorators: [{
1447
+ type: Component,
1448
+ 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" }]
1449
+ }], ctorParameters: function () { return []; }, propDecorators: { width: [{
1450
+ type: Input
1451
+ }], readonly: [{
1452
+ type: Input
1453
+ }], readonlyMode: [{
1454
+ type: Input
1455
+ }], hint: [{
1456
+ type: Input
1457
+ }], placeholder: [{
1458
+ type: Input
1459
+ }], multiple: [{
1460
+ type: Input
1461
+ }], display: [{
1462
+ type: Input
1463
+ }], value: [{
1464
+ type: Input
1465
+ }], options: [{
1466
+ type: Input
1467
+ }], optionValue: [{
1468
+ type: Input
1469
+ }], optionDisplay: [{
1470
+ type: Input
1471
+ }], optionDisplayExtra: [{
1472
+ type: Input
1473
+ }], valueChange: [{
1474
+ type: Output
1475
+ }] } });
1476
+
1477
+ class ActivityComponent {
1478
+ constructor() {
1479
+ this.notes = new Array();
1480
+ this.notesMessage = "Empty";
1481
+ this.title = "Notes";
1482
+ }
1483
+ ngOnInit() {
1484
+ }
1485
+ }
1486
+ ActivityComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ActivityComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1487
+ 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" }] });
1488
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ActivityComponent, decorators: [{
1489
+ type: Component,
1490
+ 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" }]
1491
+ }], ctorParameters: function () { return []; }, propDecorators: { notes: [{
1492
+ type: Input
1493
+ }], title: [{
1494
+ type: Input
1495
+ }] } });
1496
+
1497
+ class FilterComponent {
1498
+ constructor() {
1499
+ this.data = new MatTableDataSource();
1500
+ this.refreshClick = new EventEmitter();
1501
+ this._filterText = "";
1502
+ }
1503
+ ngOnInit() {
1504
+ }
1505
+ ngOnChanges() {
1506
+ // console.log("OnChange")
1507
+ this.applyFilter(this._filterText);
1508
+ }
1509
+ ;
1510
+ keyUp(event) {
1511
+ let text = event.target['value'];
1512
+ this.applyFilter(text);
1513
+ }
1514
+ applyFilter(filterValue) {
1515
+ if (this.data) {
1516
+ this.data.filter = filterValue.trim().toLowerCase();
1517
+ }
1518
+ }
1519
+ refreshClicked() {
1520
+ this.refreshClick.emit();
1521
+ }
1522
+ }
1523
+ FilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1524
+ 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"] }] });
1525
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FilterComponent, decorators: [{
1526
+ type: Component,
1527
+ 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"] }]
1528
+ }], ctorParameters: function () { return []; }, propDecorators: { data: [{
1529
+ type: Input
1530
+ }], refreshClick: [{
1531
+ type: Output
1532
+ }] } });
1533
+
1534
+ const CURRENCY_INPUT_MASK_DIRECTIVE_VALUE_ACCESSOR = {
1535
+ provide: NG_VALUE_ACCESSOR,
1536
+ useExisting: forwardRef(() => CurrencyInputMaskDirective),
1537
+ multi: true
1538
+ };
1539
+ class CurrencyInputMaskDirective {
1540
+ constructor(elementRef, decimalPipe) {
1541
+ this.elementRef = elementRef;
1542
+ this.decimalPipe = decimalPipe;
1543
+ this.DECIMAL_MARK = '.';
1544
+ }
1545
+ ngOnInit() {
1546
+ this.el = this.elementRef.nativeElement;
1547
+ }
1548
+ handleFocus(event) {
1549
+ const strVal = this.getInputValue();
1550
+ const unmaskedStr = this.getUnmaskedValue(strVal);
1551
+ this.updateInputValue(unmaskedStr);
1552
+ }
1553
+ handleCut(event) {
1554
+ setTimeout(() => {
1555
+ this.inputUpdated();
1556
+ }, 0);
1557
+ }
1558
+ handleKeypress(event) {
1559
+ // Restrict characters
1560
+ const newChar = String.fromCharCode(event.which);
1561
+ const allowedChars = /^[\d.]+$/;
1562
+ if (!allowedChars.test(newChar)) {
1563
+ event.preventDefault();
1564
+ return;
1565
+ }
1566
+ // Handle decimal mark input
1567
+ const currentValue = event.target.value;
1568
+ const separatorIdx = currentValue.indexOf(this.DECIMAL_MARK);
1569
+ const hasFractionalPart = (separatorIdx >= 0);
1570
+ if (!hasFractionalPart || newChar !== this.DECIMAL_MARK) {
1571
+ return;
1572
+ }
1573
+ const isOutsideSelection = !this.isIdxBetweenSelection(separatorIdx);
1574
+ if (isOutsideSelection) {
1575
+ const positionAfterMark = separatorIdx + 1;
1576
+ this.setCursorPosition(positionAfterMark);
1577
+ event.preventDefault();
1578
+ return;
1579
+ }
1580
+ }
1581
+ handleInput(event) {
1582
+ this.inputUpdated();
1583
+ }
1584
+ handlePaste(event) {
1585
+ setTimeout(() => {
1586
+ this.inputUpdated();
1587
+ }, 1);
1588
+ }
1589
+ handleBlur(event) {
1590
+ const strVal = this.getInputValue();
1591
+ const numVal = this.convertStrToDecimal(strVal);
1592
+ this.maskInput(numVal);
1593
+ this.onModelTouched.apply(event);
1594
+ }
1595
+ registerOnChange(callbackFunction) {
1596
+ this.onModelChange = callbackFunction;
1597
+ }
1598
+ registerOnTouched(callbackFunction) {
1599
+ this.onModelTouched = callbackFunction;
1600
+ }
1601
+ setDisabledState(value) {
1602
+ this.el.disabled = value;
1603
+ }
1604
+ writeValue(numValue) {
1605
+ this.maskInput(numValue);
1606
+ }
1607
+ maskInput(numVal) {
1608
+ if (!this.isNumeric(numVal)) {
1609
+ this.updateInputValue('');
1610
+ return;
1611
+ }
1612
+ const strVal = this.convertDecimalToStr(numVal);
1613
+ const newVal = this.transformWithPipe(strVal);
1614
+ this.updateInputValue(newVal);
1615
+ }
1616
+ inputUpdated() {
1617
+ this.restrictDecimalValue();
1618
+ const strVal = this.getInputValue();
1619
+ const unmaskedVal = this.getUnmaskedValue(strVal);
1620
+ const numVal = this.convertStrToDecimal(unmaskedVal);
1621
+ if (numVal !== this.lastNumVal) {
1622
+ this.lastNumVal = numVal;
1623
+ this.onModelChange(numVal);
1624
+ }
1625
+ }
1626
+ restrictDecimalValue() {
1627
+ const strVal = this.getInputValue();
1628
+ const dotIdx = strVal.indexOf(this.DECIMAL_MARK);
1629
+ const hasFractionalPart = (dotIdx >= 0);
1630
+ if (hasFractionalPart) {
1631
+ const fractionalPart = strVal.substring(dotIdx + 1);
1632
+ if (fractionalPart.length > 2) {
1633
+ const choppedVal = strVal.substring(0, dotIdx + 3);
1634
+ this.updateInputValue(choppedVal, true);
1635
+ return;
1636
+ }
1637
+ }
1638
+ }
1639
+ transformWithPipe(str) {
1640
+ return this.decimalPipe.transform(str, '1.2-2');
1641
+ }
1642
+ getUnmaskedValue(value) {
1643
+ return value.replace(/[^-\d\\.]/g, '');
1644
+ }
1645
+ updateInputValue(value, savePosition = false) {
1646
+ if (savePosition) {
1647
+ this.saveCursorPosition();
1648
+ }
1649
+ this.el.value = value;
1650
+ }
1651
+ getInputValue() {
1652
+ return this.el.value;
1653
+ }
1654
+ convertStrToDecimal(str) {
1655
+ return (this.isNumeric(str)) ? parseFloat(str) : null;
1656
+ }
1657
+ convertDecimalToStr(n) {
1658
+ return (this.isNumeric(n)) ? n + '' : '';
1659
+ }
1660
+ isNumeric(n) {
1661
+ return !isNaN(parseFloat(n)) && isFinite(n);
1662
+ }
1663
+ saveCursorPosition() {
1664
+ const position = this.el.selectionStart;
1665
+ setTimeout(() => {
1666
+ this.setCursorPosition(position);
1667
+ }, 1);
1668
+ }
1669
+ setCursorPosition(position) {
1670
+ this.el.selectionStart = position;
1671
+ this.el.selectionEnd = position;
1672
+ }
1673
+ isIdxBetweenSelection(idx) {
1674
+ if (this.el.selectionStart === this.el.selectionEnd) {
1675
+ return false;
1676
+ }
1677
+ return (idx >= this.el.selectionStart && idx < this.el.selectionEnd);
1678
+ }
1679
+ }
1680
+ 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 });
1681
+ 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: [
1682
+ CURRENCY_INPUT_MASK_DIRECTIVE_VALUE_ACCESSOR,
1683
+ DecimalPipe
1684
+ ], ngImport: i0 });
1685
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CurrencyInputMaskDirective, decorators: [{
1686
+ type: Directive,
1687
+ args: [{
1688
+ selector: '[appCurrencyInputMask]',
1689
+ providers: [
1690
+ CURRENCY_INPUT_MASK_DIRECTIVE_VALUE_ACCESSOR,
1691
+ DecimalPipe
1692
+ ]
1693
+ }]
1694
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.DecimalPipe }]; }, propDecorators: { handleFocus: [{
1695
+ type: HostListener,
1696
+ args: ['focus', ['$event']]
1697
+ }], handleCut: [{
1698
+ type: HostListener,
1699
+ args: ['cut', ['$event']]
1700
+ }], handleKeypress: [{
1701
+ type: HostListener,
1702
+ args: ['keypress', ['$event']]
1703
+ }], handleInput: [{
1704
+ type: HostListener,
1705
+ args: ['input', ['$event']]
1706
+ }], handlePaste: [{
1707
+ type: HostListener,
1708
+ args: ['paste', ['$event']]
1709
+ }], handleBlur: [{
1710
+ type: HostListener,
1711
+ args: ['blur', ['$event']]
1712
+ }] } });
1713
+
1714
+ class MoneyComponent {
1715
+ constructor() {
1716
+ this.readonly = false;
1717
+ this.hint = "";
1718
+ this.display = "";
1719
+ this.placeholder = "";
1720
+ this.value = "";
1721
+ this.width = "100%";
1722
+ this.currency = "";
1723
+ this.valueChange = new EventEmitter();
1724
+ this.leave = new EventEmitter();
1725
+ this.enterPress = new EventEmitter();
1726
+ //validation input
1727
+ this.required = true;
1728
+ this.min = 0;
1729
+ this.max = 9000000000000000; //Math.max 9000000000000000
1730
+ //validation
1731
+ this.control = new FormControl(this.value, [Validators.required, Validators.min(this.min), Validators.max(this.max)]);
1732
+ }
1733
+ ngOnInit() {
1734
+ if (this.placeholder == "") {
1735
+ this.placeholder = "Enter " + this.display;
1736
+ }
1737
+ }
1738
+ ngOnChanges() {
1739
+ }
1740
+ ngAfterViewInit() {
1741
+ this.initControl(this.control);
1742
+ }
1743
+ initControl(control) {
1744
+ if (this.readonly) {
1745
+ control.setValidators(null);
1746
+ control.updateValueAndValidity();
1747
+ }
1748
+ if (!this.required && !this.readonly) {
1749
+ control.setValidators([Validators.min(this.min), Validators.max(this.max)]);
1750
+ this.control.updateValueAndValidity();
1751
+ }
1752
+ }
1753
+ changed(x) {
1754
+ this.valueChange.emit(x);
1755
+ }
1756
+ leaved() {
1757
+ this.leave.emit();
1758
+ }
1759
+ enterPressed() {
1760
+ this.enterPress.emit();
1761
+ }
1762
+ validate(control) {
1763
+ if (this.required && control.hasError('required')) {
1764
+ return `Required`;
1765
+ }
1766
+ if (parseFloat(this.value) < this.min) {
1767
+ return `Minimun value is ${this.min}`;
1768
+ }
1769
+ if (parseFloat(this.value) > this.max) {
1770
+ return `Maximum value is ${this.max}`;
1771
+ }
1772
+ if (control.hasError('min')) {
1773
+ return `Minimun value is ${this.min}`;
1774
+ }
1775
+ if (control.hasError('max')) {
1776
+ return `Maximum value is ${this.max}`;
1777
+ }
1778
+ return "";
1779
+ }
1780
+ }
1781
+ MoneyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MoneyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1782
+ MoneyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: MoneyComponent, selector: "spa-money", inputs: { readonly: "readonly", hint: "hint", display: "display", placeholder: "placeholder", value: "value", width: "width", currency: "currency", required: "required", min: "min", max: "max" }, outputs: { valueChange: "valueChange", leave: "leave", enterPress: "enterPress" }, usesOnChanges: true, ngImport: i0, template: "\r\n\r\n<mat-form-field hideRequiredMarker=\"true\" [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 [min]=\"min\" [max]=\"max\"\r\n [ngModel]=\"value\" (ngModelChange)=\"changed($event)\" (keyup.enter)=\"enterPressed()\" (blur)=\"leaved()\" [placeholder]=\"placeholder\" [formControl]=\"control\" [readonly]=\"readonly\" />\r\n <span *ngIf=\"currency!=''\" matPrefix>{{currency}}&nbsp;</span>\r\n <mat-error *ngIf=\"control.invalid\">{{validate(control)}}</mat-error>\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.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: 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]" }] });
1783
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MoneyComponent, decorators: [{
1784
+ type: Component,
1785
+ args: [{ selector: 'spa-money', template: "\r\n\r\n<mat-form-field hideRequiredMarker=\"true\" [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 [min]=\"min\" [max]=\"max\"\r\n [ngModel]=\"value\" (ngModelChange)=\"changed($event)\" (keyup.enter)=\"enterPressed()\" (blur)=\"leaved()\" [placeholder]=\"placeholder\" [formControl]=\"control\" [readonly]=\"readonly\" />\r\n <span *ngIf=\"currency!=''\" matPrefix>{{currency}}&nbsp;</span>\r\n <mat-error *ngIf=\"control.invalid\">{{validate(control)}}</mat-error>\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"] }]
1786
+ }], ctorParameters: function () { return []; }, propDecorators: { readonly: [{
1787
+ type: Input
1788
+ }], hint: [{
1789
+ type: Input
1790
+ }], display: [{
1791
+ type: Input
1792
+ }], placeholder: [{
1793
+ type: Input
1794
+ }], value: [{
1795
+ type: Input
1796
+ }], width: [{
1797
+ type: Input
1798
+ }], currency: [{
1799
+ type: Input
1800
+ }], valueChange: [{
1801
+ type: Output
1802
+ }], leave: [{
1803
+ type: Output
1804
+ }], enterPress: [{
1805
+ type: Output
1806
+ }], required: [{
1807
+ type: Input
1808
+ }], min: [{
1809
+ type: Input
1810
+ }], max: [{
1811
+ type: Input
1812
+ }] } });
1813
+
1814
+ class OptionComponent {
1815
+ constructor() {
1816
+ this.optionValue = "";
1817
+ this.optionDisplay = "";
1818
+ this.readonly = false;
1819
+ this.value = "";
1820
+ this.display = "";
1821
+ this.show = false;
1822
+ this.valueChange = new EventEmitter();
1823
+ this.enterPress = new EventEmitter();
1824
+ }
1825
+ ngOnInit() {
1826
+ this.OGValue = this.value;
1827
+ }
1828
+ changed() {
1829
+ this.valueChange.emit(this.value);
1830
+ }
1831
+ enterPressed() {
1832
+ this.valueChange.emit();
1833
+ }
1834
+ resetValue() {
1835
+ this.value = this.OGValue;
1836
+ this.changed();
1837
+ }
1838
+ }
1839
+ OptionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: OptionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1840
+ 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"] }] });
1841
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: OptionComponent, decorators: [{
1842
+ type: Component,
1843
+ 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" }]
1844
+ }], ctorParameters: function () { return []; }, propDecorators: { options: [{
1845
+ type: Input
1846
+ }], optionValue: [{
1847
+ type: Input
1848
+ }], optionDisplay: [{
1849
+ type: Input
1850
+ }], readonly: [{
1851
+ type: Input
1852
+ }], value: [{
1853
+ type: Input
1854
+ }], display: [{
1855
+ type: Input
1856
+ }], show: [{
1857
+ type: Input
1858
+ }], valueChange: [{
1859
+ type: Output
1860
+ }], enterPress: [{
1861
+ type: Output
1862
+ }] } });
1863
+
1864
+ class TilesComponent {
1865
+ constructor() {
1866
+ this.clickable = false;
1867
+ this.tileClick = new EventEmitter();
1868
+ this.selected = "";
1869
+ }
1870
+ ngOnInit() {
1871
+ }
1872
+ clicked(v) {
1873
+ if (!this.clickable)
1874
+ return;
1875
+ if (this.selected == v.tileName) {
1876
+ this.tileClick.emit("");
1877
+ this.selected = "";
1878
+ }
1879
+ else {
1880
+ this.tileClick.emit(v.tileName);
1881
+ this.selected = v.tileName;
1882
+ }
1883
+ }
1884
+ }
1885
+ TilesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TilesComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1886
+ 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"] }] });
1887
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TilesComponent, decorators: [{
1888
+ type: Component,
1889
+ 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" }]
1890
+ }], ctorParameters: function () { return []; }, propDecorators: { tiles: [{
1891
+ type: Input
1892
+ }], clickable: [{
1893
+ type: Input
1894
+ }], tileClick: [{
1895
+ type: Output
1896
+ }] } });
1897
+
1898
+ class StepsComponent {
1899
+ constructor() {
1900
+ this.value = "";
1901
+ }
1902
+ ngOnInit() {
1903
+ }
1904
+ ngAfterViewInit() {
1905
+ }
1906
+ ngOnChanges() {
1907
+ this.pushSteps();
1908
+ }
1909
+ setStepper() {
1910
+ if (this.value == "")
1911
+ return;
1912
+ this.stepper.selectedIndex = 0;
1913
+ switch (this.value) {
1914
+ case "Draft":
1915
+ this.stepper.selectedIndex = 0;
1916
+ break;
1917
+ case "Head Approval":
1918
+ this.pushStepper(1);
1919
+ break;
1920
+ case "CE Approval":
1921
+ this.pushStepper(2);
1922
+ break;
1923
+ case "Booking":
1924
+ this.pushStepper(3);
1925
+ break;
1926
+ case "BTA Approval":
1927
+ this.pushStepper(4);
1928
+ break;
1929
+ case "Travel":
1930
+ this.pushStepper(5);
1931
+ break;
1932
+ case "BTR Approval":
1933
+ this.pushStepper(6);
1934
+ break;
1935
+ case "Travel Closure":
1936
+ this.pushStepper(7);
1937
+ break;
1938
+ }
1939
+ }
1940
+ pushStepper(count) {
1941
+ for (let index = 0; index < count + 1; index++) {
1942
+ // const element = array[index];
1943
+ this.stepper.selectedIndex = index;
1944
+ }
1945
+ }
1946
+ pushSteps() {
1947
+ if (this.steps.length == 0)
1948
+ return;
1949
+ if (this.value == "")
1950
+ return;
1951
+ this.stepper.selectedIndex = 0;
1952
+ let i = 0;
1953
+ for (let step of this.steps) {
1954
+ if (step.name != this.value) {
1955
+ this.stepper.selectedIndex = i;
1956
+ i++;
1957
+ }
1958
+ else {
1959
+ this.stepper.selectedIndex = i;
1960
+ break;
1961
+ }
1962
+ }
1963
+ }
1964
+ }
1965
+ StepsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: StepsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1966
+ StepsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: StepsComponent, selector: "spa-steps", inputs: { value: "value", steps: "steps" }, providers: [{
1967
+ provide: STEPPER_GLOBAL_OPTIONS, useValue: { displayDefaultIndicatorType: false }
1968
+ }], 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"] }] });
1969
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: StepsComponent, decorators: [{
1970
+ type: Component,
1971
+ args: [{ selector: 'spa-steps', providers: [{
1972
+ provide: STEPPER_GLOBAL_OPTIONS, useValue: { displayDefaultIndicatorType: false }
1973
+ }], 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"] }]
1974
+ }], ctorParameters: function () { return []; }, propDecorators: { stepper: [{
1975
+ type: ViewChild,
1976
+ args: ['stepper']
1977
+ }], value: [{
1978
+ type: Input
1979
+ }], steps: [{
1980
+ type: Input
1981
+ }] } });
1982
+
1983
+ class AttachComponent {
1984
+ constructor() {
1985
+ this.message = "Drag and drop files here";
1986
+ this.files = [];
1987
+ this.filesChange = new EventEmitter();
1988
+ this.upload = new EventEmitter();
1989
+ this.enableUpload = false;
1990
+ }
1991
+ ngOnInit() {
1992
+ }
1993
+ /**
1994
+ * on file drop handler
1995
+ */
1996
+ onFileDropped($event) {
1997
+ this.prepareFilesList($event);
1998
+ }
1999
+ /**
2000
+ * handle file from browsing
2001
+ */
2002
+ fileBrowseHandler(event) {
2003
+ let files = event.target.files;
2004
+ this.prepareFilesList(files);
2005
+ }
2006
+ /**
2007
+ * Delete file from files list
2008
+ * @param index (File index)
2009
+ */
2010
+ deleteFile(index) {
2011
+ this.files.splice(index, 1);
2012
+ }
2013
+ /**
2014
+ * Simulate the upload process
2015
+ */
2016
+ // uploadFilesSimulator(index: number) {
2017
+ // setTimeout(() => {
2018
+ // if (index === this.files.length) {
2019
+ // return;
2020
+ // } else {
2021
+ // const progressInterval = setInterval(() => {
2022
+ // if (this.files[index].progress === 100) {
2023
+ // clearInterval(progressInterval);
2024
+ // this.uploadFilesSimulator(index + 1);
2025
+ // } else {
2026
+ // this.files[index].progress += 5;
2027
+ // }
2028
+ // }, 200);
2029
+ // }
2030
+ // }, 1000);
2031
+ // }
2032
+ /**
2033
+ * Convert Files list to normal array list
2034
+ * @param files (Files List)
2035
+ */
2036
+ prepareFilesList(files) {
2037
+ for (const item of files) {
2038
+ item.progress = 0;
2039
+ this.files.push(item);
2040
+ }
2041
+ // this.uploadFilesSimulator(0);
2042
+ }
2043
+ /**
2044
+ * format bytes
2045
+ * @param bytes (File size in bytes)
2046
+ * @param decimals (Decimals point)
2047
+ */
2048
+ formatBytes(bytes, decimals) {
2049
+ if (bytes === 0) {
2050
+ return '0 Bytes';
2051
+ }
2052
+ const k = 1024;
2053
+ const dm = decimals <= 0 ? 0 : decimals || 2;
2054
+ const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
2055
+ const i = Math.floor(Math.log(bytes) / Math.log(k));
2056
+ return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];
2057
+ }
2058
+ uploaded() {
2059
+ this.upload.emit();
2060
+ }
2061
+ filesChanged() {
2062
+ this.filesChange.emit(this.files);
2063
+ }
2064
+ }
2065
+ AttachComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AttachComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2066
+ 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"] }] });
2067
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AttachComponent, decorators: [{
2068
+ type: Component,
2069
+ 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"] }]
2070
+ }], ctorParameters: function () { return []; }, propDecorators: { message: [{
2071
+ type: Input
2072
+ }], files: [{
2073
+ type: Input
2074
+ }], filesChange: [{
2075
+ type: Output
2076
+ }], upload: [{
2077
+ type: Output
2078
+ }], enableUpload: [{
2079
+ type: Input
2080
+ }] } });
2081
+
2082
+ class ChipsComponent {
2083
+ constructor(messageService) {
2084
+ this.messageService = messageService;
2085
+ this.icon = "";
2086
+ this.removable = false;
2087
+ this.addable = false;
2088
+ // @Output() chipClick = new EventEmitter();
2089
+ this.click = new EventEmitter();
2090
+ this.remove = new EventEmitter();
2091
+ }
2092
+ ngOnInit() {
2093
+ }
2094
+ clicked(chip) {
2095
+ if (typeof chip != 'string') {
2096
+ return;
2097
+ }
2098
+ if (chip) {
2099
+ this.click.emit(chip);
2100
+ }
2101
+ }
2102
+ removed(chip) {
2103
+ // const index = this.chips.indexOf(chip);
2104
+ // if (index >= 0) {
2105
+ // this.chips.splice(index, 1);
2106
+ // }
2107
+ this.messageService.confirm(`Remove ${chip} ?`).subscribe((result) => {
2108
+ if (result == "yes") {
2109
+ this.remove.emit(chip);
2110
+ }
2111
+ ;
2112
+ });
2113
+ }
2114
+ }
2115
+ ChipsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ChipsComponent, deps: [{ token: MessageService }], target: i0.ɵɵFactoryTarget.Component });
2116
+ 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"] }] });
2117
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ChipsComponent, decorators: [{
2118
+ type: Component,
2119
+ 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" }]
2120
+ }], ctorParameters: function () { return [{ type: MessageService }]; }, propDecorators: { icon: [{
2121
+ type: Input
2122
+ }], removable: [{
2123
+ type: Input
2124
+ }], addable: [{
2125
+ type: Input
2126
+ }], chips: [{
2127
+ type: Input
2128
+ }], click: [{
2129
+ type: Output
2130
+ }], remove: [{
2131
+ type: Output
2132
+ }] } });
2133
+
2134
+ class LoaderService {
2135
+ constructor() {
2136
+ this.isLoading = new BehaviorSubject(false);
2137
+ }
2138
+ }
2139
+ LoaderService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LoaderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2140
+ LoaderService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LoaderService, providedIn: 'root' });
2141
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LoaderService, decorators: [{
2142
+ type: Injectable,
2143
+ args: [{
2144
+ providedIn: 'root'
2145
+ }]
2146
+ }], ctorParameters: function () { return []; } });
2147
+
2148
+ class LoaderComponent {
2149
+ constructor(loaderService) {
2150
+ this.loaderService = loaderService;
2151
+ this.logo = "";
2152
+ this.loaderService.isLoading.subscribe((v) => {
2153
+ this.loading = v;
2154
+ });
2155
+ }
2156
+ ngOnInit() {
2157
+ }
2158
+ }
2159
+ LoaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LoaderComponent, deps: [{ token: LoaderService }], target: i0.ɵɵFactoryTarget.Component });
2160
+ 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"] }] });
2161
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LoaderComponent, decorators: [{
2162
+ type: Component,
2163
+ 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"] }]
2164
+ }], ctorParameters: function () { return [{ type: LoaderService }]; }, propDecorators: { logo: [{
2165
+ type: Input
2166
+ }] } });
2167
+
2168
+ class NavMenuComponent {
2169
+ constructor(router, authService) {
2170
+ this.router = router;
2171
+ this.authService = authService;
2172
+ this.isExpanded = false;
2173
+ this.appConfig = new AppConfig();
2174
+ }
2175
+ ngOnInit() {
2176
+ this.authService.loggedUserFullName.subscribe(user => this.loggedUserFullName = user);
2177
+ this.authService.myRoleObserv.subscribe(rol => this.myRole = rol);
2178
+ this.authService.loggedinObserv.subscribe(obj => this.loggedin = obj);
2179
+ }
2180
+ collapse() {
2181
+ this.isExpanded = false;
2182
+ }
2183
+ toggle() {
2184
+ this.isExpanded = !this.isExpanded;
2185
+ }
2186
+ // logoff() {
2187
+ // // this.authService.updateloggedin(false);
2188
+ // // this.authService.updateRole(new Role());
2189
+ // this.router.navigate(["login"]);
2190
+ // // this.storageService.clear();
2191
+ // }
2192
+ redirectTo(link) {
2193
+ this.collapse();
2194
+ if (link != "") {
2195
+ this.router.navigate([link]);
2196
+ }
2197
+ }
2198
+ }
2199
+ 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 });
2200
+ 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"] }] });
2201
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NavMenuComponent, decorators: [{
2202
+ type: Component,
2203
+ 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"] }]
2204
+ }], ctorParameters: function () { return [{ type: i1$3.Router }, { type: AuthService }]; }, propDecorators: { appConfig: [{
2205
+ type: Input
2206
+ }] } });
2207
+
2208
+ class LoaderInterceptor {
2209
+ constructor(loaderService, messageService, authService, router, logService) {
2210
+ this.loaderService = loaderService;
2211
+ this.messageService = messageService;
2212
+ this.authService = authService;
2213
+ this.router = router;
2214
+ this.logService = logService;
2215
+ this.requests = [];
2216
+ }
2217
+ removeRequest(req) {
2218
+ const i = this.requests.indexOf(req);
2219
+ if (i >= 0) {
2220
+ this.requests.splice(i, 1);
2221
+ }
2222
+ this.loaderService.isLoading.next(this.requests.length > 0);
2223
+ }
2224
+ intercept(request, next) {
2225
+ let requestClone = request.clone({
2226
+ setHeaders: {
2227
+ Authorization: "Bearer " + this.authService.tokenSource.value
2228
+ }
2229
+ });
2230
+ this.requests.push(requestClone);
2231
+ if (this.requests.length > 1) {
2232
+ this.logService.info("Multiple connections detected >= " + this.requests.length);
2233
+ }
2234
+ this.loaderService.isLoading.next(true);
2235
+ return Observable.create(observer => {
2236
+ const subscription = next.handle(requestClone).subscribe(event => {
2237
+ if (event instanceof HttpResponse) {
2238
+ this.removeRequest(requestClone);
2239
+ observer.next(event);
2240
+ }
2241
+ }, (error) => {
2242
+ this.removeRequest(requestClone);
2243
+ observer.error(error);
2244
+ if (error.status === 401) {
2245
+ this.router.navigate(["login"]);
2246
+ this.messageService.toast('Unauthorised: Please login again');
2247
+ }
2248
+ else if (error.status === 500) {
2249
+ console.log(error.error);
2250
+ this.messageService.toast('System Error');
2251
+ }
2252
+ else if (error.statusText == 'Unknown Error') {
2253
+ this.messageService.toast('Connection Error');
2254
+ }
2255
+ else {
2256
+ this.messageService.toast('Error: ' + error.statusText);
2257
+ }
2258
+ }, () => {
2259
+ this.removeRequest(requestClone);
2260
+ observer.complete();
2261
+ });
2262
+ // remove request from queue when cancelled
2263
+ return () => {
2264
+ this.removeRequest(requestClone);
2265
+ subscription.unsubscribe();
2266
+ };
2267
+ });
2268
+ }
2269
+ }
2270
+ 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 });
2271
+ LoaderInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LoaderInterceptor });
2272
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LoaderInterceptor, decorators: [{
2273
+ type: Injectable
2274
+ }], ctorParameters: function () { return [{ type: LoaderService }, { type: MessageService }, { type: AuthService }, { type: i1$3.Router }, { type: LogService }]; } });
2275
+
2276
+ class CurrencyInputModule {
2277
+ }
2278
+ CurrencyInputModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CurrencyInputModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2279
+ CurrencyInputModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: CurrencyInputModule, declarations: [CurrencyInputMaskDirective], imports: [CommonModule,
2280
+ FormsModule], exports: [CurrencyInputMaskDirective] });
2281
+ CurrencyInputModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CurrencyInputModule, imports: [CommonModule,
2282
+ FormsModule] });
2283
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CurrencyInputModule, decorators: [{
2284
+ type: NgModule,
2285
+ args: [{
2286
+ imports: [
2287
+ CommonModule,
2288
+ FormsModule
2289
+ ],
2290
+ declarations: [
2291
+ CurrencyInputMaskDirective
2292
+ ],
2293
+ exports: [
2294
+ CurrencyInputMaskDirective
2295
+ ]
2296
+ }]
2297
+ }] });
2298
+
2299
+ class NumberComponent {
2300
+ constructor() {
2301
+ // options: FormGroup;
2302
+ this.hideRequiredControl = new FormControl(true);
2303
+ this.hide = true; //for password only
2304
+ this.readonly = false;
2305
+ this.hint = "";
2306
+ this.display = "";
2307
+ this.placeholder = "";
2308
+ this.value = 0;
2309
+ this.width = "100%";
2310
+ this.valueChange = new EventEmitter();
2311
+ this.leave = new EventEmitter();
2312
+ this.enterPress = new EventEmitter();
2313
+ //validation input
2314
+ this.required = true;
2315
+ this.min = 0;
2316
+ this.max = 9000000000000000; //Math.max
2317
+ this.step = 1;
2318
+ //validation
2319
+ this.control = new FormControl(this.value, [Validators.required, Validators.min(this.min), Validators.max(this.max)]);
2320
+ }
2321
+ ngOnInit() {
2322
+ if (this.placeholder == "") {
2323
+ this.placeholder = "Enter " + this.display;
2324
+ }
2325
+ }
2326
+ ngAfterViewInit() {
2327
+ this.initControl(this.control);
2328
+ }
2329
+ initControl(control) {
2330
+ if (this.readonly) {
2331
+ control.setValidators(null);
2332
+ control.updateValueAndValidity();
2333
+ }
2334
+ if (!this.required && !this.readonly) {
2335
+ control.setValidators([Validators.minLength(this.min), Validators.maxLength(this.max)]);
2336
+ this.control.updateValueAndValidity();
2337
+ }
2338
+ }
2339
+ changed() {
2340
+ this.valueChange.emit(this.value);
2341
+ }
2342
+ leaved() {
2343
+ this.leave.emit();
2344
+ }
2345
+ enterPressed() {
2346
+ this.enterPress.emit();
2347
+ }
2348
+ validate(control) {
2349
+ if (this.required && control.hasError('required')) {
2350
+ return `Required`;
2351
+ }
2352
+ if (control.hasError('min')) {
2353
+ return `Minimun value is ${this.min}`;
2354
+ }
2355
+ if (control.hasError('max')) {
2356
+ return `Maximum value is ${this.max}`;
2357
+ }
2358
+ return "";
2359
+ }
2360
+ }
2361
+ NumberComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NumberComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2362
+ 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"] }] });
2363
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NumberComponent, decorators: [{
2364
+ type: Component,
2365
+ 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" }]
2366
+ }], ctorParameters: function () { return []; }, propDecorators: { readonly: [{
2367
+ type: Input
2368
+ }], hint: [{
2369
+ type: Input
2370
+ }], display: [{
2371
+ type: Input
2372
+ }], placeholder: [{
2373
+ type: Input
2374
+ }], value: [{
2375
+ type: Input
2376
+ }], width: [{
2377
+ type: Input
2378
+ }], valueChange: [{
2379
+ type: Output
2380
+ }], leave: [{
2381
+ type: Output
2382
+ }], enterPress: [{
2383
+ type: Output
2384
+ }], required: [{
2385
+ type: Input
2386
+ }], min: [{
2387
+ type: Input
2388
+ }], max: [{
2389
+ type: Input
2390
+ }], step: [{
2391
+ type: Input
2392
+ }] } });
2393
+
2394
+ class CamelToWordsPipe {
2395
+ transform(value) {
2396
+ if (!value)
2397
+ return value;
2398
+ if (typeof value !== 'string')
2399
+ return value;
2400
+ if (value.length == 0)
2401
+ return value;
2402
+ let v = value.charAt(0).toUpperCase() + value.substring(1);
2403
+ return v.replace(/([A-Z]+)*([A-Z][a-z])/g, "$1 $2");
2404
+ }
2405
+ }
2406
+ CamelToWordsPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CamelToWordsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
2407
+ CamelToWordsPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: CamelToWordsPipe, name: "camelToWords" });
2408
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CamelToWordsPipe, decorators: [{
2409
+ type: Pipe,
2410
+ args: [{
2411
+ name: 'camelToWords'
2412
+ }]
2413
+ }] });
2414
+
2415
+ class FormComponent {
2416
+ constructor(messageService, dataService) {
2417
+ this.messageService = messageService;
2418
+ this.dataService = dataService;
2419
+ this.buttonDisplay = "Submit";
2420
+ this.isProcessing = false;
2421
+ this.multiColumn = false;
2422
+ this.buttonClick = new EventEmitter();
2423
+ }
2424
+ ngOnInit() {
2425
+ var _a, _b;
2426
+ if (!this.config.fields) {
2427
+ this.messageService.toast("Please Configure Form Fields");
2428
+ return;
2429
+ }
2430
+ if (!this.data) {
2431
+ this.messageService.toast("Please Configure Form Data");
2432
+ return;
2433
+ }
2434
+ this.fields = this.config.fields;
2435
+ if (this.config.multiColumn) {
2436
+ this.multiColumn = this.config.multiColumn;
2437
+ }
2438
+ else {
2439
+ this.multiColumn = this.fields.length > 2;
2440
+ }
2441
+ if ((_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.button) === null || _b === void 0 ? void 0 : _b.display) {
2442
+ this.buttonDisplay = this.config.button.display;
2443
+ }
2444
+ }
2445
+ ngOnChanges() {
2446
+ console.log("changed");
2447
+ }
2448
+ buttonClicked() {
2449
+ console.log("Button Clicked");
2450
+ this.buttonClick.emit(this.data);
2451
+ console.log(this.data);
2452
+ let button = this.config.button;
2453
+ if (!button) {
2454
+ return;
2455
+ }
2456
+ //validation
2457
+ let resp = Core.validateObject(this.fields, this.data);
2458
+ if (resp != '') {
2459
+ this.messageService.toast(resp);
2460
+ return;
2461
+ }
2462
+ if (button.confirm) {
2463
+ this.messageService.confirm(`${button.confirm.message}`).subscribe((result) => {
2464
+ if (result == "yes") {
2465
+ this.processCall(button);
2466
+ }
2467
+ });
2468
+ }
2469
+ else {
2470
+ this.processCall(button);
2471
+ }
2472
+ }
2473
+ processCall(button) {
2474
+ if (!button.action)
2475
+ return;
2476
+ this.isProcessing = true;
2477
+ this.dataService.CallApi(button.action, this.data).subscribe((apiResponse) => {
2478
+ this.isProcessing = false;
2479
+ if (apiResponse.success) {
2480
+ if (button.action.successMessage) {
2481
+ this.messageService.toast(button.action.successMessage);
2482
+ }
2483
+ else {
2484
+ this.messageService.toast("Submitted");
2485
+ }
2486
+ if (this.config.reset) {
2487
+ Core.resetObject(this.fields, this.data);
2488
+ }
2489
+ }
2490
+ else {
2491
+ this.messageService.toast("Error: " + apiResponse.message);
2492
+ }
2493
+ });
2494
+ }
2495
+ }
2496
+ FormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FormComponent, deps: [{ token: MessageService }, { token: DataServiceLib }], target: i0.ɵɵFactoryTarget.Component });
2497
+ FormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: FormComponent, selector: "spa-form", inputs: { data: "data", config: "config" }, outputs: { buttonClick: "buttonClick" }, usesOnChanges: true, ngImport: i0, template: "\r\n<div [ngClass]=\"multiColumn ? 'tin-grid' : 'tin-col'\" >\r\n\r\n <div [ngClass]=\"field.span ? 'span-col' : ''\" *ngFor=\"let field of fields\">\r\n\r\n <ng-container [ngSwitch]=\"field.type\">\r\n\r\n <spa-text *ngSwitchCase=\"'text'\" [display]=\"field.name | camelToWords\" [options]=\"field.options\" [optionValue]=\"field.optionValue\" [rows]=\"field.rows\" [(value)]=\"data[field.name]\" [required]=\"field.required\" [min]=\"field.min\" [max]=\"field.max\" [readonly]=\"config.mode =='view'\"></spa-text>\r\n\r\n <spa-number *ngSwitchCase=\"'number'\" [display]=\"field.name | camelToWords\" [(value)]=\"data[field.name]\" [required]=\"field.required\" [min]=\"field.min\" [max]=\"field.max\" [readonly]=\"config.mode =='view'\"></spa-number>\r\n\r\n <spa-money *ngSwitchCase=\"'money'\" [display]=\"field.name | camelToWords\" [(value)]=\"data[field.name]\" [required]=\"field.required\" [min]=\"field.min\" [max]=\"field.max\" [readonly]=\"config.mode =='view'\"></spa-money>\r\n\r\n <spa-check *ngSwitchCase=\"'checkbox'\" [display]=\"field.name | camelToWords\" [(value)]=\"data[field.name]\" [readonly]=\"config.mode =='view'\"></spa-check>\r\n\r\n <spa-date *ngSwitchCase=\"'date'\" [display]=\"field.name | camelToWords\" [(value)]=\"data[field.name]\" [min]=\"field?.min\" [max]=\"field?.max\" [readonly]=\"config.mode =='view'\" ></spa-date>\r\n\r\n <spa-select *ngSwitchCase=\"'select'\"\r\n [display]=\"field.name | camelToWords\"\r\n [options]=\"field.options\" [optionDisplay]=\"field.optionDisplay\" [optionValue]=\"field.optionValue\" [(value)]=\"data[field.name]\" [readonly]=\"config.mode =='view'\" >\r\n </spa-select>\r\n\r\n <spa-select *ngSwitchCase=\"'multi-select'\"\r\n [display]=\"field.name | camelToWords\"\r\n [options]=\"field.options\" [optionDisplay]=\"field.optionDisplay\" [optionValue]=\"field.optionValue\" [(value)]=\"data[field.name]\" [readonly]=\"config.mode =='view'\" [multiple]=\"true\">\r\n </spa-select>\r\n\r\n <spa-text *ngSwitchDefault [display]=\"field.name | camelToWords\" [options]=\"field.options\" [optionValue]=\"field.optionValue\" [rows]=\"field.rows\" [(value)]=\"data[field.name]\" [required]=\"field.required\" [min]=\"field.min\" [max]=\"field.max\" [readonly]=\"config.mode =='view'\"></spa-text>\r\n\r\n </ng-container>\r\n\r\n </div>\r\n\r\n\r\n <div class=\"span-col-center\" *ngIf=\"config.button\">\r\n <button mat-raised-button color=\"primary\" [disabled]=\"isProcessing\" (click)=\"buttonClicked()\" cdkFocusInitial>{{buttonDisplay}}</button>\r\n </div>\r\n\r\n\r\n</div>\r\n", styles: [""], 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: "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: ["required", "min", "max", "readonly", "hint", "value", "display", "placeholder", "width"], 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", "hint", "display", "placeholder", "value", "width", "currency", "required", "min", "max"], outputs: ["valueChange", "leave", "enterPress"] }, { 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" }] });
2498
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FormComponent, decorators: [{
2499
+ type: Component,
2500
+ args: [{ selector: 'spa-form', template: "\r\n<div [ngClass]=\"multiColumn ? 'tin-grid' : 'tin-col'\" >\r\n\r\n <div [ngClass]=\"field.span ? 'span-col' : ''\" *ngFor=\"let field of fields\">\r\n\r\n <ng-container [ngSwitch]=\"field.type\">\r\n\r\n <spa-text *ngSwitchCase=\"'text'\" [display]=\"field.name | camelToWords\" [options]=\"field.options\" [optionValue]=\"field.optionValue\" [rows]=\"field.rows\" [(value)]=\"data[field.name]\" [required]=\"field.required\" [min]=\"field.min\" [max]=\"field.max\" [readonly]=\"config.mode =='view'\"></spa-text>\r\n\r\n <spa-number *ngSwitchCase=\"'number'\" [display]=\"field.name | camelToWords\" [(value)]=\"data[field.name]\" [required]=\"field.required\" [min]=\"field.min\" [max]=\"field.max\" [readonly]=\"config.mode =='view'\"></spa-number>\r\n\r\n <spa-money *ngSwitchCase=\"'money'\" [display]=\"field.name | camelToWords\" [(value)]=\"data[field.name]\" [required]=\"field.required\" [min]=\"field.min\" [max]=\"field.max\" [readonly]=\"config.mode =='view'\"></spa-money>\r\n\r\n <spa-check *ngSwitchCase=\"'checkbox'\" [display]=\"field.name | camelToWords\" [(value)]=\"data[field.name]\" [readonly]=\"config.mode =='view'\"></spa-check>\r\n\r\n <spa-date *ngSwitchCase=\"'date'\" [display]=\"field.name | camelToWords\" [(value)]=\"data[field.name]\" [min]=\"field?.min\" [max]=\"field?.max\" [readonly]=\"config.mode =='view'\" ></spa-date>\r\n\r\n <spa-select *ngSwitchCase=\"'select'\"\r\n [display]=\"field.name | camelToWords\"\r\n [options]=\"field.options\" [optionDisplay]=\"field.optionDisplay\" [optionValue]=\"field.optionValue\" [(value)]=\"data[field.name]\" [readonly]=\"config.mode =='view'\" >\r\n </spa-select>\r\n\r\n <spa-select *ngSwitchCase=\"'multi-select'\"\r\n [display]=\"field.name | camelToWords\"\r\n [options]=\"field.options\" [optionDisplay]=\"field.optionDisplay\" [optionValue]=\"field.optionValue\" [(value)]=\"data[field.name]\" [readonly]=\"config.mode =='view'\" [multiple]=\"true\">\r\n </spa-select>\r\n\r\n <spa-text *ngSwitchDefault [display]=\"field.name | camelToWords\" [options]=\"field.options\" [optionValue]=\"field.optionValue\" [rows]=\"field.rows\" [(value)]=\"data[field.name]\" [required]=\"field.required\" [min]=\"field.min\" [max]=\"field.max\" [readonly]=\"config.mode =='view'\"></spa-text>\r\n\r\n </ng-container>\r\n\r\n </div>\r\n\r\n\r\n <div class=\"span-col-center\" *ngIf=\"config.button\">\r\n <button mat-raised-button color=\"primary\" [disabled]=\"isProcessing\" (click)=\"buttonClicked()\" cdkFocusInitial>{{buttonDisplay}}</button>\r\n </div>\r\n\r\n\r\n</div>\r\n" }]
2501
+ }], ctorParameters: function () { return [{ type: MessageService }, { type: DataServiceLib }]; }, propDecorators: { data: [{
2502
+ type: Input
2503
+ }], config: [{
2504
+ type: Input
2505
+ }], buttonClick: [{
2506
+ type: Output
2507
+ }] } });
2508
+
2509
+ class detailsDialog {
2510
+ constructor(dataService, messageService, dialogRef, data) {
2511
+ this.dataService = dataService;
2512
+ this.messageService = messageService;
2513
+ this.dialogRef = dialogRef;
2514
+ this.data = data;
2515
+ this.smallScreen = false;
2516
+ this.isLoadComplete = false;
2517
+ this.isProcessing = false;
2518
+ }
2519
+ ngOnInit() {
2520
+ this.tableConfig = this.data.config;
2521
+ this.formConfig = this.tableConfig.formConfig;
2522
+ this.formConfig.mode = this.data.mode;
2523
+ this.smallScreen = this.data.smallScreen;
2524
+ if (this.formConfig.mode == "create") {
2525
+ this.details = Core.generateObject(this.formConfig.fields);
2526
+ }
2527
+ else {
2528
+ this.details = this.data.details;
2529
+ }
2530
+ this.isLoadComplete = true;
2531
+ }
2532
+ setMode(newMode) {
2533
+ this.formConfig.mode = newMode;
2534
+ }
2535
+ create() {
2536
+ console.log(this.details);
2537
+ //validation
2538
+ let resp = Core.validateObject(this.formConfig.fields, this.details);
2539
+ if (resp != '') {
2540
+ this.messageService.toast(resp);
2541
+ return;
2542
+ }
2543
+ let b = this.tableConfig.buttons.find(x => x.name == "create");
2544
+ if (!b || !b.action) {
2545
+ this.dialogRef.close({ message: 'emit', data: this.details });
2546
+ return;
2547
+ }
2548
+ this.isProcessing = true;
2549
+ this.dataService.CallApi(b.action, this.details).subscribe((apiResponse) => {
2550
+ this.isProcessing = false;
2551
+ if (apiResponse.success) {
2552
+ if (b.action.successMessage) {
2553
+ this.messageService.toast(b.action.successMessage);
2554
+ }
2555
+ else {
2556
+ this.messageService.toast("Created");
2557
+ }
2558
+ this.dialogRef.close({ message: 'success', data: this.details });
2559
+ }
2560
+ else {
2561
+ this.messageService.toast("Error: " + apiResponse);
2562
+ }
2563
+ });
2564
+ }
2565
+ edit() {
2566
+ console.log("Edit");
2567
+ //validation
2568
+ let resp = Core.validateObject(this.formConfig.fields, this.details);
2569
+ if (resp != '') {
2570
+ this.messageService.toast(resp);
2571
+ return;
2572
+ }
2573
+ let b = this.tableConfig.buttons.find(x => x.name == "edit");
2574
+ if (!b || !b.action) {
2575
+ this.dialogRef.close({ message: 'emit', data: this.details });
2576
+ return;
2577
+ }
2578
+ this.isProcessing = true;
2579
+ this.dataService.CallApi(b.action, this.details).subscribe((apiResponse) => {
2580
+ this.isProcessing = false;
2581
+ if (apiResponse.success) {
2582
+ if (b.action.successMessage) {
2583
+ this.messageService.toast(b.action.successMessage);
2584
+ }
2585
+ else {
2586
+ this.messageService.toast("Updated");
2587
+ }
2588
+ this.dialogRef.close({ message: 'success', data: this.details });
2589
+ }
2590
+ else {
2591
+ this.messageService.toast("Error: " + apiResponse);
2592
+ }
2593
+ });
2594
+ }
2595
+ delete() {
2596
+ this.messageService.confirm(`DELETE ?`).subscribe((result) => {
2597
+ if (result == "yes") {
2598
+ console.log("Delete");
2599
+ let b = this.tableConfig.buttons.find(x => x.name == "delete");
2600
+ if (!b) {
2601
+ this.dialogRef.close({ message: 'success', data: this.details });
2602
+ return;
2603
+ }
2604
+ this.isProcessing = true;
2605
+ this.dataService.CallApi(b.action, this.details).subscribe((apiResponse) => {
2606
+ this.isProcessing = false;
2607
+ if (apiResponse.success) {
2608
+ if (b.action.successMessage) {
2609
+ this.messageService.toast(b.action.successMessage);
2610
+ }
2611
+ else {
2612
+ this.messageService.toast("Deleted");
2613
+ }
2614
+ this.dialogRef.close({ message: 'success', data: this.details });
2615
+ }
2616
+ else {
2617
+ this.messageService.toast("Error: " + apiResponse);
2618
+ }
2619
+ });
2620
+ }
2621
+ });
2622
+ }
2623
+ }
2624
+ 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 });
2625
+ 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"], outputs: ["buttonClick"] }, { kind: "pipe", type: i1.TitleCasePipe, name: "titlecase" }] });
2626
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: detailsDialog, decorators: [{
2627
+ type: Component,
2628
+ 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"] }]
2629
+ }], ctorParameters: function () {
2630
+ return [{ type: DataServiceLib }, { type: MessageService }, { type: i4.MatDialogRef }, { type: undefined, decorators: [{
2631
+ type: Inject,
2632
+ args: [MAT_DIALOG_DATA]
2633
+ }] }];
2634
+ } });
2635
+ ;
2636
+
2637
+ class TableComponent {
2638
+ constructor(dataService, messageService, breakpointObserver, dialog) {
2639
+ this.dataService = dataService;
2640
+ this.messageService = messageService;
2641
+ this.breakpointObserver = breakpointObserver;
2642
+ this.dialog = dialog;
2643
+ this.actionsWidth = "50px";
2644
+ this.data = [];
2645
+ this.refreshClick = new EventEmitter();
2646
+ this.createClick = new EventEmitter();
2647
+ this.viewClick = new EventEmitter();
2648
+ this.editClick = new EventEmitter();
2649
+ this.deleteClick = new EventEmitter();
2650
+ this.custom1Click = new EventEmitter();
2651
+ this.custom2Click = new EventEmitter();
2652
+ this.custom3Click = new EventEmitter();
2653
+ this.smallScreen = false;
2654
+ this.options = [];
2655
+ this.displayedColumns = [];
2656
+ // detect screen size changes
2657
+ this.breakpointObserver.observe(["(max-width: 600px)"]).subscribe((result) => {
2658
+ if (result.matches) {
2659
+ this.smallScreen = true;
2660
+ this.setColumns();
2661
+ }
2662
+ else {
2663
+ this.smallScreen = false;
2664
+ this.setColumns();
2665
+ }
2666
+ });
2667
+ }
2668
+ ngOnInit() {
2669
+ this.options = this.config.columns;
2670
+ this.setColumns();
2671
+ this.createButton = this.getButton('create');
2672
+ this.viewButton = this.getButton('view');
2673
+ this.editButton = this.getButton('edit');
2674
+ this.deleteButton = this.getButton('delete');
2675
+ this.custom1Button = this.getButton('custom1');
2676
+ this.custom2Button = this.getButton('custom2');
2677
+ this.custom3Button = this.getButton('custom3');
2678
+ if (this.config.loadAction) {
2679
+ this.loadData();
2680
+ }
2681
+ this.formDefaults();
2682
+ }
2683
+ ngOnChanges() {
2684
+ if (!this.config.loadAction) {
2685
+ console.log("Table data Changed");
2686
+ this.dataSource = this.data;
2687
+ this.tableDataSource = new MatTableDataSource(this.dataSource);
2688
+ setTimeout(() => { this.tableDataSource.paginator = this.tablePaginator; }, 5);
2689
+ }
2690
+ }
2691
+ getButton(name) {
2692
+ if (!this.config.buttons)
2693
+ return null;
2694
+ return this.config.buttons.find(x => x.name == name);
2695
+ }
2696
+ getIcon(buttonName) {
2697
+ let b = this.getButton(buttonName);
2698
+ if (b.icon) {
2699
+ return b.icon.name;
2700
+ }
2701
+ let i = 'pageview';
2702
+ switch (buttonName) {
2703
+ case 'view':
2704
+ i = 'pageview';
2705
+ break;
2706
+ case 'edit':
2707
+ i = 'edit';
2708
+ break;
2709
+ case 'delete':
2710
+ i = 'delete';
2711
+ break;
2712
+ default:
2713
+ break;
2714
+ }
2715
+ return i;
2716
+ }
2717
+ setColumns() {
2718
+ var _a, _b;
2719
+ if (!((_a = this.config) === null || _a === void 0 ? void 0 : _a.columns)) {
2720
+ return;
2721
+ }
2722
+ if (this.smallScreen) {
2723
+ this.displayedColumns = this.config.minColumns;
2724
+ }
2725
+ else {
2726
+ this.displayedColumns = this.config.columns.map(({ name }) => name);
2727
+ }
2728
+ let buttonsCount = (_b = this.config.buttons.filter(x => x.name != 'create').length) !== null && _b !== void 0 ? _b : 0;
2729
+ if (buttonsCount > 0) {
2730
+ if (!this.displayedColumns.find(x => x == 'action') && this.config.buttons) {
2731
+ this.displayedColumns.push("action");
2732
+ }
2733
+ this.actionsWidth = `${buttonsCount * 40 + 20}px`;
2734
+ }
2735
+ }
2736
+ getOptions(column) {
2737
+ let x = this.options.find(opt => opt.name === column);
2738
+ return x;
2739
+ }
2740
+ testIconCondition(column, row) {
2741
+ const option = this.getOptions(column);
2742
+ if (option && option.icon && !option.icon.condition) {
2743
+ return true;
2744
+ }
2745
+ if (option && option.icon && option.icon.condition) {
2746
+ return option.icon.condition(row[column]);
2747
+ }
2748
+ return false;
2749
+ }
2750
+ testDisabled(row, buttonName) {
2751
+ let button = this.getButton(buttonName);
2752
+ if (button.disabled) {
2753
+ return button.disabled(row);
2754
+ }
2755
+ return false;
2756
+ }
2757
+ testVisible(row, buttonName) {
2758
+ let button = this.getButton(buttonName);
2759
+ if (button.visible) {
2760
+ return button.visible(row);
2761
+ }
2762
+ return true;
2763
+ }
2764
+ //Actions
2765
+ refreshClicked() {
2766
+ console.log("Refresh");
2767
+ this.refreshClick.emit();
2768
+ if (this.config.loadAction) {
2769
+ this.loadData();
2770
+ }
2771
+ }
2772
+ view(x) {
2773
+ console.log("View");
2774
+ this.viewClick.emit(x);
2775
+ // this.doAction('view', x);
2776
+ }
2777
+ create(x) {
2778
+ console.log("Create " + x);
2779
+ this.createClick.emit(x);
2780
+ this.doAction('create', x);
2781
+ }
2782
+ edit(x) {
2783
+ console.log("Edit " + x);
2784
+ this.editClick.emit(x);
2785
+ this.doAction('edit', x);
2786
+ }
2787
+ delete(x) {
2788
+ console.log("Delete");
2789
+ this.deleteClick.emit(x);
2790
+ this.doAction('delete', x);
2791
+ }
2792
+ custom1(x) {
2793
+ console.log("Custom 1");
2794
+ this.custom1Click.emit(x);
2795
+ this.doAction('custom1', x);
2796
+ }
2797
+ custom2(x) {
2798
+ console.log("Custom 2");
2799
+ this.custom2Click.emit(x);
2800
+ this.doAction('custom2', x);
2801
+ }
2802
+ custom3(x) {
2803
+ console.log("Custom 3");
2804
+ this.custom3Click.emit(x);
2805
+ this.doAction('custom3', x);
2806
+ }
2807
+ viewModel(row) {
2808
+ let button = this.getButton('view');
2809
+ if (button && !button.dialog) {
2810
+ this.view(row);
2811
+ return;
2812
+ }
2813
+ if (!this.config.formConfig) {
2814
+ this.messageService.toast("Please configure form");
2815
+ return;
2816
+ }
2817
+ const dialogRef = this.dialog.open(detailsDialog, {
2818
+ width: "900px",
2819
+ data: { mode: "view", config: this.config, details: row, smallScreen: this.smallScreen },
2820
+ });
2821
+ dialogRef.afterClosed().subscribe((result) => {
2822
+ if (result.message) {
2823
+ this.refreshClicked();
2824
+ }
2825
+ });
2826
+ }
2827
+ newModel() {
2828
+ let button = this.getButton('create');
2829
+ if (button && !button.dialog) {
2830
+ this.create('');
2831
+ return;
2832
+ }
2833
+ if (!this.config.formConfig) {
2834
+ this.messageService.toast("Please configure form");
2835
+ return;
2836
+ }
2837
+ const dialogRef = this.dialog.open(detailsDialog, {
2838
+ width: "900px",
2839
+ data: { mode: "create", config: this.config, smallScreen: this.smallScreen }
2840
+ });
2841
+ dialogRef.afterClosed().subscribe((result) => {
2842
+ if (result.message == "success") {
2843
+ this.create(result.data);
2844
+ this.refreshClicked();
2845
+ }
2846
+ else if (result.message == "emit") {
2847
+ this.create(result.data);
2848
+ }
2849
+ });
2850
+ }
2851
+ editModel(row) {
2852
+ let button = this.getButton('edit');
2853
+ if (button && !button.dialog) {
2854
+ this.edit(row);
2855
+ return;
2856
+ }
2857
+ if (!this.config.formConfig) {
2858
+ this.messageService.toast("Please configure form");
2859
+ return;
2860
+ }
2861
+ const dialogRef = this.dialog.open(detailsDialog, {
2862
+ width: "900px",
2863
+ data: { mode: "edit", config: this.config, details: row, smallScreen: this.smallScreen },
2864
+ });
2865
+ dialogRef.afterClosed().subscribe((result) => {
2866
+ if (result.message == "success") {
2867
+ this.edit(result.data);
2868
+ this.refreshClicked();
2869
+ }
2870
+ else if (result.message == "emit") {
2871
+ this.edit(result.data);
2872
+ }
2873
+ });
2874
+ }
2875
+ deleteModel(row) {
2876
+ let button = this.getButton('delete');
2877
+ if (button && !button.dialog) {
2878
+ this.delete(row);
2879
+ return;
2880
+ }
2881
+ this.messageService.confirm(`DELETE ?`).subscribe((result) => {
2882
+ if (result == "yes") {
2883
+ this.delete(row);
2884
+ this.refreshClicked();
2885
+ }
2886
+ });
2887
+ }
2888
+ doAction(buttonName, row) {
2889
+ let b = this.getButton(buttonName);
2890
+ if (!b)
2891
+ return;
2892
+ if (b.action && buttonName != 'delete')
2893
+ return;
2894
+ if (!b.action)
2895
+ return;
2896
+ this.dataService.CallApi(b.action, row).subscribe((apiResponse) => {
2897
+ if (apiResponse.success) {
2898
+ if (b.action.successMessage) {
2899
+ this.messageService.toast(b.action.successMessage);
2900
+ }
2901
+ else {
2902
+ this.messageService.toast("Updated");
2903
+ }
2904
+ this.refreshClicked();
2905
+ }
2906
+ else {
2907
+ this.messageService.toast("Error: " + apiResponse.message);
2908
+ }
2909
+ });
2910
+ }
2911
+ loadData() {
2912
+ console.log("loading");
2913
+ if (this.config.loadAction) {
2914
+ this.dataService.CallApi(this.config.loadAction, "").subscribe((apiResponse) => {
2915
+ this.dataSource = apiResponse.data;
2916
+ this.tableDataSource = new MatTableDataSource(apiResponse.data);
2917
+ this.tableDataSource.paginator = this.tablePaginator;
2918
+ if (apiResponse.success) {
2919
+ this.tableDataSource = new MatTableDataSource(apiResponse.data);
2920
+ this.tableDataSource.paginator = this.tablePaginator;
2921
+ }
2922
+ else {
2923
+ this.messageService.toast("Error: " + JSON.stringify(apiResponse));
2924
+ }
2925
+ });
2926
+ }
2927
+ }
2928
+ formDefaults() {
2929
+ if (!this.config.formConfig) {
2930
+ let config = new FormConfig;
2931
+ config.fields = [];
2932
+ this.config.columns.forEach(column => {
2933
+ let field = { name: column.name, type: column.type };
2934
+ config.fields.push(field);
2935
+ });
2936
+ this.config.formConfig = config;
2937
+ }
2938
+ }
2939
+ }
2940
+ 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 });
2941
+ 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" }] });
2942
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TableComponent, decorators: [{
2943
+ type: Component,
2944
+ 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"] }]
2945
+ }], ctorParameters: function () { return [{ type: DataServiceLib }, { type: MessageService }, { type: i3$3.BreakpointObserver }, { type: i4.MatDialog }]; }, propDecorators: { tablePaginator: [{
2946
+ type: ViewChild,
2947
+ args: ['tablePaginator']
2948
+ }], data: [{
2949
+ type: Input
2950
+ }], config: [{
2951
+ type: Input
2952
+ }], refreshClick: [{
2953
+ type: Output
2954
+ }], createClick: [{
2955
+ type: Output
2956
+ }], viewClick: [{
2957
+ type: Output
2958
+ }], editClick: [{
2959
+ type: Output
2960
+ }], deleteClick: [{
2961
+ type: Output
2962
+ }], custom1Click: [{
2963
+ type: Output
2964
+ }], custom2Click: [{
2965
+ type: Output
2966
+ }], custom3Click: [{
2967
+ type: Output
2968
+ }] } });
2969
+
2970
+ class TinSpaModule {
2971
+ }
2972
+ TinSpaModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TinSpaModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2973
+ TinSpaModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: TinSpaModule, declarations: [TinSpaComponent, TextComponent, CheckComponent, DateComponent, DatetimeComponent, LabelComponent, SelectComponent,
2974
+ ActivityComponent, FilterComponent, messageDialog, MoneyComponent, OptionComponent, TilesComponent, StepsComponent,
2975
+ AttachComponent, ChipsComponent, LoaderComponent, NavMenuComponent, TableComponent, detailsDialog, FormComponent, CamelToWordsPipe, NumberComponent], imports: [SpaMatModule,
2976
+ HttpClientModule,
2977
+ CurrencyInputModule], exports: [TinSpaComponent,
2978
+ SpaMatModule,
2979
+ TextComponent,
2980
+ messageDialog,
2981
+ NavMenuComponent,
2982
+ LoaderComponent,
2983
+ TilesComponent,
2984
+ DateComponent,
2985
+ SelectComponent,
2986
+ DatetimeComponent,
2987
+ CheckComponent,
2988
+ AttachComponent,
2989
+ MoneyComponent,
2990
+ ChipsComponent,
2991
+ ActivityComponent,
2992
+ OptionComponent,
2993
+ LabelComponent,
2994
+ StepsComponent,
2995
+ FilterComponent,
2996
+ TableComponent, detailsDialog,
2997
+ FormComponent,
2998
+ NumberComponent] });
2999
+ TinSpaModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TinSpaModule, providers: [
3000
+ { provide: HTTP_INTERCEPTORS, useClass: LoaderInterceptor, multi: true },
3001
+ { provide: LocationStrategy, useClass: HashLocationStrategy },
3002
+ { provide: MAT_FORM_FIELD_DEFAULT_OPTIONS, useValue: { appearance: 'legacy' } },
3003
+ CurrencyPipe, DatePipe
3004
+ ], imports: [SpaMatModule,
3005
+ HttpClientModule,
3006
+ CurrencyInputModule, SpaMatModule] });
3007
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TinSpaModule, decorators: [{
3008
+ type: NgModule,
3009
+ args: [{
3010
+ declarations: [
3011
+ TinSpaComponent, TextComponent, CheckComponent, DateComponent, DatetimeComponent, LabelComponent, SelectComponent,
3012
+ ActivityComponent, FilterComponent, messageDialog, MoneyComponent, OptionComponent, TilesComponent, StepsComponent,
3013
+ AttachComponent, ChipsComponent, LoaderComponent, NavMenuComponent, TableComponent, detailsDialog, FormComponent, CamelToWordsPipe, NumberComponent
3014
+ ],
3015
+ imports: [
3016
+ SpaMatModule,
3017
+ HttpClientModule,
3018
+ CurrencyInputModule
3019
+ ],
3020
+ exports: [
3021
+ TinSpaComponent,
3022
+ SpaMatModule,
3023
+ TextComponent,
3024
+ messageDialog,
3025
+ NavMenuComponent,
3026
+ LoaderComponent,
3027
+ TilesComponent,
3028
+ DateComponent,
3029
+ SelectComponent,
3030
+ DatetimeComponent,
3031
+ CheckComponent,
3032
+ AttachComponent,
3033
+ MoneyComponent,
3034
+ ChipsComponent,
3035
+ ActivityComponent,
3036
+ OptionComponent,
3037
+ LabelComponent,
3038
+ StepsComponent,
3039
+ FilterComponent,
3040
+ TableComponent, detailsDialog,
3041
+ FormComponent,
3042
+ NumberComponent
3043
+ ],
3044
+ providers: [
3045
+ { provide: HTTP_INTERCEPTORS, useClass: LoaderInterceptor, multi: true },
3046
+ { provide: LocationStrategy, useClass: HashLocationStrategy },
3047
+ { provide: MAT_FORM_FIELD_DEFAULT_OPTIONS, useValue: { appearance: 'legacy' } },
3048
+ CurrencyPipe, DatePipe
3049
+ ],
3050
+ }]
3051
+ }] });
3052
+
3053
+ class LoginComponent {
3054
+ constructor(httpService, storageService, router, messageService, dataService, authService, logService, route) {
3055
+ this.httpService = httpService;
3056
+ this.storageService = storageService;
3057
+ this.router = router;
3058
+ this.messageService = messageService;
3059
+ this.dataService = dataService;
3060
+ this.authService = authService;
3061
+ this.logService = logService;
3062
+ this.route = route;
3063
+ this.style = "default";
3064
+ this.email = "";
3065
+ this.password = "";
3066
+ this.user = new User();
3067
+ this.hide = true;
3068
+ this.isProcessing = false;
3069
+ this.appConfig = new AppConfig();
3070
+ }
3071
+ ngOnInit() {
3072
+ this.authService.Updateloggedin(false);
3073
+ this.authService.UpdateRole(null);
3074
+ this.storageService.clear();
3075
+ this.dataService.appConfigObserv.subscribe(x => this.appConfig = x);
3076
+ if (this.route.snapshot.queryParams["redirectTo"] != undefined) {
3077
+ this.redirectPath = this.route.snapshot.queryParams["redirectTo"];
3078
+ }
3079
+ else {
3080
+ this.redirectPath = "home";
3081
+ }
3082
+ }
3083
+ signup() {
3084
+ this.router.navigate(["signup"]);
3085
+ }
3086
+ recoverAccount() {
3087
+ this.router.navigate(["recover-account"]);
3088
+ }
3089
+ login() {
3090
+ if (this.user.userName == "" || this.user.password == "") {
3091
+ this.messageService.toast("Please enter your credentials");
3092
+ return;
3093
+ }
3094
+ this.logService.info("logging in");
3095
+ this.isProcessing = true;
3096
+ this.user.userName = this.user.userName;
3097
+ this.dataService.Login(this.user).subscribe((apiResponse) => {
3098
+ this.isProcessing = false;
3099
+ if (apiResponse.success) {
3100
+ if (apiResponse.data.authType == 'local' && !this.appConfig.localAuth) {
3101
+ this.messageService.toast("Contact Admin: Authentication Type error");
3102
+ return;
3103
+ }
3104
+ if (apiResponse.data.authType == 'AD' && !this.appConfig.ADAuth) {
3105
+ this.messageService.toast("Contact Admin: Authentication Type error");
3106
+ return;
3107
+ }
3108
+ this.authService.Updateloggedin(true);
3109
+ this.authService.UpdateToken(apiResponse.data.token);
3110
+ this.storageService.store(Constants.AUTH_TOKEN, apiResponse.data.token);
3111
+ this.authService.UpdateTokenExpire(apiResponse.data.expiration);
3112
+ this.storageService.store(Constants.AUTH_TOKEN_EXPIRE, apiResponse.data.expiration);
3113
+ this.authService.UpdateCurrentUser(this.user.userName);
3114
+ this.storageService.store(Constants.AUTH_USER, this.user.userName);
3115
+ this.authService.updateLoggedUserFullName(apiResponse.data.firstName);
3116
+ this.storageService.store(Constants.AUTH_NAME, apiResponse.data.firstName);
3117
+ this.authService.UpdateRole(apiResponse.data.role);
3118
+ this.storageService.store(Constants.AUTH_ROLES, JSON.stringify(apiResponse.data.role));
3119
+ this.logService.info("logged in");
3120
+ if (apiResponse.data.changePassword == true && apiResponse.data.authType == 'local') {
3121
+ this.router.navigate(["home/user/change-password"], {
3122
+ queryParams: { redirectTo: this.redirectPath },
3123
+ queryParamsHandling: 'merge',
3124
+ skipLocationChange: false
3125
+ });
3126
+ return;
3127
+ }
3128
+ this.router.navigate([this.redirectPath]);
3129
+ }
3130
+ else {
3131
+ this.messageService.toast("Error: " + apiResponse.message);
3132
+ this.user.password = "";
3133
+ }
3134
+ }, (error) => {
3135
+ this.isProcessing = false;
3136
+ this.messageService.toast(this.httpService.Error(error));
3137
+ });
3138
+ }
3139
+ }
3140
+ 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 });
3141
+ 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"] }] });
3142
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LoginComponent, decorators: [{
3143
+ type: Component,
3144
+ 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"] }]
3145
+ }], ctorParameters: function () { return [{ type: HttpService }, { type: StorageService }, { type: i1$3.Router }, { type: MessageService }, { type: DataServiceLib }, { type: AuthService }, { type: LogService }, { type: i1$3.ActivatedRoute }]; } });
3146
+
3147
+ class SignupComponent {
3148
+ constructor(httpService, messageService, dataService, authService) {
3149
+ this.httpService = httpService;
3150
+ this.messageService = messageService;
3151
+ this.dataService = dataService;
3152
+ this.authService = authService;
3153
+ this.isProcessing = false;
3154
+ this.user = new User();
3155
+ this.profile = new Profile();
3156
+ this.account = new Account();
3157
+ }
3158
+ ngOnInit() {
3159
+ this.account.user = this.user;
3160
+ this.account.profile = this.profile;
3161
+ }
3162
+ create() {
3163
+ this.profile.userName = this.user.userName;
3164
+ this.isProcessing = true;
3165
+ this.dataService.RegisterAccount(this.account).subscribe((apiResponse) => {
3166
+ this.isProcessing = false;
3167
+ if (apiResponse.message == "success") {
3168
+ this.messageService.toast("Account Created");
3169
+ this.user = new User();
3170
+ this.profile = new Profile();
3171
+ }
3172
+ else {
3173
+ this.messageService.toast("Error: " + apiResponse.message);
3174
+ }
3175
+ }, (error) => {
3176
+ this.isProcessing = false;
3177
+ this.messageService.toast(this.httpService.Error(error));
3178
+ });
3179
+ }
3180
+ }
3181
+ 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 });
3182
+ 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"] }] });
3183
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SignupComponent, decorators: [{
3184
+ type: Component,
3185
+ 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" }]
3186
+ }], ctorParameters: function () { return [{ type: HttpService }, { type: MessageService }, { type: DataServiceLib }, { type: AuthService }]; } });
3187
+
3188
+ class RecoverAccountComponent {
3189
+ constructor(location, dataService, authService, messageService) {
3190
+ this.location = location;
3191
+ this.dataService = dataService;
3192
+ this.authService = authService;
3193
+ this.messageService = messageService;
3194
+ this.userName = "";
3195
+ }
3196
+ ngOnInit() {
3197
+ }
3198
+ recover() {
3199
+ if (this.userName == "") {
3200
+ this.messageService.toast("Please enter your userName");
3201
+ return;
3202
+ }
3203
+ else {
3204
+ let u = new User();
3205
+ u.userName = this.userName;
3206
+ this.dataService.SelfReset(u).subscribe((apiResponse) => {
3207
+ if (apiResponse.message == "success") {
3208
+ this.messageService.toast("The password has been sent to your email");
3209
+ this.location.back();
3210
+ }
3211
+ else {
3212
+ this.messageService.toast("Error: " + apiResponse.message);
3213
+ }
3214
+ });
3215
+ }
3216
+ }
3217
+ }
3218
+ 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 });
3219
+ 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"] }] });
3220
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: RecoverAccountComponent, decorators: [{
3221
+ type: Component,
3222
+ 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" }]
3223
+ }], ctorParameters: function () { return [{ type: i1.Location }, { type: DataServiceLib }, { type: AuthService }, { type: MessageService }]; } });
3224
+
3225
+ class SpaIndexModule {
3226
+ }
3227
+ SpaIndexModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SpaIndexModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3228
+ SpaIndexModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: SpaIndexModule, declarations: [LoginComponent, SignupComponent, RecoverAccountComponent], imports: [i2.ReactiveFormsModule, CommonModule,
3229
+ FormsModule,
3230
+ ReactiveFormsModule,
3231
+ // SpaMatModule,
3232
+ TinSpaModule], exports: [CommonModule,
3233
+ FormsModule,
3234
+ // SpaMatModule,
3235
+ LoginComponent,
3236
+ SignupComponent,
3237
+ RecoverAccountComponent] });
3238
+ SpaIndexModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SpaIndexModule, imports: [ReactiveFormsModule.withConfig({ warnOnNgModelWithFormControl: "never" }),
3239
+ CommonModule,
3240
+ FormsModule,
3241
+ ReactiveFormsModule,
3242
+ // SpaMatModule,
3243
+ TinSpaModule, CommonModule,
3244
+ FormsModule] });
3245
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SpaIndexModule, decorators: [{
3246
+ type: NgModule,
3247
+ args: [{
3248
+ declarations: [LoginComponent, SignupComponent, RecoverAccountComponent],
3249
+ imports: [
3250
+ ReactiveFormsModule.withConfig({ warnOnNgModelWithFormControl: "never" }),
3251
+ CommonModule,
3252
+ FormsModule,
3253
+ ReactiveFormsModule,
3254
+ // SpaMatModule,
3255
+ TinSpaModule
3256
+ ],
3257
+ exports: [
3258
+ CommonModule,
3259
+ FormsModule,
3260
+ // SpaMatModule,
3261
+ LoginComponent,
3262
+ SignupComponent,
3263
+ RecoverAccountComponent,
3264
+ ],
3265
+ }]
3266
+ }] });
3267
+
3268
+ class ChangePasswordComponent {
3269
+ constructor(router, location, httpService, messageService, dataService, authService, route) {
3270
+ this.router = router;
3271
+ this.location = location;
3272
+ this.httpService = httpService;
3273
+ this.messageService = messageService;
3274
+ this.dataService = dataService;
3275
+ this.authService = authService;
3276
+ this.route = route;
3277
+ this.isProcessing = false;
3278
+ this.changePassword = new ChangeUserPassword();
3279
+ }
3280
+ ngOnInit() {
3281
+ this.myRole = this.authService.currentRoleSource.value;
3282
+ if (this.dataService.tmpProfileuserName == "") {
3283
+ this.changePassword.userName = this.authService.currentUser;
3284
+ }
3285
+ else {
3286
+ this.changePassword.userName = this.dataService.tmpProfileuserName;
3287
+ this.dataService.tmpProfileuserName = "";
3288
+ }
3289
+ if (this.route.snapshot.queryParams["redirectTo"] != undefined) {
3290
+ this.redirectPath = this.route.snapshot.queryParams["redirectTo"];
3291
+ }
3292
+ else {
3293
+ this.redirectPath = "home";
3294
+ }
3295
+ }
3296
+ change() {
3297
+ if (!this.myRole[this.dataService.capUsers.name]) {
3298
+ if (this.changePassword.currentPassword == "") {
3299
+ this.messageService.toast("Please enter current Password");
3300
+ return;
3301
+ }
3302
+ }
3303
+ if (this.changePassword.newPassword == "") {
3304
+ this.messageService.toast("Please enter new Password");
3305
+ return;
3306
+ }
3307
+ if (this.changePassword.confirmPassword == "") {
3308
+ this.messageService.toast("Please confirm new Password");
3309
+ return;
3310
+ }
3311
+ if (this.changePassword.confirmPassword != this.changePassword.newPassword) {
3312
+ this.messageService.toast("Passwords do not match");
3313
+ return;
3314
+ }
3315
+ this.isProcessing = true;
3316
+ if (this.myRole[this.dataService.capUsers.name]) {
3317
+ this.dataService.ChangePasswordAdmin(this.changePassword).subscribe((apiResponse) => {
3318
+ this.isProcessing = false;
3319
+ if (apiResponse.message == "success") {
3320
+ this.messageService.toast("Password Changed");
3321
+ this.router.navigate([this.redirectPath]);
3322
+ }
3323
+ else {
3324
+ this.messageService.toast("Error: " + apiResponse.message);
3325
+ }
3326
+ });
3327
+ }
3328
+ else {
3329
+ this.dataService.ChangePassword(this.changePassword).subscribe((apiResponse) => {
3330
+ this.isProcessing = false;
3331
+ if (apiResponse.message == "success") {
3332
+ this.messageService.toast("Password Changed");
3333
+ this.router.navigate([this.redirectPath]);
3334
+ }
3335
+ else {
3336
+ this.messageService.toast("Error: " + apiResponse.message);
3337
+ }
3338
+ });
3339
+ }
3340
+ }
3341
+ }
3342
+ 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 });
3343
+ 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"] }] });
3344
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ChangePasswordComponent, decorators: [{
3345
+ type: Component,
3346
+ 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" }]
3347
+ }], ctorParameters: function () { return [{ type: i1$3.Router }, { type: i1.Location }, { type: HttpService }, { type: MessageService }, { type: DataServiceLib }, { type: AuthService }, { type: i1$3.ActivatedRoute }]; } });
3348
+
3349
+ class ProfileComponent {
3350
+ constructor(dataService, messageService, httpService, router, authService) {
3351
+ this.dataService = dataService;
3352
+ this.messageService = messageService;
3353
+ this.httpService = httpService;
3354
+ this.router = router;
3355
+ this.authService = authService;
3356
+ this.initials = "";
3357
+ this.appConfig = new AppConfig();
3358
+ this.selfProfile = false;
3359
+ }
3360
+ ngOnInit() {
3361
+ this.myRole = this.authService.currentRoleSource.value;
3362
+ if (this.dataService.tmpProfileuserName == "") {
3363
+ this.loadProfile(this.authService.currentUser);
3364
+ }
3365
+ else {
3366
+ this.loadProfile(this.dataService.tmpProfileuserName);
3367
+ this.dataService.tmpProfileuserName = "";
3368
+ }
3369
+ }
3370
+ loadProfile(userName) {
3371
+ let action = "all";
3372
+ this.dataService.GetUserByID(userName).subscribe((apiResponse) => {
3373
+ var _a, _b;
3374
+ this.profile = apiResponse[0];
3375
+ if (this.profile.userName.toLocaleLowerCase() == this.authService.currentUser.toLocaleLowerCase()) {
3376
+ this.selfProfile = true;
3377
+ }
3378
+ this.loadRoles();
3379
+ 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)}`;
3380
+ }, (error) => {
3381
+ this.isProcessing = false;
3382
+ this.messageService.toast(this.httpService.Error(error));
3383
+ });
3384
+ }
3385
+ loadRoles() {
3386
+ this.dataService.GetRole("all", "").subscribe((apiResponse) => {
3387
+ this.roles = apiResponse;
3388
+ console.log(this.roles);
3389
+ }, (error) => {
3390
+ this.isProcessing = false;
3391
+ this.messageService.toast(this.httpService.Error(error));
3392
+ });
3393
+ }
3394
+ changePassword() {
3395
+ this.dataService.tmpProfileuserName = this.profile.userName;
3396
+ this.router.navigate(["home/user/change-password"]);
3397
+ }
3398
+ gotoUsers() {
3399
+ this.router.navigate(["home/admin/users"]);
3400
+ }
3401
+ update() {
3402
+ }
3403
+ updateProfile() {
3404
+ this.isProcessing = true;
3405
+ // console.log(this.profile)
3406
+ // return
3407
+ this.dataService.UpdateUser(this.profile).subscribe((apiResponse) => {
3408
+ this.isProcessing = false;
3409
+ if (apiResponse.success) {
3410
+ this.messageService.toast("Profile Updated");
3411
+ }
3412
+ else {
3413
+ this.messageService.toast("Error: " + apiResponse.message);
3414
+ }
3415
+ }, (error) => {
3416
+ this.messageService.toast("Connection failed ");
3417
+ this.isProcessing = false;
3418
+ });
3419
+ }
3420
+ }
3421
+ 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 });
3422
+ 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"] }] });
3423
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ProfileComponent, decorators: [{
3424
+ type: Component,
3425
+ 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"] }]
3426
+ }], ctorParameters: function () { return [{ type: DataServiceLib }, { type: MessageService }, { type: HttpService }, { type: i1$3.Router }, { type: AuthService }]; }, propDecorators: { appConfig: [{
3427
+ type: Input
3428
+ }] } });
3429
+
3430
+ class SpaUserModule {
3431
+ }
3432
+ SpaUserModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SpaUserModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3433
+ SpaUserModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: SpaUserModule, declarations: [ChangePasswordComponent, ProfileComponent], imports: [i2.ReactiveFormsModule, CommonModule,
3434
+ FormsModule,
3435
+ ReactiveFormsModule,
3436
+ // SpaMatModule,
3437
+ TinSpaModule], exports: [CommonModule,
3438
+ FormsModule,
3439
+ // SpaMatModule,
3440
+ ChangePasswordComponent,
3441
+ ProfileComponent] });
3442
+ SpaUserModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SpaUserModule, imports: [ReactiveFormsModule.withConfig({ warnOnNgModelWithFormControl: "never" }),
3443
+ CommonModule,
3444
+ FormsModule,
3445
+ ReactiveFormsModule,
3446
+ // SpaMatModule,
3447
+ TinSpaModule, CommonModule,
3448
+ FormsModule] });
3449
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SpaUserModule, decorators: [{
3450
+ type: NgModule,
3451
+ args: [{
3452
+ declarations: [ChangePasswordComponent, ProfileComponent],
3453
+ imports: [
3454
+ ReactiveFormsModule.withConfig({ warnOnNgModelWithFormControl: "never" }),
3455
+ CommonModule,
3456
+ FormsModule,
3457
+ ReactiveFormsModule,
3458
+ // SpaMatModule,
3459
+ TinSpaModule
3460
+ ],
3461
+ exports: [
3462
+ CommonModule,
3463
+ FormsModule,
3464
+ // SpaMatModule,
3465
+ ChangePasswordComponent,
3466
+ ProfileComponent,
3467
+ ],
3468
+ }]
3469
+ }] });
3470
+
3471
+ // import { ApiResponse } from 'tin-core';
3472
+ class SettingsComponent {
3473
+ constructor(dataService, messageService) {
3474
+ this.dataService = dataService;
3475
+ this.messageService = messageService;
3476
+ this._filterText = "";
3477
+ this.isProcessing = false;
3478
+ }
3479
+ ngOnInit() {
3480
+ this.loadSettings();
3481
+ }
3482
+ applyFilter(filterValue) {
3483
+ this.settings.filter = filterValue.trim().toLowerCase();
3484
+ }
3485
+ loadSettings() {
3486
+ this.dataService.GetSetting("all", "").subscribe((apiResponse) => {
3487
+ this.settings = apiResponse;
3488
+ });
3489
+ }
3490
+ updateSetting(setting) {
3491
+ this.isProcessing = true;
3492
+ this.dataService.UpdateSetting(setting, "edit").subscribe((apiResponse) => {
3493
+ this.isProcessing = false;
3494
+ if (apiResponse.success) {
3495
+ this.messageService.toast(`Setting ${setting.sName} Updated`);
3496
+ this.loadSettings();
3497
+ }
3498
+ else {
3499
+ this.messageService.toast("Error: " + apiResponse.message);
3500
+ }
3501
+ });
3502
+ }
3503
+ ;
3504
+ addSetting() {
3505
+ // const dialogRef = this.dialog.open(addRoleDialog, {
3506
+ // width: "1100px",
3507
+ // data: "",
3508
+ // });
3509
+ // dialogRef.afterClosed().subscribe((result) => {
3510
+ // if (result == "success") {
3511
+ // this.loadRoles();
3512
+ // }
3513
+ // });
3514
+ this.messageService.toast("Feature not Available");
3515
+ }
3516
+ }
3517
+ 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 });
3518
+ 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" }] });
3519
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SettingsComponent, decorators: [{
3520
+ type: Component,
3521
+ 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"] }]
3522
+ }], ctorParameters: function () { return [{ type: DataServiceLib }, { type: MessageService }]; } });
3523
+
3524
+ class LogsComponent {
3525
+ constructor(authService, dataService) {
3526
+ this.authService = authService;
3527
+ this.dataService = dataService;
3528
+ this.isProcessing = false;
3529
+ this.displayedColumns = ["dateLogged", "userName", "fullName", "source", "details"];
3530
+ }
3531
+ ngOnInit() {
3532
+ this.authService.isAuthorised(this.dataService.capLogs.name);
3533
+ this.loadLogs();
3534
+ }
3535
+ loadLogs() {
3536
+ this.dataService.GetLog("all", "").subscribe((apiResponse) => {
3537
+ this.logs = new MatTableDataSource(apiResponse);
3538
+ this.logs.paginator = this.logsPaginator;
3539
+ });
3540
+ }
3541
+ }
3542
+ 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 });
3543
+ 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" }] });
3544
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LogsComponent, decorators: [{
3545
+ type: Component,
3546
+ 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"] }]
3547
+ }], ctorParameters: function () { return [{ type: AuthService }, { type: DataServiceLib }]; }, propDecorators: { logsPaginator: [{
3548
+ type: ViewChild,
3549
+ args: ["logsPaginator"]
3550
+ }] } });
3551
+
3552
+ class UsersComponent {
3553
+ constructor(httpService, router, authService, dataService, dialog, messageService) {
3554
+ this.httpService = httpService;
3555
+ this.router = router;
3556
+ this.authService = authService;
3557
+ this.dataService = dataService;
3558
+ this.dialog = dialog;
3559
+ this.messageService = messageService;
3560
+ this.isProcessing = false;
3561
+ this._filterText = "";
3562
+ this.displayedColumns = ["userName", "fullName", "roleName", "locked", "dateCreated", "Action"];
3563
+ }
3564
+ ngOnInit() {
3565
+ this.authService.isAuthorised(this.dataService.capUsers.name);
3566
+ this.UpdateData();
3567
+ }
3568
+ UpdateData() {
3569
+ this.dataService.GetUser().subscribe((apiResponse) => {
3570
+ console.log(apiResponse);
3571
+ this.usersRaw = apiResponse;
3572
+ this.users = new MatTableDataSource(apiResponse);
3573
+ this.users.paginator = this.usersPaginator;
3574
+ this.applyFilter(this._filterText);
3575
+ }, (error) => {
3576
+ this.isProcessing = false;
3577
+ this.messageService.toast(this.httpService.Error(error));
3578
+ });
3579
+ }
3580
+ applyFilter(filterValue) {
3581
+ this.users.filter = filterValue.trim().toLowerCase();
3582
+ }
3583
+ createAccount() {
3584
+ this.router.navigate(["home/admin/create-account"]);
3585
+ }
3586
+ viewProfile(user) {
3587
+ this.dataService.tmpProfileuserName = user.userName;
3588
+ this.router.navigate(["home/user/profile"]);
3589
+ }
3590
+ lock(u) {
3591
+ let login = { userName: u.userName, password: "Abcdef@123" };
3592
+ this.dataService.LockUser(login).subscribe((apiResponse) => {
3593
+ if (apiResponse.success) {
3594
+ this.messageService.toast("User Locked");
3595
+ this.UpdateData();
3596
+ }
3597
+ else {
3598
+ this.messageService.toast("Error: " + apiResponse);
3599
+ }
3600
+ });
3601
+ }
3602
+ unlock(u) {
3603
+ let login = { userName: u.userName, password: "Abcdef@123" };
3604
+ this.dataService.UnlockUser(login).subscribe((apiResponse) => {
3605
+ if (apiResponse.success) {
3606
+ this.messageService.toast("User Unlocked");
3607
+ this.UpdateData();
3608
+ }
3609
+ else {
3610
+ this.messageService.toast("Error: " + apiResponse);
3611
+ }
3612
+ });
3613
+ }
3614
+ recover(u) {
3615
+ this.dataService.SelfReset(u).subscribe((apiResponse) => {
3616
+ if (apiResponse.message == "success") {
3617
+ this.messageService.toast("The password has been sent on email");
3618
+ }
3619
+ else {
3620
+ this.messageService.toast("Error: " + apiResponse.message);
3621
+ }
3622
+ });
3623
+ }
3624
+ deleteUser(user) {
3625
+ this.messageService.confirm(`Delete ${user.userName} ?`).subscribe((result) => {
3626
+ if (result == "yes") {
3627
+ this.isProcessing = true;
3628
+ this.dataService.DeleteUser(user).subscribe((apiResponse) => {
3629
+ this.isProcessing = false;
3630
+ if (apiResponse.message == "success") {
3631
+ this.messageService.toast("User Deleted");
3632
+ this.UpdateData();
3633
+ }
3634
+ else {
3635
+ this.messageService.toast("Error: " + apiResponse.message);
3636
+ }
3637
+ }, (error) => {
3638
+ this.messageService.toast("Connection failed ");
3639
+ this.isProcessing = false;
3640
+ });
3641
+ }
3642
+ });
3643
+ }
3644
+ }
3645
+ 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 });
3646
+ 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" }] });
3647
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: UsersComponent, decorators: [{
3648
+ type: Component,
3649
+ 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"] }]
3650
+ }], ctorParameters: function () { return [{ type: HttpService }, { type: i1$3.Router }, { type: AuthService }, { type: DataServiceLib }, { type: i4.MatDialog }, { type: MessageService }]; }, propDecorators: { usersPaginator: [{
3651
+ type: ViewChild,
3652
+ args: ["usersPaginator"]
3653
+ }] } });
3654
+
3655
+ class addRoleDialog {
3656
+ constructor(messageService, dataService, authService, dialogRef, data) {
3657
+ this.messageService = messageService;
3658
+ this.dataService = dataService;
3659
+ this.authService = authService;
3660
+ this.dialogRef = dialogRef;
3661
+ this.data = data;
3662
+ this.role = new Role();
3663
+ }
3664
+ ngOnInit() {
3665
+ this.capItems = this.data;
3666
+ }
3667
+ submit() {
3668
+ if (this.role.roleName == "New Role" || this.role.roleName == "") {
3669
+ this.messageService.toast("Please enter Role Name");
3670
+ return;
3671
+ }
3672
+ this.isProcessing = true;
3673
+ this.dataService.PostRole(this.role, "add").subscribe((apiResponse) => {
3674
+ this.isProcessing = false;
3675
+ if (apiResponse.success) {
3676
+ this.messageService.toast("Role Added");
3677
+ this.dialogRef.close("success");
3678
+ }
3679
+ else {
3680
+ this.messageService.toast("Error: " + apiResponse.message);
3681
+ }
3682
+ }, error => {
3683
+ this.messageService.toast("Connection failed");
3684
+ this.isProcessing = false;
3685
+ });
3686
+ }
3687
+ ;
3688
+ }
3689
+ 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 });
3690
+ 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"] }] });
3691
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: addRoleDialog, decorators: [{
3692
+ type: Component,
3693
+ 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"] }]
3694
+ }], ctorParameters: function () {
3695
+ return [{ type: MessageService }, { type: DataServiceLib }, { type: AuthService }, { type: i4.MatDialogRef }, { type: undefined, decorators: [{
3696
+ type: Inject,
3697
+ args: [MAT_DIALOG_DATA]
3698
+ }] }];
3699
+ } });
3700
+ ;
3701
+
3702
+ class RolesComponent {
3703
+ constructor(httpService, router, authService, dataService, dialog, messageService) {
3704
+ this.httpService = httpService;
3705
+ this.router = router;
3706
+ this.authService = authService;
3707
+ this.dataService = dataService;
3708
+ this.dialog = dialog;
3709
+ this.messageService = messageService;
3710
+ this.isProcessing = false;
3711
+ this.appConfig = new AppConfig();
3712
+ }
3713
+ ngOnInit() {
3714
+ this.authService.isAuthorised(this.dataService.capRoles.name);
3715
+ this.loadRoles();
3716
+ this.dataService.appConfigObserv.subscribe(x => this.appConfig = x);
3717
+ }
3718
+ loadRoles() {
3719
+ this.dataService.GetRole("all", "").subscribe((apiResponse) => {
3720
+ this.roles = apiResponse;
3721
+ });
3722
+ }
3723
+ refresh() {
3724
+ this.loadRoles();
3725
+ }
3726
+ addRole() {
3727
+ const dialogRef = this.dialog.open(addRoleDialog, {
3728
+ width: "1100px",
3729
+ data: this.appConfig.capItems,
3730
+ });
3731
+ dialogRef.afterClosed().subscribe((result) => {
3732
+ if (result == "success") {
3733
+ this.loadRoles();
3734
+ }
3735
+ });
3736
+ }
3737
+ updateRole(role) {
3738
+ this.messageService.confirm(`UPDATE ${role.roleName} ?`).subscribe((result) => {
3739
+ if (result == "yes") {
3740
+ this.dataService.PostRole(role, "edit").subscribe((apiResponse) => {
3741
+ if (apiResponse.success) {
3742
+ this.messageService.toast("Role Updated");
3743
+ this.loadRoles();
3744
+ }
3745
+ else {
3746
+ this.messageService.toast("Error: " + apiResponse);
3747
+ }
3748
+ });
3749
+ }
3750
+ });
3751
+ }
3752
+ ;
3753
+ deleteRole(role) {
3754
+ this.messageService.confirm(`DELETE ${role.roleName} ?`).subscribe((result) => {
3755
+ if (result == "yes") {
3756
+ this.dataService.PostRole(role, "delete").subscribe((apiResponse) => {
3757
+ if (apiResponse.success) {
3758
+ this.messageService.toast("Role Deleted");
3759
+ this.loadRoles();
3760
+ }
3761
+ else {
3762
+ this.messageService.toast("Error: " + apiResponse);
3763
+ }
3764
+ });
3765
+ }
3766
+ });
3767
+ }
3768
+ }
3769
+ 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 });
3770
+ 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=\"d-flex justify-content-between mb-2\">\r\n\r\n <div >\r\n <button id=\"btnNewRole\" mat-raised-button color=\"primary\" (click)=\"addRole()\">New Role</button>\r\n </div>\r\n\r\n <div class=\"d-flex justify-content-end\">\r\n <button id=\"btnRefresh\" mat-mini-fab color=\"primary\" (click)=\"refresh()\" matTooltip=\"refresh data\" matTooltipPosition=\"right\"><mat-icon class=\"refreshIcon\">refresh</mat-icon></button>\r\n </div>\r\n\r\n </div>\r\n\r\n\r\n <div class=\"row mt-2 mb-1\" *ngFor=\"let role of roles\">\r\n\r\n <mat-card class=\"mat-elevation-z8\" style=\"width:100%\">\r\n\r\n <h4>{{role.roleName}}</h4>\r\n <hr />\r\n\r\n <div class=\"tin-row\" style=\" font-size:12px;\">\r\n\r\n\r\n <div class=\"tin-row\" *ngFor=\"let capItem of appConfig.capItems\">\r\n\r\n <mat-checkbox color=\"primary\" style=\"min-width: 200px;\" [(ngModel)]=\"role[capItem.name]\">{{capItem.display}}</mat-checkbox>\r\n\r\n <div class=\"tin-row\" *ngFor=\"let capSubItem of capItem.capSubItems\">\r\n\r\n <mat-checkbox color=\"primary\" style=\"min-width: 200px;\" [(ngModel)]=\"role[capSubItem.name]\">{{capSubItem.display}}</mat-checkbox>\r\n\r\n <div class=\"tin-row\" *ngFor=\"let capSubSubItem of capSubItem.capSubItems\">\r\n\r\n <mat-checkbox color=\"primary\" style=\"min-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)=\"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"] }] });
3771
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: RolesComponent, decorators: [{
3772
+ type: Component,
3773
+ 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=\"d-flex justify-content-between mb-2\">\r\n\r\n <div >\r\n <button id=\"btnNewRole\" mat-raised-button color=\"primary\" (click)=\"addRole()\">New Role</button>\r\n </div>\r\n\r\n <div class=\"d-flex justify-content-end\">\r\n <button id=\"btnRefresh\" mat-mini-fab color=\"primary\" (click)=\"refresh()\" matTooltip=\"refresh data\" matTooltipPosition=\"right\"><mat-icon class=\"refreshIcon\">refresh</mat-icon></button>\r\n </div>\r\n\r\n </div>\r\n\r\n\r\n <div class=\"row mt-2 mb-1\" *ngFor=\"let role of roles\">\r\n\r\n <mat-card class=\"mat-elevation-z8\" style=\"width:100%\">\r\n\r\n <h4>{{role.roleName}}</h4>\r\n <hr />\r\n\r\n <div class=\"tin-row\" style=\" font-size:12px;\">\r\n\r\n\r\n <div class=\"tin-row\" *ngFor=\"let capItem of appConfig.capItems\">\r\n\r\n <mat-checkbox color=\"primary\" style=\"min-width: 200px;\" [(ngModel)]=\"role[capItem.name]\">{{capItem.display}}</mat-checkbox>\r\n\r\n <div class=\"tin-row\" *ngFor=\"let capSubItem of capItem.capSubItems\">\r\n\r\n <mat-checkbox color=\"primary\" style=\"min-width: 200px;\" [(ngModel)]=\"role[capSubItem.name]\">{{capSubItem.display}}</mat-checkbox>\r\n\r\n <div class=\"tin-row\" *ngFor=\"let capSubSubItem of capSubItem.capSubItems\">\r\n\r\n <mat-checkbox color=\"primary\" style=\"min-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)=\"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"] }]
3774
+ }], ctorParameters: function () { return [{ type: HttpService }, { type: i1$3.Router }, { type: AuthService }, { type: DataServiceLib }, { type: i4.MatDialog }, { type: MessageService }]; } });
3775
+
3776
+ class CreateAccountComponent {
3777
+ constructor(httpService, messageService, dataService, authService, router) {
3778
+ this.httpService = httpService;
3779
+ this.messageService = messageService;
3780
+ this.dataService = dataService;
3781
+ this.authService = authService;
3782
+ this.router = router;
3783
+ this.appConfig = new AppConfig();
3784
+ this.isProcessing = false;
3785
+ this.register = new Register();
3786
+ this.openProfile = true;
3787
+ this.authTypes = [
3788
+ { name: "Local Authentication", value: "local" },
3789
+ { name: "AD Authentication", value: "AD" }
3790
+ ];
3791
+ }
3792
+ ngOnInit() {
3793
+ this.appConfig = this.dataService.appConfig;
3794
+ }
3795
+ create() {
3796
+ if (this.register.authType == "") {
3797
+ this.messageService.toast("Choose Authentication Type");
3798
+ return;
3799
+ }
3800
+ this.isProcessing = true;
3801
+ this.dataService.RegisterAccount(this.register).subscribe((apiResponse) => {
3802
+ this.isProcessing = false;
3803
+ if (apiResponse.success) {
3804
+ this.messageService.toast("Account Created");
3805
+ if (this.openProfile) {
3806
+ this.viewProfile(this.register.userName);
3807
+ }
3808
+ else {
3809
+ // this.user = new User();
3810
+ this.register = new Register();
3811
+ this.confirmPassword = "";
3812
+ }
3813
+ }
3814
+ else {
3815
+ this.messageService.toast("Error: " + apiResponse.message);
3816
+ }
3817
+ }, (error) => {
3818
+ this.isProcessing = false;
3819
+ this.messageService.toast(this.httpService.Error(error));
3820
+ });
3821
+ }
3822
+ viewProfile(userName) {
3823
+ this.dataService.tmpProfileuserName = userName;
3824
+ this.router.navigate(["home/user/profile"]);
3825
+ }
3826
+ }
3827
+ 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 });
3828
+ 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"] }] });
3829
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CreateAccountComponent, decorators: [{
3830
+ type: Component,
3831
+ 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" }]
3832
+ }], ctorParameters: function () { return [{ type: HttpService }, { type: MessageService }, { type: DataServiceLib }, { type: AuthService }, { type: i1$3.Router }]; }, propDecorators: { appConfig: [{
3833
+ type: Input
3834
+ }] } });
3835
+
3836
+ class SpaAdminModule {
3837
+ }
3838
+ SpaAdminModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SpaAdminModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3839
+ SpaAdminModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: SpaAdminModule, declarations: [UsersComponent,
3840
+ RolesComponent,
3841
+ addRoleDialog,
3842
+ CreateAccountComponent,
3843
+ LogsComponent,
3844
+ SettingsComponent], imports: [i2.ReactiveFormsModule, CommonModule,
3845
+ FormsModule,
3846
+ ReactiveFormsModule,
3847
+ // SpaMatModule,
3848
+ TinSpaModule], exports: [CommonModule,
3849
+ FormsModule,
3850
+ // SpaMatModule,
3851
+ UsersComponent,
3852
+ RolesComponent,
3853
+ addRoleDialog,
3854
+ CreateAccountComponent,
3855
+ LogsComponent,
3856
+ SettingsComponent] });
3857
+ SpaAdminModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SpaAdminModule, imports: [ReactiveFormsModule.withConfig({ warnOnNgModelWithFormControl: "never" }),
3858
+ CommonModule,
3859
+ FormsModule,
3860
+ ReactiveFormsModule,
3861
+ // SpaMatModule,
3862
+ TinSpaModule, CommonModule,
3863
+ FormsModule] });
3864
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SpaAdminModule, decorators: [{
3865
+ type: NgModule,
3866
+ args: [{
3867
+ declarations: [
3868
+ UsersComponent,
3869
+ RolesComponent,
3870
+ addRoleDialog,
3871
+ CreateAccountComponent,
3872
+ LogsComponent,
3873
+ SettingsComponent
3874
+ ],
3875
+ imports: [
3876
+ ReactiveFormsModule.withConfig({ warnOnNgModelWithFormControl: "never" }),
3877
+ CommonModule,
3878
+ FormsModule,
3879
+ ReactiveFormsModule,
3880
+ // SpaMatModule,
3881
+ TinSpaModule
3882
+ ],
3883
+ exports: [
3884
+ CommonModule,
3885
+ FormsModule,
3886
+ // SpaMatModule,
3887
+ UsersComponent,
3888
+ RolesComponent,
3889
+ addRoleDialog,
3890
+ CreateAccountComponent,
3891
+ LogsComponent,
3892
+ SettingsComponent
3893
+ ],
3894
+ }]
3895
+ }] });
3896
+
3897
+ const routes$2 = [
3898
+ { path: "signup", component: SignupComponent },
3899
+ { path: 'recover-account', component: RecoverAccountComponent },
3900
+ { path: 'login', component: LoginComponent },
3901
+ { path: '', redirectTo: 'login', pathMatch: 'full' },
3902
+ { path: '**', redirectTo: '' },
3903
+ ];
3904
+ class IndexRoutingModule {
3905
+ }
3906
+ IndexRoutingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: IndexRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3907
+ IndexRoutingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: IndexRoutingModule, imports: [i1$3.RouterModule], exports: [RouterModule] });
3908
+ IndexRoutingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: IndexRoutingModule, imports: [RouterModule.forChild(routes$2), RouterModule] });
3909
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: IndexRoutingModule, decorators: [{
3910
+ type: NgModule,
3911
+ args: [{
3912
+ imports: [RouterModule.forChild(routes$2)],
3913
+ exports: [RouterModule]
3914
+ }]
3915
+ }] });
3916
+
3917
+ class IndexModule {
3918
+ }
3919
+ IndexModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: IndexModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3920
+ IndexModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: IndexModule, imports: [CommonModule,
3921
+ IndexRoutingModule,
3922
+ SpaIndexModule] });
3923
+ IndexModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: IndexModule, imports: [CommonModule,
3924
+ IndexRoutingModule,
3925
+ SpaIndexModule] });
3926
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: IndexModule, decorators: [{
3927
+ type: NgModule,
3928
+ args: [{
3929
+ declarations: [],
3930
+ imports: [
3931
+ CommonModule,
3932
+ IndexRoutingModule,
3933
+ SpaIndexModule
3934
+ ]
3935
+ }]
3936
+ }] });
3937
+
3938
+ const routes$1 = [
3939
+ { path: "users", component: UsersComponent },
3940
+ { path: "roles", component: RolesComponent },
3941
+ { path: "create-account", component: CreateAccountComponent },
3942
+ { path: "logs", component: LogsComponent },
3943
+ { path: "settings", component: SettingsComponent },
3944
+ ];
3945
+ class AdminRoutingModule {
3946
+ }
3947
+ AdminRoutingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AdminRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3948
+ AdminRoutingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: AdminRoutingModule, imports: [i1$3.RouterModule], exports: [RouterModule] });
3949
+ AdminRoutingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AdminRoutingModule, imports: [RouterModule.forChild(routes$1), RouterModule] });
3950
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AdminRoutingModule, decorators: [{
3951
+ type: NgModule,
3952
+ args: [{
3953
+ imports: [RouterModule.forChild(routes$1)],
3954
+ exports: [RouterModule]
3955
+ }]
3956
+ }] });
3957
+
3958
+ class AdminModule {
3959
+ }
3960
+ AdminModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AdminModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3961
+ AdminModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: AdminModule, imports: [CommonModule,
3962
+ AdminRoutingModule,
3963
+ SpaAdminModule] });
3964
+ AdminModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AdminModule, imports: [CommonModule,
3965
+ AdminRoutingModule,
3966
+ SpaAdminModule] });
3967
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AdminModule, decorators: [{
3968
+ type: NgModule,
3969
+ args: [{
3970
+ declarations: [],
3971
+ imports: [
3972
+ CommonModule,
3973
+ AdminRoutingModule,
3974
+ SpaAdminModule
3975
+ ]
3976
+ }]
3977
+ }] });
3978
+
3979
+ const routes = [
3980
+ { path: "change-password", component: ChangePasswordComponent },
3981
+ { path: "profile", component: ProfileComponent },
3982
+ ];
3983
+ class UserRoutingModule {
3984
+ }
3985
+ UserRoutingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: UserRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3986
+ UserRoutingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: UserRoutingModule, imports: [i1$3.RouterModule], exports: [RouterModule] });
3987
+ UserRoutingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: UserRoutingModule, imports: [RouterModule.forChild(routes), RouterModule] });
3988
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: UserRoutingModule, decorators: [{
3989
+ type: NgModule,
3990
+ args: [{
3991
+ imports: [RouterModule.forChild(routes)],
3992
+ exports: [RouterModule]
3993
+ }]
3994
+ }] });
3995
+
3996
+ class UserModule {
3997
+ }
3998
+ UserModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: UserModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3999
+ UserModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: UserModule, imports: [CommonModule,
4000
+ UserRoutingModule,
4001
+ SpaUserModule] });
4002
+ UserModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: UserModule, imports: [CommonModule,
4003
+ UserRoutingModule,
4004
+ SpaUserModule] });
4005
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: UserModule, decorators: [{
4006
+ type: NgModule,
4007
+ args: [{
4008
+ declarations: [],
4009
+ imports: [
4010
+ CommonModule,
4011
+ UserRoutingModule,
4012
+ SpaUserModule
4013
+ ]
4014
+ }]
4015
+ }] });
4016
+
4017
+ /*
4018
+ * Public API Surface of tin-spa
4019
+ */
4020
+
4021
+ /**
4022
+ * Generated bundle index. Do not edit.
4023
+ */
4024
+
4025
+ 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 };
4026
+ //# sourceMappingURL=tin-spa.mjs.map