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

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 (729) hide show
  1. package/dist/cjs/{event-listeners-74715e62.js → event-listeners-dd94dcfb.js} +7 -7
  2. package/dist/cjs/event-listeners-dd94dcfb.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-control-2c17c573.js → form-control-7494488a.js} +10 -9
  8. package/dist/cjs/form-control-7494488a.js.map +1 -0
  9. package/dist/cjs/{index-2f6daa5b.js → index-ccf35821.js} +4 -1
  10. package/dist/cjs/index-ccf35821.js.map +1 -0
  11. package/dist/cjs/loader.cjs.js +2 -2
  12. package/dist/cjs/{modal-48d42228.js → modal-21350fb5.js} +4 -3
  13. package/dist/cjs/modal-21350fb5.js.map +1 -0
  14. package/dist/cjs/{popover-f743f62b.js → popover-b5e2d5ef.js} +33 -19
  15. package/dist/cjs/popover-b5e2d5ef.js.map +1 -0
  16. package/dist/cjs/popup-44836aaf.js +103 -0
  17. package/dist/cjs/popup-44836aaf.js.map +1 -0
  18. package/dist/cjs/set-attributes_2.cjs.entry.js +4 -2
  19. package/dist/cjs/set-attributes_2.cjs.entry.js.map +1 -1
  20. package/dist/cjs/six-alert.cjs.entry.js +18 -23
  21. package/dist/cjs/six-alert.cjs.entry.js.map +1 -1
  22. package/dist/cjs/six-avatar.cjs.entry.js +5 -8
  23. package/dist/cjs/six-avatar.cjs.entry.js.map +1 -1
  24. package/dist/cjs/six-badge.cjs.entry.js +2 -2
  25. package/dist/cjs/six-badge.cjs.entry.js.map +1 -1
  26. package/dist/cjs/six-button.cjs.entry.js +30 -34
  27. package/dist/cjs/six-button.cjs.entry.js.map +1 -1
  28. package/dist/cjs/six-card.cjs.entry.js +1 -1
  29. package/dist/cjs/six-card.cjs.entry.js.map +1 -1
  30. package/dist/cjs/six-checkbox.cjs.entry.js +5 -4
  31. package/dist/cjs/six-checkbox.cjs.entry.js.map +1 -1
  32. package/dist/cjs/six-datepicker.cjs.entry.js +148 -245
  33. package/dist/cjs/six-datepicker.cjs.entry.js.map +1 -1
  34. package/dist/cjs/six-details.cjs.entry.js +48 -47
  35. package/dist/cjs/six-details.cjs.entry.js.map +1 -1
  36. package/dist/cjs/six-dialog.cjs.entry.js +36 -40
  37. package/dist/cjs/six-dialog.cjs.entry.js.map +1 -1
  38. package/dist/cjs/six-drawer.cjs.entry.js +33 -37
  39. package/dist/cjs/six-drawer.cjs.entry.js.map +1 -1
  40. package/dist/cjs/six-dropdown_2.cjs.entry.js +215 -196
  41. package/dist/cjs/six-dropdown_2.cjs.entry.js.map +1 -1
  42. package/dist/cjs/six-error-page.cjs.entry.js +20 -22
  43. package/dist/cjs/six-error-page.cjs.entry.js.map +1 -1
  44. package/dist/cjs/six-file-list-item.cjs.entry.js +2 -2
  45. package/dist/cjs/six-file-list-item.cjs.entry.js.map +1 -1
  46. package/dist/cjs/six-file-list.cjs.entry.js +1 -1
  47. package/dist/cjs/six-file-upload.cjs.entry.js +21 -21
  48. package/dist/cjs/six-file-upload.cjs.entry.js.map +1 -1
  49. package/dist/cjs/six-footer.cjs.entry.js +1 -1
  50. package/dist/cjs/six-form.cjs.entry.js +40 -35
  51. package/dist/cjs/six-form.cjs.entry.js.map +1 -1
  52. package/dist/cjs/six-group-label.cjs.entry.js +12 -11
  53. package/dist/cjs/six-group-label.cjs.entry.js.map +1 -1
  54. package/dist/cjs/six-header.cjs.entry.js +66 -44
  55. package/dist/cjs/six-header.cjs.entry.js.map +1 -1
  56. package/dist/cjs/six-icon-button.cjs.entry.js +4 -4
  57. package/dist/cjs/six-icon-button.cjs.entry.js.map +1 -1
  58. package/dist/cjs/six-icon.cjs.entry.js +1 -1
  59. package/dist/cjs/six-input.cjs.entry.js +5 -5
  60. package/dist/cjs/six-input.cjs.entry.js.map +1 -1
  61. package/dist/cjs/six-item-picker.cjs.entry.js +59 -78
  62. package/dist/cjs/six-item-picker.cjs.entry.js.map +1 -1
  63. package/dist/cjs/six-language-switcher.cjs.entry.js +2 -2
  64. package/dist/cjs/six-language-switcher.cjs.entry.js.map +1 -1
  65. package/dist/cjs/six-layout-grid.cjs.entry.js +5 -3
  66. package/dist/cjs/six-layout-grid.cjs.entry.js.map +1 -1
  67. package/dist/cjs/six-main-container.cjs.entry.js +1 -1
  68. package/dist/cjs/six-main-container.cjs.entry.js.map +1 -1
  69. package/dist/cjs/six-menu-divider.cjs.entry.js +1 -1
  70. package/dist/cjs/six-menu-item.cjs.entry.js +9 -7
  71. package/dist/cjs/six-menu-item.cjs.entry.js.map +1 -1
  72. package/dist/cjs/six-menu-label.cjs.entry.js +1 -1
  73. package/dist/cjs/six-picto.cjs.entry.js +5 -2
  74. package/dist/cjs/six-picto.cjs.entry.js.map +1 -1
  75. package/dist/cjs/six-progress-bar.cjs.entry.js +1 -1
  76. package/dist/cjs/six-progress-ring.cjs.entry.js +4 -4
  77. package/dist/cjs/six-progress-ring.cjs.entry.js.map +1 -1
  78. package/dist/cjs/six-radio.cjs.entry.js +1 -1
  79. package/dist/cjs/six-range.cjs.entry.js +4 -4
  80. package/dist/cjs/six-root.cjs.entry.js +2 -2
  81. package/dist/cjs/six-root.cjs.entry.js.map +1 -1
  82. package/dist/cjs/six-search-field.cjs.entry.js +11 -6
  83. package/dist/cjs/six-search-field.cjs.entry.js.map +1 -1
  84. package/dist/cjs/six-select.cjs.entry.js +135 -188
  85. package/dist/cjs/six-select.cjs.entry.js.map +1 -1
  86. package/dist/cjs/six-sidebar-item-group.cjs.entry.js +10 -6
  87. package/dist/cjs/six-sidebar-item-group.cjs.entry.js.map +1 -1
  88. package/dist/cjs/six-sidebar-item.cjs.entry.js +1 -1
  89. package/dist/cjs/six-sidebar.cjs.entry.js +40 -19
  90. package/dist/cjs/six-sidebar.cjs.entry.js.map +1 -1
  91. package/dist/cjs/six-spinner.cjs.entry.js +1 -1
  92. package/dist/cjs/six-spinner.cjs.entry.js.map +1 -1
  93. package/dist/cjs/six-switch.cjs.entry.js +51 -45
  94. package/dist/cjs/six-switch.cjs.entry.js.map +1 -1
  95. package/dist/cjs/six-tab-group.cjs.entry.js +131 -113
  96. package/dist/cjs/six-tab-group.cjs.entry.js.map +1 -1
  97. package/dist/cjs/six-tab-panel.cjs.entry.js +2 -2
  98. package/dist/cjs/six-tab-panel.cjs.entry.js.map +1 -1
  99. package/dist/cjs/six-tab.cjs.entry.js +5 -3
  100. package/dist/cjs/six-tab.cjs.entry.js.map +1 -1
  101. package/dist/cjs/six-tag.cjs.entry.js +5 -8
  102. package/dist/cjs/six-tag.cjs.entry.js.map +1 -1
  103. package/dist/cjs/six-textarea.cjs.entry.js +4 -4
  104. package/dist/cjs/six-tile.cjs.entry.js +14 -17
  105. package/dist/cjs/six-tile.cjs.entry.js.map +1 -1
  106. package/dist/cjs/six-timepicker.cjs.entry.js +155 -201
  107. package/dist/cjs/six-timepicker.cjs.entry.js.map +1 -1
  108. package/dist/cjs/six-tooltip.cjs.entry.js +54 -57
  109. package/dist/cjs/six-tooltip.cjs.entry.js.map +1 -1
  110. package/dist/cjs/{slot-ad537f24.js → slot-bccbdb59.js} +11 -10
  111. package/dist/cjs/slot-bccbdb59.js.map +1 -0
  112. package/dist/cjs/ui-library.cjs.js +2 -2
  113. package/dist/collection/components/six-alert/six-alert.js +17 -22
  114. package/dist/collection/components/six-alert/six-alert.js.map +1 -1
  115. package/dist/collection/components/six-avatar/six-avatar.js +4 -7
  116. package/dist/collection/components/six-avatar/six-avatar.js.map +1 -1
  117. package/dist/collection/components/six-badge/six-badge.js +1 -1
  118. package/dist/collection/components/six-badge/six-badge.js.map +1 -1
  119. package/dist/collection/components/six-button/six-button.js +38 -40
  120. package/dist/collection/components/six-button/six-button.js.map +1 -1
  121. package/dist/collection/components/six-card/six-card.js +1 -1
  122. package/dist/collection/components/six-card/six-card.js.map +1 -1
  123. package/dist/collection/components/six-checkbox/six-checkbox.js +3 -2
  124. package/dist/collection/components/six-checkbox/six-checkbox.js.map +1 -1
  125. package/dist/collection/components/six-datepicker/components/day-selection.js +2 -2
  126. package/dist/collection/components/six-datepicker/components/day-selection.js.map +1 -1
  127. package/dist/collection/components/six-datepicker/components/month-selection.js +4 -3
  128. package/dist/collection/components/six-datepicker/components/month-selection.js.map +1 -1
  129. package/dist/collection/components/six-datepicker/components/year-selection.js +9 -6
  130. package/dist/collection/components/six-datepicker/components/year-selection.js.map +1 -1
  131. package/dist/collection/components/six-datepicker/six-datepicker.js +126 -240
  132. package/dist/collection/components/six-datepicker/six-datepicker.js.map +1 -1
  133. package/dist/collection/components/six-details/six-details.js +51 -50
  134. package/dist/collection/components/six-details/six-details.js.map +1 -1
  135. package/dist/collection/components/six-dialog/six-dialog.js +34 -38
  136. package/dist/collection/components/six-dialog/six-dialog.js.map +1 -1
  137. package/dist/collection/components/six-drawer/six-drawer.js +31 -35
  138. package/dist/collection/components/six-drawer/six-drawer.js.map +1 -1
  139. package/dist/collection/components/six-dropdown/six-dropdown.js +185 -173
  140. package/dist/collection/components/six-dropdown/six-dropdown.js.map +1 -1
  141. package/dist/collection/components/six-error-page/six-error-page.js +25 -27
  142. package/dist/collection/components/six-error-page/six-error-page.js.map +1 -1
  143. package/dist/collection/components/six-file-list-item/six-file-list-item.js +3 -3
  144. package/dist/collection/components/six-file-list-item/six-file-list-item.js.map +1 -1
  145. package/dist/collection/components/six-file-upload/six-file-upload.js +32 -32
  146. package/dist/collection/components/six-file-upload/six-file-upload.js.map +1 -1
  147. package/dist/collection/components/six-form/six-form.js +41 -33
  148. package/dist/collection/components/six-form/six-form.js.map +1 -1
  149. package/dist/collection/components/six-group-label/six-group-label.js +11 -9
  150. package/dist/collection/components/six-group-label/six-group-label.js.map +1 -1
  151. package/dist/collection/components/six-header/six-header.js +64 -42
  152. package/dist/collection/components/six-header/six-header.js.map +1 -1
  153. package/dist/collection/components/six-icon-button/six-icon-button.js +8 -8
  154. package/dist/collection/components/six-icon-button/six-icon-button.js.map +1 -1
  155. package/dist/collection/components/six-input/six-input.js +16 -16
  156. package/dist/collection/components/six-input/six-input.js.map +1 -1
  157. package/dist/collection/components/six-item-picker/six-item-picker.js +65 -84
  158. package/dist/collection/components/six-item-picker/six-item-picker.js.map +1 -1
  159. package/dist/collection/components/six-language-switcher/six-language-switcher.js +2 -2
  160. package/dist/collection/components/six-language-switcher/six-language-switcher.js.map +1 -1
  161. package/dist/collection/components/six-layout-grid/six-layout-grid.js +10 -8
  162. package/dist/collection/components/six-layout-grid/six-layout-grid.js.map +1 -1
  163. package/dist/collection/components/six-main-container/six-main-container.js +1 -1
  164. package/dist/collection/components/six-main-container/six-main-container.js.map +1 -1
  165. package/dist/collection/components/six-menu/six-menu.js +29 -23
  166. package/dist/collection/components/six-menu/six-menu.js.map +1 -1
  167. package/dist/collection/components/six-menu-item/six-menu-item.js +7 -5
  168. package/dist/collection/components/six-menu-item/six-menu-item.js.map +1 -1
  169. package/dist/collection/components/six-picto/six-picto.js +5 -2
  170. package/dist/collection/components/six-picto/six-picto.js.map +1 -1
  171. package/dist/collection/components/six-progress-ring/six-progress-ring.js +5 -4
  172. package/dist/collection/components/six-progress-ring/six-progress-ring.js.map +1 -1
  173. package/dist/collection/components/six-radio/six-radio.js +2 -2
  174. package/dist/collection/components/six-root/six-root.js +4 -4
  175. package/dist/collection/components/six-root/six-root.js.map +1 -1
  176. package/dist/collection/components/six-search-field/six-search-field.js +10 -5
  177. package/dist/collection/components/six-search-field/six-search-field.js.map +1 -1
  178. package/dist/collection/components/six-select/six-select.js +139 -146
  179. package/dist/collection/components/six-select/six-select.js.map +1 -1
  180. package/dist/collection/components/six-select/util.js.map +1 -1
  181. package/dist/collection/components/six-sidebar/six-sidebar.js +40 -19
  182. package/dist/collection/components/six-sidebar/six-sidebar.js.map +1 -1
  183. package/dist/collection/components/six-sidebar-item-group/six-sidebar-item-group.js +12 -8
  184. package/dist/collection/components/six-sidebar-item-group/six-sidebar-item-group.js.map +1 -1
  185. package/dist/collection/components/six-spinner/six-spinner.js.map +1 -1
  186. package/dist/collection/components/six-stage-indicator/six-stage-indicator.js +1 -1
  187. package/dist/collection/components/six-switch/six-switch.js +58 -50
  188. package/dist/collection/components/six-switch/six-switch.js.map +1 -1
  189. package/dist/collection/components/six-tab/six-tab.js +5 -3
  190. package/dist/collection/components/six-tab/six-tab.js.map +1 -1
  191. package/dist/collection/components/six-tab-group/six-tab-group.js +130 -112
  192. package/dist/collection/components/six-tab-group/six-tab-group.js.map +1 -1
  193. package/dist/collection/components/six-tab-panel/six-tab-panel.js +2 -2
  194. package/dist/collection/components/six-tab-panel/six-tab-panel.js.map +1 -1
  195. package/dist/collection/components/six-tag/six-tag.js +4 -7
  196. package/dist/collection/components/six-tag/six-tag.js.map +1 -1
  197. package/dist/collection/components/six-textarea/six-textarea.js +10 -10
  198. package/dist/collection/components/six-tile/six-tile.js +17 -20
  199. package/dist/collection/components/six-tile/six-tile.js.map +1 -1
  200. package/dist/collection/components/six-timepicker/six-timepicker.js +129 -177
  201. package/dist/collection/components/six-timepicker/six-timepicker.js.map +1 -1
  202. package/dist/collection/components/six-tooltip/six-tooltip.js +56 -59
  203. package/dist/collection/components/six-tooltip/six-tooltip.js.map +1 -1
  204. package/dist/collection/functional-components/form-control/form-control.js +8 -7
  205. package/dist/collection/functional-components/form-control/form-control.js.map +1 -1
  206. package/dist/collection/testUtil/delay.js.map +1 -1
  207. package/dist/collection/utils/date-util.js +24 -16
  208. package/dist/collection/utils/date-util.js.map +1 -1
  209. package/dist/collection/utils/event-listeners.js +6 -6
  210. package/dist/collection/utils/event-listeners.js.map +1 -1
  211. package/dist/collection/utils/execution-control.js +5 -4
  212. package/dist/collection/utils/execution-control.js.map +1 -1
  213. package/dist/collection/utils/focus-visible.js +2 -2
  214. package/dist/collection/utils/focus-visible.js.map +1 -1
  215. package/dist/collection/utils/modal.js +3 -2
  216. package/dist/collection/utils/modal.js.map +1 -1
  217. package/dist/collection/utils/popover.js +32 -18
  218. package/dist/collection/utils/popover.js.map +1 -1
  219. package/dist/collection/utils/popup.js +95 -0
  220. package/dist/collection/utils/popup.js.map +1 -0
  221. package/dist/collection/utils/slot.js +9 -24
  222. package/dist/collection/utils/slot.js.map +1 -1
  223. package/dist/collection/utils/tabbable.js +6 -6
  224. package/dist/collection/utils/tabbable.js.map +1 -1
  225. package/dist/collection/utils/time.util.js +48 -34
  226. package/dist/collection/utils/time.util.js.map +1 -1
  227. package/dist/collection/utils/type-check.js +0 -1
  228. package/dist/collection/utils/type-check.js.map +1 -1
  229. package/dist/collection/wrappers/set-attributes/set-attributes.js +3 -1
  230. package/dist/collection/wrappers/set-attributes/set-attributes.js.map +1 -1
  231. package/dist/components/event-listeners.js +6 -6
  232. package/dist/components/event-listeners.js.map +1 -1
  233. package/dist/components/execution-control.js +5 -2
  234. package/dist/components/execution-control.js.map +1 -1
  235. package/dist/components/focus-visible.js +2 -2
  236. package/dist/components/focus-visible.js.map +1 -1
  237. package/dist/components/form-control.js +8 -7
  238. package/dist/components/form-control.js.map +1 -1
  239. package/dist/components/modal.js +3 -2
  240. package/dist/components/modal.js.map +1 -1
  241. package/dist/components/popover.js +32 -18
  242. package/dist/components/popover.js.map +1 -1
  243. package/dist/components/set-attributes2.js +3 -1
  244. package/dist/components/set-attributes2.js.map +1 -1
  245. package/dist/components/six-alert.js +17 -22
  246. package/dist/components/six-alert.js.map +1 -1
  247. package/dist/components/six-avatar.js +4 -7
  248. package/dist/components/six-avatar.js.map +1 -1
  249. package/dist/components/six-badge.js +1 -1
  250. package/dist/components/six-badge.js.map +1 -1
  251. package/dist/components/six-button.js +28 -32
  252. package/dist/components/six-button.js.map +1 -1
  253. package/dist/components/six-card.js.map +1 -1
  254. package/dist/components/six-checkbox.js +1 -0
  255. package/dist/components/six-checkbox.js.map +1 -1
  256. package/dist/components/six-datepicker.js +141 -238
  257. package/dist/components/six-datepicker.js.map +1 -1
  258. package/dist/components/six-details2.js +46 -45
  259. package/dist/components/six-details2.js.map +1 -1
  260. package/dist/components/six-dialog.js +33 -37
  261. package/dist/components/six-dialog.js.map +1 -1
  262. package/dist/components/six-drawer.js +30 -34
  263. package/dist/components/six-drawer.js.map +1 -1
  264. package/dist/components/six-dropdown2.js +185 -173
  265. package/dist/components/six-dropdown2.js.map +1 -1
  266. package/dist/components/six-error-page.js +19 -21
  267. package/dist/components/six-error-page.js.map +1 -1
  268. package/dist/components/six-file-list-item.js +1 -1
  269. package/dist/components/six-file-list-item.js.map +1 -1
  270. package/dist/components/six-file-upload.js +20 -20
  271. package/dist/components/six-file-upload.js.map +1 -1
  272. package/dist/components/six-form.js +38 -33
  273. package/dist/components/six-form.js.map +1 -1
  274. package/dist/components/six-group-label.js +9 -8
  275. package/dist/components/six-group-label.js.map +1 -1
  276. package/dist/components/six-header.js +64 -42
  277. package/dist/components/six-header.js.map +1 -1
  278. package/dist/components/six-icon-button2.js +2 -2
  279. package/dist/components/six-icon-button2.js.map +1 -1
  280. package/dist/components/six-input2.js +1 -1
  281. package/dist/components/six-input2.js.map +1 -1
  282. package/dist/components/six-item-picker2.js +56 -75
  283. package/dist/components/six-item-picker2.js.map +1 -1
  284. package/dist/components/six-language-switcher.js +1 -1
  285. package/dist/components/six-language-switcher.js.map +1 -1
  286. package/dist/components/six-layout-grid.js +5 -3
  287. package/dist/components/six-layout-grid.js.map +1 -1
  288. package/dist/components/six-main-container.js.map +1 -1
  289. package/dist/components/six-menu-item2.js +7 -5
  290. package/dist/components/six-menu-item2.js.map +1 -1
  291. package/dist/components/six-menu2.js +25 -18
  292. package/dist/components/six-menu2.js.map +1 -1
  293. package/dist/components/six-picto2.js +4 -1
  294. package/dist/components/six-picto2.js.map +1 -1
  295. package/dist/components/six-progress-ring.js +3 -3
  296. package/dist/components/six-progress-ring.js.map +1 -1
  297. package/dist/components/six-root.js +1 -1
  298. package/dist/components/six-root.js.map +1 -1
  299. package/dist/components/six-search-field.js +8 -3
  300. package/dist/components/six-search-field.js.map +1 -1
  301. package/dist/components/six-select.js +129 -182
  302. package/dist/components/six-select.js.map +1 -1
  303. package/dist/components/six-sidebar-item-group.js +8 -4
  304. package/dist/components/six-sidebar-item-group.js.map +1 -1
  305. package/dist/components/six-sidebar.js +39 -18
  306. package/dist/components/six-sidebar.js.map +1 -1
  307. package/dist/components/six-spinner2.js.map +1 -1
  308. package/dist/components/six-switch.js +50 -44
  309. package/dist/components/six-switch.js.map +1 -1
  310. package/dist/components/six-tab-group.js +129 -111
  311. package/dist/components/six-tab-group.js.map +1 -1
  312. package/dist/components/six-tab-panel.js +1 -1
  313. package/dist/components/six-tab-panel.js.map +1 -1
  314. package/dist/components/six-tab.js +4 -2
  315. package/dist/components/six-tab.js.map +1 -1
  316. package/dist/components/six-tag2.js +4 -7
  317. package/dist/components/six-tag2.js.map +1 -1
  318. package/dist/components/six-tile.js +14 -17
  319. package/dist/components/six-tile.js.map +1 -1
  320. package/dist/components/six-timepicker.js +1 -1
  321. package/dist/components/six-timepicker2.js +241 -239
  322. package/dist/components/six-timepicker2.js.map +1 -1
  323. package/dist/components/six-tooltip2.js +52 -55
  324. package/dist/components/six-tooltip2.js.map +1 -1
  325. package/dist/components/slot.js +10 -9
  326. package/dist/components/slot.js.map +1 -1
  327. package/dist/components.json +348 -166
  328. package/dist/esm/{event-listeners-570a24ea.js → event-listeners-6b434035.js} +7 -7
  329. package/dist/esm/event-listeners-6b434035.js.map +1 -0
  330. package/dist/esm/{execution-control-1a60d709.js → execution-control-72cc50f4.js} +6 -3
  331. package/dist/esm/execution-control-72cc50f4.js.map +1 -0
  332. package/dist/esm/{focus-visible-97933ea9.js → focus-visible-fa7129a0.js} +3 -3
  333. package/dist/esm/focus-visible-fa7129a0.js.map +1 -0
  334. package/dist/esm/{form-control-3b440ea1.js → form-control-44a50dd6.js} +10 -9
  335. package/dist/esm/form-control-44a50dd6.js.map +1 -0
  336. package/dist/esm/{index-5c0f6628.js → index-371fb9d4.js} +4 -2
  337. package/dist/esm/index-371fb9d4.js.map +1 -0
  338. package/dist/esm/loader.js +3 -3
  339. package/dist/esm/{modal-5ebdc320.js → modal-b1d96441.js} +4 -3
  340. package/dist/esm/modal-b1d96441.js.map +1 -0
  341. package/dist/esm/{popover-bd2c2fca.js → popover-1aacbae8.js} +33 -19
  342. package/dist/{cjs/popover-f743f62b.js.map → esm/popover-1aacbae8.js.map} +1 -1
  343. package/dist/esm/popup-678b8592.js +98 -0
  344. package/dist/esm/popup-678b8592.js.map +1 -0
  345. package/dist/esm/set-attributes_2.entry.js +4 -2
  346. package/dist/esm/set-attributes_2.entry.js.map +1 -1
  347. package/dist/esm/six-alert.entry.js +18 -23
  348. package/dist/esm/six-alert.entry.js.map +1 -1
  349. package/dist/esm/six-avatar.entry.js +5 -8
  350. package/dist/esm/six-avatar.entry.js.map +1 -1
  351. package/dist/esm/six-badge.entry.js +2 -2
  352. package/dist/esm/six-badge.entry.js.map +1 -1
  353. package/dist/esm/six-button.entry.js +30 -34
  354. package/dist/esm/six-button.entry.js.map +1 -1
  355. package/dist/esm/six-card.entry.js +1 -1
  356. package/dist/esm/six-card.entry.js.map +1 -1
  357. package/dist/esm/six-checkbox.entry.js +5 -4
  358. package/dist/esm/six-checkbox.entry.js.map +1 -1
  359. package/dist/esm/six-datepicker.entry.js +145 -242
  360. package/dist/esm/six-datepicker.entry.js.map +1 -1
  361. package/dist/esm/six-details.entry.js +48 -47
  362. package/dist/esm/six-details.entry.js.map +1 -1
  363. package/dist/esm/six-dialog.entry.js +36 -40
  364. package/dist/esm/six-dialog.entry.js.map +1 -1
  365. package/dist/esm/six-drawer.entry.js +33 -37
  366. package/dist/esm/six-drawer.entry.js.map +1 -1
  367. package/dist/esm/six-dropdown_2.entry.js +215 -196
  368. package/dist/esm/six-dropdown_2.entry.js.map +1 -1
  369. package/dist/esm/six-error-page.entry.js +20 -22
  370. package/dist/esm/six-error-page.entry.js.map +1 -1
  371. package/dist/esm/six-file-list-item.entry.js +2 -2
  372. package/dist/esm/six-file-list-item.entry.js.map +1 -1
  373. package/dist/esm/six-file-list.entry.js +1 -1
  374. package/dist/esm/six-file-upload.entry.js +21 -21
  375. package/dist/esm/six-file-upload.entry.js.map +1 -1
  376. package/dist/esm/six-footer.entry.js +1 -1
  377. package/dist/esm/six-form.entry.js +40 -35
  378. package/dist/esm/six-form.entry.js.map +1 -1
  379. package/dist/esm/six-group-label.entry.js +12 -11
  380. package/dist/esm/six-group-label.entry.js.map +1 -1
  381. package/dist/esm/six-header.entry.js +66 -44
  382. package/dist/esm/six-header.entry.js.map +1 -1
  383. package/dist/esm/six-icon-button.entry.js +4 -4
  384. package/dist/esm/six-icon-button.entry.js.map +1 -1
  385. package/dist/esm/six-icon.entry.js +1 -1
  386. package/dist/esm/six-input.entry.js +5 -5
  387. package/dist/esm/six-input.entry.js.map +1 -1
  388. package/dist/esm/six-item-picker.entry.js +59 -78
  389. package/dist/esm/six-item-picker.entry.js.map +1 -1
  390. package/dist/esm/six-language-switcher.entry.js +2 -2
  391. package/dist/esm/six-language-switcher.entry.js.map +1 -1
  392. package/dist/esm/six-layout-grid.entry.js +5 -3
  393. package/dist/esm/six-layout-grid.entry.js.map +1 -1
  394. package/dist/esm/six-main-container.entry.js +1 -1
  395. package/dist/esm/six-main-container.entry.js.map +1 -1
  396. package/dist/esm/six-menu-divider.entry.js +1 -1
  397. package/dist/esm/six-menu-item.entry.js +9 -7
  398. package/dist/esm/six-menu-item.entry.js.map +1 -1
  399. package/dist/esm/six-menu-label.entry.js +1 -1
  400. package/dist/esm/six-picto.entry.js +5 -2
  401. package/dist/esm/six-picto.entry.js.map +1 -1
  402. package/dist/esm/six-progress-bar.entry.js +1 -1
  403. package/dist/esm/six-progress-ring.entry.js +4 -4
  404. package/dist/esm/six-progress-ring.entry.js.map +1 -1
  405. package/dist/esm/six-radio.entry.js +1 -1
  406. package/dist/esm/six-range.entry.js +4 -4
  407. package/dist/esm/six-root.entry.js +2 -2
  408. package/dist/esm/six-root.entry.js.map +1 -1
  409. package/dist/esm/six-search-field.entry.js +11 -6
  410. package/dist/esm/six-search-field.entry.js.map +1 -1
  411. package/dist/esm/six-select.entry.js +135 -188
  412. package/dist/esm/six-select.entry.js.map +1 -1
  413. package/dist/esm/six-sidebar-item-group.entry.js +10 -6
  414. package/dist/esm/six-sidebar-item-group.entry.js.map +1 -1
  415. package/dist/esm/six-sidebar-item.entry.js +1 -1
  416. package/dist/esm/six-sidebar.entry.js +40 -19
  417. package/dist/esm/six-sidebar.entry.js.map +1 -1
  418. package/dist/esm/six-spinner.entry.js +1 -1
  419. package/dist/esm/six-spinner.entry.js.map +1 -1
  420. package/dist/esm/six-switch.entry.js +51 -45
  421. package/dist/esm/six-switch.entry.js.map +1 -1
  422. package/dist/esm/six-tab-group.entry.js +131 -113
  423. package/dist/esm/six-tab-group.entry.js.map +1 -1
  424. package/dist/esm/six-tab-panel.entry.js +2 -2
  425. package/dist/esm/six-tab-panel.entry.js.map +1 -1
  426. package/dist/esm/six-tab.entry.js +5 -3
  427. package/dist/esm/six-tab.entry.js.map +1 -1
  428. package/dist/esm/six-tag.entry.js +5 -8
  429. package/dist/esm/six-tag.entry.js.map +1 -1
  430. package/dist/esm/six-textarea.entry.js +4 -4
  431. package/dist/esm/six-tile.entry.js +14 -17
  432. package/dist/esm/six-tile.entry.js.map +1 -1
  433. package/dist/esm/six-timepicker.entry.js +155 -201
  434. package/dist/esm/six-timepicker.entry.js.map +1 -1
  435. package/dist/esm/six-tooltip.entry.js +54 -57
  436. package/dist/esm/six-tooltip.entry.js.map +1 -1
  437. package/dist/esm/{slot-6f3984c7.js → slot-2e64df19.js} +11 -10
  438. package/dist/esm/slot-2e64df19.js.map +1 -0
  439. package/dist/esm/ui-library.js +3 -3
  440. package/dist/types/components/six-alert/six-alert.d.ts +5 -7
  441. package/dist/types/components/six-avatar/six-avatar.d.ts +1 -2
  442. package/dist/types/components/six-badge/six-badge.d.ts +0 -1
  443. package/dist/types/components/six-button/six-button.d.ts +8 -9
  444. package/dist/types/components/six-checkbox/six-checkbox.d.ts +1 -1
  445. package/dist/types/components/six-datepicker/components/day-selection.d.ts +9 -5
  446. package/dist/types/components/six-datepicker/components/month-selection.d.ts +8 -5
  447. package/dist/types/components/six-datepicker/components/year-selection.d.ts +7 -5
  448. package/dist/types/components/six-datepicker/six-datepicker.d.ts +34 -39
  449. package/dist/types/components/six-details/six-details.d.ts +12 -12
  450. package/dist/types/components/six-dialog/six-dialog.d.ts +12 -13
  451. package/dist/types/components/six-drawer/six-drawer.d.ts +12 -13
  452. package/dist/types/components/six-dropdown/six-dropdown.d.ts +28 -32
  453. package/dist/types/components/six-error-page/six-error-page.d.ts +1 -1
  454. package/dist/types/components/six-file-list-item/six-file-list-item.d.ts +3 -3
  455. package/dist/types/components/six-file-upload/six-file-upload.d.ts +11 -11
  456. package/dist/types/components/six-form/six-form.d.ts +7 -16
  457. package/dist/types/components/six-group-label/six-group-label.d.ts +4 -4
  458. package/dist/types/components/six-header/six-header.d.ts +16 -27
  459. package/dist/types/components/six-icon-button/six-icon-button.d.ts +4 -4
  460. package/dist/types/components/six-input/six-input.d.ts +3 -3
  461. package/dist/types/components/six-item-picker/six-item-picker.d.ts +13 -16
  462. package/dist/types/components/six-layout-grid/six-layout-grid.d.ts +1 -1
  463. package/dist/types/components/six-menu/six-menu.d.ts +10 -11
  464. package/dist/types/components/six-menu-item/six-menu-item.d.ts +6 -6
  465. package/dist/types/components/six-progress-ring/six-progress-ring.d.ts +2 -2
  466. package/dist/types/components/six-radio/six-radio.d.ts +1 -1
  467. package/dist/types/components/six-root/six-root.d.ts +3 -3
  468. package/dist/types/components/six-search-field/six-search-field.d.ts +4 -5
  469. package/dist/types/components/six-select/six-select.d.ts +15 -12
  470. package/dist/types/components/six-sidebar/six-sidebar.d.ts +5 -5
  471. package/dist/types/components/six-sidebar-item-group/six-sidebar-item-group.d.ts +7 -6
  472. package/dist/types/components/six-spinner/six-spinner.d.ts +2 -2
  473. package/dist/types/components/six-switch/six-switch.d.ts +10 -11
  474. package/dist/types/components/six-tab/six-tab.d.ts +3 -3
  475. package/dist/types/components/six-tab-group/six-tab-group.d.ts +20 -21
  476. package/dist/types/components/six-tab-panel/six-tab-panel.d.ts +1 -1
  477. package/dist/types/components/six-tag/six-tag.d.ts +1 -3
  478. package/dist/types/components/six-textarea/six-textarea.d.ts +3 -3
  479. package/dist/types/components/six-tile/six-tile.d.ts +2 -3
  480. package/dist/types/components/six-timepicker/six-timepicker.d.ts +21 -33
  481. package/dist/types/components/six-tooltip/six-tooltip.d.ts +19 -21
  482. package/dist/types/components.d.ts +110 -98
  483. package/dist/types/functional-components/form-control/form-control.d.ts +5 -4
  484. package/dist/types/testUtil/delay.d.ts +1 -1
  485. package/dist/types/utils/date-util.d.ts +17 -10
  486. package/dist/types/utils/event-listeners.d.ts +1 -1
  487. package/dist/types/utils/execution-control.d.ts +1 -3
  488. package/dist/types/utils/modal.d.ts +2 -2
  489. package/dist/types/utils/popover.d.ts +5 -5
  490. package/dist/types/utils/popup.d.ts +9 -0
  491. package/dist/types/utils/slot.d.ts +2 -7
  492. package/dist/types/utils/tabbable.d.ts +1 -1
  493. package/dist/types/utils/time.util.d.ts +18 -9
  494. package/dist/types/utils/type-check.d.ts +3 -4
  495. package/dist/types/wrappers/set-attributes/set-attributes.d.ts +1 -1
  496. package/dist/ui-library/p-02d5a6d8.js +2 -0
  497. package/dist/ui-library/p-02d5a6d8.js.map +1 -0
  498. package/dist/ui-library/p-053d6de8.entry.js +2 -0
  499. package/dist/ui-library/p-053d6de8.entry.js.map +1 -0
  500. package/dist/ui-library/p-0cc08e91.js +2 -0
  501. package/dist/ui-library/p-0cc08e91.js.map +1 -0
  502. package/dist/ui-library/{p-a1d4f6cf.entry.js → p-0eee4c41.entry.js} +2 -2
  503. package/dist/ui-library/p-0eee4c41.entry.js.map +1 -0
  504. package/dist/ui-library/p-0fe78f9b.js +2 -0
  505. package/dist/ui-library/p-0fe78f9b.js.map +1 -0
  506. package/dist/ui-library/{p-ac4f4d45.js → p-187fbba0.js} +3 -3
  507. package/dist/ui-library/p-187fbba0.js.map +1 -0
  508. package/dist/ui-library/p-25b42655.entry.js +2 -0
  509. package/dist/ui-library/p-25b42655.entry.js.map +1 -0
  510. package/dist/ui-library/p-271ba152.entry.js +2 -0
  511. package/dist/ui-library/p-271ba152.entry.js.map +1 -0
  512. package/dist/ui-library/{p-6d75f216.entry.js → p-27c4ee88.entry.js} +2 -2
  513. package/dist/ui-library/{p-f604e067.entry.js → p-2a36b7d0.entry.js} +2 -2
  514. package/dist/ui-library/p-2a8ad91b.entry.js +2 -0
  515. package/dist/ui-library/p-2a8ad91b.entry.js.map +1 -0
  516. package/dist/ui-library/{p-97cc839c.entry.js → p-30e0cdce.entry.js} +2 -2
  517. package/dist/ui-library/p-30e0cdce.entry.js.map +1 -0
  518. package/dist/ui-library/{p-63703ba3.entry.js → p-3a47c8ad.entry.js} +2 -2
  519. package/dist/ui-library/{p-63703ba3.entry.js.map → p-3a47c8ad.entry.js.map} +1 -1
  520. package/dist/ui-library/p-3a4815cb.entry.js +2 -0
  521. package/dist/ui-library/p-3a4815cb.entry.js.map +1 -0
  522. package/dist/ui-library/p-3b71cac4.entry.js +2 -0
  523. package/dist/ui-library/p-3b71cac4.entry.js.map +1 -0
  524. package/dist/ui-library/{p-5a25d6fb.entry.js → p-3d4a2e03.entry.js} +2 -2
  525. package/dist/ui-library/{p-73597d13.entry.js → p-3e4b9341.entry.js} +2 -2
  526. package/dist/ui-library/{p-73597d13.entry.js.map → p-3e4b9341.entry.js.map} +1 -1
  527. package/dist/ui-library/{p-3c635d0a.entry.js → p-41f0b6ff.entry.js} +2 -2
  528. package/dist/ui-library/p-435242a8.entry.js +2 -0
  529. package/dist/ui-library/p-435242a8.entry.js.map +1 -0
  530. package/dist/ui-library/{p-19364560.entry.js → p-5084ca7c.entry.js} +2 -2
  531. package/dist/ui-library/{p-19364560.entry.js.map → p-5084ca7c.entry.js.map} +1 -1
  532. package/dist/ui-library/p-5b3e6eb7.entry.js +2 -0
  533. package/dist/ui-library/p-5b3e6eb7.entry.js.map +1 -0
  534. package/dist/ui-library/{p-8a970a40.entry.js → p-5c1dd25a.entry.js} +2 -2
  535. package/dist/ui-library/p-5c1dd25a.entry.js.map +1 -0
  536. package/dist/ui-library/p-5c60227f.entry.js +2 -0
  537. package/dist/ui-library/p-5c60227f.entry.js.map +1 -0
  538. package/dist/ui-library/p-5dc40a6a.entry.js +2 -0
  539. package/dist/ui-library/p-5dc40a6a.entry.js.map +1 -0
  540. package/dist/ui-library/{p-dd3c76f1.entry.js → p-649017db.entry.js} +2 -2
  541. package/dist/ui-library/p-713684c7.entry.js +2 -0
  542. package/dist/ui-library/p-713684c7.entry.js.map +1 -0
  543. package/dist/ui-library/{p-c30f9e0b.entry.js → p-73325eec.entry.js} +2 -2
  544. package/dist/ui-library/p-73325eec.entry.js.map +1 -0
  545. package/dist/ui-library/p-7639c68e.entry.js +2 -0
  546. package/dist/ui-library/p-7639c68e.entry.js.map +1 -0
  547. package/dist/ui-library/p-764f56dd.entry.js +2 -0
  548. package/dist/ui-library/p-764f56dd.entry.js.map +1 -0
  549. package/dist/ui-library/{p-e19a6c95.entry.js → p-886a35ee.entry.js} +2 -2
  550. package/dist/ui-library/p-8cf72af6.js +2 -0
  551. package/dist/ui-library/p-8cf72af6.js.map +1 -0
  552. package/dist/ui-library/p-8d6f4311.entry.js +2 -0
  553. package/dist/ui-library/p-8d6f4311.entry.js.map +1 -0
  554. package/dist/ui-library/p-90c2dc30.entry.js +2 -0
  555. package/dist/ui-library/p-90c2dc30.entry.js.map +1 -0
  556. package/dist/ui-library/{p-97323ad7.entry.js → p-965fa6a6.entry.js} +2 -2
  557. package/dist/ui-library/p-98234e3f.entry.js +2 -0
  558. package/dist/ui-library/p-98234e3f.entry.js.map +1 -0
  559. package/dist/ui-library/{p-820c23f0.entry.js → p-9b9c3afc.entry.js} +2 -2
  560. package/dist/ui-library/{p-394a2a12.entry.js → p-9c34eab7.entry.js} +2 -2
  561. package/dist/ui-library/{p-394a2a12.entry.js.map → p-9c34eab7.entry.js.map} +1 -1
  562. package/dist/ui-library/p-9e0c386f.entry.js +2 -0
  563. package/dist/ui-library/p-9e0c386f.entry.js.map +1 -0
  564. package/dist/ui-library/p-9f8b6144.entry.js +2 -0
  565. package/dist/ui-library/p-9f8b6144.entry.js.map +1 -0
  566. package/dist/ui-library/p-a3cc0521.entry.js +2 -0
  567. package/dist/ui-library/p-a3cc0521.entry.js.map +1 -0
  568. package/dist/ui-library/{p-21859bca.entry.js → p-a5143b8d.entry.js} +2 -2
  569. package/dist/ui-library/{p-097cced4.entry.js → p-aa6f71e1.entry.js} +2 -2
  570. package/dist/ui-library/{p-097cced4.entry.js.map → p-aa6f71e1.entry.js.map} +1 -1
  571. package/dist/ui-library/p-abb98245.entry.js +2 -0
  572. package/dist/ui-library/p-abb98245.entry.js.map +1 -0
  573. package/dist/ui-library/p-b183e44f.js +2 -0
  574. package/dist/ui-library/p-b183e44f.js.map +1 -0
  575. package/dist/ui-library/{p-19b50b5a.entry.js → p-b27f496f.entry.js} +2 -2
  576. package/dist/ui-library/p-b27f496f.entry.js.map +1 -0
  577. package/dist/ui-library/{p-4f8394d7.js → p-ba74863a.js} +2 -2
  578. package/dist/ui-library/p-ba74863a.js.map +1 -0
  579. package/dist/ui-library/p-bf4a35ec.js +2 -0
  580. package/dist/ui-library/p-bf4a35ec.js.map +1 -0
  581. package/dist/ui-library/{p-d5633a29.entry.js → p-c07adc21.entry.js} +2 -2
  582. package/dist/ui-library/p-c07adc21.entry.js.map +1 -0
  583. package/dist/ui-library/p-c700e3eb.entry.js +2 -0
  584. package/dist/ui-library/p-c700e3eb.entry.js.map +1 -0
  585. package/dist/ui-library/p-cab99e54.entry.js +2 -0
  586. package/dist/ui-library/p-cab99e54.entry.js.map +1 -0
  587. package/dist/ui-library/{p-baa03951.entry.js → p-cf1133a0.entry.js} +2 -2
  588. package/dist/ui-library/p-cf1d36c0.entry.js +2 -0
  589. package/dist/ui-library/p-cf1d36c0.entry.js.map +1 -0
  590. package/dist/ui-library/p-d87a6f4d.js +2 -0
  591. package/dist/ui-library/p-d87a6f4d.js.map +1 -0
  592. package/dist/ui-library/{p-c349d1d4.entry.js → p-d8c97778.entry.js} +2 -2
  593. package/dist/ui-library/p-d8c97778.entry.js.map +1 -0
  594. package/dist/ui-library/p-deb01174.entry.js +2 -0
  595. package/dist/ui-library/p-deb01174.entry.js.map +1 -0
  596. package/dist/ui-library/{p-af793d04.entry.js → p-e5ba13d2.entry.js} +2 -2
  597. package/dist/ui-library/p-e5ba13d2.entry.js.map +1 -0
  598. package/dist/ui-library/{p-611e1978.entry.js → p-f29ba9cb.entry.js} +2 -2
  599. package/dist/ui-library/{p-611e1978.entry.js.map → p-f29ba9cb.entry.js.map} +1 -1
  600. package/dist/ui-library/{p-9328e5bc.entry.js → p-f66eb76c.entry.js} +2 -2
  601. package/dist/ui-library/p-f66eb76c.entry.js.map +1 -0
  602. package/dist/ui-library/p-f974a184.entry.js +2 -0
  603. package/dist/ui-library/p-f974a184.entry.js.map +1 -0
  604. package/dist/ui-library/{p-b0e5658f.entry.js → p-fb8d0734.entry.js} +2 -2
  605. package/dist/ui-library/p-fb8d0734.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 +1 -1
  609. package/dist/cjs/event-listeners-74715e62.js.map +0 -1
  610. package/dist/cjs/execution-control-46f388e0.js.map +0 -1
  611. package/dist/cjs/focus-visible-0b352c74.js.map +0 -1
  612. package/dist/cjs/form-control-2c17c573.js.map +0 -1
  613. package/dist/cjs/index-2f6daa5b.js.map +0 -1
  614. package/dist/cjs/modal-48d42228.js.map +0 -1
  615. package/dist/cjs/six-timepicker.types-c19ebff3.js +0 -56
  616. package/dist/cjs/six-timepicker.types-c19ebff3.js.map +0 -1
  617. package/dist/cjs/slot-ad537f24.js.map +0 -1
  618. package/dist/collection/components/six-timepicker/six-time-format.js +0 -15
  619. package/dist/collection/components/six-timepicker/six-time-format.js.map +0 -1
  620. package/dist/collection/components/six-timepicker/six-timepicker.types.js +0 -41
  621. package/dist/collection/components/six-timepicker/six-timepicker.types.js.map +0 -1
  622. package/dist/collection/utils/as-array.js +0 -2
  623. package/dist/collection/utils/as-array.js.map +0 -1
  624. package/dist/collection/utils/matchers.js +0 -3
  625. package/dist/collection/utils/matchers.js.map +0 -1
  626. package/dist/collection/utils/testing.js +0 -39
  627. package/dist/collection/utils/testing.js.map +0 -1
  628. package/dist/esm/event-listeners-570a24ea.js.map +0 -1
  629. package/dist/esm/execution-control-1a60d709.js.map +0 -1
  630. package/dist/esm/focus-visible-97933ea9.js.map +0 -1
  631. package/dist/esm/form-control-3b440ea1.js.map +0 -1
  632. package/dist/esm/index-5c0f6628.js.map +0 -1
  633. package/dist/esm/modal-5ebdc320.js.map +0 -1
  634. package/dist/esm/popover-bd2c2fca.js.map +0 -1
  635. package/dist/esm/six-timepicker.types-e161a447.js +0 -50
  636. package/dist/esm/six-timepicker.types-e161a447.js.map +0 -1
  637. package/dist/esm/slot-6f3984c7.js.map +0 -1
  638. package/dist/types/components/six-timepicker/six-time-format.d.ts +0 -13
  639. package/dist/types/components/six-timepicker/six-timepicker.types.d.ts +0 -36
  640. package/dist/types/utils/as-array.d.ts +0 -1
  641. package/dist/types/utils/matchers.d.ts +0 -2
  642. package/dist/types/utils/popper.d.ts +0 -33
  643. package/dist/types/utils/testing.d.ts +0 -2
  644. package/dist/ui-library/p-054e12cc.entry.js +0 -2
  645. package/dist/ui-library/p-054e12cc.entry.js.map +0 -1
  646. package/dist/ui-library/p-0786fa7c.js +0 -2
  647. package/dist/ui-library/p-0786fa7c.js.map +0 -1
  648. package/dist/ui-library/p-163f2bb0.entry.js +0 -2
  649. package/dist/ui-library/p-163f2bb0.entry.js.map +0 -1
  650. package/dist/ui-library/p-18e5f772.entry.js +0 -2
  651. package/dist/ui-library/p-18e5f772.entry.js.map +0 -1
  652. package/dist/ui-library/p-18ea0c56.js +0 -2
  653. package/dist/ui-library/p-18ea0c56.js.map +0 -1
  654. package/dist/ui-library/p-19b50b5a.entry.js.map +0 -1
  655. package/dist/ui-library/p-2e48c8d2.entry.js +0 -2
  656. package/dist/ui-library/p-2e48c8d2.entry.js.map +0 -1
  657. package/dist/ui-library/p-308261c4.entry.js +0 -2
  658. package/dist/ui-library/p-308261c4.entry.js.map +0 -1
  659. package/dist/ui-library/p-33f7e22b.entry.js +0 -2
  660. package/dist/ui-library/p-33f7e22b.entry.js.map +0 -1
  661. package/dist/ui-library/p-4ae91795.entry.js +0 -2
  662. package/dist/ui-library/p-4ae91795.entry.js.map +0 -1
  663. package/dist/ui-library/p-4f8394d7.js.map +0 -1
  664. package/dist/ui-library/p-53a13db5.entry.js +0 -2
  665. package/dist/ui-library/p-53a13db5.entry.js.map +0 -1
  666. package/dist/ui-library/p-559c87f0.entry.js +0 -2
  667. package/dist/ui-library/p-559c87f0.entry.js.map +0 -1
  668. package/dist/ui-library/p-6403fd87.entry.js +0 -2
  669. package/dist/ui-library/p-6403fd87.entry.js.map +0 -1
  670. package/dist/ui-library/p-6433c0da.entry.js +0 -2
  671. package/dist/ui-library/p-6433c0da.entry.js.map +0 -1
  672. package/dist/ui-library/p-79eee01b.js +0 -2
  673. package/dist/ui-library/p-79eee01b.js.map +0 -1
  674. package/dist/ui-library/p-8a970a40.entry.js.map +0 -1
  675. package/dist/ui-library/p-90824648.entry.js +0 -2
  676. package/dist/ui-library/p-90824648.entry.js.map +0 -1
  677. package/dist/ui-library/p-9328e5bc.entry.js.map +0 -1
  678. package/dist/ui-library/p-97cc839c.entry.js.map +0 -1
  679. package/dist/ui-library/p-9a860acc.js +0 -2
  680. package/dist/ui-library/p-9a860acc.js.map +0 -1
  681. package/dist/ui-library/p-9d1d222f.entry.js +0 -2
  682. package/dist/ui-library/p-9d1d222f.entry.js.map +0 -1
  683. package/dist/ui-library/p-a1d4f6cf.entry.js.map +0 -1
  684. package/dist/ui-library/p-ac4f4d45.js.map +0 -1
  685. package/dist/ui-library/p-af793d04.entry.js.map +0 -1
  686. package/dist/ui-library/p-b0e5658f.entry.js.map +0 -1
  687. package/dist/ui-library/p-b1e66136.js +0 -2
  688. package/dist/ui-library/p-b1e66136.js.map +0 -1
  689. package/dist/ui-library/p-b4dfb7cf.js +0 -2
  690. package/dist/ui-library/p-b4dfb7cf.js.map +0 -1
  691. package/dist/ui-library/p-b997e43c.entry.js +0 -2
  692. package/dist/ui-library/p-b997e43c.entry.js.map +0 -1
  693. package/dist/ui-library/p-c0cb6436.entry.js +0 -2
  694. package/dist/ui-library/p-c0cb6436.entry.js.map +0 -1
  695. package/dist/ui-library/p-c30f9e0b.entry.js.map +0 -1
  696. package/dist/ui-library/p-c349d1d4.entry.js.map +0 -1
  697. package/dist/ui-library/p-c53a63f9.entry.js +0 -2
  698. package/dist/ui-library/p-c53a63f9.entry.js.map +0 -1
  699. package/dist/ui-library/p-c640c2d8.entry.js +0 -2
  700. package/dist/ui-library/p-c640c2d8.entry.js.map +0 -1
  701. package/dist/ui-library/p-c94d0b07.entry.js +0 -2
  702. package/dist/ui-library/p-c94d0b07.entry.js.map +0 -1
  703. package/dist/ui-library/p-d12c6092.js +0 -2
  704. package/dist/ui-library/p-d12c6092.js.map +0 -1
  705. package/dist/ui-library/p-d5633a29.entry.js.map +0 -1
  706. package/dist/ui-library/p-df655bc9.entry.js +0 -2
  707. package/dist/ui-library/p-df655bc9.entry.js.map +0 -1
  708. package/dist/ui-library/p-f18ba86f.entry.js +0 -2
  709. package/dist/ui-library/p-f18ba86f.entry.js.map +0 -1
  710. package/dist/ui-library/p-f4938771.entry.js +0 -2
  711. package/dist/ui-library/p-f4938771.entry.js.map +0 -1
  712. package/dist/ui-library/p-f70e2403.entry.js +0 -2
  713. package/dist/ui-library/p-f70e2403.entry.js.map +0 -1
  714. package/dist/ui-library/p-f9d345e0.entry.js +0 -2
  715. package/dist/ui-library/p-f9d345e0.entry.js.map +0 -1
  716. package/dist/ui-library/p-fed07a1f.entry.js +0 -2
  717. package/dist/ui-library/p-fed07a1f.entry.js.map +0 -1
  718. package/dist/ui-library/p-ff0257bf.entry.js +0 -2
  719. package/dist/ui-library/p-ff0257bf.entry.js.map +0 -1
  720. /package/dist/ui-library/{p-6d75f216.entry.js.map → p-27c4ee88.entry.js.map} +0 -0
  721. /package/dist/ui-library/{p-f604e067.entry.js.map → p-2a36b7d0.entry.js.map} +0 -0
  722. /package/dist/ui-library/{p-5a25d6fb.entry.js.map → p-3d4a2e03.entry.js.map} +0 -0
  723. /package/dist/ui-library/{p-3c635d0a.entry.js.map → p-41f0b6ff.entry.js.map} +0 -0
  724. /package/dist/ui-library/{p-dd3c76f1.entry.js.map → p-649017db.entry.js.map} +0 -0
  725. /package/dist/ui-library/{p-e19a6c95.entry.js.map → p-886a35ee.entry.js.map} +0 -0
  726. /package/dist/ui-library/{p-97323ad7.entry.js.map → p-965fa6a6.entry.js.map} +0 -0
  727. /package/dist/ui-library/{p-820c23f0.entry.js.map → p-9b9c3afc.entry.js.map} +0 -0
  728. /package/dist/ui-library/{p-21859bca.entry.js.map → p-a5143b8d.entry.js.map} +0 -0
  729. /package/dist/ui-library/{p-baa03951.entry.js.map → p-cf1133a0.entry.js.map} +0 -0
