@astryx-vue/core 0.13.1 → 0.15.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 (266) hide show
  1. package/dist/AlertDialog/index.js +1 -1
  2. package/dist/{AlertDialog-CsdgJDLK.js → AlertDialog-BH74lTP9.js} +4 -4
  3. package/dist/AppShell/index.js +1 -1
  4. package/dist/{AppShell-CE5Up5SI.js → AppShell-CBhuHXh4.js} +1 -1
  5. package/dist/Avatar/index.js +1 -1
  6. package/dist/{Avatar-D5CFSkAG.js → Avatar-B-dg3imS.js} +1 -1
  7. package/dist/AvatarGroup/index.d.ts +1 -1
  8. package/dist/Banner/index.d.ts +1 -1
  9. package/dist/Banner/index.js +1 -1
  10. package/dist/{Banner-B4IEG4Fx.js → Banner-qEMqg2D8.js} +1 -1
  11. package/dist/BottomSheet/index.d.ts +1 -1
  12. package/dist/BottomSheet/index.js +2 -2
  13. package/dist/{BottomSheet-D67lQ3Lo.js → BottomSheet-BTf3rz65.js} +3 -3
  14. package/dist/{BottomSheet-UctSPL-g.js → BottomSheet-BvdEUioy.js} +3 -3
  15. package/dist/Breadcrumbs/index.js +1 -1
  16. package/dist/{Breadcrumbs-By21sIml.js → Breadcrumbs-BAyIQaP-.js} +1 -1
  17. package/dist/Button/index.js +1 -1
  18. package/dist/{Button-CfbR2oPc.js → Button-47s3ZBYa.js} +2 -2
  19. package/dist/ButtonGroup/index.d.ts +1 -1
  20. package/dist/Calendar/index.d.ts +1 -1
  21. package/dist/Calendar/index.js +1 -1
  22. package/dist/{Calendar-DwFAzDky.js → Calendar-D029GXOJ.js} +1 -1
  23. package/dist/Carousel/index.d.ts +1 -1
  24. package/dist/Carousel/index.js +1 -1
  25. package/dist/{Carousel-mL_KdBMw.js → Carousel-CYjVpChx.js} +1 -1
  26. package/dist/Center/index.d.ts +1 -1
  27. package/dist/Chat/index.d.ts +1 -1
  28. package/dist/Chat/index.js +1 -1
  29. package/dist/{Chat-C10BQlIl.js → Chat-BfekV9OQ.js} +5 -5
  30. package/dist/CheckboxInput/index.d.ts +1 -1
  31. package/dist/CheckboxInput/index.js +1 -1
  32. package/dist/{CheckboxInput-BGqRMoEA.js → CheckboxInput-Cr0qhZpZ.js} +2 -2
  33. package/dist/CheckboxList/index.d.ts +1 -1
  34. package/dist/CheckboxList/index.js +1 -1
  35. package/dist/{CheckboxList-DbMhC06M.js → CheckboxList-DOAdqkXD.js} +4 -4
  36. package/dist/ClickableCard/index.d.ts +1 -1
  37. package/dist/Code/index.js +1 -1
  38. package/dist/{CodeBlock-DAlWY51H.js → CodeBlock-CuNiGAhQ.js} +1 -1
  39. package/dist/CommandPalette/index.js +1 -1
  40. package/dist/{CommandPalette-DYk_FyFB.js → CommandPalette-ChtGNWy3.js} +1 -1
  41. package/dist/ComplexSelector/index.js +1 -1
  42. package/dist/{ComplexSelector-NDpRucQB.js → ComplexSelector-TPRMIDgt.js} +3 -3
  43. package/dist/ContextMenu/index.d.ts +1 -1
  44. package/dist/ContextMenu/index.js +1 -1
  45. package/dist/{ContextMenu-JDU4HDKm.js → ContextMenu-DYKU1mJT.js} +5 -5
  46. package/dist/DateInput/index.d.ts +2 -2
  47. package/dist/DateInput/index.js +1 -1
  48. package/dist/{DateInput-DVEb1-fM.js → DateInput-iQQLaYlp.js} +562 -123
  49. package/dist/DateRangeInput/index.d.ts +1 -1
  50. package/dist/DateRangeInput/index.js +1 -1
  51. package/dist/{DateRangeInput-OuAz80nR.js → DateRangeInput-BTYlRhmn.js} +14 -11
  52. package/dist/DateTimeInput/index.d.ts +1 -1
  53. package/dist/DateTimeInput/index.js +1 -1
  54. package/dist/{DateTimeInput-J5CFTSSa.js → DateTimeInput-CiUKgoVy.js} +19 -11
  55. package/dist/Dialog/index.d.ts +1 -1
  56. package/dist/Dialog/index.js +3 -3
  57. package/dist/{Dialog-C0WuGDqP.js → Dialog-D54oHAxr.js} +3 -3
  58. package/dist/{Dialog-Cm8CXGpI.js → Dialog-DeHVvhL3.js} +1 -1
  59. package/dist/{DialogHeader-BD2Ezw4F.js → DialogHeader-B6ZIBIC4.js} +2 -2
  60. package/dist/Drawer/index.d.ts +1 -1
  61. package/dist/Drawer/index.js +1 -1
  62. package/dist/{Drawer-CFpcRHt7.js → Drawer-fB3IoD5P.js} +2 -2
  63. package/dist/DropdownMenu/index.js +2 -2
  64. package/dist/{DropdownMenu-2QRvY0aP.js → DropdownMenu-ClBIeBwM.js} +6 -6
  65. package/dist/{DropdownMenu-5Mn01A-5.js → DropdownMenu-D5fBg5Cc.js} +3 -3
  66. package/dist/EmptyState/index.js +1 -1
  67. package/dist/{EmptyState-CqUTEnGg.js → EmptyState-BS8ESteS.js} +2 -2
  68. package/dist/Field/index.js +3 -3
  69. package/dist/{Field-Cw8J8ld7.js → Field-Dxacpe9d.js} +2 -2
  70. package/dist/{FieldInfoTip-D7UNDNje.js → FieldInfoTip-DS4OAl2Q.js} +1 -1
  71. package/dist/{FieldLabel-CJbiefUx.js → FieldLabel-DjzTYhCM.js} +2 -2
  72. package/dist/FileInput/index.d.ts +1 -1
  73. package/dist/FileInput/index.js +1 -1
  74. package/dist/{FileInput-CgfiwVfs.js → FileInput-Dak2gIXU.js} +3 -3
  75. package/dist/FormLayout/index.d.ts +2 -2
  76. package/dist/FormLayout/index.js +1 -1
  77. package/dist/{FormLayout-B9dUB6Ps.js → FormLayout-CGJVeNsL.js} +5 -3
  78. package/dist/Heading/index.js +1 -1
  79. package/dist/{Heading-BO9n2vLl.js → Heading-BYB7QXkT.js} +1 -1
  80. package/dist/HoverCard/index.d.ts +1 -1
  81. package/dist/HoverCard/index.js +1 -1
  82. package/dist/{HoverCard-47J_i9AH.js → HoverCard-CtDr234t.js} +4 -4
  83. package/dist/IconButton/index.js +1 -1
  84. package/dist/{IconButton-DiDHiGbo.js → IconButton-DvgueAEp.js} +1 -1
  85. package/dist/InfoTip/index.d.ts +1 -1
  86. package/dist/InfoTip/index.js +1 -1
  87. package/dist/{InfoTip-ClRC1Hh9.js → InfoTip-DshbO5eW.js} +1 -1
  88. package/dist/{InputClearButton-DL4RM5z1.js → InputClearButton-DEb-bGsY.js} +1 -1
  89. package/dist/InputGroup/index.js +1 -1
  90. package/dist/{InputGroup-JMOrdsmu.js → InputGroup-DLu11Lsd.js} +1 -1
  91. package/dist/InternationalizationProvider/index.d.ts +1 -1
  92. package/dist/InternationalizationProvider/index.js +1 -1
  93. package/dist/{InternationalizationProvider-BYU2MRtX.js → InternationalizationProvider-CqCxB9ku.js} +1 -1
  94. package/dist/{LayerContentBoundary-CeebKoPB.js → LayerContentBoundary-Cx5xXZzg.js} +1 -1
  95. package/dist/Layout/index.d.ts +1 -1
  96. package/dist/Lightbox/index.js +1 -1
  97. package/dist/{Lightbox-kKjxYZ05.js → Lightbox-BbeuDbgd.js} +3 -3
  98. package/dist/Link/index.d.ts +1 -1
  99. package/dist/Link/index.js +1 -1
  100. package/dist/{Link-CkbAlJ3-.js → Link-CFxZ9W2X.js} +1 -1
  101. package/dist/List/index.d.ts +1 -1
  102. package/dist/Markdown/index.js +1 -1
  103. package/dist/{Markdown-DXRFVNJd.js → Markdown-DTqTIKbq.js} +3 -3
  104. package/dist/MobileNav/index.js +1 -1
  105. package/dist/{MobileNavToggle-DUtvvHc7.js → MobileNavToggle-pwkvRFW-.js} +3 -3
  106. package/dist/MoreMenu/index.d.ts +1 -1
  107. package/dist/MoreMenu/index.js +1 -1
  108. package/dist/{MoreMenu-CEJ9E2eD.js → MoreMenu-BY1t1_QA.js} +4 -4
  109. package/dist/MultiSelector/index.d.ts +1 -1
  110. package/dist/MultiSelector/index.js +1 -1
  111. package/dist/{MultiSelector-DgWCWpnM.js → MultiSelector-BgGEzXiX.js} +8 -7
  112. package/dist/{NavDisclosure-Bf5OFtwv.js → NavDisclosure-mXBWmRDC.js} +1 -1
  113. package/dist/{NavHeadingSurface-D5MpO-gO.js → NavHeadingSurface-foJo5bLT.js} +1 -1
  114. package/dist/NavMenu/index.js +3 -3
  115. package/dist/{NavMenu-BcmUfk7z.js → NavMenu-CG9Bthba.js} +2 -2
  116. package/dist/{NavMenuItem-C9xk9KZk.js → NavMenuItem-BiFZUPxC.js} +1 -1
  117. package/dist/NumberInput/index.d.ts +1 -1
  118. package/dist/NumberInput/index.js +1 -1
  119. package/dist/{NumberInput-DNcE_HLD.js → NumberInput-BDNiEgzf.js} +5 -5
  120. package/dist/OverflowList/index.d.ts +1 -1
  121. package/dist/OverflowList/index.js +1 -1
  122. package/dist/{OverflowList-CeQT7MBd.js → OverflowList-CR96Nr5t.js} +2 -2
  123. package/dist/Overlay/index.d.ts +1 -1
  124. package/dist/Pagination/index.d.ts +1 -1
  125. package/dist/Pagination/index.js +1 -1
  126. package/dist/{Pagination-DJGQe6wH.js → Pagination-40BEwZOo.js} +1 -1
  127. package/dist/{PickerWheel-CSwUYfes.js → PickerWheel-DNX3yrUd.js} +21 -8
  128. package/dist/Popover/index.js +1 -1
  129. package/dist/{Popover-C68nCirC.js → Popover-BUiTyOcY.js} +6 -6
  130. package/dist/PowerSearch/index.d.ts +1 -1
  131. package/dist/PowerSearch/index.js +1 -1
  132. package/dist/{PowerSearch-C6lkutch.js → PowerSearch-BLJd0NKp.js} +18 -18
  133. package/dist/ProgressBar/index.js +1 -1
  134. package/dist/{ProgressBar-MaDhabCm.js → ProgressBar-sGSCEtHC.js} +1 -1
  135. package/dist/Radio/index.d.ts +1 -1
  136. package/dist/Radio/index.js +1 -1
  137. package/dist/{RadioGroup-CLQLK_V7.js → RadioGroup-D58Fy-bM.js} +3 -3
  138. package/dist/RadioList/index.d.ts +1 -1
  139. package/dist/RadioList/index.js +1 -1
  140. package/dist/{RadioList-DfHTyqIQ.js → RadioList-u9PoRBXY.js} +1 -1
  141. package/dist/Resizable/index.d.ts +1 -1
  142. package/dist/ScrollableArea/index.d.ts +1 -1
  143. package/dist/SelectableCard/index.d.ts +1 -1
  144. package/dist/Selector/index.d.ts +1 -1
  145. package/dist/Selector/index.js +1 -1
  146. package/dist/{Selector-CPCoJ7Sb.js → Selector-QHLh7g_K.js} +7 -6
  147. package/dist/SideNav/index.d.ts +1 -1
  148. package/dist/SideNav/index.js +1 -1
  149. package/dist/{SideNav-CV8MKVL-.js → SideNav-BgmpUELq.js} +5 -5
  150. package/dist/Slider/index.js +1 -1
  151. package/dist/{Slider-CHJ1CESd.js → Slider-Depy9L-Y.js} +2 -2
  152. package/dist/StatusDot/index.js +1 -1
  153. package/dist/{StatusDot-CGaRrl39.js → StatusDot-D0Wy2ggp.js} +1 -1
  154. package/dist/Stepper/index.d.ts +1 -1
  155. package/dist/Switch/index.d.ts +1 -1
  156. package/dist/Switch/index.js +1 -1
  157. package/dist/{Switch-Bx9ezhrN.js → Switch-dD4OQLkI.js} +2 -2
  158. package/dist/TabList/index.d.ts +1 -1
  159. package/dist/TabList/index.js +1 -1
  160. package/dist/{TabList-o4t9vWvl.js → TabList-CoiyQidC.js} +1 -1
  161. package/dist/Table/index.d.ts +3 -3
  162. package/dist/Table/index.js +2 -2
  163. package/dist/{Table-CO2cYE8r.js → Table-CIMUux6b.js} +1335 -219
  164. package/dist/Text/index.js +1 -1
  165. package/dist/{Text-C6SB2hHJ.js → Text-BWSmB93V.js} +1 -1
  166. package/dist/TextArea/index.d.ts +1 -1
  167. package/dist/TextArea/index.js +1 -1
  168. package/dist/{TextArea-DVaDS_1K.js → TextArea-CbY2w_ic.js} +6 -6
  169. package/dist/TextInput/index.d.ts +1 -1
  170. package/dist/TextInput/index.js +1 -1
  171. package/dist/{TextInput-Dylfzj33.js → TextInput-C8f89GV8.js} +6 -6
  172. package/dist/Thumbnail/index.js +1 -1
  173. package/dist/{Thumbnail-BTQAYnWi.js → Thumbnail-DENhXd9-.js} +2 -2
  174. package/dist/{TimeField-B3JGgLuf.js → TimeField-Bzq72Me_.js} +8 -8
  175. package/dist/TimeInput/index.d.ts +1 -1
  176. package/dist/TimeInput/index.js +1 -1
  177. package/dist/{TimeInput-Dmy6PxaD.js → TimeInput-D-bRCUzU.js} +3 -3
  178. package/dist/Timer/index.js +1 -1
  179. package/dist/{Timer-CN5BmaFS.js → Timer-CgBSMr9E.js} +1 -1
  180. package/dist/Timestamp/index.d.ts +1 -1
  181. package/dist/Timestamp/index.js +1 -1
  182. package/dist/{Timestamp-B7UcCEo2.js → Timestamp-B-VgG6l8.js} +3 -3
  183. package/dist/Toast/index.js +1 -1
  184. package/dist/{Toast-DCipbbCW.js → Toast-CRSZV9K-.js} +1 -1
  185. package/dist/ToggleButton/index.d.ts +1 -1
  186. package/dist/ToggleButton/index.js +1 -1
  187. package/dist/{ToggleButton-C78lrcdr.js → ToggleButton-Bm5IQUy5.js} +1 -1
  188. package/dist/Token/index.d.ts +1 -1
  189. package/dist/Tokenizer/index.js +1 -1
  190. package/dist/{Tokenizer-D7B1ff3O.js → Tokenizer-DmjNQLDl.js} +6 -6
  191. package/dist/Toolbar/index.d.ts +2 -2
  192. package/dist/Tooltip/index.d.ts +1 -1
  193. package/dist/Tooltip/index.js +2 -2
  194. package/dist/{Tooltip-kQPfj3SE.js → Tooltip-BwrJVZ8X.js} +1 -1
  195. package/dist/TopNav/index.d.ts +1 -1
  196. package/dist/TopNav/index.js +1 -1
  197. package/dist/{TopNav-AGY785QI.js → TopNav-FiszUHkM.js} +4 -4
  198. package/dist/Typeahead/index.js +2 -2
  199. package/dist/{Typeahead-QWYeVsel.js → Typeahead-LdmEDCOU.js} +6 -6
  200. package/dist/busyAnnouncement-D3eGqdsf.js +88 -0
  201. package/dist/composables/index.d.ts +2 -2
  202. package/dist/composables/index.js +11 -11
  203. package/dist/{composables-CyKB3F8u.js → composables-Bi0Rt0Uj.js} +2 -2
  204. package/dist/{context-Cfml4jaK.js → context-DsNhYm5O.js} +6 -1
  205. package/dist/{date-input-CiEBtStM.js → date-input-rUD8YAow.js} +4 -0
  206. package/dist/{utils-BOmFijPc.js → dateParser-DS_a8Ej8.js} +1 -329
  207. package/dist/{fieldParts-CDOlBdy6.js → fieldParts-CbWvZLhH.js} +1 -1
  208. package/dist/{format-CiN0Dt_H.js → format-CMHyAMn3.js} +28 -1
  209. package/dist/{index-Cun6cXGP.d.ts → index--tm6L1ot.d.ts} +1 -1
  210. package/dist/{index-BuubzuE8.d.ts → index-BDZCJ9ri.d.ts} +2 -2
  211. package/dist/{index-D7YRtteD.d.ts → index-BHYhTZzp.d.ts} +1 -1
  212. package/dist/{index-ZbNwGVkS.d.ts → index-BKnyTWPM.d.ts} +1 -1
  213. package/dist/{index-Bl_K_cRv.d.ts → index-BL4mH8aK.d.ts} +2 -2
  214. package/dist/{index-9YGUb_Ht.d.ts → index-BlGEkjh5.d.ts} +3 -3
  215. package/dist/{index-Dlq0cFK-.d.ts → index-C5e2rZML.d.ts} +1 -1
  216. package/dist/{index-BOCb89V9.d.ts → index-CP-fJFcJ.d.ts} +3 -3
  217. package/dist/{index-CVs4A2QU.d.ts → index-Cf5j7Cjl.d.ts} +2 -1
  218. package/dist/{index-BWaO4-T-.d.ts → index-D-eT_nvf.d.ts} +125 -32
  219. package/dist/{index-FeZXsFO-.d.ts → index-DDrL_-hJ.d.ts} +1 -1
  220. package/dist/{index-s0Ezq3U-.d.ts → index-DPH5yoAr.d.ts} +2 -2
  221. package/dist/{index-DPhQZXYw.d.ts → index-DYabo8TI.d.ts} +1 -1
  222. package/dist/{index-C90l2rH1.d.ts → index-DcisK4t8.d.ts} +11 -1
  223. package/dist/{index-BpprL2SN.d.ts → index-DfdtDWSP.d.ts} +5 -1
  224. package/dist/{index-B-3EGjfQ.d.ts → index-Q1oG9yIT.d.ts} +2 -2
  225. package/dist/{index-CREW8ZiL.d.ts → index-bwNMoZo_.d.ts} +3 -3
  226. package/dist/{index-CcYSAva-.d.ts → index-fd--aE4B.d.ts} +1 -1
  227. package/dist/{index-Dep8pgnU.d.ts → index-qbj0Lj9a.d.ts} +4 -4
  228. package/dist/{index-bgjrSSaT.d.ts → index-rnFsCdJ7.d.ts} +2 -2
  229. package/dist/{index-CfoExOY_.d.ts → index-rzkX36wM.d.ts} +1 -1
  230. package/dist/index.d.ts +26 -26
  231. package/dist/index.js +95 -93
  232. package/dist/{layerDepth-BU_55vPr.js → layerDepth-I6d28O4d.js} +5 -2
  233. package/dist/{layerFocusReturn-DWGkSHXj.js → layerFocusReturn-_pBrNAPE.js} +1 -1
  234. package/dist/{loadCatalog-Kp7aQZpL.d.ts → loadCatalog-Cvf-xgDD.d.ts} +34 -27
  235. package/dist/{loadCatalog-BtQRPyzj.js → loadCatalog-DYuZZRtf.js} +1 -1
  236. package/dist/locale/index.d.ts +2 -2
  237. package/dist/locale/index.js +4 -4
  238. package/dist/{locale-DET_YkFW.js → locale-B-DrJCMs.js} +1 -1
  239. package/dist/{selectorEscape-LkWoVYQN.js → selectorEscape-FjiU_5WC.js} +3 -16
  240. package/dist/{stillPointerGate-BZ7KMJOB.js → stillPointerGate-DlAU_J_M.js} +1 -1
  241. package/dist/timeParser-D9tCF_b3.js +203 -0
  242. package/dist/{useDismiss-74dLMi5S.js → useDismiss-21Gk7uWk.js} +1 -1
  243. package/dist/{useFocusTrap-CyooA0OC.js → useFocusTrap-CnKnSN99.js} +16 -2
  244. package/dist/{useHoverLayerDismiss-B1W5qIBx.js → useHoverLayerDismiss-Chfty2wT.js} +1 -1
  245. package/dist/{useInputStatusIcon-ZqCxDNTj.js → useInputStatusIcon-Yd0hvw5K.js} +1 -1
  246. package/dist/{useLayer-BnjrJ85F.js → useLayer-vK4-yRk_.js} +1 -1
  247. package/dist/{useMenuPress-BWq7kwWm.js → useMenuPress-9vsHzbRX.js} +1 -1
  248. package/dist/{useResizable-DziUYD5W.d.ts → useResizable-CJd4JkbJ.d.ts} +30 -1
  249. package/dist/{useResizable-De4Xp3TD.js → useResizable-DYlc06-H.js} +1 -1
  250. package/dist/{useRestoreFocus-CSrI8x7v.js → useRestoreFocus-Do8y6Yy4.js} +1 -1
  251. package/dist/useTimeValue-_XW9g2V1.js +52 -0
  252. package/dist/{useTooltip-uc-VLZ8I.js → useTooltip-DIg3ZE9P.js} +4 -4
  253. package/dist/{useTouchTriggerInternal-b-txblws.js → useTouchTriggerInternal-CrLW-7kT.js} +1 -1
  254. package/dist/{useTruncationTooltip-BVMCoNno.js → useTruncationTooltip-D9_lzxpF.js} +2 -2
  255. package/dist/{useTypeahead-BWj3xhbR.js → useTypeahead-CiLt-yEg.js} +1 -1
  256. package/dist/{useTypeaheadAnnouncement-DVkdWTWy.js → useTypeaheadAnnouncement-C59m2nSx.js} +1 -1
  257. package/dist/utils/index.js +3 -1
  258. package/dist/utils-BW62BpDR.js +135 -0
  259. package/package.json +1 -1
  260. package/styles/card.css +3 -0
  261. package/styles/date-input.css +45 -3
  262. package/styles/date-range-input.css +7 -0
  263. package/styles/table.css +44 -1
  264. package/styles/time-input.css +7 -0
  265. package/dist/useTimeValue-BJd0xBhG.js +0 -95
  266. package/dist/{index-J6YRJ7Ul.d.ts → index-BqhgeAT4.d.ts} +1 -1
