@six-group/ui-library 4.0.3 → 4.0.4

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 (352) hide show
  1. package/dist/cjs/{form-control-9769b310.js → form-control-19303ed2.js} +2 -2
  2. package/dist/cjs/{form-control-9769b310.js.map → form-control-19303ed2.js.map} +1 -1
  3. package/dist/cjs/{index-900437fc.js → index-7d73cbd6.js} +281 -121
  4. package/dist/cjs/index-7d73cbd6.js.map +1 -0
  5. package/dist/cjs/index.cjs.js +15 -0
  6. package/dist/cjs/index.cjs.js.map +1 -1
  7. package/dist/cjs/loader.cjs.js +2 -2
  8. package/dist/cjs/set-attributes_2.cjs.entry.js +1 -1
  9. package/dist/cjs/six-alert.cjs.entry.js +1 -1
  10. package/dist/cjs/six-avatar.cjs.entry.js +1 -1
  11. package/dist/cjs/six-badge.cjs.entry.js +1 -1
  12. package/dist/cjs/six-button.cjs.entry.js +1 -1
  13. package/dist/cjs/six-card.cjs.entry.js +1 -1
  14. package/dist/cjs/six-checkbox.cjs.entry.js +3 -3
  15. package/dist/cjs/six-checkbox.cjs.entry.js.map +1 -1
  16. package/dist/cjs/six-datepicker.cjs.entry.js +1 -1
  17. package/dist/cjs/six-details.cjs.entry.js +1 -1
  18. package/dist/cjs/six-dialog.cjs.entry.js +1 -1
  19. package/dist/cjs/six-drawer.cjs.entry.js +2 -2
  20. package/dist/cjs/six-drawer.cjs.entry.js.map +1 -1
  21. package/dist/cjs/six-dropdown_2.cjs.entry.js +1 -1
  22. package/dist/cjs/six-error-page.cjs.entry.js +1 -1
  23. package/dist/cjs/six-error.cjs.entry.js +1 -1
  24. package/dist/cjs/six-file-list-item.cjs.entry.js +1 -1
  25. package/dist/cjs/six-file-list.cjs.entry.js +1 -1
  26. package/dist/cjs/six-file-upload.cjs.entry.js +1 -1
  27. package/dist/cjs/six-footer.cjs.entry.js +1 -1
  28. package/dist/cjs/six-group-label.cjs.entry.js +3 -3
  29. package/dist/cjs/six-group-label.cjs.entry.js.map +1 -1
  30. package/dist/cjs/six-header.cjs.entry.js +1 -1
  31. package/dist/cjs/six-icon-button.cjs.entry.js +1 -1
  32. package/dist/cjs/six-icon.cjs.entry.js +1 -1
  33. package/dist/cjs/six-input.cjs.entry.js +3 -3
  34. package/dist/cjs/six-input.cjs.entry.js.map +1 -1
  35. package/dist/cjs/six-item-picker.cjs.entry.js +1 -1
  36. package/dist/cjs/six-language-switcher.cjs.entry.js +1 -1
  37. package/dist/cjs/six-layout-grid.cjs.entry.js +1 -1
  38. package/dist/cjs/six-main-container.cjs.entry.js +1 -1
  39. package/dist/cjs/six-menu-divider.cjs.entry.js +1 -1
  40. package/dist/cjs/six-menu-item.cjs.entry.js +1 -1
  41. package/dist/cjs/six-menu-label.cjs.entry.js +1 -1
  42. package/dist/cjs/six-picto.cjs.entry.js +1 -1
  43. package/dist/cjs/six-progress-bar.cjs.entry.js +1 -1
  44. package/dist/cjs/six-progress-ring.cjs.entry.js +1 -1
  45. package/dist/cjs/six-radio.cjs.entry.js +1 -1
  46. package/dist/cjs/six-range.cjs.entry.js +3 -3
  47. package/dist/cjs/six-range.cjs.entry.js.map +1 -1
  48. package/dist/cjs/six-root.cjs.entry.js +1 -1
  49. package/dist/cjs/six-search-field.cjs.entry.js +1 -1
  50. package/dist/cjs/six-select.cjs.entry.js +3 -3
  51. package/dist/cjs/six-select.cjs.entry.js.map +1 -1
  52. package/dist/cjs/six-sidebar-item-group.cjs.entry.js +13 -3
  53. package/dist/cjs/six-sidebar-item-group.cjs.entry.js.map +1 -1
  54. package/dist/cjs/six-sidebar-item.cjs.entry.js +6 -4
  55. package/dist/cjs/six-sidebar-item.cjs.entry.js.map +1 -1
  56. package/dist/cjs/six-sidebar.cjs.entry.js +1 -1
  57. package/dist/cjs/six-spinner.cjs.entry.js +1 -1
  58. package/dist/cjs/six-switch.cjs.entry.js +3 -3
  59. package/dist/cjs/six-switch.cjs.entry.js.map +1 -1
  60. package/dist/cjs/six-tab-group.cjs.entry.js +1 -1
  61. package/dist/cjs/six-tab-panel.cjs.entry.js +1 -1
  62. package/dist/cjs/six-tab.cjs.entry.js +1 -1
  63. package/dist/cjs/six-tag.cjs.entry.js +1 -1
  64. package/dist/cjs/six-textarea.cjs.entry.js +3 -3
  65. package/dist/cjs/six-textarea.cjs.entry.js.map +1 -1
  66. package/dist/cjs/six-tile.cjs.entry.js +1 -1
  67. package/dist/cjs/six-timepicker.cjs.entry.js +1 -1
  68. package/dist/cjs/six-tooltip.cjs.entry.js +1 -1
  69. package/dist/cjs/ui-library.cjs.js +3 -3
  70. package/dist/cjs/ui-library.cjs.js.map +1 -1
  71. package/dist/collection/collection-manifest.json +2 -2
  72. package/dist/collection/components/six-checkbox/six-checkbox.css +3 -0
  73. package/dist/collection/components/six-drawer/six-drawer.js +1 -1
  74. package/dist/collection/components/six-drawer/six-drawer.js.map +1 -1
  75. package/dist/collection/components/six-drawer/test/six-drawer.spec.js +1 -1
  76. package/dist/collection/components/six-drawer/test/six-drawer.spec.js.map +1 -1
  77. package/dist/collection/components/six-group-label/six-group-label.css +3 -0
  78. package/dist/collection/components/six-input/six-input.css +3 -0
  79. package/dist/collection/components/six-range/six-range.css +3 -0
  80. package/dist/collection/components/six-select/six-select.css +3 -0
  81. package/dist/collection/components/six-sidebar-item/six-sidebar-item.css +6 -1
  82. package/dist/collection/components/six-sidebar-item/six-sidebar-item.js +21 -2
  83. package/dist/collection/components/six-sidebar-item/six-sidebar-item.js.map +1 -1
  84. package/dist/collection/components/six-sidebar-item-group/six-sidebar-item-group.css +7 -0
  85. package/dist/collection/components/six-sidebar-item-group/six-sidebar-item-group.js +28 -1
  86. package/dist/collection/components/six-sidebar-item-group/six-sidebar-item-group.js.map +1 -1
  87. package/dist/collection/components/six-switch/six-switch.css +3 -0
  88. package/dist/collection/components/six-textarea/six-textarea.css +3 -0
  89. package/dist/collection/utils/error-messages.js +14 -0
  90. package/dist/collection/utils/error-messages.js.map +1 -1
  91. package/dist/components/index.d.ts +6 -0
  92. package/dist/components/index.js +16 -2
  93. package/dist/components/index.js.map +1 -1
  94. package/dist/components/set-attributes2.js +2 -0
  95. package/dist/components/set-attributes2.js.map +1 -1
  96. package/dist/components/six-alert.js +3 -0
  97. package/dist/components/six-alert.js.map +1 -1
  98. package/dist/components/six-checkbox.js +6 -1
  99. package/dist/components/six-checkbox.js.map +1 -1
  100. package/dist/components/six-datepicker.js +4 -1
  101. package/dist/components/six-datepicker.js.map +1 -1
  102. package/dist/components/six-details2.js +2 -0
  103. package/dist/components/six-details2.js.map +1 -1
  104. package/dist/components/six-dialog.js +2 -0
  105. package/dist/components/six-dialog.js.map +1 -1
  106. package/dist/components/six-drawer.js +3 -1
  107. package/dist/components/six-drawer.js.map +1 -1
  108. package/dist/components/six-dropdown2.js +7 -0
  109. package/dist/components/six-dropdown2.js.map +1 -1
  110. package/dist/components/six-group-label.js +4 -1
  111. package/dist/components/six-group-label.js.map +1 -1
  112. package/dist/components/six-header.js +2 -0
  113. package/dist/components/six-header.js.map +1 -1
  114. package/dist/components/six-input2.js +6 -1
  115. package/dist/components/six-input2.js.map +1 -1
  116. package/dist/components/six-item-picker2.js +4 -0
  117. package/dist/components/six-item-picker2.js.map +1 -1
  118. package/dist/components/six-language-switcher.js +2 -0
  119. package/dist/components/six-language-switcher.js.map +1 -1
  120. package/dist/components/six-layout-grid.js +2 -0
  121. package/dist/components/six-layout-grid.js.map +1 -1
  122. package/dist/components/six-progress-ring.js +2 -0
  123. package/dist/components/six-progress-ring.js.map +1 -1
  124. package/dist/components/six-radio.js +3 -0
  125. package/dist/components/six-radio.js.map +1 -1
  126. package/dist/components/six-range.js +8 -1
  127. package/dist/components/six-range.js.map +1 -1
  128. package/dist/components/six-root.js +2 -0
  129. package/dist/components/six-root.js.map +1 -1
  130. package/dist/components/six-search-field.js +2 -0
  131. package/dist/components/six-search-field.js.map +1 -1
  132. package/dist/components/six-select.js +8 -1
  133. package/dist/components/six-select.js.map +1 -1
  134. package/dist/components/six-sidebar-item-group.js +13 -2
  135. package/dist/components/six-sidebar-item-group.js.map +1 -1
  136. package/dist/components/six-sidebar-item.js +7 -4
  137. package/dist/components/six-sidebar-item.js.map +1 -1
  138. package/dist/components/six-sidebar.js +2 -0
  139. package/dist/components/six-sidebar.js.map +1 -1
  140. package/dist/components/six-switch.js +5 -1
  141. package/dist/components/six-switch.js.map +1 -1
  142. package/dist/components/six-tab-group.js +2 -0
  143. package/dist/components/six-tab-group.js.map +1 -1
  144. package/dist/components/six-textarea.js +7 -1
  145. package/dist/components/six-textarea.js.map +1 -1
  146. package/dist/components/six-timepicker2.js +3 -1
  147. package/dist/components/six-timepicker2.js.map +1 -1
  148. package/dist/components/six-tooltip2.js +2 -0
  149. package/dist/components/six-tooltip2.js.map +1 -1
  150. package/dist/components.json +51 -3
  151. package/dist/esm/{form-control-b0febe88.js → form-control-079f7fb6.js} +2 -2
  152. package/dist/esm/{form-control-b0febe88.js.map → form-control-079f7fb6.js.map} +1 -1
  153. package/dist/esm/{index-8a74f992.js → index-4ee8b33e.js} +281 -121
  154. package/dist/esm/index-4ee8b33e.js.map +1 -0
  155. package/dist/esm/index.js +15 -1
  156. package/dist/esm/index.js.map +1 -1
  157. package/dist/esm/loader.js +3 -3
  158. package/dist/esm/set-attributes_2.entry.js +1 -1
  159. package/dist/esm/six-alert.entry.js +1 -1
  160. package/dist/esm/six-avatar.entry.js +1 -1
  161. package/dist/esm/six-badge.entry.js +1 -1
  162. package/dist/esm/six-button.entry.js +1 -1
  163. package/dist/esm/six-card.entry.js +1 -1
  164. package/dist/esm/six-checkbox.entry.js +3 -3
  165. package/dist/esm/six-checkbox.entry.js.map +1 -1
  166. package/dist/esm/six-datepicker.entry.js +1 -1
  167. package/dist/esm/six-details.entry.js +1 -1
  168. package/dist/esm/six-dialog.entry.js +1 -1
  169. package/dist/esm/six-drawer.entry.js +2 -2
  170. package/dist/esm/six-drawer.entry.js.map +1 -1
  171. package/dist/esm/six-dropdown_2.entry.js +1 -1
  172. package/dist/esm/six-error-page.entry.js +1 -1
  173. package/dist/esm/six-error.entry.js +1 -1
  174. package/dist/esm/six-file-list-item.entry.js +1 -1
  175. package/dist/esm/six-file-list.entry.js +1 -1
  176. package/dist/esm/six-file-upload.entry.js +1 -1
  177. package/dist/esm/six-footer.entry.js +1 -1
  178. package/dist/esm/six-group-label.entry.js +3 -3
  179. package/dist/esm/six-group-label.entry.js.map +1 -1
  180. package/dist/esm/six-header.entry.js +1 -1
  181. package/dist/esm/six-icon-button.entry.js +1 -1
  182. package/dist/esm/six-icon.entry.js +1 -1
  183. package/dist/esm/six-input.entry.js +3 -3
  184. package/dist/esm/six-input.entry.js.map +1 -1
  185. package/dist/esm/six-item-picker.entry.js +1 -1
  186. package/dist/esm/six-language-switcher.entry.js +1 -1
  187. package/dist/esm/six-layout-grid.entry.js +1 -1
  188. package/dist/esm/six-main-container.entry.js +1 -1
  189. package/dist/esm/six-menu-divider.entry.js +1 -1
  190. package/dist/esm/six-menu-item.entry.js +1 -1
  191. package/dist/esm/six-menu-label.entry.js +1 -1
  192. package/dist/esm/six-picto.entry.js +1 -1
  193. package/dist/esm/six-progress-bar.entry.js +1 -1
  194. package/dist/esm/six-progress-ring.entry.js +1 -1
  195. package/dist/esm/six-radio.entry.js +1 -1
  196. package/dist/esm/six-range.entry.js +3 -3
  197. package/dist/esm/six-range.entry.js.map +1 -1
  198. package/dist/esm/six-root.entry.js +1 -1
  199. package/dist/esm/six-search-field.entry.js +1 -1
  200. package/dist/esm/six-select.entry.js +3 -3
  201. package/dist/esm/six-select.entry.js.map +1 -1
  202. package/dist/esm/six-sidebar-item-group.entry.js +13 -3
  203. package/dist/esm/six-sidebar-item-group.entry.js.map +1 -1
  204. package/dist/esm/six-sidebar-item.entry.js +6 -4
  205. package/dist/esm/six-sidebar-item.entry.js.map +1 -1
  206. package/dist/esm/six-sidebar.entry.js +1 -1
  207. package/dist/esm/six-spinner.entry.js +1 -1
  208. package/dist/esm/six-switch.entry.js +3 -3
  209. package/dist/esm/six-switch.entry.js.map +1 -1
  210. package/dist/esm/six-tab-group.entry.js +1 -1
  211. package/dist/esm/six-tab-panel.entry.js +1 -1
  212. package/dist/esm/six-tab.entry.js +1 -1
  213. package/dist/esm/six-tag.entry.js +1 -1
  214. package/dist/esm/six-textarea.entry.js +3 -3
  215. package/dist/esm/six-textarea.entry.js.map +1 -1
  216. package/dist/esm/six-tile.entry.js +1 -1
  217. package/dist/esm/six-timepicker.entry.js +1 -1
  218. package/dist/esm/six-tooltip.entry.js +1 -1
  219. package/dist/esm/ui-library.js +4 -4
  220. package/dist/esm/ui-library.js.map +1 -1
  221. package/dist/types/components/six-sidebar-item/six-sidebar-item.d.ts +5 -0
  222. package/dist/types/components/six-sidebar-item-group/six-sidebar-item-group.d.ts +6 -0
  223. package/dist/types/components.d.ts +396 -0
  224. package/dist/types/stencil-public-runtime.d.ts +26 -3
  225. package/dist/types/utils/error-messages.d.ts +2 -1
  226. package/dist/ui-library/index.esm.js +1 -1
  227. package/dist/ui-library/index.esm.js.map +1 -1
  228. package/dist/ui-library/{p-5800663b.entry.js → p-0416ec85.entry.js} +2 -2
  229. package/dist/ui-library/{p-ae601a0f.entry.js → p-0d8154b1.entry.js} +2 -2
  230. package/dist/ui-library/p-120a1b66.entry.js +2 -0
  231. package/dist/ui-library/{p-538f3c50.entry.js.map → p-120a1b66.entry.js.map} +1 -1
  232. package/dist/ui-library/{p-9c1be3fb.entry.js → p-16eb37cd.entry.js} +2 -2
  233. package/dist/ui-library/{p-878226a0.entry.js → p-1f7dac36.entry.js} +2 -2
  234. package/dist/ui-library/{p-a6a9ee96.entry.js → p-20cb60c9.entry.js} +2 -2
  235. package/dist/ui-library/{p-613283a7.entry.js → p-21606e14.entry.js} +2 -2
  236. package/dist/ui-library/{p-411ed539.entry.js → p-2280038f.entry.js} +2 -2
  237. package/dist/ui-library/{p-e775dcb4.entry.js → p-24e80289.entry.js} +2 -2
  238. package/dist/ui-library/{p-264d4ea8.entry.js → p-27987d45.entry.js} +2 -2
  239. package/dist/ui-library/{p-cd67da3d.entry.js → p-2945a132.entry.js} +2 -2
  240. package/dist/ui-library/{p-3cc5addb.entry.js → p-2e99f389.entry.js} +2 -2
  241. package/dist/ui-library/p-3d7678a8.entry.js +2 -0
  242. package/dist/ui-library/p-3d7678a8.entry.js.map +1 -0
  243. package/dist/ui-library/p-4196a75a.entry.js +2 -0
  244. package/dist/ui-library/{p-a457fee8.entry.js.map → p-4196a75a.entry.js.map} +1 -1
  245. package/dist/ui-library/{p-dc4f41d8.entry.js → p-48b7c199.entry.js} +2 -2
  246. package/dist/ui-library/{p-37557787.entry.js → p-51630491.entry.js} +2 -2
  247. package/dist/ui-library/{p-14c1ec31.entry.js → p-5218986b.entry.js} +2 -2
  248. package/dist/ui-library/{p-66fe54b3.entry.js → p-5904d3c3.entry.js} +2 -2
  249. package/dist/ui-library/p-66a48dc4.entry.js +2 -0
  250. package/dist/ui-library/{p-db936ad7.entry.js.map → p-66a48dc4.entry.js.map} +1 -1
  251. package/dist/ui-library/{p-91b51800.entry.js → p-66d1d93d.entry.js} +2 -2
  252. package/dist/ui-library/{p-25bb1752.entry.js → p-6aced322.entry.js} +2 -2
  253. package/dist/ui-library/{p-22c9b8c3.entry.js → p-6e87aeea.entry.js} +2 -2
  254. package/dist/ui-library/p-74179b03.entry.js +2 -0
  255. package/dist/ui-library/{p-ab91c2a9.entry.js.map → p-74179b03.entry.js.map} +1 -1
  256. package/dist/ui-library/{p-1d5ee1a0.entry.js → p-77424c6b.entry.js} +2 -2
  257. package/dist/ui-library/{p-13b43e04.entry.js → p-7d00de3a.entry.js} +2 -2
  258. package/dist/ui-library/{p-cdaed936.entry.js → p-7e9257f3.entry.js} +2 -2
  259. package/dist/ui-library/p-8226e363.entry.js +2 -0
  260. package/dist/ui-library/{p-b57afbe4.entry.js.map → p-8226e363.entry.js.map} +1 -1
  261. package/dist/ui-library/{p-a2035543.entry.js → p-8296e24c.entry.js} +2 -2
  262. package/dist/ui-library/{p-a2035543.entry.js.map → p-8296e24c.entry.js.map} +1 -1
  263. package/dist/ui-library/{p-7e3ad38a.entry.js → p-93a9b693.entry.js} +2 -2
  264. package/dist/ui-library/{p-5af44076.entry.js → p-94bd8347.entry.js} +2 -2
  265. package/dist/ui-library/{p-ee950ce2.entry.js → p-9bec3e14.entry.js} +2 -2
  266. package/dist/ui-library/{p-9b354f5d.entry.js → p-a15928c4.entry.js} +2 -2
  267. package/dist/ui-library/{p-cba69e9d.entry.js → p-a4348ad4.entry.js} +2 -2
  268. package/dist/ui-library/{p-7afafb9d.entry.js → p-acd3ecfd.entry.js} +2 -2
  269. package/dist/ui-library/{p-f1dc3a88.entry.js → p-ae383f66.entry.js} +2 -2
  270. package/dist/ui-library/{p-658d9f79.entry.js → p-af0e163e.entry.js} +2 -2
  271. package/dist/ui-library/{p-3f1a5ecb.entry.js → p-b3a14438.entry.js} +2 -2
  272. package/dist/ui-library/{p-dfed33c5.entry.js → p-b42fd9c3.entry.js} +2 -2
  273. package/dist/ui-library/p-b5fdfa6a.js +3 -0
  274. package/dist/ui-library/p-b5fdfa6a.js.map +1 -0
  275. package/dist/ui-library/p-b7597736.entry.js +2 -0
  276. package/dist/ui-library/{p-4435ff73.entry.js.map → p-b7597736.entry.js.map} +1 -1
  277. package/dist/ui-library/{p-c03ebf7d.entry.js → p-b906a605.entry.js} +2 -2
  278. package/dist/ui-library/{p-ac099e6b.entry.js → p-b97764a1.entry.js} +2 -2
  279. package/dist/ui-library/p-bbefcec9.entry.js +2 -0
  280. package/dist/ui-library/{p-db34a6cc.entry.js.map → p-bbefcec9.entry.js.map} +1 -1
  281. package/dist/ui-library/{p-b351f889.entry.js → p-c75694df.entry.js} +2 -2
  282. package/dist/ui-library/{p-b6f47c9d.entry.js → p-cb32f8d2.entry.js} +2 -2
  283. package/dist/ui-library/{p-a0f290d0.entry.js → p-cd3281fb.entry.js} +2 -2
  284. package/dist/ui-library/{p-d1bda563.entry.js → p-cec8c149.entry.js} +2 -2
  285. package/dist/ui-library/{p-724875b0.entry.js → p-d1ba2ad5.entry.js} +2 -2
  286. package/dist/ui-library/{p-346f9557.entry.js → p-d2196113.entry.js} +2 -2
  287. package/dist/ui-library/p-de7a9448.entry.js +2 -0
  288. package/dist/ui-library/p-de7a9448.entry.js.map +1 -0
  289. package/dist/ui-library/{p-a55c7258.entry.js → p-df1c4a1f.entry.js} +2 -2
  290. package/dist/ui-library/{p-95fbdd0b.entry.js → p-e740215a.entry.js} +2 -2
  291. package/dist/ui-library/{p-e5020f0d.js → p-f3fdc121.js} +2 -2
  292. package/dist/ui-library/ui-library.css +1 -1
  293. package/dist/ui-library/ui-library.esm.js +1 -1
  294. package/dist/ui-library/ui-library.esm.js.map +1 -1
  295. package/package.json +12 -9
  296. package/dist/cjs/index-900437fc.js.map +0 -1
  297. package/dist/esm/index-8a74f992.js.map +0 -1
  298. package/dist/ui-library/p-4435ff73.entry.js +0 -2
  299. package/dist/ui-library/p-538f3c50.entry.js +0 -2
  300. package/dist/ui-library/p-5ba3a0fe.entry.js +0 -2
  301. package/dist/ui-library/p-5ba3a0fe.entry.js.map +0 -1
  302. package/dist/ui-library/p-6153045b.js +0 -3
  303. package/dist/ui-library/p-6153045b.js.map +0 -1
  304. package/dist/ui-library/p-6197fe2f.entry.js +0 -2
  305. package/dist/ui-library/p-6197fe2f.entry.js.map +0 -1
  306. package/dist/ui-library/p-a457fee8.entry.js +0 -2
  307. package/dist/ui-library/p-ab91c2a9.entry.js +0 -2
  308. package/dist/ui-library/p-b57afbe4.entry.js +0 -2
  309. package/dist/ui-library/p-db34a6cc.entry.js +0 -2
  310. package/dist/ui-library/p-db936ad7.entry.js +0 -2
  311. /package/dist/ui-library/{p-5800663b.entry.js.map → p-0416ec85.entry.js.map} +0 -0
  312. /package/dist/ui-library/{p-ae601a0f.entry.js.map → p-0d8154b1.entry.js.map} +0 -0
  313. /package/dist/ui-library/{p-9c1be3fb.entry.js.map → p-16eb37cd.entry.js.map} +0 -0
  314. /package/dist/ui-library/{p-878226a0.entry.js.map → p-1f7dac36.entry.js.map} +0 -0
  315. /package/dist/ui-library/{p-a6a9ee96.entry.js.map → p-20cb60c9.entry.js.map} +0 -0
  316. /package/dist/ui-library/{p-613283a7.entry.js.map → p-21606e14.entry.js.map} +0 -0
  317. /package/dist/ui-library/{p-411ed539.entry.js.map → p-2280038f.entry.js.map} +0 -0
  318. /package/dist/ui-library/{p-e775dcb4.entry.js.map → p-24e80289.entry.js.map} +0 -0
  319. /package/dist/ui-library/{p-264d4ea8.entry.js.map → p-27987d45.entry.js.map} +0 -0
  320. /package/dist/ui-library/{p-cd67da3d.entry.js.map → p-2945a132.entry.js.map} +0 -0
  321. /package/dist/ui-library/{p-3cc5addb.entry.js.map → p-2e99f389.entry.js.map} +0 -0
  322. /package/dist/ui-library/{p-dc4f41d8.entry.js.map → p-48b7c199.entry.js.map} +0 -0
  323. /package/dist/ui-library/{p-37557787.entry.js.map → p-51630491.entry.js.map} +0 -0
  324. /package/dist/ui-library/{p-14c1ec31.entry.js.map → p-5218986b.entry.js.map} +0 -0
  325. /package/dist/ui-library/{p-66fe54b3.entry.js.map → p-5904d3c3.entry.js.map} +0 -0
  326. /package/dist/ui-library/{p-91b51800.entry.js.map → p-66d1d93d.entry.js.map} +0 -0
  327. /package/dist/ui-library/{p-25bb1752.entry.js.map → p-6aced322.entry.js.map} +0 -0
  328. /package/dist/ui-library/{p-22c9b8c3.entry.js.map → p-6e87aeea.entry.js.map} +0 -0
  329. /package/dist/ui-library/{p-1d5ee1a0.entry.js.map → p-77424c6b.entry.js.map} +0 -0
  330. /package/dist/ui-library/{p-13b43e04.entry.js.map → p-7d00de3a.entry.js.map} +0 -0
  331. /package/dist/ui-library/{p-cdaed936.entry.js.map → p-7e9257f3.entry.js.map} +0 -0
  332. /package/dist/ui-library/{p-7e3ad38a.entry.js.map → p-93a9b693.entry.js.map} +0 -0
  333. /package/dist/ui-library/{p-5af44076.entry.js.map → p-94bd8347.entry.js.map} +0 -0
  334. /package/dist/ui-library/{p-ee950ce2.entry.js.map → p-9bec3e14.entry.js.map} +0 -0
  335. /package/dist/ui-library/{p-9b354f5d.entry.js.map → p-a15928c4.entry.js.map} +0 -0
  336. /package/dist/ui-library/{p-cba69e9d.entry.js.map → p-a4348ad4.entry.js.map} +0 -0
  337. /package/dist/ui-library/{p-7afafb9d.entry.js.map → p-acd3ecfd.entry.js.map} +0 -0
  338. /package/dist/ui-library/{p-f1dc3a88.entry.js.map → p-ae383f66.entry.js.map} +0 -0
  339. /package/dist/ui-library/{p-658d9f79.entry.js.map → p-af0e163e.entry.js.map} +0 -0
  340. /package/dist/ui-library/{p-3f1a5ecb.entry.js.map → p-b3a14438.entry.js.map} +0 -0
  341. /package/dist/ui-library/{p-dfed33c5.entry.js.map → p-b42fd9c3.entry.js.map} +0 -0
  342. /package/dist/ui-library/{p-c03ebf7d.entry.js.map → p-b906a605.entry.js.map} +0 -0
  343. /package/dist/ui-library/{p-ac099e6b.entry.js.map → p-b97764a1.entry.js.map} +0 -0
  344. /package/dist/ui-library/{p-b351f889.entry.js.map → p-c75694df.entry.js.map} +0 -0
  345. /package/dist/ui-library/{p-b6f47c9d.entry.js.map → p-cb32f8d2.entry.js.map} +0 -0
  346. /package/dist/ui-library/{p-a0f290d0.entry.js.map → p-cd3281fb.entry.js.map} +0 -0
  347. /package/dist/ui-library/{p-d1bda563.entry.js.map → p-cec8c149.entry.js.map} +0 -0
  348. /package/dist/ui-library/{p-724875b0.entry.js.map → p-d1ba2ad5.entry.js.map} +0 -0
  349. /package/dist/ui-library/{p-346f9557.entry.js.map → p-d2196113.entry.js.map} +0 -0
  350. /package/dist/ui-library/{p-a55c7258.entry.js.map → p-df1c4a1f.entry.js.map} +0 -0
  351. /package/dist/ui-library/{p-95fbdd0b.entry.js.map → p-e740215a.entry.js.map} +0 -0
  352. /package/dist/ui-library/{p-e5020f0d.js.map → p-f3fdc121.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"six-drawer.js","sourceRoot":"","sources":["../../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C/B,KAAK,EAAC,eAAe,EACrB,IAAI,EAAC,GAAG,EACR,OAAO,EAAE,IAAI,CAAC,gBAAgB,GAC9B,CACK,CACV;QAED,WAAK,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,cAAc;UACnC,eAAQ,CACJ;QAEN,cAAQ,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAC,gBAAgB;UAC1C,YAAM,IAAI,EAAC,QAAQ,EAAC,YAAY,EAAE,IAAI,CAAC,gBAAgB,GAAI,CACpD,CACL,CACF,CACP,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Method, Prop, State, Watch } from '@stencil/core';\nimport { lockBodyScrolling, unlockBodyScrolling } from '../../utils/scroll';\nimport { hasSlot } from '../../utils/slot';\nimport { isPreventScrollSupported } from '../../utils/support';\nimport Modal from '../../utils/modal';\nimport { EmptyPayload } from '../../utils/types';\n\nconst hasPreventScroll = isPreventScrollSupported();\nlet id = 0;\n\n/**\n * @since 1.0\n * @status stable\n *\n * Forked from https://github.com/shoelace-style/shoelace version v2.0.0-beta27.\n *\n * @slot - The drawer's content.\n * @slot label - The drawer's label. Alternatively, you can use the label prop.\n * @slot footer - The drawer's footer, usually one or more buttons representing various options.\n *\n * @part base - The component's base wrapper.\n * @part overlay - The overlay.\n * @part panel - The drawer panel (where the drawer and its content is rendered).\n * @part header - The drawer header.\n * @part title - The drawer title.\n * @part close-button - The close button.\n * @part body - The drawer body.\n * @part footer - The drawer footer.\n */\n\n@Component({\n tag: 'six-drawer',\n styleUrl: 'six-drawer.scss',\n shadow: true,\n})\nexport class SixDrawer {\n private componentId = `drawer-${++id}`;\n private drawer?: HTMLElement;\n private modal?: Modal;\n private panel?: HTMLElement;\n private willShow = false;\n private willHide = false;\n\n @Element() host!: HTMLSixDrawerElement;\n\n @State() hasFooter = false;\n @State() isVisible = false;\n\n /** Indicates whether the drawer is open. You can use this in lieu of the show/hide methods. */\n @Prop({ mutable: true, reflect: true }) open = false;\n\n /**\n * The drawer's label as displayed in the header. You should always include a relevant label even when using\n * `no-header`, as it is required for proper accessibility.\n */\n @Prop() label = '';\n\n /** The direction from which the drawer will open. */\n @Prop() placement: 'top' | 'right' | 'bottom' | 'left' = 'right';\n\n /**\n * By default, the drawer slides out of its containing block (usually the viewport). To make the drawer slide out of\n * its parent element, set this prop and add `position: relative` to the parent.\n */\n @Prop() contained = false;\n\n /**\n * Removes the header. This will also remove the default close button, so please ensure you provide an easy,\n * accessible way for users to dismiss the drawer.\n */\n @Prop() noHeader = false;\n\n @Watch('open')\n handleOpenChange() {\n this.open ? this.show() : this.hide();\n }\n\n /** Emitted when the drawer opens. Calling `event.preventDefault()` will prevent it from being opened. */\n @Event({ eventName: 'six-drawer-show' }) sixShow!: EventEmitter<EmptyPayload>;\n\n /** Emitted after the drawer opens and all transitions are complete. */\n @Event({ eventName: 'six-drawer-after-show' }) sixAfterShow!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the drawer closes. Calling `event.preventDefault()` will prevent it from being closed. */\n @Event({ eventName: 'six-drawer-hide' }) sixHide!: EventEmitter<EmptyPayload>;\n\n /** Emitted after the drawer closes and all transitions are complete. */\n @Event({ eventName: 'six-drawer-after-hide' }) sixAfterHide!: EventEmitter<EmptyPayload>;\n\n /**\n * Emitted when the drawer opens and the panel gains focus. Calling `event.preventDefault()` will prevent focus and\n * allow you to set it on a different element in the drawer, such as an input or button.\n */\n @Event({ eventName: 'six-drawer-initial-focus' }) sixInitialFocus!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the overlay is clicked. Calling `event.preventDefault()` will prevent the drawer from closing. */\n @Event({ eventName: 'six-drawer-overlay-dismiss' }) sixOverlayDismiss!: EventEmitter<EmptyPayload>;\n\n connectedCallback() {\n this.modal = new Modal(this.host, {\n onFocusOut: () => (this.contained ? null : this.panel?.focus()),\n });\n }\n\n componentWillLoad() {\n this.handleSlotChange();\n\n // Show on init if open\n if (this.open) {\n this.show();\n // if the sidebar is open by default we need to manually reset the\n // transition variables since there will be no transition event\n this.resetTransitionVariables();\n }\n }\n\n disconnectedCallback() {\n unlockBodyScrolling(this.host);\n }\n\n /** Shows the drawer */\n @Method()\n async show() {\n if (this.willShow || this.modal == null || this.panel == null || this.drawer == null) {\n return;\n }\n const panel = this.panel;\n\n const sixShow = this.sixShow.emit();\n if (sixShow.defaultPrevented) {\n this.open = false;\n return;\n }\n\n this.willShow = true;\n this.isVisible = true;\n this.open = true;\n\n // Lock body scrolling only if the drawer isn't contained\n if (!this.contained) {\n this.modal.activate();\n lockBodyScrolling(this.host);\n }\n\n if (this.open) {\n if (hasPreventScroll) {\n // Wait for the next frame before setting initial focus so the dialog is technically visible\n requestAnimationFrame(() => {\n const sixInitialFocus = this.sixInitialFocus.emit();\n if (!sixInitialFocus.defaultPrevented) {\n panel.focus({ preventScroll: true });\n }\n });\n } else {\n // Once Safari supports { preventScroll: true } we can remove this nasty little hack, but until then we need to\n // wait for the transition to complete before setting focus, otherwise the panel may render in a buggy way its\n // out of view initially.\n //\n // Fiddle: https://jsfiddle.net/g6buoafq/1/\n // Safari: https://bugs.webkit.org/show_bug.cgi?id=178583\n //\n this.drawer.addEventListener(\n 'transitionend',\n () => {\n const sixInitialFocus = this.sixInitialFocus.emit();\n if (!sixInitialFocus.defaultPrevented) {\n panel.focus();\n }\n },\n { once: true }\n );\n }\n }\n }\n\n /** Hides the drawer */\n @Method()\n async hide() {\n if (this.willHide || this.modal == null) {\n return;\n }\n\n const sixHide = this.sixHide.emit();\n if (sixHide.defaultPrevented) {\n this.open = true;\n return;\n }\n\n this.willHide = true;\n this.open = false;\n this.modal.deactivate();\n\n unlockBodyScrolling(this.host);\n }\n\n private handleCloseClick = () => {\n this.hide();\n };\n\n private handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n this.hide();\n }\n };\n\n private handleOverlayClick = () => {\n const sixOverlayDismiss = this.sixOverlayDismiss.emit();\n\n if (!sixOverlayDismiss.defaultPrevented) {\n this.hide();\n }\n };\n\n private handleSlotChange = () => {\n this.hasFooter = hasSlot(this.host, 'footer');\n };\n\n private handleTransitionEnd = (event: TransitionEvent) => {\n const target = event.target as HTMLElement;\n\n // Ensure we only emit one event when the target element is no longer visible\n if (event.propertyName === 'transform' && target.classList.contains('drawer__panel')) {\n this.resetTransitionVariables();\n }\n };\n\n private resetTransitionVariables() {\n this.isVisible = this.open;\n this.willShow = false;\n this.willHide = false;\n this.open ? this.sixAfterShow.emit() : this.sixAfterHide.emit();\n }\n\n render() {\n return (\n <div\n ref={(el) => (this.drawer = el)}\n part=\"base\"\n class={{\n drawer: true,\n 'drawer--open': this.open,\n 'drawer--visible': this.isVisible,\n 'drawer--top': this.placement === 'top',\n 'drawer--right': this.placement === 'right',\n 'drawer--bottom': this.placement === 'bottom',\n 'drawer--left': this.placement === 'left',\n 'drawer--contained': this.contained,\n 'drawer--fixed': !this.contained,\n 'drawer--has-footer': this.hasFooter,\n }}\n onKeyDown={this.handleKeyDown}\n onTransitionEnd={this.handleTransitionEnd}\n >\n <div part=\"overlay\" class=\"drawer__overlay\" onClick={this.handleOverlayClick} tabIndex={-1} />\n\n <div\n ref={(el) => (this.panel = el)}\n part=\"panel\"\n class=\"drawer__panel\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-hidden={this.open ? 'false' : 'true'}\n aria-label={this.noHeader ? this.label : null}\n aria-labelledby={!this.noHeader ? `${this.componentId}-title` : null}\n tabIndex={0}\n >\n {!this.noHeader && (\n <header part=\"header\" class=\"drawer__header\">\n <span part=\"title\" class=\"drawer__title\" id={`${this.componentId}-title`}>\n <slot name=\"label\">\n {/* If there's no label, use an invisible character to prevent the heading from collapsing */}\n {this.label || String.fromCharCode(65279)}\n </slot>\n </span>\n <six-icon-button\n exportparts=\"base:close-button\"\n class=\"drawer__close\"\n name=\"x\"\n onClick={this.handleCloseClick}\n />\n </header>\n )}\n\n <div part=\"body\" class=\"drawer__body\">\n <slot />\n </div>\n\n <footer part=\"footer\" class=\"drawer__footer\">\n <slot name=\"footer\" onSlotchange={this.handleSlotChange} />\n </footer>\n </div>\n </div>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"six-drawer.js","sourceRoot":"","sources":["../../../src/components/six-drawer/six-drawer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACvG,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,KAAK,MAAM,mBAAmB,CAAC;AAGtC,MAAM,gBAAgB,GAAG,wBAAwB,EAAE,CAAC;AACpD,IAAI,EAAE,GAAG,CAAC,CAAC;AAEX;;;;;;;;;;;;;;;;;;GAkBG;AAOH,MAAM,OAAO,SAAS;;IACZ,gBAAW,GAAG,UAAU,EAAE,EAAE,EAAE,CAAC;IAI/B,aAAQ,GAAG,KAAK,CAAC;IACjB,aAAQ,GAAG,KAAK,CAAC;IA0JjB,qBAAgB,GAAG,GAAG,EAAE;MAC9B,IAAI,CAAC,IAAI,EAAE,CAAC;IACd,CAAC,CAAC;IAEM,kBAAa,GAAG,CAAC,KAAoB,EAAE,EAAE;MAC/C,IAAI,KAAK,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C,CAAC,CAAC,GAAG,IAAI,CAAC,WAAW,QAAQ,CAAC,CAAC,CAAC,IAAI,EACpE,QAAQ,EAAE,CAAC;QAEV,CAAC,IAAI,CAAC,QAAQ,IAAI,CACjB,cAAQ,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAC,gBAAgB;UAC1C,YAAM,IAAI,EAAC,OAAO,EAAC,KAAK,EAAC,eAAe,EAAC,EAAE,EAAE,GAAG,IAAI,CAAC,WAAW,QAAQ;YACtE,YAAM,IAAI,EAAC,OAAO,IAEf,IAAI,CAAC,KAAK,IAAI,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,CACpC,CACF;UACP,uBACE,WAAW,EAAC,mBAAmB,EAC/B,KAAK,EAAC,eAAe,EACrB,IAAI,EAAC,OAAO,EACZ,OAAO,EAAE,IAAI,CAAC,gBAAgB,GAC9B,CACK,CACV;QAED,WAAK,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,cAAc;UACnC,eAAQ,CACJ;QAEN,cAAQ,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAC,gBAAgB;UAC1C,YAAM,IAAI,EAAC,QAAQ,EAAC,YAAY,EAAE,IAAI,CAAC,gBAAgB,GAAI,CACpD,CACL,CACF,CACP,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Method, Prop, State, Watch } from '@stencil/core';\nimport { lockBodyScrolling, unlockBodyScrolling } from '../../utils/scroll';\nimport { hasSlot } from '../../utils/slot';\nimport { isPreventScrollSupported } from '../../utils/support';\nimport Modal from '../../utils/modal';\nimport { EmptyPayload } from '../../utils/types';\n\nconst hasPreventScroll = isPreventScrollSupported();\nlet id = 0;\n\n/**\n * @since 1.0\n * @status stable\n *\n * Forked from https://github.com/shoelace-style/shoelace version v2.0.0-beta27.\n *\n * @slot - The drawer's content.\n * @slot label - The drawer's label. Alternatively, you can use the label prop.\n * @slot footer - The drawer's footer, usually one or more buttons representing various options.\n *\n * @part base - The component's base wrapper.\n * @part overlay - The overlay.\n * @part panel - The drawer panel (where the drawer and its content is rendered).\n * @part header - The drawer header.\n * @part title - The drawer title.\n * @part close-button - The close button.\n * @part body - The drawer body.\n * @part footer - The drawer footer.\n */\n\n@Component({\n tag: 'six-drawer',\n styleUrl: 'six-drawer.scss',\n shadow: true,\n})\nexport class SixDrawer {\n private componentId = `drawer-${++id}`;\n private drawer?: HTMLElement;\n private modal?: Modal;\n private panel?: HTMLElement;\n private willShow = false;\n private willHide = false;\n\n @Element() host!: HTMLSixDrawerElement;\n\n @State() hasFooter = false;\n @State() isVisible = false;\n\n /** Indicates whether the drawer is open. You can use this in lieu of the show/hide methods. */\n @Prop({ mutable: true, reflect: true }) open = false;\n\n /**\n * The drawer's label as displayed in the header. You should always include a relevant label even when using\n * `no-header`, as it is required for proper accessibility.\n */\n @Prop() label = '';\n\n /** The direction from which the drawer will open. */\n @Prop() placement: 'top' | 'right' | 'bottom' | 'left' = 'right';\n\n /**\n * By default, the drawer slides out of its containing block (usually the viewport). To make the drawer slide out of\n * its parent element, set this prop and add `position: relative` to the parent.\n */\n @Prop() contained = false;\n\n /**\n * Removes the header. This will also remove the default close button, so please ensure you provide an easy,\n * accessible way for users to dismiss the drawer.\n */\n @Prop() noHeader = false;\n\n @Watch('open')\n handleOpenChange() {\n this.open ? this.show() : this.hide();\n }\n\n /** Emitted when the drawer opens. Calling `event.preventDefault()` will prevent it from being opened. */\n @Event({ eventName: 'six-drawer-show' }) sixShow!: EventEmitter<EmptyPayload>;\n\n /** Emitted after the drawer opens and all transitions are complete. */\n @Event({ eventName: 'six-drawer-after-show' }) sixAfterShow!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the drawer closes. Calling `event.preventDefault()` will prevent it from being closed. */\n @Event({ eventName: 'six-drawer-hide' }) sixHide!: EventEmitter<EmptyPayload>;\n\n /** Emitted after the drawer closes and all transitions are complete. */\n @Event({ eventName: 'six-drawer-after-hide' }) sixAfterHide!: EventEmitter<EmptyPayload>;\n\n /**\n * Emitted when the drawer opens and the panel gains focus. Calling `event.preventDefault()` will prevent focus and\n * allow you to set it on a different element in the drawer, such as an input or button.\n */\n @Event({ eventName: 'six-drawer-initial-focus' }) sixInitialFocus!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the overlay is clicked. Calling `event.preventDefault()` will prevent the drawer from closing. */\n @Event({ eventName: 'six-drawer-overlay-dismiss' }) sixOverlayDismiss!: EventEmitter<EmptyPayload>;\n\n connectedCallback() {\n this.modal = new Modal(this.host, {\n onFocusOut: () => (this.contained ? null : this.panel?.focus()),\n });\n }\n\n componentWillLoad() {\n this.handleSlotChange();\n\n // Show on init if open\n if (this.open) {\n this.show();\n // if the sidebar is open by default we need to manually reset the\n // transition variables since there will be no transition event\n this.resetTransitionVariables();\n }\n }\n\n disconnectedCallback() {\n unlockBodyScrolling(this.host);\n }\n\n /** Shows the drawer */\n @Method()\n async show() {\n if (this.willShow || this.modal == null || this.panel == null || this.drawer == null) {\n return;\n }\n const panel = this.panel;\n\n const sixShow = this.sixShow.emit();\n if (sixShow.defaultPrevented) {\n this.open = false;\n return;\n }\n\n this.willShow = true;\n this.isVisible = true;\n this.open = true;\n\n // Lock body scrolling only if the drawer isn't contained\n if (!this.contained) {\n this.modal.activate();\n lockBodyScrolling(this.host);\n }\n\n if (this.open) {\n if (hasPreventScroll) {\n // Wait for the next frame before setting initial focus so the dialog is technically visible\n requestAnimationFrame(() => {\n const sixInitialFocus = this.sixInitialFocus.emit();\n if (!sixInitialFocus.defaultPrevented) {\n panel.focus({ preventScroll: true });\n }\n });\n } else {\n // Once Safari supports { preventScroll: true } we can remove this nasty little hack, but until then we need to\n // wait for the transition to complete before setting focus, otherwise the panel may render in a buggy way its\n // out of view initially.\n //\n // Fiddle: https://jsfiddle.net/g6buoafq/1/\n // Safari: https://bugs.webkit.org/show_bug.cgi?id=178583\n //\n this.drawer.addEventListener(\n 'transitionend',\n () => {\n const sixInitialFocus = this.sixInitialFocus.emit();\n if (!sixInitialFocus.defaultPrevented) {\n panel.focus();\n }\n },\n { once: true }\n );\n }\n }\n }\n\n /** Hides the drawer */\n @Method()\n async hide() {\n if (this.willHide || this.modal == null) {\n return;\n }\n\n const sixHide = this.sixHide.emit();\n if (sixHide.defaultPrevented) {\n this.open = true;\n return;\n }\n\n this.willHide = true;\n this.open = false;\n this.modal.deactivate();\n\n unlockBodyScrolling(this.host);\n }\n\n private handleCloseClick = () => {\n this.hide();\n };\n\n private handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n this.hide();\n }\n };\n\n private handleOverlayClick = () => {\n const sixOverlayDismiss = this.sixOverlayDismiss.emit();\n\n if (!sixOverlayDismiss.defaultPrevented) {\n this.hide();\n }\n };\n\n private handleSlotChange = () => {\n this.hasFooter = hasSlot(this.host, 'footer');\n };\n\n private handleTransitionEnd = (event: TransitionEvent) => {\n const target = event.target as HTMLElement;\n\n // Ensure we only emit one event when the target element is no longer visible\n if (event.propertyName === 'transform' && target.classList.contains('drawer__panel')) {\n this.resetTransitionVariables();\n }\n };\n\n private resetTransitionVariables() {\n this.isVisible = this.open;\n this.willShow = false;\n this.willHide = false;\n this.open ? this.sixAfterShow.emit() : this.sixAfterHide.emit();\n }\n\n render() {\n return (\n <div\n ref={(el) => (this.drawer = el)}\n part=\"base\"\n class={{\n drawer: true,\n 'drawer--open': this.open,\n 'drawer--visible': this.isVisible,\n 'drawer--top': this.placement === 'top',\n 'drawer--right': this.placement === 'right',\n 'drawer--bottom': this.placement === 'bottom',\n 'drawer--left': this.placement === 'left',\n 'drawer--contained': this.contained,\n 'drawer--fixed': !this.contained,\n 'drawer--has-footer': this.hasFooter,\n }}\n onKeyDown={this.handleKeyDown}\n onTransitionEnd={this.handleTransitionEnd}\n >\n <div part=\"overlay\" class=\"drawer__overlay\" onClick={this.handleOverlayClick} tabIndex={-1} />\n\n <div\n ref={(el) => (this.panel = el)}\n part=\"panel\"\n class=\"drawer__panel\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-hidden={this.open ? 'false' : 'true'}\n aria-label={this.noHeader ? this.label : null}\n aria-labelledby={!this.noHeader ? `${this.componentId}-title` : null}\n tabIndex={0}\n >\n {!this.noHeader && (\n <header part=\"header\" class=\"drawer__header\">\n <span part=\"title\" class=\"drawer__title\" id={`${this.componentId}-title`}>\n <slot name=\"label\">\n {/* If there's no label, use an invisible character to prevent the heading from collapsing */}\n {this.label || String.fromCharCode(65279)}\n </slot>\n </span>\n <six-icon-button\n exportparts=\"base:close-button\"\n class=\"drawer__close\"\n name=\"close\"\n onClick={this.handleCloseClick}\n />\n </header>\n )}\n\n <div part=\"body\" class=\"drawer__body\">\n <slot />\n </div>\n\n <footer part=\"footer\" class=\"drawer__footer\">\n <slot name=\"footer\" onSlotchange={this.handleSlotChange} />\n </footer>\n </div>\n </div>\n );\n }\n}\n"]}
@@ -16,7 +16,7 @@ describe('six-drawer', () => {
16
16
  <span class="drawer__title" id="drawer-1-title" part="title">
17
17
  <slot name="label"></slot>
18
18
  </span>
19
- <six-icon-button class="drawer__close" exportparts="base:close-button" name="x"></six-icon-button>
19
+ <six-icon-button class="drawer__close" exportparts="base:close-button" name="close"></six-icon-button>
20
20
  </header>
21
21
  <div class="drawer__body" part="body">
22
22
  <slot></slot>
@@ -1 +1 @@
1
- {"version":3,"file":"six-drawer.spec.js","sourceRoot":"","sources":["../../../../src/components/six-drawer/test/six-drawer.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;EAC1B,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;IACvB,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;MAC7B,UAAU,EAAE,CAAC,SAAS,CAAC;MACvB,IAAI,EAAE,2BAA2B;KAClC,CAAC,CAAC;IACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;;;KAsB7B,CAAC,CAAC;EACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newSpecPage } from '@stencil/core/testing';\nimport { SixDrawer } from '../six-drawer';\n\ndescribe('six-drawer', () => {\n it('renders', async () => {\n const page = await newSpecPage({\n components: [SixDrawer],\n html: `<six-drawer></six-drawer>`,\n });\n expect(page.root).toEqualHtml(`\n <six-drawer>\n <mock:shadow-root>\n <div class=\"drawer drawer--fixed drawer--right\" part=\"base\">\n <div class=\"drawer__overlay\" part=\"overlay\" tabindex=\"-1\"></div>\n <div aria-hidden=\"true\" aria-labelledby=\"drawer-1-title\" aria-modal=\"true\" class=\"drawer__panel\" part=\"panel\" role=\"dialog\" tabindex=\"0\">\n <header class=\"drawer__header\" part=\"header\">\n <span class=\"drawer__title\" id=\"drawer-1-title\" part=\"title\">\n <slot name=\"label\"></slot>\n </span>\n <six-icon-button class=\"drawer__close\" exportparts=\"base:close-button\" name=\"x\"></six-icon-button>\n </header>\n <div class=\"drawer__body\" part=\"body\">\n <slot></slot>\n </div>\n <footer class=\"drawer__footer\" part=\"footer\">\n <slot name=\"footer\"></slot>\n </footer>\n </div>\n </div>\n </mock:shadow-root>\n </six-drawer>\n `);\n });\n});\n"]}
1
+ {"version":3,"file":"six-drawer.spec.js","sourceRoot":"","sources":["../../../../src/components/six-drawer/test/six-drawer.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;EAC1B,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;IACvB,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;MAC7B,UAAU,EAAE,CAAC,SAAS,CAAC;MACvB,IAAI,EAAE,2BAA2B;KAClC,CAAC,CAAC;IACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;;;KAsB7B,CAAC,CAAC;EACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newSpecPage } from '@stencil/core/testing';\nimport { SixDrawer } from '../six-drawer';\n\ndescribe('six-drawer', () => {\n it('renders', async () => {\n const page = await newSpecPage({\n components: [SixDrawer],\n html: `<six-drawer></six-drawer>`,\n });\n expect(page.root).toEqualHtml(`\n <six-drawer>\n <mock:shadow-root>\n <div class=\"drawer drawer--fixed drawer--right\" part=\"base\">\n <div class=\"drawer__overlay\" part=\"overlay\" tabindex=\"-1\"></div>\n <div aria-hidden=\"true\" aria-labelledby=\"drawer-1-title\" aria-modal=\"true\" class=\"drawer__panel\" part=\"panel\" role=\"dialog\" tabindex=\"0\">\n <header class=\"drawer__header\" part=\"header\">\n <span class=\"drawer__title\" id=\"drawer-1-title\" part=\"title\">\n <slot name=\"label\"></slot>\n </span>\n <six-icon-button class=\"drawer__close\" exportparts=\"base:close-button\" name=\"close\"></six-icon-button>\n </header>\n <div class=\"drawer__body\" part=\"body\">\n <slot></slot>\n </div>\n <footer class=\"drawer__footer\" part=\"footer\">\n <slot name=\"footer\"></slot>\n </footer>\n </div>\n </div>\n </mock:shadow-root>\n </six-drawer>\n `);\n });\n});\n"]}
@@ -26,6 +26,9 @@
26
26
  .form-control--has-label .form-control__label__required::after {
27
27
  color: var(--six-color-danger-800);
28
28
  content: "*";
29
+ transform: scale(1.1);
30
+ margin-left: var(--six-spacing-xxx-small);
31
+ position: absolute;
29
32
  }
30
33
  .form-control--has-label.form-control--small .form-control__label {
31
34
  font-size: var(--six-input-label-font-size-small);
@@ -26,6 +26,9 @@
26
26
  .form-control--has-label .form-control__label__required::after {
27
27
  color: var(--six-color-danger-800);
28
28
  content: "*";
29
+ transform: scale(1.1);
30
+ margin-left: var(--six-spacing-xxx-small);
31
+ position: absolute;
29
32
  }
30
33
  .form-control--has-label.form-control--small .form-control__label {
31
34
  font-size: var(--six-input-label-font-size-small);
@@ -26,6 +26,9 @@
26
26
  .form-control--has-label .form-control__label__required::after {
27
27
  color: var(--six-color-danger-800);
28
28
  content: "*";
29
+ transform: scale(1.1);
30
+ margin-left: var(--six-spacing-xxx-small);
31
+ position: absolute;
29
32
  }
30
33
  .form-control--has-label.form-control--small .form-control__label {
31
34
  font-size: var(--six-input-label-font-size-small);
@@ -26,6 +26,9 @@
26
26
  .form-control--has-label .form-control__label__required::after {
27
27
  color: var(--six-color-danger-800);
28
28
  content: "*";
29
+ transform: scale(1.1);
30
+ margin-left: var(--six-spacing-xxx-small);
31
+ position: absolute;
29
32
  }
30
33
  .form-control--has-label.form-control--small .form-control__label {
31
34
  font-size: var(--six-input-label-font-size-small);
@@ -2,11 +2,16 @@
2
2
  display: block;
3
3
  }
4
4
 
5
+ a {
6
+ text-decoration: none;
7
+ display: block;
8
+ }
9
+
5
10
  .sidebar-item {
11
+ padding: 8px 8px 16px 16px;
6
12
  font-size: 0.9rem;
7
13
  color: var(--six-sidebar-color);
8
14
  cursor: pointer;
9
- padding: 8px 8px 16px 16px;
10
15
  font-family: var(--six-font-family);
11
16
  }
12
17
  .sidebar-item:hover:not(.sidebar-item--disabled) {
@@ -10,13 +10,15 @@ export class SixSidebarItem {
10
10
  this.value = '';
11
11
  this.selected = false;
12
12
  this.disabled = false;
13
+ this.href = undefined;
13
14
  }
14
15
  render() {
15
- return (h("div", { class: {
16
+ const Tag = this.href != null ? 'a' : 'div';
17
+ return (h(Tag, { class: {
16
18
  'sidebar-item': true,
17
19
  'sidebar-item--selected': this.selected,
18
20
  'sidebar-item--disabled': this.disabled,
19
- }, role: "menuitem", "aria-selected": this.selected ? 'true' : 'false', "aria-disabled": this.disabled ? 'true' : 'false' }, h("slot", null)));
21
+ }, role: "menuitem", href: this.href, "aria-selected": this.selected ? 'true' : 'false', "aria-disabled": this.disabled ? 'true' : 'false' }, h("slot", null)));
20
22
  }
21
23
  static get is() { return "six-sidebar-item"; }
22
24
  static get encapsulation() { return "shadow"; }
@@ -85,6 +87,23 @@ export class SixSidebarItem {
85
87
  "attribute": "disabled",
86
88
  "reflect": true,
87
89
  "defaultValue": "false"
90
+ },
91
+ "href": {
92
+ "type": "string",
93
+ "mutable": false,
94
+ "complexType": {
95
+ "original": "string | undefined",
96
+ "resolved": "string | undefined",
97
+ "references": {}
98
+ },
99
+ "required": false,
100
+ "optional": false,
101
+ "docs": {
102
+ "tags": [],
103
+ "text": "Provide if the item should be rendered as anchor tag.\nNote, that the href is added automatically when using routerLink in Angular."
104
+ },
105
+ "attribute": "href",
106
+ "reflect": true
88
107
  }
89
108
  };
90
109
  }
@@ -1 +1 @@
1
- {"version":3,"file":"six-sidebar-item.js","sourceRoot":"","sources":["../../../src/components/six-sidebar-item/six-sidebar-item.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAEnD;;;;;GAKG;AAOH,MAAM,OAAO,cAAc;;iBAEQ,EAAE;oBAGC,KAAK;oBAGL,KAAK;;EAEzC,MAAM;IACJ,OAAO,CACL,WACE,KAAK,EAAE;QACL,cAAc,EAAE,IAAI;QACpB,wBAAwB,EAAE,IAAI,CAAC,QAAQ;QACvC,wBAAwB,EAAE,IAAI,CAAC,QAAQ;OACxC,EACD,IAAI,EAAC,UAAU,mBACA,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,mBAChC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO;MAE/C,eAAa,CACT,CACP,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, Prop } from '@stencil/core';\n\n/**\n * @since 1.0\n * @status stable\n *\n * @slot - Used to define the nested displayed text of the item.\n */\n\n@Component({\n tag: 'six-sidebar-item',\n styleUrl: 'six-sidebar-item.scss',\n shadow: true,\n})\nexport class SixSidebarItem {\n /** A unique value to store in the sidebar item. This can be used as a way to identify sidebar items when selected. */\n @Prop({ reflect: true }) value = '';\n\n /** Set to true to draw the item in a selected state. */\n @Prop({ reflect: true }) selected = false;\n\n /** Set to true to draw the sidebar item in a disabled state. */\n @Prop({ reflect: true }) disabled = false;\n\n render() {\n return (\n <div\n class={{\n 'sidebar-item': true,\n 'sidebar-item--selected': this.selected,\n 'sidebar-item--disabled': this.disabled,\n }}\n role=\"menuitem\"\n aria-selected={this.selected ? 'true' : 'false'}\n aria-disabled={this.disabled ? 'true' : 'false'}\n >\n <slot></slot>\n </div>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"six-sidebar-item.js","sourceRoot":"","sources":["../../../src/components/six-sidebar-item/six-sidebar-item.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAEnD;;;;;GAKG;AAOH,MAAM,OAAO,cAAc;;iBAEQ,EAAE;oBAGC,KAAK;oBAGL,KAAK;;;EAQzC,MAAM;IACJ,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC;IAC5C,OAAO,CACL,EAAC,GAAG,IACF,KAAK,EAAE;QACL,cAAc,EAAE,IAAI;QACpB,wBAAwB,EAAE,IAAI,CAAC,QAAQ;QACvC,wBAAwB,EAAE,IAAI,CAAC,QAAQ;OACxC,EACD,IAAI,EAAC,UAAU,EACf,IAAI,EAAE,IAAI,CAAC,IAAI,mBACA,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,mBAChC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO;MAE/C,eAAa,CACT,CACP,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, Prop } from '@stencil/core';\n\n/**\n * @since 1.0\n * @status stable\n *\n * @slot - Used to define the nested displayed text of the item.\n */\n\n@Component({\n tag: 'six-sidebar-item',\n styleUrl: 'six-sidebar-item.scss',\n shadow: true,\n})\nexport class SixSidebarItem {\n /** A unique value to store in the sidebar item. This can be used as a way to identify sidebar items when selected. */\n @Prop({ reflect: true }) value = '';\n\n /** Set to true to draw the item in a selected state. */\n @Prop({ reflect: true }) selected = false;\n\n /** Set to true to draw the sidebar item in a disabled state. */\n @Prop({ reflect: true }) disabled = false;\n\n /**\n * Provide if the item should be rendered as anchor tag.\n * Note, that the href is added automatically when using routerLink in Angular.\n */\n @Prop({ reflect: true }) href: string | undefined;\n\n render() {\n const Tag = this.href != null ? 'a' : 'div';\n return (\n <Tag\n class={{\n 'sidebar-item': true,\n 'sidebar-item--selected': this.selected,\n 'sidebar-item--disabled': this.disabled,\n }}\n role=\"menuitem\"\n href={this.href}\n aria-selected={this.selected ? 'true' : 'false'}\n aria-disabled={this.disabled ? 'true' : 'false'}\n >\n <slot></slot>\n </Tag>\n );\n }\n}\n"]}
@@ -33,4 +33,11 @@
33
33
 
34
34
  .six-sidebar-details__header-icon {
35
35
  margin-right: 1em;
36
+ }
37
+
38
+ .six-sidebar-details__link {
39
+ text-decoration: none;
40
+ display: block;
41
+ color: inherit;
42
+ width: 100%;
36
43
  }
@@ -27,6 +27,7 @@ export class SixSidebarItemGroup {
27
27
  this.open = false;
28
28
  this.summaryIcon = undefined;
29
29
  this.summaryIconHasContent = false;
30
+ this.href = undefined;
30
31
  }
31
32
  connectedCallback() {
32
33
  this.handleSlotChange = this.handleSlotChange.bind(this);
@@ -41,12 +42,21 @@ export class SixSidebarItemGroup {
41
42
  var _a;
42
43
  return ((_a = this.host.parentElement) === null || _a === void 0 ? void 0 : _a.closest('six-sidebar-item-group')) != null;
43
44
  }
45
+ renderAsHref() {
46
+ return this.href != null && !this.hasItems;
47
+ }
44
48
  render() {
45
- return (h("six-details", { class: {
49
+ const element = (h("six-details", { class: {
46
50
  'six-sidebar-item-group': true,
47
51
  'six-sidebar-item-group--childless': !this.hasItems,
48
52
  'six-sidebar-item-group--subgroup': this.isSubgroup(),
49
53
  }, inline: true, open: this.open, "summary-icon": this.summaryIcon, hasContent: this.hasItems }, h("div", { slot: "summary" }, h("div", { class: "six-sidebar-details__header" }, this.icon && h("six-icon", { class: "six-sidebar-details__header-icon" }, this.icon), this.name)), this.provideSlot('summary-icon'), h("slot", null)));
54
+ if (this.renderAsHref()) {
55
+ return (h("a", { class: "six-sidebar-details__link", href: this.href }, element));
56
+ }
57
+ else {
58
+ return element;
59
+ }
50
60
  }
51
61
  static get is() { return "six-sidebar-item-group"; }
52
62
  static get encapsulation() { return "shadow"; }
@@ -150,6 +160,23 @@ export class SixSidebarItemGroup {
150
160
  },
151
161
  "attribute": "summary-icon",
152
162
  "reflect": false
163
+ },
164
+ "href": {
165
+ "type": "string",
166
+ "mutable": false,
167
+ "complexType": {
168
+ "original": "string | undefined",
169
+ "resolved": "string | undefined",
170
+ "references": {}
171
+ },
172
+ "required": false,
173
+ "optional": false,
174
+ "docs": {
175
+ "tags": [],
176
+ "text": "Provide if the item should be rendered as anchor tag.\nNote, that the href is added automatically when using routerLink in Angular."
177
+ },
178
+ "attribute": "href",
179
+ "reflect": true
153
180
  }
154
181
  };
155
182
  }
@@ -1 +1 @@
1
- {"version":3,"file":"six-sidebar-item-group.js","sourceRoot":"","sources":["../../../src/components/six-sidebar-item-group/six-sidebar-item-group.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C;;;;;GAKG;AAOH,MAAM,OAAO,mBAAmB;;IAsCtB,gBAAW,GAAG,CAAC,IAAY,EAAE,EAAE;MACrC,IAAI,IAAI,CAAC,qBAAqB,EAAE;QAC9B,OAAO,CACL,WAAK,IAAI,EAAE,IAAI;UACb,YAAM,IAAI,EAAE,IAAI,GAAS,CACrB,CACP,CAAC;OACH;MAED,OAAO,CACL,YACE,IAAI,EAAE,IAAI,EACV,YAAY,EAAE,GAAG,EAAE;;UACjB,MAAM,IAAI,GAAG,MAAA,IAAI,CAAC,IAAI,CAAC,UAAU,0CAAE,aAAa,CAAkB,cAAc,IAAI,IAAI,CAAC,CAAC;UAC1F,IAAI,IAAI,IAAI,IAAI,EAAE;YAChB,IAAI,CAAC,qBAAqB,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;WAC9D;QACH,CAAC,GACK,CACT,CAAC;IACJ,CAAC,CAAC;oBAvDkB,KAAK;gBAGV,EAAE;gBAGF,EAAE;iBAGgB,EAAE;gBAGH,KAAK;;iCAKJ,KAAK;;EAEtC,iBAAiB;IACf,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;EAC3D,CAAC;EAED,iBAAiB;IACf,IAAI,CAAC,gBAAgB,EAAE,CAAC;EAC1B,CAAC;EAEO,gBAAgB;IACtB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;EACrC,CAAC;EAEO,UAAU;;IAChB,OAAO,CAAA,MAAA,IAAI,CAAC,IAAI,CAAC,aAAa,0CAAE,OAAO,CAAC,wBAAwB,CAAC,KAAI,IAAI,CAAC;EAC5E,CAAC;EAwBD,MAAM;IACJ,OAAO,CACL,mBACE,KAAK,EAAE;QACL,wBAAwB,EAAE,IAAI;QAC9B,mCAAmC,EAAE,CAAC,IAAI,CAAC,QAAQ;QACnD,kCAAkC,EAAE,IAAI,CAAC,UAAU,EAAE;OACtD,EACD,MAAM,EAAE,IAAI,EACZ,IAAI,EAAE,IAAI,CAAC,IAAI,kBACD,IAAI,CAAC,WAAW,EAC9B,UAAU,EAAE,IAAI,CAAC,QAAQ;MAEzB,WAAK,IAAI,EAAC,SAAS;QACjB,WAAK,KAAK,EAAC,6BAA6B;UACrC,IAAI,CAAC,IAAI,IAAI,gBAAU,KAAK,EAAC,kCAAkC,IAAE,IAAI,CAAC,IAAI,CAAY;UACtF,IAAI,CAAC,IAAI,CACN,CACF;MACL,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC;MACjC,eAAQ,CACI,CACf,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, h, Prop, State } from '@stencil/core';\nimport { hasSlot } from '../../utils/slot';\n\n/**\n * @since 1.0\n * @status stable\n *\n * @slot - Used to define the nested sidebar [group] items.\n */\n\n@Component({\n tag: 'six-sidebar-item-group',\n styleUrl: 'six-sidebar-item-group.scss',\n shadow: true,\n})\nexport class SixSidebarItemGroup {\n @Element() readonly host!: HTMLSixSidebarItemGroupElement;\n\n @State() hasItems = false;\n\n /** Title of item group */\n @Prop() name = '';\n\n /** Icon of the group */\n @Prop() icon = '';\n\n /** A unique value to store in the sidebar item of the group label. This can be used as a way to identify sidebar items when selected. */\n @Prop({ reflect: true }) value = '';\n\n /** Indicates whether the sidebar is shown */\n @Prop({ reflect: true }) open = false;\n\n /** Custom summary icon name. */\n @Prop() summaryIcon?: string;\n\n @State() summaryIconHasContent = false;\n\n connectedCallback() {\n this.handleSlotChange = this.handleSlotChange.bind(this);\n }\n\n componentWillLoad() {\n this.handleSlotChange();\n }\n\n private handleSlotChange() {\n this.hasItems = hasSlot(this.host);\n }\n\n private isSubgroup() {\n return this.host.parentElement?.closest('six-sidebar-item-group') != null;\n }\n\n private provideSlot = (name: string) => {\n if (this.summaryIconHasContent) {\n return (\n <div slot={name}>\n <slot name={name}></slot>\n </div>\n );\n }\n\n return (\n <slot\n name={name}\n onSlotchange={() => {\n const slot = this.host.shadowRoot?.querySelector<HTMLSlotElement>(`slot[name=\"${name}\"]`);\n if (slot != null) {\n this.summaryIconHasContent = slot.assignedNodes().length > 0;\n }\n }}\n ></slot>\n );\n };\n\n render() {\n return (\n <six-details\n class={{\n 'six-sidebar-item-group': true,\n 'six-sidebar-item-group--childless': !this.hasItems,\n 'six-sidebar-item-group--subgroup': this.isSubgroup(),\n }}\n inline={true}\n open={this.open}\n summary-icon={this.summaryIcon}\n hasContent={this.hasItems}\n >\n <div slot=\"summary\">\n <div class=\"six-sidebar-details__header\">\n {this.icon && <six-icon class=\"six-sidebar-details__header-icon\">{this.icon}</six-icon>}\n {this.name}\n </div>\n </div>\n {this.provideSlot('summary-icon')}\n <slot />\n </six-details>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"six-sidebar-item-group.js","sourceRoot":"","sources":["../../../src/components/six-sidebar-item-group/six-sidebar-item-group.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C;;;;;GAKG;AAOH,MAAM,OAAO,mBAAmB;;IAgDtB,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mC,EAAE,CAAC,IAAI,CAAC,QAAQ;QACnD,kCAAkC,EAAE,IAAI,CAAC,UAAU,EAAE;OACtD,EACD,MAAM,EAAE,IAAI,EACZ,IAAI,EAAE,IAAI,CAAC,IAAI,kBACD,IAAI,CAAC,WAAW,EAC9B,UAAU,EAAE,IAAI,CAAC,QAAQ;MAEzB,WAAK,IAAI,EAAC,SAAS;QACjB,WAAK,KAAK,EAAC,6BAA6B;UACrC,IAAI,CAAC,IAAI,IAAI,gBAAU,KAAK,EAAC,kCAAkC,IAAE,IAAI,CAAC,IAAI,CAAY;UACtF,IAAI,CAAC,IAAI,CACN,CACF;MACL,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC;MACjC,eAAQ,CACI,CACf,CAAC;IAEF,IAAI,IAAI,CAAC,YAAY,EAAE,EAAE;MACvB,OAAO,CACL,SAAG,KAAK,EAAC,2BAA2B,EAAC,IAAI,EAAE,IAAI,CAAC,IAAI,IACjD,OAAO,CACN,CACL,CAAC;KACH;SAAM;MACL,OAAO,OAAO,CAAC;KAChB;EACH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, h, Prop, State } from '@stencil/core';\nimport { hasSlot } from '../../utils/slot';\n\n/**\n * @since 1.0\n * @status stable\n *\n * @slot - Used to define the nested sidebar [group] items.\n */\n\n@Component({\n tag: 'six-sidebar-item-group',\n styleUrl: 'six-sidebar-item-group.scss',\n shadow: true,\n})\nexport class SixSidebarItemGroup {\n @Element() readonly host!: HTMLSixSidebarItemGroupElement;\n\n @State() hasItems = false;\n\n /** Title of item group */\n @Prop() name = '';\n\n /** Icon of the group */\n @Prop() icon = '';\n\n /** A unique value to store in the sidebar item of the group label. This can be used as a way to identify sidebar items when selected. */\n @Prop({ reflect: true }) value = '';\n\n /** Indicates whether the sidebar is shown */\n @Prop({ reflect: true }) open = false;\n\n /** Custom summary icon name. */\n @Prop() summaryIcon?: string;\n\n @State() summaryIconHasContent = false;\n\n /**\n * Provide if the item should be rendered as anchor tag.\n * Note, that the href is added automatically when using routerLink in Angular.\n */\n @Prop({ reflect: true }) href: string | undefined;\n\n connectedCallback() {\n this.handleSlotChange = this.handleSlotChange.bind(this);\n }\n\n componentWillLoad() {\n this.handleSlotChange();\n }\n\n private handleSlotChange() {\n this.hasItems = hasSlot(this.host);\n }\n\n private isSubgroup() {\n return this.host.parentElement?.closest('six-sidebar-item-group') != null;\n }\n\n private renderAsHref(): boolean {\n return this.href != null && !this.hasItems;\n }\n\n private provideSlot = (name: string) => {\n if (this.summaryIconHasContent) {\n return (\n <div slot={name}>\n <slot name={name}></slot>\n </div>\n );\n }\n\n return (\n <slot\n name={name}\n onSlotchange={() => {\n const slot = this.host.shadowRoot?.querySelector<HTMLSlotElement>(`slot[name=\"${name}\"]`);\n if (slot != null) {\n this.summaryIconHasContent = slot.assignedNodes().length > 0;\n }\n }}\n ></slot>\n );\n };\n\n render() {\n const element = (\n <six-details\n class={{\n 'six-sidebar-item-group': true,\n 'six-sidebar-item-group--childless': !this.hasItems,\n 'six-sidebar-item-group--subgroup': this.isSubgroup(),\n }}\n inline={true}\n open={this.open}\n summary-icon={this.summaryIcon}\n hasContent={this.hasItems}\n >\n <div slot=\"summary\">\n <div class=\"six-sidebar-details__header\">\n {this.icon && <six-icon class=\"six-sidebar-details__header-icon\">{this.icon}</six-icon>}\n {this.name}\n </div>\n </div>\n {this.provideSlot('summary-icon')}\n <slot />\n </six-details>\n );\n\n if (this.renderAsHref()) {\n return (\n <a class=\"six-sidebar-details__link\" href={this.href}>\n {element}\n </a>\n );\n } else {\n return element;\n }\n }\n}\n"]}
@@ -26,6 +26,9 @@
26
26
  .form-control--has-label .form-control__label__required::after {
27
27
  color: var(--six-color-danger-800);
28
28
  content: "*";
29
+ transform: scale(1.1);
30
+ margin-left: var(--six-spacing-xxx-small);
31
+ position: absolute;
29
32
  }
30
33
  .form-control--has-label.form-control--small .form-control__label {
31
34
  font-size: var(--six-input-label-font-size-small);
@@ -26,6 +26,9 @@
26
26
  .form-control--has-label .form-control__label__required::after {
27
27
  color: var(--six-color-danger-800);
28
28
  content: "*";
29
+ transform: scale(1.1);
30
+ margin-left: var(--six-spacing-xxx-small);
31
+ position: absolute;
29
32
  }
30
33
  .form-control--has-label.form-control--small .form-control__label {
31
34
  font-size: var(--six-input-label-font-size-small);
@@ -1,3 +1,4 @@
1
+ export const languages = ['de', 'fr', 'it', 'en', 'es'];
1
2
  const dateFormat = new Intl.DateTimeFormat('de-CH');
2
3
  /**
3
4
  * Returns an error message for the given language and error.
@@ -87,5 +88,18 @@ const translation = {
87
88
  maxdate: 'Si prega di inserire una data il {maxdate} o precedente.',
88
89
  invaliddate: 'Inserisci una data valida.',
89
90
  },
91
+ es: {
92
+ required: 'Por favor, rellene este campo.',
93
+ minlength: 'Por favor, introduzca al menos {requiredLength} caracteres.',
94
+ maxlength: 'Por favor, introduzca no más de {requiredLength} caracteres.',
95
+ pattern: 'Por favor, introduzca un valor que coincida con el patrón: {pattern}.',
96
+ email: 'Por favor, introduzca una dirección de correo electrónico válida.',
97
+ min: 'Por favor, introduzca un valor mayor o igual a {min}.',
98
+ max: 'Por favor, introduzca un valor menor o igual a {max}.',
99
+ requiredtrue: 'Por favor, marque este campo.',
100
+ mindate: 'Por favor, introduzca una fecha igual o posterior a {mindate}.',
101
+ maxdate: 'Por favor, introduzca una fecha igual o anterior a {maxdate}.',
102
+ invaliddate: 'Por favor, introduzca una fecha válida.',
103
+ },
90
104
  };
91
105
  //# sourceMappingURL=error-messages.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"error-messages.js","sourceRoot":"","sources":["../../src/utils/error-messages.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,GAAG,IAAI,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;AAgBpD;;GAEG;AACH,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ClD,OAAO,EAAE,0DAA0D;IACnE,OAAO,EAAE,0DAA0D;IACnE,WAAW,EAAE,4BAA4B;GAC1C;CACF,CAAC","sourcesContent":["export type Language = 'de' | 'fr' | 'it' | 'en';\n\nconst dateFormat = new Intl.DateTimeFormat('de-CH');\n\nexport type ValidationError =\n | { key: 'required' }\n | { key: 'requiredtrue' }\n | { key: 'email'; requiredPattern: string }\n | { key: 'minlength'; requiredLength: number }\n | { key: 'maxlength'; requiredLength: number }\n | { key: 'pattern'; requiredPattern: string }\n | { key: 'min'; min: number }\n | { key: 'max'; max: number }\n | { key: 'mindate'; mindate: Date; actual: Date }\n | { key: 'maxdate'; maxdate: Date; actual: Date }\n | { key: 'invaliddate'; actual: Date }\n | { key: 'custom'; text: string };\n\n/**\n * Returns an error message for the given language and error.\n */\nexport function getErrorMessage(language: Language, error: ValidationError): string | undefined {\n try {\n const message = translation[language][error.key];\n switch (error.key) {\n case 'required':\n case 'requiredtrue':\n case 'email':\n return message;\n case 'minlength':\n case 'maxlength':\n return message.replace('{requiredLength}', String(error.requiredLength));\n case 'pattern':\n return message.replace('{pattern}', String(error.requiredPattern));\n case 'min':\n return message.replace('{min}', String(error.min));\n case 'max':\n return message.replace('{max}', String(error.max));\n case 'mindate':\n return message.replace('{mindate}', dateFormat.format(error.mindate));\n case 'maxdate':\n return message.replace('{maxdate}', dateFormat.format(error.maxdate));\n case 'invaliddate':\n return message;\n case 'custom':\n return error.text;\n }\n } catch (e) {\n console.warn(`no error message in '${language}' for error:`, error);\n return undefined;\n }\n}\n\nconst translation: Record<Language, Record<string, string>> = {\n en: {\n required: 'Please fill out this field.',\n minlength: 'Please enter at least {requiredLength} characters.',\n maxlength: 'Please enter no more than {requiredLength} characters.',\n pattern: 'Please enter a value that matches the pattern: {pattern}.',\n email: 'Please enter a valid email address.',\n min: 'Please enter a value greater than or equal to {min}.',\n max: 'Please enter a value less than or equal to {max}.',\n requiredtrue: 'Please check this field.',\n mindate: 'Please enter a date on or after {mindate}.',\n maxdate: 'Please enter a date on or before {maxdate}.',\n invaliddate: 'Please enter a valid date.',\n },\n fr: {\n required: \"Veuillez remplir ce champ s'il vous plaît.\",\n minlength: 'Veuillez entrer au moins {requiredLength} caractères.',\n maxlength: 'Veuillez entrer au maximum {requiredLength} caractères.',\n pattern: 'Veuillez entrer une valeur qui correspond au format : {pattern}.',\n email: 'Veuillez entrer une adresse email valide.',\n min: 'Veuillez entrer une valeur supérieure ou égale à {min}.',\n max: 'Veuillez entrer une valeur inférieure ou égale à {max}.',\n requiredtrue: \"Veuillez cocher cette case s'il vous plaît.\",\n mindate: 'Veuillez entrer une date le {mindate} ou après.',\n maxdate: 'Veuillez entrer une date le {maxdate} ou avant.',\n invaliddate: 'Veuillez entrer une date valide.',\n },\n de: {\n required: 'Bitte füllen Sie dieses Feld aus.',\n minlength: 'Bitte geben Sie mindestens {requiredLength} Zeichen ein.',\n maxlength: 'Bitte geben Sie höchstens {requiredLength} Zeichen ein.',\n pattern: 'Bitte geben Sie einen Wert ein, der dem Muster entspricht: {pattern}.',\n email: 'Bitte geben Sie eine gültige E-Mail-Adresse ein.',\n min: 'Bitte geben Sie einen Wert größer oder gleich {min} ein.',\n max: 'Bitte geben Sie einen Wert kleiner oder gleich {max} ein.',\n requiredtrue: 'Bitte aktivieren Sie dieses Feld.',\n mindate: 'Bitte geben Sie ein Datum am oder nach dem {mindate} ein.',\n maxdate: 'Bitte geben Sie ein Datum am oder vor dem {maxdate} ein.',\n invaliddate: 'Bitte geben Sie ein gültiges Datum ein.',\n },\n it: {\n required: 'Si prega di compilare questo campo.',\n minlength: 'Si prega di inserire almeno {requiredLength} caratteri.',\n maxlength: 'Si prega di inserire al massimo {requiredLength} caratteri.',\n pattern: 'Si prega di inserire un valore che corrisponde al formato: {pattern}.',\n email: 'Si prega di inserire un indirizzo email valido.',\n min: 'Si prega di inserire un valore maggiore o uguale a {min}.',\n max: 'Si prega di inserire un valore minore o uguale a {max}.',\n requiredtrue: 'Si prega di spuntare questo campo.',\n mindate: 'Si prega di inserire una data il {mindate} o successiva.',\n maxdate: 'Si prega di inserire una data il {maxdate} o precedente.',\n invaliddate: 'Inserisci una data valida.',\n },\n};\n"]}
1
+ {"version":3,"file":"error-messages.js","sourceRoot":"","sources":["../../src/utils/error-messages.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAU,CAAC;AAGjE,MAAM,UAAU,GAAG,IAAI,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;AAgBpD;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,QAAkB,EAAE,KAAsB;EACxE,IAAI;IACF,MAAM,OAAO,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACjD,QAAQ,KAAK,CAAC,GAAG,EAAE;MACjB,KAAK,UAAU,CAAC;MAChB,KAAK,cAAc,CAAC;MACpB,KAAK,OAAO;QACV,OAAO,OAAO,CAAC;MACjB,KAAK,WAAW,CAAC;MACjB,KAAK,WAAW;QACd,OAAO,OAAO,CAAC,OAAO,CAAC,kBAAkB,EAAE,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC;MAC3E,KAAK,SAAS;QACZ,OAAO,OAAO,CAAC,OAAO,CAAC,WAAW,EAAE,MAAM,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC;MACrE,KAAK,KAAK;QACR,OAAO,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;MACrD,KAAK,KAAK;QACR,OAAO,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;MACrD,KAAK,SAAS;QACZ,OAAO,OAAO,CAAC,OAAO,CAAC,WAAW,EAAE,UAAU,CAAC,MAAM,CAAC,KA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AG,EAAE,0DAA0D;IAC/D,GAAG,EAAE,2DAA2D;IAChE,YAAY,EAAE,mCAAmC;IACjD,OAAO,EAAE,2DAA2D;IACpE,OAAO,EAAE,0DAA0D;IACnE,WAAW,EAAE,yCAAyC;GACvD;EACD,EAAE,EAAE;IACF,QAAQ,EAAE,qCAAqC;IAC/C,SAAS,EAAE,yDAAyD;IACpE,SAAS,EAAE,6DAA6D;IACxE,OAAO,EAAE,uEAAuE;IAChF,KAAK,EAAE,iDAAiD;IACxD,GAAG,EAAE,2DAA2D;IAChE,GAAG,EAAE,yDAAyD;IAC9D,YAAY,EAAE,oCAAoC;IAClD,OAAO,EAAE,0DAA0D;IACnE,OAAO,EAAE,0DAA0D;IACnE,WAAW,EAAE,4BAA4B;GAC1C;EAED,EAAE,EAAE;IACF,QAAQ,EAAE,gCAAgC;IAC1C,SAAS,EAAE,6DAA6D;IACxE,SAAS,EAAE,8DAA8D;IACzE,OAAO,EAAE,uEAAuE;IAChF,KAAK,EAAE,mEAAmE;IAC1E,GAAG,EAAE,uDAAuD;IAC5D,GAAG,EAAE,uDAAuD;IAC5D,YAAY,EAAE,+BAA+B;IAC7C,OAAO,EAAE,gEAAgE;IACzE,OAAO,EAAE,+DAA+D;IACxE,WAAW,EAAE,yCAAyC;GACvD;CACF,CAAC","sourcesContent":["export const languages = ['de', 'fr', 'it', 'en', 'es'] as const;\nexport type Language = (typeof languages)[number];\n\nconst dateFormat = new Intl.DateTimeFormat('de-CH');\n\nexport type ValidationError =\n | { key: 'required' }\n | { key: 'requiredtrue' }\n | { key: 'email'; requiredPattern: string }\n | { key: 'minlength'; requiredLength: number }\n | { key: 'maxlength'; requiredLength: number }\n | { key: 'pattern'; requiredPattern: string }\n | { key: 'min'; min: number }\n | { key: 'max'; max: number }\n | { key: 'mindate'; mindate: Date; actual: Date }\n | { key: 'maxdate'; maxdate: Date; actual: Date }\n | { key: 'invaliddate'; actual: Date }\n | { key: 'custom'; text: string };\n\n/**\n * Returns an error message for the given language and error.\n */\nexport function getErrorMessage(language: Language, error: ValidationError): string | undefined {\n try {\n const message = translation[language][error.key];\n switch (error.key) {\n case 'required':\n case 'requiredtrue':\n case 'email':\n return message;\n case 'minlength':\n case 'maxlength':\n return message.replace('{requiredLength}', String(error.requiredLength));\n case 'pattern':\n return message.replace('{pattern}', String(error.requiredPattern));\n case 'min':\n return message.replace('{min}', String(error.min));\n case 'max':\n return message.replace('{max}', String(error.max));\n case 'mindate':\n return message.replace('{mindate}', dateFormat.format(error.mindate));\n case 'maxdate':\n return message.replace('{maxdate}', dateFormat.format(error.maxdate));\n case 'invaliddate':\n return message;\n case 'custom':\n return error.text;\n }\n } catch (e) {\n console.warn(`no error message in '${language}' for error:`, error);\n return undefined;\n }\n}\n\nconst translation: Record<Language, Record<string, string>> = {\n en: {\n required: 'Please fill out this field.',\n minlength: 'Please enter at least {requiredLength} characters.',\n maxlength: 'Please enter no more than {requiredLength} characters.',\n pattern: 'Please enter a value that matches the pattern: {pattern}.',\n email: 'Please enter a valid email address.',\n min: 'Please enter a value greater than or equal to {min}.',\n max: 'Please enter a value less than or equal to {max}.',\n requiredtrue: 'Please check this field.',\n mindate: 'Please enter a date on or after {mindate}.',\n maxdate: 'Please enter a date on or before {maxdate}.',\n invaliddate: 'Please enter a valid date.',\n },\n fr: {\n required: \"Veuillez remplir ce champ s'il vous plaît.\",\n minlength: 'Veuillez entrer au moins {requiredLength} caractères.',\n maxlength: 'Veuillez entrer au maximum {requiredLength} caractères.',\n pattern: 'Veuillez entrer une valeur qui correspond au format : {pattern}.',\n email: 'Veuillez entrer une adresse email valide.',\n min: 'Veuillez entrer une valeur supérieure ou égale à {min}.',\n max: 'Veuillez entrer une valeur inférieure ou égale à {max}.',\n requiredtrue: \"Veuillez cocher cette case s'il vous plaît.\",\n mindate: 'Veuillez entrer une date le {mindate} ou après.',\n maxdate: 'Veuillez entrer une date le {maxdate} ou avant.',\n invaliddate: 'Veuillez entrer une date valide.',\n },\n de: {\n required: 'Bitte füllen Sie dieses Feld aus.',\n minlength: 'Bitte geben Sie mindestens {requiredLength} Zeichen ein.',\n maxlength: 'Bitte geben Sie höchstens {requiredLength} Zeichen ein.',\n pattern: 'Bitte geben Sie einen Wert ein, der dem Muster entspricht: {pattern}.',\n email: 'Bitte geben Sie eine gültige E-Mail-Adresse ein.',\n min: 'Bitte geben Sie einen Wert größer oder gleich {min} ein.',\n max: 'Bitte geben Sie einen Wert kleiner oder gleich {max} ein.',\n requiredtrue: 'Bitte aktivieren Sie dieses Feld.',\n mindate: 'Bitte geben Sie ein Datum am oder nach dem {mindate} ein.',\n maxdate: 'Bitte geben Sie ein Datum am oder vor dem {maxdate} ein.',\n invaliddate: 'Bitte geben Sie ein gültiges Datum ein.',\n },\n it: {\n required: 'Si prega di compilare questo campo.',\n minlength: 'Si prega di inserire almeno {requiredLength} caratteri.',\n maxlength: 'Si prega di inserire al massimo {requiredLength} caratteri.',\n pattern: 'Si prega di inserire un valore che corrisponde al formato: {pattern}.',\n email: 'Si prega di inserire un indirizzo email valido.',\n min: 'Si prega di inserire un valore maggiore o uguale a {min}.',\n max: 'Si prega di inserire un valore minore o uguale a {max}.',\n requiredtrue: 'Si prega di spuntare questo campo.',\n mindate: 'Si prega di inserire una data il {mindate} o successiva.',\n maxdate: 'Si prega di inserire una data il {maxdate} o precedente.',\n invaliddate: 'Inserisci una data valida.',\n },\n\n es: {\n required: 'Por favor, rellene este campo.',\n minlength: 'Por favor, introduzca al menos {requiredLength} caracteres.',\n maxlength: 'Por favor, introduzca no más de {requiredLength} caracteres.',\n pattern: 'Por favor, introduzca un valor que coincida con el patrón: {pattern}.',\n email: 'Por favor, introduzca una dirección de correo electrónico válida.',\n min: 'Por favor, introduzca un valor mayor o igual a {min}.',\n max: 'Por favor, introduzca un valor menor o igual a {max}.',\n requiredtrue: 'Por favor, marque este campo.',\n mindate: 'Por favor, introduzca una fecha igual o posterior a {mindate}.',\n maxdate: 'Por favor, introduzca una fecha igual o anterior a {maxdate}.',\n invaliddate: 'Por favor, introduzca una fecha válida.',\n },\n};\n"]}
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Get the base path to where the assets can be found. Use "setAssetPath(path)"
3
+ * if the path needs to be customized.
4
+ */
5
+ export declare const getAssetPath: (path: string) => string;
6
+
1
7
  /**
2
8
  * Used to manually set the base path where assets can be found.
3
9
  * If the script is used as "module", it's recommended to use "import.meta.url",
@@ -51,8 +51,9 @@ import { SixTextarea } from './six-textarea.js';
51
51
  import { SixTile } from './six-tile.js';
52
52
  import { SixTimepicker } from './six-timepicker.js';
53
53
  import { SixTooltip } from './six-tooltip.js';
54
- export { setAssetPath, setNonce, setPlatformOptions } from '@stencil/core/internal/client';
54
+ export { getAssetPath, setAssetPath, setNonce, setPlatformOptions } from '@stencil/core/internal/client';
55
55
 
56
+ const languages = ['de', 'fr', 'it', 'en', 'es'];
56
57
  const dateFormat = new Intl.DateTimeFormat('de-CH');
57
58
  /**
58
59
  * Returns an error message for the given language and error.
@@ -142,6 +143,19 @@ const translation = {
142
143
  maxdate: 'Si prega di inserire una data il {maxdate} o precedente.',
143
144
  invaliddate: 'Inserisci una data valida.',
144
145
  },
146
+ es: {
147
+ required: 'Por favor, rellene este campo.',
148
+ minlength: 'Por favor, introduzca al menos {requiredLength} caracteres.',
149
+ maxlength: 'Por favor, introduzca no más de {requiredLength} caracteres.',
150
+ pattern: 'Por favor, introduzca un valor que coincida con el patrón: {pattern}.',
151
+ email: 'Por favor, introduzca una dirección de correo electrónico válida.',
152
+ min: 'Por favor, introduzca un valor mayor o igual a {min}.',
153
+ max: 'Por favor, introduzca un valor menor o igual a {max}.',
154
+ requiredtrue: 'Por favor, marque este campo.',
155
+ mindate: 'Por favor, introduzca una fecha igual o posterior a {mindate}.',
156
+ maxdate: 'Por favor, introduzca una fecha igual o anterior a {maxdate}.',
157
+ invaliddate: 'Por favor, introduzca una fecha válida.',
158
+ },
145
159
  };
146
160
 
147
161
  const defineCustomElements = (opts) => {
@@ -208,6 +222,6 @@ const defineCustomElements = (opts) => {
208
222
  }
209
223
  };
210
224
 
211
- export { defineCustomElements, getErrorMessage };
225
+ export { defineCustomElements, getErrorMessage, languages };
212
226
 
213
227
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"file":"index.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,MAAM,UAAU,GAAG,IAAI,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;AAgBpD;;;SAGgB,eAAe,CAAC,QAAkB,EAAE,KAAsB;EACxE,IAAI;IACF,MAAM,OAAO,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACjD,QAAQ,KAAK,CAAC,GAAG;MACf,KAAK,UAAU,CAAC;MAChB,KAAK,cAAc,CAAC;MACpB,KAAK,OAAO;QACV,OAAO,OAAO,CAAC;MACjB,KAAK,WAAW,CAAC;MACjB,KAAK,WAAW;QACd,OAAO,OAAO,CAAC,OAAO,CAAC,kBAAkB,EAAE,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC;MAC3E,KAAK,SAAS;QACZ,OAAO,OAAO,CAAC,OAAO,CAAC,WAAW,EAAE,MAAM,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC;MACrE,KAAK,KAAK;QACR,OAAO,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;MACrD,KAAK,KAAK;QACR,OAAO,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;MACrD,KAAK,SAAS;QACZ,OAAO,OAAO,CAAC,OAAO,CAAC,WAAW,EAAE,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;MACxE,KAAK,SAAS;QACZ,OAAO,OAAO,CAAC,OAAO,CAAC,WAAW,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A2D;IACpE,OAAO,EAAE,0DAA0D;IACnE,WAAW,EAAE,yCAAyC;GACvD;EACD,EAAE,EAAE;IACF,QAAQ,EAAE,qCAAqC;IAC/C,SAAS,EAAE,yDAAyD;IACpE,SAAS,EAAE,6DAA6D;IACxE,OAAO,EAAE,uEAAuE;IAChF,KAAK,EAAE,iDAAiD;IACxD,GAAG,EAAE,2DAA2D;IAChE,GAAG,EAAE,yDAAyD;IAC9D,YAAY,EAAE,oCAAoC;IAClD,OAAO,EAAE,0DAA0D;IACnE,OAAO,EAAE,0DAA0D;IACnE,WAAW,EAAE,4BAA4B;GAC1C;CACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/utils/error-messages.ts"],"sourcesContent":["export type Language = 'de' | 'fr' | 'it' | 'en';\n\nconst dateFormat = new Intl.DateTimeFormat('de-CH');\n\nexport type ValidationError =\n | { key: 'required' }\n | { key: 'requiredtrue' }\n | { key: 'email'; requiredPattern: string }\n | { key: 'minlength'; requiredLength: number }\n | { key: 'maxlength'; requiredLength: number }\n | { key: 'pattern'; requiredPattern: string }\n | { key: 'min'; min: number }\n | { key: 'max'; max: number }\n | { key: 'mindate'; mindate: Date; actual: Date }\n | { key: 'maxdate'; maxdate: Date; actual: Date }\n | { key: 'invaliddate'; actual: Date }\n | { key: 'custom'; text: string };\n\n/**\n * Returns an error message for the given language and error.\n */\nexport function getErrorMessage(language: Language, error: ValidationError): string | undefined {\n try {\n const message = translation[language][error.key];\n switch (error.key) {\n case 'required':\n case 'requiredtrue':\n case 'email':\n return message;\n case 'minlength':\n case 'maxlength':\n return message.replace('{requiredLength}', String(error.requiredLength));\n case 'pattern':\n return message.replace('{pattern}', String(error.requiredPattern));\n case 'min':\n return message.replace('{min}', String(error.min));\n case 'max':\n return message.replace('{max}', String(error.max));\n case 'mindate':\n return message.replace('{mindate}', dateFormat.format(error.mindate));\n case 'maxdate':\n return message.replace('{maxdate}', dateFormat.format(error.maxdate));\n case 'invaliddate':\n return message;\n case 'custom':\n return error.text;\n }\n } catch (e) {\n console.warn(`no error message in '${language}' for error:`, error);\n return undefined;\n }\n}\n\nconst translation: Record<Language, Record<string, string>> = {\n en: {\n required: 'Please fill out this field.',\n minlength: 'Please enter at least {requiredLength} characters.',\n maxlength: 'Please enter no more than {requiredLength} characters.',\n pattern: 'Please enter a value that matches the pattern: {pattern}.',\n email: 'Please enter a valid email address.',\n min: 'Please enter a value greater than or equal to {min}.',\n max: 'Please enter a value less than or equal to {max}.',\n requiredtrue: 'Please check this field.',\n mindate: 'Please enter a date on or after {mindate}.',\n maxdate: 'Please enter a date on or before {maxdate}.',\n invaliddate: 'Please enter a valid date.',\n },\n fr: {\n required: \"Veuillez remplir ce champ s'il vous plaît.\",\n minlength: 'Veuillez entrer au moins {requiredLength} caractères.',\n maxlength: 'Veuillez entrer au maximum {requiredLength} caractères.',\n pattern: 'Veuillez entrer une valeur qui correspond au format : {pattern}.',\n email: 'Veuillez entrer une adresse email valide.',\n min: 'Veuillez entrer une valeur supérieure ou égale à {min}.',\n max: 'Veuillez entrer une valeur inférieure ou égale à {max}.',\n requiredtrue: \"Veuillez cocher cette case s'il vous plaît.\",\n mindate: 'Veuillez entrer une date le {mindate} ou après.',\n maxdate: 'Veuillez entrer une date le {maxdate} ou avant.',\n invaliddate: 'Veuillez entrer une date valide.',\n },\n de: {\n required: 'Bitte füllen Sie dieses Feld aus.',\n minlength: 'Bitte geben Sie mindestens {requiredLength} Zeichen ein.',\n maxlength: 'Bitte geben Sie höchstens {requiredLength} Zeichen ein.',\n pattern: 'Bitte geben Sie einen Wert ein, der dem Muster entspricht: {pattern}.',\n email: 'Bitte geben Sie eine gültige E-Mail-Adresse ein.',\n min: 'Bitte geben Sie einen Wert größer oder gleich {min} ein.',\n max: 'Bitte geben Sie einen Wert kleiner oder gleich {max} ein.',\n requiredtrue: 'Bitte aktivieren Sie dieses Feld.',\n mindate: 'Bitte geben Sie ein Datum am oder nach dem {mindate} ein.',\n maxdate: 'Bitte geben Sie ein Datum am oder vor dem {maxdate} ein.',\n invaliddate: 'Bitte geben Sie ein gültiges Datum ein.',\n },\n it: {\n required: 'Si prega di compilare questo campo.',\n minlength: 'Si prega di inserire almeno {requiredLength} caratteri.',\n maxlength: 'Si prega di inserire al massimo {requiredLength} caratteri.',\n pattern: 'Si prega di inserire un valore che corrisponde al formato: {pattern}.',\n email: 'Si prega di inserire un indirizzo email valido.',\n min: 'Si prega di inserire un valore maggiore o uguale a {min}.',\n max: 'Si prega di inserire un valore minore o uguale a {max}.',\n requiredtrue: 'Si prega di spuntare questo campo.',\n mindate: 'Si prega di inserire una data il {mindate} o successiva.',\n maxdate: 'Si prega di inserire una data il {maxdate} o precedente.',\n invaliddate: 'Inserisci una data valida.',\n },\n};\n"],"version":3}
1
+ {"file":"index.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAAa,SAAS,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAW;AAGjE,MAAM,UAAU,GAAG,IAAI,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;AAgBpD;;;SAGgB,eAAe,CAAC,QAAkB,EAAE,KAAsB;EACxE,IAAI;IACF,MAAM,OAAO,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACjD,QAAQ,KAAK,CAAC,GAAG;MACf,KAAK,UAAU,CAAC;MAChB,KAAK,cAAc,CAAC;MACpB,KAAK,OAAO;QACV,OAAO,OAAO,CAAC;MACjB,KAAK,WAAW,CAAC;MACjB,KAAK,WAAW;QACd,OAAO,OAAO,CAAC,OAAO,CAAC,kBAAkB,EAAE,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC;MAC3E,KAAK,SAAS;QACZ,OAAO,OAAO,CAAC,OAAO,CAAC,WAAW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;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/utils/error-messages.ts"],"sourcesContent":["export const languages = ['de', 'fr', 'it', 'en', 'es'] as const;\nexport type Language = (typeof languages)[number];\n\nconst dateFormat = new Intl.DateTimeFormat('de-CH');\n\nexport type ValidationError =\n | { key: 'required' }\n | { key: 'requiredtrue' }\n | { key: 'email'; requiredPattern: string }\n | { key: 'minlength'; requiredLength: number }\n | { key: 'maxlength'; requiredLength: number }\n | { key: 'pattern'; requiredPattern: string }\n | { key: 'min'; min: number }\n | { key: 'max'; max: number }\n | { key: 'mindate'; mindate: Date; actual: Date }\n | { key: 'maxdate'; maxdate: Date; actual: Date }\n | { key: 'invaliddate'; actual: Date }\n | { key: 'custom'; text: string };\n\n/**\n * Returns an error message for the given language and error.\n */\nexport function getErrorMessage(language: Language, error: ValidationError): string | undefined {\n try {\n const message = translation[language][error.key];\n switch (error.key) {\n case 'required':\n case 'requiredtrue':\n case 'email':\n return message;\n case 'minlength':\n case 'maxlength':\n return message.replace('{requiredLength}', String(error.requiredLength));\n case 'pattern':\n return message.replace('{pattern}', String(error.requiredPattern));\n case 'min':\n return message.replace('{min}', String(error.min));\n case 'max':\n return message.replace('{max}', String(error.max));\n case 'mindate':\n return message.replace('{mindate}', dateFormat.format(error.mindate));\n case 'maxdate':\n return message.replace('{maxdate}', dateFormat.format(error.maxdate));\n case 'invaliddate':\n return message;\n case 'custom':\n return error.text;\n }\n } catch (e) {\n console.warn(`no error message in '${language}' for error:`, error);\n return undefined;\n }\n}\n\nconst translation: Record<Language, Record<string, string>> = {\n en: {\n required: 'Please fill out this field.',\n minlength: 'Please enter at least {requiredLength} characters.',\n maxlength: 'Please enter no more than {requiredLength} characters.',\n pattern: 'Please enter a value that matches the pattern: {pattern}.',\n email: 'Please enter a valid email address.',\n min: 'Please enter a value greater than or equal to {min}.',\n max: 'Please enter a value less than or equal to {max}.',\n requiredtrue: 'Please check this field.',\n mindate: 'Please enter a date on or after {mindate}.',\n maxdate: 'Please enter a date on or before {maxdate}.',\n invaliddate: 'Please enter a valid date.',\n },\n fr: {\n required: \"Veuillez remplir ce champ s'il vous plaît.\",\n minlength: 'Veuillez entrer au moins {requiredLength} caractères.',\n maxlength: 'Veuillez entrer au maximum {requiredLength} caractères.',\n pattern: 'Veuillez entrer une valeur qui correspond au format : {pattern}.',\n email: 'Veuillez entrer une adresse email valide.',\n min: 'Veuillez entrer une valeur supérieure ou égale à {min}.',\n max: 'Veuillez entrer une valeur inférieure ou égale à {max}.',\n requiredtrue: \"Veuillez cocher cette case s'il vous plaît.\",\n mindate: 'Veuillez entrer une date le {mindate} ou après.',\n maxdate: 'Veuillez entrer une date le {maxdate} ou avant.',\n invaliddate: 'Veuillez entrer une date valide.',\n },\n de: {\n required: 'Bitte füllen Sie dieses Feld aus.',\n minlength: 'Bitte geben Sie mindestens {requiredLength} Zeichen ein.',\n maxlength: 'Bitte geben Sie höchstens {requiredLength} Zeichen ein.',\n pattern: 'Bitte geben Sie einen Wert ein, der dem Muster entspricht: {pattern}.',\n email: 'Bitte geben Sie eine gültige E-Mail-Adresse ein.',\n min: 'Bitte geben Sie einen Wert größer oder gleich {min} ein.',\n max: 'Bitte geben Sie einen Wert kleiner oder gleich {max} ein.',\n requiredtrue: 'Bitte aktivieren Sie dieses Feld.',\n mindate: 'Bitte geben Sie ein Datum am oder nach dem {mindate} ein.',\n maxdate: 'Bitte geben Sie ein Datum am oder vor dem {maxdate} ein.',\n invaliddate: 'Bitte geben Sie ein gültiges Datum ein.',\n },\n it: {\n required: 'Si prega di compilare questo campo.',\n minlength: 'Si prega di inserire almeno {requiredLength} caratteri.',\n maxlength: 'Si prega di inserire al massimo {requiredLength} caratteri.',\n pattern: 'Si prega di inserire un valore che corrisponde al formato: {pattern}.',\n email: 'Si prega di inserire un indirizzo email valido.',\n min: 'Si prega di inserire un valore maggiore o uguale a {min}.',\n max: 'Si prega di inserire un valore minore o uguale a {max}.',\n requiredtrue: 'Si prega di spuntare questo campo.',\n mindate: 'Si prega di inserire una data il {mindate} o successiva.',\n maxdate: 'Si prega di inserire una data il {maxdate} o precedente.',\n invaliddate: 'Inserisci una data valida.',\n },\n\n es: {\n required: 'Por favor, rellene este campo.',\n minlength: 'Por favor, introduzca al menos {requiredLength} caracteres.',\n maxlength: 'Por favor, introduzca no más de {requiredLength} caracteres.',\n pattern: 'Por favor, introduzca un valor que coincida con el patrón: {pattern}.',\n email: 'Por favor, introduzca una dirección de correo electrónico válida.',\n min: 'Por favor, introduzca un valor mayor o igual a {min}.',\n max: 'Por favor, introduzca un valor menor o igual a {max}.',\n requiredtrue: 'Por favor, marque este campo.',\n mindate: 'Por favor, introduzca una fecha igual o posterior a {mindate}.',\n maxdate: 'Por favor, introduzca una fecha igual o anterior a {maxdate}.',\n invaliddate: 'Por favor, introduzca una fecha válida.',\n },\n};\n"],"version":3}
@@ -51,6 +51,8 @@ const SetAttributes = /*@__PURE__*/ proxyCustomElement(class SetAttributes exten
51
51
  }; }
52
52
  }, [4, "set-attributes", {
53
53
  "value": [16]
54
+ }, undefined, {
55
+ "value": ["attrsUpdated"]
54
56
  }]);
55
57
  function defineCustomElement() {
56
58
  if (typeof customElements === "undefined") {
@@ -1 +1 @@
1
- {"file":"set-attributes2.js","mappings":";;MAKa,aAAa;;;;iBAIR,EAAE;;EAElB,iBAAiB;IACf,IAAI,CAAC,WAAW,EAAE,CAAC;GACpB;EAGD,YAAY;IACV,IAAI,CAAC,WAAW,EAAE,CAAC;GACpB;EAEO,WAAW;IACjB,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,iBAAoC,CAAC;IAE5D,IAAI,QAAO,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,gBAAgB,CAAA,KAAK,UAAU,EAAE;MAChD,OAAO;KACR;IAED,MAAM,KAAK,GAAG,IAAI,CAAC,gBAAgB,EAAE,CAAC,GAAG,EAAE,CAAC;IAE5C,IAAI,CAAC,KAAK,EAAE;MACV,OAAO;KACR;IAED,MAAM,KAAK,GAAG;;MAEZ,SAAS,EAAE,CAAC,GAAW,KAAK,KAAK,CAAC,eAAe,CAAC,GAAG,CAAC;MACtD,OAAO,EAAE,CAAC,GAAW,EAAE,KAAc;QACnC,IAAI,KAAK,IAAI,IAAI,EAAE;UACjB,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;SAC7B;aAAM;UACL,KAAK,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;SAC5B;OACF;MACD,MAAM,EAAE,CAAC,GAAW,EAAE,KAAa,KAAK,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,CAAC;MACtE,MAAM,EAAE,CAAC,GAAW,EAAE,KAAa,KAAK,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,CAAC;MACtE,MAAM,EAAE,CAAC,GAAW,EAAE,KAAa,KAAK,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;KACvF,CAAC;IAEF,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;;;MAGrD,KAAK,CAAC,OAAO,KAAK,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;KACjC;GACF;EAED,MAAM;IACJ,OAAO,eAAQ,CAAC;GACjB;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/wrappers/set-attributes/set-attributes.tsx"],"sourcesContent":["import { Component, Element, h, Prop, Watch } from '@stencil/core';\n\n@Component({\n tag: 'set-attributes',\n})\nexport class SetAttributes {\n @Element() host!: HTMLSetAttributesElement;\n\n /** Attributes map */\n @Prop() value = {};\n\n componentWillLoad() {\n this.injectAttrs();\n }\n\n @Watch('value')\n attrsUpdated() {\n this.injectAttrs();\n }\n\n private injectAttrs() {\n const slot = this.host.firstElementChild as HTMLSlotElement;\n\n if (typeof slot?.assignedElements !== 'function') {\n return;\n }\n\n const child = slot.assignedElements().pop();\n\n if (!child) {\n return;\n }\n\n const types = {\n // no need for function and bigint\n undefined: (key: string) => child.removeAttribute(key),\n boolean: (key: string, value: unknown) => {\n if (value != null) {\n child.setAttribute(key, '');\n } else {\n child.removeAttribute(key);\n }\n },\n number: (key: string, value: string) => child.setAttribute(key, value),\n string: (key: string, value: string) => child.setAttribute(key, value),\n object: (key: string, value: string) => child.setAttribute(key, JSON.stringify(value)),\n };\n\n for (const [key, value] of Object.entries(this.value)) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n types[typeof value](key, value);\n }\n }\n\n render() {\n return <slot />;\n }\n}\n"],"version":3}
1
+ {"file":"set-attributes2.js","mappings":";;MAKa,aAAa;;;;iBAIR,EAAE;;EAElB,iBAAiB;IACf,IAAI,CAAC,WAAW,EAAE,CAAC;GACpB;EAGD,YAAY;IACV,IAAI,CAAC,WAAW,EAAE,CAAC;GACpB;EAEO,WAAW;IACjB,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,iBAAoC,CAAC;IAE5D,IAAI,QAAO,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,gBAAgB,CAAA,KAAK,UAAU,EAAE;MAChD,OAAO;KACR;IAED,MAAM,KAAK,GAAG,IAAI,CAAC,gBAAgB,EAAE,CAAC,GAAG,EAAE,CAAC;IAE5C,IAAI,CAAC,KAAK,EAAE;MACV,OAAO;KACR;IAED,MAAM,KAAK,GAAG;;MAEZ,SAAS,EAAE,CAAC,GAAW,KAAK,KAAK,CAAC,eAAe,CAAC,GAAG,CAAC;MACtD,OAAO,EAAE,CAAC,GAAW,EAAE,KAAc;QACnC,IAAI,KAAK,IAAI,IAAI,EAAE;UACjB,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;SAC7B;aAAM;UACL,KAAK,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;SAC5B;OACF;MACD,MAAM,EAAE,CAAC,GAAW,EAAE,KAAa,KAAK,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,CAAC;MACtE,MAAM,EAAE,CAAC,GAAW,EAAE,KAAa,KAAK,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,CAAC;MACtE,MAAM,EAAE,CAAC,GAAW,EAAE,KAAa,KAAK,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;KACvF,CAAC;IAEF,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;;;MAGrD,KAAK,CAAC,OAAO,KAAK,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;KACjC;GACF;EAED,MAAM;IACJ,OAAO,eAAQ,CAAC;GACjB;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/wrappers/set-attributes/set-attributes.tsx"],"sourcesContent":["import { Component, Element, h, Prop, Watch } from '@stencil/core';\n\n@Component({\n tag: 'set-attributes',\n})\nexport class SetAttributes {\n @Element() host!: HTMLSetAttributesElement;\n\n /** Attributes map */\n @Prop() value = {};\n\n componentWillLoad() {\n this.injectAttrs();\n }\n\n @Watch('value')\n attrsUpdated() {\n this.injectAttrs();\n }\n\n private injectAttrs() {\n const slot = this.host.firstElementChild as HTMLSlotElement;\n\n if (typeof slot?.assignedElements !== 'function') {\n return;\n }\n\n const child = slot.assignedElements().pop();\n\n if (!child) {\n return;\n }\n\n const types = {\n // no need for function and bigint\n undefined: (key: string) => child.removeAttribute(key),\n boolean: (key: string, value: unknown) => {\n if (value != null) {\n child.setAttribute(key, '');\n } else {\n child.removeAttribute(key);\n }\n },\n number: (key: string, value: string) => child.setAttribute(key, value),\n string: (key: string, value: string) => child.setAttribute(key, value),\n object: (key: string, value: string) => child.setAttribute(key, JSON.stringify(value)),\n };\n\n for (const [key, value] of Object.entries(this.value)) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n types[typeof value](key, value);\n }\n }\n\n render() {\n return <slot />;\n }\n}\n"],"version":3}
@@ -134,6 +134,9 @@ const SixAlert$1 = /*@__PURE__*/ proxyCustomElement(class SixAlert extends HTMLE
134
134
  "show": [64],
135
135
  "hide": [64],
136
136
  "toast": [64]
137
+ }, undefined, {
138
+ "open": ["handleOpenChange"],
139
+ "duration": ["handleDurationChange"]
137
140
  }]);
138
141
  function defineCustomElement$1() {
139
142
  if (typeof customElements === "undefined") {
@@ -1 +1 @@
1
- {"file":"six-alert.js","mappings":";;;;AAAA,MAAM,WAAW,GAAG,u1DAAu1D;;ACG32D,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAC,CAAC;MAsBrFA,UAAQ;;;;;;;;;IA2HX,qBAAgB,GAAG;MACzB,IAAI,CAAC,IAAI,EAAE,CAAC;KACb,CAAC;IAEM,oBAAe,GAAG;MACxB,IAAI,CAAC,eAAe,EAAE,CAAC;KACxB,CAAC;IAEM,wBAAmB,GAAG,CAAC,KAAsB;MACnD,MAAM,MAAM,GAAG,KAAK,CAAC,MAAqB,CAAC;;MAG3C,IAAI,KAAK,CAAC,YAAY,KAAK,SAAS,IAAI,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;QAC1E,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC;QAC3B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;OACjE;KACF,CAAC;qBAtImB,KAAK;gBAGqB,KAAK;oBAGhB,KAAK;gBAG8C,SAAS;oBAM7E,QAAQ;;EAG3B,gBAAgB;IACd,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,GAAG,IAAI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,IAAI,GAAG,OAAO,GAAG,MAAM,EACzC,WAAW,EAAE,IAAI,CAAC,eAAe,EACjC,eAAe,EAAE,IAAI,CAAC,mBAAmB,IAEzC,YAAM,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,aAAa,IACnC,YAAM,IAAI,EAAC,MAAM,GAAG,CACf,EAEP,YAAM,IAAI,EAAC,SAAS,EAAC,KAAK,EAAC,gBAAgB,IACzC,eAAQ,CACH,EAEN,IAAI,CAAC,QAAQ,KACZ,YAAM,KAAK,EAAC,cAAc,IACxB,uBACE,IAAI,EAAC,OAAO,EACZ,WAAW,EAAC,mBAAmB,EAC/B,OAAO,EAAE,IAAI,CAAC,gBAAgB,GACb,CACd,CACR,CACG,EACN;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["SixAlert"],"sources":["src/components/six-alert/six-alert.scss?tag=six-alert&encapsulation=shadow","src/components/six-alert/six-alert.tsx"],"sourcesContent":["@import 'src/global/component';\n@import 'src/global/mixins/hidden';\n\n/**\n * @prop --box-shadow: The alert's box shadow.\n */\n:host {\n display: contents;\n\n // For better DX, we'll reset the margin here so the base part can inherit it\n margin: 0;\n}\n\n.alert {\n position: relative;\n display: flex;\n align-items: stretch;\n background-color: var(--six-color-white);\n border: solid 1px var(--six-color-web-rock-200);\n border-top-width: 3px;\n border-radius: var(--six-border-radius-medium);\n box-shadow: var(--box-shadow);\n font-family: var(--six-font-sans);\n font-size: var(--six-font-size-small);\n font-weight: var(--six-font-weight-normal);\n line-height: 1.6;\n color: var(--six-color-web-rock-700);\n opacity: 0;\n transform: scale(0.9);\n transition: var(--six-transition-medium) opacity ease, var(--six-transition-medium) transform ease;\n margin: inherit;\n\n &:not(.alert--visible) {\n @include hidden;\n }\n}\n\n.alert--open {\n opacity: 1;\n transform: none;\n}\n\n.alert__icon {\n flex: 0 0 auto;\n display: flex;\n align-items: center;\n font-size: var(--six-font-size-large);\n\n ::slotted(*) {\n margin-left: var(--six-spacing-large);\n }\n}\n\n.alert--primary {\n border-top-color: var(--six-color-web-rock-900);\n\n .alert__icon {\n color: var(--six-color-web-rock-900);\n }\n}\n\n.alert--success {\n border-top-color: var(--six-color-success-600);\n\n .alert__icon {\n color: var(--six-color-success-600);\n }\n}\n\n.alert--info {\n border-top-color: var(--six-color-action-500);\n\n .alert__icon {\n color: var(--six-color-action-500);\n }\n}\n\n.alert--warning {\n border-top-color: var(--six-color-warning-800);\n\n .alert__icon {\n color: var(--six-color-warning-800);\n }\n}\n\n.alert--danger {\n border-top-color: var(--six-color-danger-900);\n\n .alert__icon {\n color: var(--six-color-danger-900);\n }\n}\n\n.alert__message {\n flex: 1 1 auto;\n padding: var(--six-spacing-large);\n overflow: hidden;\n}\n\n.alert__close {\n flex: 0 0 auto;\n display: flex;\n align-items: center;\n font-size: var(--six-font-size-large);\n padding-right: var(--six-spacing-medium);\n}\n","import { Component, Element, Event, EventEmitter, Method, Prop, State, Watch, h } from '@stencil/core';\nimport { EmptyPayload } from '../../utils/types';\n\nconst toastStack = Object.assign(document.createElement('div'), { className: 'six-toast-stack' });\n\n/**\n * @since 1.0\n * @status stable\n *\n * Forked from https://github.com/shoelace-style/shoelace version v2.0.0-beta27.\n *\n * @slot - The alert's content.\n * @slot icon - An icon to show in the alert.\n *\n * @part base - The component's base wrapper.\n * @part icon - The container that wraps the alert icon.\n * @part message - The alert message.\n * @part close-button - The close button.\n */\n\n@Component({\n tag: 'six-alert',\n styleUrl: 'six-alert.scss',\n shadow: true,\n})\nexport class SixAlert {\n private autoHideTimeout?: number;\n\n @Element() host!: HTMLSixAlertElement;\n\n @State() isVisible = false;\n\n /** Indicates whether or not the alert is open. You can use this in lieu of the show/hide methods. */\n @Prop({ mutable: true, reflect: true }) open = false;\n\n /** Set to true to make the alert closable. */\n @Prop({ reflect: true }) closable = false;\n\n /** The type of alert. */\n @Prop({ reflect: true }) type: 'primary' | 'success' | 'info' | 'warning' | 'danger' = 'primary';\n\n /**\n * The length of time, in milliseconds, the alert will show before closing itself. If the user interacts with the\n * alert before it closes (e.g. moves the mouse over it), the timer will restart.\n */\n @Prop() duration = Infinity;\n\n @Watch('open')\n handleOpenChange() {\n this.open ? this.show() : this.hide();\n }\n\n @Watch('duration')\n handleDurationChange() {\n this.restartAutoHide();\n }\n\n /** Emitted when the alert opens. Calling `event.preventDefault()` will prevent it from being opened. */\n @Event({ eventName: 'six-alert-show' }) sixShow!: EventEmitter<EmptyPayload>;\n\n /** Emitted after the alert opens and all transitions are complete. */\n @Event({ eventName: 'six-alert-after-show' }) sixAfterShow!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the alert closes. Calling `event.preventDefault()` will prevent it from being closed. */\n @Event({ eventName: 'six-alert-hide' }) sixHide!: EventEmitter<EmptyPayload>;\n\n /** Emitted after the alert closes and all transitions are complete. */\n @Event({ eventName: 'six-alert-after-hide' }) sixAfterHide!: EventEmitter<EmptyPayload>;\n\n componentWillLoad() {\n // Show on init if open\n if (this.open) {\n this.show();\n }\n }\n\n /** Shows the alert. */\n @Method()\n async show() {\n // Prevent subsequent calls to the method, whether manually or triggered by the `open` watcher\n if (this.isVisible) {\n return;\n }\n\n const sixShow = this.sixShow.emit();\n if (sixShow.defaultPrevented) {\n this.open = false;\n return;\n }\n\n this.isVisible = true;\n this.open = true;\n\n if (this.duration < Infinity) {\n this.autoHideTimeout = window.setTimeout(() => this.hide(), this.duration);\n }\n }\n\n /** Hides the alert */\n @Method()\n async hide() {\n // Prevent subsequent calls to the method, whether manually or triggered by the `open` watcher\n if (!this.isVisible) {\n return;\n }\n\n const sixHide = this.sixHide.emit();\n if (sixHide.defaultPrevented) {\n this.open = true;\n return;\n }\n\n clearTimeout(this.autoHideTimeout);\n this.isVisible = false;\n this.open = false;\n }\n\n /**\n * Displays the alert as a toast notification. This will move the alert out of its position in the DOM and, when\n * dismissed, it will be removed from the DOM completely. By storing a reference to the alert, you can reuse it by\n * calling this method again. The returned promise will resolve after the alert is hidden.\n */\n @Method()\n async toast() {\n return new Promise<void>((resolve) => {\n if (!toastStack.parentElement) {\n document.body.append(toastStack);\n }\n\n toastStack.append(this.host);\n requestAnimationFrame(() => this.show());\n\n this.host.addEventListener(\n 'six-alert-after-hide',\n () => {\n this.host.remove();\n resolve();\n\n // Remove the toast stack from the DOM when there are no more alerts\n if (toastStack.querySelector('six-alert') === null) {\n toastStack.remove();\n }\n },\n { once: true }\n );\n });\n }\n\n private handleCloseClick = () => {\n this.hide();\n };\n\n private handleMouseMove = () => {\n this.restartAutoHide();\n };\n\n private handleTransitionEnd = (event: TransitionEvent) => {\n const target = event.target as HTMLElement;\n\n // Ensure we only emit one event when the target element is no longer visible\n if (event.propertyName === 'opacity' && target.classList.contains('alert')) {\n this.isVisible = this.open;\n this.open ? this.sixAfterShow.emit() : this.sixAfterHide.emit();\n }\n };\n\n private restartAutoHide() {\n clearTimeout(this.autoHideTimeout);\n if (this.open && this.duration < Infinity) {\n this.autoHideTimeout = window.setTimeout(() => this.hide(), this.duration);\n }\n }\n\n render() {\n return (\n <div\n part=\"base\"\n class={{\n alert: true,\n 'alert--open': this.open,\n 'alert--visible': this.isVisible,\n 'alert--closable': this.closable,\n 'alert--primary': this.type === 'primary',\n 'alert--success': this.type === 'success',\n 'alert--info': this.type === 'info',\n 'alert--warning': this.type === 'warning',\n 'alert--danger': this.type === 'danger',\n }}\n role=\"alert\"\n aria-live=\"assertive\"\n aria-atomic=\"true\"\n aria-hidden={this.open ? 'false' : 'true'}\n onMouseMove={this.handleMouseMove}\n onTransitionEnd={this.handleTransitionEnd}\n >\n <span part=\"icon\" class=\"alert__icon\">\n <slot name=\"icon\" />\n </span>\n\n <span part=\"message\" class=\"alert__message\">\n <slot />\n </span>\n\n {this.closable && (\n <span class=\"alert__close\">\n <six-icon-button\n name=\"clear\"\n exportparts=\"base:close-button\"\n onClick={this.handleCloseClick}\n ></six-icon-button>\n </span>\n )}\n </div>\n );\n }\n}\n"],"version":3}
1
+ {"file":"six-alert.js","mappings":";;;;AAAA,MAAM,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C,mBAAmB,EAC/B,OAAO,EAAE,IAAI,CAAC,gBAAgB,GACb,CACd,CACR,CACG,EACN;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["SixAlert"],"sources":["src/components/six-alert/six-alert.scss?tag=six-alert&encapsulation=shadow","src/components/six-alert/six-alert.tsx"],"sourcesContent":["@import 'src/global/component';\n@import 'src/global/mixins/hidden';\n\n/**\n * @prop --box-shadow: The alert's box shadow.\n */\n:host {\n display: contents;\n\n // For better DX, we'll reset the margin here so the base part can inherit it\n margin: 0;\n}\n\n.alert {\n position: relative;\n display: flex;\n align-items: stretch;\n background-color: var(--six-color-white);\n border: solid 1px var(--six-color-web-rock-200);\n border-top-width: 3px;\n border-radius: var(--six-border-radius-medium);\n box-shadow: var(--box-shadow);\n font-family: var(--six-font-sans);\n font-size: var(--six-font-size-small);\n font-weight: var(--six-font-weight-normal);\n line-height: 1.6;\n color: var(--six-color-web-rock-700);\n opacity: 0;\n transform: scale(0.9);\n transition: var(--six-transition-medium) opacity ease, var(--six-transition-medium) transform ease;\n margin: inherit;\n\n &:not(.alert--visible) {\n @include hidden;\n }\n}\n\n.alert--open {\n opacity: 1;\n transform: none;\n}\n\n.alert__icon {\n flex: 0 0 auto;\n display: flex;\n align-items: center;\n font-size: var(--six-font-size-large);\n\n ::slotted(*) {\n margin-left: var(--six-spacing-large);\n }\n}\n\n.alert--primary {\n border-top-color: var(--six-color-web-rock-900);\n\n .alert__icon {\n color: var(--six-color-web-rock-900);\n }\n}\n\n.alert--success {\n border-top-color: var(--six-color-success-600);\n\n .alert__icon {\n color: var(--six-color-success-600);\n }\n}\n\n.alert--info {\n border-top-color: var(--six-color-action-500);\n\n .alert__icon {\n color: var(--six-color-action-500);\n }\n}\n\n.alert--warning {\n border-top-color: var(--six-color-warning-800);\n\n .alert__icon {\n color: var(--six-color-warning-800);\n }\n}\n\n.alert--danger {\n border-top-color: var(--six-color-danger-900);\n\n .alert__icon {\n color: var(--six-color-danger-900);\n }\n}\n\n.alert__message {\n flex: 1 1 auto;\n padding: var(--six-spacing-large);\n overflow: hidden;\n}\n\n.alert__close {\n flex: 0 0 auto;\n display: flex;\n align-items: center;\n font-size: var(--six-font-size-large);\n padding-right: var(--six-spacing-medium);\n}\n","import { Component, Element, Event, EventEmitter, Method, Prop, State, Watch, h } from '@stencil/core';\nimport { EmptyPayload } from '../../utils/types';\n\nconst toastStack = Object.assign(document.createElement('div'), { className: 'six-toast-stack' });\n\n/**\n * @since 1.0\n * @status stable\n *\n * Forked from https://github.com/shoelace-style/shoelace version v2.0.0-beta27.\n *\n * @slot - The alert's content.\n * @slot icon - An icon to show in the alert.\n *\n * @part base - The component's base wrapper.\n * @part icon - The container that wraps the alert icon.\n * @part message - The alert message.\n * @part close-button - The close button.\n */\n\n@Component({\n tag: 'six-alert',\n styleUrl: 'six-alert.scss',\n shadow: true,\n})\nexport class SixAlert {\n private autoHideTimeout?: number;\n\n @Element() host!: HTMLSixAlertElement;\n\n @State() isVisible = false;\n\n /** Indicates whether or not the alert is open. You can use this in lieu of the show/hide methods. */\n @Prop({ mutable: true, reflect: true }) open = false;\n\n /** Set to true to make the alert closable. */\n @Prop({ reflect: true }) closable = false;\n\n /** The type of alert. */\n @Prop({ reflect: true }) type: 'primary' | 'success' | 'info' | 'warning' | 'danger' = 'primary';\n\n /**\n * The length of time, in milliseconds, the alert will show before closing itself. If the user interacts with the\n * alert before it closes (e.g. moves the mouse over it), the timer will restart.\n */\n @Prop() duration = Infinity;\n\n @Watch('open')\n handleOpenChange() {\n this.open ? this.show() : this.hide();\n }\n\n @Watch('duration')\n handleDurationChange() {\n this.restartAutoHide();\n }\n\n /** Emitted when the alert opens. Calling `event.preventDefault()` will prevent it from being opened. */\n @Event({ eventName: 'six-alert-show' }) sixShow!: EventEmitter<EmptyPayload>;\n\n /** Emitted after the alert opens and all transitions are complete. */\n @Event({ eventName: 'six-alert-after-show' }) sixAfterShow!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the alert closes. Calling `event.preventDefault()` will prevent it from being closed. */\n @Event({ eventName: 'six-alert-hide' }) sixHide!: EventEmitter<EmptyPayload>;\n\n /** Emitted after the alert closes and all transitions are complete. */\n @Event({ eventName: 'six-alert-after-hide' }) sixAfterHide!: EventEmitter<EmptyPayload>;\n\n componentWillLoad() {\n // Show on init if open\n if (this.open) {\n this.show();\n }\n }\n\n /** Shows the alert. */\n @Method()\n async show() {\n // Prevent subsequent calls to the method, whether manually or triggered by the `open` watcher\n if (this.isVisible) {\n return;\n }\n\n const sixShow = this.sixShow.emit();\n if (sixShow.defaultPrevented) {\n this.open = false;\n return;\n }\n\n this.isVisible = true;\n this.open = true;\n\n if (this.duration < Infinity) {\n this.autoHideTimeout = window.setTimeout(() => this.hide(), this.duration);\n }\n }\n\n /** Hides the alert */\n @Method()\n async hide() {\n // Prevent subsequent calls to the method, whether manually or triggered by the `open` watcher\n if (!this.isVisible) {\n return;\n }\n\n const sixHide = this.sixHide.emit();\n if (sixHide.defaultPrevented) {\n this.open = true;\n return;\n }\n\n clearTimeout(this.autoHideTimeout);\n this.isVisible = false;\n this.open = false;\n }\n\n /**\n * Displays the alert as a toast notification. This will move the alert out of its position in the DOM and, when\n * dismissed, it will be removed from the DOM completely. By storing a reference to the alert, you can reuse it by\n * calling this method again. The returned promise will resolve after the alert is hidden.\n */\n @Method()\n async toast() {\n return new Promise<void>((resolve) => {\n if (!toastStack.parentElement) {\n document.body.append(toastStack);\n }\n\n toastStack.append(this.host);\n requestAnimationFrame(() => this.show());\n\n this.host.addEventListener(\n 'six-alert-after-hide',\n () => {\n this.host.remove();\n resolve();\n\n // Remove the toast stack from the DOM when there are no more alerts\n if (toastStack.querySelector('six-alert') === null) {\n toastStack.remove();\n }\n },\n { once: true }\n );\n });\n }\n\n private handleCloseClick = () => {\n this.hide();\n };\n\n private handleMouseMove = () => {\n this.restartAutoHide();\n };\n\n private handleTransitionEnd = (event: TransitionEvent) => {\n const target = event.target as HTMLElement;\n\n // Ensure we only emit one event when the target element is no longer visible\n if (event.propertyName === 'opacity' && target.classList.contains('alert')) {\n this.isVisible = this.open;\n this.open ? this.sixAfterShow.emit() : this.sixAfterHide.emit();\n }\n };\n\n private restartAutoHide() {\n clearTimeout(this.autoHideTimeout);\n if (this.open && this.duration < Infinity) {\n this.autoHideTimeout = window.setTimeout(() => this.hide(), this.duration);\n }\n }\n\n render() {\n return (\n <div\n part=\"base\"\n class={{\n alert: true,\n 'alert--open': this.open,\n 'alert--visible': this.isVisible,\n 'alert--closable': this.closable,\n 'alert--primary': this.type === 'primary',\n 'alert--success': this.type === 'success',\n 'alert--info': this.type === 'info',\n 'alert--warning': this.type === 'warning',\n 'alert--danger': this.type === 'danger',\n }}\n role=\"alert\"\n aria-live=\"assertive\"\n aria-atomic=\"true\"\n aria-hidden={this.open ? 'false' : 'true'}\n onMouseMove={this.handleMouseMove}\n onTransitionEnd={this.handleTransitionEnd}\n >\n <span part=\"icon\" class=\"alert__icon\">\n <slot name=\"icon\" />\n </span>\n\n <span part=\"message\" class=\"alert__message\">\n <slot />\n </span>\n\n {this.closable && (\n <span class=\"alert__close\">\n <six-icon-button\n name=\"clear\"\n exportparts=\"base:close-button\"\n onClick={this.handleCloseClick}\n ></six-icon-button>\n </span>\n )}\n </div>\n );\n }\n}\n"],"version":3}