@ministryofjustice/hmpps-digital-prison-reporting-frontend 4.27.0 → 4.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (468) hide show
  1. package/dpr/assets/app.js.map +2 -2
  2. package/dpr/components/_async/async-filters-form/sortByTemplate.js +60 -1
  3. package/dpr/components/_async/async-filters-form/sortByTemplate.js.map +2 -2
  4. package/dpr/components/_async/async-filters-form/types.d.js +16 -1
  5. package/dpr/components/_async/async-filters-form/types.d.js.map +2 -2
  6. package/dpr/components/_async/async-filters-form/utils.js +180 -1
  7. package/dpr/components/_async/async-filters-form/utils.js.map +2 -2
  8. package/dpr/components/_catalogue/catalogue/types.js +16 -1
  9. package/dpr/components/_catalogue/catalogue/types.js.map +2 -2
  10. package/dpr/components/_catalogue/catalogue/utils.js +83 -1
  11. package/dpr/components/_catalogue/catalogue/utils.js.map +2 -2
  12. package/dpr/components/_catalogue/catalogue-list/utils.js +140 -1
  13. package/dpr/components/_catalogue/catalogue-list/utils.js.map +2 -2
  14. package/dpr/components/_charts/chart/Chart.js +99 -1
  15. package/dpr/components/_charts/chart/Chart.js.map +2 -2
  16. package/dpr/components/_charts/chart/ChartColours.js +61 -1
  17. package/dpr/components/_charts/chart/ChartColours.js.map +2 -2
  18. package/dpr/components/_charts/chart/ChartTimeseries.js +101 -1
  19. package/dpr/components/_charts/chart/ChartTimeseries.js.map +2 -2
  20. package/dpr/components/_charts/chart/bar/BarChart.js +193 -1
  21. package/dpr/components/_charts/chart/bar/BarChart.js.map +2 -2
  22. package/dpr/components/_charts/chart/bar/types.js +16 -1
  23. package/dpr/components/_charts/chart/bar/types.js.map +2 -2
  24. package/dpr/components/_charts/chart/bar/validate.js +73 -1
  25. package/dpr/components/_charts/chart/bar/validate.js.map +2 -2
  26. package/dpr/components/_charts/chart/bar-timeseries/BarTimeseriesChart.js +80 -1
  27. package/dpr/components/_charts/chart/bar-timeseries/BarTimeseriesChart.js.map +2 -2
  28. package/dpr/components/_charts/chart/bar-timeseries/types.js +16 -1
  29. package/dpr/components/_charts/chart/bar-timeseries/types.js.map +2 -2
  30. package/dpr/components/_charts/chart/bar-timeseries/validate.js +48 -1
  31. package/dpr/components/_charts/chart/bar-timeseries/validate.js.map +2 -2
  32. package/dpr/components/_charts/chart/buckets/Buckets.js +194 -1
  33. package/dpr/components/_charts/chart/buckets/Buckets.js.map +2 -2
  34. package/dpr/components/_charts/chart/buckets/types.js +16 -1
  35. package/dpr/components/_charts/chart/buckets/types.js.map +2 -2
  36. package/dpr/components/_charts/chart/buckets/validate.js +40 -1
  37. package/dpr/components/_charts/chart/buckets/validate.js.map +2 -2
  38. package/dpr/components/_charts/chart/chart-config.js +62 -1
  39. package/dpr/components/_charts/chart/chart-config.js.map +2 -2
  40. package/dpr/components/_charts/chart/doughnut/DoughnutChart.js +96 -1
  41. package/dpr/components/_charts/chart/doughnut/DoughnutChart.js.map +2 -2
  42. package/dpr/components/_charts/chart/doughnut/types.js +16 -1
  43. package/dpr/components/_charts/chart/doughnut/types.js.map +2 -2
  44. package/dpr/components/_charts/chart/doughnut/validate.js +48 -1
  45. package/dpr/components/_charts/chart/doughnut/validate.js.map +2 -2
  46. package/dpr/components/_charts/chart/heatmap/HeatmapChart.js +213 -1
  47. package/dpr/components/_charts/chart/heatmap/HeatmapChart.js.map +2 -2
  48. package/dpr/components/_charts/chart/heatmap/types.js +16 -1
  49. package/dpr/components/_charts/chart/heatmap/types.js.map +2 -2
  50. package/dpr/components/_charts/chart/heatmap/validate.js +40 -1
  51. package/dpr/components/_charts/chart/heatmap/validate.js.map +2 -2
  52. package/dpr/components/_charts/chart/line/LineChart.js +107 -1
  53. package/dpr/components/_charts/chart/line/LineChart.js.map +2 -2
  54. package/dpr/components/_charts/chart/line/types.js +16 -1
  55. package/dpr/components/_charts/chart/line/types.js.map +2 -2
  56. package/dpr/components/_charts/chart/line/validate.js +48 -1
  57. package/dpr/components/_charts/chart/line/validate.js.map +2 -2
  58. package/dpr/components/_charts/chart/line-timeseries/LineTimeseriesChart.js +81 -1
  59. package/dpr/components/_charts/chart/line-timeseries/LineTimeseriesChart.js.map +2 -2
  60. package/dpr/components/_charts/chart/line-timeseries/types.js +16 -1
  61. package/dpr/components/_charts/chart/line-timeseries/types.js.map +2 -2
  62. package/dpr/components/_charts/chart/line-timeseries/validate.js +48 -1
  63. package/dpr/components/_charts/chart/line-timeseries/validate.js.map +2 -2
  64. package/dpr/components/_charts/utils.js +240 -1
  65. package/dpr/components/_charts/utils.js.map +2 -2
  66. package/dpr/components/_dashboards/dashboard-list/types.js +16 -1
  67. package/dpr/components/_dashboards/dashboard-list/types.js.map +2 -2
  68. package/dpr/components/_dashboards/dashboard-list/utils.js +170 -1
  69. package/dpr/components/_dashboards/dashboard-list/utils.js.map +2 -2
  70. package/dpr/components/_dashboards/dashboard-list/validate.js +43 -1
  71. package/dpr/components/_dashboards/dashboard-list/validate.js.map +2 -2
  72. package/dpr/components/_dashboards/dashboard-visualisation/Validate.js +95 -1
  73. package/dpr/components/_dashboards/dashboard-visualisation/Validate.js.map +2 -2
  74. package/dpr/components/_dashboards/dashboard-visualisation/types.js +40 -1
  75. package/dpr/components/_dashboards/dashboard-visualisation/types.js.map +2 -2
  76. package/dpr/components/_dashboards/scorecard/Scorecard.js +176 -1
  77. package/dpr/components/_dashboards/scorecard/Scorecard.js.map +2 -2
  78. package/dpr/components/_dashboards/scorecard/types.js +16 -1
  79. package/dpr/components/_dashboards/scorecard/types.js.map +2 -2
  80. package/dpr/components/_dashboards/scorecard/utils.js +61 -1
  81. package/dpr/components/_dashboards/scorecard/utils.js.map +2 -2
  82. package/dpr/components/_dashboards/scorecard/validate.js +50 -1
  83. package/dpr/components/_dashboards/scorecard/validate.js.map +2 -2
  84. package/dpr/components/_dashboards/scorecard-group/ScorecardGroup.js +212 -1
  85. package/dpr/components/_dashboards/scorecard-group/ScorecardGroup.js.map +2 -2
  86. package/dpr/components/_dashboards/scorecard-group/types.js +16 -1
  87. package/dpr/components/_dashboards/scorecard-group/types.js.map +2 -2
  88. package/dpr/components/_dashboards/scorecard-group/validate.js +50 -1
  89. package/dpr/components/_dashboards/scorecard-group/validate.js.map +2 -2
  90. package/dpr/components/_filters/filter-input/enum.js +38 -1
  91. package/dpr/components/_filters/filter-input/enum.js.map +2 -2
  92. package/dpr/components/_filters/filter-input/filters.js +37 -1
  93. package/dpr/components/_filters/filter-input/filters.js.map +2 -2
  94. package/dpr/components/_filters/filter-input/types.d.js +16 -1
  95. package/dpr/components/_filters/filter-input/types.d.js.map +2 -2
  96. package/dpr/components/_filters/filters-selected/utils.js +314 -1
  97. package/dpr/components/_filters/filters-selected/utils.js.map +2 -2
  98. package/dpr/components/_filters/filtersTypeEnum.js +32 -1
  99. package/dpr/components/_filters/filtersTypeEnum.js.map +2 -2
  100. package/dpr/components/_filters/types.d.js +16 -1
  101. package/dpr/components/_filters/types.d.js.map +2 -2
  102. package/dpr/components/_filters/utils.js +385 -1
  103. package/dpr/components/_filters/utils.js.map +2 -2
  104. package/dpr/components/_inputs/autocomplete-text-input/utils.js +45 -1
  105. package/dpr/components/_inputs/autocomplete-text-input/utils.js.map +2 -2
  106. package/dpr/components/_inputs/date-input/utils.js +88 -1
  107. package/dpr/components/_inputs/date-input/utils.js.map +2 -2
  108. package/dpr/components/_inputs/date-range/types.js +38 -1
  109. package/dpr/components/_inputs/date-range/types.js.map +2 -2
  110. package/dpr/components/_inputs/date-range/utils.js +229 -1
  111. package/dpr/components/_inputs/date-range/utils.js.map +2 -2
  112. package/dpr/components/_inputs/granular-date-range/types.js +70 -1
  113. package/dpr/components/_inputs/granular-date-range/types.js.map +2 -2
  114. package/dpr/components/_inputs/granular-date-range/utils.js +445 -1
  115. package/dpr/components/_inputs/granular-date-range/utils.js.map +2 -2
  116. package/dpr/components/_inputs/multi-select/utils.js +88 -1
  117. package/dpr/components/_inputs/multi-select/utils.js.map +2 -2
  118. package/dpr/components/_inputs/start-end-date/utils.js +84 -1
  119. package/dpr/components/_inputs/start-end-date/utils.js.map +2 -2
  120. package/dpr/components/_reports/report-actions/actionsTemplate.js +59 -1
  121. package/dpr/components/_reports/report-actions/actionsTemplate.js.map +2 -2
  122. package/dpr/components/_reports/report-actions/types.d.js +16 -1
  123. package/dpr/components/_reports/report-actions/types.d.js.map +2 -2
  124. package/dpr/components/_reports/report-actions/utils.js +97 -1
  125. package/dpr/components/_reports/report-actions/utils.js.map +2 -2
  126. package/dpr/components/_reports/report-columns-form/types.d.js +16 -1
  127. package/dpr/components/_reports/report-columns-form/types.d.js.map +2 -2
  128. package/dpr/components/_reports/report-columns-form/utils.js +65 -1
  129. package/dpr/components/_reports/report-columns-form/utils.js.map +2 -2
  130. package/dpr/components/_reports/report-data-table/types.d.js +16 -1
  131. package/dpr/components/_reports/report-data-table/types.d.js.map +2 -2
  132. package/dpr/components/_reports/report-data-table/utils.js +122 -1
  133. package/dpr/components/_reports/report-data-table/utils.js.map +2 -2
  134. package/dpr/components/_reports/report-pagination/types.d.js +16 -1
  135. package/dpr/components/_reports/report-pagination/types.d.js.map +2 -2
  136. package/dpr/components/_reports/report-pagination/utils.js +105 -1
  137. package/dpr/components/_reports/report-pagination/utils.js.map +2 -2
  138. package/dpr/components/_reports/report-totals/utils.js +42 -1
  139. package/dpr/components/_reports/report-totals/utils.js.map +2 -2
  140. package/dpr/components/card-group/utils.js +57 -1
  141. package/dpr/components/card-group/utils.js.map +2 -2
  142. package/dpr/components/report-list/defaultTokenProvider.js +36 -1
  143. package/dpr/components/report-list/defaultTokenProvider.js.map +2 -2
  144. package/dpr/components/report-list/types.d.js +16 -1
  145. package/dpr/components/report-list/types.d.js.map +2 -2
  146. package/dpr/components/report-list/utils.js +238 -1
  147. package/dpr/components/report-list/utils.js.map +2 -2
  148. package/dpr/components/show-more/utils.js +38 -3
  149. package/dpr/components/show-more/utils.js.map +2 -2
  150. package/dpr/components/user-reports/bookmarks/utils.js +198 -1
  151. package/dpr/components/user-reports/bookmarks/utils.js.map +2 -2
  152. package/dpr/components/user-reports/requested/utils.js +65 -1
  153. package/dpr/components/user-reports/requested/utils.js.map +2 -2
  154. package/dpr/components/user-reports/types.d.js +16 -1
  155. package/dpr/components/user-reports/types.d.js.map +2 -2
  156. package/dpr/components/user-reports/utils.js +365 -1
  157. package/dpr/components/user-reports/utils.js.map +2 -2
  158. package/dpr/components/user-reports/viewed/utils.js +37 -1
  159. package/dpr/components/user-reports/viewed/utils.js.map +2 -2
  160. package/dpr/data/agentConfig.js +35 -1
  161. package/dpr/data/agentConfig.js.map +2 -2
  162. package/dpr/data/dashboardClient.js +108 -1
  163. package/dpr/data/dashboardClient.js.map +2 -2
  164. package/dpr/data/dprReportingClient.js +55 -1
  165. package/dpr/data/dprReportingClient.js.map +2 -2
  166. package/dpr/data/missingReportClient.js +55 -1
  167. package/dpr/data/missingReportClient.js.map +2 -2
  168. package/dpr/data/productCollectionClient.js +58 -1
  169. package/dpr/data/productCollectionClient.js.map +2 -2
  170. package/dpr/data/reportDataStore.js +77 -1
  171. package/dpr/data/reportDataStore.js.map +2 -2
  172. package/dpr/data/reportingClient.js +173 -1
  173. package/dpr/data/reportingClient.js.map +2 -2
  174. package/dpr/data/restClient.js +143 -1
  175. package/dpr/data/restClient.js.map +2 -2
  176. package/dpr/data/types.d.js +16 -1
  177. package/dpr/data/types.d.js.map +2 -2
  178. package/dpr/middleware/reportAuthoriser.js +63 -1
  179. package/dpr/middleware/reportAuthoriser.js.map +2 -2
  180. package/dpr/middleware/setUpDprResources.js +173 -1
  181. package/dpr/middleware/setUpDprResources.js.map +2 -2
  182. package/dpr/middleware/setUpNestedRoute.js +35 -1
  183. package/dpr/middleware/setUpNestedRoute.js.map +2 -2
  184. package/dpr/routes/index.js +50 -1
  185. package/dpr/routes/index.js.map +2 -2
  186. package/dpr/routes/journeys/api-failures.cy.js +295 -1
  187. package/dpr/routes/journeys/api-failures.cy.js.map +2 -2
  188. package/dpr/routes/journeys/download-report/controller.js +65 -1
  189. package/dpr/routes/journeys/download-report/controller.js.map +2 -2
  190. package/dpr/routes/journeys/download-report/request-download/form/controller.js +98 -1
  191. package/dpr/routes/journeys/download-report/request-download/form/controller.js.map +2 -2
  192. package/dpr/routes/journeys/download-report/request-download/form/routes.js +50 -1
  193. package/dpr/routes/journeys/download-report/request-download/form/routes.js.map +2 -2
  194. package/dpr/routes/journeys/download-report/request-download/form/submitted/controller.js +68 -1
  195. package/dpr/routes/journeys/download-report/request-download/form/submitted/controller.js.map +2 -2
  196. package/dpr/routes/journeys/download-report/request-download/form/submitted/routes.js +47 -1
  197. package/dpr/routes/journeys/download-report/request-download/form/submitted/routes.js.map +2 -2
  198. package/dpr/routes/journeys/download-report/request-download/form/submitted/tests.cy.js +17 -1
  199. package/dpr/routes/journeys/download-report/request-download/form/submitted/tests.cy.js.map +1 -1
  200. package/dpr/routes/journeys/download-report/request-download/form/tests.cy.js +24 -1
  201. package/dpr/routes/journeys/download-report/request-download/form/tests.cy.js.map +2 -2
  202. package/dpr/routes/journeys/download-report/request-download/routes.js +46 -1
  203. package/dpr/routes/journeys/download-report/request-download/routes.js.map +2 -2
  204. package/dpr/routes/journeys/download-report/request-download/service.js +90 -1
  205. package/dpr/routes/journeys/download-report/request-download/service.js.map +2 -2
  206. package/dpr/routes/journeys/download-report/routes.js +63 -1
  207. package/dpr/routes/journeys/download-report/routes.js.map +2 -2
  208. package/dpr/routes/journeys/download-report/tests.cy.js +104 -1
  209. package/dpr/routes/journeys/download-report/tests.cy.js.map +2 -2
  210. package/dpr/routes/journeys/download-report/utils.js +196 -1
  211. package/dpr/routes/journeys/download-report/utils.js.map +2 -2
  212. package/dpr/routes/journeys/my-reports/bookmarks/controller.js +58 -1
  213. package/dpr/routes/journeys/my-reports/bookmarks/controller.js.map +2 -2
  214. package/dpr/routes/journeys/my-reports/bookmarks/list/controller.js +56 -1
  215. package/dpr/routes/journeys/my-reports/bookmarks/list/controller.js.map +2 -2
  216. package/dpr/routes/journeys/my-reports/bookmarks/list/routes.js +47 -1
  217. package/dpr/routes/journeys/my-reports/bookmarks/list/routes.js.map +2 -2
  218. package/dpr/routes/journeys/my-reports/bookmarks/list/tests.cy.js +32 -1
  219. package/dpr/routes/journeys/my-reports/bookmarks/list/tests.cy.js.map +2 -2
  220. package/dpr/routes/journeys/my-reports/bookmarks/routes.js +49 -1
  221. package/dpr/routes/journeys/my-reports/bookmarks/routes.js.map +2 -2
  222. package/dpr/routes/journeys/my-reports/bookmarks/service.js +123 -4
  223. package/dpr/routes/journeys/my-reports/bookmarks/service.js.map +2 -2
  224. package/dpr/routes/journeys/my-reports/bookmarks/tests.cy.js +448 -1
  225. package/dpr/routes/journeys/my-reports/bookmarks/tests.cy.js.map +2 -2
  226. package/dpr/routes/journeys/my-reports/bookmarks/utils.js +44 -1
  227. package/dpr/routes/journeys/my-reports/bookmarks/utils.js.map +2 -2
  228. package/dpr/routes/journeys/my-reports/recently-viewed/controller.js +53 -1
  229. package/dpr/routes/journeys/my-reports/recently-viewed/controller.js.map +2 -2
  230. package/dpr/routes/journeys/my-reports/recently-viewed/list/controller.js +65 -1
  231. package/dpr/routes/journeys/my-reports/recently-viewed/list/controller.js.map +2 -2
  232. package/dpr/routes/journeys/my-reports/recently-viewed/list/routes.js +47 -1
  233. package/dpr/routes/journeys/my-reports/recently-viewed/list/routes.js.map +2 -2
  234. package/dpr/routes/journeys/my-reports/recently-viewed/list/tests.cy.js +83 -1
  235. package/dpr/routes/journeys/my-reports/recently-viewed/list/tests.cy.js.map +2 -2
  236. package/dpr/routes/journeys/my-reports/recently-viewed/routes.js +49 -1
  237. package/dpr/routes/journeys/my-reports/recently-viewed/routes.js.map +2 -2
  238. package/dpr/routes/journeys/my-reports/recently-viewed/service.js +118 -1
  239. package/dpr/routes/journeys/my-reports/recently-viewed/service.js.map +2 -2
  240. package/dpr/routes/journeys/my-reports/requested-reports/controller.js +52 -1
  241. package/dpr/routes/journeys/my-reports/requested-reports/controller.js.map +2 -2
  242. package/dpr/routes/journeys/my-reports/requested-reports/list/controller.js +65 -1
  243. package/dpr/routes/journeys/my-reports/requested-reports/list/controller.js.map +2 -2
  244. package/dpr/routes/journeys/my-reports/requested-reports/list/routes.js +47 -1
  245. package/dpr/routes/journeys/my-reports/requested-reports/list/routes.js.map +2 -2
  246. package/dpr/routes/journeys/my-reports/requested-reports/list/tests.cy.js +15 -1
  247. package/dpr/routes/journeys/my-reports/requested-reports/list/tests.cy.js.map +2 -2
  248. package/dpr/routes/journeys/my-reports/requested-reports/routes.js +49 -1
  249. package/dpr/routes/journeys/my-reports/requested-reports/routes.js.map +2 -2
  250. package/dpr/routes/journeys/my-reports/requested-reports/service.js +200 -1
  251. package/dpr/routes/journeys/my-reports/requested-reports/service.js.map +2 -2
  252. package/dpr/routes/journeys/my-reports/routes.js +59 -1
  253. package/dpr/routes/journeys/my-reports/routes.js.map +2 -2
  254. package/dpr/routes/journeys/product-collection/routes.js +45 -1
  255. package/dpr/routes/journeys/product-collection/routes.js.map +2 -2
  256. package/dpr/routes/journeys/product-collection/selected/controller.js +55 -1
  257. package/dpr/routes/journeys/product-collection/selected/controller.js.map +2 -2
  258. package/dpr/routes/journeys/product-collection/selected/routes.js +37 -1
  259. package/dpr/routes/journeys/product-collection/selected/routes.js.map +2 -2
  260. package/dpr/routes/journeys/product-collection/selected/tests.cy.js +47 -1
  261. package/dpr/routes/journeys/product-collection/selected/tests.cy.js.map +2 -2
  262. package/dpr/routes/journeys/product-collection/selected/validation.js +41 -1
  263. package/dpr/routes/journeys/product-collection/selected/validation.js.map +2 -2
  264. package/dpr/routes/journeys/request-missing-report/form/controller.js +104 -1
  265. package/dpr/routes/journeys/request-missing-report/form/controller.js.map +2 -2
  266. package/dpr/routes/journeys/request-missing-report/form/routes.js +50 -1
  267. package/dpr/routes/journeys/request-missing-report/form/routes.js.map +2 -2
  268. package/dpr/routes/journeys/request-missing-report/form/tests.cy.js +22 -1
  269. package/dpr/routes/journeys/request-missing-report/form/tests.cy.js.map +2 -2
  270. package/dpr/routes/journeys/request-missing-report/form/validation.js +43 -1
  271. package/dpr/routes/journeys/request-missing-report/form/validation.js.map +2 -2
  272. package/dpr/routes/journeys/request-missing-report/routes.js +57 -1
  273. package/dpr/routes/journeys/request-missing-report/routes.js.map +2 -2
  274. package/dpr/routes/journeys/request-missing-report/submitted/controller.js +65 -1
  275. package/dpr/routes/journeys/request-missing-report/submitted/controller.js.map +2 -2
  276. package/dpr/routes/journeys/request-missing-report/submitted/routes.js +47 -1
  277. package/dpr/routes/journeys/request-missing-report/submitted/routes.js.map +2 -2
  278. package/dpr/routes/journeys/request-missing-report/submitted/tests.cy.js +14 -1
  279. package/dpr/routes/journeys/request-missing-report/submitted/tests.cy.js.map +2 -2
  280. package/dpr/routes/journeys/request-missing-report/tests.cy.js +37 -1
  281. package/dpr/routes/journeys/request-missing-report/tests.cy.js.map +2 -2
  282. package/dpr/routes/journeys/request-report/controller.js +79 -1
  283. package/dpr/routes/journeys/request-report/controller.js.map +2 -2
  284. package/dpr/routes/journeys/request-report/filters/controller.js +127 -1
  285. package/dpr/routes/journeys/request-report/filters/controller.js.map +2 -2
  286. package/dpr/routes/journeys/request-report/filters/routes.js +50 -1
  287. package/dpr/routes/journeys/request-report/filters/routes.js.map +2 -2
  288. package/dpr/routes/journeys/request-report/filters/tests.cy.js +451 -1
  289. package/dpr/routes/journeys/request-report/filters/tests.cy.js.map +2 -2
  290. package/dpr/routes/journeys/request-report/filters/utils.js +331 -1
  291. package/dpr/routes/journeys/request-report/filters/utils.js.map +2 -2
  292. package/dpr/routes/journeys/request-report/routes.js +100 -1
  293. package/dpr/routes/journeys/request-report/routes.js.map +2 -2
  294. package/dpr/routes/journeys/request-report/status/controller.js +80 -1
  295. package/dpr/routes/journeys/request-report/status/controller.js.map +2 -2
  296. package/dpr/routes/journeys/request-report/status/routes.js +48 -1
  297. package/dpr/routes/journeys/request-report/status/routes.js.map +2 -2
  298. package/dpr/routes/journeys/request-report/status/tests.cy.js +127 -1
  299. package/dpr/routes/journeys/request-report/status/tests.cy.js.map +2 -2
  300. package/dpr/routes/journeys/request-report/status/utils.js +72 -1
  301. package/dpr/routes/journeys/request-report/status/utils.js.map +2 -2
  302. package/dpr/routes/journeys/request-report/tests.cy.js +307 -1
  303. package/dpr/routes/journeys/request-report/tests.cy.js.map +2 -2
  304. package/dpr/routes/journeys/routes.js +46 -1
  305. package/dpr/routes/journeys/routes.js.map +2 -2
  306. package/dpr/routes/journeys/view-report/async/controller.js +89 -1
  307. package/dpr/routes/journeys/view-report/async/controller.js.map +2 -2
  308. package/dpr/routes/journeys/view-report/async/dashboard/controller.js +82 -1
  309. package/dpr/routes/journeys/view-report/async/dashboard/controller.js.map +2 -2
  310. package/dpr/routes/journeys/view-report/async/dashboard/routes.js +48 -1
  311. package/dpr/routes/journeys/view-report/async/dashboard/routes.js.map +2 -2
  312. package/dpr/routes/journeys/view-report/async/dashboard/tests.cy.js +33 -1
  313. package/dpr/routes/journeys/view-report/async/dashboard/tests.cy.js.map +2 -2
  314. package/dpr/routes/journeys/view-report/async/dashboard/utils.js +242 -1
  315. package/dpr/routes/journeys/view-report/async/dashboard/utils.js.map +2 -2
  316. package/dpr/routes/journeys/view-report/async/report/controller.js +83 -1
  317. package/dpr/routes/journeys/view-report/async/report/controller.js.map +2 -2
  318. package/dpr/routes/journeys/view-report/async/report/report-variants.cy.js +76 -1
  319. package/dpr/routes/journeys/view-report/async/report/report-variants.cy.js.map +2 -2
  320. package/dpr/routes/journeys/view-report/async/report/routes.js +53 -1
  321. package/dpr/routes/journeys/view-report/async/report/routes.js.map +2 -2
  322. package/dpr/routes/journeys/view-report/async/report/tests.cy.js +895 -1
  323. package/dpr/routes/journeys/view-report/async/report/tests.cy.js.map +2 -2
  324. package/dpr/routes/journeys/view-report/async/report/types.js +16 -1
  325. package/dpr/routes/journeys/view-report/async/report/types.js.map +2 -2
  326. package/dpr/routes/journeys/view-report/async/report/utils.js +427 -1
  327. package/dpr/routes/journeys/view-report/async/report/utils.js.map +2 -2
  328. package/dpr/routes/journeys/view-report/async/routes.js +52 -1
  329. package/dpr/routes/journeys/view-report/async/routes.js.map +2 -2
  330. package/dpr/routes/journeys/view-report/controller.js +62 -1
  331. package/dpr/routes/journeys/view-report/controller.js.map +2 -2
  332. package/dpr/routes/journeys/view-report/routes.js +87 -1
  333. package/dpr/routes/journeys/view-report/routes.js.map +2 -2
  334. package/dpr/routes/journeys/view-report/sync/dashboard/controller.js +68 -1
  335. package/dpr/routes/journeys/view-report/sync/dashboard/controller.js.map +2 -2
  336. package/dpr/routes/journeys/view-report/sync/dashboard/routes.js +48 -1
  337. package/dpr/routes/journeys/view-report/sync/dashboard/routes.js.map +2 -2
  338. package/dpr/routes/journeys/view-report/sync/dashboard/utils.js +144 -1
  339. package/dpr/routes/journeys/view-report/sync/dashboard/utils.js.map +2 -2
  340. package/dpr/routes/journeys/view-report/sync/load-report/controller.js +102 -1
  341. package/dpr/routes/journeys/view-report/sync/load-report/controller.js.map +2 -2
  342. package/dpr/routes/journeys/view-report/sync/load-report/routes.js +47 -1
  343. package/dpr/routes/journeys/view-report/sync/load-report/routes.js.map +2 -2
  344. package/dpr/routes/journeys/view-report/sync/report/controller.js +99 -1
  345. package/dpr/routes/journeys/view-report/sync/report/controller.js.map +2 -2
  346. package/dpr/routes/journeys/view-report/sync/report/routes.js +51 -1
  347. package/dpr/routes/journeys/view-report/sync/report/routes.js.map +2 -2
  348. package/dpr/routes/journeys/view-report/sync/report/utils.js +298 -1
  349. package/dpr/routes/journeys/view-report/sync/report/utils.js.map +2 -2
  350. package/dpr/routes/journeys/view-report/sync/routes.js +51 -1
  351. package/dpr/routes/journeys/view-report/sync/routes.js.map +2 -2
  352. package/dpr/routes/journeys/view-report/sync/tests.cy.js +43 -1
  353. package/dpr/routes/journeys/view-report/sync/tests.cy.js.map +2 -2
  354. package/dpr/routes/journeys/view-report/utils.js +173 -1
  355. package/dpr/routes/journeys/view-report/utils.js.map +2 -2
  356. package/dpr/services/dashboardService.js +66 -1
  357. package/dpr/services/dashboardService.js.map +2 -2
  358. package/dpr/services/defaultFilterValuesService.js +114 -1
  359. package/dpr/services/defaultFilterValuesService.js.map +2 -2
  360. package/dpr/services/featureFlagService.js +65 -1
  361. package/dpr/services/featureFlagService.js.map +2 -2
  362. package/dpr/services/featureFlags.cy.js +72 -1
  363. package/dpr/services/featureFlags.cy.js.map +2 -2
  364. package/dpr/services/index.js +59 -1
  365. package/dpr/services/index.js.map +2 -2
  366. package/dpr/services/missingReport/missingReportService.js +52 -1
  367. package/dpr/services/missingReport/missingReportService.js.map +2 -2
  368. package/dpr/services/productCollection/productCollectionService.js +55 -1
  369. package/dpr/services/productCollection/productCollectionService.js.map +2 -2
  370. package/dpr/services/productCollection/productCollectionStoreService.js +61 -1
  371. package/dpr/services/productCollection/productCollectionStoreService.js.map +2 -2
  372. package/dpr/services/reportStoreService.js +51 -1
  373. package/dpr/services/reportStoreService.js.map +2 -2
  374. package/dpr/services/reportingService.js +81 -1
  375. package/dpr/services/reportingService.js.map +2 -2
  376. package/dpr/setUpNunjucksFilters.js +66 -1
  377. package/dpr/setUpNunjucksFilters.js.map +2 -2
  378. package/dpr/types/AsyncReportUtils.js +16 -1
  379. package/dpr/types/AsyncReportUtils.js.map +2 -2
  380. package/dpr/types/Bookmark.js +16 -1
  381. package/dpr/types/Bookmark.js.map +2 -2
  382. package/dpr/types/Charts.js +16 -1
  383. package/dpr/types/Charts.js.map +2 -2
  384. package/dpr/types/Download.js +16 -1
  385. package/dpr/types/Download.js.map +2 -2
  386. package/dpr/types/DprConfig.js +16 -1
  387. package/dpr/types/DprConfig.js.map +2 -2
  388. package/dpr/types/DprUser.js +43 -1
  389. package/dpr/types/DprUser.js.map +2 -2
  390. package/dpr/types/EmbeddedReportUtils.js +33 -1
  391. package/dpr/types/EmbeddedReportUtils.js.map +2 -2
  392. package/dpr/types/ExecutionData.d.js +16 -1
  393. package/dpr/types/ExecutionData.d.js.map +2 -2
  394. package/dpr/types/Metrics.js +16 -1
  395. package/dpr/types/Metrics.js.map +2 -2
  396. package/dpr/types/ReportQuery.js +168 -1
  397. package/dpr/types/ReportQuery.js.map +2 -2
  398. package/dpr/types/ReportStore.js +16 -1
  399. package/dpr/types/ReportStore.js.map +2 -2
  400. package/dpr/types/Services.d.js +16 -1
  401. package/dpr/types/Services.d.js.map +2 -2
  402. package/dpr/types/Templates.d.js +16 -1
  403. package/dpr/types/Templates.d.js.map +2 -2
  404. package/dpr/types/UserReports.js +55 -1
  405. package/dpr/types/UserReports.js.map +2 -2
  406. package/dpr/types/api.d.js +16 -1
  407. package/dpr/types/api.d.js.map +2 -2
  408. package/dpr/types/index.d.js +16 -1
  409. package/dpr/types/index.d.js.map +2 -2
  410. package/dpr/utils/CollatedSummaryBuilder/CollatedSummaryBuilder.js +91 -1
  411. package/dpr/utils/CollatedSummaryBuilder/CollatedSummaryBuilder.js.map +2 -2
  412. package/dpr/utils/CreateDprServices.js +66 -1
  413. package/dpr/utils/CreateDprServices.js.map +2 -2
  414. package/dpr/utils/DataTableBuilder/DataTableBuilder.js +304 -1
  415. package/dpr/utils/DataTableBuilder/DataTableBuilder.js.map +2 -2
  416. package/dpr/utils/DataTableBuilder/types.d.js +16 -1
  417. package/dpr/utils/DataTableBuilder/types.d.js.map +2 -2
  418. package/dpr/utils/DateMapper/DateMapper.js +125 -1
  419. package/dpr/utils/DateMapper/DateMapper.js.map +2 -2
  420. package/dpr/utils/DateMapper/types.d.js +16 -1
  421. package/dpr/utils/DateMapper/types.d.js.map +2 -2
  422. package/dpr/utils/ErrorHandler.js +94 -1
  423. package/dpr/utils/ErrorHandler.js.map +2 -2
  424. package/dpr/utils/ParentChildDataTableBuilder/ParentChildDataTableBuilder.js +201 -1
  425. package/dpr/utils/ParentChildDataTableBuilder/ParentChildDataTableBuilder.js.map +2 -2
  426. package/dpr/utils/ParentChildDataTableBuilder/types.d.js +16 -1
  427. package/dpr/utils/ParentChildDataTableBuilder/types.d.js.map +2 -2
  428. package/dpr/utils/Personalisation/personalisationUtils.js +202 -1
  429. package/dpr/utils/Personalisation/personalisationUtils.js.map +2 -2
  430. package/dpr/utils/Personalisation/types.d.js +16 -1
  431. package/dpr/utils/Personalisation/types.d.js.map +2 -2
  432. package/dpr/utils/SectionedDataTableBuilder/SectionedDataTableBuilder.js +310 -1
  433. package/dpr/utils/SectionedDataTableBuilder/SectionedDataTableBuilder.js.map +2 -2
  434. package/dpr/utils/SectionedDataTableBuilder/types.d.js +16 -1
  435. package/dpr/utils/SectionedDataTableBuilder/types.d.js.map +2 -2
  436. package/dpr/utils/SectionedFieldsTableBuilder/SectionedFieldsTableBuilder.js +145 -1
  437. package/dpr/utils/SectionedFieldsTableBuilder/SectionedFieldsTableBuilder.js.map +2 -2
  438. package/dpr/utils/SummaryDataTableBuilder/SummaryDataTableBuilder.js +60 -1
  439. package/dpr/utils/SummaryDataTableBuilder/SummaryDataTableBuilder.js.map +2 -2
  440. package/dpr/utils/UserStoreItemBuilder.js +247 -1
  441. package/dpr/utils/UserStoreItemBuilder.js.map +2 -2
  442. package/dpr/utils/arrayUtils.js +28 -1
  443. package/dpr/utils/arrayUtils.js.map +2 -2
  444. package/dpr/utils/datasetHelper.js +229 -1
  445. package/dpr/utils/datasetHelper.js.map +2 -2
  446. package/dpr/utils/definitionUtils.js +133 -1
  447. package/dpr/utils/definitionUtils.js.map +2 -2
  448. package/dpr/utils/index.js +44 -1
  449. package/dpr/utils/index.js.map +2 -2
  450. package/dpr/utils/indexedAccesHelper.js +41 -1
  451. package/dpr/utils/indexedAccesHelper.js.map +2 -2
  452. package/dpr/utils/localsHelper.js +105 -1
  453. package/dpr/utils/localsHelper.js.map +2 -2
  454. package/dpr/utils/logger.js +48 -1
  455. package/dpr/utils/logger.js.map +2 -2
  456. package/dpr/utils/reportListsHelper.js +128 -12
  457. package/dpr/utils/reportListsHelper.js.map +2 -2
  458. package/dpr/utils/reportStoreHelper.js +65 -1
  459. package/dpr/utils/reportStoreHelper.js.map +2 -2
  460. package/dpr/utils/requestStatusHelper.js +172 -1
  461. package/dpr/utils/requestStatusHelper.js.map +2 -2
  462. package/dpr/utils/sanitisedError.js +45 -1
  463. package/dpr/utils/sanitisedError.js.map +2 -2
  464. package/dpr/utils/urlHelper.js +103 -1
  465. package/dpr/utils/urlHelper.js.map +2 -2
  466. package/dpr/validation/validate.js +52 -1
  467. package/dpr/validation/validate.js.map +2 -2
  468. package/package.json +1 -1