@@ -0,0 +1,135 @@
1
+ //#region src/utils/chainEventHandlers.ts
2
+ /**
3
+ * 把多个事件处理函数串成一个。每个函数都会按参数顺序执行。
4
+ *
5
+ * 和「前一个调用了 preventDefault 就跳过后面」不同:组件自己的处理函数
6
+ * 不能把事件藏起来,调用方也不能用 preventDefault 取消组件的行为。
7
+ */
8
+ function chainEventHandlers(...handlers) {
9
+ return (event) => {
10
+ for (const handler of handlers) handler?.(event);
11
+ };
12
+ }
13
+ //#endregion
14
+ //#region src/utils/dateTypes.ts
15
+ /** Weekday names indexed by {@link DayOfWeek} (0 = Sunday). */
16
+ const WEEKDAY_NAMES = [
17
+ "sun",
18
+ "mon",
19
+ "tue",
20
+ "wed",
21
+ "thu",
22
+ "fri",
23
+ "sat"
24
+ ];
25
+ /**
26
+ * Normalize a weekday to its numeric {@link DayOfWeek}. Accepts either a
27
+ * number (0–6) or a three-letter day name ('sun'–'sat', case-insensitive),
28
+ * so APIs like `weekStartsOn` can take whichever is more readable at the
29
+ * call site. Unrecognized values fall back to 0 (Sunday).
30
+ */
31
+ function normalizeDayOfWeek(value) {
32
+ if (typeof value === "number") return value;
33
+ const index = WEEKDAY_NAMES.indexOf(value.toLowerCase());
34
+ return index === -1 ? 0 : index;
35
+ }
36
+ //#endregion
37
+ //#region src/utils/groupItems.ts
38
+ /** 读出条目上的组名。不是字符串就不算分组。空字符串仍算一个组名。 */
39
+ function getItemGroup(item) {
40
+ const aux = item.auxiliaryData;
41
+ if (aux == null || typeof aux !== "object") return void 0;
42
+ const group = aux.group;
43
+ return typeof group === "string" ? group : void 0;
44
+ }
45
+ /**
46
+ * 按 `auxiliaryData.group` 分组,组的先后跟它们第一次出现的顺序。
47
+ * 没有任何组名时,返回一组 `heading: null`。
48
+ */
49
+ function groupItems(items, { ungroupedFirst = false } = {}) {
50
+ if (!items.some((item) => getItemGroup(item) != null)) return [{
51
+ heading: null,
52
+ items: [...items]
53
+ }];
54
+ const groupOrder = [];
55
+ const groups = /* @__PURE__ */ new Map();
56
+ const ungrouped = [];
57
+ for (const item of items) {
58
+ const group = getItemGroup(item);
59
+ if (group != null) {
60
+ const list = groups.get(group);
61
+ if (list) list.push(item);
62
+ else {
63
+ groupOrder.push(group);
64
+ groups.set(group, [item]);
65
+ }
66
+ } else ungrouped.push(item);
67
+ }
68
+ const namedGroups = groupOrder.map((heading) => ({
69
+ heading,
70
+ items: groups.get(heading) ?? []
71
+ }));
72
+ const ungroupedGroup = ungrouped.length > 0 ? [{
73
+ heading: null,
74
+ items: ungrouped
75
+ }] : [];
76
+ return ungroupedFirst ? [...ungroupedGroup, ...namedGroups] : [...namedGroups, ...ungroupedGroup];
77
+ }
78
+ //#endregion
79
+ //#region src/utils/inputAria.ts
80
+ function joinAriaIDs(...values) {
81
+ const ids = values.flatMap((value) => typeof value === "string" ? value.trim().split(/\s+/) : []).filter(Boolean);
82
+ if (ids.length === 0) return;
83
+ return Array.from(new Set(ids)).join(" ");
84
+ }
85
+ /**
86
+ * Builds ARIA label/description wiring for an input.
87
+ *
88
+ * Standalone inputs keep their normal native label association. Grouped inputs
89
+ * are named by the visible InputGroup label plus their own input label, and
90
+ * inherit group description/status text in addition to input-local text.
91
+ */
92
+ function getInputARIA(labelID, describedByIDs = [], inputGroup) {
93
+ return {
94
+ ariaLabelledBy: inputGroup ? joinAriaIDs(inputGroup.labelID, labelID) : void 0,
95
+ ariaDescribedBy: joinAriaIDs(inputGroup?.describedByIDs, ...describedByIDs)
96
+ };
97
+ }
98
+ //#endregion
99
+ //#region src/utils/parseStyleKey.ts
100
+ /** 把驼峰属性名变成主题用的 data 属性名,例如 listStyle → data-list-style。 */
101
+ function themeDataAttributeName(prop) {
102
+ return `data-${prop.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase()}`;
103
+ }
104
+ /** 双引号 CSS 属性选择器里的值转义。 */
105
+ function escapeAttributeValue(value) {
106
+ let escaped = "";
107
+ for (const char of value) {
108
+ const codePoint = char.codePointAt(0) ?? 0;
109
+ if (char === "\"" || char === "\\" || codePoint < 32 || codePoint === 127) escaped += `\\${(codePoint === 0 ? 65533 : codePoint).toString(16)} `;
110
+ else escaped += char;
111
+ }
112
+ return escaped;
113
+ }
114
+ /**
115
+ * 把组件样式键编成 data 属性选择器后缀。
116
+ *
117
+ * `prop:value` 选择 `[data-prop="value"]`。裸状态选择 `[data-state="state"]`。
118
+ * `+` 把多个条件接在同一个组件目标上。轴名留在选择器里,避免不同属性的相同值撞在一起。
119
+ *
120
+ * @example
121
+ * parseStyleKey('base') // ''
122
+ * parseStyleKey('variant:secondary') // '[data-variant="secondary"]'
123
+ * parseStyleKey('checked+disabled') // '[data-checked="checked"][data-disabled="disabled"]'
124
+ */
125
+ function parseStyleKey(key) {
126
+ if (key === "base") return "";
127
+ return key.split("+").map((part) => {
128
+ const separator = part.indexOf(":");
129
+ const prop = separator === -1 ? part : part.slice(0, separator);
130
+ const value = separator === -1 ? part : part.slice(separator + 1);
131
+ return `[${themeDataAttributeName(prop)}="${escapeAttributeValue(value)}"]`;
132
+ }).join("");
133
+ }
134
+ //#endregion
135
+ export { groupItems as a, getItemGroup as i, getInputARIA as n, normalizeDayOfWeek as o, joinAriaIDs as r, chainEventHandlers as s, parseStyleKey as t };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@astryx-vue/core",
3
3
  "type": "module",
