@hmcts/ccd-case-ui-toolkit 6.13.10-exui-110 → 6.13.10-exui-158

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.
@@ -30809,7 +30809,7 @@
30809
30809
  var _r34_1 = i0__namespace.ɵɵgetCurrentView();
30810
30810
  i0__namespace.ɵɵelementContainerStart(0);
30811
30811
  i0__namespace.ɵɵelementStart(1, "mat-tab-group", 23, 24);
30812
- i0__namespace.ɵɵlistener("selectedIndexChange", function CaseFullAccessViewComponent_ng_container_12_Template_mat_tab_group_selectedIndexChange_1_listener($event) { i0__namespace.ɵɵrestoreView(_r34_1); var ctx_r33 = i0__namespace.ɵɵnextContext(); return ctx_r33.tabChanged($event); });
30812
+ i0__namespace.ɵɵlistener("selectedTabChange", function CaseFullAccessViewComponent_ng_container_12_Template_mat_tab_group_selectedTabChange_1_listener($event) { i0__namespace.ɵɵrestoreView(_r34_1); var ctx_r33 = i0__namespace.ɵɵnextContext(); return ctx_r33.tabChanged($event); });
30813
30813
  i0__namespace.ɵɵtemplate(3, CaseFullAccessViewComponent_ng_container_12_mat_tab_3_Template, 1, 2, "mat-tab", 25);
30814
30814
  i0__namespace.ɵɵtemplate(4, CaseFullAccessViewComponent_ng_container_12_mat_tab_4_Template, 2, 2, "mat-tab", 25);
30815
30815
  i0__namespace.ɵɵtemplate(5, CaseFullAccessViewComponent_ng_container_12_mat_tab_5_Template, 1, 2, "mat-tab", 25);
@@ -30925,9 +30925,10 @@
30925
30925
  if (url) {
30926
30926
  var tabUrl = url ? url.split('#') : null;
30927
30927
  var tab_1 = tabUrl && tabUrl.length > 1 ? tabUrl[tabUrl.length - 1].replaceAll('%20', ' ') : '';
30928
- // Refactored under EXUI-110 to address infinite tab loop
30929
- var tabIndex = _this.tabGroup._tabs.toArray().findIndex(function (t) { return t.textLabel.toLowerCase() === tab_1.toLowerCase(); });
30930
- _this.selectedTabIndex = tabIndex || 0;
30928
+ var matTab = _this.tabGroup._tabs.find(function (x) { return x.textLabel.toLowerCase() === tab_1.toLowerCase(); });
30929
+ if (matTab && matTab.position) {
30930
+ _this.tabGroup.selectedIndex = matTab.position;
30931
+ }
30931
30932
  }
30932
30933
  });
30933
30934
  };
@@ -31053,11 +31054,23 @@
31053
31054
  }
31054
31055
  }
31055
31056
  };
