@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
|
@@ -12,6 +12,7 @@ const DBTabItem = class {
|
|
|
12
12
|
this.initialized = false;
|
|
13
13
|
this._listenerAdded = false;
|
|
14
14
|
this.boundSetSelectedOnChange = undefined;
|
|
15
|
+
this.observer = undefined;
|
|
15
16
|
}
|
|
16
17
|
setSelectedOnChange(event) {
|
|
17
18
|
event.stopPropagation();
|
|
@@ -33,6 +34,26 @@ const DBTabItem = class {
|
|
|
33
34
|
this.change.emit(event);
|
|
34
35
|
}
|
|
35
36
|
}
|
|
37
|
+
setupObserver(element) {
|
|
38
|
+
if (!element)
|
|
39
|
+
return;
|
|
40
|
+
const parent = element.closest("db-tab-item");
|
|
41
|
+
if (!parent || this.observer)
|
|
42
|
+
return;
|
|
43
|
+
this.observer = new MutationObserver((mutations) => {
|
|
44
|
+
if (mutations.some((mutation) => {
|
|
45
|
+
var _a;
|
|
46
|
+
const attr = mutation.target.attributes.getNamedItem((_a = mutation.attributeName) !== null && _a !== void 0 ? _a : "");
|
|
47
|
+
return (attr === null || attr === void 0 ? void 0 : attr.value) !== mutation.oldValue;
|
|
48
|
+
})) {
|
|
49
|
+
this.enableAttributePassing(element, "db-tab-item");
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
this.observer.observe(parent, {
|
|
53
|
+
attributes: true,
|
|
54
|
+
attributeOldValue: true,
|
|
55
|
+
});
|
|
56
|
+
}
|
|
36
57
|
/**
|
|
37
58
|
* Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.
|
|
38
59
|
* @param element the ref for the component
|
|
@@ -46,10 +67,15 @@ const DBTabItem = class {
|
|
|
46
67
|
const attr = attributes.item(i);
|
|
47
68
|
if (attr && attr.name !== 'data-density' &&
|
|
48
69
|
(attr.name.startsWith("data-") || attr.name.startsWith("aria-"))) {
|
|
49
|
-
|
|
70
|
+
if (attr.value) {
|
|
71
|
+
element.setAttribute(attr.name, attr.value);
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
element.removeAttribute(attr.name);
|
|
75
|
+
}
|
|
50
76
|
parent.removeAttribute(attr.name);
|
|
51
77
|
}
|
|
52
|
-
else if (attr &&
|
|
78
|
+
else if (attr && ["style"].includes(attr.name)) {
|
|
53
79
|
element.setAttribute(attr.name, attr.value);
|
|
54
80
|
parent.removeAttribute(attr.name);
|
|
55
81
|
}
|
|
@@ -57,7 +83,7 @@ const DBTabItem = class {
|
|
|
57
83
|
const isWebComponent = attr.value.includes("hydrated");
|
|
58
84
|
const value = attr.value.replace("hydrated", "").trim();
|
|
59
85
|
const currentClass = element.getAttribute("class");
|
|
60
|
-
element.setAttribute(attr.name, `${currentClass ?
|
|
86
|
+
element.setAttribute(attr.name, `${currentClass ? currentClass : ""}${value ? ` ${value}` : ""}`);
|
|
61
87
|
if (isWebComponent) {
|
|
62
88
|
// Stencil is using this class for lazy loading component
|
|
63
89
|
parent.setAttribute("class", "hydrated");
|
|
@@ -105,25 +131,33 @@ const DBTabItem = class {
|
|
|
105
131
|
}
|
|
106
132
|
}
|
|
107
133
|
this.enableAttributePassing(this._ref, "db-tab-item");
|
|
108
|
-
|
|
109
|
-
|
|
134
|
+
const onMountHook_0 = () => {
|
|
135
|
+
this.boundSetSelectedOnChange = this.setSelectedOnChange.bind(this);
|
|
136
|
+
this.initialized = true;
|
|
137
|
+
};
|
|
138
|
+
onMountHook_0();
|
|
139
|
+
const onMountHook_1 = () => {
|
|
140
|
+
this.setupObserver(this._ref);
|
|
141
|
+
};
|
|
142
|
+
onMountHook_1();
|
|
110
143
|
this.watch0Fn();
|
|
111
144
|
this.watch1Fn();
|
|
112
145
|
}
|
|
113
146
|
disconnectedCallback() {
|
|
114
|
-
var _a;
|
|
147
|
+
var _a, _b;
|
|
115
148
|
if (this._listenerAdded && this._ref && this.boundSetSelectedOnChange) {
|
|
116
149
|
(_a = this._ref
|
|
117
150
|
.closest("[role=tablist]")) === null || _a === void 0 ? void 0 : _a.removeEventListener("change", this.boundSetSelectedOnChange);
|
|
118
151
|
this._listenerAdded = false;
|
|
119
152
|
}
|
|
153
|
+
(_b = this.observer) === null || _b === void 0 ? void 0 : _b.disconnect();
|
|
120
154
|
}
|
|
121
155
|
render() {
|
|
122
156
|
var _a, _b, _c, _d, _e;
|
|
123
|
-
return (index.h("li", { key: '
|
|
124
|
-
index$1.getBooleanAsString(this.showIcon, "showIcon"), "data-show-icon-trailing": index$1.getBooleanAsString(this.showIconTrailing, "showIconTrailing"), "data-no-text": index$1.getBooleanAsString(this.noText, "noText") }, index.h("input", { key: '
|
|
157
|
+
return (index.h("li", { key: '003e5b968c65ba01df1b97e8f75592aee31125d9', class: index$1.cls("db-tab-item", this.className), role: "none" }, index.h("label", { key: '682e5a3cf7036abcbbbbbba9f42ce534d7a4145d', htmlFor: (_a = this.id) !== null && _a !== void 0 ? _a : (_b = this.propOverrides) === null || _b === void 0 ? void 0 : _b.id, "data-icon": (_c = this.iconLeading) !== null && _c !== void 0 ? _c : this.icon, "data-icon-trailing": this.iconTrailing, "data-show-icon": index$1.getBooleanAsString(this.showIconLeading, "showIconLeading") ||
|
|
158
|
+
index$1.getBooleanAsString(this.showIcon, "showIcon"), "data-show-icon-trailing": index$1.getBooleanAsString(this.showIconTrailing, "showIconTrailing"), "data-no-text": index$1.getBooleanAsString(this.noText, "noText") }, index.h("input", { key: 'ffb91a8e7248a8e5a2a7a05c6828fc6203e1eb37', type: "radio", role: "tab", disabled: index$1.getBoolean(this.disabled, "disabled"), "aria-selected": this._selected, checked: index$1.getBoolean(this.checked, "checked"), ref: (el) => {
|
|
125
159
|
this._ref = el;
|
|
126
|
-
}, name: this._name, id: (_d = this.id) !== null && _d !== void 0 ? _d : (_e = this.propOverrides) === null || _e === void 0 ? void 0 : _e.id, onInput: (event) => this.handleChange(event) }), this.label ? this.label : null, index.h("slot", { key: '
|
|
160
|
+
}, name: this._name, id: (_d = this.id) !== null && _d !== void 0 ? _d : (_e = this.propOverrides) === null || _e === void 0 ? void 0 : _e.id, onInput: (event) => this.handleChange(event) }), this.label ? this.label : null, index.h("slot", { key: '2d079503cd365448cd054e05bfaec608ff476e04' }))));
|
|
127
161
|
}
|
|
128
162
|
get rootElement() { return index.getElement(this); }
|
|
129
163
|
static get watchers() { return {
|
|
@@ -145,6 +179,27 @@ const DBTabItem = class {
|
|
|
145
179
|
const DBTabList = class {
|
|
146
180
|
constructor(hostRef) {
|
|
147
181
|
index.registerInstance(this, hostRef);
|
|
182
|
+
this.observer = undefined;
|
|
183
|
+
}
|
|
184
|
+
setupObserver(element) {
|
|
185
|
+
if (!element)
|
|
186
|
+
return;
|
|
187
|
+
const parent = element.closest("db-tab-list");
|
|
188
|
+
if (!parent || this.observer)
|
|
189
|
+
return;
|
|
190
|
+
this.observer = new MutationObserver((mutations) => {
|
|
191
|
+
if (mutations.some((mutation) => {
|
|
192
|
+
var _a;
|
|
193
|
+
const attr = mutation.target.attributes.getNamedItem((_a = mutation.attributeName) !== null && _a !== void 0 ? _a : "");
|
|
194
|
+
return (attr === null || attr === void 0 ? void 0 : attr.value) !== mutation.oldValue;
|
|
195
|
+
})) {
|
|
196
|
+
this.enableAttributePassing(element, "db-tab-list");
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
this.observer.observe(parent, {
|
|
200
|
+
attributes: true,
|
|
201
|
+
attributeOldValue: true,
|
|
202
|
+
});
|
|
148
203
|
}
|
|
149
204
|
/**
|
|
150
205
|
* Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.
|
|
@@ -159,10 +214,15 @@ const DBTabList = class {
|
|
|
159
214
|
const attr = attributes.item(i);
|
|
160
215
|
if (attr && attr.name !== 'data-density' &&
|
|
161
216
|
(attr.name.startsWith("data-") || attr.name.startsWith("aria-"))) {
|
|
162
|
-
|
|
217
|
+
if (attr.value) {
|
|
218
|
+
element.setAttribute(attr.name, attr.value);
|
|
219
|
+
}
|
|
220
|
+
else {
|
|
221
|
+
element.removeAttribute(attr.name);
|
|
222
|
+
}
|
|
163
223
|
parent.removeAttribute(attr.name);
|
|
164
224
|
}
|
|
165
|
-
else if (attr &&
|
|
225
|
+
else if (attr && ["style"].includes(attr.name)) {
|
|
166
226
|
element.setAttribute(attr.name, attr.value);
|
|
167
227
|
parent.removeAttribute(attr.name);
|
|
168
228
|
}
|
|
@@ -170,7 +230,7 @@ const DBTabList = class {
|
|
|
170
230
|
const isWebComponent = attr.value.includes("hydrated");
|
|
171
231
|
const value = attr.value.replace("hydrated", "").trim();
|
|
172
232
|
const currentClass = element.getAttribute("class");
|
|
173
|
-
element.setAttribute(attr.name, `${currentClass ?
|
|
233
|
+
element.setAttribute(attr.name, `${currentClass ? currentClass : ""}${value ? ` ${value}` : ""}`);
|
|
174
234
|
if (isWebComponent) {
|
|
175
235
|
// Stencil is using this class for lazy loading component
|
|
176
236
|
parent.setAttribute("class", "hydrated");
|
|
@@ -190,12 +250,17 @@ const DBTabList = class {
|
|
|
190
250
|
}
|
|
191
251
|
}
|
|
192
252
|
this.enableAttributePassing(this._ref, "db-tab-list");
|
|
253
|
+
this.setupObserver(this._ref);
|
|
254
|
+
}
|
|
255
|
+
disconnectedCallback() {
|
|
256
|
+
var _a;
|
|
257
|
+
(_a = this.observer) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
193
258
|
}
|
|
194
259
|
render() {
|
|
195
260
|
var _a, _b;
|
|
196
|
-
return (index.h("div", { key: '
|
|
261
|
+
return (index.h("div", { key: '2538ba05ecad54c8c29dda93a08acb61faf02309', class: index$1.cls("db-tab-list", this.className), ref: (el) => {
|
|
197
262
|
this._ref = el;
|
|
198
|
-
}, id: (_a = this.id) !== null && _a !== void 0 ? _a : (_b = this.propOverrides) === null || _b === void 0 ? void 0 : _b.id }, index.h("ul", { key: '
|
|
263
|
+
}, id: (_a = this.id) !== null && _a !== void 0 ? _a : (_b = this.propOverrides) === null || _b === void 0 ? void 0 : _b.id }, index.h("ul", { key: '86824302eb2cc92ca45a61d8bdec0f34cd679db6', role: "tablist" }, index.h("slot", { key: 'b56406b1e0291a29905b599531c0dccd9c035504' }))));
|
|
199
264
|
}
|
|
200
265
|
get rootElement() { return index.getElement(this); }
|
|
201
266
|
};
|
|
@@ -203,6 +268,27 @@ const DBTabList = class {
|
|
|
203
268
|
const DBTabPanel = class {
|
|
204
269
|
constructor(hostRef) {
|
|
205
270
|
index.registerInstance(this, hostRef);
|
|
271
|
+
this.observer = undefined;
|
|
272
|
+
}
|
|
273
|
+
setupObserver(element) {
|
|
274
|
+
if (!element)
|
|
275
|
+
return;
|
|
276
|
+
const parent = element.closest("db-tab-panel");
|
|
277
|
+
if (!parent || this.observer)
|
|
278
|
+
return;
|
|
279
|
+
this.observer = new MutationObserver((mutations) => {
|
|
280
|
+
if (mutations.some((mutation) => {
|
|
281
|
+
var _a;
|
|
282
|
+
const attr = mutation.target.attributes.getNamedItem((_a = mutation.attributeName) !== null && _a !== void 0 ? _a : "");
|
|
283
|
+
return (attr === null || attr === void 0 ? void 0 : attr.value) !== mutation.oldValue;
|
|
284
|
+
})) {
|
|
285
|
+
this.enableAttributePassing(element, "db-tab-panel");
|
|
286
|
+
}
|
|
287
|
+
});
|
|
288
|
+
this.observer.observe(parent, {
|
|
289
|
+
attributes: true,
|
|
290
|
+
attributeOldValue: true,
|
|
291
|
+
});
|
|
206
292
|
}
|
|
207
293
|
/**
|
|
208
294
|
* Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.
|
|
@@ -217,10 +303,15 @@ const DBTabPanel = class {
|
|
|
217
303
|
const attr = attributes.item(i);
|
|
218
304
|
if (attr && attr.name !== 'data-density' &&
|
|
219
305
|
(attr.name.startsWith("data-") || attr.name.startsWith("aria-"))) {
|
|
220
|
-
|
|
306
|
+
if (attr.value) {
|
|
307
|
+
element.setAttribute(attr.name, attr.value);
|
|
308
|
+
}
|
|
309
|
+
else {
|
|
310
|
+
element.removeAttribute(attr.name);
|
|
311
|
+
}
|
|
221
312
|
parent.removeAttribute(attr.name);
|
|
222
313
|
}
|
|
223
|
-
else if (attr &&
|
|
314
|
+
else if (attr && ["style"].includes(attr.name)) {
|
|
224
315
|
element.setAttribute(attr.name, attr.value);
|
|
225
316
|
parent.removeAttribute(attr.name);
|
|
226
317
|
}
|
|
@@ -228,7 +319,7 @@ const DBTabPanel = class {
|
|
|
228
319
|
const isWebComponent = attr.value.includes("hydrated");
|
|
229
320
|
const value = attr.value.replace("hydrated", "").trim();
|
|
230
321
|
const currentClass = element.getAttribute("class");
|
|
231
|
-
element.setAttribute(attr.name, `${currentClass ?
|
|
322
|
+
element.setAttribute(attr.name, `${currentClass ? currentClass : ""}${value ? ` ${value}` : ""}`);
|
|
232
323
|
if (isWebComponent) {
|
|
233
324
|
// Stencil is using this class for lazy loading component
|
|
234
325
|
parent.setAttribute("class", "hydrated");
|
|
@@ -248,12 +339,20 @@ const DBTabPanel = class {
|
|
|
248
339
|
}
|
|
249
340
|
}
|
|
250
341
|
this.enableAttributePassing(this._ref, "db-tab-panel");
|
|
342
|
+
const onMountHook_1 = () => {
|
|
343
|
+
this.setupObserver(this._ref);
|
|
344
|
+
};
|
|
345
|
+
onMountHook_1();
|
|
346
|
+
}
|
|
347
|
+
disconnectedCallback() {
|
|
348
|
+
var _a;
|
|
349
|
+
(_a = this.observer) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
251
350
|
}
|
|
252
351
|
render() {
|
|
253
352
|
var _a, _b;
|
|
254
|
-
return (index.h("section", { key: '
|
|
353
|
+
return (index.h("section", { key: 'd7179207343d512194f69f6d99a34897c146c00a', class: index$1.cls("db-tab-panel", this.className), role: "tabpanel", ref: (el) => {
|
|
255
354
|
this._ref = el;
|
|
256
|
-
}, id: (_a = this.id) !== null && _a !== void 0 ? _a : (_b = this.propOverrides) === null || _b === void 0 ? void 0 : _b.id }, this.content ? this.content : null, index.h("slot", { key: '
|
|
355
|
+
}, id: (_a = this.id) !== null && _a !== void 0 ? _a : (_b = this.propOverrides) === null || _b === void 0 ? void 0 : _b.id }, this.content ? this.content : null, index.h("slot", { key: 'dc745b430dd17f253cf9403c28f6c2cbd5b59020' })));
|
|
257
356
|
}
|
|
258
357
|
get rootElement() { return index.getElement(this); }
|
|
259
358
|
};
|
|
@@ -20,10 +20,15 @@ const DBTableBody = class {
|
|
|
20
20
|
const attr = attributes.item(i);
|
|
21
21
|
if (attr && attr.name !== 'data-density' &&
|
|
22
22
|
(attr.name.startsWith("data-") || attr.name.startsWith("aria-"))) {
|
|
23
|
-
|
|
23
|
+
if (attr.value) {
|
|
24
|
+
element.setAttribute(attr.name, attr.value);
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
element.removeAttribute(attr.name);
|
|
28
|
+
}
|
|
24
29
|
parent.removeAttribute(attr.name);
|
|
25
30
|
}
|
|
26
|
-
else if (attr &&
|
|
31
|
+
else if (attr && ["style"].includes(attr.name)) {
|
|
27
32
|
element.setAttribute(attr.name, attr.value);
|
|
28
33
|
parent.removeAttribute(attr.name);
|
|
29
34
|
}
|
|
@@ -31,7 +36,7 @@ const DBTableBody = class {
|
|
|
31
36
|
const isWebComponent = attr.value.includes("hydrated");
|
|
32
37
|
const value = attr.value.replace("hydrated", "").trim();
|
|
33
38
|
const currentClass = element.getAttribute("class");
|
|
34
|
-
element.setAttribute(attr.name, `${currentClass ?
|
|
39
|
+
element.setAttribute(attr.name, `${currentClass ? currentClass : ""}${value ? ` ${value}` : ""}`);
|
|
35
40
|
if (isWebComponent) {
|
|
36
41
|
// Stencil is using this class for lazy loading component
|
|
37
42
|
parent.setAttribute("class", "hydrated");
|
|
@@ -54,7 +59,7 @@ const DBTableBody = class {
|
|
|
54
59
|
}
|
|
55
60
|
render() {
|
|
56
61
|
var _a;
|
|
57
|
-
return (index.h("tbody", { key: '
|
|
62
|
+
return (index.h("tbody", { key: 'b6033bbe9cdcdb6bb9d292f68e980a6737fef9fa', class: index$1.cls("db-table-body", this.className), ref: (el) => {
|
|
58
63
|
this._ref = el;
|
|
59
64
|
}, id: this.id }, this.rows ? ((_a = this.rows) === null || _a === void 0 ? void 0 : _a.map((row, index$2) => {
|
|
60
65
|
var _a, _b, _c;
|
|
@@ -81,10 +86,15 @@ const DBTableFooter = class {
|
|
|
81
86
|
const attr = attributes.item(i);
|
|
82
87
|
if (attr && attr.name !== 'data-density' &&
|
|
83
88
|
(attr.name.startsWith("data-") || attr.name.startsWith("aria-"))) {
|
|
84
|
-
|
|
89
|
+
if (attr.value) {
|
|
90
|
+
element.setAttribute(attr.name, attr.value);
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
element.removeAttribute(attr.name);
|
|
94
|
+
}
|
|
85
95
|
parent.removeAttribute(attr.name);
|
|
86
96
|
}
|
|
87
|
-
else if (attr &&
|
|
97
|
+
else if (attr && ["style"].includes(attr.name)) {
|
|
88
98
|
element.setAttribute(attr.name, attr.value);
|
|
89
99
|
parent.removeAttribute(attr.name);
|
|
90
100
|
}
|
|
@@ -92,7 +102,7 @@ const DBTableFooter = class {
|
|
|
92
102
|
const isWebComponent = attr.value.includes("hydrated");
|
|
93
103
|
const value = attr.value.replace("hydrated", "").trim();
|
|
94
104
|
const currentClass = element.getAttribute("class");
|
|
95
|
-
element.setAttribute(attr.name, `${currentClass ?
|
|
105
|
+
element.setAttribute(attr.name, `${currentClass ? currentClass : ""}${value ? ` ${value}` : ""}`);
|
|
96
106
|
if (isWebComponent) {
|
|
97
107
|
// Stencil is using this class for lazy loading component
|
|
98
108
|
parent.setAttribute("class", "hydrated");
|
|
@@ -115,7 +125,7 @@ const DBTableFooter = class {
|
|
|
115
125
|
}
|
|
116
126
|
render() {
|
|
117
127
|
var _a;
|
|
118
|
-
return (index.h("tfoot", { key: '
|
|
128
|
+
return (index.h("tfoot", { key: '735f3ce4c1d6a3305993a8de60c797e9ce2bcd20', class: index$1.cls("db-table-footer", this.className), ref: (el) => {
|
|
119
129
|
this._ref = el;
|
|
120
130
|
}, id: this.id }, this.rows ? ((_a = this.rows) === null || _a === void 0 ? void 0 : _a.map((row, index$2) => {
|
|
121
131
|
var _a, _b, _c;
|
|
@@ -128,10 +138,31 @@ const DBTableFooter = class {
|
|
|
128
138
|
const DBTableHead = class {
|
|
129
139
|
constructor(hostRef) {
|
|
130
140
|
index.registerInstance(this, hostRef);
|
|
141
|
+
this.observer = undefined;
|
|
131
142
|
}
|
|
132
143
|
getCells(cells) {
|
|
133
144
|
return cells === null || cells === void 0 ? void 0 : cells.map((cell) => (Object.assign(Object.assign({}, cell), { headerCell: true })));
|
|
134
145
|
}
|
|
146
|
+
setupObserver(element) {
|
|
147
|
+
if (!element)
|
|
148
|
+
return;
|
|
149
|
+
const parent = element.closest("db-table-head");
|
|
150
|
+
if (!parent || this.observer)
|
|
151
|
+
return;
|
|
152
|
+
this.observer = new MutationObserver((mutations) => {
|
|
153
|
+
if (mutations.some((mutation) => {
|
|
154
|
+
var _a;
|
|
155
|
+
const attr = mutation.target.attributes.getNamedItem((_a = mutation.attributeName) !== null && _a !== void 0 ? _a : "");
|
|
156
|
+
return (attr === null || attr === void 0 ? void 0 : attr.value) !== mutation.oldValue;
|
|
157
|
+
})) {
|
|
158
|
+
this.enableAttributePassing(element, "db-table-head");
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
this.observer.observe(parent, {
|
|
162
|
+
attributes: true,
|
|
163
|
+
attributeOldValue: true,
|
|
164
|
+
});
|
|
165
|
+
}
|
|
135
166
|
/**
|
|
136
167
|
* Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.
|
|
137
168
|
* @param element the ref for the component
|
|
@@ -145,10 +176,15 @@ const DBTableHead = class {
|
|
|
145
176
|
const attr = attributes.item(i);
|
|
146
177
|
if (attr && attr.name !== 'data-density' &&
|
|
147
178
|
(attr.name.startsWith("data-") || attr.name.startsWith("aria-"))) {
|
|
148
|
-
|
|
179
|
+
if (attr.value) {
|
|
180
|
+
element.setAttribute(attr.name, attr.value);
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
element.removeAttribute(attr.name);
|
|
184
|
+
}
|
|
149
185
|
parent.removeAttribute(attr.name);
|
|
150
186
|
}
|
|
151
|
-
else if (attr &&
|
|
187
|
+
else if (attr && ["style"].includes(attr.name)) {
|
|
152
188
|
element.setAttribute(attr.name, attr.value);
|
|
153
189
|
parent.removeAttribute(attr.name);
|
|
154
190
|
}
|
|
@@ -156,7 +192,7 @@ const DBTableHead = class {
|
|
|
156
192
|
const isWebComponent = attr.value.includes("hydrated");
|
|
157
193
|
const value = attr.value.replace("hydrated", "").trim();
|
|
158
194
|
const currentClass = element.getAttribute("class");
|
|
159
|
-
element.setAttribute(attr.name, `${currentClass ?
|
|
195
|
+
element.setAttribute(attr.name, `${currentClass ? currentClass : ""}${value ? ` ${value}` : ""}`);
|
|
160
196
|
if (isWebComponent) {
|
|
161
197
|
// Stencil is using this class for lazy loading component
|
|
162
198
|
parent.setAttribute("class", "hydrated");
|
|
@@ -176,10 +212,15 @@ const DBTableHead = class {
|
|
|
176
212
|
}
|
|
177
213
|
}
|
|
178
214
|
this.enableAttributePassing(this._ref, "db-table-head");
|
|
215
|
+
this.setupObserver(this._ref);
|
|
216
|
+
}
|
|
217
|
+
disconnectedCallback() {
|
|
218
|
+
var _a;
|
|
219
|
+
(_a = this.observer) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
179
220
|
}
|
|
180
221
|
render() {
|
|
181
222
|
var _a;
|
|
182
|
-
return (index.h("thead", { key: '
|
|
223
|
+
return (index.h("thead", { key: '340673440fd36e5522f70683bef5a4356f73cb69', class: index$1.cls("db-table-head", this.className), ref: (el) => {
|
|
183
224
|
this._ref = el;
|
|
184
225
|
}, id: this.id }, this.rows ? ((_a = this.rows) === null || _a === void 0 ? void 0 : _a.map((row, index$2) => {
|
|
185
226
|
var _a, _b, _c;
|
|
@@ -6,6 +6,27 @@ var index$1 = require('./index-spuu3sXz.js');
|
|
|
6
6
|
const DBTableCaption = 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-table-caption");
|
|
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-table-caption");
|
|
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 DBTableCaption = 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 DBTableCaption = 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,11 +77,16 @@ const DBTableCaption = class {
|
|
|
51
77
|
}
|
|
52
78
|
}
|
|
53
79
|
this.enableAttributePassing(this._ref, "db-table-caption");
|
|
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
|
-
return (index.h("caption", { key: '
|
|
87
|
+
return (index.h("caption", { key: '5ef3476c6c9879f1fcf8548e11bea82516bd29d1', class: index$1.cls("db-table-caption", this.className), ref: (el) => {
|
|
57
88
|
this._ref = el;
|
|
58
|
-
}, id: this.id }, index.h("slot", { key: '
|
|
89
|
+
}, id: this.id }, index.h("slot", { key: 'e20d1d699e7ab50422c0d40bdf058c8863ae4991' })));
|
|
59
90
|
}
|
|
60
91
|
get rootElement() { return index.getElement(this); }
|
|
61
92
|
};
|
|
@@ -8,6 +8,7 @@ const DBTable = class {
|
|
|
8
8
|
index.registerInstance(this, hostRef);
|
|
9
9
|
this._data = undefined;
|
|
10
10
|
this._style = undefined;
|
|
11
|
+
this.observer = undefined;
|
|
11
12
|
}
|
|
12
13
|
convertData() {
|
|
13
14
|
try {
|
|
@@ -21,6 +22,26 @@ const DBTable = class {
|
|
|
21
22
|
}
|
|
22
23
|
return {};
|
|
23
24
|
}
|
|
25
|
+
setupObserver(element) {
|
|
26
|
+
if (!element)
|
|
27
|
+
return;
|
|
28
|
+
const parent = element.closest("db-table");
|
|
29
|
+
if (!parent || this.observer)
|
|
30
|
+
return;
|
|
31
|
+
this.observer = new MutationObserver((mutations) => {
|
|
32
|
+
if (mutations.some((mutation) => {
|
|
33
|
+
var _a;
|
|
34
|
+
const attr = mutation.target.attributes.getNamedItem((_a = mutation.attributeName) !== null && _a !== void 0 ? _a : "");
|
|
35
|
+
return (attr === null || attr === void 0 ? void 0 : attr.value) !== mutation.oldValue;
|
|
36
|
+
})) {
|
|
37
|
+
this.enableAttributePassing(element, "db-table");
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
this.observer.observe(parent, {
|
|
41
|
+
attributes: true,
|
|
42
|
+
attributeOldValue: true,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
24
45
|
/**
|
|
25
46
|
* Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.
|
|
26
47
|
* @param element the ref for the component
|
|
@@ -34,10 +55,15 @@ const DBTable = class {
|
|
|
34
55
|
const attr = attributes.item(i);
|
|
35
56
|
if (attr && attr.name !== 'data-density' &&
|
|
36
57
|
(attr.name.startsWith("data-") || attr.name.startsWith("aria-"))) {
|
|
37
|
-
|
|
58
|
+
if (attr.value) {
|
|
59
|
+
element.setAttribute(attr.name, attr.value);
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
element.removeAttribute(attr.name);
|
|
63
|
+
}
|
|
38
64
|
parent.removeAttribute(attr.name);
|
|
39
65
|
}
|
|
40
|
-
else if (attr &&
|
|
66
|
+
else if (attr && ["style"].includes(attr.name)) {
|
|
41
67
|
element.setAttribute(attr.name, attr.value);
|
|
42
68
|
parent.removeAttribute(attr.name);
|
|
43
69
|
}
|
|
@@ -45,7 +71,7 @@ const DBTable = class {
|
|
|
45
71
|
const isWebComponent = attr.value.includes("hydrated");
|
|
46
72
|
const value = attr.value.replace("hydrated", "").trim();
|
|
47
73
|
const currentClass = element.getAttribute("class");
|
|
48
|
-
element.setAttribute(attr.name, `${currentClass ?
|
|
74
|
+
element.setAttribute(attr.name, `${currentClass ? currentClass : ""}${value ? ` ${value}` : ""}`);
|
|
49
75
|
if (isWebComponent) {
|
|
50
76
|
// Stencil is using this class for lazy loading component
|
|
51
77
|
parent.setAttribute("class", "hydrated");
|
|
@@ -125,13 +151,18 @@ const DBTable = class {
|
|
|
125
151
|
}
|
|
126
152
|
}
|
|
127
153
|
this.enableAttributePassing(this._ref, "db-table");
|
|
154
|
+
this.setupObserver(this._ref);
|
|
128
155
|
this.watch0Fn();
|
|
129
156
|
this.watch1Fn();
|
|
130
157
|
this.watch2Fn();
|
|
131
158
|
}
|
|
159
|
+
disconnectedCallback() {
|
|
160
|
+
var _a;
|
|
161
|
+
(_a = this.observer) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
162
|
+
}
|
|
132
163
|
render() {
|
|
133
164
|
var _a, _b, _c, _d, _e, _f;
|
|
134
|
-
return (index.h("div", { key: '
|
|
165
|
+
return (index.h("div", { key: '7e6ea12b6cb4b2ddcc12262cd28bfec13baa55c0', class: index$1.cls("db-table", this.className), style: this._style, "data-width": this.width, "data-size": this.size, "data-divider": this.divider, "data-variant": this.variant, "data-mobile-variant": this.mobileVariant, "data-show-caption": index$1.getBooleanAsString(this.showCaption), "data-sticky-header": this.stickyHeader }, index.h("table", { key: '99fc11d1bb68297550e973293f519ad21f6953a0', ref: (el) => {
|
|
135
166
|
this._ref = el;
|
|
136
167
|
}, id: this.id }, this.captionPlain ? (index.h("caption", null, this.captionPlain)) : (index.h("slot", { name: "caption" })), this._data ? (index.h(index.Fragment, null, ((_a = this._data) === null || _a === void 0 ? void 0 : _a.header) ? (index.h("db-table-head", { rows: (_b = this._data) === null || _b === void 0 ? void 0 : _b.header })) : null, ((_c = this._data) === null || _c === void 0 ? void 0 : _c.body) ? (index.h("db-table-body", { rows: (_d = this._data) === null || _d === void 0 ? void 0 : _d.body })) : null, ((_e = this._data) === null || _e === void 0 ? void 0 : _e.footer) ? (index.h("db-table-footer", { rows: (_f = this._data) === null || _f === void 0 ? void 0 : _f.footer })) : null)) : (index.h("slot", null)))));
|
|
137
168
|
}
|