@astryx-vue/core 0.13.1 → 0.14.0

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 (285) hide show
  1. package/dist/AlertDialog/index.js +1 -1
  2. package/dist/{AlertDialog-CsdgJDLK.js → AlertDialog-BOyx3Owt.js} +4 -4
  3. package/dist/AppShell/index.d.ts +1 -1
  4. package/dist/AppShell/index.js +1 -1
  5. package/dist/{AppShell-CE5Up5SI.js → AppShell-CHN80IBy.js} +1 -1
  6. package/dist/Avatar/index.js +1 -1
  7. package/dist/{Avatar-D5CFSkAG.js → Avatar-B-dg3imS.js} +1 -1
  8. package/dist/AvatarGroup/index.d.ts +1 -1
  9. package/dist/Banner/index.d.ts +1 -1
  10. package/dist/Banner/index.js +1 -1
  11. package/dist/{Banner-B4IEG4Fx.js → Banner-qEMqg2D8.js} +1 -1
  12. package/dist/BottomSheet/index.js +2 -2
  13. package/dist/{BottomSheet-D67lQ3Lo.js → BottomSheet-CFrcT1Lr.js} +3 -3
  14. package/dist/{BottomSheet-UctSPL-g.js → BottomSheet-qD8zeVYQ.js} +3 -3
  15. package/dist/Breadcrumbs/index.js +1 -1
  16. package/dist/{Breadcrumbs-By21sIml.js → Breadcrumbs-61TGNa4M.js} +1 -1
  17. package/dist/Button/index.d.ts +1 -1
  18. package/dist/Button/index.js +1 -1
  19. package/dist/{Button-CfbR2oPc.js → Button-47s3ZBYa.js} +2 -2
  20. package/dist/ButtonGroup/index.d.ts +1 -1
  21. package/dist/Calendar/index.d.ts +1 -1
  22. package/dist/Calendar/index.js +1 -1
  23. package/dist/{Calendar-DwFAzDky.js → Calendar-D029GXOJ.js} +1 -1
  24. package/dist/Card/index.d.ts +1 -1
  25. package/dist/Carousel/index.d.ts +1 -1
  26. package/dist/Carousel/index.js +1 -1
  27. package/dist/{Carousel-mL_KdBMw.js → Carousel-CYjVpChx.js} +1 -1
  28. package/dist/Center/index.d.ts +1 -1
  29. package/dist/Chat/index.d.ts +1 -1
  30. package/dist/Chat/index.js +1 -1
  31. package/dist/{Chat-C10BQlIl.js → Chat-BfekV9OQ.js} +5 -5
  32. package/dist/CheckboxInput/index.d.ts +1 -1
  33. package/dist/CheckboxInput/index.js +1 -1
  34. package/dist/{CheckboxInput-BGqRMoEA.js → CheckboxInput-Cr0qhZpZ.js} +2 -2
  35. package/dist/CheckboxList/index.d.ts +1 -1
  36. package/dist/CheckboxList/index.js +1 -1
  37. package/dist/{CheckboxList-DbMhC06M.js → CheckboxList-DOAdqkXD.js} +4 -4
  38. package/dist/ClickableCard/index.d.ts +1 -1
  39. package/dist/Code/index.d.ts +1 -1
  40. package/dist/Code/index.js +1 -1
  41. package/dist/{CodeBlock-DAlWY51H.js → CodeBlock-CuNiGAhQ.js} +1 -1
  42. package/dist/Collapsible/index.d.ts +1 -1
  43. package/dist/CommandPalette/index.js +1 -1
  44. package/dist/{CommandPalette-DYk_FyFB.js → CommandPalette-DU4VBuWx.js} +1 -1
  45. package/dist/ComplexSelector/index.js +1 -1
  46. package/dist/{ComplexSelector-NDpRucQB.js → ComplexSelector-CdeoaX2o.js} +3 -3
  47. package/dist/ContextMenu/index.d.ts +1 -1
  48. package/dist/ContextMenu/index.js +1 -1
  49. package/dist/{ContextMenu-JDU4HDKm.js → ContextMenu-Cw34CTey.js} +5 -5
  50. package/dist/DateInput/index.d.ts +2 -2
  51. package/dist/DateInput/index.js +1 -1
  52. package/dist/{DateInput-DVEb1-fM.js → DateInput-vxaVpM2X.js} +562 -123
  53. package/dist/DateRangeInput/index.d.ts +1 -1
  54. package/dist/DateRangeInput/index.js +1 -1
  55. package/dist/{DateRangeInput-OuAz80nR.js → DateRangeInput-X5VDZkfk.js} +14 -11
  56. package/dist/DateTimeInput/index.d.ts +1 -1
  57. package/dist/DateTimeInput/index.js +1 -1
  58. package/dist/{DateTimeInput-J5CFTSSa.js → DateTimeInput-B8HeL3dk.js} +19 -11
  59. package/dist/Dialog/index.d.ts +1 -1
  60. package/dist/Dialog/index.js +3 -3
  61. package/dist/{Dialog-C0WuGDqP.js → Dialog-CprMsTku.js} +3 -3
  62. package/dist/{Dialog-Cm8CXGpI.js → Dialog-DCsuevxA.js} +1 -1
  63. package/dist/{DialogHeader-BD2Ezw4F.js → DialogHeader-DyMQBW1_.js} +2 -2
  64. package/dist/Divider/index.d.ts +1 -1
  65. package/dist/Drawer/index.d.ts +1 -1
  66. package/dist/Drawer/index.js +1 -1
  67. package/dist/{Drawer-CFpcRHt7.js → Drawer-BkFF7krL.js} +2 -2
  68. package/dist/DropdownMenu/index.js +2 -2
  69. package/dist/{DropdownMenu-2QRvY0aP.js → DropdownMenu-DEEcKIHY.js} +6 -6
  70. package/dist/{DropdownMenu-5Mn01A-5.js → DropdownMenu-Dt88fMAT.js} +3 -3
  71. package/dist/EmptyState/index.js +1 -1
  72. package/dist/{EmptyState-CqUTEnGg.js → EmptyState-BS8ESteS.js} +2 -2
  73. package/dist/Field/index.js +3 -3
  74. package/dist/{Field-Cw8J8ld7.js → Field-Dxacpe9d.js} +2 -2
  75. package/dist/{FieldInfoTip-D7UNDNje.js → FieldInfoTip-DS4OAl2Q.js} +1 -1
  76. package/dist/{FieldLabel-CJbiefUx.js → FieldLabel-DjzTYhCM.js} +2 -2
  77. package/dist/FileInput/index.d.ts +1 -1
  78. package/dist/FileInput/index.js +1 -1
  79. package/dist/{FileInput-CgfiwVfs.js → FileInput-Dak2gIXU.js} +3 -3
  80. package/dist/FormLayout/index.d.ts +2 -2
  81. package/dist/FormLayout/index.js +1 -1
  82. package/dist/{FormLayout-B9dUB6Ps.js → FormLayout-CGJVeNsL.js} +5 -3
  83. package/dist/Heading/index.d.ts +1 -1
  84. package/dist/Heading/index.js +1 -1
  85. package/dist/{Heading-BO9n2vLl.js → Heading-BYB7QXkT.js} +1 -1
  86. package/dist/HoverCard/index.d.ts +1 -1
  87. package/dist/HoverCard/index.js +1 -1
  88. package/dist/{HoverCard-47J_i9AH.js → HoverCard-CtDr234t.js} +4 -4
  89. package/dist/IconButton/index.js +1 -1
  90. package/dist/{IconButton-DiDHiGbo.js → IconButton-DvgueAEp.js} +1 -1
  91. package/dist/InfoTip/index.d.ts +1 -1
  92. package/dist/InfoTip/index.js +1 -1
  93. package/dist/{InfoTip-ClRC1Hh9.js → InfoTip-DshbO5eW.js} +1 -1
  94. package/dist/{InputClearButton-DL4RM5z1.js → InputClearButton-DEb-bGsY.js} +1 -1
  95. package/dist/InputGroup/index.js +1 -1
  96. package/dist/{InputGroup-JMOrdsmu.js → InputGroup-DLu11Lsd.js} +1 -1
  97. package/dist/InternationalizationProvider/index.d.ts +1 -1
  98. package/dist/InternationalizationProvider/index.js +1 -1
  99. package/dist/{InternationalizationProvider-BYU2MRtX.js → InternationalizationProvider-CqCxB9ku.js} +1 -1
  100. package/dist/{LayerContentBoundary-CeebKoPB.js → LayerContentBoundary-Cx5xXZzg.js} +1 -1
  101. package/dist/Lightbox/index.js +1 -1
  102. package/dist/{Lightbox-kKjxYZ05.js → Lightbox-f_0_73Zi.js} +3 -3
  103. package/dist/Link/index.d.ts +1 -1
  104. package/dist/Link/index.js +1 -1
  105. package/dist/{Link-CkbAlJ3-.js → Link-CFxZ9W2X.js} +1 -1
  106. package/dist/List/index.d.ts +1 -1
  107. package/dist/Markdown/index.js +1 -1
  108. package/dist/{Markdown-DXRFVNJd.js → Markdown-DTqTIKbq.js} +3 -3
  109. package/dist/MobileNav/index.js +1 -1
  110. package/dist/{MobileNavToggle-DUtvvHc7.js → MobileNavToggle-D_J_uTW-.js} +3 -3
  111. package/dist/MoreMenu/index.d.ts +1 -1
  112. package/dist/MoreMenu/index.js +1 -1
  113. package/dist/{MoreMenu-CEJ9E2eD.js → MoreMenu-BY1t1_QA.js} +4 -4
  114. package/dist/MultiSelector/index.d.ts +1 -1
  115. package/dist/MultiSelector/index.js +1 -1
  116. package/dist/{MultiSelector-DgWCWpnM.js → MultiSelector-BmdODQAC.js} +8 -7
  117. package/dist/{NavDisclosure-Bf5OFtwv.js → NavDisclosure-mXBWmRDC.js} +1 -1
  118. package/dist/{NavHeadingSurface-D5MpO-gO.js → NavHeadingSurface-foJo5bLT.js} +1 -1
  119. package/dist/NavItem/index.d.ts +1 -1
  120. package/dist/NavMenu/index.js +3 -3
  121. package/dist/{NavMenu-BcmUfk7z.js → NavMenu-CG9Bthba.js} +2 -2
  122. package/dist/{NavMenuItem-C9xk9KZk.js → NavMenuItem-BiFZUPxC.js} +1 -1
  123. package/dist/NumberInput/index.d.ts +1 -1
  124. package/dist/NumberInput/index.js +1 -1
  125. package/dist/{NumberInput-DNcE_HLD.js → NumberInput-BDNiEgzf.js} +5 -5
  126. package/dist/OverflowList/index.d.ts +1 -1
  127. package/dist/OverflowList/index.js +1 -1
  128. package/dist/{OverflowList-CeQT7MBd.js → OverflowList-CR96Nr5t.js} +2 -2
  129. package/dist/Overlay/index.d.ts +1 -1
  130. package/dist/Pagination/index.d.ts +1 -1
  131. package/dist/Pagination/index.js +1 -1
  132. package/dist/{Pagination-DJGQe6wH.js → Pagination-CA3yJwyk.js} +1 -1
  133. package/dist/{PickerWheel-CSwUYfes.js → PickerWheel-DNX3yrUd.js} +21 -8
  134. package/dist/Popover/index.d.ts +1 -1
  135. package/dist/Popover/index.js +1 -1
  136. package/dist/{Popover-C68nCirC.js → Popover-Mj71LwjH.js} +6 -6
  137. package/dist/PowerSearch/index.js +1 -1
  138. package/dist/{PowerSearch-C6lkutch.js → PowerSearch-CajkGExd.js} +18 -18
  139. package/dist/ProgressBar/index.d.ts +1 -1
  140. package/dist/ProgressBar/index.js +1 -1
  141. package/dist/{ProgressBar-MaDhabCm.js → ProgressBar-sGSCEtHC.js} +1 -1
  142. package/dist/Radio/index.d.ts +1 -1
  143. package/dist/Radio/index.js +1 -1
  144. package/dist/{RadioGroup-CLQLK_V7.js → RadioGroup-D58Fy-bM.js} +3 -3
  145. package/dist/RadioList/index.d.ts +1 -1
  146. package/dist/RadioList/index.js +1 -1
  147. package/dist/{RadioList-DfHTyqIQ.js → RadioList-u9PoRBXY.js} +1 -1
  148. package/dist/Resizable/index.d.ts +1 -1
  149. package/dist/ScrollableArea/index.d.ts +1 -1
  150. package/dist/SelectableCard/index.d.ts +1 -1
  151. package/dist/Selector/index.d.ts +1 -1
  152. package/dist/Selector/index.js +1 -1
  153. package/dist/{Selector-CPCoJ7Sb.js → Selector-jA_SESFs.js} +7 -6
  154. package/dist/SideNav/index.d.ts +1 -1
  155. package/dist/SideNav/index.js +1 -1
  156. package/dist/{SideNav-CV8MKVL-.js → SideNav-BgmpUELq.js} +5 -5
  157. package/dist/Slider/index.js +1 -1
  158. package/dist/{Slider-CHJ1CESd.js → Slider-Depy9L-Y.js} +2 -2
  159. package/dist/Stack/index.d.ts +1 -1
  160. package/dist/StatusDot/index.js +1 -1
  161. package/dist/{StatusDot-CGaRrl39.js → StatusDot-D0Wy2ggp.js} +1 -1
  162. package/dist/Switch/index.d.ts +1 -1
  163. package/dist/Switch/index.js +1 -1
  164. package/dist/{Switch-Bx9ezhrN.js → Switch-dD4OQLkI.js} +2 -2
  165. package/dist/TabList/index.d.ts +1 -1
  166. package/dist/TabList/index.js +1 -1
  167. package/dist/{TabList-o4t9vWvl.js → TabList-CoiyQidC.js} +1 -1
  168. package/dist/Table/index.d.ts +1 -1
  169. package/dist/Table/index.js +1 -1
  170. package/dist/{Table-CO2cYE8r.js → Table-Cb0ec1PS.js} +12 -12
  171. package/dist/Text/index.d.ts +1 -1
  172. package/dist/Text/index.js +1 -1
  173. package/dist/{Text-C6SB2hHJ.js → Text-BWSmB93V.js} +1 -1
  174. package/dist/TextArea/index.d.ts +1 -1
  175. package/dist/TextArea/index.js +1 -1
  176. package/dist/{TextArea-DVaDS_1K.js → TextArea-CbY2w_ic.js} +6 -6
  177. package/dist/TextInput/index.d.ts +1 -1
  178. package/dist/TextInput/index.js +1 -1
  179. package/dist/{TextInput-Dylfzj33.js → TextInput-C8f89GV8.js} +6 -6
  180. package/dist/Thumbnail/index.js +1 -1
  181. package/dist/{Thumbnail-BTQAYnWi.js → Thumbnail-DENhXd9-.js} +2 -2
  182. package/dist/{TimeField-B3JGgLuf.js → TimeField-DcZ9wYGn.js} +8 -8
  183. package/dist/TimeInput/index.d.ts +1 -1
  184. package/dist/TimeInput/index.js +1 -1
  185. package/dist/{TimeInput-Dmy6PxaD.js → TimeInput-DyiU7_IA.js} +3 -3
  186. package/dist/Timer/index.js +1 -1
  187. package/dist/{Timer-CN5BmaFS.js → Timer-CgBSMr9E.js} +1 -1
  188. package/dist/Timestamp/index.d.ts +1 -1
  189. package/dist/Timestamp/index.js +1 -1
  190. package/dist/{Timestamp-B7UcCEo2.js → Timestamp-B-VgG6l8.js} +3 -3
  191. package/dist/Toast/index.js +1 -1
  192. package/dist/{Toast-DCipbbCW.js → Toast-CRSZV9K-.js} +1 -1
  193. package/dist/ToggleButton/index.d.ts +1 -1
  194. package/dist/ToggleButton/index.js +1 -1
  195. package/dist/{ToggleButton-C78lrcdr.js → ToggleButton-Bm5IQUy5.js} +1 -1
  196. package/dist/Token/index.d.ts +1 -1
  197. package/dist/Tokenizer/index.d.ts +1 -1
  198. package/dist/Tokenizer/index.js +1 -1
  199. package/dist/{Tokenizer-D7B1ff3O.js → Tokenizer-DmjNQLDl.js} +6 -6
  200. package/dist/Toolbar/index.d.ts +1 -1
  201. package/dist/Tooltip/index.d.ts +1 -1
  202. package/dist/Tooltip/index.js +2 -2
  203. package/dist/{Tooltip-kQPfj3SE.js → Tooltip-BwrJVZ8X.js} +1 -1
  204. package/dist/TopNav/index.d.ts +1 -1
  205. package/dist/TopNav/index.js +1 -1
  206. package/dist/{TopNav-AGY785QI.js → TopNav-C3gyHUVv.js} +4 -4
  207. package/dist/TreeList/index.d.ts +1 -1
  208. package/dist/Typeahead/index.d.ts +1 -1
  209. package/dist/Typeahead/index.js +2 -2
  210. package/dist/{Typeahead-QWYeVsel.js → Typeahead-LdmEDCOU.js} +6 -6
  211. package/dist/busyAnnouncement-D3eGqdsf.js +88 -0
  212. package/dist/composables/index.d.ts +1 -1
  213. package/dist/composables/index.js +11 -11
  214. package/dist/{composables-CyKB3F8u.js → composables-Bi0Rt0Uj.js} +2 -2
  215. package/dist/{context-Cfml4jaK.js → context-DsNhYm5O.js} +6 -1
  216. package/dist/{date-input-CiEBtStM.js → date-input-rUD8YAow.js} +4 -0
  217. package/dist/{utils-BOmFijPc.js → dateParser-DS_a8Ej8.js} +1 -329
  218. package/dist/{fieldParts-CDOlBdy6.js → fieldParts-CbWvZLhH.js} +1 -1
  219. package/dist/{format-CiN0Dt_H.js → format-CMHyAMn3.js} +28 -1
  220. package/dist/{index-BhxqUt3y.d.ts → index--kbwaSXW.d.ts} +1 -1
  221. package/dist/{index-CL8JvxHW.d.ts → index-B3yTdknp.d.ts} +1 -1
  222. package/dist/{index-bgjrSSaT.d.ts → index-B449gOMC.d.ts} +3 -3
  223. package/dist/{index-BuubzuE8.d.ts → index-BDZCJ9ri.d.ts} +2 -2
  224. package/dist/{index-D7YRtteD.d.ts → index-BHYhTZzp.d.ts} +1 -1
  225. package/dist/{index-ZbNwGVkS.d.ts → index-BKnyTWPM.d.ts} +1 -1
  226. package/dist/{index-CVs4A2QU.d.ts → index-BPymttXR.d.ts} +1 -0
  227. package/dist/{index-Dep8pgnU.d.ts → index-BbXwtkv6.d.ts} +3 -3
  228. package/dist/{index-BB9acgK8.d.ts → index-BgT6mH3U.d.ts} +1 -1
  229. package/dist/{index-CREW8ZiL.d.ts → index-C5VJoanX.d.ts} +3 -3
  230. package/dist/{index-D05JGsT3.d.ts → index-C8wfe0Mr.d.ts} +1 -1
  231. package/dist/{index-ul1hNxih.d.ts → index-CLHJybQY.d.ts} +1 -1
  232. package/dist/{index-Bgk1Rj2A.d.ts → index-CTjkJP4x.d.ts} +1 -1
  233. package/dist/{index-FeZXsFO-.d.ts → index-CbA8rR_b.d.ts} +2 -2
  234. package/dist/{index-YKCx03zD.d.ts → index-CdvmnNMH.d.ts} +1 -1
  235. package/dist/{index-BWaO4-T-.d.ts → index-Cr9uPUc5.d.ts} +101 -55
  236. package/dist/{index-BzViSe8D.d.ts → index-D1J81rYJ.d.ts} +4 -4
  237. package/dist/{index-9YGUb_Ht.d.ts → index-DG7FmGCE.d.ts} +2 -2
  238. package/dist/{index-C90l2rH1.d.ts → index-DcisK4t8.d.ts} +11 -1
  239. package/dist/{index-BpprL2SN.d.ts → index-DfdtDWSP.d.ts} +5 -1
  240. package/dist/{index-CfoExOY_.d.ts → index-Dg0JsBpI.d.ts} +1 -1
  241. package/dist/{index-DS9SzqqJ.d.ts → index-Djf0M7PH.d.ts} +2 -2
  242. package/dist/{index-O9y23OPJ.d.ts → index-DneQgJfI.d.ts} +1 -1
  243. package/dist/{index-Cun6cXGP.d.ts → index-DpYJBFJj.d.ts} +2 -2
  244. package/dist/{index-B1eCxBCY.d.ts → index-TXcNH86P.d.ts} +1 -1
  245. package/dist/{index-Dc9_kBrU.d.ts → index-YfMHAQ_D.d.ts} +2 -2
  246. package/dist/{index-Dlq0cFK-.d.ts → index-dWlCpnua.d.ts} +3 -3
  247. package/dist/{index-DPhQZXYw.d.ts → index-eCp-ElSp.d.ts} +2 -2
  248. package/dist/{index-CtYlR9Cu.d.ts → index-rdwI-mcm.d.ts} +1 -1
  249. package/dist/{index-Bl_K_cRv.d.ts → index-wTwhcFQx.d.ts} +1 -1
  250. package/dist/{index-BEZ4ezJk.d.ts → index-wY6dKz6c.d.ts} +2 -2
  251. package/dist/{index-C89cIh4E.d.ts → index-waTkqxTz.d.ts} +1 -1
  252. package/dist/index.d.ts +36 -36
  253. package/dist/index.js +94 -92
  254. package/dist/{layerDepth-BU_55vPr.js → layerDepth-I6d28O4d.js} +5 -2
  255. package/dist/{layerFocusReturn-DWGkSHXj.js → layerFocusReturn-BrS5RTx6.js} +1 -1
  256. package/dist/{loadCatalog-Kp7aQZpL.d.ts → loadCatalog-Cvf-xgDD.d.ts} +34 -27
  257. package/dist/{loadCatalog-BtQRPyzj.js → loadCatalog-DYuZZRtf.js} +1 -1
  258. package/dist/locale/index.d.ts +2 -2
  259. package/dist/locale/index.js +4 -4
  260. package/dist/{locale-DET_YkFW.js → locale-B-DrJCMs.js} +1 -1
  261. package/dist/{selectorEscape-LkWoVYQN.js → selectorEscape-FjiU_5WC.js} +3 -16
  262. package/dist/{stillPointerGate-BZ7KMJOB.js → stillPointerGate-DlAU_J_M.js} +1 -1
  263. package/dist/timeParser-D9tCF_b3.js +203 -0
  264. package/dist/{useDismiss-74dLMi5S.js → useDismiss-21Gk7uWk.js} +1 -1
  265. package/dist/{useFocusTrap-CyooA0OC.js → useFocusTrap-BFQ7Goue.js} +1 -1
  266. package/dist/{useHoverLayerDismiss-B1W5qIBx.js → useHoverLayerDismiss-Chfty2wT.js} +1 -1
  267. package/dist/{useInputStatusIcon-ZqCxDNTj.js → useInputStatusIcon-Yd0hvw5K.js} +1 -1
  268. package/dist/{useLayer-BnjrJ85F.js → useLayer-vK4-yRk_.js} +1 -1
  269. package/dist/{useMenuPress-BWq7kwWm.js → useMenuPress-9vsHzbRX.js} +1 -1
  270. package/dist/{useResizable-De4Xp3TD.js → useResizable-DYlc06-H.js} +1 -1
  271. package/dist/{useRestoreFocus-CSrI8x7v.js → useRestoreFocus-BhcXCJwM.js} +1 -1
  272. package/dist/useTimeValue-_XW9g2V1.js +52 -0
  273. package/dist/{useTooltip-uc-VLZ8I.js → useTooltip-DIg3ZE9P.js} +4 -4
  274. package/dist/{useTouchTriggerInternal-b-txblws.js → useTouchTriggerInternal-CrLW-7kT.js} +1 -1
  275. package/dist/{useTruncationTooltip-BVMCoNno.js → useTruncationTooltip-D9_lzxpF.js} +2 -2
  276. package/dist/{useTypeahead-BWj3xhbR.js → useTypeahead-CiLt-yEg.js} +1 -1
  277. package/dist/{useTypeaheadAnnouncement-DVkdWTWy.js → useTypeaheadAnnouncement-C59m2nSx.js} +1 -1
  278. package/dist/utils/index.js +3 -1
  279. package/dist/utils-BW62BpDR.js +135 -0
  280. package/package.json +1 -1
  281. package/styles/date-input.css +45 -3
  282. package/styles/date-range-input.css +7 -0
  283. package/styles/time-input.css +7 -0
  284. package/dist/useTimeValue-BJd0xBhG.js +0 -95
  285. package/dist/{index-J6YRJ7Ul.d.ts → index-CHx33xGa.d.ts} +1 -1
