@six-group/ui-library 0.0.0-insider.a358260 → 0.0.0-insider.cd0cd0d

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 (737) hide show
  1. package/dist/cjs/event-listeners-b835dfae.js +61 -0
  2. package/dist/cjs/event-listeners-b835dfae.js.map +1 -0
  3. package/dist/cjs/{execution-control-46f388e0.js → execution-control-45c84c46.js} +6 -3
  4. package/dist/cjs/execution-control-45c84c46.js.map +1 -0
  5. package/dist/cjs/{focus-visible-0b352c74.js → focus-visible-e0d93a95.js} +3 -3
  6. package/dist/cjs/focus-visible-e0d93a95.js.map +1 -0
  7. package/dist/cjs/form-8cbd4e0e.js +20 -0
  8. package/dist/cjs/form-8cbd4e0e.js.map +1 -0
  9. package/dist/cjs/{form-control-2c17c573.js → form-control-8df00a52.js} +9 -10
  10. package/dist/cjs/form-control-8df00a52.js.map +1 -0
  11. package/dist/cjs/index.cjs.js +94 -0
  12. package/dist/cjs/index.cjs.js.map +1 -1
  13. package/dist/cjs/loader.cjs.js +1 -1
  14. package/dist/cjs/{modal-48d42228.js → modal-21350fb5.js} +4 -3
  15. package/dist/cjs/modal-21350fb5.js.map +1 -0
  16. package/dist/cjs/{popover-f743f62b.js → popover-8885d50f.js} +39 -31
  17. package/dist/cjs/popover-8885d50f.js.map +1 -0
  18. package/dist/cjs/popup-44836aaf.js +103 -0
  19. package/dist/cjs/popup-44836aaf.js.map +1 -0
  20. package/dist/cjs/set-attributes_2.cjs.entry.js +3 -1
  21. package/dist/cjs/set-attributes_2.cjs.entry.js.map +1 -1
  22. package/dist/cjs/six-alert.cjs.entry.js +17 -22
  23. package/dist/cjs/six-alert.cjs.entry.js.map +1 -1
  24. package/dist/cjs/six-avatar.cjs.entry.js +4 -7
  25. package/dist/cjs/six-avatar.cjs.entry.js.map +1 -1
  26. package/dist/cjs/six-badge.cjs.entry.js +1 -1
  27. package/dist/cjs/six-badge.cjs.entry.js.map +1 -1
  28. package/dist/cjs/six-button.cjs.entry.js +35 -33
  29. package/dist/cjs/six-button.cjs.entry.js.map +1 -1
  30. package/dist/cjs/six-card.cjs.entry.js.map +1 -1
  31. package/dist/cjs/six-checkbox.cjs.entry.js +9 -47
  32. package/dist/cjs/six-checkbox.cjs.entry.js.map +1 -1
  33. package/dist/cjs/six-datepicker.cjs.entry.js +150 -278
  34. package/dist/cjs/six-datepicker.cjs.entry.js.map +1 -1
  35. package/dist/cjs/six-details.cjs.entry.js +47 -46
  36. package/dist/cjs/six-details.cjs.entry.js.map +1 -1
  37. package/dist/cjs/six-dialog.cjs.entry.js +35 -39
  38. package/dist/cjs/six-dialog.cjs.entry.js.map +1 -1
  39. package/dist/cjs/six-drawer.cjs.entry.js +32 -36
  40. package/dist/cjs/six-drawer.cjs.entry.js.map +1 -1
  41. package/dist/cjs/six-dropdown_2.cjs.entry.js +214 -195
  42. package/dist/cjs/six-dropdown_2.cjs.entry.js.map +1 -1
  43. package/dist/cjs/six-error-page.cjs.entry.js +19 -21
  44. package/dist/cjs/six-error-page.cjs.entry.js.map +1 -1
  45. package/dist/cjs/six-file-list-item.cjs.entry.js +1 -1
  46. package/dist/cjs/six-file-list-item.cjs.entry.js.map +1 -1
  47. package/dist/cjs/six-file-upload.cjs.entry.js +20 -20
  48. package/dist/cjs/six-file-upload.cjs.entry.js.map +1 -1
  49. package/dist/cjs/six-group-label.cjs.entry.js +11 -10
  50. package/dist/cjs/six-group-label.cjs.entry.js.map +1 -1
  51. package/dist/cjs/six-header.cjs.entry.js +65 -43
  52. package/dist/cjs/six-header.cjs.entry.js.map +1 -1
  53. package/dist/cjs/six-icon-button.cjs.entry.js +3 -3
  54. package/dist/cjs/six-icon-button.cjs.entry.js.map +1 -1
  55. package/dist/cjs/six-input.cjs.entry.js +28 -87
  56. package/dist/cjs/six-input.cjs.entry.js.map +1 -1
  57. package/dist/cjs/six-item-picker.cjs.entry.js +58 -77
  58. package/dist/cjs/six-item-picker.cjs.entry.js.map +1 -1
  59. package/dist/cjs/six-language-switcher.cjs.entry.js +1 -1
  60. package/dist/cjs/six-language-switcher.cjs.entry.js.map +1 -1
  61. package/dist/cjs/six-layout-grid.cjs.entry.js +4 -2
  62. package/dist/cjs/six-layout-grid.cjs.entry.js.map +1 -1
  63. package/dist/cjs/six-main-container.cjs.entry.js.map +1 -1
  64. package/dist/cjs/six-menu-item.cjs.entry.js +8 -6
  65. package/dist/cjs/six-menu-item.cjs.entry.js.map +1 -1
  66. package/dist/cjs/six-picto.cjs.entry.js +4 -1
  67. package/dist/cjs/six-picto.cjs.entry.js.map +1 -1
  68. package/dist/cjs/six-progress-ring.cjs.entry.js +3 -3
  69. package/dist/cjs/six-progress-ring.cjs.entry.js.map +1 -1
  70. package/dist/cjs/six-radio.cjs.entry.js +17 -23
  71. package/dist/cjs/six-radio.cjs.entry.js.map +1 -1
  72. package/dist/cjs/six-range.cjs.entry.js +6 -44
  73. package/dist/cjs/six-range.cjs.entry.js.map +1 -1
  74. package/dist/cjs/six-root.cjs.entry.js +1 -1
  75. package/dist/cjs/six-root.cjs.entry.js.map +1 -1
  76. package/dist/cjs/six-search-field.cjs.entry.js +10 -5
  77. package/dist/cjs/six-search-field.cjs.entry.js.map +1 -1
  78. package/dist/cjs/six-select.cjs.entry.js +129 -222
  79. package/dist/cjs/six-select.cjs.entry.js.map +1 -1
  80. package/dist/cjs/six-sidebar-item-group.cjs.entry.js +9 -5
  81. package/dist/cjs/six-sidebar-item-group.cjs.entry.js.map +1 -1
  82. package/dist/cjs/six-sidebar.cjs.entry.js +39 -18
  83. package/dist/cjs/six-sidebar.cjs.entry.js.map +1 -1
  84. package/dist/cjs/six-spinner.cjs.entry.js.map +1 -1
  85. package/dist/cjs/six-switch.cjs.entry.js +54 -62
  86. package/dist/cjs/six-switch.cjs.entry.js.map +1 -1
  87. package/dist/cjs/six-tab-group.cjs.entry.js +130 -112
  88. package/dist/cjs/six-tab-group.cjs.entry.js.map +1 -1
  89. package/dist/cjs/six-tab-panel.cjs.entry.js +1 -1
  90. package/dist/cjs/six-tab-panel.cjs.entry.js.map +1 -1
  91. package/dist/cjs/six-tab.cjs.entry.js +4 -2
  92. package/dist/cjs/six-tab.cjs.entry.js.map +1 -1
  93. package/dist/cjs/six-tag.cjs.entry.js +4 -7
  94. package/dist/cjs/six-tag.cjs.entry.js.map +1 -1
  95. package/dist/cjs/six-textarea.cjs.entry.js +27 -76
  96. package/dist/cjs/six-textarea.cjs.entry.js.map +1 -1
  97. package/dist/cjs/six-tile.cjs.entry.js +13 -16
  98. package/dist/cjs/six-tile.cjs.entry.js.map +1 -1
  99. package/dist/cjs/six-timepicker.cjs.entry.js +157 -213
  100. package/dist/cjs/six-timepicker.cjs.entry.js.map +1 -1
  101. package/dist/cjs/six-tooltip.cjs.entry.js +53 -56
  102. package/dist/cjs/six-tooltip.cjs.entry.js.map +1 -1
  103. package/dist/cjs/{slot-ad537f24.js → slot-bccbdb59.js} +11 -10
  104. package/dist/cjs/slot-bccbdb59.js.map +1 -0
  105. package/dist/cjs/ui-library.cjs.js +1 -1
  106. package/dist/collection/collection-manifest.json +0 -1
  107. package/dist/collection/components/six-alert/six-alert.js +17 -22
  108. package/dist/collection/components/six-alert/six-alert.js.map +1 -1
  109. package/dist/collection/components/six-avatar/six-avatar.js +4 -7
  110. package/dist/collection/components/six-avatar/six-avatar.js.map +1 -1
  111. package/dist/collection/components/six-badge/six-badge.js +1 -1
  112. package/dist/collection/components/six-badge/six-badge.js.map +1 -1
  113. package/dist/collection/components/six-button/six-button.js +44 -40
  114. package/dist/collection/components/six-button/six-button.js.map +1 -1
  115. package/dist/collection/components/six-card/six-card.js +1 -1
  116. package/dist/collection/components/six-card/six-card.js.map +1 -1
  117. package/dist/collection/components/six-checkbox/six-checkbox.js +20 -128
  118. package/dist/collection/components/six-checkbox/six-checkbox.js.map +1 -1
  119. package/dist/collection/components/six-datepicker/components/day-selection.js +2 -2
  120. package/dist/collection/components/six-datepicker/components/day-selection.js.map +1 -1
  121. package/dist/collection/components/six-datepicker/components/month-selection.js +4 -3
  122. package/dist/collection/components/six-datepicker/components/month-selection.js.map +1 -1
  123. package/dist/collection/components/six-datepicker/components/year-selection.js +9 -6
  124. package/dist/collection/components/six-datepicker/components/year-selection.js.map +1 -1
  125. package/dist/collection/components/six-datepicker/six-datepicker.js +186 -376
  126. package/dist/collection/components/six-datepicker/six-datepicker.js.map +1 -1
  127. package/dist/collection/components/six-details/six-details.js +51 -50
  128. package/dist/collection/components/six-details/six-details.js.map +1 -1
  129. package/dist/collection/components/six-dialog/six-dialog.js +34 -38
  130. package/dist/collection/components/six-dialog/six-dialog.js.map +1 -1
  131. package/dist/collection/components/six-drawer/six-drawer.js +31 -35
  132. package/dist/collection/components/six-drawer/six-drawer.js.map +1 -1
  133. package/dist/collection/components/six-dropdown/six-dropdown.js +185 -173
  134. package/dist/collection/components/six-dropdown/six-dropdown.js.map +1 -1
  135. package/dist/collection/components/six-error-page/six-error-page.js +25 -27
  136. package/dist/collection/components/six-error-page/six-error-page.js.map +1 -1
  137. package/dist/collection/components/six-file-list-item/six-file-list-item.js +3 -3
  138. package/dist/collection/components/six-file-list-item/six-file-list-item.js.map +1 -1
  139. package/dist/collection/components/six-file-upload/six-file-upload.js +32 -32
  140. package/dist/collection/components/six-file-upload/six-file-upload.js.map +1 -1
  141. package/dist/collection/components/six-group-label/six-group-label.js +12 -10
  142. package/dist/collection/components/six-group-label/six-group-label.js.map +1 -1
  143. package/dist/collection/components/six-header/six-header.js +64 -42
  144. package/dist/collection/components/six-header/six-header.js.map +1 -1
  145. package/dist/collection/components/six-icon-button/six-icon-button.js +8 -8
  146. package/dist/collection/components/six-icon-button/six-icon-button.js.map +1 -1
  147. package/dist/collection/components/six-input/six-input.js +77 -274
  148. package/dist/collection/components/six-input/six-input.js.map +1 -1
  149. package/dist/collection/components/six-item-picker/six-item-picker.js +65 -84
  150. package/dist/collection/components/six-item-picker/six-item-picker.js.map +1 -1
  151. package/dist/collection/components/six-language-switcher/six-language-switcher.js +2 -2
  152. package/dist/collection/components/six-language-switcher/six-language-switcher.js.map +1 -1
  153. package/dist/collection/components/six-layout-grid/six-layout-grid.js +10 -8
  154. package/dist/collection/components/six-layout-grid/six-layout-grid.js.map +1 -1
  155. package/dist/collection/components/six-main-container/six-main-container.js +1 -1
  156. package/dist/collection/components/six-main-container/six-main-container.js.map +1 -1
  157. package/dist/collection/components/six-menu/six-menu.js +29 -23
  158. package/dist/collection/components/six-menu/six-menu.js.map +1 -1
  159. package/dist/collection/components/six-menu-item/six-menu-item.js +7 -5
  160. package/dist/collection/components/six-menu-item/six-menu-item.js.map +1 -1
  161. package/dist/collection/components/six-picto/six-picto.js +5 -2
  162. package/dist/collection/components/six-picto/six-picto.js.map +1 -1
  163. package/dist/collection/components/six-progress-ring/six-progress-ring.js +5 -4
  164. package/dist/collection/components/six-progress-ring/six-progress-ring.js.map +1 -1
  165. package/dist/collection/components/six-radio/six-radio.js +21 -76
  166. package/dist/collection/components/six-radio/six-radio.js.map +1 -1
  167. package/dist/collection/components/six-range/six-range.js +27 -119
  168. package/dist/collection/components/six-range/six-range.js.map +1 -1
  169. package/dist/collection/components/six-root/six-root.js +4 -4
  170. package/dist/collection/components/six-root/six-root.js.map +1 -1
  171. package/dist/collection/components/six-search-field/six-search-field.js +10 -5
  172. package/dist/collection/components/six-search-field/six-search-field.js.map +1 -1
  173. package/dist/collection/components/six-select/six-select.js +165 -294
  174. package/dist/collection/components/six-select/six-select.js.map +1 -1
  175. package/dist/collection/components/six-select/util.js.map +1 -1
  176. package/dist/collection/components/six-sidebar/six-sidebar.js +40 -19
  177. package/dist/collection/components/six-sidebar/six-sidebar.js.map +1 -1
  178. package/dist/collection/components/six-sidebar-item-group/six-sidebar-item-group.js +12 -8
  179. package/dist/collection/components/six-sidebar-item-group/six-sidebar-item-group.js.map +1 -1
  180. package/dist/collection/components/six-spinner/six-spinner.js.map +1 -1
  181. package/dist/collection/components/six-stage-indicator/six-stage-indicator.js +1 -1
  182. package/dist/collection/components/six-switch/six-switch.css +77 -0
  183. package/dist/collection/components/six-switch/six-switch.js +96 -133
  184. package/dist/collection/components/six-switch/six-switch.js.map +1 -1
  185. package/dist/collection/components/six-tab/six-tab.js +5 -3
  186. package/dist/collection/components/six-tab/six-tab.js.map +1 -1
  187. package/dist/collection/components/six-tab-group/six-tab-group.js +130 -112
  188. package/dist/collection/components/six-tab-group/six-tab-group.js.map +1 -1
  189. package/dist/collection/components/six-tab-panel/six-tab-panel.js +2 -2
  190. package/dist/collection/components/six-tab-panel/six-tab-panel.js.map +1 -1
  191. package/dist/collection/components/six-tag/six-tag.js +4 -7
  192. package/dist/collection/components/six-tag/six-tag.js.map +1 -1
  193. package/dist/collection/components/six-textarea/six-textarea.js +72 -207
  194. package/dist/collection/components/six-textarea/six-textarea.js.map +1 -1
  195. package/dist/collection/components/six-tile/six-tile.js +17 -20
  196. package/dist/collection/components/six-tile/six-tile.js.map +1 -1
  197. package/dist/collection/components/six-timepicker/six-timepicker.js +153 -254
  198. package/dist/collection/components/six-timepicker/six-timepicker.js.map +1 -1
  199. package/dist/collection/components/six-tooltip/six-tooltip.js +56 -59
  200. package/dist/collection/components/six-tooltip/six-tooltip.js.map +1 -1
  201. package/dist/collection/functional-components/form-control/form-control.js +8 -9
  202. package/dist/collection/functional-components/form-control/form-control.js.map +1 -1
  203. package/dist/collection/index.js +1 -1
  204. package/dist/collection/index.js.map +1 -1
  205. package/dist/collection/testUtil/delay.js.map +1 -1
  206. package/dist/collection/utils/date-util.js +25 -16
  207. package/dist/collection/utils/date-util.js.map +1 -1
  208. package/dist/collection/utils/error-messages.js +91 -0
  209. package/dist/collection/utils/error-messages.js.map +1 -0
  210. package/dist/collection/utils/event-listeners.js +22 -6
  211. package/dist/collection/utils/event-listeners.js.map +1 -1
  212. package/dist/collection/utils/execution-control.js +5 -4
  213. package/dist/collection/utils/execution-control.js.map +1 -1
  214. package/dist/collection/utils/focus-visible.js +2 -2
  215. package/dist/collection/utils/focus-visible.js.map +1 -1
  216. package/dist/collection/utils/form.js +15 -0
  217. package/dist/collection/utils/form.js.map +1 -0
  218. package/dist/collection/utils/modal.js +3 -2
  219. package/dist/collection/utils/modal.js.map +1 -1
  220. package/dist/collection/utils/popover.js +32 -18
  221. package/dist/collection/utils/popover.js.map +1 -1
  222. package/dist/collection/utils/popup.js +95 -0
  223. package/dist/collection/utils/popup.js.map +1 -0
  224. package/dist/collection/utils/slot.js +9 -24
  225. package/dist/collection/utils/slot.js.map +1 -1
  226. package/dist/collection/utils/tabbable.js +6 -6
  227. package/dist/collection/utils/tabbable.js.map +1 -1
  228. package/dist/collection/utils/time.util.js +48 -34
  229. package/dist/collection/utils/time.util.js.map +1 -1
  230. package/dist/collection/utils/type-check.js +0 -1
  231. package/dist/collection/utils/type-check.js.map +1 -1
  232. package/dist/collection/wrappers/set-attributes/set-attributes.js +3 -1
  233. package/dist/collection/wrappers/set-attributes/set-attributes.js.map +1 -1
  234. package/dist/components/event-listeners.js +22 -6
  235. package/dist/components/event-listeners.js.map +1 -1
  236. package/dist/components/execution-control.js +5 -2
  237. package/dist/components/execution-control.js.map +1 -1
  238. package/dist/components/focus-visible.js +2 -2
  239. package/dist/components/focus-visible.js.map +1 -1
  240. package/dist/components/form-control.js +8 -9
  241. package/dist/components/form-control.js.map +1 -1
  242. package/dist/components/form.js +18 -0
  243. package/dist/components/form.js.map +1 -0
  244. package/dist/components/index.js +92 -3
  245. package/dist/components/index.js.map +1 -1
  246. package/dist/components/modal.js +3 -2
  247. package/dist/components/modal.js.map +1 -1
  248. package/dist/components/popover.js +38 -30
  249. package/dist/components/popover.js.map +1 -1
  250. package/dist/components/set-attributes2.js +3 -1
  251. package/dist/components/set-attributes2.js.map +1 -1
  252. package/dist/components/six-alert.js +17 -22
  253. package/dist/components/six-alert.js.map +1 -1
  254. package/dist/components/six-avatar.js +4 -7
  255. package/dist/components/six-avatar.js.map +1 -1
  256. package/dist/components/six-badge.js +1 -1
  257. package/dist/components/six-badge.js.map +1 -1
  258. package/dist/components/six-button.js +34 -32
  259. package/dist/components/six-button.js.map +1 -1
  260. package/dist/components/six-card.js.map +1 -1
  261. package/dist/components/six-checkbox.js +7 -50
  262. package/dist/components/six-checkbox.js.map +1 -1
  263. package/dist/components/six-datepicker.js +150 -281
  264. package/dist/components/six-datepicker.js.map +1 -1
  265. package/dist/components/six-details2.js +46 -45
  266. package/dist/components/six-details2.js.map +1 -1
  267. package/dist/components/six-dialog.js +33 -37
  268. package/dist/components/six-dialog.js.map +1 -1
  269. package/dist/components/six-drawer.js +30 -34
  270. package/dist/components/six-drawer.js.map +1 -1
  271. package/dist/components/six-dropdown2.js +185 -173
  272. package/dist/components/six-dropdown2.js.map +1 -1
  273. package/dist/components/six-error-page.js +19 -21
  274. package/dist/components/six-error-page.js.map +1 -1
  275. package/dist/components/six-file-list-item.js +1 -1
  276. package/dist/components/six-file-list-item.js.map +1 -1
  277. package/dist/components/six-file-upload.js +20 -20
  278. package/dist/components/six-file-upload.js.map +1 -1
  279. package/dist/components/six-group-label.js +10 -9
  280. package/dist/components/six-group-label.js.map +1 -1
  281. package/dist/components/six-header.js +64 -42
  282. package/dist/components/six-header.js.map +1 -1
  283. package/dist/components/six-icon-button2.js +2 -2
  284. package/dist/components/six-icon-button2.js.map +1 -1
  285. package/dist/components/six-input2.js +30 -98
  286. package/dist/components/six-input2.js.map +1 -1
  287. package/dist/components/six-item-picker2.js +56 -75
  288. package/dist/components/six-item-picker2.js.map +1 -1
  289. package/dist/components/six-language-switcher.js +1 -1
  290. package/dist/components/six-language-switcher.js.map +1 -1
  291. package/dist/components/six-layout-grid.js +5 -3
  292. package/dist/components/six-layout-grid.js.map +1 -1
  293. package/dist/components/six-main-container.js.map +1 -1
  294. package/dist/components/six-menu-item2.js +7 -5
  295. package/dist/components/six-menu-item2.js.map +1 -1
  296. package/dist/components/six-menu2.js +25 -18
  297. package/dist/components/six-menu2.js.map +1 -1
  298. package/dist/components/six-picto2.js +4 -1
  299. package/dist/components/six-picto2.js.map +1 -1
  300. package/dist/components/six-progress-ring.js +3 -3
  301. package/dist/components/six-progress-ring.js.map +1 -1
  302. package/dist/components/six-radio.js +19 -28
  303. package/dist/components/six-radio.js.map +1 -1
  304. package/dist/components/six-range.js +8 -50
  305. package/dist/components/six-range.js.map +1 -1
  306. package/dist/components/six-root.js +1 -1
  307. package/dist/components/six-root.js.map +1 -1
  308. package/dist/components/six-search-field.js +8 -3
  309. package/dist/components/six-search-field.js.map +1 -1
  310. package/dist/components/six-select.js +129 -228
  311. package/dist/components/six-select.js.map +1 -1
  312. package/dist/components/six-sidebar-item-group.js +8 -4
  313. package/dist/components/six-sidebar-item-group.js.map +1 -1
  314. package/dist/components/six-sidebar.js +39 -18
  315. package/dist/components/six-sidebar.js.map +1 -1
  316. package/dist/components/six-spinner2.js.map +1 -1
  317. package/dist/components/six-switch.js +58 -68
  318. package/dist/components/six-switch.js.map +1 -1
  319. package/dist/components/six-tab-group.js +129 -111
  320. package/dist/components/six-tab-group.js.map +1 -1
  321. package/dist/components/six-tab-panel.js +1 -1
  322. package/dist/components/six-tab-panel.js.map +1 -1
  323. package/dist/components/six-tab.js +4 -2
  324. package/dist/components/six-tab.js.map +1 -1
  325. package/dist/components/six-tag2.js +4 -7
  326. package/dist/components/six-tag2.js.map +1 -1
  327. package/dist/components/six-textarea.js +29 -84
  328. package/dist/components/six-textarea.js.map +1 -1
  329. package/dist/components/six-tile.js +14 -17
  330. package/dist/components/six-tile.js.map +1 -1
  331. package/dist/components/six-timepicker.js +1 -1
  332. package/dist/components/six-timepicker2.js +247 -258
  333. package/dist/components/six-timepicker2.js.map +1 -1
  334. package/dist/components/six-tooltip2.js +52 -55
  335. package/dist/components/six-tooltip2.js.map +1 -1
  336. package/dist/components/slot.js +10 -9
  337. package/dist/components/slot.js.map +1 -1
  338. package/dist/components.json +494 -891
  339. package/dist/esm/event-listeners-535f3ad1.js +59 -0
  340. package/dist/esm/event-listeners-535f3ad1.js.map +1 -0
  341. package/dist/esm/{execution-control-1a60d709.js → execution-control-72cc50f4.js} +6 -3
  342. package/dist/esm/execution-control-72cc50f4.js.map +1 -0
  343. package/dist/esm/{focus-visible-97933ea9.js → focus-visible-fa7129a0.js} +3 -3
  344. package/dist/esm/focus-visible-fa7129a0.js.map +1 -0
  345. package/dist/esm/form-0b9c11cd.js +18 -0
  346. package/dist/esm/form-0b9c11cd.js.map +1 -0
  347. package/dist/esm/{form-control-3b440ea1.js → form-control-785c5f79.js} +9 -10
  348. package/dist/esm/form-control-785c5f79.js.map +1 -0
  349. package/dist/esm/index.js +91 -0
  350. package/dist/esm/index.js.map +1 -1
  351. package/dist/esm/loader.js +1 -1
  352. package/dist/esm/{modal-5ebdc320.js → modal-b1d96441.js} +4 -3
  353. package/dist/esm/modal-b1d96441.js.map +1 -0
  354. package/dist/esm/{popover-bd2c2fca.js → popover-2e72e7d8.js} +39 -31
  355. package/dist/esm/popover-2e72e7d8.js.map +1 -0
  356. package/dist/esm/popup-678b8592.js +98 -0
  357. package/dist/esm/popup-678b8592.js.map +1 -0
  358. package/dist/esm/set-attributes_2.entry.js +3 -1
  359. package/dist/esm/set-attributes_2.entry.js.map +1 -1
  360. package/dist/esm/six-alert.entry.js +17 -22
  361. package/dist/esm/six-alert.entry.js.map +1 -1
  362. package/dist/esm/six-avatar.entry.js +4 -7
  363. package/dist/esm/six-avatar.entry.js.map +1 -1
  364. package/dist/esm/six-badge.entry.js +1 -1
  365. package/dist/esm/six-badge.entry.js.map +1 -1
  366. package/dist/esm/six-button.entry.js +35 -33
  367. package/dist/esm/six-button.entry.js.map +1 -1
  368. package/dist/esm/six-card.entry.js.map +1 -1
  369. package/dist/esm/six-checkbox.entry.js +9 -47
  370. package/dist/esm/six-checkbox.entry.js.map +1 -1
  371. package/dist/esm/six-datepicker.entry.js +148 -276
  372. package/dist/esm/six-datepicker.entry.js.map +1 -1
  373. package/dist/esm/six-details.entry.js +47 -46
  374. package/dist/esm/six-details.entry.js.map +1 -1
  375. package/dist/esm/six-dialog.entry.js +35 -39
  376. package/dist/esm/six-dialog.entry.js.map +1 -1
  377. package/dist/esm/six-drawer.entry.js +32 -36
  378. package/dist/esm/six-drawer.entry.js.map +1 -1
  379. package/dist/esm/six-dropdown_2.entry.js +214 -195
  380. package/dist/esm/six-dropdown_2.entry.js.map +1 -1
  381. package/dist/esm/six-error-page.entry.js +19 -21
  382. package/dist/esm/six-error-page.entry.js.map +1 -1
  383. package/dist/esm/six-file-list-item.entry.js +1 -1
  384. package/dist/esm/six-file-list-item.entry.js.map +1 -1
  385. package/dist/esm/six-file-upload.entry.js +20 -20
  386. package/dist/esm/six-file-upload.entry.js.map +1 -1
  387. package/dist/esm/six-group-label.entry.js +11 -10
  388. package/dist/esm/six-group-label.entry.js.map +1 -1
  389. package/dist/esm/six-header.entry.js +65 -43
  390. package/dist/esm/six-header.entry.js.map +1 -1
  391. package/dist/esm/six-icon-button.entry.js +3 -3
  392. package/dist/esm/six-icon-button.entry.js.map +1 -1
  393. package/dist/esm/six-input.entry.js +28 -87
  394. package/dist/esm/six-input.entry.js.map +1 -1
  395. package/dist/esm/six-item-picker.entry.js +58 -77
  396. package/dist/esm/six-item-picker.entry.js.map +1 -1
  397. package/dist/esm/six-language-switcher.entry.js +1 -1
  398. package/dist/esm/six-language-switcher.entry.js.map +1 -1
  399. package/dist/esm/six-layout-grid.entry.js +4 -2
  400. package/dist/esm/six-layout-grid.entry.js.map +1 -1
  401. package/dist/esm/six-main-container.entry.js.map +1 -1
  402. package/dist/esm/six-menu-item.entry.js +8 -6
  403. package/dist/esm/six-menu-item.entry.js.map +1 -1
  404. package/dist/esm/six-picto.entry.js +4 -1
  405. package/dist/esm/six-picto.entry.js.map +1 -1
  406. package/dist/esm/six-progress-ring.entry.js +3 -3
  407. package/dist/esm/six-progress-ring.entry.js.map +1 -1
  408. package/dist/esm/six-radio.entry.js +17 -23
  409. package/dist/esm/six-radio.entry.js.map +1 -1
  410. package/dist/esm/six-range.entry.js +6 -44
  411. package/dist/esm/six-range.entry.js.map +1 -1
  412. package/dist/esm/six-root.entry.js +1 -1
  413. package/dist/esm/six-root.entry.js.map +1 -1
  414. package/dist/esm/six-search-field.entry.js +10 -5
  415. package/dist/esm/six-search-field.entry.js.map +1 -1
  416. package/dist/esm/six-select.entry.js +129 -222
  417. package/dist/esm/six-select.entry.js.map +1 -1
  418. package/dist/esm/six-sidebar-item-group.entry.js +9 -5
  419. package/dist/esm/six-sidebar-item-group.entry.js.map +1 -1
  420. package/dist/esm/six-sidebar.entry.js +39 -18
  421. package/dist/esm/six-sidebar.entry.js.map +1 -1
  422. package/dist/esm/six-spinner.entry.js.map +1 -1
  423. package/dist/esm/six-switch.entry.js +55 -63
  424. package/dist/esm/six-switch.entry.js.map +1 -1
  425. package/dist/esm/six-tab-group.entry.js +130 -112
  426. package/dist/esm/six-tab-group.entry.js.map +1 -1
  427. package/dist/esm/six-tab-panel.entry.js +1 -1
  428. package/dist/esm/six-tab-panel.entry.js.map +1 -1
  429. package/dist/esm/six-tab.entry.js +4 -2
  430. package/dist/esm/six-tab.entry.js.map +1 -1
  431. package/dist/esm/six-tag.entry.js +4 -7
  432. package/dist/esm/six-tag.entry.js.map +1 -1
  433. package/dist/esm/six-textarea.entry.js +27 -76
  434. package/dist/esm/six-textarea.entry.js.map +1 -1
  435. package/dist/esm/six-tile.entry.js +13 -16
  436. package/dist/esm/six-tile.entry.js.map +1 -1
  437. package/dist/esm/six-timepicker.entry.js +157 -213
  438. package/dist/esm/six-timepicker.entry.js.map +1 -1
  439. package/dist/esm/six-tooltip.entry.js +53 -56
  440. package/dist/esm/six-tooltip.entry.js.map +1 -1
  441. package/dist/esm/{slot-6f3984c7.js → slot-2e64df19.js} +11 -10
  442. package/dist/esm/slot-2e64df19.js.map +1 -0
  443. package/dist/esm/ui-library.js +1 -1
  444. package/dist/types/components/six-alert/six-alert.d.ts +5 -7
  445. package/dist/types/components/six-avatar/six-avatar.d.ts +1 -2
  446. package/dist/types/components/six-badge/six-badge.d.ts +0 -1
  447. package/dist/types/components/six-button/six-button.d.ts +8 -9
  448. package/dist/types/components/six-checkbox/six-checkbox.d.ts +5 -17
  449. package/dist/types/components/six-datepicker/components/day-selection.d.ts +9 -5
  450. package/dist/types/components/six-datepicker/components/month-selection.d.ts +8 -5
  451. package/dist/types/components/six-datepicker/components/year-selection.d.ts +7 -5
  452. package/dist/types/components/six-datepicker/six-datepicker.d.ts +41 -52
  453. package/dist/types/components/six-details/six-details.d.ts +12 -12
  454. package/dist/types/components/six-dialog/six-dialog.d.ts +12 -13
  455. package/dist/types/components/six-drawer/six-drawer.d.ts +12 -13
  456. package/dist/types/components/six-dropdown/six-dropdown.d.ts +28 -32
  457. package/dist/types/components/six-error-page/six-error-page.d.ts +1 -1
  458. package/dist/types/components/six-file-list-item/six-file-list-item.d.ts +3 -3
  459. package/dist/types/components/six-file-upload/six-file-upload.d.ts +11 -11
  460. package/dist/types/components/six-group-label/six-group-label.d.ts +5 -5
  461. package/dist/types/components/six-header/six-header.d.ts +16 -27
  462. package/dist/types/components/six-icon-button/six-icon-button.d.ts +4 -4
  463. package/dist/types/components/six-input/six-input.d.ts +9 -35
  464. package/dist/types/components/six-item-picker/six-item-picker.d.ts +13 -16
  465. package/dist/types/components/six-layout-grid/six-layout-grid.d.ts +1 -1
  466. package/dist/types/components/six-menu/six-menu.d.ts +10 -11
  467. package/dist/types/components/six-menu-item/six-menu-item.d.ts +6 -6
  468. package/dist/types/components/six-progress-ring/six-progress-ring.d.ts +2 -2
  469. package/dist/types/components/six-radio/six-radio.d.ts +5 -10
  470. package/dist/types/components/six-range/six-range.d.ts +6 -21
  471. package/dist/types/components/six-root/six-root.d.ts +3 -3
  472. package/dist/types/components/six-search-field/six-search-field.d.ts +4 -5
  473. package/dist/types/components/six-select/six-select.d.ts +19 -31
  474. package/dist/types/components/six-sidebar/six-sidebar.d.ts +5 -5
  475. package/dist/types/components/six-sidebar-item-group/six-sidebar-item-group.d.ts +7 -6
  476. package/dist/types/components/six-spinner/six-spinner.d.ts +2 -2
  477. package/dist/types/components/six-switch/six-switch.d.ts +18 -21
  478. package/dist/types/components/six-tab/six-tab.d.ts +3 -3
  479. package/dist/types/components/six-tab-group/six-tab-group.d.ts +20 -21
  480. package/dist/types/components/six-tab-panel/six-tab-panel.d.ts +1 -1
  481. package/dist/types/components/six-tag/six-tag.d.ts +1 -3
  482. package/dist/types/components/six-textarea/six-textarea.d.ts +9 -28
  483. package/dist/types/components/six-tile/six-tile.d.ts +2 -3
  484. package/dist/types/components/six-timepicker/six-timepicker.d.ts +26 -43
  485. package/dist/types/components/six-tooltip/six-tooltip.d.ts +19 -21
  486. package/dist/types/components.d.ts +190 -417
  487. package/dist/types/functional-components/form-control/form-control.d.ts +5 -6
  488. package/dist/types/index.d.ts +1 -0
  489. package/dist/types/testUtil/delay.d.ts +1 -1
  490. package/dist/types/types.d.ts +2 -0
  491. package/dist/types/utils/date-util.d.ts +18 -10
  492. package/dist/types/utils/error-messages.d.ts +42 -0
  493. package/dist/types/utils/event-listeners.d.ts +2 -1
  494. package/dist/types/utils/execution-control.d.ts +1 -3
  495. package/dist/types/utils/form.d.ts +1 -0
  496. package/dist/types/utils/modal.d.ts +2 -2
  497. package/dist/types/utils/popover.d.ts +5 -5
  498. package/dist/types/utils/popup.d.ts +9 -0
  499. package/dist/types/utils/slot.d.ts +2 -7
  500. package/dist/types/utils/tabbable.d.ts +1 -1
  501. package/dist/types/utils/time.util.d.ts +18 -9
  502. package/dist/types/utils/type-check.d.ts +3 -4
  503. package/dist/types/wrappers/set-attributes/set-attributes.d.ts +1 -1
  504. package/dist/ui-library/index.esm.js +1 -1
  505. package/dist/ui-library/index.esm.js.map +1 -1
  506. package/dist/ui-library/p-0108fe92.entry.js +2 -0
  507. package/dist/ui-library/p-0108fe92.entry.js.map +1 -0
  508. package/dist/ui-library/p-03a145f5.entry.js +2 -0
  509. package/dist/ui-library/p-03a145f5.entry.js.map +1 -0
  510. package/dist/ui-library/{p-3c635d0a.entry.js → p-087fdd96.entry.js} +2 -2
  511. package/dist/ui-library/p-087fdd96.entry.js.map +1 -0
  512. package/dist/ui-library/p-09779e47.entry.js +2 -0
  513. package/dist/ui-library/p-09779e47.entry.js.map +1 -0
  514. package/dist/ui-library/p-097cced4.entry.js.map +1 -1
  515. package/dist/ui-library/p-0b2c6348.js +2 -0
  516. package/dist/ui-library/p-0b2c6348.js.map +1 -0
  517. package/dist/ui-library/p-0cc08e91.js +2 -0
  518. package/dist/ui-library/p-0cc08e91.js.map +1 -0
  519. package/dist/ui-library/p-0fe78f9b.js +2 -0
  520. package/dist/ui-library/p-0fe78f9b.js.map +1 -0
  521. package/dist/ui-library/p-18e9f8b8.entry.js +2 -0
  522. package/dist/ui-library/p-18e9f8b8.entry.js.map +1 -0
  523. package/dist/ui-library/p-2761f908.js +2 -0
  524. package/dist/ui-library/p-2761f908.js.map +1 -0
  525. package/dist/ui-library/{p-19b50b5a.entry.js → p-28be55f0.entry.js} +2 -2
  526. package/dist/ui-library/p-28be55f0.entry.js.map +1 -0
  527. package/dist/ui-library/{p-c349d1d4.entry.js → p-3929b0af.entry.js} +2 -2
  528. package/dist/ui-library/p-3929b0af.entry.js.map +1 -0
  529. package/dist/ui-library/{p-9328e5bc.entry.js → p-445ba5b8.entry.js} +2 -2
  530. package/dist/ui-library/p-445ba5b8.entry.js.map +1 -0
  531. package/dist/ui-library/p-4d408fb4.js +2 -0
  532. package/dist/ui-library/p-4d408fb4.js.map +1 -0
  533. package/dist/ui-library/p-502ff3d3.entry.js +2 -0
  534. package/dist/ui-library/p-502ff3d3.entry.js.map +1 -0
  535. package/dist/ui-library/p-5a34c93e.entry.js +2 -0
  536. package/dist/ui-library/p-5a34c93e.entry.js.map +1 -0
  537. package/dist/ui-library/p-60621dc6.js +2 -0
  538. package/dist/ui-library/p-60621dc6.js.map +1 -0
  539. package/dist/ui-library/p-63703ba3.entry.js.map +1 -1
  540. package/dist/ui-library/p-66180e89.entry.js +2 -0
  541. package/dist/ui-library/p-66180e89.entry.js.map +1 -0
  542. package/dist/ui-library/p-686b12ec.entry.js +2 -0
  543. package/dist/ui-library/p-686b12ec.entry.js.map +1 -0
  544. package/dist/ui-library/p-71035abf.entry.js +2 -0
  545. package/dist/ui-library/p-71035abf.entry.js.map +1 -0
  546. package/dist/ui-library/{p-8a970a40.entry.js → p-724e154d.entry.js} +2 -2
  547. package/dist/ui-library/p-724e154d.entry.js.map +1 -0
  548. package/dist/ui-library/p-72ca96e1.entry.js +2 -0
  549. package/dist/ui-library/p-72ca96e1.entry.js.map +1 -0
  550. package/dist/ui-library/p-73597d13.entry.js.map +1 -1
  551. package/dist/ui-library/{p-c30f9e0b.entry.js → p-778cf804.entry.js} +2 -2
  552. package/dist/ui-library/p-778cf804.entry.js.map +1 -0
  553. package/dist/ui-library/p-87032e26.entry.js +2 -0
  554. package/dist/ui-library/p-87032e26.entry.js.map +1 -0
  555. package/dist/ui-library/p-8cf72af6.js +2 -0
  556. package/dist/ui-library/p-8cf72af6.js.map +1 -0
  557. package/dist/ui-library/p-8e0b6b7e.entry.js +2 -0
  558. package/dist/ui-library/p-8e0b6b7e.entry.js.map +1 -0
  559. package/dist/ui-library/p-912092c0.entry.js +2 -0
  560. package/dist/ui-library/p-912092c0.entry.js.map +1 -0
  561. package/dist/ui-library/p-92ca6a84.entry.js +2 -0
  562. package/dist/ui-library/p-92ca6a84.entry.js.map +1 -0
  563. package/dist/ui-library/{p-d5633a29.entry.js → p-9337cdd6.entry.js} +2 -2
  564. package/dist/ui-library/p-9337cdd6.entry.js.map +1 -0
  565. package/dist/ui-library/p-9461417e.entry.js +2 -0
  566. package/dist/ui-library/p-9461417e.entry.js.map +1 -0
  567. package/dist/ui-library/p-a1d4f6cf.entry.js.map +1 -1
  568. package/dist/ui-library/p-a49ae60a.entry.js +2 -0
  569. package/dist/ui-library/p-a49ae60a.entry.js.map +1 -0
  570. package/dist/ui-library/{p-611e1978.entry.js → p-a844cb72.entry.js} +2 -2
  571. package/dist/ui-library/{p-611e1978.entry.js.map → p-a844cb72.entry.js.map} +1 -1
  572. package/dist/ui-library/p-afcbe9da.entry.js +2 -0
  573. package/dist/ui-library/p-afcbe9da.entry.js.map +1 -0
  574. package/dist/ui-library/{p-97cc839c.entry.js → p-b3bff992.entry.js} +2 -2
  575. package/dist/ui-library/p-b3bff992.entry.js.map +1 -0
  576. package/dist/ui-library/p-b4547fb5.entry.js +2 -0
  577. package/dist/ui-library/p-b4547fb5.entry.js.map +1 -0
  578. package/dist/ui-library/{p-4f8394d7.js → p-ba74863a.js} +2 -2
  579. package/dist/ui-library/p-ba74863a.js.map +1 -0
  580. package/dist/ui-library/p-bd8f8eef.entry.js +2 -0
  581. package/dist/ui-library/p-bd8f8eef.entry.js.map +1 -0
  582. package/dist/ui-library/p-c57f16af.entry.js +2 -0
  583. package/dist/ui-library/p-c57f16af.entry.js.map +1 -0
  584. package/dist/ui-library/p-c5cdba08.entry.js +2 -0
  585. package/dist/ui-library/p-c5cdba08.entry.js.map +1 -0
  586. package/dist/ui-library/p-c87810b0.entry.js +2 -0
  587. package/dist/ui-library/p-c87810b0.entry.js.map +1 -0
  588. package/dist/ui-library/{p-af793d04.entry.js → p-cdcde4cd.entry.js} +2 -2
  589. package/dist/ui-library/p-cdcde4cd.entry.js.map +1 -0
  590. package/dist/ui-library/p-d6798d35.entry.js +2 -0
  591. package/dist/ui-library/p-d6798d35.entry.js.map +1 -0
  592. package/dist/ui-library/p-d87a6f4d.js +2 -0
  593. package/dist/ui-library/p-d87a6f4d.js.map +1 -0
  594. package/dist/ui-library/p-dc3f5996.entry.js +2 -0
  595. package/dist/ui-library/p-dc3f5996.entry.js.map +1 -0
  596. package/dist/ui-library/p-dcd7c547.entry.js +2 -0
  597. package/dist/ui-library/p-dcd7c547.entry.js.map +1 -0
  598. package/dist/ui-library/p-e07b3f0c.entry.js +2 -0
  599. package/dist/ui-library/p-e07b3f0c.entry.js.map +1 -0
  600. package/dist/ui-library/{p-19364560.entry.js → p-e8feb81f.entry.js} +2 -2
  601. package/dist/ui-library/{p-19364560.entry.js.map → p-e8feb81f.entry.js.map} +1 -1
  602. package/dist/ui-library/p-ef3936e5.entry.js +2 -0
  603. package/dist/ui-library/p-ef3936e5.entry.js.map +1 -0
  604. package/dist/ui-library/p-f0dd77e1.entry.js +2 -0
  605. package/dist/ui-library/p-f0dd77e1.entry.js.map +1 -0
  606. package/dist/ui-library/ui-library.esm.js +1 -1
  607. package/dist/ui-library/ui-library.esm.js.map +1 -1
  608. package/package.json +2 -2
  609. package/dist/cjs/event-listeners-74715e62.js +0 -45
  610. package/dist/cjs/event-listeners-74715e62.js.map +0 -1
  611. package/dist/cjs/execution-control-46f388e0.js.map +0 -1
  612. package/dist/cjs/focus-visible-0b352c74.js.map +0 -1
  613. package/dist/cjs/form-control-2c17c573.js.map +0 -1
  614. package/dist/cjs/modal-48d42228.js.map +0 -1
  615. package/dist/cjs/popover-f743f62b.js.map +0 -1
  616. package/dist/cjs/six-form.cjs.entry.js +0 -231
  617. package/dist/cjs/six-form.cjs.entry.js.map +0 -1
  618. package/dist/cjs/six-timepicker.types-c19ebff3.js +0 -56
  619. package/dist/cjs/six-timepicker.types-c19ebff3.js.map +0 -1
  620. package/dist/cjs/slot-ad537f24.js.map +0 -1
  621. package/dist/collection/components/six-form/six-form.css +0 -11
  622. package/dist/collection/components/six-form/six-form.js +0 -419
  623. package/dist/collection/components/six-form/six-form.js.map +0 -1
  624. package/dist/collection/components/six-timepicker/six-time-format.js +0 -15
  625. package/dist/collection/components/six-timepicker/six-time-format.js.map +0 -1
  626. package/dist/collection/components/six-timepicker/six-timepicker.types.js +0 -41
  627. package/dist/collection/components/six-timepicker/six-timepicker.types.js.map +0 -1
  628. package/dist/collection/utils/as-array.js +0 -2
  629. package/dist/collection/utils/as-array.js.map +0 -1
  630. package/dist/collection/utils/matchers.js +0 -3
  631. package/dist/collection/utils/matchers.js.map +0 -1
  632. package/dist/collection/utils/testing.js +0 -39
  633. package/dist/collection/utils/testing.js.map +0 -1
  634. package/dist/components/six-form.d.ts +0 -11
  635. package/dist/components/six-form.js +0 -252
  636. package/dist/components/six-form.js.map +0 -1
  637. package/dist/esm/event-listeners-570a24ea.js +0 -43
  638. package/dist/esm/event-listeners-570a24ea.js.map +0 -1
  639. package/dist/esm/execution-control-1a60d709.js.map +0 -1
  640. package/dist/esm/focus-visible-97933ea9.js.map +0 -1
  641. package/dist/esm/form-control-3b440ea1.js.map +0 -1
  642. package/dist/esm/modal-5ebdc320.js.map +0 -1
  643. package/dist/esm/popover-bd2c2fca.js.map +0 -1
  644. package/dist/esm/six-form.entry.js +0 -227
  645. package/dist/esm/six-form.entry.js.map +0 -1
  646. package/dist/esm/six-timepicker.types-e161a447.js +0 -50
  647. package/dist/esm/six-timepicker.types-e161a447.js.map +0 -1
  648. package/dist/esm/slot-6f3984c7.js.map +0 -1
  649. package/dist/types/components/six-form/six-form.d.ts +0 -69
  650. package/dist/types/components/six-timepicker/six-time-format.d.ts +0 -13
  651. package/dist/types/components/six-timepicker/six-timepicker.types.d.ts +0 -36
  652. package/dist/types/utils/as-array.d.ts +0 -1
  653. package/dist/types/utils/matchers.d.ts +0 -2
  654. package/dist/types/utils/popper.d.ts +0 -33
  655. package/dist/types/utils/testing.d.ts +0 -2
  656. package/dist/ui-library/p-054e12cc.entry.js +0 -2
  657. package/dist/ui-library/p-054e12cc.entry.js.map +0 -1
  658. package/dist/ui-library/p-0786fa7c.js +0 -2
  659. package/dist/ui-library/p-0786fa7c.js.map +0 -1
  660. package/dist/ui-library/p-163f2bb0.entry.js +0 -2
  661. package/dist/ui-library/p-163f2bb0.entry.js.map +0 -1
  662. package/dist/ui-library/p-18e5f772.entry.js +0 -2
  663. package/dist/ui-library/p-18e5f772.entry.js.map +0 -1
  664. package/dist/ui-library/p-18ea0c56.js +0 -2
  665. package/dist/ui-library/p-18ea0c56.js.map +0 -1
  666. package/dist/ui-library/p-19b50b5a.entry.js.map +0 -1
  667. package/dist/ui-library/p-2e48c8d2.entry.js +0 -2
  668. package/dist/ui-library/p-2e48c8d2.entry.js.map +0 -1
  669. package/dist/ui-library/p-308261c4.entry.js +0 -2
  670. package/dist/ui-library/p-308261c4.entry.js.map +0 -1
  671. package/dist/ui-library/p-33f7e22b.entry.js +0 -2
  672. package/dist/ui-library/p-33f7e22b.entry.js.map +0 -1
  673. package/dist/ui-library/p-394a2a12.entry.js +0 -2
  674. package/dist/ui-library/p-394a2a12.entry.js.map +0 -1
  675. package/dist/ui-library/p-3c635d0a.entry.js.map +0 -1
  676. package/dist/ui-library/p-4ae91795.entry.js +0 -2
  677. package/dist/ui-library/p-4ae91795.entry.js.map +0 -1
  678. package/dist/ui-library/p-4f8394d7.js.map +0 -1
  679. package/dist/ui-library/p-53a13db5.entry.js +0 -2
  680. package/dist/ui-library/p-53a13db5.entry.js.map +0 -1
  681. package/dist/ui-library/p-559c87f0.entry.js +0 -2
  682. package/dist/ui-library/p-559c87f0.entry.js.map +0 -1
  683. package/dist/ui-library/p-5a25d6fb.entry.js +0 -2
  684. package/dist/ui-library/p-5a25d6fb.entry.js.map +0 -1
  685. package/dist/ui-library/p-6403fd87.entry.js +0 -2
  686. package/dist/ui-library/p-6403fd87.entry.js.map +0 -1
  687. package/dist/ui-library/p-6433c0da.entry.js +0 -2
  688. package/dist/ui-library/p-6433c0da.entry.js.map +0 -1
  689. package/dist/ui-library/p-79eee01b.js +0 -2
  690. package/dist/ui-library/p-79eee01b.js.map +0 -1
  691. package/dist/ui-library/p-8a970a40.entry.js.map +0 -1
  692. package/dist/ui-library/p-90824648.entry.js +0 -2
  693. package/dist/ui-library/p-90824648.entry.js.map +0 -1
  694. package/dist/ui-library/p-9328e5bc.entry.js.map +0 -1
  695. package/dist/ui-library/p-97cc839c.entry.js.map +0 -1
  696. package/dist/ui-library/p-9a860acc.js +0 -2
  697. package/dist/ui-library/p-9a860acc.js.map +0 -1
  698. package/dist/ui-library/p-9d1d222f.entry.js +0 -2
  699. package/dist/ui-library/p-9d1d222f.entry.js.map +0 -1
  700. package/dist/ui-library/p-af793d04.entry.js.map +0 -1
  701. package/dist/ui-library/p-b0e5658f.entry.js +0 -2
  702. package/dist/ui-library/p-b0e5658f.entry.js.map +0 -1
  703. package/dist/ui-library/p-b1e66136.js +0 -2
  704. package/dist/ui-library/p-b1e66136.js.map +0 -1
  705. package/dist/ui-library/p-b4dfb7cf.js +0 -2
  706. package/dist/ui-library/p-b4dfb7cf.js.map +0 -1
  707. package/dist/ui-library/p-b997e43c.entry.js +0 -2
  708. package/dist/ui-library/p-b997e43c.entry.js.map +0 -1
  709. package/dist/ui-library/p-c0cb6436.entry.js +0 -2
  710. package/dist/ui-library/p-c0cb6436.entry.js.map +0 -1
  711. package/dist/ui-library/p-c30f9e0b.entry.js.map +0 -1
  712. package/dist/ui-library/p-c349d1d4.entry.js.map +0 -1
  713. package/dist/ui-library/p-c53a63f9.entry.js +0 -2
  714. package/dist/ui-library/p-c53a63f9.entry.js.map +0 -1
  715. package/dist/ui-library/p-c640c2d8.entry.js +0 -2
  716. package/dist/ui-library/p-c640c2d8.entry.js.map +0 -1
  717. package/dist/ui-library/p-c94d0b07.entry.js +0 -2
  718. package/dist/ui-library/p-c94d0b07.entry.js.map +0 -1
  719. package/dist/ui-library/p-d12c6092.js +0 -2
  720. package/dist/ui-library/p-d12c6092.js.map +0 -1
  721. package/dist/ui-library/p-d5633a29.entry.js.map +0 -1
  722. package/dist/ui-library/p-df655bc9.entry.js +0 -2
  723. package/dist/ui-library/p-df655bc9.entry.js.map +0 -1
  724. package/dist/ui-library/p-f18ba86f.entry.js +0 -2
  725. package/dist/ui-library/p-f18ba86f.entry.js.map +0 -1
  726. package/dist/ui-library/p-f4938771.entry.js +0 -2
  727. package/dist/ui-library/p-f4938771.entry.js.map +0 -1
  728. package/dist/ui-library/p-f604e067.entry.js +0 -2
  729. package/dist/ui-library/p-f604e067.entry.js.map +0 -1
  730. package/dist/ui-library/p-f70e2403.entry.js +0 -2
  731. package/dist/ui-library/p-f70e2403.entry.js.map +0 -1
  732. package/dist/ui-library/p-f9d345e0.entry.js +0 -2
  733. package/dist/ui-library/p-f9d345e0.entry.js.map +0 -1
  734. package/dist/ui-library/p-fed07a1f.entry.js +0 -2
  735. package/dist/ui-library/p-fed07a1f.entry.js.map +0 -1
  736. package/dist/ui-library/p-ff0257bf.entry.js +0 -2
  737. package/dist/ui-library/p-ff0257bf.entry.js.map +0 -1
