@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
@@ -17,6 +17,7 @@ export class DBTextarea {
17
17
  this._value = "";
18
18
  this._voiceOverFallback = "";
19
19
  this.abortController = undefined;
20
+ this.observer = undefined;
20
21
  }
21
22
  hasValidState() {
22
23
  var _a;
@@ -33,7 +34,7 @@ export class DBTextarea {
33
34
  DEFAULT_INVALID_MESSAGE;
34
35
  if (hasVoiceOver()) {
35
36
  this._voiceOverFallback = this._invalidMessage;
36
- delay(() => (this._voiceOverFallback = ""), 1000);
37
+ void delay(() => (this._voiceOverFallback = ""), 1000);
37
38
  }
38
39
  }
39
40
  else if (this.hasValidState() &&
@@ -42,7 +43,7 @@ export class DBTextarea {
42
43
  this._descByIds = this._validMessageId;
43
44
  if (hasVoiceOver()) {
44
45
  this._voiceOverFallback = (_d = this.validMessage) !== null && _d !== void 0 ? _d : DEFAULT_VALID_MESSAGE;
45
- delay(() => (this._voiceOverFallback = ""), 1000);
46
+ void delay(() => (this._voiceOverFallback = ""), 1000);
46
47
  }
47
48
  }
48
49
  else if (stringPropVisible(this.message, this.showMessage)) {
@@ -82,6 +83,26 @@ export class DBTextarea {
82
83
  this._validMessageId = mId + DEFAULT_VALID_MESSAGE_ID_SUFFIX;
83
84
  this._invalidMessageId = mId + DEFAULT_INVALID_MESSAGE_ID_SUFFIX;
84
85
  }
86
+ setupObserver(element) {
87
+ if (!element)
88
+ return;
89
+ const parent = element.closest("db-textarea");
90
+ if (!parent || this.observer)
91
+ return;
92
+ this.observer = new MutationObserver((mutations) => {
93
+ if (mutations.some((mutation) => {
94
+ var _a;
95
+ const attr = mutation.target.attributes.getNamedItem((_a = mutation.attributeName) !== null && _a !== void 0 ? _a : "");
96
+ return (attr === null || attr === void 0 ? void 0 : attr.value) !== mutation.oldValue;
97
+ })) {
98
+ this.enableAttributePassing(element, "db-textarea");
99
+ }
100
+ });
101
+ this.observer.observe(parent, {
102
+ attributes: true,
103
+ attributeOldValue: true,
104
+ });
105
+ }
85
106
  /**
86
107
  * Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.
87
108
  * @param element the ref for the component
@@ -95,10 +116,15 @@ export class DBTextarea {
95
116
  const attr = attributes.item(i);
96
117
  if (attr && attr.name !== 'data-density' &&
97
118
  (attr.name.startsWith("data-") || attr.name.startsWith("aria-"))) {
98
- element.setAttribute(attr.name, attr.value);
119
+ if (attr.value) {
120
+ element.setAttribute(attr.name, attr.value);
121
+ }
122
+ else {
123
+ element.removeAttribute(attr.name);
124
+ }
99
125
  parent.removeAttribute(attr.name);
100
126
  }
101
- else if (attr && attr.name !== 'data-density' && attr.name !== "class" && attr.name === "style") {
127
+ else if (attr && ["style"].includes(attr.name)) {
102
128
  element.setAttribute(attr.name, attr.value);
103
129
  parent.removeAttribute(attr.name);
104
130
  }
@@ -106,7 +132,7 @@ export class DBTextarea {
106
132
  const isWebComponent = attr.value.includes("hydrated");
107
133
  const value = attr.value.replace("hydrated", "").trim();
108
134
  const currentClass = element.getAttribute("class");
109
- element.setAttribute(attr.name, `${currentClass ? `${currentClass} ` : ""}${value}`);
135
+ element.setAttribute(attr.name, `${currentClass ? currentClass : ""}${value ? ` ${value}` : ""}`);
110
136
  if (isWebComponent) {
111
137
  // Stencil is using this class for lazy loading component
112
138
  parent.setAttribute("class", "hydrated");
@@ -189,8 +215,15 @@ export class DBTextarea {
189
215
  }
190
216
  }
191
217
  this.enableAttributePassing(this._ref, "db-textarea");
192
- this.resetIds();
193
- this._invalidMessage = this.invalidMessage || DEFAULT_INVALID_MESSAGE;
218
+ const onMountHook_0 = () => {
219
+ this.resetIds();
220
+ this._invalidMessage = this.invalidMessage || DEFAULT_INVALID_MESSAGE;
221
+ };
222
+ onMountHook_0();
223
+ const onMountHook_1 = () => {
224
+ this.setupObserver(this._ref);
225
+ };
226
+ onMountHook_1();
194
227
  this.watch0Fn();
195
228
  this.watch1Fn();
196
229
  this.watch2Fn();
@@ -198,15 +231,17 @@ export class DBTextarea {
198
231
  this.watch4Fn();
199
232
  }
200
233
  disconnectedCallback() {
201
- var _a;
234
+ var _a, _b;
202
235
  (_a = this.abortController) === null || _a === void 0 ? void 0 : _a.abort();
236
+ (_b = this.observer) === null || _b === void 0 ? void 0 : _b.disconnect();
203
237
  }
204
238
  render() {
205
239
  var _a, _b, _c, _d, _e, _f;
206
- return (h("div", { key: '54e6cdfacbb2aaf120b485926da7500e11a68177', class: cls("db-textarea", this.className), "data-variant": this.variant, "data-hide-asterisk": getHideProp(this.showRequiredAsterisk), "data-hide-label": getHideProp(this.showLabel) }, h("label", { key: '4b4b364ba5c83cf99b3f05ef8a7fdca6ad94aca2', htmlFor: this._id }, (_a = this.label) !== null && _a !== void 0 ? _a : DEFAULT_LABEL), h("textarea", { key: '975252d88460695bac18a6290ffa4175fd6830a4', "aria-invalid": this.validation === "invalid", "data-custom-validity": this.validation, "data-field-sizing": this.fieldSizing, ref: (el) => {
240
+ return (h("div", { key: '86667d91fc82e602b09ee517a82fff23d97966e7', class: cls("db-textarea", this.className), "data-variant": this.variant, "data-hide-asterisk": getHideProp(this.showRequiredAsterisk), "data-hide-label": getHideProp(this.showLabel) }, h("label", { key: '27de9316b7e31d3f72b70ec38413d53a6aa54e3a', htmlFor: this._id }, (_a = this.label) !== null && _a !== void 0 ? _a : DEFAULT_LABEL), h("textarea", { key: '7316f18f473c980ba1cccf4fd52e84b8dc7a98cd', "aria-invalid": this.validation === "invalid", "data-custom-validity": this.validation, "data-field-sizing": this.fieldSizing, ref: (el) => {
207
241
  this._ref = el;
208
242
  }, id: this._id, "data-resize": this.resize, "data-hide-resizer": getHideProp((_b = this.showResizer) !== null && _b !== void 0 ? _b : true), disabled: getBoolean(this.disabled, "disabled"), required: getBoolean(this.required, "required"), readOnly: getBoolean(this.readOnly, "readOnly") ||
209
- getBoolean(this.readonly, "readonly"), form: this.form, maxLength: getNumber(this.maxLength, this.maxlength), minLength: getNumber(this.minLength, this.minlength), name: this.name, wrap: this.wrap, spellcheck: this.spellCheck, autocomplete: this.autocomplete, onInput: (event) => this.handleInput(event), onChange: (event) => this.handleChange(event), onBlur: (event) => this.handleBlur(event), onFocus: (event) => this.handleFocus(event), value: (_d = (_c = this.value) !== null && _c !== void 0 ? _c : this._value) !== null && _d !== void 0 ? _d : "", "aria-describedby": (_e = this.ariaDescribedBy) !== null && _e !== void 0 ? _e : this._descByIds, placeholder: (_f = this.placeholder) !== null && _f !== void 0 ? _f : DEFAULT_PLACEHOLDER, rows: getNumber(this.rows, DEFAULT_ROWS), cols: getNumber(this.cols) }), stringPropVisible(this.message, this.showMessage) ? (h("db-infotext", { size: "small", icon: this.messageIcon, id: this._messageId }, this.message)) : null, this.hasValidState() ? (h("db-infotext", { size: "small", semantic: "successful", id: this._validMessageId }, this.validMessage || DEFAULT_VALID_MESSAGE)) : null, h("db-infotext", { key: '6991559466d3a62e284ad2fa623b03c6c15e478a', size: "small", semantic: "critical", id: this._invalidMessageId }, this._invalidMessage), h("span", { key: '548f46a7cc2d3489d3022d2e2b5d3a7654ebd372', "data-visually-hidden": "true", role: "status" }, this._voiceOverFallback)));
243
+ getBoolean(this.readonly, "readonly") ||
244
+ undefined, form: this.form, maxLength: getNumber(this.maxLength, this.maxlength), minLength: getNumber(this.minLength, this.minlength), name: this.name, wrap: this.wrap, spellcheck: this.spellCheck, autocomplete: this.autocomplete, onInput: (event) => this.handleInput(event), onChange: (event) => this.handleChange(event), onBlur: (event) => this.handleBlur(event), onFocus: (event) => this.handleFocus(event), value: (_d = (_c = this.value) !== null && _c !== void 0 ? _c : this._value) !== null && _d !== void 0 ? _d : "", "aria-describedby": (_e = this.ariaDescribedBy) !== null && _e !== void 0 ? _e : this._descByIds, placeholder: (_f = this.placeholder) !== null && _f !== void 0 ? _f : DEFAULT_PLACEHOLDER, rows: getNumber(this.rows, DEFAULT_ROWS), cols: getNumber(this.cols) }), stringPropVisible(this.message, this.showMessage) ? (h("db-infotext", { size: "small", icon: this.messageIcon, id: this._messageId }, this.message)) : null, this.hasValidState() ? (h("db-infotext", { size: "small", semantic: "successful", id: this._validMessageId }, this.validMessage || DEFAULT_VALID_MESSAGE)) : null, h("db-infotext", { key: '86ad7a246adc37d20e4b0314429202797520f39e', size: "small", semantic: "critical", id: this._invalidMessageId }, this._invalidMessage), h("span", { key: '594923a0e9bb1ebd905c665c4f3d185b2f425bd5', "data-visually-hidden": "true", role: "status" }, this._voiceOverFallback)));
210
245
  }
211
246
  static get is() { return "db-textarea"; }
212
247
  static get properties() {
@@ -1105,7 +1140,8 @@ export class DBTextarea {
1105
1140
  "_descByIds": {},
1106
1141
  "_value": {},
1107
1142
  "_voiceOverFallback": {},
1108
- "abortController": {}
1143
+ "abortController": {},
1144
+ "observer": {}
1109
1145
  };
1110
1146
  }
1111
1147
  static get events() {
@@ -13,6 +13,11 @@ export class DBTooltip {
13
13
  this.initialized = false;
14
14
  this._documentScrollListenerCallbackId = undefined;
15
15
  this._observer = undefined;
16
+ this._attachedParent = undefined;
17
+ this._attachedId = undefined;
18
+ this._activeTriggerCount = 0;
19
+ this._boundListeners = [];
20
+ this.observer = undefined;
16
21
  }
17
22
  handleClick(event) {
18
23
  event.stopPropagation();
@@ -53,23 +58,93 @@ export class DBTooltip {
53
58
  }
54
59
  }
55
60
  handleLeave() {
56
- var _a;
61
+ var _a, _b, _c;
62
+ // Multiple triggers (hover + focus) can be active at once. Only tear
63
+ // down the shared scroll callback/observer once the last one leaves.
64
+ this._activeTriggerCount = Math.max(((_a = this._activeTriggerCount) !== null && _a !== void 0 ? _a : 0) - 1, 0);
65
+ if (((_b = this._activeTriggerCount) !== null && _b !== void 0 ? _b : 0) > 0) {
66
+ return;
67
+ }
57
68
  if (this._documentScrollListenerCallbackId) {
58
69
  new DocumentScrollListener().removeCallback(this._documentScrollListenerCallbackId);
70
+ this._documentScrollListenerCallbackId = undefined;
59
71
  }
60
- (_a = this._observer) === null || _a === void 0 ? void 0 : _a.unobserve(this.getParent());
72
+ (_c = this._observer) === null || _c === void 0 ? void 0 : _c.unobserve(this.getParent());
61
73
  }
62
74
  handleEnter(parent) {
63
- var _a;
64
- this._documentScrollListenerCallbackId =
65
- new DocumentScrollListener().addCallback((event) => this.handleDocumentScroll(event, parent));
75
+ var _a, _b;
76
+ // Register the shared scroll callback only for the first active
77
+ // trigger; a second enter (e.g. focusin after mouseenter) must not
78
+ // orphan the first callback.
79
+ this._activeTriggerCount = ((_a = this._activeTriggerCount) !== null && _a !== void 0 ? _a : 0) + 1;
80
+ if (this._activeTriggerCount === 1) {
81
+ this._documentScrollListenerCallbackId =
82
+ new DocumentScrollListener().addCallback((event) => this.handleDocumentScroll(event, parent));
83
+ (_b = this._observer) === null || _b === void 0 ? void 0 : _b.observe(this.getParent());
84
+ }
66
85
  this.handleAutoPlacement(parent);
67
- (_a = this._observer) === null || _a === void 0 ? void 0 : _a.observe(this.getParent());
68
86
  }
69
87
  resetIds() {
70
88
  var _a, _b, _c;
71
89
  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 : "tooltip-" + uuid();
72
90
  }
91
+ _detachListeners() {
92
+ var _a, _b, _c;
93
+ const callbackId = this._documentScrollListenerCallbackId;
94
+ if (callbackId) {
95
+ new DocumentScrollListener().removeCallback(callbackId);
96
+ this._documentScrollListenerCallbackId = undefined;
97
+ }
98
+ (_a = this._observer) === null || _a === void 0 ? void 0 : _a.disconnect();
99
+ this._observer = undefined;
100
+ this._activeTriggerCount = 0;
101
+ const bound = (_b = this._boundListeners) !== null && _b !== void 0 ? _b : [];
102
+ bound.forEach((entry) => {
103
+ entry.parent.removeEventListener(entry.type, entry.fn);
104
+ });
105
+ this._boundListeners = [];
106
+ // Remove attributes this tooltip set on its parent, but only while
107
+ // they still belong to this tooltip (avoid clobbering another one).
108
+ const parent = this._attachedParent;
109
+ if (parent) {
110
+ const attachedId = (_c = this._attachedId) !== null && _c !== void 0 ? _c : this._id;
111
+ // Only remove data-has-tooltip when no other .db-tooltip
112
+ // siblings remain inside the same parent.
113
+ const remainingTooltips = parent.querySelectorAll(".db-tooltip");
114
+ const otherTooltipsExist = Array.from(remainingTooltips).some((el) => el !== this._ref);
115
+ if (parent.dataset["hasTooltip"] === "true" && !otherTooltipsExist) {
116
+ delete parent.dataset["hasTooltip"];
117
+ }
118
+ if (parent.getAttribute("aria-labelledby") === attachedId) {
119
+ parent.removeAttribute("aria-labelledby");
120
+ }
121
+ if (parent.getAttribute("aria-describedby") === attachedId) {
122
+ parent.removeAttribute("aria-describedby");
123
+ }
124
+ this._attachedParent = undefined;
125
+ this._attachedId = undefined;
126
+ }
127
+ }
128
+ setupObserver(element) {
129
+ if (!element)
130
+ return;
131
+ const parent = element.closest("db-tooltip");
132
+ if (!parent || this.observer)
133
+ return;
134
+ this.observer = new MutationObserver((mutations) => {
135
+ if (mutations.some((mutation) => {
136
+ var _a;
137
+ const attr = mutation.target.attributes.getNamedItem((_a = mutation.attributeName) !== null && _a !== void 0 ? _a : "");
138
+ return (attr === null || attr === void 0 ? void 0 : attr.value) !== mutation.oldValue;
139
+ })) {
140
+ this.enableAttributePassing(element, "db-tooltip");
141
+ }
142
+ });
143
+ this.observer.observe(parent, {
144
+ attributes: true,
145
+ attributeOldValue: true,
146
+ });
147
+ }
73
148
  /**
74
149
  * Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.
75
150
  * @param element the ref for the component
@@ -83,10 +158,15 @@ export class DBTooltip {
83
158
  const attr = attributes.item(i);
84
159
  if (attr && attr.name !== 'data-density' &&
85
160
  (attr.name.startsWith("data-") || attr.name.startsWith("aria-"))) {
86
- element.setAttribute(attr.name, attr.value);
161
+ if (attr.value) {
162
+ element.setAttribute(attr.name, attr.value);
163
+ }
164
+ else {
165
+ element.removeAttribute(attr.name);
166
+ }
87
167
  parent.removeAttribute(attr.name);
88
168
  }
89
- else if (attr && attr.name !== 'data-density' && attr.name !== "class" && attr.name === "style") {
169
+ else if (attr && ["style"].includes(attr.name)) {
90
170
  element.setAttribute(attr.name, attr.value);
91
171
  parent.removeAttribute(attr.name);
92
172
  }
@@ -94,7 +174,7 @@ export class DBTooltip {
94
174
  const isWebComponent = attr.value.includes("hydrated");
95
175
  const value = attr.value.replace("hydrated", "").trim();
96
176
  const currentClass = element.getAttribute("class");
97
- element.setAttribute(attr.name, `${currentClass ? `${currentClass} ` : ""}${value}`);
177
+ element.setAttribute(attr.name, `${currentClass ? currentClass : ""}${value ? ` ${value}` : ""}`);
98
178
  if (isWebComponent) {
99
179
  // Stencil is using this class for lazy loading component
100
180
  parent.setAttribute("class", "hydrated");
@@ -116,17 +196,47 @@ export class DBTooltip {
116
196
  this.watch0Fn();
117
197
  }
118
198
  watch1Fn() {
199
+ var _a;
119
200
  if (this._ref && this.initialized && this._id) {
120
201
  const parent = this.getParent();
121
202
  if (parent) {
122
203
  this.handleAutoPlacement(parent);
123
- ["mouseenter", "focusin"].forEach((event) => {
124
- parent.addEventListener(event, () => this.handleEnter(parent));
125
- });
126
- parent.addEventListener("keydown", (event) => this.handleEscape(event));
127
- ["mouseleave", "focusout"].forEach((event) => {
128
- parent.addEventListener(event, () => this.handleLeave());
129
- });
204
+ const enterListener = () => this.handleEnter(parent);
205
+ const leaveListener = () => this.handleLeave();
206
+ const keyDownListener = (event) => this.handleEscape(event);
207
+ parent.addEventListener("mouseenter", enterListener);
208
+ parent.addEventListener("focusin", enterListener);
209
+ parent.addEventListener("keydown", keyDownListener);
210
+ parent.addEventListener("mouseleave", leaveListener);
211
+ parent.addEventListener("focusout", leaveListener);
212
+ this._boundListeners = [
213
+ ...((_a = this._boundListeners) !== null && _a !== void 0 ? _a : []),
214
+ {
215
+ parent,
216
+ type: "mouseenter",
217
+ fn: enterListener,
218
+ },
219
+ {
220
+ parent,
221
+ type: "focusin",
222
+ fn: enterListener,
223
+ },
224
+ {
225
+ parent,
226
+ type: "keydown",
227
+ fn: keyDownListener,
228
+ },
229
+ {
230
+ parent,
231
+ type: "mouseleave",
232
+ fn: leaveListener,
233
+ },
234
+ {
235
+ parent,
236
+ type: "focusout",
237
+ fn: leaveListener,
238
+ },
239
+ ];
130
240
  parent.dataset["hasTooltip"] = "true";
131
241
  if (this.variant === "label") {
132
242
  parent.setAttribute("aria-labelledby", this._id);
@@ -134,6 +244,8 @@ export class DBTooltip {
134
244
  else {
135
245
  parent.setAttribute("aria-describedby", this._id);
136
246
  }
247
+ this._attachedParent = parent;
248
+ this._attachedId = this._id;
137
249
  }
138
250
  if (typeof window !== "undefined" && "IntersectionObserver" in window) {
139
251
  this._observer = new IntersectionObserver((payload) => {
@@ -157,16 +269,28 @@ export class DBTooltip {
157
269
  }
158
270
  }
159
271
  this.enableAttributePassing(this._ref, "db-tooltip");
160
- this.resetIds();
161
- this.initialized = true;
272
+ const onMountHook_0 = () => {
273
+ this.resetIds();
274
+ this.initialized = true;
275
+ };
276
+ onMountHook_0();
277
+ const onMountHook_1 = () => {
278
+ this.setupObserver(this._ref);
279
+ };
280
+ onMountHook_1();
162
281
  this.watch0Fn();
163
282
  this.watch1Fn();
164
283
  }
284
+ disconnectedCallback() {
285
+ var _a;
286
+ this._detachListeners();
287
+ (_a = this.observer) === null || _a === void 0 ? void 0 : _a.disconnect();
288
+ }
165
289
  render() {
166
290
  var _a, _b;
167
- return (h("i", { key: '2636a6f606a970f585a00c7268542b8bf8f59644', class: cls("db-tooltip", this.className), role: "tooltip", "aria-hidden": "true", "data-gap": "true", ref: (el) => {
291
+ return (h("i", { key: '8b8269b2bf4c0708c437a33101537999ab9035b5', class: cls("db-tooltip", this.className), role: "tooltip", "aria-hidden": "true", "data-gap": "true", ref: (el) => {
168
292
  this._ref = el;
169
- }, id: this._id, "data-emphasis": this.emphasis, "data-wrap": getBooleanAsString(this.wrap, "wrap"), "data-animation": getBooleanAsString((_a = this.animation) !== null && _a !== void 0 ? _a : true, "animation"), "data-delay": this.delay, "data-width": this.width, "data-show-arrow": getBooleanAsString((_b = this.showArrow) !== null && _b !== void 0 ? _b : true, "showArrow"), "data-placement": this.placement, onClick: (event) => this.handleClick(event) }, this.text ? this.text : null, h("slot", { key: 'cf37293fac4206d6c6b97a0d1b063ba28c3f4d3d' })));
293
+ }, id: this._id, "data-emphasis": this.emphasis, "data-wrap": getBooleanAsString(this.wrap, "wrap"), "data-animation": getBooleanAsString((_a = this.animation) !== null && _a !== void 0 ? _a : true, "animation"), "data-delay": this.delay, "data-width": this.width, "data-show-arrow": getBooleanAsString((_b = this.showArrow) !== null && _b !== void 0 ? _b : true, "showArrow"), "data-placement": this.placement, onClick: (event) => this.handleClick(event) }, this.text ? this.text : null, h("slot", { key: '54c19cf96a0e2ce8be7b345f149d484a6498c3a1' })));
170
294
  }
171
295
  static get is() { return "db-tooltip"; }
172
296
  static get properties() {
@@ -488,7 +612,12 @@ export class DBTooltip {
488
612
  "_id": {},
489
613
  "initialized": {},
490
614
  "_documentScrollListenerCallbackId": {},
491
- "_observer": {}
615
+ "_observer": {},
616
+ "_attachedParent": {},
617
+ "_attachedId": {},
618
+ "_activeTriggerCount": {},
619
+ "_boundListeners": {},
620
+ "observer": {}
492
621
  };
493
622
  }
494
623
  static get elementRef() { return "rootElement"; }