@unifylib/ui-lib 1.1.3 → 1.1.5

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 (286) hide show
  1. package/esm2022/iq-ui-lib.mjs +5 -0
  2. package/esm2022/lib/base-model/SearchStrConfig.mjs +11 -0
  3. package/esm2022/lib/base-model/api-response.mjs +2 -0
  4. package/esm2022/lib/base-model/audit-log-entry.mjs +3 -0
  5. package/esm2022/lib/base-model/button-action-settings.mjs +16 -0
  6. package/esm2022/lib/base-model/column-def.model.mjs +28 -0
  7. package/esm2022/lib/base-model/do-action-request.mjs +8 -0
  8. package/esm2022/lib/base-model/field-action.mjs +6 -0
  9. package/esm2022/lib/base-model/field-filter.model.mjs +3 -0
  10. package/esm2022/lib/base-model/field-info.mjs +57 -0
  11. package/esm2022/lib/base-model/field-predicate.model.mjs +10 -0
  12. package/esm2022/lib/base-model/filter-request.mjs +13 -0
  13. package/esm2022/lib/base-model/filter.model.mjs +25 -0
  14. package/esm2022/lib/base-model/get-items-list.mjs +10 -0
  15. package/esm2022/lib/base-model/index.mjs +12 -0
  16. package/esm2022/lib/base-model/items-total.model.mjs +8 -0
  17. package/esm2022/lib/base-model/line-item.model.mjs +11 -0
  18. package/esm2022/lib/base-model/lookupItem.mjs +16 -0
  19. package/esm2022/lib/base-model/page-info.mjs +17 -0
  20. package/esm2022/lib/base-model/report-request.model.mjs +17 -0
  21. package/esm2022/lib/base-model/response-envelop.model.mjs +10 -0
  22. package/esm2022/lib/base-model/snack-message.model.mjs +11 -0
  23. package/esm2022/lib/base-model/table-column.interface.mjs +2 -0
  24. package/esm2022/lib/base-model/table-page-user-action.interface.mjs +21 -0
  25. package/esm2022/lib/base-model/workflow/workflow-steps.model.mjs +9 -0
  26. package/esm2022/lib/base-model/workflow/workflow.model.mjs +42 -0
  27. package/esm2022/lib/components/action-comment/action-comment.component.mjs +101 -0
  28. package/esm2022/lib/components/action-confirmation/action-confirmation.component.mjs +55 -0
  29. package/esm2022/lib/components/activity-report-form/activity-report-form.component.mjs +499 -0
  30. package/esm2022/lib/components/advanced-filter/field-filter/field-filter.component.mjs +41 -0
  31. package/esm2022/lib/components/advanced-filter/filter-builder/filter-builder.component.mjs +162 -0
  32. package/esm2022/lib/components/audit-log-details-dialog/audit-log-details-dialog.component.mjs +70 -0
  33. package/esm2022/lib/components/audit-log-list/audit-log.component.mjs +99 -0
  34. package/esm2022/lib/components/auto-complete/auto-complete.component.mjs +292 -0
  35. package/esm2022/lib/components/base-form/base-form.component.mjs +297 -0
  36. package/esm2022/lib/components/base-form-canvas/base-form-canvas.component.mjs +591 -0
  37. package/esm2022/lib/components/base-input-dialog/base-input-dialog.component.mjs +72 -0
  38. package/esm2022/lib/components/base-table/base-table.component.mjs +514 -0
  39. package/esm2022/lib/components/button-actions/button-actions.component.mjs +70 -0
  40. package/esm2022/lib/components/editable-base-table/editable-base-table.component.mjs +496 -0
  41. package/esm2022/lib/components/equation-builder/equation-builder.component.mjs +112 -0
  42. package/esm2022/lib/components/item-line-editor/item-line-editor.component.mjs +299 -0
  43. package/esm2022/lib/components/multi-auto-complete/multi-auto-complete.component.mjs +278 -0
  44. package/esm2022/lib/components/paginator/paginator.component.mjs +91 -0
  45. package/esm2022/lib/components/report-details-dialog/report-details-dialog.component.mjs +102 -0
  46. package/esm2022/lib/components/report-form/report-form.component.mjs +498 -0
  47. package/esm2022/lib/components/search-bar/search-bar.component.mjs +62 -0
  48. package/esm2022/lib/components/section-form-canvas/section-form-canvas.component.mjs +81 -0
  49. package/esm2022/lib/components/shared/action-button/action-button.component.mjs +59 -0
  50. package/esm2022/lib/components/shared/action-card/action-card.component.mjs +93 -0
  51. package/esm2022/lib/components/shared/attachment-uploader/attachment-uploader.component.mjs +70 -0
  52. package/esm2022/lib/components/shared-list/shared-list.component.mjs +47 -0
  53. package/esm2022/lib/components/snackbar-static/snackbar-static.component.mjs +43 -0
  54. package/esm2022/lib/components/title-bar/title-bar.component.mjs +119 -0
  55. package/esm2022/lib/services/backend-service.mjs +240 -0
  56. package/esm2022/lib/services/index.mjs +4 -0
  57. package/esm2022/lib/services/top-panel.mjs +22 -0
  58. package/esm2022/lib/services/trigger-form.service.mjs +17 -0
  59. package/esm2022/lib/utils/base-utils.mjs +97 -0
  60. package/esm2022/lib/validators/date-range-validator.mjs +27 -0
  61. package/esm2022/lib/validators/index.mjs +4 -0
  62. package/esm2022/lib/validators/match-list.validator.mjs +9 -0
  63. package/esm2022/lib/validators/multi-email-validator.mjs +13 -0
  64. package/esm2022/public-api.mjs +29 -0
  65. package/esm2022/q-btech-ui-lib.mjs +5 -0
  66. package/esm2022/unifylib-ui-lib.mjs +5 -0
  67. package/fesm2022/iq-ui-lib.mjs +5625 -0
  68. package/fesm2022/iq-ui-lib.mjs.map +1 -0
  69. package/fesm2022/q-btech-ui-lib.mjs +5619 -0
  70. package/fesm2022/q-btech-ui-lib.mjs.map +1 -0
  71. package/fesm2022/unifylib-ui-lib.mjs +5625 -0
  72. package/fesm2022/unifylib-ui-lib.mjs.map +1 -0
  73. package/index.d.ts +5 -0
  74. package/lib/base-model/SearchStrConfig.d.ts +8 -0
  75. package/{src/lib/base-model/api-response.ts → lib/base-model/api-response.d.ts} +21 -23
  76. package/lib/base-model/audit-log-entry.d.ts +7 -0
  77. package/lib/base-model/button-action-settings.d.ts +15 -0
  78. package/lib/base-model/column-def.model.d.ts +11 -0
  79. package/lib/base-model/do-action-request.d.ts +10 -0
  80. package/lib/base-model/field-action.d.ts +6 -0
  81. package/lib/base-model/field-filter.model.d.ts +7 -0
  82. package/lib/base-model/field-info.d.ts +53 -0
  83. package/lib/base-model/field-predicate.model.d.ts +7 -0
  84. package/lib/base-model/filter-request.d.ts +15 -0
  85. package/lib/base-model/filter.model.d.ts +22 -0
  86. package/lib/base-model/get-items-list.d.ts +21 -0
  87. package/lib/base-model/index.d.ts +11 -0
  88. package/lib/base-model/items-total.model.d.ts +6 -0
  89. package/lib/base-model/line-item.model.d.ts +9 -0
  90. package/lib/base-model/lookupItem.d.ts +13 -0
  91. package/lib/base-model/page-info.d.ts +52 -0
  92. package/lib/base-model/report-request.model.d.ts +18 -0
  93. package/lib/base-model/response-envelop.model.d.ts +8 -0
  94. package/lib/base-model/snack-message.model.d.ts +7 -0
  95. package/lib/base-model/table-column.interface.d.ts +28 -0
  96. package/lib/base-model/table-page-user-action.interface.d.ts +14 -0
  97. package/lib/base-model/workflow/workflow-steps.model.d.ts +7 -0
  98. package/lib/base-model/workflow/workflow.model.d.ts +13 -0
  99. package/lib/components/action-comment/action-comment.component.d.ts +32 -0
  100. package/lib/components/action-confirmation/action-confirmation.component.d.ts +19 -0
  101. package/lib/components/activity-report-form/activity-report-form.component.d.ts +93 -0
  102. package/lib/components/advanced-filter/field-filter/field-filter.component.d.ts +20 -0
  103. package/lib/components/advanced-filter/filter-builder/filter-builder.component.d.ts +28 -0
  104. package/lib/components/audit-log-details-dialog/audit-log-details-dialog.component.d.ts +25 -0
  105. package/lib/components/audit-log-list/audit-log.component.d.ts +36 -0
  106. package/lib/components/auto-complete/auto-complete.component.d.ts +51 -0
  107. package/lib/components/base-form/base-form.component.d.ts +59 -0
  108. package/lib/components/base-form-canvas/base-form-canvas.component.d.ts +124 -0
  109. package/lib/components/base-input-dialog/base-input-dialog.component.d.ts +23 -0
  110. package/lib/components/base-table/base-table.component.d.ts +128 -0
  111. package/lib/components/button-actions/button-actions.component.d.ts +17 -0
  112. package/lib/components/editable-base-table/editable-base-table.component.d.ts +106 -0
  113. package/lib/components/equation-builder/equation-builder.component.d.ts +23 -0
  114. package/lib/components/item-line-editor/item-line-editor.component.d.ts +64 -0
  115. package/lib/components/multi-auto-complete/multi-auto-complete.component.d.ts +51 -0
  116. package/lib/components/paginator/paginator.component.d.ts +26 -0
  117. package/lib/components/report-details-dialog/report-details-dialog.component.d.ts +34 -0
  118. package/lib/components/report-form/report-form.component.d.ts +92 -0
  119. package/lib/components/search-bar/search-bar.component.d.ts +29 -0
  120. package/lib/components/section-form-canvas/section-form-canvas.component.d.ts +27 -0
  121. package/lib/components/shared/action-button/action-button.component.d.ts +17 -0
  122. package/lib/components/shared/action-card/action-card.component.d.ts +37 -0
  123. package/lib/components/shared/attachment-uploader/attachment-uploader.component.d.ts +16 -0
  124. package/lib/components/shared-list/shared-list.component.d.ts +21 -0
  125. package/lib/components/snackbar-static/snackbar-static.component.d.ts +15 -0
  126. package/lib/components/title-bar/title-bar.component.d.ts +42 -0
  127. package/lib/services/backend-service.d.ts +59 -0
  128. package/{src/lib/services/index.ts → lib/services/index.d.ts} +3 -3
  129. package/lib/services/top-panel.d.ts +8 -0
  130. package/lib/services/trigger-form.service.d.ts +7 -0
  131. package/lib/utils/base-utils.d.ts +13 -0
  132. package/lib/validators/date-range-validator.d.ts +2 -0
  133. package/{src/lib/validators/index.ts → lib/validators/index.d.ts} +3 -3
  134. package/lib/validators/match-list.validator.d.ts +4 -0
  135. package/lib/validators/multi-email-validator.d.ts +6 -0
  136. package/package.json +27 -14
  137. package/{src/public-api.ts → public-api.d.ts} +25 -29
  138. package/ng-package.json +0 -7
  139. package/src/lib/base-model/SearchStrConfig.ts +0 -12
  140. package/src/lib/base-model/audit-log-entry.ts +0 -7
  141. package/src/lib/base-model/button-action-settings.ts +0 -29
  142. package/src/lib/base-model/column-def.model.ts +0 -34
  143. package/src/lib/base-model/do-action-request.ts +0 -11
  144. package/src/lib/base-model/feature-item.ts +0 -9
  145. package/src/lib/base-model/field-action.ts +0 -7
  146. package/src/lib/base-model/field-filter.model.ts +0 -7
  147. package/src/lib/base-model/field-info.ts +0 -102
  148. package/src/lib/base-model/field-predicate.model.ts +0 -7
  149. package/src/lib/base-model/filter-request.ts +0 -27
  150. package/src/lib/base-model/filter.model.ts +0 -49
  151. package/src/lib/base-model/get-items-list.ts +0 -24
  152. package/src/lib/base-model/index.ts +0 -11
  153. package/src/lib/base-model/items-total.model.ts +0 -12
  154. package/src/lib/base-model/line-item.model.ts +0 -18
  155. package/src/lib/base-model/lookupItem.ts +0 -21
  156. package/src/lib/base-model/null-snackmessage.ts +0 -9
  157. package/src/lib/base-model/page-info.ts +0 -54
  158. package/src/lib/base-model/report-request.model.ts +0 -33
  159. package/src/lib/base-model/response-envelop.model.ts +0 -15
  160. package/src/lib/base-model/snack-message.model.ts +0 -14
  161. package/src/lib/base-model/snackmessage-interface.ts +0 -7
  162. package/src/lib/base-model/table-column.interface.ts +0 -29
  163. package/src/lib/base-model/table-page-user-action.interface.ts +0 -33
  164. package/src/lib/base-model/workflow/workflow-steps.model.ts +0 -9
  165. package/src/lib/base-model/workflow/workflow.model.ts +0 -52
  166. package/src/lib/components/action-comment/action-comment.component.css +0 -52
  167. package/src/lib/components/action-comment/action-comment.component.html +0 -47
  168. package/src/lib/components/action-comment/action-comment.component.spec.ts +0 -23
  169. package/src/lib/components/action-comment/action-comment.component.ts +0 -102
  170. package/src/lib/components/action-confirmation/action-confirmation.component.css +0 -46
  171. package/src/lib/components/action-confirmation/action-confirmation.component.html +0 -32
  172. package/src/lib/components/action-confirmation/action-confirmation.component.spec.ts +0 -23
  173. package/src/lib/components/action-confirmation/action-confirmation.component.ts +0 -58
  174. package/src/lib/components/activity-report-form/activity-report-form.component.html +0 -110
  175. package/src/lib/components/activity-report-form/activity-report-form.component.scss +0 -69
  176. package/src/lib/components/activity-report-form/activity-report-form.component.spec.ts +0 -25
  177. package/src/lib/components/activity-report-form/activity-report-form.component.ts +0 -616
  178. package/src/lib/components/advanced-filter/field-filter/field-filter.component.html +0 -8
  179. package/src/lib/components/advanced-filter/field-filter/field-filter.component.scss +0 -0
  180. package/src/lib/components/advanced-filter/field-filter/field-filter.component.spec.ts +0 -25
  181. package/src/lib/components/advanced-filter/field-filter/field-filter.component.ts +0 -55
  182. package/src/lib/components/advanced-filter/filter-builder/filter-builder.component.html +0 -36
  183. package/src/lib/components/advanced-filter/filter-builder/filter-builder.component.scss +0 -130
  184. package/src/lib/components/advanced-filter/filter-builder/filter-builder.component.spec.ts +0 -25
  185. package/src/lib/components/advanced-filter/filter-builder/filter-builder.component.ts +0 -186
  186. package/src/lib/components/audit-log-details-dialog/audit-log-details-dialog.component.css +0 -51
  187. package/src/lib/components/audit-log-details-dialog/audit-log-details-dialog.component.html +0 -23
  188. package/src/lib/components/audit-log-details-dialog/audit-log-details-dialog.component.spec.ts +0 -23
  189. package/src/lib/components/audit-log-details-dialog/audit-log-details-dialog.component.ts +0 -69
  190. package/src/lib/components/audit-log-list/audit-log.component.html +0 -26
  191. package/src/lib/components/audit-log-list/audit-log.component.scss +0 -50
  192. package/src/lib/components/audit-log-list/audit-log.component.spec.ts +0 -25
  193. package/src/lib/components/audit-log-list/audit-log.component.ts +0 -114
  194. package/src/lib/components/auto-complete/auto-complete.component.css +0 -55
  195. package/src/lib/components/auto-complete/auto-complete.component.html +0 -45
  196. package/src/lib/components/auto-complete/auto-complete.component.spec.ts +0 -23
  197. package/src/lib/components/auto-complete/auto-complete.component.ts +0 -331
  198. package/src/lib/components/base-form/base-form.component.html +0 -59
  199. package/src/lib/components/base-form/base-form.component.scss +0 -68
  200. package/src/lib/components/base-form/base-form.component.spec.ts +0 -25
  201. package/src/lib/components/base-form/base-form.component.ts +0 -323
  202. package/src/lib/components/base-form-canvas/base-form-canvas.component.css +0 -196
  203. package/src/lib/components/base-form-canvas/base-form-canvas.component.html +0 -1095
  204. package/src/lib/components/base-form-canvas/base-form-canvas.component.spec.ts +0 -23
  205. package/src/lib/components/base-form-canvas/base-form-canvas.component.ts +0 -680
  206. package/src/lib/components/base-input-dialog/base-input-dialog.component.css +0 -67
  207. package/src/lib/components/base-input-dialog/base-input-dialog.component.html +0 -47
  208. package/src/lib/components/base-input-dialog/base-input-dialog.component.spec.ts +0 -23
  209. package/src/lib/components/base-input-dialog/base-input-dialog.component.ts +0 -77
  210. package/src/lib/components/base-table/base-table.component.html +0 -268
  211. package/src/lib/components/base-table/base-table.component.scss +0 -140
  212. package/src/lib/components/base-table/base-table.component.spec.ts +0 -25
  213. package/src/lib/components/base-table/base-table.component.ts +0 -621
  214. package/src/lib/components/button-actions/button-actions.component.html +0 -27
  215. package/src/lib/components/button-actions/button-actions.component.scss +0 -101
  216. package/src/lib/components/button-actions/button-actions.component.spec.ts +0 -23
  217. package/src/lib/components/button-actions/button-actions.component.ts +0 -70
  218. package/src/lib/components/editable-base-table/editable-base-table.component.html +0 -337
  219. package/src/lib/components/editable-base-table/editable-base-table.component.scss +0 -126
  220. package/src/lib/components/editable-base-table/editable-base-table.component.spec.ts +0 -25
  221. package/src/lib/components/editable-base-table/editable-base-table.component.ts +0 -579
  222. package/src/lib/components/equation-builder/equation-builder.component.css +0 -39
  223. package/src/lib/components/equation-builder/equation-builder.component.html +0 -31
  224. package/src/lib/components/equation-builder/equation-builder.component.spec.ts +0 -23
  225. package/src/lib/components/equation-builder/equation-builder.component.ts +0 -119
  226. package/src/lib/components/item-line-editor/item-line-editor.component.html +0 -102
  227. package/src/lib/components/item-line-editor/item-line-editor.component.scss +0 -152
  228. package/src/lib/components/item-line-editor/item-line-editor.component.spec.ts +0 -23
  229. package/src/lib/components/item-line-editor/item-line-editor.component.ts +0 -306
  230. package/src/lib/components/multi-auto-complete/multi-auto-complete.component.css +0 -19
  231. package/src/lib/components/multi-auto-complete/multi-auto-complete.component.html +0 -38
  232. package/src/lib/components/multi-auto-complete/multi-auto-complete.component.spec.ts +0 -23
  233. package/src/lib/components/multi-auto-complete/multi-auto-complete.component.ts +0 -315
  234. package/src/lib/components/paginator/paginator.component.css +0 -65
  235. package/src/lib/components/paginator/paginator.component.html +0 -30
  236. package/src/lib/components/paginator/paginator.component.ts +0 -87
  237. package/src/lib/components/report-details-dialog/report-details-dialog.component.css +0 -17
  238. package/src/lib/components/report-details-dialog/report-details-dialog.component.html +0 -16
  239. package/src/lib/components/report-details-dialog/report-details-dialog.component.spec.ts +0 -23
  240. package/src/lib/components/report-details-dialog/report-details-dialog.component.ts +0 -111
  241. package/src/lib/components/report-form/report-form.component.html +0 -92
  242. package/src/lib/components/report-form/report-form.component.scss +0 -51
  243. package/src/lib/components/report-form/report-form.component.spec.ts +0 -25
  244. package/src/lib/components/report-form/report-form.component.ts +0 -599
  245. package/src/lib/components/search-bar/search-bar.component.html +0 -51
  246. package/src/lib/components/search-bar/search-bar.component.scss +0 -63
  247. package/src/lib/components/search-bar/search-bar.component.spec.ts +0 -25
  248. package/src/lib/components/search-bar/search-bar.component.ts +0 -68
  249. package/src/lib/components/section-form-canvas/section-form-canvas.component.html +0 -43
  250. package/src/lib/components/section-form-canvas/section-form-canvas.component.scss +0 -81
  251. package/src/lib/components/section-form-canvas/section-form-canvas.component.spec.ts +0 -23
  252. package/src/lib/components/section-form-canvas/section-form-canvas.component.ts +0 -67
  253. package/src/lib/components/shared/action-button/action-button.component.html +0 -12
  254. package/src/lib/components/shared/action-button/action-button.component.scss +0 -45
  255. package/src/lib/components/shared/action-button/action-button.component.ts +0 -51
  256. package/src/lib/components/shared/action-card/action-card.component.html +0 -78
  257. package/src/lib/components/shared/action-card/action-card.component.scss +0 -238
  258. package/src/lib/components/shared/action-card/action-card.component.ts +0 -56
  259. package/src/lib/components/shared/attachment-uploader/attachment-uploader.component.css +0 -135
  260. package/src/lib/components/shared/attachment-uploader/attachment-uploader.component.html +0 -36
  261. package/src/lib/components/shared/attachment-uploader/attachment-uploader.component.spec.ts +0 -23
  262. package/src/lib/components/shared/attachment-uploader/attachment-uploader.component.ts +0 -71
  263. package/src/lib/components/shared-list/shared-list.component.css +0 -0
  264. package/src/lib/components/shared-list/shared-list.component.html +0 -17
  265. package/src/lib/components/shared-list/shared-list.component.spec.ts +0 -23
  266. package/src/lib/components/shared-list/shared-list.component.ts +0 -53
  267. package/src/lib/components/snackbar-static/snackbar-static.component.html +0 -20
  268. package/src/lib/components/snackbar-static/snackbar-static.component.scss +0 -135
  269. package/src/lib/components/snackbar-static/snackbar-static.component.ts +0 -26
  270. package/src/lib/components/title-bar/title-bar.component.css +0 -0
  271. package/src/lib/components/title-bar/title-bar.component.css.map +0 -1
  272. package/src/lib/components/title-bar/title-bar.component.html +0 -35
  273. package/src/lib/components/title-bar/title-bar.component.scss +0 -126
  274. package/src/lib/components/title-bar/title-bar.component.spec.ts +0 -23
  275. package/src/lib/components/title-bar/title-bar.component.ts +0 -126
  276. package/src/lib/services/backend-service.ts +0 -287
  277. package/src/lib/services/top-panel.ts +0 -17
  278. package/src/lib/services/trigger-form.service.ts +0 -11
  279. package/src/lib/share-module/shared-module.ts +0 -10
  280. package/src/lib/utils/base-utils.ts +0 -102
  281. package/src/lib/validators/date-range-validator.ts +0 -31
  282. package/src/lib/validators/match-list.validator.ts +0 -10
  283. package/src/lib/validators/multi-email-validator.ts +0 -15
  284. package/tsconfig.lib.json +0 -15
  285. package/tsconfig.lib.prod.json +0 -11
  286. package/tsconfig.spec.json +0 -15
