tin-spa 2.13.15 → 9.0.0

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