@db-ux/wc-core-components 1.0.0-test-13b991d

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 (533) hide show
  1. package/README.md +92 -0
  2. package/dist/cjs/app-globals-3a1e7e63.js +7 -0
  3. package/dist/cjs/app-globals-3a1e7e63.js.map +1 -0
  4. package/dist/cjs/constants-89822e5f.js +116 -0
  5. package/dist/cjs/constants-89822e5f.js.map +1 -0
  6. package/dist/cjs/db-accordion-item.cjs.entry.js +73 -0
  7. package/dist/cjs/db-accordion-item.cjs.entry.js.map +1 -0
  8. package/dist/cjs/db-accordion.cjs.entry.js +130 -0
  9. package/dist/cjs/db-accordion.cjs.entry.js.map +1 -0
  10. package/dist/cjs/db-badge.cjs.entry.js +75 -0
  11. package/dist/cjs/db-badge.cjs.entry.js.map +1 -0
  12. package/dist/cjs/db-brand.cjs.entry.js +58 -0
  13. package/dist/cjs/db-brand.cjs.entry.js.map +1 -0
  14. package/dist/cjs/db-button.cjs.entry.js +62 -0
  15. package/dist/cjs/db-button.cjs.entry.js.map +1 -0
  16. package/dist/cjs/db-card.cjs.entry.js +62 -0
  17. package/dist/cjs/db-card.cjs.entry.js.map +1 -0
  18. package/dist/cjs/db-checkbox.cjs.entry.js +149 -0
  19. package/dist/cjs/db-checkbox.cjs.entry.js.map +1 -0
  20. package/dist/cjs/db-divider.cjs.entry.js +56 -0
  21. package/dist/cjs/db-divider.cjs.entry.js.map +1 -0
  22. package/dist/cjs/db-drawer.cjs.entry.js +108 -0
  23. package/dist/cjs/db-drawer.cjs.entry.js.map +1 -0
  24. package/dist/cjs/db-header.cjs.entry.js +89 -0
  25. package/dist/cjs/db-header.cjs.entry.js.map +1 -0
  26. package/dist/cjs/db-icon.cjs.entry.js +56 -0
  27. package/dist/cjs/db-icon.cjs.entry.js.map +1 -0
  28. package/dist/cjs/db-infotext.cjs.entry.js +57 -0
  29. package/dist/cjs/db-infotext.cjs.entry.js.map +1 -0
  30. package/dist/cjs/db-input.cjs.entry.js +157 -0
  31. package/dist/cjs/db-input.cjs.entry.js.map +1 -0
  32. package/dist/cjs/db-link.cjs.entry.js +63 -0
  33. package/dist/cjs/db-link.cjs.entry.js.map +1 -0
  34. package/dist/cjs/db-navigation-item.cjs.entry.js +102 -0
  35. package/dist/cjs/db-navigation-item.cjs.entry.js.map +1 -0
  36. package/dist/cjs/db-navigation.cjs.entry.js +59 -0
  37. package/dist/cjs/db-navigation.cjs.entry.js.map +1 -0
  38. package/dist/cjs/db-notification.cjs.entry.js +64 -0
  39. package/dist/cjs/db-notification.cjs.entry.js.map +1 -0
  40. package/dist/cjs/db-page.cjs.entry.js +73 -0
  41. package/dist/cjs/db-page.cjs.entry.js.map +1 -0
  42. package/dist/cjs/db-popover.cjs.entry.js +113 -0
  43. package/dist/cjs/db-popover.cjs.entry.js.map +1 -0
  44. package/dist/cjs/db-radio.cjs.entry.js +98 -0
  45. package/dist/cjs/db-radio.cjs.entry.js.map +1 -0
  46. package/dist/cjs/db-section.cjs.entry.js +59 -0
  47. package/dist/cjs/db-section.cjs.entry.js.map +1 -0
  48. package/dist/cjs/db-select.cjs.entry.js +170 -0
  49. package/dist/cjs/db-select.cjs.entry.js.map +1 -0
  50. package/dist/cjs/db-stack.cjs.entry.js +56 -0
  51. package/dist/cjs/db-stack.cjs.entry.js.map +1 -0
  52. package/dist/cjs/db-switch.cjs.entry.js +91 -0
  53. package/dist/cjs/db-switch.cjs.entry.js.map +1 -0
  54. package/dist/cjs/db-tab-item_3.cjs.entry.js +175 -0
  55. package/dist/cjs/db-tab-item_3.cjs.entry.js.map +1 -0
  56. package/dist/cjs/db-tabs.cjs.entry.js +173 -0
  57. package/dist/cjs/db-tabs.cjs.entry.js.map +1 -0
  58. package/dist/cjs/db-tag.cjs.entry.js +83 -0
  59. package/dist/cjs/db-tag.cjs.entry.js.map +1 -0
  60. package/dist/cjs/db-textarea.cjs.entry.js +144 -0
  61. package/dist/cjs/db-textarea.cjs.entry.js.map +1 -0
  62. package/dist/cjs/db-tooltip.cjs.entry.js +86 -0
  63. package/dist/cjs/db-tooltip.cjs.entry.js.map +1 -0
  64. package/dist/cjs/db-ux.cjs.js +27 -0
  65. package/dist/cjs/db-ux.cjs.js.map +1 -0
  66. package/dist/cjs/index-3d093f06.js +1496 -0
  67. package/dist/cjs/index-3d093f06.js.map +1 -0
  68. package/dist/cjs/index-c0df827d.js +169 -0
  69. package/dist/cjs/index-c0df827d.js.map +1 -0
  70. package/dist/cjs/index.cjs.js +118 -0
  71. package/dist/cjs/index.cjs.js.map +1 -0
  72. package/dist/cjs/loader.cjs.js +17 -0
  73. package/dist/cjs/loader.cjs.js.map +1 -0
  74. package/dist/cjs/navigation-bb2d5552.js +140 -0
  75. package/dist/cjs/navigation-bb2d5552.js.map +1 -0
  76. package/dist/collection/collection-manifest.json +42 -0
  77. package/dist/collection/components/accordion/accordion.js +311 -0
  78. package/dist/collection/components/accordion/accordion.js.map +1 -0
  79. package/dist/collection/components/accordion/index.js +3 -0
  80. package/dist/collection/components/accordion/index.js.map +1 -0
  81. package/dist/collection/components/accordion/model.js +3 -0
  82. package/dist/collection/components/accordion/model.js.map +1 -0
  83. package/dist/collection/components/accordion-item/accordion-item.js +246 -0
  84. package/dist/collection/components/accordion-item/accordion-item.js.map +1 -0
  85. package/dist/collection/components/accordion-item/index.js +3 -0
  86. package/dist/collection/components/accordion-item/index.js.map +1 -0
  87. package/dist/collection/components/accordion-item/model.js +2 -0
  88. package/dist/collection/components/accordion-item/model.js.map +1 -0
  89. package/dist/collection/components/badge/badge.js +280 -0
  90. package/dist/collection/components/badge/badge.js.map +1 -0
  91. package/dist/collection/components/badge/index.js +3 -0
  92. package/dist/collection/components/badge/index.js.map +1 -0
  93. package/dist/collection/components/badge/model.js +2 -0
  94. package/dist/collection/components/badge/model.js.map +1 -0
  95. package/dist/collection/components/brand/brand.js +206 -0
  96. package/dist/collection/components/brand/brand.js.map +1 -0
  97. package/dist/collection/components/brand/index.js +3 -0
  98. package/dist/collection/components/brand/index.js.map +1 -0
  99. package/dist/collection/components/brand/model.js +2 -0
  100. package/dist/collection/components/brand/model.js.map +1 -0
  101. package/dist/collection/components/button/button.js +527 -0
  102. package/dist/collection/components/button/button.js.map +1 -0
  103. package/dist/collection/components/button/index.js +3 -0
  104. package/dist/collection/components/button/index.js.map +1 -0
  105. package/dist/collection/components/button/model.js +4 -0
  106. package/dist/collection/components/button/model.js.map +1 -0
  107. package/dist/collection/components/card/card.js +202 -0
  108. package/dist/collection/components/card/card.js.map +1 -0
  109. package/dist/collection/components/card/index.js +3 -0
  110. package/dist/collection/components/card/index.js.map +1 -0
  111. package/dist/collection/components/card/model.js +3 -0
  112. package/dist/collection/components/card/model.js.map +1 -0
  113. package/dist/collection/components/checkbox/checkbox.js +699 -0
  114. package/dist/collection/components/checkbox/checkbox.js.map +1 -0
  115. package/dist/collection/components/checkbox/index.js +3 -0
  116. package/dist/collection/components/checkbox/index.js.map +1 -0
  117. package/dist/collection/components/checkbox/model.js +2 -0
  118. package/dist/collection/components/checkbox/model.js.map +1 -0
  119. package/dist/collection/components/divider/divider.js +204 -0
  120. package/dist/collection/components/divider/divider.js.map +1 -0
  121. package/dist/collection/components/divider/index.js +3 -0
  122. package/dist/collection/components/divider/index.js.map +1 -0
  123. package/dist/collection/components/divider/model.js +3 -0
  124. package/dist/collection/components/divider/model.js.map +1 -0
  125. package/dist/collection/components/drawer/drawer.js +398 -0
  126. package/dist/collection/components/drawer/drawer.js.map +1 -0
  127. package/dist/collection/components/drawer/index.js +3 -0
  128. package/dist/collection/components/drawer/index.js.map +1 -0
  129. package/dist/collection/components/drawer/model.js +4 -0
  130. package/dist/collection/components/drawer/model.js.map +1 -0
  131. package/dist/collection/components/header/header.js +266 -0
  132. package/dist/collection/components/header/header.js.map +1 -0
  133. package/dist/collection/components/header/index.js +3 -0
  134. package/dist/collection/components/header/index.js.map +1 -0
  135. package/dist/collection/components/header/model.js +2 -0
  136. package/dist/collection/components/header/model.js.map +1 -0
  137. package/dist/collection/components/icon/icon.js +204 -0
  138. package/dist/collection/components/icon/icon.js.map +1 -0
  139. package/dist/collection/components/icon/index.js +3 -0
  140. package/dist/collection/components/icon/index.js.map +1 -0
  141. package/dist/collection/components/icon/model.js +3 -0
  142. package/dist/collection/components/icon/model.js.map +1 -0
  143. package/dist/collection/components/infotext/index.js +3 -0
  144. package/dist/collection/components/infotext/index.js.map +1 -0
  145. package/dist/collection/components/infotext/infotext.js +230 -0
  146. package/dist/collection/components/infotext/infotext.js.map +1 -0
  147. package/dist/collection/components/infotext/model.js +2 -0
  148. package/dist/collection/components/infotext/model.js.map +1 -0
  149. package/dist/collection/components/input/index.js +3 -0
  150. package/dist/collection/components/input/index.js.map +1 -0
  151. package/dist/collection/components/input/input.js +1118 -0
  152. package/dist/collection/components/input/input.js.map +1 -0
  153. package/dist/collection/components/input/model.js +6 -0
  154. package/dist/collection/components/input/model.js.map +1 -0
  155. package/dist/collection/components/link/index.js +3 -0
  156. package/dist/collection/components/link/index.js.map +1 -0
  157. package/dist/collection/components/link/link.js +478 -0
  158. package/dist/collection/components/link/link.js.map +1 -0
  159. package/dist/collection/components/link/model.js +4 -0
  160. package/dist/collection/components/link/model.js.map +1 -0
  161. package/dist/collection/components/navigation/index.js +3 -0
  162. package/dist/collection/components/navigation/index.js.map +1 -0
  163. package/dist/collection/components/navigation/model.js +2 -0
  164. package/dist/collection/components/navigation/model.js.map +1 -0
  165. package/dist/collection/components/navigation/navigation.js +139 -0
  166. package/dist/collection/components/navigation/navigation.js.map +1 -0
  167. package/dist/collection/components/navigation-item/index.js +3 -0
  168. package/dist/collection/components/navigation-item/index.js.map +1 -0
  169. package/dist/collection/components/navigation-item/model.js +2 -0
  170. package/dist/collection/components/navigation-item/model.js.map +1 -0
  171. package/dist/collection/components/navigation-item/navigation-item.js +404 -0
  172. package/dist/collection/components/navigation-item/navigation-item.js.map +1 -0
  173. package/dist/collection/components/notification/index.js +3 -0
  174. package/dist/collection/components/notification/index.js.map +1 -0
  175. package/dist/collection/components/notification/model.js +4 -0
  176. package/dist/collection/components/notification/model.js.map +1 -0
  177. package/dist/collection/components/notification/notification.js +480 -0
  178. package/dist/collection/components/notification/notification.js.map +1 -0
  179. package/dist/collection/components/page/index.js +3 -0
  180. package/dist/collection/components/page/index.js.map +1 -0
  181. package/dist/collection/components/page/model.js +3 -0
  182. package/dist/collection/components/page/model.js.map +1 -0
  183. package/dist/collection/components/page/page.js +204 -0
  184. package/dist/collection/components/page/page.js.map +1 -0
  185. package/dist/collection/components/popover/index.js +3 -0
  186. package/dist/collection/components/popover/index.js.map +1 -0
  187. package/dist/collection/components/popover/model.js +2 -0
  188. package/dist/collection/components/popover/model.js.map +1 -0
  189. package/dist/collection/components/popover/popover.js +344 -0
  190. package/dist/collection/components/popover/popover.js.map +1 -0
  191. package/dist/collection/components/radio/index.js +3 -0
  192. package/dist/collection/components/radio/index.js.map +1 -0
  193. package/dist/collection/components/radio/model.js +2 -0
  194. package/dist/collection/components/radio/model.js.map +1 -0
  195. package/dist/collection/components/radio/radio.js +518 -0
  196. package/dist/collection/components/radio/radio.js.map +1 -0
  197. package/dist/collection/components/section/index.js +3 -0
  198. package/dist/collection/components/section/index.js.map +1 -0
  199. package/dist/collection/components/section/model.js +2 -0
  200. package/dist/collection/components/section/model.js.map +1 -0
  201. package/dist/collection/components/section/section.js +164 -0
  202. package/dist/collection/components/section/section.js.map +1 -0
  203. package/dist/collection/components/select/index.js +3 -0
  204. package/dist/collection/components/select/index.js.map +1 -0
  205. package/dist/collection/components/select/model.js +2 -0
  206. package/dist/collection/components/select/model.js.map +1 -0
  207. package/dist/collection/components/select/select.js +846 -0
  208. package/dist/collection/components/select/select.js.map +1 -0
  209. package/dist/collection/components/stack/index.js +3 -0
  210. package/dist/collection/components/stack/index.js.map +1 -0
  211. package/dist/collection/components/stack/model.js +5 -0
  212. package/dist/collection/components/stack/model.js.map +1 -0
  213. package/dist/collection/components/stack/stack.js +254 -0
  214. package/dist/collection/components/stack/stack.js.map +1 -0
  215. package/dist/collection/components/switch/index.js +3 -0
  216. package/dist/collection/components/switch/index.js.map +1 -0
  217. package/dist/collection/components/switch/model.js +2 -0
  218. package/dist/collection/components/switch/model.js.map +1 -0
  219. package/dist/collection/components/switch/switch.js +587 -0
  220. package/dist/collection/components/switch/switch.js.map +1 -0
  221. package/dist/collection/components/tab-item/index.js +3 -0
  222. package/dist/collection/components/tab-item/index.js.map +1 -0
  223. package/dist/collection/components/tab-item/model.js +2 -0
  224. package/dist/collection/components/tab-item/model.js.map +1 -0
  225. package/dist/collection/components/tab-item/tab-item.js +399 -0
  226. package/dist/collection/components/tab-item/tab-item.js.map +1 -0
  227. package/dist/collection/components/tab-list/index.js +3 -0
  228. package/dist/collection/components/tab-list/index.js.map +1 -0
  229. package/dist/collection/components/tab-list/model.js +2 -0
  230. package/dist/collection/components/tab-list/model.js.map +1 -0
  231. package/dist/collection/components/tab-list/tab-list.js +114 -0
  232. package/dist/collection/components/tab-list/tab-list.js.map +1 -0
  233. package/dist/collection/components/tab-panel/index.js +3 -0
  234. package/dist/collection/components/tab-panel/index.js.map +1 -0
  235. package/dist/collection/components/tab-panel/model.js +2 -0
  236. package/dist/collection/components/tab-panel/model.js.map +1 -0
  237. package/dist/collection/components/tab-panel/tab-panel.js +154 -0
  238. package/dist/collection/components/tab-panel/tab-panel.js.map +1 -0
  239. package/dist/collection/components/tabs/index.js +3 -0
  240. package/dist/collection/components/tabs/index.js.map +1 -0
  241. package/dist/collection/components/tabs/model.js +3 -0
  242. package/dist/collection/components/tabs/model.js.map +1 -0
  243. package/dist/collection/components/tabs/tabs.js +458 -0
  244. package/dist/collection/components/tabs/tabs.js.map +1 -0
  245. package/dist/collection/components/tag/index.js +3 -0
  246. package/dist/collection/components/tag/index.js.map +1 -0
  247. package/dist/collection/components/tag/model.js +2 -0
  248. package/dist/collection/components/tag/model.js.map +1 -0
  249. package/dist/collection/components/tag/tag.js +430 -0
  250. package/dist/collection/components/tag/tag.js.map +1 -0
  251. package/dist/collection/components/textarea/index.js +3 -0
  252. package/dist/collection/components/textarea/index.js.map +1 -0
  253. package/dist/collection/components/textarea/model.js +3 -0
  254. package/dist/collection/components/textarea/model.js.map +1 -0
  255. package/dist/collection/components/textarea/textarea.js +956 -0
  256. package/dist/collection/components/textarea/textarea.js.map +1 -0
  257. package/dist/collection/components/tooltip/index.js +3 -0
  258. package/dist/collection/components/tooltip/index.js.map +1 -0
  259. package/dist/collection/components/tooltip/model.js +2 -0
  260. package/dist/collection/components/tooltip/model.js.map +1 -0
  261. package/dist/collection/components/tooltip/tooltip.js +292 -0
  262. package/dist/collection/components/tooltip/tooltip.js.map +1 -0
  263. package/dist/collection/index.js +37 -0
  264. package/dist/collection/index.js.map +1 -0
  265. package/dist/collection/shared/constants.js +88 -0
  266. package/dist/collection/shared/constants.js.map +1 -0
  267. package/dist/collection/shared/model.js +22 -0
  268. package/dist/collection/shared/model.js.map +1 -0
  269. package/dist/collection/utils/form-components.js +11 -0
  270. package/dist/collection/utils/form-components.js.map +1 -0
  271. package/dist/collection/utils/index.js +167 -0
  272. package/dist/collection/utils/index.js.map +1 -0
  273. package/dist/collection/utils/navigation.js +137 -0
  274. package/dist/collection/utils/navigation.js.map +1 -0
  275. package/dist/custom-elements.json +13474 -0
  276. package/dist/db-ux/db-ux.esm.js +2 -0
  277. package/dist/db-ux/db-ux.esm.js.map +1 -0
  278. package/dist/db-ux/index.esm.js +2 -0
  279. package/dist/db-ux/index.esm.js.map +1 -0
  280. package/dist/db-ux/p-031e9fbf.entry.js +2 -0
  281. package/dist/db-ux/p-031e9fbf.entry.js.map +1 -0
  282. package/dist/db-ux/p-08126c21.entry.js +2 -0
  283. package/dist/db-ux/p-08126c21.entry.js.map +1 -0
  284. package/dist/db-ux/p-1066cd52.entry.js +2 -0
  285. package/dist/db-ux/p-1066cd52.entry.js.map +1 -0
  286. package/dist/db-ux/p-10d30f53.entry.js +2 -0
  287. package/dist/db-ux/p-10d30f53.entry.js.map +1 -0
  288. package/dist/db-ux/p-1566cfef.entry.js +2 -0
  289. package/dist/db-ux/p-1566cfef.entry.js.map +1 -0
  290. package/dist/db-ux/p-1c12853c.entry.js +2 -0
  291. package/dist/db-ux/p-1c12853c.entry.js.map +1 -0
  292. package/dist/db-ux/p-1feee149.js +3 -0
  293. package/dist/db-ux/p-1feee149.js.map +1 -0
  294. package/dist/db-ux/p-2d32aa06.entry.js +2 -0
  295. package/dist/db-ux/p-2d32aa06.entry.js.map +1 -0
  296. package/dist/db-ux/p-2e318e2a.entry.js +2 -0
  297. package/dist/db-ux/p-2e318e2a.entry.js.map +1 -0
  298. package/dist/db-ux/p-34f88e4e.js +2 -0
  299. package/dist/db-ux/p-34f88e4e.js.map +1 -0
  300. package/dist/db-ux/p-3f2e2d87.entry.js +2 -0
  301. package/dist/db-ux/p-3f2e2d87.entry.js.map +1 -0
  302. package/dist/db-ux/p-43aa16d7.entry.js +2 -0
  303. package/dist/db-ux/p-43aa16d7.entry.js.map +1 -0
  304. package/dist/db-ux/p-5a689165.entry.js +2 -0
  305. package/dist/db-ux/p-5a689165.entry.js.map +1 -0
  306. package/dist/db-ux/p-683d690f.entry.js +2 -0
  307. package/dist/db-ux/p-683d690f.entry.js.map +1 -0
  308. package/dist/db-ux/p-6b6f1f7f.entry.js +2 -0
  309. package/dist/db-ux/p-6b6f1f7f.entry.js.map +1 -0
  310. package/dist/db-ux/p-6f645f17.entry.js +2 -0
  311. package/dist/db-ux/p-6f645f17.entry.js.map +1 -0
  312. package/dist/db-ux/p-71cb932e.entry.js +2 -0
  313. package/dist/db-ux/p-71cb932e.entry.js.map +1 -0
  314. package/dist/db-ux/p-78e5293a.entry.js +2 -0
  315. package/dist/db-ux/p-78e5293a.entry.js.map +1 -0
  316. package/dist/db-ux/p-79b43b42.entry.js +2 -0
  317. package/dist/db-ux/p-79b43b42.entry.js.map +1 -0
  318. package/dist/db-ux/p-79d9caa7.entry.js +2 -0
  319. package/dist/db-ux/p-79d9caa7.entry.js.map +1 -0
  320. package/dist/db-ux/p-871805e1.entry.js +2 -0
  321. package/dist/db-ux/p-871805e1.entry.js.map +1 -0
  322. package/dist/db-ux/p-8e2a086b.entry.js +2 -0
  323. package/dist/db-ux/p-8e2a086b.entry.js.map +1 -0
  324. package/dist/db-ux/p-99d90022.js +2 -0
  325. package/dist/db-ux/p-99d90022.js.map +1 -0
  326. package/dist/db-ux/p-a3be13fd.entry.js +2 -0
  327. package/dist/db-ux/p-a3be13fd.entry.js.map +1 -0
  328. package/dist/db-ux/p-a494046c.entry.js +2 -0
  329. package/dist/db-ux/p-a494046c.entry.js.map +1 -0
  330. package/dist/db-ux/p-ab8a1944.entry.js +2 -0
  331. package/dist/db-ux/p-ab8a1944.entry.js.map +1 -0
  332. package/dist/db-ux/p-af3834b6.js +2 -0
  333. package/dist/db-ux/p-af3834b6.js.map +1 -0
  334. package/dist/db-ux/p-b0f1a571.entry.js +2 -0
  335. package/dist/db-ux/p-b0f1a571.entry.js.map +1 -0
  336. package/dist/db-ux/p-b47af6eb.entry.js +2 -0
  337. package/dist/db-ux/p-b47af6eb.entry.js.map +1 -0
  338. package/dist/db-ux/p-c6d54dd4.entry.js +2 -0
  339. package/dist/db-ux/p-c6d54dd4.entry.js.map +1 -0
  340. package/dist/db-ux/p-d48f3770.entry.js +2 -0
  341. package/dist/db-ux/p-d48f3770.entry.js.map +1 -0
  342. package/dist/db-ux/p-e1255160.js +2 -0
  343. package/dist/db-ux/p-e1255160.js.map +1 -0
  344. package/dist/db-ux/p-f65f4eac.entry.js +2 -0
  345. package/dist/db-ux/p-f65f4eac.entry.js.map +1 -0
  346. package/dist/db-ux/p-fea6db86.entry.js +2 -0
  347. package/dist/db-ux/p-fea6db86.entry.js.map +1 -0
  348. package/dist/esm/app-globals-0f993ce5.js +5 -0
  349. package/dist/esm/app-globals-0f993ce5.js.map +1 -0
  350. package/dist/esm/constants-745cf8d7.js +91 -0
  351. package/dist/esm/constants-745cf8d7.js.map +1 -0
  352. package/dist/esm/db-accordion-item.entry.js +69 -0
  353. package/dist/esm/db-accordion-item.entry.js.map +1 -0
  354. package/dist/esm/db-accordion.entry.js +126 -0
  355. package/dist/esm/db-accordion.entry.js.map +1 -0
  356. package/dist/esm/db-badge.entry.js +71 -0
  357. package/dist/esm/db-badge.entry.js.map +1 -0
  358. package/dist/esm/db-brand.entry.js +54 -0
  359. package/dist/esm/db-brand.entry.js.map +1 -0
  360. package/dist/esm/db-button.entry.js +58 -0
  361. package/dist/esm/db-button.entry.js.map +1 -0
  362. package/dist/esm/db-card.entry.js +58 -0
  363. package/dist/esm/db-card.entry.js.map +1 -0
  364. package/dist/esm/db-checkbox.entry.js +145 -0
  365. package/dist/esm/db-checkbox.entry.js.map +1 -0
  366. package/dist/esm/db-divider.entry.js +52 -0
  367. package/dist/esm/db-divider.entry.js.map +1 -0
  368. package/dist/esm/db-drawer.entry.js +104 -0
  369. package/dist/esm/db-drawer.entry.js.map +1 -0
  370. package/dist/esm/db-header.entry.js +85 -0
  371. package/dist/esm/db-header.entry.js.map +1 -0
  372. package/dist/esm/db-icon.entry.js +52 -0
  373. package/dist/esm/db-icon.entry.js.map +1 -0
  374. package/dist/esm/db-infotext.entry.js +53 -0
  375. package/dist/esm/db-infotext.entry.js.map +1 -0
  376. package/dist/esm/db-input.entry.js +153 -0
  377. package/dist/esm/db-input.entry.js.map +1 -0
  378. package/dist/esm/db-link.entry.js +59 -0
  379. package/dist/esm/db-link.entry.js.map +1 -0
  380. package/dist/esm/db-navigation-item.entry.js +98 -0
  381. package/dist/esm/db-navigation-item.entry.js.map +1 -0
  382. package/dist/esm/db-navigation.entry.js +55 -0
  383. package/dist/esm/db-navigation.entry.js.map +1 -0
  384. package/dist/esm/db-notification.entry.js +60 -0
  385. package/dist/esm/db-notification.entry.js.map +1 -0
  386. package/dist/esm/db-page.entry.js +69 -0
  387. package/dist/esm/db-page.entry.js.map +1 -0
  388. package/dist/esm/db-popover.entry.js +109 -0
  389. package/dist/esm/db-popover.entry.js.map +1 -0
  390. package/dist/esm/db-radio.entry.js +94 -0
  391. package/dist/esm/db-radio.entry.js.map +1 -0
  392. package/dist/esm/db-section.entry.js +55 -0
  393. package/dist/esm/db-section.entry.js.map +1 -0
  394. package/dist/esm/db-select.entry.js +166 -0
  395. package/dist/esm/db-select.entry.js.map +1 -0
  396. package/dist/esm/db-stack.entry.js +52 -0
  397. package/dist/esm/db-stack.entry.js.map +1 -0
  398. package/dist/esm/db-switch.entry.js +87 -0
  399. package/dist/esm/db-switch.entry.js.map +1 -0
  400. package/dist/esm/db-tab-item_3.entry.js +169 -0
  401. package/dist/esm/db-tab-item_3.entry.js.map +1 -0
  402. package/dist/esm/db-tabs.entry.js +169 -0
  403. package/dist/esm/db-tabs.entry.js.map +1 -0
  404. package/dist/esm/db-tag.entry.js +79 -0
  405. package/dist/esm/db-tag.entry.js.map +1 -0
  406. package/dist/esm/db-textarea.entry.js +140 -0
  407. package/dist/esm/db-textarea.entry.js.map +1 -0
  408. package/dist/esm/db-tooltip.entry.js +82 -0
  409. package/dist/esm/db-tooltip.entry.js.map +1 -0
  410. package/dist/esm/db-ux.js +22 -0
  411. package/dist/esm/db-ux.js.map +1 -0
  412. package/dist/esm/index-5be50117.js +1468 -0
  413. package/dist/esm/index-5be50117.js.map +1 -0
  414. package/dist/esm/index-fad99efc.js +153 -0
  415. package/dist/esm/index-fad99efc.js.map +1 -0
  416. package/dist/esm/index.js +30 -0
  417. package/dist/esm/index.js.map +1 -0
  418. package/dist/esm/loader.js +13 -0
  419. package/dist/esm/loader.js.map +1 -0
  420. package/dist/esm/navigation-9fec9921.js +137 -0
  421. package/dist/esm/navigation-9fec9921.js.map +1 -0
  422. package/dist/index.cjs.js +1 -0
  423. package/dist/index.js +1 -0
  424. package/dist/loader/cdn.js +1 -0
  425. package/dist/loader/index.cjs.js +1 -0
  426. package/dist/loader/index.d.ts +24 -0
  427. package/dist/loader/index.es2017.js +1 -0
  428. package/dist/loader/index.js +2 -0
  429. package/dist/loader/package.json +11 -0
  430. package/dist/types/components/accordion/accordion.d.ts +29 -0
  431. package/dist/types/components/accordion/index.d.ts +2 -0
  432. package/dist/types/components/accordion/model.d.ts +41 -0
  433. package/dist/types/components/accordion-item/accordion-item.d.ts +27 -0
  434. package/dist/types/components/accordion-item/index.d.ts +2 -0
  435. package/dist/types/components/accordion-item/model.d.ts +24 -0
  436. package/dist/types/components/badge/badge.d.ts +26 -0
  437. package/dist/types/components/badge/index.d.ts +2 -0
  438. package/dist/types/components/badge/model.d.ts +16 -0
  439. package/dist/types/components/brand/brand.d.ts +22 -0
  440. package/dist/types/components/brand/index.d.ts +2 -0
  441. package/dist/types/components/brand/model.d.ts +10 -0
  442. package/dist/types/components/button/button.d.ts +37 -0
  443. package/dist/types/components/button/index.d.ts +2 -0
  444. package/dist/types/components/button/model.d.ts +52 -0
  445. package/dist/types/components/card/card.d.ts +24 -0
  446. package/dist/types/components/card/index.d.ts +2 -0
  447. package/dist/types/components/card/model.d.ts +18 -0
  448. package/dist/types/components/checkbox/checkbox.d.ts +51 -0
  449. package/dist/types/components/checkbox/index.d.ts +2 -0
  450. package/dist/types/components/checkbox/model.d.ts +10 -0
  451. package/dist/types/components/divider/divider.d.ts +22 -0
  452. package/dist/types/components/divider/index.d.ts +2 -0
  453. package/dist/types/components/divider/model.d.ts +18 -0
  454. package/dist/types/components/drawer/drawer.d.ts +32 -0
  455. package/dist/types/components/drawer/index.d.ts +2 -0
  456. package/dist/types/components/drawer/model.d.ts +41 -0
  457. package/dist/types/components/header/header.d.ts +32 -0
  458. package/dist/types/components/header/index.d.ts +2 -0
  459. package/dist/types/components/header/model.d.ts +44 -0
  460. package/dist/types/components/icon/icon.d.ts +22 -0
  461. package/dist/types/components/icon/index.d.ts +2 -0
  462. package/dist/types/components/icon/model.d.ts +12 -0
  463. package/dist/types/components/infotext/index.d.ts +2 -0
  464. package/dist/types/components/infotext/infotext.d.ts +23 -0
  465. package/dist/types/components/infotext/model.d.ts +5 -0
  466. package/dist/types/components/input/index.d.ts +2 -0
  467. package/dist/types/components/input/input.d.ts +71 -0
  468. package/dist/types/components/input/model.d.ts +39 -0
  469. package/dist/types/components/link/index.d.ts +2 -0
  470. package/dist/types/components/link/link.d.ts +35 -0
  471. package/dist/types/components/link/model.d.ts +24 -0
  472. package/dist/types/components/navigation/index.d.ts +2 -0
  473. package/dist/types/components/navigation/model.d.ts +5 -0
  474. package/dist/types/components/navigation/navigation.d.ts +20 -0
  475. package/dist/types/components/navigation-item/index.d.ts +2 -0
  476. package/dist/types/components/navigation-item/model.d.ts +34 -0
  477. package/dist/types/components/navigation-item/navigation-item.d.ts +39 -0
  478. package/dist/types/components/notification/index.d.ts +2 -0
  479. package/dist/types/components/notification/model.d.ts +57 -0
  480. package/dist/types/components/notification/notification.d.ts +36 -0
  481. package/dist/types/components/page/index.d.ts +2 -0
  482. package/dist/types/components/page/model.d.ts +32 -0
  483. package/dist/types/components/page/page.d.ts +24 -0
  484. package/dist/types/components/popover/index.d.ts +2 -0
  485. package/dist/types/components/popover/model.d.ts +18 -0
  486. package/dist/types/components/popover/popover.d.ts +31 -0
  487. package/dist/types/components/radio/index.d.ts +2 -0
  488. package/dist/types/components/radio/model.d.ts +7 -0
  489. package/dist/types/components/radio/radio.d.ts +41 -0
  490. package/dist/types/components/section/index.d.ts +2 -0
  491. package/dist/types/components/section/model.d.ts +5 -0
  492. package/dist/types/components/section/section.d.ts +21 -0
  493. package/dist/types/components/select/index.d.ts +2 -0
  494. package/dist/types/components/select/model.d.ts +43 -0
  495. package/dist/types/components/select/select.d.ts +62 -0
  496. package/dist/types/components/stack/index.d.ts +2 -0
  497. package/dist/types/components/stack/model.d.ts +34 -0
  498. package/dist/types/components/stack/stack.d.ts +24 -0
  499. package/dist/types/components/switch/index.d.ts +2 -0
  500. package/dist/types/components/switch/model.d.ts +12 -0
  501. package/dist/types/components/switch/switch.d.ts +44 -0
  502. package/dist/types/components/tab-item/index.d.ts +2 -0
  503. package/dist/types/components/tab-item/model.d.ts +24 -0
  504. package/dist/types/components/tab-item/tab-item.d.ts +34 -0
  505. package/dist/types/components/tab-list/index.d.ts +2 -0
  506. package/dist/types/components/tab-list/model.d.ts +5 -0
  507. package/dist/types/components/tab-list/tab-list.d.ts +19 -0
  508. package/dist/types/components/tab-panel/index.d.ts +2 -0
  509. package/dist/types/components/tab-panel/model.d.ts +10 -0
  510. package/dist/types/components/tab-panel/tab-panel.d.ts +20 -0
  511. package/dist/types/components/tabs/index.d.ts +2 -0
  512. package/dist/types/components/tabs/model.d.ts +47 -0
  513. package/dist/types/components/tabs/tabs.d.ts +39 -0
  514. package/dist/types/components/tag/index.d.ts +2 -0
  515. package/dist/types/components/tag/model.d.ts +45 -0
  516. package/dist/types/components/tag/tag.d.ts +34 -0
  517. package/dist/types/components/textarea/index.d.ts +2 -0
  518. package/dist/types/components/textarea/model.d.ts +30 -0
  519. package/dist/types/components/textarea/textarea.d.ts +63 -0
  520. package/dist/types/components/tooltip/index.d.ts +2 -0
  521. package/dist/types/components/tooltip/model.d.ts +7 -0
  522. package/dist/types/components/tooltip/tooltip.d.ts +30 -0
  523. package/dist/types/components.d.ts +1479 -0
  524. package/dist/types/index.d.ts +36 -0
  525. package/dist/types/shared/constants.d.ts +83 -0
  526. package/dist/types/shared/model.d.ts +445 -0
  527. package/dist/types/stencil-public-runtime.d.ts +1680 -0
  528. package/dist/types/utils/form-components.d.ts +2 -0
  529. package/dist/types/utils/index.d.ts +61 -0
  530. package/dist/types/utils/navigation.d.ts +32 -0
  531. package/dist/vscode.html-custom-data.json +2245 -0
  532. package/dist/web-types.json +3991 -0
  533. package/package.json +48 -0
