@astryx-vue/core 0.2.5 → 0.3.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 (409) hide show
  1. package/THIRD_PARTY_NOTICES.md +9 -0
  2. package/dist/AlertDialog/index.js +1 -1
  3. package/dist/{AlertDialog-B6UeBCE7.js → AlertDialog-RAVA_cT1.js} +13 -7
  4. package/dist/AppShell/index.d.ts +1 -1
  5. package/dist/AppShell/index.js +1 -1
  6. package/dist/{AppShell-CeBmB0Q9.js → AppShell-0wTvOo3H.js} +3 -3
  7. package/dist/Avatar/index.d.ts +2 -2
  8. package/dist/Avatar/index.js +1 -1
  9. package/dist/{Avatar-BB4Z4LF1.js → Avatar-pPZ4dI_s.js} +161 -16
  10. package/dist/AvatarGroup/index.d.ts +2 -2
  11. package/dist/AvatarGroup/index.js +1 -1
  12. package/dist/AvatarGroup-B--NQSB3.js +98 -0
  13. package/dist/Banner/index.d.ts +1 -1
  14. package/dist/Banner/index.js +1 -1
  15. package/dist/{Banner-CJe9Im5a.js → Banner-GbGxrqQO.js} +1 -1
  16. package/dist/BottomSheet/index.d.ts +1 -1
  17. package/dist/BottomSheet/index.js +2 -2
  18. package/dist/{BottomSheet-o7xw-TOi.js → BottomSheet-JYMB_Ofl.js} +12 -9
  19. package/dist/{BottomSheet-BV6vfgGu.js → BottomSheet-pt7m4CvC.js} +3 -1
  20. package/dist/Breadcrumbs/index.d.ts +1 -1
  21. package/dist/Breadcrumbs/index.js +2 -2
  22. package/dist/{Breadcrumbs-D6G7f5WL.js → Breadcrumbs-DIm4figq.js} +22 -11
  23. package/dist/Button/index.d.ts +1 -1
  24. package/dist/Button/index.js +1 -1
  25. package/dist/{Button-DrqeomlE.js → Button-B6Hj_O_s.js} +3 -1
  26. package/dist/ButtonGroup/index.d.ts +1 -1
  27. package/dist/Calendar/index.d.ts +1 -1
  28. package/dist/Calendar/index.js +1 -1
  29. package/dist/{Calendar-DmTeM7PO.js → Calendar-B7vIowKq.js} +2 -2
  30. package/dist/Card/index.d.ts +1 -1
  31. package/dist/Card/index.js +1 -1
  32. package/dist/{Card-HAjZQg2s.js → Card-B-I24X9S.js} +2 -0
  33. package/dist/Carousel/index.d.ts +1 -1
  34. package/dist/Carousel/index.js +1 -1
  35. package/dist/{Carousel-CIKrcA2r.js → Carousel-CA8zpD9v.js} +48 -31
  36. package/dist/Center/index.d.ts +1 -1
  37. package/dist/Chat/index.d.ts +2 -2
  38. package/dist/Chat/index.js +1 -1
  39. package/dist/{Chat-BFox3u9D.js → Chat-Bmna9EOA.js} +98 -61
  40. package/dist/CheckboxInput/index.d.ts +1 -1
  41. package/dist/CheckboxInput/index.js +1 -1
  42. package/dist/{CheckboxInput-25Q8ItH-.js → CheckboxInput-BS9J6edf.js} +2 -2
  43. package/dist/CheckboxList/index.d.ts +1 -1
  44. package/dist/CheckboxList/index.js +1 -1
  45. package/dist/{CheckboxList-BlPf7vPe.js → CheckboxList-CX1i_jVP.js} +8 -7
  46. package/dist/Citation/index.js +1 -1
  47. package/dist/{Citation-BG-vg9ia.js → Citation-Djgwa0ko.js} +1 -1
  48. package/dist/ClickableCard/index.d.ts +1 -1
  49. package/dist/ClickableCard/index.js +1 -1
  50. package/dist/{ClickableCard-Bhds4RRe.js → ClickableCard-DUsC-j03.js} +1 -1
  51. package/dist/Code/index.d.ts +1 -1
  52. package/dist/Code/index.js +1 -1
  53. package/dist/{CodeBlock-B2pnEOJY.js → CodeBlock-D0BFubut.js} +5 -1
  54. package/dist/Collapsible/index.d.ts +2 -2
  55. package/dist/Collapsible/index.js +2 -2
  56. package/dist/{Collapsible-3YerR-FO.js → Collapsible-Cov3Pyq5.js} +67 -22
  57. package/dist/CommandPalette/index.d.ts +2 -2
  58. package/dist/CommandPalette/index.js +1 -1
  59. package/dist/{CommandPalette-DKgHzmJk.js → CommandPalette-YHsUNg3V.js} +60 -20
  60. package/dist/ComplexSelector/index.d.ts +1 -1
  61. package/dist/ComplexSelector/index.js +1 -1
  62. package/dist/{ComplexSelector-Dv44FFhN.js → ComplexSelector-DWLdKPGI.js} +41 -9
  63. package/dist/ContextMenu/index.d.ts +1 -1
  64. package/dist/ContextMenu/index.js +2 -2
  65. package/dist/{ContextMenu-BeJO5HYx.js → ContextMenu-Bq9b3Ti5.js} +15 -8
  66. package/dist/DateInput/index.d.ts +1 -1
  67. package/dist/DateInput/index.js +1 -1
  68. package/dist/DateInput-DT518j5E.js +841 -0
  69. package/dist/DateRangeInput/index.d.ts +1 -1
  70. package/dist/DateRangeInput/index.js +1 -1
  71. package/dist/{DateRangeInput-Cp6AZfew.js → DateRangeInput-Bqi5tlIA.js} +188 -140
  72. package/dist/DateTimeInput/index.d.ts +1 -1
  73. package/dist/DateTimeInput/index.js +1 -1
  74. package/dist/{DateTimeInput-B6MPPp76.js → DateTimeInput-A7m2O3bg.js} +43 -12
  75. package/dist/Dialog/index.d.ts +1 -1
  76. package/dist/Dialog/index.js +2 -2
  77. package/dist/{Dialog-CvRplBo-.js → Dialog-BiOSKQso.js} +9 -5
  78. package/dist/{Dialog-rfUt3y8P.js → Dialog-FGHfDu5M.js} +1 -1
  79. package/dist/Divider/index.d.ts +1 -1
  80. package/dist/DropdownMenu/index.js +3 -3
  81. package/dist/{DropdownMenu-6E9jFdFe.js → DropdownMenu-CoOQVlRp.js} +9 -10
  82. package/dist/{DropdownMenu--lnUeJEG.js → DropdownMenu-DEb2dSSP.js} +44 -33
  83. package/dist/EmptyState/index.js +1 -1
  84. package/dist/{EmptyState-0RWymQUS.js → EmptyState-C_GH7IV5.js} +2 -2
  85. package/dist/Field/index.d.ts +2 -2
  86. package/dist/Field/index.js +2 -2
  87. package/dist/{Field-8zRxzDHE.js → Field-D5gUEGw4.js} +1 -1
  88. package/dist/FieldInfoTip-Ds-sW_jY.js +98 -0
  89. package/dist/FieldLabel-BNeXRuGH.js +95 -0
  90. package/dist/FieldStatus/index.d.ts +1 -1
  91. package/dist/FileInput/index.d.ts +1 -1
  92. package/dist/FileInput/index.js +1 -1
  93. package/dist/FileInput-BpdiO1V8.js +285 -0
  94. package/dist/Grid/index.d.ts +1 -1
  95. package/dist/Heading/index.d.ts +1 -1
  96. package/dist/Heading/index.js +1 -1
  97. package/dist/{Heading-B9C3LZlS.js → Heading-BnwWEWkp.js} +7 -2
  98. package/dist/HoverCard/index.d.ts +2 -2
  99. package/dist/HoverCard/index.js +2 -2
  100. package/dist/HoverCard-ycY50pRN.js +492 -0
  101. package/dist/IconButton/index.js +1 -1
  102. package/dist/{IconButton-BNQuz9W_.js → IconButton-DDNgNl7B.js} +1 -1
  103. package/dist/InputGroup/index.d.ts +1 -1
  104. package/dist/InputGroup/index.js +1 -1
  105. package/dist/{InputGroup-BzR6JRZb.js → InputGroup-CA03Smrs.js} +1 -1
  106. package/dist/InternationalizationProvider/index.d.ts +2 -0
  107. package/dist/InternationalizationProvider/index.js +2 -0
  108. package/dist/InternationalizationProvider-DJay_w3B.js +170 -0
  109. package/dist/{Item-DrYJL1TG.js → Item-KhFKX9St.js} +15 -6
  110. package/dist/LayerProvider/index.d.ts +2 -0
  111. package/dist/LayerProvider/index.js +3 -0
  112. package/dist/LayerProvider-D9NsQFzL.js +73 -0
  113. package/dist/Layout/index.d.ts +1 -1
  114. package/dist/Layout/index.js +2 -2
  115. package/dist/{Layout-Bed3kP0M.js → Layout-C6RHllr-.js} +2 -2
  116. package/dist/{LayoutPanel-C34uOq3e.js → LayoutPanel-DXOsaeQb.js} +4 -1
  117. package/dist/Lightbox/index.js +1 -1
  118. package/dist/{Lightbox-Br3o0SyQ.js → Lightbox-DTF9EdTG.js} +2 -2
  119. package/dist/Link/index.d.ts +2 -2
  120. package/dist/Link/index.js +1 -1
  121. package/dist/{Link-DCZ6922-.js → Link-BqHCtiyt.js} +26 -7
  122. package/dist/LinkProvider/index.d.ts +2 -0
  123. package/dist/LinkProvider/index.js +3 -0
  124. package/dist/LinkProvider-Qsps9_mL.js +17 -0
  125. package/dist/List/index.d.ts +1 -1
  126. package/dist/List/index.js +2 -2
  127. package/dist/{ListItem-CcRHWuEm.js → ListItem-8RWT8XAG.js} +1 -1
  128. package/dist/Markdown/index.d.ts +1 -1
  129. package/dist/Markdown/index.js +1 -1
  130. package/dist/{Markdown-Bz0R3kNj.js → Markdown-CvtN7HnF.js} +4 -4
  131. package/dist/MetadataList/index.js +1 -1
  132. package/dist/{MetadataList-CFaocx6j.js → MetadataList-B-OelQlt.js} +1 -1
  133. package/dist/MobileNav/index.js +1 -1
  134. package/dist/{MobileNavToggle-Dh3uLivq.js → MobileNavToggle-DxGz0xKA.js} +11 -5
  135. package/dist/MoreMenu/index.d.ts +1 -1
  136. package/dist/MoreMenu/index.js +1 -1
  137. package/dist/{MoreMenu-B95nRSe8.js → MoreMenu-Dlb7MLlW.js} +33 -20
  138. package/dist/MultiSelector/index.d.ts +1 -1
  139. package/dist/MultiSelector/index.js +1 -1
  140. package/dist/{MultiSelector-DuF5TECE.js → MultiSelector-BtAUfQ3t.js} +122 -54
  141. package/dist/{NavDisclosure-C6sPZ89n.js → NavDisclosure-C_fugrQ3.js} +1 -2
  142. package/dist/{NavHeadingSurface-Cb3x9iDx.js → NavHeadingSurface-B3yJspSN.js} +18 -11
  143. package/dist/NavItem/index.d.ts +1 -1
  144. package/dist/NavItem/index.js +2 -2
  145. package/dist/{NavItem-FFOisITc.js → NavItem-BBIGSvDj.js} +7 -3
  146. package/dist/NavMenu/index.d.ts +1 -1
  147. package/dist/NavMenu/index.js +3 -3
  148. package/dist/{NavMenu-ClIgMaxE.js → NavMenu-ThXguZAz.js} +7 -3
  149. package/dist/{NavMenuItem-E7S8gBh-.js → NavMenuItem-BvJNsDFC.js} +8 -4
  150. package/dist/NumberInput/index.d.ts +1 -1
  151. package/dist/NumberInput/index.js +1 -1
  152. package/dist/NumberInput-AZ9x3oja.js +473 -0
  153. package/dist/Outline/index.js +1 -1
  154. package/dist/{Outline-DBUuchi9.js → Outline-755h-lMP.js} +1 -1
  155. package/dist/OverflowList/index.d.ts +1 -1
  156. package/dist/OverflowList/index.js +1 -1
  157. package/dist/{OverflowList-aDd_oem0.js → OverflowList-NmrSMbxb.js} +10 -6
  158. package/dist/Pagination/index.d.ts +1 -1
  159. package/dist/Pagination/index.js +1 -1
  160. package/dist/{Pagination-CNe9F6Fl.js → Pagination-DqwNQFRp.js} +29 -14
  161. package/dist/Popover/index.d.ts +3 -3
  162. package/dist/Popover/index.js +2 -2
  163. package/dist/Popover-DJf8POzL.js +308 -0
  164. package/dist/PowerSearch/index.d.ts +1 -1
  165. package/dist/PowerSearch/index.js +1 -1
  166. package/dist/{PowerSearch-C6U8Sq1Y.js → PowerSearch-DvjiPqMZ.js} +44 -31
  167. package/dist/ProgressBar/index.d.ts +1 -1
  168. package/dist/ProgressBar/index.js +1 -1
  169. package/dist/{ProgressBar-DF6WZNCI.js → ProgressBar-CVLzdoBK.js} +9 -3
  170. package/dist/Radio/index.d.ts +1 -1
  171. package/dist/Radio/index.js +1 -1
  172. package/dist/{RadioGroup-CBqUPq_L.js → RadioGroup-Bfu6JSNV.js} +60 -24
  173. package/dist/RadioList/index.d.ts +1 -1
  174. package/dist/RadioList/index.js +1 -1
  175. package/dist/{RadioList-CPOJn9Th.js → RadioList-xY1cwLdZ.js} +4 -1
  176. package/dist/Resizable/index.d.ts +1 -1
  177. package/dist/Resizable/index.js +1 -1
  178. package/dist/{ResizeHandle-DYy0e3v9.js → ResizeHandle-q4nD_586.js} +1 -1
  179. package/dist/ScrollableArea/index.d.ts +1 -1
  180. package/dist/ScrollableArea/index.js +1 -1
  181. package/dist/{ScrollableArea-DQDYjnxO.js → ScrollableArea-D4dCJv9I.js} +14 -3
  182. package/dist/Scrollbars/index.d.ts +2 -0
  183. package/dist/Scrollbars/index.js +3 -0
  184. package/dist/Scrollbars-D_93hJYK.js +75 -0
  185. package/dist/Section/index.d.ts +2 -1
  186. package/dist/Section/index.js +1 -1
  187. package/dist/{Section-C48Wqfc7.js → Section-v2QuWBBJ.js} +1 -1
  188. package/dist/SegmentedControl/index.d.ts +1 -1
  189. package/dist/SelectableCard/index.d.ts +1 -1
  190. package/dist/SelectableCard/index.js +1 -1
  191. package/dist/{SelectableCard-Bj5s_tIN.js → SelectableCard-Cku4dRzc.js} +1 -1
  192. package/dist/Selector/index.d.ts +1 -1
  193. package/dist/Selector/index.js +1 -1
  194. package/dist/{Selector-5N-hq2nF.js → Selector-DJ2BhUTV.js} +90 -31
  195. package/dist/SideNav/index.d.ts +2 -2
  196. package/dist/SideNav/index.js +1 -1
  197. package/dist/{SideNav-CT9lfspi.js → SideNav-BF8mYDxl.js} +76 -44
  198. package/dist/Slider/index.d.ts +1 -1
  199. package/dist/Slider/index.js +1 -1
  200. package/dist/{Slider-D8h_RKcF.js → Slider-DWobsPgm.js} +2 -2
  201. package/dist/Stack/index.d.ts +2 -2
  202. package/dist/Stack/index.js +2 -2
  203. package/dist/{Stack-iv52y_Jv.js → Stack-CTsTFfar.js} +18 -3
  204. package/dist/{Stack-gGcYdOAh.js → Stack-kQlYbbL4.js} +22 -7
  205. package/dist/StatusDot/index.d.ts +1 -1
  206. package/dist/StatusDot/index.js +1 -1
  207. package/dist/StatusDot-BPUhMOff.js +45 -0
  208. package/dist/Stepper/index.d.ts +1 -1
  209. package/dist/Stepper/index.js +1 -1
  210. package/dist/{Stepper-BqhVCgC-.js → Stepper-CE8dHysu.js} +1 -1
  211. package/dist/Switch/index.d.ts +1 -1
  212. package/dist/Switch/index.js +1 -1
  213. package/dist/{Switch-SesQzPGZ.js → Switch-DaVPRxvN.js} +2 -2
  214. package/dist/TabList/index.d.ts +2 -2
  215. package/dist/TabList/index.js +1 -1
  216. package/dist/{TabList-BlzkrObv.js → TabList-DIkK9sgK.js} +100 -23
  217. package/dist/Table/index.d.ts +3 -3
  218. package/dist/Table/index.js +2 -2
  219. package/dist/{Table-CsdH8fCB.js → Table-fecqnm7P.js} +870 -241
  220. package/dist/Text/index.d.ts +2 -2
  221. package/dist/Text/index.js +1 -1
  222. package/dist/{Text-DIzZw6FA.js → Text-CV3LmscH.js} +7 -2
  223. package/dist/TextArea/index.d.ts +1 -1
  224. package/dist/TextArea/index.js +1 -1
  225. package/dist/{TextArea-CPwSytdO.js → TextArea-Ab5Sw60T.js} +24 -14
  226. package/dist/TextInput/index.d.ts +1 -1
  227. package/dist/TextInput/index.js +1 -1
  228. package/dist/{TextInput-BasnjVvy.js → TextInput-zFT1_qgI.js} +21 -24
  229. package/dist/Thumbnail/index.js +1 -1
  230. package/dist/{Thumbnail-BnQwX1cQ.js → Thumbnail-C3NnJUFG.js} +5 -5
  231. package/dist/TimeField-CoHDGmsP.js +435 -0
  232. package/dist/TimeInput/index.d.ts +1 -1
  233. package/dist/TimeInput/index.js +1 -1
  234. package/dist/{TimeInput-C9gptCOK.js → TimeInput-D2k3Ux3p.js} +14 -2
  235. package/dist/Timer/index.d.ts +1 -1
  236. package/dist/Timer/index.js +1 -1
  237. package/dist/{Timer-kxzQx3tp.js → Timer-avMQk5DN.js} +1 -1
  238. package/dist/Timestamp/index.d.ts +1 -1
  239. package/dist/Timestamp/index.js +1 -1
  240. package/dist/{Timestamp-D7bd_nF3.js → Timestamp-xpQKCk0d.js} +7 -7
  241. package/dist/Toast/index.d.ts +3 -2
  242. package/dist/Toast/index.js +1 -1
  243. package/dist/{Toast-C2ML-bmi.js → Toast-BuqIZV5z.js} +136 -38
  244. package/dist/ToggleButton/index.d.ts +1 -1
  245. package/dist/ToggleButton/index.js +1 -1
  246. package/dist/{ToggleButton-BB_I8EdM.js → ToggleButton-B-C-Q7XP.js} +1 -1
  247. package/dist/Token/index.d.ts +1 -1
  248. package/dist/Token/index.js +1 -1
  249. package/dist/{Token-D2GsI_Ei.js → Token-DsntTYhQ.js} +33 -17
  250. package/dist/Tokenizer/index.d.ts +1 -1
  251. package/dist/Tokenizer/index.js +1 -1
  252. package/dist/Tokenizer-B5C_qY7t.js +585 -0
  253. package/dist/Toolbar/index.d.ts +2 -1
  254. package/dist/Tooltip/index.d.ts +2 -2
  255. package/dist/Tooltip/index.js +2 -2
  256. package/dist/Tooltip-C4Vaqd3G.js +320 -0
  257. package/dist/TopNav/index.d.ts +1 -1
  258. package/dist/TopNav/index.js +1 -1
  259. package/dist/{TopNav-arWFLTBM.js → TopNav-Ciq0l1w7.js} +122 -84
  260. package/dist/TreeList/index.d.ts +1 -1
  261. package/dist/TreeList/index.js +1 -1
  262. package/dist/{TreeList-C9xvMpJZ.js → TreeList-BUz-KZJd.js} +90 -40
  263. package/dist/Typeahead/index.d.ts +1 -1
  264. package/dist/Typeahead/index.js +2 -2
  265. package/dist/Typeahead-JP9RT87x.js +656 -0
  266. package/dist/{TypeaheadMenu-BEObzonz.js → TypeaheadMenu-DBW6rHeO.js} +133 -44
  267. package/dist/composables/index.d.ts +3 -3
  268. package/dist/composables/index.js +12 -7
  269. package/dist/{composables-CWw6t-RJ.js → composables-CbKx9C1Y.js} +424 -4
  270. package/dist/context-C_peZbXf.js +16 -0
  271. package/dist/context-M-er0-Rk.js +99 -0
  272. package/dist/{context-CPh7kE-a.js → context-iABt_ueM.js} +30 -4
  273. package/dist/{index-CLmKfnqf.d.ts → index-0QGtSf3r.d.ts} +2 -0
  274. package/dist/{index-z3uLM1O6.d.ts → index-B1WJxt-n.d.ts} +1 -1
  275. package/dist/{index-BPwD6aBv.d.ts → index-B3Fomy15.d.ts} +2 -2
  276. package/dist/{index-CPwzSbQQ.d.ts → index-B42oE_F-.d.ts} +17 -1
  277. package/dist/{index-EFqQF2Bx.d.ts → index-B4OOtNP8.d.ts} +2 -2
  278. package/dist/index-B7yhzGUT.d.ts +171 -0
  279. package/dist/{index-DFbvnBlf.d.ts → index-B9e52paP.d.ts} +15 -2
  280. package/dist/{index-CEB7Ywvw.d.ts → index-BKnyTWPM.d.ts} +1 -1
  281. package/dist/{index-CsVS37na.d.ts → index-BNbAJV9C.d.ts} +1 -1
  282. package/dist/index-BTK7aStw.d.ts +88 -0
  283. package/dist/{index-BBtJt5_A.d.ts → index-BULhhnGf.d.ts} +1 -1
  284. package/dist/{index-D7-WTV6I.d.ts → index-BVKivP59.d.ts} +2 -2
  285. package/dist/{index-BpH4wvsg.d.ts → index-BgT6mH3U.d.ts} +2 -2
  286. package/dist/{index-Be1czg3M.d.ts → index-BhpAUzUr.d.ts} +47 -7
  287. package/dist/{index-BcJBLWJ0.d.ts → index-BkjSF265.d.ts} +67 -4
  288. package/dist/{index-DxR1FChm.d.ts → index-Bu8NA2SD.d.ts} +49 -6
  289. package/dist/{index-HV6W3xCx.d.ts → index-Byar3h1e.d.ts} +1 -1
  290. package/dist/{index-C-QpeUlQ.d.ts → index-C2nbK2AA.d.ts} +52 -7
  291. package/dist/{index-iBLzInje.d.ts → index-C5e-7Obr.d.ts} +1 -1
  292. package/dist/index-CEv_AvOg.d.ts +17 -0
  293. package/dist/{index-Dgg0bHVM.d.ts → index-CICeEoZV.d.ts} +2 -1
  294. package/dist/{index-CB9Srua5.d.ts → index-CL1T2j4y.d.ts} +7 -4
  295. package/dist/{index-DjMwF8ET.d.ts → index-COgrQZIL.d.ts} +7 -1
  296. package/dist/{index-Ca8VIE4l.d.ts → index-CVn0GBdB.d.ts} +1 -1
  297. package/dist/{index-ChWlKHjc.d.ts → index-Cde5JvtX.d.ts} +15 -3
  298. package/dist/index-CitZGSn0.d.ts +39 -0
  299. package/dist/index-CkKPMIeX.d.ts +55 -0
  300. package/dist/{index-FEy8qFSD.d.ts → index-ClNU2Th8.d.ts} +30 -3
  301. package/dist/{index-kaKBOZSU.d.ts → index-Cq31D3fJ.d.ts} +99 -7
  302. package/dist/{index-xfkEuGLY.d.ts → index-CqE4Bf3Q.d.ts} +8 -2
  303. package/dist/{index-DtePJ_w_.d.ts → index-Crp3NFLW.d.ts} +2 -2
  304. package/dist/{index-BlOIC_AM.d.ts → index-CsNi1I8j.d.ts} +6 -0
  305. package/dist/index-Cyb9Du5Z.d.ts +76 -0
  306. package/dist/{index-4TRnFGxv.d.ts → index-D41_xqjs.d.ts} +50 -10
  307. package/dist/{index-eshFLli0.d.ts → index-D97pQbua.d.ts} +7 -0
  308. package/dist/{index-c67ca7eJ.d.ts → index-DEQ5cnUV.d.ts} +1 -1
  309. package/dist/{index-BmAxqw1G.d.ts → index-DG52Bg0W.d.ts} +15 -1
  310. package/dist/{index-Da7Jm8Ht.d.ts → index-DIXAzTKL.d.ts} +1 -1
  311. package/dist/{index-BmmdzwT9.d.ts → index-DNA2l1RN.d.ts} +35 -11
  312. package/dist/{index-B9rqmYxh.d.ts → index-DUaLJO7l.d.ts} +978 -313
  313. package/dist/index-DVmgNb78.d.ts +143 -0
  314. package/dist/{index-CDdRQQF3.d.ts → index-DWh2WC8W.d.ts} +18 -6
  315. package/dist/index-DXpSFlPG.d.ts +78 -0
  316. package/dist/{index-C_2Z65Rp.d.ts → index-DeQwYJbg.d.ts} +39 -2
  317. package/dist/{index-JL4auphT.d.ts → index-GI9xIV9l.d.ts} +2 -2
  318. package/dist/{index-Ctu32CLv.d.ts → index-IBAInumL.d.ts} +93 -56
  319. package/dist/{index-vizlhXVs.d.ts → index-T2FOcOuI.d.ts} +492 -16
  320. package/dist/{index-CA6RbRWx.d.ts → index-TXcNH86P.d.ts} +2 -2
  321. package/dist/{index-BIPc1v82.d.ts → index-TntQsADQ.d.ts} +1 -1
  322. package/dist/index-fAZaRruV.d.ts +125 -0
  323. package/dist/{index-COxy6LEW.d.ts → index-gW0HW02U.d.ts} +1 -1
  324. package/dist/{index-D5N9ikrS.d.ts → index-hCpxKePE.d.ts} +1 -1
  325. package/dist/{index-CpiWVbRZ.d.ts → index-i0tNFWfz.d.ts} +3 -1
  326. package/dist/{index-YmSe1ujk.d.ts → index-lgvUFSCO.d.ts} +1 -1
  327. package/dist/{index-bvr3WHvs.d.ts → index-xrzJC4wm.d.ts} +1 -1
  328. package/dist/{index-BK9T1TPZ.d.ts → index-yT1yiiww.d.ts} +28 -9
  329. package/dist/index.d.ts +80 -76
  330. package/dist/index.js +127 -113
  331. package/dist/link-C4_WogdF.js +18 -0
  332. package/dist/{index-C3GaPqvJ.d.ts → loadCatalog-BGHKG_9N.d.ts} +16 -37
  333. package/dist/{locale-sLw5Caia.js → loadCatalog-CXKqEB9s.js} +25 -65
  334. package/dist/locale/index.d.ts +3 -2
  335. package/dist/locale/index.js +4 -3
  336. package/dist/locale-DgkZEMTn.js +105 -0
  337. package/dist/{searchResultMessage-CCnq-_ce.js → searchResultMessage-hXXNOFJP.js} +2 -2
  338. package/dist/{size-xcIqExkS.js → size-Cpn_wzXi.js} +1 -1
  339. package/dist/{types-3eXh_5os.d.ts → types-0Q_SJv_F.d.ts} +3 -1
  340. package/dist/types-BRfVvZTH.d.ts +108 -0
  341. package/dist/{types-D7QNSqoN.d.ts → types-BTk0WZ0b.d.ts} +8 -0
  342. package/dist/{types-D_J66aPN.d.ts → types-BnNTzEnd.d.ts} +5 -1
  343. package/dist/{types-D9nP_X-c.d.ts → types-Ckih2YJi.d.ts} +9 -2
  344. package/dist/{types-Db3Owy8Q.d.ts → types-OGMYGejX.d.ts} +5 -0
  345. package/dist/{index-nKlTsNfV.d.ts → types-uFMH9NaM.d.ts} +14 -17
  346. package/dist/{useAnchoredListbox-BN9LQnon.js → useAnchoredListbox-DwztMNjP.js} +9 -4
  347. package/dist/useDevWarning-DznOpOHT.js +36 -0
  348. package/dist/useInputContainer-CpgDe2-4.js +51 -0
  349. package/dist/useInputStatusIcon-DBOwxV4x.js +41 -0
  350. package/dist/useInteractiveRole-Cn0Nd5GX.js +25 -0
  351. package/dist/{useMenuDrillIn-BgjJcY3K.js → useMenuDrillIn-DzKGkTho.js} +1 -1
  352. package/dist/{useMenuPress-DUmEy4TB.js → useMenuPress-D-FRNrBW.js} +162 -14
  353. package/dist/useMergedRefs-CfHHlCsn.js +109 -0
  354. package/dist/useNumberField-4-dIGVed.js +128 -0
  355. package/dist/{usePositionedLayer-C1NBOsVT.js → usePositionedLayer-Cru9_00b.js} +70 -7
  356. package/dist/useResizable-DDwPpPe6.d.ts +409 -0
  357. package/dist/useRestoreFocus-Djw9RUIf.js +153 -0
  358. package/dist/useScrollbars-C2NJ6Qwq.js +43 -0
  359. package/dist/{useTimeValue-DWk6oTAZ.js → useTimeValue-6ufHM15W.js} +1 -1
  360. package/dist/utils-D33VQDnk.js +58 -0
  361. package/locales/SOURCE.json +1 -1
  362. package/locales/en.json +445 -1
  363. package/package.json +19 -2
  364. package/styles/avatar-group.css +19 -1
  365. package/styles/avatar.css +34 -13
  366. package/styles/chat.css +17 -1
  367. package/styles/dialog-header.css +5 -1
  368. package/styles/field.css +11 -0
  369. package/styles/heading.css +9 -0
  370. package/styles/indicator-focus-ring.css +18 -0
  371. package/styles/number-input.css +33 -0
  372. package/styles/pressable.css +44 -0
  373. package/styles/progress-bar.css +18 -0
  374. package/styles/scrollbars.css +28 -0
  375. package/styles/side-nav.css +20 -6
  376. package/styles/stack.css +4 -2
  377. package/styles/status-dot.css +18 -0
  378. package/styles/tab-list.css +38 -2
  379. package/styles/table.css +66 -6
  380. package/styles/text.css +9 -0
  381. package/styles/time-input.css +41 -0
  382. package/styles/top-nav.css +46 -19
  383. package/styles/typeahead.css +31 -0
  384. package/styles.css +2 -0
  385. package/dist/AvatarGroup-QyzSrpYA.js +0 -60
  386. package/dist/DateInput-D4XFAEMp.js +0 -743
  387. package/dist/FieldLabel-DmmJyX7w.js +0 -184
  388. package/dist/FileInput-DuNwdbAo.js +0 -238
  389. package/dist/HoverCard-EhbWaGOW.js +0 -443
  390. package/dist/NumberInput-B4IL3s_8.js +0 -210
  391. package/dist/Popover-D7zqpFwU.js +0 -215
  392. package/dist/StatusDot-CaoIapp4.js +0 -27
  393. package/dist/TimeField-Biiuv0hB.js +0 -214
  394. package/dist/Tokenizer-rwzamZg4.js +0 -473
  395. package/dist/Tooltip-C2fh9anJ.js +0 -271
  396. package/dist/Typeahead-_V11btpv.js +0 -499
  397. package/dist/index-Blm197N_.d.ts +0 -82
  398. package/dist/index-Bt7ewoz2.d.ts +0 -119
  399. package/dist/index-C1HIqW_H.d.ts +0 -38
  400. package/dist/index-CngORuiq.d.ts +0 -387
  401. package/dist/index-D4I_obqR.d.ts +0 -58
  402. package/dist/link-CdcUSxAj.js +0 -12
  403. package/dist/size-BuTzpgnR.d.ts +0 -14
  404. package/dist/types-Cp4liug-.d.ts +0 -170
  405. package/dist/useDismiss-Cj8x_51F.js +0 -62
  406. package/dist/useNumberField-DL-Radsp.js +0 -49
  407. package/dist/useResizable-CUoNPmUw.d.ts +0 -72
  408. package/dist/useRestoreFocus-BvMdXVX9.js +0 -96
  409. package/dist/utils-C9r3UD_y.js +0 -16
