@astryx-vue/core 0.31.0 → 0.32.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 (268) hide show
  1. package/dist/AlertDialog/index.js +1 -1
  2. package/dist/{AlertDialog-CvNtu0Jd.js → AlertDialog-C5pc5nQN.js} +4 -4
  3. package/dist/AppShell/index.d.ts +1 -1
  4. package/dist/AppShell/index.js +1 -1
  5. package/dist/{AppShell-BmX6wqba.js → AppShell-B7dkDyY8.js} +1 -1
  6. package/dist/Avatar/index.js +1 -1
  7. package/dist/{Avatar-IVvsyeGV.js → Avatar-CYW9ZTD3.js} +1 -1
  8. package/dist/AvatarGroup/index.d.ts +1 -1
  9. package/dist/Banner/index.d.ts +1 -1
  10. package/dist/Banner/index.js +1 -1
  11. package/dist/{Banner-DKmvoMxD.js → Banner-BNrs2Ptl.js} +1 -1
  12. package/dist/BottomSheet/index.d.ts +1 -1
  13. package/dist/BottomSheet/index.js +2 -2
  14. package/dist/{BottomSheet-B8_znPYE.js → BottomSheet-CAJJ8cR5.js} +3 -3
  15. package/dist/{BottomSheet-BZ_yFoKC.js → BottomSheet-Z92IvLBU.js} +2 -2
  16. package/dist/Breadcrumbs/index.d.ts +2 -2
  17. package/dist/Breadcrumbs/index.js +2 -2
  18. package/dist/{Breadcrumbs-CJpvbZsf.js → Breadcrumbs-CnvaPn8M.js} +1 -1
  19. package/dist/Button/index.d.ts +1 -1
  20. package/dist/Button/index.js +1 -1
  21. package/dist/{Button-DdPty46q.js → Button-CzMWqCpJ.js} +2 -2
  22. package/dist/ButtonGroup/index.d.ts +1 -1
  23. package/dist/Calendar/index.d.ts +1 -1
  24. package/dist/Card/index.d.ts +1 -1
  25. package/dist/Carousel/index.d.ts +1 -1
  26. package/dist/Carousel/index.js +1 -1
  27. package/dist/{Carousel-BNr79JpP.js → Carousel-BjyedZ0Y.js} +1 -1
  28. package/dist/Chat/index.d.ts +1 -1
  29. package/dist/Chat/index.js +1 -1
  30. package/dist/{Chat-BadS0fEx.js → Chat-CJr2RIyc.js} +11 -11
  31. package/dist/CheckboxInput/index.d.ts +1 -1
  32. package/dist/CheckboxInput/index.js +1 -1
  33. package/dist/{CheckboxInput-CzP8gP3v.js → CheckboxInput-BrbQTrL-.js} +1 -1
  34. package/dist/CheckboxList/index.d.ts +1 -1
  35. package/dist/CheckboxList/index.js +1 -1
  36. package/dist/{CheckboxListItem-CxBjpX3d.js → CheckboxListItem-CrAzFR4x.js} +3 -3
  37. package/dist/ClickableCard/index.d.ts +1 -1
  38. package/dist/Code/index.d.ts +1 -1
  39. package/dist/Code/index.js +1 -1
  40. package/dist/{CodeBlock-Cgm4uOhG.js → CodeBlock-pWPw1-iu.js} +1 -1
  41. package/dist/Collapsible/index.d.ts +1 -1
  42. package/dist/CommandPalette/index.d.ts +1 -1
  43. package/dist/CommandPalette/index.js +1 -1
  44. package/dist/{CommandPalette-BgVwGtdA.js → CommandPalette-DnbvnT4c.js} +1 -1
  45. package/dist/ComplexSelector/index.d.ts +1 -1
  46. package/dist/ComplexSelector/index.js +1 -1
  47. package/dist/{ComplexSelector-vna5wtig.js → ComplexSelector-DWQbuovE.js} +2 -2
  48. package/dist/ContextMenu/index.d.ts +2 -2
  49. package/dist/ContextMenu/index.js +2 -2
  50. package/dist/{ContextMenu-CE-FnLI6.js → ContextMenu-DfoShDVW.js} +167 -142
  51. package/dist/DateInput/index.d.ts +1 -1
  52. package/dist/DateInput/index.js +1 -1
  53. package/dist/{DateInput-BCasoeIj.js → DateInput-D9_QsZMj.js} +10 -10
  54. package/dist/DateRangeInput/index.d.ts +1 -1
  55. package/dist/DateRangeInput/index.js +1 -1
  56. package/dist/{DateRangeInput-Bi97pjDX.js → DateRangeInput-8P8i8aVI.js} +5 -5
  57. package/dist/DateTimeInput/index.d.ts +1 -1
  58. package/dist/DateTimeInput/index.js +1 -1
  59. package/dist/{DateTimeInput-CKnvjLhi.js → DateTimeInput-C2XWslHp.js} +5 -5
  60. package/dist/Dialog/index.d.ts +1 -1
  61. package/dist/Dialog/index.js +3 -3
  62. package/dist/{Dialog-Dt0gNuMT.js → Dialog-B1Hlr0x_.js} +2 -2
  63. package/dist/{Dialog-BN-NycQr.js → Dialog-Cet6PTnf.js} +1 -1
  64. package/dist/{DialogHeader-CSH2_5v-.js → DialogHeader-BiHQct4G.js} +2 -2
  65. package/dist/Drawer/index.d.ts +1 -1
  66. package/dist/Drawer/index.js +1 -1
  67. package/dist/{Drawer-PeMgE4iA.js → Drawer-Bm3l7Dey.js} +2 -2
  68. package/dist/DropdownMenu/index.d.ts +2 -2
  69. package/dist/DropdownMenu/index.js +2 -3
  70. package/dist/{DropdownMenu-aYOIh9gZ.js → DropdownMenu-BaRXEFLa.js} +1083 -555
  71. package/dist/{DropdownMenuRadioItem.vue-C8rePTyz.d.ts → DropdownMenuRadioItem.vue-B4iwMWWD.d.ts} +16 -0
  72. package/dist/EmptyState/index.js +1 -1
  73. package/dist/{EmptyState-BGo1nrnT.js → EmptyState-CXDlpIdI.js} +2 -2
  74. package/dist/Field/index.js +3 -3
  75. package/dist/{Field-D-fRqyso.js → Field-njr7AUcW.js} +1 -1
  76. package/dist/{FieldInfoTip-Bstp5Lvd.js → FieldInfoTip-DLqZykVm.js} +1 -1
  77. package/dist/{FieldLabel-lV_qLaGp.js → FieldLabel-CyL5D1lu.js} +1 -1
  78. package/dist/FileInput/index.d.ts +1 -1
  79. package/dist/FileInput/index.js +1 -1
  80. package/dist/{FileInput-CTNnDIkm.js → FileInput-CtqZSRdh.js} +3 -3
  81. package/dist/Heading/index.js +1 -1
  82. package/dist/{Heading-BFK3PftX.js → Heading-BXTbW_px.js} +1 -1
  83. package/dist/HoverCard/index.d.ts +1 -1
  84. package/dist/HoverCard/index.js +1 -1
  85. package/dist/{HoverCard-DGjsPn-Q.js → HoverCard-zVUEeqF2.js} +4 -4
  86. package/dist/IconButton/index.js +1 -1
  87. package/dist/{IconButton-DPezhVBA.js → IconButton-CoZFp0CP.js} +1 -1
  88. package/dist/InfoTip/index.d.ts +1 -1
  89. package/dist/InfoTip/index.js +1 -1
  90. package/dist/{InfoTip-B4BFfLtT.js → InfoTip-Eg2IGZJw.js} +1 -1
  91. package/dist/{InputClearButton-CxU3iv-5.js → InputClearButton-CBsL91my.js} +1 -1
  92. package/dist/InputGroup/index.d.ts +1 -1
  93. package/dist/InputGroup/index.js +1 -1
  94. package/dist/{InputGroup-CraWGK6Y.js → InputGroup-BE83-MCX.js} +1 -1
  95. package/dist/InternationalizationProvider/index.js +1 -1
  96. package/dist/{InternationalizationProvider-C-hZoz8a.js → InternationalizationProvider-BAUKUK7N.js} +1 -1
  97. package/dist/{LayerContentBoundary-LCQLyxBT.js → LayerContentBoundary-DmRI6Bg0.js} +1 -1
  98. package/dist/Lightbox/index.js +1 -1
  99. package/dist/{Lightbox-BNUG9CQ1.js → Lightbox-5PtYb0r4.js} +2 -2
  100. package/dist/Link/index.d.ts +1 -1
  101. package/dist/Link/index.js +1 -1
  102. package/dist/{Link-Bwgpn-di.js → Link-BzXVGE7G.js} +1 -1
  103. package/dist/List/index.d.ts +1 -1
  104. package/dist/Markdown/index.d.ts +1 -1
  105. package/dist/Markdown/index.js +1 -1
  106. package/dist/{Markdown-BlEi5UGN.js → Markdown-HDZPj9Vw.js} +3 -3
  107. package/dist/MobileNav/index.js +1 -1
  108. package/dist/{MobileNavToggle-wVa9dzH1.js → MobileNavToggle-CrUf5UPQ.js} +2 -2
  109. package/dist/MoreMenu/index.d.ts +1 -1
  110. package/dist/MoreMenu/index.js +1 -1
  111. package/dist/{MoreMenu-CXshllJj.js → MoreMenu-DzpufGyj.js} +44 -15
  112. package/dist/MultiSelector/index.d.ts +1 -1
  113. package/dist/MultiSelector/index.js +1 -1
  114. package/dist/{MultiSelector-Bs3Imw6k.js → MultiSelector-BS6wxlx4.js} +7 -7
  115. package/dist/{NavDisclosure-DsUYuMJr.js → NavDisclosure-BM0dJGLA.js} +1 -1
  116. package/dist/{NavHeadingSurface-QdM33nOf.js → NavHeadingSurface-CuQnoV_V.js} +1 -1
  117. package/dist/NavItem/index.d.ts +1 -1
  118. package/dist/NavMenu/index.js +3 -3
  119. package/dist/{NavMenu-NCg3VjAQ.js → NavMenu-fXsoJKjW.js} +3 -3
  120. package/dist/{NavMenuItem-Bla6fYVl.js → NavMenuItem-BKY6eRkz.js} +2 -2
  121. package/dist/NumberInput/index.d.ts +1 -1
  122. package/dist/NumberInput/index.js +1 -1
  123. package/dist/{NumberInput-DicgvFte.js → NumberInput-Ueted2wi.js} +3 -3
  124. package/dist/OverflowList/index.d.ts +1 -1
  125. package/dist/OverflowList/index.js +1 -1
  126. package/dist/{OverflowList-BYYz3ePw.js → OverflowList-KpebInhH.js} +2 -2
  127. package/dist/Overlay/index.d.ts +1 -1
  128. package/dist/Pagination/index.d.ts +1 -1
  129. package/dist/Pagination/index.js +1 -1
  130. package/dist/{Pagination-kJhH6sPF.js → Pagination-BliQ5RGN.js} +2 -2
  131. package/dist/Popover/index.d.ts +1 -1
  132. package/dist/Popover/index.js +1 -1
  133. package/dist/{Popover-CqL_AXQB.js → Popover-DXfXGrWG.js} +6 -6
  134. package/dist/PowerSearch/index.d.ts +1 -1
  135. package/dist/PowerSearch/index.js +1 -1
  136. package/dist/{PowerSearch-Ff2n7eJ2.js → PowerSearch-CmJKFEEu.js} +25 -25
  137. package/dist/ProgressBar/index.d.ts +1 -1
  138. package/dist/ProgressBar/index.js +1 -1
  139. package/dist/{ProgressBar-DCAEXJuP.js → ProgressBar-Dj1ucJxG.js} +1 -1
  140. package/dist/Radio/index.d.ts +1 -1
  141. package/dist/Radio/index.js +1 -1
  142. package/dist/{RadioGroup-CsJYGjyx.js → RadioGroup-BLOjBRrM.js} +2 -2
  143. package/dist/RadioList/index.d.ts +1 -1
  144. package/dist/RadioList/index.js +1 -1
  145. package/dist/{RadioListItem-Yc3K82YE.js → RadioListItem-CHxTpBva.js} +1 -1
  146. package/dist/ScrollableArea/index.d.ts +1 -1
  147. package/dist/SelectableCard/index.d.ts +1 -1
  148. package/dist/Selector/index.d.ts +1 -1
  149. package/dist/Selector/index.js +1 -1
  150. package/dist/{Selector-DgzSGUul.js → Selector-OhIdsI8A.js} +6 -6
  151. package/dist/SideNav/index.d.ts +1 -1
  152. package/dist/SideNav/index.js +1 -1
  153. package/dist/{SideNav-DNQZ8l6b.js → SideNav-CcdDU-hP.js} +5 -5
  154. package/dist/Slider/index.js +1 -1
  155. package/dist/{Slider-Bq_7Nskr.js → Slider-DjbWQ1wn.js} +1 -1
  156. package/dist/StatusDot/index.js +1 -1
  157. package/dist/{StatusDot-DFJavm30.js → StatusDot-Bta_bpaZ.js} +1 -1
  158. package/dist/Stepper/index.d.ts +1 -1
  159. package/dist/Switch/index.d.ts +1 -1
  160. package/dist/Switch/index.js +1 -1
  161. package/dist/{Switch-DTPvMAxd.js → Switch-D4ojsj_l.js} +1 -1
  162. package/dist/TabList/index.d.ts +1 -1
  163. package/dist/TabList/index.js +1 -1
  164. package/dist/{TabList-C4i7UZkp.js → TabList-S99zXoRN.js} +2 -2
  165. package/dist/Table/index.d.ts +1 -1
  166. package/dist/Table/index.js +1 -1
  167. package/dist/{Table-CqAV7l7W.js → Table-3NTjPpHc.js} +12 -12
  168. package/dist/Text/index.js +1 -1
  169. package/dist/{Text-D48QFTtL.js → Text-DNKNlENe.js} +1 -1
  170. package/dist/TextArea/index.d.ts +1 -1
  171. package/dist/TextArea/index.js +1 -1
  172. package/dist/{TextArea-J2_wct0p.js → TextArea-DnSmL0A8.js} +4 -4
  173. package/dist/TextInput/index.d.ts +1 -1
  174. package/dist/TextInput/index.js +1 -1
  175. package/dist/{TextInput-Da1TYd57.js → TextInput-DyHEMYld.js} +4 -4
  176. package/dist/Thumbnail/index.js +1 -1
  177. package/dist/{Thumbnail-1LsaJ4_m.js → Thumbnail-D8GlIdNm.js} +2 -2
  178. package/dist/{TimeField-ojhX2ZOj.js → TimeField-ADeT0OA1.js} +4 -4
  179. package/dist/TimeInput/index.d.ts +1 -1
  180. package/dist/TimeInput/index.js +1 -1
  181. package/dist/{TimeInput-CfeDP72M.js → TimeInput-C1gzJGHk.js} +2 -2
  182. package/dist/Timer/index.js +1 -1
  183. package/dist/{Timer-DgQdZAEa.js → Timer-DhI2oV5L.js} +1 -1
  184. package/dist/Timestamp/index.d.ts +1 -1
  185. package/dist/Timestamp/index.js +1 -1
  186. package/dist/{Timestamp-SseS_qtf.js → Timestamp-CTZSVsmd.js} +3 -3
  187. package/dist/Toast/index.js +1 -1
  188. package/dist/{Toast-yUVFaZiJ.js → Toast-DUqDW07c.js} +1 -1
  189. package/dist/ToggleButton/index.d.ts +1 -1
  190. package/dist/ToggleButton/index.js +1 -1
  191. package/dist/{ToggleButton-B6hBzeVl.js → ToggleButton-BMBH2tmu.js} +1 -1
  192. package/dist/Token/index.d.ts +1 -1
  193. package/dist/Tokenizer/index.d.ts +1 -1
  194. package/dist/Tokenizer/index.js +1 -1
  195. package/dist/{Tokenizer-nSEekhN1.js → Tokenizer-C0CdEzQT.js} +12 -12
  196. package/dist/Toolbar/index.d.ts +1 -1
  197. package/dist/Tooltip/index.d.ts +1 -1
  198. package/dist/Tooltip/index.js +2 -2
  199. package/dist/{Tooltip-CxzlUVN0.js → Tooltip-CEyd_iFa.js} +1 -1
  200. package/dist/TopNav/index.d.ts +1 -1
  201. package/dist/TopNav/index.js +1 -1
  202. package/dist/{TopNav-CcIayfsW.js → TopNav-BObecD_X.js} +4 -4
  203. package/dist/Typeahead/index.d.ts +1 -1
  204. package/dist/Typeahead/index.js +2 -2
  205. package/dist/{Typeahead-BD6xXNKh.js → Typeahead-C_0dTmaf.js} +5 -5
  206. package/dist/{useMenuDrillIn-CMsgOcDP.js → accessibleName-Cq7krRE-.js} +116 -26
  207. package/dist/{assertOptions-DHfonaBU.js → assertOptions-Km_9Y5rI.js} +1 -1
  208. package/dist/composables/index.d.ts +2 -2
  209. package/dist/composables/index.js +11 -11
  210. package/dist/{composables-CVvk9709.js → composables-kHI1dSq2.js} +2 -2
  211. package/dist/{index-Dp6MmjIo.d.ts → index-4m5X7IYX.d.ts} +92 -92
  212. package/dist/{index-DtY_R6Oh.d.ts → index-B83v2qNb.d.ts} +3 -3
  213. package/dist/{index-BuubzuE8.d.ts → index-BDZCJ9ri.d.ts} +2 -2
  214. package/dist/{index-C_iTVOHQ.d.ts → index-BIiG1CF_.d.ts} +4 -4
  215. package/dist/{index-DHUCHxn2.d.ts → index-BWWirRm3.d.ts} +1 -1
  216. package/dist/{index-CTjkJP4x.d.ts → index-Bgk1Rj2A.d.ts} +1 -1
  217. package/dist/{index-COgrQZIL.d.ts → index-BpFzfJbo.d.ts} +2 -2
  218. package/dist/{index-DH_xZI84.d.ts → index-Bxus0zuz.d.ts} +11 -11
  219. package/dist/{index-ChqMaV6N.d.ts → index-Bzi3A980.d.ts} +1 -1
  220. package/dist/{index-BjqoHLMq.d.ts → index-C1e8LNx2.d.ts} +1 -1
  221. package/dist/{index-DE-QPNz0.d.ts → index-C943VIzi.d.ts} +3 -2
  222. package/dist/{index-DYabo8TI.d.ts → index-CHLZPpjQ.d.ts} +3 -3
  223. package/dist/{index-Q1oG9yIT.d.ts → index-CO9GW-ik.d.ts} +1 -1
  224. package/dist/{index-AgTJRqUY.d.ts → index-CQi9WGWE.d.ts} +2 -2
  225. package/dist/{index-Bh-GqMzd.d.ts → index-CdRxeyhB.d.ts} +30 -2
  226. package/dist/{index-C9ZssPUV.d.ts → index-CiVrhGUJ.d.ts} +1 -1
  227. package/dist/{index-CG6dbyeb.d.ts → index-Cj-Ob5jw.d.ts} +10 -10
  228. package/dist/{index-mK1ICsVg.d.ts → index-Cm36VS1A.d.ts} +2 -2
  229. package/dist/{index-aHC2C89h.d.ts → index-DAEgHJTK.d.ts} +4 -4
  230. package/dist/{index-CuW4AQ7M.d.ts → index-DGe-ApvN.d.ts} +3 -3
  231. package/dist/{index-ZKBj_1nu.d.ts → index-DIw5D3zj.d.ts} +2 -2
  232. package/dist/{index-DofC9Rll.d.ts → index-Dk50Zh3F.d.ts} +2 -2
  233. package/dist/{index-0RIgvtdm.d.ts → index-DogWVRJi.d.ts} +1 -1
  234. package/dist/{index-CbA8rR_b.d.ts → index-FeZXsFO-.d.ts} +2 -2
  235. package/dist/{index-QC9FDUDA.d.ts → index-ILJ7sKx3.d.ts} +4 -4
  236. package/dist/{index-DVX2jlTQ.d.ts → index-JE1HrzdJ.d.ts} +2 -2
  237. package/dist/{index-DCyYldjP.d.ts → index-T5bzxQ30.d.ts} +1 -1
  238. package/dist/{index-BenG-F5d.d.ts → index-maTGrWjF.d.ts} +1 -1
  239. package/dist/{index-CEtFUoIm.d.ts → index-o3JHyrk8.d.ts} +1 -1
  240. package/dist/{index-yQc-te9a.d.ts → index-ql9ApSTF.d.ts} +2 -2
  241. package/dist/index.d.ts +33 -33
  242. package/dist/index.js +91 -91
  243. package/dist/{layerDepth-D3Rh8T5C.js → layerDepth-8jb4An1z.js} +1 -1
  244. package/dist/lazyBottomSheet-CNYA5qOy.js +25 -0
  245. package/dist/locale/index.js +3 -3
  246. package/dist/{locale-CVpkedoa.js → locale-C9LWi1y1.js} +1 -1
  247. package/dist/{menuActivation-BqiaK6ot.js → menuActivation-BQqnzKAX.js} +8 -1
  248. package/dist/{stillPointerGate-BbMABRyU.js → stillPointerGate-CpzpYNqy.js} +1 -1
  249. package/dist/{tooltipFocusRules-CpUOvFEU.js → tooltipFocusRules-BfnTnTpn.js} +2 -2
  250. package/dist/{tooltipTriggerRules-zN2xGd9K.js → tooltipTriggerRules-BRdKWVzo.js} +1 -1
  251. package/dist/{useCombobox-BqkTY3bw.js → useCombobox-DkwiskdE.js} +1 -1
  252. package/dist/{useDismiss-BKtyCwx4.js → useDismiss-fhWaGqY8.js} +1 -1
  253. package/dist/{useFocusTrap-BD9POtMp.js → useFocusTrap-DT2UCZd-.js} +1 -1
  254. package/dist/{useInputStatusIcon-BqV6YzTV.js → useInputStatusIcon-B1i0sFKu.js} +1 -1
  255. package/dist/{useMenuPress-DcwVUsQO.js → useMenuPress-CBtTaYOS.js} +71 -4
  256. package/dist/{useResizable-hv4NYIUi.js → useResizable-AfPBAq5c.js} +1 -1
  257. package/dist/{useTooltip-DvBKna-w.js → useTooltip-llyJd1q6.js} +4 -4
  258. package/dist/{useTouchTriggerInternal-Bl602PtA.js → useTouchTriggerInternal-DzsFiDjb.js} +1 -1
  259. package/dist/{useTruncationTooltip-DNAii2Nv.js → useTruncationTooltip-BFm7XgvO.js} +3 -3
  260. package/dist/{useTypeahead-BGpvWkzm.js → useTypeahead-8Y5m41VA.js} +1 -1
  261. package/dist/{useTypeaheadMenuConfig-BT9Lwsu7.js → useTypeaheadMenuConfig-Cy-gOjVd.js} +2 -2
  262. package/package.json +1 -1
  263. package/styles/dropdown-menu.css +5 -0
  264. package/dist/DropdownMenu-B_KDdI8P.js +0 -489
  265. package/dist/lazyBottomSheet-CbU1Pnfk.js +0 -16
  266. package/dist/useSubmenuMode-CZN9qrUo.js +0 -37
  267. package/dist/{index-BqhgeAT4.d.ts → index-D8lv2BiD.d.ts} +1 -1
  268. package/dist/{loadCatalog-FwMzmCx1.js → loadCatalog-zJKVLZ89.js} +1 -1
