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