@hmcts/opal-frontend-common 0.0.65 → 0.0.67

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/fesm2022/{hmcts-opal-frontend-common-access-denied.component-CWImMW7J.mjs → hmcts-opal-frontend-common-access-denied.component-B14ZVnte.mjs} +4 -4
  2. package/fesm2022/{hmcts-opal-frontend-common-access-denied.component-CWImMW7J.mjs.map → hmcts-opal-frontend-common-access-denied.component-B14ZVnte.mjs.map} +1 -1
  3. package/fesm2022/{hmcts-opal-frontend-common-account-created.component-C-iCns7b.mjs → hmcts-opal-frontend-common-account-created.component-DMjRN8Y1.mjs} +4 -4
  4. package/fesm2022/{hmcts-opal-frontend-common-account-created.component-C-iCns7b.mjs.map → hmcts-opal-frontend-common-account-created.component-DMjRN8Y1.mjs.map} +1 -1
  5. package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-alias-base.mjs +6 -4
  6. package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-alias-base.mjs.map +1 -1
  7. package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-array-base.mjs +3 -3
  8. package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-array-removal-base.mjs +3 -3
  9. package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-base.mjs +3 -3
  10. package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-nested-form-base.mjs +3 -3
  11. package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-sortable-table-pagination.mjs +8 -8
  12. package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-sortable-table-pagination.mjs.map +1 -1
  13. package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-sortable-table.mjs +10 -10
  14. package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-sortable-table.mjs.map +1 -1
  15. package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-table-filter.mjs +10 -10
  16. package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-table-filter.mjs.map +1 -1
  17. package/fesm2022/hmcts-opal-frontend-common-components-alphagov-alphagov-accessible-autocomplete.mjs +3 -3
  18. package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-account-information-custom-account-information-item-custom-account-information-item-label.mjs +3 -3
  19. package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-account-information-custom-account-information-item-custom-account-information-item-value.mjs +3 -3
  20. package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-account-information-custom-account-information-item.mjs +3 -3
  21. package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-account-information.mjs +3 -3
  22. package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-action-links.mjs +3 -3
  23. package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-horizontal-scroll-pane.mjs +3 -3
  24. package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-page-header.mjs +3 -3
  25. package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-scrollable-panes-custom-scrollable-panes-inner-pane.mjs +3 -3
  26. package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-scrollable-panes.mjs +3 -3
  27. 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
  28. 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
  29. package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-summary-metric-bar-custom-summary-metric-bar-item.mjs +3 -3
  30. package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-summary-metric-bar.mjs +3 -3
  31. package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-vertical-scroll-pane-custom-vertical-scroll-pane-inner-pane.mjs +3 -3
  32. package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-vertical-scroll-pane-custom-vertical-scroll-pane-outer-pane.mjs +3 -3
  33. package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-vertical-scroll-pane.mjs +3 -3
  34. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-accordion.mjs +3 -3
  35. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-back-link.mjs +3 -3
  36. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-button.mjs +3 -3
  37. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-cancel-link.mjs +10 -6
  38. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-cancel-link.mjs.map +1 -1
  39. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-checkboxes.mjs +12 -12
  40. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-date-input.mjs +3 -3
  41. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-details.mjs +3 -3
  42. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-error-summary.mjs +3 -3
  43. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-footer.mjs +3 -3
  44. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-header.mjs +6 -6
  45. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-heading-with-caption.mjs +3 -3
  46. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-inset-text.mjs +3 -3
  47. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-list-govuk-list-link.mjs +3 -3
  48. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-list.mjs +3 -3
  49. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-notification-banner.mjs +3 -3
  50. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-pagination.mjs +5 -5
  51. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-pagination.mjs.map +1 -1
  52. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-panel.mjs +3 -3
  53. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-radio.mjs +12 -12
  54. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-select.mjs +3 -3
  55. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-summary-card-list.mjs +6 -6
  56. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-summary-list.mjs +12 -12
  57. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-table.mjs +12 -12
  58. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-tabs-govuk-tabs-list-item.mjs +3 -3
  59. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-tabs-govuk-tabs-panel.mjs +3 -3
  60. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-tabs.mjs +3 -3
  61. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-tag.mjs +3 -3
  62. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-task-list.mjs +6 -6
  63. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-text-area.mjs +5 -5
  64. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-text-area.mjs.map +1 -1
  65. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-text-input-prefix-suffix.mjs +3 -3
  66. package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-text-input.mjs +3 -3
  67. package/fesm2022/hmcts-opal-frontend-common-components-hod-hod-loading-spinner.mjs +3 -3
  68. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-alert.mjs +26 -22
  69. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-alert.mjs.map +1 -1
  70. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-badge.mjs +3 -3
  71. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-button-menu-moj-button-menu-item.mjs +3 -3
  72. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-button-menu.mjs +3 -3
  73. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-date-picker.mjs +3 -3
  74. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-header.mjs +3 -3
  75. 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
  76. 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
  77. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-option.mjs +3 -3
  78. 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
  79. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-selected.mjs +3 -3
  80. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel.mjs +3 -3
  81. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter.mjs +3 -3
  82. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-header.mjs +6 -6
  83. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-inset-text.mjs +3 -3
  84. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-notification-badge.mjs +3 -3
  85. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-page-header.mjs +3 -3
  86. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-pagination.mjs +5 -5
  87. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-pagination.mjs.map +1 -1
  88. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-primary-navigation.mjs +6 -6
  89. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-sortable-table.mjs +18 -18
  90. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-sub-navigation.mjs +6 -6
  91. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-ticket-panel.mjs +3 -3
  92. package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-timeline.mjs +6 -6
  93. package/fesm2022/{hmcts-opal-frontend-common-concurrency-failure.component-Cn-ShVc5.mjs → hmcts-opal-frontend-common-concurrency-failure.component-CQS1DbQQ.mjs} +4 -4
  94. package/fesm2022/{hmcts-opal-frontend-common-concurrency-failure.component-Cn-ShVc5.mjs.map → hmcts-opal-frontend-common-concurrency-failure.component-CQS1DbQQ.mjs.map} +1 -1
  95. package/fesm2022/hmcts-opal-frontend-common-directives-capitalisation.mjs +3 -3
  96. package/fesm2022/hmcts-opal-frontend-common-directives-govuk-button.mjs +3 -3
  97. package/fesm2022/hmcts-opal-frontend-common-directives-moj-multi-select.mjs +232 -0
  98. package/fesm2022/hmcts-opal-frontend-common-directives-moj-multi-select.mjs.map +1 -0
  99. package/fesm2022/{hmcts-opal-frontend-common-internal-server-error.component-DVPQlZoD.mjs → hmcts-opal-frontend-common-internal-server-error.component-lCp06yT-.mjs} +5 -5
  100. package/fesm2022/{hmcts-opal-frontend-common-internal-server-error.component-DVPQlZoD.mjs.map → hmcts-opal-frontend-common-internal-server-error.component-lCp06yT-.mjs.map} +1 -1
  101. package/fesm2022/{hmcts-opal-frontend-common-pages-access-denied.component-CWImMW7J.mjs → hmcts-opal-frontend-common-pages-access-denied.component-B14ZVnte.mjs} +4 -4
  102. package/fesm2022/{hmcts-opal-frontend-common-pages-access-denied.component-CWImMW7J.mjs.map → hmcts-opal-frontend-common-pages-access-denied.component-B14ZVnte.mjs.map} +1 -1
  103. package/fesm2022/{hmcts-opal-frontend-common-pages-account-created.component-C-iCns7b.mjs → hmcts-opal-frontend-common-pages-account-created.component-DMjRN8Y1.mjs} +4 -4
  104. package/fesm2022/{hmcts-opal-frontend-common-pages-account-created.component-C-iCns7b.mjs.map → hmcts-opal-frontend-common-pages-account-created.component-DMjRN8Y1.mjs.map} +1 -1
  105. package/fesm2022/{hmcts-opal-frontend-common-pages-concurrency-failure.component-Cn-ShVc5.mjs → hmcts-opal-frontend-common-pages-concurrency-failure.component-CQS1DbQQ.mjs} +4 -4
  106. package/fesm2022/{hmcts-opal-frontend-common-pages-concurrency-failure.component-Cn-ShVc5.mjs.map → hmcts-opal-frontend-common-pages-concurrency-failure.component-CQS1DbQQ.mjs.map} +1 -1
  107. package/fesm2022/hmcts-opal-frontend-common-pages-dashboard-page.mjs +4 -4
  108. package/fesm2022/hmcts-opal-frontend-common-pages-dashboard-page.mjs.map +1 -1
  109. package/fesm2022/{hmcts-opal-frontend-common-pages-internal-server-error.component-DVPQlZoD.mjs → hmcts-opal-frontend-common-pages-internal-server-error.component-lCp06yT-.mjs} +5 -5
  110. package/fesm2022/{hmcts-opal-frontend-common-pages-internal-server-error.component-DVPQlZoD.mjs.map → hmcts-opal-frontend-common-pages-internal-server-error.component-lCp06yT-.mjs.map} +1 -1
  111. package/fesm2022/{hmcts-opal-frontend-common-pages-permission-denied.component-CrhYr8aM.mjs → hmcts-opal-frontend-common-pages-permission-denied.component-DYa3iGTj.mjs} +4 -4
  112. package/fesm2022/{hmcts-opal-frontend-common-pages-permission-denied.component-CrhYr8aM.mjs.map → hmcts-opal-frontend-common-pages-permission-denied.component-DYa3iGTj.mjs.map} +1 -1
  113. package/fesm2022/{hmcts-opal-frontend-common-pages-sign-in-stub.component-CqOrm5qQ.mjs → hmcts-opal-frontend-common-pages-sign-in-stub.component-B87UHy9K.mjs} +4 -4
  114. package/fesm2022/{hmcts-opal-frontend-common-pages-sign-in-stub.component-CqOrm5qQ.mjs.map → hmcts-opal-frontend-common-pages-sign-in-stub.component-B87UHy9K.mjs.map} +1 -1
  115. package/fesm2022/{hmcts-opal-frontend-common-pages-sign-in.component-P8JcHzpe.mjs → hmcts-opal-frontend-common-pages-sign-in.component-Ctc9YosM.mjs} +4 -4
  116. package/fesm2022/{hmcts-opal-frontend-common-pages-sign-in.component-P8JcHzpe.mjs.map → hmcts-opal-frontend-common-pages-sign-in.component-Ctc9YosM.mjs.map} +1 -1
  117. package/fesm2022/hmcts-opal-frontend-common-pages.mjs +6 -6
  118. package/fesm2022/{hmcts-opal-frontend-common-permission-denied.component-CrhYr8aM.mjs → hmcts-opal-frontend-common-permission-denied.component-DYa3iGTj.mjs} +4 -4
  119. package/fesm2022/{hmcts-opal-frontend-common-permission-denied.component-CrhYr8aM.mjs.map → hmcts-opal-frontend-common-permission-denied.component-DYa3iGTj.mjs.map} +1 -1
  120. package/fesm2022/hmcts-opal-frontend-common-pipes-date-format.mjs +3 -3
  121. package/fesm2022/hmcts-opal-frontend-common-pipes-days-ago.mjs +3 -3
  122. package/fesm2022/hmcts-opal-frontend-common-pipes-monetary.mjs +3 -3
  123. package/fesm2022/hmcts-opal-frontend-common-pipes-national-insurance.mjs +3 -3
  124. package/fesm2022/hmcts-opal-frontend-common-resolvers-title.mjs +3 -3
  125. package/fesm2022/hmcts-opal-frontend-common-services-app-initializer-service.mjs +3 -3
  126. package/fesm2022/hmcts-opal-frontend-common-services-app-insights-service.mjs +3 -3
  127. package/fesm2022/hmcts-opal-frontend-common-services-auth-service.mjs +3 -3
  128. package/fesm2022/hmcts-opal-frontend-common-services-date-service.mjs +3 -3
  129. package/fesm2022/hmcts-opal-frontend-common-services-launch-darkly-service.mjs +3 -3
  130. package/fesm2022/hmcts-opal-frontend-common-services-opal-user-service.mjs +3 -3
  131. package/fesm2022/hmcts-opal-frontend-common-services-permissions-service.mjs +3 -3
  132. package/fesm2022/hmcts-opal-frontend-common-services-session-service.mjs +3 -3
  133. package/fesm2022/hmcts-opal-frontend-common-services-sort-service.mjs +3 -3
  134. package/fesm2022/hmcts-opal-frontend-common-services-transfer-state-service.mjs +3 -3
  135. package/fesm2022/hmcts-opal-frontend-common-services-transformation-service.mjs +3 -3
  136. package/fesm2022/hmcts-opal-frontend-common-services-utils-service.mjs +3 -3
  137. package/fesm2022/{hmcts-opal-frontend-common-sign-in-stub.component-CqOrm5qQ.mjs → hmcts-opal-frontend-common-sign-in-stub.component-B87UHy9K.mjs} +4 -4
  138. package/fesm2022/{hmcts-opal-frontend-common-sign-in-stub.component-CqOrm5qQ.mjs.map → hmcts-opal-frontend-common-sign-in-stub.component-B87UHy9K.mjs.map} +1 -1
  139. package/fesm2022/{hmcts-opal-frontend-common-sign-in.component-HUJ3zyjB.mjs → hmcts-opal-frontend-common-sign-in.component-BjLHMHMm.mjs} +4 -4
  140. package/fesm2022/{hmcts-opal-frontend-common-sign-in.component-HUJ3zyjB.mjs.map → hmcts-opal-frontend-common-sign-in.component-BjLHMHMm.mjs.map} +1 -1
  141. package/fesm2022/hmcts-opal-frontend-common.mjs +6 -6
  142. package/package.json +8 -2
  143. package/styles/styles.scss +1 -1
  144. package/types/hmcts-opal-frontend-common-components-abstract-abstract-form-alias-base.d.ts +2 -1
  145. package/types/hmcts-opal-frontend-common-components-govuk-govuk-cancel-link.d.ts +5 -2
  146. package/types/hmcts-opal-frontend-common-components-moj-moj-alert.d.ts +2 -1
  147. package/types/hmcts-opal-frontend-common-directives-moj-multi-select.d.ts +115 -0
@@ -9,13 +9,13 @@ class AccessDeniedComponent {
9
9
  // For now, test page will act as our 'Dashboard' page
10
10
  this.router.navigate(['/']);
11
11
  }
