@astryx-vue/core 0.2.1 → 0.2.3

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 (273) hide show
  1. package/THIRD_PARTY_NOTICES.md +2 -0
  2. package/dist/AppShell/index.d.ts +1 -1
  3. package/dist/AppShell/index.js +1 -1
  4. package/dist/{AppShell-1wNIEtK_.js → AppShell-Dd-D4bA2.js} +2 -2
  5. package/dist/AvatarGroup/index.d.ts +1 -1
  6. package/dist/Badge/index.d.ts +2 -1
  7. package/dist/Banner/index.d.ts +1 -1
  8. package/dist/Breadcrumbs/index.d.ts +3 -2
  9. package/dist/Breadcrumbs/index.js +3 -2
  10. package/dist/{Breadcrumbs-C97HmjkC.js → Breadcrumbs-CWGfgLNK.js} +13 -8
  11. package/dist/Button/index.d.ts +1 -1
  12. package/dist/ButtonGroup/index.d.ts +1 -1
  13. package/dist/Calendar/index.d.ts +2 -2
  14. package/dist/Calendar/index.js +1 -1
  15. package/dist/Calendar-CnOsSjMY.js +656 -0
  16. package/dist/Card/index.d.ts +1 -1
  17. package/dist/Carousel/index.js +1 -1
  18. package/dist/{Carousel-BGUnskjo.js → Carousel-JA7ilqI_.js} +2 -2
  19. package/dist/Chat/index.d.ts +2 -2
  20. package/dist/Chat/index.js +2 -2
  21. package/dist/Chat-C7WrCOE4.js +3148 -0
  22. package/dist/CheckboxIndicator/index.js +1 -1
  23. package/dist/CheckboxIndicator-D37cm2Rh.js +68 -0
  24. package/dist/CheckboxInput/index.d.ts +1 -1
  25. package/dist/CheckboxInput/index.js +1 -1
  26. package/dist/{CheckboxInput-CMsEE1_4.js → CheckboxInput-25Q8ItH-.js} +10 -9
  27. package/dist/CheckboxList/index.d.ts +1 -1
  28. package/dist/CheckboxList/index.js +1 -1
  29. package/dist/{CheckboxList-BbCPiend.js → CheckboxList-CnCGnkZk.js} +77 -24
  30. package/dist/Citation/index.js +1 -1
  31. package/dist/{Citation-DunoAqVH.js → Citation-CtwrU33I.js} +2 -2
  32. package/dist/ClickableCard/index.d.ts +1 -1
  33. package/dist/Code/index.d.ts +1 -1
  34. package/dist/Code/index.js +2 -2
  35. package/dist/{Code-yb_KOFtJ.js → Code-BvefYRpx.js} +2 -1
  36. package/dist/{CodeBlock-CAF-VJnh.js → CodeBlock-BZGzYeoL.js} +1 -1
  37. package/dist/Collapsible/index.d.ts +1 -1
  38. package/dist/Collapsible/index.js +1 -1
  39. package/dist/{Collapsible-DvMiYJp7.js → Collapsible-3YerR-FO.js} +1 -1
  40. package/dist/CommandPalette/index.js +1 -1
  41. package/dist/{CommandPalette-xfm9ldUI.js → CommandPalette-BNbM9T9y.js} +1 -1
  42. package/dist/ComplexSelector/index.d.ts +1 -1
  43. package/dist/ComplexSelector/index.js +1 -1
  44. package/dist/{ComplexSelector-B6lBTRhP.js → ComplexSelector-LtbLlrcj.js} +3 -3
  45. package/dist/ContextMenu/index.d.ts +3 -2
  46. package/dist/ContextMenu/index.js +3 -2
  47. package/dist/{ContextMenu-DUkED3Z3.js → ContextMenu-DVQl0xL5.js} +204 -56
  48. package/dist/DateInput/index.d.ts +2 -2
  49. package/dist/DateInput/index.js +1 -1
  50. package/dist/DateInput-zm8sNc0t.js +743 -0
  51. package/dist/DateRangeInput/index.d.ts +1 -1
  52. package/dist/DateRangeInput/index.js +1 -1
  53. package/dist/{DateRangeInput-e9KSxBBK.js → DateRangeInput-DlVFzrf7.js} +54 -19
  54. package/dist/DateTimeInput/index.d.ts +1 -1
  55. package/dist/DateTimeInput/index.js +1 -1
  56. package/dist/{DateTimeInput-fSOfuLex.js → DateTimeInput-C7Z-p6Yd.js} +54 -15
  57. package/dist/Dialog/index.d.ts +1 -1
  58. package/dist/Divider/index.d.ts +1 -1
  59. package/dist/DropdownMenu/index.d.ts +3 -3
  60. package/dist/DropdownMenu/index.js +4 -3
  61. package/dist/{DropdownMenu-8G0B1UND.js → DropdownMenu-BoZChdev.js} +308 -63
  62. package/dist/DropdownMenu-u1psFjis.js +325 -0
  63. package/dist/DropdownMenuRadioItem.vue-uVM0FD2f.d.ts +564 -0
  64. package/dist/FileInput/index.d.ts +1 -1
  65. package/dist/FileInput/index.js +1 -1
  66. package/dist/{FileInput-D-fchyQH.js → FileInput-QdlZn7qK.js} +2 -2
  67. package/dist/Icon/index.d.ts +4 -3
  68. package/dist/Icon/index.js +2 -2
  69. package/dist/{Icon-Bku25g_K.js → Icon-bteSId7T.js} +114 -14
  70. package/dist/Indicator/index.d.ts +3 -0
  71. package/dist/Indicator/index.js +2 -0
  72. package/dist/InputGroup/index.d.ts +2 -2
  73. package/dist/InputGroup/index.js +3 -2
  74. package/dist/InputGroup-BzR6JRZb.js +129 -0
  75. package/dist/Lightbox/index.js +1 -1
  76. package/dist/{Lightbox-uuVGgHxW.js → Lightbox-BSzfqZ-u.js} +2 -2
  77. package/dist/List/index.d.ts +1 -1
  78. package/dist/Markdown/index.js +1 -1
  79. package/dist/{Markdown-DLICa3db.js → Markdown-B6tSqenv.js} +8 -5
  80. package/dist/MetadataList/index.d.ts +1 -1
  81. package/dist/MetadataList/index.js +1 -1
  82. package/dist/{MetadataList-h492rqEN.js → MetadataList-aN1tRn6W.js} +1 -1
  83. package/dist/MobileNav/index.js +1 -1
  84. package/dist/{MobileNavToggle-BMj3Wtuq.js → MobileNavToggle-fqcSafkc.js} +1 -1
  85. package/dist/MoreMenu/index.d.ts +1 -1
  86. package/dist/MoreMenu/index.js +1 -1
  87. package/dist/{MoreMenu-DkYi5az5.js → MoreMenu-B3brqdK_.js} +1 -1
  88. package/dist/MultiSelector/index.d.ts +2 -2
  89. package/dist/MultiSelector/index.js +1 -1
  90. package/dist/{MultiSelector-C2IS-EaU.js → MultiSelector-BD5PMgez.js} +303 -121
  91. package/dist/{NavDisclosure-DHrSNRDR.js → NavDisclosure-DbYLDXK0.js} +1 -1
  92. package/dist/NavItem/index.d.ts +1 -1
  93. package/dist/NavMenu/index.js +2 -2
  94. package/dist/{NavMenuItem-B-k7olt5.js → NavMenuItem-DrwIMHKO.js} +1 -1
  95. package/dist/NumberInput/index.js +1 -1
  96. package/dist/{NumberInput-CjfAsFwj.js → NumberInput-CBeU4lEl.js} +1 -1
  97. package/dist/Outline/index.js +1 -1
  98. package/dist/{Outline-BTmrtvXR.js → Outline--HVMSB6i.js} +1 -1
  99. package/dist/OverflowList/index.d.ts +1 -1
  100. package/dist/OverflowList/index.js +1 -1
  101. package/dist/{OverflowList-CRE8BE7V.js → OverflowList-FMh7r-r_.js} +3 -3
  102. package/dist/Pagination/index.d.ts +1 -1
  103. package/dist/Pagination/index.js +1 -1
  104. package/dist/{Pagination-BpGXPmc7.js → Pagination-DlIvESjx.js} +2 -2
  105. package/dist/Popover/index.d.ts +1 -1
  106. package/dist/Popover/index.js +1 -1
  107. package/dist/{Popover-Crhk9PNP.js → Popover-D7zqpFwU.js} +1 -1
  108. package/dist/PowerSearch/index.d.ts +2 -0
  109. package/dist/PowerSearch/index.js +2 -0
  110. package/dist/PowerSearch-CMG7Rb69.js +2386 -0
  111. package/dist/ProgressBar/index.d.ts +1 -1
  112. package/dist/Radio/index.d.ts +1 -1
  113. package/dist/Radio/index.js +1 -1
  114. package/dist/{RadioGroup-BqjdSCfJ.js → RadioGroup-CBqUPq_L.js} +16 -8
  115. package/dist/RadioList/index.d.ts +1 -1
  116. package/dist/RadioList/index.js +1 -1
  117. package/dist/{RadioList-DI8ujXcT.js → RadioList-CPOJn9Th.js} +1 -1
  118. package/dist/Resizable/index.d.ts +1 -1
  119. package/dist/Resizable/index.js +1 -1
  120. package/dist/{Resizable-CE8XQDL2.js → Resizable-CXpvj1TZ.js} +1 -1
  121. package/dist/ScrollableArea/index.d.ts +1 -1
  122. package/dist/SelectableCard/index.d.ts +1 -1
  123. package/dist/Selector/index.d.ts +2 -2
  124. package/dist/Selector/index.js +1 -1
  125. package/dist/Selector-BpPnuWH3.js +618 -0
  126. package/dist/SideNav/index.d.ts +1 -1
  127. package/dist/SideNav/index.js +1 -1
  128. package/dist/{SideNav-DcDWBnXJ.js → SideNav-D4TupqgE.js} +3 -3
  129. package/dist/Stack/index.d.ts +1 -1
  130. package/dist/Stepper/index.d.ts +1 -1
  131. package/dist/Stepper/index.js +1 -1
  132. package/dist/{Stepper-DZKaqEoz.js → Stepper-H-6-T5Ps.js} +1 -1
  133. package/dist/Switch/index.d.ts +1 -1
  134. package/dist/TabList/index.d.ts +1 -1
  135. package/dist/TabList/index.js +1 -1
  136. package/dist/{TabList-hm06QPiW.js → TabList-BlzkrObv.js} +2 -2
  137. package/dist/Table/index.d.ts +3 -3
  138. package/dist/Table/index.js +2 -2
  139. package/dist/Table-nqA_njNz.js +1982 -0
  140. package/dist/TextArea/index.d.ts +1 -1
  141. package/dist/TextInput/index.d.ts +1 -1
  142. package/dist/Theme/index.d.ts +2 -1
  143. package/dist/Theme/index.js +1 -1
  144. package/dist/{Theme-BuUiiJNr.js → Theme-CejS9MHm.js} +21 -3
  145. package/dist/Thumbnail/index.js +1 -1
  146. package/dist/{Thumbnail-CAOYds8t.js → Thumbnail-CXb3m_Hv.js} +2 -2
  147. package/dist/{TimeField-BGbxCoKU.js → TimeField-B3cndWb0.js} +2 -2
  148. package/dist/TimeInput/index.d.ts +1 -1
  149. package/dist/TimeInput/index.js +1 -1
  150. package/dist/{TimeInput-DJP3l4ZS.js → TimeInput-BHQ_LKGm.js} +1 -1
  151. package/dist/Timestamp/index.d.ts +1 -1
  152. package/dist/Timestamp/index.js +1 -1
  153. package/dist/{Timestamp-BzRp8uWc.js → Timestamp-Cfuxbb3i.js} +3 -3
  154. package/dist/ToggleButton/index.d.ts +1 -1
  155. package/dist/Token/index.d.ts +1 -1
  156. package/dist/Token/index.js +1 -1
  157. package/dist/{Token-CjocuhzE.js → Token-CdVLH0_H.js} +2 -2
  158. package/dist/Tokenizer/index.d.ts +1 -1
  159. package/dist/Tokenizer/index.js +1 -1
  160. package/dist/{Tokenizer-mYES5SPM.js → Tokenizer-DlD-S_8-.js} +4 -4
  161. package/dist/Toolbar/index.d.ts +1 -1
  162. package/dist/TopNav/index.d.ts +1 -1
  163. package/dist/TopNav/index.js +1 -1
  164. package/dist/{TopNav-C2t6JkZb.js → TopNav-DzV874G7.js} +5 -5
  165. package/dist/TreeList/index.d.ts +1 -1
  166. package/dist/TreeList/index.js +1 -1
  167. package/dist/{TreeList-THJ0KamE.js → TreeList-DEwvlZRV.js} +2 -2
  168. package/dist/Typeahead/index.d.ts +1 -1
  169. package/dist/Typeahead/index.js +1 -1
  170. package/dist/{Typeahead-D7VnvRpK.js → Typeahead-DQ3tmqYe.js} +4 -4
  171. package/dist/{useTypeaheadMenu-Ba7XpcZl.js → TypeaheadMenu-CGvo0Tud.js} +107 -107
  172. package/dist/{context-O2Vb8cJl.js → colorMode-CBgdgDSn.js} +1 -7
  173. package/dist/composables/index.d.ts +4 -4
  174. package/dist/composables/index.js +10 -5
  175. package/dist/{composables-CVfjp9h4.js → composables-DDI08XFF.js} +98 -1
  176. package/dist/context-Cws_tXTr.js +7 -0
  177. package/dist/context-D5-MwxnN.js +4 -0
  178. package/dist/{context-DzcK4T_C.js → context-DmOLCubj.js} +262 -12
  179. package/dist/{index-DimuSES0.d.ts → index-B1x05arQ.d.ts} +3 -1
  180. package/dist/index-B9WzWqzk.d.ts +18 -0
  181. package/dist/index-B9f1rUEv.d.ts +77 -0
  182. package/dist/{index-DnSrjbjP.d.ts → index-BB5yVIN-.d.ts} +2 -2
  183. package/dist/{index-Bu0Zd1uw.d.ts → index-BMn9ghAX.d.ts} +3 -3
  184. package/dist/{index-CJlBAXwj.d.ts → index-BRfR0lhb.d.ts} +41 -4
  185. package/dist/{index-DeOftUMq.d.ts → index-BTAgQRP0.d.ts} +762 -114
  186. package/dist/{index-DA52oIdw.d.ts → index-BcJBLWJ0.d.ts} +2 -2
  187. package/dist/{index-jdjcb3Js.d.ts → index-Bqb_Fyju.d.ts} +2 -2
  188. package/dist/{index-CNjbOgty.d.ts → index-C-QpeUlQ.d.ts} +2 -2
  189. package/dist/{index-I4J7gwa1.d.ts → index-C2sfHfBw.d.ts} +31 -5
  190. package/dist/{index-By2mSzUA.d.ts → index-CA6RbRWx.d.ts} +1 -1
  191. package/dist/{index-DnEh-HA0.d.ts → index-C_2Z65Rp.d.ts} +1 -1
  192. package/dist/{index-cG1E0U2s.d.ts → index-Ca8VIE4l.d.ts} +1 -1
  193. package/dist/{index-CRizexSC.d.ts → index-Ch6BbxCP.d.ts} +2 -67
  194. package/dist/{index-CBym0hSq.d.ts → index-ChWlKHjc.d.ts} +1 -1
  195. package/dist/{index-DXSs3rwa.d.ts → index-CngORuiq.d.ts} +137 -2
  196. package/dist/index-Ctu32CLv.d.ts +902 -0
  197. package/dist/{index-DQAnGHu7.d.ts → index-D1Twv_fL.d.ts} +65 -6
  198. package/dist/{index-D_nYxnNv.d.ts → index-D7-WTV6I.d.ts} +1 -1
  199. package/dist/{index-c_TaW8mM.d.ts → index-D8o50qOE.d.ts} +1 -1
  200. package/dist/index-DMQG6kdM.d.ts +416 -0
  201. package/dist/index-D_UEJIU5.d.ts +83 -0
  202. package/dist/{index-D2bSSSBP.d.ts → index-DkVEBdWa.d.ts} +2 -2
  203. package/dist/{index-SMh42NI8.d.ts → index-DxsKyAxq.d.ts} +118 -46
  204. package/dist/{index-BHqRH7QW.d.ts → index-FEy8qFSD.d.ts} +2 -2
  205. package/dist/{index-Byar3h1e.d.ts → index-HV6W3xCx.d.ts} +1 -1
  206. package/dist/{index-Clmz00IK.d.ts → index-LIyvJTW3.d.ts} +63 -0
  207. package/dist/{index-BKr7yvVv.d.ts → index-MPcg1Pm4.d.ts} +1 -1
  208. package/dist/{index-cGagYM1g.d.ts → index-ViSV0RBx.d.ts} +1 -1
  209. package/dist/{index-Z_onS2lR.d.ts → index-f4NGT-e2.d.ts} +3 -3
  210. package/dist/{index-DsyKhauk.d.ts → index-foQMNKZO.d.ts} +1 -1
  211. package/dist/{index-1uRMrk63.d.ts → index-nCEmW6wa.d.ts} +1 -1
  212. package/dist/{index-NOXYEdOI.d.ts → index-utZGF4GR.d.ts} +1 -1
  213. package/dist/{index-3p2BDVHq.d.ts → index-vP0EtrJJ.d.ts} +13 -3
  214. package/dist/{index-CZeoAr0a.d.ts → index-xfkEuGLY.d.ts} +2 -2
  215. package/dist/index.d.ts +81 -78
  216. package/dist/index.js +122 -106
  217. package/dist/locale/index.d.ts +1 -1
  218. package/dist/locale/index.js +2 -2
  219. package/dist/{locale-Cpk_nrLA.js → locale-CCwVnyMZ.js} +25 -1
  220. package/dist/power-search-DrDfcoL1.d.ts +68 -0
  221. package/dist/searchResultMessage-DN0HeRRB.js +94 -0
  222. package/dist/semantic-CKH9XVqa.d.ts +54 -0
  223. package/dist/{types-JktRxujg.d.ts → types-Cp4liug-.d.ts} +66 -3
  224. package/dist/{types-BKcxXW--.d.ts → types-CwyibrRB.d.ts} +12 -11
  225. package/dist/types-DIYwbkpe.d.ts +33 -0
  226. package/dist/types-jmqqnkKA.d.ts +163 -0
  227. package/dist/{useAnchoredListbox-7W90Ny-9.js → useAnchoredListbox-BN9LQnon.js} +1 -1
  228. package/dist/useDatePresentation-C07PnOCw.js +21 -0
  229. package/dist/{useMonthGrid-CmJsZTcB.js → useDateRange-CIXoE_8k.js} +1 -42
  230. package/dist/useDisclosureHandle-Df3HhAfC.js +24 -0
  231. package/dist/{useDismiss-CAiHU6QD.js → useDismiss-Cj8x_51F.js} +8 -4
  232. package/dist/useFieldControlState-voICDrys.js +18 -0
  233. package/dist/useHandleRef-6cdKugm8.js +17 -0
  234. package/dist/useIndicator-i1NORM7W.js +147 -0
  235. package/dist/useMenuDrillIn-OaEwjK44.js +520 -0
  236. package/dist/useMonthGrid-fGHSSrFc.js +43 -0
  237. package/dist/usePendingChange-ib-h8FZK.js +25 -0
  238. package/dist/{useResizable-CeESZS1v.d.ts → useResizable-CUoNPmUw.d.ts} +1 -1
  239. package/dist/useSubmenuMode-CZN9qrUo.js +37 -0
  240. package/package.json +9 -1
  241. package/styles/calendar.css +38 -3
  242. package/styles/chat.css +469 -1
  243. package/styles/check-indicator.css +17 -0
  244. package/styles/checkbox-indicator.css +29 -10
  245. package/styles/checkbox-input.css +0 -11
  246. package/styles/date-input.css +48 -0
  247. package/styles/dropdown-menu.css +163 -0
  248. package/styles/field.css +48 -0
  249. package/styles/icon.css +69 -1
  250. package/styles/input-group.css +32 -3
  251. package/styles/multi-selector.css +26 -0
  252. package/styles/power-search.css +303 -0
  253. package/styles/radio-indicator.css +90 -0
  254. package/styles/radio.css +9 -42
  255. package/styles/selector.css +112 -14
  256. package/styles/table.css +304 -1
  257. package/styles.css +3 -0
  258. package/dist/Calendar-DqC3EDN1.js +0 -352
  259. package/dist/Chat-DCjXRiOF.js +0 -1051
  260. package/dist/CheckboxIndicator-DdJmksHt.js +0 -52
  261. package/dist/DateInput-Crcg-CCj.js +0 -376
  262. package/dist/DropdownMenu-XvW4BJob.js +0 -164
  263. package/dist/InputGroup-ChrFVxzV.js +0 -42
  264. package/dist/Selector-DkJOLZSR.js +0 -468
  265. package/dist/Table-DwehtMap.js +0 -967
  266. package/dist/index-BLOEjvaM.d.ts +0 -398
  267. package/dist/index-Bgv4ZmBl.d.ts +0 -72
  268. package/dist/index-CuFLztiI.d.ts +0 -49
  269. package/dist/index-DJo-BmXZ.d.ts +0 -431
  270. package/dist/index-IbUN4M8V.d.ts +0 -40
  271. package/dist/types-DDAAT1Xd.d.ts +0 -285
  272. package/dist/useGridRovingFocus-DQQAOYH5.js +0 -99
  273. /package/dist/{index-BUXNRekN.d.ts → index-BXkNZF3q.d.ts} +0 -0