4
- "version": "0.13.1",
4
+ "version": "0.15.0",
5
5
  "description": "Vue 3 components for the unofficial astryx-vue port of Astryx. Not affiliated with Meta.",
6
6
  "author": "ShenQingchuan",
7
7
  "license": "MIT",
package/styles/card.css CHANGED
@@ -29,6 +29,9 @@
29
29
  --container-padding-inline-end: var(--_card-padding-inline-end);
30
30
  --container-padding-block-start: var(--_card-padding-block-start);
31
31
  --container-padding-block-end: var(--_card-padding-block-end);
32
+ /* 贴边子元素伸到边框底下,所以用外圈圆角。 */
33
+ --_container-corner-block-start: var(--_card-radius);
34
+ --_container-corner-block-end: var(--_card-radius);
32
35
  --layout-padding-own-outer-x: initial;
33
36
  --layout-padding-own-outer-y: initial;
34
37
  --layout-padding-outer-x: var(--_card-padding-inline-start);
@@ -41,7 +41,7 @@
41
41
  }
42
42
 
43
43
  @media (hover: hover) {
44
- .astryx-date-input-wrapper:hover:not([data-disabled='true']):not(:focus-within) {
44
+ .astryx-date-input-wrapper:hover:not([data-disabled='true']):not([data-busy]):not(:focus-within) {
45
45
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--astryx-input-status-color, var(--astryx-input-border, #d4d4d4)) 30%, transparent);
46
46
  }
47
47
  }
@@ -51,12 +51,18 @@
51
51
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--astryx-input-status-color, var(--astryx-input-focus, #262626)) 15%, transparent);
52
52
  }
53
53
 
54
+ /* 禁用的样子只属于禁用;忙碌的字段保持平常的样子,只多一个转圈。 */
54
55
  .astryx-date-input-wrapper[data-disabled='true'] {
55
56
  opacity: 0.5;
56
57
  box-shadow: none;
57
58
  cursor: default;
58
59
  }
59
60
 
61
+ /* 禁用的字段仍可聚焦,聚焦时焦点环照样出现。 */
62
+ .astryx-date-input-wrapper[data-disabled='true']:focus-within {
63
+ box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--astryx-input-status-color, var(--astryx-input-focus, #262626)) 15%, transparent);
64
+ }
65
+
60
66
  .astryx-date-input.status-error {
61
67
  --astryx-input-status-color: var(--astryx-input-error, #e33f4a);
62
68
  }
@@ -166,12 +172,35 @@
166
172
  flex: none;
167
173
  }
168
174
 
169
- @media (prefers-reduced-motion: reduce) {
175
+ /* 粗指针下点一下就弹键盘,焦点样子渐变会在键盘升起的每一帧重画,所以直接出现。 */
176
+ @media (prefers-reduced-motion: reduce), (pointer: coarse) {
170
177
  .astryx-date-input-wrapper {
171
178
  transition: none;
172
179
  }
173
180
  }
174
181
 
182
+ @media (forced-colors: active) {
183
+ .astryx-date-input-wrapper {
184
+ border-color: ButtonText;
185
+ color: CanvasText;
186
+ background: Canvas;
187
+ box-shadow: none;
188
+ }
189
+
190
+ .astryx-date-input-wrapper[data-disabled='true'] {
191
+ color: GrayText;
192
+ border-color: GrayText;
193
+ opacity: 1;
194
+ }
195
+
196
+ /* 强制颜色会把边框统一重画、去掉内阴影;聚焦的字段(含仍可聚焦的禁用字段)用 Highlight 标出来。 */
197
+ .astryx-date-input-wrapper:focus-within,
198
+ .astryx-date-input-wrapper[data-disabled='true']:focus-within {
199
+ border-color: Highlight;
200
+ box-shadow: none;
201
+ }
202
+ }
203
+
175
204
  @media (pointer: coarse) {
176
205
  @supports (-webkit-touch-callout: none) {
177
206
  .astryx-date-input-field {
@@ -189,6 +218,18 @@
189
218
  padding: var(--astryx-spacing-3, 12px);
190
219
  }
191
220
 
221
+ /* 底部面板的抓手条浮在内容上方、高 24px。静止时面板第一行要落在它下面:
222
+ 面板自己的上内边距不够 24px 时,差多少这里补多少。 */
223
+ .astryx-date-touch,
224
+ .astryx-time-touch,
225
+ .astryx-date-time-touch-tabs {
226
+ padding-block-start: max(var(--astryx-spacing-3, 12px), calc(var(--astryx-spacing-6, 24px) - var(--container-padding-block-start, 0px)));
227
+ }
228
+
229
+ .astryx-date-time-touch .astryx-date-touch {
230
+ padding-block-start: var(--astryx-spacing-3, 12px);
231
+ }
232
+
192
233
  .astryx-date-touch-header,
193
234
  .astryx-date-touch-nav,
194
235
  .astryx-date-time-touch-tabs {
@@ -279,7 +320,8 @@
279
320
  }
280
321
 
281
322
  .astryx-date-time-touch-tabs {
282
- padding: var(--astryx-spacing-3, 12px) var(--astryx-spacing-3, 12px) 0;
323
+ padding-inline: var(--astryx-spacing-3, 12px);
324
+ padding-block-end: 0;
283
325
  }
284
326
  }
285
327
 
@@ -1,6 +1,13 @@
1
1
  @layer astryx.reset, astryx.tokens, astryx.base, astryx.components, astryx.overrides;
2
2
 
3
3
  @layer astryx.components {
4
+ /* 粗指针下点一下就弹键盘,焦点样子渐变会在键盘升起的每一帧重画,所以直接出现。 */
5
+ @media (pointer: coarse) {
6
+ .astryx-date-range-input.astryx-bordered-control {
7
+ transition: none;
8
+ }
9
+ }
10
+
4
11
  .astryx-date-range-input {
5
12
  width: 100%;
6
13
  }
package/styles/table.css CHANGED
@@ -6,6 +6,17 @@
6
6
  margin-inline-start: calc(-1 * var(--container-padding-inline-start, 0px));
7
7
  margin-inline-end: calc(-1 * var(--container-padding-inline-end, 0px));
8
8
  width: calc(100% + var(--container-padding-inline-start, 0px) + var(--container-padding-inline-end, 0px));
9
+ --_table-bleed-block-start: 0px;
10
+ --_table-bleed-block-end: 0px;
11
+ }
12
+
13
+ /*
14
+ * 行窗口化的表格在父元素给的高度里滚动。贴到容器上下边缘时,高度把抵消掉的那段内边距加回来,
15
+ * 底边仍然落在容器边缘。
16
+ */
17
+ .astryx-table-scroll[data-block-viewport] {
18
+ height: calc(100% + var(--_table-bleed-block-start) + var(--_table-bleed-block-end));
19
+ min-height: 0;
9
20
  }
10
21
 
11
22
  /*
@@ -66,6 +77,7 @@
66
77
  .astryx-bottom-sheet__content
67
78
  ) > .astryx-table-scroll:first-child {
68
79
  margin-top: calc(-1 * var(--container-padding-block-start, 0px));
80
+ --_table-bleed-block-start: var(--container-padding-block-start, 0px);
69
81
  }
70
82
 
71
83
  :is(
@@ -79,6 +91,21 @@
79
91
  .astryx-bottom-sheet__content
80
92
  ) > .astryx-table-scroll:last-child {
81
93
  margin-bottom: calc(-1 * var(--container-padding-block-end, 0px));
94
+ --_table-bleed-block-end: var(--container-padding-block-end, 0px);
95
+ }
96
+
97
+ /*
98
+ * 贴到卡片上下边缘的滚动区,在那一侧用卡片发布的圆角,焦点环和底色沿着卡片的弧线走,
99
+ * 不在角上被卡片裁掉。其余的角保持直角。
100
+ */
101
+ .astryx-card > .astryx-table-scroll:first-child {
102
+ border-start-start-radius: var(--_container-corner-block-start, 0px);
103
+ border-start-end-radius: var(--_container-corner-block-start, 0px);
104
+ }
105
+
106
+ .astryx-card > .astryx-table-scroll:last-child {
107
+ border-end-start-radius: var(--_container-corner-block-end, 0px);
108
+ border-end-end-radius: var(--_container-corner-block-end, 0px);
82
109
  }
83
110
 
84
111
  .astryx-table {
@@ -241,11 +268,27 @@
241
268
  overflow-wrap: break-word;
242
269
  }
243
270
 
244
- .astryx-table[data-striped='true'] tbody tr:nth-child(even of :not([data-expansion-panel], [data-group-header])) {
271
+ .astryx-table[data-striped='true']:not([data-windowed]) tbody tr:nth-child(even of :not([data-expansion-panel], [data-group-header])),
272
+ .astryx-table[data-striped='true'][data-windowed] tbody tr[data-parity='even'] {
245
273
  --table-row-overlay: var(--astryx-color-background-muted, light-dark(#f1f1f1, #1b1b1b));
246
274
  background-color: var(--astryx-color-background-muted, light-dark(#f1f1f1, #1b1b1b));
247
275
  }
248
276
 
277
+ /*
278
+ * 窗口化时没挂载的行、列由占位行和占位格撑住位置。它们只占地方:没有内边距、分隔线和底色,
279
+ * 特异性压过密度、分隔线和悬停的规则。
280
+ */
281
+ .astryx-table.astryx-table.astryx-table :is(th, td)[data-window-gap] {
282
+ padding: 0;
283
+ border-width: 0;
284
+ line-height: 0;
285
+ max-width: none;
286
+ }
287
+
288
+ .astryx-table.astryx-table.astryx-table tbody tr[data-window-gap] {
289
+ background-color: transparent;
290
+ }
291
+
249
292
  .astryx-table[data-hover='true'] tbody tr {
250
293
  transition: background-color var(--astryx-duration-fast, 125ms) var(--astryx-ease-standard, cubic-bezier(0.24, 1, 0.4, 1));
251
294
  }
@@ -1,6 +1,13 @@
1
1
  @layer astryx.reset, astryx.tokens, astryx.base, astryx.components, astryx.overrides;
2
2
 
3
3
  @layer astryx.components {
4
+ /* 粗指针下点一下就弹键盘,焦点样子渐变会在键盘升起的每一帧重画,所以直接出现。 */
5
+ @media (pointer: coarse) {
6
+ .astryx-time-input.astryx-bordered-control {
7
+ transition: none;
8
+ }
9
+ }
10
+
4
11
  .astryx-time-input {
5
12
  width: 100%;
6
13
  }
@@ -1,95 +0,0 @@
1
- //#region src/composables/useTimeValue.ts
2
- const DISPLAY_TIME = /^(\d{1,2})(?::(\d{2}))?(?::(\d{2}))?\s*([ap])\.?m\.?$/i;
3
- const COMPACT_TIME = /^(\d{2})(\d{2})(\d{2})?$/;
4
- const ISO_TIME = /^(\d{2}):(\d{2})(?::(\d{2}))?$/;
5
- function clampPart(value, max) {
6
- return Number.isInteger(value) && value >= 0 && value <= max;
7
- }
8
- function parseISOTime(value) {
9
- const match = ISO_TIME.exec(value.trim());
10
- if (!match) return null;
11
- const hours = Number(match[1]);
12
- const minutes = Number(match[2]);
13
- const seconds = match[3] == null ? 0 : Number(match[3]);
14
- if (!clampPart(hours, 23) || !clampPart(minutes, 59) || !clampPart(seconds, 59)) return null;
15
- return {
16
- hours,
17
- minutes,
18
- seconds
19
- };
20
- }
21
- function formatISOTime(time, hasSeconds) {
22
- const hours = String(time.hours).padStart(2, "0");
23
- const minutes = String(time.minutes).padStart(2, "0");
24
- const seconds = String(time.seconds).padStart(2, "0");
25
- return hasSeconds ? `${hours}:${minutes}:${seconds}` : `${hours}:${minutes}`;
26
- }
27
- function formatDisplayTime(value, hourFormat, hasSeconds) {
28
- const parsed = parseISOTime(value);
29
- if (!parsed) return value;
30
- if (hourFormat === "24h") return formatISOTime(parsed, hasSeconds);
31
- const suffix = parsed.hours < 12 ? "AM" : "PM";
32
- return `${parsed.hours % 12 || 12}:${String(parsed.minutes).padStart(2, "0")}${hasSeconds ? `:${String(parsed.seconds).padStart(2, "0")}` : ""} ${suffix}`;
33
- }
34
- function parseDisplayTime(text, hasSeconds) {
35
- const trimmed = text.trim();
36
- if (!trimmed) return null;
37
- const meridiem = DISPLAY_TIME.exec(trimmed);
38
- if (meridiem) {
39
- let hours = Number(meridiem[1]);
40
- const minutes = meridiem[2] == null ? 0 : Number(meridiem[2]);
41
- const seconds = meridiem[3] == null ? 0 : Number(meridiem[3]);
42
- if (!clampPart(hours, 12) || hours === 0 || !clampPart(minutes, 59) || !clampPart(seconds, 59)) return null;
43
- const isPm = meridiem[4].toLowerCase() === "p";
44
- if (hours === 12) hours = isPm ? 12 : 0;
45
- else if (isPm) hours += 12;
46
- return formatISOTime({
47
- hours,
48
- minutes,
49
- seconds
50
- }, hasSeconds);
51
- }
52
- const compact = COMPACT_TIME.exec(trimmed);
53
- if (compact) return parseDisplayTime(`${compact[1]}:${compact[2]}${compact[3] ? `:${compact[3]}` : ""}`, hasSeconds);
54
- const iso = parseISOTime(trimmed);
55
- if (!iso) return null;
56
- return formatISOTime(iso, hasSeconds);
57
- }
58
- function shiftTime(value, minuteDelta, hasSeconds) {
59
- const parsed = parseISOTime(value) ?? {
60
- hours: 0,
61
- minutes: 0,
62
- seconds: 0
63
- };
64
- const total = parsed.hours * 60 + parsed.minutes + minuteDelta;
65
- const day = 1440;
66
- const normalized = (total % day + day) % day;
67
- return formatISOTime({
68
- hours: Math.floor(normalized / 60),
69
- minutes: normalized % 60,
70
- seconds: parsed.seconds
71
- }, hasSeconds);
72
- }
73
- function comparable(value) {
74
- const parsed = parseISOTime(value);
75
- if (!parsed) return value;
76
- return formatISOTime(parsed, true);
77
- }
78
- function isTimeInRange(value, min, max) {
79
- const current = comparable(value);
80
- if (min && current < comparable(min)) return false;
81
- if (max && current > comparable(max)) return false;
82
- return true;
83
- }
84
- function resolveTimeSurface(options) {
85
- const presentation = options.presentation ?? (options.nativePicker === "always" ? "native" : options.nativePicker === "never" ? "text-input" : "adaptive-native");
86
- const needsTypedField = options.hasSeconds || options.increment !== 1 || options.needsTypedField === true;
87
- if (presentation === "text-input" || presentation === "popover") return "text";
88
- if (presentation === "bottom-sheet") return "sheet";
89
- if (presentation === "adaptive-bottom-sheet") return options.coarse ? "sheet" : "text";
90
- if (needsTypedField) return "text";
91
- if (presentation === "native") return "native";
92
- return options.coarse ? "native" : "text";
93
- }
94
- //#endregion
95
- export { parseISOTime as a, parseDisplayTime as i, formatISOTime as n, resolveTimeSurface as o, isTimeInRange as r, shiftTime as s, formatDisplayTime as t };
@@ -43,9 +43,9 @@ declare const __VLS_base: import("vue").DefineComponent<TokenProps, {}, {}, {},
43
43
  onRemove?: ((event: Event) => any) | undefined;
44
44
  }>, {
45
45
  size: TokenSize;
46
+ labelHidden: boolean;
46
47
  disabled: boolean;
47
48
  color: "default" | "blue" | "cyan" | "gray" | "green" | "orange" | "pink" | "purple" | "red" | "teal" | "yellow";
48
- labelHidden: boolean;
49
49
  removable: boolean;
50
50
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
51
51
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;