@db-ux/wc-core-components 4.5.4-mcp-e4cd7e6 → 4.5.4-table-c758ae7

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.
Files changed (221) hide show
  1. package/README.md +30 -0
  2. package/dist/cjs/db-accordion-item.cjs.entry.js +3 -3
  3. package/dist/cjs/db-accordion.cjs.entry.js +2 -2
  4. package/dist/cjs/db-badge.cjs.entry.js +2 -2
  5. package/dist/cjs/db-brand.cjs.entry.js +2 -2
  6. package/dist/cjs/db-button.cjs.entry.js +2 -2
  7. package/dist/cjs/db-card.cjs.entry.js +3 -3
  8. package/dist/cjs/db-checkbox.cjs.entry.js +3 -3
  9. package/dist/cjs/db-custom-button.cjs.entry.js +3 -3
  10. package/dist/cjs/db-custom-select-dropdown_5.cjs.entry.js +10 -10
  11. package/dist/cjs/db-custom-select-form-field.cjs.entry.js +3 -3
  12. package/dist/cjs/db-custom-select.cjs.entry.js +6 -6
  13. package/dist/cjs/db-divider.cjs.entry.js +2 -2
  14. package/dist/cjs/db-drawer.cjs.entry.js +4 -4
  15. package/dist/cjs/db-header.cjs.entry.js +3 -3
  16. package/dist/cjs/db-icon.cjs.entry.js +2 -2
  17. package/dist/cjs/db-infotext.cjs.entry.js +2 -2
  18. package/dist/cjs/db-link_4.cjs.entry.js +220 -0
  19. package/dist/cjs/db-navigation-item.cjs.entry.js +2 -2
  20. package/dist/cjs/db-navigation.cjs.entry.js +3 -3
  21. package/dist/cjs/db-notification.cjs.entry.js +3 -3
  22. package/dist/cjs/db-page.cjs.entry.js +3 -3
  23. package/dist/cjs/db-popover.cjs.entry.js +3 -3
  24. package/dist/cjs/db-radio.cjs.entry.js +2 -2
  25. package/dist/cjs/db-section.cjs.entry.js +3 -3
  26. package/dist/cjs/db-select.cjs.entry.js +3 -3
  27. package/dist/cjs/db-stack.cjs.entry.js +3 -3
  28. package/dist/cjs/db-switch.cjs.entry.js +3 -3
  29. package/dist/cjs/db-tab-item_3.cjs.entry.js +7 -7
  30. package/dist/cjs/db-table-body_3.cjs.entry.js +173 -0
  31. package/dist/cjs/{db-link.cjs.entry.js → db-table-caption.cjs.entry.js} +6 -7
  32. package/dist/cjs/db-table.cjs.entry.js +136 -0
  33. package/dist/cjs/db-tabs.cjs.entry.js +3 -3
  34. package/dist/cjs/db-textarea.cjs.entry.js +3 -3
  35. package/dist/cjs/db-tooltip.cjs.entry.js +3 -3
  36. package/dist/cjs/db-ux.cjs.js +2 -2
  37. package/dist/cjs/{index-EqJP9Qyt.js → index-CSakRmZZ.js} +21 -0
  38. package/dist/cjs/index.cjs.js +20 -1
  39. package/dist/cjs/loader.cjs.js +2 -2
  40. package/dist/collection/collection-manifest.json +9 -1
  41. package/dist/collection/components/accordion/accordion.js +1 -1
  42. package/dist/collection/components/accordion-item/accordion-item.js +2 -2
  43. package/dist/collection/components/badge/badge.js +1 -1
  44. package/dist/collection/components/brand/brand.js +2 -2
  45. package/dist/collection/components/button/button.js +4 -4
  46. package/dist/collection/components/card/card.js +2 -2
  47. package/dist/collection/components/checkbox/checkbox.js +3 -3
  48. package/dist/collection/components/custom-button/custom-button.js +5 -5
  49. package/dist/collection/components/custom-select/custom-select.js +7 -7
  50. package/dist/collection/components/custom-select-dropdown/custom-select-dropdown.js +2 -2
  51. package/dist/collection/components/custom-select-form-field/custom-select-form-field.js +2 -2
  52. package/dist/collection/components/custom-select-list/custom-select-list.js +2 -2
  53. package/dist/collection/components/custom-select-list-item/custom-select-list-item.js +2 -2
  54. package/dist/collection/components/divider/divider.js +1 -1
  55. package/dist/collection/components/drawer/drawer.js +3 -3
  56. package/dist/collection/components/header/header.js +2 -2
  57. package/dist/collection/components/icon/icon.js +2 -2
  58. package/dist/collection/components/infotext/infotext.js +2 -2
  59. package/dist/collection/components/input/input.js +6 -6
  60. package/dist/collection/components/link/link.js +1 -1
  61. package/dist/collection/components/navigation/navigation.js +2 -2
  62. package/dist/collection/components/navigation-item/navigation-item.js +2 -2
  63. package/dist/collection/components/notification/notification.js +3 -3
  64. package/dist/collection/components/page/page.js +2 -2
  65. package/dist/collection/components/popover/popover.js +2 -2
  66. package/dist/collection/components/radio/radio.js +1 -1
  67. package/dist/collection/components/section/section.js +2 -2
  68. package/dist/collection/components/select/select.js +4 -4
  69. package/dist/collection/components/stack/stack.js +2 -2
  70. package/dist/collection/components/switch/switch.js +6 -6
  71. package/dist/collection/components/tab-item/tab-item.js +5 -5
  72. package/dist/collection/components/tab-list/tab-list.js +2 -2
  73. package/dist/collection/components/tab-panel/tab-panel.js +2 -2
  74. package/dist/collection/components/table/examples/data.js +258 -0
  75. package/dist/collection/components/table/index.js +2 -0
  76. package/dist/collection/components/table/model.js +6 -0
  77. package/dist/collection/components/table/table.js +456 -0
  78. package/dist/collection/components/table-body/index.js +2 -0
  79. package/dist/collection/components/table-body/model.js +1 -0
  80. package/dist/collection/components/table-body/table-body.js +137 -0
  81. package/dist/collection/components/table-caption/index.js +2 -0
  82. package/dist/collection/components/table-caption/model.js +1 -0
  83. package/dist/collection/components/table-caption/table-caption.js +109 -0
  84. package/dist/collection/components/table-data-cell/index.js +2 -0
  85. package/dist/collection/components/table-data-cell/model.js +1 -0
  86. package/dist/collection/components/table-data-cell/table-data-cell.js +291 -0
  87. package/dist/collection/components/table-footer/index.js +2 -0
  88. package/dist/collection/components/table-footer/model.js +1 -0
  89. package/dist/collection/components/table-footer/table-footer.js +137 -0
  90. package/dist/collection/components/table-head/index.js +2 -0
  91. package/dist/collection/components/table-head/model.js +1 -0
  92. package/dist/collection/components/table-head/table-head.js +140 -0
  93. package/dist/collection/components/table-header-cell/index.js +2 -0
  94. package/dist/collection/components/table-header-cell/model.js +1 -0
  95. package/dist/collection/components/table-header-cell/table-header-cell.js +369 -0
  96. package/dist/collection/components/table-row/index.js +2 -0
  97. package/dist/collection/components/table-row/model.js +1 -0
  98. package/dist/collection/components/table-row/table-row.js +195 -0
  99. package/dist/collection/components/tabs/tabs.js +2 -2
  100. package/dist/collection/components/tag/tag.js +3 -3
  101. package/dist/collection/components/textarea/textarea.js +3 -3
  102. package/dist/collection/components/tooltip/tooltip.js +2 -2
  103. package/dist/collection/index.js +16 -0
  104. package/dist/collection/shared/model.js +1 -1
  105. package/dist/custom-elements.json +5671 -2660
  106. package/dist/db-ux/db-ux.esm.js +1 -1
  107. package/dist/db-ux/index.esm.js +1 -1
  108. package/dist/db-ux/{p-cdef6789.entry.js → p-003f3468.entry.js} +1 -1
  109. package/dist/db-ux/{p-516c3f64.entry.js → p-0055d6ce.entry.js} +1 -1
  110. package/dist/db-ux/{p-c7d1bee4.entry.js → p-032487d0.entry.js} +1 -1
  111. package/dist/db-ux/{p-83e69c0e.entry.js → p-10acdb01.entry.js} +1 -1
  112. package/dist/db-ux/{p-3ca07f53.entry.js → p-150c4aeb.entry.js} +1 -1
  113. package/dist/db-ux/{p-72d1ea3b.entry.js → p-19fe0672.entry.js} +1 -1
  114. package/dist/db-ux/p-2cdc1311.entry.js +1 -0
  115. package/dist/db-ux/p-33ca6422.entry.js +1 -0
  116. package/dist/db-ux/p-42e61221.entry.js +1 -0
  117. package/dist/db-ux/{p-fdbf8d91.entry.js → p-47bd992d.entry.js} +1 -1
  118. package/dist/db-ux/{p-fc9fb7cd.entry.js → p-50a16969.entry.js} +1 -1
  119. package/dist/db-ux/{p-aad2d524.entry.js → p-54d2e18d.entry.js} +1 -1
  120. package/dist/db-ux/{p-b99e76fd.entry.js → p-5e4de899.entry.js} +1 -1
  121. package/dist/db-ux/p-68a1d35a.entry.js +1 -0
  122. package/dist/db-ux/{p-56da8875.entry.js → p-6b87f6f1.entry.js} +1 -1
  123. package/dist/db-ux/{p-19ae6336.entry.js → p-7387346c.entry.js} +1 -1
  124. package/dist/db-ux/p-75005663.entry.js +1 -0
  125. package/dist/db-ux/{p-7f6fae6f.entry.js → p-77ee580e.entry.js} +1 -1
  126. package/dist/db-ux/{p-669fe992.entry.js → p-7da51a4c.entry.js} +1 -1
  127. package/dist/db-ux/p-7f2eaa8b.entry.js +1 -0
  128. package/dist/db-ux/{p-bd1b0142.entry.js → p-823a7488.entry.js} +1 -1
  129. package/dist/db-ux/p-8826c7fc.entry.js +1 -0
  130. package/dist/db-ux/{p-a0f6fc10.entry.js → p-8baf5ea2.entry.js} +1 -1
  131. package/dist/db-ux/{p-4f519859.entry.js → p-8f76eea7.entry.js} +1 -1
  132. package/dist/db-ux/p-97f5d48e.entry.js +1 -0
  133. package/dist/db-ux/p-LpjjuLKB.js +2 -0
  134. package/dist/db-ux/p-a8368ed2.entry.js +1 -0
  135. package/dist/db-ux/p-c0b8571d.entry.js +1 -0
  136. package/dist/db-ux/p-d20bd873.entry.js +1 -0
  137. package/dist/db-ux/{p-4a0870fa.entry.js → p-d603dcc4.entry.js} +1 -1
  138. package/dist/db-ux/{p-2c30a356.entry.js → p-dbdfc04a.entry.js} +1 -1
  139. package/dist/db-ux/{p-df2b1979.entry.js → p-e3279b61.entry.js} +1 -1
  140. package/dist/db-ux/{p-a726cd18.entry.js → p-e367150f.entry.js} +1 -1
  141. package/dist/db-ux/{p-f49ed233.entry.js → p-e9058123.entry.js} +1 -1
  142. package/dist/db-ux/p-e9142fec.entry.js +1 -0
  143. package/dist/esm/db-accordion-item.entry.js +3 -3
  144. package/dist/esm/db-accordion.entry.js +2 -2
  145. package/dist/esm/db-badge.entry.js +2 -2
  146. package/dist/esm/db-brand.entry.js +2 -2
  147. package/dist/esm/db-button.entry.js +2 -2
  148. package/dist/esm/db-card.entry.js +3 -3
  149. package/dist/esm/db-checkbox.entry.js +3 -3
  150. package/dist/esm/db-custom-button.entry.js +3 -3
  151. package/dist/esm/db-custom-select-dropdown_5.entry.js +10 -10
  152. package/dist/esm/db-custom-select-form-field.entry.js +3 -3
  153. package/dist/esm/db-custom-select.entry.js +6 -6
  154. package/dist/esm/db-divider.entry.js +2 -2
  155. package/dist/esm/db-drawer.entry.js +4 -4
  156. package/dist/esm/db-header.entry.js +3 -3
  157. package/dist/esm/db-icon.entry.js +2 -2
  158. package/dist/esm/db-infotext.entry.js +2 -2
  159. package/dist/esm/db-link_4.entry.js +215 -0
  160. package/dist/esm/db-navigation-item.entry.js +2 -2
  161. package/dist/esm/db-navigation.entry.js +3 -3
  162. package/dist/esm/db-notification.entry.js +3 -3
  163. package/dist/esm/db-page.entry.js +3 -3
  164. package/dist/esm/db-popover.entry.js +3 -3
  165. package/dist/esm/db-radio.entry.js +2 -2
  166. package/dist/esm/db-section.entry.js +3 -3
  167. package/dist/esm/db-select.entry.js +3 -3
  168. package/dist/esm/db-stack.entry.js +3 -3
  169. package/dist/esm/db-switch.entry.js +3 -3
  170. package/dist/esm/db-tab-item_3.entry.js +7 -7
  171. package/dist/esm/db-table-body_3.entry.js +169 -0
  172. package/dist/esm/{db-link.entry.js → db-table-caption.entry.js} +7 -8
  173. package/dist/esm/db-table.entry.js +134 -0
  174. package/dist/esm/db-tabs.entry.js +3 -3
  175. package/dist/esm/db-textarea.entry.js +3 -3
  176. package/dist/esm/db-tooltip.entry.js +3 -3
  177. package/dist/esm/db-ux.js +3 -3
  178. package/dist/esm/{index-kHKR5QG5.js → index-LpjjuLKB.js} +21 -0
  179. package/dist/esm/index.js +13 -2
  180. package/dist/esm/loader.js +3 -3
  181. package/dist/types/components/table/examples/data.d.ts +9 -0
  182. package/dist/types/components/table/index.d.ts +2 -0
  183. package/dist/types/components/table/model.d.ts +74 -0
  184. package/dist/types/components/table/table.d.ts +37 -0
  185. package/dist/types/components/table-body/index.d.ts +2 -0
  186. package/dist/types/components/table-body/model.d.ts +8 -0
  187. package/dist/types/components/table-body/table-body.d.ts +19 -0
  188. package/dist/types/components/table-caption/index.d.ts +2 -0
  189. package/dist/types/components/table-caption/model.d.ts +5 -0
  190. package/dist/types/components/table-caption/table-caption.d.ts +18 -0
  191. package/dist/types/components/table-data-cell/index.d.ts +2 -0
  192. package/dist/types/components/table-data-cell/model.d.ts +5 -0
  193. package/dist/types/components/table-data-cell/table-data-cell.d.ts +25 -0
  194. package/dist/types/components/table-footer/index.d.ts +2 -0
  195. package/dist/types/components/table-footer/model.d.ts +8 -0
  196. package/dist/types/components/table-footer/table-footer.d.ts +19 -0
  197. package/dist/types/components/table-head/index.d.ts +2 -0
  198. package/dist/types/components/table-head/model.d.ts +10 -0
  199. package/dist/types/components/table-head/table-head.d.ts +58 -0
  200. package/dist/types/components/table-header-cell/index.d.ts +2 -0
  201. package/dist/types/components/table-header-cell/model.d.ts +24 -0
  202. package/dist/types/components/table-header-cell/table-header-cell.d.ts +28 -0
  203. package/dist/types/components/table-row/index.d.ts +2 -0
  204. package/dist/types/components/table-row/model.d.ts +30 -0
  205. package/dist/types/components/table-row/table-row.d.ts +23 -0
  206. package/dist/types/components.d.ts +278 -0
  207. package/dist/types/index.d.ts +16 -0
  208. package/dist/types/shared/model.d.ts +42 -2
  209. package/dist/vscode.html-custom-data.json +400 -2
  210. package/dist/web-types.json +692 -4
  211. package/package.json +3 -3
  212. package/dist/db-ux/p-05e9aa2e.entry.js +0 -1
  213. package/dist/db-ux/p-2ed98454.entry.js +0 -1
  214. package/dist/db-ux/p-33443732.entry.js +0 -1
  215. package/dist/db-ux/p-58c6c29d.entry.js +0 -1
  216. package/dist/db-ux/p-85897212.entry.js +0 -1
  217. package/dist/db-ux/p-8a521b05.entry.js +0 -1
  218. package/dist/db-ux/p-974fbc69.entry.js +0 -1
  219. package/dist/db-ux/p-a3aef74b.entry.js +0 -1
  220. package/dist/db-ux/p-cb093137.entry.js +0 -1
  221. package/dist/db-ux/p-kHKR5QG5.js +0 -2