@@ -1,285 +0,0 @@
1
- import { a as ButtonProps } from "./types-WlmsNL1I.js";
2
- import { n as LayerPlacement, t as LayerAlignment } from "./position-DFW5ymAF.js";
3
- import { c as ItemTarget } from "./types-CAZY4Xua.js";
4
- import { Component, VNodeChild } from "vue";
5
- //#region src/DropdownMenu/types.d.ts
6
- /** Size of the menu, derived from the trigger button's size. */
7
- type DropdownMenuSize = 'sm' | 'md' | 'lg';
8
- /**
9
- * Where the menu opens.
10
- *
11
- * `popover` hangs off the trigger. `bottom-sheet` rises from the bottom edge.
12
- * `adaptive` uses the sheet only on a compact touch surface.
13
- */
14
- type DropdownMenuPresentation = 'adaptive' | 'bottom-sheet' | 'popover';
15
- /** Visual variant of one menu row. */
16
- type DropdownMenuItemVariant = 'default' | 'destructive';
17
- /**
18
- * The trigger button's properties.
19
- *
20
- * Every `Button` prop is accepted except `clickAction`, which would compete
21
- * with the menu for the trigger's click. Hover and pressed paint stay the
22
- * Button's own; the open state is exposed to CSS as `[data-open='true']` on the
23
- * trigger wrapper.
24
- */
25
- type DropdownMenuButtonProps = Omit<ButtonProps, 'clickAction'>;
26
- /**
27
- * The wiring a custom trigger spreads onto the control that opens the menu.
28
- *
29
- * These keys are already written in the attribute form the DOM wants, so
30
- * `v-bind` them wholesale onto the control. The menu is then named by that
31
- * control through `aria-labelledby`.
32
- */
33
- interface DropdownMenuTriggerProps {
34
- /** The control's id; the menu points at it with `aria-labelledby`. */
35
- 'id': string;
36
- 'aria-haspopup': 'menu';
37
- 'aria-expanded': boolean;
38
- 'aria-controls': string;
39
- /** Toggles the menu. */
40
- 'onClick': (event: MouseEvent) => void;
41
- /** Opens on Enter, Space, ArrowDown and ArrowUp; while open, ArrowDown walks into the menu. */
42
- 'onKeyDown': (event: KeyboardEvent) => void;
43
- }
44
- /** One action row of the `items` data API. */
45
- interface DropdownMenuItemData {
46
- /**
47
- * Stable identity for the row. Omit it and the row is keyed by position,
48
- * which is correct for a fixed menu; set it when `items` can reorder,
49
- * filter, or grow, so a row keeps its DOM node — and therefore keyboard
50
- * focus — as the array changes around it.
51
- */
52
- id?: string;
53
- /** Primary label content. */
54
- label: string | number;
55
- /**
56
- * Icon shown before the label.
57
- *
58
- * Pass a CSS icon class — for example an UnoCSS class such as
59
- * `'i-carbon-copy'` — or a Vue component that draws the SVG. astryx-vue ships
60
- * no icons of its own.
61
- */
62
- icon?: string | Component;
63
- /** Secondary line below the label. */
64
- description?: string | number;
65
- /**
66
- * Whether the row is disabled.
67
- * @default false
68
- */
69
- isDisabled?: boolean;
70
- /**
71
- * Visual variant. `destructive` renders the label, description, and icon in
72
- * the error color for dangerous actions.
73
- * @default 'default'
74
- */
75
- variant?: DropdownMenuItemVariant;
76
- /** Trailing content, such as a keyboard-shortcut hint. */
77
- endContent?: VNodeChild;
78
- /**
79
- * Whether activating the row closes the menu. Set `false` for an action that
80
- * reports its result on the row itself.
81
- * @default true
82
- */
83
- hasCloseOnSelect?: boolean;
84
- /** Address the row navigates to; the row then renders as a link. */
85
- href?: string;
86
- /** Link target. Only used with `href`. */
87
- target?: ItemTarget;
88
- /** Link relationship. Only used with `href`. */
89
- rel?: string;
90
- /** Called when the row is activated. */
91
- onClick?: (event: MouseEvent) => void;
92
- }
93
- /** A divider row of the `items` data API. */
94
- interface DropdownMenuDividerData {
95
- type: 'divider';
96
- }
97
- /** A titled group of rows of the `items` data API. */
98
- interface DropdownMenuSection {
99
- type: 'section';
100
- /** Stable identity for the group. */
101
- id?: string;
102
- /** Heading shown above the group's rows and used as its accessible name. */
103
- title?: string;
104
- items: DropdownMenuItemData[];
105
- }
106
- /** One entry of the `items` data API. */
107
- type DropdownMenuOption = DropdownMenuItemData | DropdownMenuDividerData | DropdownMenuSection;
108
- interface DropdownMenuProps {
109
- /**
110
- * The design system's own button as the trigger. Ignored when the `trigger`
111
- * slot renders a control instead.
112
- * @default { label: 'Menu' }
113
- */
114
- button?: DropdownMenuButtonProps;
115
- /**
116
- * Data-mode menu entries: action items, `{ type: 'divider' }`, and
117
- * `{ type: 'section', title, items }`. Provide either `items` or the default
118
- * slot; `items` wins when both are present.
119
- */
120
- items?: DropdownMenuOption[];
121
- /**
122
- * Controlled open state. Pair it with `v-model:is-menu-open`. Left out, the
123
- * menu manages its own open state.
124
- */
125
- isMenuOpen?: boolean;
126
- /**
127
- * Minimum width of the menu. A length grows for its content; an intrinsic
128
- * keyword such as `max-content` becomes the preferred width instead. Every
129
- * form is capped to the viewport. Defaults to the trigger's width, capped.
130
- */
131
- menuWidth?: number | string;
132
- /**
133
- * Maximum height of the menu in pixels, for a menu that must fit its rows.
134
- * Lifts the default 300px cap; the viewport still bounds it.
135
- */
136
- menuMaxHeight?: number;
137
- /**
138
- * Where the menu opens relative to the trigger. Flips when there is no room.
139
- * @default 'below'
140
- */
141
- placement?: LayerPlacement;
142
- /**
143
- * `popover` anchors to the trigger. `bottom-sheet` uses a bottom sheet.
144
- * `adaptive` chooses the sheet on a compact touch surface and a popover
145
- * otherwise.
146
- * @default 'popover'
147
- */
148
- presentation?: DropdownMenuPresentation;
149
- /**
150
- * How the menu aligns with the trigger along the placement axis.
151
- * @default 'start'
152
- */
153
- alignment?: LayerAlignment;
154
- /**
155
- * Whether the trigger button shows a trailing chevron. Hidden by default on
156
- * an icon-only trigger.
157
- * @default true
158
- */
159
- hasChevron?: boolean;
160
- }
161
- interface DropdownMenuEmits {
162
- 'update:isMenuOpen': [isOpen: boolean];
163
- /** Fired when the open state changes. */
164
- 'openChange': [isOpen: boolean];
165
- /** Fired when the trigger is activated. */
166
- 'click': [];
167
- }
168
- interface DropdownMenuSlots {
169
- /**
170
- * Compound menu content: `DropdownMenuItem`, `DropdownMenuDivider` and
171
- * `DropdownMenuGroup`. Mutually exclusive with `items`.
172
- */
173
- default?: () => VNodeChild;
174
- /**
175
- * The control the menu hangs off — an icon button, a chip, an avatar, a list
176
- * row. Spread the given props onto it.
177
- */
178
- trigger?: (props: DropdownMenuTriggerProps) => VNodeChild;
179
- }
180
- interface DropdownMenuItemProps {
181
- /**
182
- * Primary label content. Use the `label` slot for rich content.
183
- */
184
- label?: string | number;
185
- /**
186
- * Secondary line below the label. Use the `description` slot for rich
187
- * content.
188
- */
189
- description?: string | number;
190
- /**
191
- * Icon shown before the label.
192
- *
193
- * Pass a CSS icon class — for example an UnoCSS class such as
194
- * `'i-carbon-copy'` — or a Vue component that draws the SVG. astryx-vue ships
195
- * no icons of its own. Use the `icon` slot for arbitrary content.
196
- */
197
- icon?: string | Component;
198
- /**
199
- * Whether the row is disabled. A disabled row is skipped by the arrow keys
200
- * and by typeahead.
201
- * @default false
202
- */
203
- isDisabled?: boolean;
204
- /**
205
- * Visual variant. `destructive` renders the label, description, and icon in
206
- * the error color for dangerous actions.
207
- * @default 'default'
208
- */
209
- variant?: DropdownMenuItemVariant;
210
- /**
211
- * Whether activating the row closes the menu. Set `false` for an action that
212
- * reports its result on the row itself.
213
- * @default true
214
- */
215
- hasCloseOnSelect?: boolean;
216
- /**
217
- * Address the row navigates to. The row then renders as one anchor carrying
218
- * `role="menuitem"`, so a modified click and a middle click keep the
219
- * browser's meaning.
220
- */
221
- href?: string;
222
- /**
223
- * Link target. Only used with `href`.
224
- */
225
- target?: ItemTarget;
226
- /**
227
- * Link relationship. `noopener` and `noreferrer` are merged in for
228
- * `target="_blank"`. Only used with `href`.
229
- */
230
- rel?: string;
231
- /**
232
- * Called when the row is activated. On a link row it runs before the browser
233
- * navigates, and is skipped for a modified click, which the browser owns.
234
- */
235
- onClick?: (event: MouseEvent) => void;
236
- }
237
- interface DropdownMenuItemEmits {
238
- /** Fired when the row is activated. */
239
- click: [event: MouseEvent];
240
- }
241
- interface DropdownMenuItemSlots {
242
- /** Rich content replacing the `icon` prop. */
243
- icon?: () => VNodeChild;
244
- /** Rich content replacing the `label` prop. */
245
- label?: () => VNodeChild;
246
- /** Rich content replacing the `description` prop. */
247
- description?: () => VNodeChild;
248
- /** Trailing content, such as a keyboard-shortcut hint. */
249
- endContent?: () => VNodeChild;
250
- }
251
- interface DropdownMenuGroupProps {
252
- /**
253
- * Heading shown above the group's rows and used as the group's accessible
254
- * name. Omit it for an unnamed group.
255
- */
256
- title?: string | number;
257
- }
258
- interface DropdownMenuGroupSlots {
259
- /** The rows of the group. */
260
- default?: () => VNodeChild;
261
- /** Rich content replacing the `title` prop, still used as the group's name. */
262
- title?: () => VNodeChild;
263
- }
264
- interface DropdownMenuSubMenuProps {
265
- /** Row label. */
266
- label?: string | number;
267
- /** Icon before the label. A CSS class or a component. */
268
- icon?: string | Component;
269
- /** Secondary line under the label. */
270
- description?: string | number;
271
- /**
272
- * Whether the row can open its flyout.
273
- * @default false
274
- */
275
- isDisabled?: boolean;
276
- }
277
- interface DropdownMenuSubMenuSlots {
278
- /** The rows of the nested menu. */
279
- default?: () => VNodeChild;
280
- icon?: () => VNodeChild;
281
- label?: () => VNodeChild;
282
- description?: () => VNodeChild;
283
- }
284
- //#endregion
285
- export { DropdownMenuSubMenuProps as _, DropdownMenuGroupSlots as a, DropdownMenuItemProps as c, DropdownMenuOption as d, DropdownMenuPresentation as f, DropdownMenuSlots as g, DropdownMenuSize as h, DropdownMenuGroupProps as i, DropdownMenuItemSlots as l, DropdownMenuSection as m, DropdownMenuDividerData as n, DropdownMenuItemData as o, DropdownMenuProps as p, DropdownMenuEmits as r, DropdownMenuItemEmits as s, DropdownMenuButtonProps as t, DropdownMenuItemVariant as u, DropdownMenuSubMenuSlots as v, DropdownMenuTriggerProps as y };
@@ -1,99 +0,0 @@
1
- import { ref, watch } from "vue";
2
- //#region src/composables/useGridRovingFocus.ts
3
- /**
4
- * 网格式导航(roving tabindex):用方向键在二维网格中移动焦点。
5
- * 供 Calendar、Pagination(如果需要)等组件复用。
6
- */
7
- function useGridRovingFocus(options) {
8
- const { rows, columns, activeIndex, isEnabled = ref(true), isDisabled, onChange } = options;
9
- const row = ref(0);
10
- const column = ref(0);
11
- watch(activeIndex, (index) => {
12
- const cols = columns.value;
13
- if (cols > 0) {
14
- row.value = Math.floor(index / cols);
15
- column.value = index % cols;
16
- }
17
- }, { immediate: true });
18
- function indexFromRowCol(r, c) {
19
- return r * columns.value + c;
20
- }
21
- function moveTo(targetRow, targetCol) {
22
- if (!isEnabled.value) return;
23
- const r = Math.max(0, Math.min(targetRow, rows.value - 1));
24
- const c = Math.max(0, Math.min(targetCol, columns.value - 1));
25
- if (isDisabled?.(r, c)) return;
26
- const index = indexFromRowCol(r, c);
27
- onChange(index);
28
- }
29
- function moveUp() {
30
- moveTo(row.value - 1, column.value);
31
- }
32
- function moveDown() {
33
- moveTo(row.value + 1, column.value);
34
- }
35
- function moveLeft() {
36
- moveTo(row.value, column.value - 1);
37
- }
38
- function moveRight() {
39
- moveTo(row.value, column.value + 1);
40
- }
41
- function moveToFirstInRow() {
42
- moveTo(row.value, 0);
43
- }
44
- function moveToLastInRow() {
45
- moveTo(row.value, columns.value - 1);
46
- }
47
- function moveToFirstInColumn() {
48
- moveTo(0, column.value);
49
- }
50
- function moveToLastInColumn() {
51
- moveTo(rows.value - 1, column.value);
52
- }
53
- function onKeyDown(event) {
54
- if (!isEnabled.value) return;
55
- switch (event.key) {
56
- case "ArrowUp":
57
- event.preventDefault();
58
- moveUp();
59
- break;
60
- case "ArrowDown":
61
- event.preventDefault();
62
- moveDown();
63
- break;
64
- case "ArrowLeft":
65
- event.preventDefault();
66
- moveLeft();
67
- break;
68
- case "ArrowRight":
69
- event.preventDefault();
70
- moveRight();
71
- break;
72
- case "Home":
73
- event.preventDefault();
74
- if (event.ctrlKey) moveTo(0, 0);
75
- else moveToFirstInRow();
76
- break;
77
- case "End":
78
- event.preventDefault();
79
- if (event.ctrlKey) moveTo(rows.value - 1, columns.value - 1);
80
- else moveToLastInRow();
81
- break;
82
- case "PageUp":
83
- event.preventDefault();
84
- moveToFirstInColumn();
85
- break;
86
- case "PageDown":
87
- event.preventDefault();
88
- moveToLastInColumn();
89
- }
90
- }
91
- return {
92
- row,
93
- column,
94
- onKeyDown,
95
- moveTo
96
- };
97
- }
98
- //#endregion
99
- export { useGridRovingFocus as t };