@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
@@ -4136,6 +4136,13 @@
4136
4136
  }
4137
4137
  return caseField.field_type.type === 'ComponentLauncher';
4138
4138
  };
4139
+ FieldsUtils.isLinkedCasesCaseField = function (caseField) {
4140
+ return FieldsUtils.isComponentLauncherCaseField(caseField) &&
4141
+ caseField.id === 'LinkedCasesComponentLauncher';
4142
+ };
4143
+ FieldsUtils.containsLinkedCasesCaseField = function (caseFields) {
4144
+ return caseFields === null || caseFields === void 0 ? void 0 : caseFields.some(function (caseField) { return FieldsUtils.isLinkedCasesCaseField(caseField); });
4145
+ };
4139
4146
  FieldsUtils.isFlagsFieldType = function (fieldType) {
4140
4147
  if (!fieldType) {
4141
4148
  return false;
@@ -9992,14 +9999,14 @@
9992
9999
  this.title$ = new rxjs.BehaviorSubject(null);
9993
10000
  this.formValidationErrors$ = new rxjs.BehaviorSubject([]);
9994
10001
  this.editForm$ = new rxjs.BehaviorSubject(null);
9995
- this.linkError$ = new rxjs.BehaviorSubject(null);
10002
+ this.isLinkedCasesJourneyAtFinalStep$ = new rxjs.BehaviorSubject(null);
9996
10003
  this.eventTriggerName$ = new rxjs.BehaviorSubject(null);
9997
10004
  this.triggerSubmitEvent$ = new rxjs.BehaviorSubject(null);
9998
10005
  this.caseDetails$ = this.details$.asObservable();
9999
10006
  this.caseTitle$ = this.title$.asObservable();
10000
10007
  this.caseEditForm$ = this.editForm$.asObservable();
10001
10008
  this.caseFormValidationErrors$ = this.formValidationErrors$.asObservable();
10002
- this.caseLinkError$ = this.linkError$.asObservable();
10009
+ this.caseIsLinkedCasesJourneyAtFinalStep$ = this.isLinkedCasesJourneyAtFinalStep$.asObservable();
10003
10010
  this.caseEventTriggerName$ = this.eventTriggerName$.asObservable();
10004
10011
  this.caseTriggerSubmitEvent$ = this.triggerSubmitEvent$.asObservable();
10005
10012
  }
@@ -10012,9 +10019,6 @@
10012
10019
  CaseEditDataService.prototype.setCaseEventTriggerName = function (triggerName) {
10013
10020
  this.eventTriggerName$.next(triggerName);
10014
10021
  };
10015
- CaseEditDataService.prototype.setCaseLinkError = function (error) {
10016
- this.linkError$.next(error);
10017
- };
10018
10022
  CaseEditDataService.prototype.setFormValidationErrors = function (validationErrors) {
10019
10023
  this.formValidationErrors$.next(validationErrors);
10020
10024
  };
@@ -10024,8 +10028,8 @@
10024
10028
  CaseEditDataService.prototype.clearFormValidationErrors = function () {
10025
10029
  this.formValidationErrors$.next([]);
10026
10030
  };
10027
- CaseEditDataService.prototype.clearCaseLinkError = function () {
10028
- this.linkError$.next(null);
10031
+ CaseEditDataService.prototype.setLinkedCasesJourneyAtFinalStep = function (isAtFinalStep) {
10032
+ this.isLinkedCasesJourneyAtFinalStep$.next(isAtFinalStep);
10029
10033
  };
10030
10034
  CaseEditDataService.prototype.addFormValidationError = function (validationError) {
10031
10035
  this.formValidationErrors$.next(this.formValidationErrors$.getValue().concat([validationError]));
@@ -10382,6 +10386,9 @@
10382
10386
  this.caseEditDataService.caseEditForm$.subscribe({
10383
10387
  next: function (editForm) { return _this.editForm = editForm; }
10384
10388
  });
10389
+ this.caseEditDataService.caseIsLinkedCasesJourneyAtFinalStep$.subscribe({
10390
+ next: function (isLinkedCasesJourneyAtFinalStep) { return _this.isLinkedCasesJourneyAtFinalStep = isLinkedCasesJourneyAtFinalStep; }
10391
+ });
10385
10392
  this.caseEditDataService.caseTriggerSubmitEvent$.subscribe({
10386
10393
  next: function (state) {
10387
10394
  if (state) {
@@ -10401,7 +10408,11 @@
10401
10408
  return this.caseEdit.first();
10402
10409
  };
10403
10410
  CaseEditPageComponent.prototype.currentPageIsNotValid = function () {
10404
- return !this.pageValidationService.isPageValid(this.currentPage, this.editForm);
10411
+ return !this.pageValidationService.isPageValid(this.currentPage, this.editForm) ||
10412
+ (this.isLinkedCasesJourney() && !this.isLinkedCasesJourneyAtFinalStep);
10413
+ };
10414
+ CaseEditPageComponent.prototype.isLinkedCasesJourney = function () {
10415
+ return FieldsUtils.containsLinkedCasesCaseField(this.currentPage.case_fields);
10405
10416
  };
10406
10417
  /**
10407
10418
  * caseEventData.event_data contains all the values from the previous pages so we set caseEventData.data = caseEventData.event_data
@@ -10501,7 +10512,16 @@
10501
10512
  var _this = this;
10502
10513
  this.caseEditDataService.clearFormValidationErrors();
10503
10514
  if (this.currentPageIsNotValid()) {
10504
- this.generateErrorMessage(this.currentPage.case_fields);
10515
+ // The generateErrorMessage method filters out the hidden fields.
10516
+ // The error message for LinkedCases journey will never get displayed because the
10517
+ // LinkedCases is configured with ComponentLauncher field as visible and caseLinks field as hidden.
10518
+ if (this.isLinkedCasesJourney()) {
10519
+ this.validationErrors.push({ id: 'next-button', message: 'Please select Next to go to the next page' });
10520
+ CaseEditPageComponent.scrollToTop();
10521
+ }
10522
+ else {
10523
+ this.generateErrorMessage(this.currentPage.case_fields);
10524
+ }
10505
10525
  }
10506
10526
  if (!this.isSubmitting && !this.currentPageIsNotValid()) {
10507
10527
  this.isSubmitting = true;
@@ -10616,7 +10636,6 @@
10616
10636
  else {
10617
10637
  this.caseEdit.cancelled.emit();
10618
10638
  }
10619
- this.caseEditDataService.clearFormValidationErrors();
10620
10639
  };
10621
10640
  CaseEditPageComponent.prototype.submitting = function () {
10622
10641
  return this.isSubmitting;
@@ -17123,6 +17142,7 @@
17123
17142
  searchCases.forEach(function (response) {
17124
17143
  casesResponse.push(_this.mapResponse(response));
17125
17144
  });
17145
+ casesResponse = _this.sortReasonCodes(casesResponse);
17126
17146
  _this.linkedCasesFromResponse = _this.sortLinkedCasesByReasonCode(casesResponse);
17127
17147
  _this.isLoaded = true;
17128
17148
  var caseLinks = _this.linkedCasesFromResponse.map(function (item) {
@@ -17148,6 +17168,30 @@
17148
17168
  });
17149
17169
  }
17150
17170
  };
17171
+ LinkedCasesToTableComponent.prototype.sortReasonCodes = function (searchCasesResponse) {
17172
+ var _this = this;
17173
+ searchCasesResponse.forEach(function (item) {
17174
+ var _a;
17175
+ if ((_a = item === null || item === void 0 ? void 0 : item.reasons) === null || _a === void 0 ? void 0 : _a.length) {
17176
+ item.reasons.forEach(function (reason) {
17177
+ reason.sortOrder = _this.getReasonSortOrder(reason.value.Reason);
17178
+ });
17179
+ item.reasons = item.reasons.sort(function (a, b) { return a.sortOrder - b.sortOrder; });
17180
+ item.sortOrder = item.reasons[0].sortOrder;
17181
+ }
17182
+ });
17183
+ searchCasesResponse = searchCasesResponse === null || searchCasesResponse === void 0 ? void 0 : searchCasesResponse.sort(function (a, b) { return a.sortOrder - b.sortOrder; });
17184
+ return searchCasesResponse;
17185
+ };
17186
+ LinkedCasesToTableComponent.prototype.getReasonSortOrder = function (reasonCode) {
17187
+ if (reasonCode === LinkedCasesToTableComponent.CASE_PROGRESS_REASON_CODE) {
17188
+ return 1;
17189
+ }
17190
+ else if (reasonCode === LinkedCasesToTableComponent.CASE_CONSOLIDATED_REASON_CODE) {
17191
+ return 2;
17192
+ }
17193
+ return 3;
17194
+ };
17151
17195
  LinkedCasesToTableComponent.prototype.searchCasesByCaseIds = function (searchCasesResponse) {
17152
17196
  return rxjs.forkJoin(searchCasesResponse);
17153
17197
  };
@@ -17780,87 +17824,52 @@
17780
17824
  }], function () { return [{ type: i1__namespace$1.ActivatedRoute }, { type: i1__namespace$1.Router }, { type: LinkedCasesService }, { type: AbstractAppConfig }, { type: CommonDataService }]; }, null);
17781
17825
  })();
17782
17826
 
17783
- function WriteLinkedCasesFieldComponent_div_0_div_3_Template(rf, ctx) {
17784
- if (rf & 1) {
17785
- var _r9_1 = i0__namespace.ɵɵgetCurrentView();
17786
- i0__namespace.ɵɵelementStart(0, "div", 7);
17787
- i0__namespace.ɵɵelementStart(1, "ul", 8);
17788
- i0__namespace.ɵɵelementStart(2, "li");
17789
- i0__namespace.ɵɵelementStart(3, "a", 9);
17790
- i0__namespace.ɵɵlistener("click", function WriteLinkedCasesFieldComponent_div_0_div_3_Template_a_click_3_listener() { i0__namespace.ɵɵrestoreView(_r9_1); var errorMessage_r7 = ctx.$implicit; var ctx_r8 = i0__namespace.ɵɵnextContext(2); return ctx_r8.navigateToErrorElement(errorMessage_r7.fieldId); });
17791
- i0__namespace.ɵɵtext(4);
17792
- i0__namespace.ɵɵelementEnd();
17793
- i0__namespace.ɵɵelementEnd();
17794
- i0__namespace.ɵɵelementEnd();
17795
- i0__namespace.ɵɵelementEnd();
17796
- }
17797
- if (rf & 2) {
17798
- var errorMessage_r7 = ctx.$implicit;
17799
- i0__namespace.ɵɵadvance(4);
17800
- i0__namespace.ɵɵtextInterpolate(errorMessage_r7.description);
17801
- }
17802
- }
17803
- function WriteLinkedCasesFieldComponent_div_0_Template(rf, ctx) {
17827
+ function WriteLinkedCasesFieldComponent_ng_container_2_Template(rf, ctx) {
17804
17828
  if (rf & 1) {
17805
- i0__namespace.ɵɵelementStart(0, "div", 4);
17806
- i0__namespace.ɵɵelementStart(1, "h2", 5);
17807
- i0__namespace.ɵɵtext(2, " There is a problem ");
17808
- i0__namespace.ɵɵelementEnd();
17809
- i0__namespace.ɵɵtemplate(3, WriteLinkedCasesFieldComponent_div_0_div_3_Template, 5, 1, "div", 6);
17829
+ var _r6_1 = i0__namespace.ɵɵgetCurrentView();
17830
+ i0__namespace.ɵɵelementContainerStart(0);
17831
+ i0__namespace.ɵɵelementStart(1, "ccd-linked-cases-before-you-start", 3);
17832
+ i0__namespace.ɵɵlistener("linkedCasesStateEmitter", function WriteLinkedCasesFieldComponent_ng_container_2_Template_ccd_linked_cases_before_you_start_linkedCasesStateEmitter_1_listener($event) { i0__namespace.ɵɵrestoreView(_r6_1); var ctx_r5 = i0__namespace.ɵɵnextContext(); return ctx_r5.onLinkedCasesStateEmitted($event); });
17810
17833
  i0__namespace.ɵɵelementEnd();
17811
- }
17812
- if (rf & 2) {
17813
- var ctx_r0 = i0__namespace.ɵɵnextContext();
17814
- i0__namespace.ɵɵadvance(3);
17815
- i0__namespace.ɵɵproperty("ngForOf", ctx_r0.errorMessages);
17834
+ i0__namespace.ɵɵelementContainerEnd();
17816
17835
  }
17817
17836
  }
17818
17837
  function WriteLinkedCasesFieldComponent_ng_container_3_Template(rf, ctx) {
17819
17838
  if (rf & 1) {
17820
- var _r11_1 = i0__namespace.ɵɵgetCurrentView();
17839
+ var _r8_1 = i0__namespace.ɵɵgetCurrentView();
17821
17840
  i0__namespace.ɵɵelementContainerStart(0);
17822
- i0__namespace.ɵɵelementStart(1, "ccd-linked-cases-before-you-start", 10);
17823
- i0__namespace.ɵɵlistener("linkedCasesStateEmitter", function WriteLinkedCasesFieldComponent_ng_container_3_Template_ccd_linked_cases_before_you_start_linkedCasesStateEmitter_1_listener($event) { i0__namespace.ɵɵrestoreView(_r11_1); var ctx_r10 = i0__namespace.ɵɵnextContext(); return ctx_r10.onLinkedCasesStateEmitted($event); });
17841
+ i0__namespace.ɵɵelementStart(1, "ccd-no-linked-cases", 3);
17842
+ i0__namespace.ɵɵlistener("linkedCasesStateEmitter", function WriteLinkedCasesFieldComponent_ng_container_3_Template_ccd_no_linked_cases_linkedCasesStateEmitter_1_listener($event) { i0__namespace.ɵɵrestoreView(_r8_1); var ctx_r7 = i0__namespace.ɵɵnextContext(); return ctx_r7.onLinkedCasesStateEmitted($event); });
17824
17843
  i0__namespace.ɵɵelementEnd();
17825
17844
  i0__namespace.ɵɵelementContainerEnd();
17826
17845
  }
17827
17846
  }
17828
17847
  function WriteLinkedCasesFieldComponent_ng_container_4_Template(rf, ctx) {
17829
17848
  if (rf & 1) {
17830
- var _r13_1 = i0__namespace.ɵɵgetCurrentView();
17849
+ var _r10_1 = i0__namespace.ɵɵgetCurrentView();
17831
17850
  i0__namespace.ɵɵelementContainerStart(0);
17832
- i0__namespace.ɵɵelementStart(1, "ccd-no-linked-cases", 10);
17833
- i0__namespace.ɵɵlistener("linkedCasesStateEmitter", function WriteLinkedCasesFieldComponent_ng_container_4_Template_ccd_no_linked_cases_linkedCasesStateEmitter_1_listener($event) { i0__namespace.ɵɵrestoreView(_r13_1); var ctx_r12 = i0__namespace.ɵɵnextContext(); return ctx_r12.onLinkedCasesStateEmitted($event); });
17851
+ i0__namespace.ɵɵelementStart(1, "ccd-link-cases", 3);
17852
+ i0__namespace.ɵɵlistener("linkedCasesStateEmitter", function WriteLinkedCasesFieldComponent_ng_container_4_Template_ccd_link_cases_linkedCasesStateEmitter_1_listener($event) { i0__namespace.ɵɵrestoreView(_r10_1); var ctx_r9 = i0__namespace.ɵɵnextContext(); return ctx_r9.onLinkedCasesStateEmitted($event); });
17834
17853
  i0__namespace.ɵɵelementEnd();
17835
17854
  i0__namespace.ɵɵelementContainerEnd();
17836
17855
  }
17837
17856
  }
17838
17857
  function WriteLinkedCasesFieldComponent_ng_container_5_Template(rf, ctx) {
17839
17858
  if (rf & 1) {
17840
- var _r15_1 = i0__namespace.ɵɵgetCurrentView();
17859
+ var _r12_1 = i0__namespace.ɵɵgetCurrentView();
17841
17860
  i0__namespace.ɵɵelementContainerStart(0);
17842
- i0__namespace.ɵɵelementStart(1, "ccd-link-cases", 10);
17843
- i0__namespace.ɵɵlistener("linkedCasesStateEmitter", function WriteLinkedCasesFieldComponent_ng_container_5_Template_ccd_link_cases_linkedCasesStateEmitter_1_listener($event) { i0__namespace.ɵɵrestoreView(_r15_1); var ctx_r14 = i0__namespace.ɵɵnextContext(); return ctx_r14.onLinkedCasesStateEmitted($event); });
17861
+ i0__namespace.ɵɵelementStart(1, "ccd-unlink-cases", 3);
17862
+ i0__namespace.ɵɵlistener("linkedCasesStateEmitter", function WriteLinkedCasesFieldComponent_ng_container_5_Template_ccd_unlink_cases_linkedCasesStateEmitter_1_listener($event) { i0__namespace.ɵɵrestoreView(_r12_1); var ctx_r11 = i0__namespace.ɵɵnextContext(); return ctx_r11.onLinkedCasesStateEmitted($event); });
17844
17863
  i0__namespace.ɵɵelementEnd();
17845
17864
  i0__namespace.ɵɵelementContainerEnd();
17846
17865
  }
17847
17866
  }
17848
17867
  function WriteLinkedCasesFieldComponent_ng_container_6_Template(rf, ctx) {
17849
17868
  if (rf & 1) {
17850
- var _r17_1 = i0__namespace.ɵɵgetCurrentView();
17851
- i0__namespace.ɵɵelementContainerStart(0);
17852
- i0__namespace.ɵɵelementStart(1, "ccd-unlink-cases", 10);
17853
- i0__namespace.ɵɵlistener("linkedCasesStateEmitter", function WriteLinkedCasesFieldComponent_ng_container_6_Template_ccd_unlink_cases_linkedCasesStateEmitter_1_listener($event) { i0__namespace.ɵɵrestoreView(_r17_1); var ctx_r16 = i0__namespace.ɵɵnextContext(); return ctx_r16.onLinkedCasesStateEmitted($event); });
17854
- i0__namespace.ɵɵelementEnd();
17855
- i0__namespace.ɵɵelementContainerEnd();
17856
- }
17857
- }
17858
- function WriteLinkedCasesFieldComponent_ng_container_7_Template(rf, ctx) {
17859
- if (rf & 1) {
17860
- var _r19_1 = i0__namespace.ɵɵgetCurrentView();
17869
+ var _r14_1 = i0__namespace.ɵɵgetCurrentView();
17861
17870
  i0__namespace.ɵɵelementContainerStart(0);
17862
- i0__namespace.ɵɵelementStart(1, "ccd-linked-cases-check-your-answers", 10);
17863
- i0__namespace.ɵɵlistener("linkedCasesStateEmitter", function WriteLinkedCasesFieldComponent_ng_container_7_Template_ccd_linked_cases_check_your_answers_linkedCasesStateEmitter_1_listener($event) { i0__namespace.ɵɵrestoreView(_r19_1); var ctx_r18 = i0__namespace.ɵɵnextContext(); return ctx_r18.onLinkedCasesStateEmitted($event); });
17871
+ i0__namespace.ɵɵelementStart(1, "ccd-linked-cases-check-your-answers", 3);
17872
+ i0__namespace.ɵɵlistener("linkedCasesStateEmitter", function WriteLinkedCasesFieldComponent_ng_container_6_Template_ccd_linked_cases_check_your_answers_linkedCasesStateEmitter_1_listener($event) { i0__namespace.ɵɵrestoreView(_r14_1); var ctx_r13 = i0__namespace.ɵɵnextContext(); return ctx_r13.onLinkedCasesStateEmitted($event); });
17864
17873
  i0__namespace.ɵɵelementEnd();
17865
17874
  i0__namespace.ɵɵelementContainerEnd();
17866
17875
  }
@@ -17877,11 +17886,13 @@
17877
17886
  _this.linkedCasesPages = exports.LinkedCasesPages;
17878
17887
  _this.linkedCasesEventTriggers = exports.LinkedCasesEventTriggers;
17879
17888
  _this.linkedCases = [];
17880
- _this.errorMessages = [];
17881
17889
  return _this;
17882
17890
  }
17883
17891
  WriteLinkedCasesFieldComponent.prototype.ngOnInit = function () {
17884
17892
  var _this = this;
17893
+ // This is required to enable Continue button validation
17894
+ // Continue button should be enabled only at check your answers page
17895
+ this.caseEditDataService.setLinkedCasesJourneyAtFinalStep(false);
17885
17896
  // Clear validation errors
17886
17897
  this.caseEditDataService.clearFormValidationErrors();
17887
17898
  // Get linked case reasons from ref data
@@ -17918,11 +17929,10 @@
17918
17929
  };
17919
17930
  WriteLinkedCasesFieldComponent.prototype.onLinkedCasesStateEmitted = function (linkedCasesState) {
17920
17931
  var _this = this;
17921
- this.errorMessages = [];
17932
+ // Clear validation errors
17922
17933
  this.caseEditDataService.clearFormValidationErrors();
17923
17934
  if (linkedCasesState.navigateToNextPage) {
17924
17935
  this.linkedCasesPage = this.getNextPage(linkedCasesState);
17925
- this.setContinueButtonValidationErrorMessage();
17926
17936
  this.proceedToNextPage();
17927
17937
  }
17928
17938
  else {
@@ -17946,27 +17956,19 @@
17946
17956
  }
17947
17957
  });
17948
17958
  };
17949
- WriteLinkedCasesFieldComponent.prototype.setContinueButtonValidationErrorMessage = function () {
17950
- var errorMessage = this.linkedCasesService.isLinkedCasesEventTrigger
17951
- ? exports.LinkedCasesErrorMessages.LinkCasesNavigationError
17952
- : exports.LinkedCasesErrorMessages.UnlinkCasesNavigationError;
17953
- var buttonId = this.linkedCasesService.linkedCases.length === 0
17954
- ? 'back-button'
17955
- : 'next-button';
17956
- this.caseEditDataService.setCaseLinkError({
17957
- componentId: buttonId,
17958
- errorMessage: errorMessage
17959
- });
17960
- };
17961
17959
  WriteLinkedCasesFieldComponent.prototype.proceedToNextPage = function () {
17962
17960
  if (this.isAtFinalPage()) {
17963
17961
  // Continue button event must be allowed in final page
17964
- this.caseEditDataService.clearCaseLinkError();
17962
+ this.caseEditDataService.setLinkedCasesJourneyAtFinalStep(true);
17965
17963
  // Trigger validation to clear the "notAtFinalPage" error if now at the final state
17966
17964
  this.formGroup.updateValueAndValidity();
17967
17965
  // update form value
17968
17966
  this.submitLinkedCases();
17969
17967
  }
17968
+ else {
17969
+ // Continue button event must not be allowed if not in final page
17970
+ this.caseEditDataService.setLinkedCasesJourneyAtFinalStep(false);
17971
+ }
17970
17972
  };
17971
17973
  WriteLinkedCasesFieldComponent.prototype.submitLinkedCases = function () {
17972
17974
  if (!this.linkedCasesService.isLinkedCasesEventTrigger) {
@@ -18010,38 +18012,24 @@
18010
18012
  && !_this.linkedCasesService.serverLinkedApiError)
18011
18013
  ? exports.LinkedCasesPages.BEFORE_YOU_START
18012
18014
  : exports.LinkedCasesPages.NO_LINKED_CASES;
18013
- // Initialise the error to be displayed when clicked on Continue button
18014
- _this.setContinueButtonValidationErrorMessage();
18015
18015
  });
18016
18016
  };
18017
- WriteLinkedCasesFieldComponent.prototype.navigateToErrorElement = function (elementId) {
18018
- if (elementId) {
18019
- var htmlElement = document.getElementById(elementId);
18020
- if (htmlElement) {
18021
- htmlElement.scrollIntoView({ behavior: 'smooth', block: 'center' });
18022
- htmlElement.focus();
18023
- }
18024
- }
18025
- };
18026
18017
  return WriteLinkedCasesFieldComponent;
18027
18018
  }(AbstractFieldWriteComponent));
18028
18019
  WriteLinkedCasesFieldComponent.ɵfac = function WriteLinkedCasesFieldComponent_Factory(t) { return new (t || WriteLinkedCasesFieldComponent)(i0__namespace.ɵɵdirectiveInject(AbstractAppConfig), i0__namespace.ɵɵdirectiveInject(CommonDataService), i0__namespace.ɵɵdirectiveInject(CasesService), i0__namespace.ɵɵdirectiveInject(LinkedCasesService), i0__namespace.ɵɵdirectiveInject(CaseEditDataService)); };
18029
- WriteLinkedCasesFieldComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: WriteLinkedCasesFieldComponent, selectors: [["ccd-write-linked-cases-field"]], features: [i0__namespace.ɵɵ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) {
18020
+ WriteLinkedCasesFieldComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: WriteLinkedCasesFieldComponent, selectors: [["ccd-write-linked-cases-field"]], features: [i0__namespace.ɵɵ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) {
18030
18021
  if (rf & 1) {
18031
- i0__namespace.ɵɵtemplate(0, WriteLinkedCasesFieldComponent_div_0_Template, 4, 1, "div", 0);
18022
+ i0__namespace.ɵɵelementStart(0, "div", 0);
18032
18023
  i0__namespace.ɵɵelementStart(1, "div", 1);
18033
- i0__namespace.ɵɵelementStart(2, "div", 2);
18034
- i0__namespace.ɵɵtemplate(3, WriteLinkedCasesFieldComponent_ng_container_3_Template, 2, 0, "ng-container", 3);
18035
- i0__namespace.ɵɵtemplate(4, WriteLinkedCasesFieldComponent_ng_container_4_Template, 2, 0, "ng-container", 3);
18036
- i0__namespace.ɵɵtemplate(5, WriteLinkedCasesFieldComponent_ng_container_5_Template, 2, 0, "ng-container", 3);
18037
- i0__namespace.ɵɵtemplate(6, WriteLinkedCasesFieldComponent_ng_container_6_Template, 2, 0, "ng-container", 3);
18038
- i0__namespace.ɵɵtemplate(7, WriteLinkedCasesFieldComponent_ng_container_7_Template, 2, 0, "ng-container", 3);
18024
+ i0__namespace.ɵɵtemplate(2, WriteLinkedCasesFieldComponent_ng_container_2_Template, 2, 0, "ng-container", 2);
18025
+ i0__namespace.ɵɵtemplate(3, WriteLinkedCasesFieldComponent_ng_container_3_Template, 2, 0, "ng-container", 2);
18026
+ i0__namespace.ɵɵtemplate(4, WriteLinkedCasesFieldComponent_ng_container_4_Template, 2, 0, "ng-container", 2);
18027
+ i0__namespace.ɵɵtemplate(5, WriteLinkedCasesFieldComponent_ng_container_5_Template, 2, 0, "ng-container", 2);
18028
+ i0__namespace.ɵɵtemplate(6, WriteLinkedCasesFieldComponent_ng_container_6_Template, 2, 0, "ng-container", 2);
18039
18029
  i0__namespace.ɵɵelementEnd();
18040
18030
  i0__namespace.ɵɵelementEnd();
18041
18031
  }
18042
18032
  if (rf & 2) {
18043
- i0__namespace.ɵɵproperty("ngIf", ctx.errorMessages.length > 0);
18044
- i0__namespace.ɵɵadvance(1);
18045
18033
  i0__namespace.ɵɵproperty("formGroup", ctx.formGroup);
18046
18034
  i0__namespace.ɵɵadvance(1);
18047
18035
  i0__namespace.ɵɵproperty("ngSwitch", ctx.linkedCasesPage);
@@ -26021,7 +26009,7 @@
26021
26009
  AddCommentsComponent,
26022
26010
  ManageCaseFlagsComponent,
26023
26011
  UpdateFlagComponent], []);
26024
- i0__namespace.ɵɵsetComponentScope(WriteLinkedCasesFieldComponent, [i1__namespace.NgIf, i1__namespace.NgForOf, i2__namespace.NgControlStatusGroup, i2__namespace.FormGroupDirective, i1__namespace.NgSwitch, i1__namespace.NgSwitchCase, BeforeYouStartComponent,
26012
+ i0__namespace.ɵɵsetComponentScope(WriteLinkedCasesFieldComponent, [i2__namespace.NgControlStatusGroup, i2__namespace.FormGroupDirective, i1__namespace.NgSwitch, i1__namespace.NgSwitchCase, BeforeYouStartComponent,
26025
26013
  NoLinkedCasesComponent,
26026
26014
  LinkCasesComponent,
26027
26015
  UnLinkCasesComponent,
@@ -27712,46 +27700,46 @@
27712
27700
 
27713
27701
  function PaginationComponent_ul_3_li_1_a_1_Template(rf, ctx) {
27714
27702
  if (rf & 1) {
27715
- var _r8_1 = i0__namespace.ɵɵgetCurrentView();
27716
- i0__namespace.ɵɵelementStart(0, "a", 12);
27717
- i0__namespace.ɵɵlistener("keyup.enter", function PaginationComponent_ul_3_li_1_a_1_Template_a_keyup_enter_0_listener() { i0__namespace.ɵɵrestoreView(_r8_1); i0__namespace.ɵɵnextContext(3); var _r0 = i0__namespace.ɵɵreference(1); return _r0.previous(); })("click", function PaginationComponent_ul_3_li_1_a_1_Template_a_click_0_listener() { i0__namespace.ɵɵrestoreView(_r8_1); i0__namespace.ɵɵnextContext(3); var _r0 = i0__namespace.ɵɵreference(1); return _r0.previous(); });
27703
+ var _r9_1 = i0__namespace.ɵɵgetCurrentView();
27704
+ i0__namespace.ɵɵelementStart(0, "a", 13);
27705
+ i0__namespace.ɵɵlistener("keyup.enter", function PaginationComponent_ul_3_li_1_a_1_Template_a_keyup_enter_0_listener() { i0__namespace.ɵɵrestoreView(_r9_1); i0__namespace.ɵɵnextContext(3); var _r0 = i0__namespace.ɵɵreference(1); return _r0.previous(); })("click", function PaginationComponent_ul_3_li_1_a_1_Template_a_click_0_listener() { i0__namespace.ɵɵrestoreView(_r9_1); i0__namespace.ɵɵnextContext(3); var _r0 = i0__namespace.ɵɵreference(1); return _r0.previous(); });
27718
27706
  i0__namespace.ɵɵtext(1);
27719
- i0__namespace.ɵɵelementStart(2, "span", 13);
27707
+ i0__namespace.ɵɵelementStart(2, "span", 14);
27720
27708
  i0__namespace.ɵɵtext(3);
27721
27709
  i0__namespace.ɵɵelementEnd();
27722
27710
  i0__namespace.ɵɵelementEnd();
27723
27711
  }
27724
27712
  if (rf & 2) {
27725
- var ctx_r5 = i0__namespace.ɵɵnextContext(3);
27726
- i0__namespace.ɵɵattribute("aria-label", ctx_r5.previousLabel + " " + ctx_r5.screenReaderPageLabel);
27713
+ var ctx_r6 = i0__namespace.ɵɵnextContext(3);
27714
+ i0__namespace.ɵɵattribute("aria-label", ctx_r6.previousLabel + " " + ctx_r6.screenReaderPageLabel);
27727
27715
  i0__namespace.ɵɵadvance(1);
27728
- i0__namespace.ɵɵtextInterpolate1(" ", ctx_r5.previousLabel, " ");
27716
+ i0__namespace.ɵɵtextInterpolate1(" ", ctx_r6.previousLabel, " ");
27729
27717
  i0__namespace.ɵɵadvance(2);
27730
- i0__namespace.ɵɵtextInterpolate(ctx_r5.screenReaderPageLabel);
27718
+ i0__namespace.ɵɵtextInterpolate(ctx_r6.screenReaderPageLabel);
27731
27719
  }
27732
27720
  }
27733
27721
  function PaginationComponent_ul_3_li_1_span_2_Template(rf, ctx) {
27734
27722
  if (rf & 1) {
27735
27723
  i0__namespace.ɵɵelementStart(0, "span");
27736
27724
  i0__namespace.ɵɵtext(1);
27737
- i0__namespace.ɵɵelementStart(2, "span", 13);
27725
+ i0__namespace.ɵɵelementStart(2, "span", 14);
27738
27726
  i0__namespace.ɵɵtext(3);
27739
27727
  i0__namespace.ɵɵelementEnd();
27740
27728
  i0__namespace.ɵɵelementEnd();
27741
27729
  }
27742
27730
  if (rf & 2) {
27743
- var ctx_r6 = i0__namespace.ɵɵnextContext(3);
27731
+ var ctx_r7 = i0__namespace.ɵɵnextContext(3);
27744
27732
  i0__namespace.ɵɵadvance(1);
27745
- i0__namespace.ɵɵtextInterpolate1(" ", ctx_r6.previousLabel, " ");
27733
+ i0__namespace.ɵɵtextInterpolate1(" ", ctx_r7.previousLabel, " ");
27746
27734
  i0__namespace.ɵɵadvance(2);
27747
- i0__namespace.ɵɵtextInterpolate(ctx_r6.screenReaderPageLabel);
27735
+ i0__namespace.ɵɵtextInterpolate(ctx_r7.screenReaderPageLabel);
27748
27736
  }
27749
27737
  }
27750
27738
  function PaginationComponent_ul_3_li_1_Template(rf, ctx) {
27751
27739
  if (rf & 1) {
27752
- i0__namespace.ɵɵelementStart(0, "li", 9);
27753
- i0__namespace.ɵɵtemplate(1, PaginationComponent_ul_3_li_1_a_1_Template, 4, 3, "a", 10);
27754
- i0__namespace.ɵɵtemplate(2, PaginationComponent_ul_3_li_1_span_2_Template, 4, 2, "span", 11);
27740
+ i0__namespace.ɵɵelementStart(0, "li", 10);
27741
+ i0__namespace.ɵɵtemplate(1, PaginationComponent_ul_3_li_1_a_1_Template, 4, 3, "a", 11);
27742
+ i0__namespace.ɵɵtemplate(2, PaginationComponent_ul_3_li_1_span_2_Template, 4, 2, "span", 12);
27755
27743
  i0__namespace.ɵɵelementEnd();
27756
27744
  }
27757
27745
  if (rf & 2) {
@@ -27766,10 +27754,10 @@
27766
27754
  }
27767
27755
  function PaginationComponent_ul_3_li_4_a_1_Template(rf, ctx) {
27768
27756
  if (rf & 1) {
27769
- var _r15_1 = i0__namespace.ɵɵgetCurrentView();
27770
- i0__namespace.ɵɵelementStart(0, "a", 12);
27771
- i0__namespace.ɵɵlistener("keyup.enter", function PaginationComponent_ul_3_li_4_a_1_Template_a_keyup_enter_0_listener() { i0__namespace.ɵɵrestoreView(_r15_1); var page_r10 = i0__namespace.ɵɵnextContext().$implicit; i0__namespace.ɵɵnextContext(2); var _r0 = i0__namespace.ɵɵreference(1); return _r0.setCurrent(page_r10.value); })("click", function PaginationComponent_ul_3_li_4_a_1_Template_a_click_0_listener() { i0__namespace.ɵɵrestoreView(_r15_1); var page_r10 = i0__namespace.ɵɵnextContext().$implicit; i0__namespace.ɵɵnextContext(2); var _r0 = i0__namespace.ɵɵreference(1); return _r0.setCurrent(page_r10.value); });
27772
- i0__namespace.ɵɵelementStart(1, "span", 13);
27757
+ var _r16_1 = i0__namespace.ɵɵgetCurrentView();
27758
+ i0__namespace.ɵɵelementStart(0, "a", 13);
27759
+ i0__namespace.ɵɵlistener("keyup.enter", function PaginationComponent_ul_3_li_4_a_1_Template_a_keyup_enter_0_listener() { i0__namespace.ɵɵrestoreView(_r16_1); var page_r11 = i0__namespace.ɵɵnextContext().$implicit; i0__namespace.ɵɵnextContext(2); var _r0 = i0__namespace.ɵɵreference(1); return _r0.setCurrent(page_r11.value); })("click", function PaginationComponent_ul_3_li_4_a_1_Template_a_click_0_listener() { i0__namespace.ɵɵrestoreView(_r16_1); var page_r11 = i0__namespace.ɵɵnextContext().$implicit; i0__namespace.ɵɵnextContext(2); var _r0 = i0__namespace.ɵɵreference(1); return _r0.setCurrent(page_r11.value); });
27760
+ i0__namespace.ɵɵelementStart(1, "span", 14);
27773
27761
  i0__namespace.ɵɵtext(2);
27774
27762
  i0__namespace.ɵɵelementEnd();
27775
27763
  i0__namespace.ɵɵelementStart(3, "span");
@@ -27779,18 +27767,18 @@
27779
27767
  i0__namespace.ɵɵelementEnd();
27780
27768
  }
27781
27769
  if (rf & 2) {
27782
- var page_r10 = i0__namespace.ɵɵnextContext().$implicit;
27783
- var ctx_r11 = i0__namespace.ɵɵnextContext(2);
27770
+ var page_r11 = i0__namespace.ɵɵnextContext().$implicit;
27771
+ var ctx_r12 = i0__namespace.ɵɵnextContext(2);
27784
27772
  i0__namespace.ɵɵadvance(2);
27785
- i0__namespace.ɵɵtextInterpolate1("", ctx_r11.screenReaderPageLabel, " ");
27773
+ i0__namespace.ɵɵtextInterpolate1("", ctx_r12.screenReaderPageLabel, " ");
27786
27774
  i0__namespace.ɵɵadvance(2);
27787
- i0__namespace.ɵɵtextInterpolate(page_r10.label === "..." ? page_r10.label : i0__namespace.ɵɵpipeBind2(5, 2, page_r10.label, ""));
27775
+ i0__namespace.ɵɵtextInterpolate(page_r11.label === "..." ? page_r11.label : i0__namespace.ɵɵpipeBind2(5, 2, page_r11.label, ""));
27788
27776
  }
27789
27777
  }
27790
27778
  function PaginationComponent_ul_3_li_4_ng_container_2_Template(rf, ctx) {
27791
27779
  if (rf & 1) {
27792
27780
  i0__namespace.ɵɵelementContainerStart(0);
27793
- i0__namespace.ɵɵelementStart(1, "span", 13);
27781
+ i0__namespace.ɵɵelementStart(1, "span", 14);
27794
27782
  i0__namespace.ɵɵtext(2);
27795
27783
  i0__namespace.ɵɵelementEnd();
27796
27784
  i0__namespace.ɵɵelementStart(3, "span");
@@ -27800,74 +27788,74 @@
27800
27788
  i0__namespace.ɵɵelementContainerEnd();
27801
27789
  }
27802
27790
  if (rf & 2) {
27803
- var page_r10 = i0__namespace.ɵɵnextContext().$implicit;
27804
- var ctx_r12 = i0__namespace.ɵɵnextContext(2);
27791
+ var page_r11 = i0__namespace.ɵɵnextContext().$implicit;
27792
+ var ctx_r13 = i0__namespace.ɵɵnextContext(2);
27805
27793
  i0__namespace.ɵɵadvance(2);
27806
- i0__namespace.ɵɵtextInterpolate1("", ctx_r12.screenReaderCurrentLabel, " ");
27794
+ i0__namespace.ɵɵtextInterpolate1("", ctx_r13.screenReaderCurrentLabel, " ");
27807
27795
  i0__namespace.ɵɵadvance(2);
27808
- i0__namespace.ɵɵtextInterpolate(page_r10.label === "..." ? page_r10.label : i0__namespace.ɵɵpipeBind2(5, 2, page_r10.label, ""));
27796
+ i0__namespace.ɵɵtextInterpolate(page_r11.label === "..." ? page_r11.label : i0__namespace.ɵɵpipeBind2(5, 2, page_r11.label, ""));
27809
27797
  }
27810
27798
  }
27811
27799
  function PaginationComponent_ul_3_li_4_Template(rf, ctx) {
27812
27800
  if (rf & 1) {
27813
27801
  i0__namespace.ɵɵelementStart(0, "li");
27814
- i0__namespace.ɵɵtemplate(1, PaginationComponent_ul_3_li_4_a_1_Template, 6, 5, "a", 10);
27815
- i0__namespace.ɵɵtemplate(2, PaginationComponent_ul_3_li_4_ng_container_2_Template, 6, 5, "ng-container", 11);
27802
+ i0__namespace.ɵɵtemplate(1, PaginationComponent_ul_3_li_4_a_1_Template, 6, 5, "a", 11);
27803
+ i0__namespace.ɵɵtemplate(2, PaginationComponent_ul_3_li_4_ng_container_2_Template, 6, 5, "ng-container", 12);
27816
27804
  i0__namespace.ɵɵelementEnd();
27817
27805
  }
27818
27806
  if (rf & 2) {
27819
- var page_r10 = ctx.$implicit;
27807
+ var page_r11 = ctx.$implicit;
27820
27808
  i0__namespace.ɵɵnextContext(2);
27821
27809
  var _r0 = i0__namespace.ɵɵreference(1);
27822
- i0__namespace.ɵɵclassProp("current", _r0.getCurrent() === page_r10.value)("ellipsis", page_r10.label === "...");
27810
+ i0__namespace.ɵɵclassProp("current", _r0.getCurrent() === page_r11.value)("ellipsis", page_r11.label === "...");
27823
27811
  i0__namespace.ɵɵadvance(1);
27824
- i0__namespace.ɵɵproperty("ngIf", _r0.getCurrent() !== page_r10.value);
27812
+ i0__namespace.ɵɵproperty("ngIf", _r0.getCurrent() !== page_r11.value);
27825
27813
  i0__namespace.ɵɵadvance(1);
27826
- i0__namespace.ɵɵproperty("ngIf", _r0.getCurrent() === page_r10.value);
27814
+ i0__namespace.ɵɵproperty("ngIf", _r0.getCurrent() === page_r11.value);
27827
27815
  }
27828
27816
  }
27829
27817
  function PaginationComponent_ul_3_li_5_a_1_Template(rf, ctx) {
27830
27818
  if (rf & 1) {
27831
- var _r23_1 = i0__namespace.ɵɵgetCurrentView();
27832
- i0__namespace.ɵɵelementStart(0, "a", 12);
27833
- i0__namespace.ɵɵlistener("keyup.enter", function PaginationComponent_ul_3_li_5_a_1_Template_a_keyup_enter_0_listener() { i0__namespace.ɵɵrestoreView(_r23_1); i0__namespace.ɵɵnextContext(3); var _r0 = i0__namespace.ɵɵreference(1); return _r0.next(); })("click", function PaginationComponent_ul_3_li_5_a_1_Template_a_click_0_listener() { i0__namespace.ɵɵrestoreView(_r23_1); i0__namespace.ɵɵnextContext(3); var _r0 = i0__namespace.ɵɵreference(1); return _r0.next(); });
27819
+ var _r24_1 = i0__namespace.ɵɵgetCurrentView();
27820
+ i0__namespace.ɵɵelementStart(0, "a", 13);
27821
+ i0__namespace.ɵɵlistener("keyup.enter", function PaginationComponent_ul_3_li_5_a_1_Template_a_keyup_enter_0_listener() { i0__namespace.ɵɵrestoreView(_r24_1); i0__namespace.ɵɵnextContext(3); var _r0 = i0__namespace.ɵɵreference(1); return _r0.next(); })("click", function PaginationComponent_ul_3_li_5_a_1_Template_a_click_0_listener() { i0__namespace.ɵɵrestoreView(_r24_1); i0__namespace.ɵɵnextContext(3); var _r0 = i0__namespace.ɵɵreference(1); return _r0.next(); });
27834
27822
  i0__namespace.ɵɵtext(1);
27835
- i0__namespace.ɵɵelementStart(2, "span", 13);
27823
+ i0__namespace.ɵɵelementStart(2, "span", 14);
27836
27824
  i0__namespace.ɵɵtext(3);
27837
27825
  i0__namespace.ɵɵelementEnd();
27838
27826
  i0__namespace.ɵɵelementEnd();
27839
27827
  }
27840
27828
  if (rf & 2) {
27841
- var ctx_r20 = i0__namespace.ɵɵnextContext(3);
27842
- i0__namespace.ɵɵattribute("aria-label", ctx_r20.nextLabel + " " + ctx_r20.screenReaderPageLabel);
27829
+ var ctx_r21 = i0__namespace.ɵɵnextContext(3);
27830
+ i0__namespace.ɵɵattribute("aria-label", ctx_r21.nextLabel + " " + ctx_r21.screenReaderPageLabel);
27843
27831
  i0__namespace.ɵɵadvance(1);
27844
- i0__namespace.ɵɵtextInterpolate1(" ", ctx_r20.nextLabel, " ");
27832
+ i0__namespace.ɵɵtextInterpolate1(" ", ctx_r21.nextLabel, " ");
27845
27833
  i0__namespace.ɵɵadvance(2);
27846
- i0__namespace.ɵɵtextInterpolate(ctx_r20.screenReaderPageLabel);
27834
+ i0__namespace.ɵɵtextInterpolate(ctx_r21.screenReaderPageLabel);
27847
27835
  }
27848
27836
  }
27849
27837
  function PaginationComponent_ul_3_li_5_span_2_Template(rf, ctx) {
27850
27838
  if (rf & 1) {
27851
27839
  i0__namespace.ɵɵelementStart(0, "span");
27852
27840
  i0__namespace.ɵɵtext(1);
27853
- i0__namespace.ɵɵelementStart(2, "span", 13);
27841
+ i0__namespace.ɵɵelementStart(2, "span", 14);
27854
27842
  i0__namespace.ɵɵtext(3);
27855
27843
  i0__namespace.ɵɵelementEnd();
27856
27844
  i0__namespace.ɵɵelementEnd();
27857
27845
  }
27858
27846
  if (rf & 2) {
27859
- var ctx_r21 = i0__namespace.ɵɵnextContext(3);
27847
+ var ctx_r22 = i0__namespace.ɵɵnextContext(3);
27860
27848
  i0__namespace.ɵɵadvance(1);
27861
- i0__namespace.ɵɵtextInterpolate1(" ", ctx_r21.nextLabel, " ");
27849
+ i0__namespace.ɵɵtextInterpolate1(" ", ctx_r22.nextLabel, " ");
27862
27850
  i0__namespace.ɵɵadvance(2);
27863
- i0__namespace.ɵɵtextInterpolate(ctx_r21.screenReaderPageLabel);
27851
+ i0__namespace.ɵɵtextInterpolate(ctx_r22.screenReaderPageLabel);
27864
27852
  }
27865
27853
  }
27866
27854
  function PaginationComponent_ul_3_li_5_Template(rf, ctx) {
27867
27855
  if (rf & 1) {
27868
- i0__namespace.ɵɵelementStart(0, "li", 14);
27869
- i0__namespace.ɵɵtemplate(1, PaginationComponent_ul_3_li_5_a_1_Template, 4, 3, "a", 10);
27870
- i0__namespace.ɵɵtemplate(2, PaginationComponent_ul_3_li_5_span_2_Template, 4, 2, "span", 11);
27856
+ i0__namespace.ɵɵelementStart(0, "li", 15);
27857
+ i0__namespace.ɵɵtemplate(1, PaginationComponent_ul_3_li_5_a_1_Template, 4, 3, "a", 11);
27858
+ i0__namespace.ɵɵtemplate(2, PaginationComponent_ul_3_li_5_span_2_Template, 4, 2, "span", 12);
27871
27859
  i0__namespace.ɵɵelementEnd();
27872
27860
  }
27873
27861
  if (rf & 2) {
@@ -27882,13 +27870,13 @@
27882
27870
  }
27883
27871
  function PaginationComponent_ul_3_Template(rf, ctx) {
27884
27872
  if (rf & 1) {
27885
- i0__namespace.ɵɵelementStart(0, "ul", 4);
27886
- i0__namespace.ɵɵtemplate(1, PaginationComponent_ul_3_li_1_Template, 3, 4, "li", 5);
27887
- i0__namespace.ɵɵelementStart(2, "li", 6);
27873
+ i0__namespace.ɵɵelementStart(0, "ul", 5);
27874
+ i0__namespace.ɵɵtemplate(1, PaginationComponent_ul_3_li_1_Template, 3, 4, "li", 6);
27875
+ i0__namespace.ɵɵelementStart(2, "li", 7);
27888
27876
  i0__namespace.ɵɵtext(3);
27889
27877
  i0__namespace.ɵɵelementEnd();
27890
- i0__namespace.ɵɵtemplate(4, PaginationComponent_ul_3_li_4_Template, 3, 6, "li", 7);
27891
- i0__namespace.ɵɵtemplate(5, PaginationComponent_ul_3_li_5_Template, 3, 4, "li", 8);
27878
+ i0__namespace.ɵɵtemplate(4, PaginationComponent_ul_3_li_4_Template, 3, 6, "li", 8);
27879
+ i0__namespace.ɵɵtemplate(5, PaginationComponent_ul_3_li_5_Template, 3, 4, "li", 9);
27892
27880
  i0__namespace.ɵɵelementEnd();
27893
27881
  }
27894
27882
  if (rf & 2) {
@@ -27906,6 +27894,19 @@
27906
27894
  i0__namespace.ɵɵproperty("ngIf", ctx_r1.directionLinks);
27907
27895
  }
27908
27896
  }
27897
+ function PaginationComponent_div_4_Template(rf, ctx) {
27898
+ if (rf & 1) {
27899
+ var _r28_1 = i0__namespace.ɵɵgetCurrentView();
27900
+ i0__namespace.ɵɵelementStart(0, "div", 16);
27901
+ i0__namespace.ɵɵelementStart(1, "span");
27902
+ i0__namespace.ɵɵtext(2, "Go to page");
27903
+ i0__namespace.ɵɵelementEnd();
27904
+ i0__namespace.ɵɵelementStart(3, "input", 17, 18);
27905
+ i0__namespace.ɵɵlistener("keyup.enter", function PaginationComponent_div_4_Template_input_keyup_enter_3_listener($event) { i0__namespace.ɵɵrestoreView(_r28_1); var ctx_r27 = i0__namespace.ɵɵnextContext(); var _r0 = i0__namespace.ɵɵreference(1); ctx_r27.goToPage($event, _r0); return $event.target.blur(); })("blur", function PaginationComponent_div_4_Template_input_blur_3_listener($event) { i0__namespace.ɵɵrestoreView(_r28_1); var ctx_r29 = i0__namespace.ɵɵnextContext(); var _r0 = i0__namespace.ɵɵreference(1); return ctx_r29.goToPage($event, _r0); })("focus", function PaginationComponent_div_4_Template_input_focus_3_listener() { i0__namespace.ɵɵrestoreView(_r28_1); var _r26 = i0__namespace.ɵɵreference(4); return _r26.select(); });
27906
+ i0__namespace.ɵɵelementEnd();
27907
+ i0__namespace.ɵɵelementEnd();
27908
+ }
27909
+ }
27909
27910
  function coerceToBoolean(input) {
27910
27911
  return !!input && input !== 'false';
27911
27912
  }
@@ -27953,16 +27954,34 @@
27953
27954
  enumerable: false,
27954
27955
  configurable: true
27955
27956
  });
27957
+ PaginationComponent.prototype.goToPage = function ($event, p) {
27958
+ var pageNumber = Number($event.target.value);
27959
+ if ($event.target.value !== '' && pageNumber !== p.getCurrent()) {
27960
+ if (pageNumber > 0) {
27961
+ p.setCurrent(pageNumber);
27962
+ }
27963
+ else if (pageNumber < 0) {
27964
+ $event.target.value = (Math.abs(pageNumber)).toString();
27965
+ if (Math.abs(pageNumber) !== p.getCurrent()) {
27966
+ p.setCurrent(Math.abs(pageNumber));
27967
+ }
27968
+ }
27969
+ else {
27970
+ $event.target.value = '';
27971
+ }
27972
+ }
27973
+ };
27956
27974
  return PaginationComponent;
27957
27975
  }());
27958
27976
  PaginationComponent.ɵfac = function PaginationComponent_Factory(t) { return new (t || PaginationComponent)(); };
27959
- PaginationComponent.ɵcmp = i0__namespace.ɵɵ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) {
27977
+ PaginationComponent.ɵcmp = i0__namespace.ɵɵ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) {
27960
27978
  if (rf & 1) {
27961
27979
  i0__namespace.ɵɵelementStart(0, "pagination-template", 0, 1);
27962
27980
  i0__namespace.ɵɵ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); });
27963
27981
  i0__namespace.ɵɵelementStart(2, "nav", 2);
27964
27982
  i0__namespace.ɵɵtemplate(3, PaginationComponent_ul_3_Template, 6, 8, "ul", 3);
27965
27983
  i0__namespace.ɵɵelementEnd();
27984
+ i0__namespace.ɵɵtemplate(4, PaginationComponent_div_4_Template, 5, 0, "div", 4);
27966
27985
  i0__namespace.ɵɵelementEnd();
27967
27986
  }
27968
27987
  if (rf & 2) {
@@ -27970,8 +27989,10 @@
27970
27989
  i0__namespace.ɵɵproperty("id", ctx.id)("maxSize", ctx.maxSize);
27971
27990
  i0__namespace.ɵɵadvance(3);
27972
27991
  i0__namespace.ɵɵproperty("ngIf", !(ctx.autoHide && _r0.pages.length <= 1));
27992
+ i0__namespace.ɵɵadvance(1);
27993
+ i0__namespace.ɵɵproperty("ngIf", !(ctx.autoHide && _r0.pages.length <= 1));
27973
27994
  }
27974
- }, directives: [i1__namespace$6.PaginationControlsDirective, i1__namespace.NgIf, i1__namespace.NgForOf], pipes: [i1__namespace.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}}"] });
27995
+ }, directives: [i1__namespace$6.PaginationControlsDirective, i1__namespace.NgIf, i1__namespace.NgForOf], pipes: [i1__namespace.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}}"] });
27975
27996
  (function () {
27976
27997
  (typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(PaginationComponent, [{
27977
27998
  type: i0.Component,