@@ -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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AG,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,IAAqB;EAChD,MAAM,KAAK,GAAG,IAAI,CAAC,aAAa,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;EACpD,IAAI,IAAI,GAAG,EAAE,CAAC;EAEd,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;IACtB,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,YAAY,EAAE;MACvC,IAAI,IAAK,IAAoB,CAAC,SAAS,CAAC;KACzC;IAED,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,SAAS,EAAE;MACpC,IAAI,IAAI,IAAI,CAAC,WAAW,CAAC;KAC1B;EACH,CAAC,CAAC,CAAC;EAEH,OAAO,IAAI,CAAC;AACd,CAAC;AAED,EAAE;AACF,kHAAkH;AAClH,kFAAkF;AAClF,EAAE;AACF,MAAM,UAAU,cAAc,CAAC,IAAqB;EAClD,MAAM,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CA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C/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.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,kHAAkH;AAClH,kFAAkF;AAClF,EAAE;AACF,MAAM,UAAU,cAAc,CAAC,IAAsB;EACnD,MAAM,KAAK,GAAG,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;EACxE,IAAI,IAAI,GAAG,EAAE,CAAC;EAEd,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;IACtB,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,SAAS,EAAE;MACpC,IAAI,IAAI,IAAI,CAAC,WAAW,CAAC;KAC1B;EACH,CAAC,CAAC,CAAC;EAEH,OAAO,IAAI,CAAC;AACd,CAAC;AAED,EAAE;AACF,mHAAmH;AACnH,uHAAuH;AACvH,EAAE;AACF,MAAM,UAAU,OAAO,CAAC,EAAe,EAAE,IAAa;EACpD,wBAAwB;EACxB,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,KAAK,EAAE,EAAE;IAC/B,OAAO,EAAE,CAAC,aAAa,CAAC,UAAU,IAAI,IAAI,CAAC,KAAK,IAAI,CAAC;GACtD;EAED,0BAA0B;EAC1B,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE;;IAC7C,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,SAAS,IAAI,CAAA,MAAA,IAAI,CAAC,WAAW,0CAAE,IAAI,EAAE,MAAK,EAAE,EAAE;MACvE,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;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,CAAC,CAAC;AAEF,MAAM,6BAA6B,GAAG,EAAE,CAAC;AAEzC,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,KAAa,EAAE,EAAE,CACtD,KAAK,GAAG,6BAA6B,CAAC,CAAC,CAAC,KAAK,GAAG,6BAA6B,CAAC,CAAC,CAAC,KAAK,CAAC;AAExF,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAY,EAAE;EACnD,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC;EACvB,MAAM,KAAK,GAAG,GAAG,CAAC,QAAQ,EAAE,CAAC;EAC7B,OAAO;IACL,KAAK,EAAE,sBAAsB,CAAC,KAAK,CAAC;IACpC,OAAO,EAAE,GAAG,CAAC,UAAU,EAAE;IACzB,OAAO,EAAE,GAAG,CAAC,UAAU,EAAE;IACzB,YAAY,EAAE,GAAG,CAAC,eAAe,EAAE;IACnC,UAAU,EAAE,KAAK;IACjB,MAAM,EAAE,KAAK,IAAI,6BAA6B,CAAC,CAAC,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,EAAE;GACrF,CAAC;AACJ,CAAC,C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,CAAC,WAAW,EAAE,KAAK,aAAa,CAAC,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,EAAE,CAAC;OAC1G;WAAM;QACL,OAAO,CAAC,mBAAmB,CAAC,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC;OACvD;KACF;IAED,IAAI,gBAAgB,KAAK,gBAAgB,CAAC,OAAO,EAAE;MACjD,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;KAC3B;SAAM,IAAI,gBAAgB,KAAK,gBAAgB,CAAC,OAAO,EAAE;MACxD,OAAO,CAAC,UAAU,GAAG,KAAK,CAAC;KAC5B;EACH,CAAC,CAAC,CAAC;EAEH,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,IAAa,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_FORMAT_SEPARATOR);\n};\n"]}
1
+ {"version":3,"file":"time.util.js","sourceRoot":"","sources":["../../src/utils/time.util.ts"],"names":[],"mappings":"AAqCA,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAS,EAAE;EAChD,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,CAAC,CAAC;AAEF,MAAM,6BAA6B,GAAG,EAAE,CAAC;AAEzC,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,KAAa,EAAE,EAAE,CACtD,KAAK,GAAG,6BAA6B,CAAC,CAAC,CAAC,KAAK,GAAG,6BAA6B,CAAC,CAAC,CAAC,KAAK,CAAC;AAExF,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAS,EAAE;EAChD,MAAM,GAAG,GAAG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C;MACV,KAAK,IAAI;QACP,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;MAC7C,KAAK,IAAI;QACP,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;MAC/C,KAAK,IAAI;QACP,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;MAC/C,KAAK,IAAI;QACP,OAAO,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;MACpD,KAAK,IAAI;QACP,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,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"]}
@@ -1,4 +1,3 @@
1
- const equals = (a) => (b) => Object.keys(a).every((key) => a[key] === b[key]);
2
1
  class EventListeners {
3
2
  constructor() {
4
3
  this.eventListeners = [];
@@ -7,8 +6,7 @@ class EventListeners {
7
6
  el.addEventListener(name, listener);
8
7
  };
9
8
  this.remove = (el, name, listener) => {
10
- const sameItem = equals({ el, name, listener });
11
- this.eventListeners = this.getFilteredEventListeners(sameItem);
9
+ this.eventListeners = this.getFilteredEventListeners((eventListener) => eventListener.listener == listener && eventListener.el === el && eventListener.name === name);
12
10
  };
13
11
  this.removeByIdentifier = (identifier) => {
14
12
  const sameItem = (el) => el.identifier === identifier;
@@ -19,9 +17,11 @@ class EventListeners {
19
17
  this.eventListeners = this.getFilteredEventListeners(sameItem);
20
18
  };
21
19
  this.removeAll = () => {
22
- while (this.eventListeners.length) {
23
- const { el, name, listener } = this.eventListeners.pop();
24
- el.removeEventListener(name, listener);
20
+ while (this.eventListeners.length > 0) {
21
+ const eventListener = this.eventListeners.pop();
22
+ if (eventListener != null) {
23
+ eventListener.el.removeEventListener(eventListener.name, eventListener.listener);
24
+ }
25
25
  }
26
26
  };
27
27
  }
@@ -1 +1 @@
1
- {"file":"event-listeners.js","m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C,cAAc,CAAC,GAAG,EAAE,CAAC;QACzD,EAAE,CAAC,mBAAmB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;OACxC;KACF,CAAC;GACH;EAjBS,yBAAyB,CAAC,QAAyB;IACzD,OAAO,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,IAAI;MACrC,IAAI,QAAQ,CAAC,IAAI,CAAC,EAAE;QAClB,IAAI,CAAC,EAAE,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;QACtD,OAAO,KAAK,CAAC;OACd;WAAM;QACL,OAAO,IAAI,CAAC;OACb;KACF,CAAC,CAAC;GACJ;;;;;","names":[],"sources":["./src/utils/event-listeners.ts"],"sourcesContent":["interface EventListener {\n el: DocumentAndElementEventHandlers;\n name: string;\n listener: EventListenerOrEventListenerObject;\n identifier?: string | null;\n}\n\nconst equals =\n <A extends Object>(a: A) =>\n <B extends Object>(b: B) =>\n Object.keys(a).every((key) => a[key] === b[key]);\n\nexport class EventListeners {\n eventListeners: EventListener[] = [];\n\n add = <T extends DocumentAndElementEventHandlers>(\n el: T,\n name: string,\n listener: EventListenerOrEventListenerObject,\n identifier = null\n ) => {\n this.eventListeners.push({ el, name, listener, identifier });\n el.addEventListener(name, listener);\n };\n\n remove = <T extends DocumentAndElementEventHandlers>(\n el: T,\n name: string,\n listener: EventListenerOrEventListenerObject\n ) => {\n const sameItem = equals({ el, name, listener });\n this.eventListeners = this.getFilteredEventListeners(sameItem);\n };\n\n removeByIdentifier = (identifier: string) => {\n const sameItem = (el) => el.identifier === identifier;\n const foundListener = this.eventListeners.find(sameItem) !== undefined;\n\n if (!foundListener) {\n return;\n }\n\n this.eventListeners = this.getFilteredEventListeners(sameItem);\n };\n\n private getFilteredEventListeners(sameItem: (el) => boolean) {\n return this.eventListeners.filter((item) => {\n if (sameItem(item)) {\n item.el.removeEventListener(item.name, item.listener);\n return false;\n } else {\n return true;\n }\n });\n }\n\n removeAll = () => {\n while (this.eventListeners.length) {\n const { el, name, listener } = this.eventListeners.pop();\n el.removeEventListener(name, listener);\n }\n };\n}\n"],"version":3}
1
+ {"file":"event-listeners.js","mappings":"MAOa,cAAc;EAA3B;IACE,mBAAc,GAAoB,EAAE,CAAC;IAErC,QAAG,GAAG,CACJ,EAAK,EACL,IAAY,EACZ,QAA4C,EAC5C,aAAwC,IAAI;MAE5C,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,CAAC;MAC7D,EAAE,CAAC,gBAAgB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;KACrC,CAAC;IAEF,WAAM,GAAG,CACP,EAAK,EACL,IAAY,EACZ,QAA4C;MAE5C,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,yBAAyB,CAClD,CAAC,aAA4B,KAC3B,aAAa,CAAC,QAAQ,IAAI,QAAQ,IAAI,aAAa,CAAC,EAAE,KAAK,EAAE,IAAI,aAAa,CAAC,IAAI,KAAK,IAAI,CAC/F,CAAC;KACH,CAAC;IAEF,uBAAkB,GAAG,CAAC,UAAkB;MACtC,MAAM,QAAQ,GAAG,CAAC,EAAiB,KAAK,EAAE,CAAC,UAAU,KAAK,UAAU,CAAC;MACrE,MAAM,aAAa,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,SAAS,CAAC;MACvE,IAAI,CAAC,aAAa,EAAE;QAClB,OAAO;OACR;MACD,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,yBAAyB,CAAC,QAAQ,CAAC,CAAC;KAChE,CAAC;IAaF,cAAS,GAAG;MACV,OAAO,IAAI,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE;QACrC,MAAM,aAAa,GAA8B,IAAI,CAAC,cAAc,CAAC,GAAG,EAAE,CAAC;QAC3E,IAAI,aAAa,IAAI,IAAI,EAAE;UACzB,aAAa,CAAC,EAAE,CAAC,mBAAmB,CAAC,aAAa,CAAC,IAAI,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;SAClF;OACF;KACF,CAAC;GACH;EAnBS,yBAAyB,CAAC,QAAwC;IACxE,OAAO,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,IAAI;MACrC,IAAI,QAAQ,CAAC,IAAI,CAAC,EAAE;QAClB,IAAI,CAAC,EAAE,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;QACtD,OAAO,KAAK,CAAC;OACd;WAAM;QACL,OAAO,IAAI,CAAC;OACb;KACF,CAAC,CAAC;GACJ;;;;;","names":[],"sources":["./src/utils/event-listeners.ts"],"sourcesContent":["interface EventListener {\n el: DocumentAndElementEventHandlers;\n name: string;\n listener: EventListenerOrEventListenerObject;\n identifier?: string | null;\n}\n\nexport class EventListeners {\n eventListeners: EventListener[] = [];\n\n add = <T extends DocumentAndElementEventHandlers>(\n el: T,\n name: string,\n listener: EventListenerOrEventListenerObject,\n identifier: string | null | undefined = null\n ) => {\n this.eventListeners.push({ el, name, listener, identifier });\n el.addEventListener(name, listener);\n };\n\n remove = <T extends DocumentAndElementEventHandlers>(\n el: T,\n name: string,\n listener: EventListenerOrEventListenerObject\n ) => {\n this.eventListeners = this.getFilteredEventListeners(\n (eventListener: EventListener) =>\n eventListener.listener == listener && eventListener.el === el && eventListener.name === name\n );\n };\n\n removeByIdentifier = (identifier: string) => {\n const sameItem = (el: EventListener) => el.identifier === identifier;\n const foundListener = this.eventListeners.find(sameItem) !== undefined;\n if (!foundListener) {\n return;\n }\n this.eventListeners = this.getFilteredEventListeners(sameItem);\n };\n\n private getFilteredEventListeners(sameItem: (el: EventListener) => boolean) {\n return this.eventListeners.filter((item) => {\n if (sameItem(item)) {\n item.el.removeEventListener(item.name, item.listener);\n return false;\n } else {\n return true;\n }\n });\n }\n\n removeAll = () => {\n while (this.eventListeners.length > 0) {\n const eventListener: EventListener | undefined = this.eventListeners.pop();\n if (eventListener != null) {\n eventListener.el.removeEventListener(eventListener.name, eventListener.listener);\n }\n }\n };\n}\n"],"version":3}
@@ -15,9 +15,11 @@ const DEFAULT_DEBOUNCE_FAST = 300;
15
15
  */
16
16
  const debounce = (callback, timeout = DEFAULT_DEBOUNCE_FAST) => {
17
17
  let timer;
18
- return (...args) => {
18
+ return (args) => {
19
19
  clearTimeout(timer);
20
- timer = setTimeout(() => callback.apply(undefined, args), timeout);
20
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
21
+ // @ts-ignore
22
+ timer = setTimeout(() => callback(args), timeout);
21
23
  };
22
24
  };
23
25
  /**
@@ -27,6 +29,7 @@ const debounce = (callback, timeout = DEFAULT_DEBOUNCE_FAST) => {
27
29
  * @param timeout
28
30
  */
29
31
  const debounceEvent = (event, timeout) => {
32
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
30
33
  const original = event._original || event;
31
34
  const emit = debounce(original.emit.bind(original), timeout);
32
35
  return {
@@ -1 +1 @@
1
- {"file":"execution-control.js","mappings":"MAEa,8BAA8B,GAAG,GAAG;MAEpC,qBAAqB,GAAG,IAAI;AAGzC;;;;;;;;;;;;;MAaa,QAAQ,GAAG,CAAC,QAAkB,EAAE,OAAO,GAAG,qBAAqB;EAC1E,IAAI,KAAqB,CAAC;EAC1B,OAAO,CAAI,GAAG,IAAS;IACrB,YAAY,CAAC,KAAK,CAAC,CAAC;IACpB,KAAK,GAAG,UAAU,CAAC,MAAM,QAAQ,CAAC,KAAK,CAACA,SAAI,EAAE,IAAI,CAAC,EAAE,OAAO,CAAC,CAAC;GAC/D,CAAC;AACJ,EAAE;AAEF;;;;;;MAMa,aAAa,GAAG,CAAC,KAAmB,EAAE,OAAe;EAChE,MAAM,QAAQ,GAAI,KAAa,CAAC,SAAS,IAAI,KAAK,CAAC;EACnD,MAAM,IAAI,GAAG,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAyB,CAAC;EACrF,OAAO;IACL,SAAS,EAAE,KAAK;IAChB,IAAI,EAAE,IAAI;GACK,CAAC;AACpB;;;;","names":["this"],"sources":["./src/utils/execution-control.ts"],"sourcesContent":["import { EventEmitter } from '@stencil/core';\n\nexport const DEFAULT_DEBOUNCE_INSANELY_FAST = 35;\nexport const DEFAULT_DEBOUNCE_VERY_FAST = 100;\nexport const DEFAULT_DEBOUNCE_FAST = 300;\nexport const DEFAULT_DEBOUNCE_SLOW = 600;\n\n/**\n * Debounce function to implement a timeframe to wait for no new changes before executing a callback\n\n * example usages:\n * debounce(() => saveInput());\n * debounce(() => saveInput(), 750);\n * this.searchInput.addEventListener('six-input-input', debounce((event) => this.searchInputChange(event)));\n *\n * regarding default timeout check https://lawsofux.com/doherty-threshold/\n *\n * @param callback\n * @param timeout\n */\nexport const debounce = (callback: Function, timeout = DEFAULT_DEBOUNCE_FAST) => {\n let timer: NodeJS.Timeout;\n return <T>(...args: T[]) => {\n clearTimeout(timer);\n timer = setTimeout(() => callback.apply(this, args), timeout);\n };\n};\n\n/**\n * Debounce an event\n *\n * @param event\n * @param timeout\n */\nexport const debounceEvent = (event: EventEmitter, timeout: number): EventEmitter => {\n const original = (event as any)._original || event;\n const emit = debounce(original.emit.bind(original), timeout) as (any) => CustomEvent;\n return {\n _original: event,\n emit: emit,\n } as EventEmitter;\n};\n"],"version":3}
1
+ {"file":"execution-control.js","mappings":"MAEa,8BAA8B,GAAG,GAAG;MACpC,qBAAqB,GAAG,IAAI;AAEzC;;;;;;;;;;;;;MAaa,QAAQ,GAAG,CAAI,QAAwB,EAAE,OAAO,GAAG,qBAAqB;EACnF,IAAI,KAAa,CAAC;EAClB,OAAO,CAAC,IAAO;IACb,YAAY,CAAC,KAAK,CAAC,CAAC;;;IAGpB,KAAK,GAAG,UAAU,CAAC,MAAM,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,CAAC;GACnD,CAAC;AACJ,EAAE;AAEF;;;;;;MAMa,aAAa,GAAG,CAAC,KAAmB,EAAE,OAAe;;EAEhE,MAAM,QAAQ,GAAI,KAAa,CAAC,SAAS,IAAI,KAAK,CAAC;EACnD,MAAM,IAAI,GAAG,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAgC,CAAC;EAC5F,OAAO;IACL,SAAS,EAAE,KAAK;IAChB,IAAI,EAAE,IAAI;GACK,CAAC;AACpB;;;;","names":[],"sources":["./src/utils/execution-control.ts"],"sourcesContent":["import { EventEmitter } from '@stencil/core';\n\nexport const DEFAULT_DEBOUNCE_INSANELY_FAST = 35;\nexport const DEFAULT_DEBOUNCE_FAST = 300;\n\n/**\n * Debounce function to implement a timeframe to wait for no new changes before executing a callback\n\n * example usages:\n * debounce(() => saveInput());\n * debounce(() => saveInput(), 750);\n * this.searchInput.addEventListener('six-input-input', debounce((event) => this.searchInputChange(event)));\n *\n * regarding default timeout check https://lawsofux.com/doherty-threshold/\n *\n * @param callback\n * @param timeout\n */\nexport const debounce = <T>(callback: (x: T) => void, timeout = DEFAULT_DEBOUNCE_FAST) => {\n let timer: number;\n return (args: T) => {\n clearTimeout(timer);\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n timer = setTimeout(() => callback(args), timeout);\n };\n};\n\n/**\n * Debounce an event\n *\n * @param event\n * @param timeout\n */\nexport const debounceEvent = (event: EventEmitter, timeout: number): EventEmitter => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const original = (event as any)._original || event;\n const emit = debounce(original.emit.bind(original), timeout) as (_: unknown) => CustomEvent;\n return {\n _original: event,\n emit: emit,\n } as EventEmitter;\n};\n"],"version":3}
@@ -6,7 +6,7 @@
6
6
  //
7
7
  const listeners = new WeakMap();
8
8
  function observe(el) {
9
- if (!el)
9
+ if (el == null)
10
10
  return;
11
11
  const keys = ['Tab', 'ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'Home', 'End', 'PageDown', 'PageUp'];
12
12
  const is = (event) => {
@@ -22,7 +22,7 @@ function observe(el) {
22
22
  el.addEventListener('mousedown', isNot);
23
23
  }
24
24
  function unobserve(el) {
25
- if (!el)
25
+ if (el == null)
26
26
  return;
27
27
  const listener = listeners.get(el);
28
28
  if (!listener) {
@@ -1 +1 @@
1
- {"file":"focus-visible.js","mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,SAAS,GAAG,IAAI,OAAO,EAAE,CAAC;SAEhB,OAAO,CAAC,EAAe;EACrC,IAAI,CAAC,EAAE;IAAE,OAAO;EAEhB,MAAM,IAAI,GAAG,CAAC,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;EAC7G,MAAM,EAAE,GAAG,CAAC,KAAoB;IAC9B,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;MAC5B,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;KACnC;GACF,CAAC;EACF,MAAM,KAAK,GAAG,MAAM,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;EACzD,SAAS,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;EAEjC,EAAE,CAAC,gBAAgB,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;EACnC,EAAE,CAAC,gBAAgB,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;EACjC,EAAE,CAAC,gBAAgB,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;EACxC,EAAE,CAAC,gBAAgB,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;AAC1C,CAAC;SAEe,SAAS,CAAC,EAAe;EACvC,IAAI,CAAC,EAAE;IAAE,OAAO;EAEhB,MAAM,QAAQ,GAAG,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;EAEnC,IAAI,CAAC,QAAQ,EAAE;IACb,OAAO;GACR;EAED,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,QAAQ,CAAC;EAE/B,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;EACrC,EAAE,CAAC,mBAAmB,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;EACtC,EAAE,CAAC,mBAAmB,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;EACpC,EAAE,CAAC,mBAAmB,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;EAC3C,EAAE,CAAC,mBAAmB,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;AAC7C,CAAC;MAEY,YAAY,GAAG;EAC1B,OAAO;EACP,SAAS;;;;;","names":[],"sources":["./src/utils/focus-visible.ts"],"sourcesContent":["//\n// Simulates :focus-visible behavior on an element by watching for certain keyboard and mouse heuristics and toggling a\n// `focus-visible` class. Works at the component level so no global polyfill is necessary.\n//\n// This will eventually be removed pending better :focus-visible support: https://caniuse.com/#search=focus-visible\n//\nconst listeners = new WeakMap();\n\nexport function observe(el: HTMLElement) {\n if (!el) return;\n\n const keys = ['Tab', 'ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'Home', 'End', 'PageDown', 'PageUp'];\n const is = (event: KeyboardEvent) => {\n if (keys.includes(event.key)) {\n el.classList.add('focus-visible');\n }\n };\n const isNot = () => el.classList.remove('focus-visible');\n listeners.set(el, { is, isNot });\n\n el.addEventListener('keydown', is);\n el.addEventListener('keyup', is);\n el.addEventListener('mousedown', isNot);\n el.addEventListener('mousedown', isNot);\n}\n\nexport function unobserve(el: HTMLElement) {\n if (!el) return;\n\n const listener = listeners.get(el);\n\n if (!listener) {\n return;\n }\n\n const { is, isNot } = listener;\n\n el.classList.remove('focus-visible');\n el.removeEventListener('keydown', is);\n el.removeEventListener('keyup', is);\n el.removeEventListener('mousedown', isNot);\n el.removeEventListener('mousedown', isNot);\n}\n\nexport const focusVisible = {\n observe,\n unobserve,\n};\n"],"version":3}
1
+ {"file":"focus-visible.js","mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,SAAS,GAAG,IAAI,OAAO,EAAE,CAAC;SAEhB,OAAO,CAAC,EAAe;EACrC,IAAI,EAAE,IAAI,IAAI;IAAE,OAAO;EAEvB,MAAM,IAAI,GAAG,CAAC,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;EAC7G,MAAM,EAAE,GAAG,CAAC,KAAoB;IAC9B,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;MAC5B,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;KACnC;GACF,CAAC;EACF,MAAM,KAAK,GAAG,MAAM,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;EACzD,SAAS,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;EAEjC,EAAE,CAAC,gBAAgB,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;EACnC,EAAE,CAAC,gBAAgB,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;EACjC,EAAE,CAAC,gBAAgB,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;EACxC,EAAE,CAAC,gBAAgB,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;AAC1C,CAAC;SAEe,SAAS,CAAC,EAAe;EACvC,IAAI,EAAE,IAAI,IAAI;IAAE,OAAO;EAEvB,MAAM,QAAQ,GAAG,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;EAEnC,IAAI,CAAC,QAAQ,EAAE;IACb,OAAO;GACR;EAED,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,QAAQ,CAAC;EAE/B,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;EACrC,EAAE,CAAC,mBAAmB,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;EACtC,EAAE,CAAC,mBAAmB,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;EACpC,EAAE,CAAC,mBAAmB,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;EAC3C,EAAE,CAAC,mBAAmB,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;AAC7C,CAAC;MAEY,YAAY,GAAG;EAC1B,OAAO;EACP,SAAS;;;;;","names":[],"sources":["./src/utils/focus-visible.ts"],"sourcesContent":["//\n// Simulates :focus-visible behavior on an element by watching for certain keyboard and mouse heuristics and toggling a\n// `focus-visible` class. Works at the component level so no global polyfill is necessary.\n//\n// This will eventually be removed pending better :focus-visible support: https://caniuse.com/#search=focus-visible\n//\nconst listeners = new WeakMap();\n\nexport function observe(el: HTMLElement) {\n if (el == null) return;\n\n const keys = ['Tab', 'ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'Home', 'End', 'PageDown', 'PageUp'];\n const is = (event: KeyboardEvent) => {\n if (keys.includes(event.key)) {\n el.classList.add('focus-visible');\n }\n };\n const isNot = () => el.classList.remove('focus-visible');\n listeners.set(el, { is, isNot });\n\n el.addEventListener('keydown', is);\n el.addEventListener('keyup', is);\n el.addEventListener('mousedown', isNot);\n el.addEventListener('mousedown', isNot);\n}\n\nexport function unobserve(el: HTMLElement) {\n if (el == null) return;\n\n const listener = listeners.get(el);\n\n if (!listener) {\n return;\n }\n\n const { is, isNot } = listener;\n\n el.classList.remove('focus-visible');\n el.removeEventListener('keydown', is);\n el.removeEventListener('keyup', is);\n el.removeEventListener('mousedown', isNot);\n el.removeEventListener('mousedown', isNot);\n}\n\nexport const focusVisible = {\n observe,\n unobserve,\n};\n"],"version":3}
@@ -1,9 +1,10 @@
1
1
  import { h } from '@stencil/core/internal/client';
2
2
 
3
3
  const FormControl = (props, children) => {
4
- const hasLabel = props.label ? true : props.hasLabelSlot;
5
- const hasHelpText = props.helpText ? true : props.hasHelpTextSlot;
6
- /** ErrorTextAttribute has precedence if non empty value is provided or if slot is not set */
4
+ var _a, _b, _c, _d, _e, _f;
5
+ const hasLabel = props.label != null && props.label.trim() !== '' ? true : (_a = props.hasLabelSlot) !== null && _a !== void 0 ? _a : false;
6
+ const hasHelpText = props.helpText != null && props.helpText.trim() !== '' ? true : (_b = props.hasHelpTextSlot) !== null && _b !== void 0 ? _b : false;
7
+ /** ErrorTextAttribute has precedence if non-empty value is provided or if slot is not set */
7
8
  const useErrorTextAttribute = (props.errorText && props.errorText !== '') || !props.hasErrorTextSlot;
8
9
  return (h("div", { part: "form-control", class: {
9
10
  'form-control': true,
@@ -12,13 +13,13 @@ const FormControl = (props, children) => {
12
13
  'form-control--large': props.size === 'large',
13
14
  'form-control--has-label': hasLabel,
14
15
  'form-control--has-help-text': hasHelpText,
15
- 'form-control--has-error-text': props.displayError,
16
- 'form-control--disabled': props.disabled,
17
- 'form-control--invalid': props.displayError && !props.disabled,
16
+ 'form-control--has-error-text': (_c = props.displayError) !== null && _c !== void 0 ? _c : false,
17
+ 'form-control--disabled': (_d = props.disabled) !== null && _d !== void 0 ? _d : false,
18
+ 'form-control--invalid': ((_e = props.displayError) !== null && _e !== void 0 ? _e : false) && !props.disabled,
18
19
  } },
19
20
  h("label", { part: "label", id: props.labelId, class: {
20
21
  'form-control__label': true,
21
- 'form-control__label__required': props.required,
22
+ 'form-control__label__required': (_f = props.required) !== null && _f !== void 0 ? _f : false,
22
23
  }, htmlFor: props.inputId, "aria-hidden": hasLabel ? 'false' : 'true', onClick: props.onLabelClick },
23
24
  h("slot", { name: "label" }, props.label)),
24
25
  h("div", { class: "form-control__input" }, children),