@six-group/ui-library 0.0.0-insider.faf050a → 0.0.0-insider.fbc1348

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 (854) hide show
  1. package/dist/cjs/app-globals-3a1e7e63.js +7 -0
  2. package/dist/cjs/app-globals-3a1e7e63.js.map +1 -0
  3. package/dist/cjs/error-messages-6e8049a4.js +119 -0
  4. package/dist/cjs/error-messages-6e8049a4.js.map +1 -0
  5. package/dist/cjs/{form-control-f9bc25dd.js → form-control-de259450.js} +2 -2
  6. package/dist/cjs/{form-control-f9bc25dd.js.map → form-control-de259450.js.map} +1 -1
  7. package/dist/cjs/{index-3baddcdc.js → index-1f707a55.js} +127 -76
  8. package/dist/cjs/index-1f707a55.js.map +1 -0
  9. package/dist/cjs/index.cjs.js +54 -101
  10. package/dist/cjs/index.cjs.js.map +1 -1
  11. package/dist/cjs/loader.cjs.js +5 -3
  12. package/dist/cjs/loader.cjs.js.map +1 -1
  13. package/dist/cjs/{modal-3ce015be.js → modal-bd7fc5bc.js} +1 -18
  14. package/dist/cjs/modal-bd7fc5bc.js.map +1 -0
  15. package/dist/cjs/{popup-40a9adbb.js → popup-e854acda.js} +2 -2
  16. package/dist/cjs/popup-e854acda.js.map +1 -0
  17. package/dist/cjs/six-alert.cjs.entry.js +42 -9
  18. package/dist/cjs/six-alert.cjs.entry.js.map +1 -1
  19. package/dist/cjs/six-avatar.cjs.entry.js +5 -4
  20. package/dist/cjs/six-avatar.cjs.entry.js.map +1 -1
  21. package/dist/cjs/six-badge.cjs.entry.js +6 -5
  22. package/dist/cjs/six-badge.cjs.entry.js.map +1 -1
  23. package/dist/cjs/six-button.cjs.entry.js +8 -6
  24. package/dist/cjs/six-button.cjs.entry.js.map +1 -1
  25. package/dist/cjs/six-card.cjs.entry.js +5 -4
  26. package/dist/cjs/six-card.cjs.entry.js.map +1 -1
  27. package/dist/cjs/six-checkbox_2.cjs.entry.js +192 -0
  28. package/dist/cjs/six-checkbox_2.cjs.entry.js.map +1 -0
  29. package/dist/cjs/six-datepicker.cjs.entry.js +44 -15
  30. package/dist/cjs/six-datepicker.cjs.entry.js.map +1 -1
  31. package/dist/cjs/six-details.cjs.entry.js +7 -6
  32. package/dist/cjs/six-details.cjs.entry.js.map +1 -1
  33. package/dist/cjs/six-dialog.cjs.entry.js +16 -32
  34. package/dist/cjs/six-dialog.cjs.entry.js.map +1 -1
  35. package/dist/cjs/six-drawer.cjs.entry.js +15 -32
  36. package/dist/cjs/six-drawer.cjs.entry.js.map +1 -1
  37. package/dist/cjs/six-dropdown_2.cjs.entry.js +204 -130
  38. package/dist/cjs/six-dropdown_2.cjs.entry.js.map +1 -1
  39. package/dist/cjs/six-error-page.cjs.entry.js +4 -3
  40. package/dist/cjs/six-error-page.cjs.entry.js.map +1 -1
  41. package/dist/cjs/six-error.cjs.entry.js +4 -3
  42. package/dist/cjs/six-error.cjs.entry.js.map +1 -1
  43. package/dist/cjs/six-file-list-item.cjs.entry.js +6 -5
  44. package/dist/cjs/six-file-list-item.cjs.entry.js.map +1 -1
  45. package/dist/cjs/six-file-list.cjs.entry.js +4 -3
  46. package/dist/cjs/six-file-list.cjs.entry.js.map +1 -1
  47. package/dist/cjs/six-file-upload.cjs.entry.js +34 -9
  48. package/dist/cjs/six-file-upload.cjs.entry.js.map +1 -1
  49. package/dist/cjs/six-footer.cjs.entry.js +5 -4
  50. package/dist/cjs/six-footer.cjs.entry.js.map +1 -1
  51. package/dist/cjs/six-group-label.cjs.entry.js +7 -6
  52. package/dist/cjs/six-group-label.cjs.entry.js.map +1 -1
  53. package/dist/cjs/six-header.cjs.entry.js +43 -20
  54. package/dist/cjs/six-header.cjs.entry.js.map +1 -1
  55. package/dist/cjs/six-icon-button.cjs.entry.js +7 -6
  56. package/dist/cjs/six-icon-button.cjs.entry.js.map +1 -1
  57. package/dist/cjs/six-icon.cjs.entry.js +6 -5
  58. package/dist/cjs/six-icon.cjs.entry.js.map +1 -1
  59. package/dist/cjs/six-input.cjs.entry.js +11 -8
  60. package/dist/cjs/six-input.cjs.entry.js.map +1 -1
  61. package/dist/cjs/six-item-picker.cjs.entry.js +106 -9
  62. package/dist/cjs/six-item-picker.cjs.entry.js.map +1 -1
  63. package/dist/cjs/six-language-switcher.cjs.entry.js +11 -6
  64. package/dist/cjs/six-language-switcher.cjs.entry.js.map +1 -1
  65. package/dist/cjs/six-layout-grid.cjs.entry.js +4 -3
  66. package/dist/cjs/six-layout-grid.cjs.entry.js.map +1 -1
  67. package/dist/cjs/six-main-container.cjs.entry.js +4 -3
  68. package/dist/cjs/six-main-container.cjs.entry.js.map +1 -1
  69. package/dist/cjs/six-menu-divider.cjs.entry.js +5 -4
  70. package/dist/cjs/six-menu-divider.cjs.entry.js.map +1 -1
  71. package/dist/cjs/six-menu-label.cjs.entry.js +5 -4
  72. package/dist/cjs/six-menu-label.cjs.entry.js.map +1 -1
  73. package/dist/cjs/six-picto.cjs.entry.js +4 -3
  74. package/dist/cjs/six-picto.cjs.entry.js.map +1 -1
  75. package/dist/cjs/six-progress-bar.cjs.entry.js +6 -5
  76. package/dist/cjs/six-progress-bar.cjs.entry.js.map +1 -1
  77. package/dist/cjs/six-progress-ring.cjs.entry.js +5 -4
  78. package/dist/cjs/six-progress-ring.cjs.entry.js.map +1 -1
  79. package/dist/cjs/six-radio.cjs.entry.js +6 -5
  80. package/dist/cjs/six-radio.cjs.entry.js.map +1 -1
  81. package/dist/cjs/six-range.cjs.entry.js +18 -7
  82. package/dist/cjs/six-range.cjs.entry.js.map +1 -1
  83. package/dist/cjs/six-root.cjs.entry.js +4 -22
  84. package/dist/cjs/six-root.cjs.entry.js.map +1 -1
  85. package/dist/cjs/six-search-field.cjs.entry.js +5 -4
  86. package/dist/cjs/six-search-field.cjs.entry.js.map +1 -1
  87. package/dist/cjs/six-select.cjs.entry.js +340 -182
  88. package/dist/cjs/six-select.cjs.entry.js.map +1 -1
  89. package/dist/cjs/six-sidebar-item-group.cjs.entry.js +5 -4
  90. package/dist/cjs/six-sidebar-item-group.cjs.entry.js.map +1 -1
  91. package/dist/cjs/six-sidebar-item.cjs.entry.js +5 -4
  92. package/dist/cjs/six-sidebar-item.cjs.entry.js.map +1 -1
  93. package/dist/cjs/six-sidebar.cjs.entry.js +6 -5
  94. package/dist/cjs/six-sidebar.cjs.entry.js.map +1 -1
  95. package/dist/cjs/six-spinner.cjs.entry.js +5 -4
  96. package/dist/cjs/six-spinner.cjs.entry.js.map +1 -1
  97. package/dist/cjs/six-stage-indicator.cjs.entry.js +23 -0
  98. package/dist/cjs/six-stage-indicator.cjs.entry.js.map +1 -0
  99. package/dist/cjs/six-switch.cjs.entry.js +8 -7
  100. package/dist/cjs/six-switch.cjs.entry.js.map +1 -1
  101. package/dist/cjs/six-tab-group.cjs.entry.js +35 -9
  102. package/dist/cjs/six-tab-group.cjs.entry.js.map +1 -1
  103. package/dist/cjs/six-tab-panel.cjs.entry.js +5 -4
  104. package/dist/cjs/six-tab-panel.cjs.entry.js.map +1 -1
  105. package/dist/cjs/six-tab.cjs.entry.js +6 -5
  106. package/dist/cjs/six-tab.cjs.entry.js.map +1 -1
  107. package/dist/cjs/six-tag.cjs.entry.js +7 -6
  108. package/dist/cjs/six-tag.cjs.entry.js.map +1 -1
  109. package/dist/cjs/six-textarea.cjs.entry.js +8 -7
  110. package/dist/cjs/six-textarea.cjs.entry.js.map +1 -1
  111. package/dist/cjs/six-tile.cjs.entry.js +8 -7
  112. package/dist/cjs/six-tile.cjs.entry.js.map +1 -1
  113. package/dist/cjs/six-timepicker.cjs.entry.js +8 -7
  114. package/dist/cjs/six-timepicker.cjs.entry.js.map +1 -1
  115. package/dist/cjs/six-tooltip.cjs.entry.js +6 -5
  116. package/dist/cjs/six-tooltip.cjs.entry.js.map +1 -1
  117. package/dist/cjs/{slot-9821749e.js → slot-1b1232a1.js} +1 -3
  118. package/dist/cjs/slot-1b1232a1.js.map +1 -0
  119. package/dist/cjs/{types-0a6d66f6.js → types-d3da200b.js} +3 -1
  120. package/dist/cjs/types-d3da200b.js.map +1 -0
  121. package/dist/cjs/ui-library.cjs.js +6 -4
  122. package/dist/cjs/ui-library.cjs.js.map +1 -1
  123. package/dist/collection/assets/TRADEMARKS.md +3 -3
  124. package/dist/collection/collection-manifest.json +5 -6
  125. package/dist/collection/components/six-alert/six-alert.css +5 -1
  126. package/dist/collection/components/six-alert/six-alert.js +57 -12
  127. package/dist/collection/components/six-alert/six-alert.js.map +1 -1
  128. package/dist/collection/components/six-avatar/six-avatar.css +2 -2
  129. package/dist/collection/components/six-avatar/six-avatar.js +1 -1
  130. package/dist/collection/components/six-avatar/six-avatar.js.map +1 -1
  131. package/dist/collection/components/six-badge/six-badge.css +1 -1
  132. package/dist/collection/components/six-badge/six-badge.js +2 -2
  133. package/dist/collection/components/six-badge/six-badge.js.map +1 -1
  134. package/dist/collection/components/six-button/six-button.css +19 -1
  135. package/dist/collection/components/six-button/six-button.js +8 -6
  136. package/dist/collection/components/six-button/six-button.js.map +1 -1
  137. package/dist/collection/components/six-button/test/six-button.spec.js.map +1 -1
  138. package/dist/collection/components/six-card/six-card.css +4 -5
  139. package/dist/collection/components/six-card/six-card.js +1 -1
  140. package/dist/collection/components/six-card/six-card.js.map +1 -1
  141. package/dist/collection/components/six-checkbox/six-checkbox.css +8 -1
  142. package/dist/collection/components/six-checkbox/six-checkbox.js +5 -4
  143. package/dist/collection/components/six-checkbox/six-checkbox.js.map +1 -1
  144. package/dist/collection/components/six-datepicker/six-date-formats.js +1 -0
  145. package/dist/collection/components/six-datepicker/six-date-formats.js.map +1 -1
  146. package/dist/collection/components/six-datepicker/six-datepicker.css +1 -1
  147. package/dist/collection/components/six-datepicker/six-datepicker.js +20 -16
  148. package/dist/collection/components/six-datepicker/six-datepicker.js.map +1 -1
  149. package/dist/collection/components/six-details/six-details.css +1 -5
  150. package/dist/collection/components/six-details/six-details.js +3 -3
  151. package/dist/collection/components/six-details/six-details.js.map +1 -1
  152. package/dist/collection/components/six-dialog/six-dialog.css +2 -2
  153. package/dist/collection/components/six-dialog/six-dialog.js +10 -28
  154. package/dist/collection/components/six-dialog/six-dialog.js.map +1 -1
  155. package/dist/collection/components/six-drawer/six-drawer.css +2 -2
  156. package/dist/collection/components/six-drawer/six-drawer.js +9 -28
  157. package/dist/collection/components/six-drawer/six-drawer.js.map +1 -1
  158. package/dist/collection/components/six-dropdown/six-dropdown.css +22 -7
  159. package/dist/collection/components/six-dropdown/six-dropdown.js +216 -124
  160. package/dist/collection/components/six-dropdown/six-dropdown.js.map +1 -1
  161. package/dist/collection/components/six-dropdown/test/six-dropdown.spec.js +54 -29
  162. package/dist/collection/components/six-dropdown/test/six-dropdown.spec.js.map +1 -1
  163. package/dist/collection/components/six-error/six-error.js +1 -1
  164. package/dist/collection/components/six-error/six-error.js.map +1 -1
  165. package/dist/collection/components/six-error-page/six-error-page.js +1 -1
  166. package/dist/collection/components/six-error-page/six-error-page.js.map +1 -1
  167. package/dist/collection/components/six-file-list/six-file-list.js +1 -1
  168. package/dist/collection/components/six-file-list/six-file-list.js.map +1 -1
  169. package/dist/collection/components/six-file-list-item/six-file-list-item.css +1 -1
  170. package/dist/collection/components/six-file-list-item/six-file-list-item.js +2 -2
  171. package/dist/collection/components/six-file-list-item/six-file-list-item.js.map +1 -1
  172. package/dist/collection/components/six-file-upload/six-file-upload.css +12 -4
  173. package/dist/collection/components/six-file-upload/six-file-upload.js +87 -7
  174. package/dist/collection/components/six-file-upload/six-file-upload.js.map +1 -1
  175. package/dist/collection/components/six-file-upload/test/six-file-upload.spec.js +187 -24
  176. package/dist/collection/components/six-file-upload/test/six-file-upload.spec.js.map +1 -1
  177. package/dist/collection/components/six-footer/six-footer.css +2 -2
  178. package/dist/collection/components/six-footer/six-footer.js +1 -1
  179. package/dist/collection/components/six-footer/six-footer.js.map +1 -1
  180. package/dist/collection/components/six-group-label/six-group-label.css +1 -1
  181. package/dist/collection/components/six-group-label/six-group-label.js +1 -1
  182. package/dist/collection/components/six-group-label/six-group-label.js.map +1 -1
  183. package/dist/collection/components/six-header/six-header.css +15 -2
  184. package/dist/collection/components/six-header/six-header.js +77 -18
  185. package/dist/collection/components/six-header/six-header.js.map +1 -1
  186. package/dist/collection/components/six-icon/six-icon.css +5 -2
  187. package/dist/collection/components/six-icon/six-icon.js +2 -2
  188. package/dist/collection/components/six-icon/six-icon.js.map +1 -1
  189. package/dist/collection/components/six-icon-button/six-icon-button.css +1 -1
  190. package/dist/collection/components/six-icon-button/six-icon-button.js +3 -3
  191. package/dist/collection/components/six-icon-button/six-icon-button.js.map +1 -1
  192. package/dist/collection/components/six-input/six-input.css +10 -1
  193. package/dist/collection/components/six-input/six-input.js +47 -19
  194. package/dist/collection/components/six-input/six-input.js.map +1 -1
  195. package/dist/collection/components/six-item-picker/six-item-picker.css +8 -0
  196. package/dist/collection/components/six-item-picker/six-item-picker.js +101 -5
  197. package/dist/collection/components/six-item-picker/six-item-picker.js.map +1 -1
  198. package/dist/collection/components/six-item-picker/test/six-item-picker.spec.js +57 -57
  199. package/dist/collection/components/six-item-picker/test/six-item-picker.spec.js.map +1 -1
  200. package/dist/collection/components/six-item-picker/types.js +2 -0
  201. package/dist/collection/components/six-item-picker/types.js.map +1 -1
  202. package/dist/collection/components/six-language-switcher/six-language-switcher.css +7 -2
  203. package/dist/collection/components/six-language-switcher/six-language-switcher.js +7 -3
  204. package/dist/collection/components/six-language-switcher/six-language-switcher.js.map +1 -1
  205. package/dist/collection/components/six-language-switcher/test/six-language-switcher.spec.js +20 -20
  206. package/dist/collection/components/six-language-switcher/test/six-language-switcher.spec.js.map +1 -1
  207. package/dist/collection/components/six-layout-grid/six-layout-grid.js +1 -1
  208. package/dist/collection/components/six-layout-grid/six-layout-grid.js.map +1 -1
  209. package/dist/collection/components/six-main-container/six-main-container.js +1 -1
  210. package/dist/collection/components/six-main-container/six-main-container.js.map +1 -1
  211. package/dist/collection/components/six-menu/six-menu.css +8 -7
  212. package/dist/collection/components/six-menu/six-menu.js +30 -8
  213. package/dist/collection/components/six-menu/six-menu.js.map +1 -1
  214. package/dist/collection/components/six-menu/test/six-menu.spec.js +6 -6
  215. package/dist/collection/components/six-menu/test/six-menu.spec.js.map +1 -1
  216. package/dist/collection/components/six-menu-divider/six-menu-divider.css +3 -2
  217. package/dist/collection/components/six-menu-divider/six-menu-divider.js +1 -1
  218. package/dist/collection/components/six-menu-divider/six-menu-divider.js.map +1 -1
  219. package/dist/collection/components/six-menu-item/six-menu-item.css +13 -2
  220. package/dist/collection/components/six-menu-item/six-menu-item.js +37 -8
  221. package/dist/collection/components/six-menu-item/six-menu-item.js.map +1 -1
  222. package/dist/collection/components/six-menu-label/six-menu-label.css +1 -1
  223. package/dist/collection/components/six-menu-label/six-menu-label.js +1 -1
  224. package/dist/collection/components/six-menu-label/six-menu-label.js.map +1 -1
  225. package/dist/collection/components/six-picto/six-picto.js +1 -1
  226. package/dist/collection/components/six-picto/six-picto.js.map +1 -1
  227. package/dist/collection/components/six-progress-bar/six-progress-bar.css +1 -1
  228. package/dist/collection/components/six-progress-bar/six-progress-bar.js +2 -2
  229. package/dist/collection/components/six-progress-bar/six-progress-bar.js.map +1 -1
  230. package/dist/collection/components/six-progress-ring/six-progress-ring.css +1 -1
  231. package/dist/collection/components/six-progress-ring/six-progress-ring.js +1 -1
  232. package/dist/collection/components/six-progress-ring/six-progress-ring.js.map +1 -1
  233. package/dist/collection/components/six-radio/six-radio.css +1 -1
  234. package/dist/collection/components/six-radio/six-radio.js +5 -4
  235. package/dist/collection/components/six-radio/six-radio.js.map +1 -1
  236. package/dist/collection/components/six-range/six-range.css +2 -2
  237. package/dist/collection/components/six-range/six-range.js +15 -4
  238. package/dist/collection/components/six-range/six-range.js.map +1 -1
  239. package/dist/collection/components/six-root/six-root.js +1 -69
  240. package/dist/collection/components/six-root/six-root.js.map +1 -1
  241. package/dist/collection/components/six-root/test/six-root.spec.js +0 -7
  242. package/dist/collection/components/six-root/test/six-root.spec.js.map +1 -1
  243. package/dist/collection/components/six-search-field/six-search-field.css +1 -1
  244. package/dist/collection/components/six-search-field/six-search-field.js +1 -1
  245. package/dist/collection/components/six-search-field/six-search-field.js.map +1 -1
  246. package/dist/collection/components/six-select/six-select.css +54 -66
  247. package/dist/collection/components/six-select/six-select.js +351 -183
  248. package/dist/collection/components/six-select/six-select.js.map +1 -1
  249. package/dist/collection/components/six-select/test/six-select.spec.js +31 -15
  250. package/dist/collection/components/six-select/test/six-select.spec.js.map +1 -1
  251. package/dist/collection/components/six-select/test/util.spec.js +23 -1
  252. package/dist/collection/components/six-select/test/util.spec.js.map +1 -1
  253. package/dist/collection/components/six-select/util.js +24 -0
  254. package/dist/collection/components/six-select/util.js.map +1 -1
  255. package/dist/collection/components/six-sidebar/six-sidebar.css +2 -2
  256. package/dist/collection/components/six-sidebar/six-sidebar.js +8 -6
  257. package/dist/collection/components/six-sidebar/six-sidebar.js.map +1 -1
  258. package/dist/collection/components/six-sidebar-item/six-sidebar-item.js +2 -2
  259. package/dist/collection/components/six-sidebar-item/six-sidebar-item.js.map +1 -1
  260. package/dist/collection/components/six-sidebar-item-group/six-sidebar-item-group.css +2 -1
  261. package/dist/collection/components/six-sidebar-item-group/six-sidebar-item-group.js.map +1 -1
  262. package/dist/collection/components/six-spinner/six-spinner.css +1 -1
  263. package/dist/collection/components/six-spinner/six-spinner.js +2 -1
  264. package/dist/collection/components/six-spinner/six-spinner.js.map +1 -1
  265. package/dist/collection/components/six-spinner/test/six-spinner.spec.js +1 -1
  266. package/dist/collection/components/six-spinner/test/six-spinner.spec.js.map +1 -1
  267. package/dist/collection/components/six-stage-indicator/six-stage-indicator.css +1 -1
  268. package/dist/collection/components/six-switch/six-switch.css +1 -1
  269. package/dist/collection/components/six-switch/six-switch.js +5 -4
  270. package/dist/collection/components/six-switch/six-switch.js.map +1 -1
  271. package/dist/collection/components/six-tab/six-tab.css +1 -1
  272. package/dist/collection/components/six-tab/six-tab.js +5 -4
  273. package/dist/collection/components/six-tab/six-tab.js.map +1 -1
  274. package/dist/collection/components/six-tab-group/six-tab-group.css +1 -1
  275. package/dist/collection/components/six-tab-group/six-tab-group.js +36 -9
  276. package/dist/collection/components/six-tab-group/six-tab-group.js.map +1 -1
  277. package/dist/collection/components/six-tab-panel/six-tab-panel.css +1 -1
  278. package/dist/collection/components/six-tab-panel/six-tab-panel.js +1 -1
  279. package/dist/collection/components/six-tab-panel/six-tab-panel.js.map +1 -1
  280. package/dist/collection/components/six-tag/six-tag.css +1 -1
  281. package/dist/collection/components/six-tag/six-tag.js +2 -2
  282. package/dist/collection/components/six-tag/six-tag.js.map +1 -1
  283. package/dist/collection/components/six-textarea/six-textarea.css +1 -1
  284. package/dist/collection/components/six-textarea/six-textarea.js +26 -18
  285. package/dist/collection/components/six-textarea/six-textarea.js.map +1 -1
  286. package/dist/collection/components/six-textarea/test/six-textarea.spec.js.map +1 -1
  287. package/dist/collection/components/six-tile/six-tile.css +2 -2
  288. package/dist/collection/components/six-tile/six-tile.js +3 -3
  289. package/dist/collection/components/six-tile/six-tile.js.map +1 -1
  290. package/dist/collection/components/six-timepicker/six-timepicker.css +1 -1
  291. package/dist/collection/components/six-timepicker/six-timepicker.js +4 -3
  292. package/dist/collection/components/six-timepicker/six-timepicker.js.map +1 -1
  293. package/dist/collection/components/six-timepicker/test/six-timepicker.spec.js.map +1 -1
  294. package/dist/collection/components/six-tooltip/six-tooltip.css +1 -1
  295. package/dist/collection/components/six-tooltip/six-tooltip.js +2 -2
  296. package/dist/collection/components/six-tooltip/six-tooltip.js.map +1 -1
  297. package/dist/collection/index.js +1 -0
  298. package/dist/collection/index.js.map +1 -1
  299. package/dist/collection/utils/alert.js +54 -0
  300. package/dist/collection/utils/alert.js.map +1 -0
  301. package/dist/collection/utils/date-util.js +25 -0
  302. package/dist/collection/utils/date-util.js.map +1 -1
  303. package/dist/collection/utils/date-util.spec.js.map +1 -1
  304. package/dist/collection/utils/error-messages.js +7 -0
  305. package/dist/collection/utils/error-messages.js.map +1 -1
  306. package/dist/collection/utils/event-listeners.js.map +1 -1
  307. package/dist/collection/utils/focus-visible.js.map +1 -1
  308. package/dist/collection/utils/form.js.map +1 -1
  309. package/dist/collection/utils/modal.js.map +1 -1
  310. package/dist/collection/utils/popover.js.map +1 -1
  311. package/dist/collection/utils/popup.js +1 -1
  312. package/dist/collection/utils/popup.js.map +1 -1
  313. package/dist/collection/utils/scroll.js.map +1 -1
  314. package/dist/collection/utils/slot.js +0 -1
  315. package/dist/collection/utils/slot.js.map +1 -1
  316. package/dist/collection/utils/tabbable.js.map +1 -1
  317. package/dist/collection/utils/time.util.js.map +1 -1
  318. package/dist/collection/utils/time.util.spec.js.map +1 -1
  319. package/dist/components/index.js +50 -102
  320. package/dist/components/index.js.map +1 -1
  321. package/dist/components/modal.js +1 -17
  322. package/dist/components/modal.js.map +1 -1
  323. package/dist/components/six-alert.js +41 -8
  324. package/dist/components/six-alert.js.map +1 -1
  325. package/dist/components/six-avatar.js +4 -3
  326. package/dist/components/six-avatar.js.map +1 -1
  327. package/dist/components/six-badge.js +5 -4
  328. package/dist/components/six-badge.js.map +1 -1
  329. package/dist/components/six-button.js +1 -142
  330. package/dist/components/six-button.js.map +1 -1
  331. package/dist/components/six-button2.js +148 -0
  332. package/dist/components/six-button2.js.map +1 -0
  333. package/dist/components/six-card.js +4 -3
  334. package/dist/components/six-card.js.map +1 -1
  335. package/dist/components/six-checkbox.js +1 -161
  336. package/dist/components/six-checkbox.js.map +1 -1
  337. package/dist/components/six-checkbox2.js +166 -0
  338. package/dist/components/six-checkbox2.js.map +1 -0
  339. package/dist/components/six-datepicker.js +41 -12
  340. package/dist/components/six-datepicker.js.map +1 -1
  341. package/dist/components/six-details2.js +6 -5
  342. package/dist/components/six-details2.js.map +1 -1
  343. package/dist/components/six-dialog.js +14 -30
  344. package/dist/components/six-dialog.js.map +1 -1
  345. package/dist/components/six-drawer.js +13 -30
  346. package/dist/components/six-drawer.js.map +1 -1
  347. package/dist/components/six-dropdown2.js +204 -127
  348. package/dist/components/six-dropdown2.js.map +1 -1
  349. package/dist/components/six-error-page.js +3 -2
  350. package/dist/components/six-error-page.js.map +1 -1
  351. package/dist/components/six-error2.js +3 -2
  352. package/dist/components/six-error2.js.map +1 -1
  353. package/dist/components/six-file-list-item.js +5 -4
  354. package/dist/components/six-file-list-item.js.map +1 -1
  355. package/dist/components/six-file-list.js +3 -2
  356. package/dist/components/six-file-list.js.map +1 -1
  357. package/dist/components/six-file-upload.js +53 -12
  358. package/dist/components/six-file-upload.js.map +1 -1
  359. package/dist/components/six-footer.js +4 -3
  360. package/dist/components/six-footer.js.map +1 -1
  361. package/dist/components/six-group-label.js +4 -3
  362. package/dist/components/six-group-label.js.map +1 -1
  363. package/dist/components/six-header.js +50 -19
  364. package/dist/components/six-header.js.map +1 -1
  365. package/dist/components/six-icon-button2.js +6 -5
  366. package/dist/components/six-icon-button2.js.map +1 -1
  367. package/dist/components/six-icon2.js +5 -4
  368. package/dist/components/six-icon2.js.map +1 -1
  369. package/dist/components/six-input2.js +9 -5
  370. package/dist/components/six-input2.js.map +1 -1
  371. package/dist/components/six-item-picker2.js +106 -7
  372. package/dist/components/six-item-picker2.js.map +1 -1
  373. package/dist/components/six-language-switcher.js +10 -5
  374. package/dist/components/six-language-switcher.js.map +1 -1
  375. package/dist/components/six-layout-grid.js +3 -2
  376. package/dist/components/six-layout-grid.js.map +1 -1
  377. package/dist/components/six-main-container.js +3 -2
  378. package/dist/components/six-main-container.js.map +1 -1
  379. package/dist/components/six-menu-divider.js +4 -3
  380. package/dist/components/six-menu-divider.js.map +1 -1
  381. package/dist/components/six-menu-item2.js +31 -7
  382. package/dist/components/six-menu-item2.js.map +1 -1
  383. package/dist/components/six-menu-label.js +4 -3
  384. package/dist/components/six-menu-label.js.map +1 -1
  385. package/dist/components/six-menu2.js +26 -9
  386. package/dist/components/six-menu2.js.map +1 -1
  387. package/dist/components/six-picto2.js +3 -2
  388. package/dist/components/six-picto2.js.map +1 -1
  389. package/dist/components/six-progress-bar.js +5 -4
  390. package/dist/components/six-progress-bar.js.map +1 -1
  391. package/dist/components/six-progress-ring.js +4 -3
  392. package/dist/components/six-progress-ring.js.map +1 -1
  393. package/dist/components/six-radio.js +5 -4
  394. package/dist/components/six-radio.js.map +1 -1
  395. package/dist/components/six-range.js +15 -4
  396. package/dist/components/six-range.js.map +1 -1
  397. package/dist/components/six-root.js +6 -34
  398. package/dist/components/six-root.js.map +1 -1
  399. package/dist/components/six-search-field.js +4 -3
  400. package/dist/components/six-search-field.js.map +1 -1
  401. package/dist/components/six-select.js +478 -201
  402. package/dist/components/six-select.js.map +1 -1
  403. package/dist/components/six-sidebar-item-group.js +3 -2
  404. package/dist/components/six-sidebar-item-group.js.map +1 -1
  405. package/dist/components/six-sidebar-item.js +4 -3
  406. package/dist/components/six-sidebar-item.js.map +1 -1
  407. package/dist/components/six-sidebar.js +5 -4
  408. package/dist/components/six-sidebar.js.map +1 -1
  409. package/dist/components/six-spinner2.js +4 -3
  410. package/dist/components/six-spinner2.js.map +1 -1
  411. package/dist/components/six-stage-indicator2.js +3 -2
  412. package/dist/components/six-stage-indicator2.js.map +1 -1
  413. package/dist/components/six-switch.js +5 -4
  414. package/dist/components/six-switch.js.map +1 -1
  415. package/dist/components/six-tab-group.js +36 -9
  416. package/dist/components/six-tab-group.js.map +1 -1
  417. package/dist/components/six-tab-panel.js +4 -3
  418. package/dist/components/six-tab-panel.js.map +1 -1
  419. package/dist/components/six-tab.js +5 -4
  420. package/dist/components/six-tab.js.map +1 -1
  421. package/dist/components/six-tag.js +99 -1
  422. package/dist/components/six-tag.js.map +1 -1
  423. package/dist/components/six-textarea.js +5 -4
  424. package/dist/components/six-textarea.js.map +1 -1
  425. package/dist/components/six-tile.js +6 -5
  426. package/dist/components/six-tile.js.map +1 -1
  427. package/dist/components/six-timepicker2.js +5 -4
  428. package/dist/components/six-timepicker2.js.map +1 -1
  429. package/dist/components/six-tooltip2.js +5 -4
  430. package/dist/components/six-tooltip2.js.map +1 -1
  431. package/dist/components/slot.js +1 -2
  432. package/dist/components/slot.js.map +1 -1
  433. package/dist/components.d.ts +1 -21
  434. package/dist/components.json +741 -242
  435. package/dist/esm/app-globals-0f993ce5.js +5 -0
  436. package/dist/esm/app-globals-0f993ce5.js.map +1 -0
  437. package/dist/esm/error-messages-1eaaad23.js +115 -0
  438. package/dist/esm/error-messages-1eaaad23.js.map +1 -0
  439. package/dist/esm/{form-control-6b30894f.js → form-control-30c5bd8b.js} +2 -2
  440. package/dist/esm/{form-control-6b30894f.js.map → form-control-30c5bd8b.js.map} +1 -1
  441. package/dist/esm/{index-17d8173e.js → index-5390c1d6.js} +127 -76
  442. package/dist/esm/index-5390c1d6.js.map +1 -0
  443. package/dist/esm/index.js +51 -100
  444. package/dist/esm/index.js.map +1 -1
  445. package/dist/esm/loader.js +6 -4
  446. package/dist/esm/loader.js.map +1 -1
  447. package/dist/esm/{modal-96526245.js → modal-6c1288e3.js} +2 -18
  448. package/dist/esm/modal-6c1288e3.js.map +1 -0
  449. package/dist/esm/{popup-e8049817.js → popup-7209e9d5.js} +2 -2
  450. package/dist/esm/popup-7209e9d5.js.map +1 -0
  451. package/dist/esm/six-alert.entry.js +42 -9
  452. package/dist/esm/six-alert.entry.js.map +1 -1
  453. package/dist/esm/six-avatar.entry.js +5 -4
  454. package/dist/esm/six-avatar.entry.js.map +1 -1
  455. package/dist/esm/six-badge.entry.js +6 -5
  456. package/dist/esm/six-badge.entry.js.map +1 -1
  457. package/dist/esm/six-button.entry.js +8 -6
  458. package/dist/esm/six-button.entry.js.map +1 -1
  459. package/dist/esm/six-card.entry.js +5 -4
  460. package/dist/esm/six-card.entry.js.map +1 -1
  461. package/dist/esm/six-checkbox_2.entry.js +187 -0
  462. package/dist/esm/six-checkbox_2.entry.js.map +1 -0
  463. package/dist/esm/six-datepicker.entry.js +44 -15
  464. package/dist/esm/six-datepicker.entry.js.map +1 -1
  465. package/dist/esm/six-details.entry.js +7 -6
  466. package/dist/esm/six-details.entry.js.map +1 -1
  467. package/dist/esm/six-dialog.entry.js +16 -32
  468. package/dist/esm/six-dialog.entry.js.map +1 -1
  469. package/dist/esm/six-drawer.entry.js +15 -32
  470. package/dist/esm/six-drawer.entry.js.map +1 -1
  471. package/dist/esm/six-dropdown_2.entry.js +205 -131
  472. package/dist/esm/six-dropdown_2.entry.js.map +1 -1
  473. package/dist/esm/six-error-page.entry.js +4 -3
  474. package/dist/esm/six-error-page.entry.js.map +1 -1
  475. package/dist/esm/six-error.entry.js +4 -3
  476. package/dist/esm/six-error.entry.js.map +1 -1
  477. package/dist/esm/six-file-list-item.entry.js +6 -5
  478. package/dist/esm/six-file-list-item.entry.js.map +1 -1
  479. package/dist/esm/six-file-list.entry.js +4 -3
  480. package/dist/esm/six-file-list.entry.js.map +1 -1
  481. package/dist/esm/six-file-upload.entry.js +34 -9
  482. package/dist/esm/six-file-upload.entry.js.map +1 -1
  483. package/dist/esm/six-footer.entry.js +5 -4
  484. package/dist/esm/six-footer.entry.js.map +1 -1
  485. package/dist/esm/six-group-label.entry.js +7 -6
  486. package/dist/esm/six-group-label.entry.js.map +1 -1
  487. package/dist/esm/six-header.entry.js +43 -20
  488. package/dist/esm/six-header.entry.js.map +1 -1
  489. package/dist/esm/six-icon-button.entry.js +7 -6
  490. package/dist/esm/six-icon-button.entry.js.map +1 -1
  491. package/dist/esm/six-icon.entry.js +6 -5
  492. package/dist/esm/six-icon.entry.js.map +1 -1
  493. package/dist/esm/six-input.entry.js +11 -8
  494. package/dist/esm/six-input.entry.js.map +1 -1
  495. package/dist/esm/six-item-picker.entry.js +106 -9
  496. package/dist/esm/six-item-picker.entry.js.map +1 -1
  497. package/dist/esm/six-language-switcher.entry.js +11 -6
  498. package/dist/esm/six-language-switcher.entry.js.map +1 -1
  499. package/dist/esm/six-layout-grid.entry.js +4 -3
  500. package/dist/esm/six-layout-grid.entry.js.map +1 -1
  501. package/dist/esm/six-main-container.entry.js +4 -3
  502. package/dist/esm/six-main-container.entry.js.map +1 -1
  503. package/dist/esm/six-menu-divider.entry.js +5 -4
  504. package/dist/esm/six-menu-divider.entry.js.map +1 -1
  505. package/dist/esm/six-menu-label.entry.js +5 -4
  506. package/dist/esm/six-menu-label.entry.js.map +1 -1
  507. package/dist/esm/six-picto.entry.js +4 -3
  508. package/dist/esm/six-picto.entry.js.map +1 -1
  509. package/dist/esm/six-progress-bar.entry.js +6 -5
  510. package/dist/esm/six-progress-bar.entry.js.map +1 -1
  511. package/dist/esm/six-progress-ring.entry.js +5 -4
  512. package/dist/esm/six-progress-ring.entry.js.map +1 -1
  513. package/dist/esm/six-radio.entry.js +6 -5
  514. package/dist/esm/six-radio.entry.js.map +1 -1
  515. package/dist/esm/six-range.entry.js +18 -7
  516. package/dist/esm/six-range.entry.js.map +1 -1
  517. package/dist/esm/six-root.entry.js +4 -22
  518. package/dist/esm/six-root.entry.js.map +1 -1
  519. package/dist/esm/six-search-field.entry.js +5 -4
  520. package/dist/esm/six-search-field.entry.js.map +1 -1
  521. package/dist/esm/six-select.entry.js +340 -182
  522. package/dist/esm/six-select.entry.js.map +1 -1
  523. package/dist/esm/six-sidebar-item-group.entry.js +5 -4
  524. package/dist/esm/six-sidebar-item-group.entry.js.map +1 -1
  525. package/dist/esm/six-sidebar-item.entry.js +5 -4
  526. package/dist/esm/six-sidebar-item.entry.js.map +1 -1
  527. package/dist/esm/six-sidebar.entry.js +6 -5
  528. package/dist/esm/six-sidebar.entry.js.map +1 -1
  529. package/dist/esm/six-spinner.entry.js +5 -4
  530. package/dist/esm/six-spinner.entry.js.map +1 -1
  531. package/dist/esm/six-stage-indicator.entry.js +19 -0
  532. package/dist/esm/six-stage-indicator.entry.js.map +1 -0
  533. package/dist/esm/six-switch.entry.js +8 -7
  534. package/dist/esm/six-switch.entry.js.map +1 -1
  535. package/dist/esm/six-tab-group.entry.js +35 -9
  536. package/dist/esm/six-tab-group.entry.js.map +1 -1
  537. package/dist/esm/six-tab-panel.entry.js +5 -4
  538. package/dist/esm/six-tab-panel.entry.js.map +1 -1
  539. package/dist/esm/six-tab.entry.js +6 -5
  540. package/dist/esm/six-tab.entry.js.map +1 -1
  541. package/dist/esm/six-tag.entry.js +7 -6
  542. package/dist/esm/six-tag.entry.js.map +1 -1
  543. package/dist/esm/six-textarea.entry.js +8 -7
  544. package/dist/esm/six-textarea.entry.js.map +1 -1
  545. package/dist/esm/six-tile.entry.js +8 -7
  546. package/dist/esm/six-tile.entry.js.map +1 -1
  547. package/dist/esm/six-timepicker.entry.js +8 -7
  548. package/dist/esm/six-timepicker.entry.js.map +1 -1
  549. package/dist/esm/six-tooltip.entry.js +6 -5
  550. package/dist/esm/six-tooltip.entry.js.map +1 -1
  551. package/dist/esm/{slot-41bc439a.js → slot-56531341.js} +2 -3
  552. package/dist/esm/slot-56531341.js.map +1 -0
  553. package/dist/esm/{types-07748c42.js → types-a07bb999.js} +3 -1
  554. package/dist/esm/types-a07bb999.js.map +1 -0
  555. package/dist/esm/ui-library.js +7 -5
  556. package/dist/esm/ui-library.js.map +1 -1
  557. package/dist/types/components/six-alert/six-alert.d.ts +13 -6
  558. package/dist/types/components/six-button/six-button.d.ts +1 -1
  559. package/dist/types/components/six-datepicker/six-datepicker.d.ts +1 -1
  560. package/dist/types/components/six-dialog/six-dialog.d.ts +1 -0
  561. package/dist/types/components/six-dropdown/six-dropdown.d.ts +28 -9
  562. package/dist/types/components/six-file-upload/six-file-upload.d.ts +10 -0
  563. package/dist/types/components/six-header/six-header.d.ts +8 -2
  564. package/dist/types/components/six-input/six-input.d.ts +4 -0
  565. package/dist/types/components/six-item-picker/six-item-picker.d.ts +7 -0
  566. package/dist/types/components/six-menu/six-menu.d.ts +4 -0
  567. package/dist/types/components/six-menu-item/six-menu-item.d.ts +7 -1
  568. package/dist/types/components/six-range/six-range.d.ts +2 -0
  569. package/dist/types/components/six-root/six-root.d.ts +0 -13
  570. package/dist/types/components/six-select/six-select.d.ts +27 -13
  571. package/dist/types/components/six-select/util.d.ts +2 -0
  572. package/dist/types/components/six-spinner/six-spinner.d.ts +1 -0
  573. package/dist/types/components/six-tab-group/six-tab-group.d.ts +4 -1
  574. package/dist/types/components.d.ts +120 -62
  575. package/dist/types/index.d.ts +1 -0
  576. package/dist/types/types.d.ts +1 -0
  577. package/dist/types/utils/alert.d.ts +10 -0
  578. package/dist/types/utils/date-util.d.ts +9 -1
  579. package/dist/types/utils/error-messages.d.ts +1 -0
  580. package/dist/types/utils/slot.d.ts +0 -1
  581. package/dist/ui-library/assets/TRADEMARKS.md +3 -3
  582. package/dist/ui-library/index.esm.js +1 -1
  583. package/dist/ui-library/index.esm.js.map +1 -1
  584. package/dist/ui-library/p-030fa1fa.entry.js +2 -0
  585. package/dist/ui-library/p-030fa1fa.entry.js.map +1 -0
  586. package/dist/ui-library/p-03d1b956.entry.js +2 -0
  587. package/dist/ui-library/p-03d1b956.entry.js.map +1 -0
  588. package/dist/ui-library/p-047d02ad.entry.js +2 -0
  589. package/dist/ui-library/p-047d02ad.entry.js.map +1 -0
  590. package/dist/ui-library/p-05eb1bab.js +3 -0
  591. package/dist/ui-library/p-05eb1bab.js.map +1 -0
  592. package/dist/ui-library/p-060069d4.entry.js +2 -0
  593. package/dist/ui-library/p-060069d4.entry.js.map +1 -0
  594. package/dist/ui-library/p-06ba653e.entry.js +2 -0
  595. package/dist/ui-library/p-06ba653e.entry.js.map +1 -0
  596. package/dist/ui-library/p-07c8de65.entry.js +2 -0
  597. package/dist/ui-library/p-07c8de65.entry.js.map +1 -0
  598. package/dist/ui-library/p-0cebf1d2.js +2 -0
  599. package/dist/ui-library/p-0cebf1d2.js.map +1 -0
  600. package/dist/ui-library/p-0fb3fb30.entry.js +2 -0
  601. package/dist/ui-library/p-0fb3fb30.entry.js.map +1 -0
  602. package/dist/ui-library/p-14e5fccc.entry.js +2 -0
  603. package/dist/ui-library/p-14e5fccc.entry.js.map +1 -0
  604. package/dist/ui-library/p-189602e4.entry.js +2 -0
  605. package/dist/ui-library/p-189602e4.entry.js.map +1 -0
  606. package/dist/ui-library/p-19560508.entry.js +2 -0
  607. package/dist/ui-library/p-19560508.entry.js.map +1 -0
  608. package/dist/ui-library/p-21074819.entry.js +2 -0
  609. package/dist/ui-library/p-21074819.entry.js.map +1 -0
  610. package/dist/ui-library/p-2386627e.entry.js +2 -0
  611. package/dist/ui-library/p-2386627e.entry.js.map +1 -0
  612. package/dist/ui-library/p-2c25cb61.entry.js +2 -0
  613. package/dist/ui-library/p-2c25cb61.entry.js.map +1 -0
  614. package/dist/ui-library/p-32e421a3.entry.js +2 -0
  615. package/dist/ui-library/p-32e421a3.entry.js.map +1 -0
  616. package/dist/ui-library/p-3603dd96.entry.js +2 -0
  617. package/dist/ui-library/p-3603dd96.entry.js.map +1 -0
  618. package/dist/ui-library/p-39ff5f61.entry.js +2 -0
  619. package/dist/ui-library/p-39ff5f61.entry.js.map +1 -0
  620. package/dist/ui-library/p-3b5a76ea.entry.js +2 -0
  621. package/dist/ui-library/p-3b5a76ea.entry.js.map +1 -0
  622. package/dist/ui-library/p-419ed003.entry.js +2 -0
  623. package/dist/ui-library/p-419ed003.entry.js.map +1 -0
  624. package/dist/ui-library/p-45003bae.entry.js +2 -0
  625. package/dist/ui-library/p-45003bae.entry.js.map +1 -0
  626. package/dist/ui-library/p-4963f03c.entry.js +2 -0
  627. package/dist/ui-library/p-4963f03c.entry.js.map +1 -0
  628. package/dist/ui-library/p-4d89932f.entry.js +2 -0
  629. package/dist/ui-library/p-4d89932f.entry.js.map +1 -0
  630. package/dist/ui-library/{p-6907a7dc.js → p-605bdd81.js} +2 -2
  631. package/dist/ui-library/p-63acceb6.entry.js +2 -0
  632. package/dist/ui-library/p-63acceb6.entry.js.map +1 -0
  633. package/dist/ui-library/p-651293e7.js +2 -0
  634. package/dist/ui-library/p-651293e7.js.map +1 -0
  635. package/dist/ui-library/p-6888b9ee.entry.js +2 -0
  636. package/dist/ui-library/p-6888b9ee.entry.js.map +1 -0
  637. package/dist/ui-library/p-6f9153be.entry.js +2 -0
  638. package/dist/ui-library/p-6f9153be.entry.js.map +1 -0
  639. package/dist/ui-library/p-7561b336.entry.js +2 -0
  640. package/dist/ui-library/p-7561b336.entry.js.map +1 -0
  641. package/dist/ui-library/p-7c18b8ca.entry.js +2 -0
  642. package/dist/ui-library/p-7c18b8ca.entry.js.map +1 -0
  643. package/dist/ui-library/p-82bd8781.entry.js +2 -0
  644. package/dist/ui-library/p-82bd8781.entry.js.map +1 -0
  645. package/dist/ui-library/{p-0861899a.js → p-862d474e.js} +1 -1
  646. package/dist/ui-library/p-862d474e.js.map +1 -0
  647. package/dist/ui-library/p-89db9a8b.entry.js +2 -0
  648. package/dist/ui-library/p-89db9a8b.entry.js.map +1 -0
  649. package/dist/ui-library/{p-d310a6dd.entry.js → p-8f1d3461.entry.js} +2 -2
  650. package/dist/ui-library/p-8f1d3461.entry.js.map +1 -0
  651. package/dist/ui-library/p-8fb96142.entry.js +2 -0
  652. package/dist/ui-library/p-8fb96142.entry.js.map +1 -0
  653. package/dist/ui-library/p-96d441e9.entry.js +2 -0
  654. package/dist/ui-library/p-96d441e9.entry.js.map +1 -0
  655. package/dist/ui-library/p-9bc1639b.entry.js +2 -0
  656. package/dist/ui-library/p-9bc1639b.entry.js.map +1 -0
  657. package/dist/ui-library/p-9cb83369.entry.js +2 -0
  658. package/dist/ui-library/p-9cb83369.entry.js.map +1 -0
  659. package/dist/ui-library/p-a398e3eb.entry.js +2 -0
  660. package/dist/ui-library/p-a398e3eb.entry.js.map +1 -0
  661. package/dist/ui-library/p-a7e2f511.entry.js +2 -0
  662. package/dist/ui-library/p-a7e2f511.entry.js.map +1 -0
  663. package/dist/ui-library/p-a8863197.entry.js +2 -0
  664. package/dist/ui-library/p-a8863197.entry.js.map +1 -0
  665. package/dist/ui-library/p-a9e009af.entry.js +2 -0
  666. package/dist/ui-library/p-a9e009af.entry.js.map +1 -0
  667. package/dist/ui-library/p-ac00076d.entry.js +2 -0
  668. package/dist/ui-library/p-ac00076d.entry.js.map +1 -0
  669. package/dist/ui-library/p-b4bc4915.entry.js +2 -0
  670. package/dist/ui-library/p-b4bc4915.entry.js.map +1 -0
  671. package/dist/ui-library/p-b5acf54d.entry.js +2 -0
  672. package/dist/ui-library/p-b5acf54d.entry.js.map +1 -0
  673. package/dist/ui-library/p-b60c20aa.entry.js +2 -0
  674. package/dist/ui-library/p-b60c20aa.entry.js.map +1 -0
  675. package/dist/ui-library/p-c1d68730.entry.js +2 -0
  676. package/dist/ui-library/p-c1d68730.entry.js.map +1 -0
  677. package/dist/ui-library/p-c35a7cef.entry.js +2 -0
  678. package/dist/ui-library/p-c35a7cef.entry.js.map +1 -0
  679. package/dist/ui-library/p-c62893e5.entry.js +2 -0
  680. package/dist/ui-library/p-c62893e5.entry.js.map +1 -0
  681. package/dist/ui-library/p-c6464bfe.entry.js +2 -0
  682. package/dist/ui-library/p-c6464bfe.entry.js.map +1 -0
  683. package/dist/ui-library/p-cf109cbf.entry.js +2 -0
  684. package/dist/ui-library/p-cf109cbf.entry.js.map +1 -0
  685. package/dist/ui-library/p-d07b549f.entry.js +2 -0
  686. package/dist/ui-library/p-d07b549f.entry.js.map +1 -0
  687. package/dist/ui-library/p-d42f1ea9.entry.js +2 -0
  688. package/dist/ui-library/p-d42f1ea9.entry.js.map +1 -0
  689. package/dist/ui-library/p-e080d5b6.js +2 -0
  690. package/dist/ui-library/p-e080d5b6.js.map +1 -0
  691. package/dist/ui-library/p-e1255160.js +2 -0
  692. package/dist/ui-library/p-e1255160.js.map +1 -0
  693. package/dist/ui-library/p-f136a6b2.js +2 -0
  694. package/dist/ui-library/p-f136a6b2.js.map +1 -0
  695. package/dist/ui-library/p-fe37dadf.entry.js +2 -0
  696. package/dist/ui-library/p-fe37dadf.entry.js.map +1 -0
  697. package/dist/ui-library/p-fe89a7c4.entry.js +2 -0
  698. package/dist/ui-library/p-fe89a7c4.entry.js.map +1 -0
  699. package/dist/ui-library/ui-library.css +1 -10
  700. package/dist/ui-library/ui-library.esm.js +1 -1
  701. package/dist/ui-library/ui-library.esm.js.map +1 -1
  702. package/package.json +10 -13
  703. package/dist/cjs/index-3baddcdc.js.map +0 -1
  704. package/dist/cjs/modal-3ce015be.js.map +0 -1
  705. package/dist/cjs/popup-40a9adbb.js.map +0 -1
  706. package/dist/cjs/set-attributes_2.cjs.entry.js +0 -73
  707. package/dist/cjs/set-attributes_2.cjs.entry.js.map +0 -1
  708. package/dist/cjs/six-checkbox.cjs.entry.js +0 -127
  709. package/dist/cjs/six-checkbox.cjs.entry.js.map +0 -1
  710. package/dist/cjs/six-menu-item.cjs.entry.js +0 -63
  711. package/dist/cjs/six-menu-item.cjs.entry.js.map +0 -1
  712. package/dist/cjs/slot-9821749e.js.map +0 -1
  713. package/dist/cjs/types-0a6d66f6.js.map +0 -1
  714. package/dist/collection/components/six-header/assets/six-logo.svg +0 -1
  715. package/dist/collection/components/six-header/test/six-header.spec.js +0 -133
  716. package/dist/collection/components/six-header/test/six-header.spec.js.map +0 -1
  717. package/dist/collection/utils/support.js +0 -16
  718. package/dist/collection/utils/support.js.map +0 -1
  719. package/dist/collection/wrappers/set-attributes/set-attributes.js +0 -74
  720. package/dist/collection/wrappers/set-attributes/set-attributes.js.map +0 -1
  721. package/dist/collection/wrappers/set-attributes/test/set-attributes.spec.js +0 -16
  722. package/dist/collection/wrappers/set-attributes/test/set-attributes.spec.js.map +0 -1
  723. package/dist/components/set-attributes.d.ts +0 -11
  724. package/dist/components/set-attributes.js +0 -8
  725. package/dist/components/set-attributes.js.map +0 -1
  726. package/dist/components/set-attributes2.js +0 -73
  727. package/dist/components/set-attributes2.js.map +0 -1
  728. package/dist/components/six-tag2.js +0 -102
  729. package/dist/components/six-tag2.js.map +0 -1
  730. package/dist/esm/index-17d8173e.js.map +0 -1
  731. package/dist/esm/modal-96526245.js.map +0 -1
  732. package/dist/esm/popup-e8049817.js.map +0 -1
  733. package/dist/esm/set-attributes_2.entry.js +0 -68
  734. package/dist/esm/set-attributes_2.entry.js.map +0 -1
  735. package/dist/esm/six-checkbox.entry.js +0 -123
  736. package/dist/esm/six-checkbox.entry.js.map +0 -1
  737. package/dist/esm/six-menu-item.entry.js +0 -59
  738. package/dist/esm/six-menu-item.entry.js.map +0 -1
  739. package/dist/esm/slot-41bc439a.js.map +0 -1
  740. package/dist/esm/types-07748c42.js.map +0 -1
  741. package/dist/types/utils/support.d.ts +0 -1
  742. package/dist/types/wrappers/set-attributes/set-attributes.d.ts +0 -9
  743. package/dist/ui-library/assets/six-logo.svg +0 -1
  744. package/dist/ui-library/p-0861899a.js.map +0 -1
  745. package/dist/ui-library/p-0a81b42c.entry.js +0 -2
  746. package/dist/ui-library/p-0a81b42c.entry.js.map +0 -1
  747. package/dist/ui-library/p-0beec94f.js +0 -3
  748. package/dist/ui-library/p-0beec94f.js.map +0 -1
  749. package/dist/ui-library/p-100d5a25.entry.js +0 -2
  750. package/dist/ui-library/p-100d5a25.entry.js.map +0 -1
  751. package/dist/ui-library/p-178f5782.entry.js +0 -2
  752. package/dist/ui-library/p-178f5782.entry.js.map +0 -1
  753. package/dist/ui-library/p-19a61686.entry.js +0 -2
  754. package/dist/ui-library/p-19a61686.entry.js.map +0 -1
  755. package/dist/ui-library/p-1d0c5929.entry.js +0 -2
  756. package/dist/ui-library/p-1d0c5929.entry.js.map +0 -1
  757. package/dist/ui-library/p-23c02c98.entry.js +0 -2
  758. package/dist/ui-library/p-23c02c98.entry.js.map +0 -1
  759. package/dist/ui-library/p-2f9f2532.entry.js +0 -2
  760. package/dist/ui-library/p-2f9f2532.entry.js.map +0 -1
  761. package/dist/ui-library/p-3187bc23.entry.js +0 -2
  762. package/dist/ui-library/p-3187bc23.entry.js.map +0 -1
  763. package/dist/ui-library/p-32e1a5ab.entry.js +0 -2
  764. package/dist/ui-library/p-32e1a5ab.entry.js.map +0 -1
  765. package/dist/ui-library/p-3d54ecf2.entry.js +0 -2
  766. package/dist/ui-library/p-3d54ecf2.entry.js.map +0 -1
  767. package/dist/ui-library/p-4229f7e8.entry.js +0 -2
  768. package/dist/ui-library/p-4229f7e8.entry.js.map +0 -1
  769. package/dist/ui-library/p-479d8087.entry.js +0 -2
  770. package/dist/ui-library/p-479d8087.entry.js.map +0 -1
  771. package/dist/ui-library/p-49aa8d1e.entry.js +0 -2
  772. package/dist/ui-library/p-49aa8d1e.entry.js.map +0 -1
  773. package/dist/ui-library/p-58661675.entry.js +0 -2
  774. package/dist/ui-library/p-58661675.entry.js.map +0 -1
  775. package/dist/ui-library/p-5d43ea07.entry.js +0 -2
  776. package/dist/ui-library/p-5d43ea07.entry.js.map +0 -1
  777. package/dist/ui-library/p-6aa2929a.entry.js +0 -2
  778. package/dist/ui-library/p-6aa2929a.entry.js.map +0 -1
  779. package/dist/ui-library/p-7432d409.entry.js +0 -2
  780. package/dist/ui-library/p-7432d409.entry.js.map +0 -1
  781. package/dist/ui-library/p-74a714c0.entry.js +0 -2
  782. package/dist/ui-library/p-74a714c0.entry.js.map +0 -1
  783. package/dist/ui-library/p-76825395.entry.js +0 -2
  784. package/dist/ui-library/p-76825395.entry.js.map +0 -1
  785. package/dist/ui-library/p-816f857d.entry.js +0 -2
  786. package/dist/ui-library/p-816f857d.entry.js.map +0 -1
  787. package/dist/ui-library/p-882fbf6f.entry.js +0 -2
  788. package/dist/ui-library/p-882fbf6f.entry.js.map +0 -1
  789. package/dist/ui-library/p-88fd4973.entry.js +0 -2
  790. package/dist/ui-library/p-88fd4973.entry.js.map +0 -1
  791. package/dist/ui-library/p-8b750c9e.entry.js +0 -2
  792. package/dist/ui-library/p-8b750c9e.entry.js.map +0 -1
  793. package/dist/ui-library/p-911eb578.entry.js +0 -2
  794. package/dist/ui-library/p-911eb578.entry.js.map +0 -1
  795. package/dist/ui-library/p-93fcda4a.entry.js +0 -2
  796. package/dist/ui-library/p-93fcda4a.entry.js.map +0 -1
  797. package/dist/ui-library/p-981b3228.entry.js +0 -2
  798. package/dist/ui-library/p-981b3228.entry.js.map +0 -1
  799. package/dist/ui-library/p-998de05d.js +0 -2
  800. package/dist/ui-library/p-998de05d.js.map +0 -1
  801. package/dist/ui-library/p-9b1ff147.entry.js +0 -2
  802. package/dist/ui-library/p-9b1ff147.entry.js.map +0 -1
  803. package/dist/ui-library/p-a21f8d06.entry.js +0 -2
  804. package/dist/ui-library/p-a21f8d06.entry.js.map +0 -1
  805. package/dist/ui-library/p-a2461274.entry.js +0 -2
  806. package/dist/ui-library/p-a2461274.entry.js.map +0 -1
  807. package/dist/ui-library/p-a4e4620c.entry.js +0 -2
  808. package/dist/ui-library/p-a4e4620c.entry.js.map +0 -1
  809. package/dist/ui-library/p-ada23fe3.entry.js +0 -2
  810. package/dist/ui-library/p-ada23fe3.entry.js.map +0 -1
  811. package/dist/ui-library/p-b5ac1219.entry.js +0 -2
  812. package/dist/ui-library/p-b5ac1219.entry.js.map +0 -1
  813. package/dist/ui-library/p-ba247565.entry.js +0 -2
  814. package/dist/ui-library/p-ba247565.entry.js.map +0 -1
  815. package/dist/ui-library/p-bdb79948.entry.js +0 -2
  816. package/dist/ui-library/p-bdb79948.entry.js.map +0 -1
  817. package/dist/ui-library/p-c021a9c9.entry.js +0 -2
  818. package/dist/ui-library/p-c021a9c9.entry.js.map +0 -1
  819. package/dist/ui-library/p-c07b1240.entry.js +0 -2
  820. package/dist/ui-library/p-c07b1240.entry.js.map +0 -1
  821. package/dist/ui-library/p-c12a94ce.entry.js +0 -2
  822. package/dist/ui-library/p-c12a94ce.entry.js.map +0 -1
  823. package/dist/ui-library/p-c1675a45.entry.js +0 -2
  824. package/dist/ui-library/p-c1675a45.entry.js.map +0 -1
  825. package/dist/ui-library/p-c2df8c27.entry.js +0 -2
  826. package/dist/ui-library/p-c2df8c27.entry.js.map +0 -1
  827. package/dist/ui-library/p-c86aa5b3.entry.js +0 -2
  828. package/dist/ui-library/p-c86aa5b3.entry.js.map +0 -1
  829. package/dist/ui-library/p-cd35b3c6.entry.js +0 -2
  830. package/dist/ui-library/p-cd35b3c6.entry.js.map +0 -1
  831. package/dist/ui-library/p-d2cf4280.entry.js +0 -2
  832. package/dist/ui-library/p-d2cf4280.entry.js.map +0 -1
  833. package/dist/ui-library/p-d310a6dd.entry.js.map +0 -1
  834. package/dist/ui-library/p-d6838141.entry.js +0 -2
  835. package/dist/ui-library/p-d6838141.entry.js.map +0 -1
  836. package/dist/ui-library/p-dc908cbb.entry.js +0 -2
  837. package/dist/ui-library/p-dc908cbb.entry.js.map +0 -1
  838. package/dist/ui-library/p-dfb6bff6.entry.js +0 -2
  839. package/dist/ui-library/p-dfb6bff6.entry.js.map +0 -1
  840. package/dist/ui-library/p-ee71e3a3.entry.js +0 -2
  841. package/dist/ui-library/p-ee71e3a3.entry.js.map +0 -1
  842. package/dist/ui-library/p-ef317d69.entry.js +0 -2
  843. package/dist/ui-library/p-ef317d69.entry.js.map +0 -1
  844. package/dist/ui-library/p-f2ef23c4.js +0 -2
  845. package/dist/ui-library/p-f2ef23c4.js.map +0 -1
  846. package/dist/ui-library/p-f385f1c2.entry.js +0 -2
  847. package/dist/ui-library/p-f385f1c2.entry.js.map +0 -1
  848. package/dist/ui-library/p-f73a6bdc.entry.js +0 -2
  849. package/dist/ui-library/p-f73a6bdc.entry.js.map +0 -1
  850. package/dist/ui-library/p-faa04bb5.js +0 -2
  851. package/dist/ui-library/p-faa04bb5.js.map +0 -1
  852. package/dist/ui-library/p-fcd57e0a.entry.js +0 -2
  853. package/dist/ui-library/p-fcd57e0a.entry.js.map +0 -1
  854. /package/dist/ui-library/{p-6907a7dc.js.map → p-605bdd81.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"popup.js","sourceRoot":"","sources":["../../src/utils/popup.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CACpC,KAAc,EACd,KAA8B,EAC9B,YAAqC,EACrC,OAAgC,EAChC,cAAsB,EACtB,wBAAiD;IAEjD,IAAI,CAAC,KAAK,IAAI,KAAK,IAAI,IAAI,IAAI,YAAY,IAAI,IAAI,IAAI,OAAO,IAAI,IAAI,EAAE;QACtE,OAAO;KACR;IACD,6CAA6C;IAC7C,MAAM,eAAe,GAAG,qBAAqB,CA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the popup is hoisted we popup is hoisted its position will change to fix to not be clipped of by a containing container.\n * To render the popup correctly we render it normally, and then assign this screenposition to the fixed popup\n */\nexport function adjustPopupForHoisting(\n hoist: boolean,\n popup: HTMLElement | undefined,\n inputElement: HTMLElement | undefined,\n wrapper: HTMLElement | undefined,\n minPopupHeight: number,\n dropdownDirectionChanged: (isUp: boolean) => void\n) {\n if (!hoist || popup == null || inputElement == null || wrapper == null) {\n return;\n }\n // take a snapshot of normally rendered popup\n const popupDimensions = setPopupAsFixPosition(popup);\n const inputDimensions = inputElement.getBoundingClientRect();\n const inputTop = inputDimensions.top;\n const popupTop = popupDimensions.top;\n\n const isUp = calcIsDropDownContentUp(inputElement, wrapper, minPopupHeight);\n // check screen position to check whether the popup should be moved above or below the trigger element\n if (isUp && inputTop < popupTop) {\n // move popup above input field if datepicker is at bottom of screen\n popup.style.top = `${popupTop - popupDimensions.height - inputDimensions.height}px`;\n }\n dropdownDirectionChanged(isUp);\n}\n\n/*\n * For small screens the datepicker popup could be cut-off even though there might still be space within the viewport.\n * This is because the popup is always aligned with the trigger input field. However in the scenario of small screens\n * we should reposition the popup to use the space available.\n */\nexport function adjustPopupForSmallScreens(popup?: HTMLElement) {\n // execute after dropdown has been rendered to make sure the popup reference is correctly set\n setTimeout(() => {\n if (popup == null) {\n return;\n }\n const popupDimensions = popup.getBoundingClientRect();\n if (\n popupDimensions.y < 0 &&\n window.innerHeight - popupDimensions.height > 0 &&\n Math.abs(popupDimensions.y) <= popupDimensions.height\n ) {\n // handle case where popup is cut-off on top but there is still space available\n setPopupAsFixPosition(popup);\n popup.style.top = '0px';\n } else if (\n window.innerHeight < popupDimensions.y + popupDimensions.height &&\n window.innerHeight > popupDimensions.height &&\n Math.abs(popupDimensions.y - window.innerHeight) <= popupDimensions.height\n ) {\n // handle case where popup is cut-off at the bottom but there is still space available above\n // apply screen position to fixed popup\n setPopupAsFixPosition(popup);\n popup.style.top = `${window.innerHeight - popupDimensions.height}px`;\n }\n\n if (\n window.innerWidth < popupDimensions.x + popupDimensions.width &&\n window.innerWidth > popupDimensions.width &&\n Math.abs(popupDimensions.x - window.innerWidth) <= popupDimensions.width\n ) {\n // handle case where popup is cut-off to the right\n setPopupAsFixPosition(popup);\n popup.style.left = `${window.innerWidth - popupDimensions.width}px`;\n }\n }, 0);\n}\n\nexport function calcIsDropDownContentUp(\n inputElement: HTMLElement,\n wrapper: HTMLElement,\n minPopupHeight: number\n): boolean {\n const inputBoundingRect = inputElement.getBoundingClientRect();\n const wrapperBoundingRect = wrapper.getBoundingClientRect();\n const popupHeight = Math.max(wrapperBoundingRect.height, minPopupHeight);\n const moreSpaceInTop = inputBoundingRect.y > window.innerHeight / 2;\n return moreSpaceInTop && window.innerHeight < inputBoundingRect.bottom + popupHeight;\n}\n\nexport function setPopupAsFixPosition(popup: HTMLElement): DOMRect {\n const popupDimensions = popup.getBoundingClientRect();\n popup.style.position = 'fixed';\n popup.style.top = popupDimensions['top'] + 'px';\n popup.style.left = popupDimensions['left'] + 'px';\n popup.style.width = popupDimensions['width'] + 'px';\n popup.style.height = popupDimensions['height'] + 'px';\n return popupDimensions;\n}\n\n/*\n * The position of the hoisted datepicker needs to be correctly calculated since the position changes to fixed.\n * Thus if the user scrolls or adjusts the screen size we need to recalculate the datepicker position.\n */\nexport function movePopup(\n hoist: boolean,\n open: boolean,\n popup: HTMLElement | undefined,\n inputElement: HTMLElement | undefined,\n wrapper: HTMLElement | undefined,\n minPopupHeight: number\n) {\n if (!hoist || !open || popup == null || inputElement == null || wrapper == null) {\n return;\n }\n const popupBoundingClientRect = popup.getBoundingClientRect();\n const popupHeight = popupBoundingClientRect.height;\n const inputBoundingClientRect = inputElement.getBoundingClientRect();\n const inputTop = inputBoundingClientRect.top;\n const inputHeight = inputBoundingClientRect.height;\n\n const isUp = calcIsDropDownContentUp(inputElement, wrapper, minPopupHeight);\n\n if (isUp) {\n popup.style.top = `${inputTop - popupHeight}px`;\n } else {\n popup.style.top = `${inputTop + inputHeight}px`;\n }\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CAAC;IACrE,MAAM,QAAQ,GAAG,uBAAuB,CAAC,GAAG,CAAC;IAC7C,MAAM,WAAW,GAAG,uBAAuB,CAAC,MAAM,CAAC;IAEnD,MAAM,IAAI,GAAG,uBAAuB,CAAC,YAAY,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC;IAE5E,IAAI,IAAI,EAAE,CAAC;QACT,KAAK,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,QAAQ,GAAG,WAAW,IAAI,CAAC;IAClD,CAAC;SAAM,CAAC;QACN,KAAK,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,QAAQ,GAAG,WAAW,IAAI,CAAC;IAClD,CAAC;AACH,CAAC","sourcesContent":["/**\n * If the popup is hoisted we popup is hoisted its position will change to fix to not be clipped of by a containing container.\n * To render the popup correctly we render it normally, and then assign this screenposition to the fixed popup\n */\nexport function adjustPopupForHoisting(\n hoist: boolean,\n popup: HTMLElement | undefined,\n inputElement: HTMLElement | undefined,\n wrapper: HTMLElement | undefined,\n minPopupHeight: number,\n dropdownDirectionChanged: (isUp: boolean) => void\n) {\n if (!hoist || popup == null || inputElement == null || wrapper == null) {\n return;\n }\n // take a snapshot of normally rendered popup\n const popupDimensions = setPopupAsFixPosition(popup);\n const inputDimensions = inputElement.getBoundingClientRect();\n const inputTop = inputDimensions.top;\n const popupTop = popupDimensions.top;\n\n const isUp = calcIsDropDownContentUp(inputElement, wrapper, minPopupHeight);\n // check screen position to check whether the popup should be moved above or below the trigger element\n if (isUp && inputTop < popupTop) {\n // move popup above input field if datepicker is at bottom of screen\n popup.style.top = `${popupTop - popupDimensions.height - inputDimensions.height}px`;\n }\n dropdownDirectionChanged(isUp);\n}\n\n/*\n * For small screens the datepicker popup could be cut-off even though there might still be space within the viewport.\n * This is because the popup is always aligned with the trigger input field. However in the scenario of small screens\n * we should reposition the popup to use the space available.\n */\nexport function adjustPopupForSmallScreens(popup?: HTMLElement) {\n // execute after dropdown has been rendered to make sure the popup reference is correctly set\n setTimeout(() => {\n if (popup == null) {\n return;\n }\n const popupDimensions = popup.getBoundingClientRect();\n if (\n popupDimensions.y < 0 &&\n window.innerHeight - popupDimensions.height > 0 &&\n Math.abs(popupDimensions.y) <= popupDimensions.height\n ) {\n // handle case where popup is cut-off on top but there is still space available\n setPopupAsFixPosition(popup);\n popup.style.top = '0px';\n } else if (\n window.innerHeight < popupDimensions.y + popupDimensions.height &&\n window.innerHeight > popupDimensions.height &&\n Math.abs(popupDimensions.y - window.innerHeight) <= popupDimensions.height\n ) {\n // handle case where popup is cut-off at the bottom but there is still space available above\n // apply screen position to fixed popup\n setPopupAsFixPosition(popup);\n popup.style.top = `${window.innerHeight - popupDimensions.height}px`;\n }\n\n if (\n window.innerWidth < popupDimensions.x + popupDimensions.width &&\n window.innerWidth > popupDimensions.width &&\n Math.abs(popupDimensions.x - window.innerWidth) <= popupDimensions.width\n ) {\n // handle case where popup is cut-off to the right\n setPopupAsFixPosition(popup);\n popup.style.left = `${window.innerWidth - popupDimensions.width}px`;\n }\n }, 0);\n}\n\nexport function calcIsDropDownContentUp(\n inputElement: HTMLElement,\n wrapper: HTMLElement,\n minPopupHeight: number\n): boolean {\n const inputBoundingRect = inputElement.getBoundingClientRect();\n const wrapperBoundingRect = wrapper.getBoundingClientRect();\n const popupHeight = Math.max(wrapperBoundingRect.height, minPopupHeight);\n const moreSpaceInTop = inputBoundingRect.y > window.innerHeight / 2;\n return moreSpaceInTop && window.innerHeight < inputBoundingRect.bottom + popupHeight;\n}\n\nexport function setPopupAsFixPosition(popup: HTMLElement): DOMRect {\n const popupDimensions = popup.getBoundingClientRect();\n popup.style.position = 'fixed';\n popup.style.top = popupDimensions['top'] + 'px';\n popup.style.left = popupDimensions['left'] + 'px';\n popup.style.width = popupDimensions['width'] + 'px';\n popup.style.minHeight = 'fit-content';\n return popupDimensions;\n}\n\n/*\n * The position of the hoisted datepicker needs to be correctly calculated since the position changes to fixed.\n * Thus if the user scrolls or adjusts the screen size we need to recalculate the datepicker position.\n */\nexport function movePopup(\n hoist: boolean,\n open: boolean,\n popup: HTMLElement | undefined,\n inputElement: HTMLElement | undefined,\n wrapper: HTMLElement | undefined,\n minPopupHeight: number\n) {\n if (!hoist || !open || popup == null || inputElement == null || wrapper == null) {\n return;\n }\n const popupBoundingClientRect = popup.getBoundingClientRect();\n const popupHeight = popupBoundingClientRect.height;\n const inputBoundingClientRect = inputElement.getBoundingClientRect();\n const inputTop = inputBoundingClientRect.top;\n const inputHeight = inputBoundingClientRect.height;\n\n const isUp = calcIsDropDownContentUp(inputElement, wrapper, minPopupHeight);\n\n if (isUp) {\n popup.style.top = `${inputTop - popupHeight}px`;\n } else {\n popup.style.top = `${inputTop + inputHeight}px`;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"scroll.js","sourceRoot":"","sources":["../../src/utils/scroll.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,MAAM,KAAK,GAAG,IAAI,GAAG,EAAE,CAAC;AAExB,EAAE;AACF,qHAAqH;AACrH,+BAA+B;AAC/B,EAAE;AACF,MAAM,UAAU,iBAAiB,CAAC,SAAsB;IACtD,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IACrB,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;AACjD,CAAC;AAED,EAAE;AACF,oHAAoH;AACpH,EAAE;AACF,MAAM,UAAU,mBAAmB,CAAC,SAAsB;IACxD,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IAExB,IAAI,KAAK,CAAC,IAAI,KAAK,CAAC,EAAE;QACpB,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;KACnD;AACH,CAAC;AAED,EAAE;AACF,yGAAyG;AACzG,EAAE;AACF,MAAM,UAAU,cAAc,CAC5B,OAAoB,EACpB,SAAsB,EACtB,YAAgD,UAAU,EAC1D,W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E,CAAC,CAAC;SAClG;KACF;AACH,CAAC","sourcesContent":["import { getOffset } from './offset';\n\nconst locks = new Set();\n\n//\n// Prevents body scrolling. Keeps track of which elements requested a lock so multiple levels of locking are possible\n// without premature unlocking.\n//\nexport function lockBodyScrolling(lockingEl: HTMLElement) {\n locks.add(lockingEl);\n document.body.classList.add('six-scroll-lock');\n}\n\n//\n// Unlocks body scrolling. Scrolling will only be unlocked once all elements that requested a lock call this method.\n//\nexport function unlockBodyScrolling(lockingEl: HTMLElement) {\n locks.delete(lockingEl);\n\n if (locks.size === 0) {\n document.body.classList.remove('six-scroll-lock');\n }\n}\n\n//\n// Scrolls an element into view of its container. If the element is already in view, nothing will happen.\n//\nexport function scrollIntoView(\n element: HTMLElement,\n container: HTMLElement,\n direction: 'horizontal' | 'vertical' | 'both' = 'vertical',\n behavior: 'smooth' | 'auto' = 'smooth'\n) {\n const offset = getOffset(element, container);\n const offsetTop = offset.top + container.scrollTop;\n const offsetLeft = offset.left + container.scrollLeft;\n const minX = container.scrollLeft;\n const maxX = container.scrollLeft + container.offsetWidth;\n const minY = container.scrollTop;\n const maxY = container.scrollTop + container.offsetHeight;\n\n if (direction === 'horizontal' || direction === 'both') {\n if (offsetLeft < minX) {\n container.scrollTo({ left: offsetLeft, behavior });\n } else if (offsetLeft + element.clientWidth > maxX) {\n container.scrollTo({ left: offsetLeft - container.offsetWidth + element.clientWidth, behavior });\n }\n }\n\n if (direction === 'vertical' || direction === 'both') {\n if (offsetTop < minY) {\n container.scrollTo({ top: offsetTop, behavior });\n } else if (offsetTop + element.clientHeight > maxY) {\n container.scrollTo({ top: offsetTop - container.offsetHeight + element.clientHeight, behavior });\n }\n }\n}\n"]}
1
+ {"version":3,"file":"scroll.js","sourceRoot":"","sources":["../../src/utils/scroll.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,MAAM,KAAK,GAAG,IAAI,GAAG,EAAE,CAAC;AAExB,EAAE;AACF,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,EAAE,QAAQ,EAAE,CAAC,CAAC;QACrD,CAAC;aAAM,IAAI,UAAU,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,EAAE,CAAC;YACnD,SAAS,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,UAAU,GAAG,SAAS,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,EAAE,QAAQ,EAAE,CAAC,CAAC;QACnG,CAAC;IACH,CAAC;IAED,IAAI,SAAS,KAAK,UAAU,IAAI,SAAS,KAAK,MAAM,EAAE,CAAC;QACrD,IAAI,SAAS,GAAG,IAAI,EAAE,CAAC;YACrB,SAAS,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,CAAC;QACnD,CAAC;aAAM,IAAI,SAAS,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,EAAE,CAAC;YACnD,SAAS,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,SAAS,GAAG,SAAS,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,EAAE,QAAQ,EAAE,CAAC,CAAC;QACnG,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["import { getOffset } from './offset';\n\nconst locks = new Set();\n\n//\n// Prevents body scrolling. Keeps track of which elements requested a lock so multiple levels of locking are possible\n// without premature unlocking.\n//\nexport function lockBodyScrolling(lockingEl: HTMLElement) {\n locks.add(lockingEl);\n document.body.classList.add('six-scroll-lock');\n}\n\n//\n// Unlocks body scrolling. Scrolling will only be unlocked once all elements that requested a lock call this method.\n//\nexport function unlockBodyScrolling(lockingEl: HTMLElement) {\n locks.delete(lockingEl);\n\n if (locks.size === 0) {\n document.body.classList.remove('six-scroll-lock');\n }\n}\n\n//\n// Scrolls an element into view of its container. If the element is already in view, nothing will happen.\n//\nexport function scrollIntoView(\n element: HTMLElement,\n container: HTMLElement,\n direction: 'horizontal' | 'vertical' | 'both' = 'vertical',\n behavior: 'smooth' | 'auto' = 'smooth'\n) {\n const offset = getOffset(element, container);\n const offsetTop = offset.top + container.scrollTop;\n const offsetLeft = offset.left + container.scrollLeft;\n const minX = container.scrollLeft;\n const maxX = container.scrollLeft + container.offsetWidth;\n const minY = container.scrollTop;\n const maxY = container.scrollTop + container.offsetHeight;\n\n if (direction === 'horizontal' || direction === 'both') {\n if (offsetLeft < minX) {\n container.scrollTo({ left: offsetLeft, behavior });\n } else if (offsetLeft + element.clientWidth > maxX) {\n container.scrollTo({ left: offsetLeft - container.offsetWidth + element.clientWidth, behavior });\n }\n }\n\n if (direction === 'vertical' || direction === 'both') {\n if (offsetTop < minY) {\n container.scrollTo({ top: offsetTop, behavior });\n } else if (offsetTop + element.clientHeight > maxY) {\n container.scrollTo({ top: offsetTop - container.offsetHeight + element.clientHeight, behavior });\n }\n }\n}\n"]}
@@ -36,7 +36,6 @@ export function hasSlot(el, name) {
36
36
  return false;
37
37
  });
38
38
  }
39
- export const getSlotChildren = (el) => { var _a; return (_a = el.querySelector('slot')) === null || _a === void 0 ? void 0 : _a.assignedElements({ flatten: true }); };
40
39
  export function getSlot(element, slotName) {
41
40
  if (element == null)
42
41
  return null;
@@ -1 +1 @@
1
- {"version":3,"file":"slot.js","sourceRoot":"","sources":["../../src/utils/slot.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,kHAAkH;AAClH,kFAAkF;AAClF,EAAE;AACF,MAAM,UAAU,cAAc,CAAC,IAAsB;IACnD,MAAM,KAAK,GAAG,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACxE,IAAI,IAAI,GAAG,EAAE,CAAC;IAEd,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACtB,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,SAAS,EAAE;YACpC,IAAI,IAAI,IAAI,CAAC,WAAW,CAAC;SAC1B;IAC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// Given a slot, this function iterates over all of its assigned text nodes and returns the concatenated text as a\n// string. This is useful because we can't use slot.textContent as an alternative.\n//\nexport function getTextContent(slot?: HTMLSlotElement): string {\n const nodes = slot != null ? slot.assignedNodes({ flatten: true }) : [];\n let text = '';\n\n [...nodes].map((node) => {\n if (node.nodeType === Node.TEXT_NODE) {\n text += node.textContent;\n }\n });\n\n return text;\n}\n\n//\n// Determines whether an element has a slot. If name is specified, the function will look for a corresponding named\n// slot, otherwise it will look for a \"default\" slot (e.g. a non-empty text node or an element with no slot attribute).\n//\nexport function hasSlot(el: HTMLElement, name?: string): boolean {\n // Look for a named slot\n if (name != null && name !== '') {\n return el.querySelector(`[slot=\"${name}\"]`) !== null;\n }\n\n // Look for a default slot\n return Array.from(el.childNodes).some((node) => {\n if (node.nodeType === node.TEXT_NODE && node.textContent?.trim() !== '') {\n return true;\n }\n\n if (node.nodeType === node.ELEMENT_NODE) {\n const el = node as HTMLElement;\n if (!el.hasAttribute('slot')) {\n return true;\n }\n }\n\n return false;\n });\n}\n\nexport const getSlotChildren = <T extends HTMLElement>(el: HTMLElement) =>\n el.querySelector('slot')?.assignedElements({ flatten: true }) as T[];\n\nexport function getSlot(element: ParentNode | null | undefined, slotName: string): HTMLElement | null {\n if (element == null) return null;\n return element.querySelector(`[slot=\"${slotName}\"]`);\n}\n"]}
1
+ {"version":3,"file":"slot.js","sourceRoot":"","sources":["../../src/utils/slot.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,kHAAkH;AAClH,kFAAkF;AAClF,EAAE;AACF,MAAM,UAAU,cAAc,CAAC,IAAsB;IACnD,MAAM,KAAK,GAAG,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACxE,IAAI,IAAI,GAAG,EAAE,CAAC;IAEd,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EA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terates over all of its assigned text nodes and returns the concatenated text as a\n// string. This is useful because we can't use slot.textContent as an alternative.\n//\nexport function getTextContent(slot?: HTMLSlotElement): string {\n const nodes = slot != null ? slot.assignedNodes({ flatten: true }) : [];\n let text = '';\n\n [...nodes].map((node) => {\n if (node.nodeType === Node.TEXT_NODE) {\n text += node.textContent;\n }\n });\n\n return text;\n}\n\n//\n// Determines whether an element has a slot. If name is specified, the function will look for a corresponding named\n// slot, otherwise it will look for a \"default\" slot (e.g. a non-empty text node or an element with no slot attribute).\n//\nexport function hasSlot(el: HTMLElement, name?: string): boolean {\n // Look for a named slot\n if (name != null && name !== '') {\n return el.querySelector(`[slot=\"${name}\"]`) !== null;\n }\n\n // Look for a default slot\n return Array.from(el.childNodes).some((node) => {\n if (node.nodeType === node.TEXT_NODE && node.textContent?.trim() !== '') {\n return true;\n }\n\n if (node.nodeType === node.ELEMENT_NODE) {\n const el = node as HTMLElement;\n if (!el.hasAttribute('slot')) {\n return true;\n }\n }\n\n return false;\n });\n}\n\nexport function getSlot(element: ParentNode | null | undefined, slotName: string): HTMLElement | null {\n if (element == null) return null;\n return element.querySelector(`[slot=\"${slotName}\"]`);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"tabbable.js","sourceRoot":"","sources":["../../src/utils/tabbable.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,UAAU,CAAC,EAAe;IACxC,MAAM,QAAQ,GAAG,EAAE,CAAC,QAAQ,CAAC;IAC7B,OAAO,QAAQ,GAAG,CAAC,CAAC,CAAC;AACvB,CAAC;AAED,MAAM,UAAU,yBAAyB,CAAC,EAAe;IACvD,oBAAoB;IACpB,IAAI,UAAU,CAAC,EAAE,CAAC,EAAE;QAClB,OAAO,EAAE,CAAC;KACX;IAED,kCAAkC;IAClC,IAAI,EAAE,CAAC,UAAU,IAAI,IAAI,EAAE;QACzB,MAAM,mBAAmB,GAAG,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAgB,CAAC,CAAgB,CAAC;QACjH,IAAI,mBAAmB,IAAI,IAAI,EAAE;YAC/B,OAAO,mBAAmB,CAAC;SAC5B;KACF;IAED,+BAA+B;IAC/B,IAAI,EAAE,CAAC,QAAQ,IAAI,IAAI,EAAE;QACvB,OAAO,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,yBAAyB,CAAC,CAAgB,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;KACvF;IAED,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["export function isTabbable(el: HTMLElement) {\n const tabIndex = el.tabIndex;\n return tabIndex > -1;\n}\n\nexport function getNearestTabbableElement(el: HTMLElement): HTMLElement | undefined {\n // Check the element\n if (isTabbable(el)) {\n return el;\n }\n\n // Check the element's shadow root\n if (el.shadowRoot != null) {\n const tabbableShadowChild = [...el.shadowRoot.children].find((e) => isTabbable(e as HTMLElement)) as HTMLElement;\n if (tabbableShadowChild != null) {\n return tabbableShadowChild;\n }\n }\n\n // Check the element's children\n if (el.children != null) {\n return [...el.children].map((e) => getNearestTabbableElement(e as HTMLElement)).at(0);\n }\n\n return undefined;\n}\n"]}
1
+ {"version":3,"file":"tabbable.js","sourceRoot":"","sources":["../../src/utils/tabbable.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,UAAU,CAAC,EAAe;IACxC,MAAM,QAAQ,GAAG,EAAE,CAAC,QAAQ,CAAC;IAC7B,OAAO,QAAQ,GAAG,CAAC,CAAC,CAAC;AACvB,CAAC;AAED,MAAM,UAAU,yBAAyB,CAAC,EAAe;IACvD,oBAAoB;IACpB,IAAI,UAAU,CAAC,EAAE,CAAC,EAAE,CAAC;QACnB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,kCAAkC;IAClC,IAAI,EAAE,CAAC,UAAU,IAAI,IAAI,EAAE,CAAC;QAC1B,MAAM,mBAAmB,GAAG,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAgB,CAAC,CAAgB,CAAC;QACjH,IAAI,mBAAmB,IAAI,IAAI,EAAE,CAAC;YAChC,OAAO,mBAAmB,CAAC;QAC7B,CAAC;IACH,CAAC;IAED,+BAA+B;IAC/B,IAAI,EAAE,CAAC,QAAQ,IAAI,IAAI,EAAE,CAAC;QACxB,OAAO,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,yBAAyB,CAAC,CAAgB,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACxF,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["export function isTabbable(el: HTMLElement) {\n const tabIndex = el.tabIndex;\n return tabIndex > -1;\n}\n\nexport function getNearestTabbableElement(el: HTMLElement): HTMLElement | undefined {\n // Check the element\n if (isTabbable(el)) {\n return el;\n }\n\n // Check the element's shadow root\n if (el.shadowRoot != null) {\n const tabbableShadowChild = [...el.shadowRoot.children].find((e) => isTabbable(e as HTMLElement)) as HTMLElement;\n if (tabbableShadowChild != null) {\n return tabbableShadowChild;\n }\n }\n\n // Check the element's children\n if (el.children != null) {\n return [...el.children].map((e) => getNearestTabbableElement(e as HTMLElement)).at(0);\n }\n\n return undefined;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"time.util.js","sourceRoot":"","sources":["../../src/utils/time.util.ts"],"names":[],"mappings":"AAqCA,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAS,EAAE;IAChD,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC;IACvB,OAAO;QACL,KAAK,EAAE,GAAG,CAAC,QAAQ,EAAE;QACrB,OAAO,EAAE,GAAG,CAAC,UAAU,EAAE;QACzB,O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AI,CAAC,CAAC,CAAC,IAAI,CAAC;SACrE;IACH,CAAC,CAAC,CAAC;IACH,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,IAAsB,EAAE,MAAkB,EAAU,EAAE;IACrF,IAAI,IAAI,IAAI,IAAI,EAAE;QAChB,OAAO,EAAE,CAAC;KACX;IAED,MAAM,WAAW,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAqB,CAAC;IAE1D,OAAO,WAAW;SACf,GAAG,CAAC,CAAC,cAAc,EAAE,EAAE;QACtB,QAAQ,cAAc,EAAE;YACtB,KAAK,IAAI,CAAC;YACV,KAAK,IAAI;gBACP,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;YAC7C,KAAK,IAAI;gBACP,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;YAC/C,KAAK,IAAI;gBACP,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;YAC/C,KAAK,IAAI;gBACP,OAAO,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;YACpD,KAAK,IAAI;gBACP,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;SAC9B;IACH,CAAC,CAAC;SACD,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC,CAAC","sourcesContent":["export type TimePeriod = 'AM' | 'PM';\n\nexport interface Time {\n hours?: number;\n minutes?: number;\n seconds?: number;\n milliseconds?: number;\n has24Hours?: boolean; // true => 24h, false => 12h\n period?: TimePeriod; // only needed for 12-hour clock\n}\n\nexport type TimeProperties = keyof Time;\n\nexport type TimeFormatChar =\n | 'HH' // 24h\n | 'hh' // 12h\n | 'mm' // minutes\n | 'ss' // seconds\n | 'ms' // milliseconds\n | 'aa'; // period (AM/PM)\n\n/*\n * Supported time formats\n */\nexport type TimeFormat =\n | 'HH:mm:ss'\n | 'hh:mm:ss:aa'\n | 'HH:mm:ss:ms'\n | 'hh:mm:ss:ms:aa'\n | 'HH:mm'\n | 'hh:mm:aa'\n | 'HH'\n | 'hh:aa'\n | 'mm'\n | 'ss'\n | 'ms';\n\nexport const getCurrentTimeIn24Hours = (): Time => {\n const now = new Date();\n return {\n hours: now.getHours(),\n minutes: now.getMinutes(),\n seconds: now.getSeconds(),\n milliseconds: now.getMilliseconds(),\n has24Hours: true,\n };\n};\n\nconst HOURS_IN_12_HOUR_CLOCK_FORMAT = 12;\n\nexport const getHoursIn12HourFormat = (hours: number) =>\n hours > HOURS_IN_12_HOUR_CLOCK_FORMAT ? hours - HOURS_IN_12_HOUR_CLOCK_FORMAT : hours;\n\nexport const getCurrentTimeIn12Hours = (): Time => {\n const now = new Date();\n const hours = now.getHours();\n return {\n hours: getHoursIn12HourFormat(hours),\n minutes: now.getMinutes(),\n seconds: now.getSeconds(),\n milliseconds: now.getMilliseconds(),\n has24Hours: false,\n period: hours >= HOURS_IN_12_HOUR_CLOCK_FORMAT ? 'PM' : 'AM',\n };\n};\n\nexport const getCurrentTime = (has24Hours = true): Time => {\n return has24Hours ? getCurrentTimeIn24Hours() : getCurrentTimeIn12Hours();\n};\n\nexport const isValidTimeString = (timeStr: string, format: TimeFormat) => {\n const timeStringParts = timeStr.split(':');\n const timeFormatParts = format.split(':');\n return timeStringParts.length === timeFormatParts.length;\n};\n\nexport const parseTimeString = (timeStr: string, format: TimeFormat): Time => {\n const timeParts = timeStr.split(':');\n const formatParts = format.split(':') as TimeFormatChar[];\n\n if (!isValidTimeString(timeStr, format)) {\n console.error(\n `Timestring did not match expected format.\\nExpected format: ${format}\\nReceived timestring: ${timeStr}`\n );\n }\n\n const time: Time = {};\n\n timeParts.forEach((timeStringPart, i) => {\n const formatStringPart: TimeFormatChar = formatParts[i];\n switch (formatStringPart) {\n case 'HH':\n time.hours = Number(timeStringPart);\n time.has24Hours = true;\n break;\n case 'hh':\n time.hours = Number(timeStringPart);\n time.has24Hours = false;\n break;\n case 'mm':\n time.minutes = Number(timeStringPart);\n break;\n case 'ss':\n time.seconds = Number(timeStringPart);\n break;\n case 'ms':\n time.milliseconds = Number(timeStringPart);\n break;\n case 'aa':\n time.period = timeStringPart.toUpperCase() === 'PM' ? 'PM' : 'AM';\n }\n });\n return time;\n};\n\nexport const createTimeString = (time: Time | undefined, format: TimeFormat): string => {\n if (time == null) {\n return '';\n }\n\n const formatParts = format.split(':') as TimeFormatChar[];\n\n return formatParts\n .map((timeFormatPart) => {\n switch (timeFormatPart) {\n case 'HH':\n case 'hh':\n return String(time.hours).padStart(2, '0');\n case 'mm':\n return String(time.minutes).padStart(2, '0');\n case 'ss':\n return String(time.seconds).padStart(2, '0');\n case 'ms':\n return String(time.milliseconds).padStart(3, '0');\n case 'aa':\n return String(time.period);\n }\n })\n .join(':');\n};\n"]}
1
+ {"version":3,"file":"time.util.js","sourceRoot":"","sources":["../../src/utils/time.util.ts"],"names":[],"mappings":"AAqCA,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAS,EAAE;IAChD,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC;IACvB,OAAO;QACL,KAAK,EAAE,GAAG,CAAC,QAAQ,EAAE;QACrB,OAAO,EAAE,GAAG,CAAC,UAAU,EAAE;QACzB,OAAO,EAAE,GAAG,CAAC,UAAU,EAAE;QACzB,YAAY,EAAE,GAAG,CAAC,eAAe,EAAE;QACnC,UAAU,EAAE,IAAI;KACjB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,6BAA6B,GAAG,EAAE,CAAC;AAEzC,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,KAAa,EAAE,EAAE,CACtD,KAAK,GAAG,6BAA6B,CAAC,CAAC,CAAC,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AAC;IAED,MAAM,WAAW,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAqB,CAAC;IAE1D,OAAO,WAAW;SACf,GAAG,CAAC,CAAC,cAAc,EAAE,EAAE;QACtB,QAAQ,cAAc,EAAE,CAAC;YACvB,KAAK,IAAI,CAAC;YACV,KAAK,IAAI;gBACP,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;YAC7C,KAAK,IAAI;gBACP,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;YAC/C,KAAK,IAAI;gBACP,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;YAC/C,KAAK,IAAI;gBACP,OAAO,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;YACpD,KAAK,IAAI;gBACP,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC/B,CAAC;IACH,CAAC,CAAC;SACD,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC,CAAC","sourcesContent":["export type TimePeriod = 'AM' | 'PM';\n\nexport interface Time {\n hours?: number;\n minutes?: number;\n seconds?: number;\n milliseconds?: number;\n has24Hours?: boolean; // true => 24h, false => 12h\n period?: TimePeriod; // only needed for 12-hour clock\n}\n\nexport type TimeProperties = keyof Time;\n\nexport type TimeFormatChar =\n | 'HH' // 24h\n | 'hh' // 12h\n | 'mm' // minutes\n | 'ss' // seconds\n | 'ms' // milliseconds\n | 'aa'; // period (AM/PM)\n\n/*\n * Supported time formats\n */\nexport type TimeFormat =\n | 'HH:mm:ss'\n | 'hh:mm:ss:aa'\n | 'HH:mm:ss:ms'\n | 'hh:mm:ss:ms:aa'\n | 'HH:mm'\n | 'hh:mm:aa'\n | 'HH'\n | 'hh:aa'\n | 'mm'\n | 'ss'\n | 'ms';\n\nexport const getCurrentTimeIn24Hours = (): Time => {\n const now = new Date();\n return {\n hours: now.getHours(),\n minutes: now.getMinutes(),\n seconds: now.getSeconds(),\n milliseconds: now.getMilliseconds(),\n has24Hours: true,\n };\n};\n\nconst HOURS_IN_12_HOUR_CLOCK_FORMAT = 12;\n\nexport const getHoursIn12HourFormat = (hours: number) =>\n hours > HOURS_IN_12_HOUR_CLOCK_FORMAT ? hours - HOURS_IN_12_HOUR_CLOCK_FORMAT : hours;\n\nexport const getCurrentTimeIn12Hours = (): Time => {\n const now = new Date();\n const hours = now.getHours();\n return {\n hours: getHoursIn12HourFormat(hours),\n minutes: now.getMinutes(),\n seconds: now.getSeconds(),\n milliseconds: now.getMilliseconds(),\n has24Hours: false,\n period: hours >= HOURS_IN_12_HOUR_CLOCK_FORMAT ? 'PM' : 'AM',\n };\n};\n\nexport const getCurrentTime = (has24Hours = true): Time => {\n return has24Hours ? getCurrentTimeIn24Hours() : getCurrentTimeIn12Hours();\n};\n\nexport const isValidTimeString = (timeStr: string, format: TimeFormat) => {\n const timeStringParts = timeStr.split(':');\n const timeFormatParts = format.split(':');\n return timeStringParts.length === timeFormatParts.length;\n};\n\nexport const parseTimeString = (timeStr: string, format: TimeFormat): Time => {\n const timeParts = timeStr.split(':');\n const formatParts = format.split(':') as TimeFormatChar[];\n\n if (!isValidTimeString(timeStr, format)) {\n console.error(\n `Timestring did not match expected format.\\nExpected format: ${format}\\nReceived timestring: ${timeStr}`\n );\n }\n\n const time: Time = {};\n\n timeParts.forEach((timeStringPart, i) => {\n const formatStringPart: TimeFormatChar = formatParts[i];\n switch (formatStringPart) {\n case 'HH':\n time.hours = Number(timeStringPart);\n time.has24Hours = true;\n break;\n case 'hh':\n time.hours = Number(timeStringPart);\n time.has24Hours = false;\n break;\n case 'mm':\n time.minutes = Number(timeStringPart);\n break;\n case 'ss':\n time.seconds = Number(timeStringPart);\n break;\n case 'ms':\n time.milliseconds = Number(timeStringPart);\n break;\n case 'aa':\n time.period = timeStringPart.toUpperCase() === 'PM' ? 'PM' : 'AM';\n }\n });\n return time;\n};\n\nexport const createTimeString = (time: Time | undefined, format: TimeFormat): string => {\n if (time == null) {\n return '';\n }\n\n const formatParts = format.split(':') as TimeFormatChar[];\n\n return formatParts\n .map((timeFormatPart) => {\n switch (timeFormatPart) {\n case 'HH':\n case 'hh':\n return String(time.hours).padStart(2, '0');\n case 'mm':\n return String(time.minutes).padStart(2, '0');\n case 'ss':\n return String(time.seconds).padStart(2, '0');\n case 'ms':\n return String(time.milliseconds).padStart(3, '0');\n case 'aa':\n return String(time.period);\n }\n })\n .join(':');\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"time.util.spec.js","sourceRoot":"","sources":["../../src/utils/time.util.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EACtB,eAAe,GAEhB,MAAM,aAAa,CAAC;AAErB,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;IACzB,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;QACtC,EAAE,CAAC,8CAA8C,EAAE,KAAK,IAAI,EAAE;YAC5D,QAAQ;YACR,MAAM,KAAK,GAAG,CAAC,CAAC;YAEhB,OAAO;YACP,MAAM,kBAAkB,GAAG,sBAAsB,CAAC,KAAK,CAAC,CAAC;YAEzD,OAAO;YACP,MAAM,CAAC,kBAAkB,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACxC,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,8CAA8C,EAAE,KAAK,IAAI,EAAE;YAC5D,OAAO;YACP,MAAM,kBAAkB,GAAG,sBAAsB,CAAC,EAAE,CAAC,CAAC;YAEtD,OAAO;YACP,MAAM,CAAC,kBAAkB,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACxC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AAkB,CAAC,IAAU;;IACpC,MAAM,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;IAExB,MAAM,KAAK,GAAG,MAAA,IAAI,CAAC,KAAK,mCAAI,CAAC,CAAC;IAC9B,IAAI,IAAI,CAAC,UAAU,EAAE;QACnB,IAAI,CAAC,QAAQ,CAAC,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,CAAC,CAAC,CAAC;KAC3B;SAAM;QACL,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI,EAAE;YACxB,IAAI,KAAK,KAAK,EAAE,EAAE;gBAChB,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;aAClB;iBAAM;gBACL,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;aACtB;SACF;aAAM;YACL,IAAI,KAAK,KAAK,EAAE,EAAE;gBAChB,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;aACtB;iBAAM;gBACL,IAAI,CAAC,QAAQ,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC;aAC3B;SACF;KACF;IAED,IAAI,CAAC,UAAU,CAAC,MAAA,IAAI,CAAC,OAAO,mCAAI,CAAC,CAAC,CAAC;IACnC,IAAI,CAAC,UAAU,CAAC,MAAA,IAAI,CAAC,OAAO,mCAAI,CAAC,CAAC,CAAC;IACnC,IAAI,CAAC,eAAe,CAAC,MAAA,IAAI,CAAC,YAAY,mCAAI,CAAC,CAAC,CAAC;IAC7C,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC;AACxB,CAAC","sourcesContent":["import {\n createTimeString,\n getCurrentTime,\n getCurrentTimeIn12Hours,\n getCurrentTimeIn24Hours,\n getHoursIn12HourFormat,\n parseTimeString,\n Time,\n} from './time.util';\n\ndescribe('Time Util', () => {\n describe('getHoursIn12HourFormat', () => {\n it('should correctly return hour smaller than 12', async () => {\n // given\n const hours = 5;\n\n // when\n const hoursIn12HourClock = getHoursIn12HourFormat(hours);\n\n // then\n expect(hoursIn12HourClock).toEqual(5);\n });\n\n it('should correctly return hour greater than 12', async () => {\n // when\n const hoursIn12HourClock = getHoursIn12HourFormat(14);\n\n // then\n expect(hoursIn12HourClock).toEqual(2);\n });\n\n it('should correctly return hour equal to 12', async () => {\n // when\n const hoursIn12HourClock = getHoursIn12HourFormat(12);\n\n // then\n expect(hoursIn12HourClock).toEqual(12);\n });\n });\n\n describe('getCurrentTimeIn12Hours', () => {\n it('should correctly return current time', async () => {\n // when\n const linuxTime = convertToLinuxTime(getCurrentTimeIn12Hours());\n const timeNow = new Date().getTime();\n\n // then\n expect(timeNow - linuxTime).toBeLessThan(3000);\n });\n });\n\n describe('getCurrentTimeIn24Hours', () => {\n it('should correctly return current time', async () => {\n // when\n const currentTimeIn12Hours = getCurrentTimeIn24Hours();\n\n // then\n const linuxTime = convertToLinuxTime(currentTimeIn12Hours);\n const timeNow = new Date().getTime();\n expect(timeNow - linuxTime).toBeLessThan(3000);\n });\n });\n\n describe('getCurrentTime', () => {\n it('should correctly return current time for 24-hour-clock', async () => {\n // when\n const currentTime = getCurrentTime(true);\n\n // then\n const linuxTime = convertToLinuxTime(currentTime);\n const timeNow = new Date().getTime();\n expect(timeNow - linuxTime).toBeLessThan(3000);\n });\n\n it('should correctly return current time for 12-hour-clock', async () => {\n // when\n const currentTime = getCurrentTime(false);\n\n // then\n const linuxTime = convertToLinuxTime(currentTime);\n const timeNow = new Date().getTime();\n expect(timeNow - linuxTime).toBeLessThan(3000);\n });\n });\n\n describe('parseTimeString', () => {\n it('should correctly parse HH:mm:ss', async () => {\n // when\n const sixTime = parseTimeString('13:32:35', 'HH:mm:ss');\n\n // then\n expect(sixTime.hours).toEqual(13);\n expect(sixTime.minutes).toEqual(32);\n expect(sixTime.seconds).toEqual(35);\n expect(sixTime.milliseconds).toEqual(undefined);\n expect(sixTime.has24Hours).toEqual(true);\n expect(sixTime.period).toEqual(undefined);\n });\n\n it('should correctly parse hh:mm:ss:aa', () => {\n // when\n const sixTime = parseTimeString('05:12:23:am', 'hh:mm:ss:aa');\n\n // then\n expect(sixTime.hours).toEqual(5);\n expect(sixTime.minutes).toEqual(12);\n expect(sixTime.seconds).toEqual(23);\n expect(sixTime.milliseconds).toEqual(undefined);\n expect(sixTime.has24Hours).toEqual(false);\n expect(sixTime.period).toEqual('AM');\n });\n\n it('should correctly parse HH:mm:ss:ms', () => {\n // when\n const sixTime = parseTimeString('02:12:43:832', 'HH:mm:ss:ms');\n\n // then\n expect(sixTime.hours).toEqual(2);\n expect(sixTime.minutes).toEqual(12);\n expect(sixTime.seconds).toEqual(43);\n expect(sixTime.milliseconds).toEqual(832);\n expect(sixTime.has24Hours).toEqual(true);\n expect(sixTime.period).toEqual(undefined);\n });\n\n it('should correctly parse hh:mm:ss:ms:aa', () => {\n // when\n const sixTime = parseTimeString('11:59:58:999:pm', 'hh:mm:ss:ms:aa');\n\n // then\n expect(sixTime.hours).toEqual(11);\n expect(sixTime.minutes).toEqual(59);\n expect(sixTime.seconds).toEqual(58);\n expect(sixTime.milliseconds).toEqual(999);\n expect(sixTime.has24Hours).toEqual(false);\n expect(sixTime.period).toEqual('PM');\n });\n\n it('should correctly parse HH:mm', () => {\n // when\n const sixTime = parseTimeString('14:13', 'HH:mm');\n\n // then\n expect(sixTime.hours).toEqual(14);\n expect(sixTime.minutes).toEqual(13);\n expect(sixTime.seconds).toEqual(undefined);\n expect(sixTime.milliseconds).toEqual(undefined);\n expect(sixTime.has24Hours).toEqual(true);\n expect(sixTime.period).toEqual(undefined);\n });\n\n it('should correctly parse hh:mm:aa', () => {\n // when\n const sixTime = parseTimeString('12:01:am', 'hh:mm:aa');\n\n // then\n expect(sixTime.hours).toEqual(12);\n expect(sixTime.minutes).toEqual(1);\n expect(sixTime.seconds).toEqual(undefined);\n expect(sixTime.milliseconds).toEqual(undefined);\n expect(sixTime.has24Hours).toEqual(false);\n expect(sixTime.period).toEqual('AM');\n });\n\n it('should correctly parse hh:mm:aa when using only single digit', () => {\n // when\n const sixTime = parseTimeString('5:8:3:7:pm', 'hh:mm:ss:ms:aa');\n\n // then\n expect(sixTime.hours).toEqual(5);\n expect(sixTime.minutes).toEqual(8);\n expect(sixTime.seconds).toEqual(3);\n expect(sixTime.milliseconds).toEqual(7);\n expect(sixTime.has24Hours).toEqual(false);\n expect(sixTime.period).toEqual('PM');\n });\n\n it('should correctly parse HH', () => {\n // when\n const sixTime = parseTimeString('16', 'HH');\n\n // then\n expect(sixTime.hours).toEqual(16);\n expect(sixTime.minutes).toEqual(undefined);\n expect(sixTime.seconds).toEqual(undefined);\n expect(sixTime.milliseconds).toEqual(undefined);\n expect(sixTime.has24Hours).toEqual(true);\n expect(sixTime.period).toEqual(undefined);\n });\n\n it('should correctly parse hh:aa', () => {\n // when\n const sixTime = parseTimeString('10:am', 'hh:aa');\n\n // then\n expect(sixTime.hours).toEqual(10);\n expect(sixTime.minutes).toEqual(undefined);\n expect(sixTime.seconds).toEqual(undefined);\n expect(sixTime.milliseconds).toEqual(undefined);\n expect(sixTime.has24Hours).toEqual(false);\n expect(sixTime.period).toEqual('AM');\n });\n\n it('should correctly parse mm', () => {\n // when\n const sixTime = parseTimeString('22', 'mm');\n\n // then\n expect(sixTime.hours).toEqual(undefined);\n expect(sixTime.minutes).toEqual(22);\n expect(sixTime.seconds).toEqual(undefined);\n expect(sixTime.milliseconds).toEqual(undefined);\n expect(sixTime.has24Hours).toEqual(undefined);\n expect(sixTime.period).toEqual(undefined);\n });\n\n it('should correctly parse ss', () => {\n // when\n const sixTime = parseTimeString('59', 'ss');\n\n // then\n expect(sixTime.hours).toEqual(undefined);\n expect(sixTime.minutes).toEqual(undefined);\n expect(sixTime.seconds).toEqual(59);\n expect(sixTime.milliseconds).toEqual(undefined);\n expect(sixTime.has24Hours).toEqual(undefined);\n expect(sixTime.period).toEqual(undefined);\n });\n\n it('should correctly parse ms', () => {\n // when\n const sixTime = parseTimeString('647', 'ms');\n\n // then\n expect(sixTime.hours).toEqual(undefined);\n expect(sixTime.minutes).toEqual(undefined);\n expect(sixTime.seconds).toEqual(undefined);\n expect(sixTime.milliseconds).toEqual(647);\n expect(sixTime.has24Hours).toEqual(undefined);\n expect(sixTime.period).toEqual(undefined);\n });\n });\n\n describe('createTimeString', () => {\n it('should correctly format HH:mm:ss', async () => {\n // when\n const timeString = createTimeString(\n {\n hours: 21,\n minutes: 33,\n seconds: 15,\n milliseconds: 238,\n has24Hours: true,\n },\n 'HH:mm:ss'\n );\n\n // then\n expect(timeString).toEqual('21:33:15');\n });\n\n it('should correctly format hh:mm:ss:aa', async () => {\n // when\n const timeString = createTimeString(\n {\n hours: 11,\n minutes: 59,\n seconds: 15,\n milliseconds: 281,\n has24Hours: false,\n period: 'AM',\n },\n 'hh:mm:ss:aa'\n );\n\n // then\n expect(timeString).toEqual('11:59:15:AM');\n });\n\n it('should correctly format HH:mm:ss:ms', () => {\n // when\n const timeString = createTimeString(\n {\n hours: 11,\n minutes: 59,\n seconds: 15,\n milliseconds: 281,\n has24Hours: true,\n },\n 'HH:mm:ss:ms'\n );\n\n // then\n expect(timeString).toEqual('11:59:15:281');\n });\n\n it('should correctly format hh:mm:ss:ms:aa', () => {\n // when\n const timeString = createTimeString(\n {\n hours: 11,\n minutes: 59,\n seconds: 15,\n milliseconds: 281,\n has24Hours: false,\n period: 'PM',\n },\n 'hh:mm:ss:ms:aa'\n );\n\n // then\n expect(timeString).toEqual('11:59:15:281:PM');\n });\n\n it('should correctly format HH:mm', () => {\n // when\n const timeString = createTimeString(\n {\n hours: 11,\n minutes: 59,\n seconds: 15,\n milliseconds: 281,\n has24Hours: true,\n },\n 'HH:mm'\n );\n\n // then\n expect(timeString).toEqual('11:59');\n });\n\n it('should correctly format hh:mm:aa', () => {\n // when\n const timeString = createTimeString(\n {\n hours: 11,\n minutes: 59,\n seconds: 15,\n milliseconds: 281,\n has24Hours: false,\n period: 'AM',\n },\n 'hh:mm:aa'\n );\n\n // then\n expect(timeString).toEqual('11:59:AM');\n });\n\n it('should correctly format HH', () => {\n // when\n const timeString = createTimeString(\n {\n hours: 14,\n minutes: 32,\n seconds: 15,\n milliseconds: 281,\n has24Hours: true,\n },\n 'HH'\n );\n\n // then\n expect(timeString).toEqual('14');\n });\n\n it('should correctly format hh:aa', () => {\n // when\n const timeString = createTimeString(\n {\n hours: 8,\n minutes: 59,\n seconds: 15,\n milliseconds: 281,\n has24Hours: false,\n period: 'PM',\n },\n 'hh:aa'\n );\n\n // then\n expect(timeString).toEqual('08:PM');\n });\n\n it('should correctly format mm', () => {\n // when\n const timeString = createTimeString(\n {\n hours: 11,\n minutes: 2,\n seconds: 15,\n milliseconds: 281,\n has24Hours: false,\n period: 'AM',\n },\n 'mm'\n );\n\n // then\n expect(timeString).toEqual('02');\n });\n\n it('should correctly format ss', () => {\n // when\n const timeString = createTimeString(\n {\n hours: 11,\n minutes: 59,\n seconds: 7,\n milliseconds: 281,\n has24Hours: false,\n period: 'AM',\n },\n 'ss'\n );\n\n // then\n expect(timeString).toEqual('07');\n });\n\n it('should correctly format ms', () => {\n // when\n const timeString = createTimeString(\n {\n hours: 11,\n minutes: 59,\n seconds: 15,\n milliseconds: 6,\n has24Hours: false,\n period: 'AM',\n },\n 'ms'\n );\n\n // then\n expect(timeString).toEqual('006');\n });\n });\n});\n\nfunction convertToLinuxTime(time: Time) {\n const date = new Date();\n\n const hours = time.hours ?? 0;\n if (time.has24Hours) {\n date.setHours(hours ?? 0);\n } else {\n if (time.period === 'AM') {\n if (hours === 12) {\n date.setHours(0);\n } else {\n date.setHours(hours);\n }\n } else {\n if (hours === 12) {\n date.setHours(hours);\n } else {\n date.setHours(hours + 12);\n }\n }\n }\n\n date.setMinutes(time.minutes ?? 0);\n date.setSeconds(time.seconds ?? 0);\n date.setMilliseconds(time.milliseconds ?? 0);\n return date.getTime();\n}\n"]}
1
+ {"version":3,"file":"time.util.spec.js","sourceRoot":"","sources":["../../src/utils/time.util.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,uBAAuB,EACvB,uBAAuB,EAC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CAAC,KAAK,CAAC,CAAC;YACvB,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,QAAQ,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC;YAC5B,CAAC;QACH,CAAC;IACH,CAAC;IAED,IAAI,CAAC,UAAU,CAAC,MAAA,IAAI,CAAC,OAAO,mCAAI,CAAC,CAAC,CAAC;IACnC,IAAI,CAAC,UAAU,CAAC,MAAA,IAAI,CAAC,OAAO,mCAAI,CAAC,CAAC,CAAC;IACnC,IAAI,CAAC,eAAe,CAAC,MAAA,IAAI,CAAC,YAAY,mCAAI,CAAC,CAAC,CAAC;IAC7C,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC;AACxB,CAAC","sourcesContent":["import {\n createTimeString,\n getCurrentTime,\n getCurrentTimeIn12Hours,\n getCurrentTimeIn24Hours,\n getHoursIn12HourFormat,\n parseTimeString,\n Time,\n} from './time.util';\n\ndescribe('Time Util', () => {\n describe('getHoursIn12HourFormat', () => {\n it('should correctly return hour smaller than 12', async () => {\n // given\n const hours = 5;\n\n // when\n const hoursIn12HourClock = getHoursIn12HourFormat(hours);\n\n // then\n expect(hoursIn12HourClock).toEqual(5);\n });\n\n it('should correctly return hour greater than 12', async () => {\n // when\n const hoursIn12HourClock = getHoursIn12HourFormat(14);\n\n // then\n expect(hoursIn12HourClock).toEqual(2);\n });\n\n it('should correctly return hour equal to 12', async () => {\n // when\n const hoursIn12HourClock = getHoursIn12HourFormat(12);\n\n // then\n expect(hoursIn12HourClock).toEqual(12);\n });\n });\n\n describe('getCurrentTimeIn12Hours', () => {\n it('should correctly return current time', async () => {\n // when\n const linuxTime = convertToLinuxTime(getCurrentTimeIn12Hours());\n const timeNow = new Date().getTime();\n\n // then\n expect(timeNow - linuxTime).toBeLessThan(3000);\n });\n });\n\n describe('getCurrentTimeIn24Hours', () => {\n it('should correctly return current time', async () => {\n // when\n const currentTimeIn12Hours = getCurrentTimeIn24Hours();\n\n // then\n const linuxTime = convertToLinuxTime(currentTimeIn12Hours);\n const timeNow = new Date().getTime();\n expect(timeNow - linuxTime).toBeLessThan(3000);\n });\n });\n\n describe('getCurrentTime', () => {\n it('should correctly return current time for 24-hour-clock', async () => {\n // when\n const currentTime = getCurrentTime(true);\n\n // then\n const linuxTime = convertToLinuxTime(currentTime);\n const timeNow = new Date().getTime();\n expect(timeNow - linuxTime).toBeLessThan(3000);\n });\n\n it('should correctly return current time for 12-hour-clock', async () => {\n // when\n const currentTime = getCurrentTime(false);\n\n // then\n const linuxTime = convertToLinuxTime(currentTime);\n const timeNow = new Date().getTime();\n expect(timeNow - linuxTime).toBeLessThan(3000);\n });\n });\n\n describe('parseTimeString', () => {\n it('should correctly parse HH:mm:ss', async () => {\n // when\n const sixTime = parseTimeString('13:32:35', 'HH:mm:ss');\n\n // then\n expect(sixTime.hours).toEqual(13);\n expect(sixTime.minutes).toEqual(32);\n expect(sixTime.seconds).toEqual(35);\n expect(sixTime.milliseconds).toEqual(undefined);\n expect(sixTime.has24Hours).toEqual(true);\n expect(sixTime.period).toEqual(undefined);\n });\n\n it('should correctly parse hh:mm:ss:aa', () => {\n // when\n const sixTime = parseTimeString('05:12:23:am', 'hh:mm:ss:aa');\n\n // then\n expect(sixTime.hours).toEqual(5);\n expect(sixTime.minutes).toEqual(12);\n expect(sixTime.seconds).toEqual(23);\n expect(sixTime.milliseconds).toEqual(undefined);\n expect(sixTime.has24Hours).toEqual(false);\n expect(sixTime.period).toEqual('AM');\n });\n\n it('should correctly parse HH:mm:ss:ms', () => {\n // when\n const sixTime = parseTimeString('02:12:43:832', 'HH:mm:ss:ms');\n\n // then\n expect(sixTime.hours).toEqual(2);\n expect(sixTime.minutes).toEqual(12);\n expect(sixTime.seconds).toEqual(43);\n expect(sixTime.milliseconds).toEqual(832);\n expect(sixTime.has24Hours).toEqual(true);\n expect(sixTime.period).toEqual(undefined);\n });\n\n it('should correctly parse hh:mm:ss:ms:aa', () => {\n // when\n const sixTime = parseTimeString('11:59:58:999:pm', 'hh:mm:ss:ms:aa');\n\n // then\n expect(sixTime.hours).toEqual(11);\n expect(sixTime.minutes).toEqual(59);\n expect(sixTime.seconds).toEqual(58);\n expect(sixTime.milliseconds).toEqual(999);\n expect(sixTime.has24Hours).toEqual(false);\n expect(sixTime.period).toEqual('PM');\n });\n\n it('should correctly parse HH:mm', () => {\n // when\n const sixTime = parseTimeString('14:13', 'HH:mm');\n\n // then\n expect(sixTime.hours).toEqual(14);\n expect(sixTime.minutes).toEqual(13);\n expect(sixTime.seconds).toEqual(undefined);\n expect(sixTime.milliseconds).toEqual(undefined);\n expect(sixTime.has24Hours).toEqual(true);\n expect(sixTime.period).toEqual(undefined);\n });\n\n it('should correctly parse hh:mm:aa', () => {\n // when\n const sixTime = parseTimeString('12:01:am', 'hh:mm:aa');\n\n // then\n expect(sixTime.hours).toEqual(12);\n expect(sixTime.minutes).toEqual(1);\n expect(sixTime.seconds).toEqual(undefined);\n expect(sixTime.milliseconds).toEqual(undefined);\n expect(sixTime.has24Hours).toEqual(false);\n expect(sixTime.period).toEqual('AM');\n });\n\n it('should correctly parse hh:mm:aa when using only single digit', () => {\n // when\n const sixTime = parseTimeString('5:8:3:7:pm', 'hh:mm:ss:ms:aa');\n\n // then\n expect(sixTime.hours).toEqual(5);\n expect(sixTime.minutes).toEqual(8);\n expect(sixTime.seconds).toEqual(3);\n expect(sixTime.milliseconds).toEqual(7);\n expect(sixTime.has24Hours).toEqual(false);\n expect(sixTime.period).toEqual('PM');\n });\n\n it('should correctly parse HH', () => {\n // when\n const sixTime = parseTimeString('16', 'HH');\n\n // then\n expect(sixTime.hours).toEqual(16);\n expect(sixTime.minutes).toEqual(undefined);\n expect(sixTime.seconds).toEqual(undefined);\n expect(sixTime.milliseconds).toEqual(undefined);\n expect(sixTime.has24Hours).toEqual(true);\n expect(sixTime.period).toEqual(undefined);\n });\n\n it('should correctly parse hh:aa', () => {\n // when\n const sixTime = parseTimeString('10:am', 'hh:aa');\n\n // then\n expect(sixTime.hours).toEqual(10);\n expect(sixTime.minutes).toEqual(undefined);\n expect(sixTime.seconds).toEqual(undefined);\n expect(sixTime.milliseconds).toEqual(undefined);\n expect(sixTime.has24Hours).toEqual(false);\n expect(sixTime.period).toEqual('AM');\n });\n\n it('should correctly parse mm', () => {\n // when\n const sixTime = parseTimeString('22', 'mm');\n\n // then\n expect(sixTime.hours).toEqual(undefined);\n expect(sixTime.minutes).toEqual(22);\n expect(sixTime.seconds).toEqual(undefined);\n expect(sixTime.milliseconds).toEqual(undefined);\n expect(sixTime.has24Hours).toEqual(undefined);\n expect(sixTime.period).toEqual(undefined);\n });\n\n it('should correctly parse ss', () => {\n // when\n const sixTime = parseTimeString('59', 'ss');\n\n // then\n expect(sixTime.hours).toEqual(undefined);\n expect(sixTime.minutes).toEqual(undefined);\n expect(sixTime.seconds).toEqual(59);\n expect(sixTime.milliseconds).toEqual(undefined);\n expect(sixTime.has24Hours).toEqual(undefined);\n expect(sixTime.period).toEqual(undefined);\n });\n\n it('should correctly parse ms', () => {\n // when\n const sixTime = parseTimeString('647', 'ms');\n\n // then\n expect(sixTime.hours).toEqual(undefined);\n expect(sixTime.minutes).toEqual(undefined);\n expect(sixTime.seconds).toEqual(undefined);\n expect(sixTime.milliseconds).toEqual(647);\n expect(sixTime.has24Hours).toEqual(undefined);\n expect(sixTime.period).toEqual(undefined);\n });\n });\n\n describe('createTimeString', () => {\n it('should correctly format HH:mm:ss', async () => {\n // when\n const timeString = createTimeString(\n {\n hours: 21,\n minutes: 33,\n seconds: 15,\n milliseconds: 238,\n has24Hours: true,\n },\n 'HH:mm:ss'\n );\n\n // then\n expect(timeString).toEqual('21:33:15');\n });\n\n it('should correctly format hh:mm:ss:aa', async () => {\n // when\n const timeString = createTimeString(\n {\n hours: 11,\n minutes: 59,\n seconds: 15,\n milliseconds: 281,\n has24Hours: false,\n period: 'AM',\n },\n 'hh:mm:ss:aa'\n );\n\n // then\n expect(timeString).toEqual('11:59:15:AM');\n });\n\n it('should correctly format HH:mm:ss:ms', () => {\n // when\n const timeString = createTimeString(\n {\n hours: 11,\n minutes: 59,\n seconds: 15,\n milliseconds: 281,\n has24Hours: true,\n },\n 'HH:mm:ss:ms'\n );\n\n // then\n expect(timeString).toEqual('11:59:15:281');\n });\n\n it('should correctly format hh:mm:ss:ms:aa', () => {\n // when\n const timeString = createTimeString(\n {\n hours: 11,\n minutes: 59,\n seconds: 15,\n milliseconds: 281,\n has24Hours: false,\n period: 'PM',\n },\n 'hh:mm:ss:ms:aa'\n );\n\n // then\n expect(timeString).toEqual('11:59:15:281:PM');\n });\n\n it('should correctly format HH:mm', () => {\n // when\n const timeString = createTimeString(\n {\n hours: 11,\n minutes: 59,\n seconds: 15,\n milliseconds: 281,\n has24Hours: true,\n },\n 'HH:mm'\n );\n\n // then\n expect(timeString).toEqual('11:59');\n });\n\n it('should correctly format hh:mm:aa', () => {\n // when\n const timeString = createTimeString(\n {\n hours: 11,\n minutes: 59,\n seconds: 15,\n milliseconds: 281,\n has24Hours: false,\n period: 'AM',\n },\n 'hh:mm:aa'\n );\n\n // then\n expect(timeString).toEqual('11:59:AM');\n });\n\n it('should correctly format HH', () => {\n // when\n const timeString = createTimeString(\n {\n hours: 14,\n minutes: 32,\n seconds: 15,\n milliseconds: 281,\n has24Hours: true,\n },\n 'HH'\n );\n\n // then\n expect(timeString).toEqual('14');\n });\n\n it('should correctly format hh:aa', () => {\n // when\n const timeString = createTimeString(\n {\n hours: 8,\n minutes: 59,\n seconds: 15,\n milliseconds: 281,\n has24Hours: false,\n period: 'PM',\n },\n 'hh:aa'\n );\n\n // then\n expect(timeString).toEqual('08:PM');\n });\n\n it('should correctly format mm', () => {\n // when\n const timeString = createTimeString(\n {\n hours: 11,\n minutes: 2,\n seconds: 15,\n milliseconds: 281,\n has24Hours: false,\n period: 'AM',\n },\n 'mm'\n );\n\n // then\n expect(timeString).toEqual('02');\n });\n\n it('should correctly format ss', () => {\n // when\n const timeString = createTimeString(\n {\n hours: 11,\n minutes: 59,\n seconds: 7,\n milliseconds: 281,\n has24Hours: false,\n period: 'AM',\n },\n 'ss'\n );\n\n // then\n expect(timeString).toEqual('07');\n });\n\n it('should correctly format ms', () => {\n // when\n const timeString = createTimeString(\n {\n hours: 11,\n minutes: 59,\n seconds: 15,\n milliseconds: 6,\n has24Hours: false,\n period: 'AM',\n },\n 'ms'\n );\n\n // then\n expect(timeString).toEqual('006');\n });\n });\n});\n\nfunction convertToLinuxTime(time: Time) {\n const date = new Date();\n\n const hours = time.hours ?? 0;\n if (time.has24Hours) {\n date.setHours(hours ?? 0);\n } else {\n if (time.period === 'AM') {\n if (hours === 12) {\n date.setHours(0);\n } else {\n date.setHours(hours);\n }\n } else {\n if (hours === 12) {\n date.setHours(hours);\n } else {\n date.setHours(hours + 12);\n }\n }\n }\n\n date.setMinutes(time.minutes ?? 0);\n date.setSeconds(time.seconds ?? 0);\n date.setMilliseconds(time.milliseconds ?? 0);\n return date.getTime();\n}\n"]}
@@ -1,4 +1,3 @@
1
- import { SetAttributes } from './set-attributes.js';
2
1
  import { SixAlert } from './six-alert.js';
3
2
  import { SixAvatar } from './six-avatar.js';
4
3
  import { SixBadge } from './six-badge.js';
@@ -37,6 +36,7 @@ import { SixRange } from './six-range.js';
37
36
  import { SixRoot } from './six-root.js';
38
37
  import { SixSearchField } from './six-search-field.js';
39
38
  import { SixSelect } from './six-select.js';
39
+ export { g as getErrorMessage, a as getLanguage, l as languages } from './six-select.js';
40
40
  import { SixSidebar } from './six-sidebar.js';
41
41
  import { SixSidebarItem } from './six-sidebar-item.js';
42
42
  import { SixSidebarItemGroup } from './six-sidebar-item-group.js';
@@ -53,115 +53,63 @@ import { SixTimepicker } from './six-timepicker.js';
53
53
  import { SixTooltip } from './six-tooltip.js';
54
54
  export { getAssetPath, setAssetPath, setNonce, setPlatformOptions } from '@stencil/core/internal/client';
55
55
 
56
- const languages = ['de', 'fr', 'it', 'en', 'es'];
57
- const dateFormat = new Intl.DateTimeFormat('de-CH');
58
56
  /**
59
- * Returns an error message for the given language and error.
57
+ * Displays an alert on the toast stack with a specified message and optional configuration.
58
+ *
59
+ * @param message - The message to be displayed in the alert.
60
+ * @param alertType - The type of the alert. Valid values are 'primary', 'info', 'success', 'warning', 'danger'. Default is 'info'.
61
+ * @param duration - The duration in milliseconds for which the alert is displayed. If not provided, a default duration is set based on the alert type.
62
+ * @param iconName - The name of the icon to be displayed in the alert. If not provided, a default icon is set based on the alert type.
60
63
  */
61
- function getErrorMessage(language, error) {
62
- try {
63
- const message = translation[language][error.key];
64
- switch (error.key) {
65
- case 'required':
66
- case 'requiredtrue':
67
- case 'email':
68
- return message;
69
- case 'minlength':
70
- case 'maxlength':
71
- return message.replace('{requiredLength}', String(error.requiredLength));
72
- case 'pattern':
73
- return message.replace('{pattern}', String(error.requiredPattern));
74
- case 'min':
75
- return message.replace('{min}', String(error.min));
76
- case 'max':
77
- return message.replace('{max}', String(error.max));
78
- case 'mindate':
79
- return message.replace('{mindate}', dateFormat.format(error.mindate));
80
- case 'maxdate':
81
- return message.replace('{maxdate}', dateFormat.format(error.maxdate));
82
- case 'invaliddate':
83
- return message;
84
- case 'custom':
85
- return error.text;
86
- }
64
+ function showAlert(message, alertType, duration, iconName) {
65
+ const type = alertType !== null && alertType !== void 0 ? alertType : 'info';
66
+ const icon = iconName !== null && iconName !== void 0 ? iconName : getIcon(type);
67
+ const alert = Object.assign(document.createElement('six-alert'), {
68
+ type,
69
+ duration: duration !== null && duration !== void 0 ? duration : getDuration(type),
70
+ innerHTML: `<six-icon slot="icon">${icon}</six-icon>${escapeHtml(message)}`,
71
+ closable: true,
72
+ });
73
+ document.body.append(alert);
74
+ alert.toast();
75
+ }
76
+ function escapeHtml(html) {
77
+ const div = document.createElement('div');
78
+ div.textContent = html;
79
+ return div.innerHTML;
80
+ }
81
+ function getIcon(messageType) {
82
+ switch (messageType) {
83
+ case 'primary':
84
+ return 'info';
85
+ case 'info':
86
+ return 'info';
87
+ case 'success':
88
+ return 'check_circle';
89
+ case 'warning':
90
+ return 'warning';
91
+ case 'danger':
92
+ return 'report';
87
93
  }
88
- catch (e) {
89
- console.warn(`no error message in '${language}' for error:`, error);
90
- return undefined;
94
+ }
95
+ function getDuration(messageType) {
96
+ switch (messageType) {
97
+ case 'primary':
98
+ return 10000;
99
+ case 'info':
100
+ return 10000;
101
+ case 'success':
102
+ return 10000;
103
+ case 'warning':
104
+ return 20000;
105
+ case 'danger':
106
+ return 20000;
91
107
  }
92
108
  }
93
- const translation = {
94
- en: {
95
- required: 'Please fill out this field.',
96
- minlength: 'Please enter at least {requiredLength} characters.',
97
- maxlength: 'Please enter no more than {requiredLength} characters.',
98
- pattern: 'Please enter a value that matches the pattern: {pattern}.',
99
- email: 'Please enter a valid email address.',
100
- min: 'Please enter a value greater than or equal to {min}.',
101
- max: 'Please enter a value less than or equal to {max}.',
102
- requiredtrue: 'Please check this field.',
103
- mindate: 'Please enter a date on or after {mindate}.',
104
- maxdate: 'Please enter a date on or before {maxdate}.',
105
- invaliddate: 'Please enter a valid date.',
106
- },
107
- fr: {
108
- required: "Veuillez remplir ce champ s'il vous plaît.",
109
- minlength: 'Veuillez entrer au moins {requiredLength} caractères.',
110
- maxlength: 'Veuillez entrer au maximum {requiredLength} caractères.',
111
- pattern: 'Veuillez entrer une valeur qui correspond au format : {pattern}.',
112
- email: 'Veuillez entrer une adresse email valide.',
113
- min: 'Veuillez entrer une valeur supérieure ou égale à {min}.',
114
- max: 'Veuillez entrer une valeur inférieure ou égale à {max}.',
115
- requiredtrue: "Veuillez cocher cette case s'il vous plaît.",
116
- mindate: 'Veuillez entrer une date le {mindate} ou après.',
117
- maxdate: 'Veuillez entrer une date le {maxdate} ou avant.',
118
- invaliddate: 'Veuillez entrer une date valide.',
119
- },
120
- de: {
121
- required: 'Bitte füllen Sie dieses Feld aus.',
122
- minlength: 'Bitte geben Sie mindestens {requiredLength} Zeichen ein.',
123
- maxlength: 'Bitte geben Sie höchstens {requiredLength} Zeichen ein.',
124
- pattern: 'Bitte geben Sie einen Wert ein, der dem Muster entspricht: {pattern}.',
125
- email: 'Bitte geben Sie eine gültige E-Mail-Adresse ein.',
126
- min: 'Bitte geben Sie einen Wert größer oder gleich {min} ein.',
127
- max: 'Bitte geben Sie einen Wert kleiner oder gleich {max} ein.',
128
- requiredtrue: 'Bitte aktivieren Sie dieses Feld.',
129
- mindate: 'Bitte geben Sie ein Datum am oder nach dem {mindate} ein.',
130
- maxdate: 'Bitte geben Sie ein Datum am oder vor dem {maxdate} ein.',
131
- invaliddate: 'Bitte geben Sie ein gültiges Datum ein.',
132
- },
133
- it: {
134
- required: 'Si prega di compilare questo campo.',
135
- minlength: 'Si prega di inserire almeno {requiredLength} caratteri.',
136
- maxlength: 'Si prega di inserire al massimo {requiredLength} caratteri.',
137
- pattern: 'Si prega di inserire un valore che corrisponde al formato: {pattern}.',
138
- email: 'Si prega di inserire un indirizzo email valido.',
139
- min: 'Si prega di inserire un valore maggiore o uguale a {min}.',
140
- max: 'Si prega di inserire un valore minore o uguale a {max}.',
141
- requiredtrue: 'Si prega di spuntare questo campo.',
142
- mindate: 'Si prega di inserire una data il {mindate} o successiva.',
143
- maxdate: 'Si prega di inserire una data il {maxdate} o precedente.',
144
- invaliddate: 'Inserisci una data valida.',
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
- },
159
- };
160
109
 
161
110
  const defineCustomElements = (opts) => {
162
111
  if (typeof customElements !== 'undefined') {
163
112
  [
164
- SetAttributes,
165
113
  SixAlert,
166
114
  SixAvatar,
167
115
  SixBadge,
@@ -222,6 +170,6 @@ const defineCustomElements = (opts) => {
222
170
  }
223
171
  };
224
172
 
225
- export { defineCustomElements, getErrorMessage, languages };
173
+ export { defineCustomElements, showAlert };
226
174
 
227
175
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
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;IACxE,IAAI;QACF,MAAM,OAAO,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACjD,QAAQ,KAAK,CAAC,GAAG;YACf,KAAK,UAAU,CAAC;YAChB,KAAK,cAAc,CAAC;YACpB,KAAK,OAAO;gBACV,OAAO,OAAO,CAAC;YACjB,KAAK,WAAW,CAAC;YACjB,KAAK,WAAW;gBACd,OAAO,OAAO,CAAC,OAAO,CAAC,kBAAkB,EAAE,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC;YAC3E,KAAK,SAAS;gBACZ,OAAO,OAAO,CAAC,OAAO,CAAC,WAAW,EAAE,MAAM,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC;YACrE,KAAK,KAAK;gBACR,OAAO,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;YACrD,KAAK,KAAK;gBACR,OAAO,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,GA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mC;QAC7C,SAAS,EAAE,0DAA0D;QACrE,SAAS,EAAE,yDAAyD;QACpE,OAAO,EAAE,uEAAuE;QAChF,KAAK,EAAE,kDAAkD;QACzD,GAAG,EAAE,0DAA0D;QAC/D,GAAG,EAAE,2DAA2D;QAChE,YAAY,EAAE,mCAAmC;QACjD,OAAO,EAAE,2DAA2D;QACpE,OAAO,EAAE,0DAA0D;QACnE,WAAW,EAAE,yCAAyC;KACvD;IACD,EAAE,EAAE;QACF,QAAQ,EAAE,qCAAqC;QAC/C,SAAS,EAAE,yDAAyD;QACpE,SAAS,EAAE,6DAA6D;QACxE,OAAO,EAAE,uEAAuE;QAChF,KAAK,EAAE,iDAAiD;QACxD,GAAG,EAAE,2DAA2D;QAChE,GAAG,EAAE,yDAAyD;QAC9D,YAAY,EAAE,oCAAoC;QAClD,OAAO,EAAE,0DAA0D;QACnE,OAAO,EAAE,0DAA0D;QACnE,WAAW,EAAE,4BAA4B;KAC1C;IAED,EAAE,EAAE;QACF,QAAQ,EAAE,gCAAgC;QAC1C,SAAS,EAAE,6DAA6D;QACxE,SAAS,EAAE,8DAA8D;QACzE,OAAO,EAAE,uEAAuE;QAChF,KAAK,EAAE,mEAAmE;QAC1E,GAAG,EAAE,uDAAuD;QAC5D,GAAG,EAAE,uDAAuD;QAC5D,YAAY,EAAE,+BAA+B;QAC7C,OAAO,EAAE,gEAAgE;QACzE,OAAO,EAAE,+DAA+D;QACxE,WAAW,EAAE,yCAAyC;KACvD;CACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","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}
1
+ {"file":"index.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA;;;;;;;;SAQgB,SAAS,CAAC,OAAe,EAAE,SAAqB,EAAE,QAAiB,EAAE,QAAiB;IACpG,MAAM,IAAI,GAAG,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,MAAM,CAAC;IACjC,MAAM,IAAI,GAAG,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvC,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,WAAW,CAAC,EAAE;QAC/D,IAAI;QACJ,QAAQ,EAAE,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,WAAW,CAAC,IAAI,CAAC;QACvC,SAAS,EAAE,yBAAyB,IAAI,cAAc,UAAU,CAAC,OAAO,CAAC,EAAE;QAC3E,QAAQ,EAAE,IAAI;KACf,CAAC,CAAC;IACH,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC5B,KAAK,CAAC,KAAK,EAAE,CAAC;AAChB,CAAC;AAED,SAAS,UAAU,CAAC,IAAY;IAC9B,MAAM,GAAG,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC1C,GAAG,CAAC,WAAW,GAAG,IAAI,CAAC;IACvB,OAAO,GAAG,CAAC,SAAS,CAAC;AACvB,CAAC;AAED,SAAS,OAAO,CAAC,WAAsB;IACrC,QAAQ,WAAW;QACjB,KAAK,SAAS;YACZ,OAAO,MAAM,CAAC;QAChB,KAAK,MAAM;YACT,OAAO,MAAM,CAAC;QAChB,KAAK,SAAS;YACZ,OAAO,cAAc,CAAC;QACxB,KAAK,SAAS;YACZ,OAAO,SAAS,CAAC;QACnB,KAAK,QAAQ;YACX,OAAO,QAAQ,CAAC;KACnB;AACH,CAAC;AAED,SAAS,WAAW,CAAC,WAAsB;IACzC,QAAQ,WAAW;QACjB,KAAK,SAAS;YACZ,OAAO,KAAK,CAAC;QACf,KAAK,MAAM;YACT,OAAO,KAAK,CAAC;QACf,KAAK,SAAS;YACZ,OAAO,KAAK,CAAC;QACf,KAAK,SAAS;YACZ,OAAO,KAAK,CAAC;QACf,KAAK,QAAQ;YACX,OAAO,KAAK,CAAC;KAChB;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/utils/alert.ts"],"sourcesContent":["import { AlertType } from '../components/six-alert/six-alert';\n\n/**\n * Displays an alert on the toast stack with a specified message and optional configuration.\n *\n * @param message - The message to be displayed in the alert.\n * @param alertType - The type of the alert. Valid values are 'primary', 'info', 'success', 'warning', 'danger'. Default is 'info'.\n * @param duration - The duration in milliseconds for which the alert is displayed. If not provided, a default duration is set based on the alert type.\n * @param iconName - The name of the icon to be displayed in the alert. If not provided, a default icon is set based on the alert type.\n */\nexport function showAlert(message: string, alertType?: AlertType, duration?: number, iconName?: string): void {\n const type = alertType ?? 'info';\n const icon = iconName ?? getIcon(type);\n const alert = Object.assign(document.createElement('six-alert'), {\n type,\n duration: duration ?? getDuration(type),\n innerHTML: `<six-icon slot=\"icon\">${icon}</six-icon>${escapeHtml(message)}`,\n closable: true,\n });\n document.body.append(alert);\n alert.toast();\n}\n\nfunction escapeHtml(html: string): string {\n const div = document.createElement('div');\n div.textContent = html;\n return div.innerHTML;\n}\n\nfunction getIcon(messageType: AlertType): string {\n switch (messageType) {\n case 'primary':\n return 'info';\n case 'info':\n return 'info';\n case 'success':\n return 'check_circle';\n case 'warning':\n return 'warning';\n case 'danger':\n return 'report';\n }\n}\n\nfunction getDuration(messageType: AlertType): number {\n switch (messageType) {\n case 'primary':\n return 10000;\n case 'info':\n return 10000;\n case 'success':\n return 10000;\n case 'warning':\n return 20000;\n case 'danger':\n return 20000;\n }\n}\n"],"version":3}
@@ -1,19 +1,3 @@
1
- //
2
- // Determines if the browser supports focus({ preventScroll })
3
- //
4
- const isPreventScrollSupported = () => {
5
- let supported = false;
6
- const element = document.createElement('div');
7
- element.focus &&
8
- element.focus({
9
- get preventScroll() {
10
- supported = true;
11
- return false;
12
- },
13
- });
14
- return supported;
15
- };
16
-
17
1
  let activeModals = [];
18
2
  class Modal {
19
3
  constructor(element, options) {
@@ -44,6 +28,6 @@ class Modal {
44
28
  }
45
29
  }
46
30
 
47
- export { Modal as M, isPreventScrollSupported as i };
31
+ export { Modal as M };
48
32
 
49
33
  //# sourceMappingURL=modal.js.map
@@ -1 +1 @@
1
- {"file":"modal.js","mappings":"AAAA;AACA;AACA;MACa,wBAAwB,GAAG;IACtC,IAAI,SAAS,GAAG,KAAK,CAAC;IAEtB,MAAM,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC9C,OAAO,CAAC,KAAK;QACX,OAAO,CAAC,KAAK,CAAC;YACZ,IAAI,aAAa;gBACf,SAAS,GAAG,IAAI,CAAC;gBACjB,OAAO,KAAK,CAAC;aACd;SACF,CAAC,CAAC;IAEL,OAAO,SAAS,CAAC;AACnB;;ACZA,IAAI,YAAY,GAAkB,EAAE,CAAC;MAEhB,KAAK;IAIxB,YAAY,OAAoB,EAAE,OAAsB;QACtD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;KACpD;IAED,QAAQ;QACN,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAChC,QAAQ,CAAC,gBAAgB,CAAC,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;KAC1D;IAED,UAAU;QACR,YAAY,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC,KAAK,KAAK,KAAK,KAAK,IAAI,CAAC,OAAO,CAAC,CAAC;QACtE,QAAQ,CAAC,mBAAmB,CAAC,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;KAC7D;IAED,QAAQ;;QAEN,OAAO,YAAY,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,IAAI,CAAC,OAAO,CAAC;KAC/D;IAED,aAAa,CAAC,KAAY;;QACxB,MAAM,MAAM,GAAG,KAAK,CAAC,MAAqB,CAAC;QAC3C,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;;QAGnD,IAAI,IAAI,CAAC,QAAQ,EAAE,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC,OAAO,IAAI,QAAO,MAAA,IAAI,CAAC,OAAO,0CAAE,UAAU,CAAA,KAAK,UAAU,EAAE;YACjH,MAAA,IAAI,CAAC,OAAO,0CAAE,UAAU,CAAC,KAAK,CAAC,CAAC;SACjC;KACF;;;;;","names":[],"sources":["src/utils/support.ts","src/utils/modal.ts"],"sourcesContent":["//\n// Determines if the browser supports focus({ preventScroll })\n//\nexport const isPreventScrollSupported = () => {\n let supported = false;\n\n const element = document.createElement('div');\n element.focus &&\n element.focus({\n get preventScroll() {\n supported = true;\n return false;\n },\n });\n\n return supported;\n};\n","interface ModalOptions {\n onFocusOut?: (event: Event) => void;\n}\n\nlet activeModals: HTMLElement[] = [];\n\nexport default class Modal {\n element: HTMLElement;\n options?: ModalOptions;\n\n constructor(element: HTMLElement, options?: ModalOptions) {\n this.element = element;\n this.options = options;\n this.handleFocusIn = this.handleFocusIn.bind(this);\n }\n\n activate() {\n activeModals.push(this.element);\n document.addEventListener('focusin', this.handleFocusIn);\n }\n\n deactivate() {\n activeModals = activeModals.filter((modal) => modal !== this.element);\n document.removeEventListener('focusin', this.handleFocusIn);\n }\n\n isActive() {\n // The \"active\" modal is always the most recent one shown\n return activeModals[activeModals.length - 1] === this.element;\n }\n\n handleFocusIn(event: Event) {\n const target = event.target as HTMLElement;\n const tagName = this.element.tagName.toLowerCase();\n\n // If focus is lost while the modal is active, run the onFocusOut callback\n if (this.isActive() && target.closest(tagName) !== this.element && typeof this.options?.onFocusOut === 'function') {\n this.options?.onFocusOut(event);\n }\n }\n}\n"],"version":3}
1
+ {"file":"modal.js","mappings":"AAIA,IAAI,YAAY,GAAkB,EAAE,CAAC;MAEhB,KAAK;IAIxB,YAAY,OAAoB,EAAE,OAAsB;QACtD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;KACpD;IAED,QAAQ;QACN,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAChC,QAAQ,CAAC,gBAAgB,CAAC,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;KAC1D;IAED,UAAU;QACR,YAAY,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC,KAAK,KAAK,KAAK,KAAK,IAAI,CAAC,OAAO,CAAC,CAAC;QACtE,QAAQ,CAAC,mBAAmB,CAAC,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;KAC7D;IAED,QAAQ;;QAEN,OAAO,YAAY,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,IAAI,CAAC,OAAO,CAAC;KAC/D;IAED,aAAa,CAAC,KAAY;;QACxB,MAAM,MAAM,GAAG,KAAK,CAAC,MAAqB,CAAC;QAC3C,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;;QAGnD,IAAI,IAAI,CAAC,QAAQ,EAAE,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC,OAAO,IAAI,QAAO,MAAA,IAAI,CAAC,OAAO,0CAAE,UAAU,CAAA,KAAK,UAAU,EAAE;YACjH,MAAA,IAAI,CAAC,OAAO,0CAAE,UAAU,CAAC,KAAK,CAAC,CAAC;SACjC;KACF;;;;;","names":[],"sources":["src/utils/modal.ts"],"sourcesContent":["interface ModalOptions {\n onFocusOut?: (event: Event) => void;\n}\n\nlet activeModals: HTMLElement[] = [];\n\nexport default class Modal {\n element: HTMLElement;\n options?: ModalOptions;\n\n constructor(element: HTMLElement, options?: ModalOptions) {\n this.element = element;\n this.options = options;\n this.handleFocusIn = this.handleFocusIn.bind(this);\n }\n\n activate() {\n activeModals.push(this.element);\n document.addEventListener('focusin', this.handleFocusIn);\n }\n\n deactivate() {\n activeModals = activeModals.filter((modal) => modal !== this.element);\n document.removeEventListener('focusin', this.handleFocusIn);\n }\n\n isActive() {\n // The \"active\" modal is always the most recent one shown\n return activeModals[activeModals.length - 1] === this.element;\n }\n\n handleFocusIn(event: Event) {\n const target = event.target as HTMLElement;\n const tagName = this.element.tagName.toLowerCase();\n\n // If focus is lost while the modal is active, run the onFocusOut callback\n if (this.isActive() && target.closest(tagName) !== this.element && typeof this.options?.onFocusOut === 'function') {\n this.options?.onFocusOut(event);\n }\n }\n}\n"],"version":3}