@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
|
@@ -6,6 +6,27 @@ var index$1 = require('./index-spuu3sXz.js');
|
|
|
6
6
|
const DBCustomSelectFormField = class {
|
|
7
7
|
constructor(hostRef) {
|
|
8
8
|
index.registerInstance(this, hostRef);
|
|
9
|
+
this.observer = undefined;
|
|
10
|
+
}
|
|
11
|
+
setupObserver(element) {
|
|
12
|
+
if (!element)
|
|
13
|
+
return;
|
|
14
|
+
const parent = element.closest("db-custom-select-form-field");
|
|
15
|
+
if (!parent || this.observer)
|
|
16
|
+
return;
|
|
17
|
+
this.observer = new MutationObserver((mutations) => {
|
|
18
|
+
if (mutations.some((mutation) => {
|
|
19
|
+
var _a;
|
|
20
|
+
const attr = mutation.target.attributes.getNamedItem((_a = mutation.attributeName) !== null && _a !== void 0 ? _a : "");
|
|
21
|
+
return (attr === null || attr === void 0 ? void 0 : attr.value) !== mutation.oldValue;
|
|
22
|
+
})) {
|
|
23
|
+
this.enableAttributePassing(element, "db-custom-select-form-field");
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
this.observer.observe(parent, {
|
|
27
|
+
attributes: true,
|
|
28
|
+
attributeOldValue: true,
|
|
29
|
+
});
|
|
9
30
|
}
|
|
10
31
|
/**
|
|
11
32
|
* Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.
|
|
@@ -20,10 +41,15 @@ const DBCustomSelectFormField = class {
|
|
|
20
41
|
const attr = attributes.item(i);
|
|
21
42
|
if (attr && attr.name !== 'data-density' &&
|
|
22
43
|
(attr.name.startsWith("data-") || attr.name.startsWith("aria-"))) {
|
|
23
|
-
|
|
44
|
+
if (attr.value) {
|
|
45
|
+
element.setAttribute(attr.name, attr.value);
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
element.removeAttribute(attr.name);
|
|
49
|
+
}
|
|
24
50
|
parent.removeAttribute(attr.name);
|
|
25
51
|
}
|
|
26
|
-
else if (attr &&
|
|
52
|
+
else if (attr && ["style"].includes(attr.name)) {
|
|
27
53
|
element.setAttribute(attr.name, attr.value);
|
|
28
54
|
parent.removeAttribute(attr.name);
|
|
29
55
|
}
|
|
@@ -31,7 +57,7 @@ const DBCustomSelectFormField = class {
|
|
|
31
57
|
const isWebComponent = attr.value.includes("hydrated");
|
|
32
58
|
const value = attr.value.replace("hydrated", "").trim();
|
|
33
59
|
const currentClass = element.getAttribute("class");
|
|
34
|
-
element.setAttribute(attr.name, `${currentClass ?
|
|
60
|
+
element.setAttribute(attr.name, `${currentClass ? currentClass : ""}${value ? ` ${value}` : ""}`);
|
|
35
61
|
if (isWebComponent) {
|
|
36
62
|
// Stencil is using this class for lazy loading component
|
|
37
63
|
parent.setAttribute("class", "hydrated");
|
|
@@ -51,12 +77,17 @@ const DBCustomSelectFormField = class {
|
|
|
51
77
|
}
|
|
52
78
|
}
|
|
53
79
|
this.enableAttributePassing(this._ref, "db-custom-select-form-field");
|
|
80
|
+
this.setupObserver(this._ref);
|
|
81
|
+
}
|
|
82
|
+
disconnectedCallback() {
|
|
83
|
+
var _a;
|
|
84
|
+
(_a = this.observer) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
54
85
|
}
|
|
55
86
|
render() {
|
|
56
87
|
var _a, _b;
|
|
57
|
-
return (index.h("summary", { key: '
|
|
88
|
+
return (index.h("summary", { key: 'e74ace4d1b8b882d93a74274f0ae0b278f6daf42', class: index$1.cls("db-custom-select-form-field", this.className), ref: (el) => {
|
|
58
89
|
this._ref = el;
|
|
59
|
-
}, id: (_a = this.id) !== null && _a !== void 0 ? _a : (_b = this.propOverrides) === null || _b === void 0 ? void 0 : _b.id }, index.h("slot", { key: '
|
|
90
|
+
}, id: (_a = this.id) !== null && _a !== void 0 ? _a : (_b = this.propOverrides) === null || _b === void 0 ? void 0 : _b.id }, index.h("slot", { key: 'a336ba54bc2165846100b211d0f7f67755fb98d7' })));
|
|
60
91
|
}
|
|
61
92
|
get rootElement() { return index.getElement(this); }
|
|
62
93
|
};
|
|
@@ -48,6 +48,7 @@ const DBCustomSelect = class {
|
|
|
48
48
|
this._searchValue = undefined;
|
|
49
49
|
this.selectAllChecked = false;
|
|
50
50
|
this.selectAllIndeterminate = false;
|
|
51
|
+
this.observer = undefined;
|
|
51
52
|
this.satisfyReact = function satisfyReact(event) {
|
|
52
53
|
// This is a function to satisfy React
|
|
53
54
|
event.stopPropagation();
|
|
@@ -77,7 +78,7 @@ const DBCustomSelect = class {
|
|
|
77
78
|
constants.DEFAULT_INVALID_MESSAGE;
|
|
78
79
|
if (index$1.hasVoiceOver()) {
|
|
79
80
|
this._voiceOverFallback = this._invalidMessage;
|
|
80
|
-
index$1.delay(() => (this._voiceOverFallback = ""), 1000);
|
|
81
|
+
void index$1.delay(() => (this._voiceOverFallback = ""), 1000);
|
|
81
82
|
}
|
|
82
83
|
if (this._userInteraction) {
|
|
83
84
|
this._validity = (_c = this.validation) !== null && _c !== void 0 ? _c : "invalid";
|
|
@@ -89,7 +90,7 @@ const DBCustomSelect = class {
|
|
|
89
90
|
this.setDescById(this._validMessageId);
|
|
90
91
|
if (index$1.hasVoiceOver()) {
|
|
91
92
|
this._voiceOverFallback = (_e = this.validMessage) !== null && _e !== void 0 ? _e : constants.DEFAULT_VALID_MESSAGE;
|
|
92
|
-
index$1.delay(() => (this._voiceOverFallback = ""), 1000);
|
|
93
|
+
void index$1.delay(() => (this._voiceOverFallback = ""), 1000);
|
|
93
94
|
}
|
|
94
95
|
this._validity = (_f = this.validation) !== null && _f !== void 0 ? _f : "valid";
|
|
95
96
|
}
|
|
@@ -188,7 +189,7 @@ const DBCustomSelect = class {
|
|
|
188
189
|
const dropdown = this.detailsRef.querySelector("article");
|
|
189
190
|
if (dropdown) {
|
|
190
191
|
// This is a workaround for Angular
|
|
191
|
-
index$1.delay(() => {
|
|
192
|
+
void index$1.delay(() => {
|
|
192
193
|
var _a;
|
|
193
194
|
floatingComponents.handleFixedDropdown(dropdown, this.detailsRef, (_a = this.placement) !== null && _a !== void 0 ? _a : "bottom");
|
|
194
195
|
}, 1);
|
|
@@ -245,7 +246,7 @@ const DBCustomSelect = class {
|
|
|
245
246
|
// or to the last checkbox
|
|
246
247
|
const search = index$1.getSearchInput(this.detailsRef);
|
|
247
248
|
if (search) {
|
|
248
|
-
index$1.delay(() => {
|
|
249
|
+
void index$1.delay(() => {
|
|
249
250
|
search.focus();
|
|
250
251
|
}, 100);
|
|
251
252
|
}
|
|
@@ -407,7 +408,7 @@ const DBCustomSelect = class {
|
|
|
407
408
|
? checkboxes.at(1)
|
|
408
409
|
: first;
|
|
409
410
|
if (checkbox) {
|
|
410
|
-
index$1.delay(() => {
|
|
411
|
+
void index$1.delay(() => {
|
|
411
412
|
// Takes some time until element can be focused
|
|
412
413
|
checkbox.focus();
|
|
413
414
|
}, 1);
|
|
@@ -420,7 +421,7 @@ const DBCustomSelect = class {
|
|
|
420
421
|
// Focus search if possible
|
|
421
422
|
const search = index$1.getSearchInput(this.detailsRef);
|
|
422
423
|
if (search) {
|
|
423
|
-
index$1.delay(() => {
|
|
424
|
+
void index$1.delay(() => {
|
|
424
425
|
// Takes some time until element can be focused
|
|
425
426
|
search.focus();
|
|
426
427
|
}, 1);
|
|
@@ -486,6 +487,26 @@ const DBCustomSelect = class {
|
|
|
486
487
|
this._selectedLabelsId = mId + "-selected-labels";
|
|
487
488
|
this._infoTextId = mId + "-info";
|
|
488
489
|
}
|
|
490
|
+
setupObserver(element) {
|
|
491
|
+
if (!element)
|
|
492
|
+
return;
|
|
493
|
+
const parent = element.closest("db-custom-select");
|
|
494
|
+
if (!parent || this.observer)
|
|
495
|
+
return;
|
|
496
|
+
this.observer = new MutationObserver((mutations) => {
|
|
497
|
+
if (mutations.some((mutation) => {
|
|
498
|
+
var _a;
|
|
499
|
+
const attr = mutation.target.attributes.getNamedItem((_a = mutation.attributeName) !== null && _a !== void 0 ? _a : "");
|
|
500
|
+
return (attr === null || attr === void 0 ? void 0 : attr.value) !== mutation.oldValue;
|
|
501
|
+
})) {
|
|
502
|
+
this.enableAttributePassing(element, "db-custom-select");
|
|
503
|
+
}
|
|
504
|
+
});
|
|
505
|
+
this.observer.observe(parent, {
|
|
506
|
+
attributes: true,
|
|
507
|
+
attributeOldValue: true,
|
|
508
|
+
});
|
|
509
|
+
}
|
|
489
510
|
/**
|
|
490
511
|
* Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.
|
|
491
512
|
* @param element the ref for the component
|
|
@@ -499,10 +520,15 @@ const DBCustomSelect = class {
|
|
|
499
520
|
const attr = attributes.item(i);
|
|
500
521
|
if (attr && attr.name !== 'data-density' &&
|
|
501
522
|
(attr.name.startsWith("data-") || attr.name.startsWith("aria-"))) {
|
|
502
|
-
|
|
523
|
+
if (attr.value) {
|
|
524
|
+
element.setAttribute(attr.name, attr.value);
|
|
525
|
+
}
|
|
526
|
+
else {
|
|
527
|
+
element.removeAttribute(attr.name);
|
|
528
|
+
}
|
|
503
529
|
parent.removeAttribute(attr.name);
|
|
504
530
|
}
|
|
505
|
-
else if (attr &&
|
|
531
|
+
else if (attr && ["style"].includes(attr.name)) {
|
|
506
532
|
element.setAttribute(attr.name, attr.value);
|
|
507
533
|
parent.removeAttribute(attr.name);
|
|
508
534
|
}
|
|
@@ -510,7 +536,7 @@ const DBCustomSelect = class {
|
|
|
510
536
|
const isWebComponent = attr.value.includes("hydrated");
|
|
511
537
|
const value = attr.value.replace("hydrated", "").trim();
|
|
512
538
|
const currentClass = element.getAttribute("class");
|
|
513
|
-
element.setAttribute(attr.name, `${currentClass ?
|
|
539
|
+
element.setAttribute(attr.name, `${currentClass ? currentClass : ""}${value ? ` ${value}` : ""}`);
|
|
514
540
|
if (isWebComponent) {
|
|
515
541
|
// Stencil is using this class for lazy loading component
|
|
516
542
|
parent.setAttribute("class", "hydrated");
|
|
@@ -762,18 +788,25 @@ const DBCustomSelect = class {
|
|
|
762
788
|
}
|
|
763
789
|
}
|
|
764
790
|
this.enableAttributePassing(this._ref, "db-custom-select");
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
this.detailsRef.open
|
|
791
|
+
const onMountHook_0 = () => {
|
|
792
|
+
this.resetIds();
|
|
793
|
+
this._invalidMessage = this.invalidMessage || constants.DEFAULT_INVALID_MESSAGE;
|
|
794
|
+
if (typeof window !== "undefined" && "IntersectionObserver" in window) {
|
|
795
|
+
this._observer = new IntersectionObserver((payload) => {
|
|
796
|
+
if (this.detailsRef) {
|
|
797
|
+
const entry = payload.find(({ target }) => target === this.detailsRef);
|
|
798
|
+
if (entry && !entry.isIntersecting && this.detailsRef.open) {
|
|
799
|
+
this.detailsRef.open = false;
|
|
800
|
+
}
|
|
773
801
|
}
|
|
774
|
-
}
|
|
775
|
-
}
|
|
776
|
-
}
|
|
802
|
+
});
|
|
803
|
+
}
|
|
804
|
+
};
|
|
805
|
+
onMountHook_0();
|
|
806
|
+
const onMountHook_1 = () => {
|
|
807
|
+
this.setupObserver(this._ref);
|
|
808
|
+
};
|
|
809
|
+
onMountHook_1();
|
|
777
810
|
this.watch0Fn();
|
|
778
811
|
this.watch1Fn();
|
|
779
812
|
this.watch2Fn();
|
|
@@ -795,24 +828,25 @@ const DBCustomSelect = class {
|
|
|
795
828
|
this.watch18Fn();
|
|
796
829
|
}
|
|
797
830
|
disconnectedCallback() {
|
|
798
|
-
var _a;
|
|
831
|
+
var _a, _b;
|
|
799
832
|
(_a = this.abortController) === null || _a === void 0 ? void 0 : _a.abort();
|
|
833
|
+
(_b = this.observer) === null || _b === void 0 ? void 0 : _b.disconnect();
|
|
800
834
|
}
|
|
801
835
|
render() {
|
|
802
836
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
803
|
-
return (index.h("div", { key: '
|
|
837
|
+
return (index.h("div", { key: '1089ddd1cfca85b7a04524de6430b3572ccb6453', class: index$1.cls("db-custom-select", this.className), id: this._id, ref: (el) => {
|
|
804
838
|
this._ref = el;
|
|
805
839
|
}, "aria-invalid": this._validity === "invalid", "data-custom-validity": this._validity, "data-width": this.formFieldWidth, "data-variant": this.variant === "floating" &&
|
|
806
840
|
this.selectedType === "tag" &&
|
|
807
841
|
this.multiple
|
|
808
842
|
? "above"
|
|
809
|
-
: this.variant, "data-required": index$1.getBooleanAsString(this.required, "required"), "data-hide-asterisk": index$1.getHideProp(this.showRequiredAsterisk), "data-placement": this.placement, "data-selected-type": this.multiple ? this.selectedType : "text", "data-hide-label": index$1.getHideProp(this.showLabel), "data-icon": this.icon, "data-show-icon": index$1.getBooleanAsString(this.showIcon, "showIcon") }, index.h("label", { key: '
|
|
843
|
+
: this.variant, "data-required": index$1.getBooleanAsString(this.required, "required"), "data-hide-asterisk": index$1.getHideProp(this.showRequiredAsterisk), "data-placement": this.placement, "data-selected-type": this.multiple ? this.selectedType : "text", "data-hide-label": index$1.getHideProp(this.showLabel), "data-icon": this.icon, "data-show-icon": index$1.getBooleanAsString(this.showIcon, "showIcon") }, index.h("label", { key: 'df6fe2735838356dc7cf9da1538e2d734089341a', id: this._labelId }, (_a = this.label) !== null && _a !== void 0 ? _a : constants.DEFAULT_LABEL, index.h("select", { key: 'd952cedd05d4f5b1eb2a24d4362aa2b5e4064fd8', role: "none", hidden: true, id: this._selectId, tabIndex: -1, ref: (el) => {
|
|
810
844
|
this.selectRef = el;
|
|
811
845
|
}, form: this.form, name: this.name, "data-custom-validity": this._validity, multiple: index$1.getBoolean(this.multiple, "multiple"), disabled: index$1.getBoolean(this.disabled, "disabled"), required: index$1.getBoolean(this.required, "required"), onChange: (event) => this.satisfyReact(event) }, ((_b = this.options) === null || _b === void 0 ? void 0 : _b.length)
|
|
812
846
|
? (_c = this.options) === null || _c === void 0 ? void 0 : _c.map((option) => (index.h("option", { disabled: option.disabled, value: option.value, key: undefined }, this.getOptionLabel(option))))
|
|
813
|
-
: null)), index.h("details", { key: '
|
|
847
|
+
: null)), index.h("details", { key: '51e516f07db962d68494b5b012a33982df369392', ref: (el) => {
|
|
814
848
|
this.detailsRef = el;
|
|
815
|
-
}, open: this.open, onToggle: (event) => this.handleDropdownToggle(event), onKeyDown: (event) => this.handleKeyboardPress(event) }, index.h("slot", { key: '
|
|
849
|
+
}, open: this.open, onToggle: (event) => this.handleDropdownToggle(event), onKeyDown: (event) => this.handleKeyboardPress(event) }, index.h("slot", { key: '9d059be7ce413194177616d016f7babffb790f07' }), this.options ? (index.h(index.Fragment, null, index.h("summary", { class: "db-custom-select-form-field", id: this._summaryId, "aria-disabled": index$1.getBooleanAsString(this.disabled, "disabled"), tabIndex: this.disabled ? -1 : undefined, "aria-labelledby": this._labelId }, ((_d = this._selectedLabels) === null || _d === void 0 ? void 0 : _d.length) ? (index.h("span", { "data-visually-hidden": index$1.getBooleanAsString(this.selectedType === "tag", "selectedType"), id: this._selectedLabelsId }, this.selectedPrefix ? (index.h("span", { "data-visually-hidden": "true" }, this.selectedPrefix)) : null, this._selectedLabels)) : null, this.selectedType === "tag" ? (index.h("div", null, (_e = this._selectedOptions) === null || _e === void 0 ? void 0 : _e.map((option) => (index.h("db-tag", { emphasis: "strong", behavior: "removable", removeButton: this.getTagRemoveLabel(option), onRemove: (event) => this.handleTagRemove(option, event), key: undefined }, this.getOptionLabel(option)))))) : null), index.h("db-custom-select-dropdown", { width: this.dropdownWidth }, this.searchEnabled ? (index.h("div", null, index.h("db-input", { type: "search", ref: (el) => {
|
|
816
850
|
this.searchInputRef = el;
|
|
817
851
|
}, name: this._id, form: this._id, showLabel: false, value: this._searchValue, label: (_f = this.searchLabel) !== null && _f !== void 0 ? _f : constants.DEFAULT_LABEL, placeholder: (_g = this.searchPlaceholder) !== null && _g !== void 0 ? _g : this.searchLabel, ariaDescribedBy: this._hasNoOptions || this.showLoading
|
|
818
852
|
? this._infoTextId
|
|
@@ -822,7 +856,7 @@ const DBCustomSelect = class {
|
|
|
822
856
|
this.selectAllRef = el;
|
|
823
857
|
}, form: this._id, checked: this.selectAllChecked, onChange: (event) => this.handleSelectAll(event) }), this.getSelectAllLabel())))) : null, index.h("db-custom-select-list", { multiple: index$1.getBoolean(this.multiple, "multiple"), label: (_k = (_j = this.listLabel) !== null && _j !== void 0 ? _j : this.label) !== null && _k !== void 0 ? _k : constants.DEFAULT_LABEL }, (_l = this._options) === null || _l === void 0 ? void 0 : _l.map((option) => (index.h("db-custom-select-list-item", { type: this.multiple ? "checkbox" : "radio", showDivider: option.showDivider, icon: option.icon, isGroupTitle: option.isGroupTitle, groupTitle: this.getOptionLabel(option), name: this._id, checked: this.getOptionChecked(option.value), disabled: option.disabled, value: option.value, onChange: () => this.handleSelect(option.value), key: undefined }, !option.isGroupTitle
|
|
824
858
|
? this.getOptionLabel(option)
|
|
825
|
-
: null)))))), index.h("div", null, index.h("db-button", { variant: "ghost", width: "full", icon: "cross", size: "small", name: this._id, form: this._id, onClick: () => this.handleClose(undefined, true) }, (_m = this.mobileCloseButtonText) !== null && _m !== void 0 ? _m : constants.DEFAULT_CLOSE_BUTTON))))) : null), ((_o = this.showClearSelection) !== null && _o !== void 0 ? _o : true) && ((_p = this._values) === null || _p === void 0 ? void 0 : _p.length) ? (index.h("db-button", { icon: "cross", variant: "ghost", size: "small", noText: true, name: this._id, form: this._id, disabled: index$1.getBoolean(this.disabled, "disabled"), onClick: (event) => this.handleClearAll(event) }, this.clearSelectionText, index.h("db-tooltip", { placement: "top" }, this.clearSelectionText))) : null, index.h("span", { key: '
|
|
859
|
+
: null)))))), index.h("div", null, index.h("db-button", { variant: "ghost", width: "full", icon: "cross", size: "small", name: this._id, form: this._id, onClick: () => this.handleClose(undefined, true) }, (_m = this.mobileCloseButtonText) !== null && _m !== void 0 ? _m : constants.DEFAULT_CLOSE_BUTTON))))) : null), ((_o = this.showClearSelection) !== null && _o !== void 0 ? _o : true) && ((_p = this._values) === null || _p === void 0 ? void 0 : _p.length) ? (index.h("db-button", { icon: "cross", variant: "ghost", size: "small", noText: true, name: this._id, form: this._id, disabled: index$1.getBoolean(this.disabled, "disabled"), onClick: (event) => this.handleClearAll(event) }, this.clearSelectionText, index.h("db-tooltip", { placement: "top" }, this.clearSelectionText))) : null, index.h("span", { key: '116d3a64ab4dc504badf8ae2298908022b807441', class: "db-custom-select-placeholder", "aria-hidden": "true", id: this._placeholderId }, (_q = this.placeholder) !== null && _q !== void 0 ? _q : this.label), index$1.stringPropVisible(this.message, this.showMessage) ? (index.h("db-infotext", { size: "small", icon: this.messageIcon, id: this._messageId }, this.message)) : null, this.hasValidState() ? (index.h("db-infotext", { size: "small", semantic: "successful", id: this._validMessageId }, this.validMessage || constants.DEFAULT_VALID_MESSAGE)) : null, index.h("db-infotext", { key: '3930c58d7e893751803157d1f23b6f9e7050adaa', size: "small", semantic: "critical", id: this._invalidMessageId }, this._invalidMessage), index.h("span", { key: 'efdbd668c7f5b2755bada6b174a0ed31a792dd31', "data-visually-hidden": "true", role: "status" }, this._voiceOverFallback)));
|
|
826
860
|
}
|
|
827
861
|
get rootElement() { return index.getElement(this); }
|
|
828
862
|
static get watchers() { return {
|
|
@@ -6,6 +6,27 @@ var index$1 = require('./index-spuu3sXz.js');
|
|
|
6
6
|
const DBDivider = class {
|
|
7
7
|
constructor(hostRef) {
|
|
8
8
|
index.registerInstance(this, hostRef);
|
|
9
|
+
this.observer = undefined;
|
|
10
|
+
}
|
|
11
|
+
setupObserver(element) {
|
|
12
|
+
if (!element)
|
|
13
|
+
return;
|
|
14
|
+
const parent = element.closest("db-divider");
|
|
15
|
+
if (!parent || this.observer)
|
|
16
|
+
return;
|
|
17
|
+
this.observer = new MutationObserver((mutations) => {
|
|
18
|
+
if (mutations.some((mutation) => {
|
|
19
|
+
var _a;
|
|
20
|
+
const attr = mutation.target.attributes.getNamedItem((_a = mutation.attributeName) !== null && _a !== void 0 ? _a : "");
|
|
21
|
+
return (attr === null || attr === void 0 ? void 0 : attr.value) !== mutation.oldValue;
|
|
22
|
+
})) {
|
|
23
|
+
this.enableAttributePassing(element, "db-divider");
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
this.observer.observe(parent, {
|
|
27
|
+
attributes: true,
|
|
28
|
+
attributeOldValue: true,
|
|
29
|
+
});
|
|
9
30
|
}
|
|
10
31
|
/**
|
|
11
32
|
* Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.
|
|
@@ -20,10 +41,15 @@ const DBDivider = class {
|
|
|
20
41
|
const attr = attributes.item(i);
|
|
21
42
|
if (attr && attr.name !== 'data-density' &&
|
|
22
43
|
(attr.name.startsWith("data-") || attr.name.startsWith("aria-"))) {
|
|
23
|
-
|
|
44
|
+
if (attr.value) {
|
|
45
|
+
element.setAttribute(attr.name, attr.value);
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
element.removeAttribute(attr.name);
|
|
49
|
+
}
|
|
24
50
|
parent.removeAttribute(attr.name);
|
|
25
51
|
}
|
|
26
|
-
else if (attr &&
|
|
52
|
+
else if (attr && ["style"].includes(attr.name)) {
|
|
27
53
|
element.setAttribute(attr.name, attr.value);
|
|
28
54
|
parent.removeAttribute(attr.name);
|
|
29
55
|
}
|
|
@@ -31,7 +57,7 @@ const DBDivider = class {
|
|
|
31
57
|
const isWebComponent = attr.value.includes("hydrated");
|
|
32
58
|
const value = attr.value.replace("hydrated", "").trim();
|
|
33
59
|
const currentClass = element.getAttribute("class");
|
|
34
|
-
element.setAttribute(attr.name, `${currentClass ?
|
|
60
|
+
element.setAttribute(attr.name, `${currentClass ? currentClass : ""}${value ? ` ${value}` : ""}`);
|
|
35
61
|
if (isWebComponent) {
|
|
36
62
|
// Stencil is using this class for lazy loading component
|
|
37
63
|
parent.setAttribute("class", "hydrated");
|
|
@@ -51,10 +77,15 @@ const DBDivider = class {
|
|
|
51
77
|
}
|
|
52
78
|
}
|
|
53
79
|
this.enableAttributePassing(this._ref, "db-divider");
|
|
80
|
+
this.setupObserver(this._ref);
|
|
81
|
+
}
|
|
82
|
+
disconnectedCallback() {
|
|
83
|
+
var _a;
|
|
84
|
+
(_a = this.observer) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
54
85
|
}
|
|
55
86
|
render() {
|
|
56
87
|
var _a, _b;
|
|
57
|
-
return (index.h("div", { key: '
|
|
88
|
+
return (index.h("div", { key: '09e35f9aa6912126375f69d68b75a1d64a2d0ba8', class: index$1.cls("db-divider", this.className), ref: (el) => {
|
|
58
89
|
this._ref = el;
|
|
59
90
|
}, id: (_a = this.id) !== null && _a !== void 0 ? _a : (_b = this.propOverrides) === null || _b === void 0 ? void 0 : _b.id, "data-margin": this.margin, "data-variant": this.variant, "data-emphasis": this.emphasis, "data-width": this.width }));
|
|
60
91
|
}
|
|
@@ -9,6 +9,7 @@ const DBDrawer = class {
|
|
|
9
9
|
index.registerInstance(this, hostRef);
|
|
10
10
|
this.close = index.createEvent(this, "close");
|
|
11
11
|
this.initialized = false;
|
|
12
|
+
this.observer = undefined;
|
|
12
13
|
}
|
|
13
14
|
handleClose(event, forceClose) {
|
|
14
15
|
var _a;
|
|
@@ -72,6 +73,26 @@ const DBDrawer = class {
|
|
|
72
73
|
}
|
|
73
74
|
}
|
|
74
75
|
}
|
|
76
|
+
setupObserver(element) {
|
|
77
|
+
if (!element)
|
|
78
|
+
return;
|
|
79
|
+
const parent = element.closest("db-drawer");
|
|
80
|
+
if (!parent || this.observer)
|
|
81
|
+
return;
|
|
82
|
+
this.observer = new MutationObserver((mutations) => {
|
|
83
|
+
if (mutations.some((mutation) => {
|
|
84
|
+
var _a;
|
|
85
|
+
const attr = mutation.target.attributes.getNamedItem((_a = mutation.attributeName) !== null && _a !== void 0 ? _a : "");
|
|
86
|
+
return (attr === null || attr === void 0 ? void 0 : attr.value) !== mutation.oldValue;
|
|
87
|
+
})) {
|
|
88
|
+
this.enableAttributePassing(element, "db-drawer");
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
this.observer.observe(parent, {
|
|
92
|
+
attributes: true,
|
|
93
|
+
attributeOldValue: true,
|
|
94
|
+
});
|
|
95
|
+
}
|
|
75
96
|
/**
|
|
76
97
|
* Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.
|
|
77
98
|
* @param element the ref for the component
|
|
@@ -85,10 +106,15 @@ const DBDrawer = class {
|
|
|
85
106
|
const attr = attributes.item(i);
|
|
86
107
|
if (attr && attr.name !== 'data-density' &&
|
|
87
108
|
(attr.name.startsWith("data-") || attr.name.startsWith("aria-"))) {
|
|
88
|
-
|
|
109
|
+
if (attr.value) {
|
|
110
|
+
element.setAttribute(attr.name, attr.value);
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
element.removeAttribute(attr.name);
|
|
114
|
+
}
|
|
89
115
|
parent.removeAttribute(attr.name);
|
|
90
116
|
}
|
|
91
|
-
else if (attr &&
|
|
117
|
+
else if (attr && ["style"].includes(attr.name)) {
|
|
92
118
|
element.setAttribute(attr.name, attr.value);
|
|
93
119
|
parent.removeAttribute(attr.name);
|
|
94
120
|
}
|
|
@@ -96,7 +122,7 @@ const DBDrawer = class {
|
|
|
96
122
|
const isWebComponent = attr.value.includes("hydrated");
|
|
97
123
|
const value = attr.value.replace("hydrated", "").trim();
|
|
98
124
|
const currentClass = element.getAttribute("class");
|
|
99
|
-
element.setAttribute(attr.name, `${currentClass ?
|
|
125
|
+
element.setAttribute(attr.name, `${currentClass ? currentClass : ""}${value ? ` ${value}` : ""}`);
|
|
100
126
|
if (isWebComponent) {
|
|
101
127
|
// Stencil is using this class for lazy loading component
|
|
102
128
|
parent.setAttribute("class", "hydrated");
|
|
@@ -134,18 +160,29 @@ const DBDrawer = class {
|
|
|
134
160
|
}
|
|
135
161
|
}
|
|
136
162
|
this.enableAttributePassing(this._ref, "db-drawer");
|
|
137
|
-
|
|
138
|
-
|
|
163
|
+
const onMountHook_0 = () => {
|
|
164
|
+
this.handleDialogOpen();
|
|
165
|
+
this.initialized = true;
|
|
166
|
+
};
|
|
167
|
+
onMountHook_0();
|
|
168
|
+
const onMountHook_1 = () => {
|
|
169
|
+
this.setupObserver(this._ref);
|
|
170
|
+
};
|
|
171
|
+
onMountHook_1();
|
|
139
172
|
this.watch0Fn();
|
|
140
173
|
this.watch1Fn();
|
|
141
174
|
}
|
|
175
|
+
disconnectedCallback() {
|
|
176
|
+
var _a;
|
|
177
|
+
(_a = this.observer) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
178
|
+
}
|
|
142
179
|
render() {
|
|
143
180
|
var _a, _b, _c;
|
|
144
|
-
return (index.h("dialog", { key: '
|
|
181
|
+
return (index.h("dialog", { key: '68343ae9da612485135f6e0b01bd581de86d1dc6', class: "db-drawer", id: (_a = this.id) !== null && _a !== void 0 ? _a : (_b = this.propOverrides) === null || _b === void 0 ? void 0 : _b.id, ref: (el) => {
|
|
145
182
|
this._ref = el;
|
|
146
|
-
}, onClick: (event) => this.handleClose(event), onKeyDown: (event) => this.handleClose(event), "data-position": this.position, "data-backdrop": this.backdrop, "data-direction": this.direction, "data-variant": this.variant }, index.h("article", { key: '
|
|
183
|
+
}, onClick: (event) => this.handleClose(event), onKeyDown: (event) => this.handleClose(event), "data-position": this.position, "data-backdrop": this.backdrop, "data-direction": this.direction, "data-variant": this.variant }, index.h("article", { key: 'b6a860730f150e365c684a2ed362f8ad3e84e862', class: index$1.cls("db-drawer-container", this.className), ref: (el) => {
|
|
147
184
|
this.dialogContainerRef = el;
|
|
148
|
-
}, "data-spacing": this.spacing, "data-width": this.width, "data-direction": this.direction, "data-rounded": index$1.getBooleanAsString(this.rounded, "rounded") }, index.h("header", { key: '
|
|
185
|
+
}, "data-spacing": this.spacing, "data-width": this.width, "data-direction": this.direction, "data-rounded": index$1.getBooleanAsString(this.rounded, "rounded") }, index.h("header", { key: 'd8347218a266eb48f2b86717d6ba210c907f4c18', class: "db-drawer-header" }, index.h("div", { key: '6e9a89da493fa209e09bf1ddb5a5719b52606e62', class: "db-drawer-header-text" }, index.h("slot", { key: '503445639dd0a3e51a6f99f5aff3eb039e6d34eb', name: "drawerHeader" })), index.h("db-button", { key: '39400683f7e2a05c8c8dd33be6c9913d72d5454d', class: "button-close-drawer", icon: "cross", variant: "ghost", id: this.closeButtonId, noText: true, onClick: (event) => this.handleClose(event, true) }, (_c = this.closeButtonText) !== null && _c !== void 0 ? _c : constants.DEFAULT_CLOSE_BUTTON)), index.h("div", { key: 'f0e4ebb273ea7f53fd1c026f7f50a16f89ab3259', class: "db-drawer-content" }, index.h("slot", { key: 'e1ead064fd822ca9fd33be44af5fd52801ba33ea' })))));
|
|
149
186
|
}
|
|
150
187
|
get rootElement() { return index.getElement(this); }
|
|
151
188
|
static get watchers() { return {
|
|
@@ -12,6 +12,7 @@ const DBHeader = class {
|
|
|
12
12
|
this.toggle = index.createEvent(this, "toggle");
|
|
13
13
|
this.initialized = false;
|
|
14
14
|
this.forcedToMobile = false;
|
|
15
|
+
this.observer = undefined;
|
|
15
16
|
}
|
|
16
17
|
handleToggle(event) {
|
|
17
18
|
if (event && event.stopPropagation) {
|
|
@@ -27,6 +28,26 @@ const DBHeader = class {
|
|
|
27
28
|
this.handleToggle();
|
|
28
29
|
}
|
|
29
30
|
}
|
|
31
|
+
setupObserver(element) {
|
|
32
|
+
if (!element)
|
|
33
|
+
return;
|
|
34
|
+
const parent = element.closest("db-header");
|
|
35
|
+
if (!parent || this.observer)
|
|
36
|
+
return;
|
|
37
|
+
this.observer = new MutationObserver((mutations) => {
|
|
38
|
+
if (mutations.some((mutation) => {
|
|
39
|
+
var _a;
|
|
40
|
+
const attr = mutation.target.attributes.getNamedItem((_a = mutation.attributeName) !== null && _a !== void 0 ? _a : "");
|
|
41
|
+
return (attr === null || attr === void 0 ? void 0 : attr.value) !== mutation.oldValue;
|
|
42
|
+
})) {
|
|
43
|
+
this.enableAttributePassing(element, "db-header");
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
this.observer.observe(parent, {
|
|
47
|
+
attributes: true,
|
|
48
|
+
attributeOldValue: true,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
30
51
|
/**
|
|
31
52
|
* Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.
|
|
32
53
|
* @param element the ref for the component
|
|
@@ -40,10 +61,15 @@ const DBHeader = class {
|
|
|
40
61
|
const attr = attributes.item(i);
|
|
41
62
|
if (attr && attr.name !== 'data-density' &&
|
|
42
63
|
(attr.name.startsWith("data-") || attr.name.startsWith("aria-"))) {
|
|
43
|
-
|
|
64
|
+
if (attr.value) {
|
|
65
|
+
element.setAttribute(attr.name, attr.value);
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
element.removeAttribute(attr.name);
|
|
69
|
+
}
|
|
44
70
|
parent.removeAttribute(attr.name);
|
|
45
71
|
}
|
|
46
|
-
else if (attr &&
|
|
72
|
+
else if (attr && ["style"].includes(attr.name)) {
|
|
47
73
|
element.setAttribute(attr.name, attr.value);
|
|
48
74
|
parent.removeAttribute(attr.name);
|
|
49
75
|
}
|
|
@@ -51,7 +77,7 @@ const DBHeader = class {
|
|
|
51
77
|
const isWebComponent = attr.value.includes("hydrated");
|
|
52
78
|
const value = attr.value.replace("hydrated", "").trim();
|
|
53
79
|
const currentClass = element.getAttribute("class");
|
|
54
|
-
element.setAttribute(attr.name, `${currentClass ?
|
|
80
|
+
element.setAttribute(attr.name, `${currentClass ? currentClass : ""}${value ? ` ${value}` : ""}`);
|
|
55
81
|
if (isWebComponent) {
|
|
56
82
|
// Stencil is using this class for lazy loading component
|
|
57
83
|
parent.setAttribute("class", "hydrated");
|
|
@@ -85,14 +111,25 @@ const DBHeader = class {
|
|
|
85
111
|
}
|
|
86
112
|
}
|
|
87
113
|
this.enableAttributePassing(this._ref, "db-header");
|
|
88
|
-
|
|
114
|
+
const onMountHook_0 = () => {
|
|
115
|
+
this.initialized = true;
|
|
116
|
+
};
|
|
117
|
+
onMountHook_0();
|
|
118
|
+
const onMountHook_1 = () => {
|
|
119
|
+
this.setupObserver(this._ref);
|
|
120
|
+
};
|
|
121
|
+
onMountHook_1();
|
|
89
122
|
this.watch0Fn();
|
|
90
123
|
}
|
|
124
|
+
disconnectedCallback() {
|
|
125
|
+
var _a;
|
|
126
|
+
(_a = this.observer) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
127
|
+
}
|
|
91
128
|
render() {
|
|
92
129
|
var _a, _b, _c;
|
|
93
|
-
return (index.h("header", { key: '
|
|
130
|
+
return (index.h("header", { key: '5d1e86b7e973ba201396327b7cdce38e2ac97228', class: index$1.cls("db-header", this.className), ref: (el) => {
|
|
94
131
|
this._ref = el;
|
|
95
|
-
}, id: (_a = this.id) !== null && _a !== void 0 ? _a : (_b = this.propOverrides) === null || _b === void 0 ? void 0 : _b.id, "data-width": this.width, "data-on-forcing-mobile": this.forceMobile && !this.forcedToMobile }, index.h("div", { key: '
|
|
132
|
+
}, id: (_a = this.id) !== null && _a !== void 0 ? _a : (_b = this.propOverrides) === null || _b === void 0 ? void 0 : _b.id, "data-width": this.width, "data-on-forcing-mobile": this.forceMobile && !this.forcedToMobile }, index.h("div", { key: 'e01bfcb3611a7ff4ddd3fc6b758dc3bf40cbe712', class: "db-header-meta-navigation" }, index.h("slot", { key: '99f6ebb0c2bca335d25bd4eaafdb6bd9978d9c8d', name: "metaNavigation" })), index.h("div", { key: '698fa926fa448a6a540e8bf13676f92a8a0408e3', class: "db-header-navigation-bar" }, index.h("div", { key: '872fb23c94eb3ec81deca9eef498146b4c434e5e', class: "db-header-brand-container" }, index.h("slot", { key: '5575ee45816a7ecf9d5102b7c54004522fb3d0dd', name: "brand" })), index.h("div", { key: 'cda8077a77bde02515ed9c12d720802c0e1a85a0', class: "db-header-navigation-container" }, index.h("div", { key: '76bfcfe58004cc685d978815058aa1593160f90c', class: "db-header-navigation" }, index.h("slot", { key: '516e0953f7352fa7f84a8affdae187c345f77dbd' })), index.h("div", { key: '97eb5eb2f86ae44c85e5779f84d7e95f362c1b26', class: "db-header-primary-action" }, index.h("slot", { key: '2db7a8e65e46009f7fcf621c4d654204f8160e56', name: "primaryAction" }))), index.h("div", { key: '6478928d7b967b365823331648d12003b4e7eefa', class: "db-header-action-container" }, index.h("div", { key: 'ade80b06a587d723ebe9c1dfb3b8ca0cb3499ab6', class: "db-header-burger-menu-container" }, index.h("db-button", { key: '5e06f6da7bdcc1b12de1b9dbdbb98b6969c80f62', icon: "menu", variant: "ghost", noText: true, onClick: () => this.handleToggle() }, (_c = this.burgerMenuLabel) !== null && _c !== void 0 ? _c : constants.DEFAULT_BURGER_MENU)), index.h("div", { key: '7afbb296999738cf13b37b4f461fefdddff18ead', class: "db-header-secondary-action" }, index.h("slot", { key: '6a39330a6eac4a0d6c9e9bcba648590d3a30cee9', name: "secondaryAction" })))), index.h("db-drawer", { key: '5ec7b632906a280475122fa9b189345ec55917f9', class: "db-header-drawer", spacing: "small", rounded: true, closeButtonId: this.closeButtonId, closeButtonText: this.closeButtonText, open: index$1.getBoolean(this.drawerOpen), onClose: () => this.handleToggle() }, index.h("div", { key: 'c7febad8b66a9a3d3c238c4c87027534f09c8601', class: "db-header-drawer-navigation" }, index.h("div", { key: '784b2d12c1838ae2ccd90575f1ef04ce97b70104', class: "db-header-navigation", onClick: (event) => this.handleNavigationItemClick(event) }, index.h("slot", { key: '6189ff74ac04565039a45952c8ea910d5260e9e0' })), index.h("div", { key: '67223d12d595038a36d9c44953a6cb24894ed35d', class: "db-header-meta-navigation" }, index.h("slot", { key: '7c3de485a3d7516978cfd16d8ef494a61f8bc4af', name: "metaNavigation" }))), index.h("div", { key: '01e0e9ac362d8f553adf53379be18a8cdeb2b816', class: "db-header-secondary-action" }, index.h("slot", { key: 'fa6c328af54f4aff0f6c7ec80d7a2b36ea63b49a', name: "secondaryAction" })))));
|
|
96
133
|
}
|
|
97
134
|
get rootElement() { return index.getElement(this); }
|
|
98
135
|
static get watchers() { return {
|
|
@@ -6,6 +6,27 @@ var index$1 = require('./index-spuu3sXz.js');
|
|
|
6
6
|
const DBIcon = class {
|
|
7
7
|
constructor(hostRef) {
|
|
8
8
|
index.registerInstance(this, hostRef);
|
|
9
|
+
this.observer = undefined;
|
|
10
|
+
}
|
|
11
|
+
setupObserver(element) {
|
|
12
|
+
if (!element)
|
|
13
|
+
return;
|
|
14
|
+
const parent = element.closest("db-icon");
|
|
15
|
+
if (!parent || this.observer)
|
|
16
|
+
return;
|
|
17
|
+
this.observer = new MutationObserver((mutations) => {
|
|
18
|
+
if (mutations.some((mutation) => {
|
|
19
|
+
var _a;
|
|
20
|
+
const attr = mutation.target.attributes.getNamedItem((_a = mutation.attributeName) !== null && _a !== void 0 ? _a : "");
|
|
21
|
+
return (attr === null || attr === void 0 ? void 0 : attr.value) !== mutation.oldValue;
|
|
22
|
+
})) {
|
|
23
|
+
this.enableAttributePassing(element, "db-icon");
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
this.observer.observe(parent, {
|
|
27
|
+
attributes: true,
|
|
28
|
+
attributeOldValue: true,
|
|
29
|
+
});
|
|
9
30
|
}
|
|
10
31
|
/**
|
|
11
32
|
* Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.
|
|
@@ -20,10 +41,15 @@ const DBIcon = class {
|
|
|
20
41
|
const attr = attributes.item(i);
|
|
21
42
|
if (attr && attr.name !== 'data-density' &&
|
|
22
43
|
(attr.name.startsWith("data-") || attr.name.startsWith("aria-"))) {
|
|
23
|
-
|
|
44
|
+
if (attr.value) {
|
|
45
|
+
element.setAttribute(attr.name, attr.value);
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
element.removeAttribute(attr.name);
|
|
49
|
+
}
|
|
24
50
|
parent.removeAttribute(attr.name);
|
|
25
51
|
}
|
|
26
|
-
else if (attr &&
|
|
52
|
+
else if (attr && ["style"].includes(attr.name)) {
|
|
27
53
|
element.setAttribute(attr.name, attr.value);
|
|
28
54
|
parent.removeAttribute(attr.name);
|
|
29
55
|
}
|
|
@@ -31,7 +57,7 @@ const DBIcon = class {
|
|
|
31
57
|
const isWebComponent = attr.value.includes("hydrated");
|
|
32
58
|
const value = attr.value.replace("hydrated", "").trim();
|
|
33
59
|
const currentClass = element.getAttribute("class");
|
|
34
|
-
element.setAttribute(attr.name, `${currentClass ?
|
|
60
|
+
element.setAttribute(attr.name, `${currentClass ? currentClass : ""}${value ? ` ${value}` : ""}`);
|
|
35
61
|
if (isWebComponent) {
|
|
36
62
|
// Stencil is using this class for lazy loading component
|
|
37
63
|
parent.setAttribute("class", "hydrated");
|
|
@@ -51,12 +77,17 @@ const DBIcon = class {
|
|
|
51
77
|
}
|
|
52
78
|
}
|
|
53
79
|
this.enableAttributePassing(this._ref, "db-icon");
|
|
80
|
+
this.setupObserver(this._ref);
|
|
81
|
+
}
|
|
82
|
+
disconnectedCallback() {
|
|
83
|
+
var _a;
|
|
84
|
+
(_a = this.observer) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
54
85
|
}
|
|
55
86
|
render() {
|
|
56
87
|
var _a, _b;
|
|
57
|
-
return (index.h("span", { key: '
|
|
88
|
+
return (index.h("span", { key: '167039453ffa0b206221a521e52e889beeab0d43', class: index$1.cls("db-icon", this.className), "aria-hidden": "true", ref: (el) => {
|
|
58
89
|
this._ref = el;
|
|
59
|
-
}, id: (_a = this.id) !== null && _a !== void 0 ? _a : (_b = this.propOverrides) === null || _b === void 0 ? void 0 : _b.id, "data-icon": this.icon, "data-icon-weight": this.weight, "data-icon-variant": this.variant }, this.text ? this.text : null, index.h("slot", { key: '
|
|
90
|
+
}, id: (_a = this.id) !== null && _a !== void 0 ? _a : (_b = this.propOverrides) === null || _b === void 0 ? void 0 : _b.id, "data-icon": this.icon, "data-icon-weight": this.weight, "data-icon-variant": this.variant }, this.text ? this.text : null, index.h("slot", { key: 'abea7d517b9dcf61ff53fd70bbbb0cad3da1daa2' })));
|
|
60
91
|
}
|
|
61
92
|
get rootElement() { return index.getElement(this); }
|
|
62
93
|
};
|