@@ -1,2 +1,126 @@
1
- "use strict";var p=Object.create;var l=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var Y=Object.getPrototypeOf,d=Object.prototype.hasOwnProperty;var f=(a,t)=>{for(var e in t)l(a,e,{get:t[e],enumerable:!0})},s=(a,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of h(t))!d.call(a,i)&&i!==e&&l(a,i,{get:()=>t[i],enumerable:!(r=u(t,i))||r.enumerable});return a};var m=(a,t,e)=>(e=a!=null?p(Y(a)):{},s(t||!a||!a.__esModule?l(e,"default",{value:a,enumerable:!0}):e,a)),g=a=>s(l({},"__esModule",{value:!0}),a);var T={};f(T,{DateMapper:()=>c,default:()=>F});module.exports=g(T);var o=m(require("dayjs")),D=m(require("dayjs/plugin/customParseFormat")),n=m(require("../logger"));class c{isoDateRegEx=/^(\d{4}[/-](0?[1-9]|1[012])[/-](0?[1-9]|[12][0-9]|3[01]))/;localDateRegEx=/^(0?[1-9]|[12][0-9]|3[01])[/-](0?[1-9]|1[012])[/-]\d{4}$/;localDateShortYearRegEx=/^(0?[1-9]|[12][0-9]|3[01])[/-](0?[1-9]|1[012])[/-]\d{2}$/;localDateTimeRegEx=/^(0?[1-9]|[12][0-9]|3[01])[/-](0?[1-9]|1[012])[/-]\d{4} [0-2]\d:[0-5]\d$/;localDateTimeShortYearRegEx=/^(0?[1-9]|[12][0-9]|3[01])[/-](0?[1-9]|1[012])[/-]\d{2} [0-2]\d:[0-5]\d$/;isoFormat="YYYY-MM-DD";localDateFormatInput="D/M/YYYY";localDateFormatOutput="DD/MM/YYYY";localDateShortYearFormatInput="D/M/YY";localDateShortYearFormatOutput="DD/MM/YY";localDateTimeFormatInput="D/M/YYYY HH:mm";localDateTimeFormatOutput="DD/MM/YYYY HH:mm";localDateTimeShortYearFormatInput="D/M/YY HH:mm";localDateTimeShortYearFormatOutput="DD/MM/YY HH:mm";getDateType(t){if(t&&t.match){if(t.match(this.isoDateRegEx))return"iso";if(t.match(this.localDateRegEx))return"local-date";if(t.match(this.localDateShortYearRegEx))return"local-date-short-year";if(t.match(this.localDateTimeRegEx))return"local-datetime";if(t.match(this.localDateTimeShortYearRegEx))return"local-datetime-short-year"}return"none"}getDateWrapper(t){if(o.default.extend(D.default),!t)return null;switch(this.getDateType(t)){case"iso":return(0,o.default)(t);case"local-date":return(0,o.default)(t,this.localDateFormatInput);case"local-date-short-year":return(0,o.default)(t,this.localDateShortYearFormatInput);case"local-datetime":return(0,o.default)(t,this.localDateTimeFormatInput);case"local-datetime-short-year":return(0,o.default)(t,this.localDateTimeShortYearFormatInput);default:return null}}isDate(t){return this.getDateType(t)!=="none"}toDateString(t,e){const r=this.getDateWrapper(t);if(r)switch(e){case"iso":return r.format(this.isoFormat);case"local-date":return r.format(this.localDateFormatOutput);case"local-date-short-year":return r.format(this.localDateShortYearFormatOutput);case"local-datetime":return r.format(this.localDateTimeFormatOutput);case"local-datetime-short-year":return r.format(this.localDateTimeShortYearFormatOutput);default:n.default.warn(`Invalid date type: ${e}`);return}t&&n.default.warn(`Could not map non-date value : ${t}`)}}var F=c;0&&(module.exports={DateMapper});
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var DateMapper_exports = {};
30
+ __export(DateMapper_exports, {
31
+ DateMapper: () => DateMapper,
32
+ default: () => DateMapper_default
33
+ });
34
+ module.exports = __toCommonJS(DateMapper_exports);
35
+ var import_dayjs = __toESM(require("dayjs"));
36
+ var import_customParseFormat = __toESM(require("dayjs/plugin/customParseFormat"));
37
+ var import_logger = __toESM(require("../logger"));
38
+ class DateMapper {
39
+ isoDateRegEx = /^(\d{4}[/-](0?[1-9]|1[012])[/-](0?[1-9]|[12][0-9]|3[01]))/;
40
+ localDateRegEx = /^(0?[1-9]|[12][0-9]|3[01])[/-](0?[1-9]|1[012])[/-]\d{4}$/;
41
+ localDateShortYearRegEx = /^(0?[1-9]|[12][0-9]|3[01])[/-](0?[1-9]|1[012])[/-]\d{2}$/;
42
+ localDateTimeRegEx = /^(0?[1-9]|[12][0-9]|3[01])[/-](0?[1-9]|1[012])[/-]\d{4} [0-2]\d:[0-5]\d$/;
43
+ localDateTimeShortYearRegEx = /^(0?[1-9]|[12][0-9]|3[01])[/-](0?[1-9]|1[012])[/-]\d{2} [0-2]\d:[0-5]\d$/;
44
+ isoFormat = "YYYY-MM-DD";
45
+ localDateFormatInput = "D/M/YYYY";
46
+ localDateFormatOutput = "DD/MM/YYYY";
47
+ localDateShortYearFormatInput = "D/M/YY";
48
+ localDateShortYearFormatOutput = "DD/MM/YY";
49
+ localDateTimeFormatInput = "D/M/YYYY HH:mm";
50
+ localDateTimeFormatOutput = "DD/MM/YYYY HH:mm";
51
+ localDateTimeShortYearFormatInput = "D/M/YY HH:mm";
52
+ localDateTimeShortYearFormatOutput = "DD/MM/YY HH:mm";
53
+ getDateType(value) {
54
+ if (value && value.match) {
55
+ if (value.match(this.isoDateRegEx)) {
56
+ return "iso";
57
+ }
58
+ if (value.match(this.localDateRegEx)) {
59
+ return "local-date";
60
+ }
61
+ if (value.match(this.localDateShortYearRegEx)) {
62
+ return "local-date-short-year";
63
+ }
64
+ if (value.match(this.localDateTimeRegEx)) {
65
+ return "local-datetime";
66
+ }
67
+ if (value.match(this.localDateTimeShortYearRegEx)) {
68
+ return "local-datetime-short-year";
69
+ }
70
+ }
71
+ return "none";
72
+ }
73
+ getDateWrapper(value) {
74
+ import_dayjs.default.extend(import_customParseFormat.default);
75
+ if (!value) {
76
+ return null;
77
+ }
78
+ switch (this.getDateType(value)) {
79
+ case "iso":
80
+ return (0, import_dayjs.default)(value);
81
+ case "local-date":
82
+ return (0, import_dayjs.default)(value, this.localDateFormatInput);
83
+ case "local-date-short-year":
84
+ return (0, import_dayjs.default)(value, this.localDateShortYearFormatInput);
85
+ case "local-datetime":
86
+ return (0, import_dayjs.default)(value, this.localDateTimeFormatInput);
87
+ case "local-datetime-short-year":
88
+ return (0, import_dayjs.default)(value, this.localDateTimeShortYearFormatInput);
89
+ default:
90
+ return null;
91
+ }
92
+ }
93
+ isDate(value) {
94
+ return this.getDateType(value) !== "none";
95
+ }
96
+ toDateString(value, type) {
97
+ const dateWrapper = this.getDateWrapper(value);
98
+ if (dateWrapper) {
99
+ switch (type) {
100
+ case "iso":
101
+ return dateWrapper.format(this.isoFormat);
102
+ case "local-date":
103
+ return dateWrapper.format(this.localDateFormatOutput);
104
+ case "local-date-short-year":
105
+ return dateWrapper.format(this.localDateShortYearFormatOutput);
106
+ case "local-datetime":
107
+ return dateWrapper.format(this.localDateTimeFormatOutput);
108
+ case "local-datetime-short-year":
109
+ return dateWrapper.format(this.localDateTimeShortYearFormatOutput);
110
+ default:
111
+ import_logger.default.warn(`Invalid date type: ${type}`);
112
+ return void 0;
113
+ }
114
+ }
115
+ if (value) {
116
+ import_logger.default.warn(`Could not map non-date value : ${value}`);
117
+ }
118
+ return void 0;
119
+ }
120
+ }
121
+ var DateMapper_default = DateMapper;
122
+ // Annotate the CommonJS export names for ESM import in node:
123
+ 0 && (module.exports = {
124
+ DateMapper
125
+ });
2
126
  //# sourceMappingURL=DateMapper.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/dpr/utils/DateMapper/DateMapper.ts"],
