@beeq/core 1.8.0-beta.0 → 1.8.0-beta.10

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 (656) hide show
  1. package/dist/beeq/beeq.css +1 -1
  2. package/dist/beeq/beeq.esm.js +43 -1
  3. package/dist/beeq/beeq.esm.js.map +1 -1
  4. package/dist/beeq/index.esm.js +66 -1
  5. package/dist/beeq/index.esm.js.map +1 -1
  6. package/dist/beeq/p-01df4baa.js +1826 -0
  7. package/dist/beeq/p-01df4baa.js.map +1 -0
  8. package/dist/beeq/p-01fe8efb.entry.js +182 -0
  9. package/dist/beeq/p-01fe8efb.entry.js.map +1 -0
  10. package/dist/beeq/p-03373320.entry.js +318 -0
  11. package/dist/beeq/p-03373320.entry.js.map +1 -0
  12. package/dist/beeq/{p-3aa41d80.entry.js → p-0a981080.entry.js} +150 -2
  13. package/dist/beeq/{p-235328ee.entry.js.map → p-0a981080.entry.js.map} +1 -1
  14. package/dist/beeq/{p-a8cb8989.entry.js → p-0ce76c54.entry.js} +99 -2
  15. package/dist/beeq/{p-633319f3.entry.js.map → p-0ce76c54.entry.js.map} +1 -1
  16. package/dist/beeq/p-0f786b44.entry.js +458 -0
  17. package/dist/beeq/p-0f786b44.entry.js.map +1 -0
  18. package/dist/beeq/p-115ed5b2.js +25 -1
  19. package/dist/beeq/p-115ed5b2.js.map +1 -1
  20. package/dist/beeq/p-16c6ece5.entry.js +112 -0
  21. package/dist/beeq/{p-b90c6de9.entry.js.map → p-16c6ece5.entry.js.map} +1 -1
  22. package/dist/beeq/p-1c8b6eb4.js +12 -1
  23. package/dist/beeq/p-1c8b6eb4.js.map +1 -1
  24. package/dist/beeq/p-1defeea3.js +69 -0
  25. package/dist/beeq/{p-951ba558.js.map → p-1defeea3.js.map} +1 -1
  26. package/dist/beeq/p-1f3a4359.js +11 -1
  27. package/dist/beeq/p-1f3a4359.js.map +1 -1
  28. package/dist/beeq/{p-b9544567.entry.js → p-2fe5f338.entry.js} +288 -2
  29. package/dist/beeq/p-2fe5f338.entry.js.map +1 -0
  30. package/dist/beeq/p-3043c826.entry.js +133 -0
  31. package/dist/beeq/p-3043c826.entry.js.map +1 -0
  32. package/dist/beeq/p-38e70f78.entry.js +133 -0
  33. package/dist/beeq/p-38e70f78.entry.js.map +1 -0
  34. package/dist/beeq/p-398bfb48.entry.js +242 -0
  35. package/dist/beeq/{p-79b7547b.entry.js.map → p-398bfb48.entry.js.map} +1 -1
  36. package/dist/beeq/p-3fd0d92d.js +1228 -1
  37. package/dist/beeq/p-3fd0d92d.js.map +1 -1
  38. package/dist/beeq/p-41ac1d84.entry.js +195 -0
  39. package/dist/beeq/p-41ac1d84.entry.js.map +1 -0
  40. package/dist/beeq/p-4eabcd51.entry.js +82 -0
  41. package/dist/beeq/{p-94d62f1b.entry.js.map → p-4eabcd51.entry.js.map} +1 -1
  42. package/dist/beeq/p-57621be1.js +9 -1
  43. package/dist/beeq/p-57621be1.js.map +1 -1
  44. package/dist/beeq/p-5ff6621d.entry.js +134 -0
  45. package/dist/beeq/p-5ff6621d.entry.js.map +1 -0
  46. package/dist/beeq/p-60cbc966.entry.js +85 -0
  47. package/dist/beeq/{p-3b2ce34b.entry.js.map → p-60cbc966.entry.js.map} +1 -1
  48. package/dist/beeq/p-687da041.js +20 -1
  49. package/dist/beeq/p-687da041.js.map +1 -1
  50. package/dist/beeq/p-68ff188d.entry.js +144 -0
  51. package/dist/beeq/p-68ff188d.entry.js.map +1 -0
  52. package/dist/beeq/p-69c766a3.entry.js +213 -0
  53. package/dist/beeq/p-69c766a3.entry.js.map +1 -0
  54. package/dist/beeq/p-76486949.entry.js +347 -0
  55. package/dist/beeq/p-76486949.entry.js.map +1 -0
  56. package/dist/beeq/p-8512b8ee.entry.js +455 -0
  57. package/dist/beeq/p-8512b8ee.entry.js.map +1 -0
  58. package/dist/beeq/p-8b16f130.entry.js +210 -0
  59. package/dist/beeq/{p-a8cb8989.entry.js.map → p-8b16f130.entry.js.map} +1 -1
  60. package/dist/beeq/p-99829fc7.js +8 -1
  61. package/dist/beeq/p-99829fc7.js.map +1 -1
  62. package/dist/beeq/p-9cab14ee.entry.js +119 -0
  63. package/dist/beeq/{p-ae8ffb81.entry.js.map → p-9cab14ee.entry.js.map} +1 -1
  64. package/dist/beeq/p-a23b23c4.entry.js +213 -0
  65. package/dist/beeq/p-a23b23c4.entry.js.map +1 -0
  66. package/dist/beeq/p-a44ae8fe.entry.js +267 -0
  67. package/dist/beeq/p-a44ae8fe.entry.js.map +1 -0
  68. package/dist/beeq/p-a5dc1c94.js +118 -1
  69. package/dist/beeq/p-a5dc1c94.js.map +1 -1
  70. package/dist/beeq/p-a697c8de.entry.js +528 -0
  71. package/dist/beeq/p-a697c8de.entry.js.map +1 -0
  72. package/dist/beeq/p-a8cad5ab.js +5 -1
  73. package/dist/beeq/p-a8cad5ab.js.map +1 -1
  74. package/dist/beeq/p-aacaaa35.entry.js +209 -0
  75. package/dist/beeq/{p-8059836c.entry.js.map → p-aacaaa35.entry.js.map} +1 -1
  76. package/dist/beeq/p-af062402.js +7 -1
  77. package/dist/beeq/p-af062402.js.map +1 -1
  78. package/dist/beeq/p-b2df1479.entry.js +270 -0
  79. package/dist/beeq/p-b2df1479.entry.js.map +1 -0
  80. package/dist/beeq/p-b48788b5.js +72 -0
  81. package/dist/beeq/p-b48788b5.js.map +1 -0
  82. package/dist/beeq/p-b77b52f2.entry.js +188 -0
  83. package/dist/beeq/p-b77b52f2.entry.js.map +1 -0
  84. package/dist/beeq/p-c6cbb8e2.js +16 -0
  85. package/dist/beeq/{p-aee056e5.js.map → p-c6cbb8e2.js.map} +1 -1
  86. package/dist/beeq/p-c78ae3c2.js +1983 -0
  87. package/dist/beeq/p-c78ae3c2.js.map +1 -0
  88. package/dist/beeq/p-c83bc7fd.entry.js +157 -0
  89. package/dist/beeq/p-c83bc7fd.entry.js.map +1 -0
  90. package/dist/beeq/p-cb2b0014.entry.js +363 -0
  91. package/dist/beeq/p-cb2b0014.entry.js.map +1 -0
  92. package/dist/beeq/p-cb917e68.entry.js +177 -0
  93. package/dist/beeq/p-cb917e68.entry.js.map +1 -0
  94. package/dist/beeq/p-cfb8829b.entry.js +100 -0
  95. package/dist/beeq/{p-b7281046.entry.js.map → p-cfb8829b.entry.js.map} +1 -1
  96. package/dist/beeq/p-d7067dae.entry.js +151 -0
  97. package/dist/beeq/{p-571b40ff.entry.js.map → p-d7067dae.entry.js.map} +1 -1
  98. package/dist/beeq/p-d7ce7165.js +91 -0
  99. package/dist/beeq/p-d7ce7165.js.map +1 -0
  100. package/dist/beeq/p-d7dc7086.entry.js +267 -0
  101. package/dist/beeq/p-d7dc7086.entry.js.map +1 -0
  102. package/dist/beeq/p-e76e346b.entry.js +334 -0
  103. package/dist/beeq/p-e76e346b.entry.js.map +1 -0
  104. package/dist/beeq/p-ecd27cf2.js +11 -1
  105. package/dist/beeq/p-ecd27cf2.js.map +1 -1
  106. package/dist/beeq/p-edfd9767.js +31 -0
  107. package/dist/beeq/p-edfd9767.js.map +1 -0
  108. package/dist/beeq/p-f11a3beb.entry.js +90 -0
  109. package/dist/beeq/{p-be664fb0.entry.js.map → p-f11a3beb.entry.js.map} +1 -1
  110. package/dist/beeq/p-f1d6a960.entry.js +271 -0
  111. package/dist/beeq/p-f1d6a960.entry.js.map +1 -0
  112. package/dist/beeq/p-f350516b.entry.js +154 -0
  113. package/dist/beeq/p-f350516b.entry.js.map +1 -0
  114. package/dist/beeq/p-f979d79a.entry.js +120 -0
  115. package/dist/beeq/{p-9f40249f.entry.js.map → p-f979d79a.entry.js.map} +1 -1
  116. package/dist/beeq/{p-94d62f1b.entry.js → p-faa3be41.entry.js} +155 -2
  117. package/dist/beeq/{p-6e026fad.entry.js.map → p-faa3be41.entry.js.map} +1 -1
  118. package/dist/beeq/p-fb809932.entry.js +272 -0
  119. package/dist/beeq/{p-d2bbae3b.entry.js.map → p-fb809932.entry.js.map} +1 -1
  120. package/dist/cjs/assetsPath-2885c838.js +79 -0
  121. package/dist/cjs/assetsPath-2885c838.js.map +1 -0
  122. package/dist/cjs/beeq.cjs.js +3 -3
  123. package/dist/cjs/beeq.cjs.js.map +1 -1
  124. package/dist/cjs/bq-accordion-group.cjs.entry.js +3 -4
  125. package/dist/cjs/bq-accordion-group.cjs.entry.js.map +1 -1
  126. package/dist/cjs/bq-accordion.cjs.entry.js +83 -48
  127. package/dist/cjs/bq-accordion.cjs.entry.js.map +1 -1
  128. package/dist/cjs/bq-alert.cjs.entry.js +71 -63
  129. package/dist/cjs/bq-alert.cjs.entry.js.map +1 -1
  130. package/dist/cjs/bq-avatar.cjs.entry.js +42 -42
  131. package/dist/cjs/bq-avatar.cjs.entry.js.map +1 -1
  132. package/dist/cjs/bq-badge.cjs.entry.js +44 -44
  133. package/dist/cjs/bq-badge.cjs.entry.js.map +1 -1
  134. package/dist/cjs/bq-breadcrumb-item.cjs.entry.js +42 -32
  135. package/dist/cjs/bq-breadcrumb-item.cjs.entry.js.map +1 -1
  136. package/dist/cjs/bq-breadcrumb.cjs.entry.js +45 -30
  137. package/dist/cjs/bq-breadcrumb.cjs.entry.js.map +1 -1
  138. package/dist/cjs/bq-button_2.cjs.entry.js +189 -117
  139. package/dist/cjs/bq-button_2.cjs.entry.js.map +1 -1
  140. package/dist/cjs/bq-card.cjs.entry.js +5 -6
  141. package/dist/cjs/bq-card.cjs.entry.js.map +1 -1
  142. package/dist/cjs/bq-checkbox.cjs.entry.js +63 -54
  143. package/dist/cjs/bq-checkbox.cjs.entry.js.map +1 -1
  144. package/dist/cjs/bq-date-picker.cjs.entry.js +163 -140
  145. package/dist/cjs/bq-date-picker.cjs.entry.js.map +1 -1
  146. package/dist/cjs/bq-dialog.cjs.entry.js +71 -50
  147. package/dist/cjs/bq-dialog.cjs.entry.js.map +1 -1
  148. package/dist/cjs/bq-divider.cjs.entry.js +30 -25
  149. package/dist/cjs/bq-divider.cjs.entry.js.map +1 -1
  150. package/dist/cjs/bq-drawer.cjs.entry.js +52 -38
  151. package/dist/cjs/bq-drawer.cjs.entry.js.map +1 -1
  152. package/dist/cjs/bq-dropdown_2.cjs.entry.js +45 -35
  153. package/dist/cjs/bq-dropdown_2.cjs.entry.js.map +1 -1
  154. package/dist/cjs/bq-empty-state.cjs.entry.js +29 -26
  155. package/dist/cjs/bq-empty-state.cjs.entry.js.map +1 -1
  156. package/dist/cjs/bq-input.cjs.entry.js +116 -90
  157. package/dist/cjs/bq-input.cjs.entry.js.map +1 -1
  158. package/dist/cjs/bq-notification.cjs.entry.js +80 -59
  159. package/dist/cjs/bq-notification.cjs.entry.js.map +1 -1
  160. package/dist/cjs/bq-option-group.cjs.entry.js +4 -4
  161. package/dist/cjs/bq-option-group.cjs.entry.js.map +1 -1
  162. package/dist/cjs/bq-option-list_2.cjs.entry.js +77 -58
  163. package/dist/cjs/bq-option-list_2.cjs.entry.js.map +1 -1
  164. package/dist/cjs/bq-option.cjs.entry.js +65 -49
  165. package/dist/cjs/bq-option.cjs.entry.js.map +1 -1
  166. package/dist/cjs/bq-page-title.cjs.entry.js +38 -34
  167. package/dist/cjs/bq-page-title.cjs.entry.js.map +1 -1
  168. package/dist/cjs/bq-progress.cjs.entry.js +7 -8
  169. package/dist/cjs/bq-progress.cjs.entry.js.map +1 -1
  170. package/dist/cjs/bq-radio-group.cjs.entry.js +13 -8
  171. package/dist/cjs/bq-radio-group.cjs.entry.js.map +1 -1
  172. package/dist/cjs/bq-radio.cjs.entry.js +43 -37
  173. package/dist/cjs/bq-radio.cjs.entry.js.map +1 -1
  174. package/dist/cjs/bq-select.cjs.entry.js +189 -166
  175. package/dist/cjs/bq-select.cjs.entry.js.map +1 -1
  176. package/dist/cjs/bq-side-menu-item.cjs.entry.js +68 -55
  177. package/dist/cjs/bq-side-menu-item.cjs.entry.js.map +1 -1
  178. package/dist/cjs/bq-side-menu.cjs.entry.js +47 -32
  179. package/dist/cjs/bq-side-menu.cjs.entry.js.map +1 -1
  180. package/dist/cjs/bq-slider.cjs.entry.js +165 -144
  181. package/dist/cjs/bq-slider.cjs.entry.js.map +1 -1
  182. package/dist/cjs/bq-spinner.cjs.entry.js +56 -55
  183. package/dist/cjs/bq-spinner.cjs.entry.js.map +1 -1
  184. package/dist/cjs/bq-status.cjs.entry.js +4 -5
  185. package/dist/cjs/bq-status.cjs.entry.js.map +1 -1
  186. package/dist/cjs/bq-step-item.cjs.entry.js +22 -15
  187. package/dist/cjs/bq-step-item.cjs.entry.js.map +1 -1
  188. package/dist/cjs/bq-steps.cjs.entry.js +13 -11
  189. package/dist/cjs/bq-steps.cjs.entry.js.map +1 -1
  190. package/dist/cjs/bq-switch.cjs.entry.js +45 -34
  191. package/dist/cjs/bq-switch.cjs.entry.js.map +1 -1
  192. package/dist/cjs/bq-tab-group.cjs.entry.js +67 -60
  193. package/dist/cjs/bq-tab-group.cjs.entry.js.map +1 -1
  194. package/dist/cjs/bq-tab.cjs.entry.js +45 -35
  195. package/dist/cjs/bq-tab.cjs.entry.js.map +1 -1
  196. package/dist/cjs/bq-textarea.cjs.entry.js +80 -58
  197. package/dist/cjs/bq-textarea.cjs.entry.js.map +1 -1
  198. package/dist/cjs/bq-toast.cjs.entry.js +61 -57
  199. package/dist/cjs/bq-toast.cjs.entry.js.map +1 -1
  200. package/dist/cjs/bq-tooltip.cjs.entry.js +47 -43
  201. package/dist/cjs/bq-tooltip.cjs.entry.js.map +1 -1
  202. package/dist/cjs/{cssVariables-7139f0c6.js → cssVariables-dd190bc2.js} +3 -1
  203. package/dist/cjs/cssVariables-dd190bc2.js.map +1 -0
  204. package/dist/cjs/{debounce-f94a239b.js → debounce-1f7e1176.js} +3 -3
  205. package/dist/cjs/debounce-1f7e1176.js.map +1 -0
  206. package/dist/cjs/{index-e6d59dbb.js → index-34edf639.js} +48 -15
  207. package/dist/cjs/index-34edf639.js.map +1 -0
  208. package/dist/cjs/{index-e4c116b6.js → index-fc7876d6.js} +63 -19
  209. package/dist/cjs/index-fc7876d6.js.map +1 -0
  210. package/dist/cjs/index.cjs.js +6 -5
  211. package/dist/cjs/index.cjs.js.map +1 -1
  212. package/dist/cjs/{isDefined-4f4a320b.js → isDefined-869f6a26.js} +2 -2
  213. package/dist/cjs/{isDefined-4f4a320b.js.map → isDefined-869f6a26.js.map} +1 -1
  214. package/dist/cjs/loader.cjs.js +2 -2
  215. package/dist/cjs/{slot-dd6f7db9.js → slot-2fee189a.js} +3 -4
  216. package/dist/{beeq/p-d7a88b16.js.map → cjs/slot-2fee189a.js.map} +1 -1
  217. package/dist/collection/_storybook/foundation/helper/index.js +3 -3
  218. package/dist/collection/_storybook/foundation/helper/index.js.map +1 -1
  219. package/dist/collection/collection-manifest.json +2 -2
  220. package/dist/collection/components/accordion/bq-accordion.js +72 -39
  221. package/dist/collection/components/accordion/bq-accordion.js.map +1 -1
  222. package/dist/collection/components/accordion/helper/index.js +10 -4
  223. package/dist/collection/components/accordion/helper/index.js.map +1 -1
  224. package/dist/collection/components/accordion/scss/bq-accordion.css +1 -1
  225. package/dist/collection/components/accordion-group/bq-accordion-group.js +5 -0
  226. package/dist/collection/components/accordion-group/bq-accordion-group.js.map +1 -1
  227. package/dist/collection/components/accordion-group/scss/bq-accordion-group.css +1 -1
  228. package/dist/collection/components/alert/bq-alert.js +79 -61
  229. package/dist/collection/components/alert/bq-alert.js.map +1 -1
  230. package/dist/collection/components/alert/scss/bq-alert.css +1 -1
  231. package/dist/collection/components/avatar/bq-avatar.js +42 -38
  232. package/dist/collection/components/avatar/bq-avatar.js.map +1 -1
  233. package/dist/collection/components/avatar/scss/bq-avatar.css +1 -1
  234. package/dist/collection/components/badge/bq-badge.js +42 -38
  235. package/dist/collection/components/badge/bq-badge.js.map +1 -1
  236. package/dist/collection/components/badge/scss/bq-badge.css +1 -1
  237. package/dist/collection/components/breadcrumb/bq-breadcrumb.js +45 -26
  238. package/dist/collection/components/breadcrumb/bq-breadcrumb.js.map +1 -1
  239. package/dist/collection/components/breadcrumb/scss/bq-breadcrumb.css +1 -1
  240. package/dist/collection/components/breadcrumb-item/bq-breadcrumb-item.js +43 -27
  241. package/dist/collection/components/breadcrumb-item/bq-breadcrumb-item.js.map +1 -1
  242. package/dist/collection/components/breadcrumb-item/scss/bq-breadcrumb-item.css +1 -1
  243. package/dist/collection/components/button/bq-button.js +84 -43
  244. package/dist/collection/components/button/bq-button.js.map +1 -1
  245. package/dist/collection/components/button/scss/bq-button.css +1 -1
  246. package/dist/collection/components/card/bq-card.js +7 -2
  247. package/dist/collection/components/card/bq-card.js.map +1 -1
  248. package/dist/collection/components/card/scss/bq-card.css +1 -1
  249. package/dist/collection/components/checkbox/bq-checkbox.js +63 -50
  250. package/dist/collection/components/checkbox/bq-checkbox.js.map +1 -1
  251. package/dist/collection/components/checkbox/scss/bq-checkbox.css +1 -1
  252. package/dist/collection/components/date-picker/bq-date-picker.js +161 -134
  253. package/dist/collection/components/date-picker/bq-date-picker.js.map +1 -1
  254. package/dist/collection/components/date-picker/scss/bq-date-picker.css +1 -1
  255. package/dist/collection/components/dialog/bq-dialog.js +70 -45
  256. package/dist/collection/components/dialog/bq-dialog.js.map +1 -1
  257. package/dist/collection/components/dialog/scss/bq-dialog.css +1 -1
  258. package/dist/collection/components/divider/bq-divider.js +28 -19
  259. package/dist/collection/components/divider/bq-divider.js.map +1 -1
  260. package/dist/collection/components/divider/scss/bq-divider.css +1 -1
  261. package/dist/collection/components/drawer/bq-drawer.js +51 -33
  262. package/dist/collection/components/drawer/bq-drawer.js.map +1 -1
  263. package/dist/collection/components/drawer/scss/bq-drawer.css +1 -1
  264. package/dist/collection/components/dropdown/bq-dropdown.js +34 -23
  265. package/dist/collection/components/dropdown/bq-dropdown.js.map +1 -1
  266. package/dist/collection/components/empty-state/bq-empty-state.js +29 -22
  267. package/dist/collection/components/empty-state/bq-empty-state.js.map +1 -1
  268. package/dist/collection/components/icon/bq-icon.js +45 -35
  269. package/dist/collection/components/icon/bq-icon.js.map +1 -1
  270. package/dist/collection/components/icon/helper/request.js +51 -33
  271. package/dist/collection/components/icon/helper/request.js.map +1 -1
  272. package/dist/collection/components/icon/scss/bq-icon.css +1 -1
  273. package/dist/collection/components/input/bq-input.js +113 -83
  274. package/dist/collection/components/input/bq-input.js.map +1 -1
  275. package/dist/collection/components/input/scss/bq-input.css +1 -1
  276. package/dist/collection/components/notification/bq-notification.js +86 -54
  277. package/dist/collection/components/notification/bq-notification.js.map +1 -1
  278. package/dist/collection/components/notification/scss/bq-notification.css +1 -1
  279. package/dist/collection/components/option/bq-option.js +64 -44
  280. package/dist/collection/components/option/bq-option.js.map +1 -1
  281. package/dist/collection/components/option/scss/bq-option.css +1 -1
  282. package/dist/collection/components/option-group/bq-option-group.js +6 -1
  283. package/dist/collection/components/option-group/bq-option-group.js.map +1 -1
  284. package/dist/collection/components/option-group/scss/bq-option-group.css +1 -1
  285. package/dist/collection/components/option-list/bq-option-list.js +11 -1
  286. package/dist/collection/components/option-list/bq-option-list.js.map +1 -1
  287. package/dist/collection/components/option-list/scss/bq-option-list.css +1 -1
  288. package/dist/collection/components/page-title/bq-page-title.js +37 -29
  289. package/dist/collection/components/page-title/bq-page-title.js.map +1 -1
  290. package/dist/collection/components/page-title/scss/bq-page-title.css +1 -1
  291. package/dist/collection/components/panel/bq-panel.js +12 -7
  292. package/dist/collection/components/panel/bq-panel.js.map +1 -1
  293. package/dist/collection/components/panel/scss/bq-panel.css +1 -1
  294. package/dist/collection/components/progress/bq-progress.js +9 -4
  295. package/dist/collection/components/progress/bq-progress.js.map +1 -1
  296. package/dist/collection/components/progress/scss/bq-progress.css +1 -1
  297. package/dist/collection/components/radio/bq-radio.js +43 -34
  298. package/dist/collection/components/radio/bq-radio.js.map +1 -1
  299. package/dist/collection/components/radio/scss/bq-radio.css +1 -1
  300. package/dist/collection/components/radio-group/bq-radio-group.js +13 -4
  301. package/dist/collection/components/radio-group/bq-radio-group.js.map +1 -1
  302. package/dist/collection/components/select/bq-select.js +187 -160
  303. package/dist/collection/components/select/bq-select.js.map +1 -1
  304. package/dist/collection/components/select/scss/bq-select.css +1 -1
  305. package/dist/collection/components/side-menu/bq-side-menu.js +50 -29
  306. package/dist/collection/components/side-menu/bq-side-menu.js.map +1 -1
  307. package/dist/collection/components/side-menu/scss/bq-side-menu.css +1 -1
  308. package/dist/collection/components/side-menu-item/bq-side-menu-item.js +68 -51
  309. package/dist/collection/components/side-menu-item/bq-side-menu-item.js.map +1 -1
  310. package/dist/collection/components/side-menu-item/scss/bq-side-menu-item.css +1 -1
  311. package/dist/collection/components/slider/bq-slider.js +164 -139
  312. package/dist/collection/components/slider/bq-slider.js.map +1 -1
  313. package/dist/collection/components/slider/scss/bq-slider.css +1 -1
  314. package/dist/collection/components/spinner/bq-spinner.js +55 -50
  315. package/dist/collection/components/spinner/bq-spinner.js.map +1 -1
  316. package/dist/collection/components/spinner/scss/bq-spinner.css +1 -1
  317. package/dist/collection/components/status/bq-status.js +6 -1
  318. package/dist/collection/components/status/bq-status.js.map +1 -1
  319. package/dist/collection/components/status/scss/bq-status.css +1 -1
  320. package/dist/collection/components/step-item/bq-step-item.js +24 -11
  321. package/dist/collection/components/step-item/bq-step-item.js.map +1 -1
  322. package/dist/collection/components/step-item/scss/bq-step-item.css +1 -1
  323. package/dist/collection/components/steps/bq-steps.js +13 -7
  324. package/dist/collection/components/steps/bq-steps.js.map +1 -1
  325. package/dist/collection/components/steps/scss/bq-steps.css +1 -1
  326. package/dist/collection/components/switch/bq-switch.js +44 -29
  327. package/dist/collection/components/switch/bq-switch.js.map +1 -1
  328. package/dist/collection/components/switch/scss/bq-switch.css +1 -1
  329. package/dist/collection/components/tab/bq-tab.js +44 -30
  330. package/dist/collection/components/tab/bq-tab.js.map +1 -1
  331. package/dist/collection/components/tab/scss/bq-tab.css +1 -1
  332. package/dist/collection/components/tab-group/bq-tab-group.js +67 -56
  333. package/dist/collection/components/tab-group/bq-tab-group.js.map +1 -1
  334. package/dist/collection/components/tag/bq-tag.js +67 -49
  335. package/dist/collection/components/tag/bq-tag.js.map +1 -1
  336. package/dist/collection/components/tag/scss/bq-tag.css +1 -1
  337. package/dist/collection/components/textarea/bq-textarea.js +78 -52
  338. package/dist/collection/components/textarea/bq-textarea.js.map +1 -1
  339. package/dist/collection/components/textarea/scss/bq-textarea.css +1 -1
  340. package/dist/collection/components/toast/bq-toast.js +68 -52
  341. package/dist/collection/components/toast/bq-toast.js.map +1 -1
  342. package/dist/collection/components/toast/scss/bq-toast.css +1 -1
  343. package/dist/collection/components/tooltip/bq-tooltip.js +46 -39
  344. package/dist/collection/components/tooltip/bq-tooltip.js.map +1 -1
  345. package/dist/collection/components/tooltip/scss/bq-tooltip.css +1 -1
  346. package/dist/collection/index.js.map +1 -1
  347. package/dist/collection/services/libraries/floating-ui/index.js +4 -0
  348. package/dist/collection/services/libraries/floating-ui/index.js.map +1 -1
  349. package/dist/collection/shared/utils/assetsPath.js +48 -22
  350. package/dist/collection/shared/utils/assetsPath.js.map +1 -1
  351. package/dist/collection/shared/utils/cssVariables.js +2 -0
  352. package/dist/collection/shared/utils/cssVariables.js.map +1 -1
  353. package/dist/collection/shared/utils/debounce.js +2 -2
  354. package/dist/collection/shared/utils/debounce.js.map +1 -1
  355. package/dist/collection/shared/utils/slot.js +2 -3
  356. package/dist/collection/shared/utils/slot.js.map +1 -1
  357. package/dist/components/bq-accordion-group.js +2 -3
  358. package/dist/components/bq-accordion-group.js.map +1 -1
  359. package/dist/components/bq-accordion.js +81 -46
  360. package/dist/components/bq-accordion.js.map +1 -1
  361. package/dist/components/bq-alert.js +68 -60
  362. package/dist/components/bq-alert.js.map +1 -1
  363. package/dist/components/bq-avatar.js +41 -41
  364. package/dist/components/bq-avatar.js.map +1 -1
  365. package/dist/components/bq-badge2.js +41 -41
  366. package/dist/components/bq-badge2.js.map +1 -1
  367. package/dist/components/bq-breadcrumb-item.js +40 -30
  368. package/dist/components/bq-breadcrumb-item.js.map +1 -1
  369. package/dist/components/bq-breadcrumb.js +44 -29
  370. package/dist/components/bq-breadcrumb.js.map +1 -1
  371. package/dist/components/bq-button2.js +84 -47
  372. package/dist/components/bq-button2.js.map +1 -1
  373. package/dist/components/bq-card.js +4 -5
  374. package/dist/components/bq-card.js.map +1 -1
  375. package/dist/components/bq-checkbox.js +62 -53
  376. package/dist/components/bq-checkbox.js.map +1 -1
  377. package/dist/components/bq-date-picker.js +160 -137
  378. package/dist/components/bq-date-picker.js.map +1 -1
  379. package/dist/components/bq-dialog.js +69 -48
  380. package/dist/components/bq-dialog.js.map +1 -1
  381. package/dist/components/bq-divider2.js +27 -22
  382. package/dist/components/bq-divider2.js.map +1 -1
  383. package/dist/components/bq-drawer.js +50 -36
  384. package/dist/components/bq-drawer.js.map +1 -1
  385. package/dist/components/bq-dropdown2.js +32 -24
  386. package/dist/components/bq-dropdown2.js.map +1 -1
  387. package/dist/components/bq-empty-state.js +27 -24
  388. package/dist/components/bq-empty-state.js.map +1 -1
  389. package/dist/components/bq-icon2.js +164 -70
  390. package/dist/components/bq-icon2.js.map +1 -1
  391. package/dist/components/bq-input.js +112 -86
  392. package/dist/components/bq-input.js.map +1 -1
  393. package/dist/components/bq-notification.js +78 -56
  394. package/dist/components/bq-notification.js.map +1 -1
  395. package/dist/components/bq-option-group.js +3 -3
  396. package/dist/components/bq-option-group.js.map +1 -1
  397. package/dist/components/bq-option-list2.js +8 -4
  398. package/dist/components/bq-option-list2.js.map +1 -1
  399. package/dist/components/bq-option.js +63 -47
  400. package/dist/components/bq-option.js.map +1 -1
  401. package/dist/components/bq-page-title.js +36 -32
  402. package/dist/components/bq-page-title.js.map +1 -1
  403. package/dist/components/bq-panel2.js +11 -9
  404. package/dist/components/bq-panel2.js.map +1 -1
  405. package/dist/components/bq-progress.js +6 -7
  406. package/dist/components/bq-progress.js.map +1 -1
  407. package/dist/components/bq-radio-group.js +11 -6
  408. package/dist/components/bq-radio-group.js.map +1 -1
  409. package/dist/components/bq-radio.js +43 -37
  410. package/dist/components/bq-radio.js.map +1 -1
  411. package/dist/components/bq-select.js +186 -163
  412. package/dist/components/bq-select.js.map +1 -1
  413. package/dist/components/bq-side-menu-item.js +67 -54
  414. package/dist/components/bq-side-menu-item.js.map +1 -1
  415. package/dist/components/bq-side-menu.js +47 -31
  416. package/dist/components/bq-side-menu.js.map +1 -1
  417. package/dist/components/bq-slider.js +163 -142
  418. package/dist/components/bq-slider.js.map +1 -1
  419. package/dist/components/bq-spinner.js +53 -52
  420. package/dist/components/bq-spinner.js.map +1 -1
  421. package/dist/components/bq-status.js +3 -4
  422. package/dist/components/bq-status.js.map +1 -1
  423. package/dist/components/bq-step-item.js +21 -14
  424. package/dist/components/bq-step-item.js.map +1 -1
  425. package/dist/components/bq-steps.js +12 -10
  426. package/dist/components/bq-steps.js.map +1 -1
  427. package/dist/components/bq-switch.js +43 -32
  428. package/dist/components/bq-switch.js.map +1 -1
  429. package/dist/components/bq-tab-group.js +65 -58
  430. package/dist/components/bq-tab-group.js.map +1 -1
  431. package/dist/components/bq-tab.js +43 -33
  432. package/dist/components/bq-tab.js.map +1 -1
  433. package/dist/components/bq-tag2.js +66 -52
  434. package/dist/components/bq-tag2.js.map +1 -1
  435. package/dist/components/bq-textarea.js +77 -55
  436. package/dist/components/bq-textarea.js.map +1 -1
  437. package/dist/components/bq-toast.js +60 -55
  438. package/dist/components/bq-toast.js.map +1 -1
  439. package/dist/components/bq-tooltip2.js +45 -41
  440. package/dist/components/bq-tooltip2.js.map +1 -1
  441. package/dist/components/cssVariables.js +2 -0
  442. package/dist/components/cssVariables.js.map +1 -1
  443. package/dist/components/debounce.js +2 -2
  444. package/dist/components/debounce.js.map +1 -1
  445. package/dist/components/index.js +1 -1
  446. package/dist/components/index2.js +62 -18
  447. package/dist/components/index2.js.map +1 -1
  448. package/dist/components/isDefined.js +1 -1
  449. package/dist/components/slot.js +2 -3
  450. package/dist/components/slot.js.map +1 -1
  451. package/dist/esm/assetsPath-630898a9.js +76 -0
  452. package/dist/esm/assetsPath-630898a9.js.map +1 -0
  453. package/dist/esm/beeq.js +4 -4
  454. package/dist/esm/beeq.js.map +1 -1
  455. package/dist/esm/bq-accordion-group.entry.js +3 -4
  456. package/dist/esm/bq-accordion-group.entry.js.map +1 -1
  457. package/dist/esm/bq-accordion.entry.js +83 -48
  458. package/dist/esm/bq-accordion.entry.js.map +1 -1
  459. package/dist/esm/bq-alert.entry.js +71 -63
  460. package/dist/esm/bq-alert.entry.js.map +1 -1
  461. package/dist/esm/bq-avatar.entry.js +42 -42
  462. package/dist/esm/bq-avatar.entry.js.map +1 -1
  463. package/dist/esm/bq-badge.entry.js +44 -44
  464. package/dist/esm/bq-badge.entry.js.map +1 -1
  465. package/dist/esm/bq-breadcrumb-item.entry.js +42 -32
  466. package/dist/esm/bq-breadcrumb-item.entry.js.map +1 -1
  467. package/dist/esm/bq-breadcrumb.entry.js +45 -30
  468. package/dist/esm/bq-breadcrumb.entry.js.map +1 -1
  469. package/dist/esm/bq-button_2.entry.js +189 -117
  470. package/dist/esm/bq-button_2.entry.js.map +1 -1
  471. package/dist/esm/bq-card.entry.js +5 -6
  472. package/dist/esm/bq-card.entry.js.map +1 -1
  473. package/dist/esm/bq-checkbox.entry.js +63 -54
  474. package/dist/esm/bq-checkbox.entry.js.map +1 -1
  475. package/dist/esm/bq-date-picker.entry.js +163 -140
  476. package/dist/esm/bq-date-picker.entry.js.map +1 -1
  477. package/dist/esm/bq-dialog.entry.js +71 -50
  478. package/dist/esm/bq-dialog.entry.js.map +1 -1
  479. package/dist/esm/bq-divider.entry.js +30 -25
  480. package/dist/esm/bq-divider.entry.js.map +1 -1
  481. package/dist/esm/bq-drawer.entry.js +52 -38
  482. package/dist/esm/bq-drawer.entry.js.map +1 -1
  483. package/dist/esm/bq-dropdown_2.entry.js +45 -35
  484. package/dist/esm/bq-dropdown_2.entry.js.map +1 -1
  485. package/dist/esm/bq-empty-state.entry.js +29 -26
  486. package/dist/esm/bq-empty-state.entry.js.map +1 -1
  487. package/dist/esm/bq-input.entry.js +116 -90
  488. package/dist/esm/bq-input.entry.js.map +1 -1
  489. package/dist/esm/bq-notification.entry.js +80 -59
  490. package/dist/esm/bq-notification.entry.js.map +1 -1
  491. package/dist/esm/bq-option-group.entry.js +4 -4
  492. package/dist/esm/bq-option-group.entry.js.map +1 -1
  493. package/dist/esm/bq-option-list_2.entry.js +77 -58
  494. package/dist/esm/bq-option-list_2.entry.js.map +1 -1
  495. package/dist/esm/bq-option.entry.js +65 -49
  496. package/dist/esm/bq-option.entry.js.map +1 -1
  497. package/dist/esm/bq-page-title.entry.js +38 -34
  498. package/dist/esm/bq-page-title.entry.js.map +1 -1
  499. package/dist/esm/bq-progress.entry.js +7 -8
  500. package/dist/esm/bq-progress.entry.js.map +1 -1
  501. package/dist/esm/bq-radio-group.entry.js +13 -8
  502. package/dist/esm/bq-radio-group.entry.js.map +1 -1
  503. package/dist/esm/bq-radio.entry.js +43 -37
  504. package/dist/esm/bq-radio.entry.js.map +1 -1
  505. package/dist/esm/bq-select.entry.js +189 -166
  506. package/dist/esm/bq-select.entry.js.map +1 -1
  507. package/dist/esm/bq-side-menu-item.entry.js +68 -55
  508. package/dist/esm/bq-side-menu-item.entry.js.map +1 -1
  509. package/dist/esm/bq-side-menu.entry.js +47 -32
  510. package/dist/esm/bq-side-menu.entry.js.map +1 -1
  511. package/dist/esm/bq-slider.entry.js +165 -144
  512. package/dist/esm/bq-slider.entry.js.map +1 -1
  513. package/dist/esm/bq-spinner.entry.js +56 -55
  514. package/dist/esm/bq-spinner.entry.js.map +1 -1
  515. package/dist/esm/bq-status.entry.js +4 -5
  516. package/dist/esm/bq-status.entry.js.map +1 -1
  517. package/dist/esm/bq-step-item.entry.js +22 -15
  518. package/dist/esm/bq-step-item.entry.js.map +1 -1
  519. package/dist/esm/bq-steps.entry.js +13 -11
  520. package/dist/esm/bq-steps.entry.js.map +1 -1
  521. package/dist/esm/bq-switch.entry.js +45 -34
  522. package/dist/esm/bq-switch.entry.js.map +1 -1
  523. package/dist/esm/bq-tab-group.entry.js +67 -60
  524. package/dist/esm/bq-tab-group.entry.js.map +1 -1
  525. package/dist/esm/bq-tab.entry.js +45 -35
  526. package/dist/esm/bq-tab.entry.js.map +1 -1
  527. package/dist/esm/bq-textarea.entry.js +80 -58
  528. package/dist/esm/bq-textarea.entry.js.map +1 -1
  529. package/dist/esm/bq-toast.entry.js +61 -57
  530. package/dist/esm/bq-toast.entry.js.map +1 -1
  531. package/dist/esm/bq-tooltip.entry.js +47 -43
  532. package/dist/esm/bq-tooltip.entry.js.map +1 -1
  533. package/dist/esm/{cssVariables-5ffccc29.js → cssVariables-000c23ad.js} +3 -1
  534. package/dist/esm/cssVariables-000c23ad.js.map +1 -0
  535. package/dist/esm/{debounce-c82e3da1.js → debounce-3e72f418.js} +3 -3
  536. package/dist/esm/debounce-3e72f418.js.map +1 -0
  537. package/dist/esm/{index-efc1c2ef.js → index-033f1efb.js} +48 -16
  538. package/dist/esm/index-033f1efb.js.map +1 -0
  539. package/dist/esm/{index-136429a6.js → index-1618c78b.js} +63 -19
  540. package/dist/esm/index-1618c78b.js.map +1 -0
  541. package/dist/esm/index.js +7 -6
  542. package/dist/esm/index.js.map +1 -1
  543. package/dist/esm/{isDefined-91ae4cd3.js → isDefined-f356f816.js} +2 -2
  544. package/dist/esm/{isDefined-91ae4cd3.js.map → isDefined-f356f816.js.map} +1 -1
  545. package/dist/esm/loader.js +3 -3
  546. package/dist/esm/{slot-179d109d.js → slot-58bfedb5.js} +3 -4
  547. package/dist/esm/slot-58bfedb5.js.map +1 -0
  548. package/dist/hydrate/index.d.ts +10 -4
  549. package/dist/hydrate/index.js +4044 -2071
  550. package/dist/hydrate/index.mjs +4044 -2071
  551. package/dist/stencil.config.js +10 -1
  552. package/dist/stencil.config.js.map +1 -1
  553. package/dist/types/_storybook/foundation/helper/index.d.ts +1 -3
  554. package/dist/types/components/alert/bq-alert.d.ts +10 -4
  555. package/dist/types/components/button/bq-button.d.ts +5 -0
  556. package/dist/types/components/date-picker/bq-date-picker.d.ts +1 -0
  557. package/dist/types/components/divider/bq-divider.d.ts +1 -0
  558. package/dist/types/components/icon/bq-icon.d.ts +3 -1
  559. package/dist/types/components/icon/helper/request.d.ts +17 -1
  560. package/dist/types/components/notification/bq-notification.d.ts +8 -0
  561. package/dist/types/components/radio/bq-radio.d.ts +0 -5
  562. package/dist/types/components/select/bq-select.d.ts +2 -0
  563. package/dist/types/components/slider/bq-slider.d.ts +2 -0
  564. package/dist/types/components/step-item/bq-step-item.d.ts +1 -0
  565. package/dist/types/components/toast/bq-toast.d.ts +5 -0
  566. package/dist/types/components.d.ts +8 -8
  567. package/dist/types/shared/utils/assetsPath.d.ts +6 -16
  568. package/dist/types/shared/utils/cssVariables.d.ts +1 -1
  569. package/dist/types/stencil-public-runtime.d.ts +4 -0
  570. package/package.json +2 -2
  571. package/dist/beeq/p-0ab0b58d.js +0 -6
  572. package/dist/beeq/p-0ab0b58d.js.map +0 -1
  573. package/dist/beeq/p-235328ee.entry.js +0 -6
  574. package/dist/beeq/p-255fcbe4.entry.js +0 -6
  575. package/dist/beeq/p-255fcbe4.entry.js.map +0 -1
  576. package/dist/beeq/p-268dc1e3.entry.js +0 -6
  577. package/dist/beeq/p-268dc1e3.entry.js.map +0 -1
  578. package/dist/beeq/p-38d4bd8a.js +0 -6
  579. package/dist/beeq/p-38d4bd8a.js.map +0 -1
  580. package/dist/beeq/p-3aa41d80.entry.js.map +0 -1
  581. package/dist/beeq/p-3b2ce34b.entry.js +0 -6
  582. package/dist/beeq/p-41bac721.entry.js +0 -6
  583. package/dist/beeq/p-41bac721.entry.js.map +0 -1
  584. package/dist/beeq/p-4739f5c3.entry.js +0 -6
  585. package/dist/beeq/p-4739f5c3.entry.js.map +0 -1
  586. package/dist/beeq/p-4ba2bec7.entry.js +0 -6
  587. package/dist/beeq/p-4ba2bec7.entry.js.map +0 -1
  588. package/dist/beeq/p-52577f3a.entry.js +0 -6
  589. package/dist/beeq/p-52577f3a.entry.js.map +0 -1
  590. package/dist/beeq/p-571b40ff.entry.js +0 -6
  591. package/dist/beeq/p-606c080c.entry.js +0 -6
  592. package/dist/beeq/p-606c080c.entry.js.map +0 -1
  593. package/dist/beeq/p-633319f3.entry.js +0 -6
  594. package/dist/beeq/p-63ad9702.entry.js +0 -6
  595. package/dist/beeq/p-63ad9702.entry.js.map +0 -1
  596. package/dist/beeq/p-6e026fad.entry.js +0 -6
  597. package/dist/beeq/p-6edc8a33.js +0 -6
  598. package/dist/beeq/p-6edc8a33.js.map +0 -1
  599. package/dist/beeq/p-76e714c6.js +0 -7
  600. package/dist/beeq/p-76e714c6.js.map +0 -1
  601. package/dist/beeq/p-79b7547b.entry.js +0 -6
  602. package/dist/beeq/p-7f23cde7.entry.js +0 -6
  603. package/dist/beeq/p-7f23cde7.entry.js.map +0 -1
  604. package/dist/beeq/p-8059836c.entry.js +0 -6
  605. package/dist/beeq/p-8b7c7049.entry.js +0 -6
  606. package/dist/beeq/p-8b7c7049.entry.js.map +0 -1
  607. package/dist/beeq/p-90c5851d.entry.js +0 -6
  608. package/dist/beeq/p-90c5851d.entry.js.map +0 -1
  609. package/dist/beeq/p-951ba558.js +0 -6
  610. package/dist/beeq/p-96d7f361.entry.js +0 -6
  611. package/dist/beeq/p-96d7f361.entry.js.map +0 -1
  612. package/dist/beeq/p-9acfedb8.entry.js +0 -6
  613. package/dist/beeq/p-9acfedb8.entry.js.map +0 -1
  614. package/dist/beeq/p-9c6c6646.entry.js +0 -6
  615. package/dist/beeq/p-9c6c6646.entry.js.map +0 -1
  616. package/dist/beeq/p-9cd26e8d.entry.js +0 -6
  617. package/dist/beeq/p-9cd26e8d.entry.js.map +0 -1
  618. package/dist/beeq/p-9f40249f.entry.js +0 -6
  619. package/dist/beeq/p-a006be9e.entry.js +0 -6
  620. package/dist/beeq/p-a006be9e.entry.js.map +0 -1
  621. package/dist/beeq/p-a7b0fd0b.entry.js +0 -6
  622. package/dist/beeq/p-a7b0fd0b.entry.js.map +0 -1
  623. package/dist/beeq/p-ae8ffb81.entry.js +0 -6
  624. package/dist/beeq/p-aee056e5.js +0 -6
  625. package/dist/beeq/p-b7281046.entry.js +0 -6
  626. package/dist/beeq/p-b90c6de9.entry.js +0 -6
  627. package/dist/beeq/p-b9544567.entry.js.map +0 -1
  628. package/dist/beeq/p-be664fb0.entry.js +0 -6
  629. package/dist/beeq/p-c9c942e6.entry.js +0 -6
  630. package/dist/beeq/p-c9c942e6.entry.js.map +0 -1
  631. package/dist/beeq/p-d2bbae3b.entry.js +0 -6
  632. package/dist/beeq/p-d7a88b16.js +0 -6
  633. package/dist/beeq/p-ddb23180.entry.js +0 -6
  634. package/dist/beeq/p-ddb23180.entry.js.map +0 -1
  635. package/dist/beeq/p-e6382462.entry.js +0 -6
  636. package/dist/beeq/p-e6382462.entry.js.map +0 -1
  637. package/dist/beeq/p-eab59153.entry.js +0 -6
  638. package/dist/beeq/p-eab59153.entry.js.map +0 -1
  639. package/dist/beeq/p-eddb77c7.entry.js +0 -6
  640. package/dist/beeq/p-eddb77c7.entry.js.map +0 -1
  641. package/dist/cjs/assetsPath-eac0a3bf.js +0 -52
  642. package/dist/cjs/assetsPath-eac0a3bf.js.map +0 -1
  643. package/dist/cjs/cssVariables-7139f0c6.js.map +0 -1
  644. package/dist/cjs/debounce-f94a239b.js.map +0 -1
  645. package/dist/cjs/index-e4c116b6.js.map +0 -1
  646. package/dist/cjs/index-e6d59dbb.js.map +0 -1
  647. package/dist/cjs/slot-dd6f7db9.js.map +0 -1
  648. package/dist/components/assetsPath.js +0 -49
  649. package/dist/components/assetsPath.js.map +0 -1
  650. package/dist/esm/assetsPath-ae18c25e.js +0 -49
  651. package/dist/esm/assetsPath-ae18c25e.js.map +0 -1
  652. package/dist/esm/cssVariables-5ffccc29.js.map +0 -1
  653. package/dist/esm/debounce-c82e3da1.js.map +0 -1
  654. package/dist/esm/index-136429a6.js.map +0 -1
  655. package/dist/esm/index-efc1c2ef.js.map +0 -1
  656. package/dist/esm/slot-179d109d.js.map +0 -1