31056
- CaseFullAccessViewComponent.prototype.tabChanged = function (tabIndexChanged) {
31057
- // Refactored under EXUI-110 to address infinite tab loop
31058
- var matTab = this.tabGroup._tabs.find(function (tab) { return tab.isActive; });
31059
- var tabLabel = matTab.textLabel;
31060
- this.router.navigate(['cases', 'case-details', this.caseDetails.case_id], { fragment: tabLabel });
31057
+ CaseFullAccessViewComponent.prototype.tabChanged = function (tabChangeEvent) {
31058
+ // Update selected tab index
31059
+ this.selectedTabIndex = tabChangeEvent.index;
31060
+ var tab = tabChangeEvent.tab['_viewContainerRef'];
31061
+ var id = tab.element.nativeElement.id;
31062
+ // due to some edge case like hidden tab we can't calculate the last index of existing tabs,
31063
+ // so have to hard code the hearings id here
31064
+ if ((tabChangeEvent.index <= 1 && this.prependedTabs && this.prependedTabs.length) ||
31065
+ (this.appendedTabs && this.appendedTabs.length && id === 'hearings')) {
31066
+ this.router.navigate([id], { relativeTo: this.route });
31067
+ }
31068
+ else {
31069
+ var label_1 = tabChangeEvent.tab.textLabel;
31070
+ this.router.navigate(['cases', 'case-details', this.caseDetails.case_id]).then(function () {
31071
+ window.location.hash = label_1;
31072
+ });
31073
+ }
31061
31074
  };
31062
31075
  CaseFullAccessViewComponent.prototype.onLinkClicked = function (triggerOutputEventText) {
31063
31076
  // Get the *absolute* (not relative) index of the target tab and set as the active tab, using the selectedIndex input
@@ -31170,7 +31183,7 @@
31170
31183
  var _t = void 0;
31171
31184
  i0__namespace.ɵɵqueryRefresh(_t = i0__namespace.ɵɵloadQuery()) && (ctx.tabGroup = _t.first);
31172
31185
  }
31173
- }, inputs: { hasPrint: "hasPrint", hasEventSelector: "hasEventSelector", caseDetails: "caseDetails", prependedTabs: "prependedTabs", appendedTabs: "appendedTabs" }, features: [i0__namespace.ɵɵNgOnChangesFeature], decls: 13, vars: 12, consts: [["class", "error-summary", "role", "group", "aria-labelledby", "edit-case-event_error-summary-heading", "tabindex", "-1", 4, "ngIf"], [3, "triggerTextContinue", "triggerTextIgnore", "callbackErrorsSubject", "callbackErrorsContext"], [3, "caseId", "displayMode"], [1, "grid-row"], [1, "column-one-half"], [3, "caseDetails"], ["class", "case-viewer-controls", 4, "ngIf"], ["class", "column-one-half", 4, "ngIf"], ["class", "grid-row", 4, "ngIf"], [1, "column-full"], [4, "ngIf"], ["role", "group", "aria-labelledby", "edit-case-event_error-summary-heading", "tabindex", "-1", 1, "error-summary"], ["id", "edit-case-event_error-summary-heading", 1, "heading-h1", "error-summary-heading"], ["id", "edit-case-event_error-summary-body", 1, "govuk-error-summary__body"], ["href", "get-help", "target", "_blank"], ["id", "edit-case-event_error-summary-heading", 1, "heading-h2", "error-summary-heading"], ["class", "error-summary-list", 4, "ngIf"], [1, "error-summary-list"], [4, "ngFor", "ngForOf"], [1, "case-viewer-controls"], ["id", "case-viewer-control-print", "routerLink", "print", 1, "button", "button-secondary"], [3, "isDisabled", "triggers", "triggerText", "onTriggerChange", "onTriggerSubmit"], [3, "notificationBannerConfig", "linkClicked"], ["animationDuration", "0ms", 3, "disableRipple", "selectedIndex", "selectedIndexChange"], ["tabGroup", ""], [3, "id", "label", 4, "ngFor", "ngForOf"], [3, "id", "label"], ["matTabContent", ""], ["aria-describedby", "case viewer table"], ["ccdLabelSubstitutor", "", 3, "caseField", "contextFields", "hidden"], [3, "ngSwitch"], [4, "ngSwitchCase"], ["class", "compound-field", 4, "ngSwitchCase"], ["id", "case-viewer-field-label", 4, "ngIf"], ["scope", "col", 3, "id"], [1, "text-16"], [3, "topLevelFormGroup", "caseField", "caseReference", "markdownUseHrefAsRouterLink"], ["id", "case-viewer-field-label"], [1, "case-viewer-label", "text-16"], [1, "compound-field"]], template: function CaseFullAccessViewComponent_Template(rf, ctx) {
31186
+ }, inputs: { hasPrint: "hasPrint", hasEventSelector: "hasEventSelector", caseDetails: "caseDetails", prependedTabs: "prependedTabs", appendedTabs: "appendedTabs" }, features: [i0__namespace.ɵɵNgOnChangesFeature], decls: 13, vars: 12, consts: [["class", "error-summary", "role", "group", "aria-labelledby", "edit-case-event_error-summary-heading", "tabindex", "-1", 4, "ngIf"], [3, "triggerTextContinue", "triggerTextIgnore", "callbackErrorsSubject", "callbackErrorsContext"], [3, "caseId", "displayMode"], [1, "grid-row"], [1, "column-one-half"], [3, "caseDetails"], ["class", "case-viewer-controls", 4, "ngIf"], ["class", "column-one-half", 4, "ngIf"], ["class", "grid-row", 4, "ngIf"], [1, "column-full"], [4, "ngIf"], ["role", "group", "aria-labelledby", "edit-case-event_error-summary-heading", "tabindex", "-1", 1, "error-summary"], ["id", "edit-case-event_error-summary-heading", 1, "heading-h1", "error-summary-heading"], ["id", "edit-case-event_error-summary-body", 1, "govuk-error-summary__body"], ["href", "get-help", "target", "_blank"], ["id", "edit-case-event_error-summary-heading", 1, "heading-h2", "error-summary-heading"], ["class", "error-summary-list", 4, "ngIf"], [1, "error-summary-list"], [4, "ngFor", "ngForOf"], [1, "case-viewer-controls"], ["id", "case-viewer-control-print", "routerLink", "print", 1, "button", "button-secondary"], [3, "isDisabled", "triggers", "triggerText", "onTriggerChange", "onTriggerSubmit"], [3, "notificationBannerConfig", "linkClicked"], ["animationDuration", "0ms", 3, "disableRipple", "selectedIndex", "selectedTabChange"], ["tabGroup", ""], [3, "id", "label", 4, "ngFor", "ngForOf"], [3, "id", "label"], ["matTabContent", ""], ["aria-describedby", "case viewer table"], ["ccdLabelSubstitutor", "", 3, "caseField", "contextFields", "hidden"], [3, "ngSwitch"], [4, "ngSwitchCase"], ["class", "compound-field", 4, "ngSwitchCase"], ["id", "case-viewer-field-label", 4, "ngIf"], ["scope", "col", 3, "id"], [1, "text-16"], [3, "topLevelFormGroup", "caseField", "caseReference", "markdownUseHrefAsRouterLink"], ["id", "case-viewer-field-label"], [1, "case-viewer-label", "text-16"], [1, "compound-field"]], template: function CaseFullAccessViewComponent_Template(rf, ctx) {
31174
31187
  if (rf & 1) {
31175
31188
  i0__namespace.ɵɵtemplate(0, CaseFullAccessViewComponent_div_0_Template, 10, 0, "div", 0);
31176
31189
  i0__namespace.ɵɵtemplate(1, CaseFullAccessViewComponent_div_1_Template, 6, 2, "div", 0);