4
4
  "sourcesContent": ["import dayjs, { Dayjs } from 'dayjs'\nimport customParseFormat from 'dayjs/plugin/customParseFormat'\nimport { DateType } from './types'\nimport logger from '../logger'\n\nclass DateMapper {\n private isoDateRegEx = /^(\\d{4}[/-](0?[1-9]|1[012])[/-](0?[1-9]|[12][0-9]|3[01]))/\n\n private localDateRegEx = /^(0?[1-9]|[12][0-9]|3[01])[/-](0?[1-9]|1[012])[/-]\\d{4}$/\n\n private localDateShortYearRegEx = /^(0?[1-9]|[12][0-9]|3[01])[/-](0?[1-9]|1[012])[/-]\\d{2}$/\n\n private localDateTimeRegEx = /^(0?[1-9]|[12][0-9]|3[01])[/-](0?[1-9]|1[012])[/-]\\d{4} [0-2]\\d:[0-5]\\d$/\n\n private localDateTimeShortYearRegEx = /^(0?[1-9]|[12][0-9]|3[01])[/-](0?[1-9]|1[012])[/-]\\d{2} [0-2]\\d:[0-5]\\d$/\n\n private isoFormat = 'YYYY-MM-DD'\n\n private localDateFormatInput = 'D/M/YYYY'\n\n private localDateFormatOutput = 'DD/MM/YYYY'\n\n private localDateShortYearFormatInput = 'D/M/YY'\n\n private localDateShortYearFormatOutput = 'DD/MM/YY'\n\n private localDateTimeFormatInput = 'D/M/YYYY HH:mm'\n\n private localDateTimeFormatOutput = 'DD/MM/YYYY HH:mm'\n\n private localDateTimeShortYearFormatInput = 'D/M/YY HH:mm'\n\n private localDateTimeShortYearFormatOutput = 'DD/MM/YY HH:mm'\n\n getDateType(value: string | null): DateType {\n if (value && value.match) {\n if (value.match(this.isoDateRegEx)) {\n return 'iso'\n }\n\n if (value.match(this.localDateRegEx)) {\n return 'local-date'\n }\n\n if (value.match(this.localDateShortYearRegEx)) {\n return 'local-date-short-year'\n }\n\n if (value.match(this.localDateTimeRegEx)) {\n return 'local-datetime'\n }\n\n if (value.match(this.localDateTimeShortYearRegEx)) {\n return 'local-datetime-short-year'\n }\n }\n\n return 'none'\n }\n\n getDateWrapper(value: string | null): Dayjs | null {\n dayjs.extend(customParseFormat)\n if (!value) {\n return null\n }\n switch (this.getDateType(value)) {\n case 'iso':\n return dayjs(value)\n case 'local-date':\n return dayjs(value, this.localDateFormatInput)\n case 'local-date-short-year':\n return dayjs(value, this.localDateShortYearFormatInput)\n case 'local-datetime':\n return dayjs(value, this.localDateTimeFormatInput)\n case 'local-datetime-short-year':\n return dayjs(value, this.localDateTimeShortYearFormatInput)\n default:\n return null\n }\n }\n\n isDate(value: string | null): boolean {\n return this.getDateType(value) !== 'none'\n }\n\n toDateString(value: string | null, type: DateType): string | undefined {\n const dateWrapper = this.getDateWrapper(value)\n\n if (dateWrapper) {\n switch (type) {\n case 'iso':\n return dateWrapper.format(this.isoFormat)\n case 'local-date':\n return dateWrapper.format(this.localDateFormatOutput)\n case 'local-date-short-year':\n return dateWrapper.format(this.localDateShortYearFormatOutput)\n case 'local-datetime':\n return dateWrapper.format(this.localDateTimeFormatOutput)\n case 'local-datetime-short-year':\n return dateWrapper.format(this.localDateTimeShortYearFormatOutput)\n default:\n logger.warn(`Invalid date type: ${type}`)\n return undefined\n }\n }\n\n if (value) {\n logger.war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F,CAEA,OAAOA,EAA+B,CACpC,OAAO,KAAK,YAAYA,CAAK,IAAM,MACrC,CAEA,aAAaA,EAAsBG,EAAoC,CACrE,MAAMC,EAAc,KAAK,eAAeJ,CAAK,EAE7C,GAAII,EACF,OAAQD,EAAM,CACZ,IAAK,MACH,OAAOC,EAAY,OAAO,KAAK,SAAS,EAC1C,IAAK,aACH,OAAOA,EAAY,OAAO,KAAK,qBAAqB,EACtD,IAAK,wBACH,OAAOA,EAAY,OAAO,KAAK,8BAA8B,EAC/D,IAAK,iBACH,OAAOA,EAAY,OAAO,KAAK,yBAAyB,EAC1D,IAAK,4BACH,OAAOA,EAAY,OAAO,KAAK,kCAAkC,EACnE,QACE,EAAAC,QAAO,KAAK,sBAAsBF,CAAI,EAAE,EACxC,MACJ,CAGEH,GACF,EAAAK,QAAO,KAAK,kCAAkCL,CAAK,EAAE,CAGzD,CACF,CAGA,IAAOL,EAAQD",
6
- "names": ["DateMapper_exports", "__export", "DateMapper", "DateMapper_default", "__toCommonJS", "import_dayjs", "import_customParseFormat", "import_logger", "value", "dayjs", "customParseFormat", "type", "dateWrapper", "logger"]
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA6B;AAC7B,+BAA8B;AAE9B,oBAAmB;AAEnB,MAAM,WAAW;AAAA,EACP,eAAe;AAAA,EAEf,iBAAiB;AAAA,EAEjB,0BAA0B;AAAA,EAE1B,qBAAqB;AAAA,EAErB,8BAA8B;AAAA,EAE9B,YAAY;AAAA,EAEZ,uBAAuB;AAAA,EAEvB,wBAAwB;AAAA,EAExB,gCAAgC;AAAA,EAEhC,iCAAiC;AAAA,EAEjC,2BAA2B;AAAA,EAE3B,4BAA4B;AAAA,EAE5B,oCAAoC;AAAA,EAEpC,qCAAqC;AAAA,EAE7C,YAAY,OAAgC;AAC1C,QAAI,SAAS,MAAM,OAAO;AACxB,UAAI,MAAM,MAAM,KAAK,YAAY,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BAAyB;AAAA,QAC1D,KAAK;AACH,iBAAO,YAAY,OAAO,KAAK,kCAAkC;AAAA,QACnE;AACE,wBAAAE,QAAO,KAAK,sBAAsB,IAAI,EAAE;AACxC,iBAAO;AAAA,MACX;AAAA,IACF;AAEA,QAAI,OAAO;AACT,oBAAAA,QAAO,KAAK,kCAAkC,KAAK,EAAE;AAAA,IACvD;AACA,WAAO;AAAA,EACT;AACF;AAGA,IAAO,qBAAQ;",
6
+ "names": ["dayjs", "customParseFormat", "logger"]
7
7
  }