@@ -27,27 +27,32 @@ export default class Popover {
27
27
  strategy: 'absolute',
28
28
  transitionElement: this.popover,
29
29
  visibleClass: 'popover-visible',
30
- onAfterShow: () => { },
31
- onAfterHide: () => { },
32
- onTransitionEnd: () => { },
30
+ onAfterShow: () => Promise,
31
+ onAfterHide: () => Promise,
32
+ onTransitionEnd: () => Promise,
33
33
  }, options);
34
34
  this.isVisible = false;
35
35
  this.popover.hidden = true;
36
- this.popover.classList.remove(this.options.visibleClass);
36
+ if (this.options.visibleClass != null) {
37
+ this.popover.classList.remove(this.options.visibleClass);
38
+ }
37
39
  this.popover.addEventListener('transitionend', this.handleTransitionEnd);
38
40
  }
39
41
  handleTransitionEnd(event) {
42
+ var _a, _b;
40
43
  const target = event.target;
41
44
  // Make sure the transition event originates from from the correct element, and not one that has bubbled up
42
45
  if (target === this.options.transitionElement) {
43
46
  // This is called before the element is hidden so users can do things like reset scroll. It will fire once for
44
47
  // every transition property. Use `event.propertyName` to determine which property has finished transitioning.
45
- this.options.onTransitionEnd.call(this, event);
48
+ (_a = this.options.onTransitionEnd) === null || _a === void 0 ? void 0 : _a.call(this, event);
46
49
  // Make sure we only do this once, since transitionend will fire for every transition
47
50
  if (!this.isVisible && !this.popover.hidden) {
48
51
  this.popover.hidden = true;
49
- this.popover.classList.remove(this.options.visibleClass);
50
- this.options.onAfterHide.call(this);
52
+ if (this.options.visibleClass != null) {
53
+ this.popover.classList.remove(this.options.visibleClass);
54
+ }
55
+ (_b = this.options.onAfterHide) === null || _b === void 0 ? void 0 : _b.call(this);
51
56
  }
52
57
  }
53
58
  }