@@ -1,24 +1,30 @@
1
1
  import { t as hasSlotContent } from "./slotContent-CNWOrGOr.js";
2
- import { t as _sfc_main$7 } from "./Icon-Dk0jccgU.js";
2
+ import { t as _sfc_main$8 } from "./Icon-Dk0jccgU.js";
3
3
  import { n as useLinkComponent } from "./context-C_peZbXf.js";
4
- import { t as _sfc_main$8 } from "./Button-DdPty46q.js";
5
- import { n as usePositionedLayer, t as useDismiss } from "./useDismiss-BKtyCwx4.js";
6
- import { t as _sfc_main$9 } from "./LayerContentBoundary-LCQLyxBT.js";
4
+ import { t as _sfc_main$9 } from "./Button-CzMWqCpJ.js";
5
+ import { n as usePositionedLayer, t as useDismiss } from "./useDismiss-fhWaGqY8.js";
6
+ import { t as _sfc_main$10 } from "./LayerContentBoundary-DmRI6Bg0.js";
7
7
  import { a as trackInteractionModality, t as getInteractionModality } from "./interactionModality-4Km2ibsq.js";
8
8
  import { r as getFocusables } from "./focus-x7mxEqjR.js";
9
- import { a as isMenuPressActivation, t as useMenuPress } from "./useMenuPress-DcwVUsQO.js";
9
+ import { t as focusForLastInput } from "./focusReturn-DfZS7TCp.js";
10
+ import { o as useComponentMessages } from "./context-B8IEFCDR.js";
11
+ import { n as useMenuPress, s as isMenuPressActivation } from "./useMenuPress-CBtTaYOS.js";
10
12
  import { t as useOverflow } from "./useOverflow-GU0pxGaU.js";
11
- import { t as useTypeahead } from "./useTypeahead-BGpvWkzm.js";
13
+ import { t as useTypeahead } from "./useTypeahead-8Y5m41VA.js";
12
14
  import { t as useScrollbars } from "./useScrollbars-Ch0xqJWO.js";
13
- import { t as _sfc_main$10 } from "./Item-C9u_kQUO.js";
14
- import { a as _sfc_main$12, i as _sfc_main$13, n as useDropdownMenuMessages, o as dropdownMenuContextKey, r as _sfc_main$11, s as useDropdownMenuContext, t as useMenuDrillIn } from "./useMenuDrillIn-CMsgOcDP.js";
15
+ import { n as isModifiedClick, r as keepDisabledRowUnfocused, t as activateMenuItem } from "./menuActivation-BQqnzKAX.js";
16
+ import { t as _sfc_main$11 } from "./Item-C9u_kQUO.js";
17
+ import { a as _sfc_main$12, c as dropdownMenuContextKey, i as useDropdownMenuMessages, l as useDropdownMenuContext, n as useMenuDrillIn, o as _sfc_main$14, r as useSubmenuMode, s as _sfc_main$13, t as readAccessibleName } from "./accessibleName-Cq7krRE-.js";
15
18
  import { n as clampInlineSize, r as isIntrinsicInlineSize, t as LAYER_MAX_INLINE_SIZE } from "./inlineSize-BNe8wggI.js";
16
19
  import { t as useHeldPresentation } from "./useHeldPresentation-BF5vGVUn.js";
17
20
  import { t as useMenuEntranceHold } from "./useMenuEntranceHold-HznOwIry.js";
18
- import { t as LazyBottomSheet } from "./lazyBottomSheet-CbU1Pnfk.js";
19
- import { t as _sfc_main$14 } from "./Divider-mOZ6vIQw.js";
20
- import { n as isModifiedClick, t as activateMenuItem } from "./menuActivation-BqiaK6ot.js";
21
- import { Fragment, Teleport, Transition, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, guardReactiveProps, h, inject, markRaw, mergeModels, mergeProps, nextTick, normalizeProps, normalizeStyle, onBeforeUnmount, onMounted, openBlock, provide, reactive, ref, renderSlot, resolveDynamicComponent, shallowRef, toDisplayString, toRaw, unref, useAttrs, useId, useModel, useSlots, vShow, watch, withCtx, withDirectives } from "vue";
21
+ import { t as LazyBottomSheet } from "./lazyBottomSheet-CNYA5qOy.js";
22
+ import { t as _sfc_main$15 } from "./Divider-mOZ6vIQw.js";
23
+ import { t as useBusyAnnouncement } from "./busyAnnouncement-CExubuYm.js";
24
+ import { t as useMenuHover } from "./useMenuHover-DoBatZeD.js";
25
+ import { t as spinnerMessages } from "./spinner-DVia-eDf.js";
26
+ import { t as _sfc_main$16 } from "./Spinner-DEVPDsD0.js";
27
+ import { Fragment, Teleport, Transition, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, guardReactiveProps, h, inject, markRaw, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onBeforeUnmount, onMounted, openBlock, provide, reactive, ref, renderSlot, resolveDynamicComponent, shallowRef, toDisplayString, toRaw, unref, useAttrs, useId, useModel, useSlots, vShow, watch, withCtx, withDirectives, withKeys, withModifiers } from "vue";
22
28
  import "../styles/dropdown-menu.css";
23
29
  //#region src/composables/internal/useFocusReturnVisibility.ts