@@ -1,2 +1,17 @@
1
- "use strict";var l=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var y=Object.prototype.hasOwnProperty;var i=(a,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of d(e))!y.call(a,t)&&t!==r&&l(a,t,{get:()=>e[t],enumerable:!(o=c(e,t))||o.enumerable});return a};var p=a=>i(l({},"__esModule",{value:!0}),a);var s={};module.exports=p(s);
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+ var types_d_exports = {};
16
+ module.exports = __toCommonJS(types_d_exports);
2
17
  //# sourceMappingURL=types.d.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/dpr/utils/DateMapper/types.d.ts"],
4
4
  "sourcesContent": ["export type DateType =\n | 'iso'\n | 'local-date'\n | 'local-date-short-year'\n | 'local-datetime'\n | 'local-datetime-short-year'\n | 'none'\n"],
5
- "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
- "names": ["types_d_exports", "__toCommonJS"]
5
+ "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
6
+ "names": []
7
7
  }
@@ -1,2 +1,95 @@
1
- "use strict";var h=Object.create;var a=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var c=Object.getPrototypeOf,d=Object.prototype.hasOwnProperty;var f=(s,e)=>{for(var r in e)a(s,r,{get:e[r],enumerable:!0})},g=(s,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of u(e))!d.call(s,t)&&t!==r&&a(s,t,{get:()=>e[t],enumerable:!(o=p(e,t))||o.enumerable});return s};var l=(s,e,r)=>(r=s!=null?h(c(s)):{},g(e||!s||!s.__esModule?a(r,"default",{value:s,enumerable:!0}):r,s)),m=s=>g(a({},"__esModule",{value:!0}),s);var E={};f(E,{ErrorHandler:()=>i,default:()=>M});module.exports=m(E);var n=l(require("./logger"));class i{error;developerMessage;userMessage;moreInfo;stack;status;constructor(e){this.error=e,n.default.error(`Error: ${JSON.stringify(e)}`)}formatError=()=>this.handleError();handleError=()=>{if(typeof this.error=="string")this.developerMessage=this.error;else if(this.error.data){const r=this.error.data;this.developerMessage=r.developerMessage,this.userMessage=r.userMessage,this.moreInfo=r.moreInfo,this.status=r.status}else if(Object.prototype.hasOwnProperty.call(this.error,"message")){const r=this.error;this.userMessage=r.message,this.stack=r.stack,this.status=500}else if(Object.prototype.hasOwnProperty.call(this.error,"developerMessage")){const r=this.error;this.developerMessage=r.developerMessage,this.userMessage=r.userMessage,this.moreInfo=r.moreInfo,this.status=r.status}else if(Object.prototype.hasOwnProperty.call(this.error,"userMessage")){const r=this.error;if(r.stack&&r.stack.includes("ZodError")){const o=JSON.parse(r.userMessage);this.userMessage=o.map(t=>t.message).join(", "),this.status=500,this.stack=r.stack}}const e={...this.developerMessage&&{developerMessage:this.developerMessage},...this.userMessage&&{userMessage:this.userMessage},...this.moreInfo&&{moreInfo:this.moreInfo},...this.stack&&{stack:this.stack},...this.status&&{status:this.status}};return n.default.error(JSON.stringify(e,null,2)),e}}var M=i;0&&(module.exports={ErrorHandler});
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var ErrorHandler_exports = {};
30
+ __export(ErrorHandler_exports, {
31
+ ErrorHandler: () => ErrorHandler,
32
+ default: () => ErrorHandler_default
33
+ });
34
+ module.exports = __toCommonJS(ErrorHandler_exports);
35
+ var import_logger = __toESM(require("./logger"));
36
+ class ErrorHandler {
37
+ error;
38
+ developerMessage;
39
+ userMessage;
40
+ moreInfo;
41
+ stack;
42
+ status;
43
+ constructor(error) {
44
+ this.error = error;
45
+ import_logger.default.error(`Error: ${JSON.stringify(error)}`);
46
+ }
47
+ formatError = () => {
48
+ return this.handleError();
49
+ };
50
+ handleError = () => {
51
+ if (typeof this.error === "string") {
52
+ this.developerMessage = this.error;
53
+ } else if (this.error.data) {
54
+ const error = this.error.data;
55
+ this.developerMessage = error.developerMessage;
56
+ this.userMessage = error.userMessage;
57
+ this.moreInfo = error.moreInfo;
58
+ this.status = error.status;
59
+ } else if (Object.prototype.hasOwnProperty.call(this.error, "message")) {
60
+ const error = this.error;
61
+ this.userMessage = error.message;
62
+ this.stack = error.stack;
63
+ this.status = 500;
64
+ } else if (Object.prototype.hasOwnProperty.call(this.error, "developerMessage")) {
65
+ const error = this.error;
66
+ this.developerMessage = error.developerMessage;
67
+ this.userMessage = error.userMessage;
68
+ this.moreInfo = error.moreInfo;
69
+ this.status = error.status;
70
+ } else if (Object.prototype.hasOwnProperty.call(this.error, "userMessage")) {
71
+ const error = this.error;
72
+ if (error.stack && error.stack.includes("ZodError")) {
73
+ const errorArr = JSON.parse(error.userMessage);
74
+ this.userMessage = errorArr.map((m) => m.message).join(", ");
75
+ this.status = 500;
76
+ this.stack = error.stack;
77
+ }
78
+ }
79
+ const formattedError = {
80
+ ...this.developerMessage && { developerMessage: this.developerMessage },
81
+ ...this.userMessage && { userMessage: this.userMessage },
82
+ ...this.moreInfo && { moreInfo: this.moreInfo },
83
+ ...this.stack && { stack: this.stack },
84
+ ...this.status && { status: this.status }
85
+ };
86
+ import_logger.default.error(JSON.stringify(formattedError, null, 2));
87
+ return formattedError;
88
+ };
89
+ }
90
+ var ErrorHandler_default = ErrorHandler;
91
+ // Annotate the CommonJS export names for ESM import in node:
92
+ 0 && (module.exports = {
93
+ ErrorHandler
94
+ });
2
95
  //# sourceMappingURL=ErrorHandler.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/dpr/utils/ErrorHandler.ts"],
