@astryx-vue/core 0.2.2 → 0.2.4
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/THIRD_PARTY_NOTICES.md +4 -0
- package/dist/AlertDialog/index.js +1 -1
- package/dist/{AlertDialog-ovx4cBjM.js → AlertDialog-B6UeBCE7.js} +2 -2
- package/dist/AppShell/index.js +1 -1
- package/dist/{AppShell-Cb41gIAj.js → AppShell-CeBmB0Q9.js} +2 -2
- package/dist/Avatar/index.d.ts +1 -1
- package/dist/Avatar/index.js +1 -1
- package/dist/{Avatar-jmHInHwj.js → Avatar-BB4Z4LF1.js} +10 -4
- package/dist/AvatarGroup/index.d.ts +1 -1
- package/dist/Banner/index.d.ts +1 -1
- package/dist/BottomSheet/index.d.ts +2 -2
- package/dist/BottomSheet/index.js +3 -2
- package/dist/{BottomSheet-Dg95HB1s.js → BottomSheet-BV6vfgGu.js} +82 -22
- package/dist/BottomSheet-o7xw-TOi.js +153 -0
- package/dist/Breadcrumbs/index.d.ts +3 -2
- package/dist/Breadcrumbs/index.js +3 -2
- package/dist/{Breadcrumbs-CTQ7fjDn.js → Breadcrumbs-D6G7f5WL.js} +13 -8
- package/dist/Button/index.d.ts +1 -1
- package/dist/ButtonGroup/index.d.ts +1 -1
- package/dist/Calendar/index.d.ts +2 -2
- package/dist/Calendar/index.js +1 -1
- package/dist/Calendar-DmTeM7PO.js +656 -0
- package/dist/Carousel/index.js +1 -1
- package/dist/{Carousel-X0cuQkvg.js → Carousel-CIKrcA2r.js} +2 -2
- package/dist/Chat/index.d.ts +1 -1
- package/dist/Chat/index.js +1 -1
- package/dist/{Chat-M0tiGrNT.js → Chat-BFox3u9D.js} +3 -3
- package/dist/CheckboxIndicator/index.js +1 -1
- package/dist/CheckboxIndicator-D37cm2Rh.js +68 -0
- package/dist/CheckboxInput/index.d.ts +1 -1
- package/dist/CheckboxInput/index.js +1 -1
- package/dist/{CheckboxInput-CMsEE1_4.js → CheckboxInput-25Q8ItH-.js} +10 -9
- package/dist/CheckboxList/index.d.ts +1 -1
- package/dist/CheckboxList/index.js +1 -1
- package/dist/{CheckboxList-BbCPiend.js → CheckboxList-BlPf7vPe.js} +78 -25
- package/dist/Citation/index.js +1 -1
- package/dist/{Citation-C1veUk5p.js → Citation-BG-vg9ia.js} +2 -2
- package/dist/ClickableCard/index.d.ts +1 -1
- package/dist/Code/index.d.ts +3 -3
- package/dist/Code/index.js +4 -4
- package/dist/{Code-yb_KOFtJ.js → Code-XnPuGxey.js} +3 -2
- package/dist/{CodeBlock-DesTJAkm.js → CodeBlock-B2pnEOJY.js} +146 -16
- package/dist/Collapsible/index.js +1 -1
- package/dist/{Collapsible-BestK35V.js → Collapsible-3YerR-FO.js} +1 -1
- package/dist/CommandPalette/index.js +1 -1
- package/dist/{CommandPalette-BArt97V8.js → CommandPalette-DKgHzmJk.js} +10 -10
- package/dist/ComplexSelector/index.d.ts +1 -1
- package/dist/ComplexSelector/index.js +1 -1
- package/dist/{ComplexSelector-CAoig1RK.js → ComplexSelector-Dv44FFhN.js} +3 -3
- package/dist/ContextMenu/index.d.ts +3 -2
- package/dist/ContextMenu/index.js +3 -2
- package/dist/{ContextMenu-9Im6i43E.js → ContextMenu-BeJO5HYx.js} +206 -423
- package/dist/DateInput/index.d.ts +2 -2
- package/dist/DateInput/index.js +1 -1
- package/dist/DateInput-D4XFAEMp.js +743 -0
- package/dist/DateRangeInput/index.d.ts +1 -1
- package/dist/DateRangeInput/index.js +1 -1
- package/dist/{DateRangeInput-DwDy3eRo.js → DateRangeInput-Cp6AZfew.js} +54 -19
- package/dist/DateTimeInput/index.d.ts +1 -1
- package/dist/DateTimeInput/index.js +1 -1
- package/dist/{DateTimeInput-BYiaC9bn.js → DateTimeInput-B6MPPp76.js} +54 -15
- package/dist/Divider/index.d.ts +1 -1
- package/dist/DropdownMenu/index.d.ts +3 -3
- package/dist/DropdownMenu/index.js +4 -3
- package/dist/{DropdownMenu-Dh-WAHKb.js → DropdownMenu--lnUeJEG.js} +309 -64
- package/dist/DropdownMenu-6E9jFdFe.js +325 -0
- package/dist/DropdownMenuRadioItem.vue-CXEURBcq.d.ts +564 -0
- package/dist/EmptyState/index.js +1 -1
- package/dist/{EmptyState-CUJdTYKV.js → EmptyState-0RWymQUS.js} +2 -2
- package/dist/FileInput/index.d.ts +1 -1
- package/dist/FileInput/index.js +1 -1
- package/dist/{FileInput-DLO6V12n.js → FileInput-DuNwdbAo.js} +2 -2
- package/dist/Grid/index.d.ts +1 -1
- package/dist/Heading/index.d.ts +2 -2
- package/dist/Heading/index.js +1 -1
- package/dist/Heading-B9C3LZlS.js +94 -0
- package/dist/Icon/index.d.ts +4 -3
- package/dist/Icon/index.js +2 -2
- package/dist/{Icon-CJKjdJy-.js → Icon-bteSId7T.js} +113 -18
- package/dist/Indicator/index.d.ts +3 -0
- package/dist/Indicator/index.js +2 -0
- package/dist/InputGroup/index.d.ts +2 -2
- package/dist/InputGroup/index.js +3 -2
- package/dist/InputGroup-BzR6JRZb.js +129 -0
- package/dist/Item-DrYJL1TG.js +590 -0
- package/dist/Lightbox/index.js +1 -1
- package/dist/{Lightbox-CdFCS_EA.js → Lightbox-Br3o0SyQ.js} +2 -2
- package/dist/Link/index.d.ts +3 -2
- package/dist/Link/index.js +1 -1
- package/dist/Link-DCZ6922-.js +196 -0
- package/dist/List/index.d.ts +3 -3
- package/dist/List/index.js +2 -2
- package/dist/{ListItem-pGxvn6QJ.js → ListItem-CcRHWuEm.js} +8 -2
- package/dist/Markdown/index.d.ts +2 -2
- package/dist/Markdown/index.js +2 -2
- package/dist/{Markdown-BqKloI3w.js → Markdown-Bz0R3kNj.js} +280 -33
- package/dist/MetadataList/index.js +1 -1
- package/dist/{MetadataList-CvZkmisf.js → MetadataList-CFaocx6j.js} +1 -1
- package/dist/MobileNav/index.js +1 -1
- package/dist/{MobileNavToggle-Bwi0qXXM.js → MobileNavToggle-Dh3uLivq.js} +1 -1
- package/dist/MoreMenu/index.d.ts +1 -1
- package/dist/MoreMenu/index.js +1 -1
- package/dist/{MoreMenu-BwJaJrkB.js → MoreMenu-B95nRSe8.js} +3 -3
- package/dist/MultiSelector/index.d.ts +2 -2
- package/dist/MultiSelector/index.js +1 -1
- package/dist/{MultiSelector-C-ETfFy_.js → MultiSelector-DuF5TECE.js} +304 -122
- package/dist/{NavDisclosure-DHrSNRDR.js → NavDisclosure-C6sPZ89n.js} +5 -2
- package/dist/NavHeadingSurface-Cb3x9iDx.js +287 -0
- package/dist/NavMenu/index.d.ts +2 -2
- package/dist/NavMenu/index.js +4 -3
- package/dist/NavMenu-ClIgMaxE.js +176 -0
- package/dist/{NavMenuItem-B-k7olt5.js → NavMenuItem-E7S8gBh-.js} +1 -1
- package/dist/NumberInput/index.d.ts +1 -1
- package/dist/NumberInput/index.js +1 -1
- package/dist/{NumberInput-DjetVB8O.js → NumberInput-B4IL3s_8.js} +1 -1
- package/dist/Outline/index.js +1 -1
- package/dist/{Outline-Bz9c-u5y.js → Outline-DBUuchi9.js} +1 -1
- package/dist/OverflowList/index.d.ts +1 -1
- package/dist/OverflowList/index.js +1 -1
- package/dist/{OverflowList-ED-KN9Y5.js → OverflowList-aDd_oem0.js} +3 -3
- package/dist/Pagination/index.d.ts +1 -1
- package/dist/Pagination/index.js +1 -1
- package/dist/{Pagination-Cb66HMEf.js → Pagination-CNe9F6Fl.js} +181 -45
- package/dist/Popover/index.js +1 -1
- package/dist/{Popover-Crhk9PNP.js → Popover-D7zqpFwU.js} +1 -1
- package/dist/PowerSearch/index.d.ts +1 -1
- package/dist/PowerSearch/index.js +1 -1
- package/dist/{PowerSearch-CjU8y4mi.js → PowerSearch-C6U8Sq1Y.js} +16 -16
- package/dist/ProgressBar/index.d.ts +2 -2
- package/dist/ProgressBar/index.js +1 -1
- package/dist/{ProgressBar-DO9Chic6.js → ProgressBar-DF6WZNCI.js} +45 -6
- package/dist/Radio/index.d.ts +1 -1
- package/dist/Radio/index.js +1 -1
- package/dist/{RadioGroup-BqjdSCfJ.js → RadioGroup-CBqUPq_L.js} +16 -8
- package/dist/RadioList/index.d.ts +1 -1
- package/dist/RadioList/index.js +1 -1
- package/dist/{RadioList-DI8ujXcT.js → RadioList-CPOJn9Th.js} +1 -1
- package/dist/Resizable/index.js +1 -1
- package/dist/{Resizable-D-TBCg0Y.js → ResizeHandle-DYy0e3v9.js} +1 -1
- package/dist/ScrollableArea/index.d.ts +1 -1
- package/dist/SelectableCard/index.d.ts +1 -1
- package/dist/Selector/index.d.ts +2 -2
- package/dist/Selector/index.js +1 -1
- package/dist/Selector-5N-hq2nF.js +618 -0
- package/dist/SideNav/index.d.ts +2 -2
- package/dist/SideNav/index.js +1 -1
- package/dist/{SideNav-DonEfiAx.js → SideNav-CT9lfspi.js} +226 -230
- package/dist/Stepper/index.js +1 -1
- package/dist/{Stepper-D2ZIcUNx.js → Stepper-BqhVCgC-.js} +1 -1
- package/dist/Switch/index.d.ts +1 -1
- package/dist/TabList/index.js +1 -1
- package/dist/{TabList-D3F-stq-.js → TabList-BlzkrObv.js} +2 -2
- package/dist/Table/index.js +1 -1
- package/dist/{Table-CrP2Uffq.js → Table-CsdH8fCB.js} +7 -7
- package/dist/Text/index.d.ts +3 -3
- package/dist/Text/index.js +1 -1
- package/dist/Text-DIzZw6FA.js +86 -0
- package/dist/TextArea/index.d.ts +1 -1
- package/dist/TextInput/index.d.ts +1 -1
- package/dist/Theme/index.d.ts +3 -2
- package/dist/Theme/index.js +2 -2
- package/dist/Theme-CtaUWo4g.js +1246 -0
- package/dist/Thumbnail/index.js +1 -1
- package/dist/{Thumbnail-BC5JGPGZ.js → Thumbnail-BnQwX1cQ.js} +3 -3
- package/dist/{TimeField-DpHFrNv0.js → TimeField-Biiuv0hB.js} +2 -2
- package/dist/TimeInput/index.d.ts +1 -1
- package/dist/TimeInput/index.js +1 -1
- package/dist/{TimeInput-DJLV0_4z.js → TimeInput-C9gptCOK.js} +1 -1
- package/dist/Timer/index.d.ts +1 -1
- package/dist/Timer/index.js +1 -1
- package/dist/{Timer-B7GV6hqd.js → Timer-kxzQx3tp.js} +1 -1
- package/dist/Timestamp/index.d.ts +1 -1
- package/dist/Timestamp/index.js +1 -1
- package/dist/{Timestamp-GKNjjt5g.js → Timestamp-D7bd_nF3.js} +3 -3
- package/dist/ToggleButton/index.d.ts +1 -1
- package/dist/Token/index.d.ts +1 -1
- package/dist/Token/index.js +1 -1
- package/dist/{Token-Chu_eCVs.js → Token-D2GsI_Ei.js} +2 -2
- package/dist/Tokenizer/index.d.ts +1 -1
- package/dist/Tokenizer/index.js +1 -1
- package/dist/{Tokenizer-DRDpvQ_l.js → Tokenizer-rwzamZg4.js} +4 -4
- package/dist/Toolbar/index.d.ts +1 -1
- package/dist/Tooltip/index.d.ts +1 -1
- package/dist/Tooltip/index.js +1 -1
- package/dist/{Tooltip-mp0NMh_Y.js → Tooltip-C2fh9anJ.js} +23 -8
- package/dist/TopNav/index.d.ts +1 -1
- package/dist/TopNav/index.js +1 -1
- package/dist/{TopNav-CEyWddtA.js → TopNav-arWFLTBM.js} +113 -43
- package/dist/TreeList/index.js +1 -1
- package/dist/{TreeList-COS8US8e.js → TreeList-C9xvMpJZ.js} +2 -2
- package/dist/Typeahead/index.d.ts +2 -2
- package/dist/Typeahead/index.js +3 -2
- package/dist/Typeahead-_V11btpv.js +499 -0
- package/dist/{TypeaheadMenu-CGvo0Tud.js → TypeaheadMenu-BEObzonz.js} +46 -10
- package/dist/{context-O2Vb8cJl.js → colorMode-CBgdgDSn.js} +1 -7
- package/dist/composables/index.d.ts +2 -2
- package/dist/composables/index.js +12 -7
- package/dist/composables-CWw6t-RJ.js +520 -0
- package/dist/{context-CiKncNSH.js → context-CPh7kE-a.js} +140 -18
- package/dist/context-Cws_tXTr.js +7 -0
- package/dist/context-D5-MwxnN.js +4 -0
- package/dist/{index-CJlBAXwj.d.ts → index-12QYAbiz.d.ts} +41 -4
- package/dist/{index-Cs5pcwY3.d.ts → index-6yB8BtEu.d.ts} +3 -3
- package/dist/{index-C7mxUcDR.d.ts → index-B4OOtNP8.d.ts} +2 -2
- package/dist/index-BBtJt5_A.d.ts +26 -0
- package/dist/{index-CRizexSC.d.ts → index-BH9PzQ1F.d.ts} +13 -73
- package/dist/index-BPwD6aBv.d.ts +83 -0
- package/dist/{index-DOUEn7V0.d.ts → index-BcZI402h.d.ts} +64 -5
- package/dist/{index-C8wDPDcP.d.ts → index-Bi49IrAJ.d.ts} +50 -8
- package/dist/{index-DimuSES0.d.ts → index-BlOIC_AM.d.ts} +3 -1
- package/dist/{index-C5p2NeCr.d.ts → index-Blm197N_.d.ts} +11 -2
- package/dist/{index-Bu3oXIIS.d.ts → index-BmmdzwT9.d.ts} +6 -0
- package/dist/{index-kVhSuA9t.d.ts → index-BxhJqiZ7.d.ts} +6 -6
- package/dist/{index-HV6W3xCx.d.ts → index-Byar3h1e.d.ts} +1 -1
- package/dist/{index-qiZtHnGK.d.ts → index-C3GaPqvJ.d.ts} +123 -8
- package/dist/{index-D4I_obqR.d.ts → index-CFIXnk5D.d.ts} +1 -1
- package/dist/{index-cGagYM1g.d.ts → index-CI9kyg74.d.ts} +11 -1
- package/dist/{index-D-ZuubCK.d.ts → index-CUCcYKxl.d.ts} +1 -1
- package/dist/{index-DWH_HzXi.d.ts → index-ChWlKHjc.d.ts} +1 -1
- package/dist/{index-DGXviOlp.d.ts → index-D-ezcKaY.d.ts} +30 -4
- package/dist/{index-Cm_TiLXU.d.ts → index-Dgg0bHVM.d.ts} +7 -3
- package/dist/index-DxR1FChm.d.ts +158 -0
- package/dist/{index-DNRBbwp_.d.ts → index-EtZgovdH.d.ts} +842 -107
- package/dist/{index-BHqRH7QW.d.ts → index-FEy8qFSD.d.ts} +2 -2
- package/dist/index-XuAAcYiP.d.ts +77 -0
- package/dist/{index-D0TlUOtG.d.ts → index-YmSe1ujk.d.ts} +76 -3
- package/dist/{index-BMrggCw-.d.ts → index-bvr3WHvs.d.ts} +1 -1
- package/dist/{index-CDDMDHJM.d.ts → index-c67ca7eJ.d.ts} +1 -1
- package/dist/{index-c_TaW8mM.d.ts → index-cL3q7O4R.d.ts} +31 -2
- package/dist/{index-CGZ2xi3r.d.ts → index-eshFLli0.d.ts} +40 -3
- package/dist/{index-DsyKhauk.d.ts → index-hCpxKePE.d.ts} +48 -2
- package/dist/{index-u5ozu0G7.d.ts → index-vP0EtrJJ.d.ts} +13 -3
- package/dist/{index-B1TG2GPS.d.ts → index-vizlhXVs.d.ts} +246 -45
- package/dist/{index-DfgHJE7H.d.ts → index-z3uLM1O6.d.ts} +153 -24
- package/dist/index.d.ts +82 -80
- package/dist/index.js +127 -116
- package/dist/locale/index.d.ts +2 -2
- package/dist/locale/index.js +3 -3
- package/dist/locale-sLw5Caia.js +917 -0
- package/dist/searchResultMessage-CCnq-_ce.js +94 -0
- package/dist/semantic-CKH9XVqa.d.ts +54 -0
- package/dist/syntaxTheme-CwVEcVDk.d.ts +57 -0
- package/dist/{syntaxTheme-ClpWALZX.js → syntaxTheme-R7xnu5x5.js} +24 -3
- package/dist/{types-pnljWjEE.d.ts → types-CwyibrRB.d.ts} +12 -11
- package/dist/{types-Bt-lSgYX.d.ts → types-D9nP_X-c.d.ts} +14 -1
- package/dist/{types-CAZY4Xua.d.ts → types-DGYHIu4I.d.ts} +30 -1
- package/dist/types-D_J66aPN.d.ts +85 -0
- package/dist/types-gKsEkk2g.d.ts +320 -0
- package/dist/{useAnchoredListbox-7W90Ny-9.js → useAnchoredListbox-BN9LQnon.js} +1 -1
- package/dist/useDatePresentation-C07PnOCw.js +21 -0
- package/dist/{useMonthGrid-CmJsZTcB.js → useDateRange-CIXoE_8k.js} +1 -42
- package/dist/useDisclosureHandle-Df3HhAfC.js +24 -0
- package/dist/{useDismiss-CAiHU6QD.js → useDismiss-Cj8x_51F.js} +8 -4
- package/dist/useFieldControlState-voICDrys.js +18 -0
- package/dist/useHandleRef-6cdKugm8.js +17 -0
- package/dist/useIndicator-i1NORM7W.js +147 -0
- package/dist/useMenuDrillIn-BgjJcY3K.js +520 -0
- package/dist/useMenuPress-DUmEy4TB.js +425 -0
- package/dist/useMonthGrid-fGHSSrFc.js +43 -0
- package/dist/usePendingChange-ib-h8FZK.js +25 -0
- package/dist/{composables-CVfjp9h4.js → useResizable-B3ahKLoZ.js} +74 -152
- package/dist/useSubmenuMode-CZN9qrUo.js +37 -0
- package/dist/useTruncation-B5qXQzAP.js +53 -0
- package/locales/SOURCE.json +37 -0
- package/locales/af-ZA.json +1482 -0
- package/locales/ar-SA.json +1482 -0
- package/locales/ca-ES.json +1482 -0
- package/locales/cs-CZ.json +1482 -0
- package/locales/da-DK.json +1482 -0
- package/locales/de-DE.json +1482 -0
- package/locales/el-GR.json +1482 -0
- package/locales/en.json +1646 -0
- package/locales/es-ES.json +1482 -0
- package/locales/fi-FI.json +1482 -0
- package/locales/fr-FR.json +1482 -0
- package/locales/he-IL.json +1482 -0
- package/locales/hu-HU.json +1482 -0
- package/locales/it-IT.json +1482 -0
- package/locales/ja-JP.json +1482 -0
- package/locales/ko-KR.json +1482 -0
- package/locales/nl-NL.json +1482 -0
- package/locales/no-NO.json +1482 -0
- package/locales/pl-PL.json +1482 -0
- package/locales/pt-BR.json +1482 -0
- package/locales/pt-PT.json +1482 -0
- package/locales/ro-RO.json +1482 -0
- package/locales/ru-RU.json +1482 -0
- package/locales/sr-SP.json +1482 -0
- package/locales/sv-SE.json +1482 -0
- package/locales/tr-TR.json +1482 -0
- package/locales/uk-UA.json +1482 -0
- package/locales/vi-VN.json +1482 -0
- package/locales/zh-CN.json +1482 -0
- package/locales/zh-TW.json +1482 -0
- package/package.json +7 -1
- package/styles/bottom-sheet.css +27 -0
- package/styles/calendar.css +38 -3
- package/styles/check-indicator.css +17 -0
- package/styles/checkbox-indicator.css +29 -10
- package/styles/checkbox-input.css +0 -11
- package/styles/code.css +62 -0
- package/styles/container-reveal.css +104 -0
- package/styles/date-input.css +48 -0
- package/styles/dropdown-menu.css +163 -0
- package/styles/field.css +48 -0
- package/styles/heading.css +47 -0
- package/styles/icon.css +51 -3
- package/styles/input-group.css +32 -3
- package/styles/keyboard-hint.css +28 -0
- package/styles/link.css +34 -0
- package/styles/list.css +88 -1
- package/styles/markdown.css +12 -0
- package/styles/multi-selector.css +26 -0
- package/styles/pagination.css +30 -0
- package/styles/progress-bar.css +49 -0
- package/styles/radio-indicator.css +90 -0
- package/styles/radio.css +9 -42
- package/styles/selector.css +112 -14
- package/styles/side-nav.css +36 -1
- package/styles/text.css +18 -0
- package/styles/top-nav.css +145 -6
- package/styles/typeahead.css +24 -0
- package/styles.css +4 -0
- package/dist/Calendar-BFaI5AMv.js +0 -352
- package/dist/CheckboxIndicator-DdJmksHt.js +0 -52
- package/dist/DateInput-BLocxqC3.js +0 -376
- package/dist/DropdownMenu-Ddfr-aEC.js +0 -164
- package/dist/Heading-Dugosn6j.js +0 -43
- package/dist/InputGroup-ChrFVxzV.js +0 -42
- package/dist/Item-C1z6gXn8.js +0 -289
- package/dist/Link-DqdQZ37C.js +0 -141
- package/dist/Selector-DE2IEFML.js +0 -468
- package/dist/Text-BHVghsWo.js +0 -53
- package/dist/Theme-BuUiiJNr.js +0 -429
- package/dist/Typeahead-P7cCqtaQ.js +0 -375
- package/dist/index-Bgv4ZmBl.d.ts +0 -72
- package/dist/index-DN7MXPHM.d.ts +0 -398
- package/dist/index-Dg3ZmwEg.d.ts +0 -75
- package/dist/index-IbUN4M8V.d.ts +0 -40
- package/dist/index-jdjcb3Js.d.ts +0 -80
- package/dist/locale-Cpk_nrLA.js +0 -18
- package/dist/syntaxTheme-Bcs1YMF7.d.ts +0 -38
- package/dist/types-DDAAT1Xd.d.ts +0 -285
- package/dist/useGridRovingFocus-DQQAOYH5.js +0 -99
- package/dist/useHotkeys-dABSK1o9.js +0 -80
- package/dist/useLongPress-Cyxwa73s.js +0 -60
- package/dist/{index-BUXNRekN.d.ts → index-IdK2g5B4.d.ts} +2 -2
|
@@ -1,33 +1,17 @@
|
|
|
1
1
|
import { t as useMediaQuery } from "./useMediaQuery-GMmgp28-.js";
|
|
2
|
-
import { t as useDismiss } from "./useDismiss-
|
|
3
|
-
import {
|
|
2
|
+
import { t as useDismiss } from "./useDismiss-Cj8x_51F.js";
|
|
3
|
+
import { o as useAstryxMessages } from "./context-CPh7kE-a.js";
|
|
4
|
+
import { a as useLongPress, i as useMenuNav, n as useMenuPress, r as isModifiedClick, t as resetMenuPress } from "./useMenuPress-DUmEy4TB.js";
|
|
4
5
|
import { n as useOverflow } from "./useOverflow-VrwF5oek.js";
|
|
5
6
|
import { t as usePositionedLayer } from "./usePositionedLayer-C1NBOsVT.js";
|
|
6
|
-
import { t as _sfc_main$6 } from "./BottomSheet-
|
|
7
|
-
import { t as _sfc_main$7 } from "./Icon-
|
|
8
|
-
import {
|
|
7
|
+
import { t as _sfc_main$6 } from "./BottomSheet-BV6vfgGu.js";
|
|
8
|
+
import { t as _sfc_main$7 } from "./Icon-bteSId7T.js";
|
|
9
|
+
import { c as contextMenuContextKey, d as useContextMenuSize, i as _sfc_main$8, l as submenuAncestorOpenKey, n as _sfc_main$10, r as _sfc_main$9, t as useMenuDrillIn, u as useContextMenu } from "./useMenuDrillIn-BgjJcY3K.js";
|
|
10
|
+
import { t as _sfc_main$11 } from "./Divider-BtwnL18I.js";
|
|
11
|
+
import { t as _sfc_main$12 } from "./Spinner-9cYUCnDy.js";
|
|
12
|
+
import { t as useSubmenuMode } from "./useSubmenuMode-CZN9qrUo.js";
|
|
9
13
|
import { Fragment, Teleport, Transition, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, inject, mergeModels, mergeProps, nextTick, normalizeClass, normalizeStyle, onBeforeUnmount, onMounted, onScopeDispose, openBlock, provide, ref, renderList, renderSlot, resolveComponent, resolveDynamicComponent, shallowRef, toDisplayString, unref, useAttrs, useId, useModel, useTemplateRef, vShow, watch, withCtx, withDirectives, withModifiers } from "vue";
|
|
10
14
|
import "../styles/context-menu.css";
|
|
11
|
-
//#region src/ContextMenu/context.ts
|
|
12
|
-
const contextMenuContextKey = Symbol("astryx-context-menu");
|
|
13
|
-
/**
|
|
14
|
-
* Whether the submenu flyout that contains this one is showing.
|
|
15
|
-
*
|
|
16
|
-
* Nested flyouts are teleported to `body`, so hiding an ancestor's DOM does
|
|
17
|
-
* not hide them. Each submenu provides its own `showsFlyout` for the next
|
|
18
|
-
* level; a row with no ancestor submenu reads as open.
|
|
19
|
-
*/
|
|
20
|
-
const submenuAncestorOpenKey = Symbol("astryx-submenu-ancestor-open");
|
|
21
|
-
/** The surrounding menu, or `undefined` when the row stands alone. */
|
|
22
|
-
function useContextMenu() {
|
|
23
|
-
return inject(contextMenuContextKey, void 0);
|
|
24
|
-
}
|
|
25
|
-
/** The row density of the surrounding menu, or the menu default. */
|
|
26
|
-
function useContextMenuSize() {
|
|
27
|
-
const menu = useContextMenu();
|
|
28
|
-
return computed(() => menu?.menuSize.value ?? "md");
|
|
29
|
-
}
|
|
30
|
-
//#endregion
|
|
31
15
|
//#region src/ContextMenu/ContextMenuDivider.vue
|
|
32
16
|
const _sfc_main$5 = /*@__PURE__*/ defineComponent({
|
|
33
17
|
name: "AstryxContextMenuDivider",
|
|
@@ -35,7 +19,7 @@ const _sfc_main$5 = /*@__PURE__*/ defineComponent({
|
|
|
35
19
|
props: { variant: { default: "subtle" } },
|
|
36
20
|
setup(__props) {
|
|
37
21
|
return (_ctx, _cache) => {
|
|
38
|
-
return openBlock(), createBlock(_sfc_main$
|
|
22
|
+
return openBlock(), createBlock(_sfc_main$11, {
|
|
39
23
|
class: "astryx-context-menu-divider",
|
|
40
24
|
variant: __props.variant
|
|
41
25
|
}, null, 8, ["variant"]);
|
|
@@ -67,233 +51,17 @@ const _sfc_main$4 = /*@__PURE__*/ defineComponent({
|
|
|
67
51
|
}
|
|
68
52
|
});
|
|
69
53
|
//#endregion
|
|
70
|
-
//#region src/ContextMenu/menuNav.ts
|
|
71
|
-
/**
|
|
72
|
-
* Roles a menu row can carry. The selectable roles sit alongside the plain
|
|
73
|
-
* one so every row is reachable by arrow keys, typeahead, and Enter/Space.
|
|
74
|
-
*/
|
|
75
|
-
const MENU_ITEM_ROLES = /* @__PURE__ */ new Set([
|
|
76
|
-
"menuitem",
|
|
77
|
-
"menuitemradio",
|
|
78
|
-
"menuitemcheckbox"
|
|
79
|
-
]);
|
|
80
|
-
/** Selector for the activatable rows of one menu level. */
|
|
81
|
-
const MENU_ITEM_SELECTOR = [...MENU_ITEM_ROLES].map((role) => `[role="${role}"]:not([aria-disabled="true"])`).join(",");
|
|
82
|
-
/** Selector for any menu level, used to scope a level's rows and key events. */
|
|
83
|
-
const MENU_BOUNDARY_SELECTOR = "[role=\"menu\"]";
|
|
84
|
-
/**
|
|
85
|
-
* Whether a click carries a modifier or a non-primary button. On a row that is
|
|
86
|
-
* a link the browser gives such a click a meaning of its own, which the row
|
|
87
|
-
* must leave alone.
|
|
88
|
-
*/
|
|
89
|
-
function isModifiedClick(event) {
|
|
90
|
-
return event.metaKey || event.ctrlKey || event.shiftKey || event.altKey || (event.button ?? 0) !== 0;
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Activate a row from the keyboard: a synthesized click that carries the key's
|
|
94
|
-
* modifiers, so a modified Enter on a link row opens the way a modified click
|
|
95
|
-
* would. `detail` stays 0, the mark of a non-pointer activation.
|
|
96
|
-
*/
|
|
97
|
-
function activateMenuItem(row, key) {
|
|
98
|
-
row.dispatchEvent(new MouseEvent("click", {
|
|
99
|
-
altKey: key.altKey,
|
|
100
|
-
bubbles: true,
|
|
101
|
-
cancelable: true,
|
|
102
|
-
composed: true,
|
|
103
|
-
ctrlKey: key.ctrlKey,
|
|
104
|
-
metaKey: key.metaKey,
|
|
105
|
-
shiftKey: key.shiftKey
|
|
106
|
-
}));
|
|
107
|
-
}
|
|
108
|
-
function isDisabledRow(row) {
|
|
109
|
-
return row.getAttribute("aria-disabled") === "true" || row.hasAttribute("disabled");
|
|
110
|
-
}
|
|
111
|
-
function isHiddenWithin(row, container) {
|
|
112
|
-
let current = row;
|
|
113
|
-
while (current != null && current !== container) {
|
|
114
|
-
if (current.hidden || current.getAttribute("aria-hidden") === "true") return true;
|
|
115
|
-
current = current.parentElement;
|
|
116
|
-
}
|
|
117
|
-
return false;
|
|
118
|
-
}
|
|
119
|
-
const TYPEAHEAD_RESET_MS = 750;
|
|
120
|
-
/**
|
|
121
|
-
* Roving focus, typeahead, and activation for one menu level.
|
|
122
|
-
*
|
|
123
|
-
* Both the menu panel and every submenu flyout own one of these, so a nested
|
|
124
|
-
* level keeps its own highlight, its own typeahead buffer, and its own keys
|
|
125
|
-
* without coordinating with its parent.
|
|
126
|
-
*/
|
|
127
|
-
function useMenuNav(options) {
|
|
128
|
-
const { menuRef, onClose } = options;
|
|
129
|
-
let typeaheadBuffer = "";
|
|
130
|
-
let typeaheadTimer;
|
|
131
|
-
function resetTypeahead() {
|
|
132
|
-
typeaheadBuffer = "";
|
|
133
|
-
if (typeaheadTimer != null) {
|
|
134
|
-
clearTimeout(typeaheadTimer);
|
|
135
|
-
typeaheadTimer = void 0;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
function getItems() {
|
|
139
|
-
const menu = menuRef.value;
|
|
140
|
-
if (menu == null) return [];
|
|
141
|
-
return Array.from(menu.querySelectorAll(MENU_ITEM_SELECTOR)).filter((row) => !isHiddenWithin(row, menu)).filter((row) => row.closest(MENU_BOUNDARY_SELECTOR) === menu);
|
|
142
|
-
}
|
|
143
|
-
function ownsEvent(event) {
|
|
144
|
-
const menu = menuRef.value;
|
|
145
|
-
const target = event.target;
|
|
146
|
-
if (menu == null || !(target instanceof Element)) return true;
|
|
147
|
-
return target.closest(MENU_BOUNDARY_SELECTOR) === menu;
|
|
148
|
-
}
|
|
149
|
-
function getCurrentIndex(items) {
|
|
150
|
-
const active = menuRef.value?.ownerDocument.activeElement ?? null;
|
|
151
|
-
return items.findIndex((row) => row === active || row.contains(active));
|
|
152
|
-
}
|
|
153
|
-
function findEnabledIndex(items, start, step, wrap) {
|
|
154
|
-
const count = items.length;
|
|
155
|
-
if (count === 0) return -1;
|
|
156
|
-
let index = start;
|
|
157
|
-
for (let i = 0; i < count; i++) {
|
|
158
|
-
if (index < 0 || index >= count) {
|
|
159
|
-
if (!wrap) return -1;
|
|
160
|
-
index = (index + count) % count;
|
|
161
|
-
}
|
|
162
|
-
const row = items[index];
|
|
163
|
-
if (row != null && !isDisabledRow(row)) return index;
|
|
164
|
-
index += step;
|
|
165
|
-
}
|
|
166
|
-
return -1;
|
|
167
|
-
}
|
|
168
|
-
function focusIndex(items, index) {
|
|
169
|
-
const row = items[index];
|
|
170
|
-
if (row == null) return false;
|
|
171
|
-
row.focus();
|
|
172
|
-
return true;
|
|
173
|
-
}
|
|
174
|
-
function focusFirst() {
|
|
175
|
-
const items = getItems();
|
|
176
|
-
return focusIndex(items, findEnabledIndex(items, 0, 1, false));
|
|
177
|
-
}
|
|
178
|
-
function focusLast() {
|
|
179
|
-
const items = getItems();
|
|
180
|
-
return focusIndex(items, findEnabledIndex(items, items.length - 1, -1, false));
|
|
181
|
-
}
|
|
182
|
-
function moveBy(direction) {
|
|
183
|
-
const items = getItems();
|
|
184
|
-
if (items.length === 0) return false;
|
|
185
|
-
const current = getCurrentIndex(items);
|
|
186
|
-
return focusIndex(items, findEnabledIndex(items, current === -1 ? direction === 1 ? 0 : items.length - 1 : current + direction, direction, true));
|
|
187
|
-
}
|
|
188
|
-
/**
|
|
189
|
-
* PageDown / PageUp move by the rows a viewport shows, never wrapping; in a
|
|
190
|
-
* menu that does not scroll they act as End and Home.
|
|
191
|
-
*/
|
|
192
|
-
function focusPage(direction) {
|
|
193
|
-
const menu = menuRef.value;
|
|
194
|
-
const all = getItems();
|
|
195
|
-
const active = all.map((row, index) => isDisabledRow(row) ? -1 : index).filter((index) => index !== -1);
|
|
196
|
-
if (menu == null || active.length === 0) return false;
|
|
197
|
-
if (menu.clientHeight === 0 || menu.scrollHeight <= menu.clientHeight) return direction === 1 ? focusLast() : focusFirst();
|
|
198
|
-
const rowHeight = all[active[0]]?.getBoundingClientRect().height ?? 0;
|
|
199
|
-
const perPage = rowHeight > 0 ? Math.max(1, Math.floor(menu.clientHeight / rowHeight)) : active.length;
|
|
200
|
-
const position = active.indexOf(getCurrentIndex(all));
|
|
201
|
-
const from = position === -1 ? direction === 1 ? -1 : active.length : position;
|
|
202
|
-
return focusIndex(all, active[Math.max(0, Math.min(active.length - 1, from + direction * perPage))]);
|
|
203
|
-
}
|
|
204
|
-
/**
|
|
205
|
-
* Typeahead over the rows' label elements. Repeated presses of the same
|
|
206
|
-
* character cycle through the matches instead of filtering deeper.
|
|
207
|
-
*/
|
|
208
|
-
function handleTypeahead(event) {
|
|
209
|
-
const isSpaceMidType = event.key === " " && typeaheadBuffer.length > 0;
|
|
210
|
-
if (!(event.key.length === 1 && !event.ctrlKey && !event.metaKey && event.key !== " ") && !isSpaceMidType) return false;
|
|
211
|
-
const items = getItems();
|
|
212
|
-
const labels = items.map((row) => row.querySelector(`[data-menu-item-label]`)?.textContent ?? row.textContent);
|
|
213
|
-
if (labels.length === 0) return false;
|
|
214
|
-
const char = event.key.toLowerCase();
|
|
215
|
-
const nextBuffer = typeaheadBuffer.length > 0 && [...typeaheadBuffer].every((entry) => entry === char) ? char : typeaheadBuffer + char;
|
|
216
|
-
typeaheadBuffer = nextBuffer;
|
|
217
|
-
if (typeaheadTimer != null) clearTimeout(typeaheadTimer);
|
|
218
|
-
typeaheadTimer = setTimeout(resetTypeahead, TYPEAHEAD_RESET_MS);
|
|
219
|
-
const current = getCurrentIndex(items);
|
|
220
|
-
const hasCurrent = current >= 0;
|
|
221
|
-
const start = hasCurrent ? current : 0;
|
|
222
|
-
const offset = hasCurrent && nextBuffer.length === 1 ? 1 : 0;
|
|
223
|
-
for (let i = 0; i < labels.length; i++) {
|
|
224
|
-
const index = (start + offset + i + labels.length) % labels.length;
|
|
225
|
-
if (isDisabledRow(items[index])) continue;
|
|
226
|
-
const label = labels[index];
|
|
227
|
-
if (label != null && label.trim().toLowerCase().startsWith(nextBuffer)) {
|
|
228
|
-
focusIndex(items, index);
|
|
229
|
-
return true;
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
return true;
|
|
233
|
-
}
|
|
234
|
-
function handleKeyDown(event) {
|
|
235
|
-
if (event.defaultPrevented || event.isComposing || event.ctrlKey || event.metaKey || event.altKey) return;
|
|
236
|
-
if (!ownsEvent(event)) return;
|
|
237
|
-
if (event.key === "Enter" || event.key === " ") {
|
|
238
|
-
event.preventDefault();
|
|
239
|
-
if (event.repeat) return;
|
|
240
|
-
const active = menuRef.value?.ownerDocument.activeElement;
|
|
241
|
-
if (active instanceof HTMLElement && MENU_ITEM_ROLES.has(active.getAttribute("role") ?? "")) activateMenuItem(active, event);
|
|
242
|
-
return;
|
|
243
|
-
}
|
|
244
|
-
if (event.key === "Tab") {
|
|
245
|
-
onClose("tab");
|
|
246
|
-
return;
|
|
247
|
-
}
|
|
248
|
-
if (event.key === "Escape") {
|
|
249
|
-
event.preventDefault();
|
|
250
|
-
onClose("escape");
|
|
251
|
-
return;
|
|
252
|
-
}
|
|
253
|
-
if (handleTypeahead(event)) {
|
|
254
|
-
event.preventDefault();
|
|
255
|
-
return;
|
|
256
|
-
}
|
|
257
|
-
if (event.key === "ArrowDown" && moveBy(1)) {
|
|
258
|
-
event.preventDefault();
|
|
259
|
-
return;
|
|
260
|
-
}
|
|
261
|
-
if (event.key === "ArrowUp" && moveBy(-1)) {
|
|
262
|
-
event.preventDefault();
|
|
263
|
-
return;
|
|
264
|
-
}
|
|
265
|
-
if (event.key === "Home" && focusFirst()) {
|
|
266
|
-
event.preventDefault();
|
|
267
|
-
return;
|
|
268
|
-
}
|
|
269
|
-
if (event.key === "End" && focusLast()) {
|
|
270
|
-
event.preventDefault();
|
|
271
|
-
return;
|
|
272
|
-
}
|
|
273
|
-
if (event.key === "PageDown" && focusPage(1)) {
|
|
274
|
-
event.preventDefault();
|
|
275
|
-
return;
|
|
276
|
-
}
|
|
277
|
-
if (event.key === "PageUp" && focusPage(-1)) event.preventDefault();
|
|
278
|
-
}
|
|
279
|
-
return {
|
|
280
|
-
focusFirst,
|
|
281
|
-
handleKeyDown,
|
|
282
|
-
resetTypeahead
|
|
283
|
-
};
|
|
284
|
-
}
|
|
285
|
-
//#endregion
|
|
286
54
|
//#region src/ContextMenu/ContextMenuItem.vue
|
|
287
55
|
const _hoisted_1$2 = {
|
|
288
56
|
key: 0,
|
|
289
57
|
class: "astryx-context-menu-item__start"
|
|
290
58
|
};
|
|
291
|
-
const _hoisted_2$
|
|
292
|
-
const _hoisted_3$
|
|
59
|
+
const _hoisted_2$2 = { class: "astryx-context-menu-item__content" };
|
|
60
|
+
const _hoisted_3$2 = {
|
|
293
61
|
class: "astryx-context-menu-item__label",
|
|
294
62
|
"data-menu-item-label": ""
|
|
295
63
|
};
|
|
296
|
-
const _hoisted_4$
|
|
64
|
+
const _hoisted_4$2 = {
|
|
297
65
|
key: 0,
|
|
298
66
|
class: "astryx-context-menu-item__description"
|
|
299
67
|
};
|
|
@@ -377,7 +145,7 @@ const _sfc_main$3 = /*@__PURE__*/ defineComponent({
|
|
|
377
145
|
icon: __props.icon,
|
|
378
146
|
size: "sm"
|
|
379
147
|
}, null, 8, ["color", "icon"])])])) : createCommentVNode("v-if", true),
|
|
380
|
-
createElementVNode("span", _hoisted_2$
|
|
148
|
+
createElementVNode("span", _hoisted_2$2, [createElementVNode("span", _hoisted_3$2, [renderSlot(_ctx.$slots, "label", {}, () => [createTextVNode(toDisplayString(__props.label), 1)])]), __props.description != null || _ctx.$slots.description ? (openBlock(), createElementBlock("span", _hoisted_4$2, [renderSlot(_ctx.$slots, "description", {}, () => [createTextVNode(toDisplayString(__props.description), 1)])])) : createCommentVNode("v-if", true)]),
|
|
381
149
|
__props.endContent != null || _ctx.$slots.endContent ? (openBlock(), createElementBlock("span", _hoisted_5$1, [renderSlot(_ctx.$slots, "endContent", {}, () => [createTextVNode(toDisplayString(__props.endContent), 1)])])) : createCommentVNode("v-if", true)
|
|
382
150
|
]),
|
|
383
151
|
_: 3
|
|
@@ -627,12 +395,12 @@ const _hoisted_1$1 = [
|
|
|
627
395
|
"data-size",
|
|
628
396
|
"tabindex"
|
|
629
397
|
];
|
|
630
|
-
const _hoisted_2 = {
|
|
398
|
+
const _hoisted_2$1 = {
|
|
631
399
|
key: 0,
|
|
632
400
|
class: "astryx-context-menu-item__start"
|
|
633
401
|
};
|
|
634
|
-
const _hoisted_3 = { class: "astryx-context-menu-item__content" };
|
|
635
|
-
const _hoisted_4 = {
|
|
402
|
+
const _hoisted_3$1 = { class: "astryx-context-menu-item__content" };
|
|
403
|
+
const _hoisted_4$1 = {
|
|
636
404
|
class: "astryx-context-menu-item__label",
|
|
637
405
|
"data-menu-item-label": ""
|
|
638
406
|
};
|
|
@@ -641,7 +409,12 @@ const _hoisted_5 = {
|
|
|
641
409
|
class: "astryx-context-menu-item__description"
|
|
642
410
|
};
|
|
643
411
|
const _hoisted_6 = { class: "astryx-context-menu-item__end" };
|
|
644
|
-
const _hoisted_7 =
|
|
412
|
+
const _hoisted_7 = {
|
|
413
|
+
key: 0,
|
|
414
|
+
"aria-hidden": "true"
|
|
415
|
+
};
|
|
416
|
+
const _hoisted_8 = ["aria-label", "hidden"];
|
|
417
|
+
const _hoisted_9 = [
|
|
645
418
|
"aria-label",
|
|
646
419
|
"data-overflow",
|
|
647
420
|
"data-placement",
|
|
@@ -660,7 +433,13 @@ const _sfc_main$2 = /*@__PURE__*/ defineComponent({
|
|
|
660
433
|
type: Boolean,
|
|
661
434
|
default: false
|
|
662
435
|
},
|
|
663
|
-
items: {}
|
|
436
|
+
items: {},
|
|
437
|
+
hasSpinner: {
|
|
438
|
+
type: Boolean,
|
|
439
|
+
default: false
|
|
440
|
+
},
|
|
441
|
+
menuWidth: {},
|
|
442
|
+
presentation: { default: "adaptive" }
|
|
664
443
|
},
|
|
665
444
|
emits: ["openChange", "select"],
|
|
666
445
|
setup(__props, { emit: __emit }) {
|
|
@@ -669,6 +448,21 @@ const _sfc_main$2 = /*@__PURE__*/ defineComponent({
|
|
|
669
448
|
const attrs = useAttrs();
|
|
670
449
|
const menu = useContextMenu();
|
|
671
450
|
const size = useContextMenuSize();
|
|
451
|
+
const messages = useAstryxMessages();
|
|
452
|
+
const viewId = useId();
|
|
453
|
+
const mode = useSubmenuMode({
|
|
454
|
+
drillIn: computed(() => menu?.drillIn.value),
|
|
455
|
+
presentation: computed(() => props.presentation),
|
|
456
|
+
viewId
|
|
457
|
+
});
|
|
458
|
+
const isDrill = mode.isDrill;
|
|
459
|
+
const drillOnStack = mode.isOnStack;
|
|
460
|
+
const drillIsTop = mode.isTop;
|
|
461
|
+
const drillHost = computed(() => isDrill.value ? menu?.drillIn.value.host ?? null : null);
|
|
462
|
+
const backLabel = computed(() => {
|
|
463
|
+
const parent = menu?.menuLabel.value;
|
|
464
|
+
return parent != null && parent !== "" ? messages.value.dropdownMenu.backTo(parent) : messages.value.dropdownMenu.back;
|
|
465
|
+
});
|
|
672
466
|
const row = useTemplateRef("row");
|
|
673
467
|
const flyout = useTemplateRef("flyout");
|
|
674
468
|
const isOpen = ref(false);
|
|
@@ -685,10 +479,14 @@ const _sfc_main$2 = /*@__PURE__*/ defineComponent({
|
|
|
685
479
|
alignment: computed(() => "start"),
|
|
686
480
|
gap: GAP$1
|
|
687
481
|
});
|
|
688
|
-
const flyoutStyle = computed(() =>
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
482
|
+
const flyoutStyle = computed(() => {
|
|
483
|
+
const style = {
|
|
484
|
+
left: `${position.value.left}px`,
|
|
485
|
+
top: `${position.value.top}px`
|
|
486
|
+
};
|
|
487
|
+
if (props.menuWidth != null) style.minWidth = `min(${typeof props.menuWidth === "number" ? `${props.menuWidth}px` : props.menuWidth}, calc(100vw - 16px))`;
|
|
488
|
+
return style;
|
|
489
|
+
});
|
|
692
490
|
const hasOverflow = useOverflow(flyout, showsFlyout);
|
|
693
491
|
const nav = useMenuNav({
|
|
694
492
|
menuRef: flyout,
|
|
@@ -714,6 +512,13 @@ const _sfc_main$2 = /*@__PURE__*/ defineComponent({
|
|
|
714
512
|
});
|
|
715
513
|
function open(focusFirstRow) {
|
|
716
514
|
if (props.isDisabled) return;
|
|
515
|
+
if (isDrill.value) {
|
|
516
|
+
const wasOpen = drillOnStack.value;
|
|
517
|
+
mode.openDrill();
|
|
518
|
+
if (!wasOpen) emit("openChange", true);
|
|
519
|
+
if (focusFirstRow) nextTick(() => nav.focusFirst());
|
|
520
|
+
return;
|
|
521
|
+
}
|
|
717
522
|
if (isOpen.value) {
|
|
718
523
|
if (focusFirstRow) nav.focusFirst();
|
|
719
524
|
return;
|
|
@@ -730,6 +535,12 @@ const _sfc_main$2 = /*@__PURE__*/ defineComponent({
|
|
|
730
535
|
hover.noteHoverOpened();
|
|
731
536
|
}
|
|
732
537
|
function close(focusRow) {
|
|
538
|
+
if (isDrill.value) {
|
|
539
|
+
if (!mode.closeDrill()) return;
|
|
540
|
+
emit("openChange", false);
|
|
541
|
+
if (focusRow) row.value?.focus();
|
|
542
|
+
return;
|
|
543
|
+
}
|
|
733
544
|
const wasOpen = isOpen.value;
|
|
734
545
|
hover.markClosed();
|
|
735
546
|
if (!wasOpen) return;
|
|
@@ -799,7 +610,7 @@ const _sfc_main$2 = /*@__PURE__*/ defineComponent({
|
|
|
799
610
|
}, unref(attrs), {
|
|
800
611
|
"aria-controls": flyoutId,
|
|
801
612
|
"aria-disabled": __props.isDisabled || void 0,
|
|
802
|
-
"aria-expanded": showsFlyout.value,
|
|
613
|
+
"aria-expanded": showsFlyout.value || unref(drillOnStack),
|
|
803
614
|
"aria-haspopup": "menu",
|
|
804
615
|
class: ["astryx-context-menu-item astryx-context-menu-item--submenu", unref(attrs).class],
|
|
805
616
|
"data-disabled": __props.isDisabled || void 0,
|
|
@@ -814,20 +625,50 @@ const _sfc_main$2 = /*@__PURE__*/ defineComponent({
|
|
|
814
625
|
onPointerleave: _cache[0] || (_cache[0] = (...args) => unref(hover).onTriggerPointerLeave && unref(hover).onTriggerPointerLeave(...args)),
|
|
815
626
|
onPointermove: onRowPointerMove
|
|
816
627
|
}), [
|
|
817
|
-
__props.icon != null || _ctx.$slots.icon ? (openBlock(), createElementBlock("span", _hoisted_2, [renderSlot(_ctx.$slots, "icon", {}, () => [createVNode(_sfc_main$7, {
|
|
628
|
+
__props.icon != null || _ctx.$slots.icon ? (openBlock(), createElementBlock("span", _hoisted_2$1, [renderSlot(_ctx.$slots, "icon", {}, () => [createVNode(_sfc_main$7, {
|
|
818
629
|
icon: __props.icon,
|
|
819
630
|
color: "secondary",
|
|
820
631
|
size: "sm"
|
|
821
632
|
}, null, 8, ["icon"])])])) : createCommentVNode("v-if", true),
|
|
822
|
-
createElementVNode("span", _hoisted_3, [createElementVNode("span", _hoisted_4, [renderSlot(_ctx.$slots, "label", {}, () => [createTextVNode(toDisplayString(__props.label), 1)])]), __props.description != null || _ctx.$slots.description ? (openBlock(), createElementBlock("span", _hoisted_5, [renderSlot(_ctx.$slots, "description", {}, () => [createTextVNode(toDisplayString(__props.description), 1)])])) : createCommentVNode("v-if", true)]),
|
|
823
|
-
createElementVNode("span", _hoisted_6, [renderSlot(_ctx.$slots, "endContent", {}, () => [createVNode(_sfc_main$7, {
|
|
633
|
+
createElementVNode("span", _hoisted_3$1, [createElementVNode("span", _hoisted_4$1, [renderSlot(_ctx.$slots, "label", {}, () => [createTextVNode(toDisplayString(__props.label), 1)])]), __props.description != null || _ctx.$slots.description ? (openBlock(), createElementBlock("span", _hoisted_5, [renderSlot(_ctx.$slots, "description", {}, () => [createTextVNode(toDisplayString(__props.description), 1)])])) : createCommentVNode("v-if", true)]),
|
|
634
|
+
createElementVNode("span", _hoisted_6, [renderSlot(_ctx.$slots, "endContent", {}, () => [__props.hasSpinner ? (openBlock(), createElementBlock("span", _hoisted_7, [createVNode(_sfc_main$12, { size: "sm" })])) : (openBlock(), createBlock(_sfc_main$7, {
|
|
635
|
+
key: 1,
|
|
824
636
|
class: "astryx-context-menu-item__chevron",
|
|
825
637
|
icon: "chevronRight",
|
|
826
638
|
color: "secondary",
|
|
827
639
|
size: "sm"
|
|
828
|
-
})])])
|
|
640
|
+
}))])])
|
|
829
641
|
], 16, _hoisted_1$1),
|
|
830
|
-
(openBlock(), createBlock(Teleport, {
|
|
642
|
+
drillHost.value ? (openBlock(), createBlock(Teleport, {
|
|
643
|
+
key: 0,
|
|
644
|
+
to: drillHost.value
|
|
645
|
+
}, [withDirectives(createElementVNode("div", {
|
|
646
|
+
ref_key: "flyout",
|
|
647
|
+
ref: flyout,
|
|
648
|
+
class: "astryx-context-menu astryx-context-menu--flyout",
|
|
649
|
+
role: "menu",
|
|
650
|
+
"aria-label": flyoutLabel.value,
|
|
651
|
+
hidden: unref(drillIsTop) ? void 0 : true,
|
|
652
|
+
tabindex: "-1",
|
|
653
|
+
onKeydown: onFlyoutKeyDown
|
|
654
|
+
}, [createVNode(_sfc_main$3, {
|
|
655
|
+
"has-close-on-select": false,
|
|
656
|
+
label: backLabel.value,
|
|
657
|
+
onClick: _cache[1] || (_cache[1] = ($event) => close(true))
|
|
658
|
+
}, {
|
|
659
|
+
icon: withCtx(() => [createVNode(_sfc_main$7, {
|
|
660
|
+
color: "secondary",
|
|
661
|
+
icon: "chevronLeft",
|
|
662
|
+
size: "sm"
|
|
663
|
+
})]),
|
|
664
|
+
_: 1
|
|
665
|
+
}, 8, ["label"]), renderSlot(_ctx.$slots, "default", {}, () => [createVNode(_sfc_main$1, {
|
|
666
|
+
items: __props.items ?? [],
|
|
667
|
+
onSelect: onNestedSelect
|
|
668
|
+
}, null, 8, ["items"])])], 40, _hoisted_8), [[vShow, unref(drillOnStack)]])], 8, ["to"])) : (openBlock(), createBlock(Teleport, {
|
|
669
|
+
key: 1,
|
|
670
|
+
to: "body"
|
|
671
|
+
}, [createVNode(Transition, {
|
|
831
672
|
name: "astryx-context-menu-flyout",
|
|
832
673
|
persisted: ""
|
|
833
674
|
}, {
|
|
@@ -843,14 +684,14 @@ const _sfc_main$2 = /*@__PURE__*/ defineComponent({
|
|
|
843
684
|
role: "menu",
|
|
844
685
|
style: normalizeStyle(flyoutStyle.value),
|
|
845
686
|
tabindex: "-1",
|
|
846
|
-
onContextmenu: _cache[
|
|
687
|
+
onContextmenu: _cache[2] || (_cache[2] = withModifiers(() => {}, ["prevent"])),
|
|
847
688
|
onKeydown: onFlyoutKeyDown,
|
|
848
|
-
onPointerenter: _cache[
|
|
849
|
-
onPointerleave: _cache[
|
|
689
|
+
onPointerenter: _cache[3] || (_cache[3] = (...args) => unref(hover).onFlyoutPointerEnter && unref(hover).onFlyoutPointerEnter(...args)),
|
|
690
|
+
onPointerleave: _cache[4] || (_cache[4] = (...args) => unref(hover).onFlyoutPointerLeave && unref(hover).onFlyoutPointerLeave(...args))
|
|
850
691
|
}, [renderSlot(_ctx.$slots, "default", {}, () => [createVNode(_sfc_main$1, {
|
|
851
692
|
items: __props.items ?? [],
|
|
852
693
|
onSelect: onNestedSelect
|
|
853
|
-
}, null, 8, ["items"])])], 44,
|
|
694
|
+
}, null, 8, ["items"])])], 44, _hoisted_9), [[vShow, showsFlyout.value]])]),
|
|
854
695
|
_: 3
|
|
855
696
|
})]))
|
|
856
697
|
], 64);
|
|
@@ -866,6 +707,12 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
|
866
707
|
emits: ["select"],
|
|
867
708
|
setup(__props, { emit: __emit }) {
|
|
868
709
|
const emit = __emit;
|
|
710
|
+
function isCheckbox(option) {
|
|
711
|
+
return option.type === "checkbox";
|
|
712
|
+
}
|
|
713
|
+
function isRadio(option) {
|
|
714
|
+
return option.type === "radio";
|
|
715
|
+
}
|
|
869
716
|
function isDivider(option) {
|
|
870
717
|
return option.type === "divider";
|
|
871
718
|
}
|
|
@@ -889,6 +736,8 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
|
889
736
|
function keyOf(option, index) {
|
|
890
737
|
if (option.type === "divider") return `divider-${index}`;
|
|
891
738
|
if (option.type === "section") return `section-${option.id ?? index}`;
|
|
739
|
+
if (option.type === "checkbox") return `checkbox-${option.id ?? index}`;
|
|
740
|
+
if (option.type === "radio") return `radio-${option.id ?? index}`;
|
|
892
741
|
return `item-${option.id ?? index}`;
|
|
893
742
|
}
|
|
894
743
|
function onRowClick(option, event) {
|
|
@@ -899,11 +748,60 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
|
899
748
|
function onNestedSelect(item, event) {
|
|
900
749
|
emit("select", item, event);
|
|
901
750
|
}
|
|
751
|
+
function onRadioModel(option, value) {
|
|
752
|
+
if (value != null) option.onChange?.(value);
|
|
753
|
+
}
|
|
902
754
|
return (_ctx, _cache) => {
|
|
903
755
|
const _component_ContextMenuItems = resolveComponent("ContextMenuItems", true);
|
|
904
756
|
return openBlock(true), createElementBlock(Fragment, null, renderList(__props.items, (option, index) => {
|
|
905
|
-
return openBlock(), createElementBlock(Fragment, { key: keyOf(option, index) }, [isDivider(option) ? (openBlock(), createBlock(_sfc_main$5, { key: 0 })) :
|
|
757
|
+
return openBlock(), createElementBlock(Fragment, { key: keyOf(option, index) }, [isDivider(option) ? (openBlock(), createBlock(_sfc_main$5, { key: 0 })) : isCheckbox(option) ? (openBlock(), createBlock(_sfc_main$8, {
|
|
906
758
|
key: 1,
|
|
759
|
+
description: option.description,
|
|
760
|
+
"has-close-on-select": option.hasCloseOnSelect,
|
|
761
|
+
icon: option.icon,
|
|
762
|
+
"is-disabled": option.isDisabled,
|
|
763
|
+
label: option.label,
|
|
764
|
+
"model-value": option.checked,
|
|
765
|
+
"onUpdate:modelValue": ($event) => option.onChange?.($event)
|
|
766
|
+
}, null, 8, [
|
|
767
|
+
"description",
|
|
768
|
+
"has-close-on-select",
|
|
769
|
+
"icon",
|
|
770
|
+
"is-disabled",
|
|
771
|
+
"label",
|
|
772
|
+
"model-value",
|
|
773
|
+
"onUpdate:modelValue"
|
|
774
|
+
])) : isRadio(option) ? (openBlock(), createBlock(_sfc_main$9, {
|
|
775
|
+
key: 2,
|
|
776
|
+
"has-close-on-select": option.hasCloseOnSelect,
|
|
777
|
+
label: option.label,
|
|
778
|
+
"model-value": option.value,
|
|
779
|
+
"onUpdate:modelValue": ($event) => onRadioModel(option, $event)
|
|
780
|
+
}, {
|
|
781
|
+
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(option.items, (choice, choiceIndex) => {
|
|
782
|
+
return openBlock(), createBlock(_sfc_main$10, {
|
|
783
|
+
key: choice.id ?? choiceIndex,
|
|
784
|
+
description: choice.description,
|
|
785
|
+
icon: choice.icon,
|
|
786
|
+
"is-disabled": choice.isDisabled,
|
|
787
|
+
label: choice.label,
|
|
788
|
+
value: choice.value
|
|
789
|
+
}, null, 8, [
|
|
790
|
+
"description",
|
|
791
|
+
"icon",
|
|
792
|
+
"is-disabled",
|
|
793
|
+
"label",
|
|
794
|
+
"value"
|
|
795
|
+
]);
|
|
796
|
+
}), 128))]),
|
|
797
|
+
_: 2
|
|
798
|
+
}, 1032, [
|
|
799
|
+
"has-close-on-select",
|
|
800
|
+
"label",
|
|
801
|
+
"model-value",
|
|
802
|
+
"onUpdate:modelValue"
|
|
803
|
+
])) : isSection(option) ? (openBlock(), createBlock(_sfc_main$4, {
|
|
804
|
+
key: 3,
|
|
907
805
|
title: option.title
|
|
908
806
|
}, {
|
|
909
807
|
default: withCtx(() => [createVNode(_component_ContextMenuItems, {
|
|
@@ -912,7 +810,7 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
|
912
810
|
}, null, 8, ["items"])]),
|
|
913
811
|
_: 2
|
|
914
812
|
}, 1032, ["title"])) : isSubMenu(option) ? (openBlock(), createBlock(_sfc_main$2, {
|
|
915
|
-
key:
|
|
813
|
+
key: 4,
|
|
916
814
|
icon: option.icon,
|
|
917
815
|
"is-disabled": option.isDisabled,
|
|
918
816
|
items: option.items,
|
|
@@ -924,7 +822,7 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
|
924
822
|
"items",
|
|
925
823
|
"label"
|
|
926
824
|
])) : (openBlock(), createBlock(_sfc_main$3, mergeProps({
|
|
927
|
-
key:
|
|
825
|
+
key: 5,
|
|
928
826
|
ref_for: true
|
|
929
827
|
}, itemProps(option), { onClick: ($event) => onRowClick(option, $event) }), null, 16, ["onClick"]))], 64);
|
|
930
828
|
}), 128);
|
|
@@ -932,155 +830,6 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
|
932
830
|
}
|
|
933
831
|
});
|
|
934
832
|
//#endregion
|
|
935
|
-
//#region src/ContextMenu/useMenuPress.ts
|
|
936
|
-
/** How long after a tracked release the browser's own click is still swallowed. */
|
|
937
|
-
const STRAY_CLICK_MS = 400;
|
|
938
|
-
let swallower = null;
|
|
939
|
-
function disarmStrayClick() {
|
|
940
|
-
if (swallower == null) return;
|
|
941
|
-
swallower.isArmed = false;
|
|
942
|
-
if (swallower.timer != null) {
|
|
943
|
-
clearTimeout(swallower.timer);
|
|
944
|
-
swallower.timer = null;
|
|
945
|
-
}
|
|
946
|
-
}
|
|
947
|
-
function onWindowClickCapture(event) {
|
|
948
|
-
if (swallower == null || !swallower.isArmed) return;
|
|
949
|
-
if (event.detail === 0) return;
|
|
950
|
-
event.preventDefault();
|
|
951
|
-
event.stopImmediatePropagation();
|
|
952
|
-
disarmStrayClick();
|
|
953
|
-
}
|
|
954
|
-
/**
|
|
955
|
-
* Swallow the browser's compatibility click for a gesture the press model
|
|
956
|
-
* already acted on. The listener sits on the window in the capture phase, so
|
|
957
|
-
* it runs ahead of any listener the application or the row itself installed.
|
|
958
|
-
*/
|
|
959
|
-
function armStrayClick(doc) {
|
|
960
|
-
const view = doc.defaultView;
|
|
961
|
-
if (view == null) return;
|
|
962
|
-
if (swallower == null || swallower.doc !== doc) {
|
|
963
|
-
if (swallower != null) {
|
|
964
|
-
swallower.doc.defaultView?.removeEventListener("click", onWindowClickCapture, true);
|
|
965
|
-
swallower.doc.removeEventListener("pointerdown", disarmStrayClick, true);
|
|
966
|
-
}
|
|
967
|
-
view.addEventListener("click", onWindowClickCapture, true);
|
|
968
|
-
doc.addEventListener("pointerdown", disarmStrayClick, true);
|
|
969
|
-
swallower = {
|
|
970
|
-
doc,
|
|
971
|
-
isArmed: false,
|
|
972
|
-
timer: null
|
|
973
|
-
};
|
|
974
|
-
}
|
|
975
|
-
disarmStrayClick();
|
|
976
|
-
swallower.isArmed = true;
|
|
977
|
-
swallower.timer = setTimeout(disarmStrayClick, STRAY_CLICK_MS);
|
|
978
|
-
}
|
|
979
|
-
/** Forget an armed swallower. Called when a surface unmounts and in tests. */
|
|
980
|
-
function resetMenuPress() {
|
|
981
|
-
disarmStrayClick();
|
|
982
|
-
}
|
|
983
|
-
/**
|
|
984
|
-
* The press model of a painted menu surface.
|
|
985
|
-
*
|
|
986
|
-
* A finger's pointer events stay with the element it landed on, so the gesture
|
|
987
|
-
* is tracked at the document level by `pointerId`:
|
|
988
|
-
*
|
|
989
|
-
* - The highlight follows the finger.
|
|
990
|
-
* - The row under the RELEASE acts, the way its own click would, carrying the
|
|
991
|
-
* release's modifiers; the browser's own click for that gesture is swallowed
|
|
992
|
-
* so the row never acts twice.
|
|
993
|
-
* - A finger released outside leaves the menu open; a mouse released outside
|
|
994
|
-
* dismisses it.
|
|
995
|
-
* - `pointercancel` and a second pointer end the gesture with nothing acting.
|
|
996
|
-
*/
|
|
997
|
-
function useMenuPress(options) {
|
|
998
|
-
const { menuRef, isEnabled, onDismiss } = options;
|
|
999
|
-
let trackedId = null;
|
|
1000
|
-
let trackedIsMouse = false;
|
|
1001
|
-
let highlighted = null;
|
|
1002
|
-
let doc = null;
|
|
1003
|
-
function isRowInsideMenu(row) {
|
|
1004
|
-
const menu = menuRef.value;
|
|
1005
|
-
return row instanceof HTMLElement && menu != null && menu.contains(row) && row.closest("[role=\"menu\"]") === menu;
|
|
1006
|
-
}
|
|
1007
|
-
function rowFromEvent(event) {
|
|
1008
|
-
const hit = doc?.elementFromPoint?.(event.clientX, event.clientY) ?? null;
|
|
1009
|
-
const fromPoint = hit instanceof Element ? hit.closest(MENU_ITEM_SELECTOR) : null;
|
|
1010
|
-
if (fromPoint != null && isRowInsideMenu(fromPoint)) return fromPoint;
|
|
1011
|
-
const target = event.target;
|
|
1012
|
-
const fromTarget = target instanceof Element ? target.closest(MENU_ITEM_SELECTOR) : null;
|
|
1013
|
-
return fromTarget != null && isRowInsideMenu(fromTarget) ? fromTarget : null;
|
|
1014
|
-
}
|
|
1015
|
-
function isEventInsideMenu(event) {
|
|
1016
|
-
const menu = menuRef.value;
|
|
1017
|
-
if (menu == null) return false;
|
|
1018
|
-
const hit = doc?.elementFromPoint?.(event.clientX, event.clientY) ?? null;
|
|
1019
|
-
if (hit instanceof Node && menu.contains(hit)) return true;
|
|
1020
|
-
const target = event.target;
|
|
1021
|
-
return target instanceof Node && menu.contains(target);
|
|
1022
|
-
}
|
|
1023
|
-
function highlight(row) {
|
|
1024
|
-
if (row === highlighted) return;
|
|
1025
|
-
highlighted = row;
|
|
1026
|
-
row?.focus({ preventScroll: true });
|
|
1027
|
-
}
|
|
1028
|
-
function onDocumentPointerMove(event) {
|
|
1029
|
-
if (event.pointerId !== trackedId) return;
|
|
1030
|
-
const row = rowFromEvent(event);
|
|
1031
|
-
if (row != null) highlight(row);
|
|
1032
|
-
}
|
|
1033
|
-
function onDocumentPointerUp(event) {
|
|
1034
|
-
if (event.pointerId !== trackedId) return;
|
|
1035
|
-
const row = rowFromEvent(event);
|
|
1036
|
-
endGesture();
|
|
1037
|
-
if (row == null) return;
|
|
1038
|
-
if (doc != null) armStrayClick(doc);
|
|
1039
|
-
activateMenuItem(row, event);
|
|
1040
|
-
}
|
|
1041
|
-
function onDocumentPointerCancel(event) {
|
|
1042
|
-
if (event.pointerId !== trackedId) return;
|
|
1043
|
-
endGesture();
|
|
1044
|
-
}
|
|
1045
|
-
function onDocumentMouseUp(event) {
|
|
1046
|
-
const isInside = isEventInsideMenu(event);
|
|
1047
|
-
endGesture();
|
|
1048
|
-
if (!isInside) onDismiss();
|
|
1049
|
-
}
|
|
1050
|
-
function endGesture() {
|
|
1051
|
-
const current = doc;
|
|
1052
|
-
if (current != null) {
|
|
1053
|
-
current.removeEventListener("pointermove", onDocumentPointerMove, true);
|
|
1054
|
-
current.removeEventListener("pointerup", onDocumentPointerUp, true);
|
|
1055
|
-
current.removeEventListener("pointercancel", onDocumentPointerCancel, true);
|
|
1056
|
-
current.removeEventListener("mouseup", onDocumentMouseUp, true);
|
|
1057
|
-
}
|
|
1058
|
-
trackedId = null;
|
|
1059
|
-
trackedIsMouse = false;
|
|
1060
|
-
highlighted = null;
|
|
1061
|
-
}
|
|
1062
|
-
function onPointerDown(event) {
|
|
1063
|
-
if (!isEnabled()) return;
|
|
1064
|
-
if (trackedId != null) endGesture();
|
|
1065
|
-
const target = event.target;
|
|
1066
|
-
const row = target instanceof Element ? target.closest(MENU_ITEM_SELECTOR) : null;
|
|
1067
|
-
if (row == null || !isRowInsideMenu(row)) return;
|
|
1068
|
-
highlighted = row;
|
|
1069
|
-
trackedId = event.pointerId;
|
|
1070
|
-
trackedIsMouse = event.pointerType === "mouse";
|
|
1071
|
-
doc = menuRef.value?.ownerDocument ?? null;
|
|
1072
|
-
if (trackedIsMouse) {
|
|
1073
|
-
doc?.addEventListener("mouseup", onDocumentMouseUp, true);
|
|
1074
|
-
return;
|
|
1075
|
-
}
|
|
1076
|
-
doc?.addEventListener("pointermove", onDocumentPointerMove, true);
|
|
1077
|
-
doc?.addEventListener("pointerup", onDocumentPointerUp, true);
|
|
1078
|
-
doc?.addEventListener("pointercancel", onDocumentPointerCancel, true);
|
|
1079
|
-
}
|
|
1080
|
-
onBeforeUnmount(endGesture);
|
|
1081
|
-
return { onPointerDown };
|
|
1082
|
-
}
|
|
1083
|
-
//#endregion
|
|
1084
833
|
//#region src/ContextMenu/ContextMenu.vue
|
|
1085
834
|
const _hoisted_1 = [
|
|
1086
835
|
"aria-label",
|
|
@@ -1089,6 +838,9 @@ const _hoisted_1 = [
|
|
|
1089
838
|
"data-size",
|
|
1090
839
|
"data-width"
|
|
1091
840
|
];
|
|
841
|
+
const _hoisted_2 = ["hidden", "inert"];
|
|
842
|
+
const _hoisted_3 = ["aria-label"];
|
|
843
|
+
const _hoisted_4 = ["hidden", "inert"];
|
|
1092
844
|
const GAP = 0;
|
|
1093
845
|
const DEFAULT_MIN_WIDTH = 160;
|
|
1094
846
|
const ADAPTIVE_QUERY = "(max-width: 768px) and (pointer: coarse)";
|
|
@@ -1176,10 +928,18 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
1176
928
|
openAt(rect == null ? point.x : point.x - rect.left, rect == null ? point.y : point.y - rect.top);
|
|
1177
929
|
}
|
|
1178
930
|
});
|
|
931
|
+
const { drillIn, host, isDrilled } = useMenuDrillIn(isOpen, ADAPTIVE_QUERY);
|
|
1179
932
|
useDismiss({
|
|
1180
933
|
container: panel,
|
|
1181
934
|
isEnabled: isOpen,
|
|
1182
|
-
onDismiss: () => closeMenu()
|
|
935
|
+
onDismiss: () => closeMenu(),
|
|
936
|
+
onEscape: () => {
|
|
937
|
+
if (drillIn.value.viewStack.length > 0) {
|
|
938
|
+
drillIn.value.pop();
|
|
939
|
+
return;
|
|
940
|
+
}
|
|
941
|
+
closeMenu({ restoreFocus: true });
|
|
942
|
+
}
|
|
1183
943
|
});
|
|
1184
944
|
function formatSize(value) {
|
|
1185
945
|
return typeof value === "number" ? `${value}px` : value;
|
|
@@ -1256,8 +1016,12 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
1256
1016
|
function onSelect(item, event) {
|
|
1257
1017
|
emit("select", item, event);
|
|
1258
1018
|
}
|
|
1019
|
+
function assignHost(element) {
|
|
1020
|
+
host.value = element instanceof HTMLElement ? element : null;
|
|
1021
|
+
}
|
|
1259
1022
|
provide(contextMenuContextKey, {
|
|
1260
1023
|
closeMenu,
|
|
1024
|
+
drillIn,
|
|
1261
1025
|
isOpen,
|
|
1262
1026
|
menuLabel: computed(() => props.label),
|
|
1263
1027
|
menuSize: computed(() => props.size)
|
|
@@ -1346,11 +1110,19 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
1346
1110
|
onContextmenu: _cache[0] || (_cache[0] = withModifiers(() => {}, ["prevent"])),
|
|
1347
1111
|
onKeydown: _cache[1] || (_cache[1] = (...args) => unref(nav).handleKeyDown && unref(nav).handleKeyDown(...args)),
|
|
1348
1112
|
onPointerdown: _cache[2] || (_cache[2] = (...args) => unref(menuPress).onPointerDown && unref(menuPress).onPointerDown(...args))
|
|
1349
|
-
}, [
|
|
1113
|
+
}, [createElementVNode("div", {
|
|
1114
|
+
class: "astryx-dropdown-menu-tree",
|
|
1115
|
+
hidden: unref(isDrilled) || void 0,
|
|
1116
|
+
inert: unref(isDrilled) || void 0
|
|
1117
|
+
}, [__props.items != null ? (openBlock(), createBlock(_sfc_main$1, {
|
|
1350
1118
|
key: 0,
|
|
1351
1119
|
items: __props.items,
|
|
1352
1120
|
onSelect
|
|
1353
|
-
}, null, 8, ["items"])) :
|
|
1121
|
+
}, null, 8, ["items"])) : renderSlot(_ctx.$slots, "content", {}, void 0, void 0, 1)], 8, _hoisted_2), !isSheet.value ? (openBlock(), createElementBlock("div", {
|
|
1122
|
+
key: 0,
|
|
1123
|
+
ref: assignHost,
|
|
1124
|
+
class: "astryx-dropdown-menu-tree"
|
|
1125
|
+
}, null, 512)) : createCommentVNode("v-if", true)], 46, _hoisted_1), [[vShow, isOpen.value && !isSheet.value]])]),
|
|
1354
1126
|
_: 3
|
|
1355
1127
|
})])),
|
|
1356
1128
|
isSheet.value ? (openBlock(), createBlock(_sfc_main$6, {
|
|
@@ -1359,11 +1131,22 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
1359
1131
|
label: __props.label,
|
|
1360
1132
|
"onUpdate:isOpen": onSheetOpen
|
|
1361
1133
|
}, {
|
|
1362
|
-
default: withCtx(() => [
|
|
1134
|
+
default: withCtx(() => [createElementVNode("div", {
|
|
1135
|
+
class: "astryx-context-menu-sheet",
|
|
1136
|
+
role: "menu",
|
|
1137
|
+
"aria-label": __props.label
|
|
1138
|
+
}, [createElementVNode("div", {
|
|
1139
|
+
class: "astryx-dropdown-menu-tree",
|
|
1140
|
+
hidden: unref(isDrilled) || void 0,
|
|
1141
|
+
inert: unref(isDrilled) || void 0
|
|
1142
|
+
}, [__props.items != null ? (openBlock(), createBlock(_sfc_main$1, {
|
|
1363
1143
|
key: 0,
|
|
1364
1144
|
items: __props.items,
|
|
1365
1145
|
onSelect
|
|
1366
|
-
}, null, 8, ["items"])) : renderSlot(_ctx.$slots, "content", {}, void 0, void 0, 1)]),
|
|
1146
|
+
}, null, 8, ["items"])) : renderSlot(_ctx.$slots, "content", {}, void 0, void 0, 1)], 8, _hoisted_4), createElementVNode("div", {
|
|
1147
|
+
ref: assignHost,
|
|
1148
|
+
class: "astryx-dropdown-menu-tree"
|
|
1149
|
+
}, null, 512)], 8, _hoisted_3)]),
|
|
1367
1150
|
_: 3
|
|
1368
1151
|
}, 8, ["is-open", "label"])) : createCommentVNode("v-if", true)
|
|
1369
1152
|
], 64);
|
|
@@ -1371,4 +1154,4 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
1371
1154
|
}
|
|
1372
1155
|
});
|
|
1373
1156
|
//#endregion
|
|
1374
|
-
export { _sfc_main$5 as a, _sfc_main$4 as i, _sfc_main$2 as n,
|
|
1157
|
+
export { _sfc_main$5 as a, _sfc_main$4 as i, _sfc_main$2 as n, _sfc_main$3 as r, _sfc_main as t };
|