@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.
Files changed (316) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/bundle/db-accordion-item.js +1 -1
  3. package/bundle/db-accordion.js +1 -1
  4. package/bundle/db-badge.js +1 -1
  5. package/bundle/db-brand.js +1 -1
  6. package/bundle/db-button.js +1 -1
  7. package/bundle/db-card.js +1 -1
  8. package/bundle/db-checkbox.js +1 -1
  9. package/bundle/db-custom-button.js +1 -1
  10. package/bundle/db-custom-select-dropdown.js +1 -1
  11. package/bundle/db-custom-select-form-field.js +1 -1
  12. package/bundle/db-custom-select-list-item.js +1 -1
  13. package/bundle/db-custom-select-list.js +1 -1
  14. package/bundle/db-custom-select.js +1 -1
  15. package/bundle/db-divider.js +1 -1
  16. package/bundle/db-drawer.js +1 -1
  17. package/bundle/db-header.js +1 -1
  18. package/bundle/db-icon.js +1 -1
  19. package/bundle/db-infotext.js +1 -1
  20. package/bundle/db-input.js +1 -1
  21. package/bundle/db-link.js +1 -1
  22. package/bundle/db-navigation-item.js +1 -1
  23. package/bundle/db-navigation.js +1 -1
  24. package/bundle/db-notification.js +1 -1
  25. package/bundle/db-page.js +1 -1
  26. package/bundle/db-popover.js +1 -1
  27. package/bundle/db-radio.js +1 -1
  28. package/bundle/db-section.js +1 -1
  29. package/bundle/db-select.js +1 -1
  30. package/bundle/db-stack.js +1 -1
  31. package/bundle/db-switch.js +1 -1
  32. package/bundle/db-tab-item.js +1 -1
  33. package/bundle/db-tab-list.js +1 -1
  34. package/bundle/db-tab-panel.js +1 -1
  35. package/bundle/db-table-body.js +1 -1
  36. package/bundle/db-table-caption.js +1 -1
  37. package/bundle/db-table-data-cell.js +1 -1
  38. package/bundle/db-table-footer.js +1 -1
  39. package/bundle/db-table-head.js +1 -1
  40. package/bundle/db-table-header-cell.js +1 -1
  41. package/bundle/db-table-row.js +1 -1
  42. package/bundle/db-table.js +1 -1
  43. package/bundle/db-tabs.js +1 -1
  44. package/bundle/db-tag.js +1 -1
  45. package/bundle/db-textarea.js +1 -1
  46. package/bundle/db-tooltip.js +1 -1
  47. package/bundle/p-3Da4lo5j.js +1 -0
  48. package/bundle/p-BEcb3EOO.js +1 -0
  49. package/bundle/p-BEolc6Da.js +1 -0
  50. package/bundle/p-BekmqY3B.js +1 -0
  51. package/bundle/p-BmRO4X-P.js +1 -0
  52. package/bundle/p-BrQIYm5N.js +1 -0
  53. package/bundle/p-BxZ0zFXf.js +1 -0
  54. package/bundle/p-C2viXF7U.js +1 -0
  55. package/bundle/p-C4iD-won.js +1 -0
  56. package/bundle/p-CHg_VPD9.js +1 -0
  57. package/bundle/p-CZ9SsTOA.js +1 -0
  58. package/bundle/p-CewqZGHg.js +1 -0
  59. package/bundle/p-CotiEHZi.js +1 -0
  60. package/bundle/p-D1orcIJf.js +1 -0
  61. package/bundle/p-D9RSX1St.js +1 -0
  62. package/bundle/p-DbgzEek1.js +1 -0
  63. package/bundle/p-DqNXsduK.js +1 -0
  64. package/bundle/p-Duacd-NX.js +1 -0
  65. package/bundle/p-k5Hci0ok.js +1 -0
  66. package/bundle/p-mk64Fltq.js +1 -0
  67. package/dist/cjs/db-accordion-item.cjs.entry.js +46 -9
  68. package/dist/cjs/db-accordion.cjs.entry.js +43 -6
  69. package/dist/cjs/db-badge.cjs.entry.js +43 -6
  70. package/dist/cjs/db-brand.cjs.entry.js +36 -5
  71. package/dist/cjs/db-button.cjs.entry.js +36 -5
  72. package/dist/cjs/db-card.cjs.entry.js +36 -5
  73. package/dist/cjs/db-checkbox.cjs.entry.js +45 -11
  74. package/dist/cjs/db-custom-button.cjs.entry.js +36 -5
  75. package/dist/cjs/db-custom-select-dropdown_5.cjs.entry.js +190 -31
  76. package/dist/cjs/db-custom-select-form-field.cjs.entry.js +36 -5
  77. package/dist/cjs/db-custom-select.cjs.entry.js +60 -26
  78. package/dist/cjs/db-divider.cjs.entry.js +35 -4
  79. package/dist/cjs/db-drawer.cjs.entry.js +45 -8
  80. package/dist/cjs/db-header.cjs.entry.js +43 -6
  81. package/dist/cjs/db-icon.cjs.entry.js +36 -5
  82. package/dist/cjs/db-infotext.cjs.entry.js +36 -5
  83. package/dist/cjs/db-link_4.cjs.entry.js +65 -19
  84. package/dist/cjs/db-navigation-item.cjs.entry.js +46 -9
  85. package/dist/cjs/db-navigation.cjs.entry.js +36 -5
  86. package/dist/cjs/db-notification.cjs.entry.js +36 -5
  87. package/dist/cjs/db-page.cjs.entry.js +48 -13
  88. package/dist/cjs/db-popover.cjs.entry.js +43 -6
  89. package/dist/cjs/db-radio.cjs.entry.js +42 -8
  90. package/dist/cjs/db-section.cjs.entry.js +36 -5
  91. package/dist/cjs/db-select.cjs.entry.js +45 -11
  92. package/dist/cjs/db-stack.cjs.entry.js +36 -5
  93. package/dist/cjs/db-switch.cjs.entry.js +45 -11
  94. package/dist/cjs/db-tab-item_3.cjs.entry.js +118 -19
  95. package/dist/cjs/db-table-body_3.cjs.entry.js +53 -12
  96. package/dist/cjs/db-table-caption.cjs.entry.js +36 -5
  97. package/dist/cjs/db-table.cjs.entry.js +35 -4
  98. package/dist/cjs/db-tabs.cjs.entry.js +42 -8
  99. package/dist/cjs/db-textarea.cjs.entry.js +45 -10
  100. package/dist/cjs/db-tooltip.cjs.entry.js +144 -20
  101. package/dist/cjs/db-ux.cjs.js +1 -1
  102. package/dist/cjs/loader.cjs.js +1 -1
  103. package/dist/collection/components/accordion/accordion.js +45 -7
  104. package/dist/collection/components/accordion-item/accordion-item.js +48 -10
  105. package/dist/collection/components/badge/badge.js +45 -7
  106. package/dist/collection/components/brand/brand.js +43 -5
  107. package/dist/collection/components/button/button.js +43 -5
  108. package/dist/collection/components/card/card.js +43 -5
  109. package/dist/collection/components/checkbox/checkbox.js +47 -12
  110. package/dist/collection/components/custom-button/custom-button.js +43 -5
  111. package/dist/collection/components/custom-select/custom-select.js +62 -27
  112. package/dist/collection/components/custom-select-dropdown/custom-select-dropdown.js +41 -5
  113. package/dist/collection/components/custom-select-form-field/custom-select-form-field.js +43 -5
  114. package/dist/collection/components/custom-select-list/custom-select-list.js +43 -5
  115. package/dist/collection/components/custom-select-list-item/custom-select-list-item.js +37 -5
  116. package/dist/collection/components/divider/divider.js +42 -4
  117. package/dist/collection/components/drawer/drawer.js +47 -9
  118. package/dist/collection/components/header/header.js +45 -7
  119. package/dist/collection/components/icon/icon.js +43 -5
  120. package/dist/collection/components/infotext/infotext.js +43 -5
  121. package/dist/collection/components/input/input.js +49 -13
  122. package/dist/collection/components/link/link.js +43 -5
  123. package/dist/collection/components/navigation/navigation.js +43 -5
  124. package/dist/collection/components/navigation-item/navigation-item.js +48 -10
  125. package/dist/collection/components/notification/notification.js +43 -5
  126. package/dist/collection/components/page/page.js +50 -14
  127. package/dist/collection/components/popover/popover.js +45 -7
  128. package/dist/collection/components/radio/radio.js +44 -9
  129. package/dist/collection/components/section/section.js +43 -5
  130. package/dist/collection/components/select/select.js +47 -12
  131. package/dist/collection/components/stack/stack.js +43 -5
  132. package/dist/collection/components/switch/switch.js +47 -12
  133. package/dist/collection/components/tab-item/tab-item.js +45 -10
  134. package/dist/collection/components/tab-list/tab-list.js +43 -5
  135. package/dist/collection/components/tab-panel/tab-panel.js +48 -5
  136. package/dist/collection/components/table/table.js +37 -5
  137. package/dist/collection/components/table-body/table-body.js +9 -4
  138. package/dist/collection/components/table-caption/table-caption.js +43 -5
  139. package/dist/collection/components/table-data-cell/table-data-cell.js +10 -5
  140. package/dist/collection/components/table-footer/table-footer.js +9 -4
  141. package/dist/collection/components/table-head/table-head.js +42 -4
  142. package/dist/collection/components/table-header-cell/table-header-cell.js +10 -5
  143. package/dist/collection/components/table-row/table-row.js +9 -4
  144. package/dist/collection/components/tabs/tabs.js +44 -9
  145. package/dist/collection/components/tag/tag.js +43 -5
  146. package/dist/collection/components/textarea/textarea.js +47 -11
  147. package/dist/collection/components/tooltip/tooltip.js +150 -21
  148. package/dist/custom-elements.json +710 -0
  149. package/dist/db-ux/db-ux.esm.js +1 -1
  150. package/dist/db-ux/p-0123ee1b.entry.js +1 -0
  151. package/dist/db-ux/p-090b1797.entry.js +1 -0
  152. package/dist/db-ux/p-0e17c5a0.entry.js +1 -0
  153. package/dist/db-ux/p-194e851c.entry.js +1 -0
  154. package/dist/db-ux/p-281f5e3e.entry.js +1 -0
  155. package/dist/db-ux/p-2ae377e6.entry.js +1 -0
  156. package/dist/db-ux/p-2cf4345f.entry.js +1 -0
  157. package/dist/db-ux/p-2e6c8304.entry.js +1 -0
  158. package/dist/db-ux/p-335391d4.entry.js +1 -0
  159. package/dist/db-ux/p-34235204.entry.js +1 -0
  160. package/dist/db-ux/p-3569bb3c.entry.js +1 -0
  161. package/dist/db-ux/p-398f9165.entry.js +1 -0
  162. package/dist/db-ux/p-5070470f.entry.js +1 -0
  163. package/dist/db-ux/p-5e08712d.entry.js +1 -0
  164. package/dist/db-ux/p-63d98f9d.entry.js +1 -0
  165. package/dist/db-ux/p-6aa92091.entry.js +1 -0
  166. package/dist/db-ux/p-78b7e6f6.entry.js +1 -0
  167. package/dist/db-ux/p-7ca4bc82.entry.js +1 -0
  168. package/dist/db-ux/p-8f989150.entry.js +1 -0
  169. package/dist/db-ux/p-8fa7a578.entry.js +1 -0
  170. package/dist/db-ux/p-91052c75.entry.js +1 -0
  171. package/dist/db-ux/p-9ccd42b1.entry.js +1 -0
  172. package/dist/db-ux/p-a4d9f6e2.entry.js +1 -0
  173. package/dist/db-ux/p-af248e57.entry.js +1 -0
  174. package/dist/db-ux/p-ba82a0b0.entry.js +1 -0
  175. package/dist/db-ux/p-c2ce6ecd.entry.js +1 -0
  176. package/dist/db-ux/p-d7b5748d.entry.js +1 -0
  177. package/dist/db-ux/p-dfbbe502.entry.js +1 -0
  178. package/dist/db-ux/p-e7a400a2.entry.js +1 -0
  179. package/dist/db-ux/p-ef1aa878.entry.js +1 -0
  180. package/dist/db-ux/p-f1daaefa.entry.js +1 -0
  181. package/dist/db-ux/p-f6312d2c.entry.js +1 -0
  182. package/dist/db-ux/p-fbf09569.entry.js +1 -0
  183. package/dist/db-ux/p-ff11c071.entry.js +1 -0
  184. package/dist/esm/db-accordion-item.entry.js +46 -9
  185. package/dist/esm/db-accordion.entry.js +43 -6
  186. package/dist/esm/db-badge.entry.js +43 -6
  187. package/dist/esm/db-brand.entry.js +36 -5
  188. package/dist/esm/db-button.entry.js +36 -5
  189. package/dist/esm/db-card.entry.js +36 -5
  190. package/dist/esm/db-checkbox.entry.js +45 -11
  191. package/dist/esm/db-custom-button.entry.js +36 -5
  192. package/dist/esm/db-custom-select-dropdown_5.entry.js +190 -31
  193. package/dist/esm/db-custom-select-form-field.entry.js +36 -5
  194. package/dist/esm/db-custom-select.entry.js +60 -26
  195. package/dist/esm/db-divider.entry.js +35 -4
  196. package/dist/esm/db-drawer.entry.js +45 -8
  197. package/dist/esm/db-header.entry.js +43 -6
  198. package/dist/esm/db-icon.entry.js +36 -5
  199. package/dist/esm/db-infotext.entry.js +36 -5
  200. package/dist/esm/db-link_4.entry.js +65 -19
  201. package/dist/esm/db-navigation-item.entry.js +47 -10
  202. package/dist/esm/db-navigation.entry.js +36 -5
  203. package/dist/esm/db-notification.entry.js +36 -5
  204. package/dist/esm/db-page.entry.js +48 -13
  205. package/dist/esm/db-popover.entry.js +43 -6
  206. package/dist/esm/db-radio.entry.js +42 -8
  207. package/dist/esm/db-section.entry.js +36 -5
  208. package/dist/esm/db-select.entry.js +45 -11
  209. package/dist/esm/db-stack.entry.js +36 -5
  210. package/dist/esm/db-switch.entry.js +45 -11
  211. package/dist/esm/db-tab-item_3.entry.js +118 -19
  212. package/dist/esm/db-table-body_3.entry.js +53 -12
  213. package/dist/esm/db-table-caption.entry.js +36 -5
  214. package/dist/esm/db-table.entry.js +35 -4
  215. package/dist/esm/db-tabs.entry.js +43 -9
  216. package/dist/esm/db-textarea.entry.js +45 -10
  217. package/dist/esm/db-tooltip.entry.js +144 -20
  218. package/dist/esm/db-ux.js +1 -1
  219. package/dist/esm/loader.js +1 -1
  220. package/dist/types/components/accordion/accordion.d.ts +3 -0
  221. package/dist/types/components/accordion-item/accordion-item.d.ts +3 -0
  222. package/dist/types/components/badge/badge.d.ts +3 -0
  223. package/dist/types/components/brand/brand.d.ts +3 -0
  224. package/dist/types/components/button/button.d.ts +3 -0
  225. package/dist/types/components/card/card.d.ts +3 -0
  226. package/dist/types/components/checkbox/checkbox.d.ts +2 -0
  227. package/dist/types/components/custom-button/custom-button.d.ts +3 -0
  228. package/dist/types/components/custom-select/custom-select.d.ts +2 -0
  229. package/dist/types/components/custom-select-dropdown/custom-select-dropdown.d.ts +3 -0
  230. package/dist/types/components/custom-select-form-field/custom-select-form-field.d.ts +3 -0
  231. package/dist/types/components/custom-select-list/custom-select-list.d.ts +3 -0
  232. package/dist/types/components/custom-select-list-item/custom-select-list-item.d.ts +3 -0
  233. package/dist/types/components/divider/divider.d.ts +3 -0
  234. package/dist/types/components/drawer/drawer.d.ts +3 -0
  235. package/dist/types/components/header/header.d.ts +3 -0
  236. package/dist/types/components/icon/icon.d.ts +3 -0
  237. package/dist/types/components/infotext/infotext.d.ts +3 -0
  238. package/dist/types/components/input/input.d.ts +2 -0
  239. package/dist/types/components/link/link.d.ts +3 -0
  240. package/dist/types/components/navigation/navigation.d.ts +3 -0
  241. package/dist/types/components/navigation-item/navigation-item.d.ts +3 -0
  242. package/dist/types/components/notification/notification.d.ts +3 -0
  243. package/dist/types/components/page/page.d.ts +2 -0
  244. package/dist/types/components/popover/popover.d.ts +3 -0
  245. package/dist/types/components/radio/radio.d.ts +2 -0
  246. package/dist/types/components/section/section.d.ts +3 -0
  247. package/dist/types/components/select/select.d.ts +2 -0
  248. package/dist/types/components/stack/stack.d.ts +3 -0
  249. package/dist/types/components/switch/switch.d.ts +2 -0
  250. package/dist/types/components/tab-item/tab-item.d.ts +2 -0
  251. package/dist/types/components/tab-list/tab-list.d.ts +3 -0
  252. package/dist/types/components/tab-panel/tab-panel.d.ts +3 -0
  253. package/dist/types/components/table/table.d.ts +3 -0
  254. package/dist/types/components/table-caption/table-caption.d.ts +3 -0
  255. package/dist/types/components/table-head/table-head.d.ts +3 -0
  256. package/dist/types/components/tabs/tabs.d.ts +2 -0
  257. package/dist/types/components/tag/tag.d.ts +3 -0
  258. package/dist/types/components/textarea/textarea.d.ts +2 -0
  259. package/dist/types/components/tooltip/model.d.ts +9 -0
  260. package/dist/types/components/tooltip/tooltip.d.ts +8 -0
  261. package/dist/web-types.json +84 -40
  262. package/package.json +6 -6
  263. package/bundle/p-B5ANMEnQ.js +0 -1
  264. package/bundle/p-BJwvv-yT.js +0 -1
  265. package/bundle/p-BNiKxu3y.js +0 -1
  266. package/bundle/p-B_bPnncM.js +0 -1
  267. package/bundle/p-BnLhi6Lz.js +0 -1
  268. package/bundle/p-BrBlnLrn.js +0 -1
  269. package/bundle/p-CByFfoSH.js +0 -1
  270. package/bundle/p-CQo0C7QE.js +0 -1
  271. package/bundle/p-CR2ZbfYe.js +0 -1
  272. package/bundle/p-CeDu282h.js +0 -1
  273. package/bundle/p-CfLPOLHz.js +0 -1
  274. package/bundle/p-CoOxyQb2.js +0 -1
  275. package/bundle/p-CqED0CfD.js +0 -1
  276. package/bundle/p-Cr_z1Jfi.js +0 -1
  277. package/bundle/p-D-XzX0R7.js +0 -1
  278. package/bundle/p-DMSIvqcA.js +0 -1
  279. package/bundle/p-DUiroUyR.js +0 -1
  280. package/bundle/p-DdyMClpj.js +0 -1
  281. package/bundle/p-DjVjS2Tb.js +0 -1
  282. package/bundle/p-in4Kv88F.js +0 -1
  283. package/dist/db-ux/p-08271c80.entry.js +0 -1
  284. package/dist/db-ux/p-105ffa74.entry.js +0 -1
  285. package/dist/db-ux/p-15adca91.entry.js +0 -1
  286. package/dist/db-ux/p-1a322a0c.entry.js +0 -1
  287. package/dist/db-ux/p-1f7232c0.entry.js +0 -1
  288. package/dist/db-ux/p-27e2f6f2.entry.js +0 -1
  289. package/dist/db-ux/p-2907f214.entry.js +0 -1
  290. package/dist/db-ux/p-2ff958e4.entry.js +0 -1
  291. package/dist/db-ux/p-3423b7af.entry.js +0 -1
  292. package/dist/db-ux/p-365e6edf.entry.js +0 -1
  293. package/dist/db-ux/p-42516007.entry.js +0 -1
  294. package/dist/db-ux/p-5045182c.entry.js +0 -1
  295. package/dist/db-ux/p-5e1d42e5.entry.js +0 -1
  296. package/dist/db-ux/p-61b28212.entry.js +0 -1
  297. package/dist/db-ux/p-6850a53c.entry.js +0 -1
  298. package/dist/db-ux/p-6bff55b4.entry.js +0 -1
  299. package/dist/db-ux/p-6e7c5e42.entry.js +0 -1
  300. package/dist/db-ux/p-76adf385.entry.js +0 -1
  301. package/dist/db-ux/p-78f7b353.entry.js +0 -1
  302. package/dist/db-ux/p-7fa5d304.entry.js +0 -1
  303. package/dist/db-ux/p-95b69e71.entry.js +0 -1
  304. package/dist/db-ux/p-99ebe6ec.entry.js +0 -1
  305. package/dist/db-ux/p-a5dc355d.entry.js +0 -1
  306. package/dist/db-ux/p-a6113789.entry.js +0 -1
  307. package/dist/db-ux/p-b9c0feaf.entry.js +0 -1
  308. package/dist/db-ux/p-c14fa91a.entry.js +0 -1
  309. package/dist/db-ux/p-c65b807e.entry.js +0 -1
  310. package/dist/db-ux/p-dd9cedbe.entry.js +0 -1
  311. package/dist/db-ux/p-e3f705fd.entry.js +0 -1
  312. package/dist/db-ux/p-e4cddc9f.entry.js +0 -1
  313. package/dist/db-ux/p-e7a8612c.entry.js +0 -1
  314. package/dist/db-ux/p-ee8c3243.entry.js +0 -1
  315. package/dist/db-ux/p-f0d0acfc.entry.js +0 -1
  316. package/dist/db-ux/p-f15748ea.entry.js +0 -1
