@hmcts/opal-frontend-common 0.0.26 → 0.0.27
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/components/moj/moj-pagination/index.d.ts +46 -128
- package/directives/capitalisation/index.d.ts +1 -3
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-alias-base.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-alias-base.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-array-base.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-array-base.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-array-removal-base.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-array-removal-base.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-base.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-base.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-sortable-table-pagination.mjs +8 -8
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-sortable-table-pagination.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-sortable-table.mjs +10 -10
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-sortable-table.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-table-filter.mjs +10 -10
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-table-filter.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-alphagov-alphagov-accessible-autocomplete.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-alphagov-alphagov-accessible-autocomplete.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-account-information-custom-account-information-item-custom-account-information-item-label.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-account-information-custom-account-information-item-custom-account-information-item-label.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-account-information-custom-account-information-item-custom-account-information-item-value.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-account-information-custom-account-information-item-custom-account-information-item-value.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-account-information-custom-account-information-item.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-account-information-custom-account-information-item.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-account-information.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-account-information.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-action-links.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-action-links.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-horizontal-scroll-pane.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-horizontal-scroll-pane.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-page-header.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-page-header.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-scrollable-panes-custom-scrollable-panes-inner-pane.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-scrollable-panes-custom-scrollable-panes-inner-pane.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-scrollable-panes.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-scrollable-panes.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-summary-metric-bar-custom-summary-metric-bar-item-custom-summary-metric-bar-item-label.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-summary-metric-bar-custom-summary-metric-bar-item-custom-summary-metric-bar-item-label.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-summary-metric-bar-custom-summary-metric-bar-item-custom-summary-metric-bar-item-value.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-summary-metric-bar-custom-summary-metric-bar-item-custom-summary-metric-bar-item-value.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-summary-metric-bar-custom-summary-metric-bar-item.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-summary-metric-bar-custom-summary-metric-bar-item.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-summary-metric-bar.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-summary-metric-bar.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-vertical-scroll-pane-custom-vertical-scroll-pane-inner-pane.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-vertical-scroll-pane-custom-vertical-scroll-pane-inner-pane.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-vertical-scroll-pane-custom-vertical-scroll-pane-outer-pane.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-vertical-scroll-pane-custom-vertical-scroll-pane-outer-pane.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-vertical-scroll-pane.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-vertical-scroll-pane.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-accordion.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-accordion.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-back-link.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-back-link.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-button.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-button.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-cancel-link.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-cancel-link.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-checkboxes.mjs +12 -12
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-checkboxes.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-date-input.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-date-input.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-details.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-details.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-error-summary.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-error-summary.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-footer.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-footer.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-header.mjs +6 -6
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-header.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-heading-with-caption.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-heading-with-caption.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-inset-text.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-inset-text.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-list-govuk-list-link.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-list-govuk-list-link.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-list.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-list.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-notification-banner.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-notification-banner.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-pagination.mjs +5 -5
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-pagination.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-panel.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-panel.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-radio.mjs +12 -12
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-radio.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-select.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-select.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-summary-card-list.mjs +6 -6
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-summary-card-list.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-summary-list.mjs +12 -12
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-summary-list.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-table.mjs +12 -12
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-table.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-tabs-govuk-tabs-list-item.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-tabs-govuk-tabs-list-item.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-tabs-govuk-tabs-panel.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-tabs-govuk-tabs-panel.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-tabs.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-tabs.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-tag.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-tag.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-task-list.mjs +6 -6
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-task-list.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-text-area.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-text-area.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-text-input-prefix-suffix.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-text-input-prefix-suffix.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-text-input.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-text-input.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-hod-hod-loading-spinner.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-hod-hod-loading-spinner.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-alert.mjs +25 -29
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-alert.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-badge.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-badge.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-button-menu-moj-button-menu-item.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-button-menu-moj-button-menu-item.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-button-menu.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-button-menu.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-date-picker.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-date-picker.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-header.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-header.mjs.map +1 -1
- 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 +3 -3
- 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.map +1 -1
- 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 +3 -3
- 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.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-option.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-option.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-selected-moj-filter-panel-selected-tag.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-selected-moj-filter-panel-selected-tag.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-selected.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-selected.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-header.mjs +6 -6
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-header.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-notification-badge.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-notification-badge.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-page-header.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-page-header.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-pagination.mjs +104 -226
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-pagination.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-primary-navigation.mjs +6 -6
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-primary-navigation.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-sortable-table.mjs +22 -26
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-sortable-table.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-sub-navigation.mjs +6 -6
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-sub-navigation.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-ticket-panel.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-ticket-panel.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-timeline.mjs +6 -6
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-timeline.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-directives-capitalisation.mjs +7 -10
- package/fesm2022/hmcts-opal-frontend-common-directives-capitalisation.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-directives-govuk-button.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-directives-govuk-button.mjs.map +1 -1
- package/fesm2022/{hmcts-opal-frontend-common-pages-access-denied.component-hjYG8Hhi.mjs → hmcts-opal-frontend-common-pages-access-denied.component-0Pl64thA.mjs} +4 -4
- package/fesm2022/{hmcts-opal-frontend-common-pages-access-denied.component-hjYG8Hhi.mjs.map → hmcts-opal-frontend-common-pages-access-denied.component-0Pl64thA.mjs.map} +1 -1
- package/fesm2022/{hmcts-opal-frontend-common-pages-sign-in-stub.component-joWzJ-cV.mjs → hmcts-opal-frontend-common-pages-sign-in-stub.component-DvQOlQMW.mjs} +4 -4
- package/fesm2022/{hmcts-opal-frontend-common-pages-sign-in-stub.component-joWzJ-cV.mjs.map → hmcts-opal-frontend-common-pages-sign-in-stub.component-DvQOlQMW.mjs.map} +1 -1
- package/fesm2022/{hmcts-opal-frontend-common-pages-sign-in.component-JCBGIMBe.mjs → hmcts-opal-frontend-common-pages-sign-in.component-yuoev8a3.mjs} +4 -4
- package/fesm2022/{hmcts-opal-frontend-common-pages-sign-in.component-JCBGIMBe.mjs.map → hmcts-opal-frontend-common-pages-sign-in.component-yuoev8a3.mjs.map} +1 -1
- package/fesm2022/hmcts-opal-frontend-common-pages.mjs +2 -2
- package/fesm2022/hmcts-opal-frontend-common-pipes-date-format.mjs +7 -10
- package/fesm2022/hmcts-opal-frontend-common-pipes-date-format.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-pipes-days-ago.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-pipes-days-ago.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-pipes-national-insurance.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-pipes-national-insurance.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-resolvers-title.mjs +7 -10
- package/fesm2022/hmcts-opal-frontend-common-resolvers-title.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-services-app-initializer-service.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-services-app-initializer-service.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-services-app-insights-service.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-services-app-insights-service.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-services-auth-service.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-services-auth-service.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-services-date-service.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-services-date-service.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-services-launch-darkly-service.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-services-launch-darkly-service.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-services-permissions-service.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-services-permissions-service.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-services-session-service.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-services-session-service.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-services-sort-service.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-services-sort-service.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-services-transfer-state-service.mjs +12 -20
- package/fesm2022/hmcts-opal-frontend-common-services-transfer-state-service.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-services-transformation-service.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-services-transformation-service.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-services-utils-service.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-services-utils-service.mjs.map +1 -1
- package/package.json +3 -3
- package/pipes/date-format/index.d.ts +0 -2
- package/resolvers/title/index.d.ts +0 -2
- package/services/transfer-state-service/index.d.ts +3 -5
|
@@ -1,277 +1,155 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
import { CommonModule } from '@angular/common';
|
|
4
|
-
|
|
5
|
-
class MojPaginationItemComponent {
|
|
6
|
-
class = 'moj-pagination__item';
|
|
7
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: MojPaginationItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
8
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: MojPaginationItemComponent, isStandalone: true, selector: "opal-lib-moj-pagination-item , [opal-lib-moj-pagination-item]", host: { properties: { "class": "this.class" } }, ngImport: i0, template: "<ng-content></ng-content>\n" });
|
|
9
|
-
}
|
|
10
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: MojPaginationItemComponent, decorators: [{
|
|
11
|
-
type: Component,
|
|
12
|
-
args: [{ selector: 'opal-lib-moj-pagination-item , [opal-lib-moj-pagination-item]', imports: [], template: "<ng-content></ng-content>\n" }]
|
|
13
|
-
}], propDecorators: { class: [{
|
|
14
|
-
type: HostBinding,
|
|
15
|
-
args: ['class']
|
|
16
|
-
}] } });
|
|
17
|
-
|
|
18
|
-
class MojPaginationLinkComponent {
|
|
19
|
-
page = 1;
|
|
20
|
-
currentPage = 1;
|
|
21
|
-
totalPages = 1;
|
|
22
|
-
changePage = new EventEmitter();
|
|
23
|
-
/**
|
|
24
|
-
* Checks if the given page number is not the current page.
|
|
25
|
-
*
|
|
26
|
-
* @param page - The page number to check.
|
|
27
|
-
* @returns A boolean indicating whether the given page is not the current page.
|
|
28
|
-
*/
|
|
29
|
-
pageIsNotCurrentPage(page) {
|
|
30
|
-
return page !== this.currentPage;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Checks if the given page number is not negative.
|
|
34
|
-
*
|
|
35
|
-
* @param page - The page number to check.
|
|
36
|
-
* @returns `true` if the page number is greater than 0, otherwise `false`.
|
|
37
|
-
*/
|
|
38
|
-
pageIsNotNegative(page) {
|
|
39
|
-
return page > 0;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Checks if the given page number is not greater than the total number of pages.
|
|
43
|
-
*
|
|
44
|
-
* @param page - The page number to check.
|
|
45
|
-
* @returns `true` if the page number is less than or equal to the total number of pages, otherwise `false`.
|
|
46
|
-
*/
|
|
47
|
-
pageIsNotGreaterThanTotalPages(page) {
|
|
48
|
-
return page <= this.totalPages;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Handles the page change event.
|
|
52
|
-
*
|
|
53
|
-
* @param event - The mouse event that triggered the page change.
|
|
54
|
-
* @param page - The page number to change to.
|
|
55
|
-
*
|
|
56
|
-
* Prevents the default action of the event and checks if the page number is valid.
|
|
57
|
-
* A valid page number is one that is not the current page, is greater than 0,
|
|
58
|
-
* and is less than or equal to the total number of pages.
|
|
59
|
-
* If the page number is valid, emits the changePage event with the new page number.
|
|
60
|
-
*/
|
|
61
|
-
changePageEvent(event, page) {
|
|
62
|
-
event.preventDefault();
|
|
63
|
-
if (this.pageIsNotCurrentPage(page) && this.pageIsNotNegative(page) && this.pageIsNotGreaterThanTotalPages(page)) {
|
|
64
|
-
this.changePage.emit(page);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: MojPaginationLinkComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
68
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: MojPaginationLinkComponent, isStandalone: true, selector: "opal-lib-moj-pagination-link", inputs: { page: "page", currentPage: "currentPage", totalPages: "totalPages", changePage: "changePage" }, ngImport: i0, template: "<a class=\"moj-pagination__link\" href=\"#\" (click)=\"changePageEvent($event, +page)\"> <ng-content></ng-content></a>\n", changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
69
|
-
}
|
|
70
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: MojPaginationLinkComponent, decorators: [{
|
|
71
|
-
type: Component,
|
|
72
|
-
args: [{ selector: 'opal-lib-moj-pagination-link', imports: [], changeDetection: ChangeDetectionStrategy.OnPush, template: "<a class=\"moj-pagination__link\" href=\"#\" (click)=\"changePageEvent($event, +page)\"> <ng-content></ng-content></a>\n" }]
|
|
73
|
-
}], propDecorators: { page: [{
|
|
74
|
-
type: Input,
|
|
75
|
-
args: [{ required: true }]
|
|
76
|
-
}], currentPage: [{
|
|
77
|
-
type: Input,
|
|
78
|
-
args: [{ required: true }]
|
|
79
|
-
}], totalPages: [{
|
|
80
|
-
type: Input,
|
|
81
|
-
args: [{ required: true }]
|
|
82
|
-
}], changePage: [{
|
|
83
|
-
type: Input
|
|
84
|
-
}] } });
|
|
85
|
-
|
|
86
|
-
class MojPaginationListComponent {
|
|
87
|
-
class = 'moj-pagination__list';
|
|
88
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: MojPaginationListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
89
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: MojPaginationListComponent, isStandalone: true, selector: "opal-lib-moj-pagination-list , [opal-lib-moj-pagination-list]", host: { properties: { "class": "this.class" } }, ngImport: i0, template: "<ng-content></ng-content>\n" });
|
|
90
|
-
}
|
|
91
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: MojPaginationListComponent, decorators: [{
|
|
92
|
-
type: Component,
|
|
93
|
-
args: [{ selector: 'opal-lib-moj-pagination-list , [opal-lib-moj-pagination-list]', imports: [], template: "<ng-content></ng-content>\n" }]
|
|
94
|
-
}], propDecorators: { class: [{
|
|
95
|
-
type: HostBinding,
|
|
96
|
-
args: ['class']
|
|
97
|
-
}] } });
|
|
2
|
+
import { signal, EventEmitter, Output, Input, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
98
3
|
|
|
99
4
|
class MojPaginationComponent {
|
|
5
|
+
pages = signal([], ...(ngDevMode ? [{ debugName: "pages" }] : []));
|
|
6
|
+
id;
|
|
100
7
|
currentPage = 1;
|
|
101
8
|
total = 0;
|
|
102
|
-
|
|
103
|
-
limit = 100;
|
|
104
|
-
ariaLabel = 'Pagination navigation';
|
|
9
|
+
limit = 25;
|
|
105
10
|
changePage = new EventEmitter();
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
startItem = signal(0);
|
|
109
|
-
endItem = signal(0);
|
|
110
|
-
totalItems = signal(0);
|
|
11
|
+
elipsedPages = signal([], ...(ngDevMode ? [{ debugName: "elipsedPages" }] : []));
|
|
12
|
+
ELIPSIS = '…';
|
|
111
13
|
/**
|
|
112
|
-
*
|
|
14
|
+
* Gets the total number of pages available.
|
|
113
15
|
*
|
|
114
|
-
*
|
|
115
|
-
* - `totalPages`: The total number of pages based on the total items and items per page limit.
|
|
116
|
-
* - `startItem`: The index of the first item on the current page.
|
|
117
|
-
* - `endItem`: The index of the last item on the current page.
|
|
118
|
-
* - `pages`: The array of page numbers to be displayed.
|
|
119
|
-
* - `totalItems`: The total number of items.
|
|
120
|
-
*
|
|
121
|
-
* @private
|
|
16
|
+
* @returns The total count of pages as a number.
|
|
122
17
|
*/
|
|
123
|
-
|
|
124
|
-
this.
|
|
125
|
-
this.startItem.set(this.getStartItem(this.currentPage, this.limit));
|
|
126
|
-
this.endItem.set(this.getEndItem(this.currentPage, this.limit, this.total));
|
|
127
|
-
this.setPages();
|
|
128
|
-
this.setTotalItems();
|
|
18
|
+
get totalPages() {
|
|
19
|
+
return this.pages().length;
|
|
129
20
|
}
|
|
130
21
|
/**
|
|
131
|
-
*
|
|
22
|
+
* Gets the starting item index for the current page in a paginated list.
|
|
132
23
|
*
|
|
133
|
-
* @
|
|
134
|
-
* @param limit - The number of items per page.
|
|
135
|
-
* @returns The total number of pages.
|
|
136
|
-
*/
|
|
137
|
-
getTotalPages(total, limit) {
|
|
138
|
-
return Math.ceil(total / limit);
|
|
139
|
-
}
|
|
140
|
-
/**
|
|
141
|
-
* Sets the pagination pages based on the current page and total pages.
|
|
142
|
-
* This method updates the `pages` property with the result of the `getPages` method.
|
|
24
|
+
* @returns {number} The index of the first item on the current page, or 0 if there are no items.
|
|
143
25
|
*
|
|
144
|
-
*
|
|
26
|
+
* If `total` is 0, returns 0. Otherwise, calculates the starting index based on the current page and the limit per page.
|
|
145
27
|
*/
|
|
146
|
-
|
|
147
|
-
this.
|
|
28
|
+
get pageStart() {
|
|
29
|
+
return this.total === 0 ? 0 : (this.currentPage - 1) * this.limit + 1;
|
|
148
30
|
}
|
|
149
31
|
/**
|
|
150
|
-
*
|
|
32
|
+
* Gets the index of the last item on the current page.
|
|
151
33
|
*
|
|
152
|
-
* @
|
|
153
|
-
*
|
|
154
|
-
*
|
|
34
|
+
* @returns {number} The index of the last item displayed on the current page.
|
|
35
|
+
* Returns 0 if there are no items (`total` is 0). Otherwise, returns the lesser of
|
|
36
|
+
* `currentPage * limit` and `total`, ensuring the end index does not exceed the total number of items.
|
|
155
37
|
*/
|
|
156
|
-
|
|
157
|
-
return (currentPage
|
|
38
|
+
get pageEnd() {
|
|
39
|
+
return this.total === 0 ? 0 : Math.min(this.currentPage * this.limit, this.total);
|
|
158
40
|
}
|
|
159
41
|
/**
|
|
160
|
-
* Calculates the
|
|
42
|
+
* Calculates and updates the pagination pages and elided (skipped) pages based on the current limit and total items.
|
|
161
43
|
*
|
|
162
|
-
*
|
|
163
|
-
*
|
|
164
|
-
*
|
|
165
|
-
* @returns The index of the last item on the current page, or the total number of items if the end of the list is reached.
|
|
166
|
-
*/
|
|
167
|
-
getEndItem(currentPage, limit, total) {
|
|
168
|
-
return Math.min(currentPage * limit, total);
|
|
169
|
-
}
|
|
170
|
-
/**
|
|
171
|
-
* Updates the total number of items by setting the value of `totalItems` to the current `total`.
|
|
44
|
+
* - If either `limit` or `total` is less than or equal to zero, clears the pages and elided pages.
|
|
45
|
+
* - Otherwise, computes the total number of pages, updates the `pages` observable with the full range,
|
|
46
|
+
* and updates the `elipsedPages` observable with the result of skipping pages for ellipsis display.
|
|
172
47
|
*
|
|
173
48
|
* @private
|
|
174
49
|
*/
|
|
175
|
-
|
|
176
|
-
this.
|
|
50
|
+
calculatePages() {
|
|
51
|
+
if (this.limit <= 0 || this.total <= 0) {
|
|
52
|
+
this.pages.set([]);
|
|
53
|
+
this.elipsedPages.set([]);
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
const pagesCount = Math.ceil(this.total / this.limit);
|
|
57
|
+
this.pages.set(this.range(1, pagesCount + 1));
|
|
58
|
+
this.elipsedPages.set(this.elipseSkippedPages(this.pages(), this.currentPage));
|
|
177
59
|
}
|
|
178
60
|
/**
|
|
179
|
-
* Generates an array of
|
|
61
|
+
* Generates an array of numbers starting from `start` up to, but not including, `end`.
|
|
180
62
|
*
|
|
181
|
-
* @param
|
|
182
|
-
* @param
|
|
183
|
-
* @returns An array of
|
|
184
|
-
*
|
|
185
|
-
* The function ensures that the pagination display shows a maximum of 5 pages at a time.
|
|
186
|
-
* It calculates the range of pages to display based on the current page and total pages.
|
|
187
|
-
* If the start page is greater than 1, it adds an ellipsis and the first page at the beginning.
|
|
188
|
-
* If the end page is less than the total pages, it adds an ellipsis and the last page at the end.
|
|
63
|
+
* @param start - The starting number of the range (inclusive).
|
|
64
|
+
* @param end - The ending number of the range (exclusive).
|
|
65
|
+
* @returns An array of numbers from `start` to `end - 1`.
|
|
189
66
|
*/
|
|
190
|
-
|
|
191
|
-
const
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
const endPage = this.calculateEndPage(currentPage, totalPages, halfPagesToShow);
|
|
195
|
-
const pages = this.generatePageNumbers(startPage, endPage);
|
|
196
|
-
if (startPage > 1) {
|
|
197
|
-
pages.unshift(eclipses);
|
|
198
|
-
pages.unshift(1);
|
|
199
|
-
}
|
|
200
|
-
if (endPage < totalPages) {
|
|
201
|
-
pages.push(eclipses);
|
|
202
|
-
pages.push(totalPages);
|
|
67
|
+
range(start, end) {
|
|
68
|
+
const result = [];
|
|
69
|
+
for (let i = start; i < end; i++) {
|
|
70
|
+
result.push(i);
|
|
203
71
|
}
|
|
204
|
-
return
|
|
72
|
+
return result;
|
|
205
73
|
}
|
|
206
74
|
/**
|
|
207
|
-
*
|
|
75
|
+
* Generates a pagination array with ellipses ("...") to represent skipped page ranges.
|
|
208
76
|
*
|
|
209
|
-
*
|
|
210
|
-
*
|
|
211
|
-
*
|
|
212
|
-
*
|
|
77
|
+
* The resulting array always includes the first and last page numbers, the current page,
|
|
78
|
+
* and up to one page before and after the current page. Ellipses are inserted where
|
|
79
|
+
* there are skipped ranges between the displayed pages.
|
|
80
|
+
*
|
|
81
|
+
* @param pages - An array of page numbers representing all available pages.
|
|
82
|
+
* @param currentPage - The currently active page number.
|
|
83
|
+
* @returns An array containing page numbers and ellipsis strings ("...") to indicate skipped pages.
|
|
213
84
|
*/
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
85
|
+
elipseSkippedPages(pages, currentPage) {
|
|
86
|
+
const totalPages = pages.length;
|
|
87
|
+
const first = 1;
|
|
88
|
+
const last = totalPages;
|
|
89
|
+
const result = [];
|
|
90
|
+
// Always show the first page
|
|
91
|
+
result.push(first);
|
|
92
|
+
// Determine left-side ellipsis
|
|
93
|
+
if (currentPage > first + 2) {
|
|
94
|
+
result.push(this.ELIPSIS);
|
|
218
95
|
}
|
|
219
|
-
|
|
220
|
-
|
|
96
|
+
// Middle pages: current - 1, current, current + 1
|
|
97
|
+
for (let i = currentPage - 1; i <= currentPage + 1; i++) {
|
|
98
|
+
if (i > first && i < last) {
|
|
99
|
+
result.push(i);
|
|
100
|
+
}
|
|
221
101
|
}
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
* @param currentPage - The current page number.
|
|
228
|
-
* @param totalPages - The total number of pages.
|
|
229
|
-
* @param halfPagesToShow - Half the number of pages to show around the current page.
|
|
230
|
-
* @returns The calculated end page number.
|
|
231
|
-
*/
|
|
232
|
-
calculateEndPage(currentPage, totalPages, halfPagesToShow) {
|
|
233
|
-
let endPage = Math.min(totalPages, currentPage + halfPagesToShow);
|
|
234
|
-
if (currentPage - halfPagesToShow <= 0) {
|
|
235
|
-
endPage = Math.min(totalPages, endPage + (halfPagesToShow - currentPage + 1));
|
|
102
|
+
// Decide whether to add right-side ellipsis
|
|
103
|
+
const lastIncluded = result.includes(last);
|
|
104
|
+
const secondLast = last - 1;
|
|
105
|
+
if (!result.includes(secondLast) && !lastIncluded) {
|
|
106
|
+
result.push(this.ELIPSIS);
|
|
236
107
|
}
|
|
237
|
-
|
|
238
|
-
|
|
108
|
+
// Add last page if not already included
|
|
109
|
+
if (!lastIncluded && last !== first) {
|
|
110
|
+
result.push(last);
|
|
239
111
|
}
|
|
240
|
-
return
|
|
112
|
+
return result;
|
|
241
113
|
}
|
|
242
114
|
/**
|
|
243
|
-
*
|
|
115
|
+
* Handles the page change event for the pagination component.
|
|
244
116
|
*
|
|
245
|
-
*
|
|
246
|
-
*
|
|
247
|
-
* @
|
|
117
|
+
* Prevents the default action of the event (if provided) and emits the selected page number.
|
|
118
|
+
*
|
|
119
|
+
* @param event - The event triggered by the page change action. If provided, its default behavior will be prevented.
|
|
120
|
+
* @param page - The page number to navigate to.
|
|
248
121
|
*/
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
pages.push(i);
|
|
122
|
+
onPageChanged(event, page) {
|
|
123
|
+
if (event) {
|
|
124
|
+
event.preventDefault();
|
|
253
125
|
}
|
|
254
|
-
|
|
126
|
+
this.changePage.emit(page);
|
|
255
127
|
}
|
|
128
|
+
/**
|
|
129
|
+
* Lifecycle hook that is called when any data-bound property of the component changes.
|
|
130
|
+
* Invokes the `calculatePages` method to update the pagination state based on the new input values.
|
|
131
|
+
*/
|
|
256
132
|
ngOnChanges() {
|
|
257
|
-
this.
|
|
133
|
+
this.calculatePages();
|
|
258
134
|
}
|
|
259
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
260
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
135
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: MojPaginationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
136
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.4", type: MojPaginationComponent, isStandalone: true, selector: "opal-lib-moj-pagination", inputs: { id: "id", currentPage: "currentPage", total: "total", limit: "limit" }, outputs: { changePage: "changePage" }, usesOnChanges: true, ngImport: i0, template: "@if (totalPages > 1) {\n <nav class=\"moj-pagination moj-pagination-alignment\" aria-label=\"Pagination navigation\" [id]=\"id\">\n <ul class=\"moj-pagination__list\">\n @if (currentPage > 1) {\n <li class=\"moj-pagination__item moj-pagination__item--prev\">\n <a\n class=\"moj-pagination__link\"\n (click)=\"onPageChanged($event, currentPage - 1)\"\n (keydown.enter)=\"onPageChanged($event, currentPage - 1)\"\n tabindex=\"0\"\n >Previous<span class=\"govuk-visually-hidden\"> page</span></a\n >\n </li>\n }\n\n @for (elipsedPage of elipsedPages(); track elipsedPage) {\n @switch (elipsedPage) {\n @case (currentPage) {\n <li\n class=\"moj-pagination__item moj-pagination__item--active\"\n [attr.aria-label]=\"'Page ' + elipsedPage + ' of ' + totalPages\"\n aria-current=\"page\"\n >\n {{ elipsedPage }}\n </li>\n }\n @case (ELIPSIS) {\n <li class=\"moj-pagination__item moj-pagination__item--dots\">{{ ELIPSIS }}</li>\n }\n @default {\n <li class=\"moj-pagination__item\">\n <a\n class=\"moj-pagination__link\"\n (click)=\"onPageChanged($event, +elipsedPage)\"\n (keydown.enter)=\"onPageChanged($event, +elipsedPage)\"\n tabindex=\"0\"\n [attr.aria-label]=\"'Page ' + elipsedPage + ' of ' + totalPages\"\n >\n {{ elipsedPage }}\n </a>\n </li>\n }\n }\n }\n\n @if (currentPage < totalPages) {\n <li class=\"moj-pagination__item moj-pagination__item--next\">\n <a\n class=\"moj-pagination__link\"\n (click)=\"onPageChanged($event, currentPage + 1)\"\n (keydown.enter)=\"onPageChanged($event, currentPage + 1)\"\n tabindex=\"0\"\n >\n Next<span class=\"govuk-visually-hidden\"> page</span></a\n >\n </li>\n }\n </ul>\n <p class=\"moj-pagination__results govuk-!-text-align-right\">\n Showing <b>{{ pageStart }}</b> to <b>{{ pageEnd }}</b> of <b>{{ total }}</b> results\n </p>\n </nav>\n}\n", styles: [".moj-pagination-alignment{width:100%;display:grid;grid-template-columns:.5fr .5fr}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
261
137
|
}
|
|
262
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
138
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: MojPaginationComponent, decorators: [{
|
|
263
139
|
type: Component,
|
|
264
|
-
args: [{ selector: 'opal-lib-moj-pagination
|
|
265
|
-
}], propDecorators: {
|
|
266
|
-
type: Input
|
|
140
|
+
args: [{ selector: 'opal-lib-moj-pagination', changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (totalPages > 1) {\n <nav class=\"moj-pagination moj-pagination-alignment\" aria-label=\"Pagination navigation\" [id]=\"id\">\n <ul class=\"moj-pagination__list\">\n @if (currentPage > 1) {\n <li class=\"moj-pagination__item moj-pagination__item--prev\">\n <a\n class=\"moj-pagination__link\"\n (click)=\"onPageChanged($event, currentPage - 1)\"\n (keydown.enter)=\"onPageChanged($event, currentPage - 1)\"\n tabindex=\"0\"\n >Previous<span class=\"govuk-visually-hidden\"> page</span></a\n >\n </li>\n }\n\n @for (elipsedPage of elipsedPages(); track elipsedPage) {\n @switch (elipsedPage) {\n @case (currentPage) {\n <li\n class=\"moj-pagination__item moj-pagination__item--active\"\n [attr.aria-label]=\"'Page ' + elipsedPage + ' of ' + totalPages\"\n aria-current=\"page\"\n >\n {{ elipsedPage }}\n </li>\n }\n @case (ELIPSIS) {\n <li class=\"moj-pagination__item moj-pagination__item--dots\">{{ ELIPSIS }}</li>\n }\n @default {\n <li class=\"moj-pagination__item\">\n <a\n class=\"moj-pagination__link\"\n (click)=\"onPageChanged($event, +elipsedPage)\"\n (keydown.enter)=\"onPageChanged($event, +elipsedPage)\"\n tabindex=\"0\"\n [attr.aria-label]=\"'Page ' + elipsedPage + ' of ' + totalPages\"\n >\n {{ elipsedPage }}\n </a>\n </li>\n }\n }\n }\n\n @if (currentPage < totalPages) {\n <li class=\"moj-pagination__item moj-pagination__item--next\">\n <a\n class=\"moj-pagination__link\"\n (click)=\"onPageChanged($event, currentPage + 1)\"\n (keydown.enter)=\"onPageChanged($event, currentPage + 1)\"\n tabindex=\"0\"\n >\n Next<span class=\"govuk-visually-hidden\"> page</span></a\n >\n </li>\n }\n </ul>\n <p class=\"moj-pagination__results govuk-!-text-align-right\">\n Showing <b>{{ pageStart }}</b> to <b>{{ pageEnd }}</b> of <b>{{ total }}</b> results\n </p>\n </nav>\n}\n", styles: [".moj-pagination-alignment{width:100%;display:grid;grid-template-columns:.5fr .5fr}\n"] }]
|
|
141
|
+
}], propDecorators: { id: [{
|
|
142
|
+
type: Input,
|
|
143
|
+
args: [{ required: true }]
|
|
144
|
+
}], currentPage: [{
|
|
145
|
+
type: Input,
|
|
146
|
+
args: [{ required: true }]
|
|
267
147
|
}], total: [{
|
|
268
|
-
type: Input
|
|
269
|
-
|
|
270
|
-
type: Input
|
|
148
|
+
type: Input,
|
|
149
|
+
args: [{ required: true }]
|
|
271
150
|
}], limit: [{
|
|
272
|
-
type: Input
|
|
273
|
-
|
|
274
|
-
type: Input
|
|
151
|
+
type: Input,
|
|
152
|
+
args: [{ required: true }]
|
|
275
153
|
}], changePage: [{
|
|
276
154
|
type: Output
|
|
277
155
|
}] } });
|
|
@@ -280,5 +158,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
280
158
|
* Generated bundle index. Do not edit.
|
|
281
159
|
*/
|
|
282
160
|
|
|
283
|
-
export { MojPaginationComponent
|
|
161
|
+
export { MojPaginationComponent };
|
|
284
162
|
//# sourceMappingURL=hmcts-opal-frontend-common-components-moj-moj-pagination.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-components-moj-moj-pagination.mjs","sources":["../../../projects/opal-frontend-common/components/moj/moj-pagination/moj-pagination-item/moj-pagination-item.component.ts","../../../projects/opal-frontend-common/components/moj/moj-pagination/moj-pagination-item/moj-pagination-item.component.html","../../../projects/opal-frontend-common/components/moj/moj-pagination/moj-pagination-link/moj-pagination-link.component.ts","../../../projects/opal-frontend-common/components/moj/moj-pagination/moj-pagination-link/moj-pagination-link.component.html","../../../projects/opal-frontend-common/components/moj/moj-pagination/moj-pagination-list/moj-pagination-list.component.ts","../../../projects/opal-frontend-common/components/moj/moj-pagination/moj-pagination-list/moj-pagination-list.component.html","../../../projects/opal-frontend-common/components/moj/moj-pagination/moj-pagination.component.ts","../../../projects/opal-frontend-common/components/moj/moj-pagination/moj-pagination.component.html","../../../projects/opal-frontend-common/components/moj/moj-pagination/hmcts-opal-frontend-common-components-moj-moj-pagination.ts"],"sourcesContent":["import { Component, HostBinding } from '@angular/core';\n\n@Component({\n selector: 'opal-lib-moj-pagination-item , [opal-lib-moj-pagination-item]',\n imports: [],\n templateUrl: './moj-pagination-item.component.html',\n})\nexport class MojPaginationItemComponent {\n @HostBinding('class') class = 'moj-pagination__item';\n}\n","<ng-content></ng-content>\n","import { ChangeDetectionStrategy, Component, EventEmitter, Input } from '@angular/core';\n\n@Component({\n selector: 'opal-lib-moj-pagination-link',\n imports: [],\n templateUrl: './moj-pagination-link.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class MojPaginationLinkComponent {\n @Input({ required: true }) page: number | string = 1;\n @Input({ required: true }) currentPage: number = 1;\n @Input({ required: true }) totalPages: number = 1;\n @Input() changePage: EventEmitter<number> = new EventEmitter<number>();\n\n /**\n * Checks if the given page number is not the current page.\n *\n * @param page - The page number to check.\n * @returns A boolean indicating whether the given page is not the current page.\n */\n\n private pageIsNotCurrentPage(page: number): boolean {\n return page !== this.currentPage;\n }\n\n /**\n * Checks if the given page number is not negative.\n *\n * @param page - The page number to check.\n * @returns `true` if the page number is greater than 0, otherwise `false`.\n */\n\n private pageIsNotNegative(page: number): boolean {\n return page > 0;\n }\n\n /**\n * Checks if the given page number is not greater than the total number of pages.\n *\n * @param page - The page number to check.\n * @returns `true` if the page number is less than or equal to the total number of pages, otherwise `false`.\n */\n\n private pageIsNotGreaterThanTotalPages(page: number): boolean {\n return page <= this.totalPages;\n }\n /**\n * Handles the page change event.\n *\n * @param event - The mouse event that triggered the page change.\n * @param page - The page number to change to.\n *\n * Prevents the default action of the event and checks if the page number is valid.\n * A valid page number is one that is not the current page, is greater than 0,\n * and is less than or equal to the total number of pages.\n * If the page number is valid, emits the changePage event with the new page number.\n */\n public changePageEvent(event: MouseEvent, page: number): void {\n event.preventDefault();\n\n if (this.pageIsNotCurrentPage(page) && this.pageIsNotNegative(page) && this.pageIsNotGreaterThanTotalPages(page)) {\n this.changePage.emit(page);\n }\n }\n}\n","<a class=\"moj-pagination__link\" href=\"#\" (click)=\"changePageEvent($event, +page)\"> <ng-content></ng-content></a>\n","import { Component, HostBinding } from '@angular/core';\n\n@Component({\n selector: 'opal-lib-moj-pagination-list , [opal-lib-moj-pagination-list]',\n imports: [],\n templateUrl: './moj-pagination-list.component.html',\n})\nexport class MojPaginationListComponent {\n @HostBinding('class') class = 'moj-pagination__list';\n}\n","<ng-content></ng-content>\n","import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnChanges, Output, signal } from '@angular/core';\nimport { MojPaginationItemComponent } from './moj-pagination-item/moj-pagination-item.component';\nimport { MojPaginationListComponent } from './moj-pagination-list/moj-pagination-list.component';\nimport { MojPaginationLinkComponent } from './moj-pagination-link/moj-pagination-link.component';\nimport { CommonModule } from '@angular/common';\n\n@Component({\n selector: 'opal-lib-moj-pagination,',\n styleUrls: ['./moj-pagination.component.scss'],\n\n imports: [CommonModule, MojPaginationItemComponent, MojPaginationListComponent, MojPaginationLinkComponent],\n templateUrl: './moj-pagination.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class MojPaginationComponent implements OnChanges {\n @Input() currentPage = 1;\n @Input() total = 0;\n @Input() maxPagesToShow = 5;\n @Input() limit = 100;\n @Input() ariaLabel = 'Pagination navigation';\n @Output() changePage = new EventEmitter<number>();\n\n public pages = signal<(number | string)[]>([]);\n public totalPages = signal<number>(0);\n public startItem = signal<number>(0);\n public endItem = signal<number>(0);\n public totalItems = signal<number>(0);\n\n /**\n * Updates the pagination signals based on the current state.\n *\n * This method recalculates and sets the following signals:\n * - `totalPages`: The total number of pages based on the total items and items per page limit.\n * - `startItem`: The index of the first item on the current page.\n * - `endItem`: The index of the last item on the current page.\n * - `pages`: The array of page numbers to be displayed.\n * - `totalItems`: The total number of items.\n *\n * @private\n */\n private setSignals(): void {\n this.totalPages.set(this.getTotalPages(this.total, this.limit));\n this.startItem.set(this.getStartItem(this.currentPage, this.limit));\n this.endItem.set(this.getEndItem(this.currentPage, this.limit, this.total));\n this.setPages();\n this.setTotalItems();\n }\n\n /**\n * Calculates the total number of pages based on the total number of items and the limit of items per page.\n *\n * @param total - The total number of items.\n * @param limit - The number of items per page.\n * @returns The total number of pages.\n */\n private getTotalPages(total: number, limit: number): number {\n return Math.ceil(total / limit);\n }\n /**\n * Sets the pagination pages based on the current page and total pages.\n * This method updates the `pages` property with the result of the `getPages` method.\n *\n * @private\n */\n private setPages(): void {\n this.pages.set(this.getPages(this.currentPage, this.totalPages()));\n }\n\n /**\n * Calculates the starting item index for pagination.\n *\n * @param currentPage - The current page number.\n * @param limit - The number of items per page.\n * @returns The starting item index for the given page.\n */\n private getStartItem(currentPage: number, limit: number): number {\n return (currentPage - 1) * limit + 1;\n }\n\n /**\n * Calculates the end item index for pagination.\n *\n * @param currentPage - The current page number.\n * @param limit - The number of items per page.\n * @param total - The total number of items.\n * @returns The index of the last item on the current page, or the total number of items if the end of the list is reached.\n */\n private getEndItem(currentPage: number, limit: number, total: number): number {\n return Math.min(currentPage * limit, total);\n }\n /**\n * Updates the total number of items by setting the value of `totalItems` to the current `total`.\n *\n * @private\n */\n private setTotalItems(): void {\n this.totalItems.set(this.total);\n }\n\n /**\n * Generates an array of page numbers and ellipses for pagination display.\n *\n * @param currentPage - The current active page number.\n * @param totalPages - The total number of pages available.\n * @returns An array of page numbers and ellipses representing the pagination.\n *\n * The function ensures that the pagination display shows a maximum of 5 pages at a time.\n * It calculates the range of pages to display based on the current page and total pages.\n * If the start page is greater than 1, it adds an ellipsis and the first page at the beginning.\n * If the end page is less than the total pages, it adds an ellipsis and the last page at the end.\n */\n private getPages(currentPage: number, totalPages: number): (number | string)[] {\n const halfPagesToShow = Math.floor(this.maxPagesToShow / 2);\n const eclipses = '...';\n\n const startPage = this.calculateStartPage(currentPage, totalPages, halfPagesToShow);\n const endPage = this.calculateEndPage(currentPage, totalPages, halfPagesToShow);\n\n const pages = this.generatePageNumbers(startPage, endPage);\n\n if (startPage > 1) {\n pages.unshift(eclipses);\n pages.unshift(1);\n }\n\n if (endPage < totalPages) {\n pages.push(eclipses);\n pages.push(totalPages);\n }\n\n return pages;\n }\n\n /**\n * Calculates the start page for pagination based on the current page, total pages, and the number of pages to show on either side of the current page.\n *\n * @param currentPage - The current active page number.\n * @param totalPages - The total number of pages available.\n * @param halfPagesToShow - The number of pages to show on either side of the current page.\n * @returns The start page number for pagination.\n */\n private calculateStartPage(currentPage: number, totalPages: number, halfPagesToShow: number): number {\n let startPage = Math.max(1, currentPage - halfPagesToShow);\n\n if (currentPage - halfPagesToShow <= 0) {\n startPage = 1;\n } else if (currentPage + halfPagesToShow > totalPages) {\n startPage = Math.max(1, startPage - (currentPage + halfPagesToShow - totalPages));\n }\n\n return startPage;\n }\n\n /**\n * Calculates the end page number for pagination based on the current page, total pages, and the number of pages to show.\n *\n * @param currentPage - The current page number.\n * @param totalPages - The total number of pages.\n * @param halfPagesToShow - Half the number of pages to show around the current page.\n * @returns The calculated end page number.\n */\n private calculateEndPage(currentPage: number, totalPages: number, halfPagesToShow: number): number {\n let endPage = Math.min(totalPages, currentPage + halfPagesToShow);\n\n if (currentPage - halfPagesToShow <= 0) {\n endPage = Math.min(totalPages, endPage + (halfPagesToShow - currentPage + 1));\n } else if (currentPage + halfPagesToShow > totalPages) {\n endPage = totalPages;\n }\n\n return endPage;\n }\n\n /**\n * Generates an array of page numbers from the startPage to the endPage.\n *\n * @param startPage - The starting page number.\n * @param endPage - The ending page number.\n * @returns An array of page numbers from startPage to endPage.\n */\n private generatePageNumbers(startPage: number, endPage: number): (number | string)[] {\n const pages: (number | string)[] = [];\n for (let i = startPage; i <= endPage; i++) {\n pages.push(i);\n }\n return pages;\n }\n\n public ngOnChanges(): void {\n this.setSignals();\n }\n}\n","<nav class=\"moj-pagination moj-pagination-alignment\" [attr.aria-label]=\"ariaLabel\">\n <ul opal-lib-moj-pagination-list>\n <li opal-lib-moj-pagination-item class=\"moj-pagination__item moj-pagination__item--prev\">\n @if (currentPage > 1) {\n <opal-lib-moj-pagination-link\n [changePage]=\"changePage\"\n [page]=\"currentPage - 1\"\n [currentPage]=\"currentPage\"\n [totalPages]=\"totalPages()\"\n >Previous<span class=\"govuk-visually-hidden\"> page </span></opal-lib-moj-pagination-link\n >\n }\n </li>\n @for (page of pages(); track page) {\n <li\n opal-lib-moj-pagination-item\n [class.moj-pagination__item--active]=\"page === currentPage\"\n [class.moj-pagination__item--dot]=\"page === '...'\"\n >\n @if (page !== currentPage && page !== '...') {\n <opal-lib-moj-pagination-link\n [changePage]=\"changePage\"\n [page]=\"+page\"\n [currentPage]=\"currentPage\"\n [totalPages]=\"totalPages()\"\n >\n {{ page }}\n </opal-lib-moj-pagination-link>\n } @else if (page === '...') {\n <strong>...</strong>\n } @else {\n {{ page }}\n }\n </li>\n }\n\n <li opal-lib-moj-pagination-item class=\"moj-pagination__item moj-pagination__item--next\">\n @if (currentPage < totalPages()) {\n <opal-lib-moj-pagination-link\n [changePage]=\"changePage\"\n [page]=\"currentPage + 1\"\n [currentPage]=\"currentPage\"\n [totalPages]=\"totalPages()\"\n >Next<span class=\"govuk-visually-hidden\"> page</span></opal-lib-moj-pagination-link\n >\n }\n </li>\n </ul>\n <p class=\"moj-pagination__results\">\n Showing <b>{{ startItem() - 1 }}</b> to <b>{{ endItem() }}</b> of <b>{{ totalItems() }}</b> results\n </p>\n</nav>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAOa,0BAA0B,CAAA;IACf,KAAK,GAAG,sBAAsB;wGADzC,0BAA0B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAA1B,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,0BAA0B,0KCPvC,6BACA,EAAA,CAAA;;4FDMa,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBALtC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,+DAA+D,WAChE,EAAE,EAAA,QAAA,EAAA,6BAAA,EAAA;8BAIW,KAAK,EAAA,CAAA;sBAA1B,WAAW;uBAAC,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AAA,sFAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,ED1CY,YAAY,+BAAE,0BAA0B,EAAA,QAAA,EAAA,+DAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,0BAA0B,EAAA,QAAA,EAAA,+DAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,0BAA0B,EAAA,QAAA,EAAA,8BAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,aAAA,EAAA,YAAA,EAAA,YAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;4FAI/F,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBARlC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,0BAA0B,EAAA,OAAA,EAG3B,CAAC,YAAY,EAAE,0BAA0B,EAAE,0BAA0B,EAAE,0BAA0B,CAAC,EAAA,eAAA,EAE1F,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,+4DAAA,EAAA,MAAA,EAAA,CAAA,sFAAA,CAAA,EAAA;8BAGtC,WAAW,EAAA,CAAA;sBAAnB;gBACQ,KAAK,EAAA,CAAA;sBAAb;gBACQ,cAAc,EAAA,CAAA;sBAAtB;gBACQ,KAAK,EAAA,CAAA;sBAAb;gBACQ,SAAS,EAAA,CAAA;sBAAjB;gBACS,UAAU,EAAA,CAAA;sBAAnB;;;AEpBH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"hmcts-opal-frontend-common-components-moj-moj-pagination.mjs","sources":["../../../projects/opal-frontend-common/components/moj/moj-pagination/moj-pagination.component.ts","../../../projects/opal-frontend-common/components/moj/moj-pagination/moj-pagination.component.html","../../../projects/opal-frontend-common/components/moj/moj-pagination/hmcts-opal-frontend-common-components-moj-moj-pagination.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnChanges, Output, signal } from '@angular/core';\n\n@Component({\n selector: 'opal-lib-moj-pagination',\n templateUrl: './moj-pagination.component.html',\n styleUrl: './moj-pagination.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class MojPaginationComponent implements OnChanges {\n private readonly pages = signal<number[]>([]);\n\n @Input({ required: true }) id!: string;\n @Input({ required: true }) currentPage: number = 1;\n @Input({ required: true }) total: number = 0;\n @Input({ required: true }) limit: number = 25;\n @Output() changePage = new EventEmitter<number>();\n\n public readonly elipsedPages = signal<(number | string)[]>([]);\n public readonly ELIPSIS = '…';\n\n /**\n * Gets the total number of pages available.\n *\n * @returns The total count of pages as a number.\n */\n get totalPages(): number {\n return this.pages().length;\n }\n\n /**\n * Gets the starting item index for the current page in a paginated list.\n *\n * @returns {number} The index of the first item on the current page, or 0 if there are no items.\n *\n * If `total` is 0, returns 0. Otherwise, calculates the starting index based on the current page and the limit per page.\n */\n get pageStart(): number {\n return this.total === 0 ? 0 : (this.currentPage - 1) * this.limit + 1;\n }\n\n /**\n * Gets the index of the last item on the current page.\n *\n * @returns {number} The index of the last item displayed on the current page.\n * Returns 0 if there are no items (`total` is 0). Otherwise, returns the lesser of\n * `currentPage * limit` and `total`, ensuring the end index does not exceed the total number of items.\n */\n get pageEnd(): number {\n return this.total === 0 ? 0 : Math.min(this.currentPage * this.limit, this.total);\n }\n\n /**\n * Calculates and updates the pagination pages and elided (skipped) pages based on the current limit and total items.\n *\n * - If either `limit` or `total` is less than or equal to zero, clears the pages and elided pages.\n * - Otherwise, computes the total number of pages, updates the `pages` observable with the full range,\n * and updates the `elipsedPages` observable with the result of skipping pages for ellipsis display.\n *\n * @private\n */\n private calculatePages() {\n if (this.limit <= 0 || this.total <= 0) {\n this.pages.set([]);\n this.elipsedPages.set([]);\n return;\n }\n const pagesCount = Math.ceil(this.total / this.limit);\n this.pages.set(this.range(1, pagesCount + 1));\n this.elipsedPages.set(this.elipseSkippedPages(this.pages(), this.currentPage));\n }\n\n /**\n * Generates an array of numbers starting from `start` up to, but not including, `end`.\n *\n * @param start - The starting number of the range (inclusive).\n * @param end - The ending number of the range (exclusive).\n * @returns An array of numbers from `start` to `end - 1`.\n */\n private range(start: number, end: number): number[] {\n const result: number[] = [];\n for (let i = start; i < end; i++) {\n result.push(i);\n }\n return result;\n }\n /**\n * Generates a pagination array with ellipses (\"...\") to represent skipped page ranges.\n *\n * The resulting array always includes the first and last page numbers, the current page,\n * and up to one page before and after the current page. Ellipses are inserted where\n * there are skipped ranges between the displayed pages.\n *\n * @param pages - An array of page numbers representing all available pages.\n * @param currentPage - The currently active page number.\n * @returns An array containing page numbers and ellipsis strings (\"...\") to indicate skipped pages.\n */\n private elipseSkippedPages(pages: number[], currentPage: number): (number | string)[] {\n const totalPages = pages.length;\n const first = 1;\n const last = totalPages;\n\n const result: (number | string)[] = [];\n\n // Always show the first page\n result.push(first);\n\n // Determine left-side ellipsis\n if (currentPage > first + 2) {\n result.push(this.ELIPSIS);\n }\n\n // Middle pages: current - 1, current, current + 1\n for (let i = currentPage - 1; i <= currentPage + 1; i++) {\n if (i > first && i < last) {\n result.push(i);\n }\n }\n\n // Decide whether to add right-side ellipsis\n const lastIncluded = result.includes(last);\n const secondLast = last - 1;\n if (!result.includes(secondLast) && !lastIncluded) {\n result.push(this.ELIPSIS);\n }\n\n // Add last page if not already included\n if (!lastIncluded && last !== first) {\n result.push(last);\n }\n\n return result;\n }\n\n /**\n * Handles the page change event for the pagination component.\n *\n * Prevents the default action of the event (if provided) and emits the selected page number.\n *\n * @param event - The event triggered by the page change action. If provided, its default behavior will be prevented.\n * @param page - The page number to navigate to.\n */\n public onPageChanged(event: Event, page: number): void {\n if (event) {\n event.preventDefault();\n }\n this.changePage.emit(page);\n }\n\n /**\n * Lifecycle hook that is called when any data-bound property of the component changes.\n * Invokes the `calculatePages` method to update the pagination state based on the new input values.\n */\n public ngOnChanges(): void {\n this.calculatePages();\n }\n}\n","@if (totalPages > 1) {\n <nav class=\"moj-pagination moj-pagination-alignment\" aria-label=\"Pagination navigation\" [id]=\"id\">\n <ul class=\"moj-pagination__list\">\n @if (currentPage > 1) {\n <li class=\"moj-pagination__item moj-pagination__item--prev\">\n <a\n class=\"moj-pagination__link\"\n (click)=\"onPageChanged($event, currentPage - 1)\"\n (keydown.enter)=\"onPageChanged($event, currentPage - 1)\"\n tabindex=\"0\"\n >Previous<span class=\"govuk-visually-hidden\"> page</span></a\n >\n </li>\n }\n\n @for (elipsedPage of elipsedPages(); track elipsedPage) {\n @switch (elipsedPage) {\n @case (currentPage) {\n <li\n class=\"moj-pagination__item moj-pagination__item--active\"\n [attr.aria-label]=\"'Page ' + elipsedPage + ' of ' + totalPages\"\n aria-current=\"page\"\n >\n {{ elipsedPage }}\n </li>\n }\n @case (ELIPSIS) {\n <li class=\"moj-pagination__item moj-pagination__item--dots\">{{ ELIPSIS }}</li>\n }\n @default {\n <li class=\"moj-pagination__item\">\n <a\n class=\"moj-pagination__link\"\n (click)=\"onPageChanged($event, +elipsedPage)\"\n (keydown.enter)=\"onPageChanged($event, +elipsedPage)\"\n tabindex=\"0\"\n [attr.aria-label]=\"'Page ' + elipsedPage + ' of ' + totalPages\"\n >\n {{ elipsedPage }}\n </a>\n </li>\n }\n }\n }\n\n @if (currentPage < totalPages) {\n <li class=\"moj-pagination__item moj-pagination__item--next\">\n <a\n class=\"moj-pagination__link\"\n (click)=\"onPageChanged($event, currentPage + 1)\"\n (keydown.enter)=\"onPageChanged($event, currentPage + 1)\"\n tabindex=\"0\"\n >\n Next<span class=\"govuk-visually-hidden\"> page</span></a\n >\n </li>\n }\n </ul>\n <p class=\"moj-pagination__results govuk-!-text-align-right\">\n Showing <b>{{ pageStart }}</b> to <b>{{ pageEnd }}</b> of <b>{{ total }}</b> results\n </p>\n </nav>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;MAQa,sBAAsB,CAAA;AAChB,IAAA,KAAK,GAAG,M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AC,EAAE,QAAQ,EAAE,IAAI,EAAE;gBACf,UAAU,EAAA,CAAA;sBAAnB;;;AEfH;;AAEG;;;;"}
|
|
@@ -24,10 +24,10 @@ class MojPrimaryNavigationItemComponent {
|
|
|
24
24
|
// Basically we want to mimic the behaviour of the GDS tabs component, as this is how these will be used.
|
|
25
25
|
this.router.navigate(['./'], { relativeTo: this.route, fragment: item });
|
|
26
26
|
}
|
|
27
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
28
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
27
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: MojPrimaryNavigationItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
28
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.4", type: MojPrimaryNavigationItemComponent, isStandalone: true, selector: "opal-lib-moj-primary-navigation-item, [opal-lib-moj-primary-navigation-item]", inputs: { primaryNavigationItemId: "primaryNavigationItemId", primaryNavigationItemFragment: "primaryNavigationItemFragment", primaryNavigationItemText: "primaryNavigationItemText", activeItemFragment: "activeItemFragment", isLastItem: "isLastItem" }, host: { properties: { "class": "this.hostClass", "id": "this.hostId", "class.last-item": "this.hostLastItem" } }, ngImport: i0, template: "<a\n href=\"\"\n class=\"moj-primary-navigation__link cursor-pointer\"\n [attr.aria-current]=\"primaryNavigationItemFragment === activeItemFragment ? 'page' : null\"\n (click)=\"handleItemClick($event, primaryNavigationItemFragment)\"\n (keyup.enter)=\"handleItemClick($event, primaryNavigationItemFragment)\"\n >{{ primaryNavigationItemText }}</a\n>\n", styles: [".moj-primary-navigation__item.last-item{margin-right:initial!important}.moj-primary-navigation__item{margin-right:20px}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
29
29
|
}
|
|
30
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
30
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: MojPrimaryNavigationItemComponent, decorators: [{
|
|
31
31
|
type: Component,
|
|
32
32
|
args: [{ selector: 'opal-lib-moj-primary-navigation-item, [opal-lib-moj-primary-navigation-item]', imports: [], changeDetection: ChangeDetectionStrategy.OnPush, template: "<a\n href=\"\"\n class=\"moj-primary-navigation__link cursor-pointer\"\n [attr.aria-current]=\"primaryNavigationItemFragment === activeItemFragment ? 'page' : null\"\n (click)=\"handleItemClick($event, primaryNavigationItemFragment)\"\n (keyup.enter)=\"handleItemClick($event, primaryNavigationItemFragment)\"\n >{{ primaryNavigationItemText }}</a\n>\n", styles: [".moj-primary-navigation__item.last-item{margin-right:initial!important}.moj-primary-navigation__item{margin-right:20px}\n"] }]
|
|
33
33
|
}], propDecorators: { primaryNavigationItemId: [{
|
|
@@ -89,10 +89,10 @@ class MojPrimaryNavigationComponent {
|
|
|
89
89
|
this.ngUnsubscribe.next();
|
|
90
90
|
this.ngUnsubscribe.complete();
|
|
91
91
|
}
|
|
92
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
93
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
92
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: MojPrimaryNavigationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
93
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.4", type: MojPrimaryNavigationComponent, isStandalone: true, selector: "opal-lib-moj-primary-navigation", inputs: { primaryNavigationId: "primaryNavigationId" }, outputs: { activeItemFragment: "activeItemFragment" }, ngImport: i0, template: "<div class=\"moj-primary-navigation\" [id]=\"primaryNavigationId\">\n <div class=\"moj-primary-navigation__container\">\n <div class=\"moj-primary-navigation__nav\">\n <nav class=\"moj-primary-navigation\" aria-label=\"Primary navigation\">\n <ul class=\"moj-primary-navigation__list\">\n <ng-content></ng-content>\n </ul>\n </nav>\n </div>\n </div>\n</div>\n", changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
94
94
|
}
|
|
95
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
95
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: MojPrimaryNavigationComponent, decorators: [{
|
|
96
96
|
type: Component,
|
|
97
97
|
args: [{ selector: 'opal-lib-moj-primary-navigation', imports: [], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"moj-primary-navigation\" [id]=\"primaryNavigationId\">\n <div class=\"moj-primary-navigation__container\">\n <div class=\"moj-primary-navigation__nav\">\n <nav class=\"moj-primary-navigation\" aria-label=\"Primary navigation\">\n <ul class=\"moj-primary-navigation__list\">\n <ng-content></ng-content>\n </ul>\n </nav>\n </div>\n </div>\n</div>\n" }]
|
|
98
98
|
}], propDecorators: { primaryNavigationId: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-components-moj-moj-primary-navigation.mjs","sources":["../../../projects/opal-frontend-common/components/moj/moj-primary-navigation/moj-primary-navigation-item/moj-primary-navigation-item.component.ts","../../../projects/opal-frontend-common/components/moj/moj-primary-navigation/moj-primary-navigation-item/moj-primary-navigation-item.component.html","../../../projects/opal-frontend-common/components/moj/moj-primary-navigation/moj-primary-navigation.component.ts","../../../projects/opal-frontend-common/components/moj/moj-primary-navigation/moj-primary-navigation.component.html","../../../projects/opal-frontend-common/components/moj/moj-primary-navigation/hmcts-opal-frontend-common-components-moj-moj-primary-navigation.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, HostBinding, Input, inject } from '@angular/core';\nimport { ActivatedRoute, Router } from '@angular/router';\n\n@Component({\n selector: 'opal-lib-moj-primary-navigation-item, [opal-lib-moj-primary-navigation-item]',\n imports: [],\n templateUrl: './moj-primary-navigation-item.component.html',\n styleUrls: ['./moj-primary-navigation-item.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class MojPrimaryNavigationItemComponent {\n private readonly router = inject(Router);\n private readonly route = inject(ActivatedRoute);\n\n @Input({ required: true }) public primaryNavigationItemId!: string;\n @Input({ required: true }) public primaryNavigationItemFragment!: string;\n @Input({ required: true }) public primaryNavigationItemText!: string;\n @Input({ required: true }) public activeItemFragment!: string;\n @Input({ required: false }) public isLastItem: boolean = false;\n\n @HostBinding('class') hostClass = 'moj-primary-navigation__item';\n @HostBinding('id') hostId = `${this.primaryNavigationItemId}`;\n @HostBinding('class.last-item') hostLastItem = this.isLastItem;\n\n /**\n * Handles the click event of a sub-navigation item.\n * @param event - The click event.\n * @param item - The item string.\n */\n public handleItemClick(event: Event, item: string): void {\n event.preventDefault();\n // Basically we want to mimic the behaviour of the GDS tabs component, as this is how these will be used.\n this.router.navigate(['./'], { relativeTo: this.route, fragment: item });\n }\n}\n","<a\n href=\"\"\n class=\"moj-primary-navigation__link cursor-pointer\"\n [attr.aria-current]=\"primaryNavigationItemFragment === activeItemFragment ? 'page' : null\"\n (click)=\"handleItemClick($event, primaryNavigationItemFragment)\"\n (keyup.enter)=\"handleItemClick($event, primaryNavigationItemFragment)\"\n >{{ primaryNavigationItemText }}</a\n>\n","import {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Input,\n OnDestroy,\n OnInit,\n Output,\n inject,\n} from '@angular/core';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { Subject, takeUntil } from 'rxjs';\n\n@Component({\n selector: 'opal-lib-moj-primary-navigation',\n imports: [],\n templateUrl: './moj-primary-navigation.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class MojPrimaryNavigationComponent implements OnInit, OnDestroy {\n private readonly router = inject(Router);\n private readonly route = inject(ActivatedRoute);\n private readonly ngUnsubscribe = new Subject<void>();\n\n @Input({ required: true }) public primaryNavigationId!: string;\n @Output() activeItemFragment = new EventEmitter<string>();\n\n /**\n * Sets up the listeners for the route fragment changes.\n * Emits the active navigation item when a fragment is present in the route.\n */\n private setupListeners(): void {\n // Basically we want to mimic the behaviour of the GDS tabs component, as this is how these will be used.\n this.route.fragment.pipe(takeUntil(this.ngUnsubscribe)).subscribe((fragment) => {\n if (fragment) {\n this.activeItemFragment.emit(fragment);\n }\n });\n }\n\n /**\n * Initializes the component.\n * This method is called after the component has been created and initialized.\n */\n public ngOnInit(): void {\n this.setupListeners();\n }\n\n /**\n * Lifecycle hook that is called when the component is about to be destroyed.\n * Unsubscribes from the route fragment subscription.\n */\n public ngOnDestroy(): void {\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n }\n}\n","<div class=\"moj-primary-navigation\" [id]=\"primaryNavigationId\">\n <div class=\"moj-primary-navigation__container\">\n <div class=\"moj-primary-navigation__nav\">\n <nav class=\"moj-primary-navigation\" aria-label=\"Primary navigation\">\n <ul class=\"moj-primary-navigation__list\">\n <ng-content></ng-content>\n </ul>\n </nav>\n </div>\n </div>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAUa,iCAAiC,CAAA;AAC3B,IAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AACvB,IAAA,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC;AAEb,IAAA,uBAAuB;AACvB,IAAA,6BAA6B;AAC7B,IAAA,yBAAyB;AACzB,IAAA,kBAAkB;IACjB,UAAU,GAAY,KAAK;IAExC,SAAS,GAAG,8BAA8B;AAC7C,IAAA,MAAM,GAAG,CAAA,EAAG,IAAI,CAAC,uBAAuB,EAAE;AAC7B,IAAA,YAAY,GAAG,IAAI,CAAC,UAAU;AAE9D;;;;AAIG;IACI,eAAe,CAAC,KAAY,EAAE,IAAY,EAAA;QAC/C,KAAK,CAAC,cAAc,EAAE;;QAEtB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,UAAU,EAAE,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC1E;
|
|
1
|
+
{"version":3,"file":"hmcts-opal-frontend-common-components-moj-moj-primary-navigation.mjs","sources":["../../../projects/opal-frontend-common/components/moj/moj-primary-navigation/moj-primary-navigation-item/moj-primary-navigation-item.component.ts","../../../projects/opal-frontend-common/components/moj/moj-primary-navigation/moj-primary-navigation-item/moj-primary-navigation-item.component.html","../../../projects/opal-frontend-common/components/moj/moj-primary-navigation/moj-primary-navigation.component.ts","../../../projects/opal-frontend-common/components/moj/moj-primary-navigation/moj-primary-navigation.component.html","../../../projects/opal-frontend-common/components/moj/moj-primary-navigation/hmcts-opal-frontend-common-components-moj-moj-primary-navigation.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, HostBinding, Input, inject } from '@angular/core';\nimport { ActivatedRoute, Router } from '@angular/router';\n\n@Component({\n selector: 'opal-lib-moj-primary-navigation-item, [opal-lib-moj-primary-navigation-item]',\n imports: [],\n templateUrl: './moj-primary-navigation-item.component.html',\n styleUrls: ['./moj-primary-navigation-item.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class MojPrimaryNavigationItemComponent {\n private readonly router = inject(Router);\n private readonly route = inject(ActivatedRoute);\n\n @Input({ required: true }) public primaryNavigationItemId!: string;\n @Input({ required: true }) public primaryNavigationItemFragment!: string;\n @Input({ required: true }) public primaryNavigationItemText!: string;\n @Input({ required: true }) public activeItemFragment!: string;\n @Input({ required: false }) public isLastItem: boolean = false;\n\n @HostBinding('class') hostClass = 'moj-primary-navigation__item';\n @HostBinding('id') hostId = `${this.primaryNavigationItemId}`;\n @HostBinding('class.last-item') hostLastItem = this.isLastItem;\n\n /**\n * Handles the click event of a sub-navigation item.\n * @param event - The click event.\n * @param item - The item string.\n */\n public handleItemClick(event: Event, item: string): void {\n event.preventDefault();\n // Basically we want to mimic the behaviour of the GDS tabs component, as this is how these will be used.\n this.router.navigate(['./'], { relativeTo: this.route, fragment: item });\n }\n}\n","<a\n href=\"\"\n class=\"moj-primary-navigation__link cursor-pointer\"\n [attr.aria-current]=\"primaryNavigationItemFragment === activeItemFragment ? 'page' : null\"\n (click)=\"handleItemClick($event, primaryNavigationItemFragment)\"\n (keyup.enter)=\"handleItemClick($event, primaryNavigationItemFragment)\"\n >{{ primaryNavigationItemText }}</a\n>\n","import {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Input,\n OnDestroy,\n OnInit,\n Output,\n inject,\n} from '@angular/core';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { Subject, takeUntil } from 'rxjs';\n\n@Component({\n selector: 'opal-lib-moj-primary-navigation',\n imports: [],\n templateUrl: './moj-primary-navigation.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class MojPrimaryNavigationComponent implements OnInit, OnDestroy {\n private readonly router = inject(Router);\n private readonly route = inject(ActivatedRoute);\n private readonly ngUnsubscribe = new Subject<void>();\n\n @Input({ required: true }) public primaryNavigationId!: string;\n @Output() activeItemFragment = new EventEmitter<string>();\n\n /**\n * Sets up the listeners for the route fragment changes.\n * Emits the active navigation item when a fragment is present in the route.\n */\n private setupListeners(): void {\n // Basically we want to mimic the behaviour of the GDS tabs component, as this is how these will be used.\n this.route.fragment.pipe(takeUntil(this.ngUnsubscribe)).subscribe((fragment) => {\n if (fragment) {\n this.activeItemFragment.emit(fragment);\n }\n });\n }\n\n /**\n * Initializes the component.\n * This method is called after the component has been created and initialized.\n */\n public ngOnInit(): void {\n this.setupListeners();\n }\n\n /**\n * Lifecycle hook that is called when the component is about to be destroyed.\n * Unsubscribes from the route fragment subscription.\n */\n public ngOnDestroy(): void {\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n }\n}\n","<div class=\"moj-primary-navigation\" [id]=\"primaryNavigationId\">\n <div class=\"moj-primary-navigation__container\">\n <div class=\"moj-primary-navigation__nav\">\n <nav class=\"moj-primary-navigation\" aria-label=\"Primary navigation\">\n <ul class=\"moj-primary-navigation__list\">\n <ng-content></ng-content>\n </ul>\n </nav>\n </div>\n </div>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAUa,iCAAiC,CAAA;AAC3B,IAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AACvB,IAAA,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC;AAEb,IAAA,uBAAuB;AACvB,IAAA,6BAA6B;AAC7B,IAAA,yBAAyB;AACzB,IAAA,kBAAkB;IACjB,UAAU,GAAY,KAAK;IAExC,SAAS,GAAG,8BAA8B;AAC7C,IAAA,MAAM,GAAG,CAAA,EAAG,IAAI,CAAC,uBAAuB,EAAE;AAC7B,IAAA,YAAY,GAAG,IAAI,CAAC,UAAU;AAE9D;;;;AAIG;IACI,eAAe,CAAC,KAAY,EAAE,IAAY,EAAA;QAC/C,KAAK,CAAC,cAAc,EAAE;;QAEtB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,UAAU,EAAE,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC1E;uGAvBW,iCAAiC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAjC,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,iCAAiC,sfCV9C,wWAQA,EAAA,MAAA,EAAA,CAAA,2HAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FDEa,iCAAiC,EAAA,UAAA,EAAA,CAAA;kBAP7C,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EA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