@@ -1,15 +1,20 @@
1
1
  import { t as _sfc_main$14 } from "./VisuallyHidden-C7NN3VEP.js";
2
- import { t as _sfc_main$15 } from "./Button-DrqeomlE.js";
3
- import { o as useAstryxMessages } from "./context-CPh7kE-a.js";
4
- import { t as _sfc_main$16 } from "./Tooltip-C2fh9anJ.js";
5
- import { t as _sfc_main$17 } from "./IconButton-BNQuz9W_.js";
2
+ import { t as _sfc_main$15 } from "./Button-B6Hj_O_s.js";
3
+ import { t as _sfc_main$16 } from "./IconButton-DDNgNl7B.js";
4
+ import { o as useAstryxMessages } from "./context-iABt_ueM.js";
5
+ import { t as _sfc_main$17 } from "./Tooltip-C4Vaqd3G.js";
6
+ import { t as useScrollbars } from "./useScrollbars-C2NJ6Qwq.js";
6
7
  import { t as _sfc_main$18 } from "./Icon-bteSId7T.js";
7
- import { t as _sfc_main$19 } from "./CheckboxInput-25Q8ItH-.js";
8
- import { t as _sfc_main$20 } from "./Popover-D7zqpFwU.js";
9
- import { t as _sfc_main$21 } from "./Pagination-CNe9F6Fl.js";
10
- import { t as _sfc_main$22 } from "./Selector-5N-hq2nF.js";
11
- import { t as _sfc_main$23 } from "./TextInput-BasnjVvy.js";
12
- import { Fragment, Teleport, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, h, mergeProps, nextTick, normalizeClass, normalizeStyle, onBeforeUnmount, onMounted, onScopeDispose, openBlock, ref, renderList, renderSlot, toDisplayString, toValue, unref, watch, withCtx, withModifiers } from "vue";
8
+ import { t as _sfc_main$19 } from "./CheckboxInput-BS9J6edf.js";
9
+ import { t as _sfc_main$20 } from "./Popover-DJf8POzL.js";
10
+ import { t as _sfc_main$21 } from "./DateInput-DT518j5E.js";
11
+ import { t as _sfc_main$22 } from "./MultiSelector-BtAUfQ3t.js";
12
+ import { t as _sfc_main$23 } from "./NumberInput-AZ9x3oja.js";
13
+ import { t as _sfc_main$24 } from "./Pagination-DqwNQFRp.js";
14
+ import { t as _sfc_main$25 } from "./Selector-DJ2BhUTV.js";
15
+ import { t as _sfc_main$26 } from "./TextInput-zFT1_qgI.js";
16
+ import { t as _sfc_main$27 } from "./Toolbar-BrgvvTCk.js";
17
+ import { Fragment, Teleport, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, h, mergeProps, nextTick, normalizeClass, normalizeStyle, onBeforeUnmount, onMounted, onScopeDispose, openBlock, ref, renderList, renderSlot, toDisplayString, toValue, unref, useTemplateRef, watch, withCtx, withModifiers } from "vue";
13
18
  import "../styles/table.css";
