@eunomia/elements 1.0.0-beta.6 → 1.0.0-beta.8

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 (327) hide show
  1. package/README.md +1 -1
  2. package/dist/cdn/components/chunks/{chunk-KDN4O5W2.js → chunk-32L2QYWQ.js} +5 -5
  3. package/dist/cdn/components/chunks/{chunk-JYIIWN2P.js → chunk-36KLGY6U.js} +8 -8
  4. package/dist/cdn/components/chunks/chunk-3BMACIDO.js +1 -0
  5. package/dist/cdn/components/chunks/{chunk-2Y2EU2CI.js → chunk-3UUZM7X2.js} +1 -1
  6. package/dist/cdn/components/chunks/chunk-55PUDL7D.js +109 -0
  7. package/dist/cdn/components/chunks/chunk-5LA5DQMP.js +1 -0
  8. package/dist/cdn/components/chunks/chunk-5LXGJVJR.js +1 -0
  9. package/dist/cdn/components/chunks/{chunk-ZKZV2YG5.js → chunk-5XPOGBPL.js} +1 -1
  10. package/dist/cdn/components/chunks/{chunk-LMVW522V.js → chunk-62RLISRD.js} +1 -1
  11. package/dist/cdn/components/chunks/{chunk-PMPSJG5V.js → chunk-6FYW5TQU.js} +3 -3
  12. package/dist/cdn/components/chunks/chunk-6TIEBY34.js +1 -0
  13. package/dist/cdn/components/chunks/{chunk-MOMYII3P.js → chunk-AH2SKZ7T.js} +14 -1
  14. package/dist/cdn/components/chunks/chunk-AK2DIJX7.js +1 -0
  15. package/dist/cdn/components/chunks/chunk-B5XMGWM7.js +10 -0
  16. package/dist/cdn/components/chunks/chunk-GVS6IUKC.js +1 -0
  17. package/dist/cdn/components/chunks/chunk-GWLD2I3P.js +8 -0
  18. package/dist/cdn/components/chunks/{chunk-UDVB4LAE.js → chunk-I4ERDXSM.js} +5 -3
  19. package/dist/cdn/components/chunks/{chunk-QZ5SHR3I.js → chunk-J3SZBXM6.js} +2 -2
  20. package/dist/cdn/components/chunks/chunk-JAGZL7JH.js +1 -0
  21. package/dist/cdn/components/chunks/{chunk-VYFR364B.js → chunk-LD35BFNK.js} +18 -17
  22. package/dist/cdn/components/chunks/{chunk-XDPRWUKN.js → chunk-MQQJ6DID.js} +1 -1
  23. package/dist/cdn/components/chunks/chunk-P6LGU3FT.js +1 -0
  24. package/dist/cdn/components/chunks/chunk-QL5GSW2A.js +1 -0
  25. package/dist/cdn/components/chunks/{chunk-UYZR4JXZ.js → chunk-QSZO4GIH.js} +45 -9
  26. package/dist/cdn/components/chunks/{chunk-7KKWYPHY.js → chunk-QXQ25SQS.js} +21 -19
  27. package/dist/cdn/components/chunks/{chunk-SZYEBMG6.js → chunk-QYB6Z6FG.js} +5 -5
  28. package/dist/cdn/components/chunks/{chunk-RIFF2D2F.js → chunk-RGC3I6MK.js} +1 -1
  29. package/dist/cdn/components/chunks/{chunk-L2ADCEN7.js → chunk-SVGWCKWT.js} +1 -1
  30. package/dist/cdn/components/chunks/{chunk-N6ZW5CDN.js → chunk-TCSB2MLU.js} +1 -1
  31. package/dist/cdn/components/chunks/{chunk-MQQ4BGVJ.js → chunk-TFTRCIIK.js} +7 -6
  32. package/dist/cdn/components/chunks/chunk-TLBXTBMM.js +46 -0
  33. package/dist/cdn/components/chunks/chunk-UVHVQRPT.js +1 -0
  34. package/dist/cdn/components/chunks/chunk-WIUERJII.js +1 -0
  35. package/dist/cdn/components/chunks/chunk-WW4BTWMH.js +1 -0
  36. package/dist/cdn/components/eun-alert.js +13 -6
  37. package/dist/cdn/components/eun-animate.js +6 -6
  38. package/dist/cdn/components/eun-badge.js +1 -1
  39. package/dist/cdn/components/eun-button.js +1 -1
  40. package/dist/cdn/components/eun-calendar.js +2 -2
  41. package/dist/cdn/components/eun-card.js +4 -4
  42. package/dist/cdn/components/eun-carousel.js +26 -22
  43. package/dist/cdn/components/eun-check-card.js +1 -1
  44. package/dist/cdn/components/eun-checkbox-list.js +11 -8
  45. package/dist/cdn/components/eun-checkbox.js +1 -1
  46. package/dist/cdn/components/eun-chip.js +17 -11
  47. package/dist/cdn/components/eun-collapse.js +1 -1
  48. package/dist/cdn/components/eun-color-picker.js +74 -69
  49. package/dist/cdn/components/eun-counter.js +16 -14
  50. package/dist/cdn/components/eun-date-picker.js +67 -63
  51. package/dist/cdn/components/eun-description-list.js +2 -2
  52. package/dist/cdn/components/eun-divider.js +3 -3
  53. package/dist/cdn/components/eun-drawer.js +21 -22
  54. package/dist/cdn/components/eun-dropdown-button.js +1 -1
  55. package/dist/cdn/components/eun-dropdown-item.js +3 -3
  56. package/dist/cdn/components/eun-fab.js +2 -2
  57. package/dist/cdn/components/eun-icon.js +1 -1
  58. package/dist/cdn/components/eun-image-card.js +1 -1
  59. package/dist/cdn/components/eun-image-carousel.js +10 -10
  60. package/dist/cdn/components/eun-infinite-list.js +1 -1
  61. package/dist/cdn/components/eun-input-file.js +21 -21
  62. package/dist/cdn/components/eun-input-phone.js +16 -12
  63. package/dist/cdn/components/eun-input.js +1 -1
  64. package/dist/cdn/components/eun-link.js +59 -13
  65. package/dist/cdn/components/eun-loader.js +1 -1
  66. package/dist/cdn/components/eun-modal.js +33 -23
  67. package/dist/cdn/components/eun-pagination.js +16 -16
  68. package/dist/cdn/components/eun-password-strength.js +14 -10
  69. package/dist/cdn/components/eun-radio-card.js +1 -1
  70. package/dist/cdn/components/eun-radio-list.js +11 -8
  71. package/dist/cdn/components/eun-radio.js +1 -1
  72. package/dist/cdn/components/eun-rating.js +276 -0
  73. package/dist/cdn/components/eun-scheduler-event-editor.js +11 -11
  74. package/dist/cdn/components/eun-scheduler-event.js +1 -1
  75. package/dist/cdn/components/eun-scheduler.js +28 -28
  76. package/dist/cdn/components/eun-search.js +36 -32
  77. package/dist/cdn/components/eun-select.js +27 -27
  78. package/dist/cdn/components/eun-sidebar.js +73 -26
  79. package/dist/cdn/components/eun-skeleton.js +1 -1
  80. package/dist/cdn/components/eun-slider.js +3 -3
  81. package/dist/cdn/components/eun-sliding-card.js +1 -1
  82. package/dist/cdn/components/eun-step.js +5 -4
  83. package/dist/cdn/components/eun-stepper.js +30 -30
  84. package/dist/cdn/components/eun-switch.js +1 -1
  85. package/dist/cdn/components/eun-tab-group.js +4 -4
  86. package/dist/cdn/components/eun-tab-panel.js +1 -1
  87. package/dist/cdn/components/eun-tab.js +1 -1
  88. package/dist/cdn/components/eun-table-action-bar.js +1 -1
  89. package/dist/cdn/components/eun-table.js +2 -2
  90. package/dist/cdn/components/eun-tag.js +3 -3
  91. package/dist/cdn/components/eun-textarea.js +36 -28
  92. package/dist/cdn/components/eun-time-picker.js +31 -28
  93. package/dist/cdn/components/eun-toast.js +24 -15
  94. package/dist/cdn/components/eun-toggle-group.js +75 -37
  95. package/dist/cdn/components/eun-toggle-item.js +9 -9
  96. package/dist/cdn/components/eun-toggle.js +2 -2
  97. package/dist/cdn/components/eun-toolbar.js +22 -22
  98. package/dist/cdn/components/eun-tooltip.js +6 -6
  99. package/dist/cdn/styles/eunomia-themes.css +1 -1
  100. package/dist/cdn/styles/themes/mixins/eunomia-neutrals.mixin.scss +6 -2
  101. package/dist/cdn/styles/themes/prebuilt-themes/eunomia/eunomia-dark.mixin.scss +6 -2
  102. package/dist/cdn/styles/themes/prebuilt-themes/eunomia/eunomia.theme.css +1 -1
  103. package/dist/cdn/styles/themes/prebuilt-themes/fire/eunomia-fire-dark.mixin.scss +6 -2
  104. package/dist/cdn/styles/themes/prebuilt-themes/fire/eunomia-fire.theme.css +1 -1
  105. package/dist/cdn/styles/themes/prebuilt-themes/forest/eunomia-forest-dark.mixin.scss +6 -2
  106. package/dist/cdn/styles/themes/prebuilt-themes/forest/eunomia-forest.theme.css +1 -1
  107. package/dist/cdn/styles/themes/prebuilt-themes/gold/eunomia-gold-dark.mixin.scss +6 -2
  108. package/dist/cdn/styles/themes/prebuilt-themes/gold/eunomia-gold.theme.css +1 -1
  109. package/dist/cdn/styles/themes/prebuilt-themes/ocean/eunomia-ocean-dark.mixin.scss +6 -2
  110. package/dist/cdn/styles/themes/prebuilt-themes/ocean/eunomia-ocean.theme.css +1 -1
  111. package/dist/cdn/styles/themes/prebuilt-themes/salmon/eunomia-salmon-dark.mixin.scss +6 -2
  112. package/dist/cdn/styles/themes/prebuilt-themes/salmon/eunomia-salmon.theme.css +1 -1
  113. package/dist/cdn/styles/themes/prebuilt-themes/violet/eunomia-violet-dark.mixin.scss +6 -2
  114. package/dist/cdn/styles/themes/prebuilt-themes/violet/eunomia-violet.theme.css +1 -1
  115. package/dist/components/action/button/button.d.ts +4 -3
  116. package/dist/components/action/button/button.js +6 -9
  117. package/dist/components/action/button/button.styles.js +13 -8
  118. package/dist/components/action/dropdown-button/dropdown-button.d.ts +4 -6
  119. package/dist/components/action/dropdown-button/dropdown-button.js +16 -13
  120. package/dist/components/action/dropdown-button/dropdown-item.d.ts +10 -2
  121. package/dist/components/action/dropdown-button/dropdown-item.js +24 -9
  122. package/dist/components/action/link/link.d.ts +10 -1
  123. package/dist/components/action/link/link.js +13 -1
  124. package/dist/components/action/link/link.styles.js +50 -3
  125. package/dist/components/action/toggle/toggle-group.d.ts +12 -2
  126. package/dist/components/action/toggle/toggle-group.js +18 -3
  127. package/dist/components/action/toggle/toggle-group.styles.js +58 -20
  128. package/dist/components/action/toggle/toggle-item.js +1 -3
  129. package/dist/components/action/toggle/toggle-item.styles.js +7 -7
  130. package/dist/components/action/toggle/toggle.js +1 -1
  131. package/dist/components/alert/alert/alert.d.ts +9 -7
  132. package/dist/components/alert/alert/alert.js +11 -14
  133. package/dist/components/alert/alert/alert.styles.js +9 -2
  134. package/dist/components/alert/drawer/drawer.d.ts +30 -5
  135. package/dist/components/alert/drawer/drawer.js +48 -13
  136. package/dist/components/alert/drawer/drawer.styles.js +7 -7
  137. package/dist/components/alert/modal/modal.d.ts +35 -10
  138. package/dist/components/alert/modal/modal.js +55 -28
  139. package/dist/components/alert/modal/modal.styles.js +17 -6
  140. package/dist/components/alert/toast/toast.d.ts +7 -5
  141. package/dist/components/alert/toast/toast.js +12 -15
  142. package/dist/components/alert/toast/toast.styles.js +18 -9
  143. package/dist/components/content/badge/badge.js +2 -2
  144. package/dist/components/content/card/card.js +1 -1
  145. package/dist/components/content/card/card.styles.js +2 -2
  146. package/dist/components/content/chip/chip.d.ts +4 -4
  147. package/dist/components/content/chip/chip.js +11 -10
  148. package/dist/components/content/chip/chip.styles.js +9 -3
  149. package/dist/components/content/description-list/description-list.js +3 -3
  150. package/dist/components/content/icon/icon.d.ts +3 -0
  151. package/dist/components/content/icon/icon.js +3 -0
  152. package/dist/components/content/icon/icon.style.d.ts +2 -0
  153. package/dist/components/content/icon/icon.style.js +4 -0
  154. package/dist/components/content/image-carousel/image-carousel.d.ts +12 -12
  155. package/dist/components/content/image-carousel/image-carousel.js +29 -28
  156. package/dist/components/content/password-strength/password-strength.d.ts +21 -6
  157. package/dist/components/content/password-strength/password-strength.js +37 -16
  158. package/dist/components/content/password-strength/password-strength.styles.js +4 -0
  159. package/dist/components/content/tag/tag.js +2 -2
  160. package/dist/components/content/tooltip/tooltip.d.ts +16 -9
  161. package/dist/components/content/tooltip/tooltip.js +31 -15
  162. package/dist/components/content/tooltip/tooltip.styles.js +1 -1
  163. package/dist/components/form/checkbox/check-card.d.ts +1 -0
  164. package/dist/components/form/checkbox/check-card.js +1 -0
  165. package/dist/components/form/checkbox/checkbox-list.d.ts +17 -0
  166. package/dist/components/form/checkbox/checkbox-list.js +39 -10
  167. package/dist/components/form/checkbox/checkbox.d.ts +1 -0
  168. package/dist/components/form/checkbox/checkbox.js +3 -1
  169. package/dist/components/form/checkbox/checkbox.styles.js +3 -2
  170. package/dist/components/form/color-picker/color-picker.d.ts +47 -28
  171. package/dist/components/form/color-picker/color-picker.js +73 -51
  172. package/dist/components/form/color-picker/color-picker.styles.js +14 -1
  173. package/dist/components/form/counter/counter.d.ts +24 -18
  174. package/dist/components/form/counter/counter.js +61 -61
  175. package/dist/components/form/counter/counter.styles.js +6 -4
  176. package/dist/components/form/date-picker/date-picker.d.ts +33 -7
  177. package/dist/components/form/date-picker/date-picker.js +82 -56
  178. package/dist/components/form/date-picker/date-picker.styles.js +9 -6
  179. package/dist/components/form/input/input.d.ts +43 -39
  180. package/dist/components/form/input/input.js +91 -110
  181. package/dist/components/form/input-file/input-file.d.ts +26 -13
  182. package/dist/components/form/input-file/input-file.js +35 -35
  183. package/dist/components/form/input-file/input-file.styles.js +4 -4
  184. package/dist/components/form/input-phone/input-phone.d.ts +28 -5
  185. package/dist/components/form/input-phone/input-phone.js +47 -13
  186. package/dist/components/form/input-phone/input-phone.styles.js +6 -3
  187. package/dist/components/form/radio/radio-card.d.ts +1 -0
  188. package/dist/components/form/radio/radio-card.js +1 -0
  189. package/dist/components/form/radio/radio-list.d.ts +23 -7
  190. package/dist/components/form/radio/radio-list.js +47 -22
  191. package/dist/components/form/radio/radio.d.ts +1 -0
  192. package/dist/components/form/radio/radio.js +1 -0
  193. package/dist/components/form/rating/rating.d.ts +349 -0
  194. package/dist/components/form/rating/rating.js +665 -0
  195. package/dist/components/form/rating/rating.styles.d.ts +1 -0
  196. package/dist/components/form/rating/rating.styles.js +213 -0
  197. package/dist/components/form/search/search.d.ts +72 -18
  198. package/dist/components/form/search/search.js +135 -72
  199. package/dist/components/form/search/search.styles.js +2 -0
  200. package/dist/components/form/select/select.d.ts +29 -10
  201. package/dist/components/form/select/select.js +65 -41
  202. package/dist/components/form/shared-styles/field.styles.js +45 -8
  203. package/dist/components/form/shared-styles/listbox.styles.js +15 -1
  204. package/dist/components/form/slider/slider.d.ts +7 -8
  205. package/dist/components/form/slider/slider.js +9 -12
  206. package/dist/components/form/switch/switch.d.ts +1 -0
  207. package/dist/components/form/switch/switch.js +1 -0
  208. package/dist/components/form/textarea/textarea.d.ts +90 -23
  209. package/dist/components/form/textarea/textarea.js +194 -44
  210. package/dist/components/form/textarea/textarea.styles.js +3 -0
  211. package/dist/components/form/time-picker/time-picker-columns.d.ts +2 -2
  212. package/dist/components/form/time-picker/time-picker-columns.js +8 -8
  213. package/dist/components/form/time-picker/time-picker.d.ts +30 -9
  214. package/dist/components/form/time-picker/time-picker.js +66 -40
  215. package/dist/components/form/time-picker/time-picker.styles.js +7 -5
  216. package/dist/components/layout/animate/animate.js +3 -2
  217. package/dist/components/layout/animate/animate.styles.js +2 -2
  218. package/dist/components/layout/divider/divider.js +1 -1
  219. package/dist/components/layout/divider/divider.styles.js +1 -1
  220. package/dist/components/loader/loader/loader.js +2 -2
  221. package/dist/components/loader/loader/loader.styles.js +14 -12
  222. package/dist/components/loader/skeleton/skeleton.js +1 -1
  223. package/dist/components/navigation/carousel/carousel.d.ts +32 -9
  224. package/dist/components/navigation/carousel/carousel.js +88 -41
  225. package/dist/components/navigation/carousel/carousel.styles.js +10 -6
  226. package/dist/components/navigation/pagination/pagination.d.ts +23 -21
  227. package/dist/components/navigation/pagination/pagination.js +30 -53
  228. package/dist/components/navigation/sidebar/sidebar.d.ts +113 -65
  229. package/dist/components/navigation/sidebar/sidebar.js +161 -118
  230. package/dist/components/navigation/sidebar/sidebar.styles.d.ts +1 -1
  231. package/dist/components/navigation/sidebar/sidebar.styles.js +74 -24
  232. package/dist/components/navigation/stepper/step.js +9 -8
  233. package/dist/components/navigation/stepper/stepper.d.ts +1 -3
  234. package/dist/components/navigation/stepper/stepper.js +15 -26
  235. package/dist/components/navigation/tabs/tab-group/tab-group.js +2 -2
  236. package/dist/components/navigation/tabs/tab-group/tab-group.styles.js +2 -2
  237. package/dist/components/navigation/toolbar/toolbar.d.ts +23 -13
  238. package/dist/components/navigation/toolbar/toolbar.js +28 -35
  239. package/dist/components/navigation/toolbar/toolbar.styles.js +18 -17
  240. package/dist/events/select.event.d.ts +3 -2
  241. package/dist/events/select.event.js +2 -1
  242. package/dist/features/scheduler/calendar/calendar.js +1 -1
  243. package/dist/features/scheduler/scheduler/scheduler.d.ts +7 -7
  244. package/dist/features/scheduler/scheduler/scheduler.js +15 -24
  245. package/dist/features/scheduler/scheduler-event/scheduler-event.js +3 -3
  246. package/dist/features/scheduler/scheduler-event/scheduler-event.styles.js +1 -1
  247. package/dist/features/scheduler/scheduler-event-editor/scheduler-event-editor.d.ts +6 -4
  248. package/dist/features/scheduler/scheduler-event-editor/scheduler-event-editor.js +7 -8
  249. package/dist/features/table/table/table.js +1 -1
  250. package/dist/features/table/table-action-bar/table-action-bar.js +2 -2
  251. package/dist/i18n/en.d.ts +68 -0
  252. package/dist/i18n/en.js +68 -0
  253. package/dist/i18n/fr.js +68 -2
  254. package/dist/index.d.ts +3 -0
  255. package/dist/index.js +1 -0
  256. package/dist/mixins/button.mixin.d.ts +1 -1
  257. package/dist/mixins/button.mixin.js +9 -6
  258. package/dist/mixins/check.mixin.js +11 -10
  259. package/dist/mixins/dialog-surface.mixin.d.ts +8 -0
  260. package/dist/mixins/disabled.mixin.d.ts +5 -0
  261. package/dist/mixins/disabled.mixin.js +21 -1
  262. package/dist/mixins/editable.mixin.js +28 -5
  263. package/dist/mixins/field-appearance.mixin.js +3 -2
  264. package/dist/mixins/field-size.mixin.d.ts +19 -0
  265. package/dist/mixins/field-size.mixin.js +33 -0
  266. package/dist/mixins/form.mixin.d.ts +4 -0
  267. package/dist/mixins/form.mixin.js +87 -13
  268. package/dist/mixins/localizable.mixin.d.ts +1 -1
  269. package/dist/mixins/localizable.mixin.js +1 -1
  270. package/dist/mixins/radio.mixin.js +11 -10
  271. package/dist/mixins/readonly.mixin.d.ts +2 -1
  272. package/dist/mixins/readonly.mixin.js +10 -3
  273. package/dist/mixins/rounded.mixin.d.ts +18 -0
  274. package/dist/mixins/rounded.mixin.js +32 -0
  275. package/dist/ssr/alert-ssr.css +187 -0
  276. package/dist/ssr/badge-ssr.css +67 -0
  277. package/dist/ssr/breadcrumb-ssr.css +41 -0
  278. package/dist/ssr/button-ssr.css +5 -5
  279. package/dist/ssr/card-ssr.css +27 -15
  280. package/dist/ssr/carousel-ssr.css +247 -0
  281. package/dist/ssr/checkbox-ssr.css +67 -0
  282. package/dist/ssr/chip-ssr.css +250 -0
  283. package/dist/ssr/collapse-ssr.css +180 -0
  284. package/dist/ssr/field-ssr.css +202 -0
  285. package/dist/ssr/icon-ssr.css +266 -0
  286. package/dist/ssr/image-carousel-ssr.css +34 -0
  287. package/dist/ssr/links-ssr.css +44 -1
  288. package/dist/ssr/pagination-ssr.css +4 -0
  289. package/dist/ssr/rating-ssr.css +254 -0
  290. package/dist/ssr/sidebar-ssr.css +102 -3
  291. package/dist/ssr/skeleton-ssr.css +63 -0
  292. package/dist/ssr/tabs-ssr.css +129 -0
  293. package/dist/ssr/toggle-group-ssr.css +233 -0
  294. package/dist/ssr/toolbar-ssr.css +81 -2
  295. package/dist/types/variant.type.d.ts +4 -1
  296. package/dist/utils/boolean.utils.d.ts +14 -0
  297. package/dist/utils/boolean.utils.js +20 -0
  298. package/dist/utils/dropdown-menu.utils.d.ts +1 -1
  299. package/dist/utils/focusable-elements.utils.d.ts +12 -0
  300. package/dist/utils/focusable-elements.utils.js +26 -0
  301. package/dist/utils/implicit-submission.utils.d.ts +18 -0
  302. package/dist/utils/implicit-submission.utils.js +79 -0
  303. package/dist/utils/input-modality.utils.d.ts +13 -0
  304. package/dist/utils/input-modality.utils.js +34 -0
  305. package/dist/utils/listbox-options.utils.d.ts +11 -0
  306. package/dist/utils/listbox-options.utils.js +41 -3
  307. package/dist/utils/theme-generator.utils.d.ts +8 -2
  308. package/dist/utils/theme-generator.utils.js +30 -9
  309. package/package.json +26 -7
  310. package/styles/themes/mixins/eunomia-neutrals.mixin.scss +6 -2
  311. package/styles/themes/prebuilt-themes/eunomia/eunomia-dark.mixin.scss +6 -2
  312. package/styles/themes/prebuilt-themes/fire/eunomia-fire-dark.mixin.scss +6 -2
  313. package/styles/themes/prebuilt-themes/forest/eunomia-forest-dark.mixin.scss +6 -2
  314. package/styles/themes/prebuilt-themes/gold/eunomia-gold-dark.mixin.scss +6 -2
  315. package/styles/themes/prebuilt-themes/ocean/eunomia-ocean-dark.mixin.scss +6 -2
  316. package/styles/themes/prebuilt-themes/salmon/eunomia-salmon-dark.mixin.scss +6 -2
  317. package/styles/themes/prebuilt-themes/violet/eunomia-violet-dark.mixin.scss +6 -2
  318. package/dist/cdn/components/chunks/chunk-4PI6RDUS.js +0 -1
  319. package/dist/cdn/components/chunks/chunk-6VK6SHCG.js +0 -1
  320. package/dist/cdn/components/chunks/chunk-A3X4KD2X.js +0 -1
  321. package/dist/cdn/components/chunks/chunk-BQFJR2UP.js +0 -110
  322. package/dist/cdn/components/chunks/chunk-G5SBDQQ3.js +0 -1
  323. package/dist/cdn/components/chunks/chunk-KSZRQRN4.js +0 -1
  324. package/dist/cdn/components/chunks/chunk-PE4DAXHQ.js +0 -3
  325. package/dist/cdn/components/chunks/chunk-RS7TWEMQ.js +0 -1
  326. package/dist/cdn/components/chunks/chunk-UDOZRIJZ.js +0 -1
  327. package/dist/cdn/components/chunks/chunk-VOTRXBDS.js +0 -38
