tin-spa 2.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (241) hide show
  1. package/README.md +2 -2
  2. package/{esm2015/lib/classes/Classes.js → esm2020/lib/classes/Classes.mjs} +15 -55
  3. package/esm2020/lib/classes/TinCore.mjs +148 -0
  4. package/esm2020/lib/components/activity/activity.component.mjs +24 -0
  5. package/esm2020/lib/components/attach/attach.component.mjs +105 -0
  6. package/esm2020/lib/components/change-password/change-password.component.mjs +92 -0
  7. package/esm2020/lib/components/check/check.component.mjs +56 -0
  8. package/esm2020/lib/components/chips/chips.component.mjs +58 -0
  9. package/esm2020/lib/components/create-account/create-account.component.mjs +72 -0
  10. package/esm2020/lib/components/date/date.component.mjs +64 -0
  11. package/esm2020/lib/components/datetime/datetime.component.mjs +39 -0
  12. package/esm2020/lib/components/filter/filter.component.mjs +46 -0
  13. package/esm2020/lib/components/form/form.component.mjs +63 -0
  14. package/esm2020/lib/components/label/label.component.mjs +25 -0
  15. package/esm2020/lib/components/loader/loader.component.mjs +24 -0
  16. package/esm2020/lib/components/login/login.component.mjs +113 -0
  17. package/esm2020/lib/components/logs/logs.component.mjs +37 -0
  18. package/esm2020/lib/components/message/messageDialog.component.mjs +32 -0
  19. package/esm2020/lib/components/money/currency-input-mask.directive.mjs +185 -0
  20. package/esm2020/lib/components/money/currency-input-mask.module.mjs +28 -0
  21. package/esm2020/lib/components/money/money.component.mjs +64 -0
  22. package/esm2020/lib/components/nav-menu/nav-menu.component.mjs +49 -0
  23. package/esm2020/lib/components/number/number.component.mjs +86 -0
  24. package/esm2020/lib/components/option/option.component.mjs +59 -0
  25. package/esm2020/lib/components/profile/profile.component.mjs +93 -0
  26. package/esm2020/lib/components/recover-account/recover-account.component.mjs +46 -0
  27. package/esm2020/lib/components/roles/addRoleDialog.component.mjs +61 -0
  28. package/esm2020/lib/components/roles/roles.component.mjs +91 -0
  29. package/esm2020/lib/components/select/select.component.mjs +71 -0
  30. package/esm2020/lib/components/settings/settings.component.mjs +63 -0
  31. package/esm2020/lib/components/signup/signup.component.mjs +50 -0
  32. package/esm2020/lib/components/steps/steps.component.mjs +90 -0
  33. package/esm2020/lib/components/table/detailsDialog.component.mjs +149 -0
  34. package/esm2020/lib/components/table/table.component.mjs +341 -0
  35. package/esm2020/lib/components/text/text.component.mjs +166 -0
  36. package/esm2020/lib/components/tiles/tiles.component.mjs +41 -0
  37. package/esm2020/lib/components/tin-spa.component.mjs +19 -0
  38. package/esm2020/lib/components/users/users.component.mjs +119 -0
  39. package/esm2020/lib/modules/admin/admin-routing.module.mjs +29 -0
  40. package/esm2020/lib/modules/admin/admin.module.mjs +26 -0
  41. package/esm2020/lib/modules/index/index-routing.module.mjs +27 -0
  42. package/esm2020/lib/modules/index/index.module.mjs +26 -0
  43. package/esm2020/lib/modules/spa-admin.module.mjs +73 -0
  44. package/esm2020/lib/modules/spa-index.module.mjs +52 -0
  45. package/esm2020/lib/modules/spa-mat.module.mjs +67 -0
  46. package/esm2020/lib/modules/spa-user.module.mjs +49 -0
  47. package/esm2020/lib/modules/user/user-routing.module.mjs +23 -0
  48. package/esm2020/lib/modules/user/user.module.mjs +26 -0
  49. package/esm2020/lib/pipes/camelToWords.pipe.mjs +23 -0
  50. package/esm2020/lib/services/auth.service.mjs +142 -0
  51. package/esm2020/lib/services/data.service.mjs +125 -0
  52. package/esm2020/lib/services/export.service.mjs +16 -0
  53. package/esm2020/lib/services/http.service.mjs +79 -0
  54. package/esm2020/lib/services/loader-interceptor.service.mjs +77 -0
  55. package/esm2020/lib/services/loader.service.mjs +17 -0
  56. package/esm2020/lib/services/log.service.mjs +77 -0
  57. package/esm2020/lib/services/message.service.mjs +52 -0
  58. package/esm2020/lib/services/storage.service.mjs +34 -0
  59. package/esm2020/lib/services/tin-spa.service.mjs +14 -0
  60. package/esm2020/lib/tin-spa.module.mjs +114 -0
  61. package/esm2020/public-api.mjs +62 -0
  62. package/esm2020/tin-spa.mjs +5 -0
  63. package/fesm2015/tin-spa.mjs +3846 -0
  64. package/fesm2015/tin-spa.mjs.map +1 -0
  65. package/fesm2020/tin-spa.mjs +3829 -0
  66. package/fesm2020/tin-spa.mjs.map +1 -0
  67. package/index.d.ts +5 -0
  68. package/lib/classes/Classes.d.ts +58 -63
  69. package/lib/classes/TinCore.d.ts +1 -0
  70. package/lib/components/activity/activity.component.d.ts +3 -0
  71. package/lib/components/attach/attach.component.d.ts +4 -1
  72. package/lib/components/change-password/change-password.component.d.ts +3 -0
  73. package/lib/components/check/check.component.d.ts +3 -0
  74. package/lib/components/chips/chips.component.d.ts +3 -0
  75. package/lib/components/create-account/create-account.component.d.ts +3 -0
  76. package/lib/components/date/date.component.d.ts +14 -6
  77. package/lib/components/datetime/datetime.component.d.ts +3 -0
  78. package/lib/components/filter/filter.component.d.ts +4 -0
  79. package/lib/components/form/form.component.d.ts +16 -0
  80. package/lib/components/label/label.component.d.ts +3 -0
  81. package/lib/components/loader/loader.component.d.ts +3 -0
  82. package/lib/components/login/login.component.d.ts +6 -0
  83. package/lib/components/logs/logs.component.d.ts +3 -0
  84. package/lib/components/message/messageDialog.component.d.ts +3 -0
  85. package/lib/components/money/currency-input-mask.directive.d.ts +41 -0
  86. package/lib/components/money/currency-input-mask.module.d.ts +9 -0
  87. package/lib/components/money/money.component.d.ts +9 -1
  88. package/lib/components/nav-menu/nav-menu.component.d.ts +3 -0
  89. package/lib/components/number/number.component.d.ts +29 -0
  90. package/lib/components/option/option.component.d.ts +3 -0
  91. package/lib/components/profile/profile.component.d.ts +6 -2
  92. package/lib/components/recover-account/recover-account.component.d.ts +3 -0
  93. package/lib/components/roles/addRoleDialog.component.d.ts +3 -0
  94. package/lib/components/roles/roles.component.d.ts +3 -0
  95. package/lib/components/select/select.component.d.ts +5 -1
  96. package/lib/components/settings/settings.component.d.ts +3 -0
  97. package/lib/components/signup/signup.component.d.ts +3 -0
  98. package/lib/components/steps/steps.component.d.ts +3 -0
  99. package/lib/components/table/detailsDialog.component.d.ts +28 -0
  100. package/lib/components/table/table.component.d.ts +57 -17
  101. package/lib/components/text/text.component.d.ts +13 -9
  102. package/lib/components/tiles/tiles.component.d.ts +3 -0
  103. package/lib/components/tin-spa.component.d.ts +4 -4
  104. package/lib/components/users/users.component.d.ts +4 -0
  105. package/lib/modules/admin/admin-routing.module.d.ts +7 -0
  106. package/lib/modules/admin/admin.module.d.ts +9 -0
  107. package/lib/modules/index/index-routing.module.d.ts +7 -0
  108. package/lib/modules/index/index.module.d.ts +9 -0
  109. package/lib/modules/spa-admin.module.d.ts +13 -0
  110. package/lib/modules/spa-index.module.d.ts +10 -0
  111. package/lib/modules/spa-mat.module.d.ts +31 -0
  112. package/lib/modules/spa-user.module.d.ts +9 -0
  113. package/lib/modules/user/user-routing.module.d.ts +7 -0
  114. package/lib/modules/user/user.module.d.ts +9 -0
  115. package/lib/pipes/camelToWords.pipe.d.ts +7 -0
  116. package/lib/services/auth.service.d.ts +3 -0
  117. package/lib/services/data.service.d.ts +5 -1
  118. package/lib/services/export.service.d.ts +3 -4
  119. package/lib/services/http.service.d.ts +3 -0
  120. package/lib/services/loader-interceptor.service.d.ts +3 -0
  121. package/lib/services/loader.service.d.ts +3 -0
  122. package/lib/services/log.service.d.ts +3 -0
  123. package/lib/services/message.service.d.ts +3 -0
  124. package/lib/services/storage.service.d.ts +3 -0
  125. package/lib/services/tin-spa.service.d.ts +3 -0
  126. package/lib/tin-spa.module.d.ts +30 -0
  127. package/package.json +24 -23
  128. package/public-api.d.ts +7 -2
  129. package/bundles/tin-spa.umd.js +0 -3672
  130. package/bundles/tin-spa.umd.js.map +0 -1
  131. package/bundles/tin-spa.umd.min.js +0 -16
  132. package/bundles/tin-spa.umd.min.js.map +0 -1
  133. package/esm2015/lib/classes/TinCore.js +0 -139
  134. package/esm2015/lib/components/activity/activity.component.js +0 -26
  135. package/esm2015/lib/components/attach/attach.component.js +0 -107
  136. package/esm2015/lib/components/change-password/change-password.component.js +0 -102
  137. package/esm2015/lib/components/check/check.component.js +0 -63
  138. package/esm2015/lib/components/chips/chips.component.js +0 -66
  139. package/esm2015/lib/components/create-account/create-account.component.js +0 -78
  140. package/esm2015/lib/components/date/date.component.js +0 -45
  141. package/esm2015/lib/components/datetime/datetime.component.js +0 -44
  142. package/esm2015/lib/components/filter/filter.component.js +0 -40
  143. package/esm2015/lib/components/label/label.component.js +0 -29
  144. package/esm2015/lib/components/loader/loader.component.js +0 -29
  145. package/esm2015/lib/components/login/login.component.js +0 -114
  146. package/esm2015/lib/components/logs/logs.component.js +0 -39
  147. package/esm2015/lib/components/message/messageDialog.component.js +0 -31
  148. package/esm2015/lib/components/money/money.component.js +0 -52
  149. package/esm2015/lib/components/nav-menu/nav-menu.component.js +0 -51
  150. package/esm2015/lib/components/option/option.component.js +0 -63
  151. package/esm2015/lib/components/profile/profile.component.js +0 -98
  152. package/esm2015/lib/components/recover-account/recover-account.component.js +0 -53
  153. package/esm2015/lib/components/roles/addRoleDialog.component.js +0 -61
  154. package/esm2015/lib/components/roles/roles.component.js +0 -94
  155. package/esm2015/lib/components/select/select.component.js +0 -77
  156. package/esm2015/lib/components/settings/settings.component.js +0 -63
  157. package/esm2015/lib/components/signup/signup.component.js +0 -57
  158. package/esm2015/lib/components/steps/steps.component.js +0 -93
  159. package/esm2015/lib/components/table/table.component.js +0 -107
  160. package/esm2015/lib/components/text/text.component.js +0 -165
  161. package/esm2015/lib/components/tiles/tiles.component.js +0 -41
  162. package/esm2015/lib/components/timeout/timeout.component.js +0 -90
  163. package/esm2015/lib/components/tin-spa.component.js +0 -19
  164. package/esm2015/lib/components/users/users.component.js +0 -120
  165. package/esm2015/lib/dnd.directive.js +0 -51
  166. package/esm2015/lib/modules/spa-admin.module.js +0 -50
  167. package/esm2015/lib/modules/spa-index.module.js +0 -35
  168. package/esm2015/lib/modules/spa-mat.module.js +0 -53
  169. package/esm2015/lib/modules/spa-user.module.js +0 -33
  170. package/esm2015/lib/services/auth.service.js +0 -155
  171. package/esm2015/lib/services/data.service.js +0 -115
  172. package/esm2015/lib/services/export.service.js +0 -29
  173. package/esm2015/lib/services/http.service.js +0 -84
  174. package/esm2015/lib/services/loader-interceptor.service.js +0 -83
  175. package/esm2015/lib/services/loader.service.js +0 -17
  176. package/esm2015/lib/services/log.service.js +0 -76
  177. package/esm2015/lib/services/message.service.js +0 -58
  178. package/esm2015/lib/services/storage.service.js +0 -42
  179. package/esm2015/lib/services/tin-spa.service.js +0 -14
  180. package/esm2015/lib/tin-spa.module.js +0 -91
  181. package/esm2015/public-api.js +0 -56
  182. package/esm2015/tin-spa.js +0 -8
  183. package/esm5/lib/classes/Classes.js +0 -313
  184. package/esm5/lib/classes/TinCore.js +0 -166
  185. package/esm5/lib/components/activity/activity.component.js +0 -27
  186. package/esm5/lib/components/attach/attach.component.js +0 -119
  187. package/esm5/lib/components/change-password/change-password.component.js +0 -104
  188. package/esm5/lib/components/check/check.component.js +0 -64
  189. package/esm5/lib/components/chips/chips.component.js +0 -68
  190. package/esm5/lib/components/create-account/create-account.component.js +0 -80
  191. package/esm5/lib/components/date/date.component.js +0 -46
  192. package/esm5/lib/components/datetime/datetime.component.js +0 -45
  193. package/esm5/lib/components/filter/filter.component.js +0 -41
  194. package/esm5/lib/components/label/label.component.js +0 -30
  195. package/esm5/lib/components/loader/loader.component.js +0 -31
  196. package/esm5/lib/components/login/login.component.js +0 -117
  197. package/esm5/lib/components/logs/logs.component.js +0 -41
  198. package/esm5/lib/components/message/messageDialog.component.js +0 -32
  199. package/esm5/lib/components/money/money.component.js +0 -53
  200. package/esm5/lib/components/nav-menu/nav-menu.component.js +0 -53
  201. package/esm5/lib/components/option/option.component.js +0 -64
  202. package/esm5/lib/components/profile/profile.component.js +0 -102
  203. package/esm5/lib/components/recover-account/recover-account.component.js +0 -55
  204. package/esm5/lib/components/roles/addRoleDialog.component.js +0 -63
  205. package/esm5/lib/components/roles/roles.component.js +0 -100
  206. package/esm5/lib/components/select/select.component.js +0 -79
  207. package/esm5/lib/components/settings/settings.component.js +0 -66
  208. package/esm5/lib/components/signup/signup.component.js +0 -59
  209. package/esm5/lib/components/steps/steps.component.js +0 -105
  210. package/esm5/lib/components/table/table.component.js +0 -109
  211. package/esm5/lib/components/text/text.component.js +0 -168
  212. package/esm5/lib/components/tiles/tiles.component.js +0 -42
  213. package/esm5/lib/components/timeout/timeout.component.js +0 -92
  214. package/esm5/lib/components/tin-spa.component.js +0 -17
  215. package/esm5/lib/components/users/users.component.js +0 -126
  216. package/esm5/lib/dnd.directive.js +0 -52
  217. package/esm5/lib/modules/spa-admin.module.js +0 -53
  218. package/esm5/lib/modules/spa-index.module.js +0 -38
  219. package/esm5/lib/modules/spa-mat.module.js +0 -56
  220. package/esm5/lib/modules/spa-user.module.js +0 -36
  221. package/esm5/lib/services/auth.service.js +0 -157
  222. package/esm5/lib/services/data.service.js +0 -116
  223. package/esm5/lib/services/export.service.js +0 -30
  224. package/esm5/lib/services/http.service.js +0 -85
  225. package/esm5/lib/services/loader-interceptor.service.js +0 -85
  226. package/esm5/lib/services/loader.service.js +0 -18
  227. package/esm5/lib/services/log.service.js +0 -112
  228. package/esm5/lib/services/message.service.js +0 -59
  229. package/esm5/lib/services/storage.service.js +0 -74
  230. package/esm5/lib/services/tin-spa.service.js +0 -16
  231. package/esm5/lib/tin-spa.module.js +0 -94
  232. package/esm5/public-api.js +0 -56
  233. package/esm5/tin-spa.js +0 -8
  234. package/fesm2015/tin-spa.js +0 -3184
  235. package/fesm2015/tin-spa.js.map +0 -1
  236. package/fesm5/tin-spa.js +0 -3422
  237. package/fesm5/tin-spa.js.map +0 -1
  238. package/lib/components/timeout/timeout.component.d.ts +0 -21
  239. package/lib/dnd.directive.d.ts +0 -8
  240. package/tin-spa.d.ts +0 -7
  241. package/tin-spa.metadata.json +0 -1