@@ -1,8 +1,8 @@
1
- import { n as _sfc_main$4 } from "./BottomSheet-D67lQ3Lo.js";
1
+ import { n as _sfc_main$4 } from "./BottomSheet-CFrcT1Lr.js";
2
2
  import { t as _sfc_main$5 } from "./Icon-BCHo7W0x.js";
3
3
  import { r as useInputGroupDisabled } from "./context-Bg7eSJ47.js";
4
4
  import { i as useSize } from "./SizeContext-BbaF-SEx.js";
5
- import { o as isImeKeyEvent } from "./layerDepth-BU_55vPr.js";
5
+ import { a as noteOutsideDismissal, c as currentGesture, s as isImeKeyEvent } from "./layerDepth-I6d28O4d.js";
6
6
  import { t as _sfc_main$6 } from "./VisuallyHidden-cpmsV-0M.js";
7
7
  import { t as _sfc_main$7 } from "./ButtonTooltip-CNKOQHYR.js";
8
8
  import { t as useButtonTooltip } from "./useButtonTooltip-DjCaZMp_.js";
@@ -12,25 +12,140 @@ import { t as _sfc_main$8 } from "./FieldIcon-DMtfe1Ne.js";
12
12
  import { a as useAstryxLocale, o as useComponentMessages } from "./context-B8IEFCDR.js";
