@hmcts/opal-frontend-common 0.0.2 → 0.0.3

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 (437) 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 +20 -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-page-header/moj-page-header.component.d.ts +6 -0
  92. package/components/moj/moj-pagination/moj-pagination-item/moj-pagination-item.component.d.ts +6 -0
  93. package/components/moj/moj-pagination/moj-pagination-link/moj-pagination-link.component.d.ts +43 -0
  94. package/components/moj/moj-pagination/moj-pagination-list/moj-pagination-list.component.d.ts +6 -0
  95. package/components/moj/moj-pagination/moj-pagination.component.d.ts +108 -0
  96. package/components/moj/moj-primary-navigation/moj-primary-navigation-item/moj-primary-navigation-item.component.d.ts +18 -0
  97. package/components/moj/moj-primary-navigation/moj-primary-navigation.component.d.ts +26 -0
  98. package/components/moj/moj-sortable-table/moj-sortable-table-header/moj-sortable-table-header.component.d.ts +24 -0
  99. package/components/moj/moj-sortable-table/moj-sortable-table-row/moj-sortable-table-row.component.d.ts +7 -0
  100. package/components/moj/moj-sortable-table/moj-sortable-table.component.d.ts +6 -0
  101. package/components/moj/moj-sub-navigation/moj-sub-navigation-item/moj-sub-navigation-item.component.d.ts +17 -0
  102. package/components/moj/moj-sub-navigation/moj-sub-navigation.component.d.ts +21 -0
  103. package/components/moj/moj-ticket-panel/moj-ticket-panel.component.d.ts +8 -0
  104. package/components/moj/moj-timeline/moj-timeline-item/moj-timeline-item.component.d.ts +5 -0
  105. package/components/moj/moj-timeline/moj-timeline.component.d.ts +5 -0
  106. package/components/moj/public-api.d.ts +24 -0
  107. package/constants/index.d.ts +5 -0
  108. package/constants/public-api.d.ts +4 -0
  109. package/constants/src/routing-paths.constant.d.ts +2 -0
  110. package/constants/src/routing-titles.constant.d.ts +2 -0
  111. package/constants/src/session-endpoints.constant.d.ts +2 -0
  112. package/constants/src/sso-endpoints.constant.d.ts +2 -0
  113. package/fesm2022/hmcts-opal-frontend-common-components-abstract.mjs +1288 -0
  114. package/fesm2022/hmcts-opal-frontend-common-components-abstract.mjs.map +1 -0
  115. package/fesm2022/hmcts-opal-frontend-common-components-alphagov.mjs +170 -0
  116. package/fesm2022/hmcts-opal-frontend-common-components-alphagov.mjs.map +1 -0
  117. package/fesm2022/hmcts-opal-frontend-common-components-govuk.mjs +1259 -0
  118. package/fesm2022/hmcts-opal-frontend-common-components-govuk.mjs.map +1 -0
  119. package/fesm2022/hmcts-opal-frontend-common-components-moj.mjs +804 -0
  120. package/fesm2022/hmcts-opal-frontend-common-components-moj.mjs.map +1 -0
  121. package/fesm2022/hmcts-opal-frontend-common-constants.mjs +36 -0
  122. package/fesm2022/hmcts-opal-frontend-common-constants.mjs.map +1 -0
  123. package/fesm2022/hmcts-opal-frontend-common-guards.mjs +134 -0
  124. package/fesm2022/hmcts-opal-frontend-common-guards.mjs.map +1 -0
  125. package/fesm2022/hmcts-opal-frontend-common-interceptors.mjs +31 -0
  126. package/fesm2022/hmcts-opal-frontend-common-interceptors.mjs.map +1 -0
  127. package/fesm2022/hmcts-opal-frontend-common-interfaces.mjs +4 -0
  128. package/fesm2022/hmcts-opal-frontend-common-interfaces.mjs.map +1 -0
  129. package/fesm2022/hmcts-opal-frontend-common-mocks.mjs +429 -0
  130. package/fesm2022/hmcts-opal-frontend-common-mocks.mjs.map +1 -0
  131. package/fesm2022/hmcts-opal-frontend-common-pages-sign-in-stub.component-eGVOJLC2.mjs +41 -0
  132. package/fesm2022/hmcts-opal-frontend-common-pages-sign-in-stub.component-eGVOJLC2.mjs.map +1 -0
  133. package/fesm2022/hmcts-opal-frontend-common-pages.mjs +109 -0
  134. package/fesm2022/hmcts-opal-frontend-common-pages.mjs.map +1 -0
  135. package/fesm2022/hmcts-opal-frontend-common-pipes.mjs +64 -0
  136. package/fesm2022/hmcts-opal-frontend-common-pipes.mjs.map +1 -0
  137. package/fesm2022/hmcts-opal-frontend-common-resolvers.mjs +40 -0
  138. package/fesm2022/hmcts-opal-frontend-common-resolvers.mjs.map +1 -0
  139. package/fesm2022/hmcts-opal-frontend-common-services.mjs +817 -0
  140. package/fesm2022/hmcts-opal-frontend-common-services.mjs.map +1 -0
  141. package/fesm2022/hmcts-opal-frontend-common-stores.mjs +40 -0
  142. package/fesm2022/hmcts-opal-frontend-common-stores.mjs.map +1 -0
  143. package/fesm2022/hmcts-opal-frontend-common-types.mjs +4 -0
  144. package/fesm2022/hmcts-opal-frontend-common-types.mjs.map +1 -0
  145. package/fesm2022/hmcts-opal-frontend-common-validators.mjs +278 -0
  146. package/fesm2022/hmcts-opal-frontend-common-validators.mjs.map +1 -0
  147. package/fesm2022/hmcts-opal-frontend-common.mjs +0 -1943
  148. package/fesm2022/hmcts-opal-frontend-common.mjs.map +1 -1
  149. package/{lib/guards → guards}/can-deactivate/can-deactivate.guard.d.ts +1 -1
  150. package/{lib/guards → guards}/can-deactivate/interfaces/can-deactivate-can-component-deactivate.interface.d.ts +1 -1
  151. package/{lib/guards → guards}/helpers/get-guard-with-dummy-url.d.ts +1 -1
  152. package/{lib/guards → guards}/helpers/handle-observable-result.d.ts +1 -1
  153. package/{lib/guards → guards}/helpers/run-has-flow-state-guard-with-context.d.ts +1 -1
  154. package/guards/index.d.ts +5 -0
  155. package/guards/public-api.d.ts +9 -0
  156. package/interceptors/index.d.ts +5 -0
  157. package/interceptors/public-api.d.ts +1 -0
  158. package/interfaces/index.d.ts +5 -0
  159. package/interfaces/public-api.d.ts +12 -0
  160. package/{lib/pages/routing/interfaces → interfaces/src}/routing-paths.interface.d.ts +1 -1
  161. package/mocks/index.d.ts +5 -0
  162. package/mocks/public-api.d.ts +8 -0
  163. package/mocks/src/route-permissions.mock.d.ts +3 -0
  164. package/mocks/src/session-token-expiry.mock.d.ts +2 -0
  165. package/mocks/src/session-user-state.mock.d.ts +2 -0
  166. package/mocks/src/transfer-state.mock.d.ts +2 -0
  167. package/package.json +106 -9
  168. package/pages/index.d.ts +5 -0
  169. package/{lib/pages → pages}/sign-in/sign-in.component.d.ts +10 -10
  170. package/pipes/date-format/date-format.pipe.d.ts +10 -0
  171. package/pipes/days-ago/days-ago.pipe.d.ts +7 -0
  172. package/pipes/index.d.ts +5 -0
  173. package/pipes/public-api.d.ts +2 -0
  174. package/public-api.d.ts +1 -10
  175. package/resolvers/index.d.ts +5 -0
  176. package/resolvers/public-api.d.ts +2 -0
  177. package/{lib/resolvers → resolvers}/user-state/user-state.resolver.d.ts +1 -1
  178. package/{lib/services → services}/date-service/date.service.d.ts +8 -0
  179. package/services/index.d.ts +5 -0
  180. package/{lib/services → services}/permissions-service/permissions.service.d.ts +1 -1
  181. package/services/public-api.d.ts +11 -0
  182. package/{lib/services → services}/session-service/session.service.d.ts +1 -1
  183. package/services/sort-service/interfaces/sort-service-values.interface.d.ts +7 -0
  184. package/{lib/services → services}/sort-service/sort-service.d.ts +1 -1
  185. package/{lib/services → services}/transfer-state-service/transfer-state.service.d.ts +1 -1
  186. package/{lib/services → services}/transformation-service/transformation.service.d.ts +1 -1
  187. package/{lib/stores → stores}/global/global.store.d.ts +1 -4
  188. package/stores/index.d.ts +5 -0
  189. package/stores/public-api.d.ts +1 -0
  190. package/types/index.d.ts +5 -0
  191. package/types/public-api.d.ts +4 -0
  192. package/types/src/abstract-sortable-table.type.d.ts +1 -0
  193. package/types/src/global-store.type.d.ts +2 -0
  194. package/types/src/sort-service.type.d.ts +1 -0
  195. package/validators/index.d.ts +5 -0
  196. package/{lib/validators → validators}/over-eighteen/over-eighteen.validator.d.ts +1 -1
  197. package/validators/public-api.d.ts +18 -0
  198. package/esm2022/hmcts-opal-frontend-common.mjs +0 -5
  199. package/esm2022/lib/components/govuk/govuk-button/govuk-button.component.mjs +0 -34
  200. package/esm2022/lib/components/govuk/govuk-text-input/govuk-text-input.component.mjs +0 -57
  201. package/esm2022/lib/components/govuk/index.mjs +0 -3
  202. package/esm2022/lib/guards/auth/auth.guard.mjs +0 -20
  203. package/esm2022/lib/guards/auth/index.mjs +0 -2
  204. package/esm2022/lib/guards/can-deactivate/can-deactivate.guard.mjs +0 -6
  205. package/esm2022/lib/guards/can-deactivate/index.mjs +0 -5
  206. package/esm2022/lib/guards/can-deactivate/interfaces/can-deactivate-can-component-deactivate.interface.mjs +0 -2
  207. package/esm2022/lib/guards/can-deactivate/interfaces/index.mjs +0 -2
  208. package/esm2022/lib/guards/has-flow-state/has-flow-state.guard.mjs +0 -16
  209. package/esm2022/lib/guards/has-flow-state/index.mjs +0 -2
  210. package/esm2022/lib/guards/helpers/get-guard-with-dummy-url.mjs +0 -19
  211. package/esm2022/lib/guards/helpers/handle-observable-result.mjs +0 -13
  212. package/esm2022/lib/guards/helpers/index.mjs +0 -5
  213. package/esm2022/lib/guards/helpers/run-auth-guard-with-context.mjs +0 -15
  214. package/esm2022/lib/guards/helpers/run-has-flow-state-guard-with-context.mjs +0 -9
  215. package/esm2022/lib/guards/index.mjs +0 -10
  216. package/esm2022/lib/guards/route-permissions/index.mjs +0 -2
  217. package/esm2022/lib/guards/route-permissions/route-permissions.guard.mjs +0 -25
  218. package/esm2022/lib/guards/signed-in/index.mjs +0 -3
  219. package/esm2022/lib/guards/signed-in/signed-in.guard.mjs +0 -20
  220. package/esm2022/lib/guards/types/can-deactivate.type.mjs +0 -2
  221. package/esm2022/lib/guards/types/guard-return.type.mjs +0 -2
  222. package/esm2022/lib/guards/types/index.mjs +0 -3
  223. package/esm2022/lib/interceptors/http-error/http-error.interceptor.mjs +0 -24
  224. package/esm2022/lib/interceptors/index.mjs +0 -3
  225. package/esm2022/lib/opal-frontend-common.module.mjs +0 -22
  226. package/esm2022/lib/pages/access-denied/access-denied.component.mjs +0 -18
  227. package/esm2022/lib/pages/index.mjs +0 -4
  228. package/esm2022/lib/pages/routing/constants/routing-paths.constant.mjs +0 -9
  229. package/esm2022/lib/pages/routing/constants/routing-titles.constant.mjs +0 -9
  230. package/esm2022/lib/pages/routing/interfaces/routing-paths.interface.mjs +0 -2
  231. package/esm2022/lib/pages/routing/pages.routes.mjs +0 -24
  232. package/esm2022/lib/pages/sign-in/interfaces/index.mjs +0 -2
  233. package/esm2022/lib/pages/sign-in/interfaces/sign-in-stub-form.interface.mjs +0 -2
  234. package/esm2022/lib/pages/sign-in/sign-in-sso/sign-in-sso.component.mjs +0 -23
  235. package/esm2022/lib/pages/sign-in/sign-in-stub/sign-in-stub.component.mjs +0 -39
  236. package/esm2022/lib/pages/sign-in/sign-in.component.mjs +0 -38
  237. package/esm2022/lib/resolvers/index.mjs +0 -3
  238. package/esm2022/lib/resolvers/title/index.mjs +0 -2
  239. package/esm2022/lib/resolvers/title/title.resolver.mjs +0 -22
  240. package/esm2022/lib/resolvers/user-state/index.mjs +0 -2
  241. package/esm2022/lib/resolvers/user-state/user-state.resolver.mjs +0 -12
  242. package/esm2022/lib/routing/constants/index.mjs +0 -2
  243. package/esm2022/lib/routing/constants/sso-endpoints.constant.mjs +0 -7
  244. package/esm2022/lib/routing/index.mjs +0 -3
  245. package/esm2022/lib/routing/interfaces/child-routing-paths.interface.mjs +0 -2
  246. package/esm2022/lib/routing/interfaces/index.mjs +0 -4
  247. package/esm2022/lib/routing/interfaces/nested-routes.interface.mjs +0 -2
  248. package/esm2022/lib/routing/interfaces/sso-endpoints.interface.mjs +0 -2
  249. package/esm2022/lib/services/app-initializer-service/app-initializer.service.mjs +0 -36
  250. package/esm2022/lib/services/app-initializer-service/index.mjs +0 -2
  251. package/esm2022/lib/services/app-insights/app-insights.service.mjs +0 -73
  252. package/esm2022/lib/services/app-insights/index.mjs +0 -4
  253. package/esm2022/lib/services/auth-service/auth.service.mjs +0 -36
  254. package/esm2022/lib/services/auth-service/index.mjs +0 -2
  255. package/esm2022/lib/services/date-service/date.service.mjs +0 -182
  256. package/esm2022/lib/services/date-service/index.mjs +0 -4
  257. package/esm2022/lib/services/index.mjs +0 -12
  258. package/esm2022/lib/services/launch-darkly/index.mjs +0 -5
  259. package/esm2022/lib/services/launch-darkly/launch-darkly.service.mjs +0 -94
  260. package/esm2022/lib/services/launch-darkly/mocks/index.mjs +0 -3
  261. package/esm2022/lib/services/launch-darkly/mocks/launch-darkly-change-flags.mock.mjs +0 -5
  262. package/esm2022/lib/services/launch-darkly/mocks/launch-darkly-flags.mock.mjs +0 -5
  263. package/esm2022/lib/services/permissions-service/index.mjs +0 -4
  264. package/esm2022/lib/services/permissions-service/permissions.service.mjs +0 -40
  265. package/esm2022/lib/services/session-service/constants/index.mjs +0 -2
  266. package/esm2022/lib/services/session-service/constants/session-endpoints.constant.mjs +0 -5
  267. package/esm2022/lib/services/session-service/index.mjs +0 -7
  268. package/esm2022/lib/services/session-service/interfaces/index.mjs +0 -4
  269. package/esm2022/lib/services/session-service/interfaces/session-endpoints.interface.mjs +0 -2
  270. package/esm2022/lib/services/session-service/interfaces/session-token-expiry.interface.mjs +0 -2
  271. package/esm2022/lib/services/session-service/interfaces/session-user-state.interface.mjs +0 -2
  272. package/esm2022/lib/services/session-service/mocks/index.mjs +0 -3
  273. package/esm2022/lib/services/session-service/mocks/session-token-expiry.mock.mjs +0 -5
  274. package/esm2022/lib/services/session-service/mocks/session-user-state.mock.mjs +0 -386
  275. package/esm2022/lib/services/session-service/session.service.mjs +0 -64
  276. package/esm2022/lib/services/sort-service/index.mjs +0 -6
  277. package/esm2022/lib/services/sort-service/interfaces/index.mjs +0 -3
  278. package/esm2022/lib/services/sort-service/interfaces/sort-service-values.interface.mjs +0 -2
  279. package/esm2022/lib/services/sort-service/interfaces/sort-service.interface.mjs +0 -2
  280. package/esm2022/lib/services/sort-service/sort-service.mjs +0 -90
  281. package/esm2022/lib/services/sort-service/types/index.mjs +0 -2
  282. package/esm2022/lib/services/sort-service/types/sort-service.type.mjs +0 -2
  283. package/esm2022/lib/services/transfer-state-service/index.mjs +0 -6
  284. package/esm2022/lib/services/transfer-state-service/interfaces/index.mjs +0 -4
  285. package/esm2022/lib/services/transfer-state-service/interfaces/transfer-state-app-insights-config.interface.mjs +0 -2
  286. package/esm2022/lib/services/transfer-state-service/interfaces/transfer-state-launch-darkly-config.interface.mjs +0 -2
  287. package/esm2022/lib/services/transfer-state-service/interfaces/transfer-state-server-state.interface.mjs +0 -2
  288. package/esm2022/lib/services/transfer-state-service/mocks/index.mjs +0 -4
  289. package/esm2022/lib/services/transfer-state-service/mocks/transfer-state-app-insights-config.mock.mjs +0 -6
  290. package/esm2022/lib/services/transfer-state-service/mocks/transfer-state-launch-darkly-config.mock.mjs +0 -6
  291. package/esm2022/lib/services/transfer-state-service/mocks/transfer-state.mock.mjs +0 -8
  292. package/esm2022/lib/services/transfer-state-service/transfer-state.service.mjs +0 -59
  293. package/esm2022/lib/services/transformation-service/index.mjs +0 -5
  294. package/esm2022/lib/services/transformation-service/interfaces/index.mjs +0 -2
  295. package/esm2022/lib/services/transformation-service/interfaces/transform-item.interface.mjs +0 -2
  296. package/esm2022/lib/services/transformation-service/transformation.service.mjs +0 -69
  297. package/esm2022/lib/services/utils/index.mjs +0 -4
  298. package/esm2022/lib/services/utils/utils.service.mjs +0 -86
  299. package/esm2022/lib/stores/global/global.store.mjs +0 -33
  300. package/esm2022/lib/stores/global/index.mjs +0 -6
  301. package/esm2022/lib/stores/global/interfaces/error-state.interface.mjs +0 -2
  302. package/esm2022/lib/stores/global/interfaces/index.mjs +0 -2
  303. package/esm2022/lib/stores/global/types/global-store.type.mjs +0 -2
  304. package/esm2022/lib/stores/global/types/index.mjs +0 -2
  305. package/esm2022/lib/stores/index.mjs +0 -2
  306. package/esm2022/lib/validators/alphabetical-text/alphabetical-text.validator.mjs +0 -10
  307. package/esm2022/lib/validators/amount/amount.validator.mjs +0 -15
  308. package/esm2022/lib/validators/date-after-year/date-after-year.validator.mjs +0 -12
  309. package/esm2022/lib/validators/date-before/date-before.validator.mjs +0 -15
  310. package/esm2022/lib/validators/date-of-birth/date-of-birth.validator.mjs +0 -18
  311. package/esm2022/lib/validators/future-date/future-date.validator.mjs +0 -15
  312. package/esm2022/lib/validators/index.mjs +0 -20
  313. package/esm2022/lib/validators/invalid-value/invalid-value.validator.mjs +0 -9
  314. package/esm2022/lib/validators/national-insurance-number/national-insurance-number.validator.mjs +0 -16
  315. package/esm2022/lib/validators/numerical-only/numerical-only.validator.mjs +0 -10
  316. package/esm2022/lib/validators/optional-max-length/optional-max-length.validator.mjs +0 -10
  317. package/esm2022/lib/validators/optional-valid-date/optional-valid-date.validator.mjs +0 -23
  318. package/esm2022/lib/validators/optional-valid-email-address/optional-valid-email-address.validator.mjs +0 -11
  319. package/esm2022/lib/validators/optional-valid-telephone/optional-valid-telephone.validator.mjs +0 -14
  320. package/esm2022/lib/validators/over-eighteen/over-eighteen.validator.mjs +0 -45
  321. package/esm2022/lib/validators/past-date/past-date.validator.mjs +0 -16
  322. package/esm2022/lib/validators/special-characters/special-characters.validator.mjs +0 -11
  323. package/esm2022/lib/validators/two-decimal-places/two-decimal-places.validator.mjs +0 -12
  324. package/esm2022/lib/validators/valid-value/valid-value.validator.mjs +0 -9
  325. package/esm2022/public-api.mjs +0 -11
  326. package/fesm2022/hmcts-opal-frontend-common-sign-in-stub.component-CysPzJGJ.mjs +0 -41
  327. package/fesm2022/hmcts-opal-frontend-common-sign-in-stub.component-CysPzJGJ.mjs.map +0 -1
  328. package/lib/components/govuk/index.d.ts +0 -2
  329. package/lib/guards/auth/index.d.ts +0 -1
  330. package/lib/guards/can-deactivate/index.d.ts +0 -2
  331. package/lib/guards/can-deactivate/interfaces/index.d.ts +0 -2
  332. package/lib/guards/has-flow-state/index.d.ts +0 -1
  333. package/lib/guards/helpers/index.d.ts +0 -4
  334. package/lib/guards/index.d.ts +0 -7
  335. package/lib/guards/route-permissions/index.d.ts +0 -1
  336. package/lib/guards/signed-in/index.d.ts +0 -1
  337. package/lib/guards/types/index.d.ts +0 -2
  338. package/lib/interceptors/index.d.ts +0 -2
  339. package/lib/opal-frontend-common.module.d.ts +0 -14
  340. package/lib/pages/routing/constants/routing-paths.constant.d.ts +0 -2
  341. package/lib/pages/routing/constants/routing-titles.constant.d.ts +0 -2
  342. package/lib/resolvers/index.d.ts +0 -2
  343. package/lib/resolvers/title/index.d.ts +0 -1
  344. package/lib/resolvers/user-state/index.d.ts +0 -1
  345. package/lib/routing/constants/index.d.ts +0 -1
  346. package/lib/routing/constants/sso-endpoints.constant.d.ts +0 -2
  347. package/lib/routing/index.d.ts +0 -2
  348. package/lib/routing/interfaces/index.d.ts +0 -3
  349. package/lib/services/app-initializer-service/index.d.ts +0 -1
  350. package/lib/services/app-insights/index.d.ts +0 -1
  351. package/lib/services/auth-service/index.d.ts +0 -1
  352. package/lib/services/date-service/index.d.ts +0 -1
  353. package/lib/services/index.d.ts +0 -11
  354. package/lib/services/launch-darkly/index.d.ts +0 -2
  355. package/lib/services/launch-darkly/mocks/index.d.ts +0 -2
  356. package/lib/services/permissions-service/index.d.ts +0 -1
  357. package/lib/services/session-service/constants/index.d.ts +0 -1
  358. package/lib/services/session-service/constants/session-endpoints.constant.d.ts +0 -2
  359. package/lib/services/session-service/index.d.ts +0 -4
  360. package/lib/services/session-service/interfaces/index.d.ts +0 -3
  361. package/lib/services/session-service/mocks/index.d.ts +0 -2
  362. package/lib/services/session-service/mocks/session-token-expiry.mock.d.ts +0 -2
  363. package/lib/services/session-service/mocks/session-user-state.mock.d.ts +0 -2
  364. package/lib/services/sort-service/index.d.ts +0 -3
  365. package/lib/services/sort-service/interfaces/index.d.ts +0 -2
  366. package/lib/services/sort-service/interfaces/sort-service-values.interface.d.ts +0 -6
  367. package/lib/services/sort-service/types/index.d.ts +0 -1
  368. package/lib/services/sort-service/types/sort-service.type.d.ts +0 -1
  369. package/lib/services/transfer-state-service/index.d.ts +0 -3
  370. package/lib/services/transfer-state-service/interfaces/index.d.ts +0 -3
  371. package/lib/services/transfer-state-service/mocks/index.d.ts +0 -3
  372. package/lib/services/transfer-state-service/mocks/transfer-state.mock.d.ts +0 -2
  373. package/lib/services/transformation-service/index.d.ts +0 -2
  374. package/lib/services/transformation-service/interfaces/index.d.ts +0 -1
  375. package/lib/services/utils/index.d.ts +0 -1
  376. package/lib/stores/global/index.d.ts +0 -3
  377. package/lib/stores/global/interfaces/index.d.ts +0 -1
  378. package/lib/stores/global/types/global-store.type.d.ts +0 -2
  379. package/lib/stores/global/types/index.d.ts +0 -1
  380. package/lib/stores/index.d.ts +0 -1
  381. package/lib/validators/index.d.ts +0 -19
  382. /package/{lib/components → components}/govuk/govuk-button/govuk-button.component.d.ts +0 -0
  383. /package/{lib/components → components}/govuk/govuk-text-input/govuk-text-input.component.d.ts +0 -0
  384. /package/{lib/guards → guards}/auth/auth.guard.d.ts +0 -0
  385. /package/{lib/guards → guards}/has-flow-state/has-flow-state.guard.d.ts +0 -0
  386. /package/{lib/guards → guards}/helpers/run-auth-guard-with-context.d.ts +0 -0
  387. /package/{lib/guards → guards}/route-permissions/route-permissions.guard.d.ts +0 -0
  388. /package/{lib/guards → guards}/signed-in/signed-in.guard.d.ts +0 -0
  389. /package/{lib/guards → guards}/types/guard-return.type.d.ts +0 -0
  390. /package/{lib/interceptors → interceptors}/http-error/http-error.interceptor.d.ts +0 -0
  391. /package/{lib/routing/interfaces → interfaces/src}/child-routing-paths.interface.d.ts +0 -0
  392. /package/{lib/stores/global/interfaces → interfaces/src}/error-state.interface.d.ts +0 -0
  393. /package/{lib/routing/interfaces → interfaces/src}/nested-routes.interface.d.ts +0 -0
  394. /package/{lib/services/session-service/interfaces → interfaces/src}/session-endpoints.interface.d.ts +0 -0
  395. /package/{lib/services/session-service/interfaces → interfaces/src}/session-token-expiry.interface.d.ts +0 -0
  396. /package/{lib/services/session-service/interfaces → interfaces/src}/session-user-state.interface.d.ts +0 -0
  397. /package/{lib/routing/interfaces → interfaces/src}/sso-endpoints.interface.d.ts +0 -0
  398. /package/{lib/services/transfer-state-service/interfaces → interfaces/src}/transfer-state-app-insights-config.interface.d.ts +0 -0
  399. /package/{lib/services/transfer-state-service/interfaces → interfaces/src}/transfer-state-launch-darkly-config.interface.d.ts +0 -0
  400. /package/{lib/services/transfer-state-service/interfaces → interfaces/src}/transfer-state-server-state.interface.d.ts +0 -0
  401. /package/{lib/services/transformation-service/interfaces → interfaces/src}/transform-item.interface.d.ts +0 -0
  402. /package/{lib/services/launch-darkly/mocks → mocks/src}/launch-darkly-change-flags.mock.d.ts +0 -0
  403. /package/{lib/services/launch-darkly/mocks → mocks/src}/launch-darkly-flags.mock.d.ts +0 -0
  404. /package/{lib/services/transfer-state-service/mocks → mocks/src}/transfer-state-app-insights-config.mock.d.ts +0 -0
  405. /package/{lib/services/transfer-state-service/mocks → mocks/src}/transfer-state-launch-darkly-config.mock.d.ts +0 -0
  406. /package/{lib/pages → pages}/access-denied/access-denied.component.d.ts +0 -0
  407. /package/{lib/pages/index.d.ts → pages/public-api.d.ts} +0 -0
  408. /package/{lib/pages → pages}/routing/pages.routes.d.ts +0 -0
  409. /package/{lib/pages → pages}/sign-in/interfaces/index.d.ts +0 -0
  410. /package/{lib/pages → pages}/sign-in/interfaces/sign-in-stub-form.interface.d.ts +0 -0
  411. /package/{lib/pages → pages}/sign-in/sign-in-sso/sign-in-sso.component.d.ts +0 -0
  412. /package/{lib/pages → pages}/sign-in/sign-in-stub/sign-in-stub.component.d.ts +0 -0
  413. /package/{lib/resolvers → resolvers}/title/title.resolver.d.ts +0 -0
  414. /package/{lib/services → services}/app-initializer-service/app-initializer.service.d.ts +0 -0
  415. /package/{lib/services → services}/app-insights/app-insights.service.d.ts +0 -0
  416. /package/{lib/services → services}/auth-service/auth.service.d.ts +0 -0
  417. /package/{lib/services → services}/launch-darkly/launch-darkly.service.d.ts +0 -0
  418. /package/{lib/services → services}/sort-service/interfaces/sort-service.interface.d.ts +0 -0
  419. /package/{lib/services → services}/utils/utils.service.d.ts +0 -0
  420. /package/{lib/guards/types → types/src}/can-deactivate.type.d.ts +0 -0
  421. /package/{lib/validators → validators}/alphabetical-text/alphabetical-text.validator.d.ts +0 -0
  422. /package/{lib/validators → validators}/amount/amount.validator.d.ts +0 -0
  423. /package/{lib/validators → validators}/date-after-year/date-after-year.validator.d.ts +0 -0
  424. /package/{lib/validators → validators}/date-before/date-before.validator.d.ts +0 -0
  425. /package/{lib/validators → validators}/date-of-birth/date-of-birth.validator.d.ts +0 -0
  426. /package/{lib/validators → validators}/future-date/future-date.validator.d.ts +0 -0
  427. /package/{lib/validators → validators}/invalid-value/invalid-value.validator.d.ts +0 -0
  428. /package/{lib/validators → validators}/national-insurance-number/national-insurance-number.validator.d.ts +0 -0
  429. /package/{lib/validators → validators}/numerical-only/numerical-only.validator.d.ts +0 -0
  430. /package/{lib/validators → validators}/optional-max-length/optional-max-length.validator.d.ts +0 -0
  431. /package/{lib/validators → validators}/optional-valid-date/optional-valid-date.validator.d.ts +0 -0
  432. /package/{lib/validators → validators}/optional-valid-email-address/optional-valid-email-address.validator.d.ts +0 -0
  433. /package/{lib/validators → validators}/optional-valid-telephone/optional-valid-telephone.validator.d.ts +0 -0
  434. /package/{lib/validators → validators}/past-date/past-date.validator.d.ts +0 -0
  435. /package/{lib/validators → validators}/special-characters/special-characters.validator.d.ts +0 -0
  436. /package/{lib/validators → validators}/two-decimal-places/two-decimal-places.validator.d.ts +0 -0
  437. /package/{lib/validators → validators}/valid-value/valid-value.validator.d.ts +0 -0
