@db-ux/wc-core-components 4.6.1 → 4.7.0-tabs-34782eb
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/CHANGELOG.md +8 -0
- package/agent/Tabs.md +30 -30
- package/dist/cjs/db-accordion-item.cjs.entry.js +2 -2
- package/dist/cjs/db-accordion.cjs.entry.js +1 -1
- package/dist/cjs/db-badge.cjs.entry.js +1 -1
- package/dist/cjs/db-brand.cjs.entry.js +1 -1
- package/dist/cjs/db-button.cjs.entry.js +1 -1
- package/dist/cjs/db-card.cjs.entry.js +2 -2
- package/dist/cjs/db-checkbox.cjs.entry.js +2 -2
- package/dist/cjs/db-custom-button.cjs.entry.js +2 -2
- package/dist/cjs/db-custom-select-dropdown_5.cjs.entry.js +9 -9
- package/dist/cjs/db-custom-select-form-field.cjs.entry.js +2 -2
- package/dist/cjs/db-custom-select.cjs.entry.js +5 -5
- package/dist/cjs/db-divider.cjs.entry.js +1 -1
- package/dist/cjs/db-drawer.cjs.entry.js +3 -3
- package/dist/cjs/db-header.cjs.entry.js +2 -2
- package/dist/cjs/db-icon.cjs.entry.js +1 -1
- package/dist/cjs/db-infotext.cjs.entry.js +1 -1
- package/dist/cjs/db-link.cjs.entry.js +1 -1
- package/dist/cjs/db-navigation-item.cjs.entry.js +1 -1
- package/dist/cjs/db-navigation.cjs.entry.js +2 -2
- package/dist/cjs/db-notification.cjs.entry.js +2 -2
- package/dist/cjs/db-page.cjs.entry.js +2 -2
- package/dist/cjs/db-popover.cjs.entry.js +2 -2
- package/dist/cjs/db-radio.cjs.entry.js +1 -1
- package/dist/cjs/db-section.cjs.entry.js +2 -2
- package/dist/cjs/db-select.cjs.entry.js +2 -2
- package/dist/cjs/db-stack.cjs.entry.js +2 -2
- package/dist/cjs/db-switch.cjs.entry.js +2 -2
- package/dist/cjs/db-tab-item_3.cjs.entry.js +133 -67
- package/dist/cjs/db-tabs.cjs.entry.js +373 -123
- package/dist/cjs/db-textarea.cjs.entry.js +2 -2
- package/dist/cjs/db-tooltip.cjs.entry.js +3 -4
- package/dist/cjs/db-ux.cjs.js +1 -1
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/accordion/accordion.js +1 -1
- package/dist/collection/components/accordion-item/accordion-item.js +2 -2
- package/dist/collection/components/badge/badge.js +1 -1
- package/dist/collection/components/brand/brand.js +1 -1
- package/dist/collection/components/button/button.js +1 -1
- package/dist/collection/components/card/card.js +2 -2
- package/dist/collection/components/checkbox/checkbox.js +2 -2
- package/dist/collection/components/custom-button/custom-button.js +2 -2
- package/dist/collection/components/custom-select/custom-select.js +5 -5
- package/dist/collection/components/custom-select-dropdown/custom-select-dropdown.js +2 -2
- package/dist/collection/components/custom-select-form-field/custom-select-form-field.js +2 -2
- package/dist/collection/components/custom-select-list/custom-select-list.js +2 -2
- package/dist/collection/components/custom-select-list-item/custom-select-list-item.js +1 -1
- package/dist/collection/components/divider/divider.js +1 -1
- package/dist/collection/components/drawer/drawer.js +3 -3
- package/dist/collection/components/header/header.js +2 -2
- package/dist/collection/components/icon/icon.js +1 -1
- package/dist/collection/components/infotext/infotext.js +1 -1
- package/dist/collection/components/input/input.js +2 -2
- package/dist/collection/components/link/link.js +1 -1
- package/dist/collection/components/navigation/navigation.js +2 -2
- package/dist/collection/components/navigation-item/navigation-item.js +1 -1
- package/dist/collection/components/notification/notification.js +2 -2
- package/dist/collection/components/page/page.js +2 -2
- package/dist/collection/components/popover/popover.js +2 -2
- package/dist/collection/components/radio/radio.js +1 -1
- package/dist/collection/components/section/section.js +2 -2
- package/dist/collection/components/select/select.js +2 -2
- package/dist/collection/components/stack/stack.js +2 -2
- package/dist/collection/components/switch/switch.js +2 -2
- package/dist/collection/components/tab-item/tab-item.js +198 -129
- package/dist/collection/components/tab-list/tab-list.js +74 -12
- package/dist/collection/components/tab-panel/tab-panel.js +80 -2
- package/dist/collection/components/tabs/tabs.js +504 -167
- package/dist/collection/components/tag/tag.js +2 -2
- package/dist/collection/components/textarea/textarea.js +2 -2
- package/dist/collection/components/tooltip/tooltip.js +3 -4
- package/dist/collection/shared/model.js +1 -1
- package/dist/custom-elements.json +4021 -3053
- package/dist/db-ux/db-ux.esm.js +1 -1
- package/dist/db-ux/index.esm.js +1 -1
- package/dist/db-ux/{p-2355324e.entry.js → p-01c278b9.entry.js} +1 -1
- package/dist/db-ux/{p-5f5eb78d.entry.js → p-071ae423.entry.js} +1 -1
- package/dist/db-ux/{p-abb0885d.entry.js → p-07c7ecc9.entry.js} +1 -1
- package/dist/db-ux/p-10869bfa.entry.js +1 -0
- package/dist/db-ux/p-1427bb15.entry.js +1 -0
- package/dist/db-ux/{p-70823b80.entry.js → p-328faf6b.entry.js} +1 -1
- package/dist/db-ux/p-397bc590.entry.js +1 -0
- package/dist/db-ux/{p-d85b1c15.entry.js → p-43a9623f.entry.js} +1 -1
- package/dist/db-ux/{p-67d59d5b.entry.js → p-44a0407b.entry.js} +1 -1
- package/dist/db-ux/{p-12a2c502.entry.js → p-61784f7a.entry.js} +1 -1
- package/dist/db-ux/p-68835a75.entry.js +1 -0
- package/dist/db-ux/p-68a995df.entry.js +1 -0
- package/dist/db-ux/{p-a65d0d23.entry.js → p-6c26b0ba.entry.js} +1 -1
- package/dist/db-ux/p-6e898a58.entry.js +1 -0
- package/dist/db-ux/{p-761c9ddf.entry.js → p-70e6d32f.entry.js} +1 -1
- package/dist/db-ux/p-71868bb5.entry.js +1 -0
- package/dist/db-ux/{p-bed8d029.entry.js → p-74a45768.entry.js} +1 -1
- package/dist/db-ux/{p-ba8464d2.entry.js → p-9a895c18.entry.js} +1 -1
- package/dist/db-ux/p-9b4d0c18.entry.js +1 -0
- package/dist/db-ux/{p-0e0c3c72.entry.js → p-9b518eb4.entry.js} +1 -1
- package/dist/db-ux/p-a927fe88.entry.js +1 -0
- package/dist/db-ux/p-a93ca690.entry.js +1 -0
- package/dist/db-ux/{p-212bde1e.entry.js → p-b06fe221.entry.js} +1 -1
- package/dist/db-ux/{p-13157b54.entry.js → p-b7087f0b.entry.js} +1 -1
- package/dist/db-ux/{p-d8b38722.entry.js → p-d93b9d58.entry.js} +1 -1
- package/dist/db-ux/p-d97c0787.entry.js +1 -0
- package/dist/db-ux/{p-c76089f6.entry.js → p-ee43015b.entry.js} +1 -1
- package/dist/db-ux/p-efde1b6e.entry.js +1 -0
- package/dist/db-ux/{p-5cb74480.entry.js → p-f08b14d9.entry.js} +1 -1
- package/dist/db-ux/p-f92cbbae.entry.js +1 -0
- package/dist/db-ux/{p-980a6afe.entry.js → p-ffe614c8.entry.js} +1 -1
- package/dist/esm/db-accordion-item.entry.js +2 -2
- package/dist/esm/db-accordion.entry.js +1 -1
- package/dist/esm/db-badge.entry.js +1 -1
- package/dist/esm/db-brand.entry.js +1 -1
- package/dist/esm/db-button.entry.js +1 -1
- package/dist/esm/db-card.entry.js +2 -2
- package/dist/esm/db-checkbox.entry.js +2 -2
- package/dist/esm/db-custom-button.entry.js +2 -2
- package/dist/esm/db-custom-select-dropdown_5.entry.js +9 -9
- package/dist/esm/db-custom-select-form-field.entry.js +2 -2
- package/dist/esm/db-custom-select.entry.js +5 -5
- package/dist/esm/db-divider.entry.js +1 -1
- package/dist/esm/db-drawer.entry.js +3 -3
- package/dist/esm/db-header.entry.js +2 -2
- package/dist/esm/db-icon.entry.js +1 -1
- package/dist/esm/db-infotext.entry.js +1 -1
- package/dist/esm/db-link.entry.js +1 -1
- package/dist/esm/db-navigation-item.entry.js +1 -1
- package/dist/esm/db-navigation.entry.js +2 -2
- package/dist/esm/db-notification.entry.js +2 -2
- package/dist/esm/db-page.entry.js +2 -2
- package/dist/esm/db-popover.entry.js +2 -2
- package/dist/esm/db-radio.entry.js +1 -1
- package/dist/esm/db-section.entry.js +2 -2
- package/dist/esm/db-select.entry.js +2 -2
- package/dist/esm/db-stack.entry.js +2 -2
- package/dist/esm/db-switch.entry.js +2 -2
- package/dist/esm/db-tab-item_3.entry.js +134 -68
- package/dist/esm/db-tabs.entry.js +373 -123
- package/dist/esm/db-textarea.entry.js +2 -2
- package/dist/esm/db-tooltip.entry.js +4 -5
- package/dist/esm/db-ux.js +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/tab-item/model.d.ts +28 -11
- package/dist/types/components/tab-item/tab-item.d.ts +22 -20
- package/dist/types/components/tab-list/model.d.ts +15 -5
- package/dist/types/components/tab-list/tab-list.d.ts +4 -1
- package/dist/types/components/tab-panel/model.d.ts +13 -3
- package/dist/types/components/tab-panel/tab-panel.d.ts +3 -0
- package/dist/types/components/tabs/model.d.ts +51 -17
- package/dist/types/components/tabs/tabs.d.ts +35 -16
- package/dist/types/components.d.ts +80 -30
- package/dist/types/shared/model.d.ts +5 -5
- package/dist/vscode.html-custom-data.json +153 -59
- package/dist/web-types.json +297 -135
- package/package.json +3 -3
- package/dist/db-ux/p-202323c2.entry.js +0 -1
- package/dist/db-ux/p-21068628.entry.js +0 -1
- package/dist/db-ux/p-377987d0.entry.js +0 -1
- package/dist/db-ux/p-3d5d49ff.entry.js +0 -1
- package/dist/db-ux/p-452a8b6b.entry.js +0 -1
- package/dist/db-ux/p-4de2c697.entry.js +0 -1
- package/dist/db-ux/p-605013f0.entry.js +0 -1
- package/dist/db-ux/p-6f9e146e.entry.js +0 -1
- package/dist/db-ux/p-7fa91164.entry.js +0 -1
- package/dist/db-ux/p-8e84712d.entry.js +0 -1
- package/dist/db-ux/p-a9efbb0b.entry.js +0 -1
- package/dist/db-ux/p-bd66d144.entry.js +0 -1
- package/dist/db-ux/p-dd08f6e4.entry.js +0 -1
|
@@ -48,9 +48,9 @@ const DBStack = class {
|
|
|
48
48
|
}
|
|
49
49
|
render() {
|
|
50
50
|
var _a, _b;
|
|
51
|
-
return (index.h("div", { key: '
|
|
51
|
+
return (index.h("div", { key: '7b1914f7484d0116dbdcca6c2b8fd62ee5f5361d', class: index$1.cls("db-stack", this.className), ref: (el) => {
|
|
52
52
|
this._ref = el;
|
|
53
|
-
}, id: (_a = this.id) !== null && _a !== void 0 ? _a : (_b = this.propOverrides) === null || _b === void 0 ? void 0 : _b.id, "data-gap": this.gap, "data-variant": this.variant, "data-direction": this.direction, "data-alignment": this.alignment, "data-justify-content": this.justifyContent, "data-wrap": index$1.getBooleanAsString(this.wrap) }, index.h("slot", { key: '
|
|
53
|
+
}, id: (_a = this.id) !== null && _a !== void 0 ? _a : (_b = this.propOverrides) === null || _b === void 0 ? void 0 : _b.id, "data-gap": this.gap, "data-variant": this.variant, "data-direction": this.direction, "data-alignment": this.alignment, "data-justify-content": this.justifyContent, "data-wrap": index$1.getBooleanAsString(this.wrap) }, index.h("slot", { key: '8b24b8791579cab2d6e5597f983ee488e860172d' })));
|
|
54
54
|
}
|
|
55
55
|
};
|
|
56
56
|
|
|
@@ -188,9 +188,9 @@ const DBSwitch = class {
|
|
|
188
188
|
}
|
|
189
189
|
render() {
|
|
190
190
|
var _a, _b;
|
|
191
|
-
return (index.h("div", { key: '
|
|
191
|
+
return (index.h("div", { key: 'ef12ecb991d547a453f5a35d6a9502e2b811ea2b', class: index$1.cls("db-switch", this.className), "data-visual-aid": index$1.getBooleanAsString(this.visualAid), "data-size": this.size, "data-hide-label": index$1.getHideProp(this.showLabel), "data-variant": this.variant, "data-hide-asterisk": index$1.getHideProp(this.showRequiredAsterisk), "data-custom-validity": this.validation }, index.h("label", { key: 'a037c403a8204c7093c5a29517235dbee5684c67', htmlFor: this._id }, index.h("input", { key: '513e08da8efc09d2b8c4b8bc12d6b46019988e63', type: "checkbox", role: "switch", id: this._id, ref: (el) => {
|
|
192
192
|
this._ref = el;
|
|
193
|
-
}, checked: index$1.getBoolean(this.checked, "checked"), value: this.value, disabled: index$1.getBoolean(this.disabled, "disabled"), "aria-invalid": this.validation === "invalid" ? "true" : undefined, "aria-describedby": this._descByIds, name: this.name, required: index$1.getBoolean(this.required, "required"), "data-aid-icon": (_a = this.iconLeading) !== null && _a !== void 0 ? _a : this.icon, "data-aid-icon-trailing": this.iconTrailing, onChange: (event) => this.handleChange(event), onBlur: (event) => this.handleBlur(event), onFocus: (event) => this.handleFocus(event), onKeyDown: (event) => this.handleKeyDown(event) }), this.label ? this.label : index.h("slot", null)), index$1.stringPropVisible(this.message, this.showMessage) ? (index.h("db-infotext", { size: "small", semantic: "adaptive", id: this._messageId, icon: this.messageIcon }, this.message)) : null, this.hasValidState() ? (index.h("db-infotext", { size: "small", semantic: "successful", id: this._validMessageId }, (_b = this.validMessage) !== null && _b !== void 0 ? _b : constants.DEFAULT_VALID_MESSAGE)) : null, index.h("db-infotext", { key: '
|
|
193
|
+
}, checked: index$1.getBoolean(this.checked, "checked"), value: this.value, disabled: index$1.getBoolean(this.disabled, "disabled"), "aria-invalid": this.validation === "invalid" ? "true" : undefined, "aria-describedby": this._descByIds, name: this.name, required: index$1.getBoolean(this.required, "required"), "data-aid-icon": (_a = this.iconLeading) !== null && _a !== void 0 ? _a : this.icon, "data-aid-icon-trailing": this.iconTrailing, onChange: (event) => this.handleChange(event), onBlur: (event) => this.handleBlur(event), onFocus: (event) => this.handleFocus(event), onKeyDown: (event) => this.handleKeyDown(event) }), this.label ? this.label : index.h("slot", null)), index$1.stringPropVisible(this.message, this.showMessage) ? (index.h("db-infotext", { size: "small", semantic: "adaptive", id: this._messageId, icon: this.messageIcon }, this.message)) : null, this.hasValidState() ? (index.h("db-infotext", { size: "small", semantic: "successful", id: this._validMessageId }, (_b = this.validMessage) !== null && _b !== void 0 ? _b : constants.DEFAULT_VALID_MESSAGE)) : null, index.h("db-infotext", { key: '88bbba78f87645a478e74ddf003303406e333c8f', size: "small", semantic: "critical", id: this._invalidMessageId }, this._invalidMessage), index.h("span", { key: 'd3564c75c3c4a8aefd24b91665345425af9c9071', "data-visually-hidden": "true", role: "status" }, this._voiceOverFallback)));
|
|
194
194
|
}
|
|
195
195
|
static get watchers() { return {
|
|
196
196
|
"id": [{
|
|
@@ -6,31 +6,50 @@ var index$1 = require('./index-2_9ESkQu.js');
|
|
|
6
6
|
const DBTabItem = class {
|
|
7
7
|
constructor(hostRef) {
|
|
8
8
|
index.registerInstance(this, hostRef);
|
|
9
|
-
this.
|
|
10
|
-
this._selected = false;
|
|
11
|
-
this._name = undefined;
|
|
9
|
+
this.click = index.createEvent(this, "click");
|
|
12
10
|
this.initialized = false;
|
|
13
|
-
this.
|
|
14
|
-
this.
|
|
11
|
+
this.internalActive = false;
|
|
12
|
+
this.internalTabIndex = -1;
|
|
13
|
+
this.isTruncated = false;
|
|
14
|
+
this.tooltipText = "";
|
|
15
|
+
this._resizeObserver = null;
|
|
16
|
+
this._ariaSelectedListener = null;
|
|
15
17
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
getCurrentTabIndex() {
|
|
19
|
+
return this.tabIndex !== undefined
|
|
20
|
+
? Number(this.tabIndex)
|
|
21
|
+
: this.internalTabIndex;
|
|
19
22
|
}
|
|
20
|
-
|
|
21
|
-
if (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
this._name = value;
|
|
27
|
-
}
|
|
28
|
-
};
|
|
23
|
+
handleClick(event) {
|
|
24
|
+
if (event && event.preventDefault) {
|
|
25
|
+
event.preventDefault();
|
|
26
|
+
}
|
|
27
|
+
if (!index$1.getBoolean(this.disabled) && this.click) {
|
|
28
|
+
this.click.emit(event);
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
|
|
32
|
-
if (this.
|
|
33
|
-
this.
|
|
31
|
+
checkTruncation() {
|
|
32
|
+
if (this._labelRef) {
|
|
33
|
+
const scrollWidth = Math.ceil(this._labelRef.scrollWidth);
|
|
34
|
+
const clientWidth = Math.ceil(this._labelRef.clientWidth);
|
|
35
|
+
const truncated = scrollWidth > clientWidth + 1;
|
|
36
|
+
if (this.isTruncated !== truncated) {
|
|
37
|
+
this.isTruncated = truncated;
|
|
38
|
+
if (!truncated && this._ref) {
|
|
39
|
+
if (this._ref.hasAttribute("data-has-tooltip")) {
|
|
40
|
+
this._ref.removeAttribute("data-has-tooltip");
|
|
41
|
+
}
|
|
42
|
+
if (this._ref.hasAttribute("aria-describedby")) {
|
|
43
|
+
this._ref.removeAttribute("aria-describedby");
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
this.tooltipText = truncated
|
|
48
|
+
? this.label ||
|
|
49
|
+
this._labelRef.innerText ||
|
|
50
|
+
this._labelRef.textContent ||
|
|
51
|
+
""
|
|
52
|
+
: "";
|
|
34
53
|
}
|
|
35
54
|
}
|
|
36
55
|
/**
|
|
@@ -70,66 +89,112 @@ const DBTabItem = class {
|
|
|
70
89
|
}
|
|
71
90
|
}
|
|
72
91
|
watch0Fn() {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
this.initialized = false;
|
|
76
|
-
// deselect this tab when another tab in tablist is selected
|
|
77
|
-
if (!this._listenerAdded) {
|
|
78
|
-
(_a = this._ref
|
|
79
|
-
.closest("[role=tablist]")) === null || _a === void 0 ? void 0 : _a.addEventListener("change", this.boundSetSelectedOnChange);
|
|
80
|
-
this._listenerAdded = true;
|
|
81
|
-
}
|
|
82
|
-
// Initialize selected state from either active prop (set by parent) or checked attribute
|
|
83
|
-
if (this.active || this._ref.checked) {
|
|
84
|
-
this._selected = index$1.getBooleanAsString(true);
|
|
85
|
-
this._ref.click();
|
|
86
|
-
}
|
|
92
|
+
if (this.active !== undefined) {
|
|
93
|
+
this.internalActive = index$1.getBoolean(this.active) || false;
|
|
87
94
|
}
|
|
88
95
|
}
|
|
89
96
|
watch0() {
|
|
90
97
|
this.watch0Fn();
|
|
91
98
|
}
|
|
92
|
-
watch1Fn() {
|
|
93
|
-
if (this.name) {
|
|
94
|
-
this._name = this.name;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
watch1() {
|
|
98
|
-
this.watch1Fn();
|
|
99
|
-
}
|
|
100
99
|
componentDidLoad() {
|
|
100
|
+
var _a;
|
|
101
101
|
this.enableAttributePassing(this._ref, "db-tab-item");
|
|
102
|
-
this.
|
|
103
|
-
this.
|
|
102
|
+
this.internalActive = index$1.getBoolean(this.active) || false;
|
|
103
|
+
this.internalTabIndex = index$1.getBoolean(this.active) ? 0 : -1;
|
|
104
|
+
if (typeof window !== "undefined") {
|
|
105
|
+
const setupObserverAndCheck = () => {
|
|
106
|
+
requestAnimationFrame(() => {
|
|
107
|
+
this.checkTruncation();
|
|
108
|
+
const labelEl = this._labelRef;
|
|
109
|
+
if (labelEl && !labelEl.dataset.label) {
|
|
110
|
+
labelEl.dataset.label =
|
|
111
|
+
this.label || labelEl.innerText || labelEl.textContent || "";
|
|
112
|
+
}
|
|
113
|
+
if (this._labelRef) {
|
|
114
|
+
const resizeObserver = new ResizeObserver(() => {
|
|
115
|
+
requestAnimationFrame(() => {
|
|
116
|
+
this.checkTruncation();
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
resizeObserver.observe(this._labelRef);
|
|
120
|
+
this._resizeObserver = resizeObserver;
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
};
|
|
124
|
+
const hasIcon = this.showIcon && this.icon;
|
|
125
|
+
if (hasIcon && ((_a = document.fonts) === null || _a === void 0 ? void 0 : _a.ready)) {
|
|
126
|
+
document.fonts.ready.then(setupObserverAndCheck);
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
setupObserverAndCheck();
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
if (this._ref) {
|
|
133
|
+
const listener = (event) => {
|
|
134
|
+
this.internalActive = event.detail.selected;
|
|
135
|
+
if (this.tabIndex === undefined) {
|
|
136
|
+
if (event.detail.tabIndex !== undefined) {
|
|
137
|
+
this.internalTabIndex = event.detail.tabIndex;
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
this.internalTabIndex = event.detail.selected ? 0 : -1;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
this._ariaSelectedListener = {
|
|
145
|
+
fn: listener,
|
|
146
|
+
};
|
|
147
|
+
this._ref.addEventListener("aria-selected-changed", listener);
|
|
148
|
+
}
|
|
104
149
|
this.watch0Fn();
|
|
105
|
-
this.watch1Fn();
|
|
106
150
|
}
|
|
107
151
|
disconnectedCallback() {
|
|
108
152
|
var _a;
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
this.
|
|
153
|
+
(_a = this._resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
154
|
+
const _listener = this._ariaSelectedListener;
|
|
155
|
+
if (this._ref && _listener) {
|
|
156
|
+
this._ref.removeEventListener("aria-selected-changed", _listener.fn);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
componentDidUpdate() {
|
|
160
|
+
var _a, _b;
|
|
161
|
+
if (this._ref) {
|
|
162
|
+
const isDisabled = index$1.getBoolean(this.disabled);
|
|
163
|
+
const disabledStr = isDisabled ? "true" : "false";
|
|
164
|
+
if (((_a = this._ref) === null || _a === void 0 ? void 0 : _a.getAttribute("aria-disabled")) !== disabledStr) {
|
|
165
|
+
(_b = this._ref) === null || _b === void 0 ? void 0 : _b.setAttribute("aria-disabled", disabledStr);
|
|
166
|
+
}
|
|
167
|
+
if (!this.isTruncated) {
|
|
168
|
+
if (this._ref.hasAttribute("data-has-tooltip")) {
|
|
169
|
+
this._ref.removeAttribute("data-has-tooltip");
|
|
170
|
+
}
|
|
171
|
+
if (this._ref.hasAttribute("aria-describedby")) {
|
|
172
|
+
this._ref.removeAttribute("aria-describedby");
|
|
173
|
+
}
|
|
174
|
+
}
|
|
113
175
|
}
|
|
114
176
|
}
|
|
115
177
|
render() {
|
|
116
|
-
var _a, _b, _c, _d
|
|
117
|
-
return (index.h("
|
|
178
|
+
var _a, _b, _c, _d;
|
|
179
|
+
return (index.h("button", { key: '87666630bffa6918a10d8b2f3539263d4dbcbc32', class: index$1.cls("db-tab-item", this.className), type: "button", role: "tab", title: "", ref: (el) => {
|
|
118
180
|
this._ref = el;
|
|
119
|
-
},
|
|
181
|
+
}, "aria-label": index$1.getBoolean(this.noText) ? this.label : undefined, "aria-selected": (this.active !== undefined
|
|
182
|
+
? index$1.getBoolean(this.active)
|
|
183
|
+
: this.internalActive)
|
|
184
|
+
? "true"
|
|
185
|
+
: "false", "aria-controls": this.ariaControls, disabled: index$1.getBoolean(this.disabled) ? true : undefined, tabIndex: this.getCurrentTabIndex(), id: this.id, "data-active": this.active !== undefined
|
|
186
|
+
? index$1.getBoolean(this.active)
|
|
187
|
+
: this.internalActive, "data-no-text": index$1.getBoolean(this.noText) ? "true" : undefined, "data-value": this.value, onClick: (event) => this.handleClick(event) }, !this.noText ? (index.h("span", { class: "db-tab-label", title: "", ref: (el) => {
|
|
188
|
+
this._labelRef = el;
|
|
189
|
+
}, "data-icon": index$1.getBoolean((_a = this.showIconLeading) !== null && _a !== void 0 ? _a : this.showIcon)
|
|
190
|
+
? (_b = this.iconLeading) !== null && _b !== void 0 ? _b : this.icon
|
|
191
|
+
: undefined, "data-icon-trailing": index$1.getBoolean(this.showIconTrailing) ? this.iconTrailing : undefined }, this.label ? this.label : null, !this.label ? index.h("slot", null) : null)) : null, index$1.getBoolean(this.noText) ? (index.h("span", { class: "db-tab-label", "aria-hidden": "true", "data-icon": index$1.getBoolean((_c = this.showIconLeading) !== null && _c !== void 0 ? _c : this.showIcon)
|
|
192
|
+
? (_d = this.iconLeading) !== null && _d !== void 0 ? _d : this.icon
|
|
193
|
+
: undefined })) : null, this.isTruncated && this.tooltipText ? (index.h("db-tooltip", { placement: "right" }, this.tooltipText)) : null));
|
|
120
194
|
}
|
|
121
195
|
static get watchers() { return {
|
|
122
|
-
"
|
|
123
|
-
"watch0": 0
|
|
124
|
-
}],
|
|
125
|
-
"initialized": [{
|
|
196
|
+
"active": [{
|
|
126
197
|
"watch0": 0
|
|
127
|
-
}],
|
|
128
|
-
"boundSetSelectedOnChange": [{
|
|
129
|
-
"watch0": 0
|
|
130
|
-
}],
|
|
131
|
-
"name": [{
|
|
132
|
-
"watch1": 0
|
|
133
198
|
}]
|
|
134
199
|
}; }
|
|
135
200
|
};
|
|
@@ -137,6 +202,7 @@ const DBTabItem = class {
|
|
|
137
202
|
const DBTabList = class {
|
|
138
203
|
constructor(hostRef) {
|
|
139
204
|
index.registerInstance(this, hostRef);
|
|
205
|
+
this._id = "tab-list-base-id";
|
|
140
206
|
}
|
|
141
207
|
/**
|
|
142
208
|
* Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.
|
|
@@ -176,12 +242,12 @@ const DBTabList = class {
|
|
|
176
242
|
}
|
|
177
243
|
componentDidLoad() {
|
|
178
244
|
this.enableAttributePassing(this._ref, "db-tab-list");
|
|
245
|
+
this._id = this.id || "tab-list-" + index$1.uuid();
|
|
179
246
|
}
|
|
180
247
|
render() {
|
|
181
|
-
|
|
182
|
-
return (index.h("div", { key: '8f02145864a04b79d94d5d5923b6eff32346a0c3', class: index$1.cls("db-tab-list", this.className), ref: (el) => {
|
|
248
|
+
return (index.h("div", { key: 'd6e9d47968f44e65f2c0f400a4141917e2035727', class: index$1.cls("db-tab-list", this.className), role: "tablist", ref: (el) => {
|
|
183
249
|
this._ref = el;
|
|
184
|
-
}, id:
|
|
250
|
+
}, id: this._id, "aria-orientation": this.orientation || "horizontal", "aria-label": this.ariaLabelledby ? undefined : this.ariaLabel, "aria-labelledby": this.ariaLabelledby }, index.h("slot", { key: 'dafa7344fceee4c2cb0fd3d364509c41e4686e6d' })));
|
|
185
251
|
}
|
|
186
252
|
};
|
|
187
253
|
|
|
@@ -230,9 +296,9 @@ const DBTabPanel = class {
|
|
|
230
296
|
}
|
|
231
297
|
render() {
|
|
232
298
|
var _a, _b;
|
|
233
|
-
return (index.h("
|
|
299
|
+
return (index.h("div", { key: '231689474d2f2b3acfa8e8aed736b3a76559daf9', class: index$1.cls("db-tab-panel", this.className), role: "tabpanel", ref: (el) => {
|
|
234
300
|
this._ref = el;
|
|
235
|
-
}, id: (_a = this.id) !== null && _a !== void 0 ? _a : (_b = this.propOverrides) === null || _b === void 0 ? void 0 : _b.id }, this.content ? this.content : null, index.h("slot", { key: '
|
|
301
|
+
}, id: (_a = this.id) !== null && _a !== void 0 ? _a : (_b = this.propOverrides) === null || _b === void 0 ? void 0 : _b.id, tabIndex: this.hidden ? -1 : 0, hidden: this.hidden, "aria-label": this.ariaLabel, "aria-labelledby": this.ariaLabel ? undefined : this.ariaLabelledby }, this.content ? this.content : null, index.h("slot", { key: 'eb72a30d12dcd1bce44b0a2b61d2c486ec779d16' })));
|
|
236
302
|
}
|
|
237
303
|
};
|
|
238
304
|
|