@skyux/tabs 7.0.0-beta.0 → 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 +1118 -836
- 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-adapter.service.mjs +16 -0
- package/esm2020/lib/modules/tabs/tab-button-view-model.mjs +2 -0
- package/esm2020/lib/modules/tabs/tab-button.component.mjs +103 -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 +227 -219
- package/esm2020/lib/modules/tabs/tabset.service.mjs +104 -26
- 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 +947 -668
- 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 +1075 -800
- 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-adapter.service.d.ts +10 -0
- package/lib/modules/tabs/tab-button-view-model.d.ts +17 -0
- package/lib/modules/tabs/tab-button.component.d.ts +30 -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 +14 -70
- package/lib/modules/tabs/tabset.service.d.ts +16 -9
- 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', [
|
|
@@ -1000,10 +1024,264 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
|
|
|
1000
1024
|
/**
|
|
1001
1025
|
* @internal
|
|
1002
1026
|
*/
|
|
1003
|
-
class
|
|
1027
|
+
class SkyTabButtonAdapterService {
|
|
1028
|
+
focusButtonLink(buttonEl) {
|
|
1029
|
+
buttonEl.nativeElement.querySelector('a').focus();
|
|
1030
|
+
}
|
|
1031
|
+
}
|
|
1032
|
+
SkyTabButtonAdapterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyTabButtonAdapterService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1033
|
+
SkyTabButtonAdapterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyTabButtonAdapterService });
|
|
1034
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyTabButtonAdapterService, decorators: [{
|
|
1035
|
+
type: Injectable
|
|
1036
|
+
}] });
|
|
1037
|
+
|
|
1038
|
+
var _SkyTabsetService_instances, _SkyTabsetService_activeTabIndex, _SkyTabsetService_focusedTabBtnIndex, _SkyTabsetService_activeTabUnregistered, _SkyTabsetService_tabs, _SkyTabsetService_tabCounter, _SkyTabsetService_isTabIndexActive, _SkyTabsetService_getNextTabArrayIndex, _SkyTabsetService_getPrevTabArrayIndex;
|
|
1039
|
+
/**
|
|
1040
|
+
* @internal
|
|
1041
|
+
*/
|
|
1042
|
+
class SkyTabsetService {
|
|
1004
1043
|
constructor() {
|
|
1044
|
+
_SkyTabsetService_instances.add(this);
|
|
1045
|
+
this.currentActiveTabIndex = 0;
|
|
1046
|
+
this.currentFocusedTabBtnIndex = 0;
|
|
1047
|
+
_SkyTabsetService_activeTabIndex.set(this, void 0);
|
|
1048
|
+
_SkyTabsetService_focusedTabBtnIndex.set(this, void 0);
|
|
1049
|
+
_SkyTabsetService_activeTabUnregistered.set(this, void 0);
|
|
1050
|
+
_SkyTabsetService_tabs.set(this, []);
|
|
1051
|
+
_SkyTabsetService_tabCounter.set(this, 0);
|
|
1052
|
+
__classPrivateFieldSet(this, _SkyTabsetService_activeTabIndex, new BehaviorSubject(0), "f");
|
|
1053
|
+
__classPrivateFieldSet(this, _SkyTabsetService_activeTabUnregistered, new Subject(), "f");
|
|
1054
|
+
__classPrivateFieldSet(this, _SkyTabsetService_focusedTabBtnIndex, new Subject(), "f");
|
|
1055
|
+
}
|
|
1056
|
+
get activeTabUnregistered() {
|
|
1057
|
+
return __classPrivateFieldGet(this, _SkyTabsetService_activeTabUnregistered, "f");
|
|
1058
|
+
}
|
|
1059
|
+
get activeTabIndex() {
|
|
1060
|
+
return __classPrivateFieldGet(this, _SkyTabsetService_activeTabIndex, "f");
|
|
1061
|
+
}
|
|
1062
|
+
get focusedTabBtnIndex() {
|
|
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();
|
|
1069
|
+
}
|
|
1070
|
+
/**
|
|
1071
|
+
* Sets the active tab by its unique `tabIndex` property.
|
|
1072
|
+
*/
|
|
1073
|
+
setActiveTabIndex(value, config = {
|
|
1074
|
+
emitChange: true,
|
|
1075
|
+
}) {
|
|
1076
|
+
if (value !== undefined &&
|
|
1077
|
+
!this.tabIndexesEqual(value, this.currentActiveTabIndex)) {
|
|
1078
|
+
this.currentActiveTabIndex = value;
|
|
1079
|
+
/* istanbul ignore else */
|
|
1080
|
+
if (config.emitChange) {
|
|
1081
|
+
__classPrivateFieldGet(this, _SkyTabsetService_activeTabIndex, "f").next(value);
|
|
1082
|
+
}
|
|
1083
|
+
this.setFocusedTabBtnIndex(value);
|
|
1084
|
+
}
|
|
1085
|
+
}
|
|
1086
|
+
focusNextTabBtn(tabButtons) {
|
|
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)) {
|
|
1089
|
+
const tabBtn = tabButtons[i];
|
|
1090
|
+
if (!tabBtn.disabled && tabBtn.tabIndex !== undefined) {
|
|
1091
|
+
this.setFocusedTabBtnIndex(tabBtn.tabIndex);
|
|
1092
|
+
return;
|
|
1093
|
+
}
|
|
1094
|
+
}
|
|
1095
|
+
}
|
|
1096
|
+
focusPrevTabBtn(tabButtons) {
|
|
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)) {
|
|
1099
|
+
const tabBtn = tabButtons[i];
|
|
1100
|
+
if (!tabBtn.disabled && tabBtn.tabIndex !== undefined) {
|
|
1101
|
+
this.setFocusedTabBtnIndex(tabBtn.tabIndex);
|
|
1102
|
+
return;
|
|
1103
|
+
}
|
|
1104
|
+
}
|
|
1105
|
+
}
|
|
1106
|
+
focusFirstOrNearestTabBtn(tabButtons) {
|
|
1107
|
+
for (let i = 0; i < tabButtons.length; i++) {
|
|
1108
|
+
const tabBtn = tabButtons[i];
|
|
1109
|
+
if (!tabBtn.disabled && tabBtn.tabIndex !== undefined) {
|
|
1110
|
+
this.setFocusedTabBtnIndex(tabBtn.tabIndex);
|
|
1111
|
+
return;
|
|
1112
|
+
}
|
|
1113
|
+
}
|
|
1114
|
+
}
|
|
1115
|
+
focusLastOrNearestTabBtn(tabButtons) {
|
|
1116
|
+
for (let i = tabButtons.length - 1; i >= 0; i--) {
|
|
1117
|
+
const tabBtn = tabButtons[i];
|
|
1118
|
+
if (!tabBtn.disabled && tabBtn.tabIndex !== undefined) {
|
|
1119
|
+
this.setFocusedTabBtnIndex(tabBtn.tabIndex);
|
|
1120
|
+
return;
|
|
1121
|
+
}
|
|
1122
|
+
}
|
|
1123
|
+
}
|
|
1124
|
+
setFocusedTabBtnIndex(tabIndex) {
|
|
1125
|
+
this.currentFocusedTabBtnIndex = tabIndex;
|
|
1126
|
+
__classPrivateFieldGet(this, _SkyTabsetService_focusedTabBtnIndex, "f").next(tabIndex);
|
|
1127
|
+
}
|
|
1128
|
+
/**
|
|
1129
|
+
* Registers a tab component.
|
|
1130
|
+
*/
|
|
1131
|
+
registerTab(tabIndex) {
|
|
1132
|
+
var _a;
|
|
1133
|
+
if (tabIndex === undefined) {
|
|
1134
|
+
tabIndex = __classPrivateFieldGet(this, _SkyTabsetService_tabCounter, "f");
|
|
1135
|
+
__classPrivateFieldSet(this, _SkyTabsetService_tabCounter, (_a = __classPrivateFieldGet(this, _SkyTabsetService_tabCounter, "f"), _a++, _a), "f");
|
|
1136
|
+
}
|
|
1137
|
+
__classPrivateFieldGet(this, _SkyTabsetService_tabs, "f").push({ tabIndex });
|
|
1138
|
+
return tabIndex;
|
|
1139
|
+
}
|
|
1140
|
+
updateTabIndex(currentTabIndex, newTabIndex) {
|
|
1141
|
+
const found = __classPrivateFieldGet(this, _SkyTabsetService_tabs, "f").find((tab) => this.tabIndexesEqual(tab.tabIndex, currentTabIndex));
|
|
1142
|
+
if (found) {
|
|
1143
|
+
found.tabIndex = newTabIndex;
|
|
1144
|
+
}
|
|
1145
|
+
}
|
|
1146
|
+
/**
|
|
1147
|
+
* Unregisters a tab component.
|
|
1148
|
+
*/
|
|
1149
|
+
unregisterTab(tabIndex) {
|
|
1150
|
+
var _b;
|
|
1151
|
+
const index = __classPrivateFieldGet(this, _SkyTabsetService_tabs, "f").findIndex((tab) => this.tabIndexesEqual(tab.tabIndex, tabIndex));
|
|
1152
|
+
// Notify the tabset component when an active tab is unregistered.
|
|
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({
|
|
1155
|
+
arrayIndex: index,
|
|
1156
|
+
});
|
|
1157
|
+
}
|
|
1158
|
+
__classPrivateFieldGet(this, _SkyTabsetService_tabs, "f").splice(index, 1);
|
|
1159
|
+
}
|
|
1160
|
+
/**
|
|
1161
|
+
* Unregisters all tab components at once.
|
|
1162
|
+
*/
|
|
1163
|
+
unregisterAll() {
|
|
1164
|
+
__classPrivateFieldSet(this, _SkyTabsetService_tabs, [], "f");
|
|
1165
|
+
}
|
|
1166
|
+
/**
|
|
1167
|
+
* Compares two tab indexes and returns `true` if they are equal.
|
|
1168
|
+
*/
|
|
1169
|
+
tabIndexesEqual(tabIndex1, tabIndex2) {
|
|
1170
|
+
return (tabIndex1 === tabIndex2 ||
|
|
1171
|
+
(tabIndex1 !== undefined &&
|
|
1172
|
+
tabIndex2 !== undefined &&
|
|
1173
|
+
+tabIndex1 === +tabIndex2));
|
|
1174
|
+
}
|
|
1175
|
+
/**
|
|
1176
|
+
* Verifies if a provided tab index is registered.
|
|
1177
|
+
*/
|
|
1178
|
+
isValidTabIndex(tabIndex) {
|
|
1179
|
+
return __classPrivateFieldGet(this, _SkyTabsetService_tabs, "f").some((tab) => this.tabIndexesEqual(tab.tabIndex, tabIndex));
|
|
1180
|
+
}
|
|
1181
|
+
/**
|
|
1182
|
+
* Activates the first registered tab.
|
|
1183
|
+
*/
|
|
1184
|
+
activateFirstTab() {
|
|
1185
|
+
const firstTabIndex = __classPrivateFieldGet(this, _SkyTabsetService_tabs, "f")[0] && __classPrivateFieldGet(this, _SkyTabsetService_tabs, "f")[0].tabIndex;
|
|
1186
|
+
if (firstTabIndex !== undefined) {
|
|
1187
|
+
this.setActiveTabIndex(firstTabIndex);
|
|
1188
|
+
return firstTabIndex;
|
|
1189
|
+
}
|
|
1190
|
+
return undefined;
|
|
1191
|
+
}
|
|
1192
|
+
/**
|
|
1193
|
+
* Activates the next registered tab, or the previous one based on a provided array index.
|
|
1194
|
+
*/
|
|
1195
|
+
activateNearestTab(arrayIndex) {
|
|
1196
|
+
const newActiveTab = __classPrivateFieldGet(this, _SkyTabsetService_tabs, "f")[arrayIndex] || __classPrivateFieldGet(this, _SkyTabsetService_tabs, "f")[arrayIndex - 1];
|
|
1197
|
+
if (newActiveTab) {
|
|
1198
|
+
this.currentActiveTabIndex = newActiveTab.tabIndex;
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
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
|
+
};
|
|
1217
|
+
SkyTabsetService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyTabsetService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1218
|
+
SkyTabsetService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyTabsetService });
|
|
1219
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyTabsetService, decorators: [{
|
|
1220
|
+
type: Injectable
|
|
1221
|
+
}], ctorParameters: function () { return []; } });
|
|
1222
|
+
|
|
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;
|
|
1225
|
+
/**
|
|
1226
|
+
* @internal
|
|
1227
|
+
*/
|
|
1228
|
+
class SkyTabButtonComponent {
|
|
1229
|
+
constructor(elementRef, adapterService, changeDetectorRef, tabsetService) {
|
|
1230
|
+
_SkyTabButtonComponent_instances.add(this);
|
|
1005
1231
|
this.buttonClick = new EventEmitter();
|
|
1006
1232
|
this.closeClick = new EventEmitter();
|
|
1233
|
+
this.closeBtnTabIndex = '-1';
|
|
1234
|
+
_SkyTabButtonComponent__isActive.set(this, false);
|
|
1235
|
+
_SkyTabButtonComponent__isDisabled.set(this, DEFAULT_DISABLED);
|
|
1236
|
+
_SkyTabButtonComponent__tabStyle.set(this, void 0);
|
|
1237
|
+
_SkyTabButtonComponent_adapterService.set(this, void 0);
|
|
1238
|
+
_SkyTabButtonComponent_changeDetectorRef.set(this, void 0);
|
|
1239
|
+
_SkyTabButtonComponent_elementRef.set(this, void 0);
|
|
1240
|
+
_SkyTabButtonComponent_tabsetService.set(this, void 0);
|
|
1241
|
+
_SkyTabButtonComponent_ngUnsubscribe.set(this, new Subject());
|
|
1242
|
+
__classPrivateFieldSet(this, _SkyTabButtonComponent_adapterService, adapterService, "f");
|
|
1243
|
+
__classPrivateFieldSet(this, _SkyTabButtonComponent_changeDetectorRef, changeDetectorRef, "f");
|
|
1244
|
+
__classPrivateFieldSet(this, _SkyTabButtonComponent_elementRef, elementRef, "f");
|
|
1245
|
+
__classPrivateFieldSet(this, _SkyTabButtonComponent_tabsetService, tabsetService, "f");
|
|
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
|
+
}
|
|
1261
|
+
get tabStyle() {
|
|
1262
|
+
return __classPrivateFieldGet(this, _SkyTabButtonComponent__tabStyle, "f");
|
|
1263
|
+
}
|
|
1264
|
+
set tabStyle(style) {
|
|
1265
|
+
__classPrivateFieldSet(this, _SkyTabButtonComponent__tabStyle, style, "f");
|
|
1266
|
+
__classPrivateFieldGet(this, _SkyTabButtonComponent_instances, "m", _SkyTabButtonComponent_updateWizardStepState).call(this);
|
|
1267
|
+
}
|
|
1268
|
+
ngAfterViewInit() {
|
|
1269
|
+
__classPrivateFieldGet(this, _SkyTabButtonComponent_tabsetService, "f").focusedTabBtnIndex
|
|
1270
|
+
.pipe(distinctUntilChanged(), takeUntil(__classPrivateFieldGet(this, _SkyTabButtonComponent_ngUnsubscribe, "f")))
|
|
1271
|
+
.subscribe((focusedIndex) => {
|
|
1272
|
+
if (this.tabIndex !== undefined && focusedIndex === this.tabIndex) {
|
|
1273
|
+
this.closeBtnTabIndex = '0';
|
|
1274
|
+
this.focusBtn();
|
|
1275
|
+
}
|
|
1276
|
+
else {
|
|
1277
|
+
this.closeBtnTabIndex = '-1';
|
|
1278
|
+
}
|
|
1279
|
+
__classPrivateFieldGet(this, _SkyTabButtonComponent_changeDetectorRef, "f").markForCheck();
|
|
1280
|
+
});
|
|
1281
|
+
}
|
|
1282
|
+
ngOnDestroy() {
|
|
1283
|
+
__classPrivateFieldGet(this, _SkyTabButtonComponent_ngUnsubscribe, "f").next();
|
|
1284
|
+
__classPrivateFieldGet(this, _SkyTabButtonComponent_ngUnsubscribe, "f").complete();
|
|
1007
1285
|
}
|
|
1008
1286
|
onButtonClick(event) {
|
|
1009
1287
|
if (!this.disabled) {
|
|
@@ -1032,13 +1310,38 @@ class SkyTabButtonComponent {
|
|
|
1032
1310
|
event.stopPropagation();
|
|
1033
1311
|
event.preventDefault();
|
|
1034
1312
|
}
|
|
1313
|
+
focusBtn() {
|
|
1314
|
+
__classPrivateFieldGet(this, _SkyTabButtonComponent_adapterService, "f").focusButtonLink(__classPrivateFieldGet(this, _SkyTabButtonComponent_elementRef, "f"));
|
|
1315
|
+
}
|
|
1316
|
+
onFocus() {
|
|
1317
|
+
if (this.tabIndex !== undefined) {
|
|
1318
|
+
__classPrivateFieldGet(this, _SkyTabButtonComponent_tabsetService, "f").setFocusedTabBtnIndex(this.tabIndex);
|
|
1319
|
+
}
|
|
1320
|
+
}
|
|
1035
1321
|
}
|
|
1036
|
-
|
|
1037
|
-
|
|
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
|
+
};
|
|
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 });
|
|
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 });
|
|
1038
1341
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyTabButtonComponent, decorators: [{
|
|
1039
1342
|
type: Component,
|
|
1040
|
-
args: [{ selector: 'sky-tab-button', 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 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 [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]=\"
|
|
1041
|
-
}], propDecorators: { active: [{
|
|
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"] }]
|
|
1344
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: SkyTabButtonAdapterService }, { type: i0.ChangeDetectorRef }, { type: SkyTabsetService }]; }, propDecorators: { active: [{
|
|
1042
1345
|
type: Input
|
|
1043
1346
|
}], ariaControls: [{
|
|
1044
1347
|
type: Input
|
|
@@ -1054,6 +1357,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
|
|
|
1054
1357
|
type: Input
|
|
1055
1358
|
}], disabled: [{
|
|
1056
1359
|
type: Input
|
|
1360
|
+
}], tabIndex: [{
|
|
1361
|
+
type: Input
|
|
1362
|
+
}], tabNumber: [{
|
|
1363
|
+
type: Input
|
|
1364
|
+
}], totalTabsCount: [{
|
|
1365
|
+
type: Input
|
|
1057
1366
|
}], tabStyle: [{
|
|
1058
1367
|
type: Input
|
|
1059
1368
|
}], buttonClick: [{
|
|
@@ -1062,40 +1371,48 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
|
|
|
1062
1371
|
type: Output
|
|
1063
1372
|
}] } });
|
|
1064
1373
|
|
|
1374
|
+
var _SkyTabsetPermalinkService_instances, _SkyTabsetPermalinkService_popStateChange, _SkyTabsetPermalinkService_subscription, _SkyTabsetPermalinkService_activatedRoute, _SkyTabsetPermalinkService_location, _SkyTabsetPermalinkService_router, _SkyTabsetPermalinkService_getParams;
|
|
1065
1375
|
/**
|
|
1066
1376
|
* @internal
|
|
1067
1377
|
*/
|
|
1068
1378
|
class SkyTabsetPermalinkService {
|
|
1069
1379
|
constructor(activatedRoute, location, router) {
|
|
1070
|
-
this
|
|
1071
|
-
this
|
|
1072
|
-
this
|
|
1073
|
-
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");
|
|
1074
1390
|
}
|
|
1075
1391
|
get popStateChange() {
|
|
1076
|
-
return this
|
|
1392
|
+
return __classPrivateFieldGet(this, _SkyTabsetPermalinkService_popStateChange, "f");
|
|
1077
1393
|
}
|
|
1078
1394
|
ngOnDestroy() {
|
|
1079
|
-
if (this
|
|
1080
|
-
this.
|
|
1395
|
+
if (__classPrivateFieldGet(this, _SkyTabsetPermalinkService_subscription, "f")) {
|
|
1396
|
+
__classPrivateFieldGet(this, _SkyTabsetPermalinkService_subscription, "f").unsubscribe();
|
|
1081
1397
|
}
|
|
1398
|
+
__classPrivateFieldGet(this, _SkyTabsetPermalinkService_popStateChange, "f").complete();
|
|
1082
1399
|
}
|
|
1083
1400
|
init() {
|
|
1084
|
-
this
|
|
1085
|
-
this.
|
|
1086
|
-
});
|
|
1401
|
+
__classPrivateFieldSet(this, _SkyTabsetPermalinkService_subscription, __classPrivateFieldGet(this, _SkyTabsetPermalinkService_location, "f").subscribe(() => {
|
|
1402
|
+
__classPrivateFieldGet(this, _SkyTabsetPermalinkService_popStateChange, "f").next();
|
|
1403
|
+
}), "f");
|
|
1087
1404
|
}
|
|
1088
1405
|
/**
|
|
1089
1406
|
* Returns the value of a URL query param.
|
|
1090
1407
|
*/
|
|
1091
1408
|
getParam(name) {
|
|
1092
|
-
return this.
|
|
1409
|
+
return __classPrivateFieldGet(this, _SkyTabsetPermalinkService_instances, "m", _SkyTabsetPermalinkService_getParams).call(this)[name];
|
|
1093
1410
|
}
|
|
1094
1411
|
/**
|
|
1095
1412
|
* Sets the value of a URL query param.
|
|
1096
1413
|
*/
|
|
1097
1414
|
setParam(name, value) {
|
|
1098
|
-
const params = this.
|
|
1415
|
+
const params = __classPrivateFieldGet(this, _SkyTabsetPermalinkService_instances, "m", _SkyTabsetPermalinkService_getParams).call(this);
|
|
1099
1416
|
if (value === null) {
|
|
1100
1417
|
delete params[name];
|
|
1101
1418
|
}
|
|
@@ -1104,18 +1421,18 @@ class SkyTabsetPermalinkService {
|
|
|
1104
1421
|
}
|
|
1105
1422
|
// Update the URL without triggering a navigation state change.
|
|
1106
1423
|
// See: https://stackoverflow.com/a/46486677
|
|
1107
|
-
const url = this
|
|
1424
|
+
const url = __classPrivateFieldGet(this, _SkyTabsetPermalinkService_router, "f")
|
|
1108
1425
|
.createUrlTree([], {
|
|
1109
|
-
relativeTo: this
|
|
1426
|
+
relativeTo: __classPrivateFieldGet(this, _SkyTabsetPermalinkService_activatedRoute, "f"),
|
|
1110
1427
|
queryParams: params,
|
|
1111
1428
|
queryParamsHandling: 'merge',
|
|
1112
1429
|
})
|
|
1113
1430
|
.toString();
|
|
1114
1431
|
// Abort redirect if the current URL is equal to the new URL.
|
|
1115
|
-
if (this.
|
|
1432
|
+
if (__classPrivateFieldGet(this, _SkyTabsetPermalinkService_location, "f").isCurrentPathEqualTo(url)) {
|
|
1116
1433
|
return;
|
|
1117
1434
|
}
|
|
1118
|
-
this.
|
|
1435
|
+
__classPrivateFieldGet(this, _SkyTabsetPermalinkService_location, "f").go(url);
|
|
1119
1436
|
}
|
|
1120
1437
|
/**
|
|
1121
1438
|
* Removes the provided query param from the URL.
|
|
@@ -1131,13 +1448,13 @@ class SkyTabsetPermalinkService {
|
|
|
1131
1448
|
if (!name) {
|
|
1132
1449
|
return null;
|
|
1133
1450
|
}
|
|
1134
|
-
const params = this.
|
|
1451
|
+
const params = __classPrivateFieldGet(this, _SkyTabsetPermalinkService_instances, "m", _SkyTabsetPermalinkService_getParams).call(this);
|
|
1135
1452
|
params[name] = value;
|
|
1136
|
-
const baseUrl = this.
|
|
1453
|
+
const baseUrl = __classPrivateFieldGet(this, _SkyTabsetPermalinkService_location, "f").path().split('?')[0];
|
|
1137
1454
|
const paramString = Object.keys(params)
|
|
1138
1455
|
.map((k) => `${k}=${params[k]}`)
|
|
1139
1456
|
.join('&');
|
|
1140
|
-
return this.
|
|
1457
|
+
return __classPrivateFieldGet(this, _SkyTabsetPermalinkService_location, "f").prepareExternalUrl(`${baseUrl}?${paramString}`);
|
|
1141
1458
|
}
|
|
1142
1459
|
/**
|
|
1143
1460
|
* Converts the provided string into a value that can be safely used in a URL.
|
|
@@ -1156,155 +1473,59 @@ class SkyTabsetPermalinkService {
|
|
|
1156
1473
|
.replace(/--/g, '-');
|
|
1157
1474
|
return sanitized;
|
|
1158
1475
|
}
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
const path = this.location.path();
|
|
1165
|
-
if (path.indexOf('?') === -1) {
|
|
1166
|
-
return params;
|
|
1167
|
-
}
|
|
1168
|
-
const existingParamPairs = path.split('?')[1].split('&');
|
|
1169
|
-
existingParamPairs.forEach((pair) => {
|
|
1170
|
-
const fragments = pair.split('=');
|
|
1171
|
-
params[fragments[0]] = decodeURIComponent(fragments[1]);
|
|
1172
|
-
});
|
|
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) {
|
|
1173
1481
|
return params;
|
|
1174
1482
|
}
|
|
1175
|
-
|
|
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
|
+
};
|
|
1176
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 });
|
|
1177
1491
|
SkyTabsetPermalinkService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyTabsetPermalinkService });
|
|
1178
1492
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyTabsetPermalinkService, decorators: [{
|
|
1179
1493
|
type: Injectable
|
|
1180
1494
|
}], ctorParameters: function () { return [{ type: i1$1.ActivatedRoute }, { type: i4.Location }, { type: i1$1.Router }]; } });
|
|
1181
1495
|
|
|
1182
|
-
|
|
1183
|
-
* @internal
|
|
1184
|
-
*/
|
|
1185
|
-
class SkyTabsetService {
|
|
1186
|
-
constructor() {
|
|
1187
|
-
this.currentActiveTabIndex = 0;
|
|
1188
|
-
this._activeTabIndex = new BehaviorSubject(0);
|
|
1189
|
-
this._activeTabUnregistered = new Subject();
|
|
1190
|
-
this.tabs = [];
|
|
1191
|
-
this.tabCounter = 0;
|
|
1192
|
-
}
|
|
1193
|
-
get activeTabUnregistered() {
|
|
1194
|
-
return this._activeTabUnregistered.asObservable();
|
|
1195
|
-
}
|
|
1196
|
-
get activeTabIndex() {
|
|
1197
|
-
return this._activeTabIndex.asObservable();
|
|
1198
|
-
}
|
|
1199
|
-
/**
|
|
1200
|
-
* Sets the active tab by its unique `tabIndex` property.
|
|
1201
|
-
*/
|
|
1202
|
-
setActiveTabIndex(value, config = {
|
|
1203
|
-
emitChange: true,
|
|
1204
|
-
}) {
|
|
1205
|
-
if (value !== undefined &&
|
|
1206
|
-
!this.tabIndexesEqual(value, this.currentActiveTabIndex)) {
|
|
1207
|
-
this.currentActiveTabIndex = value;
|
|
1208
|
-
/* istanbul ignore else */
|
|
1209
|
-
if (config.emitChange) {
|
|
1210
|
-
this._activeTabIndex.next(value);
|
|
1211
|
-
}
|
|
1212
|
-
}
|
|
1213
|
-
}
|
|
1214
|
-
/**
|
|
1215
|
-
* Registers a tab component.
|
|
1216
|
-
*/
|
|
1217
|
-
registerTab(tabIndex) {
|
|
1218
|
-
if (tabIndex === undefined) {
|
|
1219
|
-
tabIndex = this.tabCounter;
|
|
1220
|
-
this.tabCounter++;
|
|
1221
|
-
}
|
|
1222
|
-
this.tabs.push({ tabIndex });
|
|
1223
|
-
return tabIndex;
|
|
1224
|
-
}
|
|
1225
|
-
updateTabIndex(currentTabIndex, newTabIndex) {
|
|
1226
|
-
const found = this.tabs.find((tab) => this.tabIndexesEqual(tab.tabIndex, currentTabIndex));
|
|
1227
|
-
found.tabIndex = newTabIndex;
|
|
1228
|
-
}
|
|
1229
|
-
/**
|
|
1230
|
-
* Unregisters a tab component.
|
|
1231
|
-
*/
|
|
1232
|
-
unregisterTab(tabIndex) {
|
|
1233
|
-
const index = this.tabs.findIndex((tab) => this.tabIndexesEqual(tab.tabIndex, tabIndex));
|
|
1234
|
-
// Notify the tabset component when an active tab is unregistered.
|
|
1235
|
-
if (this.isTabIndexActive(this.tabs[index].tabIndex)) {
|
|
1236
|
-
this._activeTabUnregistered.next({
|
|
1237
|
-
arrayIndex: index,
|
|
1238
|
-
});
|
|
1239
|
-
}
|
|
1240
|
-
this.tabs.splice(index, 1);
|
|
1241
|
-
}
|
|
1242
|
-
/**
|
|
1243
|
-
* Unregisters all tab components at once.
|
|
1244
|
-
*/
|
|
1245
|
-
unregisterAll() {
|
|
1246
|
-
this.tabs = [];
|
|
1247
|
-
}
|
|
1248
|
-
/**
|
|
1249
|
-
* Compares two tab indexes and returns `true` if they are equal.
|
|
1250
|
-
*/
|
|
1251
|
-
tabIndexesEqual(tabIndex1, tabIndex2) {
|
|
1252
|
-
return tabIndex1 === tabIndex2 || +tabIndex1 === +tabIndex2;
|
|
1253
|
-
}
|
|
1254
|
-
/**
|
|
1255
|
-
* Verifies if a provided tab index is registered.
|
|
1256
|
-
*/
|
|
1257
|
-
isValidTabIndex(tabIndex) {
|
|
1258
|
-
return this.tabs.some((tab) => this.tabIndexesEqual(tab.tabIndex, tabIndex));
|
|
1259
|
-
}
|
|
1260
|
-
/**
|
|
1261
|
-
* Activates the first registered tab.
|
|
1262
|
-
*/
|
|
1263
|
-
activateFirstTab() {
|
|
1264
|
-
const firstTabIndex = this.tabs[0] && this.tabs[0].tabIndex;
|
|
1265
|
-
if (firstTabIndex !== undefined) {
|
|
1266
|
-
this.setActiveTabIndex(firstTabIndex);
|
|
1267
|
-
return firstTabIndex;
|
|
1268
|
-
}
|
|
1269
|
-
}
|
|
1270
|
-
/**
|
|
1271
|
-
* Activates the next registered tab, or the previous one based on a provided array index.
|
|
1272
|
-
*/
|
|
1273
|
-
activateNearestTab(arrayIndex) {
|
|
1274
|
-
const newActiveTab = this.tabs[arrayIndex] || this.tabs[arrayIndex - 1];
|
|
1275
|
-
if (newActiveTab) {
|
|
1276
|
-
this.currentActiveTabIndex = newActiveTab.tabIndex;
|
|
1277
|
-
}
|
|
1278
|
-
}
|
|
1279
|
-
isTabIndexActive(tabIndex) {
|
|
1280
|
-
return this.tabIndexesEqual(tabIndex, this.currentActiveTabIndex);
|
|
1281
|
-
}
|
|
1282
|
-
}
|
|
1283
|
-
SkyTabsetService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyTabsetService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1284
|
-
SkyTabsetService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyTabsetService });
|
|
1285
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyTabsetService, decorators: [{
|
|
1286
|
-
type: Injectable
|
|
1287
|
-
}] });
|
|
1288
|
-
|
|
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;
|
|
1289
1497
|
let nextId = 0;
|
|
1290
1498
|
class SkyTabComponent {
|
|
1291
1499
|
constructor(changeDetector, permalinkService, tabsetService) {
|
|
1292
|
-
this
|
|
1293
|
-
this.permalinkService = permalinkService;
|
|
1294
|
-
this.tabsetService = tabsetService;
|
|
1500
|
+
_SkyTabComponent_instances.add(this);
|
|
1295
1501
|
/**
|
|
1296
1502
|
* Fires when users click the button to close the tab.
|
|
1297
1503
|
* The close button is added to the tab when you specify a listener for this event.
|
|
1298
1504
|
* This event only applies when the tabset's `tabStyle` is `"tabs"`.
|
|
1299
1505
|
*/
|
|
1300
1506
|
this.close = new EventEmitter(); // eslint-disable-line @angular-eslint/no-output-native
|
|
1507
|
+
this.permalinkValueOrDefault = '';
|
|
1301
1508
|
this.showContent = false;
|
|
1302
|
-
this
|
|
1303
|
-
this
|
|
1304
|
-
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");
|
|
1305
1522
|
const id = nextId++;
|
|
1306
1523
|
this.tabPanelId = `sky-tab-${id}`;
|
|
1307
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);
|
|
1308
1529
|
}
|
|
1309
1530
|
/**
|
|
1310
1531
|
* Indicates whether the tab is active when the tabset loads. After initialization, the `active`
|
|
@@ -1312,16 +1533,16 @@ class SkyTabComponent {
|
|
|
1312
1533
|
* @default false
|
|
1313
1534
|
*/
|
|
1314
1535
|
set active(value) {
|
|
1315
|
-
if (value !== undefined && value !== this
|
|
1316
|
-
this
|
|
1317
|
-
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();
|
|
1318
1539
|
}
|
|
1319
1540
|
}
|
|
1320
1541
|
get active() {
|
|
1321
|
-
return this
|
|
1542
|
+
return __classPrivateFieldGet(this, _SkyTabComponent__active, "f");
|
|
1322
1543
|
}
|
|
1323
1544
|
get activeChange() {
|
|
1324
|
-
return this
|
|
1545
|
+
return __classPrivateFieldGet(this, _SkyTabComponent_activeChange, "f");
|
|
1325
1546
|
}
|
|
1326
1547
|
/**
|
|
1327
1548
|
* Specifies a custom query parameter value for the tab.
|
|
@@ -1332,65 +1553,90 @@ class SkyTabComponent {
|
|
|
1332
1553
|
* This input only applies when the tabset's `tabStyle` is `"tabs"`.
|
|
1333
1554
|
*/
|
|
1334
1555
|
set permalinkValue(value) {
|
|
1335
|
-
this
|
|
1556
|
+
__classPrivateFieldSet(this, _SkyTabComponent__permalinkValue, value, "f");
|
|
1557
|
+
__classPrivateFieldGet(this, _SkyTabComponent_instances, "m", _SkyTabComponent_setPermalinkValueOrDefault).call(this);
|
|
1336
1558
|
}
|
|
1337
1559
|
get permalinkValue() {
|
|
1338
|
-
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");
|
|
1339
1576
|
}
|
|
1340
1577
|
/**
|
|
1341
1578
|
* Specifies a unique identifier for the tab.
|
|
1342
1579
|
* If not defined, the identifier is set to the position of the tab on load, starting with `0`.
|
|
1343
1580
|
*/
|
|
1344
1581
|
set tabIndex(value) {
|
|
1345
|
-
if (value !== this
|
|
1582
|
+
if (value !== __classPrivateFieldGet(this, _SkyTabComponent__tabIndex, "f") &&
|
|
1346
1583
|
value !== undefined &&
|
|
1347
|
-
this
|
|
1348
|
-
this.
|
|
1349
|
-
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);
|
|
1350
1587
|
}
|
|
1351
|
-
this
|
|
1588
|
+
__classPrivateFieldSet(this, _SkyTabComponent__tabIndex, value, "f");
|
|
1352
1589
|
}
|
|
1353
1590
|
get tabIndex() {
|
|
1354
|
-
return this
|
|
1355
|
-
}
|
|
1356
|
-
get closeable() {
|
|
1357
|
-
return this.close.observers.length > 0;
|
|
1591
|
+
return __classPrivateFieldGet(this, _SkyTabComponent__tabIndex, "f");
|
|
1358
1592
|
}
|
|
1359
1593
|
/**
|
|
1360
1594
|
* Alerts the tabset component when this component has changes that need to be reflected in the UI.
|
|
1361
1595
|
*/
|
|
1362
1596
|
get stateChange() {
|
|
1363
|
-
return this
|
|
1597
|
+
return __classPrivateFieldGet(this, _SkyTabComponent_stateChange, "f");
|
|
1364
1598
|
}
|
|
1365
1599
|
get tabIndexChange() {
|
|
1366
|
-
return this
|
|
1600
|
+
return __classPrivateFieldGet(this, _SkyTabComponent_tabIndexChange, "f");
|
|
1367
1601
|
}
|
|
1368
1602
|
ngOnChanges(changes) {
|
|
1369
1603
|
if ((changes.disabled && !changes.disabled.firstChange) ||
|
|
1370
1604
|
(changes.tabHeading && !changes.tabHeading.firstChange) ||
|
|
1371
1605
|
(changes.tabHeaderCount && !changes.tabHeaderCount.firstChange) ||
|
|
1372
1606
|
(changes.permalinkValue && !changes.permalinkValue.firstChange)) {
|
|
1373
|
-
this.
|
|
1607
|
+
__classPrivateFieldGet(this, _SkyTabComponent_stateChange, "f").next();
|
|
1374
1608
|
}
|
|
1375
1609
|
}
|
|
1376
1610
|
ngOnDestroy() {
|
|
1377
|
-
this.
|
|
1378
|
-
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
|
+
}
|
|
1379
1617
|
}
|
|
1380
1618
|
init() {
|
|
1381
|
-
this
|
|
1619
|
+
__classPrivateFieldSet(this, _SkyTabComponent__tabIndex, __classPrivateFieldGet(this, _SkyTabComponent_tabsetService, "f").registerTab(this.tabIndex), "f");
|
|
1382
1620
|
}
|
|
1383
1621
|
activate() {
|
|
1384
|
-
this
|
|
1622
|
+
__classPrivateFieldSet(this, _SkyTabComponent__active, true, "f");
|
|
1385
1623
|
this.showContent = true;
|
|
1386
|
-
this.
|
|
1624
|
+
__classPrivateFieldGet(this, _SkyTabComponent_changeDetector, "f").markForCheck();
|
|
1387
1625
|
}
|
|
1388
1626
|
deactivate() {
|
|
1389
|
-
this
|
|
1627
|
+
__classPrivateFieldSet(this, _SkyTabComponent__active, false, "f");
|
|
1390
1628
|
this.showContent = false;
|
|
1391
|
-
this.
|
|
1629
|
+
__classPrivateFieldGet(this, _SkyTabComponent_changeDetector, "f").markForCheck();
|
|
1630
|
+
}
|
|
1631
|
+
isCloseable() {
|
|
1632
|
+
return this.close.observers.length > 0;
|
|
1392
1633
|
}
|
|
1393
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
|
+
};
|
|
1394
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 });
|
|
1395
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 });
|
|
1396
1642
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyTabComponent, decorators: [{
|
|
@@ -1412,7 +1658,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
|
|
|
1412
1658
|
type: Output
|
|
1413
1659
|
}] } });
|
|
1414
1660
|
|
|
1415
|
-
|
|
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;
|
|
1416
1682
|
const buttonTypeNext = 'next';
|
|
1417
1683
|
const buttonTypePrevious = 'previous';
|
|
1418
1684
|
const buttonTypeFinish = 'finish';
|
|
@@ -1420,6 +1686,7 @@ class SkyTabsetNavButtonComponent {
|
|
|
1420
1686
|
constructor(logger) {
|
|
1421
1687
|
_SkyTabsetNavButtonComponent_instances.add(this);
|
|
1422
1688
|
this.isVisible = false;
|
|
1689
|
+
this.type = 'submit';
|
|
1423
1690
|
_SkyTabsetNavButtonComponent__buttonType.set(this, void 0);
|
|
1424
1691
|
_SkyTabsetNavButtonComponent__disabled.set(this, void 0);
|
|
1425
1692
|
_SkyTabsetNavButtonComponent__tabset.set(this, void 0);
|
|
@@ -1428,7 +1695,6 @@ class SkyTabsetNavButtonComponent {
|
|
|
1428
1695
|
_SkyTabsetNavButtonComponent_currentTabsetSub.set(this, void 0);
|
|
1429
1696
|
_SkyTabsetNavButtonComponent_logger.set(this, void 0);
|
|
1430
1697
|
_SkyTabsetNavButtonComponent_tabCount.set(this, void 0);
|
|
1431
|
-
_SkyTabsetNavButtonComponent_tabToSelect.set(this, void 0);
|
|
1432
1698
|
_SkyTabsetNavButtonComponent_ngUnsubscribe.set(this, new Subject());
|
|
1433
1699
|
__classPrivateFieldSet(this, _SkyTabsetNavButtonComponent_logger, logger, "f");
|
|
1434
1700
|
}
|
|
@@ -1436,20 +1702,21 @@ class SkyTabsetNavButtonComponent {
|
|
|
1436
1702
|
* Specifies the tabset wizard component to associate with the nav button.
|
|
1437
1703
|
* @required
|
|
1438
1704
|
*/
|
|
1705
|
+
get tabset() {
|
|
1706
|
+
return __classPrivateFieldGet(this, _SkyTabsetNavButtonComponent__tabset, "f");
|
|
1707
|
+
}
|
|
1439
1708
|
set tabset(value) {
|
|
1440
1709
|
__classPrivateFieldSet(this, _SkyTabsetNavButtonComponent__tabset, value, "f");
|
|
1441
1710
|
if (__classPrivateFieldGet(this, _SkyTabsetNavButtonComponent_currentTabsetSub, "f")) {
|
|
1442
1711
|
__classPrivateFieldGet(this, _SkyTabsetNavButtonComponent_currentTabsetSub, "f").unsubscribe();
|
|
1443
1712
|
}
|
|
1444
1713
|
if (value) {
|
|
1445
|
-
|
|
1446
|
-
__classPrivateFieldGet(this, _SkyTabsetNavButtonComponent__tabset, "f").hasFinishButton = true;
|
|
1447
|
-
}
|
|
1448
|
-
__classPrivateFieldSet(this, _SkyTabsetNavButtonComponent_currentTabsetSub, __classPrivateFieldGet(this, _SkyTabsetNavButtonComponent__tabset, "f").activeChange
|
|
1714
|
+
__classPrivateFieldSet(this, _SkyTabsetNavButtonComponent_currentTabsetSub, value.activeChange
|
|
1449
1715
|
.pipe(distinctUntilChanged(), takeUntil(__classPrivateFieldGet(this, _SkyTabsetNavButtonComponent_ngUnsubscribe, "f")))
|
|
1450
1716
|
.subscribe((index) => {
|
|
1717
|
+
var _a, _b;
|
|
1451
1718
|
__classPrivateFieldSet(this, _SkyTabsetNavButtonComponent_activeSkyTabIndex, index, "f");
|
|
1452
|
-
__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");
|
|
1453
1720
|
__classPrivateFieldGet(this, _SkyTabsetNavButtonComponent_instances, "m", _SkyTabsetNavButtonComponent_updateTabToSelect).call(this);
|
|
1454
1721
|
__classPrivateFieldGet(this, _SkyTabsetNavButtonComponent_instances, "m", _SkyTabsetNavButtonComponent_updateButtonVisibility).call(this);
|
|
1455
1722
|
__classPrivateFieldGet(this, _SkyTabsetNavButtonComponent_instances, "m", _SkyTabsetNavButtonComponent_updateButtonProperties).call(this);
|
|
@@ -1487,13 +1754,7 @@ class SkyTabsetNavButtonComponent {
|
|
|
1487
1754
|
__classPrivateFieldSet(this, _SkyTabsetNavButtonComponent__disabled, value, "f");
|
|
1488
1755
|
}
|
|
1489
1756
|
get disabled() {
|
|
1490
|
-
|
|
1491
|
-
return __classPrivateFieldGet(this, _SkyTabsetNavButtonComponent__disabled, "f");
|
|
1492
|
-
}
|
|
1493
|
-
else if (__classPrivateFieldGet(this, _SkyTabsetNavButtonComponent__buttonType, "f") === buttonTypeFinish) {
|
|
1494
|
-
return false;
|
|
1495
|
-
}
|
|
1496
|
-
return !__classPrivateFieldGet(this, _SkyTabsetNavButtonComponent_tabToSelect, "f") || __classPrivateFieldGet(this, _SkyTabsetNavButtonComponent_tabToSelect, "f").disabled;
|
|
1757
|
+
return __classPrivateFieldGet(this, _SkyTabsetNavButtonComponent__disabled, "f");
|
|
1497
1758
|
}
|
|
1498
1759
|
ngOnDestroy() {
|
|
1499
1760
|
__classPrivateFieldGet(this, _SkyTabsetNavButtonComponent_ngUnsubscribe, "f").next();
|
|
@@ -1501,59 +1762,55 @@ class SkyTabsetNavButtonComponent {
|
|
|
1501
1762
|
}
|
|
1502
1763
|
buttonClick() {
|
|
1503
1764
|
/* istanbul ignore else */
|
|
1504
|
-
if (
|
|
1505
|
-
|
|
1765
|
+
if (this.tabToSelect && !this.tabToSelect.disabled && this.tabset) {
|
|
1766
|
+
this.tabset.active = this.tabToSelect.tabIndex;
|
|
1506
1767
|
}
|
|
1507
1768
|
}
|
|
1508
1769
|
}
|
|
1509
|
-
_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(),
|
|
1510
|
-
const isLastStep = __classPrivateFieldGet(this, _SkyTabsetNavButtonComponent_activeIndexNumber, "f") === __classPrivateFieldGet(this, _SkyTabsetNavButtonComponent_tabCount, "f") - 1;
|
|
1511
|
-
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) {
|
|
1512
1773
|
this.isVisible = isLastStep;
|
|
1513
|
-
return;
|
|
1514
1774
|
}
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
this.isVisible =
|
|
1520
|
-
return;
|
|
1775
|
+
else if (this.buttonType === buttonTypeNext) {
|
|
1776
|
+
this.isVisible = !isLastStep;
|
|
1777
|
+
}
|
|
1778
|
+
else {
|
|
1779
|
+
this.isVisible = true;
|
|
1521
1780
|
}
|
|
1522
|
-
this.isVisible = true;
|
|
1523
1781
|
}, _SkyTabsetNavButtonComponent_updateButtonProperties = function _SkyTabsetNavButtonComponent_updateButtonProperties() {
|
|
1524
|
-
var _a
|
|
1525
|
-
if (
|
|
1526
|
-
|
|
1527
|
-
((_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) {
|
|
1528
1785
|
this.buttonClassName = 'sky-btn-primary';
|
|
1529
1786
|
}
|
|
1530
1787
|
else {
|
|
1531
1788
|
this.buttonClassName = 'sky-btn-default';
|
|
1532
1789
|
}
|
|
1533
|
-
this.ariaControls = (
|
|
1790
|
+
this.ariaControls = (_a = this.tabToSelect) === null || _a === void 0 ? void 0 : _a.tabPanelId;
|
|
1534
1791
|
}, _SkyTabsetNavButtonComponent_updateTabToSelect = function _SkyTabsetNavButtonComponent_updateTabToSelect() {
|
|
1535
1792
|
var _a;
|
|
1536
|
-
if ((_a =
|
|
1537
|
-
const tabs =
|
|
1538
|
-
|
|
1793
|
+
if ((_a = this.tabset) === null || _a === void 0 ? void 0 : _a.tabs) {
|
|
1794
|
+
const tabs = this.tabset.tabs.toArray();
|
|
1795
|
+
this.tabToSelect = undefined;
|
|
1539
1796
|
// tab index can be a number or a string, but we need the actual number index
|
|
1540
1797
|
__classPrivateFieldSet(this, _SkyTabsetNavButtonComponent_activeIndexNumber, tabs.findIndex((tab) => tab.tabIndex === __classPrivateFieldGet(this, _SkyTabsetNavButtonComponent_activeSkyTabIndex, "f")), "f");
|
|
1541
1798
|
/* istanbul ignore else */
|
|
1542
1799
|
if (__classPrivateFieldGet(this, _SkyTabsetNavButtonComponent_activeIndexNumber, "f") !== undefined) {
|
|
1543
|
-
if (
|
|
1544
|
-
|
|
1800
|
+
if (this.buttonType === buttonTypeNext) {
|
|
1801
|
+
this.tabToSelect = tabs[__classPrivateFieldGet(this, _SkyTabsetNavButtonComponent_activeIndexNumber, "f") + 1];
|
|
1545
1802
|
}
|
|
1546
|
-
else if (
|
|
1547
|
-
|
|
1803
|
+
else if (this.buttonType === buttonTypePrevious) {
|
|
1804
|
+
this.tabToSelect = tabs[__classPrivateFieldGet(this, _SkyTabsetNavButtonComponent_activeIndexNumber, "f") - 1];
|
|
1548
1805
|
}
|
|
1549
1806
|
}
|
|
1550
1807
|
}
|
|
1551
1808
|
};
|
|
1552
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 });
|
|
1553
|
-
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" }] });
|
|
1554
1811
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyTabsetNavButtonComponent, decorators: [{
|
|
1555
1812
|
type: Component,
|
|
1556
|
-
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" }]
|
|
1557
1814
|
}], ctorParameters: function () { return [{ type: i1.SkyLogService }]; }, propDecorators: { tabset: [{
|
|
1558
1815
|
type: Input
|
|
1559
1816
|
}], buttonType: [{
|
|
@@ -1564,25 +1821,35 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
|
|
|
1564
1821
|
type: Input
|
|
1565
1822
|
}] } });
|
|
1566
1823
|
|
|
1824
|
+
var _SkyTabsetAdapterService_instances, _SkyTabsetAdapterService_currentOverflow, _SkyTabsetAdapterService_tabsetRef, _SkyTabsetAdapterService_tabsOffsetLeft, _SkyTabsetAdapterService_overflowChange, _SkyTabsetAdapterService_getTabsOffsetLeft;
|
|
1567
1825
|
/**
|
|
1568
1826
|
* @internal
|
|
1569
1827
|
*/
|
|
1570
1828
|
class SkyTabsetAdapterService {
|
|
1571
1829
|
constructor() {
|
|
1572
|
-
|
|
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");
|
|
1573
1836
|
}
|
|
1574
1837
|
get overflowChange() {
|
|
1575
|
-
return this
|
|
1838
|
+
return __classPrivateFieldGet(this, _SkyTabsetAdapterService_overflowChange, "f");
|
|
1839
|
+
}
|
|
1840
|
+
ngOnDestroy() {
|
|
1841
|
+
__classPrivateFieldGet(this, _SkyTabsetAdapterService_overflowChange, "f").complete();
|
|
1576
1842
|
}
|
|
1577
1843
|
registerTabset(tabsetRef) {
|
|
1578
|
-
this
|
|
1579
|
-
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");
|
|
1580
1846
|
}
|
|
1581
1847
|
/**
|
|
1582
1848
|
* Detects if the tab buttons are wider than the tabset container.
|
|
1583
1849
|
*/
|
|
1584
1850
|
detectOverflow() {
|
|
1585
|
-
|
|
1851
|
+
var _a;
|
|
1852
|
+
const nativeElement = (_a = __classPrivateFieldGet(this, _SkyTabsetAdapterService_tabsetRef, "f")) === null || _a === void 0 ? void 0 : _a.nativeElement;
|
|
1586
1853
|
const tabsetRect = nativeElement
|
|
1587
1854
|
.querySelector('.sky-tabset')
|
|
1588
1855
|
.getBoundingClientRect();
|
|
@@ -1592,39 +1859,37 @@ class SkyTabsetAdapterService {
|
|
|
1592
1859
|
const tabExtraButtonsRect = nativeElement
|
|
1593
1860
|
.querySelector('.sky-tabset-btns')
|
|
1594
1861
|
.getBoundingClientRect();
|
|
1595
|
-
const tabButtonsWidth = tabButtonsRect.width + tabExtraButtonsRect.width + this
|
|
1862
|
+
const tabButtonsWidth = tabButtonsRect.width + tabExtraButtonsRect.width + __classPrivateFieldGet(this, _SkyTabsetAdapterService_tabsOffsetLeft, "f");
|
|
1596
1863
|
const newOverflow = tabButtonsWidth > tabsetRect.width;
|
|
1597
|
-
if (this
|
|
1598
|
-
this
|
|
1599
|
-
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"));
|
|
1600
1867
|
}
|
|
1601
1868
|
}
|
|
1602
|
-
/**
|
|
1603
|
-
* Returns the number of pixels to the left of the first tab.
|
|
1604
|
-
*/
|
|
1605
|
-
getTabsOffsetLeft(tabsetEl) {
|
|
1606
|
-
const tabsetRect = tabsetEl.getBoundingClientRect();
|
|
1607
|
-
// The dropdown element is the first "tab" and always exists in the DOM, even when hidden.
|
|
1608
|
-
const firstTabRect = tabsetEl
|
|
1609
|
-
.querySelector('.sky-tabset-dropdown')
|
|
1610
|
-
.getBoundingClientRect();
|
|
1611
|
-
return firstTabRect.left - tabsetRect.left;
|
|
1612
|
-
}
|
|
1613
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
|
+
};
|
|
1614
1883
|
SkyTabsetAdapterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyTabsetAdapterService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1615
1884
|
SkyTabsetAdapterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyTabsetAdapterService });
|
|
1616
1885
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyTabsetAdapterService, decorators: [{
|
|
1617
1886
|
type: Injectable
|
|
1618
|
-
}] });
|
|
1887
|
+
}], ctorParameters: function () { return []; } });
|
|
1619
1888
|
|
|
1620
|
-
var
|
|
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;
|
|
1621
1890
|
class SkyTabsetComponent {
|
|
1622
1891
|
constructor(changeDetector, elementRef, adapterService, permalinkService, tabsetService) {
|
|
1623
|
-
this
|
|
1624
|
-
this.elementRef = elementRef;
|
|
1625
|
-
this.adapterService = adapterService;
|
|
1626
|
-
this.permalinkService = permalinkService;
|
|
1627
|
-
this.tabsetService = tabsetService;
|
|
1892
|
+
_SkyTabsetComponent_instances.add(this);
|
|
1628
1893
|
/**
|
|
1629
1894
|
* Fires when the active tab changes. This event emits the index of the active tab.
|
|
1630
1895
|
*/
|
|
@@ -1646,41 +1911,57 @@ class SkyTabsetComponent {
|
|
|
1646
1911
|
* This event only applies when `tabStyle` is `"tabs"`.
|
|
1647
1912
|
*/
|
|
1648
1913
|
this.tabIndexesChange = new EventEmitter();
|
|
1914
|
+
this.dropdownTriggerButtonText = '';
|
|
1649
1915
|
this.tabButtons = [];
|
|
1650
|
-
this
|
|
1651
|
-
this
|
|
1652
|
-
|
|
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");
|
|
1653
1934
|
}
|
|
1654
1935
|
/**
|
|
1655
1936
|
* Activates a tab by its `tabIndex` property.
|
|
1656
1937
|
*/
|
|
1657
1938
|
set active(value) {
|
|
1658
1939
|
if (value === undefined ||
|
|
1659
|
-
this.
|
|
1940
|
+
__classPrivateFieldGet(this, _SkyTabsetComponent_tabsetService, "f").tabIndexesEqual(value, __classPrivateFieldGet(this, _SkyTabsetComponent__active, "f"))) {
|
|
1660
1941
|
return;
|
|
1661
1942
|
}
|
|
1662
|
-
this
|
|
1943
|
+
__classPrivateFieldSet(this, _SkyTabsetComponent__active, value, "f");
|
|
1663
1944
|
if (this.tabs) {
|
|
1664
|
-
this.
|
|
1945
|
+
__classPrivateFieldGet(this, _SkyTabsetComponent_tabsetService, "f").setActiveTabIndex(value);
|
|
1665
1946
|
}
|
|
1666
1947
|
else {
|
|
1667
1948
|
// On init, wait for children tabs to render before broadcasting the active tab index.
|
|
1668
1949
|
setTimeout(() => {
|
|
1669
|
-
if (this.
|
|
1950
|
+
if (__classPrivateFieldGet(this, _SkyTabsetComponent_tabsetService, "f").isValidTabIndex(value)) {
|
|
1670
1951
|
// On init, yield to the permalink ID, if it exists.
|
|
1671
|
-
if (this.
|
|
1672
|
-
this.
|
|
1952
|
+
if (__classPrivateFieldGet(this, _SkyTabsetComponent_instances, "m", _SkyTabsetComponent_getActiveTabIndexByPermalinkId).call(this) === undefined) {
|
|
1953
|
+
__classPrivateFieldGet(this, _SkyTabsetComponent_tabsetService, "f").setActiveTabIndex(value);
|
|
1673
1954
|
}
|
|
1674
1955
|
}
|
|
1675
1956
|
else {
|
|
1676
1957
|
// Activate the first tab if the new tab index is invalid.
|
|
1677
|
-
this
|
|
1958
|
+
__classPrivateFieldSet(this, _SkyTabsetComponent__active, __classPrivateFieldGet(this, _SkyTabsetComponent_tabsetService, "f").activateFirstTab(), "f");
|
|
1678
1959
|
}
|
|
1679
1960
|
});
|
|
1680
1961
|
}
|
|
1681
1962
|
}
|
|
1682
1963
|
get active() {
|
|
1683
|
-
return this
|
|
1964
|
+
return __classPrivateFieldGet(this, _SkyTabsetComponent__active, "f");
|
|
1684
1965
|
}
|
|
1685
1966
|
/**
|
|
1686
1967
|
* Distinguishes a tabset's unique state in the URL by generating a query parameter
|
|
@@ -1691,77 +1972,85 @@ class SkyTabsetComponent {
|
|
|
1691
1972
|
*/
|
|
1692
1973
|
set permalinkId(value) {
|
|
1693
1974
|
if (!value) {
|
|
1694
|
-
|
|
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");
|
|
1695
1980
|
}
|
|
1696
|
-
const sanitized = this.permalinkService.urlify(value);
|
|
1697
|
-
this._permalinkId = `${sanitized}-active-tab`;
|
|
1698
1981
|
}
|
|
1699
1982
|
get permalinkId() {
|
|
1700
|
-
return this
|
|
1983
|
+
return __classPrivateFieldGet(this, _SkyTabsetComponent__permalinkId, "f");
|
|
1701
1984
|
}
|
|
1702
1985
|
/**
|
|
1703
1986
|
* Specifies the behavior for a series of tabs.
|
|
1704
1987
|
* @default "tabs"
|
|
1705
1988
|
*/
|
|
1706
1989
|
set tabStyle(value) {
|
|
1707
|
-
this
|
|
1990
|
+
__classPrivateFieldSet(this, _SkyTabsetComponent__tabStyle, value || 'tabs', "f");
|
|
1708
1991
|
}
|
|
1709
1992
|
get tabStyle() {
|
|
1710
|
-
return this
|
|
1993
|
+
return __classPrivateFieldGet(this, _SkyTabsetComponent__tabStyle, "f");
|
|
1711
1994
|
}
|
|
1712
1995
|
set tabDisplayMode(value) {
|
|
1713
|
-
this
|
|
1714
|
-
this.
|
|
1996
|
+
__classPrivateFieldSet(this, _SkyTabsetComponent__tabDisplayMode, value, "f");
|
|
1997
|
+
__classPrivateFieldGet(this, _SkyTabsetComponent_changeDetector, "f").markForCheck();
|
|
1715
1998
|
}
|
|
1716
1999
|
get tabDisplayMode() {
|
|
1717
|
-
return this
|
|
2000
|
+
return __classPrivateFieldGet(this, _SkyTabsetComponent__tabDisplayMode, "f");
|
|
1718
2001
|
}
|
|
1719
|
-
|
|
1720
|
-
|
|
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
|
+
});
|
|
1721
2008
|
}
|
|
1722
|
-
|
|
1723
|
-
|
|
2009
|
+
get tabs() {
|
|
2010
|
+
return __classPrivateFieldGet(this, _SkyTabsetComponent__tabs, "f");
|
|
1724
2011
|
}
|
|
1725
2012
|
ngAfterViewInit() {
|
|
1726
|
-
this.
|
|
1727
|
-
this.
|
|
1728
|
-
|
|
1729
|
-
this.
|
|
1730
|
-
this.
|
|
1731
|
-
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);
|
|
1732
2018
|
// If the currently active tab is getting unregistered, activate the next one.
|
|
1733
|
-
this.
|
|
1734
|
-
.pipe(takeUntil(this
|
|
2019
|
+
__classPrivateFieldGet(this, _SkyTabsetComponent_tabsetService, "f").activeTabUnregistered
|
|
2020
|
+
.pipe(takeUntil(__classPrivateFieldGet(this, _SkyTabsetComponent_ngUnsubscribe, "f")))
|
|
1735
2021
|
.subscribe((tab) => {
|
|
1736
2022
|
// Wait for the new tabs to render before activating.
|
|
1737
2023
|
setTimeout(() => {
|
|
1738
|
-
this.
|
|
2024
|
+
__classPrivateFieldGet(this, _SkyTabsetComponent_tabsetService, "f").activateNearestTab(tab.arrayIndex);
|
|
1739
2025
|
});
|
|
1740
2026
|
});
|
|
1741
2027
|
// Let the tabset render the initial active index before listening for changes.
|
|
1742
2028
|
setTimeout(() => {
|
|
1743
|
-
this.
|
|
1744
|
-
this.
|
|
1745
|
-
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();
|
|
1746
2032
|
});
|
|
1747
2033
|
}
|
|
1748
2034
|
ngOnDestroy() {
|
|
1749
|
-
this.
|
|
1750
|
-
this.
|
|
1751
|
-
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);
|
|
1752
2040
|
if (this.permalinkId) {
|
|
1753
|
-
this.
|
|
2041
|
+
__classPrivateFieldGet(this, _SkyTabsetComponent_permalinkService, "f").clearParam(this.permalinkId);
|
|
1754
2042
|
}
|
|
1755
2043
|
}
|
|
1756
2044
|
onWindowResize() {
|
|
1757
|
-
this.
|
|
2045
|
+
__classPrivateFieldGet(this, _SkyTabsetComponent_adapterService, "f").detectOverflow();
|
|
1758
2046
|
}
|
|
1759
2047
|
onTabCloseClick(tabButton) {
|
|
1760
|
-
|
|
1761
|
-
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();
|
|
1762
2051
|
}
|
|
1763
2052
|
onTabButtonClick(tabButton) {
|
|
1764
|
-
this.
|
|
2053
|
+
__classPrivateFieldGet(this, _SkyTabsetComponent_tabsetService, "f").setActiveTabIndex(tabButton.tabIndex);
|
|
1765
2054
|
}
|
|
1766
2055
|
onNewTabClick() {
|
|
1767
2056
|
this.newTab.emit();
|
|
@@ -1769,218 +2058,206 @@ class SkyTabsetComponent {
|
|
|
1769
2058
|
onOpenTabClick() {
|
|
1770
2059
|
this.openTab.emit();
|
|
1771
2060
|
}
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
* 1. Does the URL include a query param that reflects this tabset's active tab?
|
|
1775
|
-
* 2. Does one of the tab components have their `active` property set to `true`?
|
|
1776
|
-
* 3. Is the tabset component's `active` property set to a specific tab index?
|
|
1777
|
-
*/
|
|
1778
|
-
getInitialTabIndex() {
|
|
1779
|
-
var _a;
|
|
1780
|
-
let activeIndex = this.getActiveTabIndexByPermalinkId();
|
|
1781
|
-
if (activeIndex === undefined) {
|
|
1782
|
-
activeIndex = (_a = this.getActiveTabComponent()) === null || _a === void 0 ? void 0 : _a.tabIndex;
|
|
1783
|
-
if (activeIndex === undefined) {
|
|
1784
|
-
activeIndex = this.active;
|
|
1785
|
-
}
|
|
1786
|
-
}
|
|
1787
|
-
return activeIndex;
|
|
2061
|
+
onRightKeyDown() {
|
|
2062
|
+
__classPrivateFieldGet(this, _SkyTabsetComponent_tabsetService, "f").focusNextTabBtn(this.tabButtons);
|
|
1788
2063
|
}
|
|
1789
|
-
|
|
1790
|
-
this.
|
|
1791
|
-
.pipe(distinctUntilChanged(), takeUntil(this.ngUnsubscribe))
|
|
1792
|
-
.subscribe((activeIndex) => {
|
|
1793
|
-
this.updateTabsetComponent(activeIndex);
|
|
1794
|
-
});
|
|
2064
|
+
onLeftKeyDown() {
|
|
2065
|
+
__classPrivateFieldGet(this, _SkyTabsetComponent_tabsetService, "f").focusPrevTabBtn(this.tabButtons);
|
|
1795
2066
|
}
|
|
1796
|
-
|
|
1797
|
-
this.
|
|
1798
|
-
this.resetTabComponents();
|
|
1799
|
-
});
|
|
2067
|
+
onHomeKeyDown() {
|
|
2068
|
+
__classPrivateFieldGet(this, _SkyTabsetComponent_tabsetService, "f").focusFirstOrNearestTabBtn(this.tabButtons);
|
|
1800
2069
|
}
|
|
1801
|
-
|
|
2070
|
+
onEndKeyDown() {
|
|
2071
|
+
__classPrivateFieldGet(this, _SkyTabsetComponent_tabsetService, "f").focusLastOrNearestTabBtn(this.tabButtons);
|
|
2072
|
+
}
|
|
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;
|
|
2079
|
+
if (activeIndex === undefined) {
|
|
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) {
|
|
1802
2092
|
combineLatest(this.tabs.map((tab) => tab.activeChange))
|
|
1803
|
-
.pipe(takeUntil(race(this
|
|
2093
|
+
.pipe(takeUntil(race(__classPrivateFieldGet(this, _SkyTabsetComponent_tabComponentsStateChangeUnsubscribe, "f"), __classPrivateFieldGet(this, _SkyTabsetComponent_ngUnsubscribe, "f"))))
|
|
1804
2094
|
.subscribe(() => {
|
|
1805
2095
|
// Wait for the tab components to render changes before finding the active one.
|
|
1806
2096
|
setTimeout(() => {
|
|
1807
2097
|
var _a;
|
|
1808
|
-
const tabIndex = (_a = this.
|
|
1809
|
-
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);
|
|
1810
2100
|
});
|
|
1811
2101
|
});
|
|
1812
2102
|
combineLatest(this.tabs.map((tab) => tab.tabIndexChange))
|
|
1813
|
-
.pipe(takeUntil(race(this
|
|
2103
|
+
.pipe(takeUntil(race(__classPrivateFieldGet(this, _SkyTabsetComponent_tabComponentsStateChangeUnsubscribe, "f"), __classPrivateFieldGet(this, _SkyTabsetComponent_ngUnsubscribe, "f"))))
|
|
1814
2104
|
.subscribe(() => {
|
|
1815
2105
|
// Don't emit the first change.
|
|
1816
2106
|
if (this.lastActiveTabIndex !== undefined) {
|
|
1817
2107
|
// Wait for the tab components to render changes before updating the view.
|
|
1818
2108
|
setTimeout(() => {
|
|
1819
|
-
this.
|
|
1820
|
-
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);
|
|
1821
2111
|
});
|
|
1822
2112
|
}
|
|
1823
2113
|
});
|
|
1824
2114
|
combineLatest(this.tabs.map((tab) => tab.stateChange))
|
|
1825
|
-
.pipe(takeUntil(race(this
|
|
2115
|
+
.pipe(takeUntil(race(__classPrivateFieldGet(this, _SkyTabsetComponent_tabComponentsStateChangeUnsubscribe, "f"), __classPrivateFieldGet(this, _SkyTabsetComponent_ngUnsubscribe, "f"))))
|
|
1826
2116
|
.subscribe(() => {
|
|
1827
2117
|
// Wait for the tab components to render changes before finding the active one.
|
|
1828
2118
|
setTimeout(() => {
|
|
1829
|
-
this.
|
|
2119
|
+
__classPrivateFieldGet(this, _SkyTabsetComponent_instances, "m", _SkyTabsetComponent_updateTabsetComponent).call(this, __classPrivateFieldGet(this, _SkyTabsetComponent_tabsetService, "f").currentActiveTabIndex, true);
|
|
1830
2120
|
});
|
|
1831
2121
|
});
|
|
1832
2122
|
}
|
|
1833
|
-
|
|
1834
|
-
|
|
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;
|
|
1835
2134
|
}
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
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;
|
|
1844
2176
|
}
|
|
1845
|
-
|
|
1846
|
-
const activeIndex = (_a = this.getActiveTabComponent()) === null || _a === void 0 ? void 0 : _a.tabIndex;
|
|
1847
|
-
this.tabsetService.setActiveTabIndex(activeIndex, {
|
|
1848
|
-
emitChange: false,
|
|
1849
|
-
});
|
|
1850
|
-
this.listenTabComponentsStateChange();
|
|
1851
|
-
}
|
|
1852
|
-
emitTabIndexChange() {
|
|
1853
|
-
this.tabIndexesChange.emit({
|
|
1854
|
-
tabs: this.tabs.map((tab) => ({
|
|
1855
|
-
tabHeading: tab.tabHeading,
|
|
1856
|
-
tabIndex: tab.tabIndex,
|
|
1857
|
-
})),
|
|
1858
|
-
});
|
|
2177
|
+
return undefined;
|
|
1859
2178
|
}
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
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);
|
|
1873
2219
|
}
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
.
|
|
1881
|
-
|
|
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);
|
|
1882
2232
|
});
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
const activeIndex = this.getActiveTabIndexByPermalinkId();
|
|
1886
|
-
this.tabsetService.setActiveTabIndex(activeIndex);
|
|
1887
|
-
}
|
|
1888
|
-
getActiveTabIndexByPermalinkId() {
|
|
1889
|
-
var _a;
|
|
1890
|
-
if (this.permalinkId) {
|
|
1891
|
-
const paramValue = this.permalinkService.getParam(this.permalinkId);
|
|
1892
|
-
if (paramValue) {
|
|
1893
|
-
return (_a = this.tabs.find((tab) => tab.permalinkValue === paramValue)) === null || _a === void 0 ? void 0 : _a.tabIndex;
|
|
1894
|
-
}
|
|
2233
|
+
if (activeTabComponent) {
|
|
2234
|
+
__classPrivateFieldGet(this, _SkyTabsetComponent_permalinkService, "f").setParam(this.permalinkId, activeTabComponent.permalinkValueOrDefault);
|
|
1895
2235
|
}
|
|
1896
2236
|
}
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
closeable: tab.closeable,
|
|
1907
|
-
ariaControls: tab.tabPanelId,
|
|
1908
|
-
disabled: tab.disabled,
|
|
1909
|
-
buttonHref: tab.disabled
|
|
1910
|
-
? null
|
|
1911
|
-
: this.permalinkService.getParamHref(this.permalinkId, tab.permalinkValue),
|
|
1912
|
-
buttonId: tab.tabButtonId,
|
|
1913
|
-
buttonTextCount: tab.tabHeaderCount,
|
|
1914
|
-
buttonText: tab.tabHeading,
|
|
1915
|
-
tabIndex: tab.tabIndex,
|
|
1916
|
-
}));
|
|
1917
|
-
}
|
|
1918
|
-
updateTabButtons(activeIndex) {
|
|
1919
|
-
this.tabButtons.forEach((button) => {
|
|
1920
|
-
button.active = this.tabsetService.tabIndexesEqual(button.tabIndex, activeIndex);
|
|
1921
|
-
});
|
|
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);
|
|
1922
2246
|
}
|
|
1923
|
-
|
|
1924
|
-
* Updates the UI and state of the tabset component after the tab index or
|
|
1925
|
-
* tab components have changed.
|
|
1926
|
-
* @param activeIndex The currently active tab index.
|
|
1927
|
-
* @param regenerateTabButtons Indicates if tab button view models should be regenerated.
|
|
1928
|
-
* Setting this value to `false` will simply update the existing tab buttons. Setting this value
|
|
1929
|
-
* to `true` is only necessary when the underlying tab components have changed and the tab
|
|
1930
|
-
* buttons must reflect those changes.
|
|
1931
|
-
*/
|
|
1932
|
-
updateTabsetComponent(activeIndex, regenerateTabButtons = false) {
|
|
1933
|
-
var _a;
|
|
1934
|
-
// Activate/deactivate tab components.
|
|
1935
|
-
this.tabs.forEach((tab) => {
|
|
1936
|
-
this.tabsetService.tabIndexesEqual(tab.tabIndex, activeIndex)
|
|
1937
|
-
? tab.activate()
|
|
1938
|
-
: tab.deactivate();
|
|
1939
|
-
});
|
|
1940
|
-
// Update the tab button models.
|
|
1941
|
-
if (regenerateTabButtons || !this.tabButtons.length) {
|
|
1942
|
-
this.tabButtons = this.createTabButtons(activeIndex);
|
|
1943
|
-
}
|
|
1944
|
-
else {
|
|
1945
|
-
this.updateTabButtons(activeIndex);
|
|
1946
|
-
}
|
|
1947
|
-
// Update the dropdown trigger button text.
|
|
1948
|
-
this.dropdownTriggerButtonText = (_a = this.tabButtons.find((b) => {
|
|
1949
|
-
return this.tabsetService.tabIndexesEqual(b.tabIndex, activeIndex);
|
|
1950
|
-
})) === null || _a === void 0 ? void 0 : _a.buttonText;
|
|
1951
|
-
// Set the query params based on active tab.
|
|
1952
|
-
if (this.permalinkId) {
|
|
1953
|
-
const activeTabComponent = this.tabs.find((tab) => {
|
|
1954
|
-
return this.tabsetService.tabIndexesEqual(tab.tabIndex, activeIndex);
|
|
1955
|
-
});
|
|
1956
|
-
this.permalinkService.setParam(this.permalinkId, activeTabComponent.permalinkValue);
|
|
1957
|
-
}
|
|
1958
|
-
// Wait for tab button view models to render before gauging dimensions.
|
|
1959
|
-
setTimeout(() => {
|
|
1960
|
-
this.adapterService.detectOverflow();
|
|
1961
|
-
});
|
|
1962
|
-
this.changeDetector.markForCheck();
|
|
1963
|
-
// Emit the new active index value to consumers.
|
|
1964
|
-
if (this.lastActiveTabIndex !== activeIndex) {
|
|
1965
|
-
this.lastActiveTabIndex = activeIndex;
|
|
1966
|
-
this.activeChange.emit(activeIndex);
|
|
1967
|
-
}
|
|
1968
|
-
}
|
|
1969
|
-
}
|
|
1970
|
-
_SkyTabsetComponent__hasFinishButton = new WeakMap();
|
|
2247
|
+
};
|
|
1971
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 });
|
|
1972
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: [
|
|
1973
2250
|
SkyTabsetAdapterService,
|
|
1974
2251
|
SkyTabsetPermalinkService,
|
|
1975
2252
|
SkyTabsetService,
|
|
1976
|
-
], 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>\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 [tabStyle]=\"tabStyle\"\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", "tabStyle"], outputs: ["buttonClick", "closeClick"] }, { kind: "pipe", type: i3.SkyLibResourcesPipe, name: "skyLibResources" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
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 });
|
|
1977
2254
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyTabsetComponent, decorators: [{
|
|
1978
2255
|
type: Component,
|
|
1979
2256
|
args: [{ selector: 'sky-tabset', providers: [
|
|
1980
2257
|
SkyTabsetAdapterService,
|
|
1981
2258
|
SkyTabsetPermalinkService,
|
|
1982
2259
|
SkyTabsetService,
|
|
1983
|
-
], 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>\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 [tabStyle]=\"tabStyle\"\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"] }]
|
|
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"] }]
|
|
1984
2261
|
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: SkyTabsetAdapterService }, { type: SkyTabsetPermalinkService }, { type: SkyTabsetService }]; }, propDecorators: { active: [{
|
|
1985
2262
|
type: Input
|
|
1986
2263
|
}], ariaLabel: [{
|
|
@@ -2010,7 +2287,8 @@ SkyTabsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
|
2010
2287
|
SkyTabsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.0", ngImport: i0, type: SkyTabsModule, declarations: [SkyTabButtonComponent,
|
|
2011
2288
|
SkyTabComponent,
|
|
2012
2289
|
SkyTabsetComponent,
|
|
2013
|
-
SkyTabsetNavButtonComponent
|
|
2290
|
+
SkyTabsetNavButtonComponent,
|
|
2291
|
+
SkyTabsetNavButtonDisabledPipe], imports: [CommonModule,
|
|
2014
2292
|
RouterModule,
|
|
2015
2293
|
SkyDropdownModule,
|
|
2016
2294
|
SkyI18nModule,
|
|
@@ -2032,6 +2310,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
|
|
|
2032
2310
|
SkyTabComponent,
|
|
2033
2311
|
SkyTabsetComponent,
|
|
2034
2312
|
SkyTabsetNavButtonComponent,
|
|
2313
|
+
SkyTabsetNavButtonDisabledPipe,
|
|
2035
2314
|
],
|
|
2036
2315
|
imports: [
|
|
2037
2316
|
CommonModule,
|