@skyux/tabs 4.6.9 → 5.0.0-beta.4
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/LICENSE +21 -0
- package/bundles/skyux-tabs-testing.umd.js +324 -221
- package/bundles/skyux-tabs-testing.umd.js.map +1 -1
- package/bundles/skyux-tabs.umd.js +657 -782
- package/bundles/skyux-tabs.umd.js.map +1 -1
- package/documentation.json +5509 -0
- package/esm2015/modules/sectioned-form/sectioned-form-section.component.js +29 -32
- package/esm2015/modules/sectioned-form/sectioned-form.component.js +52 -41
- package/esm2015/modules/sectioned-form/sectioned-form.module.js +30 -19
- package/esm2015/modules/sectioned-form/sectioned-form.service.js +9 -8
- package/esm2015/modules/shared/sky-tabs-resources.module.js +41 -0
- package/esm2015/modules/tabs/tab-button.component.js +41 -47
- package/esm2015/modules/tabs/tab-index.js +2 -1
- package/esm2015/modules/tabs/tab.component.js +31 -41
- package/esm2015/modules/tabs/tabs.module.js +45 -23
- package/esm2015/modules/tabs/tabset-active-tab-unregistered-args.js +2 -1
- package/esm2015/modules/tabs/tabset-adapter.service.js +9 -8
- package/esm2015/modules/tabs/tabset-buttons-display-mode.js +2 -1
- package/esm2015/modules/tabs/tabset-nav-button.component.js +21 -26
- package/esm2015/modules/tabs/tabset-permalink.service.js +11 -15
- package/esm2015/modules/tabs/tabset-style.js +2 -1
- package/esm2015/modules/tabs/tabset-tab-indexes-change.js +2 -1
- package/esm2015/modules/tabs/tabset.component.js +56 -57
- package/esm2015/modules/tabs/tabset.service.js +10 -8
- package/esm2015/modules/vertical-tabset/vertical-tab-media-query.service.js +9 -8
- package/esm2015/modules/vertical-tabset/vertical-tab.component.js +57 -65
- package/esm2015/modules/vertical-tabset/vertical-tabset-adapter.service.js +10 -12
- package/esm2015/modules/vertical-tabset/vertical-tabset-group.component.js +75 -54
- package/esm2015/modules/vertical-tabset/vertical-tabset.component.js +70 -57
- package/esm2015/modules/vertical-tabset/vertical-tabset.module.js +47 -30
- package/esm2015/modules/vertical-tabset/vertical-tabset.service.js +19 -16
- package/esm2015/public-api.js +23 -0
- package/esm2015/skyux-tabs.js +2 -18
- package/esm2015/testing/public-api.js +3 -0
- package/esm2015/testing/skyux-tabs-testing.js +2 -2
- package/esm2015/testing/tabs/tab-fixture-tab.js +2 -1
- package/esm2015/testing/tabs/tabset-fixture.js +1 -1
- package/fesm2015/skyux-tabs-testing.js.map +1 -1
- package/fesm2015/skyux-tabs.js +596 -518
- package/fesm2015/skyux-tabs.js.map +1 -1
- package/modules/sectioned-form/sectioned-form-section.component.d.ts +3 -0
- package/modules/sectioned-form/sectioned-form.component.d.ts +3 -0
- package/modules/sectioned-form/sectioned-form.module.d.ts +9 -0
- package/modules/sectioned-form/sectioned-form.service.d.ts +3 -0
- package/modules/shared/sky-tabs-resources.module.d.ts +14 -0
- package/modules/tabs/tab-button.component.d.ts +4 -1
- package/modules/tabs/tab.component.d.ts +4 -1
- package/modules/tabs/tabs.module.d.ts +15 -0
- package/modules/tabs/tabset-adapter.service.d.ts +3 -0
- package/modules/tabs/tabset-nav-button.component.d.ts +3 -0
- package/modules/tabs/tabset-permalink.service.d.ts +3 -0
- package/modules/tabs/tabset.component.d.ts +4 -1
- package/modules/tabs/tabset.service.d.ts +3 -0
- package/modules/vertical-tabset/vertical-tab-media-query.service.d.ts +3 -0
- package/modules/vertical-tabset/vertical-tab.component.d.ts +3 -0
- package/modules/vertical-tabset/vertical-tabset-adapter.service.d.ts +3 -0
- package/modules/vertical-tabset/vertical-tabset-group.component.d.ts +3 -0
- package/modules/vertical-tabset/vertical-tabset.component.d.ts +3 -0
- package/modules/vertical-tabset/vertical-tabset.module.d.ts +11 -0
- package/modules/vertical-tabset/vertical-tabset.service.d.ts +3 -0
- package/package.json +14 -29
- package/public-api.d.ts +16 -0
- package/skyux-tabs.d.ts +2 -17
- package/testing/package.json +2 -5
- package/testing/{public_api.d.ts → public-api.d.ts} +0 -0
- package/testing/skyux-tabs-testing.d.ts +2 -1
- package/CHANGELOG.md +0 -218
- package/bundles/skyux-tabs-testing.umd.min.js +0 -16
- package/bundles/skyux-tabs-testing.umd.min.js.map +0 -1
- package/bundles/skyux-tabs.umd.min.js +0 -16
- package/bundles/skyux-tabs.umd.min.js.map +0 -1
- package/esm2015/modules/shared/tabs-resources.module.js +0 -17
- package/esm2015/plugin-resources/tabs-resources-provider.js +0 -16
- package/esm2015/public_api.js +0 -10
- package/esm2015/testing/public_api.js +0 -2
- package/esm5/modules/sectioned-form/sectioned-form-section.component.js +0 -84
- package/esm5/modules/sectioned-form/sectioned-form.component.js +0 -111
- package/esm5/modules/sectioned-form/sectioned-form.module.js +0 -31
- package/esm5/modules/sectioned-form/sectioned-form.service.js +0 -35
- package/esm5/modules/shared/tabs-resources.module.js +0 -20
- package/esm5/modules/tabs/tab-button.component.js +0 -72
- package/esm5/modules/tabs/tab-index.js +0 -1
- package/esm5/modules/tabs/tab.component.js +0 -173
- package/esm5/modules/tabs/tabs.module.js +0 -44
- package/esm5/modules/tabs/tabset-active-tab-unregistered-args.js +0 -1
- package/esm5/modules/tabs/tabset-adapter.service.js +0 -58
- package/esm5/modules/tabs/tabset-buttons-display-mode.js +0 -1
- package/esm5/modules/tabs/tabset-nav-button.component.js +0 -145
- package/esm5/modules/tabs/tabset-permalink.service.js +0 -129
- package/esm5/modules/tabs/tabset-style.js +0 -1
- package/esm5/modules/tabs/tabset-tab-indexes-change.js +0 -1
- package/esm5/modules/tabs/tabset.component.js +0 -434
- package/esm5/modules/tabs/tabset.service.js +0 -122
- package/esm5/modules/vertical-tabset/vertical-tab-media-query.service.js +0 -76
- package/esm5/modules/vertical-tabset/vertical-tab.component.js +0 -214
- package/esm5/modules/vertical-tabset/vertical-tabset-adapter.service.js +0 -51
- package/esm5/modules/vertical-tabset/vertical-tabset-group.component.js +0 -119
- package/esm5/modules/vertical-tabset/vertical-tabset.component.js +0 -145
- package/esm5/modules/vertical-tabset/vertical-tabset.module.js +0 -46
- package/esm5/modules/vertical-tabset/vertical-tabset.service.js +0 -176
- package/esm5/plugin-resources/tabs-resources-provider.js +0 -17
- package/esm5/public_api.js +0 -10
- package/esm5/skyux-tabs.js +0 -21
- package/esm5/testing/public_api.js +0 -2
- package/esm5/testing/skyux-tabs-testing.js +0 -5
- package/esm5/testing/tabs/tab-fixture-tab.js +0 -1
- package/esm5/testing/tabs/tabset-fixture.js +0 -168
- package/fesm5/skyux-tabs-testing.js +0 -174
- package/fesm5/skyux-tabs-testing.js.map +0 -1
- package/fesm5/skyux-tabs.js +0 -2182
- package/fesm5/skyux-tabs.js.map +0 -1
- package/modules/shared/tabs-resources.module.d.ts +0 -2
- package/plugin-resources/tabs-resources-provider.d.ts +0 -5
- package/public_api.d.ts +0 -9
- package/skyux-tabs.metadata.json +0 -1
- package/src/assets/img/guidelines/tabs/tabs-anatomy.png +0 -0
- package/src/assets/img/guidelines/tabs/tabs-behavior-1.png +0 -0
- package/src/assets/img/guidelines/tabs/tabs-layout-1.png +0 -0
- package/src/assets/img/guidelines/tabs/tabs-layout-2.png +0 -0
- package/src/assets/img/guidelines/tabs/tabs-layout-3.png +0 -0
- package/src/assets/img/guidelines/tabs/tabs-layout-4.png +0 -0
- package/src/assets/img/guidelines/tabs/tabs-options-1.png +0 -0
- package/src/assets/img/guidelines/tabs/tabs-options-2.png +0 -0
- package/src/assets/img/guidelines/tabs/tabs-state-collapsed-closed.png +0 -0
- package/src/assets/img/guidelines/tabs/tabs-state-collapsed-open.png +0 -0
- package/src/assets/img/guidelines/tabs/tabs-state-hover.png +0 -0
- package/src/assets/img/guidelines/tabs/tabs-state-selected.png +0 -0
- package/src/assets/img/guidelines/tabs/tabs-state-unselected.png +0 -0
- package/src/assets/img/guidelines/tabs/tabs-usage-1.png +0 -0
- package/src/assets/img/guidelines/tabs/tabs-usage-2.png +0 -0
- package/src/assets/img/guidelines/tabs/tabs-usage-3.png +0 -0
- package/src/assets/img/guidelines/tabs/tabs-usage-4.png +0 -0
- package/src/assets/img/guidelines/tabs/tabs-usage-5.png +0 -0
- package/src/assets/img/guidelines/vertical-tabs/vertical-tabs-anatomy-1.png +0 -0
- package/src/assets/img/guidelines/vertical-tabs/vertical-tabs-anatomy-2.png +0 -0
- package/src/assets/img/guidelines/vertical-tabs/vertical-tabs-layout-1.png +0 -0
- package/src/assets/img/guidelines/vertical-tabs/vertical-tabs-state-hover.png +0 -0
- package/src/assets/img/guidelines/vertical-tabs/vertical-tabs-state-selected-group.png +0 -0
- package/src/assets/img/guidelines/vertical-tabs/vertical-tabs-state-selected.png +0 -0
- package/src/assets/img/guidelines/vertical-tabs/vertical-tabs-state-unselected-group.png +0 -0
- package/src/assets/img/guidelines/vertical-tabs/vertical-tabs-state-unselected.png +0 -0
- package/src/assets/img/guidelines/vertical-tabs/vertical-tabs-usage-1.png +0 -0
- package/src/assets/img/guidelines/vertical-tabs/vertical-tabs-usage-2.png +0 -0
- package/src/assets/img/guidelines/vertical-tabs/vertical-tabs-usage-3.png +0 -0
- package/src/assets/img/guidelines/vertical-tabs/vertical-tabs-usage-4.png +0 -0
- package/src/assets/img/guidelines/vertical-tabs/vertical-tabs-usage-5.png +0 -0
- package/src/assets/img/guidelines/vertical-tabs/vertical-tabs-usage-6.png +0 -0
- package/src/assets/img/guidelines/vertical-tabs/vertical-tabs-usage-7.png +0 -0
- package/src/assets/locales/resources_en_US.json +0 -26
- package/testing/skyux-tabs-testing.metadata.json +0 -1
package/fesm5/skyux-tabs.js
DELETED
|
@@ -1,2182 +0,0 @@
|
|
|
1
|
-
import { __decorate } from 'tslib';
|
|
2
|
-
import { Injectable, EventEmitter, ChangeDetectorRef, Input, Output, ViewChild, Component, ChangeDetectionStrategy, RendererFactory2, HostListener, NgModule, ContentChildren, ViewEncapsulation, ElementRef } from '@angular/core';
|
|
3
|
-
import { CommonModule, Location } from '@angular/common';
|
|
4
|
-
import { trigger, transition, style, animate } from '@angular/animations';
|
|
5
|
-
import { BehaviorSubject, Subject, forkJoin, combineLatest, race } from 'rxjs';
|
|
6
|
-
import { takeUntil, take, distinctUntilChanged } from 'rxjs/operators';
|
|
7
|
-
import { SkyMediaBreakpoints, SkyMediaQueryService, SkyMediaQueryModule } from '@skyux/core';
|
|
8
|
-
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
|
9
|
-
import { SkyChevronModule, SkyIconModule, SkyStatusIndicatorModule } from '@skyux/indicators';
|
|
10
|
-
import { SkyThemeModule } from '@skyux/theme';
|
|
11
|
-
import { getStringForLocale, SKY_LIB_RESOURCES_PROVIDERS, SkyLibResourcesService, SkyI18nModule } from '@skyux/i18n';
|
|
12
|
-
import { SkyCheckboxModule } from '@skyux/forms';
|
|
13
|
-
import { ActivatedRoute, Router, RouterModule } from '@angular/router';
|
|
14
|
-
import { SkyDropdownModule } from '@skyux/popovers';
|
|
15
|
-
|
|
16
|
-
var VISIBLE_STATE = 'shown';
|
|
17
|
-
var HIDDEN_STATE = 'void';
|
|
18
|
-
/**
|
|
19
|
-
* @internal
|
|
20
|
-
*/
|
|
21
|
-
var SkyVerticalTabsetService = /** @class */ (function () {
|
|
22
|
-
function SkyVerticalTabsetService(mediaQueryService) {
|
|
23
|
-
var _this = this;
|
|
24
|
-
this.mediaQueryService = mediaQueryService;
|
|
25
|
-
this.activeIndex = undefined;
|
|
26
|
-
this.hidingTabs = new BehaviorSubject(false);
|
|
27
|
-
this.indexChanged = new BehaviorSubject(undefined);
|
|
28
|
-
this.maintainTabContent = false;
|
|
29
|
-
this.showingTabs = new BehaviorSubject(false);
|
|
30
|
-
this.switchingMobile = new Subject();
|
|
31
|
-
this.tabs = [];
|
|
32
|
-
this.tabAdded = new Subject();
|
|
33
|
-
this.tabClicked = new BehaviorSubject(undefined);
|
|
34
|
-
this._contentAdded = false;
|
|
35
|
-
this._tabsVisible = false;
|
|
36
|
-
this._isMobile = false;
|
|
37
|
-
this.mediaQueryService.subscribe(function (breakpoint) {
|
|
38
|
-
var nowMobile = breakpoint === SkyMediaBreakpoints.xs;
|
|
39
|
-
if (nowMobile && !_this._isMobile) {
|
|
40
|
-
// switching to mobile
|
|
41
|
-
_this.switchingMobile.next(true);
|
|
42
|
-
if (!_this._tabsVisible) {
|
|
43
|
-
_this.hidingTabs.next(true);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
else if (!nowMobile && _this._isMobile) {
|
|
47
|
-
// switching to widescreen
|
|
48
|
-
_this.switchingMobile.next(false);
|
|
49
|
-
if (!_this._tabsVisible) {
|
|
50
|
-
_this.showingTabs.next(true);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
_this._isMobile = nowMobile;
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
Object.defineProperty(SkyVerticalTabsetService.prototype, "content", {
|
|
57
|
-
set: function (value) {
|
|
58
|
-
this._content = value;
|
|
59
|
-
},
|
|
60
|
-
enumerable: true,
|
|
61
|
-
configurable: true
|
|
62
|
-
});
|
|
63
|
-
SkyVerticalTabsetService.prototype.addTab = function (tab) {
|
|
64
|
-
var index = this.tabs.length;
|
|
65
|
-
tab.index = index;
|
|
66
|
-
this.tabs.push(tab);
|
|
67
|
-
if (tab.active) {
|
|
68
|
-
this.activateTab(tab);
|
|
69
|
-
}
|
|
70
|
-
this.tabAdded.next(tab);
|
|
71
|
-
};
|
|
72
|
-
SkyVerticalTabsetService.prototype.destroyTab = function (tab) {
|
|
73
|
-
var tabIndex = this.tabs.indexOf(tab);
|
|
74
|
-
if (tabIndex === -1) {
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
if (this.maintainTabContent && tab.contentRendered && this._content) {
|
|
78
|
-
if (this._content.nativeElement.contains(tab.tabContent.nativeElement)) {
|
|
79
|
-
this._content.nativeElement.removeChild(tab.tabContent.nativeElement);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
this.tabs.splice(tabIndex, 1);
|
|
83
|
-
// update tab indices
|
|
84
|
-
this.tabs.forEach(function (tabItem, index) { return tabItem.index = index; });
|
|
85
|
-
if (tab.active) {
|
|
86
|
-
if (!this.maintainTabContent) {
|
|
87
|
-
this.destroyContent();
|
|
88
|
-
}
|
|
89
|
-
// Try selecting the next tab first, and if there's no next tab then
|
|
90
|
-
// try selecting the previous one.
|
|
91
|
-
var newActiveTab = this.tabs[tabIndex] || this.tabs[tabIndex - 1];
|
|
92
|
-
/*istanbul ignore else */
|
|
93
|
-
if (newActiveTab) {
|
|
94
|
-
newActiveTab.activateTab();
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
SkyVerticalTabsetService.prototype.activateTab = function (tab) {
|
|
99
|
-
var _this = this;
|
|
100
|
-
// unactivate active tab
|
|
101
|
-
var activeTab = this.tabs.find(function (t) { return t.index === _this.activeIndex; });
|
|
102
|
-
if (activeTab && activeTab.index !== tab.index) {
|
|
103
|
-
activeTab.active = false;
|
|
104
|
-
activeTab.tabDeactivated();
|
|
105
|
-
}
|
|
106
|
-
this.activeIndex = tab.index;
|
|
107
|
-
this.tabClicked.next(true);
|
|
108
|
-
this.updateTabClicked();
|
|
109
|
-
};
|
|
110
|
-
SkyVerticalTabsetService.prototype.activeTab = function () {
|
|
111
|
-
var _this = this;
|
|
112
|
-
return this.tabs.find(function (t) { return t.index === _this.activeIndex; });
|
|
113
|
-
};
|
|
114
|
-
SkyVerticalTabsetService.prototype.isMobile = function () {
|
|
115
|
-
return this._isMobile;
|
|
116
|
-
};
|
|
117
|
-
SkyVerticalTabsetService.prototype.updateContent = function () {
|
|
118
|
-
var _this = this;
|
|
119
|
-
if (!this.maintainTabContent) {
|
|
120
|
-
if (!this._contentAdded && this.contentVisible()) {
|
|
121
|
-
// content needs to be moved
|
|
122
|
-
this.moveContent();
|
|
123
|
-
}
|
|
124
|
-
else if (this._contentAdded && !this.contentVisible()) {
|
|
125
|
-
// content hidden
|
|
126
|
-
this._contentAdded = false;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
else {
|
|
130
|
-
this.tabs.forEach(function (tab) {
|
|
131
|
-
if (!tab.contentRendered) {
|
|
132
|
-
_this._content.nativeElement.appendChild(tab.tabContent.nativeElement);
|
|
133
|
-
tab.contentRendered = true;
|
|
134
|
-
}
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
};
|
|
138
|
-
SkyVerticalTabsetService.prototype.tabsVisible = function () {
|
|
139
|
-
return !this.isMobile() || this._tabsVisible;
|
|
140
|
-
};
|
|
141
|
-
SkyVerticalTabsetService.prototype.contentVisible = function () {
|
|
142
|
-
return !this.isMobile() || !this._tabsVisible;
|
|
143
|
-
};
|
|
144
|
-
SkyVerticalTabsetService.prototype.showTabs = function () {
|
|
145
|
-
this._tabsVisible = true;
|
|
146
|
-
this._contentAdded = false;
|
|
147
|
-
this.animationTabsVisibleState = VISIBLE_STATE;
|
|
148
|
-
this.animationContentVisibleState = HIDDEN_STATE;
|
|
149
|
-
this.showingTabs.next(true);
|
|
150
|
-
};
|
|
151
|
-
SkyVerticalTabsetService.prototype.destroyContent = function () {
|
|
152
|
-
if (this._content) {
|
|
153
|
-
this._content.nativeElement.innerHTML = '';
|
|
154
|
-
}
|
|
155
|
-
this.content = undefined;
|
|
156
|
-
};
|
|
157
|
-
SkyVerticalTabsetService.prototype.moveContent = function () {
|
|
158
|
-
if (this._content && !this._contentAdded) {
|
|
159
|
-
var activeTab = this.activeTab();
|
|
160
|
-
var activeContent = activeTab ? activeTab.tabContent : undefined;
|
|
161
|
-
if (activeContent && activeContent.nativeElement) {
|
|
162
|
-
this._content.nativeElement.appendChild(activeContent.nativeElement);
|
|
163
|
-
activeTab.contentRendered = true;
|
|
164
|
-
this._contentAdded = true;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
};
|
|
168
|
-
SkyVerticalTabsetService.prototype.updateTabClicked = function () {
|
|
169
|
-
this._contentAdded = false;
|
|
170
|
-
if (this.isMobile()) {
|
|
171
|
-
this._tabsVisible = false;
|
|
172
|
-
this.animationContentVisibleState = VISIBLE_STATE;
|
|
173
|
-
this.animationTabsVisibleState = HIDDEN_STATE;
|
|
174
|
-
this.hidingTabs.next(true);
|
|
175
|
-
}
|
|
176
|
-
this.indexChanged.next(this.activeIndex);
|
|
177
|
-
};
|
|
178
|
-
SkyVerticalTabsetService.ctorParameters = function () { return [
|
|
179
|
-
{ type: SkyMediaQueryService }
|
|
180
|
-
]; };
|
|
181
|
-
SkyVerticalTabsetService = __decorate([
|
|
182
|
-
Injectable()
|
|
183
|
-
], SkyVerticalTabsetService);
|
|
184
|
-
return SkyVerticalTabsetService;
|
|
185
|
-
}());
|
|
186
|
-
|
|
187
|
-
/**
|
|
188
|
-
* Creates a container for the sectioned forms.
|
|
189
|
-
*/
|
|
190
|
-
var SkySectionedFormComponent = /** @class */ (function () {
|
|
191
|
-
function SkySectionedFormComponent(tabService, changeRef) {
|
|
192
|
-
this.tabService = tabService;
|
|
193
|
-
this.changeRef = changeRef;
|
|
194
|
-
/**
|
|
195
|
-
* Indicates whether the sectioned form loads section content during initialization so that it
|
|
196
|
-
* displays content without moving around elements in the content container.
|
|
197
|
-
* @default false
|
|
198
|
-
*/
|
|
199
|
-
this.maintainSectionContent = false;
|
|
200
|
-
/**
|
|
201
|
-
* Fires when the active tab changes and emits the index of the active
|
|
202
|
-
* section. The index is based on the section's position when the form loads.
|
|
203
|
-
*/
|
|
204
|
-
this.indexChanged = new EventEmitter();
|
|
205
|
-
this.isMobile = false;
|
|
206
|
-
this._ngUnsubscribe = new Subject();
|
|
207
|
-
}
|
|
208
|
-
Object.defineProperty(SkySectionedFormComponent.prototype, "ariaRole", {
|
|
209
|
-
get: function () {
|
|
210
|
-
return this.isMobile ? undefined : 'tablist';
|
|
211
|
-
},
|
|
212
|
-
enumerable: true,
|
|
213
|
-
configurable: true
|
|
214
|
-
});
|
|
215
|
-
SkySectionedFormComponent.prototype.ngOnInit = function () {
|
|
216
|
-
var _this = this;
|
|
217
|
-
this.tabService.maintainTabContent = this.maintainSectionContent;
|
|
218
|
-
this.tabService.indexChanged
|
|
219
|
-
.pipe(takeUntil(this._ngUnsubscribe))
|
|
220
|
-
.subscribe(function (index) {
|
|
221
|
-
_this.indexChanged.emit(index);
|
|
222
|
-
_this.changeRef.markForCheck();
|
|
223
|
-
});
|
|
224
|
-
this.tabService.switchingMobile
|
|
225
|
-
.pipe(takeUntil(this._ngUnsubscribe))
|
|
226
|
-
.subscribe(function (mobile) {
|
|
227
|
-
_this.isMobile = mobile;
|
|
228
|
-
_this.changeRef.markForCheck();
|
|
229
|
-
});
|
|
230
|
-
if (this.tabService.isMobile()) {
|
|
231
|
-
this.isMobile = true;
|
|
232
|
-
this.tabService.animationContentVisibleState = VISIBLE_STATE;
|
|
233
|
-
this.changeRef.markForCheck();
|
|
234
|
-
}
|
|
235
|
-
};
|
|
236
|
-
SkySectionedFormComponent.prototype.ngAfterViewChecked = function () {
|
|
237
|
-
this.tabService.content = this.content;
|
|
238
|
-
this.tabService.updateContent();
|
|
239
|
-
};
|
|
240
|
-
SkySectionedFormComponent.prototype.ngOnDestroy = function () {
|
|
241
|
-
this._ngUnsubscribe.next();
|
|
242
|
-
this._ngUnsubscribe.complete();
|
|
243
|
-
};
|
|
244
|
-
SkySectionedFormComponent.prototype.tabsVisible = function () {
|
|
245
|
-
this.changeRef.markForCheck();
|
|
246
|
-
return this.tabService.tabsVisible();
|
|
247
|
-
};
|
|
248
|
-
SkySectionedFormComponent.prototype.showTabs = function () {
|
|
249
|
-
this.tabService.showTabs();
|
|
250
|
-
this.changeRef.markForCheck();
|
|
251
|
-
};
|
|
252
|
-
SkySectionedFormComponent.ctorParameters = function () { return [
|
|
253
|
-
{ type: SkyVerticalTabsetService },
|
|
254
|
-
{ type: ChangeDetectorRef }
|
|
255
|
-
]; };
|
|
256
|
-
__decorate([
|
|
257
|
-
Input()
|
|
258
|
-
], SkySectionedFormComponent.prototype, "maintainSectionContent", void 0);
|
|
259
|
-
__decorate([
|
|
260
|
-
Output()
|
|
261
|
-
], SkySectionedFormComponent.prototype, "indexChanged", void 0);
|
|
262
|
-
__decorate([
|
|
263
|
-
ViewChild('skySectionSideContent')
|
|
264
|
-
], SkySectionedFormComponent.prototype, "content", void 0);
|
|
265
|
-
SkySectionedFormComponent = __decorate([
|
|
266
|
-
Component({
|
|
267
|
-
selector: 'sky-sectioned-form',
|
|
268
|
-
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 sky-padding-even-large\"\n [ngClass]=\"{'sky-sectioned-form-content-hidden': !tabService.contentVisible()}\"\n [@contentEnter]=\"tabService.animationContentVisibleState\"\n #skySectionSideContent\n >\n </div>\n</div>\n\n",
|
|
269
|
-
providers: [SkyVerticalTabsetService],
|
|
270
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
271
|
-
animations: [
|
|
272
|
-
trigger('tabEnter', [
|
|
273
|
-
transition(HIDDEN_STATE + " => " + VISIBLE_STATE, [
|
|
274
|
-
style({ transform: 'translate(-100%)' }),
|
|
275
|
-
animate('150ms ease-in')
|
|
276
|
-
])
|
|
277
|
-
]),
|
|
278
|
-
trigger('contentEnter', [
|
|
279
|
-
transition(HIDDEN_STATE + " => " + VISIBLE_STATE, [
|
|
280
|
-
style({ transform: 'translate(100%)' }),
|
|
281
|
-
animate('150ms ease-in')
|
|
282
|
-
])
|
|
283
|
-
])
|
|
284
|
-
],
|
|
285
|
-
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-lg) .sky-sectioned-form,:host-context(.sky-responsive-container-md) .sky-sectioned-form,:host-context(.sky-responsive-container-sm) .sky-sectioned-form,:host-context(.sky-responsive-container-xs) .sky-sectioned-form{display:block;max-height:none}:host-context(.sky-responsive-container-lg) .sky-sectioned-form-content,:host-context(.sky-responsive-container-md) .sky-sectioned-form-content,:host-context(.sky-responsive-container-sm) .sky-sectioned-form-content,:host-context(.sky-responsive-container-xs) .sky-sectioned-form-content{flex-basis:auto;overflow-y:visible}:host-context(.sky-responsive-container-lg) .sky-sectioned-form-tabs,:host-context(.sky-responsive-container-md) .sky-sectioned-form-tabs,:host-context(.sky-responsive-container-sm) .sky-sectioned-form-tabs,:host-context(.sky-responsive-container-xs) .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%;overflow-y:auto}:host .sky-sectioned-form-tabs{flex-basis:30%;overflow-y:auto}}:host-context(.sky-responsive-container-lg) .sky-sectioned-form,:host-context(.sky-responsive-container-md) .sky-sectioned-form,:host-context(.sky-responsive-container-sm) .sky-sectioned-form{display:flex;max-height:100%}:host-context(.sky-responsive-container-lg) .sky-sectioned-form-content,:host-context(.sky-responsive-container-md) .sky-sectioned-form-content,:host-context(.sky-responsive-container-sm) .sky-sectioned-form-content{flex-basis:70%;overflow-y:auto}:host-context(.sky-responsive-container-lg) .sky-sectioned-form-tabs,:host-context(.sky-responsive-container-md) .sky-sectioned-form-tabs,:host-context(.sky-responsive-container-sm) .sky-sectioned-form-tabs{flex-basis:30%;overflow-y:auto}.sky-sectioned-form-content-hidden,.sky-sectioned-form-tabs-hidden{display:none}"]
|
|
286
|
-
})
|
|
287
|
-
], SkySectionedFormComponent);
|
|
288
|
-
return SkySectionedFormComponent;
|
|
289
|
-
}());
|
|
290
|
-
|
|
291
|
-
/**
|
|
292
|
-
* @internal
|
|
293
|
-
*/
|
|
294
|
-
var SkyVerticalTabMediaQueryService = /** @class */ (function () {
|
|
295
|
-
function SkyVerticalTabMediaQueryService() {
|
|
296
|
-
this.currentSubject = new BehaviorSubject(this.current);
|
|
297
|
-
this._current = SkyMediaBreakpoints.xs;
|
|
298
|
-
this.currentSubject.next(this._current);
|
|
299
|
-
}
|
|
300
|
-
Object.defineProperty(SkyVerticalTabMediaQueryService.prototype, "current", {
|
|
301
|
-
get: function () {
|
|
302
|
-
return this._current;
|
|
303
|
-
},
|
|
304
|
-
enumerable: true,
|
|
305
|
-
configurable: true
|
|
306
|
-
});
|
|
307
|
-
SkyVerticalTabMediaQueryService.prototype.subscribe = function (listener) {
|
|
308
|
-
return this.currentSubject.subscribe({
|
|
309
|
-
next: function (breakpoints) {
|
|
310
|
-
listener(breakpoints);
|
|
311
|
-
}
|
|
312
|
-
});
|
|
313
|
-
};
|
|
314
|
-
SkyVerticalTabMediaQueryService.prototype.setBreakpointForWidth = function (width) {
|
|
315
|
-
var breakpoint;
|
|
316
|
-
if (this.isWidthWithinBreakpiont(width, SkyMediaBreakpoints.xs)) {
|
|
317
|
-
breakpoint = SkyMediaBreakpoints.xs;
|
|
318
|
-
}
|
|
319
|
-
else if (this.isWidthWithinBreakpiont(width, SkyMediaBreakpoints.sm)) {
|
|
320
|
-
breakpoint = SkyMediaBreakpoints.sm;
|
|
321
|
-
}
|
|
322
|
-
else if (this.isWidthWithinBreakpiont(width, SkyMediaBreakpoints.md)) {
|
|
323
|
-
breakpoint = SkyMediaBreakpoints.md;
|
|
324
|
-
}
|
|
325
|
-
else {
|
|
326
|
-
breakpoint = SkyMediaBreakpoints.lg;
|
|
327
|
-
}
|
|
328
|
-
this._current = breakpoint;
|
|
329
|
-
this.currentSubject.next(this._current);
|
|
330
|
-
};
|
|
331
|
-
SkyVerticalTabMediaQueryService.prototype.isWidthWithinBreakpiont = function (width, breakpoint) {
|
|
332
|
-
var xsBreakpointMaxPixels = 767;
|
|
333
|
-
var smBreakpointMinPixels = 768;
|
|
334
|
-
var smBreakpointMaxPixels = 991;
|
|
335
|
-
var mdBreakpointMinPixels = 992;
|
|
336
|
-
var mdBreakpointMaxPixels = 1199;
|
|
337
|
-
var lgBreakpointMinPixels = 1200;
|
|
338
|
-
switch (breakpoint) {
|
|
339
|
-
case SkyMediaBreakpoints.xs: {
|
|
340
|
-
return (width <= xsBreakpointMaxPixels);
|
|
341
|
-
}
|
|
342
|
-
case SkyMediaBreakpoints.sm: {
|
|
343
|
-
return (width >= smBreakpointMinPixels && width <= smBreakpointMaxPixels);
|
|
344
|
-
}
|
|
345
|
-
case SkyMediaBreakpoints.md: {
|
|
346
|
-
return (width >= mdBreakpointMinPixels && width <= mdBreakpointMaxPixels);
|
|
347
|
-
}
|
|
348
|
-
default: {
|
|
349
|
-
return (width >= lgBreakpointMinPixels);
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
};
|
|
353
|
-
SkyVerticalTabMediaQueryService.prototype.destroy = function () {
|
|
354
|
-
this.currentSubject.complete();
|
|
355
|
-
};
|
|
356
|
-
SkyVerticalTabMediaQueryService = __decorate([
|
|
357
|
-
Injectable()
|
|
358
|
-
], SkyVerticalTabMediaQueryService);
|
|
359
|
-
return SkyVerticalTabMediaQueryService;
|
|
360
|
-
}());
|
|
361
|
-
|
|
362
|
-
var SkyVerticalTabsetAdapterService = /** @class */ (function () {
|
|
363
|
-
function SkyVerticalTabsetAdapterService(rendererFactory) {
|
|
364
|
-
this.rendererFactory = rendererFactory;
|
|
365
|
-
this.renderer = this.rendererFactory.createRenderer(undefined, undefined);
|
|
366
|
-
}
|
|
367
|
-
SkyVerticalTabsetAdapterService.prototype.getWidth = function (elementRef) {
|
|
368
|
-
return elementRef.nativeElement.clientWidth;
|
|
369
|
-
};
|
|
370
|
-
SkyVerticalTabsetAdapterService.prototype.scrollToContentTop = function (element) {
|
|
371
|
-
element.nativeElement.scrollTop = 0;
|
|
372
|
-
};
|
|
373
|
-
SkyVerticalTabsetAdapterService.prototype.setResponsiveClass = function (element, breakpoint) {
|
|
374
|
-
var nativeEl = element.nativeElement;
|
|
375
|
-
this.renderer.removeClass(nativeEl, 'sky-responsive-container-xs');
|
|
376
|
-
this.renderer.removeClass(nativeEl, 'sky-responsive-container-sm');
|
|
377
|
-
this.renderer.removeClass(nativeEl, 'sky-responsive-container-md');
|
|
378
|
-
this.renderer.removeClass(nativeEl, 'sky-responsive-container-lg');
|
|
379
|
-
var newClass;
|
|
380
|
-
switch (breakpoint) {
|
|
381
|
-
case SkyMediaBreakpoints.xs: {
|
|
382
|
-
newClass = 'sky-responsive-container-xs';
|
|
383
|
-
break;
|
|
384
|
-
}
|
|
385
|
-
case SkyMediaBreakpoints.sm: {
|
|
386
|
-
newClass = 'sky-responsive-container-sm';
|
|
387
|
-
break;
|
|
388
|
-
}
|
|
389
|
-
case SkyMediaBreakpoints.md: {
|
|
390
|
-
newClass = 'sky-responsive-container-md';
|
|
391
|
-
break;
|
|
392
|
-
}
|
|
393
|
-
default: {
|
|
394
|
-
newClass = 'sky-responsive-container-lg';
|
|
395
|
-
break;
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
|
-
this.renderer.addClass(nativeEl, newClass);
|
|
399
|
-
};
|
|
400
|
-
SkyVerticalTabsetAdapterService.ctorParameters = function () { return [
|
|
401
|
-
{ type: RendererFactory2 }
|
|
402
|
-
]; };
|
|
403
|
-
SkyVerticalTabsetAdapterService = __decorate([
|
|
404
|
-
Injectable()
|
|
405
|
-
], SkyVerticalTabsetAdapterService);
|
|
406
|
-
return SkyVerticalTabsetAdapterService;
|
|
407
|
-
}());
|
|
408
|
-
|
|
409
|
-
var SkyVerticalTabComponent = /** @class */ (function () {
|
|
410
|
-
function SkyVerticalTabComponent(adapterService, changeRef, tabsetService, verticalTabMediaQueryService) {
|
|
411
|
-
this.adapterService = adapterService;
|
|
412
|
-
this.changeRef = changeRef;
|
|
413
|
-
this.tabsetService = tabsetService;
|
|
414
|
-
this.verticalTabMediaQueryService = verticalTabMediaQueryService;
|
|
415
|
-
/**
|
|
416
|
-
* Indicates whether the tab is active when the tabset loads.
|
|
417
|
-
*/
|
|
418
|
-
this.active = false;
|
|
419
|
-
/**
|
|
420
|
-
* Indicates whether to disable the tab.
|
|
421
|
-
*/
|
|
422
|
-
this.disabled = false;
|
|
423
|
-
/**
|
|
424
|
-
* Indicates whether to indicate that the tab has an error.
|
|
425
|
-
* @internal This is used for sectioned forms and is not currently a supported design for pure vertical tabs.
|
|
426
|
-
*/
|
|
427
|
-
this.errorIndicator = false;
|
|
428
|
-
this.isMobile = false;
|
|
429
|
-
this._contentRendered = false;
|
|
430
|
-
this._mobileSubscription = new Subject();
|
|
431
|
-
this._ngUnsubscribe = new Subject();
|
|
432
|
-
this._showTabRightArrow = false;
|
|
433
|
-
}
|
|
434
|
-
Object.defineProperty(SkyVerticalTabComponent.prototype, "ariaControls", {
|
|
435
|
-
/**
|
|
436
|
-
* Specifies the HTML element ID (without the leading `#`) of the element that contains
|
|
437
|
-
* the content that the vertical tab displays, which corresponds to the `tabId`. This property
|
|
438
|
-
* [supports accessibility rules for disclosures](https://www.w3.org/TR/wai-aria-practices-1.1/#disclosure).
|
|
439
|
-
*/
|
|
440
|
-
get: function () {
|
|
441
|
-
return this.isMobile ? undefined : this._ariaControls;
|
|
442
|
-
},
|
|
443
|
-
set: function (value) {
|
|
444
|
-
this._ariaControls = value;
|
|
445
|
-
},
|
|
446
|
-
enumerable: true,
|
|
447
|
-
configurable: true
|
|
448
|
-
});
|
|
449
|
-
Object.defineProperty(SkyVerticalTabComponent.prototype, "ariaRole", {
|
|
450
|
-
/**
|
|
451
|
-
* Specifies an ARIA role for the vertical tab
|
|
452
|
-
* [to support accessibility](https://developer.blackbaud.com/skyux/learn/accessibility)
|
|
453
|
-
* by indicating how the tab functions and what it controls. For information about how
|
|
454
|
-
* an ARIA role indicates what an item represents on a web page, see the
|
|
455
|
-
* [WAI-ARIA roles model](https://www.w3.org/WAI/PF/aria/roles).
|
|
456
|
-
* @default "tab"
|
|
457
|
-
*/
|
|
458
|
-
get: function () {
|
|
459
|
-
if (this.isMobile) {
|
|
460
|
-
return undefined;
|
|
461
|
-
}
|
|
462
|
-
return this._ariaRole || 'tab';
|
|
463
|
-
},
|
|
464
|
-
set: function (value) {
|
|
465
|
-
this._ariaRole = value;
|
|
466
|
-
},
|
|
467
|
-
enumerable: true,
|
|
468
|
-
configurable: true
|
|
469
|
-
});
|
|
470
|
-
Object.defineProperty(SkyVerticalTabComponent.prototype, "showTabRightArrow", {
|
|
471
|
-
/**
|
|
472
|
-
* Indicates whether to display a chevron-right icon in the righthand side of the tab.
|
|
473
|
-
* @internal
|
|
474
|
-
*/
|
|
475
|
-
get: function () {
|
|
476
|
-
return this._showTabRightArrow && this.tabsetService.isMobile();
|
|
477
|
-
},
|
|
478
|
-
set: function (value) {
|
|
479
|
-
this._showTabRightArrow = value;
|
|
480
|
-
},
|
|
481
|
-
enumerable: true,
|
|
482
|
-
configurable: true
|
|
483
|
-
});
|
|
484
|
-
Object.defineProperty(SkyVerticalTabComponent.prototype, "contentRendered", {
|
|
485
|
-
get: function () {
|
|
486
|
-
return this._contentRendered;
|
|
487
|
-
},
|
|
488
|
-
set: function (value) {
|
|
489
|
-
var _this = this;
|
|
490
|
-
this._contentRendered = value;
|
|
491
|
-
if (this._contentRendered) {
|
|
492
|
-
// NOTE: Wrapped in a setTimeout here to ensure that everything has completed rendering.
|
|
493
|
-
setTimeout(function () {
|
|
494
|
-
_this.updateBreakpointAndResponsiveClass(_this.adapterService.getWidth(_this.tabContent));
|
|
495
|
-
});
|
|
496
|
-
}
|
|
497
|
-
},
|
|
498
|
-
enumerable: true,
|
|
499
|
-
configurable: true
|
|
500
|
-
});
|
|
501
|
-
SkyVerticalTabComponent.prototype.ngOnInit = function () {
|
|
502
|
-
var _this = this;
|
|
503
|
-
this.isMobile = this.tabsetService.isMobile();
|
|
504
|
-
this.changeRef.markForCheck();
|
|
505
|
-
this.tabsetService.switchingMobile
|
|
506
|
-
.subscribe(function (mobile) {
|
|
507
|
-
_this.isMobile = mobile;
|
|
508
|
-
_this.changeRef.markForCheck();
|
|
509
|
-
});
|
|
510
|
-
// Update the breakpoint and responsive class here just as a sanity check since we can not
|
|
511
|
-
// watch for element resizing.
|
|
512
|
-
this.tabsetService.indexChanged
|
|
513
|
-
.pipe(takeUntil(this._ngUnsubscribe))
|
|
514
|
-
.subscribe(function (index) {
|
|
515
|
-
if (_this.index === index && _this.contentRendered) {
|
|
516
|
-
_this.updateBreakpointAndResponsiveClass(_this.adapterService.getWidth(_this.tabContent));
|
|
517
|
-
}
|
|
518
|
-
});
|
|
519
|
-
this.tabsetService.addTab(this);
|
|
520
|
-
};
|
|
521
|
-
SkyVerticalTabComponent.prototype.ngOnDestroy = function () {
|
|
522
|
-
this._mobileSubscription.unsubscribe();
|
|
523
|
-
this._ngUnsubscribe.next();
|
|
524
|
-
this._ngUnsubscribe.complete();
|
|
525
|
-
this.tabsetService.destroyTab(this);
|
|
526
|
-
};
|
|
527
|
-
SkyVerticalTabComponent.prototype.tabIndex = function () {
|
|
528
|
-
if (!this.disabled) {
|
|
529
|
-
return 0;
|
|
530
|
-
}
|
|
531
|
-
else {
|
|
532
|
-
return -1;
|
|
533
|
-
}
|
|
534
|
-
};
|
|
535
|
-
SkyVerticalTabComponent.prototype.activateTab = function () {
|
|
536
|
-
if (!this.disabled) {
|
|
537
|
-
this.active = true;
|
|
538
|
-
this.tabsetService.activateTab(this);
|
|
539
|
-
this.changeRef.markForCheck();
|
|
540
|
-
}
|
|
541
|
-
};
|
|
542
|
-
SkyVerticalTabComponent.prototype.onWindowResize = function () {
|
|
543
|
-
this.updateBreakpointAndResponsiveClass(this.adapterService.getWidth(this.tabContent));
|
|
544
|
-
};
|
|
545
|
-
SkyVerticalTabComponent.prototype.tabDeactivated = function () {
|
|
546
|
-
this.changeRef.markForCheck();
|
|
547
|
-
};
|
|
548
|
-
SkyVerticalTabComponent.prototype.updateBreakpointAndResponsiveClass = function (width) {
|
|
549
|
-
this.verticalTabMediaQueryService.setBreakpointForWidth(width);
|
|
550
|
-
var newBreakpiont = this.verticalTabMediaQueryService.current;
|
|
551
|
-
this.adapterService.setResponsiveClass(this.tabContent, newBreakpiont);
|
|
552
|
-
this.changeRef.markForCheck();
|
|
553
|
-
};
|
|
554
|
-
SkyVerticalTabComponent.ctorParameters = function () { return [
|
|
555
|
-
{ type: SkyVerticalTabsetAdapterService },
|
|
556
|
-
{ type: ChangeDetectorRef },
|
|
557
|
-
{ type: SkyVerticalTabsetService },
|
|
558
|
-
{ type: SkyVerticalTabMediaQueryService }
|
|
559
|
-
]; };
|
|
560
|
-
__decorate([
|
|
561
|
-
Input()
|
|
562
|
-
], SkyVerticalTabComponent.prototype, "active", void 0);
|
|
563
|
-
__decorate([
|
|
564
|
-
Input()
|
|
565
|
-
], SkyVerticalTabComponent.prototype, "ariaControls", null);
|
|
566
|
-
__decorate([
|
|
567
|
-
Input()
|
|
568
|
-
], SkyVerticalTabComponent.prototype, "ariaInvalid", void 0);
|
|
569
|
-
__decorate([
|
|
570
|
-
Input()
|
|
571
|
-
], SkyVerticalTabComponent.prototype, "ariaRequired", void 0);
|
|
572
|
-
__decorate([
|
|
573
|
-
Input()
|
|
574
|
-
], SkyVerticalTabComponent.prototype, "ariaRole", null);
|
|
575
|
-
__decorate([
|
|
576
|
-
Input()
|
|
577
|
-
], SkyVerticalTabComponent.prototype, "disabled", void 0);
|
|
578
|
-
__decorate([
|
|
579
|
-
Input()
|
|
580
|
-
], SkyVerticalTabComponent.prototype, "errorIndicator", void 0);
|
|
581
|
-
__decorate([
|
|
582
|
-
Input()
|
|
583
|
-
], SkyVerticalTabComponent.prototype, "tabHeaderCount", void 0);
|
|
584
|
-
__decorate([
|
|
585
|
-
Input()
|
|
586
|
-
], SkyVerticalTabComponent.prototype, "tabHeading", void 0);
|
|
587
|
-
__decorate([
|
|
588
|
-
Input()
|
|
589
|
-
], SkyVerticalTabComponent.prototype, "showTabRightArrow", null);
|
|
590
|
-
__decorate([
|
|
591
|
-
Input()
|
|
592
|
-
], SkyVerticalTabComponent.prototype, "tabId", void 0);
|
|
593
|
-
__decorate([
|
|
594
|
-
ViewChild('tabContentWrapper')
|
|
595
|
-
], SkyVerticalTabComponent.prototype, "tabContent", void 0);
|
|
596
|
-
__decorate([
|
|
597
|
-
HostListener('window:resize')
|
|
598
|
-
], SkyVerticalTabComponent.prototype, "onWindowResize", null);
|
|
599
|
-
SkyVerticalTabComponent = __decorate([
|
|
600
|
-
Component({
|
|
601
|
-
selector: 'sky-vertical-tab',
|
|
602
|
-
template: "<a\n class=\"sky-vertical-tab\"\n [attr.aria-controls]=\"ariaControls\"\n [attr.aria-invalid]=\"ariaInvalid\"\n [attr.aria-required]=\"ariaRequired ? ariaRequired : null\"\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-deemphasized': disabled\n }\"\n [tabIndex]=\"tabIndex()\"\n (click)=\"activateTab()\"\n (keyup.enter)=\"activateTab()\">\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 ({{ tabHeaderCount }})\n </span>\n </div>\n <sky-status-indicator *ngIf=\"errorIndicator\"\n class=\"sky-vertical-tab-heading-error\"\n descriptionType=\"error\"\n indicatorType=\"danger\"\n ></sky-status-indicator>\n\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\n #tabContentWrapper\n>\n <div\n class=\"sky-vertical-tab-content-pane\"\n [ngClass]=\"{'sky-vertical-tab-hidden': !active}\"\n >\n\n <ng-content></ng-content>\n\n <div>\n\n</div>\n\n",
|
|
603
|
-
providers: [
|
|
604
|
-
SkyVerticalTabMediaQueryService,
|
|
605
|
-
{ provide: SkyMediaQueryService, useExisting: SkyVerticalTabMediaQueryService }
|
|
606
|
-
],
|
|
607
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
608
|
-
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{outline:dotted thin;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;font-style:normal}.sky-vertical-tab-right-arrow{padding:3px 10px 0 0;color:#cdcfd2}.sky-theme-modern .sky-vertical-tab,:host-context(.sky-theme-modern) .sky-vertical-tab{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,: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}.sky-theme-modern .sky-vertical-tab:not(:active):focus,:host-context(.sky-theme-modern) .sky-vertical-tab:not(:active):focus{outline:#1870b8 solid 2px;outline-offset:-2px;box-shadow:0 1px 8px 0 rgba(0,0,0,.3)}.sky-theme-modern .sky-vertical-tab:focus:active:hover,:host-context(.sky-theme-modern) .sky-vertical-tab:focus:active:hover{outline:0;background:0 0}.sky-theme-modern .sky-vertical-tab:active,:host-context(.sky-theme-modern) .sky-vertical-tab:active{border-left:3px solid #00b4f1;padding-left:7px}.sky-theme-modern .sky-vertical-tab .sky-vertical-tab-heading-error,:host-context(.sky-theme-modern) .sky-vertical-tab .sky-vertical-tab-heading-error{padding-left:10px}.sky-theme-modern .sky-vertical-tab-active,:host-context(.sky-theme-modern) .sky-vertical-tab-active{background:0 0;padding-left:7px;border-left:3px solid #1870b8}"]
|
|
609
|
-
})
|
|
610
|
-
], SkyVerticalTabComponent);
|
|
611
|
-
return SkyVerticalTabComponent;
|
|
612
|
-
}());
|
|
613
|
-
|
|
614
|
-
var SkySectionedFormService = /** @class */ (function () {
|
|
615
|
-
function SkySectionedFormService() {
|
|
616
|
-
/**
|
|
617
|
-
* @internal
|
|
618
|
-
*/
|
|
619
|
-
this.invalidChange = new BehaviorSubject(undefined);
|
|
620
|
-
/**
|
|
621
|
-
* @internal
|
|
622
|
-
*/
|
|
623
|
-
this.requiredChange = new BehaviorSubject(undefined);
|
|
624
|
-
}
|
|
625
|
-
/**
|
|
626
|
-
* Sets the current section's invalid state based on the `isInvalid` parameter.
|
|
627
|
-
* This method is used within a `sky-sectioned-form-section` element.
|
|
628
|
-
*/
|
|
629
|
-
SkySectionedFormService.prototype.invalidFieldChanged = function (isInvalid) {
|
|
630
|
-
this.invalidChange.next(isInvalid);
|
|
631
|
-
};
|
|
632
|
-
/**
|
|
633
|
-
* Sets the current section's required state based on the `isRequired` parameter.
|
|
634
|
-
* This method is used within a `sky-sectioned-form-section` element.
|
|
635
|
-
*/
|
|
636
|
-
SkySectionedFormService.prototype.requiredFieldChanged = function (isRequired) {
|
|
637
|
-
this.requiredChange.next(isRequired);
|
|
638
|
-
};
|
|
639
|
-
SkySectionedFormService = __decorate([
|
|
640
|
-
Injectable()
|
|
641
|
-
], SkySectionedFormService);
|
|
642
|
-
return SkySectionedFormService;
|
|
643
|
-
}());
|
|
644
|
-
|
|
645
|
-
var nextId = 0;
|
|
646
|
-
/**
|
|
647
|
-
* Creates an individual form to display as a section within the sectioned form.
|
|
648
|
-
*/
|
|
649
|
-
var SkySectionedFormSectionComponent = /** @class */ (function () {
|
|
650
|
-
function SkySectionedFormSectionComponent(sectionedFormService, tabsetService, changeRef) {
|
|
651
|
-
this.sectionedFormService = sectionedFormService;
|
|
652
|
-
this.tabsetService = tabsetService;
|
|
653
|
-
this.changeRef = changeRef;
|
|
654
|
-
this.sectionTabId = "sky-sectioned-form-tab-" + ++nextId;
|
|
655
|
-
this.sectionContentId = "sky-sectioned-form-section-" + ++nextId;
|
|
656
|
-
this.isMobile = false;
|
|
657
|
-
this._ngUnsubscribe = new Subject();
|
|
658
|
-
}
|
|
659
|
-
Object.defineProperty(SkySectionedFormSectionComponent.prototype, "ariaRole", {
|
|
660
|
-
get: function () {
|
|
661
|
-
return this.isMobile ? undefined : 'tabpanel';
|
|
662
|
-
},
|
|
663
|
-
enumerable: true,
|
|
664
|
-
configurable: true
|
|
665
|
-
});
|
|
666
|
-
Object.defineProperty(SkySectionedFormSectionComponent.prototype, "ariaLabelledby", {
|
|
667
|
-
get: function () {
|
|
668
|
-
return this.isMobile ? undefined : this.sectionTabId;
|
|
669
|
-
},
|
|
670
|
-
enumerable: true,
|
|
671
|
-
configurable: true
|
|
672
|
-
});
|
|
673
|
-
SkySectionedFormSectionComponent.prototype.ngOnInit = function () {
|
|
674
|
-
var _this = this;
|
|
675
|
-
this.isMobile = this.tabsetService.isMobile();
|
|
676
|
-
this.changeRef.detectChanges();
|
|
677
|
-
this.tabsetService.switchingMobile
|
|
678
|
-
.subscribe(function (mobile) {
|
|
679
|
-
_this.isMobile = mobile;
|
|
680
|
-
_this.changeRef.detectChanges();
|
|
681
|
-
});
|
|
682
|
-
this.sectionedFormService.requiredChange
|
|
683
|
-
.pipe(takeUntil(this._ngUnsubscribe))
|
|
684
|
-
.subscribe(function (required) { return _this.fieldRequired = required; });
|
|
685
|
-
this.sectionedFormService.invalidChange
|
|
686
|
-
.pipe(takeUntil(this._ngUnsubscribe))
|
|
687
|
-
.subscribe(function (invalid) { return _this.fieldInvalid = invalid; });
|
|
688
|
-
};
|
|
689
|
-
SkySectionedFormSectionComponent.prototype.ngOnDestroy = function () {
|
|
690
|
-
this._ngUnsubscribe.next();
|
|
691
|
-
this._ngUnsubscribe.complete();
|
|
692
|
-
};
|
|
693
|
-
SkySectionedFormSectionComponent.ctorParameters = function () { return [
|
|
694
|
-
{ type: SkySectionedFormService },
|
|
695
|
-
{ type: SkyVerticalTabsetService },
|
|
696
|
-
{ type: ChangeDetectorRef }
|
|
697
|
-
]; };
|
|
698
|
-
__decorate([
|
|
699
|
-
Input()
|
|
700
|
-
], SkySectionedFormSectionComponent.prototype, "heading", void 0);
|
|
701
|
-
__decorate([
|
|
702
|
-
Input()
|
|
703
|
-
], SkySectionedFormSectionComponent.prototype, "itemCount", void 0);
|
|
704
|
-
__decorate([
|
|
705
|
-
Input()
|
|
706
|
-
], SkySectionedFormSectionComponent.prototype, "active", void 0);
|
|
707
|
-
__decorate([
|
|
708
|
-
ViewChild(SkyVerticalTabComponent)
|
|
709
|
-
], SkySectionedFormSectionComponent.prototype, "tab", void 0);
|
|
710
|
-
SkySectionedFormSectionComponent = __decorate([
|
|
711
|
-
Component({
|
|
712
|
-
selector: 'sky-sectioned-form-section',
|
|
713
|
-
template: "<sky-vertical-tab\n [active]=\"active\"\n [ariaControls]=\"sectionContentId\"\n [ariaInvalid]=\"fieldInvalid\"\n [ariaRequired]=\"fieldRequired\"\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 <div\n [attr.aria-labelledby]=\"ariaLabelledby\"\n [attr.role]=\"ariaRole\"\n [id]=\"sectionContentId\"\n #tabContent>\n <ng-content></ng-content>\n </div>\n</sky-vertical-tab>\n",
|
|
714
|
-
providers: [SkySectionedFormService],
|
|
715
|
-
styles: [":host .sky-tab-field-required ::ng-deep .sky-vertical-tab-heading:after{content:\"*\";color:#ef4044;padding-left:5px}"]
|
|
716
|
-
})
|
|
717
|
-
], SkySectionedFormSectionComponent);
|
|
718
|
-
return SkySectionedFormSectionComponent;
|
|
719
|
-
}());
|
|
720
|
-
|
|
721
|
-
var SkyTabsResourcesProvider = /** @class */ (function () {
|
|
722
|
-
function SkyTabsResourcesProvider() {
|
|
723
|
-
this.resources = { "EN-US": { "skyux_tab_add": "Add tab", "skyux_tab_close": "Close {0} tab", "skyux_tabs_navigator_next": "Next", "skyux_tabs_navigator_previous": "Previous", "skyux_tab_open": "Open tab", "skyux_vertical_tabs_show_tabs_text": "Tab list" } };
|
|
724
|
-
}
|
|
725
|
-
SkyTabsResourcesProvider.prototype.getString = function (localeInfo, name) {
|
|
726
|
-
return getStringForLocale(this.resources, localeInfo.locale, name);
|
|
727
|
-
};
|
|
728
|
-
SkyTabsResourcesProvider = __decorate([
|
|
729
|
-
Injectable()
|
|
730
|
-
], SkyTabsResourcesProvider);
|
|
731
|
-
return SkyTabsResourcesProvider;
|
|
732
|
-
}());
|
|
733
|
-
|
|
734
|
-
var SkyTabsResourcesModule = /** @class */ (function () {
|
|
735
|
-
function SkyTabsResourcesModule() {
|
|
736
|
-
}
|
|
737
|
-
SkyTabsResourcesModule = __decorate([
|
|
738
|
-
NgModule({
|
|
739
|
-
providers: [{
|
|
740
|
-
provide: SKY_LIB_RESOURCES_PROVIDERS,
|
|
741
|
-
useClass: SkyTabsResourcesProvider,
|
|
742
|
-
multi: true
|
|
743
|
-
}]
|
|
744
|
-
})
|
|
745
|
-
], SkyTabsResourcesModule);
|
|
746
|
-
return SkyTabsResourcesModule;
|
|
747
|
-
}());
|
|
748
|
-
|
|
749
|
-
var SkyVerticalTabsetComponent = /** @class */ (function () {
|
|
750
|
-
function SkyVerticalTabsetComponent(adapterService, tabService, resources, changeRef) {
|
|
751
|
-
this.adapterService = adapterService;
|
|
752
|
-
this.tabService = tabService;
|
|
753
|
-
this.resources = resources;
|
|
754
|
-
this.changeRef = changeRef;
|
|
755
|
-
/**
|
|
756
|
-
* Indicates whether the vertical tabset loads tab content during initialization so that it
|
|
757
|
-
* displays content without moving around elements in the content container.
|
|
758
|
-
* @default 'false'
|
|
759
|
-
*/
|
|
760
|
-
this.maintainTabContent = false;
|
|
761
|
-
/**
|
|
762
|
-
* Fires when the active tab changes. Emits the index of the active tab. The
|
|
763
|
-
* index is based on the tab's position when it loads.
|
|
764
|
-
*/
|
|
765
|
-
this.activeChange = new EventEmitter();
|
|
766
|
-
this.isMobile = false;
|
|
767
|
-
this._ngUnsubscribe = new Subject();
|
|
768
|
-
}
|
|
769
|
-
Object.defineProperty(SkyVerticalTabsetComponent.prototype, "ariaRole", {
|
|
770
|
-
/**
|
|
771
|
-
* Specifies an ARIA role for the vertical tabset
|
|
772
|
-
* [to support accessibility](https://developer.blackbaud.com/skyux/learn/accessibility)
|
|
773
|
-
* by indicating how the tabset functions and what it controls. For information about how
|
|
774
|
-
* an ARIA role indicates what an item represents on a web page, see the
|
|
775
|
-
* [WAI-ARIA roles model](https://www.w3.org/WAI/PF/aria/roles).
|
|
776
|
-
* @default "tablist"
|
|
777
|
-
*/
|
|
778
|
-
get: function () {
|
|
779
|
-
if (this.isMobile) {
|
|
780
|
-
return undefined;
|
|
781
|
-
}
|
|
782
|
-
return this._ariaRole || 'tablist';
|
|
783
|
-
},
|
|
784
|
-
set: function (value) {
|
|
785
|
-
this._ariaRole = value;
|
|
786
|
-
},
|
|
787
|
-
enumerable: true,
|
|
788
|
-
configurable: true
|
|
789
|
-
});
|
|
790
|
-
SkyVerticalTabsetComponent.prototype.ngOnInit = function () {
|
|
791
|
-
var _this = this;
|
|
792
|
-
this.tabService.maintainTabContent = this.maintainTabContent;
|
|
793
|
-
this.tabService.indexChanged
|
|
794
|
-
.pipe(takeUntil(this._ngUnsubscribe))
|
|
795
|
-
.subscribe(function (index) {
|
|
796
|
-
_this.activeChange.emit(index);
|
|
797
|
-
if (_this.contentWrapper) {
|
|
798
|
-
_this.adapterService.scrollToContentTop(_this.contentWrapper);
|
|
799
|
-
}
|
|
800
|
-
_this.changeRef.markForCheck();
|
|
801
|
-
});
|
|
802
|
-
this.tabService.switchingMobile
|
|
803
|
-
.pipe(takeUntil(this._ngUnsubscribe))
|
|
804
|
-
.subscribe(function (mobile) {
|
|
805
|
-
_this.isMobile = mobile;
|
|
806
|
-
_this.changeRef.markForCheck();
|
|
807
|
-
});
|
|
808
|
-
if (this.tabService.isMobile()) {
|
|
809
|
-
this.isMobile = true;
|
|
810
|
-
this.tabService.animationContentVisibleState = VISIBLE_STATE;
|
|
811
|
-
this.changeRef.markForCheck();
|
|
812
|
-
}
|
|
813
|
-
if (!this.showTabsText) {
|
|
814
|
-
this.resources.getString('skyux_vertical_tabs_show_tabs_text')
|
|
815
|
-
.pipe(take(1))
|
|
816
|
-
.subscribe(function (resource) {
|
|
817
|
-
/* sanity check */
|
|
818
|
-
if (!_this.showTabsText) {
|
|
819
|
-
_this.showTabsText = resource;
|
|
820
|
-
}
|
|
821
|
-
});
|
|
822
|
-
}
|
|
823
|
-
};
|
|
824
|
-
SkyVerticalTabsetComponent.prototype.ngAfterViewChecked = function () {
|
|
825
|
-
this.tabService.content = this.content;
|
|
826
|
-
this.tabService.updateContent();
|
|
827
|
-
};
|
|
828
|
-
SkyVerticalTabsetComponent.prototype.ngOnDestroy = function () {
|
|
829
|
-
this._ngUnsubscribe.next();
|
|
830
|
-
this._ngUnsubscribe.complete();
|
|
831
|
-
};
|
|
832
|
-
SkyVerticalTabsetComponent.ctorParameters = function () { return [
|
|
833
|
-
{ type: SkyVerticalTabsetAdapterService },
|
|
834
|
-
{ type: SkyVerticalTabsetService },
|
|
835
|
-
{ type: SkyLibResourcesService },
|
|
836
|
-
{ type: ChangeDetectorRef }
|
|
837
|
-
]; };
|
|
838
|
-
__decorate([
|
|
839
|
-
Input()
|
|
840
|
-
], SkyVerticalTabsetComponent.prototype, "showTabsText", void 0);
|
|
841
|
-
__decorate([
|
|
842
|
-
Input()
|
|
843
|
-
], SkyVerticalTabsetComponent.prototype, "ariaRole", null);
|
|
844
|
-
__decorate([
|
|
845
|
-
Input()
|
|
846
|
-
], SkyVerticalTabsetComponent.prototype, "maintainTabContent", void 0);
|
|
847
|
-
__decorate([
|
|
848
|
-
Output()
|
|
849
|
-
], SkyVerticalTabsetComponent.prototype, "activeChange", void 0);
|
|
850
|
-
__decorate([
|
|
851
|
-
ViewChild('groupContainerWrapper')
|
|
852
|
-
], SkyVerticalTabsetComponent.prototype, "tabGroups", void 0);
|
|
853
|
-
__decorate([
|
|
854
|
-
ViewChild('skySideContent')
|
|
855
|
-
], SkyVerticalTabsetComponent.prototype, "content", void 0);
|
|
856
|
-
__decorate([
|
|
857
|
-
ViewChild('contentContainerWrapper')
|
|
858
|
-
], SkyVerticalTabsetComponent.prototype, "contentWrapper", void 0);
|
|
859
|
-
SkyVerticalTabsetComponent = __decorate([
|
|
860
|
-
Component({
|
|
861
|
-
selector: 'sky-vertical-tabset',
|
|
862
|
-
template: " <div class=\"sky-vertical-tabset\" (window:resize)=\"tabService.updateContent()\">\n <div\n *ngIf=\"maintainTabContent || tabService.tabsVisible()\"\n #groupContainerWrapper\n class=\"sky-vertical-tabset-group-container\"\n [ngClass]=\"{'sky-vertical-tabset-hidden': !tabService.tabsVisible()}\"\n [attr.role]=\"ariaRole\"\n [@tabGroupEnter]=\"tabService.animationTabsVisibleState\"\n >\n <ng-content></ng-content>\n </div>\n <div\n *ngIf=\"maintainTabContent || tabService.contentVisible()\"\n class=\"sky-vertical-tabset-content\"\n [ngClass]=\"{'sky-vertical-tabset-content-hidden': !tabService.contentVisible()}\"\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",
|
|
863
|
-
providers: [SkyVerticalTabsetService],
|
|
864
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
865
|
-
animations: [
|
|
866
|
-
trigger('tabGroupEnter', [
|
|
867
|
-
transition(HIDDEN_STATE + " => " + VISIBLE_STATE, [
|
|
868
|
-
style({ transform: 'translate(-100%)' }),
|
|
869
|
-
animate('150ms ease-in')
|
|
870
|
-
])
|
|
871
|
-
]),
|
|
872
|
-
trigger('contentEnter', [
|
|
873
|
-
transition(HIDDEN_STATE + " => " + VISIBLE_STATE, [
|
|
874
|
-
style({ transform: 'translate(100%)' }),
|
|
875
|
-
animate('150ms ease-in')
|
|
876
|
-
])
|
|
877
|
-
])
|
|
878
|
-
],
|
|
879
|
-
styles: [":host .sky-vertical-tabset{display:block;height:auto}:host .sky-vertical-tabset-group-container{border-right:none}:host-context(.sky-responsive-container-lg) .sky-vertical-tabset,:host-context(.sky-responsive-container-md) .sky-vertical-tabset,:host-context(.sky-responsive-container-sm) .sky-vertical-tabset,:host-context(.sky-responsive-container-xs) .sky-vertical-tabset{display:block;height:auto}:host-context(.sky-responsive-container-lg) .sky-vertical-tabset-group-container,:host-context(.sky-responsive-container-md) .sky-vertical-tabset-group-container,:host-context(.sky-responsive-container-sm) .sky-vertical-tabset-group-container,:host-context(.sky-responsive-container-xs) .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-lg) .sky-vertical-tabset,:host-context(.sky-responsive-container-md) .sky-vertical-tabset,:host-context(.sky-responsive-container-sm) .sky-vertical-tabset{display:flex;height:100%}:host-context(.sky-responsive-container-lg) .sky-vertical-tabset-group-container,:host-context(.sky-responsive-container-md) .sky-vertical-tabset-group-container,:host-context(.sky-responsive-container-sm) .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}"]
|
|
880
|
-
})
|
|
881
|
-
], SkyVerticalTabsetComponent);
|
|
882
|
-
return SkyVerticalTabsetComponent;
|
|
883
|
-
}());
|
|
884
|
-
|
|
885
|
-
var SkyVerticalTabsetGroupComponent = /** @class */ (function () {
|
|
886
|
-
function SkyVerticalTabsetGroupComponent(tabService, changeRef) {
|
|
887
|
-
var _this = this;
|
|
888
|
-
this.tabService = tabService;
|
|
889
|
-
this.changeRef = changeRef;
|
|
890
|
-
this.ngUnsubscribe = new Subject();
|
|
891
|
-
this.openBeforeTabsHidden = false;
|
|
892
|
-
this._open = false;
|
|
893
|
-
this.tabClicked = function () {
|
|
894
|
-
_this.changeRef.markForCheck();
|
|
895
|
-
};
|
|
896
|
-
this.tabsHidden = function () {
|
|
897
|
-
// this fixes an animation bug with ngIf when the parent component goes from visible to hidden
|
|
898
|
-
_this.openBeforeTabsHidden = _this.open;
|
|
899
|
-
_this.open = false;
|
|
900
|
-
_this.changeRef.markForCheck();
|
|
901
|
-
};
|
|
902
|
-
this.tabsShown = function () {
|
|
903
|
-
_this.open = _this.openBeforeTabsHidden;
|
|
904
|
-
_this.changeRef.markForCheck();
|
|
905
|
-
};
|
|
906
|
-
}
|
|
907
|
-
Object.defineProperty(SkyVerticalTabsetGroupComponent.prototype, "open", {
|
|
908
|
-
get: function () {
|
|
909
|
-
return !this.disabled && this._open;
|
|
910
|
-
},
|
|
911
|
-
/**
|
|
912
|
-
* Indicates whether the collapsible group is expanded.
|
|
913
|
-
* @default "false"
|
|
914
|
-
*/
|
|
915
|
-
set: function (value) {
|
|
916
|
-
this._open = value;
|
|
917
|
-
},
|
|
918
|
-
enumerable: true,
|
|
919
|
-
configurable: true
|
|
920
|
-
});
|
|
921
|
-
SkyVerticalTabsetGroupComponent.prototype.ngOnInit = function () {
|
|
922
|
-
this.tabService.hidingTabs
|
|
923
|
-
.pipe(takeUntil(this.ngUnsubscribe))
|
|
924
|
-
.subscribe(this.tabsHidden);
|
|
925
|
-
this.tabService.showingTabs
|
|
926
|
-
.pipe(takeUntil(this.ngUnsubscribe))
|
|
927
|
-
.subscribe(this.tabsShown);
|
|
928
|
-
this.tabService.tabClicked
|
|
929
|
-
.pipe(takeUntil(this.ngUnsubscribe))
|
|
930
|
-
.subscribe(this.tabClicked);
|
|
931
|
-
};
|
|
932
|
-
SkyVerticalTabsetGroupComponent.prototype.ngOnDestroy = function () {
|
|
933
|
-
this.ngUnsubscribe.next();
|
|
934
|
-
this.ngUnsubscribe.complete();
|
|
935
|
-
};
|
|
936
|
-
SkyVerticalTabsetGroupComponent.prototype.toggleMenuOpen = function () {
|
|
937
|
-
if (!this.disabled) {
|
|
938
|
-
this.open = !this.open;
|
|
939
|
-
}
|
|
940
|
-
this.changeRef.markForCheck();
|
|
941
|
-
};
|
|
942
|
-
SkyVerticalTabsetGroupComponent.prototype.subMenuOpen = function () {
|
|
943
|
-
return this.tabs && (this.tabs.find(function (t) { return t.active; }) !== undefined);
|
|
944
|
-
};
|
|
945
|
-
SkyVerticalTabsetGroupComponent.ctorParameters = function () { return [
|
|
946
|
-
{ type: SkyVerticalTabsetService },
|
|
947
|
-
{ type: ChangeDetectorRef }
|
|
948
|
-
]; };
|
|
949
|
-
__decorate([
|
|
950
|
-
Input()
|
|
951
|
-
], SkyVerticalTabsetGroupComponent.prototype, "disabled", void 0);
|
|
952
|
-
__decorate([
|
|
953
|
-
Input()
|
|
954
|
-
], SkyVerticalTabsetGroupComponent.prototype, "groupHeading", void 0);
|
|
955
|
-
__decorate([
|
|
956
|
-
Input()
|
|
957
|
-
], SkyVerticalTabsetGroupComponent.prototype, "open", null);
|
|
958
|
-
__decorate([
|
|
959
|
-
ContentChildren(SkyVerticalTabComponent)
|
|
960
|
-
], SkyVerticalTabsetGroupComponent.prototype, "tabs", void 0);
|
|
961
|
-
SkyVerticalTabsetGroupComponent = __decorate([
|
|
962
|
-
Component({
|
|
963
|
-
selector: 'sky-vertical-tabset-group',
|
|
964
|
-
template: "<div class=\"sky-vertical-tabset-group\">\n <div\n class=\"sky-vertical-tabset-group-header sky-padding-even-default\"\n [ngClass]=\"{\n 'sky-vertical-tabset-group-header-sub-open sky-emphasized': subMenuOpen(),\n 'sky-deemphasized': disabled,\n 'sky-vertical-tabset-disabled': disabled\n }\"\n (click)=\"toggleMenuOpen()\"\n (keyup.enter)=\"toggleMenuOpen()\"\n [tabIndex]=\"-1\"\n >\n {{ groupHeading }}\n <sky-chevron *skyThemeIf=\"'default'\"\n class=\"sky-vertical-tabset-group-header-chevron\"\n [direction]=\"open ? 'up' : 'down'\"\n [disabled]=\"disabled\"\n (directionChange)=\"toggleMenuOpen()\"\n (keyup.enter)=\"$event.stopPropagation()\"\n >\n </sky-chevron>\n <ng-container *skyThemeIf=\"'modern'\">\n <button *ngIf=\"!open\"\n class=\"sky-btn sky-btn-icon-borderless sky-vertical-tabset-group-header-chevron\"\n type=\"button\"\n >\n <sky-icon\n icon=\"chevron-right\"\n iconType=\"skyux\"\n >\n </sky-icon>\n </button>\n <button *ngIf=\"open\"\n class=\"sky-btn sky-btn-icon-borderless sky-vertical-tabset-group-header-chevron\"\n type=\"button\"\n >\n <sky-icon\n icon=\"chevron-down\"\n iconType=\"skyux\"\n >\n </sky-icon>\n </button>\n </ng-container>\n </div>\n <div\n class=\"sky-vertical-tabset-group-content\"\n *ngIf=\"open\"\n [@tabSlide]\n >\n <ng-content></ng-content>\n </div>\n</div>\n",
|
|
965
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
966
|
-
animations: [
|
|
967
|
-
trigger('tabSlide', [
|
|
968
|
-
transition(':enter', [
|
|
969
|
-
style({
|
|
970
|
-
height: '0',
|
|
971
|
-
visibility: 'hidden'
|
|
972
|
-
}),
|
|
973
|
-
animate('150ms ease-in', style({
|
|
974
|
-
height: '*',
|
|
975
|
-
visibility: 'visible'
|
|
976
|
-
}))
|
|
977
|
-
]),
|
|
978
|
-
transition(':leave', [
|
|
979
|
-
style({
|
|
980
|
-
height: '*',
|
|
981
|
-
visibility: 'visible'
|
|
982
|
-
}),
|
|
983
|
-
animate('150ms ease-in', style({
|
|
984
|
-
height: '0',
|
|
985
|
-
visibility: 'hidden'
|
|
986
|
-
}))
|
|
987
|
-
])
|
|
988
|
-
])
|
|
989
|
-
],
|
|
990
|
-
styles: [".sky-vertical-tabset-group{border-bottom:1px solid #e2e3e4;margin:5px 0 5px 5px}.sky-vertical-tabset-group-header{cursor:pointer;display:flex;justify-content:space-between}.sky-vertical-tabset-group-header:focus{outline:dotted thin;outline:-webkit-focus-ring-color auto 5px}.sky-vertical-tabset-group-content{overflow:hidden;border-top:1px solid #e2e3e4}:host ::ng-deep .sky-vertical-tabset-group-header-chevron>button{font-size:14px!important}.sky-vertical-tabset-disabled{cursor:not-allowed;pointer-events:none;font-style:normal}.sky-theme-modern .sky-vertical-tabset-group,:host-context(.sky-theme-modern) .sky-vertical-tabset-group{border:none}.sky-theme-modern .sky-vertical-tabset-group-content,:host-context(.sky-theme-modern) .sky-vertical-tabset-group-content{border:none;padding-left:25px}.sky-theme-modern .sky-vertical-tabset-group-header,:host-context(.sky-theme-modern) .sky-vertical-tabset-group-header{position:relative}.sky-theme-modern .sky-vertical-tabset-group-header-chevron,:host-context(.sky-theme-modern) .sky-vertical-tabset-group-header-chevron{position:absolute;top:6px;right:5px}"]
|
|
991
|
-
})
|
|
992
|
-
], SkyVerticalTabsetGroupComponent);
|
|
993
|
-
return SkyVerticalTabsetGroupComponent;
|
|
994
|
-
}());
|
|
995
|
-
|
|
996
|
-
var SkyVerticalTabsetModule = /** @class */ (function () {
|
|
997
|
-
function SkyVerticalTabsetModule() {
|
|
998
|
-
}
|
|
999
|
-
SkyVerticalTabsetModule = __decorate([
|
|
1000
|
-
NgModule({
|
|
1001
|
-
declarations: [
|
|
1002
|
-
SkyVerticalTabsetComponent,
|
|
1003
|
-
SkyVerticalTabsetGroupComponent,
|
|
1004
|
-
SkyVerticalTabComponent
|
|
1005
|
-
],
|
|
1006
|
-
imports: [
|
|
1007
|
-
CommonModule,
|
|
1008
|
-
BrowserAnimationsModule,
|
|
1009
|
-
SkyChevronModule,
|
|
1010
|
-
SkyIconModule,
|
|
1011
|
-
SkyMediaQueryModule,
|
|
1012
|
-
SkyStatusIndicatorModule,
|
|
1013
|
-
SkyTabsResourcesModule,
|
|
1014
|
-
SkyThemeModule
|
|
1015
|
-
],
|
|
1016
|
-
providers: [
|
|
1017
|
-
SkyVerticalTabsetAdapterService
|
|
1018
|
-
],
|
|
1019
|
-
exports: [
|
|
1020
|
-
SkyVerticalTabsetComponent,
|
|
1021
|
-
SkyVerticalTabsetGroupComponent,
|
|
1022
|
-
SkyVerticalTabComponent
|
|
1023
|
-
]
|
|
1024
|
-
})
|
|
1025
|
-
], SkyVerticalTabsetModule);
|
|
1026
|
-
return SkyVerticalTabsetModule;
|
|
1027
|
-
}());
|
|
1028
|
-
|
|
1029
|
-
var SkySectionedFormModule = /** @class */ (function () {
|
|
1030
|
-
function SkySectionedFormModule() {
|
|
1031
|
-
}
|
|
1032
|
-
SkySectionedFormModule = __decorate([
|
|
1033
|
-
NgModule({
|
|
1034
|
-
declarations: [
|
|
1035
|
-
SkySectionedFormComponent,
|
|
1036
|
-
SkySectionedFormSectionComponent
|
|
1037
|
-
],
|
|
1038
|
-
imports: [
|
|
1039
|
-
CommonModule,
|
|
1040
|
-
SkyCheckboxModule,
|
|
1041
|
-
SkyVerticalTabsetModule
|
|
1042
|
-
],
|
|
1043
|
-
exports: [
|
|
1044
|
-
SkySectionedFormComponent,
|
|
1045
|
-
SkySectionedFormSectionComponent
|
|
1046
|
-
]
|
|
1047
|
-
})
|
|
1048
|
-
], SkySectionedFormModule);
|
|
1049
|
-
return SkySectionedFormModule;
|
|
1050
|
-
}());
|
|
1051
|
-
|
|
1052
|
-
/**
|
|
1053
|
-
* @internal
|
|
1054
|
-
*/
|
|
1055
|
-
var SkyTabButtonComponent = /** @class */ (function () {
|
|
1056
|
-
function SkyTabButtonComponent() {
|
|
1057
|
-
this.buttonClick = new EventEmitter();
|
|
1058
|
-
this.closeClick = new EventEmitter();
|
|
1059
|
-
}
|
|
1060
|
-
SkyTabButtonComponent.prototype.onButtonClick = function (event) {
|
|
1061
|
-
if (!this.disabled) {
|
|
1062
|
-
this.buttonClick.emit();
|
|
1063
|
-
event.preventDefault();
|
|
1064
|
-
}
|
|
1065
|
-
};
|
|
1066
|
-
SkyTabButtonComponent.prototype.onButtonEnterKeyDown = function (event) {
|
|
1067
|
-
this.onButtonClick(event);
|
|
1068
|
-
};
|
|
1069
|
-
SkyTabButtonComponent.prototype.onCloseClick = function (event) {
|
|
1070
|
-
this.closeClick.emit();
|
|
1071
|
-
// Prevent the click event from bubbling up to the anchor tag;
|
|
1072
|
-
// otherwise it will trigger a page refresh.
|
|
1073
|
-
event.stopPropagation();
|
|
1074
|
-
event.preventDefault();
|
|
1075
|
-
};
|
|
1076
|
-
__decorate([
|
|
1077
|
-
Input()
|
|
1078
|
-
], SkyTabButtonComponent.prototype, "active", void 0);
|
|
1079
|
-
__decorate([
|
|
1080
|
-
Input()
|
|
1081
|
-
], SkyTabButtonComponent.prototype, "ariaControls", void 0);
|
|
1082
|
-
__decorate([
|
|
1083
|
-
Input()
|
|
1084
|
-
], SkyTabButtonComponent.prototype, "buttonHref", void 0);
|
|
1085
|
-
__decorate([
|
|
1086
|
-
Input()
|
|
1087
|
-
], SkyTabButtonComponent.prototype, "buttonId", void 0);
|
|
1088
|
-
__decorate([
|
|
1089
|
-
Input()
|
|
1090
|
-
], SkyTabButtonComponent.prototype, "buttonText", void 0);
|
|
1091
|
-
__decorate([
|
|
1092
|
-
Input()
|
|
1093
|
-
], SkyTabButtonComponent.prototype, "buttonTextCount", void 0);
|
|
1094
|
-
__decorate([
|
|
1095
|
-
Input()
|
|
1096
|
-
], SkyTabButtonComponent.prototype, "closeable", void 0);
|
|
1097
|
-
__decorate([
|
|
1098
|
-
Input()
|
|
1099
|
-
], SkyTabButtonComponent.prototype, "disabled", void 0);
|
|
1100
|
-
__decorate([
|
|
1101
|
-
Input()
|
|
1102
|
-
], SkyTabButtonComponent.prototype, "tabStyle", void 0);
|
|
1103
|
-
__decorate([
|
|
1104
|
-
Output()
|
|
1105
|
-
], SkyTabButtonComponent.prototype, "buttonClick", void 0);
|
|
1106
|
-
__decorate([
|
|
1107
|
-
Output()
|
|
1108
|
-
], SkyTabButtonComponent.prototype, "closeClick", void 0);
|
|
1109
|
-
SkyTabButtonComponent = __decorate([
|
|
1110
|
-
Component({
|
|
1111
|
-
selector: 'sky-tab-button',
|
|
1112
|
-
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]=\"disabled ? '-1' : '0'\"\n (click)=\"onButtonClick($event)\"\n (keydown.enter)=\"onButtonEnterKeyDown($event)\"\n >\n <span\n class=\"sky-tab-heading\"\n >\n {{ buttonText }}\n <span *ngIf=\"buttonTextCount !== undefined\"\n class=\"sky-tab-header-count\"\n >\n {{ buttonTextCount }}\n </span>\n </span>\n </a>\n\n <button *ngIf=\"closeable\"\n class=\"sky-btn-tab-close\"\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\n icon=\"remove\"\n ></sky-icon>\n </button>\n</div>\n",
|
|
1113
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1114
|
-
encapsulation: ViewEncapsulation.None,
|
|
1115
|
-
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 150ms}.sky-btn-tab-wrapper.sky-btn-tab-wrapper-selected:not(.sky-btn-tab-wrapper-disabled) .sky-btn-tab-close{color:#fff}.sky-tab-btn-closeable{padding-right:43px}.sky-theme-modern .sky-btn-tab-wrapper,:host-context(.sky-theme-modern) .sky-btn-tab-wrapper{margin-right:10px}.sky-theme-modern .sky-btn-tab-wrapper .sky-btn-tab-close,:host-context(.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,: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}.sky-theme-modern .sky-tab-btn-closeable,:host-context(.sky-theme-modern) .sky-tab-btn-closeable{padding-right:44px}.sky-theme-modern.sky-theme-mode-dark .sky-btn-tab-wrapper .sky-btn-tab-close,:host-context(.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,: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}"]
|
|
1116
|
-
})
|
|
1117
|
-
], SkyTabButtonComponent);
|
|
1118
|
-
return SkyTabButtonComponent;
|
|
1119
|
-
}());
|
|
1120
|
-
|
|
1121
|
-
/**
|
|
1122
|
-
* @internal
|
|
1123
|
-
*/
|
|
1124
|
-
var SkyTabsetPermalinkService = /** @class */ (function () {
|
|
1125
|
-
function SkyTabsetPermalinkService(activatedRoute, location, router) {
|
|
1126
|
-
this.activatedRoute = activatedRoute;
|
|
1127
|
-
this.location = location;
|
|
1128
|
-
this.router = router;
|
|
1129
|
-
this._popStateChange = new Subject();
|
|
1130
|
-
}
|
|
1131
|
-
Object.defineProperty(SkyTabsetPermalinkService.prototype, "popStateChange", {
|
|
1132
|
-
get: function () {
|
|
1133
|
-
return this._popStateChange.asObservable();
|
|
1134
|
-
},
|
|
1135
|
-
enumerable: true,
|
|
1136
|
-
configurable: true
|
|
1137
|
-
});
|
|
1138
|
-
SkyTabsetPermalinkService.prototype.ngOnDestroy = function () {
|
|
1139
|
-
if (this.subscription) {
|
|
1140
|
-
this.subscription.unsubscribe();
|
|
1141
|
-
}
|
|
1142
|
-
};
|
|
1143
|
-
SkyTabsetPermalinkService.prototype.init = function () {
|
|
1144
|
-
var _this = this;
|
|
1145
|
-
this.subscription = this.location.subscribe(function () {
|
|
1146
|
-
_this._popStateChange.next();
|
|
1147
|
-
});
|
|
1148
|
-
};
|
|
1149
|
-
/**
|
|
1150
|
-
* Returns the value of a URL query param.
|
|
1151
|
-
*/
|
|
1152
|
-
SkyTabsetPermalinkService.prototype.getParam = function (name) {
|
|
1153
|
-
return this.getParams()[name];
|
|
1154
|
-
};
|
|
1155
|
-
/**
|
|
1156
|
-
* Sets the value of a URL query param.
|
|
1157
|
-
*/
|
|
1158
|
-
SkyTabsetPermalinkService.prototype.setParam = function (name, value) {
|
|
1159
|
-
var params = this.getParams();
|
|
1160
|
-
if (value === null) {
|
|
1161
|
-
delete params[name];
|
|
1162
|
-
}
|
|
1163
|
-
else {
|
|
1164
|
-
params[name] = value;
|
|
1165
|
-
}
|
|
1166
|
-
// Update the URL without triggering a navigation state change.
|
|
1167
|
-
// See: https://stackoverflow.com/a/46486677
|
|
1168
|
-
var url = this.router.createUrlTree(['.'], {
|
|
1169
|
-
relativeTo: this.activatedRoute,
|
|
1170
|
-
queryParams: params,
|
|
1171
|
-
queryParamsHandling: 'merge'
|
|
1172
|
-
}).toString();
|
|
1173
|
-
// Abort redirect if the current URL is equal to the new URL.
|
|
1174
|
-
if (this.location.isCurrentPathEqualTo(url)) {
|
|
1175
|
-
return;
|
|
1176
|
-
}
|
|
1177
|
-
this.location.go(url);
|
|
1178
|
-
};
|
|
1179
|
-
/**
|
|
1180
|
-
* Removes the provided query param from the URL.
|
|
1181
|
-
*/
|
|
1182
|
-
SkyTabsetPermalinkService.prototype.clearParam = function (name) {
|
|
1183
|
-
/*tslint:disable-next-line:no-null-keyword*/
|
|
1184
|
-
this.setParam(name, null);
|
|
1185
|
-
};
|
|
1186
|
-
/**
|
|
1187
|
-
* Returns a relative URL that includes the provided query parameter. The value is inteded to be
|
|
1188
|
-
* used by an HTML anchor element.
|
|
1189
|
-
*/
|
|
1190
|
-
SkyTabsetPermalinkService.prototype.getParamHref = function (name, value) {
|
|
1191
|
-
if (!name) {
|
|
1192
|
-
/*tslint:disable-next-line:no-null-keyword*/
|
|
1193
|
-
return null;
|
|
1194
|
-
}
|
|
1195
|
-
var params = this.getParams();
|
|
1196
|
-
params[name] = value;
|
|
1197
|
-
var baseUrl = this.location.path().split('?')[0];
|
|
1198
|
-
var paramString = Object.keys(params).map(function (k) { return k + "=" + params[k]; }).join('&');
|
|
1199
|
-
return this.location.prepareExternalUrl(baseUrl + "?" + paramString);
|
|
1200
|
-
};
|
|
1201
|
-
/**
|
|
1202
|
-
* Converts the provided string into a value that can be safely used in a URL.
|
|
1203
|
-
*/
|
|
1204
|
-
SkyTabsetPermalinkService.prototype.urlify = function (value) {
|
|
1205
|
-
if (!value) {
|
|
1206
|
-
return '';
|
|
1207
|
-
}
|
|
1208
|
-
var sanitized = value.toLowerCase()
|
|
1209
|
-
// Remove special characters.
|
|
1210
|
-
.replace(/[\_\~\`\@\!\#\$\%\^\&\*\(\)\[\]\{\}\;\:\'\/\\\<\>\,\.\?\=\+\|"]/g, '')
|
|
1211
|
-
// Replace space characters with a dash.
|
|
1212
|
-
.replace(/\s/g, '-')
|
|
1213
|
-
// Remove any double-dashes.
|
|
1214
|
-
.replace(/--/g, '-');
|
|
1215
|
-
return sanitized;
|
|
1216
|
-
};
|
|
1217
|
-
/**
|
|
1218
|
-
* Returns all query params that exist in the current URL.
|
|
1219
|
-
*/
|
|
1220
|
-
SkyTabsetPermalinkService.prototype.getParams = function () {
|
|
1221
|
-
var params = {};
|
|
1222
|
-
var path = this.location.path();
|
|
1223
|
-
if (path.indexOf('?') === -1) {
|
|
1224
|
-
return params;
|
|
1225
|
-
}
|
|
1226
|
-
var existingParamPairs = path.split('?')[1].split('&');
|
|
1227
|
-
existingParamPairs.forEach(function (pair) {
|
|
1228
|
-
var fragments = pair.split('=');
|
|
1229
|
-
params[fragments[0]] = decodeURIComponent(fragments[1]);
|
|
1230
|
-
});
|
|
1231
|
-
return params;
|
|
1232
|
-
};
|
|
1233
|
-
SkyTabsetPermalinkService.ctorParameters = function () { return [
|
|
1234
|
-
{ type: ActivatedRoute },
|
|
1235
|
-
{ type: Location },
|
|
1236
|
-
{ type: Router }
|
|
1237
|
-
]; };
|
|
1238
|
-
SkyTabsetPermalinkService = __decorate([
|
|
1239
|
-
Injectable()
|
|
1240
|
-
], SkyTabsetPermalinkService);
|
|
1241
|
-
return SkyTabsetPermalinkService;
|
|
1242
|
-
}());
|
|
1243
|
-
|
|
1244
|
-
/**
|
|
1245
|
-
* @internal
|
|
1246
|
-
*/
|
|
1247
|
-
var SkyTabsetService = /** @class */ (function () {
|
|
1248
|
-
function SkyTabsetService() {
|
|
1249
|
-
this.currentActiveTabIndex = 0;
|
|
1250
|
-
this._activeTabIndex = new BehaviorSubject(0);
|
|
1251
|
-
this._activeTabUnregistered = new Subject();
|
|
1252
|
-
this.tabs = [];
|
|
1253
|
-
this.tabCounter = 0;
|
|
1254
|
-
}
|
|
1255
|
-
Object.defineProperty(SkyTabsetService.prototype, "activeTabUnregistered", {
|
|
1256
|
-
get: function () {
|
|
1257
|
-
return this._activeTabUnregistered.asObservable();
|
|
1258
|
-
},
|
|
1259
|
-
enumerable: true,
|
|
1260
|
-
configurable: true
|
|
1261
|
-
});
|
|
1262
|
-
Object.defineProperty(SkyTabsetService.prototype, "activeTabIndex", {
|
|
1263
|
-
get: function () {
|
|
1264
|
-
return this._activeTabIndex.asObservable();
|
|
1265
|
-
},
|
|
1266
|
-
enumerable: true,
|
|
1267
|
-
configurable: true
|
|
1268
|
-
});
|
|
1269
|
-
/**
|
|
1270
|
-
* Sets the active tab by its unique `tabIndex` property.
|
|
1271
|
-
*/
|
|
1272
|
-
SkyTabsetService.prototype.setActiveTabIndex = function (value, config) {
|
|
1273
|
-
if (config === void 0) { config = {
|
|
1274
|
-
emitChange: true
|
|
1275
|
-
}; }
|
|
1276
|
-
if (value !== undefined &&
|
|
1277
|
-
!this.tabIndexesEqual(value, this.currentActiveTabIndex)) {
|
|
1278
|
-
this.currentActiveTabIndex = value;
|
|
1279
|
-
if (config.emitChange) {
|
|
1280
|
-
this._activeTabIndex.next(value);
|
|
1281
|
-
}
|
|
1282
|
-
}
|
|
1283
|
-
};
|
|
1284
|
-
/**
|
|
1285
|
-
* Registers a tab component.
|
|
1286
|
-
*/
|
|
1287
|
-
SkyTabsetService.prototype.registerTab = function (tabIndex) {
|
|
1288
|
-
if (tabIndex === undefined) {
|
|
1289
|
-
tabIndex = this.tabCounter;
|
|
1290
|
-
this.tabCounter++;
|
|
1291
|
-
}
|
|
1292
|
-
this.tabs.push({ tabIndex: tabIndex });
|
|
1293
|
-
return tabIndex;
|
|
1294
|
-
};
|
|
1295
|
-
SkyTabsetService.prototype.updateTabIndex = function (currentTabIndex, newTabIndex) {
|
|
1296
|
-
var _this = this;
|
|
1297
|
-
var found = this.tabs.find(function (tab) { return _this.tabIndexesEqual(tab.tabIndex, currentTabIndex); });
|
|
1298
|
-
found.tabIndex = newTabIndex;
|
|
1299
|
-
};
|
|
1300
|
-
/**
|
|
1301
|
-
* Unregisters a tab component.
|
|
1302
|
-
*/
|
|
1303
|
-
SkyTabsetService.prototype.unregisterTab = function (tabIndex) {
|
|
1304
|
-
var _this = this;
|
|
1305
|
-
var index = this.tabs.findIndex(function (tab) { return _this.tabIndexesEqual(tab.tabIndex, tabIndex); });
|
|
1306
|
-
// Notify the tabset component when an active tab is unregistered.
|
|
1307
|
-
if (this.isTabIndexActive(this.tabs[index].tabIndex)) {
|
|
1308
|
-
this._activeTabUnregistered.next({
|
|
1309
|
-
arrayIndex: index
|
|
1310
|
-
});
|
|
1311
|
-
}
|
|
1312
|
-
this.tabs.splice(index, 1);
|
|
1313
|
-
};
|
|
1314
|
-
/**
|
|
1315
|
-
* Unregisters all tab components at once.
|
|
1316
|
-
*/
|
|
1317
|
-
SkyTabsetService.prototype.unregisterAll = function () {
|
|
1318
|
-
this.tabs = [];
|
|
1319
|
-
};
|
|
1320
|
-
/**
|
|
1321
|
-
* Compares two tab indexes and returns `true` if they are equal.
|
|
1322
|
-
*/
|
|
1323
|
-
SkyTabsetService.prototype.tabIndexesEqual = function (tabIndex1, tabIndex2) {
|
|
1324
|
-
return (tabIndex1 === tabIndex2 ||
|
|
1325
|
-
+tabIndex1 === +tabIndex2);
|
|
1326
|
-
};
|
|
1327
|
-
/**
|
|
1328
|
-
* Verifies if a provided tab index is registered.
|
|
1329
|
-
*/
|
|
1330
|
-
SkyTabsetService.prototype.isValidTabIndex = function (tabIndex) {
|
|
1331
|
-
var _this = this;
|
|
1332
|
-
return this.tabs.some(function (tab) { return _this.tabIndexesEqual(tab.tabIndex, tabIndex); });
|
|
1333
|
-
};
|
|
1334
|
-
/**
|
|
1335
|
-
* Activates the first registered tab.
|
|
1336
|
-
*/
|
|
1337
|
-
SkyTabsetService.prototype.activateFirstTab = function () {
|
|
1338
|
-
var firstTabIndex = this.tabs[0] && this.tabs[0].tabIndex;
|
|
1339
|
-
if (firstTabIndex !== undefined) {
|
|
1340
|
-
this.setActiveTabIndex(firstTabIndex);
|
|
1341
|
-
return firstTabIndex;
|
|
1342
|
-
}
|
|
1343
|
-
};
|
|
1344
|
-
/**
|
|
1345
|
-
* Activates the next registered tab, or the previous one based on a provided array index.
|
|
1346
|
-
*/
|
|
1347
|
-
SkyTabsetService.prototype.activateNearestTab = function (arrayIndex) {
|
|
1348
|
-
var newActiveTab = this.tabs[arrayIndex] || this.tabs[arrayIndex - 1];
|
|
1349
|
-
if (newActiveTab) {
|
|
1350
|
-
this.currentActiveTabIndex = newActiveTab.tabIndex;
|
|
1351
|
-
}
|
|
1352
|
-
};
|
|
1353
|
-
SkyTabsetService.prototype.isTabIndexActive = function (tabIndex) {
|
|
1354
|
-
return this.tabIndexesEqual(tabIndex, this.currentActiveTabIndex);
|
|
1355
|
-
};
|
|
1356
|
-
SkyTabsetService = __decorate([
|
|
1357
|
-
Injectable()
|
|
1358
|
-
], SkyTabsetService);
|
|
1359
|
-
return SkyTabsetService;
|
|
1360
|
-
}());
|
|
1361
|
-
|
|
1362
|
-
var nextId$1 = 0;
|
|
1363
|
-
var SkyTabComponent = /** @class */ (function () {
|
|
1364
|
-
function SkyTabComponent(changeDetector, permalinkService, tabsetService) {
|
|
1365
|
-
this.changeDetector = changeDetector;
|
|
1366
|
-
this.permalinkService = permalinkService;
|
|
1367
|
-
this.tabsetService = tabsetService;
|
|
1368
|
-
/**
|
|
1369
|
-
* Fires when users click the button to close the tab.
|
|
1370
|
-
* The close button is added to the tab when you specify a listener for this event.
|
|
1371
|
-
*/
|
|
1372
|
-
this.close = new EventEmitter();
|
|
1373
|
-
this.showContent = false;
|
|
1374
|
-
this._activeChange = new BehaviorSubject(undefined);
|
|
1375
|
-
this._stateChange = new BehaviorSubject(undefined);
|
|
1376
|
-
this._tabIndexChange = new BehaviorSubject(undefined);
|
|
1377
|
-
var id = nextId$1++;
|
|
1378
|
-
this.tabPanelId = "sky-tab-" + id;
|
|
1379
|
-
this.tabButtonId = this.tabPanelId + "-nav-btn";
|
|
1380
|
-
}
|
|
1381
|
-
Object.defineProperty(SkyTabComponent.prototype, "active", {
|
|
1382
|
-
get: function () {
|
|
1383
|
-
return this._active || false;
|
|
1384
|
-
},
|
|
1385
|
-
/**
|
|
1386
|
-
* Indicates whether the tab is active when the tabset loads. After initialization, the `active`
|
|
1387
|
-
* property on the tabset component should be used to set the active tab.
|
|
1388
|
-
* @default false
|
|
1389
|
-
*/
|
|
1390
|
-
set: function (value) {
|
|
1391
|
-
if (value !== undefined &&
|
|
1392
|
-
value !== this._active) {
|
|
1393
|
-
this._active = value;
|
|
1394
|
-
this._activeChange.next();
|
|
1395
|
-
}
|
|
1396
|
-
},
|
|
1397
|
-
enumerable: true,
|
|
1398
|
-
configurable: true
|
|
1399
|
-
});
|
|
1400
|
-
Object.defineProperty(SkyTabComponent.prototype, "activeChange", {
|
|
1401
|
-
get: function () {
|
|
1402
|
-
return this._activeChange.asObservable();
|
|
1403
|
-
},
|
|
1404
|
-
enumerable: true,
|
|
1405
|
-
configurable: true
|
|
1406
|
-
});
|
|
1407
|
-
Object.defineProperty(SkyTabComponent.prototype, "permalinkValue", {
|
|
1408
|
-
get: function () {
|
|
1409
|
-
return this._permalinkValue || this.permalinkService.urlify(this.tabHeading);
|
|
1410
|
-
},
|
|
1411
|
-
/**
|
|
1412
|
-
* Specifies a custom query parameter value for the tab.
|
|
1413
|
-
* This works in conjunction with the tabset's `permalinkId` to distinguish
|
|
1414
|
-
* the tab's unique state in the URL by generating a query parameter that is
|
|
1415
|
-
* written as `?<queryParam>-active-tab=<sanitized-tab-heading`.
|
|
1416
|
-
* By default, the query parameter's value is parsed automatically from the tab's heading text.
|
|
1417
|
-
*/
|
|
1418
|
-
set: function (value) {
|
|
1419
|
-
this._permalinkValue = this.permalinkService.urlify(value);
|
|
1420
|
-
},
|
|
1421
|
-
enumerable: true,
|
|
1422
|
-
configurable: true
|
|
1423
|
-
});
|
|
1424
|
-
Object.defineProperty(SkyTabComponent.prototype, "tabIndex", {
|
|
1425
|
-
get: function () {
|
|
1426
|
-
return this._tabIndex;
|
|
1427
|
-
},
|
|
1428
|
-
/**
|
|
1429
|
-
* Specifies a unique identifier for the tab.
|
|
1430
|
-
* If not defined, the identifier is set to the position of the tab on load, starting with `0`.
|
|
1431
|
-
*/
|
|
1432
|
-
set: function (value) {
|
|
1433
|
-
if (value !== this._tabIndex &&
|
|
1434
|
-
value !== undefined &&
|
|
1435
|
-
this._tabIndex !== undefined) {
|
|
1436
|
-
this.tabsetService.updateTabIndex(this._tabIndex, value);
|
|
1437
|
-
this._tabIndexChange.next(value);
|
|
1438
|
-
}
|
|
1439
|
-
this._tabIndex = value;
|
|
1440
|
-
},
|
|
1441
|
-
enumerable: true,
|
|
1442
|
-
configurable: true
|
|
1443
|
-
});
|
|
1444
|
-
Object.defineProperty(SkyTabComponent.prototype, "closeable", {
|
|
1445
|
-
get: function () {
|
|
1446
|
-
return this.close.observers.length > 0;
|
|
1447
|
-
},
|
|
1448
|
-
enumerable: true,
|
|
1449
|
-
configurable: true
|
|
1450
|
-
});
|
|
1451
|
-
Object.defineProperty(SkyTabComponent.prototype, "stateChange", {
|
|
1452
|
-
/**
|
|
1453
|
-
* Alerts the tabset component when this component has changes that need to be reflected in the UI.
|
|
1454
|
-
*/
|
|
1455
|
-
get: function () {
|
|
1456
|
-
return this._stateChange.asObservable();
|
|
1457
|
-
},
|
|
1458
|
-
enumerable: true,
|
|
1459
|
-
configurable: true
|
|
1460
|
-
});
|
|
1461
|
-
Object.defineProperty(SkyTabComponent.prototype, "tabIndexChange", {
|
|
1462
|
-
get: function () {
|
|
1463
|
-
return this._tabIndexChange.asObservable();
|
|
1464
|
-
},
|
|
1465
|
-
enumerable: true,
|
|
1466
|
-
configurable: true
|
|
1467
|
-
});
|
|
1468
|
-
SkyTabComponent.prototype.ngOnChanges = function (changes) {
|
|
1469
|
-
if (changes.disabled && !changes.disabled.firstChange ||
|
|
1470
|
-
changes.tabHeading && !changes.tabHeading.firstChange ||
|
|
1471
|
-
changes.tabHeaderCount && !changes.tabHeaderCount.firstChange ||
|
|
1472
|
-
changes.permalinkValue && !changes.permalinkValue.firstChange) {
|
|
1473
|
-
this._stateChange.next();
|
|
1474
|
-
}
|
|
1475
|
-
};
|
|
1476
|
-
SkyTabComponent.prototype.ngOnDestroy = function () {
|
|
1477
|
-
this._stateChange.complete();
|
|
1478
|
-
this.tabsetService.unregisterTab(this.tabIndex);
|
|
1479
|
-
};
|
|
1480
|
-
SkyTabComponent.prototype.init = function () {
|
|
1481
|
-
this._tabIndex = this.tabsetService.registerTab(this.tabIndex);
|
|
1482
|
-
};
|
|
1483
|
-
SkyTabComponent.prototype.activate = function () {
|
|
1484
|
-
this._active = true;
|
|
1485
|
-
this.showContent = true;
|
|
1486
|
-
this.changeDetector.markForCheck();
|
|
1487
|
-
};
|
|
1488
|
-
SkyTabComponent.prototype.deactivate = function () {
|
|
1489
|
-
this._active = false;
|
|
1490
|
-
this.showContent = false;
|
|
1491
|
-
this.changeDetector.markForCheck();
|
|
1492
|
-
};
|
|
1493
|
-
SkyTabComponent.ctorParameters = function () { return [
|
|
1494
|
-
{ type: ChangeDetectorRef },
|
|
1495
|
-
{ type: SkyTabsetPermalinkService },
|
|
1496
|
-
{ type: SkyTabsetService }
|
|
1497
|
-
]; };
|
|
1498
|
-
__decorate([
|
|
1499
|
-
Input()
|
|
1500
|
-
], SkyTabComponent.prototype, "active", null);
|
|
1501
|
-
__decorate([
|
|
1502
|
-
Input()
|
|
1503
|
-
], SkyTabComponent.prototype, "disabled", void 0);
|
|
1504
|
-
__decorate([
|
|
1505
|
-
Input()
|
|
1506
|
-
], SkyTabComponent.prototype, "permalinkValue", null);
|
|
1507
|
-
__decorate([
|
|
1508
|
-
Input()
|
|
1509
|
-
], SkyTabComponent.prototype, "tabHeaderCount", void 0);
|
|
1510
|
-
__decorate([
|
|
1511
|
-
Input()
|
|
1512
|
-
], SkyTabComponent.prototype, "tabHeading", void 0);
|
|
1513
|
-
__decorate([
|
|
1514
|
-
Input()
|
|
1515
|
-
], SkyTabComponent.prototype, "tabIndex", null);
|
|
1516
|
-
__decorate([
|
|
1517
|
-
Output()
|
|
1518
|
-
], SkyTabComponent.prototype, "close", void 0);
|
|
1519
|
-
SkyTabComponent = __decorate([
|
|
1520
|
-
Component({
|
|
1521
|
-
selector: 'sky-tab',
|
|
1522
|
-
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",
|
|
1523
|
-
changeDetection: ChangeDetectionStrategy.OnPush
|
|
1524
|
-
})
|
|
1525
|
-
], SkyTabComponent);
|
|
1526
|
-
return SkyTabComponent;
|
|
1527
|
-
}());
|
|
1528
|
-
|
|
1529
|
-
var buttonTypeNext = 'next';
|
|
1530
|
-
var buttonTypePrevious = 'previous';
|
|
1531
|
-
/**
|
|
1532
|
-
* @internal
|
|
1533
|
-
*/
|
|
1534
|
-
var SkyTabsetNavButtonComponent = /** @class */ (function () {
|
|
1535
|
-
function SkyTabsetNavButtonComponent(resourceService, changeDetector) {
|
|
1536
|
-
this.resourceService = resourceService;
|
|
1537
|
-
this.changeDetector = changeDetector;
|
|
1538
|
-
}
|
|
1539
|
-
Object.defineProperty(SkyTabsetNavButtonComponent.prototype, "buttonText", {
|
|
1540
|
-
get: function () {
|
|
1541
|
-
if (this._buttonText) {
|
|
1542
|
-
return this._buttonText;
|
|
1543
|
-
}
|
|
1544
|
-
switch (this.buttonType) {
|
|
1545
|
-
case buttonTypePrevious:
|
|
1546
|
-
return this.previousButtonText;
|
|
1547
|
-
case buttonTypeNext:
|
|
1548
|
-
return this.nextButtonText;
|
|
1549
|
-
/* istanbul ignore next */
|
|
1550
|
-
default:
|
|
1551
|
-
return '';
|
|
1552
|
-
}
|
|
1553
|
-
},
|
|
1554
|
-
set: function (value) {
|
|
1555
|
-
this._buttonText = value;
|
|
1556
|
-
},
|
|
1557
|
-
enumerable: true,
|
|
1558
|
-
configurable: true
|
|
1559
|
-
});
|
|
1560
|
-
Object.defineProperty(SkyTabsetNavButtonComponent.prototype, "disabled", {
|
|
1561
|
-
get: function () {
|
|
1562
|
-
var tabToSelect;
|
|
1563
|
-
switch (this.buttonType) {
|
|
1564
|
-
case buttonTypePrevious:
|
|
1565
|
-
tabToSelect = this.previousTab;
|
|
1566
|
-
break;
|
|
1567
|
-
case buttonTypeNext:
|
|
1568
|
-
tabToSelect = this.nextTab;
|
|
1569
|
-
break;
|
|
1570
|
-
/* istanbul ignore next */
|
|
1571
|
-
default:
|
|
1572
|
-
break;
|
|
1573
|
-
}
|
|
1574
|
-
return !tabToSelect || tabToSelect.disabled;
|
|
1575
|
-
},
|
|
1576
|
-
enumerable: true,
|
|
1577
|
-
configurable: true
|
|
1578
|
-
});
|
|
1579
|
-
Object.defineProperty(SkyTabsetNavButtonComponent.prototype, "selectedTab", {
|
|
1580
|
-
get: function () {
|
|
1581
|
-
var _this = this;
|
|
1582
|
-
var selectedTab;
|
|
1583
|
-
if (this.tabset && this.tabset.tabs) {
|
|
1584
|
-
selectedTab = this.tabset.tabs.find(function (tab) { return tab.tabIndex === _this.tabset.lastActiveTabIndex; });
|
|
1585
|
-
}
|
|
1586
|
-
return selectedTab;
|
|
1587
|
-
},
|
|
1588
|
-
enumerable: true,
|
|
1589
|
-
configurable: true
|
|
1590
|
-
});
|
|
1591
|
-
Object.defineProperty(SkyTabsetNavButtonComponent.prototype, "nextTab", {
|
|
1592
|
-
get: function () {
|
|
1593
|
-
var selectedTab = this.selectedTab;
|
|
1594
|
-
if (selectedTab) {
|
|
1595
|
-
var tabs = this.tabset.tabs.toArray();
|
|
1596
|
-
return tabs[tabs.indexOf(selectedTab) + 1];
|
|
1597
|
-
}
|
|
1598
|
-
return undefined;
|
|
1599
|
-
},
|
|
1600
|
-
enumerable: true,
|
|
1601
|
-
configurable: true
|
|
1602
|
-
});
|
|
1603
|
-
Object.defineProperty(SkyTabsetNavButtonComponent.prototype, "previousTab", {
|
|
1604
|
-
get: function () {
|
|
1605
|
-
var selectedTab = this.selectedTab;
|
|
1606
|
-
if (selectedTab) {
|
|
1607
|
-
var tabs = this.tabset.tabs.toArray();
|
|
1608
|
-
return tabs[tabs.indexOf(selectedTab) - 1];
|
|
1609
|
-
}
|
|
1610
|
-
return undefined;
|
|
1611
|
-
},
|
|
1612
|
-
enumerable: true,
|
|
1613
|
-
configurable: true
|
|
1614
|
-
});
|
|
1615
|
-
SkyTabsetNavButtonComponent.prototype.ngAfterViewInit = function () {
|
|
1616
|
-
var _this = this;
|
|
1617
|
-
forkJoin([
|
|
1618
|
-
this.resourceService.getString('skyux_tabs_navigator_previous'),
|
|
1619
|
-
this.resourceService.getString('skyux_tabs_navigator_next')
|
|
1620
|
-
])
|
|
1621
|
-
.pipe(take(1))
|
|
1622
|
-
.subscribe(function (resources) {
|
|
1623
|
-
_this.previousButtonText = resources[0];
|
|
1624
|
-
_this.nextButtonText = resources[1];
|
|
1625
|
-
_this.changeDetector.detectChanges();
|
|
1626
|
-
});
|
|
1627
|
-
};
|
|
1628
|
-
SkyTabsetNavButtonComponent.prototype.buttonClick = function () {
|
|
1629
|
-
var tabToSelect;
|
|
1630
|
-
switch (this.buttonType) {
|
|
1631
|
-
case buttonTypePrevious:
|
|
1632
|
-
tabToSelect = this.previousTab;
|
|
1633
|
-
break;
|
|
1634
|
-
case buttonTypeNext:
|
|
1635
|
-
tabToSelect = this.nextTab;
|
|
1636
|
-
break;
|
|
1637
|
-
/* istanbul ignore next */
|
|
1638
|
-
default:
|
|
1639
|
-
break;
|
|
1640
|
-
}
|
|
1641
|
-
/* istanbul ignore else */
|
|
1642
|
-
if (tabToSelect && !tabToSelect.disabled) {
|
|
1643
|
-
this.tabset.active = tabToSelect.tabIndex;
|
|
1644
|
-
}
|
|
1645
|
-
};
|
|
1646
|
-
SkyTabsetNavButtonComponent.ctorParameters = function () { return [
|
|
1647
|
-
{ type: SkyLibResourcesService },
|
|
1648
|
-
{ type: ChangeDetectorRef }
|
|
1649
|
-
]; };
|
|
1650
|
-
__decorate([
|
|
1651
|
-
Input()
|
|
1652
|
-
], SkyTabsetNavButtonComponent.prototype, "tabset", void 0);
|
|
1653
|
-
__decorate([
|
|
1654
|
-
Input()
|
|
1655
|
-
], SkyTabsetNavButtonComponent.prototype, "buttonType", void 0);
|
|
1656
|
-
__decorate([
|
|
1657
|
-
Input()
|
|
1658
|
-
], SkyTabsetNavButtonComponent.prototype, "buttonText", null);
|
|
1659
|
-
SkyTabsetNavButtonComponent = __decorate([
|
|
1660
|
-
Component({
|
|
1661
|
-
selector: 'sky-tabset-nav-button',
|
|
1662
|
-
template: "<button\n class=\"sky-btn sky-btn-default\"\n type=\"button\"\n [disabled]=\"disabled\"\n (click)=\"buttonClick()\"\n>\n {{ buttonText }}\n</button>\n"
|
|
1663
|
-
})
|
|
1664
|
-
], SkyTabsetNavButtonComponent);
|
|
1665
|
-
return SkyTabsetNavButtonComponent;
|
|
1666
|
-
}());
|
|
1667
|
-
|
|
1668
|
-
/**
|
|
1669
|
-
* @internal
|
|
1670
|
-
*/
|
|
1671
|
-
var SkyTabsetAdapterService = /** @class */ (function () {
|
|
1672
|
-
function SkyTabsetAdapterService() {
|
|
1673
|
-
this._overflowChange = new BehaviorSubject(false);
|
|
1674
|
-
}
|
|
1675
|
-
Object.defineProperty(SkyTabsetAdapterService.prototype, "overflowChange", {
|
|
1676
|
-
get: function () {
|
|
1677
|
-
return this._overflowChange.asObservable();
|
|
1678
|
-
},
|
|
1679
|
-
enumerable: true,
|
|
1680
|
-
configurable: true
|
|
1681
|
-
});
|
|
1682
|
-
SkyTabsetAdapterService.prototype.registerTabset = function (tabsetRef) {
|
|
1683
|
-
this.tabsetRef = tabsetRef;
|
|
1684
|
-
this.tabsOffsetLeft = this.getTabsOffsetLeft(tabsetRef.nativeElement);
|
|
1685
|
-
};
|
|
1686
|
-
/**
|
|
1687
|
-
* Detects if the tab buttons are wider than the tabset container.
|
|
1688
|
-
*/
|
|
1689
|
-
SkyTabsetAdapterService.prototype.detectOverflow = function () {
|
|
1690
|
-
var nativeElement = this.tabsetRef.nativeElement;
|
|
1691
|
-
var tabsetRect = nativeElement
|
|
1692
|
-
.querySelector('.sky-tabset')
|
|
1693
|
-
.getBoundingClientRect();
|
|
1694
|
-
var tabButtonsRect = nativeElement
|
|
1695
|
-
.querySelector('.sky-tabset-tabs')
|
|
1696
|
-
.getBoundingClientRect();
|
|
1697
|
-
var tabExtraButtonsRect = nativeElement
|
|
1698
|
-
.querySelector('.sky-tabset-btns')
|
|
1699
|
-
.getBoundingClientRect();
|
|
1700
|
-
var tabButtonsWidth = tabButtonsRect.width + tabExtraButtonsRect.width + this.tabsOffsetLeft;
|
|
1701
|
-
var newOverflow = (tabButtonsWidth > tabsetRect.width);
|
|
1702
|
-
if (this.currentOverflow !== newOverflow) {
|
|
1703
|
-
this.currentOverflow = newOverflow;
|
|
1704
|
-
this._overflowChange.next(this.currentOverflow);
|
|
1705
|
-
}
|
|
1706
|
-
};
|
|
1707
|
-
/**
|
|
1708
|
-
* Returns the number of pixels to the left of the first tab.
|
|
1709
|
-
*/
|
|
1710
|
-
SkyTabsetAdapterService.prototype.getTabsOffsetLeft = function (tabsetEl) {
|
|
1711
|
-
var tabsetRect = tabsetEl.getBoundingClientRect();
|
|
1712
|
-
// The dropdown element is the first "tab" and always exists in the DOM, even when hidden.
|
|
1713
|
-
var firstTabRect = tabsetEl.querySelector('.sky-tabset-dropdown').getBoundingClientRect();
|
|
1714
|
-
return firstTabRect.left - tabsetRect.left;
|
|
1715
|
-
};
|
|
1716
|
-
SkyTabsetAdapterService = __decorate([
|
|
1717
|
-
Injectable()
|
|
1718
|
-
], SkyTabsetAdapterService);
|
|
1719
|
-
return SkyTabsetAdapterService;
|
|
1720
|
-
}());
|
|
1721
|
-
|
|
1722
|
-
var SkyTabsetComponent = /** @class */ (function () {
|
|
1723
|
-
function SkyTabsetComponent(changeDetector, elementRef, adapterService, permalinkService, tabsetService) {
|
|
1724
|
-
this.changeDetector = changeDetector;
|
|
1725
|
-
this.elementRef = elementRef;
|
|
1726
|
-
this.adapterService = adapterService;
|
|
1727
|
-
this.permalinkService = permalinkService;
|
|
1728
|
-
this.tabsetService = tabsetService;
|
|
1729
|
-
/**
|
|
1730
|
-
* Fires when the active tab changes. This event emits the index of the active tab.
|
|
1731
|
-
*/
|
|
1732
|
-
this.activeChange = new EventEmitter();
|
|
1733
|
-
/**
|
|
1734
|
-
* Fires when users click the button to add a new tab.
|
|
1735
|
-
* The new tab button is added to the tab area when you specify a listener for this event.
|
|
1736
|
-
*/
|
|
1737
|
-
this.newTab = new EventEmitter();
|
|
1738
|
-
/**
|
|
1739
|
-
* Fires when users click the button to open a tab.
|
|
1740
|
-
* The open tab button is added to the tab area when you specify a listener for this event.
|
|
1741
|
-
*/
|
|
1742
|
-
this.openTab = new EventEmitter();
|
|
1743
|
-
/**
|
|
1744
|
-
* Fires when any tab's `tabIndex` value changes.
|
|
1745
|
-
*/
|
|
1746
|
-
this.tabIndexesChange = new EventEmitter();
|
|
1747
|
-
this.tabButtons = [];
|
|
1748
|
-
this.ngUnsubscribe = new Subject();
|
|
1749
|
-
this.tabComponentsStateChangeUnsubscribe = new Subject();
|
|
1750
|
-
}
|
|
1751
|
-
Object.defineProperty(SkyTabsetComponent.prototype, "active", {
|
|
1752
|
-
get: function () {
|
|
1753
|
-
return this._active;
|
|
1754
|
-
},
|
|
1755
|
-
/**
|
|
1756
|
-
* Activates a tab by its `tabIndex` property.
|
|
1757
|
-
*/
|
|
1758
|
-
set: function (value) {
|
|
1759
|
-
var _this = this;
|
|
1760
|
-
if (value === undefined ||
|
|
1761
|
-
this.tabsetService.tabIndexesEqual(value, this._active)) {
|
|
1762
|
-
return;
|
|
1763
|
-
}
|
|
1764
|
-
this._active = value;
|
|
1765
|
-
if (this.tabs) {
|
|
1766
|
-
this.tabsetService.setActiveTabIndex(value);
|
|
1767
|
-
}
|
|
1768
|
-
else {
|
|
1769
|
-
// On init, wait for children tabs to render before broadcasting the active tab index.
|
|
1770
|
-
setTimeout(function () {
|
|
1771
|
-
if (_this.tabsetService.isValidTabIndex(value)) {
|
|
1772
|
-
// On init, yield to the permalink ID, if it exists.
|
|
1773
|
-
if (_this.getActiveTabIndexByPermalinkId() === undefined) {
|
|
1774
|
-
_this.tabsetService.setActiveTabIndex(value);
|
|
1775
|
-
}
|
|
1776
|
-
}
|
|
1777
|
-
else {
|
|
1778
|
-
// Activate the first tab if the new tab index is invalid.
|
|
1779
|
-
_this._active = _this.tabsetService.activateFirstTab();
|
|
1780
|
-
}
|
|
1781
|
-
});
|
|
1782
|
-
}
|
|
1783
|
-
},
|
|
1784
|
-
enumerable: true,
|
|
1785
|
-
configurable: true
|
|
1786
|
-
});
|
|
1787
|
-
Object.defineProperty(SkyTabsetComponent.prototype, "permalinkId", {
|
|
1788
|
-
get: function () {
|
|
1789
|
-
return this._permalinkId || '';
|
|
1790
|
-
},
|
|
1791
|
-
/**
|
|
1792
|
-
* Distinguishes a tabset's unique state in the URL by generating a query parameter
|
|
1793
|
-
* that is written as `?<queryParam>-active-tab=<sanitized-tab-heading>`.
|
|
1794
|
-
* The query parameter's value is parsed automatically from the selected tab's heading text,
|
|
1795
|
-
* but you can supply a custom query parameter value for each tab with its `permalinkValue`.
|
|
1796
|
-
*/
|
|
1797
|
-
set: function (value) {
|
|
1798
|
-
if (!value) {
|
|
1799
|
-
return;
|
|
1800
|
-
}
|
|
1801
|
-
var sanitized = this.permalinkService.urlify(value);
|
|
1802
|
-
this._permalinkId = sanitized + "-active-tab";
|
|
1803
|
-
},
|
|
1804
|
-
enumerable: true,
|
|
1805
|
-
configurable: true
|
|
1806
|
-
});
|
|
1807
|
-
Object.defineProperty(SkyTabsetComponent.prototype, "tabStyle", {
|
|
1808
|
-
get: function () {
|
|
1809
|
-
return this._tabStyle || 'tabs';
|
|
1810
|
-
},
|
|
1811
|
-
/**
|
|
1812
|
-
* Specifies the behavior for a series of tabs.
|
|
1813
|
-
* @deprecated The property was designed to create wizards by setting tabStyle="wizard" on tabsets in modals,
|
|
1814
|
-
* but this wizard implementation was replaced by the
|
|
1815
|
-
* [progress indicator component](https://developer.blackbaud.com/skyux/components/progress-indicator).
|
|
1816
|
-
* @default 'tabs'
|
|
1817
|
-
*/
|
|
1818
|
-
set: function (value) {
|
|
1819
|
-
/*istanbul ignore else*/
|
|
1820
|
-
if (value && value.toLowerCase() === 'wizard') {
|
|
1821
|
-
console.warn('The tabset wizard is deprecated. Please implement the new approach using ' +
|
|
1822
|
-
'progress indicator as documented here: https://developer.blackbaud.com/skyux/components/wizard.');
|
|
1823
|
-
}
|
|
1824
|
-
this._tabStyle = value;
|
|
1825
|
-
},
|
|
1826
|
-
enumerable: true,
|
|
1827
|
-
configurable: true
|
|
1828
|
-
});
|
|
1829
|
-
Object.defineProperty(SkyTabsetComponent.prototype, "tabDisplayMode", {
|
|
1830
|
-
get: function () {
|
|
1831
|
-
return this._tabDisplayMode || 'tabs';
|
|
1832
|
-
},
|
|
1833
|
-
set: function (value) {
|
|
1834
|
-
this._tabDisplayMode = value;
|
|
1835
|
-
this.changeDetector.markForCheck();
|
|
1836
|
-
},
|
|
1837
|
-
enumerable: true,
|
|
1838
|
-
configurable: true
|
|
1839
|
-
});
|
|
1840
|
-
SkyTabsetComponent.prototype.ngAfterViewInit = function () {
|
|
1841
|
-
var _this = this;
|
|
1842
|
-
this.initTabComponents();
|
|
1843
|
-
this.listenTabComponentsStructuralChange();
|
|
1844
|
-
var initialTabIndex = this.getInitialTabIndex();
|
|
1845
|
-
this.tabsetService.setActiveTabIndex(initialTabIndex);
|
|
1846
|
-
this.listenTabButtonsOverflowChange();
|
|
1847
|
-
this.listenLocationPopStateChange();
|
|
1848
|
-
// If the currently active tab is getting unregistered, activate the next one.
|
|
1849
|
-
this.tabsetService.activeTabUnregistered
|
|
1850
|
-
.pipe(takeUntil(this.ngUnsubscribe))
|
|
1851
|
-
.subscribe(function (tab) {
|
|
1852
|
-
// Wait for the new tabs to render before activating.
|
|
1853
|
-
setTimeout(function () {
|
|
1854
|
-
_this.tabsetService.activateNearestTab(tab.arrayIndex);
|
|
1855
|
-
});
|
|
1856
|
-
});
|
|
1857
|
-
// Let the tabset render the initial active index before listening for changes.
|
|
1858
|
-
setTimeout(function () {
|
|
1859
|
-
_this.listenTabComponentsStateChange();
|
|
1860
|
-
_this.listenActiveIndexChange();
|
|
1861
|
-
_this.permalinkService.init();
|
|
1862
|
-
});
|
|
1863
|
-
};
|
|
1864
|
-
SkyTabsetComponent.prototype.ngOnDestroy = function () {
|
|
1865
|
-
this.ngUnsubscribe.next();
|
|
1866
|
-
this.ngUnsubscribe.complete();
|
|
1867
|
-
this.unsubscribeTabComponentsStateChange();
|
|
1868
|
-
this.permalinkService.clearParam(this.permalinkId);
|
|
1869
|
-
};
|
|
1870
|
-
SkyTabsetComponent.prototype.onWindowResize = function () {
|
|
1871
|
-
this.adapterService.detectOverflow();
|
|
1872
|
-
};
|
|
1873
|
-
SkyTabsetComponent.prototype.onTabCloseClick = function (tabButton) {
|
|
1874
|
-
var _this = this;
|
|
1875
|
-
var tabComponent = this.tabs.find(function (tab) {
|
|
1876
|
-
return _this.tabsetService.tabIndexesEqual(tab.tabIndex, tabButton.tabIndex);
|
|
1877
|
-
});
|
|
1878
|
-
tabComponent.close.emit();
|
|
1879
|
-
};
|
|
1880
|
-
SkyTabsetComponent.prototype.onTabButtonClick = function (tabButton) {
|
|
1881
|
-
this.tabsetService.setActiveTabIndex(tabButton.tabIndex);
|
|
1882
|
-
};
|
|
1883
|
-
SkyTabsetComponent.prototype.onNewTabClick = function () {
|
|
1884
|
-
this.newTab.emit();
|
|
1885
|
-
};
|
|
1886
|
-
SkyTabsetComponent.prototype.onOpenTabClick = function () {
|
|
1887
|
-
this.openTab.emit();
|
|
1888
|
-
};
|
|
1889
|
-
/**
|
|
1890
|
-
* Sets the initial active tab index based on the following criteria.
|
|
1891
|
-
* 1. Does the URL include a query param that reflects this tabset's active tab?
|
|
1892
|
-
* 2. Does one of the tab components have their `active` property set to `true`?
|
|
1893
|
-
* 3. Is the tabset component's `active` property set to a specific tab index?
|
|
1894
|
-
*/
|
|
1895
|
-
SkyTabsetComponent.prototype.getInitialTabIndex = function () {
|
|
1896
|
-
var _a;
|
|
1897
|
-
var activeIndex = this.getActiveTabIndexByPermalinkId();
|
|
1898
|
-
if (activeIndex === undefined) {
|
|
1899
|
-
activeIndex = (_a = this.getActiveTabComponent()) === null || _a === void 0 ? void 0 : _a.tabIndex;
|
|
1900
|
-
if (activeIndex === undefined) {
|
|
1901
|
-
activeIndex = this.active;
|
|
1902
|
-
}
|
|
1903
|
-
}
|
|
1904
|
-
return activeIndex;
|
|
1905
|
-
};
|
|
1906
|
-
SkyTabsetComponent.prototype.listenActiveIndexChange = function () {
|
|
1907
|
-
var _this = this;
|
|
1908
|
-
this.tabsetService.activeTabIndex
|
|
1909
|
-
.pipe(distinctUntilChanged(), takeUntil(this.ngUnsubscribe))
|
|
1910
|
-
.subscribe(function (activeIndex) {
|
|
1911
|
-
_this.updateTabsetComponent(activeIndex);
|
|
1912
|
-
});
|
|
1913
|
-
};
|
|
1914
|
-
SkyTabsetComponent.prototype.listenTabComponentsStructuralChange = function () {
|
|
1915
|
-
var _this = this;
|
|
1916
|
-
this.tabs.changes
|
|
1917
|
-
.pipe(takeUntil(this.ngUnsubscribe))
|
|
1918
|
-
.subscribe(function () {
|
|
1919
|
-
_this.resetTabComponents();
|
|
1920
|
-
});
|
|
1921
|
-
};
|
|
1922
|
-
SkyTabsetComponent.prototype.listenTabComponentsStateChange = function () {
|
|
1923
|
-
var _this = this;
|
|
1924
|
-
combineLatest(this.tabs.map(function (tab) { return tab.activeChange; }))
|
|
1925
|
-
.pipe(takeUntil(race(this.tabComponentsStateChangeUnsubscribe, this.ngUnsubscribe)))
|
|
1926
|
-
.subscribe(function () {
|
|
1927
|
-
// Wait for the tab components to render changes before finding the active one.
|
|
1928
|
-
setTimeout(function () {
|
|
1929
|
-
var _a;
|
|
1930
|
-
var tabIndex = (_a = _this.getActiveTabComponent()) === null || _a === void 0 ? void 0 : _a.tabIndex;
|
|
1931
|
-
_this.tabsetService.setActiveTabIndex(tabIndex);
|
|
1932
|
-
});
|
|
1933
|
-
});
|
|
1934
|
-
combineLatest(this.tabs.map(function (tab) { return tab.tabIndexChange; }))
|
|
1935
|
-
.pipe(takeUntil(race(this.tabComponentsStateChangeUnsubscribe, this.ngUnsubscribe)))
|
|
1936
|
-
.subscribe(function () {
|
|
1937
|
-
// Don't emit the first change.
|
|
1938
|
-
if (_this.lastActiveTabIndex !== undefined) {
|
|
1939
|
-
// Wait for the tab components to render changes before updating the view.
|
|
1940
|
-
setTimeout(function () {
|
|
1941
|
-
_this.updateTabsetComponent(_this.tabsetService.currentActiveTabIndex, true);
|
|
1942
|
-
_this.emitTabIndexChange();
|
|
1943
|
-
});
|
|
1944
|
-
}
|
|
1945
|
-
});
|
|
1946
|
-
combineLatest(this.tabs.map(function (tab) { return tab.stateChange; }))
|
|
1947
|
-
.pipe(takeUntil(race(this.tabComponentsStateChangeUnsubscribe, this.ngUnsubscribe)))
|
|
1948
|
-
.subscribe(function () {
|
|
1949
|
-
// Wait for the tab components to render changes before finding the active one.
|
|
1950
|
-
setTimeout(function () {
|
|
1951
|
-
_this.updateTabsetComponent(_this.tabsetService.currentActiveTabIndex, true);
|
|
1952
|
-
});
|
|
1953
|
-
});
|
|
1954
|
-
};
|
|
1955
|
-
SkyTabsetComponent.prototype.initTabComponents = function () {
|
|
1956
|
-
this.tabs.forEach(function (tab) { return tab.init(); });
|
|
1957
|
-
};
|
|
1958
|
-
SkyTabsetComponent.prototype.resetTabComponents = function () {
|
|
1959
|
-
var _a;
|
|
1960
|
-
this.unsubscribeTabComponentsStateChange();
|
|
1961
|
-
this.tabsetService.unregisterAll();
|
|
1962
|
-
// If there are no tab components, do a hard reset of the view.
|
|
1963
|
-
if (this.tabs.length === 0) {
|
|
1964
|
-
this.updateTabsetComponent(0, true);
|
|
1965
|
-
return;
|
|
1966
|
-
}
|
|
1967
|
-
this.initTabComponents();
|
|
1968
|
-
var activeIndex = (_a = this.getActiveTabComponent()) === null || _a === void 0 ? void 0 : _a.tabIndex;
|
|
1969
|
-
this.tabsetService.setActiveTabIndex(activeIndex, {
|
|
1970
|
-
emitChange: false
|
|
1971
|
-
});
|
|
1972
|
-
this.listenTabComponentsStateChange();
|
|
1973
|
-
};
|
|
1974
|
-
SkyTabsetComponent.prototype.emitTabIndexChange = function () {
|
|
1975
|
-
this.tabIndexesChange.emit({
|
|
1976
|
-
tabs: this.tabs.map(function (tab) { return ({
|
|
1977
|
-
tabHeading: tab.tabHeading,
|
|
1978
|
-
tabIndex: tab.tabIndex
|
|
1979
|
-
}); })
|
|
1980
|
-
});
|
|
1981
|
-
};
|
|
1982
|
-
SkyTabsetComponent.prototype.unsubscribeTabComponentsStateChange = function () {
|
|
1983
|
-
this.tabComponentsStateChangeUnsubscribe.next();
|
|
1984
|
-
this.tabComponentsStateChangeUnsubscribe.complete();
|
|
1985
|
-
this.tabComponentsStateChangeUnsubscribe = new Subject();
|
|
1986
|
-
};
|
|
1987
|
-
SkyTabsetComponent.prototype.listenTabButtonsOverflowChange = function () {
|
|
1988
|
-
var _this = this;
|
|
1989
|
-
this.adapterService.registerTabset(this.elementRef);
|
|
1990
|
-
this.adapterService.overflowChange
|
|
1991
|
-
.pipe(takeUntil(this.ngUnsubscribe))
|
|
1992
|
-
.subscribe(function (isOverflowing) {
|
|
1993
|
-
_this.tabDisplayMode = (isOverflowing) ? 'dropdown' : 'tabs';
|
|
1994
|
-
_this.changeDetector.markForCheck();
|
|
1995
|
-
});
|
|
1996
|
-
};
|
|
1997
|
-
/**
|
|
1998
|
-
* Listen for back/forward history button presses to detect query param changes in the URL.
|
|
1999
|
-
*/
|
|
2000
|
-
SkyTabsetComponent.prototype.listenLocationPopStateChange = function () {
|
|
2001
|
-
var _this = this;
|
|
2002
|
-
this.permalinkService.popStateChange
|
|
2003
|
-
.pipe(takeUntil(this.ngUnsubscribe))
|
|
2004
|
-
.subscribe(function () {
|
|
2005
|
-
_this.setActiveTabIndexByPermalinkId();
|
|
2006
|
-
});
|
|
2007
|
-
};
|
|
2008
|
-
SkyTabsetComponent.prototype.setActiveTabIndexByPermalinkId = function () {
|
|
2009
|
-
var activeIndex = this.getActiveTabIndexByPermalinkId();
|
|
2010
|
-
this.tabsetService.setActiveTabIndex(activeIndex);
|
|
2011
|
-
};
|
|
2012
|
-
SkyTabsetComponent.prototype.getActiveTabIndexByPermalinkId = function () {
|
|
2013
|
-
var _a;
|
|
2014
|
-
if (this.permalinkId) {
|
|
2015
|
-
var paramValue_1 = this.permalinkService.getParam(this.permalinkId);
|
|
2016
|
-
if (paramValue_1) {
|
|
2017
|
-
return (_a = this.tabs.find(function (tab) { return tab.permalinkValue === paramValue_1; })) === null || _a === void 0 ? void 0 : _a.tabIndex;
|
|
2018
|
-
}
|
|
2019
|
-
}
|
|
2020
|
-
};
|
|
2021
|
-
SkyTabsetComponent.prototype.getActiveTabComponent = function () {
|
|
2022
|
-
return this.tabs.toArray().reverse().find(function (tab) { return tab.active === true; });
|
|
2023
|
-
};
|
|
2024
|
-
SkyTabsetComponent.prototype.createTabButtons = function (activeIndex) {
|
|
2025
|
-
var _this = this;
|
|
2026
|
-
return this.tabs.map(function (tab) { return ({
|
|
2027
|
-
active: _this.tabsetService.tabIndexesEqual(tab.tabIndex, activeIndex),
|
|
2028
|
-
closeable: tab.closeable,
|
|
2029
|
-
ariaControls: tab.tabPanelId,
|
|
2030
|
-
disabled: tab.disabled,
|
|
2031
|
-
/*tslint:disable-next-line:no-null-keyword*/
|
|
2032
|
-
buttonHref: (tab.disabled) ? null : _this.permalinkService.getParamHref(_this.permalinkId, tab.permalinkValue),
|
|
2033
|
-
buttonId: tab.tabButtonId,
|
|
2034
|
-
buttonTextCount: tab.tabHeaderCount,
|
|
2035
|
-
buttonText: tab.tabHeading,
|
|
2036
|
-
tabIndex: tab.tabIndex
|
|
2037
|
-
}); });
|
|
2038
|
-
};
|
|
2039
|
-
SkyTabsetComponent.prototype.updateTabButtons = function (activeIndex) {
|
|
2040
|
-
var _this = this;
|
|
2041
|
-
this.tabButtons.forEach(function (button) {
|
|
2042
|
-
button.active = _this.tabsetService.tabIndexesEqual(button.tabIndex, activeIndex);
|
|
2043
|
-
});
|
|
2044
|
-
};
|
|
2045
|
-
/**
|
|
2046
|
-
* Updates the UI and state of the tabset component after the tab index or
|
|
2047
|
-
* tab components have changed.
|
|
2048
|
-
* @param activeIndex The currently active tab index.
|
|
2049
|
-
* @param regenerateTabButtons Indicates if tab button view models should be regenerated.
|
|
2050
|
-
* Setting this value to `false` will simply update the existing tab buttons. Setting this value
|
|
2051
|
-
* to `true` is only necessary when the underlying tab components have changed and the tab
|
|
2052
|
-
* buttons must reflect those changes.
|
|
2053
|
-
*/
|
|
2054
|
-
SkyTabsetComponent.prototype.updateTabsetComponent = function (activeIndex, regenerateTabButtons) {
|
|
2055
|
-
var _this = this;
|
|
2056
|
-
if (regenerateTabButtons === void 0) { regenerateTabButtons = false; }
|
|
2057
|
-
var _a;
|
|
2058
|
-
// Activate/deactivate tab components.
|
|
2059
|
-
this.tabs.forEach(function (tab) {
|
|
2060
|
-
_this.tabsetService.tabIndexesEqual(tab.tabIndex, activeIndex)
|
|
2061
|
-
? tab.activate()
|
|
2062
|
-
: tab.deactivate();
|
|
2063
|
-
});
|
|
2064
|
-
// Update the tab button models.
|
|
2065
|
-
if (regenerateTabButtons || !this.tabButtons.length) {
|
|
2066
|
-
this.tabButtons = this.createTabButtons(activeIndex);
|
|
2067
|
-
}
|
|
2068
|
-
else {
|
|
2069
|
-
this.updateTabButtons(activeIndex);
|
|
2070
|
-
}
|
|
2071
|
-
// Update the dropdown trigger button text.
|
|
2072
|
-
this.dropdownTriggerButtonText = (_a = this.tabButtons.find(function (b) {
|
|
2073
|
-
return _this.tabsetService.tabIndexesEqual(b.tabIndex, activeIndex);
|
|
2074
|
-
})) === null || _a === void 0 ? void 0 : _a.buttonText;
|
|
2075
|
-
// Set the query params based on active tab.
|
|
2076
|
-
if (this.permalinkId) {
|
|
2077
|
-
var activeTabComponent = this.tabs.find(function (tab) {
|
|
2078
|
-
return _this.tabsetService.tabIndexesEqual(tab.tabIndex, activeIndex);
|
|
2079
|
-
});
|
|
2080
|
-
this.permalinkService.setParam(this.permalinkId, activeTabComponent.permalinkValue);
|
|
2081
|
-
}
|
|
2082
|
-
// Wait for tab button view models to render before gauging dimensions.
|
|
2083
|
-
setTimeout(function () {
|
|
2084
|
-
_this.adapterService.detectOverflow();
|
|
2085
|
-
});
|
|
2086
|
-
this.changeDetector.markForCheck();
|
|
2087
|
-
// Emit the new active index value to consumers.
|
|
2088
|
-
if (this.lastActiveTabIndex !== activeIndex) {
|
|
2089
|
-
this.lastActiveTabIndex = activeIndex;
|
|
2090
|
-
this.activeChange.emit(activeIndex);
|
|
2091
|
-
}
|
|
2092
|
-
};
|
|
2093
|
-
SkyTabsetComponent.ctorParameters = function () { return [
|
|
2094
|
-
{ type: ChangeDetectorRef },
|
|
2095
|
-
{ type: ElementRef },
|
|
2096
|
-
{ type: SkyTabsetAdapterService },
|
|
2097
|
-
{ type: SkyTabsetPermalinkService },
|
|
2098
|
-
{ type: SkyTabsetService }
|
|
2099
|
-
]; };
|
|
2100
|
-
__decorate([
|
|
2101
|
-
Input()
|
|
2102
|
-
], SkyTabsetComponent.prototype, "active", null);
|
|
2103
|
-
__decorate([
|
|
2104
|
-
Input()
|
|
2105
|
-
], SkyTabsetComponent.prototype, "ariaLabel", void 0);
|
|
2106
|
-
__decorate([
|
|
2107
|
-
Input()
|
|
2108
|
-
], SkyTabsetComponent.prototype, "ariaLabelledBy", void 0);
|
|
2109
|
-
__decorate([
|
|
2110
|
-
Input()
|
|
2111
|
-
], SkyTabsetComponent.prototype, "permalinkId", null);
|
|
2112
|
-
__decorate([
|
|
2113
|
-
Input()
|
|
2114
|
-
], SkyTabsetComponent.prototype, "tabStyle", null);
|
|
2115
|
-
__decorate([
|
|
2116
|
-
Output()
|
|
2117
|
-
], SkyTabsetComponent.prototype, "activeChange", void 0);
|
|
2118
|
-
__decorate([
|
|
2119
|
-
Output()
|
|
2120
|
-
], SkyTabsetComponent.prototype, "newTab", void 0);
|
|
2121
|
-
__decorate([
|
|
2122
|
-
Output()
|
|
2123
|
-
], SkyTabsetComponent.prototype, "openTab", void 0);
|
|
2124
|
-
__decorate([
|
|
2125
|
-
Output()
|
|
2126
|
-
], SkyTabsetComponent.prototype, "tabIndexesChange", void 0);
|
|
2127
|
-
__decorate([
|
|
2128
|
-
ContentChildren(SkyTabComponent)
|
|
2129
|
-
], SkyTabsetComponent.prototype, "tabs", void 0);
|
|
2130
|
-
SkyTabsetComponent = __decorate([
|
|
2131
|
-
Component({
|
|
2132
|
-
selector: 'sky-tabset',
|
|
2133
|
-
template: "<div\n class=\"sky-tabset\"\n role=\"tablist\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledBy\"\n [ngClass]=\"'sky-tabset-mode-' + tabDisplayMode + ' sky-tabset-style-' + tabStyle\"\n (window:resize)=\"onWindowResize()\"\n>\n <span class=\"sky-tabset-dropdown\">\n <sky-dropdown *ngIf=\"tabDisplayMode === 'dropdown'\"\n buttonType=\"tab\"\n >\n <sky-dropdown-button>\n {{ dropdownTriggerButtonText }}\n </sky-dropdown-button>\n <sky-dropdown-menu>\n <sky-dropdown-item *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 *ngTemplateOutlet=\"tabButtonTemplate; context: {\n $implicit: tabButton\n }\"></ng-container>\n </div>\n </sky-dropdown-item>\n </sky-dropdown-menu>\n </sky-dropdown>\n </span>\n <span\n class=\"sky-tabset-tabs\"\n >\n <ng-container *ngFor=\"let tabButton of tabButtons\">\n <ng-container *ngTemplateOutlet=\"tabButtonTemplate; context: {\n $implicit: tabButton\n }\"></ng-container>\n </ng-container>\n </span>\n <span\n class=\"sky-tabset-btns\"\n >\n <button *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\n icon=\"plus-circle\"\n size=\"lg\"\n >\n </sky-icon>\n </button>\n <button *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\n icon=\"folder-open-o\"\n size=\"lg\"\n >\n </sky-icon>\n </button>\n </span>\n</div>\n<ng-content></ng-content>\n\n<ng-template\n let-tabButton\n #tabButtonTemplate\n>\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",
|
|
2134
|
-
providers: [
|
|
2135
|
-
SkyTabsetAdapterService,
|
|
2136
|
-
SkyTabsetPermalinkService,
|
|
2137
|
-
SkyTabsetService
|
|
2138
|
-
],
|
|
2139
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2140
|
-
encapsulation: ViewEncapsulation.None,
|
|
2141
|
-
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;padding-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-tabset{border-bottom:1px solid #d2d2d2;overflow:visible}.sky-theme-modern .sky-tab-dropdown-menu-item .sky-btn-tab-wrapper{margin-right:0}"]
|
|
2142
|
-
})
|
|
2143
|
-
], SkyTabsetComponent);
|
|
2144
|
-
return SkyTabsetComponent;
|
|
2145
|
-
}());
|
|
2146
|
-
|
|
2147
|
-
var SkyTabsModule = /** @class */ (function () {
|
|
2148
|
-
function SkyTabsModule() {
|
|
2149
|
-
}
|
|
2150
|
-
SkyTabsModule = __decorate([
|
|
2151
|
-
NgModule({
|
|
2152
|
-
declarations: [
|
|
2153
|
-
SkyTabButtonComponent,
|
|
2154
|
-
SkyTabComponent,
|
|
2155
|
-
SkyTabsetComponent,
|
|
2156
|
-
SkyTabsetNavButtonComponent
|
|
2157
|
-
],
|
|
2158
|
-
imports: [
|
|
2159
|
-
CommonModule,
|
|
2160
|
-
RouterModule,
|
|
2161
|
-
SkyDropdownModule,
|
|
2162
|
-
SkyI18nModule,
|
|
2163
|
-
SkyIconModule,
|
|
2164
|
-
SkyTabsResourcesModule,
|
|
2165
|
-
SkyThemeModule
|
|
2166
|
-
],
|
|
2167
|
-
exports: [
|
|
2168
|
-
SkyTabComponent,
|
|
2169
|
-
SkyTabsetComponent,
|
|
2170
|
-
SkyTabsetNavButtonComponent
|
|
2171
|
-
]
|
|
2172
|
-
})
|
|
2173
|
-
], SkyTabsModule);
|
|
2174
|
-
return SkyTabsModule;
|
|
2175
|
-
}());
|
|
2176
|
-
|
|
2177
|
-
/**
|
|
2178
|
-
* Generated bundle index. Do not edit.
|
|
2179
|
-
*/
|
|
2180
|
-
|
|
2181
|
-
export { SkySectionedFormComponent, SkySectionedFormModule, SkySectionedFormService, SkyTabsModule, SkyVerticalTabsetModule, VISIBLE_STATE as ɵa, HIDDEN_STATE as ɵb, SkyVerticalTabsetService as ɵc, SkySectionedFormSectionComponent as ɵd, SkyVerticalTabComponent as ɵe, SkyVerticalTabMediaQueryService as ɵf, SkyVerticalTabsetAdapterService as ɵg, SkyVerticalTabsetComponent as ɵh, SkyVerticalTabsetGroupComponent as ɵi, SkyTabsResourcesModule as ɵj, SkyTabsResourcesProvider as ɵk, SkyTabButtonComponent as ɵl, SkyTabComponent as ɵm, SkyTabsetPermalinkService as ɵn, SkyTabsetService as ɵo, SkyTabsetComponent as ɵp, SkyTabsetAdapterService as ɵq, SkyTabsetNavButtonComponent as ɵr };
|
|
2182
|
-
//# sourceMappingURL=skyux-tabs.js.map
|