@@ -0,0 +1,456 @@
1
+ import { cls, delay, getBooleanAsString } from "../../utils";
2
+ import { h, Fragment } from "@stencil/core";
3
+ /**
4
+ * @slot children - This is a default/unnamed slot
5
+ * @slot caption - TODO: Add description for slotCaption
6
+ */
7
+ export class DBTable {
8
+ constructor() {
9
+ this._data = undefined;
10
+ this._style = undefined;
11
+ }
12
+ convertData() {
13
+ try {
14
+ if (typeof this.data === "string") {
15
+ return JSON.parse(this.data);
16
+ }
17
+ return this.data;
18
+ }
19
+ catch (error) {
20
+ console.error(error);
21
+ }
22
+ return {};
23
+ }
24
+ /**
25
+ * Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.
26
+ * @param element the ref for the component
27
+ * @param customElementSelector the custom element like `my-component`
28
+ */
29
+ enableAttributePassing(element, customElementSelector) {
30
+ const parent = element === null || element === void 0 ? void 0 : element.closest(customElementSelector);
31
+ if (element && parent) {
32
+ const attributes = parent.attributes;
33
+ for (let i = 0; i < attributes.length; i++) {
34
+ const attr = attributes.item(i);
35
+ if (attr && attr.name !== 'data-density' &&
36
+ (attr.name.startsWith("data-") || attr.name.startsWith("aria-"))) {
37
+ element.setAttribute(attr.name, attr.value);
38
+ parent.removeAttribute(attr.name);
39
+ }
40
+ else if (attr && attr.name !== 'data-density' && attr.name !== "class" && attr.name === "style") {
41
+ element.setAttribute(attr.name, attr.value);
42
+ parent.removeAttribute(attr.name);
43
+ }
44
+ else if (attr && attr.name === "class") {
45
+ const isWebComponent = attr.value.includes("hydrated");
46
+ const value = attr.value.replace("hydrated", "").trim();
47
+ const currentClass = element.getAttribute("class");
48
+ element.setAttribute(attr.name, `${currentClass ? `${currentClass} ` : ""}${value}`);
49
+ if (isWebComponent) {
50
+ // Stencil is using this class for lazy loading component
51
+ parent.setAttribute("class", "hydrated");
52
+ }
53
+ else {
54
+ parent.removeAttribute(attr.name);
55
+ }
56
+ }
57
+ }
58
+ }
59
+ }
60
+ watch0Fn() {
61
+ if (this.data) {
62
+ this._data = this.convertData();
63
+ }
64
+ }
65
+ watch0() {
66
+ this.watch0Fn();
67
+ }
68
+ watch1Fn() {
69
+ if (this._ref && this.mobileVariant === "list") {
70
+ // Delay for angular
71
+ void delay(() => {
72
+ const table = this._ref;
73
+ if (!table)
74
+ return;
75
+ const headerCells = table.querySelectorAll("thead tr th");
76
+ if (headerCells.length) {
77
+ const otherRows = table.querySelectorAll(":is(tbody,tfoot) tr");
78
+ otherRows.forEach((row) => {
79
+ const cells = row.querySelectorAll(":is(td,th)");
80
+ cells.forEach((cell, index) => {
81
+ const headerCell = headerCells[index];
82
+ if (headerCell &&
83
+ headerCell.textContent &&
84
+ !cell.dataset["header"]) {
85
+ cell.dataset["header"] = headerCell.textContent.trim();
86
+ }
87
+ });
88
+ });
89
+ }
90
+ }, 1);
91
+ }
92
+ }
93
+ watch1() {
94
+ this.watch1Fn();
95
+ }
96
+ watch2Fn() {
97
+ if (this.columnSizes) {
98
+ const columnStyles = {};
99
+ Object.entries(this.columnSizes).forEach(([key, value]) => {
100
+ columnStyles[`--db-table-column-size-${key}`] = value;
101
+ });
102
+ this._style = columnStyles;
103
+ }
104
+ }
105
+ watch2() {
106
+ this.watch2Fn();
107
+ }
108
+ componentDidLoad() {
109
+ this.enableAttributePassing(this._ref, "db-table");
110
+ this.watch0Fn();
111
+ this.watch1Fn();
112
+ this.watch2Fn();
113
+ }
114
+ render() {
115
+ var _a, _b, _c, _d, _e, _f;
116
+ return (h("div", { key: 'f64631aec68b83467db063e5e0923144743bce72', class: 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": getBooleanAsString(this.showCaption), "data-sticky-header": this.stickyHeader }, h("table", { key: '6cce6265d3907c99c333d8c4d209493548f22b36', ref: (el) => {
117
+ this._ref = el;
118
+ }, id: this.id }, h("caption", { key: '3ad5a7a85bd195180b842b39a5b2aeaebdd3bee7' }, this.captionPlain ? (this.captionPlain) : (h("slot", { name: "caption" }))), this._data ? (h(Fragment, null, ((_a = this._data) === null || _a === void 0 ? void 0 : _a.header) ? (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) ? (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) ? (h("db-table-footer", { rows: (_f = this._data) === null || _f === void 0 ? void 0 : _f.footer })) : null)) : (h("slot", null)))));
119
+ }
120
+ static get is() { return "db-table"; }
121
+ static get properties() {
122
+ return {
123
+ "data": {
124
+ "type": "string",
125
+ "mutable": false,
126
+ "complexType": {
127
+ "original": "DBTableProps[\"data\"]",
128
+ "resolved": "string | { header?: DBTableRowDefaultProps[]; body?: DBTableRowDefaultProps[]; footer?: DBTableRowDefaultProps[]; }",
129
+ "references": {
130
+ "DBTableProps": {
131
+ "location": "import",
132
+ "path": "./model",
133
+ "id": "src/components/table/model.ts::DBTableProps",
134
+ "referenceLocation": "DBTableProps"
135
+ }
136
+ }
137
+ },
138
+ "required": false,
139
+ "optional": false,
140
+ "docs": {
141
+ "tags": [],
142
+ "text": ""
143
+ },
144
+ "getter": false,
145
+ "setter": false,
146
+ "reflect": false,
147
+ "attribute": "data"
148
+ },
149
+ "mobileVariant": {
150
+ "type": "string",
151
+ "mutable": false,
152
+ "complexType": {
153
+ "original": "DBTableProps[\"mobileVariant\"]",
154
+ "resolved": "\"list\" | \"table\"",
155
+ "references": {
156
+ "DBTableProps": {
157
+ "location": "import",
158
+ "path": "./model",
159
+ "id": "src/components/table/model.ts::DBTableProps",
160
+ "referenceLocation": "DBTableProps"
161
+ }
162
+ }
163
+ },
164
+ "required": false,
165
+ "optional": false,
166
+ "docs": {
167
+ "tags": [],
168
+ "text": ""
169
+ },
170
+ "getter": false,
171
+ "setter": false,
172
+ "reflect": false,
173
+ "attribute": "mobile-variant"
174
+ },
175
+ "columnSizes": {
176
+ "type": "unknown",
177
+ "mutable": false,
178
+ "complexType": {
179
+ "original": "DBTableProps[\"columnSizes\"]",
180
+ "resolved": "number | string",
181
+ "references": {
182
+ "DBTableProps": {
183
+ "location": "import",
184
+ "path": "./model",
185
+ "id": "src/components/table/model.ts::DBTableProps",
186
+ "referenceLocation": "DBTableProps"
187
+ }
188
+ }
189
+ },
190
+ "required": false,
191
+ "optional": false,
192
+ "docs": {
193
+ "tags": [],
194
+ "text": ""
195
+ },
196
+ "getter": false,
197
+ "setter": false
198
+ },
199
+ "className": {
200
+ "type": "string",
201
+ "mutable": false,
202
+ "complexType": {
203
+ "original": "DBTableProps[\"className\"]",
204
+ "resolved": "string",
205
+ "references": {
206
+ "DBTableProps": {
207
+ "location": "import",
208
+ "path": "./model",
209
+ "id": "src/components/table/model.ts::DBTableProps",
210
+ "referenceLocation": "DBTableProps"
211
+ }
212
+ }
213
+ },
214
+ "required": false,
215
+ "optional": false,
216
+ "docs": {
217
+ "tags": [],
218
+ "text": ""
219
+ },
220
+ "getter": false,
221
+ "setter": false,
222
+ "reflect": false,
223
+ "attribute": "classname"
224
+ },
225
+ "width": {
226
+ "type": "string",
227
+ "mutable": false,
228
+ "complexType": {
229
+ "original": "DBTableProps[\"width\"]",
230
+ "resolved": "string",
231
+ "references": {
232
+ "DBTableProps": {
233
+ "location": "import",
234
+ "path": "./model",
235
+ "id": "src/components/table/model.ts::DBTableProps",
236
+ "referenceLocation": "DBTableProps"
237
+ }
238
+ }
239
+ },
240
+ "required": false,
241
+ "optional": false,
242
+ "docs": {
243
+ "tags": [],
244
+ "text": ""
245
+ },
246
+ "getter": false,
247
+ "setter": false,
248
+ "reflect": false,
249
+ "attribute": "width"
250
+ },
251
+ "size": {
252
+ "type": "string",
253
+ "mutable": false,
254
+ "complexType": {
255
+ "original": "DBTableProps[\"size\"]",
256
+ "resolved": "\"large\" | \"medium\" | \"small\" | \"x-small\"",
257
+ "references": {
258
+ "DBTableProps": {
259
+ "location": "import",
260
+ "path": "./model",
261
+ "id": "src/components/table/model.ts::DBTableProps",
262
+ "referenceLocation": "DBTableProps"
263
+ }
264
+ }
265
+ },
266
+ "required": false,
267
+ "optional": false,
268
+ "docs": {
269
+ "tags": [],
270
+ "text": ""
271
+ },
272
+ "getter": false,
273
+ "setter": false,
274
+ "reflect": false,
275
+ "attribute": "size"
276
+ },
277
+ "divider": {
278
+ "type": "string",
279
+ "mutable": false,
280
+ "complexType": {
281
+ "original": "DBTableProps[\"divider\"]",
282
+ "resolved": "\"both\" | \"horizontal\" | \"none\" | \"vertical\"",
283
+ "references": {
284
+ "DBTableProps": {
285
+ "location": "import",
286
+ "path": "./model",
287
+ "id": "src/components/table/model.ts::DBTableProps",
288
+ "referenceLocation": "DBTableProps"
289
+ }
290
+ }
291
+ },
292
+ "required": false,
293
+ "optional": false,
294
+ "docs": {
295
+ "tags": [],
296
+ "text": ""
297
+ },
298
+ "getter": false,
299
+ "setter": false,
300
+ "reflect": false,
301
+ "attribute": "divider"
302
+ },
303
+ "variant": {
304
+ "type": "string",
305
+ "mutable": false,
306
+ "complexType": {
307
+ "original": "DBTableProps[\"variant\"]",
308
+ "resolved": "\"floating\" | \"joined\" | \"zebra\"",
309
+ "references": {
310
+ "DBTableProps": {
311
+ "location": "import",
312
+ "path": "./model",
313
+ "id": "src/components/table/model.ts::DBTableProps",
314
+ "referenceLocation": "DBTableProps"
315
+ }
316
+ }
317
+ },
318
+ "required": false,
319
+ "optional": false,
320
+ "docs": {
321
+ "tags": [],
322
+ "text": ""
323
+ },
324
+ "getter": false,
325
+ "setter": false,
326
+ "reflect": false,
327
+ "attribute": "variant"
328
+ },
329
+ "showCaption": {
330
+ "type": "any",
331
+ "mutable": false,
332
+ "complexType": {
333
+ "original": "DBTableProps[\"showCaption\"]",
334
+ "resolved": "boolean | string",
335
+ "references": {
336
+ "DBTableProps": {
337
+ "location": "import",
338
+ "path": "./model",
339
+ "id": "src/components/table/model.ts::DBTableProps",
340
+ "referenceLocation": "DBTableProps"
341
+ }
342
+ }
343
+ },
344
+ "required": false,
345
+ "optional": false,
346
+ "docs": {
347
+ "tags": [],
348
+ "text": ""
349
+ },
350
+ "getter": false,
351
+ "setter": false,
352
+ "reflect": false,
353
+ "attribute": "show-caption"
354
+ },
355
+ "stickyHeader": {
356
+ "type": "string",
357
+ "mutable": false,
358
+ "complexType": {
359
+ "original": "DBTableProps[\"stickyHeader\"]",
360
+ "resolved": "\"both\" | \"horizontal\" | \"none\" | \"vertical\"",
361
+ "references": {
362
+ "DBTableProps": {
363
+ "location": "import",
364
+ "path": "./model",
365
+ "id": "src/components/table/model.ts::DBTableProps",
366
+ "referenceLocation": "DBTableProps"
367
+ }
368
+ }
369
+ },
370
+ "required": false,
371
+ "optional": false,
372
+ "docs": {
373
+ "tags": [],
374
+ "text": ""
375
+ },
376
+ "getter": false,
377
+ "setter": false,
378
+ "reflect": false,
379
+ "attribute": "sticky-header"
380
+ },
381
+ "id": {
382
+ "type": "string",
383
+ "mutable": false,
384
+ "complexType": {
385
+ "original": "DBTableProps[\"id\"]",
386
+ "resolved": "string",
387
+ "references": {
388
+ "DBTableProps": {
389
+ "location": "import",
390
+ "path": "./model",
391
+ "id": "src/components/table/model.ts::DBTableProps",
392
+ "referenceLocation": "DBTableProps"
393
+ }
394
+ }
395
+ },
396
+ "required": false,
397
+ "optional": false,
398
+ "docs": {
399
+ "tags": [],
400
+ "text": ""
401
+ },
402
+ "getter": false,
403
+ "setter": false,
404
+ "reflect": false,
405
+ "attribute": "id"
406
+ },
407
+ "captionPlain": {
408
+ "type": "string",
409
+ "mutable": false,
410
+ "complexType": {
411
+ "original": "DBTableProps[\"captionPlain\"]",
412
+ "resolved": "string",
413
+ "references": {
414
+ "DBTableProps": {
415
+ "location": "import",
416
+ "path": "./model",
417
+ "id": "src/components/table/model.ts::DBTableProps",
418
+ "referenceLocation": "DBTableProps"
419
+ }
420
+ }
421
+ },
422
+ "required": false,
423
+ "optional": false,
424
+ "docs": {
425
+ "tags": [],
426
+ "text": ""
427
+ },
428
+ "getter": false,
429
+ "setter": false,
430
+ "reflect": false,
431
+ "attribute": "caption-plain"
432
+ }
433
+ };
434
+ }
435
+ static get states() {
436
+ return {
437
+ "_data": {},
438
+ "_style": {}
439
+ };
440
+ }
441
+ static get watchers() {
442
+ return [{
443
+ "propName": "data",
444
+ "methodName": "watch0"
445
+ }, {
446
+ "propName": "mobileVariant",
447
+ "methodName": "watch1"
448
+ }, {
449
+ "propName": "_ref",
450
+ "methodName": "watch1"
451
+ }, {
452
+ "propName": "columnSizes",
453
+ "methodName": "watch2"
454
+ }];
455
+ }
456
+ }
@@ -0,0 +1,2 @@
1
+ import { DBTableBody } from "./table-body";
2
+ export default DBTableBody;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,137 @@
1
+ import { cls, uuid } from "../../utils";
2
+ import { h } from "@stencil/core";
3
+ /**
4
+ * @slot children - This is a default/unnamed slot
5
+
6
+ */
7
+ export class DBTableBody {
8
+ /**
9
+ * Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.
10
+ * @param element the ref for the component
11
+ * @param customElementSelector the custom element like `my-component`
12
+ */
13
+ enableAttributePassing(element, customElementSelector) {
14
+ const parent = element === null || element === void 0 ? void 0 : element.closest(customElementSelector);
15
+ if (element && parent) {
16
+ const attributes = parent.attributes;
17
+ for (let i = 0; i < attributes.length; i++) {
18
+ const attr = attributes.item(i);
19
+ if (attr && attr.name !== 'data-density' &&
20
+ (attr.name.startsWith("data-") || attr.name.startsWith("aria-"))) {
21
+ element.setAttribute(attr.name, attr.value);
22
+ parent.removeAttribute(attr.name);
23
+ }
24
+ else if (attr && attr.name !== 'data-density' && attr.name !== "class" && attr.name === "style") {
25
+ element.setAttribute(attr.name, attr.value);
26
+ parent.removeAttribute(attr.name);
27
+ }
28
+ else if (attr && attr.name === "class") {
29
+ const isWebComponent = attr.value.includes("hydrated");
30
+ const value = attr.value.replace("hydrated", "").trim();
31
+ const currentClass = element.getAttribute("class");
32
+ element.setAttribute(attr.name, `${currentClass ? `${currentClass} ` : ""}${value}`);
33
+ if (isWebComponent) {
34
+ // Stencil is using this class for lazy loading component
35
+ parent.setAttribute("class", "hydrated");
36
+ }
37
+ else {
38
+ parent.removeAttribute(attr.name);
39
+ }
40
+ }
41
+ }
42
+ }
43
+ }
44
+ componentDidLoad() {
45
+ this.enableAttributePassing(this._ref, "db-table-body");
46
+ }
47
+ render() {
48
+ var _a;
49
+ return (h("tbody", { key: 'f32625da9123926d08a779f2b04f907249153f8b', class: cls("db-table-body", this.className), ref: (el) => {
50
+ this._ref = el;
51
+ }, id: this.id }, this.rows ? ((_a = this.rows) === null || _a === void 0 ? void 0 : _a.map((row, index) => {
52
+ var _a, _b;
53
+ return (h("db-table-row", { class: (_a = row.className) !== null && _a !== void 0 ? _a : row.class, key: `${(_b = this.id) !== null && _b !== void 0 ? _b : uuid()}-table-body-row-${index}`, cells: row.cells, id: row.id }));
54
+ })) : (h("slot", null))));
55
+ }
56
+ static get is() { return "db-table-body"; }
57
+ static get properties() {
58
+ return {
59
+ "id": {
60
+ "type": "string",
61
+ "mutable": false,
62
+ "complexType": {
63
+ "original": "DBTableBodyProps[\"id\"]",
64
+ "resolved": "string",
65
+ "references": {
66
+ "DBTableBodyProps": {
67
+ "location": "import",
68
+ "path": "./model",
69
+ "id": "src/components/table-body/model.ts::DBTableBodyProps",
70
+ "referenceLocation": "DBTableBodyProps"
71
+ }
72
+ }
73
+ },
74
+ "required": false,
75
+ "optional": false,
76
+ "docs": {
77
+ "tags": [],
78
+ "text": ""
79
+ },
80
+ "getter": false,
81
+ "setter": false,
82
+ "reflect": false,
83
+ "attribute": "id"
84
+ },
85
+ "className": {
86
+ "type": "string",
87
+ "mutable": false,
88
+ "complexType": {
89
+ "original": "DBTableBodyProps[\"className\"]",
90
+ "resolved": "string",
91
+ "references": {
92
+ "DBTableBodyProps": {
93
+ "location": "import",
94
+ "path": "./model",
95
+ "id": "src/components/table-body/model.ts::DBTableBodyProps",
96
+ "referenceLocation": "DBTableBodyProps"
97
+ }
98
+ }
99
+ },
100
+ "required": false,
101
+ "optional": false,
102
+ "docs": {
103
+ "tags": [],
104
+ "text": ""
105
+ },
106
+ "getter": false,
107
+ "setter": false,
108
+ "reflect": false,
109
+ "attribute": "classname"
110
+ },
111
+ "rows": {
112
+ "type": "unknown",
113
+ "mutable": false,
114
+ "complexType": {
115
+ "original": "DBTableBodyProps[\"rows\"]",
116
+ "resolved": "DBTableRowProps[]",
117
+ "references": {
118
+ "DBTableBodyProps": {
119
+ "location": "import",
120
+ "path": "./model",
121
+ "id": "src/components/table-body/model.ts::DBTableBodyProps",
122
+ "referenceLocation": "DBTableBodyProps"
123
+ }
124
+ }
125
+ },
126
+ "required": false,
127
+ "optional": false,
128
+ "docs": {
129
+ "tags": [],
130
+ "text": ""
131
+ },
132
+ "getter": false,
133
+ "setter": false
134
+ }
135
+ };
136
+ }
137
+ }
@@ -0,0 +1,2 @@
1
+ import { DBTableCaption } from "./table-caption";
2
+ export default DBTableCaption;
@@ -0,0 +1 @@
1
+ export {};