@@ -1,3184 +0,0 @@
1
- import { __decorate, __awaiter, __param } from 'tslib';
2
- import { ɵɵdefineInjectable, Injectable, Inject, Component, ɵɵinject, Input, NgModule, EventEmitter, Output, ViewChild, HostBinding, HostListener, Directive } from '@angular/core';
3
- import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar';
4
- import { MatDialogRef, MAT_DIALOG_DATA, MatDialog, MatDialogModule, MAT_DIALOG_DEFAULT_OPTIONS } from '@angular/material/dialog';
5
- import { of, BehaviorSubject, Observable } from 'rxjs';
6
- import { mergeMap, startWith, map } from 'rxjs/operators';
7
- import { saveAs } from 'file-saver';
8
- import { utils, write } from 'xlsx';
9
- import { Router, ActivatedRoute } from '@angular/router';
10
- import { HttpHeaders, HttpClient, HttpResponse, HTTP_INTERCEPTORS } from '@angular/common/http';
11
- import { CommonModule, LocationStrategy, HashLocationStrategy, Location } from '@angular/common';
12
- import { MatAutocompleteModule } from '@angular/material/autocomplete';
13
- import { MatBadgeModule } from '@angular/material/badge';
14
- import { MatButtonModule } from '@angular/material/button';
15
- import { MatCardModule } from '@angular/material/card';
16
- import { MatCheckboxModule } from '@angular/material/checkbox';
17
- import { MatChipsModule } from '@angular/material/chips';
18
- import { MatNativeDateModule, MAT_DATE_LOCALE } from '@angular/material/core';
19
- import { MatDatepickerModule } from '@angular/material/datepicker';
20
- import { MatFormFieldModule } from '@angular/material/form-field';
21
- import { MatIconModule } from '@angular/material/icon';
22
- import { MatInputModule } from '@angular/material/input';
23
- import { MatListModule } from '@angular/material/list';
24
- import { MatMenuModule } from '@angular/material/menu';
25
- import { MatPaginatorModule } from '@angular/material/paginator';
26
- import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
27
- import { MatRadioModule } from '@angular/material/radio';
28
- import { MatSelectModule } from '@angular/material/select';
29
- import { MatSliderModule } from '@angular/material/slider';
30
- import { MatSortModule } from '@angular/material/sort';
31
- import { MatStepperModule } from '@angular/material/stepper';
32
- import { MatTableModule, MatTableDataSource } from '@angular/material/table';
33
- import { MatTabsModule } from '@angular/material/tabs';
34
- import { MatTooltipModule } from '@angular/material/tooltip';
35
- import { FormsModule, ReactiveFormsModule, FormControl, Validators } from '@angular/forms';
36
- import { Keepalive, NgIdleKeepaliveModule } from '@ng-idle/keepalive';
37
- import { MomentModule } from 'angular2-moment';
38
- import { DEFAULT_INTERRUPTSOURCES, Idle } from '@ng-idle/core';
39
- import { STEPPER_GLOBAL_OPTIONS } from '@angular/cdk/stepper';
40
-
41
- let TinSpaService = class TinSpaService {
42
- constructor() { }
43
- };
44
- TinSpaService.ɵprov = ɵɵdefineInjectable({ factory: function TinSpaService_Factory() { return new TinSpaService(); }, token: TinSpaService, providedIn: "root" });
45
- TinSpaService = __decorate([
46
- Injectable({
47
- providedIn: 'root'
48
- })
49
- ], TinSpaService);
50
-
51
- let StorageService = class StorageService {
52
- constructor() { }
53
- // Store the value
54
- store(storageKey, value) {
55
- return __awaiter(this, void 0, void 0, function* () {
56
- const encryptedValue = btoa(escape(JSON.stringify(value)));
57
- // const encryptedValue = JSON.stringify(value);
58
- yield localStorage.setItem(storageKey, encryptedValue);
59
- });
60
- }
61
- // Get the value
62
- get(storageKey) {
63
- return __awaiter(this, void 0, void 0, function* () {
64
- const ret = yield localStorage.getItem(storageKey);
65
- return JSON.parse(unescape(atob(ret)));
66
- // return JSON.parse(ret);
67
- });
68
- }
69
- // Remove
70
- removeStorageItem(storageKey) {
71
- return __awaiter(this, void 0, void 0, function* () {
72
- yield localStorage.removeItem(storageKey);
73
- });
74
- }
75
- // Clear storage
76
- clear() {
77
- return __awaiter(this, void 0, void 0, function* () {
78
- yield localStorage.clear();
79
- });
80
- }
81
- };
82
- StorageService.ɵprov = ɵɵdefineInjectable({ factory: function StorageService_Factory() { return new StorageService(); }, token: StorageService, providedIn: "root" });
83
- StorageService = __decorate([
84
- Injectable({
85
- providedIn: 'root'
86
- })
87
- ], StorageService);
88
-
89
- let messageDialog = class messageDialog {
90
- constructor(dialogRef, data) {
91
- this.dialogRef = dialogRef;
92
- this.data = data;
93
- }
94
- ngOnInit() {
95
- this.messageType = this.data.type;
96
- this._messageSubject = this.data.subject;
97
- this._messageDetails = this.data.details;
98
- }
99
- response(resp) {
100
- this.dialogRef.close(resp);
101
- }
102
- };
103
- messageDialog.ctorParameters = () => [
104
- { type: MatDialogRef },
105
- { type: undefined, decorators: [{ type: Inject, args: [MAT_DIALOG_DATA,] }] }
106
- ];
107
- messageDialog = __decorate([
108
- Component({
109
- selector: 'lib-app-message',
110
- 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"
111
- }),
112
- __param(1, Inject(MAT_DIALOG_DATA))
113
- ], messageDialog);
114
- ;
115
-
116
- let MessageService = class MessageService {
117
- constructor(snackBar, dialog) {
118
- this.snackBar = snackBar;
119
- this.dialog = dialog;
120
- }
121
- toast(msg) {
122
- this.snackBar.open(msg, "OK", { duration: 5000 });
123
- }
124
- info(subject, details) {
125
- let type = "info";
126
- const dialogRef = this.dialog.open(messageDialog, {
127
- width: "600px",
128
- data: { type, subject, details },
129
- });
130
- }
131
- error(details) {
132
- let type = "error";
133
- let subject;
134
- const dialogRef = this.dialog.open(messageDialog, {
135
- width: "600px",
136
- data: { type, subject, details },
137
- });
138
- }
139
- confirm(msg) {
140
- let type = "confirm";
141
- let subject = "";
142
- let details = msg;
143
- const dialogRef = this.dialog.open(messageDialog, {
144
- width: "400px",
145
- data: { type, subject, details },
146
- });
147
- return dialogRef.afterClosed().pipe(mergeMap((result) => {
148
- return of(result);
149
- }));
150
- }
151
- };
152
- MessageService.ctorParameters = () => [
153
- { type: MatSnackBar },
154
- { type: MatDialog }
155
- ];
156
- MessageService.ɵprov = ɵɵdefineInjectable({ factory: function MessageService_Factory() { return new MessageService(ɵɵinject(MatSnackBar), ɵɵinject(MatDialog)); }, token: MessageService, providedIn: "root" });
157
- MessageService = __decorate([
158
- Injectable({
159
- providedIn: "root",
160
- })
161
- ], MessageService);
162
-
163
- let ExportService = class ExportService {
164
- constructor() {
165
- this.fileType = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8';
166
- this.fileExtension = '.xlsx';
167
- }
168
- exportExcel(jsonData, fileName) {
169
- const ws = utils.json_to_sheet(jsonData);
170
- const wb = { Sheets: { 'data': ws }, SheetNames: ['data'] };
171
- const excelBuffer = write(wb, { bookType: 'xlsx', type: 'array' });
172
- this.saveExcelFile(excelBuffer, fileName);
173
- }
174
- saveExcelFile(buffer, fileName) {
175
- const data = new Blob([buffer], { type: this.fileType });
176
- saveAs(data, fileName + this.fileExtension);
177
- }
178
- };
179
- ExportService.ɵprov = ɵɵdefineInjectable({ factory: function ExportService_Factory() { return new ExportService(); }, token: ExportService, providedIn: "root" });
180
- ExportService = __decorate([
181
- Injectable({
182
- providedIn: 'root'
183
- })
184
- ], ExportService);
185
-
186
- class Core {
187
- static getClone(x) {
188
- return JSON.parse(JSON.stringify(x));
189
- }
190
- static getNumber(value) {
191
- if (value == null || value == "") {
192
- return 0;
193
- }
194
- const onlyNumbers = value.replace(/[^\d.-]/g, '');
195
- return onlyNumbers;
196
- }
197
- static getFirstDayOfMonth() {
198
- const date = new Date();
199
- return new Date(date.getFullYear(), date.getMonth(), 1);
200
- }
201
- static emailIsValid(email) {
202
- // return /\S+@\S+\.\S+/.test(email)
203
- return false;
204
- }
205
- static isValidUNCPath(path) {
206
- // return /\\\\([a-zA-Z0-9_.$●-]+)\\([a-zA-Z0-9_.$●-]+).*/.test(path)
207
- return false;
208
- }
209
- static isValidDate(date) {
210
- var parsedDate = Date.parse(date);
211
- if (isNaN(date) && !isNaN(parsedDate)) {
212
- return true;
213
- }
214
- else {
215
- return false;
216
- }
217
- }
218
- static isValidEmailList(list) {
219
- if (list.includes(";")) {
220
- let emails = list.split(";");
221
- for (var email of emails) {
222
- if (this.emailIsValid(email) == false) {
223
- return false;
224
- }
225
- }
226
- }
227
- else {
228
- if (this.emailIsValid(list) == false) {
229
- return false;
230
- }
231
- }
232
- return true;
233
- }
234
- static isNumber(value) {
235
- return ((value != null) &&
236
- (value !== '') &&
237
- !isNaN(Number(value.toString())));
238
- }
239
- static getDiff(startDate, endDate = Date()) {
240
- var eventStartTime = new Date(startDate);
241
- var eventEndTime = new Date(endDate);
242
- var milliseconds = eventEndTime.valueOf() - eventStartTime.valueOf();
243
- function numberEnding(number) {
244
- if (number.toFixed() == '1') {
245
- return '';
246
- }
247
- else {
248
- return 's';
249
- }
250
- }
251
- var minutes = (milliseconds / (1000 * 60));
252
- var hours = (milliseconds / (1000 * 60 * 60));
253
- var days = (milliseconds / (1000 * 60 * 60 * 24));
254
- var weeks = (milliseconds / (1000 * 60 * 60 * 24 * 7));
255
- var months = (milliseconds / (1000 * 60 * 60 * 24 * 7 * 4));
256
- var years = (milliseconds / (1000 * 60 * 60 * 24 * 365));
257
- if (years >= 1) {
258
- return years.toFixed() + ' year' + numberEnding(years);
259
- }
260
- else if (months >= 1) {
261
- return months.toFixed() + ' month' + numberEnding(months);
262
- }
263
- else if (weeks >= 1) {
264
- return weeks.toFixed() + ' week' + numberEnding(weeks);
265
- }
266
- else if (days >= 1) {
267
- return days.toFixed() + ' day' + numberEnding(days);
268
- }
269
- else if (hours >= 1) {
270
- return hours.toFixed() + ' hour' + numberEnding(hours);
271
- }
272
- else if (minutes >= 1) {
273
- return minutes.toFixed() + ' minute' + numberEnding(minutes);
274
- }
275
- else if (milliseconds >= (-1000 * 60)) {
276
- return 'a minute';
277
- }
278
- else {
279
- return 'N/A';
280
- }
281
- }
282
- static nowDate(NoTime = false) {
283
- if (NoTime) {
284
- return this.getFormatedDate(Date(), true);
285
- }
286
- else {
287
- return this.getFormatedDate(Date());
288
- }
289
- }
290
- static getFormatedDate(dateString, NoTime = false) {
291
- let d = new Date(dateString);
292
- d.setHours(d.getHours() + 2);
293
- if (NoTime == true) {
294
- return d.toISOString().split('T')[0];
295
- }
296
- else {
297
- return d.toISOString().split('.')[0];
298
- }
299
- }
300
- static getBusinessDatesCount(startDate, endDate) {
301
- var count = 0;
302
- var _startDate = new Date(startDate);
303
- var _endDate = new Date(endDate);
304
- var curDate = _startDate;
305
- while (curDate < _endDate) {
306
- var dayOfWeek = curDate.getDay();
307
- if (!(dayOfWeek == 6 || dayOfWeek == 0))
308
- count++;
309
- curDate.setDate(curDate.getDate() + 1);
310
- }
311
- return count;
312
- }
313
- }
314
- Core.nullDate = "01 Jan 1969";
315
- class ApiResponse {
316
- }
317
- class Constants {
318
- }
319
- Constants.AUTH_USER = 'a';
320
- Constants.AUTH_NAME = 'b';
321
- Constants.AUTH_ROLES = 'c';
322
- Constants.AUTH_TOKEN = 'd';
323
- Constants.AUTH_TOKEN_EXPIRE = 'e';
324
-
325
- var LogLevel;
326
- (function (LogLevel) {
327
- LogLevel[LogLevel["All"] = 0] = "All";
328
- LogLevel[LogLevel["Debug"] = 1] = "Debug";
329
- LogLevel[LogLevel["Info"] = 2] = "Info";
330
- LogLevel[LogLevel["Warn"] = 3] = "Warn";
331
- LogLevel[LogLevel["Error"] = 4] = "Error";
332
- LogLevel[LogLevel["Fatal"] = 5] = "Fatal";
333
- LogLevel[LogLevel["Off"] = 6] = "Off";
334
- })(LogLevel || (LogLevel = {}));
335
- class Tile {
336
- }
337
- class Step {
338
- }
339
- class TableConfig {
340
- constructor() {
341
- this.enableFilter = false;
342
- this.create = new TableCreate();
343
- this.greyout = new Condition();
344
- }
345
- }
346
- class TableCreate {
347
- }
348
- class TableColumn {
349
- constructor() {
350
- this.name = "default";
351
- this.display = "default";
352
- this.type = TableColumnType.String;
353
- }
354
- }
355
- var TableColumnType;
356
- (function (TableColumnType) {
357
- TableColumnType[TableColumnType["String"] = 0] = "String";
358
- TableColumnType[TableColumnType["Date"] = 1] = "Date";
359
- TableColumnType[TableColumnType["DateTime"] = 2] = "DateTime";
360
- TableColumnType[TableColumnType["Image"] = 3] = "Image";
361
- TableColumnType[TableColumnType["Icon"] = 4] = "Icon";
362
- TableColumnType[TableColumnType["TextIcon"] = 5] = "TextIcon";
363
- TableColumnType[TableColumnType["Chip"] = 6] = "Chip";
364
- })(TableColumnType || (TableColumnType = {}));
365
- class Condition {
366
- constructor() {
367
- this.field = "";
368
- this.operator = Operator.Equal;
369
- this.value = "";
370
- }
371
- }
372
- var Operator;
373
- (function (Operator) {
374
- Operator[Operator["Equal"] = 0] = "Equal";
375
- Operator[Operator["Less"] = 1] = "Less";
376
- Operator[Operator["Greater"] = 2] = "Greater";
377
- Operator[Operator["NotEqual"] = 3] = "NotEqual";
378
- })(Operator || (Operator = {}));
379
- class Color extends Condition {
380
- }
381
- class Icon extends Condition {
382
- }
383
- class TableAction {
384
- }
385
- class ActionResponse {
386
- }
387
- class loginConfig {
388
- constructor() {
389
- this.appName = "";
390
- this.selfService = false;
391
- this.logo = "";
392
- this.logoSize = "normal";
393
- }
394
- }
395
- class AppConfig {
396
- constructor() {
397
- this.appName = "App Name";
398
- this.logo = "";
399
- this.logoSize = "normal";
400
- this.ADAuth = true;
401
- this.localAuth = true;
402
- this.selfService = false;
403
- }
404
- }
405
- class CapItem {
406
- constructor() {
407
- this.name = "";
408
- this.display = "New Cap Item";
409
- this.enabled = false;
410
- this.type = "";
411
- this.newLine = false;
412
- this.showMenu = true;
413
- this.ignoreSubsDisplay = false;
414
- this.link = "";
415
- this.icon = "navigate_next";
416
- }
417
- }
418
- class Account {
419
- }
420
- class User {
421
- constructor() {
422
- this.userName = "";
423
- this.password = "";
424
- this.tries = "0";
425
- this.locked = "0";
426
- this.logged = "0";
427
- this.disabled = "0";
428
- this.changepassword = "0";
429
- this.dateCreated = Core.nowDate();
430
- this.dateUpdated = Core.nowDate();
431
- this.token = "";
432
- this.dateExpire = Core.nowDate();
433
- this.tokenExpire = Core.nowDate();
434
- this.authType = "";
435
- }
436
- }
437
- class ChangeUserPassword {
438
- constructor() {
439
- this.userName = "";
440
- this.currentPassword = "";
441
- this.newPassword = "";
442
- this.confirmPassword = "";
443
- }
444
- }
445
- class Register {
446
- constructor() {
447
- this.userName = "";
448
- this.roleID = 1;
449
- this.firstName = "";
450
- this.lastName = "";
451
- this.email = "";
452
- this.authType = "";
453
- this.password = "";
454
- }
455
- }
456
- class Profile {
457
- constructor() {
458
- this.profileID = "";
459
- this.userName = "";
460
- this.roleID = 1;
461
- this.firstName = "";
462
- this.lastName = "";
463
- this.email = "";
464
- this.empID = "";
465
- this.arID = "0";
466
- this.authType = "";
467
- this.password = "";
468
- this.role = new Role();
469
- }
470
- }
471
- class Role {
472
- constructor() {
473
- this.roleID = 0;
474
- this.roleName = "New Role";
475
- this.cap1 = false;
476
- this.cap2 = false;
477
- this.cap3 = false;
478
- this.cap4 = false;
479
- this.cap5 = false;
480
- this.cap6 = false;
481
- this.cap7 = false;
482
- this.cap8 = false;
483
- this.cap9 = false;
484
- this.cap10 = false;
485
- this.cap11 = false;
486
- this.cap12 = false;
487
- this.cap13 = false;
488
- this.cap14 = false;
489
- this.cap15 = false;
490
- this.cap16 = false;
491
- this.cap17 = false;
492
- this.cap18 = false;
493
- this.cap19 = false;
494
- this.cap20 = false;
495
- this.cap21 = false;
496
- this.cap22 = false;
497
- this.cap23 = false;
498
- this.cap24 = false;
499
- this.cap25 = false;
500
- this.cap26 = false;
501
- this.cap27 = false;
502
- this.cap28 = false;
503
- this.cap29 = false;
504
- this.cap30 = false;
505
- this.cap31 = false;
506
- this.cap32 = false;
507
- this.cap33 = false;
508
- this.cap34 = false;
509
- this.cap35 = false;
510
- this.cap36 = false;
511
- this.cap37 = false;
512
- this.cap38 = false;
513
- this.cap39 = false;
514
- this.cap40 = false;
515
- this.cap41 = false;
516
- this.cap42 = false;
517
- this.cap43 = false;
518
- this.cap44 = false;
519
- this.cap45 = false;
520
- this.cap46 = false;
521
- this.cap47 = false;
522
- this.cap48 = false;
523
- this.cap49 = false;
524
- this.cap50 = false;
525
- this.cap51 = false;
526
- this.cap52 = false;
527
- this.cap53 = false;
528
- this.cap54 = false;
529
- this.cap55 = false;
530
- this.cap56 = false;
531
- this.cap57 = false;
532
- this.cap58 = false;
533
- this.cap59 = false;
534
- this.cap60 = false;
535
- this.cap61 = false;
536
- this.cap62 = false;
537
- this.cap63 = false;
538
- this.cap64 = false;
539
- this.cap65 = false;
540
- this.cap66 = false;
541
- this.cap67 = false;
542
- this.cap68 = false;
543
- this.cap69 = false;
544
- this.cap70 = false;
545
- this.cap71 = false;
546
- this.cap72 = false;
547
- this.cap73 = false;
548
- this.cap74 = false;
549
- this.cap75 = false;
550
- this.cap76 = false;
551
- this.cap77 = false;
552
- this.cap78 = false;
553
- this.cap79 = false;
554
- this.cap80 = false;
555
- this.cap81 = false;
556
- this.cap82 = false;
557
- this.cap83 = false;
558
- this.cap84 = false;
559
- this.cap85 = false;
560
- this.cap86 = false;
561
- this.cap87 = false;
562
- this.cap88 = false;
563
- this.cap89 = false;
564
- this.cap90 = false;
565
- this.cap91 = false;
566
- this.cap92 = false;
567
- this.cap93 = false;
568
- this.cap94 = false;
569
- this.cap95 = false;
570
- this.cap96 = false;
571
- this.cap97 = false;
572
- this.cap98 = false;
573
- this.cap99 = false;
574
- this.cap100 = false;
575
- }
576
- }
577
-
578
- let LogService = class LogService {
579
- constructor() {
580
- this.level = LogLevel.All;
581
- this.logToConsole = true;
582
- this.logToApi = false;
583
- }
584
- debug(msg, ...optionalParams) {
585
- this.writeToLog(msg, LogLevel.Debug, optionalParams);
586
- }
587
- info(msg, ...optionalParams) {
588
- this.writeToLog(msg, LogLevel.Info, optionalParams);
589
- }
590
- warn(msg, ...optionalParams) {
591
- this.writeToLog(msg, LogLevel.Warn, optionalParams);
592
- }
593
- error(msg, ...optionalParams) {
594
- this.writeToLog(msg, LogLevel.Error, optionalParams);
595
- }
596
- fatal(msg, ...optionalParams) {
597
- this.writeToLog(msg, LogLevel.Fatal, optionalParams);
598
- }
599
- log(msg, ...optionalParams) {
600
- this.writeToLog(msg, LogLevel.All, optionalParams);
601
- }
602
- writeToLog(msg, level, params) {
603
- if (this.shouldLog(level)) {
604
- // Build log string
605
- let value = Core.getFormatedDate(Date(), false).replace("T", " ");
606
- // value += " - Type: " + LogLevel[this.level];
607
- value += " - Message: " + msg;
608
- if (params.length) {
609
- value += " - Extra Info: " + this.formatParams(params);
610
- }
611
- // Log the value
612
- if (this.logToConsole) {
613
- console.log(value);
614
- }
615
- if (this.logToApi) {
616
- //Call API post
617
- }
618
- }
619
- }
620
- formatParams(params) {
621
- let ret = params.join(",");
622
- // Is there at least one object in the array?
623
- if (params.some((p) => typeof p == "object")) {
624
- ret = "";
625
- // Build comma-delimited string
626
- for (let item of params) {
627
- ret += JSON.stringify(item) + ",";
628
- }
629
- }
630
- return ret;
631
- }
632
- shouldLog(level) {
633
- let ret = false;
634
- if ((level >= this.level && level !== LogLevel.Off) ||
635
- this.level === LogLevel.All) {
636
- ret = true;
637
- }
638
- return ret;
639
- }
640
- };
641
- LogService.ɵprov = ɵɵdefineInjectable({ factory: function LogService_Factory() { return new LogService(); }, token: LogService, providedIn: "root" });
642
- LogService = __decorate([
643
- Injectable({
644
- providedIn: "root",
645
- })
646
- ], LogService);
647
-
648
- let HttpService = class HttpService {
649
- constructor(httpClient, router) {
650
- this.httpClient = httpClient;
651
- this.router = router;
652
- //----Set apiUrl from the data service of the project---//
653
- this.apiUrl = "https://api.solinc.co.zw/"; //default
654
- this.httpOptions_Legacy = {
655
- headers: new HttpHeaders({
656
- Accept: "application/json",
657
- "Content-Type": "application/json",
658
- Authorization: "Basic " + btoa("emptyUser:emptyToken"),
659
- }),
660
- resposeType: "json",
661
- };
662
- this.httpOptions_Files = {
663
- headers: new HttpHeaders({
664
- Authorization: "Basic " + btoa("tnyagato:j5Toszfr@ys"),
665
- }),
666
- resposeType: "json",
667
- };
668
- }
669
- //POST
670
- Post(service, data) {
671
- return this.httpClient.post(this.apiUrl + service, data, this.httpOptions_Legacy);
672
- }
673
- //PUT
674
- Put(service, data) {
675
- return this.httpClient.put(this.apiUrl + service, data, this.httpOptions_Legacy);
676
- }
677
- //POST RAW
678
- Post_Raw(url, data) {
679
- return this.httpClient.post(url, data, this.httpOptions_Legacy);
680
- }
681
- //POST with file
682
- Post_WithFile(service, data, file) {
683
- let formData = new FormData();
684
- if (file) {
685
- formData.append("uploadFile", file, file.name);
686
- }
687
- formData.append("data", JSON.stringify(data));
688
- return this.httpClient.post(this.apiUrl + service, formData, this.httpOptions_Files);
689
- }
690
- // //POST with files
691
- Post_FormData(service, formData) {
692
- return this.httpClient.post(this.apiUrl + service, formData, this.httpOptions_Files);
693
- }
694
- //GET
695
- Get(service) {
696
- return this.httpClient.get(this.apiUrl + service, this.httpOptions_Legacy);
697
- }
698
- //Get RAW
699
- Get_Raw(url) {
700
- return this.httpClient.get(url, this.httpOptions_Legacy);
701
- }
702
- //ERROR
703
- Error(error) {
704
- if (error.statusText == "Unauthorized") {
705
- this.router.navigate(["login"]);
706
- return "Unauthorized";
707
- }
708
- else {
709
- return "Connection failed";
710
- }
711
- }
712
- };
713
- HttpService.ctorParameters = () => [
714
- { type: HttpClient },
715
- { type: Router }
716
- ];
717
- HttpService.ɵprov = ɵɵdefineInjectable({ factory: function HttpService_Factory() { return new HttpService(ɵɵinject(HttpClient), ɵɵinject(Router)); }, token: HttpService, providedIn: "root" });
718
- HttpService = __decorate([
719
- Injectable({
720
- providedIn: "root",
721
- })
722
- ], HttpService);
723
-
724
- let AuthService = class AuthService {
725
- constructor(_route, storage, router, httpService, messageService, logService) {
726
- this._route = _route;
727
- this.storage = storage;
728
- this.router = router;
729
- this.httpService = httpService;
730
- this.messageService = messageService;
731
- this.logService = logService;
732
- //Logged in
733
- this.loggedin = false;
734
- this.loggedinSource = new BehaviorSubject(this.loggedin);
735
- this.loggedinObserv = this.loggedinSource.asObservable();
736
- //Token
737
- this.token = "";
738
- this.tokenSource = new BehaviorSubject(this.token);
739
- this.tokenObserv = this.tokenSource.asObservable();
740
- //TokenExpire
741
- this.tokenExpire = "";
742
- this.tokenExpireSource = new BehaviorSubject(this.tokenExpire);
743
- this.tokenExpireObserv = this.tokenExpireSource.asObservable();
744
- //Current User
745
- this.currentUser = "tnyagato";
746
- this.currentUserSource = new BehaviorSubject(this.currentUser);
747
- this.currentUserObserv = this.currentUserSource.asObservable();
748
- //Line Manager
749
- this.islineManager = false;
750
- this.isLineManagerSource = new BehaviorSubject(this.islineManager);
751
- this.isLineManagerObserv = this.isLineManagerSource.asObservable();
752
- //Roles
753
- this.currentRole = new Role;
754
- this.currentRoleSource = new BehaviorSubject(this.currentRole);
755
- this.myRoleObserv = this.currentRoleSource.asObservable();
756
- //Logged in FirstName
757
- this.loggedUserSource = new BehaviorSubject("tnyagato");
758
- this.loggedUserFullName = this.loggedUserSource.asObservable();
759
- }
760
- Updateloggedin(loggedin) {
761
- this.loggedinSource.next(loggedin);
762
- this.loggedin = loggedin;
763
- }
764
- UpdateToken(newToken) {
765
- this.tokenSource.next(newToken);
766
- }
767
- UpdateTokenExpire(newTokenExpire) {
768
- this.tokenExpireSource.next(newTokenExpire);
769
- }
770
- UpdateCurrentUser(newUser) {
771
- this.currentUserSource.next(newUser.toLocaleLowerCase());
772
- this.currentUser = newUser.toLocaleLowerCase();
773
- }
774
- UpdateIsLineManager(manager) {
775
- this.isLineManagerSource.next(manager);
776
- }
777
- UpdateRole(role) {
778
- this.currentRoleSource.next(role);
779
- }
780
- updateLoggedUserFullName(userName) {
781
- this.loggedUserSource.next(userName);
782
- }
783
- //Authorisation
784
- isAuthorised(capName) {
785
- if (!this.currentRoleSource.value[capName]) {
786
- // this.logService.info(`authorise: ${this.currentRoleSource.value.roleName} not authorised for ${capName}`);
787
- this.router.navigate(["home"]);
788
- this.messageService.toast(`Unauthorised: ${capName}`);
789
- return false;
790
- }
791
- else {
792
- return true;
793
- }
794
- }
795
- isValidToken() {
796
- let tokenExpire = new Date(this.tokenExpireSource.value);
797
- let nowDate = new Date();
798
- let valid = tokenExpire > nowDate;
799
- if (!valid) {
800
- this.router.navigate(["login"]);
801
- this.messageService.toast(`Expired Session`);
802
- }
803
- return valid;
804
- }
805
- canActivate() {
806
- if (this.loggedin && this.isValidToken()) {
807
- // this.logService.info("authentication: logged in");
808
- return true;
809
- }
810
- if (localStorage.getItem(Constants.AUTH_USER) === null) {
811
- // this.logService.info("authentication: not logged and no cache");
812
- this.Updateloggedin(false);
813
- let url = new URL(window.location.href);
814
- let path = url.hash.replace("#/", "");
815
- this.router.navigate(["login"], {
816
- relativeTo: this._route,
817
- queryParams: { redirectTo: path },
818
- queryParamsHandling: 'merge',
819
- skipLocationChange: false
820
- });
821
- return false;
822
- }
823
- else {
824
- // this.logService.info("authentication: not logged but allowed login");
825
- this.Updateloggedin(true);
826
- this.storage.get(Constants.AUTH_USER).then((resp) => {
827
- this.UpdateCurrentUser(resp);
828
- });
829
- this.storage.get(Constants.AUTH_NAME).then((resp) => {
830
- this.updateLoggedUserFullName(resp);
831
- });
832
- this.storage.get(Constants.AUTH_ROLES).then((resp) => {
833
- let ret = JSON.parse(resp);
834
- this.UpdateRole(ret);
835
- });
836
- this.storage.get(Constants.AUTH_TOKEN).then((resp) => {
837
- this.UpdateToken(resp);
838
- });
839
- this.storage.get(Constants.AUTH_TOKEN_EXPIRE).then((resp) => {
840
- this.UpdateTokenExpire(resp);
841
- this.isValidToken();
842
- });
843
- return true;
844
- }
845
- }
846
- };
847
- AuthService.ctorParameters = () => [
848
- { type: ActivatedRoute },
849
- { type: StorageService },
850
- { type: Router },
851
- { type: HttpService },
852
- { type: MessageService },
853
- { type: LogService }
854
- ];
855
- AuthService.ɵprov = ɵɵdefineInjectable({ factory: function AuthService_Factory() { return new AuthService(ɵɵinject(ActivatedRoute), ɵɵinject(StorageService), ɵɵinject(Router), ɵɵinject(HttpService), ɵɵinject(MessageService), ɵɵinject(LogService)); }, token: AuthService, providedIn: "root" });
856
- AuthService = __decorate([
857
- Injectable({
858
- providedIn: 'root'
859
- })
860
- ], AuthService);
861
-
862
- let DataServiceLib = class DataServiceLib {
863
- constructor(httpService) {
864
- this.httpService = httpService;
865
- this.appConfig = new AppConfig();
866
- this.appConfigSource = new BehaviorSubject(this.appConfig);
867
- this.appConfigObserv = this.appConfigSource.asObservable();
868
- // caps: CapItem[];
869
- this.capHome = new CapItem;
870
- this.capAdmin = new CapItem;
871
- this.capUsers = new CapItem;
872
- this.capRoles = new CapItem;
873
- this.capLogs = new CapItem;
874
- this.capSettings = new CapItem;
875
- this.tmpProfileuserName = "";
876
- this.appConfig.appName = "App-Name";
877
- this.appConfig.logo = "./assets/logo.png";
878
- this.appConfig.ADAuth = true;
879
- this.appConfig.capItems = [this.capAdmin, this.capHome];
880
- this.capHome.name = "cap1";
881
- this.capHome.display = "Home";
882
- this.capHome.link = "home";
883
- this.capAdmin.name = "cap2";
884
- this.capAdmin.display = "Admin";
885
- this.capAdmin.capSubItems = [this.capUsers, this.capRoles, this.capLogs, this.capSettings];
886
- this.capUsers.name = "cap3";
887
- this.capUsers.display = "Users";
888
- this.capUsers.link = "home/admin/users";
889
- this.capRoles.name = "cap4";
890
- this.capRoles.display = "Roles";
891
- this.capRoles.link = "home/admin/roles";
892
- this.capLogs.name = "cap5";
893
- this.capLogs.display = "Logs";
894
- this.capLogs.link = "home/admin/logs";
895
- this.capSettings.name = "cap6";
896
- this.capSettings.display = "Settings";
897
- this.capSettings.link = "home/admin/settings";
898
- }
899
- UpdateAppConfig(config) {
900
- this.appConfigSource.next(config);
901
- this.appConfig = config;
902
- }
903
- //Users
904
- GetUser() {
905
- return this.httpService.Get("User/all/x");
906
- }
907
- RegisterAccount(u) {
908
- return this.httpService.Post("User/register", u);
909
- }
910
- GetUserByID(val) {
911
- return this.httpService.Get(`User/id/${val}`);
912
- }
913
- UpdateUser(profile) {
914
- return this.httpService.Post("User/edit", profile);
915
- }
916
- UnlockUser(user) {
917
- return this.httpService.Post("User/unlock", user);
918
- }
919
- LockUser(user) {
920
- return this.httpService.Post("User/lock", user);
921
- }
922
- DeleteUser(user) {
923
- return this.httpService.Post("User/delete", user);
924
- }
925
- Login(u) {
926
- return this.httpService.Post("User/login", u);
927
- }
928
- ChangePassword(u) {
929
- return this.httpService.Post("User/changepassword-self", u);
930
- }
931
- ChangePasswordAdmin(u) {
932
- return this.httpService.Post("User/changepassword-admin", u);
933
- }
934
- SelfReset(u) {
935
- return this.httpService.Post("Basic/SelfReset", u);
936
- }
937
- //Roles
938
- PostRole(role, action) {
939
- return this.httpService.Post(`Role?action=${action}`, role);
940
- }
941
- PutRole(role) {
942
- return this.httpService.Put("Role", role);
943
- }
944
- GetRole(by, val) {
945
- return this.httpService.Get("Role/all/x");
946
- }
947
- //Logs
948
- GetLog(by, val) {
949
- return this.httpService.Get("Log/all/x");
950
- }
951
- //Settings
952
- GetSetting(by, val) {
953
- return this.httpService.Get("Setting/all/x");
954
- }
955
- UpdateSetting(setting, action) {
956
- return this.httpService.Post(`Setting?action=${action}`, setting);
957
- }
958
- };
959
- DataServiceLib.ctorParameters = () => [
960
- { type: HttpService }
961
- ];
962
- DataServiceLib.ɵprov = ɵɵdefineInjectable({ factory: function DataServiceLib_Factory() { return new DataServiceLib(ɵɵinject(HttpService)); }, token: DataServiceLib, providedIn: "root" });
963
- DataServiceLib = __decorate([
964
- Injectable({
965
- providedIn: 'root'
966
- })
967
- ], DataServiceLib);
968
-
969
- let LoaderService = class LoaderService {
970
- constructor() {
971
- this.isLoading = new BehaviorSubject(false);
972
- }
973
- };
974
- LoaderService.ɵprov = ɵɵdefineInjectable({ factory: function LoaderService_Factory() { return new LoaderService(); }, token: LoaderService, providedIn: "root" });
975
- LoaderService = __decorate([
976
- Injectable({
977
- providedIn: 'root'
978
- })
979
- ], LoaderService);
980
-
981
- let LoaderComponent = class LoaderComponent {
982
- constructor(loaderService) {
983
- this.loaderService = loaderService;
984
- this.logo = "";
985
- this.loaderService.isLoading.subscribe((v) => {
986
- this.loading = v;
987
- });
988
- }
989
- ngOnInit() {
990
- }
991
- };
992
- LoaderComponent.ctorParameters = () => [
993
- { type: LoaderService }
994
- ];
995
- __decorate([
996
- Input()
997
- ], LoaderComponent.prototype, "logo", void 0);
998
- LoaderComponent = __decorate([
999
- Component({
1000
- selector: 'spa-loader',
1001
- 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",
1002
- styles: [".loading-spinner{background-color:#0000001f;position:absolute;width:100%;top:0;left:0;height:100vh;align-items:center;justify-content:center;display:-ms-grid;display:grid}.loading-spinner img{-ms-grid-row-align:end;align-self:end}.loading-message{text-align:center;-ms-grid-row-align:start;align-self:start}"]
1003
- })
1004
- ], LoaderComponent);
1005
-
1006
- const ɵ0 = { disableClose: true, hasBackdrop: true };
1007
- let SpaMatModule = class SpaMatModule {
1008
- };
1009
- SpaMatModule = __decorate([
1010
- NgModule({
1011
- declarations: [],
1012
- imports: [],
1013
- exports: [
1014
- CommonModule, FormsModule, ReactiveFormsModule,
1015
- MatMenuModule, MatSliderModule, MatTableModule, MatPaginatorModule,
1016
- MatCheckboxModule, MatBadgeModule, MatButtonModule, MatIconModule, MatDialogModule, MatSnackBarModule,
1017
- MatTabsModule, MatFormFieldModule, MatInputModule, MatCardModule, MatChipsModule, MatSelectModule,
1018
- MatNativeDateModule, MatProgressSpinnerModule, MatListModule, MatAutocompleteModule, MatTooltipModule, MatSortModule,
1019
- MatDatepickerModule, MatStepperModule, MatRadioModule,
1020
- ],
1021
- providers: [
1022
- { provide: MAT_DIALOG_DEFAULT_OPTIONS, useValue: ɵ0 },
1023
- { provide: MAT_DATE_LOCALE, useValue: "en-GB" },
1024
- ]
1025
- })
1026
- ], SpaMatModule);
1027
-
1028
- let LoaderInterceptor = class LoaderInterceptor {
1029
- constructor(loaderService, messageService, authService, router, logService) {
1030
- this.loaderService = loaderService;
1031
- this.messageService = messageService;
1032
- this.authService = authService;
1033
- this.router = router;
1034
- this.logService = logService;
1035
- this.requests = [];
1036
- }
1037
- removeRequest(req) {
1038
- const i = this.requests.indexOf(req);
1039
- if (i >= 0) {
1040
- this.requests.splice(i, 1);
1041
- }
1042
- this.loaderService.isLoading.next(this.requests.length > 0);
1043
- }
1044
- intercept(request, next) {
1045
- let requestClone = request.clone({
1046
- setHeaders: {
1047
- Authorization: "Bearer " + this.authService.tokenSource.value
1048
- }
1049
- });
1050
- this.requests.push(requestClone);
1051
- if (this.requests.length > 1) {
1052
- this.logService.info("Multiple connections detected > " + this.requests.length);
1053
- }
1054
- this.loaderService.isLoading.next(true);
1055
- return Observable.create(observer => {
1056
- const subscription = next.handle(requestClone).subscribe(event => {
1057
- if (event instanceof HttpResponse) {
1058
- this.removeRequest(requestClone);
1059
- observer.next(event);
1060
- }
1061
- }, (error) => {
1062
- this.removeRequest(requestClone);
1063
- observer.error(error);
1064
- if (error.status === 401) {
1065
- this.router.navigate(["login"]);
1066
- this.messageService.toast('Unauthorised: Please login again');
1067
- }
1068
- else if (error.status === 500) {
1069
- console.log(error.error);
1070
- this.messageService.toast('System Error');
1071
- }
1072
- else if (error.statusText == 'Unknown Error') {
1073
- this.messageService.toast('Connection Error');
1074
- }
1075
- else {
1076
- this.messageService.toast('Error: ' + error.statusText);
1077
- }
1078
- }, () => {
1079
- this.removeRequest(requestClone);
1080
- observer.complete();
1081
- });
1082
- // remove request from queue when cancelled
1083
- return () => {
1084
- this.removeRequest(requestClone);
1085
- subscription.unsubscribe();
1086
- };
1087
- });
1088
- }
1089
- };
1090
- LoaderInterceptor.ctorParameters = () => [
1091
- { type: LoaderService },
1092
- { type: MessageService },
1093
- { type: AuthService },
1094
- { type: Router },
1095
- { type: LogService }
1096
- ];
1097
- LoaderInterceptor = __decorate([
1098
- Injectable()
1099
- ], LoaderInterceptor);
1100
-
1101
- let TinSpaComponent = class TinSpaComponent {
1102
- constructor() { }
1103
- ngOnInit() {
1104
- }
1105
- };
1106
- TinSpaComponent = __decorate([
1107
- Component({
1108
- selector: 'lib-tin-spa',
1109
- template: `
1110
- <p>
1111
- tin-spa works!
1112
- </p>
1113
- `
1114
- })
1115
- ], TinSpaComponent);
1116
-
1117
- let NavMenuComponent = class NavMenuComponent {
1118
- constructor(router, authService) {
1119
- this.router = router;
1120
- this.authService = authService;
1121
- this.isExpanded = false;
1122
- this.appConfig = new AppConfig();
1123
- }
1124
- ngOnInit() {
1125
- this.authService.loggedUserFullName.subscribe(user => this.loggedUserFullName = user);
1126
- this.authService.myRoleObserv.subscribe(rol => this.myRole = rol);
1127
- this.authService.loggedinObserv.subscribe(obj => this.loggedin = obj);
1128
- }
1129
- collapse() {
1130
- this.isExpanded = false;
1131
- }
1132
- toggle() {
1133
- this.isExpanded = !this.isExpanded;
1134
- }
1135
- // logoff() {
1136
- // // this.authService.updateloggedin(false);
1137
- // // this.authService.updateRole(new Role());
1138
- // this.router.navigate(["login"]);
1139
- // // this.storageService.clear();
1140
- // }
1141
- redirectTo(link) {
1142
- if (link != "") {
1143
- this.router.navigate([link]);
1144
- }
1145
- }
1146
- };
1147
- NavMenuComponent.ctorParameters = () => [
1148
- { type: Router },
1149
- { type: AuthService }
1150
- ];
1151
- __decorate([
1152
- Input()
1153
- ], NavMenuComponent.prototype, "appConfig", void 0);
1154
- NavMenuComponent = __decorate([
1155
- Component({
1156
- selector: 'spa-nav-menu',
1157
- template: "<header *ngIf=\"loggedin\">\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 <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\"\r\n type=\"button\"\r\n data-toggle=\"collapse\"\r\n data-target=\".navbar-collapse\"\r\n aria-label=\"Toggle navigation\"\r\n [attr.aria-expanded]=\"isExpanded\"\r\n (click)=\"toggle()\">\r\n <span class=\"navbar-toggler-icon\"></span>\r\n </button>\r\n\r\n <div *ngIf=\"myRole\" class=\"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')\"> <mat-icon>logout</mat-icon> </button>\r\n\r\n <button id=\"btnUser\" mat-button [matMenuTriggerFor]=\"profileMenu\" style=\"margin-left:2em\"><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</header>\r\n",
1158
- styles: ["a.navbar-brand{white-space:normal;text-align:center;word-break:break-all}html{font-size:14px}@media (min-width:768px){html{font-size:16px}}.box-shadow{box-shadow:0 .25rem .75rem rgba(0,0,0,.05)}.toolbar{height:60px;display:flex;align-items:center;background-color:#03a;color:#fff;font-weight:600}.stack-top{z-index:9;margin:20px}"]
1159
- })
1160
- ], NavMenuComponent);
1161
-
1162
- let TimeoutComponent = class TimeoutComponent {
1163
- constructor(idle, keepalive, authService, router) {
1164
- this.idle = idle;
1165
- this.keepalive = keepalive;
1166
- this.authService = authService;
1167
- this.router = router;
1168
- this.loggedin = false;
1169
- this.idleState = 'Not started.';
1170
- this.timedOut = false;
1171
- this.lastPing = null;
1172
- this.isWarning = false;
1173
- this.authService.loggedinObserv.subscribe(obj => {
1174
- this.loggedin = obj;
1175
- // if (this.loggedin){
1176
- // this.startWatch();
1177
- // }else{
1178
- // this.stopWatch();
1179
- // }
1180
- });
1181
- // sets an idle timeout of 5 seconds, for testing purposes.
1182
- idle.setIdle(900);
1183
- // sets a timeout period of 5 seconds. after 10 seconds of inactivity, the user will be considered timed out.
1184
- idle.setTimeout(10);
1185
- // sets the default interrupts, in this case, things like clicks, scrolls, touches to the document
1186
- idle.setInterrupts(DEFAULT_INTERRUPTSOURCES);
1187
- idle.onIdleStart.subscribe(() => {
1188
- this.idleState = 'You\'ve gone idle!';
1189
- });
1190
- idle.onIdleEnd.subscribe(() => {
1191
- this.idleState = 'No longer idle.';
1192
- this.isWarning = false;
1193
- });
1194
- idle.onTimeoutWarning.subscribe((countdown) => {
1195
- this.idleState = 'You will be signed out in ' + countdown + ' seconds!';
1196
- if (this.loggedin) {
1197
- this.isWarning = true;
1198
- }
1199
- });
1200
- idle.onTimeout.subscribe(() => {
1201
- this.idleState = 'Timed out!';
1202
- this.timedOut = true;
1203
- //action
1204
- this.stopWatch();
1205
- });
1206
- // sets the ping interval to 15 seconds
1207
- keepalive.interval(15);
1208
- keepalive.onPing.subscribe(() => {
1209
- this.lastPing = new Date();
1210
- });
1211
- this.startWatch();
1212
- }
1213
- ngOnInit() {
1214
- }
1215
- startWatch() {
1216
- this.idle.watch();
1217
- this.idleState = 'Started.';
1218
- this.timedOut = false;
1219
- this.isWarning = false;
1220
- }
1221
- stopWatch() {
1222
- this.idle.stop();
1223
- this.isWarning = false;
1224
- this.router.navigate(['login']);
1225
- }
1226
- using() {
1227
- //remove message and continue
1228
- this.isWarning = false;
1229
- }
1230
- };
1231
- TimeoutComponent.ctorParameters = () => [
1232
- { type: Idle },
1233
- { type: Keepalive },
1234
- { type: AuthService },
1235
- { type: Router }
1236
- ];
1237
- TimeoutComponent = __decorate([
1238
- Component({
1239
- selector: 'spa-timeout',
1240
- template: "\r\n<div class=\"loading-spinner\" [hidden]=\"!isWarning\" >\r\n\r\n <div style=\"width: 500px; text-align: center;\">\r\n\r\n\r\n\r\n <div class=\"row\">\r\n <div class=\"col\">\r\n <img style=\"width: 100px;\"\r\n src=\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNTAgMjUwIj4KICAgIDxwYXRoIGZpbGw9IiNERDAwMzEiIGQ9Ik0xMjUgMzBMMzEuOSA2My4ybDE0LjIgMTIzLjFMMTI1IDIzMGw3OC45LTQzLjcgMTQuMi0xMjMuMXoiIC8+CiAgICA8cGF0aCBmaWxsPSIjQzMwMDJGIiBkPSJNMTI1IDMwdjIyLjItLjFWMjMwbDc4LjktNDMuNyAxNC4yLTEyMy4xTDEyNSAzMHoiIC8+CiAgICA8cGF0aCAgZmlsbD0iI0ZGRkZGRiIgZD0iTTEyNSA1Mi4xTDY2LjggMTgyLjZoMjEuN2wxMS43LTI5LjJoNDkuNGwxMS43IDI5LjJIMTgzTDEyNSA1Mi4xem0xNyA4My4zaC0zNGwxNy00MC45IDE3IDQwLjl6IiAvPgogIDwvc3ZnPg==\">\r\n </div>\r\n </div>\r\n\r\n <mat-card class=\"mat-elevation-z3\" >\r\n\r\n <mat-card-header>\r\n\r\n <h5>Are you still there ?</h5>\r\n\r\n </mat-card-header>\r\n\r\n <mat-card-content>\r\n\r\n <br>\r\n <span>{{idleState}}</span>\r\n\r\n <br>\r\n\r\n </mat-card-content>\r\n\r\n <mat-card-actions>\r\n\r\n <div class=\"row justify-content-around\">\r\n\r\n <div class=\"col-2\">\r\n <button style=\"width: 100px;\" mat-stroked-button color=\"primary\" (click)=\"using()\">Yes</button>\r\n </div>\r\n\r\n <div class=\"col-4\">\r\n <button style=\"width: 100px;\" mat-stroked-button color=\"primary\" (click)=\"stopWatch()\">No</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\r\n</div>\r\n\r\n</div>\r\n",
1241
- styles: [".loading-spinner{background-color:#0000001f;position:absolute;width:100%;top:0;left:0;height:100vh;align-items:center;justify-content:center;display:-ms-grid;display:grid}.loading-spinner img{-ms-grid-row-align:end;align-self:end}.loading-message{text-align:center;-ms-grid-row-align:start;align-self:start}"]
1242
- })
1243
- ], TimeoutComponent);
1244
-
1245
- let TableComponent = class TableComponent {
1246
- constructor() {
1247
- this.dataChange = new EventEmitter();
1248
- this.buttonClick = new EventEmitter();
1249
- this.loadClick = new EventEmitter();
1250
- this.createClick = new EventEmitter();
1251
- this.colType = TableColumnType;
1252
- this.op = Operator;
1253
- this.displayedColumns = [];
1254
- this._filterText = "";
1255
- }
1256
- ngOnInit() {
1257
- this.config.columns.forEach(element => {
1258
- this.displayedColumns.push(element.name);
1259
- });
1260
- this.displayedColumns.push("Action");
1261
- this.styleString = `width: ${50 * this.config.actions.length}px`;
1262
- }
1263
- ngOnChanges() {
1264
- this.data = new MatTableDataSource(this.data);
1265
- this.data.paginator = this.tablePaginator;
1266
- this.applyFilter(this._filterText);
1267
- }
1268
- applyFilter(filterValue) {
1269
- this.data.filter = filterValue.trim().toLowerCase();
1270
- }
1271
- do(name, item) {
1272
- let resp = new ActionResponse();
1273
- resp.name = name;
1274
- resp.value = item;
1275
- this.buttonClick.emit(resp);
1276
- }
1277
- create() {
1278
- this.createClick.emit();
1279
- }
1280
- load() {
1281
- this.loadClick.emit();
1282
- }
1283
- test(a, op, b) {
1284
- if (op == Operator.Equal) {
1285
- if (a == b) {
1286
- return true;
1287
- }
1288
- else {
1289
- return false;
1290
- }
1291
- }
1292
- if (op == Operator.Greater) {
1293
- if (a > b) {
1294
- return true;
1295
- }
1296
- else {
1297
- return false;
1298
- }
1299
- }
1300
- if (op == Operator.Less) {
1301
- if (a < b) {
1302
- return true;
1303
- }
1304
- else {
1305
- return false;
1306
- }
1307
- }
1308
- if (op == Operator.NotEqual) {
1309
- if (a != b) {
1310
- return true;
1311
- }
1312
- else {
1313
- return false;
1314
- }
1315
- }
1316
- }
1317
- };
1318
- __decorate([
1319
- Input()
1320
- ], TableComponent.prototype, "config", void 0);
1321
- __decorate([
1322
- Input()
1323
- ], TableComponent.prototype, "data", void 0);
1324
- __decorate([
1325
- Output()
1326
- ], TableComponent.prototype, "dataChange", void 0);
1327
- __decorate([
1328
- Output()
1329
- ], TableComponent.prototype, "buttonClick", void 0);
1330
- __decorate([
1331
- Output()
1332
- ], TableComponent.prototype, "loadClick", void 0);
1333
- __decorate([
1334
- Output()
1335
- ], TableComponent.prototype, "createClick", void 0);
1336
- __decorate([
1337
- ViewChild('tablePaginator')
1338
- ], TableComponent.prototype, "tablePaginator", void 0);
1339
- TableComponent = __decorate([
1340
- Component({
1341
- selector: 'spa-table',
1342
- template: "<div >\r\n\r\n<div *ngIf=\"config.create.enabled || config.enableFilter\" class=\"row justify-content-between\" style=\"padding-bottom: 10px\">\r\n <div class=\"col\">\r\n<button *ngIf=\"config.create\" [disabled]=\"!config.create.enabled\" mat-raised-button color=\"primary\" (click)=\"create()\">{{config.create.display}}</button>\r\n</div>\r\n <div *ngIf=\"config.enableFilter\" class=\"col d-flex justify-content-end\">\r\n<mat-form-field style=\"font-size:12px;margin-right: 5px;\">\r\n<mat-label>Filter</mat-label>\r\n<input matInput [(ngModel)]=\"_filterText\" (keyup)=\"applyFilter($event.target.value)\" placeholder=\"Enter Filter text\" autocomplete=\"off\">\r\n</mat-form-field>\r\n<button mat-mini-fab color=\"primary\" (click)=\"load()\" style=\"margin-top:5px\" matTooltip=\"refresh data\" matTooltipPosition=\"right\"><mat-icon class=\"refreshIcon\">refresh</mat-icon></button>\r\n</div>\r\n</div>\r\n\r\n<div class=\"mat-elevation-z8\" *ngIf=\"data\">\r\n\r\n <table mat-table [dataSource]=\"data\">\r\n\r\n <ng-container *ngFor=\"let col of config.columns; let i = index\"\r\n\r\n [matColumnDef]=\"col.name\">\r\n <th mat-header-cell *matHeaderCellDef> {{col.display}} </th>\r\n <td mat-cell *matCellDef=\"let row\">\r\n\r\n <!-- String -->\r\n <div *ngIf=\"(col.type==colType.String || col.type == null) && col.color == null\"> {{row[col.name]}}</div>\r\n\r\n <div [ngStyle]=\"{'color':col.color.name}\"\r\n *ngIf=\"(col.type==colType.String || col.type == null) && col.color != null && test(row[col.color.field], col.color.operator, col.color.value )\" >\r\n {{row[col.name]}}\r\n </div>\r\n\r\n <div\r\n *ngIf=\"(col.type==colType.String || col.type == null) && col.color != null && !test(row[col.color.field], col.color.operator, col.color.value )\" >\r\n {{row[col.name]}}\r\n </div>\r\n\r\n <!-- <div [ngStyle]=\"{'color':col.color.name}\"\r\n *ngIf=\"(col.type==colType.String || col.type == null) && col.color != null &&\r\n col.color.operator==op.Equal && row[col.color.field]==col.color.value\" >\r\n {{row[col.name]}}\r\n </div>\r\n\r\n <div [ngStyle]=\"{'color':col.color.name}\"\r\n *ngIf=\"(col.type==colType.String || col.type == null) && col.color != null &&\r\n col.color.operator==op.Greater && row[col.color.field]>col.color.value\" >\r\n {{row[col.name]}}\r\n </div>\r\n\r\n <div [ngStyle]=\"{'color':col.color.name}\"\r\n *ngIf=\"(col.type==colType.String || col.type == null) && col.color != null &&\r\n col.color.operator==op.Less && row[col.color.field]<col.color.value\" >\r\n {{row[col.name]}}\r\n </div>\r\n\r\n <div [ngStyle]=\"{'color':col.color.name}\"\r\n *ngIf=\"(col.type==colType.String || col.type == null) && col.color != null &&\r\n col.color.operator==op.NotEqual && row[col.color.field]!=col.color.value\" >\r\n {{row[col.name]}}\r\n </div> -->\r\n\r\n\r\n <!-- Date -->\r\n <div *ngIf=\"col.type==colType.Date\"> {{row[col.name] | date:'dd/MM/yyyy'}}</div>\r\n\r\n\r\n <!-- DateTime -->\r\n <div *ngIf=\"col.type==colType.DateTime\"> {{row[col.name] | date:'dd/MM/yyyy HH:mm'}}</div>\r\n\r\n\r\n <ng-container *ngFor=\"let icon of col.icons;\">\r\n <!-- <mat-icon *ngIf=\"col.type==colType.Icon && icon.operator==op.Equal && row[icon.field]==icon.value\"\r\n [ngStyle]=\"{'color':icon.color}\"\r\n [matTooltip]=\"icon.hint\" matTooltipPosition=\"above\">\r\n {{icon.name}}\r\n </mat-icon>\r\n\r\n <mat-icon *ngIf=\"col.type==colType.Icon && icon.operator==op.Greater && row[icon.field]>icon.value\"\r\n [ngStyle]=\"{'color':icon.color}\"\r\n [matTooltip]=\"icon.hint\" matTooltipPosition=\"above\">\r\n {{icon.name}}\r\n </mat-icon>\r\n\r\n <mat-icon *ngIf=\"col.type==colType.Icon && icon.operator==op.Less && row[icon.field]<icon.value\"\r\n [ngStyle]=\"{'color':icon.color}\"\r\n [matTooltip]=\"icon.hint\" matTooltipPosition=\"above\">\r\n {{icon.name}}\r\n </mat-icon>\r\n <mat-icon *ngIf=\"col.type==colType.Icon && icon.operator==op.NotEqual && row[icon.field]!=icon.value\"\r\n [ngStyle]=\"{'color':icon.color}\"\r\n [matTooltip]=\"icon.hint\" matTooltipPosition=\"above\">\r\n {{icon.name}}\r\n </mat-icon> -->\r\n\r\n <mat-icon *ngIf=\"col.type==colType.Icon && test(row[icon.field],icon.operator,icon.value)\"\r\n [ngStyle]=\"{'color':icon.color}\"\r\n [matTooltip]=\"icon.hint\" matTooltipPosition=\"above\">\r\n {{icon.name}}\r\n </mat-icon>\r\n\r\n </ng-container>\r\n\r\n </td>\r\n\r\n </ng-container>\r\n\r\n\r\n\r\n\r\n <ng-container matColumnDef=\"Action\">\r\n\r\n <th mat-header-cell *matHeaderCellDef> Action </th>\r\n <td mat-cell *matCellDef=\"let row\" [style]=\"styleString+';padding-right: 0px;'\">\r\n\r\n <ng-container *ngFor=\"let act of config.actions\">\r\n\r\n <button *ngIf=\" (act.disappear && (row[act.disappear.field] != act.disappear.value)) || !act.disappear\" mat-mini-fab\r\n\r\n [disabled]=\"(act.disable && (row[act.disable.field] == act.disable.value))\"\r\n [color]=\"act.color==null? 'primary' : act.color\"\r\n [matTooltip]=\"act.hint\" matTooltipPosition=\"above\"\r\n (click)=\"do(act.name,row)\" style=\"margin-right:5px\">\r\n <mat-icon>{{act.icon}}</mat-icon>\r\n\r\n </button>\r\n\r\n </ng-container>\r\n\r\n </td>\r\n </ng-container>\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[config.greyout.field]==config.greyout.value}\"></tr>\r\n\r\n </table>\r\n</div>\r\n<mat-paginator #tablePaginator [pageSizeOptions]=\"[10, 50, 100]\" showFirstLastButtons></mat-paginator>\r\n</div>\r\n\r\n",
1343
- styles: [".mat-mini-fab{width:32px;height:32px}.mat-mini-fab mat-icon{font-size:16px;margin-top:-3px}.make-gray{background-color:#d3d3d3}"]
1344
- })
1345
- ], TableComponent);
1346
-
1347
- let TilesComponent = class TilesComponent {
1348
- constructor() {
1349
- this.clickable = false;
1350
- this.tileClick = new EventEmitter();
1351
- this.selected = "";
1352
- }
1353
- ngOnInit() {
1354
- }
1355
- clicked(v) {
1356
- if (!this.clickable)
1357
- return;
1358
- if (this.selected == v.tileName) {
1359
- this.tileClick.emit("");
1360
- this.selected = "";
1361
- }
1362
- else {
1363
- this.tileClick.emit(v.tileName);
1364
- this.selected = v.tileName;
1365
- }
1366
- }
1367
- };
1368
- __decorate([
1369
- Input()
1370
- ], TilesComponent.prototype, "tiles", void 0);
1371
- __decorate([
1372
- Input()
1373
- ], TilesComponent.prototype, "clickable", void 0);
1374
- __decorate([
1375
- Output()
1376
- ], TilesComponent.prototype, "tileClick", void 0);
1377
- TilesComponent = __decorate([
1378
- Component({
1379
- selector: 'spa-tiles',
1380
- 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",
1381
- styles: [""]
1382
- })
1383
- ], TilesComponent);
1384
-
1385
- let DateComponent = class DateComponent {
1386
- constructor() {
1387
- this.date = new FormControl(new Date());
1388
- this.display = "";
1389
- this.readonly = false;
1390
- this.currentYear = new Date().getFullYear();
1391
- this.min = new FormControl(new Date(this.currentYear - 50, 0, 1));
1392
- this.max = new FormControl(new Date(this.currentYear + 50, 0, 1));
1393
- }
1394
- ngOnInit() {
1395
- }
1396
- // @Output() dateChange = new EventEmitter();
1397
- // minDate: Date = new Date(this.currentYear, 2, 2);
1398
- // maxDate: Date = new Date(this.currentYear, 2, 10);
1399
- onChangeEvent(d) {
1400
- // this.dateChange.emit(d);
1401
- }
1402
- };
1403
- __decorate([
1404
- Input()
1405
- ], DateComponent.prototype, "date", void 0);
1406
- __decorate([
1407
- Input()
1408
- ], DateComponent.prototype, "display", void 0);
1409
- __decorate([
1410
- Input()
1411
- ], DateComponent.prototype, "readonly", void 0);
1412
- __decorate([
1413
- Input()
1414
- ], DateComponent.prototype, "min", void 0);
1415
- __decorate([
1416
- Input()
1417
- ], DateComponent.prototype, "max", void 0);
1418
- DateComponent = __decorate([
1419
- Component({
1420
- selector: 'spa-date',
1421
- template: "\r\n<mat-form-field style=\"width:150px;margin-right:20px\">\r\n<input [formControl]=\"date\" [min]=\"min.value\" [max]=\"max.value\" matInput [matDatepicker]=\"picker_date\" [placeholder]=\"display\" [readonly]=\"true\" [disabled]=\"readonly\">\r\n<mat-datepicker-toggle matSuffix [for]=\"picker_date\"></mat-datepicker-toggle>\r\n<mat-datepicker #picker_date></mat-datepicker>\r\n</mat-form-field>\r\n",
1422
- styles: [""]
1423
- })
1424
- ], DateComponent);
1425
-
1426
- let TextComponent = class TextComponent {
1427
- constructor() {
1428
- // options: FormGroup;
1429
- this.hideRequiredControl = new FormControl(true);
1430
- this.readonly = false;
1431
- this.hint = "";
1432
- this.display = "";
1433
- this.placeholder = "";
1434
- this.value = "";
1435
- this.valueChange = new EventEmitter();
1436
- this.format = "text";
1437
- this.type = "";
1438
- this.leave = new EventEmitter();
1439
- this.enterPress = new EventEmitter();
1440
- this.rows = "";
1441
- this.width = "100%";
1442
- //Autocomplete items
1443
- this.options = [];
1444
- this.optionValue = "";
1445
- this.optionDisplay = "";
1446
- this.myControl = new FormControl();
1447
- //validations
1448
- this.required = true;
1449
- this.min = 0;
1450
- this.max = 9000000000000000; //Math.max
1451
- this.regex = ""; //"[a-zA-Z ]*" //"/\S+@\S+\.\S+/";
1452
- this.control = new FormControl(this.value, [Validators.required, Validators.minLength(this.min), Validators.maxLength(this.max), Validators.pattern(this.regex)]);
1453
- }
1454
- ngOnInit() {
1455
- if (this.options.length > 0) {
1456
- this.initFilter();
1457
- }
1458
- if (this.placeholder == "") {
1459
- this.placeholder = "Enter " + this.display;
1460
- }
1461
- }
1462
- ngAfterViewInit() {
1463
- if (this.readonly) {
1464
- this.control.setValidators(null);
1465
- this.control.updateValueAndValidity();
1466
- }
1467
- if (!this.required && !this.readonly) {
1468
- this.control.setValidators([Validators.minLength(this.min), Validators.maxLength(this.max), Validators.pattern(this.regex)]);
1469
- this.control.updateValueAndValidity();
1470
- }
1471
- }
1472
- initFilter() {
1473
- this.filteredOptions = this.myControl.valueChanges.pipe(startWith(""), map((value) => this._filter(value)));
1474
- }
1475
- _filter(value) {
1476
- const filterValue = value.toLowerCase();
1477
- return this.options.filter((option) => option[`${this.optionDisplay}`].toLowerCase().includes(filterValue));
1478
- }
1479
- changed() {
1480
- // if (this.options.length > 0) {
1481
- // this.value = this.myControl.value;
1482
- // }
1483
- this.valueChange.emit(this.value);
1484
- }
1485
- changed2() {
1486
- // if (this.options.length > 0) {
1487
- // this.value = this.myControl.value;
1488
- // }
1489
- this.valueChange.emit(this.myControl.value);
1490
- }
1491
- leaved() {
1492
- this.leave.emit();
1493
- }
1494
- enterPressed() {
1495
- this.enterPress.emit();
1496
- }
1497
- validate() {
1498
- if ((this.required || this.min > 0) && this.control.hasError('required')) {
1499
- return `Required`;
1500
- }
1501
- if (this.control.hasError('minlength')) {
1502
- return `Minimun length is ${this.min}`;
1503
- }
1504
- if (this.control.hasError('maxlength')) {
1505
- return `Maximum length is ${this.max}`;
1506
- }
1507
- if (this.control.hasError('pattern')) {
1508
- return `Invalid Input`;
1509
- }
1510
- // if (this.regex != ""){
1511
- // let r = new RegExp(this.regex, "g");
1512
- // if (!r.test(this.value)){
1513
- // this.valid = false;
1514
- // this.errorMessage = "Invalid input";
1515
- // return this.errorMessage;
1516
- // }
1517
- // }
1518
- return "";
1519
- }
1520
- };
1521
- __decorate([
1522
- Input()
1523
- ], TextComponent.prototype, "readonly", void 0);
1524
- __decorate([
1525
- Input()
1526
- ], TextComponent.prototype, "hint", void 0);
1527
- __decorate([
1528
- Input()
1529
- ], TextComponent.prototype, "display", void 0);
1530
- __decorate([
1531
- Input()
1532
- ], TextComponent.prototype, "placeholder", void 0);
1533
- __decorate([
1534
- Input()
1535
- ], TextComponent.prototype, "value", void 0);
1536
- __decorate([
1537
- Output()
1538
- ], TextComponent.prototype, "valueChange", void 0);
1539
- __decorate([
1540
- Input()
1541
- ], TextComponent.prototype, "format", void 0);
1542
- __decorate([
1543
- Input()
1544
- ], TextComponent.prototype, "type", void 0);
1545
- __decorate([
1546
- Output()
1547
- ], TextComponent.prototype, "leave", void 0);
1548
- __decorate([
1549
- Output()
1550
- ], TextComponent.prototype, "enterPress", void 0);
1551
- __decorate([
1552
- Input()
1553
- ], TextComponent.prototype, "rows", void 0);
1554
- __decorate([
1555
- Input()
1556
- ], TextComponent.prototype, "width", void 0);
1557
- __decorate([
1558
- Input()
1559
- ], TextComponent.prototype, "options", void 0);
1560
- __decorate([
1561
- Input()
1562
- ], TextComponent.prototype, "optionValue", void 0);
1563
- __decorate([
1564
- Input()
1565
- ], TextComponent.prototype, "optionDisplay", void 0);
1566
- __decorate([
1567
- Input()
1568
- ], TextComponent.prototype, "required", void 0);
1569
- __decorate([
1570
- Input()
1571
- ], TextComponent.prototype, "min", void 0);
1572
- __decorate([
1573
- Input()
1574
- ], TextComponent.prototype, "max", void 0);
1575
- __decorate([
1576
- Input()
1577
- ], TextComponent.prototype, "regex", void 0);
1578
- TextComponent = __decorate([
1579
- Component({
1580
- selector: 'spa-text',
1581
- template: "<mat-form-field *ngIf=\"rows == '' && options.length==0\" hideRequiredMarker=\"true\" [hintLabel]=\"hint\" style=\"padding-right: 20px;\" [ngStyle]=\"{'width':width}\" >\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<!-- <mat-label *ngIf=\"format=='datetime'\">{{display | date:'dd/MM/yyyy HH:mm'}}</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()}}</mat-error>\r\n</mat-form-field>\r\n\r\n\r\n<!-- TextArea copy - Only change input to textarea and change ngif to not -->\r\n\r\n<mat-form-field *ngIf=\"rows != '' && options.length==0\" hideRequiredMarker=\"true\" [hintLabel]=\"hint\" style=\"padding-right: 20px;\" [ngStyle]=\"{'width':width}\">\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()}}</mat-error>\r\n</mat-form-field>\r\n\r\n\r\n\r\n<!-- Work in progress cant bind to value -->\r\n\r\n <!-- <mat-form-field *ngIf=\"options.length !=0\" hideRequiredMarker=\"true\" [hintLabel]=\"hint\" style=\"padding-right: 20px;\" [ngStyle]=\"{'width':width}\">\r\n <input type=\"text\" autocomplete=\"off\" [placeholder]=\"display\" (change)=\"changed2()\" matInput [formControl]=\"myControl\" [matAutocomplete]=\"auto\" [readonly]=\"readonly\">\r\n <mat-autocomplete #auto=\"matAutocomplete\">\r\n <mat-option *ngFor=\"let row of filteredOptions | async\" [value]=\"row[optionValue]\">\r\n {{row[optionDisplay]}}\r\n </mat-option>\r\n </mat-autocomplete>\r\n</mat-form-field> -->\r\n\r\n",
1582
- styles: [""]
1583
- })
1584
- ], TextComponent);
1585
-
1586
- let SelectComponent = class SelectComponent {
1587
- constructor() {
1588
- this.width = "100%";
1589
- this.readonly = false;
1590
- this.readonlyMode = "";
1591
- this.hint = "";
1592
- this.placeholder = "";
1593
- this.display = "";
1594
- this.value = "";
1595
- this.optionValue = "";
1596
- this.optionDisplay = "";
1597
- this.optionDisplayExtra = "";
1598
- this.valueChange = new EventEmitter();
1599
- }
1600
- ngOnInit() {
1601
- // this.displayValue = this.options.filter((m) => m.optionValue == this.value)
1602
- // this.displayValue = this.value
1603
- if (this.placeholder == "") {
1604
- this.placeholder = "Select " + this.display;
1605
- }
1606
- }
1607
- ngOnChanges() {
1608
- if (this.readonlyMode != "" && this.options.length > 0) {
1609
- this.displayValue = this.options.filter((m) => m[`${this.optionValue}`] == this.value)[0][`${this.optionDisplay}`];
1610
- }
1611
- }
1612
- changed() {
1613
- this.valueChange.emit(this.value);
1614
- }
1615
- };
1616
- __decorate([
1617
- Input()
1618
- ], SelectComponent.prototype, "width", void 0);
1619
- __decorate([
1620
- Input()
1621
- ], SelectComponent.prototype, "readonly", void 0);
1622
- __decorate([
1623
- Input()
1624
- ], SelectComponent.prototype, "readonlyMode", void 0);
1625
- __decorate([
1626
- Input()
1627
- ], SelectComponent.prototype, "hint", void 0);
1628
- __decorate([
1629
- Input()
1630
- ], SelectComponent.prototype, "placeholder", void 0);
1631
- __decorate([
1632
- Input()
1633
- ], SelectComponent.prototype, "display", void 0);
1634
- __decorate([
1635
- Input()
1636
- ], SelectComponent.prototype, "value", void 0);
1637
- __decorate([
1638
- Input()
1639
- ], SelectComponent.prototype, "options", void 0);
1640
- __decorate([
1641
- Input()
1642
- ], SelectComponent.prototype, "optionValue", void 0);
1643
- __decorate([
1644
- Input()
1645
- ], SelectComponent.prototype, "optionDisplay", void 0);
1646
- __decorate([
1647
- Input()
1648
- ], SelectComponent.prototype, "optionDisplayExtra", void 0);
1649
- __decorate([
1650
- Output()
1651
- ], SelectComponent.prototype, "valueChange", void 0);
1652
- SelectComponent = __decorate([
1653
- Component({
1654
- selector: 'spa-select',
1655
- template: "\r\n<mat-form-field *ngIf=\"readonlyMode==''\" style=\"padding-right: 20px;\" floatLabel=\"always\" [ngStyle]=\"{'width':width}\">\r\n <mat-label>{{display}}</mat-label>\r\n <mat-select [(value)]=\"value\" (selectionChange)=\"changed()\" [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",
1656
- styles: [""]
1657
- })
1658
- ], SelectComponent);
1659
-
1660
- let CheckComponent = class CheckComponent {
1661
- constructor() {
1662
- this.readonly = false;
1663
- this.display = "";
1664
- this.value = false;
1665
- this.valueChange = new EventEmitter();
1666
- this.click = new EventEmitter();
1667
- this.check = new EventEmitter();
1668
- this.uncheck = new EventEmitter();
1669
- }
1670
- ngOnInit() {
1671
- }
1672
- changed() {
1673
- this.valueChange.emit(this.value);
1674
- }
1675
- clicked() {
1676
- this.click.emit();
1677
- if (!this.value) {
1678
- this.checked();
1679
- }
1680
- else {
1681
- this.unchecked();
1682
- }
1683
- }
1684
- checked() {
1685
- this.check.emit();
1686
- }
1687
- unchecked() {
1688
- this.uncheck.emit();
1689
- }
1690
- };
1691
- __decorate([
1692
- Input()
1693
- ], CheckComponent.prototype, "readonly", void 0);
1694
- __decorate([
1695
- Input()
1696
- ], CheckComponent.prototype, "display", void 0);
1697
- __decorate([
1698
- Input()
1699
- ], CheckComponent.prototype, "value", void 0);
1700
- __decorate([
1701
- Output()
1702
- ], CheckComponent.prototype, "valueChange", void 0);
1703
- __decorate([
1704
- Output()
1705
- ], CheckComponent.prototype, "click", void 0);
1706
- __decorate([
1707
- Output()
1708
- ], CheckComponent.prototype, "check", void 0);
1709
- __decorate([
1710
- Output()
1711
- ], CheckComponent.prototype, "uncheck", void 0);
1712
- CheckComponent = __decorate([
1713
- Component({
1714
- selector: 'spa-check',
1715
- 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",
1716
- styles: [""]
1717
- })
1718
- ], CheckComponent);
1719
-
1720
- let AttachComponent = class AttachComponent {
1721
- constructor() {
1722
- this.message = "Drag and drop files here";
1723
- this.files = [];
1724
- this.filesChange = new EventEmitter();
1725
- this.upload = new EventEmitter();
1726
- this.enableUpload = false;
1727
- }
1728
- ngOnInit() {
1729
- }
1730
- /**
1731
- * on file drop handler
1732
- */
1733
- onFileDropped($event) {
1734
- this.prepareFilesList($event);
1735
- }
1736
- /**
1737
- * handle file from browsing
1738
- */
1739
- fileBrowseHandler(files) {
1740
- this.prepareFilesList(files);
1741
- }
1742
- /**
1743
- * Delete file from files list
1744
- * @param index (File index)
1745
- */
1746
- deleteFile(index) {
1747
- this.files.splice(index, 1);
1748
- }
1749
- /**
1750
- * Simulate the upload process
1751
- */
1752
- // uploadFilesSimulator(index: number) {
1753
- // setTimeout(() => {
1754
- // if (index === this.files.length) {
1755
- // return;
1756
- // } else {
1757
- // const progressInterval = setInterval(() => {
1758
- // if (this.files[index].progress === 100) {
1759
- // clearInterval(progressInterval);
1760
- // this.uploadFilesSimulator(index + 1);
1761
- // } else {
1762
- // this.files[index].progress += 5;
1763
- // }
1764
- // }, 200);
1765
- // }
1766
- // }, 1000);
1767
- // }
1768
- /**
1769
- * Convert Files list to normal array list
1770
- * @param files (Files List)
1771
- */
1772
- prepareFilesList(files) {
1773
- for (const item of files) {
1774
- item.progress = 0;
1775
- this.files.push(item);
1776
- }
1777
- // this.uploadFilesSimulator(0);
1778
- }
1779
- /**
1780
- * format bytes
1781
- * @param bytes (File size in bytes)
1782
- * @param decimals (Decimals point)
1783
- */
1784
- formatBytes(bytes, decimals) {
1785
- if (bytes === 0) {
1786
- return '0 Bytes';
1787
- }
1788
- const k = 1024;
1789
- const dm = decimals <= 0 ? 0 : decimals || 2;
1790
- const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
1791
- const i = Math.floor(Math.log(bytes) / Math.log(k));
1792
- return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];
1793
- }
1794
- uploaded() {
1795
- this.upload.emit();
1796
- }
1797
- filesChanged() {
1798
- this.filesChange.emit(this.files);
1799
- }
1800
- };
1801
- __decorate([
1802
- Input()
1803
- ], AttachComponent.prototype, "message", void 0);
1804
- __decorate([
1805
- Input()
1806
- ], AttachComponent.prototype, "files", void 0);
1807
- __decorate([
1808
- Output()
1809
- ], AttachComponent.prototype, "filesChange", void 0);
1810
- __decorate([
1811
- Output()
1812
- ], AttachComponent.prototype, "upload", void 0);
1813
- __decorate([
1814
- Input()
1815
- ], AttachComponent.prototype, "enableUpload", void 0);
1816
- AttachComponent = __decorate([
1817
- Component({
1818
- selector: 'spa-attach',
1819
- 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.target.files)\" />\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",
1820
- styles: [".container{width:100%;height:200px;padding:2rem;text-align:center;border:2px dashed #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{-webkit-animation:1s infinite shake;animation:1s infinite shake}.files-list{margin-top:1.5rem}.files-list .single-file{display:flex;padding:.5rem;justify-content:space-between;align-items:center;border:1px dashed #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 0 0 1rem}.files-list .single-file .info{width:100%}@-webkit-keyframes shake{0%{transform:translate(1px,1px) rotate(0)}10%{transform:translate(-1px,-2px) rotate(-1deg)}20%{transform:translate(-3px,0) 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)}100%{transform:translate(1px,-2px) rotate(-1deg)}}@keyframes shake{0%{transform:translate(1px,1px) rotate(0)}10%{transform:translate(-1px,-2px) rotate(-1deg)}20%{transform:translate(-3px,0) 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)}100%{transform:translate(1px,-2px) rotate(-1deg)}}"]
1821
- })
1822
- ], AttachComponent);
1823
-
1824
- let DatetimeComponent = class DatetimeComponent {
1825
- constructor() {
1826
- this.display = "";
1827
- this.value = "";
1828
- this.valueChange = new EventEmitter();
1829
- this.readonly = false;
1830
- this.min = "01 jan 1900";
1831
- this.max = "31 dec 9999";
1832
- }
1833
- ngOnInit() {
1834
- }
1835
- changed() {
1836
- this.valueChange.emit(this.value);
1837
- }
1838
- };
1839
- __decorate([
1840
- Input()
1841
- ], DatetimeComponent.prototype, "display", void 0);
1842
- __decorate([
1843
- Input()
1844
- ], DatetimeComponent.prototype, "value", void 0);
1845
- __decorate([
1846
- Output()
1847
- ], DatetimeComponent.prototype, "valueChange", void 0);
1848
- __decorate([
1849
- Input()
1850
- ], DatetimeComponent.prototype, "readonly", void 0);
1851
- __decorate([
1852
- Input()
1853
- ], DatetimeComponent.prototype, "min", void 0);
1854
- __decorate([
1855
- Input()
1856
- ], DatetimeComponent.prototype, "max", void 0);
1857
- DatetimeComponent = __decorate([
1858
- Component({
1859
- selector: 'spa-datetime',
1860
- template: "<mat-form-field style=\"width:150px;margin-right:20px\">\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",
1861
- styles: [""]
1862
- })
1863
- ], DatetimeComponent);
1864
-
1865
- // import { CurrencyPipe } from '@angular/common';
1866
- // import { Core } from 'tin-core';
1867
- let MoneyComponent = class MoneyComponent {
1868
- constructor() {
1869
- this.readonly = false;
1870
- this.display = "";
1871
- this.value = "";
1872
- this.valueChange = new EventEmitter();
1873
- this.width = "100%";
1874
- this.hint = "";
1875
- this.currency = "$";
1876
- }
1877
- ngOnInit() {
1878
- }
1879
- ngOnChanges() {
1880
- }
1881
- changed() {
1882
- this.valueChange.emit(this.value);
1883
- }
1884
- };
1885
- __decorate([
1886
- Input()
1887
- ], MoneyComponent.prototype, "readonly", void 0);
1888
- __decorate([
1889
- Input()
1890
- ], MoneyComponent.prototype, "display", void 0);
1891
- __decorate([
1892
- Input()
1893
- ], MoneyComponent.prototype, "value", void 0);
1894
- __decorate([
1895
- Output()
1896
- ], MoneyComponent.prototype, "valueChange", void 0);
1897
- __decorate([
1898
- Input()
1899
- ], MoneyComponent.prototype, "width", void 0);
1900
- __decorate([
1901
- Input()
1902
- ], MoneyComponent.prototype, "hint", void 0);
1903
- __decorate([
1904
- Input()
1905
- ], MoneyComponent.prototype, "currency", void 0);
1906
- MoneyComponent = __decorate([
1907
- Component({
1908
- selector: 'spa-money',
1909
- template: "\r\n<div class=\"tin-input-row\">\r\n\r\n<Label>{{currency}}</Label>\r\n<mat-form-field [hintLabel]=\"hint\" style=\"padding-right: 20px;\" [ngStyle]=\"{'width':width}\" >\r\n <mat-label>{{display}}</mat-label>\r\n <!-- <span>$</span> -->\r\n <input matInput class=\"example-right-align\" autocomplete=\"off\" type=\"number\" min=\"0.00\" step=\"0.01\" [(ngModel)]=\"value \" [placeholder]=\"display\" (change)=\"changed()\" [readonly]=\"readonly\" />\r\n<!-- <span matTextSuffix>.00</span> -->\r\n</mat-form-field>\r\n</div>\r\n\r\n\r\n\r\n\r\n",
1910
- styles: ["input.example-right-align{-moz-appearance:textfield}.example-right-align{text-align:right}input.example-right-align::-webkit-inner-spin-button,input.example-right-align::-webkit-outer-spin-button{display:none}.curr{background-color:red}"]
1911
- })
1912
- ], MoneyComponent);
1913
-
1914
- let DndDirective = class DndDirective {
1915
- constructor() {
1916
- this.fileDropped = new EventEmitter();
1917
- }
1918
- // Dragover listener
1919
- onDragOver(evt) {
1920
- evt.preventDefault();
1921
- evt.stopPropagation();
1922
- this.fileOver = true;
1923
- }
1924
- // Dragleave listener
1925
- onDragLeave(evt) {
1926
- evt.preventDefault();
1927
- evt.stopPropagation();
1928
- this.fileOver = false;
1929
- }
1930
- // Drop listener
1931
- ondrop(evt) {
1932
- evt.preventDefault();
1933
- evt.stopPropagation();
1934
- this.fileOver = false;
1935
- let files = evt.dataTransfer.files;
1936
- if (files.length > 0) {
1937
- this.fileDropped.emit(files);
1938
- }
1939
- }
1940
- };
1941
- __decorate([
1942
- HostBinding('class.fileover')
1943
- ], DndDirective.prototype, "fileOver", void 0);
1944
- __decorate([
1945
- Output()
1946
- ], DndDirective.prototype, "fileDropped", void 0);
1947
- __decorate([
1948
- HostListener('dragover', ['$event'])
1949
- ], DndDirective.prototype, "onDragOver", null);
1950
- __decorate([
1951
- HostListener('dragleave', ['$event'])
1952
- ], DndDirective.prototype, "onDragLeave", null);
1953
- __decorate([
1954
- HostListener('drop', ['$event'])
1955
- ], DndDirective.prototype, "ondrop", null);
1956
- DndDirective = __decorate([
1957
- Directive({
1958
- selector: '[appDnd]'
1959
- })
1960
- ], DndDirective);
1961
-
1962
- let ChipsComponent = class ChipsComponent {
1963
- constructor(messageService) {
1964
- this.messageService = messageService;
1965
- this.icon = "";
1966
- this.removable = false;
1967
- this.addable = false;
1968
- // @Output() chipClick = new EventEmitter();
1969
- this.click = new EventEmitter();
1970
- this.remove = new EventEmitter();
1971
- }
1972
- ngOnInit() {
1973
- }
1974
- clicked(chip) {
1975
- if (typeof chip != 'string') {
1976
- return;
1977
- }
1978
- if (chip) {
1979
- this.click.emit(chip);
1980
- }
1981
- }
1982
- removed(chip) {
1983
- // const index = this.chips.indexOf(chip);
1984
- // if (index >= 0) {
1985
- // this.chips.splice(index, 1);
1986
- // }
1987
- this.messageService.confirm(`Remove ${chip} ?`).subscribe((result) => {
1988
- if (result == "yes") {
1989
- this.remove.emit(chip);
1990
- }
1991
- ;
1992
- });
1993
- }
1994
- };
1995
- ChipsComponent.ctorParameters = () => [
1996
- { type: MessageService }
1997
- ];
1998
- __decorate([
1999
- Input()
2000
- ], ChipsComponent.prototype, "icon", void 0);
2001
- __decorate([
2002
- Input()
2003
- ], ChipsComponent.prototype, "removable", void 0);
2004
- __decorate([
2005
- Input()
2006
- ], ChipsComponent.prototype, "addable", void 0);
2007
- __decorate([
2008
- Input()
2009
- ], ChipsComponent.prototype, "chips", void 0);
2010
- __decorate([
2011
- Output()
2012
- ], ChipsComponent.prototype, "click", void 0);
2013
- __decorate([
2014
- Output()
2015
- ], ChipsComponent.prototype, "remove", void 0);
2016
- ChipsComponent = __decorate([
2017
- Component({
2018
- selector: 'spa-chips',
2019
- 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",
2020
- styles: [""]
2021
- })
2022
- ], ChipsComponent);
2023
-
2024
- let ActivityComponent = class ActivityComponent {
2025
- constructor() {
2026
- this.notes = new Array();
2027
- this.notesMessage = "Empty";
2028
- this.title = "Notes";
2029
- }
2030
- ngOnInit() {
2031
- }
2032
- };
2033
- __decorate([
2034
- Input()
2035
- ], ActivityComponent.prototype, "notes", void 0);
2036
- __decorate([
2037
- Input()
2038
- ], ActivityComponent.prototype, "title", void 0);
2039
- ActivityComponent = __decorate([
2040
- Component({
2041
- selector: 'spa-activity',
2042
- 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",
2043
- styles: [""]
2044
- })
2045
- ], ActivityComponent);
2046
-
2047
- let OptionComponent = class OptionComponent {
2048
- constructor() {
2049
- this.optionValue = "";
2050
- this.optionDisplay = "";
2051
- this.readonly = false;
2052
- this.value = "";
2053
- this.display = "";
2054
- this.show = false;
2055
- this.valueChange = new EventEmitter();
2056
- this.enterPress = new EventEmitter();
2057
- }
2058
- ngOnInit() {
2059
- this.OGValue = this.value;
2060
- }
2061
- changed() {
2062
- this.valueChange.emit(this.value);
2063
- }
2064
- enterPressed() {
2065
- this.valueChange.emit();
2066
- }
2067
- resetValue() {
2068
- this.value = this.OGValue;
2069
- this.changed();
2070
- }
2071
- };
2072
- __decorate([
2073
- Input()
2074
- ], OptionComponent.prototype, "options", void 0);
2075
- __decorate([
2076
- Input()
2077
- ], OptionComponent.prototype, "optionValue", void 0);
2078
- __decorate([
2079
- Input()
2080
- ], OptionComponent.prototype, "optionDisplay", void 0);
2081
- __decorate([
2082
- Input()
2083
- ], OptionComponent.prototype, "readonly", void 0);
2084
- __decorate([
2085
- Input()
2086
- ], OptionComponent.prototype, "value", void 0);
2087
- __decorate([
2088
- Input()
2089
- ], OptionComponent.prototype, "display", void 0);
2090
- __decorate([
2091
- Input()
2092
- ], OptionComponent.prototype, "show", void 0);
2093
- __decorate([
2094
- Output()
2095
- ], OptionComponent.prototype, "valueChange", void 0);
2096
- __decorate([
2097
- Output()
2098
- ], OptionComponent.prototype, "enterPress", void 0);
2099
- OptionComponent = __decorate([
2100
- Component({
2101
- selector: 'spa-option',
2102
- 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",
2103
- styles: [""]
2104
- })
2105
- ], OptionComponent);
2106
-
2107
- let LabelComponent = class LabelComponent {
2108
- constructor() {
2109
- this.display = "";
2110
- this.value = "";
2111
- this.format = "text";
2112
- }
2113
- ngOnInit() {
2114
- }
2115
- };
2116
- __decorate([
2117
- Input()
2118
- ], LabelComponent.prototype, "display", void 0);
2119
- __decorate([
2120
- Input()
2121
- ], LabelComponent.prototype, "value", void 0);
2122
- __decorate([
2123
- Input()
2124
- ], LabelComponent.prototype, "format", void 0);
2125
- LabelComponent = __decorate([
2126
- Component({
2127
- selector: 'spa-label',
2128
- 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",
2129
- styles: [""]
2130
- })
2131
- ], LabelComponent);
2132
-
2133
- const ɵ0$1 = { displayDefaultIndicatorType: false };
2134
- let StepsComponent = class StepsComponent {
2135
- constructor() {
2136
- this.value = "";
2137
- }
2138
- ngOnInit() {
2139
- }
2140
- ngAfterViewInit() {
2141
- }
2142
- ngOnChanges() {
2143
- this.pushSteps();
2144
- }
2145
- setStepper() {
2146
- if (this.value == "")
2147
- return;
2148
- this.stepper.selectedIndex = 0;
2149
- switch (this.value) {
2150
- case "Draft":
2151
- this.stepper.selectedIndex = 0;
2152
- break;
2153
- case "Head Approval":
2154
- this.pushStepper(1);
2155
- break;
2156
- case "CE Approval":
2157
- this.pushStepper(2);
2158
- break;
2159
- case "Booking":
2160
- this.pushStepper(3);
2161
- break;
2162
- case "BTA Approval":
2163
- this.pushStepper(4);
2164
- break;
2165
- case "Travel":
2166
- this.pushStepper(5);
2167
- break;
2168
- case "BTR Approval":
2169
- this.pushStepper(6);
2170
- break;
2171
- case "Travel Closure":
2172
- this.pushStepper(7);
2173
- break;
2174
- }
2175
- }
2176
- pushStepper(count) {
2177
- for (let index = 0; index < count + 1; index++) {
2178
- // const element = array[index];
2179
- this.stepper.selectedIndex = index;
2180
- }
2181
- }
2182
- pushSteps() {
2183
- if (this.steps.length == 0)
2184
- return;
2185
- if (this.value == "")
2186
- return;
2187
- this.stepper.selectedIndex = 0;
2188
- let i = 0;
2189
- for (let step of this.steps) {
2190
- if (step.name != this.value) {
2191
- this.stepper.selectedIndex = i;
2192
- i++;
2193
- }
2194
- else {
2195
- this.stepper.selectedIndex = i;
2196
- break;
2197
- }
2198
- }
2199
- }
2200
- };
2201
- __decorate([
2202
- ViewChild('stepper')
2203
- ], StepsComponent.prototype, "stepper", void 0);
2204
- __decorate([
2205
- Input()
2206
- ], StepsComponent.prototype, "value", void 0);
2207
- __decorate([
2208
- Input()
2209
- ], StepsComponent.prototype, "steps", void 0);
2210
- StepsComponent = __decorate([
2211
- Component({
2212
- selector: 'spa-steps',
2213
- 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",
2214
- providers: [{
2215
- provide: STEPPER_GLOBAL_OPTIONS, useValue: ɵ0$1
2216
- }],
2217
- styles: [".transparent{background-color:rgba(0,0,0,0)}: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}"]
2218
- })
2219
- ], StepsComponent);
2220
-
2221
- let FilterComponent = class FilterComponent {
2222
- constructor() {
2223
- this.data = new MatTableDataSource();
2224
- this.refreshClick = new EventEmitter();
2225
- this._filterText = "";
2226
- }
2227
- ngOnInit() {
2228
- }
2229
- ngOnChanges() {
2230
- // console.log("OnChange")
2231
- this.applyFilter(this._filterText);
2232
- }
2233
- ;
2234
- applyFilter(filterValue) {
2235
- if (this.data) {
2236
- this.data.filter = filterValue.trim().toLowerCase();
2237
- }
2238
- }
2239
- refreshClicked() {
2240
- this.refreshClick.emit();
2241
- }
2242
- };
2243
- __decorate([
2244
- Input()
2245
- ], FilterComponent.prototype, "data", void 0);
2246
- __decorate([
2247
- Output()
2248
- ], FilterComponent.prototype, "refreshClick", void 0);
2249
- FilterComponent = __decorate([
2250
- Component({
2251
- selector: 'spa-filter',
2252
- template: "<mat-form-field style=\"font-size:12px\">\r\n <mat-label>Filter</mat-label>\r\n <input id=\"txtFilter\" matInput [(ngModel)]=\"_filterText\" (keyup)=\"applyFilter($event.target.value)\" 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\"><mat-icon class=\"refreshIcon\">refresh</mat-icon></button>\r\n",
2253
- 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}"]
2254
- })
2255
- ], FilterComponent);
2256
-
2257
- let TinSpaModule = class TinSpaModule {
2258
- };
2259
- TinSpaModule = __decorate([
2260
- NgModule({
2261
- declarations: [DndDirective, TinSpaComponent, messageDialog, NavMenuComponent, LoaderComponent,
2262
- TimeoutComponent, TableComponent, TilesComponent, DateComponent, TextComponent,
2263
- SelectComponent, CheckComponent, AttachComponent, DatetimeComponent,
2264
- MoneyComponent,
2265
- ChipsComponent,
2266
- ActivityComponent, OptionComponent, LabelComponent, StepsComponent, FilterComponent],
2267
- entryComponents: [messageDialog],
2268
- imports: [
2269
- ReactiveFormsModule.withConfig({ warnOnNgModelWithFormControl: "never" }),
2270
- CommonModule,
2271
- FormsModule,
2272
- ReactiveFormsModule,
2273
- SpaMatModule,
2274
- MomentModule,
2275
- // NgxDocViewerModule,
2276
- // AngularEditorModule,
2277
- NgIdleKeepaliveModule.forRoot()
2278
- ],
2279
- exports: [
2280
- CommonModule,
2281
- FormsModule,
2282
- SpaMatModule,
2283
- TinSpaComponent,
2284
- messageDialog,
2285
- NavMenuComponent,
2286
- LoaderComponent,
2287
- TimeoutComponent,
2288
- TableComponent,
2289
- TilesComponent,
2290
- DateComponent,
2291
- SelectComponent,
2292
- TextComponent,
2293
- DatetimeComponent,
2294
- CheckComponent,
2295
- AttachComponent,
2296
- MoneyComponent,
2297
- ChipsComponent,
2298
- ActivityComponent,
2299
- OptionComponent,
2300
- LabelComponent,
2301
- StepsComponent,
2302
- FilterComponent
2303
- ],
2304
- providers: [
2305
- { provide: HTTP_INTERCEPTORS, useClass: LoaderInterceptor, multi: true },
2306
- { provide: LocationStrategy, useClass: HashLocationStrategy }
2307
- ],
2308
- })
2309
- ], TinSpaModule);
2310
-
2311
- let LoginComponent = class LoginComponent {
2312
- constructor(httpService, storageService, router, messageService, dataService, authService, logService, route) {
2313
- this.httpService = httpService;
2314
- this.storageService = storageService;
2315
- this.router = router;
2316
- this.messageService = messageService;
2317
- this.dataService = dataService;
2318
- this.authService = authService;
2319
- this.logService = logService;
2320
- this.route = route;
2321
- this.user = new User();
2322
- this.hide = true;
2323
- this.isProcessing = false;
2324
- this.appConfig = new AppConfig();
2325
- }
2326
- ngOnInit() {
2327
- this.authService.Updateloggedin(false);
2328
- this.authService.UpdateRole(null);
2329
- this.storageService.clear();
2330
- this.dataService.appConfigObserv.subscribe(x => this.appConfig = x);
2331
- if (this.route.snapshot.queryParams.redirectTo != undefined) {
2332
- this.redirectPath = this.route.snapshot.queryParams.redirectTo;
2333
- }
2334
- else {
2335
- this.redirectPath = "home";
2336
- }
2337
- }
2338
- signup() {
2339
- this.router.navigate(["signup"]);
2340
- }
2341
- recoverAccount() {
2342
- this.router.navigate(["recover-account"]);
2343
- }
2344
- login() {
2345
- if (this.user.userName == "" || this.user.password == "") {
2346
- this.messageService.toast("Please enter your credentials");
2347
- return;
2348
- }
2349
- this.logService.info("logging in");
2350
- this.isProcessing = true;
2351
- this.user.userName = this.user.userName;
2352
- this.dataService.Login(this.user).subscribe((apiResponse) => {
2353
- this.isProcessing = false;
2354
- if (apiResponse.success) {
2355
- if (apiResponse.data.authType == 'local' && !this.appConfig.localAuth) {
2356
- this.messageService.toast("Contact Admin: Authentication Type error");
2357
- return;
2358
- }
2359
- if (apiResponse.data.authType == 'AD' && !this.appConfig.ADAuth) {
2360
- this.messageService.toast("Contact Admin: Authentication Type error");
2361
- return;
2362
- }
2363
- this.authService.Updateloggedin(true);
2364
- this.authService.UpdateToken(apiResponse.data.token);
2365
- this.storageService.store(Constants.AUTH_TOKEN, apiResponse.data.token);
2366
- this.authService.UpdateTokenExpire(apiResponse.data.expiration);
2367
- this.storageService.store(Constants.AUTH_TOKEN_EXPIRE, apiResponse.data.expiration);
2368
- this.authService.UpdateCurrentUser(this.user.userName);
2369
- this.storageService.store(Constants.AUTH_USER, this.user.userName);
2370
- this.authService.updateLoggedUserFullName(apiResponse.data.firstName);
2371
- this.storageService.store(Constants.AUTH_NAME, apiResponse.data.firstName);
2372
- this.authService.UpdateRole(apiResponse.data.role);
2373
- this.storageService.store(Constants.AUTH_ROLES, JSON.stringify(apiResponse.data.role));
2374
- this.logService.info("logged in");
2375
- if (apiResponse.data.changePassword == true && apiResponse.data.authType == 'local') {
2376
- this.router.navigate(["home/user/change-password"], {
2377
- queryParams: { redirectTo: this.redirectPath },
2378
- queryParamsHandling: 'merge',
2379
- skipLocationChange: false
2380
- });
2381
- return;
2382
- }
2383
- this.router.navigate([this.redirectPath]);
2384
- }
2385
- else {
2386
- this.messageService.toast("Error: " + apiResponse.message);
2387
- this.user.password = "";
2388
- }
2389
- }, (error) => {
2390
- this.isProcessing = false;
2391
- this.messageService.toast(this.httpService.Error(error));
2392
- });
2393
- }
2394
- };
2395
- LoginComponent.ctorParameters = () => [
2396
- { type: HttpService },
2397
- { type: StorageService },
2398
- { type: Router },
2399
- { type: MessageService },
2400
- { type: DataServiceLib },
2401
- { type: AuthService },
2402
- { type: LogService },
2403
- { type: ActivatedRoute }
2404
- ];
2405
- LoginComponent = __decorate([
2406
- Component({
2407
- selector: "spa-login",
2408
- template: "\r\n <div 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=\"height:100px;margin-right:3em;margin-left:3em\" />\r\n <img *ngIf=\"appConfig.logoSize=='medium'\" [src]=\"appConfig.logo\" style=\"height:150px;margin-right:3em;margin-left:3em\" />\r\n <img *ngIf=\"appConfig.logoSize=='large'\" [src]=\"appConfig.logo\" style=\"height: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\" 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",
2409
- styles: [".login-page{position:absolute;top:0;left:0;right:0;bottom:0;overflow:auto}.tin-bg-login{background-image:url(~/assets/login-bg.jpg);background-size:100%}"]
2410
- })
2411
- ], LoginComponent);
2412
-
2413
- let SignupComponent = class SignupComponent {
2414
- constructor(httpService, messageService, dataService, authService) {
2415
- this.httpService = httpService;
2416
- this.messageService = messageService;
2417
- this.dataService = dataService;
2418
- this.authService = authService;
2419
- this.isProcessing = false;
2420
- this.user = new User();
2421
- this.profile = new Profile();
2422
- this.account = new Account();
2423
- }
2424
- ngOnInit() {
2425
- this.account.user = this.user;
2426
- this.account.profile = this.profile;
2427
- }
2428
- create() {
2429
- this.profile.userName = this.user.userName;
2430
- this.isProcessing = true;
2431
- this.dataService.RegisterAccount(this.account).subscribe((apiResponse) => {
2432
- this.isProcessing = false;
2433
- if (apiResponse.message == "success") {
2434
- this.messageService.toast("Account Created");
2435
- this.user = new User();
2436
- this.profile = new Profile();
2437
- }
2438
- else {
2439
- this.messageService.toast("Error: " + apiResponse.message);
2440
- }
2441
- }, (error) => {
2442
- this.isProcessing = false;
2443
- this.messageService.toast(this.httpService.Error(error));
2444
- });
2445
- }
2446
- };
2447
- SignupComponent.ctorParameters = () => [
2448
- { type: HttpService },
2449
- { type: MessageService },
2450
- { type: DataServiceLib },
2451
- { type: AuthService }
2452
- ];
2453
- SignupComponent = __decorate([
2454
- Component({
2455
- selector: 'spa-signup',
2456
- template: "\r\n<h4 style=\"margin-top: 1em;\">Signup</h4>\r\n\r\n<hr/>\r\nComplete the form below.\r\n\r\n<div class=\"d-flex justify-content-center row align-items-center\">\r\n\r\n <div class=\"tin-input\" style=\"font-size:14px; width: 50%;\">\r\n\r\n\r\n <div class=\"tin-input-row\">\r\n\r\n <div class=\"col\">\r\n\r\n <mat-form-field style=\"width:100%\">\r\n <mat-label>FirstName</mat-label>\r\n <input matInput autocomplete=\"off\" [(ngModel)]=\"account.profile.firstName\" placeholder=\"Enter FirstName\" />\r\n </mat-form-field>\r\n\r\n </div>\r\n\r\n <div class=\"col\">\r\n\r\n <mat-form-field style=\"width:100%\">\r\n <mat-label>LastName</mat-label>\r\n <input matInput autocomplete=\"off\" [(ngModel)]=\"profile.lastName\" placeholder=\"Enter LastName\" />\r\n </mat-form-field>\r\n\r\n </div>\r\n\r\n\r\n </div>\r\n\r\n <div class=\"tin-input-row mt-3\">\r\n\r\n <div class=\"col-6\">\r\n\r\n <mat-form-field style=\"width:100%\">\r\n <mat-label>userName</mat-label>\r\n <input matInput autocomplete=\"off\" [(ngModel)]=\"user.userName\" placeholder=\"Enter userName\" />\r\n </mat-form-field>\r\n </div>\r\n\r\n\r\n </div>\r\n\r\n <div class=\"tin-input-row\">\r\n\r\n <div class=\"col\">\r\n\r\n <mat-form-field style=\"width:100%\">\r\n <mat-label>Password</mat-label>\r\n <input matInput autocomplete=\"off\" type=\"password\" [(ngModel)]=\"user.password\" placeholder=\"Enter Password\" />\r\n </mat-form-field>\r\n\r\n </div>\r\n\r\n <div class=\"col\">\r\n\r\n <mat-form-field style=\"width:100%\">\r\n <mat-label>Confirm Password</mat-label>\r\n <input matInput autocomplete=\"off\" type=\"password\" [(ngModel)]=\"confirmPassword\" placeholder=\"Enter Confirm Password\" />\r\n </mat-form-field>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n\r\n\r\n\r\n <div class=\"tin-input-row mt-3\">\r\n <button 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\r\n</div>\r\n\r\n",
2457
- styles: [""]
2458
- })
2459
- ], SignupComponent);
2460
-
2461
- let RecoverAccountComponent = class RecoverAccountComponent {
2462
- constructor(location, dataService, authService, messageService) {
2463
- this.location = location;
2464
- this.dataService = dataService;
2465
- this.authService = authService;
2466
- this.messageService = messageService;
2467
- this.userName = "";
2468
- }
2469
- ngOnInit() {
2470
- }
2471
- recover() {
2472
- if (this.userName == "") {
2473
- this.messageService.toast("Please enter your userName");
2474
- return;
2475
- }
2476
- else {
2477
- let u = new User();
2478
- u.userName = this.userName;
2479
- this.dataService.SelfReset(u).subscribe((apiResponse) => {
2480
- if (apiResponse.message == "success") {
2481
- this.messageService.toast("The password has been sent to your email");
2482
- this.location.back();
2483
- }
2484
- else {
2485
- this.messageService.toast("Error: " + apiResponse.message);
2486
- }
2487
- });
2488
- }
2489
- }
2490
- };
2491
- RecoverAccountComponent.ctorParameters = () => [
2492
- { type: Location },
2493
- { type: DataServiceLib },
2494
- { type: AuthService },
2495
- { type: MessageService }
2496
- ];
2497
- RecoverAccountComponent = __decorate([
2498
- Component({
2499
- selector: 'spa-recover-account',
2500
- template: "<h4 style=\"margin-top: 1em;\">Recover Account</h4>\r\n\r\n<hr/>\r\nSubmit your userName and we will send you details to your registered email address.\r\n\r\n<div class=\"mt-3\" >\r\n\r\n <div class=\"tin-input \" style=\"font-size:14px;\">\r\n\r\n <div class=\"col\">\r\n <spa-text display=\"Username\" [(value)]=\"userName\" ></spa-text>\r\n </div>\r\n\r\n <div class=\"col mt-3\">\r\n <button 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",
2501
- styles: [""]
2502
- })
2503
- ], RecoverAccountComponent);
2504
-
2505
- let SpaIndexModule = class SpaIndexModule {
2506
- };
2507
- SpaIndexModule = __decorate([
2508
- NgModule({
2509
- declarations: [LoginComponent, SignupComponent, RecoverAccountComponent],
2510
- entryComponents: [],
2511
- imports: [
2512
- ReactiveFormsModule.withConfig({ warnOnNgModelWithFormControl: "never" }),
2513
- CommonModule,
2514
- FormsModule,
2515
- ReactiveFormsModule,
2516
- SpaMatModule,
2517
- TinSpaModule
2518
- ],
2519
- exports: [
2520
- CommonModule,
2521
- FormsModule,
2522
- SpaMatModule,
2523
- LoginComponent,
2524
- SignupComponent,
2525
- RecoverAccountComponent,
2526
- ],
2527
- })
2528
- ], SpaIndexModule);
2529
-
2530
- let ChangePasswordComponent = class ChangePasswordComponent {
2531
- constructor(router, location, httpService, messageService, dataService, authService, route) {
2532
- this.router = router;
2533
- this.location = location;
2534
- this.httpService = httpService;
2535
- this.messageService = messageService;
2536
- this.dataService = dataService;
2537
- this.authService = authService;
2538
- this.route = route;
2539
- this.isProcessing = false;
2540
- this.changePassword = new ChangeUserPassword();
2541
- }
2542
- ngOnInit() {
2543
- this.myRole = this.authService.currentRoleSource.value;
2544
- if (this.dataService.tmpProfileuserName == "") {
2545
- this.changePassword.userName = this.authService.currentUser;
2546
- }
2547
- else {
2548
- this.changePassword.userName = this.dataService.tmpProfileuserName;
2549
- this.dataService.tmpProfileuserName = "";
2550
- }
2551
- if (this.route.snapshot.queryParams.redirectTo != undefined) {
2552
- this.redirectPath = this.route.snapshot.queryParams.redirectTo;
2553
- }
2554
- else {
2555
- this.redirectPath = "home";
2556
- }
2557
- }
2558
- change() {
2559
- if (!this.myRole[this.dataService.capUsers.name]) {
2560
- if (this.changePassword.currentPassword == "") {
2561
- this.messageService.toast("Please enter current Password");
2562
- return;
2563
- }
2564
- }
2565
- if (this.changePassword.newPassword == "") {
2566
- this.messageService.toast("Please enter new Password");
2567
- return;
2568
- }
2569
- if (this.changePassword.confirmPassword == "") {
2570
- this.messageService.toast("Please confirm new Password");
2571
- return;
2572
- }
2573
- if (this.changePassword.confirmPassword != this.changePassword.newPassword) {
2574
- this.messageService.toast("Passwords do not match");
2575
- return;
2576
- }
2577
- this.isProcessing = true;
2578
- if (this.myRole[this.dataService.capUsers.name]) {
2579
- this.dataService.ChangePasswordAdmin(this.changePassword).subscribe((apiResponse) => {
2580
- this.isProcessing = false;
2581
- if (apiResponse.message == "success") {
2582
- this.messageService.toast("Password Changed");
2583
- this.router.navigate([this.redirectPath]);
2584
- }
2585
- else {
2586
- this.messageService.toast("Error: " + apiResponse.message);
2587
- }
2588
- });
2589
- }
2590
- else {
2591
- this.dataService.ChangePassword(this.changePassword).subscribe((apiResponse) => {
2592
- this.isProcessing = false;
2593
- if (apiResponse.message == "success") {
2594
- this.messageService.toast("Password Changed");
2595
- this.router.navigate([this.redirectPath]);
2596
- }
2597
- else {
2598
- this.messageService.toast("Error: " + apiResponse.message);
2599
- }
2600
- });
2601
- }
2602
- }
2603
- };
2604
- ChangePasswordComponent.ctorParameters = () => [
2605
- { type: Router },
2606
- { type: Location },
2607
- { type: HttpService },
2608
- { type: MessageService },
2609
- { type: DataServiceLib },
2610
- { type: AuthService },
2611
- { type: ActivatedRoute }
2612
- ];
2613
- ChangePasswordComponent = __decorate([
2614
- Component({
2615
- selector: 'spa-change-password',
2616
- template: "<h4>Change Password</h4>\r\n<hr>\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",
2617
- styles: [""]
2618
- })
2619
- ], ChangePasswordComponent);
2620
-
2621
- let ProfileComponent = class ProfileComponent {
2622
- constructor(dataService, messageService, httpService, router, authService) {
2623
- this.dataService = dataService;
2624
- this.messageService = messageService;
2625
- this.httpService = httpService;
2626
- this.router = router;
2627
- this.authService = authService;
2628
- this.appConfig = new AppConfig();
2629
- this.selfProfile = false;
2630
- this.profile = new Profile();
2631
- }
2632
- ngOnInit() {
2633
- this.myRole = this.authService.currentRoleSource.value;
2634
- if (this.dataService.tmpProfileuserName == "") {
2635
- this.loadProfile(this.authService.currentUser);
2636
- }
2637
- else {
2638
- this.loadProfile(this.dataService.tmpProfileuserName);
2639
- this.dataService.tmpProfileuserName = "";
2640
- }
2641
- }
2642
- loadProfile(userName) {
2643
- let action = "all";
2644
- this.dataService.GetUserByID(userName).subscribe((apiResponse) => {
2645
- this.profile = apiResponse[0];
2646
- if (this.profile.userName.toLocaleLowerCase() == this.authService.currentUser.toLocaleLowerCase()) {
2647
- this.selfProfile = true;
2648
- }
2649
- this.loadRoles();
2650
- console.log(this.profile);
2651
- }, (error) => {
2652
- this.isProcessing = false;
2653
- this.messageService.toast(this.httpService.Error(error));
2654
- });
2655
- }
2656
- loadRoles() {
2657
- this.dataService.GetRole("all", "").subscribe((apiResponse) => {
2658
- this.roles = apiResponse;
2659
- console.log(this.roles);
2660
- }, (error) => {
2661
- this.isProcessing = false;
2662
- this.messageService.toast(this.httpService.Error(error));
2663
- });
2664
- }
2665
- changePassword() {
2666
- this.dataService.tmpProfileuserName = this.profile.userName;
2667
- this.router.navigate(["home/user/change-password"]);
2668
- }
2669
- gotoUsers() {
2670
- this.router.navigate(["home/admin/users"]);
2671
- }
2672
- update() {
2673
- }
2674
- updateProfile() {
2675
- this.isProcessing = true;
2676
- // console.log(this.profile)
2677
- // return
2678
- this.dataService.UpdateUser(this.profile).subscribe((apiResponse) => {
2679
- this.isProcessing = false;
2680
- if (apiResponse.success) {
2681
- this.messageService.toast("Profile Updated");
2682
- }
2683
- else {
2684
- this.messageService.toast("Error: " + apiResponse.message);
2685
- }
2686
- }, (error) => {
2687
- this.messageService.toast("Connection failed ");
2688
- this.isProcessing = false;
2689
- });
2690
- }
2691
- };
2692
- ProfileComponent.ctorParameters = () => [
2693
- { type: DataServiceLib },
2694
- { type: MessageService },
2695
- { type: HttpService },
2696
- { type: Router },
2697
- { type: AuthService }
2698
- ];
2699
- __decorate([
2700
- Input()
2701
- ], ProfileComponent.prototype, "appConfig", void 0);
2702
- ProfileComponent = __decorate([
2703
- Component({
2704
- selector: 'spa-profile',
2705
- template: "\r\n<div class=\"container\">\r\n\r\n <div class=\"row mt-3\" style=\"font-size:14px;\">\r\n\r\n <div class=\"col-2 mt-3 \">\r\n\r\n <div class=\"tin-input\">\r\n\r\n <div class=\"col\">\r\n <mat-icon style=\"font-size: 70px;\">account_circle</mat-icon>\r\n <!-- <img style=\"height: 40px\"> -->\r\n </div>\r\n\r\n <div class=\"col\">\r\n <mat-label id=\"lbluserName\" style=\"font-size: 14px;\">{{profile?.userName}}</mat-label>\r\n </div>\r\n\r\n\r\n </div>\r\n\r\n\r\n\r\n </div>\r\n\r\n <div class=\"col-8 mt-3\">\r\n\r\n <div class=\"tin-input\" style=\"width: 70%;\">\r\n\r\n <div class=\"tin-input-row\">\r\n\r\n\r\n <div class=\"col\">\r\n <spa-text id=\"txtFirstName\" display=\"First Name\" [(value)]=\"profile.firstName\" [readonly]=\"selfProfile\"></spa-text>\r\n </div>\r\n\r\n <div class=\"col\">\r\n <spa-text id=\"txtLastName\" display=\"Last Name\" [(value)]=\"profile.lastName\" [readonly]=\"selfProfile\"></spa-text>\r\n </div>\r\n\r\n </div>\r\n\r\n <div class=\"col\">\r\n <spa-text id=\"txtAuth\" display=\"Authentication\" [(value)]=\"profile.authType\" [readonly]=\"true\"></spa-text>\r\n </div>\r\n\r\n <div class=\"col\">\r\n <spa-text id=\"txtEmail\" display=\"Email\" [(value)]=\"profile.email\" [readonly]=\"selfProfile\"></spa-text>\r\n </div>\r\n\r\n <div class=\"col\">\r\n <spa-select id=\"cboRole\" display=\"Role\" [options]=\"roles\" optionDisplay=\"roleName\" optionValue=\"roleID\" [(value)]=\"profile.roleID\" [readonly]=\"selfProfile\"></spa-select>\r\n </div>\r\n\r\n\r\n <div class=\"tin-input-row mt-2\">\r\n <button id=\"btnUpdate\" mat-raised-button color=\"primary\" *ngIf=\"!selfProfile\" [disabled]=\"isProcessing\" (click)=\"updateProfile()\" >Update Profile</button>\r\n </div>\r\n\r\n\r\n </div>\r\n\r\n\r\n </div>\r\n\r\n <div class=\"col-2 mt-4\">\r\n\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\r\n </div>\r\n\r\n </div>\r\n\r\n</div>\r\n\r\n\r\n\r\n",
2706
- styles: [""]
2707
- })
2708
- ], ProfileComponent);
2709
-
2710
- let SpaUserModule = class SpaUserModule {
2711
- };
2712
- SpaUserModule = __decorate([
2713
- NgModule({
2714
- declarations: [ChangePasswordComponent, ProfileComponent],
2715
- entryComponents: [],
2716
- imports: [
2717
- ReactiveFormsModule.withConfig({ warnOnNgModelWithFormControl: "never" }),
2718
- CommonModule,
2719
- FormsModule,
2720
- ReactiveFormsModule,
2721
- SpaMatModule,
2722
- TinSpaModule
2723
- ],
2724
- exports: [
2725
- CommonModule,
2726
- FormsModule,
2727
- SpaMatModule,
2728
- ChangePasswordComponent,
2729
- ProfileComponent,
2730
- ],
2731
- })
2732
- ], SpaUserModule);
2733
-
2734
- // import { ApiResponse } from 'tin-core';
2735
- let SettingsComponent = class SettingsComponent {
2736
- constructor(dataService, messageService) {
2737
- this.dataService = dataService;
2738
- this.messageService = messageService;
2739
- this._filterText = "";
2740
- this.isProcessing = false;
2741
- }
2742
- ngOnInit() {
2743
- this.loadSettings();
2744
- }
2745
- applyFilter(filterValue) {
2746
- this.settings.filter = filterValue.trim().toLowerCase();
2747
- }
2748
- loadSettings() {
2749
- this.dataService.GetSetting("all", "").subscribe((apiResponse) => {
2750
- this.settings = apiResponse;
2751
- });
2752
- }
2753
- updateSetting(setting) {
2754
- this.isProcessing = true;
2755
- this.dataService.UpdateSetting(setting, "edit").subscribe((apiResponse) => {
2756
- this.isProcessing = false;
2757
- if (apiResponse.success) {
2758
- this.messageService.toast(`Setting ${setting.sName} Updated`);
2759
- this.loadSettings();
2760
- }
2761
- else {
2762
- this.messageService.toast("Error: " + apiResponse.message);
2763
- }
2764
- });
2765
- }
2766
- ;
2767
- addSetting() {
2768
- // const dialogRef = this.dialog.open(addRoleDialog, {
2769
- // width: "1100px",
2770
- // data: "",
2771
- // });
2772
- // dialogRef.afterClosed().subscribe((result) => {
2773
- // if (result == "success") {
2774
- // this.loadRoles();
2775
- // }
2776
- // });
2777
- this.messageService.toast("Feature not Available");
2778
- }
2779
- };
2780
- SettingsComponent.ctorParameters = () => [
2781
- { type: DataServiceLib },
2782
- { type: MessageService }
2783
- ];
2784
- SettingsComponent = __decorate([
2785
- Component({
2786
- selector: 'spa-settings',
2787
- 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",
2788
- styles: [".mat-mini-fab{width:32px;height:32px}.mat-mini-fab mat-icon{font-size:16px;margin-top:-3px}"]
2789
- })
2790
- ], SettingsComponent);
2791
-
2792
- let LogsComponent = class LogsComponent {
2793
- constructor(authService, dataService) {
2794
- this.authService = authService;
2795
- this.dataService = dataService;
2796
- this.isProcessing = false;
2797
- this.displayedColumns = ["dateLogged", "userName", "fullName", "source", "details"];
2798
- }
2799
- ngOnInit() {
2800
- this.authService.isAuthorised(this.dataService.capLogs.name);
2801
- this.loadLogs();
2802
- }
2803
- loadLogs() {
2804
- this.dataService.GetLog("all", "").subscribe((apiResponse) => {
2805
- this.logs = new MatTableDataSource(apiResponse);
2806
- this.logs.paginator = this.logsPaginator;
2807
- });
2808
- }
2809
- };
2810
- LogsComponent.ctorParameters = () => [
2811
- { type: AuthService },
2812
- { type: DataServiceLib }
2813
- ];
2814
- __decorate([
2815
- ViewChild("logsPaginator")
2816
- ], LogsComponent.prototype, "logsPaginator", void 0);
2817
- LogsComponent = __decorate([
2818
- Component({
2819
- selector: 'spa-logs',
2820
- 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",
2821
- 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}"]
2822
- })
2823
- ], LogsComponent);
2824
-
2825
- let UsersComponent = class UsersComponent {
2826
- constructor(httpService, router, authService, dataService, dialog, messageService) {
2827
- this.httpService = httpService;
2828
- this.router = router;
2829
- this.authService = authService;
2830
- this.dataService = dataService;
2831
- this.dialog = dialog;
2832
- this.messageService = messageService;
2833
- this.isProcessing = false;
2834
- this._filterText = "";
2835
- this.displayedColumns = ["userName", "fullName", "roleName", "locked", "dateCreated", "Action"];
2836
- }
2837
- ngOnInit() {
2838
- this.authService.isAuthorised(this.dataService.capUsers.name);
2839
- this.UpdateData();
2840
- }
2841
- UpdateData() {
2842
- this.dataService.GetUser().subscribe((apiResponse) => {
2843
- this.users = new MatTableDataSource(apiResponse);
2844
- this.users.paginator = this.usersPaginator;
2845
- this.applyFilter(this._filterText);
2846
- }, (error) => {
2847
- this.isProcessing = false;
2848
- this.messageService.toast(this.httpService.Error(error));
2849
- });
2850
- }
2851
- applyFilter(filterValue) {
2852
- this.users.filter = filterValue.trim().toLowerCase();
2853
- }
2854
- createAccount() {
2855
- this.router.navigate(["home/admin/create-account"]);
2856
- }
2857
- viewProfile(user) {
2858
- this.dataService.tmpProfileuserName = user.userName;
2859
- this.router.navigate(["home/user/profile"]);
2860
- }
2861
- lock(u) {
2862
- let login = { userName: u.userName, password: "Abcdef@123" };
2863
- this.dataService.LockUser(login).subscribe((apiResponse) => {
2864
- if (apiResponse.success) {
2865
- this.messageService.toast("User Locked");
2866
- this.UpdateData();
2867
- }
2868
- else {
2869
- this.messageService.toast("Error: " + apiResponse);
2870
- }
2871
- });
2872
- }
2873
- unlock(u) {
2874
- let login = { userName: u.userName, password: "Abcdef@123" };
2875
- this.dataService.UnlockUser(login).subscribe((apiResponse) => {
2876
- if (apiResponse.success) {
2877
- this.messageService.toast("User Unlocked");
2878
- this.UpdateData();
2879
- }
2880
- else {
2881
- this.messageService.toast("Error: " + apiResponse);
2882
- }
2883
- });
2884
- }
2885
- recover(u) {
2886
- this.dataService.SelfReset(u).subscribe((apiResponse) => {
2887
- if (apiResponse.message == "success") {
2888
- this.messageService.toast("The password has been sent on email");
2889
- }
2890
- else {
2891
- this.messageService.toast("Error: " + apiResponse.message);
2892
- }
2893
- });
2894
- }
2895
- deleteUser(user) {
2896
- this.messageService.confirm(`Delete ${user.userName} ?`).subscribe((result) => {
2897
- if (result == "yes") {
2898
- this.isProcessing = true;
2899
- this.dataService.DeleteUser(user).subscribe((apiResponse) => {
2900
- this.isProcessing = false;
2901
- if (apiResponse.message == "success") {
2902
- this.messageService.toast("User Deleted");
2903
- this.UpdateData();
2904
- }
2905
- else {
2906
- this.messageService.toast("Error: " + apiResponse.message);
2907
- }
2908
- }, (error) => {
2909
- this.messageService.toast("Connection failed ");
2910
- this.isProcessing = false;
2911
- });
2912
- }
2913
- });
2914
- }
2915
- };
2916
- UsersComponent.ctorParameters = () => [
2917
- { type: HttpService },
2918
- { type: Router },
2919
- { type: AuthService },
2920
- { type: DataServiceLib },
2921
- { type: MatDialog },
2922
- { type: MessageService }
2923
- ];
2924
- __decorate([
2925
- ViewChild("usersPaginator")
2926
- ], UsersComponent.prototype, "usersPaginator", void 0);
2927
- UsersComponent = __decorate([
2928
- Component({
2929
- selector: "spa-users",
2930
- 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",
2931
- 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}"]
2932
- })
2933
- ], UsersComponent);
2934
-
2935
- let addRoleDialog = class addRoleDialog {
2936
- constructor(messageService, dataService, authService, dialogRef, data) {
2937
- this.messageService = messageService;
2938
- this.dataService = dataService;
2939
- this.authService = authService;
2940
- this.dialogRef = dialogRef;
2941
- this.data = data;
2942
- this.role = new Role();
2943
- }
2944
- ngOnInit() {
2945
- this.capItems = this.data;
2946
- }
2947
- submit() {
2948
- if (this.role.roleName == "New Role" || this.role.roleName == "") {
2949
- this.messageService.toast("Please enter Role Name");
2950
- return;
2951
- }
2952
- this.isProcessing = true;
2953
- this.dataService.PostRole(this.role, "add").subscribe((apiResponse) => {
2954
- this.isProcessing = false;
2955
- if (apiResponse.success) {
2956
- this.messageService.toast("Role Added");
2957
- this.dialogRef.close("success");
2958
- }
2959
- else {
2960
- this.messageService.toast("Error: " + apiResponse.message);
2961
- }
2962
- }, error => {
2963
- this.messageService.toast("Connection failed");
2964
- this.isProcessing = false;
2965
- });
2966
- }
2967
- ;
2968
- };
2969
- addRoleDialog.ctorParameters = () => [
2970
- { type: MessageService },
2971
- { type: DataServiceLib },
2972
- { type: AuthService },
2973
- { type: MatDialogRef },
2974
- { type: undefined, decorators: [{ type: Inject, args: [MAT_DIALOG_DATA,] }] }
2975
- ];
2976
- addRoleDialog = __decorate([
2977
- Component({
2978
- selector: 'app-addRole',
2979
- 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",
2980
- 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}"]
2981
- }),
2982
- __param(4, Inject(MAT_DIALOG_DATA))
2983
- ], addRoleDialog);
2984
- ;
2985
-
2986
- let RolesComponent = class RolesComponent {
2987
- constructor(httpService, router, authService, dataService, dialog, messageService) {
2988
- this.httpService = httpService;
2989
- this.router = router;
2990
- this.authService = authService;
2991
- this.dataService = dataService;
2992
- this.dialog = dialog;
2993
- this.messageService = messageService;
2994
- this.isProcessing = false;
2995
- this.appConfig = new AppConfig();
2996
- }
2997
- ngOnInit() {
2998
- this.authService.isAuthorised(this.dataService.capRoles.name);
2999
- this.loadRoles();
3000
- this.dataService.appConfigObserv.subscribe(x => this.appConfig = x);
3001
- }
3002
- loadRoles() {
3003
- this.dataService.GetRole("all", "").subscribe((apiResponse) => {
3004
- this.roles = apiResponse;
3005
- });
3006
- }
3007
- refresh() {
3008
- this.loadRoles();
3009
- }
3010
- addRole() {
3011
- const dialogRef = this.dialog.open(addRoleDialog, {
3012
- width: "1100px",
3013
- data: this.appConfig.capItems,
3014
- });
3015
- dialogRef.afterClosed().subscribe((result) => {
3016
- if (result == "success") {
3017
- this.loadRoles();
3018
- }
3019
- });
3020
- }
3021
- updateRole(role) {
3022
- this.messageService.confirm(`UPDATE ${role.roleName} ?`).subscribe((result) => {
3023
- if (result == "yes") {
3024
- this.dataService.PostRole(role, "edit").subscribe((apiResponse) => {
3025
- if (apiResponse.success) {
3026
- this.messageService.toast("Role Updated");
3027
- this.loadRoles();
3028
- }
3029
- else {
3030
- this.messageService.toast("Error: " + apiResponse);
3031
- }
3032
- });
3033
- }
3034
- });
3035
- }
3036
- ;
3037
- deleteRole(role) {
3038
- this.messageService.confirm(`DELETE ${role.roleName} ?`).subscribe((result) => {
3039
- if (result == "yes") {
3040
- this.dataService.PostRole(role, "delete").subscribe((apiResponse) => {
3041
- if (apiResponse.success) {
3042
- this.messageService.toast("Role Deleted");
3043
- this.loadRoles();
3044
- }
3045
- else {
3046
- this.messageService.toast("Error: " + apiResponse);
3047
- }
3048
- });
3049
- }
3050
- });
3051
- }
3052
- };
3053
- RolesComponent.ctorParameters = () => [
3054
- { type: HttpService },
3055
- { type: Router },
3056
- { type: AuthService },
3057
- { type: DataServiceLib },
3058
- { type: MatDialog },
3059
- { type: MessageService }
3060
- ];
3061
- RolesComponent = __decorate([
3062
- Component({
3063
- selector: "spa-roles",
3064
- template: "<h4> Roles </h4>\r\n<hr />\r\n\r\n<div class=\"container mb-5\">\r\n\r\n <div class=\"row justify-content-between\" style=\"padding-bottom: 10px;padding-left:10px\">\r\n <div class=\"col-2\">\r\n\r\n <button id=\"btnNewRole\" mat-raised-button color=\"primary\" (click)=\"addRole()\">New Role</button>\r\n </div>\r\n <div class=\"col-1\">\r\n\r\n <button id=\"btnRefresh\" mat-mini-fab color=\"primary\" (click)=\"refresh()\" style=\"margin-right:1em;margin-top:5px\" matTooltip=\"refresh data\" matTooltipPosition=\"right\"><mat-icon class=\"refreshIcon\">refresh</mat-icon></button>\r\n\r\n </div>\r\n </div>\r\n\r\n\r\n <div class=\"row mt-2 mb-1\" style=\"margin-left:10px\" *ngFor=\"let role of roles\">\r\n\r\n <mat-card class=\"mat-elevation-z8\" style=\"width:100%;padding-left:2em\">\r\n\r\n <h4>{{role.roleName}}</h4>\r\n <hr />\r\n\r\n <div class=\"row\" style=\"margin-left: 2em;\">\r\n\r\n\r\n <div class=\"row\" style=\"margin-right:20px;\" *ngFor=\"let capItem of appConfig.capItems\">\r\n\r\n <mat-checkbox color=\"primary\" style=\" font-size:12px; width: 200px;\" [(ngModel)]=\"role[capItem.name]\">{{capItem.display}}</mat-checkbox>\r\n\r\n <div class=\"row\" style=\"margin-right:20px;margin-left: 0px; \" *ngFor=\"let capSubItem of capItem.capSubItems\">\r\n\r\n <mat-checkbox color=\"primary\" style=\" font-size:12px; width: 200px;\" [(ngModel)]=\"role[capSubItem.name]\">{{capSubItem.display}}</mat-checkbox>\r\n\r\n <div class=\"row\" style=\"margin-right:20px;margin-left: 0px;\" *ngFor=\"let capSubSubItem of capSubItem.capSubItems\">\r\n\r\n <mat-checkbox color=\"primary\" style=\"font-size:12px; width: 200px;\" [(ngModel)]=\"role[capSubSubItem.name]\">{{capSubSubItem.display}}</mat-checkbox>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n\r\n <mat-card-actions>\r\n\r\n <button mat-mini-fab color=\"primary\" (click)=\"updateRole(role)\" style=\"margin-right:10px;\">\r\n <mat-icon>done_all</mat-icon>\r\n </button>\r\n\r\n <!-- <button mat-mini-fab color=\"warn\" (click)=\"editRole(role)\" style=\"margin-right:10px\">\r\n <mat-icon>edit</mat-icon>\r\n </button> -->\r\n\r\n <button mat-mini-fab color=\"warn\" (click)=\"deleteRole(role)\" style=\"margin-right:10px\">\r\n <mat-icon>delete</mat-icon>\r\n </button>\r\n\r\n </mat-card-actions>\r\n\r\n </mat-card>\r\n\r\n </div>\r\n\r\n\r\n</div>\r\n\r\n",
3065
- 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}"]
3066
- })
3067
- ], RolesComponent);
3068
-
3069
- let CreateAccountComponent = class CreateAccountComponent {
3070
- constructor(httpService, messageService, dataService, authService, router) {
3071
- this.httpService = httpService;
3072
- this.messageService = messageService;
3073
- this.dataService = dataService;
3074
- this.authService = authService;
3075
- this.router = router;
3076
- this.appConfig = new AppConfig();
3077
- this.isProcessing = false;
3078
- this.register = new Register();
3079
- this.openProfile = true;
3080
- this.authTypes = [
3081
- { name: "Local Authentication", value: "local" },
3082
- { name: "AD Authentication", value: "AD" }
3083
- ];
3084
- }
3085
- ngOnInit() {
3086
- this.appConfig = this.dataService.appConfig;
3087
- }
3088
- create() {
3089
- if (this.register.authType == "") {
3090
- this.messageService.toast("Choose Authentication Type");
3091
- return;
3092
- }
3093
- this.isProcessing = true;
3094
- this.dataService.RegisterAccount(this.register).subscribe((apiResponse) => {
3095
- this.isProcessing = false;
3096
- if (apiResponse.success) {
3097
- this.messageService.toast("Account Created");
3098
- if (this.openProfile) {
3099
- this.viewProfile(this.register.userName);
3100
- }
3101
- else {
3102
- // this.user = new User();
3103
- this.register = new Register();
3104
- this.confirmPassword = "";
3105
- }
3106
- }
3107
- else {
3108
- this.messageService.toast("Error: " + apiResponse.message);
3109
- }
3110
- }, (error) => {
3111
- this.isProcessing = false;
3112
- this.messageService.toast(this.httpService.Error(error));
3113
- });
3114
- }
3115
- viewProfile(userName) {
3116
- this.dataService.tmpProfileuserName = userName;
3117
- this.router.navigate(["home/user/profile"]);
3118
- }
3119
- };
3120
- CreateAccountComponent.ctorParameters = () => [
3121
- { type: HttpService },
3122
- { type: MessageService },
3123
- { type: DataServiceLib },
3124
- { type: AuthService },
3125
- { type: Router }
3126
- ];
3127
- __decorate([
3128
- Input()
3129
- ], CreateAccountComponent.prototype, "appConfig", void 0);
3130
- CreateAccountComponent = __decorate([
3131
- Component({
3132
- selector: 'spa-create-account',
3133
- template: "<h4>Create Account</h4>\r\n\r\n<hr/>\r\n\r\n<div class=\"container\">\r\n\r\n <div class=\"tin-input\" style=\"font-size:14px; width: 70%;\">\r\n\r\n\r\n <div class=\"tin-input-row\">\r\n\r\n <div class=\"col\">\r\n <spa-text id=\"txtFirstName\" display=\"FirstName\" [(value)]=\"register.firstName\"></spa-text>\r\n </div>\r\n\r\n <div class=\"col\">\r\n <spa-text id=\"txtLastName\" display=\"LastName\" [(value)]=\"register.lastName\"></spa-text>\r\n </div>\r\n\r\n </div>\r\n\r\n\r\n <div class=\"tin-input-row mt-3\">\r\n\r\n <div class=\"col\">\r\n <spa-text id=\"txtUserName\" display=\"Username\" [(value)]=\"register.userName\"></spa-text>\r\n </div>\r\n\r\n <div class=\"col\">\r\n <spa-select id=\"cboAuth\" display=\"Authentication Type\" [options]=\"authTypes\" optionDisplay=\"name\" optionValue=\"value\" [(value)]=\"register.authType\" ></spa-select>\r\n </div>\r\n\r\n </div>\r\n\r\n\r\n <div class=\"tin-input-row\" *ngIf=\"register.authType=='local'\">\r\n\r\n <div class=\"col\">\r\n <spa-text id=\"txtPassword\" display=\"Password\" [(value)]=\"register.password\" type=\"password\"></spa-text>\r\n </div>\r\n\r\n <div class=\"col\">\r\n <spa-text id=\"txtConfirmPassword\" display=\"Confirm Password\" [(value)]=\"confirmPassword\" type=\"password\"></spa-text>\r\n </div>\r\n\r\n </div>\r\n\r\n\r\n <div class=\"tin-input-row mt-3\" style=\"margin-left: 1em;\">\r\n <mat-checkbox id=\"cbkOpenAfter\" color=\"primary\" style=\"margin-right:100px; font-size:12px\" [(ngModel)]=\"openProfile\">Open profile after creation</mat-checkbox>\r\n </div>\r\n\r\n <div class=\"tin-input-row mt-3\">\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 </div>\r\n</div>\r\n\r\n",
3134
- styles: [""]
3135
- })
3136
- ], CreateAccountComponent);
3137
-
3138
- let SpaAdminModule = class SpaAdminModule {
3139
- };
3140
- SpaAdminModule = __decorate([
3141
- NgModule({
3142
- declarations: [
3143
- UsersComponent,
3144
- RolesComponent,
3145
- addRoleDialog,
3146
- CreateAccountComponent,
3147
- LogsComponent,
3148
- SettingsComponent
3149
- ],
3150
- entryComponents: [
3151
- addRoleDialog,
3152
- ],
3153
- imports: [
3154
- ReactiveFormsModule.withConfig({ warnOnNgModelWithFormControl: "never" }),
3155
- CommonModule,
3156
- FormsModule,
3157
- ReactiveFormsModule,
3158
- SpaMatModule,
3159
- TinSpaModule
3160
- ],
3161
- exports: [
3162
- CommonModule,
3163
- FormsModule,
3164
- SpaMatModule,
3165
- UsersComponent,
3166
- RolesComponent,
3167
- addRoleDialog,
3168
- CreateAccountComponent,
3169
- LogsComponent,
3170
- SettingsComponent
3171
- ],
3172
- })
3173
- ], SpaAdminModule);
3174
-
3175
- /*
3176
- * Public API Surface of tin-spa
3177
- */
3178
-
3179
- /**
3180
- * Generated bundle index. Do not edit.
3181
- */
3182
-
3183
- export { Account, ActionResponse, ActivityComponent, ApiResponse, AppConfig, AttachComponent, AuthService, CapItem, ChangePasswordComponent, ChangeUserPassword, CheckComponent, ChipsComponent, Color, Condition, Constants, Core, CreateAccountComponent, DataServiceLib, DateComponent, DatetimeComponent, ExportService, FilterComponent, HttpService, Icon, LabelComponent, LoaderComponent, LogLevel, LogService, LoginComponent, LogsComponent, MessageService, MoneyComponent, NavMenuComponent, Operator, OptionComponent, Profile, ProfileComponent, RecoverAccountComponent, Register, Role, RolesComponent, SelectComponent, SettingsComponent, SignupComponent, SpaAdminModule, SpaIndexModule, SpaMatModule, SpaUserModule, Step, StepsComponent, StorageService, TableAction, TableColumn, TableColumnType, TableComponent, TableConfig, TableCreate, TextComponent, Tile, TilesComponent, TimeoutComponent, TinSpaComponent, TinSpaModule, TinSpaService, User, UsersComponent, addRoleDialog, loginConfig, messageDialog, ɵ0, DndDirective as ɵa, LoaderService as ɵb, LoaderInterceptor as ɵc };
3184
- //# sourceMappingURL=tin-spa.js.map