@db-ux/wc-core-components 4.11.0 → 4.11.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 +12 -0
- package/bundle/db-accordion-item.js +1 -1
- package/bundle/db-accordion.js +1 -1
- package/bundle/db-badge.js +1 -1
- package/bundle/db-brand.js +1 -1
- package/bundle/db-button.js +1 -1
- package/bundle/db-card.js +1 -1
- package/bundle/db-checkbox.js +1 -1
- package/bundle/db-custom-button.js +1 -1
- package/bundle/db-custom-select-dropdown.js +1 -1
- package/bundle/db-custom-select-form-field.js +1 -1
- package/bundle/db-custom-select-list-item.js +1 -1
- package/bundle/db-custom-select-list.js +1 -1
- package/bundle/db-custom-select.js +1 -1
- package/bundle/db-divider.js +1 -1
- package/bundle/db-drawer.js +1 -1
- package/bundle/db-header.js +1 -1
- package/bundle/db-icon.js +1 -1
- package/bundle/db-infotext.js +1 -1
- package/bundle/db-input.js +1 -1
- package/bundle/db-link.js +1 -1
- package/bundle/db-navigation-item.js +1 -1
- package/bundle/db-navigation.js +1 -1
- package/bundle/db-notification.js +1 -1
- package/bundle/db-page.js +1 -1
- package/bundle/db-popover.js +1 -1
- package/bundle/db-radio.js +1 -1
- package/bundle/db-section.js +1 -1
- package/bundle/db-select.js +1 -1
- package/bundle/db-stack.js +1 -1
- package/bundle/db-switch.js +1 -1
- package/bundle/db-tab-item.js +1 -1
- package/bundle/db-tab-list.js +1 -1
- package/bundle/db-tab-panel.js +1 -1
- package/bundle/db-table-body.js +1 -1
- package/bundle/db-table-caption.js +1 -1
- package/bundle/db-table-data-cell.js +1 -1
- package/bundle/db-table-footer.js +1 -1
- package/bundle/db-table-head.js +1 -1
- package/bundle/db-table-header-cell.js +1 -1
- package/bundle/db-table-row.js +1 -1
- package/bundle/db-table.js +1 -1
- package/bundle/db-tabs.js +1 -1
- package/bundle/db-tag.js +1 -1
- package/bundle/db-textarea.js +1 -1
- package/bundle/db-tooltip.js +1 -1
- package/bundle/p-3Da4lo5j.js +1 -0
- package/bundle/p-BEcb3EOO.js +1 -0
- package/bundle/p-BEolc6Da.js +1 -0
- package/bundle/p-BekmqY3B.js +1 -0
- package/bundle/p-BmRO4X-P.js +1 -0
- package/bundle/p-BrQIYm5N.js +1 -0
- package/bundle/p-BxZ0zFXf.js +1 -0
- package/bundle/p-C2viXF7U.js +1 -0
- package/bundle/p-C4iD-won.js +1 -0
- package/bundle/p-CHg_VPD9.js +1 -0
- package/bundle/p-CZ9SsTOA.js +1 -0
- package/bundle/p-CewqZGHg.js +1 -0
- package/bundle/p-CotiEHZi.js +1 -0
- package/bundle/p-D1orcIJf.js +1 -0
- package/bundle/p-D9RSX1St.js +1 -0
- package/bundle/p-DbgzEek1.js +1 -0
- package/bundle/p-DqNXsduK.js +1 -0
- package/bundle/p-Duacd-NX.js +1 -0
- package/bundle/p-k5Hci0ok.js +1 -0
- package/bundle/p-mk64Fltq.js +1 -0
- package/dist/cjs/db-accordion-item.cjs.entry.js +46 -9
- package/dist/cjs/db-accordion.cjs.entry.js +43 -6
- package/dist/cjs/db-badge.cjs.entry.js +43 -6
- package/dist/cjs/db-brand.cjs.entry.js +36 -5
- package/dist/cjs/db-button.cjs.entry.js +36 -5
- package/dist/cjs/db-card.cjs.entry.js +36 -5
- package/dist/cjs/db-checkbox.cjs.entry.js +45 -11
- package/dist/cjs/db-custom-button.cjs.entry.js +36 -5
- package/dist/cjs/db-custom-select-dropdown_5.cjs.entry.js +190 -31
- package/dist/cjs/db-custom-select-form-field.cjs.entry.js +36 -5
- package/dist/cjs/db-custom-select.cjs.entry.js +60 -26
- package/dist/cjs/db-divider.cjs.entry.js +35 -4
- package/dist/cjs/db-drawer.cjs.entry.js +45 -8
- package/dist/cjs/db-header.cjs.entry.js +43 -6
- package/dist/cjs/db-icon.cjs.entry.js +36 -5
- package/dist/cjs/db-infotext.cjs.entry.js +36 -5
- package/dist/cjs/db-link_4.cjs.entry.js +65 -19
- package/dist/cjs/db-navigation-item.cjs.entry.js +46 -9
- package/dist/cjs/db-navigation.cjs.entry.js +36 -5
- package/dist/cjs/db-notification.cjs.entry.js +36 -5
- package/dist/cjs/db-page.cjs.entry.js +48 -13
- package/dist/cjs/db-popover.cjs.entry.js +43 -6
- package/dist/cjs/db-radio.cjs.entry.js +42 -8
- package/dist/cjs/db-section.cjs.entry.js +36 -5
- package/dist/cjs/db-select.cjs.entry.js +45 -11
- package/dist/cjs/db-stack.cjs.entry.js +36 -5
- package/dist/cjs/db-switch.cjs.entry.js +45 -11
- package/dist/cjs/db-tab-item_3.cjs.entry.js +118 -19
- package/dist/cjs/db-table-body_3.cjs.entry.js +53 -12
- package/dist/cjs/db-table-caption.cjs.entry.js +36 -5
- package/dist/cjs/db-table.cjs.entry.js +35 -4
- package/dist/cjs/db-tabs.cjs.entry.js +42 -8
- package/dist/cjs/db-textarea.cjs.entry.js +45 -10
- package/dist/cjs/db-tooltip.cjs.entry.js +144 -20
- package/dist/cjs/db-ux.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/accordion/accordion.js +45 -7
- package/dist/collection/components/accordion-item/accordion-item.js +48 -10
- package/dist/collection/components/badge/badge.js +45 -7
- package/dist/collection/components/brand/brand.js +43 -5
- package/dist/collection/components/button/button.js +43 -5
- package/dist/collection/components/card/card.js +43 -5
- package/dist/collection/components/checkbox/checkbox.js +47 -12
- package/dist/collection/components/custom-button/custom-button.js +43 -5
- package/dist/collection/components/custom-select/custom-select.js +62 -27
- package/dist/collection/components/custom-select-dropdown/custom-select-dropdown.js +41 -5
- package/dist/collection/components/custom-select-form-field/custom-select-form-field.js +43 -5
- package/dist/collection/components/custom-select-list/custom-select-list.js +43 -5
- package/dist/collection/components/custom-select-list-item/custom-select-list-item.js +37 -5
- package/dist/collection/components/divider/divider.js +42 -4
- package/dist/collection/components/drawer/drawer.js +47 -9
- package/dist/collection/components/header/header.js +45 -7
- package/dist/collection/components/icon/icon.js +43 -5
- package/dist/collection/components/infotext/infotext.js +43 -5
- package/dist/collection/components/input/input.js +49 -13
- package/dist/collection/components/link/link.js +43 -5
- package/dist/collection/components/navigation/navigation.js +43 -5
- package/dist/collection/components/navigation-item/navigation-item.js +48 -10
- package/dist/collection/components/notification/notification.js +43 -5
- package/dist/collection/components/page/page.js +50 -14
- package/dist/collection/components/popover/popover.js +45 -7
- package/dist/collection/components/radio/radio.js +44 -9
- package/dist/collection/components/section/section.js +43 -5
- package/dist/collection/components/select/select.js +47 -12
- package/dist/collection/components/stack/stack.js +43 -5
- package/dist/collection/components/switch/switch.js +47 -12
- package/dist/collection/components/tab-item/tab-item.js +45 -10
- package/dist/collection/components/tab-list/tab-list.js +43 -5
- package/dist/collection/components/tab-panel/tab-panel.js +48 -5
- package/dist/collection/components/table/table.js +37 -5
- package/dist/collection/components/table-body/table-body.js +9 -4
- package/dist/collection/components/table-caption/table-caption.js +43 -5
- package/dist/collection/components/table-data-cell/table-data-cell.js +10 -5
- package/dist/collection/components/table-footer/table-footer.js +9 -4
- package/dist/collection/components/table-head/table-head.js +42 -4
- package/dist/collection/components/table-header-cell/table-header-cell.js +10 -5
- package/dist/collection/components/table-row/table-row.js +9 -4
- package/dist/collection/components/tabs/tabs.js +44 -9
- package/dist/collection/components/tag/tag.js +43 -5
- package/dist/collection/components/textarea/textarea.js +47 -11
- package/dist/collection/components/tooltip/tooltip.js +150 -21
- package/dist/custom-elements.json +710 -0
- package/dist/db-ux/db-ux.esm.js +1 -1
- package/dist/db-ux/p-0123ee1b.entry.js +1 -0
- package/dist/db-ux/p-090b1797.entry.js +1 -0
- package/dist/db-ux/p-0e17c5a0.entry.js +1 -0
- package/dist/db-ux/p-194e851c.entry.js +1 -0
- package/dist/db-ux/p-281f5e3e.entry.js +1 -0
- package/dist/db-ux/p-2ae377e6.entry.js +1 -0
- package/dist/db-ux/p-2cf4345f.entry.js +1 -0
- package/dist/db-ux/p-2e6c8304.entry.js +1 -0
- package/dist/db-ux/p-335391d4.entry.js +1 -0
- package/dist/db-ux/p-34235204.entry.js +1 -0
- package/dist/db-ux/p-3569bb3c.entry.js +1 -0
- package/dist/db-ux/p-398f9165.entry.js +1 -0
- package/dist/db-ux/p-5070470f.entry.js +1 -0
- package/dist/db-ux/p-5e08712d.entry.js +1 -0
- package/dist/db-ux/p-63d98f9d.entry.js +1 -0
- package/dist/db-ux/p-6aa92091.entry.js +1 -0
- package/dist/db-ux/p-78b7e6f6.entry.js +1 -0
- package/dist/db-ux/p-7ca4bc82.entry.js +1 -0
- package/dist/db-ux/p-8f989150.entry.js +1 -0
- package/dist/db-ux/p-8fa7a578.entry.js +1 -0
- package/dist/db-ux/p-91052c75.entry.js +1 -0
- package/dist/db-ux/p-9ccd42b1.entry.js +1 -0
- package/dist/db-ux/p-a4d9f6e2.entry.js +1 -0
- package/dist/db-ux/p-af248e57.entry.js +1 -0
- package/dist/db-ux/p-ba82a0b0.entry.js +1 -0
- package/dist/db-ux/p-c2ce6ecd.entry.js +1 -0
- package/dist/db-ux/p-d7b5748d.entry.js +1 -0
- package/dist/db-ux/p-dfbbe502.entry.js +1 -0
- package/dist/db-ux/p-e7a400a2.entry.js +1 -0
- package/dist/db-ux/p-ef1aa878.entry.js +1 -0
- package/dist/db-ux/p-f1daaefa.entry.js +1 -0
- package/dist/db-ux/p-f6312d2c.entry.js +1 -0
- package/dist/db-ux/p-fbf09569.entry.js +1 -0
- package/dist/db-ux/p-ff11c071.entry.js +1 -0
- package/dist/esm/db-accordion-item.entry.js +46 -9
- package/dist/esm/db-accordion.entry.js +43 -6
- package/dist/esm/db-badge.entry.js +43 -6
- package/dist/esm/db-brand.entry.js +36 -5
- package/dist/esm/db-button.entry.js +36 -5
- package/dist/esm/db-card.entry.js +36 -5
- package/dist/esm/db-checkbox.entry.js +45 -11
- package/dist/esm/db-custom-button.entry.js +36 -5
- package/dist/esm/db-custom-select-dropdown_5.entry.js +190 -31
- package/dist/esm/db-custom-select-form-field.entry.js +36 -5
- package/dist/esm/db-custom-select.entry.js +60 -26
- package/dist/esm/db-divider.entry.js +35 -4
- package/dist/esm/db-drawer.entry.js +45 -8
- package/dist/esm/db-header.entry.js +43 -6
- package/dist/esm/db-icon.entry.js +36 -5
- package/dist/esm/db-infotext.entry.js +36 -5
- package/dist/esm/db-link_4.entry.js +65 -19
- package/dist/esm/db-navigation-item.entry.js +47 -10
- package/dist/esm/db-navigation.entry.js +36 -5
- package/dist/esm/db-notification.entry.js +36 -5
- package/dist/esm/db-page.entry.js +48 -13
- package/dist/esm/db-popover.entry.js +43 -6
- package/dist/esm/db-radio.entry.js +42 -8
- package/dist/esm/db-section.entry.js +36 -5
- package/dist/esm/db-select.entry.js +45 -11
- package/dist/esm/db-stack.entry.js +36 -5
- package/dist/esm/db-switch.entry.js +45 -11
- package/dist/esm/db-tab-item_3.entry.js +118 -19
- package/dist/esm/db-table-body_3.entry.js +53 -12
- package/dist/esm/db-table-caption.entry.js +36 -5
- package/dist/esm/db-table.entry.js +35 -4
- package/dist/esm/db-tabs.entry.js +43 -9
- package/dist/esm/db-textarea.entry.js +45 -10
- package/dist/esm/db-tooltip.entry.js +144 -20
- package/dist/esm/db-ux.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/accordion/accordion.d.ts +3 -0
- package/dist/types/components/accordion-item/accordion-item.d.ts +3 -0
- package/dist/types/components/badge/badge.d.ts +3 -0
- package/dist/types/components/brand/brand.d.ts +3 -0
- package/dist/types/components/button/button.d.ts +3 -0
- package/dist/types/components/card/card.d.ts +3 -0
- package/dist/types/components/checkbox/checkbox.d.ts +2 -0
- package/dist/types/components/custom-button/custom-button.d.ts +3 -0
- package/dist/types/components/custom-select/custom-select.d.ts +2 -0
- package/dist/types/components/custom-select-dropdown/custom-select-dropdown.d.ts +3 -0
- package/dist/types/components/custom-select-form-field/custom-select-form-field.d.ts +3 -0
- package/dist/types/components/custom-select-list/custom-select-list.d.ts +3 -0
- package/dist/types/components/custom-select-list-item/custom-select-list-item.d.ts +3 -0
- package/dist/types/components/divider/divider.d.ts +3 -0
- package/dist/types/components/drawer/drawer.d.ts +3 -0
- package/dist/types/components/header/header.d.ts +3 -0
- package/dist/types/components/icon/icon.d.ts +3 -0
- package/dist/types/components/infotext/infotext.d.ts +3 -0
- package/dist/types/components/input/input.d.ts +2 -0
- package/dist/types/components/link/link.d.ts +3 -0
- package/dist/types/components/navigation/navigation.d.ts +3 -0
- package/dist/types/components/navigation-item/navigation-item.d.ts +3 -0
- package/dist/types/components/notification/notification.d.ts +3 -0
- package/dist/types/components/page/page.d.ts +2 -0
- package/dist/types/components/popover/popover.d.ts +3 -0
- package/dist/types/components/radio/radio.d.ts +2 -0
- package/dist/types/components/section/section.d.ts +3 -0
- package/dist/types/components/select/select.d.ts +2 -0
- package/dist/types/components/stack/stack.d.ts +3 -0
- package/dist/types/components/switch/switch.d.ts +2 -0
- package/dist/types/components/tab-item/tab-item.d.ts +2 -0
- package/dist/types/components/tab-list/tab-list.d.ts +3 -0
- package/dist/types/components/tab-panel/tab-panel.d.ts +3 -0
- package/dist/types/components/table/table.d.ts +3 -0
- package/dist/types/components/table-caption/table-caption.d.ts +3 -0
- package/dist/types/components/table-head/table-head.d.ts +3 -0
- package/dist/types/components/tabs/tabs.d.ts +2 -0
- package/dist/types/components/tag/tag.d.ts +3 -0
- package/dist/types/components/textarea/textarea.d.ts +2 -0
- package/dist/types/components/tooltip/model.d.ts +9 -0
- package/dist/types/components/tooltip/tooltip.d.ts +8 -0
- package/dist/web-types.json +84 -40
- package/package.json +6 -6
- package/bundle/p-B5ANMEnQ.js +0 -1
- package/bundle/p-BJwvv-yT.js +0 -1
- package/bundle/p-BNiKxu3y.js +0 -1
- package/bundle/p-B_bPnncM.js +0 -1
- package/bundle/p-BnLhi6Lz.js +0 -1
- package/bundle/p-BrBlnLrn.js +0 -1
- package/bundle/p-CByFfoSH.js +0 -1
- package/bundle/p-CQo0C7QE.js +0 -1
- package/bundle/p-CR2ZbfYe.js +0 -1
- package/bundle/p-CeDu282h.js +0 -1
- package/bundle/p-CfLPOLHz.js +0 -1
- package/bundle/p-CoOxyQb2.js +0 -1
- package/bundle/p-CqED0CfD.js +0 -1
- package/bundle/p-Cr_z1Jfi.js +0 -1
- package/bundle/p-D-XzX0R7.js +0 -1
- package/bundle/p-DMSIvqcA.js +0 -1
- package/bundle/p-DUiroUyR.js +0 -1
- package/bundle/p-DdyMClpj.js +0 -1
- package/bundle/p-DjVjS2Tb.js +0 -1
- package/bundle/p-in4Kv88F.js +0 -1
- package/dist/db-ux/p-08271c80.entry.js +0 -1
- package/dist/db-ux/p-105ffa74.entry.js +0 -1
- package/dist/db-ux/p-15adca91.entry.js +0 -1
- package/dist/db-ux/p-1a322a0c.entry.js +0 -1
- package/dist/db-ux/p-1f7232c0.entry.js +0 -1
- package/dist/db-ux/p-27e2f6f2.entry.js +0 -1
- package/dist/db-ux/p-2907f214.entry.js +0 -1
- package/dist/db-ux/p-2ff958e4.entry.js +0 -1
- package/dist/db-ux/p-3423b7af.entry.js +0 -1
- package/dist/db-ux/p-365e6edf.entry.js +0 -1
- package/dist/db-ux/p-42516007.entry.js +0 -1
- package/dist/db-ux/p-5045182c.entry.js +0 -1
- package/dist/db-ux/p-5e1d42e5.entry.js +0 -1
- package/dist/db-ux/p-61b28212.entry.js +0 -1
- package/dist/db-ux/p-6850a53c.entry.js +0 -1
- package/dist/db-ux/p-6bff55b4.entry.js +0 -1
- package/dist/db-ux/p-6e7c5e42.entry.js +0 -1
- package/dist/db-ux/p-76adf385.entry.js +0 -1
- package/dist/db-ux/p-78f7b353.entry.js +0 -1
- package/dist/db-ux/p-7fa5d304.entry.js +0 -1
- package/dist/db-ux/p-95b69e71.entry.js +0 -1
- package/dist/db-ux/p-99ebe6ec.entry.js +0 -1
- package/dist/db-ux/p-a5dc355d.entry.js +0 -1
- package/dist/db-ux/p-a6113789.entry.js +0 -1
- package/dist/db-ux/p-b9c0feaf.entry.js +0 -1
- package/dist/db-ux/p-c14fa91a.entry.js +0 -1
- package/dist/db-ux/p-c65b807e.entry.js +0 -1
- package/dist/db-ux/p-dd9cedbe.entry.js +0 -1
- package/dist/db-ux/p-e3f705fd.entry.js +0 -1
- package/dist/db-ux/p-e4cddc9f.entry.js +0 -1
- package/dist/db-ux/p-e7a8612c.entry.js +0 -1
- package/dist/db-ux/p-ee8c3243.entry.js +0 -1
- package/dist/db-ux/p-f0d0acfc.entry.js +0 -1
- package/dist/db-ux/p-f15748ea.entry.js +0 -1
|
@@ -10,6 +10,7 @@ const DBPopover = class {
|
|
|
10
10
|
this.isExpanded = false;
|
|
11
11
|
this._documentScrollListenerCallbackId = undefined;
|
|
12
12
|
this._observer = undefined;
|
|
13
|
+
this.observer = undefined;
|
|
13
14
|
}
|
|
14
15
|
handleEscape(event) {
|
|
15
16
|
if (!event || event.key === "Escape") {
|
|
@@ -85,6 +86,26 @@ const DBPopover = class {
|
|
|
85
86
|
}
|
|
86
87
|
return null;
|
|
87
88
|
}
|
|
89
|
+
setupObserver(element) {
|
|
90
|
+
if (!element)
|
|
91
|
+
return;
|
|
92
|
+
const parent = element.closest("db-popover");
|
|
93
|
+
if (!parent || this.observer)
|
|
94
|
+
return;
|
|
95
|
+
this.observer = new MutationObserver((mutations) => {
|
|
96
|
+
if (mutations.some((mutation) => {
|
|
97
|
+
var _a;
|
|
98
|
+
const attr = mutation.target.attributes.getNamedItem((_a = mutation.attributeName) !== null && _a !== void 0 ? _a : "");
|
|
99
|
+
return (attr === null || attr === void 0 ? void 0 : attr.value) !== mutation.oldValue;
|
|
100
|
+
})) {
|
|
101
|
+
this.enableAttributePassing(element, "db-popover");
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
this.observer.observe(parent, {
|
|
105
|
+
attributes: true,
|
|
106
|
+
attributeOldValue: true,
|
|
107
|
+
});
|
|
108
|
+
}
|
|
88
109
|
/**
|
|
89
110
|
* Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.
|
|
90
111
|
* @param element the ref for the component
|
|
@@ -98,10 +119,15 @@ const DBPopover = class {
|
|
|
98
119
|
const attr = attributes.item(i);
|
|
99
120
|
if (attr && attr.name !== 'data-density' &&
|
|
100
121
|
(attr.name.startsWith("data-") || attr.name.startsWith("aria-"))) {
|
|
101
|
-
|
|
122
|
+
if (attr.value) {
|
|
123
|
+
element.setAttribute(attr.name, attr.value);
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
element.removeAttribute(attr.name);
|
|
127
|
+
}
|
|
102
128
|
parent.removeAttribute(attr.name);
|
|
103
129
|
}
|
|
104
|
-
else if (attr &&
|
|
130
|
+
else if (attr && ["style"].includes(attr.name)) {
|
|
105
131
|
element.setAttribute(attr.name, attr.value);
|
|
106
132
|
parent.removeAttribute(attr.name);
|
|
107
133
|
}
|
|
@@ -109,7 +135,7 @@ const DBPopover = class {
|
|
|
109
135
|
const isWebComponent = attr.value.includes("hydrated");
|
|
110
136
|
const value = attr.value.replace("hydrated", "").trim();
|
|
111
137
|
const currentClass = element.getAttribute("class");
|
|
112
|
-
element.setAttribute(attr.name, `${currentClass ?
|
|
138
|
+
element.setAttribute(attr.name, `${currentClass ? currentClass : ""}${value ? ` ${value}` : ""}`);
|
|
113
139
|
if (isWebComponent) {
|
|
114
140
|
// Stencil is using this class for lazy loading component
|
|
115
141
|
parent.setAttribute("class", "hydrated");
|
|
@@ -168,15 +194,26 @@ const DBPopover = class {
|
|
|
168
194
|
}
|
|
169
195
|
}
|
|
170
196
|
this.enableAttributePassing(this._ref, "db-popover");
|
|
171
|
-
|
|
197
|
+
const onMountHook_0 = () => {
|
|
198
|
+
this.initialized = true;
|
|
199
|
+
};
|
|
200
|
+
onMountHook_0();
|
|
201
|
+
const onMountHook_1 = () => {
|
|
202
|
+
this.setupObserver(this._ref);
|
|
203
|
+
};
|
|
204
|
+
onMountHook_1();
|
|
172
205
|
this.watch0Fn();
|
|
173
206
|
this.watch1Fn();
|
|
174
207
|
}
|
|
208
|
+
disconnectedCallback() {
|
|
209
|
+
var _a;
|
|
210
|
+
(_a = this.observer) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
211
|
+
}
|
|
175
212
|
render() {
|
|
176
213
|
var _a, _b, _c;
|
|
177
|
-
return (h("div", { key: '
|
|
214
|
+
return (h("div", { key: '09a8f5d4aedc314e07a184c3e41d232073b4ffc9', class: cls("db-popover", this.className), ref: (el) => {
|
|
178
215
|
this._ref = el;
|
|
179
|
-
}, id: (_a = this.id) !== null && _a !== void 0 ? _a : (_b = this.propOverrides) === null || _b === void 0 ? void 0 : _b.id }, h("slot", { key: '
|
|
216
|
+
}, id: (_a = this.id) !== null && _a !== void 0 ? _a : (_b = this.propOverrides) === null || _b === void 0 ? void 0 : _b.id }, h("slot", { key: 'eeee6e2e8d94272e91d275fb6799c7f781f8210a', name: "trigger" }), h("article", { key: 'cbbdd13d730291ec06059334c47be4c4bb8ffa71', class: "db-popover-content", "data-spacing": this.spacing, "data-gap": getBooleanAsString(this.gap, "gap"), "data-animation": getBooleanAsString((_c = this.animation) !== null && _c !== void 0 ? _c : true, "animation"), "data-open": getBooleanAsString(this.open, "open"), "data-delay": this.delay, "data-width": this.width, "data-placement": this.placement }, h("slot", { key: '7ae19bc9f8ba3130c107fcf826a8ca9bcf8d9f88' }))));
|
|
180
217
|
}
|
|
181
218
|
get rootElement() { return getElement(this); }
|
|
182
219
|
static get watchers() { return {
|
|
@@ -12,6 +12,7 @@ const DBRadio = class {
|
|
|
12
12
|
this.initialized = false;
|
|
13
13
|
this._id = undefined;
|
|
14
14
|
this.abortController = undefined;
|
|
15
|
+
this.observer = undefined;
|
|
15
16
|
}
|
|
16
17
|
handleInput(event, reset) {
|
|
17
18
|
if (this.input) {
|
|
@@ -37,6 +38,26 @@ const DBRadio = class {
|
|
|
37
38
|
var _a, _b, _c;
|
|
38
39
|
this._id = (_c = (_a = this.id) !== null && _a !== void 0 ? _a : (_b = this.propOverrides) === null || _b === void 0 ? void 0 : _b.id) !== null && _c !== void 0 ? _c : `radio-${uuid()}`;
|
|
39
40
|
}
|
|
41
|
+
setupObserver(element) {
|
|
42
|
+
if (!element)
|
|
43
|
+
return;
|
|
44
|
+
const parent = element.closest("db-radio");
|
|
45
|
+
if (!parent || this.observer)
|
|
46
|
+
return;
|
|
47
|
+
this.observer = new MutationObserver((mutations) => {
|
|
48
|
+
if (mutations.some((mutation) => {
|
|
49
|
+
var _a;
|
|
50
|
+
const attr = mutation.target.attributes.getNamedItem((_a = mutation.attributeName) !== null && _a !== void 0 ? _a : "");
|
|
51
|
+
return (attr === null || attr === void 0 ? void 0 : attr.value) !== mutation.oldValue;
|
|
52
|
+
})) {
|
|
53
|
+
this.enableAttributePassing(element, "db-radio");
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
this.observer.observe(parent, {
|
|
57
|
+
attributes: true,
|
|
58
|
+
attributeOldValue: true,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
40
61
|
/**
|
|
41
62
|
* Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.
|
|
42
63
|
* @param element the ref for the component
|
|
@@ -50,10 +71,15 @@ const DBRadio = class {
|
|
|
50
71
|
const attr = attributes.item(i);
|
|
51
72
|
if (attr && attr.name !== 'data-density' &&
|
|
52
73
|
(attr.name.startsWith("data-") || attr.name.startsWith("aria-"))) {
|
|
53
|
-
|
|
74
|
+
if (attr.value) {
|
|
75
|
+
element.setAttribute(attr.name, attr.value);
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
element.removeAttribute(attr.name);
|
|
79
|
+
}
|
|
54
80
|
parent.removeAttribute(attr.name);
|
|
55
81
|
}
|
|
56
|
-
else if (attr &&
|
|
82
|
+
else if (attr && ["style"].includes(attr.name)) {
|
|
57
83
|
element.setAttribute(attr.name, attr.value);
|
|
58
84
|
parent.removeAttribute(attr.name);
|
|
59
85
|
}
|
|
@@ -61,7 +87,7 @@ const DBRadio = class {
|
|
|
61
87
|
const isWebComponent = attr.value.includes("hydrated");
|
|
62
88
|
const value = attr.value.replace("hydrated", "").trim();
|
|
63
89
|
const currentClass = element.getAttribute("class");
|
|
64
|
-
element.setAttribute(attr.name, `${currentClass ?
|
|
90
|
+
element.setAttribute(attr.name, `${currentClass ? currentClass : ""}${value ? ` ${value}` : ""}`);
|
|
65
91
|
if (isWebComponent) {
|
|
66
92
|
// Stencil is using this class for lazy loading component
|
|
67
93
|
parent.setAttribute("class", "hydrated");
|
|
@@ -120,20 +146,28 @@ const DBRadio = class {
|
|
|
120
146
|
}
|
|
121
147
|
}
|
|
122
148
|
this.enableAttributePassing(this._ref, "db-radio");
|
|
123
|
-
|
|
124
|
-
|
|
149
|
+
const onMountHook_0 = () => {
|
|
150
|
+
this.initialized = true;
|
|
151
|
+
this.resetIds();
|
|
152
|
+
};
|
|
153
|
+
onMountHook_0();
|
|
154
|
+
const onMountHook_1 = () => {
|
|
155
|
+
this.setupObserver(this._ref);
|
|
156
|
+
};
|
|
157
|
+
onMountHook_1();
|
|
125
158
|
this.watch0Fn();
|
|
126
159
|
this.watch1Fn();
|
|
127
160
|
this.watch2Fn();
|
|
128
161
|
}
|
|
129
162
|
disconnectedCallback() {
|
|
130
|
-
var _a;
|
|
163
|
+
var _a, _b;
|
|
131
164
|
(_a = this.abortController) === null || _a === void 0 ? void 0 : _a.abort();
|
|
165
|
+
(_b = this.observer) === null || _b === void 0 ? void 0 : _b.disconnect();
|
|
132
166
|
}
|
|
133
167
|
render() {
|
|
134
|
-
return (h("label", { key: '
|
|
168
|
+
return (h("label", { key: '85734ed463718801789a9dea9c0febcc4c2e8266', class: cls("db-radio", this.className), "data-size": this.size, "data-hide-label": getHideProp(this.showLabel), "data-hide-asterisk": getHideProp(this.showRequiredAsterisk), htmlFor: this._id }, h("input", { key: '7906add8b0074893bbffaaa0963284de1f89836c', type: "radio", "aria-invalid": this.validation === "invalid", "data-custom-validity": this.validation, ref: (el) => {
|
|
135
169
|
this._ref = el;
|
|
136
|
-
}, id: this._id, name: this.name, checked: getBoolean(this.checked, "checked"), disabled: getBoolean(this.disabled, "disabled"), value: this.value, required: getBoolean(this.required, "required"), onInput: (event) => this.handleInput(event), onChange: (event) => this.handleChange(event), onBlur: (event) => this.handleBlur(event), onFocus: (event) => this.handleFocus(event) }), this.label ? this.label : null, h("slot", { key: '
|
|
170
|
+
}, id: this._id, name: this.name, checked: getBoolean(this.checked, "checked"), disabled: getBoolean(this.disabled, "disabled"), value: this.value, required: getBoolean(this.required, "required"), onInput: (event) => this.handleInput(event), onChange: (event) => this.handleChange(event), onBlur: (event) => this.handleBlur(event), onFocus: (event) => this.handleFocus(event) }), this.label ? this.label : null, h("slot", { key: '7c35400883fd27d67bb2932cd646492fe137ccd9' })));
|
|
137
171
|
}
|
|
138
172
|
get rootElement() { return getElement(this); }
|
|
139
173
|
static get watchers() { return {
|
|
@@ -4,6 +4,27 @@ import { c as cls } from './index-fumiz06Y.js';
|
|
|
4
4
|
const DBSection = class {
|
|
5
5
|
constructor(hostRef) {
|
|
6
6
|
registerInstance(this, hostRef);
|
|
7
|
+
this.observer = undefined;
|
|
8
|
+
}
|
|
9
|
+
setupObserver(element) {
|
|
10
|
+
if (!element)
|
|
11
|
+
return;
|
|
12
|
+
const parent = element.closest("db-section");
|
|
13
|
+
if (!parent || this.observer)
|
|
14
|
+
return;
|
|
15
|
+
this.observer = new MutationObserver((mutations) => {
|
|
16
|
+
if (mutations.some((mutation) => {
|
|
17
|
+
var _a;
|
|
18
|
+
const attr = mutation.target.attributes.getNamedItem((_a = mutation.attributeName) !== null && _a !== void 0 ? _a : "");
|
|
19
|
+
return (attr === null || attr === void 0 ? void 0 : attr.value) !== mutation.oldValue;
|
|
20
|
+
})) {
|
|
21
|
+
this.enableAttributePassing(element, "db-section");
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
this.observer.observe(parent, {
|
|
25
|
+
attributes: true,
|
|
26
|
+
attributeOldValue: true,
|
|
27
|
+
});
|
|
7
28
|
}
|
|
8
29
|
/**
|
|
9
30
|
* Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.
|
|
@@ -18,10 +39,15 @@ const DBSection = class {
|
|
|
18
39
|
const attr = attributes.item(i);
|
|
19
40
|
if (attr && attr.name !== 'data-density' &&
|
|
20
41
|
(attr.name.startsWith("data-") || attr.name.startsWith("aria-"))) {
|
|
21
|
-
|
|
42
|
+
if (attr.value) {
|
|
43
|
+
element.setAttribute(attr.name, attr.value);
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
element.removeAttribute(attr.name);
|
|
47
|
+
}
|
|
22
48
|
parent.removeAttribute(attr.name);
|
|
23
49
|
}
|
|
24
|
-
else if (attr &&
|
|
50
|
+
else if (attr && ["style"].includes(attr.name)) {
|
|
25
51
|
element.setAttribute(attr.name, attr.value);
|
|
26
52
|
parent.removeAttribute(attr.name);
|
|
27
53
|
}
|
|
@@ -29,7 +55,7 @@ const DBSection = class {
|
|
|
29
55
|
const isWebComponent = attr.value.includes("hydrated");
|
|
30
56
|
const value = attr.value.replace("hydrated", "").trim();
|
|
31
57
|
const currentClass = element.getAttribute("class");
|
|
32
|
-
element.setAttribute(attr.name, `${currentClass ?
|
|
58
|
+
element.setAttribute(attr.name, `${currentClass ? currentClass : ""}${value ? ` ${value}` : ""}`);
|
|
33
59
|
if (isWebComponent) {
|
|
34
60
|
// Stencil is using this class for lazy loading component
|
|
35
61
|
parent.setAttribute("class", "hydrated");
|
|
@@ -49,12 +75,17 @@ const DBSection = class {
|
|
|
49
75
|
}
|
|
50
76
|
}
|
|
51
77
|
this.enableAttributePassing(this._ref, "db-section");
|
|
78
|
+
this.setupObserver(this._ref);
|
|
79
|
+
}
|
|
80
|
+
disconnectedCallback() {
|
|
81
|
+
var _a;
|
|
82
|
+
(_a = this.observer) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
52
83
|
}
|
|
53
84
|
render() {
|
|
54
85
|
var _a, _b;
|
|
55
|
-
return (h("section", { key: '
|
|
86
|
+
return (h("section", { key: 'e33119ea38ff1f66b56792cb1a5a57e47d87d370', class: cls("db-section", this.className), ref: (el) => {
|
|
56
87
|
this._ref = el;
|
|
57
|
-
}, id: (_a = this.id) !== null && _a !== void 0 ? _a : (_b = this.propOverrides) === null || _b === void 0 ? void 0 : _b.id, "data-spacing": this.spacing || "medium", "data-width": this.width }, h("slot", { key: '
|
|
88
|
+
}, id: (_a = this.id) !== null && _a !== void 0 ? _a : (_b = this.propOverrides) === null || _b === void 0 ? void 0 : _b.id, "data-spacing": this.spacing || "medium", "data-width": this.width }, h("slot", { key: '0ac9622c130f2a896b334e65025f16365fe50ea5' })));
|
|
58
89
|
}
|
|
59
90
|
get rootElement() { return getElement(this); }
|
|
60
91
|
};
|
|
@@ -22,6 +22,7 @@ const DBSelect = class {
|
|
|
22
22
|
this.initialized = false;
|
|
23
23
|
this._voiceOverFallback = "";
|
|
24
24
|
this.abortController = undefined;
|
|
25
|
+
this.observer = undefined;
|
|
25
26
|
}
|
|
26
27
|
hasValidState() {
|
|
27
28
|
var _a;
|
|
@@ -38,7 +39,7 @@ const DBSelect = class {
|
|
|
38
39
|
DEFAULT_INVALID_MESSAGE;
|
|
39
40
|
if (hasVoiceOver()) {
|
|
40
41
|
this._voiceOverFallback = this._invalidMessage;
|
|
41
|
-
delay(() => (this._voiceOverFallback = ""), 1000);
|
|
42
|
+
void delay(() => (this._voiceOverFallback = ""), 1000);
|
|
42
43
|
}
|
|
43
44
|
}
|
|
44
45
|
else if (this.hasValidState() &&
|
|
@@ -47,7 +48,7 @@ const DBSelect = class {
|
|
|
47
48
|
this._descByIds = this._validMessageId;
|
|
48
49
|
if (hasVoiceOver()) {
|
|
49
50
|
this._voiceOverFallback = (_d = this.validMessage) !== null && _d !== void 0 ? _d : DEFAULT_VALID_MESSAGE;
|
|
50
|
-
delay(() => (this._voiceOverFallback = ""), 1000);
|
|
51
|
+
void delay(() => (this._voiceOverFallback = ""), 1000);
|
|
51
52
|
}
|
|
52
53
|
}
|
|
53
54
|
else if (stringPropVisible(this.message, this.showMessage)) {
|
|
@@ -111,6 +112,26 @@ const DBSelect = class {
|
|
|
111
112
|
this._invalidMessageId = mId + DEFAULT_INVALID_MESSAGE_ID_SUFFIX;
|
|
112
113
|
this._placeholderId = mId + DEFAULT_PLACEHOLDER_ID_SUFFIX;
|
|
113
114
|
}
|
|
115
|
+
setupObserver(element) {
|
|
116
|
+
if (!element)
|
|
117
|
+
return;
|
|
118
|
+
const parent = element.closest("db-select");
|
|
119
|
+
if (!parent || this.observer)
|
|
120
|
+
return;
|
|
121
|
+
this.observer = new MutationObserver((mutations) => {
|
|
122
|
+
if (mutations.some((mutation) => {
|
|
123
|
+
var _a;
|
|
124
|
+
const attr = mutation.target.attributes.getNamedItem((_a = mutation.attributeName) !== null && _a !== void 0 ? _a : "");
|
|
125
|
+
return (attr === null || attr === void 0 ? void 0 : attr.value) !== mutation.oldValue;
|
|
126
|
+
})) {
|
|
127
|
+
this.enableAttributePassing(element, "db-select");
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
this.observer.observe(parent, {
|
|
131
|
+
attributes: true,
|
|
132
|
+
attributeOldValue: true,
|
|
133
|
+
});
|
|
134
|
+
}
|
|
114
135
|
/**
|
|
115
136
|
* Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.
|
|
116
137
|
* @param element the ref for the component
|
|
@@ -124,10 +145,15 @@ const DBSelect = class {
|
|
|
124
145
|
const attr = attributes.item(i);
|
|
125
146
|
if (attr && attr.name !== 'data-density' &&
|
|
126
147
|
(attr.name.startsWith("data-") || attr.name.startsWith("aria-"))) {
|
|
127
|
-
|
|
148
|
+
if (attr.value) {
|
|
149
|
+
element.setAttribute(attr.name, attr.value);
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
element.removeAttribute(attr.name);
|
|
153
|
+
}
|
|
128
154
|
parent.removeAttribute(attr.name);
|
|
129
155
|
}
|
|
130
|
-
else if (attr &&
|
|
156
|
+
else if (attr && ["style"].includes(attr.name)) {
|
|
131
157
|
element.setAttribute(attr.name, attr.value);
|
|
132
158
|
parent.removeAttribute(attr.name);
|
|
133
159
|
}
|
|
@@ -135,7 +161,7 @@ const DBSelect = class {
|
|
|
135
161
|
const isWebComponent = attr.value.includes("hydrated");
|
|
136
162
|
const value = attr.value.replace("hydrated", "").trim();
|
|
137
163
|
const currentClass = element.getAttribute("class");
|
|
138
|
-
element.setAttribute(attr.name, `${currentClass ?
|
|
164
|
+
element.setAttribute(attr.name, `${currentClass ? currentClass : ""}${value ? ` ${value}` : ""}`);
|
|
139
165
|
if (isWebComponent) {
|
|
140
166
|
// Stencil is using this class for lazy loading component
|
|
141
167
|
parent.setAttribute("class", "hydrated");
|
|
@@ -227,9 +253,16 @@ const DBSelect = class {
|
|
|
227
253
|
}
|
|
228
254
|
}
|
|
229
255
|
this.enableAttributePassing(this._ref, "db-select");
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
256
|
+
const onMountHook_0 = () => {
|
|
257
|
+
this.initialized = true;
|
|
258
|
+
this.resetIds();
|
|
259
|
+
this._invalidMessage = this.invalidMessage || DEFAULT_INVALID_MESSAGE;
|
|
260
|
+
};
|
|
261
|
+
onMountHook_0();
|
|
262
|
+
const onMountHook_1 = () => {
|
|
263
|
+
this.setupObserver(this._ref);
|
|
264
|
+
};
|
|
265
|
+
onMountHook_1();
|
|
233
266
|
this.watch0Fn();
|
|
234
267
|
this.watch1Fn();
|
|
235
268
|
this.watch2Fn();
|
|
@@ -237,19 +270,20 @@ const DBSelect = class {
|
|
|
237
270
|
this.watch4Fn();
|
|
238
271
|
}
|
|
239
272
|
disconnectedCallback() {
|
|
240
|
-
var _a;
|
|
273
|
+
var _a, _b;
|
|
241
274
|
(_a = this.abortController) === null || _a === void 0 ? void 0 : _a.abort();
|
|
275
|
+
(_b = this.observer) === null || _b === void 0 ? void 0 : _b.disconnect();
|
|
242
276
|
}
|
|
243
277
|
render() {
|
|
244
278
|
var _a, _b, _c, _d, _e, _f;
|
|
245
|
-
return (h("div", { key: '
|
|
279
|
+
return (h("div", { key: '71200b34c84ae3c90e4990b11e55e8dea4c16e55', 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, "showIcon") }, h("label", { key: '3633f34f827d53ee4b4d15e5b230307984fcbd09', htmlFor: this._id }, (_a = this.label) !== null && _a !== void 0 ? _a : DEFAULT_LABEL), h("select", { key: 'ff177d80acfa3519df6467892fb5f97f4ad6872b', "aria-invalid": this.validation === "invalid", "data-custom-validity": this.validation, ref: (el) => {
|
|
246
280
|
this._ref = el;
|
|
247
281
|
}, required: getBoolean(this.required, "required"), disabled: getBoolean(this.disabled, "disabled"), id: this._id, name: this.name, size: this.size,
|
|
248
282
|
/* @ts-ignore */
|
|
249
283
|
value: (_c = (_b = this.value) !== null && _b !== void 0 ? _b : this._value) !== null && _c !== void 0 ? _c : undefined, 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": (_d = this.ariaDescribedBy) !== null && _d !== void 0 ? _d : this._descByIds }, this.variant === "floating" || !!this.placeholder ? (h("option", { class: "placeholder", value: "", "data-show-empty-option": getBooleanAsString(this.shouldShowEmptyOption(), "showEmptyOption") })) : null, ((_e = this.options) === null || _e === void 0 ? void 0 : _e.length) ? ((_f = this.options) === null || _f === void 0 ? void 0 : _f.map((option) => {
|
|
250
284
|
var _a;
|
|
251
285
|
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)))));
|
|
252
|
-
})) : (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: '
|
|
286
|
+
})) : (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: '5baf4a0984f8d71776cda0d0d9c12e62f08f434b', size: "small", semantic: "critical", id: this._invalidMessageId }, this._invalidMessage), h("span", { key: '2b7c6895a1de8e77daba33de6923a33b7c43bee1', "data-visually-hidden": "true", role: "status" }, this._voiceOverFallback)));
|
|
253
287
|
}
|
|
254
288
|
get rootElement() { return getElement(this); }
|
|
255
289
|
static get watchers() { return {
|
|
@@ -4,6 +4,27 @@ import { g as getBooleanAsString, c as cls } from './index-fumiz06Y.js';
|
|
|
4
4
|
const DBStack = class {
|
|
5
5
|
constructor(hostRef) {
|
|
6
6
|
registerInstance(this, hostRef);
|
|
7
|
+
this.observer = undefined;
|
|
8
|
+
}
|
|
9
|
+
setupObserver(element) {
|
|
10
|
+
if (!element)
|
|
11
|
+
return;
|
|
12
|
+
const parent = element.closest("db-stack");
|
|
13
|
+
if (!parent || this.observer)
|
|
14
|
+
return;
|
|
15
|
+
this.observer = new MutationObserver((mutations) => {
|
|
16
|
+
if (mutations.some((mutation) => {
|
|
17
|
+
var _a;
|
|
18
|
+
const attr = mutation.target.attributes.getNamedItem((_a = mutation.attributeName) !== null && _a !== void 0 ? _a : "");
|
|
19
|
+
return (attr === null || attr === void 0 ? void 0 : attr.value) !== mutation.oldValue;
|
|
20
|
+
})) {
|
|
21
|
+
this.enableAttributePassing(element, "db-stack");
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
this.observer.observe(parent, {
|
|
25
|
+
attributes: true,
|
|
26
|
+
attributeOldValue: true,
|
|
27
|
+
});
|
|
7
28
|
}
|
|
8
29
|
/**
|
|
9
30
|
* Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.
|
|
@@ -18,10 +39,15 @@ const DBStack = class {
|
|
|
18
39
|
const attr = attributes.item(i);
|
|
19
40
|
if (attr && attr.name !== 'data-density' &&
|
|
20
41
|
(attr.name.startsWith("data-") || attr.name.startsWith("aria-"))) {
|
|
21
|
-
|
|
42
|
+
if (attr.value) {
|
|
43
|
+
element.setAttribute(attr.name, attr.value);
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
element.removeAttribute(attr.name);
|
|
47
|
+
}
|
|
22
48
|
parent.removeAttribute(attr.name);
|
|
23
49
|
}
|
|
24
|
-
else if (attr &&
|
|
50
|
+
else if (attr && ["style"].includes(attr.name)) {
|
|
25
51
|
element.setAttribute(attr.name, attr.value);
|
|
26
52
|
parent.removeAttribute(attr.name);
|
|
27
53
|
}
|
|
@@ -29,7 +55,7 @@ const DBStack = class {
|
|
|
29
55
|
const isWebComponent = attr.value.includes("hydrated");
|
|
30
56
|
const value = attr.value.replace("hydrated", "").trim();
|
|
31
57
|
const currentClass = element.getAttribute("class");
|
|
32
|
-
element.setAttribute(attr.name, `${currentClass ?
|
|
58
|
+
element.setAttribute(attr.name, `${currentClass ? currentClass : ""}${value ? ` ${value}` : ""}`);
|
|
33
59
|
if (isWebComponent) {
|
|
34
60
|
// Stencil is using this class for lazy loading component
|
|
35
61
|
parent.setAttribute("class", "hydrated");
|
|
@@ -49,12 +75,17 @@ const DBStack = class {
|
|
|
49
75
|
}
|
|
50
76
|
}
|
|
51
77
|
this.enableAttributePassing(this._ref, "db-stack");
|
|
78
|
+
this.setupObserver(this._ref);
|
|
79
|
+
}
|
|
80
|
+
disconnectedCallback() {
|
|
81
|
+
var _a;
|
|
82
|
+
(_a = this.observer) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
52
83
|
}
|
|
53
84
|
render() {
|
|
54
85
|
var _a, _b;
|
|
55
|
-
return (h("div", { key: '
|
|
86
|
+
return (h("div", { key: '02389c1bd26917e0176c95ce3e38e7ef664813e7', class: cls("db-stack", this.className), ref: (el) => {
|
|
56
87
|
this._ref = el;
|
|
57
|
-
}, 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": getBooleanAsString(this.wrap, "wrap") }, h("slot", { key: '
|
|
88
|
+
}, 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": getBooleanAsString(this.wrap, "wrap") }, h("slot", { key: '70b94e0558c79bc76096be335af95029ad2cbe5c' })));
|
|
58
89
|
}
|
|
59
90
|
get rootElement() { return getElement(this); }
|
|
60
91
|
};
|
|
@@ -17,6 +17,7 @@ const DBSwitch = class {
|
|
|
17
17
|
this._descByIds = undefined;
|
|
18
18
|
this._voiceOverFallback = "";
|
|
19
19
|
this.abortController = undefined;
|
|
20
|
+
this.observer = undefined;
|
|
20
21
|
}
|
|
21
22
|
hasValidState() {
|
|
22
23
|
var _a;
|
|
@@ -33,7 +34,7 @@ const DBSwitch = class {
|
|
|
33
34
|
if (hasVoiceOver()) {
|
|
34
35
|
this._voiceOverFallback =
|
|
35
36
|
this._invalidMessage || DEFAULT_INVALID_MESSAGE;
|
|
36
|
-
delay(() => {
|
|
37
|
+
void delay(() => {
|
|
37
38
|
this._voiceOverFallback = "";
|
|
38
39
|
}, 1000);
|
|
39
40
|
}
|
|
@@ -43,7 +44,7 @@ const DBSwitch = class {
|
|
|
43
44
|
this._descByIds = this._validMessageId;
|
|
44
45
|
if (hasVoiceOver()) {
|
|
45
46
|
this._voiceOverFallback = (_f = this.validMessage) !== null && _f !== void 0 ? _f : DEFAULT_VALID_MESSAGE;
|
|
46
|
-
delay(() => {
|
|
47
|
+
void delay(() => {
|
|
47
48
|
this._voiceOverFallback = "";
|
|
48
49
|
}, 1000);
|
|
49
50
|
}
|
|
@@ -90,6 +91,26 @@ const DBSwitch = class {
|
|
|
90
91
|
this._validMessageId = `${mId}${DEFAULT_VALID_MESSAGE_ID_SUFFIX}`;
|
|
91
92
|
this._invalidMessageId = `${mId}${DEFAULT_INVALID_MESSAGE_ID_SUFFIX}`;
|
|
92
93
|
}
|
|
94
|
+
setupObserver(element) {
|
|
95
|
+
if (!element)
|
|
96
|
+
return;
|
|
97
|
+
const parent = element.closest("db-switch");
|
|
98
|
+
if (!parent || this.observer)
|
|
99
|
+
return;
|
|
100
|
+
this.observer = new MutationObserver((mutations) => {
|
|
101
|
+
if (mutations.some((mutation) => {
|
|
102
|
+
var _a;
|
|
103
|
+
const attr = mutation.target.attributes.getNamedItem((_a = mutation.attributeName) !== null && _a !== void 0 ? _a : "");
|
|
104
|
+
return (attr === null || attr === void 0 ? void 0 : attr.value) !== mutation.oldValue;
|
|
105
|
+
})) {
|
|
106
|
+
this.enableAttributePassing(element, "db-switch");
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
this.observer.observe(parent, {
|
|
110
|
+
attributes: true,
|
|
111
|
+
attributeOldValue: true,
|
|
112
|
+
});
|
|
113
|
+
}
|
|
93
114
|
/**
|
|
94
115
|
* Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.
|
|
95
116
|
* @param element the ref for the component
|
|
@@ -103,10 +124,15 @@ const DBSwitch = class {
|
|
|
103
124
|
const attr = attributes.item(i);
|
|
104
125
|
if (attr && attr.name !== 'data-density' &&
|
|
105
126
|
(attr.name.startsWith("data-") || attr.name.startsWith("aria-"))) {
|
|
106
|
-
|
|
127
|
+
if (attr.value) {
|
|
128
|
+
element.setAttribute(attr.name, attr.value);
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
element.removeAttribute(attr.name);
|
|
132
|
+
}
|
|
107
133
|
parent.removeAttribute(attr.name);
|
|
108
134
|
}
|
|
109
|
-
else if (attr &&
|
|
135
|
+
else if (attr && ["style"].includes(attr.name)) {
|
|
110
136
|
element.setAttribute(attr.name, attr.value);
|
|
111
137
|
parent.removeAttribute(attr.name);
|
|
112
138
|
}
|
|
@@ -114,7 +140,7 @@ const DBSwitch = class {
|
|
|
114
140
|
const isWebComponent = attr.value.includes("hydrated");
|
|
115
141
|
const value = attr.value.replace("hydrated", "").trim();
|
|
116
142
|
const currentClass = element.getAttribute("class");
|
|
117
|
-
element.setAttribute(attr.name, `${currentClass ?
|
|
143
|
+
element.setAttribute(attr.name, `${currentClass ? currentClass : ""}${value ? ` ${value}` : ""}`);
|
|
118
144
|
if (isWebComponent) {
|
|
119
145
|
// Stencil is using this class for lazy loading component
|
|
120
146
|
parent.setAttribute("class", "hydrated");
|
|
@@ -178,23 +204,31 @@ const DBSwitch = class {
|
|
|
178
204
|
}
|
|
179
205
|
}
|
|
180
206
|
this.enableAttributePassing(this._ref, "db-switch");
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
207
|
+
const onMountHook_0 = () => {
|
|
208
|
+
this.resetIds();
|
|
209
|
+
this.handleValidation();
|
|
210
|
+
this._invalidMessage = this.invalidMessage || DEFAULT_INVALID_MESSAGE;
|
|
211
|
+
};
|
|
212
|
+
onMountHook_0();
|
|
213
|
+
const onMountHook_1 = () => {
|
|
214
|
+
this.setupObserver(this._ref);
|
|
215
|
+
};
|
|
216
|
+
onMountHook_1();
|
|
184
217
|
this.watch0Fn();
|
|
185
218
|
this.watch1Fn();
|
|
186
219
|
this.watch2Fn();
|
|
187
220
|
this.watch3Fn();
|
|
188
221
|
}
|
|
189
222
|
disconnectedCallback() {
|
|
190
|
-
var _a;
|
|
223
|
+
var _a, _b;
|
|
191
224
|
(_a = this.abortController) === null || _a === void 0 ? void 0 : _a.abort();
|
|
225
|
+
(_b = this.observer) === null || _b === void 0 ? void 0 : _b.disconnect();
|
|
192
226
|
}
|
|
193
227
|
render() {
|
|
194
228
|
var _a, _b;
|
|
195
|
-
return (h("div", { key: '
|
|
229
|
+
return (h("div", { key: 'e95dafb6d580ef8cfbd54b91ee77da4809984862', class: cls("db-switch", this.className), "data-visual-aid": getBooleanAsString(this.visualAid, "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: '533173f9a522375012848dbff80b0e357f5e1b30', htmlFor: this._id }, h("input", { key: '68e6d40e2b5654508d8ebaf9be66dd56aa39c8f2', type: "checkbox", role: "switch", id: this._id, ref: (el) => {
|
|
196
230
|
this._ref = el;
|
|
197
|
-
}, 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 : null, h("slot", { key: '
|
|
231
|
+
}, 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 : null, h("slot", { key: 'a89d78f024905190780c3c8436773ab710115857' })), 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: 'e170d8c368afd61c7c94c10bb2ea13fe4520d692', size: "small", semantic: "critical", id: this._invalidMessageId }, this._invalidMessage), h("span", { key: 'd8a5b8e7a5e0f70f245de5756f7b2d19640b4863', "data-visually-hidden": "true", role: "status" }, this._voiceOverFallback)));
|
|
198
232
|
}
|
|
199
233
|
get rootElement() { return getElement(this); }
|
|
200
234
|
static get watchers() { return {
|