4
4
  "sourcesContent": ["import { components } from '../types/api'\nimport logger from './logger'\n\nexport interface DprErrorMessage {\n userMessage?: string\n developerMessage?: string\n stack?: string\n moreInfo?: string\n status?: string | number\n}\n\ninterface DprErrorData {\n data: components['schemas']['ErrorResponse']\n}\n\ninterface ZodValidationError {\n userMessage: string\n stack: string\n}\n\nclass ErrorHandler {\n error: Error | components['schemas']['ErrorResponse'] | string | undefined | unknown | DprErrorData\n\n developerMessage?: string | undefined\n\n userMessage?: string | undefined\n\n moreInfo?: string | undefined\n\n stack?: string | undefined\n\n status?: number | string | undefined\n\n constructor(error: Error | components['schemas']['ErrorResponse'] | string | undefined | unknown) {\n this.error = error\n logger.error(`Error: ${JSON.stringify(error)}`)\n }\n\n formatError = (): DprErrorMessage => {\n return this.handleError()\n }\n\n private handleError = (): DprErrorMessage => {\n // status: FAILED\n if (typeof this.error === 'string') {\n this.developerMessage = this.error\n }\n\n // Error response\n else if ((<DprErrorData>this.error).data) {\n const error = (<DprErrorData>this.error).data\n this.developerMessage = error.developerMessage\n this.userMessage = error.userMessage\n this.moreInfo = error.moreInfo\n this.status = error.status\n }\n\n // client side error\n else if (Object.prototype.hasOwnProperty.call(this.error, 'message')) {\n const error = <Error>this.error\n this.userMessage = error.message\n this.stack = error.stack\n this.status = 500\n }\n\n // Server response error\n else if (Object.prototype.hasOwnProperty.call(this.error, 'developerMessage')) {\n const error = <components['schemas']['ErrorResponse']>this.error\n this.developerMessage = error.developerMessage\n this.userMessage = error.userMessage\n this.moreInfo = error.moreInfo\n this.status = error.status\n }\n\n // Zod error\n else if (Object.prototype.hasOwnProperty.call(this.error, 'userMessage')) {\n const error = <ZodValidationError>this.error\n if (error.stack && error.stack.includes('ZodError')) {\n const errorArr: { message: string }[] = JSON.parse(error.userMessage)\n this.userMessage = errorArr.map((m) => m.message).join(', ')\n this.status = 500\n this.stack = error.stack\n }\n }\n\n const formattedError = {\n ...(this.developerMessage && { developerMessage: this.developerMessage }),\n ...(this.userMessage && { userMessage: this.userMessage }),\n ...(this.moreInfo && { moreInfo: this.moreInfo }),\n ...(this.stack && { stack: this.stack }),\n ...(this.status && { status: this.status }),\n }\n\n logger.error(JSON.stringify(formattedError, null, 2))\n\n return formattedError\n }\n}\n\nexport { ErrorHandler }\nexport default ErrorHandler\n"],