@@ -1,4 +1,7 @@
1
- import{a as q}from"./chunks/chunk-G5SBDQQ3.js";import{a as X}from"./chunks/chunk-L74LXUGL.js";import{a as W}from"./chunks/chunk-UYZR4JXZ.js";import{a as U}from"./chunks/chunk-4PI6RDUS.js";import{a as G}from"./chunks/chunk-BO3JOEWM.js";import{a as S,c as z,d as j,e as K,f as C}from"./chunks/chunk-VOTRXBDS.js";import{a as F}from"./chunks/chunk-YYCEPZUN.js";import{a as N,b as y,c as w,d as A,e as V,f as R,g as O}from"./chunks/chunk-GDBPWZN6.js";import{a as B}from"./chunks/chunk-RS7TWEMQ.js";import{a as v}from"./chunks/chunk-PPCHQG7P.js";import{a as P}from"./chunks/chunk-O7PHBLH2.js";import"./chunks/chunk-SGM2X2TC.js";import"./chunks/chunk-KSZRQRN4.js";import{a as c,f as I,h as D,j as u,k as E,l as k,p as f,r as b,u as _}from"./chunks/chunk-YITWLCD3.js";var ae=D`
1
+ import{a as U}from"./chunks/chunk-UVHVQRPT.js";import{a as Y}from"./chunks/chunk-L74LXUGL.js";import{a as X}from"./chunks/chunk-QSZO4GIH.js";import{a as W}from"./chunks/chunk-GVS6IUKC.js";import{a as q}from"./chunks/chunk-BO3JOEWM.js";import{a as S,c as K,d as j,e as G,f as C}from"./chunks/chunk-TLBXTBMM.js";import{a as H}from"./chunks/chunk-YYCEPZUN.js";import{a as $,b as y,c as N,d as A,e as O,f as R,g as B}from"./chunks/chunk-GDBPWZN6.js";import{a as z}from"./chunks/chunk-3BMACIDO.js";import{a as v}from"./chunks/chunk-PPCHQG7P.js";import{a as P}from"./chunks/chunk-O7PHBLH2.js";import"./chunks/chunk-SGM2X2TC.js";import{a as V}from"./chunks/chunk-62RLISRD.js";import"./chunks/chunk-QL5GSW2A.js";import{a as c,f as I,h as D,j as u,k as E,l as w,p as g,r as b,u as _}from"./chunks/chunk-YITWLCD3.js";var ae=D`
2
+ :host {
3
+ --_defaultLineHeight: normal;
4
+ }
2
5
  #field {
3
6
  resize: vertical;
4
7
  min-height: 6rem;
@@ -153,15 +156,18 @@ import{a as q}from"./chunks/chunk-G5SBDQQ3.js";import{a as X}from"./chunks/chunk
153
156
  #char-count[data-exceeded] {
154
157
  color: var(--_errorColor);
155
158
  }
