@hmcts/opal-frontend-common 0.0.2 → 0.0.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 (441) hide show
  1. package/components/abstract/abstract-form-alias-base/abstract-form-alias-base.d.ts +117 -0
  2. package/components/abstract/abstract-form-alias-base/interfaces/abstract-form-alias-base-alias-controls.interface.d.ts +4 -0
  3. package/components/abstract/abstract-form-array-base/abstract-form-array-base.d.ts +158 -0
  4. package/components/abstract/abstract-form-array-parent-base/abstract-form-array-parent-base.component.d.ts +13 -0
  5. package/components/abstract/abstract-form-array-removal-base/abstract-form-array-removal-base.component.d.ts +44 -0
  6. package/components/abstract/abstract-form-array-removal-base/interfaces/abstract-form-array-removal-base-control-value.interface.d.ts +5 -0
  7. package/components/abstract/abstract-form-base/abstract-form-base.component.d.ts +232 -0
  8. package/components/abstract/abstract-form-base/interfaces/abstract-form-base-field-error.interface.d.ts +6 -0
  9. package/components/abstract/abstract-form-base/interfaces/abstract-form-base-field-errors.interface.d.ts +4 -0
  10. package/components/abstract/abstract-form-base/interfaces/abstract-form-base-form-error.interface.d.ts +6 -0
  11. package/components/abstract/abstract-form-base/interfaces/abstract-form-base-form.interface.d.ts +4 -0
  12. package/components/abstract/abstract-form-base/interfaces/abstract-form-base-high-priority-form-error.interface.d.ts +5 -0
  13. package/components/abstract/abstract-form-base/interfaces/abstract-form-base-status.interface.d.ts +3 -0
  14. package/components/abstract/abstract-form-parent-base/abstract-form-parent-base.component.d.ts +29 -0
  15. package/components/abstract/abstract-sortable-table/abstract-sortable-table.component.d.ts +79 -0
  16. package/components/abstract/abstract-sortable-table/interfaces/abstract-sortable-table-interfaces.d.ts +7 -0
  17. package/components/abstract/abstract-sortable-table-pagination/abstract-sortable-table-pagination.component.d.ts +31 -0
  18. package/components/abstract/index.d.ts +5 -0
  19. package/components/abstract/interfaces/abstract-form-array-control-validation.interface.d.ts +5 -0
  20. package/components/abstract/interfaces/abstract-form-array-control.interface.d.ts +5 -0
  21. package/components/abstract/interfaces/abstract-form-array-controls.interface.d.ts +4 -0
  22. package/components/abstract/interfaces/abstract-form-base-form-error-summary-message.interface.d.ts +4 -0
  23. package/components/abstract/interfaces/abstract-form-control-error-message.interface.d.ts +3 -0
  24. package/components/abstract/public-api.d.ts +21 -0
  25. package/components/alphagov/alphagov-accessible-autocomplete/alphagov-accessible-autocomplete.component.d.ts +59 -0
  26. package/components/alphagov/alphagov-accessible-autocomplete/interfaces/alphagov-accessible-autocomplete-item.interface.d.ts +4 -0
  27. package/components/alphagov/index.d.ts +5 -0
  28. package/components/alphagov/public-api.d.ts +2 -0
  29. package/components/govuk/govuk-accordion/govuk-accordion.component.d.ts +13 -0
  30. package/components/govuk/govuk-back-link/govuk-back-link.component.d.ts +14 -0
  31. package/components/govuk/govuk-cancel-link/govuk-cancel-link.component.d.ts +12 -0
  32. package/components/govuk/govuk-checkboxes/govuk-checkboxes-conditional/govuk-checkboxes-conditional.component.d.ts +10 -0
  33. package/components/govuk/govuk-checkboxes/govuk-checkboxes-divider/govuk-checkboxes-divider.component.d.ts +5 -0
  34. package/components/govuk/govuk-checkboxes/govuk-checkboxes-item/govuk-checkboxes-item.component.d.ts +16 -0
  35. package/components/govuk/govuk-checkboxes/govuk-checkboxes.component.d.ts +10 -0
  36. package/components/govuk/govuk-checkboxes/interfaces/govuk-checkboxes-input.interface.d.ts +17 -0
  37. package/components/govuk/govuk-date-input/govuk-date-input.component.d.ts +18 -0
  38. package/components/govuk/govuk-date-input/interfaces/govuk-date-input.interface.d.ts +12 -0
  39. package/components/govuk/govuk-details/govuk-details.component.d.ts +6 -0
  40. package/components/govuk/govuk-error-summary/govuk-error-summary.component.d.ts +16 -0
  41. package/components/govuk/govuk-footer/constants/govuk-footer-links.constant.d.ts +2 -0
  42. package/components/govuk/govuk-footer/govuk-footer.component.d.ts +6 -0
  43. package/components/govuk/govuk-footer/interfaces/govuk-footer-links.interface.d.ts +5 -0
  44. package/components/govuk/govuk-header/constants/govuk-header-links.constant.d.ts +2 -0
  45. package/components/govuk/govuk-header/govuk-header-navigation-item/govuk-header-navigation-item.component.d.ts +12 -0
  46. package/components/govuk/govuk-header/govuk-header.component.d.ts +6 -0
  47. package/components/govuk/govuk-header/interfaces/govuk-header-links.interface.d.ts +4 -0
  48. package/components/govuk/govuk-heading-with-caption/govuk-heading-with-caption.component.d.ts +9 -0
  49. package/components/govuk/govuk-inset-text/govuk-inset-text.component.d.ts +6 -0
  50. package/components/govuk/govuk-notification-banner/govuk-notification-banner.component.d.ts +10 -0
  51. package/components/govuk/govuk-pagination/govuk-pagination.component.d.ts +44 -0
  52. package/components/govuk/govuk-panel/govuk-panel.component.d.ts +7 -0
  53. package/components/govuk/govuk-radio/govuk-radio.component.d.ts +11 -0
  54. package/components/govuk/govuk-radio/govuk-radios-conditional/govuk-radios-conditional.component.d.ts +10 -0
  55. package/components/govuk/govuk-radio/govuk-radios-divider/govuk-radios-divider.component.d.ts +5 -0
  56. package/components/govuk/govuk-radio/govuk-radios-item/govuk-radios-item.component.d.ts +18 -0
  57. package/components/govuk/govuk-radio/interfaces/govuk-radio-input.interface.d.ts +17 -0
  58. package/components/govuk/govuk-radio/interfaces/govuk-radio-options.interface.d.ts +4 -0
  59. package/components/govuk/govuk-select/govuk-select.component.d.ts +18 -0
  60. package/components/govuk/govuk-select/interfaces/govuk-select-options.interface.d.ts +4 -0
  61. package/components/govuk/govuk-summary-card-list/govuk-summary-card-action/govuk-summary-card-action.component.d.ts +17 -0
  62. package/components/govuk/govuk-summary-card-list/govuk-summary-card-list.component.d.ts +12 -0
  63. package/components/govuk/govuk-summary-list/govuk-summary-list-row/govuk-summary-list-row-actions/govuk-summary-list-row-action-item/govuk-summary-list-row-action-item.component.d.ts +15 -0
  64. package/components/govuk/govuk-summary-list/govuk-summary-list-row/govuk-summary-list-row-actions/govuk-summary-list-row-actions.component.d.ts +5 -0
  65. package/components/govuk/govuk-summary-list/govuk-summary-list-row/govuk-summary-list-row.component.d.ts +20 -0
  66. package/components/govuk/govuk-summary-list/govuk-summary-list.component.d.ts +7 -0
  67. package/components/govuk/govuk-table/govuk-table-body-row/govuk-table-body-row-data/govuk-table-body-row-data.component.d.ts +8 -0
  68. package/components/govuk/govuk-table/govuk-table-body-row/govuk-table-body-row.component.d.ts +7 -0
  69. package/components/govuk/govuk-table/govuk-table-heading/govuk-table-heading.component.d.ts +7 -0
  70. package/components/govuk/govuk-table/govuk-table.component.d.ts +6 -0
  71. package/components/govuk/govuk-tabs/govuk-tab-list-item/govuk-tab-list-item.component.d.ts +11 -0
  72. package/components/govuk/govuk-tabs/govuk-tab-panel/govuk-tab-panel.component.d.ts +9 -0
  73. package/components/govuk/govuk-tabs/govuk-tabs.component.d.ts +14 -0
  74. package/components/govuk/govuk-tag/govuk-tag.component.d.ts +7 -0
  75. package/components/govuk/govuk-task-list/govuk-task-list-item/govuk-task-list-item.component.d.ts +8 -0
  76. package/components/govuk/govuk-task-list/govuk-task-list.component.d.ts +7 -0
  77. package/components/govuk/govuk-text-area/govuk-text-area.component.d.ts +21 -0
  78. package/components/govuk/govuk-text-input-prefix-suffix/govuk-text-input-prefix-suffix.component.d.ts +22 -0
  79. package/components/govuk/index.d.ts +5 -0
  80. package/components/govuk/public-api.d.ts +52 -0
  81. package/components/moj/index.d.ts +5 -0
  82. package/components/moj/moj-badge/moj.badge.component.d.ts +7 -0
  83. package/components/moj/moj-banner/moj-banner.component.d.ts +8 -0
  84. package/components/moj/moj-button-menu/moj-button-menu-item/moj-button-menu-item.component.d.ts +8 -0
  85. package/components/moj/moj-button-menu/moj-button-menu.component.d.ts +10 -0
  86. package/components/moj/moj-date-picker/moj-date-picker.component.d.ts +40 -0
  87. package/components/moj/moj-header/constants/moj-header-links.constant.d.ts +2 -0
  88. package/components/moj/moj-header/interfaces/moj-header-links.interface.d.ts +4 -0
  89. package/components/moj/moj-header/moj-header-navigation-item/moj-header-navigation-item.component.d.ts +12 -0
  90. package/components/moj/moj-header/moj-header.component.d.ts +6 -0
  91. package/components/moj/moj-notification-badge/moj-notification-badge.component.d.ts +6 -0
  92. package/components/moj/moj-page-header/moj-page-header.component.d.ts +6 -0
  93. package/components/moj/moj-pagination/moj-pagination-item/moj-pagination-item.component.d.ts +6 -0
  94. package/components/moj/moj-pagination/moj-pagination-link/moj-pagination-link.component.d.ts +43 -0
  95. package/components/moj/moj-pagination/moj-pagination-list/moj-pagination-list.component.d.ts +6 -0
  96. package/components/moj/moj-pagination/moj-pagination.component.d.ts +108 -0
  97. package/components/moj/moj-primary-navigation/moj-primary-navigation-item/moj-primary-navigation-item.component.d.ts +18 -0
  98. package/components/moj/moj-primary-navigation/moj-primary-navigation.component.d.ts +26 -0
  99. package/components/moj/moj-sortable-table/moj-sortable-table-header/moj-sortable-table-header.component.d.ts +24 -0
  100. package/components/moj/moj-sortable-table/moj-sortable-table-row/moj-sortable-table-row-data/moj-sortable-table-row-data.component.d.ts +8 -0
  101. package/components/moj/moj-sortable-table/moj-sortable-table-row/moj-sortable-table-row.component.d.ts +7 -0
  102. package/components/moj/moj-sortable-table/moj-sortable-table-status/moj-sortable-table-status.component.d.ts +7 -0
  103. package/components/moj/moj-sortable-table/moj-sortable-table.component.d.ts +6 -0
  104. package/components/moj/moj-sub-navigation/moj-sub-navigation-item/moj-sub-navigation-item.component.d.ts +18 -0
  105. package/components/moj/moj-sub-navigation/moj-sub-navigation.component.d.ts +21 -0
  106. package/components/moj/moj-ticket-panel/moj-ticket-panel.component.d.ts +8 -0
  107. package/components/moj/moj-timeline/moj-timeline-item/moj-timeline-item.component.d.ts +5 -0
  108. package/components/moj/moj-timeline/moj-timeline.component.d.ts +5 -0
  109. package/components/moj/public-api.d.ts +27 -0
  110. package/constants/index.d.ts +5 -0
  111. package/constants/public-api.d.ts +4 -0
  112. package/constants/src/routing-paths.constant.d.ts +2 -0
  113. package/constants/src/routing-titles.constant.d.ts +2 -0
  114. package/constants/src/session-endpoints.constant.d.ts +2 -0
  115. package/constants/src/sso-endpoints.constant.d.ts +2 -0
  116. package/fesm2022/hmcts-opal-frontend-common-components-abstract.mjs +1288 -0
  117. package/fesm2022/hmcts-opal-frontend-common-components-abstract.mjs.map +1 -0
  118. package/fesm2022/hmcts-opal-frontend-common-components-alphagov.mjs +170 -0
  119. package/fesm2022/hmcts-opal-frontend-common-components-alphagov.mjs.map +1 -0
  120. package/fesm2022/hmcts-opal-frontend-common-components-govuk.mjs +1259 -0
  121. package/fesm2022/hmcts-opal-frontend-common-components-govuk.mjs.map +1 -0
  122. package/fesm2022/hmcts-opal-frontend-common-components-moj.mjs +861 -0
  123. package/fesm2022/hmcts-opal-frontend-common-components-moj.mjs.map +1 -0
  124. package/fesm2022/hmcts-opal-frontend-common-constants.mjs +36 -0
  125. package/fesm2022/hmcts-opal-frontend-common-constants.mjs.map +1 -0
  126. package/fesm2022/hmcts-opal-frontend-common-guards.mjs +134 -0
  127. package/fesm2022/hmcts-opal-frontend-common-guards.mjs.map +1 -0
  128. package/fesm2022/hmcts-opal-frontend-common-interceptors.mjs +31 -0
  129. package/fesm2022/hmcts-opal-frontend-common-interceptors.mjs.map +1 -0
  130. package/fesm2022/hmcts-opal-frontend-common-interfaces.mjs +4 -0
  131. package/fesm2022/hmcts-opal-frontend-common-interfaces.mjs.map +1 -0
  132. package/fesm2022/hmcts-opal-frontend-common-mocks.mjs +429 -0
  133. package/fesm2022/hmcts-opal-frontend-common-mocks.mjs.map +1 -0
  134. package/fesm2022/hmcts-opal-frontend-common-pages-sign-in-stub.component-eGVOJLC2.mjs +41 -0
  135. package/fesm2022/hmcts-opal-frontend-common-pages-sign-in-stub.component-eGVOJLC2.mjs.map +1 -0
  136. package/fesm2022/hmcts-opal-frontend-common-pages.mjs +109 -0
  137. package/fesm2022/hmcts-opal-frontend-common-pages.mjs.map +1 -0
  138. package/fesm2022/hmcts-opal-frontend-common-pipes.mjs +64 -0
  139. package/fesm2022/hmcts-opal-frontend-common-pipes.mjs.map +1 -0
  140. package/fesm2022/hmcts-opal-frontend-common-resolvers.mjs +40 -0
  141. package/fesm2022/hmcts-opal-frontend-common-resolvers.mjs.map +1 -0
  142. package/fesm2022/hmcts-opal-frontend-common-services.mjs +817 -0
  143. package/fesm2022/hmcts-opal-frontend-common-services.mjs.map +1 -0
  144. package/fesm2022/hmcts-opal-frontend-common-stores.mjs +40 -0
  145. package/fesm2022/hmcts-opal-frontend-common-stores.mjs.map +1 -0
  146. package/fesm2022/hmcts-opal-frontend-common-types.mjs +4 -0
  147. package/fesm2022/hmcts-opal-frontend-common-types.mjs.map +1 -0
  148. package/fesm2022/hmcts-opal-frontend-common-validators.mjs +278 -0
  149. package/fesm2022/hmcts-opal-frontend-common-validators.mjs.map +1 -0
  150. package/fesm2022/hmcts-opal-frontend-common.mjs +0 -1943
  151. package/fesm2022/hmcts-opal-frontend-common.mjs.map +1 -1
  152. package/{lib/guards → guards}/can-deactivate/can-deactivate.guard.d.ts +1 -1
  153. package/{lib/guards → guards}/can-deactivate/interfaces/can-deactivate-can-component-deactivate.interface.d.ts +1 -1
  154. package/{lib/guards → guards}/helpers/get-guard-with-dummy-url.d.ts +1 -1
  155. package/{lib/guards → guards}/helpers/handle-observable-result.d.ts +1 -1
  156. package/{lib/guards → guards}/helpers/run-has-flow-state-guard-with-context.d.ts +1 -1
  157. package/guards/index.d.ts +5 -0
  158. package/guards/public-api.d.ts +9 -0
  159. package/interceptors/index.d.ts +5 -0
  160. package/interceptors/public-api.d.ts +1 -0
  161. package/interfaces/index.d.ts +5 -0
  162. package/interfaces/public-api.d.ts +13 -0
  163. package/interfaces/src/parent-routing-paths.interface.d.ts +7 -0
  164. package/{lib/pages/routing/interfaces → interfaces/src}/routing-paths.interface.d.ts +1 -1
  165. package/mocks/index.d.ts +5 -0
  166. package/mocks/public-api.d.ts +8 -0
  167. package/mocks/src/route-permissions.mock.d.ts +3 -0
  168. package/mocks/src/session-token-expiry.mock.d.ts +2 -0
  169. package/mocks/src/session-user-state.mock.d.ts +2 -0
  170. package/mocks/src/transfer-state.mock.d.ts +2 -0
  171. package/package.json +106 -9
  172. package/pages/index.d.ts +5 -0
  173. package/{lib/pages → pages}/sign-in/sign-in.component.d.ts +10 -10
  174. package/pipes/date-format/date-format.pipe.d.ts +10 -0
  175. package/pipes/days-ago/days-ago.pipe.d.ts +7 -0
  176. package/pipes/index.d.ts +5 -0
  177. package/pipes/public-api.d.ts +2 -0
  178. package/public-api.d.ts +1 -10
  179. package/resolvers/index.d.ts +5 -0
  180. package/resolvers/public-api.d.ts +2 -0
  181. package/{lib/resolvers → resolvers}/user-state/user-state.resolver.d.ts +1 -1
  182. package/{lib/services → services}/date-service/date.service.d.ts +8 -0
  183. package/services/index.d.ts +5 -0
  184. package/{lib/services → services}/permissions-service/permissions.service.d.ts +1 -1
  185. package/services/public-api.d.ts +11 -0
  186. package/{lib/services → services}/session-service/session.service.d.ts +1 -1
  187. package/services/sort-service/interfaces/sort-service-values.interface.d.ts +7 -0
  188. package/{lib/services → services}/sort-service/sort-service.d.ts +1 -1
  189. package/{lib/services → services}/transfer-state-service/transfer-state.service.d.ts +1 -1
  190. package/{lib/services → services}/transformation-service/transformation.service.d.ts +1 -1
  191. package/{lib/stores → stores}/global/global.store.d.ts +1 -4
  192. package/stores/index.d.ts +5 -0
  193. package/stores/public-api.d.ts +1 -0
  194. package/types/index.d.ts +5 -0
  195. package/types/public-api.d.ts +4 -0
  196. package/types/src/abstract-sortable-table.type.d.ts +1 -0
  197. package/types/src/global-store.type.d.ts +2 -0
  198. package/types/src/sort-service.type.d.ts +1 -0
  199. package/validators/index.d.ts +5 -0
  200. package/{lib/validators → validators}/over-eighteen/over-eighteen.validator.d.ts +1 -1
  201. package/validators/public-api.d.ts +18 -0
  202. package/esm2022/hmcts-opal-frontend-common.mjs +0 -5
  203. package/esm2022/lib/components/govuk/govuk-button/govuk-button.component.mjs +0 -34
  204. package/esm2022/lib/components/govuk/govuk-text-input/govuk-text-input.component.mjs +0 -57
  205. package/esm2022/lib/components/govuk/index.mjs +0 -3
  206. package/esm2022/lib/guards/auth/auth.guard.mjs +0 -20
  207. package/esm2022/lib/guards/auth/index.mjs +0 -2
  208. package/esm2022/lib/guards/can-deactivate/can-deactivate.guard.mjs +0 -6
  209. package/esm2022/lib/guards/can-deactivate/index.mjs +0 -5
  210. package/esm2022/lib/guards/can-deactivate/interfaces/can-deactivate-can-component-deactivate.interface.mjs +0 -2
  211. package/esm2022/lib/guards/can-deactivate/interfaces/index.mjs +0 -2
  212. package/esm2022/lib/guards/has-flow-state/has-flow-state.guard.mjs +0 -16
  213. package/esm2022/lib/guards/has-flow-state/index.mjs +0 -2
  214. package/esm2022/lib/guards/helpers/get-guard-with-dummy-url.mjs +0 -19
  215. package/esm2022/lib/guards/helpers/handle-observable-result.mjs +0 -13
  216. package/esm2022/lib/guards/helpers/index.mjs +0 -5
  217. package/esm2022/lib/guards/helpers/run-auth-guard-with-context.mjs +0 -15
  218. package/esm2022/lib/guards/helpers/run-has-flow-state-guard-with-context.mjs +0 -9
  219. package/esm2022/lib/guards/index.mjs +0 -10
  220. package/esm2022/lib/guards/route-permissions/index.mjs +0 -2
  221. package/esm2022/lib/guards/route-permissions/route-permissions.guard.mjs +0 -25
  222. package/esm2022/lib/guards/signed-in/index.mjs +0 -3
  223. package/esm2022/lib/guards/signed-in/signed-in.guard.mjs +0 -20
  224. package/esm2022/lib/guards/types/can-deactivate.type.mjs +0 -2
  225. package/esm2022/lib/guards/types/guard-return.type.mjs +0 -2
  226. package/esm2022/lib/guards/types/index.mjs +0 -3
  227. package/esm2022/lib/interceptors/http-error/http-error.interceptor.mjs +0 -24
  228. package/esm2022/lib/interceptors/index.mjs +0 -3
  229. package/esm2022/lib/opal-frontend-common.module.mjs +0 -22
  230. package/esm2022/lib/pages/access-denied/access-denied.component.mjs +0 -18
  231. package/esm2022/lib/pages/index.mjs +0 -4
  232. package/esm2022/lib/pages/routing/constants/routing-paths.constant.mjs +0 -9
  233. package/esm2022/lib/pages/routing/constants/routing-titles.constant.mjs +0 -9
  234. package/esm2022/lib/pages/routing/interfaces/routing-paths.interface.mjs +0 -2
  235. package/esm2022/lib/pages/routing/pages.routes.mjs +0 -24
  236. package/esm2022/lib/pages/sign-in/interfaces/index.mjs +0 -2
  237. package/esm2022/lib/pages/sign-in/interfaces/sign-in-stub-form.interface.mjs +0 -2
  238. package/esm2022/lib/pages/sign-in/sign-in-sso/sign-in-sso.component.mjs +0 -23
  239. package/esm2022/lib/pages/sign-in/sign-in-stub/sign-in-stub.component.mjs +0 -39
  240. package/esm2022/lib/pages/sign-in/sign-in.component.mjs +0 -38
  241. package/esm2022/lib/resolvers/index.mjs +0 -3
  242. package/esm2022/lib/resolvers/title/index.mjs +0 -2
  243. package/esm2022/lib/resolvers/title/title.resolver.mjs +0 -22
  244. package/esm2022/lib/resolvers/user-state/index.mjs +0 -2
  245. package/esm2022/lib/resolvers/user-state/user-state.resolver.mjs +0 -12
  246. package/esm2022/lib/routing/constants/index.mjs +0 -2
  247. package/esm2022/lib/routing/constants/sso-endpoints.constant.mjs +0 -7
  248. package/esm2022/lib/routing/index.mjs +0 -3
  249. package/esm2022/lib/routing/interfaces/child-routing-paths.interface.mjs +0 -2
  250. package/esm2022/lib/routing/interfaces/index.mjs +0 -4
  251. package/esm2022/lib/routing/interfaces/nested-routes.interface.mjs +0 -2
  252. package/esm2022/lib/routing/interfaces/sso-endpoints.interface.mjs +0 -2
  253. package/esm2022/lib/services/app-initializer-service/app-initializer.service.mjs +0 -36
  254. package/esm2022/lib/services/app-initializer-service/index.mjs +0 -2
  255. package/esm2022/lib/services/app-insights/app-insights.service.mjs +0 -73
  256. package/esm2022/lib/services/app-insights/index.mjs +0 -4
  257. package/esm2022/lib/services/auth-service/auth.service.mjs +0 -36
  258. package/esm2022/lib/services/auth-service/index.mjs +0 -2
  259. package/esm2022/lib/services/date-service/date.service.mjs +0 -182
  260. package/esm2022/lib/services/date-service/index.mjs +0 -4
  261. package/esm2022/lib/services/index.mjs +0 -12
  262. package/esm2022/lib/services/launch-darkly/index.mjs +0 -5
  263. package/esm2022/lib/services/launch-darkly/launch-darkly.service.mjs +0 -94
  264. package/esm2022/lib/services/launch-darkly/mocks/index.mjs +0 -3
  265. package/esm2022/lib/services/launch-darkly/mocks/launch-darkly-change-flags.mock.mjs +0 -5
  266. package/esm2022/lib/services/launch-darkly/mocks/launch-darkly-flags.mock.mjs +0 -5
  267. package/esm2022/lib/services/permissions-service/index.mjs +0 -4
  268. package/esm2022/lib/services/permissions-service/permissions.service.mjs +0 -40
  269. package/esm2022/lib/services/session-service/constants/index.mjs +0 -2
  270. package/esm2022/lib/services/session-service/constants/session-endpoints.constant.mjs +0 -5
  271. package/esm2022/lib/services/session-service/index.mjs +0 -7
  272. package/esm2022/lib/services/session-service/interfaces/index.mjs +0 -4
  273. package/esm2022/lib/services/session-service/interfaces/session-endpoints.interface.mjs +0 -2
  274. package/esm2022/lib/services/session-service/interfaces/session-token-expiry.interface.mjs +0 -2
  275. package/esm2022/lib/services/session-service/interfaces/session-user-state.interface.mjs +0 -2
  276. package/esm2022/lib/services/session-service/mocks/index.mjs +0 -3
  277. package/esm2022/lib/services/session-service/mocks/session-token-expiry.mock.mjs +0 -5
  278. package/esm2022/lib/services/session-service/mocks/session-user-state.mock.mjs +0 -386
  279. package/esm2022/lib/services/session-service/session.service.mjs +0 -64
  280. package/esm2022/lib/services/sort-service/index.mjs +0 -6
  281. package/esm2022/lib/services/sort-service/interfaces/index.mjs +0 -3
  282. package/esm2022/lib/services/sort-service/interfaces/sort-service-values.interface.mjs +0 -2
  283. package/esm2022/lib/services/sort-service/interfaces/sort-service.interface.mjs +0 -2
  284. package/esm2022/lib/services/sort-service/sort-service.mjs +0 -90
  285. package/esm2022/lib/services/sort-service/types/index.mjs +0 -2
  286. package/esm2022/lib/services/sort-service/types/sort-service.type.mjs +0 -2
  287. package/esm2022/lib/services/transfer-state-service/index.mjs +0 -6
  288. package/esm2022/lib/services/transfer-state-service/interfaces/index.mjs +0 -4
  289. package/esm2022/lib/services/transfer-state-service/interfaces/transfer-state-app-insights-config.interface.mjs +0 -2
  290. package/esm2022/lib/services/transfer-state-service/interfaces/transfer-state-launch-darkly-config.interface.mjs +0 -2
  291. package/esm2022/lib/services/transfer-state-service/interfaces/transfer-state-server-state.interface.mjs +0 -2
  292. package/esm2022/lib/services/transfer-state-service/mocks/index.mjs +0 -4
  293. package/esm2022/lib/services/transfer-state-service/mocks/transfer-state-app-insights-config.mock.mjs +0 -6
  294. package/esm2022/lib/services/transfer-state-service/mocks/transfer-state-launch-darkly-config.mock.mjs +0 -6
  295. package/esm2022/lib/services/transfer-state-service/mocks/transfer-state.mock.mjs +0 -8
  296. package/esm2022/lib/services/transfer-state-service/transfer-state.service.mjs +0 -59
  297. package/esm2022/lib/services/transformation-service/index.mjs +0 -5
  298. package/esm2022/lib/services/transformation-service/interfaces/index.mjs +0 -2
  299. package/esm2022/lib/services/transformation-service/interfaces/transform-item.interface.mjs +0 -2
  300. package/esm2022/lib/services/transformation-service/transformation.service.mjs +0 -69
  301. package/esm2022/lib/services/utils/index.mjs +0 -4
  302. package/esm2022/lib/services/utils/utils.service.mjs +0 -86
  303. package/esm2022/lib/stores/global/global.store.mjs +0 -33
  304. package/esm2022/lib/stores/global/index.mjs +0 -6
  305. package/esm2022/lib/stores/global/interfaces/error-state.interface.mjs +0 -2
  306. package/esm2022/lib/stores/global/interfaces/index.mjs +0 -2
  307. package/esm2022/lib/stores/global/types/global-store.type.mjs +0 -2
  308. package/esm2022/lib/stores/global/types/index.mjs +0 -2
  309. package/esm2022/lib/stores/index.mjs +0 -2
  310. package/esm2022/lib/validators/alphabetical-text/alphabetical-text.validator.mjs +0 -10
  311. package/esm2022/lib/validators/amount/amount.validator.mjs +0 -15
  312. package/esm2022/lib/validators/date-after-year/date-after-year.validator.mjs +0 -12
  313. package/esm2022/lib/validators/date-before/date-before.validator.mjs +0 -15
  314. package/esm2022/lib/validators/date-of-birth/date-of-birth.validator.mjs +0 -18
  315. package/esm2022/lib/validators/future-date/future-date.validator.mjs +0 -15
  316. package/esm2022/lib/validators/index.mjs +0 -20
  317. package/esm2022/lib/validators/invalid-value/invalid-value.validator.mjs +0 -9
  318. package/esm2022/lib/validators/national-insurance-number/national-insurance-number.validator.mjs +0 -16
  319. package/esm2022/lib/validators/numerical-only/numerical-only.validator.mjs +0 -10
  320. package/esm2022/lib/validators/optional-max-length/optional-max-length.validator.mjs +0 -10
  321. package/esm2022/lib/validators/optional-valid-date/optional-valid-date.validator.mjs +0 -23
  322. package/esm2022/lib/validators/optional-valid-email-address/optional-valid-email-address.validator.mjs +0 -11
  323. package/esm2022/lib/validators/optional-valid-telephone/optional-valid-telephone.validator.mjs +0 -14
  324. package/esm2022/lib/validators/over-eighteen/over-eighteen.validator.mjs +0 -45
  325. package/esm2022/lib/validators/past-date/past-date.validator.mjs +0 -16
  326. package/esm2022/lib/validators/special-characters/special-characters.validator.mjs +0 -11
  327. package/esm2022/lib/validators/two-decimal-places/two-decimal-places.validator.mjs +0 -12
  328. package/esm2022/lib/validators/valid-value/valid-value.validator.mjs +0 -9
  329. package/esm2022/public-api.mjs +0 -11
  330. package/fesm2022/hmcts-opal-frontend-common-sign-in-stub.component-CysPzJGJ.mjs +0 -41
  331. package/fesm2022/hmcts-opal-frontend-common-sign-in-stub.component-CysPzJGJ.mjs.map +0 -1
  332. package/lib/components/govuk/index.d.ts +0 -2
  333. package/lib/guards/auth/index.d.ts +0 -1
  334. package/lib/guards/can-deactivate/index.d.ts +0 -2
  335. package/lib/guards/can-deactivate/interfaces/index.d.ts +0 -2
  336. package/lib/guards/has-flow-state/index.d.ts +0 -1
  337. package/lib/guards/helpers/index.d.ts +0 -4
  338. package/lib/guards/index.d.ts +0 -7
  339. package/lib/guards/route-permissions/index.d.ts +0 -1
  340. package/lib/guards/signed-in/index.d.ts +0 -1
  341. package/lib/guards/types/index.d.ts +0 -2
  342. package/lib/interceptors/index.d.ts +0 -2
  343. package/lib/opal-frontend-common.module.d.ts +0 -14
  344. package/lib/pages/routing/constants/routing-paths.constant.d.ts +0 -2
  345. package/lib/pages/routing/constants/routing-titles.constant.d.ts +0 -2
  346. package/lib/resolvers/index.d.ts +0 -2
  347. package/lib/resolvers/title/index.d.ts +0 -1
  348. package/lib/resolvers/user-state/index.d.ts +0 -1
  349. package/lib/routing/constants/index.d.ts +0 -1
  350. package/lib/routing/constants/sso-endpoints.constant.d.ts +0 -2
  351. package/lib/routing/index.d.ts +0 -2
  352. package/lib/routing/interfaces/index.d.ts +0 -3
  353. package/lib/services/app-initializer-service/index.d.ts +0 -1
  354. package/lib/services/app-insights/index.d.ts +0 -1
  355. package/lib/services/auth-service/index.d.ts +0 -1
  356. package/lib/services/date-service/index.d.ts +0 -1
  357. package/lib/services/index.d.ts +0 -11
  358. package/lib/services/launch-darkly/index.d.ts +0 -2
  359. package/lib/services/launch-darkly/mocks/index.d.ts +0 -2
  360. package/lib/services/permissions-service/index.d.ts +0 -1
  361. package/lib/services/session-service/constants/index.d.ts +0 -1
  362. package/lib/services/session-service/constants/session-endpoints.constant.d.ts +0 -2
  363. package/lib/services/session-service/index.d.ts +0 -4
  364. package/lib/services/session-service/interfaces/index.d.ts +0 -3
  365. package/lib/services/session-service/mocks/index.d.ts +0 -2
  366. package/lib/services/session-service/mocks/session-token-expiry.mock.d.ts +0 -2
  367. package/lib/services/session-service/mocks/session-user-state.mock.d.ts +0 -2
  368. package/lib/services/sort-service/index.d.ts +0 -3
  369. package/lib/services/sort-service/interfaces/index.d.ts +0 -2
  370. package/lib/services/sort-service/interfaces/sort-service-values.interface.d.ts +0 -6
  371. package/lib/services/sort-service/types/index.d.ts +0 -1
  372. package/lib/services/sort-service/types/sort-service.type.d.ts +0 -1
  373. package/lib/services/transfer-state-service/index.d.ts +0 -3
  374. package/lib/services/transfer-state-service/interfaces/index.d.ts +0 -3
  375. package/lib/services/transfer-state-service/mocks/index.d.ts +0 -3
  376. package/lib/services/transfer-state-service/mocks/transfer-state.mock.d.ts +0 -2
  377. package/lib/services/transformation-service/index.d.ts +0 -2
  378. package/lib/services/transformation-service/interfaces/index.d.ts +0 -1
  379. package/lib/services/utils/index.d.ts +0 -1
  380. package/lib/stores/global/index.d.ts +0 -3
  381. package/lib/stores/global/interfaces/index.d.ts +0 -1
  382. package/lib/stores/global/types/global-store.type.d.ts +0 -2
  383. package/lib/stores/global/types/index.d.ts +0 -1
  384. package/lib/stores/index.d.ts +0 -1
  385. package/lib/validators/index.d.ts +0 -19
  386. /package/{lib/components → components}/govuk/govuk-button/govuk-button.component.d.ts +0 -0
  387. /package/{lib/components → components}/govuk/govuk-text-input/govuk-text-input.component.d.ts +0 -0
  388. /package/{lib/guards → guards}/auth/auth.guard.d.ts +0 -0
  389. /package/{lib/guards → guards}/has-flow-state/has-flow-state.guard.d.ts +0 -0
  390. /package/{lib/guards → guards}/helpers/run-auth-guard-with-context.d.ts +0 -0
  391. /package/{lib/guards → guards}/route-permissions/route-permissions.guard.d.ts +0 -0
  392. /package/{lib/guards → guards}/signed-in/signed-in.guard.d.ts +0 -0
  393. /package/{lib/guards → guards}/types/guard-return.type.d.ts +0 -0
  394. /package/{lib/interceptors → interceptors}/http-error/http-error.interceptor.d.ts +0 -0
  395. /package/{lib/routing/interfaces → interfaces/src}/child-routing-paths.interface.d.ts +0 -0
  396. /package/{lib/stores/global/interfaces → interfaces/src}/error-state.interface.d.ts +0 -0
  397. /package/{lib/routing/interfaces → interfaces/src}/nested-routes.interface.d.ts +0 -0
  398. /package/{lib/services/session-service/interfaces → interfaces/src}/session-endpoints.interface.d.ts +0 -0
  399. /package/{lib/services/session-service/interfaces → interfaces/src}/session-token-expiry.interface.d.ts +0 -0
  400. /package/{lib/services/session-service/interfaces → interfaces/src}/session-user-state.interface.d.ts +0 -0
  401. /package/{lib/routing/interfaces → interfaces/src}/sso-endpoints.interface.d.ts +0 -0
  402. /package/{lib/services/transfer-state-service/interfaces → interfaces/src}/transfer-state-app-insights-config.interface.d.ts +0 -0
  403. /package/{lib/services/transfer-state-service/interfaces → interfaces/src}/transfer-state-launch-darkly-config.interface.d.ts +0 -0
  404. /package/{lib/services/transfer-state-service/interfaces → interfaces/src}/transfer-state-server-state.interface.d.ts +0 -0
  405. /package/{lib/services/transformation-service/interfaces → interfaces/src}/transform-item.interface.d.ts +0 -0
  406. /package/{lib/services/launch-darkly/mocks → mocks/src}/launch-darkly-change-flags.mock.d.ts +0 -0
  407. /package/{lib/services/launch-darkly/mocks → mocks/src}/launch-darkly-flags.mock.d.ts +0 -0
  408. /package/{lib/services/transfer-state-service/mocks → mocks/src}/transfer-state-app-insights-config.mock.d.ts +0 -0
  409. /package/{lib/services/transfer-state-service/mocks → mocks/src}/transfer-state-launch-darkly-config.mock.d.ts +0 -0
  410. /package/{lib/pages → pages}/access-denied/access-denied.component.d.ts +0 -0
  411. /package/{lib/pages/index.d.ts → pages/public-api.d.ts} +0 -0
  412. /package/{lib/pages → pages}/routing/pages.routes.d.ts +0 -0
  413. /package/{lib/pages → pages}/sign-in/interfaces/index.d.ts +0 -0
  414. /package/{lib/pages → pages}/sign-in/interfaces/sign-in-stub-form.interface.d.ts +0 -0
  415. /package/{lib/pages → pages}/sign-in/sign-in-sso/sign-in-sso.component.d.ts +0 -0
  416. /package/{lib/pages → pages}/sign-in/sign-in-stub/sign-in-stub.component.d.ts +0 -0
  417. /package/{lib/resolvers → resolvers}/title/title.resolver.d.ts +0 -0
  418. /package/{lib/services → services}/app-initializer-service/app-initializer.service.d.ts +0 -0
  419. /package/{lib/services → services}/app-insights/app-insights.service.d.ts +0 -0
  420. /package/{lib/services → services}/auth-service/auth.service.d.ts +0 -0
  421. /package/{lib/services → services}/launch-darkly/launch-darkly.service.d.ts +0 -0
  422. /package/{lib/services → services}/sort-service/interfaces/sort-service.interface.d.ts +0 -0
  423. /package/{lib/services → services}/utils/utils.service.d.ts +0 -0
  424. /package/{lib/guards/types → types/src}/can-deactivate.type.d.ts +0 -0
  425. /package/{lib/validators → validators}/alphabetical-text/alphabetical-text.validator.d.ts +0 -0
  426. /package/{lib/validators → validators}/amount/amount.validator.d.ts +0 -0
  427. /package/{lib/validators → validators}/date-after-year/date-after-year.validator.d.ts +0 -0
  428. /package/{lib/validators → validators}/date-before/date-before.validator.d.ts +0 -0
  429. /package/{lib/validators → validators}/date-of-birth/date-of-birth.validator.d.ts +0 -0
  430. /package/{lib/validators → validators}/future-date/future-date.validator.d.ts +0 -0
  431. /package/{lib/validators → validators}/invalid-value/invalid-value.validator.d.ts +0 -0
  432. /package/{lib/validators → validators}/national-insurance-number/national-insurance-number.validator.d.ts +0 -0
  433. /package/{lib/validators → validators}/numerical-only/numerical-only.validator.d.ts +0 -0
  434. /package/{lib/validators → validators}/optional-max-length/optional-max-length.validator.d.ts +0 -0
  435. /package/{lib/validators → validators}/optional-valid-date/optional-valid-date.validator.d.ts +0 -0
  436. /package/{lib/validators → validators}/optional-valid-email-address/optional-valid-email-address.validator.d.ts +0 -0
  437. /package/{lib/validators → validators}/optional-valid-telephone/optional-valid-telephone.validator.d.ts +0 -0
  438. /package/{lib/validators → validators}/past-date/past-date.validator.d.ts +0 -0
  439. /package/{lib/validators → validators}/special-characters/special-characters.validator.d.ts +0 -0
  440. /package/{lib/validators → validators}/two-decimal-places/two-decimal-places.validator.d.ts +0 -0
  441. /package/{lib/validators → validators}/valid-value/valid-value.validator.d.ts +0 -0
