@skyux/tabs 7.0.0-beta.5 → 7.0.0-beta.6

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 (40) hide show
  1. package/documentation.json +664 -557
  2. package/esm2020/lib/modules/sectioned-form/sectioned-form.component.mjs +2 -2
  3. package/esm2020/lib/modules/tabs/tab-button-view-model.mjs +1 -1
  4. package/esm2020/lib/modules/tabs/tab-button.component.mjs +5 -3
  5. package/esm2020/lib/modules/tabs/tab.component.mjs +73 -33
  6. package/esm2020/lib/modules/tabs/tabs.module.mjs +5 -2
  7. package/esm2020/lib/modules/tabs/tabset-adapter.service.mjs +34 -22
  8. package/esm2020/lib/modules/tabs/tabset-nav-button-disabled.pipe.mjs +22 -0
  9. package/esm2020/lib/modules/tabs/tabset-nav-button.component.mjs +17 -23
  10. package/esm2020/lib/modules/tabs/tabset-permalink.service.mjs +41 -35
  11. package/esm2020/lib/modules/tabs/tabset-tab-indexes-change.mjs +1 -1
  12. package/esm2020/lib/modules/tabs/tabset.component.mjs +220 -216
  13. package/esm2020/lib/modules/tabs/tabset.service.mjs +67 -51
  14. package/esm2020/lib/modules/vertical-tabset/vertical-tab.component.mjs +5 -3
  15. package/esm2020/lib/modules/vertical-tabset/vertical-tabset-group.component.mjs +2 -2
  16. package/esm2020/lib/modules/vertical-tabset/vertical-tabset.component.mjs +2 -2
  17. package/esm2020/testing/tabs/tab-fixture-tab.mjs +1 -1
  18. package/esm2020/testing/tabs/tabset-fixture.mjs +44 -47
  19. package/fesm2015/skyux-tabs-testing.mjs +47 -49
  20. package/fesm2015/skyux-tabs-testing.mjs.map +1 -1
  21. package/fesm2015/skyux-tabs.mjs +478 -383
  22. package/fesm2015/skyux-tabs.mjs.map +1 -1
  23. package/fesm2020/skyux-tabs-testing.mjs +43 -46
  24. package/fesm2020/skyux-tabs-testing.mjs.map +1 -1
  25. package/fesm2020/skyux-tabs.mjs +597 -504
  26. package/fesm2020/skyux-tabs.mjs.map +1 -1
  27. package/lib/modules/tabs/tab-button-view-model.d.ts +5 -5
  28. package/lib/modules/tabs/tab-button.component.d.ts +9 -9
  29. package/lib/modules/tabs/tab.component.d.ts +13 -18
  30. package/lib/modules/tabs/tabs.module.d.ts +9 -8
  31. package/lib/modules/tabs/tabset-adapter.service.d.ts +5 -10
  32. package/lib/modules/tabs/tabset-nav-button-disabled.pipe.d.ts +8 -0
  33. package/lib/modules/tabs/tabset-nav-button.component.d.ts +8 -6
  34. package/lib/modules/tabs/tabset-permalink.service.d.ts +3 -11
  35. package/lib/modules/tabs/tabset-tab-indexes-change.d.ts +2 -2
  36. package/lib/modules/tabs/tabset.component.d.ts +10 -53
  37. package/lib/modules/tabs/tabset.service.d.ts +8 -12
  38. package/package.json +9 -9
  39. package/testing/tabs/tab-fixture-tab.d.ts +3 -3
  40. package/testing/tabs/tabset-fixture.d.ts +3 -9
@@ -1,7 +1,7 @@
1
1
  import * as i4 from '@angular/common';
2
2
  import { CommonModule } from '@angular/common';
3
3
  import * as i0 from '@angular/core';
4
- import { NgModule, Injectable, Component, ChangeDetectionStrategy, Input, ViewChild, HostListener, ContentChildren, EventEmitter, Output, ViewEncapsulation } from '@angular/core';
4
+ import { NgModule, Injectable, Component, ChangeDetectionStrategy, Input, ViewChild, HostListener, ContentChildren, EventEmitter, Output, ViewEncapsulation, Pipe } from '@angular/core';
5
5
  import { SkyCheckboxModule } from '@skyux/forms';
6
6
  import * as i7 from '@skyux/theme';
7
7
  import { SkyThemeModule } from '@skyux/theme';
@@ -502,7 +502,9 @@ _SkyVerticalTabComponent__ariaRole = new WeakMap(), _SkyVerticalTabComponent__co
502
502
  const width = __classPrivateFieldGet(this, _SkyVerticalTabComponent_adapterService, "f").getWidth(this.tabContent);
503
503
  __classPrivateFieldGet(this, _SkyVerticalTabComponent_verticalTabMediaQueryService, "f").setBreakpointForWidth(width);
504
504
  const newBreakpoint = __classPrivateFieldGet(this, _SkyVerticalTabComponent_verticalTabMediaQueryService, "f").current;
505
- __classPrivateFieldGet(this, _SkyVerticalTabComponent_adapterService, "f").setResponsiveClass(this.tabContent, newBreakpoint);
505
+ if (newBreakpoint) {
506
+ __classPrivateFieldGet(this, _SkyVerticalTabComponent_adapterService, "f").setResponsiveClass(this.tabContent, newBreakpoint);
507
+ }
506
508
  __classPrivateFieldGet(this, _SkyVerticalTabComponent_changeRef, "f").markForCheck();
507
509
  }
508
510
  };
@@ -1033,27 +1035,37 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
1033
1035
  type: Injectable
1034
1036
  }] });
1035
1037
 
1038
+ var _SkyTabsetService_instances, _SkyTabsetService_activeTabIndex, _SkyTabsetService_focusedTabBtnIndex, _SkyTabsetService_activeTabUnregistered, _SkyTabsetService_tabs, _SkyTabsetService_tabCounter, _SkyTabsetService_isTabIndexActive, _SkyTabsetService_getNextTabArrayIndex, _SkyTabsetService_getPrevTabArrayIndex;
1036
1039
  /**
1037
1040
  * @internal
1038
1041
  */
1039
1042
  class SkyTabsetService {
1040
1043
  constructor() {
1044
+ _SkyTabsetService_instances.add(this);
1041
1045
  this.currentActiveTabIndex = 0;
1042
1046
  this.currentFocusedTabBtnIndex = 0;
1043
- this._activeTabIndex = new BehaviorSubject(0);
1044
- this._focusedTabBtnIndex = new Subject();
1045
- this._activeTabUnregistered = new Subject();
1046
- this.tabs = [];
1047
- this.tabCounter = 0;
1047
+ _SkyTabsetService_activeTabIndex.set(this, void 0);
1048
+ _SkyTabsetService_focusedTabBtnIndex.set(this, void 0);
1049
+ _SkyTabsetService_activeTabUnregistered.set(this, void 0);
1050
+ _SkyTabsetService_tabs.set(this, []);
1051
+ _SkyTabsetService_tabCounter.set(this, 0);
1052
+ __classPrivateFieldSet(this, _SkyTabsetService_activeTabIndex, new BehaviorSubject(0), "f");
1053
+ __classPrivateFieldSet(this, _SkyTabsetService_activeTabUnregistered, new Subject(), "f");
1054
+ __classPrivateFieldSet(this, _SkyTabsetService_focusedTabBtnIndex, new Subject(), "f");
1048
1055
  }
1049
1056
  get activeTabUnregistered() {
1050
- return this._activeTabUnregistered.asObservable();
1057
+ return __classPrivateFieldGet(this, _SkyTabsetService_activeTabUnregistered, "f");
1051
1058
  }
1052
1059
  get activeTabIndex() {
1053
- return this._activeTabIndex.asObservable();
1060
+ return __classPrivateFieldGet(this, _SkyTabsetService_activeTabIndex, "f");
1054
1061
  }
1055
1062
  get focusedTabBtnIndex() {
1056
- return this._focusedTabBtnIndex.asObservable();
1063
+ return __classPrivateFieldGet(this, _SkyTabsetService_focusedTabBtnIndex, "f");
1064
+ }
1065
+ ngOnDestroy() {
1066
+ __classPrivateFieldGet(this, _SkyTabsetService_activeTabIndex, "f").complete();
1067
+ __classPrivateFieldGet(this, _SkyTabsetService_activeTabUnregistered, "f").complete();
1068
+ __classPrivateFieldGet(this, _SkyTabsetService_focusedTabBtnIndex, "f").complete();
1057
1069
  }
1058
1070
  /**
1059
1071
  * Sets the active tab by its unique `tabIndex` property.
@@ -1066,26 +1078,26 @@ class SkyTabsetService {
1066
1078
  this.currentActiveTabIndex = value;
1067
1079
  /* istanbul ignore else */
1068
1080
  if (config.emitChange) {
1069
- this._activeTabIndex.next(value);
1081
+ __classPrivateFieldGet(this, _SkyTabsetService_activeTabIndex, "f").next(value);
1070
1082
  }
1071
1083
  this.setFocusedTabBtnIndex(value);
1072
1084
  }
1073
1085
  }