14
19
  function proportional(value = 1, options) {
15
20
  return {
@@ -163,36 +168,140 @@ function compareValues(a, b) {
163
168
  }
164
169
  //#endregion
165
170
  //#region src/Table/plugins/columnResize.ts
171
+ /** 宽度的类型。没写宽度按比例列处理。 */
172
+ function isProportionalColumnWidth(width) {
173
+ return width == null || width.type === "proportional";
174
+ }
175
+ /**
176
+ * 一列能拖到的最窄像素。
177
+ * 全局 `minWidth` 优先,其次列自己声明的下限,再退到默认值:没写宽度 60px,比例列 120px。
178
+ * 固定像素列不能比它声明的宽度更窄。
179
+ */
180
+ function columnResizeMinWidth(width, globalMinWidth) {
181
+ if (globalMinWidth != null) return globalMinWidth;
182
+ if (width == null) return 60;
183
+ if (width.type === "proportional") return width.minWidth ?? 120;
184
+ if (width.type === "pixel") return width.value;
185
+ return 60;
186
+ }
187
+ /**
188
+ * 按拖动位移算出每一列的新宽度。
189
+ *
190
+ * 有相邻列时两列一增一减,表格总宽不变;没有相邻列时只改这一列,钳在它自己的上下限里。
191
+ * 表格宽度已知时,最后一列总是吃掉剩下的空间,所以表格保持撑满。
192
+ */
193
+ function resizeColumnWidths(plan, delta) {
194
+ const { snapshots, resizeIndex, neighborIndex, tableWidth } = plan;
195
+ const widths = snapshots.map((snapshot) => snapshot.initialWidth);
196
+ const self = snapshots[resizeIndex];
197
+ if (self == null) return widths;
198
+ if (neighborIndex != null) {
199
+ const neighbor = snapshots[neighborIndex];
200
+ if (neighbor != null) {
201
+ const room = neighbor.initialWidth - neighbor.minWidth;
202
+ const give = Math.max(self.minWidth - self.initialWidth, Math.min(delta, room));
203
+ widths[neighborIndex] = neighbor.initialWidth - give;
204
+ widths[resizeIndex] = self.initialWidth + give;
205
+ }
206
+ } else widths[resizeIndex] = Math.min(self.maxWidth, Math.max(self.minWidth, self.initialWidth + delta));
207
+ const last = snapshots.length - 1;
208
+ if (last >= 0 && tableWidth > 0) {
209
+ let used = 0;
210
+ for (let index = 0; index < widths.length; index++) if (index !== last) used += widths[index] ?? 0;
211
+ widths[last] = Math.max(snapshots[last]?.minWidth ?? 0, tableWidth - used);
212
+ }
213
+ return widths;
214
+ }
215
+ /** 横向位移的方向。RTL 里往右拖等于把列变窄。 */
216
+ function columnResizeDirectionSign(direction) {
217
+ return direction === "rtl" ? -1 : 1;
218
+ }
219
+ /** 键盘按一下走多少像素。按住 Shift 走大步。 */
220
+ function columnResizeStep(isShiftKey) {
221
+ return isShiftKey ? 50 : 10;
222
+ }
223
+ function roundWidth(value) {
224
+ return Math.round(value);
225
+ }
166
226
  function useTableColumnResize(config) {
167
227
  return {
168
228
  widthFor(column) {
169
- return toValue(config).columnWidths[column.key];
229
+ return toValue(config).columnWidths?.[column.key];
230
+ },
231
+ resizeFor(column, columns) {
232
+ if (column.resizable === false) return null;
233
+ const current = toValue(config);
234
+ const resizable = (current.columns ?? columns).filter((item) => item.resizable !== false);
235
+ const index = resizable.findIndex((item) => item.key === column.key);
236
+ const isLast = index >= 0 && index === resizable.length - 1;
237
+ const isProportional = isProportionalColumnWidth(column.width);
238
+ const neighbor = isProportional && index >= 0 && index < resizable.length - 1 ? resizable[index + 1]?.key ?? null : null;
239
+ return {
240
+ currentWidth: current.columnWidths?.[column.key],
241
+ minWidth: columnResizeMinWidth(column.width, current.minWidth),
242
+ maxWidth: current.maxWidth ?? Number.POSITIVE_INFINITY,
243
+ neighborKey: neighbor,
244
+ hasHandle: !(isLast && isProportional)
245
+ };
170
246
  },
171
- onColumnResizeEnd(key, width) {
172
- toValue(config).onColumnResizeEnd({ [key]: Math.max(60, Math.round(width)) });
247
+ onColumnResizeEnd(updates) {
248
+ const current = toValue(config);
249
+ if (current.onColumnResizeEnd == null) return;
250
+ const rounded = {};
251
+ for (const [key, width] of Object.entries(updates)) rounded[key] = roundWidth(width);
252
+ current.onColumnResizeEnd(rounded);
173
253
  }
174
254
  };
175
255
  }
176
256
  //#endregion
177
257
  //#region src/Table/plugins/columnSettings.ts
178
258
  function useTableColumnSettingsState(config) {
259
+ function lockedKeys() {
260
+ return config.columns.filter((column) => column.isAlwaysVisible).map((column) => column.key);
261
+ }
262
+ function lockedSet() {
263
+ return new Set(lockedKeys());
264
+ }
265
+ function toggleColumn(key) {
266
+ if (lockedSet().has(key)) return;
267
+ const current = toValue(config.activeColumnKeys);
268
+ if (current.includes(key)) config.onChangeActiveColumnKeys(current.filter((item) => item !== key));
269
+ else config.onChangeActiveColumnKeys([...current, key]);
270
+ }
179
271
  function setActiveColumnKeys(keys) {
180
- const locked = config.columns.filter((column) => column.isAlwaysVisible).map((column) => column.key);
181
- const next = [...keys];
182
- for (const key of locked) if (!next.includes(key)) next.unshift(key);
183
- config.onChangeActiveColumnKeys(next);
272
+ const next = new Set(keys);
273
+ for (const key of lockedKeys()) next.add(key);
274
+ config.onChangeActiveColumnKeys([...next]);
275
+ }
276
+ function showAllColumns() {
277
+ config.onChangeActiveColumnKeys(config.columns.map((column) => column.key));
278
+ }
279
+ function resetToDefault() {
280
+ if (config.defaultColumnKeys != null) {
281
+ config.onChangeActiveColumnKeys([...config.defaultColumnKeys]);
282
+ return;
283
+ }
284
+ showAllColumns();
184
285
  }
185
286
  return {
186
287
  get activeColumnKeys() {
187
288
  return toValue(config.activeColumnKeys);
188
289
  },
290
+ toggleColumn,
291
+ isColumnActive: (key) => toValue(config.activeColumnKeys).includes(key),
292
+ isColumnToggleable: (key) => !lockedSet().has(key),
293
+ showAllColumns,
294
+ resetToDefault,
189
295
  setActiveColumnKeys,
190
296
  columnSettingsConfig: {
191
297
  columns: config.columns,
192
298
  get activeColumnKeys() {
193
299
  return toValue(config.activeColumnKeys);
194
300
  },
195
- onChangeActiveColumnKeys: setActiveColumnKeys
301
+ onChangeActiveColumnKeys: setActiveColumnKeys,
302
+ get defaultColumnKeys() {
303
+ return config.defaultColumnKeys;
304
+ }
196
305
  }
197
306
  };
198
307
  }
@@ -205,11 +314,24 @@ function useTableColumnSettings(config) {
205
314
  }
206
315
  //#endregion
207
316
  //#region src/Table/plugins/filtering.ts
208
- function useTableFilterState(initial = {}) {
209
- const filters = ref({ ...initial });
317
+ function isEmptyValue(value) {
318
+ if (value == null || value === "") return true;
319
+ return Array.isArray(value) && value.length === 0;
320
+ }
321
+ function resolveInitialState(initial) {
322
+ if (initial == null) return {};
323
+ const options = initial.initialState;
324
+ if (options != null && typeof options === "object") return { ...options };
325
+ return { ...initial };
326
+ }
327
+ /**
328
+ * 托住过滤条件。位置参数可以直接给初始条件,也可以写成 `{ initialState }`。
329
+ */
330
+ function useTableFilterState(initial) {
331
+ const filters = ref(resolveInitialState(initial));
210
332
  function onFilterChange(key, value) {
211
333
  const next = { ...filters.value };
212
- if (value == null || value === "" || Array.isArray(value) && value.length === 0) delete next[key];
334
+ if (value == null || isEmptyValue(value)) delete next[key];
213
335
  else next[key] = value;
214
336
  filters.value = next;
215
337
  }
@@ -222,32 +344,92 @@ function useTableFilterState(initial = {}) {
222
344
  clearAll
223
345
  };
224
346
  }
347
+ function toComparableNumber(value) {
348
+ if (typeof value === "number") return Number.isNaN(value) ? null : value;
349
+ if (value instanceof Date) return value.getTime();
350
+ if (typeof value === "string") {
351
+ const trimmed = value.trim();
352
+ if (trimmed === "") return null;
353
+ const parsed = Number(trimmed);
354
+ return Number.isNaN(parsed) ? null : parsed;
355
+ }
356
+ return null;
357
+ }
358
+ function toTimestamp(value) {
359
+ if (value instanceof Date) return Number.isNaN(value.getTime()) ? null : value.getTime();
360
+ if (typeof value === "number") return Number.isNaN(value) ? null : value;
361
+ if (typeof value === "string") {
362
+ const parsed = Date.parse(value);
363
+ return Number.isNaN(parsed) ? null : parsed;
364
+ }
365
+ return null;
366
+ }
367
+ /** 单元格的值看成一组可比较的文本。数组格的每一项都算一个值。 */
368
+ function cellValues(cell) {
369
+ if (Array.isArray(cell)) return cell.map((item) => cellText(item).toLowerCase());
370
+ return [cellText(cell).toLowerCase()];
371
+ }
372
+ function matchesField(value, cell, kind) {
373
+ switch (kind) {
374
+ case "enum":
375
+ case "multi-select": {
376
+ const selected = (Array.isArray(value) ? value : [value]).map((item) => String(item).toLowerCase());
377
+ const values = cellValues(cell);
378
+ return selected.some((item) => values.includes(item));
379
+ }
380
+ case "number": {
381
+ const target = toComparableNumber(value);
382
+ const actual = toComparableNumber(cell);
383
+ return target != null && actual != null && target === actual;
384
+ }
385
+ case "date": {
386
+ const target = toTimestamp(value);
387
+ const actual = toTimestamp(cell);
388
+ return target != null && actual != null && actual > target;
389
+ }
390
+ default: return cellText(cell).toLowerCase().includes(String(value).toLowerCase());
391
+ }
392
+ }
393
+ /**
394
+ * 按当前过滤条件挑出符合条件的行。每个条件都要满足。
395
+ * `string` 匹配子串,`enum` / `multi-select` 匹配选项,`number` 比数值,`date` 要求单元格日期更晚。
396
+ */
225
397
  function applyTableFilters(rows, filters, fields = []) {
226
398
  const kinds = new Map(fields.map((field) => [field.key, field.type]));
227
- const active = Object.entries(filters).filter(([, value]) => value != null && value !== "" && !(Array.isArray(value) && value.length === 0));
399
+ const active = Object.entries(filters).filter(([, value]) => !isEmptyValue(value));
228
400
  if (active.length === 0) return [...rows];
229
401
  return rows.filter((row) => active.every(([key, value]) => {
230
- const cell = String(row[key] ?? "").toLowerCase();
231
- if ((kinds.get(key) ?? (Array.isArray(value) ? "enum" : "string")) === "enum") return (Array.isArray(value) ? value : [value]).some((item) => cell === item.toLowerCase());
232
- return cell.includes(String(value).toLowerCase());
402
+ const kind = kinds.get(key) ?? (Array.isArray(value) ? "multi-select" : "string");
403
+ return matchesField(value, row[key], kind);
233
404
  }));
234
405
  }
235
406
  function useTableFiltering(config) {
236
- return { filterFor(column) {
237
- if (column.filter == null) return null;
238
- const current = toValue(config);
239
- const fieldKey = column.filter;
240
- const field = current.fields.find((item) => item.key === fieldKey);
241
- if (field == null) return null;
242
- return {
243
- variant: current.variant ?? "popover",
244
- field,
245
- value: current.filters[fieldKey] ?? null,
246
- onChange(value) {
247
- toValue(config).onFilterChange(fieldKey, value);
248
- }
249
- };
250
- } };
407
+ const variantOf = () => toValue(config).variant ?? "popover";
408
+ return {
409
+ transformColumns(columns) {
410
+ const variant = variantOf();
411
+ if (variant !== "inline" && variant !== "inline-compact") return columns;
412
+ return columns.map((column) => column.filter != null && column.width == null ? {
413
+ ...column,
414
+ width: proportional(1)
415
+ } : column);
416
+ },
417
+ filterFor(column) {
418
+ if (column.filter == null) return null;
419
+ const current = toValue(config);
420
+ const fieldKey = column.filter;
421
+ const field = current.fields.find((item) => item.key === fieldKey);
422
+ if (field == null) return null;
423
+ return {
424
+ variant: current.variant ?? "popover",
425
+ field,
426
+ value: current.filters[fieldKey] ?? null,
427
+ onChange(value) {
428
+ toValue(config).onFilterChange(fieldKey, value);
429
+ }
430
+ };
431
+ }
432
+ };
251
433
  }
252
434
  //#endregion
253
435
  //#region src/Table/plugins/groupedRows.ts
@@ -353,29 +535,56 @@ function isInteractiveRowClick(event) {
353
535
  //#endregion
354
536
  //#region src/Table/plugins/pagination.ts
355
537
  function useTablePagination(config) {
356
- function controls() {
538
+ const messages = useAstryxMessages();
539
+ function pageCount(current) {
540
+ if (current.totalPages != null) return current.totalPages;
541
+ if (current.totalItems == null) return void 0;
542
+ const size = current.pageSize ?? 10;
543
+ const pageSize = Number.isFinite(size) ? Math.max(1, Math.floor(size)) : 10;
544
+ return Math.ceil(current.totalItems / pageSize);
545
+ }
546
+ /** 只有一页、也没有下一页时整个控件不出现,和原版一致。 */
547
+ function isVisible(current) {
548
+ if ((current.position ?? "below") === "none") return false;
549
+ return !(pageCount(current) === 1 && current.hasMore !== true);
550
+ }
551
+ function controls(place) {
357
552
  const current = toValue(config);
358
- if ((current.position ?? "below") === "none") return null;
359
- const pageSize = current.pageSize ?? 10;
553
+ if (!isVisible(current)) return null;
554
+ const size = current.pageSize ?? 10;
555
+ const pageSize = Number.isFinite(size) ? Math.max(1, Math.floor(size)) : 10;
556
+ const label = current.label ?? messages.value.table.paginationLabel;
360
557
  return h("div", {
361
558
  "class": "astryx-table__pagination",
362
- "data-align": current.align ?? "center"
363
- }, [h(_sfc_main$21, {
559
+ "data-align": current.align ?? "center",
560
+ "data-place": place
561
+ }, [h(_sfc_main$24, {
364
562
  "page": current.page,
365
563
  pageSize,
366
564
  "total": current.totalItems ?? 0,
565
+ "totalPages": pageCount(current),
566
+ "hasMore": current.hasMore,
567
+ "variant": current.variant ?? "pages",
568
+ "size": current.size ?? "md",
367
569
  "showSizeChanger": current.pageSizeOptions != null && current.onPageSizeChange != null,
368
570
  "pageSizeOptions": current.pageSizeOptions,
369
- "aria-label": current.label,
571
+ "label": (current.position ?? "below") === "both" ? place === "above" ? messages.value.table.paginationLabelAbove(label) : messages.value.table.paginationLabelBelow(label) : label,
370
572
  "onUpdate:page": (page) => toValue(config).onPageChange(page),
371
573
  "onUpdate:pageSize": (size) => toValue(config).onPageSizeChange?.(size)
372
574
  })]);
373
575
  }
374
- return { below() {
375
- const position = toValue(config).position ?? "below";
376
- if (position === "above" || position === "none") return null;
377
- return controls();
378
- } };
576
+ return {
577
+ above() {
578
+ const position = toValue(config).position ?? "below";
579
+ if (position !== "above" && position !== "both") return null;
580
+ return controls("above");
581
+ },
582
+ below() {
583
+ const position = toValue(config).position ?? "below";
584
+ if (position !== "below" && position !== "both") return null;
585
+ return controls("below");
586
+ }
587
+ };
379
588
  }
380
589
  //#endregion
381
590
  //#region src/Table/TableExpansionChevron.vue
@@ -550,7 +759,7 @@ function useTableRowStatus(config) {
550
759
  const status = toValue(config).getStatus(item);
551
760
  if (status == null) return null;
552
761
  const customColor = status.status == null && status.icon != null && NAMED_ICON_COLOR[status.color] == null ? status.color : void 0;
553
- return h(_sfc_main$16, { content: status.label }, { default: () => h("span", {
762
+ return h(_sfc_main$17, { content: status.label }, { default: () => h("span", {
554
763
  "class": "astryx-table__status",
555
764
  "role": "img",
556
765
  "aria-label": status.label,
@@ -563,39 +772,85 @@ function useTableRowStatus(config) {
563
772
  //#endregion
564
773
  //#region src/Table/plugins/selection.ts
565
774
  function rowId(row, idKey) {
775
+ if (typeof idKey === "function") return String(idKey(row));
566
776
  return String(row[idKey] ?? "");
567
777
  }
568
778
  function useTableSelectionState(config) {
569
- const selectable = computed(() => toValue(config.data));
570
- return { selectionConfig: {
571
- getIsItemSelected: (item) => toValue(config.selectedKeys).has(rowId(item, config.idKey)),
572
- onSelectItem: ({ item, isSelected }) => {
573
- const next = new Set(toValue(config.selectedKeys));
574
- const id = rowId(item, config.idKey);
575
- if (isSelected) next.add(id);
576
- else next.delete(id);
577
- config.setSelectedKeys(next);
578
- },
579
- onSelectAll: ({ isAllSelected }) => {
580
- config.setSelectedKeys(isAllSelected ? new Set(toValue(config.data).map((item) => rowId(item, config.idKey))) : /* @__PURE__ */ new Set());
581
- },
582
- getIsAllSelected: () => {
583
- const rows = toValue(config.data);
584
- const selected = toValue(config.selectedKeys);
585
- return rows.length > 0 && rows.every((item) => selected.has(rowId(item, config.idKey)));
586
- },
587
- getIsIndeterminate: () => {
588
- const rows = toValue(config.data);
589
- const selected = toValue(config.selectedKeys);
590
- const count = rows.filter((item) => selected.has(rowId(item, config.idKey))).length;
591
- return count > 0 && count < rows.length;
779
+ const rows = () => toValue(config.data);
780
+ const selectedKeys = () => toValue(config.selectedKeys);
781
+ const isSelectable = (item) => config.getIsItemSelectable?.(item) ?? true;
782
+ const isEnabled = (item) => config.getIsItemEnabled?.(item) ?? true;
783
+ /** 能勾的行:既显示复选框,又没被禁用。 */
784
+ const isTogglable = (item) => isSelectable(item) && isEnabled(item);
785
+ const keysOf = (items) => new Set(items.map((item) => rowId(item, config.idKey)));
786
+ /** 全选时要打开的键:已选中的加上所有能勾的行。 */
787
+ function selectableKeys() {
788
+ return keysOf(rows().filter(isTogglable));
789
+ }
790
+ /** 全选时要保留的键:不在可勾集合里的(点名选中、被禁用、不在当前数据里)一律保留。 */
791
+ function frozenKeys() {
792
+ const selectable = selectableKeys();
793
+ const frozen = /* @__PURE__ */ new Set();
794
+ for (const key of selectedKeys()) if (!selectable.has(key)) frozen.add(key);
795
+ return frozen;
796
+ }
797
+ function write(keys) {
798
+ config.setSelectedKeys(keys);
799
+ }
800
+ return {
801
+ selectionConfig: {
802
+ getIsItemSelected: (item) => selectedKeys().has(rowId(item, config.idKey)),
803
+ onSelectItem: ({ item, isSelected }) => {
804
+ const next = new Set(selectedKeys());
805
+ const id = rowId(item, config.idKey);
806
+ if (isSelected) next.add(id);
807
+ else next.delete(id);
808
+ write(next);
809
+ },
810
+ onSelectAll: ({ isAllSelected }) => {
811
+ if (!isAllSelected) {
812
+ write(frozenKeys());
813
+ return;
814
+ }
815
+ const next = new Set(selectedKeys());
816
+ for (const key of selectableKeys()) next.add(key);
817
+ write(next);
818
+ },
819
+ getIsAllSelected: () => {
820
+ const selectable = selectableKeys();
821
+ if (selectable.size === 0) return false;
822
+ const keys = selectedKeys();
823
+ for (const key of selectable) if (!keys.has(key)) return false;
824
+ return true;
825
+ },
826
+ getIsIndeterminate: () => {
827
+ const selectable = selectableKeys();
828
+ const keys = selectedKeys();
829
+ let count = 0;
830
+ for (const key of selectable) if (keys.has(key)) count += 1;
831
+ return count > 0 && count < selectable.size;
832
+ },
833
+ getIsItemSelectable: isSelectable,
834
+ getIsItemEnabled: isEnabled,
835
+ getRowLabel: config.getRowLabel,
836
+ hasRowHighlight: config.hasRowHighlight,
837
+ get rows() {
838
+ return rows();
839
+ }
592
840
  },
593
- getRowLabel: config.getRowLabel,
594
- hasRowHighlight: config.hasRowHighlight,
595
- get rows() {
596
- return selectable.value;
841
+ selectionState: {
842
+ get selectedKeys() {
843
+ return selectedKeys();
844
+ },
845
+ get selectedCount() {
846
+ return selectedKeys().size;
847
+ },
848
+ get hasSelection() {
849
+ return selectedKeys().size > 0;
850
+ },
851
+ clearSelection: () => write(/* @__PURE__ */ new Set())
597
852
  }
598
- } };
853
+ };
599
854
  }
600
855
  function useTableSelection(config) {
601
856
  return { selection: {
@@ -603,6 +858,7 @@ function useTableSelection(config) {
603
858
  isIndeterminate: () => toValue(config).getIsIndeterminate?.() ?? false,
604
859
  isSelected: (row) => toValue(config).getIsItemSelected(row),
605
860
  isSelectable: (row) => toValue(config).getIsItemSelectable?.(row) ?? true,
861
+ isEnabled: (row) => toValue(config).getIsItemEnabled?.(row) ?? true,
606
862
  selectAll: (selected) => toValue(config).onSelectAll({ isAllSelected: selected }),
607
863
  selectRow: (row, selected) => toValue(config).onSelectItem({
608
864
  item: row,
@@ -1028,8 +1284,101 @@ function useTableTreeState(config) {
1028
1284
  };
1029
1285
  }
1030
1286
  //#endregion
1287
+ //#region src/Table/TableDataRenderers.ts
1288
+ /**
1289
+ * 渲染单元格内容:优先走列自己的 renderCell,没给就回退成纯文本。
1290
+ */
1291
+ const CellContent = defineComponent({
1292
+ name: "AstryxTableCellContent",
1293
+ props: {
1294
+ column: {
1295
+ type: Object,
1296
+ required: true
1297
+ },
1298
+ row: {
1299
+ type: Object,
1300
+ required: true
1301
+ },
1302
+ index: {
1303
+ type: Number,
1304
+ required: true
1305
+ }
1306
+ },
1307
+ setup(cellProps) {
1308
+ return () => {
1309
+ const column = cellProps.column;
1310
+ const row = cellProps.row;
1311
+ const rendered = column.renderCell?.(row, cellProps.index);
1312
+ if (rendered == null) return cellText(row[column.key]);
1313
+ return rendered;
1314
+ };
1315
+ }
1316
+ });
1317
+ /**
1318
+ * 把外部传入的 render 函数包成组件,让模板里能直接当标签用。
1319
+ */
1320
+ const RenderFn = defineComponent({
1321
+ name: "AstryxTableRenderFn",
1322
+ props: { render: {
1323
+ type: Function,
1324
+ required: true
1325
+ } },
1326
+ setup(renderProps) {
1327
+ return () => renderProps.render();
1328
+ }
1329
+ });
1330
+ /**
1331
+ * 表头单元格里留给插件的扩展位。
1332
+ */
1333
+ const HeaderAddon = defineComponent({
1334
+ name: "AstryxTableHeaderAddon",
1335
+ props: {
1336
+ column: {
1337
+ type: Object,
1338
+ required: true
1339
+ },
1340
+ plugins: {
1341
+ type: Array,
1342
+ required: true
1343
+ }
1344
+ },
1345
+ setup(addonProps) {
1346
+ return () => {
1347
+ const column = addonProps.column;
1348
+ const nodes = [];
1349
+ for (const plugin of addonProps.plugins) {
1350
+ const before = plugin.headerPatch?.(column)?.before?.();
1351
+ if (before != null) nodes.push(before);
1352
+ }
1353
+ return nodes;
1354
+ };
1355
+ }
1356
+ });
1357
+ /**
1358
+ * 渲染插件挂在表格上方或下方的内容。
1359
+ */
1360
+ const PluginFooter = defineComponent({
1361
+ name: "AstryxTablePluginFooter",
1362
+ props: {
1363
+ plugin: {
1364
+ type: Object,
1365
+ required: true
1366
+ },
1367
+ place: {
1368
+ type: String,
1369
+ default: "below"
1370
+ }
1371
+ },
1372
+ setup(footerProps) {
1373
+ return () => {
1374
+ const plugin = footerProps.plugin;
1375
+ return (footerProps.place === "above" ? plugin.above?.() : plugin.below?.()) ?? null;
1376
+ };
1377
+ }
1378
+ });
1379
+ //#endregion
1031
1380
  //#region src/Table/TableFilterControl.vue
1032
- const _hoisted_1$8 = { class: "astryx-table__filter" };
1381
+ const _hoisted_1$8 = ["data-variant"];
1033
1382
  const _hoisted_2$3 = { class: "astryx-table__filter-popover" };
1034
1383
  const _hoisted_3$2 = { class: "astryx-table__filter-actions" };
1035
1384
  const _sfc_main$11 = /*@__PURE__*/ defineComponent({
@@ -1038,69 +1387,209 @@ const _sfc_main$11 = /*@__PURE__*/ defineComponent({
1038
1387
  setup(__props) {
1039
1388
  const props = __props;
1040
1389
  const messages = useAstryxMessages();
1041
- const draft = ref(typeof props.filter.value === "string" ? props.filter.value : "");
1390
+ const draft = ref(props.filter.value);
1391
+ const isCompact = computed(() => props.filter.variant === "inline-compact");
1042
1392
  watch(() => props.filter.value, (value) => {
1043
- draft.value = typeof value === "string" ? value : "";
1393
+ draft.value = value;
1044
1394
  });
1045
1395
  function commit(value) {
1046
1396
  props.filter.onChange(value);
1047
1397
  }
1048
- function onInlineInput(value) {
1398
+ function textValue(value) {
1399
+ return typeof value === "string" ? value : "";
1400
+ }
1401
+ function numberValue(value) {
1402
+ return typeof value === "number" ? value : null;
1403
+ }
1404
+ function dateValue(value) {
1405
+ if (typeof value !== "string" || value === "") return null;
1406
+ const parsed = new Date(value);
1407
+ return Number.isNaN(parsed.getTime()) ? null : parsed;
1408
+ }
1409
+ function listValue(value) {
1410
+ return Array.isArray(value) ? value : [];
1411
+ }
1412
+ const options = computed(() => props.filter.field.options ?? []);
1413
+ const step = computed(() => props.filter.field.step ?? (props.filter.field.isIntegerOnly ? 1 : null));
1414
+ function onTextInput(value) {
1049
1415
  draft.value = value;
1050
1416
  commit(value === "" ? null : value);
1051
1417
  }
1418
+ function onNumberInput(value) {
1419
+ draft.value = value;
1420
+ commit(value);
1421
+ }
1422
+ function onDateInput(value) {
1423
+ const next = value == null ? null : value.toISOString().slice(0, 10);
1424
+ draft.value = next;
1425
+ commit(next);
1426
+ }
1427
+ function onSingleSelect(value) {
1428
+ const next = value == null || value === "" ? null : String(value);
1429
+ draft.value = next;
1430
+ commit(next);
1431
+ }
1432
+ function onMultiSelect(value) {
1433
+ const next = value.map(String);
1434
+ draft.value = next;
1435
+ commit(next.length === 0 ? null : next);
1436
+ }
1052
1437
  return (_ctx, _cache) => {
1053
- return openBlock(), createElementBlock("div", _hoisted_1$8, [__props.filter.variant === "inline" && __props.filter.field.type === "string" ? (openBlock(), createBlock(_sfc_main$23, {
1438
+ return openBlock(), createElementBlock("div", {
1439
+ class: "astryx-table__filter",
1440
+ "data-variant": __props.filter.variant
1441
+ }, [__props.filter.variant === "inline" || __props.filter.variant === "inline-compact" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [__props.filter.field.type === "string" ? (openBlock(), createBlock(_sfc_main$26, {
1054
1442
  key: 0,
1055
- "model-value": draft.value,
1443
+ "model-value": textValue(draft.value),
1056
1444
  label: __props.filter.field.label,
1057
1445
  "is-label-hidden": "",
1058
1446
  size: "sm",
1059
1447
  placeholder: __props.filter.field.label,
1060
- "onUpdate:modelValue": onInlineInput
1448
+ "onUpdate:modelValue": onTextInput
1061
1449
  }, null, 8, [
1062
1450
  "model-value",
1063
1451
  "label",
1064
1452
  "placeholder"
1065
- ])) : __props.filter.variant === "inline" ? (openBlock(), createBlock(_sfc_main$22, {
1453
+ ])) : __props.filter.field.type === "number" ? (openBlock(), createBlock(_sfc_main$23, {
1066
1454
  key: 1,
1067
- "model-value": draft.value || null,
1455
+ "model-value": numberValue(draft.value),
1456
+ label: __props.filter.field.label,
1457
+ "is-label-hidden": "",
1458
+ size: "sm",
1459
+ placeholder: __props.filter.field.label,
1460
+ min: __props.filter.field.min ?? null,
1461
+ max: __props.filter.field.max ?? null,
1462
+ step: step.value,
1463
+ "is-integer-only": __props.filter.field.isIntegerOnly,
1464
+ "has-clear": "",
1465
+ "onUpdate:modelValue": onNumberInput
1466
+ }, null, 8, [
1467
+ "model-value",
1468
+ "label",
1469
+ "placeholder",
1470
+ "min",
1471
+ "max",
1472
+ "step",
1473
+ "is-integer-only"
1474
+ ])) : __props.filter.field.type === "date" ? (openBlock(), createBlock(_sfc_main$21, {
1475
+ key: 2,
1476
+ "model-value": dateValue(draft.value),
1477
+ label: __props.filter.field.label,
1478
+ "is-label-hidden": "",
1479
+ size: "sm",
1480
+ placeholder: __props.filter.field.label,
1481
+ "has-clear": "",
1482
+ "onUpdate:modelValue": onDateInput
1483
+ }, null, 8, [
1484
+ "model-value",
1485
+ "label",
1486
+ "placeholder"
1487
+ ])) : __props.filter.field.type === "multi-select" ? (openBlock(), createBlock(_sfc_main$22, {
1488
+ key: 3,
1489
+ "model-value": listValue(draft.value),
1490
+ label: __props.filter.field.label,
1491
+ "label-hidden": "",
1492
+ size: "sm",
1493
+ options: options.value,
1494
+ placeholder: unref(messages).table.filterAll,
1495
+ searchable: !isCompact.value,
1496
+ "select-all": "",
1497
+ "has-clear": "",
1498
+ "onUpdate:modelValue": onMultiSelect
1499
+ }, null, 8, [
1500
+ "model-value",
1501
+ "label",
1502
+ "options",
1503
+ "placeholder",
1504
+ "searchable"
1505
+ ])) : (openBlock(), createBlock(_sfc_main$25, {
1506
+ key: 4,
1507
+ "model-value": textValue(draft.value) || null,
1068
1508
  label: __props.filter.field.label,
1509
+ "is-label-hidden": "",
1069
1510
  size: "sm",
1070
1511
  placeholder: unref(messages).table.filterAll,
1071
- options: __props.filter.field.options ?? [],
1072
- "onUpdate:modelValue": _cache[0] || (_cache[0] = (value) => commit(value == null || value === "" ? null : String(value)))
1512
+ options: options.value,
1513
+ "onUpdate:modelValue": onSingleSelect
1073
1514
  }, null, 8, [
1074
1515
  "model-value",
1075
1516
  "label",
1076
1517
  "placeholder",
1077
1518
  "options"
1078
- ])) : (openBlock(), createBlock(_sfc_main$20, {
1079
- key: 2,
1519
+ ]))], 64)) : (openBlock(), createBlock(_sfc_main$20, {
1520
+ key: 1,
1080
1521
  label: __props.filter.field.label,
1081
1522
  "has-close-button": false,
1082
1523
  width: 240
1083
1524
  }, {
1084
- content: withCtx(() => [createElementVNode("div", _hoisted_2$3, [__props.filter.field.type === "string" ? (openBlock(), createBlock(_sfc_main$23, {
1525
+ content: withCtx(() => [createElementVNode("div", _hoisted_2$3, [__props.filter.field.type === "string" ? (openBlock(), createBlock(_sfc_main$26, {
1085
1526
  key: 0,
1086
- "model-value": draft.value,
1527
+ "model-value": textValue(draft.value),
1087
1528
  label: __props.filter.field.label,
1088
1529
  "is-label-hidden": "",
1089
1530
  size: "sm",
1090
1531
  placeholder: __props.filter.field.label,
1091
- "onUpdate:modelValue": _cache[1] || (_cache[1] = (value) => draft.value = value)
1532
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = (value) => draft.value = value)
1092
1533
  }, null, 8, [
1093
1534
  "model-value",
1094
1535
  "label",
1095
1536
  "placeholder"
1096
- ])) : (openBlock(), createBlock(_sfc_main$22, {
1537
+ ])) : __props.filter.field.type === "number" ? (openBlock(), createBlock(_sfc_main$23, {
1097
1538
  key: 1,
1098
- "model-value": draft.value || null,
1539
+ "model-value": numberValue(draft.value),
1540
+ label: __props.filter.field.label,
1541
+ "is-label-hidden": "",
1542
+ size: "sm",
1543
+ placeholder: __props.filter.field.label,
1544
+ min: __props.filter.field.min ?? null,
1545
+ max: __props.filter.field.max ?? null,
1546
+ step: step.value,
1547
+ "is-integer-only": __props.filter.field.isIntegerOnly,
1548
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = (value) => draft.value = value)
1549
+ }, null, 8, [
1550
+ "model-value",
1551
+ "label",
1552
+ "placeholder",
1553
+ "min",
1554
+ "max",
1555
+ "step",
1556
+ "is-integer-only"
1557
+ ])) : __props.filter.field.type === "date" ? (openBlock(), createBlock(_sfc_main$21, {
1558
+ key: 2,
1559
+ "model-value": dateValue(draft.value),
1560
+ label: __props.filter.field.label,
1561
+ "is-label-hidden": "",
1562
+ size: "sm",
1563
+ placeholder: __props.filter.field.label,
1564
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = (value) => draft.value = value == null ? null : value.toISOString().slice(0, 10))
1565
+ }, null, 8, [
1566
+ "model-value",
1567
+ "label",
1568
+ "placeholder"
1569
+ ])) : __props.filter.field.type === "multi-select" ? (openBlock(), createBlock(_sfc_main$22, {
1570
+ key: 3,
1571
+ "model-value": listValue(draft.value),
1572
+ label: __props.filter.field.label,
1573
+ "label-hidden": "",
1574
+ size: "sm",
1575
+ options: options.value,
1576
+ placeholder: unref(messages).table.filterAll,
1577
+ "select-all": "",
1578
+ "onUpdate:modelValue": _cache[3] || (_cache[3] = (value) => draft.value = value.length === 0 ? null : value.map(String))
1579
+ }, null, 8, [
1580
+ "model-value",
1581
+ "label",
1582
+ "options",
1583
+ "placeholder"
1584
+ ])) : (openBlock(), createBlock(_sfc_main$25, {
1585
+ key: 4,
1586
+ "model-value": textValue(draft.value) || null,
1099
1587
  label: __props.filter.field.label,
1588
+ "is-label-hidden": "",
1100
1589
  size: "sm",
1101
1590
  placeholder: unref(messages).table.filterAll,
1102
- options: __props.filter.field.options ?? [],
1103
- "onUpdate:modelValue": _cache[2] || (_cache[2] = (value) => draft.value = value == null ? "" : String(value))
1591
+ options: options.value,
1592
+ "onUpdate:modelValue": _cache[4] || (_cache[4] = (value) => draft.value = value == null ? null : String(value))
1104
1593
  }, null, 8, [
1105
1594
  "model-value",
1106
1595
  "label",
@@ -1110,8 +1599,8 @@ const _sfc_main$11 = /*@__PURE__*/ defineComponent({
1110
1599
  variant: "ghost",
1111
1600
  size: "sm",
1112
1601
  label: unref(messages).table.reset,
1113
- onClick: _cache[3] || (_cache[3] = ($event) => {
1114
- draft.value = "";
1602
+ onClick: _cache[5] || (_cache[5] = ($event) => {
1603
+ draft.value = null;
1115
1604
  commit(null);
1116
1605
  })
1117
1606
  }, {
@@ -1121,12 +1610,12 @@ const _sfc_main$11 = /*@__PURE__*/ defineComponent({
1121
1610
  variant: "primary",
1122
1611
  size: "sm",
1123
1612
  label: unref(messages).table.apply,
1124
- onClick: _cache[4] || (_cache[4] = ($event) => commit(draft.value === "" ? null : draft.value))
1613
+ onClick: _cache[6] || (_cache[6] = ($event) => commit(draft.value))
1125
1614
  }, {
1126
1615
  default: withCtx(() => [createTextVNode(toDisplayString(unref(messages).table.apply), 1)]),
1127
1616
  _: 1
1128
1617
  }, 8, ["label"])])])]),
1129
- default: withCtx(() => [createVNode(_sfc_main$17, {
1618
+ default: withCtx(() => [createVNode(_sfc_main$16, {
1130
1619
  variant: "ghost",
1131
1620
  size: "sm",
1132
1621
  label: __props.filter.field.label
@@ -1138,7 +1627,7 @@ const _sfc_main$11 = /*@__PURE__*/ defineComponent({
1138
1627
  _: 1
1139
1628
  }, 8, ["label"])]),
1140
1629
  _: 1
1141
- }, 8, ["label"]))]);
1630
+ }, 8, ["label"]))], 8, _hoisted_1$8);
1142
1631
  };
1143
1632
  }
1144
1633
  });
@@ -1290,6 +1779,7 @@ const _hoisted_2$1 = [
1290
1779
  "data-hover",
1291
1780
  "data-overflow",
1292
1781
  "data-valign",
1782
+ "data-row-highlight",
1293
1783
  "aria-rowcount"
1294
1784
  ];
1295
1785
  const _hoisted_3 = [
@@ -1311,7 +1801,14 @@ const _hoisted_9 = {
1311
1801
  class: "astryx-table__sort-rank"
1312
1802
  };
1313
1803
  const _hoisted_10 = { key: 2 };
1314
- const _hoisted_11 = ["onPointerdown"];
1804
+ const _hoisted_11 = [
1805
+ "aria-label",
1806
+ "aria-valuenow",
1807
+ "aria-valuemin",
1808
+ "aria-valuemax",
1809
+ "onPointerdown",
1810
+ "onKeydown"
1811
+ ];
1315
1812
  const _hoisted_12 = { key: 0 };
1316
1813
  const _hoisted_13 = ["colspan"];
1317
1814
  const _hoisted_14 = [
@@ -1324,6 +1821,7 @@ const _hoisted_15 = ["colspan"];
1324
1821
  const _hoisted_16 = ["data-column", "data-align"];
1325
1822
  const _hoisted_17 = ["data-variant"];
1326
1823
  const _hoisted_18 = ["colspan"];
1824
+ /** 收集这一行表头的宽度快照,用来算拖动后的宽度。 */
1327
1825
  const _sfc_main$8 = /*@__PURE__*/ defineComponent({
1328
1826
  __name: "TableData",
1329
1827
  props: {
@@ -1345,13 +1843,31 @@ const _sfc_main$8 = /*@__PURE__*/ defineComponent({
1345
1843
  setup(__props) {
1346
1844
  const props = __props;
1347
1845
  const messages = useAstryxMessages();
1348
- const dragWidths = ref({});
1349
1846
  const scrollRoot = ref(null);
1847
+ useScrollbars(scrollRoot);
1350
1848
  const menu = ref(null);
1351
1849
  const resolvedColumns = computed(() => props.plugins.reduce((columns, plugin) => plugin.transformColumns?.(columns) ?? columns, [...props.columns]));
1352
1850
  const widths = computed(() => resolveColumnWidths(resolvedColumns.value));
1353
1851
  const selection = computed(() => props.plugins.find((plugin) => plugin.selection)?.selection);
1354
1852
  const canResize = computed(() => props.plugins.some((plugin) => plugin.onColumnResizeEnd));
1853
+ /**
1854
+ * 一列参与拖动改宽的方式。第一个给出结果的插件说了算。
1855
+ * 只实现了 `onColumnResizeEnd` 的老插件仍然拿到一个最朴素的把手:只管自己这一列,最窄 60px。
1856
+ */
1857
+ function resizeContribution(column) {
1858
+ for (const plugin of props.plugins) {
1859
+ const contribution = plugin.resizeFor?.(column, resolvedColumns.value);
1860
+ if (contribution != null) return contribution;
1861
+ }
1862
+ if (!canResize.value || column.resizable === false) return null;
1863
+ return {
1864
+ minWidth: 60,
1865
+ maxWidth: Number.POSITIVE_INFINITY,
1866
+ neighborKey: null,
1867
+ hasHandle: true
1868
+ };
1869
+ }
1870
+ const resizeContributions = computed(() => new Map(resolvedColumns.value.map((column) => [column.key, resizeContribution(column)])));
1355
1871
  const layoutColumns = computed(() => selection.value ? [selectColumn(), ...resolvedColumns.value] : resolvedColumns.value);
1356
1872
  const columnCount = computed(() => layoutColumns.value.length);
1357
1873
  const trackRows = computed(() => props.rowCount != null || props.rowIndexStart != null);
@@ -1371,7 +1887,7 @@ const _sfc_main$8 = /*@__PURE__*/ defineComponent({
1371
1887
  });
1372
1888
  function styleFor(column) {
1373
1889
  const base = { ...widths.value.columns.get(column.key)?.style ?? {} };
1374
- const override = props.plugins.map((plugin) => plugin.widthFor?.(column)).find((value) => value != null) ?? dragWidths.value[column.key];
1890
+ const override = props.plugins.map((plugin) => plugin.widthFor?.(column)).find((value) => value != null) ?? resizeContributions.value.get(column.key)?.currentWidth;
1375
1891
  if (override != null) {
1376
1892
  base.width = `${override}px`;
1377
1893
  base.minWidth = `${override}px`;
@@ -1397,9 +1913,6 @@ const _sfc_main$8 = /*@__PURE__*/ defineComponent({
1397
1913
  const id = row[props.idKey];
1398
1914
  return id == null ? String(index) : String(id);
1399
1915
  }
1400
- function selected(row) {
1401
- return selection.value?.isSelected(row) === true && selection.value.hasRowHighlight !== false;
1402
- }
1403
1916
  function mergeCell(column, row, kind) {
1404
1917
  const style = {};
1405
1918
  const classes = [];
@@ -1488,99 +2001,153 @@ const _sfc_main$8 = /*@__PURE__*/ defineComponent({
1488
2001
  items
1489
2002
  };
1490
2003
  }
1491
- const CellContent = defineComponent({
1492
- name: "AstryxTableCellContent",
1493
- props: {
1494
- column: {
1495
- type: Object,
1496
- required: true
1497
- },
1498
- row: {
1499
- type: Object,
1500
- required: true
1501
- },
1502
- index: {
1503
- type: Number,
1504
- required: true
1505
- }
1506
- },
1507
- setup(cellProps) {
1508
- return () => {
1509
- const column = cellProps.column;
1510
- const row = cellProps.row;
1511
- const rendered = column.renderCell?.(row, cellProps.index);
1512
- if (rendered == null) return cellText(row[column.key]);
1513
- return rendered;
1514
- };
1515
- }
1516
- });
1517
- const RenderFn = defineComponent({
1518
- name: "AstryxTableRenderFn",
1519
- props: { render: {
1520
- type: Function,
1521
- required: true
1522
- } },
1523
- setup(renderProps) {
1524
- return () => renderProps.render();
1525
- }
1526
- });
1527
- const HeaderAddon = defineComponent({
1528
- name: "AstryxTableHeaderAddon",
1529
- props: { column: {
1530
- type: Object,
1531
- required: true
1532
- } },
1533
- setup(addonProps) {
1534
- return () => {
1535
- const column = addonProps.column;
1536
- const nodes = [];
1537
- for (const plugin of props.plugins) {
1538
- const before = plugin.headerPatch?.(column)?.before?.();
1539
- if (before != null) nodes.push(before);
1540
- }
1541
- return nodes;
1542
- };
2004
+ function buildResizeState(cell, column) {
2005
+ const row = cell.parentElement;
2006
+ if (row == null) return null;
2007
+ const table = cell.closest("table");
2008
+ const dragged = resizeContributions.value.get(column.key);
2009
+ const snapshots = [];
2010
+ const elements = /* @__PURE__ */ new Map();
2011
+ for (const child of Array.from(row.children)) {
2012
+ if (!(child instanceof HTMLElement)) continue;
2013
+ const key = child.dataset.column;
2014
+ if (key == null) continue;
2015
+ const contribution = resizeContributions.value.get(key);
2016
+ if (contribution == null) continue;
2017
+ const measured = child.getBoundingClientRect().width;
2018
+ snapshots.push({
2019
+ key,
2020
+ initialWidth: contribution.currentWidth ?? (measured > 0 ? measured : 0),
2021
+ minWidth: contribution.minWidth,
2022
+ maxWidth: contribution.maxWidth
2023
+ });
2024
+ elements.set(key, child);
1543
2025
  }
1544
- });
1545
- const PluginFooter = defineComponent({
1546
- name: "AstryxTablePluginFooter",
1547
- props: { plugin: {
1548
- type: Object,
1549
- required: true
1550
- } },
1551
- setup(footerProps) {
1552
- return () => footerProps.plugin.below?.() ?? null;
2026
+ const resizeIndex = snapshots.findIndex((item) => item.key === column.key);
2027
+ if (resizeIndex < 0) return null;
2028
+ return {
2029
+ snapshots,
2030
+ resizeIndex,
2031
+ neighborIndex: dragged?.neighborKey == null ? null : snapshots.findIndex((item) => item.key === dragged.neighborKey),
2032
+ tableWidth: table?.getBoundingClientRect().width ?? 0,
2033
+ direction: columnResizeDirectionSign(getComputedStyle(cell).direction),
2034
+ elements
2035
+ };
2036
+ }
2037
+ function applyResize(widths, state) {
2038
+ state.snapshots.forEach((snapshot, index) => {
2039
+ const element = state.elements.get(snapshot.key);
2040
+ const width = widths[index];
2041
+ if (element == null || width == null) return;
2042
+ const pixels = `${width}px`;
2043
+ element.style.width = pixels;
2044
+ element.style.minWidth = pixels;
2045
+ element.style.maxWidth = pixels;
2046
+ });
2047
+ }
2048
+ function resetResizeStyles(state) {
2049
+ for (const element of state.elements.values()) {
2050
+ element.style.width = "";
2051
+ element.style.minWidth = "";
2052
+ element.style.maxWidth = "";
1553
2053
  }
1554
- });
2054
+ }
2055
+ /** 算一次拖动结果:先把预览写到表头,再把变了的列交给插件。 */
2056
+ function commitResize(state, delta) {
2057
+ const widths = resizeColumnWidths(state, delta);
2058
+ applyResize(widths, state);
2059
+ const last = state.snapshots.length - 1;
2060
+ const updates = {};
2061
+ state.snapshots.forEach((snapshot, index) => {
2062
+ const width = widths[index];
2063
+ if (index !== last && width != null) updates[snapshot.key] = width;
2064
+ });
2065
+ if (Object.keys(updates).length === 0) return;
2066
+ for (const plugin of props.plugins) plugin.onColumnResizeEnd?.(updates);
2067
+ }
2068
+ function resizeLabel(column) {
2069
+ const header = typeof column.header === "string" && column.header.length > 0 ? column.header : column.key;
2070
+ return messages.value.table.resizeColumn(header);
2071
+ }
2072
+ function resizeMax(contribution) {
2073
+ const max = contribution?.maxWidth;
2074
+ return max == null || !Number.isFinite(max) ? void 0 : max;
2075
+ }
1555
2076
  function startResize(event, column) {
1556
- const handle = event.currentTarget;
1557
- if (!(handle instanceof HTMLElement)) return;
1558
- const cell = handle.closest("th");
1559
- if (cell == null) return;
2077
+ const target = event.currentTarget;
2078
+ if (!(target instanceof HTMLElement) || event.button !== 0) return;
2079
+ const cell = target.closest("th");
2080
+ const state = cell == null ? null : buildResizeState(cell, column);
2081
+ if (state == null || cell == null) return;
2082
+ event.preventDefault();
2083
+ const pointerId = event.pointerId;
1560
2084
  const startX = event.clientX;
1561
- const startWidth = cell.getBoundingClientRect().width;
1562
- handle.setPointerCapture(event.pointerId);
2085
+ const table = cell.closest("table");
2086
+ const previousUserSelect = table?.style.userSelect ?? "";
2087
+ if (table != null) table.style.userSelect = "none";
2088
+ target.setAttribute("data-resizing", "true");
2089
+ target.setPointerCapture(pointerId);
2090
+ const listeners = new AbortController();
1563
2091
  const move = (moveEvent) => {
1564
- if (!(moveEvent instanceof PointerEvent)) return;
1565
- const next = Math.max(60, startWidth + moveEvent.clientX - startX);
1566
- dragWidths.value = {
1567
- ...dragWidths.value,
1568
- [column.key]: next
1569
- };
2092
+ if (moveEvent.pointerId !== pointerId) return;
2093
+ applyResize(resizeColumnWidths(state, (moveEvent.clientX - startX) * state.direction), state);
2094
+ };
2095
+ const finish = () => {
2096
+ listeners.abort();
2097
+ target.removeAttribute("data-resizing");
2098
+ if (target.hasPointerCapture(pointerId)) target.releasePointerCapture(pointerId);
2099
+ if (table != null) table.style.userSelect = previousUserSelect;
1570
2100
  };
1571
2101
  const stop = (upEvent) => {
1572
- handle.removeEventListener("pointermove", move);
1573
- handle.removeEventListener("pointerup", stop);
1574
- const width = dragWidths.value[column.key] ?? startWidth;
1575
- for (const plugin of props.plugins) plugin.onColumnResizeEnd?.(column.key, width);
1576
- if (upEvent instanceof PointerEvent && handle.hasPointerCapture(upEvent.pointerId)) handle.releasePointerCapture(upEvent.pointerId);
2102
+ if (upEvent.pointerId !== pointerId) return;
2103
+ finish();
2104
+ commitResize(state, (upEvent.clientX - startX) * state.direction);
2105
+ };
2106
+ const cancel = (cancelEvent) => {
2107
+ if (cancelEvent.pointerId !== pointerId) return;
2108
+ finish();
2109
+ resetResizeStyles(state);
1577
2110
  };
1578
- handle.addEventListener("pointermove", move);
1579
- handle.addEventListener("pointerup", stop);
2111
+ const options = { signal: listeners.signal };
2112
+ target.addEventListener("pointermove", move, options);
2113
+ target.addEventListener("pointerup", stop, options);
2114
+ target.addEventListener("pointercancel", cancel, options);
2115
+ }
2116
+ function onResizeKeydown(event, column) {
2117
+ const handle = event.currentTarget;
2118
+ if (!(handle instanceof HTMLElement)) return;
2119
+ const cell = handle.closest("th");
2120
+ const state = cell == null ? null : buildResizeState(cell, column);
2121
+ if (state == null) return;
2122
+ const self = state.snapshots[state.resizeIndex];
2123
+ if (self == null) return;
2124
+ const step = columnResizeStep(event.shiftKey);
2125
+ let delta = null;
2126
+ switch (event.key) {
2127
+ case "ArrowRight":
2128
+ delta = step * state.direction;
2129
+ break;
2130
+ case "ArrowLeft":
2131
+ delta = -step * state.direction;
2132
+ break;
2133
+ case "Home":
2134
+ delta = self.minWidth - self.initialWidth;
2135
+ break;
2136
+ case "End": if (Number.isFinite(self.maxWidth)) delta = self.maxWidth - self.initialWidth;
2137
+ }
2138
+ if (delta == null) return;
2139
+ event.preventDefault();
2140
+ commitResize(state, delta);
1580
2141
  }
1581
2142
  function selectCellPatch(kind, row) {
1582
2143
  return mergeCell(selectColumn(), row, kind);
1583
2144
  }
2145
+ function isSelected(row) {
2146
+ return selection.value?.isSelected(row) === true;
2147
+ }
2148
+ function isEnabled(row) {
2149
+ return selection.value?.isEnabled?.(row) ?? true;
2150
+ }
1584
2151
  return (_ctx, _cache) => {
1585
2152
  return openBlock(), createElementBlock("div", {
1586
2153
  ref_key: "scrollRoot",
@@ -1589,6 +2156,13 @@ const _sfc_main$8 = /*@__PURE__*/ defineComponent({
1589
2156
  role: "group",
1590
2157
  "aria-label": __props.label
1591
2158
  }, [
2159
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.plugins.filter((item) => item.above), (plugin, index) => {
2160
+ return openBlock(), createBlock(unref(PluginFooter), {
2161
+ key: `above-${index}`,
2162
+ plugin,
2163
+ place: "above"
2164
+ }, null, 8, ["plugin"]);
2165
+ }), 128)),
1592
2166
  createElementVNode("table", {
1593
2167
  class: "astryx-table",
1594
2168
  "data-density": __props.density,
@@ -1597,6 +2171,7 @@ const _sfc_main$8 = /*@__PURE__*/ defineComponent({
1597
2171
  "data-hover": __props.hasHover || void 0,
1598
2172
  "data-overflow": __props.textOverflow,
1599
2173
  "data-valign": __props.verticalAlign,
2174
+ "data-row-highlight": selection.value?.hasRowHighlight === false ? "off" : void 0,
1600
2175
  "aria-rowcount": ariaRowCount.value,
1601
2176
  style: normalizeStyle(__props.minWidth ? { minWidth: `${Math.max(__props.minWidth, widths.value.tableMinWidth)}px` } : { minWidth: `${widths.value.tableMinWidth}px` })
1602
2177
  }, [createElementVNode("thead", null, [createElementVNode("tr", null, [selection.value ? (openBlock(), createElementBlock("th", mergeProps({
@@ -1619,43 +2194,58 @@ const _sfc_main$8 = /*@__PURE__*/ defineComponent({
1619
2194
  }, { ref_for: true }, mergeCell(column, null, "header").attrs, {
1620
2195
  style: headerStyle(column),
1621
2196
  "aria-sort": sortFor(column)?.direction ?? void 0
1622
- }), [createElementVNode("div", _hoisted_4, [createElementVNode("div", _hoisted_5, [createVNode(unref(HeaderAddon), { column }, null, 8, ["column"]), sortFor(column) ? (openBlock(), createElementBlock("button", {
1623
- key: 0,
1624
- type: "button",
1625
- class: "astryx-table__sort",
1626
- "data-align": column.align,
1627
- "aria-label": sortFor(column)?.label,
1628
- onClick: ($event) => sortFor(column)?.onClick($event)
1629
- }, [
1630
- column.headerHidden ? (openBlock(), createBlock(_sfc_main$14, { key: 0 }, {
2197
+ }), [
2198
+ createElementVNode("div", _hoisted_4, [createElementVNode("div", _hoisted_5, [createVNode(unref(HeaderAddon), {
2199
+ column,
2200
+ plugins: __props.plugins
2201
+ }, null, 8, ["column", "plugins"]), sortFor(column) ? (openBlock(), createElementBlock("button", {
2202
+ key: 0,
2203
+ type: "button",
2204
+ class: "astryx-table__sort",
2205
+ "data-align": column.align,
2206
+ "aria-label": sortFor(column)?.label,
2207
+ onClick: ($event) => sortFor(column)?.onClick($event)
2208
+ }, [
2209
+ column.headerHidden ? (openBlock(), createBlock(_sfc_main$14, { key: 0 }, {
2210
+ default: withCtx(() => [createTextVNode(toDisplayString(column.header ?? column.key), 1)]),
2211
+ _: 2
2212
+ }, 1024)) : (openBlock(), createElementBlock("span", _hoisted_7, toDisplayString(column.header ?? column.key), 1)),
2213
+ createElementVNode("span", {
2214
+ class: "astryx-table__sort-icon",
2215
+ "data-active": sortFor(column)?.direction != null || void 0
2216
+ }, [createVNode(_sfc_main$18, {
2217
+ icon: sortFor(column)?.direction === "descending" ? "arrowDown" : "arrowUp",
2218
+ size: "sm"
2219
+ }, null, 8, ["icon"])], 8, _hoisted_8),
2220
+ sortFor(column)?.rank ? (openBlock(), createElementBlock("span", _hoisted_9, toDisplayString(sortFor(column)?.rank), 1)) : createCommentVNode("v-if", true)
2221
+ ], 8, _hoisted_6)) : column.headerHidden ? (openBlock(), createBlock(_sfc_main$14, { key: 1 }, {
1631
2222
  default: withCtx(() => [createTextVNode(toDisplayString(column.header ?? column.key), 1)]),
1632
2223
  _: 2
1633
- }, 1024)) : (openBlock(), createElementBlock("span", _hoisted_7, toDisplayString(column.header ?? column.key), 1)),
1634
- createElementVNode("span", {
1635
- class: "astryx-table__sort-icon",
1636
- "data-active": sortFor(column)?.direction != null || void 0
1637
- }, [createVNode(_sfc_main$18, {
1638
- icon: sortFor(column)?.direction === "descending" ? "arrowDown" : "arrowUp",
1639
- size: "sm"
1640
- }, null, 8, ["icon"])], 8, _hoisted_8),
1641
- sortFor(column)?.rank ? (openBlock(), createElementBlock("span", _hoisted_9, toDisplayString(sortFor(column)?.rank), 1)) : createCommentVNode("v-if", true)
1642
- ], 8, _hoisted_6)) : column.headerHidden ? (openBlock(), createBlock(_sfc_main$14, { key: 1 }, {
1643
- default: withCtx(() => [createTextVNode(toDisplayString(column.header ?? column.key), 1)]),
1644
- _: 2
1645
- }, 1024)) : (openBlock(), createElementBlock("span", _hoisted_10, toDisplayString(column.header ?? column.key), 1))]), filterFor(column) ? (openBlock(), createBlock(_sfc_main$11, {
1646
- key: 0,
1647
- filter: filterFor(column)
1648
- }, null, 8, ["filter"])) : createCommentVNode("v-if", true)]), canResize.value && column.resizable !== false ? (openBlock(), createElementBlock("span", {
1649
- key: 0,
1650
- class: "astryx-table__resize",
1651
- onPointerdown: ($event) => startResize($event, column)
1652
- }, null, 40, _hoisted_11)) : createCommentVNode("v-if", true)], 16, _hoisted_3);
2224
+ }, 1024)) : (openBlock(), createElementBlock("span", _hoisted_10, toDisplayString(column.header ?? column.key), 1))]), filterFor(column) ? (openBlock(), createBlock(_sfc_main$11, {
2225
+ key: 0,
2226
+ filter: filterFor(column)
2227
+ }, null, 8, ["filter"])) : createCommentVNode("v-if", true)]),
2228
+ createCommentVNode(" eslint-disable-next-line vue-a11y/no-static-element-interactions -- role=\"separator\" 是 WAI-ARIA 的分隔条:自己可聚焦,方向键也归它处理。 "),
2229
+ resizeContributions.value.get(column.key)?.hasHandle ? (openBlock(), createElementBlock("span", {
2230
+ key: 0,
2231
+ class: "astryx-table__resize",
2232
+ role: "separator",
2233
+ "aria-orientation": "vertical",
2234
+ "aria-label": resizeLabel(column),
2235
+ "aria-valuenow": resizeContributions.value.get(column.key)?.currentWidth ?? resizeContributions.value.get(column.key)?.minWidth,
2236
+ "aria-valuemin": resizeContributions.value.get(column.key)?.minWidth,
2237
+ "aria-valuemax": resizeMax(resizeContributions.value.get(column.key)),
2238
+ tabindex: "0",
2239
+ onPointerdown: ($event) => startResize($event, column),
2240
+ onKeydown: ($event) => onResizeKeydown($event, column)
2241
+ }, null, 40, _hoisted_11)) : createCommentVNode("v-if", true)
2242
+ ], 16, _hoisted_3);
1653
2243
  }), 128))])]), createElementVNode("tbody", null, [__props.rows.length === 0 ? (openBlock(), createElementBlock("tr", _hoisted_12, [createElementVNode("td", {
1654
2244
  class: "astryx-table__empty",
1655
2245
  colspan: columnCount.value
1656
2246
  }, [renderSlot(_ctx.$slots, "empty", {}, () => [createTextVNode(toDisplayString(unref(messages).table.noData), 1)])], 8, _hoisted_13)])) : createCommentVNode("v-if", true), (openBlock(true), createElementBlock(Fragment, null, renderList(entries.value, (entry) => {
1657
2247
  return openBlock(), createElementBlock(Fragment, { key: entry.key }, [createElementVNode("tr", mergeProps({
1658
- "aria-selected": !entry.patch.group && selected(entry.row) ? "true" : void 0,
2248
+ "aria-selected": !entry.patch.group && isSelected(entry.row) ? "true" : void 0,
1659
2249
  "aria-rowindex": entry.rowIndex,
1660
2250
  class: entry.patch.class
1661
2251
  }, { ref_for: true }, entry.patch.attrs, {
@@ -1692,10 +2282,12 @@ const _sfc_main$8 = /*@__PURE__*/ defineComponent({
1692
2282
  label: selection.value.rowLabel?.(entry.row) ? unref(messages).table.selectRowNamed(selection.value.rowLabel(entry.row)) : unref(messages).table.selectRow,
1693
2283
  "is-label-hidden": "",
1694
2284
  size: "sm",
2285
+ "is-disabled": !isEnabled(entry.row),
1695
2286
  "onUpdate:modelValue": (value) => selection.value?.selectRow(entry.row, value === true)
1696
2287
  }, null, 8, [
1697
2288
  "model-value",
1698
2289
  "label",
2290
+ "is-disabled",
1699
2291
  "onUpdate:modelValue"
1700
2292
  ])) : createCommentVNode("v-if", true)], 16)) : createCommentVNode("v-if", true), (openBlock(true), createElementBlock(Fragment, null, renderList(resolvedColumns.value, (column) => {
1701
2293
  return openBlock(), createElementBlock("td", mergeProps({
@@ -1722,10 +2314,11 @@ const _sfc_main$8 = /*@__PURE__*/ defineComponent({
1722
2314
  colspan: columnCount.value
1723
2315
  }, [createVNode(unref(RenderFn), { render: entry.patch.panel.render }, null, 8, ["render"])], 8, _hoisted_18)], 8, _hoisted_17)) : createCommentVNode("v-if", true)], 64);
1724
2316
  }), 128))])], 12, _hoisted_2$1),
1725
- (openBlock(true), createElementBlock(Fragment, null, renderList(__props.plugins, (plugin, index) => {
2317
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.plugins.filter((item) => item.below), (plugin, index) => {
1726
2318
  return openBlock(), createBlock(unref(PluginFooter), {
1727
- key: index,
1728
- plugin
2319
+ key: `below-${index}`,
2320
+ plugin,
2321
+ place: "below"
1729
2322
  }, null, 8, ["plugin"]);
1730
2323
  }), 128)),
1731
2324
  (openBlock(), createBlock(Teleport, { to: "body" }, [menu.value ? (openBlock(), createBlock(_sfc_main$9, {
@@ -1793,6 +2386,8 @@ const _sfc_main$7 = /*@__PURE__*/ defineComponent({
1793
2386
  const plugins = computed(() => Object.values(props.plugins ?? {}).filter((plugin) => plugin != null));
1794
2387
  const dataMode = computed(() => props.data != null);
1795
2388
  const columns = computed(() => props.columns ?? []);
2389
+ const scrollEl = useTemplateRef("scroll");
2390
+ useScrollbars(scrollEl);
1796
2391
  return (_ctx, _cache) => {
1797
2392
  return dataMode.value ? (openBlock(), createBlock(_sfc_main$8, {
1798
2393
  key: 0,
@@ -1833,6 +2428,7 @@ const _sfc_main$7 = /*@__PURE__*/ defineComponent({
1833
2428
  "row-count"
1834
2429
  ])) : (openBlock(), createElementBlock("div", {
1835
2430
  key: 1,
2431
+ ref: "scroll",
1836
2432
  class: "astryx-table-scroll",
1837
2433
  role: "group",
1838
2434
  "aria-label": __props.label ?? unref(messages).table.label
@@ -1952,31 +2548,64 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
1952
2548
  });
1953
2549
  //#endregion
1954
2550
  //#region src/Table/TableSelectionToolbar.vue
1955
- const _hoisted_1 = ["aria-label"];
2551
+ const _hoisted_1 = { class: "astryx-table-selection-toolbar__label" };
1956
2552
  const _sfc_main = /*@__PURE__*/ defineComponent({
1957
2553
  name: "AstryxTableSelectionToolbar",
1958
2554
  __name: "TableSelectionToolbar",
1959
- props: { count: {} },
2555
+ props: {
2556
+ count: { default: 0 },
2557
+ selection: {},
2558
+ label: {},
2559
+ clearLabel: {},
2560
+ size: { default: "sm" },
2561
+ variant: { default: "muted" }
2562
+ },
1960
2563
  emits: ["clear"],
1961
2564
  setup(__props, { emit: __emit }) {
2565
+ const props = __props;
1962
2566
  const emit = __emit;
1963
2567
  const messages = useAstryxMessages();
2568
+ /** 有 selection 就用它的计数,否则回落到 count。 */
2569
+ const effectiveCount = computed(() => props.selection?.selectedCount ?? props.count);
2570
+ /** 走 selection 时,一个都没选中就整条不渲染。 */
2571
+ const isVisible = computed(() => props.selection == null || props.selection.hasSelection);
2572
+ const resolvedLabel = computed(() => props.label ?? messages.value.table.bulkActionsLabel);
2573
+ const resolvedClearLabel = computed(() => props.clearLabel ?? messages.value.table.clearAll);
2574
+ const resolvedCountLabel = computed(() => messages.value.table.selectedCount(effectiveCount.value));
2575
+ /** Toolbar 只有透明和弱化底,表面色这一档由本组件的类补上。 */
2576
+ const toolbarVariant = computed(() => props.variant === "muted" ? "muted" : "transparent");
2577
+ function clearSelection() {
2578
+ props.selection?.clearSelection();
2579
+ emit("clear");
2580
+ }
1964
2581
  return (_ctx, _cache) => {
1965
- return openBlock(), createElementBlock("div", {
1966
- class: "astryx-table-selection-toolbar",
1967
- role: "region",
1968
- "aria-label": unref(messages).table.bulkActionsLabel
1969
- }, [
1970
- createElementVNode("span", null, toDisplayString(unref(messages).table.selectedCount(__props.count)), 1),
1971
- renderSlot(_ctx.$slots, "default"),
1972
- createElementVNode("button", {
1973
- type: "button",
1974
- class: "astryx-table__sort",
1975
- onClick: _cache[0] || (_cache[0] = ($event) => emit("clear"))
1976
- }, toDisplayString(unref(messages).table.clearAll), 1)
1977
- ], 8, _hoisted_1);
2582
+ return isVisible.value ? (openBlock(), createBlock(_sfc_main$27, {
2583
+ key: 0,
2584
+ class: normalizeClass(["astryx-table-selection-toolbar", { "astryx-table-selection-toolbar--section": __props.variant === "section" }]),
2585
+ label: resolvedLabel.value,
2586
+ size: __props.size,
2587
+ variant: toolbarVariant.value
2588
+ }, createSlots({
2589
+ end: withCtx(() => [createElementVNode("span", _hoisted_1, [renderSlot(_ctx.$slots, "label", { count: effectiveCount.value }, () => [createTextVNode(toDisplayString(resolvedCountLabel.value), 1)])]), createVNode(_sfc_main$15, {
2590
+ class: "astryx-table-selection-toolbar__clear",
2591
+ label: resolvedClearLabel.value,
2592
+ size: __props.size,
2593
+ variant: "ghost",
2594
+ onClick: clearSelection
2595
+ }, null, 8, ["label", "size"])]),
2596
+ _: 2
2597
+ }, [_ctx.$slots.start || _ctx.$slots.default ? {
2598
+ name: "start",
2599
+ fn: withCtx(() => [renderSlot(_ctx.$slots, "start", {}, () => [renderSlot(_ctx.$slots, "default")])]),
2600
+ key: "0"
2601
+ } : void 0]), 1032, [
2602
+ "class",
2603
+ "label",
2604
+ "size",
2605
+ "variant"
2606
+ ])) : createCommentVNode("v-if", true);
1978
2607
  };
1979
2608
  }
1980
2609
  });
1981
2610
  //#endregion
1982
- export { useTableColumnSettings as A, resolveColumnWidths as B, isInteractiveRowClick as C, applyTableFilters as D, useTableGroupedRows as E, generateColumns as F, paginateData as I, pixel as L, useTableColumnResize as M, capitalize as N, useTableFilterState as O, cellText as P, proportional as R, useTablePagination as S, isTableGroupHeader as T, sortRows as V, useTableSelection as _, _sfc_main$4 as a, useTableRowIndex as b, _sfc_main$7 as c, useTableTreeState as d, resolveStickySide as f, useTableSortableState as g, useTableSortable as h, _sfc_main$3 as i, useTableColumnSettingsState as j, useTableFiltering as k, flattenTree as l, useTableStickyColumns as m, _sfc_main$1 as n, _sfc_main$5 as o, stickyOffsets as p, _sfc_main$2 as r, _sfc_main$6 as s, _sfc_main as t, useTableTreeData as u, useTableSelectionState as v, buildGroupedRows as w, useTableRowExpansion as x, useTableRowStatus as y, resolveColumnFloorWidths as z };
2611
+ export { useTableColumnSettings as A, generateColumns as B, isInteractiveRowClick as C, applyTableFilters as D, useTableGroupedRows as E, isProportionalColumnWidth as F, resolveColumnWidths as G, pixel as H, resizeColumnWidths as I, sortRows as K, useTableColumnResize as L, columnResizeDirectionSign as M, columnResizeMinWidth as N, useTableFilterState as O, columnResizeStep as P, capitalize as R, useTablePagination as S, isTableGroupHeader as T, proportional as U, paginateData as V, resolveColumnFloorWidths as W, useTableSelection as _, _sfc_main$4 as a, useTableRowIndex as b, _sfc_main$7 as c, useTableTreeState as d, resolveStickySide as f, useTableSortableState as g, useTableSortable as h, _sfc_main$3 as i, useTableColumnSettingsState as j, useTableFiltering as k, flattenTree as l, useTableStickyColumns as m, _sfc_main$1 as n, _sfc_main$5 as o, stickyOffsets as p, _sfc_main$2 as r, _sfc_main$6 as s, _sfc_main as t, useTableTreeData as u, useTableSelectionState as v, buildGroupedRows as w, useTableRowExpansion as x, useTableRowStatus as y, cellText as z };