13
13
  import { t as usePendingChange } from "./usePendingChange-ib-h8FZK.js";
14
14
  import { t as useResolvedLabelHidden } from "./useResolvedLabelHidden-B2rlWiaI.js";
15
- import { n as standaloneShortWeekdayNames, r as weekdayNames, t as formatCalendarMonth } from "./format-CiN0Dt_H.js";
15
+ import { n as standaloneShortWeekdayNames, r as weekdayNames, t as formatCalendarMonth } from "./format-CMHyAMn3.js";
16
16
  import { t as calendarMessages } from "./calendar-Cs2vIPsV.js";
17
- import { a as isOutsideCalendarBounds, c as toCalendarDate, i as isCalendarDateDisabled, l as weekStartIndex, n as resolveCalendarKey, o as formatWeekdayDate, r as buildCalendarWeeks, s as sameCalendarDay, t as _sfc_main$9 } from "./Calendar-DwFAzDky.js";
17
+ import { a as isOutsideCalendarBounds, c as toCalendarDate, i as isCalendarDateDisabled, l as weekStartIndex, n as resolveCalendarKey, o as formatWeekdayDate, r as buildCalendarWeeks, s as sameCalendarDay, t as _sfc_main$9 } from "./Calendar-D029GXOJ.js";
18
18
  import { t as _sfc_main$10 } from "./Spinner-DEVPDsD0.js";
19
- import { i as useAriaRequired } from "./context-Cfml4jaK.js";
20
- import { t as _sfc_main$11 } from "./Field-Cw8J8ld7.js";
21
- import { t as useFieldPartStyling } from "./fieldParts-CDOlBdy6.js";
22
- import { t as _sfc_main$12 } from "./Popover-C68nCirC.js";
23
- import { t as dateInputMessages } from "./date-input-CiEBtStM.js";
19
+ import { a as useEntryErrorBehavior, i as useAriaRequired } from "./context-DsNhYm5O.js";
20
+ import { t as _sfc_main$11 } from "./Field-Dxacpe9d.js";
21
+ import { t as useFieldPartStyling } from "./fieldParts-CbWvZLhH.js";
22
+ import { t as _sfc_main$12 } from "./Popover-Mj71LwjH.js";
23
+ import { t as useBusyAnnouncement } from "./busyAnnouncement-D3eGqdsf.js";
24
+ import { t as dateInputMessages } from "./date-input-rUD8YAow.js";
24
25
  import { t as formatInstant } from "./formatInstant-BDWUIxS7.js";
25
- import { t as _sfc_main$13 } from "./PickerWheel-CSwUYfes.js";
26
- import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, mergeProps, normalizeClass, normalizeStyle, onBeforeUnmount, onMounted, openBlock, ref, renderList, renderSlot, resolveDynamicComponent, shallowRef, toDisplayString, unref, useAttrs, useId, useTemplateRef, watch, withCtx } from "vue";
26
+ import { P as plainDateToDate, n as parseDateInput } from "./dateParser-DS_a8Ej8.js";
27
+ import { t as _sfc_main$13 } from "./PickerWheel-DNX3yrUd.js";
28
+ import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, getCurrentInstance, mergeProps, nextTick, normalizeClass, normalizeStyle, onBeforeUnmount, onMounted, onScopeDispose, openBlock, ref, renderList, renderSlot, resolveDynamicComponent, shallowRef, toDisplayString, unref, useAttrs, useId, useTemplateRef, watch, withCtx } from "vue";
27
29
  import { CalendarDate } from "@internationalized/date";
28
30
  import "../styles/calendar.css";
29
31
  import "../styles/date-input.css";
