@hmcts/opal-frontend-common 0.0.109 → 0.0.110
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.
- package/fesm2022/hmcts-opal-frontend-common-access-denied.component-DuQgLlU6.mjs +57 -0
- package/fesm2022/hmcts-opal-frontend-common-account-created.component-DtlFlzU9.mjs +47 -0
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-account-summary-base.mjs +73 -81
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-creditor-details-base.mjs +71 -92
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-alias-base-interfaces.mjs +0 -4
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-alias-base.mjs +133 -233
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-array-base-interfaces.mjs +0 -4
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-array-base.mjs +123 -251
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-array-parent-base.mjs +24 -43
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-array-removal-base-interfaces.mjs +0 -4
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-array-removal-base.mjs +66 -94
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-base-interfaces.mjs +0 -4
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-base.mjs +340 -616
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-parent-base.mjs +25 -61
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-nested-form-base.mjs +88 -142
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-report-instances-table-base.mjs +48 -29
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-report-summary-list-base-constants.mjs +14 -19
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-report-summary-list-base-interfaces.mjs +0 -4
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-report-summary-list-base-types.mjs +0 -4
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-report-summary-list-base.mjs +144 -273
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-sortable-table-interfaces.mjs +0 -4
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-sortable-table-pagination.mjs +104 -129
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-sortable-table-types.mjs +0 -4
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-sortable-table.mjs +123 -204
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-tab-data.mjs +35 -121
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-table-filter-interfaces.mjs +0 -4
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-table-filter-types.mjs +0 -4
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-table-filter.mjs +111 -183
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-interfaces.mjs +0 -4
- package/fesm2022/hmcts-opal-frontend-common-components-alphagov-alphagov-accessible-autocomplete-interfaces.mjs +0 -4
- package/fesm2022/hmcts-opal-frontend-common-components-alphagov-alphagov-accessible-autocomplete.mjs +278 -275
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-accessible-monetary.mjs +66 -53
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-account-information-custom-account-information-item-custom-account-information-item-label.mjs +44 -21
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-account-information-custom-account-information-item-custom-account-information-item-value.mjs +44 -21
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-account-information-custom-account-information-item.mjs +54 -27
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-account-information.mjs +38 -17
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-action-links.mjs +70 -37
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-deferred-live-region-announcement.mjs +109 -119
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-horizontal-scroll-pane.mjs +38 -17
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-page-header.mjs +40 -17
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-scrollable-panes-custom-scrollable-panes-inner-pane.mjs +66 -27
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-scrollable-panes.mjs +44 -21
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-summary-metric-bar-custom-summary-metric-bar-item-custom-summary-metric-bar-item-label.mjs +54 -27
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-summary-metric-bar-custom-summary-metric-bar-item-custom-summary-metric-bar-item-value.mjs +54 -27
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-summary-metric-bar-custom-summary-metric-bar-item.mjs +67 -42
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-summary-metric-bar.mjs +40 -17
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-vertical-scroll-pane-custom-vertical-scroll-pane-inner-pane.mjs +66 -27
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-vertical-scroll-pane-custom-vertical-scroll-pane-outer-pane.mjs +42 -21
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-vertical-scroll-pane.mjs +36 -17
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-accordion.mjs +125 -119
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-back-link.mjs +46 -30
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-button.mjs +72 -39
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-cancel-link.mjs +54 -34
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-checkboxes-interfaces.mjs +0 -4
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-checkboxes.mjs +303 -134
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-date-input-interfaces.mjs +0 -4
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-date-input.mjs +163 -79
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-details.mjs +45 -21
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-error-summary.mjs +49 -33
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-footer-interfaces.mjs +0 -4
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-footer.mjs +42 -20
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-header-interfaces.mjs +0 -4
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-header.mjs +103 -41
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-heading-with-caption-types.mjs +0 -4
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-heading-with-caption.mjs +90 -39
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-inset-text.mjs +60 -26
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-list-govuk-list-link.mjs +53 -30
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-list.mjs +36 -17
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-notification-banner.mjs +75 -44
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-pagination.mjs +80 -85
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-panel.mjs +53 -25
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-radio-interfaces.mjs +0 -4
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-radio.mjs +397 -267
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-select-interfaces.mjs +0 -4
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-select.mjs +164 -80
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-summary-card-list.mjs +153 -85
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-summary-list.mjs +246 -121
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-table.mjs +224 -90
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-tabs-govuk-tabs-list-item.mjs +99 -76
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-tabs-govuk-tabs-panel.mjs +78 -51
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-tabs.mjs +79 -72
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-tag.mjs +55 -25
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-task-list.mjs +112 -46
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-text-area.mjs +185 -104
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-text-input-prefix-suffix.mjs +165 -95
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-text-input.mjs +151 -81
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-helpers.mjs +5 -16
- package/fesm2022/hmcts-opal-frontend-common-components-hod-hod-loading-spinner.mjs +65 -32
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-alert.mjs +396 -243
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-badge.mjs +55 -25
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-button-menu-moj-button-menu-item.mjs +53 -28
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-button-menu.mjs +92 -60
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-date-picker.mjs +216 -165
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-header.mjs +44 -21
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-option-moj-filter-panel-option-form-group-item.mjs +64 -42
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-option-moj-filter-panel-option-form-group-keyword.mjs +68 -47
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-option.mjs +52 -33
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-selected-moj-filter-panel-selected-tag.mjs +61 -40
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-selected.mjs +63 -42
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel.mjs +38 -17
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter.mjs +56 -34
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-header-interfaces.mjs +0 -4
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-header.mjs +100 -41
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-inset-text.mjs +62 -26
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-notification-badge.mjs +46 -21
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-page-header.mjs +47 -21
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-pagination.mjs +119 -164
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-primary-navigation.mjs +225 -172
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-sortable-table.mjs +355 -188
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-sub-navigation.mjs +152 -96
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-ticket-panel.mjs +61 -29
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-timeline.mjs +74 -26
- package/fesm2022/hmcts-opal-frontend-common-concurrency-failure.component-BqsP0gj2.mjs +41 -0
- package/fesm2022/hmcts-opal-frontend-common-constants.mjs +7 -13
- package/fesm2022/hmcts-opal-frontend-common-directives-capitalisation.mjs +55 -43
- package/fesm2022/hmcts-opal-frontend-common-directives-govuk-button.mjs +86 -60
- package/fesm2022/hmcts-opal-frontend-common-directives-moj-multi-select.mjs +184 -223
- package/fesm2022/hmcts-opal-frontend-common-directives-trim-leading-trailing-whitespace.mjs +56 -40
- package/fesm2022/hmcts-opal-frontend-common-guards-account.mjs +17 -37
- package/fesm2022/hmcts-opal-frontend-common-guards-auth.mjs +30 -41
- package/fesm2022/hmcts-opal-frontend-common-guards-business-unit-route-permissions.mjs +31 -90
- package/fesm2022/hmcts-opal-frontend-common-guards-can-deactivate-interfaces.mjs +0 -4
- package/fesm2022/hmcts-opal-frontend-common-guards-can-deactivate-types.mjs +0 -4
- package/fesm2022/hmcts-opal-frontend-common-guards-can-deactivate.mjs +3 -9
- package/fesm2022/hmcts-opal-frontend-common-guards-feature-flag.mjs +29 -64
- package/fesm2022/hmcts-opal-frontend-common-guards-has-flow-state.mjs +13 -20
- package/fesm2022/hmcts-opal-frontend-common-guards-has-url-state-match.mjs +19 -48
- package/fesm2022/hmcts-opal-frontend-common-guards-helpers.mjs +21 -54
- package/fesm2022/hmcts-opal-frontend-common-guards-route-permissions.mjs +20 -30
- package/fesm2022/hmcts-opal-frontend-common-guards-signed-in.mjs +13 -24
- package/fesm2022/hmcts-opal-frontend-common-guards-types.mjs +0 -4
- package/fesm2022/hmcts-opal-frontend-common-interceptors-content-digest.mjs +59 -107
- package/fesm2022/hmcts-opal-frontend-common-interceptors-http-error-constants.mjs +11 -17
- package/fesm2022/hmcts-opal-frontend-common-interceptors-http-error-interfaces.mjs +0 -4
- package/fesm2022/hmcts-opal-frontend-common-interceptors-http-error.mjs +74 -148
- package/fesm2022/hmcts-opal-frontend-common-interceptors-http-retry-constants.mjs +18 -13
- package/fesm2022/hmcts-opal-frontend-common-interceptors-http-retry-interfaces.mjs +0 -4
- package/fesm2022/hmcts-opal-frontend-common-interceptors-http-retry.mjs +65 -134
- package/fesm2022/hmcts-opal-frontend-common-internal-server-error.component-8EP_PgKk.mjs +55 -0
- package/fesm2022/hmcts-opal-frontend-common-pages-access-denied.component-DuQgLlU6.mjs +57 -0
- package/fesm2022/hmcts-opal-frontend-common-pages-account-created.component-DtlFlzU9.mjs +47 -0
- package/fesm2022/hmcts-opal-frontend-common-pages-concurrency-failure.component-BqsP0gj2.mjs +41 -0
- package/fesm2022/hmcts-opal-frontend-common-pages-dashboard-page-interfaces.mjs +0 -4
- package/fesm2022/hmcts-opal-frontend-common-pages-dashboard-page.mjs +112 -62
- package/fesm2022/hmcts-opal-frontend-common-pages-internal-server-error.component-8EP_PgKk.mjs +55 -0
- package/fesm2022/hmcts-opal-frontend-common-pages-permission-denied.component-B3EkD8uw.mjs +41 -0
- package/fesm2022/hmcts-opal-frontend-common-pages-routing-constants.mjs +22 -27
- package/fesm2022/hmcts-opal-frontend-common-pages-routing-interfaces.mjs +0 -4
- package/fesm2022/hmcts-opal-frontend-common-pages-sign-in-stub.component-CT2Bh7gD.mjs +127 -0
- package/fesm2022/hmcts-opal-frontend-common-pages-sign-in.component-BxpouMug.mjs +55 -0
- package/fesm2022/hmcts-opal-frontend-common-pages.mjs +51 -52
- package/fesm2022/hmcts-opal-frontend-common-permission-denied.component-B3EkD8uw.mjs +41 -0
- package/fesm2022/hmcts-opal-frontend-common-pipes-date-format.mjs +41 -28
- package/fesm2022/hmcts-opal-frontend-common-pipes-days-ago.mjs +43 -40
- package/fesm2022/hmcts-opal-frontend-common-pipes-monetary.mjs +43 -39
- package/fesm2022/hmcts-opal-frontend-common-pipes-national-insurance.mjs +41 -29
- package/fesm2022/hmcts-opal-frontend-common-resolvers-title.mjs +37 -25
- package/fesm2022/hmcts-opal-frontend-common-services-app-initializer-service.mjs +68 -91
- package/fesm2022/hmcts-opal-frontend-common-services-app-insights-service.mjs +74 -65
- package/fesm2022/hmcts-opal-frontend-common-services-auth-service-constants.mjs +6 -10
- package/fesm2022/hmcts-opal-frontend-common-services-auth-service-interfaces.mjs +0 -4
- package/fesm2022/hmcts-opal-frontend-common-services-auth-service.mjs +49 -42
- package/fesm2022/hmcts-opal-frontend-common-services-date-service-interfaces.mjs +0 -4
- package/fesm2022/hmcts-opal-frontend-common-services-date-service.mjs +118 -233
- package/fesm2022/hmcts-opal-frontend-common-services-history-transformation-service.mjs +185 -484
- package/fesm2022/hmcts-opal-frontend-common-services-launch-darkly-service-mocks.mjs +12 -11
- package/fesm2022/hmcts-opal-frontend-common-services-launch-darkly-service.mjs +77 -115
- package/fesm2022/hmcts-opal-frontend-common-services-opal-user-service-interfaces.mjs +0 -4
- package/fesm2022/hmcts-opal-frontend-common-services-opal-user-service-mocks.mjs +150 -159
- package/fesm2022/hmcts-opal-frontend-common-services-opal-user-service.mjs +119 -202
- package/fesm2022/hmcts-opal-frontend-common-services-permissions-service.mjs +47 -68
- package/fesm2022/hmcts-opal-frontend-common-services-session-service-constants.mjs +3 -9
- package/fesm2022/hmcts-opal-frontend-common-services-session-service-interfaces.mjs +0 -4
- package/fesm2022/hmcts-opal-frontend-common-services-session-service-mocks.mjs +4 -8
- package/fesm2022/hmcts-opal-frontend-common-services-session-service.mjs +50 -40
- package/fesm2022/hmcts-opal-frontend-common-services-sort-service-interfaces.mjs +0 -4
- package/fesm2022/hmcts-opal-frontend-common-services-sort-service.mjs +56 -96
- package/fesm2022/hmcts-opal-frontend-common-services-transfer-state-service-interfaces.mjs +0 -4
- package/fesm2022/hmcts-opal-frontend-common-services-transfer-state-service-mocks.mjs +19 -26
- package/fesm2022/hmcts-opal-frontend-common-services-transfer-state-service.mjs +71 -99
- package/fesm2022/hmcts-opal-frontend-common-services-transformation-service-constants.mjs +4 -8
- package/fesm2022/hmcts-opal-frontend-common-services-transformation-service-interfaces.mjs +0 -4
- package/fesm2022/hmcts-opal-frontend-common-services-transformation-service.mjs +65 -106
- package/fesm2022/hmcts-opal-frontend-common-services-utils-service.mjs +102 -193
- package/fesm2022/hmcts-opal-frontend-common-sign-in-stub.component-CT2Bh7gD.mjs +127 -0
- package/fesm2022/hmcts-opal-frontend-common-sign-in.component-Dz97ji3i.mjs +55 -0
- package/fesm2022/hmcts-opal-frontend-common-stores-global-constants.mjs +6 -10
- package/fesm2022/hmcts-opal-frontend-common-stores-global-interfaces.mjs +0 -4
- package/fesm2022/hmcts-opal-frontend-common-stores-global-types.mjs +0 -4
- package/fesm2022/hmcts-opal-frontend-common-stores-global.mjs +52 -57
- package/fesm2022/hmcts-opal-frontend-common-types.mjs +0 -4
- package/fesm2022/hmcts-opal-frontend-common-validators-amount.mjs +7 -18
- package/fesm2022/hmcts-opal-frontend-common-validators-date-after-year.mjs +8 -15
- package/fesm2022/hmcts-opal-frontend-common-validators-date-before.mjs +9 -18
- package/fesm2022/hmcts-opal-frontend-common-validators-date-of-birth.mjs +13 -21
- package/fesm2022/hmcts-opal-frontend-common-validators-future-date.mjs +9 -18
- package/fesm2022/hmcts-opal-frontend-common-validators-invalid-value.mjs +6 -12
- package/fesm2022/hmcts-opal-frontend-common-validators-national-insurance-number.mjs +9 -17
- package/fesm2022/hmcts-opal-frontend-common-validators-non-negative-value.mjs +10 -26
- package/fesm2022/hmcts-opal-frontend-common-validators-non-zero-value.mjs +10 -26
- package/fesm2022/hmcts-opal-frontend-common-validators-optional-max-length.mjs +7 -14
- package/fesm2022/hmcts-opal-frontend-common-validators-optional-valid-date.mjs +13 -26
- package/fesm2022/hmcts-opal-frontend-common-validators-optional-valid-telephone.mjs +12 -17
- package/fesm2022/hmcts-opal-frontend-common-validators-over-eighteen.mjs +19 -48
- package/fesm2022/hmcts-opal-frontend-common-validators-past-date.mjs +11 -19
- package/fesm2022/hmcts-opal-frontend-common-validators-pattern-validator.mjs +7 -26
- package/fesm2022/hmcts-opal-frontend-common-validators-valid-value.mjs +6 -12
- package/fesm2022/hmcts-opal-frontend-common.mjs +56 -76
- package/package.json +1 -1
- package/types/hmcts-opal-frontend-common-components-abstract-abstract-account-summary-base.d.ts +95 -104
- package/types/hmcts-opal-frontend-common-components-abstract-abstract-creditor-details-base.d.ts +75 -78
- package/types/hmcts-opal-frontend-common-components-abstract-abstract-form-alias-base-interfaces.d.ts +4 -7
- package/types/hmcts-opal-frontend-common-components-abstract-abstract-form-alias-base.d.ts +123 -126
- package/types/hmcts-opal-frontend-common-components-abstract-abstract-form-array-base-interfaces.d.ts +4 -7
- package/types/hmcts-opal-frontend-common-components-abstract-abstract-form-array-base.d.ts +156 -159
- package/types/hmcts-opal-frontend-common-components-abstract-abstract-form-array-parent-base.d.ts +13 -16
- package/types/hmcts-opal-frontend-common-components-abstract-abstract-form-array-removal-base-interfaces.d.ts +5 -7
- package/types/hmcts-opal-frontend-common-components-abstract-abstract-form-array-removal-base.d.ts +46 -50
- package/types/hmcts-opal-frontend-common-components-abstract-abstract-form-base-interfaces.d.ts +27 -35
- package/types/hmcts-opal-frontend-common-components-abstract-abstract-form-base.d.ts +323 -328
- package/types/hmcts-opal-frontend-common-components-abstract-abstract-form-parent-base.d.ts +33 -36
- package/types/hmcts-opal-frontend-common-components-abstract-abstract-nested-form-base.d.ts +75 -78
- package/types/hmcts-opal-frontend-common-components-abstract-abstract-report-instances-table-base.d.ts +15 -13
- package/types/hmcts-opal-frontend-common-components-abstract-abstract-report-summary-list-base-constants.d.ts +16 -19
- package/types/hmcts-opal-frontend-common-components-abstract-abstract-report-summary-list-base-interfaces.d.ts +23 -30
- package/types/hmcts-opal-frontend-common-components-abstract-abstract-report-summary-list-base-types.d.ts +1 -3
- package/types/hmcts-opal-frontend-common-components-abstract-abstract-report-summary-list-base.d.ts +179 -188
- package/types/hmcts-opal-frontend-common-components-abstract-abstract-sortable-table-interfaces.d.ts +6 -9
- package/types/hmcts-opal-frontend-common-components-abstract-abstract-sortable-table-pagination.d.ts +66 -66
- package/types/hmcts-opal-frontend-common-components-abstract-abstract-sortable-table-types.d.ts +2 -5
- package/types/hmcts-opal-frontend-common-components-abstract-abstract-sortable-table.d.ts +112 -113
- package/types/hmcts-opal-frontend-common-components-abstract-abstract-tab-data.d.ts +83 -86
- package/types/hmcts-opal-frontend-common-components-abstract-abstract-table-filter-interfaces.d.ts +12 -15
- package/types/hmcts-opal-frontend-common-components-abstract-abstract-table-filter-types.d.ts +1 -3
- package/types/hmcts-opal-frontend-common-components-abstract-abstract-table-filter.d.ts +113 -116
- package/types/hmcts-opal-frontend-common-components-abstract-interfaces.d.ts +16 -23
- package/types/hmcts-opal-frontend-common-components-alphagov-alphagov-accessible-autocomplete-interfaces.d.ts +4 -6
- package/types/hmcts-opal-frontend-common-components-alphagov-alphagov-accessible-autocomplete.d.ts +136 -95
- package/types/hmcts-opal-frontend-common-components-custom-custom-accessible-monetary.d.ts +35 -29
- package/types/hmcts-opal-frontend-common-components-custom-custom-account-information-custom-account-information-item-custom-account-information-item-label.d.ts +6 -9
- package/types/hmcts-opal-frontend-common-components-custom-custom-account-information-custom-account-information-item-custom-account-information-item-value.d.ts +6 -9
- package/types/hmcts-opal-frontend-common-components-custom-custom-account-information-custom-account-information-item.d.ts +12 -10
- package/types/hmcts-opal-frontend-common-components-custom-custom-account-information.d.ts +5 -8
- package/types/hmcts-opal-frontend-common-components-custom-custom-action-links.d.ts +18 -12
- package/types/hmcts-opal-frontend-common-components-custom-custom-deferred-live-region-announcement.d.ts +67 -57
- package/types/hmcts-opal-frontend-common-components-custom-custom-horizontal-scroll-pane.d.ts +5 -8
- package/types/hmcts-opal-frontend-common-components-custom-custom-page-header.d.ts +5 -8
- package/types/hmcts-opal-frontend-common-components-custom-custom-scrollable-panes-custom-scrollable-panes-inner-pane.d.ts +16 -10
- package/types/hmcts-opal-frontend-common-components-custom-custom-scrollable-panes.d.ts +11 -9
- package/types/hmcts-opal-frontend-common-components-custom-custom-summary-metric-bar-custom-summary-metric-bar-item-custom-summary-metric-bar-item-label.d.ts +12 -10
- package/types/hmcts-opal-frontend-common-components-custom-custom-summary-metric-bar-custom-summary-metric-bar-item-custom-summary-metric-bar-item-value.d.ts +12 -10
- package/types/hmcts-opal-frontend-common-components-custom-custom-summary-metric-bar-custom-summary-metric-bar-item.d.ts +26 -20
- package/types/hmcts-opal-frontend-common-components-custom-custom-summary-metric-bar.d.ts +5 -8
- package/types/hmcts-opal-frontend-common-components-custom-custom-vertical-scroll-pane-custom-vertical-scroll-pane-inner-pane.d.ts +16 -10
- package/types/hmcts-opal-frontend-common-components-custom-custom-vertical-scroll-pane-custom-vertical-scroll-pane-outer-pane.d.ts +11 -9
- package/types/hmcts-opal-frontend-common-components-custom-custom-vertical-scroll-pane.d.ts +5 -8
- package/types/hmcts-opal-frontend-common-components-govuk-govuk-accordion.d.ts +72 -64
- package/types/hmcts-opal-frontend-common-components-govuk-govuk-back-link.d.ts +16 -17
- package/types/hmcts-opal-frontend-common-components-govuk-govuk-button.d.ts +29 -17
- package/types/hmcts-opal-frontend-common-components-govuk-govuk-cancel-link.d.ts +22 -18
- package/types/hmcts-opal-frontend-common-components-govuk-govuk-checkboxes-interfaces.d.ts +14 -16
- package/types/hmcts-opal-frontend-common-components-govuk-govuk-checkboxes.d.ts +96 -43
- package/types/hmcts-opal-frontend-common-components-govuk-govuk-date-input-interfaces.d.ts +13 -15
- package/types/hmcts-opal-frontend-common-components-govuk-govuk-date-input.d.ts +75 -34
- package/types/hmcts-opal-frontend-common-components-govuk-govuk-details.d.ts +11 -9
- package/types/hmcts-opal-frontend-common-components-govuk-govuk-error-summary.d.ts +23 -19
- package/types/hmcts-opal-frontend-common-components-govuk-govuk-footer-interfaces.d.ts +5 -7
- package/types/hmcts-opal-frontend-common-components-govuk-govuk-footer.d.ts +14 -13
- package/types/hmcts-opal-frontend-common-components-govuk-govuk-header-interfaces.d.ts +4 -6
- package/types/hmcts-opal-frontend-common-components-govuk-govuk-header.d.ts +25 -23
- package/types/hmcts-opal-frontend-common-components-govuk-govuk-heading-with-caption-types.d.ts +1 -3
- package/types/hmcts-opal-frontend-common-components-govuk-govuk-heading-with-caption.d.ts +32 -14
- package/types/hmcts-opal-frontend-common-components-govuk-govuk-inset-text.d.ts +16 -10
- package/types/hmcts-opal-frontend-common-components-govuk-govuk-list-govuk-list-link.d.ts +16 -12
- package/types/hmcts-opal-frontend-common-components-govuk-govuk-list.d.ts +5 -8
- package/types/hmcts-opal-frontend-common-components-govuk-govuk-notification-banner.d.ts +37 -20
- package/types/hmcts-opal-frontend-common-components-govuk-govuk-pagination.d.ts +59 -47
- package/types/hmcts-opal-frontend-common-components-govuk-govuk-panel.d.ts +12 -10
- package/types/hmcts-opal-frontend-common-components-govuk-govuk-radio-interfaces.d.ts +17 -20
- package/types/hmcts-opal-frontend-common-components-govuk-govuk-radio.d.ts +162 -101
- package/types/hmcts-opal-frontend-common-components-govuk-govuk-select-interfaces.d.ts +4 -6
- package/types/hmcts-opal-frontend-common-components-govuk-govuk-select.d.ts +67 -26
- package/types/hmcts-opal-frontend-common-components-govuk-govuk-summary-card-list.d.ts +67 -35
- package/types/hmcts-opal-frontend-common-components-govuk-govuk-summary-list.d.ts +80 -47
- package/types/hmcts-opal-frontend-common-components-govuk-govuk-table.d.ts +47 -30
- package/types/hmcts-opal-frontend-common-components-govuk-govuk-tabs-govuk-tabs-list-item.d.ts +44 -34
- package/types/hmcts-opal-frontend-common-components-govuk-govuk-tabs-govuk-tabs-panel.d.ts +19 -17
- package/types/hmcts-opal-frontend-common-components-govuk-govuk-tabs.d.ts +44 -36
- package/types/hmcts-opal-frontend-common-components-govuk-govuk-tag.d.ts +16 -10
- package/types/hmcts-opal-frontend-common-components-govuk-govuk-task-list.d.ts +35 -17
- package/types/hmcts-opal-frontend-common-components-govuk-govuk-text-area.d.ts +83 -29
- package/types/hmcts-opal-frontend-common-components-govuk-govuk-text-input-prefix-suffix.d.ts +74 -28
- package/types/hmcts-opal-frontend-common-components-govuk-govuk-text-input.d.ts +65 -23
- package/types/hmcts-opal-frontend-common-components-govuk-helpers.d.ts +1 -3
- package/types/hmcts-opal-frontend-common-components-hod-hod-loading-spinner.d.ts +18 -12
- package/types/hmcts-opal-frontend-common-components-moj-moj-alert.d.ts +89 -69
- package/types/hmcts-opal-frontend-common-components-moj-moj-badge.d.ts +16 -10
- package/types/hmcts-opal-frontend-common-components-moj-moj-button-menu-moj-button-menu-item.d.ts +16 -12
- package/types/hmcts-opal-frontend-common-components-moj-moj-button-menu.d.ts +32 -26
- package/types/hmcts-opal-frontend-common-components-moj-moj-date-picker.d.ts +116 -60
- package/types/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-header.d.ts +11 -9
- package/types/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-option-moj-filter-panel-option-form-group-item.d.ts +33 -29
- package/types/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-option-moj-filter-panel-option-form-group-keyword.d.ts +34 -22
- package/types/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-option.d.ts +22 -18
- package/types/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-selected-moj-filter-panel-selected-tag.d.ts +32 -24
- package/types/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-selected.d.ts +29 -21
- package/types/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel.d.ts +5 -8
- package/types/hmcts-opal-frontend-common-components-moj-moj-filter.d.ts +23 -17
- package/types/hmcts-opal-frontend-common-components-moj-moj-header-interfaces.d.ts +4 -6
- package/types/hmcts-opal-frontend-common-components-moj-moj-header.d.ts +25 -23
- package/types/hmcts-opal-frontend-common-components-moj-moj-inset-text.d.ts +16 -10
- package/types/hmcts-opal-frontend-common-components-moj-moj-notification-badge.d.ts +11 -9
- package/types/hmcts-opal-frontend-common-components-moj-moj-page-header.d.ts +11 -9
- package/types/hmcts-opal-frontend-common-components-moj-moj-pagination.d.ts +99 -83
- package/types/hmcts-opal-frontend-common-components-moj-moj-primary-navigation.d.ts +102 -67
- package/types/hmcts-opal-frontend-common-components-moj-moj-sortable-table.d.ts +83 -51
- package/types/hmcts-opal-frontend-common-components-moj-moj-sub-navigation.d.ts +62 -42
- package/types/hmcts-opal-frontend-common-components-moj-moj-ticket-panel.d.ts +21 -11
- package/types/hmcts-opal-frontend-common-components-moj-moj-timeline.d.ts +8 -12
- package/types/hmcts-opal-frontend-common-constants.d.ts +20 -25
- package/types/hmcts-opal-frontend-common-directives-capitalisation.d.ts +17 -15
- package/types/hmcts-opal-frontend-common-directives-govuk-button.d.ts +33 -21
- package/types/hmcts-opal-frontend-common-directives-moj-multi-select.d.ts +92 -69
- package/types/hmcts-opal-frontend-common-directives-trim-leading-trailing-whitespace.d.ts +13 -11
- package/types/hmcts-opal-frontend-common-guards-account.d.ts +2 -5
- package/types/hmcts-opal-frontend-common-guards-auth.d.ts +4 -7
- package/types/hmcts-opal-frontend-common-guards-business-unit-route-permissions.d.ts +14 -19
- package/types/hmcts-opal-frontend-common-guards-can-deactivate-interfaces.d.ts +4 -7
- package/types/hmcts-opal-frontend-common-guards-can-deactivate-types.d.ts +3 -6
- package/types/hmcts-opal-frontend-common-guards-can-deactivate.d.ts +4 -8
- package/types/hmcts-opal-frontend-common-guards-feature-flag.d.ts +4 -7
- package/types/hmcts-opal-frontend-common-guards-has-flow-state.d.ts +2 -5
- package/types/hmcts-opal-frontend-common-guards-has-url-state-match.d.ts +2 -5
- package/types/hmcts-opal-frontend-common-guards-helpers.d.ts +8 -15
- package/types/hmcts-opal-frontend-common-guards-route-permissions.d.ts +2 -5
- package/types/hmcts-opal-frontend-common-guards-signed-in.d.ts +2 -5
- package/types/hmcts-opal-frontend-common-guards-types.d.ts +2 -5
- package/types/hmcts-opal-frontend-common-interceptors-content-digest.d.ts +2 -5
- package/types/hmcts-opal-frontend-common-interceptors-http-error-constants.d.ts +4 -9
- package/types/hmcts-opal-frontend-common-interceptors-http-error-interfaces.d.ts +9 -11
- package/types/hmcts-opal-frontend-common-interceptors-http-error.d.ts +2 -5
- package/types/hmcts-opal-frontend-common-interceptors-http-retry-constants.d.ts +5 -11
- package/types/hmcts-opal-frontend-common-interceptors-http-retry-interfaces.d.ts +7 -9
- package/types/hmcts-opal-frontend-common-interceptors-http-retry.d.ts +9 -15
- package/types/hmcts-opal-frontend-common-pages-dashboard-page-interfaces.d.ts +17 -21
- package/types/hmcts-opal-frontend-common-pages-dashboard-page.d.ts +89 -96
- package/types/hmcts-opal-frontend-common-pages-routing-constants.d.ts +3 -7
- package/types/hmcts-opal-frontend-common-pages-routing-interfaces.d.ts +24 -29
- package/types/hmcts-opal-frontend-common-pages.d.ts +2 -5
- package/types/hmcts-opal-frontend-common-pipes-date-format.d.ts +8 -11
- package/types/hmcts-opal-frontend-common-pipes-days-ago.d.ts +7 -10
- package/types/hmcts-opal-frontend-common-pipes-monetary.d.ts +8 -11
- package/types/hmcts-opal-frontend-common-pipes-national-insurance.d.ts +7 -10
- package/types/hmcts-opal-frontend-common-resolvers-title.d.ts +8 -11
- package/types/hmcts-opal-frontend-common-services-app-initializer-service.d.ts +37 -41
- package/types/hmcts-opal-frontend-common-services-app-insights-service.d.ts +14 -17
- package/types/hmcts-opal-frontend-common-services-auth-service-constants.d.ts +2 -5
- package/types/hmcts-opal-frontend-common-services-auth-service-interfaces.d.ts +6 -8
- package/types/hmcts-opal-frontend-common-services-auth-service.d.ts +8 -12
- package/types/hmcts-opal-frontend-common-services-date-service-interfaces.d.ts +7 -9
- package/types/hmcts-opal-frontend-common-services-date-service.d.ts +149 -153
- package/types/hmcts-opal-frontend-common-services-history-transformation-service.d.ts +104 -125
- package/types/hmcts-opal-frontend-common-services-launch-darkly-service-mocks.d.ts +13 -16
- package/types/hmcts-opal-frontend-common-services-launch-darkly-service.d.ts +46 -49
- package/types/hmcts-opal-frontend-common-services-opal-user-service-interfaces.d.ts +28 -36
- package/types/hmcts-opal-frontend-common-services-opal-user-service-mocks.d.ts +4 -9
- package/types/hmcts-opal-frontend-common-services-opal-user-service.d.ts +97 -104
- package/types/hmcts-opal-frontend-common-services-permissions-service.d.ts +33 -36
- package/types/hmcts-opal-frontend-common-services-session-service-constants.d.ts +2 -5
- package/types/hmcts-opal-frontend-common-services-session-service-interfaces.d.ts +6 -9
- package/types/hmcts-opal-frontend-common-services-session-service-mocks.d.ts +2 -5
- package/types/hmcts-opal-frontend-common-services-session-service.d.ts +17 -20
- package/types/hmcts-opal-frontend-common-services-sort-service-interfaces.d.ts +9 -13
- package/types/hmcts-opal-frontend-common-services-sort-service.d.ts +64 -67
- package/types/hmcts-opal-frontend-common-services-transfer-state-service-interfaces.d.ts +20 -26
- package/types/hmcts-opal-frontend-common-services-transfer-state-service-mocks.d.ts +11 -17
- package/types/hmcts-opal-frontend-common-services-transfer-state-service.d.ts +44 -47
- package/types/hmcts-opal-frontend-common-services-transformation-service-constants.d.ts +2 -5
- package/types/hmcts-opal-frontend-common-services-transformation-service-interfaces.d.ts +12 -14
- package/types/hmcts-opal-frontend-common-services-transformation-service.d.ts +41 -44
- package/types/hmcts-opal-frontend-common-services-utils-service.d.ts +111 -114
- package/types/hmcts-opal-frontend-common-stores-global-constants.d.ts +2 -5
- package/types/hmcts-opal-frontend-common-stores-global-interfaces.d.ts +6 -8
- package/types/hmcts-opal-frontend-common-stores-global-types.d.ts +2 -5
- package/types/hmcts-opal-frontend-common-stores-global.d.ts +52 -57
- package/types/hmcts-opal-frontend-common-types.d.ts +1 -3
- package/types/hmcts-opal-frontend-common-validators-amount.d.ts +2 -5
- package/types/hmcts-opal-frontend-common-validators-date-after-year.d.ts +2 -5
- package/types/hmcts-opal-frontend-common-validators-date-before.d.ts +2 -5
- package/types/hmcts-opal-frontend-common-validators-date-of-birth.d.ts +2 -5
- package/types/hmcts-opal-frontend-common-validators-future-date.d.ts +2 -5
- package/types/hmcts-opal-frontend-common-validators-invalid-value.d.ts +2 -5
- package/types/hmcts-opal-frontend-common-validators-national-insurance-number.d.ts +2 -5
- package/types/hmcts-opal-frontend-common-validators-non-negative-value.d.ts +2 -5
- package/types/hmcts-opal-frontend-common-validators-non-zero-value.d.ts +2 -5
- package/types/hmcts-opal-frontend-common-validators-optional-max-length.d.ts +2 -5
- package/types/hmcts-opal-frontend-common-validators-optional-valid-date.d.ts +2 -5
- package/types/hmcts-opal-frontend-common-validators-optional-valid-telephone.d.ts +2 -5
- package/types/hmcts-opal-frontend-common-validators-over-eighteen.d.ts +3 -6
- package/types/hmcts-opal-frontend-common-validators-past-date.d.ts +2 -5
- package/types/hmcts-opal-frontend-common-validators-pattern-validator.d.ts +2 -5
- package/types/hmcts-opal-frontend-common-validators-valid-value.d.ts +2 -5
- package/types/hmcts-opal-frontend-common.d.ts +23 -31
- package/fesm2022/hmcts-opal-frontend-common-access-denied.component-DeYZkvfj.mjs +0 -21
- package/fesm2022/hmcts-opal-frontend-common-account-created.component-DUd7qbuq.mjs +0 -15
- package/fesm2022/hmcts-opal-frontend-common-concurrency-failure.component-BfPeI980.mjs +0 -14
- package/fesm2022/hmcts-opal-frontend-common-internal-server-error.component-DzHlkMqq.mjs +0 -26
- package/fesm2022/hmcts-opal-frontend-common-pages-access-denied.component-DeYZkvfj.mjs +0 -21
- package/fesm2022/hmcts-opal-frontend-common-pages-account-created.component-DUd7qbuq.mjs +0 -15
- package/fesm2022/hmcts-opal-frontend-common-pages-concurrency-failure.component-BfPeI980.mjs +0 -14
- package/fesm2022/hmcts-opal-frontend-common-pages-internal-server-error.component-DzHlkMqq.mjs +0 -26
- package/fesm2022/hmcts-opal-frontend-common-pages-permission-denied.component-C28WmjEQ.mjs +0 -14
- package/fesm2022/hmcts-opal-frontend-common-pages-sign-in-stub.component-BKGzFqXC.mjs +0 -42
- package/fesm2022/hmcts-opal-frontend-common-pages-sign-in.component-DgVojWf0.mjs +0 -28
- package/fesm2022/hmcts-opal-frontend-common-permission-denied.component-C28WmjEQ.mjs +0 -14
- package/fesm2022/hmcts-opal-frontend-common-sign-in-stub.component-BKGzFqXC.mjs +0 -42
- package/fesm2022/hmcts-opal-frontend-common-sign-in.component-BZz2kmre.mjs +0 -28
|
@@ -1,338 +1,333 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { Subject } from
|
|
5
|
-
import {
|
|
6
|
-
import { UtilsService } from
|
|
7
|
-
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { EventEmitter, OnDestroy, OnInit } from "@angular/core";
|
|
3
|
+
import { FormControl, FormGroup, FormRecord, ValidatorFn } from "@angular/forms";
|
|
4
|
+
import { Subject } from "rxjs";
|
|
5
|
+
import { IAbstractFormArrayControlValidation, IAbstractFormBaseFormErrorSummaryMessage, IAbstractFormControlErrorMessage } from "@hmcts/opal-frontend-common/components/abstract/interfaces";
|
|
6
|
+
import { UtilsService } from "@hmcts/opal-frontend-common/services/utils-service";
|
|
8
7
|
interface IAbstractFormBaseFieldError {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
[key: string]: {
|
|
9
|
+
message: string;
|
|
10
|
+
priority: number;
|
|
11
|
+
};
|
|
13
12
|
}
|
|
14
|
-
|
|
15
13
|
interface IAbstractFormBaseFieldErrors {
|
|
16
|
-
|
|
14
|
+
[key: string]: IAbstractFormBaseFieldError;
|
|
17
15
|
}
|
|
18
|
-
|
|
19
16
|
interface IAbstractFormBaseFormError {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
fieldId: string;
|
|
18
|
+
message: string | null;
|
|
19
|
+
priority: number;
|
|
20
|
+
type: string | null;
|
|
24
21
|
}
|
|
25
|
-
|
|
26
22
|
interface IAbstractFormBaseForm<T> {
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
formData: T;
|
|
24
|
+
nestedFlow: boolean;
|
|
29
25
|
}
|
|
30
|
-
|
|
31
26
|
interface IAbstractFormBaseHandleRouteOptions {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
declare abstract class AbstractFormBaseComponent implements OnInit, OnDestroy {
|
|
39
|
-
private readonly changeDetectorRef;
|
|
40
|
-
private readonly router;
|
|
41
|
-
private readonly activatedRoute;
|
|
42
|
-
protected unsavedChanges: EventEmitter<boolean>;
|
|
43
|
-
protected formSubmit: EventEmitter<IAbstractFormBaseForm<any>>;
|
|
44
|
-
protected readonly utilsService: UtilsService;
|
|
45
|
-
protected fieldErrors: IAbstractFormBaseFieldErrors;
|
|
46
|
-
protected formSubmitted: boolean;
|
|
47
|
-
protected readonly ngUnsubscribe: Subject<void>;
|
|
48
|
-
form: FormGroup;
|
|
49
|
-
formControlErrorMessages: IAbstractFormControlErrorMessage;
|
|
50
|
-
formErrorSummaryMessage: IAbstractFormBaseFormErrorSummaryMessage[];
|
|
51
|
-
formErrors: IAbstractFormBaseFormError[];
|
|
52
|
-
constructor();
|
|
53
|
-
/**
|
|
54
|
-
* Scrolls to a specific form field and attempts to focus on it.
|
|
55
|
-
*
|
|
56
|
-
* This method locates the target field or its associated label/legend
|
|
57
|
-
* based on the provided `fieldId`. It ensures that the field or its
|
|
58
|
-
* nested focusable element is brought into view and focused, if possible.
|
|
59
|
-
*
|
|
60
|
-
* The scrolling behavior is smooth, and the method prioritizes the following
|
|
61
|
-
* elements in order:
|
|
62
|
-
* 1. A label associated with an autocomplete field (`label[for="${fieldId}-autocomplete"]`).
|
|
63
|
-
* 2. A regular label associated with the field (`label[for="${fieldId}"]`).
|
|
64
|
-
* 3. A legend within a fieldset associated with the field (`[id="${fieldId}"] .govuk-fieldset__legend`).
|
|
65
|
-
* 4. The field itself or its nested focusable element.
|
|
66
|
-
*
|
|
67
|
-
* @param fieldId - The ID of the form field to scroll to and focus on.
|
|
68
|
-
*/
|
|
69
|
-
private scroll;
|
|
70
|
-
/**
|
|
71
|
-
* Determines whether a given HTML element can receive focus.
|
|
72
|
-
*
|
|
73
|
-
* An element is considered focusable if:
|
|
74
|
-
* - It has a `tabIndex` greater than or equal to 0 and does not have the `disabled` attribute.
|
|
75
|
-
* - It is an anchor (`<a>`) element with a valid `href` attribute.
|
|
76
|
-
* - It is one of the following tags: `INPUT`, `SELECT`, `TEXTAREA`, or `BUTTON`,
|
|
77
|
-
* and it is not disabled.
|
|
78
|
-
*
|
|
79
|
-
* @param element - The HTML element to check for focusability.
|
|
80
|
-
* @returns `true` if the element can receive focus, otherwise `false`.
|
|
81
|
-
*/
|
|
82
|
-
private canReceiveFocus;
|
|
83
|
-
/**
|
|
84
|
-
* Returns the highest priority form error from the given error keys and field errors.
|
|
85
|
-
* @param errorKeys - An array of error keys.
|
|
86
|
-
* @param fieldErrors - An object containing field errors.
|
|
87
|
-
* @returns The highest priority form error or null if no errors are found.
|
|
88
|
-
*/
|
|
89
|
-
private getHighestPriorityError;
|
|
90
|
-
/**
|
|
91
|
-
* Retrieves the details of the highest priority form error for a given control path.
|
|
92
|
-
* @param controlPath - The path to the control in the form.
|
|
93
|
-
* @returns The details of the highest priority form error, or null if there are no errors.
|
|
94
|
-
*/
|
|
95
|
-
private getFieldErrorDetails;
|
|
96
|
-
/**
|
|
97
|
-
* Retrieves all form errors from the provided form and its nested form groups.
|
|
98
|
-
*
|
|
99
|
-
* @param form - The form group to retrieve errors from.
|
|
100
|
-
* @param controlPath - An optional array representing the path to the current control within the form group.
|
|
101
|
-
* @returns An array of form errors, each containing the field ID, error message, priority, and type.
|
|
102
|
-
*/
|
|
103
|
-
private getFormErrors;
|
|
104
|
-
/**
|
|
105
|
-
* Sets the error messages for the form controls and error summary based on the provided form errors.
|
|
106
|
-
* @param formErrors - An array of form errors containing field IDs and error messages.
|
|
107
|
-
*/
|
|
108
|
-
private setErrorMessages;
|
|
109
|
-
/**
|
|
110
|
-
* Gets the indexes of the date fields to remove based on the form error summary message.
|
|
111
|
-
* @returns An array of indexes representing the date fields to remove.
|
|
112
|
-
*/
|
|
113
|
-
private getDateFieldsToRemoveIndexes;
|
|
114
|
-
/**
|
|
115
|
-
* Returns an array of indices corresponding to the positions of the given field IDs in the form error summary message array.
|
|
116
|
-
*
|
|
117
|
-
* @param fieldIds - An array of field IDs to search for in the form error summary message array.
|
|
118
|
-
* @param formErrorSummaryMessage - An array of form error summary messages.
|
|
119
|
-
* @returns An array of indices corresponding to the positions of the field IDs in the form error summary message array.
|
|
120
|
-
*/
|
|
121
|
-
private getFormErrorSummaryIndex;
|
|
122
|
-
/**
|
|
123
|
-
* Removes error summary messages from the given array based on the specified indexes.
|
|
124
|
-
*
|
|
125
|
-
* @param formErrorSummaryMessage - The array of error summary messages.
|
|
126
|
-
* @param indexes - The indexes of the error summary messages to be removed.
|
|
127
|
-
* @returns The updated array of error summary messages.
|
|
128
|
-
*/
|
|
129
|
-
private removeErrorSummaryMessages;
|
|
130
|
-
/**
|
|
131
|
-
* Splits the form errors into two arrays based on the provided field IDs.
|
|
132
|
-
* Errors with field IDs included in the fieldIds array will be moved to the removedFormErrors array,
|
|
133
|
-
* while the remaining errors will be moved to the cleanFormErrors array.
|
|
134
|
-
*
|
|
135
|
-
* @param fieldIds - An array of field IDs to filter the form errors.
|
|
136
|
-
* @param formErrors - An array of form errors to be split.
|
|
137
|
-
* @returns An array containing two arrays: cleanFormErrors and removedFormErrors.
|
|
138
|
-
*/
|
|
139
|
-
private splitFormErrors;
|
|
140
|
-
/**
|
|
141
|
-
* Manipulates the error message for specific fields in the formErrors array.
|
|
142
|
-
* @param fields - An array of field IDs to target for error message manipulation.
|
|
143
|
-
* @param messageOverride - The new error message to be used for the targeted fields.
|
|
144
|
-
* @param errorType - The type of error to match for the targeted fields.
|
|
145
|
-
* @param formErrors - An array of IFormError objects representing the form errors.
|
|
146
|
-
* @returns An array of IFormError objects with the manipulated error messages.
|
|
147
|
-
*/
|
|
148
|
-
private manipulateFormErrorMessage;
|
|
149
|
-
/**
|
|
150
|
-
* Retrieves the form errors with the highest priority.
|
|
151
|
-
*
|
|
152
|
-
* @param formErrors - An array of form errors.
|
|
153
|
-
* @returns An array of form errors with the highest priority.
|
|
154
|
-
*/
|
|
155
|
-
private getHighPriorityFormErrors;
|
|
156
|
-
/**
|
|
157
|
-
* Focuses on the error summary element and scrolls to the top of the page.
|
|
158
|
-
*
|
|
159
|
-
* This method first triggers change detection to ensure the view is up-to-date.
|
|
160
|
-
* It then selects the error summary element with the class 'govuk-error-summary'.
|
|
161
|
-
* If the error summary element is found, it sets focus on it without scrolling the page.
|
|
162
|
-
* Finally, it calls a utility service to scroll to the top of the page.
|
|
163
|
-
*
|
|
164
|
-
* @private
|
|
165
|
-
*/
|
|
166
|
-
private focusAndScrollToErrorSummary;
|
|
167
|
-
/**
|
|
168
|
-
* Setup listener for the form value changes and to emit hasUnsavedChanges
|
|
169
|
-
*/
|
|
170
|
-
private setupListener;
|
|
171
|
-
/**
|
|
172
|
-
* Adds controls to a form group.
|
|
173
|
-
*
|
|
174
|
-
* @param formGroup - The form group to add controls to.
|
|
175
|
-
* @param controls - An array of form array control validations.
|
|
176
|
-
* @param index - The index of the form array control.
|
|
177
|
-
*/
|
|
178
|
-
protected addControlsToFormGroup(formGroup: FormGroup, controls: IAbstractFormArrayControlValidation[], index: number): void;
|
|
179
|
-
/**
|
|
180
|
-
* Creates a form control with the specified validators and initial value.
|
|
181
|
-
*
|
|
182
|
-
* @param validators - An array of validator functions.
|
|
183
|
-
* @param initialValue - The initial value for the form control. Defaults to null.
|
|
184
|
-
* @returns The created form control.
|
|
185
|
-
*/
|
|
186
|
-
protected createFormControl(validators: ValidatorFn[], initialValue?: string | null): FormControl;
|
|
187
|
-
/**
|
|
188
|
-
* Handles the error messages and populates the relevant variables
|
|
189
|
-
*/
|
|
190
|
-
protected handleErrorMessages(): void;
|
|
191
|
-
/**
|
|
192
|
-
* Checks whether the form has been touched and submitted
|
|
193
|
-
*
|
|
194
|
-
* @returns boolean
|
|
195
|
-
*/
|
|
196
|
-
protected hasUnsavedChanges(): boolean;
|
|
197
|
-
/**
|
|
198
|
-
* Sets the value of a form control specified by its path and marks it as touched.
|
|
199
|
-
*
|
|
200
|
-
* @param value - The value to set for the form control.
|
|
201
|
-
* @param controlPath - The dot-delimited path to the form control within the form group.
|
|
202
|
-
*/
|
|
203
|
-
protected setInputValue(value: string, controlPath: string): void;
|
|
204
|
-
/**
|
|
205
|
-
* Handles the form errors for the date input fields.
|
|
206
|
-
* @param formErrors - An array of form errors.
|
|
207
|
-
* @returns An array of form errors with the manipulated error messages.
|
|
208
|
-
*/
|
|
209
|
-
protected handleDateInputFormErrors(): IAbstractFormBaseFormError[];
|
|
210
|
-
/**
|
|
211
|
-
* Sets the initial error messages for the form controls.
|
|
212
|
-
*
|
|
213
|
-
* @param form - The FormGroup instance.
|
|
214
|
-
*/
|
|
215
|
-
protected setInitialErrorMessages(): void;
|
|
216
|
-
/**
|
|
217
|
-
* Repopulates the search form with the data from the account enquiry search.
|
|
218
|
-
* @param state - The state object containing the search form data.
|
|
219
|
-
*/
|
|
220
|
-
protected rePopulateForm(state: any): void;
|
|
221
|
-
/**
|
|
222
|
-
* Adds a new form control to the form group.
|
|
223
|
-
*
|
|
224
|
-
* @param controlName - The name of the control to add.
|
|
225
|
-
* @param validators - An array of validators to apply to the control.
|
|
226
|
-
*/
|
|
227
|
-
protected createControl(controlName: string, validators: ValidatorFn[]): void;
|
|
228
|
-
/**
|
|
229
|
-
* Updates the validators of an existing form control.
|
|
230
|
-
*
|
|
231
|
-
* @param controlName - The name of the control to update.
|
|
232
|
-
* @param validators - An array of validators to apply to the control.
|
|
233
|
-
*/
|
|
234
|
-
protected updateControl(controlName: string, validators: ValidatorFn[]): void;
|
|
235
|
-
/**
|
|
236
|
-
* Removes a control from the form.
|
|
237
|
-
*
|
|
238
|
-
* @param controlName - The name of the control to remove.
|
|
239
|
-
*/
|
|
240
|
-
protected removeControl(controlName: string): void;
|
|
241
|
-
/**
|
|
242
|
-
* Removes the error message associated with the specified control name from the formControlErrorMessages object.
|
|
243
|
-
*
|
|
244
|
-
* @param controlName - The name of the control for which to remove the error message.
|
|
245
|
-
*/
|
|
246
|
-
protected removeControlErrors(controlName: string): void;
|
|
247
|
-
/**
|
|
248
|
-
* Clears all error messages from the form.
|
|
249
|
-
*/
|
|
250
|
-
protected clearAllErrorMessages(): void;
|
|
251
|
-
/**
|
|
252
|
-
* Create a plain object from a FormRecord of FormControls.
|
|
253
|
-
*
|
|
254
|
-
* What it does: copies each control's current value onto a plain object.
|
|
255
|
-
* When to use: when you need the raw values from a FormRecord (e.g. to send to an API).
|
|
256
|
-
*
|
|
257
|
-
* Example
|
|
258
|
-
* -------
|
|
259
|
-
* // record: FormRecord<FormControl<string | null>> with a single control 'firstName'
|
|
260
|
-
* const out = this.objectFromFormRecord(record, {
|
|
261
|
-
* mapKey: k => k, // optional (defaults to identity)
|
|
262
|
-
* mapValue: v => v ?? '' // turn null/undefined into ''
|
|
263
|
-
* });
|
|
264
|
-
* // out -> { firstName: '' }
|
|
265
|
-
*
|
|
266
|
-
* @typeParam T - Control value type.
|
|
267
|
-
* @typeParam U - Output value type (defaults to T).
|
|
268
|
-
* @typeParam K - Output key type (defaults to string). Control names are strings; provide `mapKey` if you need numbers.
|
|
269
|
-
*/
|
|
270
|
-
protected objectFromFormRecord<T, U = T, K extends string | number = string>(controlRecord: FormRecord<FormControl<T | null | undefined>>, options?: {
|
|
271
|
-
mapKey?: (key: string) => K;
|
|
272
|
-
mapValue?: (value: T | null | undefined) => U;
|
|
273
|
-
}): Record<K, U>;
|
|
274
|
-
/**
|
|
275
|
-
* Patch a FormRecord of FormControls from a plain object.
|
|
276
|
-
*
|
|
277
|
-
* What it does: for each entry in `values`, finds the matching control by name
|
|
278
|
-
* (optionally mapped via `mapKey`) and sets its value **only if** it changes.
|
|
279
|
-
* When to use: when you need to patch many controls at once, without
|
|
280
|
-
* triggering extra updates for unchanged values.
|
|
281
|
-
*
|
|
282
|
-
* Example
|
|
283
|
-
* -------
|
|
284
|
-
* // controlRecord: FormRecord<FormControl<string>> with controls 'firstName', 'lastName'
|
|
285
|
-
* this.patchFormRecordFromObject(controlRecord, { firstName: 'Ada', lastName: 'Lovelace' }, {
|
|
286
|
-
* emitEvent: true,
|
|
287
|
-
* isEqual: (a, b) => a === b,
|
|
288
|
-
* // mapKey: k => `ctrl_${k as string}` // optional: map incoming keys to control names
|
|
289
|
-
* });
|
|
290
|
-
*
|
|
291
|
-
* @typeParam T - Control value type.
|
|
292
|
-
* @typeParam K - Keys present in the `values` object (string or number).
|
|
293
|
-
*/
|
|
294
|
-
protected patchFormRecordFromObject<T, K extends string | number = string>(controlRecord: FormRecord<FormControl<T>>, values: Record<K, T>, options?: {
|
|
295
|
-
emitEvent?: boolean;
|
|
296
|
-
/** How provided keys map to control names (defaults to String(key)). */
|
|
297
|
-
mapKey?: (key: K) => string;
|
|
298
|
-
/** Equality check used to avoid unnecessary writes (defaults to Object.is). */
|
|
299
|
-
isEqual?: (a: T, b: T) => boolean;
|
|
300
|
-
}): void;
|
|
301
|
-
/**
|
|
302
|
-
* Clears the search form.
|
|
303
|
-
*/
|
|
304
|
-
handleClearForm(): void;
|
|
305
|
-
/**
|
|
306
|
-
* Handles the scroll of the component error from the summary
|
|
307
|
-
*
|
|
308
|
-
* @param fieldId - Field id of the component
|
|
309
|
-
*/
|
|
310
|
-
scrollTo(fieldId: string): void;
|
|
311
|
-
/**
|
|
312
|
-
* Handles route with the supplied route
|
|
313
|
-
*
|
|
314
|
-
* @param route string of route
|
|
315
|
-
* @param options optional parameters
|
|
316
|
-
*/
|
|
317
|
-
handleRoute(route: string, options?: IAbstractFormBaseHandleRouteOptions): void;
|
|
318
|
-
/**
|
|
319
|
-
* Handles the form submission event.
|
|
320
|
-
*
|
|
321
|
-
* @param event - The form submission event.
|
|
322
|
-
* @returns void
|
|
323
|
-
*/
|
|
324
|
-
handleFormSubmit(event: SubmitEvent): void;
|
|
325
|
-
/**
|
|
326
|
-
* Handles the input event to convert all letters in the input value to uppercase.
|
|
327
|
-
* This method is triggered by an input event and modifies the input value directly.
|
|
328
|
-
*
|
|
329
|
-
* @param event - The input event triggered by the user.
|
|
330
|
-
*/
|
|
331
|
-
handleUppercaseInputMask(event: Event): void;
|
|
332
|
-
ngOnInit(): void;
|
|
333
|
-
ngOnDestroy(): void;
|
|
334
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<AbstractFormBaseComponent, never>;
|
|
335
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<AbstractFormBaseComponent, "ng-component", never, {}, { "unsavedChanges": "unsavedChanges"; "formSubmit": "formSubmit"; }, never, never, true, never>;
|
|
27
|
+
nonRelative?: boolean;
|
|
28
|
+
event?: Event;
|
|
29
|
+
routeData?: any;
|
|
30
|
+
fragment?: string;
|
|
336
31
|
}
|
|
337
|
-
|
|
338
|
-
|
|
32
|
+
export declare abstract class AbstractFormBaseComponent implements OnInit, OnDestroy {
|
|
33
|
+
private readonly changeDetectorRef;
|
|
34
|
+
private readonly router;
|
|
35
|
+
private readonly activatedRoute;
|
|
36
|
+
protected unsavedChanges: EventEmitter<boolean>;
|
|
37
|
+
protected formSubmit: EventEmitter<IAbstractFormBaseForm<any>>;
|
|
38
|
+
protected readonly utilsService: UtilsService;
|
|
39
|
+
protected fieldErrors: IAbstractFormBaseFieldErrors;
|
|
40
|
+
protected formSubmitted: boolean;
|
|
41
|
+
protected readonly ngUnsubscribe: Subject<void>;
|
|
42
|
+
form: FormGroup;
|
|
43
|
+
formControlErrorMessages: IAbstractFormControlErrorMessage;
|
|
44
|
+
formErrorSummaryMessage: IAbstractFormBaseFormErrorSummaryMessage[];
|
|
45
|
+
formErrors: IAbstractFormBaseFormError[];
|
|
46
|
+
constructor();
|
|
47
|
+
/**
|
|
48
|
+
* Scrolls to a specific form field and attempts to focus on it.
|
|
49
|
+
*
|
|
50
|
+
* This method locates the target field or its associated label/legend
|
|
51
|
+
* based on the provided `fieldId`. It ensures that the field or its
|
|
52
|
+
* nested focusable element is brought into view and focused, if possible.
|
|
53
|
+
*
|
|
54
|
+
* The scrolling behavior is smooth, and the method prioritizes the following
|
|
55
|
+
* elements in order:
|
|
56
|
+
* 1. A label associated with an autocomplete field (`label[for="${fieldId}-autocomplete"]`).
|
|
57
|
+
* 2. A regular label associated with the field (`label[for="${fieldId}"]`).
|
|
58
|
+
* 3. A legend within a fieldset associated with the field (`[id="${fieldId}"] .govuk-fieldset__legend`).
|
|
59
|
+
* 4. The field itself or its nested focusable element.
|
|
60
|
+
*
|
|
61
|
+
* @param fieldId - The ID of the form field to scroll to and focus on.
|
|
62
|
+
*/
|
|
63
|
+
private scroll;
|
|
64
|
+
/**
|
|
65
|
+
* Determines whether a given HTML element can receive focus.
|
|
66
|
+
*
|
|
67
|
+
* An element is considered focusable if:
|
|
68
|
+
* - It has a `tabIndex` greater than or equal to 0 and does not have the `disabled` attribute.
|
|
69
|
+
* - It is an anchor (`<a>`) element with a valid `href` attribute.
|
|
70
|
+
* - It is one of the following tags: `INPUT`, `SELECT`, `TEXTAREA`, or `BUTTON`,
|
|
71
|
+
* and it is not disabled.
|
|
72
|
+
*
|
|
73
|
+
* @param element - The HTML element to check for focusability.
|
|
74
|
+
* @returns `true` if the element can receive focus, otherwise `false`.
|
|
75
|
+
*/
|
|
76
|
+
private canReceiveFocus;
|
|
77
|
+
/**
|
|
78
|
+
* Returns the highest priority form error from the given error keys and field errors.
|
|
79
|
+
* @param errorKeys - An array of error keys.
|
|
80
|
+
* @param fieldErrors - An object containing field errors.
|
|
81
|
+
* @returns The highest priority form error or null if no errors are found.
|
|
82
|
+
*/
|
|
83
|
+
private getHighestPriorityError;
|
|
84
|
+
/**
|
|
85
|
+
* Retrieves the details of the highest priority form error for a given control path.
|
|
86
|
+
* @param controlPath - The path to the control in the form.
|
|
87
|
+
* @returns The details of the highest priority form error, or null if there are no errors.
|
|
88
|
+
*/
|
|
89
|
+
private getFieldErrorDetails;
|
|
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
|
+
private getFormErrors;
|
|
98
|
+
/**
|
|
99
|
+
* Sets the error messages for the form controls and error summary based on the provided form errors.
|
|
100
|
+
* @param formErrors - An array of form errors containing field IDs and error messages.
|
|
101
|
+
*/
|
|
102
|
+
private setErrorMessages;
|
|
103
|
+
/**
|
|
104
|
+
* Gets the indexes of the date fields to remove based on the form error summary message.
|
|
105
|
+
* @returns An array of indexes representing the date fields to remove.
|
|
106
|
+
*/
|
|
107
|
+
private getDateFieldsToRemoveIndexes;
|
|
108
|
+
/**
|
|
109
|
+
* Returns an array of indices corresponding to the positions of the given field IDs in the form error summary message array.
|
|
110
|
+
*
|
|
111
|
+
* @param fieldIds - An array of field IDs to search for in the form error summary message array.
|
|
112
|
+
* @param formErrorSummaryMessage - An array of form error summary messages.
|
|
113
|
+
* @returns An array of indices corresponding to the positions of the field IDs in the form error summary message array.
|
|
114
|
+
*/
|
|
115
|
+
private getFormErrorSummaryIndex;
|
|
116
|
+
/**
|
|
117
|
+
* Removes error summary messages from the given array based on the specified indexes.
|
|
118
|
+
*
|
|
119
|
+
* @param formErrorSummaryMessage - The array of error summary messages.
|
|
120
|
+
* @param indexes - The indexes of the error summary messages to be removed.
|
|
121
|
+
* @returns The updated array of error summary messages.
|
|
122
|
+
*/
|
|
123
|
+
private removeErrorSummaryMessages;
|
|
124
|
+
/**
|
|
125
|
+
* Splits the form errors into two arrays based on the provided field IDs.
|
|
126
|
+
* Errors with field IDs included in the fieldIds array will be moved to the removedFormErrors array,
|
|
127
|
+
* while the remaining errors will be moved to the cleanFormErrors array.
|
|
128
|
+
*
|
|
129
|
+
* @param fieldIds - An array of field IDs to filter the form errors.
|
|
130
|
+
* @param formErrors - An array of form errors to be split.
|
|
131
|
+
* @returns An array containing two arrays: cleanFormErrors and removedFormErrors.
|
|
132
|
+
*/
|
|
133
|
+
private splitFormErrors;
|
|
134
|
+
/**
|
|
135
|
+
* Manipulates the error message for specific fields in the formErrors array.
|
|
136
|
+
* @param fields - An array of field IDs to target for error message manipulation.
|
|
137
|
+
* @param messageOverride - The new error message to be used for the targeted fields.
|
|
138
|
+
* @param errorType - The type of error to match for the targeted fields.
|
|
139
|
+
* @param formErrors - An array of IFormError objects representing the form errors.
|
|
140
|
+
* @returns An array of IFormError objects with the manipulated error messages.
|
|
141
|
+
*/
|
|
142
|
+
private manipulateFormErrorMessage;
|
|
143
|
+
/**
|
|
144
|
+
* Retrieves the form errors with the highest priority.
|
|
145
|
+
*
|
|
146
|
+
* @param formErrors - An array of form errors.
|
|
147
|
+
* @returns An array of form errors with the highest priority.
|
|
148
|
+
*/
|
|
149
|
+
private getHighPriorityFormErrors;
|
|
150
|
+
/**
|
|
151
|
+
* Focuses on the error summary element and scrolls to the top of the page.
|
|
152
|
+
*
|
|
153
|
+
* This method first triggers change detection to ensure the view is up-to-date.
|
|
154
|
+
* It then selects the error summary element with the class 'govuk-error-summary'.
|
|
155
|
+
* If the error summary element is found, it sets focus on it without scrolling the page.
|
|
156
|
+
* Finally, it calls a utility service to scroll to the top of the page.
|
|
157
|
+
*
|
|
158
|
+
* @private
|
|
159
|
+
*/
|
|
160
|
+
private focusAndScrollToErrorSummary;
|
|
161
|
+
/**
|
|
162
|
+
* Setup listener for the form value changes and to emit hasUnsavedChanges
|
|
163
|
+
*/
|
|
164
|
+
private setupListener;
|
|
165
|
+
/**
|
|
166
|
+
* Adds controls to a form group.
|
|
167
|
+
*
|
|
168
|
+
* @param formGroup - The form group to add controls to.
|
|
169
|
+
* @param controls - An array of form array control validations.
|
|
170
|
+
* @param index - The index of the form array control.
|
|
171
|
+
*/
|
|
172
|
+
protected addControlsToFormGroup(formGroup: FormGroup, controls: IAbstractFormArrayControlValidation[], index: number): void;
|
|
173
|
+
/**
|
|
174
|
+
* Creates a form control with the specified validators and initial value.
|
|
175
|
+
*
|
|
176
|
+
* @param validators - An array of validator functions.
|
|
177
|
+
* @param initialValue - The initial value for the form control. Defaults to null.
|
|
178
|
+
* @returns The created form control.
|
|
179
|
+
*/
|
|
180
|
+
protected createFormControl(validators: ValidatorFn[], initialValue?: string | null): FormControl;
|
|
181
|
+
/**
|
|
182
|
+
* Handles the error messages and populates the relevant variables
|
|
183
|
+
*/
|
|
184
|
+
protected handleErrorMessages(): void;
|
|
185
|
+
/**
|
|
186
|
+
* Checks whether the form has been touched and submitted
|
|
187
|
+
*
|
|
188
|
+
* @returns boolean
|
|
189
|
+
*/
|
|
190
|
+
protected hasUnsavedChanges(): boolean;
|
|
191
|
+
/**
|
|
192
|
+
* Sets the value of a form control specified by its path and marks it as touched.
|
|
193
|
+
*
|
|
194
|
+
* @param value - The value to set for the form control.
|
|
195
|
+
* @param controlPath - The dot-delimited path to the form control within the form group.
|
|
196
|
+
*/
|
|
197
|
+
protected setInputValue(value: string, controlPath: string): void;
|
|
198
|
+
/**
|
|
199
|
+
* Handles the form errors for the date input fields.
|
|
200
|
+
* @param formErrors - An array of form errors.
|
|
201
|
+
* @returns An array of form errors with the manipulated error messages.
|
|
202
|
+
*/
|
|
203
|
+
protected handleDateInputFormErrors(): IAbstractFormBaseFormError[];
|
|
204
|
+
/**
|
|
205
|
+
* Sets the initial error messages for the form controls.
|
|
206
|
+
*
|
|
207
|
+
* @param form - The FormGroup instance.
|
|
208
|
+
*/
|
|
209
|
+
protected setInitialErrorMessages(): void;
|
|
210
|
+
/**
|
|
211
|
+
* Repopulates the search form with the data from the account enquiry search.
|
|
212
|
+
* @param state - The state object containing the search form data.
|
|
213
|
+
*/
|
|
214
|
+
protected rePopulateForm(state: any): void;
|
|
215
|
+
/**
|
|
216
|
+
* Adds a new form control to the form group.
|
|
217
|
+
*
|
|
218
|
+
* @param controlName - The name of the control to add.
|
|
219
|
+
* @param validators - An array of validators to apply to the control.
|
|
220
|
+
*/
|
|
221
|
+
protected createControl(controlName: string, validators: ValidatorFn[]): void;
|
|
222
|
+
/**
|
|
223
|
+
* Updates the validators of an existing form control.
|
|
224
|
+
*
|
|
225
|
+
* @param controlName - The name of the control to update.
|
|
226
|
+
* @param validators - An array of validators to apply to the control.
|
|
227
|
+
*/
|
|
228
|
+
protected updateControl(controlName: string, validators: ValidatorFn[]): void;
|
|
229
|
+
/**
|
|
230
|
+
* Removes a control from the form.
|
|
231
|
+
*
|
|
232
|
+
* @param controlName - The name of the control to remove.
|
|
233
|
+
*/
|
|
234
|
+
protected removeControl(controlName: string): void;
|
|
235
|
+
/**
|
|
236
|
+
* Removes the error message associated with the specified control name from the formControlErrorMessages object.
|
|
237
|
+
*
|
|
238
|
+
* @param controlName - The name of the control for which to remove the error message.
|
|
239
|
+
*/
|
|
240
|
+
protected removeControlErrors(controlName: string): void;
|
|
241
|
+
/**
|
|
242
|
+
* Clears all error messages from the form.
|
|
243
|
+
*/
|
|
244
|
+
protected clearAllErrorMessages(): void;
|
|
245
|
+
/**
|
|
246
|
+
* Create a plain object from a FormRecord of FormControls.
|
|
247
|
+
*
|
|
248
|
+
* What it does: copies each control's current value onto a plain object.
|
|
249
|
+
* When to use: when you need the raw values from a FormRecord (e.g. to send to an API).
|
|
250
|
+
*
|
|
251
|
+
* Example
|
|
252
|
+
* -------
|
|
253
|
+
* // record: FormRecord<FormControl<string | null>> with a single control 'firstName'
|
|
254
|
+
* const out = this.objectFromFormRecord(record, {
|
|
255
|
+
* mapKey: k => k, // optional (defaults to identity)
|
|
256
|
+
* mapValue: v => v ?? '' // turn null/undefined into ''
|
|
257
|
+
* });
|
|
258
|
+
* // out -> { firstName: '' }
|
|
259
|
+
*
|
|
260
|
+
* @typeParam T - Control value type.
|
|
261
|
+
* @typeParam U - Output value type (defaults to T).
|
|
262
|
+
* @typeParam K - Output key type (defaults to string). Control names are strings; provide `mapKey` if you need numbers.
|
|
263
|
+
*/
|
|
264
|
+
protected objectFromFormRecord<T, U = T, K extends string | number = string>(controlRecord: FormRecord<FormControl<T | null | undefined>>, options?: {
|
|
265
|
+
mapKey?: (key: string) => K;
|
|
266
|
+
mapValue?: (value: T | null | undefined) => U;
|
|
267
|
+
}): Record<K, U>;
|
|
268
|
+
/**
|
|
269
|
+
* Patch a FormRecord of FormControls from a plain object.
|
|
270
|
+
*
|
|
271
|
+
* What it does: for each entry in `values`, finds the matching control by name
|
|
272
|
+
* (optionally mapped via `mapKey`) and sets its value **only if** it changes.
|
|
273
|
+
* When to use: when you need to patch many controls at once, without
|
|
274
|
+
* triggering extra updates for unchanged values.
|
|
275
|
+
*
|
|
276
|
+
* Example
|
|
277
|
+
* -------
|
|
278
|
+
* // controlRecord: FormRecord<FormControl<string>> with controls 'firstName', 'lastName'
|
|
279
|
+
* this.patchFormRecordFromObject(controlRecord, { firstName: 'Ada', lastName: 'Lovelace' }, {
|
|
280
|
+
* emitEvent: true,
|
|
281
|
+
* isEqual: (a, b) => a === b,
|
|
282
|
+
* // mapKey: k => `ctrl_${k as string}` // optional: map incoming keys to control names
|
|
283
|
+
* });
|
|
284
|
+
*
|
|
285
|
+
* @typeParam T - Control value type.
|
|
286
|
+
* @typeParam K - Keys present in the `values` object (string or number).
|
|
287
|
+
*/
|
|
288
|
+
protected patchFormRecordFromObject<T, K extends string | number = string>(controlRecord: FormRecord<FormControl<T>>, values: Record<K, T>, options?: {
|
|
289
|
+
emitEvent?: boolean;
|
|
290
|
+
/** How provided keys map to control names (defaults to String(key)). */
|
|
291
|
+
mapKey?: (key: K) => string;
|
|
292
|
+
/** Equality check used to avoid unnecessary writes (defaults to Object.is). */
|
|
293
|
+
isEqual?: (a: T, b: T) => boolean;
|
|
294
|
+
}): void;
|
|
295
|
+
/**
|
|
296
|
+
* Clears the search form.
|
|
297
|
+
*/
|
|
298
|
+
handleClearForm(): void;
|
|
299
|
+
/**
|
|
300
|
+
* Handles the scroll of the component error from the summary
|
|
301
|
+
*
|
|
302
|
+
* @param fieldId - Field id of the component
|
|
303
|
+
*/
|
|
304
|
+
scrollTo(fieldId: string): void;
|
|
305
|
+
/**
|
|
306
|
+
* Handles route with the supplied route
|
|
307
|
+
*
|
|
308
|
+
* @param route string of route
|
|
309
|
+
* @param options optional parameters
|
|
310
|
+
*/
|
|
311
|
+
handleRoute(route: string, options?: IAbstractFormBaseHandleRouteOptions): void;
|
|
312
|
+
/**
|
|
313
|
+
* Handles the form submission event.
|
|
314
|
+
*
|
|
315
|
+
* @param event - The form submission event.
|
|
316
|
+
* @returns void
|
|
317
|
+
*/
|
|
318
|
+
handleFormSubmit(event: SubmitEvent): void;
|
|
319
|
+
/**
|
|
320
|
+
* Handles the input event to convert all letters in the input value to uppercase.
|
|
321
|
+
* This method is triggered by an input event and modifies the input value directly.
|
|
322
|
+
*
|
|
323
|
+
* @param event - The input event triggered by the user.
|
|
324
|
+
*/
|
|
325
|
+
handleUppercaseInputMask(event: Event): void;
|
|
326
|
+
ngOnInit(): void;
|
|
327
|
+
ngOnDestroy(): void;
|
|
328
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AbstractFormBaseComponent, never>;
|
|
329
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AbstractFormBaseComponent, "ng-component", never, {}, {
|
|
330
|
+
"unsavedChanges": "unsavedChanges";
|
|
331
|
+
"formSubmit": "formSubmit";
|
|
332
|
+
}, never, never, true, never>;
|
|
333
|
+
}
|