tin-spa 0.0.1

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