@fluid-topics/ft-tabs 1.2.5 → 1.2.7
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/build/ft-base-tabs.d.ts +1 -0
- package/build/ft-base-tabs.js +17 -5
- package/build/ft-tab.properties.d.ts +1 -0
- package/build/ft-tabs.d.ts +0 -2
- package/build/ft-tabs.js +0 -4
- package/build/ft-tabs.light.js +96 -76
- package/build/ft-tabs.min.js +129 -109
- package/build/ftds-tabs.js +1 -0
- package/build/ftds-tabs.styles.js +22 -2
- package/package.json +7 -7
package/build/ft-base-tabs.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ export declare abstract class FtBaseTabs extends FtLitElement implements FtBaseT
|
|
|
23
23
|
private tabsContainer?;
|
|
24
24
|
private activeTab?;
|
|
25
25
|
private activeTabIndicator?;
|
|
26
|
+
horizontal: boolean;
|
|
26
27
|
activeIndex?: number;
|
|
27
28
|
abstract get tabsClasses(): ClassInfo;
|
|
28
29
|
protected render(): TemplateResult<1>;
|
package/build/ft-base-tabs.js
CHANGED
|
@@ -32,6 +32,7 @@ class FtBaseTabs extends FtLitElement {
|
|
|
32
32
|
super(...arguments);
|
|
33
33
|
this.alignTabs = FtTabsAlignment.justify;
|
|
34
34
|
this.ftTabs = [];
|
|
35
|
+
this.horizontal = false;
|
|
35
36
|
this.activeIndex = 0;
|
|
36
37
|
this.updateDebouncer = new Debouncer(2);
|
|
37
38
|
this.onTabUpdated = () => this.updateDebouncer.run(() => {
|
|
@@ -122,16 +123,24 @@ class FtBaseTabs extends FtLitElement {
|
|
|
122
123
|
this.placeActiveTabIndicator(this.activeTabIndicator, this.activeTab);
|
|
123
124
|
}
|
|
124
125
|
placeActiveTabIndicator(activeTabIndicator, activeTab) {
|
|
125
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
126
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
126
127
|
if (activeTabIndicator) {
|
|
127
128
|
const target = (_a = activeTab === null || activeTab === void 0 ? void 0 : activeTab.closest(".ft-tabs--tab-tooltip")) !== null && _a !== void 0 ? _a : activeTab;
|
|
128
129
|
if (target) {
|
|
129
130
|
const targetHeight = (_c = (_b = target === null || target === void 0 ? void 0 : target.getBoundingClientRect()) === null || _b === void 0 ? void 0 : _b.height) !== null && _c !== void 0 ? _c : 0;
|
|
130
131
|
const targetWidth = (_e = (_d = target === null || target === void 0 ? void 0 : target.getBoundingClientRect()) === null || _d === void 0 ? void 0 : _d.width) !== null && _e !== void 0 ? _e : 0;
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
132
|
+
if (this.horizontal) {
|
|
133
|
+
activeTabIndicator.style.height = targetHeight + "px";
|
|
134
|
+
activeTabIndicator.style.width = "3px";
|
|
135
|
+
activeTabIndicator.style.left = ((_f = target === null || target === void 0 ? void 0 : target.offsetLeft) !== null && _f !== void 0 ? _f : 0) + targetWidth - 3 + "px";
|
|
136
|
+
activeTabIndicator.style.top = ((_g = target === null || target === void 0 ? void 0 : target.offsetTop) !== null && _g !== void 0 ? _g : 0) + "px";
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
activeTabIndicator.style.height = "3px";
|
|
140
|
+
activeTabIndicator.style.width = targetWidth + "px";
|
|
141
|
+
activeTabIndicator.style.left = ((_h = target === null || target === void 0 ? void 0 : target.offsetLeft) !== null && _h !== void 0 ? _h : 0) + "px";
|
|
142
|
+
activeTabIndicator.style.top = (((_j = target === null || target === void 0 ? void 0 : target.offsetTop) !== null && _j !== void 0 ? _j : 0) + targetHeight - 3) + "px";
|
|
143
|
+
}
|
|
135
144
|
}
|
|
136
145
|
else {
|
|
137
146
|
activeTabIndicator.style.height = "0px";
|
|
@@ -173,6 +182,9 @@ __decorate([
|
|
|
173
182
|
__decorate([
|
|
174
183
|
query(".ft-tabs--active-tab-indicator")
|
|
175
184
|
], FtBaseTabs.prototype, "activeTabIndicator", void 0);
|
|
185
|
+
__decorate([
|
|
186
|
+
property({ type: Boolean })
|
|
187
|
+
], FtBaseTabs.prototype, "horizontal", void 0);
|
|
176
188
|
__decorate([
|
|
177
189
|
optionalNumberProperty({ reflect: true })
|
|
178
190
|
], FtBaseTabs.prototype, "activeIndex", void 0);
|
package/build/ft-tabs.d.ts
CHANGED
|
@@ -5,13 +5,11 @@ import { TemplateResult } from "lit";
|
|
|
5
5
|
export interface FtTabsProperties extends FtBaseTabsProperties {
|
|
6
6
|
dense: boolean;
|
|
7
7
|
collapsible: boolean;
|
|
8
|
-
horizontal: boolean;
|
|
9
8
|
contentBefore: boolean;
|
|
10
9
|
}
|
|
11
10
|
export declare class FtTabs extends FtBaseTabs implements FtTabsProperties {
|
|
12
11
|
dense: boolean;
|
|
13
12
|
collapsible: boolean;
|
|
14
|
-
horizontal: boolean;
|
|
15
13
|
contentBefore: boolean;
|
|
16
14
|
static styles: import("lit").CSSResult[];
|
|
17
15
|
get tabsClasses(): ClassInfo;
|
package/build/ft-tabs.js
CHANGED
|
@@ -14,7 +14,6 @@ class FtTabs extends FtBaseTabs {
|
|
|
14
14
|
super(...arguments);
|
|
15
15
|
this.dense = false;
|
|
16
16
|
this.collapsible = false;
|
|
17
|
-
this.horizontal = false;
|
|
18
17
|
this.contentBefore = false;
|
|
19
18
|
}
|
|
20
19
|
get tabsClasses() {
|
|
@@ -93,9 +92,6 @@ __decorate([
|
|
|
93
92
|
__decorate([
|
|
94
93
|
property({ type: Boolean })
|
|
95
94
|
], FtTabs.prototype, "collapsible", void 0);
|
|
96
|
-
__decorate([
|
|
97
|
-
property({ type: Boolean })
|
|
98
|
-
], FtTabs.prototype, "horizontal", void 0);
|
|
99
95
|
__decorate([
|
|
100
96
|
property({ type: Boolean })
|
|
101
97
|
], FtTabs.prototype, "contentBefore", void 0);
|