24
30
  /**
@@ -45,7 +51,7 @@ function useFocusReturnVisibility() {
45
51
  }
46
52
  //#endregion
47
53
  //#region src/DropdownMenu/DropdownMenuBranch.vue
48
- const _sfc_main$6 = /*@__PURE__*/ defineComponent({
54
+ const _sfc_main$7 = /*@__PURE__*/ defineComponent({
49
55
  name: "AstryxDropdownMenuBranch",
50
56
  __name: "DropdownMenuBranch",
51
57
  props: { value: {} },
@@ -61,76 +67,82 @@ const _sfc_main$6 = /*@__PURE__*/ defineComponent({
61
67
  const dropdownMenuFrameKey = Symbol("astryx-dropdown-menu-frame");
62
68
  //#endregion
63
69
  //#region src/DropdownMenu/DropdownMenuDivider.vue
64
- const _sfc_main$5 = /*@__PURE__*/ defineComponent({
70
+ const _sfc_main$6 = /*@__PURE__*/ defineComponent({
65
71
  name: "AstryxDropdownMenuDivider",
66
72
  __name: "DropdownMenuDivider",
67
73
  setup(__props) {
68
74
  return (_ctx, _cache) => {
69
- return openBlock(), createBlock(_sfc_main$14, { class: "astryx-dropdown-menu-divider" });
75
+ return openBlock(), createBlock(_sfc_main$15, { class: "astryx-dropdown-menu-divider" });
70
76
  };
71
77
  }
72
78
  });
73
79
  //#endregion
74
80
  //#region src/DropdownMenu/DropdownMenuSectionHeading.vue
75
- const _hoisted_1$4 = { class: "astryx-dropdown-menu-section-heading" };
76
- const _sfc_main$4 = /*@__PURE__*/ defineComponent({
81
+ const _hoisted_1$5 = { class: "astryx-dropdown-menu-section-heading" };
82
+ const _sfc_main$5 = /*@__PURE__*/ defineComponent({
77
83
  name: "AstryxDropdownMenuSectionHeading",
78
84
  __name: "DropdownMenuSectionHeading",
79
85
  setup(__props) {
80
86
  return (_ctx, _cache) => {
81
- return openBlock(), createElementBlock("div", _hoisted_1$4, [renderSlot(_ctx.$slots, "default")]);
87
+ return openBlock(), createElementBlock("div", _hoisted_1$5, [renderSlot(_ctx.$slots, "default")]);
82
88
  };
83
89
  }
84
90
  });
85
91
  //#endregion
86
92
  //#region src/DropdownMenu/DropdownMenuGroup.vue
87
- const _hoisted_1$3 = ["aria-labelledby"];
88
- const _sfc_main$3 = /*@__PURE__*/ defineComponent({
93
+ const _hoisted_1$4 = ["aria-labelledby"];
94
+ const _sfc_main$4 = /*@__PURE__*/ defineComponent({
89
95
  name: "AstryxDropdownMenuGroup",
96
+ inheritAttrs: false,
90
97
  __name: "DropdownMenuGroup",
91
98
  props: { title: {} },
92
99
  setup(__props) {
93
100
  const props = __props;
94
101
  const slots = useSlots();
102
+ const attrs = useAttrs();
95
103
  const headingId = `astryx-dropdown-menu-group-${useId()}`;
104
+ const callerLabelledBy = computed(() => {
105
+ const value = attrs["aria-labelledby"];
106
+ return typeof value === "string" ? value : void 0;
107
+ });
96
108
  function hasTitle() {
97
109
  return hasSlotContent(slots.title) || props.title != null && props.title !== "";
98
110
  }
99
111
  return (_ctx, _cache) => {
100
- return openBlock(), createElementBlock("div", {
112
+ return openBlock(), createElementBlock("div", mergeProps(unref(attrs), {
101
113
  class: "astryx-dropdown-menu-group",
102
114
  role: "group",
103
- "aria-labelledby": hasTitle() ? headingId : void 0
104
- }, [hasTitle() ? (openBlock(), createBlock(_sfc_main$4, {
115
+ "aria-labelledby": hasTitle() ? headingId : callerLabelledBy.value
116
+ }), [hasTitle() ? (openBlock(), createBlock(_sfc_main$5, {
105
117
  key: 0,
106
118
  id: headingId
107
119
  }, {
108
120
  default: withCtx(() => [renderSlot(_ctx.$slots, "title", {}, () => [createTextVNode(toDisplayString(__props.title), 1)])]),
109
121
  _: 3
110
- })) : createCommentVNode("v-if", true), renderSlot(_ctx.$slots, "default")], 8, _hoisted_1$3);
122
+ })) : createCommentVNode("v-if", true), renderSlot(_ctx.$slots, "default")], 16, _hoisted_1$4);
111
123
  };
112
124
  }
113
125
  });
114
126
  //#endregion
115
127
  //#region src/DropdownMenu/DropdownMenuItem.vue
116
- const _hoisted_1$2 = {
128
+ const _hoisted_1$3 = {
117
129
  key: 0,
118
130
  class: "astryx-item__start"
119
131
  };
120
- const _hoisted_2$1 = { class: "astryx-item__content" };
121
- const _hoisted_3$1 = {
132
+ const _hoisted_2$2 = { class: "astryx-item__content" };
133
+ const _hoisted_3$2 = {
122
134
  key: 0,
123
135
  class: "astryx-item__label"
124
136
  };
125
- const _hoisted_4$1 = {
137
+ const _hoisted_4$2 = {
126
138
  key: 1,
127
139
  class: "astryx-item__description"
128
140
  };
129
- const _hoisted_5$1 = {
141
+ const _hoisted_5$2 = {
130
142
  key: 1,
131
143
  class: "astryx-item__end"
132
144
  };
133
- const _sfc_main$2 = /*@__PURE__*/ defineComponent({
145
+ const _sfc_main$3 = /*@__PURE__*/ defineComponent({
134
146
  name: "AstryxDropdownMenuItem",
135
147
  inheritAttrs: false,
136
148
  __name: "DropdownMenuItem",
@@ -210,7 +222,7 @@ const _sfc_main$2 = /*@__PURE__*/ defineComponent({
210
222
  function handlePointerMove(event) {
211
223
  if (props.isDisabled || event.pointerType !== "mouse") return;
212
224
  const row = event.currentTarget;
213
- if (row instanceof HTMLElement && row !== row.ownerDocument.activeElement) row.focus({ preventScroll: true });
225
+ if (row instanceof HTMLElement && row !== row.ownerDocument.activeElement) focusForLastInput(row, { preventScroll: true });
214
226
  }
215
227
  return (_ctx, _cache) => {
216
228
  return openBlock(), createElementBlock(Fragment, null, [createCommentVNode("\n A row that navigates is the link itself. `Item` gives its root an inner\n anchor instead when a `role` is set, which would put two controls in one\n row, so the link row renders the same markup with the anchor as its root.\n "), isLink.value ? (openBlock(), createBlock(resolveDynamicComponent(linkRoot.value), mergeProps({ key: 0 }, forwardedAttrs.value, {
@@ -228,20 +240,21 @@ const _sfc_main$2 = /*@__PURE__*/ defineComponent({
228
240
  to: linkRoot.value !== "a" && !__props.isDisabled ? linkHref.value : void 0,
229
241
  rel: resolvedRel.value,
230
242
  style: unref(attrs).style,
231
- tabindex: __props.isDisabled ? void 0 : -1,
243
+ tabindex: "-1",
232
244
  target: __props.target,
233
245
  onAuxclick: handleAuxClick,
234
246
  onClick: handleClick,
247
+ onMousedown: _cache[0] || (_cache[0] = ($event) => __props.isDisabled && unref(keepDisabledRowUnfocused)($event)),
235
248
  onPointermove: handlePointerMove
236
249
  }), {
237
250
  default: withCtx(() => [
238
- hasStart.value ? (openBlock(), createElementBlock("span", _hoisted_1$2, [renderSlot(_ctx.$slots, "icon", {}, () => [createVNode(_sfc_main$7, {
251
+ hasStart.value ? (openBlock(), createElementBlock("span", _hoisted_1$3, [renderSlot(_ctx.$slots, "icon", {}, () => [createVNode(_sfc_main$8, {
239
252
  color: iconColor.value,
240
253
  icon: __props.icon,
241
254
  size: "sm"
242
255
  }, null, 8, ["color", "icon"])])])) : createCommentVNode("v-if", true),
243
- createElementVNode("span", _hoisted_2$1, [hasLabel.value ? (openBlock(), createElementBlock("span", _hoisted_3$1, [renderSlot(_ctx.$slots, "label", {}, () => [createTextVNode(toDisplayString(__props.label), 1)])])) : createCommentVNode("v-if", true), hasDescription.value ? (openBlock(), createElementBlock("span", _hoisted_4$1, [renderSlot(_ctx.$slots, "description", {}, () => [createTextVNode(toDisplayString(__props.description), 1)])])) : createCommentVNode("v-if", true)]),
244
- hasEnd.value ? (openBlock(), createElementBlock("span", _hoisted_5$1, [renderSlot(_ctx.$slots, "endContent")])) : createCommentVNode("v-if", true)
256
+ createElementVNode("span", _hoisted_2$2, [hasLabel.value ? (openBlock(), createElementBlock("span", _hoisted_3$2, [renderSlot(_ctx.$slots, "label", {}, () => [createTextVNode(toDisplayString(__props.label), 1)])])) : createCommentVNode("v-if", true), hasDescription.value ? (openBlock(), createElementBlock("span", _hoisted_4$2, [renderSlot(_ctx.$slots, "description", {}, () => [createTextVNode(toDisplayString(__props.description), 1)])])) : createCommentVNode("v-if", true)]),
257
+ hasEnd.value ? (openBlock(), createElementBlock("span", _hoisted_5$2, [renderSlot(_ctx.$slots, "endContent")])) : createCommentVNode("v-if", true)
245
258
  ]),
246
259
  _: 3
247
260
  }, 16, [
@@ -255,9 +268,8 @@ const _sfc_main$2 = /*@__PURE__*/ defineComponent({
255
268
  "to",
256
269
  "rel",
257
270
  "style",
258
- "tabindex",
259
271
  "target"
260
- ])) : (openBlock(), createBlock(_sfc_main$10, mergeProps({ key: 1 }, unref(attrs), {
272
+ ])) : (openBlock(), createBlock(_sfc_main$11, mergeProps({ key: 1 }, unref(attrs), {
261
273
  class: "astryx-dropdown-menu-item",
262
274
  role: "menuitem",
263
275
  "data-menu-size": menuSize.value,
@@ -267,13 +279,14 @@ const _sfc_main$2 = /*@__PURE__*/ defineComponent({
267
279
  "is-disabled": __props.isDisabled,
268
280
  label: __props.label,
269
281
  "on-click": handleClick,
270
- tabindex: __props.isDisabled ? void 0 : -1,
282
+ tabindex: "-1",
271
283
  onAuxclick: handleAuxClick,
284
+ onMousedown: _cache[1] || (_cache[1] = ($event) => __props.isDisabled && unref(keepDisabledRowUnfocused)($event)),
272
285
  onPointermove: handlePointerMove
273
286
  }), createSlots({ _: 2 }, [
274
287
  hasStart.value ? {
275
288
  name: "startContent",
276
- fn: withCtx(() => [renderSlot(_ctx.$slots, "icon", {}, () => [createVNode(_sfc_main$7, {
289
+ fn: withCtx(() => [renderSlot(_ctx.$slots, "icon", {}, () => [createVNode(_sfc_main$8, {
277
290
  color: iconColor.value,
278
291
  icon: __props.icon,
279
292
  size: "sm"
@@ -301,537 +314,1059 @@ const _sfc_main$2 = /*@__PURE__*/ defineComponent({
301
314
  "description",
302
315
  "density",
303
316
  "is-disabled",
304
- "label",
305
- "tabindex"
317
+ "label"
306
318
  ]))], 2112);
307
319
  };
308
320
  }
309
321
  });
310
322
  //#endregion
311
- //#region src/DropdownMenu/renderItems.ts
312
- function endSlot(endContent) {
313
- return endContent == null ? void 0 : { endContent: () => endContent };
323
+ //#region src/DropdownMenu/menuItemRoles.ts
324
+ /**
325
+ * Rows a menu's roving focus, typeahead, and keyboard activation all agree on.
326
+ */
327
+ const MENU_ITEM_ROLES = /* @__PURE__ */ new Set([
328
+ "menuitem",
329
+ "menuitemradio",
330
+ "menuitemcheckbox"
331
+ ]);
332
+ [...MENU_ITEM_ROLES].map((role) => `[role="${role}"]:not([aria-disabled="true"])`).join(",");
333
+ /**
334
+ * Every row, disabled rows included. The arrow keys, Home, End and type-ahead
335
+ * visit a disabled row so a keyboard user finds it; the row stays inert.
336
+ */
337
+ const MENU_ROW_SELECTOR = [...MENU_ITEM_ROLES].map((role) => `[role="${role}"]`).join(",");
338
+ /** Scopes item collection and key handling to one menu level. */
339
+ const MENU_BOUNDARY_SELECTOR = "[role=\"menu\"]";
340
+ /** Keyboard-activate the focused element when it is a menu row. */
341
+ function activateFocusedMenuItem(key) {
342
+ const focused = typeof document !== "undefined" ? document.activeElement : null;
343
+ if (focused instanceof HTMLElement && MENU_ITEM_ROLES.has(focused.getAttribute("role") ?? "")) activateMenuItem(focused, key);
314
344
  }
315
- function renderRadioOption(option, index) {
316
- const { endContent, id, ...itemProps } = option;
317
- return h(_sfc_main$11, {
318
- key: id ?? `radio-${index}`,
319
- ...itemProps
320
- }, endSlot(endContent));
345
+ //#endregion
346
+ //#region src/DropdownMenu/useMenuFocus.ts
347
+ function isDisabled(el) {
348
+ return el.getAttribute("aria-disabled") === "true" || el.hasAttribute("disabled");
321
349
  }
322
- function renderCheckbox(item, index) {
323
- const { checked, endContent, id, onChange, ...itemProps } = item;
324
- return h(_sfc_main$12, {
325
- "key": id ?? `checkbox-${index}`,
326
- ...itemProps,
327
- "modelValue": checked,
328
- "onUpdate:modelValue": (value) => onChange?.(value)
329
- }, endSlot(endContent));
350
+ /** A row inside a drilled-away view stays mounted and must not take focus. */
351
+ function isHiddenRow(el, listEl) {
352
+ let current = el;
353
+ while (current != null && current !== listEl) {
354
+ if (current.hidden || current.getAttribute("aria-hidden") === "true") return true;
355
+ current = current.parentElement;
356
+ }
357
+ return false;
330
358
  }
331
- function renderRadio(item, index) {
332
- return h(_sfc_main$13, {
333
- "key": item.id ?? `radio-group-${index}`,
334
- "label": item.label,
335
- "modelValue": item.value,
336
- "onUpdate:modelValue": (value) => {
337
- if (value != null) item.onChange?.(value);
338
- },
339
- ...item.hasCloseOnSelect == null ? {} : { hasCloseOnSelect: item.hasCloseOnSelect }
340
- }, { default: () => item.items.map((option, optionIndex) => renderRadioOption(option, optionIndex)) });
359
+ /**
360
+ * Roving focus over a menu's rows.
361
+ *
362
+ * Rows are `tabindex="-1"`, so the menu keeps the single tab stop and the arrow
363
+ * keys move DOM focus from row to row; DOM focus is also the only highlight
364
+ * source, so hover and the keyboard can never light two rows at once.
365
+ */
366
+ function useMenuFocus(options) {
367
+ const { list } = options;
368
+ function belongsHere(el, listEl) {
369
+ return el.closest(MENU_BOUNDARY_SELECTOR) === listEl;
370
+ }
371
+ function getItems() {
372
+ const listEl = list.value;
373
+ if (listEl == null) return [];
374
+ return Array.from(listEl.querySelectorAll(MENU_ROW_SELECTOR)).filter((el) => belongsHere(el, listEl) && !isHiddenRow(el, listEl));
375
+ }
376
+ function getCurrentIndex() {
377
+ const active = document.activeElement;
378
+ return getItems().findIndex((el) => el === active || el.contains(active));
379
+ }
380
+ function focusIndex(items, index) {
381
+ items[index]?.focus({ preventScroll: true });
382
+ }
383
+ /** The next enabled row from `start`, wrapping. -1 when there is none. */
384
+ function findEnabledIndex(items, start, step) {
385
+ const count = items.length;
386
+ if (count === 0) return -1;
387
+ let index = start;
388
+ for (let i = 0; i < count; i++) {
389
+ index = (index % count + count) % count;
390
+ const item = items[index];
391
+ if (item != null && !isDisabled(item)) return index;
392
+ index += step;
393
+ }
394
+ return -1;
395
+ }
396
+ function focusItem(index) {
397
+ const items = getItems();
398
+ if (items.length === 0) return;
399
+ focusIndex(items, Math.max(0, Math.min(index, items.length - 1)));
400
+ }
401
+ function focusFirst() {
402
+ const items = getItems();
403
+ const index = findEnabledIndex(items, 0, 1);
404
+ if (index === -1) return false;
405
+ focusIndex(items, index);
406
+ return true;
407
+ }
408
+ function focusLast() {
409
+ const items = getItems();
410
+ const index = findEnabledIndex(items, items.length - 1, -1);
411
+ if (index === -1) return false;
412
+ focusIndex(items, index);
413
+ return true;
414
+ }
415
+ /**
416
+ * PageDown/PageUp: the last/first row fully visible in the surface, and one
417
+ * viewport further when pressed again there. A menu whose rows all fit pages
418
+ * straight to its last/first row. Never wraps.
419
+ */
420
+ function focusPage(direction) {
421
+ const container = list.value;
422
+ const items = getItems();
423
+ if (container == null || items.length === 0) return;
424
+ const currentIndex = getCurrentIndex();
425
+ if (currentIndex === -1 && direction === -1) {
426
+ focusFirst();
427
+ return;
428
+ }
429
+ function visibleIndices() {
430
+ const bounds = container.getBoundingClientRect();
431
+ return items.map((item, index) => ({
432
+ index,
433
+ rect: item.getBoundingClientRect()
434
+ })).filter(({ rect }) => rect.height > 0 && rect.top >= bounds.top - 1 && rect.bottom <= bounds.bottom + 1).map(({ index }) => index);
435
+ }
436
+ function isAhead(index) {
437
+ return currentIndex === -1 || (direction === 1 ? index > currentIndex : index < currentIndex);
438
+ }
439
+ function edgeOf(visible) {
440
+ if (visible.length === 0) return -1;
441
+ return direction === 1 ? visible[visible.length - 1] : visible[0];
442
+ }
443
+ let visible = visibleIndices();
444
+ let target = edgeOf(visible);
445
+ if (target === -1 || !isAhead(target)) {
446
+ container.scrollTop += direction * container.clientHeight;
447
+ visible = visibleIndices();
448
+ target = edgeOf(visible);
449
+ }
450
+ if (target === -1 || !isAhead(target)) {
451
+ const pageSize = Math.max(1, visible.length);
452
+ const from = currentIndex === -1 ? direction === 1 ? -1 : items.length : currentIndex;
453
+ target = Math.max(0, Math.min(items.length - 1, from + direction * pageSize));
454
+ }
455
+ if (target !== -1 && target !== currentIndex) focusIndex(items, target);
456
+ }
457
+ function ownsEvent(event) {
458
+ const listEl = list.value;
459
+ const target = event.target;
460
+ if (listEl == null || !(target instanceof HTMLElement)) return true;
461
+ return belongsHere(target, listEl);
462
+ }
463
+ function handleKeyDown(event) {
464
+ if (event.ctrlKey || event.metaKey || event.altKey) return;
465
+ if (!ownsEvent(event)) return;
466
+ const items = getItems();
467
+ const currentIndex = getCurrentIndex();
468
+ if (event.key === "ArrowDown") {
469
+ if (items.length > 0) focusIndex(items, currentIndex === -1 ? 0 : (currentIndex + 1) % items.length);
470
+ } else if (event.key === "ArrowUp") {
471
+ if (items.length > 0) focusIndex(items, currentIndex === -1 ? items.length - 1 : (currentIndex - 1 + items.length) % items.length);
472
+ } else if (event.key === "Home") focusIndex(items, 0);
473
+ else if (event.key === "End") focusIndex(items, items.length - 1);
474
+ else if (event.key === "PageDown") focusPage(1);
475
+ else if (event.key === "PageUp") focusPage(-1);
476
+ else return;
477
+ event.preventDefault();
478
+ }
479
+ return {
480
+ focusFirst,
481
+ focusItem,
482
+ focusLast,
483
+ getItems,
484
+ handleKeyDown,
485
+ ownsEvent
486
+ };
341
487
  }
342
- function renderItem(item, index) {
343
- const { endContent, id, ...itemProps } = item;
344
- return h(_sfc_main$2, {
345
- key: id ?? `item-${index}`,
346
- ...itemProps
347
- }, endSlot(endContent));
488
+ //#endregion
489
+ //#region src/DropdownMenu/useMenuRegions.ts
490
+ /**
491
+ * Controls Tab can land on inside a header or footer, in DOM order.
492
+ *
493
+ * Hidden, `display: none`, and `aria-hidden` controls are skipped, so a field
494
+ * that the layout has put away is not a stop.
495
+ */
496
+ function tabbablesIn(region) {
497
+ if (region == null) return [];
498
+ return getFocusables(region).filter((element) => {
499
+ if (element.tabIndex < 0) return false;
500
+ let node = element;
501
+ while (node != null && node !== region.parentElement) {
502
+ if (node.hidden || node.getAttribute("aria-hidden") === "true") return false;
503
+ if (typeof window !== "undefined" && window.getComputedStyle(node).display === "none") return false;
504
+ node = node.parentElement;
505
+ }
506
+ return true;
507
+ });
348
508
  }
349
- function renderEntry(entry, index) {
350
- if ("type" in entry && entry.type === "checkbox") return renderCheckbox(entry, index);
351
- if ("type" in entry && entry.type === "radio") return renderRadio(entry, index);
352
- return renderItem(entry, index);
509
+ function focusControl(element) {
510
+ if (element == null) return false;
511
+ element.focus();
512
+ return element.ownerDocument.activeElement === element;
513
+ }
514
+ function radioGroupKey(element) {
515
+ if (!(element instanceof HTMLInputElement) || element.getAttribute("type") !== "radio" || element.name === "") return null;
516
+ return `${element.form?.id ?? ""}\u0000${element.name}`;
353
517
  }
354
518
  /**
355
- * Renders one data-mode entry. A section renders through `DropdownMenuGroup`,
356
- * so both modes produce one `role="group"` named by its visible heading.
519
+ * A named radio group is one Tab stop: the focused radio, else the checked
520
+ * one, else the first radio going forward or the last going backward.
357
521
  */
358
- function renderOption(option, index) {
359
- if ("type" in option && option.type === "divider") return h(_sfc_main$5, { key: `divider-${index}` });
360
- if ("type" in option && option.type === "section") return h(_sfc_main$3, {
361
- key: option.id ?? `section-${index}`,
362
- title: option.title
363
- }, { default: () => option.items.map((item, itemIndex) => renderEntry(item, itemIndex)) });
364
- if ("type" in option && option.type === "checkbox") return renderCheckbox(option, index);
365
- if ("type" in option && option.type === "radio") return renderRadio(option, index);
366
- return renderItem(option, index);
367
- }
368
- /** Data-mode content of a `DropdownMenu`, as a component so the template stays flat. */
369
- const DropdownMenuItems = defineComponent({
370
- name: "AstryxDropdownMenuItems",
371
- inheritAttrs: false,
372
- props: { items: {
373
- type: Array,
374
- required: true
375
- } },
376
- setup(props) {
377
- return () => props.items.map((option, index) => renderOption(option, index));
378
- }
379
- });
380
- //#endregion
381
- //#region src/DropdownMenu/DropdownMenuFrame.vue
382
- const _hoisted_1$1 = [
383
- "id",
384
- "aria-labelledby",
385
- "aria-label",
386
- "data-overflow"
387
- ];
388
- const _hoisted_2 = ["hidden", "inert"];
389
- const _hoisted_3 = [
390
- "id",
391
- "aria-label",
392
- "data-placement"
393
- ];
394
- const _hoisted_4 = [
395
- "id",
396
- "aria-labelledby",
397
- "aria-label",
398
- "data-overflow",
399
- "data-region-focus"
400
- ];
401
- const _hoisted_5 = ["hidden", "inert"];
402
- const _hoisted_6 = [
403
- "id",
404
- "aria-labelledby",
405
- "aria-label",
406
- "data-placement",
407
- "data-overflow"
408
- ];
409
- const _hoisted_7 = ["hidden", "inert"];
410
- const _sfc_main$1 = /*@__PURE__*/ defineComponent({
411
- name: "AstryxDropdownMenuFrame",
412
- __name: "DropdownMenuFrame",
413
- setup(__props) {
414
- const frame = inject(dropdownMenuFrameKey);
415
- if (frame == null) throw new Error("DropdownMenuFrame must render inside DropdownMenu");
416
- const isClient = ref(false);
417
- onMounted(() => {
418
- isClient.value = true;
419
- });
420
- return (_ctx, _cache) => {
421
- return unref(frame).isSheet && isClient.value ? (openBlock(), createBlock(unref(LazyBottomSheet), {
422
- key: 0,
423
- "is-open": unref(frame).sheetOpen,
424
- "onUpdate:isOpen": _cache[3] || (_cache[3] = ($event) => unref(frame).sheetOpen = $event),
425
- height: "hug",
426
- label: unref(frame).sheetLabel,
427
- padding: 2,
428
- onMotionComplete: _cache[4] || (_cache[4] = ($event) => $event === "exiting" && unref(frame).onSheetSettled())
429
- }, {
430
- default: withCtx(() => [createVNode(_sfc_main$9, null, {
431
- default: withCtx(() => [createVNode(_sfc_main$6, { value: unref(frame).menuContext }, {
432
- default: withCtx(() => [
433
- _ctx.$slots.header ? (openBlock(), createElementBlock("div", {
434
- key: 0,
435
- ref: unref(frame).setHeader,
436
- class: "astryx-dropdown-menu-region",
437
- onKeydown: _cache[0] || (_cache[0] = (...args) => unref(frame).regions.onRegionKeydown && unref(frame).regions.onRegionKeydown(...args))
438
- }, [renderSlot(_ctx.$slots, "header")], 544)) : createCommentVNode("v-if", true),
439
- createElementVNode("div", mergeProps({
440
- id: unref(frame).surfaceId,
441
- ref: unref(frame).setSurface
442
- }, unref(frame).menuBindings, {
443
- "aria-labelledby": unref(frame).menuAriaLabelledBy,
444
- "aria-label": unref(frame).menuAriaLabel,
445
- class: ["astryx-dropdown-menu is-sheet", unref(frame).surfaceClass],
446
- "data-overflow": unref(frame).hasOverflow || void 0,
447
- role: "menu",
448
- tabindex: "-1",
449
- onKeydown: _cache[1] || (_cache[1] = (...args) => unref(frame).onSurfaceKeydown && unref(frame).onSurfaceKeydown(...args))
450
- }), [createElementVNode("div", {
451
- class: "astryx-dropdown-menu-tree",
452
- hidden: unref(frame).isDrilled || void 0,
453
- inert: unref(frame).isDrilled || void 0
454
- }, [unref(frame).items != null ? (openBlock(), createBlock(unref(DropdownMenuItems), {
455
- key: 0,
456
- items: unref(frame).items
457
- }, null, 8, ["items"])) : renderSlot(_ctx.$slots, "default", {}, void 0, void 0, 1)], 8, _hoisted_2), createElementVNode("div", {
458
- ref: unref(frame).setHost,
459
- class: "astryx-dropdown-menu-tree"
460
- }, null, 512)], 16, _hoisted_1$1),
461
- _ctx.$slots.footer ? (openBlock(), createElementBlock("div", {
462
- key: 1,
463
- ref: unref(frame).setFooter,
464
- class: "astryx-dropdown-menu-region",
465
- onKeydown: _cache[2] || (_cache[2] = (...args) => unref(frame).regions.onRegionKeydown && unref(frame).regions.onRegionKeydown(...args))
466
- }, [renderSlot(_ctx.$slots, "footer")], 544)) : createCommentVNode("v-if", true)
467
- ]),
468
- _: 3
469
- }, 8, ["value"])]),
470
- _: 3
471
- })]),
472
- _: 3
473
- }, 8, ["is-open", "label"])) : (openBlock(), createBlock(Teleport, {
474
- key: 1,
475
- to: unref(frame).teleportTarget
476
- }, [createVNode(Transition, { name: "astryx-dropdown-menu" }, {
477
- default: withCtx(() => [unref(frame).hasRegions ? withDirectives((openBlock(), createElementBlock("div", {
478
- key: 0,
479
- id: unref(frame).dialogId,
480
- ref: unref(frame).setPopover,
481
- class: "astryx-dropdown-menu-popover",
482
- role: "dialog",
483
- "aria-modal": "true",
484
- "aria-label": unref(frame).dialogLabel,
485
- "data-placement": unref(frame).placement,
486
- style: normalizeStyle(unref(frame).surfaceStyle)
487
- }, [createVNode(_sfc_main$9, null, {
488
- default: withCtx(() => [createVNode(_sfc_main$6, { value: unref(frame).menuContext }, {
489
- default: withCtx(() => [
490
- _ctx.$slots.header ? (openBlock(), createElementBlock("div", {
491
- key: 0,
492
- ref: unref(frame).setHeader,
493
- class: "astryx-dropdown-menu-region",
494
- onKeydown: _cache[5] || (_cache[5] = (...args) => unref(frame).regions.onRegionKeydown && unref(frame).regions.onRegionKeydown(...args))
495
- }, [renderSlot(_ctx.$slots, "header")], 544)) : createCommentVNode("v-if", true),
496
- createElementVNode("div", mergeProps({
497
- id: unref(frame).surfaceId,
498
- ref: unref(frame).setSurface
499
- }, unref(frame).menuBindings, {
500
- "aria-labelledby": unref(frame).menuAriaLabelledBy,
501
- "aria-label": unref(frame).menuAriaLabel,
502
- class: ["astryx-dropdown-menu is-in-frame", unref(frame).surfaceClass],
503
- "data-overflow": unref(frame).hasOverflow || void 0,
504
- "data-region-focus": unref(frame).regionFocus || void 0,
505
- role: "menu",
506
- tabindex: "0",
507
- onFocus: _cache[6] || (_cache[6] = (...args) => unref(frame).onSurfaceFocus && unref(frame).onSurfaceFocus(...args)),
508
- onKeydown: _cache[7] || (_cache[7] = (...args) => unref(frame).onSurfaceKeydown && unref(frame).onSurfaceKeydown(...args))
509
- }), [createElementVNode("div", {
510
- class: "astryx-dropdown-menu-tree",
511
- hidden: unref(frame).isDrilled || void 0,
512
- inert: unref(frame).isDrilled || void 0
513
- }, [unref(frame).items != null ? (openBlock(), createBlock(unref(DropdownMenuItems), {
514
- key: 0,
515
- items: unref(frame).items
516
- }, null, 8, ["items"])) : renderSlot(_ctx.$slots, "default", {}, void 0, void 0, 1)], 8, _hoisted_5), createElementVNode("div", {
517
- ref: unref(frame).setHost,
518
- class: "astryx-dropdown-menu-tree"
519
- }, null, 512)], 16, _hoisted_4),
520
- _ctx.$slots.footer ? (openBlock(), createElementBlock("div", {
521
- key: 1,
522
- ref: unref(frame).setFooter,
523
- class: "astryx-dropdown-menu-region",
524
- onKeydown: _cache[8] || (_cache[8] = (...args) => unref(frame).regions.onRegionKeydown && unref(frame).regions.onRegionKeydown(...args))
525
- }, [renderSlot(_ctx.$slots, "footer")], 544)) : createCommentVNode("v-if", true)
526
- ]),
527
- _: 3
528
- }, 8, ["value"])]),
529
- _: 3
530
- })], 12, _hoisted_3)), [[vShow, unref(frame).isOpen]]) : withDirectives((openBlock(), createElementBlock("div", mergeProps({
531
- key: 1,
532
- id: unref(frame).surfaceId,
533
- ref: unref(frame).setSurface
534
- }, unref(frame).menuBindings, {
535
- "aria-labelledby": unref(frame).menuAriaLabelledBy,
536
- "aria-label": unref(frame).menuAriaLabel,
537
- class: ["astryx-dropdown-menu", unref(frame).surfaceClass],
538
- "data-placement": unref(frame).placement,
539
- "data-overflow": unref(frame).hasOverflow || void 0,
540
- role: "menu",
541
- style: unref(frame).surfaceStyle,
542
- tabindex: "-1",
543
- onFocus: _cache[9] || (_cache[9] = (...args) => unref(frame).onSurfaceFocus && unref(frame).onSurfaceFocus(...args)),
544
- onKeydown: _cache[10] || (_cache[10] = (...args) => unref(frame).onSurfaceKeydown && unref(frame).onSurfaceKeydown(...args))
545
- }), [createVNode(_sfc_main$9, null, {
546
- default: withCtx(() => [createVNode(_sfc_main$6, { value: unref(frame).menuContext }, {
547
- default: withCtx(() => [createElementVNode("div", {
548
- class: "astryx-dropdown-menu-tree",
549
- hidden: unref(frame).isDrilled || void 0,
550
- inert: unref(frame).isDrilled || void 0
551
- }, [unref(frame).items != null ? (openBlock(), createBlock(unref(DropdownMenuItems), {
552
- key: 0,
553
- items: unref(frame).items
554
- }, null, 8, ["items"])) : renderSlot(_ctx.$slots, "default", {}, void 0, void 0, 1)], 8, _hoisted_7), createElementVNode("div", {
555
- ref: unref(frame).setHost,
556
- class: "astryx-dropdown-menu-tree"
557
- }, null, 512)]),
558
- _: 3
559
- }, 8, ["value"])]),
560
- _: 3
561
- })], 16, _hoisted_6)), [[vShow, unref(frame).isOpen]])]),
562
- _: 3
563
- })], 8, ["to"]));
564
- };
522
+ function collapseRadioGroups(elements, active, isBackward) {
523
+ const groups = /* @__PURE__ */ new Map();
524
+ for (const element of elements) {
525
+ const key = radioGroupKey(element);
526
+ if (key == null) continue;
527
+ const members = groups.get(key) ?? [];
528
+ members.push(element);
529
+ groups.set(key, members);
565
530
  }
566
- });
567
- //#endregion
568
- //#region src/DropdownMenu/menuItemRoles.ts
569
- /**
570
- * Rows a menu's roving focus, typeahead, and keyboard activation all agree on.
571
- */
572
- const MENU_ITEM_ROLES = /* @__PURE__ */ new Set([
573
- "menuitem",
574
- "menuitemradio",
575
- "menuitemcheckbox"
576
- ]);
577
- /** Rows the arrow keys may land on: enabled menu items, in DOM order. */
578
- const MENU_ITEM_SELECTOR = [...MENU_ITEM_ROLES].map((role) => `[role="${role}"]:not([aria-disabled="true"])`).join(",");
579
- /** Scopes item collection and key handling to one menu level. */
580
- const MENU_BOUNDARY_SELECTOR = "[role=\"menu\"]";
581
- /** Keyboard-activate the focused element when it is a menu row. */
582
- function activateFocusedMenuItem(key) {
583
- const focused = typeof document !== "undefined" ? document.activeElement : null;
584
- if (focused instanceof HTMLElement && MENU_ITEM_ROLES.has(focused.getAttribute("role") ?? "")) activateMenuItem(focused, key);
585
- }
586
- //#endregion
587
- //#region src/DropdownMenu/useMenuFocus.ts
588
- function isDisabled(el) {
589
- return el.getAttribute("aria-disabled") === "true" || el.hasAttribute("disabled");
590
- }
591
- /** A row inside a drilled-away view stays mounted and must not take focus. */
592
- function isHiddenRow(el, listEl) {
593
- let current = el;
594
- while (current != null && current !== listEl) {
595
- if (current.hidden || current.getAttribute("aria-hidden") === "true") return true;
596
- current = current.parentElement;
531
+ const placed = /* @__PURE__ */ new Set();
532
+ const result = [];
533
+ for (const element of elements) {
534
+ const key = radioGroupKey(element);
535
+ if (key == null) {
536
+ result.push(element);
537
+ continue;
538
+ }
539
+ if (placed.has(key)) continue;
540
+ placed.add(key);
541
+ const members = groups.get(key) ?? [];
542
+ const stop = members.find((radio) => radio === active) ?? members.find((radio) => radio.checked) ?? (isBackward ? members[members.length - 1] : members[0]);
543
+ if (stop != null) result.push(stop);
597
544
  }
598
- return false;
545
+ return result;
599
546
  }
600
547
  /**
601
- * Roving focus over a menu's rows.
548
+ * Keyboard between a menu and the header and footer beside it.
602
549
  *
603
- * Rows are `tabindex="-1"`, so the menu keeps the single tab stop and the arrow
604
- * keys move DOM focus from row to row; DOM focus is also the only highlight
605
- * source, so hover and the keyboard can never light two rows at once.
550
+ * With either region the popover is a dialog: Tab cycles the header, the menu
551
+ * as one stop, and the footer, and wraps at both ends. A row counts as the
552
+ * menu's stop, so Shift+Tab from a row lands on the header.
606
553
  */
607
- function useMenuFocus(options) {
608
- const { list } = options;
609
- function belongsHere(el, listEl) {
610
- return el.closest(MENU_BOUNDARY_SELECTOR) === listEl;
611
- }
612
- function getItems() {
613
- const listEl = list.value;
614
- if (listEl == null) return [];
615
- return Array.from(listEl.querySelectorAll(MENU_ITEM_SELECTOR)).filter((el) => belongsHere(el, listEl) && !isDisabled(el) && !isHiddenRow(el, listEl));
554
+ function useMenuRegions(options) {
555
+ function focusRegion(direction) {
556
+ const tabbables = tabbablesIn(direction === "previous" ? options.header.value : options.footer.value);
557
+ if (!focusControl(direction === "previous" ? tabbables[tabbables.length - 1] : tabbables[0])) {
558
+ options.closeMenu();
559
+ return false;
560
+ }
561
+ return true;
616
562
  }
617
- function getCurrentIndex() {
618
- const active = document.activeElement;
619
- return getItems().findIndex((el) => el === active || el.contains(active));
563
+ function moveDialogTab(event, isFromFlyout = false) {
564
+ const menu = options.menu.value;
565
+ if (menu == null || !options.hasRegions.value) return;
566
+ event.preventDefault();
567
+ event.stopPropagation();
568
+ const active = menu.ownerDocument.activeElement;
569
+ const cycle = collapseRadioGroups([
570
+ ...tabbablesIn(options.header.value),
571
+ menu,
572
+ ...tabbablesIn(options.footer.value)
573
+ ], active, event.shiftKey);
574
+ if (cycle.length <= 1) {
575
+ if (isFromFlyout) menu.focus();
576
+ return;
577
+ }
578
+ const menuIndex = cycle.indexOf(menu);
579
+ let index = active instanceof Node && menu.contains(active) ? menuIndex : cycle.findIndex((element) => element === active || element.contains(active));
580
+ if (index < 0) index = menuIndex;
581
+ const step = event.shiftKey ? -1 : 1;
582
+ const next = cycle[(index + step + cycle.length) % cycle.length];
583
+ if (!focusControl(next)) menu.focus();
620
584
  }
621
- function focusIndex(items, index) {
622
- items[index]?.focus({ preventScroll: true });
585
+ function onRegionKeydown(event) {
586
+ if (event.key === "Tab") moveDialogTab(event);
623
587
  }
624
- /** The next enabled row from `start`, wrapping. -1 when there is none. */
625
- function findEnabledIndex(items, start, step) {
626
- const count = items.length;
627
- if (count === 0) return -1;
628
- let index = start;
629
- for (let i = 0; i < count; i++) {
630
- index = (index % count + count) % count;
631
- const item = items[index];
632
- if (item != null && !isDisabled(item)) return index;
633
- index += step;
588
+ return {
589
+ focusRegion,
590
+ moveDialogTab,
591
+ onRegionKeydown
592
+ };
593
+ }
594
+ //#endregion
595
+ //#region src/DropdownMenu/DropdownMenuSubMenu.vue
596
+ const _hoisted_1$2 = {
597
+ key: 0,
598
+ class: "astryx-dropdown-menu-spinner",
599
+ "aria-hidden": "true"
600
+ };
601
+ const _hoisted_2$1 = [
602
+ "role",
603
+ "aria-label",
604
+ "aria-labelledby",
605
+ "aria-modal",
606
+ "hidden"
607
+ ];
608
+ const _hoisted_3$1 = ["aria-label", "aria-labelledby"];
609
+ const _hoisted_4$1 = [
610
+ "role",
611
+ "aria-label",
612
+ "aria-labelledby",
613
+ "aria-modal",
614
+ "data-overflow"
615
+ ];
616
+ const _hoisted_5$1 = ["aria-label", "aria-labelledby"];
617
+ const _sfc_main$2 = /*@__PURE__*/ defineComponent({
618
+ name: "AstryxDropdownMenuSubMenu",
619
+ inheritAttrs: false,
620
+ __name: "DropdownMenuSubMenu",
621
+ props: {
622
+ label: {},
623
+ icon: {},
624
+ description: {},
625
+ isDisabled: {
626
+ type: Boolean,
627
+ default: false
628
+ },
629
+ hasSpinner: {
630
+ type: Boolean,
631
+ default: false
632
+ },
633
+ menuWidth: {},
634
+ presentation: { default: "adaptive" },
635
+ delay: { default: 150 },
636
+ hideDelay: { default: 200 }
637
+ },
638
+ emits: ["openChange"],
639
+ setup(__props, { emit: __emit }) {
640
+ const props = __props;
641
+ const emit = __emit;
642
+ const slots = useSlots();
643
+ const messages = useDropdownMenuMessages();
644
+ const spinnerText = useComponentMessages({ spinner: spinnerMessages });
645
+ const menu = useDropdownMenuContext();
646
+ const rowComponent = ref(null);
647
+ const rowRef = computed(() => rowComponent.value?.element ?? null);
648
+ const flyoutRef = ref(null);
649
+ const drillRef = ref(null);
650
+ const flyoutOpen = ref(false);
651
+ const viewId = useId();
652
+ const menuSize = computed(() => menu?.menuSize.value ?? "md");
653
+ const density = computed(() => menuSize.value === "sm" ? "compact" : "balanced");
654
+ const hasStart = computed(() => slots.icon != null || props.icon != null);
655
+ const hasRegions = computed(() => slots.header != null || slots.footer != null);
656
+ const headerRef = ref(null);
657
+ const footerRef = ref(null);
658
+ const regionMenuRef = ref(null);
659
+ function setHeader(el) {
660
+ headerRef.value = el ?? null;
661
+ }
662
+ function setFooter(el) {
663
+ footerRef.value = el ?? null;
664
+ }
665
+ function setRegionMenu(el) {
666
+ regionMenuRef.value = el ?? null;
667
+ }
668
+ const stringLabel = computed(() => typeof props.label === "string" && props.label !== "" ? props.label : void 0);
669
+ const hasNodeLabel = computed(() => stringLabel.value == null && slots.label != null);
670
+ const nodeLabelId = `astryx-dropdown-submenu-label-${useId()}`;
671
+ const nodeLabelText = ref();
672
+ const viewLabelledBy = computed(() => hasNodeLabel.value ? nodeLabelId : void 0);
673
+ function readNodeLabelText() {
674
+ const element = document.getElementById(nodeLabelId);
675
+ if (element == null) return void 0;
676
+ const copy = element.cloneNode(true);
677
+ for (const hidden of copy.querySelectorAll("[aria-hidden=\"true\"]")) hidden.remove();
678
+ return copy.textContent?.replace(/\s+/g, " ").trim() || void 0;
679
+ }
680
+ const focus = useMenuFocus({ list: flyoutRef });
681
+ const drillFocus = useMenuFocus({ list: drillRef });
682
+ const hasOverflow = useOverflow(flyoutRef, flyoutOpen);
683
+ const regions = useMenuRegions({
684
+ header: headerRef,
685
+ footer: footerRef,
686
+ menu: computed(() => hasRegions.value ? regionMenuRef.value : flyoutRef.value),
687
+ hasRegions,
688
+ closeMenu: () => closeFlyout(true)
689
+ });
690
+ const mode = useSubmenuMode({
691
+ drillIn: computed(() => menu?.drillIn.value),
692
+ presentation: computed(() => props.presentation),
693
+ viewId
694
+ });
695
+ const isDrill = mode.isDrill;
696
+ const drillOnStack = mode.isOnStack;
697
+ const drillIsTop = mode.isTop;
698
+ const isShown = computed(() => isDrill.value ? drillOnStack.value : flyoutOpen.value);
699
+ watch(isShown, (shown) => {
700
+ if (shown && hasNodeLabel.value) nodeLabelText.value = readNodeLabelText();
701
+ });
702
+ const backLabel = computed(() => {
703
+ const parent = menu?.menuLabel.value;
704
+ return parent != null && parent !== "" ? messages.value.dropdownMenu.backTo(parent) : messages.value.dropdownMenu.back;
705
+ });
706
+ const { position, teleportTarget } = usePositionedLayer({
707
+ anchor: rowRef,
708
+ layer: flyoutRef,
709
+ isOpen: flyoutOpen,
710
+ placement: computed(() => "end"),
711
+ alignment: computed(() => "start"),
712
+ gap: 4
713
+ });
714
+ const flyoutStyle = computed(() => {
715
+ const style = {
716
+ top: `${position.value.top}px`,
717
+ left: `${position.value.left}px`,
718
+ zIndex: 1001
719
+ };
720
+ if (props.menuWidth == null) return style;
721
+ const width = (typeof props.menuWidth === "number" ? `${props.menuWidth}px` : props.menuWidth).trim();
722
+ if (isIntrinsicInlineSize(width)) style.width = width;
723
+ else style.minWidth = clampInlineSize(width);
724
+ return style;
725
+ });
726
+ useBusyAnnouncement(() => props.hasSpinner && (menu?.isOpen.value ?? true), () => spinnerText.value.spinner.loading, rowRef);
727
+ const drillHost = computed(() => isDrill.value ? menu?.drillIn.value.host ?? null : null);
728
+ async function focusDrillFirst() {
729
+ await nextTick();
730
+ const target = drillFocus.getItems().findIndex((row, index) => index > 0 && row.getAttribute("aria-disabled") !== "true");
731
+ if (target !== -1) drillFocus.focusItem(target);
732
+ else if (!drillFocus.focusFirst()) drillRef.value?.focus({ preventScroll: true });
634
733
  }
635
- return -1;
636
- }
637
- function focusItem(index) {
638
- const items = getItems();
639
- if (items.length === 0) return;
640
- focusIndex(items, Math.max(0, Math.min(index, items.length - 1)));
641
- }
642
- function focusFirst() {
643
- const items = getItems();
644
- const index = findEnabledIndex(items, 0, 1);
645
- if (index === -1) return false;
646
- focusIndex(items, index);
647
- return true;
648
- }
649
- function focusLast() {
650
- const items = getItems();
651
- const index = findEnabledIndex(items, items.length - 1, -1);
652
- if (index === -1) return false;
653
- focusIndex(items, index);
654
- return true;
655
- }
656
- /**
657
- * PageDown/PageUp: the last/first row fully visible in the surface, and one
658
- * viewport further when pressed again there. A menu whose rows all fit pages
659
- * straight to its last/first row. Never wraps.
660
- */
661
- function focusPage(direction) {
662
- const container = list.value;
663
- const items = getItems();
664
- if (container == null || items.length === 0) return;
665
- const currentIndex = getCurrentIndex();
666
- if (currentIndex === -1 && direction === -1) {
667
- focusFirst();
668
- return;
734
+ async function openFlyout(options) {
735
+ if (props.isDisabled || menu?.isOpen.value === false) return;
736
+ const skipAutoFocus = options?.skipAutoFocus === true;
737
+ if (isDrill.value) {
738
+ const wasOpen = drillOnStack.value;
739
+ mode.openDrill();
740
+ if (!wasOpen) emit("openChange", true);
741
+ if (!skipAutoFocus) await focusDrillFirst();
742
+ return;
743
+ }
744
+ if (!flyoutOpen.value) emit("openChange", true);
745
+ flyoutOpen.value = true;
746
+ if (skipAutoFocus) return;
747
+ await nextTick();
748
+ focus.focusFirst();
669
749
  }
670
- function visibleIndices() {
671
- const bounds = container.getBoundingClientRect();
672
- return items.map((item, index) => ({
673
- index,
674
- rect: item.getBoundingClientRect()
675
- })).filter(({ rect }) => rect.height > 0 && rect.top >= bounds.top - 1 && rect.bottom <= bounds.bottom + 1).map(({ index }) => index);
750
+ /**
751
+ * 焦点回到触发行。行的 `focus()` 只会找里面的链接或按钮,子菜单这一行两者都没有,
752
+ * 所以直接聚焦行元素本身。
753
+ */
754
+ function focusRowElement() {
755
+ rowRef.value?.focus();
756
+ nextTick(() => rowRef.value?.focus());
676
757
  }
677
- function isAhead(index) {
678
- return currentIndex === -1 || (direction === 1 ? index > currentIndex : index < currentIndex);
758
+ function closeFlyout(focusRow = true) {
759
+ if (isDrill.value) {
760
+ if (!mode.closeDrill()) return;
761
+ emit("openChange", false);
762
+ if (focusRow) focusRowElement();
763
+ return;
764
+ }
765
+ if (flyoutOpen.value) {
766
+ flyoutOpen.value = false;
767
+ emit("openChange", false);
768
+ }
769
+ if (focusRow) focusRowElement();
679
770
  }
680
- function edgeOf(visible) {
681
- if (visible.length === 0) return -1;
682
- return direction === 1 ? visible[visible.length - 1] : visible[0];
771
+ /** 关掉这一层,再让上面各层一路关到根菜单。 */
772
+ function closeWholeMenu() {
773
+ closeFlyout(false);
774
+ menu?.closeMenu();
683
775
  }
684
- let visible = visibleIndices();
685
- let target = edgeOf(visible);
686
- if (target === -1 || !isAhead(target)) {
687
- container.scrollTop += direction * container.clientHeight;
688
- visible = visibleIndices();
689
- target = edgeOf(visible);
776
+ /** 抽屉视图和飞出层共用的按键:Tab、返回、激活,其余交给这一层自己的行焦点。 */
777
+ function handleLevelKeydown(event, rows) {
778
+ if (event.key === "Tab" && hasRegions.value) {
779
+ regions.moveDialogTab(event);
780
+ return;
781
+ }
782
+ if (event.key === "Tab" && menu?.hasRegions.value) {
783
+ event.preventDefault();
784
+ event.stopPropagation();
785
+ closeFlyout(false);
786
+ menu.moveDialogTab(event, true);
787
+ return;
788
+ }
789
+ if (event.key === "Tab") {
790
+ event.stopPropagation();
791
+ closeWholeMenu();
792
+ return;
793
+ }
794
+ if (event.key === "ArrowLeft" || event.key === "Escape") {
795
+ event.preventDefault();
796
+ event.stopPropagation();
797
+ closeFlyout(true);
798
+ return;
799
+ }
800
+ if (event.key === "Enter" || event.key === " ") {
801
+ event.preventDefault();
802
+ event.stopPropagation();
803
+ if (event.repeat) return;
804
+ activateFocusedMenuItem(event);
805
+ return;
806
+ }
807
+ event.stopPropagation();
808
+ rows.handleKeyDown(event);
690
809
  }
691
- if (target === -1 || !isAhead(target)) {
692
- const pageSize = Math.max(1, visible.length);
693
- const from = currentIndex === -1 ? direction === 1 ? -1 : items.length : currentIndex;
694
- target = Math.max(0, Math.min(items.length - 1, from + direction * pageSize));
810
+ const onDrillKeydown = (event) => handleLevelKeydown(event, drillFocus);
811
+ const onFlyoutKeydown = (event) => handleLevelKeydown(event, focus);
812
+ const emptyDrill = {
813
+ host: null,
814
+ isCompactTouch: false,
815
+ pop: () => {},
816
+ push: () => {},
817
+ viewStack: []
818
+ };
819
+ const nestedContext = {
820
+ closeMenu: closeWholeMenu,
821
+ drillIn: computed(() => menu?.drillIn.value ?? emptyDrill),
822
+ focusRegion: (direction) => menu?.focusRegion(direction) ?? false,
823
+ moveDialogTab: (event, fromFlyout) => menu?.moveDialogTab(event, fromFlyout),
824
+ hasRegions: computed(() => menu?.hasRegions.value ?? false),
825
+ isOpen: computed(() => (menu?.isOpen.value ?? true) && isShown.value),
826
+ menuLabel: computed(() => stringLabel.value ?? (hasNodeLabel.value ? nodeLabelText.value : void 0) ?? menu?.menuLabel.value),
827
+ menuSize
828
+ };
829
+ const hover = useMenuHover({
830
+ show: (options) => void openFlyout(options),
831
+ hide: () => {
832
+ if (hasRegions.value && flyoutRef.value?.contains(document.activeElement)) return;
833
+ closeFlyout(false);
834
+ },
835
+ isOpen: flyoutOpen,
836
+ isEnabled: () => !props.isDisabled && !isDrill.value,
837
+ showDelay: () => props.delay,
838
+ hideDelay: () => props.hideDelay,
839
+ flyoutRef,
840
+ ownsFocus: false
841
+ });
842
+ watch(rowRef, (element) => {
843
+ hover.setTriggerEl(element);
844
+ }, { immediate: true });
845
+ function onRowClick(event) {
846
+ if (isDrill.value) {
847
+ openFlyout({ skipAutoFocus: event.detail > 0 || isMenuPressActivation() });
848
+ return;
849
+ }
850
+ hover.triggerProps.onClick(event);
695
851
  }
696
- if (target !== -1 && target !== currentIndex) focusIndex(items, target);
697
- }
698
- function ownsEvent(event) {
699
- const listEl = list.value;
700
- const target = event.target;
701
- if (listEl == null || !(target instanceof HTMLElement)) return true;
702
- return belongsHere(target, listEl);
703
- }
704
- function handleKeyDown(event) {
705
- if (event.ctrlKey || event.metaKey || event.altKey) return;
706
- if (!ownsEvent(event)) return;
707
- const items = getItems();
708
- const currentIndex = getCurrentIndex();
709
- if (event.key === "ArrowDown") {
710
- const next = findEnabledIndex(items, currentIndex === -1 ? 0 : currentIndex + 1, 1);
711
- if (next !== -1) focusIndex(items, next);
712
- } else if (event.key === "ArrowUp") {
713
- const prev = findEnabledIndex(items, currentIndex === -1 ? items.length - 1 : currentIndex - 1, -1);
714
- if (prev !== -1) focusIndex(items, prev);
715
- } else if (event.key === "Home") focusFirst();
716
- else if (event.key === "End") focusLast();
717
- else if (event.key === "PageDown") focusPage(1);
718
- else if (event.key === "PageUp") focusPage(-1);
719
- else return;
720
- event.preventDefault();
852
+ /**
853
+ * 关闭时焦点还留在面板里(Escape、外部关闭都会这样),就交还给触发行:
854
+ * 否则焦点会落进一个已经隐藏的容器。
855
+ */
856
+ watch(flyoutOpen, (open, wasOpen) => {
857
+ if (open || !wasOpen) return;
858
+ if (isDrill.value) return;
859
+ const active = document.activeElement;
860
+ if (active instanceof Node && flyoutRef.value?.contains(active)) focusRowElement();
861
+ }, { flush: "pre" });
862
+ useDismiss({
863
+ container: flyoutRef,
864
+ trigger: rowRef,
865
+ isEnabled: computed(() => flyoutOpen.value && !isDrill.value),
866
+ onDismiss: () => closeFlyout(false),
867
+ onEscape: () => closeFlyout(true)
868
+ });
869
+ useDismiss({
870
+ container: drillRef,
871
+ isEnabled: drillIsTop,
872
+ onDismiss: () => {
873
+ if (drillIsTop.value) closeFlyout(true);
874
+ }
875
+ });
876
+ watch(() => menu?.isOpen.value, (open) => {
877
+ if (open) return;
878
+ hover.cancelPending();
879
+ if (!isDrill.value) closeFlyout(false);
880
+ });
881
+ watch(drillOnStack, (onStack, wasOnStack) => {
882
+ if (wasOnStack === true && !onStack && menu?.isOpen.value) focusRowElement();
883
+ });
884
+ return (_ctx, _cache) => {
885
+ return openBlock(), createElementBlock(Fragment, null, [createVNode(_sfc_main$11, mergeProps(_ctx.$attrs, {
886
+ ref_key: "rowComponent",
887
+ ref: rowComponent,
888
+ class: "astryx-dropdown-menu-item",
889
+ role: "menuitem",
890
+ "aria-haspopup": hasRegions.value ? "dialog" : "menu",
891
+ "aria-expanded": isShown.value,
892
+ "data-menu-size": menuSize.value,
893
+ "data-variant": "default",
894
+ density: density.value,
895
+ description: __props.description,
896
+ "is-disabled": __props.isDisabled,
897
+ label: __props.label,
898
+ tabindex: __props.isDisabled ? void 0 : -1,
899
+ "on-click": onRowClick,
900
+ onKeydown: [
901
+ _cache[0] || (_cache[0] = withKeys(withModifiers(($event) => openFlyout(), ["prevent", "stop"]), ["right"])),
902
+ _cache[1] || (_cache[1] = withKeys(withModifiers(($event) => openFlyout(), ["prevent", "stop"]), ["enter"])),
903
+ _cache[2] || (_cache[2] = withKeys(withModifiers(($event) => openFlyout(), ["prevent", "stop"]), ["space"]))
904
+ ],
905
+ onMouseenter: unref(hover).triggerProps.onMouseenter,
906
+ onMouseleave: unref(hover).triggerProps.onMouseleave
907
+ }), createSlots({
908
+ endContent: withCtx(() => [__props.hasSpinner ? (openBlock(), createElementBlock("span", _hoisted_1$2, [createVNode(_sfc_main$16, { size: "sm" })])) : (openBlock(), createBlock(_sfc_main$8, {
909
+ key: 1,
910
+ color: "secondary",
911
+ icon: "chevronRight",
912
+ size: "sm"
913
+ }))]),
914
+ _: 2
915
+ }, [
916
+ hasStart.value ? {
917
+ name: "startContent",
918
+ fn: withCtx(() => [renderSlot(_ctx.$slots, "icon", {}, () => [createVNode(_sfc_main$8, {
919
+ color: "secondary",
920
+ icon: __props.icon,
921
+ size: "sm"
922
+ }, null, 8, ["icon"])])]),
923
+ key: "0"
924
+ } : void 0,
925
+ unref(slots).label ? {
926
+ name: "label",
927
+ fn: withCtx(() => [hasNodeLabel.value ? (openBlock(), createElementBlock("span", {
928
+ key: 0,
929
+ id: nodeLabelId
930
+ }, [renderSlot(_ctx.$slots, "label")])) : renderSlot(_ctx.$slots, "label", {}, void 0, void 0, 1)]),
931
+ key: "1"
932
+ } : void 0,
933
+ unref(slots).description ? {
934
+ name: "description",
935
+ fn: withCtx(() => [renderSlot(_ctx.$slots, "description")]),
936
+ key: "2"
937
+ } : void 0
938
+ ]), 1040, [
939
+ "aria-haspopup",
940
+ "aria-expanded",
941
+ "data-menu-size",
942
+ "density",
943
+ "description",
944
+ "is-disabled",
945
+ "label",
946
+ "tabindex",
947
+ "onMouseenter",
948
+ "onMouseleave"
949
+ ]), drillHost.value ? (openBlock(), createBlock(Teleport, {
950
+ key: 0,
951
+ to: drillHost.value
952
+ }, [createCommentVNode(" eslint-disable-next-line vue-a11y/no-static-element-interactions -- 键盘事件在面板根上接住再分发给头部、菜单和尾部,交互元素仍是里面的行和控件。 "), withDirectives(createElementVNode("div", {
953
+ ref_key: "drillRef",
954
+ ref: drillRef,
955
+ class: normalizeClass(["astryx-dropdown-menu-drill", { "is-frame": hasRegions.value }]),
956
+ role: hasRegions.value ? "dialog" : "menu",
957
+ "aria-label": stringLabel.value,
958
+ "aria-labelledby": viewLabelledBy.value,
959
+ "aria-modal": hasRegions.value ? "true" : void 0,
960
+ hidden: unref(drillIsTop) ? void 0 : true,
961
+ tabindex: "-1",
962
+ onKeydown: onDrillKeydown
963
+ }, [createVNode(_sfc_main$10, null, {
964
+ default: withCtx(() => [createVNode(_sfc_main$7, { value: nestedContext }, {
965
+ default: withCtx(() => [hasRegions.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
966
+ createElementVNode("div", {
967
+ ref: setHeader,
968
+ class: "astryx-dropdown-menu-region",
969
+ onKeydown: _cache[3] || (_cache[3] = (...args) => unref(regions).onRegionKeydown && unref(regions).onRegionKeydown(...args))
970
+ }, [renderSlot(_ctx.$slots, "header")], 544),
971
+ createElementVNode("div", {
972
+ ref: setRegionMenu,
973
+ class: "astryx-dropdown-menu-region-menu",
974
+ "aria-label": stringLabel.value,
975
+ "aria-labelledby": viewLabelledBy.value,
976
+ role: "menu",
977
+ tabindex: "-1"
978
+ }, [createVNode(_sfc_main$3, {
979
+ "has-close-on-select": false,
980
+ label: backLabel.value,
981
+ onClick: _cache[4] || (_cache[4] = ($event) => closeFlyout(true))
982
+ }, {
983
+ icon: withCtx(() => [createVNode(_sfc_main$8, {
984
+ color: "secondary",
985
+ icon: "chevronLeft",
986
+ size: "sm"
987
+ })]),
988
+ _: 1
989
+ }, 8, ["label"]), renderSlot(_ctx.$slots, "default")], 8, _hoisted_3$1),
990
+ createElementVNode("div", {
991
+ ref: setFooter,
992
+ class: "astryx-dropdown-menu-region",
993
+ onKeydown: _cache[5] || (_cache[5] = (...args) => unref(regions).onRegionKeydown && unref(regions).onRegionKeydown(...args))
994
+ }, [renderSlot(_ctx.$slots, "footer")], 544)
995
+ ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createVNode(_sfc_main$3, {
996
+ "has-close-on-select": false,
997
+ label: backLabel.value,
998
+ onClick: _cache[6] || (_cache[6] = ($event) => closeFlyout(true))
999
+ }, {
1000
+ icon: withCtx(() => [createVNode(_sfc_main$8, {
1001
+ color: "secondary",
1002
+ icon: "chevronLeft",
1003
+ size: "sm"
1004
+ })]),
1005
+ _: 1
1006
+ }, 8, ["label"]), renderSlot(_ctx.$slots, "default")], 64))]),
1007
+ _: 3
1008
+ })]),
1009
+ _: 3
1010
+ })], 42, _hoisted_2$1), [[vShow, unref(drillOnStack)]])], 8, ["to"])) : (openBlock(), createBlock(Teleport, {
1011
+ key: 1,
1012
+ to: unref(teleportTarget)
1013
+ }, [createCommentVNode(" eslint-disable-next-line vue-a11y/no-static-element-interactions -- 键盘事件在面板根上接住再分发给头部、菜单和尾部,交互元素仍是里面的行和控件。 "), withDirectives(createElementVNode("div", {
1014
+ ref_key: "flyoutRef",
1015
+ ref: flyoutRef,
1016
+ class: normalizeClass(["astryx-dropdown-menu astryx-dropdown-submenu", { "is-frame": hasRegions.value }]),
1017
+ role: hasRegions.value ? "dialog" : "menu",
1018
+ "aria-label": stringLabel.value,
1019
+ "aria-labelledby": viewLabelledBy.value,
1020
+ "aria-modal": hasRegions.value ? "true" : void 0,
1021
+ "data-overflow": unref(hasOverflow) || void 0,
1022
+ style: normalizeStyle(flyoutStyle.value),
1023
+ tabindex: "-1",
1024
+ onKeydown: onFlyoutKeydown,
1025
+ onMouseenter: _cache[9] || (_cache[9] = (...args) => unref(hover).contentProps.onMouseenter && unref(hover).contentProps.onMouseenter(...args)),
1026
+ onMouseleave: _cache[10] || (_cache[10] = (...args) => unref(hover).contentProps.onMouseleave && unref(hover).contentProps.onMouseleave(...args))
1027
+ }, [createVNode(_sfc_main$10, null, {
1028
+ default: withCtx(() => [createVNode(_sfc_main$7, { value: nestedContext }, {
1029
+ default: withCtx(() => [hasRegions.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1030
+ createElementVNode("div", {
1031
+ ref: setHeader,
1032
+ class: "astryx-dropdown-menu-region",
1033
+ onKeydown: _cache[7] || (_cache[7] = (...args) => unref(regions).onRegionKeydown && unref(regions).onRegionKeydown(...args))
1034
+ }, [renderSlot(_ctx.$slots, "header")], 544),
1035
+ createElementVNode("div", {
1036
+ ref: setRegionMenu,
1037
+ class: "astryx-dropdown-menu-region-menu",
1038
+ "aria-label": stringLabel.value,
1039
+ "aria-labelledby": viewLabelledBy.value,
1040
+ role: "menu",
1041
+ tabindex: "-1"
1042
+ }, [renderSlot(_ctx.$slots, "default")], 8, _hoisted_5$1),
1043
+ createElementVNode("div", {
1044
+ ref: setFooter,
1045
+ class: "astryx-dropdown-menu-region",
1046
+ onKeydown: _cache[8] || (_cache[8] = (...args) => unref(regions).onRegionKeydown && unref(regions).onRegionKeydown(...args))
1047
+ }, [renderSlot(_ctx.$slots, "footer")], 544)
1048
+ ], 64)) : renderSlot(_ctx.$slots, "default", {}, void 0, void 0, 1)]),
1049
+ _: 3
1050
+ })]),
1051
+ _: 3
1052
+ })], 46, _hoisted_4$1), [[vShow, flyoutOpen.value]])], 8, ["to"]))], 64);
1053
+ };
721
1054
  }
722
- return {
723
- focusFirst,
724
- focusItem,
725
- focusLast,
726
- getItems,
727
- handleKeyDown,
728
- ownsEvent
729
- };
730
- }
1055
+ });
731
1056
  //#endregion
732
- //#region src/DropdownMenu/useMenuRegions.ts
733
- /**
734
- * Controls Tab can land on inside a header or footer, in DOM order.
735
- *
736
- * Hidden, `display: none`, and `aria-hidden` controls are skipped, so a field
737
- * that the layout has put away is not a stop.
738
- */
739
- function tabbablesIn(region) {
740
- if (region == null) return [];
741
- return getFocusables(region).filter((element) => {
742
- if (element.tabIndex < 0) return false;
743
- let node = element;
744
- while (node != null && node !== region.parentElement) {
745
- if (node.hidden || node.getAttribute("aria-hidden") === "true") return false;
746
- if (typeof window !== "undefined" && window.getComputedStyle(node).display === "none") return false;
747
- node = node.parentElement;
748
- }
749
- return true;
750
- });
1057
+ //#region src/DropdownMenu/renderItems.ts
1058
+ function endSlot(endContent) {
1059
+ return endContent == null ? void 0 : { endContent: () => endContent };
751
1060
  }
752
- function focusControl(element) {
753
- if (element == null) return false;
754
- element.focus();
755
- return element.ownerDocument.activeElement === element;
1061
+ function renderRadioOption(option, index) {
1062
+ const { endContent, id, ...itemProps } = option;
1063
+ return h(_sfc_main$12, {
1064
+ key: id ?? `radio-${index}`,
1065
+ ...itemProps
1066
+ }, endSlot(endContent));
756
1067
  }
757
- function radioGroupKey(element) {
758
- if (!(element instanceof HTMLInputElement) || element.getAttribute("type") !== "radio" || element.name === "") return null;
759
- return `${element.form?.id ?? ""}\u0000${element.name}`;
1068
+ function renderCheckbox(item, index) {
1069
+ const { checked, endContent, id, onChange, ...itemProps } = item;
1070
+ return h(_sfc_main$13, {
1071
+ "key": id ?? `checkbox-${index}`,
1072
+ ...itemProps,
1073
+ "modelValue": checked,
1074
+ "onUpdate:modelValue": (value) => onChange?.(value)
1075
+ }, endSlot(endContent));
1076
+ }
1077
+ function renderRadio(item, index) {
1078
+ return h(_sfc_main$14, {
1079
+ "key": item.id ?? `radio-group-${index}`,
1080
+ "label": item.label,
1081
+ "modelValue": item.value,
1082
+ "onUpdate:modelValue": (value) => {
1083
+ if (value != null) item.onChange?.(value);
1084
+ },
1085
+ ...item.hasCloseOnSelect == null ? {} : { hasCloseOnSelect: item.hasCloseOnSelect }
1086
+ }, { default: () => item.items.map((option, optionIndex) => renderRadioOption(option, optionIndex)) });
1087
+ }
1088
+ function renderItem(item, index) {
1089
+ const { endContent, id, items: nested, ...itemProps } = item;
1090
+ if (nested != null && nested.length > 0) return h(_sfc_main$2, {
1091
+ key: id ?? `submenu-${index}`,
1092
+ description: item.description,
1093
+ icon: item.icon,
1094
+ isDisabled: item.isDisabled,
1095
+ label: item.label
1096
+ }, { default: () => nested.map((option, optionIndex) => renderOption(option, optionIndex)) });
1097
+ return h(_sfc_main$3, {
1098
+ key: id ?? `item-${index}`,
1099
+ ...itemProps
1100
+ }, endSlot(endContent));
1101
+ }
1102
+ function renderEntry(entry, index) {
1103
+ if ("type" in entry && entry.type === "checkbox") return renderCheckbox(entry, index);
1104
+ if ("type" in entry && entry.type === "radio") return renderRadio(entry, index);
1105
+ return renderItem(entry, index);
760
1106
  }
761
1107
  /**
762
- * A named radio group is one Tab stop: the focused radio, else the checked
763
- * one, else the first radio going forward or the last going backward.
1108
+ * Renders one data-mode entry. A section renders through `DropdownMenuGroup`,
1109
+ * so both modes produce one `role="group"` named by its visible heading.
764
1110
  */
765
- function collapseRadioGroups(elements, active, isBackward) {
766
- const groups = /* @__PURE__ */ new Map();
767
- for (const element of elements) {
768
- const key = radioGroupKey(element);
769
- if (key == null) continue;
770
- const members = groups.get(key) ?? [];
771
- members.push(element);
772
- groups.set(key, members);
1111
+ function renderOption(option, index) {
1112
+ if ("type" in option && option.type === "divider") return h(_sfc_main$6, { key: `divider-${index}` });
1113
+ if ("type" in option && option.type === "section") return h(_sfc_main$4, {
1114
+ key: option.id ?? `section-${index}`,
1115
+ title: option.title
1116
+ }, { default: () => option.items.map((item, itemIndex) => renderEntry(item, itemIndex)) });
1117
+ if ("type" in option && option.type === "checkbox") return renderCheckbox(option, index);
1118
+ if ("type" in option && option.type === "radio") return renderRadio(option, index);
1119
+ return renderItem(option, index);
1120
+ }
1121
+ /** Data-mode content of a `DropdownMenu`, as a component so the template stays flat. */
1122
+ const DropdownMenuItems = defineComponent({
1123
+ name: "AstryxDropdownMenuItems",
1124
+ inheritAttrs: false,
1125
+ props: { items: {
1126
+ type: Array,
1127
+ required: true
1128
+ } },
1129
+ setup(props) {
1130
+ return () => props.items.map((option, index) => renderOption(option, index));
773
1131
  }
774
- const placed = /* @__PURE__ */ new Set();
775
- const result = [];
776
- for (const element of elements) {
777
- const key = radioGroupKey(element);
778
- if (key == null) {
779
- result.push(element);
780
- continue;
781
- }
782
- if (placed.has(key)) continue;
783
- placed.add(key);
784
- const members = groups.get(key) ?? [];
785
- const stop = members.find((radio) => radio === active) ?? members.find((radio) => radio.checked) ?? (isBackward ? members[members.length - 1] : members[0]);
786
- if (stop != null) result.push(stop);
1132
+ });
1133
+ //#endregion
1134
+ //#region src/DropdownMenu/DropdownMenuFrame.vue
1135
+ const _hoisted_1$1 = [
1136
+ "id",
1137
+ "aria-labelledby",
1138
+ "aria-label",
1139
+ "data-overflow"
1140
+ ];
1141
+ const _hoisted_2 = ["hidden", "inert"];
1142
+ const _hoisted_3 = [
1143
+ "id",
1144
+ "aria-label",
1145
+ "data-placement"
1146
+ ];
1147
+ const _hoisted_4 = [
1148
+ "id",
1149
+ "aria-labelledby",
1150
+ "aria-label",
1151
+ "data-overflow",
1152
+ "data-region-focus"
1153
+ ];
1154
+ const _hoisted_5 = ["hidden", "inert"];
1155
+ const _hoisted_6 = [
1156
+ "id",
1157
+ "aria-labelledby",
1158
+ "aria-label",
1159
+ "data-placement",
1160
+ "data-overflow"
1161
+ ];
1162
+ const _hoisted_7 = ["hidden", "inert"];
1163
+ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
1164
+ name: "AstryxDropdownMenuFrame",
1165
+ __name: "DropdownMenuFrame",
1166
+ setup(__props) {
1167
+ const frame = inject(dropdownMenuFrameKey);
1168
+ if (frame == null) throw new Error("DropdownMenuFrame must render inside DropdownMenu");
1169
+ const isClient = ref(false);
1170
+ onMounted(() => {
1171
+ isClient.value = true;
1172
+ });
1173
+ return (_ctx, _cache) => {
1174
+ return unref(frame).isSheet && isClient.value ? (openBlock(), createBlock(unref(LazyBottomSheet), {
1175
+ key: 0,
1176
+ "is-open": unref(frame).sheetOpen,
1177
+ "onUpdate:isOpen": _cache[3] || (_cache[3] = ($event) => unref(frame).sheetOpen = $event),
1178
+ height: "hug",
1179
+ label: unref(frame).sheetLabel,
1180
+ padding: 2,
1181
+ onMotionComplete: _cache[4] || (_cache[4] = ($event) => $event === "exiting" && unref(frame).onSheetSettled())
1182
+ }, {
1183
+ default: withCtx(() => [createVNode(_sfc_main$10, null, {
1184
+ default: withCtx(() => [createVNode(_sfc_main$7, { value: unref(frame).menuContext }, {
1185
+ default: withCtx(() => [
1186
+ _ctx.$slots.header ? (openBlock(), createElementBlock("div", {
1187
+ key: 0,
1188
+ ref: unref(frame).setHeader,
1189
+ class: "astryx-dropdown-menu-region",
1190
+ onKeydown: _cache[0] || (_cache[0] = (...args) => unref(frame).regions.onRegionKeydown && unref(frame).regions.onRegionKeydown(...args))
1191
+ }, [renderSlot(_ctx.$slots, "header")], 544)) : createCommentVNode("v-if", true),
1192
+ createElementVNode("div", mergeProps({
1193
+ id: unref(frame).surfaceId,
1194
+ ref: unref(frame).setSurface
1195
+ }, unref(frame).menuBindings, {
1196
+ "aria-labelledby": unref(frame).menuAriaLabelledBy,
1197
+ "aria-label": unref(frame).menuAriaLabel,
1198
+ class: ["astryx-dropdown-menu is-sheet", unref(frame).surfaceClass],
1199
+ "data-overflow": unref(frame).hasOverflow || void 0,
1200
+ role: "menu",
1201
+ tabindex: "-1",
1202
+ onKeydown: _cache[1] || (_cache[1] = (...args) => unref(frame).onSurfaceKeydown && unref(frame).onSurfaceKeydown(...args))
1203
+ }), [createElementVNode("div", {
1204
+ class: "astryx-dropdown-menu-tree",
1205
+ hidden: unref(frame).isDrilled || void 0,
1206
+ inert: unref(frame).isDrilled || void 0
1207
+ }, [unref(frame).items != null ? (openBlock(), createBlock(unref(DropdownMenuItems), {
1208
+ key: 0,
1209
+ items: unref(frame).items
1210
+ }, null, 8, ["items"])) : renderSlot(_ctx.$slots, "default", {}, void 0, void 0, 1)], 8, _hoisted_2), createElementVNode("div", {
1211
+ ref: unref(frame).setHost,
1212
+ class: "astryx-dropdown-menu-tree"
1213
+ }, null, 512)], 16, _hoisted_1$1),
1214
+ _ctx.$slots.footer ? (openBlock(), createElementBlock("div", {
1215
+ key: 1,
1216
+ ref: unref(frame).setFooter,
1217
+ class: "astryx-dropdown-menu-region",
1218
+ onKeydown: _cache[2] || (_cache[2] = (...args) => unref(frame).regions.onRegionKeydown && unref(frame).regions.onRegionKeydown(...args))
1219
+ }, [renderSlot(_ctx.$slots, "footer")], 544)) : createCommentVNode("v-if", true)
1220
+ ]),
1221
+ _: 3
1222
+ }, 8, ["value"])]),
1223
+ _: 3
1224
+ })]),
1225
+ _: 3
1226
+ }, 8, ["is-open", "label"])) : (openBlock(), createBlock(Teleport, {
1227
+ key: 1,
1228
+ to: unref(frame).teleportTarget
1229
+ }, [createVNode(Transition, { name: "astryx-dropdown-menu" }, {
1230
+ default: withCtx(() => [unref(frame).hasRegions ? withDirectives((openBlock(), createElementBlock("div", {
1231
+ key: 0,
1232
+ id: unref(frame).dialogId,
1233
+ ref: unref(frame).setPopover,
1234
+ class: "astryx-dropdown-menu-popover",
1235
+ role: "dialog",
1236
+ "aria-modal": "true",
1237
+ "aria-label": unref(frame).dialogLabel,
1238
+ "data-placement": unref(frame).placement,
1239
+ style: normalizeStyle(unref(frame).surfaceStyle)
1240
+ }, [createVNode(_sfc_main$10, null, {
1241
+ default: withCtx(() => [createVNode(_sfc_main$7, { value: unref(frame).menuContext }, {
1242
+ default: withCtx(() => [
1243
+ _ctx.$slots.header ? (openBlock(), createElementBlock("div", {
1244
+ key: 0,
1245
+ ref: unref(frame).setHeader,
1246
+ class: "astryx-dropdown-menu-region",
1247
+ onKeydown: _cache[5] || (_cache[5] = (...args) => unref(frame).regions.onRegionKeydown && unref(frame).regions.onRegionKeydown(...args))
1248
+ }, [renderSlot(_ctx.$slots, "header")], 544)) : createCommentVNode("v-if", true),
1249
+ createElementVNode("div", mergeProps({
1250
+ id: unref(frame).surfaceId,
1251
+ ref: unref(frame).setSurface
1252
+ }, unref(frame).menuBindings, {
1253
+ "aria-labelledby": unref(frame).menuAriaLabelledBy,
1254
+ "aria-label": unref(frame).menuAriaLabel,
1255
+ class: ["astryx-dropdown-menu is-in-frame", unref(frame).surfaceClass],
1256
+ "data-overflow": unref(frame).hasOverflow || void 0,
1257
+ "data-region-focus": unref(frame).regionFocus || void 0,
1258
+ role: "menu",
1259
+ tabindex: "0",
1260
+ onFocus: _cache[6] || (_cache[6] = (...args) => unref(frame).onSurfaceFocus && unref(frame).onSurfaceFocus(...args)),
1261
+ onKeydown: _cache[7] || (_cache[7] = (...args) => unref(frame).onSurfaceKeydown && unref(frame).onSurfaceKeydown(...args))
1262
+ }), [createElementVNode("div", {
1263
+ class: "astryx-dropdown-menu-tree",
1264
+ hidden: unref(frame).isDrilled || void 0,
1265
+ inert: unref(frame).isDrilled || void 0
1266
+ }, [unref(frame).items != null ? (openBlock(), createBlock(unref(DropdownMenuItems), {
1267
+ key: 0,
1268
+ items: unref(frame).items
1269
+ }, null, 8, ["items"])) : renderSlot(_ctx.$slots, "default", {}, void 0, void 0, 1)], 8, _hoisted_5), createElementVNode("div", {
1270
+ ref: unref(frame).setHost,
1271
+ class: "astryx-dropdown-menu-tree"
1272
+ }, null, 512)], 16, _hoisted_4),
1273
+ _ctx.$slots.footer ? (openBlock(), createElementBlock("div", {
1274
+ key: 1,
1275
+ ref: unref(frame).setFooter,
1276
+ class: "astryx-dropdown-menu-region",
1277
+ onKeydown: _cache[8] || (_cache[8] = (...args) => unref(frame).regions.onRegionKeydown && unref(frame).regions.onRegionKeydown(...args))
1278
+ }, [renderSlot(_ctx.$slots, "footer")], 544)) : createCommentVNode("v-if", true)
1279
+ ]),
1280
+ _: 3
1281
+ }, 8, ["value"])]),
1282
+ _: 3
1283
+ })], 12, _hoisted_3)), [[vShow, unref(frame).isOpen]]) : withDirectives((openBlock(), createElementBlock("div", mergeProps({
1284
+ key: 1,
1285
+ id: unref(frame).surfaceId,
1286
+ ref: unref(frame).setSurface
1287
+ }, unref(frame).menuBindings, {
1288
+ "aria-labelledby": unref(frame).menuAriaLabelledBy,
1289
+ "aria-label": unref(frame).menuAriaLabel,
1290
+ class: ["astryx-dropdown-menu", unref(frame).surfaceClass],
1291
+ "data-placement": unref(frame).placement,
1292
+ "data-overflow": unref(frame).hasOverflow || void 0,
1293
+ role: "menu",
1294
+ style: unref(frame).surfaceStyle,
1295
+ tabindex: "-1",
1296
+ onFocus: _cache[9] || (_cache[9] = (...args) => unref(frame).onSurfaceFocus && unref(frame).onSurfaceFocus(...args)),
1297
+ onKeydown: _cache[10] || (_cache[10] = (...args) => unref(frame).onSurfaceKeydown && unref(frame).onSurfaceKeydown(...args))
1298
+ }), [createVNode(_sfc_main$10, null, {
1299
+ default: withCtx(() => [createVNode(_sfc_main$7, { value: unref(frame).menuContext }, {
1300
+ default: withCtx(() => [createElementVNode("div", {
1301
+ class: "astryx-dropdown-menu-tree",
1302
+ hidden: unref(frame).isDrilled || void 0,
1303
+ inert: unref(frame).isDrilled || void 0
1304
+ }, [unref(frame).items != null ? (openBlock(), createBlock(unref(DropdownMenuItems), {
1305
+ key: 0,
1306
+ items: unref(frame).items
1307
+ }, null, 8, ["items"])) : renderSlot(_ctx.$slots, "default", {}, void 0, void 0, 1)], 8, _hoisted_7), createElementVNode("div", {
1308
+ ref: unref(frame).setHost,
1309
+ class: "astryx-dropdown-menu-tree"
1310
+ }, null, 512)]),
1311
+ _: 3
1312
+ }, 8, ["value"])]),
1313
+ _: 3
1314
+ })], 16, _hoisted_6)), [[vShow, unref(frame).isOpen]])]),
1315
+ _: 3
1316
+ })], 8, ["to"]));
1317
+ };
787
1318
  }
788
- return result;
789
- }
1319
+ });
1320
+ //#endregion
1321
+ //#region src/DropdownMenu/useMenuNaming.ts
790
1322
  /**
791
- * Keyboard between a menu and the header and footer beside it.
1323
+ * 菜单面板、对话框和底部弹层的名字与 id。
792
1324
  *
793
- * With either region the popover is a dialog: Tab cycles the header, the menu
794
- * as one stop, and the footer, and wraps at both ends. A row counts as the
795
- * menu's stop, so Shift+Tab from a row lands on the header.
1325
+ * 内置按钮开的菜单以按钮文字命名;自定义触发器开的菜单以调用方的 `aria-label`
1326
+ * 命名,没有就用触发器自己的可访问名称,不再一律叫「Menu」。
796
1327
  */
797
- function useMenuRegions(options) {
798
- function focusRegion(direction) {
799
- const tabbables = tabbablesIn(direction === "previous" ? options.header.value : options.footer.value);
800
- if (!focusControl(direction === "previous" ? tabbables[tabbables.length - 1] : tabbables[0])) {
801
- options.closeMenu();
802
- return false;
803
- }
804
- return true;
805
- }
806
- function moveDialogTab(event, isFromFlyout = false) {
807
- const menu = options.menu.value;
808
- if (menu == null || !options.hasRegions.value) return;
809
- event.preventDefault();
810
- event.stopPropagation();
811
- const active = menu.ownerDocument.activeElement;
812
- const cycle = collapseRadioGroups([
813
- ...tabbablesIn(options.header.value),
814
- menu,
815
- ...tabbablesIn(options.footer.value)
816
- ], active, event.shiftKey);
817
- if (cycle.length <= 1) {
818
- if (isFromFlyout) menu.focus();
819
- return;
820
- }
821
- const menuIndex = cycle.indexOf(menu);
822
- let index = active instanceof Node && menu.contains(active) ? menuIndex : cycle.findIndex((element) => element === active || element.contains(active));
823
- if (index < 0) index = menuIndex;
824
- const step = event.shiftKey ? -1 : 1;
825
- const next = cycle[(index + step + cycle.length) % cycle.length];
826
- if (!focusControl(next)) menu.focus();
827
- }
828
- function onRegionKeydown(event) {
829
- if (event.key === "Tab") moveDialogTab(event);
1328
+ function useMenuNaming(options) {
1329
+ const triggerName = shallowRef();
1330
+ const buttonLabel = () => {
1331
+ const label = options.buttonLabel();
1332
+ return typeof label === "string" ? label : void 0;
1333
+ };
1334
+ function captureTriggerName() {
1335
+ triggerName.value = options.hasCustomTrigger() ? readAccessibleName(options.getTriggerControl()) : void 0;
830
1336
  }
1337
+ const surfaceId = computed(() => {
1338
+ const provided = options.attrs().id;
1339
+ return typeof provided === "string" && provided.length > 0 ? provided : options.menuId;
1340
+ });
1341
+ const menuLabel = computed(() => {
1342
+ const explicit = options.attrs()["aria-label"];
1343
+ if (typeof explicit === "string" && explicit.length > 0) return explicit;
1344
+ return buttonLabel();
1345
+ });
1346
+ const menuAriaLabel = computed(() => {
1347
+ const explicit = options.attrs()["aria-label"];
1348
+ if (typeof explicit === "string") return explicit;
1349
+ return options.hasCustomTrigger() ? void 0 : buttonLabel();
1350
+ });
831
1351
  return {
832
- focusRegion,
833
- moveDialogTab,
834
- onRegionKeydown
1352
+ captureTriggerName,
1353
+ menuAriaLabel,
1354
+ menuAriaLabelledBy: computed(() => {
1355
+ const explicit = options.attrs()["aria-labelledby"];
1356
+ if (typeof explicit === "string") return explicit;
1357
+ if (menuAriaLabel.value != null) return void 0;
1358
+ return options.hasCustomTrigger() ? options.triggerId : void 0;
1359
+ }),
1360
+ menuLabel,
1361
+ sheetLabel: computed(() => {
1362
+ if (options.hasCustomTrigger()) {
1363
+ const explicit = options.attrs()["aria-label"];
1364
+ if (typeof explicit === "string" && explicit.trim() !== "") return explicit;
1365
+ return triggerName.value ?? options.fallback();
1366
+ }
1367
+ return buttonLabel() ?? options.fallback();
1368
+ }),
1369
+ surfaceId
835
1370
  };
836
1371
  }
837
1372
  //#endregion
@@ -851,7 +1386,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
851
1386
  menuWidth: {},
852
1387
  menuMaxHeight: {},
853
1388
  placement: { default: "below" },
854
- presentation: { default: "popover" },
1389
+ presentation: {},
855
1390
  alignment: { default: "start" },
856
1391
  hasChevron: {
857
1392
  type: Boolean,
@@ -898,7 +1433,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
898
1433
  const hasRegions = computed(() => slots.header != null || slots.footer != null);
899
1434
  const { drillIn, host, isDrilled } = useMenuDrillIn(isOpen);
900
1435
  const positionedEl = computed(() => hasRegions.value ? popoverRef.value : surfaceRef.value);
901
- const { isSheet, settle: onSheetSettled } = useHeldPresentation(() => props.presentation, isOpen);
1436
+ const { isSheet, settle: onSheetSettled } = useHeldPresentation(() => props.presentation ?? "popover", isOpen);
902
1437
  const sheetOpen = computed({
903
1438
  get: () => isSheet.value && isOpen.value,
904
1439
  set: (open) => {
@@ -909,24 +1444,17 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
909
1444
  label: messages.value.dropdownMenu.label,
910
1445
  ...props.button
911
1446
  }));
912
- const sheetLabel = computed(() => typeof buttonProps.value.label === "string" ? buttonProps.value.label : messages.value.dropdownMenu.label);
913
1447
  const menuSize = computed(() => buttonProps.value.size ?? "md");
914
1448
  const isIconOnly = computed(() => buttonProps.value.isIconOnly === true);
915
1449
  const hasChevron = computed(() => props.hasChevron && !isIconOnly.value);
916
- const surfaceId = computed(() => {
917
- const provided = attrs.id;
918
- return typeof provided === "string" && provided.length > 0 ? provided : menuId;
919
- });
920
- const menuLabel = computed(() => {
921
- const explicit = attrs["aria-label"];
922
- if (typeof explicit === "string" && explicit.length > 0) return explicit;
923
- return typeof buttonProps.value.label === "string" ? buttonProps.value.label : void 0;
924
- });
925
- const menuAriaLabel = computed(() => {
926
- const explicit = attrs["aria-label"];
927
- if (typeof explicit === "string") return explicit;
928
- if (slots.trigger != null) return void 0;
929
- return typeof buttonProps.value.label === "string" ? buttonProps.value.label : void 0;
1450
+ const { captureTriggerName, menuAriaLabel, menuAriaLabelledBy, menuLabel, sheetLabel, surfaceId } = useMenuNaming({
1451
+ attrs: () => attrs,
1452
+ buttonLabel: () => buttonProps.value.label,
1453
+ fallback: () => messages.value.dropdownMenu.label,
1454
+ getTriggerControl: () => getTriggerControl(),
1455
+ hasCustomTrigger: () => slots.trigger != null,
1456
+ menuId,
1457
+ triggerId
930
1458
  });
931
1459
  const dialogLabel = computed(() => menuLabel.value ?? messages.value.dropdownMenu.label);
932
1460
  const dialogId = `${menuId}-dialog`;
@@ -934,12 +1462,6 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
934
1462
  const controlsId = computed(() => hasRegions.value ? dialogId : surfaceId.value);
935
1463
  const focusRing = computed(() => focusReturn.isFocusRingSuppressed.value ? "off" : void 0);
936
1464
  const hasOverflow = useOverflow(surfaceRef, isOpen);
937
- const menuAriaLabelledBy = computed(() => {
938
- const explicit = attrs["aria-labelledby"];
939
- if (typeof explicit === "string") return explicit;
940
- if (menuAriaLabel.value != null) return void 0;
941
- return slots.trigger != null ? triggerId : void 0;
942
- });
943
1465
  const forwardedAttrs = computed(() => Object.fromEntries(Object.entries(attrs).filter(([key]) => ![
944
1466
  "class",
945
1467
  "style",
@@ -1038,6 +1560,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
1038
1560
  const press = useMenuPress({
1039
1561
  menuRef: surfaceRef,
1040
1562
  triggerRef: anchorRef,
1563
+ touchModel: props.presentation === "popover" ? "pointer" : "uikit",
1041
1564
  isEnabled: () => !isSheet.value && !isTriggerDisabled(),
1042
1565
  onTriggerPress: () => {
1043
1566
  if (isOpen.value) {
@@ -1065,14 +1588,18 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
1065
1588
  await nextTick();
1066
1589
  if (surfaceRef.value == null) return;
1067
1590
  shouldFocusOnOpen.value = false;
1068
- const hasFocusedRow = focusLastOnOpen.value ? focusNav.focusLast() : focusNav.focusFirst();
1591
+ const isPointerOpen = openModality === "pointer";
1592
+ const active = surfaceRef.value.ownerDocument.activeElement;
1593
+ const isRowLit = isPointerOpen && active !== surfaceRef.value && surfaceRef.value.contains(active);
1594
+ const hasFocusedRow = isRowLit || !isPointerOpen && (focusLastOnOpen.value ? focusNav.focusLast() : focusNav.focusFirst());
1069
1595
  focusLastOnOpen.value = false;
1070
- if (openModality === "pointer" || !hasFocusedRow) focusSurface();
1596
+ if (!isRowLit && (isPointerOpen || !hasFocusedRow)) focusSurface();
1071
1597
  openModality = "keyboard";
1072
1598
  }
1073
1599
  watch(isOpen, async (nowOpen) => {
1074
1600
  layerIsOpen.value = nowOpen && !isSheet.value;
1075
1601
  if (nowOpen) {
1602
+ captureTriggerName();
1076
1603
  anchorWidth.value = anchorRef.value?.getBoundingClientRect().width ?? 0;
1077
1604
  await focusMenuOnOpen();
1078
1605
  return;
@@ -1208,6 +1735,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
1208
1735
  onMounted(() => {
1209
1736
  if (!isOpen.value) return;
1210
1737
  layerIsOpen.value = true;
1738
+ captureTriggerName();
1211
1739
  anchorWidth.value = anchorRef.value?.getBoundingClientRect().width ?? 0;
1212
1740
  });
1213
1741
  onBeforeUnmount(() => {
@@ -1222,7 +1750,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
1222
1750
  onContextmenu: _cache[0] || (_cache[0] = (...args) => unref(press).triggerProps.onContextmenu && unref(press).triggerProps.onContextmenu(...args)),
1223
1751
  onFocusin: _cache[1] || (_cache[1] = (...args) => unref(focusReturn).onFocusReturnTargetFocus && unref(focusReturn).onFocusReturnTargetFocus(...args)),
1224
1752
  onPointerdown: _cache[2] || (_cache[2] = (...args) => unref(press).triggerProps.onPointerdown && unref(press).triggerProps.onPointerdown(...args))
1225
- }, [unref(slots).trigger ? renderSlot(_ctx.$slots, "trigger", normalizeProps(guardReactiveProps(triggerProps.value)), void 0, void 0, 0) : (openBlock(), createBlock(_sfc_main$8, mergeProps({ key: 1 }, buttonProps.value, {
1753
+ }, [unref(slots).trigger ? renderSlot(_ctx.$slots, "trigger", normalizeProps(guardReactiveProps(triggerProps.value)), void 0, void 0, 0) : (openBlock(), createBlock(_sfc_main$9, mergeProps({ key: 1 }, buttonProps.value, {
1226
1754
  id: triggerId,
1227
1755
  "aria-controls": controlsId.value,
1228
1756
  "aria-expanded": isOpen.value,
@@ -1234,7 +1762,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
1234
1762
  onKeydown: onTriggerKeydown
1235
1763
  }), createSlots({ _: 2 }, [hasChevron.value ? {
1236
1764
  name: "end",
1237
- fn: withCtx(() => [createVNode(_sfc_main$7, {
1765
+ fn: withCtx(() => [createVNode(_sfc_main$8, {
1238
1766
  color: "inherit",
1239
1767
  icon: "chevronDown",
1240
1768
  size: "sm"
@@ -1263,4 +1791,4 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
1263
1791
  }
1264
1792
  });
1265
1793
  //#endregion
1266
- export { _sfc_main$2 as a, _sfc_main$6 as c, activateFocusedMenuItem as i, useMenuRegions as n, _sfc_main$3 as o, useMenuFocus as r, _sfc_main$5 as s, _sfc_main as t };
1794
+ export { _sfc_main$6 as a, _sfc_main$4 as i, _sfc_main$2 as n, _sfc_main$3 as r, _sfc_main as t };