@astryx-vue/core 0.31.0 → 0.32.1
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.
- package/dist/AlertDialog/index.js +1 -1
- package/dist/{AlertDialog-CvNtu0Jd.js → AlertDialog-JmxbMkeV.js} +8 -8
- package/dist/AppShell/index.js +1 -1
- package/dist/{AppShell-BmX6wqba.js → AppShell-mWlY4pE3.js} +4 -6
- package/dist/Avatar/index.js +1 -1
- package/dist/{Avatar-IVvsyeGV.js → Avatar-B-gSpEw4.js} +1 -1
- package/dist/AvatarGroup/index.d.ts +1 -1
- package/dist/AvatarGroup/index.js +1 -1
- package/dist/{AvatarGroup-Dd-yDDNz.js → AvatarGroup-CCFMtKks.js} +1 -1
- package/dist/Banner/index.d.ts +1 -1
- package/dist/Banner/index.js +1 -1
- package/dist/{Banner-DKmvoMxD.js → Banner-BJETFZr7.js} +1 -1
- package/dist/BottomSheet/index.d.ts +1 -1
- package/dist/BottomSheet/index.js +2 -2
- package/dist/{BottomSheet-BZ_yFoKC.js → BottomSheet-C6pQBvnU.js} +10 -38
- package/dist/{BottomSheet-B8_znPYE.js → BottomSheet-C_LoskZt.js} +3 -3
- package/dist/Breadcrumbs/index.d.ts +2 -2
- package/dist/Breadcrumbs/index.js +2 -2
- package/dist/{Breadcrumbs-CJpvbZsf.js → Breadcrumbs-D05OmNfd.js} +1 -1
- package/dist/Button/index.d.ts +1 -1
- package/dist/Button/index.js +1 -1
- package/dist/{Button-DdPty46q.js → Button-X7k1WCkW.js} +4 -4
- package/dist/ButtonGroup/index.d.ts +1 -1
- package/dist/ButtonGroup/index.js +1 -1
- package/dist/{ButtonGroup-oI99JAyN.js → ButtonGroup-D5E7QLWI.js} +2 -2
- package/dist/Calendar/index.d.ts +1 -1
- package/dist/Carousel/index.d.ts +1 -1
- package/dist/Carousel/index.js +1 -1
- package/dist/{Carousel-BNr79JpP.js → Carousel-Bpbx-2DK.js} +1 -1
- package/dist/Chat/index.d.ts +1 -1
- package/dist/Chat/index.js +1 -1
- package/dist/{Chat-BadS0fEx.js → Chat-D7Q2z9W2.js} +11 -11
- package/dist/CheckboxInput/index.d.ts +1 -1
- package/dist/CheckboxInput/index.js +1 -1
- package/dist/{CheckboxInput-CzP8gP3v.js → CheckboxInput-Cxtmdymo.js} +3 -3
- package/dist/CheckboxList/index.d.ts +1 -1
- package/dist/CheckboxList/index.js +1 -1
- package/dist/{CheckboxListItem-CxBjpX3d.js → CheckboxListItem-DJrx97cA.js} +5 -5
- package/dist/ClickableCard/index.d.ts +1 -1
- package/dist/ClickableCard/index.js +1 -1
- package/dist/{ClickableCard-B86P2aiM.js → ClickableCard-CLXCxaxo.js} +1 -1
- package/dist/Code/index.js +1 -1
- package/dist/{CodeBlock-Cgm4uOhG.js → CodeBlock-Bgxy15iD.js} +1 -1
- package/dist/Collapsible/index.js +1 -1
- package/dist/{Collapsible-DXl9RRaX.js → Collapsible-Cf5zttC-.js} +2 -3
- package/dist/CommandPalette/index.js +1 -1
- package/dist/{CommandPalette-BgVwGtdA.js → CommandPalette-CniaCqex.js} +2 -2
- package/dist/ComplexSelector/index.js +1 -1
- package/dist/{ComplexSelector-vna5wtig.js → ComplexSelector-DYeYZKON.js} +2 -2
- package/dist/ContextMenu/index.d.ts +2 -2
- package/dist/ContextMenu/index.js +2 -2
- package/dist/{ContextMenu-CE-FnLI6.js → ContextMenu-CLCgJG0C.js} +167 -142
- package/dist/DateInput/index.d.ts +1 -1
- package/dist/DateInput/index.js +1 -1
- package/dist/{DateInput-BCasoeIj.js → DateInput-BmEbQA1z.js} +10 -10
- package/dist/DateRangeInput/index.d.ts +1 -1
- package/dist/DateRangeInput/index.js +1 -1
- package/dist/{DateRangeInput-Bi97pjDX.js → DateRangeInput-CoA1PuGz.js} +5 -5
- package/dist/DateTimeInput/index.d.ts +1 -1
- package/dist/DateTimeInput/index.js +1 -1
- package/dist/{DateTimeInput-CKnvjLhi.js → DateTimeInput-CL0sp0ES.js} +5 -5
- package/dist/Dialog/index.js +3 -3
- package/dist/{Dialog-BN-NycQr.js → Dialog-C46xHdDO.js} +1 -1
- package/dist/{Dialog-Dt0gNuMT.js → Dialog-uzq24bX_.js} +2 -2
- package/dist/{DialogHeader-CSH2_5v-.js → DialogHeader-E0auaRKt.js} +2 -2
- package/dist/Divider/index.d.ts +1 -1
- package/dist/Drawer/index.d.ts +1 -1
- package/dist/Drawer/index.js +1 -1
- package/dist/{Drawer-PeMgE4iA.js → Drawer-DfhhdBMZ.js} +2 -2
- package/dist/DropdownMenu/index.d.ts +2 -2
- package/dist/DropdownMenu/index.js +2 -3
- package/dist/{DropdownMenu-aYOIh9gZ.js → DropdownMenu-BWgt12MZ.js} +1083 -555
- package/dist/{DropdownMenuRadioItem.vue-C8rePTyz.d.ts → DropdownMenuRadioItem.vue-B4iwMWWD.d.ts} +16 -0
- package/dist/EmptyState/index.js +1 -1
- package/dist/{EmptyState-BGo1nrnT.js → EmptyState-C8WQltQk.js} +2 -2
- package/dist/Field/index.js +3 -3
- package/dist/{Field-D-fRqyso.js → Field-CrnwM-2A.js} +1 -1
- package/dist/{FieldInfoTip-Bstp5Lvd.js → FieldInfoTip-DqQP1T-d.js} +1 -1
- package/dist/{FieldLabel-lV_qLaGp.js → FieldLabel-CLxclKT2.js} +1 -1
- package/dist/FileInput/index.js +1 -1
- package/dist/{FileInput-CTNnDIkm.js → FileInput-BHFjo_zo.js} +3 -3
- package/dist/Heading/index.d.ts +1 -1
- package/dist/Heading/index.js +1 -1
- package/dist/{Heading-BFK3PftX.js → Heading-jYno4L3t.js} +1 -1
- package/dist/HoverCard/index.d.ts +1 -1
- package/dist/HoverCard/index.js +1 -1
- package/dist/{HoverCard-DGjsPn-Q.js → HoverCard-D_6idU4r.js} +4 -4
- package/dist/IconButton/index.js +1 -1
- package/dist/{IconButton-DPezhVBA.js → IconButton-B6m42AlL.js} +1 -1
- package/dist/InfoTip/index.d.ts +1 -1
- package/dist/InfoTip/index.js +1 -1
- package/dist/{InfoTip-B4BFfLtT.js → InfoTip-CUkTHca2.js} +2 -2
- package/dist/{InputClearButton-CxU3iv-5.js → InputClearButton-s_MEW25n.js} +1 -1
- package/dist/InputGroup/index.js +1 -1
- package/dist/{InputGroup-CraWGK6Y.js → InputGroup-42PbUmg-.js} +1 -1
- package/dist/InternationalizationProvider/index.js +1 -1
- package/dist/{InternationalizationProvider-C-hZoz8a.js → InternationalizationProvider-BAUKUK7N.js} +1 -1
- package/dist/{Item-C9u_kQUO.js → Item-C9Cs0Jqr.js} +1 -1
- package/dist/{LayerContentBoundary-LCQLyxBT.js → LayerContentBoundary-XvH9wmdg.js} +1 -1
- package/dist/Layout/index.d.ts +1 -1
- package/dist/Layout/index.js +2 -2
- package/dist/{Layout-094k14rN.js → Layout-tU7e1J1I.js} +1 -1
- package/dist/{LayoutPanel-BPboQAJj.js → LayoutPanel-D8t8F-sl.js} +22 -2
- package/dist/Lightbox/index.js +1 -1
- package/dist/{Lightbox-BNUG9CQ1.js → Lightbox-Bur4pvRo.js} +2 -2
- package/dist/Link/index.d.ts +1 -1
- package/dist/Link/index.js +1 -1
- package/dist/{Link-Bwgpn-di.js → Link-DVslj_GH.js} +2 -2
- package/dist/List/index.d.ts +1 -1
- package/dist/List/index.js +2 -2
- package/dist/{ListItem-_lOmngHp.js → ListItem-DOFfdRA_.js} +2 -2
- package/dist/Markdown/index.js +1 -1
- package/dist/{Markdown-BlEi5UGN.js → Markdown-Baq5r2Mp.js} +3 -3
- package/dist/MetadataList/index.d.ts +1 -1
- package/dist/MobileNav/index.js +1 -1
- package/dist/{MobileNavToggle-wVa9dzH1.js → MobileNavToggle-BV3fmVmO.js} +2 -2
- package/dist/MoreMenu/index.d.ts +1 -1
- package/dist/MoreMenu/index.js +1 -1
- package/dist/{MoreMenu-CXshllJj.js → MoreMenu-COSDjYyl.js} +45 -16
- package/dist/MultiSelector/index.d.ts +1 -1
- package/dist/MultiSelector/index.js +1 -1
- package/dist/{MultiSelector-Bs3Imw6k.js → MultiSelector-eJSx3iZR.js} +8 -8
- package/dist/{NavDisclosure-DsUYuMJr.js → NavDisclosure-B8G8t325.js} +1 -1
- package/dist/{NavHeadingSurface-QdM33nOf.js → NavHeadingSurface-BkNP_1au.js} +1 -1
- package/dist/NavItem/index.d.ts +1 -1
- package/dist/NavItem/index.js +1 -1
- package/dist/{NavItem-D4xHjSTo.js → NavItem-B7xpLk_x.js} +1 -1
- package/dist/NavMenu/index.js +3 -3
- package/dist/{NavMenu-NCg3VjAQ.js → NavMenu-C6OU4a5Z.js} +3 -3
- package/dist/{NavMenuItem-Bla6fYVl.js → NavMenuItem-BZuajqYL.js} +3 -3
- package/dist/NumberInput/index.d.ts +1 -1
- package/dist/NumberInput/index.js +1 -1
- package/dist/{NumberInput-DicgvFte.js → NumberInput-Dd4QQGZp.js} +3 -3
- package/dist/Outline/index.js +1 -1
- package/dist/{Outline-CnSt_KvS.js → Outline-coqRQ06s.js} +4 -3
- package/dist/OverflowList/index.d.ts +1 -1
- package/dist/OverflowList/index.js +1 -1
- package/dist/{OverflowList-BYYz3ePw.js → OverflowList-DS7cmNsr.js} +2 -2
- package/dist/Pagination/index.d.ts +1 -1
- package/dist/Pagination/index.js +1 -1
- package/dist/{Pagination-kJhH6sPF.js → Pagination-BWPJfO4_.js} +2 -2
- package/dist/Popover/index.d.ts +1 -1
- package/dist/Popover/index.js +1 -1
- package/dist/{Popover-CqL_AXQB.js → Popover-DnrZk22Y.js} +8 -8
- package/dist/PowerSearch/index.d.ts +1 -1
- package/dist/PowerSearch/index.js +1 -1
- package/dist/{PowerSearch-Ff2n7eJ2.js → PowerSearch-CDwASKYp.js} +27 -27
- package/dist/ProgressBar/index.d.ts +1 -1
- package/dist/ProgressBar/index.js +1 -1
- package/dist/{ProgressBar-DCAEXJuP.js → ProgressBar-C-HzrG8T.js} +1 -1
- package/dist/Radio/index.d.ts +1 -1
- package/dist/Radio/index.js +1 -1
- package/dist/{RadioGroup-CsJYGjyx.js → RadioGroup-B-AkUDI8.js} +4 -4
- package/dist/RadioList/index.d.ts +1 -1
- package/dist/RadioList/index.js +1 -1
- package/dist/{RadioListItem-Yc3K82YE.js → RadioListItem-DhmF7YNL.js} +1 -1
- package/dist/Resizable/index.d.ts +1 -1
- package/dist/Resizable/index.js +1 -1
- package/dist/{ResizeHandle-BMSbAFdP.js → ResizeHandle-CcS-NP4r.js} +21 -4
- package/dist/ScrollableArea/index.d.ts +1 -1
- package/dist/SegmentedControl/index.js +1 -1
- package/dist/{SegmentedControl-C-F5dkcG.js → SegmentedControl-BdbqWErg.js} +2 -2
- package/dist/SelectableCard/index.d.ts +1 -1
- package/dist/SelectableCard/index.js +1 -1
- package/dist/{SelectableCard-CwfpgsS8.js → SelectableCard-YzN6trLf.js} +1 -1
- package/dist/Selector/index.d.ts +1 -1
- package/dist/Selector/index.js +1 -1
- package/dist/{Selector-DgzSGUul.js → Selector-BNr_kb6Q.js} +6 -6
- package/dist/SideNav/index.d.ts +1 -1
- package/dist/SideNav/index.js +2 -2
- package/dist/{SideNav-DNQZ8l6b.js → SideNav-DnoR_4ml.js} +9 -11
- package/dist/Slider/index.js +1 -1
- package/dist/{Slider-Bq_7Nskr.js → Slider-DaHQhbA7.js} +2 -2
- package/dist/Stack/index.d.ts +1 -1
- package/dist/StatusDot/index.js +1 -1
- package/dist/{StatusDot-DFJavm30.js → StatusDot-B7T0et3H.js} +1 -1
- package/dist/Stepper/index.d.ts +1 -1
- package/dist/Stepper/index.js +1 -1
- package/dist/{Stepper-CWluGqBs.js → Stepper-C3ZFN-Gp.js} +1 -1
- package/dist/Switch/index.d.ts +1 -1
- package/dist/Switch/index.js +1 -1
- package/dist/{Switch-DTPvMAxd.js → Switch-B8HRxp3u.js} +2 -2
- package/dist/TabList/index.d.ts +1 -1
- package/dist/TabList/index.js +1 -1
- package/dist/{TabList-C4i7UZkp.js → TabList-BOQ0bvE3.js} +3 -3
- package/dist/Table/index.d.ts +2 -2
- package/dist/Table/index.js +1 -1
- package/dist/{Table-CqAV7l7W.js → Table-CoWGEhzQ.js} +13 -15
- package/dist/Text/index.d.ts +1 -1
- package/dist/Text/index.js +1 -1
- package/dist/{Text-D48QFTtL.js → Text-DqiV40AF.js} +1 -1
- package/dist/TextArea/index.d.ts +1 -1
- package/dist/TextArea/index.js +1 -1
- package/dist/{TextArea-J2_wct0p.js → TextArea-Vrx7Os5P.js} +4 -4
- package/dist/TextInput/index.d.ts +1 -1
- package/dist/TextInput/index.js +1 -1
- package/dist/{TextInput-Da1TYd57.js → TextInput-DOeUROX8.js} +4 -4
- package/dist/Thumbnail/index.js +1 -1
- package/dist/{Thumbnail-1LsaJ4_m.js → Thumbnail-BF53Z6jm.js} +3 -3
- package/dist/{TimeField-ojhX2ZOj.js → TimeField-CkGXOHTG.js} +4 -4
- package/dist/TimeInput/index.d.ts +1 -1
- package/dist/TimeInput/index.js +1 -1
- package/dist/{TimeInput-CfeDP72M.js → TimeInput-DCksf1di.js} +2 -2
- package/dist/Timer/index.js +1 -1
- package/dist/{Timer-DgQdZAEa.js → Timer-DDrODKow.js} +1 -1
- package/dist/Timestamp/index.d.ts +1 -1
- package/dist/Timestamp/index.js +1 -1
- package/dist/{Timestamp-SseS_qtf.js → Timestamp-CCzREXNN.js} +3 -3
- package/dist/Toast/index.js +1 -1
- package/dist/{Toast-yUVFaZiJ.js → Toast-CoAEdN_I.js} +2 -2
- package/dist/ToggleButton/index.d.ts +1 -1
- package/dist/ToggleButton/index.js +1 -1
- package/dist/{ToggleButton-B6hBzeVl.js → ToggleButton-DAW-pV4r.js} +3 -3
- package/dist/Token/index.d.ts +1 -1
- package/dist/Token/index.js +1 -1
- package/dist/{Token-DTGUCgpn.js → Token-DZmmnHEj.js} +1 -1
- package/dist/Tokenizer/index.js +1 -1
- package/dist/{Tokenizer-nSEekhN1.js → Tokenizer-DsPtN6tZ.js} +13 -13
- package/dist/Toolbar/index.d.ts +2 -2
- package/dist/Tooltip/index.d.ts +1 -1
- package/dist/Tooltip/index.js +2 -2
- package/dist/{Tooltip-CxzlUVN0.js → Tooltip-DhV7MkwU.js} +1 -1
- package/dist/TopNav/index.d.ts +1 -1
- package/dist/TopNav/index.js +1 -1
- package/dist/{TopNav-CcIayfsW.js → TopNav-Djli-IEz.js} +5 -5
- package/dist/TreeList/index.d.ts +1 -1
- package/dist/TreeList/index.js +1 -1
- package/dist/{TreeList-CsgXzBdm.js → TreeList-CqJ3xfhB.js} +3 -4
- package/dist/Typeahead/index.js +2 -2
- package/dist/{Typeahead-BD6xXNKh.js → Typeahead-Dowds5Z-.js} +6 -6
- package/dist/{VelocityTracker-DgjmootV.js → VelocityTracker-DVbtTSXR.js} +1 -1
- package/dist/{useMenuDrillIn-CMsgOcDP.js → accessibleName-CINO01Ek.js} +117 -27
- package/dist/{animator-C0kqgDUJ.js → animator-DLWdws2R.js} +3 -2
- package/dist/{assertOptions-DHfonaBU.js → assertOptions-BCEzojGr.js} +1 -1
- package/dist/composables/index.d.ts +3 -3
- package/dist/composables/index.js +13 -13
- package/dist/{composables-CVvk9709.js → composables-B7FrCjk6.js} +11 -7
- package/dist/{context-ZWA02GaM.js → context-C_rX8KGX.js} +1 -2
- package/dist/cssValues-Cr6PhYTx.js +223 -0
- package/dist/{pressGesture-BzIBmKF2.js → gestures-C8VhWve7.js} +2 -296
- package/dist/{index-DH_xZI84.d.ts → index-B-Z4GL8g.d.ts} +2 -2
- package/dist/{index-DYabo8TI.d.ts → index-B44fLswd.d.ts} +2 -2
- package/dist/{index-etx25Eq-.d.ts → index-Bwh8O-v8.d.ts} +1 -1
- package/dist/{index-mK1ICsVg.d.ts → index-C3JmGujU.d.ts} +1 -1
- package/dist/{index-CKnr0JlT.d.ts → index-C4S65SAW.d.ts} +1 -1
- package/dist/{index-D05JGsT3.d.ts → index-C8wfe0Mr.d.ts} +1 -1
- package/dist/{index-DE-QPNz0.d.ts → index-C943VIzi.d.ts} +3 -2
- package/dist/{index-DVX2jlTQ.d.ts → index-CUuUoX3h.d.ts} +1 -1
- package/dist/{index-COgrQZIL.d.ts → index-CdvmnNMH.d.ts} +1 -1
- package/dist/{index-C_iTVOHQ.d.ts → index-CilCxEvD.d.ts} +1 -1
- package/dist/{index-BgT6mH3U.d.ts → index-D7ShT2c-.d.ts} +1 -1
- package/dist/{index-ZKBj_1nu.d.ts → index-D8l_CmL-.d.ts} +1 -1
- package/dist/{index-DbNGGCM0.d.ts → index-DAz4l6Jw.d.ts} +1 -1
- package/dist/{index-DtY_R6Oh.d.ts → index-DIkdln91.d.ts} +2 -2
- package/dist/{index-Bh-GqMzd.d.ts → index-DLE-sASO.d.ts} +31 -3
- package/dist/{index-Q1oG9yIT.d.ts → index-DPklTi3o.d.ts} +1 -1
- package/dist/{index-DofC9Rll.d.ts → index-Dk50Zh3F.d.ts} +2 -2
- package/dist/{index-CG6dbyeb.d.ts → index-DoYrlaEI.d.ts} +3 -3
- package/dist/{index-CuW4AQ7M.d.ts → index-In41wHf3.d.ts} +2 -2
- package/dist/{index-utZGF4GR.d.ts → index-NOXYEdOI.d.ts} +1 -1
- package/dist/{index-Dp6MmjIo.d.ts → index-Rz4jwv4Q.d.ts} +52 -52
- package/dist/{index-0RIgvtdm.d.ts → index-ZXrvTM3A.d.ts} +2 -2
- package/dist/{index-CEtFUoIm.d.ts → index-o3JHyrk8.d.ts} +1 -1
- package/dist/{index-CtYlR9Cu.d.ts → index-rdwI-mcm.d.ts} +1 -1
- package/dist/{index-C89cIh4E.d.ts → index-waTkqxTz.d.ts} +1 -1
- package/dist/index.d.ts +29 -29
- package/dist/index.js +110 -110
- package/dist/{batch-DPlrpYU6.js → landing-DrnLUanQ.js} +812 -4
- package/dist/{layerDepth-D3Rh8T5C.js → layerDepth-BdZX0xSD.js} +2 -2
- package/dist/lazyBottomSheet-BUXYsz28.js +25 -0
- package/dist/linearEasing-BxWjPql6.js +282 -0
- package/dist/locale/index.js +3 -3
- package/dist/{locale-CVpkedoa.js → locale-C9LWi1y1.js} +1 -1
- package/dist/{menuActivation-BqiaK6ot.js → menuActivation-BQqnzKAX.js} +8 -1
- package/dist/{pressFeedback-9dqGYjxv.js → pressFeedback-CPzGi_88.js} +2 -1
- package/dist/pressGesture-BV4fYPIG.js +103 -0
- package/dist/resizableChannel-BeoqCSou.js +387 -0
- package/dist/resolveMotion-BLdMNTpf.js +117 -0
- package/dist/resolveSnapPoint-DygD-wmL.js +110 -0
- package/dist/roles-CPMsH5Ob.js +196 -0
- package/dist/rubberBand-DecgmtDj.js +123 -0
- package/dist/{resolveSnapPoint-DdZyBkT4.js → springs-BR66JuIm.js} +2 -182
- package/dist/{stillPointerGate-BbMABRyU.js → stillPointerGate-BChxtcd6.js} +1 -1
- package/dist/{themeTiming-D1U0redl.js → themeTiming-BA_wpgEn.js} +1 -1
- package/dist/{tooltipFocusRules-CpUOvFEU.js → tooltipFocusRules-CU8eUu3v.js} +2 -2
- package/dist/{tooltipTriggerRules-zN2xGd9K.js → tooltipTriggerRules-CKfpQu9d.js} +1 -1
- package/dist/{useActionGroupTracking-CLFF7FI2.js → useActionGroupTracking-iv0p__dY.js} +3 -3
- package/dist/{useAnimatedLayout-DWWc31RR.js → useAnimatedLayout-B_mZd526.js} +1 -1
- package/dist/{useAttachment-BuNyeUXy.js → useAttachment-BohgLE3o.js} +3 -3
- package/dist/{useCombobox-BqkTY3bw.js → useCombobox-BYRrwLe-.js} +1 -1
- package/dist/{useDismiss-BKtyCwx4.js → useDismiss-Qq0hUJoO.js} +1 -1
- package/dist/{useFocusTrap-BD9POtMp.js → useFocusTrap-CX-qEF-G.js} +1 -1
- package/dist/{useInputStatusIcon-BqV6YzTV.js → useInputStatusIcon-CYvxaJvt.js} +1 -1
- package/dist/{useMenuPress-DcwVUsQO.js → useMenuPress-DDvcJNRd.js} +72 -5
- package/dist/{usePressFeedback-DHdmAsMp.js → usePressFeedback-BuyFZkQO.js} +1 -1
- package/dist/{useResizable-hv4NYIUi.js → useResizable-BIaZZDJ2.js} +411 -85
- package/dist/{useResizable-CJd4JkbJ.d.ts → useResizable-CKDaU_se.d.ts} +10 -8
- package/dist/{useTooltip-DvBKna-w.js → useTooltip-CgJi5QQW.js} +4 -4
- package/dist/{useTouchHitArea-SY1ITxSJ.js → useTouchHitArea-Dsz80HzY.js} +1 -1
- package/dist/{useTouchTriggerInternal-Bl602PtA.js → useTouchTriggerInternal-BapohoUw.js} +1 -1
- package/dist/{useTruncationTooltip-DNAii2Nv.js → useTruncationTooltip-x1cQd8of.js} +3 -3
- package/dist/{useTypeahead-BGpvWkzm.js → useTypeahead-CZuT8Niw.js} +1 -1
- package/dist/{useTypeaheadMenuConfig-BT9Lwsu7.js → useTypeaheadMenuConfig-BMd42XKb.js} +2 -2
- package/package.json +1 -1
- package/styles/dropdown-menu.css +5 -0
- package/styles/resize-handle.css +2 -0
- package/dist/DropdownMenu-B_KDdI8P.js +0 -489
- package/dist/edge-DFaE6rUg.js +0 -164
- package/dist/edgeRide-UdNxbwxY.js +0 -500
- package/dist/handle-CwxCHapJ.js +0 -22
- package/dist/landing-CSCE9afT.js +0 -105
- package/dist/lazyBottomSheet-CbU1Pnfk.js +0 -16
- package/dist/linearEasing-BiRVC8Mq.js +0 -98
- package/dist/resizableChannel-LElsNkSY.js +0 -33
- package/dist/resolveMotion-B9NDPeUz.js +0 -508
- package/dist/useSubmenuMode-CZN9qrUo.js +0 -37
- package/dist/{index-BqhgeAT4.d.ts → index-D8lv2BiD.d.ts} +1 -1
- 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$
|
|
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$
|
|
5
|
-
import { n as usePositionedLayer, t as useDismiss } from "./useDismiss-
|
|
6
|
-
import { t as _sfc_main$
|
|
4
|
+
import { t as _sfc_main$9 } from "./Button-X7k1WCkW.js";
|
|
5
|
+
import { n as usePositionedLayer, t as useDismiss } from "./useDismiss-Qq0hUJoO.js";
|
|
6
|
+
import { t as _sfc_main$10 } from "./LayerContentBoundary-XvH9wmdg.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 {
|
|
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-DDvcJNRd.js";
|
|
10
12
|
import { t as useOverflow } from "./useOverflow-GU0pxGaU.js";
|
|
11
|
-
import { t as useTypeahead } from "./useTypeahead-
|
|
13
|
+
import { t as useTypeahead } from "./useTypeahead-CZuT8Niw.js";
|
|
12
14
|
import { t as useScrollbars } from "./useScrollbars-Ch0xqJWO.js";
|
|
13
|
-
import { t as
|
|
14
|
-
import {
|
|
15
|
+
import { n as isModifiedClick, r as keepDisabledRowUnfocused, t as activateMenuItem } from "./menuActivation-BQqnzKAX.js";
|
|
16
|
+
import { t as _sfc_main$11 } from "./Item-C9Cs0Jqr.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-CINO01Ek.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-
|
|
19
|
-
import { t as _sfc_main$
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
21
|
+
import { t as LazyBottomSheet } from "./lazyBottomSheet-BUXYsz28.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$
|
|
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$
|
|
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$
|
|
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$
|
|
76
|
-
const _sfc_main$
|
|
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$
|
|
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$
|
|
88
|
-
const _sfc_main$
|
|
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 :
|
|
104
|
-
}, [hasTitle() ? (openBlock(), createBlock(_sfc_main$
|
|
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")],
|
|
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$
|
|
128
|
+
const _hoisted_1$3 = {
|
|
117
129
|
key: 0,
|
|
118
130
|
class: "astryx-item__start"
|
|
119
131
|
};
|
|
120
|
-
const _hoisted_2$
|
|
121
|
-
const _hoisted_3$
|
|
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$
|
|
137
|
+
const _hoisted_4$2 = {
|
|
126
138
|
key: 1,
|
|
127
139
|
class: "astryx-item__description"
|
|
128
140
|
};
|
|
129
|
-
const _hoisted_5$
|
|
141
|
+
const _hoisted_5$2 = {
|
|
130
142
|
key: 1,
|
|
131
143
|
class: "astryx-item__end"
|
|
132
144
|
};
|
|
133
|
-
const _sfc_main$
|
|
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
|
|
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:
|
|
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$
|
|
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$
|
|
244
|
-
hasEnd.value ? (openBlock(), createElementBlock("span", _hoisted_5$
|
|
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$
|
|
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:
|
|
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$
|
|
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/
|
|
312
|
-
|
|
313
|
-
|
|
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
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
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
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
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
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
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
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
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
|
|
350
|
-
if (
|
|
351
|
-
|
|
352
|
-
return
|
|
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
|
-
*
|
|
356
|
-
*
|
|
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
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
key
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
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
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
]
|
|
577
|
-
|
|
578
|
-
|
|
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
|
|
545
|
+
return result;
|
|
599
546
|
}
|
|
600
547
|
/**
|
|
601
|
-
*
|
|
548
|
+
* Keyboard between a menu and the header and footer beside it.
|
|
602
549
|
*
|
|
603
|
-
*
|
|
604
|
-
*
|
|
605
|
-
*
|
|
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
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
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
|
|
618
|
-
const
|
|
619
|
-
|
|
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
|
|
622
|
-
|
|
585
|
+
function onRegionKeydown(event) {
|
|
586
|
+
if (event.key === "Tab") moveDialogTab(event);
|
|
623
587
|
}
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
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
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
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
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
750
|
+
/**
|
|
751
|
+
* 焦点回到触发行。行的 `focus()` 只会找里面的链接或按钮,子菜单这一行两者都没有,
|
|
752
|
+
* 所以直接聚焦行元素本身。
|
|
753
|
+
*/
|
|
754
|
+
function focusRowElement() {
|
|
755
|
+
rowRef.value?.focus();
|
|
756
|
+
nextTick(() => rowRef.value?.focus());
|
|
676
757
|
}
|
|
677
|
-
function
|
|
678
|
-
|
|
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
|
-
|
|
681
|
-
|
|
682
|
-
|
|
771
|
+
/** 关掉这一层,再让上面各层一路关到根菜单。 */
|
|
772
|
+
function closeWholeMenu() {
|
|
773
|
+
closeFlyout(false);
|
|
774
|
+
menu?.closeMenu();
|
|
683
775
|
}
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
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
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
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
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
}
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
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
|
-
|
|
723
|
-
focusFirst,
|
|
724
|
-
focusItem,
|
|
725
|
-
focusLast,
|
|
726
|
-
getItems,
|
|
727
|
-
handleKeyDown,
|
|
728
|
-
ownsEvent
|
|
729
|
-
};
|
|
730
|
-
}
|
|
1055
|
+
});
|
|
731
1056
|
//#endregion
|
|
732
|
-
//#region src/DropdownMenu/
|
|
733
|
-
|
|
734
|
-
|
|
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
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
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
|
|
758
|
-
|
|
759
|
-
return
|
|
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
|
-
*
|
|
763
|
-
*
|
|
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
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
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
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
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
|
-
|
|
789
|
-
|
|
1319
|
+
});
|
|
1320
|
+
//#endregion
|
|
1321
|
+
//#region src/DropdownMenu/useMenuNaming.ts
|
|
790
1322
|
/**
|
|
791
|
-
*
|
|
1323
|
+
* 菜单面板、对话框和底部弹层的名字与 id。
|
|
792
1324
|
*
|
|
793
|
-
*
|
|
794
|
-
*
|
|
795
|
-
* menu's stop, so Shift+Tab from a row lands on the header.
|
|
1325
|
+
* 内置按钮开的菜单以按钮文字命名;自定义触发器开的菜单以调用方的 `aria-label`
|
|
1326
|
+
* 命名,没有就用触发器自己的可访问名称,不再一律叫「Menu」。
|
|
796
1327
|
*/
|
|
797
|
-
function
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
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
|
-
|
|
833
|
-
|
|
834
|
-
|
|
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: {
|
|
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 =
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
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
|
|
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 (
|
|
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$
|
|
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$
|
|
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$
|
|
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 };
|