@@ -1,287 +0,0 @@
1
- import {Inject, Injectable} from "@angular/core";
2
- import {HttpClient, HttpErrorResponse, HttpHeaders, HttpParams} from "@angular/common/http";
3
- import {Observable, of, Subject} from "rxjs";
4
- import {catchError, distinctUntilChanged} from "rxjs/operators";
5
- import {SnackMessage} from "../base-model/snack-message.model";
6
- import {PageInfo} from "../base-model/page-info";
7
- import {TranslateService} from "@ngx-translate/core";
8
- import {ColumnDef} from "../base-model/column-def.model";
9
- import {TableColumn} from "../base-model/table-column.interface";
10
- import {GetItemsList} from "../base-model/get-items-list";
11
- import {FieldAction} from "../base-model/field-action";
12
- import {Workflow} from "../base-model/workflow/workflow.model";
13
- import {ReportRequest} from "../base-model/report-request.model";
14
- import {FilterRequest} from "../base-model/filter-request";
15
- import {ResponseEnvelop} from "../base-model/response-envelop.model";
16
- import {FormGroup} from "@angular/forms";
17
- import { ActivatedRoute } from "@angular/router";
18
- import {TopPanel} from "./top-panel";
19
- import {DoActionRequest} from "../base-model/do-action-request";
20
- import {MatDialog} from "@angular/material/dialog";
21
- import {ActionConfirmationComponent} from "../components/action-confirmation/action-confirmation.component";
22
-
23
- const WORKFLOW_STATES_MAP: Record<number, string> = {
24
- 1: 'New',
25
- 2: 'Pending',
26
- 3: 'Terminated',
27
- 4: 'Completed',
28
- 5: 'Updated',
29
- 6: 'Default'
30
- };
31
-
32
- const EXCLUDED_REPORT_COLUMNS = ['listAction','button', 'checkbox'];
33
- @Injectable({
34
- providedIn: 'root'
35
- })
36
- export class BackendService {
37
- public topPanelMessage$ = new Subject<SnackMessage>();
38
- // @ts-ignore
39
- public parentForm: FormGroup;
40
- public childForm: FormGroup;
41
- public fieldAction$ = new Subject<FieldAction>();
42
- public isEmptyItems: boolean = true;
43
-
44
- constructor(private http: HttpClient,
45
- private topPanel: TopPanel,
46
- private translateService: TranslateService,
47
- private route: ActivatedRoute,
48
- private dialog: MatDialog,
49
- @Inject('config') private config: any,
50
- @Inject('secretsManager') private secretsManager: any) {
51
-
52
- this.topPanelMessage$.subscribe(msg => {
53
- this.topPanel.topPanelMessage$.next(msg);
54
- })
55
- }
56
-
57
- set defaults(value: any | undefined) {
58
- }
59
-
60
- get defaults(): any | undefined {
61
- return {};
62
- }
63
-
64
- getStatusDescription(element: any, workflow: Workflow) {
65
- if (element?.stepId) {
66
-
67
- let index = workflow?.workflowSteps?.findIndex(s => s.stepId === element.stepId);
68
- if (index > -1) {
69
- return this.translateService.getDefaultLang() === 'ar' ?
70
- workflow?.workflowSteps[index].stepNameAr || workflow?.workflowSteps[index].stepName:
71
- workflow?.workflowSteps[index].stepName;
72
- // return this.translateService.instant(workflow?.workflowSteps[index].stepName);
73
- } else {
74
- return this.translateService.instant('INVENTORY.inprocessStatus');
75
- }
76
- } else {
77
- if (element.statusId === 4 && element.statusDescription) {
78
- return element.statusDescription;
79
- } else if (element.statusId) {
80
- return this.translateService.instant(WORKFLOW_STATES_MAP[element.statusId]);
81
- } else {
82
- return "unknown";
83
- }
84
- }
85
- }
86
- //sss
87
- getItemsByFilter(reportRequest: any, apiUrl: string): Observable<any> {
88
- const url = `${this.getApiBasePath()}/api/v1${apiUrl}/list`;
89
- return this.http.post(url, reportRequest, { headers: this.buildSecuredHeader()}).pipe(
90
- distinctUntilChanged(),
91
- catchError(err => of(err.message || err)));
92
- }
93
-
94
- getItemAuditLog(reportRequest: any, apiUrl: string): Observable<any> {
95
- const url = `${this.getApiBasePath()}/api/v1${apiUrl}/audit-log`;
96
- return this.http.post(url, reportRequest, { headers: this.buildSecuredHeader()}).pipe(
97
- distinctUntilChanged(),
98
- catchError(err => of(err.message || err)));
99
- }
100
-
101
-
102
- private buildSecuredHeader() {
103
- const headers = new HttpHeaders({
104
- 'Content-Type': 'application/json',
105
- Authorization: this.config.getAuthToken()
106
- });
107
- return headers;
108
- }
109
-
110
- public buildFormSecuredHeader() {
111
- const headers = new HttpHeaders({
112
- Authorization: this.config.getAuthToken()
113
- });
114
- return headers;
115
- }
116
-
117
- labelKey(column: any, pageInfo: PageInfo) {
118
- const configuredKey = column.label ? column.label : column.property;
119
-
120
- if (configuredKey && configuredKey.trim() !== '' && configuredKey.startsWith(pageInfo.labelsSection)) {
121
- return configuredKey;
122
- }
123
-
124
- return `${pageInfo.labelsSection}.${configuredKey}`;
125
- }
126
-
127
-
128
- private buildReportColumn(columns: TableColumn<any>[], pageInfo: PageInfo): ColumnDef[] {
129
- let columnDef: ColumnDef[] = [];
130
-
131
- columns.filter(x => !EXCLUDED_REPORT_COLUMNS.includes(x.type)).forEach((c, index) => {
132
- let transLabel = this.translateService.instant(this.labelKey(c,pageInfo));
133
- let transGroup = pageInfo.supportGroupingInExport ?
134
- c.group.trim() ? this.translateService.instant(c.group) : ' ' : null;
135
- if (c.type === 'workflowStatus') {
136
- transLabel = this.translateService.instant('workflowStatus');
137
- }
138
- if ((c.reportVisible === true) || (c.visible === true && c.reportVisible !== false)) {
139
- columnDef.push(new ColumnDef(c, index, transLabel, this.translateService.getDefaultLang(),transGroup));
140
- }
141
- });
142
- return columnDef;
143
- }
144
-
145
- private base64ToArrayBuffer(base64: string) {
146
- const binaryString = window.atob(base64); // Comment this if not using base64
147
- const bytes = new Uint8Array(binaryString.length);
148
- return bytes.map((byte, i) => binaryString.charCodeAt(i));
149
- }
150
-
151
- buildReportRequest(columns: TableColumn<any>[], title: string | string[], filterRequest: FilterRequest, reportType: any, pageInfo: PageInfo, searchStr: string ,orientation='PORTRAIT'): ReportRequest {
152
- const columnDef = this.buildReportColumn(columns, pageInfo);
153
- const reportRequest = new ReportRequest({
154
- dataset: [], filter: "",
155
- columns: columnDef,
156
- // sessionId: this.topPanel.userSession().sessionId,
157
- sessionId: this.config.getAuthToken(),
158
- title: this.translateService.instant(title),
159
- prefLang: this.translateService.getDefaultLang(),
160
- reportType: reportType,
161
- searchStr: searchStr,
162
- filterRequest: filterRequest,
163
- orientation: orientation});
164
- return reportRequest;
165
- }
166
-
167
- getLookupItemsByMultiFilter(listItems: GetItemsList, filterRequest?: FilterRequest): Observable<any> {
168
- listItems.pageSize = 100;
169
- filterRequest.pageSize = 100;
170
- const params = new HttpParams().set('searchStr', listItems.searchStr);
171
- let url = `${this.getApiBasePath()}/api/v1/${listItems.apiUri}`;
172
- return this.http.post(url, filterRequest, { headers: this.buildSecuredHeader(), params: params}).pipe(
173
- distinctUntilChanged(),
174
- catchError(err => of(err.message || err)));
175
- }
176
- getLookupItemsByFilter(listItems: GetItemsList, cascadedId?: any): Observable<any> {
177
- listItems.pageSize = 500;
178
- const params = new HttpParams().set('searchStr', listItems.searchStr);
179
- let url = `${this.getApiBasePath()}/api/v1/${listItems.apiUri}`;
180
- if (cascadedId) {
181
- url = url + `/${cascadedId}`
182
- }
183
-
184
- return this.http.post(url, listItems,{ headers: this.buildSecuredHeader()}).pipe(
185
- distinctUntilChanged(),
186
- catchError(err => of(err.message || err)));
187
- }
188
-
189
-
190
-
191
- downloadReport(reportRequest: ReportRequest, pageApiPath : string, readyPath? : boolean ) {
192
- const s = readyPath === true ? `/api/v1${pageApiPath}` : `/api/v1${pageApiPath}/extractAndDownloadListReport`;
193
- return this.http.post<ResponseEnvelop>(this.getApiBasePath() + s, reportRequest, {headers: this.buildSecuredHeader()}).subscribe(
194
- (resp:ResponseEnvelop) => {
195
- if (resp.valid) {
196
- if (resp.body) {
197
- const filename = reportRequest.title + "." + reportRequest.reportType;
198
- const blob = new Blob([this.base64ToArrayBuffer(resp.body)]);
199
- if (navigator.msSaveBlob) {
200
- navigator.msSaveBlob(blob, filename);
201
- } else {
202
- const link = document.createElement('a');
203
- // Browsers that support HTML5 download attribute
204
- if (link.download !== undefined) {
205
- const url = URL.createObjectURL(blob);
206
- link.setAttribute('href', url);
207
- link.setAttribute('download', filename);
208
- link.style.visibility = 'hidden';
209
- document.body.appendChild(link);
210
- link.click();
211
- document.body.removeChild(link);
212
- }
213
- }
214
- } else {
215
- this.topPanel.topPanelMessage$.next(new SnackMessage(resp.message.toString(), true, 'info'));
216
- }
217
- } else {
218
- this.topPanel.topPanelMessage$.next(new SnackMessage(resp.message.toString(), false, 'error'));
219
- }
220
- }
221
- );
222
-
223
- }
224
-
225
- private getApiBasePath(){
226
- return this.config.getBaseApi();
227
- }
228
-
229
- doActionWithAttachments(request: DoActionRequest, param2: any[], pageInfo: PageInfo) {
230
- const url = `${this.getApiBasePath()}/api/v1${pageInfo.apiUri}/doActionWithAttachments`;
231
- const formData: FormData = new FormData();
232
- formData.set('doActionRequest', new Blob([JSON.stringify(request)], {
233
- type: "application/json"
234
- }));
235
-
236
- return this.http.post(url, formData, { headers: this.buildFormSecuredHeader() }).pipe(
237
- distinctUntilChanged(),
238
- catchError((error: HttpErrorResponse) => {
239
- return of(error.error);
240
- })
241
- );
242
-
243
- }
244
- doActionWithAttachment(request: DoActionRequest, file: File, pageInfo: PageInfo) {
245
- const url = `${this.getApiBasePath()}/api/v1${pageInfo.apiUri}/doActionWithAttachments`;
246
- const formData: FormData = new FormData();
247
-
248
- formData.append('files', file);
249
- formData.set('doActionRequest', new Blob([JSON.stringify(request)], {
250
- type: "application/json"
251
- }));
252
-
253
- return this.http.post<any>(url, formData, {
254
- headers: this.buildFormSecuredHeader()
255
- }).pipe(
256
- distinctUntilChanged(),
257
- catchError((error: HttpErrorResponse) => {
258
- // Transform the error into a fake success-like response
259
- return of(error.error); // This will now be passed to `next` in subscribe()
260
- })
261
- );
262
- }
263
-
264
- encrypt(message: any) {
265
- return this.secretsManager.encryptSecret(message);
266
- }
267
-
268
- decrypt(secret: any) {
269
- return this.secretsManager.decryptSecret(secret);
270
- }
271
-
272
- public getConfirmation(): Observable<any> {
273
- const dialogRef = this.dialog.open(ActionConfirmationComponent, {
274
- data: {acceptActionLabel: 'accept',rejectActionLabel:'return', warningMsg: 'confirmation_message'},
275
- width: '600px',
276
- height: 'auto'
277
- });
278
- return dialogRef.afterClosed();
279
- }
280
-
281
- }
282
-
283
- declare global {
284
- interface Navigator {
285
- msSaveBlob: (blobOrBase64: Blob | string, filename: string) => void
286
- }
287
- }
@@ -1,17 +0,0 @@
1
- import {Injectable} from "@angular/core";
2
- import {BehaviorSubject} from "rxjs";
3
- import {SnackMessage} from "../base-model/snack-message.model";
4
-
5
- @Injectable({
6
- providedIn: 'root'
7
- })
8
- export class TopPanel {
9
-
10
- public topPanelMessage$ = new BehaviorSubject<SnackMessage>({
11
- message: '',
12
- translate: false,
13
- type: 'info',
14
- translateParams: {}
15
- });
16
-
17
- }
@@ -1,11 +0,0 @@
1
- import {Injectable, signal} from '@angular/core';
2
-
3
- @Injectable({
4
- providedIn: 'root'
5
- })
6
-
7
-
8
- export class ShareDataService {
9
- trigger = signal<boolean>(true);
10
- enableTrigger = (() => (() => this.trigger.update((val) => val = !val)))
11
- }
@@ -1,10 +0,0 @@
1
- // projects/your-lib/src/lib/shared/shared.module.ts
2
- import { NgModule } from '@angular/core';
3
- import { CommonModule } from '@angular/common';
4
- // Import other shared modules (e.g., Angular Material modules)
5
-
6
- @NgModule({
7
- imports: [CommonModule],
8
- exports: [CommonModule]
9
- })
10
- export class SharedModule { }
@@ -1,102 +0,0 @@
1
- import {FieldInfo, EMPTY_PAGE_INFO, PageInfo, FilterRequest, SAVE_AND_COMPLETE} from "../base-model";
2
- import {APPROVE, NEW, SAVE} from "../base-model/do-action-request";
3
- import {Validators} from "@angular/forms";
4
-
5
- export class BaseUtils {
6
-
7
- pageInfo: PageInfo = EMPTY_PAGE_INFO;
8
-
9
- labelKey(column: any) {
10
- if (column.type === 'workflowStatus') {
11
- return 'INVENTORY.workflowStatus'
12
- }
13
- if (!column.property.length) {
14
- return "";
15
- }
16
- const configuredKey = column.label ? column.label : column.property
17
- return configuredKey.startsWith(this.pageInfo.labelsSection) ? `${configuredKey}` : `${this.pageInfo.labelsSection}.${configuredKey}`;
18
- }
19
-
20
- labelKeyByValue(column: any, element) {
21
- if (!column.property.length) {
22
- return "";
23
- }
24
- return `${this.pageInfo.labelsSection}.${element[column.property]}`
25
- }
26
-
27
- formatTimeToDate(v: any){
28
- const fromTime: Date = new Date();
29
- if (v) {
30
- let split = v.split(":");
31
- fromTime.setHours(split[0], split[1]);
32
- }
33
- return new Date(fromTime.getTime());
34
- }
35
- }
36
-
37
- export function buildFormFields(fields: FieldInfo[], item:any){
38
- let fieldsControls: string[] = [];
39
- for (let field of fields) {
40
- if (field.type !== 'spacer') {
41
- const emptyValue = field.type === 'lookup' || field.type === 'multi-select' ? null : '';
42
- const extractedValue = item ? extractFieldName(item, field.property) : undefined;
43
- const validators = field.required
44
- ? [...(field.validators || []), Validators.required]
45
- : field.validators || [];
46
-
47
- fieldsControls[field.property] = extractedValue !== undefined && extractedValue !== null
48
- ? [extractedValue, validators]
49
- : [emptyValue, validators];
50
- }
51
- }
52
- return fieldsControls;
53
- }
54
- export function buildItemsList(searchStr: string, apiPath?: string, cascadedByProperty?:string){
55
- const filterRequest : FilterRequest = new FilterRequest();
56
- // return {
57
- filterRequest.apiUri = cascadedByProperty ? `${apiPath}/${cascadedByProperty}` :apiPath;
58
- filterRequest.searchStr= searchStr
59
- filterRequest.pageIndex = 0;
60
- filterRequest.pageSize= 10;
61
- filterRequest.sortKey= 'id';
62
- filterRequest.sortDirection = "DESC" as const;
63
- // }
64
- return filterRequest;
65
- }
66
-
67
- export function extractFieldName(element: any, property: string) {
68
- if (property.includes('.')) {
69
- return property.split('.').reduce((acc, part) => acc && acc[part], element);
70
- } else {
71
- return element[property];
72
- }
73
- }
74
-
75
- export function getPositiveWfActionKey(stateType: any) {
76
- if (stateType === "COMPLETED") {
77
- return "save";
78
- } else if (stateType === "PENDING" || stateType === "NEW") {
79
- return "approve";
80
- }
81
- return "save";
82
- }
83
-
84
- export function getNegativeWfActionKey(stateType: any) {
85
- if (stateType === "COMPLETED" ) {
86
- return "cancel";
87
- } else if (stateType === "PENDING"|| stateType === "NEW") {
88
- return "reject";
89
- }
90
- return "cancel";
91
- }
92
-
93
- export function getWfActionId(stateType) {
94
- let actionId = NEW;
95
- if (stateType === "COMPLETED") {
96
- actionId = SAVE;
97
- } else if (stateType === "PENDING" || stateType === "NEW") {
98
- actionId = APPROVE;
99
- }
100
- return actionId;
101
- }
102
-
@@ -1,31 +0,0 @@
1
- import { AbstractControl, ValidationErrors, FormArray, FormGroup } from '@angular/forms';
2
-
3
- export function DateRangeValidator(group: AbstractControl): ValidationErrors | null {
4
- let fromDateControl: AbstractControl | null = null;
5
- let toDateControl: AbstractControl | null = null;
6
-
7
- if (group.parent instanceof FormGroup && group.parent.parent instanceof FormArray) {
8
- const formGroup = group.parent;
9
- fromDateControl = formGroup.get('fromDate');
10
- toDateControl = formGroup.get('toDate');
11
- } else {
12
- fromDateControl = group.root.get('fromDate');
13
- toDateControl = group.root.get('toDate');
14
- }
15
-
16
- if (fromDateControl && toDateControl) {
17
- const fromDateValue = fromDateControl.value;
18
- const toDateValue = toDateControl.value;
19
-
20
- if (fromDateValue && toDateValue) {
21
- const fromDate = new Date(fromDateValue);
22
- const toDate = new Date(toDateValue);
23
-
24
- if (fromDate > toDate) {
25
- return { dateRangeInvalid: 'Invalid Date Range: To date must be after from date' };
26
- }
27
- }
28
- }
29
-
30
- return null;
31
- }
@@ -1,10 +0,0 @@
1
- import {FormGroup} from "@angular/forms";
2
- import {LookupItem} from "../base-model";
3
-
4
- export function RequireMatch(control: FormGroup) {
5
- const selection: any = control.value;
6
- if (typeof selection === 'string' || (selection instanceof LookupItem && selection.id === -1)) {
7
- return { incorrect: true };
8
- }
9
- return null;
10
- }
@@ -1,15 +0,0 @@
1
- import { FormGroup } from '@angular/forms';
2
-
3
- export function MultiEmailValidator(control: FormGroup) {
4
- if (!control.value) {
5
- return null;
6
- }
7
- const emails = control.value.split(';').map(email => email.trim());
8
-
9
- for (let email of emails) {
10
- if (!email.match(/^([\w+-.%]+@[\w-.]+\.[A-Za-z]{2,7};?)*$/)) {
11
- return { 'invalidEmail': { value: control.value } };
12
- }
13
- }
14
- return null;
15
- }
package/tsconfig.lib.json DELETED
@@ -1,15 +0,0 @@
1
- /* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
2
- /* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
3
- {
4
- "extends": "../../../tsconfig.json",
5
- "compilerOptions": {
6
- "outDir": "../../../out-tsc/lib",
7
- "declaration": true,
8
- "declarationMap": true,
9
- "inlineSources": true,
10
- "types": []
11
- },
12
- "exclude": [
13
- "**/*.spec.ts"
14
- ]
15
- }
@@ -1,11 +0,0 @@
1
- /* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
2
- /* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
3
- {
4
- "extends": "./tsconfig.lib.json",
5
- "compilerOptions": {
6
- "declarationMap": false
7
- },
8
- "angularCompilerOptions": {
9
- "compilationMode": "partial"
10
- }
11
- }
@@ -1,15 +0,0 @@
1
- /* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
2
- /* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
3
- {
4
- "extends": "../../../tsconfig.json",
5
- "compilerOptions": {
6
- "outDir": "../../../out-tsc/spec",
7
- "types": [
8
- "jasmine"
9
- ]
10
- },
11
- "include": [
12
- "**/*.spec.ts",
13
- "**/*.d.ts"
14
- ]
15
- }