@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
@@ -12,6 +12,7 @@ const DBPopover = class {
12
12
  this.isExpanded = false;
13
13
  this._documentScrollListenerCallbackId = undefined;
14
14
  this._observer = undefined;
15
+ this.observer = undefined;
15
16
  }
16
17
  handleEscape(event) {
17
18
  if (!event || event.key === "Escape") {
@@ -87,6 +88,26 @@ const DBPopover = class {
87
88
  }
88
89
  return null;
89
90
  }
91
+ setupObserver(element) {
92
+ if (!element)
93
+ return;
94
+ const parent = element.closest("db-popover");
95
+ if (!parent || this.observer)
96
+ return;
97
+ this.observer = new MutationObserver((mutations) => {
98
+ if (mutations.some((mutation) => {
99
+ var _a;
100
+ const attr = mutation.target.attributes.getNamedItem((_a = mutation.attributeName) !== null && _a !== void 0 ? _a : "");
101
+ return (attr === null || attr === void 0 ? void 0 : attr.value) !== mutation.oldValue;
102
+ })) {
103
+ this.enableAttributePassing(element, "db-popover");
104
+ }
105
+ });
106
+ this.observer.observe(parent, {
107
+ attributes: true,
108
+ attributeOldValue: true,
109
+ });
110
+ }
90
111
  /**
91
112
  * Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.
92
113
  * @param element the ref for the component
@@ -100,10 +121,15 @@ const DBPopover = class {
100
121
  const attr = attributes.item(i);
101
122
  if (attr && attr.name !== 'data-density' &&
102
123
  (attr.name.startsWith("data-") || attr.name.startsWith("aria-"))) {
103
- element.setAttribute(attr.name, attr.value);
124
+ if (attr.value) {
125
+ element.setAttribute(attr.name, attr.value);
126
+ }
127
+ else {
128
+ element.removeAttribute(attr.name);
129
+ }
104
130
  parent.removeAttribute(attr.name);
105
131
  }
106
- else if (attr && attr.name !== 'data-density' && attr.name !== "class" && attr.name === "style") {
132
+ else if (attr && ["style"].includes(attr.name)) {
107
133
  element.setAttribute(attr.name, attr.value);
108
134
  parent.removeAttribute(attr.name);
109
135
  }
@@ -111,7 +137,7 @@ const DBPopover = class {
111
137
  const isWebComponent = attr.value.includes("hydrated");
112
138
  const value = attr.value.replace("hydrated", "").trim();
113
139
  const currentClass = element.getAttribute("class");
114
- element.setAttribute(attr.name, `${currentClass ? `${currentClass} ` : ""}${value}`);
140
+ element.setAttribute(attr.name, `${currentClass ? currentClass : ""}${value ? ` ${value}` : ""}`);
115
141
  if (isWebComponent) {
116
142
  // Stencil is using this class for lazy loading component
117
143
  parent.setAttribute("class", "hydrated");
@@ -170,15 +196,26 @@ const DBPopover = class {
170
196
  }
171
197
  }
172
198
  this.enableAttributePassing(this._ref, "db-popover");
173
- this.initialized = true;
199
+ const onMountHook_0 = () => {
200
+ this.initialized = true;
201
+ };
202
+ onMountHook_0();
203
+ const onMountHook_1 = () => {
204
+ this.setupObserver(this._ref);
205
+ };
206
+ onMountHook_1();
174
207
  this.watch0Fn();
175
208
  this.watch1Fn();
176
209
  }
210
+ disconnectedCallback() {
211
+ var _a;
212
+ (_a = this.observer) === null || _a === void 0 ? void 0 : _a.disconnect();
213
+ }
177
214
  render() {
178
215
  var _a, _b, _c;
179
- return (index.h("div", { key: 'b4ade41cbe4f2ba97d817feb8d2921dc9a4c2e63', class: index$1.cls("db-popover", this.className), ref: (el) => {
216
+ return (index.h("div", { key: '09a8f5d4aedc314e07a184c3e41d232073b4ffc9', class: index$1.cls("db-popover", this.className), ref: (el) => {
180
217
  this._ref = el;
181
- }, id: (_a = this.id) !== null && _a !== void 0 ? _a : (_b = this.propOverrides) === null || _b === void 0 ? void 0 : _b.id }, index.h("slot", { key: '51ef67b406d5411f3622a8d62c51e26cdd8b44b0', name: "trigger" }), index.h("article", { key: '7a04c2dc442eea91ff41ed2a5030c238bc7b2740', class: "db-popover-content", "data-spacing": this.spacing, "data-gap": index$1.getBooleanAsString(this.gap, "gap"), "data-animation": index$1.getBooleanAsString((_c = this.animation) !== null && _c !== void 0 ? _c : true, "animation"), "data-open": index$1.getBooleanAsString(this.open, "open"), "data-delay": this.delay, "data-width": this.width, "data-placement": this.placement }, index.h("slot", { key: '8a8892cb2b035d6d50c5aa5599026f1476b0bede' }))));
218
+ }, id: (_a = this.id) !== null && _a !== void 0 ? _a : (_b = this.propOverrides) === null || _b === void 0 ? void 0 : _b.id }, index.h("slot", { key: 'eeee6e2e8d94272e91d275fb6799c7f781f8210a', name: "trigger" }), index.h("article", { key: 'cbbdd13d730291ec06059334c47be4c4bb8ffa71', class: "db-popover-content", "data-spacing": this.spacing, "data-gap": index$1.getBooleanAsString(this.gap, "gap"), "data-animation": index$1.getBooleanAsString((_c = this.animation) !== null && _c !== void 0 ? _c : true, "animation"), "data-open": index$1.getBooleanAsString(this.open, "open"), "data-delay": this.delay, "data-width": this.width, "data-placement": this.placement }, index.h("slot", { key: '7ae19bc9f8ba3130c107fcf826a8ca9bcf8d9f88' }))));
182
219
  }
183
220
  get rootElement() { return index.getElement(this); }
184
221
  static get watchers() { return {
@@ -14,6 +14,7 @@ const DBRadio = class {
14
14
  this.initialized = false;
15
15
  this._id = undefined;
16
16
  this.abortController = undefined;
17
+ this.observer = undefined;
17
18
  }
18
19
  handleInput(event, reset) {
19
20
  if (this.input) {
@@ -39,6 +40,26 @@ const DBRadio = class {
39
40
  var _a, _b, _c;
40
41
  this._id = (_c = (_a = this.id) !== null && _a !== void 0 ? _a : (_b = this.propOverrides) === null || _b === void 0 ? void 0 : _b.id) !== null && _c !== void 0 ? _c : `radio-${index$1.uuid()}`;
41
42
  }
43
+ setupObserver(element) {
44
+ if (!element)
45
+ return;
46
+ const parent = element.closest("db-radio");
47
+ if (!parent || this.observer)
48
+ return;
49
+ this.observer = new MutationObserver((mutations) => {
50
+ if (mutations.some((mutation) => {
51
+ var _a;
52
+ const attr = mutation.target.attributes.getNamedItem((_a = mutation.attributeName) !== null && _a !== void 0 ? _a : "");
53
+ return (attr === null || attr === void 0 ? void 0 : attr.value) !== mutation.oldValue;
54
+ })) {
55
+ this.enableAttributePassing(element, "db-radio");
56
+ }
57
+ });
58
+ this.observer.observe(parent, {
59
+ attributes: true,
60
+ attributeOldValue: true,
61
+ });
62
+ }
42
63
  /**
43
64
  * Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.
44
65
  * @param element the ref for the component
@@ -52,10 +73,15 @@ const DBRadio = class {
52
73
  const attr = attributes.item(i);
53
74
  if (attr && attr.name !== 'data-density' &&
54
75
  (attr.name.startsWith("data-") || attr.name.startsWith("aria-"))) {
55
- element.setAttribute(attr.name, attr.value);
76
+ if (attr.value) {
77
+ element.setAttribute(attr.name, attr.value);
78
+ }
79
+ else {
80
+ element.removeAttribute(attr.name);
81
+ }
56
82
  parent.removeAttribute(attr.name);
57
83
  }
58
- else if (attr && attr.name !== 'data-density' && attr.name !== "class" && attr.name === "style") {
84
+ else if (attr && ["style"].includes(attr.name)) {
59
85
  element.setAttribute(attr.name, attr.value);
60
86
  parent.removeAttribute(attr.name);
61
87
  }
@@ -63,7 +89,7 @@ const DBRadio = class {
63
89
  const isWebComponent = attr.value.includes("hydrated");
64
90
  const value = attr.value.replace("hydrated", "").trim();
65
91
  const currentClass = element.getAttribute("class");
66
- element.setAttribute(attr.name, `${currentClass ? `${currentClass} ` : ""}${value}`);
92
+ element.setAttribute(attr.name, `${currentClass ? currentClass : ""}${value ? ` ${value}` : ""}`);
67
93
  if (isWebComponent) {
68
94
  // Stencil is using this class for lazy loading component
69
95
  parent.setAttribute("class", "hydrated");
@@ -122,20 +148,28 @@ const DBRadio = class {
122
148
  }
123
149
  }
124
150
  this.enableAttributePassing(this._ref, "db-radio");
125
- this.initialized = true;
126
- this.resetIds();
151
+ const onMountHook_0 = () => {
152
+ this.initialized = true;
153
+ this.resetIds();
154
+ };
155
+ onMountHook_0();
156
+ const onMountHook_1 = () => {
157
+ this.setupObserver(this._ref);
158
+ };
159
+ onMountHook_1();
127
160
  this.watch0Fn();
128
161
  this.watch1Fn();
129
162
  this.watch2Fn();
130
163
  }
131
164
  disconnectedCallback() {
132
- var _a;
165
+ var _a, _b;
133
166
  (_a = this.abortController) === null || _a === void 0 ? void 0 : _a.abort();
167
+ (_b = this.observer) === null || _b === void 0 ? void 0 : _b.disconnect();
134
168
  }
135
169
  render() {
136
- return (index.h("label", { key: 'a0c0cd38ac8c6addb0f826294c56ff235d0ea624', class: index$1.cls("db-radio", this.className), "data-size": this.size, "data-hide-label": index$1.getHideProp(this.showLabel), "data-hide-asterisk": index$1.getHideProp(this.showRequiredAsterisk), htmlFor: this._id }, index.h("input", { key: '1dae5434da230a2e9268e89057d83b92f64b91c6', type: "radio", "aria-invalid": this.validation === "invalid", "data-custom-validity": this.validation, ref: (el) => {
170
+ return (index.h("label", { key: '85734ed463718801789a9dea9c0febcc4c2e8266', class: index$1.cls("db-radio", this.className), "data-size": this.size, "data-hide-label": index$1.getHideProp(this.showLabel), "data-hide-asterisk": index$1.getHideProp(this.showRequiredAsterisk), htmlFor: this._id }, index.h("input", { key: '7906add8b0074893bbffaaa0963284de1f89836c', type: "radio", "aria-invalid": this.validation === "invalid", "data-custom-validity": this.validation, ref: (el) => {
137
171
  this._ref = el;
138
- }, id: this._id, name: this.name, checked: index$1.getBoolean(this.checked, "checked"), disabled: index$1.getBoolean(this.disabled, "disabled"), value: this.value, required: index$1.getBoolean(this.required, "required"), onInput: (event) => this.handleInput(event), onChange: (event) => this.handleChange(event), onBlur: (event) => this.handleBlur(event), onFocus: (event) => this.handleFocus(event) }), this.label ? this.label : null, index.h("slot", { key: '7e8423038fc180907953fe21a406bc7195dcdaeb' })));
172
+ }, id: this._id, name: this.name, checked: index$1.getBoolean(this.checked, "checked"), disabled: index$1.getBoolean(this.disabled, "disabled"), value: this.value, required: index$1.getBoolean(this.required, "required"), onInput: (event) => this.handleInput(event), onChange: (event) => this.handleChange(event), onBlur: (event) => this.handleBlur(event), onFocus: (event) => this.handleFocus(event) }), this.label ? this.label : null, index.h("slot", { key: '7c35400883fd27d67bb2932cd646492fe137ccd9' })));
139
173
  }
140
174
  get rootElement() { return index.getElement(this); }
141
175
  static get watchers() { return {
@@ -6,6 +6,27 @@ var index$1 = require('./index-spuu3sXz.js');
6
6
  const DBSection = 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-section");
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-section");
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 DBSection = 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
- 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
+ }
24
50
  parent.removeAttribute(attr.name);
25
51
  }
26
- else if (attr && attr.name !== 'data-density' && attr.name !== "class" && attr.name === "style") {
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 DBSection = 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 ? `${currentClass} ` : ""}${value}`);
60
+ element.setAttribute(attr.name, `${currentClass ? currentClass : ""}${value ? ` ${value}` : ""}`);
35
61
  if (isWebComponent) {
36
62
  // Stencil is using this class for lazy loading component
37
63
  parent.setAttribute("class", "hydrated");
@@ -51,12 +77,17 @@ const DBSection = class {
51
77
  }
52
78
  }
53
79
  this.enableAttributePassing(this._ref, "db-section");
80
+ this.setupObserver(this._ref);
81
+ }
82
+ disconnectedCallback() {
83
+ var _a;
84
+ (_a = this.observer) === null || _a === void 0 ? void 0 : _a.disconnect();
54
85
  }
55
86
  render() {
56
87
  var _a, _b;
57
- return (index.h("section", { key: '5c139b6a510425291fae249e710d4b3eafdbd0c4', class: index$1.cls("db-section", this.className), ref: (el) => {
88
+ return (index.h("section", { key: 'e33119ea38ff1f66b56792cb1a5a57e47d87d370', class: index$1.cls("db-section", this.className), ref: (el) => {
58
89
  this._ref = el;
59
- }, id: (_a = this.id) !== null && _a !== void 0 ? _a : (_b = this.propOverrides) === null || _b === void 0 ? void 0 : _b.id, "data-spacing": this.spacing || "medium", "data-width": this.width }, index.h("slot", { key: 'de4549ef8be697b8298962bb254c33b531cbc915' })));
90
+ }, id: (_a = this.id) !== null && _a !== void 0 ? _a : (_b = this.propOverrides) === null || _b === void 0 ? void 0 : _b.id, "data-spacing": this.spacing || "medium", "data-width": this.width }, index.h("slot", { key: '0ac9622c130f2a896b334e65025f16365fe50ea5' })));
60
91
  }
61
92
  get rootElement() { return index.getElement(this); }
62
93
  };
@@ -24,6 +24,7 @@ const DBSelect = class {
24
24
  this.initialized = false;
25
25
  this._voiceOverFallback = "";
26
26
  this.abortController = undefined;
27
+ this.observer = undefined;
27
28
  }
28
29
  hasValidState() {
29
30
  var _a;
@@ -40,7 +41,7 @@ const DBSelect = class {
40
41
  constants.DEFAULT_INVALID_MESSAGE;
41
42
  if (index$1.hasVoiceOver()) {
42
43
  this._voiceOverFallback = this._invalidMessage;
43
- index$1.delay(() => (this._voiceOverFallback = ""), 1000);
44
+ void index$1.delay(() => (this._voiceOverFallback = ""), 1000);
44
45
  }
45
46
  }
46
47
  else if (this.hasValidState() &&
@@ -49,7 +50,7 @@ const DBSelect = class {
49
50
  this._descByIds = this._validMessageId;
50
51
  if (index$1.hasVoiceOver()) {
51
52
  this._voiceOverFallback = (_d = this.validMessage) !== null && _d !== void 0 ? _d : constants.DEFAULT_VALID_MESSAGE;
52
- index$1.delay(() => (this._voiceOverFallback = ""), 1000);
53
+ void index$1.delay(() => (this._voiceOverFallback = ""), 1000);
53
54
  }
54
55
  }
55
56
  else if (index$1.stringPropVisible(this.message, this.showMessage)) {
@@ -113,6 +114,26 @@ const DBSelect = class {
113
114
  this._invalidMessageId = mId + constants.DEFAULT_INVALID_MESSAGE_ID_SUFFIX;
114
115
  this._placeholderId = mId + constants.DEFAULT_PLACEHOLDER_ID_SUFFIX;
115
116
  }
117
+ setupObserver(element) {
118
+ if (!element)
119
+ return;
120
+ const parent = element.closest("db-select");
121
+ if (!parent || this.observer)
122
+ return;
123
+ this.observer = new MutationObserver((mutations) => {
124
+ if (mutations.some((mutation) => {
125
+ var _a;
126
+ const attr = mutation.target.attributes.getNamedItem((_a = mutation.attributeName) !== null && _a !== void 0 ? _a : "");
127
+ return (attr === null || attr === void 0 ? void 0 : attr.value) !== mutation.oldValue;
128
+ })) {
129
+ this.enableAttributePassing(element, "db-select");
130
+ }
131
+ });
132
+ this.observer.observe(parent, {
133
+ attributes: true,
134
+ attributeOldValue: true,
135
+ });
136
+ }
116
137
  /**
117
138
  * Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.
118
139
  * @param element the ref for the component
@@ -126,10 +147,15 @@ const DBSelect = class {
126
147
  const attr = attributes.item(i);
127
148
  if (attr && attr.name !== 'data-density' &&
128
149
  (attr.name.startsWith("data-") || attr.name.startsWith("aria-"))) {
129
- element.setAttribute(attr.name, attr.value);
150
+ if (attr.value) {
151
+ element.setAttribute(attr.name, attr.value);
152
+ }
153
+ else {
154
+ element.removeAttribute(attr.name);
155
+ }
130
156
  parent.removeAttribute(attr.name);
131
157
  }
132
- else if (attr && attr.name !== 'data-density' && attr.name !== "class" && attr.name === "style") {
158
+ else if (attr && ["style"].includes(attr.name)) {
133
159
  element.setAttribute(attr.name, attr.value);
134
160
  parent.removeAttribute(attr.name);
135
161
  }
@@ -137,7 +163,7 @@ const DBSelect = class {
137
163
  const isWebComponent = attr.value.includes("hydrated");
138
164
  const value = attr.value.replace("hydrated", "").trim();
139
165
  const currentClass = element.getAttribute("class");
140
- element.setAttribute(attr.name, `${currentClass ? `${currentClass} ` : ""}${value}`);
166
+ element.setAttribute(attr.name, `${currentClass ? currentClass : ""}${value ? ` ${value}` : ""}`);
141
167
  if (isWebComponent) {
142
168
  // Stencil is using this class for lazy loading component
143
169
  parent.setAttribute("class", "hydrated");
@@ -229,9 +255,16 @@ const DBSelect = class {
229
255
  }
230
256
  }
231
257
  this.enableAttributePassing(this._ref, "db-select");
232
- this.initialized = true;
233
- this.resetIds();
234
- this._invalidMessage = this.invalidMessage || constants.DEFAULT_INVALID_MESSAGE;
258
+ const onMountHook_0 = () => {
259
+ this.initialized = true;
260
+ this.resetIds();
261
+ this._invalidMessage = this.invalidMessage || constants.DEFAULT_INVALID_MESSAGE;
262
+ };
263
+ onMountHook_0();
264
+ const onMountHook_1 = () => {
265
+ this.setupObserver(this._ref);
266
+ };
267
+ onMountHook_1();
235
268
  this.watch0Fn();
236
269
  this.watch1Fn();
237
270
  this.watch2Fn();
@@ -239,19 +272,20 @@ const DBSelect = class {
239
272
  this.watch4Fn();
240
273
  }
241
274
  disconnectedCallback() {
242
- var _a;
275
+ var _a, _b;
243
276
  (_a = this.abortController) === null || _a === void 0 ? void 0 : _a.abort();
277
+ (_b = this.observer) === null || _b === void 0 ? void 0 : _b.disconnect();
244
278
  }
245
279
  render() {
246
280
  var _a, _b, _c, _d, _e, _f;
247
- return (index.h("div", { key: '9a671204460166241b06ea30a76987f89bc44185', class: index$1.cls("db-select", this.className), "data-variant": this.variant, "data-hide-label": index$1.getHideProp(this.showLabel), "data-hide-asterisk": index$1.getHideProp(this.showRequiredAsterisk), "data-icon": this.icon, "data-show-icon": index$1.getBooleanAsString(this.showIcon, "showIcon") }, index.h("label", { key: '008bd6fffd2fb37d74c1bc347e02789265dc8b1b', htmlFor: this._id }, (_a = this.label) !== null && _a !== void 0 ? _a : constants.DEFAULT_LABEL), index.h("select", { key: '6136d1db041667b7cb9ac8cbb6fe116f3aebe56a', "aria-invalid": this.validation === "invalid", "data-custom-validity": this.validation, ref: (el) => {
281
+ return (index.h("div", { key: '71200b34c84ae3c90e4990b11e55e8dea4c16e55', class: index$1.cls("db-select", this.className), "data-variant": this.variant, "data-hide-label": index$1.getHideProp(this.showLabel), "data-hide-asterisk": index$1.getHideProp(this.showRequiredAsterisk), "data-icon": this.icon, "data-show-icon": index$1.getBooleanAsString(this.showIcon, "showIcon") }, index.h("label", { key: '3633f34f827d53ee4b4d15e5b230307984fcbd09', htmlFor: this._id }, (_a = this.label) !== null && _a !== void 0 ? _a : constants.DEFAULT_LABEL), index.h("select", { key: 'ff177d80acfa3519df6467892fb5f97f4ad6872b', "aria-invalid": this.validation === "invalid", "data-custom-validity": this.validation, ref: (el) => {
248
282
  this._ref = el;
249
283
  }, required: index$1.getBoolean(this.required, "required"), disabled: index$1.getBoolean(this.disabled, "disabled"), id: this._id, name: this.name, size: this.size,
250
284
  /* @ts-ignore */
251
285
  value: (_c = (_b = this.value) !== null && _b !== void 0 ? _b : this._value) !== null && _c !== void 0 ? _c : undefined, autocomplete: this.autocomplete, multiple: this.multiple, onInput: (event) => this.handleInput(event), onClick: (event) => this.handleClick(event), onChange: (event) => this.handleChange(event), onBlur: (event) => this.handleBlur(event), onFocus: (event) => this.handleFocus(event), "aria-describedby": (_d = this.ariaDescribedBy) !== null && _d !== void 0 ? _d : this._descByIds }, this.variant === "floating" || !!this.placeholder ? (index.h("option", { class: "placeholder", value: "", "data-show-empty-option": index$1.getBooleanAsString(this.shouldShowEmptyOption(), "showEmptyOption") })) : null, ((_e = this.options) === null || _e === void 0 ? void 0 : _e.length) ? ((_f = this.options) === null || _f === void 0 ? void 0 : _f.map((option) => {
252
286
  var _a;
253
287
  return (index.h(index.Fragment, null, option.options ? (index.h("optgroup", { label: this.getOptionLabel(option), key: undefined }, (_a = option.options) === null || _a === void 0 ? void 0 : _a.map((optgroupOption) => (index.h("option", { value: optgroupOption.value, selected: optgroupOption.selected, disabled: optgroupOption.disabled, key: undefined }, this.getOptionLabel(optgroupOption)))))) : (index.h("option", { value: option.value, disabled: option.disabled, selected: option.selected, key: undefined }, this.getOptionLabel(option)))));
254
- })) : (index.h("slot", null))), this.placeholder ? (index.h("span", { class: "db-select-placeholder", id: this._placeholderId }, this.placeholder)) : null, index$1.stringPropVisible(this.message, this.showMessage) ? (index.h("db-infotext", { size: "small", icon: this.messageIcon, id: this._messageId }, this.message)) : null, this.hasValidState() ? (index.h("db-infotext", { size: "small", semantic: "successful", id: this._validMessageId }, this.validMessage || constants.DEFAULT_VALID_MESSAGE)) : null, index.h("db-infotext", { key: '2917ae74aeec788b09b7b8d748905f5505742076', size: "small", semantic: "critical", id: this._invalidMessageId }, this._invalidMessage), index.h("span", { key: '34c00871d2416959b44f2bb21816696d5ee62ea3', "data-visually-hidden": "true", role: "status" }, this._voiceOverFallback)));
288
+ })) : (index.h("slot", null))), this.placeholder ? (index.h("span", { class: "db-select-placeholder", id: this._placeholderId }, this.placeholder)) : null, index$1.stringPropVisible(this.message, this.showMessage) ? (index.h("db-infotext", { size: "small", icon: this.messageIcon, id: this._messageId }, this.message)) : null, this.hasValidState() ? (index.h("db-infotext", { size: "small", semantic: "successful", id: this._validMessageId }, this.validMessage || constants.DEFAULT_VALID_MESSAGE)) : null, index.h("db-infotext", { key: '5baf4a0984f8d71776cda0d0d9c12e62f08f434b', size: "small", semantic: "critical", id: this._invalidMessageId }, this._invalidMessage), index.h("span", { key: '2b7c6895a1de8e77daba33de6923a33b7c43bee1', "data-visually-hidden": "true", role: "status" }, this._voiceOverFallback)));
255
289
  }
