@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
|
@@ -7,6 +7,27 @@ import { h } from "@stencil/core";
|
|
|
7
7
|
export class DBCustomSelectDropdown {
|
|
8
8
|
constructor() {
|
|
9
9
|
this.width = "fixed";
|
|
10
|
+
this.observer = undefined;
|
|
11
|
+
}
|
|
12
|
+
setupObserver(element) {
|
|
13
|
+
if (!element)
|
|
14
|
+
return;
|
|
15
|
+
const parent = element.closest("db-custom-select-dropdown");
|
|
16
|
+
if (!parent || this.observer)
|
|
17
|
+
return;
|
|
18
|
+
this.observer = new MutationObserver((mutations) => {
|
|
19
|
+
if (mutations.some((mutation) => {
|
|
20
|
+
var _a;
|
|
21
|
+
const attr = mutation.target.attributes.getNamedItem((_a = mutation.attributeName) !== null && _a !== void 0 ? _a : "");
|
|
22
|
+
return (attr === null || attr === void 0 ? void 0 : attr.value) !== mutation.oldValue;
|
|
23
|
+
})) {
|
|
24
|
+
this.enableAttributePassing(element, "db-custom-select-dropdown");
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
this.observer.observe(parent, {
|
|
28
|
+
attributes: true,
|
|
29
|
+
attributeOldValue: true,
|
|
30
|
+
});
|
|
10
31
|
}
|
|
11
32
|
/**
|
|
12
33
|
* Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.
|
|
@@ -21,10 +42,15 @@ export class DBCustomSelectDropdown {
|
|
|
21
42
|
const attr = attributes.item(i);
|
|
22
43
|
if (attr && attr.name !== 'data-density' &&
|
|
23
44
|
(attr.name.startsWith("data-") || attr.name.startsWith("aria-"))) {
|
|
24
|
-
|
|
45
|
+
if (attr.value) {
|
|
46
|
+
element.setAttribute(attr.name, attr.value);
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
element.removeAttribute(attr.name);
|
|
50
|
+
}
|
|
25
51
|
parent.removeAttribute(attr.name);
|
|
26
52
|
}
|
|
27
|
-
else if (attr &&
|
|
53
|
+
else if (attr && ["style"].includes(attr.name)) {
|
|
28
54
|
element.setAttribute(attr.name, attr.value);
|
|
29
55
|
parent.removeAttribute(attr.name);
|
|
30
56
|
}
|
|
@@ -32,7 +58,7 @@ export class DBCustomSelectDropdown {
|
|
|
32
58
|
const isWebComponent = attr.value.includes("hydrated");
|
|
33
59
|
const value = attr.value.replace("hydrated", "").trim();
|
|
34
60
|
const currentClass = element.getAttribute("class");
|
|
35
|
-
element.setAttribute(attr.name, `${currentClass ?
|
|
61
|
+
element.setAttribute(attr.name, `${currentClass ? currentClass : ""}${value ? ` ${value}` : ""}`);
|
|
36
62
|
if (isWebComponent) {
|
|
37
63
|
// Stencil is using this class for lazy loading component
|
|
38
64
|
parent.setAttribute("class", "hydrated");
|
|
@@ -52,12 +78,17 @@ export class DBCustomSelectDropdown {
|
|
|
52
78
|
}
|
|
53
79
|
}
|
|
54
80
|
this.enableAttributePassing(this._ref, "db-custom-select-dropdown");
|
|
81
|
+
this.setupObserver(this._ref);
|
|
82
|
+
}
|
|
83
|
+
disconnectedCallback() {
|
|
84
|
+
var _a;
|
|
85
|
+
(_a = this.observer) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
55
86
|
}
|
|
56
87
|
render() {
|
|
57
88
|
var _a, _b;
|
|
58
|
-
return (h("article", { key: '
|
|
89
|
+
return (h("article", { key: '49bd2cef7c2c04b2ae3696fea83057858a59fd9a', class: cls("db-custom-select-dropdown db-card", this.className), "data-spacing": "none", ref: (el) => {
|
|
59
90
|
this._ref = el;
|
|
60
|
-
}, id: (_a = this.id) !== null && _a !== void 0 ? _a : (_b = this.propOverrides) === null || _b === void 0 ? void 0 : _b.id, "data-width": this.width }, h("slot", { key: '
|
|
91
|
+
}, id: (_a = this.id) !== null && _a !== void 0 ? _a : (_b = this.propOverrides) === null || _b === void 0 ? void 0 : _b.id, "data-width": this.width }, h("slot", { key: '89ceec1851f4ffdb27f99b5f301e70784607c2c8' })));
|
|
61
92
|
}
|
|
62
93
|
static get is() { return "db-custom-select-dropdown"; }
|
|
63
94
|
static get properties() {
|
|
@@ -167,5 +198,10 @@ export class DBCustomSelectDropdown {
|
|
|
167
198
|
}
|
|
168
199
|
};
|
|
169
200
|
}
|
|
201
|
+
static get states() {
|
|
202
|
+
return {
|
|
203
|
+
"observer": {}
|
|
204
|
+
};
|
|
205
|
+
}
|
|
170
206
|
static get elementRef() { return "rootElement"; }
|
|
171
207
|
}
|
|
@@ -5,6 +5,29 @@ import { h } from "@stencil/core";
|
|
|
5
5
|
|
|
6
6
|
*/
|
|
7
7
|
export class DBCustomSelectFormField {
|
|
8
|
+
constructor() {
|
|
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
|
+
});
|
|
30
|
+
}
|
|
8
31
|
/**
|
|
9
32
|
* Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.
|
|
10
33
|
* @param element the ref for the component
|
|
@@ -18,10 +41,15 @@ export class DBCustomSelectFormField {
|
|
|
18
41
|
const attr = attributes.item(i);
|
|
19
42
|
if (attr && attr.name !== 'data-density' &&
|
|
20
43
|
(attr.name.startsWith("data-") || attr.name.startsWith("aria-"))) {
|
|
21
|
-
|
|
44
|
+
if (attr.value) {
|
|
45
|
+
element.setAttribute(attr.name, attr.value);
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
element.removeAttribute(attr.name);
|
|
49
|
+
}
|
|
22
50
|
parent.removeAttribute(attr.name);
|
|
23
51
|
}
|
|
24
|
-
else if (attr &&
|
|
52
|
+
else if (attr && ["style"].includes(attr.name)) {
|
|
25
53
|
element.setAttribute(attr.name, attr.value);
|
|
26
54
|
parent.removeAttribute(attr.name);
|
|
27
55
|
}
|
|
@@ -29,7 +57,7 @@ export class DBCustomSelectFormField {
|
|
|
29
57
|
const isWebComponent = attr.value.includes("hydrated");
|
|
30
58
|
const value = attr.value.replace("hydrated", "").trim();
|
|
31
59
|
const currentClass = element.getAttribute("class");
|
|
32
|
-
element.setAttribute(attr.name, `${currentClass ?
|
|
60
|
+
element.setAttribute(attr.name, `${currentClass ? currentClass : ""}${value ? ` ${value}` : ""}`);
|
|
33
61
|
if (isWebComponent) {
|
|
34
62
|
// Stencil is using this class for lazy loading component
|
|
35
63
|
parent.setAttribute("class", "hydrated");
|
|
@@ -49,12 +77,17 @@ export class DBCustomSelectFormField {
|
|
|
49
77
|
}
|
|
50
78
|
}
|
|
51
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();
|
|
52
85
|
}
|
|
53
86
|
render() {
|
|
54
87
|
var _a, _b;
|
|
55
|
-
return (h("summary", { key: '
|
|
88
|
+
return (h("summary", { key: 'e74ace4d1b8b882d93a74274f0ae0b278f6daf42', class: cls("db-custom-select-form-field", this.className), ref: (el) => {
|
|
56
89
|
this._ref = el;
|
|
57
|
-
}, id: (_a = this.id) !== null && _a !== void 0 ? _a : (_b = this.propOverrides) === null || _b === void 0 ? void 0 : _b.id }, h("slot", { key: '
|
|
90
|
+
}, id: (_a = this.id) !== null && _a !== void 0 ? _a : (_b = this.propOverrides) === null || _b === void 0 ? void 0 : _b.id }, h("slot", { key: 'a336ba54bc2165846100b211d0f7f67755fb98d7' })));
|
|
58
91
|
}
|
|
59
92
|
static get is() { return "db-custom-select-form-field"; }
|
|
60
93
|
static get properties() {
|
|
@@ -137,5 +170,10 @@ export class DBCustomSelectFormField {
|
|
|
137
170
|
}
|
|
138
171
|
};
|
|
139
172
|
}
|
|
173
|
+
static get states() {
|
|
174
|
+
return {
|
|
175
|
+
"observer": {}
|
|
176
|
+
};
|
|
177
|
+
}
|
|
140
178
|
static get elementRef() { return "rootElement"; }
|
|
141
179
|
}
|
|
@@ -5,6 +5,29 @@ import { h } from "@stencil/core";
|
|
|
5
5
|
|
|
6
6
|
*/
|
|
7
7
|
export class DBCustomSelectList {
|
|
8
|
+
constructor() {
|
|
9
|
+
this.observer = undefined;
|
|
10
|
+
}
|
|
11
|
+
setupObserver(element) {
|
|
12
|
+
if (!element)
|
|
13
|
+
return;
|
|
14
|
+
const parent = element.closest("db-custom-select-list");
|
|
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-list");
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
this.observer.observe(parent, {
|
|
27
|
+
attributes: true,
|
|
28
|
+
attributeOldValue: true,
|
|
29
|
+
});
|
|
30
|
+
}
|
|
8
31
|
/**
|
|
9
32
|
* Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.
|
|
10
33
|
* @param element the ref for the component
|
|
@@ -18,10 +41,15 @@ export class DBCustomSelectList {
|
|
|
18
41
|
const attr = attributes.item(i);
|
|
19
42
|
if (attr && attr.name !== 'data-density' &&
|
|
20
43
|
(attr.name.startsWith("data-") || attr.name.startsWith("aria-"))) {
|
|
21
|
-
|
|
44
|
+
if (attr.value) {
|
|
45
|
+
element.setAttribute(attr.name, attr.value);
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
element.removeAttribute(attr.name);
|
|
49
|
+
}
|
|
22
50
|
parent.removeAttribute(attr.name);
|
|
23
51
|
}
|
|
24
|
-
else if (attr &&
|
|
52
|
+
else if (attr && ["style"].includes(attr.name)) {
|
|
25
53
|
element.setAttribute(attr.name, attr.value);
|
|
26
54
|
parent.removeAttribute(attr.name);
|
|
27
55
|
}
|
|
@@ -29,7 +57,7 @@ export class DBCustomSelectList {
|
|
|
29
57
|
const isWebComponent = attr.value.includes("hydrated");
|
|
30
58
|
const value = attr.value.replace("hydrated", "").trim();
|
|
31
59
|
const currentClass = element.getAttribute("class");
|
|
32
|
-
element.setAttribute(attr.name, `${currentClass ?
|
|
60
|
+
element.setAttribute(attr.name, `${currentClass ? currentClass : ""}${value ? ` ${value}` : ""}`);
|
|
33
61
|
if (isWebComponent) {
|
|
34
62
|
// Stencil is using this class for lazy loading component
|
|
35
63
|
parent.setAttribute("class", "hydrated");
|
|
@@ -49,12 +77,17 @@ export class DBCustomSelectList {
|
|
|
49
77
|
}
|
|
50
78
|
}
|
|
51
79
|
this.enableAttributePassing(this._ref, "db-custom-select-list");
|
|
80
|
+
this.setupObserver(this._ref);
|
|
81
|
+
}
|
|
82
|
+
disconnectedCallback() {
|
|
83
|
+
var _a;
|
|
84
|
+
(_a = this.observer) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
52
85
|
}
|
|
53
86
|
render() {
|
|
54
87
|
var _a, _b;
|
|
55
|
-
return (h("div", { key: '
|
|
88
|
+
return (h("div", { key: '2dee04c035ef27c7f398805eee1c77e7a3ad893c', class: cls("db-custom-select-list", this.className), role: this.multiple ? "group" : "radiogroup", "aria-label": this.label, ref: (el) => {
|
|
56
89
|
this._ref = el;
|
|
57
|
-
}, id: (_a = this.id) !== null && _a !== void 0 ? _a : (_b = this.propOverrides) === null || _b === void 0 ? void 0 : _b.id }, h("ul", { key: '
|
|
90
|
+
}, id: (_a = this.id) !== null && _a !== void 0 ? _a : (_b = this.propOverrides) === null || _b === void 0 ? void 0 : _b.id }, h("ul", { key: '64b6f1efc4344d7e274a5dd3ad78ce80983a8b77' }, h("slot", { key: '26e0de28808a85216b9f1dcb8f788928a0c62c15' }))));
|
|
58
91
|
}
|
|
59
92
|
static get is() { return "db-custom-select-list"; }
|
|
60
93
|
static get properties() {
|
|
@@ -189,5 +222,10 @@ export class DBCustomSelectList {
|
|
|
189
222
|
}
|
|
190
223
|
};
|
|
191
224
|
}
|
|
225
|
+
static get states() {
|
|
226
|
+
return {
|
|
227
|
+
"observer": {}
|
|
228
|
+
};
|
|
229
|
+
}
|
|
192
230
|
static get elementRef() { return "rootElement"; }
|
|
193
231
|
}
|
|
@@ -7,6 +7,7 @@ import { h } from "@stencil/core";
|
|
|
7
7
|
export class DBCustomSelectListItem {
|
|
8
8
|
constructor() {
|
|
9
9
|
this.hasDivider = false;
|
|
10
|
+
this.observer = undefined;
|
|
10
11
|
}
|
|
11
12
|
handleChange(event) {
|
|
12
13
|
event.stopPropagation();
|
|
@@ -20,6 +21,26 @@ export class DBCustomSelectListItem {
|
|
|
20
21
|
}
|
|
21
22
|
return getBoolean(this.checked, "checked") ? "check" : "x_placeholder";
|
|
22
23
|
}
|
|
24
|
+
setupObserver(element) {
|
|
25
|
+
if (!element)
|
|
26
|
+
return;
|
|
27
|
+
const parent = element.closest("db-custom-select-list-item");
|
|
28
|
+
if (!parent || this.observer)
|
|
29
|
+
return;
|
|
30
|
+
this.observer = new MutationObserver((mutations) => {
|
|
31
|
+
if (mutations.some((mutation) => {
|
|
32
|
+
var _a;
|
|
33
|
+
const attr = mutation.target.attributes.getNamedItem((_a = mutation.attributeName) !== null && _a !== void 0 ? _a : "");
|
|
34
|
+
return (attr === null || attr === void 0 ? void 0 : attr.value) !== mutation.oldValue;
|
|
35
|
+
})) {
|
|
36
|
+
this.enableAttributePassing(element, "db-custom-select-list-item");
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
this.observer.observe(parent, {
|
|
40
|
+
attributes: true,
|
|
41
|
+
attributeOldValue: true,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
23
44
|
/**
|
|
24
45
|
* Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.
|
|
25
46
|
* @param element the ref for the component
|
|
@@ -33,10 +54,15 @@ export class DBCustomSelectListItem {
|
|
|
33
54
|
const attr = attributes.item(i);
|
|
34
55
|
if (attr && attr.name !== 'data-density' &&
|
|
35
56
|
(attr.name.startsWith("data-") || attr.name.startsWith("aria-"))) {
|
|
36
|
-
|
|
57
|
+
if (attr.value) {
|
|
58
|
+
element.setAttribute(attr.name, attr.value);
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
element.removeAttribute(attr.name);
|
|
62
|
+
}
|
|
37
63
|
parent.removeAttribute(attr.name);
|
|
38
64
|
}
|
|
39
|
-
else if (attr &&
|
|
65
|
+
else if (attr && ["style"].includes(attr.name)) {
|
|
40
66
|
element.setAttribute(attr.name, attr.value);
|
|
41
67
|
parent.removeAttribute(attr.name);
|
|
42
68
|
}
|
|
@@ -44,7 +70,7 @@ export class DBCustomSelectListItem {
|
|
|
44
70
|
const isWebComponent = attr.value.includes("hydrated");
|
|
45
71
|
const value = attr.value.replace("hydrated", "").trim();
|
|
46
72
|
const currentClass = element.getAttribute("class");
|
|
47
|
-
element.setAttribute(attr.name, `${currentClass ?
|
|
73
|
+
element.setAttribute(attr.name, `${currentClass ? currentClass : ""}${value ? ` ${value}` : ""}`);
|
|
48
74
|
if (isWebComponent) {
|
|
49
75
|
// Stencil is using this class for lazy loading component
|
|
50
76
|
parent.setAttribute("class", "hydrated");
|
|
@@ -70,11 +96,16 @@ export class DBCustomSelectListItem {
|
|
|
70
96
|
}
|
|
71
97
|
}
|
|
72
98
|
this.enableAttributePassing(this._ref, "db-custom-select-list-item");
|
|
99
|
+
this.setupObserver(this._ref);
|
|
73
100
|
this.watch0Fn();
|
|
74
101
|
}
|
|
102
|
+
disconnectedCallback() {
|
|
103
|
+
var _a;
|
|
104
|
+
(_a = this.observer) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
105
|
+
}
|
|
75
106
|
render() {
|
|
76
107
|
var _a, _b;
|
|
77
|
-
return (h("li", { key: '
|
|
108
|
+
return (h("li", { key: 'cb467f74569cd0505dab2ac02a9b375de8f5a9bc', class: cls("db-custom-select-list-item", this.className, {
|
|
78
109
|
"db-checkbox": this.type === "checkbox" && !this.isGroupTitle,
|
|
79
110
|
"db-radio": this.type !== "checkbox" && !this.isGroupTitle,
|
|
80
111
|
}), ref: (el) => {
|
|
@@ -450,7 +481,8 @@ export class DBCustomSelectListItem {
|
|
|
450
481
|
}
|
|
451
482
|
static get states() {
|
|
452
483
|
return {
|
|
453
|
-
"hasDivider": {}
|
|
484
|
+
"hasDivider": {},
|
|
485
|
+
"observer": {}
|
|
454
486
|
};
|
|
455
487
|
}
|
|
456
488
|
static get events() {
|
|
@@ -5,6 +5,29 @@ import { h } from "@stencil/core";
|
|
|
5
5
|
|
|
6
6
|
*/
|
|
7
7
|
export class DBDivider {
|
|
8
|
+
constructor() {
|
|
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
|
+
});
|
|
30
|
+
}
|
|
8
31
|
/**
|
|
9
32
|
* Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.
|
|
10
33
|
* @param element the ref for the component
|
|
@@ -18,10 +41,15 @@ export class DBDivider {
|
|
|
18
41
|
const attr = attributes.item(i);
|
|
19
42
|
if (attr && attr.name !== 'data-density' &&
|
|
20
43
|
(attr.name.startsWith("data-") || attr.name.startsWith("aria-"))) {
|
|
21
|
-
|
|
44
|
+
if (attr.value) {
|
|
45
|
+
element.setAttribute(attr.name, attr.value);
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
element.removeAttribute(attr.name);
|
|
49
|
+
}
|
|
22
50
|
parent.removeAttribute(attr.name);
|
|
23
51
|
}
|
|
24
|
-
else if (attr &&
|
|
52
|
+
else if (attr && ["style"].includes(attr.name)) {
|
|
25
53
|
element.setAttribute(attr.name, attr.value);
|
|
26
54
|
parent.removeAttribute(attr.name);
|
|
27
55
|
}
|
|
@@ -29,7 +57,7 @@ export class DBDivider {
|
|
|
29
57
|
const isWebComponent = attr.value.includes("hydrated");
|
|
30
58
|
const value = attr.value.replace("hydrated", "").trim();
|
|
31
59
|
const currentClass = element.getAttribute("class");
|
|
32
|
-
element.setAttribute(attr.name, `${currentClass ?
|
|
60
|
+
element.setAttribute(attr.name, `${currentClass ? currentClass : ""}${value ? ` ${value}` : ""}`);
|
|
33
61
|
if (isWebComponent) {
|
|
34
62
|
// Stencil is using this class for lazy loading component
|
|
35
63
|
parent.setAttribute("class", "hydrated");
|
|
@@ -49,10 +77,15 @@ export class DBDivider {
|
|
|
49
77
|
}
|
|
50
78
|
}
|
|
51
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();
|
|
52
85
|
}
|
|
53
86
|
render() {
|
|
54
87
|
var _a, _b;
|
|
55
|
-
return (h("div", { key: '
|
|
88
|
+
return (h("div", { key: '09e35f9aa6912126375f69d68b75a1d64a2d0ba8', class: cls("db-divider", this.className), ref: (el) => {
|
|
56
89
|
this._ref = el;
|
|
57
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 }));
|
|
58
91
|
}
|
|
@@ -241,5 +274,10 @@ export class DBDivider {
|
|
|
241
274
|
}
|
|
242
275
|
};
|
|
243
276
|
}
|
|
277
|
+
static get states() {
|
|
278
|
+
return {
|
|
279
|
+
"observer": {}
|
|
280
|
+
};
|
|
281
|
+
}
|
|
244
282
|
static get elementRef() { return "rootElement"; }
|
|
245
283
|
}
|
|
@@ -8,6 +8,7 @@ import { h } from "@stencil/core";
|
|
|
8
8
|
export class DBDrawer {
|
|
9
9
|
constructor() {
|
|
10
10
|
this.initialized = false;
|
|
11
|
+
this.observer = undefined;
|
|
11
12
|
}
|
|
12
13
|
handleClose(event, forceClose) {
|
|
13
14
|
var _a;
|
|
@@ -71,6 +72,26 @@ export class DBDrawer {
|
|
|
71
72
|
}
|
|
72
73
|
}
|
|
73
74
|
}
|
|
75
|
+
setupObserver(element) {
|
|
76
|
+
if (!element)
|
|
77
|
+
return;
|
|
78
|
+
const parent = element.closest("db-drawer");
|
|
79
|
+
if (!parent || this.observer)
|
|
80
|
+
return;
|
|
81
|
+
this.observer = new MutationObserver((mutations) => {
|
|
82
|
+
if (mutations.some((mutation) => {
|
|
83
|
+
var _a;
|
|
84
|
+
const attr = mutation.target.attributes.getNamedItem((_a = mutation.attributeName) !== null && _a !== void 0 ? _a : "");
|
|
85
|
+
return (attr === null || attr === void 0 ? void 0 : attr.value) !== mutation.oldValue;
|
|
86
|
+
})) {
|
|
87
|
+
this.enableAttributePassing(element, "db-drawer");
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
this.observer.observe(parent, {
|
|
91
|
+
attributes: true,
|
|
92
|
+
attributeOldValue: true,
|
|
93
|
+
});
|
|
94
|
+
}
|
|
74
95
|
/**
|
|
75
96
|
* Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.
|
|
76
97
|
* @param element the ref for the component
|
|
@@ -84,10 +105,15 @@ export class DBDrawer {
|
|
|
84
105
|
const attr = attributes.item(i);
|
|
85
106
|
if (attr && attr.name !== 'data-density' &&
|
|
86
107
|
(attr.name.startsWith("data-") || attr.name.startsWith("aria-"))) {
|
|
87
|
-
|
|
108
|
+
if (attr.value) {
|
|
109
|
+
element.setAttribute(attr.name, attr.value);
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
element.removeAttribute(attr.name);
|
|
113
|
+
}
|
|
88
114
|
parent.removeAttribute(attr.name);
|
|
89
115
|
}
|
|
90
|
-
else if (attr &&
|
|
116
|
+
else if (attr && ["style"].includes(attr.name)) {
|
|
91
117
|
element.setAttribute(attr.name, attr.value);
|
|
92
118
|
parent.removeAttribute(attr.name);
|
|
93
119
|
}
|
|
@@ -95,7 +121,7 @@ export class DBDrawer {
|
|
|
95
121
|
const isWebComponent = attr.value.includes("hydrated");
|
|
96
122
|
const value = attr.value.replace("hydrated", "").trim();
|
|
97
123
|
const currentClass = element.getAttribute("class");
|
|
98
|
-
element.setAttribute(attr.name, `${currentClass ?
|
|
124
|
+
element.setAttribute(attr.name, `${currentClass ? currentClass : ""}${value ? ` ${value}` : ""}`);
|
|
99
125
|
if (isWebComponent) {
|
|
100
126
|
// Stencil is using this class for lazy loading component
|
|
101
127
|
parent.setAttribute("class", "hydrated");
|
|
@@ -133,18 +159,29 @@ export class DBDrawer {
|
|
|
133
159
|
}
|
|
134
160
|
}
|
|
135
161
|
this.enableAttributePassing(this._ref, "db-drawer");
|
|
136
|
-
|
|
137
|
-
|
|
162
|
+
const onMountHook_0 = () => {
|
|
163
|
+
this.handleDialogOpen();
|
|
164
|
+
this.initialized = true;
|
|
165
|
+
};
|
|
166
|
+
onMountHook_0();
|
|
167
|
+
const onMountHook_1 = () => {
|
|
168
|
+
this.setupObserver(this._ref);
|
|
169
|
+
};
|
|
170
|
+
onMountHook_1();
|
|
138
171
|
this.watch0Fn();
|
|
139
172
|
this.watch1Fn();
|
|
140
173
|
}
|
|
174
|
+
disconnectedCallback() {
|
|
175
|
+
var _a;
|
|
176
|
+
(_a = this.observer) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
177
|
+
}
|
|
141
178
|
render() {
|
|
142
179
|
var _a, _b, _c;
|
|
143
|
-
return (h("dialog", { key: '
|
|
180
|
+
return (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) => {
|
|
144
181
|
this._ref = el;
|
|
145
|
-
}, 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 }, h("article", { key: '
|
|
182
|
+
}, 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 }, h("article", { key: 'b6a860730f150e365c684a2ed362f8ad3e84e862', class: cls("db-drawer-container", this.className), ref: (el) => {
|
|
146
183
|
this.dialogContainerRef = el;
|
|
147
|
-
}, "data-spacing": this.spacing, "data-width": this.width, "data-direction": this.direction, "data-rounded": getBooleanAsString(this.rounded, "rounded") }, h("header", { key: '
|
|
184
|
+
}, "data-spacing": this.spacing, "data-width": this.width, "data-direction": this.direction, "data-rounded": getBooleanAsString(this.rounded, "rounded") }, h("header", { key: 'd8347218a266eb48f2b86717d6ba210c907f4c18', class: "db-drawer-header" }, h("div", { key: '6e9a89da493fa209e09bf1ddb5a5719b52606e62', class: "db-drawer-header-text" }, h("slot", { key: '503445639dd0a3e51a6f99f5aff3eb039e6d34eb', name: "drawerHeader" })), 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 : DEFAULT_CLOSE_BUTTON)), h("div", { key: 'f0e4ebb273ea7f53fd1c026f7f50a16f89ab3259', class: "db-drawer-content" }, h("slot", { key: 'e1ead064fd822ca9fd33be44af5fd52801ba33ea' })))));
|
|
148
185
|
}
|
|
149
186
|
static get is() { return "db-drawer"; }
|
|
150
187
|
static get properties() {
|
|
@@ -489,7 +526,8 @@ export class DBDrawer {
|
|
|
489
526
|
}
|
|
490
527
|
static get states() {
|
|
491
528
|
return {
|
|
492
|
-
"initialized": {}
|
|
529
|
+
"initialized": {},
|
|
530
|
+
"observer": {}
|
|
493
531
|
};
|
|
494
532
|
}
|
|
495
533
|
static get events() {
|
|
@@ -13,6 +13,7 @@ export class DBHeader {
|
|
|
13
13
|
constructor() {
|
|
14
14
|
this.initialized = false;
|
|
15
15
|
this.forcedToMobile = false;
|
|
16
|
+
this.observer = undefined;
|
|
16
17
|
}
|
|
17
18
|
handleToggle(event) {
|
|
18
19
|
if (event && event.stopPropagation) {
|
|
@@ -28,6 +29,26 @@ export class DBHeader {
|
|
|
28
29
|
this.handleToggle();
|
|
29
30
|
}
|
|
30
31
|
}
|
|
32
|
+
setupObserver(element) {
|
|
33
|
+
if (!element)
|
|
34
|
+
return;
|
|
35
|
+
const parent = element.closest("db-header");
|
|
36
|
+
if (!parent || this.observer)
|
|
37
|
+
return;
|
|
38
|
+
this.observer = new MutationObserver((mutations) => {
|
|
39
|
+
if (mutations.some((mutation) => {
|
|
40
|
+
var _a;
|
|
41
|
+
const attr = mutation.target.attributes.getNamedItem((_a = mutation.attributeName) !== null && _a !== void 0 ? _a : "");
|
|
42
|
+
return (attr === null || attr === void 0 ? void 0 : attr.value) !== mutation.oldValue;
|
|
43
|
+
})) {
|
|
44
|
+
this.enableAttributePassing(element, "db-header");
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
this.observer.observe(parent, {
|
|
48
|
+
attributes: true,
|
|
49
|
+
attributeOldValue: true,
|
|
50
|
+
});
|
|
51
|
+
}
|
|
31
52
|
/**
|
|
32
53
|
* Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.
|
|
33
54
|
* @param element the ref for the component
|
|
@@ -41,10 +62,15 @@ export class DBHeader {
|
|
|
41
62
|
const attr = attributes.item(i);
|
|
42
63
|
if (attr && attr.name !== 'data-density' &&
|
|
43
64
|
(attr.name.startsWith("data-") || attr.name.startsWith("aria-"))) {
|
|
44
|
-
|
|
65
|
+
if (attr.value) {
|
|
66
|
+
element.setAttribute(attr.name, attr.value);
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
element.removeAttribute(attr.name);
|
|
70
|
+
}
|
|
45
71
|
parent.removeAttribute(attr.name);
|
|
46
72
|
}
|
|
47
|
-
else if (attr &&
|
|
73
|
+
else if (attr && ["style"].includes(attr.name)) {
|
|
48
74
|
element.setAttribute(attr.name, attr.value);
|
|
49
75
|
parent.removeAttribute(attr.name);
|
|
50
76
|
}
|
|
@@ -52,7 +78,7 @@ export class DBHeader {
|
|
|
52
78
|
const isWebComponent = attr.value.includes("hydrated");
|
|
53
79
|
const value = attr.value.replace("hydrated", "").trim();
|
|
54
80
|
const currentClass = element.getAttribute("class");
|
|
55
|
-
element.setAttribute(attr.name, `${currentClass ?
|
|
81
|
+
element.setAttribute(attr.name, `${currentClass ? currentClass : ""}${value ? ` ${value}` : ""}`);
|
|
56
82
|
if (isWebComponent) {
|
|
57
83
|
// Stencil is using this class for lazy loading component
|
|
58
84
|
parent.setAttribute("class", "hydrated");
|
|
@@ -86,14 +112,25 @@ export class DBHeader {
|
|
|
86
112
|
}
|
|
87
113
|
}
|
|
88
114
|
this.enableAttributePassing(this._ref, "db-header");
|
|
89
|
-
|
|
115
|
+
const onMountHook_0 = () => {
|
|
116
|
+
this.initialized = true;
|
|
117
|
+
};
|
|
118
|
+
onMountHook_0();
|
|
119
|
+
const onMountHook_1 = () => {
|
|
120
|
+
this.setupObserver(this._ref);
|
|
121
|
+
};
|
|
122
|
+
onMountHook_1();
|
|
90
123
|
this.watch0Fn();
|
|
91
124
|
}
|
|
125
|
+
disconnectedCallback() {
|
|
126
|
+
var _a;
|
|
127
|
+
(_a = this.observer) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
128
|
+
}
|
|
92
129
|
render() {
|
|
93
130
|
var _a, _b, _c;
|
|
94
|
-
return (h("header", { key: '
|
|
131
|
+
return (h("header", { key: '5d1e86b7e973ba201396327b7cdce38e2ac97228', class: cls("db-header", this.className), ref: (el) => {
|
|
95
132
|
this._ref = el;
|
|
96
|
-
}, 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 }, h("div", { key: '
|
|
133
|
+
}, 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 }, h("div", { key: 'e01bfcb3611a7ff4ddd3fc6b758dc3bf40cbe712', class: "db-header-meta-navigation" }, h("slot", { key: '99f6ebb0c2bca335d25bd4eaafdb6bd9978d9c8d', name: "metaNavigation" })), h("div", { key: '698fa926fa448a6a540e8bf13676f92a8a0408e3', class: "db-header-navigation-bar" }, h("div", { key: '872fb23c94eb3ec81deca9eef498146b4c434e5e', class: "db-header-brand-container" }, h("slot", { key: '5575ee45816a7ecf9d5102b7c54004522fb3d0dd', name: "brand" })), h("div", { key: 'cda8077a77bde02515ed9c12d720802c0e1a85a0', class: "db-header-navigation-container" }, h("div", { key: '76bfcfe58004cc685d978815058aa1593160f90c', class: "db-header-navigation" }, h("slot", { key: '516e0953f7352fa7f84a8affdae187c345f77dbd' })), h("div", { key: '97eb5eb2f86ae44c85e5779f84d7e95f362c1b26', class: "db-header-primary-action" }, h("slot", { key: '2db7a8e65e46009f7fcf621c4d654204f8160e56', name: "primaryAction" }))), h("div", { key: '6478928d7b967b365823331648d12003b4e7eefa', class: "db-header-action-container" }, h("div", { key: 'ade80b06a587d723ebe9c1dfb3b8ca0cb3499ab6', class: "db-header-burger-menu-container" }, h("db-button", { key: '5e06f6da7bdcc1b12de1b9dbdbb98b6969c80f62', icon: "menu", variant: "ghost", noText: true, onClick: () => this.handleToggle() }, (_c = this.burgerMenuLabel) !== null && _c !== void 0 ? _c : DEFAULT_BURGER_MENU)), h("div", { key: '7afbb296999738cf13b37b4f461fefdddff18ead', class: "db-header-secondary-action" }, h("slot", { key: '6a39330a6eac4a0d6c9e9bcba648590d3a30cee9', name: "secondaryAction" })))), h("db-drawer", { key: '5ec7b632906a280475122fa9b189345ec55917f9', class: "db-header-drawer", spacing: "small", rounded: true, closeButtonId: this.closeButtonId, closeButtonText: this.closeButtonText, open: getBoolean(this.drawerOpen), onClose: () => this.handleToggle() }, h("div", { key: 'c7febad8b66a9a3d3c238c4c87027534f09c8601', class: "db-header-drawer-navigation" }, h("div", { key: '784b2d12c1838ae2ccd90575f1ef04ce97b70104', class: "db-header-navigation", onClick: (event) => this.handleNavigationItemClick(event) }, h("slot", { key: '6189ff74ac04565039a45952c8ea910d5260e9e0' })), h("div", { key: '67223d12d595038a36d9c44953a6cb24894ed35d', class: "db-header-meta-navigation" }, h("slot", { key: '7c3de485a3d7516978cfd16d8ef494a61f8bc4af', name: "metaNavigation" }))), h("div", { key: '01e0e9ac362d8f553adf53379be18a8cdeb2b816', class: "db-header-secondary-action" }, h("slot", { key: 'fa6c328af54f4aff0f6c7ec80d7a2b36ea63b49a', name: "secondaryAction" })))));
|
|
97
134
|
}
|
|
98
135
|
static get is() { return "db-header"; }
|
|
99
136
|
static get properties() {
|
|
@@ -335,7 +372,8 @@ export class DBHeader {
|
|
|
335
372
|
static get states() {
|
|
336
373
|
return {
|
|
337
374
|
"initialized": {},
|
|
338
|
-
"forcedToMobile": {}
|
|
375
|
+
"forcedToMobile": {},
|
|
376
|
+
"observer": {}
|
|
339
377
|
};
|
|
340
378
|
}
|
|
341
379
|
static get events() {
|