@unifylib/ui-lib 1.0.3 → 1.1.4

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 (259) 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} +5 -7
  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/{src/lib/base-model/page-info.ts → lib/base-model/page-info.d.ts} +25 -24
  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} +1 -1
  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/lib/validators/match-list.validator.d.ts +4 -0
  134. package/lib/validators/multi-email-validator.d.ts +6 -0
  135. package/package.json +19 -4
  136. package/{src/public-api.ts → public-api.d.ts} +22 -18
  137. package/ng-package.json +0 -7
  138. package/src/lib/base-model/SearchStrConfig.ts +0 -12
  139. package/src/lib/base-model/audit-log-entry.ts +0 -7
  140. package/src/lib/base-model/button-action-settings.ts +0 -25
  141. package/src/lib/base-model/column-def.model.ts +0 -34
  142. package/src/lib/base-model/do-action-request.ts +0 -11
  143. package/src/lib/base-model/field-action.ts +0 -7
  144. package/src/lib/base-model/field-filter.model.ts +0 -14
  145. package/src/lib/base-model/field-info.ts +0 -98
  146. package/src/lib/base-model/field-predicate.model.ts +0 -7
  147. package/src/lib/base-model/filter-request.ts +0 -27
  148. package/src/lib/base-model/filter.model.ts +0 -49
  149. package/src/lib/base-model/get-items-list.ts +0 -24
  150. package/src/lib/base-model/index.ts +0 -11
  151. package/src/lib/base-model/lookupItem.ts +0 -21
  152. package/src/lib/base-model/null-snackmessage.ts +0 -9
  153. package/src/lib/base-model/report-request.model.ts +0 -33
  154. package/src/lib/base-model/response-envelop.model.ts +0 -15
  155. package/src/lib/base-model/snack-message.model.ts +0 -14
  156. package/src/lib/base-model/snackmessage-interface.ts +0 -7
  157. package/src/lib/base-model/table-column.interface.ts +0 -29
  158. package/src/lib/base-model/table-page-user-action.interface.ts +0 -33
  159. package/src/lib/base-model/workflow/workflow-steps.model.ts +0 -9
  160. package/src/lib/base-model/workflow/workflow.model.ts +0 -52
  161. package/src/lib/components/action-confirmation/action-confirmation.component.css +0 -34
  162. package/src/lib/components/action-confirmation/action-confirmation.component.html +0 -18
  163. package/src/lib/components/action-confirmation/action-confirmation.component.spec.ts +0 -23
  164. package/src/lib/components/action-confirmation/action-confirmation.component.ts +0 -58
  165. package/src/lib/components/activity-report-form/activity-report-form.component.html +0 -109
  166. package/src/lib/components/activity-report-form/activity-report-form.component.scss +0 -0
  167. package/src/lib/components/activity-report-form/activity-report-form.component.spec.ts +0 -25
  168. package/src/lib/components/activity-report-form/activity-report-form.component.ts +0 -605
  169. package/src/lib/components/audit-log-details-dialog/audit-log-details-dialog.component.css +0 -51
  170. package/src/lib/components/audit-log-details-dialog/audit-log-details-dialog.component.html +0 -23
  171. package/src/lib/components/audit-log-details-dialog/audit-log-details-dialog.component.spec.ts +0 -23
  172. package/src/lib/components/audit-log-details-dialog/audit-log-details-dialog.component.ts +0 -69
  173. package/src/lib/components/audit-log-list/audit-log.component.html +0 -23
  174. package/src/lib/components/audit-log-list/audit-log.component.scss +0 -0
  175. package/src/lib/components/audit-log-list/audit-log.component.spec.ts +0 -25
  176. package/src/lib/components/audit-log-list/audit-log.component.ts +0 -116
  177. package/src/lib/components/auto-complete/auto-complete.component.css +0 -14
  178. package/src/lib/components/auto-complete/auto-complete.component.html +0 -29
  179. package/src/lib/components/auto-complete/auto-complete.component.spec.ts +0 -23
  180. package/src/lib/components/auto-complete/auto-complete.component.ts +0 -330
  181. package/src/lib/components/base-form/base-form.component.html +0 -58
  182. package/src/lib/components/base-form/base-form.component.scss +0 -0
  183. package/src/lib/components/base-form/base-form.component.spec.ts +0 -25
  184. package/src/lib/components/base-form/base-form.component.ts +0 -305
  185. package/src/lib/components/base-form-canvas/base-form-canvas.component.css +0 -22
  186. package/src/lib/components/base-form-canvas/base-form-canvas.component.html +0 -1006
  187. package/src/lib/components/base-form-canvas/base-form-canvas.component.spec.ts +0 -23
  188. package/src/lib/components/base-form-canvas/base-form-canvas.component.ts +0 -573
  189. package/src/lib/components/base-input-dialog/base-input-dialog.component.css +0 -0
  190. package/src/lib/components/base-input-dialog/base-input-dialog.component.html +0 -42
  191. package/src/lib/components/base-input-dialog/base-input-dialog.component.spec.ts +0 -23
  192. package/src/lib/components/base-input-dialog/base-input-dialog.component.ts +0 -78
  193. package/src/lib/components/base-table/base-table.component.html +0 -242
  194. package/src/lib/components/base-table/base-table.component.scss +0 -31
  195. package/src/lib/components/base-table/base-table.component.spec.ts +0 -25
  196. package/src/lib/components/base-table/base-table.component.ts +0 -568
  197. package/src/lib/components/button-actions/button-actions.component.html +0 -28
  198. package/src/lib/components/button-actions/button-actions.component.scss +0 -6
  199. package/src/lib/components/button-actions/button-actions.component.spec.ts +0 -23
  200. package/src/lib/components/button-actions/button-actions.component.ts +0 -72
  201. package/src/lib/components/editable-base-table/editable-base-table.component.html +0 -372
  202. package/src/lib/components/editable-base-table/editable-base-table.component.scss +0 -44
  203. package/src/lib/components/editable-base-table/editable-base-table.component.spec.ts +0 -25
  204. package/src/lib/components/editable-base-table/editable-base-table.component.ts +0 -570
  205. package/src/lib/components/equation-builder/equation-builder.component.css +0 -0
  206. package/src/lib/components/equation-builder/equation-builder.component.html +0 -31
  207. package/src/lib/components/equation-builder/equation-builder.component.spec.ts +0 -23
  208. package/src/lib/components/equation-builder/equation-builder.component.ts +0 -121
  209. package/src/lib/components/multi-auto-complete/multi-auto-complete.component.css +0 -11
  210. package/src/lib/components/multi-auto-complete/multi-auto-complete.component.html +0 -38
  211. package/src/lib/components/multi-auto-complete/multi-auto-complete.component.spec.ts +0 -23
  212. package/src/lib/components/multi-auto-complete/multi-auto-complete.component.ts +0 -317
  213. package/src/lib/components/paginator/paginator.component.css +0 -25
  214. package/src/lib/components/paginator/paginator.component.html +0 -34
  215. package/src/lib/components/paginator/paginator.component.ts +0 -94
  216. package/src/lib/components/rejection-comment/action-comment.component.css +0 -33
  217. package/src/lib/components/rejection-comment/action-comment.component.html +0 -46
  218. package/src/lib/components/rejection-comment/action-comment.component.spec.ts +0 -23
  219. package/src/lib/components/rejection-comment/action-comment.component.ts +0 -86
  220. package/src/lib/components/report-details-dialog/report-details-dialog.component.css +0 -17
  221. package/src/lib/components/report-details-dialog/report-details-dialog.component.html +0 -16
  222. package/src/lib/components/report-details-dialog/report-details-dialog.component.spec.ts +0 -23
  223. package/src/lib/components/report-details-dialog/report-details-dialog.component.ts +0 -113
  224. package/src/lib/components/report-form/report-form.component.html +0 -94
  225. package/src/lib/components/report-form/report-form.component.scss +0 -0
  226. package/src/lib/components/report-form/report-form.component.spec.ts +0 -25
  227. package/src/lib/components/report-form/report-form.component.ts +0 -588
  228. package/src/lib/components/search-bar/search-bar.component.html +0 -62
  229. package/src/lib/components/search-bar/search-bar.component.scss +0 -8
  230. package/src/lib/components/search-bar/search-bar.component.spec.ts +0 -25
  231. package/src/lib/components/search-bar/search-bar.component.ts +0 -70
  232. package/src/lib/components/shared/attachment-uploader/attachment-uploader.component.css +0 -54
  233. package/src/lib/components/shared/attachment-uploader/attachment-uploader.component.html +0 -22
  234. package/src/lib/components/shared/attachment-uploader/attachment-uploader.component.spec.ts +0 -23
  235. package/src/lib/components/shared/attachment-uploader/attachment-uploader.component.ts +0 -45
  236. package/src/lib/components/shared-list/shared-list.component.css +0 -0
  237. package/src/lib/components/shared-list/shared-list.component.html +0 -17
  238. package/src/lib/components/shared-list/shared-list.component.spec.ts +0 -23
  239. package/src/lib/components/shared-list/shared-list.component.ts +0 -53
  240. package/src/lib/components/title-bar/title-bar.component.css +0 -0
  241. package/src/lib/components/title-bar/title-bar.component.css.map +0 -1
  242. package/src/lib/components/title-bar/title-bar.component.html +0 -31
  243. package/src/lib/components/title-bar/title-bar.component.scss +0 -23
  244. package/src/lib/components/title-bar/title-bar.component.spec.ts +0 -23
  245. package/src/lib/components/title-bar/title-bar.component.ts +0 -119
  246. package/src/lib/services/backend-service.ts +0 -286
  247. package/src/lib/services/top-panel.ts +0 -17
  248. package/src/lib/services/trigger-form.service.ts +0 -11
  249. package/src/lib/share-module/shared-module.ts +0 -10
  250. package/src/lib/styles/invoiceq-theme.scss +0 -252
  251. package/src/lib/styles/styles.scss +0 -1723
  252. package/src/lib/utils/base-utils.ts +0 -102
  253. package/src/lib/validators/date-range-validator.ts +0 -31
  254. package/src/lib/validators/match-list.validator.ts +0 -10
  255. package/src/lib/validators/multi-email-validator.ts +0 -15
  256. package/tsconfig.lib.json +0 -15
  257. package/tsconfig.lib.prod.json +0 -11
  258. package/tsconfig.spec.json +0 -15
  259. /package/{src/lib/validators/index.ts → lib/validators/index.d.ts} +0 -0