156
- `,Y=[W,ae];var re="eun-textarea",H={bold:"STRONG",italic:"EM",underline:"U"},T={bold:()=>document.createElement("strong"),italic:()=>document.createElement("em"),underline:()=>document.createElement("u")},se={b:"bold",i:"italic",u:"underline"};function ce(n){return!(n.ctrlKey||n.metaKey)||n.altKey?null:se[n.key.toLowerCase()]??null}function J(n,l){let e=l;for(;e&&e.parentNode!==n;)e=e.parentNode;return e}function m(n){let l=n.getRootNode();return l instanceof ShadowRoot&&typeof l.getSelection=="function"?l.getSelection():window.getSelection()}function $(n){let l=m(n);if(!l||!l.rangeCount)return null;let e=l.getRangeAt(0);return e.collapsed||!n.contains(e.commonAncestorContainer)?null:e}function ne(n,l){let e=document.createRange();e.selectNodeContents(l),n.removeAllRanges(),n.addRange(e)}function Q(n){let l=m(n);if(!l||!l.rangeCount)return null;let e=l.getRangeAt(0);return!e.collapsed||!n.contains(e.commonAncestorContainer)?null:e}function de(n){return!n.bold&&!n.italic&&!n.underline&&!n.color&&!n.highlight}var x="\u200B";function ue(n){let l=[];if(n.bold&&l.push(T.bold()),n.italic&&l.push(T.italic()),n.underline&&l.push(T.underline()),n.color){let e=y(n.color),t=document.createElement("span");t.setAttribute("data-color",n.color),t.style.color=e?.text??"inherit",l.push(t)}if(n.highlight){let e=y(n.highlight),t=document.createElement("span");t.setAttribute("data-highlight",n.highlight),t.style.backgroundColor=e?.highlight??"transparent",l.push(t)}if(!l.length)return null;for(let e=0;e<l.length-1;e+=1)l[e].appendChild(l[e+1]);return l[l.length-1].appendChild(document.createTextNode(x)),l[0]}function he(n,l){let e=l;for(;e.parentNode&&e.parentNode!==n&&e.parentNode.childNodes.length===1;)e=e.parentNode;return e}function Z(n,l){let e=he(n,l),t=e.parentNode,i=Array.from(t.childNodes).indexOf(e);t.removeChild(e);let o=document.createRange();return o.setStart(t,i),o.collapse(!0),o}function ee(n,l,e,t){let i=l,o=e;for(;;){let a=i.parentNode;if(!a||a===n)break;let r=i.nodeType===Node.TEXT_NODE?i.textContent?.length??0:i.childNodes.length;if(!(t?o===0:o===r))break;let h=Array.from(a.childNodes).indexOf(i);i=a,o=t?h:h+1}return{container:i,offset:o}}function le(n,l){let e=ee(n,l.startContainer,l.startOffset,!0),t=ee(n,l.endContainer,l.endOffset,!1);l.setStart(e.container,e.offset),l.setEnd(t.container,t.offset)}function oe(n,l){n.querySelectorAll("*").forEach(e=>{if(!l(e))return;let t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}})}function pe(n,l,e){let t=m(n),i=$(n);if(!t||!i)return!1;le(n,i);let o=H[l],a=i.extractContents();oe(a,d=>d.tagName===o);let r=a;if(e){let d=T[l]();d.appendChild(a),r=d}return i.insertNode(r),ne(t,r),!0}function fe(n,l,e){let t=m(n),i=$(n);if(!t||!i)return!1;le(n,i);let o=l==="color"?"color":"highlight",a=i.extractContents();oe(a,d=>d.tagName==="SPAN"&&d.hasAttribute(`data-${o}`));let r=a;if(e){let d=y(e),h=document.createElement("span");h.setAttribute(`data-${o}`,e),h.style.cssText=l==="color"?`color: ${d?.text??"inherit"}`:`background-color: ${d?.highlight??"transparent"}`,h.appendChild(a),r=h}return i.insertNode(r),ne(t,r),!0}function te(n){let l=m(n);if(!l||!l.anchorNode||!n.contains(l.anchorNode))return[];let e=new Set,t=l.anchorNode;for(;t&&t!==n;){if(t instanceof HTMLElement){let i=Object.entries(H).find(([,o])=>o===t.tagName)?.[0];i&&e.add(i)}t=t.parentNode}return Array.from(e)}function ie(n,l){let e=m(n);if(!e||!e.anchorNode||!n.contains(e.anchorNode))return null;let t=e.anchorNode;for(;t&&t!==n;){if(t instanceof HTMLElement){let i=l==="color"?t.getAttribute("data-color"):t.getAttribute("data-highlight");if(i)return i}t=t.parentNode}return null}var ge=B(K(_)),me=U(G(j(q(z(ge))))),s=class extends me{constructor(){super(...arguments);this.formatting=!1;this.formatToolbarLabel="Text formatting";this.formatBoldLabel="Bold";this.formatItalicLabel="Italic";this.formatUnderlineLabel="Underline";this.formatAlignLabel="Text alignment";this.formatAlignStartLabel="Align left";this.formatAlignCenterLabel="Center";this.formatAlignEndLabel="Align right";this.formatAlignJustifyLabel="Justify";this.formatTextColorLabel="Text color";this.formatHighlightLabel="Highlight";this.formatColorClearLabel="Default";this.colorLabels=Object.fromEntries(N.map(e=>[e.name,e.label]));this.autocomplete="off";this.emptyValueLabel="No value set";this.confirmLabel="Save";this.cancelLabel="Cancel";this.openPicker=null;this.activeTextColor=null;this.activeHighlight=null;this.previousActiveFormats=[];this.pendingMarks={bold:!1,italic:!1,underline:!1,color:null,highlight:null};this.pendingCaretNode=null;this.handleHostFocus=()=>{this.fieldEl?.focus()};this.checkLocalValidators=()=>this.formatting?this.checkEditableValidators():X(this.fieldEl,["valueMissing","tooShort","tooLong"]);this.handleEditableInput=()=>{let e=this.fieldEl;if(!(e instanceof HTMLDivElement))return;let t=O(e);this.lastSyncedValue=t,this.value=t,this.resizeEditableField(),this.dispatchEvent(new F(this.value)),this.syncToolbarToSelection()};this.handleEditableBeforeInput=e=>{if(this.maxlength===void 0)return;let t=this.fieldEl;if(!(t instanceof HTMLDivElement)||!e.inputType.startsWith("insert"))return;let i=m(t);!(i&&!i.isCollapsed)&&(t.textContent?.length??0)>=this.maxlength&&e.preventDefault()};this.handleEditablePaste=e=>{let t=this.fieldEl;if(!(t instanceof HTMLDivElement))return;e.preventDefault();let i=e.clipboardData?.getData("text/plain")??"";if(!i)return;let o=m(t);if(!o||!o.rangeCount)return;let a=o.getRangeAt(0);a.deleteContents();let r=i.split(`
157
- `);if(r.length===1){let d=document.createTextNode(r[0]);a.insertNode(d),a.setStartAfter(d),a.collapse(!0)}else{let d=J(t,a.startContainer),h=a.cloneRange();d&&h.setEndAfter(d.lastChild??d);let p=h.extractContents();a.insertNode(document.createTextNode(r[0]));let g=d;for(let M=1;M<r.length;M+=1){let L=document.createElement("p");L.textContent=r[M],g?.after(L),g=L}g?.appendChild(p),g&&a.selectNodeContents(g),a.collapse(!1)}o.removeAllRanges(),o.addRange(a),this.handleEditableInput()};this.handleEditableKeydown=e=>{let t=this.fieldEl;if(!(t instanceof HTMLDivElement))return;let i=ce(e);if(i){e.preventDefault();let g=te(t).includes(i);this.applyFormat(i,!g);return}if(e.key!=="Enter")return;e.preventDefault();let o=m(t);if(!o||!o.rangeCount)return;let a=o.getRangeAt(0);a.deleteContents();let r=J(t,a.startContainer);if(!r)return;r.hasChildNodes()||r.appendChild(document.createElement("br"));let d=a.cloneRange();d.setEndAfter(r.lastChild??r);let h=d.extractContents();r.hasChildNodes()||r.appendChild(document.createElement("br"));let p=document.createElement("p");p.appendChild(h),p.hasChildNodes()||p.appendChild(document.createElement("br")),r.after(p),a.selectNodeContents(p),a.collapse(!0),o.removeAllRanges(),o.addRange(a),this.handleEditableInput()};this.handleSelectionChange=()=>{this.cleanupAbandonedPendingMarker(),this.syncToolbarToSelection()};this.handleOutsideClick=e=>{e.composedPath().some(o=>o instanceof HTMLElement&&o.classList.contains("color-picker"))||this.closeColorPicker()}}get defaultValue(){return super.defaultValue}set defaultValue(e){super.defaultValue=e}connectedCallback(){super.connectedCallback?.(),this.addEventListener("focus",this.handleHostFocus)}disconnectedCallback(){this.removeEventListener("focus",this.handleHostFocus),document.removeEventListener("click",this.handleOutsideClick,{capture:!0}),super.disconnectedCallback?.()}firstUpdated(){this.formatting&&this.fieldEl instanceof HTMLDivElement?(R(this.fieldEl,this.value??""),this.lastSyncedValue=this.value,this.resizeEditableField()):this.resizeToContent()}updated(e){if(super.updated(e),e.has("editing")&&this.editing&&this.fieldEl?.focus(),!this.formatting){(e.has("value")||e.has("editing"))&&this.resizeToContent();return}(e.has("editing")&&this.editing||e.has("formatting")&&this.formatting||e.has("value")&&this.value!==this.lastSyncedValue)&&this.fieldEl instanceof HTMLDivElement&&this.fieldEl instanceof HTMLDivElement&&(R(this.fieldEl,this.value??""),this.lastSyncedValue=this.value),(e.has("value")||e.has("editing"))&&this.resizeEditableField()}checkEditableValidators(){let e=A(this.value??"");return this.minlength!==void 0&&e>0&&e<this.minlength?{validity:{tooShort:!0},message:this.validationDictionary.validation.tooShort(this.minlength,e)}:this.maxlength!==void 0&&e>this.maxlength?{validity:{tooLong:!0},message:this.validationDictionary.validation.tooLong(this.maxlength,e)}:{validity:{}}}getFocusAnchor(){return this.fieldEl??void 0}focus(){super.focus?.(),this.fieldEl?.focus()}resizeToContent(){let e=this.fieldEl;if(!e||this.rows!==void 0)return;e.style.height="";let t=e.clientHeight;e.style.height="0px";let i=e.scrollHeight;e.style.height=i>t?`${i}px`:""}resizeEditableField(){let e=this.fieldEl;if(!e||!(e instanceof HTMLDivElement))return;if(this.rows===void 0){e.style.height="",e.style.overflowY="";return}let t=parseFloat(getComputedStyle(e).lineHeight)||20;e.style.height=`${t*this.rows}px`,e.style.overflowY="auto"}handleInput(e){this.value=e.target.value,this.resizeToContent(),this.dispatchEvent(new F(this.value))}syncToolbarToSelection(){if(!(!this.formatting||!this.fieldEl)){if(this.toolbarEl){let e=te(this.fieldEl);this.previousActiveFormats=e,this.toolbarEl.value=e}this.activeTextColor=ie(this.fieldEl,"color"),this.activeHighlight=ie(this.fieldEl,"highlight")}}cleanupAbandonedPendingMarker(){let e=this.fieldEl,t=this.pendingCaretNode;if(!t||!(e instanceof HTMLDivElement))return;let i=m(e),o=i?.rangeCount?i.getRangeAt(0):null;o&&o.collapsed&&o.startContainer===t||(t.data===x?Z(e,t):t.data=t.data.replace(x,""),this.pendingCaretNode=null,this.pendingMarks={bold:!1,italic:!1,underline:!1,color:null,highlight:null})}updatePendingMarker(e,t){let i=t,o=this.pendingCaretNode,a=!!o&&t.startContainer===o;if(a&&o.data===x?(i=Z(e,o),this.pendingCaretNode=null):a&&(o.data=o.data.replace(x,""),this.pendingCaretNode=null),de(this.pendingMarks))return;let r=ue(this.pendingMarks);if(!r)return;i.insertNode(r);let h=document.createTreeWalker(r,NodeFilter.SHOW_TEXT).nextNode();if(!h)return;this.pendingCaretNode=h;let p=m(e);if(!p)return;let g=document.createRange();g.setStart(h,h.data.length),g.collapse(!0),p.removeAllRanges(),p.addRange(g)}applyFormat(e,t){let i=this.fieldEl;if(!(i instanceof HTMLDivElement))return;if($(i)){if(!pe(i,e,t))return;this.handleEditableInput(),this.updateComplete.then(()=>{i.focus(),this.syncToolbarToSelection()});return}let a=Q(i);a&&(this.pendingMarks={...this.pendingMarks,[e]:t},this.updatePendingMarker(i,a),i.focus(),this.syncToolbarToSelection())}handleToolbarChange(e){e.stopPropagation();let i=e.target.value;Object.keys(H).forEach(o=>{let a=this.previousActiveFormats.includes(o),r=i.includes(o);a!==r&&this.applyFormat(o,r)}),this.previousActiveFormats=i}handleAlignChange(e){e.stopPropagation();let t=this.fieldEl;if(!(t instanceof HTMLDivElement))return;let[i]=e.target.value;t.style.textAlign=i==="start"?"":i,this.handleEditableInput(),this.updateComplete.then(()=>t.focus())}toggleColorPicker(e){if(this.openPicker===e){this.closeColorPicker();return}this.openPicker=e,document.addEventListener("click",this.handleOutsideClick,{capture:!0})}closeColorPicker(){this.openPicker!==null&&(this.openPicker=null,document.removeEventListener("click",this.handleOutsideClick,{capture:!0}))}selectColor(e,t){let i=this.fieldEl;if(i instanceof HTMLDivElement)if($(i))fe(i,e,t)&&this.handleEditableInput();else{let a=Q(i);a&&(this.pendingMarks={...this.pendingMarks,[e]:t},this.updatePendingMarker(i,a),this.syncToolbarToSelection())}this.closeColorPicker(),this.updateComplete.then(()=>this.fieldEl?.focus())}renderToolbar(){let e=this.disabled||this.readonly,t=w(this.value??"").align;return f`
159
+ `,J=[X,ae];var se="eun-textarea",F={bold:"STRONG",italic:"EM",underline:"U"},T={bold:()=>document.createElement("strong"),italic:()=>document.createElement("em"),underline:()=>document.createElement("u")},ce={b:"bold",i:"italic",u:"underline"};function de(o){return!(o.ctrlKey||o.metaKey)||o.altKey?null:ce[o.key.toLowerCase()]??null}function Q(o,l){let e=l;for(;e&&e.parentNode!==o;)e=e.parentNode;return e}function m(o){let l=o.getRootNode();return l instanceof ShadowRoot&&typeof l.getSelection=="function"?l.getSelection():window.getSelection()}function k(o){let l=m(o);if(!l||!l.rangeCount)return null;let e=l.getRangeAt(0);return e.collapsed||!o.contains(e.commonAncestorContainer)?null:e}function oe(o,l){let e=document.createRange();e.selectNodeContents(l),o.removeAllRanges(),o.addRange(e)}function Z(o){let l=m(o);if(!l||!l.rangeCount)return null;let e=l.getRangeAt(0);return!e.collapsed||!o.contains(e.commonAncestorContainer)?null:e}function ue(o){return!o.bold&&!o.italic&&!o.underline&&!o.color&&!o.highlight}var x="\u200B";function he(o){let l=[];if(o.bold&&l.push(T.bold()),o.italic&&l.push(T.italic()),o.underline&&l.push(T.underline()),o.color){let e=y(o.color),t=document.createElement("span");t.setAttribute("data-color",o.color),t.style.color=e?.text??"inherit",l.push(t)}if(o.highlight){let e=y(o.highlight),t=document.createElement("span");t.setAttribute("data-highlight",o.highlight),t.style.backgroundColor=e?.highlight??"transparent",l.push(t)}if(!l.length)return null;for(let e=0;e<l.length-1;e+=1)l[e].appendChild(l[e+1]);return l[l.length-1].appendChild(document.createTextNode(x)),l[0]}function pe(o,l){let e=l;for(;e.parentNode&&e.parentNode!==o&&e.parentNode.childNodes.length===1;)e=e.parentNode;return e}function ee(o,l){let e=pe(o,l),t=e.parentNode,i=Array.from(t.childNodes).indexOf(e);t.removeChild(e);let n=document.createRange();return n.setStart(t,i),n.collapse(!0),n}function te(o,l,e,t){let i=l,n=e;for(;;){let r=i.parentNode;if(!r||r===o)break;let a=i.nodeType===Node.TEXT_NODE?i.textContent?.length??0:i.childNodes.length;if(!(t?n===0:n===a))break;let h=Array.from(r.childNodes).indexOf(i);i=r,n=t?h:h+1}return{container:i,offset:n}}function le(o,l){let e=te(o,l.startContainer,l.startOffset,!0),t=te(o,l.endContainer,l.endOffset,!1);l.setStart(e.container,e.offset),l.setEnd(t.container,t.offset)}function re(o,l){o.querySelectorAll("*").forEach(e=>{if(!l(e))return;let t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}})}function ge(o,l,e){let t=m(o),i=k(o);if(!t||!i)return!1;le(o,i);let n=F[l],r=i.extractContents();re(r,d=>d.tagName===n);let a=r;if(e){let d=T[l]();d.appendChild(r),a=d}return i.insertNode(a),oe(t,a),!0}function fe(o,l,e){let t=m(o),i=k(o);if(!t||!i)return!1;le(o,i);let n=l==="color"?"color":"highlight",r=i.extractContents();re(r,d=>d.tagName==="SPAN"&&d.hasAttribute(`data-${n}`));let a=r;if(e){let d=y(e),h=document.createElement("span");h.setAttribute(`data-${n}`,e),h.style.cssText=l==="color"?`color: ${d?.text??"inherit"}`:`background-color: ${d?.highlight??"transparent"}`,h.appendChild(r),a=h}return i.insertNode(a),oe(t,a),!0}function ie(o){let l=m(o);if(!l||!l.anchorNode||!o.contains(l.anchorNode))return[];let e=new Set,t=l.anchorNode;for(;t&&t!==o;){if(t instanceof HTMLElement){let i=Object.entries(F).find(([,n])=>n===t.tagName)?.[0];i&&e.add(i)}t=t.parentNode}return Array.from(e)}function ne(o,l){let e=m(o);if(!e||!e.anchorNode||!o.contains(e.anchorNode))return null;let t=e.anchorNode;for(;t&&t!==o;){if(t instanceof HTMLElement){let i=l==="color"?t.getAttribute("data-color"):t.getAttribute("data-highlight");if(i)return i}t=t.parentNode}return null}var me=z(G(_)),be=V(W(q(j(U(K(me)))))),s=class extends be{constructor(){super(...arguments);this.formatting=!1;this.formatToolbarLabel="Text formatting";this.formatBoldLabel="Bold";this.formatItalicLabel="Italic";this.formatUnderlineLabel="Underline";this.formatAlignLabel="Text alignment";this.formatAlignStartLabel="Align left";this.formatAlignCenterLabel="Center";this.formatAlignEndLabel="Align right";this.formatAlignJustifyLabel="Justify";this.formatTextColorLabel="Text color";this.formatHighlightLabel="Highlight";this.formatColorClearLabel="Default";this.colorLabels=Object.fromEntries($.map(e=>[e.name,e.label]));this.autocomplete="off";this.openPicker=null;this.activeTextColor=null;this.activeHighlight=null;this.previousActiveFormats=[];this.pendingMarks={bold:!1,italic:!1,underline:!1,color:null,highlight:null};this.pendingCaretNode=null;this.toolbarFocusIndex=0;this.checkLocalValidators=()=>this.formatting?this.checkEditableValidators():Y(this.fieldEl,["valueMissing","tooShort","tooLong"]);this.handleEditableInput=()=>{let e=this.fieldEl;if(!(e instanceof HTMLDivElement))return;let t=B(e);this.lastSyncedValue=t,this.value=t,this.resizeEditableField(),this.dispatchEvent(new H(this.value)),this.syncToolbarToSelection()};this.handleEditableBeforeInput=e=>{if(this.maxlength===void 0)return;let t=this.fieldEl;if(!(t instanceof HTMLDivElement)||!e.inputType.startsWith("insert"))return;let i=m(t);!(i&&!i.isCollapsed)&&(t.textContent?.length??0)>=this.maxlength&&e.preventDefault()};this.handleEditablePaste=e=>{let t=this.fieldEl;if(!(t instanceof HTMLDivElement))return;e.preventDefault();let i=e.clipboardData?.getData("text/plain")??"";if(!i)return;let n=m(t);if(!n||!n.rangeCount)return;let r=n.getRangeAt(0);r.deleteContents();let a=i.split(`
160
+ `);if(a.length===1){let d=document.createTextNode(a[0]);r.insertNode(d),r.setStartAfter(d),r.collapse(!0)}else{let d=Q(t,r.startContainer),h=r.cloneRange();d&&h.setEndAfter(d.lastChild??d);let p=h.extractContents();r.insertNode(document.createTextNode(a[0]));let f=d;for(let M=1;M<a.length;M+=1){let L=document.createElement("p");L.textContent=a[M],f?.after(L),f=L}f?.appendChild(p),f&&r.selectNodeContents(f),r.collapse(!1)}n.removeAllRanges(),n.addRange(r),this.handleEditableInput()};this.handleEditableKeydown=e=>{let t=this.fieldEl;if(!(t instanceof HTMLDivElement))return;let i=de(e);if(i){e.preventDefault();let f=ie(t).includes(i);this.applyFormat(i,!f);return}if(e.key!=="Enter")return;e.preventDefault();let n=m(t);if(!n||!n.rangeCount)return;let r=n.getRangeAt(0);r.deleteContents();let a=Q(t,r.startContainer);if(!a)return;a.hasChildNodes()||a.appendChild(document.createElement("br"));let d=r.cloneRange();d.setEndAfter(a.lastChild??a);let h=d.extractContents();a.hasChildNodes()||a.appendChild(document.createElement("br"));let p=document.createElement("p");p.appendChild(h),p.hasChildNodes()||p.appendChild(document.createElement("br")),a.after(p),r.selectNodeContents(p),r.collapse(!0),n.removeAllRanges(),n.addRange(r),this.handleEditableInput()};this.handleSelectionChange=()=>{this.cleanupAbandonedPendingMarker(),this.syncToolbarToSelection()};this.handleOutsideClick=e=>{e.composedPath().some(n=>n instanceof HTMLElement&&n.classList.contains("color-picker"))||this.closeColorPicker()};this.handleToolbarKeydown={handleEvent:e=>{let t=this.toolbarControls().filter(a=>!a.hasAttribute("disabled")),i=t.indexOf(e.target);if(i===-1)return;let n=t[i];if((e.key==="Enter"||e.key===" ")&&n.closest("#align-toolbar")){e.preventDefault(),e.stopPropagation(),n.click();return}let r;switch(e.key){case"ArrowRight":r=(i+1)%t.length;break;case"ArrowLeft":r=(i-1+t.length)%t.length;break;case"Home":r=0;break;case"End":r=t.length-1;break;default:return}e.preventDefault(),e.stopPropagation(),t[r].focus()},capture:!0}}get defaultValue(){return super.defaultValue}set defaultValue(e){super.defaultValue=e}disconnectedCallback(){document.removeEventListener("click",this.handleOutsideClick,{capture:!0}),clearTimeout(this.toolbarRovingTimer),super.disconnectedCallback?.()}firstUpdated(){this.formatting&&this.fieldEl instanceof HTMLDivElement?(R(this.fieldEl,this.value??""),this.lastSyncedValue=this.value,this.resizeEditableField()):this.resizeToContent()}updated(e){if(super.updated(e),e.has("editing")&&this.editing&&this.fieldEl?.focus(),!this.formatting){(e.has("value")||e.has("editing"))&&this.resizeToContent();return}this.scheduleToolbarRoving(),(e.has("editing")&&this.editing||e.has("formatting")&&this.formatting||e.has("value")&&this.value!==this.lastSyncedValue)&&this.fieldEl instanceof HTMLDivElement&&this.fieldEl instanceof HTMLDivElement&&(R(this.fieldEl,this.value??""),this.lastSyncedValue=this.value),(e.has("value")||e.has("editing"))&&this.resizeEditableField()}checkEditableValidators(){let e=A(this.value??"");return this.minlength!==void 0&&e>0&&e<this.minlength?{validity:{tooShort:!0},message:this.validationDictionary.validation.tooShort(this.minlength,e)}:this.maxlength!==void 0&&e>this.maxlength?{validity:{tooLong:!0},message:this.validationDictionary.validation.tooLong(this.maxlength,e)}:{validity:{}}}get hostTabStop(){return!1}getFocusAnchor(){return this.fieldEl??void 0}focus(){super.focus?.(),this.fieldEl?.focus()}resizeToContent(){let e=this.fieldEl;if(!e||this.rows!==void 0)return;e.style.height="";let t=e.clientHeight;e.style.height="0px";let i=e.scrollHeight;e.style.height=i>t?`${i}px`:""}resizeEditableField(){let e=this.fieldEl;if(!e||!(e instanceof HTMLDivElement))return;if(this.rows===void 0){e.style.height="",e.style.overflowY="";return}let t=parseFloat(getComputedStyle(e).lineHeight)||20;e.style.height=`${t*this.rows}px`,e.style.overflowY="auto"}handleInput(e){this.value=e.target.value,this.resizeToContent(),this.dispatchEvent(new H(this.value))}syncToolbarToSelection(){if(!(!this.formatting||!this.fieldEl)){if(this.toolbarEl){let e=ie(this.fieldEl);this.previousActiveFormats=e,this.toolbarEl.value=e}this.activeTextColor=ne(this.fieldEl,"color"),this.activeHighlight=ne(this.fieldEl,"highlight")}}cleanupAbandonedPendingMarker(){let e=this.fieldEl,t=this.pendingCaretNode;if(!t||!(e instanceof HTMLDivElement))return;let i=m(e),n=i?.rangeCount?i.getRangeAt(0):null;n&&n.collapsed&&n.startContainer===t||(t.data===x?ee(e,t):t.data=t.data.replace(x,""),this.pendingCaretNode=null,this.pendingMarks={bold:!1,italic:!1,underline:!1,color:null,highlight:null})}updatePendingMarker(e,t){let i=t,n=this.pendingCaretNode,r=!!n&&t.startContainer===n;if(r&&n.data===x?(i=ee(e,n),this.pendingCaretNode=null):r&&(n.data=n.data.replace(x,""),this.pendingCaretNode=null),ue(this.pendingMarks))return;let a=he(this.pendingMarks);if(!a)return;i.insertNode(a);let h=document.createTreeWalker(a,NodeFilter.SHOW_TEXT).nextNode();if(!h)return;this.pendingCaretNode=h;let p=m(e);if(!p)return;let f=document.createRange();f.setStart(h,h.data.length),f.collapse(!0),p.removeAllRanges(),p.addRange(f)}applyFormat(e,t){let i=this.fieldEl;if(!(i instanceof HTMLDivElement))return;if(k(i)){if(!ge(i,e,t))return;this.handleEditableInput(),this.updateComplete.then(()=>{i.focus(),this.syncToolbarToSelection()});return}let r=Z(i);r&&(this.pendingMarks={...this.pendingMarks,[e]:t},this.updatePendingMarker(i,r),i.focus(),this.syncToolbarToSelection())}handleToolbarChange(e){e.stopPropagation();let i=e.target.value;Object.keys(F).forEach(n=>{let r=this.previousActiveFormats.includes(n),a=i.includes(n);r!==a&&this.applyFormat(n,a)}),this.previousActiveFormats=i}handleAlignChange(e){e.stopPropagation();let t=this.fieldEl;if(!(t instanceof HTMLDivElement))return;let[i]=e.target.value;t.style.textAlign=i==="start"?"":i,this.handleEditableInput(),this.updateComplete.then(()=>t.focus())}toggleColorPicker(e){if(this.openPicker===e){this.closeColorPicker();return}this.openPicker=e,document.addEventListener("click",this.handleOutsideClick,{capture:!0}),this.updateComplete.then(()=>{let t=this.colorSwatches();(t.find(i=>i.ariaChecked==="true")??t[0])?.focus()})}colorSwatches(){return Array.from(this.shadowRoot?.querySelectorAll(".color-picker-panel .color-swatch")??[])}handleColorPickerKeydown(e){let i=e.currentTarget.previousElementSibling;if(e.key==="Escape"||e.key==="Tab"){e.key==="Escape"&&e.preventDefault(),this.closeColorPicker(),i?.focus();return}let n=this.colorSwatches(),r=n.indexOf(this.shadowRoot?.activeElement),a;switch(e.key){case"ArrowRight":case"ArrowDown":a=(r+1)%n.length;break;case"ArrowLeft":case"ArrowUp":a=(r-1+n.length)%n.length;break;case"Home":a=0;break;case"End":a=n.length-1;break;default:return}e.preventDefault(),n[a]?.focus()}closeColorPicker(){this.openPicker!==null&&(this.openPicker=null,document.removeEventListener("click",this.handleOutsideClick,{capture:!0}))}selectColor(e,t){let i=this.fieldEl;if(i instanceof HTMLDivElement)if(k(i))fe(i,e,t)&&this.handleEditableInput();else{let r=Z(i);r&&(this.pendingMarks={...this.pendingMarks,[e]:t},this.updatePendingMarker(i,r),this.syncToolbarToSelection())}this.closeColorPicker(),this.updateComplete.then(()=>this.fieldEl?.focus())}toolbarControls(){return Array.from(this.shadowRoot?.querySelectorAll("#toolbar-groups eun-toggle-item, #toolbar-groups .color-picker-trigger")??[])}scheduleToolbarRoving(){clearTimeout(this.toolbarRovingTimer),this.toolbarRovingTimer=setTimeout(()=>this.applyToolbarRoving())}applyToolbarRoving(){if(this.disabled||this.readonly)return;let e=this.toolbarControls(),t=Math.min(this.toolbarFocusIndex,e.length-1);e.forEach((i,n)=>{i.setAttribute("tabindex",n===t?"0":"-1")})}handleToolbarFocusIn(e){let t=this.toolbarControls().indexOf(e.target);t!==-1&&t!==this.toolbarFocusIndex&&(this.toolbarFocusIndex=t,this.applyToolbarRoving())}renderToolbar(){let e=this.disabled||this.readonly,t=N(this.value??"").align;return g`
158
161
  <div