5
- "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,kBAAAE,EAAA,YAAAC,IAAA,eAAAC,EAAAJ,GACA,IAAAK,EAAmB,uBAmBnB,MAAMH,CAAa,CACjB,MAEA,iBAEA,YAEA,SAEA,MAEA,OAEA,YAAYI,EAAsF,CAChG,KAAK,MAAQA,EACb,EAAAC,QAAO,MAAM,UAAU,KAAK,UAAUD,CAAK,CAAC,EAAE,CAChD,CAEA,YAAc,IACL,KAAK,YAAY,EAGlB,YAAc,IAAuB,CAE3C,GAAI,OAAO,KAAK,OAAU,SACxB,KAAK,iBAAmB,KAAK,cAIP,KAAK,MAAO,KAAM,CACxC,MAAMA,EAAuB,KAAK,MAAO,KACzC,KAAK,iBAAmBA,EAAM,iBAC9B,KAAK,YAAcA,EAAM,YACzB,KAAK,SAAWA,EAAM,SACtB,KAAK,OAASA,EAAM,MACtB,SAGS,OAAO,UAAU,eAAe,KAAK,KAAK,MAAO,SAAS,EAAG,CACpE,MAAMA,EAAe,KAAK,MAC1B,KAAK,YAAcA,EAAM,QACzB,KAAK,MAAQA,EAAM,MACnB,KAAK,OAAS,GAChB,SAGS,OAAO,UAAU,eAAe,KAAK,KAAK,MAAO,kBAAkB,EAAG,CAC7E,MAAMA,EAAgD,KAAK,MAC3D,KAAK,iBAAmBA,EAAM,iBAC9B,KAAK,YAAcA,EAAM,YACzB,KAAK,SAAWA,EAAM,SACtB,KAAK,OAASA,EAAM,MACtB,SAGS,OAAO,UAAU,eAAe,KAAK,KAAK,MAAO,aAAa,EAAG,CACxE,MAAMA,EAA4B,KAAK,MACvC,GAAIA,EAAM,OAASA,EAAM,MAAM,SAAS,UAAU,EAAG,CACnD,MAAME,EAAkC,KAAK,MAAMF,EAAM,WAAW,EACpE,KAAK,YAAcE,EAAS,IAAKC,GAAMA,EAAE,OAAO,EAAE,KAAK,IAAI,EAC3D,KAAK,OAAS,IACd,KAAK,MAAQH,EAAM,KACrB,CACF,CAEA,MAAMI,EAAiB,CACrB,GAAI,KAAK,kBAAoB,CAAE,iBAAkB,KAAK,gBAAiB,EACvE,GAAI,KAAK,aAAe,CAAE,YAAa,KAAK,WAAY,EACxD,GAAI,KAAK,UAAY,CAAE,SAAU,KAAK,QAAS,EAC/C,GAAI,KAAK,OAAS,CAAE,MAAO,KAAK,KAAM,EACtC,GAAI,KAAK,QAAU,CAAE,OAAQ,KAAK,MAAO,CAC3C,EAEA,SAAAH,QAAO,MAAM,KAAK,UAAUG,EAAgB,KAAM,CAAC,CAAC,EAE7CA,CACT,CACF,CAGA,IAAOP,EAAQD",
6
- "names": ["ErrorHandler_exports", "__export", "ErrorHandler", "ErrorHandler_default", "__toCommonJS", "import_logger", "error", "logger", "errorArr", "m", "formattedError"]
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,oBAAmB;AAmBnB,MAAM,aAAa;AAAA,EACjB;AAAA,EAEA;AAAA,EAEA;AAAA,EAEA;AAAA,EAEA;AAAA,EAEA;AAAA,EAEA,YAAY,OAAsF;AAChG,SAAK,QAAQ;AACb,kBAAAA,QAAO,MAAM,UAAU,KAAK,UAAU,KAAK,CAAC,EAAE;AAAA,EAChD;AAAA,EAEA,cAAc,MAAuB;AACnC,WAAO,KAAK,YAAY;AAAA,EAC1B;AAAA,EAEQ,cAAc,MAAuB;AAE3C,QAAI,OAAO,KAAK,UAAU,UAAU;AAClC,WAAK,mBAAmB,KAAK;AAAA,IAC/B,WAGwB,KAAK,MAAO,MAAM;AACxC,YAAM,QAAuB,KAAK,MAAO;AACzC,WAAK,mBAAmB,MAAM;AAC9B,WAAK,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object.create;var m=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var A=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty;var N=(n,t)=>{for(var a in t)m(n,a,{get:t[a],enumerable:!0})},y=(n,t,a,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of v(t))!w.call(n,e)&&e!==a&&m(n,e,{get:()=>t[e],enumerable:!(i=P(t,e))||i.enumerable});return n};var f=(n,t,a)=>(a=n!=null?K(A(n)):{},y(t||!n||!n.__esModule?m(a,"default",{value:n,enumerable:!0}):a,n)),F=n=>y(m({},"__esModule",{value:!0}),n);var H={};N(H,{ParentChildDataTableBuilder:()=>u,default:()=>B});module.exports=F(H);var S=f(require("../DataTableBuilder/DataTableBuilder")),g=require("../arrayUtils"),b=f(require("../SectionedDataTableBuilder/SectionedDataTableBuilder"));class u extends b.default{variant;childVariants;childData=[];constructor(t){const{specification:a}=t,{sections:i,template:e}=a;super(a),this.sections=i,this.template=e,this.variant=t,this.childVariants=this.variant.childVariants||[]}createParentChildTable(t,a){let i={};const e=this.mapNamesToFields(this.childVariants.flatMap(r=>r.joinFields).reduce(g.distinct,[])),s=this.calculateParentChildKeys(t,e);s.forEach(r=>{i[r.sortKey]={parent:[]}}),i=this.splitParentDataIntoSections(i,t,e),i=this.splitChildDataIntoSections(s,i);const c=this.createChildDataTableBuilders();return s.flatMap(r=>{const l=i[r.sortKey]||{};let h=[];return l&&(h=l.parent?l.parent:[]),[a].concat(h.map(d=>this.mapRow(d,"dpr-parent-cell"))).concat(this.childVariants.filter(d=>l&&l[d.id]).map(d=>{const p=c[d.id],D=l[d.id],C=p&&D?p.buildTable(D):void 0,T=C?this.convertDataTableToHtml(C):"";return[{classes:"dpr-child-report-cell",format:"string",html:`<div class='dpr-child-report'><h2 class="govuk-heading-s">${d.name}</h2><div class="dpr-child-report_table">${T}</div></div>`,colspan:this.columns.length}]}))})}createParentChildSectionRows(t,a){const e=this.mapSections(t).sectionedData,s=[];return Object.keys(e).forEach(o=>{const r=e[o];s.push({sectionDescription:o,...this.getSectionCount(e,o),rows:this.createParentChildTable(r,a)})}),s.flatMap((o,r)=>[...this.createSectionHeader(o.sectionDescription,r,o.count,o.countDescription),...o.rows])}mapParentChildData(t,a){return this.sections?.length?this.createParentChildSectionRows(t,a):this.createParentChildTable(t,a)}createChildDataTableBuilders(){return this.childVariants.reduce((a,i)=>{const{specification:e}=i,s=e?e.fields:[],c=s.filter(r=>r.visible||r.mandatory).map(r=>r.name),o=new S.default(s).withNoHeaderOptions(c).withSortedData();return{...a,[i.id]:o}},{})}calculateParentChildKeys(t,a){return t.map(i=>({sortKey:this.getSortKey(i,a),childSortKeys:this.childVariants.reduce((e,s)=>({...e,[s.id]:this.getSortKey(i,this.mapNamesToFields(s.joinFields))}),{})})).reduce((i,e)=>i.find(s=>s.sortKey===e.sortKey)?i:i.concat(e),[])}splitParentDataIntoSections(t,a,i){return a.reduce((e,s)=>{const c=this.getSortKey(s,i),o=e[c]?e[c].parent:[];return{...e,...o&&{[c]:{parent:o.concat(s)}}}},t)}splitChildDataIntoSections(t,a){const i={...a};return this.childVariants.forEach(e=>{const s=this.mapNamesToFields(e.joinFields),c=this.childData.find(r=>r.id===e.id);(c?c.data:[]).filter(r=>{const l=this.getSortKey(r,s);return t.find(h=>h.childSortKeys[e.id]===l)}).forEach(r=>{const l=this.getSortKey(r,s),h=t.find(D=>D.childSortKeys[e.id]===l),d=h?h.sortKey:"",p=i[d];if(p){const D=p[e.id]||[];p[e.id]=D.concat(r)}})}),i}withChildData(t){return this.childData=t,this}buildTable(t){return{head:null,rows:this.mapParentChildData(t,this.mapHeader(!0,"govuk-table__header")),rowCount:t.length,colCount:this.columns.length}}}var B=u;0&&(module.exports={ParentChildDataTableBuilder});
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var ParentChildDataTableBuilder_exports = {};
30
+ __export(ParentChildDataTableBuilder_exports, {
31
+ ParentChildDataTableBuilder: () => ParentChildDataTableBuilder,
32
+ default: () => ParentChildDataTableBuilder_default
33
+ });
34
+ module.exports = __toCommonJS(ParentChildDataTableBuilder_exports);
35
+ var import_DataTableBuilder = __toESM(require("../DataTableBuilder/DataTableBuilder"));
36
+ var import_arrayUtils = require("../arrayUtils");
37
+ var import_SectionedDataTableBuilder = __toESM(require("../SectionedDataTableBuilder/SectionedDataTableBuilder"));
38
+ class ParentChildDataTableBuilder extends import_SectionedDataTableBuilder.default {
39
+ variant;
40
+ childVariants;
41
+ childData = [];
42
+ constructor(variant) {
43
+ const { specification } = variant;
44
+ const { sections, template } = specification;
45
+ super(specification);
46
+ this.sections = sections;
47
+ this.template = template;
48
+ this.variant = variant;
49
+ this.childVariants = this.variant.childVariants || [];
50
+ }
51
+ createParentChildTable(parentData, header) {
52
+ let sectionedParentChildData = {};
53
+ const joinFields = this.mapNamesToFields(this.childVariants.flatMap((c) => c.joinFields).reduce(import_arrayUtils.distinct, []));
54
+ const parentChildKeys = this.calculateParentChildKeys(parentData, joinFields);
55
+ parentChildKeys.forEach((parentKey) => {
56
+ sectionedParentChildData[parentKey.sortKey] = {
57
+ parent: []
58
+ };
59
+ });
60
+ sectionedParentChildData = this.splitParentDataIntoSections(sectionedParentChildData, parentData, joinFields);
61
+ sectionedParentChildData = this.splitChildDataIntoSections(parentChildKeys, sectionedParentChildData);
62
+ const childDataTableBuilders = this.createChildDataTableBuilders();
63
+ const parentChildTable = parentChildKeys.flatMap((key) => {
64
+ const sectionData = sectionedParentChildData[key.sortKey] || {};
65
+ let parentSectionData = [];
66
+ if (sectionData) {
67
+ parentSectionData = sectionData["parent"] ? sectionData["parent"] : [];
68
+ }
69
+ return [header].concat(parentSectionData.map((r) => this.mapRow(r, "dpr-parent-cell"))).concat(
70
+ this.childVariants.filter((childVariant) => sectionData && sectionData[childVariant.id]).map((childVariant) => {
71
+ const builder = childDataTableBuilders[childVariant.id];
72
+ const section = sectionData[childVariant.id];
73
+ const dataTable = builder && section ? builder.buildTable(section) : void 0;
74
+ const dataTableHtml = dataTable ? this.convertDataTableToHtml(dataTable) : "";
75
+ return [
76
+ {
77
+ classes: "dpr-child-report-cell",
78
+ format: "string",
79
+ html: `<div class='dpr-child-report'><h2 class="govuk-heading-s">${childVariant.name}</h2><div class="dpr-child-report_table">${dataTableHtml}</div></div>`,
80
+ colspan: this.columns.length
81
+ }
82
+ ];
83
+ })
84
+ );
85
+ });
86
+ return parentChildTable;
87
+ }
88
+ createParentChildSectionRows(parentData, header) {
89
+ const sectionsDetails = this.mapSections(parentData);
90
+ const sectionedData = sectionsDetails.sectionedData;
91
+ const sectionedParentChildSectionedRows = [];
92
+ Object.keys(sectionedData).forEach((sectionDescription) => {
93
+ const data = sectionedData[sectionDescription];
94
+ sectionedParentChildSectionedRows.push({
95
+ sectionDescription,
96
+ ...this.getSectionCount(sectionedData, sectionDescription),
97
+ rows: this.createParentChildTable(data, header)
98
+ });
99
+ });
100
+ const rows = sectionedParentChildSectionedRows.flatMap((section, index) => {
101
+ const sectionHeader = this.createSectionHeader(
102
+ section.sectionDescription,
103
+ index,
104
+ section.count,
105
+ section.countDescription
106
+ );
107
+ return [...sectionHeader, ...section.rows];
108
+ });
109
+ return rows;
110
+ }
111
+ mapParentChildData(parentData, header) {
112
+ if (this.sections?.length) {
113
+ return this.createParentChildSectionRows(parentData, header);
114
+ }
115
+ return this.createParentChildTable(parentData, header);
116
+ }
117
+ createChildDataTableBuilders() {
118
+ const childDataTables = this.childVariants.reduce((previousValue, childVariant) => {
119
+ const { specification } = childVariant;
120
+ const fields = specification ? specification.fields : [];
121
+ const fieldNamesToDisplay = fields.filter((f) => f.visible || f.mandatory).map((f) => f.name);
122
+ const dataTableBuilder = new import_DataTableBuilder.default(fields).withNoHeaderOptions(fieldNamesToDisplay).withSortedData();
123
+ return {
124
+ ...previousValue,
125
+ [childVariant.id]: dataTableBuilder
126
+ };
127
+ }, {});
128
+ return childDataTables;
129
+ }
130
+ calculateParentChildKeys(parentData, joinFields) {
131
+ return parentData.map(
132
+ (rowData) => ({
133
+ sortKey: this.getSortKey(rowData, joinFields),
134
+ childSortKeys: this.childVariants.reduce((previousValue, childVariant) => {
135
+ return {
136
+ ...previousValue,
137
+ [childVariant.id]: this.getSortKey(rowData, this.mapNamesToFields(childVariant.joinFields))
138
+ };
139
+ }, {})
140
+ })
141
+ ).reduce((previousValue, sortKey) => {
142
+ if (previousValue.find((v) => v.sortKey === sortKey.sortKey)) {
143
+ return previousValue;
144
+ }
145
+ return previousValue.concat(sortKey);
146
+ }, []);
147
+ }
148
+ splitParentDataIntoSections(sectionedParentChildData, parentData, joinFields) {
149
+ return parentData.reduce((previousValue, rowData) => {
150
+ const parentKey = this.getSortKey(rowData, joinFields);
151
+ const previousParentValue = previousValue[parentKey] ? previousValue[parentKey]["parent"] : [];
152
+ return {
153
+ ...previousValue,
154
+ ...previousParentValue && {
155
+ [parentKey]: {
156
+ parent: previousParentValue.concat(rowData)
157
+ }
158
+ }
159
+ };
160
+ }, sectionedParentChildData);
161
+ }
162
+ splitChildDataIntoSections(parentKeys, sectionedParentChildData) {
163
+ const sectionedParentChildDataWithChildren = { ...sectionedParentChildData };
164
+ this.childVariants.forEach((childVariant) => {
165
+ const childFields = this.mapNamesToFields(childVariant.joinFields);
166
+ const matchingChildData = this.childData.find((d) => d.id === childVariant.id);
167
+ const data = matchingChildData ? matchingChildData.data : [];
168
+ data.filter((rowData) => {
169
+ const sortKey = this.getSortKey(rowData, childFields);
170
+ return parentKeys.find((p) => p.childSortKeys[childVariant.id] === sortKey);
171
+ }).forEach((rowData) => {
172
+ const sortKey = this.getSortKey(rowData, childFields);
173
+ const parent = parentKeys.find((p) => p.childSortKeys[childVariant.id] === sortKey);
174
+ const parentSortKey = parent ? parent.sortKey : "";
175
+ const parentSection = sectionedParentChildDataWithChildren[parentSortKey];
176
+ if (parentSection) {
177
+ const existingChildData = parentSection[childVariant.id] || [];
178
+ parentSection[childVariant.id] = existingChildData.concat(rowData);
179
+ }
180
+ });
181
+ });
182
+ return sectionedParentChildDataWithChildren;
183
+ }
184
+ withChildData(childData) {
185
+ this.childData = childData;
186
+ return this;
187
+ }
188
+ buildTable(data) {
189
+ return {
190
+ head: null,
191
+ rows: this.mapParentChildData(data, this.mapHeader(true, "govuk-table__header")),
192
+ rowCount: data.length,
193
+ colCount: this.columns.length
194
+ };
195
+ }
196
+ }
197
+ var ParentChildDataTableBuilder_default = ParentChildDataTableBuilder;
198
+ // Annotate the CommonJS export names for ESM import in node:
199
+ 0 && (module.exports = {
200
+ ParentChildDataTableBuilder
201
+ });
2
202
  //# sourceMappingURL=ParentChildDataTableBuilder.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/dpr/utils/ParentChildDataTableBuilder/ParentChildDataTableBuilder.ts"],
