@hmcts/opal-frontend-common 0.0.108 → 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 -263
- 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 +3 -3
- 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 -93
- 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-BDTGvQ4J.mjs +0 -21
- package/fesm2022/hmcts-opal-frontend-common-account-created.component-6jzTqXSI.mjs +0 -15
- package/fesm2022/hmcts-opal-frontend-common-concurrency-failure.component-D43W-peK.mjs +0 -14
- package/fesm2022/hmcts-opal-frontend-common-internal-server-error.component-DftC2eY-.mjs +0 -26
- package/fesm2022/hmcts-opal-frontend-common-pages-access-denied.component-BDTGvQ4J.mjs +0 -21
- package/fesm2022/hmcts-opal-frontend-common-pages-account-created.component-6jzTqXSI.mjs +0 -15
- package/fesm2022/hmcts-opal-frontend-common-pages-concurrency-failure.component-D43W-peK.mjs +0 -14
- package/fesm2022/hmcts-opal-frontend-common-pages-internal-server-error.component-DftC2eY-.mjs +0 -26
- package/fesm2022/hmcts-opal-frontend-common-pages-permission-denied.component-CNGPX5k_.mjs +0 -14
- package/fesm2022/hmcts-opal-frontend-common-pages-sign-in-stub.component-BIgTV7f1.mjs +0 -42
- package/fesm2022/hmcts-opal-frontend-common-pages-sign-in.component-0pu6fIcO.mjs +0 -28
- package/fesm2022/hmcts-opal-frontend-common-permission-denied.component-CNGPX5k_.mjs +0 -14
- package/fesm2022/hmcts-opal-frontend-common-sign-in-stub.component-BIgTV7f1.mjs +0 -42
- package/fesm2022/hmcts-opal-frontend-common-sign-in.component-BxUlQIYI.mjs +0 -28
|
@@ -1,525 +1,226 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import { Injectable } from
|
|
3
|
-
import { DateService } from
|
|
4
|
-
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { Injectable } from "@angular/core";
|
|
3
|
+
import { DateService } from "@hmcts/opal-frontend-common/services/date-service";
|
|
5
4
|
const HISTORY_DETAILS_PATTERNS = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
keyNormalise: /[\s_-]/g,
|
|
6
|
+
snakeCaseBoundary: /([a-z])([A-Z])/g,
|
|
7
|
+
snakeCaseSeparator: /[\s-]/g,
|
|
8
|
+
transactionTypeSpace: /\s+/g
|
|
10
9
|
};
|
|
11
|
-
|
|
12
10
|
const HISTORY_DETAILS_DATE_SERVICE = new DateService();
|
|
13
|
-
/**
|
|
14
|
-
* Transforms a raw history item into the configured structured details model.
|
|
15
|
-
*
|
|
16
|
-
* @param item - The raw history item.
|
|
17
|
-
* @param config - The domain-specific transformation configuration.
|
|
18
|
-
* @returns The transformed details model.
|
|
19
|
-
*/
|
|
20
11
|
function transformHistoryDetails(item, config) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Transforms raw history items while preserving the rest of each item.
|
|
27
|
-
*
|
|
28
|
-
* @param items - The raw history items.
|
|
29
|
-
* @param config - The domain-specific transformation configuration.
|
|
30
|
-
* @returns The items with transformed structured details.
|
|
31
|
-
*/
|
|
12
|
+
const itemType = normaliseHistoryKey(getHistoryString(item, config.historyItemTypeAliases, config.aliasPathPrefixes, config.emptyValues));
|
|
13
|
+
const transformer = itemType ? config.transformers[itemType] : null;
|
|
14
|
+
return transformer ? transformer(item) : transformHistoryFallbackDetails(item, config);
|
|
15
|
+
}
|
|
32
16
|
function transformHistoryItems(items, config) {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Builds fallback details from configured fallback fields when no transformer matches.
|
|
40
|
-
*
|
|
41
|
-
* @param item - The raw history item.
|
|
42
|
-
* @param config - The domain-specific transformation configuration.
|
|
43
|
-
* @returns The fallback structured details model.
|
|
44
|
-
*/
|
|
17
|
+
return items.map((item) => ({
|
|
18
|
+
...item,
|
|
19
|
+
details: transformHistoryDetails(item, config)
|
|
20
|
+
}));
|
|
21
|
+
}
|
|
45
22
|
function transformHistoryFallbackDetails(item, config) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
getHistoryString(item, config.historyItemTypeAliases, config.aliasPathPrefixes, config.emptyValues)),
|
|
49
|
-
]);
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Creates a details object and normalises an empty secondary line to null.
|
|
53
|
-
*
|
|
54
|
-
* @param line1Parts - The primary line parts.
|
|
55
|
-
* @param line2Parts - The secondary line parts.
|
|
56
|
-
* @returns The structured details object.
|
|
57
|
-
*/
|
|
23
|
+
return createHistoryDetails([createHistoryTextPart(getHistoryString(item, config.fallbackAliases, config.aliasPathPrefixes, config.emptyValues) ?? getHistoryString(item, config.historyItemTypeAliases, config.aliasPathPrefixes, config.emptyValues))]);
|
|
24
|
+
}
|
|
58
25
|
function createHistoryDetails(line1Parts, line2Parts = []) {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Creates a details part after removing empty fragments.
|
|
68
|
-
*
|
|
69
|
-
* @param fragments - The fragments for the part.
|
|
70
|
-
* @returns The details part or null when no fragments are visible.
|
|
71
|
-
*/
|
|
26
|
+
const line1 = line1Parts.filter(isPresentPart);
|
|
27
|
+
const line2 = line2Parts.filter(isPresentPart);
|
|
28
|
+
return {
|
|
29
|
+
line1,
|
|
30
|
+
line2: line2.length ? line2 : null
|
|
31
|
+
};
|
|
32
|
+
}
|
|
72
33
|
function createHistoryDetailsPart(fragments) {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Creates a text-only details part.
|
|
78
|
-
*
|
|
79
|
-
* @param text - The part text.
|
|
80
|
-
* @returns The details part or null when text is empty.
|
|
81
|
-
*/
|
|
34
|
+
const visibleFragments = fragments.filter(({ text }) => text.length > 0);
|
|
35
|
+
return visibleFragments.length ? { fragments: visibleFragments } : null;
|
|
36
|
+
}
|
|
82
37
|
function createHistoryTextPart(text) {
|
|
83
|
-
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Creates a details part containing a bold label and plain value.
|
|
87
|
-
*
|
|
88
|
-
* @param label - The label text.
|
|
89
|
-
* @param value - The value text.
|
|
90
|
-
* @returns The labelled details part or null when value is empty.
|
|
91
|
-
*/
|
|
38
|
+
return text ? createHistoryDetailsPart([createHistoryFragment(text)]) : null;
|
|
39
|
+
}
|
|
92
40
|
function createHistoryLabelValuePart(label, value) {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
: null;
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Creates a text fragment with default styling flags.
|
|
99
|
-
*
|
|
100
|
-
* @param text - The fragment text.
|
|
101
|
-
* @param options - Optional fragment styling and link metadata.
|
|
102
|
-
* @returns The details fragment.
|
|
103
|
-
*/
|
|
41
|
+
return value ? createHistoryDetailsPart([createHistoryFragment(label, { bold: true }), createHistoryFragment(value)]) : null;
|
|
42
|
+
}
|
|
104
43
|
function createHistoryFragment(text, options = {}) {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* Creates link metadata for a details fragment.
|
|
114
|
-
*
|
|
115
|
-
* @param type - The link type emitted by the UI.
|
|
116
|
-
* @param emit - The emitted linked entity identifier.
|
|
117
|
-
* @returns The fragment link metadata.
|
|
118
|
-
*/
|
|
44
|
+
return {
|
|
45
|
+
text,
|
|
46
|
+
bold: options.bold ?? false,
|
|
47
|
+
hyphen: options.hyphen ?? false,
|
|
48
|
+
...options.link ? { link: options.link } : {}
|
|
49
|
+
};
|
|
50
|
+
}
|
|
119
51
|
function createHistoryLink(type, emit) {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
* @param item - The raw history item.
|
|
126
|
-
* @param aliases - The candidate field aliases.
|
|
127
|
-
* @param aliasPathPrefixes - The prefixes used for unqualified aliases.
|
|
128
|
-
* @param emptyValues - Values that should be treated as empty.
|
|
129
|
-
* @returns The string value or null.
|
|
130
|
-
*/
|
|
52
|
+
return {
|
|
53
|
+
type,
|
|
54
|
+
emit
|
|
55
|
+
};
|
|
56
|
+
}
|
|
131
57
|
function getHistoryString(item, aliases, aliasPathPrefixes, emptyValues) {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
return String(value);
|
|
137
|
-
}
|
|
138
|
-
/**
|
|
139
|
-
* Reads the first non-empty value from candidate aliases.
|
|
140
|
-
*
|
|
141
|
-
* @param item - The raw history item.
|
|
142
|
-
* @param aliases - The candidate field aliases.
|
|
143
|
-
* @param aliasPathPrefixes - The prefixes used for unqualified aliases.
|
|
144
|
-
* @param emptyValues - Values that should be treated as empty.
|
|
145
|
-
* @returns The matched value or null.
|
|
146
|
-
*/
|
|
58
|
+
const value = getHistoryValue(item, aliases, aliasPathPrefixes, emptyValues);
|
|
59
|
+
if (isHistoryEmptyValue(value, emptyValues) || isHistoryRecord(value)) return null;
|
|
60
|
+
return String(value);
|
|
61
|
+
}
|
|
147
62
|
function getHistoryValue(item, aliases, aliasPathPrefixes, emptyValues) {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
return null;
|
|
157
|
-
}
|
|
158
|
-
/**
|
|
159
|
-
* Expands an alias into candidate dot-notated paths.
|
|
160
|
-
*
|
|
161
|
-
* @param alias - The field alias.
|
|
162
|
-
* @param aliasPathPrefixes - The prefixes used for unqualified aliases.
|
|
163
|
-
* @returns The candidate paths.
|
|
164
|
-
*/
|
|
63
|
+
for (const alias of aliases) for (const path of getHistoryAliasPaths(alias, aliasPathPrefixes)) {
|
|
64
|
+
const value = getHistoryValueByPath(item, path);
|
|
65
|
+
if (!isHistoryEmptyValue(value, emptyValues)) return value;
|
|
66
|
+
}
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
165
69
|
function getHistoryAliasPaths(alias, aliasPathPrefixes) {
|
|
166
|
-
|
|
167
|
-
}
|
|
168
|
-
/**
|
|
169
|
-
* Reads a value from an history item using a dot-notated path.
|
|
170
|
-
*
|
|
171
|
-
* @param item - The raw history item.
|
|
172
|
-
* @param path - The dot-notated path.
|
|
173
|
-
* @returns The matched value or undefined.
|
|
174
|
-
*/
|
|
70
|
+
return alias.includes(".") ? [alias] : aliasPathPrefixes.map((prefix) => `${prefix}${alias}`);
|
|
71
|
+
}
|
|
175
72
|
function getHistoryValueByPath(item, path) {
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
}, item);
|
|
182
|
-
}
|
|
183
|
-
/**
|
|
184
|
-
* Checks whether a value is a non-null record.
|
|
185
|
-
*
|
|
186
|
-
* @param value - The value to check.
|
|
187
|
-
* @returns True when the value is a record.
|
|
188
|
-
*/
|
|
73
|
+
return path.split(".").reduce((value, key) => {
|
|
74
|
+
if (!isHistoryRecord(value)) return;
|
|
75
|
+
return value[key];
|
|
76
|
+
}, item);
|
|
77
|
+
}
|
|
189
78
|
function isHistoryRecord(value) {
|
|
190
|
-
|
|
191
|
-
}
|
|
192
|
-
/**
|
|
193
|
-
* Checks whether a value should be treated as empty.
|
|
194
|
-
*
|
|
195
|
-
* @param value - The value to check.
|
|
196
|
-
* @param emptyValues - Values that should be treated as empty.
|
|
197
|
-
* @returns True when the value is empty.
|
|
198
|
-
*/
|
|
79
|
+
return typeof value === "object" && value !== null;
|
|
80
|
+
}
|
|
199
81
|
function isHistoryEmptyValue(value, emptyValues) {
|
|
200
|
-
|
|
201
|
-
}
|
|
202
|
-
/**
|
|
203
|
-
* Checks whether a string value is present.
|
|
204
|
-
*
|
|
205
|
-
* @param value - The value to check.
|
|
206
|
-
* @returns True when the value is a non-empty string.
|
|
207
|
-
*/
|
|
82
|
+
return emptyValues.includes(value);
|
|
83
|
+
}
|
|
208
84
|
function isHistoryPresentString(value) {
|
|
209
|
-
|
|
210
|
-
}
|
|
211
|
-
/**
|
|
212
|
-
* Normalises a history item type key for transformer lookup.
|
|
213
|
-
*
|
|
214
|
-
* @param value - The raw key.
|
|
215
|
-
* @returns The normalised key or null.
|
|
216
|
-
*/
|
|
85
|
+
return !!value;
|
|
86
|
+
}
|
|
217
87
|
function normaliseHistoryKey(value) {
|
|
218
|
-
|
|
219
|
-
}
|
|
220
|
-
/**
|
|
221
|
-
* Normalises a transaction type code for switch matching.
|
|
222
|
-
*
|
|
223
|
-
* @param value - The raw transaction type.
|
|
224
|
-
* @returns The normalised transaction type or null.
|
|
225
|
-
*/
|
|
88
|
+
return value ? value.replace(HISTORY_DETAILS_PATTERNS.keyNormalise, "").toLowerCase() : null;
|
|
89
|
+
}
|
|
226
90
|
function normaliseHistoryTransactionType(value) {
|
|
227
|
-
|
|
228
|
-
}
|
|
229
|
-
/**
|
|
230
|
-
* Converts a camel, space, or hyphen value to snake case.
|
|
231
|
-
*
|
|
232
|
-
* @param value - The raw value.
|
|
233
|
-
* @returns The snake case value.
|
|
234
|
-
*/
|
|
91
|
+
return value ? value.trim().toUpperCase().replace(HISTORY_DETAILS_PATTERNS.transactionTypeSpace, " ") : null;
|
|
92
|
+
}
|
|
235
93
|
function toHistorySnakeCase(value) {
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
.replace(HISTORY_DETAILS_PATTERNS.snakeCaseSeparator, '_')
|
|
239
|
-
.toLowerCase();
|
|
240
|
-
}
|
|
241
|
-
/**
|
|
242
|
-
* Formats configured date strings to the configured output format.
|
|
243
|
-
*
|
|
244
|
-
* @param value - The raw date value.
|
|
245
|
-
* @param dateFormat - The input and output date formats.
|
|
246
|
-
* @returns The formatted date or original value when parsing fails.
|
|
247
|
-
*/
|
|
94
|
+
return value.replace(HISTORY_DETAILS_PATTERNS.snakeCaseBoundary, "$1_$2").replace(HISTORY_DETAILS_PATTERNS.snakeCaseSeparator, "_").toLowerCase();
|
|
95
|
+
}
|
|
248
96
|
function formatHistoryDate(value, dateFormat) {
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
}
|
|
256
|
-
const isoDate = HISTORY_DETAILS_DATE_SERVICE.getFromIso(value);
|
|
257
|
-
return HISTORY_DETAILS_DATE_SERVICE.isValidDate(isoDate)
|
|
258
|
-
? HISTORY_DETAILS_DATE_SERVICE.toFormat(isoDate, dateFormat.output)
|
|
259
|
-
: value;
|
|
260
|
-
}
|
|
261
|
-
/**
|
|
262
|
-
* Formats numeric values as currency while preserving preformatted text.
|
|
263
|
-
*
|
|
264
|
-
* @param value - The raw money value.
|
|
265
|
-
* @param currencyPrefix - The currency prefix to prepend to numeric values.
|
|
266
|
-
* @param emptyValues - Values that should be treated as empty.
|
|
267
|
-
* @returns The formatted money text or null.
|
|
268
|
-
*/
|
|
97
|
+
if (!value) return null;
|
|
98
|
+
const parsedFormattedDate = HISTORY_DETAILS_DATE_SERVICE.getFromFormat(value, dateFormat.input);
|
|
99
|
+
if (HISTORY_DETAILS_DATE_SERVICE.isValidDate(parsedFormattedDate)) return HISTORY_DETAILS_DATE_SERVICE.getFromFormatToFormat(value, dateFormat.input, dateFormat.output);
|
|
100
|
+
const isoDate = HISTORY_DETAILS_DATE_SERVICE.getFromIso(value);
|
|
101
|
+
return HISTORY_DETAILS_DATE_SERVICE.isValidDate(isoDate) ? HISTORY_DETAILS_DATE_SERVICE.toFormat(isoDate, dateFormat.output) : value;
|
|
102
|
+
}
|
|
269
103
|
function formatHistoryMoney(value, currencyPrefix, emptyValues) {
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
const text = String(value);
|
|
277
|
-
if (text.startsWith(currencyPrefix)) {
|
|
278
|
-
return text;
|
|
279
|
-
}
|
|
280
|
-
const numericValue = Number(text);
|
|
281
|
-
return Number.isFinite(numericValue) ? `${currencyPrefix}${numericValue.toFixed(2)}` : text;
|
|
282
|
-
}
|
|
283
|
-
/**
|
|
284
|
-
* Checks whether a details part should be kept in the rendered output.
|
|
285
|
-
*
|
|
286
|
-
* @param value - The details part to check.
|
|
287
|
-
* @returns True when the part is present.
|
|
288
|
-
*/
|
|
289
|
-
function isPresentPart(value) {
|
|
290
|
-
return !!value;
|
|
104
|
+
if (isHistoryEmptyValue(value, emptyValues)) return null;
|
|
105
|
+
if (typeof value === "number") return `${currencyPrefix}${value.toFixed(2)}`;
|
|
106
|
+
const text = String(value);
|
|
107
|
+
if (text.startsWith(currencyPrefix)) return text;
|
|
108
|
+
const numericValue = Number(text);
|
|
109
|
+
return Number.isFinite(numericValue) ? `${currencyPrefix}${numericValue.toFixed(2)}` : text;
|
|
291
110
|
}
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
111
|
+
function isPresentPart(value) {
|
|
112
|
+
return !!value;
|
|
113
|
+
}
|
|
114
|
+
var HistoryTransformationService = class HistoryTransformationService {
|
|
115
|
+
transformDetails(item, config) {
|
|
116
|
+
return transformHistoryDetails(item, config);
|
|
117
|
+
}
|
|
118
|
+
transformItems(items, config) {
|
|
119
|
+
return transformHistoryItems(items, config);
|
|
120
|
+
}
|
|
121
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
122
|
+
minVersion: "12.0.0",
|
|
123
|
+
version: "21.2.25",
|
|
124
|
+
ngImport: i0,
|
|
125
|
+
type: HistoryTransformationService,
|
|
126
|
+
deps: [],
|
|
127
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
128
|
+
});
|
|
129
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
130
|
+
minVersion: "12.0.0",
|
|
131
|
+
version: "21.2.25",
|
|
132
|
+
ngImport: i0,
|
|
133
|
+
type: HistoryTransformationService,
|
|
134
|
+
providedIn: "root"
|
|
135
|
+
});
|
|
136
|
+
};
|
|
137
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
138
|
+
minVersion: "12.0.0",
|
|
139
|
+
version: "21.2.25",
|
|
140
|
+
ngImport: i0,
|
|
141
|
+
type: HistoryTransformationService,
|
|
142
|
+
decorators: [{
|
|
143
|
+
type: Injectable,
|
|
144
|
+
args: [{ providedIn: "root" }]
|
|
145
|
+
}]
|
|
146
|
+
});
|
|
324
147
|
const HISTORY_MAPPING_DATE_SERVICE = new DateService();
|
|
325
|
-
const HISTORY_MAPPING_DEFAULT_FIELD_PATH_SEPARATOR =
|
|
148
|
+
const HISTORY_MAPPING_DEFAULT_FIELD_PATH_SEPARATOR = ".";
|
|
326
149
|
const HISTORY_MAPPING_DEFAULT_NUMBER_OPTIONS = {
|
|
327
|
-
|
|
328
|
-
|
|
150
|
+
fieldPathSeparator: null,
|
|
151
|
+
numberSanitisePattern: null
|
|
329
152
|
};
|
|
330
|
-
/**
|
|
331
|
-
* Checks whether a value can be mapped as a raw history item.
|
|
332
|
-
*
|
|
333
|
-
* @param value - The value to check.
|
|
334
|
-
* @returns True when the value is an object record.
|
|
335
|
-
*/
|
|
336
153
|
function isHistoryMappingItem(value) {
|
|
337
|
-
|
|
338
|
-
}
|
|
339
|
-
/**
|
|
340
|
-
* Finds the first supported history item collection and filters it to mappable object items.
|
|
341
|
-
*
|
|
342
|
-
* @param source - The source object containing a history item collection.
|
|
343
|
-
* @param keys - Candidate history item collection keys in priority order.
|
|
344
|
-
* @returns The matched collection entry, or null when no array is present.
|
|
345
|
-
*/
|
|
154
|
+
return typeof value === "object" && value !== null;
|
|
155
|
+
}
|
|
346
156
|
function getHistoryMappingItemsEntry(source, keys) {
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
return null;
|
|
357
|
-
}
|
|
358
|
-
/**
|
|
359
|
-
* Maps the first supported history item collection into consumer-owned row objects.
|
|
360
|
-
*
|
|
361
|
-
* @param source - The source object containing a history item collection.
|
|
362
|
-
* @param keys - Candidate history item collection keys in priority order.
|
|
363
|
-
* @param mapItemToRow - Row mapper owned by the consuming flow.
|
|
364
|
-
* @returns Mapped rows.
|
|
365
|
-
*/
|
|
157
|
+
for (const key of keys) {
|
|
158
|
+
const historyItems = source[key];
|
|
159
|
+
if (Array.isArray(historyItems)) return {
|
|
160
|
+
key,
|
|
161
|
+
items: historyItems.filter(isHistoryMappingItem)
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
return null;
|
|
165
|
+
}
|
|
366
166
|
function getHistoryMappingRows(source, keys, mapItemToRow) {
|
|
367
|
-
|
|
368
|
-
}
|
|
369
|
-
/**
|
|
370
|
-
* Gets a value from a history item using a field path.
|
|
371
|
-
*
|
|
372
|
-
* @param source - The source history item.
|
|
373
|
-
* @param path - The field path.
|
|
374
|
-
* @param fieldPathSeparator - The path segment separator.
|
|
375
|
-
* @returns The matched field value.
|
|
376
|
-
*/
|
|
167
|
+
return (getHistoryMappingItemsEntry(source, keys)?.items ?? []).map((item, index) => mapItemToRow(item, index));
|
|
168
|
+
}
|
|
377
169
|
function getHistoryMappingValue(source, path, fieldPathSeparator = HISTORY_MAPPING_DEFAULT_FIELD_PATH_SEPARATOR) {
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
}, source);
|
|
384
|
-
}
|
|
385
|
-
/**
|
|
386
|
-
* Gets the first present string or number from the supplied history item paths.
|
|
387
|
-
*
|
|
388
|
-
* @param item - The source history item.
|
|
389
|
-
* @param paths - The field paths to inspect.
|
|
390
|
-
* @param fieldPathSeparator - The path segment separator.
|
|
391
|
-
* @returns The first present string value.
|
|
392
|
-
*/
|
|
170
|
+
return path.split(fieldPathSeparator).reduce((current, key) => {
|
|
171
|
+
if (typeof current !== "object" || current === null) return;
|
|
172
|
+
return current[key];
|
|
173
|
+
}, source);
|
|
174
|
+
}
|
|
393
175
|
function getHistoryMappingString(item, paths, fieldPathSeparator = HISTORY_MAPPING_DEFAULT_FIELD_PATH_SEPARATOR) {
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
}
|
|
402
|
-
}
|
|
403
|
-
return null;
|
|
404
|
-
}
|
|
405
|
-
/**
|
|
406
|
-
* Gets the first finite number from the supplied history item paths.
|
|
407
|
-
*
|
|
408
|
-
* @param item - The source history item.
|
|
409
|
-
* @param paths - The field paths to inspect.
|
|
410
|
-
* @param options - Number mapping options.
|
|
411
|
-
* @returns The first finite number value.
|
|
412
|
-
*/
|
|
176
|
+
for (const path of paths) {
|
|
177
|
+
const value = getHistoryMappingValue(item, path, fieldPathSeparator);
|
|
178
|
+
if (typeof value === "string" && value.trim()) return value;
|
|
179
|
+
if (typeof value === "number") return String(value);
|
|
180
|
+
}
|
|
181
|
+
return null;
|
|
182
|
+
}
|
|
413
183
|
function getHistoryMappingNumber(item, paths, options = HISTORY_MAPPING_DEFAULT_NUMBER_OPTIONS) {
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
if (Number.isFinite(parsed)) {
|
|
428
|
-
return parsed;
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
}
|
|
432
|
-
return null;
|
|
433
|
-
}
|
|
434
|
-
/**
|
|
435
|
-
* Parses supported history date values to sortable UTC timestamps.
|
|
436
|
-
*
|
|
437
|
-
* @param value - The raw date value.
|
|
438
|
-
* @param dateFormat - The configured input date format.
|
|
439
|
-
* @returns The UTC timestamp in milliseconds, or null when parsing fails.
|
|
440
|
-
*/
|
|
184
|
+
const fieldPathSeparator = options.fieldPathSeparator ?? HISTORY_MAPPING_DEFAULT_FIELD_PATH_SEPARATOR;
|
|
185
|
+
for (const path of paths) {
|
|
186
|
+
const value = getHistoryMappingValue(item, path, fieldPathSeparator);
|
|
187
|
+
if (typeof value === "number" && Number.isFinite(value)) return value;
|
|
188
|
+
if (typeof value === "string") {
|
|
189
|
+
const trimmedValue = (options.numberSanitisePattern ? value.replace(options.numberSanitisePattern, "") : value).trim();
|
|
190
|
+
if (!trimmedValue) continue;
|
|
191
|
+
const parsed = Number(trimmedValue);
|
|
192
|
+
if (Number.isFinite(parsed)) return parsed;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
return null;
|
|
196
|
+
}
|
|
441
197
|
function parseHistoryDateTimestamp(value, dateFormat) {
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
return Date.UTC(parsedFormattedDate.year, parsedFormattedDate.month - 1, parsedFormattedDate.day);
|
|
452
|
-
}
|
|
453
|
-
const isoDate = HISTORY_MAPPING_DATE_SERVICE.getFromIso(trimmedValue);
|
|
454
|
-
if (!HISTORY_MAPPING_DATE_SERVICE.isValidDate(isoDate)) {
|
|
455
|
-
return null;
|
|
456
|
-
}
|
|
457
|
-
return trimmedValue.length === 10 ? Date.UTC(isoDate.year, isoDate.month - 1, isoDate.day) : isoDate.toMillis();
|
|
458
|
-
}
|
|
459
|
-
/**
|
|
460
|
-
* Gets the first parseable date timestamp from the supplied history item paths.
|
|
461
|
-
*
|
|
462
|
-
* @param item - The source history item.
|
|
463
|
-
* @param paths - The field paths to inspect.
|
|
464
|
-
* @param dateFormat - The configured input date format.
|
|
465
|
-
* @param fieldPathSeparator - The path segment separator.
|
|
466
|
-
* @returns The first parseable UTC timestamp in milliseconds.
|
|
467
|
-
*/
|
|
198
|
+
if (typeof value === "number" && Number.isFinite(value)) return value;
|
|
199
|
+
if (typeof value !== "string" || !value.trim()) return null;
|
|
200
|
+
const trimmedValue = value.trim();
|
|
201
|
+
const parsedFormattedDate = HISTORY_MAPPING_DATE_SERVICE.getFromFormat(trimmedValue, dateFormat.input);
|
|
202
|
+
if (HISTORY_MAPPING_DATE_SERVICE.isValidDate(parsedFormattedDate)) return Date.UTC(parsedFormattedDate.year, parsedFormattedDate.month - 1, parsedFormattedDate.day);
|
|
203
|
+
const isoDate = HISTORY_MAPPING_DATE_SERVICE.getFromIso(trimmedValue);
|
|
204
|
+
if (!HISTORY_MAPPING_DATE_SERVICE.isValidDate(isoDate)) return null;
|
|
205
|
+
return trimmedValue.length === 10 ? Date.UTC(isoDate.year, isoDate.month - 1, isoDate.day) : isoDate.toMillis();
|
|
206
|
+
}
|
|
468
207
|
function getHistoryMappingDateTimestamp(item, paths, dateFormat, fieldPathSeparator = HISTORY_MAPPING_DEFAULT_FIELD_PATH_SEPARATOR) {
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
return null;
|
|
476
|
-
}
|
|
477
|
-
/**
|
|
478
|
-
* Gets the rendered prefix for a history details fragment.
|
|
479
|
-
*
|
|
480
|
-
* @param fragment - The details fragment.
|
|
481
|
-
* @param index - The fragment index in its part.
|
|
482
|
-
* @param options - Prefix display options.
|
|
483
|
-
* @returns The rendered prefix.
|
|
484
|
-
*/
|
|
208
|
+
for (const path of paths) {
|
|
209
|
+
const timestamp = parseHistoryDateTimestamp(getHistoryMappingValue(item, path, fieldPathSeparator), dateFormat);
|
|
210
|
+
if (timestamp !== null) return timestamp;
|
|
211
|
+
}
|
|
212
|
+
return null;
|
|
213
|
+
}
|
|
485
214
|
function getHistoryMappingFragmentPrefix(fragment, index, options) {
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
return index > 0 ? options.fragmentSpacePrefix : (options.fragmentEmptyPrefix ?? '');
|
|
490
|
-
}
|
|
491
|
-
/**
|
|
492
|
-
* Converts transformed history details into plain text for table sorting.
|
|
493
|
-
*
|
|
494
|
-
* @param details - The transformed details model.
|
|
495
|
-
* @param options - Details text display options.
|
|
496
|
-
* @returns Details text.
|
|
497
|
-
*/
|
|
215
|
+
if (fragment.hyphen) return options.hyphenPrefix;
|
|
216
|
+
return index > 0 ? options.fragmentSpacePrefix : options.fragmentEmptyPrefix ?? "";
|
|
217
|
+
}
|
|
498
218
|
function getHistoryMappingDetailsText(details, options) {
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
.join(options.detailsLineSeparator);
|
|
502
|
-
}
|
|
503
|
-
/**
|
|
504
|
-
* Converts transformed history details parts into plain text for table sorting.
|
|
505
|
-
*
|
|
506
|
-
* @param parts - The transformed details parts.
|
|
507
|
-
* @param options - Details text display options.
|
|
508
|
-
* @returns Details parts text.
|
|
509
|
-
*/
|
|
219
|
+
return [getHistoryMappingPartsText(details.line1, options), getHistoryMappingPartsText(details.line2 ?? [], options)].filter(Boolean).join(options.detailsLineSeparator);
|
|
220
|
+
}
|
|
510
221
|
function getHistoryMappingPartsText(parts, options) {
|
|
511
|
-
|
|
512
|
-
.map((part) => part.fragments
|
|
513
|
-
.map((fragment, index) => `${getHistoryMappingFragmentPrefix(fragment, index, options)}${fragment.text}`)
|
|
514
|
-
.join(options.fragmentJoiner ?? '')
|
|
515
|
-
.trim())
|
|
516
|
-
.filter(Boolean)
|
|
517
|
-
.join(options.partSeparator);
|
|
222
|
+
return parts.map((part) => part.fragments.map((fragment, index) => `${getHistoryMappingFragmentPrefix(fragment, index, options)}${fragment.text}`).join(options.fragmentJoiner ?? "").trim()).filter(Boolean).join(options.partSeparator);
|
|
518
223
|
}
|
|
519
|
-
|
|
520
|
-
/**
|
|
521
|
-
* Generated bundle index. Do not edit.
|
|
522
|
-
*/
|
|
523
|
-
|
|
524
224
|
export { HISTORY_DETAILS_PATTERNS, HistoryTransformationService, createHistoryDetails, createHistoryDetailsPart, createHistoryFragment, createHistoryLabelValuePart, createHistoryLink, createHistoryTextPart, formatHistoryDate, formatHistoryMoney, getHistoryAliasPaths, getHistoryMappingDateTimestamp, getHistoryMappingDetailsText, getHistoryMappingFragmentPrefix, getHistoryMappingItemsEntry, getHistoryMappingNumber, getHistoryMappingPartsText, getHistoryMappingRows, getHistoryMappingString, getHistoryMappingValue, getHistoryString, getHistoryValue, getHistoryValueByPath, isHistoryEmptyValue, isHistoryMappingItem, isHistoryPresentString, isHistoryRecord, normaliseHistoryKey, normaliseHistoryTransactionType, parseHistoryDateTimestamp, toHistorySnakeCase, transformHistoryDetails, transformHistoryFallbackDetails, transformHistoryItems };
|
|
525
|
-
|
|
225
|
+
|
|
226
|
+
//# sourceMappingURL=hmcts-opal-frontend-common-services-history-transformation-service.mjs.map
|