159
162
  id="toolbar-groups"
163
+ role="toolbar"
164
+ aria-label=${this.formatToolbarLabel}
160
165
  @mousedown=${i=>i.preventDefault()}
166
+ @focusin=${this.handleToolbarFocusIn}
167
+ @keydown=${this.handleToolbarKeydown}
161
168
  >
162
169
  <eun-toggle-group
163
170
  id="toolbar"
164
- aria-label=${this.formatToolbarLabel}
165
171
  ?disabled=${e}
166
172
  @eunchange=${this.handleToolbarChange}
167
173
  >
@@ -213,41 +219,43 @@ import{a as q}from"./chunks/chunk-G5SBDQQ3.js";import{a as X}from"./chunks/chunk
213
219
  ${this.renderColorPicker("color",this.formatTextColorLabel,"format_color_text")}
214
220
  ${this.renderColorPicker("highlight",this.formatHighlightLabel,"format_color_fill")}
215
221
  </div>
216
- `}renderColorPicker(e,t,i){let o=this.disabled||this.readonly,a=this.openPicker===e,r=e==="color"?this.activeTextColor:this.activeHighlight,d=r?y(r):void 0,h=e==="color"?d?.text:d?.highlight;return f`
222
+ `}renderColorPicker(e,t,i){let n=this.disabled||this.readonly,r=this.openPicker===e,a=e==="color"?this.activeTextColor:this.activeHighlight,d=a?y(a):void 0,h=e==="color"?d?.text:d?.highlight;return g`
217
223
  <div class="color-picker">