@@ -12,26 +12,6 @@ let id = 0;
12
12
  */
13
13
  export class BqDropdown {
14
14
  constructor() {
15
- // Own Properties
16
- // ====================
17
- this.dropdownPanelId = `bq-dropdown-panel-${++id}`;
18
- // Public methods API
19
- // These methods are exposed on the host element.
20
- // Always use two lines.
21
- // Public Methods must be async.
22
- // Requires JSDocs for public API documentation.
23
- // ===============================================
24
- // Local methods
25
- // Internal business logic.
26
- // These methods cannot be called from the host element.
27
- // =======================================================
28
- this.togglePanel = () => {
29
- var _a;
30
- // Don't toggle the panel if the component is disabled or the trigger element is disabled
31
- if (this.disabled || ((_a = this.triggerElem) === null || _a === void 0 ? void 0 : _a.hasAttribute('disabled')))
32
- return;
33
- this.open = !this.open;
34
- };
35
15
  this.disabled = false;
36
16
  this.distance = 4;
37
17
  this.keepOpenOnSelect = false;
@@ -42,18 +22,33 @@ export class BqDropdown {
42
22
  this.skidding = 0;
43
23
  this.strategy = 'fixed';
44
24
  }
25
+ // Own Properties
26
+ // ====================
27
+ dropdownPanelId = `bq-dropdown-panel-${++id}`;
28
+ triggerElem;
29
+ // Reference to host HTML element
30
+ // ===================================
31
+ el;
45
32
  // Prop lifecycle events
46
33
  // =======================
47
34
  onOpenChange() {
48
35
  this.bqOpen.emit({ open: this.open });
49
36
  }
50
37
  handleDisabledChange() {
51
- var _a, _b;
52
38
  if (!this.triggerElem)
53
39
  return;
54
40
  // set 'disabled' attribute based on 'this.disabled' value, ensuring consistent state handling
55
- this.disabled ? (_a = this.triggerElem) === null || _a === void 0 ? void 0 : _a.setAttribute('disabled', 'true') : (_b = this.triggerElem) === null || _b === void 0 ? void 0 : _b.removeAttribute('disabled');
41
+ if (!this.disabled) {
42
+ this.triggerElem?.removeAttribute('disabled');
43
+ return;
44
+ }
45
+ this.triggerElem?.setAttribute('disabled', 'true');
56
46
  }
47
+ // Events section
48
+ // Requires JSDocs for public API documentation
49
+ // ==============================================
50
+ /** Callback handler to be called when the dropdown panel is opened or closed. */
51
+ bqOpen;
57
52
  // Component lifecycle events
58
53
  // Ordered by their natural call order
59
54
  // =====================================
@@ -91,6 +86,22 @@ export class BqDropdown {
91
86
  return;
92
87
  this.open = false;
93
88
  }
89
+ // Public methods API
90
+ // These methods are exposed on the host element.
91
+ // Always use two lines.
92
+ // Public Methods must be async.
93
+ // Requires JSDocs for public API documentation.
94
+ // ===============================================
95
+ // Local methods
96
+ // Internal business logic.
97
+ // These methods cannot be called from the host element.
98
+ // =======================================================
99
+ togglePanel = () => {
100
+ // Don't toggle the panel if the component is disabled or the trigger element is disabled
101
+ if (this.disabled || this.triggerElem?.hasAttribute('disabled'))
102
+ return;
103
+ this.open = !this.open;
104
+ };
94
105
  // render() function
95
106
  // Always the last one in the class.
96
107
  // ===================================
@@ -98,7 +109,7 @@ export class BqDropdown {
98
109
  const style = {
99
110
  ...(this.panelHeight && { '--bq-panel--height': this.panelHeight }),
100
111
  };
101
- return (h("div", { key: '50ad5de23a43cc4cf52b84109f4956c4a3b858bc', class: "bq-dropdown", part: "base" }, h("div", { key: '81787e14a6b5693e069ef554dfd4c0594a0a5a6d', class: "bq-dropdown__trigger block", "aria-controls": this.dropdownPanelId, "aria-haspopup": "true", onClick: this.togglePanel, part: "trigger" }, h("slot", { key: 'ed9b75fde64885b12aeb4e9f69bb2cc42cd5e52a', name: "trigger" })), h("bq-panel", { key: '2520cbe2913f90d966a45926489fe9dc86c70450', style: style, id: this.dropdownPanelId, class: "bq-dropdown__panel", distance: this.distance, placement: this.placement, open: this.open, sameWidth: this.sameWidth, skidding: this.skidding, strategy: this.strategy, role: "group", part: "dropdown", exportparts: "panel" }, h("slot", { key: 'dd36867f0d0bbabbd76e56ee081ca1a3c3fb88f3' }))));
112
+ return (h("div", { key: '2ac61eda06d45f2b8854b267644853bf4a51ef01', class: "bq-dropdown", part: "base" }, h("div", { key: '59edd47afa2965bb12cabcb06fdaf9de0b9b4b5f', class: "bq-dropdown__trigger block", "aria-controls": this.dropdownPanelId, "aria-haspopup": "true", onClick: this.togglePanel, part: "trigger" }, h("slot", { key: '6a17b3bf90a78c5098ebe90df4fe50d43b056e91', name: "trigger" })), h("bq-panel", { key: 'd90f69501154639e9aebc37dbecf2ddaf8b3dd7f', style: style, id: this.dropdownPanelId, class: "bq-dropdown__panel", distance: this.distance, placement: this.placement, open: this.open, sameWidth: this.sameWidth, skidding: this.skidding, strategy: this.strategy, role: "group", part: "dropdown", exportparts: "panel" }, h("slot", { key: '7f8f659817324022d6dc31726094a1c82e6cab91' }))));
102
113
  }
103
114
  static get is() { return "bq-dropdown"; }
104
115
  static get encapsulation() { return "shadow"; }
@@ -1 +1 @@
1
- {"version":3,"file":"bq-dropdown.js","sourceRoot":"","sources":["../../../../../../src/components/dropdown/bq-dropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAIhG,IAAI,EAAE,GAAG,CAAC,CAAC;AAEX;;;;;GAKG;AAMH,MAAM,OAAO,UAAU;;QACrB,iBAAiB;QACjB,uBAAuB;QAEf,oBAAe,GAAG,qBAAqB,EAAE,EAAE,EAAE,CAAC;QA+GtD,qBAAqB;QACrB,iDAAiD;QACjD,wBAAwB;QACxB,gCAAgC;QAChC,gDAAgD;QAChD,kDAAkD;QAElD,gBAAgB;QAChB,2BAA2B;QAC3B,wDAAwD;QACxD,0DAA0D;QAElD,gBAAW,GAAG,GAAS,EAAE;;YAC/B,yFAAyF;YACzF,IAAI,IAAI,CAAC,QAAQ,KAAI,MAAA,IAAI,CAAC,WAAW,0CAAE,YAAY,CAAC,UAAU,CAAC,CAAA;gBAAE,OAAO;YAExE,IAAI,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC;QACzB,CAAC,CAAC;wBAhH4C,KAAK;wBAGN,CAAC;gCAGQ,KAAK;yBAGV,cAAc;oBAGN,KAAK;;yBAMf,KAAK;wBAGP,CAAC;wBAGa,OAAO;;IAElE,wBAAwB;IACxB,0BAA0B;IAG1B,YAAY;QACV,IAAI,CAAC,MAAM,CAAC,IAAI,CAA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esContent":["import { Component, Element, Event, EventEmitter, h, Listen, Prop, Watch } from '@stencil/core';\n\nimport { Placement } from '../../services/interfaces';\n\nlet id = 0;\n\n/**\n * @part base - The component's internal wrapper.\n * @part dropdown - The `<bq-panel>` element used under the hood to display the dropdown panel\n * @part panel - The `<div>` element used to display and style the panel inside the `<bq-panel>` element\n * @part trigger - The `<div>` element that hosts the trigger element\n */\n@Component({\n tag: 'bq-dropdown',\n styleUrl: './scss/bq-dropdown.scss',\n shadow: true,\n})\nexport class BqDropdown {\n // Own Properties\n // ====================\n\n private dropdownPanelId = `bq-dropdown-panel-${++id}`;\n private triggerElem: HTMLElement;\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqDropdownElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n // Public Property API\n // ========================\n\n /** If true, the dropdown panel will be visible and won't be shown. */\n @Prop({ reflect: true }) disabled?: boolean = false;\n\n /** Represents the distance (gutter or margin) between the panel and the trigger element. */\n @Prop({ reflect: true }) distance?: number = 4;\n\n /** If true, the panel will remain open after a selection is made. */\n @Prop({ reflect: true }) keepOpenOnSelect?: boolean = false;\n\n /** Position of the panel */\n @Prop({ reflect: true }) placement?: Placement = 'bottom-start';\n\n /** If true, the panel will be visible. */\n @Prop({ reflect: true, mutable: true }) open?: boolean = false;\n\n /** When set, it will override the height of the dropdown panel */\n @Prop({ reflect: true }) panelHeight?: string;\n\n /** Whether the panel should have the same width as the trigger element */\n @Prop({ reflect: true }) sameWidth?: boolean = false;\n\n /** Represents the skidding between the panel and the trigger element. */\n @Prop({ reflect: true }) skidding?: number = 0;\n\n /** Defines the strategy to position the panel */\n @Prop({ reflect: true }) strategy?: 'fixed' | 'absolute' = 'fixed';\n\n // Prop lifecycle events\n // =======================\n\n @Watch('open')\n onOpenChange() {\n this.bqOpen.emit({ open: this.open });\n }\n\n @Watch('disabled')\n handleDisabledChange() {\n if (!this.triggerElem) return;\n\n // set 'disabled' attribute based on 'this.disabled' value, ensuring consistent state handling\n this.disabled ? this.triggerElem?.setAttribute('disabled', 'true') : this.triggerElem?.removeAttribute('disabled');\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Callback handler to be called when the dropdown panel is opened or closed. */\n @Event() bqOpen: EventEmitter<{ open: boolean }>;\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n componentDidLoad() {\n this.triggerElem = this.el.querySelector('[slot=\"trigger\"]');\n this.handleDisabledChange();\n }\n\n // Listeners\n // ==============\n\n /** Listens for the 'click' event on the document object\n * and closes the dropdown panel if the click is outside the component.\n */\n @Listen('click', { target: 'document', passive: true })\n onClickOutside(event: MouseEvent) {\n if (!this.open) return;\n\n // Close when clicking outside of the close element\n const path = event.composedPath();\n if (!path.includes(this.el)) {\n this.open = false;\n }\n }\n\n /**\n * Listens for the 'keyup' event on the window object\n * and closes the dropdown panel if the 'Escape' key or 'Tab' key outside the component is pressed.\n */\n @Listen('keyup', { target: 'window', passive: true })\n onEscape(event: KeyboardEvent) {\n if (!this.open) return;\n\n if (event.key === 'Escape' || (event.key === 'Tab' && !event.composedPath().includes(this.el))) {\n this.open = false;\n }\n }\n\n @Listen('bqSelect', { passive: true })\n onItemSelect() {\n if (this.keepOpenOnSelect) return;\n\n this.open = false;\n }\n\n // Public methods API\n // These methods are exposed on the host element.\n // Always use two lines.\n // Public Methods must be async.\n // Requires JSDocs for public API documentation.\n // ===============================================\n\n // Local methods\n // Internal business logic.\n // These methods cannot be called from the host element.\n // =======================================================\n\n private togglePanel = (): void => {\n // Don't toggle the panel if the component is disabled or the trigger element is disabled\n if (this.disabled || this.triggerElem?.hasAttribute('disabled')) return;\n\n this.open = !this.open;\n };\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n const style = {\n ...(this.panelHeight && { '--bq-panel--height': this.panelHeight }),\n };\n\n return (\n <div class=\"bq-dropdown\" part=\"base\">\n {/* TRIGGER CONTAINER */}\n <div\n class=\"bq-dropdown__trigger block\"\n aria-controls={this.dropdownPanelId}\n aria-haspopup=\"true\"\n onClick={this.togglePanel}\n part=\"trigger\"\n >\n <slot name=\"trigger\" />\n </div>\n {/* PANEL */}\n <bq-panel\n style={style}\n id={this.dropdownPanelId}\n class=\"bq-dropdown__panel\"\n distance={this.distance}\n placement={this.placement}\n open={this.open}\n sameWidth={this.sameWidth}\n skidding={this.skidding}\n strategy={this.strategy}\n role=\"group\"\n part=\"dropdown\"\n exportparts=\"panel\"\n >\n <slot />\n </bq-panel>\n </div>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"bq-dropdown.js","sourceRoot":"","sources":["../../../../../../src/components/dropdown/bq-dropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAIhG,IAAI,EAAE,GAAG,CAAC,CAAC;AAEX;;;;;GAKG;AAMH,MAAM,OAAO,UAAU;;wBAoByB,KAAK;wBAGN,CAAC;gCAGQ,KAAK;yBAGV,cAAc;oBAGN,KAAK;;yBAMf,KAAK;wBAGP,CAAC;wBAGa,OAAO;;IA3ClE,iBAAiB;IACjB,uBAAuB;IAEf,eAAe,GAAG,qBAAqB,EAAE,EAAE,EAAE,CAAC;IAC9C,WAAW,CAAc;IAEjC,iCAAiC;IACjC,sCAAsC;IAE3B,EAAE,CAAyB;IAoCtC,wBAAwB;IACxB,0BAA0B;IAG1B,YAAY;QACV,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;IACxC,CAAC;IAGD,oBAAoB;QAClB,IAAI,CAAC,IAAI,CAAC,WAAW;YAAE,OAAO;QAE9B,8FAA8F;QAC9F,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACnB,IAAI,CAAC,WAAW,EAAE,eAAe,CAAC,UAAU,CAAC,CAAC;YA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Listen, Prop, Watch } from '@stencil/core';\n\nimport { Placement } from '../../services/interfaces';\n\nlet id = 0;\n\n/**\n * @part base - The component's internal wrapper.\n * @part dropdown - The `<bq-panel>` element used under the hood to display the dropdown panel\n * @part panel - The `<div>` element used to display and style the panel inside the `<bq-panel>` element\n * @part trigger - The `<div>` element that hosts the trigger element\n */\n@Component({\n tag: 'bq-dropdown',\n styleUrl: './scss/bq-dropdown.scss',\n shadow: true,\n})\nexport class BqDropdown {\n // Own Properties\n // ====================\n\n private dropdownPanelId = `bq-dropdown-panel-${++id}`;\n private triggerElem: HTMLElement;\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqDropdownElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n // Public Property API\n // ========================\n\n /** If true, the dropdown panel will be visible and won't be shown. */\n @Prop({ reflect: true }) disabled?: boolean = false;\n\n /** Represents the distance (gutter or margin) between the panel and the trigger element. */\n @Prop({ reflect: true }) distance?: number = 4;\n\n /** If true, the panel will remain open after a selection is made. */\n @Prop({ reflect: true }) keepOpenOnSelect?: boolean = false;\n\n /** Position of the panel */\n @Prop({ reflect: true }) placement?: Placement = 'bottom-start';\n\n /** If true, the panel will be visible. */\n @Prop({ reflect: true, mutable: true }) open?: boolean = false;\n\n /** When set, it will override the height of the dropdown panel */\n @Prop({ reflect: true }) panelHeight?: string;\n\n /** Whether the panel should have the same width as the trigger element */\n @Prop({ reflect: true }) sameWidth?: boolean = false;\n\n /** Represents the skidding between the panel and the trigger element. */\n @Prop({ reflect: true }) skidding?: number = 0;\n\n /** Defines the strategy to position the panel */\n @Prop({ reflect: true }) strategy?: 'fixed' | 'absolute' = 'fixed';\n\n // Prop lifecycle events\n // =======================\n\n @Watch('open')\n onOpenChange() {\n this.bqOpen.emit({ open: this.open });\n }\n\n @Watch('disabled')\n handleDisabledChange() {\n if (!this.triggerElem) return;\n\n // set 'disabled' attribute based on 'this.disabled' value, ensuring consistent state handling\n if (!this.disabled) {\n this.triggerElem?.removeAttribute('disabled');\n return;\n }\n this.triggerElem?.setAttribute('disabled', 'true');\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Callback handler to be called when the dropdown panel is opened or closed. */\n @Event() bqOpen: EventEmitter<{ open: boolean }>;\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n componentDidLoad() {\n this.triggerElem = this.el.querySelector('[slot=\"trigger\"]');\n this.handleDisabledChange();\n }\n\n // Listeners\n // ==============\n\n /** Listens for the 'click' event on the document object\n * and closes the dropdown panel if the click is outside the component.\n */\n @Listen('click', { target: 'document', passive: true })\n onClickOutside(event: MouseEvent) {\n if (!this.open) return;\n\n // Close when clicking outside of the close element\n const path = event.composedPath();\n if (!path.includes(this.el)) {\n this.open = false;\n }\n }\n\n /**\n * Listens for the 'keyup' event on the window object\n * and closes the dropdown panel if the 'Escape' key or 'Tab' key outside the component is pressed.\n */\n @Listen('keyup', { target: 'window', passive: true })\n onEscape(event: KeyboardEvent) {\n if (!this.open) return;\n\n if (event.key === 'Escape' || (event.key === 'Tab' && !event.composedPath().includes(this.el))) {\n this.open = false;\n }\n }\n\n @Listen('bqSelect', { passive: true })\n onItemSelect() {\n if (this.keepOpenOnSelect) return;\n\n this.open = false;\n }\n\n // Public methods API\n // These methods are exposed on the host element.\n // Always use two lines.\n // Public Methods must be async.\n // Requires JSDocs for public API documentation.\n // ===============================================\n\n // Local methods\n // Internal business logic.\n // These methods cannot be called from the host element.\n // =======================================================\n\n private togglePanel = (): void => {\n // Don't toggle the panel if the component is disabled or the trigger element is disabled\n if (this.disabled || this.triggerElem?.hasAttribute('disabled')) return;\n\n this.open = !this.open;\n };\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n const style = {\n ...(this.panelHeight && { '--bq-panel--height': this.panelHeight }),\n };\n\n return (\n <div class=\"bq-dropdown\" part=\"base\">\n {/* TRIGGER CONTAINER */}\n <div\n class=\"bq-dropdown__trigger block\"\n aria-controls={this.dropdownPanelId}\n aria-haspopup=\"true\"\n onClick={this.togglePanel}\n part=\"trigger\"\n >\n <slot name=\"trigger\" />\n </div>\n {/* PANEL */}\n <bq-panel\n style={style}\n id={this.dropdownPanelId}\n class=\"bq-dropdown__panel\"\n distance={this.distance}\n placement={this.placement}\n open={this.open}\n sameWidth={this.sameWidth}\n skidding={this.skidding}\n strategy={this.strategy}\n role=\"group\"\n part=\"dropdown\"\n exportparts=\"panel\"\n >\n <slot />\n </bq-panel>\n </div>\n );\n }\n}\n"]}
@@ -15,28 +15,17 @@ import { hasSlotContent, validatePropValue } from "../../shared/utils";
15
15
  */
16
16
  export class BqEmptyState {
17
17
  constructor() {
18
- // Listeners
19
- // ==============
20
- // Public methods API
21
- // These methods are exposed on the host element.
22
- // Always use two lines.
23
- // Public Methods must be async.
24
- // Requires JSDocs for public API documentation.
25
- // ===============================================
26
- // Local methods
27
- // Internal business logic.
28
- // These methods cannot be called from the host element.
29
- // =======================================================
30
- this.handleContentSlotChange = () => {
31
- this.hasBody = hasSlotContent(this.bodyElem, 'body');
32
- };
33
- this.handleFooterSlotChange = () => {
34
- this.hasFooter = hasSlotContent(this.footerElem, 'footer');
35
- };
36
18
  this.hasBody = false;
37
19
  this.hasFooter = false;
38
20
  this.size = 'medium';
39
21
  }
22
+ // Own Properties
23
+ // ====================
24
+ bodyElem;
25
+ footerElem;
26
+ // Reference to host HTML element
27
+ // ===================================
28
+ el;
40
29
  // Prop lifecycle events
41
30
  // =======================
42
31
  checkPropValues() {
@@ -51,6 +40,24 @@ export class BqEmptyState {
51
40
  componentWillLoad() {
52
41
  this.checkPropValues();
53
42
  }
43
+ // Listeners
44
+ // ==============
45
+ // Public methods API
46
+ // These methods are exposed on the host element.
47
+ // Always use two lines.
48
+ // Public Methods must be async.
49
+ // Requires JSDocs for public API documentation.
50
+ // ===============================================
51
+ // Local methods
52
+ // Internal business logic.
53
+ // These methods cannot be called from the host element.
54
+ // =======================================================
55
+ handleContentSlotChange = () => {
56
+ this.hasBody = hasSlotContent(this.bodyElem, 'body');
57
+ };
58
+ handleFooterSlotChange = () => {
59
+ this.hasFooter = hasSlotContent(this.footerElem, 'footer');
60
+ };
54
61
  get iconSize() {
55
62
  return SIZE_TO_VALUE_MAP[this.size] || SIZE_TO_VALUE_MAP.medium;
56
63
  }
@@ -58,11 +65,11 @@ export class BqEmptyState {
58
65
  // Always the last one in the class.
59
66
  // ===================================
60
67
  render() {
61
- return (h("div", { key: 'b90615e659a6cac45327e8c696189bbd13c29507', class: "inline-flex flex-col items-center", part: "wrapper" }, h("div", { key: 'b6042b2a9882fa0c1d144c429f310f544603b765', class: {
68
+ return (h("div", { key: 'edbbd39b9a17ead9e468197c44baade22dc48e94', class: "inline-flex flex-col items-center", part: "wrapper" }, h("div", { key: 'a40b8a7186614deeb705a98ffd32a35e91d47684', class: {
62
69
  'm-be-m': this.size === 'small',
63
70
  'm-be-xl': this.size === 'medium',
64
71
  'm-be-xxl': this.size === 'large',
65
- }, part: "thumbnail" }, h("slot", { key: '0591ec8aeedbf24b9591c771439f7152b0ede783', name: "thumbnail" }, h("bq-icon", { key: 'fa71af7602f1711fb137082030af4196ca9be7da', size: this.iconSize, name: "database", part: "icon", exportparts: "base,svg" }))), h("div", { key: '0df3edf598038dadca2cf6e31629f5a7fbbcaefe', class: {
72
+ }, part: "thumbnail" }, h("slot", { key: '7fd61415c33d06a0e083dd9cfd71d2beb6fece94', name: "thumbnail" }, h("bq-icon", { key: '13f20586539db6b31b21361d749e3f87e58b9176', size: this.iconSize, name: "database", part: "icon", exportparts: "base,svg" }))), h("div", { key: '0b0cbf179c5f4c4b7199aaea8b64d57c1081f18d', class: {
66
73
  'title-font font-bold leading-regular text-text-primary': true,
67
74
  'text-m': this.size === 'small',
68
75
  'text-l': this.size === 'medium',
@@ -70,7 +77,7 @@ export class BqEmptyState {
70
77
  'm-be-xs': this.size === 'small' && this.hasBody,
71
78
  'm-be-m': this.size === 'medium' && this.hasBody,
72
79
  'm-be-l': this.size === 'large' && this.hasBody,
73
- }, part: "title" }, h("slot", { key: 'c72a86306c641ddf07b9b43e2b4a387bcb274595' })), h("div", { key: 'bf5ea4bbde69a6e8ff1213844a479358f792f530', class: {
80
+ }, part: "title" }, h("slot", { key: '6b7573b0a9dd1643a70addac73e5a81c230a345b' })), h("div", { key: '43d6a20cb5dff348f89d8000a1429e43cc24660d', class: {
74
81
  'font-normal leading-regular': true,
75
82
  'text-s': this.size === 'small',
76
83
  'text-m': this.size === 'medium',
@@ -78,7 +85,7 @@ export class BqEmptyState {
78
85
  'm-be-m': this.size === 'small' && this.hasFooter,
79
86
  'm-be-l': this.size === 'medium' && this.hasFooter,
80
87
  'm-be-xl': this.size === 'large' && this.hasFooter,
81
- }, ref: (div) => (this.bodyElem = div), part: "body" }, h("slot", { key: '4dfcf2f72ad4cd972373ac9b0040b0a8685e6a70', name: "body", onSlotchange: this.handleContentSlotChange })), h("div", { key: '51b98d98e2d09ab0b14c8c63e0559eebd46844c2', class: { 'flex items-start gap-xs': true }, ref: (div) => (this.footerElem = div), part: "footer" }, h("slot", { key: 'd81630f3a9cf1a98f9adbfa759e4e02671961823', name: "footer", onSlotchange: this.handleFooterSlotChange }))));
88
+ }, ref: (div) => (this.bodyElem = div), part: "body" }, h("slot", { key: '42a967e534f2806881bc1c27baad90f7d8174693', name: "body", onSlotchange: this.handleContentSlotChange })), h("div", { key: '4196f39c435a23d92494af48b7a7724b7354f7a2', class: { 'flex items-start gap-xs': true }, ref: (div) => (this.footerElem = div), part: "footer" }, h("slot", { key: '93586a303fc4c43c06d32755a506c9fce16c98a4', name: "footer", onSlotchange: this.handleFooterSlotChange }))));
82
89
  }
83
90
  static get is() { return "bq-empty-state"; }
84
91
  static get encapsulation() { return "shadow"; }
@@ -1 +1 @@
1
- {"version":3,"file":"bq-empty-state.js","sourceRoot":"","sources":["../../../../../../src/components/empty-state/bq-empty-state.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAE1E,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAmB,MAAM,wBAAwB,CAAC;AAC9F,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvE;;;;;;;GAOG;AAOH,MAAM,OAAO,YAAY;;QA6CvB,YAAY;QACZ,iBAAiB;QAEjB,qBAAqB;QACrB,iDAAiD;QACjD,wBAAwB;QACxB,gCAAgC;QAChC,gDAAgD;QAChD,kDAAkD;QAElD,gBAAgB;QAChB,2BAA2B;QAC3B,wDAAwD;QACxD,0DAA0D;QAElD,4BAAuB,GAAG,GAAG,EAAE;YACrC,IAAI,CAAC,OAAO,GAAG,cAAc,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QACvD,CAAC,CAAC;QAEM,2BAAsB,GAAG,GAAG,EAAE;YACpC,IAAI,CAAC,SAAS,GAAG,cAAc,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;QAC7D,CAAC,CAAC;uBAlDyB,KAAK;yBACH,KAAK;oBAM8B,QAAQ;;IAExE,wBAAwB;IACxB,0BAA0B;IAG1B,eAAe;QACb,iBAAiB,CAAC,gBAAgB,EAAE,QAAQ,EAAE,IAAI,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;IACjE,CAAC;IAED,iBAAiB;IACjB,+CAA+C;IAC/C,iDAAiD;IAEjD,6BAA6B;IAC7B,sCAAsC;IACtC,wCAAwC;IAExC,iBAAiB;QACf,IAAI,CAAC,eAAe,EAAE,CA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IAAI,CAAC,IAAI,KAAK,QAAQ;oBAChC,QAAQ,EAAE,IAAI,CAAC,IAAI,KAAK,OAAO;oBAC/B,QAAQ,EAAE,IAAI,CAAC,IAAI,KAAK,OAAO,IAAI,IAAI,CAAC,SAAS;oBACjD,QAAQ,EAAE,IAAI,CAAC,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,SAAS;oBAClD,SAAS,EAAE,IAAI,CAAC,IAAI,KAAK,OAAO,IAAI,IAAI,CAAC,SAAS;iBACnD,EACD,GAAG,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,GAAG,GAAG,CAAC,EACnC,IAAI,EAAC,MAAM;gBAEX,6DAAM,IAAI,EAAC,MAAM,EAAC,YAAY,EAAE,IAAI,CAAC,uBAAuB,GAAI,CAC5D;YACN,4DAAK,KAAK,EAAE,EAAE,yBAAyB,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,UAAU,GAAG,GAAG,CAAC,EAAE,IAAI,EAAC,QAAQ;gBACnG,6DAAM,IAAI,EAAC,QAAQ,EAAC,YAAY,EAAE,IAAI,CAAC,sBAAsB,GAAI,CAC7D,CACF,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, h, Prop, State, Watch } from '@stencil/core';\n\nimport { EMPTY_STATE_SIZE, SIZE_TO_VALUE_MAP, TEmptyStateSize } from './bq-empty-state.types';\nimport { hasSlotContent, validatePropValue } from '../../shared/utils';\n\n/**\n * @part body - The container `<div>` that wraps the alert description content\n * @part footer - The container `<div>` that wraps the alert footer content\n * @part icon - The `<bq-icon>` element used to render a predefined icon size based on the empty state size (small, medium, large)\n * @part thumbnail - The container `<div>` that wraps the thumbnail element\n * @part title - The container `<div>` that wraps the empty state title content\n * @part wrapper - The wrapper container `<div>` of the element inside the shadow DOM\n */\n\n@Component({\n tag: 'bq-empty-state',\n styleUrl: './scss/bq-empty-state.scss',\n shadow: true,\n})\nexport class BqEmptyState {\n // Own Properties\n // ====================\n\n private bodyElem: HTMLDivElement;\n private footerElem: HTMLDivElement;\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqEmptyStateElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n @State() private hasBody = false;\n @State() private hasFooter = false;\n\n // Public Property API\n // ========================\n\n /** The size of the empty state component */\n @Prop({ reflect: true, mutable: true }) size: TEmptyStateSize = 'medium';\n\n // Prop lifecycle events\n // =======================\n\n @Watch('size')\n checkPropValues() {\n validatePropValue(EMPTY_STATE_SIZE, 'medium', this.el, 'size');\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n componentWillLoad() {\n this.checkPropValues();\n }\n\n // Listeners\n // ==============\n\n // Public methods API\n // These methods are exposed on the host element.\n // Always use two lines.\n // Public Methods must be async.\n // Requires JSDocs for public API documentation.\n // ===============================================\n\n // Local methods\n // Internal business logic.\n // These methods cannot be called from the host element.\n // =======================================================\n\n private handleContentSlotChange = () => {\n this.hasBody = hasSlotContent(this.bodyElem, 'body');\n };\n\n private handleFooterSlotChange = () => {\n this.hasFooter = hasSlotContent(this.footerElem, 'footer');\n };\n\n private get iconSize(): number {\n return SIZE_TO_VALUE_MAP[this.size] || SIZE_TO_VALUE_MAP.medium;\n }\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n return (\n <div class=\"inline-flex flex-col items-center\" part=\"wrapper\">\n <div\n class={{\n 'm-be-m': this.size === 'small',\n 'm-be-xl': this.size === 'medium',\n 'm-be-xxl': this.size === 'large',\n }}\n part=\"thumbnail\"\n >\n <slot name=\"thumbnail\">\n <bq-icon size={this.iconSize} name=\"database\" part=\"icon\" exportparts=\"base,svg\" />\n </slot>\n </div>\n <div\n class={{\n 'title-font font-bold leading-regular text-text-primary': true,\n 'text-m': this.size === 'small',\n 'text-l': this.size === 'medium',\n 'text-xxl2': this.size === 'large',\n 'm-be-xs': this.size === 'small' && this.hasBody,\n 'm-be-m': this.size === 'medium' && this.hasBody,\n 'm-be-l': this.size === 'large' && this.hasBody,\n }}\n part=\"title\"\n >\n <slot />\n </div>\n <div\n class={{\n 'font-normal leading-regular': true,\n 'text-s': this.size === 'small',\n 'text-m': this.size === 'medium',\n 'text-l': this.size === 'large',\n 'm-be-m': this.size === 'small' && this.hasFooter,\n 'm-be-l': this.size === 'medium' && this.hasFooter,\n 'm-be-xl': this.size === 'large' && this.hasFooter,\n }}\n ref={(div) => (this.bodyElem = div)}\n part=\"body\"\n >\n <slot name=\"body\" onSlotchange={this.handleContentSlotChange} />\n </div>\n <div class={{ 'flex items-start gap-xs': true }} ref={(div) => (this.footerElem = div)} part=\"footer\">\n <slot name=\"footer\" onSlotchange={this.handleFooterSlotChange} />\n </div>\n </div>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"bq-empty-state.js","sourceRoot":"","sources":["../../../../../../src/components/empty-state/bq-empty-state.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAE1E,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAmB,MAAM,wBAAwB,CAAC;AAC9F,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvE;;;;;;;GAOG;AAOH,MAAM,OAAO,YAAY;;uBAgBI,KAAK;yBACH,KAAK;oBAM8B,QAAQ;;IAtBxE,iBAAiB;IACjB,uBAAuB;IAEf,QAAQ,CAAiB;IACzB,UAAU,CAAiB;IAEnC,iCAAiC;IACjC,sCAAsC;IAE3B,EAAE,CAA2B;IAexC,wBAAwB;IACxB,0BAA0B;IAG1B,eAAe;QACb,iBAAiB,CAAC,gBAAgB,EAAE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E,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,UAAU,GAAG,GAAG,CAAC,EAAE,IAAI,EAAC,QAAQ;gBACnG,6DAAM,IAAI,EAAC,QAAQ,EAAC,YAAY,EAAE,IAAI,CAAC,sBAAsB,GAAI,CAC7D,CACF,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, h, Prop, State, Watch } from '@stencil/core';\n\nimport { EMPTY_STATE_SIZE, SIZE_TO_VALUE_MAP, TEmptyStateSize } from './bq-empty-state.types';\nimport { hasSlotContent, validatePropValue } from '../../shared/utils';\n\n/**\n * @part body - The container `<div>` that wraps the alert description content\n * @part footer - The container `<div>` that wraps the alert footer content\n * @part icon - The `<bq-icon>` element used to render a predefined icon size based on the empty state size (small, medium, large)\n * @part thumbnail - The container `<div>` that wraps the thumbnail element\n * @part title - The container `<div>` that wraps the empty state title content\n * @part wrapper - The wrapper container `<div>` of the element inside the shadow DOM\n */\n\n@Component({\n tag: 'bq-empty-state',\n styleUrl: './scss/bq-empty-state.scss',\n shadow: true,\n})\nexport class BqEmptyState {\n // Own Properties\n // ====================\n\n private bodyElem: HTMLDivElement;\n private footerElem: HTMLDivElement;\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqEmptyStateElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n @State() private hasBody = false;\n @State() private hasFooter = false;\n\n // Public Property API\n // ========================\n\n /** The size of the empty state component */\n @Prop({ reflect: true, mutable: true }) size: TEmptyStateSize = 'medium';\n\n // Prop lifecycle events\n // =======================\n\n @Watch('size')\n checkPropValues() {\n validatePropValue(EMPTY_STATE_SIZE, 'medium', this.el, 'size');\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n componentWillLoad() {\n this.checkPropValues();\n }\n\n // Listeners\n // ==============\n\n // Public methods API\n // These methods are exposed on the host element.\n // Always use two lines.\n // Public Methods must be async.\n // Requires JSDocs for public API documentation.\n // ===============================================\n\n // Local methods\n // Internal business logic.\n // These methods cannot be called from the host element.\n // =======================================================\n\n private handleContentSlotChange = () => {\n this.hasBody = hasSlotContent(this.bodyElem, 'body');\n };\n\n private handleFooterSlotChange = () => {\n this.hasFooter = hasSlotContent(this.footerElem, 'footer');\n };\n\n private get iconSize(): number {\n return SIZE_TO_VALUE_MAP[this.size] || SIZE_TO_VALUE_MAP.medium;\n }\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n return (\n <div class=\"inline-flex flex-col items-center\" part=\"wrapper\">\n <div\n class={{\n 'm-be-m': this.size === 'small',\n 'm-be-xl': this.size === 'medium',\n 'm-be-xxl': this.size === 'large',\n }}\n part=\"thumbnail\"\n >\n <slot name=\"thumbnail\">\n <bq-icon size={this.iconSize} name=\"database\" part=\"icon\" exportparts=\"base,svg\" />\n </slot>\n </div>\n <div\n class={{\n 'title-font font-bold leading-regular text-text-primary': true,\n 'text-m': this.size === 'small',\n 'text-l': this.size === 'medium',\n 'text-xxl2': this.size === 'large',\n 'm-be-xs': this.size === 'small' && this.hasBody,\n 'm-be-m': this.size === 'medium' && this.hasBody,\n 'm-be-l': this.size === 'large' && this.hasBody,\n }}\n part=\"title\"\n >\n <slot />\n </div>\n <div\n class={{\n 'font-normal leading-regular': true,\n 'text-s': this.size === 'small',\n 'text-m': this.size === 'medium',\n 'text-l': this.size === 'large',\n 'm-be-m': this.size === 'small' && this.hasFooter,\n 'm-be-l': this.size === 'medium' && this.hasFooter,\n 'm-be-xl': this.size === 'large' && this.hasFooter,\n }}\n ref={(div) => (this.bodyElem = div)}\n part=\"body\"\n >\n <slot name=\"body\" onSlotchange={this.handleContentSlotChange} />\n </div>\n <div class={{ 'flex items-start gap-xs': true }} ref={(div) => (this.footerElem = div)} part=\"footer\">\n <slot name=\"footer\" onSlotchange={this.handleFooterSlotChange} />\n </div>\n </div>\n );\n }\n}\n"]}
@@ -13,35 +13,6 @@ import { getBasePath, getColorCSSVariable, isNil } from "../../shared/utils";
13
13
  */
14
14
  export class BqIcon {
15
15
  constructor() {
16
- // Listeners
17
- // ==============
18
- // Public methods API
19
- // These methods are exposed on the host element.
20
- // Always use two lines.
21
- // Public Methods must be async.
22
- // Requires JSDocs for public API documentation.
23
- // ===============================================
24
- // Local methods
25
- // Internal business logic.
26
- // These methods cannot be called from the host element.
27
- // =======================================================
28
- this.getIconSource = (name) => {
29
- if (!this.name && !this.src)
30
- return;
31
- // Return the src if it is set
32
- if (this.src)
33
- return this.src;
34
- const SVG_EXTENSION = '.svg';
35
- const iconFileName = `${name}${SVG_EXTENSION}`;
36
- return getBasePath(iconFileName);
37
- };
38
- this.loadIcon = (name) => {
39
- const url = this.getIconSource(name);
40
- getSvgContent(url, true).then(() => {
41
- this._svgContent = iconContent.get(url);
42
- this.svgLoaded.emit(this._svgContent);
43
- });
44
- };
45
16
  this._svgContent = undefined;
46
17
  this.label = undefined;
47
18
  this.color = undefined;
@@ -76,25 +47,64 @@ export class BqIcon {
76
47
  const iconName = `${this.name}${weightSuffix}`;
77
48
  this.loadIcon(iconName);
78
49
  }
50
+ // Events section
51
+ // Requires JSDocs for public API documentation
52
+ // ==============================================
53
+ /** Callback handler to be called when the SVG has loaded */
54
+ svgLoaded;
79
55
  // Component lifecycle events
80
56
  // Ordered by their natural call order
81
57
  // =====================================
82
58
  connectedCallback() {
83
- this.handlePropsChange();
59
+ this.setupIconComponent();
60
+ }
61
+ componentWillLoad() {
62
+ this.setupIconComponent();
63
+ }
64
+ // Listeners
65
+ // ==============
66
+ // Public methods API
67
+ // These methods are exposed on the host element.
68
+ // Always use two lines.
69
+ // Public Methods must be async.
70
+ // Requires JSDocs for public API documentation.
71
+ // ===============================================
72
+ // Local methods
73
+ // Internal business logic.
74
+ // These methods cannot be called from the host element.
75
+ // =======================================================
76
+ setupIconComponent = () => {
77
+ this.loadIcon(this.name);
84
78
  // !TO BE REMOVED: Delete this once the deprecated `weight` property is removed
85
79
  if (!isNil(this.weight))
86
80
  this.handleWeightChange();
87
- }
81
+ };
82
+ getIconSource = (name) => {
83
+ if (!this.name && !this.src)
84
+ return;
85
+ // Return the src if it is set
86
+ if (this.src)
87
+ return this.src;
88
+ const SVG_EXTENSION = '.svg';
89
+ const iconFileName = `${name}${SVG_EXTENSION}`;
90
+ return getBasePath(iconFileName);
91
+ };
92
+ loadIcon = (name) => {
93
+ const url = this.getIconSource(name);
94
+ getSvgContent(url, true).then(() => {
95
+ this._svgContent = iconContent.get(url);
96
+ this.svgLoaded.emit(this._svgContent);
97
+ });
98
+ };
88
99
  // render() function
89
100
  // Always the last one in the class.
90
101
  // ===================================
91
102
  render() {
92
- var _a;
93
103
  const styles = {
94
104
  ...(this.color && { '--bq-icon--color': getColorCSSVariable(this.color) }),
95
105
  ...(this.size && { '--bq-icon--size': `${this.size}px` }),
96
106
  };
97
- return (h(Host, { key: 'b9779cb2a449a9ed5e1b1527c032ac063eb2ddfa', style: styles }, h("div", { key: '523947c4b80904049f194e369f7edce91dca43de', "aria-label": (_a = this.label) !== null && _a !== void 0 ? _a : `${this.name} icon`, class: "flex text-[color:--bq-icon--color] bs-[--bq-icon--size] is-[--bq-icon--size]", innerHTML: this._svgContent, part: "base", role: "img" })));
107
+ return (h(Host, { key: '69753077792209616891575d12aeeefbd767f29c', style: styles }, h("div", { key: 'b7df52fa6437e598b9a79e686c9b036cd3dbe864', "aria-label": this.label ?? `${this.name} icon`, class: "flex text-[color:--bq-icon--color] bs-[--bq-icon--size] is-[--bq-icon--size]", innerHTML: this._svgContent, part: "base", role: "img" })));
98
108
  }
99
109
  static get is() { return "bq-icon"; }
100
110
  static get encapsulation() { return "shadow"; }
@@ -153,8 +163,8 @@ export class BqIcon {
153
163
  "resolved": "string",
154
164
  "references": {}
155
165
  },
156
- "required": true,
157
- "optional": false,
166
+ "required": false,
167
+ "optional": true,
158
168
  "docs": {
159
169
  "tags": [],
160
170
  "text": "Icon name to load. Please check all available icons [here](https://phosphoricons.com/)"
@@ -1 +1 @@
1
- {"version":3,"file":"bq-icon.js","sourceRoot":"","sources":["../../../../../../src/components/icon/bq-icon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAG5F,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE7E;;;;;GAKG;AAOH,MAAM,OAAO,MAAM;;QAuFjB,YAAY;QACZ,iBAAiB;QAEjB,qBAAqB;QACrB,iDAAiD;QACjD,wBAAwB;QACxB,gCAAgC;QAChC,gDAAgD;QAChD,kDAAkD;QAElD,gBAAgB;QAChB,2BAA2B;QAC3B,wDAAwD;QACxD,0DAA0D;QAElD,kBAAa,GAAG,CAAC,IAAY,EAAE,EAAE;YACvC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG;gBAAE,OAAO;YACpC,8BAA8B;YAC9B,IAAI,IAAI,CAAC,GAAG;gBAAE,OAAO,IAAI,CAAC,GAAG,CAAC;YAE9B,MAAM,aAAa,GAAG,MAAM,CAAC;YAC7B,MAAM,YAAY,GAAG,GAAG,IAAI,GAAG,aAAa,EAAE,CAAC;YAE/C,OAAO,WAAW,CAAC,YAAY,CAAC,CAAC;QACnC,CAAC,CAAC;QAEM,aAAQ,GAAG,CAAC,IAAY,EAAE,EAAE;YAClC,MAAM,GAAG,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;YACrC,aAAa,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;gBACjC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC,GAAG,CAAC,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;YACb,GAAG,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,kBAAkB,EAAE,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;YAC1E,GAAG,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE,iBAAiB,EAAE,GAAG,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC;SAC1D,CAAC;QAEF,OAAO,CACL,EAAC,IAAI,qDAAC,KAAK,EAAE,MAAM;YACjB,0EACc,MAAA,IAAI,CAAC,KAAK,mCAAI,GAAG,IAAI,CAAC,IAAI,OAAO,EAC7C,KAAK,EAAC,8EAA8E,EACpF,SAAS,EAAE,IAAI,CAAC,WAAW,EAC3B,IAAI,EAAC,MAAM,EACX,IAAI,EAAC,KAAK,GACV,CACG,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Event, EventEmitter, h, Host, Prop, State, Watch } from '@stencil/core';\n\nimport { TIconWeight } from './bq-icon.types';\nimport { getSvgContent, iconContent } from './helper/request';\nimport { getBasePath, getColorCSSVariable, isNil } from '../../shared/utils';\n\n/**\n * Icons are simplified images that graphically explain the meaning of an object on the screen.\n *\n * @part base - The component's internal wrapper that holds the icon SVG content.\n * @part svg - The `<svg>` tag element inside the component.\n */\n@Component({\n assetsDirs: ['svg'],\n tag: 'bq-icon',\n styleUrl: './scss/bq-icon.scss',\n shadow: true,\n})\nexport class BqIcon {\n // Own Properties\n // ====================\n\n // Reference to host HTML element\n // ===================================\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n @State() private _svgContent: string;\n\n // Public Property API\n // ========================\n\n /** Label for the icon, used for accessibility */\n @Prop({ reflect: true }) label?: string;\n\n /** Set the stroke color of the SVG. The value should be a valid value of the palette color */\n @Prop({ reflect: true }) color?: string;\n\n /** Icon name to load. Please check all available icons [here](https://phosphoricons.com/) */\n @Prop({ reflect: true }) name!: string;\n\n /** Set the size of the SVG */\n @Prop({ reflect: true }) size?: string | number = 24;\n\n /** Set the source of the SVG. If the source is set, the name property will be ignored */\n @Prop({ reflect: true }) src?: string;\n\n /** @deprecated It set the icon weight/style */\n @Prop({ reflect: true }) weight?: TIconWeight = undefined;\n\n // Prop lifecycle events\n // =======================\n\n @Watch('color')\n @Watch('name')\n @Watch('size')\n handlePropsChange() {\n this.loadIcon(this.name);\n }\n\n /**\n * !TO BE REMOVED: Delete this `@Watch()` once the deprecated `weight` property is removed\n * We need to maintain retro-compatibility until the next major release\n */\n @Watch('weight')\n handleWeightChange() {\n if (this.name.includes(this.weight)) return;\n\n console.warn(\n `❗️ [bq-icon]: the 'weight' property is deprecated, you should add the weight to the icon name.\\n\n For example, '<bq-icon name=\"bell-fill\"></bq-icon>' instead of '<bq-icon name=\"bell\" weight=\"fill\"></bq-icon>'`,\n );\n // Check if the icon is weighted. An icon is considered weighted if its weight is not 'regular' and ENV_SVG_PATH is not set.\n // Eg: if the weight is 'bold' and ENV_SVG_PATH is not set, isWeightedIcon will be true.\n const REGULAR = 'regular';\n const isWeightedIcon = !isNil(this.weight) && this.weight !== REGULAR;\n // If the icon is weighted, append the weight to the icon name. Otherwise, append nothing.\n // Eg: if isWeightedIcon is true and the weight is 'bold', weightSuffix will be '-bold'.\n const weightSuffix = isWeightedIcon ? `-${this.weight}` : '';\n // Construct the icon name by appending the weight suffix (if any) and the file extension.\n // Eg: if the name is 'my-icon' and weightSuffix is '-bold', iconName will be 'my-icon-bold.svg'.\n const iconName = `${this.name}${weightSuffix}`;\n this.loadIcon(iconName);\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Callback handler to be called when the SVG has loaded */\n @Event() svgLoaded: EventEmitter;\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n connectedCallback() {\n this.handlePropsChange();\n\n // !TO BE REMOVED: Delete this once the deprecated `weight` property is removed\n if (!isNil(this.weight)) this.handleWeightChange();\n }\n\n // Listeners\n // ==============\n\n // Public methods API\n // These methods are exposed on the host element.\n // Always use two lines.\n // Public Methods must be async.\n // Requires JSDocs for public API documentation.\n // ===============================================\n\n // Local methods\n // Internal business logic.\n // These methods cannot be called from the host element.\n // =======================================================\n\n private getIconSource = (name: string) => {\n if (!this.name && !this.src) return;\n // Return the src if it is set\n if (this.src) return this.src;\n\n const SVG_EXTENSION = '.svg';\n const iconFileName = `${name}${SVG_EXTENSION}`;\n\n return getBasePath(iconFileName);\n };\n\n private loadIcon = (name: string) => {\n const url = this.getIconSource(name);\n getSvgContent(url, true).then(() => {\n this._svgContent = iconContent.get(url);\n this.svgLoaded.emit(this._svgContent);\n });\n };\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n const styles = {\n ...(this.color && { '--bq-icon--color': getColorCSSVariable(this.color) }),\n ...(this.size && { '--bq-icon--size': `${this.size}px` }),\n };\n\n return (\n <Host style={styles}>\n <div\n aria-label={this.label ?? `${this.name} icon`}\n class=\"flex text-[color:--bq-icon--color] bs-[--bq-icon--size] is-[--bq-icon--size]\"\n innerHTML={this._svgContent}\n part=\"base\"\n role=\"img\"\n />\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"bq-icon.js","sourceRoot":"","sources":["../../../../../../src/components/icon/bq-icon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAG5F,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE7E;;;;;GAKG;AAOH,MAAM,O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I,IAAI,EAAE,CAAC;SAC1D,CAAC;QAEF,OAAO,CACL,EAAC,IAAI,qDAAC,KAAK,EAAE,MAAM;YACjB,0EACc,IAAI,CAAC,KAAK,IAAI,GAAG,IAAI,CAAC,IAAI,OAAO,EAC7C,KAAK,EAAC,8EAA8E,EACpF,SAAS,EAAE,IAAI,CAAC,WAAW,EAC3B,IAAI,EAAC,MAAM,EACX,IAAI,EAAC,KAAK,GACV,CACG,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Event, EventEmitter, h, Host, Prop, State, Watch } from '@stencil/core';\n\nimport { TIconWeight } from './bq-icon.types';\nimport { getSvgContent, iconContent } from './helper/request';\nimport { getBasePath, getColorCSSVariable, isNil } from '../../shared/utils';\n\n/**\n * Icons are simplified images that graphically explain the meaning of an object on the screen.\n *\n * @part base - The component's internal wrapper that holds the icon SVG content.\n * @part svg - The `<svg>` tag element inside the component.\n */\n@Component({\n assetsDirs: ['svg'],\n tag: 'bq-icon',\n styleUrl: './scss/bq-icon.scss',\n shadow: true,\n})\nexport class BqIcon {\n // Own Properties\n // ====================\n\n // Reference to host HTML element\n // ===================================\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n @State() private _svgContent: string;\n\n // Public Property API\n // ========================\n\n /** Label for the icon, used for accessibility */\n @Prop({ reflect: true }) label?: string;\n\n /** Set the stroke color of the SVG. The value should be a valid value of the palette color */\n @Prop({ reflect: true }) color?: string;\n\n /** Icon name to load. Please check all available icons [here](https://phosphoricons.com/) */\n @Prop({ reflect: true }) name?: string;\n\n /** Set the size of the SVG */\n @Prop({ reflect: true }) size?: string | number = 24;\n\n /** Set the source of the SVG. If the source is set, the name property will be ignored */\n @Prop({ reflect: true }) src?: string;\n\n /** @deprecated It set the icon weight/style */\n @Prop({ reflect: true }) weight?: TIconWeight = undefined;\n\n // Prop lifecycle events\n // =======================\n\n @Watch('color')\n @Watch('name')\n @Watch('size')\n handlePropsChange() {\n this.loadIcon(this.name);\n }\n\n /**\n * !TO BE REMOVED: Delete this `@Watch()` once the deprecated `weight` property is removed\n * We need to maintain retro-compatibility until the next major release\n */\n @Watch('weight')\n handleWeightChange() {\n if (this.name.includes(this.weight)) return;\n\n console.warn(\n `❗️ [bq-icon]: the 'weight' property is deprecated, you should add the weight to the icon name.\\n\n For example, '<bq-icon name=\"bell-fill\"></bq-icon>' instead of '<bq-icon name=\"bell\" weight=\"fill\"></bq-icon>'`,\n );\n // Check if the icon is weighted. An icon is considered weighted if its weight is not 'regular' and ENV_SVG_PATH is not set.\n // Eg: if the weight is 'bold' and ENV_SVG_PATH is not set, isWeightedIcon will be true.\n const REGULAR = 'regular';\n const isWeightedIcon = !isNil(this.weight) && this.weight !== REGULAR;\n // If the icon is weighted, append the weight to the icon name. Otherwise, append nothing.\n // Eg: if isWeightedIcon is true and the weight is 'bold', weightSuffix will be '-bold'.\n const weightSuffix = isWeightedIcon ? `-${this.weight}` : '';\n // Construct the icon name by appending the weight suffix (if any) and the file extension.\n // Eg: if the name is 'my-icon' and weightSuffix is '-bold', iconName will be 'my-icon-bold.svg'.\n const iconName = `${this.name}${weightSuffix}`;\n this.loadIcon(iconName);\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Callback handler to be called when the SVG has loaded */\n @Event() svgLoaded: EventEmitter;\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n connectedCallback() {\n this.setupIconComponent();\n }\n\n componentWillLoad() {\n this.setupIconComponent();\n }\n\n // Listeners\n // ==============\n\n // Public methods API\n // These methods are exposed on the host element.\n // Always use two lines.\n // Public Methods must be async.\n // Requires JSDocs for public API documentation.\n // ===============================================\n\n // Local methods\n // Internal business logic.\n // These methods cannot be called from the host element.\n // =======================================================\n\n private setupIconComponent = () => {\n this.loadIcon(this.name);\n // !TO BE REMOVED: Delete this once the deprecated `weight` property is removed\n if (!isNil(this.weight)) this.handleWeightChange();\n };\n\n private getIconSource = (name: string) => {\n if (!this.name && !this.src) return;\n // Return the src if it is set\n if (this.src) return this.src;\n\n const SVG_EXTENSION = '.svg';\n const iconFileName = `${name}${SVG_EXTENSION}`;\n\n return getBasePath(iconFileName);\n };\n\n private loadIcon = (name: string) => {\n const url = this.getIconSource(name);\n getSvgContent(url, true).then(() => {\n this._svgContent = iconContent.get(url);\n this.svgLoaded.emit(this._svgContent);\n });\n };\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n const styles = {\n ...(this.color && { '--bq-icon--color': getColorCSSVariable(this.color) }),\n ...(this.size && { '--bq-icon--size': `${this.size}px` }),\n };\n\n return (\n <Host style={styles}>\n <div\n aria-label={this.label ?? `${this.name} icon`}\n class=\"flex text-[color:--bq-icon--color] bs-[--bq-icon--size] is-[--bq-icon--size]\"\n innerHTML={this._svgContent}\n part=\"base\"\n role=\"img\"\n />\n </Host>\n );\n }\n}\n"]}
@@ -7,9 +7,17 @@
7
7
  /* -------------------------------------------------------------------------- */
8
8
  import { isNil, isString } from "../../../shared/utils";
9
9
  const requests = new Map();
10
+ export const iconContent = new Map();
11
+ /**
12
+ * Fetches SVG content from a given URL and optionally sanitizes it.
13
+ * @param {string} url - The URL to fetch the SVG from.
14
+ * @param {boolean} sanitize - Whether to sanitize the SVG content.
15
+ * @returns {Promise<unknown>} - A promise that resolves to the SVG content.
16
+ */
10
17
  const fetchSvg = async (url, sanitize) => {
11
- if (typeof fetch === 'undefined' || typeof document === 'undefined')
18
+ if (isNil(url) || typeof fetch === 'undefined' || typeof window === 'undefined') {
12
19
  return;
20
+ }
13
21
  if (requests.has(url))
14
22
  return requests.get(url);
15
23
  try {
@@ -18,70 +26,80 @@ const fetchSvg = async (url, sanitize) => {
18
26
  iconContent.set(url, '');
19
27
  return;
20
28
  }
21
- let svgContent = (await response.text()) || '';
22
- if (svgContent && sanitize !== false)
29
+ let svgContent = await response.text();
30
+ if (sanitize !== false) {
23
31
  svgContent = validateContent(svgContent);
32
+ }
24
33
  iconContent.set(url, svgContent);
34
+ return svgContent;
25
35
  }
26
36
  catch (error) {
27
37
  console.error(`[BqIcon] Failed to fetch SVG from ${url}:`, error);
28
38
  iconContent.set(url, '');
29
39
  }
30
40
  };
31
- export const iconContent = new Map();
41
+ /**
42
+ * Retrieves the SVG content for a given URL, fetching and caching it if necessary.
43
+ * @param {string} url - The URL to fetch the SVG from.
44
+ * @param {boolean} sanitize - Whether to sanitize the SVG content.
45
+ * @returns {Promise<unknown>} - A promise that resolves to the SVG content.
46
+ */
32
47
  export const getSvgContent = async (url, sanitize) => {
48
+ if (isNil(url))
49
+ return;
33
50
  let req = requests.get(url);
34
- // NOTE: if the request does not exists we will cache it
35
51
  if (isNil(req)) {
36
52
  req = fetchSvg(url, sanitize);
37
53
  requests.set(url, req);
38
54
  }
39
55
  return req;
40
56
  };
57
+ /**
58
+ * Validates and sanitizes the SVG content.
59
+ * @param {string} svgContent - The SVG content to validate.
60
+ * @returns {string} - The sanitized SVG content.
61
+ */
41
62
  export const validateContent = (svgContent) => {
63
+ if (typeof window === 'undefined' || isNil(svgContent))
64
+ return '';
42
65
  const svgTag = 'svg';
43
66
  const iconCssClass = 'bq-icon__svg';
44
67
  const div = document.createElement('div');
45
68
  div.innerHTML = svgContent;
46
- for (let i = div.childNodes.length - 1; i >= 0; i--) {
47
- if (div.childNodes[i].nodeName.toLowerCase() !== svgTag) {
48
- div.removeChild(div.childNodes[i]);
49
- }
50
- }
51
- // must only have 1 root element
52
- const svgElm = div.firstElementChild;
53
- if (svgElm && svgElm.nodeName.toLowerCase() === svgTag) {
54
- // keep other CSS classes (if there's any) and add the `bq-icon__svg` CSS class
55
- const othersCssClasses = svgElm.getAttribute('class') || '';
56
- svgElm.setAttribute('class', `${othersCssClasses} ${iconCssClass}`.trim());
57
- // set the shadow DOM part for the SVG element
69
+ const svgElm = div.querySelector(svgTag);
70
+ if (svgElm) {
71
+ const existingClasses = svgElm.getAttribute('class') || '';
72
+ svgElm.setAttribute('class', `${existingClasses} ${iconCssClass}`.trim());
58
73
  svgElm.setAttribute('part', svgTag);
59
- // remove height and width attribute, if for some reason they are still present in the SVG tag
60
74
  svgElm.removeAttribute('height');
61
75
  svgElm.removeAttribute('width');
62
- // root element must be an svg
63
- // lets double check we've got valid elements
64
- // do not allow scripts
65
- if (isValid(svgElm))
76
+ if (isValid(svgElm)) {
66
77
  return div.innerHTML;
78
+ }
67
79
  }
68
80
  return '';
69
81
  };
82
+ /**
83
+ * Checks if an HTML element is valid (i.e., does not contain scripts or event handlers).
84
+ * @param {HTMLElement} elm - The element to check.
85
+ * @returns {boolean} - True if the element is valid, false otherwise.
86
+ */
70
87
  export const isValid = (elm) => {
71
- if (elm.nodeType === Node.ELEMENT_NODE) {
72
- if (elm.nodeName.toLowerCase() === 'script')
88
+ if (!elm)
89
+ return false;
90
+ if (elm.nodeType !== Node.ELEMENT_NODE)
91
+ return false;
92
+ if (elm.nodeName.toLowerCase() === 'script')
93
+ return false;
94
+ for (const attribute of Array.from(elm.attributes)) {
95
+ if (isString(attribute.value) && attribute.value.toLowerCase().startsWith('on')) {
73
96
  return false;
74
- for (const attribute of Array.from(elm.attributes)) {
75
- const value = attribute.value;
76
- if (isString(value) && value.toLowerCase().startsWith('on')) {
77
- return false;
78
- }
79
- }
80
- for (const childNode of Array.from(elm.children)) {
81
- if (!isValid(childNode))
82
- return false;
83
97
  }
84
98
  }
99
+ for (const childNode of Array.from(elm.children)) {
100
+ if (!isValid(childNode))
101
+ return false;
102
+ }
85
103
  return true;
86
104
  };
87
105
  //# sourceMappingURL=request.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"request.js","sourceRoot":"","sources":["../../../../../../../src/components/icon/helper/request.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,gFAAgF;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C,MAAM,EAAE,MAAM,CAAC,CAAC;QAEpC,8FAA8F;QAC9F,MAAM,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;QACjC,MAAM,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;QAEhC,8BAA8B;QAC9B,6CAA6C;QAC7C,uBAAuB;QACvB,IAAI,OAAO,CAAC,MAAqB,CAAC;YAAE,OAAO,GAAG,CAAC,SAAS,CAAC;IAC3D,CAAC;IAED,OAAO,EAAE,CAAC;AACZ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,GAAgB,EAAW,EAAE;IACnD,IAAI,GAAG,CAAC,QAAQ,KAAK,IAAI,CAAC,YAAY,EAAE,CAAC;QACvC,IAAI,GAAG,CAAC,QAAQ,CAAC,WAAW,EAAE,KAAK,QAAQ;YAAE,OAAO,KAAK,CAAC;QAE1D,KAAK,MAAM,SAAS,IAAI,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC;YACnD,MAAM,KAAK,GAAG,SAAS,CAAC,KAAK,CAAC;YAC9B,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC5D,OAAO,KAAK,CAAC;YACf,CAAC;QACH,CAAC;QAED,KAAK,MAAM,SAAS,IAAI,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAkB,EAAE,CAAC;YAClE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;gBAAE,OAAO,KAAK,CAAC;QACxC,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC","sourcesContent":["/* -------------------------------------------------------------------------- */\n/* Icon request helper */\n/* -------------------------------------------------------------------------- */\n\nimport { isNil, isString } from '../../../shared/utils';\n\nconst requests = new Map<string, Promise<unknown>>();\n\nconst fetchSvg = async (url: string, sanitize: boolean): Promise<unknown> => {\n if (typeof fetch === 'undefined' || typeof document === 'undefined') return;\n\n if (requests.has(url)) return requests.get(url);\n\n try {\n const response = await fetch(url);\n\n if (!response.ok) {\n iconContent.set(url, '');\n return;\n }\n\n let svgContent = (await response.text()) || '';\n\n if (svgContent && sanitize !== false) svgContent = validateContent(svgContent);\n\n iconContent.set(url, svgContent);\n } catch (error) {\n console.error(`[BqIcon] Failed to fetch SVG from ${url}:`, error);\n iconContent.set(url, '');\n }\n};\n\nexport const iconContent = new Map<string, string>();\n\nexport const getSvgContent = async (url: string, sanitize: boolean) => {\n let req = requests.get(url);\n\n // NOTE: if the request does not exists we will cache it\n if (isNil(req)) {\n req = fetchSvg(url, sanitize);\n requests.set(url, req);\n }\n return req;\n};\n\nexport const validateContent = (svgContent: string): string => {\n const svgTag = 'svg';\n const iconCssClass = 'bq-icon__svg';\n\n const div = document.createElement('div');\n div.innerHTML = svgContent;\n\n for (let i = div.childNodes.length - 1; i >= 0; i--) {\n if (div.childNodes[i].nodeName.toLowerCase() !== svgTag) {\n div.removeChild(div.childNodes[i]);\n }\n }\n\n // must only have 1 root element\n const svgElm = div.firstElementChild;\n if (svgElm && svgElm.nodeName.toLowerCase() === svgTag) {\n // keep other CSS classes (if there's any) and add the `bq-icon__svg` CSS class\n const othersCssClasses = svgElm.getAttribute('class') || '';\n svgElm.setAttribute('class', `${othersCssClasses} ${iconCssClass}`.trim());\n // set the shadow DOM part for the SVG element\n svgElm.setAttribute('part', svgTag);\n\n // remove height and width attribute, if for some reason they are still present in the SVG tag\n svgElm.removeAttribute('height');\n svgElm.removeAttribute('width');\n\n // root element must be an svg\n // lets double check we've got valid elements\n // do not allow scripts\n if (isValid(svgElm as HTMLElement)) return div.innerHTML;\n }\n\n return '';\n};\n\nexport const isValid = (elm: HTMLElement): boolean => {\n if (elm.nodeType === Node.ELEMENT_NODE) {\n if (elm.nodeName.toLowerCase() === 'script') return false;\n\n for (const attribute of Array.from(elm.attributes)) {\n const value = attribute.value;\n if (isString(value) && value.toLowerCase().startsWith('on')) {\n return false;\n }\n }\n\n for (const childNode of Array.from(elm.children) as HTMLElement[]) {\n if (!isValid(childNode)) return false;\n }\n }\n return true;\n};\n"]}
1
+ {"version":3,"file":"request.js","sourceRoot":"","sources":["../../../../../../../src/components/icon/helper/request.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,gFAAgF;AAChF,gFAAgF;AAEhF,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAExD,MAAM,QAAQ,GAAG,IAAI,GAAG,EAA4B,CAAC;AACrD,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,GAAG,EAAkB,CAAC;AAErD;;;;;GAKG;AACH,MAAM,QAAQ,GAAG,KAAK,EAAE,GAAW,EAAE,QAAiB,EAAoB,EAAE;IAC1E,IAAI,KAAK,CAAC,GAAG,CAAC,IAAI,OAAO,KAAK,KAAK,WAAW,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;QAChF,OAAO;IACT,CAAC;IAED,IAAI,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC;QAAE,OAAO,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAEhD,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC;QAElC,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACjB,WAAW,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;YACzB,OAAO;QACT,CAAC;QAED,IAAI,UAAU,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QAEvC,IAAI,QAAQ,KAAK,KAAK,EAAE,CAAC;YACvB,UAAU,GAAG,eAAe,CAAC,UAAU,CAAC,CAAC;QAC3C,CAAC;QAED,WAAW,CAAC,GAAG,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;QACjC,OAAO,UAAU,CAAC;IACpB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC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QAC1E,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACpC,MAAM,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;QACjC,MAAM,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;QAEhC,IAAI,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;YACpB,OAAO,GAAG,CAAC,SAAS,CAAC;QACvB,CAAC;IACH,CAAC;IAED,OAAO,EAAE,CAAC;AACZ,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,GAAY,EAAW,EAAE;IAC/C,IAAI,CAAC,GAAG;QAAE,OAAO,KAAK,CAAC;IACvB,IAAI,GAAG,CAAC,QAAQ,KAAK,IAAI,CAAC,YAAY;QAAE,OAAO,KAAK,CAAC;IACrD,IAAI,GAAG,CAAC,QAAQ,CAAC,WAAW,EAAE,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAE1D,KAAK,MAAM,SAAS,IAAI,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC;QACnD,IAAI,QAAQ,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,SAAS,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;YAChF,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IAED,KAAK,MAAM,SAAS,IAAI,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAkB,EAAE,CAAC;QAClE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;YAAE,OAAO,KAAK,CAAC;IACxC,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC","sourcesContent":["/* -------------------------------------------------------------------------- */\n/* Icon request helper */\n/* -------------------------------------------------------------------------- */\n\nimport { isNil, isString } from '../../../shared/utils';\n\nconst requests = new Map<string, Promise<unknown>>();\nexport const iconContent = new Map<string, string>();\n\n/**\n * Fetches SVG content from a given URL and optionally sanitizes it.\n * @param {string} url - The URL to fetch the SVG from.\n * @param {boolean} sanitize - Whether to sanitize the SVG content.\n * @returns {Promise<unknown>} - A promise that resolves to the SVG content.\n */\nconst fetchSvg = async (url: string, sanitize: boolean): Promise<unknown> => {\n if (isNil(url) || typeof fetch === 'undefined' || typeof window === 'undefined') {\n return;\n }\n\n if (requests.has(url)) return requests.get(url);\n\n try {\n const response = await fetch(url);\n\n if (!response.ok) {\n iconContent.set(url, '');\n return;\n }\n\n let svgContent = await response.text();\n\n if (sanitize !== false) {\n svgContent = validateContent(svgContent);\n }\n\n iconContent.set(url, svgContent);\n return svgContent;\n } catch (error) {\n console.error(`[BqIcon] Failed to fetch SVG from ${url}:`, error);\n iconContent.set(url, '');\n }\n};\n\n/**\n * Retrieves the SVG content for a given URL, fetching and caching it if necessary.\n * @param {string} url - The URL to fetch the SVG from.\n * @param {boolean} sanitize - Whether to sanitize the SVG content.\n * @returns {Promise<unknown>} - A promise that resolves to the SVG content.\n */\nexport const getSvgContent = async (url: string, sanitize: boolean): Promise<unknown> => {\n if (isNil(url)) return;\n\n let req = requests.get(url);\n\n if (isNil(req)) {\n req = fetchSvg(url, sanitize);\n requests.set(url, req);\n }\n return req;\n};\n\n/**\n * Validates and sanitizes the SVG content.\n * @param {string} svgContent - The SVG content to validate.\n * @returns {string} - The sanitized SVG content.\n */\nexport const validateContent = (svgContent: string): string => {\n if (typeof window === 'undefined' || isNil(svgContent)) return '';\n\n const svgTag = 'svg';\n const iconCssClass = 'bq-icon__svg';\n const div = document.createElement('div');\n div.innerHTML = svgContent;\n\n const svgElm = div.querySelector(svgTag);\n\n if (svgElm) {\n const existingClasses = svgElm.getAttribute('class') || '';\n svgElm.setAttribute('class', `${existingClasses} ${iconCssClass}`.trim());\n svgElm.setAttribute('part', svgTag);\n svgElm.removeAttribute('height');\n svgElm.removeAttribute('width');\n\n if (isValid(svgElm)) {\n return div.innerHTML;\n }\n }\n\n return '';\n};\n\n/**\n * Checks if an HTML element is valid (i.e., does not contain scripts or event handlers).\n * @param {HTMLElement} elm - The element to check.\n * @returns {boolean} - True if the element is valid, false otherwise.\n */\nexport const isValid = (elm: Element): boolean => {\n if (!elm) return false;\n if (elm.nodeType !== Node.ELEMENT_NODE) return false;\n if (elm.nodeName.toLowerCase() === 'script') return false;\n\n for (const attribute of Array.from(elm.attributes)) {\n if (isString(attribute.value) && attribute.value.toLowerCase().startsWith('on')) {\n return false;\n }\n }\n\n for (const childNode of Array.from(elm.children) as HTMLElement[]) {\n if (!isValid(childNode)) return false;\n }\n\n return true;\n};\n"]}