32
+ //#region src/DateInput/dateText.ts
33
+ /** 本地日期写成 `YYYY-MM-DD`。 */
34
+ function toIsoDate(date) {
35
+ return `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, "0")}-${String(date.getDate()).padStart(2, "0")}`;
36
+ }
37
+ /** 读 `YYYY-M-D` 形式的文字。不是真实存在的日子就返回 `null`。 */
38
+ function parseTypedDate(text) {
39
+ const match = text.trim().match(/^(\d{4})-(\d{1,2})-(\d{1,2})$/);
40
+ if (!match) return null;
41
+ const [, year, month, day] = match;
42
+ const date = new Date(Number(year), Number(month) - 1, Number(day));
43
+ if (Number.isNaN(date.getTime()) || date.getFullYear() !== Number(year) || date.getMonth() !== Number(month) - 1 || date.getDate() !== Number(day)) return null;
44
+ return date;
45
+ }
46
+ /** 已提交日期的显示文字。 */
47
+ function formatCommittedDate(date, format, locale) {
48
+ if (!date) return "";
49
+ const iso = toIsoDate(date);
50
+ if (typeof format === "function") return format(iso);
51
+ if (format === "system_date") return iso;
52
+ return formatInstant(date, format ?? "date_long", locale);
53
+ }
54
+ /** 把字符串写法的状态展开成 `{ type }`,`default` 当作没有状态。 */
55
+ function resolveDateStatus(status) {
56
+ if (status == null || status === "default") return void 0;
57
+ if (typeof status === "string") return { type: status };
58
+ return status;
59
+ }
60
+ //#endregion
61
+ //#region src/DateInput/dateEntry.ts
62
+ const ISO_DATE = /^(\d{4})-(\d{1,2})-(\d{1,2})$/;
63
+ const ISO_PREFIX = /^\d{1,4}(?:-(?:\d{1,2}(?:-\d?)?)?)?$/;
64
+ /**
65
+ * 读打进来的文字。`YYYY-M-D` 打完整(日子是两位,或者一位但不会再变)就算完整;
66
+ * 还能接着打的 ISO 前缀算半截;其余文字交给 `parseDateInput`,读出来的日子只在 Enter 或失焦时提交。
67
+ */
68
+ function parseDateEntry(text, locale, isBlocked) {
69
+ const trimmed = text.trim();
70
+ const iso = ISO_DATE.exec(trimmed);
71
+ if (iso) {
72
+ const year = Number(iso[1]);
73
+ const month = Number(iso[2]);
74
+ const day = Number(iso[3]);
75
+ if (month < 1 || month > 12 || day < 1 || day > 31) return { kind: "unreadable" };
76
+ const date = new Date(year, month - 1, day);
77
+ date.setFullYear(year);
78
+ const isComplete = iso[3].length === 2 || day > 3;
79
+ if (date.getMonth() !== month - 1 || date.getDate() !== day) return isComplete ? { kind: "nonexistent" } : { kind: "incomplete" };
80
+ return {
81
+ kind: isBlocked(date) ? "outOfRange" : "value",
82
+ date,
83
+ isComplete
84
+ };
85
+ }
86
+ if (ISO_PREFIX.test(trimmed)) return { kind: "incomplete" };
87
+ const loose = parseDateInput(trimmed, locale);
88
+ if (loose == null) return { kind: "unreadable" };
89
+ const date = plainDateToDate(loose);
90
+ return {
91
+ kind: isBlocked(date) ? "outOfRange" : "value",
92
+ date,
93
+ isComplete: false
94
+ };
95
+ }
96
+ /**
97
+ * 一个结果此刻亮出来的拒绝:Enter 或失焦提交过的文字的错,
98
+ * 或者在 `complete` 下一个已经打完整的日子的错。读不成日期的文字永远不完整,所以等提交。
99
+ */
100
+ function dateEntryErrorKind(result, isCommitted, behavior) {
101
+ if (result == null) return null;
102
+ if ((result.kind === "unreadable" || result.kind === "incomplete") && isCommitted) return "unreadable";
103
+ if (result.kind === "nonexistent" && (isCommitted || behavior === "complete")) return "nonexistent";
104
+ if (result.kind === "outOfRange" && (isCommitted || result.isComplete && behavior === "complete")) return "outOfRange";
105
+ return null;
106
+ }
107
+ /** 这个结果是不是打字就会提交的日子,它会结束一个亮着的拒绝。 */
108
+ function isAcceptedEntry(result) {
109
+ return result.kind === "value" && result.isComplete;
110
+ }
111
+ function dayOf(date) {
112
+ return date.getFullYear() * 1e4 + date.getMonth() * 100 + date.getDate();
113
+ }
114
+ function isOutsideBounds(date, bounds) {
115
+ return bounds.min != null && dayOf(date) < dayOf(bounds.min) || bounds.max != null && dayOf(date) > dayOf(bounds.max);
116
+ }
117
+ /** 报给调用方的拒绝。 */
118
+ function toEntryError(result, text, bounds) {
119
+ if (result.kind === "incomplete" || result.kind === "unreadable" || result.kind === "nonexistent") return {
120
+ kind: result.kind,
121
+ text
122
+ };
123
+ return {
124
+ kind: result.kind === "outOfRange" && isOutsideBounds(result.date, bounds) ? "outOfRange" : "unavailable",
125
+ text,
126
+ date: toIsoDate(result.date)
127
+ };
128
+ }
129
+ /** 拒绝时字段下方显示的那句话。边界日期按字段的显示格式写,自定义格式函数时用长日期。 */
130
+ function dateEntryMessage(result, bounds, format, locale, messages) {
131
+ if (result.kind === "nonexistent") return messages.nonexistentDate;
132
+ if (result.kind === "outOfRange" || result.kind === "value") {
133
+ const boundFormat = typeof format === "function" ? "date_long" : format;
134
+ const write = (date) => date ? formatCommittedDate(date, boundFormat, locale) : "";
135
+ const which = !isOutsideBounds(result.date, bounds) ? "other" : bounds.min != null && bounds.max != null ? "both" : bounds.min != null ? "min" : "max";
136
+ return messages.outOfRangeDate(which, write(bounds.min), write(bounds.max));
137
+ }
138
+ return messages.invalidDate;
139
+ }
140
+ function sameEntryError(a, b) {
141
+ return a === b || a != null && b != null && a.kind === b.kind && a.text === b.text && a.date === b.date;
142
+ }
143
+ //#endregion
30
144
  //#region src/DateInput/NativeDateField.vue
31
145
  const _hoisted_1$3 = ["data-status"];
32
146
  const _hoisted_2$3 = [
33
147
  "data-disabled",
148
+ "data-busy",
34
149
  "data-size",
35
150
  "data-status"
36
151
  ];
@@ -132,7 +247,8 @@ const _sfc_main$3 = /*@__PURE__*/ defineComponent({
132
247
  String,
133
248
  Object,
134
249
  Array
135
- ] }
250
+ ] },
251
+ hasEntryErrorListener: { type: Boolean }
136
252
  },
137
253
  emits: ["update:modelValue", "change"],