4
4
  "sourcesContent": ["import Dict = NodeJS.Dict\nimport { components } from '../../types/api'\nimport { Cell, DataTable } from '../DataTableBuilder/types'\nimport DataTableBuilder from '../DataTableBuilder/DataTableBuilder'\nimport { distinct } from '../arrayUtils'\nimport { ChildData, ParentChildSortKey } from './types'\nimport SectionedDataTableBuilder from '../SectionedDataTableBuilder/SectionedDataTableBuilder'\n\nclass ParentChildDataTableBuilder extends SectionedDataTableBuilder {\n variant: components['schemas']['VariantDefinition']\n\n childVariants: components['schemas']['ChildVariantDefinition'][]\n\n childData: Array<ChildData> = []\n\n constructor(variant: components['schemas']['VariantDefinition']) {\n const { specification } = variant\n const { sections, template } = <components['schemas']['Specification']>specification\n super(<components['schemas']['Specification']>specification)\n\n this.sections = sections\n this.template = template\n this.variant = variant\n this.childVariants = this.variant.childVariants || []\n }\n\n private createParentChildTable(parentData: Array<Dict<string>>, header: Cell[]) {\n let sectionedParentChildData: Dict<Dict<Array<Dict<string>>>> = {}\n const joinFields = this.mapNamesToFields(this.childVariants.flatMap((c) => c.joinFields).reduce(distinct, []))\n // Get the parent-child joins definition data\n\n // Create the section keys and\n const parentChildKeys = this.calculateParentChildKeys(parentData, joinFields)\n parentChildKeys.forEach((parentKey) => {\n sectionedParentChildData[parentKey.sortKey] = {\n parent: [],\n }\n })\n\n sectionedParentChildData = this.splitParentDataIntoSections(sectionedParentChildData, parentData, joinFields)\n sectionedParentChildData = this.splitChildDataIntoSections(parentChildKeys, sectionedParentChildData)\n\n const childDataTableBuilders = this.createChildDataTableBuilders()\n\n const parentChildTable = parentChildKeys.flatMap((key) => {\n const sectionData = sectionedParentChildData[key.sortKey] || {}\n\n let parentSectionData: Dict<string>[] = []\n if (sectionData) {\n parentSectionData = sectionData['parent'] ? sectionData['parent'] : []\n }\n\n return [header].concat(parentSectionData.map((r) => this.mapRow(r, 'dpr-parent-cell'))).concat(\n this.childVariants\n .filter((childVariant) => sectionData && sectionData[childVariant.id])\n .map((childVariant) => {\n const builder = childDataTableBuilders[childVariant.id]\n const section = sectionData[childVariant.id]\n const dataTable = builder && section ? builder.buildTable(section) : undefined\n const dataTableHtml = dataTable ? this.convertDataTableToHtml(dataTable) : ''\n\n return [\n {\n classes: 'dpr-child-report-cell',\n format: 'string',\n html: `<div class='dpr-child-report'><h2 class=\"govuk-heading-s\">${childVariant.name}</h2><div class=\"dpr-child-report_table\">${dataTableHtml}</div></div>`,\n colspan: this.columns.length,\n },\n ]\n }),\n )\n })\n\n return parentChildTable\n }\n\n private createParentChildSectionRows(parentData: Array<Dict<string>>, header: Cell[]) {\n const sectionsDetails = this.mapSections(parentData)\n const sectionedData = sectionsDetails.sectionedData as Dict<Array<Dict<string>>>\n const sectionedParentChildSectionedRows: {\n sectionDescription: string\n rows: Cell[][]\n count: number\n countDescription: string\n }[] = []\n\n Object.keys(sectionedData).forEach((sectionDescription) => {\n const data = sectionedData[sectionDescription] as Array<Dict<string>>\n\n sectionedParentChildSectionedRows.push({\n sectionDescription,\n ...this.getSectionCount(sectionedData, sectionDescription),\n rows: this.createParentChildTable(data, header),\n })\n })\n\n const rows = sectionedParentChildSectionedRows.flatMap((section, index) => {\n const sectionHeader = this.createSectionHeader(\n section.sectionDescription,\n index,\n section.count,\n section.countDescription,\n )\n return [...sectionHeader, ...section.rows]\n })\n\n return rows\n }\n\n private mapParentChildData(parentData: Array<Dict<string>>, header: Cell[]): Cell[][] {\n if (this.sections?.length) {\n return this.createParentChildSectionRows(parentData, header)\n }\n return this.createParentChildTable(parentData, header)\n }\n\n private createChildDataTableBuilders() {\n const childDataTables: Dict<DataTableBuilder> = this.childVariants.reduce((previousValue, childVariant) => {\n const { specification } = childVariant\n const fields = specification ? specification.fields : []\n const fieldNamesToDisplay = fields.filter((f) => f.visible || f.mandatory).map((f) => f.name)\n\n const dataTableBuilder = new DataTableBuilder(fields).withNoHeaderOptions(fieldNamesToDisplay).withSortedData()\n\n return {\n ...previousValue,\n [childVariant.id]: dataTableBuilder,\n }\n }, {})\n return childDataTables\n }\n\n private calculateParentChildKeys(\n parentData: Array<NodeJS.Dict<string>>,\n joinFields: components['schemas']['FieldDefinition'][],\n ) {\n return parentData\n .map(\n (rowData): ParentChildSortKey => ({\n sortKey: this.getSortKey(rowData, joinFields),\n childSortKeys: this.childVariants.reduce((previousValue, childVariant) => {\n return {\n ...previousValue,\n [childVariant.id]: this.getSortKey(rowData, this.mapNamesToFields(childVariant.joinFields)),\n }\n }, {}),\n }),\n )\n .reduce((previousValue: ParentChildSortKey[], sortKey: ParentChildSortKey) => {\n if (previousValue.find((v) => v.sortKey === sortKey.sortKey)) {\n return previousValue\n }\n return previousValue.concat(sortKey)\n }, [])\n }\n\n private splitParentDataIntoSections(\n sectionedParentChildData: NodeJS.Dict<NodeJS.Dict<Array<NodeJS.Dict<string>>>>,\n parentData: Array<NodeJS.Dict<string>>,\n joinFields: components['schemas']['FieldDefinition'][],\n ) {\n return parentData.reduce((previousValue, rowData) => {\n const parentKey: string = this.getSortKey(rowData, joinFields)\n const previousParentValue = previousValue[parentKey] ? previousValue[parentKey]['parent'] : []\n\n return {\n ...previousValue,\n ...(previousParentValue && {\n [parentKey]: {\n parent: previousParentValue.concat(rowData),\n },\n }),\n }\n }, sectionedParentChildData)\n }\n\n private splitChildDataIntoSections(\n parentKeys: ParentChildSortKey[],\n sectionedParentChildData: Dict<Dict<Array<Dict<string>>>>,\n ): Dict<Dict<Array<Dict<string>>>> {\n const sectionedParentChildDataWithChildren = { ...sectionedParentChildData }\n\n this.childVariants.forEach((childVariant) => {\n const childFields = this.mapNamesToFields(childVariant.joinFields)\n const matchingChildData = this.childData.find((d) => d.id === childVariant.id)\n const data = matchingChildData ? matchingChildData.data : []\n\n data\n .filter((rowData) => {\n const sortKey = this.getSortKey(rowData, childFields)\n return parentKeys.find((p) => p.childSortKeys[childVariant.id] === sortKey)\n })\n .forEach((rowData) => {\n const sortKey = this.getSortKey(rowData, childFields)\n const parent = parentKeys.find((p) => p.childSortKeys[childVariant.id] === sortKey)\n const parentSortKey = parent ? parent.sortKey : ''\n const parentSection = sectionedParentChildDataWithChildren[parentSortKey]\n if (parentSection) {\n const existingChildData = parentSection[childVariant.id] || []\n parentSection[childVariant.id] = existingChildData.concat(rowData)\n }\n })\n })\n\n return sectionedParentChildDataWithChildren\n }\n\n withChildData(childData: Array<ChildData>) {\n this.childData = childData\n return this\n }\n\n override buildTable(data: Array<Dict<string>>): DataTable {\n return {\n head: null,\n rows: this.mapParentChildData(data, this.mapHeader(true, 'govuk-table__header')),\n rowCount: data.length,\n colCount: this.columns.length,\n }\n }\n}\n\nexport { ParentChildDataTableBuilder }\nexport default ParentChildDataTableBuilder\n"],