1074
1086
  focusNextTabBtn(tabButtons) {
1075
- const currentTabArrayIndex = this.tabs.findIndex((tab) => this.tabIndexesEqual(tab.tabIndex, this.currentFocusedTabBtnIndex));
1076
- for (let i = this.getNextTabArrayIndex(currentTabArrayIndex); i !== currentTabArrayIndex; i = this.getNextTabArrayIndex(i)) {
1087
+ const currentTabArrayIndex = __classPrivateFieldGet(this, _SkyTabsetService_tabs, "f").findIndex((tab) => this.tabIndexesEqual(tab.tabIndex, this.currentFocusedTabBtnIndex));
1088
+ for (let i = __classPrivateFieldGet(this, _SkyTabsetService_instances, "m", _SkyTabsetService_getNextTabArrayIndex).call(this, currentTabArrayIndex); i !== currentTabArrayIndex; i = __classPrivateFieldGet(this, _SkyTabsetService_instances, "m", _SkyTabsetService_getNextTabArrayIndex).call(this, i)) {
1077
1089
  const tabBtn = tabButtons[i];
1078
- if (!tabBtn.disabled) {
1090
+ if (!tabBtn.disabled && tabBtn.tabIndex !== undefined) {
1079
1091
  this.setFocusedTabBtnIndex(tabBtn.tabIndex);
1080
1092
  return;
1081
1093
  }
1082
1094
  }
1083
1095
  }
1084
1096
  focusPrevTabBtn(tabButtons) {
1085
- const currentTabArrayIndex = this.tabs.findIndex((tab) => this.tabIndexesEqual(tab.tabIndex, this.currentFocusedTabBtnIndex));
1086
- for (let i = this.getPrevTabArrayIndex(currentTabArrayIndex); i !== currentTabArrayIndex; i = this.getPrevTabArrayIndex(i)) {
1097
+ const currentTabArrayIndex = __classPrivateFieldGet(this, _SkyTabsetService_tabs, "f").findIndex((tab) => this.tabIndexesEqual(tab.tabIndex, this.currentFocusedTabBtnIndex));
1098
+ for (let i = __classPrivateFieldGet(this, _SkyTabsetService_instances, "m", _SkyTabsetService_getPrevTabArrayIndex).call(this, currentTabArrayIndex); i !== currentTabArrayIndex; i = __classPrivateFieldGet(this, _SkyTabsetService_instances, "m", _SkyTabsetService_getPrevTabArrayIndex).call(this, i)) {
1087
1099
  const tabBtn = tabButtons[i];
1088
- if (!tabBtn.disabled) {
1100
+ if (!tabBtn.disabled && tabBtn.tabIndex !== undefined) {
1089
1101
  this.setFocusedTabBtnIndex(tabBtn.tabIndex);
1090
1102
  return;
1091
1103
  }
@@ -1094,7 +1106,7 @@ class SkyTabsetService {
1094
1106
  focusFirstOrNearestTabBtn(tabButtons) {
1095
1107
  for (let i = 0; i < tabButtons.length; i++) {
1096
1108
  const tabBtn = tabButtons[i];
1097
- if (!tabBtn.disabled) {
1109
+ if (!tabBtn.disabled && tabBtn.tabIndex !== undefined) {
1098
1110
  this.setFocusedTabBtnIndex(tabBtn.tabIndex);
1099
1111
  return;
1100
1112
  }
@@ -1103,7 +1115,7 @@ class SkyTabsetService {
1103
1115
  focusLastOrNearestTabBtn(tabButtons) {
1104
1116
  for (let i = tabButtons.length - 1; i >= 0; i--) {
1105
1117
  const tabBtn = tabButtons[i];
1106
- if (!tabBtn.disabled) {
1118
+ if (!tabBtn.disabled && tabBtn.tabIndex !== undefined) {
1107
1119
  this.setFocusedTabBtnIndex(tabBtn.tabIndex);
1108
1120
  return;
1109
1121
  }
@@ -1111,97 +1123,102 @@ class SkyTabsetService {
1111
1123
  }
1112
1124
  setFocusedTabBtnIndex(tabIndex) {
1113
1125
  this.currentFocusedTabBtnIndex = tabIndex;
1114
- this._focusedTabBtnIndex.next(tabIndex);
1126
+ __classPrivateFieldGet(this, _SkyTabsetService_focusedTabBtnIndex, "f").next(tabIndex);
1115
1127
  }
1116
1128
  /**
1117
1129
  * Registers a tab component.
1118
1130
  */
1119
1131
  registerTab(tabIndex) {
1132
+ var _a;
1120
1133
  if (tabIndex === undefined) {
1121
- tabIndex = this.tabCounter;
1122
- this.tabCounter++;
1134
+ tabIndex = __classPrivateFieldGet(this, _SkyTabsetService_tabCounter, "f");
1135
+ __classPrivateFieldSet(this, _SkyTabsetService_tabCounter, (_a = __classPrivateFieldGet(this, _SkyTabsetService_tabCounter, "f"), _a++, _a), "f");
1123
1136
  }
1124
- this.tabs.push({ tabIndex });
1137
+ __classPrivateFieldGet(this, _SkyTabsetService_tabs, "f").push({ tabIndex });
1125
1138
  return tabIndex;
1126
1139
  }
1127
1140
  updateTabIndex(currentTabIndex, newTabIndex) {
1128
- const found = this.tabs.find((tab) => this.tabIndexesEqual(tab.tabIndex, currentTabIndex));
1129
- found.tabIndex = newTabIndex;
1141
+ const found = __classPrivateFieldGet(this, _SkyTabsetService_tabs, "f").find((tab) => this.tabIndexesEqual(tab.tabIndex, currentTabIndex));
1142
+ if (found) {
1143
+ found.tabIndex = newTabIndex;
1144
+ }
1130
1145
  }
1131
1146
  /**
1132
1147
  * Unregisters a tab component.
1133
1148
  */
1134
1149
  unregisterTab(tabIndex) {
1135
- var _a;
1136
- const index = this.tabs.findIndex((tab) => this.tabIndexesEqual(tab.tabIndex, tabIndex));
1150
+ var _b;
1151
+ const index = __classPrivateFieldGet(this, _SkyTabsetService_tabs, "f").findIndex((tab) => this.tabIndexesEqual(tab.tabIndex, tabIndex));
1137
1152
  // Notify the tabset component when an active tab is unregistered.
1138
- if (this.isTabIndexActive((_a = this.tabs[index]) === null || _a === void 0 ? void 0 : _a.tabIndex)) {
1139
- this._activeTabUnregistered.next({
1153
+ if (__classPrivateFieldGet(this, _SkyTabsetService_instances, "m", _SkyTabsetService_isTabIndexActive).call(this, (_b = __classPrivateFieldGet(this, _SkyTabsetService_tabs, "f")[index]) === null || _b === void 0 ? void 0 : _b.tabIndex)) {
1154
+ __classPrivateFieldGet(this, _SkyTabsetService_activeTabUnregistered, "f").next({
1140
1155
  arrayIndex: index,
1141
1156
  });
1142
1157
  }
1143
- this.tabs.splice(index, 1);
1158
+ __classPrivateFieldGet(this, _SkyTabsetService_tabs, "f").splice(index, 1);
1144
1159
  }
1145
1160
  /**
1146
1161
  * Unregisters all tab components at once.
1147
1162
  */
1148
1163
  unregisterAll() {
1149
- this.tabs = [];
1164
+ __classPrivateFieldSet(this, _SkyTabsetService_tabs, [], "f");
1150
1165
  }
1151
1166
  /**
1152
1167
  * Compares two tab indexes and returns `true` if they are equal.
1153
1168
  */
1154
1169
  tabIndexesEqual(tabIndex1, tabIndex2) {
1155
- return tabIndex1 === tabIndex2 || +tabIndex1 === +tabIndex2;
1170
+ return (tabIndex1 === tabIndex2 ||
1171
+ (tabIndex1 !== undefined &&
1172
+ tabIndex2 !== undefined &&
1173
+ +tabIndex1 === +tabIndex2));
1156
1174
  }
1157
1175
  /**
1158
1176
  * Verifies if a provided tab index is registered.
1159
1177
  */
1160
1178
  isValidTabIndex(tabIndex) {
1161
- return this.tabs.some((tab) => this.tabIndexesEqual(tab.tabIndex, tabIndex));
1179
+ return __classPrivateFieldGet(this, _SkyTabsetService_tabs, "f").some((tab) => this.tabIndexesEqual(tab.tabIndex, tabIndex));
1162
1180
  }
1163
1181
  /**
1164
1182
  * Activates the first registered tab.
1165
1183
  */
1166
1184
  activateFirstTab() {
1167
- const firstTabIndex = this.tabs[0] && this.tabs[0].tabIndex;
1185
+ const firstTabIndex = __classPrivateFieldGet(this, _SkyTabsetService_tabs, "f")[0] && __classPrivateFieldGet(this, _SkyTabsetService_tabs, "f")[0].tabIndex;
1168
1186
  if (firstTabIndex !== undefined) {
1169
1187
  this.setActiveTabIndex(firstTabIndex);
1170
1188
  return firstTabIndex;
1171
1189
  }
1190
+ return undefined;
1172
1191
  }
1173
1192
  /**
1174
1193
  * Activates the next registered tab, or the previous one based on a provided array index.
1175
1194
  */
1176
1195
  activateNearestTab(arrayIndex) {
1177
- const newActiveTab = this.tabs[arrayIndex] || this.tabs[arrayIndex - 1];
1196
+ const newActiveTab = __classPrivateFieldGet(this, _SkyTabsetService_tabs, "f")[arrayIndex] || __classPrivateFieldGet(this, _SkyTabsetService_tabs, "f")[arrayIndex - 1];
1178
1197
  if (newActiveTab) {
1179
1198
  this.currentActiveTabIndex = newActiveTab.tabIndex;
1180
1199
  }
1181
1200
  }
1182
- isTabIndexActive(tabIndex) {
1183
- return this.tabIndexesEqual(tabIndex, this.currentActiveTabIndex);
1184
- }
1185
- getNextTabArrayIndex(currentIndex) {
1186
- let nextIndex = currentIndex + 1;
1187
- if (nextIndex === this.tabs.length) {
1188
- nextIndex = 0;
1189
- }
1190
- return nextIndex;
1191
- }
1192
- getPrevTabArrayIndex(currentIndex) {
1193
- let prevIndex = currentIndex - 1;
1194
- if (prevIndex < 0) {
1195
- prevIndex = this.tabs.length - 1;
1196
- }
1197
- return prevIndex;
1198
- }
1199
1201
  }
1202
+ _SkyTabsetService_activeTabIndex = new WeakMap(), _SkyTabsetService_focusedTabBtnIndex = new WeakMap(), _SkyTabsetService_activeTabUnregistered = new WeakMap(), _SkyTabsetService_tabs = new WeakMap(), _SkyTabsetService_tabCounter = new WeakMap(), _SkyTabsetService_instances = new WeakSet(), _SkyTabsetService_isTabIndexActive = function _SkyTabsetService_isTabIndexActive(tabIndex) {
1203
+ return this.tabIndexesEqual(tabIndex, this.currentActiveTabIndex);
1204
+ }, _SkyTabsetService_getNextTabArrayIndex = function _SkyTabsetService_getNextTabArrayIndex(currentIndex) {
1205
+ let nextIndex = currentIndex + 1;
1206
+ if (nextIndex === __classPrivateFieldGet(this, _SkyTabsetService_tabs, "f").length) {
1207
+ nextIndex = 0;
1208
+ }
1209
+ return nextIndex;
1210
+ }, _SkyTabsetService_getPrevTabArrayIndex = function _SkyTabsetService_getPrevTabArrayIndex(currentIndex) {
1211
+ let prevIndex = currentIndex - 1;
1212
+ if (prevIndex < 0) {
1213
+ prevIndex = __classPrivateFieldGet(this, _SkyTabsetService_tabs, "f").length - 1;
1214
+ }
1215
+ return prevIndex;
1216
+ };
1200
1217
  SkyTabsetService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyTabsetService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1201
1218
  SkyTabsetService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyTabsetService });
1202
1219
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyTabsetService, decorators: [{
1203
1220
  type: Injectable
1204
- }] });
1221
+ }], ctorParameters: function () { return []; } });
1205
1222
 
1206
1223
  var _SkyTabButtonComponent_instances, _SkyTabButtonComponent__isActive, _SkyTabButtonComponent__isDisabled, _SkyTabButtonComponent__tabStyle, _SkyTabButtonComponent_adapterService, _SkyTabButtonComponent_changeDetectorRef, _SkyTabButtonComponent_elementRef, _SkyTabButtonComponent_tabsetService, _SkyTabButtonComponent_ngUnsubscribe, _SkyTabButtonComponent_updateWizardStepState;
1207
1224
  const DEFAULT_DISABLED = false;
@@ -1252,7 +1269,7 @@ class SkyTabButtonComponent {
1252
1269
  __classPrivateFieldGet(this, _SkyTabButtonComponent_tabsetService, "f").focusedTabBtnIndex
1253
1270
  .pipe(distinctUntilChanged(), takeUntil(__classPrivateFieldGet(this, _SkyTabButtonComponent_ngUnsubscribe, "f")))
1254
1271
  .subscribe((focusedIndex) => {
1255
- if (focusedIndex === this.tabIndex) {
1272
+ if (this.tabIndex !== undefined && focusedIndex === this.tabIndex) {
1256
1273
  this.closeBtnTabIndex = '0';
1257
1274
  this.focusBtn();
1258
1275
  }
@@ -1297,7 +1314,9 @@ class SkyTabButtonComponent {
1297
1314
  __classPrivateFieldGet(this, _SkyTabButtonComponent_adapterService, "f").focusButtonLink(__classPrivateFieldGet(this, _SkyTabButtonComponent_elementRef, "f"));
1298
1315
  }
1299
1316
  onFocus() {
1300
- __classPrivateFieldGet(this, _SkyTabButtonComponent_tabsetService, "f").setFocusedTabBtnIndex(this.tabIndex);
1317
+ if (this.tabIndex !== undefined) {
1318
+ __classPrivateFieldGet(this, _SkyTabButtonComponent_tabsetService, "f").setFocusedTabBtnIndex(this.tabIndex);
1319
+ }
1301
1320
  }
1302
1321
  }
1303
1322
  _SkyTabButtonComponent__isActive = new WeakMap(), _SkyTabButtonComponent__isDisabled = new WeakMap(), _SkyTabButtonComponent__tabStyle = new WeakMap(), _SkyTabButtonComponent_adapterService = new WeakMap(), _SkyTabButtonComponent_changeDetectorRef = new WeakMap(), _SkyTabButtonComponent_elementRef = new WeakMap(), _SkyTabButtonComponent_tabsetService = new WeakMap(), _SkyTabButtonComponent_ngUnsubscribe = new WeakMap(), _SkyTabButtonComponent_instances = new WeakSet(), _SkyTabButtonComponent_updateWizardStepState = function _SkyTabButtonComponent_updateWizardStepState() {
@@ -1352,40 +1371,48 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
1352
1371
  type: Output
1353
1372
  }] } });
1354
1373
 
1374
+ var _SkyTabsetPermalinkService_instances, _SkyTabsetPermalinkService_popStateChange, _SkyTabsetPermalinkService_subscription, _SkyTabsetPermalinkService_activatedRoute, _SkyTabsetPermalinkService_location, _SkyTabsetPermalinkService_router, _SkyTabsetPermalinkService_getParams;
1355
1375
  /**
1356
1376
  * @internal
1357
1377
  */
1358
1378
  class SkyTabsetPermalinkService {
1359
1379
  constructor(activatedRoute, location, router) {
1360
- this.activatedRoute = activatedRoute;
1361
- this.location = location;
1362
- this.router = router;
1363
- this._popStateChange = new Subject();
1380
+ _SkyTabsetPermalinkService_instances.add(this);
1381
+ _SkyTabsetPermalinkService_popStateChange.set(this, void 0);
1382
+ _SkyTabsetPermalinkService_subscription.set(this, void 0);
1383
+ _SkyTabsetPermalinkService_activatedRoute.set(this, void 0);
1384
+ _SkyTabsetPermalinkService_location.set(this, void 0);
1385
+ _SkyTabsetPermalinkService_router.set(this, void 0);
1386
+ __classPrivateFieldSet(this, _SkyTabsetPermalinkService_activatedRoute, activatedRoute, "f");
1387
+ __classPrivateFieldSet(this, _SkyTabsetPermalinkService_location, location, "f");
1388
+ __classPrivateFieldSet(this, _SkyTabsetPermalinkService_router, router, "f");
1389
+ __classPrivateFieldSet(this, _SkyTabsetPermalinkService_popStateChange, new Subject(), "f");
1364
1390
  }
1365
1391
  get popStateChange() {
1366
- return this._popStateChange.asObservable();
1392
+ return __classPrivateFieldGet(this, _SkyTabsetPermalinkService_popStateChange, "f");
1367
1393
  }
1368
1394
  ngOnDestroy() {
1369
- if (this.subscription) {
1370
- this.subscription.unsubscribe();
1395
+ if (__classPrivateFieldGet(this, _SkyTabsetPermalinkService_subscription, "f")) {
1396
+ __classPrivateFieldGet(this, _SkyTabsetPermalinkService_subscription, "f").unsubscribe();
1371
1397
  }
1398
+ __classPrivateFieldGet(this, _SkyTabsetPermalinkService_popStateChange, "f").complete();
1372
1399
  }
1373
1400
  init() {
1374
- this.subscription = this.location.subscribe(() => {
1375
- this._popStateChange.next();
1376
- });
1401
+ __classPrivateFieldSet(this, _SkyTabsetPermalinkService_subscription, __classPrivateFieldGet(this, _SkyTabsetPermalinkService_location, "f").subscribe(() => {
1402
+ __classPrivateFieldGet(this, _SkyTabsetPermalinkService_popStateChange, "f").next();
1403
+ }), "f");
1377
1404
  }
1378
1405
  /**
1379
1406
  * Returns the value of a URL query param.
1380
1407
  */
1381
1408
  getParam(name) {
1382
- return this.getParams()[name];
1409
+ return __classPrivateFieldGet(this, _SkyTabsetPermalinkService_instances, "m", _SkyTabsetPermalinkService_getParams).call(this)[name];
1383
1410
  }
1384
1411
  /**
1385
1412
  * Sets the value of a URL query param.
1386
1413
  */
1387
1414
  setParam(name, value) {
1388
- const params = this.getParams();
1415
+ const params = __classPrivateFieldGet(this, _SkyTabsetPermalinkService_instances, "m", _SkyTabsetPermalinkService_getParams).call(this);
1389
1416
  if (value === null) {
1390
1417
  delete params[name];
1391
1418
  }
@@ -1394,18 +1421,18 @@ class SkyTabsetPermalinkService {
1394
1421
  }
1395
1422
  // Update the URL without triggering a navigation state change.
1396
1423
  // See: https://stackoverflow.com/a/46486677
1397
- const url = this.router
1424
+ const url = __classPrivateFieldGet(this, _SkyTabsetPermalinkService_router, "f")
1398
1425
  .createUrlTree([], {
1399
- relativeTo: this.activatedRoute,
1426
+ relativeTo: __classPrivateFieldGet(this, _SkyTabsetPermalinkService_activatedRoute, "f"),
1400
1427
  queryParams: params,
1401
1428
  queryParamsHandling: 'merge',
1402
1429
  })
1403
1430
  .toString();
1404
1431
  // Abort redirect if the current URL is equal to the new URL.
1405
- if (this.location.isCurrentPathEqualTo(url)) {
1432
+ if (__classPrivateFieldGet(this, _SkyTabsetPermalinkService_location, "f").isCurrentPathEqualTo(url)) {
1406
1433
  return;
1407
1434
  }
1408
- this.location.go(url);
1435
+ __classPrivateFieldGet(this, _SkyTabsetPermalinkService_location, "f").go(url);
1409
1436
  }
1410
1437
  /**
1411
1438
  * Removes the provided query param from the URL.
@@ -1421,13 +1448,13 @@ class SkyTabsetPermalinkService {
1421
1448
  if (!name) {
1422
1449
  return null;
1423
1450
  }
1424
- const params = this.getParams();
1451
+ const params = __classPrivateFieldGet(this, _SkyTabsetPermalinkService_instances, "m", _SkyTabsetPermalinkService_getParams).call(this);
1425
1452
  params[name] = value;
1426
- const baseUrl = this.location.path().split('?')[0];
1453
+ const baseUrl = __classPrivateFieldGet(this, _SkyTabsetPermalinkService_location, "f").path().split('?')[0];
1427
1454
  const paramString = Object.keys(params)
1428
1455
  .map((k) => `${k}=${params[k]}`)
1429
1456
  .join('&');
1430
- return this.location.prepareExternalUrl(`${baseUrl}?${paramString}`);
1457
+ return __classPrivateFieldGet(this, _SkyTabsetPermalinkService_location, "f").prepareExternalUrl(`${baseUrl}?${paramString}`);
1431
1458
  }
1432
1459
  /**
1433
1460
  * Converts the provided string into a value that can be safely used in a URL.
@@ -1446,48 +1473,59 @@ class SkyTabsetPermalinkService {
1446
1473
  .replace(/--/g, '-');
1447
1474
  return sanitized;
1448
1475
  }
1449
- /**
1450
- * Returns all query params that exist in the current URL.
1451
- */
1452
- getParams() {
1453
- const params = {};
1454
- const path = this.location.path();
1455
- if (path.indexOf('?') === -1) {
1456
- return params;
1457
- }
1458
- const existingParamPairs = path.split('?')[1].split('&');
1459
- existingParamPairs.forEach((pair) => {
1460
- const fragments = pair.split('=');
1461
- params[fragments[0]] = decodeURIComponent(fragments[1]);
1462
- });
1476
+ }
1477
+ _SkyTabsetPermalinkService_popStateChange = new WeakMap(), _SkyTabsetPermalinkService_subscription = new WeakMap(), _SkyTabsetPermalinkService_activatedRoute = new WeakMap(), _SkyTabsetPermalinkService_location = new WeakMap(), _SkyTabsetPermalinkService_router = new WeakMap(), _SkyTabsetPermalinkService_instances = new WeakSet(), _SkyTabsetPermalinkService_getParams = function _SkyTabsetPermalinkService_getParams() {
1478
+ const params = {};
1479
+ const path = __classPrivateFieldGet(this, _SkyTabsetPermalinkService_location, "f").path();
1480
+ if (path.indexOf('?') === -1) {
1463
1481
  return params;
1464
1482
  }
1465
- }
1483
+ const existingParamPairs = path.split('?')[1].split('&');
1484
+ existingParamPairs.forEach((pair) => {
1485
+ const fragments = pair.split('=');
1486
+ params[fragments[0]] = decodeURIComponent(fragments[1]);
1487
+ });
1488
+ return params;
1489
+ };
1466
1490
  SkyTabsetPermalinkService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyTabsetPermalinkService, deps: [{ token: i1$1.ActivatedRoute }, { token: i4.Location }, { token: i1$1.Router }], target: i0.ɵɵFactoryTarget.Injectable });
1467
1491
  SkyTabsetPermalinkService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyTabsetPermalinkService });
1468
1492
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyTabsetPermalinkService, decorators: [{
1469
1493
  type: Injectable
1470
1494
  }], ctorParameters: function () { return [{ type: i1$1.ActivatedRoute }, { type: i4.Location }, { type: i1$1.Router }]; } });
1471
1495
 
1496
+ var _SkyTabComponent_instances, _SkyTabComponent__active, _SkyTabComponent_activeChange, _SkyTabComponent__permalinkValue, _SkyTabComponent_stateChange, _SkyTabComponent__tabHeading, _SkyTabComponent__tabIndex, _SkyTabComponent_tabIndexChange, _SkyTabComponent_changeDetector, _SkyTabComponent_permalinkService, _SkyTabComponent_tabsetService, _SkyTabComponent_setPermalinkValueOrDefault;
1472
1497
  let nextId = 0;
1473
1498
  class SkyTabComponent {
1474
1499
  constructor(changeDetector, permalinkService, tabsetService) {
1475
- this.changeDetector = changeDetector;
1476
- this.permalinkService = permalinkService;
1477
- this.tabsetService = tabsetService;
1500
+ _SkyTabComponent_instances.add(this);
1478
1501
  /**
1479
1502
  * Fires when users click the button to close the tab.
1480
1503
  * The close button is added to the tab when you specify a listener for this event.
1481
1504
  * This event only applies when the tabset's `tabStyle` is `"tabs"`.
1482
1505
  */
1483
1506
  this.close = new EventEmitter(); // eslint-disable-line @angular-eslint/no-output-native
1507
+ this.permalinkValueOrDefault = '';
1484
1508
  this.showContent = false;
1485
- this._activeChange = new BehaviorSubject(undefined);
1486
- this._stateChange = new BehaviorSubject(undefined);
1487
- this._tabIndexChange = new BehaviorSubject(undefined);
1509
+ _SkyTabComponent__active.set(this, false);
1510
+ _SkyTabComponent_activeChange.set(this, void 0);
1511
+ _SkyTabComponent__permalinkValue.set(this, void 0);
1512
+ _SkyTabComponent_stateChange.set(this, void 0);
1513
+ _SkyTabComponent__tabHeading.set(this, void 0);
1514
+ _SkyTabComponent__tabIndex.set(this, void 0);
1515
+ _SkyTabComponent_tabIndexChange.set(this, void 0);
1516
+ _SkyTabComponent_changeDetector.set(this, void 0);
1517
+ _SkyTabComponent_permalinkService.set(this, void 0);
1518
+ _SkyTabComponent_tabsetService.set(this, void 0);
1519
+ __classPrivateFieldSet(this, _SkyTabComponent_changeDetector, changeDetector, "f");
1520
+ __classPrivateFieldSet(this, _SkyTabComponent_permalinkService, permalinkService, "f");
1521
+ __classPrivateFieldSet(this, _SkyTabComponent_tabsetService, tabsetService, "f");
1488
1522
  const id = nextId++;
1489
1523
  this.tabPanelId = `sky-tab-${id}`;
1490
1524
  this.tabButtonId = `${this.tabPanelId}-nav-btn`;
1525
+ __classPrivateFieldSet(this, _SkyTabComponent_activeChange, new BehaviorSubject(undefined), "f");
1526
+ __classPrivateFieldSet(this, _SkyTabComponent_stateChange, new BehaviorSubject(undefined), "f");
1527
+ __classPrivateFieldSet(this, _SkyTabComponent_tabIndexChange, new BehaviorSubject(undefined), "f");
1528
+ __classPrivateFieldGet(this, _SkyTabComponent_instances, "m", _SkyTabComponent_setPermalinkValueOrDefault).call(this);
1491
1529
  }
1492
1530
  /**
1493
1531
  * Indicates whether the tab is active when the tabset loads. After initialization, the `active`
@@ -1495,16 +1533,16 @@ class SkyTabComponent {
1495
1533
  * @default false
1496
1534
  */
1497
1535
  set active(value) {
1498
- if (value !== undefined && value !== this._active) {
1499
- this._active = value;
1500
- this._activeChange.next();
1536
+ if (value !== undefined && !!value !== __classPrivateFieldGet(this, _SkyTabComponent__active, "f")) {
1537
+ __classPrivateFieldSet(this, _SkyTabComponent__active, value, "f");
1538
+ __classPrivateFieldGet(this, _SkyTabComponent_activeChange, "f").next();
1501
1539
  }
1502
1540
  }
1503
1541
  get active() {
1504
- return this._active || false;
1542
+ return __classPrivateFieldGet(this, _SkyTabComponent__active, "f");
1505
1543
  }
1506
1544
  get activeChange() {
1507
- return this._activeChange.asObservable();
1545
+ return __classPrivateFieldGet(this, _SkyTabComponent_activeChange, "f");
1508
1546
  }
1509
1547
  /**
1510
1548
  * Specifies a custom query parameter value for the tab.
@@ -1515,65 +1553,90 @@ class SkyTabComponent {
1515
1553
  * This input only applies when the tabset's `tabStyle` is `"tabs"`.
1516
1554
  */
1517
1555
  set permalinkValue(value) {
1518
- this._permalinkValue = this.permalinkService.urlify(value);
1556
+ __classPrivateFieldSet(this, _SkyTabComponent__permalinkValue, value, "f");
1557
+ __classPrivateFieldGet(this, _SkyTabComponent_instances, "m", _SkyTabComponent_setPermalinkValueOrDefault).call(this);
1519
1558
  }
1520
1559
  get permalinkValue() {
1521
- return (this._permalinkValue || this.permalinkService.urlify(this.tabHeading));
1560
+ return __classPrivateFieldGet(this, _SkyTabComponent__permalinkValue, "f");
1561
+ }
1562
+ /**
1563
+ * Specifies the tab header.
1564
+ * When using tabs as the main navigation on a page,
1565
+ * use [the Angular `Title` service](https://angular.io/docs/ts/latest/cookbook/set-document-title.html)
1566
+ * and [the SKY UX `title` configuration property](https://developer.blackbaud.com/skyux/learn/reference/configuration#app)
1567
+ * to reflect the tab header in the page title.
1568
+ * @required
1569
+ */
1570
+ set tabHeading(value) {
1571
+ __classPrivateFieldSet(this, _SkyTabComponent__tabHeading, value, "f");
1572
+ __classPrivateFieldGet(this, _SkyTabComponent_instances, "m", _SkyTabComponent_setPermalinkValueOrDefault).call(this);
1573
+ }
1574
+ get tabHeading() {
1575
+ return __classPrivateFieldGet(this, _SkyTabComponent__tabHeading, "f");
1522
1576
  }
1523
1577
  /**
1524
1578
  * Specifies a unique identifier for the tab.
1525
1579
  * If not defined, the identifier is set to the position of the tab on load, starting with `0`.
1526
1580
  */
1527
1581
  set tabIndex(value) {
1528
- if (value !== this._tabIndex &&
1582
+ if (value !== __classPrivateFieldGet(this, _SkyTabComponent__tabIndex, "f") &&
1529
1583
  value !== undefined &&
1530
- this._tabIndex !== undefined) {
1531
- this.tabsetService.updateTabIndex(this._tabIndex, value);
1532
- this._tabIndexChange.next(value);
1584
+ __classPrivateFieldGet(this, _SkyTabComponent__tabIndex, "f") !== undefined) {
1585
+ __classPrivateFieldGet(this, _SkyTabComponent_tabsetService, "f").updateTabIndex(__classPrivateFieldGet(this, _SkyTabComponent__tabIndex, "f"), value);
1586
+ __classPrivateFieldGet(this, _SkyTabComponent_tabIndexChange, "f").next(value);
1533
1587
  }
1534
- this._tabIndex = value;
1588
+ __classPrivateFieldSet(this, _SkyTabComponent__tabIndex, value, "f");
1535
1589
  }
1536
1590
  get tabIndex() {
1537
- return this._tabIndex;
1538
- }
1539
- get closeable() {
1540
- return this.close.observers.length > 0;
1591
+ return __classPrivateFieldGet(this, _SkyTabComponent__tabIndex, "f");
1541
1592
  }
1542
1593
  /**
1543
1594
  * Alerts the tabset component when this component has changes that need to be reflected in the UI.
1544
1595
  */
1545
1596
  get stateChange() {
1546
- return this._stateChange.asObservable();
1597
+ return __classPrivateFieldGet(this, _SkyTabComponent_stateChange, "f");
1547
1598
  }
1548
1599
  get tabIndexChange() {
1549
- return this._tabIndexChange.asObservable();
1600
+ return __classPrivateFieldGet(this, _SkyTabComponent_tabIndexChange, "f");
1550
1601
  }
1551
1602
  ngOnChanges(changes) {
1552
1603
  if ((changes.disabled && !changes.disabled.firstChange) ||
1553
1604
  (changes.tabHeading && !changes.tabHeading.firstChange) ||
1554
1605
  (changes.tabHeaderCount && !changes.tabHeaderCount.firstChange) ||
1555
1606
  (changes.permalinkValue && !changes.permalinkValue.firstChange)) {
1556
- this._stateChange.next();
1607
+ __classPrivateFieldGet(this, _SkyTabComponent_stateChange, "f").next();
1557
1608
  }
1558
1609
  }
1559
1610
  ngOnDestroy() {
1560
- this._stateChange.complete();
1561
- this.tabsetService.unregisterTab(this.tabIndex);
1611
+ __classPrivateFieldGet(this, _SkyTabComponent_activeChange, "f").complete();
1612
+ __classPrivateFieldGet(this, _SkyTabComponent_stateChange, "f").complete();
1613
+ __classPrivateFieldGet(this, _SkyTabComponent_tabIndexChange, "f").complete();
1614
+ if (this.tabIndex !== undefined) {
1615
+ __classPrivateFieldGet(this, _SkyTabComponent_tabsetService, "f").unregisterTab(this.tabIndex);
1616
+ }
1562
1617
  }
1563
1618
  init() {
1564
- this._tabIndex = this.tabsetService.registerTab(this.tabIndex);
1619
+ __classPrivateFieldSet(this, _SkyTabComponent__tabIndex, __classPrivateFieldGet(this, _SkyTabComponent_tabsetService, "f").registerTab(this.tabIndex), "f");
1565
1620
  }
1566
1621
  activate() {
1567
- this._active = true;
1622
+ __classPrivateFieldSet(this, _SkyTabComponent__active, true, "f");
1568
1623
  this.showContent = true;
1569
- this.changeDetector.markForCheck();
1624
+ __classPrivateFieldGet(this, _SkyTabComponent_changeDetector, "f").markForCheck();
1570
1625
  }
1571
1626
  deactivate() {
1572
- this._active = false;
1627
+ __classPrivateFieldSet(this, _SkyTabComponent__active, false, "f");
1573
1628
  this.showContent = false;
1574
- this.changeDetector.markForCheck();
1629
+ __classPrivateFieldGet(this, _SkyTabComponent_changeDetector, "f").markForCheck();
1630
+ }
1631
+ isCloseable() {
1632
+ return this.close.observers.length > 0;
1575
1633
  }
1576
1634
  }
1635
+ _SkyTabComponent__active = new WeakMap(), _SkyTabComponent_activeChange = new WeakMap(), _SkyTabComponent__permalinkValue = new WeakMap(), _SkyTabComponent_stateChange = new WeakMap(), _SkyTabComponent__tabHeading = new WeakMap(), _SkyTabComponent__tabIndex = new WeakMap(), _SkyTabComponent_tabIndexChange = new WeakMap(), _SkyTabComponent_changeDetector = new WeakMap(), _SkyTabComponent_permalinkService = new WeakMap(), _SkyTabComponent_tabsetService = new WeakMap(), _SkyTabComponent_instances = new WeakSet(), _SkyTabComponent_setPermalinkValueOrDefault = function _SkyTabComponent_setPermalinkValueOrDefault() {
1636
+ this.permalinkValueOrDefault =
1637
+ __classPrivateFieldGet(this, _SkyTabComponent_permalinkService, "f").urlify(this.permalinkValue) ||
1638
+ __classPrivateFieldGet(this, _SkyTabComponent_permalinkService, "f").urlify(this.tabHeading);
1639
+ };
1577
1640
  SkyTabComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyTabComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: SkyTabsetPermalinkService }, { token: SkyTabsetService }], target: i0.ɵɵFactoryTarget.Component });
1578
1641
  SkyTabComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: SkyTabComponent, selector: "sky-tab", inputs: { active: "active", disabled: "disabled", permalinkValue: "permalinkValue", tabHeaderCount: "tabHeaderCount", tabHeading: "tabHeading", tabIndex: "tabIndex" }, outputs: { close: "close" }, usesOnChanges: true, ngImport: i0, template: "<div\n class=\"sky-tab\"\n role=\"tabpanel\"\n [attr.aria-labelledby]=\"tabButtonId\"\n [hidden]=\"!showContent\"\n [id]=\"tabPanelId\"\n>\n <ng-content></ng-content>\n</div>\n", changeDetection: i0.ChangeDetectionStrategy.OnPush });