@@ -5,6 +5,29 @@ import { h } from "@stencil/core";
5
5
 
6
6
  */
7
7
  export class DBStack {
8
+ constructor() {
9
+ this.observer = undefined;
10
+ }
11
+ setupObserver(element) {
12
+ if (!element)
13
+ return;
14
+ const parent = element.closest("db-stack");
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-stack");
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 DBStack {
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
- element.setAttribute(attr.name, attr.value);
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 && attr.name !== 'data-density' && attr.name !== "class" && attr.name === "style") {
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 DBStack {
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 ? `${currentClass} ` : ""}${value}`);
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 DBStack {
49
77
  }
50
78
  }
51
79
  this.enableAttributePassing(this._ref, "db-stack");
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: '62cf5c2919a377c7167776fda39248a7ea03ebb2', class: cls("db-stack", this.className), ref: (el) => {
88
+ return (h("div", { key: '02389c1bd26917e0176c95ce3e38e7ef664813e7', class: cls("db-stack", 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, "data-gap": this.gap, "data-variant": this.variant, "data-direction": this.direction, "data-alignment": this.alignment, "data-justify-content": this.justifyContent, "data-wrap": getBooleanAsString(this.wrap, "wrap") }, h("slot", { key: 'af86645752507ed68b97f6b290cd304c6cf48952' })));
90
+ }, id: (_a = this.id) !== null && _a !== void 0 ? _a : (_b = this.propOverrides) === null || _b === void 0 ? void 0 : _b.id, "data-gap": this.gap, "data-variant": this.variant, "data-direction": this.direction, "data-alignment": this.alignment, "data-justify-content": this.justifyContent, "data-wrap": getBooleanAsString(this.wrap, "wrap") }, h("slot", { key: '70b94e0558c79bc76096be335af95029ad2cbe5c' })));
58
91
  }
59
92
  static get is() { return "db-stack"; }
60
93
  static get properties() {
@@ -293,5 +326,10 @@ export class DBStack {
293
326
  }
294
327
  };
295
328
  }
329
+ static get states() {
330
+ return {
331
+ "observer": {}
332
+ };
333
+ }
296
334
  static get elementRef() { return "rootElement"; }
297
335
  }
@@ -16,6 +16,7 @@ export class DBSwitch {
16
16
  this._descByIds = undefined;
17
17
  this._voiceOverFallback = "";
18
18
  this.abortController = undefined;
19
+ this.observer = undefined;
19
20
  }
20
21
  hasValidState() {
21
22
  var _a;
@@ -32,7 +33,7 @@ export class DBSwitch {
32
33
  if (hasVoiceOver()) {
33
34
  this._voiceOverFallback =
34
35
  this._invalidMessage || DEFAULT_INVALID_MESSAGE;
35
- delay(() => {
36
+ void delay(() => {
36
37
  this._voiceOverFallback = "";
37
38
  }, 1000);
38
39
  }
@@ -42,7 +43,7 @@ export class DBSwitch {
42
43
  this._descByIds = this._validMessageId;
43
44
  if (hasVoiceOver()) {
44
45
  this._voiceOverFallback = (_f = this.validMessage) !== null && _f !== void 0 ? _f : DEFAULT_VALID_MESSAGE;
45
- delay(() => {
46
+ void delay(() => {
46
47
  this._voiceOverFallback = "";
47
48
  }, 1000);
48
49
  }
@@ -89,6 +90,26 @@ export class DBSwitch {
89
90
  this._validMessageId = `${mId}${DEFAULT_VALID_MESSAGE_ID_SUFFIX}`;
90
91
  this._invalidMessageId = `${mId}${DEFAULT_INVALID_MESSAGE_ID_SUFFIX}`;
91
92
  }
93
+ setupObserver(element) {
94
+ if (!element)
95
+ return;
96
+ const parent = element.closest("db-switch");
97
+ if (!parent || this.observer)
98
+ return;
99
+ this.observer = new MutationObserver((mutations) => {
100
+ if (mutations.some((mutation) => {
101
+ var _a;
102
+ const attr = mutation.target.attributes.getNamedItem((_a = mutation.attributeName) !== null && _a !== void 0 ? _a : "");
103
+ return (attr === null || attr === void 0 ? void 0 : attr.value) !== mutation.oldValue;
104
+ })) {
105
+ this.enableAttributePassing(element, "db-switch");
106
+ }
107
+ });
108
+ this.observer.observe(parent, {
109
+ attributes: true,
110
+ attributeOldValue: true,
111
+ });
112
+ }
92
113
  /**
93
114
  * Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.
94
115
  * @param element the ref for the component
@@ -102,10 +123,15 @@ export class DBSwitch {
102
123
  const attr = attributes.item(i);
103
124
  if (attr && attr.name !== 'data-density' &&
104
125
  (attr.name.startsWith("data-") || attr.name.startsWith("aria-"))) {
105
- element.setAttribute(attr.name, attr.value);
126
+ if (attr.value) {
127
+ element.setAttribute(attr.name, attr.value);
128
+ }
129
+ else {
130
+ element.removeAttribute(attr.name);
131
+ }
106
132
  parent.removeAttribute(attr.name);
107
133
  }
108
- else if (attr && attr.name !== 'data-density' && attr.name !== "class" && attr.name === "style") {
134
+ else if (attr && ["style"].includes(attr.name)) {
109
135
  element.setAttribute(attr.name, attr.value);
110
136
  parent.removeAttribute(attr.name);
111
137
  }
@@ -113,7 +139,7 @@ export class DBSwitch {
113
139
  const isWebComponent = attr.value.includes("hydrated");
114
140
  const value = attr.value.replace("hydrated", "").trim();
115
141
  const currentClass = element.getAttribute("class");
116
- element.setAttribute(attr.name, `${currentClass ? `${currentClass} ` : ""}${value}`);
142
+ element.setAttribute(attr.name, `${currentClass ? currentClass : ""}${value ? ` ${value}` : ""}`);
117
143
  if (isWebComponent) {
118
144
  // Stencil is using this class for lazy loading component
119
145
  parent.setAttribute("class", "hydrated");
@@ -177,23 +203,31 @@ export class DBSwitch {
177
203
  }
178
204
  }
179
205
  this.enableAttributePassing(this._ref, "db-switch");
180
- this.resetIds();
181
- this.handleValidation();
182
- this._invalidMessage = this.invalidMessage || DEFAULT_INVALID_MESSAGE;
206
+ const onMountHook_0 = () => {
207
+ this.resetIds();
208
+ this.handleValidation();
209
+ this._invalidMessage = this.invalidMessage || DEFAULT_INVALID_MESSAGE;
210
+ };
211
+ onMountHook_0();
212
+ const onMountHook_1 = () => {
213
+ this.setupObserver(this._ref);
214
+ };
215
+ onMountHook_1();
183
216
  this.watch0Fn();
184
217
  this.watch1Fn();
185
218
  this.watch2Fn();
186
219
  this.watch3Fn();
187
220
  }
188
221
  disconnectedCallback() {
189
- var _a;
222
+ var _a, _b;
190
223
  (_a = this.abortController) === null || _a === void 0 ? void 0 : _a.abort();
224
+ (_b = this.observer) === null || _b === void 0 ? void 0 : _b.disconnect();
191
225
  }
192
226
  render() {
193
227
  var _a, _b;
194
- return (h("div", { key: '4580075ad2dc46cce52be60c2738d0fd1033ae74', class: cls("db-switch", this.className), "data-visual-aid": getBooleanAsString(this.visualAid, "visualAid"), "data-size": this.size, "data-hide-label": getHideProp(this.showLabel), "data-variant": this.variant, "data-hide-asterisk": getHideProp(this.showRequiredAsterisk), "data-custom-validity": this.validation }, h("label", { key: 'bb3f0961808c94615181dc7e256a0ee35dcf34b7', htmlFor: this._id }, h("input", { key: '352257d398c6808c4a643e97b5505edddec9477c', type: "checkbox", role: "switch", id: this._id, ref: (el) => {
228
+ return (h("div", { key: 'e95dafb6d580ef8cfbd54b91ee77da4809984862', class: cls("db-switch", this.className), "data-visual-aid": getBooleanAsString(this.visualAid, "visualAid"), "data-size": this.size, "data-hide-label": getHideProp(this.showLabel), "data-variant": this.variant, "data-hide-asterisk": getHideProp(this.showRequiredAsterisk), "data-custom-validity": this.validation }, h("label", { key: '533173f9a522375012848dbff80b0e357f5e1b30', htmlFor: this._id }, h("input", { key: '68e6d40e2b5654508d8ebaf9be66dd56aa39c8f2', type: "checkbox", role: "switch", id: this._id, ref: (el) => {
195
229
  this._ref = el;
196
- }, checked: getBoolean(this.checked, "checked"), value: this.value, disabled: getBoolean(this.disabled, "disabled"), "aria-invalid": this.validation === "invalid" ? "true" : undefined, "aria-describedby": this._descByIds, name: this.name, required: getBoolean(this.required, "required"), "data-aid-icon": (_a = this.iconLeading) !== null && _a !== void 0 ? _a : this.icon, "data-aid-icon-trailing": this.iconTrailing, onChange: (event) => this.handleChange(event), onBlur: (event) => this.handleBlur(event), onFocus: (event) => this.handleFocus(event), onKeyDown: (event) => this.handleKeyDown(event) }), this.label ? this.label : null, h("slot", { key: '72b91ff451105158b600372cf2a338feb417488d' })), stringPropVisible(this.message, this.showMessage) ? (h("db-infotext", { size: "small", semantic: "adaptive", id: this._messageId, icon: this.messageIcon }, this.message)) : null, this.hasValidState() ? (h("db-infotext", { size: "small", semantic: "successful", id: this._validMessageId }, (_b = this.validMessage) !== null && _b !== void 0 ? _b : DEFAULT_VALID_MESSAGE)) : null, h("db-infotext", { key: '77aeba89e7998e2e62f47cf578d087da4881bea1', size: "small", semantic: "critical", id: this._invalidMessageId }, this._invalidMessage), h("span", { key: '470358471b50f36f0faa2fe3107768785f5c256a', "data-visually-hidden": "true", role: "status" }, this._voiceOverFallback)));
230
+ }, checked: getBoolean(this.checked, "checked"), value: this.value, disabled: getBoolean(this.disabled, "disabled"), "aria-invalid": this.validation === "invalid" ? "true" : undefined, "aria-describedby": this._descByIds, name: this.name, required: getBoolean(this.required, "required"), "data-aid-icon": (_a = this.iconLeading) !== null && _a !== void 0 ? _a : this.icon, "data-aid-icon-trailing": this.iconTrailing, onChange: (event) => this.handleChange(event), onBlur: (event) => this.handleBlur(event), onFocus: (event) => this.handleFocus(event), onKeyDown: (event) => this.handleKeyDown(event) }), this.label ? this.label : null, h("slot", { key: 'a89d78f024905190780c3c8436773ab710115857' })), stringPropVisible(this.message, this.showMessage) ? (h("db-infotext", { size: "small", semantic: "adaptive", id: this._messageId, icon: this.messageIcon }, this.message)) : null, this.hasValidState() ? (h("db-infotext", { size: "small", semantic: "successful", id: this._validMessageId }, (_b = this.validMessage) !== null && _b !== void 0 ? _b : DEFAULT_VALID_MESSAGE)) : null, h("db-infotext", { key: 'e170d8c368afd61c7c94c10bb2ea13fe4520d692', size: "small", semantic: "critical", id: this._invalidMessageId }, this._invalidMessage), h("span", { key: 'd8a5b8e7a5e0f70f245de5756f7b2d19640b4863', "data-visually-hidden": "true", role: "status" }, this._voiceOverFallback)));
197
231
  }
198
232
  static get is() { return "db-switch"; }
199
233
  static get properties() {
@@ -805,7 +839,8 @@ export class DBSwitch {
805
839
  "_invalidMessage": {},
806
840
  "_descByIds": {},
807
841
  "_voiceOverFallback": {},
808
- "abortController": {}
842
+ "abortController": {},
843
+ "observer": {}
809
844
  };
810
845
  }
811
846
  static get events() {
@@ -11,6 +11,7 @@ export class DBTabItem {
11
11
  this.initialized = false;
12
12
  this._listenerAdded = false;
13
13
  this.boundSetSelectedOnChange = undefined;
14
+ this.observer = undefined;
14
15
  }
15
16
  setSelectedOnChange(event) {
16
17
  event.stopPropagation();
@@ -32,6 +33,26 @@ export class DBTabItem {
32
33
  this.change.emit(event);
33
34
  }
34
35
  }
36
+ setupObserver(element) {
37
+ if (!element)
38
+ return;
39
+ const parent = element.closest("db-tab-item");
40
+ if (!parent || this.observer)
41
+ return;
42
+ this.observer = new MutationObserver((mutations) => {
43
+ if (mutations.some((mutation) => {
44
+ var _a;
45
+ const attr = mutation.target.attributes.getNamedItem((_a = mutation.attributeName) !== null && _a !== void 0 ? _a : "");
46
+ return (attr === null || attr === void 0 ? void 0 : attr.value) !== mutation.oldValue;
47
+ })) {
48
+ this.enableAttributePassing(element, "db-tab-item");
49
+ }
50
+ });
51
+ this.observer.observe(parent, {
52
+ attributes: true,
53
+ attributeOldValue: true,
54
+ });
55
+ }
35
56
  /**
36
57
  * Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.
37
58
  * @param element the ref for the component
@@ -45,10 +66,15 @@ export class DBTabItem {
45
66
  const attr = attributes.item(i);
46
67
  if (attr && attr.name !== 'data-density' &&
47
68
  (attr.name.startsWith("data-") || attr.name.startsWith("aria-"))) {
48
- element.setAttribute(attr.name, attr.value);
69
+ if (attr.value) {
70
+ element.setAttribute(attr.name, attr.value);
71
+ }
72
+ else {
73
+ element.removeAttribute(attr.name);
74
+ }
49
75
  parent.removeAttribute(attr.name);
50
76
  }
51
- else if (attr && attr.name !== 'data-density' && attr.name !== "class" && attr.name === "style") {
77
+ else if (attr && ["style"].includes(attr.name)) {
52
78
  element.setAttribute(attr.name, attr.value);
53
79
  parent.removeAttribute(attr.name);
54
80
  }
@@ -56,7 +82,7 @@ export class DBTabItem {
56
82
  const isWebComponent = attr.value.includes("hydrated");
57
83
  const value = attr.value.replace("hydrated", "").trim();
58
84
  const currentClass = element.getAttribute("class");
59
- element.setAttribute(attr.name, `${currentClass ? `${currentClass} ` : ""}${value}`);
85
+ element.setAttribute(attr.name, `${currentClass ? currentClass : ""}${value ? ` ${value}` : ""}`);
60
86
  if (isWebComponent) {
61
87
  // Stencil is using this class for lazy loading component
62
88
  parent.setAttribute("class", "hydrated");
@@ -104,25 +130,33 @@ export class DBTabItem {
104
130
  }
105
131
  }
106
132
  this.enableAttributePassing(this._ref, "db-tab-item");
107
- this.boundSetSelectedOnChange = this.setSelectedOnChange.bind(this);
108
- this.initialized = true;
133
+ const onMountHook_0 = () => {
134
+ this.boundSetSelectedOnChange = this.setSelectedOnChange.bind(this);
135
+ this.initialized = true;
136
+ };
137
+ onMountHook_0();
138
+ const onMountHook_1 = () => {
139
+ this.setupObserver(this._ref);
140
+ };
141
+ onMountHook_1();
109
142
  this.watch0Fn();
110
143
  this.watch1Fn();
111
144
  }
112
145
  disconnectedCallback() {
113
- var _a;
146
+ var _a, _b;
114
147
  if (this._listenerAdded && this._ref && this.boundSetSelectedOnChange) {
115
148
  (_a = this._ref
116
149
  .closest("[role=tablist]")) === null || _a === void 0 ? void 0 : _a.removeEventListener("change", this.boundSetSelectedOnChange);
117
150
  this._listenerAdded = false;
118
151
  }
152
+ (_b = this.observer) === null || _b === void 0 ? void 0 : _b.disconnect();
119
153
  }
120
154
  render() {
121
155
  var _a, _b, _c, _d, _e;
122
- return (h("li", { key: '8189c400a6ac975657082338dd31d96a2d0c38d9', class: cls("db-tab-item", this.className), role: "none" }, h("label", { key: '08c6f0760a4cc6f5758d22380c94331858f4823d', 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": getBooleanAsString(this.showIconLeading, "showIconLeading") ||
123
- getBooleanAsString(this.showIcon, "showIcon"), "data-show-icon-trailing": getBooleanAsString(this.showIconTrailing, "showIconTrailing"), "data-no-text": getBooleanAsString(this.noText, "noText") }, h("input", { key: '6729729ae705d60fa25cb49850cc54166b7f56a0', type: "radio", role: "tab", disabled: getBoolean(this.disabled, "disabled"), "aria-selected": this._selected, checked: getBoolean(this.checked, "checked"), ref: (el) => {
156
+ return (h("li", { key: '003e5b968c65ba01df1b97e8f75592aee31125d9', class: cls("db-tab-item", this.className), role: "none" }, 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": getBooleanAsString(this.showIconLeading, "showIconLeading") ||
157
+ getBooleanAsString(this.showIcon, "showIcon"), "data-show-icon-trailing": getBooleanAsString(this.showIconTrailing, "showIconTrailing"), "data-no-text": getBooleanAsString(this.noText, "noText") }, h("input", { key: 'ffb91a8e7248a8e5a2a7a05c6828fc6203e1eb37', type: "radio", role: "tab", disabled: getBoolean(this.disabled, "disabled"), "aria-selected": this._selected, checked: getBoolean(this.checked, "checked"), ref: (el) => {
124
158
  this._ref = el;
125
- }, 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, h("slot", { key: 'eb4bc6568c4c6d63706d2f5927ea73fd5d40d6ac' }))));
159
+ }, 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, h("slot", { key: '2d079503cd365448cd054e05bfaec608ff476e04' }))));
126
160
  }
127
161
  static get is() { return "db-tab-item"; }
128
162
  static get properties() {
@@ -523,7 +557,8 @@ export class DBTabItem {
523
557
  "_name": {},
524
558
  "initialized": {},
525
559
  "_listenerAdded": {},
526
- "boundSetSelectedOnChange": {}
560
+ "boundSetSelectedOnChange": {},
561
+ "observer": {}
527
562
  };
528
563
  }
529
564
  static get events() {
@@ -5,6 +5,29 @@ import { h } from "@stencil/core";
5
5
 
6
6
  */
7
7
  export class DBTabList {
8
+ constructor() {
9
+ this.observer = undefined;
10
+ }
11
+ setupObserver(element) {
12
+ if (!element)
13
+ return;
14
+ const parent = element.closest("db-tab-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-tab-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 DBTabList {
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
- element.setAttribute(attr.name, attr.value);
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 && attr.name !== 'data-density' && attr.name !== "class" && attr.name === "style") {
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 DBTabList {
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 ? `${currentClass} ` : ""}${value}`);
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 DBTabList {
49
77
  }
50
78
  }
51
79
  this.enableAttributePassing(this._ref, "db-tab-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: '9459e474559fa115dc69cb188e4c490a522d035c', class: cls("db-tab-list", this.className), ref: (el) => {
88
+ return (h("div", { key: '2538ba05ecad54c8c29dda93a08acb61faf02309', class: cls("db-tab-list", 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("ul", { key: '7d2dbddd6ad03047abd8572b6125a53072ff94d0', role: "tablist" }, h("slot", { key: '10079c1b3bbc66157a0603e55ea1f5f48aee0faf' }))));
90
+ }, id: (_a = this.id) !== null && _a !== void 0 ? _a : (_b = this.propOverrides) === null || _b === void 0 ? void 0 : _b.id }, h("ul", { key: '86824302eb2cc92ca45a61d8bdec0f34cd679db6', role: "tablist" }, h("slot", { key: 'b56406b1e0291a29905b599531c0dccd9c035504' }))));
58
91
  }