5
- "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,iCAAAE,EAAA,YAAAC,IAAA,eAAAC,EAAAJ,GAGA,IAAAK,EAA6B,mDAC7BC,EAAyB,yBAEzBC,EAAsC,qEAEtC,MAAML,UAAoC,EAAAM,OAA0B,CAClE,QAEA,cAEA,UAA8B,CAAC,EAE/B,YAAYC,EAAqD,CAC/D,KAAM,CAAE,cAAAC,CAAc,EAAID,EACpB,CAAE,SAAAE,EAAU,SAAAC,CAAS,EAA4CF,EACvE,MAA8CA,CAAa,EAE3D,KAAK,SAAWC,EAChB,KAAK,SAAWC,EAChB,KAAK,QAAUH,EACf,KAAK,cAAgB,KAAK,QAAQ,eAAiB,CAAC,CACtD,CAEQ,uBAAuBI,EAAiCC,EAAgB,CAC9E,IAAIC,EAA4D,CAAC,EACjE,MAAMC,EAAa,KAAK,iBAAiB,KAAK,cAAc,QAASC,GAAMA,EAAE,UAAU,EAAE,OAAO,WAAU,CAAC,CAAC,CAAC,EAIvGC,EAAkB,KAAK,yBAAyBL,EAAYG,CAAU,EAC5EE,EAAgB,QAASC,GAAc,CACrCJ,EAAyBI,EAAU,OAAO,EAAI,CAC5C,OAAQ,CAAC,CACX,CACF,CAAC,EAEDJ,EAA2B,KAAK,4BAA4BA,EAA0BF,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H,GAAIS,GAAuB,CACzB,CAACzB,CAAS,EAAG,CACX,OAAQyB,EAAoB,OAAOH,CAAO,CAC5C,CACF,CACF,CACF,EAAG1B,CAAwB,CAC7B,CAEQ,2BACN8B,EACA9B,EACiC,CACjC,MAAM+B,EAAuC,CAAE,GAAG/B,CAAyB,EAE3E,YAAK,cAAc,QAASU,GAAiB,CAC3C,MAAMsB,EAAc,KAAK,iBAAiBtB,EAAa,UAAU,EAC3DuB,EAAoB,KAAK,UAAU,KAAMC,GAAMA,EAAE,KAAOxB,EAAa,EAAE,GAChEuB,EAAoBA,EAAkB,KAAO,CAAC,GAGxD,OAAQP,GAAY,CACnB,MAAMC,EAAU,KAAK,WAAWD,EAASM,CAAW,EACpD,OAAOF,EAAW,KAAMK,GAAMA,EAAE,cAAczB,EAAa,EAAE,IAAMiB,CAAO,CAC5E,CAAC,EACA,QAASD,GAAY,CACpB,MAAMC,EAAU,KAAK,WAAWD,EAASM,CAAW,EAC9CI,EAASN,EAAW,KAAMK,GAAMA,EAAE,cAAczB,EAAa,EAAE,IAAMiB,CAAO,EAC5EU,EAAgBD,EAASA,EAAO,QAAU,GAC1CE,EAAgBP,EAAqCM,CAAa,EACxE,GAAIC,EAAe,CACjB,MAAMC,EAAoBD,EAAc5B,EAAa,EAAE,GAAK,CAAC,EAC7D4B,EAAc5B,EAAa,EAAE,EAAI6B,EAAkB,OAAOb,CAAO,CACnE,CACF,CAAC,CACL,CAAC,EAEMK,CACT,CAEA,cAAcS,EAA6B,CACzC,YAAK,UAAYA,EACV,IACT,CAES,WAAWtB,EAAsC,CACxD,MAAO,CACL,KAAM,KACN,KAAM,KAAK,mBAAmBA,EAAM,KAAK,UAAU,GAAM,qBAAqB,CAAC,EAC/E,SAAUA,EAAK,OACf,SAAU,KAAK,QAAQ,MACzB,CACF,CACF,CAGA,IAAO9B,EAAQD",
6
- "names": ["ParentChildDataTableBuilder_exports", "__export", "ParentChildDataTableBuilder", "ParentChildDataTableBuilder_default", "__toCommonJS", "import_DataTableBuilder", "import_arrayUtils", "import_SectionedDataTableBuilder", "SectionedDataTableBuilder", "variant", "specification", "sections", "template", "parentData", "header", "sectionedParentChildData", "joinFields", "c", "parentChildKeys", "parentKey", "childDataTableBuilders", "key", "sectionData", "parentSectionData", "r", "childVariant", "builder", "section", "dataTable", "dataTableHtml", "sectionedData", "sectionedParentChildSectionedRows", "sectionDescription", "data", "index", "previousValue", "fields", "fieldNamesToDisplay", "f", "dataTableBuilder", "DataTableBuilder", "rowData", "sortKey", "v", "previousParentValue", "parentKeys", "sectionedParentChildDataWithChildren", "childFields", "matchingChildData", "d", "p", "parent", "parentSortKey", "parentSection", "existingChildData", "childData"]
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,8BAA6B;AAC7B,wBAAyB;AAEzB,uCAAsC;AAEtC,MAAM,oCAAoC,iCAAAA,QAA0B;AAAA,EAClE;AAAA,EAEA;AAAA,EAEA,YAA8B,CAAC;AAAA,EAE/B,YAAY,SAAqD;AAC/D,UAAM,EAAE,cAAc,IAAI;AAC1B,UAAM,EAAE,UAAU,SAAS,IAA4C;AACvE,UAA8C,aAAa;AAE3D,SAAK,WAAW;AAChB,SAAK,WAAW;AAChB,SAAK,UAAU;AACf,SAAK,gBAAgB,KAAK,QAAQ,iBAAiB,CAAC;AAAA,EACtD;AAAA,EAEQ,uBAAuB,YAAiC,QAAgB;AAC9E,QAAI,2BAA4D,CAAC;AACjE,UAAM,aAAa,KAAK,iBAAiB,KAAK,cAAc,QAAQ,CAAC,MAAM,EAAE,UAAU,EAAE,OAAO,4BAAU,CAAC,CAAC,CAAC;AAI7G,UAAM,kBAAkB,KAAK,yBAAyB,YAAY,UAAU;AAC5E,oBAAgB,QAAQ,CAAC,cAAc;AACrC,+BAAyB,UAAU,OAAO,IAAI;AAAA,QAC5C,QAAQ,CAAC;AAAA,MACX;AAAA,IACF,CAAC;AAED,+BAA2B,KAAK,4BA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AM,EAAE,cAAc,aAAa,EAAE,MAAM,OAAO;AAClF,cAAM,gBAAgB,SAAS,OAAO,UAAU;AAChD,cAAM,gBAAgB,qCAAqC,aAAa;AACxE,YAAI,eAAe;AACjB,gBAAM,oBAAoB,cAAc,aAAa,EAAE,KAAK,CAAC;AAC7D,wBAAc,aAAa,EAAE,IAAI,kBAAkB,OAAO,OAAO;AAAA,QACnE;AAAA,MACF,CAAC;AAAA,IACL,CAAC;AAED,WAAO;AAAA,EACT;AAAA,EAEA,cAAc,WAA6B;AACzC,SAAK,YAAY;AACjB,WAAO;AAAA,EACT;AAAA,EAES,WAAW,MAAsC;AACxD,WAAO;AAAA,MACL,MAAM;AAAA,MACN,MAAM,KAAK,mBAAmB,MAAM,KAAK,UAAU,MAAM,qBAAqB,CAAC;AAAA,MAC/E,UAAU,KAAK;AAAA,MACf,UAAU,KAAK,QAAQ;AAAA,IACzB;AAAA,EACF;AACF;AAGA,IAAO,sCAAQ;",
6
+ "names": ["SectionedDataTableBuilder", "DataTableBuilder"]
7
7
  }
@@ -1,2 +1,17 @@
1
- "use strict";var o=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var n=Object.prototype.hasOwnProperty;var s=(r,t,a,e)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of d(t))!n.call(r,i)&&i!==a&&o(r,i,{get:()=>t[i],enumerable:!(e=c(t,i))||e.enumerable});return r};var y=r=>s(o({},"__esModule",{value:!0}),r);var D={};module.exports=y(D);
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+ var types_d_exports = {};
16
+ module.exports = __toCommonJS(types_d_exports);
2
17
  //# sourceMappingURL=types.d.js.map