@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,588 +0,0 @@
1
- import {ChangeDetectionStrategy, Component, EventEmitter, Injector, Input, OnInit, Output} from '@angular/core';
2
- import {FieldInfo} from "../../base-model/field-info";
3
- import {EMPTY_PAGE_INFO, PageInfo} from "../../base-model/page-info";
4
- import {TableColumn} from "../../base-model/table-column.interface";
5
- import {FieldMessage} from "../../base-model/api-response";
6
- import {TranslateModule, TranslateService} from "@ngx-translate/core";
7
- import {BackendService} from "../../services/backend-service";
8
- import {ActivatedRoute, Router} from "@angular/router";
9
- import {FormBuilder, FormGroup} from "@angular/forms";
10
- import {formatDate, NgForOf, NgIf} from "@angular/common";
11
- import {FlexLayoutModule} from "@angular/flex-layout";
12
- import {MatMenu, MatMenuItem, MatMenuTrigger} from "@angular/material/menu";
13
- import {MatButton, MatButtonModule} from "@angular/material/button";
14
- import {BaseTableComponent} from "../base-table/base-table.component";
15
- import {MatIconModule} from "@angular/material/icon";
16
- import {FilterRequest} from "../../base-model/filter-request";
17
- import {ReportRequest} from "../../base-model/report-request.model";
18
- import {Filter} from "../../base-model/filter.model";
19
- import {TitleBarComponent} from "../title-bar/title-bar.component";
20
- import {BaseFormCanvasComponent} from "../base-form-canvas/base-form-canvas.component";
21
- import {DRILL_DOWN_ACTION, JUNIOR_DOWN_ACTION, SnackMessage, TablePageUserAction} from "../../base-model";
22
- import {} from "../audit-log-details-dialog/audit-log-details-dialog.component";
23
- import {MatDialog} from "@angular/material/dialog";
24
- import {ReportDetailsDialogComponent} from "../report-details-dialog/report-details-dialog.component";
25
- import { cloneDeep } from 'lodash';
26
- import {MatTooltip} from "@angular/material/tooltip";
27
- import {Directionality} from "@angular/cdk/bidi";
28
-
29
-
30
- const NON_REPORT_COLUMNS = ['listAction', 'button', 'checkbox'];
31
-
32
- @Component({
33
- selector: 'app-report-form',
34
- standalone: true,
35
- imports: [
36
- FlexLayoutModule,
37
- TitleBarComponent,
38
- BaseFormCanvasComponent,
39
- MatMenu,
40
- MatMenuItem,
41
- NgForOf,
42
- MatMenuTrigger,
43
- MatButtonModule,
44
- TranslateModule,
45
- BaseTableComponent,
46
- NgIf,
47
- MatIconModule,
48
- MatButton,
49
- MatTooltip
50
- ],
51
- templateUrl: './report-form.component.html',
52
- styleUrl: './report-form.component.scss'
53
- })
54
- export class ReportFormComponent implements OnInit {
55
- @Input()
56
- showDetails : any = [];
57
-
58
- @Input()
59
- showExtractButton: boolean = true;
60
-
61
- @Input()
62
- columns: TableColumn<any>[] =[];
63
-
64
- @Input() actionRequestCallback!: (actionRequest: TablePageUserAction) => TablePageUserAction;
65
- @Input() enrichDrillDownReportRequest!: (actionRequest: TablePageUserAction, reportRequest: ReportRequest) => TablePageUserAction;
66
- @Input() enrichHyperLinkReportRequest!: (actionRequest: TablePageUserAction, reportRequest: ReportRequest) => TablePageUserAction;
67
- @Input() enrichJuniorReportRequest!: (actionRequest: TablePageUserAction, reportRequest: ReportRequest) => TablePageUserAction;
68
-
69
- @Output()
70
- userAction: EventEmitter<TablePageUserAction> = new EventEmitter<TablePageUserAction>();
71
- activeLevel: number = 1;
72
-
73
- private filterRequest: FilterRequest;
74
- x: any;
75
- isEditable: boolean = true;
76
- fields: FieldInfo[] = [];
77
- pageInfo: PageInfo = EMPTY_PAGE_INFO;
78
- drillDownPageInfo: PageInfo = EMPTY_PAGE_INFO;
79
- drillDownColumns: TableColumn<any>[] = [];
80
- hideDrillDownButton: false;
81
-
82
- juniorPageInfo: PageInfo = EMPTY_PAGE_INFO;
83
- juniorColumns: TableColumn<any>[] = [];
84
-
85
- columnsDefinition: TableColumn<any>[] = [];
86
- types: string[] = ["pdf", "csv", "xlsx"]
87
- searchStr: string = '';
88
-
89
- errors: FieldMessage[] = [];
90
-
91
- reloadData: boolean = false;
92
- backButtonEnabled: boolean = true;
93
-
94
-
95
- reportRequest: ReportRequest = new ReportRequest({});
96
- childReportRequest: ReportRequest = new ReportRequest({});
97
- juniorReportRequest: ReportRequest = new ReportRequest({});
98
- public reportForm: FormGroup;
99
- readyToSearch = false;
100
- private pageSize: any;
101
- private dialogReportRequest: any;
102
- currentDirection: 'ltr' | 'rtl';
103
-
104
- constructor(private translateService: TranslateService,
105
- public backendService: BackendService,
106
- private activatedRoute: ActivatedRoute,
107
- private injector: Injector,
108
- private router: Router,
109
- private route: ActivatedRoute,
110
- private directionality: Directionality,
111
- public dialog: MatDialog,
112
- private fb: FormBuilder) {
113
- }
114
-
115
- disableExportAction : boolean = false;
116
-
117
- ngOnInit(): void {
118
- this.currentDirection = this.directionality.value;
119
- this.directionality.change.subscribe((value) => {
120
- this.currentDirection = value;
121
- })
122
-
123
- this.activatedRoute.data.subscribe(data => {
124
- this.pageInfo = data['pageInfo'];
125
- this.pageSize = this.pageInfo.pageSize ?? 10;
126
- this.filterRequest = new FilterRequest(this.pageSize);
127
- data['pageInfo'].lazyLoadData = true;
128
- this.drillDownPageInfo = data['drillDownPageInfo'];
129
- this.drillDownColumns = data['drillDownColumns']?.filter(c => c.property !== 'selectItem');
130
- this.hideDrillDownButton = data['hideDrillDownButton'] ?? false;
131
- this.juniorPageInfo = data['juniorPageInfo'];
132
- this.juniorColumns = data['juniorColumns'];
133
- this.columnsDefinition = data['columnsDefinition'].filter(c => (this.drillDownPageInfo && this.drillDownColumns || (!NON_REPORT_COLUMNS.includes(c.type))));
134
- this.fields = data['fields'];
135
- if (data['enrichDrillDownReportRequest']) {
136
- this.enrichDrillDownReportRequest = data['enrichDrillDownReportRequest'](this.injector);
137
- }
138
- if (data['enrichJuniorReportRequest']) {
139
- this.enrichJuniorReportRequest = data['enrichJuniorReportRequest'](this.injector);
140
- }
141
-
142
- if (data['enrichHyperLinkReportRequest']) {
143
- this.enrichHyperLinkReportRequest = data['enrichHyperLinkReportRequest'](this.injector);
144
- }
145
- });
146
- this.route.queryParamMap.subscribe(params => {
147
- const isComparisonReport = params.get('comparisonReport') === 'true';
148
-
149
- if (isComparisonReport) {
150
- const comparisonStr = sessionStorage.getItem('comparisonReportPageInfo');
151
-
152
- if (comparisonStr) {
153
- const comparisonData = JSON.parse(comparisonStr);
154
-
155
- this.pageInfo.lazyLoadData = comparisonData.lazyLoadData ?? false;
156
- this.activeLevel = comparisonData.activeLevel ?? 2;
157
- this.isEditable = false;
158
- this.backButtonEnabled = false;
159
- this.drillDownPageInfo = comparisonData.drillDownPageInfo;
160
- this.drillDownColumns = comparisonData.drillDownColumns;
161
- this.reportForm = this.fb.group({
162
- directorate: [[]],
163
- fromDate: [''],
164
- toDate: [''],
165
- sector: [''],
166
- });
167
-
168
- this.reportForm.patchValue(comparisonData.form)
169
- this.fields = this.fields.filter(c => c.type !== 'checkbox');
170
-
171
- const reportRequest = comparisonData.reportRequest;
172
-
173
- this.childReportRequest = this.backendService.buildReportRequest(
174
- this.drillDownColumns,
175
- `${this.drillDownPageInfo.labelsSection}.${this.drillDownPageInfo.id}`,
176
- reportRequest,
177
- '',
178
- this.drillDownPageInfo,
179
- 'LANDSCAPE'
180
- );
181
-
182
- }
183
- }
184
- });
185
- }
186
-
187
-
188
- // ngOnChanges({item, errors, fields}: SimpleChanges): void {
189
- // // errors?.currentValue?.forEach((msg: FieldMessage) => {
190
- // // this.backendService.parentForm.get(msg.fieldName)?.setErrors({serverError: msg.message});
191
- // // });
192
- // // if (fields?.currentValue && !fields.isFirstChange()){
193
- // // this.buildForm();
194
- // // }
195
- // // this.buildForm();
196
- // }
197
-
198
- isMatchHeight() {
199
- return this.pageInfo.pageHeight === 'match';
200
- }
201
-
202
-
203
- doAction(type: string) {
204
- if (this.backendService.parentForm.valid) {
205
- this.reloadData = !this.reloadData;
206
- const filterRequest: FilterRequest = new FilterRequest(this.pageSize);
207
- filterRequest.filters = [];
208
- let paramsString: string[] = [];
209
- this.fields.filter(x => x.type !== 'spacer').forEach(f => {
210
- if (this.getParamValue(f) != null && this.getParamValue(f).toString().trim() !== '')
211
- {
212
- if (f.type === 'multi-select' || f.type === 'lookup') {
213
- // do not filter if this field as cascading for another one and the other one got selected values
214
- const childFieldIdx = this.fields.findIndex(field => field.cascadedBy === f.property);
215
- if (childFieldIdx > -1 && this.backendService.parentForm.get(this.fields[childFieldIdx].property)?.value?.length > 0) {
216
- return;
217
- }
218
- const idz: number[] = [];
219
- const param: string[] = [];
220
- if (this.backendService.parentForm.get(f.property)?.value && Array.isArray(this.backendService.parentForm.get(f.property)?.value)
221
- && this.backendService.parentForm.get(f.property)?.value.length > 0) {
222
- this.backendService.parentForm.get(f.property)?.value.forEach((a: {
223
- channelId: number;
224
- englishName: string;
225
- id: number;
226
- }) => {
227
- if (f.flattenBySubAttribute) {
228
- idz.push(a[f.flattenBySubAttribute]);
229
- param.push(a[f.flattenBySubAttribute]);
230
- } else if (this.fields.find(s => s.property === 'terminalId')) {
231
- idz.push(a.channelId);
232
- param.push(a.englishName);
233
- } else {
234
- idz.push(a.id);
235
- param.push(a.englishName);
236
- }
237
- })
238
- filterRequest.filters?.push(new Filter({
239
- id: f.property, fieldName: f.property, label: this.translateService.instant(f.label),
240
- filterType: 'FILED_FILTER', operator: f.filterOperator,
241
- valueObject: idz
242
- }));
243
- paramsString.push(this.translateService.instant(f.label) + ' : ' + param.join(','));
244
- } else if (this.backendService.parentForm.get(f.property)?.value && f.flattenBySubAttribute) {
245
- filterRequest.filters?.push(new Filter({
246
- id: f.property, fieldName: f.property, label: this.translateService.instant(f.label),
247
- filterType: 'FILED_FILTER', operator: f.filterOperator,
248
- valueObject: this.getParamValue(f)[f.flattenBySubAttribute]
249
- }));
250
- }
251
- } else {
252
- if (this.backendService.parentForm.get(f.property)?.value !== null &&
253
- this.backendService.parentForm.get(f.property)?.value !== undefined &&
254
- this.backendService.parentForm.get(f.property)?.value !== "") {
255
- filterRequest.filters?.push(new Filter({
256
- id: f.property, fieldName: f.property, label: this.translateService.instant(f.label),
257
- filterType: 'FILED_FILTER', operator: f.filterOperator,
258
- valueObject: this.getParamValue(f)
259
- }));
260
- }
261
- paramsString.push(this.translateService.instant(f.label) + ' : ' + this.getParamValueLabel(f));
262
- }
263
- }})
264
- const reportRequest = this.backendService.buildReportRequest(this.columnsDefinition, this.pageInfo.labelsSection + '.' + this.pageInfo.id,
265
- filterRequest, type, this.pageInfo, 'LANDSCAPE');
266
- reportRequest.searchStr = paramsString.join(' , ');
267
- this.reportRequest = reportRequest;
268
- // this.activeLevel = 1;
269
- } else {
270
- this.backendService.topPanelMessage$.next(new SnackMessage('INVALID_REPORT_FORM', true, 'error'));
271
- }
272
- }
273
-
274
- private getParamValue(f: FieldInfo) {
275
- if (f.type === 'date' && this.backendService.parentForm.get(f.property)?.value) {
276
- return formatDate(this.backendService.parentForm.get(f.property)?.value, 'yyyy-MM-dd', 'en_US')
277
- }else if (f.type === 'checkbox') {
278
- return !!this.backendService.parentForm.get(f.property)?.value;
279
- }else {
280
- return this.backendService.parentForm.get(f.property)?.value;
281
- }
282
- }
283
-
284
- private getParamValueLabel(f: FieldInfo) {
285
- if (f.type === 'checkbox') {
286
- return this.backendService.parentForm.get(f.property)?.value ? this.translateService.instant('yes') : this.translateService.instant('no');
287
- }else {
288
- return this.backendService.parentForm.get(f.property)?.value;
289
- }
290
- }
291
-
292
- getTitle() {
293
- const pageInfoMap = {
294
- 1: this.pageInfo,
295
- 2: this.drillDownPageInfo,
296
- 3: this.juniorPageInfo
297
- };
298
-
299
- const currentInfo = pageInfoMap[this.activeLevel] || this.pageInfo;
300
- return `${currentInfo.labelsSection}.${currentInfo.id}`;
301
- }
302
-
303
- updateForm($event: FormGroup) {
304
- this.reportForm = $event;
305
- this.backendService.parentForm = $event;
306
-
307
- this.setupDependentFieldWatchers();
308
-
309
- this.backendService.parentForm.valueChanges.subscribe(x => {
310
- this.readyToSearch = this.backendService.parentForm.valid;
311
- }
312
-
313
- );
314
- }
315
-
316
- private setupDependentFieldWatchers() {
317
- this.fields
318
- .filter(field => field.lookupFilterList && field.lookupFilterList.length > 0)
319
- .forEach(field => {
320
- const dependentFields = field.lookupFilterList.map(f => f.fieldName);
321
-
322
- dependentFields.forEach(dependentFieldName => {
323
- const dependentControl = this.reportForm.get(dependentFieldName);
324
- if (dependentControl) {
325
- dependentControl.valueChanges.subscribe(() => {
326
- const targetControl = this.reportForm.get(field.property);
327
- if (targetControl) {
328
- targetControl.setValue([]);
329
- }
330
- });
331
- }
332
- });
333
- });
334
- }
335
-
336
- isValidForm() {
337
- return this.readyToSearch ;
338
-
339
- }
340
-
341
-
342
-
343
- emitUserAction($event: TablePageUserAction) {
344
- $event.pageInfo = this.pageInfo;
345
- this.doADrillDownAction($event);
346
- }
347
-
348
- emitHyperLinkAction($event: TablePageUserAction) {
349
- if (!this.shouldProcessEventItem($event.item)) return;
350
-
351
- const item = $event.item;
352
- this.prepareDialogReportRequest(item);
353
- const reportRequest = this.buildDialogReportRequest();
354
- reportRequest.filterRequest.pageIndex = 0
355
- const dialogRef = this.dialog.open(ReportDetailsDialogComponent, {
356
- data: {
357
- pageInfo: this.juniorPageInfo,
358
- request: reportRequest,
359
- columns: this.juniorColumns,
360
- item,
361
- },
362
- height: '50vw',
363
- maxWidth: '120vw',
364
- direction: this.currentDirection,
365
- disableClose: false,
366
- });
367
-
368
- dialogRef.afterOpened().subscribe(() => this.doHyperLinkAction($event));
369
- dialogRef.afterClosed().subscribe(() => {});
370
- }
371
-
372
- private prepareDialogReportRequest(item: any): void {
373
- this.dialogReportRequest = cloneDeep(this.reportRequest);
374
- this.dialogReportRequest.filterRequest = { filters: [] };
375
-
376
- this.addStandardFilters(item);
377
- this.addOrReplaceFilter('isec1', 'iSec', item['isec_value']);
378
- this.addFilterType();
379
- }
380
-
381
- private addStandardFilters(item: any): void {
382
- const standardFilters = [
383
- { key: 'period', value: item['period'] },
384
- { key: 'year', value: item['year'] },
385
- { key: 'sector', value: item['sectorCode'] },
386
- { key: 'directorate', value: item['directorateCode'] },
387
- { key: 'subTaxRate', value: item['tax_rate_code'] },
388
- ];
389
-
390
- standardFilters.forEach(({ key, value }) =>
391
- this.dialogReportRequest.filterRequest.filters.push(
392
- this.createFilter(key, key, value)
393
- )
394
- );
395
- }
396
-
397
- private addFilterType(): void {
398
- const isTax = this.dialogReportRequest.actionKey?.toLowerCase().includes('tax');
399
- const filterType = isTax ? 'TAX' : 'VALUE';
400
-
401
- this.dialogReportRequest.filterRequest.filters.push(
402
- this.createFilter('filterType', 'filterType', filterType)
403
- );
404
- }
405
-
406
- private buildDialogReportRequest(): any {
407
- return this.backendService.buildReportRequest(
408
- this.juniorColumns,
409
- `${this.juniorPageInfo.labelsSection}.${this.juniorPageInfo.id}`,
410
- { ...this.dialogReportRequest.filterRequest },
411
- '',
412
- this.juniorPageInfo,
413
- 'LANDSCAPE'
414
- );
415
- }
416
-
417
- private createFilter(key: string, fieldName: string, value: any): Filter {
418
- return new Filter({
419
- key,
420
- fieldName,
421
- label: '',
422
- filterType: 'FILED_FILTER',
423
- operator: 'EQUALS',
424
- valueObject: value,
425
- });
426
- }
427
-
428
- private addOrReplaceFilter(id: string, fieldName: string, value: any): void {
429
- const filter = new Filter({
430
- id,
431
- fieldName,
432
- label: '',
433
- filterType: 'FILED_FILTER',
434
- operator: 'EQUALS',
435
- valueObject: value,
436
- });
437
-
438
- const filters = this.dialogReportRequest.filterRequest.filters;
439
- const existingIndex = filters.findIndex((f: Filter) => f.id === id);
440
-
441
- if (existingIndex !== -1) {
442
- filters.splice(existingIndex, 1, filter);
443
- } else {
444
- filters.push(filter);
445
- }
446
- }
447
-
448
-
449
-
450
- emitJuniorAction($event: TablePageUserAction) {
451
- const juniorAction = JUNIOR_DOWN_ACTION;
452
- juniorAction.pageInfo = this.drillDownPageInfo;
453
- this.doJuniorAction($event);
454
- }
455
-
456
- drillDown() {
457
- const drilldownaction = DRILL_DOWN_ACTION;
458
- drilldownaction.pageInfo = this.drillDownPageInfo;
459
- this.doADrillDownAction(drilldownaction);
460
- }
461
-
462
- private doJuniorAction($event: TablePageUserAction) {
463
- if (this.juniorColumns && this.juniorPageInfo) {
464
- if (this.enrichJuniorReportRequest) {
465
- if (this.activeLevel === 2) {
466
- this.isEditable = false;
467
- this.disableExportAction = this.juniorPageInfo.hideReportsExtractButton || false;
468
- this.juniorReportRequest = this.backendService.buildReportRequest(this.juniorColumns,
469
- this.juniorPageInfo.labelsSection + '.' + this.juniorPageInfo.id,
470
- this.reportRequest.filterRequest, '', this.juniorPageInfo, 'LANDSCAPE');
471
- this.enrichJuniorReportRequest($event, this.juniorReportRequest);
472
- }
473
- }
474
- this.activeLevel = this.activeLevel +1;
475
- }
476
- }
477
- private doADrillDownAction($event: TablePageUserAction) {
478
- if (this.drillDownColumns && this.drillDownPageInfo) {
479
- if (this.enrichDrillDownReportRequest) {
480
- if (this.activeLevel === 1) {
481
- this.isEditable = false;
482
- this.childReportRequest = this.backendService.buildReportRequest(this.drillDownColumns,
483
- this.drillDownPageInfo.labelsSection + '.' + this.drillDownPageInfo.id,
484
- this.reportRequest.filterRequest, '', this.drillDownPageInfo, 'LANDSCAPE');
485
- this.disableExportAction = this.drillDownPageInfo.hideReportsExtractButton || false;
486
- this.enrichDrillDownReportRequest($event, this.childReportRequest);
487
- }
488
- }
489
- this.activeLevel = this.activeLevel +1;
490
- }
491
- }
492
-
493
- private doHyperLinkAction($event: TablePageUserAction) {
494
- if (this.enrichHyperLinkReportRequest) {
495
- this.juniorReportRequest = this.backendService.buildReportRequest(this.juniorColumns,
496
- this.juniorPageInfo.labelsSection + '.' + this.juniorPageInfo.id,
497
- this.dialogReportRequest.filterRequest, '', this.juniorPageInfo, 'LANDSCAPE');
498
- this.disableExportAction = this.juniorPageInfo.hideReportsExtractButton || false;
499
- this.enrichHyperLinkReportRequest($event, this.juniorReportRequest);
500
- }
501
- }
502
-
503
- extractReport(reportType: any) {
504
- if (this.activeLevel === 1) {
505
- this.reportRequest.reportType = reportType;
506
- this.backendService.downloadReport(this.reportRequest, this.pageInfo.apiUri );
507
- }
508
- else if (this.activeLevel === 2) {
509
- this.childReportRequest.reportType = reportType;
510
- this.backendService.downloadReport(this.childReportRequest, this.drillDownPageInfo.apiUri );
511
- }
512
- else if (this.activeLevel === 3) {
513
- this.juniorReportRequest.reportType = reportType;
514
- this.backendService.downloadReport(this.juniorReportRequest, this.juniorPageInfo.apiUri );
515
- }
516
- }
517
-
518
- goUp() {
519
- this.isEditable = true;
520
- this.activeLevel = this.activeLevel -1;
521
- this.doAction(this.x);
522
- this.reloadData = true;
523
- if (this.activeLevel >1) {
524
- this.isEditable = false;
525
- }
526
- this.disableExportAction = false
527
- }
528
-
529
- drillDownEnabled() {
530
- return this.drillDownPageInfo && !this.hideDrillDownButton && !this.getIsEmptyList();
531
- }
532
-
533
- drillDownLabel() {
534
- return `${this.pageInfo.labelsSection}.drillDownLabel` ;
535
- }
536
- getIsEmptyList() {
537
- return this.backendService.isEmptyItems || this.disableExportAction === true;
538
- }
539
- clear() {
540
- const currentUrl = this.router.url;
541
- this.router.navigateByUrl('/', { skipLocationChange: true }).then(() => {
542
- this.router.navigate([currentUrl]);
543
- });
544
-
545
- // if (this.reportForm) {
546
- // this.reportForm.reset();
547
- //
548
- // this.fields.forEach(field => {
549
- // if (field.type === 'lookup' || field.type === 'multi-select') {
550
- // const control = this.reportForm.get(field.property);
551
- // if (control) {
552
- // control.setValue([]);
553
- // }
554
- // }
555
- // });
556
- // }
557
-
558
- }
559
-
560
-
561
- isFormEmpty(): boolean {
562
- if (!this.reportForm || !this.reportForm.value) {
563
- return true;
564
- }
565
-
566
- return Object.values(this.reportForm.value).every(value => {
567
- if (value === null || value === undefined || value === '') {
568
- return true;
569
- }
570
- return Array.isArray(value) && value.length === 0;
571
-
572
-
573
- });
574
- }
575
-
576
- shouldProcessEventItem(item: any): boolean {
577
- const groupByProp = this.pageInfo?.groupByProperty;
578
- const groupByValues = this.pageInfo?.groupByValue;
579
-
580
- if (!groupByProp || !groupByValues || !item[groupByProp]) {
581
- return true;
582
- }
583
-
584
- const value = item[groupByProp].toString();
585
-
586
- return !groupByValues.some(v => value.includes(v) && value.length >= v.length);
587
- }
588
- }
@@ -1,62 +0,0 @@
1
- <div class="mainSearchBar">
2
- <div
3
- fxLayout="row"
4
- fxLayoutAlign="start center"
5
- fxLayoutGap="16px"
6
- class="search"
7
- style="width: 100%; padding: 0 16px; margin-bottom: 16px;"
8
- >
9
-
10
- <mat-form-field appearance="outline" class="search__field" fxFlex="50">
11
- <input
12
- matInput
13
- class="search__input"
14
- placeholder="Search..."
15
- (keydown.enter)= onSearch()
16
- [(ngModel)]="searchValue" />
17
- </mat-form-field>
18
-
19
- <mat-form-field appearance="outline" class="search__field" fxFlex="15">
20
- <mat-select
21
- class="search__toggle"
22
- [(ngModel)]="searchType"
23
- placeholder="Type">
24
- <mat-option value="exact">Exact</mat-option>
25
- <mat-option value="like">Like</mat-option>
26
- </mat-select>
27
- </mat-form-field>
28
-
29
-
30
- <mat-form-field appearance="outline" class="search__field" fxFlex="15">
31
- <mat-select
32
- class="search__toggle"
33
- [(ngModel)]="selectedSortKey"
34
- placeholder="Sort By">
35
- <mat-option *ngFor="let col of getColumns()" [value]="col.property">
36
- {{ labelKey(col) | translate }}
37
- </mat-option>
38
- </mat-select>
39
- </mat-form-field>
40
-
41
- <mat-form-field appearance="outline" class="search__field" fxFlex="10">
42
- <mat-select
43
- class="search__toggle"
44
- [(ngModel)]="selectedSortType"
45
- placeholder="Type">
46
- <mat-option value="ASC">ASC</mat-option>
47
- <mat-option value="DESC">DESC</mat-option>
48
- </mat-select>
49
- </mat-form-field>
50
- <div
51
- class="search__button"
52
- fxLayout="row"
53
- fxLayoutAlign="center center"
54
- style="margin-bottom: 6px "
55
- >
56
- <div class="icon-design" (click)="onSearch()">
57
- <mat-icon style="height: 30px; width: 30px; font-size: 30px; margin-bottom: 15px;cursor: pointer" color="primary">search</mat-icon>
58
- </div>
59
- </div>
60
-
61
- </div>
62
- </div>
@@ -1,8 +0,0 @@
1
- ::ng-deep .search__button {
2
- display: flex;
3
- align-items: center;
4
- justify-content: center;
5
- height: 56px;
6
- margin-top: -6px;
7
-
8
- }
@@ -1,25 +0,0 @@
1
- import {async, ComponentFixture, TestBed} from '@angular/core/testing';
2
-
3
- import {SearchBarComponent} from './search-bar.component';
4
-
5
- describe('SearchBarComponent', () => {
6
- let component: SearchBarComponent;
7
- let fixture: ComponentFixture<SearchBarComponent>;
8
-
9
- beforeEach(async(() => {
10
- TestBed.configureTestingModule({
11
- declarations: [ SearchBarComponent ]
12
- })
13
- .compileComponents();
14
- }));
15
-
16
- beforeEach(() => {
17
- fixture = TestBed.createComponent(SearchBarComponent);
18
- component = fixture.componentInstance;
19
- fixture.detectChanges();
20
- });
21
-
22
- it('should create', () => {
23
- expect(component).toBeTruthy();
24
- });
25
- });