@skyux/tabs 7.0.0-beta.1 → 7.0.0-beta.10
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.
- package/documentation.json +970 -830
- package/esm2020/lib/modules/sectioned-form/sectioned-form-section.component.mjs +20 -14
- package/esm2020/lib/modules/sectioned-form/sectioned-form.component.mjs +25 -19
- package/esm2020/lib/modules/sectioned-form/sectioned-form.service.mjs +1 -1
- package/esm2020/lib/modules/shared/sky-tabs-resources.module.mjs +9 -1
- package/esm2020/lib/modules/tabs/tab-button-view-model.mjs +1 -1
- package/esm2020/lib/modules/tabs/tab-button.component.mjs +48 -10
- package/esm2020/lib/modules/tabs/tab.component.mjs +73 -33
- package/esm2020/lib/modules/tabs/tabs.module.mjs +5 -2
- package/esm2020/lib/modules/tabs/tabset-adapter.service.mjs +34 -22
- package/esm2020/lib/modules/tabs/tabset-nav-button-disabled.pipe.mjs +22 -0
- package/esm2020/lib/modules/tabs/tabset-nav-button.component.mjs +32 -42
- package/esm2020/lib/modules/tabs/tabset-permalink.service.mjs +41 -35
- package/esm2020/lib/modules/tabs/tabset-tab-indexes-change.mjs +1 -1
- package/esm2020/lib/modules/tabs/tabset.component.mjs +219 -226
- package/esm2020/lib/modules/tabs/tabset.service.mjs +67 -51
- package/esm2020/lib/modules/vertical-tabset/vertical-tab-media-query.service.mjs +11 -12
- package/esm2020/lib/modules/vertical-tabset/vertical-tab.component.mjs +67 -54
- package/esm2020/lib/modules/vertical-tabset/vertical-tabset-adapter.service.mjs +11 -8
- package/esm2020/lib/modules/vertical-tabset/vertical-tabset-group.component.mjs +28 -34
- package/esm2020/lib/modules/vertical-tabset/vertical-tabset.component.mjs +23 -20
- package/esm2020/lib/modules/vertical-tabset/vertical-tabset.service.mjs +55 -56
- package/esm2020/testing/tabs/tab-fixture-tab.mjs +1 -1
- package/esm2020/testing/tabs/tabset-fixture.mjs +44 -47
- package/fesm2015/skyux-tabs-testing.mjs +47 -49
- package/fesm2015/skyux-tabs-testing.mjs.map +1 -1
- package/fesm2015/skyux-tabs.mjs +764 -624
- package/fesm2015/skyux-tabs.mjs.map +1 -1
- package/fesm2020/skyux-tabs-testing.mjs +43 -46
- package/fesm2020/skyux-tabs-testing.mjs.map +1 -1
- package/fesm2020/skyux-tabs.mjs +867 -731
- package/fesm2020/skyux-tabs.mjs.map +1 -1
- package/lib/modules/sectioned-form/sectioned-form-section.component.d.ts +7 -10
- package/lib/modules/sectioned-form/sectioned-form.component.d.ts +4 -6
- package/lib/modules/sectioned-form/sectioned-form.service.d.ts +4 -4
- package/lib/modules/tabs/tab-button-view-model.d.ts +7 -5
- package/lib/modules/tabs/tab-button.component.d.ts +17 -11
- package/lib/modules/tabs/tab.component.d.ts +13 -18
- package/lib/modules/tabs/tabs.module.d.ts +9 -8
- package/lib/modules/tabs/tabset-adapter.service.d.ts +5 -10
- package/lib/modules/tabs/tabset-nav-button-disabled.pipe.d.ts +8 -0
- package/lib/modules/tabs/tabset-nav-button.component.d.ts +8 -5
- package/lib/modules/tabs/tabset-permalink.service.d.ts +3 -11
- package/lib/modules/tabs/tabset-tab-indexes-change.d.ts +2 -2
- package/lib/modules/tabs/tabset.component.d.ts +9 -56
- package/lib/modules/tabs/tabset.service.d.ts +8 -12
- package/lib/modules/vertical-tabset/vertical-tab-media-query.service.d.ts +2 -3
- package/lib/modules/vertical-tabset/vertical-tab.component.d.ts +13 -22
- package/lib/modules/vertical-tabset/vertical-tabset-adapter.service.d.ts +1 -2
- package/lib/modules/vertical-tabset/vertical-tabset-group.component.d.ts +7 -11
- package/lib/modules/vertical-tabset/vertical-tabset.component.d.ts +10 -13
- package/lib/modules/vertical-tabset/vertical-tabset.service.d.ts +10 -17
- package/package.json +9 -9
- package/testing/tabs/tab-fixture-tab.d.ts +3 -3
- package/testing/tabs/tabset-fixture.d.ts +3 -9
package/fesm2015/skyux-tabs.mjs
CHANGED
|
@@ -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';
|
|
@@ -11,7 +11,8 @@ import * as i5 from '@skyux/indicators';
|
|
|
11
11
|
import { SkyIconModule, SkyExpansionIndicatorModule, SkyStatusIndicatorModule } from '@skyux/indicators';
|
|
12
12
|
import * as i3 from '@skyux/i18n';
|
|
13
13
|
import { getLibStringForLocale, SkyI18nModule, SKY_LIB_RESOURCES_PROVIDERS } from '@skyux/i18n';
|
|
14
|
-
import {
|
|
14
|
+
import { __classPrivateFieldSet, __classPrivateFieldGet } from 'tslib';
|
|
15
|
+
import { ReplaySubject, BehaviorSubject, Subject, combineLatest, race } from 'rxjs';
|
|
15
16
|
import { takeUntil, take, distinctUntilChanged } from 'rxjs/operators';
|
|
16
17
|
import { skyAnimationSlide } from '@skyux/animations';
|
|
17
18
|
import { trigger, transition, style, animate } from '@angular/animations';
|
|
@@ -19,7 +20,6 @@ import * as i1$1 from '@angular/router';
|
|
|
19
20
|
import { RouterModule } from '@angular/router';
|
|
20
21
|
import * as i5$1 from '@skyux/popovers';
|
|
21
22
|
import { SkyDropdownModule } from '@skyux/popovers';
|
|
22
|
-
import { __classPrivateFieldSet, __classPrivateFieldGet } from 'tslib';
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* NOTICE: DO NOT MODIFY THIS FILE!
|
|
@@ -35,7 +35,15 @@ const RESOURCES = {
|
|
|
35
35
|
skyux_tabs_navigator_next: { message: 'Next' },
|
|
36
36
|
skyux_tabs_navigator_previous: { message: 'Previous' },
|
|
37
37
|
skyux_tab_open: { message: 'Open tab' },
|
|
38
|
+
skyux_tabs_sr_tab_order: { message: 'Tab {0} of {1}: {2}' },
|
|
38
39
|
skyux_vertical_tabs_show_tabs_text: { message: 'Tab list' },
|
|
40
|
+
skyux_wizard_sr_step_current: { message: 'Step {0} of {1}, current: {2}' },
|
|
41
|
+
skyux_wizard_sr_step_completed: {
|
|
42
|
+
message: 'Step {0} of {1}, completed: {2}',
|
|
43
|
+
},
|
|
44
|
+
skyux_wizard_sr_step_unavailable: {
|
|
45
|
+
message: 'Step {0} of {1}, unavailable: {2}',
|
|
46
|
+
},
|
|
39
47
|
},
|
|
40
48
|
};
|
|
41
49
|
class SkyTabsResourcesProvider {
|
|
@@ -71,20 +79,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
|
|
|
71
79
|
}]
|
|
72
80
|
}] });
|
|
73
81
|
|
|
82
|
+
var _SkyVerticalTabMediaQueryService_currentSubject;
|
|
74
83
|
/**
|
|
75
84
|
* @internal
|
|
76
85
|
*/
|
|
77
86
|
class SkyVerticalTabMediaQueryService {
|
|
78
87
|
constructor() {
|
|
79
|
-
this
|
|
80
|
-
this
|
|
81
|
-
this.currentSubject.next(this._current);
|
|
82
|
-
}
|
|
83
|
-
get current() {
|
|
84
|
-
return this._current;
|
|
88
|
+
_SkyVerticalTabMediaQueryService_currentSubject.set(this, void 0);
|
|
89
|
+
__classPrivateFieldSet(this, _SkyVerticalTabMediaQueryService_currentSubject, new ReplaySubject(1), "f");
|
|
85
90
|
}
|
|
86
91
|
subscribe(listener) {
|
|
87
|
-
return this.
|
|
92
|
+
return __classPrivateFieldGet(this, _SkyVerticalTabMediaQueryService_currentSubject, "f").subscribe({
|
|
88
93
|
next: (breakpoints) => {
|
|
89
94
|
listener(breakpoints);
|
|
90
95
|
},
|
|
@@ -104,8 +109,8 @@ class SkyVerticalTabMediaQueryService {
|
|
|
104
109
|
else {
|
|
105
110
|
breakpoint = SkyMediaBreakpoints.lg;
|
|
106
111
|
}
|
|
107
|
-
this.
|
|
108
|
-
this.
|
|
112
|
+
this.current = breakpoint;
|
|
113
|
+
__classPrivateFieldGet(this, _SkyVerticalTabMediaQueryService_currentSubject, "f").next(this.current);
|
|
109
114
|
}
|
|
110
115
|
isWidthWithinBreakpiont(width, breakpoint) {
|
|
111
116
|
const xsBreakpointMaxPixels = 767;
|
|
@@ -130,19 +135,21 @@ class SkyVerticalTabMediaQueryService {
|
|
|
130
135
|
}
|
|
131
136
|
}
|
|
132
137
|
destroy() {
|
|
133
|
-
this.
|
|
138
|
+
__classPrivateFieldGet(this, _SkyVerticalTabMediaQueryService_currentSubject, "f").complete();
|
|
134
139
|
}
|
|
135
140
|
}
|
|
141
|
+
_SkyVerticalTabMediaQueryService_currentSubject = new WeakMap();
|
|
136
142
|
SkyVerticalTabMediaQueryService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyVerticalTabMediaQueryService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
137
143
|
SkyVerticalTabMediaQueryService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyVerticalTabMediaQueryService });
|
|
138
144
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyVerticalTabMediaQueryService, decorators: [{
|
|
139
145
|
type: Injectable
|
|
140
146
|
}], ctorParameters: function () { return []; } });
|
|
141
147
|
|
|
148
|
+
var _SkyVerticalTabsetAdapterService_renderer;
|
|
142
149
|
class SkyVerticalTabsetAdapterService {
|
|
143
150
|
constructor(rendererFactory) {
|
|
144
|
-
this
|
|
145
|
-
this
|
|
151
|
+
_SkyVerticalTabsetAdapterService_renderer.set(this, void 0);
|
|
152
|
+
__classPrivateFieldSet(this, _SkyVerticalTabsetAdapterService_renderer, rendererFactory.createRenderer(undefined, null), "f");
|
|
146
153
|
}
|
|
147
154
|
getWidth(elementRef) {
|
|
148
155
|
return elementRef.nativeElement.clientWidth;
|
|
@@ -152,10 +159,10 @@ class SkyVerticalTabsetAdapterService {
|
|
|
152
159
|
}
|
|
153
160
|
setResponsiveClass(element, breakpoint) {
|
|
154
161
|
const nativeEl = element.nativeElement;
|
|
155
|
-
this.
|
|
156
|
-
this.
|
|
157
|
-
this.
|
|
158
|
-
this.
|
|
162
|
+
__classPrivateFieldGet(this, _SkyVerticalTabsetAdapterService_renderer, "f").removeClass(nativeEl, 'sky-responsive-container-xs');
|
|
163
|
+
__classPrivateFieldGet(this, _SkyVerticalTabsetAdapterService_renderer, "f").removeClass(nativeEl, 'sky-responsive-container-sm');
|
|
164
|
+
__classPrivateFieldGet(this, _SkyVerticalTabsetAdapterService_renderer, "f").removeClass(nativeEl, 'sky-responsive-container-md');
|
|
165
|
+
__classPrivateFieldGet(this, _SkyVerticalTabsetAdapterService_renderer, "f").removeClass(nativeEl, 'sky-responsive-container-lg');
|
|
159
166
|
let newClass;
|
|
160
167
|
switch (breakpoint) {
|
|
161
168
|
case SkyMediaBreakpoints.xs: {
|
|
@@ -175,15 +182,17 @@ class SkyVerticalTabsetAdapterService {
|
|
|
175
182
|
break;
|
|
176
183
|
}
|
|
177
184
|
}
|
|
178
|
-
this.
|
|
185
|
+
__classPrivateFieldGet(this, _SkyVerticalTabsetAdapterService_renderer, "f").addClass(nativeEl, newClass);
|
|
179
186
|
}
|
|
180
187
|
}
|
|
188
|
+
_SkyVerticalTabsetAdapterService_renderer = new WeakMap();
|
|
181
189
|
SkyVerticalTabsetAdapterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyVerticalTabsetAdapterService, deps: [{ token: i0.RendererFactory2 }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
182
190
|
SkyVerticalTabsetAdapterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyVerticalTabsetAdapterService });
|
|
183
191
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyVerticalTabsetAdapterService, decorators: [{
|
|
184
192
|
type: Injectable
|
|
185
193
|
}], ctorParameters: function () { return [{ type: i0.RendererFactory2 }]; } });
|
|
186
194
|
|
|
195
|
+
var _SkyVerticalTabsetService_instances, _SkyVerticalTabsetService_contentAdded, _SkyVerticalTabsetService_tabsVisible, _SkyVerticalTabsetService_isMobile, _SkyVerticalTabsetService_mediaQueryService, _SkyVerticalTabsetService_destroyContent, _SkyVerticalTabsetService_moveContent, _SkyVerticalTabsetService_updateTabClicked;
|
|
187
196
|
const VISIBLE_STATE = 'shown';
|
|
188
197
|
const HIDDEN_STATE = 'void';
|
|
189
198
|
/**
|
|
@@ -191,41 +200,40 @@ const HIDDEN_STATE = 'void';
|
|
|
191
200
|
*/
|
|
192
201
|
class SkyVerticalTabsetService {
|
|
193
202
|
constructor(mediaQueryService) {
|
|
194
|
-
this
|
|
203
|
+
_SkyVerticalTabsetService_instances.add(this);
|
|
195
204
|
this.activeIndex = undefined;
|
|
196
205
|
this.hidingTabs = new BehaviorSubject(false);
|
|
197
|
-
this.indexChanged = new
|
|
206
|
+
this.indexChanged = new ReplaySubject(1);
|
|
198
207
|
this.maintainTabContent = false;
|
|
199
208
|
this.showingTabs = new BehaviorSubject(false);
|
|
200
209
|
this.switchingMobile = new Subject();
|
|
201
210
|
this.tabs = [];
|
|
202
211
|
this.tabAdded = new Subject();
|
|
203
|
-
this.tabClicked = new
|
|
204
|
-
this
|
|
205
|
-
this
|
|
206
|
-
this
|
|
207
|
-
|
|
212
|
+
this.tabClicked = new ReplaySubject(1);
|
|
213
|
+
_SkyVerticalTabsetService_contentAdded.set(this, false);
|
|
214
|
+
_SkyVerticalTabsetService_tabsVisible.set(this, false);
|
|
215
|
+
_SkyVerticalTabsetService_isMobile.set(this, false);
|
|
216
|
+
_SkyVerticalTabsetService_mediaQueryService.set(this, void 0);
|
|
217
|
+
__classPrivateFieldSet(this, _SkyVerticalTabsetService_mediaQueryService, mediaQueryService, "f");
|
|
218
|
+
__classPrivateFieldGet(this, _SkyVerticalTabsetService_mediaQueryService, "f").subscribe((breakpoint) => {
|
|
208
219
|
const nowMobile = breakpoint === SkyMediaBreakpoints.xs;
|
|
209
|
-
if (nowMobile && !this
|
|
220
|
+
if (nowMobile && !__classPrivateFieldGet(this, _SkyVerticalTabsetService_isMobile, "f")) {
|
|
210
221
|
// switching to mobile
|
|
211
222
|
this.switchingMobile.next(true);
|
|
212
|
-
if (!this
|
|
223
|
+
if (!__classPrivateFieldGet(this, _SkyVerticalTabsetService_tabsVisible, "f")) {
|
|
213
224
|
this.hidingTabs.next(true);
|
|
214
225
|
}
|
|
215
226
|
}
|
|
216
|
-
else if (!nowMobile && this
|
|
227
|
+
else if (!nowMobile && __classPrivateFieldGet(this, _SkyVerticalTabsetService_isMobile, "f")) {
|
|
217
228
|
// switching to widescreen
|
|
218
229
|
this.switchingMobile.next(false);
|
|
219
|
-
if (!this
|
|
230
|
+
if (!__classPrivateFieldGet(this, _SkyVerticalTabsetService_tabsVisible, "f")) {
|
|
220
231
|
this.showingTabs.next(true);
|
|
221
232
|
}
|
|
222
233
|
}
|
|
223
|
-
this
|
|
234
|
+
__classPrivateFieldSet(this, _SkyVerticalTabsetService_isMobile, nowMobile, "f");
|
|
224
235
|
});
|
|
225
236
|
}
|
|
226
|
-
set content(value) {
|
|
227
|
-
this._content = value;
|
|
228
|
-
}
|
|
229
237
|
addTab(tab) {
|
|
230
238
|
const index = this.tabs.length;
|
|
231
239
|
tab.index = index;
|
|
@@ -236,7 +244,7 @@ class SkyVerticalTabsetService {
|
|
|
236
244
|
this.tabAdded.next(tab);
|
|
237
245
|
}
|
|
238
246
|
destroyTab(tab) {
|
|
239
|
-
var _a;
|
|
247
|
+
var _a, _b, _c, _d;
|
|
240
248
|
const tabIndex = this.tabs.indexOf(tab);
|
|
241
249
|
if (tabIndex === -1) {
|
|
242
250
|
return;
|
|
@@ -245,15 +253,15 @@ class SkyVerticalTabsetService {
|
|
|
245
253
|
tab.contentRendered &&
|
|
246
254
|
(
|
|
247
255
|
/* istanbul ignore next */
|
|
248
|
-
(_a = this.
|
|
249
|
-
this.
|
|
256
|
+
(_a = this.content) === null || _a === void 0 ? void 0 : _a.nativeElement.contains((_b = tab.tabContent) === null || _b === void 0 ? void 0 : _b.nativeElement))) {
|
|
257
|
+
(_c = this.content) === null || _c === void 0 ? void 0 : _c.nativeElement.removeChild((_d = tab.tabContent) === null || _d === void 0 ? void 0 : _d.nativeElement);
|
|
250
258
|
}
|
|
251
259
|
this.tabs.splice(tabIndex, 1);
|
|
252
260
|
// update tab indices
|
|
253
261
|
this.tabs.forEach((tabItem, index) => (tabItem.index = index));
|
|
254
262
|
if (tab.active) {
|
|
255
263
|
if (!this.maintainTabContent) {
|
|
256
|
-
this.
|
|
264
|
+
__classPrivateFieldGet(this, _SkyVerticalTabsetService_instances, "m", _SkyVerticalTabsetService_destroyContent).call(this);
|
|
257
265
|
}
|
|
258
266
|
// Try selecting the next tab first, and if there's no next tab then
|
|
259
267
|
// try selecting the previous one.
|
|
@@ -273,89 +281,86 @@ class SkyVerticalTabsetService {
|
|
|
273
281
|
}
|
|
274
282
|
this.activeIndex = tab.index;
|
|
275
283
|
this.tabClicked.next(true);
|
|
276
|
-
this.
|
|
284
|
+
__classPrivateFieldGet(this, _SkyVerticalTabsetService_instances, "m", _SkyVerticalTabsetService_updateTabClicked).call(this);
|
|
277
285
|
}
|
|
278
286
|
activeTab() {
|
|
279
287
|
return this.tabs.find((t) => t.index === this.activeIndex);
|
|
280
288
|
}
|
|
281
289
|
isMobile() {
|
|
282
|
-
return this
|
|
290
|
+
return __classPrivateFieldGet(this, _SkyVerticalTabsetService_isMobile, "f");
|
|
283
291
|
}
|
|
284
292
|
updateContent() {
|
|
285
293
|
if (!this.maintainTabContent) {
|
|
286
|
-
if (!this
|
|
294
|
+
if (!__classPrivateFieldGet(this, _SkyVerticalTabsetService_contentAdded, "f") && this.contentVisible()) {
|
|
287
295
|
// content needs to be moved
|
|
288
|
-
this.
|
|
296
|
+
__classPrivateFieldGet(this, _SkyVerticalTabsetService_instances, "m", _SkyVerticalTabsetService_moveContent).call(this);
|
|
289
297
|
}
|
|
290
|
-
else if (this
|
|
298
|
+
else if (__classPrivateFieldGet(this, _SkyVerticalTabsetService_contentAdded, "f") && !this.contentVisible()) {
|
|
291
299
|
// content hidden
|
|
292
|
-
this
|
|
300
|
+
__classPrivateFieldSet(this, _SkyVerticalTabsetService_contentAdded, false, "f");
|
|
293
301
|
}
|
|
294
302
|
}
|
|
295
303
|
else {
|
|
296
304
|
this.tabs.forEach((tab) => {
|
|
305
|
+
var _a, _b;
|
|
297
306
|
if (!tab.contentRendered) {
|
|
298
|
-
this.
|
|
307
|
+
(_a = this.content) === null || _a === void 0 ? void 0 : _a.nativeElement.appendChild((_b = tab.tabContent) === null || _b === void 0 ? void 0 : _b.nativeElement);
|
|
299
308
|
tab.contentRendered = true;
|
|
300
309
|
}
|
|
301
310
|
});
|
|
302
311
|
}
|
|
303
312
|
}
|
|
304
313
|
tabsVisible() {
|
|
305
|
-
return !this.isMobile() || this
|
|
314
|
+
return !this.isMobile() || __classPrivateFieldGet(this, _SkyVerticalTabsetService_tabsVisible, "f");
|
|
306
315
|
}
|
|
307
316
|
contentVisible() {
|
|
308
|
-
return !this.isMobile() || !this
|
|
317
|
+
return !this.isMobile() || !__classPrivateFieldGet(this, _SkyVerticalTabsetService_tabsVisible, "f");
|
|
309
318
|
}
|
|
310
319
|
showTabs() {
|
|
311
|
-
this
|
|
312
|
-
this
|
|
320
|
+
__classPrivateFieldSet(this, _SkyVerticalTabsetService_tabsVisible, true, "f");
|
|
321
|
+
__classPrivateFieldSet(this, _SkyVerticalTabsetService_contentAdded, false, "f");
|
|
313
322
|
this.animationTabsVisibleState = VISIBLE_STATE;
|
|
314
323
|
this.animationContentVisibleState = HIDDEN_STATE;
|
|
315
324
|
this.showingTabs.next(true);
|
|
316
325
|
}
|
|
317
|
-
destroyContent() {
|
|
318
|
-
if (this._content) {
|
|
319
|
-
this._content.nativeElement.innerHTML = '';
|
|
320
|
-
}
|
|
321
|
-
this.content = undefined;
|
|
322
|
-
}
|
|
323
|
-
moveContent() {
|
|
324
|
-
/* istanbul ignore else */
|
|
325
|
-
if (this._content && !this._contentAdded) {
|
|
326
|
-
const activeTab = this.activeTab();
|
|
327
|
-
const activeContent = activeTab ? activeTab.tabContent : undefined;
|
|
328
|
-
if (activeContent && activeContent.nativeElement) {
|
|
329
|
-
this._content.nativeElement.appendChild(activeContent.nativeElement);
|
|
330
|
-
activeTab.contentRendered = true;
|
|
331
|
-
this._contentAdded = true;
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
updateTabClicked() {
|
|
336
|
-
this._contentAdded = false;
|
|
337
|
-
if (this.isMobile()) {
|
|
338
|
-
this._tabsVisible = false;
|
|
339
|
-
this.animationContentVisibleState = VISIBLE_STATE;
|
|
340
|
-
this.animationTabsVisibleState = HIDDEN_STATE;
|
|
341
|
-
this.hidingTabs.next(true);
|
|
342
|
-
}
|
|
343
|
-
this.indexChanged.next(this.activeIndex);
|
|
344
|
-
}
|
|
345
326
|
}
|
|
327
|
+
_SkyVerticalTabsetService_contentAdded = new WeakMap(), _SkyVerticalTabsetService_tabsVisible = new WeakMap(), _SkyVerticalTabsetService_isMobile = new WeakMap(), _SkyVerticalTabsetService_mediaQueryService = new WeakMap(), _SkyVerticalTabsetService_instances = new WeakSet(), _SkyVerticalTabsetService_destroyContent = function _SkyVerticalTabsetService_destroyContent() {
|
|
328
|
+
if (this.content) {
|
|
329
|
+
this.content.nativeElement.innerHTML = '';
|
|
330
|
+
}
|
|
331
|
+
this.content = undefined;
|
|
332
|
+
}, _SkyVerticalTabsetService_moveContent = function _SkyVerticalTabsetService_moveContent() {
|
|
333
|
+
/* istanbul ignore else */
|
|
334
|
+
if (this.content && !__classPrivateFieldGet(this, _SkyVerticalTabsetService_contentAdded, "f")) {
|
|
335
|
+
const activeTab = this.activeTab();
|
|
336
|
+
const activeContent = activeTab ? activeTab.tabContent : undefined;
|
|
337
|
+
if (activeContent && activeTab && activeContent.nativeElement) {
|
|
338
|
+
this.content.nativeElement.appendChild(activeContent.nativeElement);
|
|
339
|
+
activeTab.contentRendered = true;
|
|
340
|
+
__classPrivateFieldSet(this, _SkyVerticalTabsetService_contentAdded, true, "f");
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
}, _SkyVerticalTabsetService_updateTabClicked = function _SkyVerticalTabsetService_updateTabClicked() {
|
|
344
|
+
__classPrivateFieldSet(this, _SkyVerticalTabsetService_contentAdded, false, "f");
|
|
345
|
+
if (this.isMobile()) {
|
|
346
|
+
__classPrivateFieldSet(this, _SkyVerticalTabsetService_tabsVisible, false, "f");
|
|
347
|
+
this.animationContentVisibleState = VISIBLE_STATE;
|
|
348
|
+
this.animationTabsVisibleState = HIDDEN_STATE;
|
|
349
|
+
this.hidingTabs.next(true);
|
|
350
|
+
}
|
|
351
|
+
this.indexChanged.next(this.activeIndex);
|
|
352
|
+
};
|
|
346
353
|
SkyVerticalTabsetService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyVerticalTabsetService, deps: [{ token: i1.SkyMediaQueryService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
347
354
|
SkyVerticalTabsetService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyVerticalTabsetService });
|
|
348
355
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyVerticalTabsetService, decorators: [{
|
|
349
356
|
type: Injectable
|
|
350
357
|
}], ctorParameters: function () { return [{ type: i1.SkyMediaQueryService }]; } });
|
|
351
358
|
|
|
359
|
+
var _SkyVerticalTabComponent_instances, _SkyVerticalTabComponent__ariaRole, _SkyVerticalTabComponent__contentRendered, _SkyVerticalTabComponent_tabIdOrDefault, _SkyVerticalTabComponent_defaultTabId, _SkyVerticalTabComponent_mobileSubscription, _SkyVerticalTabComponent_ngUnsubscribe, _SkyVerticalTabComponent_adapterService, _SkyVerticalTabComponent_changeRef, _SkyVerticalTabComponent_tabsetService, _SkyVerticalTabComponent_verticalTabMediaQueryService, _SkyVerticalTabComponent_updateBreakpointAndResponsiveClass;
|
|
352
360
|
let nextId$2 = 0;
|
|
353
361
|
class SkyVerticalTabComponent {
|
|
354
362
|
constructor(adapterService, changeRef, tabsetService, verticalTabMediaQueryService) {
|
|
355
|
-
this
|
|
356
|
-
this.changeRef = changeRef;
|
|
357
|
-
this.tabsetService = tabsetService;
|
|
358
|
-
this.verticalTabMediaQueryService = verticalTabMediaQueryService;
|
|
363
|
+
_SkyVerticalTabComponent_instances.add(this);
|
|
359
364
|
/**
|
|
360
365
|
* Indicates whether the tab is active when the tabset loads.
|
|
361
366
|
*/
|
|
@@ -369,16 +374,22 @@ class SkyVerticalTabComponent {
|
|
|
369
374
|
* @internal This is used for sectioned forms and is not currently a supported design for pure vertical tabs.
|
|
370
375
|
*/
|
|
371
376
|
this.errorIndicator = false;
|
|
372
|
-
/**
|
|
373
|
-
* Specifies an ID for the tab.
|
|
374
|
-
* @deprecated Now that the vertical tabs provide aria labels automatically, this input is no longer necessary.
|
|
375
|
-
*/
|
|
376
|
-
this.tabId = `sky-vertical-tab-${++nextId$2}`;
|
|
377
377
|
this.isMobile = false;
|
|
378
|
-
this
|
|
379
|
-
this
|
|
380
|
-
this
|
|
381
|
-
this
|
|
378
|
+
_SkyVerticalTabComponent__ariaRole.set(this, 'tab');
|
|
379
|
+
_SkyVerticalTabComponent__contentRendered.set(this, false);
|
|
380
|
+
_SkyVerticalTabComponent_tabIdOrDefault.set(this, void 0);
|
|
381
|
+
_SkyVerticalTabComponent_defaultTabId.set(this, void 0);
|
|
382
|
+
_SkyVerticalTabComponent_mobileSubscription.set(this, new Subject());
|
|
383
|
+
_SkyVerticalTabComponent_ngUnsubscribe.set(this, new Subject());
|
|
384
|
+
_SkyVerticalTabComponent_adapterService.set(this, void 0);
|
|
385
|
+
_SkyVerticalTabComponent_changeRef.set(this, void 0);
|
|
386
|
+
_SkyVerticalTabComponent_tabsetService.set(this, void 0);
|
|
387
|
+
_SkyVerticalTabComponent_verticalTabMediaQueryService.set(this, void 0);
|
|
388
|
+
__classPrivateFieldSet(this, _SkyVerticalTabComponent_adapterService, adapterService, "f");
|
|
389
|
+
__classPrivateFieldSet(this, _SkyVerticalTabComponent_changeRef, changeRef, "f");
|
|
390
|
+
__classPrivateFieldSet(this, _SkyVerticalTabComponent_tabsetService, tabsetService, "f");
|
|
391
|
+
__classPrivateFieldSet(this, _SkyVerticalTabComponent_verticalTabMediaQueryService, verticalTabMediaQueryService, "f");
|
|
392
|
+
__classPrivateFieldSet(this, _SkyVerticalTabComponent_tabIdOrDefault, __classPrivateFieldSet(this, _SkyVerticalTabComponent_defaultTabId, `sky-vertical-tab-${++nextId$2}`, "f"), "f");
|
|
382
393
|
}
|
|
383
394
|
/**
|
|
384
395
|
* Specifies an ARIA role for the vertical tab
|
|
@@ -391,60 +402,61 @@ class SkyVerticalTabComponent {
|
|
|
391
402
|
* In the next major version, this property will be automatically set to `tab`.
|
|
392
403
|
*/
|
|
393
404
|
get ariaRole() {
|
|
394
|
-
|
|
395
|
-
return undefined;
|
|
396
|
-
}
|
|
397
|
-
return this._ariaRole || 'tab';
|
|
405
|
+
return __classPrivateFieldGet(this, _SkyVerticalTabComponent__ariaRole, "f");
|
|
398
406
|
}
|
|
399
407
|
set ariaRole(value) {
|
|
400
|
-
this
|
|
408
|
+
__classPrivateFieldSet(this, _SkyVerticalTabComponent__ariaRole, value !== null && value !== void 0 ? value : 'tab', "f");
|
|
401
409
|
}
|
|
402
410
|
/**
|
|
403
|
-
*
|
|
404
|
-
* @
|
|
411
|
+
* Specifies an ID for the tab.
|
|
412
|
+
* @deprecated Now that the vertical tabs provide aria labels automatically, this input is no longer necessary.
|
|
405
413
|
*/
|
|
406
|
-
|
|
407
|
-
|
|
414
|
+
set tabId(value) {
|
|
415
|
+
__classPrivateFieldSet(this, _SkyVerticalTabComponent_tabIdOrDefault, value || __classPrivateFieldGet(this, _SkyVerticalTabComponent_defaultTabId, "f"), "f");
|
|
408
416
|
}
|
|
409
|
-
|
|
410
|
-
this
|
|
417
|
+
get tabId() {
|
|
418
|
+
return __classPrivateFieldGet(this, _SkyVerticalTabComponent_tabIdOrDefault, "f");
|
|
411
419
|
}
|
|
412
420
|
set contentRendered(value) {
|
|
413
|
-
this
|
|
421
|
+
__classPrivateFieldSet(this, _SkyVerticalTabComponent__contentRendered, value, "f");
|
|
414
422
|
/* istanbul ignore else */
|
|
415
|
-
if (this
|
|
423
|
+
if (__classPrivateFieldGet(this, _SkyVerticalTabComponent__contentRendered, "f")) {
|
|
416
424
|
// NOTE: Wrapped in a setTimeout here to ensure that everything has completed rendering.
|
|
417
425
|
setTimeout(() => {
|
|
418
|
-
|
|
426
|
+
if (this.tabContent) {
|
|
427
|
+
__classPrivateFieldGet(this, _SkyVerticalTabComponent_instances, "m", _SkyVerticalTabComponent_updateBreakpointAndResponsiveClass).call(this);
|
|
428
|
+
}
|
|
419
429
|
});
|
|
420
430
|
}
|
|
421
431
|
}
|
|
422
432
|
get contentRendered() {
|
|
423
|
-
return this
|
|
433
|
+
return __classPrivateFieldGet(this, _SkyVerticalTabComponent__contentRendered, "f");
|
|
424
434
|
}
|
|
425
435
|
ngOnInit() {
|
|
426
|
-
this.isMobile = this.
|
|
427
|
-
this.
|
|
428
|
-
this.
|
|
436
|
+
this.isMobile = __classPrivateFieldGet(this, _SkyVerticalTabComponent_tabsetService, "f").isMobile();
|
|
437
|
+
__classPrivateFieldGet(this, _SkyVerticalTabComponent_changeRef, "f").markForCheck();
|
|
438
|
+
__classPrivateFieldGet(this, _SkyVerticalTabComponent_tabsetService, "f").switchingMobile.subscribe((mobile) => {
|
|
429
439
|
this.isMobile = mobile;
|
|
430
|
-
this.
|
|
440
|
+
__classPrivateFieldGet(this, _SkyVerticalTabComponent_changeRef, "f").markForCheck();
|
|
431
441
|
});
|
|
432
442
|
// Update the breakpoint and responsive class here just as a sanity check since we can not
|
|
433
443
|
// watch for element resizing.
|
|
434
|
-
this.
|
|
435
|
-
.pipe(takeUntil(this
|
|
444
|
+
__classPrivateFieldGet(this, _SkyVerticalTabComponent_tabsetService, "f").indexChanged
|
|
445
|
+
.pipe(takeUntil(__classPrivateFieldGet(this, _SkyVerticalTabComponent_ngUnsubscribe, "f")))
|
|
436
446
|
.subscribe((index) => {
|
|
437
447
|
if (this.index === index && this.contentRendered) {
|
|
438
|
-
|
|
448
|
+
if (this.tabContent) {
|
|
449
|
+
__classPrivateFieldGet(this, _SkyVerticalTabComponent_instances, "m", _SkyVerticalTabComponent_updateBreakpointAndResponsiveClass).call(this);
|
|
450
|
+
}
|
|
439
451
|
}
|
|
440
452
|
});
|
|
441
|
-
this.
|
|
453
|
+
__classPrivateFieldGet(this, _SkyVerticalTabComponent_tabsetService, "f").addTab(this);
|
|
442
454
|
}
|
|
443
455
|
ngOnDestroy() {
|
|
444
|
-
this.
|
|
445
|
-
this.
|
|
446
|
-
this.
|
|
447
|
-
this.
|
|
456
|
+
__classPrivateFieldGet(this, _SkyVerticalTabComponent_mobileSubscription, "f").unsubscribe();
|
|
457
|
+
__classPrivateFieldGet(this, _SkyVerticalTabComponent_ngUnsubscribe, "f").next();
|
|
458
|
+
__classPrivateFieldGet(this, _SkyVerticalTabComponent_ngUnsubscribe, "f").complete();
|
|
459
|
+
__classPrivateFieldGet(this, _SkyVerticalTabComponent_tabsetService, "f").destroyTab(this);
|
|
448
460
|
}
|
|
449
461
|
tabIndex() {
|
|
450
462
|
if (!this.disabled) {
|
|
@@ -457,8 +469,8 @@ class SkyVerticalTabComponent {
|
|
|
457
469
|
activateTab() {
|
|
458
470
|
if (!this.disabled) {
|
|
459
471
|
this.active = true;
|
|
460
|
-
this.
|
|
461
|
-
this.
|
|
472
|
+
__classPrivateFieldGet(this, _SkyVerticalTabComponent_tabsetService, "f").activateTab(this);
|
|
473
|
+
__classPrivateFieldGet(this, _SkyVerticalTabComponent_changeRef, "f").markForCheck();
|
|
462
474
|
}
|
|
463
475
|
}
|
|
464
476
|
onTabButtonKeyUp(event) {
|
|
@@ -477,18 +489,25 @@ class SkyVerticalTabComponent {
|
|
|
477
489
|
}
|
|
478
490
|
}
|
|
479
491
|
onWindowResize() {
|
|
480
|
-
|
|
492
|
+
if (this.tabContent) {
|
|
493
|
+
__classPrivateFieldGet(this, _SkyVerticalTabComponent_instances, "m", _SkyVerticalTabComponent_updateBreakpointAndResponsiveClass).call(this);
|
|
494
|
+
}
|
|
481
495
|
}
|
|
482
496
|
tabDeactivated() {
|
|
483
|
-
this.
|
|
484
|
-
}
|
|
485
|
-
updateBreakpointAndResponsiveClass(width) {
|
|
486
|
-
this.verticalTabMediaQueryService.setBreakpointForWidth(width);
|
|
487
|
-
const newBreakpiont = this.verticalTabMediaQueryService.current;
|
|
488
|
-
this.adapterService.setResponsiveClass(this.tabContent, newBreakpiont);
|
|
489
|
-
this.changeRef.markForCheck();
|
|
497
|
+
__classPrivateFieldGet(this, _SkyVerticalTabComponent_changeRef, "f").markForCheck();
|
|
490
498
|
}
|
|
491
499
|
}
|
|
500
|
+
_SkyVerticalTabComponent__ariaRole = new WeakMap(), _SkyVerticalTabComponent__contentRendered = new WeakMap(), _SkyVerticalTabComponent_tabIdOrDefault = new WeakMap(), _SkyVerticalTabComponent_defaultTabId = new WeakMap(), _SkyVerticalTabComponent_mobileSubscription = new WeakMap(), _SkyVerticalTabComponent_ngUnsubscribe = new WeakMap(), _SkyVerticalTabComponent_adapterService = new WeakMap(), _SkyVerticalTabComponent_changeRef = new WeakMap(), _SkyVerticalTabComponent_tabsetService = new WeakMap(), _SkyVerticalTabComponent_verticalTabMediaQueryService = new WeakMap(), _SkyVerticalTabComponent_instances = new WeakSet(), _SkyVerticalTabComponent_updateBreakpointAndResponsiveClass = function _SkyVerticalTabComponent_updateBreakpointAndResponsiveClass() {
|
|
501
|
+
if (this.tabContent) {
|
|
502
|
+
const width = __classPrivateFieldGet(this, _SkyVerticalTabComponent_adapterService, "f").getWidth(this.tabContent);
|
|
503
|
+
__classPrivateFieldGet(this, _SkyVerticalTabComponent_verticalTabMediaQueryService, "f").setBreakpointForWidth(width);
|
|
504
|
+
const newBreakpoint = __classPrivateFieldGet(this, _SkyVerticalTabComponent_verticalTabMediaQueryService, "f").current;
|
|
505
|
+
if (newBreakpoint) {
|
|
506
|
+
__classPrivateFieldGet(this, _SkyVerticalTabComponent_adapterService, "f").setResponsiveClass(this.tabContent, newBreakpoint);
|
|
507
|
+
}
|
|
508
|
+
__classPrivateFieldGet(this, _SkyVerticalTabComponent_changeRef, "f").markForCheck();
|
|
509
|
+
}
|
|
510
|
+
};
|
|
492
511
|
SkyVerticalTabComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyVerticalTabComponent, deps: [{ token: SkyVerticalTabsetAdapterService }, { token: i0.ChangeDetectorRef }, { token: SkyVerticalTabsetService }, { token: SkyVerticalTabMediaQueryService }], target: i0.ɵɵFactoryTarget.Component });
|
|
493
512
|
SkyVerticalTabComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: SkyVerticalTabComponent, selector: "sky-vertical-tab", inputs: { active: "active", ariaControls: "ariaControls", ariaRole: "ariaRole", disabled: "disabled", errorIndicator: "errorIndicator", tabHeaderCount: "tabHeaderCount", tabHeading: "tabHeading", showTabRightArrow: "showTabRightArrow", tabId: "tabId" }, host: { listeners: { "window:resize": "onWindowResize()" } }, providers: [
|
|
494
513
|
SkyVerticalTabMediaQueryService,
|
|
@@ -496,7 +515,7 @@ SkyVerticalTabComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0"
|
|
|
496
515
|
provide: SkyMediaQueryService,
|
|
497
516
|
useExisting: SkyVerticalTabMediaQueryService,
|
|
498
517
|
},
|
|
499
|
-
], viewQueries: [{ propertyName: "tabContent", first: true, predicate: ["tabContentWrapper"], descendants: true }], ngImport: i0, template: "<a\n class=\"sky-vertical-tab\"\n [attr.aria-controls]=\"isMobile ? null : ariaControls || tabContentPane.id\"\n [attr.aria-selected]=\"active\"\n [attr.id]=\"tabId\"\n [attr.role]=\"ariaRole\"\n [ngClass]=\"{\n 'sky-vertical-tab-active': active,\n 'sky-vertical-tab-disabled': disabled,\n 'sky-font-deemphasized': disabled,\n 'sky-deemphasized': disabled\n }\"\n [tabIndex]=\"tabIndex()\"\n (click)=\"activateTab()\"\n (keyup)=\"onTabButtonKeyUp($event)\"\n>\n <div class=\"sky-vertical-tab-display\">\n <div class=\"sky-vertical-tab-heading\">\n <span class=\"sky-vertical-tab-heading-value\">{{ tabHeading }}</span>\n <span\n class=\"sky-vertical-tab-count\"\n *ngIf=\"tabHeaderCount || tabHeaderCount === 0\"\n >\n ({{ tabHeaderCount }})\n </span>\n </div>\n <sky-status-indicator\n *ngIf=\"errorIndicator\"\n class=\"sky-vertical-tab-heading-error\"\n descriptionType=\"error\"\n indicatorType=\"danger\"\n ></sky-status-indicator>\n <sky-icon\n *ngIf=\"showTabRightArrow\"\n class=\"sky-vertical-tab-right-arrow\"\n icon=\"chevron-right\"\n >\n </sky-icon>\n </div>\n</a>\n\n<div #tabContentWrapper>\n <div\n class=\"sky-vertical-tab-content-pane\"\n role=\"tabpanel\"\n tabindex=\"0\"\n skyId\n [attr.aria-labelledby]=\"tabId\"\n [ngClass]=\"{ 'sky-vertical-tab-hidden': !active }\"\n #tabContentPane\n >\n <ng-content></ng-content>\n\n <div></div>\n </div>\n</div>\n", styles: [".sky-vertical-tab{cursor:pointer;padding:7px 0 7px 10px;margin:5px 0 5px 10px;display:flex;text-decoration:none}.sky-vertical-tab:not(.sky-deemphasized){color:#212327}.sky-vertical-tab:hover{background-color:#eeeeef}.sky-vertical-tab:focus-visible{outline:thin dotted;outline:-webkit-focus-ring-color auto 5px}.sky-vertical-tab:hover .sky-vertical-tab-right-arrow{color:#979ba2}.sky-vertical-tab-active{background-color:#eeeeef;color:#212327;padding-left:6px;border-left:4px solid #00b4f1}.sky-vertical-tab-hidden{display:none}.sky-vertical-tab-display{display:flex;flex-grow:1}.sky-vertical-tab-heading-error{padding-left:5px}.sky-vertical-tab-count{margin-left:5px}.sky-vertical-tab-disabled{cursor:not-allowed;pointer-events:none}.sky-vertical-tab-right-arrow{padding:3px 10px 0 0;color:#cdcfd2}:host-context(.sky-theme-modern) .sky-vertical-tab{color:#686c73;cursor:pointer;padding:10px 0 10px 10px;margin:10px 0 20px 10px}:host-context(.sky-theme-modern) .sky-vertical-tab:not(.sky-vertical-tab-active):not(:active):hover{color:#212327;background-color:transparent;padding-left:9px;border-left:1px solid #00b4f1}:host-context(.sky-theme-modern) .sky-vertical-tab:not(:active):focus-visible{outline:solid 2px #1870B8;outline-offset:-2px;box-shadow:0 1px 8px #0000004d}:host-context(.sky-theme-modern) .sky-vertical-tab:focus:active:hover{outline:none;background:none}:host-context(.sky-theme-modern) .sky-vertical-tab:active{border-left:3px solid #00b4f1;color:#212327;padding-left:7px}:host-context(.sky-theme-modern) .sky-vertical-tab .sky-vertical-tab-heading-error{padding-left:10px;position:relative;top:-2px}:host-context(.sky-theme-modern) .sky-vertical-tab-active{background:none;color:#212327;padding-left:7px;border-left:3px solid #1870B8}.sky-theme-modern .sky-vertical-tab{color:#686c73;cursor:pointer;padding:10px 0 10px 10px;margin:10px 0 20px 10px}.sky-theme-modern .sky-vertical-tab:not(.sky-vertical-tab-active):not(:active):hover{color:#212327;background-color:transparent;padding-left:9px;border-left:1px solid #00b4f1}.sky-theme-modern .sky-vertical-tab:not(:active):focus-visible{outline:solid 2px #1870B8;outline-offset:-2px;box-shadow:0 1px 8px #0000004d}.sky-theme-modern .sky-vertical-tab:focus:active:hover{outline:none;background:none}.sky-theme-modern .sky-vertical-tab:active{border-left:3px solid #00b4f1;color:#212327;padding-left:7px}.sky-theme-modern .sky-vertical-tab .sky-vertical-tab-heading-error{padding-left:10px;position:relative;top:-2px}.sky-theme-modern .sky-vertical-tab-active{background:none;color:#212327;padding-left:7px;border-left:3px solid #1870B8}\n"], dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.λ4, selector: "sky-icon", inputs: ["icon", "iconType", "size", "fixedWidth", "variant"] }, { kind: "directive", type: i1.λ2, selector: "[skyId]", exportAs: ["skyId"] }, { kind: "component", type: i5.λ10, selector: "sky-status-indicator", inputs: ["indicatorType", "descriptionType", "customDescription"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
518
|
+
], viewQueries: [{ propertyName: "tabContent", first: true, predicate: ["tabContentWrapper"], descendants: true }], ngImport: i0, template: "<a\n class=\"sky-vertical-tab\"\n [attr.aria-controls]=\"isMobile ? null : ariaControls || tabContentPane.id\"\n [attr.aria-selected]=\"active\"\n [attr.id]=\"tabId\"\n [attr.role]=\"isMobile ? undefined : ariaRole\"\n [ngClass]=\"{\n 'sky-vertical-tab-active': active,\n 'sky-vertical-tab-disabled': disabled,\n 'sky-font-deemphasized': disabled,\n 'sky-deemphasized': disabled\n }\"\n [tabIndex]=\"tabIndex()\"\n (click)=\"activateTab()\"\n (keyup)=\"onTabButtonKeyUp($event)\"\n>\n <div class=\"sky-vertical-tab-display\">\n <div class=\"sky-vertical-tab-heading\">\n <span class=\"sky-vertical-tab-heading-value\">{{ tabHeading }}</span>\n <span\n class=\"sky-vertical-tab-count\"\n *ngIf=\"tabHeaderCount || tabHeaderCount === 0\"\n >\n ({{ tabHeaderCount }})\n </span>\n </div>\n <sky-status-indicator\n *ngIf=\"errorIndicator\"\n class=\"sky-vertical-tab-heading-error\"\n descriptionType=\"error\"\n indicatorType=\"danger\"\n ></sky-status-indicator>\n <sky-icon\n *ngIf=\"isMobile && showTabRightArrow\"\n class=\"sky-vertical-tab-right-arrow\"\n icon=\"chevron-right\"\n >\n </sky-icon>\n </div>\n</a>\n\n<div #tabContentWrapper>\n <div\n class=\"sky-vertical-tab-content-pane\"\n role=\"tabpanel\"\n tabindex=\"0\"\n skyId\n [attr.aria-labelledby]=\"tabId\"\n [ngClass]=\"{ 'sky-vertical-tab-hidden': !active }\"\n #tabContentPane\n >\n <ng-content></ng-content>\n\n <div></div>\n </div>\n</div>\n", styles: [".sky-vertical-tab{cursor:pointer;padding:7px 0 7px 10px;margin:5px 0 5px 10px;display:flex;text-decoration:none}.sky-vertical-tab:not(.sky-deemphasized){color:#212327}.sky-vertical-tab:hover{background-color:#eeeeef}.sky-vertical-tab:focus-visible{outline:thin dotted;outline:-webkit-focus-ring-color auto 5px}.sky-vertical-tab:hover .sky-vertical-tab-right-arrow{color:#979ba2}.sky-vertical-tab-active{background-color:#eeeeef;color:#212327;padding-left:6px;border-left:4px solid #00b4f1}.sky-vertical-tab-hidden{display:none}.sky-vertical-tab-display{display:flex;flex-grow:1}.sky-vertical-tab-heading-error{padding-left:5px}.sky-vertical-tab-count{margin-left:5px}.sky-vertical-tab-disabled{cursor:not-allowed;pointer-events:none}.sky-vertical-tab-right-arrow{padding:3px 10px 0 0;color:#cdcfd2}:host-context(.sky-theme-modern) .sky-vertical-tab{color:#686c73;cursor:pointer;padding:10px 0 10px 10px;margin:10px 0 20px 10px}:host-context(.sky-theme-modern) .sky-vertical-tab:not(.sky-vertical-tab-active):not(:active):hover{color:#212327;background-color:transparent;padding-left:9px;border-left:1px solid #00b4f1}:host-context(.sky-theme-modern) .sky-vertical-tab:not(:active):focus-visible{outline:solid 2px #1870B8;outline-offset:-2px;box-shadow:0 1px 8px #0000004d}:host-context(.sky-theme-modern) .sky-vertical-tab:focus:active:hover{outline:none;background:none}:host-context(.sky-theme-modern) .sky-vertical-tab:active{border-left:3px solid #00b4f1;color:#212327;padding-left:7px}:host-context(.sky-theme-modern) .sky-vertical-tab .sky-vertical-tab-heading-error{padding-left:10px;position:relative;top:-2px}:host-context(.sky-theme-modern) .sky-vertical-tab-active{background:none;color:#212327;padding-left:7px;border-left:3px solid #1870B8}.sky-theme-modern .sky-vertical-tab{color:#686c73;cursor:pointer;padding:10px 0 10px 10px;margin:10px 0 20px 10px}.sky-theme-modern .sky-vertical-tab:not(.sky-vertical-tab-active):not(:active):hover{color:#212327;background-color:transparent;padding-left:9px;border-left:1px solid #00b4f1}.sky-theme-modern .sky-vertical-tab:not(:active):focus-visible{outline:solid 2px #1870B8;outline-offset:-2px;box-shadow:0 1px 8px #0000004d}.sky-theme-modern .sky-vertical-tab:focus:active:hover{outline:none;background:none}.sky-theme-modern .sky-vertical-tab:active{border-left:3px solid #00b4f1;color:#212327;padding-left:7px}.sky-theme-modern .sky-vertical-tab .sky-vertical-tab-heading-error{padding-left:10px;position:relative;top:-2px}.sky-theme-modern .sky-vertical-tab-active{background:none;color:#212327;padding-left:7px;border-left:3px solid #1870B8}\n"], dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.λ4, selector: "sky-icon", inputs: ["icon", "iconType", "size", "fixedWidth", "variant"] }, { kind: "directive", type: i1.λ2, selector: "[skyId]", exportAs: ["skyId"] }, { kind: "component", type: i5.λ10, selector: "sky-status-indicator", inputs: ["indicatorType", "descriptionType", "customDescription"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
500
519
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyVerticalTabComponent, decorators: [{
|
|
501
520
|
type: Component,
|
|
502
521
|
args: [{ selector: 'sky-vertical-tab', providers: [
|
|
@@ -505,7 +524,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
|
|
|
505
524
|
provide: SkyMediaQueryService,
|
|
506
525
|
useExisting: SkyVerticalTabMediaQueryService,
|
|
507
526
|
},
|
|
508
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<a\n class=\"sky-vertical-tab\"\n [attr.aria-controls]=\"isMobile ? null : ariaControls || tabContentPane.id\"\n [attr.aria-selected]=\"active\"\n [attr.id]=\"tabId\"\n [attr.role]=\"ariaRole\"\n [ngClass]=\"{\n 'sky-vertical-tab-active': active,\n 'sky-vertical-tab-disabled': disabled,\n 'sky-font-deemphasized': disabled,\n 'sky-deemphasized': disabled\n }\"\n [tabIndex]=\"tabIndex()\"\n (click)=\"activateTab()\"\n (keyup)=\"onTabButtonKeyUp($event)\"\n>\n <div class=\"sky-vertical-tab-display\">\n <div class=\"sky-vertical-tab-heading\">\n <span class=\"sky-vertical-tab-heading-value\">{{ tabHeading }}</span>\n <span\n class=\"sky-vertical-tab-count\"\n *ngIf=\"tabHeaderCount || tabHeaderCount === 0\"\n >\n ({{ tabHeaderCount }})\n </span>\n </div>\n <sky-status-indicator\n *ngIf=\"errorIndicator\"\n class=\"sky-vertical-tab-heading-error\"\n descriptionType=\"error\"\n indicatorType=\"danger\"\n ></sky-status-indicator>\n <sky-icon\n *ngIf=\"showTabRightArrow\"\n class=\"sky-vertical-tab-right-arrow\"\n icon=\"chevron-right\"\n >\n </sky-icon>\n </div>\n</a>\n\n<div #tabContentWrapper>\n <div\n class=\"sky-vertical-tab-content-pane\"\n role=\"tabpanel\"\n tabindex=\"0\"\n skyId\n [attr.aria-labelledby]=\"tabId\"\n [ngClass]=\"{ 'sky-vertical-tab-hidden': !active }\"\n #tabContentPane\n >\n <ng-content></ng-content>\n\n <div></div>\n </div>\n</div>\n", styles: [".sky-vertical-tab{cursor:pointer;padding:7px 0 7px 10px;margin:5px 0 5px 10px;display:flex;text-decoration:none}.sky-vertical-tab:not(.sky-deemphasized){color:#212327}.sky-vertical-tab:hover{background-color:#eeeeef}.sky-vertical-tab:focus-visible{outline:thin dotted;outline:-webkit-focus-ring-color auto 5px}.sky-vertical-tab:hover .sky-vertical-tab-right-arrow{color:#979ba2}.sky-vertical-tab-active{background-color:#eeeeef;color:#212327;padding-left:6px;border-left:4px solid #00b4f1}.sky-vertical-tab-hidden{display:none}.sky-vertical-tab-display{display:flex;flex-grow:1}.sky-vertical-tab-heading-error{padding-left:5px}.sky-vertical-tab-count{margin-left:5px}.sky-vertical-tab-disabled{cursor:not-allowed;pointer-events:none}.sky-vertical-tab-right-arrow{padding:3px 10px 0 0;color:#cdcfd2}:host-context(.sky-theme-modern) .sky-vertical-tab{color:#686c73;cursor:pointer;padding:10px 0 10px 10px;margin:10px 0 20px 10px}:host-context(.sky-theme-modern) .sky-vertical-tab:not(.sky-vertical-tab-active):not(:active):hover{color:#212327;background-color:transparent;padding-left:9px;border-left:1px solid #00b4f1}:host-context(.sky-theme-modern) .sky-vertical-tab:not(:active):focus-visible{outline:solid 2px #1870B8;outline-offset:-2px;box-shadow:0 1px 8px #0000004d}:host-context(.sky-theme-modern) .sky-vertical-tab:focus:active:hover{outline:none;background:none}:host-context(.sky-theme-modern) .sky-vertical-tab:active{border-left:3px solid #00b4f1;color:#212327;padding-left:7px}:host-context(.sky-theme-modern) .sky-vertical-tab .sky-vertical-tab-heading-error{padding-left:10px;position:relative;top:-2px}:host-context(.sky-theme-modern) .sky-vertical-tab-active{background:none;color:#212327;padding-left:7px;border-left:3px solid #1870B8}.sky-theme-modern .sky-vertical-tab{color:#686c73;cursor:pointer;padding:10px 0 10px 10px;margin:10px 0 20px 10px}.sky-theme-modern .sky-vertical-tab:not(.sky-vertical-tab-active):not(:active):hover{color:#212327;background-color:transparent;padding-left:9px;border-left:1px solid #00b4f1}.sky-theme-modern .sky-vertical-tab:not(:active):focus-visible{outline:solid 2px #1870B8;outline-offset:-2px;box-shadow:0 1px 8px #0000004d}.sky-theme-modern .sky-vertical-tab:focus:active:hover{outline:none;background:none}.sky-theme-modern .sky-vertical-tab:active{border-left:3px solid #00b4f1;color:#212327;padding-left:7px}.sky-theme-modern .sky-vertical-tab .sky-vertical-tab-heading-error{padding-left:10px;position:relative;top:-2px}.sky-theme-modern .sky-vertical-tab-active{background:none;color:#212327;padding-left:7px;border-left:3px solid #1870B8}\n"] }]
|
|
527
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<a\n class=\"sky-vertical-tab\"\n [attr.aria-controls]=\"isMobile ? null : ariaControls || tabContentPane.id\"\n [attr.aria-selected]=\"active\"\n [attr.id]=\"tabId\"\n [attr.role]=\"isMobile ? undefined : ariaRole\"\n [ngClass]=\"{\n 'sky-vertical-tab-active': active,\n 'sky-vertical-tab-disabled': disabled,\n 'sky-font-deemphasized': disabled,\n 'sky-deemphasized': disabled\n }\"\n [tabIndex]=\"tabIndex()\"\n (click)=\"activateTab()\"\n (keyup)=\"onTabButtonKeyUp($event)\"\n>\n <div class=\"sky-vertical-tab-display\">\n <div class=\"sky-vertical-tab-heading\">\n <span class=\"sky-vertical-tab-heading-value\">{{ tabHeading }}</span>\n <span\n class=\"sky-vertical-tab-count\"\n *ngIf=\"tabHeaderCount || tabHeaderCount === 0\"\n >\n ({{ tabHeaderCount }})\n </span>\n </div>\n <sky-status-indicator\n *ngIf=\"errorIndicator\"\n class=\"sky-vertical-tab-heading-error\"\n descriptionType=\"error\"\n indicatorType=\"danger\"\n ></sky-status-indicator>\n <sky-icon\n *ngIf=\"isMobile && showTabRightArrow\"\n class=\"sky-vertical-tab-right-arrow\"\n icon=\"chevron-right\"\n >\n </sky-icon>\n </div>\n</a>\n\n<div #tabContentWrapper>\n <div\n class=\"sky-vertical-tab-content-pane\"\n role=\"tabpanel\"\n tabindex=\"0\"\n skyId\n [attr.aria-labelledby]=\"tabId\"\n [ngClass]=\"{ 'sky-vertical-tab-hidden': !active }\"\n #tabContentPane\n >\n <ng-content></ng-content>\n\n <div></div>\n </div>\n</div>\n", styles: [".sky-vertical-tab{cursor:pointer;padding:7px 0 7px 10px;margin:5px 0 5px 10px;display:flex;text-decoration:none}.sky-vertical-tab:not(.sky-deemphasized){color:#212327}.sky-vertical-tab:hover{background-color:#eeeeef}.sky-vertical-tab:focus-visible{outline:thin dotted;outline:-webkit-focus-ring-color auto 5px}.sky-vertical-tab:hover .sky-vertical-tab-right-arrow{color:#979ba2}.sky-vertical-tab-active{background-color:#eeeeef;color:#212327;padding-left:6px;border-left:4px solid #00b4f1}.sky-vertical-tab-hidden{display:none}.sky-vertical-tab-display{display:flex;flex-grow:1}.sky-vertical-tab-heading-error{padding-left:5px}.sky-vertical-tab-count{margin-left:5px}.sky-vertical-tab-disabled{cursor:not-allowed;pointer-events:none}.sky-vertical-tab-right-arrow{padding:3px 10px 0 0;color:#cdcfd2}:host-context(.sky-theme-modern) .sky-vertical-tab{color:#686c73;cursor:pointer;padding:10px 0 10px 10px;margin:10px 0 20px 10px}:host-context(.sky-theme-modern) .sky-vertical-tab:not(.sky-vertical-tab-active):not(:active):hover{color:#212327;background-color:transparent;padding-left:9px;border-left:1px solid #00b4f1}:host-context(.sky-theme-modern) .sky-vertical-tab:not(:active):focus-visible{outline:solid 2px #1870B8;outline-offset:-2px;box-shadow:0 1px 8px #0000004d}:host-context(.sky-theme-modern) .sky-vertical-tab:focus:active:hover{outline:none;background:none}:host-context(.sky-theme-modern) .sky-vertical-tab:active{border-left:3px solid #00b4f1;color:#212327;padding-left:7px}:host-context(.sky-theme-modern) .sky-vertical-tab .sky-vertical-tab-heading-error{padding-left:10px;position:relative;top:-2px}:host-context(.sky-theme-modern) .sky-vertical-tab-active{background:none;color:#212327;padding-left:7px;border-left:3px solid #1870B8}.sky-theme-modern .sky-vertical-tab{color:#686c73;cursor:pointer;padding:10px 0 10px 10px;margin:10px 0 20px 10px}.sky-theme-modern .sky-vertical-tab:not(.sky-vertical-tab-active):not(:active):hover{color:#212327;background-color:transparent;padding-left:9px;border-left:1px solid #00b4f1}.sky-theme-modern .sky-vertical-tab:not(:active):focus-visible{outline:solid 2px #1870B8;outline-offset:-2px;box-shadow:0 1px 8px #0000004d}.sky-theme-modern .sky-vertical-tab:focus:active:hover{outline:none;background:none}.sky-theme-modern .sky-vertical-tab:active{border-left:3px solid #00b4f1;color:#212327;padding-left:7px}.sky-theme-modern .sky-vertical-tab .sky-vertical-tab-heading-error{padding-left:10px;position:relative;top:-2px}.sky-theme-modern .sky-vertical-tab-active{background:none;color:#212327;padding-left:7px;border-left:3px solid #1870B8}\n"] }]
|
|
509
528
|
}], ctorParameters: function () { return [{ type: SkyVerticalTabsetAdapterService }, { type: i0.ChangeDetectorRef }, { type: SkyVerticalTabsetService }, { type: SkyVerticalTabMediaQueryService }]; }, propDecorators: { active: [{
|
|
510
529
|
type: Input
|
|
511
530
|
}], ariaControls: [{
|
|
@@ -532,67 +551,60 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
|
|
|
532
551
|
args: ['window:resize']
|
|
533
552
|
}] } });
|
|
534
553
|
|
|
554
|
+
var _SkyVerticalTabsetGroupComponent_ngUnsubscribe, _SkyVerticalTabsetGroupComponent_openBeforeTabsHidden, _SkyVerticalTabsetGroupComponent_tabService, _SkyVerticalTabsetGroupComponent_changeRef;
|
|
535
555
|
class SkyVerticalTabsetGroupComponent {
|
|
536
556
|
constructor(tabService, changeRef) {
|
|
537
|
-
this
|
|
538
|
-
this
|
|
539
|
-
this
|
|
540
|
-
this
|
|
541
|
-
this._open = false;
|
|
557
|
+
_SkyVerticalTabsetGroupComponent_ngUnsubscribe.set(this, new Subject());
|
|
558
|
+
_SkyVerticalTabsetGroupComponent_openBeforeTabsHidden.set(this, false);
|
|
559
|
+
_SkyVerticalTabsetGroupComponent_tabService.set(this, void 0);
|
|
560
|
+
_SkyVerticalTabsetGroupComponent_changeRef.set(this, void 0);
|
|
542
561
|
this.tabClicked = () => {
|
|
543
|
-
this.
|
|
562
|
+
__classPrivateFieldGet(this, _SkyVerticalTabsetGroupComponent_changeRef, "f").markForCheck();
|
|
544
563
|
};
|
|
545
564
|
this.tabsHidden = () => {
|
|
546
565
|
// this fixes an animation bug with ngIf when the parent component goes from visible to hidden
|
|
547
|
-
this
|
|
566
|
+
__classPrivateFieldSet(this, _SkyVerticalTabsetGroupComponent_openBeforeTabsHidden, this.open, "f");
|
|
548
567
|
this.open = false;
|
|
549
|
-
this.
|
|
568
|
+
__classPrivateFieldGet(this, _SkyVerticalTabsetGroupComponent_changeRef, "f").markForCheck();
|
|
550
569
|
};
|
|
551
570
|
this.tabsShown = () => {
|
|
552
|
-
this.open = this
|
|
553
|
-
this.
|
|
571
|
+
this.open = __classPrivateFieldGet(this, _SkyVerticalTabsetGroupComponent_openBeforeTabsHidden, "f");
|
|
572
|
+
__classPrivateFieldGet(this, _SkyVerticalTabsetGroupComponent_changeRef, "f").markForCheck();
|
|
554
573
|
};
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
* Indicates whether the collapsible group is expanded.
|
|
558
|
-
* @default false
|
|
559
|
-
*/
|
|
560
|
-
set open(value) {
|
|
561
|
-
this._open = value;
|
|
562
|
-
}
|
|
563
|
-
get open() {
|
|
564
|
-
return !this.disabled && this._open;
|
|
574
|
+
__classPrivateFieldSet(this, _SkyVerticalTabsetGroupComponent_tabService, tabService, "f");
|
|
575
|
+
__classPrivateFieldSet(this, _SkyVerticalTabsetGroupComponent_changeRef, changeRef, "f");
|
|
565
576
|
}
|
|
566
577
|
ngOnInit() {
|
|
567
|
-
this.
|
|
568
|
-
.pipe(takeUntil(this
|
|
578
|
+
__classPrivateFieldGet(this, _SkyVerticalTabsetGroupComponent_tabService, "f").hidingTabs
|
|
579
|
+
.pipe(takeUntil(__classPrivateFieldGet(this, _SkyVerticalTabsetGroupComponent_ngUnsubscribe, "f")))
|
|
569
580
|
.subscribe(this.tabsHidden);
|
|
570
|
-
this.
|
|
571
|
-
.pipe(takeUntil(this
|
|
581
|
+
__classPrivateFieldGet(this, _SkyVerticalTabsetGroupComponent_tabService, "f").showingTabs
|
|
582
|
+
.pipe(takeUntil(__classPrivateFieldGet(this, _SkyVerticalTabsetGroupComponent_ngUnsubscribe, "f")))
|
|
572
583
|
.subscribe(this.tabsShown);
|
|
573
|
-
this.
|
|
574
|
-
.pipe(takeUntil(this
|
|
584
|
+
__classPrivateFieldGet(this, _SkyVerticalTabsetGroupComponent_tabService, "f").tabClicked
|
|
585
|
+
.pipe(takeUntil(__classPrivateFieldGet(this, _SkyVerticalTabsetGroupComponent_ngUnsubscribe, "f")))
|
|
575
586
|
.subscribe(this.tabClicked);
|
|
576
587
|
}
|
|
577
588
|
ngOnDestroy() {
|
|
578
|
-
this.
|
|
579
|
-
this.
|
|
589
|
+
__classPrivateFieldGet(this, _SkyVerticalTabsetGroupComponent_ngUnsubscribe, "f").next();
|
|
590
|
+
__classPrivateFieldGet(this, _SkyVerticalTabsetGroupComponent_ngUnsubscribe, "f").complete();
|
|
580
591
|
}
|
|
581
592
|
toggleMenuOpen() {
|
|
582
593
|
if (!this.disabled) {
|
|
583
594
|
this.open = !this.open;
|
|
584
595
|
}
|
|
585
|
-
this.
|
|
596
|
+
__classPrivateFieldGet(this, _SkyVerticalTabsetGroupComponent_changeRef, "f").markForCheck();
|
|
586
597
|
}
|
|
587
598
|
subMenuOpen() {
|
|
588
|
-
return this.tabs && this.tabs.find((t) => t.active) !== undefined;
|
|
599
|
+
return !!this.tabs && this.tabs.find((t) => !!t.active) !== undefined;
|
|
589
600
|
}
|
|
590
601
|
}
|
|
602
|
+
_SkyVerticalTabsetGroupComponent_ngUnsubscribe = new WeakMap(), _SkyVerticalTabsetGroupComponent_openBeforeTabsHidden = new WeakMap(), _SkyVerticalTabsetGroupComponent_tabService = new WeakMap(), _SkyVerticalTabsetGroupComponent_changeRef = new WeakMap();
|
|
591
603
|
SkyVerticalTabsetGroupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyVerticalTabsetGroupComponent, deps: [{ token: SkyVerticalTabsetService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
592
|
-
SkyVerticalTabsetGroupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: SkyVerticalTabsetGroupComponent, selector: "sky-vertical-tabset-group", inputs: { disabled: "disabled", groupHeading: "groupHeading", open: "open" }, queries: [{ propertyName: "tabs", predicate: SkyVerticalTabComponent }], ngImport: i0, template: "<div class=\"sky-vertical-tabset-group\">\n <!-- [ngClass] includes font classes for both modern and default styles -->\n <div\n class=\"sky-vertical-tabset-group-header\"\n [ngClass]=\"{\n 'sky-vertical-tabset-group-header-sub-open sky-font-emphasized sky-emphasized':\n subMenuOpen(),\n 'sky-font-deemphasized': disabled,\n 'sky-deemphasized': disabled,\n 'sky-vertical-tabset-disabled': disabled\n }\"\n [tabIndex]=\"-1\"\n >\n <button\n class=\"sky-padding-even-default\"\n type=\"button\"\n skyId\n [attr.aria-controls]=\"groupContent.id\"\n [attr.aria-expanded]=\"open\"\n (click)=\"toggleMenuOpen()\"\n #groupHeadingButton\n >\n {{ groupHeading }}\n <sky-expansion-indicator\n class=\"sky-vertical-tabset-group-expansion-indicator\"\n [direction]=\"open ? 'up' : 'down'\"\n >\n </sky-expansion-indicator>\n </button>\n </div>\n <div\n class=\"sky-vertical-tabset-group-content\"\n
|
|
604
|
+
SkyVerticalTabsetGroupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: SkyVerticalTabsetGroupComponent, selector: "sky-vertical-tabset-group", inputs: { disabled: "disabled", groupHeading: "groupHeading", open: "open" }, queries: [{ propertyName: "tabs", predicate: SkyVerticalTabComponent }], ngImport: i0, template: "<div class=\"sky-vertical-tabset-group\">\n <!-- [ngClass] includes font classes for both modern and default styles -->\n <div\n class=\"sky-vertical-tabset-group-header\"\n [ngClass]=\"{\n 'sky-vertical-tabset-group-header-sub-open sky-font-emphasized sky-emphasized':\n subMenuOpen(),\n 'sky-font-deemphasized': disabled,\n 'sky-deemphasized': disabled,\n 'sky-vertical-tabset-disabled': disabled\n }\"\n [tabIndex]=\"-1\"\n >\n <button\n class=\"sky-padding-even-default\"\n type=\"button\"\n skyId\n [attr.aria-controls]=\"groupContent.id\"\n [attr.aria-expanded]=\"!disabled && open\"\n (click)=\"toggleMenuOpen()\"\n #groupHeadingButton\n >\n {{ groupHeading }}\n <sky-expansion-indicator\n class=\"sky-vertical-tabset-group-expansion-indicator\"\n [direction]=\"!disabled && open ? 'up' : 'down'\"\n >\n </sky-expansion-indicator>\n </button>\n </div>\n <div\n class=\"sky-vertical-tabset-group-content\"\n skyId\n [attr.labelledby]=\"groupHeadingButton.id\"\n [@skyAnimationSlide]=\"!disabled && open ? 'down' : 'up'\"\n #groupContent\n >\n <ng-content></ng-content>\n </div>\n</div>\n", styles: [".sky-vertical-tabset-group{border-bottom:1px solid #e2e3e4;margin:5px 0 5px 5px}.sky-vertical-tabset-group-header button{cursor:pointer;display:flex;justify-content:space-between;border:none;width:100%;text-align:left;background:none}.sky-vertical-tabset-group-content{overflow:hidden;border-top:1px solid #e2e3e4}:host ::ng-deep .sky-vertical-tabset-group-expansion-indicator>button{font-size:14px!important}.sky-vertical-tabset-disabled{cursor:not-allowed;pointer-events:none}:host-context(.sky-theme-modern) .sky-vertical-tabset-group{border:none;margin:10px 0}:host-context(.sky-theme-modern) .sky-vertical-tabset-group-content{border:none;padding-left:25px}:host-context(.sky-theme-modern) .sky-vertical-tabset-group-header{position:relative}:host-context(.sky-theme-modern) .sky-vertical-tabset-group-expansion-indicator{position:absolute;top:6px;right:5px}.sky-theme-modern .sky-vertical-tabset-group{border:none;margin:10px 0}.sky-theme-modern .sky-vertical-tabset-group-content{border:none;padding-left:25px}.sky-theme-modern .sky-vertical-tabset-group-header{position:relative}.sky-theme-modern .sky-vertical-tabset-group-expansion-indicator{position:absolute;top:6px;right:5px}\n"], dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.λ2, selector: "[skyId]", exportAs: ["skyId"] }, { kind: "component", type: i5.λ15, selector: "sky-expansion-indicator", inputs: ["direction"] }], animations: [skyAnimationSlide], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
593
605
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyVerticalTabsetGroupComponent, decorators: [{
|
|
594
606
|
type: Component,
|
|
595
|
-
args: [{ selector: 'sky-vertical-tabset-group', changeDetection: ChangeDetectionStrategy.OnPush, animations: [skyAnimationSlide], template: "<div class=\"sky-vertical-tabset-group\">\n <!-- [ngClass] includes font classes for both modern and default styles -->\n <div\n class=\"sky-vertical-tabset-group-header\"\n [ngClass]=\"{\n 'sky-vertical-tabset-group-header-sub-open sky-font-emphasized sky-emphasized':\n subMenuOpen(),\n 'sky-font-deemphasized': disabled,\n 'sky-deemphasized': disabled,\n 'sky-vertical-tabset-disabled': disabled\n }\"\n [tabIndex]=\"-1\"\n >\n <button\n class=\"sky-padding-even-default\"\n type=\"button\"\n skyId\n [attr.aria-controls]=\"groupContent.id\"\n [attr.aria-expanded]=\"open\"\n (click)=\"toggleMenuOpen()\"\n #groupHeadingButton\n >\n {{ groupHeading }}\n <sky-expansion-indicator\n class=\"sky-vertical-tabset-group-expansion-indicator\"\n [direction]=\"open ? 'up' : 'down'\"\n >\n </sky-expansion-indicator>\n </button>\n </div>\n <div\n class=\"sky-vertical-tabset-group-content\"\n
|
|
607
|
+
args: [{ selector: 'sky-vertical-tabset-group', changeDetection: ChangeDetectionStrategy.OnPush, animations: [skyAnimationSlide], template: "<div class=\"sky-vertical-tabset-group\">\n <!-- [ngClass] includes font classes for both modern and default styles -->\n <div\n class=\"sky-vertical-tabset-group-header\"\n [ngClass]=\"{\n 'sky-vertical-tabset-group-header-sub-open sky-font-emphasized sky-emphasized':\n subMenuOpen(),\n 'sky-font-deemphasized': disabled,\n 'sky-deemphasized': disabled,\n 'sky-vertical-tabset-disabled': disabled\n }\"\n [tabIndex]=\"-1\"\n >\n <button\n class=\"sky-padding-even-default\"\n type=\"button\"\n skyId\n [attr.aria-controls]=\"groupContent.id\"\n [attr.aria-expanded]=\"!disabled && open\"\n (click)=\"toggleMenuOpen()\"\n #groupHeadingButton\n >\n {{ groupHeading }}\n <sky-expansion-indicator\n class=\"sky-vertical-tabset-group-expansion-indicator\"\n [direction]=\"!disabled && open ? 'up' : 'down'\"\n >\n </sky-expansion-indicator>\n </button>\n </div>\n <div\n class=\"sky-vertical-tabset-group-content\"\n skyId\n [attr.labelledby]=\"groupHeadingButton.id\"\n [@skyAnimationSlide]=\"!disabled && open ? 'down' : 'up'\"\n #groupContent\n >\n <ng-content></ng-content>\n </div>\n</div>\n", styles: [".sky-vertical-tabset-group{border-bottom:1px solid #e2e3e4;margin:5px 0 5px 5px}.sky-vertical-tabset-group-header button{cursor:pointer;display:flex;justify-content:space-between;border:none;width:100%;text-align:left;background:none}.sky-vertical-tabset-group-content{overflow:hidden;border-top:1px solid #e2e3e4}:host ::ng-deep .sky-vertical-tabset-group-expansion-indicator>button{font-size:14px!important}.sky-vertical-tabset-disabled{cursor:not-allowed;pointer-events:none}:host-context(.sky-theme-modern) .sky-vertical-tabset-group{border:none;margin:10px 0}:host-context(.sky-theme-modern) .sky-vertical-tabset-group-content{border:none;padding-left:25px}:host-context(.sky-theme-modern) .sky-vertical-tabset-group-header{position:relative}:host-context(.sky-theme-modern) .sky-vertical-tabset-group-expansion-indicator{position:absolute;top:6px;right:5px}.sky-theme-modern .sky-vertical-tabset-group{border:none;margin:10px 0}.sky-theme-modern .sky-vertical-tabset-group-content{border:none;padding-left:25px}.sky-theme-modern .sky-vertical-tabset-group-header{position:relative}.sky-theme-modern .sky-vertical-tabset-group-expansion-indicator{position:absolute;top:6px;right:5px}\n"] }]
|
|
596
608
|
}], ctorParameters: function () { return [{ type: SkyVerticalTabsetService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { disabled: [{
|
|
597
609
|
type: Input
|
|
598
610
|
}], groupHeading: [{
|
|
@@ -604,12 +616,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
|
|
|
604
616
|
args: [SkyVerticalTabComponent]
|
|
605
617
|
}] } });
|
|
606
618
|
|
|
619
|
+
var _SkyVerticalTabsetComponent_ngUnsubscribe, _SkyVerticalTabsetComponent__ariaRole, _SkyVerticalTabsetComponent_resources, _SkyVerticalTabsetComponent_changeRef;
|
|
607
620
|
class SkyVerticalTabsetComponent {
|
|
608
621
|
constructor(adapterService, tabService, resources, changeRef) {
|
|
609
622
|
this.adapterService = adapterService;
|
|
610
623
|
this.tabService = tabService;
|
|
611
|
-
this.resources = resources;
|
|
612
|
-
this.changeRef = changeRef;
|
|
613
624
|
/**
|
|
614
625
|
* Indicates whether the vertical tabset loads tab content during initialization so that it
|
|
615
626
|
* displays content without moving around elements in the content container.
|
|
@@ -622,7 +633,12 @@ class SkyVerticalTabsetComponent {
|
|
|
622
633
|
*/
|
|
623
634
|
this.activeChange = new EventEmitter();
|
|
624
635
|
this.isMobile = false;
|
|
625
|
-
this
|
|
636
|
+
_SkyVerticalTabsetComponent_ngUnsubscribe.set(this, new Subject());
|
|
637
|
+
_SkyVerticalTabsetComponent__ariaRole.set(this, 'tablist');
|
|
638
|
+
_SkyVerticalTabsetComponent_resources.set(this, void 0);
|
|
639
|
+
_SkyVerticalTabsetComponent_changeRef.set(this, void 0);
|
|
640
|
+
__classPrivateFieldSet(this, _SkyVerticalTabsetComponent_resources, resources, "f");
|
|
641
|
+
__classPrivateFieldSet(this, _SkyVerticalTabsetComponent_changeRef, changeRef, "f");
|
|
626
642
|
}
|
|
627
643
|
/**
|
|
628
644
|
* Specifies an ARIA role for the vertical tabset
|
|
@@ -635,38 +651,35 @@ class SkyVerticalTabsetComponent {
|
|
|
635
651
|
* In the next major version, this property will be automatically set to `tablist`.
|
|
636
652
|
*/
|
|
637
653
|
get ariaRole() {
|
|
638
|
-
|
|
639
|
-
return undefined;
|
|
640
|
-
}
|
|
641
|
-
return this._ariaRole || 'tablist';
|
|
654
|
+
return __classPrivateFieldGet(this, _SkyVerticalTabsetComponent__ariaRole, "f");
|
|
642
655
|
}
|
|
643
656
|
set ariaRole(value) {
|
|
644
|
-
this
|
|
657
|
+
__classPrivateFieldSet(this, _SkyVerticalTabsetComponent__ariaRole, value !== null && value !== void 0 ? value : 'tablist', "f");
|
|
645
658
|
}
|
|
646
659
|
ngOnInit() {
|
|
647
660
|
this.tabService.maintainTabContent = this.maintainTabContent;
|
|
648
661
|
this.tabService.indexChanged
|
|
649
|
-
.pipe(takeUntil(this
|
|
662
|
+
.pipe(takeUntil(__classPrivateFieldGet(this, _SkyVerticalTabsetComponent_ngUnsubscribe, "f")))
|
|
650
663
|
.subscribe((index) => {
|
|
651
664
|
this.activeChange.emit(index);
|
|
652
665
|
if (this.contentWrapper) {
|
|
653
666
|
this.adapterService.scrollToContentTop(this.contentWrapper);
|
|
654
667
|
}
|
|
655
|
-
this.
|
|
668
|
+
__classPrivateFieldGet(this, _SkyVerticalTabsetComponent_changeRef, "f").markForCheck();
|
|
656
669
|
});
|
|
657
670
|
this.tabService.switchingMobile
|
|
658
|
-
.pipe(takeUntil(this
|
|
671
|
+
.pipe(takeUntil(__classPrivateFieldGet(this, _SkyVerticalTabsetComponent_ngUnsubscribe, "f")))
|
|
659
672
|
.subscribe((mobile) => {
|
|
660
673
|
this.isMobile = mobile;
|
|
661
|
-
this.
|
|
674
|
+
__classPrivateFieldGet(this, _SkyVerticalTabsetComponent_changeRef, "f").markForCheck();
|
|
662
675
|
});
|
|
663
676
|
if (this.tabService.isMobile()) {
|
|
664
677
|
this.isMobile = true;
|
|
665
678
|
this.tabService.animationContentVisibleState = VISIBLE_STATE;
|
|
666
|
-
this.
|
|
679
|
+
__classPrivateFieldGet(this, _SkyVerticalTabsetComponent_changeRef, "f").markForCheck();
|
|
667
680
|
}
|
|
668
681
|
if (!this.showTabsText) {
|
|
669
|
-
this
|
|
682
|
+
__classPrivateFieldGet(this, _SkyVerticalTabsetComponent_resources, "f")
|
|
670
683
|
.getString('skyux_vertical_tabs_show_tabs_text')
|
|
671
684
|
.pipe(take(1))
|
|
672
685
|
.subscribe((resource) => {
|
|
@@ -683,12 +696,13 @@ class SkyVerticalTabsetComponent {
|
|
|
683
696
|
this.tabService.updateContent();
|
|
684
697
|
}
|
|
685
698
|
ngOnDestroy() {
|
|
686
|
-
this.
|
|
687
|
-
this.
|
|
699
|
+
__classPrivateFieldGet(this, _SkyVerticalTabsetComponent_ngUnsubscribe, "f").next();
|
|
700
|
+
__classPrivateFieldGet(this, _SkyVerticalTabsetComponent_ngUnsubscribe, "f").complete();
|
|
688
701
|
}
|
|
689
702
|
}
|
|
703
|
+
_SkyVerticalTabsetComponent_ngUnsubscribe = new WeakMap(), _SkyVerticalTabsetComponent__ariaRole = new WeakMap(), _SkyVerticalTabsetComponent_resources = new WeakMap(), _SkyVerticalTabsetComponent_changeRef = new WeakMap();
|
|
690
704
|
SkyVerticalTabsetComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyVerticalTabsetComponent, deps: [{ token: SkyVerticalTabsetAdapterService }, { token: SkyVerticalTabsetService }, { token: i3.SkyLibResourcesService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
691
|
-
SkyVerticalTabsetComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: SkyVerticalTabsetComponent, selector: "sky-vertical-tabset", inputs: { showTabsText: "showTabsText", ariaLabel: "ariaLabel", ariaLabelledBy: "ariaLabelledBy", ariaRole: "ariaRole", maintainTabContent: "maintainTabContent" }, outputs: { activeChange: "activeChange" }, providers: [SkyVerticalTabsetService], viewQueries: [{ propertyName: "tabGroups", first: true, predicate: ["groupContainerWrapper"], descendants: true }, { propertyName: "content", first: true, predicate: ["skySideContent"], descendants: true }, { propertyName: "contentWrapper", first: true, predicate: ["contentContainerWrapper"], descendants: true }], ngImport: i0, template: "<div class=\"sky-vertical-tabset\" (window:resize)=\"tabService.updateContent()\">\n <div\n *ngIf=\"maintainTabContent || tabService.tabsVisible()\"\n aria-orientation=\"vertical\"\n class=\"sky-vertical-tabset-group-container\"\n [ngClass]=\"{ 'sky-vertical-tabset-hidden': !tabService.tabsVisible() }\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledBy\"\n [attr.role]=\"ariaRole\"\n [@tabGroupEnter]=\"tabService.animationTabsVisibleState\"\n #groupContainerWrapper\n >\n <ng-content></ng-content>\n </div>\n <div\n *ngIf=\"maintainTabContent || tabService.contentVisible()\"\n class=\"sky-vertical-tabset-content\"\n [ngClass]=\"{\n 'sky-vertical-tabset-content-hidden': !tabService.contentVisible()\n }\"\n [@contentEnter]=\"tabService.animationContentVisibleState\"\n #contentContainerWrapper\n >\n <div #skySideContent></div>\n <button\n *ngIf=\"!tabService.tabsVisible()\"\n (click)=\"tabService.showTabs()\"\n class=\"sky-btn sky-btn-primary sky-vertical-tabset-show-tabs-btn\"\n >\n <sky-icon icon=\"chevron-left\"></sky-icon>\n {{ showTabsText }}\n </button>\n </div>\n</div>\n", styles: [":host .sky-vertical-tabset{display:block;height:auto}:host .sky-vertical-tabset-group-container{border-right:none}:host-context(.sky-responsive-container-xs) .sky-vertical-tabset,:host-context(.sky-responsive-container-sm) .sky-vertical-tabset,:host-context(.sky-responsive-container-md) .sky-vertical-tabset,:host-context(.sky-responsive-container-lg) .sky-vertical-tabset{display:block;height:auto}:host-context(.sky-responsive-container-xs) .sky-vertical-tabset-group-container,:host-context(.sky-responsive-container-sm) .sky-vertical-tabset-group-container,:host-context(.sky-responsive-container-md) .sky-vertical-tabset-group-container,:host-context(.sky-responsive-container-lg) .sky-vertical-tabset-group-container{border-right:none}@media (min-width: 768px){:host .sky-vertical-tabset{display:flex;height:100%}:host .sky-vertical-tabset-group-container{border-right:1px solid #cdcfd2}}:host-context(.sky-responsive-container-sm) .sky-vertical-tabset,:host-context(.sky-responsive-container-md) .sky-vertical-tabset,:host-context(.sky-responsive-container-lg) .sky-vertical-tabset{display:flex;height:100%}:host-context(.sky-responsive-container-sm) .sky-vertical-tabset-group-container,:host-context(.sky-responsive-container-md) .sky-vertical-tabset-group-container,:host-context(.sky-responsive-container-lg) .sky-vertical-tabset-group-container{border-right:1px solid #cdcfd2}.sky-vertical-tabset-hidden{display:none}.sky-vertical-tabset-content{margin:10px 0 0 10px;flex-basis:75%;overflow-y:auto}.sky-vertical-tabset-content-hidden{display:none}.sky-vertical-tabset-show-tabs-btn{margin-top:10px}.sky-vertical-tabset-group-container{flex-basis:25%;overflow-y:auto}:host-context(.sky-theme-modern) .sky-vertical-tabset-content{margin:15px}@media (min-width: 768px){:host-context(.sky-theme-modern) :host .sky-vertical-tabset-content{margin:20px 30px}:host-context(.sky-theme-modern) :host .sky-vertical-tabset-group-container{border-right:1px solid #d2d2d2}}:host-context(.sky-theme-modern) :host-context(.sky-responsive-container-sm) .sky-vertical-tabset-content,:host-context(.sky-theme-modern) :host-context(.sky-responsive-container-md) .sky-vertical-tabset-content,:host-context(.sky-theme-modern) :host-context(.sky-responsive-container-lg) .sky-vertical-tabset-content{margin:20px 30px}:host-context(.sky-theme-modern) :host-context(.sky-responsive-container-sm) .sky-vertical-tabset-group-container,:host-context(.sky-theme-modern) :host-context(.sky-responsive-container-md) .sky-vertical-tabset-group-container,:host-context(.sky-theme-modern) :host-context(.sky-responsive-container-lg) .sky-vertical-tabset-group-container{border-right:1px solid #d2d2d2}.sky-theme-modern .sky-vertical-tabset-content{margin:15px}@media (min-width: 768px){.sky-theme-modern :host .sky-vertical-tabset-content{margin:20px 30px}.sky-theme-modern :host .sky-vertical-tabset-group-container{border-right:1px solid #d2d2d2}}.sky-theme-modern :host-context(.sky-responsive-container-sm) .sky-vertical-tabset-content,.sky-theme-modern :host-context(.sky-responsive-container-md) .sky-vertical-tabset-content,.sky-theme-modern :host-context(.sky-responsive-container-lg) .sky-vertical-tabset-content{margin:20px 30px}.sky-theme-modern :host-context(.sky-responsive-container-sm) .sky-vertical-tabset-group-container,.sky-theme-modern :host-context(.sky-responsive-container-md) .sky-vertical-tabset-group-container,.sky-theme-modern :host-context(.sky-responsive-container-lg) .sky-vertical-tabset-group-container{border-right:1px solid #d2d2d2}\n"], dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.λ4, selector: "sky-icon", inputs: ["icon", "iconType", "size", "fixedWidth", "variant"] }], animations: [
|
|
705
|
+
SkyVerticalTabsetComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: SkyVerticalTabsetComponent, selector: "sky-vertical-tabset", inputs: { showTabsText: "showTabsText", ariaLabel: "ariaLabel", ariaLabelledBy: "ariaLabelledBy", ariaRole: "ariaRole", maintainTabContent: "maintainTabContent" }, outputs: { activeChange: "activeChange" }, providers: [SkyVerticalTabsetService], viewQueries: [{ propertyName: "tabGroups", first: true, predicate: ["groupContainerWrapper"], descendants: true }, { propertyName: "content", first: true, predicate: ["skySideContent"], descendants: true }, { propertyName: "contentWrapper", first: true, predicate: ["contentContainerWrapper"], descendants: true }], ngImport: i0, template: "<div class=\"sky-vertical-tabset\" (window:resize)=\"tabService.updateContent()\">\n <div\n *ngIf=\"maintainTabContent || tabService.tabsVisible()\"\n aria-orientation=\"vertical\"\n class=\"sky-vertical-tabset-group-container\"\n [ngClass]=\"{ 'sky-vertical-tabset-hidden': !tabService.tabsVisible() }\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledBy\"\n [attr.role]=\"isMobile ? undefined : ariaRole\"\n [@tabGroupEnter]=\"tabService.animationTabsVisibleState\"\n #groupContainerWrapper\n >\n <ng-content></ng-content>\n </div>\n <div\n *ngIf=\"maintainTabContent || tabService.contentVisible()\"\n class=\"sky-vertical-tabset-content\"\n [ngClass]=\"{\n 'sky-vertical-tabset-content-hidden': !tabService.contentVisible()\n }\"\n [@contentEnter]=\"tabService.animationContentVisibleState\"\n #contentContainerWrapper\n >\n <div #skySideContent></div>\n <button\n *ngIf=\"!tabService.tabsVisible()\"\n (click)=\"tabService.showTabs()\"\n class=\"sky-btn sky-btn-primary sky-vertical-tabset-show-tabs-btn\"\n >\n <sky-icon icon=\"chevron-left\"></sky-icon>\n {{ showTabsText }}\n </button>\n </div>\n</div>\n", styles: [":host .sky-vertical-tabset{display:block;height:auto}:host .sky-vertical-tabset-group-container{border-right:none}:host-context(.sky-responsive-container-xs) .sky-vertical-tabset,:host-context(.sky-responsive-container-sm) .sky-vertical-tabset,:host-context(.sky-responsive-container-md) .sky-vertical-tabset,:host-context(.sky-responsive-container-lg) .sky-vertical-tabset{display:block;height:auto}:host-context(.sky-responsive-container-xs) .sky-vertical-tabset-group-container,:host-context(.sky-responsive-container-sm) .sky-vertical-tabset-group-container,:host-context(.sky-responsive-container-md) .sky-vertical-tabset-group-container,:host-context(.sky-responsive-container-lg) .sky-vertical-tabset-group-container{border-right:none}@media (min-width: 768px){:host .sky-vertical-tabset{display:flex;height:100%}:host .sky-vertical-tabset-group-container{border-right:1px solid #cdcfd2}}:host-context(.sky-responsive-container-sm) .sky-vertical-tabset,:host-context(.sky-responsive-container-md) .sky-vertical-tabset,:host-context(.sky-responsive-container-lg) .sky-vertical-tabset{display:flex;height:100%}:host-context(.sky-responsive-container-sm) .sky-vertical-tabset-group-container,:host-context(.sky-responsive-container-md) .sky-vertical-tabset-group-container,:host-context(.sky-responsive-container-lg) .sky-vertical-tabset-group-container{border-right:1px solid #cdcfd2}.sky-vertical-tabset-hidden{display:none}.sky-vertical-tabset-content{margin:10px 0 0 10px;flex-basis:75%;overflow-y:auto}.sky-vertical-tabset-content-hidden{display:none}.sky-vertical-tabset-show-tabs-btn{margin-top:10px}.sky-vertical-tabset-group-container{flex-basis:25%;overflow-y:auto}:host-context(sky-modal-content)>.sky-vertical-tabset{margin:-15px}:host-context(.sky-theme-modern) .sky-vertical-tabset-content{margin:15px}@media (min-width: 768px){:host-context(.sky-theme-modern) :host .sky-vertical-tabset-content{margin:20px 30px}:host-context(.sky-theme-modern) :host .sky-vertical-tabset-group-container{border-right:1px solid #d2d2d2}}:host-context(.sky-theme-modern) :host-context(.sky-responsive-container-sm) .sky-vertical-tabset-content,:host-context(.sky-theme-modern) :host-context(.sky-responsive-container-md) .sky-vertical-tabset-content,:host-context(.sky-theme-modern) :host-context(.sky-responsive-container-lg) .sky-vertical-tabset-content{margin:20px 30px}:host-context(.sky-theme-modern) :host-context(.sky-responsive-container-sm) .sky-vertical-tabset-group-container,:host-context(.sky-theme-modern) :host-context(.sky-responsive-container-md) .sky-vertical-tabset-group-container,:host-context(.sky-theme-modern) :host-context(.sky-responsive-container-lg) .sky-vertical-tabset-group-container{border-right:1px solid #d2d2d2}.sky-theme-modern .sky-vertical-tabset-content{margin:15px}@media (min-width: 768px){.sky-theme-modern :host .sky-vertical-tabset-content{margin:20px 30px}.sky-theme-modern :host .sky-vertical-tabset-group-container{border-right:1px solid #d2d2d2}}.sky-theme-modern :host-context(.sky-responsive-container-sm) .sky-vertical-tabset-content,.sky-theme-modern :host-context(.sky-responsive-container-md) .sky-vertical-tabset-content,.sky-theme-modern :host-context(.sky-responsive-container-lg) .sky-vertical-tabset-content{margin:20px 30px}.sky-theme-modern :host-context(.sky-responsive-container-sm) .sky-vertical-tabset-group-container,.sky-theme-modern :host-context(.sky-responsive-container-md) .sky-vertical-tabset-group-container,.sky-theme-modern :host-context(.sky-responsive-container-lg) .sky-vertical-tabset-group-container{border-right:1px solid #d2d2d2}\n"], dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.λ4, selector: "sky-icon", inputs: ["icon", "iconType", "size", "fixedWidth", "variant"] }], animations: [
|
|
692
706
|
trigger('tabGroupEnter', [
|
|
693
707
|
transition(`${HIDDEN_STATE} => ${VISIBLE_STATE}`, [
|
|
694
708
|
style({ transform: 'translate(-100%)' }),
|
|
@@ -717,7 +731,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
|
|
|
717
731
|
animate('150ms ease-in'),
|
|
718
732
|
]),
|
|
719
733
|
]),
|
|
720
|
-
], template: "<div class=\"sky-vertical-tabset\" (window:resize)=\"tabService.updateContent()\">\n <div\n *ngIf=\"maintainTabContent || tabService.tabsVisible()\"\n aria-orientation=\"vertical\"\n class=\"sky-vertical-tabset-group-container\"\n [ngClass]=\"{ 'sky-vertical-tabset-hidden': !tabService.tabsVisible() }\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledBy\"\n [attr.role]=\"ariaRole\"\n [@tabGroupEnter]=\"tabService.animationTabsVisibleState\"\n #groupContainerWrapper\n >\n <ng-content></ng-content>\n </div>\n <div\n *ngIf=\"maintainTabContent || tabService.contentVisible()\"\n class=\"sky-vertical-tabset-content\"\n [ngClass]=\"{\n 'sky-vertical-tabset-content-hidden': !tabService.contentVisible()\n }\"\n [@contentEnter]=\"tabService.animationContentVisibleState\"\n #contentContainerWrapper\n >\n <div #skySideContent></div>\n <button\n *ngIf=\"!tabService.tabsVisible()\"\n (click)=\"tabService.showTabs()\"\n class=\"sky-btn sky-btn-primary sky-vertical-tabset-show-tabs-btn\"\n >\n <sky-icon icon=\"chevron-left\"></sky-icon>\n {{ showTabsText }}\n </button>\n </div>\n</div>\n", styles: [":host .sky-vertical-tabset{display:block;height:auto}:host .sky-vertical-tabset-group-container{border-right:none}:host-context(.sky-responsive-container-xs) .sky-vertical-tabset,:host-context(.sky-responsive-container-sm) .sky-vertical-tabset,:host-context(.sky-responsive-container-md) .sky-vertical-tabset,:host-context(.sky-responsive-container-lg) .sky-vertical-tabset{display:block;height:auto}:host-context(.sky-responsive-container-xs) .sky-vertical-tabset-group-container,:host-context(.sky-responsive-container-sm) .sky-vertical-tabset-group-container,:host-context(.sky-responsive-container-md) .sky-vertical-tabset-group-container,:host-context(.sky-responsive-container-lg) .sky-vertical-tabset-group-container{border-right:none}@media (min-width: 768px){:host .sky-vertical-tabset{display:flex;height:100%}:host .sky-vertical-tabset-group-container{border-right:1px solid #cdcfd2}}:host-context(.sky-responsive-container-sm) .sky-vertical-tabset,:host-context(.sky-responsive-container-md) .sky-vertical-tabset,:host-context(.sky-responsive-container-lg) .sky-vertical-tabset{display:flex;height:100%}:host-context(.sky-responsive-container-sm) .sky-vertical-tabset-group-container,:host-context(.sky-responsive-container-md) .sky-vertical-tabset-group-container,:host-context(.sky-responsive-container-lg) .sky-vertical-tabset-group-container{border-right:1px solid #cdcfd2}.sky-vertical-tabset-hidden{display:none}.sky-vertical-tabset-content{margin:10px 0 0 10px;flex-basis:75%;overflow-y:auto}.sky-vertical-tabset-content-hidden{display:none}.sky-vertical-tabset-show-tabs-btn{margin-top:10px}.sky-vertical-tabset-group-container{flex-basis:25%;overflow-y:auto}:host-context(.sky-theme-modern) .sky-vertical-tabset-content{margin:15px}@media (min-width: 768px){:host-context(.sky-theme-modern) :host .sky-vertical-tabset-content{margin:20px 30px}:host-context(.sky-theme-modern) :host .sky-vertical-tabset-group-container{border-right:1px solid #d2d2d2}}:host-context(.sky-theme-modern) :host-context(.sky-responsive-container-sm) .sky-vertical-tabset-content,:host-context(.sky-theme-modern) :host-context(.sky-responsive-container-md) .sky-vertical-tabset-content,:host-context(.sky-theme-modern) :host-context(.sky-responsive-container-lg) .sky-vertical-tabset-content{margin:20px 30px}:host-context(.sky-theme-modern) :host-context(.sky-responsive-container-sm) .sky-vertical-tabset-group-container,:host-context(.sky-theme-modern) :host-context(.sky-responsive-container-md) .sky-vertical-tabset-group-container,:host-context(.sky-theme-modern) :host-context(.sky-responsive-container-lg) .sky-vertical-tabset-group-container{border-right:1px solid #d2d2d2}.sky-theme-modern .sky-vertical-tabset-content{margin:15px}@media (min-width: 768px){.sky-theme-modern :host .sky-vertical-tabset-content{margin:20px 30px}.sky-theme-modern :host .sky-vertical-tabset-group-container{border-right:1px solid #d2d2d2}}.sky-theme-modern :host-context(.sky-responsive-container-sm) .sky-vertical-tabset-content,.sky-theme-modern :host-context(.sky-responsive-container-md) .sky-vertical-tabset-content,.sky-theme-modern :host-context(.sky-responsive-container-lg) .sky-vertical-tabset-content{margin:20px 30px}.sky-theme-modern :host-context(.sky-responsive-container-sm) .sky-vertical-tabset-group-container,.sky-theme-modern :host-context(.sky-responsive-container-md) .sky-vertical-tabset-group-container,.sky-theme-modern :host-context(.sky-responsive-container-lg) .sky-vertical-tabset-group-container{border-right:1px solid #d2d2d2}\n"] }]
|
|
734
|
+
], template: "<div class=\"sky-vertical-tabset\" (window:resize)=\"tabService.updateContent()\">\n <div\n *ngIf=\"maintainTabContent || tabService.tabsVisible()\"\n aria-orientation=\"vertical\"\n class=\"sky-vertical-tabset-group-container\"\n [ngClass]=\"{ 'sky-vertical-tabset-hidden': !tabService.tabsVisible() }\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledBy\"\n [attr.role]=\"isMobile ? undefined : ariaRole\"\n [@tabGroupEnter]=\"tabService.animationTabsVisibleState\"\n #groupContainerWrapper\n >\n <ng-content></ng-content>\n </div>\n <div\n *ngIf=\"maintainTabContent || tabService.contentVisible()\"\n class=\"sky-vertical-tabset-content\"\n [ngClass]=\"{\n 'sky-vertical-tabset-content-hidden': !tabService.contentVisible()\n }\"\n [@contentEnter]=\"tabService.animationContentVisibleState\"\n #contentContainerWrapper\n >\n <div #skySideContent></div>\n <button\n *ngIf=\"!tabService.tabsVisible()\"\n (click)=\"tabService.showTabs()\"\n class=\"sky-btn sky-btn-primary sky-vertical-tabset-show-tabs-btn\"\n >\n <sky-icon icon=\"chevron-left\"></sky-icon>\n {{ showTabsText }}\n </button>\n </div>\n</div>\n", styles: [":host .sky-vertical-tabset{display:block;height:auto}:host .sky-vertical-tabset-group-container{border-right:none}:host-context(.sky-responsive-container-xs) .sky-vertical-tabset,:host-context(.sky-responsive-container-sm) .sky-vertical-tabset,:host-context(.sky-responsive-container-md) .sky-vertical-tabset,:host-context(.sky-responsive-container-lg) .sky-vertical-tabset{display:block;height:auto}:host-context(.sky-responsive-container-xs) .sky-vertical-tabset-group-container,:host-context(.sky-responsive-container-sm) .sky-vertical-tabset-group-container,:host-context(.sky-responsive-container-md) .sky-vertical-tabset-group-container,:host-context(.sky-responsive-container-lg) .sky-vertical-tabset-group-container{border-right:none}@media (min-width: 768px){:host .sky-vertical-tabset{display:flex;height:100%}:host .sky-vertical-tabset-group-container{border-right:1px solid #cdcfd2}}:host-context(.sky-responsive-container-sm) .sky-vertical-tabset,:host-context(.sky-responsive-container-md) .sky-vertical-tabset,:host-context(.sky-responsive-container-lg) .sky-vertical-tabset{display:flex;height:100%}:host-context(.sky-responsive-container-sm) .sky-vertical-tabset-group-container,:host-context(.sky-responsive-container-md) .sky-vertical-tabset-group-container,:host-context(.sky-responsive-container-lg) .sky-vertical-tabset-group-container{border-right:1px solid #cdcfd2}.sky-vertical-tabset-hidden{display:none}.sky-vertical-tabset-content{margin:10px 0 0 10px;flex-basis:75%;overflow-y:auto}.sky-vertical-tabset-content-hidden{display:none}.sky-vertical-tabset-show-tabs-btn{margin-top:10px}.sky-vertical-tabset-group-container{flex-basis:25%;overflow-y:auto}:host-context(sky-modal-content)>.sky-vertical-tabset{margin:-15px}:host-context(.sky-theme-modern) .sky-vertical-tabset-content{margin:15px}@media (min-width: 768px){:host-context(.sky-theme-modern) :host .sky-vertical-tabset-content{margin:20px 30px}:host-context(.sky-theme-modern) :host .sky-vertical-tabset-group-container{border-right:1px solid #d2d2d2}}:host-context(.sky-theme-modern) :host-context(.sky-responsive-container-sm) .sky-vertical-tabset-content,:host-context(.sky-theme-modern) :host-context(.sky-responsive-container-md) .sky-vertical-tabset-content,:host-context(.sky-theme-modern) :host-context(.sky-responsive-container-lg) .sky-vertical-tabset-content{margin:20px 30px}:host-context(.sky-theme-modern) :host-context(.sky-responsive-container-sm) .sky-vertical-tabset-group-container,:host-context(.sky-theme-modern) :host-context(.sky-responsive-container-md) .sky-vertical-tabset-group-container,:host-context(.sky-theme-modern) :host-context(.sky-responsive-container-lg) .sky-vertical-tabset-group-container{border-right:1px solid #d2d2d2}.sky-theme-modern .sky-vertical-tabset-content{margin:15px}@media (min-width: 768px){.sky-theme-modern :host .sky-vertical-tabset-content{margin:20px 30px}.sky-theme-modern :host .sky-vertical-tabset-group-container{border-right:1px solid #d2d2d2}}.sky-theme-modern :host-context(.sky-responsive-container-sm) .sky-vertical-tabset-content,.sky-theme-modern :host-context(.sky-responsive-container-md) .sky-vertical-tabset-content,.sky-theme-modern :host-context(.sky-responsive-container-lg) .sky-vertical-tabset-content{margin:20px 30px}.sky-theme-modern :host-context(.sky-responsive-container-sm) .sky-vertical-tabset-group-container,.sky-theme-modern :host-context(.sky-responsive-container-md) .sky-vertical-tabset-group-container,.sky-theme-modern :host-context(.sky-responsive-container-lg) .sky-vertical-tabset-group-container{border-right:1px solid #d2d2d2}\n"] }]
|
|
721
735
|
}], ctorParameters: function () { return [{ type: SkyVerticalTabsetAdapterService }, { type: SkyVerticalTabsetService }, { type: i3.SkyLibResourcesService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { showTabsText: [{
|
|
722
736
|
type: Input
|
|
723
737
|
}], ariaLabel: [{
|
|
@@ -820,15 +834,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
|
|
|
820
834
|
type: Injectable
|
|
821
835
|
}] });
|
|
822
836
|
|
|
837
|
+
var _SkySectionedFormSectionComponent_ngUnsubscribe, _SkySectionedFormSectionComponent_sectionedFormService, _SkySectionedFormSectionComponent_tabsetService, _SkySectionedFormSectionComponent_changeRef;
|
|
823
838
|
let nextId$1 = 0;
|
|
824
839
|
/**
|
|
825
840
|
* Creates an individual form to display as a section within the sectioned form.
|
|
826
841
|
*/
|
|
827
842
|
class SkySectionedFormSectionComponent {
|
|
828
843
|
constructor(sectionedFormService, tabsetService, changeRef) {
|
|
829
|
-
this.sectionedFormService = sectionedFormService;
|
|
830
|
-
this.tabsetService = tabsetService;
|
|
831
|
-
this.changeRef = changeRef;
|
|
832
844
|
this.sectionTabId = `sky-sectioned-form-tab-${++nextId$1}`;
|
|
833
845
|
this.sectionContentId = `sky-sectioned-form-section-${++nextId$1}`;
|
|
834
846
|
/**
|
|
@@ -836,25 +848,32 @@ class SkySectionedFormSectionComponent {
|
|
|
836
848
|
* @default false
|
|
837
849
|
*/
|
|
838
850
|
this.active = false;
|
|
839
|
-
this
|
|
851
|
+
_SkySectionedFormSectionComponent_ngUnsubscribe.set(this, new Subject());
|
|
852
|
+
_SkySectionedFormSectionComponent_sectionedFormService.set(this, void 0);
|
|
853
|
+
_SkySectionedFormSectionComponent_tabsetService.set(this, void 0);
|
|
854
|
+
_SkySectionedFormSectionComponent_changeRef.set(this, void 0);
|
|
855
|
+
__classPrivateFieldSet(this, _SkySectionedFormSectionComponent_sectionedFormService, sectionedFormService, "f");
|
|
856
|
+
__classPrivateFieldSet(this, _SkySectionedFormSectionComponent_tabsetService, tabsetService, "f");
|
|
857
|
+
__classPrivateFieldSet(this, _SkySectionedFormSectionComponent_changeRef, changeRef, "f");
|
|
840
858
|
}
|
|
841
859
|
ngOnInit() {
|
|
842
|
-
this.
|
|
843
|
-
this.
|
|
844
|
-
this.
|
|
860
|
+
__classPrivateFieldGet(this, _SkySectionedFormSectionComponent_changeRef, "f").detectChanges();
|
|
861
|
+
__classPrivateFieldGet(this, _SkySectionedFormSectionComponent_tabsetService, "f").switchingMobile.subscribe((mobile) => {
|
|
862
|
+
__classPrivateFieldGet(this, _SkySectionedFormSectionComponent_changeRef, "f").detectChanges();
|
|
845
863
|
});
|
|
846
|
-
this.
|
|
847
|
-
.pipe(takeUntil(this
|
|
864
|
+
__classPrivateFieldGet(this, _SkySectionedFormSectionComponent_sectionedFormService, "f").requiredChange
|
|
865
|
+
.pipe(takeUntil(__classPrivateFieldGet(this, _SkySectionedFormSectionComponent_ngUnsubscribe, "f")))
|
|
848
866
|
.subscribe((required) => (this.fieldRequired = required));
|
|
849
|
-
this.
|
|
850
|
-
.pipe(takeUntil(this
|
|
867
|
+
__classPrivateFieldGet(this, _SkySectionedFormSectionComponent_sectionedFormService, "f").invalidChange
|
|
868
|
+
.pipe(takeUntil(__classPrivateFieldGet(this, _SkySectionedFormSectionComponent_ngUnsubscribe, "f")))
|
|
851
869
|
.subscribe((invalid) => (this.fieldInvalid = invalid));
|
|
852
870
|
}
|
|
853
871
|
ngOnDestroy() {
|
|
854
|
-
this.
|
|
855
|
-
this.
|
|
872
|
+
__classPrivateFieldGet(this, _SkySectionedFormSectionComponent_ngUnsubscribe, "f").next();
|
|
873
|
+
__classPrivateFieldGet(this, _SkySectionedFormSectionComponent_ngUnsubscribe, "f").complete();
|
|
856
874
|
}
|
|
857
875
|
}
|
|
876
|
+
_SkySectionedFormSectionComponent_ngUnsubscribe = new WeakMap(), _SkySectionedFormSectionComponent_sectionedFormService = new WeakMap(), _SkySectionedFormSectionComponent_tabsetService = new WeakMap(), _SkySectionedFormSectionComponent_changeRef = new WeakMap();
|
|
858
877
|
SkySectionedFormSectionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkySectionedFormSectionComponent, deps: [{ token: SkySectionedFormService }, { token: SkyVerticalTabsetService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
859
878
|
SkySectionedFormSectionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: SkySectionedFormSectionComponent, selector: "sky-sectioned-form-section", inputs: { heading: "heading", itemCount: "itemCount", active: "active" }, providers: [SkySectionedFormService], viewQueries: [{ propertyName: "tab", first: true, predicate: SkyVerticalTabComponent, descendants: true }], ngImport: i0, template: "<sky-vertical-tab\n [active]=\"active\"\n [errorIndicator]=\"fieldInvalid\"\n [ngClass]=\"{\n 'sky-tab-field-required': fieldRequired\n }\"\n [showTabRightArrow]=\"true\"\n [tabHeaderCount]=\"itemCount\"\n [tabHeading]=\"heading\"\n [tabId]=\"sectionTabId\"\n>\n <ng-content></ng-content>\n</sky-vertical-tab>\n", styles: [":host .sky-tab-field-required ::ng-deep .sky-vertical-tab-heading:after{content:\"*\";color:#ef4044;padding-left:5px}\n"], dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: SkyVerticalTabComponent, selector: "sky-vertical-tab", inputs: ["active", "ariaControls", "ariaRole", "disabled", "errorIndicator", "tabHeaderCount", "tabHeading", "showTabRightArrow", "tabId"] }] });
|
|
860
879
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkySectionedFormSectionComponent, decorators: [{
|
|
@@ -871,13 +890,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
|
|
|
871
890
|
args: [SkyVerticalTabComponent]
|
|
872
891
|
}] } });
|
|
873
892
|
|
|
893
|
+
var _SkySectionedFormComponent_ngUnsubscribe, _SkySectionedFormComponent_changeRef;
|
|
874
894
|
/**
|
|
875
895
|
* Creates a container for the sectioned forms.
|
|
876
896
|
*/
|
|
877
897
|
class SkySectionedFormComponent {
|
|
878
898
|
constructor(tabService, changeRef) {
|
|
879
899
|
this.tabService = tabService;
|
|
880
|
-
this.changeRef = changeRef;
|
|
881
900
|
/**
|
|
882
901
|
* Indicates whether the sectioned form loads section content during initialization so that it
|
|
883
902
|
* displays content without moving around elements in the content container.
|
|
@@ -889,30 +908,34 @@ class SkySectionedFormComponent {
|
|
|
889
908
|
* section. The index is based on the section's position when the form loads.
|
|
890
909
|
*/
|
|
891
910
|
this.indexChanged = new EventEmitter();
|
|
892
|
-
this.
|
|
893
|
-
this
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
return this.isMobile ? undefined : 'tablist';
|
|
911
|
+
this.ariaRole = 'tablist';
|
|
912
|
+
_SkySectionedFormComponent_ngUnsubscribe.set(this, new Subject());
|
|
913
|
+
_SkySectionedFormComponent_changeRef.set(this, void 0);
|
|
914
|
+
__classPrivateFieldSet(this, _SkySectionedFormComponent_changeRef, changeRef, "f");
|
|
897
915
|
}
|
|
898
916
|
ngOnInit() {
|
|
899
917
|
this.tabService.maintainTabContent = this.maintainSectionContent;
|
|
900
918
|
this.tabService.indexChanged
|
|
901
|
-
.pipe(takeUntil(this
|
|
919
|
+
.pipe(takeUntil(__classPrivateFieldGet(this, _SkySectionedFormComponent_ngUnsubscribe, "f")))
|
|
902
920
|
.subscribe((index) => {
|
|
903
921
|
this.indexChanged.emit(index);
|
|
904
|
-
this.
|
|
922
|
+
__classPrivateFieldGet(this, _SkySectionedFormComponent_changeRef, "f").markForCheck();
|
|
905
923
|
});
|
|
906
924
|
this.tabService.switchingMobile
|
|
907
|
-
.pipe(takeUntil(this
|
|
925
|
+
.pipe(takeUntil(__classPrivateFieldGet(this, _SkySectionedFormComponent_ngUnsubscribe, "f")))
|
|
908
926
|
.subscribe((mobile) => {
|
|
909
|
-
|
|
910
|
-
|
|
927
|
+
if (!mobile) {
|
|
928
|
+
this.ariaRole = 'tablist';
|
|
929
|
+
}
|
|
930
|
+
else {
|
|
931
|
+
this.ariaRole = undefined;
|
|
932
|
+
}
|
|
933
|
+
__classPrivateFieldGet(this, _SkySectionedFormComponent_changeRef, "f").markForCheck();
|
|
911
934
|
});
|
|
912
935
|
if (this.tabService.isMobile()) {
|
|
913
|
-
this.
|
|
936
|
+
this.ariaRole = undefined;
|
|
914
937
|
this.tabService.animationContentVisibleState = VISIBLE_STATE;
|
|
915
|
-
this.
|
|
938
|
+
__classPrivateFieldGet(this, _SkySectionedFormComponent_changeRef, "f").markForCheck();
|
|
916
939
|
}
|
|
917
940
|
}
|
|
918
941
|
ngAfterViewChecked() {
|
|
@@ -920,18 +943,19 @@ class SkySectionedFormComponent {
|
|
|
920
943
|
this.tabService.updateContent();
|
|
921
944
|
}
|
|
922
945
|
ngOnDestroy() {
|
|
923
|
-
this.
|
|
924
|
-
this.
|
|
946
|
+
__classPrivateFieldGet(this, _SkySectionedFormComponent_ngUnsubscribe, "f").next();
|
|
947
|
+
__classPrivateFieldGet(this, _SkySectionedFormComponent_ngUnsubscribe, "f").complete();
|
|
925
948
|
}
|
|
926
949
|
tabsVisible() {
|
|
927
|
-
this.
|
|
950
|
+
__classPrivateFieldGet(this, _SkySectionedFormComponent_changeRef, "f").markForCheck();
|
|
928
951
|
return this.tabService.tabsVisible();
|
|
929
952
|
}
|
|
930
953
|
showTabs() {
|
|
931
954
|
this.tabService.showTabs();
|
|
932
|
-
this.
|
|
955
|
+
__classPrivateFieldGet(this, _SkySectionedFormComponent_changeRef, "f").markForCheck();
|
|
933
956
|
}
|
|
934
957
|
}
|
|
958
|
+
_SkySectionedFormComponent_ngUnsubscribe = new WeakMap(), _SkySectionedFormComponent_changeRef = new WeakMap();
|
|
935
959
|
SkySectionedFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkySectionedFormComponent, deps: [{ token: SkyVerticalTabsetService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
936
960
|
SkySectionedFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: SkySectionedFormComponent, selector: "sky-sectioned-form", inputs: { maintainSectionContent: "maintainSectionContent" }, outputs: { indexChanged: "indexChanged" }, providers: [SkyVerticalTabsetService], viewQueries: [{ propertyName: "content", first: true, predicate: ["skySectionSideContent"], descendants: true }], ngImport: i0, template: "<div\n aria-orientation=\"vertical\"\n class=\"sky-sectioned-form\"\n [attr.role]=\"ariaRole\"\n (window:resize)=\"tabService.updateContent()\"\n>\n <div\n *ngIf=\"maintainSectionContent || tabsVisible()\"\n class=\"sky-sectioned-form-tabs\"\n [ngClass]=\"{ 'sky-sectioned-form-tabs-hidden': !tabsVisible() }\"\n [@tabEnter]=\"tabService.animationTabsVisibleState\"\n >\n <ng-content></ng-content>\n </div>\n <div\n *ngIf=\"maintainSectionContent || tabService.contentVisible()\"\n class=\"sky-sectioned-form-content\"\n [ngClass]=\"{\n 'sky-sectioned-form-content-hidden': !tabService.contentVisible()\n }\"\n [@contentEnter]=\"tabService.animationContentVisibleState\"\n #skySectionSideContent\n ></div>\n</div>\n", styles: [":host .sky-sectioned-form{display:block;max-height:none}:host .sky-sectioned-form-content{flex-basis:auto;overflow-y:visible}:host .sky-sectioned-form-tabs{flex-basis:auto;overflow-y:visible;border-right:1px solid #e2e3e4}:host-context(.sky-responsive-container-xs) .sky-sectioned-form,:host-context(.sky-responsive-container-sm) .sky-sectioned-form,:host-context(.sky-responsive-container-md) .sky-sectioned-form,:host-context(.sky-responsive-container-lg) .sky-sectioned-form{display:block;max-height:none}:host-context(.sky-responsive-container-xs) .sky-sectioned-form-content,:host-context(.sky-responsive-container-sm) .sky-sectioned-form-content,:host-context(.sky-responsive-container-md) .sky-sectioned-form-content,:host-context(.sky-responsive-container-lg) .sky-sectioned-form-content{flex-basis:auto;overflow-y:visible}:host-context(.sky-responsive-container-xs) .sky-sectioned-form-tabs,:host-context(.sky-responsive-container-sm) .sky-sectioned-form-tabs,:host-context(.sky-responsive-container-md) .sky-sectioned-form-tabs,:host-context(.sky-responsive-container-lg) .sky-sectioned-form-tabs{flex-basis:auto;overflow-y:visible;border-right:1px solid #e2e3e4}@media (min-width: 768px){:host .sky-sectioned-form{display:flex;max-height:100%}:host .sky-sectioned-form-content{flex-basis:70%;padding:15px;overflow-y:auto}:host .sky-sectioned-form-tabs{flex-basis:30%;overflow-y:auto}}:host-context(.sky-responsive-container-sm) .sky-sectioned-form,:host-context(.sky-responsive-container-md) .sky-sectioned-form,:host-context(.sky-responsive-container-lg) .sky-sectioned-form{display:flex;max-height:100%}:host-context(.sky-responsive-container-sm) .sky-sectioned-form-content,:host-context(.sky-responsive-container-md) .sky-sectioned-form-content,:host-context(.sky-responsive-container-lg) .sky-sectioned-form-content{flex-basis:70%;padding:15px;overflow-y:auto}:host-context(.sky-responsive-container-sm) .sky-sectioned-form-tabs,:host-context(.sky-responsive-container-md) .sky-sectioned-form-tabs,:host-context(.sky-responsive-container-lg) .sky-sectioned-form-tabs{flex-basis:30%;overflow-y:auto}.sky-sectioned-form-tabs-hidden,.sky-sectioned-form-content-hidden{display:none}:host-context(.sky-theme-modern) .sky-sectioned-form-content{padding:15px}:host-context(.sky-theme-modern) .sky-sectioned-form-tabs{border-right:1px solid #d2d2d2}@media (min-width: 768px){:host-context(.sky-theme-modern) :host .sky-sectioned-form-content{margin:20px 30px}}:host-context(.sky-theme-modern) :host-context(.sky-responsive-container-sm) .sky-sectioned-form-content,:host-context(.sky-theme-modern) :host-context(.sky-responsive-container-md) .sky-sectioned-form-content,:host-context(.sky-theme-modern) :host-context(.sky-responsive-container-lg) .sky-sectioned-form-content{margin:20px 30px}.sky-theme-modern .sky-sectioned-form-content{padding:15px}.sky-theme-modern .sky-sectioned-form-tabs{border-right:1px solid #d2d2d2}@media (min-width: 768px){.sky-theme-modern :host .sky-sectioned-form-content{margin:20px 30px}}.sky-theme-modern :host-context(.sky-responsive-container-sm) .sky-sectioned-form-content,.sky-theme-modern :host-context(.sky-responsive-container-md) .sky-sectioned-form-content,.sky-theme-modern :host-context(.sky-responsive-container-lg) .sky-sectioned-form-content{margin:20px 30px}\n"], dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], animations: [
|
|
937
961
|
trigger('tabEnter', [
|
|
@@ -1011,27 +1035,37 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
|
|
|
1011
1035
|
type: Injectable
|
|
1012
1036
|
}] });
|
|
1013
1037
|
|
|
1038
|
+
var _SkyTabsetService_instances, _SkyTabsetService_activeTabIndex, _SkyTabsetService_focusedTabBtnIndex, _SkyTabsetService_activeTabUnregistered, _SkyTabsetService_tabs, _SkyTabsetService_tabCounter, _SkyTabsetService_isTabIndexActive, _SkyTabsetService_getNextTabArrayIndex, _SkyTabsetService_getPrevTabArrayIndex;
|
|
1014
1039
|
/**
|
|
1015
1040
|
* @internal
|
|
1016
1041
|
*/
|
|
1017
1042
|
class SkyTabsetService {
|
|
1018
1043
|
constructor() {
|
|
1044
|
+
_SkyTabsetService_instances.add(this);
|
|
1019
1045
|
this.currentActiveTabIndex = 0;
|
|
1020
1046
|
this.currentFocusedTabBtnIndex = 0;
|
|
1021
|
-
this
|
|
1022
|
-
this
|
|
1023
|
-
this
|
|
1024
|
-
this
|
|
1025
|
-
this
|
|
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");
|
|
1026
1055
|
}
|
|
1027
1056
|
get activeTabUnregistered() {
|
|
1028
|
-
return this
|
|
1057
|
+
return __classPrivateFieldGet(this, _SkyTabsetService_activeTabUnregistered, "f");
|
|
1029
1058
|
}
|
|
1030
1059
|
get activeTabIndex() {
|
|
1031
|
-
return this
|
|
1060
|
+
return __classPrivateFieldGet(this, _SkyTabsetService_activeTabIndex, "f");
|
|
1032
1061
|
}
|
|
1033
1062
|
get focusedTabBtnIndex() {
|
|
1034
|
-
return this
|
|
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();
|
|
1035
1069
|
}
|
|
1036
1070
|
/**
|
|
1037
1071
|
* Sets the active tab by its unique `tabIndex` property.
|
|
@@ -1044,26 +1078,26 @@ class SkyTabsetService {
|
|
|
1044
1078
|
this.currentActiveTabIndex = value;
|
|
1045
1079
|
/* istanbul ignore else */
|
|
1046
1080
|
if (config.emitChange) {
|
|
1047
|
-
this.
|
|
1081
|
+
__classPrivateFieldGet(this, _SkyTabsetService_activeTabIndex, "f").next(value);
|
|
1048
1082
|
}
|
|
1049
1083
|
this.setFocusedTabBtnIndex(value);
|
|
1050
1084
|
}
|
|
1051
1085
|
}
|
|
1052
1086
|
focusNextTabBtn(tabButtons) {
|
|
1053
|
-
const currentTabArrayIndex = this.
|
|
1054
|
-
for (let i = this.
|
|
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)) {
|
|
1055
1089
|
const tabBtn = tabButtons[i];
|
|
1056
|
-
if (!tabBtn.disabled) {
|
|
1090
|
+
if (!tabBtn.disabled && tabBtn.tabIndex !== undefined) {
|
|
1057
1091
|
this.setFocusedTabBtnIndex(tabBtn.tabIndex);
|
|
1058
1092
|
return;
|
|
1059
1093
|
}
|
|
1060
1094
|
}
|
|
1061
1095
|
}
|
|
1062
1096
|
focusPrevTabBtn(tabButtons) {
|
|
1063
|
-
const currentTabArrayIndex = this.
|
|
1064
|
-
for (let i = this.
|
|
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)) {
|
|
1065
1099
|
const tabBtn = tabButtons[i];
|
|
1066
|
-
if (!tabBtn.disabled) {
|
|
1100
|
+
if (!tabBtn.disabled && tabBtn.tabIndex !== undefined) {
|
|
1067
1101
|
this.setFocusedTabBtnIndex(tabBtn.tabIndex);
|
|
1068
1102
|
return;
|
|
1069
1103
|
}
|
|
@@ -1072,7 +1106,7 @@ class SkyTabsetService {
|
|
|
1072
1106
|
focusFirstOrNearestTabBtn(tabButtons) {
|
|
1073
1107
|
for (let i = 0; i < tabButtons.length; i++) {
|
|
1074
1108
|
const tabBtn = tabButtons[i];
|
|
1075
|
-
if (!tabBtn.disabled) {
|
|
1109
|
+
if (!tabBtn.disabled && tabBtn.tabIndex !== undefined) {
|
|
1076
1110
|
this.setFocusedTabBtnIndex(tabBtn.tabIndex);
|
|
1077
1111
|
return;
|
|
1078
1112
|
}
|
|
@@ -1081,7 +1115,7 @@ class SkyTabsetService {
|
|
|
1081
1115
|
focusLastOrNearestTabBtn(tabButtons) {
|
|
1082
1116
|
for (let i = tabButtons.length - 1; i >= 0; i--) {
|
|
1083
1117
|
const tabBtn = tabButtons[i];
|
|
1084
|
-
if (!tabBtn.disabled) {
|
|
1118
|
+
if (!tabBtn.disabled && tabBtn.tabIndex !== undefined) {
|
|
1085
1119
|
this.setFocusedTabBtnIndex(tabBtn.tabIndex);
|
|
1086
1120
|
return;
|
|
1087
1121
|
}
|
|
@@ -1089,108 +1123,116 @@ class SkyTabsetService {
|
|
|
1089
1123
|
}
|
|
1090
1124
|
setFocusedTabBtnIndex(tabIndex) {
|
|
1091
1125
|
this.currentFocusedTabBtnIndex = tabIndex;
|
|
1092
|
-
this.
|
|
1126
|
+
__classPrivateFieldGet(this, _SkyTabsetService_focusedTabBtnIndex, "f").next(tabIndex);
|
|
1093
1127
|
}
|
|
1094
1128
|
/**
|
|
1095
1129
|
* Registers a tab component.
|
|
1096
1130
|
*/
|
|
1097
1131
|
registerTab(tabIndex) {
|
|
1132
|
+
var _a;
|
|
1098
1133
|
if (tabIndex === undefined) {
|
|
1099
|
-
tabIndex = this
|
|
1100
|
-
this
|
|
1134
|
+
tabIndex = __classPrivateFieldGet(this, _SkyTabsetService_tabCounter, "f");
|
|
1135
|
+
__classPrivateFieldSet(this, _SkyTabsetService_tabCounter, (_a = __classPrivateFieldGet(this, _SkyTabsetService_tabCounter, "f"), _a++, _a), "f");
|
|
1101
1136
|
}
|
|
1102
|
-
this.
|
|
1137
|
+
__classPrivateFieldGet(this, _SkyTabsetService_tabs, "f").push({ tabIndex });
|
|
1103
1138
|
return tabIndex;
|
|
1104
1139
|
}
|
|
1105
1140
|
updateTabIndex(currentTabIndex, newTabIndex) {
|
|
1106
|
-
const found = this.
|
|
1107
|
-
found
|
|
1141
|
+
const found = __classPrivateFieldGet(this, _SkyTabsetService_tabs, "f").find((tab) => this.tabIndexesEqual(tab.tabIndex, currentTabIndex));
|
|
1142
|
+
if (found) {
|
|
1143
|
+
found.tabIndex = newTabIndex;
|
|
1144
|
+
}
|
|
1108
1145
|
}
|
|
1109
1146
|
/**
|
|
1110
1147
|
* Unregisters a tab component.
|
|
1111
1148
|
*/
|
|
1112
1149
|
unregisterTab(tabIndex) {
|
|
1113
|
-
|
|
1150
|
+
var _b;
|
|
1151
|
+
const index = __classPrivateFieldGet(this, _SkyTabsetService_tabs, "f").findIndex((tab) => this.tabIndexesEqual(tab.tabIndex, tabIndex));
|
|
1114
1152
|
// Notify the tabset component when an active tab is unregistered.
|
|
1115
|
-
if (this.
|
|
1116
|
-
this.
|
|
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({
|
|
1117
1155
|
arrayIndex: index,
|
|
1118
1156
|
});
|
|
1119
1157
|
}
|
|
1120
|
-
this.
|
|
1158
|
+
__classPrivateFieldGet(this, _SkyTabsetService_tabs, "f").splice(index, 1);
|
|
1121
1159
|
}
|
|
1122
1160
|
/**
|
|
1123
1161
|
* Unregisters all tab components at once.
|
|
1124
1162
|
*/
|
|
1125
1163
|
unregisterAll() {
|
|
1126
|
-
this
|
|
1164
|
+
__classPrivateFieldSet(this, _SkyTabsetService_tabs, [], "f");
|
|
1127
1165
|
}
|
|
1128
1166
|
/**
|
|
1129
1167
|
* Compares two tab indexes and returns `true` if they are equal.
|
|
1130
1168
|
*/
|
|
1131
1169
|
tabIndexesEqual(tabIndex1, tabIndex2) {
|
|
1132
|
-
return tabIndex1 === tabIndex2 ||
|
|
1170
|
+
return (tabIndex1 === tabIndex2 ||
|
|
1171
|
+
(tabIndex1 !== undefined &&
|
|
1172
|
+
tabIndex2 !== undefined &&
|
|
1173
|
+
+tabIndex1 === +tabIndex2));
|
|
1133
1174
|
}
|
|
1134
1175
|
/**
|
|
1135
1176
|
* Verifies if a provided tab index is registered.
|
|
1136
1177
|
*/
|
|
1137
1178
|
isValidTabIndex(tabIndex) {
|
|
1138
|
-
return this.
|
|
1179
|
+
return __classPrivateFieldGet(this, _SkyTabsetService_tabs, "f").some((tab) => this.tabIndexesEqual(tab.tabIndex, tabIndex));
|
|
1139
1180
|
}
|
|
1140
1181
|
/**
|
|
1141
1182
|
* Activates the first registered tab.
|
|
1142
1183
|
*/
|
|
1143
1184
|
activateFirstTab() {
|
|
1144
|
-
const firstTabIndex = this
|
|
1185
|
+
const firstTabIndex = __classPrivateFieldGet(this, _SkyTabsetService_tabs, "f")[0] && __classPrivateFieldGet(this, _SkyTabsetService_tabs, "f")[0].tabIndex;
|
|
1145
1186
|
if (firstTabIndex !== undefined) {
|
|
1146
1187
|
this.setActiveTabIndex(firstTabIndex);
|
|
1147
1188
|
return firstTabIndex;
|
|
1148
1189
|
}
|
|
1190
|
+
return undefined;
|
|
1149
1191
|
}
|
|
1150
1192
|
/**
|
|
1151
1193
|
* Activates the next registered tab, or the previous one based on a provided array index.
|
|
1152
1194
|
*/
|
|
1153
1195
|
activateNearestTab(arrayIndex) {
|
|
1154
|
-
const newActiveTab = this
|
|
1196
|
+
const newActiveTab = __classPrivateFieldGet(this, _SkyTabsetService_tabs, "f")[arrayIndex] || __classPrivateFieldGet(this, _SkyTabsetService_tabs, "f")[arrayIndex - 1];
|
|
1155
1197
|
if (newActiveTab) {
|
|
1156
1198
|
this.currentActiveTabIndex = newActiveTab.tabIndex;
|
|
1157
1199
|
}
|
|
1158
1200
|
}
|
|
1159
|
-
isTabIndexActive(tabIndex) {
|
|
1160
|
-
return this.tabIndexesEqual(tabIndex, this.currentActiveTabIndex);
|
|
1161
|
-
}
|
|
1162
|
-
getNextTabArrayIndex(currentIndex) {
|
|
1163
|
-
let nextIndex = currentIndex + 1;
|
|
1164
|
-
if (nextIndex === this.tabs.length) {
|
|
1165
|
-
nextIndex = 0;
|
|
1166
|
-
}
|
|
1167
|
-
return nextIndex;
|
|
1168
|
-
}
|
|
1169
|
-
getPrevTabArrayIndex(currentIndex) {
|
|
1170
|
-
let prevIndex = currentIndex - 1;
|
|
1171
|
-
if (prevIndex < 0) {
|
|
1172
|
-
prevIndex = this.tabs.length - 1;
|
|
1173
|
-
}
|
|
1174
|
-
return prevIndex;
|
|
1175
|
-
}
|
|
1176
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
|
+
};
|
|
1177
1217
|
SkyTabsetService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyTabsetService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1178
1218
|
SkyTabsetService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyTabsetService });
|
|
1179
1219
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyTabsetService, decorators: [{
|
|
1180
1220
|
type: Injectable
|
|
1181
|
-
}] });
|
|
1221
|
+
}], ctorParameters: function () { return []; } });
|
|
1182
1222
|
|
|
1183
|
-
var _SkyTabButtonComponent__tabStyle, _SkyTabButtonComponent_adapterService, _SkyTabButtonComponent_changeDetectorRef, _SkyTabButtonComponent_elementRef, _SkyTabButtonComponent_tabsetService, _SkyTabButtonComponent_ngUnsubscribe;
|
|
1184
|
-
const
|
|
1223
|
+
var _SkyTabButtonComponent_instances, _SkyTabButtonComponent__isActive, _SkyTabButtonComponent__isDisabled, _SkyTabButtonComponent__tabStyle, _SkyTabButtonComponent_adapterService, _SkyTabButtonComponent_changeDetectorRef, _SkyTabButtonComponent_elementRef, _SkyTabButtonComponent_tabsetService, _SkyTabButtonComponent_ngUnsubscribe, _SkyTabButtonComponent_updateWizardStepState;
|
|
1224
|
+
const DEFAULT_DISABLED = false;
|
|
1185
1225
|
/**
|
|
1186
1226
|
* @internal
|
|
1187
1227
|
*/
|
|
1188
1228
|
class SkyTabButtonComponent {
|
|
1189
1229
|
constructor(elementRef, adapterService, changeDetectorRef, tabsetService) {
|
|
1230
|
+
_SkyTabButtonComponent_instances.add(this);
|
|
1190
1231
|
this.buttonClick = new EventEmitter();
|
|
1191
1232
|
this.closeClick = new EventEmitter();
|
|
1192
|
-
this.elementRole = DEFAULT_ELEMENT_ROLE$1;
|
|
1193
1233
|
this.closeBtnTabIndex = '-1';
|
|
1234
|
+
_SkyTabButtonComponent__isActive.set(this, false);
|
|
1235
|
+
_SkyTabButtonComponent__isDisabled.set(this, DEFAULT_DISABLED);
|
|
1194
1236
|
_SkyTabButtonComponent__tabStyle.set(this, void 0);
|
|
1195
1237
|
_SkyTabButtonComponent_adapterService.set(this, void 0);
|
|
1196
1238
|
_SkyTabButtonComponent_changeDetectorRef.set(this, void 0);
|
|
@@ -1202,18 +1244,32 @@ class SkyTabButtonComponent {
|
|
|
1202
1244
|
__classPrivateFieldSet(this, _SkyTabButtonComponent_elementRef, elementRef, "f");
|
|
1203
1245
|
__classPrivateFieldSet(this, _SkyTabButtonComponent_tabsetService, tabsetService, "f");
|
|
1204
1246
|
}
|
|
1247
|
+
get active() {
|
|
1248
|
+
return __classPrivateFieldGet(this, _SkyTabButtonComponent__isActive, "f");
|
|
1249
|
+
}
|
|
1250
|
+
set active(value) {
|
|
1251
|
+
__classPrivateFieldSet(this, _SkyTabButtonComponent__isActive, value, "f");
|
|
1252
|
+
__classPrivateFieldGet(this, _SkyTabButtonComponent_instances, "m", _SkyTabButtonComponent_updateWizardStepState).call(this);
|
|
1253
|
+
}
|
|
1254
|
+
get disabled() {
|
|
1255
|
+
return __classPrivateFieldGet(this, _SkyTabButtonComponent__isDisabled, "f");
|
|
1256
|
+
}
|
|
1257
|
+
set disabled(value) {
|
|
1258
|
+
__classPrivateFieldSet(this, _SkyTabButtonComponent__isDisabled, value !== null && value !== void 0 ? value : DEFAULT_DISABLED, "f");
|
|
1259
|
+
__classPrivateFieldGet(this, _SkyTabButtonComponent_instances, "m", _SkyTabButtonComponent_updateWizardStepState).call(this);
|
|
1260
|
+
}
|
|
1205
1261
|
get tabStyle() {
|
|
1206
1262
|
return __classPrivateFieldGet(this, _SkyTabButtonComponent__tabStyle, "f");
|
|
1207
1263
|
}
|
|
1208
1264
|
set tabStyle(style) {
|
|
1209
1265
|
__classPrivateFieldSet(this, _SkyTabButtonComponent__tabStyle, style, "f");
|
|
1210
|
-
this
|
|
1266
|
+
__classPrivateFieldGet(this, _SkyTabButtonComponent_instances, "m", _SkyTabButtonComponent_updateWizardStepState).call(this);
|
|
1211
1267
|
}
|
|
1212
1268
|
ngAfterViewInit() {
|
|
1213
1269
|
__classPrivateFieldGet(this, _SkyTabButtonComponent_tabsetService, "f").focusedTabBtnIndex
|
|
1214
1270
|
.pipe(distinctUntilChanged(), takeUntil(__classPrivateFieldGet(this, _SkyTabButtonComponent_ngUnsubscribe, "f")))
|
|
1215
1271
|
.subscribe((focusedIndex) => {
|
|
1216
|
-
if (focusedIndex === this.tabIndex) {
|
|
1272
|
+
if (this.tabIndex !== undefined && focusedIndex === this.tabIndex) {
|
|
1217
1273
|
this.closeBtnTabIndex = '0';
|
|
1218
1274
|
this.focusBtn();
|
|
1219
1275
|
}
|
|
@@ -1258,15 +1314,33 @@ class SkyTabButtonComponent {
|
|
|
1258
1314
|
__classPrivateFieldGet(this, _SkyTabButtonComponent_adapterService, "f").focusButtonLink(__classPrivateFieldGet(this, _SkyTabButtonComponent_elementRef, "f"));
|
|
1259
1315
|
}
|
|
1260
1316
|
onFocus() {
|
|
1261
|
-
|
|
1317
|
+
if (this.tabIndex !== undefined) {
|
|
1318
|
+
__classPrivateFieldGet(this, _SkyTabButtonComponent_tabsetService, "f").setFocusedTabBtnIndex(this.tabIndex);
|
|
1319
|
+
}
|
|
1262
1320
|
}
|
|
1263
1321
|
}
|
|
1264
|
-
_SkyTabButtonComponent__tabStyle = new WeakMap(), _SkyTabButtonComponent_adapterService = new WeakMap(), _SkyTabButtonComponent_changeDetectorRef = new WeakMap(), _SkyTabButtonComponent_elementRef = new WeakMap(), _SkyTabButtonComponent_tabsetService = new WeakMap(), _SkyTabButtonComponent_ngUnsubscribe = new WeakMap()
|
|
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() {
|
|
1323
|
+
if (this.tabStyle === 'tabs') {
|
|
1324
|
+
this.wizardStepState = undefined;
|
|
1325
|
+
}
|
|
1326
|
+
else {
|
|
1327
|
+
if (this.active) {
|
|
1328
|
+
this.wizardStepState = 'current';
|
|
1329
|
+
}
|
|
1330
|
+
else if (!this.disabled) {
|
|
1331
|
+
this.wizardStepState = 'completed';
|
|
1332
|
+
}
|
|
1333
|
+
else {
|
|
1334
|
+
this.wizardStepState = 'unavailable';
|
|
1335
|
+
}
|
|
1336
|
+
}
|
|
1337
|
+
__classPrivateFieldGet(this, _SkyTabButtonComponent_changeDetectorRef, "f").markForCheck();
|
|
1338
|
+
};
|
|
1265
1339
|
SkyTabButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyTabButtonComponent, deps: [{ token: i0.ElementRef }, { token: SkyTabButtonAdapterService }, { token: i0.ChangeDetectorRef }, { token: SkyTabsetService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1266
|
-
SkyTabButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: SkyTabButtonComponent, selector: "sky-tab-button", inputs: { active: "active", ariaControls: "ariaControls", buttonHref: "buttonHref", buttonId: "buttonId", buttonText: "buttonText", buttonTextCount: "buttonTextCount", closeable: "closeable", disabled: "disabled", tabIndex: "tabIndex", tabStyle: "tabStyle" }, outputs: { buttonClick: "buttonClick", closeClick: "closeClick" }, providers: [SkyTabButtonAdapterService], ngImport: i0, template: "<div\n class=\"sky-btn-tab-wrapper\"\n [ngClass]=\"{\n 'sky-btn-tab-wrapper-selected': active,\n 'sky-btn-tab-wrapper-disabled': disabled\n }\"\n>\n <a\n #tabButtonEl\n class=\"sky-btn-tab\"\n
|
|
1340
|
+
SkyTabButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: SkyTabButtonComponent, selector: "sky-tab-button", inputs: { active: "active", ariaControls: "ariaControls", buttonHref: "buttonHref", buttonId: "buttonId", buttonText: "buttonText", buttonTextCount: "buttonTextCount", closeable: "closeable", disabled: "disabled", tabIndex: "tabIndex", tabNumber: "tabNumber", totalTabsCount: "totalTabsCount", tabStyle: "tabStyle" }, outputs: { buttonClick: "buttonClick", closeClick: "closeClick" }, providers: [SkyTabButtonAdapterService], ngImport: i0, template: "<div\n class=\"sky-btn-tab-wrapper\"\n [ngClass]=\"{\n 'sky-btn-tab-wrapper-selected': active,\n 'sky-btn-tab-wrapper-disabled': disabled\n }\"\n>\n <a\n #tabButtonEl\n class=\"sky-btn-tab\"\n role=\"tab\"\n [attr.aria-controls]=\"ariaControls\"\n [attr.aria-disabled]=\"disabled\"\n [attr.aria-selected]=\"active\"\n [attr.href]=\"buttonHref\"\n [attr.aria-label]=\"\n (tabStyle === 'wizard'\n ? 'skyux_wizard_sr_step_' + wizardStepState\n : 'skyux_tabs_sr_tab_order'\n ) | skyLibResources: tabNumber:totalTabsCount:buttonText\n \"\n [id]=\"buttonId\"\n [ngClass]=\"{\n 'sky-btn-tab-wizard': tabStyle === 'wizard',\n 'sky-btn-tab-selected': active,\n 'sky-btn-tab-disabled': disabled,\n 'sky-tab-btn-closeable': closeable\n }\"\n [tabindex]=\"active ? '0' : '-1'\"\n (click)=\"onButtonClick($event)\"\n (keydown)=\"onTabButtonKeyDown($event)\"\n (focus)=\"onFocus()\"\n >\n <span class=\"sky-tab-heading\" [attr.aria-hidden]=\"true\">\n {{ buttonText }}\n <span *ngIf=\"buttonTextCount !== undefined\" class=\"sky-tab-header-count\">\n {{ buttonTextCount }}\n </span>\n </span>\n </a>\n\n <button\n *ngIf=\"closeable\"\n class=\"sky-btn-tab-close\"\n [tabindex]=\"closeBtnTabIndex\"\n type=\"button\"\n [attr.aria-label]=\"'skyux_tab_close' | skyLibResources: buttonText\"\n [disabled]=\"disabled\"\n [ngClass]=\"{\n 'sky-btn-tab-close-disabled': disabled\n }\"\n (click)=\"onCloseClick($event)\"\n >\n <sky-icon icon=\"remove\"></sky-icon>\n </button>\n</div>\n", styles: [".sky-btn-tab-wrapper{display:inline-block;position:relative;margin-right:5px}.sky-btn-tab-wrapper .sky-btn-tab-close{position:absolute;top:10px;right:10px;color:#686c73}.sky-btn-tab-wrapper .sky-btn-tab-close:hover{color:#212327;transition:color .15s}.sky-btn-tab-wrapper.sky-btn-tab-wrapper-selected:not(.sky-btn-tab-wrapper-disabled) .sky-btn-tab-close{color:#fff}.sky-btn-tab-wrapper.sky-btn-tab-wrapper-disabled{cursor:not-allowed}.sky-tab-btn-closeable{padding-right:43px}:host-context(.sky-theme-modern) .sky-btn-tab-wrapper{margin-right:10px}:host-context(.sky-theme-modern) .sky-btn-tab-wrapper .sky-btn-tab-close{top:12px;right:10px}:host-context(.sky-theme-modern) .sky-btn-tab-wrapper.sky-btn-tab-wrapper-selected:not(.sky-btn-tab-wrapper-disabled) .sky-btn-tab-close{color:#686c73}:host-context(.sky-theme-modern) .sky-tab-btn-closeable{padding-right:44px}.sky-theme-modern .sky-btn-tab-wrapper{margin-right:10px}.sky-theme-modern .sky-btn-tab-wrapper .sky-btn-tab-close{top:12px;right:10px}.sky-theme-modern .sky-btn-tab-wrapper.sky-btn-tab-wrapper-selected:not(.sky-btn-tab-wrapper-disabled) .sky-btn-tab-close{color:#686c73}.sky-theme-modern .sky-tab-btn-closeable{padding-right:44px}:host-context(.sky-theme-modern.sky-theme-mode-dark) .sky-btn-tab-wrapper .sky-btn-tab-close{color:#eeeeef}:host-context(.sky-theme-modern.sky-theme-mode-dark) .sky-btn-tab-wrapper.sky-btn-tab-wrapper-selected:not(.sky-btn-tab-wrapper-disabled) .sky-btn-tab-close{color:#eeeeef}.sky-theme-modern.sky-theme-mode-dark .sky-btn-tab-wrapper .sky-btn-tab-close{color:#eeeeef}.sky-theme-modern.sky-theme-mode-dark .sky-btn-tab-wrapper.sky-btn-tab-wrapper-selected:not(.sky-btn-tab-wrapper-disabled) .sky-btn-tab-close{color:#eeeeef}\n"], dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.λ4, selector: "sky-icon", inputs: ["icon", "iconType", "size", "fixedWidth", "variant"] }, { kind: "pipe", type: i3.SkyLibResourcesPipe, name: "skyLibResources" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
1267
1341
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyTabButtonComponent, decorators: [{
|
|
1268
1342
|
type: Component,
|
|
1269
|
-
args: [{ selector: 'sky-tab-button', providers: [SkyTabButtonAdapterService], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div\n class=\"sky-btn-tab-wrapper\"\n [ngClass]=\"{\n 'sky-btn-tab-wrapper-selected': active,\n 'sky-btn-tab-wrapper-disabled': disabled\n }\"\n>\n <a\n #tabButtonEl\n class=\"sky-btn-tab\"\n
|
|
1343
|
+
args: [{ selector: 'sky-tab-button', providers: [SkyTabButtonAdapterService], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div\n class=\"sky-btn-tab-wrapper\"\n [ngClass]=\"{\n 'sky-btn-tab-wrapper-selected': active,\n 'sky-btn-tab-wrapper-disabled': disabled\n }\"\n>\n <a\n #tabButtonEl\n class=\"sky-btn-tab\"\n role=\"tab\"\n [attr.aria-controls]=\"ariaControls\"\n [attr.aria-disabled]=\"disabled\"\n [attr.aria-selected]=\"active\"\n [attr.href]=\"buttonHref\"\n [attr.aria-label]=\"\n (tabStyle === 'wizard'\n ? 'skyux_wizard_sr_step_' + wizardStepState\n : 'skyux_tabs_sr_tab_order'\n ) | skyLibResources: tabNumber:totalTabsCount:buttonText\n \"\n [id]=\"buttonId\"\n [ngClass]=\"{\n 'sky-btn-tab-wizard': tabStyle === 'wizard',\n 'sky-btn-tab-selected': active,\n 'sky-btn-tab-disabled': disabled,\n 'sky-tab-btn-closeable': closeable\n }\"\n [tabindex]=\"active ? '0' : '-1'\"\n (click)=\"onButtonClick($event)\"\n (keydown)=\"onTabButtonKeyDown($event)\"\n (focus)=\"onFocus()\"\n >\n <span class=\"sky-tab-heading\" [attr.aria-hidden]=\"true\">\n {{ buttonText }}\n <span *ngIf=\"buttonTextCount !== undefined\" class=\"sky-tab-header-count\">\n {{ buttonTextCount }}\n </span>\n </span>\n </a>\n\n <button\n *ngIf=\"closeable\"\n class=\"sky-btn-tab-close\"\n [tabindex]=\"closeBtnTabIndex\"\n type=\"button\"\n [attr.aria-label]=\"'skyux_tab_close' | skyLibResources: buttonText\"\n [disabled]=\"disabled\"\n [ngClass]=\"{\n 'sky-btn-tab-close-disabled': disabled\n }\"\n (click)=\"onCloseClick($event)\"\n >\n <sky-icon icon=\"remove\"></sky-icon>\n </button>\n</div>\n", styles: [".sky-btn-tab-wrapper{display:inline-block;position:relative;margin-right:5px}.sky-btn-tab-wrapper .sky-btn-tab-close{position:absolute;top:10px;right:10px;color:#686c73}.sky-btn-tab-wrapper .sky-btn-tab-close:hover{color:#212327;transition:color .15s}.sky-btn-tab-wrapper.sky-btn-tab-wrapper-selected:not(.sky-btn-tab-wrapper-disabled) .sky-btn-tab-close{color:#fff}.sky-btn-tab-wrapper.sky-btn-tab-wrapper-disabled{cursor:not-allowed}.sky-tab-btn-closeable{padding-right:43px}:host-context(.sky-theme-modern) .sky-btn-tab-wrapper{margin-right:10px}:host-context(.sky-theme-modern) .sky-btn-tab-wrapper .sky-btn-tab-close{top:12px;right:10px}:host-context(.sky-theme-modern) .sky-btn-tab-wrapper.sky-btn-tab-wrapper-selected:not(.sky-btn-tab-wrapper-disabled) .sky-btn-tab-close{color:#686c73}:host-context(.sky-theme-modern) .sky-tab-btn-closeable{padding-right:44px}.sky-theme-modern .sky-btn-tab-wrapper{margin-right:10px}.sky-theme-modern .sky-btn-tab-wrapper .sky-btn-tab-close{top:12px;right:10px}.sky-theme-modern .sky-btn-tab-wrapper.sky-btn-tab-wrapper-selected:not(.sky-btn-tab-wrapper-disabled) .sky-btn-tab-close{color:#686c73}.sky-theme-modern .sky-tab-btn-closeable{padding-right:44px}:host-context(.sky-theme-modern.sky-theme-mode-dark) .sky-btn-tab-wrapper .sky-btn-tab-close{color:#eeeeef}:host-context(.sky-theme-modern.sky-theme-mode-dark) .sky-btn-tab-wrapper.sky-btn-tab-wrapper-selected:not(.sky-btn-tab-wrapper-disabled) .sky-btn-tab-close{color:#eeeeef}.sky-theme-modern.sky-theme-mode-dark .sky-btn-tab-wrapper .sky-btn-tab-close{color:#eeeeef}.sky-theme-modern.sky-theme-mode-dark .sky-btn-tab-wrapper.sky-btn-tab-wrapper-selected:not(.sky-btn-tab-wrapper-disabled) .sky-btn-tab-close{color:#eeeeef}\n"] }]
|
|
1270
1344
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: SkyTabButtonAdapterService }, { type: i0.ChangeDetectorRef }, { type: SkyTabsetService }]; }, propDecorators: { active: [{
|
|
1271
1345
|
type: Input
|
|
1272
1346
|
}], ariaControls: [{
|
|
@@ -1285,6 +1359,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
|
|
|
1285
1359
|
type: Input
|
|
1286
1360
|
}], tabIndex: [{
|
|
1287
1361
|
type: Input
|
|
1362
|
+
}], tabNumber: [{
|
|
1363
|
+
type: Input
|
|
1364
|
+
}], totalTabsCount: [{
|
|
1365
|
+
type: Input
|
|
1288
1366
|
}], tabStyle: [{
|
|
1289
1367
|
type: Input
|
|
1290
1368
|
}], buttonClick: [{
|
|
@@ -1293,40 +1371,48 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
|
|
|
1293
1371
|
type: Output
|
|
1294
1372
|
}] } });
|
|
1295
1373
|
|
|
1374
|
+
var _SkyTabsetPermalinkService_instances, _SkyTabsetPermalinkService_popStateChange, _SkyTabsetPermalinkService_subscription, _SkyTabsetPermalinkService_activatedRoute, _SkyTabsetPermalinkService_location, _SkyTabsetPermalinkService_router, _SkyTabsetPermalinkService_getParams;
|
|
1296
1375
|
/**
|
|
1297
1376
|
* @internal
|
|
1298
1377
|
*/
|
|
1299
1378
|
class SkyTabsetPermalinkService {
|
|
1300
1379
|
constructor(activatedRoute, location, router) {
|
|
1301
|
-
this
|
|
1302
|
-
this
|
|
1303
|
-
this
|
|
1304
|
-
this
|
|
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");
|
|
1305
1390
|
}
|
|
1306
1391
|
get popStateChange() {
|
|
1307
|
-
return this
|
|
1392
|
+
return __classPrivateFieldGet(this, _SkyTabsetPermalinkService_popStateChange, "f");
|
|
1308
1393
|
}
|
|
1309
1394
|
ngOnDestroy() {
|
|
1310
|
-
if (this
|
|
1311
|
-
this.
|
|
1395
|
+
if (__classPrivateFieldGet(this, _SkyTabsetPermalinkService_subscription, "f")) {
|
|
1396
|
+
__classPrivateFieldGet(this, _SkyTabsetPermalinkService_subscription, "f").unsubscribe();
|
|
1312
1397
|
}
|
|
1398
|
+
__classPrivateFieldGet(this, _SkyTabsetPermalinkService_popStateChange, "f").complete();
|
|
1313
1399
|
}
|
|
1314
1400
|
init() {
|
|
1315
|
-
this
|
|
1316
|
-
this.
|
|
1317
|
-
});
|
|
1401
|
+
__classPrivateFieldSet(this, _SkyTabsetPermalinkService_subscription, __classPrivateFieldGet(this, _SkyTabsetPermalinkService_location, "f").subscribe(() => {
|
|
1402
|
+
__classPrivateFieldGet(this, _SkyTabsetPermalinkService_popStateChange, "f").next();
|
|
1403
|
+
}), "f");
|
|
1318
1404
|
}
|
|
1319
1405
|
/**
|
|
1320
1406
|
* Returns the value of a URL query param.
|
|
1321
1407
|
*/
|
|
1322
1408
|
getParam(name) {
|
|
1323
|
-
return this.
|
|
1409
|
+
return __classPrivateFieldGet(this, _SkyTabsetPermalinkService_instances, "m", _SkyTabsetPermalinkService_getParams).call(this)[name];
|
|
1324
1410
|
}
|
|
1325
1411
|
/**
|
|
1326
1412
|
* Sets the value of a URL query param.
|
|
1327
1413
|
*/
|
|
1328
1414
|
setParam(name, value) {
|
|
1329
|
-
const params = this.
|
|
1415
|
+
const params = __classPrivateFieldGet(this, _SkyTabsetPermalinkService_instances, "m", _SkyTabsetPermalinkService_getParams).call(this);
|
|
1330
1416
|
if (value === null) {
|
|
1331
1417
|
delete params[name];
|
|
1332
1418
|
}
|
|
@@ -1335,18 +1421,18 @@ class SkyTabsetPermalinkService {
|
|
|
1335
1421
|
}
|
|
1336
1422
|
// Update the URL without triggering a navigation state change.
|
|
1337
1423
|
// See: https://stackoverflow.com/a/46486677
|
|
1338
|
-
const url = this
|
|
1424
|
+
const url = __classPrivateFieldGet(this, _SkyTabsetPermalinkService_router, "f")
|
|
1339
1425
|
.createUrlTree([], {
|
|
1340
|
-
relativeTo: this
|
|
1426
|
+
relativeTo: __classPrivateFieldGet(this, _SkyTabsetPermalinkService_activatedRoute, "f"),
|
|
1341
1427
|
queryParams: params,
|
|
1342
1428
|
queryParamsHandling: 'merge',
|
|
1343
1429
|
})
|
|
1344
1430
|
.toString();
|
|
1345
1431
|
// Abort redirect if the current URL is equal to the new URL.
|
|
1346
|
-
if (this.
|
|
1432
|
+
if (__classPrivateFieldGet(this, _SkyTabsetPermalinkService_location, "f").isCurrentPathEqualTo(url)) {
|
|
1347
1433
|
return;
|
|
1348
1434
|
}
|
|
1349
|
-
this.
|
|
1435
|
+
__classPrivateFieldGet(this, _SkyTabsetPermalinkService_location, "f").go(url);
|
|
1350
1436
|
}
|
|
1351
1437
|
/**
|
|
1352
1438
|
* Removes the provided query param from the URL.
|
|
@@ -1362,13 +1448,13 @@ class SkyTabsetPermalinkService {
|
|
|
1362
1448
|
if (!name) {
|
|
1363
1449
|
return null;
|
|
1364
1450
|
}
|
|
1365
|
-
const params = this.
|
|
1451
|
+
const params = __classPrivateFieldGet(this, _SkyTabsetPermalinkService_instances, "m", _SkyTabsetPermalinkService_getParams).call(this);
|
|
1366
1452
|
params[name] = value;
|
|
1367
|
-
const baseUrl = this.
|
|
1453
|
+
const baseUrl = __classPrivateFieldGet(this, _SkyTabsetPermalinkService_location, "f").path().split('?')[0];
|
|
1368
1454
|
const paramString = Object.keys(params)
|
|
1369
1455
|
.map((k) => `${k}=${params[k]}`)
|
|
1370
1456
|
.join('&');
|
|
1371
|
-
return this.
|
|
1457
|
+
return __classPrivateFieldGet(this, _SkyTabsetPermalinkService_location, "f").prepareExternalUrl(`${baseUrl}?${paramString}`);
|
|
1372
1458
|
}
|
|
1373
1459
|
/**
|
|
1374
1460
|
* Converts the provided string into a value that can be safely used in a URL.
|
|
@@ -1387,48 +1473,59 @@ class SkyTabsetPermalinkService {
|
|
|
1387
1473
|
.replace(/--/g, '-');
|
|
1388
1474
|
return sanitized;
|
|
1389
1475
|
}
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
const path = this.location.path();
|
|
1396
|
-
if (path.indexOf('?') === -1) {
|
|
1397
|
-
return params;
|
|
1398
|
-
}
|
|
1399
|
-
const existingParamPairs = path.split('?')[1].split('&');
|
|
1400
|
-
existingParamPairs.forEach((pair) => {
|
|
1401
|
-
const fragments = pair.split('=');
|
|
1402
|
-
params[fragments[0]] = decodeURIComponent(fragments[1]);
|
|
1403
|
-
});
|
|
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) {
|
|
1404
1481
|
return params;
|
|
1405
1482
|
}
|
|
1406
|
-
|
|
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
|
+
};
|
|
1407
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 });
|
|
1408
1491
|
SkyTabsetPermalinkService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyTabsetPermalinkService });
|
|
1409
1492
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyTabsetPermalinkService, decorators: [{
|
|
1410
1493
|
type: Injectable
|
|
1411
1494
|
}], ctorParameters: function () { return [{ type: i1$1.ActivatedRoute }, { type: i4.Location }, { type: i1$1.Router }]; } });
|
|
1412
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;
|
|
1413
1497
|
let nextId = 0;
|
|
1414
1498
|
class SkyTabComponent {
|
|
1415
1499
|
constructor(changeDetector, permalinkService, tabsetService) {
|
|
1416
|
-
this
|
|
1417
|
-
this.permalinkService = permalinkService;
|
|
1418
|
-
this.tabsetService = tabsetService;
|
|
1500
|
+
_SkyTabComponent_instances.add(this);
|
|
1419
1501
|
/**
|
|
1420
1502
|
* Fires when users click the button to close the tab.
|
|
1421
1503
|
* The close button is added to the tab when you specify a listener for this event.
|
|
1422
1504
|
* This event only applies when the tabset's `tabStyle` is `"tabs"`.
|
|
1423
1505
|
*/
|
|
1424
1506
|
this.close = new EventEmitter(); // eslint-disable-line @angular-eslint/no-output-native
|
|
1507
|
+
this.permalinkValueOrDefault = '';
|
|
1425
1508
|
this.showContent = false;
|
|
1426
|
-
this
|
|
1427
|
-
this
|
|
1428
|
-
this
|
|
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");
|
|
1429
1522
|
const id = nextId++;
|
|
1430
1523
|
this.tabPanelId = `sky-tab-${id}`;
|
|
1431
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);
|
|
1432
1529
|
}
|
|
1433
1530
|
/**
|
|
1434
1531
|
* Indicates whether the tab is active when the tabset loads. After initialization, the `active`
|
|
@@ -1436,16 +1533,16 @@ class SkyTabComponent {
|
|
|
1436
1533
|
* @default false
|
|
1437
1534
|
*/
|
|
1438
1535
|
set active(value) {
|
|
1439
|
-
if (value !== undefined && value !== this
|
|
1440
|
-
this
|
|
1441
|
-
this.
|
|
1536
|
+
if (value !== undefined && !!value !== __classPrivateFieldGet(this, _SkyTabComponent__active, "f")) {
|
|
1537
|
+
__classPrivateFieldSet(this, _SkyTabComponent__active, value, "f");
|
|
1538
|
+
__classPrivateFieldGet(this, _SkyTabComponent_activeChange, "f").next();
|
|
1442
1539
|
}
|
|
1443
1540
|
}
|
|
1444
1541
|
get active() {
|
|
1445
|
-
return this
|
|
1542
|
+
return __classPrivateFieldGet(this, _SkyTabComponent__active, "f");
|
|
1446
1543
|
}
|
|
1447
1544
|
get activeChange() {
|
|
1448
|
-
return this
|
|
1545
|
+
return __classPrivateFieldGet(this, _SkyTabComponent_activeChange, "f");
|
|
1449
1546
|
}
|
|
1450
1547
|
/**
|
|
1451
1548
|
* Specifies a custom query parameter value for the tab.
|
|
@@ -1456,65 +1553,90 @@ class SkyTabComponent {
|
|
|
1456
1553
|
* This input only applies when the tabset's `tabStyle` is `"tabs"`.
|
|
1457
1554
|
*/
|
|
1458
1555
|
set permalinkValue(value) {
|
|
1459
|
-
this
|
|
1556
|
+
__classPrivateFieldSet(this, _SkyTabComponent__permalinkValue, value, "f");
|
|
1557
|
+
__classPrivateFieldGet(this, _SkyTabComponent_instances, "m", _SkyTabComponent_setPermalinkValueOrDefault).call(this);
|
|
1460
1558
|
}
|
|
1461
1559
|
get permalinkValue() {
|
|
1462
|
-
return (this
|
|
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");
|
|
1463
1576
|
}
|
|
1464
1577
|
/**
|
|
1465
1578
|
* Specifies a unique identifier for the tab.
|
|
1466
1579
|
* If not defined, the identifier is set to the position of the tab on load, starting with `0`.
|
|
1467
1580
|
*/
|
|
1468
1581
|
set tabIndex(value) {
|
|
1469
|
-
if (value !== this
|
|
1582
|
+
if (value !== __classPrivateFieldGet(this, _SkyTabComponent__tabIndex, "f") &&
|
|
1470
1583
|
value !== undefined &&
|
|
1471
|
-
this
|
|
1472
|
-
this.
|
|
1473
|
-
this.
|
|
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);
|
|
1474
1587
|
}
|
|
1475
|
-
this
|
|
1588
|
+
__classPrivateFieldSet(this, _SkyTabComponent__tabIndex, value, "f");
|
|
1476
1589
|
}
|
|
1477
1590
|
get tabIndex() {
|
|
1478
|
-
return this
|
|
1479
|
-
}
|
|
1480
|
-
get closeable() {
|
|
1481
|
-
return this.close.observers.length > 0;
|
|
1591
|
+
return __classPrivateFieldGet(this, _SkyTabComponent__tabIndex, "f");
|
|
1482
1592
|
}
|
|
1483
1593
|
/**
|
|
1484
1594
|
* Alerts the tabset component when this component has changes that need to be reflected in the UI.
|
|
1485
1595
|
*/
|
|
1486
1596
|
get stateChange() {
|
|
1487
|
-
return this
|
|
1597
|
+
return __classPrivateFieldGet(this, _SkyTabComponent_stateChange, "f");
|
|
1488
1598
|
}
|
|
1489
1599
|
get tabIndexChange() {
|
|
1490
|
-
return this
|
|
1600
|
+
return __classPrivateFieldGet(this, _SkyTabComponent_tabIndexChange, "f");
|
|
1491
1601
|
}
|
|
1492
1602
|
ngOnChanges(changes) {
|
|
1493
1603
|
if ((changes.disabled && !changes.disabled.firstChange) ||
|
|
1494
1604
|
(changes.tabHeading && !changes.tabHeading.firstChange) ||
|
|
1495
1605
|
(changes.tabHeaderCount && !changes.tabHeaderCount.firstChange) ||
|
|
1496
1606
|
(changes.permalinkValue && !changes.permalinkValue.firstChange)) {
|
|
1497
|
-
this.
|
|
1607
|
+
__classPrivateFieldGet(this, _SkyTabComponent_stateChange, "f").next();
|
|
1498
1608
|
}
|
|
1499
1609
|
}
|
|
1500
1610
|
ngOnDestroy() {
|
|
1501
|
-
this.
|
|
1502
|
-
this.
|
|
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
|
+
}
|
|
1503
1617
|
}
|
|
1504
1618
|
init() {
|
|
1505
|
-
this
|
|
1619
|
+
__classPrivateFieldSet(this, _SkyTabComponent__tabIndex, __classPrivateFieldGet(this, _SkyTabComponent_tabsetService, "f").registerTab(this.tabIndex), "f");
|
|
1506
1620
|
}
|
|
1507
1621
|
activate() {
|
|
1508
|
-
this
|
|
1622
|
+
__classPrivateFieldSet(this, _SkyTabComponent__active, true, "f");
|
|
1509
1623
|
this.showContent = true;
|
|
1510
|
-
this.
|
|
1624
|
+
__classPrivateFieldGet(this, _SkyTabComponent_changeDetector, "f").markForCheck();
|
|
1511
1625
|
}
|
|
1512
1626
|
deactivate() {
|
|
1513
|
-
this
|
|
1627
|
+
__classPrivateFieldSet(this, _SkyTabComponent__active, false, "f");
|
|
1514
1628
|
this.showContent = false;
|
|
1515
|
-
this.
|
|
1629
|
+
__classPrivateFieldGet(this, _SkyTabComponent_changeDetector, "f").markForCheck();
|
|
1630
|
+
}
|
|
1631
|
+
isCloseable() {
|
|
1632
|
+
return this.close.observers.length > 0;
|
|
1516
1633
|
}
|
|
1517
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
|
+
};
|
|
1518
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 });
|
|
1519
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 });
|
|
1520
1642
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyTabComponent, decorators: [{
|
|
@@ -1536,7 +1658,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
|
|
|
1536
1658
|
type: Output
|
|
1537
1659
|
}] } });
|
|
1538
1660
|
|
|
1539
|
-
|
|
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;
|
|
1540
1682
|
const buttonTypeNext = 'next';
|
|
1541
1683
|
const buttonTypePrevious = 'previous';
|
|
1542
1684
|
const buttonTypeFinish = 'finish';
|
|
@@ -1544,6 +1686,7 @@ class SkyTabsetNavButtonComponent {
|
|
|
1544
1686
|
constructor(logger) {
|
|
1545
1687
|
_SkyTabsetNavButtonComponent_instances.add(this);
|
|
1546
1688
|
this.isVisible = false;
|
|
1689
|
+
this.type = 'submit';
|
|
1547
1690
|
_SkyTabsetNavButtonComponent__buttonType.set(this, void 0);
|
|
1548
1691
|
_SkyTabsetNavButtonComponent__disabled.set(this, void 0);
|
|
1549
1692
|
_SkyTabsetNavButtonComponent__tabset.set(this, void 0);
|
|
@@ -1552,7 +1695,6 @@ class SkyTabsetNavButtonComponent {
|
|
|
1552
1695
|
_SkyTabsetNavButtonComponent_currentTabsetSub.set(this, void 0);
|
|
1553
1696
|
_SkyTabsetNavButtonComponent_logger.set(this, void 0);
|
|
1554
1697
|
_SkyTabsetNavButtonComponent_tabCount.set(this, void 0);
|
|
1555
|
-
_SkyTabsetNavButtonComponent_tabToSelect.set(this, void 0);
|
|
1556
1698
|
_SkyTabsetNavButtonComponent_ngUnsubscribe.set(this, new Subject());
|
|
1557
1699
|
__classPrivateFieldSet(this, _SkyTabsetNavButtonComponent_logger, logger, "f");
|
|
1558
1700
|
}
|
|
@@ -1560,20 +1702,21 @@ class SkyTabsetNavButtonComponent {
|
|
|
1560
1702
|
* Specifies the tabset wizard component to associate with the nav button.
|
|
1561
1703
|
* @required
|
|
1562
1704
|
*/
|
|
1705
|
+
get tabset() {
|
|
1706
|
+
return __classPrivateFieldGet(this, _SkyTabsetNavButtonComponent__tabset, "f");
|
|
1707
|
+
}
|
|
1563
1708
|
set tabset(value) {
|
|
1564
1709
|
__classPrivateFieldSet(this, _SkyTabsetNavButtonComponent__tabset, value, "f");
|
|
1565
1710
|
if (__classPrivateFieldGet(this, _SkyTabsetNavButtonComponent_currentTabsetSub, "f")) {
|
|
1566
1711
|
__classPrivateFieldGet(this, _SkyTabsetNavButtonComponent_currentTabsetSub, "f").unsubscribe();
|
|
1567
1712
|
}
|
|
1568
1713
|
if (value) {
|
|
1569
|
-
|
|
1570
|
-
__classPrivateFieldGet(this, _SkyTabsetNavButtonComponent__tabset, "f").hasFinishButton = true;
|
|
1571
|
-
}
|
|
1572
|
-
__classPrivateFieldSet(this, _SkyTabsetNavButtonComponent_currentTabsetSub, __classPrivateFieldGet(this, _SkyTabsetNavButtonComponent__tabset, "f").activeChange
|
|
1714
|
+
__classPrivateFieldSet(this, _SkyTabsetNavButtonComponent_currentTabsetSub, value.activeChange
|
|
1573
1715
|
.pipe(distinctUntilChanged(), takeUntil(__classPrivateFieldGet(this, _SkyTabsetNavButtonComponent_ngUnsubscribe, "f")))
|
|
1574
1716
|
.subscribe((index) => {
|
|
1717
|
+
var _a, _b;
|
|
1575
1718
|
__classPrivateFieldSet(this, _SkyTabsetNavButtonComponent_activeSkyTabIndex, index, "f");
|
|
1576
|
-
__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");
|
|
1577
1720
|
__classPrivateFieldGet(this, _SkyTabsetNavButtonComponent_instances, "m", _SkyTabsetNavButtonComponent_updateTabToSelect).call(this);
|
|
1578
1721
|
__classPrivateFieldGet(this, _SkyTabsetNavButtonComponent_instances, "m", _SkyTabsetNavButtonComponent_updateButtonVisibility).call(this);
|
|
1579
1722
|
__classPrivateFieldGet(this, _SkyTabsetNavButtonComponent_instances, "m", _SkyTabsetNavButtonComponent_updateButtonProperties).call(this);
|
|
@@ -1611,13 +1754,7 @@ class SkyTabsetNavButtonComponent {
|
|
|
1611
1754
|
__classPrivateFieldSet(this, _SkyTabsetNavButtonComponent__disabled, value, "f");
|
|
1612
1755
|
}
|
|
1613
1756
|
get disabled() {
|
|
1614
|
-
|
|
1615
|
-
return __classPrivateFieldGet(this, _SkyTabsetNavButtonComponent__disabled, "f");
|
|
1616
|
-
}
|
|
1617
|
-
else if (__classPrivateFieldGet(this, _SkyTabsetNavButtonComponent__buttonType, "f") === buttonTypeFinish) {
|
|
1618
|
-
return false;
|
|
1619
|
-
}
|
|
1620
|
-
return !__classPrivateFieldGet(this, _SkyTabsetNavButtonComponent_tabToSelect, "f") || __classPrivateFieldGet(this, _SkyTabsetNavButtonComponent_tabToSelect, "f").disabled;
|
|
1757
|
+
return __classPrivateFieldGet(this, _SkyTabsetNavButtonComponent__disabled, "f");
|
|
1621
1758
|
}
|
|
1622
1759
|
ngOnDestroy() {
|
|
1623
1760
|
__classPrivateFieldGet(this, _SkyTabsetNavButtonComponent_ngUnsubscribe, "f").next();
|
|
@@ -1625,59 +1762,55 @@ class SkyTabsetNavButtonComponent {
|
|
|
1625
1762
|
}
|
|
1626
1763
|
buttonClick() {
|
|
1627
1764
|
/* istanbul ignore else */
|
|
1628
|
-
if (
|
|
1629
|
-
|
|
1765
|
+
if (this.tabToSelect && !this.tabToSelect.disabled && this.tabset) {
|
|
1766
|
+
this.tabset.active = this.tabToSelect.tabIndex;
|
|
1630
1767
|
}
|
|
1631
1768
|
}
|
|
1632
1769
|
}
|
|
1633
|
-
_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(),
|
|
1634
|
-
const isLastStep = __classPrivateFieldGet(this, _SkyTabsetNavButtonComponent_activeIndexNumber, "f") === __classPrivateFieldGet(this, _SkyTabsetNavButtonComponent_tabCount, "f") - 1;
|
|
1635
|
-
if (
|
|
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;
|
|
1772
|
+
if (this.buttonType === buttonTypeFinish) {
|
|
1636
1773
|
this.isVisible = isLastStep;
|
|
1637
|
-
return;
|
|
1638
1774
|
}
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
this.isVisible =
|
|
1644
|
-
return;
|
|
1775
|
+
else if (this.buttonType === buttonTypeNext) {
|
|
1776
|
+
this.isVisible = !isLastStep;
|
|
1777
|
+
}
|
|
1778
|
+
else {
|
|
1779
|
+
this.isVisible = true;
|
|
1645
1780
|
}
|
|
1646
|
-
this.isVisible = true;
|
|
1647
1781
|
}, _SkyTabsetNavButtonComponent_updateButtonProperties = function _SkyTabsetNavButtonComponent_updateButtonProperties() {
|
|
1648
|
-
var _a
|
|
1649
|
-
if (
|
|
1650
|
-
|
|
1651
|
-
((_a = __classPrivateFieldGet(this, _SkyTabsetNavButtonComponent__tabset, "f")) === null || _a === void 0 ? void 0 : _a.hasFinishButton)) {
|
|
1782
|
+
var _a;
|
|
1783
|
+
if (this.buttonType === buttonTypeNext ||
|
|
1784
|
+
this.buttonType === buttonTypeFinish) {
|
|
1652
1785
|
this.buttonClassName = 'sky-btn-primary';
|
|
1653
1786
|
}
|
|
1654
1787
|
else {
|
|
1655
1788
|
this.buttonClassName = 'sky-btn-default';
|
|
1656
1789
|
}
|
|
1657
|
-
this.ariaControls = (
|
|
1790
|
+
this.ariaControls = (_a = this.tabToSelect) === null || _a === void 0 ? void 0 : _a.tabPanelId;
|
|
1658
1791
|
}, _SkyTabsetNavButtonComponent_updateTabToSelect = function _SkyTabsetNavButtonComponent_updateTabToSelect() {
|
|
1659
1792
|
var _a;
|
|
1660
|
-
if ((_a =
|
|
1661
|
-
const tabs =
|
|
1662
|
-
|
|
1793
|
+
if ((_a = this.tabset) === null || _a === void 0 ? void 0 : _a.tabs) {
|
|
1794
|
+
const tabs = this.tabset.tabs.toArray();
|
|
1795
|
+
this.tabToSelect = undefined;
|
|
1663
1796
|
// tab index can be a number or a string, but we need the actual number index
|
|
1664
1797
|
__classPrivateFieldSet(this, _SkyTabsetNavButtonComponent_activeIndexNumber, tabs.findIndex((tab) => tab.tabIndex === __classPrivateFieldGet(this, _SkyTabsetNavButtonComponent_activeSkyTabIndex, "f")), "f");
|
|
1665
1798
|
/* istanbul ignore else */
|
|
1666
1799
|
if (__classPrivateFieldGet(this, _SkyTabsetNavButtonComponent_activeIndexNumber, "f") !== undefined) {
|
|
1667
|
-
if (
|
|
1668
|
-
|
|
1800
|
+
if (this.buttonType === buttonTypeNext) {
|
|
1801
|
+
this.tabToSelect = tabs[__classPrivateFieldGet(this, _SkyTabsetNavButtonComponent_activeIndexNumber, "f") + 1];
|
|
1669
1802
|
}
|
|
1670
|
-
else if (
|
|
1671
|
-
|
|
1803
|
+
else if (this.buttonType === buttonTypePrevious) {
|
|
1804
|
+
this.tabToSelect = tabs[__classPrivateFieldGet(this, _SkyTabsetNavButtonComponent_activeIndexNumber, "f") - 1];
|
|
1672
1805
|
}
|
|
1673
1806
|
}
|
|
1674
1807
|
}
|
|
1675
1808
|
};
|
|
1676
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 });
|
|
1677
|
-
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" }] });
|
|
1678
1811
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyTabsetNavButtonComponent, decorators: [{
|
|
1679
1812
|
type: Component,
|
|
1680
|
-
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" }]
|
|
1681
1814
|
}], ctorParameters: function () { return [{ type: i1.SkyLogService }]; }, propDecorators: { tabset: [{
|
|
1682
1815
|
type: Input
|
|
1683
1816
|
}], buttonType: [{
|
|
@@ -1688,25 +1821,35 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
|
|
|
1688
1821
|
type: Input
|
|
1689
1822
|
}] } });
|
|
1690
1823
|
|
|
1824
|
+
var _SkyTabsetAdapterService_instances, _SkyTabsetAdapterService_currentOverflow, _SkyTabsetAdapterService_tabsetRef, _SkyTabsetAdapterService_tabsOffsetLeft, _SkyTabsetAdapterService_overflowChange, _SkyTabsetAdapterService_getTabsOffsetLeft;
|
|
1691
1825
|
/**
|
|
1692
1826
|
* @internal
|
|
1693
1827
|
*/
|
|
1694
1828
|
class SkyTabsetAdapterService {
|
|
1695
1829
|
constructor() {
|
|
1696
|
-
|
|
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");
|
|
1697
1836
|
}
|
|
1698
1837
|
get overflowChange() {
|
|
1699
|
-
return this
|
|
1838
|
+
return __classPrivateFieldGet(this, _SkyTabsetAdapterService_overflowChange, "f");
|
|
1839
|
+
}
|
|
1840
|
+
ngOnDestroy() {
|
|
1841
|
+
__classPrivateFieldGet(this, _SkyTabsetAdapterService_overflowChange, "f").complete();
|
|
1700
1842
|
}
|
|
1701
1843
|
registerTabset(tabsetRef) {
|
|
1702
|
-
this
|
|
1703
|
-
this
|
|
1844
|
+
__classPrivateFieldSet(this, _SkyTabsetAdapterService_tabsetRef, tabsetRef, "f");
|
|
1845
|
+
__classPrivateFieldSet(this, _SkyTabsetAdapterService_tabsOffsetLeft, __classPrivateFieldGet(this, _SkyTabsetAdapterService_instances, "m", _SkyTabsetAdapterService_getTabsOffsetLeft).call(this, tabsetRef.nativeElement), "f");
|
|
1704
1846
|
}
|
|
1705
1847
|
/**
|
|
1706
1848
|
* Detects if the tab buttons are wider than the tabset container.
|
|
1707
1849
|
*/
|
|
1708
1850
|
detectOverflow() {
|
|
1709
|
-
|
|
1851
|
+
var _a;
|
|
1852
|
+
const nativeElement = (_a = __classPrivateFieldGet(this, _SkyTabsetAdapterService_tabsetRef, "f")) === null || _a === void 0 ? void 0 : _a.nativeElement;
|
|
1710
1853
|
const tabsetRect = nativeElement
|
|
1711
1854
|
.querySelector('.sky-tabset')
|
|
1712
1855
|
.getBoundingClientRect();
|
|
@@ -1716,40 +1859,37 @@ class SkyTabsetAdapterService {
|
|
|
1716
1859
|
const tabExtraButtonsRect = nativeElement
|
|
1717
1860
|
.querySelector('.sky-tabset-btns')
|
|
1718
1861
|
.getBoundingClientRect();
|
|
1719
|
-
const tabButtonsWidth = tabButtonsRect.width + tabExtraButtonsRect.width + this
|
|
1862
|
+
const tabButtonsWidth = tabButtonsRect.width + tabExtraButtonsRect.width + __classPrivateFieldGet(this, _SkyTabsetAdapterService_tabsOffsetLeft, "f");
|
|
1720
1863
|
const newOverflow = tabButtonsWidth > tabsetRect.width;
|
|
1721
|
-
if (this
|
|
1722
|
-
this
|
|
1723
|
-
this.
|
|
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"));
|
|
1724
1867
|
}
|
|
1725
1868
|
}
|
|
1726
|
-
/**
|
|
1727
|
-
* Returns the number of pixels to the left of the first tab.
|
|
1728
|
-
*/
|
|
1729
|
-
getTabsOffsetLeft(tabsetEl) {
|
|
1730
|
-
const tabsetRect = tabsetEl.getBoundingClientRect();
|
|
1731
|
-
// The dropdown element is the first "tab" and always exists in the DOM, even when hidden.
|
|
1732
|
-
const firstTabRect = tabsetEl
|
|
1733
|
-
.querySelector('.sky-tabset-dropdown')
|
|
1734
|
-
.getBoundingClientRect();
|
|
1735
|
-
return firstTabRect.left - tabsetRect.left;
|
|
1736
|
-
}
|
|
1737
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
|
+
};
|
|
1738
1883
|
SkyTabsetAdapterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyTabsetAdapterService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1739
1884
|
SkyTabsetAdapterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyTabsetAdapterService });
|
|
1740
1885
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyTabsetAdapterService, decorators: [{
|
|
1741
1886
|
type: Injectable
|
|
1742
|
-
}] });
|
|
1887
|
+
}], ctorParameters: function () { return []; } });
|
|
1743
1888
|
|
|
1744
|
-
var
|
|
1745
|
-
const DEFAULT_ELEMENT_ROLE = 'tablist';
|
|
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;
|
|
1746
1890
|
class SkyTabsetComponent {
|
|
1747
1891
|
constructor(changeDetector, elementRef, adapterService, permalinkService, tabsetService) {
|
|
1748
|
-
this
|
|
1749
|
-
this.elementRef = elementRef;
|
|
1750
|
-
this.adapterService = adapterService;
|
|
1751
|
-
this.permalinkService = permalinkService;
|
|
1752
|
-
this.tabsetService = tabsetService;
|
|
1892
|
+
_SkyTabsetComponent_instances.add(this);
|
|
1753
1893
|
/**
|
|
1754
1894
|
* Fires when the active tab changes. This event emits the index of the active tab.
|
|
1755
1895
|
*/
|
|
@@ -1771,42 +1911,57 @@ class SkyTabsetComponent {
|
|
|
1771
1911
|
* This event only applies when `tabStyle` is `"tabs"`.
|
|
1772
1912
|
*/
|
|
1773
1913
|
this.tabIndexesChange = new EventEmitter();
|
|
1914
|
+
this.dropdownTriggerButtonText = '';
|
|
1774
1915
|
this.tabButtons = [];
|
|
1775
|
-
this
|
|
1776
|
-
this
|
|
1777
|
-
this
|
|
1778
|
-
|
|
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");
|
|
1779
1934
|
}
|
|
1780
1935
|
/**
|
|
1781
1936
|
* Activates a tab by its `tabIndex` property.
|
|
1782
1937
|
*/
|
|
1783
1938
|
set active(value) {
|
|
1784
1939
|
if (value === undefined ||
|
|
1785
|
-
this.
|
|
1940
|
+
__classPrivateFieldGet(this, _SkyTabsetComponent_tabsetService, "f").tabIndexesEqual(value, __classPrivateFieldGet(this, _SkyTabsetComponent__active, "f"))) {
|
|
1786
1941
|
return;
|
|
1787
1942
|
}
|
|
1788
|
-
this
|
|
1943
|
+
__classPrivateFieldSet(this, _SkyTabsetComponent__active, value, "f");
|
|
1789
1944
|
if (this.tabs) {
|
|
1790
|
-
this.
|
|
1945
|
+
__classPrivateFieldGet(this, _SkyTabsetComponent_tabsetService, "f").setActiveTabIndex(value);
|
|
1791
1946
|
}
|
|
1792
1947
|
else {
|
|
1793
1948
|
// On init, wait for children tabs to render before broadcasting the active tab index.
|
|
1794
1949
|
setTimeout(() => {
|
|
1795
|
-
if (this.
|
|
1950
|
+
if (__classPrivateFieldGet(this, _SkyTabsetComponent_tabsetService, "f").isValidTabIndex(value)) {
|
|
1796
1951
|
// On init, yield to the permalink ID, if it exists.
|
|
1797
|
-
if (this.
|
|
1798
|
-
this.
|
|
1952
|
+
if (__classPrivateFieldGet(this, _SkyTabsetComponent_instances, "m", _SkyTabsetComponent_getActiveTabIndexByPermalinkId).call(this) === undefined) {
|
|
1953
|
+
__classPrivateFieldGet(this, _SkyTabsetComponent_tabsetService, "f").setActiveTabIndex(value);
|
|
1799
1954
|
}
|
|
1800
1955
|
}
|
|
1801
1956
|
else {
|
|
1802
1957
|
// Activate the first tab if the new tab index is invalid.
|
|
1803
|
-
this
|
|
1958
|
+
__classPrivateFieldSet(this, _SkyTabsetComponent__active, __classPrivateFieldGet(this, _SkyTabsetComponent_tabsetService, "f").activateFirstTab(), "f");
|
|
1804
1959
|
}
|
|
1805
1960
|
});
|
|
1806
1961
|
}
|
|
1807
1962
|
}
|
|
1808
1963
|
get active() {
|
|
1809
|
-
return this
|
|
1964
|
+
return __classPrivateFieldGet(this, _SkyTabsetComponent__active, "f");
|
|
1810
1965
|
}
|
|
1811
1966
|
/**
|
|
1812
1967
|
* Distinguishes a tabset's unique state in the URL by generating a query parameter
|
|
@@ -1817,78 +1972,85 @@ class SkyTabsetComponent {
|
|
|
1817
1972
|
*/
|
|
1818
1973
|
set permalinkId(value) {
|
|
1819
1974
|
if (!value) {
|
|
1820
|
-
|
|
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");
|
|
1821
1980
|
}
|
|
1822
|
-
const sanitized = this.permalinkService.urlify(value);
|
|
1823
|
-
this._permalinkId = `${sanitized}-active-tab`;
|
|
1824
1981
|
}
|
|
1825
1982
|
get permalinkId() {
|
|
1826
|
-
return this
|
|
1983
|
+
return __classPrivateFieldGet(this, _SkyTabsetComponent__permalinkId, "f");
|
|
1827
1984
|
}
|
|
1828
1985
|
/**
|
|
1829
1986
|
* Specifies the behavior for a series of tabs.
|
|
1830
1987
|
* @default "tabs"
|
|
1831
1988
|
*/
|
|
1832
1989
|
set tabStyle(value) {
|
|
1833
|
-
this
|
|
1834
|
-
this.elementRole = value === 'tabs' ? DEFAULT_ELEMENT_ROLE : undefined;
|
|
1990
|
+
__classPrivateFieldSet(this, _SkyTabsetComponent__tabStyle, value || 'tabs', "f");
|
|
1835
1991
|
}
|
|
1836
1992
|
get tabStyle() {
|
|
1837
|
-
return this
|
|
1993
|
+
return __classPrivateFieldGet(this, _SkyTabsetComponent__tabStyle, "f");
|
|
1838
1994
|
}
|
|
1839
1995
|
set tabDisplayMode(value) {
|
|
1840
|
-
this
|
|
1841
|
-
this.
|
|
1996
|
+
__classPrivateFieldSet(this, _SkyTabsetComponent__tabDisplayMode, value, "f");
|
|
1997
|
+
__classPrivateFieldGet(this, _SkyTabsetComponent_changeDetector, "f").markForCheck();
|
|
1842
1998
|
}
|
|
1843
1999
|
get tabDisplayMode() {
|
|
1844
|
-
return this
|
|
2000
|
+
return __classPrivateFieldGet(this, _SkyTabsetComponent__tabDisplayMode, "f");
|
|
1845
2001
|
}
|
|
1846
|
-
|
|
1847
|
-
|
|
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
|
+
});
|
|
1848
2008
|
}
|
|
1849
|
-
|
|
1850
|
-
|
|
2009
|
+
get tabs() {
|
|
2010
|
+
return __classPrivateFieldGet(this, _SkyTabsetComponent__tabs, "f");
|
|
1851
2011
|
}
|
|
1852
2012
|
ngAfterViewInit() {
|
|
1853
|
-
this.
|
|
1854
|
-
this.
|
|
1855
|
-
|
|
1856
|
-
this.
|
|
1857
|
-
this.
|
|
1858
|
-
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);
|
|
1859
2018
|
// If the currently active tab is getting unregistered, activate the next one.
|
|
1860
|
-
this.
|
|
1861
|
-
.pipe(takeUntil(this
|
|
2019
|
+
__classPrivateFieldGet(this, _SkyTabsetComponent_tabsetService, "f").activeTabUnregistered
|
|
2020
|
+
.pipe(takeUntil(__classPrivateFieldGet(this, _SkyTabsetComponent_ngUnsubscribe, "f")))
|
|
1862
2021
|
.subscribe((tab) => {
|
|
1863
2022
|
// Wait for the new tabs to render before activating.
|
|
1864
2023
|
setTimeout(() => {
|
|
1865
|
-
this.
|
|
2024
|
+
__classPrivateFieldGet(this, _SkyTabsetComponent_tabsetService, "f").activateNearestTab(tab.arrayIndex);
|
|
1866
2025
|
});
|
|
1867
2026
|
});
|
|
1868
2027
|
// Let the tabset render the initial active index before listening for changes.
|
|
1869
2028
|
setTimeout(() => {
|
|
1870
|
-
this.
|
|
1871
|
-
this.
|
|
1872
|
-
this.
|
|
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();
|
|
1873
2032
|
});
|
|
1874
2033
|
}
|
|
1875
2034
|
ngOnDestroy() {
|
|
1876
|
-
this.
|
|
1877
|
-
this.
|
|
1878
|
-
this.
|
|
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);
|
|
1879
2040
|
if (this.permalinkId) {
|
|
1880
|
-
this.
|
|
2041
|
+
__classPrivateFieldGet(this, _SkyTabsetComponent_permalinkService, "f").clearParam(this.permalinkId);
|
|
1881
2042
|
}
|
|
1882
2043
|
}
|
|
1883
2044
|
onWindowResize() {
|
|
1884
|
-
this.
|
|
2045
|
+
__classPrivateFieldGet(this, _SkyTabsetComponent_adapterService, "f").detectOverflow();
|
|
1885
2046
|
}
|
|
1886
2047
|
onTabCloseClick(tabButton) {
|
|
1887
|
-
|
|
1888
|
-
tabComponent.
|
|
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();
|
|
1889
2051
|
}
|
|
1890
2052
|
onTabButtonClick(tabButton) {
|
|
1891
|
-
this.
|
|
2053
|
+
__classPrivateFieldGet(this, _SkyTabsetComponent_tabsetService, "f").setActiveTabIndex(tabButton.tabIndex);
|
|
1892
2054
|
}
|
|
1893
2055
|
onNewTabClick() {
|
|
1894
2056
|
this.newTab.emit();
|
|
@@ -1897,229 +2059,205 @@ class SkyTabsetComponent {
|
|
|
1897
2059
|
this.openTab.emit();
|
|
1898
2060
|
}
|
|
1899
2061
|
onRightKeyDown() {
|
|
1900
|
-
this.
|
|
2062
|
+
__classPrivateFieldGet(this, _SkyTabsetComponent_tabsetService, "f").focusNextTabBtn(this.tabButtons);
|
|
1901
2063
|
}
|
|
1902
2064
|
onLeftKeyDown() {
|
|
1903
|
-
this.
|
|
2065
|
+
__classPrivateFieldGet(this, _SkyTabsetComponent_tabsetService, "f").focusPrevTabBtn(this.tabButtons);
|
|
1904
2066
|
}
|
|
1905
2067
|
onHomeKeyDown() {
|
|
1906
|
-
this.
|
|
2068
|
+
__classPrivateFieldGet(this, _SkyTabsetComponent_tabsetService, "f").focusFirstOrNearestTabBtn(this.tabButtons);
|
|
1907
2069
|
}
|
|
1908
2070
|
onEndKeyDown() {
|
|
1909
|
-
this.
|
|
2071
|
+
__classPrivateFieldGet(this, _SkyTabsetComponent_tabsetService, "f").focusLastOrNearestTabBtn(this.tabButtons);
|
|
1910
2072
|
}
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
getInitialTabIndex() {
|
|
1918
|
-
var _a;
|
|
1919
|
-
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;
|
|
1920
2079
|
if (activeIndex === undefined) {
|
|
1921
|
-
activeIndex =
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
this.
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
});
|
|
1934
|
-
}
|
|
1935
|
-
listenTabComponentsStructuralChange() {
|
|
1936
|
-
this.tabs.changes.pipe(takeUntil(this.ngUnsubscribe)).subscribe(() => {
|
|
1937
|
-
this.resetTabComponents();
|
|
1938
|
-
});
|
|
1939
|
-
}
|
|
1940
|
-
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) {
|
|
1941
2092
|
combineLatest(this.tabs.map((tab) => tab.activeChange))
|
|
1942
|
-
.pipe(takeUntil(race(this
|
|
2093
|
+
.pipe(takeUntil(race(__classPrivateFieldGet(this, _SkyTabsetComponent_tabComponentsStateChangeUnsubscribe, "f"), __classPrivateFieldGet(this, _SkyTabsetComponent_ngUnsubscribe, "f"))))
|
|
1943
2094
|
.subscribe(() => {
|
|
1944
2095
|
// Wait for the tab components to render changes before finding the active one.
|
|
1945
2096
|
setTimeout(() => {
|
|
1946
2097
|
var _a;
|
|
1947
|
-
const tabIndex = (_a = this.
|
|
1948
|
-
this.
|
|
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);
|
|
1949
2100
|
});
|
|
1950
2101
|
});
|
|
1951
2102
|
combineLatest(this.tabs.map((tab) => tab.tabIndexChange))
|
|
1952
|
-
.pipe(takeUntil(race(this
|
|
2103
|
+
.pipe(takeUntil(race(__classPrivateFieldGet(this, _SkyTabsetComponent_tabComponentsStateChangeUnsubscribe, "f"), __classPrivateFieldGet(this, _SkyTabsetComponent_ngUnsubscribe, "f"))))
|
|
1953
2104
|
.subscribe(() => {
|
|
1954
2105
|
// Don't emit the first change.
|
|
1955
2106
|
if (this.lastActiveTabIndex !== undefined) {
|
|
1956
2107
|
// Wait for the tab components to render changes before updating the view.
|
|
1957
2108
|
setTimeout(() => {
|
|
1958
|
-
this.
|
|
1959
|
-
this.
|
|
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);
|
|
1960
2111
|
});
|
|
1961
2112
|
}
|
|
1962
2113
|
});
|
|
1963
2114
|
combineLatest(this.tabs.map((tab) => tab.stateChange))
|
|
1964
|
-
.pipe(takeUntil(race(this
|
|
2115
|
+
.pipe(takeUntil(race(__classPrivateFieldGet(this, _SkyTabsetComponent_tabComponentsStateChangeUnsubscribe, "f"), __classPrivateFieldGet(this, _SkyTabsetComponent_ngUnsubscribe, "f"))))
|
|
1965
2116
|
.subscribe(() => {
|
|
1966
2117
|
// Wait for the tab components to render changes before finding the active one.
|
|
1967
2118
|
setTimeout(() => {
|
|
1968
|
-
this.
|
|
2119
|
+
__classPrivateFieldGet(this, _SkyTabsetComponent_instances, "m", _SkyTabsetComponent_updateTabsetComponent).call(this, __classPrivateFieldGet(this, _SkyTabsetComponent_tabsetService, "f").currentActiveTabIndex, true);
|
|
1969
2120
|
});
|
|
1970
2121
|
});
|
|
1971
2122
|
}
|
|
1972
|
-
|
|
1973
|
-
|
|
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;
|
|
1974
2134
|
}
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
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,
|
|
2146
|
+
tabIndex: tab.tabIndex,
|
|
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;
|
|
1983
2176
|
}
|
|
1984
|
-
|
|
1985
|
-
const activeIndex = (_a = this.getActiveTabComponent()) === null || _a === void 0 ? void 0 : _a.tabIndex;
|
|
1986
|
-
this.tabsetService.setActiveTabIndex(activeIndex, {
|
|
1987
|
-
emitChange: false,
|
|
1988
|
-
});
|
|
1989
|
-
this.listenTabComponentsStateChange();
|
|
1990
|
-
}
|
|
1991
|
-
emitTabIndexChange() {
|
|
1992
|
-
this.tabIndexesChange.emit({
|
|
1993
|
-
tabs: this.tabs.map((tab) => ({
|
|
1994
|
-
tabHeading: tab.tabHeading,
|
|
1995
|
-
tabIndex: tab.tabIndex,
|
|
1996
|
-
})),
|
|
1997
|
-
});
|
|
2177
|
+
return undefined;
|
|
1998
2178
|
}
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
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);
|
|
2012
2219
|
}
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
.
|
|
2020
|
-
|
|
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);
|
|
2021
2232
|
});
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
const activeIndex = this.getActiveTabIndexByPermalinkId();
|
|
2025
|
-
this.tabsetService.setActiveTabIndex(activeIndex);
|
|
2026
|
-
}
|
|
2027
|
-
getActiveTabIndexByPermalinkId() {
|
|
2028
|
-
var _a;
|
|
2029
|
-
if (this.permalinkId) {
|
|
2030
|
-
const paramValue = this.permalinkService.getParam(this.permalinkId);
|
|
2031
|
-
if (paramValue) {
|
|
2032
|
-
return (_a = this.tabs.find((tab) => tab.permalinkValue === paramValue)) === null || _a === void 0 ? void 0 : _a.tabIndex;
|
|
2033
|
-
}
|
|
2233
|
+
if (activeTabComponent) {
|
|
2234
|
+
__classPrivateFieldGet(this, _SkyTabsetComponent_permalinkService, "f").setParam(this.permalinkId, activeTabComponent.permalinkValueOrDefault);
|
|
2034
2235
|
}
|
|
2035
2236
|
}
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
closeable: tab.closeable,
|
|
2046
|
-
ariaControls: tab.tabPanelId,
|
|
2047
|
-
disabled: tab.disabled,
|
|
2048
|
-
buttonHref: tab.disabled
|
|
2049
|
-
? null
|
|
2050
|
-
: this.permalinkService.getParamHref(this.permalinkId, tab.permalinkValue),
|
|
2051
|
-
buttonId: tab.tabButtonId,
|
|
2052
|
-
buttonTextCount: tab.tabHeaderCount,
|
|
2053
|
-
buttonText: tab.tabHeading,
|
|
2054
|
-
tabIndex: tab.tabIndex,
|
|
2055
|
-
}));
|
|
2056
|
-
}
|
|
2057
|
-
updateTabButtons(activeIndex) {
|
|
2058
|
-
this.tabButtons.forEach((button) => {
|
|
2059
|
-
button.active = this.tabsetService.tabIndexesEqual(button.tabIndex, activeIndex);
|
|
2060
|
-
});
|
|
2061
|
-
}
|
|
2062
|
-
/**
|
|
2063
|
-
* Updates the UI and state of the tabset component after the tab index or
|
|
2064
|
-
* tab components have changed.
|
|
2065
|
-
* @param activeIndex The currently active tab index.
|
|
2066
|
-
* @param regenerateTabButtons Indicates if tab button view models should be regenerated.
|
|
2067
|
-
* Setting this value to `false` will simply update the existing tab buttons. Setting this value
|
|
2068
|
-
* to `true` is only necessary when the underlying tab components have changed and the tab
|
|
2069
|
-
* buttons must reflect those changes.
|
|
2070
|
-
*/
|
|
2071
|
-
updateTabsetComponent(activeIndex, regenerateTabButtons = false) {
|
|
2072
|
-
var _a;
|
|
2073
|
-
// Activate/deactivate tab components.
|
|
2074
|
-
this.tabs.forEach((tab) => {
|
|
2075
|
-
this.tabsetService.tabIndexesEqual(tab.tabIndex, activeIndex)
|
|
2076
|
-
? tab.activate()
|
|
2077
|
-
: tab.deactivate();
|
|
2078
|
-
});
|
|
2079
|
-
// Update the tab button models.
|
|
2080
|
-
if (regenerateTabButtons || !this.tabButtons.length) {
|
|
2081
|
-
this.tabButtons = this.createTabButtons(activeIndex);
|
|
2082
|
-
}
|
|
2083
|
-
else {
|
|
2084
|
-
this.updateTabButtons(activeIndex);
|
|
2085
|
-
}
|
|
2086
|
-
// Update the dropdown trigger button text.
|
|
2087
|
-
this.dropdownTriggerButtonText = (_a = this.tabButtons.find((b) => {
|
|
2088
|
-
return this.tabsetService.tabIndexesEqual(b.tabIndex, activeIndex);
|
|
2089
|
-
})) === null || _a === void 0 ? void 0 : _a.buttonText;
|
|
2090
|
-
// Set the query params based on active tab.
|
|
2091
|
-
if (this.permalinkId) {
|
|
2092
|
-
const activeTabComponent = this.tabs.find((tab) => {
|
|
2093
|
-
return this.tabsetService.tabIndexesEqual(tab.tabIndex, activeIndex);
|
|
2094
|
-
});
|
|
2095
|
-
this.permalinkService.setParam(this.permalinkId, activeTabComponent.permalinkValue);
|
|
2096
|
-
}
|
|
2097
|
-
// Wait for tab button view models to render before gauging dimensions.
|
|
2098
|
-
setTimeout(() => {
|
|
2099
|
-
this.adapterService.detectOverflow();
|
|
2100
|
-
});
|
|
2101
|
-
this.changeDetector.markForCheck();
|
|
2102
|
-
// Emit the new active index value to consumers.
|
|
2103
|
-
if (this.lastActiveTabIndex !== activeIndex) {
|
|
2104
|
-
this.lastActiveTabIndex = activeIndex;
|
|
2105
|
-
this.activeChange.emit(activeIndex);
|
|
2106
|
-
}
|
|
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);
|
|
2107
2246
|
}
|
|
2108
|
-
}
|
|
2109
|
-
_SkyTabsetComponent__hasFinishButton = new WeakMap();
|
|
2247
|
+
};
|
|
2110
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 });
|
|
2111
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: [
|
|
2112
2250
|
SkyTabsetAdapterService,
|
|
2113
2251
|
SkyTabsetPermalinkService,
|
|
2114
2252
|
SkyTabsetService,
|
|
2115
|
-
], queries: [{ propertyName: "tabs", predicate: SkyTabComponent }], ngImport: i0, template: "<div\n class=\"sky-tabset\"\n
|
|
2253
|
+
], queries: [{ propertyName: "tabs", predicate: SkyTabComponent }], ngImport: i0, template: "<div\n class=\"sky-tabset\"\n role=\"tablist\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledBy\"\n [ngClass]=\"\n 'sky-tabset-mode-' + tabDisplayMode + ' sky-tabset-style-' + tabStyle\n \"\n (window:resize)=\"onWindowResize()\"\n (keydown.arrowright)=\"onRightKeyDown()\"\n (keydown.arrowleft)=\"onLeftKeyDown()\"\n (keydown.home)=\"onHomeKeyDown()\"\n (keydown.end)=\"onEndKeyDown()\"\n>\n <span class=\"sky-tabset-dropdown\">\n <sky-dropdown *ngIf=\"tabDisplayMode === 'dropdown'\" buttonType=\"tab\">\n <sky-dropdown-button>\n {{ dropdownTriggerButtonText }}\n </sky-dropdown-button>\n <sky-dropdown-menu>\n <sky-dropdown-item\n *ngFor=\"let tabButton of tabButtons\"\n class=\"sky-tab-dropdown-menu-item\"\n >\n <div\n class=\"sky-tab-dropdown-item\"\n [ngClass]=\"{\n 'sky-tab-dropdown-item-selected': tabButton.active\n }\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n tabButtonTemplate;\n context: {\n $implicit: tabButton\n }\n \"\n ></ng-container>\n </div>\n </sky-dropdown-item>\n </sky-dropdown-menu>\n </sky-dropdown>\n </span>\n <span class=\"sky-tabset-tabs\">\n <ng-container *ngFor=\"let tabButton of tabButtons\">\n <ng-container\n *ngTemplateOutlet=\"\n tabButtonTemplate;\n context: {\n $implicit: tabButton\n }\n \"\n ></ng-container>\n </ng-container>\n </span>\n <span class=\"sky-tabset-btns\">\n <button\n *ngIf=\"newTab.observers.length > 0\"\n class=\"sky-btn sky-btn-icon sky-tabset-btn-new sky-margin-inline-compact\"\n type=\"button\"\n [attr.aria-label]=\"'skyux_tab_add' | skyLibResources\"\n [skyThemeClass]=\"{\n 'sky-margin-inline-sm': 'modern'\n }\"\n (click)=\"onNewTabClick()\"\n >\n <sky-icon icon=\"plus-circle\" size=\"lg\"> </sky-icon>\n </button>\n <button\n *ngIf=\"openTab.observers.length > 0\"\n class=\"sky-btn sky-btn-icon sky-tabset-btn-open sky-margin-inline-compact\"\n type=\"button\"\n [attr.aria-label]=\"'skyux_tab_open' | skyLibResources\"\n [skyThemeClass]=\"{\n 'sky-margin-inline-sm': 'modern'\n }\"\n (click)=\"onOpenTabClick()\"\n >\n <sky-icon icon=\"folder-open-o\" size=\"lg\"> </sky-icon>\n </button>\n </span>\n</div>\n<ng-content></ng-content>\n\n<ng-template let-tabButton #tabButtonTemplate>\n <sky-tab-button\n [active]=\"tabButton.active\"\n [ariaControls]=\"tabButton.ariaControls\"\n [buttonHref]=\"tabButton.buttonHref\"\n [buttonId]=\"tabButton.buttonId\"\n [buttonText]=\"tabButton.buttonText\"\n [buttonTextCount]=\"tabButton.buttonTextCount\"\n [closeable]=\"tabButton.closeable\"\n [disabled]=\"tabButton.disabled\"\n [tabIndex]=\"tabButton.tabIndex\"\n [tabStyle]=\"tabStyle\"\n [tabNumber]=\"tabButton.tabNumber\"\n [totalTabsCount]=\"tabButton.totalTabsCount\"\n (buttonClick)=\"onTabButtonClick(tabButton)\"\n (closeClick)=\"onTabCloseClick(tabButton)\"\n ></sky-tab-button>\n</ng-template>\n", styles: [".sky-tabset{align-items:center;border-bottom:2px solid #0974a1;display:flex;list-style-type:none;margin:0;overflow:hidden;padding:0 0 0 15px;white-space:nowrap}.sky-tabset.sky-tabset-style-wizard{border-bottom:none;margin-bottom:10px;padding-left:0}.sky-tabset-btns{order:1;padding-left:10px}.sky-tabset-dropdown{order:0;max-width:100%}.sky-tabset-mode-dropdown{line-height:0}.sky-tabset-mode-dropdown .sky-tabset-tabs{visibility:hidden;order:2}.sky-tab-dropdown-menu-item sky-tab-button{display:flex;min-width:300px}.sky-tab-dropdown-menu-item .sky-dropdown-item{margin:0}.sky-tab-dropdown-menu-item .sky-btn-tab-wrapper{width:100%;margin-right:0}.sky-tab-dropdown-menu-item .sky-btn-tab{margin:0;border-radius:0;width:100%;display:flex}.sky-tab-dropdown-menu-item .sky-btn-tab>.sky-tab-heading{flex:1 1 auto}.sky-tab-dropdown-menu-item .sky-btn-tab>.sky-btn-tab-close{flex:0 1 auto}.sky-tabset-tabs{order:0;white-space:nowrap}.sky-tabset-btn-new,.sky-tabset-btn-open{color:#0974a1}.sky-theme-modern .sky-modal-content .sky-tabset{margin:-10px -30px 30px;padding-left:30px;padding-right:30px}.sky-theme-modern .sky-tabset{border-bottom:1px solid #d2d2d2;overflow:visible}.sky-theme-modern .sky-tab-dropdown-menu-item .sky-btn-tab-wrapper{margin-right:0}\n"], dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i5$1.λ2, selector: "sky-dropdown-button" }, { kind: "component", type: i5$1.λ3, selector: "sky-dropdown", inputs: ["buttonStyle", "buttonType", "disabled", "dismissOnBlur", "label", "horizontalAlignment", "messageStream", "title", "trigger"] }, { kind: "component", type: i5$1.λ1, selector: "sky-dropdown-item", inputs: ["ariaRole"] }, { kind: "component", type: i5$1.λ4, selector: "sky-dropdown-menu", inputs: ["ariaLabelledBy", "ariaRole", "useNativeFocus"], outputs: ["menuChanges"] }, { kind: "component", type: i5.λ4, selector: "sky-icon", inputs: ["icon", "iconType", "size", "fixedWidth", "variant"] }, { kind: "directive", type: i7.λ2, selector: "[skyThemeClass]", inputs: ["class", "skyThemeClass"] }, { kind: "component", type: SkyTabButtonComponent, selector: "sky-tab-button", inputs: ["active", "ariaControls", "buttonHref", "buttonId", "buttonText", "buttonTextCount", "closeable", "disabled", "tabIndex", "tabNumber", "totalTabsCount", "tabStyle"], outputs: ["buttonClick", "closeClick"] }, { kind: "pipe", type: i3.SkyLibResourcesPipe, name: "skyLibResources" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
2116
2254
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyTabsetComponent, decorators: [{
|
|
2117
2255
|
type: Component,
|
|
2118
2256
|
args: [{ selector: 'sky-tabset', providers: [
|
|
2119
2257
|
SkyTabsetAdapterService,
|
|
2120
2258
|
SkyTabsetPermalinkService,
|
|
2121
2259
|
SkyTabsetService,
|
|
2122
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div\n class=\"sky-tabset\"\n
|
|
2260
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div\n class=\"sky-tabset\"\n role=\"tablist\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledBy\"\n [ngClass]=\"\n 'sky-tabset-mode-' + tabDisplayMode + ' sky-tabset-style-' + tabStyle\n \"\n (window:resize)=\"onWindowResize()\"\n (keydown.arrowright)=\"onRightKeyDown()\"\n (keydown.arrowleft)=\"onLeftKeyDown()\"\n (keydown.home)=\"onHomeKeyDown()\"\n (keydown.end)=\"onEndKeyDown()\"\n>\n <span class=\"sky-tabset-dropdown\">\n <sky-dropdown *ngIf=\"tabDisplayMode === 'dropdown'\" buttonType=\"tab\">\n <sky-dropdown-button>\n {{ dropdownTriggerButtonText }}\n </sky-dropdown-button>\n <sky-dropdown-menu>\n <sky-dropdown-item\n *ngFor=\"let tabButton of tabButtons\"\n class=\"sky-tab-dropdown-menu-item\"\n >\n <div\n class=\"sky-tab-dropdown-item\"\n [ngClass]=\"{\n 'sky-tab-dropdown-item-selected': tabButton.active\n }\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n tabButtonTemplate;\n context: {\n $implicit: tabButton\n }\n \"\n ></ng-container>\n </div>\n </sky-dropdown-item>\n </sky-dropdown-menu>\n </sky-dropdown>\n </span>\n <span class=\"sky-tabset-tabs\">\n <ng-container *ngFor=\"let tabButton of tabButtons\">\n <ng-container\n *ngTemplateOutlet=\"\n tabButtonTemplate;\n context: {\n $implicit: tabButton\n }\n \"\n ></ng-container>\n </ng-container>\n </span>\n <span class=\"sky-tabset-btns\">\n <button\n *ngIf=\"newTab.observers.length > 0\"\n class=\"sky-btn sky-btn-icon sky-tabset-btn-new sky-margin-inline-compact\"\n type=\"button\"\n [attr.aria-label]=\"'skyux_tab_add' | skyLibResources\"\n [skyThemeClass]=\"{\n 'sky-margin-inline-sm': 'modern'\n }\"\n (click)=\"onNewTabClick()\"\n >\n <sky-icon icon=\"plus-circle\" size=\"lg\"> </sky-icon>\n </button>\n <button\n *ngIf=\"openTab.observers.length > 0\"\n class=\"sky-btn sky-btn-icon sky-tabset-btn-open sky-margin-inline-compact\"\n type=\"button\"\n [attr.aria-label]=\"'skyux_tab_open' | skyLibResources\"\n [skyThemeClass]=\"{\n 'sky-margin-inline-sm': 'modern'\n }\"\n (click)=\"onOpenTabClick()\"\n >\n <sky-icon icon=\"folder-open-o\" size=\"lg\"> </sky-icon>\n </button>\n </span>\n</div>\n<ng-content></ng-content>\n\n<ng-template let-tabButton #tabButtonTemplate>\n <sky-tab-button\n [active]=\"tabButton.active\"\n [ariaControls]=\"tabButton.ariaControls\"\n [buttonHref]=\"tabButton.buttonHref\"\n [buttonId]=\"tabButton.buttonId\"\n [buttonText]=\"tabButton.buttonText\"\n [buttonTextCount]=\"tabButton.buttonTextCount\"\n [closeable]=\"tabButton.closeable\"\n [disabled]=\"tabButton.disabled\"\n [tabIndex]=\"tabButton.tabIndex\"\n [tabStyle]=\"tabStyle\"\n [tabNumber]=\"tabButton.tabNumber\"\n [totalTabsCount]=\"tabButton.totalTabsCount\"\n (buttonClick)=\"onTabButtonClick(tabButton)\"\n (closeClick)=\"onTabCloseClick(tabButton)\"\n ></sky-tab-button>\n</ng-template>\n", styles: [".sky-tabset{align-items:center;border-bottom:2px solid #0974a1;display:flex;list-style-type:none;margin:0;overflow:hidden;padding:0 0 0 15px;white-space:nowrap}.sky-tabset.sky-tabset-style-wizard{border-bottom:none;margin-bottom:10px;padding-left:0}.sky-tabset-btns{order:1;padding-left:10px}.sky-tabset-dropdown{order:0;max-width:100%}.sky-tabset-mode-dropdown{line-height:0}.sky-tabset-mode-dropdown .sky-tabset-tabs{visibility:hidden;order:2}.sky-tab-dropdown-menu-item sky-tab-button{display:flex;min-width:300px}.sky-tab-dropdown-menu-item .sky-dropdown-item{margin:0}.sky-tab-dropdown-menu-item .sky-btn-tab-wrapper{width:100%;margin-right:0}.sky-tab-dropdown-menu-item .sky-btn-tab{margin:0;border-radius:0;width:100%;display:flex}.sky-tab-dropdown-menu-item .sky-btn-tab>.sky-tab-heading{flex:1 1 auto}.sky-tab-dropdown-menu-item .sky-btn-tab>.sky-btn-tab-close{flex:0 1 auto}.sky-tabset-tabs{order:0;white-space:nowrap}.sky-tabset-btn-new,.sky-tabset-btn-open{color:#0974a1}.sky-theme-modern .sky-modal-content .sky-tabset{margin:-10px -30px 30px;padding-left:30px;padding-right:30px}.sky-theme-modern .sky-tabset{border-bottom:1px solid #d2d2d2;overflow:visible}.sky-theme-modern .sky-tab-dropdown-menu-item .sky-btn-tab-wrapper{margin-right:0}\n"] }]
|
|
2123
2261
|
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: SkyTabsetAdapterService }, { type: SkyTabsetPermalinkService }, { type: SkyTabsetService }]; }, propDecorators: { active: [{
|
|
2124
2262
|
type: Input
|
|
2125
2263
|
}], ariaLabel: [{
|
|
@@ -2149,7 +2287,8 @@ SkyTabsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
|
2149
2287
|
SkyTabsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.0", ngImport: i0, type: SkyTabsModule, declarations: [SkyTabButtonComponent,
|
|
2150
2288
|
SkyTabComponent,
|
|
2151
2289
|
SkyTabsetComponent,
|
|
2152
|
-
SkyTabsetNavButtonComponent
|
|
2290
|
+
SkyTabsetNavButtonComponent,
|
|
2291
|
+
SkyTabsetNavButtonDisabledPipe], imports: [CommonModule,
|
|
2153
2292
|
RouterModule,
|
|
2154
2293
|
SkyDropdownModule,
|
|
2155
2294
|
SkyI18nModule,
|
|
@@ -2171,6 +2310,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
|
|
|
2171
2310
|
SkyTabComponent,
|
|
2172
2311
|
SkyTabsetComponent,
|
|
2173
2312
|
SkyTabsetNavButtonComponent,
|
|
2313
|
+
SkyTabsetNavButtonDisabledPipe,
|
|
2174
2314
|
],
|
|
2175
2315
|
imports: [
|
|
2176
2316
|
CommonModule,
|