@db-ux/wc-core-components 4.4.2 → 4.4.3
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 +10 -0
- package/dist/cjs/db-accordion-item.cjs.entry.js +9 -5
- package/dist/cjs/db-accordion.cjs.entry.js +8 -4
- package/dist/cjs/db-badge.cjs.entry.js +8 -4
- package/dist/cjs/db-brand.cjs.entry.js +8 -4
- package/dist/cjs/db-button.cjs.entry.js +8 -4
- package/dist/cjs/db-card.cjs.entry.js +9 -5
- package/dist/cjs/db-checkbox.cjs.entry.js +9 -5
- package/dist/cjs/db-custom-select-dropdown_5.cjs.entry.js +40 -20
- package/dist/cjs/db-custom-select-form-field.cjs.entry.js +9 -5
- package/dist/cjs/db-custom-select.cjs.entry.js +14 -10
- package/dist/cjs/db-divider.cjs.entry.js +8 -4
- package/dist/cjs/db-drawer.cjs.entry.js +10 -6
- package/dist/cjs/db-header.cjs.entry.js +11 -7
- package/dist/cjs/db-icon.cjs.entry.js +8 -4
- package/dist/cjs/db-infotext.cjs.entry.js +8 -4
- package/dist/cjs/db-link.cjs.entry.js +8 -4
- package/dist/cjs/db-navigation-item.cjs.entry.js +10 -6
- package/dist/cjs/db-navigation.cjs.entry.js +9 -5
- package/dist/cjs/db-notification.cjs.entry.js +9 -5
- package/dist/cjs/db-page.cjs.entry.js +9 -5
- package/dist/cjs/db-popover.cjs.entry.js +11 -7
- package/dist/cjs/db-radio.cjs.entry.js +8 -4
- package/dist/cjs/db-section.cjs.entry.js +9 -5
- package/dist/cjs/db-select.cjs.entry.js +9 -5
- package/dist/cjs/db-stack.cjs.entry.js +9 -5
- package/dist/cjs/db-switch.cjs.entry.js +9 -5
- package/dist/cjs/db-tab-item_3.cjs.entry.js +25 -13
- package/dist/cjs/db-tabs.cjs.entry.js +9 -5
- package/dist/cjs/db-textarea.cjs.entry.js +9 -5
- package/dist/cjs/db-tooltip.cjs.entry.js +12 -7
- package/dist/cjs/db-ux.cjs.js +3 -3
- package/dist/cjs/{floating-components-ogUqz72V.js → floating-components-pYaTeNhp.js} +65 -15
- package/dist/cjs/{index-CEqZnn9s.js → index-Bh5ovRL2.js} +1 -1
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{navigation-DauGE-qj.js → navigation-BztJmEHf.js} +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/accordion/accordion.js +7 -3
- package/dist/collection/components/accordion-item/accordion-item.js +8 -4
- package/dist/collection/components/badge/badge.js +7 -3
- package/dist/collection/components/brand/brand.js +7 -3
- package/dist/collection/components/button/button.js +7 -3
- package/dist/collection/components/card/card.js +8 -4
- package/dist/collection/components/checkbox/checkbox.js +8 -4
- package/dist/collection/components/custom-select/custom-select.js +12 -8
- package/dist/collection/components/custom-select-dropdown/custom-select-dropdown.js +8 -4
- package/dist/collection/components/custom-select-form-field/custom-select-form-field.js +8 -4
- package/dist/collection/components/custom-select-list/custom-select-list.js +8 -4
- package/dist/collection/components/custom-select-list-item/custom-select-list-item.js +7 -3
- package/dist/collection/components/divider/divider.js +7 -3
- package/dist/collection/components/drawer/drawer.js +9 -5
- package/dist/collection/components/header/header.js +8 -4
- package/dist/collection/components/icon/icon.js +7 -3
- package/dist/collection/components/infotext/infotext.js +7 -3
- package/dist/collection/components/input/input.js +8 -4
- package/dist/collection/components/link/link.js +7 -3
- package/dist/collection/components/navigation/navigation.js +8 -4
- package/dist/collection/components/navigation-item/navigation-item.js +7 -3
- package/dist/collection/components/notification/notification.js +8 -4
- package/dist/collection/components/page/page.js +8 -4
- package/dist/collection/components/popover/popover.js +9 -5
- package/dist/collection/components/radio/radio.js +7 -3
- package/dist/collection/components/section/section.js +8 -4
- package/dist/collection/components/select/select.js +8 -4
- package/dist/collection/components/stack/stack.js +8 -4
- package/dist/collection/components/switch/switch.js +13 -7
- package/dist/collection/components/tab-item/tab-item.js +8 -4
- package/dist/collection/components/tab-list/tab-list.js +8 -4
- package/dist/collection/components/tab-panel/tab-panel.js +8 -4
- package/dist/collection/components/tabs/tabs.js +8 -4
- package/dist/collection/components/tag/tag.js +8 -4
- package/dist/collection/components/textarea/textarea.js +8 -4
- package/dist/collection/components/tooltip/tooltip.js +10 -5
- package/dist/collection/utils/floating-components.js +65 -15
- package/dist/custom-elements.json +17369 -1424
- package/dist/db-ux/db-ux.esm.js +1 -1
- package/dist/db-ux/index.esm.js +1 -1
- package/dist/db-ux/p-1a72176e.entry.js +1 -0
- package/dist/db-ux/p-1b7f6a0b.entry.js +1 -0
- package/dist/db-ux/p-1da21066.entry.js +1 -0
- package/dist/db-ux/p-2d15e200.entry.js +1 -0
- package/dist/db-ux/p-312d52da.entry.js +1 -0
- package/dist/db-ux/p-3e6b86d6.entry.js +1 -0
- package/dist/db-ux/p-4aa16916.entry.js +1 -0
- package/dist/db-ux/p-4b69acea.entry.js +1 -0
- package/dist/db-ux/p-4cfff250.entry.js +1 -0
- package/dist/db-ux/p-5237e5d5.entry.js +1 -0
- package/dist/db-ux/p-5b1a0f0f.entry.js +1 -0
- package/dist/db-ux/p-5fa85b19.entry.js +1 -0
- package/dist/db-ux/p-64264628.entry.js +1 -0
- package/dist/db-ux/p-7351b5ab.entry.js +1 -0
- package/dist/db-ux/p-77150a25.entry.js +1 -0
- package/dist/db-ux/p-7c6b7578.entry.js +1 -0
- package/dist/db-ux/p-828a77d8.entry.js +1 -0
- package/dist/db-ux/p-9b47dc80.entry.js +1 -0
- package/dist/db-ux/p-DfYL98sI.js +1 -0
- package/dist/db-ux/p-a3a8ce36.entry.js +1 -0
- package/dist/db-ux/p-aa0f7280.entry.js +1 -0
- package/dist/db-ux/p-b07122c4.entry.js +1 -0
- package/dist/db-ux/p-b1fc0f4c.entry.js +1 -0
- package/dist/db-ux/p-c2624e1b.entry.js +1 -0
- package/dist/db-ux/p-c29d8e32.entry.js +1 -0
- package/dist/db-ux/{p-sP2NlPcu.js → p-cNk4ImpW.js} +1 -1
- package/dist/db-ux/p-cf50169a.entry.js +1 -0
- package/dist/db-ux/p-d4f3cfa2.entry.js +1 -0
- package/dist/db-ux/p-e05fee5a.entry.js +1 -0
- package/dist/db-ux/p-f40d2d61.entry.js +1 -0
- package/dist/db-ux/p-fcf8e274.entry.js +1 -0
- package/dist/db-ux/p-fe06f815.entry.js +1 -0
- package/dist/esm/db-accordion-item.entry.js +9 -5
- package/dist/esm/db-accordion.entry.js +8 -4
- package/dist/esm/db-badge.entry.js +8 -4
- package/dist/esm/db-brand.entry.js +8 -4
- package/dist/esm/db-button.entry.js +8 -4
- package/dist/esm/db-card.entry.js +9 -5
- package/dist/esm/db-checkbox.entry.js +9 -5
- package/dist/esm/db-custom-select-dropdown_5.entry.js +40 -20
- package/dist/esm/db-custom-select-form-field.entry.js +9 -5
- package/dist/esm/db-custom-select.entry.js +14 -10
- package/dist/esm/db-divider.entry.js +8 -4
- package/dist/esm/db-drawer.entry.js +10 -6
- package/dist/esm/db-header.entry.js +11 -7
- package/dist/esm/db-icon.entry.js +8 -4
- package/dist/esm/db-infotext.entry.js +8 -4
- package/dist/esm/db-link.entry.js +8 -4
- package/dist/esm/db-navigation-item.entry.js +10 -6
- package/dist/esm/db-navigation.entry.js +9 -5
- package/dist/esm/db-notification.entry.js +9 -5
- package/dist/esm/db-page.entry.js +9 -5
- package/dist/esm/db-popover.entry.js +11 -7
- package/dist/esm/db-radio.entry.js +8 -4
- package/dist/esm/db-section.entry.js +9 -5
- package/dist/esm/db-select.entry.js +9 -5
- package/dist/esm/db-stack.entry.js +9 -5
- package/dist/esm/db-switch.entry.js +9 -5
- package/dist/esm/db-tab-item_3.entry.js +25 -13
- package/dist/esm/db-tabs.entry.js +9 -5
- package/dist/esm/db-textarea.entry.js +9 -5
- package/dist/esm/db-tooltip.entry.js +12 -7
- package/dist/esm/db-ux.js +4 -4
- package/dist/esm/{floating-components-G-TursYV.js → floating-components-DfYL98sI.js} +65 -15
- package/dist/esm/{index-BrThqi62.js → index-Crtu1dn6.js} +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{navigation--UdC9CzO.js → navigation-DgsMCdfn.js} +1 -1
- package/dist/types/components/switch/model.d.ts +1 -1
- package/dist/types/components.d.ts +1 -0
- package/dist/types/shared/model.d.ts +2 -2
- package/dist/vscode.html-custom-data.json +1718 -294
- package/dist/web-types.json +2740 -666
- package/package.json +4 -4
- package/dist/db-ux/p-07bf3657.entry.js +0 -1
- package/dist/db-ux/p-0a89cbcd.entry.js +0 -1
- package/dist/db-ux/p-15539d9d.entry.js +0 -1
- package/dist/db-ux/p-41cb4673.entry.js +0 -1
- package/dist/db-ux/p-460073dd.entry.js +0 -1
- package/dist/db-ux/p-4a9b9909.entry.js +0 -1
- package/dist/db-ux/p-4ec09cf1.entry.js +0 -1
- package/dist/db-ux/p-57205dfd.entry.js +0 -1
- package/dist/db-ux/p-5775bf7a.entry.js +0 -1
- package/dist/db-ux/p-5bcde39a.entry.js +0 -1
- package/dist/db-ux/p-6341aaa9.entry.js +0 -1
- package/dist/db-ux/p-64573104.entry.js +0 -1
- package/dist/db-ux/p-6b63156d.entry.js +0 -1
- package/dist/db-ux/p-70822a27.entry.js +0 -1
- package/dist/db-ux/p-710a430d.entry.js +0 -1
- package/dist/db-ux/p-72d712b0.entry.js +0 -1
- package/dist/db-ux/p-7b7f4d03.entry.js +0 -1
- package/dist/db-ux/p-7bd4c573.entry.js +0 -1
- package/dist/db-ux/p-819cf20a.entry.js +0 -1
- package/dist/db-ux/p-87fdbcfb.entry.js +0 -1
- package/dist/db-ux/p-9051e26c.entry.js +0 -1
- package/dist/db-ux/p-934a708c.entry.js +0 -1
- package/dist/db-ux/p-9ffa5c48.entry.js +0 -1
- package/dist/db-ux/p-G-TursYV.js +0 -1
- package/dist/db-ux/p-a9af70eb.entry.js +0 -1
- package/dist/db-ux/p-aa8383a3.entry.js +0 -1
- package/dist/db-ux/p-ba1f69bd.entry.js +0 -1
- package/dist/db-ux/p-d273b998.entry.js +0 -1
- package/dist/db-ux/p-da4ee6ee.entry.js +0 -1
- package/dist/db-ux/p-e584e927.entry.js +0 -1
- package/dist/db-ux/p-fe185f98.entry.js +0 -1
- /package/dist/db-ux/{p-BrThqi62.js → p-Crtu1dn6.js} +0 -0
|
@@ -16,12 +16,16 @@ export class DBSection {
|
|
|
16
16
|
const attributes = parent.attributes;
|
|
17
17
|
for (let i = 0; i < attributes.length; i++) {
|
|
18
18
|
const attr = attributes.item(i);
|
|
19
|
-
if (attr &&
|
|
19
|
+
if (attr && attr.name !== 'data-density' &&
|
|
20
20
|
(attr.name.startsWith("data-") || attr.name.startsWith("aria-"))) {
|
|
21
21
|
element.setAttribute(attr.name, attr.value);
|
|
22
22
|
parent.removeAttribute(attr.name);
|
|
23
23
|
}
|
|
24
|
-
if (attr && attr.name
|
|
24
|
+
else if (attr && attr.name !== 'data-density' && attr.name !== "class" && attr.name === "style") {
|
|
25
|
+
element.setAttribute(attr.name, attr.value);
|
|
26
|
+
parent.removeAttribute(attr.name);
|
|
27
|
+
}
|
|
28
|
+
else if (attr && attr.name === "class") {
|
|
25
29
|
const isWebComponent = attr.value.includes("hydrated");
|
|
26
30
|
const value = attr.value.replace("hydrated", "").trim();
|
|
27
31
|
const currentClass = element.getAttribute("class");
|
|
@@ -41,9 +45,9 @@ export class DBSection {
|
|
|
41
45
|
this.enableAttributePassing(this._ref, "db-section");
|
|
42
46
|
}
|
|
43
47
|
render() {
|
|
44
|
-
return (h("section", { key: '
|
|
48
|
+
return (h("section", { key: 'be6ea106507603acde69e5020d97318002075614', class: cls("db-section", this.className), ref: (el) => {
|
|
45
49
|
this._ref = el;
|
|
46
|
-
}, id: this.id, "data-spacing": this.spacing || "medium", "data-width": this.width }, h("slot", { key: '
|
|
50
|
+
}, id: this.id, "data-spacing": this.spacing || "medium", "data-width": this.width }, h("slot", { key: '339c00c1fca3117ad6e148474f8fefbecb6c28f6' })));
|
|
47
51
|
}
|
|
48
52
|
static get is() { return "db-section"; }
|
|
49
53
|
static get properties() {
|
|
@@ -110,12 +110,16 @@ export class DBSelect {
|
|
|
110
110
|
const attributes = parent.attributes;
|
|
111
111
|
for (let i = 0; i < attributes.length; i++) {
|
|
112
112
|
const attr = attributes.item(i);
|
|
113
|
-
if (attr &&
|
|
113
|
+
if (attr && attr.name !== 'data-density' &&
|
|
114
114
|
(attr.name.startsWith("data-") || attr.name.startsWith("aria-"))) {
|
|
115
115
|
element.setAttribute(attr.name, attr.value);
|
|
116
116
|
parent.removeAttribute(attr.name);
|
|
117
117
|
}
|
|
118
|
-
if (attr && attr.name
|
|
118
|
+
else if (attr && attr.name !== 'data-density' && attr.name !== "class" && attr.name === "style") {
|
|
119
|
+
element.setAttribute(attr.name, attr.value);
|
|
120
|
+
parent.removeAttribute(attr.name);
|
|
121
|
+
}
|
|
122
|
+
else if (attr && attr.name === "class") {
|
|
119
123
|
const isWebComponent = attr.value.includes("hydrated");
|
|
120
124
|
const value = attr.value.replace("hydrated", "").trim();
|
|
121
125
|
const currentClass = element.getAttribute("class");
|
|
@@ -216,14 +220,14 @@ export class DBSelect {
|
|
|
216
220
|
}
|
|
217
221
|
render() {
|
|
218
222
|
var _a, _b, _c, _d, _e;
|
|
219
|
-
return (h("div", { key: '
|
|
223
|
+
return (h("div", { key: 'fa85d886e937a4df9260c6c7afe3482054707a37', class: cls("db-select", this.className), "data-variant": this.variant, "data-hide-label": getHideProp(this.showLabel), "data-hide-asterisk": getHideProp(this.showRequiredAsterisk), "data-icon": this.icon, "data-show-icon": getBooleanAsString(this.showIcon) }, h("label", { key: '8641dd7e53e841c2b14c953e6f515bc019714a02', htmlFor: this._id }, (_a = this.label) !== null && _a !== void 0 ? _a : DEFAULT_LABEL), h("select", { key: '98086f761e1c7353e9c9be5a2b25ee6ad1539116', "aria-invalid": this.validation === "invalid", "data-custom-validity": this.validation, ref: (el) => {
|
|
220
224
|
this._ref = el;
|
|
221
225
|
}, required: getBoolean(this.required, "required"), disabled: getBoolean(this.disabled, "disabled"), id: this._id, name: this.name, size: this.size,
|
|
222
226
|
/* @ts-ignore */
|
|
223
227
|
value: (_b = this.value) !== null && _b !== void 0 ? _b : this._value, autocomplete: this.autocomplete, multiple: this.multiple, onInput: (event) => this.handleInput(event), onClick: (event) => this.handleClick(event), onChange: (event) => this.handleChange(event), onBlur: (event) => this.handleBlur(event), onFocus: (event) => this.handleFocus(event), "aria-describedby": (_c = this.ariaDescribedBy) !== null && _c !== void 0 ? _c : this._descByIds }, this.variant === "floating" || !!this.placeholder ? (h("option", { class: "placeholder", value: "", "data-show-empty-option": getBooleanAsString(this.shouldShowEmptyOption()) })) : null, ((_d = this.options) === null || _d === void 0 ? void 0 : _d.length) ? ((_e = this.options) === null || _e === void 0 ? void 0 : _e.map((option) => {
|
|
224
228
|
var _a;
|
|
225
229
|
return (h(Fragment, null, option.options ? (h("optgroup", { label: this.getOptionLabel(option), key: undefined }, (_a = option.options) === null || _a === void 0 ? void 0 : _a.map((optgroupOption) => (h("option", { value: optgroupOption.value, selected: optgroupOption.selected, disabled: optgroupOption.disabled, key: undefined }, this.getOptionLabel(optgroupOption)))))) : (h("option", { value: option.value, disabled: option.disabled, selected: option.selected, key: undefined }, this.getOptionLabel(option)))));
|
|
226
|
-
})) : (h("slot", null))), this.placeholder ? (h("span", { class: "db-select-placeholder", id: this._placeholderId }, this.placeholder)) : null, stringPropVisible(this.message, this.showMessage) ? (h("db-infotext", { size: "small", icon: this.messageIcon, id: this._messageId }, this.message)) : null, this.hasValidState() ? (h("db-infotext", { size: "small", semantic: "successful", id: this._validMessageId }, this.validMessage || DEFAULT_VALID_MESSAGE)) : null, h("db-infotext", { key: '
|
|
230
|
+
})) : (h("slot", null))), this.placeholder ? (h("span", { class: "db-select-placeholder", id: this._placeholderId }, this.placeholder)) : null, stringPropVisible(this.message, this.showMessage) ? (h("db-infotext", { size: "small", icon: this.messageIcon, id: this._messageId }, this.message)) : null, this.hasValidState() ? (h("db-infotext", { size: "small", semantic: "successful", id: this._validMessageId }, this.validMessage || DEFAULT_VALID_MESSAGE)) : null, h("db-infotext", { key: 'ef8708b7b5c72f4755b057387877a631eea7efe4', size: "small", semantic: "critical", id: this._invalidMessageId }, this._invalidMessage), h("span", { key: '7ce062862b7f38d673833d45ab59539c71758dcc', "data-visually-hidden": "true", role: "status" }, this._voiceOverFallback)));
|
|
227
231
|
}
|
|
228
232
|
static get is() { return "db-select"; }
|
|
229
233
|
static get properties() {
|
|
@@ -16,12 +16,16 @@ export class DBStack {
|
|
|
16
16
|
const attributes = parent.attributes;
|
|
17
17
|
for (let i = 0; i < attributes.length; i++) {
|
|
18
18
|
const attr = attributes.item(i);
|
|
19
|
-
if (attr &&
|
|
19
|
+
if (attr && attr.name !== 'data-density' &&
|
|
20
20
|
(attr.name.startsWith("data-") || attr.name.startsWith("aria-"))) {
|
|
21
21
|
element.setAttribute(attr.name, attr.value);
|
|
22
22
|
parent.removeAttribute(attr.name);
|
|
23
23
|
}
|
|
24
|
-
if (attr && attr.name
|
|
24
|
+
else if (attr && attr.name !== 'data-density' && attr.name !== "class" && attr.name === "style") {
|
|
25
|
+
element.setAttribute(attr.name, attr.value);
|
|
26
|
+
parent.removeAttribute(attr.name);
|
|
27
|
+
}
|
|
28
|
+
else if (attr && attr.name === "class") {
|
|
25
29
|
const isWebComponent = attr.value.includes("hydrated");
|
|
26
30
|
const value = attr.value.replace("hydrated", "").trim();
|
|
27
31
|
const currentClass = element.getAttribute("class");
|
|
@@ -41,9 +45,9 @@ export class DBStack {
|
|
|
41
45
|
this.enableAttributePassing(this._ref, "db-stack");
|
|
42
46
|
}
|
|
43
47
|
render() {
|
|
44
|
-
return (h("div", { key: '
|
|
48
|
+
return (h("div", { key: '8e1a65def48c19955230380ca6795ddc19306278', class: cls("db-stack", this.className), ref: (el) => {
|
|
45
49
|
this._ref = el;
|
|
46
|
-
}, id: this.id, "data-gap": this.gap, "data-variant": this.variant, "data-direction": this.direction, "data-alignment": this.alignment, "data-justify-content": this.justifyContent, "data-wrap": getBooleanAsString(this.wrap) }, h("slot", { key: '
|
|
50
|
+
}, id: this.id, "data-gap": this.gap, "data-variant": this.variant, "data-direction": this.direction, "data-alignment": this.alignment, "data-justify-content": this.justifyContent, "data-wrap": getBooleanAsString(this.wrap) }, h("slot", { key: '170c71100d2005b60f5f6cf7432180d4a960ea16' })));
|
|
47
51
|
}
|
|
48
52
|
static get is() { return "db-stack"; }
|
|
49
53
|
static get properties() {
|
|
@@ -92,12 +92,16 @@ export class DBSwitch {
|
|
|
92
92
|
const attributes = parent.attributes;
|
|
93
93
|
for (let i = 0; i < attributes.length; i++) {
|
|
94
94
|
const attr = attributes.item(i);
|
|
95
|
-
if (attr &&
|
|
95
|
+
if (attr && attr.name !== 'data-density' &&
|
|
96
96
|
(attr.name.startsWith("data-") || attr.name.startsWith("aria-"))) {
|
|
97
97
|
element.setAttribute(attr.name, attr.value);
|
|
98
98
|
parent.removeAttribute(attr.name);
|
|
99
99
|
}
|
|
100
|
-
if (attr && attr.name
|
|
100
|
+
else if (attr && attr.name !== 'data-density' && attr.name !== "class" && attr.name === "style") {
|
|
101
|
+
element.setAttribute(attr.name, attr.value);
|
|
102
|
+
parent.removeAttribute(attr.name);
|
|
103
|
+
}
|
|
104
|
+
else if (attr && attr.name === "class") {
|
|
101
105
|
const isWebComponent = attr.value.includes("hydrated");
|
|
102
106
|
const value = attr.value.replace("hydrated", "").trim();
|
|
103
107
|
const currentClass = element.getAttribute("class");
|
|
@@ -155,9 +159,9 @@ export class DBSwitch {
|
|
|
155
159
|
}
|
|
156
160
|
render() {
|
|
157
161
|
var _a, _b, _c, _d;
|
|
158
|
-
return (h("div", { key: '
|
|
162
|
+
return (h("div", { key: '381988aad06b23fd3e1da260baa8767e65149bd1', class: cls("db-switch", this.className), "data-visual-aid": getBooleanAsString(this.visualAid), "data-size": this.size, "data-hide-label": getHideProp(this.showLabel), "data-variant": this.variant, "data-hide-asterisk": getHideProp(this.showRequiredAsterisk), "data-custom-validity": this.validation }, h("label", { key: '88dde462a4617702b4c4ef9458e9c83d183b0a75', htmlFor: this._id }, h("input", { key: '740ea4c6d187bef60bd240d67ea564c96205bb15', type: "checkbox", role: "switch", id: this._id, ref: (el) => {
|
|
159
163
|
this._ref = el;
|
|
160
|
-
}, checked: getBoolean(this.checked, "checked"), value: this.value, disabled: getBoolean(this.disabled, "disabled"), "aria-invalid": this.validation === "invalid" ? "true" : undefined, "aria-describedby": this._descByIds, name: this.name, required: 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 : h("slot", null)), stringPropVisible(this.message, this.showMessage) ? (h("db-infotext", { size: "small", semantic: "adaptive", id: this._messageId, icon: this.messageIcon }, this.message)) : null, this.hasValidState() ? (h("db-infotext", { size: "small", semantic: "successful", id: this._validMessageId }, (_b = this.validMessage) !== null && _b !== void 0 ? _b : DEFAULT_VALID_MESSAGE)) : null, h("db-infotext", { key: '
|
|
164
|
+
}, checked: getBoolean(this.checked, "checked"), value: this.value, disabled: getBoolean(this.disabled, "disabled"), "aria-invalid": this.validation === "invalid" ? "true" : undefined, "aria-describedby": this._descByIds, name: this.name, required: 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 : h("slot", null)), stringPropVisible(this.message, this.showMessage) ? (h("db-infotext", { size: "small", semantic: "adaptive", id: this._messageId, icon: this.messageIcon }, this.message)) : null, this.hasValidState() ? (h("db-infotext", { size: "small", semantic: "successful", id: this._validMessageId }, (_b = this.validMessage) !== null && _b !== void 0 ? _b : DEFAULT_VALID_MESSAGE)) : null, h("db-infotext", { key: 'af53c40d0292aa12daab8e30c2a18a69a3f70477', size: "small", semantic: "critical", id: this._invalidMessageId }, (_d = (_c = this._invalidMessage) !== null && _c !== void 0 ? _c : this.invalidMessage) !== null && _d !== void 0 ? _d : DEFAULT_INVALID_MESSAGE), h("span", { key: 'b70a42d0cdc3f3d0e63672af09293d0dbd263262', "data-visually-hidden": "true", role: "status" }, this._voiceOverFallback)));
|
|
161
165
|
}
|
|
162
166
|
static get is() { return "db-switch"; }
|
|
163
167
|
static get properties() {
|
|
@@ -475,11 +479,11 @@ export class DBSwitch {
|
|
|
475
479
|
"attribute": "show-label"
|
|
476
480
|
},
|
|
477
481
|
"variant": {
|
|
478
|
-
"type": "
|
|
482
|
+
"type": "string",
|
|
479
483
|
"mutable": false,
|
|
480
484
|
"complexType": {
|
|
481
485
|
"original": "DBSwitchProps[\"variant\"]",
|
|
482
|
-
"resolved": "
|
|
486
|
+
"resolved": "\"leading\" | \"trailing\"",
|
|
483
487
|
"references": {
|
|
484
488
|
"DBSwitchProps": {
|
|
485
489
|
"location": "import",
|
|
@@ -496,7 +500,9 @@ export class DBSwitch {
|
|
|
496
500
|
"text": ""
|
|
497
501
|
},
|
|
498
502
|
"getter": false,
|
|
499
|
-
"setter": false
|
|
503
|
+
"setter": false,
|
|
504
|
+
"reflect": false,
|
|
505
|
+
"attribute": "variant"
|
|
500
506
|
},
|
|
501
507
|
"showRequiredAsterisk": {
|
|
502
508
|
"type": "any",
|
|
@@ -43,12 +43,16 @@ export class DBTabItem {
|
|
|
43
43
|
const attributes = parent.attributes;
|
|
44
44
|
for (let i = 0; i < attributes.length; i++) {
|
|
45
45
|
const attr = attributes.item(i);
|
|
46
|
-
if (attr &&
|
|
46
|
+
if (attr && attr.name !== 'data-density' &&
|
|
47
47
|
(attr.name.startsWith("data-") || attr.name.startsWith("aria-"))) {
|
|
48
48
|
element.setAttribute(attr.name, attr.value);
|
|
49
49
|
parent.removeAttribute(attr.name);
|
|
50
50
|
}
|
|
51
|
-
if (attr && attr.name
|
|
51
|
+
else if (attr && attr.name !== 'data-density' && attr.name !== "class" && attr.name === "style") {
|
|
52
|
+
element.setAttribute(attr.name, attr.value);
|
|
53
|
+
parent.removeAttribute(attr.name);
|
|
54
|
+
}
|
|
55
|
+
else if (attr && attr.name === "class") {
|
|
52
56
|
const isWebComponent = attr.value.includes("hydrated");
|
|
53
57
|
const value = attr.value.replace("hydrated", "").trim();
|
|
54
58
|
const currentClass = element.getAttribute("class");
|
|
@@ -109,9 +113,9 @@ export class DBTabItem {
|
|
|
109
113
|
}
|
|
110
114
|
render() {
|
|
111
115
|
var _a, _b;
|
|
112
|
-
return (h("li", { key: '
|
|
116
|
+
return (h("li", { key: 'd41844269899bdbe6f51e5b233e7231de9684896', class: cls("db-tab-item", this.className), role: "none" }, h("label", { key: '7457d13ecb96dabfa6b7db882dd859db3e5835aa', htmlFor: this.id, "data-icon": (_a = this.iconLeading) !== null && _a !== void 0 ? _a : this.icon, "data-icon-trailing": this.iconTrailing, "data-show-icon": getBooleanAsString((_b = this.showIconLeading) !== null && _b !== void 0 ? _b : this.showIcon), "data-show-icon-trailing": getBooleanAsString(this.showIconTrailing), "data-no-text": getBooleanAsString(this.noText) }, h("input", { key: '9ac547b1cc507744eae9cef47b0f07ef77664353', type: "radio", role: "tab", disabled: getBoolean(this.disabled, "disabled"), "aria-selected": this._selected, checked: getBoolean(this.checked, "checked"), ref: (el) => {
|
|
113
117
|
this._ref = el;
|
|
114
|
-
}, name: this._name, id: this.id, onInput: (event) => this.handleChange(event) }), this.label ? this.label : null, h("slot", { key: '
|
|
118
|
+
}, name: this._name, id: this.id, onInput: (event) => this.handleChange(event) }), this.label ? this.label : null, h("slot", { key: 'f647866c15651dbfa8f553c3628f75db7ff2f706' }))));
|
|
115
119
|
}
|
|
116
120
|
static get is() { return "db-tab-item"; }
|
|
117
121
|
static get properties() {
|
|
@@ -16,12 +16,16 @@ export class DBTabList {
|
|
|
16
16
|
const attributes = parent.attributes;
|
|
17
17
|
for (let i = 0; i < attributes.length; i++) {
|
|
18
18
|
const attr = attributes.item(i);
|
|
19
|
-
if (attr &&
|
|
19
|
+
if (attr && attr.name !== 'data-density' &&
|
|
20
20
|
(attr.name.startsWith("data-") || attr.name.startsWith("aria-"))) {
|
|
21
21
|
element.setAttribute(attr.name, attr.value);
|
|
22
22
|
parent.removeAttribute(attr.name);
|
|
23
23
|
}
|
|
24
|
-
if (attr && attr.name
|
|
24
|
+
else if (attr && attr.name !== 'data-density' && attr.name !== "class" && attr.name === "style") {
|
|
25
|
+
element.setAttribute(attr.name, attr.value);
|
|
26
|
+
parent.removeAttribute(attr.name);
|
|
27
|
+
}
|
|
28
|
+
else if (attr && attr.name === "class") {
|
|
25
29
|
const isWebComponent = attr.value.includes("hydrated");
|
|
26
30
|
const value = attr.value.replace("hydrated", "").trim();
|
|
27
31
|
const currentClass = element.getAttribute("class");
|
|
@@ -41,9 +45,9 @@ export class DBTabList {
|
|
|
41
45
|
this.enableAttributePassing(this._ref, "db-tab-list");
|
|
42
46
|
}
|
|
43
47
|
render() {
|
|
44
|
-
return (h("div", { key: '
|
|
48
|
+
return (h("div", { key: 'b957f2a462786de26787834a1ee87584c5a07a5a', class: cls("db-tab-list", this.className), ref: (el) => {
|
|
45
49
|
this._ref = el;
|
|
46
|
-
}, id: this.id }, h("ul", { key: '
|
|
50
|
+
}, id: this.id }, h("ul", { key: 'c7e7884642f3914237bb576f0460337b2e2598ed', role: "tablist" }, h("slot", { key: '5edad46fde906c2903fcfdad2dca8ded8ba0854c' }))));
|
|
47
51
|
}
|
|
48
52
|
static get is() { return "db-tab-list"; }
|
|
49
53
|
static get properties() {
|
|
@@ -16,12 +16,16 @@ export class DBTabPanel {
|
|
|
16
16
|
const attributes = parent.attributes;
|
|
17
17
|
for (let i = 0; i < attributes.length; i++) {
|
|
18
18
|
const attr = attributes.item(i);
|
|
19
|
-
if (attr &&
|
|
19
|
+
if (attr && attr.name !== 'data-density' &&
|
|
20
20
|
(attr.name.startsWith("data-") || attr.name.startsWith("aria-"))) {
|
|
21
21
|
element.setAttribute(attr.name, attr.value);
|
|
22
22
|
parent.removeAttribute(attr.name);
|
|
23
23
|
}
|
|
24
|
-
if (attr && attr.name
|
|
24
|
+
else if (attr && attr.name !== 'data-density' && attr.name !== "class" && attr.name === "style") {
|
|
25
|
+
element.setAttribute(attr.name, attr.value);
|
|
26
|
+
parent.removeAttribute(attr.name);
|
|
27
|
+
}
|
|
28
|
+
else if (attr && attr.name === "class") {
|
|
25
29
|
const isWebComponent = attr.value.includes("hydrated");
|
|
26
30
|
const value = attr.value.replace("hydrated", "").trim();
|
|
27
31
|
const currentClass = element.getAttribute("class");
|
|
@@ -41,9 +45,9 @@ export class DBTabPanel {
|
|
|
41
45
|
this.enableAttributePassing(this._ref, "db-tab-panel");
|
|
42
46
|
}
|
|
43
47
|
render() {
|
|
44
|
-
return (h("section", { key: '
|
|
48
|
+
return (h("section", { key: 'f44bf1489cf2917d2c114eccb1e2c863630baa18', class: cls("db-tab-panel", this.className), role: "tabpanel", ref: (el) => {
|
|
45
49
|
this._ref = el;
|
|
46
|
-
}, id: this.id }, this.content ? this.content : null, h("slot", { key: '
|
|
50
|
+
}, id: this.id }, this.content ? this.content : null, h("slot", { key: 'a21fe75df9dbb089c1520a0cc1ce040fefe0bacd' })));
|
|
47
51
|
}
|
|
48
52
|
static get is() { return "db-tab-panel"; }
|
|
49
53
|
static get properties() {
|
|
@@ -143,12 +143,16 @@ export class DBTabs {
|
|
|
143
143
|
const attributes = parent.attributes;
|
|
144
144
|
for (let i = 0; i < attributes.length; i++) {
|
|
145
145
|
const attr = attributes.item(i);
|
|
146
|
-
if (attr &&
|
|
146
|
+
if (attr && attr.name !== 'data-density' &&
|
|
147
147
|
(attr.name.startsWith("data-") || attr.name.startsWith("aria-"))) {
|
|
148
148
|
element.setAttribute(attr.name, attr.value);
|
|
149
149
|
parent.removeAttribute(attr.name);
|
|
150
150
|
}
|
|
151
|
-
if (attr && attr.name
|
|
151
|
+
else if (attr && attr.name !== 'data-density' && attr.name !== "class" && attr.name === "style") {
|
|
152
|
+
element.setAttribute(attr.name, attr.value);
|
|
153
|
+
parent.removeAttribute(attr.name);
|
|
154
|
+
}
|
|
155
|
+
else if (attr && attr.name === "class") {
|
|
152
156
|
const isWebComponent = attr.value.includes("hydrated");
|
|
153
157
|
const value = attr.value.replace("hydrated", "").trim();
|
|
154
158
|
const currentClass = element.getAttribute("class");
|
|
@@ -202,10 +206,10 @@ export class DBTabs {
|
|
|
202
206
|
}
|
|
203
207
|
render() {
|
|
204
208
|
var _a, _b, _c, _d;
|
|
205
|
-
return (h("div", { key: '
|
|
209
|
+
return (h("div", { key: 'd1ce43010fda441bb6190b71624b6f72bb6a2a5b', class: cls("db-tabs", this.className), ref: (el) => {
|
|
206
210
|
this._ref = el;
|
|
207
211
|
}, id: this.id, "data-orientation": this.orientation, "data-scroll-behavior": this.behavior, "data-alignment": (_a = this.alignment) !== null && _a !== void 0 ? _a : "start", "data-width": (_b = this.width) !== null && _b !== void 0 ? _b : "auto", onInput: (event) => this.handleChange(event), onChange: (event) => this.handleChange(event) }, this.showScrollLeft ? (h("db-button", { class: "tabs-scroll-left", variant: "ghost", icon: "chevron_left", type: "button", noText: true, onClick: () => this.scroll(true) }, "Scroll left")) : null, this.tabs ? (h(Fragment, null, h("db-tab-list", null, (_c = this.convertTabs()) === null || _c === void 0 ? void 0 : _c.map((tab, index) => (h("db-tab-item", { key: this.name + "tab-item" + index, active: tab.active, label: tab.label, iconTrailing: tab.iconTrailing, icon: tab.icon, noText: tab.noText })))), (_d = this.convertTabs()) === null || _d === void 0 ? void 0 :
|
|
208
|
-
_d.map((tab, index) => (h("db-tab-panel", { key: this.name + "tab-panel" + index, content: tab.content }, tab.children))))) : null, this.showScrollRight ? (h("db-button", { class: "tabs-scroll-right", variant: "ghost", icon: "chevron_right", type: "button", noText: true, onClick: () => this.scroll() }, "Scroll right")) : null, h("slot", { key: '
|
|
212
|
+
_d.map((tab, index) => (h("db-tab-panel", { key: this.name + "tab-panel" + index, content: tab.content }, tab.children))))) : null, this.showScrollRight ? (h("db-button", { class: "tabs-scroll-right", variant: "ghost", icon: "chevron_right", type: "button", noText: true, onClick: () => this.scroll() }, "Scroll right")) : null, h("slot", { key: '2b4836a486ca06290a4fc64cb3922b62cd999add' })));
|
|
209
213
|
}
|
|
210
214
|
static get is() { return "db-tabs"; }
|
|
211
215
|
static get properties() {
|
|
@@ -32,12 +32,16 @@ export class DBTag {
|
|
|
32
32
|
const attributes = parent.attributes;
|
|
33
33
|
for (let i = 0; i < attributes.length; i++) {
|
|
34
34
|
const attr = attributes.item(i);
|
|
35
|
-
if (attr &&
|
|
35
|
+
if (attr && attr.name !== 'data-density' &&
|
|
36
36
|
(attr.name.startsWith("data-") || attr.name.startsWith("aria-"))) {
|
|
37
37
|
element.setAttribute(attr.name, attr.value);
|
|
38
38
|
parent.removeAttribute(attr.name);
|
|
39
39
|
}
|
|
40
|
-
if (attr && attr.name
|
|
40
|
+
else if (attr && attr.name !== 'data-density' && attr.name !== "class" && attr.name === "style") {
|
|
41
|
+
element.setAttribute(attr.name, attr.value);
|
|
42
|
+
parent.removeAttribute(attr.name);
|
|
43
|
+
}
|
|
44
|
+
else if (attr && attr.name === "class") {
|
|
41
45
|
const isWebComponent = attr.value.includes("hydrated");
|
|
42
46
|
const value = attr.value.replace("hydrated", "").trim();
|
|
43
47
|
const currentClass = element.getAttribute("class");
|
|
@@ -58,9 +62,9 @@ export class DBTag {
|
|
|
58
62
|
}
|
|
59
63
|
render() {
|
|
60
64
|
var _a;
|
|
61
|
-
return (h("div", { key: '
|
|
65
|
+
return (h("div", { key: 'c0f6907ce1246c8047c5af115a093ecaa4032a55', class: cls("db-tag", this.className), ref: (el) => {
|
|
62
66
|
this._ref = el;
|
|
63
|
-
}, id: this.id, "data-semantic": this.semantic, "data-emphasis": this.emphasis, "data-icon": this.icon, "data-show-check-state": getBooleanAsString((_a = this.showCheckState) !== null && _a !== void 0 ? _a : true), "data-show-icon": getBooleanAsString(this.showIcon), "data-no-text": getBooleanAsString(this.noText), "data-overflow": getBooleanAsString(this.overflow) }, h("slot", { key: '
|
|
67
|
+
}, id: this.id, "data-semantic": this.semantic, "data-emphasis": this.emphasis, "data-icon": this.icon, "data-show-check-state": getBooleanAsString((_a = this.showCheckState) !== null && _a !== void 0 ? _a : true), "data-show-icon": getBooleanAsString(this.showIcon), "data-no-text": getBooleanAsString(this.noText), "data-overflow": getBooleanAsString(this.overflow) }, h("slot", { key: 'c5e244aebde8e2fa54bcd61e66d69559a607a952', name: "content" }), h("slot", { key: '7356f14f2c11b4180f1f59ef8bd5a4e0dffb9d9c' }), this.text ? this.text : null, this.behavior === "removable" ? (h("button", { class: "db-button db-tab-remove-button", "data-icon": "cross", "data-size": "small", "data-no-text": "true", "data-variant": "ghost", type: "button", onClick: (event) => this.handleRemove(event) }, h("db-tooltip", { variant: "label" }, this.getRemoveButtonText()))) : null));
|
|
64
68
|
}
|
|
65
69
|
static get is() { return "db-tag"; }
|
|
66
70
|
static get properties() {
|
|
@@ -85,12 +85,16 @@ export class DBTextarea {
|
|
|
85
85
|
const attributes = parent.attributes;
|
|
86
86
|
for (let i = 0; i < attributes.length; i++) {
|
|
87
87
|
const attr = attributes.item(i);
|
|
88
|
-
if (attr &&
|
|
88
|
+
if (attr && attr.name !== 'data-density' &&
|
|
89
89
|
(attr.name.startsWith("data-") || attr.name.startsWith("aria-"))) {
|
|
90
90
|
element.setAttribute(attr.name, attr.value);
|
|
91
91
|
parent.removeAttribute(attr.name);
|
|
92
92
|
}
|
|
93
|
-
if (attr && attr.name
|
|
93
|
+
else if (attr && attr.name !== 'data-density' && attr.name !== "class" && attr.name === "style") {
|
|
94
|
+
element.setAttribute(attr.name, attr.value);
|
|
95
|
+
parent.removeAttribute(attr.name);
|
|
96
|
+
}
|
|
97
|
+
else if (attr && attr.name === "class") {
|
|
94
98
|
const isWebComponent = attr.value.includes("hydrated");
|
|
95
99
|
const value = attr.value.replace("hydrated", "").trim();
|
|
96
100
|
const currentClass = element.getAttribute("class");
|
|
@@ -182,10 +186,10 @@ export class DBTextarea {
|
|
|
182
186
|
}
|
|
183
187
|
render() {
|
|
184
188
|
var _a, _b, _c, _d, _e;
|
|
185
|
-
return (h("div", { key: '
|
|
189
|
+
return (h("div", { key: 'c5a0b30d63e913e519eda3d1a4f2358260ee78bc', class: cls("db-textarea", this.className), "data-variant": this.variant, "data-hide-asterisk": getHideProp(this.showRequiredAsterisk), "data-hide-label": getHideProp(this.showLabel) }, h("label", { key: 'bc06e336ede0361cfea4dede668ce4a9d51db8d5', htmlFor: this._id }, (_a = this.label) !== null && _a !== void 0 ? _a : DEFAULT_LABEL), h("textarea", { key: 'c578a2d86b8146c6b063038110c3b946196192cc', "aria-invalid": this.validation === "invalid", "data-custom-validity": this.validation, "data-field-sizing": this.fieldSizing, ref: (el) => {
|
|
186
190
|
this._ref = el;
|
|
187
191
|
}, id: this._id, "data-resize": this.resize, "data-hide-resizer": getHideProp((_b = this.showResizer) !== null && _b !== void 0 ? _b : true), disabled: getBoolean(this.disabled, "disabled"), required: getBoolean(this.required, "required"), readOnly: getBoolean(this.readOnly, "readOnly") ||
|
|
188
|
-
getBoolean(this.readonly, "readonly"), form: this.form, maxLength: getNumber(this.maxLength, this.maxlength), minLength: getNumber(this.minLength, this.minlength), name: this.name, wrap: this.wrap, spellcheck: this.spellCheck, autocomplete: this.autocomplete, onInput: (event) => this.handleInput(event), onChange: (event) => this.handleChange(event), onBlur: (event) => this.handleBlur(event), onFocus: (event) => this.handleFocus(event), value: (_c = this.value) !== null && _c !== void 0 ? _c : this._value, "aria-describedby": (_d = this.ariaDescribedBy) !== null && _d !== void 0 ? _d : this._descByIds, placeholder: (_e = this.placeholder) !== null && _e !== void 0 ? _e : DEFAULT_PLACEHOLDER, rows: getNumber(this.rows, DEFAULT_ROWS), cols: getNumber(this.cols) }), stringPropVisible(this.message, this.showMessage) ? (h("db-infotext", { size: "small", icon: this.messageIcon, id: this._messageId }, this.message)) : null, this.hasValidState() ? (h("db-infotext", { size: "small", semantic: "successful", id: this._validMessageId }, this.validMessage || DEFAULT_VALID_MESSAGE)) : null, h("db-infotext", { key: '
|
|
192
|
+
getBoolean(this.readonly, "readonly"), form: this.form, maxLength: getNumber(this.maxLength, this.maxlength), minLength: getNumber(this.minLength, this.minlength), name: this.name, wrap: this.wrap, spellcheck: this.spellCheck, autocomplete: this.autocomplete, onInput: (event) => this.handleInput(event), onChange: (event) => this.handleChange(event), onBlur: (event) => this.handleBlur(event), onFocus: (event) => this.handleFocus(event), value: (_c = this.value) !== null && _c !== void 0 ? _c : this._value, "aria-describedby": (_d = this.ariaDescribedBy) !== null && _d !== void 0 ? _d : this._descByIds, placeholder: (_e = this.placeholder) !== null && _e !== void 0 ? _e : DEFAULT_PLACEHOLDER, rows: getNumber(this.rows, DEFAULT_ROWS), cols: getNumber(this.cols) }), stringPropVisible(this.message, this.showMessage) ? (h("db-infotext", { size: "small", icon: this.messageIcon, id: this._messageId }, this.message)) : null, this.hasValidState() ? (h("db-infotext", { size: "small", semantic: "successful", id: this._validMessageId }, this.validMessage || DEFAULT_VALID_MESSAGE)) : null, h("db-infotext", { key: '7e4779a8d59cdf989d50efcb9327bb388afed965', size: "small", semantic: "critical", id: this._invalidMessageId }, this._invalidMessage), h("span", { key: 'c1dd840156dc108c653c0f0b6c7d4a8e4af5c8a0', "data-visually-hidden": "true", role: "status" }, this._voiceOverFallback)));
|
|
189
193
|
}
|
|
190
194
|
static get is() { return "db-textarea"; }
|
|
191
195
|
static get properties() {
|
|
@@ -37,7 +37,7 @@ export class DBTooltip {
|
|
|
37
37
|
return;
|
|
38
38
|
if (this._ref) {
|
|
39
39
|
// This is a workaround for angular
|
|
40
|
-
utilsDelay(() => {
|
|
40
|
+
void utilsDelay(() => {
|
|
41
41
|
var _a;
|
|
42
42
|
// Due to race conditions we need to check for _ref again
|
|
43
43
|
if (this._ref) {
|
|
@@ -77,12 +77,16 @@ export class DBTooltip {
|
|
|
77
77
|
const attributes = parent.attributes;
|
|
78
78
|
for (let i = 0; i < attributes.length; i++) {
|
|
79
79
|
const attr = attributes.item(i);
|
|
80
|
-
if (attr &&
|
|
80
|
+
if (attr && attr.name !== 'data-density' &&
|
|
81
81
|
(attr.name.startsWith("data-") || attr.name.startsWith("aria-"))) {
|
|
82
82
|
element.setAttribute(attr.name, attr.value);
|
|
83
83
|
parent.removeAttribute(attr.name);
|
|
84
84
|
}
|
|
85
|
-
if (attr && attr.name
|
|
85
|
+
else if (attr && attr.name !== 'data-density' && attr.name !== "class" && attr.name === "style") {
|
|
86
|
+
element.setAttribute(attr.name, attr.value);
|
|
87
|
+
parent.removeAttribute(attr.name);
|
|
88
|
+
}
|
|
89
|
+
else if (attr && attr.name === "class") {
|
|
86
90
|
const isWebComponent = attr.value.includes("hydrated");
|
|
87
91
|
const value = attr.value.replace("hydrated", "").trim();
|
|
88
92
|
const currentClass = element.getAttribute("class");
|
|
@@ -110,6 +114,7 @@ export class DBTooltip {
|
|
|
110
114
|
if (this._ref && this.initialized && this._id) {
|
|
111
115
|
const parent = this.getParent();
|
|
112
116
|
if (parent) {
|
|
117
|
+
this.handleAutoPlacement(parent);
|
|
113
118
|
["mouseenter", "focusin"].forEach((event) => {
|
|
114
119
|
parent.addEventListener(event, () => this.handleEnter(parent));
|
|
115
120
|
});
|
|
@@ -148,9 +153,9 @@ export class DBTooltip {
|
|
|
148
153
|
}
|
|
149
154
|
render() {
|
|
150
155
|
var _a, _b;
|
|
151
|
-
return (h("i", { key: '
|
|
156
|
+
return (h("i", { key: 'c7945ff2b0ac7baf8b2f7d7c2eae448815889415', class: cls("db-tooltip", this.className), role: "tooltip", "aria-hidden": "true", "data-gap": "true", ref: (el) => {
|
|
152
157
|
this._ref = el;
|
|
153
|
-
}, id: this._id, "data-emphasis": this.emphasis, "data-animation": getBooleanAsString((_a = this.animation) !== null && _a !== void 0 ? _a : true), "data-delay": this.delay, "data-width": this.width, "data-show-arrow": getBooleanAsString((_b = this.showArrow) !== null && _b !== void 0 ? _b : true), "data-placement": this.placement, onClick: (event) => this.handleClick(event) }, h("slot", { key: '
|
|
158
|
+
}, id: this._id, "data-emphasis": this.emphasis, "data-animation": getBooleanAsString((_a = this.animation) !== null && _a !== void 0 ? _a : true), "data-delay": this.delay, "data-width": this.width, "data-show-arrow": getBooleanAsString((_b = this.showArrow) !== null && _b !== void 0 ? _b : true), "data-placement": this.placement, onClick: (event) => this.handleClick(event) }, h("slot", { key: '3d170c76cc0d05c75a65daaac4b3570ed522d0d1' })));
|
|
154
159
|
}
|
|
155
160
|
static get is() { return "db-tooltip"; }
|
|
156
161
|
static get properties() {
|
|
@@ -228,10 +228,54 @@ export const getFloatingProps = (element, parent, placement) => {
|
|
|
228
228
|
innerHeight
|
|
229
229
|
};
|
|
230
230
|
};
|
|
231
|
+
const MAX_ANCESTOR_DEPTH = 10;
|
|
232
|
+
const ancestorCache = new WeakMap();
|
|
233
|
+
const getAncestorHasCorrectedPlacement = (element) => {
|
|
234
|
+
if (ancestorCache.has(element)) {
|
|
235
|
+
return ancestorCache.get(element);
|
|
236
|
+
}
|
|
237
|
+
let current = element.parentElement;
|
|
238
|
+
let anchor = 0;
|
|
239
|
+
while (current && anchor < MAX_ANCESTOR_DEPTH) {
|
|
240
|
+
if (current.dataset['correctedPlacement']) {
|
|
241
|
+
ancestorCache.set(element, current);
|
|
242
|
+
return current;
|
|
243
|
+
}
|
|
244
|
+
current = current.parentElement;
|
|
245
|
+
anchor += 1;
|
|
246
|
+
}
|
|
247
|
+
ancestorCache.set(element, null);
|
|
248
|
+
return null;
|
|
249
|
+
};
|
|
231
250
|
export const handleFixedPopover = (element, parent, placement) => {
|
|
232
|
-
var _a;
|
|
233
|
-
const
|
|
234
|
-
const
|
|
251
|
+
var _a, _b;
|
|
252
|
+
const parentComputedStyles = getComputedStyle(parent);
|
|
253
|
+
const parentHasFloatingPosition = ['absolute', 'fixed'].includes(parentComputedStyles.position);
|
|
254
|
+
const ancestorWithCorrectedPlacement = getAncestorHasCorrectedPlacement(element);
|
|
255
|
+
const noFloatingAncestor = !ancestorWithCorrectedPlacement && !parentHasFloatingPosition;
|
|
256
|
+
const distance = (_b = (_a = getComputedStyle(element)) === null || _a === void 0 ? void 0 : _a.getPropertyValue('--db-popover-distance')) !== null && _b !== void 0 ? _b : '0px';
|
|
257
|
+
let { top, height, width, childHeight, childWidth, right, left, bottom, correctedPlacement, innerWidth, innerHeight } = getFloatingProps(element, parent, placement);
|
|
258
|
+
if (ancestorWithCorrectedPlacement) {
|
|
259
|
+
const ancestorRect = ancestorWithCorrectedPlacement.getBoundingClientRect();
|
|
260
|
+
left = Math.abs(left - ancestorRect.left);
|
|
261
|
+
right = (width + Math.abs(right - ancestorRect.right)) * 1.5; // We add a transform -50% later
|
|
262
|
+
top = Math.abs(top - ancestorRect.top);
|
|
263
|
+
bottom = (height + Math.abs(bottom - ancestorRect.bottom)) * 1.5; // We add a transform -50% later
|
|
264
|
+
}
|
|
265
|
+
if (parentHasFloatingPosition) {
|
|
266
|
+
/*
|
|
267
|
+
* If we have a floating element inside an element with position:absolute/fixed
|
|
268
|
+
* we need to calculate with relative values
|
|
269
|
+
* */
|
|
270
|
+
left = 0;
|
|
271
|
+
right = width;
|
|
272
|
+
top = 0;
|
|
273
|
+
bottom = height;
|
|
274
|
+
if (['auto', 'inherit', '0'].includes(parentComputedStyles.zIndex)) {
|
|
275
|
+
// We need the default zIndex for floating elements on the parent
|
|
276
|
+
parent.style.zIndex = '1';
|
|
277
|
+
}
|
|
278
|
+
}
|
|
235
279
|
// Tooltip arrow position
|
|
236
280
|
if (childWidth > width && (correctedPlacement.startsWith('bottom') || correctedPlacement.startsWith('top'))) {
|
|
237
281
|
const diff = width / 2 / childWidth * 100;
|
|
@@ -241,6 +285,9 @@ export const handleFixedPopover = (element, parent, placement) => {
|
|
|
241
285
|
else if (correctedPlacement.endsWith('end')) {
|
|
242
286
|
element.style.setProperty('--db-tooltip-arrow-inline-start', `${100 - diff}%`);
|
|
243
287
|
}
|
|
288
|
+
else {
|
|
289
|
+
element.style.setProperty('--db-tooltip-arrow-inline-start', `50%`);
|
|
290
|
+
}
|
|
244
291
|
}
|
|
245
292
|
if (childHeight > height && (correctedPlacement.startsWith('left') || correctedPlacement.startsWith('bottom'))) {
|
|
246
293
|
const diff = height / 2 / childHeight * 100;
|
|
@@ -250,6 +297,9 @@ export const handleFixedPopover = (element, parent, placement) => {
|
|
|
250
297
|
else if (correctedPlacement.endsWith('end')) {
|
|
251
298
|
element.style.setProperty('--db-tooltip-arrow-block-start', `${100 - diff}%`);
|
|
252
299
|
}
|
|
300
|
+
else {
|
|
301
|
+
element.style.setProperty('--db-tooltip-arrow-block-start', `50%`);
|
|
302
|
+
}
|
|
253
303
|
}
|
|
254
304
|
// Popover position
|
|
255
305
|
if (correctedPlacement === 'right' || correctedPlacement === 'left') {
|
|
@@ -259,11 +309,11 @@ export const handleFixedPopover = (element, parent, placement) => {
|
|
|
259
309
|
else if (correctedPlacement === 'right-start' || correctedPlacement === 'left-start') {
|
|
260
310
|
const end = top + childHeight;
|
|
261
311
|
element.style.insetBlockStart = `${top}px`;
|
|
262
|
-
element.style.insetBlockEnd = `${end > innerHeight ? innerHeight : end}px`;
|
|
312
|
+
element.style.insetBlockEnd = `${!parentHasFloatingPosition && end > innerHeight ? innerHeight : end}px`;
|
|
263
313
|
}
|
|
264
314
|
else if (correctedPlacement === 'right-end' || correctedPlacement === 'left-end') {
|
|
265
315
|
const start = bottom - childHeight;
|
|
266
|
-
element.style.insetBlockStart = `${start < 0 ? 0 : start}px`;
|
|
316
|
+
element.style.insetBlockStart = `${!parentHasFloatingPosition && start < 0 ? 0 : start}px`;
|
|
267
317
|
element.style.insetBlockEnd = `${bottom}px`;
|
|
268
318
|
}
|
|
269
319
|
else if (correctedPlacement === 'top' || correctedPlacement === 'bottom') {
|
|
@@ -273,32 +323,32 @@ export const handleFixedPopover = (element, parent, placement) => {
|
|
|
273
323
|
else if (correctedPlacement === 'top-start' || correctedPlacement === 'bottom-start') {
|
|
274
324
|
const end = left + childWidth;
|
|
275
325
|
element.style.insetInlineStart = `${left}px`;
|
|
276
|
-
element.style.insetInlineEnd = `${end > innerWidth ? innerWidth : end}px`;
|
|
326
|
+
element.style.insetInlineEnd = `${!parentHasFloatingPosition && end > innerWidth ? innerWidth : end}px`;
|
|
277
327
|
}
|
|
278
328
|
else if (correctedPlacement === 'top-end' || correctedPlacement === 'bottom-end') {
|
|
279
|
-
const start =
|
|
280
|
-
element.style.insetInlineStart = `${
|
|
281
|
-
element.style.insetInlineEnd = `${
|
|
329
|
+
const start = right - childWidth;
|
|
330
|
+
element.style.insetInlineStart = `${!parentHasFloatingPosition && start < 0 ? 0 : start}px`;
|
|
331
|
+
element.style.insetInlineEnd = `${right}px`;
|
|
282
332
|
}
|
|
283
333
|
if (correctedPlacement === null || correctedPlacement === void 0 ? void 0 : correctedPlacement.startsWith('right')) {
|
|
284
334
|
const end = right + childWidth;
|
|
285
335
|
element.style.insetInlineStart = `calc(${right}px + ${distance})`;
|
|
286
|
-
element.style.insetInlineEnd = `calc(${end > innerWidth ? innerWidth : end}px + ${distance})`;
|
|
336
|
+
element.style.insetInlineEnd = `calc(${noFloatingAncestor && end > innerWidth ? innerWidth : end}px + ${distance})`;
|
|
287
337
|
}
|
|
288
338
|
else if (correctedPlacement === null || correctedPlacement === void 0 ? void 0 : correctedPlacement.startsWith('left')) {
|
|
289
339
|
const start = left - childWidth;
|
|
290
|
-
element.style.insetInlineStart = `calc(${start < 0 ? 0 : start}px - ${distance})`;
|
|
340
|
+
element.style.insetInlineStart = `calc(${noFloatingAncestor && start < 0 ? 0 : start}px - ${distance})`;
|
|
291
341
|
element.style.insetInlineEnd = `calc(${right}px - ${distance})`;
|
|
292
342
|
}
|
|
293
343
|
else if (correctedPlacement === null || correctedPlacement === void 0 ? void 0 : correctedPlacement.startsWith('top')) {
|
|
294
344
|
const start = top - childHeight;
|
|
295
|
-
element.style.insetBlockStart = `calc(${start < 0 ? 0 : start}px - ${distance})`;
|
|
296
|
-
element.style.insetBlockEnd = `calc(${bottom}px - ${distance})`;
|
|
345
|
+
element.style.insetBlockStart = `calc(${noFloatingAncestor && start < 0 ? 0 : start}px - ${distance})`;
|
|
346
|
+
element.style.insetBlockEnd = `calc(${parentHasFloatingPosition ? start : bottom}px - ${distance})`;
|
|
297
347
|
}
|
|
298
348
|
else if (correctedPlacement === null || correctedPlacement === void 0 ? void 0 : correctedPlacement.startsWith('bottom')) {
|
|
299
349
|
const end = bottom + childHeight;
|
|
300
|
-
element.style.insetBlockStart = `calc(${bottom}px + ${distance})`;
|
|
301
|
-
element.style.insetBlockEnd = `calc(${end > innerHeight ? innerHeight : end}px + ${distance})`;
|
|
350
|
+
element.style.insetBlockStart = `calc(${parentHasFloatingPosition ? end : bottom}px + ${distance})`;
|
|
351
|
+
element.style.insetBlockEnd = `calc(${noFloatingAncestor && end > innerHeight ? innerHeight : end}px + ${distance})`;
|
|
302
352
|
}
|
|
303
353
|
element.style.position = 'fixed';
|
|
304
354
|
element.dataset['correctedPlacement'] = correctedPlacement;
|