138
254
  setup(__props, { emit: __emit }) {
@@ -145,7 +261,11 @@ const _sfc_main$3 = /*@__PURE__*/ defineComponent({
145
261
  const inputRef = useTemplateRef("input");
146
262
  const containerRef = useTemplateRef("container");
147
263
  const focused = ref(false);
148
- const rejected = ref(false);
264
+ /** 系统控件报上来、字段不收的日子,等 Enter 或失焦再亮出来。 */
265
+ const heldRefusal = ref(null);
266
+ /** Enter 或失焦亮出来的被拒日子。控件恢复成已提交的值后仍然亮着,直到报来能收的日子或清空。 */
267
+ const shownRefusal = ref(null);
268
+ let isRevealing = false;
149
269
  const pending = usePendingChange(() => props.changeAction);
150
270
  const busy = computed(() => props.isLoading || pending.busy.value);
151
271
  const locked = computed(() => props.disabled || busy.value);
@@ -154,11 +274,7 @@ const _sfc_main$3 = /*@__PURE__*/ defineComponent({
154
274
  const showsDisabledMessage = computed(() => locked.value && disabledMessage.value != null);
155
275
  const disabledTooltip = useButtonTooltip(showsDisabledMessage);
156
276
  const showsClear = computed(() => (props.hasClear || props.clearable) && Boolean(props.modelValue) && !locked.value);
157
- function toIso(date) {
158
- const month = String(date.getMonth() + 1).padStart(2, "0");
159
- const day = String(date.getDate()).padStart(2, "0");
160
- return `${date.getFullYear()}-${month}-${day}`;
161
- }
277
+ useBusyAnnouncement(busy, () => messages.value.dateInput.loading, () => containerRef.value);
162
278
  function allowed(date) {
163
279
  return !isCalendarDateDisabled(toCalendarDate(date), {
164
280
  min: props.min,
@@ -167,27 +283,35 @@ const _sfc_main$3 = /*@__PURE__*/ defineComponent({
167
283
  dateConstraints: props.dateConstraints
168
284
  });
169
285
  }
170
- const nativeValue = computed(() => props.modelValue ? toIso(props.modelValue) : "");
171
- const overlay = computed(() => {
172
- if (!props.modelValue) return props.placeholder ?? messages.value.dateInput.placeholder;
173
- const iso = toIso(props.modelValue);
174
- if (typeof props.format === "function") return props.format(iso);
175
- if (props.format === "system_date") return iso;
176
- return formatInstant(props.modelValue, props.format ?? "date_long", locale.value);
286
+ const nativeValue = computed(() => props.modelValue ? toIsoDate(props.modelValue) : "");
287
+ const overlay = computed(() => props.modelValue ? formatCommittedDate(props.modelValue, props.format, locale.value) : props.placeholder ?? messages.value.dateInput.placeholder);
288
+ const refusalMessage = computed(() => !locked.value && shownRefusal.value ? dateEntryMessage({
289
+ kind: "outOfRange",
290
+ date: shownRefusal.value,
291
+ isComplete: true
292
+ }, {
293
+ min: props.min,
294
+ max: props.max
295
+ }, props.format, locale.value, messages.value.dateInput) : null);
296
+ const callerError = computed(() => {
297
+ const status = resolveDateStatus(props.status);
298
+ return props.hasEntryErrorListener && status?.type === "error" && status.message ? status.message : null;
177
299
  });
178
- const statusType = computed(() => {
179
- const status = props.status;
180
- if (status == null || status === "default") return void 0;
181
- return typeof status === "string" ? status : status.type;
300
+ const statusValue = computed(() => refusalMessage.value != null && callerError.value == null ? {
301
+ type: "error",
302
+ message: refusalMessage.value
303
+ } : resolveDateStatus(props.status));
304
+ const statusType = computed(() => statusValue.value?.type);
305
+ const repeat = ref(null);
306
+ watch(() => refusalMessage.value != null, (rejected) => {
307
+ repeat.value = rejected ? callerError.value : null;
182
308
  });
183
- const statusValue = computed(() => {
184
- const status = props.status;
185
- if (status == null || status === "default") return void 0;
186
- if (typeof status === "string") return { type: status };
187
- return status;
309
+ watch(callerError, (next) => {
310
+ if (repeat.value !== null && repeat.value !== next) repeat.value = null;
188
311
  });
189
- const minIso = computed(() => props.min ? toIso(props.min) : void 0);
190
- const maxIso = computed(() => props.max ? toIso(props.max) : void 0);
312
+ const alertMessage = computed(() => refusalMessage.value != null && repeat.value != null && repeat.value === callerError.value ? repeat.value : "");
313
+ const minIso = computed(() => props.min ? toIsoDate(props.min) : void 0);
314
+ const maxIso = computed(() => props.max ? toIsoDate(props.max) : void 0);
191
315
  function write(value) {
192
316
  const input = inputRef.value;
193
317
  if (input && input.value !== value) input.value = value;
@@ -201,7 +325,8 @@ const _sfc_main$3 = /*@__PURE__*/ defineComponent({
201
325
  function read(raw) {
202
326
  if (locked.value) return;
203
327
  if (!raw) {
204
- rejected.value = false;
328
+ heldRefusal.value = null;
329
+ shownRefusal.value = null;
205
330
  if (props.modelValue) commit(null);
206
331
  return;
207
332
  }
@@ -209,11 +334,12 @@ const _sfc_main$3 = /*@__PURE__*/ defineComponent({
209
334
  if (!match) return;
210
335
  const date = new Date(Number(match[1]), Number(match[2]) - 1, Number(match[3]));
211
336
  if (!allowed(date)) {
212
- rejected.value = true;
337
+ heldRefusal.value = date;
213
338
  return;
214
339
  }
215
- rejected.value = false;
216
- if (!props.modelValue || toIso(props.modelValue) !== raw) commit(date);
340
+ heldRefusal.value = null;
341
+ shownRefusal.value = null;
342
+ if (!props.modelValue || toIsoDate(props.modelValue) !== raw) commit(date);
217
343
  }
218
344
  function onNative() {
219
345
  read(inputRef.value?.value ?? "");
@@ -221,12 +347,25 @@ const _sfc_main$3 = /*@__PURE__*/ defineComponent({
221
347
  function onFocus() {
222
348
  focused.value = true;
223
349
  }
350
+ /** Enter 或失焦:亮出压着的被拒日子。 */
351
+ function revealRefusal() {
352
+ if (locked.value || heldRefusal.value == null) return;
353
+ shownRefusal.value = heldRefusal.value;
354
+ heldRefusal.value = null;
355
+ isRevealing = true;
356
+ nextTick(() => {
357
+ isRevealing = false;
358
+ });
359
+ }
224
360
  function onBlur() {
225
361
  focused.value = false;
226
- rejected.value = false;
227
362
  read(inputRef.value?.value ?? "");
363
+ revealRefusal();
228
364
  write(nativeValue.value);
229
365
  }
366
+ function onKeydown(event) {
367
+ if (event.key === "Enter") revealRefusal();
368
+ }
230
369
  function onInputFocus(event) {
231
370
  onFocus();
232
371
  disabledTooltip.onFocus(event);
@@ -261,6 +400,10 @@ const _sfc_main$3 = /*@__PURE__*/ defineComponent({
261
400
  input?.removeEventListener("change", onNative);
262
401
  });
263
402
  watch(nativeValue, (value) => {
403
+ if (!isRevealing) {
404
+ heldRefusal.value = null;
405
+ shownRefusal.value = null;
406
+ }
264
407
  if (!focused.value) write(value);
265
408
  });
266
409
  return (_ctx, _cache) => {
@@ -295,7 +438,8 @@ const _sfc_main$3 = /*@__PURE__*/ defineComponent({
295
438
  onPointerleave: _cache[1] || (_cache[1] = (...args) => unref(disabledTooltip).onPointerLeave && unref(disabledTooltip).onPointerLeave(...args))
296
439
  }, [createElementVNode("div", {
297
440
  class: "astryx-date-input-wrapper",
298
- "data-disabled": locked.value ? "true" : void 0,
441
+ "data-disabled": __props.disabled ? "true" : void 0,
442
+ "data-busy": busy.value || void 0,
299
443
  "data-size": __props.size,
300
444
  "data-status": statusType.value
301
445
  }, [
@@ -328,12 +472,13 @@ const _sfc_main$3 = /*@__PURE__*/ defineComponent({
328
472
  showsDisabledMessage.value ? disabledMessageId : void 0
329
473
  ].filter(Boolean).join(" ") || void 0,
330
474
  "aria-disabled": locked.value || void 0,
331
- "aria-invalid": statusType.value === "error" || rejected.value ? "true" : void 0,
475
+ "aria-invalid": statusType.value === "error" ? "true" : void 0,
332
476
  "aria-required": unref(ariaRequired),
333
477
  "aria-busy": busy.value || void 0,
334
478
  autocomplete: "off",
335
479
  onFocus: onInputFocus,
336
- onBlur: onInputBlur
480
+ onBlur: onInputBlur,
481
+ onKeydown
337
482
  }), null, 16, _hoisted_5$3), createElementVNode("span", {
338
483
  class: "astryx-date-input-overlay",
339
484
  "data-placeholder": __props.modelValue ? void 0 : "true",
@@ -353,12 +498,12 @@ const _sfc_main$3 = /*@__PURE__*/ defineComponent({
353
498
  busy.value ? (openBlock(), createBlock(_sfc_main$10, {
354
499
  key: 1,
355
500
  size: "sm",
356
- "aria-label": unref(messages).dateInput.loading
357
- }, null, 8, ["aria-label"])) : statusType.value && __props.statusVariant !== "tooltip" ? (openBlock(), createBlock(_sfc_main$8, {
501
+ "aria-hidden": "true"
502
+ })) : statusType.value && __props.statusVariant !== "tooltip" ? (openBlock(), createBlock(_sfc_main$8, {
358
503
  key: 2,
359
504
  type: statusType.value
360
505
  }, null, 8, ["type"])) : createCommentVNode("v-if", true)
361
- ], 8, _hoisted_2$3), createElementVNode("div", _hoisted_8$2, toDisplayString(rejected.value ? unref(messages).dateInput.invalidDate : ""), 1)], 46, _hoisted_1$3)]),
506
+ ], 8, _hoisted_2$3), createElementVNode("div", _hoisted_8$2, toDisplayString(alertMessage.value), 1)], 46, _hoisted_1$3)]),
362
507
  _: 1
363
508
  }, 8, [
364
509
  "class",
@@ -458,7 +603,8 @@ const _sfc_main$2 = /*@__PURE__*/ defineComponent({
458
603
  max: {},
459
604
  isDateDisabled: { type: Function },
460
605
  dateConstraints: {},
461
- weekStartsOn: {}
606
+ weekStartsOn: {},
607
+ today: {}
462
608
  },
463
609
  emits: ["pick", "update:view"],
464
610
  setup(__props, { emit: __emit }) {
@@ -467,7 +613,7 @@ const _sfc_main$2 = /*@__PURE__*/ defineComponent({
467
613
  const locale = useAstryxLocale();
468
614
  const weekStart = computed(() => weekStartIndex(props.weekStartsOn));
469
615
  const selectedDate = computed(() => props.selected ? toCalendarDate(props.selected) : null);
470
- const today = toCalendarDate(/* @__PURE__ */ new Date());
616
+ const todayDate = computed(() => toCalendarDate(props.today));
471
617
  const focused = shallowRef(new CalendarDate(props.year, props.month, 1));
472
618
  const headers = computed(() => {
473
619
  const shorts = standaloneShortWeekdayNames(locale.value);
@@ -545,14 +691,14 @@ const _sfc_main$2 = /*@__PURE__*/ defineComponent({
545
691
  type: "button",
546
692
  class: normalizeClass(["astryx-calendar-cell", {
547
693
  "is-selected": !!selectedDate.value && !day.outside && unref(sameCalendarDay)(day.date, selectedDate.value),
548
- "is-today": !day.outside && unref(sameCalendarDay)(day.date, unref(today)),
694
+ "is-today": !day.outside && unref(sameCalendarDay)(day.date, todayDate.value),
549
695
  "is-disabled": day.outside || blocked(day.date),
550
696
  "is-other-month": day.outside
551
697
  }]),
552
698
  "data-date": day.iso,
553
699
  tabindex: !day.outside && unref(sameCalendarDay)(day.date, focused.value) ? 0 : -1,
554
700
  "aria-disabled": day.outside || blocked(day.date) || void 0,
555
- "aria-current": !day.outside && unref(sameCalendarDay)(day.date, unref(today)) ? "date" : void 0,
701
+ "aria-current": !day.outside && unref(sameCalendarDay)(day.date, todayDate.value) ? "date" : void 0,
556
702
  "aria-label": unref(formatWeekdayDate)(day.date, unref(locale)),
557
703
  onClick: ($event) => pick(day.date, day.outside)
558
704
  }, [createElementVNode("span", _hoisted_5$2, toDisplayString(day.day), 1)], 10, _hoisted_4$2)]);
@@ -563,7 +709,10 @@ const _sfc_main$2 = /*@__PURE__*/ defineComponent({
563
709
  });
564
710
  //#endregion
565
711
  //#region src/DateInput/TouchDateSheet.vue
566
- const _hoisted_1$1 = { class: "astryx-date-touch" };
712
+ const _hoisted_1$1 = {
713
+ key: 0,
714
+ class: "astryx-date-touch"
715
+ };
567
716
  const _hoisted_2$1 = { class: "astryx-date-touch-header" };
568
717
  const _hoisted_3$1 = ["aria-expanded", "aria-label"];
569
718
  const _hoisted_4$1 = {
@@ -590,6 +739,10 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
590
739
  saveDisabled: {
591
740
  type: Boolean,
592
741
  default: false
742
+ },
743
+ isDisabled: {
744
+ type: Boolean,
745
+ default: false
593
746
  }
594
747
  },
595
748
  emits: [
@@ -607,10 +760,20 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
607
760
  const locale = useAstryxLocale();
608
761
  const wheelsOpen = ref(false);
609
762
  const dragX = ref(null);
610
- const range = computed(() => reachableMonthRange(props.min, props.max));
611
- const initial = props.selected ?? /* @__PURE__ */ new Date();
612
- const view = ref(clampMonthIndex(monthIndex(initial.getFullYear(), initial.getMonth() + 1), range.value.min, range.value.max));
763
+ const coarse = useMediaQuery("(pointer: coarse)");
764
+ const titleRef = useTemplateRef("title");
765
+ const prevRef = useTemplateRef("prev");
766
+ const nextRef = useTemplateRef("next");
767
+ const today = shallowRef(null);
768
+ const range = computed(() => reachableMonthRange(props.min, props.max, today.value ?? void 0));
769
+ const view = ref(0);
613
770
  const cursor = computed(() => fromMonthIndex(view.value));
771
+ onMounted(() => {
772
+ const now = /* @__PURE__ */ new Date();
773
+ const opening = props.selected ?? now;
774
+ today.value = now;
775
+ view.value = clampMonthIndex(monthIndex(opening.getFullYear(), opening.getMonth() + 1), range.value.min, range.value.max);
776
+ });
614
777
  const monthLabel = computed(() => formatCalendarMonth(cursor.value.year, cursor.value.month, locale.value));
615
778
  const resolvedSaveLabel = computed(() => props.saveLabel ?? messages.value.dateInput.savePicking);
616
779
  const rtl = computed(() => typeof document !== "undefined" && document.documentElement.dir === "rtl");
@@ -645,23 +808,66 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
645
808
  }
646
809
  return options;
647
810
  });
811
+ /**
812
+ * 翻到 `target` 月。到了可选范围的头,那一头的箭头会消失,消失的元素会丢掉焦点:
813
+ * 焦点在它上面时,先等另一个箭头画出来,再把焦点交给它;两个箭头都消失就交给月份标题。
814
+ */
815
+ function showMonth(target) {
816
+ const prevHides = target <= range.value.min;
817
+ const nextHides = target >= range.value.max;
818
+ const active = typeof document === "undefined" ? null : document.activeElement;
819
+ const onPrev = prevHides && active != null && active === prevRef.value;
820
+ const onNext = nextHides && active != null && active === nextRef.value;
821
+ view.value = target;
822
+ if (!onPrev && !onNext) return;
823
+ const otherHides = onPrev ? nextHides : prevHides;
824
+ nextTick(() => {
825
+ (otherHides ? titleRef.value : onPrev ? nextRef.value : prevRef.value)?.focus({ preventScroll: true });
826
+ });
827
+ }
648
828
  function move(amount) {
649
- view.value = clampMonthIndex(view.value + amount, range.value.min, range.value.max);
829
+ showMonth(clampMonthIndex(view.value + amount, range.value.min, range.value.max));
830
+ }
831
+ function allowed(date) {
832
+ return !isCalendarDateDisabled(toCalendarDate(date), {
833
+ min: props.min,
834
+ max: props.max,
835
+ isDateDisabled: props.isDateDisabled,
836
+ dateConstraints: props.dateConstraints
837
+ });
838
+ }
839
+ /**
840
+ * 手指下,月份和年份滚轮像 UIDatePicker 一样带着已选日期走:日子不变,
841
+ * 那个月没有这一天就落在月底,再收进最小最大日期之内。约束拒绝的日子不选,只翻日历。
842
+ * 鼠标下滚轮只翻日历。
843
+ */
844
+ function carrySelection(target) {
845
+ const selected = props.selected;
846
+ if (!coarse.value || !selected) return;
847
+ const { year, month } = fromMonthIndex(target);
848
+ const lastDay = new Date(year, month, 0).getDate();
849
+ let date = new Date(year, month - 1, Math.min(selected.getDate(), lastDay));
850
+ if (props.min && date < props.min) date = new Date(props.min.getFullYear(), props.min.getMonth(), props.min.getDate());
851
+ if (props.max && date > props.max) date = new Date(props.max.getFullYear(), props.max.getMonth(), props.max.getDate());
852
+ if (allowed(date) && date.getTime() !== selected.getTime()) emit("pick", date);
650
853
  }
651
854
  function setMonth(value) {
652
855
  const target = monthIndex(cursor.value.year, Number(value));
653
856
  if (target < range.value.min || target > range.value.max) return;
654
857
  view.value = target;
858
+ carrySelection(target);
655
859
  }
656
860
  function setYear(value) {
657
861
  const year = Number(value);
658
862
  const target = clampMonthIndex(monthIndex(year, cursor.value.month), range.value.min, range.value.max);
659
863
  if (fromMonthIndex(target).year !== year) return;
660
864
  view.value = target;
865
+ carrySelection(target);
661
866
  }
662
867
  function onReset() {
663
- const today = /* @__PURE__ */ new Date();
664
- view.value = clampMonthIndex(monthIndex(today.getFullYear(), today.getMonth() + 1), range.value.min, range.value.max);
868
+ if (props.isDisabled) return;
869
+ const now = /* @__PURE__ */ new Date();
870
+ view.value = clampMonthIndex(monthIndex(now.getFullYear(), now.getMonth() + 1), range.value.min, range.value.max);
665
871
  wheelsOpen.value = false;
666
872
  emit("reset");
667
873
  }
@@ -676,11 +882,12 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
676
882
  move((rtl.value ? delta > 0 : delta < 0) ? 1 : -1);
677
883
  }
678
884
  function onView(year, month) {
679
- view.value = clampMonthIndex(monthIndex(year, month), range.value.min, range.value.max);
885
+ showMonth(clampMonthIndex(monthIndex(year, month), range.value.min, range.value.max));
680
886
  }
681
887
  return (_ctx, _cache) => {
682
- return openBlock(), createElementBlock("div", _hoisted_1$1, [
888
+ return today.value ? (openBlock(), createElementBlock("div", _hoisted_1$1, [
683
889
  createElementVNode("div", _hoisted_2$1, [createElementVNode("button", {
890
+ ref: "title",
684
891
  type: "button",
685
892
  class: "astryx-date-touch-title",
686
893
  "aria-expanded": wheelsOpen.value,
@@ -689,6 +896,7 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
689
896
  }, toDisplayString(monthLabel.value), 9, _hoisted_3$1), !wheelsOpen.value ? (openBlock(), createElementBlock("div", _hoisted_4$1, [
690
897
  canPrev.value ? (openBlock(), createElementBlock("button", {
691
898
  key: 0,
899
+ ref: "prev",
692
900
  type: "button",
693
901
  class: "astryx-date-touch-arrow",
694
902
  "aria-label": unref(messages).calendar.previousMonth,
@@ -699,6 +907,7 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
699
907
  }, null, 8, ["icon"])], 8, _hoisted_5$1)) : createCommentVNode("v-if", true),
700
908
  canNext.value ? (openBlock(), createElementBlock("button", {
701
909
  key: 1,
910
+ ref: "next",
702
911
  type: "button",
703
912
  class: "astryx-date-touch-arrow",
704
913
  "aria-label": unref(messages).calendar.nextMonth,
@@ -744,6 +953,7 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
744
953
  "is-date-disabled": __props.isDateDisabled,
745
954
  "date-constraints": __props.dateConstraints,
746
955
  "week-starts-on": __props.weekStartsOn,
956
+ today: today.value,
747
957
  onPick: _cache[3] || (_cache[3] = ($event) => emit("pick", $event)),
748
958
  "onUpdate:view": onView
749
959
  }, null, 8, [
@@ -754,7 +964,8 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
754
964
  "max",
755
965
  "is-date-disabled",
756
966
  "date-constraints",
757
- "week-starts-on"
967
+ "week-starts-on",
968
+ "today"
758
969
  ])], 32)),
759
970
  createElementVNode("button", {
760
971
  type: "button",
@@ -762,15 +973,214 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
762
973
  disabled: !wheelsOpen.value && __props.saveDisabled,
763
974
  onClick: _cache[4] || (_cache[4] = ($event) => wheelsOpen.value ? wheelsOpen.value = false : emit("save"))
764
975
  }, toDisplayString(wheelsOpen.value ? unref(messages).dateInput.doneChoosingMonth : resolvedSaveLabel.value), 9, _hoisted_8$1)
765
- ]);
976
+ ])) : createCommentVNode("v-if", true);
766
977
  };
767
978
  }
768
979
  });
769
980
  //#endregion
981
+ //#region src/DateInput/useCalendarDismiss.ts
982
+ function isLabelFor(target, input) {
983
+ return input != null && target instanceof Element && target.localName === "label" && target.control === input;
984
+ }
985
+ /**
986
+ * 鼠标下的日历弹层什么时候关。
987
+ *
988
+ * 文本输入框不是弹层的触发按钮,交给弹层的「点外面就关」会把按在输入框上的那一下当成外面,
989
+ * 日历关了又被同一下打开。所以这里自己判断:按在字段里(输入框、清除按钮、日历按钮)、
990
+ * 指向输入框的 label 上、或者日历里,日历都保持打开;按在别处才关。
991
+ * 焦点从字段里移到字段和日历之外的地方时也关,下一个字段的日历就不会和它并排开着。
992
+ * 焦点哪儿也没去(切走窗口)时不关。
993
+ * 日历在模态框里被这样关掉时,会登记到手势上,让同一下遮罩按压只关日历、不关模态框。
994
+ */
995
+ function useCalendarDismiss(options) {
996
+ function popupSurface() {
997
+ const popup = options.popup();
998
+ return popup?.closest(".astryx-popover") ?? popup;
999
+ }
1000
+ function isInside(target) {
1001
+ if (!(target instanceof Node)) return false;
1002
+ return Boolean(options.field()?.contains(target) || popupSurface()?.contains(target));
1003
+ }
1004
+ function onPointerDown(event) {
1005
+ const path = event.composedPath();
1006
+ const input = options.input();
1007
+ if (path.some((target) => isInside(target) || isLabelFor(target, input))) return;
1008
+ noteOutsideDismissal();
1009
+ options.close();
1010
+ }
1011
+ let listening = false;
1012
+ function stop() {
1013
+ if (!listening) return;
1014
+ document.removeEventListener("pointerdown", onPointerDown, true);
1015
+ listening = false;
1016
+ }
1017
+ watch(options.isOpen, (open) => {
1018
+ if (typeof document === "undefined") return;
1019
+ if (open && !listening) {
1020
+ currentGesture();
1021
+ document.addEventListener("pointerdown", onPointerDown, true);
1022
+ listening = true;
1023
+ } else if (!open) stop();
1024
+ }, { immediate: true });
1025
+ onScopeDispose(stop);
1026
+ function onFieldFocusOut(event) {
1027
+ const next = event.relatedTarget;
1028
+ if (!options.isOpen.value || next == null || isInside(next)) return;
1029
+ noteOutsideDismissal();
1030
+ options.close();
1031
+ }
1032
+ return { onFieldFocusOut };
1033
+ }
1034
+ //#endregion
1035
+ //#region src/DateInput/useTypedDateEntry.ts
1036
+ /**
1037
+ * 日期文本框的打字状态:显示的文字、拒绝和提交。
1038
+ *
1039
+ * 打字时只在日子打完整、再打也变不了时才提交;读不成日期的文字等 Enter 或失焦,
1040
+ * 那时文字留在框里,字段显示为什么不收,`aria-invalid`,并且只念一次。
1041
+ * 之后的编辑让文字仍然不对或没打完时,拒绝继续亮着;改成能收的日子或清空时立刻消失。
1042
+ */
1043
+ function useTypedDateEntry(options) {
1044
+ /** 打进来的文字;`null` 表示框里显示已提交的值。 */
1045
+ const pending = ref(null);
1046
+ /** Enter 或失焦留下了被拒的文字。 */
1047
+ const isRejectionCommitted = ref(false);
1048
+ /** 一次编辑让文字仍然被拒或没打完时,继续亮着的那段被拒文字。 */
1049
+ const keptText = ref(null);
1050
+ const isFocused = ref(false);
1051
+ /** 这一轮打字已经报过的日子,同一个日子只报一次。 */
1052
+ let reported = null;
1053
+ /** Enter 或失焦刚刚留下被拒的文字。这一刻传进来的新值不顶掉文字,调用方可以在这里恢复自己的值。 */
1054
+ let isRevealing = false;
1055
+ function parse(text) {
1056
+ return parseDateEntry(text, options.locale(), options.isBlocked);
1057
+ }
1058
+ const committedText = computed(() => formatCommittedDate(options.value(), options.format(), options.locale()));
1059
+ const displayValue = computed(() => pending.value ?? committedText.value);
1060
+ const typed = computed(() => pending.value !== null && pending.value.trim() ? parse(pending.value) : null);
1061
+ const ownError = computed(() => dateEntryErrorKind(typed.value, isRejectionCommitted.value, options.behavior()));
1062
+ const shown = computed(() => {
1063
+ if (options.isLocked()) return null;
1064
+ if (ownError.value != null && typed.value != null && pending.value !== null) return {
1065
+ text: pending.value,
1066
+ result: typed.value
1067
+ };
1068
+ if (keptText.value === null || typed.value == null || isAcceptedEntry(typed.value)) return null;
1069
+ const kept = parse(keptText.value);
1070
+ return dateEntryErrorKind(kept, true, options.behavior()) != null ? {
1071
+ text: keptText.value,
1072
+ result: kept
1073
+ } : null;
1074
+ });
1075
+ const message = computed(() => shown.value ? dateEntryMessage(shown.value.result, options.bounds(), options.format(), options.locale(), options.messages()) : null);
1076
+ const entryError = computed(() => shown.value ? toEntryError(shown.value.result, shown.value.text, options.bounds()) : null);
1077
+ const callerError = computed(() => {
1078
+ const status = options.status();
1079
+ return options.hasEntryErrorListener() && status?.type === "error" && status.message ? status.message : null;
1080
+ });
1081
+ const fieldStatus = computed(() => message.value != null && callerError.value == null ? {
1082
+ type: "error",
1083
+ message: message.value
1084
+ } : options.status());
1085
+ const repeat = shallowRef(null);
1086
+ watch(() => message.value != null, (rejected) => {
1087
+ repeat.value = rejected ? callerError.value : null;
1088
+ });
1089
+ watch(callerError, (next) => {
1090
+ if (repeat.value !== null && repeat.value !== next) repeat.value = null;
1091
+ });
1092
+ const alertMessage = computed(() => message.value != null && repeat.value != null && repeat.value === callerError.value ? repeat.value : "");
1093
+ let lastReport = null;
1094
+ watch(entryError, (next) => {
1095
+ if (sameEntryError(next, lastReport)) return;
1096
+ lastReport = next;
1097
+ options.reportEntryError(next);
1098
+ });
1099
+ onScopeDispose(() => {
1100
+ if (lastReport != null) options.reportEntryError(null);
1101
+ });
1102
+ function reset() {
1103
+ pending.value = null;
1104
+ isRejectionCommitted.value = false;
1105
+ keptText.value = null;
1106
+ }
1107
+ function report(date) {
1108
+ const iso = toIsoDate(date);
1109
+ const value = options.value();
1110
+ if (value && toIsoDate(value) === iso || iso === reported) return;
1111
+ reported = iso;
1112
+ options.commitValue(date);
1113
+ }
1114
+ function onInput(text) {
1115
+ if (options.isLocked()) return;
1116
+ const result = parse(text);
1117
+ const isEmpty = !text.trim();
1118
+ const isRejected = !isEmpty && dateEntryErrorKind(result, false, options.behavior()) != null;
1119
+ const shownText = shown.value?.text ?? null;
1120
+ keptText.value = isRejected || isEmpty || isAcceptedEntry(result) ? null : shownText;
1121
+ pending.value = text;
1122
+ isRejectionCommitted.value = false;
1123
+ if (result.kind === "value" && result.isComplete) report(result.date);
1124
+ }
1125
+ function commit() {
1126
+ if (pending.value === null || options.isLocked()) return;
1127
+ if (!pending.value.trim()) {
1128
+ if (options.value()) options.commitValue(null);
1129
+ reset();
1130
+ return;
1131
+ }
1132
+ const result = parse(pending.value);
1133
+ if (result.kind !== "value") {
1134
+ isRejectionCommitted.value = true;
1135
+ keptText.value = null;
1136
+ isRevealing = true;
1137
+ nextTick(() => {
1138
+ isRevealing = false;
1139
+ });
1140
+ return;
1141
+ }
1142
+ report(result.date);
1143
+ reported = null;
1144
+ reset();
1145
+ }
1146
+ watch(() => {
1147
+ const value = options.value();
1148
+ return value ? toIsoDate(value) : null;
1149
+ }, (iso) => {
1150
+ if (iso !== null && iso === reported) return;
1151
+ reported = null;
1152
+ if (pending.value !== null && !isRevealing) reset();
1153
+ });
1154
+ watch(options.isLocked, (locked) => {
1155
+ const result = typed.value;
1156
+ if (locked || isFocused.value || result?.kind !== "value" || toIsoDate(result.date) !== reported) return;
1157
+ reported = null;
1158
+ reset();
1159
+ });
1160
+ return {
1161
+ displayValue,
1162
+ isPending: computed(() => pending.value !== null && !(isRejectionCommitted.value && typed.value?.kind === "unreadable")),
1163
+ isInvalid: computed(() => shown.value != null),
1164
+ fieldStatus,
1165
+ alertMessage,
1166
+ onInput,
1167
+ commit,
1168
+ onFocus: () => {
1169
+ isFocused.value = true;
1170
+ },
1171
+ onBlur: () => {
1172
+ isFocused.value = false;
1173
+ commit();
1174
+ },
1175
+ reset
1176
+ };
1177
+ }
1178
+ //#endregion
770
1179
  //#region src/DateInput/DateInput.vue
771
1180
  const _hoisted_1 = ["data-status", "data-presentation"];
772
1181
  const _hoisted_2 = [
773
1182
  "data-disabled",
1183
+ "data-busy",
774
1184
  "data-size",
775
1185
  "data-status"
776
1186
  ];
@@ -806,7 +1216,11 @@ const _hoisted_7 = {
806
1216
  };
807
1217
  const _hoisted_8 = ["id"];
808
1218
  const _hoisted_9 = ["id"];
809
- const _hoisted_10 = ["name", "value"];
1219
+ const _hoisted_10 = {
1220
+ class: "astryx-date-input-alert",
1221
+ role: "alert"
1222
+ };
1223
+ const _hoisted_11 = ["name", "value"];
810
1224
  const TOUCH_POINTER_QUERY = "(pointer: coarse)";
811
1225
  const _sfc_main = /*@__PURE__*/ defineComponent({
812
1226
  name: "AstryxDateInput",
@@ -858,6 +1272,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
858
1272
  numberOfMonths: { default: 1 },
859
1273
  weekStartsOn: {},
860
1274
  width: {},
1275
+ entryErrorBehavior: {},
861
1276
  containerClass: { type: [
862
1277
  Boolean,
863
1278
  null,
@@ -887,7 +1302,11 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
887
1302
  Array
888
1303
  ] }
889
1304
  },
890
- emits: ["update:modelValue", "change"],
1305
+ emits: [
1306
+ "update:modelValue",
1307
+ "change",
1308
+ "entryErrorChange"
1309
+ ],
891
1310
  setup(__props, { expose: __expose, emit: __emit }) {
892
1311
  const props = __props;
893
1312
  const emit = __emit;
@@ -938,7 +1357,6 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
938
1357
  const inputRef = useTemplateRef("inputRef");
939
1358
  const containerRef = useTemplateRef("containerRef");
940
1359
  const isOpen = ref(false);
941
- const inputValue = ref("");
942
1360
  const disabledMessageId = `${generatedId}-disabled`;
943
1361
  const pending = usePendingChange(() => props.changeAction);
944
1362
  const busy = computed(() => props.isLoading || pending.busy.value);
@@ -952,6 +1370,20 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
952
1370
  const surface = computed(() => resolveDateSurface(policy.value, isCoarsePointer.value));
953
1371
  const useSheet = computed(() => surface.value === "sheet");
954
1372
  const popupWidth = computed(() => props.numberOfMonths === 2 ? "min(36rem, calc(100vw - 16px))" : 280);
1373
+ const popoverOpen = computed(() => !useSheet.value && isOpen.value);
1374
+ function popupElement() {
1375
+ return typeof document === "undefined" ? null : document.getElementById(popupId.value);
1376
+ }
1377
+ useBusyAnnouncement(() => busy.value && surface.value !== "native", () => messages.value.dateInput.loading, () => (useSheet.value && isOpen.value ? popupElement() : null) ?? containerRef.value);
1378
+ const dismiss = useCalendarDismiss({
1379
+ isOpen: popoverOpen,
1380
+ field: () => containerRef.value,
1381
+ input: () => inputRef.value,
1382
+ popup: popupElement,
1383
+ close: () => {
1384
+ isOpen.value = false;
1385
+ }
1386
+ });
955
1387
  function allowed(date) {
956
1388
  return !isCalendarDateDisabled(toCalendarDate(date), {
957
1389
  min: props.min,
@@ -960,6 +1392,12 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
960
1392
  dateConstraints: props.dateConstraints
961
1393
  });
962
1394
  }
1395
+ const instance = getCurrentInstance();
1396
+ /** 调用方有没有监听 `entryErrorChange`。声明过的事件不进 attrs,只能看 vnode 上的 props。 */
1397
+ function hasEntryErrorListener() {
1398
+ return Boolean(instance?.vnode.props?.onEntryErrorChange);
1399
+ }
1400
+ const entryErrorBehavior = useEntryErrorBehavior(() => props.entryErrorBehavior);
963
1401
  function commit(value) {
964
1402
  if (locked.value) return;
965
1403
  emit("update:modelValue", value);
@@ -970,41 +1408,26 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
970
1408
  get: () => props.modelValue,
971
1409
  set: (value) => commit(value)
972
1410
  });
973
- function toIso(date) {
974
- return `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, "0")}-${String(date.getDate()).padStart(2, "0")}`;
975
- }
976
- function formatCommitted(date) {
977
- if (!date) return "";
978
- const iso = toIso(date);
979
- const format = props.format;
980
- if (typeof format === "function") return format(iso);
981
- if (format === "system_date") return iso;
982
- return formatInstant(date, format, locale.value);
983
- }
984
- function parseDate(str) {
985
- if (!str.trim()) return null;
986
- const match = str.match(/^(\d{4})-(\d{1,2})-(\d{1,2})$/);
987
- if (match) {
988
- const [, year, month, day] = match;
989
- const date = new Date(Number(year), Number(month) - 1, Number(day));
990
- if (!Number.isNaN(date.getTime()) && date.getFullYear() === Number(year) && date.getMonth() === Number(month) - 1 && date.getDate() === Number(day)) return date;
991
- }
992
- return null;
993
- }
994
- function syncDisplayValue() {
995
- inputValue.value = formatCommitted(props.modelValue);
996
- }
997
- watch(() => [
998
- props.modelValue,
999
- props.format,
1000
- locale.value
1001
- ], syncDisplayValue, { immediate: true });
1002
- function resolvedStatus(status) {
1003
- if (status == null || status === "default") return void 0;
1004
- if (typeof status === "string") return { type: status };
1005
- return status;
1006
- }
1007
- const statusValue = computed(() => resolvedStatus(props.status));
1411
+ const parseDate = parseTypedDate;
1412
+ const entry = useTypedDateEntry({
1413
+ value: () => props.modelValue,
1414
+ format: () => props.format,
1415
+ locale: () => locale.value,
1416
+ bounds: () => ({
1417
+ min: props.min,
1418
+ max: props.max
1419
+ }),
1420
+ isBlocked: (date) => !allowed(date),
1421
+ isLocked: () => locked.value,
1422
+ behavior: () => entryErrorBehavior.value,
1423
+ status: () => resolveDateStatus(props.status),
1424
+ hasEntryErrorListener,
1425
+ messages: () => messages.value.dateInput,
1426
+ commitValue: (value) => commit(value),
1427
+ reportEntryError: (error) => emit("entryErrorChange", error)
1428
+ });
1429
+ const inputValue = entry.displayValue;
1430
+ const statusValue = entry.fieldStatus;
1008
1431
  const statusType = computed(() => statusValue.value?.type);
1009
1432
  const showsField = computed(() => Boolean(props.label || props.description || statusValue.value?.message));
1010
1433
  const shell = computed(() => showsField.value ? _sfc_main$11 : PassThrough);
@@ -1037,15 +1460,15 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
1037
1460
  }
1038
1461
  function onInput(event) {
1039
1462
  if (useSheet.value || locked.value || event instanceof InputEvent && event.isComposing) return;
1040
- const target = event.target;
1041
- const value = target.value.trim();
1042
- inputValue.value = target.value;
1043
- const parsed = parseDate(value);
1044
- if (parsed && allowed(parsed)) modelValueRef.value = parsed;
1463
+ entry.onInput(event.target.value);
1045
1464
  }
1046
1465
  function onBlur() {
1047
1466
  disabledTooltip.onBlur();
1048
- if (!parseDate(inputValue.value.trim())) syncDisplayValue();
1467
+ entry.onBlur();
1468
+ }
1469
+ function onFocus(event) {
1470
+ entry.onFocus();
1471
+ disabledTooltip.onFocus(event);
1049
1472
  }
1050
1473
  function onOpenChange(open) {
1051
1474
  if (!useSheet.value) isOpen.value = open;
@@ -1062,13 +1485,22 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
1062
1485
  if (useSheet.value) openCalendar();
1063
1486
  }
1064
1487
  function onInputKeyDown(event) {
1065
- if (isImeKeyEvent(event) || locked.value || isOpen.value) return;
1488
+ if (isImeKeyEvent(event)) return;
1489
+ if (event.key === "Enter") {
1490
+ if (locked.value || entry.isPending.value) {
1491
+ event.preventDefault();
1492
+ entry.commit();
1493
+ }
1494
+ return;
1495
+ }
1496
+ if (locked.value || isOpen.value) return;
1066
1497
  if (event.key === "ArrowDown" || event.altKey && event.key === "ArrowDown") {
1067
1498
  event.preventDefault();
1068
1499
  openCalendar();
1069
1500
  }
1070
1501
  }
1071
1502
  function onCalendarChange(date) {
1503
+ entry.reset();
1072
1504
  modelValueRef.value = date;
1073
1505
  if (!useSheet.value) {
1074
1506
  isOpen.value = false;
@@ -1079,13 +1511,13 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
1079
1511
  isOpen.value = false;
1080
1512
  }
1081
1513
  function onSheetReset() {
1514
+ entry.reset();
1082
1515
  modelValueRef.value = null;
1083
1516
  }
1084
1517
  function onClear(event) {
1085
1518
  event.stopPropagation();
1519
+ entry.reset();
1086
1520
  modelValueRef.value = null;
1087
- inputValue.value = "";
1088
- isOpen.value = false;
1089
1521
  inputRef.value?.focus({ preventScroll: true });
1090
1522
  }
1091
1523
  function onToggleKeyDown(event) {
@@ -1098,7 +1530,6 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
1098
1530
  onClear,
1099
1531
  parseDate
1100
1532
  });
1101
- syncDisplayValue();
1102
1533
  return (_ctx, _cache) => {
1103
1534
  return openBlock(), createElementBlock(Fragment, null, [
1104
1535
  surface.value === "native" ? (openBlock(), createBlock(_sfc_main$3, mergeProps({
@@ -1132,7 +1563,8 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
1132
1563
  "container-class": unref(parts).containerClass.value,
1133
1564
  "container-style": unref(parts).containerStyle.value,
1134
1565
  "control-class": unref(parts).controlClass(),
1135
- "control-style": unref(parts).controlStyle()
1566
+ "control-style": unref(parts).controlStyle(),
1567
+ "has-entry-error-listener": hasEntryErrorListener()
1136
1568
  }, inputAttrs(), { "onUpdate:modelValue": commit }), null, 16, [
1137
1569
  "input-id",
1138
1570
  "model-value",
@@ -1163,7 +1595,8 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
1163
1595
  "container-class",
1164
1596
  "container-style",
1165
1597
  "control-class",
1166
- "control-style"
1598
+ "control-style",
1599
+ "has-entry-error-listener"
1167
1600
  ])) : (openBlock(), createBlock(resolveDynamicComponent(shell.value), mergeProps({ key: 1 }, fieldBindings.value, {
1168
1601
  class: unref(parts).containerClass.value,
1169
1602
  style: unref(parts).containerStyle.value
@@ -1179,6 +1612,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
1179
1612
  style: normalizeStyle(unref(parts).controlStyle()),
1180
1613
  "data-status": statusType.value,
1181
1614
  "data-presentation": useSheet.value ? "bottom-sheet" : "popover",
1615
+ onFocusout: _cache[1] || (_cache[1] = (...args) => unref(dismiss).onFieldFocusOut && unref(dismiss).onFieldFocusOut(...args)),
1182
1616
  onPointerenter: _cache[2] || (_cache[2] = (...args) => unref(disabledTooltip).onPointerEnter && unref(disabledTooltip).onPointerEnter(...args)),
1183
1617
  onPointerleave: _cache[3] || (_cache[3] = (...args) => unref(disabledTooltip).onPointerLeave && unref(disabledTooltip).onPointerLeave(...args))
1184
1618
  }, [
@@ -1192,11 +1626,12 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
1192
1626
  "has-close-button": false,
1193
1627
  "is-modal": false,
1194
1628
  "has-auto-focus": true,
1629
+ "has-light-dismiss": false,
1195
1630
  role: "dialog",
1196
1631
  label: dialogLabel.value,
1197
1632
  onOpenChange
1198
1633
  }, {
1199
- content: withCtx(() => [!useSheet.value ? (openBlock(), createElementBlock("div", {
1634
+ content: withCtx(() => [popoverOpen.value ? (openBlock(), createElementBlock("div", {
1200
1635
  key: 0,
1201
1636
  id: popupId.value
1202
1637
  }, [createVNode(_sfc_main$9, {
@@ -1219,7 +1654,8 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
1219
1654
  ])], 8, _hoisted_8)) : createCommentVNode("v-if", true)]),
1220
1655
  default: withCtx(() => [createElementVNode("div", {
1221
1656
  class: "astryx-date-input-wrapper",
1222
- "data-disabled": locked.value ? "true" : void 0,
1657
+ "data-disabled": unref(isDisabled) ? "true" : void 0,
1658
+ "data-busy": busy.value || void 0,
1223
1659
  "data-size": unref(size),
1224
1660
  "data-status": statusType.value
1225
1661
  }, [
@@ -1243,7 +1679,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
1243
1679
  type: "text",
1244
1680
  class: "astryx-date-input-field",
1245
1681
  role: "combobox",
1246
- value: inputValue.value,
1682
+ value: unref(inputValue),
1247
1683
  placeholder: resolvedPlaceholder.value,
1248
1684
  readonly: useSheet.value || locked.value,
1249
1685
  "aria-disabled": locked.value || void 0,
@@ -1251,7 +1687,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
1251
1687
  "aria-label": showsField.value ? void 0 : props.label,
1252
1688
  "aria-labelledby": showsField.value ? field?.labelId : void 0,
1253
1689
  "aria-describedby": describedBy(field?.describedBy),
1254
- "aria-invalid": statusType.value === "error" ? "true" : void 0,
1690
+ "aria-invalid": statusType.value === "error" || unref(entry).isInvalid.value ? "true" : void 0,
1255
1691
  "aria-required": unref(ariaRequired),
1256
1692
  "aria-busy": busy.value || void 0,
1257
1693
  "aria-controls": popupId.value,
@@ -1260,7 +1696,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
1260
1696
  autocomplete: "off",
1261
1697
  onInput,
1262
1698
  onBlur,
1263
- onFocus: _cache[0] || (_cache[0] = (...args) => unref(disabledTooltip).onFocus && unref(disabledTooltip).onFocus(...args)),
1699
+ onFocus,
1264
1700
  onClick: openCalendar,
1265
1701
  onKeydown: onInputKeyDown
1266
1702
  }), null, 16, _hoisted_5),
@@ -1279,8 +1715,8 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
1279
1715
  key: 3,
1280
1716
  class: "astryx-date-input-spinner",
1281
1717
  size: "sm",
1282
- "aria-label": unref(messages).dateInput.loading
1283
- }, null, 8, ["aria-label"])) : statusType.value && props.statusVariant !== "tooltip" ? (openBlock(), createBlock(_sfc_main$8, {
1718
+ "aria-hidden": "true"
1719
+ })) : statusType.value && props.statusVariant !== "tooltip" ? (openBlock(), createBlock(_sfc_main$8, {
1284
1720
  key: 4,
1285
1721
  type: statusType.value
1286
1722
  }, null, 8, ["type"])) : createCommentVNode("v-if", true)
@@ -1295,7 +1731,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
1295
1731
  useSheet.value ? (openBlock(), createBlock(_sfc_main$4, {
1296
1732
  key: 0,
1297
1733
  "is-open": isOpen.value,
1298
- "onUpdate:isOpen": _cache[1] || (_cache[1] = ($event) => isOpen.value = $event),
1734
+ "onUpdate:isOpen": _cache[0] || (_cache[0] = ($event) => isOpen.value = $event),
1299
1735
  label: dialogLabel.value,
1300
1736
  height: "hug",
1301
1737
  padding: 0
@@ -1307,6 +1743,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
1307
1743
  "is-date-disabled": props.isDateDisabled,
1308
1744
  "date-constraints": props.dateConstraints,
1309
1745
  "week-starts-on": props.weekStartsOn,
1746
+ "is-disabled": unref(isDisabled),
1310
1747
  onPick: onCalendarChange,
1311
1748
  onSave: onSheetSave,
1312
1749
  onReset: onSheetReset
@@ -1316,16 +1753,18 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
1316
1753
  "max",
1317
1754
  "is-date-disabled",
1318
1755
  "date-constraints",
1319
- "week-starts-on"
1756
+ "week-starts-on",
1757
+ "is-disabled"
1320
1758
  ])], 8, _hoisted_9)]),
1321
1759
  _: 1
1322
1760
  }, 8, ["is-open", "label"])) : createCommentVNode("v-if", true),
1761
+ createElementVNode("div", _hoisted_10, toDisplayString(unref(entry).alertMessage.value), 1),
1323
1762
  props.name ? (openBlock(), createElementBlock("input", {
1324
1763
  key: 1,
1325
1764
  type: "hidden",
1326
1765
  name: props.name,
1327
- value: props.modelValue ? toIso(props.modelValue) : ""
1328
- }, null, 8, _hoisted_10)) : createCommentVNode("v-if", true)
1766
+ value: props.modelValue ? unref(toIsoDate)(props.modelValue) : ""
1767
+ }, null, 8, _hoisted_11)) : createCommentVNode("v-if", true)
1329
1768
  ], 46, _hoisted_1)]),
1330
1769
  _: 3
1331
1770
  }, 16, ["class", "style"])),