@@ -55,14 +60,18 @@ export default class Popover {
55
60
  this.popover.removeEventListener('transitionend', this.handleTransitionEnd);
56
61
  if (this.popper) {
57
62
  this.popper.destroy();
58
- this.popper = null;
63
+ this.popper = undefined;
59
64
  }
60
65
  }
61
66
  show() {
62
67
  this.isVisible = true;
63
68
  this.popover.hidden = false;
64
69
  this.popover.clientWidth; // force reflow
65
- requestAnimationFrame(() => this.popover.classList.add(this.options.visibleClass));
70
+ requestAnimationFrame(() => {
71
+ if (this.options.visibleClass != null) {
72
+ this.popover.classList.add(this.options.visibleClass);
73
+ }
74
+ });
66
75
  if (this.popper) {
67
76
  this.popper.destroy();
68
77
  }
@@ -84,30 +93,35 @@ export default class Popover {
84
93
  },
85
94
  ],
86
95
  });
87
- this.popover.addEventListener('transitionend', () => this.options.onAfterShow.call(this), { once: true });
96
+ this.popover.addEventListener('transitionend', () => { var _a; return (_a = this.options.onAfterShow) === null || _a === void 0 ? void 0 : _a.call(this); }, { once: true });
88
97
  // Reposition the menu after it appears in case a modifier kicked in
