@hmcts/ccd-case-ui-toolkit 6.14.2-clear-validation-errors → 6.14.2-go-to-page-2

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 (29) hide show
  1. package/bundles/hmcts-ccd-case-ui-toolkit.umd.js +178 -157
  2. package/bundles/hmcts-ccd-case-ui-toolkit.umd.js.map +1 -1
  3. package/bundles/hmcts-ccd-case-ui-toolkit.umd.min.js +1 -1
  4. package/bundles/hmcts-ccd-case-ui-toolkit.umd.min.js.map +1 -1
  5. package/esm2015/lib/shared/commons/case-edit-data/case-edit-data.service.js +5 -8
  6. package/esm2015/lib/shared/components/case-editor/case-edit-page/case-edit-page.component.js +19 -4
  7. package/esm2015/lib/shared/components/pagination/pagination.component.js +88 -57
  8. package/esm2015/lib/shared/components/palette/linked-cases/components/linked-cases-table/linked-cases-to-table.component.js +26 -2
  9. package/esm2015/lib/shared/components/palette/linked-cases/domain/linked-cases-state.model.js +1 -1
  10. package/esm2015/lib/shared/components/palette/linked-cases/write-linked-cases-field.component.js +36 -86
  11. package/esm2015/lib/shared/components/palette/palette.module.js +2 -2
  12. package/esm2015/lib/shared/services/fields/fields.utils.js +8 -1
  13. package/fesm2015/hmcts-ccd-case-ui-toolkit.js +176 -152
  14. package/fesm2015/hmcts-ccd-case-ui-toolkit.js.map +1 -1
  15. package/lib/shared/commons/case-edit-data/case-edit-data.service.d.ts +3 -5
  16. package/lib/shared/commons/case-edit-data/case-edit-data.service.d.ts.map +1 -1
  17. package/lib/shared/components/case-editor/case-edit-page/case-edit-page.component.d.ts +2 -0
  18. package/lib/shared/components/case-editor/case-edit-page/case-edit-page.component.d.ts.map +1 -1
  19. package/lib/shared/components/pagination/pagination.component.d.ts +1 -0
  20. package/lib/shared/components/pagination/pagination.component.d.ts.map +1 -1
  21. package/lib/shared/components/palette/linked-cases/components/linked-cases-table/linked-cases-to-table.component.d.ts +2 -0
  22. package/lib/shared/components/palette/linked-cases/components/linked-cases-table/linked-cases-to-table.component.d.ts.map +1 -1
  23. package/lib/shared/components/palette/linked-cases/domain/linked-cases-state.model.d.ts +0 -4
  24. package/lib/shared/components/palette/linked-cases/domain/linked-cases-state.model.d.ts.map +1 -1
  25. package/lib/shared/components/palette/linked-cases/write-linked-cases-field.component.d.ts +0 -4
  26. package/lib/shared/components/palette/linked-cases/write-linked-cases-field.component.d.ts.map +1 -1
  27. package/lib/shared/services/fields/fields.utils.d.ts +2 -0
  28. package/lib/shared/services/fields/fields.utils.d.ts.map +1 -1
  29. package/package.json +1 -1
@@ -3464,6 +3464,13 @@ class FieldsUtils {
3464
3464
  }
3465
3465
  return caseField.field_type.type === 'ComponentLauncher';
3466
3466
  }