@@ -1,286 +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 fieldAction$ = new Subject<FieldAction>();
41
- public isEmptyItems: boolean = true;
42
-
43
- constructor(private http: HttpClient,
44
- private topPanel: TopPanel,
45
- private translateService: TranslateService,
46
- private route: ActivatedRoute,
47
- private dialog: MatDialog,
48
- @Inject('config') private config: any,
49
- @Inject('secretsManager') private secretsManager: any) {
50
-
51
- this.topPanelMessage$.subscribe(msg => {
52
- this.topPanel.topPanelMessage$.next(msg);
53
- })
54
- }
55
-
56
- set defaults(value: any | undefined) {
57
- }
58
-
59
- get defaults(): any | undefined {
60
- return {};
61
- }
62
-
63
- getStatusDescription(element: any, workflow: Workflow) {
64
- if (element?.stepId) {
65
-
66
- let index = workflow?.workflowSteps?.findIndex(s => s.stepId === element.stepId);
67
- if (index > -1) {
68
- return this.translateService.getDefaultLang() === 'ar' ?
69
- workflow?.workflowSteps[index].stepNameAr || workflow?.workflowSteps[index].stepName:
70
- workflow?.workflowSteps[index].stepName;
71
- // return this.translateService.instant(workflow?.workflowSteps[index].stepName);
72
- } else {
73
- return this.translateService.instant('INVENTORY.inprocessStatus');
74
- }
75
- } else {
76
- if (element.statusId === 4 && element.statusDescription) {
77
- return element.statusDescription;
78
- } else if (element.statusId) {
79
- return this.translateService.instant(WORKFLOW_STATES_MAP[element.statusId]);
80
- } else {
81
- return "unknown";
82
- }
83
- }
84
- }
85
- //sss
86
- getItemsByFilter(reportRequest: any, apiUrl: string): Observable<any> {
87
- const url = `${this.getApiBasePath()}/api/v1${apiUrl}/list`;
88
- return this.http.post(url, reportRequest, { headers: this.buildSecuredHeader()}).pipe(
89
- distinctUntilChanged(),
90
- catchError(err => of(err.message || err)));
91
- }
92
-
93
- getItemAuditLog(reportRequest: any, apiUrl: string): Observable<any> {
94
- const url = `${this.getApiBasePath()}/api/v1${apiUrl}/audit-log`;
95
- return this.http.post(url, reportRequest, { headers: this.buildSecuredHeader()}).pipe(
96
- distinctUntilChanged(),
97
- catchError(err => of(err.message || err)));
98
- }
99
-
100
-
101
- private buildSecuredHeader() {
102
- const headers = new HttpHeaders({
103
- 'Content-Type': 'application/json',
104
- Authorization: this.config.getAuthToken()
105
- });
106
- return headers;
107
- }
108
-
109
- public buildFormSecuredHeader() {
110
- const headers = new HttpHeaders({
111
- Authorization: this.config.getAuthToken()
112
- });
113
- return headers;
114
- }
115
-
116
- labelKey(column: any, pageInfo: PageInfo) {
117
- const configuredKey = column.label ? column.label : column.property;
118
-
119
- if (configuredKey && configuredKey.trim() !== '' && configuredKey.startsWith(pageInfo.labelsSection)) {
120
- return configuredKey;
121
- }
122
-
123
- return `${pageInfo.labelsSection}.${configuredKey}`;
124
- }
125
-
126
-
127
- private buildReportColumn(columns: TableColumn<any>[], pageInfo: PageInfo): ColumnDef[] {
128
- let columnDef: ColumnDef[] = [];
129
-
130
- columns.filter(x => !EXCLUDED_REPORT_COLUMNS.includes(x.type)).forEach((c, index) => {
131
- let transLabel = this.translateService.instant(this.labelKey(c,pageInfo));
132
- let transGroup = pageInfo.supportGroupingInExport ?
133
- c.group.trim() ? this.translateService.instant(c.group) : ' ' : null;
134
- if (c.type === 'workflowStatus') {
135
- transLabel = this.translateService.instant('workflowStatus');
136
- }
137
- if ((c.reportVisible === true) || (c.visible === true && c.reportVisible !== false)) {
138
- columnDef.push(new ColumnDef(c, index, transLabel, this.translateService.getDefaultLang(),transGroup));
139
- }
140
- });
141
- return columnDef;
142
- }
143
-
144
- private base64ToArrayBuffer(base64: string) {
145
- const binaryString = window.atob(base64); // Comment this if not using base64
146
- const bytes = new Uint8Array(binaryString.length);
147
- return bytes.map((byte, i) => binaryString.charCodeAt(i));
148
- }
149
-
150
- buildReportRequest(columns: TableColumn<any>[], title: string | string[], filterRequest: FilterRequest, reportType: any, pageInfo: PageInfo, searchStr: string ,orientation='PORTRAIT'): ReportRequest {
151
- const columnDef = this.buildReportColumn(columns, pageInfo);
152
- const reportRequest = new ReportRequest({
153
- dataset: [], filter: "",
154
- columns: columnDef,
155
- // sessionId: this.topPanel.userSession().sessionId,
156
- sessionId: this.config.getAuthToken(),
157
- title: this.translateService.instant(title),
158
- prefLang: this.translateService.getDefaultLang(),
159
- reportType: reportType,
160
- searchStr: searchStr,
161
- filterRequest: filterRequest,
162
- orientation: orientation});
163
- return reportRequest;
164
- }
165
-
166
- getLookupItemsByMultiFilter(listItems: GetItemsList, filterRequest?: FilterRequest): Observable<any> {
167
- listItems.pageSize = 100;
168
- filterRequest.pageSize = 100;
169
- const params = new HttpParams().set('searchStr', listItems.searchStr);
170
- let url = `${this.getApiBasePath()}/api/v1/${listItems.apiUri}`;
171
- return this.http.post(url, filterRequest, { headers: this.buildSecuredHeader(), params: params}).pipe(
172
- distinctUntilChanged(),
173
- catchError(err => of(err.message || err)));
174
- }
175
- getLookupItemsByFilter(listItems: GetItemsList, cascadedId?: any): Observable<any> {
176
- listItems.pageSize = 500;
177
- const params = new HttpParams().set('searchStr', listItems.searchStr);
178
- let url = `${this.getApiBasePath()}/api/v1/${listItems.apiUri}`;
179
- if (cascadedId) {
180
- url = url + `/${cascadedId}`
181
- }
182
-
183
- return this.http.post(url, listItems,{ headers: this.buildSecuredHeader()}).pipe(
184
- distinctUntilChanged(),
185
- catchError(err => of(err.message || err)));
186
- }
187
-
188
-
189
-
190
- downloadReport(reportRequest: ReportRequest, pageApiPath : string, readyPath? : boolean ) {
191
- const s = readyPath === true ? `/api/v1${pageApiPath}` : `/api/v1${pageApiPath}/extractAndDownloadListReport`;
192
- return this.http.post<ResponseEnvelop>(this.getApiBasePath() + s, reportRequest, {headers: this.buildSecuredHeader()}).subscribe(
193
- (resp:ResponseEnvelop) => {
194
- if (resp.valid) {
195
- if (resp.body) {
196
- const filename = reportRequest.title + "." + reportRequest.reportType;
197
- const blob = new Blob([this.base64ToArrayBuffer(resp.body)]);
198
- if (navigator.msSaveBlob) {
199
- navigator.msSaveBlob(blob, filename);
200
- } else {
201
- const link = document.createElement('a');
202
- // Browsers that support HTML5 download attribute
203
- if (link.download !== undefined) {
204
- const url = URL.createObjectURL(blob);
205
- link.setAttribute('href', url);
206
- link.setAttribute('download', filename);
207
- link.style.visibility = 'hidden';
208
- document.body.appendChild(link);
209
- link.click();
210
- document.body.removeChild(link);
211
- }
212
- }
213
- } else {
214
- this.topPanel.topPanelMessage$.next(new SnackMessage(resp.message.toString(), true, 'info'));
215
- }
216
- } else {
217
- this.topPanel.topPanelMessage$.next(new SnackMessage(resp.message.toString(), false, 'error'));
218
- }
219
- }
220
- );
221
-
222
- }
223
-
224
- private getApiBasePath(){
225
- return this.config.getBaseApi();
226
- }
227
-
228
- doActionWithAttachments(request: DoActionRequest, param2: any[], pageInfo: PageInfo) {
229
- const url = `${this.getApiBasePath()}/api/v1${pageInfo.apiUri}/doActionWithAttachments`;
230
- const formData: FormData = new FormData();
231
- formData.set('doActionRequest', new Blob([JSON.stringify(request)], {
232
- type: "application/json"
233
- }));
234
-
235
- return this.http.post(url, formData, { headers: this.buildFormSecuredHeader() }).pipe(
236
- distinctUntilChanged(),
237
- catchError((error: HttpErrorResponse) => {
238
- return of(error.error);
239
- })
240
- );
241
-
242
- }
243
- doActionWithAttachment(request: DoActionRequest, file: File, pageInfo: PageInfo) {
244
- const url = `${this.getApiBasePath()}/api/v1${pageInfo.apiUri}/doActionWithAttachments`;
245
- const formData: FormData = new FormData();
246
-
247
- formData.append('files', file);
248
- formData.set('doActionRequest', new Blob([JSON.stringify(request)], {
249
- type: "application/json"
250
- }));
251
-
252
- return this.http.post<any>(url, formData, {
253
- headers: this.buildFormSecuredHeader()
254
- }).pipe(
255
- distinctUntilChanged(),
256
- catchError((error: HttpErrorResponse) => {
257
- // Transform the error into a fake success-like response
258
- return of(error.error); // This will now be passed to `next` in subscribe()
259
- })
260
- );
261
- }
262
-
263
- encrypt(message: any) {
264
- return this.secretsManager.encryptSecret(message);
265
- }
266
-
267
- decrypt(secret: any) {
268
- return this.secretsManager.decryptSecret(secret);
269
- }
270
-
271
- public getConfirmation(): Observable<any> {
272
- const dialogRef = this.dialog.open(ActionConfirmationComponent, {
273
- data: {acceptActionLabel: 'accept',rejectActionLabel:'return', warningMsg: 'confirmation_message'},
274
- width: '600px',
275
- height: 'auto'
276
- });
277
- return dialogRef.afterClosed();
278
- }
279
-
280
- }
281
-
282
- declare global {
283
- interface Navigator {
284
- msSaveBlob: (blobOrBase64: Blob | string, filename: string) => void
285
- }
286
- }
@@ -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,252 +0,0 @@
1
- @use '@angular/material' as mat;
2
-
3
- @include mat.core();
4
-
5
- //@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@200..1000&display=swap');
6
-
7
- // Define a custom typography config that overrides the font-family as well as the
8
- // `headlines` and `body-1` levels.
9
-
10
- $custom-typography: mat.define-typography-config(
11
- $font-family: 'Cairo',
12
- $headline-1: mat.define-typography-level(112px, 112px, 300),
13
- $headline-2: mat.define-typography-level(56px, 56px, 400),
14
- $headline-3: mat.define-typography-level(45px, 48px, 400),
15
- $headline-4: mat.define-typography-level(34px, 40px, 400),
16
- $headline-5: mat.define-typography-level(24px, 32px, 400),
17
- $headline-6: mat.define-typography-level(20px, 32px, 500),
18
- $subtitle-2: mat.define-typography-level(16px, 28px, 400),
19
- $subtitle-1: mat.define-typography-level(15px, 24px, 400),
20
- $body-2: mat.define-typography-level(14px, 24px, 500),
21
- $body-1: mat.define-typography-level(14px, 20px, 400),
22
- $caption: mat.define-typography-level(12px, 20px, 400),
23
- $button: mat.define-typography-level(14px, 14px, 500),
24
- $overline: mat.define-typography-level(inherit, 1.125, 400)
25
- );
26
-
27
- @include mat.all-component-themes($custom-typography);
28
- // Override typography for all Angular Material, including mat-base-typography and all components.
29
- @include mat.all-component-typographies($custom-typography);
30
-
31
- @include mat.core-theme($custom-typography);
32
-
33
- /* For use in src/lib/core/theming/_palette.scss */
34
- $md-primary: (
35
- 50 : #e3f4f5,
36
- 100 : #b8e4e6,
37
- 200 : #89d2d5,
38
- 300 : #59bfc4,
39
- 400 : #36b2b8,
40
- 500 : var(--primary-color),
41
- 600 : #109ca4,
42
- 700 : #0d929a,
43
- 800 : #0a8991,
44
- 900 : #057880,
45
- A100 : #aef9ff,
46
- A200 : #7bf4ff,
47
- A400 : #48f0ff,
48
- A700 : #2feeff,
49
- contrast: (
50
- 50 : #000000,
51
- 100 : #000000,
52
- 200 : #000000,
53
- 300 : #000000,
54
- 400 : #000000,
55
- 500 : #ffffff,
56
- 600 : #ffffff,
57
- 700 : #ffffff,
58
- 800 : #ffffff,
59
- 900 : #ffffff,
60
- A100 : #000000,
61
- A200 : #000000,
62
- A400 : #000000,
63
- A700 : #000000,
64
- )
65
- );
66
-
67
- $md-accent: (
68
- 50 : #e0e0e0,
69
- 100 : #b3b3b3,
70
- 200 : #808080,
71
- 300 : #4d4d4d,
72
- 400 : #262626,
73
- 500 : var(--accent-color),
74
- 600 : #000000,
75
- 700 : #000000,
76
- 800 : #000000,
77
- 900 : #000000,
78
- A100 : #a6a6a6,
79
- A200 : #8c8c8c,
80
- A400 : #737373,
81
- A700 : #666666,
82
- contrast: (
83
- 50 : #000000,
84
- 100 : #000000,
85
- 200 : #000000,
86
- 300 : #ffffff,
87
- 400 : #ffffff,
88
- 500 : #ffffff,
89
- 600 : #ffffff,
90
- 700 : #ffffff,
91
- 800 : #ffffff,
92
- 900 : #ffffff,
93
- A100 : #000000,
94
- A200 : #000000,
95
- A400 : #ffffff,
96
- A700 : #ffffff,
97
- )
98
- );
99
-
100
- $md-warn: (
101
- 50 : #f9e0e0,
102
- 100 : #f0b3b3,
103
- 200 : #e68080,
104
- 300 : #db4d4d,
105
- 400 : #d42626,
106
- 500 : #cc0000,
107
- 600 : #c70000,
108
- 700 : #c00000,
109
- 800 : #b90000,
110
- 900 : #ad0000,
111
- A100 : #ffd7d7,
112
- A200 : #ffa4a4,
113
- A400 : #ff7171,
114
- A700 : #ff5858,
115
- contrast: (
116
- 50 : #000000,
117
- 100 : #000000,
118
- 200 : #000000,
119
- 300 : #ffffff,
120
- 400 : #ffffff,
121
- 500 : #ffffff,
122
- 600 : #ffffff,
123
- 700 : #ffffff,
124
- 800 : #ffffff,
125
- 900 : #ffffff,
126
- A100 : #000000,
127
- A200 : #000000,
128
- A400 : #000000,
129
- A700 : #000000,
130
- )
131
- );
132
-
133
-
134
- $my-theme-primary: mat.define-palette($md-primary);
135
- $my-theme-accent: mat.define-palette($md-accent);
136
- //the third, for the warn color, is the predefined material red palette
137
- $my-theme-warn: mat.define-palette(mat.$red-palette);
138
-
139
- $invoiceq-theme: mat.define-light-theme($my-theme-primary, $my-theme-accent, $my-theme-warn);
140
-
141
- @include mat.all-component-themes($invoiceq-theme);
142
-
143
- :root {
144
- --primary-color: #00A8C4;
145
- --background-color: white;
146
- --accent-color: #222222;
147
- --primary-color-2nd: #1C355E;
148
- }
149
-
150
- .primpary-color-a40 {
151
- background-color: rgba(var(--primary-color), 0.4);
152
- }
153
-
154
- .mat-button-toggle {
155
- background-color: mat.get-color-from-palette($md-primary);
156
- color: mat.get-color-from-palette($md-primary, default-contrast);
157
- }
158
-
159
- .mat-sort-header-arrow {
160
- color: white !important;
161
- }
162
- .mat-button-toggle-checked {
163
- background-color: mat.get-color-from-palette($md-accent);
164
- color: mat.get-color-from-palette($md-accent, default-contrast);
165
- }
166
-
167
- .mat-checkbox-layout { white-space: normal !important; }
168
- .mat-form-field-wrapper {
169
- padding-bottom: 0.25em;
170
- }
171
-
172
- .mat-form-field-prefix {
173
- align-self: center;
174
- margin-top: -2px;
175
- font-weight: bold;
176
- }
177
-
178
- .mat-form-field {
179
- font-size: 14px;
180
- //font-weight: bold;
181
- //border-radius: 12px !important;
182
- }
183
-
184
- .mat-form-field-appearance-outline .mat-form-field-outline {
185
- background-color: white;
186
- border-radius: 5px;
187
- }
188
-
189
- .mat-list-option[aria-selected="true"] {
190
- background: transparent !important;
191
- color: var(--primary-color);
192
- }
193
- .mat-list-option {
194
- background: transparent !important;
195
- margin-top: 1px;
196
- }
197
- .mat-select-panel {
198
- font-size: 18px;
199
- width: 50%;
200
- }
201
- .mat-list-option:hover {
202
- font-weight: bold;
203
- background-color: transparent !important;
204
- }
205
-
206
- .mat-drawer-container {
207
- background-color: transparent !important;
208
- }
209
-
210
- tr.mat-row:hover {
211
- font-weight: bold;
212
- box-shadow: 1px 3px 3px rgba(0,0,0,0.25);
213
-
214
- transform: scale(1);
215
- }
216
- .mat-flat-button.mat-accent, .mat-raised-button.mat-accent, .mat-fab.mat-accent, .mat-mini-fab.mat-accent {
217
- background-color: var(--accent-color);
218
- }
219
-
220
- .no-data {
221
- pointer-events: none;
222
- }
223
- .allow-no-data {
224
- color: red;
225
- }
226
-
227
-
228
- .iq_loading {
229
- position: absolute;
230
- top: 0;
231
- left: 0;
232
- right: 0;
233
- background: rgba(0, 0, 0, 0.15);
234
- z-index: 1000;
235
- display: flex;
236
- align-items: center;
237
- justify-content: center;
238
- width: 100%;
239
- height: 100%;
240
- }
241
-
242
- .primary-chip {
243
- background-color: var(--primary-color);
244
- }
245
-
246
- .accent-chip {
247
- background-color: var(--accent-color);
248
- }
249
-
250
-
251
-
252
- //.mat-sidenav-container { background-color: transparent!important; }