218
224
  <button
219
225
  type="button"
220
226
  class="color-picker-trigger"
221
- aria-haspopup="true"
222
- aria-expanded=${a?"true":"false"}
227
+ aria-haspopup="menu"
228
+ aria-expanded=${r?"true":"false"}
223
229
  aria-label=${t}
224
- ?disabled=${o}
230
+ ?disabled=${n}
225
231
  style=${h?`--_border-indicator-color: ${h}`:""}
226
232
  @click=${()=>this.toggleColorPicker(e)}
227
233
  >
228
234
  <eun-icon name=${i} size="18"></eun-icon>
229
235
  </button>
230
- ${a?f`
236
+ ${r?g`
231
237
  <div
232
238
  class="color-picker-panel"
233
239
  role="menu"
234
240
  aria-label=${t}
235
- @keydown=${p=>p.key==="Escape"&&this.closeColorPicker()}
241
+ @keydown=${this.handleColorPickerKeydown}
236
242
  >
237
243
  <button
238
244
  type="button"
239
245
  class="color-swatch clear"
240
246
  role="menuitemradio"
241
- aria-checked=${r===null?"true":"false"}
247
+ tabindex="-1"
248
+ aria-checked=${a===null?"true":"false"}
242
249
  aria-label=${this.formatColorClearLabel}
243
250
  @click=${()=>this.selectColor(e,null)}
244
251
  ></button>
245
- ${N.map(p=>f`
252
+ ${$.map(p=>g`
246
253
  <button
247
254
  type="button"
248
255
  class="color-swatch"
249
256
  role="menuitemradio"
250
- aria-checked=${r===p.name?"true":"false"}
257
+ tabindex="-1"
258
+ aria-checked=${a===p.name?"true":"false"}
251
259
  aria-label=${this.colorLabels[p.name]??p.label}
252
260
  style="--_swatch-bg: ${e==="color"?p.text:p.highlight}"
253
261
  @click=${()=>this.selectColor(e,p.name)}
@@ -256,11 +264,11 @@ import{a as q}from"./chunks/chunk-G5SBDQQ3.js";import{a as X}from"./chunks/chunk
256
264
  </div>
257
265
  `:b}
258
266
  </div>
259
- `}renderCharCount(){let e=this.formatting?A(this.value??""):this.value?.length??0,t=this.maxlength!==void 0&&e>this.maxlength;return f`
267
+ `}renderCharCount(){let e=this.formatting?A(this.value??""):this.value?.length??0,t=this.maxlength!==void 0&&e>this.maxlength;return g`
260
268
  <span id="char-count" ?data-exceeded=${t}
261
269
  >${e}/${this.maxlength}</span
262
270
  >
263
- `}renderReadonlyDisplay(){let e=!!this.value?.trim().length,t=this.formatting?w(this.value??"").align:void 0;return f`
271
+ `}renderReadonlyDisplay(){let e=!!this.value?.trim().length,t=this.formatting?N(this.value??"").align:void 0;return g`
264
272
  <div
265
273
  id="readonly-display"
266
274
  role="button"
@@ -270,12 +278,12 @@ import{a as q}from"./chunks/chunk-G5SBDQQ3.js";import{a as X}from"./chunks/chunk
270
278
  @click=${this.startEdit}
271
279
  @keydown=${i=>(i.key==="Enter"||i.key===" ")&&this.startEdit()}
272
280
  >
273
- ${e&&this.formatting?V(this.value):f`<span
281
+ ${e&&this.formatting?O(this.value):g`<span
274
282
  class=${P({"plain-value":!0,empty:!e})}
275
- >${e?this.value:this.emptyValueLabel}</span
283
+ >${e?this.value:this.emptyValueLabel??this.dictionary.common.noValue}</span
276
284
  >`}
277
285
  </div>
278
- `}renderNativeField(e){return f`
286
+ `}renderNativeField(e){return g`
279
287
  <textarea
280
288
  id="field"
281
289
  rows=${v(this.rows)}
@@ -296,7 +304,7 @@ import{a as q}from"./chunks/chunk-G5SBDQQ3.js";import{a as X}from"./chunks/chunk
296
304
  @click=${this.handleSelectionChange}
297
305
  @focus=${this.handleSelectionChange}
298
306
  ></textarea>
299
- `}renderEditableField(e){let t=this.disabled||this.readonly;return f`
307
+ `}renderEditableField(e){let t=this.disabled||this.readonly;return g`
300
308
  <div
301
309
  id="field"
302
310
  contenteditable=${t?"false":"true"}
@@ -316,22 +324,22 @@ import{a as q}from"./chunks/chunk-G5SBDQQ3.js";import{a as X}from"./chunks/chunk
316
324
  @click=${this.handleSelectionChange}
317
325
  @focus=${this.handleSelectionChange}
318
326
  ></div>
319
- ${!this.value&&this.placeholder?f`<span id="editable-placeholder">${this.placeholder}</span>`:b}
320
- `}renderField(e){let t=[e?"description":null,this.maxlength!==void 0?"char-count":null].filter(i=>!!i).join(" ");return f`
327
+ ${!this.value&&this.placeholder?g`<span id="editable-placeholder">${this.placeholder}</span>`:b}
328
+ `}renderField(e){let t=[e?"description":null,this.maxlength!==void 0?"char-count":null].filter(i=>!!i).join(" ");return g`
321
329
  ${this.formatting?this.renderToolbar():b}
322
330
  <div id="field-wrapper">
323
331
  ${this.formatting?this.renderEditableField(t):this.renderNativeField(t)}
324
332
  </div>
325
- ${S(this.readonlyAvailable,()=>f`
333
+ ${S(this.readonlyAvailable,()=>g`
326
334
  <div id="edit-actions">
327
335
  <eun-button
328
336
  class="confirm"
329
337
  size="s"
330
- appearance="default"
338
+ appearance="soft"
331
339
  rounded
332
340
  type="button"
333
341
  @click=${this.confirmEdit}
334
- >${this.confirmLabel}</eun-button
342
+ >${this.confirmLabel??this.dictionary.common.save}</eun-button
335
343
  >
336
344
  <eun-button
337
345
  class="cancel"
@@ -341,18 +349,18 @@ import{a as q}from"./chunks/chunk-G5SBDQQ3.js";import{a as X}from"./chunks/chunk
341
349
  rounded
342
350
  type="button"
343
351
  @click=${this.cancelEdit}
344
- >${this.cancelLabel}</eun-button
352
+ >${this.cancelLabel??this.dictionary.common.cancel}</eun-button
345
353
  >
346
354
  </div>
347
355
  `)}
348
- `}render(){let e=this.readonlyAvailable&&!this.editing,t=this.renderDescription(),i=this.maxlength!==void 0&&!e;return f`
356
+ `}render(){let e=this.readonlyAvailable&&!this.editing,t=this.renderDescription(),i=this.maxlength!==void 0&&!e;return g`
349
357
  <div id="wrapper">
350
358
  ${this.renderFormLabels(e?void 0:"field")}
351
359
  ${e?this.renderReadonlyDisplay():this.renderField(t!==b)}
352
- ${S(t!==b||i,()=>f`
360
+ ${S(t!==b||i,()=>g`
353
361
  <div id="description-row">
354
362
  ${t} ${i?this.renderCharCount():b}
355
363
  </div>
356
364
  `)}
357
365
  </div>
358
- `}};s.styles=[Y,C.base,C.errorMessages,C.hintMessages],c([u({attribute:"default-value"})],s.prototype,"defaultValue",1),c([u()],s.prototype,"placeholder",2),c([u({type:Number,reflect:!0})],s.prototype,"rows",2),c([u({type:Boolean,reflect:!0})],s.prototype,"formatting",2),c([u({attribute:"format-toolbar-label"})],s.prototype,"formatToolbarLabel",2),c([u({attribute:"format-bold-label"})],s.prototype,"formatBoldLabel",2),c([u({attribute:"format-italic-label"})],s.prototype,"formatItalicLabel",2),c([u({attribute:"format-underline-label"})],s.prototype,"formatUnderlineLabel",2),c([u({attribute:"format-align-label"})],s.prototype,"formatAlignLabel",2),c([u({attribute:"format-align-start-label"})],s.prototype,"formatAlignStartLabel",2),c([u({attribute:"format-align-center-label"})],s.prototype,"formatAlignCenterLabel",2),c([u({attribute:"format-align-end-label"})],s.prototype,"formatAlignEndLabel",2),c([u({attribute:"format-align-justify-label"})],s.prototype,"formatAlignJustifyLabel",2),c([u({attribute:"format-text-color-label"})],s.prototype,"formatTextColorLabel",2),c([u({attribute:"format-highlight-label"})],s.prototype,"formatHighlightLabel",2),c([u({attribute:"format-color-clear-label"})],s.prototype,"formatColorClearLabel",2),c([u({attribute:!1})],s.prototype,"colorLabels",2),c([u()],s.prototype,"autocomplete",2),c([u({type:Number})],s.prototype,"minlength",2),c([u({type:Number})],s.prototype,"maxlength",2),c([u({attribute:"empty-value-label"})],s.prototype,"emptyValueLabel",2),c([u({attribute:"confirm-label"})],s.prototype,"confirmLabel",2),c([u({attribute:"cancel-label"})],s.prototype,"cancelLabel",2),c([E()],s.prototype,"openPicker",2),c([E()],s.prototype,"activeTextColor",2),c([E()],s.prototype,"activeHighlight",2),c([k("#field")],s.prototype,"fieldEl",2),c([k("#toolbar")],s.prototype,"toolbarEl",2),s=c([I(re)],s);export{s as EunomiaTextarea,re as EunomiaTextareaTagName};
366
+ `}};s.styles=[J,C.base,C.errorMessages,C.hintMessages],c([u({attribute:"default-value"})],s.prototype,"defaultValue",1),c([u()],s.prototype,"placeholder",2),c([u({type:Number,reflect:!0})],s.prototype,"rows",2),c([u({type:Boolean,reflect:!0})],s.prototype,"formatting",2),c([u({attribute:"format-toolbar-label"})],s.prototype,"formatToolbarLabel",2),c([u({attribute:"format-bold-label"})],s.prototype,"formatBoldLabel",2),c([u({attribute:"format-italic-label"})],s.prototype,"formatItalicLabel",2),c([u({attribute:"format-underline-label"})],s.prototype,"formatUnderlineLabel",2),c([u({attribute:"format-align-label"})],s.prototype,"formatAlignLabel",2),c([u({attribute:"format-align-start-label"})],s.prototype,"formatAlignStartLabel",2),c([u({attribute:"format-align-center-label"})],s.prototype,"formatAlignCenterLabel",2),c([u({attribute:"format-align-end-label"})],s.prototype,"formatAlignEndLabel",2),c([u({attribute:"format-align-justify-label"})],s.prototype,"formatAlignJustifyLabel",2),c([u({attribute:"format-text-color-label"})],s.prototype,"formatTextColorLabel",2),c([u({attribute:"format-highlight-label"})],s.prototype,"formatHighlightLabel",2),c([u({attribute:"format-color-clear-label"})],s.prototype,"formatColorClearLabel",2),c([u({attribute:!1})],s.prototype,"colorLabels",2),c([u()],s.prototype,"autocomplete",2),c([u({type:Number})],s.prototype,"minlength",2),c([u({type:Number})],s.prototype,"maxlength",2),c([u({attribute:"empty-value-label"})],s.prototype,"emptyValueLabel",2),c([u({attribute:"confirm-label"})],s.prototype,"confirmLabel",2),c([u({attribute:"cancel-label"})],s.prototype,"cancelLabel",2),c([E()],s.prototype,"openPicker",2),c([E()],s.prototype,"activeTextColor",2),c([E()],s.prototype,"activeHighlight",2),c([w("#field")],s.prototype,"fieldEl",2),c([w("#toolbar")],s.prototype,"toolbarEl",2),s=c([I(se)],s);export{s as EunomiaTextarea,se as EunomiaTextareaTagName};
@@ -1,4 +1,4 @@
1
- import{a as Q,b as $,c as X,d as ee,e as te,f as ie,g as D,h as E,i as oe,j as H,k as re,m as h,o as I,p as ne,q as ae,r as se,s as le}from"./chunks/chunk-JYIIWN2P.js";import"./chunks/chunk-VJCNHMQZ.js";import{a as W}from"./chunks/chunk-LK5BJ4SH.js";import{a as Z}from"./chunks/chunk-UYZR4JXZ.js";import{b as J,c as T}from"./chunks/chunk-624VJYNA.js";import{a as A}from"./chunks/chunk-LYYQAALT.js";import{a as G}from"./chunks/chunk-4PI6RDUS.js";import{a as Y}from"./chunks/chunk-BO3JOEWM.js";import{b as B,c as j,d as U,e as q,f as C}from"./chunks/chunk-VOTRXBDS.js";import{a as P}from"./chunks/chunk-YYCEPZUN.js";import{a as N}from"./chunks/chunk-RS7TWEMQ.js";import{b as R}from"./chunks/chunk-BKZGTCMF.js";import"./chunks/chunk-PPCHQG7P.js";import"./chunks/chunk-SD2H5UDZ.js";import{a as _}from"./chunks/chunk-O7PHBLH2.js";import"./chunks/chunk-SGM2X2TC.js";import{a as K}from"./chunks/chunk-LMVW522V.js";import"./chunks/chunk-KSZRQRN4.js";import{a as r,f as z,h as x,j as s,k as M,l as b,p as d,r as k,u as V}from"./chunks/chunk-YITWLCD3.js";var he=x`
1
+ import{a as ie,b as $,c as oe,d as re,e as ne,f as ae,g as E,h as D,i as se,j as I,k as le,m as h,o as H,p as de,q as ue,r as ce,s as me}from"./chunks/chunk-36KLGY6U.js";import"./chunks/chunk-VJCNHMQZ.js";import{a as J}from"./chunks/chunk-LK5BJ4SH.js";import{a as Z}from"./chunks/chunk-WIUERJII.js";import{a as Q}from"./chunks/chunk-QSZO4GIH.js";import{b as X,c as T}from"./chunks/chunk-624VJYNA.js";import{a as A}from"./chunks/chunk-LYYQAALT.js";import{a as ee,b as te}from"./chunks/chunk-WW4BTWMH.js";import{a as G}from"./chunks/chunk-GVS6IUKC.js";import{a as W}from"./chunks/chunk-P6LGU3FT.js";import{a as Y}from"./chunks/chunk-BO3JOEWM.js";import{b as B,c as j,d as U,e as q,f as C}from"./chunks/chunk-TLBXTBMM.js";import{a as P}from"./chunks/chunk-YYCEPZUN.js";import{a as N}from"./chunks/chunk-3BMACIDO.js";import{b as K}from"./chunks/chunk-BKZGTCMF.js";import"./chunks/chunk-PPCHQG7P.js";import"./chunks/chunk-SD2H5UDZ.js";import{a as V}from"./chunks/chunk-O7PHBLH2.js";import"./chunks/chunk-SGM2X2TC.js";import{a as R}from"./chunks/chunk-62RLISRD.js";import"./chunks/chunk-QL5GSW2A.js";import{a as r,f as _,h as x,j as s,k as M,l as g,p as u,r as S,u as O}from"./chunks/chunk-YITWLCD3.js";var be=x`
2
2
  :host {
3
3
  display: block;
4
4
  width: 100%;
@@ -8,15 +8,15 @@ import{a as Q,b as $,c as X,d as ee,e as te,f as ie,g as D,h as E,i as oe,j as H
8
8
  display: flex;
9
9
  align-items: center;
10
10
  gap: var(--eun-space-xs, 4px);
11
- width: 100%;
12
11
  color: var(--_textColor);
13
12
  background-color: var(--_background);
14
13
  border: var(--eun-border-width-m, 1.5px) solid var(--_borderColor);
15
14
  border-radius: var(--_borderRadius);
16
- padding: var(--eun-space-xs, 4px) var(--eun-space-xs, 4px)
17
- var(--eun-space-xs, 4px) var(--eun-space-s, 8px);
15
+ padding: var(--_paddingBlock) calc(var(--_defaultPaddingInline) / 2)
16
+ var(--_paddingBlock) var(--_defaultPaddingInline);
18
17
  outline: 1px solid transparent;
19
- box-sizing: border-box;
18
+ box-sizing: content-box;
19
+ height: var(--_lineHeight);
20
20
  transition:
21
21
  border-color var(--eun-duration-s, 150ms) var(--eun-easing-default, ease),
22
22
  outline-color var(--eun-duration-s, 150ms) var(--eun-easing-default, ease);
@@ -71,9 +71,10 @@ import{a as Q,b as $,c as X,d as ee,e as te,f as ie,g as D,h as E,i as oe,j as H
71
71
  box-sizing: content-box;
72
72
  border: none;
73
73
  background: none;
74
- padding: var(--eun-space-xxs, 1.6px) 1px;
74
+ padding: 0 1px;
75
75
  color: inherit;
76
76
  font: inherit;
77
+ line-height: var(--_lineHeight);
77
78
  text-align: center;
78
79
  outline: none;
79
80
  overflow: visible;
@@ -99,6 +100,7 @@ import{a as Q,b as $,c as X,d as ee,e as te,f as ie,g as D,h as E,i as oe,j as H
99
100
  padding-inline: 2px;
100
101
  }
101
102
  #clock-trigger {
103
+ --icon-size: min(16px, var(--_lineHeight));
102
104
  display: flex;
103
105
  align-items: center;
104
106
  justify-content: center;
@@ -180,7 +182,7 @@ import{a as Q,b as $,c as X,d as ee,e as te,f as ie,g as D,h as E,i as oe,j as H
180
182
  #modal-time .modal-footer {
181
183
  padding: var(--eun-space-m);
182
184
  }
183
- `,ue=[Z,he],fe=x`
185
+ `,pe=[Q,be],ye=x`
184
186
  @supports (anchor-name: --a) {
185
187
  #clock-popover:popover-open {
186
188
  position-try-fallbacks: --eun-time-picker-above;
@@ -192,7 +194,7 @@ import{a as Q,b as $,c as X,d as ee,e as te,f as ie,g as D,h as E,i as oe,j as H
192
194
  bottom: calc(anchor(top) + 4px);
193
195
  }
194
196
  }
195
- `,de=fe;var ve=x`
197
+ `,he=ye;var xe=x`
196
198
  .tp-list {
197
199
  display: flex;
198
200
  flex-direction: column;
@@ -243,20 +245,20 @@ import{a as Q,b as $,c as X,d as ee,e as te,f as ie,g as D,h as E,i as oe,j as H
243
245
  cursor: not-allowed;
244
246
  opacity: 0.4;
245
247
  }
246
- `,ce=ve;var be=1440;function pe(u){let{format:g,hour:e,minute:t,locale:i,disabled:n=!1,onPick:c}=u,p=Math.max(1,Math.round(u.stepMinutes)),w=new Intl.DateTimeFormat(i,{hour:"numeric",minute:"2-digit",hourCycle:g===12?"h12":"h23"}),f=[];for(let a=0;a<be;a+=p){let l=Math.floor(a/60),m=a%60;f.push({hour24:l,minute:m,text:w.format(new Date(2e3,0,1,l,m)),selected:l===e&&m===t})}let F=f.findIndex(a=>a.selected),O=F===-1?0:F,v=(a,l)=>{let m=a.querySelectorAll('[role="option"]'),S=Math.min(Math.max(l,0),m.length-1);m[S]?.focus()},me=a=>{let l=a.currentTarget,m=Array.from(l.querySelectorAll('[role="option"]')),S=m.indexOf(document.activeElement),y=S===-1?O:S;switch(a.key){case"ArrowDown":a.preventDefault(),v(l,y+1);break;case"ArrowUp":a.preventDefault(),v(l,y-1);break;case"PageDown":a.preventDefault(),v(l,y+5);break;case"PageUp":a.preventDefault(),v(l,y-5);break;case"Home":a.preventDefault(),v(l,0);break;case"End":a.preventDefault(),v(l,m.length-1);break;case"Enter":case" ":{a.preventDefault();let L=f[y];L&&c(L.hour24,L.minute);break}default:break}};return d`
248
+ `,fe=xe;var Me=1440;function ve(d){let{format:b,hour:e,minute:t,locale:i,disabled:n=!1,onPick:c}=d,m=Math.max(1,Math.round(d.stepMinutes)),k=new Intl.DateTimeFormat(i,{hour:"numeric",minute:"2-digit",hourCycle:b===12?"h12":"h23"}),f=[];for(let a=0;a<Me;a+=m){let l=Math.floor(a/60),p=a%60;f.push({hour24:l,minute:p,text:k.format(new Date(2e3,0,1,l,p)),selected:l===e&&p===t})}let F=f.findIndex(a=>a.selected),z=F===-1?0:F,v=(a,l)=>{let p=a.querySelectorAll('[role="option"]'),w=Math.min(Math.max(l,0),p.length-1);p[w]?.focus()},ge=a=>{let l=a.currentTarget,p=Array.from(l.querySelectorAll('[role="option"]')),w=p.indexOf(document.activeElement),y=w===-1?z:w;switch(a.key){case"ArrowDown":a.preventDefault(),v(l,y+1);break;case"ArrowUp":a.preventDefault(),v(l,y-1);break;case"PageDown":a.preventDefault(),v(l,y+5);break;case"PageUp":a.preventDefault(),v(l,y-5);break;case"Home":a.preventDefault(),v(l,0);break;case"End":a.preventDefault(),v(l,p.length-1);break;case"Enter":case" ":{a.preventDefault();let L=f[y];L&&c(L.hour24,L.minute);break}default:break}};return u`
247
249
  <div
248
250
  class="tp-list"
249
251
  role="listbox"
250
- aria-label=${u.ariaLabel??"Time"}
252
+ aria-label=${d.ariaLabel??"Time"}
251
253
  aria-disabled=${n?"true":"false"}
252
- @keydown=${me}
254
+ @keydown=${ge}
253
255
  >
254
- ${f.map((a,l)=>d`
256
+ ${f.map((a,l)=>u`
255
257
  <button
256
258
  type="button"
257
259
  role="option"
258
- class=${_({"tp-list-item":!0,selected:a.selected})}
259
- tabindex=${n?"-1":l===O?"0":"-1"}
260
+ class=${V({"tp-list-item":!0,selected:a.selected})}
261
+ tabindex=${n?"-1":l===z?"0":"-1"}
260
262
  aria-selected=${a.selected?"true":"false"}
261
263
  ?disabled=${n}
262
264
  @click=${()=>c(a.hour24,a.minute)}
@@ -265,7 +267,7 @@ import{a as Q,b as $,c as X,d as ee,e as te,f as ie,g as D,h as E,i as oe,j as H
265
267
  </button>
266
268
  `)}
267
269
  </div>
268
- `}var ge="eun-time-picker",ye=N(q(V)),xe=K(W(G(Y(U(j(ye)))))),o=class extends xe{constructor(){super(...arguments);this.stepMinute=1;this.mobileMode="wheel";this.panelMode="columns";this.listStepMinutes=30;this.noAnimation=!1;this.applyLabel="Apply";this.cancelLabel="Cancel";this.ariaLabelClock="Open clock";this.hourPlaceholder="hh";this.minutePlaceholder="mm";this.hideTimezoneLabel=!1;this.isOpen=!1;this.isModalOpen=!1;this.stagingValue=null;this.segments={hour:"",minute:"",period:""};this.checkLocalValidators=()=>{let e=this.resolvedHourFormat();if(Me(this.segments)&&!E(this.segments,e))return{validity:{badInput:!0},message:this.dictionary.validation.invalidTime};if(this.value){let{hour:t,minute:i}=h(this.value,this.timezone),n=re({hour:t,minute:i},H(this.minTime),H(this.maxTime));if(!n.valid)return n.violation==="min"?{validity:{rangeUnderflow:!0},message:this.dictionary.timePicker.mustBeAtOrAfter(this.minTime??"")}:{validity:{rangeOverflow:!0},message:this.dictionary.timePicker.mustBeAtOrBefore(this.maxTime??"")}}return{validity:{}}};this.handleHourColumnChange=e=>{let{minute:t}=h(this.displaySource,this.timezone);this.commitAdjustment(e,t)};this.handleMinuteColumnChange=e=>{let{hour:t}=h(this.displaySource,this.timezone);this.commitAdjustment(t,e)};this.handlePeriodColumnChange=e=>{let{hour:t,minute:i}=h(this.displaySource,this.timezone),{hour:n}=$(t);this.commitAdjustment(X(n,e),i)};this.handleTriggerClick=()=>{if(!(this.disabled||this.readonly)){if(this.resetStaging(),this.panelMode!=="list"&&this.isMobileViewport()){this.isModalOpen=!0;return}this.updateComplete.then(()=>{let e=this.popoverEl;if(!e)return;let t=this.popoverAnimation!==void 0;this.popoverAnimation?.cancel(),this.popoverAnimation=void 0;let i=!e.matches(":popover-open");i&&e.showPopover(),(i||t)&&this.playPopoverOpenAnimation(e)})}};this.handlePopoverToggle=e=>{if(e.newState==="open"){this.isOpen=!0,this.fieldWrapperEl&&this.popoverEl&&this.anchorFloatingElement(this.fieldWrapperEl,this.popoverEl,{forceFallback:A}),this.observeAnchorVisibility(this.fieldWrapperEl,()=>this.closePopover()),this.updateComplete.then(()=>this.panelMode==="list"?this.focusListSelection():this.focusFirstSpinbutton());return}this.isOpen=!1,this.unanchorFloatingElement(),this.unobserveAnchorVisibility(),this.triggerEl?.focus()};this.handleModalConfirm=()=>{this.commitStaged(),this.isModalOpen=!1};this.handleModalCancel=()=>{this.isModalOpen=!1};this.handleListPick=(e,t)=>{this.commitAdjustment(e,t),this.closePopover()};this.handlePeriodSegmentClick=()=>{this.setPeriodSegment(ee(this.segments.period||"AM"))};this.handlePeriodSegmentKeydown=e=>{switch(e.key){case"ArrowUp":case"ArrowDown":case"Enter":case" ":e.preventDefault(),this.handlePeriodSegmentClick();break;case"a":case"A":e.preventDefault(),this.setPeriodSegment("AM");break;case"p":case"P":e.preventDefault(),this.setPeriodSegment("PM");break;case"ArrowLeft":e.preventDefault(),this.focusPreviousSegment("period");break;case"ArrowRight":e.preventDefault(),this.focusNextSegment("period");break;default:break}}}get defaultValue(){return super.defaultValue}set defaultValue(e){super.defaultValue=e}willUpdate(e){let t=e.has("segments")||e.has("minTime")||e.has("maxTime");if(e.has("value")||e.has("timezone")||e.has("hourFormat")||e.has("locale")){let i=this.resolvedHourFormat();if(this.value){let n=h(this.value,this.timezone);this.segments=D(n.hour,n.minute,i)}else this.segments=D(null,null,i);t=!0}t&&this.checkValidity(this.value??null),super.willUpdate(e)}updated(e){super.updated(e),B(e)&&this.setAttribute("aria-invalid",String(this.showError))}getFocusAnchor(){return this.firstSegmentEl??void 0}focus(){super.focus?.(),this.firstSegmentEl?.focus()}isMobileViewport(){return window.matchMedia(R("tablet")).matches}resolvedHourFormat(){return Q(this.locale,this.hourFormat)}get displaySource(){return this.stagingValue??this.value??new Date}resetStaging(){this.stagingValue=this.value??null}commitStaged(){this.value=this.stagingValue,this.dispatchEvent(new P(this.value))}commitAdjustment(e,t){let i=I(this.displaySource,this.timezone,e,t);this.stagingValue=i,!this.isModalOpen&&(this.value=i,this.dispatchEvent(new P(this.value)))}commitTypedTime(e,t){this.value=I(this.value??new Date,this.timezone,e,t),this.dispatchEvent(new P(this.value)),(this.isOpen||this.isModalOpen)&&this.resetStaging()}commitSegmentGroupIfComplete(e){let t=this.resolvedHourFormat();if(!oe(e,t))return;let i=E(e,t);i&&this.commitTypedTime(i.hour,i.minute)}popoverAnimationDuration(e){return this.noAnimation||window.matchMedia("(prefers-reduced-motion: reduce)").matches?0:J(e,"--time-picker-panel-transition-duration","m",200)}playPopoverOpenAnimation(e){e.style.removeProperty("pointer-events");let t=this.popoverAnimationDuration(e);t!==0&&(this.popoverAnimation=e.animate([{opacity:0,transform:"scaleY(0.01)"},{opacity:1,transform:"scaleY(1)"}],{duration:t,easing:T(e),fill:"forwards"}))}closePopover(){let e=this.popoverEl;this.popoverAnimation?.cancel(),this.popoverAnimation=void 0,e?.matches(":popover-open")&&this.playPopoverCloseAnimation(e)}playPopoverCloseAnimation(e){e.style.pointerEvents="none";let t=this.popoverAnimationDuration(e);if(t===0){e.hidePopover();return}let i=e.animate([{opacity:1,transform:"scaleY(1)"},{opacity:0,transform:"scaleY(0.01)"}],{duration:t,easing:T(e),fill:"forwards"});this.popoverAnimation=i,i.finished.then(()=>{this.popoverAnimation===i&&(this.popoverAnimation=void 0),e.hidePopover()}).catch(()=>{})}focusFirstSpinbutton(){(this.isModalOpen?this.shadowRoot:this.popoverEl)?.querySelector('[role="spinbutton"]')?.focus({preventScroll:!0})}focusListSelection(){let e=this.popoverEl?.querySelector('[role="option"][aria-selected="true"]')??this.popoverEl?.querySelector('[role="option"]');e?.focus({preventScroll:!0}),e?.scrollIntoView({block:"center",behavior:this.noAnimation?"instant":"smooth"})}visibleSegmentOrder(){let e=te(this.resolvedHourFormat());return ie(this.locale).filter(t=>e.includes(t))}focusPreviousSegment(e){let t=this.visibleSegmentOrder(),i=t.indexOf(e);i<=0||this.focusSegment(t[i-1])}focusNextSegment(e){let t=this.visibleSegmentOrder(),i=t.indexOf(e);i===-1||i>=t.length-1||this.focusSegment(t[i+1])}focusSegment(e){this.shadowRoot?.querySelector(`.segment-${e}`)?.focus()}handleSegmentInput(e,t){let i=e.target,n=i.value.replace(/\D/g,"").slice(0,2);i.value=n;let c={...this.segments,[t]:n};this.segments=c,n.length===2&&this.focusNextSegment(t),this.commitSegmentGroupIfComplete(c)}handleSegmentKeydown(e,t){let i=e.target;e.key==="Backspace"&&i.value===""||e.key==="ArrowLeft"?(e.preventDefault(),this.focusPreviousSegment(t)):e.key==="ArrowRight"?(e.preventDefault(),this.focusNextSegment(t)):e.key==="ArrowUp"?(e.preventDefault(),this.adjustSegment(t,1)):e.key==="ArrowDown"&&(e.preventDefault(),this.adjustSegment(t,-1))}adjustSegment(e,t){let i=this.resolvedHourFormat(),n=e==="hour"?i===12?{min:1,max:12}:{min:0,max:23}:{min:0,max:59},c=Number(this.segments[e]),p;if(this.segments[e]===""||Number.isNaN(c)){let f=h(this.displaySource,this.timezone);p=e==="hour"?i===12?$(f.hour).hour:f.hour:f.minute}else p=c+t,p>n.max?p=n.min:p<n.min&&(p=n.max);let w={...this.segments,[e]:String(p).padStart(2,"0")};this.segments=w,this.commitSegmentGroupIfComplete(w)}setPeriodSegment(e){if(this.disabled||this.readonly)return;let t={...this.segments,period:e};this.segments=t,this.commitSegmentGroupIfComplete(t)}renderSegment(e){return e==="period"?d`
270
+ `}var Se="eun-time-picker",ke=N(q(O)),we=R(J(W(Z(G(Y(U(j(ke)))))))),o=class extends we{constructor(){super();this.stepMinute=1;this.mobileMode="wheel";this.panelMode="columns";this.listStepMinutes=30;this.noAnimation=!1;this.applyLabel="Apply";this.hourPlaceholder="hh";this.minutePlaceholder="mm";this.hideTimezoneLabel=!1;this.isOpen=!1;this.handleImplicitSubmission=e=>{let t=this.internals.form,i=e.composedPath()[0];!t||this.isOpen||!(i instanceof Element&&i.matches(".segment"))||!ee(e)||(e.preventDefault(),te(t))};this.isModalOpen=!1;this.stagingValue=null;this.segments={hour:"",minute:"",period:""};this.checkLocalValidators=()=>{let e=this.resolvedHourFormat();if(Pe(this.segments)&&!D(this.segments,e))return{validity:{badInput:!0},message:this.dictionary.validation.invalidTime};if(this.value){let{hour:t,minute:i}=h(this.value,this.timezone),n=le({hour:t,minute:i},I(this.minTime),I(this.maxTime));if(!n.valid)return n.violation==="min"?{validity:{rangeUnderflow:!0},message:this.dictionary.timePicker.mustBeAtOrAfter(this.minTime??"")}:{validity:{rangeOverflow:!0},message:this.dictionary.timePicker.mustBeAtOrBefore(this.maxTime??"")}}return{validity:{}}};this.handleHourColumnChange=e=>{let{minute:t}=h(this.displaySource,this.timezone);this.commitAdjustment(e,t)};this.handleMinuteColumnChange=e=>{let{hour:t}=h(this.displaySource,this.timezone);this.commitAdjustment(t,e)};this.handlePeriodColumnChange=e=>{let{hour:t,minute:i}=h(this.displaySource,this.timezone),{hour:n}=$(t);this.commitAdjustment(oe(n,e),i)};this.handleTriggerClick=()=>{if(!(this.disabled||this.readonly)){if(this.resetStaging(),this.panelMode!=="list"&&this.isMobileViewport()){this.isModalOpen=!0;return}this.updateComplete.then(()=>{let e=this.popoverEl;if(!e)return;let t=this.popoverAnimation!==void 0;this.popoverAnimation?.cancel(),this.popoverAnimation=void 0;let i=!e.matches(":popover-open");i&&e.showPopover(),(i||t)&&this.playPopoverOpenAnimation(e)})}};this.handlePopoverToggle=e=>{if(e.newState==="open"){this.isOpen=!0,this.fieldWrapperEl&&this.popoverEl&&this.anchorFloatingElement(this.fieldWrapperEl,this.popoverEl,{forceFallback:A}),this.observeAnchorVisibility(this.fieldWrapperEl,()=>this.closePopover()),this.updateComplete.then(()=>this.panelMode==="list"?this.focusListSelection():this.focusFirstSpinbutton());return}this.isOpen=!1,this.unanchorFloatingElement(),this.unobserveAnchorVisibility(),this.triggerEl?.focus()};this.handleModalConfirm=()=>{this.commitStaged(),this.isModalOpen=!1};this.handleModalCancel=()=>{this.isModalOpen=!1};this.handleListPick=(e,t)=>{this.commitAdjustment(e,t),this.closePopover()};this.handlePeriodSegmentClick=()=>{this.setPeriodSegment(re(this.segments.period||"AM"))};this.handlePeriodSegmentKeydown=e=>{switch(e.key){case"ArrowUp":case"ArrowDown":case"Enter":case" ":e.preventDefault(),this.handlePeriodSegmentClick();break;case"a":case"A":e.preventDefault(),this.setPeriodSegment("AM");break;case"p":case"P":e.preventDefault(),this.setPeriodSegment("PM");break;case"ArrowLeft":e.preventDefault(),this.focusPreviousSegment("period");break;case"ArrowRight":e.preventDefault(),this.focusNextSegment("period");break;default:break}};this.addEventListener("keydown",this.handleImplicitSubmission)}get defaultValue(){return super.defaultValue}set defaultValue(e){super.defaultValue=e}willUpdate(e){let t=e.has("segments")||e.has("minTime")||e.has("maxTime");if(e.has("value")||e.has("timezone")||e.has("hourFormat")||e.has("locale")){let i=this.resolvedHourFormat();if(this.value){let n=h(this.value,this.timezone);this.segments=E(n.hour,n.minute,i)}else this.segments=E(null,null,i);t=!0}t&&this.checkValidity(this.value??null),super.willUpdate(e)}updated(e){super.updated(e),B(e)&&this.setAttribute("aria-invalid",String(this.showError))}get hostTabStop(){return!1}getFocusAnchor(){return this.firstSegmentEl??void 0}focus(){super.focus?.(),this.firstSegmentEl?.focus()}isMobileViewport(){return window.matchMedia(K("tablet")).matches}resolvedHourFormat(){return ie(this.locale,this.hourFormat)}get displaySource(){return this.stagingValue??this.value??new Date}resetStaging(){this.stagingValue=this.value??null}commitStaged(){this.value=this.stagingValue,this.dispatchEvent(new P(this.value))}commitAdjustment(e,t){let i=H(this.displaySource,this.timezone,e,t);this.stagingValue=i,!this.isModalOpen&&(this.value=i,this.dispatchEvent(new P(this.value)))}commitTypedTime(e,t){this.value=H(this.value??new Date,this.timezone,e,t),this.dispatchEvent(new P(this.value)),(this.isOpen||this.isModalOpen)&&this.resetStaging()}commitSegmentGroupIfComplete(e){let t=this.resolvedHourFormat();if(!se(e,t))return;let i=D(e,t);i&&this.commitTypedTime(i.hour,i.minute)}popoverAnimationDuration(e){return this.noAnimation||window.matchMedia("(prefers-reduced-motion: reduce)").matches?0:X(e,"--time-picker-panel-transition-duration","m",200)}playPopoverOpenAnimation(e){e.style.removeProperty("pointer-events");let t=this.popoverAnimationDuration(e);t!==0&&(this.popoverAnimation=e.animate([{opacity:0,transform:"scaleY(0.01)"},{opacity:1,transform:"scaleY(1)"}],{duration:t,easing:T(e),fill:"forwards"}))}closePopover(){let e=this.popoverEl;this.popoverAnimation?.cancel(),this.popoverAnimation=void 0,e?.matches(":popover-open")&&this.playPopoverCloseAnimation(e)}playPopoverCloseAnimation(e){e.style.pointerEvents="none";let t=this.popoverAnimationDuration(e);if(t===0){e.hidePopover();return}let i=e.animate([{opacity:1,transform:"scaleY(1)"},{opacity:0,transform:"scaleY(0.01)"}],{duration:t,easing:T(e),fill:"forwards"});this.popoverAnimation=i,i.finished.then(()=>{this.popoverAnimation===i&&(this.popoverAnimation=void 0),e.hidePopover()}).catch(()=>{})}focusFirstSpinbutton(){(this.isModalOpen?this.shadowRoot:this.popoverEl)?.querySelector('[role="spinbutton"]')?.focus({preventScroll:!0})}focusListSelection(){let e=this.popoverEl?.querySelector('[role="option"][aria-selected="true"]')??this.popoverEl?.querySelector('[role="option"]');e?.focus({preventScroll:!0}),e?.scrollIntoView({block:"center",behavior:this.noAnimation?"instant":"smooth"})}visibleSegmentOrder(){let e=ne(this.resolvedHourFormat());return ae(this.locale).filter(t=>e.includes(t))}focusPreviousSegment(e){let t=this.visibleSegmentOrder(),i=t.indexOf(e);i<=0||this.focusSegment(t[i-1])}focusNextSegment(e){let t=this.visibleSegmentOrder(),i=t.indexOf(e);i===-1||i>=t.length-1||this.focusSegment(t[i+1])}focusSegment(e){this.shadowRoot?.querySelector(`.segment-${e}`)?.focus()}handleSegmentInput(e,t){let i=e.target,n=i.value.replace(/\D/g,"").slice(0,2);i.value=n;let c={...this.segments,[t]:n};this.segments=c,n.length===2&&this.focusNextSegment(t),this.commitSegmentGroupIfComplete(c)}handleSegmentKeydown(e,t){let i=e.target;e.key==="Backspace"&&i.value===""||e.key==="ArrowLeft"?(e.preventDefault(),this.focusPreviousSegment(t)):e.key==="ArrowRight"?(e.preventDefault(),this.focusNextSegment(t)):e.key==="ArrowUp"?(e.preventDefault(),this.adjustSegment(t,1)):e.key==="ArrowDown"&&(e.preventDefault(),this.adjustSegment(t,-1))}adjustSegment(e,t){let i=this.resolvedHourFormat(),n=e==="hour"?i===12?{min:1,max:12}:{min:0,max:23}:{min:0,max:59},c=Number(this.segments[e]),m;if(this.segments[e]===""||Number.isNaN(c)){let f=h(this.displaySource,this.timezone);m=e==="hour"?i===12?$(f.hour).hour:f.hour:f.minute}else m=c+t,m>n.max?m=n.min:m<n.min&&(m=n.max);let k={...this.segments,[e]:String(m).padStart(2,"0")};this.segments=k,this.commitSegmentGroupIfComplete(k)}setPeriodSegment(e){if(this.disabled||this.readonly)return;let t={...this.segments,period:e};this.segments=t,this.commitSegmentGroupIfComplete(t)}renderSegment(e){return e==="period"?u`
269
271
  <button
270
272
  type="button"
271
273
  class="segment segment-period"
@@ -277,7 +279,7 @@ import{a as Q,b as $,c as X,d as ee,e as te,f as ie,g as D,h as E,i as oe,j as H
277
279
  >
278
280
  ${this.segments.period||"--"}
279
281
  </button>
280
- `:d`
282
+ `:u`
281
283
  <input
282
284
  class="segment segment-${e}"
283
285
  type="text"
@@ -293,15 +295,16 @@ import{a as Q,b as $,c as X,d as ee,e as te,f as ie,g as D,h as E,i as oe,j as H
293
295
  @input=${t=>this.handleSegmentInput(t,e)}
294
296
  @keydown=${t=>this.handleSegmentKeydown(t,e)}
295
297
  />
296
- `}renderField(){let e=this.visibleSegmentOrder();return d`
298
+ `}renderField(){let e=this.visibleSegmentOrder();return u`
297
299
  <div id="field-wrapper">
298
300
  <div
299
301
  class="segment-group"
300
302
  role="group"
301
- aria-label=${this.label??"Time"}
303
+ aria-label=${this.label??this.dictionary.timePicker.time}
304
+ aria-describedby=${this.description?.length?"description":S}
302
305
  >
303
- ${e.map((t,i)=>{let n=e[i-1];return d`
304
- ${i===0?k:d`<span class="segment-divider" aria-hidden="true"
306
+ ${e.map((t,i)=>{let n=e[i-1];return u`
307
+ ${i===0?S:u`<span class="segment-divider" aria-hidden="true"
305
308
  >${n==="hour"&&t==="minute"||n==="minute"&&t==="hour"?":":" "}</span
306
309
  >`}
307
310
  ${this.renderSegment(t)}
@@ -310,16 +313,16 @@ import{a as Q,b as $,c as X,d as ee,e as te,f as ie,g as D,h as E,i as oe,j as H
310
313
  <button
311
314
  type="button"
312
315
  id="clock-trigger"
313
- aria-label=${this.ariaLabelClock}
316
+ aria-label=${this.clockLabel??this.dictionary.timePicker.openClock}
314
317
  aria-haspopup=${this.panelMode==="list"?"listbox":"dialog"}
315
318
  aria-expanded=${this.isOpen||this.isModalOpen?"true":"false"}
316
319
  ?disabled=${this.disabled}
317
320
  @click=${this.handleTriggerClick}
318
321
  >
319
- <eun-icon name="access_time" size="16"></eun-icon>
322
+ <eun-icon name="access_time"></eun-icon>
320
323
  </button>
321
324
  </div>
322
- `}renderTimezoneLabel(){if(this.hideTimezoneLabel||!this.timezone||ne(this.timezone))return k;let e=ae(this.value??new Date,this.timezone,{locale:this.locale});return d`<p id="timezone-label">${e}</p>`}renderPanelContent(e){let t=this.resolvedHourFormat(),i=h(this.displaySource,this.timezone),n=i.hour<12?"AM":"PM";return se({visual:e,format:t,hour:i.hour,minute:i.minute,period:n,stepMinute:this.stepMinute,disabled:this.disabled,noAnimation:this.noAnimation,ariaLabelGroup:this.dictionary.timePicker.time,ariaLabelHour:this.dictionary.timePicker.hour,ariaLabelMinute:this.dictionary.timePicker.minute,ariaLabelPeriod:this.dictionary.timePicker.amPm,onHourChange:this.handleHourColumnChange,onMinuteChange:this.handleMinuteColumnChange,onPeriodChange:this.handlePeriodColumnChange})}renderListPanelContent(){let e=this.resolvedHourFormat(),t=h(this.displaySource,this.timezone);return pe({format:e,hour:t.hour,minute:t.minute,locale:this.locale,stepMinutes:this.listStepMinutes,disabled:this.disabled,ariaLabel:this.label??this.dictionary.timePicker.time,onPick:this.handleListPick})}formatModalPreview(){if(!this.stagingValue)return this.dictionary.timePicker.selectATime;let e=this.resolvedHourFormat();return new Intl.DateTimeFormat(this.locale,{hour:"numeric",minute:"2-digit",hourCycle:e===12?"h12":"h23",timeZone:this.timezone}).format(this.stagingValue)}render(){return d`
325
+ `}renderTimezoneLabel(){if(this.hideTimezoneLabel||!this.timezone||de(this.timezone))return S;let e=ue(this.value??new Date,this.timezone,{locale:this.locale});return u`<p id="timezone-label">${e}</p>`}renderPanelContent(e){let t=this.resolvedHourFormat(),i=h(this.displaySource,this.timezone),n=i.hour<12?"AM":"PM";return ce({visual:e,format:t,hour:i.hour,minute:i.minute,period:n,stepMinute:this.stepMinute,disabled:this.disabled,noAnimation:this.noAnimation,ariaLabelGroup:this.dictionary.timePicker.time,ariaLabelHour:this.dictionary.timePicker.hour,ariaLabelMinute:this.dictionary.timePicker.minute,ariaLabelPeriod:this.dictionary.timePicker.amPm,onHourChange:this.handleHourColumnChange,onMinuteChange:this.handleMinuteColumnChange,onPeriodChange:this.handlePeriodColumnChange})}renderListPanelContent(){let e=this.resolvedHourFormat(),t=h(this.displaySource,this.timezone);return ve({format:e,hour:t.hour,minute:t.minute,locale:this.locale,stepMinutes:this.listStepMinutes,disabled:this.disabled,ariaLabel:this.label??this.dictionary.timePicker.time,onPick:this.handleListPick})}formatModalPreview(){if(!this.stagingValue)return this.dictionary.timePicker.selectATime;let e=this.resolvedHourFormat();return new Intl.DateTimeFormat(this.locale,{hour:"numeric",minute:"2-digit",hourCycle:e===12?"h12":"h23",timeZone:this.timezone}).format(this.stagingValue)}render(){return u`
323
326
  <div id="wrapper">
324
327
  ${this.renderFormLabels("clock-trigger")} ${this.renderField()}
325
328
  ${this.renderTimezoneLabel()} ${this.renderDescription()}
@@ -335,27 +338,27 @@ import{a as Q,b as $,c as X,d as ee,e as te,f as ie,g as D,h as E,i as oe,j as H
335
338
  ?open=${this.isModalOpen}
336
339
  .closeable=${!1}
337
340
  confirm-label=${this.applyLabel}
338
- cancel-label=${this.cancelLabel}
341
+ cancel-label=${this.cancelLabel??this.dictionary.common.cancel}
339
342
  aria-label=${this.label??this.dictionary.timePicker.selectATime}
340
343
  @eunconfirm=${this.handleModalConfirm}
341
344
  @euncancel=${this.handleModalCancel}
342
345
  id="modal-time"
343
346
  >
344
- ${this.isModalOpen?d`
347
+ ${this.isModalOpen?u`
345
348
  <div id="modal-time-heading">${this.formatModalPreview()}</div>
346
349
  ${this.renderPanelContent(this.mobileMode==="wheel"?"wheel":"buttons")}
347
- `:k}
350
+ `:S}
348
351
  <div slot="footer" class="modal-footer">
349
352
  <eun-button
350
353
  appearance="ghost"
351
354
  id="cancel"
352
355
  @click=${()=>this.modalEl?.cancel()}
353
356
  >
354
- ${this.cancelLabel}
357
+ ${this.cancelLabel??this.dictionary.common.cancel}
355
358
  </eun-button>
356
359
  <eun-button id="confirm" @click=${()=>this.modalEl?.confirm()}>
357
360
  ${this.applyLabel}
358
361
  </eun-button>
359
362
  </div>
360
363
  </eun-modal>
361
- `}};o.styles=[ue,...A?[]:[de],le,ce,C.base,C.errorMessages,C.hintMessages],r([s()],o.prototype,"timezone",2),r([s({type:Number,attribute:"hour-format"})],o.prototype,"hourFormat",2),r([s({type:Number,attribute:"step-minute"})],o.prototype,"stepMinute",2),r([s({attribute:"min-time"})],o.prototype,"minTime",2),r([s({attribute:"max-time"})],o.prototype,"maxTime",2),r([s({attribute:"mobile-mode"})],o.prototype,"mobileMode",2),r([s({attribute:"panel-mode"})],o.prototype,"panelMode",2),r([s({type:Number,attribute:"list-step-minutes"})],o.prototype,"listStepMinutes",2),r([s({type:Boolean,reflect:!0,attribute:"no-animation"})],o.prototype,"noAnimation",2),r([s({attribute:"apply-label"})],o.prototype,"applyLabel",2),r([s({attribute:"cancel-label"})],o.prototype,"cancelLabel",2),r([s({attribute:"aria-label-clock"})],o.prototype,"ariaLabelClock",2),r([s({attribute:"hour-placeholder"})],o.prototype,"hourPlaceholder",2),r([s({attribute:"minute-placeholder"})],o.prototype,"minutePlaceholder",2),r([s({type:Boolean,attribute:"hide-timezone-label"})],o.prototype,"hideTimezoneLabel",2),r([s({attribute:"default-value",converter:{fromAttribute:e=>we(e),toAttribute:e=>e?Se(e):null}})],o.prototype,"defaultValue",1),r([M()],o.prototype,"isOpen",2),r([M()],o.prototype,"isModalOpen",2),r([M()],o.prototype,"stagingValue",2),r([M()],o.prototype,"segments",2),r([b("#clock-trigger")],o.prototype,"triggerEl",2),r([b("#clock-popover")],o.prototype,"popoverEl",2),r([b("#field-wrapper")],o.prototype,"fieldWrapperEl",2),r([b("#modal-time")],o.prototype,"modalEl",2),r([b(".segment")],o.prototype,"firstSegmentEl",2),o=r([z(ge)],o);function Me(u){return u.hour!==""||u.minute!==""||u.period!==""}function we(u){if(!u)return null;let g=new Date(u);return Number.isNaN(g.getTime())?null:g}function Se(u){return u?u.toISOString():""}export{o as EunomiaTimePicker,ge as EunomiaTimePickerTagName};
364
+ `}};o.styles=[pe,...A?[]:[he],me,fe,C.base,C.errorMessages,C.hintMessages],r([s()],o.prototype,"timezone",2),r([s({type:Number,attribute:"hour-format"})],o.prototype,"hourFormat",2),r([s({type:Number,attribute:"step-minute"})],o.prototype,"stepMinute",2),r([s({attribute:"min-time"})],o.prototype,"minTime",2),r([s({attribute:"max-time"})],o.prototype,"maxTime",2),r([s({attribute:"mobile-mode"})],o.prototype,"mobileMode",2),r([s({attribute:"panel-mode"})],o.prototype,"panelMode",2),r([s({type:Number,attribute:"list-step-minutes"})],o.prototype,"listStepMinutes",2),r([s({type:Boolean,reflect:!0,attribute:"no-animation"})],o.prototype,"noAnimation",2),r([s({attribute:"apply-label"})],o.prototype,"applyLabel",2),r([s({attribute:"cancel-label"})],o.prototype,"cancelLabel",2),r([s({attribute:"clock-label"})],o.prototype,"clockLabel",2),r([s({attribute:"hour-placeholder"})],o.prototype,"hourPlaceholder",2),r([s({attribute:"minute-placeholder"})],o.prototype,"minutePlaceholder",2),r([s({type:Boolean,attribute:"hide-timezone-label"})],o.prototype,"hideTimezoneLabel",2),r([s({attribute:"default-value",converter:{fromAttribute:e=>Ce(e),toAttribute:e=>e?Le(e):null}})],o.prototype,"defaultValue",1),r([M()],o.prototype,"isOpen",2),r([M()],o.prototype,"isModalOpen",2),r([M()],o.prototype,"stagingValue",2),r([M()],o.prototype,"segments",2),r([g("#clock-trigger")],o.prototype,"triggerEl",2),r([g("#clock-popover")],o.prototype,"popoverEl",2),r([g("#field-wrapper")],o.prototype,"fieldWrapperEl",2),r([g("#modal-time")],o.prototype,"modalEl",2),r([g(".segment")],o.prototype,"firstSegmentEl",2),o=r([_(Se)],o);function Pe(d){return d.hour!==""||d.minute!==""||d.period!==""}function Ce(d){if(!d)return null;let b=new Date(d);return Number.isNaN(b.getTime())?null:b}function Le(d){return d?d.toISOString():""}export{o as EunomiaTimePicker,Se as EunomiaTimePickerTagName};