1579
1642
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyTabComponent, decorators: [{
@@ -1595,7 +1658,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
1595
1658
  type: Output
1596
1659
  }] } });
1597
1660
 
1598
- var _SkyTabsetNavButtonComponent_instances, _SkyTabsetNavButtonComponent__buttonType, _SkyTabsetNavButtonComponent__disabled, _SkyTabsetNavButtonComponent__tabset, _SkyTabsetNavButtonComponent_activeIndexNumber, _SkyTabsetNavButtonComponent_activeSkyTabIndex, _SkyTabsetNavButtonComponent_currentTabsetSub, _SkyTabsetNavButtonComponent_logger, _SkyTabsetNavButtonComponent_tabCount, _SkyTabsetNavButtonComponent_tabToSelect, _SkyTabsetNavButtonComponent_ngUnsubscribe, _SkyTabsetNavButtonComponent_updateButtonVisibility, _SkyTabsetNavButtonComponent_updateButtonProperties, _SkyTabsetNavButtonComponent_updateTabToSelect;
1661
+ class SkyTabsetNavButtonDisabledPipe {
1662
+ transform(disabled, buttonType, tabToSelectExists, tabToSelectIsDisabled) {
1663
+ if (disabled !== undefined) {
1664
+ return disabled;
1665
+ }
1666
+ else if (buttonType === 'finish') {
1667
+ return false;
1668
+ }
1669
+ return !tabToSelectExists || !!tabToSelectIsDisabled;
1670
+ }
1671
+ }
1672
+ SkyTabsetNavButtonDisabledPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyTabsetNavButtonDisabledPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1673
+ SkyTabsetNavButtonDisabledPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.2.0", ngImport: i0, type: SkyTabsetNavButtonDisabledPipe, name: "skyTabsetNavButtonDisabled" });
1674
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyTabsetNavButtonDisabledPipe, decorators: [{
1675
+ type: Pipe,
1676
+ args: [{
1677
+ name: 'skyTabsetNavButtonDisabled',
1678
+ }]
1679
+ }] });
1680
+
1681
+ var _SkyTabsetNavButtonComponent_instances, _SkyTabsetNavButtonComponent__buttonType, _SkyTabsetNavButtonComponent__disabled, _SkyTabsetNavButtonComponent__tabset, _SkyTabsetNavButtonComponent_activeIndexNumber, _SkyTabsetNavButtonComponent_activeSkyTabIndex, _SkyTabsetNavButtonComponent_currentTabsetSub, _SkyTabsetNavButtonComponent_logger, _SkyTabsetNavButtonComponent_tabCount, _SkyTabsetNavButtonComponent_ngUnsubscribe, _SkyTabsetNavButtonComponent_updateButtonVisibility, _SkyTabsetNavButtonComponent_updateButtonProperties, _SkyTabsetNavButtonComponent_updateTabToSelect;
1599
1682
  const buttonTypeNext = 'next';