89
98
  requestAnimationFrame(() => { var _a; return (_a = this.popper) === null || _a === void 0 ? void 0 : _a.update(); });
90
99
  }
91
100
  reposition() {
92
- this.popper.update();
101
+ var _a;
102
+ (_a = this.popper) === null || _a === void 0 ? void 0 : _a.update();
93
103
  }
94
104
  hide() {
95
105
  // Apply the hidden styles and wait for the transition before hiding completely
96
106
  this.isVisible = false;
97
- this.popover.classList.remove(this.options.visibleClass);
107
+ if (this.options.visibleClass != null) {
108
+ this.popover.classList.remove(this.options.visibleClass);
109
+ }
98
110
  }
99
111
  setOptions(options) {
100
112
  this.options = Object.assign(this.options, options);
101
- this.isVisible
102
- ? this.popover.classList.add(this.options.visibleClass)
103
- : this.popover.classList.remove(this.options.visibleClass);
113
+ if (this.options.visibleClass != null) {
114
+ this.isVisible
115
+ ? this.popover.classList.add(this.options.visibleClass)
116
+ : this.popover.classList.remove(this.options.visibleClass);
117
+ }
104
118
  // Update popper options
105
- if (this.popper) {
106
- this.popper.setOptions({
119
+ if (this.popper != null) {
120
+ void this.popper.setOptions({
107
121
  placement: this.options.placement,
108
122
  strategy: this.options.strategy,
109
123
  });
110
- requestAnimationFrame(() => this.popper.update());
124
+ requestAnimationFrame(() => { var _a; return (_a = this.popper) === null || _a === void 0 ? void 0 : _a.update(); });
111
125
  }
112
126
  }
113
127
  }
@@ -1 +1 @@
1
- {"version":3,"file":"popover.js","sourceRoot":"","sources":["../../src/utils/popover.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,wGAAwG;AACxG,EAAE;AACF,wBAAwB;AACxB,EAAE;AACF,QAAQ;AACR,EAAE;AACF,qHAAqH;AACrH,wHAAwH;AACxH,EAAE;AACF,wHAAwH;AACxH,+BAA+B;AAC/B,EAAE;AACF,mHAAmH;AACnH,+EAA+E;AAC/E,EAAE;AACF,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,MAAM,CAAC,OAAO,OAAO,OAAO;EAO1B,YAAY,MAAmB,EAAE,OAAoB,EAAE,OAAwB;IAC7E,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAE/D,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACrB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACvB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,CAC1B;MACE,QAAQ,EAAE,CAAC;MACX,QAAQ,EAAE,CAAC;MACX,SAAS,EAAE,cAAc;MACzB,QAAQ,EAAE,UAAU;MACpB,iBAAiB,EAAE,IAAI,CAAC,OAAO;MAC/B,YAAY,EAAE,iBAAiB;MAC/B,WAAW,EAAE,GAAG,EAAE,GAAE,CAAC;MACrB,WAAW,EAAE,GAAG,EAAE,GAAE,CAAC;MACrB,eAAe,EAAE,GAAG,EAAE,GAAE,CAAC;KAC1B,EACD,OAAO,CACR,CAAC;IAEF,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;IACvB,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAC3B,I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D,CAAC;EAED,UAAU,CAAC,OAAuB;IAChC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACpD,IAAI,CAAC,SAAS;MACZ,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC;MACvD,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;IAE7D,wBAAwB;IACxB,IAAI,IAAI,CAAC,MAAM,EAAE;MACf,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC;QACrB,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS;QACjC,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ;OAChC,CAAC,CAAC;MAEH,qBAAqB,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;KACnD;EACH,CAAC;CACF","sourcesContent":["//\n// A positioning utility for popovers that handles show/hide/transitionEnd events with simple callbacks.\n//\n// Powered by Popper.js.\n//\n// NOTE:\n//\n// - The popover MUST have at least one property that transitions, otherwise transitionEnd won't fire and the popover\n// won't be hidden. If transitions are delegated to a child element, set the `transitionElement` property accordingly.\n//\n// - When the popover is shown, it's assigned `PopoverOptions.visibleClass`. You can use this class to provide different\n// transitions for show/hide.\n//\n// - Popper uses `translate3d` to position elements, so adding a transition to the `transform` property may have an\n// undesired effect when the element is shown and when its placement changes.\n//\nimport { createPopper } from '@popperjs/core';\nimport { PopperInstance } from './popper';\n\nexport default class Popover {\n anchor: HTMLElement;\n isVisible: boolean;\n popover: HTMLElement;\n popper: PopperInstance;\n options: PopoverOptions;\n\n constructor(anchor: HTMLElement, popover: HTMLElement, options?: PopoverOptions) {\n this.handleTransitionEnd = this.handleTransitionEnd.bind(this);\n\n this.anchor = anchor;\n this.popover = popover;\n this.options = Object.assign(\n {\n skidding: 0,\n distance: 0,\n placement: 'bottom-start',\n strategy: 'absolute',\n transitionElement: this.popover,\n visibleClass: 'popover-visible',\n onAfterShow: () => {},\n onAfterHide: () => {},\n onTransitionEnd: () => {},\n },\n options\n );\n\n this.isVisible = false;\n this.popover.hidden = true;\n this.popover.classList.remove(this.options.visibleClass);\n\n this.popover.addEventListener('transitionend', this.handleTransitionEnd);\n }\n\n private handleTransitionEnd(event: TransitionEvent) {\n const target = event.target as HTMLElement;\n\n // Make sure the transition event originates from from the correct element, and not one that has bubbled up\n if (target === this.options.transitionElement) {\n // This is called before the element is hidden so users can do things like reset scroll. It will fire once for\n // every transition property. Use `event.propertyName` to determine which property has finished transitioning.\n this.options.onTransitionEnd.call(this, event);\n\n // Make sure we only do this once, since transitionend will fire for every transition\n if (!this.isVisible && !this.popover.hidden) {\n this.popover.hidden = true;\n this.popover.classList.remove(this.options.visibleClass);\n this.options.onAfterHide.call(this);\n }\n }\n }\n\n destroy() {\n this.popover.removeEventListener('transitionend', this.handleTransitionEnd);\n\n if (this.popper) {\n this.popper.destroy();\n this.popper = null;\n }\n }\n\n show() {\n this.isVisible = true;\n this.popover.hidden = false;\n this.popover.clientWidth; // force reflow\n requestAnimationFrame(() => this.popover.classList.add(this.options.visibleClass));\n\n if (this.popper) {\n this.popper.destroy();\n }\n\n this.popper = createPopper(this.anchor, this.popover, {\n placement: this.options.placement,\n strategy: this.options.strategy,\n modifiers: [\n {\n name: 'flip',\n options: {\n boundary: 'viewport',\n },\n },\n {\n name: 'offset',\n options: {\n offset: [this.options.skidding, this.options.distance],\n },\n },\n ],\n });\n\n this.popover.addEventListener('transitionend', () => this.options.onAfterShow.call(this), { once: true });\n\n // Reposition the menu after it appears in case a modifier kicked in\n requestAnimationFrame(() => this.popper?.update());\n }\n\n reposition() {\n this.popper.update();\n }\n\n hide() {\n // Apply the hidden styles and wait for the transition before hiding completely\n this.isVisible = false;\n this.popover.classList.remove(this.options.visibleClass);\n }\n\n setOptions(options: PopoverOptions) {\n this.options = Object.assign(this.options, options);\n this.isVisible\n ? this.popover.classList.add(this.options.visibleClass)\n : this.popover.classList.remove(this.options.visibleClass);\n\n // Update popper options\n if (this.popper) {\n this.popper.setOptions({\n placement: this.options.placement,\n strategy: this.options.strategy,\n });\n\n requestAnimationFrame(() => this.popper.update());\n }\n }\n}\n\ninterface PopoverOptions {\n distance?: number;\n placement?:\n | 'auto'\n | 'auto-start'\n | 'auto-end'\n | 'top'\n | 'top-start'\n | 'top-end'\n | 'bottom'\n | 'bottom-start'\n | 'bottom-end'\n | 'right'\n | 'right-start'\n | 'right-end'\n | 'left'\n | 'left-start'\n | 'left-end';\n skidding?: number;\n strategy?: 'absolute' | 'fixed';\n transitionElement?: HTMLElement;\n visibleClass?: string;\n onAfterShow?: () => any;\n onAfterHide?: () => any;\n onTransitionEnd?: (event: TransitionEvent) => any;\n}\n"]}
1
+ {"version":3,"file":"popover.js","sourceRoot":"","sources":["../../src/utils/popover.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,wGAAwG;AACxG,EAAE;AACF,wBAAwB;AACxB,EAAE;AACF,QAAQ;AACR,EAAE;AACF,qHAAqH;AACrH,wHAAwH;AACxH,EAAE;AACF,wHAAwH;AACxH,+BAA+B;AAC/B,EAAE;AACF,mHAAmH;AACnH,+EAA+E;AAC/E,EAAE;AACF,OAAO,EAAE,YAAY,EAAY,MAAM,gBAAgB,CAAC;AAExD,MAAM,CAAC,OAAO,OAAO,OAAO;EAO1B,YAAY,MAAmB,EAAE,OAAoB,EAAE,OAAwB;IAC7E,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAE/D,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACrB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACvB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,CAC1B;MACE,QA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E;MACvB,KAAK,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC;QAC1B,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS;QACjC,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ;OAChC,CAAC,CAAC;MAEH,qBAAqB,CAAC,GAAG,EAAE,WAAC,OAAA,MAAA,IAAI,CAAC,MAAM,0CAAE,MAAM,EAAE,CAAA,EAAA,CAAC,CAAC;KACpD;EACH,CAAC;CACF","sourcesContent":["//\n// A positioning utility for popovers that handles show/hide/transitionEnd events with simple callbacks.\n//\n// Powered by Popper.js.\n//\n// NOTE:\n//\n// - The popover MUST have at least one property that transitions, otherwise transitionEnd won't fire and the popover\n// won't be hidden. If transitions are delegated to a child element, set the `transitionElement` property accordingly.\n//\n// - When the popover is shown, it's assigned `PopoverOptions.visibleClass`. You can use this class to provide different\n// transitions for show/hide.\n//\n// - Popper uses `translate3d` to position elements, so adding a transition to the `transform` property may have an\n// undesired effect when the element is shown and when its placement changes.\n//\nimport { createPopper, Instance } from '@popperjs/core';\n\nexport default class Popover {\n anchor: HTMLElement;\n isVisible: boolean;\n popover: HTMLElement;\n popper?: Instance;\n options: PopoverOptions;\n\n constructor(anchor: HTMLElement, popover: HTMLElement, options?: PopoverOptions) {\n this.handleTransitionEnd = this.handleTransitionEnd.bind(this);\n\n this.anchor = anchor;\n this.popover = popover;\n this.options = Object.assign(\n {\n skidding: 0,\n distance: 0,\n placement: 'bottom-start',\n strategy: 'absolute',\n transitionElement: this.popover,\n visibleClass: 'popover-visible',\n onAfterShow: () => Promise<void>,\n onAfterHide: () => Promise<void>,\n onTransitionEnd: () => Promise<void>,\n },\n options\n );\n\n this.isVisible = false;\n this.popover.hidden = true;\n if (this.options.visibleClass != null) {\n this.popover.classList.remove(this.options.visibleClass);\n }\n\n this.popover.addEventListener('transitionend', this.handleTransitionEnd);\n }\n\n private handleTransitionEnd(event: TransitionEvent) {\n const target = event.target as HTMLElement;\n\n // Make sure the transition event originates from from the correct element, and not one that has bubbled up\n if (target === this.options.transitionElement) {\n // This is called before the element is hidden so users can do things like reset scroll. It will fire once for\n // every transition property. Use `event.propertyName` to determine which property has finished transitioning.\n this.options.onTransitionEnd?.call(this, event);\n\n // Make sure we only do this once, since transitionend will fire for every transition\n if (!this.isVisible && !this.popover.hidden) {\n this.popover.hidden = true;\n if (this.options.visibleClass != null) {\n this.popover.classList.remove(this.options.visibleClass);\n }\n this.options.onAfterHide?.call(this);\n }\n }\n }\n\n destroy() {\n this.popover.removeEventListener('transitionend', this.handleTransitionEnd);\n\n if (this.popper) {\n this.popper.destroy();\n this.popper = undefined;\n }\n }\n\n show() {\n this.isVisible = true;\n this.popover.hidden = false;\n this.popover.clientWidth; // force reflow\n requestAnimationFrame(() => {\n if (this.options.visibleClass != null) {\n this.popover.classList.add(this.options.visibleClass);\n }\n });\n\n if (this.popper) {\n this.popper.destroy();\n }\n\n this.popper = createPopper(this.anchor, this.popover, {\n placement: this.options.placement,\n strategy: this.options.strategy,\n modifiers: [\n {\n name: 'flip',\n options: {\n boundary: 'viewport',\n },\n },\n {\n name: 'offset',\n options: {\n offset: [this.options.skidding, this.options.distance],\n },\n },\n ],\n });\n\n this.popover.addEventListener('transitionend', () => this.options.onAfterShow?.call(this), { once: true });\n\n // Reposition the menu after it appears in case a modifier kicked in\n requestAnimationFrame(() => this.popper?.update());\n }\n\n reposition() {\n this.popper?.update();\n }\n\n hide() {\n // Apply the hidden styles and wait for the transition before hiding completely\n this.isVisible = false;\n if (this.options.visibleClass != null) {\n this.popover.classList.remove(this.options.visibleClass);\n }\n }\n\n setOptions(options: PopoverOptions) {\n this.options = Object.assign(this.options, options);\n if (this.options.visibleClass != null) {\n this.isVisible\n ? this.popover.classList.add(this.options.visibleClass)\n : this.popover.classList.remove(this.options.visibleClass);\n }\n\n // Update popper options\n if (this.popper != null) {\n void this.popper.setOptions({\n placement: this.options.placement,\n strategy: this.options.strategy,\n });\n\n requestAnimationFrame(() => this.popper?.update());\n }\n }\n}\n\ninterface PopoverOptions {\n distance?: number;\n placement?:\n | 'auto'\n | 'auto-start'\n | 'auto-end'\n | 'top'\n | 'top-start'\n | 'top-end'\n | 'bottom'\n | 'bottom-start'\n | 'bottom-end'\n | 'right'\n | 'right-start'\n | 'right-end'\n | 'left'\n | 'left-start'\n | 'left-end';\n skidding?: number;\n strategy?: 'absolute' | 'fixed';\n transitionElement?: HTMLElement;\n visibleClass?: string;\n onAfterShow?: () => void;\n onAfterHide?: () => void;\n onTransitionEnd?: (event: TransitionEvent) => void;\n}\n"]}
@@ -0,0 +1,95 @@
1
+ /**
2
+ * If the popup is hoisted we popup is hoisted its position will change to fix to not be clipped of by a containing container.
3
+ * To render the popup correctly we render it normally, and then assign this screenposition to the fixed popup
4
+ */
5
+ export function adjustPopupForHoisting(hoist, popup, inputElement, wrapper, minPopupHeight, dropdownDirectionChanged) {
6
+ if (!hoist || popup == null || inputElement == null || wrapper == null) {
7
+ return;
8
+ }
9
+ // take a snapshot of normally rendered popup
10
+ const popupDimensions = setPopupAsFixPosition(popup);
11
+ const inputDimensions = inputElement.getBoundingClientRect();
12
+ const inputTop = inputDimensions.top;
13
+ const popupTop = popupDimensions.top;
14
+ const isUp = calcIsDropDownContentUp(inputElement, wrapper, minPopupHeight);
15
+ // check screen position to check whether the popup should be moved above or below the trigger element
16
+ if (isUp && inputTop < popupTop) {
17
+ // move popup above input field if datepicker is at bottom of screen
18
+ popup.style.top = `${popupTop - popupDimensions.height - inputDimensions.height}px`;
19
+ }
20
+ dropdownDirectionChanged(isUp);
21
+ }
22
+ /*
23
+ * For small screens the datepicker popup could be cut-off even though there might still be space within the viewport.
24
+ * This is because the popup is always aligned with the trigger input field. However in the scenario of small screens
25
+ * we should reposition the popup to use the space available.
26
+ */
27
+ export function adjustPopupForSmallScreens(popup) {
28
+ // execute after dropdown has been rendered to make sure the popup reference is correctly set
29
+ setTimeout(() => {
30
+ if (popup == null) {
31
+ return;
32
+ }
33
+ const popupDimensions = popup.getBoundingClientRect();
34
+ if (popupDimensions.y < 0 &&
35
+ window.innerHeight - popupDimensions.height > 0 &&
36
+ Math.abs(popupDimensions.y) <= popupDimensions.height) {
37
+ // handle case where popup is cut-off on top but there is still space available
38
+ setPopupAsFixPosition(popup);
39
+ popup.style.top = '0px';
40
+ }
41
+ else if (window.innerHeight < popupDimensions.y + popupDimensions.height &&
42
+ window.innerHeight > popupDimensions.height &&
43
+ Math.abs(popupDimensions.y - window.innerHeight) <= popupDimensions.height) {
44
+ // handle case where popup is cut-off at the bottom but there is still space available above
45
+ // apply screen position to fixed popup
46
+ setPopupAsFixPosition(popup);
47
+ popup.style.top = `${window.innerHeight - popupDimensions.height}px`;
48
+ }
49
+ if (window.innerWidth < popupDimensions.x + popupDimensions.width &&
50
+ window.innerWidth > popupDimensions.width &&
51
+ Math.abs(popupDimensions.x - window.innerWidth) <= popupDimensions.width) {
52
+ // handle case where popup is cut-off to the right
53
+ setPopupAsFixPosition(popup);
54
+ popup.style.left = `${window.innerWidth - popupDimensions.width}px`;
55
+ }
56
+ }, 0);
57
+ }
58
+ export function calcIsDropDownContentUp(inputElement, wrapper, minPopupHeight) {
59
+ const inputBoundingRect = inputElement.getBoundingClientRect();
60
+ const wrapperBoundingRect = wrapper.getBoundingClientRect();
61
+ const popupHeight = Math.max(wrapperBoundingRect.height, minPopupHeight);
62
+ const moreSpaceInTop = inputBoundingRect.y > window.innerHeight / 2;
63
+ return moreSpaceInTop && window.innerHeight < inputBoundingRect.bottom + popupHeight;
64
+ }
65
+ export function setPopupAsFixPosition(popup) {
66
+ const popupDimensions = popup.getBoundingClientRect();
67
+ popup.style.position = 'fixed';
68
+ popup.style.top = popupDimensions['top'] + 'px';
69
+ popup.style.left = popupDimensions['left'] + 'px';
70
+ popup.style.width = popupDimensions['width'] + 'px';
71
+ popup.style.height = popupDimensions['height'] + 'px';
72
+ return popupDimensions;
73
+ }
74
+ /*
75
+ * The position of the hoisted datepicker needs to be correctly calculated since the position changes to fixed.
76
+ * Thus if the user scrolls or adjusts the screen size we need to recalculate the datepicker position.
77
+ */
78
+ export function movePopup(hoist, open, popup, inputElement, wrapper, minPopupHeight) {
79
+ if (!hoist || !open || popup == null || inputElement == null || wrapper == null) {
80
+ return;
81
+ }
82
+ const popupBoundingClientRect = popup.getBoundingClientRect();
83
+ const popupHeight = popupBoundingClientRect.height;
84
+ const inputBoundingClientRect = inputElement.getBoundingClientRect();
85
+ const inputTop = inputBoundingClientRect.top;
86
+ const inputHeight = inputBoundingClientRect.height;
87
+ const isUp = calcIsDropDownContentUp(inputElement, wrapper, minPopupHeight);
88
+ if (isUp) {
89
+ popup.style.top = `${inputTop - popupHeight}px`;
90
+ }
91
+ else {
92
+ popup.style.top = `${inputTop + inputHeight}px`;
93
+ }
94
+ }
95
+ //# sourceMappingURL=popup.js.map
@@ -0,0 +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;EAEjD,IAAI,CAAC,KAAK,IAAI,KAAK,IAAI,IAAI,IAAI,YAAY,IAAI,IAAI,IAAI,OAAO,IAAI,IAAI,EAAE;IACtE,OAAO;GACR;EACD,6CAA6C;EAC7C,MAAM,eAAe,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAC;EACrD,MAAM,eAAe,GAAG,YAAY,CAAC,qBAAqB,EAAE,CAAC;EAC7D,MAAM,QAAQ,GAAG,eAAe,CAAC,GAAG,CAAC;EACrC,MAAM,QAAQ,GAAG,eAAe,CAAC,GAAG,CAAC;EAErC,MAAM,IAAI,GAAG,uBAAuB,CAAC,YAAY,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC;EAC5E,sGAAsG;EACtG,IAAI,IAAI,IAAI,QAAQ,GAAG,QAAQ,EAAE;IAC/B,qEAAqE;IACrE,KAAK,CAA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,CAAC;EACtD,OAAO,eAAe,CAAC;AACzB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,SAAS,CACvB,KAAc,EACd,IAAa,EACb,KAA8B,EAC9B,YAAqC,EACrC,OAAgC,EAChC,cAAsB;EAEtB,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,YAAY,IAAI,IAAI,IAAI,OAAO,IAAI,IAAI,EAAE;IAC/E,OAAO;GACR;EACD,MAAM,uBAAuB,GAAG,KAAK,CAAC,qBAAqB,EAAE,CAAC;EAC9D,MAAM,WAAW,GAAG,uBAAuB,CAAC,MAAM,CAAC;EACnD,MAAM,uBAAuB,GAAG,YAAY,CAAC,qBAAqB,EAAE,CAAC;EACrE,MAAM,QAAQ,GAAG,uBAAuB,CAAC,GAAG,CAAC;EAC7C,MAAM,WAAW,GAAG,uBAAuB,CAAC,MAAM,CAAC;EAEnD,MAAM,IAAI,GAAG,uBAAuB,CAAC,YAAY,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC;EAE5E,IAAI,IAAI,EAAE;IACR,KAAK,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,QAAQ,GAAG,WAAW,IAAI,CAAC;GACjD;OAAM;IACL,KAAK,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,QAAQ,GAAG,WAAW,IAAI,CAAC;GACjD;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.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 }\n}\n"]}
@@ -1,26 +1,9 @@
1
1
  //
2
- // Given a slot, this function iterates over all of its assigned element and text nodes and returns the concatenated
3
- // HTML as a string. This is useful because we can't use slot.innerHTML as an alternative.
4
- //
5
- export function getInnerHTML(slot) {
6
- const nodes = slot.assignedNodes({ flatten: true });
7
- let html = '';
8
- [...nodes].map((node) => {
9
- if (node.nodeType === Node.ELEMENT_NODE) {
10
- html += node.outerHTML;
11
- }
12
- if (node.nodeType === Node.TEXT_NODE) {
13
- html += node.textContent;
14
- }
15
- });
16
- return html;
17
- }
18
- //
19
2
  // Given a slot, this function iterates over all of its assigned text nodes and returns the concatenated text as a
20
3
  // string. This is useful because we can't use slot.textContent as an alternative.
21
4
  //
22
5
  export function getTextContent(slot) {
23
- const nodes = slot ? slot.assignedNodes({ flatten: true }) : [];
6
+ const nodes = slot != null ? slot.assignedNodes({ flatten: true }) : [];
24
7
  let text = '';
25
8
  [...nodes].map((node) => {
26
9
  if (node.nodeType === Node.TEXT_NODE) {
@@ -35,12 +18,13 @@ export function getTextContent(slot) {
35
18
  //
36
19
  export function hasSlot(el, name) {
37
20
  // Look for a named slot
38
- if (name) {
21
+ if (name != null && name !== '') {
39
22
  return el.querySelector(`[slot="${name}"]`) !== null;
40
23
  }
41
24
  // Look for a default slot
42
25
  return Array.from(el.childNodes).some((node) => {
43
- if (node.nodeType === node.TEXT_NODE && node.textContent.trim() !== '') {
26
+ var _a;
27
+ if (node.nodeType === node.TEXT_NODE && ((_a = node.textContent) === null || _a === void 0 ? void 0 : _a.trim()) !== '') {
44
28
  return true;
45
29
  }
46
30
  if (node.nodeType === node.ELEMENT_NODE) {
@@ -52,9 +36,10 @@ export function hasSlot(el, name) {
52
36
  return false;
53
37
  });
54
38
  }
55
- const fromPairs = (acc, [k, v]) => (Object.assign(Object.assign({}, acc), { [k]: v }));
56
- export const getAvailableSlots = (slots) => (host) => Object.values(slots)
57
- .map((name) => [name, hasSlot(host, name)])
58
- .reduce(fromPairs, {});
59
39
  export const getSlotChildren = (el) => { var _a; return (_a = el.querySelector('slot')) === null || _a === void 0 ? void 0 : _a.assignedElements({ flatten: true }); };
40
+ export function getSlot(element, slotName) {
41
+ if (element == null)
42
+ return null;
43
+ return element.querySelector(`[slot="${slotName}"]`);
44
+ }
60
45
  //# sourceMappingURL=slot.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"slot.js","sourceRoot":"","sources":["../../src/utils/slot.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,oHAAoH;AACpH,0FAA0F;AAC1F,EAAE;AACF,MAAM,UAAU,YAAY,CAAC,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AAK,CAAC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE;IAC7C,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;MACtE,OAAO,IAAI,CAAC;KACb;IAED,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,YAAY,EAAE;MACvC,MAAM,EAAE,GAAG,IAAmB,CAAC;MAC/B,IAAI,CAAC,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE;QAC5B,OAAO,IAAI,CAAC;OACb;KACF;IAED,OAAO,KAAK,CAAC;EACf,CAAC,CAAC,CAAC;AACL,CAAC;AAID,MAAM,SAAS,GAAG,CAAmB,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAe,EAAE,EAAE,CAAC,iCAAM,GAAG,KAAE,CAAC,CAAC,CAAC,EAAE,CAAC,IAAG,CAAC;AAExF,MAAM,CAAC,MAAM,iBAAiB,GAC5B,CAAmB,KAAQ,EAAE,EAAE,CAC/B,CAAwB,IAAO,EAAqB,EAAE,CACpD,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;GACjB,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;GAC1C,MAAM,CAAC,SAAS,EAAE,EAAuB,CAAC,CAAC;AAElD,MAAM,CAAC,MAAM,eAAe,GAAG,CAAwB,EAAe,EAAE,EAAE,WACxE,OAAA,MAAA,EAAE,CAAC,aAAa,CAAC,MAAM,CAAC,0CAAE,gBAAgB,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAQ,CAAA,EAAA,CAAC","sourcesContent":["//\n// Given a slot, this function iterates over all of its assigned element and text nodes and returns the concatenated\n// HTML as a string. This is useful because we can't use slot.innerHTML as an alternative.\n//\nexport function getInnerHTML(slot: HTMLSlotElement): string {\n const nodes = slot.assignedNodes({ flatten: true });\n let html = '';\n\n [...nodes].map((node) => {\n if (node.nodeType === Node.ELEMENT_NODE) {\n html += (node as HTMLElement).outerHTML;\n }\n\n if (node.nodeType === Node.TEXT_NODE) {\n html += node.textContent;\n }\n });\n\n return html;\n}\n\n//\n// 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 ? 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) {\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\ntype AvailableSlots<T> = { readonly [K in keyof T]: boolean };\n\nconst fromPairs = <T extends string>(acc, [k, v]: [T, boolean]) => ({ ...acc, [k]: v });\n\nexport const getAvailableSlots =\n <T extends object>(slots: T) =>\n <E extends HTMLElement>(host: E): AvailableSlots<T> =>\n Object.values(slots)\n .map((name) => [name, hasSlot(host, name)])\n .reduce(fromPairs, {} as AvailableSlots<T>);\n\nexport const getSlotChildren = <T extends HTMLElement>(el: HTMLElement) =>\n el.querySelector('slot')?.assignedElements({ flatten: true }) as T[];\n"]}
1
+ {"version":3,"file":"slot.js","sourceRoot":"","sources":["../../src/utils/slot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B,OAAO,IAAI,CAAC;OACb;KACF;IAED,OAAO,KAAK,CAAC;EACf,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,MAAM,eAAe,GAAG,CAAwB,EAAe,EAAE,EAAE,WACxE,OAAA,MAAA,EAAE,CAAC,aAAa,CAAC,MAAM,CAAC,0CAAE,gBAAgB,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAQ,CAAA,EAAA,CAAC;AAEvE,MAAM,UAAU,OAAO,CAAC,OAAsC,EAAE,QAAgB;EAC9E,IAAI,OAAO,IAAI,IAAI;IAAE,OAAO,IAAI,CAAC;EACjC,OAAO,OAAO,CAAC,aAAa,CAAC,UAAU,QAAQ,IAAI,CAAC,CAAC;AACvD,CAAC","sourcesContent":["//\n// 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"]}
@@ -8,16 +8,16 @@ export function getNearestTabbableElement(el) {
8
8
  return el;
9
9
  }
10
10
  // Check the element's shadow root
11
- if (el.shadowRoot) {
12
- const tabbableShadowChild = [...el.shadowRoot.children].find(isTabbable);
13
- if (tabbableShadowChild) {
11
+ if (el.shadowRoot != null) {
12
+ const tabbableShadowChild = [...el.shadowRoot.children].find((e) => isTabbable(e));
13
+ if (tabbableShadowChild != null) {
14
14
  return tabbableShadowChild;
15
15
  }
16
16
  }
17
17
  // Check the element's children
18
- if (el.children) {
19
- return [...el.children].map(getNearestTabbableElement)[0];
18
+ if (el.children != null) {
19
+ return [...el.children].map((e) => getNearestTabbableElement(e)).at(0);
20
20
  }
21
- return null;
21
+ return undefined;
22
22
  }
23
23
  //# sourceMappingURL=tabbable.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tabbable.js","sourceRoot":"","sources":["../../src/utils/tabbable.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,UAAU,CAAC,EAAe;EACxC,MAAM,QAAQ,GAAG,EAAE,CAAC,QAAQ,CAAC;EAC7B,OAAO,QAAQ,GAAG,CAAC,CAAC,CAAC;AACvB,CAAC;AAED,MAAM,UAAU,yBAAyB,CAAC,EAAe;EACvD,oBAAoB;EACpB,IAAI,UAAU,CAAC,EAAE,CAAC,EAAE;IAClB,OAAO,EAAE,CAAC;GACX;EAED,kCAAkC;EAClC,IAAI,EAAE,CAAC,UAAU,EAAE;IACjB,MAAM,mBAAmB,GAAG,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,UAAU,CAAgB,CAAC;IACxF,IAAI,mBAAmB,EAAE;MACvB,OAAO,mBAAmB,CAAC;KAC5B;GACF;EAED,+BAA+B;EAC/B,IAAI,EAAE,CAAC,QAAQ,EAAE;IACf,OAAO,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC,CAAC;GAC3D;EAED,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["export function isTabbable(el: HTMLElement) {\n const tabIndex = el.tabIndex;\n return tabIndex > -1;\n}\n\nexport function getNearestTabbableElement(el: HTMLElement): HTMLElement {\n // Check the element\n if (isTabbable(el)) {\n return el;\n }\n\n // Check the element's shadow root\n if (el.shadowRoot) {\n const tabbableShadowChild = [...el.shadowRoot.children].find(isTabbable) as HTMLElement;\n if (tabbableShadowChild) {\n return tabbableShadowChild;\n }\n }\n\n // Check the element's children\n if (el.children) {\n return [...el.children].map(getNearestTabbableElement)[0];\n }\n\n return null;\n}\n"]}
1
+ {"version":3,"file":"tabbable.js","sourceRoot":"","sources":["../../src/utils/tabbable.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,UAAU,CAAC,EAAe;EACxC,MAAM,QAAQ,GAAG,EAAE,CAAC,QAAQ,CAAC;EAC7B,OAAO,QAAQ,GAAG,CAAC,CAAC,CAAC;AACvB,CAAC;AAED,MAAM,UAAU,yBAAyB,CAAC,EAAe;EACvD,oBAAoB;EACpB,IAAI,UAAU,CAAC,EAAE,CAAC,EAAE;IAClB,OAAO,EAAE,CAAC;GACX;EAED,kCAAkC;EAClC,IAAI,EAAE,CAAC,UAAU,IAAI,IAAI,EAAE;IACzB,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;IACjH,IAAI,mBAAmB,IAAI,IAAI,EAAE;MAC/B,OAAO,mBAAmB,CAAC;KAC5B;GACF;EAED,+BAA+B;EAC/B,IAAI,EAAE,CAAC,QAAQ,IAAI,IAAI,EAAE;IACvB,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;GACvF;EAED,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,7 +1,3 @@
1
- /*
2
- * Returns the current time in the format of your choice
3
- */
4
- import { SixTimePeriod, TIME_FORMAT_CHAR, TIME_FORMAT_CHAR_TO_SIX_TIME_PROPERTY_MAP, } from '../components/six-timepicker/six-timepicker.types';
5
1
  export const getCurrentTimeIn24Hours = () => {
6
2
  const now = new Date();
7
3
  return {
@@ -23,53 +19,71 @@ export const getCurrentTimeIn12Hours = () => {
23
19
  seconds: now.getSeconds(),
24
20
  milliseconds: now.getMilliseconds(),
25
21
  has24Hours: false,
26
- period: hours >= HOURS_IN_12_HOUR_CLOCK_FORMAT ? SixTimePeriod.PM : SixTimePeriod.AM,
22
+ period: hours >= HOURS_IN_12_HOUR_CLOCK_FORMAT ? 'PM' : 'AM',
27
23
  };
28
24
  };
29
25
  export const getCurrentTime = (has24Hours = true) => {
30
26
  return has24Hours ? getCurrentTimeIn24Hours() : getCurrentTimeIn12Hours();
31
27
  };
32
- export const TIME_FORMAT_SEPARATOR = ':';
33
28
  export const isValidTimeString = (timeStr, format) => {
34
- const timeStringParts = timeStr.split(TIME_FORMAT_SEPARATOR);
35
- const timeFormatParts = format.split(TIME_FORMAT_SEPARATOR);
29
+ const timeStringParts = timeStr.split(':');
30
+ const timeFormatParts = format.split(':');
36
31
  return timeStringParts.length === timeFormatParts.length;
37
32
  };
38
33
  export const parseTimeString = (timeStr, format) => {
39
- const timeStringParts = timeStr.split(TIME_FORMAT_SEPARATOR);
40
- const timeFormatParts = format.split(TIME_FORMAT_SEPARATOR);
34
+ const timeParts = timeStr.split(':');
35
+ const formatParts = format.split(':');
41
36
  if (!isValidTimeString(timeStr, format)) {
42
37
  console.error(`Timestring did not match expected format.\nExpected format: ${format}\nReceived timestring: ${timeStr}`);
43
38
  }
44
- const sixTime = {};
45
- timeStringParts.forEach((timeStringPart, i) => {
46
- const formatStringPart = timeFormatParts[i];
47
- const sixTimePropertyName = TIME_FORMAT_CHAR_TO_SIX_TIME_PROPERTY_MAP[formatStringPart];
48
- if (sixTimePropertyName !== undefined) {
49
- if (formatStringPart === TIME_FORMAT_CHAR.PERIOD) {
50
- sixTime.period = timeStringPart.toUpperCase() === SixTimePeriod.PM ? SixTimePeriod.PM : SixTimePeriod.AM;
51
- }
52
- else {
53
- sixTime[sixTimePropertyName] = Number(timeStringPart);
54
- }
55
- }
56
- if (formatStringPart === TIME_FORMAT_CHAR.HOUR_24) {
57
- sixTime.has24Hours = true;
58
- }
59
- else if (formatStringPart === TIME_FORMAT_CHAR.HOUR_12) {
60
- sixTime.has24Hours = false;
39
+ const time = {};
40
+ timeParts.forEach((timeStringPart, i) => {
41
+ const formatStringPart = formatParts[i];
42
+ switch (formatStringPart) {
43
+ case 'HH':
44
+ time.hours = Number(timeStringPart);
45
+ time.has24Hours = true;
46
+ break;
47
+ case 'hh':
48
+ time.hours = Number(timeStringPart);
49
+ time.has24Hours = false;
50
+ break;
51
+ case 'mm':
52
+ time.minutes = Number(timeStringPart);
53
+ break;
54
+ case 'ss':
55
+ time.seconds = Number(timeStringPart);
56
+ break;
57
+ case 'ms':
58
+ time.milliseconds = Number(timeStringPart);
59
+ break;
60
+ case 'aa':
61
+ time.period = timeStringPart.toUpperCase() === 'PM' ? 'PM' : 'AM';
61
62
  }
62
63
  });
63
- return sixTime;
64
+ return time;
64
65
  };
65
66
  export const createTimeString = (time, format) => {
66
- return format
67
- .split(TIME_FORMAT_SEPARATOR)
67
+ if (time == null) {
68
+ return '';
69
+ }
70
+ const formatParts = format.split(':');
71
+ return formatParts
68
72
  .map((timeFormatPart) => {
69
- const sixTimePropertyName = TIME_FORMAT_CHAR_TO_SIX_TIME_PROPERTY_MAP[timeFormatPart];
70
- const paddingLength = timeFormatPart === TIME_FORMAT_CHAR.MILLISECOND ? 3 : 2;
71
- return String(time[sixTimePropertyName]).padStart(paddingLength, '0');
73
+ switch (timeFormatPart) {
74
+ case 'HH':
75
+ case 'hh':
76
+ return String(time.hours).padStart(2, '0');
77
+ case 'mm':
78
+ return String(time.minutes).padStart(2, '0');
79
+ case 'ss':
80
+ return String(time.seconds).padStart(2, '0');
81
+ case 'ms':
82
+ return String(time.milliseconds).padStart(3, '0');
83
+ case 'aa':
84
+ return String(time.period);
85
+ }
72
86
  })
73
- .join(TIME_FORMAT_SEPARATOR);
87
+ .join(':');
74
88
  };
75
89
  //# sourceMappingURL=time.util.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"time.util.js","sourceRoot":"","sources":["../../src/utils/time.util.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAEL,aAAa,EACb,gBAAgB,EAChB,yCAAyC,GAC1C,MAAM,mDAAmD,CAAC;AAG3D,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAY,EAAE;EACnD,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC;EACvB,OAAO;IACL,KAAK,EAAE,GAAG,CAAC,QAAQ,EAAE;IACrB,OAAO,EAAE,GAAG,CAAC,UAAU,EAAE;IACzB,OAAO,EAAE,GAAG,CAAC,UAAU,EAAE;IACzB,YAAY,EAAE,GAAG,CAAC,eAAe,EAAE;IACnC,UAAU,EAAE,IAAI;GACjB,CAAC;AACJ,C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AAa,EAAE,MAAqB,EAAE,EAAE;EACvE,OAAO,MAAM;KACV,KAAK,CAAC,qBAAqB,CAAC;KAC5B,GAAG,CAAC,CAAC,cAAc,EAAE,EAAE;IACtB,MAAM,mBAAmB,GAAG,yCAAyC,CAAC,cAAc,CAAC,CAAC;IACtF,MAAM,aAAa,GAAG,cAAc,KAAK,gBAAgB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9E,OAAO,MAAM,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,EAAE,GAAG,CAAC,CAAC;EACxE,CAAC,CAAC;KACD,IAAI,CAAC,qBAAqB,CAAC,CAAC;AACjC,CAAC,CAAC","sourcesContent":["/*\n * Returns the current time in the format of your choice\n */\nimport {\n SixTime,\n SixTimePeriod,\n TIME_FORMAT_CHAR,\n TIME_FORMAT_CHAR_TO_SIX_TIME_PROPERTY_MAP,\n} from '../components/six-timepicker/six-timepicker.types';\nimport { SixTimeFormat } from '../components/six-timepicker/six-time-format';\n\nexport const getCurrentTimeIn24Hours = (): SixTime => {\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 = (): SixTime => {\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 ? SixTimePeriod.PM : SixTimePeriod.AM,\n };\n};\n\nexport const getCurrentTime = (has24Hours: boolean = true): SixTime => {\n return has24Hours ? getCurrentTimeIn24Hours() : getCurrentTimeIn12Hours();\n};\n\nexport const TIME_FORMAT_SEPARATOR = ':';\nexport const isValidTimeString = (timeStr: string, format: SixTimeFormat) => {\n const timeStringParts = timeStr.split(TIME_FORMAT_SEPARATOR);\n const timeFormatParts = format.split(TIME_FORMAT_SEPARATOR);\n return timeStringParts.length === timeFormatParts.length;\n};\n\nexport const parseTimeString = (timeStr: string, format: SixTimeFormat): SixTime => {\n const timeStringParts = timeStr.split(TIME_FORMAT_SEPARATOR);\n const timeFormatParts = format.split(TIME_FORMAT_SEPARATOR);\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 sixTime: SixTime = {};\n\n timeStringParts.forEach((timeStringPart, i) => {\n const formatStringPart = timeFormatParts[i];\n const sixTimePropertyName = TIME_FORMAT_CHAR_TO_SIX_TIME_PROPERTY_MAP[formatStringPart];\n\n if (sixTimePropertyName !== undefined) {\n if (formatStringPart === TIME_FORMAT_CHAR.PERIOD) {\n sixTime.period = timeStringPart.toUpperCase() === SixTimePeriod.PM ? SixTimePeriod.PM : SixTimePeriod.AM;\n } else {\n sixTime[sixTimePropertyName] = Number(timeStringPart);\n }\n }\n\n if (formatStringPart === TIME_FORMAT_CHAR.HOUR_24) {\n sixTime.has24Hours = true;\n } else if (formatStringPart === TIME_FORMAT_CHAR.HOUR_12) {\n sixTime.has24Hours = false;\n }\n });\n\n return sixTime;\n};\n\nexport const createTimeString = (time: SixTime, format: SixTimeFormat) => {\n return format\n .split(TIME_FORMAT_SEPARATOR)\n .map((timeFormatPart) => {\n const sixTimePropertyName = TIME_FORMAT_CHAR_TO_SIX_TIME_PROPERTY_MAP[timeFormatPart];\n const paddingLength = timeFormatPart === TIME_FORMAT_CHAR.MILLISECOND ? 3 : 2;\n return String(time[sixTimePropertyName]).padStart(paddingLength, '0');\n })\n .join(TIME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CAAC;KAC9B;EACH,CAAC,CAAC;KACD,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"]}
@@ -2,5 +2,4 @@ export const isString = (value) => typeof value === 'string';
2
2
  // only use '==' instead of '===' to also catch undefined and void
3
3
  export const isNil = (value) => value == null;
4
4
  export const isDate = (value) => value instanceof Date;
5
- export const isNumber = (value) => value === 'number';
6
5
  //# sourceMappingURL=type-check.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"type-check.js","sourceRoot":"","sources":["../../src/utils/type-check.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,KAAU,EAAmB,EAAE,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC;AAEnF,kEAAkE;AAClE,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,IAAI,IAAI,CAAC;AAE9C,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,KAAK,EAAiB,EAAE,CAAC,KAAK,YAAY,IAAI,CAAC;AAEtE,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,KAAK,EAAmB,EAAE,CAAC,KAAK,KAAK,QAAQ,CAAC","sourcesContent":["export const isString = (value: any): value is string => typeof value === 'string';\n\n// only use '==' instead of '===' to also catch undefined and void\nexport const isNil = (value) => value == null;\n\nexport const isDate = (value): value is Date => value instanceof Date;\n\nexport const isNumber = (value): value is number => value === 'number';\n"]}
1
+ {"version":3,"file":"type-check.js","sourceRoot":"","sources":["../../src/utils/type-check.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAmB,EAAE,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC;AAEvF,kEAAkE;AAClE,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,KAAc,EAA6B,EAAE,CAAC,KAAK,IAAI,IAAI,CAAC;AAElF,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,KAAc,EAAiB,EAAE,CAAC,KAAK,YAAY,IAAI,CAAC","sourcesContent":["export const isString = (value: unknown): value is string => typeof value === 'string';\n\n// only use '==' instead of '===' to also catch undefined and void\nexport const isNil = (value: unknown): value is undefined | null => value == null;\n\nexport const isDate = (value: unknown): value is Date => value instanceof Date;\n"]}
@@ -22,7 +22,7 @@ export class SetAttributes {
22
22
  // no need for function and bigint
23
23
  undefined: (key) => child.removeAttribute(key),
24
24
  boolean: (key, value) => {
25
- if (value) {
25
+ if (value != null) {
26
26
  child.setAttribute(key, '');
27
27
  }
28
28
  else {
@@ -34,6 +34,8 @@ export class SetAttributes {
34
34
  object: (key, value) => child.setAttribute(key, JSON.stringify(value)),
35
35
  };
36
36
  for (const [key, value] of Object.entries(this.value)) {
37
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
38
+ // @ts-ignore
37
39
  types[typeof value](key, value);
38
40
  }
39
41
  }
@@ -1 +1 @@
1
- {"version":3,"file":"set-attributes.js","sourceRoot":"","sources":["../../../src/wrappers/set-attributes/set-attributes.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAKnE,MAAM,OAAO,aAAa;;iBAIR,EAAE;;EAElB,iBAAiB;IACf,IAAI,CAAC,WAAW,EAAE,CAAC;EACrB,CAAC;EAGD,YAAY;IACV,IAAI,CAAC,WAAW,EAAE,CAAC;EACrB,CAAC;EAED,WAAW;IACT,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,iBAAoC,CAAC;IAE5D,IAAI,OAAO,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,gBAAgB,CAAA,KAAK,UAAU,EAAE;MAChD,OAAO;KACR;IAED,MAAM,KAAK,GAAG,IAAI,CAAC,gBAAgB,EAAE,CAAC,GAAG,EAAE,CAAC;IAE5C,IAAI,CAAC,KAAK,EAAE;MACV,OAAO;KACR;IAED,MAAM,KAAK,GAAG;MACZ,kCAAkC;MAClC,SAAS,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,KAAK,CAAC,eAAe,CAAC,GAAG,CAAC;MAC9C,OAAO,EAAE,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;QACtB,IAAI,KAAK,EAAE;UACT,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;SAC7B;aAAM;UACL,KAAK,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;SAC5B;MACH,CAAC;MACD,MAAM,EAAE,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,CAAC;MACtD,MAAM,EAAE,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,CAAC;MACtD,MAAM,EAAE,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;KACvE,CAAC;IAEF,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;MACrD,KAAK,CAAC,OAAO,KAAK,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;KACjC;EACH,CAAC;EAED,MAAM;IACJ,OAAO,eAAQ,CAAC;EAClB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Watch, Prop, h } from '@stencil/core';\n\n@Component({\n tag: 'set-attributes',\n})\nexport class SetAttributes {\n @Element() host: HTMLSetAttributesElement;\n\n /** Attributes map */\n @Prop() value = {};\n\n componentWillLoad() {\n this.injectAttrs();\n }\n\n @Watch('value')\n attrsUpdated() {\n this.injectAttrs();\n }\n\n injectAttrs() {\n const slot = this.host.firstElementChild as HTMLSlotElement;\n\n if (typeof slot?.assignedElements !== 'function') {\n return;\n }\n\n const child = slot.assignedElements().pop();\n\n if (!child) {\n return;\n }\n\n const types = {\n // no need for function and bigint\n undefined: (key) => child.removeAttribute(key),\n boolean: (key, value) => {\n if (value) {\n child.setAttribute(key, '');\n } else {\n child.removeAttribute(key);\n }\n },\n number: (key, value) => child.setAttribute(key, value),\n string: (key, value) => child.setAttribute(key, value),\n object: (key, value) => child.setAttribute(key, JSON.stringify(value)),\n };\n\n for (const [key, value] of Object.entries(this.value)) {\n types[typeof value](key, value);\n }\n }\n\n render() {\n return <slot />;\n }\n}\n"]}
1
+ {"version":3,"file":"set-attributes.js","sourceRoot":"","sources":["../../../src/wrappers/set-attributes/set-attributes.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAKnE,MAAM,OAAO,aAAa;;iBAIR,EAAE;;EAElB,iBAAiB;IACf,IAAI,CAAC,WAAW,EAAE,CAAC;EACrB,CAAC;EAGD,YAAY;IACV,IAAI,CAAC,WAAW,EAAE,CAAC;EACrB,CAAC;EAEO,WAAW;IACjB,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,iBAAoC,CAAC;IAE5D,IAAI,OAAO,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,gBAAgB,CAAA,KAAK,UAAU,EAAE;MAChD,OAAO;KACR;IAED,MAAM,KAAK,GAAG,IAAI,CAAC,gBAAgB,EAAE,CAAC,GAAG,EAAE,CAAC;IAE5C,IAAI,CAAC,KAAK,EAAE;MACV,OAAO;KACR;IAED,MAAM,KAAK,GAAG;MACZ,kCAAkC;MAClC,SAAS,EAAE,CAAC,GAAW,EAAE,EAAE,CAAC,KAAK,CAAC,eAAe,CAAC,GAAG,CAAC;MACtD,OAAO,EAAE,CAAC,GAAW,EAAE,KAAc,EAAE,EAAE;QACvC,IAAI,KAAK,IAAI,IAAI,EAAE;UACjB,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;SAC7B;aAAM;UACL,KAAK,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;SAC5B;MACH,CAAC;MACD,MAAM,EAAE,CAAC,GAAW,EAAE,KAAa,EAAE,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,CAAC;MACtE,MAAM,EAAE,CAAC,GAAW,EAAE,KAAa,EAAE,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,CAAC;MACtE,MAAM,EAAE,CAAC,GAAW,EAAE,KAAa,EAAE,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;KACvF,CAAC;IAEF,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;MACrD,6DAA6D;MAC7D,aAAa;MACb,KAAK,CAAC,OAAO,KAAK,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;KACjC;EACH,CAAC;EAED,MAAM;IACJ,OAAO,eAAQ,CAAC;EAClB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, h, Prop, Watch } from '@stencil/core';\n\n@Component({\n tag: 'set-attributes',\n})\nexport class SetAttributes {\n @Element() host!: HTMLSetAttributesElement;\n\n /** Attributes map */\n @Prop() value = {};\n\n componentWillLoad() {\n this.injectAttrs();\n }\n\n @Watch('value')\n attrsUpdated() {\n this.injectAttrs();\n }\n\n private injectAttrs() {\n const slot = this.host.firstElementChild as HTMLSlotElement;\n\n if (typeof slot?.assignedElements !== 'function') {\n return;\n }\n\n const child = slot.assignedElements().pop();\n\n if (!child) {\n return;\n }\n\n const types = {\n // no need for function and bigint\n undefined: (key: string) => child.removeAttribute(key),\n boolean: (key: string, value: unknown) => {\n if (value != null) {\n child.setAttribute(key, '');\n } else {\n child.removeAttribute(key);\n }\n },\n number: (key: string, value: string) => child.setAttribute(key, value),\n string: (key: string, value: string) => child.setAttribute(key, value),\n object: (key: string, value: string) => child.setAttribute(key, JSON.stringify(value)),\n };\n\n for (const [key, value] of Object.entries(this.value)) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n types[typeof value](key, value);\n }\n }\n\n render() {\n return <slot />;\n }\n}\n"]}