@@ -0,0 +1,1288 @@
1
+ import * as i0 from '@angular/core';
2
+ import { EventEmitter, inject, ChangeDetectorRef, Output, Component, signal, computed } from '@angular/core';
3
+ import { FormGroup, FormArray, FormControl } from '@angular/forms';
4
+ import { Router, ActivatedRoute } from '@angular/router';
5
+ import { Subject, takeUntil } from 'rxjs';
6
+ import { UtilsService, SortService } from '@hmcts/opal-frontend-common/services';
7
+
8
+ class AbstractFormBaseComponent {
9
+ unsavedChanges = new EventEmitter();
10
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
11
+ formSubmit = new EventEmitter();
12
+ changeDetectorRef = inject(ChangeDetectorRef);
13
+ router = inject(Router);
14
+ activatedRoute = inject(ActivatedRoute);
15
+ utilsService = inject(UtilsService);
16
+ form;
17
+ formControlErrorMessages;
18
+ formErrorSummaryMessage;
19
+ fieldErrors;
20
+ formSubmitted = false;
21
+ ngUnsubscribe = new Subject();
22
+ formErrors;
23
+ constructor() { }
24
+ /**
25
+ * Scrolls to the label of the component and focuses on the field id
26
+ *
27
+ * @param fieldId - Field id of the component
28
+ */
29
+ scroll(fieldId) {
30
+ let labelTarget;
31
+ let fieldElement;
32
+ const autocompleteLabel = document.querySelector(`label[for=${fieldId}-autocomplete]`);
33
+ const regularLabel = document.querySelector(`label[for=${fieldId}]`);
34
+ const fieldsetLegend = document.querySelector(`#${fieldId} .govuk-fieldset__legend`);
35
+ if (autocompleteLabel) {
36
+ labelTarget = autocompleteLabel;
37
+ fieldElement = document.getElementById(`${fieldId}-autocomplete`);
38
+ }
39
+ else {
40
+ labelTarget = regularLabel || fieldsetLegend;
41
+ fieldElement = document.getElementById(fieldId);
42
+ }
43
+ if (fieldElement) {
44
+ if (labelTarget) {
45
+ labelTarget.scrollIntoView({ behavior: 'smooth' });
46
+ }
47
+ fieldElement.focus();
48
+ }
49
+ }
50
+ /**
51
+ * Returns the highest priority form error from the given error keys and field errors.
52
+ * @param errorKeys - An array of error keys.
53
+ * @param fieldErrors - An object containing field errors.
54
+ * @returns The highest priority form error or null if no errors are found.
55
+ */
56
+ getHighestPriorityError(errorKeys = [], fieldErrors = {}) {
57
+ if (errorKeys.length && Object.keys(fieldErrors).length) {
58
+ const errors = errorKeys.map((errorType) => {
59
+ return {
60
+ ...fieldErrors[errorType],
61
+ type: errorType,
62
+ };
63
+ });
64
+ const sortedErrors = [...errors].sort((a, b) => a.priority - b.priority);
65
+ return sortedErrors[0];
66
+ }
67
+ return null;
68
+ }
69
+ /**
70
+ * Retrieves the details of the highest priority form error for a given control path.
71
+ * @param controlPath - The path to the control in the form.
72
+ * @returns The details of the highest priority form error, or null if there are no errors.
73
+ */
74
+ getFieldErrorDetails(controlPath) {
75
+ // Get the control
76
+ const control = this.form.get(controlPath);
77
+ // If we have errors
78
+ const controlErrors = control?.errors;
79
+ if (controlErrors) {
80
+ /// Get all the error keys
81
+ const controlKey = controlPath[controlPath.length - 1];
82
+ const errorKeys = Object.keys(controlErrors) || [];
83
+ const fieldErrors = this.fieldErrors[controlKey] || {};
84
+ if (errorKeys.length && Object.keys(fieldErrors).length) {
85
+ return this.getHighestPriorityError(errorKeys, fieldErrors);
86
+ }
87
+ }
88
+ return null;
89
+ }
90
+ /**
91
+ * Retrieves all form errors from the provided form and its nested form groups.
92
+ *
93
+ * @param form - The form group to retrieve errors from.
94
+ * @param controlPath - An optional array representing the path to the current control within the form group.
95
+ * @returns An array of form errors, each containing the field ID, error message, priority, and type.
96
+ */
97
+ getFormErrors(form, controlPath = []) {
98
+ // recursively get all errors from all controls in the form including nested form group controls
99
+ const formControls = form.controls;
100
+ const errorSummary = Object.keys(formControls)
101
+ .filter((controlName) => formControls[controlName].invalid)
102
+ .map((controlName) => {
103
+ const control = formControls[controlName];
104
+ if (control instanceof FormGroup) {
105
+ return this.getFormErrors(control, [...controlPath, controlName]);
106
+ }
107
+ if (control instanceof FormArray) {
108
+ return control.controls
109
+ .map((controlItem, index) => {
110
+ // We only support FormGroups in FormArrays
111
+ if (controlItem instanceof FormGroup) {
112
+ return this.getFormErrors(controlItem, [...controlPath, controlName, index]);
113
+ }
114
+ return [];
115
+ })
116
+ .flat();
117
+ }
118
+ const getFieldErrorDetails = this.getFieldErrorDetails([...controlPath, controlName]);
119
+ // Return the error summary entry
120
+ // If we don't have the error details, return a null message
121
+ return {
122
+ fieldId: controlName,
123
+ message: getFieldErrorDetails?.message ?? null,
124
+ priority: getFieldErrorDetails?.priority ?? 999999999,
125
+ type: getFieldErrorDetails?.type ?? null,
126
+ };
127
+ })
128
+ .flat();
129
+ // Remove any null errors
130
+ return errorSummary.filter((item) => item?.message !== null);
131
+ }
132
+ /**
133
+ * Sets the error messages for the form controls and error summary based on the provided form errors.
134
+ * @param formErrors - An array of form errors containing field IDs and error messages.
135
+ */
136
+ setErrorMessages(formErrors) {
137
+ // Reset the form error messages
138
+ this.formControlErrorMessages = {};
139
+ this.formErrorSummaryMessage = [];
140
+ // Set the form error messages based on the error summary entries
141
+ formErrors.forEach((entry) => {
142
+ this.formControlErrorMessages[entry.fieldId] = entry.message;
143
+ this.formErrorSummaryMessage.push({ fieldId: entry.fieldId, message: entry.message });
144
+ });
145
+ }
146
+ /**
147
+ * Gets the indexes of the date fields to remove based on the form error summary message.
148
+ * @returns An array of indexes representing the date fields to remove.
149
+ */
150
+ getDateFieldsToRemoveIndexes() {
151
+ const indexesToRemove = [];
152
+ // The order of the field ids is important
153
+ // this is the order in which we want to remove them
154
+ const foundIndexes = this.getFormErrorSummaryIndex(['dayOfMonth', 'monthOfYear', 'year'], this.formErrorSummaryMessage);
155
+ // Determine which indexes to remove based on the found fields
156
+ switch (foundIndexes.length) {
157
+ case 3:
158
+ // All three date fields are present
159
+ indexesToRemove.push(foundIndexes[1], foundIndexes[2]);
160
+ break;
161
+ case 2:
162
+ // Two date fields are present
163
+ indexesToRemove.push(foundIndexes[1]);
164
+ break;
165
+ }
166
+ return indexesToRemove;
167
+ }
168
+ /**
169
+ * Returns an array of indices corresponding to the positions of the given field IDs in the form error summary message array.
170
+ *
171
+ * @param fieldIds - An array of field IDs to search for in the form error summary message array.
172
+ * @param formErrorSummaryMessage - An array of form error summary messages.
173
+ * @returns An array of indices corresponding to the positions of the field IDs in the form error summary message array.
174
+ */
175
+ getFormErrorSummaryIndex(fieldIds, formErrorSummaryMessage) {
176
+ return fieldIds.reduce((acc, field) => {
177
+ const index = formErrorSummaryMessage.findIndex((error) => error.fieldId === field);
178
+ return index !== -1 ? [...acc, index] : acc;
179
+ }, []);
180
+ }
181
+ /**
182
+ * Removes error summary messages from the given array based on the specified indexes.
183
+ *
184
+ * @param formErrorSummaryMessage - The array of error summary messages.
185
+ * @param indexes - The indexes of the error summary messages to be removed.
186
+ * @returns The updated array of error summary messages.
187
+ */
188
+ removeErrorSummaryMessages(formErrorSummaryMessage, indexes) {
189
+ return formErrorSummaryMessage.filter((_, index) => !indexes.includes(index));
190
+ }
191
+ /**
192
+ * Splits the form errors into two arrays based on the provided field IDs.
193
+ * Errors with field IDs included in the fieldIds array will be moved to the removedFormErrors array,
194
+ * while the remaining errors will be moved to the cleanFormErrors array.
195
+ *
196
+ * @param fieldIds - An array of field IDs to filter the form errors.
197
+ * @param formErrors - An array of form errors to be split.
198
+ * @returns An array containing two arrays: cleanFormErrors and removedFormErrors.
199
+ */
200
+ splitFormErrors(fieldIds, formErrors) {
201
+ const cleanFormErrors = [];
202
+ const removedFormErrors = [];
203
+ formErrors.forEach((error) => {
204
+ if (fieldIds.includes(error.fieldId)) {
205
+ removedFormErrors.push(error);
206
+ }
207
+ else {
208
+ cleanFormErrors.push(error);
209
+ }
210
+ });
211
+ return [cleanFormErrors, removedFormErrors];
212
+ }
213
+ /**
214
+ * Manipulates the error message for specific fields in the formErrors array.
215
+ * @param fields - An array of field IDs to target for error message manipulation.
216
+ * @param messageOverride - The new error message to be used for the targeted fields.
217
+ * @param errorType - The type of error to match for the targeted fields.
218
+ * @param formErrors - An array of IFormError objects representing the form errors.
219
+ * @returns An array of IFormError objects with the manipulated error messages.
220
+ */
221
+ manipulateFormErrorMessage(fields, messageOverride, errorType, formErrors) {
222
+ const manipulatedFields = [];
223
+ formErrors.forEach((field) => {
224
+ if (fields.includes(field.fieldId)) {
225
+ if (field.type === errorType) {
226
+ manipulatedFields.push({ ...field, message: messageOverride });
227
+ }
228
+ else {
229
+ manipulatedFields.push(field);
230
+ }
231
+ }
232
+ else {
233
+ manipulatedFields.push(field);
234
+ }
235
+ });
236
+ return manipulatedFields;
237
+ }
238
+ /**
239
+ * Retrieves the form errors with the highest priority.
240
+ *
241
+ * @param formErrors - An array of form errors.
242
+ * @returns An array of form errors with the highest priority.
243
+ */
244
+ getHighPriorityFormErrors(formErrors) {
245
+ // Get the lowest priority (1 is the highest priority, 3 is the lowest priority)
246
+ const lowestPriority = Math.min(...formErrors.map((item) => item.priority));
247
+ return formErrors.filter((item) => item.priority === lowestPriority);
248
+ }
249
+ /**
250
+ * Focuses on the error summary element and scrolls to the top of the page.
251
+ *
252
+ * This method first triggers change detection to ensure the view is up-to-date.
253
+ * It then selects the error summary element with the class 'govuk-error-summary'.
254
+ * If the error summary element is found, it sets focus on it without scrolling the page.
255
+ * Finally, it calls a utility service to scroll to the top of the page.
256
+ *
257
+ * @private
258
+ */
259
+ focusAndScrollToErrorSummary() {
260
+ this.changeDetectorRef.detectChanges();
261
+ const errorSummary = document.querySelector('.govuk-error-summary');
262
+ if (errorSummary) {
263
+ errorSummary.focus({ preventScroll: true });
264
+ this.utilsService.scrollToTop();
265
+ }
266
+ }
267
+ /**
268
+ * Setup listener for the form value changes and to emit hasUnsavedChanges
269
+ */
270
+ setupListener() {
271
+ this.form.valueChanges.pipe(takeUntil(this.ngUnsubscribe)).subscribe(() => {
272
+ this.unsavedChanges.emit(this.hasUnsavedChanges());
273
+ });
274
+ }
275
+ /**
276
+ * Adds controls to a form group.
277
+ *
278
+ * @param formGroup - The form group to add controls to.
279
+ * @param controls - An array of form array control validations.
280
+ * @param index - The index of the form array control.
281
+ */
282
+ addControlsToFormGroup(formGroup, controls, index) {
283
+ controls.forEach(({ controlName, validators }) => {
284
+ formGroup.addControl(`${controlName}_${index}`, new FormControl(null, validators));
285
+ });
286
+ }
287
+ /**
288
+ * Creates a form control with the specified validators and initial value.
289
+ *
290
+ * @param validators - An array of validator functions.
291
+ * @param initialValue - The initial value for the form control. Defaults to null.
292
+ * @returns The created form control.
293
+ */
294
+ createFormControl(validators, initialValue = null) {
295
+ return new FormControl(initialValue, { validators: [...validators] });
296
+ }
297
+ /**
298
+ * Handles the error messages and populates the relevant variables
299
+ */
300
+ handleErrorMessages() {
301
+ this.formErrors = this.getFormErrors(this.form);
302
+ this.setErrorMessages(this.formErrors);
303
+ this.formErrorSummaryMessage = this.removeErrorSummaryMessages(this.formErrorSummaryMessage, this.getDateFieldsToRemoveIndexes());
304
+ }
305
+ /**
306
+ * Checks whether the form has been touched and submitted
307
+ *
308
+ * @returns boolean
309
+ */
310
+ hasUnsavedChanges() {
311
+ return this.form.dirty && !this.formSubmitted;
312
+ }
313
+ /**
314
+ * Sets the value of a specified form control and marks it as touched.
315
+ *
316
+ * @param {string} value - The value to set for the form control.
317
+ * @param {string} control - The name of the form control to update.
318
+ */
319
+ setInputValue(value, control) {
320
+ this.form.controls[control].patchValue(value);
321
+ this.form.controls[control].markAsTouched();
322
+ }
323
+ /**
324
+ * Handles the form errors for the date input fields.
325
+ * @param formErrors - An array of form errors.
326
+ * @returns An array of form errors with the manipulated error messages.
327
+ */
328
+ handleDateInputFormErrors() {
329
+ const dateInputFields = ['dayOfMonth', 'monthOfYear', 'year'];
330
+ const splitFormErrors = this.splitFormErrors(dateInputFields, this.formErrors);
331
+ const highPriorityDateControlErrors = this.getHighPriorityFormErrors(splitFormErrors[1]);
332
+ let manipulatedFormErrors = highPriorityDateControlErrors;
333
+ // If we have more than one error then we want to manipulate the error message
334
+ if (highPriorityDateControlErrors.length > 1) {
335
+ manipulatedFormErrors = this.manipulateFormErrorMessage(dateInputFields, 'Please enter a DOB', 'required', manipulatedFormErrors);
336
+ }
337
+ return [...splitFormErrors[0], ...manipulatedFormErrors];
338
+ }
339
+ /**
340
+ * Sets the initial error messages for the form controls.
341
+ *
342
+ * @param form - The FormGroup instance.
343
+ */
344
+ setInitialErrorMessages() {
345
+ const formControls = this.form.controls;
346
+ const initialFormControlErrorMessages = {};
347
+ Object.keys(formControls).forEach((controlName) => {
348
+ initialFormControlErrorMessages[controlName] = null;
349
+ });
350
+ this.formControlErrorMessages = initialFormControlErrorMessages;
351
+ this.formErrorSummaryMessage = [];
352
+ }
353
+ /**
354
+ * Repopulates the search form with the data from the account enquiry search.
355
+ * @param state - The state object containing the search form data.
356
+ */
357
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
358
+ rePopulateForm(state) {
359
+ this.form.patchValue(state);
360
+ }
361
+ /**
362
+ * Adds a new form control to the form group.
363
+ *
364
+ * @param controlName - The name of the control to add.
365
+ * @param validators - An array of validators to apply to the control.
366
+ */
367
+ createControl(controlName, validators) {
368
+ this.form.addControl(controlName, new FormControl(null, validators));
369
+ }
370
+ /**
371
+ * Updates the validators of an existing form control.
372
+ *
373
+ * @param controlName - The name of the control to update.
374
+ * @param validators - An array of validators to apply to the control.
375
+ */
376
+ updateControl(controlName, validators) {
377
+ const control = this.form.get(controlName);
378
+ if (control) {
379
+ control.setValidators(validators);
380
+ control.updateValueAndValidity();
381
+ }
382
+ else {
383
+ this.createControl(controlName, validators);
384
+ }
385
+ }
386
+ /**
387
+ * Removes a control from the form.
388
+ *
389
+ * @param controlName - The name of the control to remove.
390
+ */
391
+ removeControl(controlName) {
392
+ if (this.formControlErrorMessages[controlName]) {
393
+ this.removeControlErrors(controlName);
394
+ }
395
+ this.form.removeControl(controlName);
396
+ }
397
+ /**
398
+ * Removes the error message associated with the specified control name from the formControlErrorMessages object.
399
+ *
400
+ * @param controlName - The name of the control for which to remove the error message.
401
+ */
402
+ removeControlErrors(controlName) {
403
+ delete this.formControlErrorMessages[controlName];
404
+ }
405
+ /**
406
+ * Clears the search form.
407
+ */
408
+ handleClearForm() {
409
+ this.form.reset();
410
+ }
411
+ /**
412
+ * Handles the scroll of the component error from the summary
413
+ *
414
+ * @param fieldId - Field id of the component
415
+ */
416
+ scrollTo(fieldId) {
417
+ this['scroll'](fieldId);
418
+ }
419
+ /**
420
+ * Handles route with the supplied route
421
+ *
422
+ * @param route string of route
423
+ * @param nonRelative boolean indicating if route is relative to the parent
424
+ */
425
+ handleRoute(route, nonRelative = false, event) {
426
+ if (event) {
427
+ event.preventDefault();
428
+ }
429
+ this.unsavedChanges.emit(this.hasUnsavedChanges());
430
+ if (nonRelative) {
431
+ this.router.navigate([route]);
432
+ }
433
+ else {
434
+ this.router.navigate([route], { relativeTo: this.activatedRoute.parent });
435
+ }
436
+ }
437
+ /**
438
+ * Handles the form submission event.
439
+ *
440
+ * @param event - The form submission event.
441
+ * @returns void
442
+ */
443
+ handleFormSubmit(event) {
444
+ this.handleErrorMessages();
445
+ if (this.form.valid) {
446
+ this.formSubmitted = true;
447
+ const nestedFlow = event.submitter ? event.submitter.className.includes('nested-flow') : false;
448
+ this.unsavedChanges.emit(this.hasUnsavedChanges());
449
+ this.formSubmit.emit({ formData: this.form.value, nestedFlow: nestedFlow });
450
+ }
451
+ else {
452
+ this.focusAndScrollToErrorSummary();
453
+ }
454
+ }
455
+ /**
456
+ * Handles the input event to convert all letters in the input value to uppercase.
457
+ * This method is triggered by an input event and modifies the input value directly.
458
+ *
459
+ * @param event - The input event triggered by the user.
460
+ */
461
+ handleUppercaseInputMask(event) {
462
+ const input = event.target;
463
+ input.value = this.utilsService.upperCaseAllLetters(input.value);
464
+ }
465
+ ngOnInit() {
466
+ if (this.form) {
467
+ this.setupListener();
468
+ }
469
+ }
470
+ ngOnDestroy() {
471
+ this.ngUnsubscribe.next();
472
+ this.ngUnsubscribe.complete();
473
+ }
474
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AbstractFormBaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
475
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: AbstractFormBaseComponent, isStandalone: true, selector: "ng-component", outputs: { unsavedChanges: "unsavedChanges", formSubmit: "formSubmit" }, ngImport: i0, template: '', isInline: true });
476
+ }
477
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AbstractFormBaseComponent, decorators: [{
478
+ type: Component,
479
+ args: [{
480
+ template: '',
481
+ }]
482
+ }], ctorParameters: () => [], propDecorators: { unsavedChanges: [{
483
+ type: Output
484
+ }], formSubmit: [{
485
+ type: Output
486
+ }] } });
487
+
488
+ class AbstractFormAliasBaseComponent extends AbstractFormBaseComponent {
489
+ aliasControls = [];
490
+ aliasControlsValidation = [];
491
+ aliasFields = [];
492
+ /**
493
+ * Builds an array of form controls for the given form array.
494
+ *
495
+ * @param formControlCount - An array of numbers representing the number of form controls to create.
496
+ * @param formArrayName - The name of the form array.
497
+ * @param fieldNames - An array of field names.
498
+ * @param controlValidation - An array of control validation objects.
499
+ * @returns An array of form controls for the given form array.
500
+ */
501
+ buildFormAliasControls(formControlCount, formArrayName, fieldNames, controlValidation) {
502
+ // Directly map each index to a control
503
+ return formControlCount.map((_element, index) => this.addAliasControls(index, formArrayName, fieldNames, controlValidation));
504
+ }
505
+ /**
506
+ * Adds alias controls to the form array.
507
+ *
508
+ * @param index - The index of the form array.
509
+ * @param formArrayName - The name of the form array.
510
+ * @param fieldNames - The names of the fields for the alias controls.
511
+ * @param controlValidation - The validation rules for the alias controls.
512
+ * @returns An object containing the form controls.
513
+ */
514
+ addAliasControls(index, formArrayName, fieldNames, controlValidation) {
515
+ const formAliases = this.form.get(formArrayName);
516
+ const formAliasesFormGroup = new FormGroup({});
517
+ // Create the form controls...
518
+ const controls = this.createAliasControls(fieldNames, index);
519
+ // Add the controls to the form group...
520
+ this.addControlsToFormGroup(formAliasesFormGroup, controlValidation, index);
521
+ // Add the form group to the form array...
522
+ formAliases.push(formAliasesFormGroup);
523
+ // Return the form controls...
524
+ return controls;
525
+ }
526
+ /**
527
+ * Removes all form alias controls from a FormArray and clears any associated error messages.
528
+ *
529
+ * @param formArrayControls - An array of form array controls.
530
+ * @param formArrayName - The name of the FormArray.
531
+ * @param fieldNames - An array of field names associated with the form array controls.
532
+ * @returns An empty array of form array controls.
533
+ */
534
+ removeAllFormAliasControls(formArrayControls, formArrayName, fieldNames) {
535
+ const control = this.form.get(formArrayName);
536
+ // Clear the error messages...
537
+ [...formArrayControls].forEach((_element, index) => {
538
+ this.removeFormAliasControlsErrors(index, formArrayControls, fieldNames);
539
+ });
540
+ // Reset the form array controls...
541
+ control.clear();
542
+ // Return en empty array of form array controls...
543
+ return [];
544
+ }
545
+ /**
546
+ * Creates a FormArray with the specified validators and controls.
547
+ *
548
+ * @param validators - An array of validators to apply to the FormArray.
549
+ * @param controls - An optional array of initial FormControl instances to add to the FormArray.
550
+ * @returns A new FormArray instance.
551
+ */
552
+ createFormAlias(validators, controls = []) {
553
+ return new FormArray(controls, { validators: [...validators] });
554
+ }
555
+ /**
556
+ * Removes a form alias control at the specified index from the given form array controls.
557
+ *
558
+ * @param index - The index of the form alias control to remove.
559
+ * @param formArrayControls - The array of form array controls.
560
+ * @returns The updated array of form array controls after removing the specified control.
561
+ */
562
+ removeFormAliasControl(index, formArrayControls) {
563
+ formArrayControls.splice(index, 1);
564
+ return formArrayControls;
565
+ }
566
+ /**
567
+ * Sets up the alias form controls based on the provided alias count array and form array name.
568
+ * If there are any aliases, the alias controls will be re-populated.
569
+ *
570
+ * @param aliasCountArray - An array containing the count of aliases.
571
+ * @param formArrayName - The name of the form array.
572
+ */
573
+ setupAliasFormControls(aliasCountArray, formArrayName) {
574
+ // Re-populate the alias controls if there are any aliases
575
+ if (aliasCountArray.length) {
576
+ this.aliasControls = this.buildFormAliasControls(aliasCountArray, formArrayName, this.aliasFields, this.aliasControlsValidation);
577
+ }
578
+ }
579
+ /**
580
+ * Removes the form alias controls errors for a specific index in a form array.
581
+ *
582
+ * @param index - The index of the form array control.
583
+ * @param formArrayControls - An array of form array controls.
584
+ * @param fieldNames - An array of field names to remove errors from.
585
+ */
586
+ removeFormAliasControlsErrors(index, formArrayControls, fieldNames) {
587
+ const formArrayControl = formArrayControls[index];
588
+ if (formArrayControl) {
589
+ fieldNames.forEach((field) => {
590
+ delete this.formControlErrorMessages?.[formArrayControl[field].controlName];
591
+ });
592
+ }
593
+ }
594
+ /**
595
+ * Creates alias controls for the given fields and index.
596
+ * @param fields - The list of fields for which alias controls need to be created.
597
+ * @param index - The index value used to generate unique identifiers for the controls.
598
+ * @returns An object containing the alias controls.
599
+ */
600
+ createAliasControls(fields, index) {
601
+ return fields.reduce((controls, field) => ({
602
+ ...controls,
603
+ [field]: {
604
+ inputId: `${field}_${index}`,
605
+ inputName: `${field}_${index}`,
606
+ controlName: `${field}_${index}`,
607
+ },
608
+ }), {});
609
+ }
610
+ /**
611
+ * Sets up the alias checkbox listener.
612
+ *
613
+ * @param formCheckboxName - The name of the checkbox control in the form.
614
+ * @param formArrayName - The name of the form array control in the form.
615
+ */
616
+ setUpAliasCheckboxListener(formCheckboxName, formArrayName) {
617
+ // Ensure any existing subscription is cleared to avoid memory leaks
618
+ this['ngUnsubscribe'].next();
619
+ this['ngUnsubscribe'].complete();
620
+ const addAliasControl = this.form.get(formCheckboxName);
621
+ if (!addAliasControl) {
622
+ return;
623
+ }
624
+ addAliasControl.valueChanges.pipe(takeUntil(this['ngUnsubscribe'])).subscribe((shouldAddAlias) => {
625
+ this.aliasControls = shouldAddAlias
626
+ ? this.buildFormAliasControls([0], formArrayName, this.aliasFields, this.aliasControlsValidation)
627
+ : this.removeAllFormAliasControls(this.aliasControls, formArrayName, this.aliasFields);
628
+ });
629
+ }
630
+ /**
631
+ * Removes a form alias control from a form array and updates the list of form array controls.
632
+ * @param index - The index of the form alias control to be removed.
633
+ * @param formArrayName - The name of the form array.
634
+ * @param formArrayControls - The list of form array controls.
635
+ * @param fieldNames - The names of the fields associated with the form array controls.
636
+ * @returns The updated list of form array controls after removing the specified control.
637
+ */
638
+ removeFormAliasControls(index, formArrayName, formArrayControls, fieldNames) {
639
+ // Get the form array...
640
+ const control = this.form.get(formArrayName);
641
+ // Remove the form array control based on index
642
+ control.removeAt(index);
643
+ // Then remove the form array controls errors...
644
+ this.removeFormAliasControlsErrors(index, formArrayControls, fieldNames);
645
+ // Return the new list of form array controls...
646
+ return this.removeFormAliasControl(index, formArrayControls);
647
+ }
648
+ /**
649
+ * Adds an alias to the specified index of the form array.
650
+ *
651
+ * @param index - The index at which to add the alias.
652
+ * @param formArrayName - The name of the form array.
653
+ */
654
+ addAlias(index, formArrayName) {
655
+ this.aliasControls.push(this.addAliasControls(index, formArrayName, this.aliasFields, this.aliasControlsValidation));
656
+ }
657
+ /**
658
+ * Removes an alias from the form array.
659
+ *
660
+ * @param index - The index of the alias to remove.
661
+ * @param formArrayName - The name of the form array.
662
+ */
663
+ removeAlias(index, formArrayName) {
664
+ this.aliasControls = this.removeFormAliasControls(index, formArrayName, this.aliasControls, this.aliasFields);
665
+ }
666
+ ngOnInit() {
667
+ super.ngOnInit();
668
+ }
669
+ ngOnDestroy() {
670
+ this['ngUnsubscribe'].next();
671
+ this['ngUnsubscribe'].complete();
672
+ super.ngOnDestroy();
673
+ }
674
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AbstractFormAliasBaseComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
675
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: AbstractFormAliasBaseComponent, isStandalone: true, selector: "ng-component", usesInheritance: true, ngImport: i0, template: '', isInline: true });
676
+ }
677
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AbstractFormAliasBaseComponent, decorators: [{
678
+ type: Component,
679
+ args: [{
680
+ template: '',
681
+ }]
682
+ }] });
683
+
684
+ class AbstractFormArrayBaseComponent extends AbstractFormBaseComponent {
685
+ formArrayControls = [];
686
+ formArrayControlsValidation = [];
687
+ formArrayFields = [];
688
+ /**
689
+ * Builds an array of form controls for a form array.
690
+ *
691
+ * @param formControlCount - An array of numbers representing the number of form controls to create.
692
+ * @param formArrayName - The name of the form array.
693
+ * @param fieldNames - An array of field names for the form controls.
694
+ * @param controlValidation - An array of control validation configurations.
695
+ * @returns An array of form controls for the form array.
696
+ */
697
+ buildFormArrayControls(formControlCount, formArrayName, fieldNames, controlValidation) {
698
+ // Directly map each index to a control
699
+ return formControlCount.map((_element, index) => this.addFormArrayControls(index, formArrayName, fieldNames, controlValidation));
700
+ }
701
+ /**
702
+ * Adds form array controls to the specified form array.
703
+ *
704
+ * @param index - The index at which the form array controls should be added.
705
+ * @param formArrayName - The name of the form array.
706
+ * @param fieldNames - The names of the form controls to be created.
707
+ * @param controlValidation - The validation rules for the form controls.
708
+ * @returns An object containing the form controls that were added.
709
+ */
710
+ addFormArrayControls(index, formArrayName, fieldNames, controlValidation) {
711
+ const formArray = this.form.get(formArrayName);
712
+ const formArrayFormGroup = new FormGroup({});
713
+ // Create the form controls...
714
+ const controls = this.createFormArrayControls(fieldNames, index);
715
+ // Add the controls to the form group...
716
+ this.addControlsToFormGroup(formArrayFormGroup, controlValidation, index);
717
+ // Add the form group to the form array...
718
+ formArray.push(formArrayFormGroup);
719
+ // Return the form controls...
720
+ return controls;
721
+ }
722
+ /**
723
+ * Creates a new instance of FormArray with the specified validators and controls.
724
+ *
725
+ * @param validators - An array of validator functions to be applied to the form array.
726
+ * @param controls - An optional array of form controls to initialize the form array with.
727
+ * @returns A new instance of FormArray.
728
+ */
729
+ createFormArray(validators, controls = []) {
730
+ return new FormArray(controls, { validators: [...validators] });
731
+ }
732
+ /**
733
+ * Sets up the form array form controls based on the provided parameters.
734
+ *
735
+ * @param formArrayCountArray - An array of numbers representing the count of form array controls.
736
+ * @param formArrayName - The name of the form array.
737
+ */
738
+ setupFormArrayFormControls(formArrayCountArray, formArrayName) {
739
+ if (formArrayCountArray.length) {
740
+ this.formArrayControls = this.buildFormArrayControls(formArrayCountArray, formArrayName, this.formArrayFields, this.formArrayControlsValidation);
741
+ }
742
+ }
743
+ /**
744
+ * Creates an object with form array controls based on the given fields and index.
745
+ *
746
+ * @param fields - An array of field names.
747
+ * @param index - The index of the form array.
748
+ * @returns An object with form array controls.
749
+ */
750
+ createFormArrayControls(fields, index) {
751
+ return fields.reduce((controls, field) => ({
752
+ ...controls,
753
+ [field]: {
754
+ inputId: `${field}_${index}`,
755
+ inputName: `${field}_${index}`,
756
+ controlName: `${field}_${index}`,
757
+ },
758
+ }), {});
759
+ }
760
+ /**
761
+ * Removes form array controls errors for a specific index.
762
+ *
763
+ * @param index - The index of the form array control.
764
+ * @param formArrayControls - An array of form array controls.
765
+ * @param fieldNames - An array of field names to remove errors from.
766
+ */
767
+ removeFormArrayControlsErrors(index, formArrayControls, fieldNames) {
768
+ const formArrayControl = formArrayControls[index];
769
+ if (formArrayControl) {
770
+ fieldNames.forEach((field) => {
771
+ delete this.formControlErrorMessages?.[formArrayControl[field].controlName];
772
+ });
773
+ }
774
+ }
775
+ /**
776
+ * Adds controls to the form array at the specified index.
777
+ *
778
+ * @param index - The index at which the controls should be added.
779
+ * @param formArrayName - The name of the form array.
780
+ */
781
+ addControlsToFormArray(index, formArrayName) {
782
+ this.formArrayControls.push(this.addFormArrayControls(index, formArrayName, this.formArrayFields, this.formArrayControlsValidation));
783
+ }
784
+ /**
785
+ * Removes a form array control at the specified index from the given array of form array controls.
786
+ *
787
+ * @param index - The index of the form array control to be removed.
788
+ * @param formArrayControls - The array of form array controls.
789
+ * @returns The updated array of form array controls after removing the specified control.
790
+ */
791
+ removeFormArrayControl(index, formArrayControls) {
792
+ formArrayControls.splice(index, 1);
793
+ return formArrayControls;
794
+ }
795
+ /**
796
+ * Retrieves the value of a form control or returns a default value if the control is null or undefined.
797
+ *
798
+ * @param control - The form control to retrieve the value from.
799
+ * @param defaultValue - The default value to return if the control is null or undefined.
800
+ * @returns The value of the control if it exists, otherwise the default value.
801
+ */
802
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
803
+ getControlValueOrDefault(control, defaultValue) {
804
+ return control?.value || defaultValue;
805
+ }
806
+ /**
807
+ * Removes a form array control at the specified index and updates the form array controls and errors.
808
+ *
809
+ * @param index - The index of the form array control to remove.
810
+ * @param formArrayName - The name of the form array.
811
+ * @param formArrayControls - The list of form array controls.
812
+ * @param fieldNames - The names of the fields associated with the form array controls.
813
+ * @returns The updated list of form array controls.
814
+ */
815
+ removeFormArrayControls(index, formArrayName, formArrayControls, fieldNames) {
816
+ // Get the form array...
817
+ const control = this.form.get(formArrayName);
818
+ // Remove the form array control based on index
819
+ control.removeAt(index);
820
+ // Then remove the form array controls errors...
821
+ this.removeFormArrayControlsErrors(index, formArrayControls, fieldNames);
822
+ // Return the new list of form array controls...
823
+ return this.removeFormArrayControl(index, formArrayControls);
824
+ }
825
+ /**
826
+ * Removes controls from a form array at the specified index.
827
+ *
828
+ * @param index - The index at which to remove the controls.
829
+ * @param formArrayName - The name of the form array.
830
+ */
831
+ removeControlsFromFormArray(index, formArrayName) {
832
+ this.formArrayControls = this.removeFormArrayControls(index, formArrayName, this.formArrayControls, this.formArrayFields);
833
+ }
834
+ /**
835
+ * Removes a form array control from the specified form array.
836
+ *
837
+ * @param formArrayControl - The form array control to remove.
838
+ * @param formArrayName - The name of the form array.
839
+ */
840
+ removeFormArrayControlFromArray(formArrayControl, formArrayName) {
841
+ const formArrayControlIndex = this.formArrayControls.findIndex((control) => control === formArrayControl);
842
+ this.removeFormArrayControls(formArrayControlIndex, formArrayName, this.formArrayControls, this.formArrayFields);
843
+ }
844
+ /**
845
+ * Retrieves the FormGroup at the specified index from a FormArray.
846
+ *
847
+ * @param index - The index of the FormGroup to retrieve.
848
+ * @param formArrayName - The name of the FormArray.
849
+ * @returns The FormGroup at the specified index.
850
+ */
851
+ getFormArrayFormGroup(index, formArrayName) {
852
+ const formArray = this.form.get(formArrayName);
853
+ return formArray.controls[index];
854
+ }
855
+ /**
856
+ * Retrieves the FormControl from a FormGroup within a FormArray at the specified index.
857
+ *
858
+ * @param formGroup - The FormGroup containing the FormControl.
859
+ * @param controlName - The name of the FormControl.
860
+ * @param index - The index of the FormArray.
861
+ * @returns The FormControl at the specified index.
862
+ */
863
+ getFormArrayFormGroupControl(formGroup, controlName, index) {
864
+ return formGroup.controls[`${controlName}_${index}`];
865
+ }
866
+ /**
867
+ * Adds validators to a specific form control within a form array group.
868
+ *
869
+ * @param formGroup - The form group containing the form array.
870
+ * @param controlName - The name of the form control within the form array group.
871
+ * @param index - The index of the form array group within the form array.
872
+ * @param validators - An array of validator functions to be added to the form control.
873
+ */
874
+ addFormArrayFormGroupControlValidators(formControl, validators) {
875
+ formControl.setValidators(validators);
876
+ formControl.updateValueAndValidity({ emitEvent: false });
877
+ }
878
+ /**
879
+ * Removes validators from a specific form control within a form array group.
880
+ * @param formGroup - The form group containing the form array.
881
+ * @param controlName - The name of the form control within the form array group.
882
+ * @param index - The index of the form array group within the form array.
883
+ */
884
+ removeFormArrayFormGroupControlValidators(formControl) {
885
+ formControl.clearValidators();
886
+ formControl.setErrors(null);
887
+ formControl.setValue(null, { emitEvent: false });
888
+ formControl.updateValueAndValidity({ emitEvent: false });
889
+ }
890
+ /**
891
+ * Reverses the form array data by appending the index to each key in the objects.
892
+ *
893
+ * @param data - An array of objects containing form data.
894
+ * @returns An array of objects with keys modified to include their index in the original array.
895
+ */
896
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
897
+ addIndexToFormArrayData(data) {
898
+ return data.map((item, index) => Object.entries(item).reduce((indexedObject, [key, value]) => {
899
+ if (value !== undefined) {
900
+ indexedObject[`${key}_${index}`] = value;
901
+ }
902
+ return indexedObject;
903
+ },
904
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
905
+ {}));
906
+ }
907
+ ngOnInit() {
908
+ super.ngOnInit();
909
+ }
910
+ ngOnDestroy() {
911
+ this.ngUnsubscribe.next();
912
+ this.ngUnsubscribe.complete();
913
+ super.ngOnDestroy();
914
+ }
915
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AbstractFormArrayBaseComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
916
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: AbstractFormArrayBaseComponent, isStandalone: true, selector: "ng-component", usesInheritance: true, ngImport: i0, template: '', isInline: true });
917
+ }
918
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AbstractFormArrayBaseComponent, decorators: [{
919
+ type: Component,
920
+ args: [{
921
+ template: '',
922
+ }]
923
+ }] });
924
+
925
+ class AbstractFormParentBaseComponent {
926
+ router = inject(Router);
927
+ activatedRoute = inject(ActivatedRoute);
928
+ stateUnsavedChanges;
929
+ /**
930
+ * If the user navigates externally from the site or closes the tab
931
+ * Check if there is unsaved changes form state -> warning message
932
+ * Otherwise -> no warning message
933
+ *
934
+ * @returns boolean
935
+ */
936
+ canDeactivate() {
937
+ if (this.stateUnsavedChanges) {
938
+ return false;
939
+ }
940
+ else {
941
+ return true;
942
+ }
943
+ }
944
+ /**
945
+ * Navigates to the specified route using the Angular router.
946
+ *
947
+ * @param route - The route to navigate to.
948
+ */
949
+ routerNavigate(route, nonRelative = false, event) {
950
+ if (event) {
951
+ event.preventDefault();
952
+ }
953
+ if (nonRelative) {
954
+ this.router.navigate([route]);
955
+ }
956
+ else {
957
+ this.router.navigate([route], { relativeTo: this.activatedRoute.parent });
958
+ }
959
+ }
960
+ /**
961
+ * Checks if an object has any non-empty values.
962
+ *
963
+ * @param form - The object representing form data with key-value pairs.
964
+ * @returns A boolean indicating whether the object has any non-empty values.
965
+ */
966
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
967
+ hasFormValues(form) {
968
+ return Object.values(form).some(Boolean);
969
+ }
970
+ }
971
+
972
+ class AbstractFormArrayParentBaseComponent extends AbstractFormParentBaseComponent {
973
+ /**
974
+ * Removes index suffixes from keys in an array of objects and restructures the data.
975
+ *
976
+ * This function takes an array of objects where keys have an index suffix (e.g., `key_0`, `key_1`),
977
+ * and returns a new array of objects where the keys are grouped by their base name without the index.
978
+ *
979
+ * @param data - The array of objects with indexed keys.
980
+ * @returns A new array of objects with keys grouped by their base name.
981
+ */
982
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
983
+ removeIndexFromFormArrayData(data) {
984
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
985
+ return data.reduce((result, indexedObject) => {
986
+ let currentIndex;
987
+ Object.keys(indexedObject).forEach((key) => {
988
+ const match = RegExp(/^(.*)_(\d+)$/).exec(key);
989
+ if (match) {
990
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
991
+ const [_, baseKey, index] = match;
992
+ const idx = parseInt(index, 10);
993
+ currentIndex = idx; // Set the current index based on the last indexed key
994
+ result[idx] = result[idx] || {};
995
+ result[idx][baseKey] = indexedObject[key];
996
+ }
997
+ else {
998
+ // For non-indexed keys, use the currentIndex if available
999
+ result[currentIndex] = result[currentIndex] || {};
1000
+ result[currentIndex][key] = indexedObject[key];
1001
+ }
1002
+ });
1003
+ return result;
1004
+ }, []);
1005
+ }
1006
+ }
1007
+
1008
+ class AbstractFormArrayRemovalComponent {
1009
+ router = inject(Router);
1010
+ activatedRoute = inject(ActivatedRoute);
1011
+ getFormArrayControlValue(formArray, controlName, rowIndex, defaultValue) {
1012
+ const value = formArray.controls[rowIndex]?.get(controlName)?.value;
1013
+ if (typeof value === 'string' && !isNaN(Number(value))) {
1014
+ return Number(value);
1015
+ }
1016
+ return value ?? defaultValue;
1017
+ }
1018
+ /**
1019
+ * Removes a control from the given form array at the specified index and renumbers the remaining controls.
1020
+ *
1021
+ * @param formArray - The form array from which to remove the control.
1022
+ * @param removeIndex - The index of the control to remove.
1023
+ * @param fieldNames - The names of the fields associated with the controls.
1024
+ * @param dynamicFieldPrefix - The prefix used for dynamically generated field names.
1025
+ */
1026
+ removeControlAndRenumber(formArray, removeIndex, fieldNames, dynamicFieldPrefix) {
1027
+ formArray.removeAt(removeIndex);
1028
+ this.renumberControls(formArray, removeIndex, fieldNames, dynamicFieldPrefix);
1029
+ }
1030
+ /**
1031
+ * Renumber the controls in a FormArray starting from a specific index.
1032
+ * This method updates the control keys of each FormGroup within the FormArray.
1033
+ *
1034
+ * @param formArray - The FormArray to renumber the controls for.
1035
+ * @param startIndex - The index to start renumbering the controls from.
1036
+ * @param fieldNames - The names of the fields in the FormGroup.
1037
+ * @param dynamicFieldPrefix - The prefix to use for dynamic field names.
1038
+ */
1039
+ renumberControls(formArray, startIndex, fieldNames, dynamicFieldPrefix) {
1040
+ const formGroups = formArray.controls.slice(startIndex);
1041
+ for (const [index, formGroup] of formGroups.entries()) {
1042
+ this.updateControlKeys(formGroup, index + startIndex, fieldNames, dynamicFieldPrefix);
1043
+ }
1044
+ }
1045
+ /**
1046
+ * Updates the control keys in a form group based on the provided parameters.
1047
+ * @param formGroup - The form group to update.
1048
+ * @param index - The index of the form group within an array.
1049
+ * @param fieldNames - An array of field names to update.
1050
+ * @param dynamicFieldPrefix - The prefix to use for dynamic field keys.
1051
+ */
1052
+ updateControlKeys(formGroup, index, fieldNames, dynamicFieldPrefix) {
1053
+ fieldNames.forEach((field) => {
1054
+ const currentKey = `${dynamicFieldPrefix}_${field}_${index + 1}`;
1055
+ const newKey = `${dynamicFieldPrefix}_${field}_${index}`;
1056
+ // Retrieve the current control, if it exists
1057
+ const control = formGroup.get(currentKey);
1058
+ if (control) {
1059
+ // Remove the old control first, then add it with the new key
1060
+ formGroup.removeControl(currentKey);
1061
+ // Add the control with the updated key
1062
+ formGroup.addControl(newKey, control);
1063
+ }
1064
+ });
1065
+ }
1066
+ /**
1067
+ * Handles route with the supplied route
1068
+ *
1069
+ * @param route string of route
1070
+ * @param nonRelative boolean indicating if route is relative to the parent
1071
+ */
1072
+ handleRoute(route, nonRelative = false, event) {
1073
+ if (event) {
1074
+ event.preventDefault();
1075
+ }
1076
+ if (nonRelative) {
1077
+ this.router.navigate([route]);
1078
+ }
1079
+ else {
1080
+ this.router.navigate([route], { relativeTo: this.activatedRoute.parent });
1081
+ }
1082
+ }
1083
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AbstractFormArrayRemovalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1084
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: AbstractFormArrayRemovalComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: '', isInline: true });
1085
+ }
1086
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AbstractFormArrayRemovalComponent, decorators: [{
1087
+ type: Component,
1088
+ args: [{
1089
+ template: '',
1090
+ }]
1091
+ }] });
1092
+
1093
+ class AbstractSortableTableComponent {
1094
+ sortService = inject(SortService);
1095
+ abstractTableDataSignal = signal([]);
1096
+ abstractExistingSortState = null;
1097
+ sortStateSignal = signal({});
1098
+ sortedColumnTitleSignal = signal('');
1099
+ sortedColumnDirectionSignal = signal('none');
1100
+ abstractSortState = new EventEmitter();
1101
+ /**
1102
+ * Creates an initial sort state for a table based on the provided table data.
1103
+ *
1104
+ * @param tableData - Array of table data objects representing table rows.
1105
+ * @returns Initial sort state object with column names as keys and 'none' as values.
1106
+ */
1107
+ createSortState(tableData) {
1108
+ return tableData?.length
1109
+ ? Object.keys(tableData[0]).reduce((state, key) => {
1110
+ state[key] = 'none';
1111
+ return state;
1112
+ }, {})
1113
+ : {};
1114
+ }
1115
+ /**
1116
+ * Initializes the sort state for the sortable table component.
1117
+ *
1118
+ * This method sets the initial sort state based on the existing sort state or creates a new one
1119
+ * if none exists. It then updates the sort state signal with the initial sort state.
1120
+ *
1121
+ * If an existing sort state is found, it iterates over each entry and triggers the sort change
1122
+ * for each key that has a sort type other than 'none'.
1123
+ *
1124
+ * @private
1125
+ * @returns {void}
1126
+ */
1127
+ initialiseSortState() {
1128
+ const existingSortState = this.abstractExistingSortState;
1129
+ const initialSortState = existingSortState || this.createSortState(this.abstractTableDataSignal());
1130
+ this.sortStateSignal.set(initialSortState);
1131
+ if (existingSortState) {
1132
+ Object.entries(existingSortState).forEach(([key, sortType]) => {
1133
+ if (sortType !== 'none') {
1134
+ this.onSortChange({ key, sortType });
1135
+ }
1136
+ });
1137
+ }
1138
+ this.getSortedColumn();
1139
+ }
1140
+ /**
1141
+ * Updates the sort state for a given column key and sort type.
1142
+ * Resets the sort state for all other columns to 'none'.
1143
+ *
1144
+ * @param key - The column to sort by.
1145
+ * @param sortType - Sorting order ('ascending' or 'descending').
1146
+ */
1147
+ updateSortState(key, sortType) {
1148
+ this.sortStateSignal.set(Object.keys(this.sortStateSignal()).reduce((state, columnKey) => {
1149
+ state[columnKey] = columnKey === key ? sortType : 'none';
1150
+ return state;
1151
+ }, {}));
1152
+ }
1153
+ /**
1154
+ * Retrieves the sorted table data based on the specified key and sort type.
1155
+ *
1156
+ * @param key - The key of the property to sort by.
1157
+ * @param sortType - The type of sorting to apply, either 'ascending' or 'descending'.
1158
+ * @returns An array of sorted table data objects.
1159
+ */
1160
+ getSortedTableData(key, sortType) {
1161
+ return sortType === 'ascending'
1162
+ ? this.sortService.sortObjectArrayAsc(this.abstractTableDataSignal(), key)
1163
+ : this.sortService.sortObjectArrayDesc(this.abstractTableDataSignal(), key);
1164
+ }
1165
+ /**
1166
+ * Determines the first column with a sort state other than 'none' and updates the sorted column signals accordingly.
1167
+ *
1168
+ * - If a sorted column is found, updates the `sortedColumnTitleSignal` and `sortedColumnDirectionSignal` with the column key and state.
1169
+ * - If no sorted column is found, sets the `sortedColumnTitleSignal` to an empty string and `sortedColumnDirectionSignal` to 'none'.
1170
+ *
1171
+ * @private
1172
+ * @returns {void}
1173
+ */
1174
+ getSortedColumn() {
1175
+ // Find the first column that has a sort state other than 'none'
1176
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
1177
+ const sortedColumn = Object.entries(this.sortStateSignal()).find(([_, state]) => state !== 'none');
1178
+ // If a sorted column is found, set the signal to the sorted column key and state
1179
+ if (sortedColumn) {
1180
+ const [columnKey, state] = sortedColumn;
1181
+ this.sortedColumnTitleSignal.set(columnKey);
1182
+ this.sortedColumnDirectionSignal.set(state);
1183
+ }
1184
+ else {
1185
+ // Otherwise, set the signal to null
1186
+ this.sortedColumnTitleSignal.set('');
1187
+ this.sortedColumnDirectionSignal.set('none');
1188
+ }
1189
+ }
1190
+ /**
1191
+ * Handles the change in sorting for the table.
1192
+ *
1193
+ * @param event - An object containing the key to sort by and the sort type.
1194
+ * @param event.key - The key of the column to sort.
1195
+ * @param event.sortType - The type of sorting to apply ('ascending' or 'descending').
1196
+ *
1197
+ * This method updates the sort state, sorts the table data based on the provided key and sort type,
1198
+ * updates the table data signal, and emits the updated sort state.
1199
+ */
1200
+ onSortChange(event) {
1201
+ const { key, sortType } = event;
1202
+ this.updateSortState(key, sortType);
1203
+ this.getSortedColumn();
1204
+ const sortedData = this.getSortedTableData(key, sortType);
1205
+ // Update the table data signal
1206
+ this.abstractTableDataSignal.set(sortedData);
1207
+ // Emit the updated sort state
1208
+ this.abstractSortState.emit(this.sortStateSignal());
1209
+ }
1210
+ /**
1211
+ * Lifecycle hook to initialise the sort state.
1212
+ */
1213
+ ngOnInit() {
1214
+ this.initialiseSortState();
1215
+ }
1216
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AbstractSortableTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1217
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: AbstractSortableTableComponent, isStandalone: true, selector: "ng-component", outputs: { abstractSortState: "abstractSortState" }, ngImport: i0, template: '', isInline: true });
1218
+ }
1219
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AbstractSortableTableComponent, decorators: [{
1220
+ type: Component,
1221
+ args: [{
1222
+ template: '',
1223
+ }]
1224
+ }], propDecorators: { abstractSortState: [{
1225
+ type: Output
1226
+ }] } });
1227
+
1228
+ class AbstractSortableTablePaginationComponent extends AbstractSortableTableComponent {
1229
+ // Signal for the current page. Used to calculate the start and end indices for pagination.
1230
+ currentPageSignal = signal(1);
1231
+ // Signal for the number of items per page. Determines how many items are displayed on each page.
1232
+ itemsPerPageSignal = signal(10);
1233
+ // Signal for the start index (1-based). Automatically updates when `currentPageSignal` or `itemsPerPageSignal` changes.
1234
+ startIndexComputed = computed(() => {
1235
+ const currentPage = this.currentPageSignal();
1236
+ return (currentPage - 1) * this.itemsPerPageSignal() + 1;
1237
+ });
1238
+ // Signal for the end index (1-based). Automatically recalculates when `startIndexComputed` or `abstractTableDataSignal` changes.
1239
+ endIndexComputed = computed(() => {
1240
+ const startIndex = this.startIndexComputed();
1241
+ return Math.min(startIndex + this.itemsPerPageSignal() - 1, this.abstractTableDataSignal().length);
1242
+ });
1243
+ // Computed signal for paginated table data. Reactively slices `abstractTableDataSignal` based on `startIndexComputed` and `endIndexComputed`.
1244
+ paginatedTableDataComputed = computed(() => {
1245
+ const data = this.abstractTableDataSignal(); // Full table data
1246
+ return data.slice(this.startIndexComputed() - 1, this.endIndexComputed()); // Return paginated data subset
1247
+ });
1248
+ /**
1249
+ * Handles sorting changes and resets the page to the first page.
1250
+ *
1251
+ * @param event - The sorting event containing:
1252
+ * - `key`: The column key to sort by.
1253
+ * - `sortType`: The sorting order, either 'ascending' or 'descending'.
1254
+ *
1255
+ * Resets `currentPageSignal` to 1 and triggers re-sorting of `abstractTableDataSignal`.
1256
+ */
1257
+ onSortChange(event) {
1258
+ super.onSortChange(event); // Update the sort state and sort the data
1259
+ this.currentPageSignal.set(1); // Reset the page to the first page
1260
+ }
1261
+ /**
1262
+ * Handles the event when the page is changed.
1263
+ *
1264
+ * @param newPage - The new page number to set. If the provided page number is out of range,
1265
+ * it will be clamped between 1 and the total number of pages.
1266
+ */
1267
+ onPageChange(newPage) {
1268
+ const totalPages = Math.ceil(this.abstractTableDataSignal().length / this.itemsPerPageSignal());
1269
+ this.currentPageSignal.set(Math.max(1, Math.min(newPage, totalPages)));
1270
+ }
1271
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AbstractSortableTablePaginationComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1272
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: AbstractSortableTablePaginationComponent, isStandalone: true, selector: "ng-component", usesInheritance: true, ngImport: i0, template: '', isInline: true });
1273
+ }
1274
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AbstractSortableTablePaginationComponent, decorators: [{
1275
+ type: Component,
1276
+ args: [{
1277
+ template: '',
1278
+ }]
1279
+ }] });
1280
+
1281
+ // ABSTRACT CLASSES
1282
+
1283
+ /**
1284
+ * Generated bundle index. Do not edit.
1285
+ */
1286
+
1287
+ export { AbstractFormAliasBaseComponent, AbstractFormArrayBaseComponent, AbstractFormArrayParentBaseComponent, AbstractFormArrayRemovalComponent, AbstractFormBaseComponent, AbstractFormParentBaseComponent, AbstractSortableTableComponent, AbstractSortableTablePaginationComponent };
1288
+ //# sourceMappingURL=hmcts-opal-frontend-common-components-abstract.mjs.map