1600
1683
  const buttonTypePrevious = 'previous';
1601
1684
  const buttonTypeFinish = 'finish';
@@ -1603,6 +1686,7 @@ class SkyTabsetNavButtonComponent {
1603
1686
  constructor(logger) {
1604
1687
  _SkyTabsetNavButtonComponent_instances.add(this);
1605
1688
  this.isVisible = false;
1689
+ this.type = 'submit';
1606
1690
  _SkyTabsetNavButtonComponent__buttonType.set(this, void 0);
1607
1691
  _SkyTabsetNavButtonComponent__disabled.set(this, void 0);
1608
1692
  _SkyTabsetNavButtonComponent__tabset.set(this, void 0);
@@ -1611,7 +1695,6 @@ class SkyTabsetNavButtonComponent {
1611
1695
  _SkyTabsetNavButtonComponent_currentTabsetSub.set(this, void 0);
1612
1696
  _SkyTabsetNavButtonComponent_logger.set(this, void 0);
1613
1697
  _SkyTabsetNavButtonComponent_tabCount.set(this, void 0);
1614
- _SkyTabsetNavButtonComponent_tabToSelect.set(this, void 0);
1615
1698
  _SkyTabsetNavButtonComponent_ngUnsubscribe.set(this, new Subject());
1616
1699
  __classPrivateFieldSet(this, _SkyTabsetNavButtonComponent_logger, logger, "f");
1617
1700
  }
@@ -1628,11 +1711,12 @@ class SkyTabsetNavButtonComponent {
1628
1711
  __classPrivateFieldGet(this, _SkyTabsetNavButtonComponent_currentTabsetSub, "f").unsubscribe();
1629
1712
  }
1630
1713
  if (value) {
1631
- __classPrivateFieldSet(this, _SkyTabsetNavButtonComponent_currentTabsetSub, __classPrivateFieldGet(this, _SkyTabsetNavButtonComponent__tabset, "f").activeChange
1714
+ __classPrivateFieldSet(this, _SkyTabsetNavButtonComponent_currentTabsetSub, value.activeChange
1632
1715
  .pipe(distinctUntilChanged(), takeUntil(__classPrivateFieldGet(this, _SkyTabsetNavButtonComponent_ngUnsubscribe, "f")))
1633
1716
  .subscribe((index) => {
1717
+ var _a, _b;
1634
1718
  __classPrivateFieldSet(this, _SkyTabsetNavButtonComponent_activeSkyTabIndex, index, "f");
1635
- __classPrivateFieldSet(this, _SkyTabsetNavButtonComponent_tabCount, __classPrivateFieldGet(this, _SkyTabsetNavButtonComponent__tabset, "f").tabs.length, "f");
1719
+ __classPrivateFieldSet(this, _SkyTabsetNavButtonComponent_tabCount, (_b = (_a = __classPrivateFieldGet(this, _SkyTabsetNavButtonComponent__tabset, "f")) === null || _a === void 0 ? void 0 : _a.tabs) === null || _b === void 0 ? void 0 : _b.length, "f");
1636
1720
  __classPrivateFieldGet(this, _SkyTabsetNavButtonComponent_instances, "m", _SkyTabsetNavButtonComponent_updateTabToSelect).call(this);
1637
1721
  __classPrivateFieldGet(this, _SkyTabsetNavButtonComponent_instances, "m", _SkyTabsetNavButtonComponent_updateButtonVisibility).call(this);
1638
1722
  __classPrivateFieldGet(this, _SkyTabsetNavButtonComponent_instances, "m", _SkyTabsetNavButtonComponent_updateButtonProperties).call(this);
@@ -1670,13 +1754,7 @@ class SkyTabsetNavButtonComponent {
1670
1754
  __classPrivateFieldSet(this, _SkyTabsetNavButtonComponent__disabled, value, "f");
1671
1755
  }
1672
1756
  get disabled() {
1673
- if (__classPrivateFieldGet(this, _SkyTabsetNavButtonComponent__disabled, "f") !== undefined) {
1674
- return __classPrivateFieldGet(this, _SkyTabsetNavButtonComponent__disabled, "f");
1675
- }
1676
- else if (this.buttonType === buttonTypeFinish) {
1677
- return false;
1678
- }
1679
- return !__classPrivateFieldGet(this, _SkyTabsetNavButtonComponent_tabToSelect, "f") || __classPrivateFieldGet(this, _SkyTabsetNavButtonComponent_tabToSelect, "f").disabled;
1757
+ return __classPrivateFieldGet(this, _SkyTabsetNavButtonComponent__disabled, "f");
1680
1758
  }
1681
1759
  ngOnDestroy() {
1682
1760
  __classPrivateFieldGet(this, _SkyTabsetNavButtonComponent_ngUnsubscribe, "f").next();
@@ -1684,13 +1762,13 @@ class SkyTabsetNavButtonComponent {
1684
1762
  }
1685
1763
  buttonClick() {
1686
1764
  /* istanbul ignore else */
1687
- if (__classPrivateFieldGet(this, _SkyTabsetNavButtonComponent_tabToSelect, "f") && !__classPrivateFieldGet(this, _SkyTabsetNavButtonComponent_tabToSelect, "f").disabled) {
1688
- this.tabset.active = __classPrivateFieldGet(this, _SkyTabsetNavButtonComponent_tabToSelect, "f").tabIndex;
1765
+ if (this.tabToSelect && !this.tabToSelect.disabled && this.tabset) {
1766
+ this.tabset.active = this.tabToSelect.tabIndex;
1689
1767
  }
1690
1768
  }
1691
1769
  }
1692
- _SkyTabsetNavButtonComponent__buttonType = new WeakMap(), _SkyTabsetNavButtonComponent__disabled = new WeakMap(), _SkyTabsetNavButtonComponent__tabset = new WeakMap(), _SkyTabsetNavButtonComponent_activeIndexNumber = new WeakMap(), _SkyTabsetNavButtonComponent_activeSkyTabIndex = new WeakMap(), _SkyTabsetNavButtonComponent_currentTabsetSub = new WeakMap(), _SkyTabsetNavButtonComponent_logger = new WeakMap(), _SkyTabsetNavButtonComponent_tabCount = new WeakMap(), _SkyTabsetNavButtonComponent_tabToSelect = new WeakMap(), _SkyTabsetNavButtonComponent_ngUnsubscribe = new WeakMap(), _SkyTabsetNavButtonComponent_instances = new WeakSet(), _SkyTabsetNavButtonComponent_updateButtonVisibility = function _SkyTabsetNavButtonComponent_updateButtonVisibility() {
1693
- const isLastStep = __classPrivateFieldGet(this, _SkyTabsetNavButtonComponent_activeIndexNumber, "f") === __classPrivateFieldGet(this, _SkyTabsetNavButtonComponent_tabCount, "f") - 1;
1770
+ _SkyTabsetNavButtonComponent__buttonType = new WeakMap(), _SkyTabsetNavButtonComponent__disabled = new WeakMap(), _SkyTabsetNavButtonComponent__tabset = new WeakMap(), _SkyTabsetNavButtonComponent_activeIndexNumber = new WeakMap(), _SkyTabsetNavButtonComponent_activeSkyTabIndex = new WeakMap(), _SkyTabsetNavButtonComponent_currentTabsetSub = new WeakMap(), _SkyTabsetNavButtonComponent_logger = new WeakMap(), _SkyTabsetNavButtonComponent_tabCount = new WeakMap(), _SkyTabsetNavButtonComponent_ngUnsubscribe = new WeakMap(), _SkyTabsetNavButtonComponent_instances = new WeakSet(), _SkyTabsetNavButtonComponent_updateButtonVisibility = function _SkyTabsetNavButtonComponent_updateButtonVisibility() {
1771
+ const isLastStep = !!__classPrivateFieldGet(this, _SkyTabsetNavButtonComponent_tabCount, "f") && __classPrivateFieldGet(this, _SkyTabsetNavButtonComponent_activeIndexNumber, "f") === __classPrivateFieldGet(this, _SkyTabsetNavButtonComponent_tabCount, "f") - 1;
1694
1772
  if (this.buttonType === buttonTypeFinish) {
1695
1773
  this.isVisible = isLastStep;
1696
1774
  }
@@ -1709,30 +1787,30 @@ _SkyTabsetNavButtonComponent__buttonType = new WeakMap(), _SkyTabsetNavButtonCom
1709
1787
  else {
1710
1788
  this.buttonClassName = 'sky-btn-default';
1711
1789
  }
1712
- this.ariaControls = (_a = __classPrivateFieldGet(this, _SkyTabsetNavButtonComponent_tabToSelect, "f")) === null || _a === void 0 ? void 0 : _a.tabPanelId;
1790
+ this.ariaControls = (_a = this.tabToSelect) === null || _a === void 0 ? void 0 : _a.tabPanelId;
1713
1791
  }, _SkyTabsetNavButtonComponent_updateTabToSelect = function _SkyTabsetNavButtonComponent_updateTabToSelect() {
1714
1792
  var _a;
1715
1793
  if ((_a = this.tabset) === null || _a === void 0 ? void 0 : _a.tabs) {
1716
1794
  const tabs = this.tabset.tabs.toArray();
1717
- __classPrivateFieldSet(this, _SkyTabsetNavButtonComponent_tabToSelect, undefined, "f");
1795
+ this.tabToSelect = undefined;
1718
1796
  // tab index can be a number or a string, but we need the actual number index
1719
1797
  __classPrivateFieldSet(this, _SkyTabsetNavButtonComponent_activeIndexNumber, tabs.findIndex((tab) => tab.tabIndex === __classPrivateFieldGet(this, _SkyTabsetNavButtonComponent_activeSkyTabIndex, "f")), "f");
1720
1798
  /* istanbul ignore else */
1721
1799
  if (__classPrivateFieldGet(this, _SkyTabsetNavButtonComponent_activeIndexNumber, "f") !== undefined) {
1722
1800
  if (this.buttonType === buttonTypeNext) {
1723
- __classPrivateFieldSet(this, _SkyTabsetNavButtonComponent_tabToSelect, tabs[__classPrivateFieldGet(this, _SkyTabsetNavButtonComponent_activeIndexNumber, "f") + 1], "f");
1801
+ this.tabToSelect = tabs[__classPrivateFieldGet(this, _SkyTabsetNavButtonComponent_activeIndexNumber, "f") + 1];
1724
1802
  }
1725
1803
  else if (this.buttonType === buttonTypePrevious) {
1726
- __classPrivateFieldSet(this, _SkyTabsetNavButtonComponent_tabToSelect, tabs[__classPrivateFieldGet(this, _SkyTabsetNavButtonComponent_activeIndexNumber, "f") - 1], "f");
1804
+ this.tabToSelect = tabs[__classPrivateFieldGet(this, _SkyTabsetNavButtonComponent_activeIndexNumber, "f") - 1];
1727
1805
  }
1728
1806
  }
1729
1807
  }
1730
1808
  };
1731
1809
  SkyTabsetNavButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyTabsetNavButtonComponent, deps: [{ token: i1.SkyLogService }], target: i0.ɵɵFactoryTarget.Component });
1732
- SkyTabsetNavButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: SkyTabsetNavButtonComponent, selector: "sky-tabset-nav-button", inputs: { tabset: "tabset", buttonType: "buttonType", buttonText: "buttonText", disabled: "disabled" }, ngImport: i0, template: "<button\n *ngIf=\"isVisible\"\n class=\"sky-btn sky-margin-inline-sm\"\n [attr.aria-controls]=\"ariaControls\"\n [disabled]=\"disabled\"\n [ngClass]=\"buttonClassName\"\n [type]=\"type\"\n (click)=\"buttonType === 'finish' ? null : buttonClick()\"\n>\n {{ buttonText || ('skyux_tabs_navigator_' + buttonType | skyLibResources) }}\n</button>\n", dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i3.SkyLibResourcesPipe, name: "skyLibResources" }] });
1810
+ SkyTabsetNavButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: SkyTabsetNavButtonComponent, selector: "sky-tabset-nav-button", inputs: { tabset: "tabset", buttonType: "buttonType", buttonText: "buttonText", disabled: "disabled" }, ngImport: i0, template: "<button\n *ngIf=\"isVisible\"\n class=\"sky-btn sky-margin-inline-sm\"\n [attr.aria-controls]=\"ariaControls\"\n [disabled]=\"\n disabled\n | skyTabsetNavButtonDisabled\n : buttonType\n : !!tabToSelect\n : tabToSelect?.disabled\n \"\n [ngClass]=\"buttonClassName\"\n [type]=\"type\"\n (click)=\"buttonType === 'finish' ? null : buttonClick()\"\n>\n {{ buttonText || ('skyux_tabs_navigator_' + buttonType | skyLibResources) }}\n</button>\n", dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i3.SkyLibResourcesPipe, name: "skyLibResources" }, { kind: "pipe", type: SkyTabsetNavButtonDisabledPipe, name: "skyTabsetNavButtonDisabled" }] });
1733
1811
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyTabsetNavButtonComponent, decorators: [{
1734
1812
  type: Component,
1735
- args: [{ selector: 'sky-tabset-nav-button', template: "<button\n *ngIf=\"isVisible\"\n class=\"sky-btn sky-margin-inline-sm\"\n [attr.aria-controls]=\"ariaControls\"\n [disabled]=\"disabled\"\n [ngClass]=\"buttonClassName\"\n [type]=\"type\"\n (click)=\"buttonType === 'finish' ? null : buttonClick()\"\n>\n {{ buttonText || ('skyux_tabs_navigator_' + buttonType | skyLibResources) }}\n</button>\n" }]
1813
+ args: [{ selector: 'sky-tabset-nav-button', template: "<button\n *ngIf=\"isVisible\"\n class=\"sky-btn sky-margin-inline-sm\"\n [attr.aria-controls]=\"ariaControls\"\n [disabled]=\"\n disabled\n | skyTabsetNavButtonDisabled\n : buttonType\n : !!tabToSelect\n : tabToSelect?.disabled\n \"\n [ngClass]=\"buttonClassName\"\n [type]=\"type\"\n (click)=\"buttonType === 'finish' ? null : buttonClick()\"\n>\n {{ buttonText || ('skyux_tabs_navigator_' + buttonType | skyLibResources) }}\n</button>\n" }]
1736
1814
  }], ctorParameters: function () { return [{ type: i1.SkyLogService }]; }, propDecorators: { tabset: [{
1737
1815
  type: Input
1738
1816
  }], buttonType: [{
@@ -1743,25 +1821,35 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
1743
1821
  type: Input
1744
1822
  }] } });