12
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: AccessDeniedComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
13
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.1", type: AccessDeniedComponent, isStandalone: true, selector: "opal-lib-access-denied", ngImport: i0, template: "<div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-two-thirds\">\n <h1 class=\"govuk-heading-l\">Access Denied</h1>\n <p class=\"govuk-body\">You do not have the appropriate permissions to access this page.</p>\n <p class=\"govuk-body\">\n <opal-lib-govuk-button\n buttonClasses=\"govuk-button--secondary\"\n buttonId=\"go-back\"\n (buttonClickEvent)=\"handleGoBackButtonClick()\"\n >\n Back to dashboard</opal-lib-govuk-button\n >\n </p>\n </div>\n</div>\n", dependencies: [{ kind: "component", type: GovukButtonComponent, selector: "opal-lib-govuk-button", inputs: ["buttonId", "type", "buttonClasses"], outputs: ["buttonClickEvent"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
12
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: AccessDeniedComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
13
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.6", type: AccessDeniedComponent, isStandalone: true, selector: "opal-lib-access-denied", ngImport: i0, template: "<div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-two-thirds\">\n <h1 class=\"govuk-heading-l\">Access Denied</h1>\n <p class=\"govuk-body\">You do not have the appropriate permissions to access this page.</p>\n <p class=\"govuk-body\">\n <opal-lib-govuk-button\n buttonClasses=\"govuk-button--secondary\"\n buttonId=\"go-back\"\n (buttonClickEvent)=\"handleGoBackButtonClick()\"\n >\n Back to dashboard</opal-lib-govuk-button\n >\n </p>\n </div>\n</div>\n", dependencies: [{ kind: "component", type: GovukButtonComponent, selector: "opal-lib-govuk-button", inputs: ["buttonId", "type", "buttonClasses"], outputs: ["buttonClickEvent"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
14
14
  }
15
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: AccessDeniedComponent, decorators: [{
15
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: AccessDeniedComponent, decorators: [{
16
16
  type: Component,
17
17
  args: [{ selector: 'opal-lib-access-denied', imports: [GovukButtonComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-two-thirds\">\n <h1 class=\"govuk-heading-l\">Access Denied</h1>\n <p class=\"govuk-body\">You do not have the appropriate permissions to access this page.</p>\n <p class=\"govuk-body\">\n <opal-lib-govuk-button\n buttonClasses=\"govuk-button--secondary\"\n buttonId=\"go-back\"\n (buttonClickEvent)=\"handleGoBackButtonClick()\"\n >\n Back to dashboard</opal-lib-govuk-button\n >\n </p>\n </div>\n</div>\n" }]
18
18
  }] });
19
19
 
20
20
  export { AccessDeniedComponent };
21
- //# sourceMappingURL=hmcts-opal-frontend-common-access-denied.component-CWImMW7J.mjs.map
21
+ //# sourceMappingURL=hmcts-opal-frontend-common-access-denied.component-B14ZVnte.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"hmcts-opal-frontend-common-access-denied.component-CWImMW7J.mjs","sources":["../../../projects/opal-frontend-common/pages/access-denied/access-denied.component.ts","../../../projects/opal-frontend-common/pages/access-denied/access-denied.component.html"],"sourcesContent":["import { ChangeDetectionStrategy, Component, inject } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { GovukButtonComponent } from '@hmcts/opal-frontend-common/components/govuk/govuk-button';\n\n@Component({\n selector: 'opal-lib-access-denied',\n imports: [GovukButtonComponent],\n templateUrl: './access-denied.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class AccessDeniedComponent {\n private readonly router = inject(Router);\n\n public handleGoBackButtonClick(): void {\n // For now, test page will act as our 'Dashboard' page\n this.router.navigate(['/']);\n }\n}\n","<div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-two-thirds\">\n <h1 class=\"govuk-heading-l\">Access Denied</h1>\n <p class=\"govuk-body\">You do not have the appropriate permissions to access this page.</p>\n <p class=\"govuk-body\">\n <opal-lib-govuk-button\n buttonClasses=\"govuk-button--secondary\"\n buttonId=\"go-back\"\n (buttonClickEvent)=\"handleGoBackButtonClick()\"\n >\n Back to dashboard</opal-lib-govuk-button\n >\n </p>\n </div>\n</div>\n"],"names":[],"mappings":";;;;;MAUa,qBAAqB,CAAA;AACf,IAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;IAEjC,uBAAuB,GAAA;;QAE5B,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC;IAC7B;uGANW,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAArB,qBAAqB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,wBAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECVlC,ihBAeA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDTY,oBAAoB,EAAA,QAAA,EAAA,uBAAA,EAAA,MAAA,EAAA,CAAA,UAAA,EAAA,MAAA,EAAA,eAAA,CAAA,EAAA,OAAA,EAAA,CAAA,kBAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAInB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBANjC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,wBAAwB,WACzB,CAAC,oBAAoB,CAAC,EAAA,eAAA,EAEd,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,ihBAAA,EAAA;;;;;"}
1
+ {"version":3,"file":"hmcts-opal-frontend-common-access-denied.component-B14ZVnte.mjs","sources":["../../../projects/opal-frontend-common/pages/access-denied/access-denied.component.ts","../../../projects/opal-frontend-common/pages/access-denied/access-denied.component.html"],"sourcesContent":["import { ChangeDetectionStrategy, Component, inject } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { GovukButtonComponent } from '@hmcts/opal-frontend-common/components/govuk/govuk-button';\n\n@Component({\n selector: 'opal-lib-access-denied',\n imports: [GovukButtonComponent],\n templateUrl: './access-denied.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class AccessDeniedComponent {\n private readonly router = inject(Router);\n\n public handleGoBackButtonClick(): void {\n // For now, test page will act as our 'Dashboard' page\n this.router.navigate(['/']);\n }\n}\n","<div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-two-thirds\">\n <h1 class=\"govuk-heading-l\">Access Denied</h1>\n <p class=\"govuk-body\">You do not have the appropriate permissions to access this page.</p>\n <p class=\"govuk-body\">\n <opal-lib-govuk-button\n buttonClasses=\"govuk-button--secondary\"\n buttonId=\"go-back\"\n (buttonClickEvent)=\"handleGoBackButtonClick()\"\n >\n Back to dashboard</opal-lib-govuk-button\n >\n </p>\n </div>\n</div>\n"],"names":[],"mappings":";;;;;MAUa,qBAAqB,CAAA;AACf,IAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;IAEjC,uBAAuB,GAAA;;QAE5B,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC;IAC7B;uGANW,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAArB,qBAAqB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,wBAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECVlC,ihBAeA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDTY,oBAAoB,EAAA,QAAA,EAAA,uBAAA,EAAA,MAAA,EAAA,CAAA,UAAA,EAAA,MAAA,EAAA,eAAA,CAAA,EAAA,OAAA,EAAA,CAAA,kBAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAInB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBANjC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,wBAAwB,WACzB,CAAC,oBAAoB,CAAC,EAAA,eAAA,EAEd,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,ihBAAA,EAAA;;;;;"}
@@ -3,13 +3,13 @@ import { ChangeDetectionStrategy, Component } from '@angular/core';
3
3
  import { GovukPanelComponent } from '@hmcts/opal-frontend-common/components/govuk/govuk-panel';
4
4
 
5
5
  class AccountCreated {
6
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: AccountCreated, deps: [], target: i0.ɵɵFactoryTarget.Component });
7
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.1", type: AccountCreated, isStandalone: true, selector: "opal-lib-account-created", ngImport: i0, template: "<div class=\"govuk-grid-column-two-thirds\">\n <opal-lib-govuk-panel panelTitle=\"User account created\"></opal-lib-govuk-panel>\n <fieldset class=\"govuk-fieldset\">\n <legend class=\"govuk-fieldset__legend govuk-fieldset__legend--m\">\n <h2 class=\"govuk-fieldset__heading\">Next steps</h2>\n </legend>\n <p class=\"govuk-body\">\n Your Opal account has been created but is not yet live. <br />\n Contact your team lead to activate it fully.\n </p>\n </fieldset>\n</div>\n", dependencies: [{ kind: "component", type: GovukPanelComponent, selector: "opal-lib-govuk-panel", inputs: ["panelTitle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
6
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: AccountCreated, deps: [], target: i0.ɵɵFactoryTarget.Component });
7
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.6", type: AccountCreated, isStandalone: true, selector: "opal-lib-account-created", ngImport: i0, template: "<div class=\"govuk-grid-column-two-thirds\">\n <opal-lib-govuk-panel panelTitle=\"User account created\"></opal-lib-govuk-panel>\n <fieldset class=\"govuk-fieldset\">\n <legend class=\"govuk-fieldset__legend govuk-fieldset__legend--m\">\n <h2 class=\"govuk-fieldset__heading\">Next steps</h2>\n </legend>\n <p class=\"govuk-body\">\n Your Opal account has been created but is not yet live. <br />\n Contact your team lead to activate it fully.\n </p>\n </fieldset>\n</div>\n", dependencies: [{ kind: "component", type: GovukPanelComponent, selector: "opal-lib-govuk-panel", inputs: ["panelTitle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
8
8
  }
9
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: AccountCreated, decorators: [{
9
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: AccountCreated, decorators: [{
10
10
  type: Component,
11
11
  args: [{ selector: 'opal-lib-account-created', imports: [GovukPanelComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"govuk-grid-column-two-thirds\">\n <opal-lib-govuk-panel panelTitle=\"User account created\"></opal-lib-govuk-panel>\n <fieldset class=\"govuk-fieldset\">\n <legend class=\"govuk-fieldset__legend govuk-fieldset__legend--m\">\n <h2 class=\"govuk-fieldset__heading\">Next steps</h2>\n </legend>\n <p class=\"govuk-body\">\n Your Opal account has been created but is not yet live. <br />\n Contact your team lead to activate it fully.\n </p>\n </fieldset>\n</div>\n" }]
12
12
  }] });
13
13
 
14
14
  export { AccountCreated };
15
- //# sourceMappingURL=hmcts-opal-frontend-common-account-created.component-C-iCns7b.mjs.map
15
+ //# sourceMappingURL=hmcts-opal-frontend-common-account-created.component-DMjRN8Y1.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"hmcts-opal-frontend-common-account-created.component-C-iCns7b.mjs","sources":["../../../projects/opal-frontend-common/pages/account-created/account-created.component.ts","../../../projects/opal-frontend-common/pages/account-created/account-created.component.html"],"sourcesContent":["import { ChangeDetectionStrategy, Component } from '@angular/core';\nimport { GovukPanelComponent } from '@hmcts/opal-frontend-common/components/govuk/govuk-panel';\n\n@Component({\n selector: 'opal-lib-account-created',\n imports: [GovukPanelComponent],\n templateUrl: './account-created.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class AccountCreated {}\n","<div class=\"govuk-grid-column-two-thirds\">\n <opal-lib-govuk-panel panelTitle=\"User account created\"></opal-lib-govuk-panel>\n <fieldset class=\"govuk-fieldset\">\n <legend class=\"govuk-fieldset__legend govuk-fieldset__legend--m\">\n <h2 class=\"govuk-fieldset__heading\">Next steps</h2>\n </legend>\n <p class=\"govuk-body\">\n Your Opal account has been created but is not yet live. <br />\n Contact your team lead to activate it fully.\n </p>\n </fieldset>\n</div>\n"],"names":[],"mappings":";;;;MASa,cAAc,CAAA;uGAAd,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAd,cAAc,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,0BAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECT3B,0fAYA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDPY,mBAAmB,EAAA,QAAA,EAAA,sBAAA,EAAA,MAAA,EAAA,CAAA,YAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAIlB,cAAc,EAAA,UAAA,EAAA,CAAA;kBAN1B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,0BAA0B,WAC3B,CAAC,mBAAmB,CAAC,EAAA,eAAA,EAEb,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,0fAAA,EAAA;;;;;"}
1
+ {"version":3,"file":"hmcts-opal-frontend-common-account-created.component-DMjRN8Y1.mjs","sources":["../../../projects/opal-frontend-common/pages/account-created/account-created.component.ts","../../../projects/opal-frontend-common/pages/account-created/account-created.component.html"],"sourcesContent":["import { ChangeDetectionStrategy, Component } from '@angular/core';\nimport { GovukPanelComponent } from '@hmcts/opal-frontend-common/components/govuk/govuk-panel';\n\n@Component({\n selector: 'opal-lib-account-created',\n imports: [GovukPanelComponent],\n templateUrl: './account-created.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class AccountCreated {}\n","<div class=\"govuk-grid-column-two-thirds\">\n <opal-lib-govuk-panel panelTitle=\"User account created\"></opal-lib-govuk-panel>\n <fieldset class=\"govuk-fieldset\">\n <legend class=\"govuk-fieldset__legend govuk-fieldset__legend--m\">\n <h2 class=\"govuk-fieldset__heading\">Next steps</h2>\n </legend>\n <p class=\"govuk-body\">\n Your Opal account has been created but is not yet live. <br />\n Contact your team lead to activate it fully.\n </p>\n </fieldset>\n</div>\n"],"names":[],"mappings":";;;;MASa,cAAc,CAAA;uGAAd,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAd,cAAc,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,0BAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECT3B,0fAYA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDPY,mBAAmB,EAAA,QAAA,EAAA,sBAAA,EAAA,MAAA,EAAA,CAAA,YAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAIlB,cAAc,EAAA,UAAA,EAAA,CAAA;kBAN1B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,0BAA0B,WAC3B,CAAC,mBAAmB,CAAC,EAAA,eAAA,EAEb,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,0fAAA,EAAA;;;;;"}
@@ -199,8 +199,10 @@ class AbstractFormAliasBaseComponent extends AbstractFormBaseComponent {
199
199
  *
200
200
  * @param index - The index of the alias to remove.
201
201
  * @param formArrayName - The name of the form array.
202
+ * @param event - The event object from the click event, used to prevent default behavior.
202
203
  */
203
- removeAlias(index, formArrayName) {
204
+ removeAlias(index, formArrayName, event) {
205
+ event?.preventDefault();
204
206
  this.aliasControls = this.removeFormAliasControls(index, formArrayName, this.aliasControls, this.aliasFields);
205
207
  }
206
208
  ngOnInit() {
@@ -211,10 +213,10 @@ class AbstractFormAliasBaseComponent extends AbstractFormBaseComponent {
211
213
  this['ngUnsubscribe'].complete();
212
214
  super.ngOnDestroy();
213
215
  }
214
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: AbstractFormAliasBaseComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
215
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.1", type: AbstractFormAliasBaseComponent, isStandalone: true, selector: "ng-component", viewQueries: [{ propertyName: "aliasFirstField", predicate: ["aliasFirstField"], descendants: true }], usesInheritance: true, ngImport: i0, template: '', isInline: true });
216
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: AbstractFormAliasBaseComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
217
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.6", type: AbstractFormAliasBaseComponent, isStandalone: true, selector: "ng-component", viewQueries: [{ propertyName: "aliasFirstField", predicate: ["aliasFirstField"], descendants: true }], usesInheritance: true, ngImport: i0, template: '', isInline: true });
216
218
  }
217
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: AbstractFormAliasBaseComponent, decorators: [{
219
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: AbstractFormAliasBaseComponent, decorators: [{
218
220
  type: Component,
219
221
  args: [{
220
222
  template: '',
@@ -1 +1 @@
1
- {"version":3,"file":"hmcts-opal-frontend-common-components-abstract-abstract-form-alias-base.mjs","sources":["../../../projects/opal-frontend-common/components/abstract/abstract-form-alias-base/abstract-form-alias-base.component.ts","../../../projects/opal-frontend-common/components/abstract/abstract-form-alias-base/hmcts-opal-frontend-common-components-abstract-abstract-form-alias-base.ts"],"sourcesContent":["import { FormArray, FormControl, FormGroup, ValidatorFn } from '@angular/forms';\nimport { takeUntil } from 'rxjs';\nimport { Component, OnDestroy, OnInit, QueryList, ViewChildren } from '@angular/core';\nimport { IAbstractFormAliasBaseAliasControls } from '@hmcts/opal-frontend-common/components/abstract/abstract-form-alias-base/interfaces';\nimport { AbstractFormBaseComponent } from '@hmcts/opal-frontend-common/components/abstract/abstract-form-base';\nimport {\n IAbstractFormArrayControlValidation,\n IAbstractFormArrayControls,\n IAbstractFormArrayControl,\n} from '@hmcts/opal-frontend-common/components/abstract/interfaces';\nimport { GovukTextInputComponent } from '@hmcts/opal-frontend-common/components/govuk/govuk-text-input';\n\n@Component({\n template: '',\n})\nexport abstract class AbstractFormAliasBaseComponent extends AbstractFormBaseComponent implements OnInit, OnDestroy {\n @ViewChildren('aliasFirstField') aliasFirstField!: QueryList<GovukTextInputComponent>;\n public aliasControls: IAbstractFormAliasBaseAliasControls[] = [];\n public aliasControlsValidation: IAbstractFormArrayControlValidation[] = [];\n public aliasFields: string[] = [];\n\n /**\n * Builds an array of form controls for the given form array.\n *\n * @param formControlCount - An array of numbers representing the number of form controls to create.\n * @param formArrayName - The name of the form array.\n * @param fieldNames - An array of field names.\n * @param controlValidation - An array of control validation objects.\n * @returns An array of form controls for the given form array.\n */\n private buildFormAliasControls(\n formControlCount: number[],\n formArrayName: string,\n fieldNames: string[],\n controlValidation: IAbstractFormArrayControlValidation[],\n ): IAbstractFormArrayControls[] {\n // Directly map each index to a control\n return formControlCount.map((_element, index) =>\n this.addAliasControls(index, formArrayName, fieldNames, controlValidation),\n );\n }\n\n /**\n * Adds alias controls to the form array.\n *\n * @param index - The index of the form array.\n * @param formArrayName - The name of the form array.\n * @param fieldNames - The names of the fields for the alias controls.\n * @param controlValidation - The validation rules for the alias controls.\n * @returns An object containing the form controls.\n */\n private addAliasControls(\n index: number,\n formArrayName: string,\n fieldNames: string[],\n controlValidation: IAbstractFormArrayControlValidation[],\n ): { [key: string]: IAbstractFormArrayControl } {\n const formAliases = this.form.get(formArrayName) as FormArray;\n const formAliasesFormGroup = new FormGroup({});\n\n // Create the form controls...\n const controls = this.createAliasControls(fieldNames, index);\n\n // Add the controls to the form group...\n this.addControlsToFormGroup(formAliasesFormGroup, controlValidation, index);\n\n // Add the form group to the form array...\n formAliases.push(formAliasesFormGroup);\n\n // Return the form controls...\n return controls;\n }\n\n /**\n * Removes all form alias controls from a FormArray and clears any associated error messages.\n *\n * @param formArrayControls - An array of form array controls.\n * @param formArrayName - The name of the FormArray.\n * @param fieldNames - An array of field names associated with the form array controls.\n * @returns An empty array of form array controls.\n */\n private removeAllFormAliasControls(\n formArrayControls: IAbstractFormArrayControls[],\n formArrayName: string,\n fieldNames: string[],\n ): [] {\n const control = this.form.get(formArrayName) as FormArray;\n\n // Clear the error messages...\n for (const [index] of formArrayControls.entries()) {\n this.removeFormAliasControlsErrors(index, formArrayControls, fieldNames);\n }\n\n // Reset the form array controls...\n control.clear();\n\n // Return en empty array of form array controls...\n return [];\n }\n\n /**\n * Creates a FormArray with the specified validators and controls.\n *\n * @param validators - An array of validators to apply to the FormArray.\n * @param controls - An optional array of initial FormControl instances to add to the FormArray.\n * @returns A new FormArray instance.\n */\n protected createFormAlias(validators: ValidatorFn[], controls: FormControl[] = []): FormArray {\n return new FormArray(controls, { validators: [...validators] });\n }\n\n /**\n * Removes a form alias control at the specified index from the given form array controls.\n *\n * @param index - The index of the form alias control to remove.\n * @param formArrayControls - The array of form array controls.\n * @returns The updated array of form array controls after removing the specified control.\n */\n protected removeFormAliasControl(\n index: number,\n formArrayControls: IAbstractFormArrayControls[],\n ): IAbstractFormArrayControls[] {\n formArrayControls.splice(index, 1);\n return formArrayControls;\n }\n\n /**\n * Sets up the alias form controls based on the provided alias count array and form array name.\n * If there are any aliases, the alias controls will be re-populated.\n *\n * @param aliasCountArray - An array containing the count of aliases.\n * @param formArrayName - The name of the form array.\n */\n protected setupAliasFormControls(aliasCountArray: number[], formArrayName: string): void {\n // Re-populate the alias controls if there are any aliases\n if (aliasCountArray.length) {\n this.aliasControls = this.buildFormAliasControls(\n aliasCountArray,\n formArrayName,\n this.aliasFields,\n this.aliasControlsValidation,\n );\n }\n }\n\n /**\n * Removes the form alias controls errors for a specific index in a form array.\n *\n * @param index - The index of the form array control.\n * @param formArrayControls - An array of form array controls.\n * @param fieldNames - An array of field names to remove errors from.\n */\n protected removeFormAliasControlsErrors(\n index: number,\n formArrayControls: IAbstractFormArrayControls[],\n fieldNames: string[],\n ): void {\n const formArrayControl = formArrayControls[index];\n\n if (formArrayControl) {\n for (const field of fieldNames) {\n delete this.formControlErrorMessages?.[formArrayControl[field].controlName];\n }\n }\n }\n\n /**\n * Creates alias controls for the given fields and index.\n * @param fields - The list of fields for which alias controls need to be created.\n * @param index - The index value used to generate unique identifiers for the controls.\n * @returns An object containing the alias controls.\n */\n protected createAliasControls(fields: string[], index: number): { [key: string]: IAbstractFormArrayControl } {\n return fields.reduce(\n (controls, field) => ({\n ...controls,\n [field]: {\n inputId: `${field}_${index}`,\n inputName: `${field}_${index}`,\n controlName: `${field}_${index}`,\n },\n }),\n {},\n );\n }\n\n /**\n * Sets up the alias checkbox listener.\n *\n * @param formCheckboxName - The name of the checkbox control in the form.\n * @param formArrayName - The name of the form array control in the form.\n */\n protected setUpAliasCheckboxListener(formCheckboxName: string, formArrayName: string): void {\n // Ensure any existing subscription is cleared to avoid memory leaks\n this['ngUnsubscribe'].next();\n this['ngUnsubscribe'].complete();\n\n const addAliasControl = this.form.get(formCheckboxName);\n if (!addAliasControl) {\n return;\n }\n\n addAliasControl.valueChanges.pipe(takeUntil(this['ngUnsubscribe'])).subscribe((shouldAddAlias) => {\n if (shouldAddAlias) {\n this.aliasControls = this.buildFormAliasControls(\n [0],\n formArrayName,\n this.aliasFields,\n this.aliasControlsValidation,\n );\n this.focusFirstAliasField();\n } else {\n this.aliasControls = this.removeAllFormAliasControls(this.aliasControls, formArrayName, this.aliasFields);\n }\n });\n }\n\n /**\n * Sets focus to the first input field of a newly added alias row.\n */\n public focusFirstAliasField(): void {\n this['changeDetectorRef'].detectChanges();\n setTimeout(() => {\n const index = this.aliasControls.length - 1;\n const inputId = this.aliasFirstField.get(index)?.inputId;\n if (inputId) {\n const el = document.getElementById(inputId);\n el?.focus();\n }\n }, 0);\n }\n\n /**\n * Removes a form alias control from a form array and updates the list of form array controls.\n * @param index - The index of the form alias control to be removed.\n * @param formArrayName - The name of the form array.\n * @param formArrayControls - The list of form array controls.\n * @param fieldNames - The names of the fields associated with the form array controls.\n * @returns The updated list of form array controls after removing the specified control.\n */\n public removeFormAliasControls(\n index: number,\n formArrayName: string,\n formArrayControls: IAbstractFormArrayControls[],\n fieldNames: string[],\n ): IAbstractFormArrayControls[] {\n // Get the form array...\n const control = this.form.get(formArrayName) as FormArray;\n\n // Remove the form array control based on index\n control.removeAt(index);\n\n // Then remove the form array controls errors...\n this.removeFormAliasControlsErrors(index, formArrayControls, fieldNames);\n\n // Return the new list of form array controls...\n return this.removeFormAliasControl(index, formArrayControls);\n }\n\n /**\n * Adds an alias to the specified index of the form array.\n * Sets user focus to the first field of the newly added alias.\n *\n * @param index - The index at which to add the alias.\n * @param formArrayName - The name of the form array.\n */\n public addAlias(index: number, formArrayName: string): void {\n this.aliasControls.push(\n this.addAliasControls(index, formArrayName, this.aliasFields, this.aliasControlsValidation),\n );\n this.focusFirstAliasField();\n }\n\n /**\n * Removes an alias from the form array.\n *\n * @param index - The index of the alias to remove.\n * @param formArrayName - The name of the form array.\n */\n public removeAlias(index: number, formArrayName: string): void {\n this.aliasControls = this.removeFormAliasControls(index, formArrayName, this.aliasControls, this.aliasFields);\n }\n\n public override ngOnInit(): void {\n super.ngOnInit();\n }\n\n public override ngOnDestroy(): void {\n this['ngUnsubscribe'].next();\n this['ngUnsubscribe'].complete();\n super.ngOnDestroy();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAeM,MAAgB,8BAA+B,SAAQ,yBAAyB,CAAA;AACnD,IAAA,eAAe;IACzC,aAAa,GAA0C,EAAE;IACzD,uBAAuB,GAA0C,EAAE;IACnE,WAAW,GAAa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AAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,8BAA8B,sMAFxC,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA;;2FAEQ,8BAA8B,EAAA,UAAA,EAAA,CAAA;kBAHnD,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,EAAE;AACb,iBAAA;;sBAEE,YAAY;uBAAC,iBAAiB;;;AChBjC;;AAEG;;;;"}
1
+ {"version":3,"file":"hmcts-opal-frontend-common-components-abstract-abstract-form-alias-base.mjs","sources":["../../../projects/opal-frontend-common/components/abstract/abstract-form-alias-base/abstract-form-alias-base.component.ts","../../../projects/opal-frontend-common/components/abstract/abstract-form-alias-base/hmcts-opal-frontend-common-components-abstract-abstract-form-alias-base.ts"],"sourcesContent":["import { FormArray, FormControl, FormGroup, ValidatorFn } from '@angular/forms';\nimport { takeUntil } from 'rxjs';\nimport { Component, OnDestroy, OnInit, QueryList, ViewChildren } from '@angular/core';\nimport { IAbstractFormAliasBaseAliasControls } from '@hmcts/opal-frontend-common/components/abstract/abstract-form-alias-base/interfaces';\nimport { AbstractFormBaseComponent } from '@hmcts/opal-frontend-common/components/abstract/abstract-form-base';\nimport {\n IAbstractFormArrayControlValidation,\n IAbstractFormArrayControls,\n IAbstractFormArrayControl,\n} from '@hmcts/opal-frontend-common/components/abstract/interfaces';\nimport { GovukTextInputComponent } from '@hmcts/opal-frontend-common/components/govuk/govuk-text-input';\n\n@Component({\n template: '',\n})\nexport abstract class AbstractFormAliasBaseComponent extends AbstractFormBaseComponent implements OnInit, OnDestroy {\n @ViewChildren('aliasFirstField') aliasFirstField!: QueryList<GovukTextInputComponent>;\n public aliasControls: IAbstractFormAliasBaseAliasControls[] = [];\n public aliasControlsValidation: IAbstractFormArrayControlValidation[] = [];\n public aliasFields: string[] = [];\n\n /**\n * Builds an array of form controls for the given form array.\n *\n * @param formControlCount - An array of numbers representing the number of form controls to create.\n * @param formArrayName - The name of the form array.\n * @param fieldNames - An array of field names.\n * @param controlValidation - An array of control validation objects.\n * @returns An array of form controls for the given form array.\n */\n private buildFormAliasControls(\n formControlCount: number[],\n formArrayName: string,\n fieldNames: string[],\n controlValidation: IAbstractFormArrayControlValidation[],\n ): IAbstractFormArrayControls[] {\n // Directly map each index to a control\n return formControlCount.map((_element, index) =>\n this.addAliasControls(index, formArrayName, fieldNames, controlValidation),\n );\n }\n\n /**\n * Adds alias controls to the form array.\n *\n * @param index - The index of the form array.\n * @param formArrayName - The name of the form array.\n * @param fieldNames - The names of the fields for the alias controls.\n * @param controlValidation - The validation rules for the alias controls.\n * @returns An object containing the form controls.\n */\n private addAliasControls(\n index: number,\n formArrayName: string,\n fieldNames: string[],\n controlValidation: IAbstractFormArrayControlValidation[],\n ): { [key: string]: IAbstractFormArrayControl } {\n const formAliases = this.form.get(formArrayName) as FormArray;\n const formAliasesFormGroup = new FormGroup({});\n\n // Create the form controls...\n const controls = this.createAliasControls(fieldNames, index);\n\n // Add the controls to the form group...\n this.addControlsToFormGroup(formAliasesFormGroup, controlValidation, index);\n\n // Add the form group to the form array...\n formAliases.push(formAliasesFormGroup);\n\n // Return the form controls...\n return controls;\n }\n\n /**\n * Removes all form alias controls from a FormArray and clears any associated error messages.\n *\n * @param formArrayControls - An array of form array controls.\n * @param formArrayName - The name of the FormArray.\n * @param fieldNames - An array of field names associated with the form array controls.\n * @returns An empty array of form array controls.\n */\n private removeAllFormAliasControls(\n formArrayControls: IAbstractFormArrayControls[],\n formArrayName: string,\n fieldNames: string[],\n ): [] {\n const control = this.form.get(formArrayName) as FormArray;\n\n // Clear the error messages...\n for (const [index] of formArrayControls.entries()) {\n this.removeFormAliasControlsErrors(index, formArrayControls, fieldNames);\n }\n\n // Reset the form array controls...\n control.clear();\n\n // Return en empty array of form array controls...\n return [];\n }\n\n /**\n * Creates a FormArray with the specified validators and controls.\n *\n * @param validators - An array of validators to apply to the FormArray.\n * @param controls - An optional array of initial FormControl instances to add to the FormArray.\n * @returns A new FormArray instance.\n */\n protected createFormAlias(validators: ValidatorFn[], controls: FormControl[] = []): FormArray {\n return new FormArray(controls, { validators: [...validators] });\n }\n\n /**\n * Removes a form alias control at the specified index from the given form array controls.\n *\n * @param index - The index of the form alias control to remove.\n * @param formArrayControls - The array of form array controls.\n * @returns The updated array of form array controls after removing the specified control.\n */\n protected removeFormAliasControl(\n index: number,\n formArrayControls: IAbstractFormArrayControls[],\n ): IAbstractFormArrayControls[] {\n formArrayControls.splice(index, 1);\n return formArrayControls;\n }\n\n /**\n * Sets up the alias form controls based on the provided alias count array and form array name.\n * If there are any aliases, the alias controls will be re-populated.\n *\n * @param aliasCountArray - An array containing the count of aliases.\n * @param formArrayName - The name of the form array.\n */\n protected setupAliasFormControls(aliasCountArray: number[], formArrayName: string): void {\n // Re-populate the alias controls if there are any aliases\n if (aliasCountArray.length) {\n this.aliasControls = this.buildFormAliasControls(\n aliasCountArray,\n formArrayName,\n this.aliasFields,\n this.aliasControlsValidation,\n );\n }\n }\n\n /**\n * Removes the form alias controls errors for a specific index in a form array.\n *\n * @param index - The index of the form array control.\n * @param formArrayControls - An array of form array controls.\n * @param fieldNames - An array of field names to remove errors from.\n */\n protected removeFormAliasControlsErrors(\n index: number,\n formArrayControls: IAbstractFormArrayControls[],\n fieldNames: string[],\n ): void {\n const formArrayControl = formArrayControls[index];\n\n if (formArrayControl) {\n for (const field of fieldNames) {\n delete this.formControlErrorMessages?.[formArrayControl[field].controlName];\n }\n }\n }\n\n /**\n * Creates alias controls for the given fields and index.\n * @param fields - The list of fields for which alias controls need to be created.\n * @param index - The index value used to generate unique identifiers for the controls.\n * @returns An object containing the alias controls.\n */\n protected createAliasControls(fields: string[], index: number): { [key: string]: IAbstractFormArrayControl } {\n return fields.reduce(\n (controls, field) => ({\n ...controls,\n [field]: {\n inputId: `${field}_${index}`,\n inputName: `${field}_${index}`,\n controlName: `${field}_${index}`,\n },\n }),\n {},\n );\n }\n\n /**\n * Sets up the alias checkbox listener.\n *\n * @param formCheckboxName - The name of the checkbox control in the form.\n * @param formArrayName - The name of the form array control in the form.\n */\n protected setUpAliasCheckboxListener(formCheckboxName: string, formArrayName: string): void {\n // Ensure any existing subscription is cleared to avoid memory leaks\n this['ngUnsubscribe'].next();\n this['ngUnsubscribe'].complete();\n\n const addAliasControl = this.form.get(formCheckboxName);\n if (!addAliasControl) {\n return;\n }\n\n addAliasControl.valueChanges.pipe(takeUntil(this['ngUnsubscribe'])).subscribe((shouldAddAlias) => {\n if (shouldAddAlias) {\n this.aliasControls = this.buildFormAliasControls(\n [0],\n formArrayName,\n this.aliasFields,\n this.aliasControlsValidation,\n );\n this.focusFirstAliasField();\n } else {\n this.aliasControls = this.removeAllFormAliasControls(this.aliasControls, formArrayName, this.aliasFields);\n }\n });\n }\n\n /**\n * Sets focus to the first input field of a newly added alias row.\n */\n public focusFirstAliasField(): void {\n this['changeDetectorRef'].detectChanges();\n setTimeout(() => {\n const index = this.aliasControls.length - 1;\n const inputId = this.aliasFirstField.get(index)?.inputId;\n if (inputId) {\n const el = document.getElementById(inputId);\n el?.focus();\n }\n }, 0);\n }\n\n /**\n * Removes a form alias control from a form array and updates the list of form array controls.\n * @param index - The index of the form alias control to be removed.\n * @param formArrayName - The name of the form array.\n * @param formArrayControls - The list of form array controls.\n * @param fieldNames - The names of the fields associated with the form array controls.\n * @returns The updated list of form array controls after removing the specified control.\n */\n public removeFormAliasControls(\n index: number,\n formArrayName: string,\n formArrayControls: IAbstractFormArrayControls[],\n fieldNames: string[],\n ): IAbstractFormArrayControls[] {\n // Get the form array...\n const control = this.form.get(formArrayName) as FormArray;\n\n // Remove the form array control based on index\n control.removeAt(index);\n\n // Then remove the form array controls errors...\n this.removeFormAliasControlsErrors(index, formArrayControls, fieldNames);\n\n // Return the new list of form array controls...\n return this.removeFormAliasControl(index, formArrayControls);\n }\n\n /**\n * Adds an alias to the specified index of the form array.\n * Sets user focus to the first field of the newly added alias.\n *\n * @param index - The index at which to add the alias.\n * @param formArrayName - The name of the form array.\n */\n public addAlias(index: number, formArrayName: string): void {\n this.aliasControls.push(\n this.addAliasControls(index, formArrayName, this.aliasFields, this.aliasControlsValidation),\n );\n this.focusFirstAliasField();\n }\n\n /**\n * Removes an alias from the form array.\n *\n * @param index - The index of the alias to remove.\n * @param formArrayName - The name of the form array.\n * @param event - The event object from the click event, used to prevent default behavior.\n */\n public removeAlias(index: number, formArrayName: string, event?: Event): void {\n event?.preventDefault();\n this.aliasControls = this.removeFormAliasControls(index, formArrayName, this.aliasControls, this.aliasFields);\n }\n\n public override ngOnInit(): void {\n super.ngOnInit();\n }\n\n public override ngOnDestroy(): void {\n this['ngUnsubscribe'].next();\n this['ngUnsubscribe'].complete();\n super.ngOnDestroy();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAeM,MAAgB,8BAA+B,SAAQ,yBAAyB,CAAA;AACnD,IAAA,eAAe;IACzC,aAAa,GAA0C,EAAE;IACzD,uBAAuB,GAA0C,EAAE;IACnE,WAAW,GAAa,EAAE;AAEjC;;;;;;;;AAQG;AACK,IAAA,sBAAsB,CAC5B,gBAA0B,EAC1B,aAAqB,EACrB,UAAoB,EACpB,iBAAwD,EAAA;;QAGxD,OAAO,gBAAgB,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,KAAK,KAC1C,IAAI,CAAC,gBAAgB,CAAC,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,iBAAiB,CAAC,CAC3E;IACH;AAEA;;;;;;;;AAQG;AACK,IAAA,gBAAgB,CACtB,KAAa,EACb,aAAqB,EACrB,UAAoB,EACpB,iBAAwD,EAAA;QAExD,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,aAAa,CAAc;AAC7D,QAAA,MAAM,oBAAoB,GAAG,IAAI,SAAS,CAAC,EAAE,CAAC;;QAG9C,MAAM,QAAQ,GAAG,IAAI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BAAgB,CAAC,KAAK,EAAE,aAAa,EAAE,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,uBAAuB,CAAC,CAC5F;QACD,IAAI,CAAC,oBAAoB,EAAE;IAC7B;AAEA;;;;;;AAMG;AACI,IAAA,WAAW,CAAC,KAAa,EAAE,aAAqB,EAAE,KAAa,EAAA;QACpE,KAAK,EAAE,cAAc,EAAE;AACvB,QAAA,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,uBAAuB,CAAC,KAAK,EAAE,aAAa,EAAE,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,WAAW,CAAC;IAC/G;IAEgB,QAAQ,GAAA;QACtB,KAAK,CAAC,QAAQ,EAAE;IAClB;IAEgB,WAAW,GAAA;AACzB,QAAA,IAAI,CAAC,eAAe,CAAC,CAAC,IAAI,EAAE;AAC5B,QAAA,IAAI,CAAC,eAAe,CAAC,CAAC,QAAQ,EAAE;QAChC,KAAK,CAAC,WAAW,EAAE;IACrB;uGAtRoB,8BAA8B,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAA9B,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,8BAA8B,sMAFxC,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA;;2FAEQ,8BAA8B,EAAA,UAAA,EAAA,CAAA;kBAHnD,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,EAAE;AACb,iBAAA;;sBAEE,YAAY;uBAAC,iBAAiB;;;AChBjC;;AAEG;;;;"}
@@ -234,10 +234,10 @@ class AbstractFormArrayBaseComponent extends AbstractFormBaseComponent {
234
234
  this.ngUnsubscribe.complete();
235
235
  super.ngOnDestroy();
236
236
  }
237
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: AbstractFormArrayBaseComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
238
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.1", type: AbstractFormArrayBaseComponent, isStandalone: true, selector: "ng-component", usesInheritance: true, ngImport: i0, template: '', isInline: true });
237
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: AbstractFormArrayBaseComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
238
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.6", type: AbstractFormArrayBaseComponent, isStandalone: true, selector: "ng-component", usesInheritance: true, ngImport: i0, template: '', isInline: true });
239
239
  }
240
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: AbstractFormArrayBaseComponent, decorators: [{
240
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: AbstractFormArrayBaseComponent, decorators: [{
241
241
  type: Component,
242
242
  args: [{
243
243
  template: '',
@@ -77,10 +77,10 @@ class AbstractFormArrayRemovalComponent {
77
77
  this.router.navigate([route], { relativeTo: this.activatedRoute.parent });
78
78
  }
79
79
  }
80
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: AbstractFormArrayRemovalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
81
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.1", type: AbstractFormArrayRemovalComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: '', isInline: true });
80
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: AbstractFormArrayRemovalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
81
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.6", type: AbstractFormArrayRemovalComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: '', isInline: true });
82
82
  }
83
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: AbstractFormArrayRemovalComponent, decorators: [{
83
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: AbstractFormArrayRemovalComponent, decorators: [{
84
84
  type: Component,
85
85
  args: [{
86
86
  template: '',
@@ -595,10 +595,10 @@ class AbstractFormBaseComponent {
595
595
  this.ngUnsubscribe.next();
596
596
  this.ngUnsubscribe.complete();
597
597
  }
598
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: AbstractFormBaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
599
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.1", type: AbstractFormBaseComponent, isStandalone: true, selector: "ng-component", outputs: { unsavedChanges: "unsavedChanges", formSubmit: "formSubmit" }, ngImport: i0, template: '', isInline: true });
598
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: AbstractFormBaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
599
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.6", type: AbstractFormBaseComponent, isStandalone: true, selector: "ng-component", outputs: { unsavedChanges: "unsavedChanges", formSubmit: "formSubmit" }, ngImport: i0, template: '', isInline: true });
600
600
  }
601
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: AbstractFormBaseComponent, decorators: [{
601
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: AbstractFormBaseComponent, decorators: [{
602
602
  type: Component,
603
603
  args: [{
604
604
  template: '',
@@ -125,10 +125,10 @@ class AbstractNestedFormBaseComponent extends AbstractFormBaseComponent {
125
125
  }
126
126
  super.ngOnDestroy();
127
127
  }
128
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: AbstractNestedFormBaseComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
129
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.1", type: AbstractNestedFormBaseComponent, isStandalone: true, selector: "ng-component", usesInheritance: true, ngImport: i0, template: '', isInline: true });
128
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: AbstractNestedFormBaseComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
129
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.6", type: AbstractNestedFormBaseComponent, isStandalone: true, selector: "ng-component", usesInheritance: true, ngImport: i0, template: '', isInline: true });
130
130
  }
131
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: AbstractNestedFormBaseComponent, decorators: [{
131
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: AbstractNestedFormBaseComponent, decorators: [{
132
132
  type: Component,
133
133
  args: [{
134
134
  template: '',
@@ -4,14 +4,14 @@ import { AbstractSortableTableComponent } from '@hmcts/opal-frontend-common/comp
4
4
 
5
5
  class AbstractSortableTablePaginationComponent extends AbstractSortableTableComponent {
6
6
  // Signal for the current page. Used to calculate the start and end indices for pagination.
7
- currentPageSignal = signal(1, ...(ngDevMode ? [{ debugName: "currentPageSignal" }] : []));
7
+ currentPageSignal = signal(1, ...(ngDevMode ? [{ debugName: "currentPageSignal" }] : /* istanbul ignore next */ []));
8
8
  // Signal for the number of items per page. Determines how many items are displayed on each page.
9
- itemsPerPageSignal = signal(10, ...(ngDevMode ? [{ debugName: "itemsPerPageSignal" }] : []));
9
+ itemsPerPageSignal = signal(10, ...(ngDevMode ? [{ debugName: "itemsPerPageSignal" }] : /* istanbul ignore next */ []));
10
10
  // Signal for the start index (1-based). Automatically updates when `currentPageSignal` or `itemsPerPageSignal` changes.
11
11
  startIndexComputed = computed(() => {
12
12
  const currentPage = this.currentPageSignal();
13
13
  return (currentPage - 1) * this.itemsPerPageSignal() + 1;
14
- }, ...(ngDevMode ? [{ debugName: "startIndexComputed" }] : []));
14
+ }, ...(ngDevMode ? [{ debugName: "startIndexComputed" }] : /* istanbul ignore next */ []));
15
15
  /**
16
16
  * Computes the end index for the current page of the sorted table data.
17
17
  * Ensures the end index does not exceed the total number of items.
@@ -20,12 +20,12 @@ class AbstractSortableTablePaginationComponent extends AbstractSortableTableComp
20
20
  */
21
21
  endIndexComputed = computed(() => {
22
22
  return Math.min(this.sortedTableDataSignal().length, this.startIndexComputed() + this.itemsPerPageSignal() - 1);
23
- }, ...(ngDevMode ? [{ debugName: "endIndexComputed" }] : []));
23
+ }, ...(ngDevMode ? [{ debugName: "endIndexComputed" }] : /* istanbul ignore next */ []));
24
24
  // Computed signal for paginated table data. Reactively slices `displayTableDataSignal` based on `startIndexComputed` and `endIndexComputed`.
25
25
  paginatedTableDataComputed = computed(() => {
26
26
  const data = this.sortedTableDataSignal(); // Full table data
27
27
  return data.slice(this.startIndexComputed() - 1, this.endIndexComputed()); // Return paginated data subset
28
- }, ...(ngDevMode ? [{ debugName: "paginatedTableDataComputed" }] : []));
28
+ }, ...(ngDevMode ? [{ debugName: "paginatedTableDataComputed" }] : /* istanbul ignore next */ []));
29
29
  /**
30
30
  * Handles sorting changes and resets the page to the first page.
31
31
  *
@@ -61,10 +61,10 @@ class AbstractSortableTablePaginationComponent extends AbstractSortableTableComp
61
61
  const totalPages = Math.ceil(this.displayTableDataSignal().length / this.itemsPerPageSignal());
62
62
  this.currentPageSignal.set(Math.max(1, Math.min(newPage, totalPages)));
63
63
  }
64
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: AbstractSortableTablePaginationComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
65
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.1", type: AbstractSortableTablePaginationComponent, isStandalone: true, selector: "ng-component", usesInheritance: true, ngImport: i0, template: '', isInline: true });
64
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: AbstractSortableTablePaginationComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
65
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.6", type: AbstractSortableTablePaginationComponent, isStandalone: true, selector: "ng-component", usesInheritance: true, ngImport: i0, template: '', isInline: true });
66
66
  }
67
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: AbstractSortableTablePaginationComponent, decorators: [{
67
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: AbstractSortableTablePaginationComponent, decorators: [{
68
68
  type: Component,
69
69
  args: [{
70
70
  template: '',
@@ -1 +1 @@
1
- {"version":3,"file":"hmcts-opal-frontend-common-components-abstract-abstract-sortable-table-pagination.mjs","sources":["../../../projects/opal-frontend-common/components/abstract/abstract-sortable-table-pagination/abstract-sortable-table-pagination.component.ts","../../../projects/opal-frontend-common/components/abstract/abstract-sortable-table-pagination/hmcts-opal-frontend-common-components-abstract-abstract-sortable-table-pagination.ts"],"sourcesContent":["import { Component, computed, signal } from '@angular/core';\nimport { AbstractSortableTableComponent } from '@hmcts/opal-frontend-common/components/abstract/abstract-sortable-table';\n\n@Component({\n template: '',\n})\nexport abstract class AbstractSortableTablePaginationComponent extends AbstractSortableTableComponent {\n // Signal for the current page. Used to calculate the start and end indices for pagination.\n public currentPageSignal = signal(1);\n\n // Signal for the number of items per page. Determines how many items are displayed on each page.\n public itemsPerPageSignal = signal(10);\n\n // Signal for the start index (1-based). Automatically updates when `currentPageSignal` or `itemsPerPageSignal` changes.\n public startIndexComputed = computed(() => {\n const currentPage = this.currentPageSignal();\n return (currentPage - 1) * this.itemsPerPageSignal() + 1;\n });\n\n /**\n * Computes the end index for the current page of the sorted table data.\n * Ensures the end index does not exceed the total number of items.\n *\n * @returns The zero-based index of the last item to display on the current page.\n */\n public endIndexComputed = computed(() => {\n return Math.min(this.sortedTableDataSignal().length, this.startIndexComputed() + this.itemsPerPageSignal() - 1);\n });\n\n // Computed signal for paginated table data. Reactively slices `displayTableDataSignal` based on `startIndexComputed` and `endIndexComputed`.\n public paginatedTableDataComputed = computed(() => {\n const data = this.sortedTableDataSignal(); // Full table data\n\n return data.slice(this.startIndexComputed() - 1, this.endIndexComputed()); // Return paginated data subset\n });\n\n /**\n * Handles sorting changes and resets the page to the first page.\n *\n * @param event - The sorting event containing:\n * - `key`: The column key to sort by.\n * - `sortType`: The sorting order, either 'ascending' or 'descending'.\n *\n * Resets `currentPageSignal` to 1 and triggers re-sorting of `displayTableDataSignal`.\n */\n public override onSortChange(event: { key: string; sortType: 'ascending' | 'descending' }): void {\n super.onSortChange(event); // Update the sort state and sort the data\n this.currentPageSignal.set(1); // Reset the page to the first page\n }\n\n /**\n * Applies the current filters to the table data.\n *\n * Overrides the base implementation to additionally reset the pagination to the first page\n * after filters are applied.\n *\n * @override\n */\n public override onApplyFilters(): void {\n super.onApplyFilters();\n this.currentPageSignal.set(1); // Reset to first page after filtering\n }\n\n /**\n * Handles the event when the page is changed.\n *\n * @param newPage - The new page number to set. If the provided page number is out of range,\n * it will be clamped between 1 and the total number of pages.\n */\n public onPageChange(newPage: number): void {\n const totalPages = Math.ceil(this.displayTableDataSignal().length / this.itemsPerPageSignal());\n this.currentPageSignal.set(Math.max(1, Math.min(newPage, totalPages)));\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AAMM,MAAgB,wCAAyC,SAAQ,8BAA8B,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IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,sBAAsB,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAC9F,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC;IACxE;uGAlEoB,wCAAwC,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAxC,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,wCAAwC,+FAFlD,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA;;2FAEQ,wCAAwC,EAAA,UAAA,EAAA,CAAA;kBAH7D,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,EAAE;AACb,iBAAA;;;ACLD;;AAEG;;;;"}
1
+ {"version":3,"file":"hmcts-opal-frontend-common-components-abstract-abstract-sortable-table-pagination.mjs","sources":["../../../projects/opal-frontend-common/components/abstract/abstract-sortable-table-pagination/abstract-sortable-table-pagination.component.ts","../../../projects/opal-frontend-common/components/abstract/abstract-sortable-table-pagination/hmcts-opal-frontend-common-components-abstract-abstract-sortable-table-pagination.ts"],"sourcesContent":["import { Component, computed, signal } from '@angular/core';\nimport { AbstractSortableTableComponent } from '@hmcts/opal-frontend-common/components/abstract/abstract-sortable-table';\n\n@Component({\n template: '',\n})\nexport abstract class AbstractSortableTablePaginationComponent extends AbstractSortableTableComponent {\n // Signal for the current page. Used to calculate the start and end indices for pagination.\n public currentPageSignal = signal(1);\n\n // Signal for the number of items per page. Determines how many items are displayed on each page.\n public itemsPerPageSignal = signal(10);\n\n // Signal for the start index (1-based). Automatically updates when `currentPageSignal` or `itemsPerPageSignal` changes.\n public startIndexComputed = computed(() => {\n const currentPage = this.currentPageSignal();\n return (currentPage - 1) * this.itemsPerPageSignal() + 1;\n });\n\n /**\n * Computes the end index for the current page of the sorted table data.\n * Ensures the end index does not exceed the total number of items.\n *\n * @returns The zero-based index of the last item to display on the current page.\n */\n public endIndexComputed = computed(() => {\n return Math.min(this.sortedTableDataSignal().length, this.startIndexComputed() + this.itemsPerPageSignal() - 1);\n });\n\n // Computed signal for paginated table data. Reactively slices `displayTableDataSignal` based on `startIndexComputed` and `endIndexComputed`.\n public paginatedTableDataComputed = computed(() => {\n const data = this.sortedTableDataSignal(); // Full table data\n\n return data.slice(this.startIndexComputed() - 1, this.endIndexComputed()); // Return paginated data subset\n });\n\n /**\n * Handles sorting changes and resets the page to the first page.\n *\n * @param event - The sorting event containing:\n * - `key`: The column key to sort by.\n * - `sortType`: The sorting order, either 'ascending' or 'descending'.\n *\n * Resets `currentPageSignal` to 1 and triggers re-sorting of `displayTableDataSignal`.\n */\n public override onSortChange(event: { key: string; sortType: 'ascending' | 'descending' }): void {\n super.onSortChange(event); // Update the sort state and sort the data\n this.currentPageSignal.set(1); // Reset the page to the first page\n }\n\n /**\n * Applies the current filters to the table data.\n *\n * Overrides the base implementation to additionally reset the pagination to the first page\n * after filters are applied.\n *\n * @override\n */\n public override onApplyFilters(): void {\n super.onApplyFilters();\n this.currentPageSignal.set(1); // Reset to first page after filtering\n }\n\n /**\n * Handles the event when the page is changed.\n *\n * @param newPage - The new page number to set. If the provided page number is out of range,\n * it will be clamped between 1 and the total number of pages.\n */\n public onPageChange(newPage: number): void {\n const totalPages = Math.ceil(this.displayTableDataSignal().length / this.itemsPerPageSignal());\n this.currentPageSignal.set(Math.max(1, Math.min(newPage, totalPages)));\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AAMM,MAAgB,wCAAyC,SAAQ,8BAA8B,CAAA;;AAE5F,IAAA,iBAAiB,GAAG,MAAM,C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B,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAC9F,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC;IACxE;uGAlEoB,wCAAwC,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAxC,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,wCAAwC,+FAFlD,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA;;2FAEQ,wCAAwC,EAAA,UAAA,EAAA,CAAA;kBAH7D,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,EAAE;AACb,iBAAA;;;ACLD;;AAEG;;;;"}
@@ -22,14 +22,14 @@ class AbstractSortableTableComponent extends AbstractTableFilterComponent {
22
22
  // No sort applied – use filtered data directly
23
23
  this.sortedTableDataSignal.set([...filtered]);
24
24
  }
25
- }, ...(ngDevMode ? [{ debugName: "syncSortedDataEffect" }] : []));
26
- displayTableDataSignal = signal([], ...(ngDevMode ? [{ debugName: "displayTableDataSignal" }] : []));
27
- filteredTableDataSignal = signal([], ...(ngDevMode ? [{ debugName: "filteredTableDataSignal" }] : []));
28
- sortedTableDataSignal = signal([], ...(ngDevMode ? [{ debugName: "sortedTableDataSignal" }] : []));
25
+ }, ...(ngDevMode ? [{ debugName: "syncSortedDataEffect" }] : /* istanbul ignore next */ []));
26
+ displayTableDataSignal = signal([], ...(ngDevMode ? [{ debugName: "displayTableDataSignal" }] : /* istanbul ignore next */ []));
27
+ filteredTableDataSignal = signal([], ...(ngDevMode ? [{ debugName: "filteredTableDataSignal" }] : /* istanbul ignore next */ []));
28
+ sortedTableDataSignal = signal([], ...(ngDevMode ? [{ debugName: "sortedTableDataSignal" }] : /* istanbul ignore next */ []));
29
29
  abstractExistingSortState = null;
30
- sortStateSignal = signal({}, ...(ngDevMode ? [{ debugName: "sortStateSignal" }] : []));
31
- sortedColumnTitleSignal = signal('', ...(ngDevMode ? [{ debugName: "sortedColumnTitleSignal" }] : []));
32
- sortedColumnDirectionSignal = signal('none', ...(ngDevMode ? [{ debugName: "sortedColumnDirectionSignal" }] : []));
30
+ sortStateSignal = signal({}, ...(ngDevMode ? [{ debugName: "sortStateSignal" }] : /* istanbul ignore next */ []));
31
+ sortedColumnTitleSignal = signal('', ...(ngDevMode ? [{ debugName: "sortedColumnTitleSignal" }] : /* istanbul ignore next */ []));
32
+ sortedColumnDirectionSignal = signal('none', ...(ngDevMode ? [{ debugName: "sortedColumnDirectionSignal" }] : /* istanbul ignore next */ []));
33
33
  abstractSortState = new EventEmitter();
34
34
  /**
35
35
  * Creates an initial sort state for a table based on the provided table data.
@@ -185,10 +185,10 @@ class AbstractSortableTableComponent extends AbstractTableFilterComponent {
185
185
  this.onSortChange({ key, sortType });
186
186
  }
187
187
  }
188
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: AbstractSortableTableComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
189
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.1", type: AbstractSortableTableComponent, isStandalone: true, selector: "ng-component", outputs: { abstractSortState: "abstractSortState" }, usesInheritance: true, ngImport: i0, template: '', isInline: true });
188
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: AbstractSortableTableComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
189
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.6", type: AbstractSortableTableComponent, isStandalone: true, selector: "ng-component", outputs: { abstractSortState: "abstractSortState" }, usesInheritance: true, ngImport: i0, template: '', isInline: true });
190
190
  }
191
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: AbstractSortableTableComponent, decorators: [{
191
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: AbstractSortableTableComponent, decorators: [{
192
192
  type: Component,
193
193
  args: [{
194
194
  template: '',
@@ -1 +1 @@
1
- {"version":3,"file":"hmcts-opal-frontend-common-components-abstract-abstract-sortable-table.mjs","sources":["../../../projects/opal-frontend-common/components/abstract/abstract-sortable-table/abstract-sortable-table.component.ts","../../../projects/opal-frontend-common/components/abstract/abstract-sortable-table/hmcts-opal-frontend-common-components-abstract-abstract-sortable-table.ts"],"sourcesContent":["import { Component, EventEmitter, OnInit, Output, effect, inject, signal } from '@angular/core';\nimport {\n IAbstractSortState,\n IAbstractTableData,\n} from '@hmcts/opal-frontend-common/components/abstract/abstract-sortable-table/interfaces';\nimport { SortService } from '@hmcts/opal-frontend-common/services/sort-service';\nimport {\n SortableValuesType,\n SortDirectionType,\n} from '@hmcts/opal-frontend-common/components/abstract/abstract-sortable-table/types';\nimport { AbstractTableFilterComponent } from '@hmcts/opal-frontend-common/components/abstract/abstract-table-filter';\n\n@Component({\n template: '',\n})\nexport abstract class AbstractSortableTableComponent extends AbstractTableFilterComponent implements OnInit {\n private readonly sortService = inject(SortService);\n\n /**\n * Synchronizes the sorted table data with the current filter and sort state.\n *\n * This effect observes changes to the filtered table data and the sort state signals.\n * If no active sort key is found (i.e., no sorting is applied), it sets the sorted table data\n * to a shallow copy of the filtered data. Otherwise, sorting logic should be applied elsewhere.\n *\n * @protected\n */\n protected syncSortedDataEffect = effect(() => {\n const filtered = this.filteredTableDataSignal();\n const currentSort = this.sortStateSignal();\n\n const activeSortKey = Object.keys(currentSort).find((k) => currentSort[k] !== 'none');\n\n if (!activeSortKey) {\n // No sort applied – use filtered data directly\n this.sortedTableDataSignal.set([...filtered]);\n }\n });\n\n public override displayTableDataSignal = signal<IAbstractTableData<SortableValuesType>[]>([]);\n public override filteredTableDataSignal = signal<IAbstractTableData<SortableValuesType>[]>([]);\n public sortedTableDataSignal = signal<IAbstractTableData<SortableValuesType>[]>([]);\n public abstractExistingSortState: IAbstractSortState | null = null;\n public sortStateSignal = signal<IAbstractSortState>({});\n public sortedColumnTitleSignal = signal<string>('');\n public sortedColumnDirectionSignal = signal<SortDirectionType>('none');\n\n @Output() abstractSortState = new EventEmitter<IAbstractSortState>();\n\n /**\n * Creates an initial sort state for a table based on the provided table data.\n *\n * @param tableData - Array of table data objects representing table rows.\n * @returns Initial sort state object with column names as keys and 'none' as values.\n */\n private createSortState(tableData: IAbstractTableData<SortableValuesType>[] | null): IAbstractSortState {\n return tableData?.length\n ? Object.keys(tableData[0]).reduce<IAbstractSortState>((state, key) => {\n state[key] = 'none';\n return state;\n }, {})\n : {};\n }\n /**\n * Initializes the sort state for the sortable table component.\n *\n * This method sets the initial sort state based on the existing sort state or creates a new one\n * if none exists. It then updates the sort state signal with the initial sort state.\n *\n * If an existing sort state is found, it iterates over each entry and triggers the sort change\n * for each key that has a sort type other than 'none'.\n *\n * @private\n * @returns {void}\n */\n private initialiseSortState(): void {\n const existingSortState = this.abstractExistingSortState;\n const initialSortState = existingSortState || this.createSortState(this.displayTableDataSignal());\n this.applyFilterState();\n\n this.sortStateSignal.set(initialSortState);\n\n if (existingSortState) {\n for (const [key, sortType] of Object.entries(existingSortState)) {\n if (sortType !== 'none') {\n this.onSortChange({ key, sortType });\n }\n }\n }\n this.getSortedColumn();\n }\n\n /**\n * Updates the sort state for a given column key and sort type.\n * Resets the sort state for all other columns to 'none'.\n *\n * @param key - The column to sort by.\n * @param sortType - Sorting order ('ascending' or 'descending').\n */\n private updateSortState(key: string, sortType: 'ascending' | 'descending'): void {\n this.sortStateSignal.set(\n Object.keys(this.sortStateSignal()).reduce<IAbstractSortState>((state, columnKey) => {\n state[columnKey] = columnKey === key ? sortType : 'none';\n return state;\n }, {}),\n );\n }\n\n /**\n * Retrieves the sorted table data based on the specified key and sort type.\n *\n * @param key - The key of the property to sort by.\n * @param sortType - The type of sorting to apply, either 'ascending' or 'descending'.\n * @returns An array of sorted table data objects.\n */\n private getSortedTableData(\n key: string,\n sortType: 'ascending' | 'descending',\n ): IAbstractTableData<SortableValuesType>[] {\n return sortType === 'ascending'\n ? (this.sortService.sortObjectArrayAsc(\n this.filteredTableDataSignal(),\n key,\n ) as IAbstractTableData<SortableValuesType>[])\n : (this.sortService.sortObjectArrayDesc(\n this.filteredTableDataSignal(),\n key,\n ) as IAbstractTableData<SortableValuesType>[]);\n }\n\n /**\n * Determines the first column with a sort state other than 'none' and updates the sorted column signals accordingly.\n *\n * - If a sorted column is found, updates the `sortedColumnTitleSignal` and `sortedColumnDirectionSignal` with the column key and state.\n * - If no sorted column is found, sets the `sortedColumnTitleSignal` to an empty string and `sortedColumnDirectionSignal` to 'none'.\n *\n * @private\n * @returns {void}\n */\n private getSortedColumn(): void {\n // Find the first column that has a sort state other than 'none'\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const sortedColumn = Object.entries(this.sortStateSignal()).find(([_, state]) => state !== 'none');\n\n // If a sorted column is found, set the signal to the sorted column key and state\n if (sortedColumn) {\n const [columnKey, state] = sortedColumn;\n this.sortedColumnTitleSignal.set(columnKey);\n this.sortedColumnDirectionSignal.set(state);\n } else {\n // Otherwise, set the signal to null\n this.sortedColumnTitleSignal.set('');\n this.sortedColumnDirectionSignal.set('none');\n }\n }\n\n /**\n * Handles the change in sorting for the table.\n *\n * @param event - An object containing the key to sort by and the sort type.\n * @param event.key - The key of the column to sort.\n * @param event.sortType - The type of sorting to apply ('ascending' or 'descending').\n *\n * This method updates the sort state, sorts the table data based on the provided key and sort type,\n * updates the table data signal, and emits the updated sort state.\n */\n protected onSortChange(event: { key: string; sortType: 'ascending' | 'descending' }): void {\n const { key, sortType } = event;\n\n this.updateSortState(key, sortType);\n this.getSortedColumn();\n const sortedData = this.getSortedTableData(key, sortType);\n\n // Update the table data signal\n this.sortedTableDataSignal.set(sortedData);\n\n // Emit the updated sort state\n this.abstractSortState.emit(this.sortStateSignal());\n }\n\n /**\n * Lifecycle hook to initialise the sort state.\n */\n public ngOnInit(): void {\n this.initialiseSortState();\n }\n /**\n * Applies the current filters to the table data and updates the sorted data accordingly.\n *\n * This method overrides the parent implementation to additionally handle sorting.\n * If there is an active sort key, it applies the corresponding sort to the filtered data.\n * If no sort key is active, it simply updates the sorted data to match the filtered data.\n *\n * @override\n */\n public override onApplyFilters(): void {\n super.onApplyFilters();\n\n const key = this.sortedColumnTitleSignal();\n const sortType = this.sortedColumnDirectionSignal();\n\n if (!key || sortType === 'none') {\n this.sortedTableDataSignal.set([...this.filteredTableDataSignal()]);\n } else {\n this.onSortChange({ key, sortType });\n }\n }\n\n /**\n * Clears all filters applied to the table and restores the data to its unfiltered state.\n * If a sort is currently active, re-applies the sort after clearing filters.\n * Otherwise, resets the sorted table data to match the filtered data.\n *\n * @override\n */\n public override clearAllFilters(): void {\n super.clearAllFilters();\n\n const key = this.sortedColumnTitleSignal();\n const sortType = this.sortedColumnDirectionSignal();\n\n if (!key || sortType === 'none') {\n this.sortedTableDataSignal.set([...this.filteredTableDataSignal()]);\n } else {\n this.onSortChange({ key, sortType });\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAeM,MAAgB,8BAA+B,SAAQ,4BAA4B,CAAA;AACtE,IAAA,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;AAElD;;;;;;;;AAQG;AACO,IAAA,oBAAoB,GAAG,MAAM,CAAC,MAAK;AAC3C,QAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,uBAAuB,EAAE;AAC/C,QAAA,MAAM,WAAW,GAAG,IAAI,CAAC,eAAe,EAAE;QAE1C,MAAM,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,IAAI,CA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AAC,eAAe,EAAE;AAEvB,QAAA,MAAM,GAAG,GAAG,IAAI,CAAC,uBAAuB,EAAE;AAC1C,QAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,2BAA2B,EAAE;AAEnD,QAAA,IAAI,CAAC,GAAG,IAAI,QAAQ,KAAK,MAAM,EAAE;AAC/B,YAAA,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,uBAAuB,EAAE,CAAC,CAAC;QACrE;aAAO;YACL,IAAI,CAAC,YAAY,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC;QACtC;IACF;uGAnNoB,8BAA8B,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAA9B,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,8BAA8B,oJAFxC,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA;;2FAEQ,8BAA8B,EAAA,UAAA,EAAA,CAAA;kBAHnD,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,EAAE;AACb,iBAAA;;sBAiCE;;;AC/CH;;AAEG;;;;"}
1
+ {"version":3,"file":"hmcts-opal-frontend-common-components-abstract-abstract-sortable-table.mjs","sources":["../../../projects/opal-frontend-common/components/abstract/abstract-sortable-table/abstract-sortable-table.component.ts","../../../projects/opal-frontend-common/components/abstract/abstract-sortable-table/hmcts-opal-frontend-common-components-abstract-abstract-sortable-table.ts"],"sourcesContent":["import { Component, EventEmitter, OnInit, Output, effect, inject, signal } from '@angular/core';\nimport {\n IAbstractSortState,\n IAbstractTableData,\n} from '@hmcts/opal-frontend-common/components/abstract/abstract-sortable-table/interfaces';\nimport { SortService } from '@hmcts/opal-frontend-common/services/sort-service';\nimport {\n SortableValuesType,\n SortDirectionType,\n} from '@hmcts/opal-frontend-common/components/abstract/abstract-sortable-table/types';\nimport { AbstractTableFilterComponent } from '@hmcts/opal-frontend-common/components/abstract/abstract-table-filter';\n\n@Component({\n template: '',\n})\nexport abstract class AbstractSortableTableComponent extends AbstractTableFilterComponent implements OnInit {\n private readonly sortService = inject(SortService);\n\n /**\n * Synchronizes the sorted table data with the current filter and sort state.\n *\n * This effect observes changes to the filtered table data and the sort state signals.\n * If no active sort key is found (i.e., no sorting is applied), it sets the sorted table data\n * to a shallow copy of the filtered data. Otherwise, sorting logic should be applied elsewhere.\n *\n * @protected\n */\n protected syncSortedDataEffect = effect(() => {\n const filtered = this.filteredTableDataSignal();\n const currentSort = this.sortStateSignal();\n\n const activeSortKey = Object.keys(currentSort).find((k) => currentSort[k] !== 'none');\n\n if (!activeSortKey) {\n // No sort applied – use filtered data directly\n this.sortedTableDataSignal.set([...filtered]);\n }\n });\n\n public override displayTableDataSignal = signal<IAbstractTableData<SortableValuesType>[]>([]);\n public override filteredTableDataSignal = signal<IAbstractTableData<SortableValuesType>[]>([]);\n public sortedTableDataSignal = signal<IAbstractTableData<SortableValuesType>[]>([]);\n public abstractExistingSortState: IAbstractSortState | null = null;\n public sortStateSignal = signal<IAbstractSortState>({});\n public sortedColumnTitleSignal = signal<string>('');\n public sortedColumnDirectionSignal = signal<SortDirectionType>('none');\n\n @Output() abstractSortState = new EventEmitter<IAbstractSortState>();\n\n /**\n * Creates an initial sort state for a table based on the provided table data.\n *\n * @param tableData - Array of table data objects representing table rows.\n * @returns Initial sort state object with column names as keys and 'none' as values.\n */\n private createSortState(tableData: IAbstractTableData<SortableValuesType>[] | null): IAbstractSortState {\n return tableData?.length\n ? Object.keys(tableData[0]).reduce<IAbstractSortState>((state, key) => {\n state[key] = 'none';\n return state;\n }, {})\n : {};\n }\n /**\n * Initializes the sort state for the sortable table component.\n *\n * This method sets the initial sort state based on the existing sort state or creates a new one\n * if none exists. It then updates the sort state signal with the initial sort state.\n *\n * If an existing sort state is found, it iterates over each entry and triggers the sort change\n * for each key that has a sort type other than 'none'.\n *\n * @private\n * @returns {void}\n */\n private initialiseSortState(): void {\n const existingSortState = this.abstractExistingSortState;\n const initialSortState = existingSortState || this.createSortState(this.displayTableDataSignal());\n this.applyFilterState();\n\n this.sortStateSignal.set(initialSortState);\n\n if (existingSortState) {\n for (const [key, sortType] of Object.entries(existingSortState)) {\n if (sortType !== 'none') {\n this.onSortChange({ key, sortType });\n }\n }\n }\n this.getSortedColumn();\n }\n\n /**\n * Updates the sort state for a given column key and sort type.\n * Resets the sort state for all other columns to 'none'.\n *\n * @param key - The column to sort by.\n * @param sortType - Sorting order ('ascending' or 'descending').\n */\n private updateSortState(key: string, sortType: 'ascending' | 'descending'): void {\n this.sortStateSignal.set(\n Object.keys(this.sortStateSignal()).reduce<IAbstractSortState>((state, columnKey) => {\n state[columnKey] = columnKey === key ? sortType : 'none';\n return state;\n }, {}),\n );\n }\n\n /**\n * Retrieves the sorted table data based on the specified key and sort type.\n *\n * @param key - The key of the property to sort by.\n * @param sortType - The type of sorting to apply, either 'ascending' or 'descending'.\n * @returns An array of sorted table data objects.\n */\n private getSortedTableData(\n key: string,\n sortType: 'ascending' | 'descending',\n ): IAbstractTableData<SortableValuesType>[] {\n return sortType === 'ascending'\n ? (this.sortService.sortObjectArrayAsc(\n this.filteredTableDataSignal(),\n key,\n ) as IAbstractTableData<SortableValuesType>[])\n : (this.sortService.sortObjectArrayDesc(\n this.filteredTableDataSignal(),\n key,\n ) as IAbstractTableData<SortableValuesType>[]);\n }\n\n /**\n * Determines the first column with a sort state other than 'none' and updates the sorted column signals accordingly.\n *\n * - If a sorted column is found, updates the `sortedColumnTitleSignal` and `sortedColumnDirectionSignal` with the column key and state.\n * - If no sorted column is found, sets the `sortedColumnTitleSignal` to an empty string and `sortedColumnDirectionSignal` to 'none'.\n *\n * @private\n * @returns {void}\n */\n private getSortedColumn(): void {\n // Find the first column that has a sort state other than 'none'\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const sortedColumn = Object.entries(this.sortStateSignal()).find(([_, state]) => state !== 'none');\n\n // If a sorted column is found, set the signal to the sorted column key and state\n if (sortedColumn) {\n const [columnKey, state] = sortedColumn;\n this.sortedColumnTitleSignal.set(columnKey);\n this.sortedColumnDirectionSignal.set(state);\n } else {\n // Otherwise, set the signal to null\n this.sortedColumnTitleSignal.set('');\n this.sortedColumnDirectionSignal.set('none');\n }\n }\n\n /**\n * Handles the change in sorting for the table.\n *\n * @param event - An object containing the key to sort by and the sort type.\n * @param event.key - The key of the column to sort.\n * @param event.sortType - The type of sorting to apply ('ascending' or 'descending').\n *\n * This method updates the sort state, sorts the table data based on the provided key and sort type,\n * updates the table data signal, and emits the updated sort state.\n */\n protected onSortChange(event: { key: string; sortType: 'ascending' | 'descending' }): void {\n const { key, sortType } = event;\n\n this.updateSortState(key, sortType);\n this.getSortedColumn();\n const sortedData = this.getSortedTableData(key, sortType);\n\n // Update the table data signal\n this.sortedTableDataSignal.set(sortedData);\n\n // Emit the updated sort state\n this.abstractSortState.emit(this.sortStateSignal());\n }\n\n /**\n * Lifecycle hook to initialise the sort state.\n */\n public ngOnInit(): void {\n this.initialiseSortState();\n }\n /**\n * Applies the current filters to the table data and updates the sorted data accordingly.\n *\n * This method overrides the parent implementation to additionally handle sorting.\n * If there is an active sort key, it applies the corresponding sort to the filtered data.\n * If no sort key is active, it simply updates the sorted data to match the filtered data.\n *\n * @override\n */\n public override onApplyFilters(): void {\n super.onApplyFilters();\n\n const key = this.sortedColumnTitleSignal();\n const sortType = this.sortedColumnDirectionSignal();\n\n if (!key || sortType === 'none') {\n this.sortedTableDataSignal.set([...this.filteredTableDataSignal()]);\n } else {\n this.onSortChange({ key, sortType });\n }\n }\n\n /**\n * Clears all filters applied to the table and restores the data to its unfiltered state.\n * If a sort is currently active, re-applies the sort after clearing filters.\n * Otherwise, resets the sorted table data to match the filtered data.\n *\n * @override\n */\n public override clearAllFilters(): void {\n super.clearAllFilters();\n\n const key = this.sortedColumnTitleSignal();\n const sortType = this.sortedColumnDirectionSignal();\n\n if (!key || sortType === 'none') {\n this.sortedTableDataSignal.set([...this.filteredTableDataSignal()]);\n } else {\n this.onSortChange({ key, sortType });\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAeM,MAAgB,8BAA+B,SAAQ,4BAA4B,CAAA;AACtE,IAAA,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;AAElD;;;;;;;;AAQG;AACO,IAAA,oBAAoB,GAAG,MAAM,CAAC,MAAK;AAC3C,QAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,uBAAuB,EAAE;AAC/C,QAAA,MAAM,WAAW,GAAG,IAAI,CAAC,eAAe,EAAE;QAE1C,MAAM,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,WAAW,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC;QAErF,IAAI,CAAC,aAAa,EAAE;;YAElB,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC;QAC/C;AACF,IAAA,CAAC,2FAAC;AAEc,IAAA,sBAAsB,GAAG,MAAM,CAA2C,EAAE,6FAAC;AAC7E,IAAA,uBAAuB,GAAG,MAAM,CAA2C,EAAE,8FAAC;AACvF,IAAA,qBAAqB,GAAG,MAAM,CAA2C,EAAE,4FAAC;IAC5E,yBAAyB,GAA8B,IAAI;AAC3D,IAAA,eAAe,GAAG,MAAM,CAAqB,EAAE,sFAAC;AAChD,IAAA,uBAAuB,GAAG,MAAM,CAAS,EAAE,8FAAC;AAC5C,IAAA,2BAA2B,GAAG,MAAM,CAAoB,MAAM,kGAAC;AAE5D,IAAA,iBAAiB,GAAG,IAAI,YAAY,EAAsB;AAEpE;;;;;AAKG;AACK,IAAA,eAAe,CAAC,SAA0D,EAAA;QAChF,OAAO,SAAS,EAAE;AACh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Q,8BAA8B,EAAA,UAAA,EAAA,CAAA;kBAHnD,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,EAAE;AACb,iBAAA;;sBAiCE;;;AC/CH;;AAEG;;;;"}
@@ -2,12 +2,12 @@ import * as i0 from '@angular/core';
2
2
  import { signal, computed, Component } from '@angular/core';
3
3
 
4
4
  class AbstractTableFilterComponent {
5
- displayTableDataSignal = signal([], ...(ngDevMode ? [{ debugName: "displayTableDataSignal" }] : []));
6
- filteredTableDataSignal = signal([], ...(ngDevMode ? [{ debugName: "filteredTableDataSignal" }] : []));
7
- filterTags = signal([], ...(ngDevMode ? [{ debugName: "filterTags" }] : []));
8
- keyword = signal('', ...(ngDevMode ? [{ debugName: "keyword" }] : []));
9
- appliedFilterTags = signal([], ...(ngDevMode ? [{ debugName: "appliedFilterTags" }] : []));
10
- appliedKeyword = signal('', ...(ngDevMode ? [{ debugName: "appliedKeyword" }] : []));
5
+ displayTableDataSignal = signal([], ...(ngDevMode ? [{ debugName: "displayTableDataSignal" }] : /* istanbul ignore next */ []));
6
+ filteredTableDataSignal = signal([], ...(ngDevMode ? [{ debugName: "filteredTableDataSignal" }] : /* istanbul ignore next */ []));
7
+ filterTags = signal([], ...(ngDevMode ? [{ debugName: "filterTags" }] : /* istanbul ignore next */ []));
8
+ keyword = signal('', ...(ngDevMode ? [{ debugName: "keyword" }] : /* istanbul ignore next */ []));
9
+ appliedFilterTags = signal([], ...(ngDevMode ? [{ debugName: "appliedFilterTags" }] : /* istanbul ignore next */ []));
10
+ appliedKeyword = signal('', ...(ngDevMode ? [{ debugName: "appliedKeyword" }] : /* istanbul ignore next */ []));
11
11
  /**
12
12
  * A computed signal that returns the currently selected filter tags.
13
13
  * It filters the filterTags signal to include only those options that are selected,
@@ -15,7 +15,7 @@ class AbstractTableFilterComponent {
15
15
  *
16
16
  * @returns An array of filter categories each containing only the selected options.
17
17
  */
18
- abstractSelectedTags = computed(() => this.getSelectedOptionsFromTags(this.filterTags()), ...(ngDevMode ? [{ debugName: "abstractSelectedTags" }] : []));
18
+ abstractSelectedTags = computed(() => this.getSelectedOptionsFromTags(this.filterTags()), ...(ngDevMode ? [{ debugName: "abstractSelectedTags" }] : /* istanbul ignore next */ []));
19
19
  /**
20
20
  * Determines whether a given item matches a specific filter option within a category.
21
21
  * @param item The data item to test.
@@ -168,10 +168,10 @@ class AbstractTableFilterComponent {
168
168
  this.appliedKeyword.set(keyword);
169
169
  this.applyFilterState();
170
170
  }
171
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: AbstractTableFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
172
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.1", type: AbstractTableFilterComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: '', isInline: true });
171
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: AbstractTableFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
172
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.6", type: AbstractTableFilterComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: '', isInline: true });
173
173
  }
174
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: AbstractTableFilterComponent, decorators: [{
174
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: AbstractTableFilterComponent, decorators: [{
175
175
  type: Component,
176
176
  args: [{ template: '' }]
177
177
  }] });
@@ -1 +1 @@
1
- {"version":3,"file":"hmcts-opal-frontend-common-components-abstract-abstract-table-filter.mjs","sources":["../../../projects/opal-frontend-common/components/abstract/abstract-table-filter/abstract-table-filter.component.ts","../../../projects/opal-frontend-common/components/abstract/abstract-table-filter/hmcts-opal-frontend-common-components-abstract-abstract-table-filter.ts"],"sourcesContent":["import { Component, signal, computed, Signal } from '@angular/core';\nimport {\n IAbstractTableData,\n IAbstractTableFilterCategory,\n IAbstractTableFilterOption,\n} from '@hmcts/opal-frontend-common/components/abstract/abstract-table-filter/interfaces';\nimport { SortableValuesType } from '@hmcts/opal-frontend-common/components/abstract/abstract-table-filter/types';\n\n@Component({ template: '' })\nexport abstract class AbstractTableFilterComponent {\n public displayTableDataSignal = signal<IAbstractTableData<SortableValuesType>[]>([]);\n public filteredTableDataSignal = signal<IAbstractTableData<SortableValuesType>[]>([]);\n public filterTags = signal<IAbstractTableFilterCategory[]>([]);\n public keyword = signal<string>('');\n public appliedFilterTags = signal<IAbstractTableFilterCategory[]>([]);\n public appliedKeyword = signal<string>('');\n\n /**\n * A computed signal that returns the currently selected filter tags.\n * It filters the filterTags signal to include only those options that are selected,\n * grouped by their category name.\n *\n * @returns An array of filter categories each containing only the selected options.\n */\n public abstractSelectedTags: Signal<IAbstractTableFilterCategory[]> = computed(() =>\n this.getSelectedOptionsFromTags(this.filterTags()),\n );\n\n /**\n * Determines whether a given item matches a specific filter option within a category.\n * @param item The data item to test.\n * @param categoryName The category name to check within the item.\n * @param option The filter option to match against.\n * @returns True if the item's value for the category matches the option's value; otherwise false.\n */\n protected matchItemWithFilterOption(\n item: IAbstractTableData<SortableValuesType>,\n categoryName: string,\n option: IAbstractTableFilterOption,\n ): boolean {\n return item?.[categoryName] === option.value;\n }\n\n /**\n * Determines whether a given item matches the keyword filter.\n * Checks if any value in the item contains the keyword (case-insensitive).\n * @param item The data item to test.\n * @param keyword The keyword to match against.\n * @returns True if any value in the item contains the keyword; otherwise false.\n */\n protected matchItemWithKeyword(item: IAbstractTableData<SortableValuesType>, keyword: string): boolean {\n return Object.values(item).some((value) => value?.toString().toLowerCase().includes(keyword));\n }\n\n /**\n * Extracts and returns categories from the provided tags that have at least one selected option.\n *\n * For each category in the input array, this method filters its options to include only those marked as selected.\n * Only categories with at least one selected option are included in the returned array.\n *\n * @param tags - An array of category objects, each containing a list of options.\n * @returns An array of category objects, each with only the selected options, and only categories with at least one selected option.\n */\n protected getSelectedOptionsFromTags(tags: IAbstractTableFilterCategory[]): IAbstractTableFilterCategory[] {\n return tags\n .map((group) => ({\n categoryName: group.categoryName,\n options: group.options.filter((option) => option.selected),\n }))\n .filter((group) => group.options.length > 0);\n }\n\n /**\n * Updates the keyword used to filter the table data.\n * @param newKeyword The new keyword string to filter by.\n */\n public onKeywordChange(newKeyword: string): void {\n this.keyword.set(newKeyword);\n }\n\n /**\n * Updates the selection state of a filter option within a category.\n * @param categoryName The name of the filter category.\n * @param optionValue The value of the filter option to update.\n * @param selected Whether the option is selected (true) or deselected (false).\n */\n public onCategoryCheckboxChange(categoryName: string, optionValue: string | number, selected: boolean): void {\n const updatedFilterTags = this.filterTags().map((group) => {\n if (group.categoryName === categoryName) {\n return {\n ...group,\n options: group.options.map((option) => (option.value === optionValue ? { ...option, selected } : option)),\n };\n }\n return group;\n });\n this.filterTags.set(updatedFilterTags);\n }\n\n /**\n * Removes a selected filter tag by deselecting the corresponding filter option.\n * @param categoryName The name of the filter category.\n * @param optionValue The value of the filter option to remove.\n */\n public removeTag(categoryName: string, optionValue: string | number): void {\n this.onCategoryCheckboxChange(categoryName, optionValue, false);\n }\n\n /**\n * Clears all applied filters and resets the filter state.\n *\n * This method performs the following actions:\n * - Resets the keyword and applied keyword to empty strings.\n * - Iterates through all filter tag groups and sets each option's `selected` property to `false`.\n * - Updates both the current and applied filter tags with the cleared state.\n * - Applies the updated filter state.\n */\n public clearAllFilters(): void {\n this.keyword.set('');\n this.appliedKeyword.set('');\n\n const clearedFilterTags = this.filterTags().map((group) => ({\n ...group,\n options: group.options.map((option) => ({ ...option, selected: false })),\n }));\n\n this.filterTags.set(clearedFilterTags);\n this.appliedFilterTags.set(clearedFilterTags);\n\n this.applyFilterState();\n }\n\n /**\n * Initializes and updates the filtered table data based on the currently applied keyword and filter tags.\n *\n * This method performs the following steps:\n * 1. Retrieves the current table data, applied keyword, and filter tags.\n * 2. If filter tags are present, filters the data to include only items that match all selected filter options.\n * 3. If a keyword is present, further filters the data to include only items that match the keyword.\n * 4. Updates the filtered table data signal with the resulting filtered data.\n *\n * @remarks\n * - Filtering by tags requires each item to match every group of filter tags.\n * - Filtering by keyword is case-insensitive and trims whitespace.\n */\n public applyFilterState(): void {\n const data = this.displayTableDataSignal();\n const keyword = this.appliedKeyword().toLowerCase().trim();\n const tags = this.appliedFilterTags();\n\n const selectedTagGroups = this.getSelectedOptionsFromTags(tags);\n\n let filtered = data;\n\n if (selectedTagGroups.length > 0) {\n filtered = filtered.filter((item) =>\n selectedTagGroups.every((group) =>\n group.options.some((option) => this.matchItemWithFilterOption(item, group.categoryName, option)),\n ),\n );\n }\n\n if (keyword) {\n filtered = filtered.filter((item) => this.matchItemWithKeyword(item, keyword));\n }\n\n this.filteredTableDataSignal.set(filtered);\n }\n\n /**\n * Applies the current filter tags and keyword to the table data.\n *\n * This method updates the `appliedFilterTags` and `appliedKeyword` properties\n * with the current filter values, then re-initialises the filtered data set\n * by invoking `applyFilterState()`.\n *\n * Typically called when the user confirms or applies filter changes in the UI.\n */\n public onApplyFilters(): void {\n this.appliedFilterTags.set(this.filterTags());\n this.appliedKeyword.set(this.keyword());\n this.applyFilterState();\n }\n\n /**\n * Sets the data to be displayed in the table.\n *\n * @param data - An array of table data objects conforming to the `IAbstractTableData<SortableValuesType>` interface.\n */\n public setTableData(data: IAbstractTableData<SortableValuesType>[]): void {\n this.displayTableDataSignal.set(data);\n }\n\n /**\n * Resets the filter and keyword state to the provided values and reapplies them.\n *\n * @param tags - The filter tag state to apply (including selected values).\n * @param keyword - The keyword string to apply (optional, defaults to empty).\n */\n public resetFiltersTo(tags: IAbstractTableFilterCategory[], keyword: string = ''): void {\n this.filterTags.set(tags);\n this.keyword.set(keyword);\n this.appliedFilterTags.set(tags);\n this.appliedKeyword.set(keyword);\n this.applyFilterState();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from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AAC,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;QACvC,IAAI,CAAC,gBAAgB,EAAE;IACzB;AAEA;;;;AAIG;AACI,IAAA,YAAY,CAAC,IAA8C,EAAA;AAChE,QAAA,IAAI,CAAC,sBAAsB,CAAC,GAAG,CAAC,IAAI,CAAC;IACvC;AAEA;;;;;AAKG;AACI,IAAA,cAAc,CAAC,IAAoC,EAAE,OAAA,GAAkB,EAAE,EAAA;AAC9E,QAAA,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC;AACzB,QAAA,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;AACzB,QAAA,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC;AAChC,QAAA,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC;QAChC,IAAI,CAAC,gBAAgB,EAAE;IACzB;uGApMoB,4BAA4B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAA5B,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,4BAA4B,wEAD3B,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA;;2FACH,4BAA4B,EAAA,UAAA,EAAA,CAAA;kBADjD,SAAS;mBAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;;;ACR3B;;AAEG;;;;"}
1
+ {"version":3,"file":"hmcts-opal-frontend-common-components-abstract-abstract-table-filter.mjs","sources":["../../../projects/opal-frontend-common/components/abstract/abstract-table-filter/abstract-table-filter.component.ts","../../../projects/opal-frontend-common/components/abstract/abstract-table-filter/hmcts-opal-frontend-common-components-abstract-abstract-table-filter.ts"],"sourcesContent":["import { Component, signal, computed, Signal } from '@angular/core';\nimport {\n IAbstractTableData,\n IAbstractTableFilterCategory,\n IAbstractTableFilterOption,\n} from '@hmcts/opal-frontend-common/components/abstract/abstract-table-filter/interfaces';\nimport { SortableValuesType } from '@hmcts/opal-frontend-common/components/abstract/abstract-table-filter/types';\n\n@Component({ template: '' })\nexport abstract class AbstractTableFilterComponent {\n public displayTableDataSignal = signal<IAbstractTableData<SortableValuesType>[]>([]);\n public filteredTableDataSignal = signal<IAbstractTableData<SortableValuesType>[]>([]);\n public filterTags = signal<IAbstractTableFilterCategory[]>([]);\n public keyword = signal<string>('');\n public appliedFilterTags = signal<IAbstractTableFilterCategory[]>([]);\n public appliedKeyword = signal<string>('');\n\n /**\n * A computed signal that returns the currently selected filter tags.\n * It filters the filterTags signal to include only those options that are selected,\n * grouped by their category name.\n *\n * @returns An array of filter categories each containing only the selected options.\n */\n public abstractSelectedTags: Signal<IAbstractTableFilterCategory[]> = computed(() =>\n this.getSelectedOptionsFromTags(this.filterTags()),\n );\n\n /**\n * Determines whether a given item matches a specific filter option within a category.\n * @param item The data item to test.\n * @param categoryName The category name to check within the item.\n * @param option The filter option to match against.\n * @returns True if the item's value for the category matches the option's value; otherwise false.\n */\n protected matchItemWithFilterOption(\n item: IAbstractTableData<SortableValuesType>,\n categoryName: string,\n option: IAbstractTableFilterOption,\n ): boolean {\n return item?.[categoryName] === option.value;\n }\n\n /**\n * Determines whether a given item matches the keyword filter.\n * Checks if any value in the item contains the keyword (case-insensitive).\n * @param item The data item to test.\n * @param keyword The keyword to match against.\n * @returns True if any value in the item contains the keyword; otherwise false.\n */\n protected matchItemWithKeyword(item: IAbstractTableData<SortableValuesType>, keyword: string): boolean {\n return Object.values(item).some((value) => value?.toString().toLowerCase().includes(keyword));\n }\n\n /**\n * Extracts and returns categories from the provided tags that have at least one selected option.\n *\n * For each category in the input array, this method filters its options to include only those marked as selected.\n * Only categories with at least one selected option are included in the returned array.\n *\n * @param tags - An array of category objects, each containing a list of options.\n * @returns An array of category objects, each with only the selected options, and only categories with at least one selected option.\n */\n protected getSelectedOptionsFromTags(tags: IAbstractTableFilterCategory[]): IAbstractTableFilterCategory[] {\n return tags\n .map((group) => ({\n categoryName: group.categoryName,\n options: group.options.filter((option) => option.selected),\n }))\n .filter((group) => group.options.length > 0);\n }\n\n /**\n * Updates the keyword used to filter the table data.\n * @param newKeyword The new keyword string to filter by.\n */\n public onKeywordChange(newKeyword: string): void {\n this.keyword.set(newKeyword);\n }\n\n /**\n * Updates the selection state of a filter option within a category.\n * @param categoryName The name of the filter category.\n * @param optionValue The value of the filter option to update.\n * @param selected Whether the option is selected (true) or deselected (false).\n */\n public onCategoryCheckboxChange(categoryName: string, optionValue: string | number, selected: boolean): void {\n const updatedFilterTags = this.filterTags().map((group) => {\n if (group.categoryName === categoryName) {\n return {\n ...group,\n options: group.options.map((option) => (option.value === optionValue ? { ...option, selected } : option)),\n };\n }\n return group;\n });\n this.filterTags.set(updatedFilterTags);\n }\n\n /**\n * Removes a selected filter tag by deselecting the corresponding filter option.\n * @param categoryName The name of the filter category.\n * @param optionValue The value of the filter option to remove.\n */\n public removeTag(categoryName: string, optionValue: string | number): void {\n this.onCategoryCheckboxChange(categoryName, optionValue, false);\n }\n\n /**\n * Clears all applied filters and resets the filter state.\n *\n * This method performs the following actions:\n * - Resets the keyword and applied keyword to empty strings.\n * - Iterates through all filter tag groups and sets each option's `selected` property to `false`.\n * - Updates both the current and applied filter tags with the cleared state.\n * - Applies the updated filter state.\n */\n public clearAllFilters(): void {\n this.keyword.set('');\n this.appliedKeyword.set('');\n\n const clearedFilterTags = this.filterTags().map((group) => ({\n ...group,\n options: group.options.map((option) => ({ ...option, selected: false })),\n }));\n\n this.filterTags.set(clearedFilterTags);\n this.appliedFilterTags.set(clearedFilterTags);\n\n this.applyFilterState();\n }\n\n /**\n * Initializes and updates the filtered table data based on the currently applied keyword and filter tags.\n *\n * This method performs the following steps:\n * 1. Retrieves the current table data, applied keyword, and filter tags.\n * 2. If filter tags are present, filters the data to include only items that match all selected filter options.\n * 3. If a keyword is present, further filters the data to include only items that match the keyword.\n * 4. Updates the filtered table data signal with the resulting filtered data.\n *\n * @remarks\n * - Filtering by tags requires each item to match every group of filter tags.\n * - Filtering by keyword is case-insensitive and trims whitespace.\n */\n public applyFilterState(): void {\n const data = this.displayTableDataSignal();\n const keyword = this.appliedKeyword().toLowerCase().trim();\n const tags = this.appliedFilterTags();\n\n const selectedTagGroups = this.getSelectedOptionsFromTags(tags);\n\n let filtered = data;\n\n if (selectedTagGroups.length > 0) {\n filtered = filtered.filter((item) =>\n selectedTagGroups.every((group) =>\n group.options.some((option) => this.matchItemWithFilterOption(item, group.categoryName, option)),\n ),\n );\n }\n\n if (keyword) {\n filtered = filtered.filter((item) => this.matchItemWithKeyword(item, keyword));\n }\n\n this.filteredTableDataSignal.set(filtered);\n }\n\n /**\n * Applies the current filter tags and keyword to the table data.\n *\n * This method updates the `appliedFilterTags` and `appliedKeyword` properties\n * with the current filter values, then re-initialises the filtered data set\n * by invoking `applyFilterState()`.\n *\n * Typically called when the user confirms or applies filter changes in the UI.\n */\n public onApplyFilters(): void {\n this.appliedFilterTags.set(this.filterTags());\n this.appliedKeyword.set(this.keyword());\n this.applyFilterState();\n }\n\n /**\n * Sets the data to be displayed in the table.\n *\n * @param data - An array of table data objects conforming to the `IAbstractTableData<SortableValuesType>` interface.\n */\n public setTableData(data: IAbstractTableData<SortableValuesType>[]): void {\n this.displayTableDataSignal.set(data);\n }\n\n /**\n * Resets the filter and keyword state to the provided values and reapplies them.\n *\n * @param tags - The filter tag state to apply (including selected values).\n * @param keyword - The keyword string to apply (optional, defaults to empty).\n */\n public resetFiltersTo(tags: IAbstractTableFilterCategory[], keyword: string = ''): void {\n this.filterTags.set(tags);\n this.keyword.set(keyword);\n this.appliedFilterTags.set(tags);\n this.appliedKeyword.set(keyword);\n this.applyFilterState();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;MASsB,4BAA4B,CAAA;AACzC,IAAA,sBAAsB,GAAG,MAAM,CAA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B;AAEA;;;;AAIG;AACI,IAAA,YAAY,CAAC,IAA8C,EAAA;AAChE,QAAA,IAAI,CAAC,sBAAsB,CAAC,GAAG,CAAC,IAAI,CAAC;IACvC;AAEA;;;;;AAKG;AACI,IAAA,cAAc,CAAC,IAAoC,EAAE,OAAA,GAAkB,EAAE,EAAA;AAC9E,QAAA,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC;AACzB,QAAA,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;AACzB,QAAA,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC;AAChC,QAAA,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC;QAChC,IAAI,CAAC,gBAAgB,EAAE;IACzB;uGApMoB,4BAA4B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAA5B,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,4BAA4B,wEAD3B,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA;;2FACH,4BAA4B,EAAA,UAAA,EAAA,CAAA;kBADjD,SAAS;mBAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;;;ACR3B;;AAEG;;;;"}
@@ -221,10 +221,10 @@ class AlphagovAccessibleAutocompleteComponent {
221
221
  this.describedByObserver?.disconnect();
222
222
  this.containerObserver?.disconnect();
223
223
  }
224
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: AlphagovAccessibleAutocompleteComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
225
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.1", type: AlphagovAccessibleAutocompleteComponent, isStandalone: true, selector: "opal-lib-alphagov-accessible-autocomplete", inputs: { labelText: "labelText", labelClasses: "labelClasses", inputId: "inputId", inputName: "inputName", inputClasses: "inputClasses", hintText: "hintText", autoCompleteItems: "autoCompleteItems", showAllValues: "showAllValues", errors: "errors", control: "control" }, viewQueries: [{ propertyName: "autocompleteContainer", first: true, predicate: ["autocomplete"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"govuk-form-group\" [class.govuk-form-group--error]=\"!!errors\">\n <label class=\"govuk-label {{ labelClasses }}\" [for]=\"autoCompleteId\"> {{ labelText }} </label>\n @if (hintText) {\n <div id=\"{{ inputId }}-hint\" class=\"govuk-hint\">\n {{ hintText }}\n </div>\n }\n\n @if (errors) {\n <p id=\"{{ this.autoCompleteId }}-error-message\" class=\"govuk-error-message\">\n <span class=\"govuk-visually-hidden\">Error: </span> {{ errors }}\n </p>\n }\n\n <div #autocomplete id=\"{{ autoCompleteId }}-container\" class=\"{{ inputClasses }}\"></div>\n <input\n [id]=\"inputId\"\n [name]=\"inputName\"\n type=\"hidden\"\n [formControl]=\"getControl\"\n [attr.aria-describedby]=\"hintText ? inputId + '-hint' : null\"\n />\n</div>\n", styles: [":host ::ng-deep .autocomplete__option{font-family:GDS Transport,arial,sans-serif}:host ::ng-deep .govuk-input--error input{border-color:#d4351c}:host ::ng-deep .autocomplete__input{background-color:#fff}:host ::ng-deep .autocomplete__dropdown-arrow-down{z-index:1!important;pointer-events:none!important}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
224
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: AlphagovAccessibleAutocompleteComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
225
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.6", type: AlphagovAccessibleAutocompleteComponent, isStandalone: true, selector: "opal-lib-alphagov-accessible-autocomplete", inputs: { labelText: "labelText", labelClasses: "labelClasses", inputId: "inputId", inputName: "inputName", inputClasses: "inputClasses", hintText: "hintText", autoCompleteItems: "autoCompleteItems", showAllValues: "showAllValues", errors: "errors", control: "control" }, viewQueries: [{ propertyName: "autocompleteContainer", first: true, predicate: ["autocomplete"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"govuk-form-group\" [class.govuk-form-group--error]=\"!!errors\">\n <label class=\"govuk-label {{ labelClasses }}\" [for]=\"autoCompleteId\"> {{ labelText }} </label>\n @if (hintText) {\n <div id=\"{{ inputId }}-hint\" class=\"govuk-hint\">\n {{ hintText }}\n </div>\n }\n\n @if (errors) {\n <p id=\"{{ this.autoCompleteId }}-error-message\" class=\"govuk-error-message\">\n <span class=\"govuk-visually-hidden\">Error: </span> {{ errors }}\n </p>\n }\n\n <div #autocomplete id=\"{{ autoCompleteId }}-container\" class=\"{{ inputClasses }}\"></div>\n <input\n [id]=\"inputId\"\n [name]=\"inputName\"\n type=\"hidden\"\n [formControl]=\"getControl\"\n [attr.aria-describedby]=\"hintText ? inputId + '-hint' : null\"\n />\n</div>\n", styles: [":host ::ng-deep .autocomplete__option{font-family:GDS Transport,arial,sans-serif}:host ::ng-deep .govuk-input--error input{border-color:#d4351c}:host ::ng-deep .autocomplete__input{background-color:#fff}:host ::ng-deep .autocomplete__dropdown-arrow-down{z-index:1!important;pointer-events:none!important}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
226
226
  }
227
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: AlphagovAccessibleAutocompleteComponent, decorators: [{
227
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: AlphagovAccessibleAutocompleteComponent, decorators: [{
228
228
  type: Component,
229
229
  args: [{ selector: 'opal-lib-alphagov-accessible-autocomplete', imports: [ReactiveFormsModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"govuk-form-group\" [class.govuk-form-group--error]=\"!!errors\">\n <label class=\"govuk-label {{ labelClasses }}\" [for]=\"autoCompleteId\"> {{ labelText }} </label>\n @if (hintText) {\n <div id=\"{{ inputId }}-hint\" class=\"govuk-hint\">\n {{ hintText }}\n </div>\n }\n\n @if (errors) {\n <p id=\"{{ this.autoCompleteId }}-error-message\" class=\"govuk-error-message\">\n <span class=\"govuk-visually-hidden\">Error: </span> {{ errors }}\n </p>\n }\n\n <div #autocomplete id=\"{{ autoCompleteId }}-container\" class=\"{{ inputClasses }}\"></div>\n <input\n [id]=\"inputId\"\n [name]=\"inputName\"\n type=\"hidden\"\n [formControl]=\"getControl\"\n [attr.aria-describedby]=\"hintText ? inputId + '-hint' : null\"\n />\n</div>\n", styles: [":host ::ng-deep .autocomplete__option{font-family:GDS Transport,arial,sans-serif}:host ::ng-deep .govuk-input--error input{border-color:#d4351c}:host ::ng-deep .autocomplete__input{background-color:#fff}:host ::ng-deep .autocomplete__dropdown-arrow-down{z-index:1!important;pointer-events:none!important}\n"] }]
230
230
  }], ctorParameters: () => [], propDecorators: { labelText: [{