59
92
  static get is() { return "db-tab-list"; }
60
93
  static get properties() {
@@ -137,5 +170,10 @@ export class DBTabList {
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 DBTabPanel {
8
+ constructor() {
9
+ this.observer = undefined;
10
+ }
11
+ setupObserver(element) {
12
+ if (!element)
13
+ return;
14
+ const parent = element.closest("db-tab-panel");
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-tab-panel");
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 DBTabPanel {
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
- element.setAttribute(attr.name, attr.value);
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 && attr.name !== 'data-density' && attr.name !== "class" && attr.name === "style") {
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 DBTabPanel {
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 ? `${currentClass} ` : ""}${value}`);
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,22 @@ export class DBTabPanel {
49
77
  }
50
78
  }
51
79
  this.enableAttributePassing(this._ref, "db-tab-panel");
80
+ const onMountHook_0 = () => { };
81
+ onMountHook_0();
82
+ const onMountHook_1 = () => {
83
+ this.setupObserver(this._ref);
84
+ };
85
+ onMountHook_1();
86
+ }
87
+ disconnectedCallback() {
88
+ var _a;
89
+ (_a = this.observer) === null || _a === void 0 ? void 0 : _a.disconnect();
52
90
  }
53
91
  render() {
54
92
  var _a, _b;
55
- return (h("section", { key: 'c5b52e3d5bce98a32f2dba1956f58d707ae1b89b', class: cls("db-tab-panel", this.className), role: "tabpanel", ref: (el) => {
93
+ return (h("section", { key: 'd7179207343d512194f69f6d99a34897c146c00a', class: cls("db-tab-panel", this.className), role: "tabpanel", ref: (el) => {
56
94
  this._ref = el;
57
- }, 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, h("slot", { key: 'd64ba9e9cdbb15198934c7069f7e2390c3c443e8' })));
95
+ }, 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, h("slot", { key: 'dc745b430dd17f253cf9403c28f6c2cbd5b59020' })));
58
96
  }
59
97
  static get is() { return "db-tab-panel"; }
60
98
  static get properties() {
@@ -163,5 +201,10 @@ export class DBTabPanel {
163
201
  }
164
202
  };
165
203
  }
204
+ static get states() {
205
+ return {
206
+ "observer": {}
207
+ };
208
+ }
166
209
  static get elementRef() { return "rootElement"; }
167
210
  }
@@ -8,6 +8,7 @@ export class DBTable {
8
8
  constructor() {
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 @@ export class DBTable {
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 @@ export class DBTable {
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
- element.setAttribute(attr.name, attr.value);
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 && attr.name !== 'data-density' && attr.name !== "class" && attr.name === "style") {
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 @@ export class DBTable {
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 ? `${currentClass} ` : ""}${value}`);
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 @@ export class DBTable {
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 (h("div", { key: 'd4edb3348e35410ac540499f815e173237e533dc', 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: '2eda8c59f2c86a480691a1a4fae4a1fdaa63a6b1', ref: (el) => {
165
+ return (h("div", { key: '7e6ea12b6cb4b2ddcc12262cd28bfec13baa55c0', 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: '99fc11d1bb68297550e973293f519ad21f6953a0', ref: (el) => {
135
166
  this._ref = el;
136
167
  }, id: this.id }, this.captionPlain ? (h("caption", null, 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)))));
137
168
  }
@@ -453,7 +484,8 @@ export class DBTable {
453
484
  static get states() {
454
485
  return {
455
486
  "_data": {},
456
- "_style": {}
487
+ "_style": {},
488
+ "observer": {}
457
489
  };
458
490
  }
459
491
  static get elementRef() { return "rootElement"; }
@@ -18,10 +18,15 @@ export class DBTableBody {
18
18
  const attr = attributes.item(i);
19
19
  if (attr && attr.name !== 'data-density' &&
20
20
  (attr.name.startsWith("data-") || attr.name.startsWith("aria-"))) {
21
- element.setAttribute(attr.name, attr.value);
21
+ if (attr.value) {
22
+ element.setAttribute(attr.name, attr.value);
23
+ }
24
+ else {
25
+ element.removeAttribute(attr.name);
26
+ }
22
27
  parent.removeAttribute(attr.name);
23
28
  }
24
- else if (attr && attr.name !== 'data-density' && attr.name !== "class" && attr.name === "style") {
29
+ else if (attr && ["style"].includes(attr.name)) {
25
30
  element.setAttribute(attr.name, attr.value);
26
31
  parent.removeAttribute(attr.name);
27
32
  }
@@ -29,7 +34,7 @@ export class DBTableBody {
29
34
  const isWebComponent = attr.value.includes("hydrated");
30
35
  const value = attr.value.replace("hydrated", "").trim();
31
36
  const currentClass = element.getAttribute("class");
32
- element.setAttribute(attr.name, `${currentClass ? `${currentClass} ` : ""}${value}`);
37
+ element.setAttribute(attr.name, `${currentClass ? currentClass : ""}${value ? ` ${value}` : ""}`);
33
38
  if (isWebComponent) {
34
39
  // Stencil is using this class for lazy loading component
35
40
  parent.setAttribute("class", "hydrated");
@@ -52,7 +57,7 @@ export class DBTableBody {
52
57
  }
53
58
  render() {
54
59
  var _a;
55
- return (h("tbody", { key: 'c497d5a4be20eda6884e6e04b37ef7c9e211f307', class: cls("db-table-body", this.className), ref: (el) => {
60
+ return (h("tbody", { key: 'b6033bbe9cdcdb6bb9d292f68e980a6737fef9fa', class: cls("db-table-body", this.className), ref: (el) => {
56
61
  this._ref = el;
57
62
  }, id: this.id }, this.rows ? ((_a = this.rows) === null || _a === void 0 ? void 0 : _a.map((row, index) => {
58
63
  var _a, _b, _c;