1745
1823
 
1824
+ var _SkyTabsetAdapterService_instances, _SkyTabsetAdapterService_currentOverflow, _SkyTabsetAdapterService_tabsetRef, _SkyTabsetAdapterService_tabsOffsetLeft, _SkyTabsetAdapterService_overflowChange, _SkyTabsetAdapterService_getTabsOffsetLeft;
1746
1825
  /**
1747
1826
  * @internal
1748
1827
  */
1749
1828
  class SkyTabsetAdapterService {
1750
1829
  constructor() {
1751
- this._overflowChange = new BehaviorSubject(false);
1830
+ _SkyTabsetAdapterService_instances.add(this);
1831
+ _SkyTabsetAdapterService_currentOverflow.set(this, false);
1832
+ _SkyTabsetAdapterService_tabsetRef.set(this, void 0);
1833
+ _SkyTabsetAdapterService_tabsOffsetLeft.set(this, void 0);
1834
+ _SkyTabsetAdapterService_overflowChange.set(this, void 0);
1835
+ __classPrivateFieldSet(this, _SkyTabsetAdapterService_overflowChange, new BehaviorSubject(false), "f");
1752
1836
  }
1753
1837
  get overflowChange() {
1754
- return this._overflowChange.asObservable();
1838
+ return __classPrivateFieldGet(this, _SkyTabsetAdapterService_overflowChange, "f");
1839
+ }
1840
+ ngOnDestroy() {
1841
+ __classPrivateFieldGet(this, _SkyTabsetAdapterService_overflowChange, "f").complete();
1755
1842
  }
1756
1843
  registerTabset(tabsetRef) {
1757
- this.tabsetRef = tabsetRef;
1758
- this.tabsOffsetLeft = this.getTabsOffsetLeft(tabsetRef.nativeElement);
1844
+ __classPrivateFieldSet(this, _SkyTabsetAdapterService_tabsetRef, tabsetRef, "f");
1845
+ __classPrivateFieldSet(this, _SkyTabsetAdapterService_tabsOffsetLeft, __classPrivateFieldGet(this, _SkyTabsetAdapterService_instances, "m", _SkyTabsetAdapterService_getTabsOffsetLeft).call(this, tabsetRef.nativeElement), "f");
1759
1846
  }
1760
1847
  /**
1761
1848
  * Detects if the tab buttons are wider than the tabset container.
1762
1849
  */
1763
1850
  detectOverflow() {
1764
- const nativeElement = this.tabsetRef.nativeElement;
1851
+ var _a;
1852
+ const nativeElement = (_a = __classPrivateFieldGet(this, _SkyTabsetAdapterService_tabsetRef, "f")) === null || _a === void 0 ? void 0 : _a.nativeElement;
1765
1853
  const tabsetRect = nativeElement
1766
1854
  .querySelector('.sky-tabset')
1767
1855
  .getBoundingClientRect();
@@ -1771,38 +1859,37 @@ class SkyTabsetAdapterService {
1771
1859
  const tabExtraButtonsRect = nativeElement
1772
1860
  .querySelector('.sky-tabset-btns')
1773
1861
  .getBoundingClientRect();
1774
- const tabButtonsWidth = tabButtonsRect.width + tabExtraButtonsRect.width + this.tabsOffsetLeft;
1862
+ const tabButtonsWidth = tabButtonsRect.width + tabExtraButtonsRect.width + __classPrivateFieldGet(this, _SkyTabsetAdapterService_tabsOffsetLeft, "f");
1775
1863
  const newOverflow = tabButtonsWidth > tabsetRect.width;
1776
- if (this.currentOverflow !== newOverflow) {
1777
- this.currentOverflow = newOverflow;
1778
- this._overflowChange.next(this.currentOverflow);
1864
+ if (__classPrivateFieldGet(this, _SkyTabsetAdapterService_currentOverflow, "f") !== newOverflow) {
1865
+ __classPrivateFieldSet(this, _SkyTabsetAdapterService_currentOverflow, newOverflow, "f");
1866
+ __classPrivateFieldGet(this, _SkyTabsetAdapterService_overflowChange, "f").next(__classPrivateFieldGet(this, _SkyTabsetAdapterService_currentOverflow, "f"));
1779
1867
  }
1780
1868
  }
1781
- /**
1782
- * Returns the number of pixels to the left of the first tab.
1783
- */
1784
- getTabsOffsetLeft(tabsetEl) {
1785
- const tabsetRect = tabsetEl.getBoundingClientRect();
1786
- // The dropdown element is the first "tab" and always exists in the DOM, even when hidden.
1787
- const firstTabRect = tabsetEl
1788
- .querySelector('.sky-tabset-dropdown')
1789
- .getBoundingClientRect();
1790
- return firstTabRect.left - tabsetRect.left;
1791
- }
1792
1869
  }
1870
+ _SkyTabsetAdapterService_currentOverflow = new WeakMap(), _SkyTabsetAdapterService_tabsetRef = new WeakMap(), _SkyTabsetAdapterService_tabsOffsetLeft = new WeakMap(), _SkyTabsetAdapterService_overflowChange = new WeakMap(), _SkyTabsetAdapterService_instances = new WeakSet(), _SkyTabsetAdapterService_getTabsOffsetLeft = function _SkyTabsetAdapterService_getTabsOffsetLeft(tabsetEl) {
1871
+ var _a;
1872
+ const tabsetRect = tabsetEl.getBoundingClientRect();
1873
+ // The dropdown element is the first "tab" and always exists in the DOM, even when hidden.
1874
+ const firstTabRect = (_a = tabsetEl
1875
+ .querySelector('.sky-tabset-dropdown')) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
1876
+ // Safety check
1877
+ /* istanbul ignore next */
1878
+ if (!firstTabRect) {
1879
+ return 0;
1880
+ }
1881
+ return firstTabRect.left - tabsetRect.left;
1882
+ };
1793
1883
  SkyTabsetAdapterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyTabsetAdapterService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1794
1884
  SkyTabsetAdapterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyTabsetAdapterService });
1795
1885
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyTabsetAdapterService, decorators: [{
1796
1886
  type: Injectable
1797
- }] });
1887
+ }], ctorParameters: function () { return []; } });
1798
1888
 