256
290
  get rootElement() { return index.getElement(this); }
257
291
  static get watchers() { return {
@@ -6,6 +6,27 @@ var index$1 = require('./index-spuu3sXz.js');
6
6
  const DBStack = 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-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
+ });
9
30
  }
10
31
  /**
11
32
  * Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.
@@ -20,10 +41,15 @@ const DBStack = 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
- 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
+ }
24
50
  parent.removeAttribute(attr.name);
25
51
  }
26
- else if (attr && attr.name !== 'data-density' && attr.name !== "class" && attr.name === "style") {
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 DBStack = 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 ? `${currentClass} ` : ""}${value}`);
60
+ element.setAttribute(attr.name, `${currentClass ? currentClass : ""}${value ? ` ${value}` : ""}`);
35
61
  if (isWebComponent) {
36
62
  // Stencil is using this class for lazy loading component
37
63
  parent.setAttribute("class", "hydrated");
@@ -51,12 +77,17 @@ const DBStack = class {
51
77
  }
52
78
  }
53
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();
54
85
  }
55
86
  render() {
56
87
  var _a, _b;
57
- return (index.h("div", { key: '62cf5c2919a377c7167776fda39248a7ea03ebb2', class: index$1.cls("db-stack", this.className), ref: (el) => {
88
+ return (index.h("div", { key: '02389c1bd26917e0176c95ce3e38e7ef664813e7', class: index$1.cls("db-stack", this.className), ref: (el) => {
58
89
  this._ref = el;
59
- }, id: (_a = this.id) !== null && _a !== void 0 ? _a : (_b = this.propOverrides) === null || _b === void 0 ? void 0 : _b.id, "data-gap": this.gap, "data-variant": this.variant, "data-direction": this.direction, "data-alignment": this.alignment, "data-justify-content": this.justifyContent, "data-wrap": index$1.getBooleanAsString(this.wrap, "wrap") }, index.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": index$1.getBooleanAsString(this.wrap, "wrap") }, index.h("slot", { key: '70b94e0558c79bc76096be335af95029ad2cbe5c' })));
60
91
  }
61
92
  get rootElement() { return index.getElement(this); }
62
93
  };
@@ -19,6 +19,7 @@ const DBSwitch = class {
19
19
  this._descByIds = undefined;
20
20
  this._voiceOverFallback = "";
21
21
  this.abortController = undefined;
22
+ this.observer = undefined;
22
23
  }
23
24
  hasValidState() {
24
25
  var _a;
@@ -35,7 +36,7 @@ const DBSwitch = class {
35
36
  if (index$1.hasVoiceOver()) {
36
37
  this._voiceOverFallback =
37
38
  this._invalidMessage || constants.DEFAULT_INVALID_MESSAGE;
38
- index$1.delay(() => {
39
+ void index$1.delay(() => {
39
40
  this._voiceOverFallback = "";
40
41
  }, 1000);
41
42
  }
@@ -45,7 +46,7 @@ const DBSwitch = class {
45
46
  this._descByIds = this._validMessageId;
46
47
  if (index$1.hasVoiceOver()) {
47
48
  this._voiceOverFallback = (_f = this.validMessage) !== null && _f !== void 0 ? _f : constants.DEFAULT_VALID_MESSAGE;
48
- index$1.delay(() => {
49
+ void index$1.delay(() => {
49
50
  this._voiceOverFallback = "";
50
51
  }, 1000);
51
52
  }
@@ -92,6 +93,26 @@ const DBSwitch = class {
92
93
  this._validMessageId = `${mId}${constants.DEFAULT_VALID_MESSAGE_ID_SUFFIX}`;
93
94
  this._invalidMessageId = `${mId}${constants.DEFAULT_INVALID_MESSAGE_ID_SUFFIX}`;
94
95
  }
96
+ setupObserver(element) {
97
+ if (!element)
98
+ return;
99
+ const parent = element.closest("db-switch");
100
+ if (!parent || this.observer)
101
+ return;
102
+ this.observer = new MutationObserver((mutations) => {
103
+ if (mutations.some((mutation) => {
104
+ var _a;
105
+ const attr = mutation.target.attributes.getNamedItem((_a = mutation.attributeName) !== null && _a !== void 0 ? _a : "");
106
+ return (attr === null || attr === void 0 ? void 0 : attr.value) !== mutation.oldValue;
107
+ })) {
108
+ this.enableAttributePassing(element, "db-switch");
109
+ }
110
+ });
111
+ this.observer.observe(parent, {
112
+ attributes: true,
113
+ attributeOldValue: true,
114
+ });
115
+ }
95
116
  /**
96
117
  * Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.
97
118
  * @param element the ref for the component
@@ -105,10 +126,15 @@ const DBSwitch = class {
105
126
  const attr = attributes.item(i);
106
127
  if (attr && attr.name !== 'data-density' &&
107
128
  (attr.name.startsWith("data-") || attr.name.startsWith("aria-"))) {
108
- element.setAttribute(attr.name, attr.value);
129
+ if (attr.value) {
130
+ element.setAttribute(attr.name, attr.value);
131
+ }
132
+ else {
133
+ element.removeAttribute(attr.name);
134
+ }
109
135
  parent.removeAttribute(attr.name);
110
136
  }
111
- else if (attr && attr.name !== 'data-density' && attr.name !== "class" && attr.name === "style") {
137
+ else if (attr && ["style"].includes(attr.name)) {
112
138
  element.setAttribute(attr.name, attr.value);
113
139
  parent.removeAttribute(attr.name);
114
140
  }
@@ -116,7 +142,7 @@ const DBSwitch = class {
116
142
  const isWebComponent = attr.value.includes("hydrated");
117
143
  const value = attr.value.replace("hydrated", "").trim();
118
144
  const currentClass = element.getAttribute("class");
119
- element.setAttribute(attr.name, `${currentClass ? `${currentClass} ` : ""}${value}`);
145
+ element.setAttribute(attr.name, `${currentClass ? currentClass : ""}${value ? ` ${value}` : ""}`);
120
146
  if (isWebComponent) {
121
147
  // Stencil is using this class for lazy loading component
122
148
  parent.setAttribute("class", "hydrated");
@@ -180,23 +206,31 @@ const DBSwitch = class {
180
206
  }
181
207
  }
182
208
  this.enableAttributePassing(this._ref, "db-switch");
183
- this.resetIds();
184
- this.handleValidation();
185
- this._invalidMessage = this.invalidMessage || constants.DEFAULT_INVALID_MESSAGE;
209
+ const onMountHook_0 = () => {
210
+ this.resetIds();
211
+ this.handleValidation();
212
+ this._invalidMessage = this.invalidMessage || constants.DEFAULT_INVALID_MESSAGE;
213
+ };
214
+ onMountHook_0();
215
+ const onMountHook_1 = () => {
216
+ this.setupObserver(this._ref);
217
+ };
218
+ onMountHook_1();
186
219
  this.watch0Fn();
187
220
  this.watch1Fn();
188
221
  this.watch2Fn();
189
222
  this.watch3Fn();
190
223
  }
191
224
  disconnectedCallback() {
192
- var _a;
225
+ var _a, _b;
193
226
  (_a = this.abortController) === null || _a === void 0 ? void 0 : _a.abort();
227
+ (_b = this.observer) === null || _b === void 0 ? void 0 : _b.disconnect();
194
228
  }
195
229
  render() {
196
230
  var _a, _b;
197
- return (index.h("div", { key: '4580075ad2dc46cce52be60c2738d0fd1033ae74', class: index$1.cls("db-switch", this.className), "data-visual-aid": index$1.getBooleanAsString(this.visualAid, "visualAid"), "data-size": this.size, "data-hide-label": index$1.getHideProp(this.showLabel), "data-variant": this.variant, "data-hide-asterisk": index$1.getHideProp(this.showRequiredAsterisk), "data-custom-validity": this.validation }, index.h("label", { key: 'bb3f0961808c94615181dc7e256a0ee35dcf34b7', htmlFor: this._id }, index.h("input", { key: '352257d398c6808c4a643e97b5505edddec9477c', type: "checkbox", role: "switch", id: this._id, ref: (el) => {
231
+ return (index.h("div", { key: 'e95dafb6d580ef8cfbd54b91ee77da4809984862', class: index$1.cls("db-switch", this.className), "data-visual-aid": index$1.getBooleanAsString(this.visualAid, "visualAid"), "data-size": this.size, "data-hide-label": index$1.getHideProp(this.showLabel), "data-variant": this.variant, "data-hide-asterisk": index$1.getHideProp(this.showRequiredAsterisk), "data-custom-validity": this.validation }, index.h("label", { key: '533173f9a522375012848dbff80b0e357f5e1b30', htmlFor: this._id }, index.h("input", { key: '68e6d40e2b5654508d8ebaf9be66dd56aa39c8f2', type: "checkbox", role: "switch", id: this._id, ref: (el) => {
198
232
  this._ref = el;
199
- }, checked: index$1.getBoolean(this.checked, "checked"), value: this.value, disabled: index$1.getBoolean(this.disabled, "disabled"), "aria-invalid": this.validation === "invalid" ? "true" : undefined, "aria-describedby": this._descByIds, name: this.name, required: index$1.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, index.h("slot", { key: '72b91ff451105158b600372cf2a338feb417488d' })), index$1.stringPropVisible(this.message, this.showMessage) ? (index.h("db-infotext", { size: "small", semantic: "adaptive", id: this._messageId, icon: this.messageIcon }, this.message)) : null, this.hasValidState() ? (index.h("db-infotext", { size: "small", semantic: "successful", id: this._validMessageId }, (_b = this.validMessage) !== null && _b !== void 0 ? _b : constants.DEFAULT_VALID_MESSAGE)) : null, index.h("db-infotext", { key: '77aeba89e7998e2e62f47cf578d087da4881bea1', size: "small", semantic: "critical", id: this._invalidMessageId }, this._invalidMessage), index.h("span", { key: '470358471b50f36f0faa2fe3107768785f5c256a', "data-visually-hidden": "true", role: "status" }, this._voiceOverFallback)));
233
+ }, checked: index$1.getBoolean(this.checked, "checked"), value: this.value, disabled: index$1.getBoolean(this.disabled, "disabled"), "aria-invalid": this.validation === "invalid" ? "true" : undefined, "aria-describedby": this._descByIds, name: this.name, required: index$1.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, index.h("slot", { key: 'a89d78f024905190780c3c8436773ab710115857' })), index$1.stringPropVisible(this.message, this.showMessage) ? (index.h("db-infotext", { size: "small", semantic: "adaptive", id: this._messageId, icon: this.messageIcon }, this.message)) : null, this.hasValidState() ? (index.h("db-infotext", { size: "small", semantic: "successful", id: this._validMessageId }, (_b = this.validMessage) !== null && _b !== void 0 ? _b : constants.DEFAULT_VALID_MESSAGE)) : null, index.h("db-infotext", { key: 'e170d8c368afd61c7c94c10bb2ea13fe4520d692', size: "small", semantic: "critical", id: this._invalidMessageId }, this._invalidMessage), index.h("span", { key: 'd8a5b8e7a5e0f70f245de5756f7b2d19640b4863', "data-visually-hidden": "true", role: "status" }, this._voiceOverFallback)));
200
234
  }
201
235
  get rootElement() { return index.getElement(this); }
202
236
  static get watchers() { return {