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