1889
+ var _SkyTabsetComponent_instances, _SkyTabsetComponent_ngUnsubscribe, _SkyTabsetComponent_tabComponentsChangeUnsubscribe, _SkyTabsetComponent_tabComponentsStateChangeUnsubscribe, _SkyTabsetComponent__active, _SkyTabsetComponent__permalinkId, _SkyTabsetComponent__tabs, _SkyTabsetComponent__tabDisplayMode, _SkyTabsetComponent__tabStyle, _SkyTabsetComponent_changeDetector, _SkyTabsetComponent_elementRef, _SkyTabsetComponent_adapterService, _SkyTabsetComponent_permalinkService, _SkyTabsetComponent_tabsetService, _SkyTabsetComponent_getInitialTabIndex, _SkyTabsetComponent_listenActiveIndexChange, _SkyTabsetComponent_listenTabComponentsStateChange, _SkyTabsetComponent_initTabComponents, _SkyTabsetComponent_resetTabComponents, _SkyTabsetComponent_emitTabIndexChange, _SkyTabsetComponent_unsubscribeTabComponentsStateChange, _SkyTabsetComponent_listenTabButtonsOverflowChange, _SkyTabsetComponent_listenLocationPopStateChange, _SkyTabsetComponent_setActiveTabIndexByPermalinkId, _SkyTabsetComponent_getActiveTabIndexByPermalinkId, _SkyTabsetComponent_getActiveTabComponent, _SkyTabsetComponent_createTabButtons, _SkyTabsetComponent_updateTabButtons, _SkyTabsetComponent_updateTabsetComponent;
1799
1890
  class SkyTabsetComponent {
1800
1891
  constructor(changeDetector, elementRef, adapterService, permalinkService, tabsetService) {
1801
- this.changeDetector = changeDetector;
1802
- this.elementRef = elementRef;
1803
- this.adapterService = adapterService;
1804
- this.permalinkService = permalinkService;
1805
- this.tabsetService = tabsetService;
1892
+ _SkyTabsetComponent_instances.add(this);
1806
1893
  /**
1807
1894
  * Fires when the active tab changes. This event emits the index of the active tab.
1808
1895
  */
@@ -1824,40 +1911,57 @@ class SkyTabsetComponent {
1824
1911
  * This event only applies when `tabStyle` is `"tabs"`.
1825
1912
  */
1826
1913
  this.tabIndexesChange = new EventEmitter();
1914
+ this.dropdownTriggerButtonText = '';
1827
1915
  this.tabButtons = [];
1828
- this.ngUnsubscribe = new Subject();
1829
- this.tabComponentsStateChangeUnsubscribe = new Subject();
1916
+ _SkyTabsetComponent_ngUnsubscribe.set(this, new Subject());
1917
+ _SkyTabsetComponent_tabComponentsChangeUnsubscribe.set(this, new Subject());
1918
+ _SkyTabsetComponent_tabComponentsStateChangeUnsubscribe.set(this, new Subject());
1919
+ _SkyTabsetComponent__active.set(this, void 0);
1920
+ _SkyTabsetComponent__permalinkId.set(this, '');
1921
+ _SkyTabsetComponent__tabs.set(this, void 0);
1922
+ _SkyTabsetComponent__tabDisplayMode.set(this, 'tabs');
1923
+ _SkyTabsetComponent__tabStyle.set(this, 'tabs');
1924
+ _SkyTabsetComponent_changeDetector.set(this, void 0);
1925
+ _SkyTabsetComponent_elementRef.set(this, void 0);
1926
+ _SkyTabsetComponent_adapterService.set(this, void 0);
1927
+ _SkyTabsetComponent_permalinkService.set(this, void 0);
1928
+ _SkyTabsetComponent_tabsetService.set(this, void 0);
1929
+ __classPrivateFieldSet(this, _SkyTabsetComponent_changeDetector, changeDetector, "f");
1930
+ __classPrivateFieldSet(this, _SkyTabsetComponent_elementRef, elementRef, "f");
1931
+ __classPrivateFieldSet(this, _SkyTabsetComponent_adapterService, adapterService, "f");
1932
+ __classPrivateFieldSet(this, _SkyTabsetComponent_permalinkService, permalinkService, "f");
1933
+ __classPrivateFieldSet(this, _SkyTabsetComponent_tabsetService, tabsetService, "f");
1830
1934
  }
1831
1935
  /**
1832
1936
  * Activates a tab by its `tabIndex` property.
1833
1937
  */
1834
1938
  set active(value) {
1835
1939
  if (value === undefined ||
1836
- this.tabsetService.tabIndexesEqual(value, this._active)) {
1940
+ __classPrivateFieldGet(this, _SkyTabsetComponent_tabsetService, "f").tabIndexesEqual(value, __classPrivateFieldGet(this, _SkyTabsetComponent__active, "f"))) {
1837
1941
  return;
1838
1942
  }
1839
- this._active = value;
1943
+ __classPrivateFieldSet(this, _SkyTabsetComponent__active, value, "f");
1840
1944
  if (this.tabs) {
1841
- this.tabsetService.setActiveTabIndex(value);
1945
+ __classPrivateFieldGet(this, _SkyTabsetComponent_tabsetService, "f").setActiveTabIndex(value);
1842
1946
  }
1843
1947
  else {
1844
1948
  // On init, wait for children tabs to render before broadcasting the active tab index.
1845
1949
  setTimeout(() => {
1846
- if (this.tabsetService.isValidTabIndex(value)) {
1950
+ if (__classPrivateFieldGet(this, _SkyTabsetComponent_tabsetService, "f").isValidTabIndex(value)) {
1847
1951
  // On init, yield to the permalink ID, if it exists.
1848
- if (this.getActiveTabIndexByPermalinkId() === undefined) {
1849
- this.tabsetService.setActiveTabIndex(value);
1952
+ if (__classPrivateFieldGet(this, _SkyTabsetComponent_instances, "m", _SkyTabsetComponent_getActiveTabIndexByPermalinkId).call(this) === undefined) {
1953
+ __classPrivateFieldGet(this, _SkyTabsetComponent_tabsetService, "f").setActiveTabIndex(value);
1850
1954
  }
1851
1955
  }
1852
1956
  else {
1853
1957
  // Activate the first tab if the new tab index is invalid.
1854
- this._active = this.tabsetService.activateFirstTab();
1958
+ __classPrivateFieldSet(this, _SkyTabsetComponent__active, __classPrivateFieldGet(this, _SkyTabsetComponent_tabsetService, "f").activateFirstTab(), "f");
1855
1959
  }
1856
1960
  });
1857
1961
  }
1858
1962
  }
1859
1963
  get active() {
1860
- return this._active;
1964
+ return __classPrivateFieldGet(this, _SkyTabsetComponent__active, "f");
1861
1965
  }
1862
1966
  /**
1863
1967
  * Distinguishes a tabset's unique state in the URL by generating a query parameter
@@ -1868,71 +1972,85 @@ class SkyTabsetComponent {
1868
1972
  */
1869
1973
  set permalinkId(value) {
1870
1974
  if (!value) {
1871
- return;
1975
+ __classPrivateFieldSet(this, _SkyTabsetComponent__permalinkId, '', "f");
1976
+ }
1977
+ else {
1978
+ const sanitized = __classPrivateFieldGet(this, _SkyTabsetComponent_permalinkService, "f").urlify(value);
1979
+ __classPrivateFieldSet(this, _SkyTabsetComponent__permalinkId, `${sanitized}-active-tab`, "f");
1872
1980
  }
1873
- const sanitized = this.permalinkService.urlify(value);
1874
- this._permalinkId = `${sanitized}-active-tab`;
1875
1981
  }
1876
1982
  get permalinkId() {
1877
- return this._permalinkId || '';
1983
+ return __classPrivateFieldGet(this, _SkyTabsetComponent__permalinkId, "f");
1878
1984
  }
1879
1985
  /**
1880
1986
  * Specifies the behavior for a series of tabs.
1881
1987
  * @default "tabs"
1882
1988
  */
1883
1989
  set tabStyle(value) {
1884
- this._tabStyle = value;
1990
+ __classPrivateFieldSet(this, _SkyTabsetComponent__tabStyle, value || 'tabs', "f");
1885
1991
  }
1886
1992
  get tabStyle() {
1887
- return this._tabStyle || 'tabs';
1993
+ return __classPrivateFieldGet(this, _SkyTabsetComponent__tabStyle, "f");
1888
1994
  }
1889
1995
  set tabDisplayMode(value) {
1890
- this._tabDisplayMode = value;
1891
- this.changeDetector.markForCheck();
1996
+ __classPrivateFieldSet(this, _SkyTabsetComponent__tabDisplayMode, value, "f");
1997
+ __classPrivateFieldGet(this, _SkyTabsetComponent_changeDetector, "f").markForCheck();
1892
1998
  }
1893
1999
  get tabDisplayMode() {
1894
- return this._tabDisplayMode || 'tabs';
2000
+ return __classPrivateFieldGet(this, _SkyTabsetComponent__tabDisplayMode, "f");
2001
+ }
2002
+ set tabs(value) {
2003
+ __classPrivateFieldSet(this, _SkyTabsetComponent__tabs, value, "f");
2004
+ __classPrivateFieldGet(this, _SkyTabsetComponent_tabComponentsChangeUnsubscribe, "f").next();
2005
+ value === null || value === void 0 ? void 0 : value.changes.pipe(takeUntil(__classPrivateFieldGet(this, _SkyTabsetComponent_tabComponentsChangeUnsubscribe, "f"))).subscribe(() => {
2006
+ __classPrivateFieldGet(this, _SkyTabsetComponent_instances, "m", _SkyTabsetComponent_resetTabComponents).call(this);
2007
+ });
2008
+ }
2009
+ get tabs() {
2010
+ return __classPrivateFieldGet(this, _SkyTabsetComponent__tabs, "f");
1895
2011
  }
1896
2012
  ngAfterViewInit() {
1897
- this.initTabComponents();
1898
- this.listenTabComponentsStructuralChange();
1899
- const initialTabIndex = this.getInitialTabIndex();
1900
- this.tabsetService.setActiveTabIndex(initialTabIndex);
1901
- this.listenTabButtonsOverflowChange();
1902
- this.listenLocationPopStateChange();
2013
+ __classPrivateFieldGet(this, _SkyTabsetComponent_instances, "m", _SkyTabsetComponent_initTabComponents).call(this);
2014
+ const initialTabIndex = __classPrivateFieldGet(this, _SkyTabsetComponent_instances, "m", _SkyTabsetComponent_getInitialTabIndex).call(this);
2015
+ __classPrivateFieldGet(this, _SkyTabsetComponent_tabsetService, "f").setActiveTabIndex(initialTabIndex);
2016
+ __classPrivateFieldGet(this, _SkyTabsetComponent_instances, "m", _SkyTabsetComponent_listenTabButtonsOverflowChange).call(this);
2017
+ __classPrivateFieldGet(this, _SkyTabsetComponent_instances, "m", _SkyTabsetComponent_listenLocationPopStateChange).call(this);
1903
2018
  // If the currently active tab is getting unregistered, activate the next one.
1904
- this.tabsetService.activeTabUnregistered
1905
- .pipe(takeUntil(this.ngUnsubscribe))
2019
+ __classPrivateFieldGet(this, _SkyTabsetComponent_tabsetService, "f").activeTabUnregistered
2020
+ .pipe(takeUntil(__classPrivateFieldGet(this, _SkyTabsetComponent_ngUnsubscribe, "f")))
1906
2021
  .subscribe((tab) => {
1907
2022
  // Wait for the new tabs to render before activating.
1908
2023
  setTimeout(() => {
1909
- this.tabsetService.activateNearestTab(tab.arrayIndex);
2024
+ __classPrivateFieldGet(this, _SkyTabsetComponent_tabsetService, "f").activateNearestTab(tab.arrayIndex);
1910
2025
  });
1911
2026
  });
1912
2027
  // Let the tabset render the initial active index before listening for changes.
1913
2028
  setTimeout(() => {
1914
- this.listenTabComponentsStateChange();
1915
- this.listenActiveIndexChange();
1916
- this.permalinkService.init();
2029
+ __classPrivateFieldGet(this, _SkyTabsetComponent_instances, "m", _SkyTabsetComponent_listenTabComponentsStateChange).call(this);
2030
+ __classPrivateFieldGet(this, _SkyTabsetComponent_instances, "m", _SkyTabsetComponent_listenActiveIndexChange).call(this);
2031
+ __classPrivateFieldGet(this, _SkyTabsetComponent_permalinkService, "f").init();
1917
2032
  });
1918
2033
  }
1919
2034
  ngOnDestroy() {
1920
- this.ngUnsubscribe.next();
1921
- this.ngUnsubscribe.complete();
1922
- this.unsubscribeTabComponentsStateChange();
2035
+ __classPrivateFieldGet(this, _SkyTabsetComponent_ngUnsubscribe, "f").next();
2036
+ __classPrivateFieldGet(this, _SkyTabsetComponent_ngUnsubscribe, "f").complete();
2037
+ __classPrivateFieldGet(this, _SkyTabsetComponent_tabComponentsChangeUnsubscribe, "f").next();
2038
+ __classPrivateFieldGet(this, _SkyTabsetComponent_tabComponentsChangeUnsubscribe, "f").complete();
2039
+ __classPrivateFieldGet(this, _SkyTabsetComponent_instances, "m", _SkyTabsetComponent_unsubscribeTabComponentsStateChange).call(this);
1923
2040
  if (this.permalinkId) {
1924
- this.permalinkService.clearParam(this.permalinkId);
2041
+ __classPrivateFieldGet(this, _SkyTabsetComponent_permalinkService, "f").clearParam(this.permalinkId);
1925
2042
  }
1926
2043
  }
1927
2044
  onWindowResize() {
1928
- this.adapterService.detectOverflow();
2045
+ __classPrivateFieldGet(this, _SkyTabsetComponent_adapterService, "f").detectOverflow();
1929
2046
  }
1930
2047
  onTabCloseClick(tabButton) {
1931
- const tabComponent = this.tabs.find((tab) => this.tabsetService.tabIndexesEqual(tab.tabIndex, tabButton.tabIndex));
1932
- tabComponent.close.emit();
2048
+ var _a;
2049
+ const tabComponent = (_a = this.tabs) === null || _a === void 0 ? void 0 : _a.find((tab) => __classPrivateFieldGet(this, _SkyTabsetComponent_tabsetService, "f").tabIndexesEqual(tab.tabIndex, tabButton.tabIndex));
2050
+ tabComponent === null || tabComponent === void 0 ? void 0 : tabComponent.close.emit();
1933
2051
  }
1934
2052
  onTabButtonClick(tabButton) {
1935
- this.tabsetService.setActiveTabIndex(tabButton.tabIndex);
2053
+ __classPrivateFieldGet(this, _SkyTabsetComponent_tabsetService, "f").setActiveTabIndex(tabButton.tabIndex);
1936
2054
  }
1937
2055
  onNewTabClick() {
1938
2056
  this.newTab.emit();
@@ -1941,217 +2059,192 @@ class SkyTabsetComponent {
1941
2059
  this.openTab.emit();
1942
2060
  }
1943
2061
  onRightKeyDown() {
1944
- this.tabsetService.focusNextTabBtn(this.tabButtons);
2062
+ __classPrivateFieldGet(this, _SkyTabsetComponent_tabsetService, "f").focusNextTabBtn(this.tabButtons);
1945
2063
  }
1946
2064
  onLeftKeyDown() {
1947
- this.tabsetService.focusPrevTabBtn(this.tabButtons);
2065
+ __classPrivateFieldGet(this, _SkyTabsetComponent_tabsetService, "f").focusPrevTabBtn(this.tabButtons);
1948
2066
  }
1949
2067
  onHomeKeyDown() {
1950
- this.tabsetService.focusFirstOrNearestTabBtn(this.tabButtons);
2068
+ __classPrivateFieldGet(this, _SkyTabsetComponent_tabsetService, "f").focusFirstOrNearestTabBtn(this.tabButtons);
1951
2069
  }
1952
2070
  onEndKeyDown() {
1953
- this.tabsetService.focusLastOrNearestTabBtn(this.tabButtons);
2071
+ __classPrivateFieldGet(this, _SkyTabsetComponent_tabsetService, "f").focusLastOrNearestTabBtn(this.tabButtons);
1954
2072
  }
1955
- /**
1956
- * Sets the initial active tab index based on the following criteria.
1957
- * 1. Does the URL include a query param that reflects this tabset's active tab?
1958
- * 2. Does one of the tab components have their `active` property set to `true`?
1959
- * 3. Is the tabset component's `active` property set to a specific tab index?
1960
- */
1961
- getInitialTabIndex() {
1962
- var _a;
1963
- let activeIndex = this.getActiveTabIndexByPermalinkId();
2073
+ }
2074
+ _SkyTabsetComponent_ngUnsubscribe = new WeakMap(), _SkyTabsetComponent_tabComponentsChangeUnsubscribe = new WeakMap(), _SkyTabsetComponent_tabComponentsStateChangeUnsubscribe = new WeakMap(), _SkyTabsetComponent__active = new WeakMap(), _SkyTabsetComponent__permalinkId = new WeakMap(), _SkyTabsetComponent__tabs = new WeakMap(), _SkyTabsetComponent__tabDisplayMode = new WeakMap(), _SkyTabsetComponent__tabStyle = new WeakMap(), _SkyTabsetComponent_changeDetector = new WeakMap(), _SkyTabsetComponent_elementRef = new WeakMap(), _SkyTabsetComponent_adapterService = new WeakMap(), _SkyTabsetComponent_permalinkService = new WeakMap(), _SkyTabsetComponent_tabsetService = new WeakMap(), _SkyTabsetComponent_instances = new WeakSet(), _SkyTabsetComponent_getInitialTabIndex = function _SkyTabsetComponent_getInitialTabIndex() {
2075
+ var _a;
2076
+ let activeIndex = __classPrivateFieldGet(this, _SkyTabsetComponent_instances, "m", _SkyTabsetComponent_getActiveTabIndexByPermalinkId).call(this);
2077
+ if (activeIndex === undefined) {
2078
+ activeIndex = (_a = __classPrivateFieldGet(this, _SkyTabsetComponent_instances, "m", _SkyTabsetComponent_getActiveTabComponent).call(this)) === null || _a === void 0 ? void 0 : _a.tabIndex;
1964
2079
  if (activeIndex === undefined) {
1965
- activeIndex = (_a = this.getActiveTabComponent()) === null || _a === void 0 ? void 0 : _a.tabIndex;
1966
- if (activeIndex === undefined) {
1967
- activeIndex = this.active;
1968
- }
1969
- }
1970
- return activeIndex;
1971
- }
1972
- listenActiveIndexChange() {
1973
- this.tabsetService.activeTabIndex
1974
- .pipe(distinctUntilChanged(), takeUntil(this.ngUnsubscribe))
1975
- .subscribe((activeIndex) => {
1976
- this.updateTabsetComponent(activeIndex);
1977
- });
1978
- }
1979
- listenTabComponentsStructuralChange() {
1980
- this.tabs.changes.pipe(takeUntil(this.ngUnsubscribe)).subscribe(() => {
1981
- this.resetTabComponents();
1982
- });
1983
- }
1984
- listenTabComponentsStateChange() {
2080
+ activeIndex = this.active;
2081
+ }
2082
+ }
2083
+ return activeIndex;
2084
+ }, _SkyTabsetComponent_listenActiveIndexChange = function _SkyTabsetComponent_listenActiveIndexChange() {
2085
+ __classPrivateFieldGet(this, _SkyTabsetComponent_tabsetService, "f").activeTabIndex
2086
+ .pipe(distinctUntilChanged(), takeUntil(__classPrivateFieldGet(this, _SkyTabsetComponent_ngUnsubscribe, "f")))
2087
+ .subscribe((activeIndex) => {
2088
+ __classPrivateFieldGet(this, _SkyTabsetComponent_instances, "m", _SkyTabsetComponent_updateTabsetComponent).call(this, activeIndex);
2089
+ });
2090
+ }, _SkyTabsetComponent_listenTabComponentsStateChange = function _SkyTabsetComponent_listenTabComponentsStateChange() {
2091
+ if (this.tabs) {
1985
2092
  combineLatest(this.tabs.map((tab) => tab.activeChange))
1986
- .pipe(takeUntil(race(this.tabComponentsStateChangeUnsubscribe, this.ngUnsubscribe)))
2093
+ .pipe(takeUntil(race(__classPrivateFieldGet(this, _SkyTabsetComponent_tabComponentsStateChangeUnsubscribe, "f"), __classPrivateFieldGet(this, _SkyTabsetComponent_ngUnsubscribe, "f"))))
1987
2094
  .subscribe(() => {
1988
2095
  // Wait for the tab components to render changes before finding the active one.
1989
2096
  setTimeout(() => {
1990
2097
  var _a;
1991
- const tabIndex = (_a = this.getActiveTabComponent()) === null || _a === void 0 ? void 0 : _a.tabIndex;
1992
- this.tabsetService.setActiveTabIndex(tabIndex);
2098
+ const tabIndex = (_a = __classPrivateFieldGet(this, _SkyTabsetComponent_instances, "m", _SkyTabsetComponent_getActiveTabComponent).call(this)) === null || _a === void 0 ? void 0 : _a.tabIndex;
2099
+ __classPrivateFieldGet(this, _SkyTabsetComponent_tabsetService, "f").setActiveTabIndex(tabIndex);
1993
2100
  });
1994
2101
  });
1995
2102
  combineLatest(this.tabs.map((tab) => tab.tabIndexChange))
1996
- .pipe(takeUntil(race(this.tabComponentsStateChangeUnsubscribe, this.ngUnsubscribe)))
2103
+ .pipe(takeUntil(race(__classPrivateFieldGet(this, _SkyTabsetComponent_tabComponentsStateChangeUnsubscribe, "f"), __classPrivateFieldGet(this, _SkyTabsetComponent_ngUnsubscribe, "f"))))
1997
2104
  .subscribe(() => {
1998
2105
  // Don't emit the first change.
1999
2106
  if (this.lastActiveTabIndex !== undefined) {
2000
2107
  // Wait for the tab components to render changes before updating the view.
2001
2108
  setTimeout(() => {
2002
- this.updateTabsetComponent(this.tabsetService.currentActiveTabIndex, true);
2003
- this.emitTabIndexChange();
2109
+ __classPrivateFieldGet(this, _SkyTabsetComponent_instances, "m", _SkyTabsetComponent_updateTabsetComponent).call(this, __classPrivateFieldGet(this, _SkyTabsetComponent_tabsetService, "f").currentActiveTabIndex, true);
2110
+ __classPrivateFieldGet(this, _SkyTabsetComponent_instances, "m", _SkyTabsetComponent_emitTabIndexChange).call(this);
2004
2111
  });
2005
2112
  }
2006
2113
  });
2007
2114
  combineLatest(this.tabs.map((tab) => tab.stateChange))
2008
- .pipe(takeUntil(race(this.tabComponentsStateChangeUnsubscribe, this.ngUnsubscribe)))
2115
+ .pipe(takeUntil(race(__classPrivateFieldGet(this, _SkyTabsetComponent_tabComponentsStateChangeUnsubscribe, "f"), __classPrivateFieldGet(this, _SkyTabsetComponent_ngUnsubscribe, "f"))))
2009
2116
  .subscribe(() => {
2010
2117
  // Wait for the tab components to render changes before finding the active one.
2011
2118
  setTimeout(() => {
2012
- this.updateTabsetComponent(this.tabsetService.currentActiveTabIndex, true);
2119
+ __classPrivateFieldGet(this, _SkyTabsetComponent_instances, "m", _SkyTabsetComponent_updateTabsetComponent).call(this, __classPrivateFieldGet(this, _SkyTabsetComponent_tabsetService, "f").currentActiveTabIndex, true);
2013
2120
  });
2014
2121
  });
2015
2122
  }
2016
- initTabComponents() {
2017
- this.tabs.forEach((tab) => tab.init());
2018
- }
2019
- resetTabComponents() {
2020
- var _a;
2021
- this.unsubscribeTabComponentsStateChange();
2022
- this.tabsetService.unregisterAll();
2023
- // If there are no tab components, do a hard reset of the view.
2024
- if (this.tabs.length === 0) {
2025
- this.updateTabsetComponent(0, true);
2026
- return;
2027
- }
2028
- this.initTabComponents();
2029
- const activeIndex = (_a = this.getActiveTabComponent()) === null || _a === void 0 ? void 0 : _a.tabIndex;
2030
- this.tabsetService.setActiveTabIndex(activeIndex, {
2031
- emitChange: false,
2032
- });
2033
- this.listenTabComponentsStateChange();
2034
- }
2035
- emitTabIndexChange() {
2036
- this.tabIndexesChange.emit({
2037
- tabs: this.tabs.map((tab) => ({
2038
- tabHeading: tab.tabHeading,
2039
- tabIndex: tab.tabIndex,
2040
- })),
2041
- });
2042
- }
2043
- unsubscribeTabComponentsStateChange() {
2044
- this.tabComponentsStateChangeUnsubscribe.next();
2045
- this.tabComponentsStateChangeUnsubscribe.complete();
2046
- this.tabComponentsStateChangeUnsubscribe = new Subject();
2047
- }
2048
- listenTabButtonsOverflowChange() {
2049
- this.adapterService.registerTabset(this.elementRef);
2050
- this.adapterService.overflowChange
2051
- .pipe(takeUntil(this.ngUnsubscribe))
2052
- .subscribe((isOverflowing) => {
2053
- this.tabDisplayMode = isOverflowing ? 'dropdown' : 'tabs';
2054
- this.changeDetector.markForCheck();
2055
- });
2056
- }
2057
- /**
2058
- * Listen for back/forward history button presses to detect query param changes in the URL.
2059
- */
2060
- listenLocationPopStateChange() {
2061
- this.permalinkService.popStateChange
2062
- .pipe(takeUntil(this.ngUnsubscribe))
2063
- .subscribe(() => {
2064
- this.setActiveTabIndexByPermalinkId();
2065
- });
2066
- }
2067
- setActiveTabIndexByPermalinkId() {
2068
- const activeIndex = this.getActiveTabIndexByPermalinkId();
2069
- this.tabsetService.setActiveTabIndex(activeIndex);
2070
- }
2071
- getActiveTabIndexByPermalinkId() {
2072
- var _a;
2073
- if (this.permalinkId) {
2074
- const paramValue = this.permalinkService.getParam(this.permalinkId);
2075
- if (paramValue) {
2076
- return (_a = this.tabs.find((tab) => tab.permalinkValue === paramValue)) === null || _a === void 0 ? void 0 : _a.tabIndex;
2077
- }
2078
- }
2079
- }
2080
- getActiveTabComponent() {
2081
- return this.tabs
2082
- .toArray()
2083
- .reverse()
2084
- .find((tab) => tab.active === true);
2085
- }
2086
- createTabButtons(activeIndex) {
2087
- return this.tabs.map((tab, index) => ({
2088
- active: this.tabsetService.tabIndexesEqual(tab.tabIndex, activeIndex),
2089
- closeable: tab.closeable,
2090
- ariaControls: tab.tabPanelId,
2091
- disabled: tab.disabled,
2092
- buttonHref: tab.disabled
2093
- ? null
2094
- : this.permalinkService.getParamHref(this.permalinkId, tab.permalinkValue),
2095
- buttonId: tab.tabButtonId,
2096
- buttonTextCount: tab.tabHeaderCount,
2097
- buttonText: tab.tabHeading,
2123
+ }, _SkyTabsetComponent_initTabComponents = function _SkyTabsetComponent_initTabComponents() {
2124
+ var _a;
2125
+ (_a = this.tabs) === null || _a === void 0 ? void 0 : _a.forEach((tab) => tab.init());
2126
+ }, _SkyTabsetComponent_resetTabComponents = function _SkyTabsetComponent_resetTabComponents() {
2127
+ var _a, _b;
2128
+ __classPrivateFieldGet(this, _SkyTabsetComponent_instances, "m", _SkyTabsetComponent_unsubscribeTabComponentsStateChange).call(this);
2129
+ __classPrivateFieldGet(this, _SkyTabsetComponent_tabsetService, "f").unregisterAll();
2130
+ // If there are no tab components, do a hard reset of the view.
2131
+ if (((_a = this.tabs) === null || _a === void 0 ? void 0 : _a.length) === 0) {
2132
+ __classPrivateFieldGet(this, _SkyTabsetComponent_instances, "m", _SkyTabsetComponent_updateTabsetComponent).call(this, 0, true);
2133
+ return;
2134
+ }
2135
+ __classPrivateFieldGet(this, _SkyTabsetComponent_instances, "m", _SkyTabsetComponent_initTabComponents).call(this);
2136
+ const activeIndex = (_b = __classPrivateFieldGet(this, _SkyTabsetComponent_instances, "m", _SkyTabsetComponent_getActiveTabComponent).call(this)) === null || _b === void 0 ? void 0 : _b.tabIndex;
2137
+ __classPrivateFieldGet(this, _SkyTabsetComponent_tabsetService, "f").setActiveTabIndex(activeIndex, {
2138
+ emitChange: false,
2139
+ });
2140
+ __classPrivateFieldGet(this, _SkyTabsetComponent_instances, "m", _SkyTabsetComponent_listenTabComponentsStateChange).call(this);
2141
+ }, _SkyTabsetComponent_emitTabIndexChange = function _SkyTabsetComponent_emitTabIndexChange() {
2142
+ var _a;
2143
+ this.tabIndexesChange.emit({
2144
+ tabs: (_a = this.tabs) === null || _a === void 0 ? void 0 : _a.map((tab) => ({
2145
+ tabHeading: tab.tabHeading,
2098
2146
  tabIndex: tab.tabIndex,
2099
- tabNumber: index + 1,
2100
- totalTabsCount: this.tabs.length,
2101
- }));
2102
- }
2103
- updateTabButtons(activeIndex) {
2104
- this.tabButtons.forEach((button) => {
2105
- button.active = this.tabsetService.tabIndexesEqual(button.tabIndex, activeIndex);
2106
- });
2147
+ })),
2148
+ });
2149
+ }, _SkyTabsetComponent_unsubscribeTabComponentsStateChange = function _SkyTabsetComponent_unsubscribeTabComponentsStateChange() {
2150
+ __classPrivateFieldGet(this, _SkyTabsetComponent_tabComponentsStateChangeUnsubscribe, "f").next();
2151
+ __classPrivateFieldGet(this, _SkyTabsetComponent_tabComponentsStateChangeUnsubscribe, "f").complete();
2152
+ __classPrivateFieldSet(this, _SkyTabsetComponent_tabComponentsStateChangeUnsubscribe, new Subject(), "f");
2153
+ }, _SkyTabsetComponent_listenTabButtonsOverflowChange = function _SkyTabsetComponent_listenTabButtonsOverflowChange() {
2154
+ __classPrivateFieldGet(this, _SkyTabsetComponent_adapterService, "f").registerTabset(__classPrivateFieldGet(this, _SkyTabsetComponent_elementRef, "f"));
2155
+ __classPrivateFieldGet(this, _SkyTabsetComponent_adapterService, "f").overflowChange
2156
+ .pipe(takeUntil(__classPrivateFieldGet(this, _SkyTabsetComponent_ngUnsubscribe, "f")))
2157
+ .subscribe((isOverflowing) => {
2158
+ this.tabDisplayMode = isOverflowing ? 'dropdown' : 'tabs';
2159
+ __classPrivateFieldGet(this, _SkyTabsetComponent_changeDetector, "f").markForCheck();
2160
+ });
2161
+ }, _SkyTabsetComponent_listenLocationPopStateChange = function _SkyTabsetComponent_listenLocationPopStateChange() {
2162
+ __classPrivateFieldGet(this, _SkyTabsetComponent_permalinkService, "f").popStateChange
2163
+ .pipe(takeUntil(__classPrivateFieldGet(this, _SkyTabsetComponent_ngUnsubscribe, "f")))
2164
+ .subscribe(() => {
2165
+ __classPrivateFieldGet(this, _SkyTabsetComponent_instances, "m", _SkyTabsetComponent_setActiveTabIndexByPermalinkId).call(this);
2166
+ });
2167
+ }, _SkyTabsetComponent_setActiveTabIndexByPermalinkId = function _SkyTabsetComponent_setActiveTabIndexByPermalinkId() {
2168
+ const activeIndex = __classPrivateFieldGet(this, _SkyTabsetComponent_instances, "m", _SkyTabsetComponent_getActiveTabIndexByPermalinkId).call(this);
2169
+ __classPrivateFieldGet(this, _SkyTabsetComponent_tabsetService, "f").setActiveTabIndex(activeIndex);
2170
+ }, _SkyTabsetComponent_getActiveTabIndexByPermalinkId = function _SkyTabsetComponent_getActiveTabIndexByPermalinkId() {
2171
+ var _a, _b;
2172
+ if (this.permalinkId) {
2173
+ const paramValue = __classPrivateFieldGet(this, _SkyTabsetComponent_permalinkService, "f").getParam(this.permalinkId);
2174
+ if (paramValue) {
2175
+ return (_b = (_a = this.tabs) === null || _a === void 0 ? void 0 : _a.find((tab) => tab.permalinkValueOrDefault === paramValue)) === null || _b === void 0 ? void 0 : _b.tabIndex;
2176
+ }
2177
+ return undefined;
2178
+ }
2179
+ return undefined;
2180
+ }, _SkyTabsetComponent_getActiveTabComponent = function _SkyTabsetComponent_getActiveTabComponent() {
2181
+ var _a;
2182
+ return (_a = this.tabs) === null || _a === void 0 ? void 0 : _a.toArray().reverse().find((tab) => tab.active === true);
2183
+ }, _SkyTabsetComponent_createTabButtons = function _SkyTabsetComponent_createTabButtons(activeIndex) {
2184
+ // Safety check
2185
+ /* istanbul ignore next */
2186
+ if (!this.tabs) {
2187
+ return [];
2188
+ }
2189
+ return this.tabs.map((tab, index) => ({
2190
+ active: __classPrivateFieldGet(this, _SkyTabsetComponent_tabsetService, "f").tabIndexesEqual(tab.tabIndex, activeIndex),
2191
+ closeable: tab.isCloseable(),
2192
+ ariaControls: tab.tabPanelId,
2193
+ disabled: tab.disabled,
2194
+ buttonHref: tab.disabled
2195
+ ? null
2196
+ : __classPrivateFieldGet(this, _SkyTabsetComponent_permalinkService, "f").getParamHref(this.permalinkId, tab.permalinkValueOrDefault),
2197
+ buttonId: tab.tabButtonId,
2198
+ buttonTextCount: tab.tabHeaderCount,
2199
+ buttonText: tab.tabHeading,
2200
+ tabIndex: tab.tabIndex,
2201
+ tabNumber: index + 1,
2202
+ totalTabsCount: this.tabs.length,
2203
+ }));
2204
+ }, _SkyTabsetComponent_updateTabButtons = function _SkyTabsetComponent_updateTabButtons(activeIndex) {
2205
+ this.tabButtons.forEach((button) => {
2206
+ button.active = __classPrivateFieldGet(this, _SkyTabsetComponent_tabsetService, "f").tabIndexesEqual(button.tabIndex, activeIndex);
2207
+ });
2208
+ }, _SkyTabsetComponent_updateTabsetComponent = function _SkyTabsetComponent_updateTabsetComponent(activeIndex, regenerateTabButtons = false) {
2209
+ var _a, _b, _c, _d;
2210
+ // Activate/deactivate tab components.
2211
+ (_a = this.tabs) === null || _a === void 0 ? void 0 : _a.forEach((tab) => {
2212
+ __classPrivateFieldGet(this, _SkyTabsetComponent_tabsetService, "f").tabIndexesEqual(tab.tabIndex, activeIndex)
2213
+ ? tab.activate()
2214
+ : tab.deactivate();
2215
+ });
2216
+ // Update the tab button models.
2217
+ if (regenerateTabButtons || !this.tabButtons.length) {
2218
+ this.tabButtons = __classPrivateFieldGet(this, _SkyTabsetComponent_instances, "m", _SkyTabsetComponent_createTabButtons).call(this, activeIndex);
2107
2219
  }
2108
- /**
2109
- * Updates the UI and state of the tabset component after the tab index or
2110
- * tab components have changed.
2111
- * @param activeIndex The currently active tab index.
2112
- * @param regenerateTabButtons Indicates if tab button view models should be regenerated.
2113
- * Setting this value to `false` will simply update the existing tab buttons. Setting this value
2114
- * to `true` is only necessary when the underlying tab components have changed and the tab
2115
- * buttons must reflect those changes.
2116
- */
2117
- updateTabsetComponent(activeIndex, regenerateTabButtons = false) {
2118
- var _a;
2119
- // Activate/deactivate tab components.
2120
- this.tabs.forEach((tab) => {
2121
- this.tabsetService.tabIndexesEqual(tab.tabIndex, activeIndex)
2122
- ? tab.activate()
2123
- : tab.deactivate();
2124
- });
2125
- // Update the tab button models.
2126
- if (regenerateTabButtons || !this.tabButtons.length) {
2127
- this.tabButtons = this.createTabButtons(activeIndex);
2128
- }
2129
- else {
2130
- this.updateTabButtons(activeIndex);
2131
- }
2132
- // Update the dropdown trigger button text.
2133
- this.dropdownTriggerButtonText = (_a = this.tabButtons.find((b) => {
2134
- return this.tabsetService.tabIndexesEqual(b.tabIndex, activeIndex);
2135
- })) === null || _a === void 0 ? void 0 : _a.buttonText;
2136
- // Set the query params based on active tab.
2137
- if (this.permalinkId) {
2138
- const activeTabComponent = this.tabs.find((tab) => {
2139
- return this.tabsetService.tabIndexesEqual(tab.tabIndex, activeIndex);
2140
- });
2141
- this.permalinkService.setParam(this.permalinkId, activeTabComponent.permalinkValue);
2142
- }
2143
- // Wait for tab button view models to render before gauging dimensions.
2144
- setTimeout(() => {
2145
- this.adapterService.detectOverflow();
2220
+ else {
2221
+ __classPrivateFieldGet(this, _SkyTabsetComponent_instances, "m", _SkyTabsetComponent_updateTabButtons).call(this, activeIndex);
2222
+ }
2223
+ // Update the dropdown trigger button text.
2224
+ this.dropdownTriggerButtonText =
2225
+ (_c = (_b = this.tabButtons.find((b) => {
2226
+ return __classPrivateFieldGet(this, _SkyTabsetComponent_tabsetService, "f").tabIndexesEqual(b.tabIndex, activeIndex);
2227
+ })) === null || _b === void 0 ? void 0 : _b.buttonText) !== null && _c !== void 0 ? _c : '';
2228
+ // Set the query params based on active tab.
2229
+ if (this.permalinkId) {
2230
+ const activeTabComponent = (_d = this.tabs) === null || _d === void 0 ? void 0 : _d.find((tab) => {
2231
+ return __classPrivateFieldGet(this, _SkyTabsetComponent_tabsetService, "f").tabIndexesEqual(tab.tabIndex, activeIndex);
2146
2232
  });
2147
- this.changeDetector.markForCheck();
2148
- // Emit the new active index value to consumers.
2149
- if (this.lastActiveTabIndex !== activeIndex) {
2150
- this.lastActiveTabIndex = activeIndex;
2151
- this.activeChange.emit(activeIndex);
2233
+ if (activeTabComponent) {
2234
+ __classPrivateFieldGet(this, _SkyTabsetComponent_permalinkService, "f").setParam(this.permalinkId, activeTabComponent.permalinkValueOrDefault);
2152
2235
  }
2153
2236
  }
2154
- }
2237
+ // Wait for tab button view models to render before gauging dimensions.
2238
+ setTimeout(() => {
2239
+ __classPrivateFieldGet(this, _SkyTabsetComponent_adapterService, "f").detectOverflow();
2240
+ });
2241
+ __classPrivateFieldGet(this, _SkyTabsetComponent_changeDetector, "f").markForCheck();
2242
+ // Emit the new active index value to consumers.
2243
+ if (this.lastActiveTabIndex !== activeIndex) {
2244
+ this.lastActiveTabIndex = activeIndex;
2245
+ this.activeChange.emit(activeIndex);
2246
+ }
2247
+ };
2155
2248
  SkyTabsetComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyTabsetComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: SkyTabsetAdapterService }, { token: SkyTabsetPermalinkService }, { token: SkyTabsetService }], target: i0.ɵɵFactoryTarget.Component });
2156
2249
  SkyTabsetComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: SkyTabsetComponent, selector: "sky-tabset", inputs: { active: "active", ariaLabel: "ariaLabel", ariaLabelledBy: "ariaLabelledBy", permalinkId: "permalinkId", tabStyle: "tabStyle" }, outputs: { activeChange: "activeChange", newTab: "newTab", openTab: "openTab", tabIndexesChange: "tabIndexesChange" }, providers: [
2157
2250
  SkyTabsetAdapterService,
@@ -2194,7 +2287,8 @@ SkyTabsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
2194
2287
  SkyTabsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.0", ngImport: i0, type: SkyTabsModule, declarations: [SkyTabButtonComponent,
2195
2288
  SkyTabComponent,
2196
2289
  SkyTabsetComponent,
2197
- SkyTabsetNavButtonComponent], imports: [CommonModule,
2290
+ SkyTabsetNavButtonComponent,
2291
+ SkyTabsetNavButtonDisabledPipe], imports: [CommonModule,
2198
2292
  RouterModule,
2199
2293
  SkyDropdownModule,
2200
2294
  SkyI18nModule,
@@ -2216,6 +2310,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
2216
2310
  SkyTabComponent,
2217
2311
  SkyTabsetComponent,
2218
2312
  SkyTabsetNavButtonComponent,
2313
+ SkyTabsetNavButtonDisabledPipe,
2219
2314
  ],
2220
2315
  imports: [
2221
2316
  CommonModule,