@db-ux/wc-core-components 4.7.0-tabs-34782eb → 4.7.1
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 +5 -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 +67 -133
- package/dist/cjs/db-tabs.cjs.entry.js +123 -373
- package/dist/cjs/db-textarea.cjs.entry.js +2 -2
- package/dist/cjs/db-tooltip.cjs.entry.js +4 -3
- 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 +129 -198
- package/dist/collection/components/tab-list/tab-list.js +12 -74
- package/dist/collection/components/tab-panel/tab-panel.js +2 -80
- package/dist/collection/components/tabs/tabs.js +167 -504
- 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 +4 -3
- package/dist/collection/shared/model.js +1 -1
- package/dist/custom-elements.json +2998 -3898
- package/dist/db-ux/db-ux.esm.js +1 -1
- package/dist/db-ux/index.esm.js +1 -1
- package/dist/db-ux/{p-9b518eb4.entry.js → p-0e0c3c72.entry.js} +1 -1
- package/dist/db-ux/{p-61784f7a.entry.js → p-12a2c502.entry.js} +1 -1
- package/dist/db-ux/{p-b7087f0b.entry.js → p-13157b54.entry.js} +1 -1
- package/dist/db-ux/p-202323c2.entry.js +1 -0
- package/dist/db-ux/p-21068628.entry.js +1 -0
- package/dist/db-ux/{p-b06fe221.entry.js → p-212bde1e.entry.js} +1 -1
- package/dist/db-ux/{p-01c278b9.entry.js → p-2355324e.entry.js} +1 -1
- package/dist/db-ux/p-377987d0.entry.js +1 -0
- package/dist/db-ux/p-3d5d49ff.entry.js +1 -0
- package/dist/db-ux/p-452a8b6b.entry.js +1 -0
- package/dist/db-ux/p-4de2c697.entry.js +1 -0
- package/dist/db-ux/{p-f08b14d9.entry.js → p-5cb74480.entry.js} +1 -1
- package/dist/db-ux/{p-071ae423.entry.js → p-5f5eb78d.entry.js} +1 -1
- package/dist/db-ux/p-605013f0.entry.js +1 -0
- package/dist/db-ux/p-6f9e146e.entry.js +1 -0
- package/dist/db-ux/{p-328faf6b.entry.js → p-70823b80.entry.js} +1 -1
- package/dist/db-ux/{p-70e6d32f.entry.js → p-761c9ddf.entry.js} +1 -1
- package/dist/db-ux/p-7fa91164.entry.js +1 -0
- package/dist/db-ux/p-8e84712d.entry.js +1 -0
- package/dist/db-ux/{p-ffe614c8.entry.js → p-980a6afe.entry.js} +1 -1
- package/dist/db-ux/{p-6c26b0ba.entry.js → p-a65d0d23.entry.js} +1 -1
- package/dist/db-ux/p-a9efbb0b.entry.js +1 -0
- package/dist/db-ux/{p-07c7ecc9.entry.js → p-abb0885d.entry.js} +1 -1
- package/dist/db-ux/{p-9a895c18.entry.js → p-ba8464d2.entry.js} +1 -1
- package/dist/db-ux/p-bd66d144.entry.js +1 -0
- package/dist/db-ux/{p-74a45768.entry.js → p-bed8d029.entry.js} +1 -1
- package/dist/db-ux/{p-ee43015b.entry.js → p-c76089f6.entry.js} +1 -1
- package/dist/db-ux/{p-44a0407b.entry.js → p-c7bf8d05.entry.js} +1 -1
- package/dist/db-ux/{p-43a9623f.entry.js → p-d85b1c15.entry.js} +1 -1
- package/dist/db-ux/{p-d93b9d58.entry.js → p-d8b38722.entry.js} +1 -1
- package/dist/db-ux/p-dd08f6e4.entry.js +1 -0
- 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 +68 -134
- package/dist/esm/db-tabs.entry.js +123 -373
- package/dist/esm/db-textarea.entry.js +2 -2
- package/dist/esm/db-tooltip.entry.js +5 -4
- 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 +11 -28
- package/dist/types/components/tab-item/tab-item.d.ts +20 -22
- package/dist/types/components/tab-list/model.d.ts +5 -15
- package/dist/types/components/tab-list/tab-list.d.ts +1 -4
- package/dist/types/components/tab-panel/model.d.ts +3 -13
- package/dist/types/components/tab-panel/tab-panel.d.ts +0 -3
- package/dist/types/components/tabs/model.d.ts +17 -51
- package/dist/types/components/tabs/tabs.d.ts +16 -35
- package/dist/types/components.d.ts +30 -80
- package/dist/types/shared/model.d.ts +5 -5
- package/dist/vscode.html-custom-data.json +59 -147
- package/dist/web-types.json +135 -289
- package/package.json +3 -3
- package/dist/db-ux/p-10869bfa.entry.js +0 -1
- package/dist/db-ux/p-1427bb15.entry.js +0 -1
- package/dist/db-ux/p-397bc590.entry.js +0 -1
- package/dist/db-ux/p-68835a75.entry.js +0 -1
- package/dist/db-ux/p-68a995df.entry.js +0 -1
- package/dist/db-ux/p-6e898a58.entry.js +0 -1
- package/dist/db-ux/p-71868bb5.entry.js +0 -1
- package/dist/db-ux/p-9b4d0c18.entry.js +0 -1
- package/dist/db-ux/p-a927fe88.entry.js +0 -1
- package/dist/db-ux/p-a93ca690.entry.js +0 -1
- package/dist/db-ux/p-d97c0787.entry.js +0 -1
- package/dist/db-ux/p-efde1b6e.entry.js +0 -1
- package/dist/db-ux/p-f92cbbae.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: 'e8a95918ab5412c03412b92adb3f2a2d5979d492', 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: 'b95b19d6ff1a61f416eadfb14d9e19647e4f6cb4' })));
|
|
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: '66c2badcfc403e68d44d93cd1a79d087b212bbd6', 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: 'c22fc86dd012f6de327f861cca3c1b4ab4f3605d', htmlFor: this._id }, index.h("input", { key: '3d1532eee9a137f2a1db1ba1574856ecc61833d8', 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: 'd24f80874212a9a9669d5731d9e5b6f4f3be6001', size: "small", semantic: "critical", id: this._invalidMessageId }, this._invalidMessage), index.h("span", { key: 'cb3420bd986f1398094fbac151d27a5c2f392d7d', "data-visually-hidden": "true", role: "status" }, this._voiceOverFallback)));
|
|
194
194
|
}
|
|
195
195
|
static get watchers() { return {
|
|
196
196
|
"id": [{
|
|
@@ -6,50 +6,31 @@ 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.
|
|
9
|
+
this.change = index.createEvent(this, "change");
|
|
10
|
+
this._selected = false;
|
|
11
|
+
this._name = undefined;
|
|
10
12
|
this.initialized = false;
|
|
11
|
-
this.
|
|
12
|
-
this.
|
|
13
|
-
this.isTruncated = false;
|
|
14
|
-
this.tooltipText = "";
|
|
15
|
-
this._resizeObserver = null;
|
|
16
|
-
this._ariaSelectedListener = null;
|
|
13
|
+
this._listenerAdded = false;
|
|
14
|
+
this.boundSetSelectedOnChange = undefined;
|
|
17
15
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
: this.internalTabIndex;
|
|
16
|
+
setSelectedOnChange(event) {
|
|
17
|
+
event.stopPropagation();
|
|
18
|
+
this._selected = index$1.getBooleanAsString(event.target === this._ref);
|
|
22
19
|
}
|
|
23
|
-
|
|
24
|
-
if (
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
20
|
+
handleNameAttribute() {
|
|
21
|
+
if (this._ref) {
|
|
22
|
+
const setAttribute = this._ref.setAttribute;
|
|
23
|
+
this._ref.setAttribute = (attribute, value) => {
|
|
24
|
+
setAttribute.call(this._ref, attribute, value);
|
|
25
|
+
if (attribute === "name") {
|
|
26
|
+
this._name = value;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
|
|
32
|
-
if (this.
|
|
33
|
-
|
|
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
|
-
: "";
|
|
31
|
+
handleChange(event) {
|
|
32
|
+
if (this.change) {
|
|
33
|
+
this.change.emit(event);
|
|
53
34
|
}
|
|
54
35
|
}
|
|
55
36
|
/**
|
|
@@ -89,112 +70,66 @@ const DBTabItem = class {
|
|
|
89
70
|
}
|
|
90
71
|
}
|
|
91
72
|
watch0Fn() {
|
|
92
|
-
|
|
93
|
-
|
|
73
|
+
var _a;
|
|
74
|
+
if (this._ref && this.initialized && this.boundSetSelectedOnChange) {
|
|
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
|
+
}
|
|
94
87
|
}
|
|
95
88
|
}
|
|
96
89
|
watch0() {
|
|
97
90
|
this.watch0Fn();
|
|
98
91
|
}
|
|
92
|
+
watch1Fn() {
|
|
93
|
+
if (this.name) {
|
|
94
|
+
this._name = this.name;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
watch1() {
|
|
98
|
+
this.watch1Fn();
|
|
99
|
+
}
|
|
99
100
|
componentDidLoad() {
|
|
100
|
-
var _a;
|
|
101
101
|
this.enableAttributePassing(this._ref, "db-tab-item");
|
|
102
|
-
this.
|
|
103
|
-
this.
|
|
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
|
-
}
|
|
102
|
+
this.boundSetSelectedOnChange = this.setSelectedOnChange.bind(this);
|
|
103
|
+
this.initialized = true;
|
|
149
104
|
this.watch0Fn();
|
|
105
|
+
this.watch1Fn();
|
|
150
106
|
}
|
|
151
107
|
disconnectedCallback() {
|
|
152
108
|
var _a;
|
|
153
|
-
(
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
this.
|
|
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
|
-
}
|
|
109
|
+
if (this._listenerAdded && this._ref && this.boundSetSelectedOnChange) {
|
|
110
|
+
(_a = this._ref
|
|
111
|
+
.closest("[role=tablist]")) === null || _a === void 0 ? void 0 : _a.removeEventListener("change", this.boundSetSelectedOnChange);
|
|
112
|
+
this._listenerAdded = false;
|
|
175
113
|
}
|
|
176
114
|
}
|
|
177
115
|
render() {
|
|
178
|
-
var _a, _b, _c, _d;
|
|
179
|
-
return (index.h("
|
|
116
|
+
var _a, _b, _c, _d, _e, _f;
|
|
117
|
+
return (index.h("li", { key: '0b8687c942d18b49bdf25249be3f0ae1ca727256', class: index$1.cls("db-tab-item", this.className), role: "none" }, index.h("label", { key: 'b9eaa4d53de58d78d7f968d18b021c9cfe013502', htmlFor: (_a = this.id) !== null && _a !== void 0 ? _a : (_b = this.propOverrides) === null || _b === void 0 ? void 0 : _b.id, "data-icon": (_c = this.iconLeading) !== null && _c !== void 0 ? _c : this.icon, "data-icon-trailing": this.iconTrailing, "data-show-icon": index$1.getBooleanAsString((_d = this.showIconLeading) !== null && _d !== void 0 ? _d : this.showIcon), "data-show-icon-trailing": index$1.getBooleanAsString(this.showIconTrailing), "data-no-text": index$1.getBooleanAsString(this.noText) }, index.h("input", { key: '81cf38a1a39e88fc85282e8b82d43768ce6f70a4', type: "radio", role: "tab", disabled: index$1.getBoolean(this.disabled, "disabled"), "aria-selected": this._selected, checked: index$1.getBoolean(this.checked, "checked"), ref: (el) => {
|
|
180
118
|
this._ref = el;
|
|
181
|
-
},
|
|
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));
|
|
119
|
+
}, name: this._name, id: (_e = this.id) !== null && _e !== void 0 ? _e : (_f = this.propOverrides) === null || _f === void 0 ? void 0 : _f.id, onInput: (event) => this.handleChange(event) }), this.label ? this.label : null, index.h("slot", { key: '89a4ba46af36e8dcc3bc53f87d17977c5827cd12' }))));
|
|
194
120
|
}
|
|
195
121
|
static get watchers() { return {
|
|
196
|
-
"
|
|
122
|
+
"_ref": [{
|
|
123
|
+
"watch0": 0
|
|
124
|
+
}],
|
|
125
|
+
"initialized": [{
|
|
197
126
|
"watch0": 0
|
|
127
|
+
}],
|
|
128
|
+
"boundSetSelectedOnChange": [{
|
|
129
|
+
"watch0": 0
|
|
130
|
+
}],
|
|
131
|
+
"name": [{
|
|
132
|
+
"watch1": 0
|
|
198
133
|
}]
|
|
199
134
|
}; }
|
|
200
135
|
};
|
|
@@ -202,7 +137,6 @@ const DBTabItem = class {
|
|
|
202
137
|
const DBTabList = class {
|
|
203
138
|
constructor(hostRef) {
|
|
204
139
|
index.registerInstance(this, hostRef);
|
|
205
|
-
this._id = "tab-list-base-id";
|
|
206
140
|
}
|
|
207
141
|
/**
|
|
208
142
|
* Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.
|
|
@@ -242,12 +176,12 @@ const DBTabList = class {
|
|
|
242
176
|
}
|
|
243
177
|
componentDidLoad() {
|
|
244
178
|
this.enableAttributePassing(this._ref, "db-tab-list");
|
|
245
|
-
this._id = this.id || "tab-list-" + index$1.uuid();
|
|
246
179
|
}
|
|
247
180
|
render() {
|
|
248
|
-
|
|
181
|
+
var _a, _b;
|
|
182
|
+
return (index.h("div", { key: '8f02145864a04b79d94d5d5923b6eff32346a0c3', class: index$1.cls("db-tab-list", this.className), ref: (el) => {
|
|
249
183
|
this._ref = el;
|
|
250
|
-
}, id: this.
|
|
184
|
+
}, id: (_a = this.id) !== null && _a !== void 0 ? _a : (_b = this.propOverrides) === null || _b === void 0 ? void 0 : _b.id }, index.h("ul", { key: '759fdba6e69209ca915148c8b190f9311cb6f1ff', role: "tablist" }, index.h("slot", { key: '96bf4a10d3b422d6eb6be68c46f926b9f55eb0e6' }))));
|
|
251
185
|
}
|
|
252
186
|
};
|
|
253
187
|
|
|
@@ -296,9 +230,9 @@ const DBTabPanel = class {
|
|
|
296
230
|
}
|
|
297
231
|
render() {
|
|
298
232
|
var _a, _b;
|
|
299
|
-
return (index.h("
|
|
233
|
+
return (index.h("section", { key: 'c10873d5857be6ea8653189ab735784939c53474', class: index$1.cls("db-tab-panel", this.className), role: "tabpanel", ref: (el) => {
|
|
300
234
|
this._ref = el;
|
|
301
|
-
}, id: (_a = this.id) !== null && _a !== void 0 ? _a : (_b = this.propOverrides) === null || _b === void 0 ? void 0 : _b.id
|
|
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: '57a98a1b7e26ca61b16397b7615f71d883bfbd28' })));
|
|
302
236
|
}
|
|
303
237
|
};
|
|
304
238
|
|