@@ -0,0 +1,167 @@
1
+ export const uuid = () => {
2
+ var _a, _b;
3
+ if (typeof window !== 'undefined') {
4
+ if ((_a = window.crypto) === null || _a === void 0 ? void 0 : _a.randomUUID) {
5
+ return window.crypto.randomUUID();
6
+ }
7
+ else if ((_b = window.crypto) === null || _b === void 0 ? void 0 : _b.getRandomValues) {
8
+ return window.crypto.getRandomValues(new Uint32Array(3)).join('-');
9
+ }
10
+ }
11
+ return Math.random().toString().substring(2);
12
+ };
13
+ export const addAttributeToChildren = (element, attribute) => {
14
+ const children = element.children;
15
+ Object.values(children).forEach((child) => {
16
+ child.setAttribute(attribute.key, attribute.value);
17
+ if (child.children.length > 0) {
18
+ addAttributeToChildren(child, attribute);
19
+ }
20
+ });
21
+ };
22
+ export const cls = (...args) => {
23
+ let result = '';
24
+ for (const arg of args) {
25
+ if (arg) {
26
+ if (typeof arg === 'string') {
27
+ result += `${arg} `;
28
+ }
29
+ else {
30
+ for (const key in arg) {
31
+ if (arg[key]) {
32
+ result += `${key} `;
33
+ }
34
+ }
35
+ }
36
+ }
37
+ }
38
+ return result.trim();
39
+ };
40
+ const reactHtmlAttributes = ['suppressHydrationWarning', 'suppressContentEditableWarning', 'translate', 'title', 'tabIndex', 'style', 'spellCheck', 'nonce', 'lang', 'hidden', 'draggable', 'dir', 'contextMenu', 'contentEditable', 'autoFocus', 'accessKey', 'is', 'inputMode', 'unselectable', 'security', 'results', 'vocab', 'typeof', 'rev', 'resource', 'rel', 'property', 'inlist', 'datatype', 'content', 'about', 'role', 'radioGroup', 'color'];
41
+ export const filterPassingProps = (props, propsPassingFilter) => Object.keys(props).filter(key => (key.startsWith('data-') || key.startsWith('aria-') || key.startsWith('default') || key.startsWith('auto') || key.startsWith('item') || key.startsWith('on') || reactHtmlAttributes.includes(key)) && !propsPassingFilter.includes(key)).reduce((obj, key) => {
42
+ return Object.assign(Object.assign({}, obj), { [key]: props[key] });
43
+ }, {});
44
+ export const getRootProps = (props, rooProps) => {
45
+ return Object.keys(props).filter(key => rooProps.includes(key)).reduce((obj, key) => {
46
+ return Object.assign(Object.assign({}, obj), { [key]: props[key] });
47
+ }, {});
48
+ };
49
+ export const visibleInVX = (el) => {
50
+ const { left, right } = el.getBoundingClientRect();
51
+ const { innerWidth } = window;
52
+ return left >= 0 && right <= innerWidth;
53
+ };
54
+ export const visibleInVY = (el) => {
55
+ const { top, bottom } = el.getBoundingClientRect();
56
+ const { innerHeight } = window;
57
+ return top >= 0 && bottom <= innerHeight;
58
+ };
59
+ export const isInView = (el) => {
60
+ var _a;
61
+ const { top, bottom, left, right } = el.getBoundingClientRect();
62
+ const { innerHeight, innerWidth } = window;
63
+ let outTop = top < 0;
64
+ let outBottom = bottom > innerHeight;
65
+ let outLeft = left < 0;
66
+ let outRight = right > innerWidth;
67
+ // We need to check if it was already outside
68
+ const outsideY = el.hasAttribute('data-outside-vy');
69
+ const outsideX = el.hasAttribute('data-outside-vx');
70
+ const parentRect = (_a = el === null || el === void 0 ? void 0 : el.parentElement) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
71
+ if (parentRect) {
72
+ if (outsideY) {
73
+ const position = el.getAttribute('data-outside-vy');
74
+ if (position === 'top') {
75
+ outTop = parentRect.top - (bottom - parentRect.bottom) < 0;
76
+ }
77
+ else {
78
+ outBottom = parentRect.bottom + (parentRect.top - top) > innerHeight;
79
+ }
80
+ }
81
+ if (outsideX) {
82
+ const position = el.getAttribute('data-outside-vx');
83
+ if (position === 'left') {
84
+ outLeft = parentRect.left - (right - parentRect.right) < 0;
85
+ }
86
+ else {
87
+ outRight = parentRect.right + (parentRect.left - left) > innerWidth;
88
+ }
89
+ }
90
+ }
91
+ return {
92
+ outTop,
93
+ outBottom,
94
+ outLeft,
95
+ outRight
96
+ };
97
+ };
98
+ export const handleDataOutside = (el) => {
99
+ const { outTop, outBottom, outLeft, outRight } = isInView(el);
100
+ let dataOutsidePair = {};
101
+ if (outTop || outBottom) {
102
+ dataOutsidePair = {
103
+ vy: outTop ? 'top' : 'bottom'
104
+ };
105
+ el.setAttribute('data-outside-vy', dataOutsidePair.vy);
106
+ }
107
+ else {
108
+ el.removeAttribute('data-outside-vy');
109
+ }
110
+ if (outLeft || outRight) {
111
+ dataOutsidePair = Object.assign(Object.assign({}, dataOutsidePair), { vx: outRight ? 'right' : 'left' });
112
+ el.setAttribute('data-outside-vx', dataOutsidePair.vx);
113
+ }
114
+ else {
115
+ el.removeAttribute('data-outside-vx');
116
+ }
117
+ return dataOutsidePair;
118
+ };
119
+ export const isArrayOfStrings = (value) => Array.isArray(value) && value.every(item => typeof item === 'string');
120
+ const appleOs = ['Mac', 'iPhone', 'iPad', 'iPod'];
121
+ export const hasVoiceOver = () => typeof window !== 'undefined' && appleOs.some(os => window.navigator.userAgent.includes(os));
122
+ export const delay = (fn, ms) => new Promise(() => setTimeout(fn, ms));
123
+ /**
124
+ * Some frameworks like stencil would not add "true" as value for a prop
125
+ * if it is used in a framework like angular e.g.: [disabled]="myDisabledProp"
126
+ * @param originBool Some boolean to convert to string
127
+ */
128
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
129
+ export const getBooleanAsString = (originBool) => {
130
+ if (originBool) {
131
+ return String(originBool);
132
+ }
133
+ return originBool;
134
+ };
135
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
136
+ export const getHideProp = (show) => {
137
+ if (show === undefined || show === null) {
138
+ return undefined;
139
+ }
140
+ return getBooleanAsString(!show);
141
+ };
142
+ export const stringPropVisible = (givenString, showString) => {
143
+ if (showString === undefined) {
144
+ return !!givenString;
145
+ }
146
+ else {
147
+ return showString && givenString;
148
+ }
149
+ };
150
+ export default {
151
+ getRootProps,
152
+ filterPassingProps,
153
+ cls,
154
+ addAttributeToChildren,
155
+ uuid,
156
+ visibleInVX,
157
+ visibleInVY,
158
+ isInView,
159
+ handleDataOutside,
160
+ isArrayOfStrings,
161
+ hasVoiceOver,
162
+ delay,
163
+ getBooleanAsString,
164
+ getHideProp,
165
+ stringPropVisible
166
+ };
167
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,IAAI,GAAG,GAAG,EAAE;;IACvB,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;QAClC,IAAI,MAAA,MAAM,CAAC,MAAM,0CAAE,UAAU,EAAE,CAA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,WAAW;IACX,QAAQ;IACR,iBAAiB;IACjB,gBAAgB;IAChB,YAAY;IACZ,KAAK;IACL,kBAAkB;IAClB,WAAW;IACX,iBAAiB;CAClB,CAAA","sourcesContent":["export const uuid = () => {\n if (typeof window !== 'undefined') {\n if (window.crypto?.randomUUID) {\n return window.crypto.randomUUID();\n } else if (window.crypto?.getRandomValues) {\n return window.crypto.getRandomValues(new Uint32Array(3)).join('-');\n }\n }\n return Math.random().toString().substring(2);\n};\nexport const addAttributeToChildren = (element: Element, attribute: {\n key: string;\n value: string;\n}) => {\n const children = element.children;\n Object.values(children).forEach((child: Element) => {\n child.setAttribute(attribute.key, attribute.value);\n if (child.children.length > 0) {\n addAttributeToChildren(child, attribute);\n }\n });\n};\nexport type ClassNameArg = string | {\n [key: string]: boolean | undefined;\n} | undefined;\nexport const cls = (...args: ClassNameArg[]) => {\n let result = '';\n for (const arg of args) {\n if (arg) {\n if (typeof arg === 'string') {\n result += `${arg} `;\n } else {\n for (const key in arg) {\n if (arg[key]) {\n result += `${key} `;\n }\n }\n }\n }\n }\n return result.trim();\n};\nconst reactHtmlAttributes = ['suppressHydrationWarning', 'suppressContentEditableWarning', 'translate', 'title', 'tabIndex', 'style', 'spellCheck', 'nonce', 'lang', 'hidden', 'draggable', 'dir', 'contextMenu', 'contentEditable', 'autoFocus', 'accessKey', 'is', 'inputMode', 'unselectable', 'security', 'results', 'vocab', 'typeof', 'rev', 'resource', 'rel', 'property', 'inlist', 'datatype', 'content', 'about', 'role', 'radioGroup', 'color'];\nexport const filterPassingProps = (props: Record<string, unknown>, propsPassingFilter: string[]): Record<string, unknown> => Object.keys(props).filter(key => (key.startsWith('data-') || key.startsWith('aria-') || key.startsWith('default') || key.startsWith('auto') || key.startsWith('item') || key.startsWith('on') || reactHtmlAttributes.includes(key)) && !propsPassingFilter.includes(key)).reduce((obj: Record<string, unknown>, key: string) => {\n return {\n ...obj,\n [key]: props[key]\n };\n}, {});\nexport const getRootProps = (props: Record<string, unknown>, rooProps: string[]): Record<string, unknown> => {\n return Object.keys(props).filter(key => rooProps.includes(key)).reduce((obj: Record<string, unknown>, key: string) => {\n return {\n ...obj,\n [key]: props[key]\n };\n }, {});\n};\nexport const visibleInVX = (el: Element) => {\n const {\n left,\n right\n } = el.getBoundingClientRect();\n const {\n innerWidth\n } = window;\n return left >= 0 && right <= innerWidth;\n};\nexport const visibleInVY = (el: Element) => {\n const {\n top,\n bottom\n } = el.getBoundingClientRect();\n const {\n innerHeight\n } = window;\n return top >= 0 && bottom <= innerHeight;\n};\nexport const isInView = (el: Element) => {\n const {\n top,\n bottom,\n left,\n right\n } = el.getBoundingClientRect();\n const {\n innerHeight,\n innerWidth\n } = window;\n let outTop = top < 0;\n let outBottom = bottom > innerHeight;\n let outLeft = left < 0;\n let outRight = right > innerWidth;\n\n // We need to check if it was already outside\n const outsideY = el.hasAttribute('data-outside-vy');\n const outsideX = el.hasAttribute('data-outside-vx');\n const parentRect = el?.parentElement?.getBoundingClientRect();\n if (parentRect) {\n if (outsideY) {\n const position = el.getAttribute('data-outside-vy');\n if (position === 'top') {\n outTop = parentRect.top - (bottom - parentRect.bottom) < 0;\n } else {\n outBottom = parentRect.bottom + (parentRect.top - top) > innerHeight;\n }\n }\n if (outsideX) {\n const position = el.getAttribute('data-outside-vx');\n if (position === 'left') {\n outLeft = parentRect.left - (right - parentRect.right) < 0;\n } else {\n outRight = parentRect.right + (parentRect.left - left) > innerWidth;\n }\n }\n }\n return {\n outTop,\n outBottom,\n outLeft,\n outRight\n };\n};\nexport interface DBDataOutsidePair {\n vx?: 'left' | 'right';\n vy?: 'top' | 'bottom';\n}\nexport const handleDataOutside = (el: Element): DBDataOutsidePair => {\n const {\n outTop,\n outBottom,\n outLeft,\n outRight\n } = isInView(el);\n let dataOutsidePair: DBDataOutsidePair = {};\n if (outTop || outBottom) {\n dataOutsidePair = {\n vy: outTop ? 'top' : 'bottom'\n };\n el.setAttribute('data-outside-vy', dataOutsidePair.vy!);\n } else {\n el.removeAttribute('data-outside-vy');\n }\n if (outLeft || outRight) {\n dataOutsidePair = {\n ...dataOutsidePair,\n vx: outRight ? 'right' : 'left'\n };\n el.setAttribute('data-outside-vx', dataOutsidePair.vx!);\n } else {\n el.removeAttribute('data-outside-vx');\n }\n return dataOutsidePair;\n};\nexport const isArrayOfStrings = (value: unknown): value is string[] => Array.isArray(value) && value.every(item => typeof item === 'string');\nconst appleOs = ['Mac', 'iPhone', 'iPad', 'iPod'];\nexport const hasVoiceOver = (): boolean => typeof window !== 'undefined' && appleOs.some(os => window.navigator.userAgent.includes(os));\nexport const delay = (fn: () => void, ms: number) => new Promise(() => setTimeout(fn, ms));\n\n/**\n * Some frameworks like stencil would not add \"true\" as value for a prop\n * if it is used in a framework like angular e.g.: [disabled]=\"myDisabledProp\"\n * @param originBool Some boolean to convert to string\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const getBooleanAsString = (originBool?: boolean): any => {\n if (originBool) {\n return String(originBool);\n }\n return originBool;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const getHideProp = (show?: boolean): any => {\n if (show === undefined || show === null) {\n return undefined;\n }\n return getBooleanAsString(!show);\n};\nexport const stringPropVisible = (givenString?: string, showString?: boolean) => {\n if (showString === undefined) {\n return !!givenString;\n } else {\n return showString && givenString;\n }\n};\nexport default {\n getRootProps,\n filterPassingProps,\n cls,\n addAttributeToChildren,\n uuid,\n visibleInVX,\n visibleInVY,\n isInView,\n handleDataOutside,\n isArrayOfStrings,\n hasVoiceOver,\n delay,\n getBooleanAsString,\n getHideProp,\n stringPropVisible\n}"]}
@@ -0,0 +1,137 @@
1
+ import { handleDataOutside } from "./index";
2
+ export const isEventTargetNavigationItem = (event) => {
3
+ var _a, _b;
4
+ const { target } = event;
5
+ return Boolean(!((_a = target === null || target === void 0 ? void 0 : target.classList) === null || _a === void 0 ? void 0 : _a.contains('db-navigation-item-expand-button')) && ((_b = target === null || target === void 0 ? void 0 : target.parentElement) === null || _b === void 0 ? void 0 : _b.classList.contains('db-navigation-item')));
6
+ };
7
+ export class NavigationItemSafeTriangle {
8
+ constructor(element, subNavigation) {
9
+ var _a;
10
+ this.parentSubNavigation = null;
11
+ this.initialized = false;
12
+ this.mouseX = 0;
13
+ this.mouseY = 0;
14
+ this.element = element;
15
+ this.subNavigation = subNavigation;
16
+ if (!this.element || !this.subNavigation) {
17
+ return;
18
+ }
19
+ this.parentSubNavigation = (_a = this.element) === null || _a === void 0 ? void 0 : _a.closest('.db-sub-navigation');
20
+ /*
21
+ * only initiate if:
22
+ * 1. item is not at root navigation level
23
+ * 2. item is not in the mobile navigation / within db-drawer
24
+ */
25
+ if (this.parentSubNavigation && !this.element.closest('.db-drawer')) {
26
+ this.init();
27
+ }
28
+ }
29
+ init() {
30
+ var _a, _b, _c;
31
+ const parentElementWidth = (_b = (_a = this.parentSubNavigation) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().width) !== null && _b !== void 0 ? _b : 0;
32
+ // the triangle has the width of the sub-navigation, current nav-item can be wider.
33
+ // so the width of the triangle must be adapted to a possibly wider nav-item.
34
+ (_c = this.element) === null || _c === void 0 ? void 0 : _c.style.setProperty('--db-navigation-item-inline-size', `${parentElementWidth}px`);
35
+ this.initialized = true;
36
+ }
37
+ enableFollow() {
38
+ var _a, _b;
39
+ if (!this.initialized || this.triangleData || !this.element || !this.subNavigation) {
40
+ return;
41
+ }
42
+ const dataOutsidePair = handleDataOutside(this.subNavigation);
43
+ const itemRect = this.element.getBoundingClientRect();
44
+ const parentElementWidth = (_b = (_a = this.parentSubNavigation) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().width) !== null && _b !== void 0 ? _b : 0;
45
+ this.triangleData = {
46
+ itemRect,
47
+ parentElementWidth,
48
+ subNavigationHeight: this.subNavigation.getBoundingClientRect().height,
49
+ padding: (parentElementWidth - itemRect.width) / 2,
50
+ outsideVX: dataOutsidePair.vx,
51
+ outsideVY: dataOutsidePair.vy
52
+ };
53
+ }
54
+ disableFollow() {
55
+ this.triangleData = undefined;
56
+ }
57
+ getTriangleTipX() {
58
+ if (!this.triangleData)
59
+ return 0;
60
+ if (this.triangleData.outsideVX === 'right') {
61
+ // vertical flipped triangle needs an inverted x pos
62
+ return this.triangleData.itemRect.width - this.mouseX;
63
+ }
64
+ // triangle stops shrinking from 75% x pos
65
+ return Math.min(this.mouseX, this.triangleData.itemRect.width * 0.75);
66
+ }
67
+ getTriangleTipY() {
68
+ if (!this.triangleData)
69
+ return 0;
70
+ // padding must be added to the y pos of the tip so that the y pos matches the cursor
71
+ const mouseYLimited = Math.max(Math.min(this.mouseY, this.triangleData.itemRect.height), 0) + this.triangleData.padding;
72
+ if (this.triangleData.outsideVY === 'bottom') {
73
+ // add offset to tip y pos to match corrected sub-navigation y pos
74
+ return mouseYLimited + (this.triangleData.subNavigationHeight - this.triangleData.padding * 2 - this.triangleData.itemRect.height);
75
+ }
76
+ return mouseYLimited;
77
+ }
78
+ hasMouseEnteredSubNavigation() {
79
+ if (!this.triangleData) {
80
+ return false;
81
+ }
82
+ const isSubNavigationOnLeftSide = this.triangleData.outsideVX === 'right';
83
+ if (isSubNavigationOnLeftSide && this.mouseX < -1 * this.triangleData.padding) {
84
+ return true;
85
+ }
86
+ if (!isSubNavigationOnLeftSide && this.mouseX > this.triangleData.parentElementWidth - this.triangleData.padding) {
87
+ return true;
88
+ }
89
+ return false;
90
+ }
91
+ getTriangleCoordinates(variant) {
92
+ if (!this.triangleData) {
93
+ return;
94
+ }
95
+ if (variant === 'fill-gap') {
96
+ const itemHeight = `${this.triangleData.itemRect.height + 2 * this.triangleData.padding}px`;
97
+ const xStart = `${this.triangleData.parentElementWidth - this.triangleData.padding}px`;
98
+ return {
99
+ lb: `${xStart} ${itemHeight}`,
100
+ lt: `${xStart} 0`,
101
+ rt: '100% 0',
102
+ rb: `100% ${itemHeight}`
103
+ };
104
+ }
105
+ const tipX = this.getTriangleTipX();
106
+ const tipY = this.getTriangleTipY();
107
+ const lb = `${tipX}px ${tipY}px`;
108
+ const lt = `${tipX}px ${tipY}px`;
109
+ return {
110
+ lb,
111
+ lt,
112
+ rt: '100% 0',
113
+ rb: '100% 100%'
114
+ };
115
+ }
116
+ followByMouseEvent(event) {
117
+ if (!this.initialized || !this.triangleData || !this.element || !this.subNavigation) {
118
+ return;
119
+ }
120
+ this.mouseX = event.clientX - this.triangleData.itemRect.left;
121
+ this.mouseY = event.clientY - this.triangleData.itemRect.top;
122
+ const isOverSubNavigation = this.hasMouseEnteredSubNavigation();
123
+ const coordinates = this.getTriangleCoordinates(isOverSubNavigation ? 'fill-gap' : 'safe-triangle');
124
+ if (!coordinates) {
125
+ return;
126
+ }
127
+ this.element.style.setProperty('--db-navigation-item-clip-path', `polygon(${coordinates.lb}, ${coordinates.lt}, ${coordinates.rt}, ${coordinates.rb})`);
128
+ if (isOverSubNavigation) {
129
+ this.triangleData = undefined;
130
+ }
131
+ }
132
+ }
133
+ export default {
134
+ isEventTargetNavigationItem,
135
+ NavigationItemSafeTriangle
136
+ };
137
+ //# sourceMappingURL=navigation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navigation.js","sourceRoot":"","sources":["../../src/utils/navigation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAS5C,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,KAAc,EAAW,EAAE;;IACrE,MAAM,EACJ,MAAM,EACP,GAAI,KAEH,CAAC;IACH,OAAO,OAAO,CAAC,CAAC,CAAA,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,SAAS,0CAAE,QAAQ,CAAC,kCAAkC,CAAC,CAAA,KAAI,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,aAAa,0CAAE,SAAS,CAAC,QAAQ,CAAC,oBAAoB,CAAC,CAAA,CAAC,CAAC;AACtJ,CAAC,CAAC;AACF,MAAM,OAAO,0BAA0B;IAQrC,YAAY,OAA2B,EAAE,aAA6B;;QALrD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mBAAmB,EAAE,CAAC;YACxB,IAAI,CAAC,YAAY,GAAG,SAAS,CAAC;QAChC,CAAC;IACH,CAAC;CACF;AACD,eAAe;IACb,2BAA2B;IAC3B,0BAA0B;CAC3B,CAAA","sourcesContent":["import { handleDataOutside } from './index';\nexport type TriangleData = {\n itemRect: DOMRect;\n parentElementWidth: number;\n subNavigationHeight: number;\n padding: number;\n outsideVX: 'left' | 'right' | undefined;\n outsideVY: 'top' | 'bottom' | undefined;\n};\nexport const isEventTargetNavigationItem = (event: unknown): boolean => {\n const {\n target\n } = (event as {\n target: HTMLElement;\n });\n return Boolean(!target?.classList?.contains('db-navigation-item-expand-button') && target?.parentElement?.classList.contains('db-navigation-item'));\n};\nexport class NavigationItemSafeTriangle {\n private readonly element: HTMLElement | null;\n private readonly subNavigation: Element | null;\n private readonly parentSubNavigation: Element | null = null;\n private triangleData?: TriangleData;\n private initialized: boolean = false;\n private mouseX: number = 0;\n private mouseY: number = 0;\n constructor(element: HTMLElement | null, subNavigation: Element | null) {\n this.element = element;\n this.subNavigation = subNavigation;\n if (!this.element || !this.subNavigation) {\n return;\n }\n this.parentSubNavigation = this.element?.closest('.db-sub-navigation');\n\n /*\n * only initiate if:\n * 1. item is not at root navigation level\n * 2. item is not in the mobile navigation / within db-drawer\n */\n if (this.parentSubNavigation && !this.element.closest('.db-drawer')) {\n this.init();\n }\n }\n private init() {\n const parentElementWidth = this.parentSubNavigation?.getBoundingClientRect().width ?? 0;\n\n // the triangle has the width of the sub-navigation, current nav-item can be wider.\n // so the width of the triangle must be adapted to a possibly wider nav-item.\n this.element?.style.setProperty('--db-navigation-item-inline-size', `${parentElementWidth}px`);\n this.initialized = true;\n }\n public enableFollow() {\n if (!this.initialized || this.triangleData || !this.element || !this.subNavigation) {\n return;\n }\n const dataOutsidePair = handleDataOutside(this.subNavigation);\n const itemRect = this.element.getBoundingClientRect();\n const parentElementWidth = this.parentSubNavigation?.getBoundingClientRect().width ?? 0;\n this.triangleData = {\n itemRect,\n parentElementWidth,\n subNavigationHeight: this.subNavigation.getBoundingClientRect().height,\n padding: (parentElementWidth - itemRect.width) / 2,\n outsideVX: dataOutsidePair.vx,\n outsideVY: dataOutsidePair.vy\n };\n }\n public disableFollow() {\n this.triangleData = undefined;\n }\n private getTriangleTipX(): number {\n if (!this.triangleData) return 0;\n if (this.triangleData.outsideVX === 'right') {\n // vertical flipped triangle needs an inverted x pos\n return this.triangleData.itemRect.width - this.mouseX;\n }\n\n // triangle stops shrinking from 75% x pos\n return Math.min(this.mouseX, this.triangleData.itemRect.width * 0.75);\n }\n private getTriangleTipY(): number {\n if (!this.triangleData) return 0;\n\n // padding must be added to the y pos of the tip so that the y pos matches the cursor\n const mouseYLimited = Math.max(Math.min(this.mouseY, this.triangleData.itemRect.height), 0) + this.triangleData.padding;\n if (this.triangleData.outsideVY === 'bottom') {\n // add offset to tip y pos to match corrected sub-navigation y pos\n return mouseYLimited + (this.triangleData.subNavigationHeight - this.triangleData.padding * 2 - this.triangleData.itemRect.height);\n }\n return mouseYLimited;\n }\n private hasMouseEnteredSubNavigation(): boolean {\n if (!this.triangleData) {\n return false;\n }\n const isSubNavigationOnLeftSide = this.triangleData.outsideVX === 'right';\n if (isSubNavigationOnLeftSide && this.mouseX < -1 * this.triangleData.padding) {\n return true;\n }\n if (!isSubNavigationOnLeftSide && this.mouseX > this.triangleData.parentElementWidth - this.triangleData.padding) {\n return true;\n }\n return false;\n }\n private getTriangleCoordinates(variant: 'safe-triangle' | 'fill-gap'): undefined | {\n lb: string;\n lt: string;\n rt: string;\n rb: string;\n } {\n if (!this.triangleData) {\n return;\n }\n if (variant === 'fill-gap') {\n const itemHeight = `${this.triangleData.itemRect.height + 2 * this.triangleData.padding}px`;\n const xStart = `${this.triangleData.parentElementWidth - this.triangleData.padding}px`;\n return {\n lb: `${xStart} ${itemHeight}`,\n lt: `${xStart} 0`,\n rt: '100% 0',\n rb: `100% ${itemHeight}`\n };\n }\n const tipX = this.getTriangleTipX();\n const tipY = this.getTriangleTipY();\n const lb = `${tipX}px ${tipY}px`;\n const lt = `${tipX}px ${tipY}px`;\n return {\n lb,\n lt,\n rt: '100% 0',\n rb: '100% 100%'\n };\n }\n public followByMouseEvent(event: MouseEvent) {\n if (!this.initialized || !this.triangleData || !this.element || !this.subNavigation) {\n return;\n }\n this.mouseX = event.clientX - this.triangleData.itemRect.left;\n this.mouseY = event.clientY - this.triangleData.itemRect.top;\n const isOverSubNavigation = this.hasMouseEnteredSubNavigation();\n const coordinates = this.getTriangleCoordinates(isOverSubNavigation ? 'fill-gap' : 'safe-triangle');\n if (!coordinates) {\n return;\n }\n this.element.style.setProperty('--db-navigation-item-clip-path', `polygon(${coordinates.lb}, ${coordinates.lt}, ${coordinates.rt}, ${coordinates.rb})`);\n if (isOverSubNavigation) {\n this.triangleData = undefined;\n }\n }\n}\nexport default {\n isEventTargetNavigationItem,\n NavigationItemSafeTriangle\n}"]}