@@ -0,0 +1,117 @@
1
+ import { AbstractFormBaseComponent } from '../abstract-form-base/abstract-form-base.component';
2
+ import { OnDestroy, OnInit } from '@angular/core';
3
+ import { IAbstractFormAliasBaseAliasControls } from './interfaces/abstract-form-alias-base-alias-controls.interface';
4
+ import { IAbstractFormArrayControlValidation } from '../interfaces/abstract-form-array-control-validation.interface';
5
+ import { IAbstractFormArrayControls } from '../interfaces/abstract-form-array-controls.interface';
6
+ import { FormArray, FormControl, ValidatorFn } from '@angular/forms';
7
+ import { IAbstractFormArrayControl } from '../interfaces/abstract-form-array-control.interface';
8
+ import * as i0 from "@angular/core";
9
+ export declare abstract class AbstractFormAliasBaseComponent extends AbstractFormBaseComponent implements OnInit, OnDestroy {
10
+ aliasControls: IAbstractFormAliasBaseAliasControls[];
11
+ aliasControlsValidation: IAbstractFormArrayControlValidation[];
12
+ aliasFields: string[];
13
+ /**
14
+ * Builds an array of form controls for the given form array.
15
+ *
16
+ * @param formControlCount - An array of numbers representing the number of form controls to create.
17
+ * @param formArrayName - The name of the form array.
18
+ * @param fieldNames - An array of field names.
19
+ * @param controlValidation - An array of control validation objects.
20
+ * @returns An array of form controls for the given form array.
21
+ */
22
+ private buildFormAliasControls;
23
+ /**
24
+ * Adds alias controls to the form array.
25
+ *
26
+ * @param index - The index of the form array.
27
+ * @param formArrayName - The name of the form array.
28
+ * @param fieldNames - The names of the fields for the alias controls.
29
+ * @param controlValidation - The validation rules for the alias controls.
30
+ * @returns An object containing the form controls.
31
+ */
32
+ private addAliasControls;
33
+ /**
34
+ * Removes all form alias controls from a FormArray and clears any associated error messages.
35
+ *
36
+ * @param formArrayControls - An array of form array controls.
37
+ * @param formArrayName - The name of the FormArray.
38
+ * @param fieldNames - An array of field names associated with the form array controls.
39
+ * @returns An empty array of form array controls.
40
+ */
41
+ private removeAllFormAliasControls;
42
+ /**
43
+ * Creates a FormArray with the specified validators and controls.
44
+ *
45
+ * @param validators - An array of validators to apply to the FormArray.
46
+ * @param controls - An optional array of initial FormControl instances to add to the FormArray.
47
+ * @returns A new FormArray instance.
48
+ */
49
+ protected createFormAlias(validators: ValidatorFn[], controls?: FormControl[]): FormArray;
50
+ /**
51
+ * Removes a form alias control at the specified index from the given form array controls.
52
+ *
53
+ * @param index - The index of the form alias control to remove.
54
+ * @param formArrayControls - The array of form array controls.
55
+ * @returns The updated array of form array controls after removing the specified control.
56
+ */
57
+ protected removeFormAliasControl(index: number, formArrayControls: IAbstractFormArrayControls[]): IAbstractFormArrayControls[];
58
+ /**
59
+ * Sets up the alias form controls based on the provided alias count array and form array name.
60
+ * If there are any aliases, the alias controls will be re-populated.
61
+ *
62
+ * @param aliasCountArray - An array containing the count of aliases.
63
+ * @param formArrayName - The name of the form array.
64
+ */
65
+ protected setupAliasFormControls(aliasCountArray: number[], formArrayName: string): void;
66
+ /**
67
+ * Removes the form alias controls errors for a specific index in a form array.
68
+ *
69
+ * @param index - The index of the form array control.
70
+ * @param formArrayControls - An array of form array controls.
71
+ * @param fieldNames - An array of field names to remove errors from.
72
+ */
73
+ protected removeFormAliasControlsErrors(index: number, formArrayControls: IAbstractFormArrayControls[], fieldNames: string[]): void;
74
+ /**
75
+ * Creates alias controls for the given fields and index.
76
+ * @param fields - The list of fields for which alias controls need to be created.
77
+ * @param index - The index value used to generate unique identifiers for the controls.
78
+ * @returns An object containing the alias controls.
79
+ */
80
+ protected createAliasControls(fields: string[], index: number): {
81
+ [key: string]: IAbstractFormArrayControl;
82
+ };
83
+ /**
84
+ * Sets up the alias checkbox listener.
85
+ *
86
+ * @param formCheckboxName - The name of the checkbox control in the form.
87
+ * @param formArrayName - The name of the form array control in the form.
88
+ */
89
+ protected setUpAliasCheckboxListener(formCheckboxName: string, formArrayName: string): void;
90
+ /**
91
+ * Removes a form alias control from a form array and updates the list of form array controls.
92
+ * @param index - The index of the form alias control to be removed.
93
+ * @param formArrayName - The name of the form array.
94
+ * @param formArrayControls - The list of form array controls.
95
+ * @param fieldNames - The names of the fields associated with the form array controls.
96
+ * @returns The updated list of form array controls after removing the specified control.
97
+ */
98
+ removeFormAliasControls(index: number, formArrayName: string, formArrayControls: IAbstractFormArrayControls[], fieldNames: string[]): IAbstractFormArrayControls[];
99
+ /**
100
+ * Adds an alias to the specified index of the form array.
101
+ *
102
+ * @param index - The index at which to add the alias.
103
+ * @param formArrayName - The name of the form array.
104
+ */
105
+ addAlias(index: number, formArrayName: string): void;
106
+ /**
107
+ * Removes an alias from the form array.
108
+ *
109
+ * @param index - The index of the alias to remove.
110
+ * @param formArrayName - The name of the form array.
111
+ */
112
+ removeAlias(index: number, formArrayName: string): void;
113
+ ngOnInit(): void;
114
+ ngOnDestroy(): void;
115
+ static ɵfac: i0.ɵɵFactoryDeclaration<AbstractFormAliasBaseComponent, never>;
116
+ static ɵcmp: i0.ɵɵComponentDeclaration<AbstractFormAliasBaseComponent, "ng-component", never, {}, {}, never, never, true, never>;
117
+ }
@@ -0,0 +1,4 @@
1
+ import { IAbstractFormArrayControl } from '../../interfaces/abstract-form-array-control.interface';
2
+ export interface IAbstractFormAliasBaseAliasControls {
3
+ [key: string]: IAbstractFormArrayControl;
4
+ }
@@ -0,0 +1,158 @@
1
+ import { OnDestroy, OnInit } from '@angular/core';
2
+ import { AbstractFormBaseComponent } from '../abstract-form-base/abstract-form-base.component';
3
+ import { IAbstractFormArrayControls } from '../interfaces/abstract-form-array-controls.interface';
4
+ import { IAbstractFormArrayControlValidation } from '../interfaces/abstract-form-array-control-validation.interface';
5
+ import { AbstractControl, FormArray, FormControl, FormGroup, ValidatorFn } from '@angular/forms';
6
+ import { IAbstractFormArrayControl } from '../interfaces/abstract-form-array-control.interface';
7
+ import * as i0 from "@angular/core";
8
+ export declare abstract class AbstractFormArrayBaseComponent extends AbstractFormBaseComponent implements OnInit, OnDestroy {
9
+ formArrayControls: IAbstractFormArrayControls[];
10
+ formArrayControlsValidation: IAbstractFormArrayControlValidation[];
11
+ formArrayFields: string[];
12
+ /**
13
+ * Builds an array of form controls for a form array.
14
+ *
15
+ * @param formControlCount - An array of numbers representing the number of form controls to create.
16
+ * @param formArrayName - The name of the form array.
17
+ * @param fieldNames - An array of field names for the form controls.
18
+ * @param controlValidation - An array of control validation configurations.
19
+ * @returns An array of form controls for the form array.
20
+ */
21
+ private buildFormArrayControls;
22
+ /**
23
+ * Adds form array controls to the specified form array.
24
+ *
25
+ * @param index - The index at which the form array controls should be added.
26
+ * @param formArrayName - The name of the form array.
27
+ * @param fieldNames - The names of the form controls to be created.
28
+ * @param controlValidation - The validation rules for the form controls.
29
+ * @returns An object containing the form controls that were added.
30
+ */
31
+ private addFormArrayControls;
32
+ /**
33
+ * Creates a new instance of FormArray with the specified validators and controls.
34
+ *
35
+ * @param validators - An array of validator functions to be applied to the form array.
36
+ * @param controls - An optional array of form controls to initialize the form array with.
37
+ * @returns A new instance of FormArray.
38
+ */
39
+ protected createFormArray(validators: ValidatorFn[], controls?: FormControl[]): FormArray;
40
+ /**
41
+ * Sets up the form array form controls based on the provided parameters.
42
+ *
43
+ * @param formArrayCountArray - An array of numbers representing the count of form array controls.
44
+ * @param formArrayName - The name of the form array.
45
+ */
46
+ protected setupFormArrayFormControls(formArrayCountArray: number[], formArrayName: string): void;
47
+ /**
48
+ * Creates an object with form array controls based on the given fields and index.
49
+ *
50
+ * @param fields - An array of field names.
51
+ * @param index - The index of the form array.
52
+ * @returns An object with form array controls.
53
+ */
54
+ protected createFormArrayControls(fields: string[], index: number): {
55
+ [key: string]: IAbstractFormArrayControl;
56
+ };
57
+ /**
58
+ * Removes form array controls errors for a specific index.
59
+ *
60
+ * @param index - The index of the form array control.
61
+ * @param formArrayControls - An array of form array controls.
62
+ * @param fieldNames - An array of field names to remove errors from.
63
+ */
64
+ protected removeFormArrayControlsErrors(index: number, formArrayControls: IAbstractFormArrayControls[], fieldNames: string[]): void;
65
+ /**
66
+ * Adds controls to the form array at the specified index.
67
+ *
68
+ * @param index - The index at which the controls should be added.
69
+ * @param formArrayName - The name of the form array.
70
+ */
71
+ addControlsToFormArray(index: number, formArrayName: string): void;
72
+ /**
73
+ * Removes a form array control at the specified index from the given array of form array controls.
74
+ *
75
+ * @param index - The index of the form array control to be removed.
76
+ * @param formArrayControls - The array of form array controls.
77
+ * @returns The updated array of form array controls after removing the specified control.
78
+ */
79
+ protected removeFormArrayControl(index: number, formArrayControls: IAbstractFormArrayControls[]): IAbstractFormArrayControls[];
80
+ /**
81
+ * Retrieves the value of a form control or returns a default value if the control is null or undefined.
82
+ *
83
+ * @param control - The form control to retrieve the value from.
84
+ * @param defaultValue - The default value to return if the control is null or undefined.
85
+ * @returns The value of the control if it exists, otherwise the default value.
86
+ */
87
+ protected getControlValueOrDefault(control: AbstractControl | null, defaultValue: any): any;
88
+ /**
89
+ * Removes a form array control at the specified index and updates the form array controls and errors.
90
+ *
91
+ * @param index - The index of the form array control to remove.
92
+ * @param formArrayName - The name of the form array.
93
+ * @param formArrayControls - The list of form array controls.
94
+ * @param fieldNames - The names of the fields associated with the form array controls.
95
+ * @returns The updated list of form array controls.
96
+ */
97
+ removeFormArrayControls(index: number, formArrayName: string, formArrayControls: IAbstractFormArrayControls[], fieldNames: string[]): IAbstractFormArrayControls[];
98
+ /**
99
+ * Removes controls from a form array at the specified index.
100
+ *
101
+ * @param index - The index at which to remove the controls.
102
+ * @param formArrayName - The name of the form array.
103
+ */
104
+ removeControlsFromFormArray(index: number, formArrayName: string): void;
105
+ /**
106
+ * Removes a form array control from the specified form array.
107
+ *
108
+ * @param formArrayControl - The form array control to remove.
109
+ * @param formArrayName - The name of the form array.
110
+ */
111
+ removeFormArrayControlFromArray(formArrayControl: IAbstractFormArrayControls, formArrayName: string): void;
112
+ /**
113
+ * Retrieves the FormGroup at the specified index from a FormArray.
114
+ *
115
+ * @param index - The index of the FormGroup to retrieve.
116
+ * @param formArrayName - The name of the FormArray.
117
+ * @returns The FormGroup at the specified index.
118
+ */
119
+ getFormArrayFormGroup(index: number, formArrayName: string): FormGroup;
120
+ /**
121
+ * Retrieves the FormControl from a FormGroup within a FormArray at the specified index.
122
+ *
123
+ * @param formGroup - The FormGroup containing the FormControl.
124
+ * @param controlName - The name of the FormControl.
125
+ * @param index - The index of the FormArray.
126
+ * @returns The FormControl at the specified index.
127
+ */
128
+ getFormArrayFormGroupControl(formGroup: FormGroup, controlName: string, index: number): FormControl;
129
+ /**
130
+ * Adds validators to a specific form control within a form array group.
131
+ *
132
+ * @param formGroup - The form group containing the form array.
133
+ * @param controlName - The name of the form control within the form array group.
134
+ * @param index - The index of the form array group within the form array.
135
+ * @param validators - An array of validator functions to be added to the form control.
136
+ */
137
+ addFormArrayFormGroupControlValidators(formControl: FormControl, validators: ValidatorFn[]): void;
138
+ /**
139
+ * Removes validators from a specific form control within a form array group.
140
+ * @param formGroup - The form group containing the form array.
141
+ * @param controlName - The name of the form control within the form array group.
142
+ * @param index - The index of the form array group within the form array.
143
+ */
144
+ removeFormArrayFormGroupControlValidators(formControl: FormControl): void;
145
+ /**
146
+ * Reverses the form array data by appending the index to each key in the objects.
147
+ *
148
+ * @param data - An array of objects containing form data.
149
+ * @returns An array of objects with keys modified to include their index in the original array.
150
+ */
151
+ addIndexToFormArrayData(data: any[]): {
152
+ [key: string]: any;
153
+ }[];
154
+ ngOnInit(): void;
155
+ ngOnDestroy(): void;
156
+ static ɵfac: i0.ɵɵFactoryDeclaration<AbstractFormArrayBaseComponent, never>;
157
+ static ɵcmp: i0.ɵɵComponentDeclaration<AbstractFormArrayBaseComponent, "ng-component", never, {}, {}, never, never, true, never>;
158
+ }
@@ -0,0 +1,13 @@
1
+ import { AbstractFormParentBaseComponent } from '../abstract-form-parent-base/abstract-form-parent-base.component';
2
+ export declare abstract class AbstractFormArrayParentBaseComponent extends AbstractFormParentBaseComponent {
3
+ /**
4
+ * Removes index suffixes from keys in an array of objects and restructures the data.
5
+ *
6
+ * This function takes an array of objects where keys have an index suffix (e.g., `key_0`, `key_1`),
7
+ * and returns a new array of objects where the keys are grouped by their base name without the index.
8
+ *
9
+ * @param data - The array of objects with indexed keys.
10
+ * @returns A new array of objects with keys grouped by their base name.
11
+ */
12
+ removeIndexFromFormArrayData(data: any[]): any[];
13
+ }
@@ -0,0 +1,44 @@
1
+ import { FormArray, FormGroup } from '@angular/forms';
2
+ import { IAbstractFormArrayRemovalBaseControlValue } from './interfaces/abstract-form-array-removal-base-control-value.interface';
3
+ import * as i0 from "@angular/core";
4
+ export declare abstract class AbstractFormArrayRemovalComponent {
5
+ private readonly router;
6
+ private readonly activatedRoute;
7
+ protected getFormArrayControlValue(formArray: FormArray, controlName: string, rowIndex: number, defaultValue: IAbstractFormArrayRemovalBaseControlValue[keyof IAbstractFormArrayRemovalBaseControlValue]): IAbstractFormArrayRemovalBaseControlValue[keyof IAbstractFormArrayRemovalBaseControlValue];
8
+ /**
9
+ * Removes a control from the given form array at the specified index and renumbers the remaining controls.
10
+ *
11
+ * @param formArray - The form array from which to remove the control.
12
+ * @param removeIndex - The index of the control to remove.
13
+ * @param fieldNames - The names of the fields associated with the controls.
14
+ * @param dynamicFieldPrefix - The prefix used for dynamically generated field names.
15
+ */
16
+ protected removeControlAndRenumber(formArray: FormArray, removeIndex: number, fieldNames: string[], dynamicFieldPrefix: string): void;
17
+ /**
18
+ * Renumber the controls in a FormArray starting from a specific index.
19
+ * This method updates the control keys of each FormGroup within the FormArray.
20
+ *
21
+ * @param formArray - The FormArray to renumber the controls for.
22
+ * @param startIndex - The index to start renumbering the controls from.
23
+ * @param fieldNames - The names of the fields in the FormGroup.
24
+ * @param dynamicFieldPrefix - The prefix to use for dynamic field names.
25
+ */
26
+ protected renumberControls(formArray: FormArray, startIndex: number, fieldNames: string[], dynamicFieldPrefix: string): void;
27
+ /**
28
+ * Updates the control keys in a form group based on the provided parameters.
29
+ * @param formGroup - The form group to update.
30
+ * @param index - The index of the form group within an array.
31
+ * @param fieldNames - An array of field names to update.
32
+ * @param dynamicFieldPrefix - The prefix to use for dynamic field keys.
33
+ */
34
+ protected updateControlKeys(formGroup: FormGroup, index: number, fieldNames: string[], dynamicFieldPrefix: string): void;
35
+ /**
36
+ * Handles route with the supplied route
37
+ *
38
+ * @param route string of route
39
+ * @param nonRelative boolean indicating if route is relative to the parent
40
+ */
41
+ handleRoute(route: string, nonRelative?: boolean, event?: Event): void;
42
+ static ɵfac: i0.ɵɵFactoryDeclaration<AbstractFormArrayRemovalComponent, never>;
43
+ static ɵcmp: i0.ɵɵComponentDeclaration<AbstractFormArrayRemovalComponent, "ng-component", never, {}, {}, never, never, true, never>;
44
+ }
@@ -0,0 +1,5 @@
1
+ export interface IAbstractFormArrayRemovalBaseControlValue {
2
+ stringValue: string;
3
+ numberValue: number;
4
+ nullValue: null;
5
+ }
@@ -0,0 +1,232 @@
1
+ import { EventEmitter, OnDestroy, OnInit } from '@angular/core';
2
+ import { FormControl, FormGroup, ValidatorFn } from '@angular/forms';
3
+ import { Subject } from 'rxjs';
4
+ import { IAbstractFormBaseFieldErrors } from './interfaces/abstract-form-base-field-errors.interface';
5
+ import { IAbstractFormBaseFormError } from './interfaces/abstract-form-base-form-error.interface';
6
+ import { IAbstractFormBaseFormErrorSummaryMessage } from '../interfaces/abstract-form-base-form-error-summary-message.interface';
7
+ import { IAbstractFormBaseForm } from './interfaces/abstract-form-base-form.interface';
8
+ import { IAbstractFormControlErrorMessage } from '../interfaces/abstract-form-control-error-message.interface';
9
+ import { IAbstractFormArrayControlValidation } from '../interfaces/abstract-form-array-control-validation.interface';
10
+ import { UtilsService } from '@hmcts/opal-frontend-common/services';
11
+ import * as i0 from "@angular/core";
12
+ export declare abstract class AbstractFormBaseComponent implements OnInit, OnDestroy {
13
+ protected unsavedChanges: EventEmitter<boolean>;
14
+ protected formSubmit: EventEmitter<IAbstractFormBaseForm<any>>;
15
+ private readonly changeDetectorRef;
16
+ private readonly router;
17
+ private readonly activatedRoute;
18
+ protected readonly utilsService: UtilsService;
19
+ form: FormGroup;
20
+ formControlErrorMessages: IAbstractFormControlErrorMessage;
21
+ formErrorSummaryMessage: IAbstractFormBaseFormErrorSummaryMessage[];
22
+ protected fieldErrors: IAbstractFormBaseFieldErrors;
23
+ protected formSubmitted: boolean;
24
+ protected readonly ngUnsubscribe: Subject<void>;
25
+ formErrors: IAbstractFormBaseFormError[];
26
+ constructor();
27
+ /**
28
+ * Scrolls to the label of the component and focuses on the field id
29
+ *
30
+ * @param fieldId - Field id of the component
31
+ */
32
+ private scroll;
33
+ /**
34
+ * Returns the highest priority form error from the given error keys and field errors.
35
+ * @param errorKeys - An array of error keys.
36
+ * @param fieldErrors - An object containing field errors.
37
+ * @returns The highest priority form error or null if no errors are found.
38
+ */
39
+ private getHighestPriorityError;
40
+ /**
41
+ * Retrieves the details of the highest priority form error for a given control path.
42
+ * @param controlPath - The path to the control in the form.
43
+ * @returns The details of the highest priority form error, or null if there are no errors.
44
+ */
45
+ private getFieldErrorDetails;
46
+ /**
47
+ * Retrieves all form errors from the provided form and its nested form groups.
48
+ *
49
+ * @param form - The form group to retrieve errors from.
50
+ * @param controlPath - An optional array representing the path to the current control within the form group.
51
+ * @returns An array of form errors, each containing the field ID, error message, priority, and type.
52
+ */
53
+ private getFormErrors;
54
+ /**
55
+ * Sets the error messages for the form controls and error summary based on the provided form errors.
56
+ * @param formErrors - An array of form errors containing field IDs and error messages.
57
+ */
58
+ private setErrorMessages;
59
+ /**
60
+ * Gets the indexes of the date fields to remove based on the form error summary message.
61
+ * @returns An array of indexes representing the date fields to remove.
62
+ */
63
+ private getDateFieldsToRemoveIndexes;
64
+ /**
65
+ * Returns an array of indices corresponding to the positions of the given field IDs in the form error summary message array.
66
+ *
67
+ * @param fieldIds - An array of field IDs to search for in the form error summary message array.
68
+ * @param formErrorSummaryMessage - An array of form error summary messages.
69
+ * @returns An array of indices corresponding to the positions of the field IDs in the form error summary message array.
70
+ */
71
+ private getFormErrorSummaryIndex;
72
+ /**
73
+ * Removes error summary messages from the given array based on the specified indexes.
74
+ *
75
+ * @param formErrorSummaryMessage - The array of error summary messages.
76
+ * @param indexes - The indexes of the error summary messages to be removed.
77
+ * @returns The updated array of error summary messages.
78
+ */
79
+ private removeErrorSummaryMessages;
80
+ /**
81
+ * Splits the form errors into two arrays based on the provided field IDs.
82
+ * Errors with field IDs included in the fieldIds array will be moved to the removedFormErrors array,
83
+ * while the remaining errors will be moved to the cleanFormErrors array.
84
+ *
85
+ * @param fieldIds - An array of field IDs to filter the form errors.
86
+ * @param formErrors - An array of form errors to be split.
87
+ * @returns An array containing two arrays: cleanFormErrors and removedFormErrors.
88
+ */
89
+ private splitFormErrors;
90
+ /**
91
+ * Manipulates the error message for specific fields in the formErrors array.
92
+ * @param fields - An array of field IDs to target for error message manipulation.
93
+ * @param messageOverride - The new error message to be used for the targeted fields.
94
+ * @param errorType - The type of error to match for the targeted fields.
95
+ * @param formErrors - An array of IFormError objects representing the form errors.
96
+ * @returns An array of IFormError objects with the manipulated error messages.
97
+ */
98
+ private manipulateFormErrorMessage;
99
+ /**
100
+ * Retrieves the form errors with the highest priority.
101
+ *
102
+ * @param formErrors - An array of form errors.
103
+ * @returns An array of form errors with the highest priority.
104
+ */
105
+ private getHighPriorityFormErrors;
106
+ /**
107
+ * Focuses on the error summary element and scrolls to the top of the page.
108
+ *
109
+ * This method first triggers change detection to ensure the view is up-to-date.
110
+ * It then selects the error summary element with the class 'govuk-error-summary'.
111
+ * If the error summary element is found, it sets focus on it without scrolling the page.
112
+ * Finally, it calls a utility service to scroll to the top of the page.
113
+ *
114
+ * @private
115
+ */
116
+ private focusAndScrollToErrorSummary;
117
+ /**
118
+ * Setup listener for the form value changes and to emit hasUnsavedChanges
119
+ */
120
+ private setupListener;
121
+ /**
122
+ * Adds controls to a form group.
123
+ *
124
+ * @param formGroup - The form group to add controls to.
125
+ * @param controls - An array of form array control validations.
126
+ * @param index - The index of the form array control.
127
+ */
128
+ protected addControlsToFormGroup(formGroup: FormGroup, controls: IAbstractFormArrayControlValidation[], index: number): void;
129
+ /**
130
+ * Creates a form control with the specified validators and initial value.
131
+ *
132
+ * @param validators - An array of validator functions.
133
+ * @param initialValue - The initial value for the form control. Defaults to null.
134
+ * @returns The created form control.
135
+ */
136
+ protected createFormControl(validators: ValidatorFn[], initialValue?: string | null): FormControl;
137
+ /**
138
+ * Handles the error messages and populates the relevant variables
139
+ */
140
+ protected handleErrorMessages(): void;
141
+ /**
142
+ * Checks whether the form has been touched and submitted
143
+ *
144
+ * @returns boolean
145
+ */
146
+ protected hasUnsavedChanges(): boolean;
147
+ /**
148
+ * Sets the value of a specified form control and marks it as touched.
149
+ *
150
+ * @param {string} value - The value to set for the form control.
151
+ * @param {string} control - The name of the form control to update.
152
+ */
153
+ protected setInputValue(value: string, control: string): void;
154
+ /**
155
+ * Handles the form errors for the date input fields.
156
+ * @param formErrors - An array of form errors.
157
+ * @returns An array of form errors with the manipulated error messages.
158
+ */
159
+ protected handleDateInputFormErrors(): IAbstractFormBaseFormError[];
160
+ /**
161
+ * Sets the initial error messages for the form controls.
162
+ *
163
+ * @param form - The FormGroup instance.
164
+ */
165
+ protected setInitialErrorMessages(): void;
166
+ /**
167
+ * Repopulates the search form with the data from the account enquiry search.
168
+ * @param state - The state object containing the search form data.
169
+ */
170
+ protected rePopulateForm(state: any): void;
171
+ /**
172
+ * Adds a new form control to the form group.
173
+ *
174
+ * @param controlName - The name of the control to add.
175
+ * @param validators - An array of validators to apply to the control.
176
+ */
177
+ protected createControl(controlName: string, validators: ValidatorFn[]): void;
178
+ /**
179
+ * Updates the validators of an existing form control.
180
+ *
181
+ * @param controlName - The name of the control to update.
182
+ * @param validators - An array of validators to apply to the control.
183
+ */
184
+ protected updateControl(controlName: string, validators: ValidatorFn[]): void;
185
+ /**
186
+ * Removes a control from the form.
187
+ *
188
+ * @param controlName - The name of the control to remove.
189
+ */
190
+ protected removeControl(controlName: string): void;
191
+ /**
192
+ * Removes the error message associated with the specified control name from the formControlErrorMessages object.
193
+ *
194
+ * @param controlName - The name of the control for which to remove the error message.
195
+ */
196
+ protected removeControlErrors(controlName: string): void;
197
+ /**
198
+ * Clears the search form.
199
+ */
200
+ handleClearForm(): void;
201
+ /**
202
+ * Handles the scroll of the component error from the summary
203
+ *
204
+ * @param fieldId - Field id of the component
205
+ */
206
+ scrollTo(fieldId: string): void;
207
+ /**
208
+ * Handles route with the supplied route
209
+ *
210
+ * @param route string of route
211
+ * @param nonRelative boolean indicating if route is relative to the parent
212
+ */
213
+ handleRoute(route: string, nonRelative?: boolean, event?: Event): void;
214
+ /**
215
+ * Handles the form submission event.
216
+ *
217
+ * @param event - The form submission event.
218
+ * @returns void
219
+ */
220
+ handleFormSubmit(event: SubmitEvent): void;
221
+ /**
222
+ * Handles the input event to convert all letters in the input value to uppercase.
223
+ * This method is triggered by an input event and modifies the input value directly.
224
+ *
225
+ * @param event - The input event triggered by the user.
226
+ */
227
+ handleUppercaseInputMask(event: Event): void;
228
+ ngOnInit(): void;
229
+ ngOnDestroy(): void;
230
+ static ɵfac: i0.ɵɵFactoryDeclaration<AbstractFormBaseComponent, never>;
231
+ static ɵcmp: i0.ɵɵComponentDeclaration<AbstractFormBaseComponent, "ng-component", never, {}, { "unsavedChanges": "unsavedChanges"; "formSubmit": "formSubmit"; }, never, never, true, never>;
232
+ }
@@ -0,0 +1,6 @@
1
+ export interface IAbstractFormBaseFieldError {
2
+ [key: string]: {
3
+ message: string;
4
+ priority: number;
5
+ };
6
+ }
@@ -0,0 +1,4 @@
1
+ import { IAbstractFormBaseFieldError } from './abstract-form-base-field-error.interface';
2
+ export interface IAbstractFormBaseFieldErrors {
3
+ [key: string]: IAbstractFormBaseFieldError;
4
+ }
@@ -0,0 +1,6 @@
1
+ export interface IAbstractFormBaseFormError {
2
+ fieldId: string;
3
+ message: string | null;
4
+ priority: number;
5
+ type: string | null;
6
+ }
@@ -0,0 +1,4 @@
1
+ export interface IAbstractFormBaseForm<T> {
2
+ formData: T;
3
+ nestedFlow: boolean;
4
+ }
@@ -0,0 +1,5 @@
1
+ export interface IAbstractFormBaseHighPriorityFormError {
2
+ message: string;
3
+ priority: number;
4
+ type: string;
5
+ }
@@ -0,0 +1,3 @@
1
+ export interface IAbstractFormBaseStatus {
2
+ [key: string]: string;
3
+ }
@@ -0,0 +1,29 @@
1
+ import { CanDeactivateTypes } from '@hmcts/opal-frontend-common/types';
2
+ export declare abstract class AbstractFormParentBaseComponent {
3
+ private readonly router;
4
+ private readonly activatedRoute;
5
+ stateUnsavedChanges: boolean;
6
+ /**
7
+ * If the user navigates externally from the site or closes the tab
8
+ * Check if there is unsaved changes form state -> warning message
9
+ * Otherwise -> no warning message
10
+ *
11
+ * @returns boolean
12
+ */
13
+ canDeactivate(): CanDeactivateTypes;
14
+ /**
15
+ * Navigates to the specified route using the Angular router.
16
+ *
17
+ * @param route - The route to navigate to.
18
+ */
19
+ protected routerNavigate(route: string, nonRelative?: boolean, event?: Event): void;
20
+ /**
21
+ * Checks if an object has any non-empty values.
22
+ *
23
+ * @param form - The object representing form data with key-value pairs.
24
+ * @returns A boolean indicating whether the object has any non-empty values.
25
+ */
26
+ protected hasFormValues(form: {
27
+ [key: string]: any;
28
+ }): boolean;
29
+ }