3467
+ static isLinkedCasesCaseField(caseField) {
3468
+ return FieldsUtils.isComponentLauncherCaseField(caseField) &&
3469
+ caseField.id === 'LinkedCasesComponentLauncher';
3470
+ }
3471
+ static containsLinkedCasesCaseField(caseFields) {
3472
+ return caseFields === null || caseFields === void 0 ? void 0 : caseFields.some(caseField => FieldsUtils.isLinkedCasesCaseField(caseField));
3473
+ }
3467
3474
  static isFlagsFieldType(fieldType) {
3468
3475
  if (!fieldType) {
3469
3476
  return false;
@@ -8588,14 +8595,14 @@ class CaseEditDataService {
8588
8595
  this.title$ = new BehaviorSubject(null);
8589
8596
  this.formValidationErrors$ = new BehaviorSubject([]);
8590
8597
  this.editForm$ = new BehaviorSubject(null);
8591
- this.linkError$ = new BehaviorSubject(null);
8598
+ this.isLinkedCasesJourneyAtFinalStep$ = new BehaviorSubject(null);
8592
8599
  this.eventTriggerName$ = new BehaviorSubject(null);
8593
8600
  this.triggerSubmitEvent$ = new BehaviorSubject(null);
8594
8601
  this.caseDetails$ = this.details$.asObservable();
8595
8602
  this.caseTitle$ = this.title$.asObservable();
8596
8603
  this.caseEditForm$ = this.editForm$.asObservable();
8597
8604
  this.caseFormValidationErrors$ = this.formValidationErrors$.asObservable();
8598
- this.caseLinkError$ = this.linkError$.asObservable();
8605
+ this.caseIsLinkedCasesJourneyAtFinalStep$ = this.isLinkedCasesJourneyAtFinalStep$.asObservable();
8599
8606
  this.caseEventTriggerName$ = this.eventTriggerName$.asObservable();
8600
8607
  this.caseTriggerSubmitEvent$ = this.triggerSubmitEvent$.asObservable();
8601
8608
  }
@@ -8608,9 +8615,6 @@ class CaseEditDataService {
8608
8615
  setCaseEventTriggerName(triggerName) {
8609
8616
  this.eventTriggerName$.next(triggerName);
8610
8617
  }
8611
- setCaseLinkError(error) {
8612
- this.linkError$.next(error);
8613
- }
8614
8618
  setFormValidationErrors(validationErrors) {
8615
8619
  this.formValidationErrors$.next(validationErrors);
8616
8620
  }
@@ -8620,8 +8624,8 @@ class CaseEditDataService {
8620
8624
  clearFormValidationErrors() {
8621
8625
  this.formValidationErrors$.next([]);
8622
8626
  }
8623
- clearCaseLinkError() {
8624
- this.linkError$.next(null);
8627
+ setLinkedCasesJourneyAtFinalStep(isAtFinalStep) {
8628
+ this.isLinkedCasesJourneyAtFinalStep$.next(isAtFinalStep);
8625
8629
  }
8626
8630
  addFormValidationError(validationError) {
8627
8631
  this.formValidationErrors$.next(this.formValidationErrors$.getValue().concat([validationError]));
@@ -8995,6 +8999,9 @@ class CaseEditPageComponent {
8995
8999
  this.caseEditDataService.caseEditForm$.subscribe({
8996
9000
  next: editForm => this.editForm = editForm
8997
9001
  });
9002
+ this.caseEditDataService.caseIsLinkedCasesJourneyAtFinalStep$.subscribe({
9003
+ next: isLinkedCasesJourneyAtFinalStep => this.isLinkedCasesJourneyAtFinalStep = isLinkedCasesJourneyAtFinalStep
9004
+ });
8998
9005
  this.caseEditDataService.caseTriggerSubmitEvent$.subscribe({
8999
9006
  next: state => {
9000
9007
  if (state) {
@@ -9014,7 +9021,11 @@ class CaseEditPageComponent {
9014
9021
  return this.caseEdit.first();
9015
9022
  }
9016
9023
  currentPageIsNotValid() {
9017
- return !this.pageValidationService.isPageValid(this.currentPage, this.editForm);
9024
+ return !this.pageValidationService.isPageValid(this.currentPage, this.editForm) ||
9025
+ (this.isLinkedCasesJourney() && !this.isLinkedCasesJourneyAtFinalStep);
9026
+ }
9027
+ isLinkedCasesJourney() {
9028
+ return FieldsUtils.containsLinkedCasesCaseField(this.currentPage.case_fields);
9018
9029
  }
9019
9030
  /**
9020
9031
  * caseEventData.event_data contains all the values from the previous pages so we set caseEventData.data = caseEventData.event_data
@@ -9112,7 +9123,16 @@ class CaseEditPageComponent {
9112
9123
  submit() {
9113
9124
  this.caseEditDataService.clearFormValidationErrors();
9114
9125
  if (this.currentPageIsNotValid()) {
9115
- this.generateErrorMessage(this.currentPage.case_fields);
9126
+ // The generateErrorMessage method filters out the hidden fields.
9127
+ // The error message for LinkedCases journey will never get displayed because the
9128
+ // LinkedCases is configured with ComponentLauncher field as visible and caseLinks field as hidden.
9129
+ if (this.isLinkedCasesJourney()) {
9130
+ this.validationErrors.push({ id: 'next-button', message: 'Please select Next to go to the next page' });
9131
+ CaseEditPageComponent.scrollToTop();
9132
+ }
9133
+ else {
9134
+ this.generateErrorMessage(this.currentPage.case_fields);
9135
+ }
9116
9136
  }
9117
9137
  if (!this.isSubmitting && !this.currentPageIsNotValid()) {
9118
9138
  this.isSubmitting = true;
@@ -9215,7 +9235,6 @@ class CaseEditPageComponent {
9215
9235
  else {
9216
9236
  this.caseEdit.cancelled.emit();
9217
9237
  }
9218
- this.caseEditDataService.clearFormValidationErrors();
9219
9238
  }
9220
9239
  submitting() {
9221
9240
  return this.isSubmitting;
@@ -14885,10 +14904,11 @@ class LinkedCasesToTableComponent {
14885
14904
  });
14886
14905
  if (searchCasesResponse.length) {
14887
14906
  this.searchCasesByCaseIds(searchCasesResponse).subscribe((searchCases) => {
14888
- const casesResponse = [];
14907
+ let casesResponse = [];
14889
14908
  searchCases.forEach(response => {
14890
14909
  casesResponse.push(this.mapResponse(response));
14891
14910
  });
14911
+ casesResponse = this.sortReasonCodes(casesResponse);
14892
14912
  this.linkedCasesFromResponse = this.sortLinkedCasesByReasonCode(casesResponse);
14893
14913
  this.isLoaded = true;
14894
14914
  const caseLinks = this.linkedCasesFromResponse.map(item => {
@@ -14914,6 +14934,29 @@ class LinkedCasesToTableComponent {
14914
14934
  });
14915
14935
  }
14916
14936
  }
14937
+ sortReasonCodes(searchCasesResponse) {
14938
+ searchCasesResponse.forEach((item) => {
14939
+ var _a;
14940
+ if ((_a = item === null || item === void 0 ? void 0 : item.reasons) === null || _a === void 0 ? void 0 : _a.length) {
14941
+ item.reasons.forEach((reason) => {
14942
+ reason.sortOrder = this.getReasonSortOrder(reason.value.Reason);
14943
+ });
14944
+ item.reasons = item.reasons.sort((a, b) => a.sortOrder - b.sortOrder);
14945
+ item.sortOrder = item.reasons[0].sortOrder;
14946
+ }
14947
+ });
14948
+ searchCasesResponse = searchCasesResponse === null || searchCasesResponse === void 0 ? void 0 : searchCasesResponse.sort((a, b) => a.sortOrder - b.sortOrder);
14949
+ return searchCasesResponse;
14950
+ }
14951
+ getReasonSortOrder(reasonCode) {
14952
+ if (reasonCode === LinkedCasesToTableComponent.CASE_PROGRESS_REASON_CODE) {
14953
+ return 1;
14954
+ }
14955
+ else if (reasonCode === LinkedCasesToTableComponent.CASE_CONSOLIDATED_REASON_CODE) {
14956
+ return 2;
14957
+ }
14958
+ return 3;
14959
+ }
14917
14960
  searchCasesByCaseIds(searchCasesResponse) {
14918
14961
  return forkJoin(searchCasesResponse);
14919
14962
  }
@@ -15448,72 +15491,43 @@ ReadLinkedCasesFieldComponent.ɵcmp = i0.ɵɵdefineComponent({ type: ReadLinkedC
15448
15491
  }]
15449
15492
  }], function () { return [{ type: i1$1.ActivatedRoute }, { type: i1$1.Router }, { type: LinkedCasesService }, { type: AbstractAppConfig }, { type: CommonDataService }]; }, null); })();
15450
15493
 
15451
- function WriteLinkedCasesFieldComponent_div_0_div_3_Template(rf, ctx) { if (rf & 1) {
15452
- const _r9 = i0.ɵɵgetCurrentView();
15453
- i0.ɵɵelementStart(0, "div", 7);
15454
- i0.ɵɵelementStart(1, "ul", 8);
15455
- i0.ɵɵelementStart(2, "li");
15456
- i0.ɵɵelementStart(3, "a", 9);
15457
- i0.ɵɵlistener("click", function WriteLinkedCasesFieldComponent_div_0_div_3_Template_a_click_3_listener() { i0.ɵɵrestoreView(_r9); const errorMessage_r7 = ctx.$implicit; const ctx_r8 = i0.ɵɵnextContext(2); return ctx_r8.navigateToErrorElement(errorMessage_r7.fieldId); });
15458
- i0.ɵɵtext(4);
15459
- i0.ɵɵelementEnd();
15460
- i0.ɵɵelementEnd();
15461
- i0.ɵɵelementEnd();
15462
- i0.ɵɵelementEnd();
15463
- } if (rf & 2) {
15464
- const errorMessage_r7 = ctx.$implicit;
15465
- i0.ɵɵadvance(4);
15466
- i0.ɵɵtextInterpolate(errorMessage_r7.description);
15467
- } }
15468
- function WriteLinkedCasesFieldComponent_div_0_Template(rf, ctx) { if (rf & 1) {
15469
- i0.ɵɵelementStart(0, "div", 4);
15470
- i0.ɵɵelementStart(1, "h2", 5);
15471
- i0.ɵɵtext(2, " There is a problem ");
15472
- i0.ɵɵelementEnd();
15473
- i0.ɵɵtemplate(3, WriteLinkedCasesFieldComponent_div_0_div_3_Template, 5, 1, "div", 6);
15494
+ function WriteLinkedCasesFieldComponent_ng_container_2_Template(rf, ctx) { if (rf & 1) {
15495
+ const _r6 = i0.ɵɵgetCurrentView();
15496
+ i0.ɵɵelementContainerStart(0);
15497
+ i0.ɵɵelementStart(1, "ccd-linked-cases-before-you-start", 3);
15498
+ i0.ɵɵlistener("linkedCasesStateEmitter", function WriteLinkedCasesFieldComponent_ng_container_2_Template_ccd_linked_cases_before_you_start_linkedCasesStateEmitter_1_listener($event) { i0.ɵɵrestoreView(_r6); const ctx_r5 = i0.ɵɵnextContext(); return ctx_r5.onLinkedCasesStateEmitted($event); });
15474
15499
  i0.ɵɵelementEnd();
15475
- } if (rf & 2) {
15476
- const ctx_r0 = i0.ɵɵnextContext();
15477
- i0.ɵɵadvance(3);
15478
- i0.ɵɵproperty("ngForOf", ctx_r0.errorMessages);
15500
+ i0.ɵɵelementContainerEnd();
15479
15501
  } }
15480
15502
  function WriteLinkedCasesFieldComponent_ng_container_3_Template(rf, ctx) { if (rf & 1) {
15481
- const _r11 = i0.ɵɵgetCurrentView();
15503
+ const _r8 = i0.ɵɵgetCurrentView();
15482
15504
  i0.ɵɵelementContainerStart(0);
15483
- i0.ɵɵelementStart(1, "ccd-linked-cases-before-you-start", 10);
15484
- i0.ɵɵlistener("linkedCasesStateEmitter", function WriteLinkedCasesFieldComponent_ng_container_3_Template_ccd_linked_cases_before_you_start_linkedCasesStateEmitter_1_listener($event) { i0.ɵɵrestoreView(_r11); const ctx_r10 = i0.ɵɵnextContext(); return ctx_r10.onLinkedCasesStateEmitted($event); });
15505
+ i0.ɵɵelementStart(1, "ccd-no-linked-cases", 3);
15506
+ i0.ɵɵlistener("linkedCasesStateEmitter", function WriteLinkedCasesFieldComponent_ng_container_3_Template_ccd_no_linked_cases_linkedCasesStateEmitter_1_listener($event) { i0.ɵɵrestoreView(_r8); const ctx_r7 = i0.ɵɵnextContext(); return ctx_r7.onLinkedCasesStateEmitted($event); });
15485
15507
  i0.ɵɵelementEnd();
15486
15508
  i0.ɵɵelementContainerEnd();
15487
15509
  } }
15488
15510
  function WriteLinkedCasesFieldComponent_ng_container_4_Template(rf, ctx) { if (rf & 1) {
15489
- const _r13 = i0.ɵɵgetCurrentView();
15511
+ const _r10 = i0.ɵɵgetCurrentView();
15490
15512
  i0.ɵɵelementContainerStart(0);
15491
- i0.ɵɵelementStart(1, "ccd-no-linked-cases", 10);
15492
- i0.ɵɵlistener("linkedCasesStateEmitter", function WriteLinkedCasesFieldComponent_ng_container_4_Template_ccd_no_linked_cases_linkedCasesStateEmitter_1_listener($event) { i0.ɵɵrestoreView(_r13); const ctx_r12 = i0.ɵɵnextContext(); return ctx_r12.onLinkedCasesStateEmitted($event); });
15513
+ i0.ɵɵelementStart(1, "ccd-link-cases", 3);
15514
+ i0.ɵɵlistener("linkedCasesStateEmitter", function WriteLinkedCasesFieldComponent_ng_container_4_Template_ccd_link_cases_linkedCasesStateEmitter_1_listener($event) { i0.ɵɵrestoreView(_r10); const ctx_r9 = i0.ɵɵnextContext(); return ctx_r9.onLinkedCasesStateEmitted($event); });
15493
15515
  i0.ɵɵelementEnd();
15494
15516
  i0.ɵɵelementContainerEnd();
15495
15517
  } }
15496
15518
  function WriteLinkedCasesFieldComponent_ng_container_5_Template(rf, ctx) { if (rf & 1) {
15497
- const _r15 = i0.ɵɵgetCurrentView();
15519
+ const _r12 = i0.ɵɵgetCurrentView();
15498
15520
  i0.ɵɵelementContainerStart(0);
15499
- i0.ɵɵelementStart(1, "ccd-link-cases", 10);
15500
- i0.ɵɵlistener("linkedCasesStateEmitter", function WriteLinkedCasesFieldComponent_ng_container_5_Template_ccd_link_cases_linkedCasesStateEmitter_1_listener($event) { i0.ɵɵrestoreView(_r15); const ctx_r14 = i0.ɵɵnextContext(); return ctx_r14.onLinkedCasesStateEmitted($event); });
15521
+ i0.ɵɵelementStart(1, "ccd-unlink-cases", 3);
15522
+ i0.ɵɵlistener("linkedCasesStateEmitter", function WriteLinkedCasesFieldComponent_ng_container_5_Template_ccd_unlink_cases_linkedCasesStateEmitter_1_listener($event) { i0.ɵɵrestoreView(_r12); const ctx_r11 = i0.ɵɵnextContext(); return ctx_r11.onLinkedCasesStateEmitted($event); });
15501
15523
  i0.ɵɵelementEnd();
15502
15524
  i0.ɵɵelementContainerEnd();
15503
15525
  } }
15504
15526
  function WriteLinkedCasesFieldComponent_ng_container_6_Template(rf, ctx) { if (rf & 1) {
15505
- const _r17 = i0.ɵɵgetCurrentView();
15506
- i0.ɵɵelementContainerStart(0);
15507
- i0.ɵɵelementStart(1, "ccd-unlink-cases", 10);
15508
- i0.ɵɵlistener("linkedCasesStateEmitter", function WriteLinkedCasesFieldComponent_ng_container_6_Template_ccd_unlink_cases_linkedCasesStateEmitter_1_listener($event) { i0.ɵɵrestoreView(_r17); const ctx_r16 = i0.ɵɵnextContext(); return ctx_r16.onLinkedCasesStateEmitted($event); });
15509
- i0.ɵɵelementEnd();
15510
- i0.ɵɵelementContainerEnd();
15511
- } }
15512
- function WriteLinkedCasesFieldComponent_ng_container_7_Template(rf, ctx) { if (rf & 1) {
15513
- const _r19 = i0.ɵɵgetCurrentView();
15527
+ const _r14 = i0.ɵɵgetCurrentView();
15514
15528
  i0.ɵɵelementContainerStart(0);
15515
- i0.ɵɵelementStart(1, "ccd-linked-cases-check-your-answers", 10);
15516
- i0.ɵɵlistener("linkedCasesStateEmitter", function WriteLinkedCasesFieldComponent_ng_container_7_Template_ccd_linked_cases_check_your_answers_linkedCasesStateEmitter_1_listener($event) { i0.ɵɵrestoreView(_r19); const ctx_r18 = i0.ɵɵnextContext(); return ctx_r18.onLinkedCasesStateEmitted($event); });
15529
+ i0.ɵɵelementStart(1, "ccd-linked-cases-check-your-answers", 3);
15530
+ i0.ɵɵlistener("linkedCasesStateEmitter", function WriteLinkedCasesFieldComponent_ng_container_6_Template_ccd_linked_cases_check_your_answers_linkedCasesStateEmitter_1_listener($event) { i0.ɵɵrestoreView(_r14); const ctx_r13 = i0.ɵɵnextContext(); return ctx_r13.onLinkedCasesStateEmitted($event); });
15517
15531
  i0.ɵɵelementEnd();
15518
15532
  i0.ɵɵelementContainerEnd();
15519
15533
  } }
@@ -15528,9 +15542,11 @@ class WriteLinkedCasesFieldComponent extends AbstractFieldWriteComponent {
15528
15542
  this.linkedCasesPages = LinkedCasesPages;
15529
15543
  this.linkedCasesEventTriggers = LinkedCasesEventTriggers;
15530
15544
  this.linkedCases = [];
15531
- this.errorMessages = [];
15532
15545
  }
15533
15546
  ngOnInit() {
15547
+ // This is required to enable Continue button validation
15548
+ // Continue button should be enabled only at check your answers page
15549
+ this.caseEditDataService.setLinkedCasesJourneyAtFinalStep(false);
15534
15550
  // Clear validation errors
15535
15551
  this.caseEditDataService.clearFormValidationErrors();
15536
15552
  // Get linked case reasons from ref data
@@ -15566,11 +15582,10 @@ class WriteLinkedCasesFieldComponent extends AbstractFieldWriteComponent {
15566
15582
  }
15567
15583
  }
15568
15584
  onLinkedCasesStateEmitted(linkedCasesState) {
15569
- this.errorMessages = [];
15585
+ // Clear validation errors
15570
15586
  this.caseEditDataService.clearFormValidationErrors();
15571
15587
  if (linkedCasesState.navigateToNextPage) {
15572
15588
  this.linkedCasesPage = this.getNextPage(linkedCasesState);
15573
- this.setContinueButtonValidationErrorMessage();
15574
15589
  this.proceedToNextPage();
15575
15590
  }
15576
15591
  else {
@@ -15593,27 +15608,19 @@ class WriteLinkedCasesFieldComponent extends AbstractFieldWriteComponent {
15593
15608
  }
15594
15609
  });
15595
15610
  }
15596
- setContinueButtonValidationErrorMessage() {
15597
- const errorMessage = this.linkedCasesService.isLinkedCasesEventTrigger
15598
- ? LinkedCasesErrorMessages.LinkCasesNavigationError
15599
- : LinkedCasesErrorMessages.UnlinkCasesNavigationError;
15600
- const buttonId = this.linkedCasesService.linkedCases.length === 0
15601
- ? 'back-button'
15602
- : 'next-button';
15603
- this.caseEditDataService.setCaseLinkError({
15604
- componentId: buttonId,
15605
- errorMessage
15606
- });
15607
- }
15608
15611
  proceedToNextPage() {
15609
15612
  if (this.isAtFinalPage()) {
15610
15613
  // Continue button event must be allowed in final page
15611
- this.caseEditDataService.clearCaseLinkError();
15614
+ this.caseEditDataService.setLinkedCasesJourneyAtFinalStep(true);
15612
15615
  // Trigger validation to clear the "notAtFinalPage" error if now at the final state
15613
15616
  this.formGroup.updateValueAndValidity();
15614
15617
  // update form value
15615
15618
  this.submitLinkedCases();
15616
15619
  }
15620
+ else {
15621
+ // Continue button event must not be allowed if not in final page
15622
+ this.caseEditDataService.setLinkedCasesJourneyAtFinalStep(false);
15623
+ }
15617
15624
  }
15618
15625
  submitLinkedCases() {
15619
15626
  if (!this.linkedCasesService.isLinkedCasesEventTrigger) {
@@ -15653,35 +15660,21 @@ class WriteLinkedCasesFieldComponent extends AbstractFieldWriteComponent {
15653
15660
  && !this.linkedCasesService.serverLinkedApiError)
15654
15661
  ? LinkedCasesPages.BEFORE_YOU_START
15655
15662
  : LinkedCasesPages.NO_LINKED_CASES;
15656
- // Initialise the error to be displayed when clicked on Continue button
15657
- this.setContinueButtonValidationErrorMessage();
15658
15663
  });
15659
15664
  }
15660
- navigateToErrorElement(elementId) {
15661
- if (elementId) {
15662
- const htmlElement = document.getElementById(elementId);
15663
- if (htmlElement) {
15664
- htmlElement.scrollIntoView({ behavior: 'smooth', block: 'center' });
15665
- htmlElement.focus();
15666
- }
15667
- }
15668
- }
15669
15665
  }
15670
15666
  WriteLinkedCasesFieldComponent.ɵfac = function WriteLinkedCasesFieldComponent_Factory(t) { return new (t || WriteLinkedCasesFieldComponent)(i0.ɵɵdirectiveInject(AbstractAppConfig), i0.ɵɵdirectiveInject(CommonDataService), i0.ɵɵdirectiveInject(CasesService), i0.ɵɵdirectiveInject(LinkedCasesService), i0.ɵɵdirectiveInject(CaseEditDataService)); };
15671
- WriteLinkedCasesFieldComponent.ɵcmp = i0.ɵɵdefineComponent({ type: WriteLinkedCasesFieldComponent, selectors: [["ccd-write-linked-cases-field"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 8, vars: 8, consts: [["class", "govuk-error-summary", "aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "govuk-error-summary", 4, "ngIf"], [1, "form-group", "govuk-!-margin-bottom-2", 3, "formGroup"], [1, "govuk-form-group", 3, "ngSwitch"], [4, "ngSwitchCase"], ["aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "govuk-error-summary", 1, "govuk-error-summary"], ["id", "error-summary-title", 1, "govuk-error-summary__title"], ["class", "govuk-error-summary__body", 4, "ngFor", "ngForOf"], [1, "govuk-error-summary__body"], [1, "govuk-list", "govuk-error-summary__list"], [1, "validation-error", 3, "click"], [3, "linkedCasesStateEmitter"]], template: function WriteLinkedCasesFieldComponent_Template(rf, ctx) { if (rf & 1) {
15672
- i0.ɵɵtemplate(0, WriteLinkedCasesFieldComponent_div_0_Template, 4, 1, "div", 0);
15667
+ WriteLinkedCasesFieldComponent.ɵcmp = i0.ɵɵdefineComponent({ type: WriteLinkedCasesFieldComponent, selectors: [["ccd-write-linked-cases-field"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 7, vars: 7, consts: [[1, "form-group", "govuk-!-margin-bottom-2", 3, "formGroup"], [1, "govuk-form-group", 3, "ngSwitch"], [4, "ngSwitchCase"], [3, "linkedCasesStateEmitter"]], template: function WriteLinkedCasesFieldComponent_Template(rf, ctx) { if (rf & 1) {
15668
+ i0.ɵɵelementStart(0, "div", 0);
15673
15669
  i0.ɵɵelementStart(1, "div", 1);
15674
- i0.ɵɵelementStart(2, "div", 2);
15675
- i0.ɵɵtemplate(3, WriteLinkedCasesFieldComponent_ng_container_3_Template, 2, 0, "ng-container", 3);
15676
- i0.ɵɵtemplate(4, WriteLinkedCasesFieldComponent_ng_container_4_Template, 2, 0, "ng-container", 3);
15677
- i0.ɵɵtemplate(5, WriteLinkedCasesFieldComponent_ng_container_5_Template, 2, 0, "ng-container", 3);
15678
- i0.ɵɵtemplate(6, WriteLinkedCasesFieldComponent_ng_container_6_Template, 2, 0, "ng-container", 3);
15679
- i0.ɵɵtemplate(7, WriteLinkedCasesFieldComponent_ng_container_7_Template, 2, 0, "ng-container", 3);
15670
+ i0.ɵɵtemplate(2, WriteLinkedCasesFieldComponent_ng_container_2_Template, 2, 0, "ng-container", 2);
15671
+ i0.ɵɵtemplate(3, WriteLinkedCasesFieldComponent_ng_container_3_Template, 2, 0, "ng-container", 2);
15672
+ i0.ɵɵtemplate(4, WriteLinkedCasesFieldComponent_ng_container_4_Template, 2, 0, "ng-container", 2);
15673
+ i0.ɵɵtemplate(5, WriteLinkedCasesFieldComponent_ng_container_5_Template, 2, 0, "ng-container", 2);
15674
+ i0.ɵɵtemplate(6, WriteLinkedCasesFieldComponent_ng_container_6_Template, 2, 0, "ng-container", 2);
15680
15675
  i0.ɵɵelementEnd();
15681
15676
  i0.ɵɵelementEnd();
15682
15677
  } if (rf & 2) {
15683
- i0.ɵɵproperty("ngIf", ctx.errorMessages.length > 0);
15684
- i0.ɵɵadvance(1);
15685
15678
  i0.ɵɵproperty("formGroup", ctx.formGroup);
15686
15679
  i0.ɵɵadvance(1);
15687
15680
  i0.ɵɵproperty("ngSwitch", ctx.linkedCasesPage);
@@ -22644,7 +22637,7 @@ i0.ɵɵsetComponentScope(WriteCaseFlagFieldComponent, [i1.NgIf, i1.NgForOf, i2.N
22644
22637
  AddCommentsComponent,
22645
22638
  ManageCaseFlagsComponent,
22646
22639
  UpdateFlagComponent], []);
22647
- i0.ɵɵsetComponentScope(WriteLinkedCasesFieldComponent, [i1.NgIf, i1.NgForOf, i2.NgControlStatusGroup, i2.FormGroupDirective, i1.NgSwitch, i1.NgSwitchCase, BeforeYouStartComponent,
22640
+ i0.ɵɵsetComponentScope(WriteLinkedCasesFieldComponent, [i2.NgControlStatusGroup, i2.FormGroupDirective, i1.NgSwitch, i1.NgSwitchCase, BeforeYouStartComponent,
22648
22641
  NoLinkedCasesComponent,
22649
22642
  LinkCasesComponent,
22650
22643
  UnLinkCasesComponent,
@@ -24141,40 +24134,40 @@ CaseHeaderModule.ɵinj = i0.ɵɵdefineInjector({ imports: [[
24141
24134
  }], null, null); })();
24142
24135
 
24143
24136
  function PaginationComponent_ul_3_li_1_a_1_Template(rf, ctx) { if (rf & 1) {
24144
- const _r8 = i0.ɵɵgetCurrentView();
24145
- i0.ɵɵelementStart(0, "a", 12);
24146
- i0.ɵɵlistener("keyup.enter", function PaginationComponent_ul_3_li_1_a_1_Template_a_keyup_enter_0_listener() { i0.ɵɵrestoreView(_r8); i0.ɵɵnextContext(3); const _r0 = i0.ɵɵreference(1); return _r0.previous(); })("click", function PaginationComponent_ul_3_li_1_a_1_Template_a_click_0_listener() { i0.ɵɵrestoreView(_r8); i0.ɵɵnextContext(3); const _r0 = i0.ɵɵreference(1); return _r0.previous(); });
24137
+ const _r9 = i0.ɵɵgetCurrentView();
24138
+ i0.ɵɵelementStart(0, "a", 13);
24139
+ i0.ɵɵlistener("keyup.enter", function PaginationComponent_ul_3_li_1_a_1_Template_a_keyup_enter_0_listener() { i0.ɵɵrestoreView(_r9); i0.ɵɵnextContext(3); const _r0 = i0.ɵɵreference(1); return _r0.previous(); })("click", function PaginationComponent_ul_3_li_1_a_1_Template_a_click_0_listener() { i0.ɵɵrestoreView(_r9); i0.ɵɵnextContext(3); const _r0 = i0.ɵɵreference(1); return _r0.previous(); });
24147
24140
  i0.ɵɵtext(1);
24148
- i0.ɵɵelementStart(2, "span", 13);
24141
+ i0.ɵɵelementStart(2, "span", 14);
24149
24142
  i0.ɵɵtext(3);
24150
24143
  i0.ɵɵelementEnd();
24151
24144
  i0.ɵɵelementEnd();
24152
24145
  } if (rf & 2) {
24153
- const ctx_r5 = i0.ɵɵnextContext(3);
24154
- i0.ɵɵattribute("aria-label", ctx_r5.previousLabel + " " + ctx_r5.screenReaderPageLabel);
24146
+ const ctx_r6 = i0.ɵɵnextContext(3);
24147
+ i0.ɵɵattribute("aria-label", ctx_r6.previousLabel + " " + ctx_r6.screenReaderPageLabel);
24155
24148
  i0.ɵɵadvance(1);
24156
- i0.ɵɵtextInterpolate1(" ", ctx_r5.previousLabel, " ");
24149
+ i0.ɵɵtextInterpolate1(" ", ctx_r6.previousLabel, " ");
24157
24150
  i0.ɵɵadvance(2);
24158
- i0.ɵɵtextInterpolate(ctx_r5.screenReaderPageLabel);
24151
+ i0.ɵɵtextInterpolate(ctx_r6.screenReaderPageLabel);
24159
24152
  } }
24160
24153
  function PaginationComponent_ul_3_li_1_span_2_Template(rf, ctx) { if (rf & 1) {
24161
24154
  i0.ɵɵelementStart(0, "span");
24162
24155
  i0.ɵɵtext(1);
24163
- i0.ɵɵelementStart(2, "span", 13);
24156
+ i0.ɵɵelementStart(2, "span", 14);
24164
24157
  i0.ɵɵtext(3);
24165
24158
  i0.ɵɵelementEnd();
24166
24159
  i0.ɵɵelementEnd();
24167
24160
  } if (rf & 2) {
24168
- const ctx_r6 = i0.ɵɵnextContext(3);
24161
+ const ctx_r7 = i0.ɵɵnextContext(3);
24169
24162
  i0.ɵɵadvance(1);
24170
- i0.ɵɵtextInterpolate1(" ", ctx_r6.previousLabel, " ");
24163
+ i0.ɵɵtextInterpolate1(" ", ctx_r7.previousLabel, " ");
24171
24164
  i0.ɵɵadvance(2);
24172
- i0.ɵɵtextInterpolate(ctx_r6.screenReaderPageLabel);
24165
+ i0.ɵɵtextInterpolate(ctx_r7.screenReaderPageLabel);
24173
24166
  } }
24174
24167
  function PaginationComponent_ul_3_li_1_Template(rf, ctx) { if (rf & 1) {
24175
- i0.ɵɵelementStart(0, "li", 9);
24176
- i0.ɵɵtemplate(1, PaginationComponent_ul_3_li_1_a_1_Template, 4, 3, "a", 10);
24177
- i0.ɵɵtemplate(2, PaginationComponent_ul_3_li_1_span_2_Template, 4, 2, "span", 11);
24168
+ i0.ɵɵelementStart(0, "li", 10);
24169
+ i0.ɵɵtemplate(1, PaginationComponent_ul_3_li_1_a_1_Template, 4, 3, "a", 11);
24170
+ i0.ɵɵtemplate(2, PaginationComponent_ul_3_li_1_span_2_Template, 4, 2, "span", 12);
24178
24171
  i0.ɵɵelementEnd();
24179
24172
  } if (rf & 2) {
24180
24173
  i0.ɵɵnextContext(2);
@@ -24186,10 +24179,10 @@ function PaginationComponent_ul_3_li_1_Template(rf, ctx) { if (rf & 1) {
24186
24179
  i0.ɵɵproperty("ngIf", _r0.isFirstPage());
24187
24180
  } }
24188
24181
  function PaginationComponent_ul_3_li_4_a_1_Template(rf, ctx) { if (rf & 1) {
24189
- const _r15 = i0.ɵɵgetCurrentView();
24190
- i0.ɵɵelementStart(0, "a", 12);
24191
- i0.ɵɵlistener("keyup.enter", function PaginationComponent_ul_3_li_4_a_1_Template_a_keyup_enter_0_listener() { i0.ɵɵrestoreView(_r15); const page_r10 = i0.ɵɵnextContext().$implicit; i0.ɵɵnextContext(2); const _r0 = i0.ɵɵreference(1); return _r0.setCurrent(page_r10.value); })("click", function PaginationComponent_ul_3_li_4_a_1_Template_a_click_0_listener() { i0.ɵɵrestoreView(_r15); const page_r10 = i0.ɵɵnextContext().$implicit; i0.ɵɵnextContext(2); const _r0 = i0.ɵɵreference(1); return _r0.setCurrent(page_r10.value); });
24192
- i0.ɵɵelementStart(1, "span", 13);
24182
+ const _r16 = i0.ɵɵgetCurrentView();
24183
+ i0.ɵɵelementStart(0, "a", 13);
24184
+ i0.ɵɵlistener("keyup.enter", function PaginationComponent_ul_3_li_4_a_1_Template_a_keyup_enter_0_listener() { i0.ɵɵrestoreView(_r16); const page_r11 = i0.ɵɵnextContext().$implicit; i0.ɵɵnextContext(2); const _r0 = i0.ɵɵreference(1); return _r0.setCurrent(page_r11.value); })("click", function PaginationComponent_ul_3_li_4_a_1_Template_a_click_0_listener() { i0.ɵɵrestoreView(_r16); const page_r11 = i0.ɵɵnextContext().$implicit; i0.ɵɵnextContext(2); const _r0 = i0.ɵɵreference(1); return _r0.setCurrent(page_r11.value); });
24185
+ i0.ɵɵelementStart(1, "span", 14);
24193
24186
  i0.ɵɵtext(2);
24194
24187
  i0.ɵɵelementEnd();
24195
24188
  i0.ɵɵelementStart(3, "span");
@@ -24198,16 +24191,16 @@ function PaginationComponent_ul_3_li_4_a_1_Template(rf, ctx) { if (rf & 1) {
24198
24191
  i0.ɵɵelementEnd();
24199
24192
  i0.ɵɵelementEnd();
24200
24193
  } if (rf & 2) {
24201
- const page_r10 = i0.ɵɵnextContext().$implicit;
24202
- const ctx_r11 = i0.ɵɵnextContext(2);
24194
+ const page_r11 = i0.ɵɵnextContext().$implicit;
24195
+ const ctx_r12 = i0.ɵɵnextContext(2);
24203
24196
  i0.ɵɵadvance(2);
24204
- i0.ɵɵtextInterpolate1("", ctx_r11.screenReaderPageLabel, " ");
24197
+ i0.ɵɵtextInterpolate1("", ctx_r12.screenReaderPageLabel, " ");
24205
24198
  i0.ɵɵadvance(2);
24206
- i0.ɵɵtextInterpolate(page_r10.label === "..." ? page_r10.label : i0.ɵɵpipeBind2(5, 2, page_r10.label, ""));
24199
+ i0.ɵɵtextInterpolate(page_r11.label === "..." ? page_r11.label : i0.ɵɵpipeBind2(5, 2, page_r11.label, ""));
24207
24200
  } }
24208
24201
  function PaginationComponent_ul_3_li_4_ng_container_2_Template(rf, ctx) { if (rf & 1) {
24209
24202
  i0.ɵɵelementContainerStart(0);
24210
- i0.ɵɵelementStart(1, "span", 13);
24203
+ i0.ɵɵelementStart(1, "span", 14);
24211
24204
  i0.ɵɵtext(2);
24212
24205
  i0.ɵɵelementEnd();
24213
24206
  i0.ɵɵelementStart(3, "span");
@@ -24216,63 +24209,63 @@ function PaginationComponent_ul_3_li_4_ng_container_2_Template(rf, ctx) { if (rf
24216
24209
  i0.ɵɵelementEnd();
24217
24210
  i0.ɵɵelementContainerEnd();
24218
24211
  } if (rf & 2) {
24219
- const page_r10 = i0.ɵɵnextContext().$implicit;
24220
- const ctx_r12 = i0.ɵɵnextContext(2);
24212
+ const page_r11 = i0.ɵɵnextContext().$implicit;
24213
+ const ctx_r13 = i0.ɵɵnextContext(2);
24221
24214
  i0.ɵɵadvance(2);
24222
- i0.ɵɵtextInterpolate1("", ctx_r12.screenReaderCurrentLabel, " ");
24215
+ i0.ɵɵtextInterpolate1("", ctx_r13.screenReaderCurrentLabel, " ");
24223
24216
  i0.ɵɵadvance(2);
24224
- i0.ɵɵtextInterpolate(page_r10.label === "..." ? page_r10.label : i0.ɵɵpipeBind2(5, 2, page_r10.label, ""));
24217
+ i0.ɵɵtextInterpolate(page_r11.label === "..." ? page_r11.label : i0.ɵɵpipeBind2(5, 2, page_r11.label, ""));
24225
24218
  } }
24226
24219
  function PaginationComponent_ul_3_li_4_Template(rf, ctx) { if (rf & 1) {
24227
24220
  i0.ɵɵelementStart(0, "li");
24228
- i0.ɵɵtemplate(1, PaginationComponent_ul_3_li_4_a_1_Template, 6, 5, "a", 10);
24229
- i0.ɵɵtemplate(2, PaginationComponent_ul_3_li_4_ng_container_2_Template, 6, 5, "ng-container", 11);
24221
+ i0.ɵɵtemplate(1, PaginationComponent_ul_3_li_4_a_1_Template, 6, 5, "a", 11);
24222
+ i0.ɵɵtemplate(2, PaginationComponent_ul_3_li_4_ng_container_2_Template, 6, 5, "ng-container", 12);
24230
24223
  i0.ɵɵelementEnd();
24231
24224
  } if (rf & 2) {
24232
- const page_r10 = ctx.$implicit;
24225
+ const page_r11 = ctx.$implicit;
24233
24226
  i0.ɵɵnextContext(2);
24234
24227
  const _r0 = i0.ɵɵreference(1);
24235
- i0.ɵɵclassProp("current", _r0.getCurrent() === page_r10.value)("ellipsis", page_r10.label === "...");
24228
+ i0.ɵɵclassProp("current", _r0.getCurrent() === page_r11.value)("ellipsis", page_r11.label === "...");
24236
24229
  i0.ɵɵadvance(1);
24237
- i0.ɵɵproperty("ngIf", _r0.getCurrent() !== page_r10.value);
24230
+ i0.ɵɵproperty("ngIf", _r0.getCurrent() !== page_r11.value);
24238
24231
  i0.ɵɵadvance(1);
24239
- i0.ɵɵproperty("ngIf", _r0.getCurrent() === page_r10.value);
24232
+ i0.ɵɵproperty("ngIf", _r0.getCurrent() === page_r11.value);
24240
24233
  } }
24241
24234
  function PaginationComponent_ul_3_li_5_a_1_Template(rf, ctx) { if (rf & 1) {
24242
- const _r23 = i0.ɵɵgetCurrentView();
24243
- i0.ɵɵelementStart(0, "a", 12);
24244
- i0.ɵɵlistener("keyup.enter", function PaginationComponent_ul_3_li_5_a_1_Template_a_keyup_enter_0_listener() { i0.ɵɵrestoreView(_r23); i0.ɵɵnextContext(3); const _r0 = i0.ɵɵreference(1); return _r0.next(); })("click", function PaginationComponent_ul_3_li_5_a_1_Template_a_click_0_listener() { i0.ɵɵrestoreView(_r23); i0.ɵɵnextContext(3); const _r0 = i0.ɵɵreference(1); return _r0.next(); });
24235
+ const _r24 = i0.ɵɵgetCurrentView();
24236
+ i0.ɵɵelementStart(0, "a", 13);
24237
+ i0.ɵɵlistener("keyup.enter", function PaginationComponent_ul_3_li_5_a_1_Template_a_keyup_enter_0_listener() { i0.ɵɵrestoreView(_r24); i0.ɵɵnextContext(3); const _r0 = i0.ɵɵreference(1); return _r0.next(); })("click", function PaginationComponent_ul_3_li_5_a_1_Template_a_click_0_listener() { i0.ɵɵrestoreView(_r24); i0.ɵɵnextContext(3); const _r0 = i0.ɵɵreference(1); return _r0.next(); });
24245
24238
  i0.ɵɵtext(1);
24246
- i0.ɵɵelementStart(2, "span", 13);
24239
+ i0.ɵɵelementStart(2, "span", 14);
24247
24240
  i0.ɵɵtext(3);
24248
24241
  i0.ɵɵelementEnd();
24249
24242
  i0.ɵɵelementEnd();
24250
24243
  } if (rf & 2) {
24251
- const ctx_r20 = i0.ɵɵnextContext(3);
24252
- i0.ɵɵattribute("aria-label", ctx_r20.nextLabel + " " + ctx_r20.screenReaderPageLabel);
24244
+ const ctx_r21 = i0.ɵɵnextContext(3);
24245
+ i0.ɵɵattribute("aria-label", ctx_r21.nextLabel + " " + ctx_r21.screenReaderPageLabel);
24253
24246
  i0.ɵɵadvance(1);
24254
- i0.ɵɵtextInterpolate1(" ", ctx_r20.nextLabel, " ");
24247
+ i0.ɵɵtextInterpolate1(" ", ctx_r21.nextLabel, " ");
24255
24248
  i0.ɵɵadvance(2);
24256
- i0.ɵɵtextInterpolate(ctx_r20.screenReaderPageLabel);
24249
+ i0.ɵɵtextInterpolate(ctx_r21.screenReaderPageLabel);
24257
24250
  } }
24258
24251
  function PaginationComponent_ul_3_li_5_span_2_Template(rf, ctx) { if (rf & 1) {
24259
24252
  i0.ɵɵelementStart(0, "span");
24260
24253
  i0.ɵɵtext(1);
24261
- i0.ɵɵelementStart(2, "span", 13);
24254
+ i0.ɵɵelementStart(2, "span", 14);
24262
24255
  i0.ɵɵtext(3);
24263
24256
  i0.ɵɵelementEnd();
24264
24257
  i0.ɵɵelementEnd();
24265
24258
  } if (rf & 2) {
24266
- const ctx_r21 = i0.ɵɵnextContext(3);
24259
+ const ctx_r22 = i0.ɵɵnextContext(3);
24267
24260
  i0.ɵɵadvance(1);
24268
- i0.ɵɵtextInterpolate1(" ", ctx_r21.nextLabel, " ");
24261
+ i0.ɵɵtextInterpolate1(" ", ctx_r22.nextLabel, " ");
24269
24262
  i0.ɵɵadvance(2);
24270
- i0.ɵɵtextInterpolate(ctx_r21.screenReaderPageLabel);
24263
+ i0.ɵɵtextInterpolate(ctx_r22.screenReaderPageLabel);
24271
24264
  } }
24272
24265
  function PaginationComponent_ul_3_li_5_Template(rf, ctx) { if (rf & 1) {
24273
- i0.ɵɵelementStart(0, "li", 14);
24274
- i0.ɵɵtemplate(1, PaginationComponent_ul_3_li_5_a_1_Template, 4, 3, "a", 10);
24275
- i0.ɵɵtemplate(2, PaginationComponent_ul_3_li_5_span_2_Template, 4, 2, "span", 11);
24266
+ i0.ɵɵelementStart(0, "li", 15);
24267
+ i0.ɵɵtemplate(1, PaginationComponent_ul_3_li_5_a_1_Template, 4, 3, "a", 11);
24268
+ i0.ɵɵtemplate(2, PaginationComponent_ul_3_li_5_span_2_Template, 4, 2, "span", 12);
24276
24269
  i0.ɵɵelementEnd();
24277
24270
  } if (rf & 2) {
24278
24271
  i0.ɵɵnextContext(2);
@@ -24284,13 +24277,13 @@ function PaginationComponent_ul_3_li_5_Template(rf, ctx) { if (rf & 1) {
24284
24277
  i0.ɵɵproperty("ngIf", _r0.isLastPage());
24285
24278
  } }
24286
24279
  function PaginationComponent_ul_3_Template(rf, ctx) { if (rf & 1) {
24287
- i0.ɵɵelementStart(0, "ul", 4);
24288
- i0.ɵɵtemplate(1, PaginationComponent_ul_3_li_1_Template, 3, 4, "li", 5);
24289
- i0.ɵɵelementStart(2, "li", 6);
24280
+ i0.ɵɵelementStart(0, "ul", 5);
24281
+ i0.ɵɵtemplate(1, PaginationComponent_ul_3_li_1_Template, 3, 4, "li", 6);
24282
+ i0.ɵɵelementStart(2, "li", 7);
24290
24283
  i0.ɵɵtext(3);
24291
24284
  i0.ɵɵelementEnd();
24292
- i0.ɵɵtemplate(4, PaginationComponent_ul_3_li_4_Template, 3, 6, "li", 7);
24293
- i0.ɵɵtemplate(5, PaginationComponent_ul_3_li_5_Template, 3, 4, "li", 8);
24285
+ i0.ɵɵtemplate(4, PaginationComponent_ul_3_li_4_Template, 3, 6, "li", 8);
24286
+ i0.ɵɵtemplate(5, PaginationComponent_ul_3_li_5_Template, 3, 4, "li", 9);
24294
24287
  i0.ɵɵelementEnd();
24295
24288
  } if (rf & 2) {
24296
24289
  const ctx_r1 = i0.ɵɵnextContext();
@@ -24306,6 +24299,17 @@ function PaginationComponent_ul_3_Template(rf, ctx) { if (rf & 1) {
24306
24299
  i0.ɵɵadvance(1);
24307
24300
  i0.ɵɵproperty("ngIf", ctx_r1.directionLinks);
24308
24301
  } }
24302
+ function PaginationComponent_div_4_Template(rf, ctx) { if (rf & 1) {
24303
+ const _r28 = i0.ɵɵgetCurrentView();
24304
+ i0.ɵɵelementStart(0, "div", 16);
24305
+ i0.ɵɵelementStart(1, "span");
24306
+ i0.ɵɵtext(2, "Go to page");
24307
+ i0.ɵɵelementEnd();
24308
+ i0.ɵɵelementStart(3, "input", 17, 18);
24309
+ i0.ɵɵlistener("keyup.enter", function PaginationComponent_div_4_Template_input_keyup_enter_3_listener($event) { i0.ɵɵrestoreView(_r28); const ctx_r27 = i0.ɵɵnextContext(); const _r0 = i0.ɵɵreference(1); ctx_r27.goToPage($event, _r0); return $event.target.blur(); })("blur", function PaginationComponent_div_4_Template_input_blur_3_listener($event) { i0.ɵɵrestoreView(_r28); const ctx_r29 = i0.ɵɵnextContext(); const _r0 = i0.ɵɵreference(1); return ctx_r29.goToPage($event, _r0); })("focus", function PaginationComponent_div_4_Template_input_focus_3_listener() { i0.ɵɵrestoreView(_r28); const _r26 = i0.ɵɵreference(4); return _r26.select(); });
24310
+ i0.ɵɵelementEnd();
24311
+ i0.ɵɵelementEnd();
24312
+ } }
24309
24313
  function coerceToBoolean(input) {
24310
24314
  return !!input && input !== 'false';
24311
24315
  }
@@ -24341,21 +24345,41 @@ class PaginationComponent {
24341
24345
  set responsive(value) {
24342
24346
  this.pResponsive = coerceToBoolean(value);
24343
24347
  }
24348
+ goToPage($event, p) {
24349
+ const pageNumber = Number($event.target.value);
24350
+ if ($event.target.value !== '' && pageNumber !== p.getCurrent()) {
24351
+ if (pageNumber > 0) {
24352
+ p.setCurrent(pageNumber);
24353
+ }
24354
+ else if (pageNumber < 0) {
24355
+ $event.target.value = (Math.abs(pageNumber)).toString();
24356
+ if (Math.abs(pageNumber) !== p.getCurrent()) {
24357
+ p.setCurrent(Math.abs(pageNumber));
24358
+ }
24359
+ }
24360
+ else {
24361
+ $event.target.value = '';
24362
+ }
24363
+ }
24364
+ }
24344
24365
  }
24345
24366
  PaginationComponent.ɵfac = function PaginationComponent_Factory(t) { return new (t || PaginationComponent)(); };
24346
- PaginationComponent.ɵcmp = i0.ɵɵdefineComponent({ type: PaginationComponent, selectors: [["ccd-pagination"]], inputs: { visibilityLabel: "visibilityLabel", id: "id", maxSize: "maxSize", previousLabel: "previousLabel", nextLabel: "nextLabel", screenReaderPaginationLabel: "screenReaderPaginationLabel", screenReaderPageLabel: "screenReaderPageLabel", screenReaderCurrentLabel: "screenReaderCurrentLabel", directionLinks: "directionLinks", autoHide: "autoHide", responsive: "responsive" }, outputs: { pageChange: "pageChange", pageBoundsCorrection: "pageBoundsCorrection" }, decls: 4, vars: 3, consts: [[3, "id", "maxSize", "pageChange", "pageBoundsCorrection"], ["p", "paginationApi"], ["role", "navigation", "aria-label", "Pagination"], ["class", "ngx-pagination", "role", "navigation", 3, "responsive", 4, "ngIf"], ["role", "navigation", 1, "ngx-pagination"], ["class", "pagination-previous", 3, "disabled", 4, "ngIf"], [1, "small-screen"], [3, "current", "ellipsis", 4, "ngFor", "ngForOf"], ["class", "pagination-next", 3, "disabled", 4, "ngIf"], [1, "pagination-previous"], ["tabindex", "0", 3, "keyup.enter", "click", 4, "ngIf"], [4, "ngIf"], ["tabindex", "0", 3, "keyup.enter", "click"], [1, "show-for-sr"], [1, "pagination-next"]], template: function PaginationComponent_Template(rf, ctx) { if (rf & 1) {
24367
+ PaginationComponent.ɵcmp = i0.ɵɵdefineComponent({ type: PaginationComponent, selectors: [["ccd-pagination"]], inputs: { visibilityLabel: "visibilityLabel", id: "id", maxSize: "maxSize", previousLabel: "previousLabel", nextLabel: "nextLabel", screenReaderPaginationLabel: "screenReaderPaginationLabel", screenReaderPageLabel: "screenReaderPageLabel", screenReaderCurrentLabel: "screenReaderCurrentLabel", directionLinks: "directionLinks", autoHide: "autoHide", responsive: "responsive" }, outputs: { pageChange: "pageChange", pageBoundsCorrection: "pageBoundsCorrection" }, decls: 5, vars: 4, consts: [[3, "id", "maxSize", "pageChange", "pageBoundsCorrection"], ["p", "paginationApi"], ["role", "navigation", "aria-label", "Pagination", 1, "ngx-pagination-wrapper"], ["class", "ngx-pagination", "role", "navigation", 3, "responsive", 4, "ngIf"], ["class", "ngx-go-to-page", 4, "ngIf"], ["role", "navigation", 1, "ngx-pagination"], ["class", "pagination-previous", 3, "disabled", 4, "ngIf"], [1, "small-screen"], [3, "current", "ellipsis", 4, "ngFor", "ngForOf"], ["class", "pagination-next", 3, "disabled", 4, "ngIf"], [1, "pagination-previous"], ["tabindex", "0", 3, "keyup.enter", "click", 4, "ngIf"], [4, "ngIf"], ["tabindex", "0", 3, "keyup.enter", "click"], [1, "show-for-sr"], [1, "pagination-next"], [1, "ngx-go-to-page"], ["type", "number", "maxlength", "5", "min", "1", 1, "govuk-input", 3, "keyup.enter", "blur", "focus"], ["goToPageInput", ""]], template: function PaginationComponent_Template(rf, ctx) { if (rf & 1) {
24347
24368
  i0.ɵɵelementStart(0, "pagination-template", 0, 1);
24348
24369
  i0.ɵɵlistener("pageChange", function PaginationComponent_Template_pagination_template_pageChange_0_listener($event) { return ctx.pageChange.emit($event); })("pageBoundsCorrection", function PaginationComponent_Template_pagination_template_pageBoundsCorrection_0_listener($event) { return ctx.pageBoundsCorrection.emit($event); });
24349
24370
  i0.ɵɵelementStart(2, "nav", 2);
24350
24371
  i0.ɵɵtemplate(3, PaginationComponent_ul_3_Template, 6, 8, "ul", 3);
24351
24372
  i0.ɵɵelementEnd();
24373
+ i0.ɵɵtemplate(4, PaginationComponent_div_4_Template, 5, 0, "div", 4);
24352
24374
  i0.ɵɵelementEnd();
24353
24375
  } if (rf & 2) {
24354
24376
  const _r0 = i0.ɵɵreference(1);
24355
24377
  i0.ɵɵproperty("id", ctx.id)("maxSize", ctx.maxSize);
24356
24378
  i0.ɵɵadvance(3);
24357
24379
  i0.ɵɵproperty("ngIf", !(ctx.autoHide && _r0.pages.length <= 1));
24358
- } }, directives: [i1$6.PaginationControlsDirective, i1.NgIf, i1.NgForOf], pipes: [i1.DecimalPipe], styles: [".ngx-pagination[_ngcontent-%COMP%]{margin-left:0;margin-bottom:1rem;padding-top:25px;text-decoration:none;text-align:left;font-size:16px}.ngx-pagination[_ngcontent-%COMP%]:after, .ngx-pagination[_ngcontent-%COMP%]:before{content:\" \";display:table}.ngx-pagination[_ngcontent-%COMP%]:after{clear:both}.ngx-pagination[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;margin-right:.0625rem;border-radius:0;display:inline-block}.ngx-pagination[_ngcontent-%COMP%] a[_ngcontent-%COMP%], .ngx-pagination[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{display:block;padding:.1875rem .625rem;border-radius:0;color:#005da6}.ngx-pagination[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover, .ngx-pagination[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover{background:#e6e6e6}.ngx-pagination[_ngcontent-%COMP%] .current[_ngcontent-%COMP%]{padding:.1875rem .625rem;background:#fff;color:#4c2c92;cursor:default;font-weight:900}.ngx-pagination[_ngcontent-%COMP%] .disabled[_ngcontent-%COMP%]{display:none}.ngx-pagination[_ngcontent-%COMP%] .disabled[_ngcontent-%COMP%]:hover{background:transparent}.ngx-pagination[_ngcontent-%COMP%] a[_ngcontent-%COMP%], .ngx-pagination[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{cursor:pointer}.ngx-pagination[_ngcontent-%COMP%] .pagination-previous.disabled[_ngcontent-%COMP%]:before, .ngx-pagination[_ngcontent-%COMP%] .pagination-previous[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:before{margin-right:.5rem;border-width:3px 0 0 3px}.ngx-pagination[_ngcontent-%COMP%] .pagination-next.disabled[_ngcontent-%COMP%]:after, .ngx-pagination[_ngcontent-%COMP%] .pagination-next[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:after, .ngx-pagination[_ngcontent-%COMP%] .pagination-previous.disabled[_ngcontent-%COMP%]:before, .ngx-pagination[_ngcontent-%COMP%] .pagination-previous[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:before{display:inline-block;height:10px;width:10px;border-style:solid;color:#0a0a0a;background:transparent;transform:rotate(-45deg);content:\"\"}.ngx-pagination[_ngcontent-%COMP%] .pagination-next.disabled[_ngcontent-%COMP%]:after, .ngx-pagination[_ngcontent-%COMP%] .pagination-next[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:after{margin-left:.5rem;border-width:0 3px 3px 0}.ngx-pagination[_ngcontent-%COMP%] .show-for-sr[_ngcontent-%COMP%]{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}.ngx-pagination[_ngcontent-%COMP%] .small-screen[_ngcontent-%COMP%]{display:none}@media screen and (max-width:601px){.ngx-pagination.responsive[_ngcontent-%COMP%] .small-screen[_ngcontent-%COMP%]{display:inline-block}.ngx-pagination.responsive[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:not(.small-screen):not(.pagination-previous):not(.pagination-next){display:none}}"] });
24380
+ i0.ɵɵadvance(1);
24381
+ i0.ɵɵproperty("ngIf", !(ctx.autoHide && _r0.pages.length <= 1));
24382
+ } }, directives: [i1$6.PaginationControlsDirective, i1.NgIf, i1.NgForOf], pipes: [i1.DecimalPipe], styles: [".ngx-go-to-page[_ngcontent-%COMP%], .ngx-pagination-wrapper[_ngcontent-%COMP%]{display:inline-block}.ngx-go-to-page[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{margin:0 10px 0 50px}.ngx-go-to-page[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{width:50px}.ngx-pagination[_ngcontent-%COMP%]{margin-left:0;margin-bottom:1rem;padding-top:25px;text-decoration:none;text-align:left;font-size:16px}.ngx-pagination[_ngcontent-%COMP%]:after, .ngx-pagination[_ngcontent-%COMP%]:before{content:\" \";display:table}.ngx-pagination[_ngcontent-%COMP%]:after{clear:both}.ngx-pagination[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;margin-right:.0625rem;border-radius:0;display:inline-block}.ngx-pagination[_ngcontent-%COMP%] a[_ngcontent-%COMP%], .ngx-pagination[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{display:block;padding:.1875rem .625rem;border-radius:0;color:#005da6}.ngx-pagination[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover, .ngx-pagination[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover{background:#e6e6e6}.ngx-pagination[_ngcontent-%COMP%] .current[_ngcontent-%COMP%]{padding:.1875rem .625rem;background:#fff;color:#4c2c92;cursor:default;font-weight:900}.ngx-pagination[_ngcontent-%COMP%] .disabled[_ngcontent-%COMP%]{display:none}.ngx-pagination[_ngcontent-%COMP%] .disabled[_ngcontent-%COMP%]:hover{background:transparent}.ngx-pagination[_ngcontent-%COMP%] a[_ngcontent-%COMP%], .ngx-pagination[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{cursor:pointer}.ngx-pagination[_ngcontent-%COMP%] .pagination-previous.disabled[_ngcontent-%COMP%]:before, .ngx-pagination[_ngcontent-%COMP%] .pagination-previous[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:before{margin-right:.5rem;border-width:3px 0 0 3px}.ngx-pagination[_ngcontent-%COMP%] .pagination-next.disabled[_ngcontent-%COMP%]:after, .ngx-pagination[_ngcontent-%COMP%] .pagination-next[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:after, .ngx-pagination[_ngcontent-%COMP%] .pagination-previous.disabled[_ngcontent-%COMP%]:before, .ngx-pagination[_ngcontent-%COMP%] .pagination-previous[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:before{display:inline-block;height:10px;width:10px;border-style:solid;color:#0a0a0a;background:transparent;transform:rotate(-45deg);content:\"\"}.ngx-pagination[_ngcontent-%COMP%] .pagination-next.disabled[_ngcontent-%COMP%]:after, .ngx-pagination[_ngcontent-%COMP%] .pagination-next[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:after{margin-left:.5rem;border-width:0 3px 3px 0}.ngx-pagination[_ngcontent-%COMP%] .show-for-sr[_ngcontent-%COMP%]{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}.ngx-pagination[_ngcontent-%COMP%] .small-screen[_ngcontent-%COMP%]{display:none}@media screen and (max-width:601px){.ngx-pagination.responsive[_ngcontent-%COMP%] .small-screen[_ngcontent-%COMP%]{display:inline-block}.ngx-pagination.responsive[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:not(.small-screen):not(.pagination-previous):not(.pagination-next){display:none}}"] });
24359
24383
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PaginationComponent, [{
24360
24384
  type: Component,
24361
24385
  args: [{