@maas/vue-equipment 1.0.0-beta.3 → 1.0.0-beta.30
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/README.md +2 -2
- package/dist/composables/index.d.ts +5 -5
- package/dist/composables/index.js +23 -13
- package/dist/composables/index.js.map +1 -1
- package/dist/nuxt/module.d.mts +2 -1
- package/dist/nuxt/module.json +2 -2
- package/dist/nuxt/module.mjs +32 -25
- package/dist/nuxt/types.d.mts +3 -1
- package/dist/plugins/.turbo/turbo-lint.log +1 -9
- package/dist/plugins/MagicAccordion/nuxt.d.ts +1 -1
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionContent.vue +61 -84
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionContent.vue.d.ts +10 -24
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionProvider.vue +17 -31
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionProvider.vue.d.ts +6 -20
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue +57 -62
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue.d.ts +9 -24
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue +34 -45
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue.d.ts +8 -22
- package/dist/plugins/MagicAccordion/src/composables/private/useAccordionTrigger.d.ts +1 -1
- package/dist/plugins/MagicAccordion/src/composables/private/useAccordionTrigger.mjs +1 -0
- package/dist/plugins/MagicAccordion/src/composables/private/useAccordionView.mjs +1 -0
- package/dist/plugins/MagicAccordion/src/composables/useMagicAccordion.mjs +1 -0
- package/dist/plugins/MagicAccordion/src/symbols/index.d.ts +2 -2
- package/dist/plugins/MagicAccordion/src/types/index.d.ts +2 -2
- package/dist/plugins/MagicCommand/nuxt.d.ts +1 -1
- package/dist/plugins/MagicCommand/src/components/MagicCommandContent.vue +148 -154
- package/dist/plugins/MagicCommand/src/components/MagicCommandContent.vue.d.ts +7 -14
- package/dist/plugins/MagicCommand/src/components/MagicCommandDrawer.vue +42 -52
- package/dist/plugins/MagicCommand/src/components/MagicCommandDrawer.vue.d.ts +6 -20
- package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue +72 -87
- package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue.d.ts +13 -25
- package/dist/plugins/MagicCommand/src/components/MagicCommandModal.vue +37 -47
- package/dist/plugins/MagicCommand/src/components/MagicCommandModal.vue.d.ts +6 -20
- package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue +61 -77
- package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue.d.ts +6 -22
- package/dist/plugins/MagicCommand/src/components/MagicCommandRenderer.vue +23 -39
- package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.vue +80 -86
- package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.vue.d.ts +9 -25
- package/dist/plugins/MagicCommand/src/components/MagicCommandView.vue +36 -48
- package/dist/plugins/MagicCommand/src/components/MagicCommandView.vue.d.ts +8 -22
- package/dist/plugins/MagicCommand/src/composables/private/useCommandScroll.d.ts +2 -2
- package/dist/plugins/MagicCommand/src/composables/private/useCommandState.mjs +1 -1
- package/dist/plugins/MagicCommand/src/composables/private/useCommandTrigger.d.ts +1 -1
- package/dist/plugins/MagicCommand/src/composables/private/useCommandTrigger.mjs +1 -0
- package/dist/plugins/MagicCommand/src/symbols/index.d.ts +4 -4
- package/dist/plugins/MagicCommand/src/types/index.d.ts +3 -3
- package/dist/plugins/MagicCookie/nuxt.d.ts +1 -1
- package/dist/plugins/MagicCookie/src/components/MagicCookieItem.vue +34 -41
- package/dist/plugins/MagicCookie/src/components/MagicCookieItem.vue.d.ts +8 -22
- package/dist/plugins/MagicCookie/src/components/MagicCookieProvider.vue +19 -36
- package/dist/plugins/MagicCookie/src/components/MagicCookieProvider.vue.d.ts +6 -20
- package/dist/plugins/MagicCookie/src/components/MagicCookieView.vue +42 -74
- package/dist/plugins/MagicCookie/src/components/MagicCookieView.vue.d.ts +9 -14
- package/dist/plugins/MagicCookie/src/composables/private/useCookieItem.mjs +0 -1
- package/dist/plugins/MagicCookie/src/symbols/index.d.ts +2 -2
- package/dist/plugins/MagicCookie/src/types/index.d.ts +2 -2
- package/dist/plugins/MagicDraggable/nuxt.d.ts +1 -1
- package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue +82 -100
- package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue.d.ts +6 -24
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableDrag.d.ts +2 -2
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableDrag.mjs +43 -63
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableScrollLock.mjs +34 -14
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableSnap.d.ts +2 -15
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableSnap.mjs +103 -53
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableState.mjs +6 -5
- package/dist/plugins/MagicDraggable/src/types/index.d.ts +4 -3
- package/dist/plugins/MagicDraggable/src/utils/defaultOptions.mjs +1 -1
- package/dist/plugins/MagicDrawer/nuxt.d.ts +1 -1
- package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue +284 -323
- package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue.d.ts +18 -35
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDOM.mjs +34 -14
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDrag.d.ts +2 -2
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDrag.mjs +3 -3
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerGuards.d.ts +1 -1
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerGuards.mjs +28 -10
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerProgress.d.ts +2 -2
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerSnap.d.ts +3 -3
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerSnap.mjs +16 -14
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerWheel.d.ts +1 -1
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerWheel.mjs +1 -1
- package/dist/plugins/MagicDrawer/src/composables/useMagicDrawer.mjs +1 -1
- package/dist/plugins/MagicDrawer/src/types/index.mjs +1 -0
- package/dist/plugins/MagicDrawer/src/utils/defaultOptions.mjs +2 -2
- package/dist/plugins/MagicEmitter/nuxt.d.ts +1 -1
- package/dist/plugins/MagicEmitter/src/composables/useMagicEmitter.d.ts +202 -100
- package/dist/plugins/MagicEmitter/src/types/index.d.ts +2 -0
- package/dist/plugins/MagicMarquee/nuxt.d.ts +1 -1
- package/dist/plugins/MagicMarquee/src/components/MagicMarquee.vue +38 -72
- package/dist/plugins/MagicMarquee/src/components/MagicMarquee.vue.d.ts +8 -24
- package/dist/plugins/MagicMarquee/src/composables/private/useMarqueeApi.d.ts +1 -1
- package/dist/plugins/MagicMarquee/src/composables/private/useMarqueeApi.mjs +8 -2
- package/dist/plugins/MagicMarquee/src/composables/useMagicMarquee.d.ts +1 -1
- package/dist/plugins/MagicMenu/nuxt.d.ts +1 -1
- package/dist/plugins/MagicMenu/src/components/MagicMenuChannel.vue +51 -63
- package/dist/plugins/MagicMenu/src/components/MagicMenuChannel.vue.d.ts +6 -20
- package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue +180 -216
- package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue.d.ts +10 -25
- package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue +171 -198
- package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue.d.ts +8 -24
- package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue +87 -113
- package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue.d.ts +13 -25
- package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.vue +82 -81
- package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.vue.d.ts +6 -22
- package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.vue +63 -86
- package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.vue.d.ts +9 -23
- package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue +94 -97
- package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue.d.ts +11 -25
- package/dist/plugins/MagicMenu/src/components/MagicMenuView.vue +49 -61
- package/dist/plugins/MagicMenu/src/components/MagicMenuView.vue.d.ts +8 -22
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCallback.mjs +1 -1
- package/dist/plugins/MagicMenu/src/composables/private/useMenuChannel.mjs +15 -5
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCursor.d.ts +3 -3
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCursor.mjs +4 -4
- package/dist/plugins/MagicMenu/src/composables/private/useMenuDOM.mjs +35 -15
- package/dist/plugins/MagicMenu/src/composables/private/useMenuKeyListener.mjs +6 -2
- package/dist/plugins/MagicMenu/src/composables/private/useMenuTrigger.d.ts +1 -1
- package/dist/plugins/MagicMenu/src/composables/private/useMenuTrigger.mjs +2 -0
- package/dist/plugins/MagicMenu/src/composables/private/useMenuView.mjs +18 -6
- package/dist/plugins/MagicMenu/src/composables/useMagicMenu.mjs +1 -0
- package/dist/plugins/MagicMenu/src/symbols/index.d.ts +4 -4
- package/dist/plugins/MagicMenu/src/types/index.d.ts +2 -2
- package/dist/plugins/MagicMenu/src/utils/modeDelayDefaults.d.ts +2 -2
- package/dist/plugins/MagicMenu/src/utils/modeDelayDefaults.mjs +2 -2
- package/dist/plugins/MagicModal/nuxt.d.ts +1 -1
- package/dist/plugins/MagicModal/src/components/MagicModal.vue +134 -171
- package/dist/plugins/MagicModal/src/components/MagicModal.vue.d.ts +10 -25
- package/dist/plugins/MagicModal/src/composables/private/useModalDOM.mjs +34 -14
- package/dist/plugins/MagicModal/src/types/index.d.ts +2 -2
- package/dist/plugins/MagicModal/src/types/index.mjs +1 -0
- package/dist/plugins/MagicNoise/nuxt.d.ts +1 -1
- package/dist/plugins/MagicNoise/src/components/MagicNoise.vue +50 -81
- package/dist/plugins/MagicNoise/src/components/MagicNoise.vue.d.ts +1 -10
- package/dist/plugins/MagicNoise/src/composables/private/useNoiseApi.d.ts +3 -3
- package/dist/plugins/MagicNoise/src/composables/private/useNoiseApi.mjs +10 -6
- package/dist/plugins/MagicNoise/src/types/index.d.ts +2 -0
- package/dist/plugins/MagicNoise/src/utils/defaultOptions.mjs +3 -1
- package/dist/plugins/MagicPie/index.d.ts +7 -0
- package/dist/plugins/MagicPie/index.mjs +8 -0
- package/dist/plugins/MagicPie/nuxt.d.ts +2 -0
- package/dist/plugins/MagicPie/nuxt.mjs +23 -0
- package/dist/plugins/MagicPie/src/components/MagicPie.vue +168 -0
- package/dist/plugins/MagicPie/src/components/MagicPie.vue.d.ts +7 -0
- package/dist/plugins/MagicPie/src/composables/private/usePieState.d.ts +6 -0
- package/dist/plugins/MagicPie/src/composables/private/usePieState.mjs +33 -0
- package/dist/plugins/MagicPie/src/composables/useMagicPie.d.ts +13 -0
- package/dist/plugins/MagicPie/src/composables/useMagicPie.mjs +43 -0
- package/dist/plugins/MagicPie/src/types/index.d.ts +9 -0
- package/dist/plugins/MagicPie/src/types/index.mjs +0 -0
- package/dist/plugins/MagicPlayer/nuxt.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudio.vue +93 -65
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue +123 -127
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue.d.ts +9 -25
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerDisplayTime.vue +32 -42
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerDisplayTime.vue.d.ts +1 -10
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.vue +117 -103
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.vue.d.ts +1 -10
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerOverlay.vue +134 -82
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerOverlay.vue.d.ts +17 -13
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerPoster.vue +20 -36
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerPoster.vue.d.ts +5 -10
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerProvider.vue +66 -56
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerProvider.vue.d.ts +6 -22
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerTimeline.vue +60 -109
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideo.vue +118 -68
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideoControls.vue +179 -210
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideoControls.vue.d.ts +24 -34
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerAudioApi.d.ts +0 -4
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerAudioApi.mjs +9 -52
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerControlsApi.d.ts +8 -34
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerControlsApi.mjs +170 -234
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerEmitter.d.ts +8 -0
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerEmitter.mjs +103 -0
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerMediaApi.d.ts +3 -17
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerMediaApi.mjs +59 -176
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerProvider.d.ts +6 -0
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerProvider.mjs +34 -0
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerRuntime.d.ts +3 -4
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerRuntime.mjs +19 -35
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerState.d.ts +7 -0
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerState.mjs +60 -0
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerVideoApi.d.ts +4 -8
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerVideoApi.mjs +43 -91
- package/dist/plugins/MagicPlayer/src/composables/useMagicPlayer.d.ts +37 -52
- package/dist/plugins/MagicPlayer/src/composables/useMagicPlayer.mjs +53 -3
- package/dist/plugins/MagicPlayer/src/css/magic-player-audio-controls.css +0 -1
- package/dist/plugins/MagicPlayer/src/css/magic-player-timeline.css +5 -0
- package/dist/plugins/MagicPlayer/src/symbols/index.d.ts +6 -2
- package/dist/plugins/MagicPlayer/src/symbols/index.mjs +12 -1
- package/dist/plugins/MagicPlayer/src/types/index.d.ts +75 -10
- package/dist/plugins/MagicPlayer/src/utils/defaultOptions.d.ts +2 -2
- package/dist/plugins/MagicPlayer/src/utils/defaultOptions.mjs +6 -1
- package/dist/plugins/MagicPlayer/src/utils/playbackDefaults.d.ts +3 -0
- package/dist/plugins/MagicPlayer/src/utils/playbackDefaults.mjs +7 -0
- package/dist/plugins/MagicScroll/nuxt.d.ts +1 -1
- package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.vue +54 -61
- package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.vue.d.ts +6 -22
- package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue +56 -71
- package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue.d.ts +6 -22
- package/dist/plugins/MagicScroll/src/components/MagicScrollProvider.vue +26 -33
- package/dist/plugins/MagicScroll/src/components/MagicScrollProvider.vue.d.ts +24 -21
- package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue +63 -71
- package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue.d.ts +8 -24
- package/dist/plugins/MagicScroll/src/composables/private/useCollisionDetection.d.ts +2 -2
- package/dist/plugins/MagicScroll/src/composables/private/useCollisionDetection.mjs +16 -6
- package/dist/plugins/MagicScroll/src/composables/private/useScrollApi.d.ts +2 -2
- package/dist/plugins/MagicScroll/src/composables/private/useScrollApi.mjs +41 -26
- package/dist/plugins/MagicScroll/src/symbols/index.d.ts +1 -1
- package/dist/plugins/MagicToast/nuxt.d.ts +1 -1
- package/dist/plugins/MagicToast/src/components/MagicToastProvider.vue +90 -109
- package/dist/plugins/MagicToast/src/components/MagicToastProvider.vue.d.ts +7 -16
- package/dist/plugins/MagicToast/src/components/MagicToastView.vue +53 -81
- package/dist/plugins/MagicToast/src/components/MagicToastView.vue.d.ts +6 -23
- package/dist/plugins/MagicToast/src/composables/private/useToastCallback.d.ts +2 -2
- package/dist/plugins/MagicToast/src/composables/private/useToastCallback.mjs +5 -5
- package/dist/plugins/MagicToast/src/composables/private/useToastDrag.mjs +23 -23
- package/dist/plugins/MagicToast/src/composables/private/useToastListener.mjs +1 -0
- package/dist/plugins/MagicToast/src/composables/private/useToastScrollLock.mjs +33 -15
- package/dist/plugins/MagicToast/src/composables/private/useToastView.mjs +1 -0
- package/dist/plugins/MagicToast/src/composables/useMagicToast.d.ts +1 -0
- package/dist/plugins/MagicToast/src/composables/useMagicToast.mjs +10 -2
- package/dist/plugins/MagicToast/src/types/index.d.ts +3 -3
- package/dist/plugins/MagicToast/src/utils/defaultOptions.mjs +1 -1
- package/dist/plugins/index.d.ts +1 -0
- package/dist/plugins/index.mjs +1 -0
- package/dist/utils/css/animations/fade-down.css +9 -0
- package/dist/utils/css/animations.css +9 -22
- package/dist/utils/css/easings.css +9 -1
- package/dist/utils/css/keyframes.css +22 -0
- package/dist/utils/index.d.ts +9 -4
- package/dist/utils/index.js +39 -3
- package/dist/utils/index.js.map +1 -1
- package/package.json +11 -7
- package/dist/nuxt/module.cjs +0 -5
- package/dist/nuxt/module.d.ts +0 -9
- package/dist/nuxt/types.d.ts +0 -1
- package/dist/plugins/MagicAccordion/demo/data/footer.json +0 -117
- package/dist/plugins/MagicCommand/demo/data/about.json +0 -3
- package/dist/plugins/MagicCommand/demo/data/search.json +0 -594
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerStateEmitter.d.ts +0 -15
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerStateEmitter.mjs +0 -9
- package/dist/utils/css/transitions.css +0 -8
- /package/dist/utils/css/{transitions → animations}/clip.css +0 -0
- /package/dist/utils/css/{transitions → animations}/fade-up.css +0 -0
- /package/dist/utils/css/{transitions → animations}/fade.css +0 -0
- /package/dist/utils/css/{transitions → animations}/slide-btt.css +0 -0
- /package/dist/utils/css/{transitions → animations}/slide-ltr.css +0 -0
- /package/dist/utils/css/{transitions → animations}/slide-rtl.css +0 -0
- /package/dist/utils/css/{transitions → animations}/slide-ttb.css +0 -0
- /package/dist/utils/css/{transitions → animations}/zoom.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/auto-size-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/clip-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/clip-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/fade-down-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/fade-down-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/fade-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/fade-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/fade-up-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/fade-up-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/flip-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/flip-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/slide-btt-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/slide-btt-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/slide-ltr-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/slide-ltr-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/slide-rtl-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/slide-rtl-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/slide-ttb-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/slide-ttb-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/squash-y.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/zoom-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/zoom-out.css +0 -0
|
@@ -1,7 +1,22 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<primitive
|
|
3
|
+
ref="el"
|
|
4
|
+
:data-id="`${mappedViewId}-trigger`"
|
|
5
|
+
:data-active="view?.active"
|
|
6
|
+
:data-disabled="mappedDisabled"
|
|
7
|
+
:tabindex="mappedTabindex"
|
|
8
|
+
:as-child="asChild"
|
|
9
|
+
class="magic-menu-trigger"
|
|
10
|
+
@click="onClick"
|
|
11
|
+
@contextmenu="onClick"
|
|
12
|
+
@mouseenter="onMouseenter"
|
|
13
|
+
>
|
|
14
|
+
<slot :view-active="view?.active" :trigger-disabled="mappedDisabled" />
|
|
15
|
+
</primitive>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script setup>
|
|
19
|
+
import { computed, inject, useTemplateRef, toValue, watch } from "vue";
|
|
5
20
|
import { Primitive } from "@maas/vue-primitive";
|
|
6
21
|
import { useMenuState } from "../composables/private/useMenuState";
|
|
7
22
|
import { useMenuView } from "../composables/private/useMenuView";
|
|
@@ -13,100 +28,82 @@ import {
|
|
|
13
28
|
MagicMenuItemId
|
|
14
29
|
} from "../symbols";
|
|
15
30
|
import { onKeyStroke } from "@vueuse/core";
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
elRef
|
|
73
|
-
});
|
|
74
|
-
watch(
|
|
75
|
-
() => view?.active,
|
|
76
|
-
async (value) => {
|
|
77
|
-
if (value) {
|
|
78
|
-
await new Promise((resolve) => requestAnimationFrame(resolve));
|
|
79
|
-
toValue(elRef)?.$el?.blur();
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
);
|
|
83
|
-
onKeyStroke("Enter", onEnter);
|
|
84
|
-
return (_ctx, _cache) => {
|
|
85
|
-
return _openBlock(), _createBlock(_unref(Primitive), {
|
|
86
|
-
ref_key: "elRef",
|
|
87
|
-
ref: elRef,
|
|
88
|
-
"data-id": `${_unref(viewId)}-trigger`,
|
|
89
|
-
"data-active": _unref(view)?.active,
|
|
90
|
-
"data-disabled": mappedDisabled.value,
|
|
91
|
-
tabindex: mappedTabindex.value,
|
|
92
|
-
"as-child": _ctx.asChild,
|
|
93
|
-
class: "magic-menu-trigger",
|
|
94
|
-
onClick: _unref(onClick),
|
|
95
|
-
onContextmenu: _unref(onClick),
|
|
96
|
-
onMouseenter: _unref(onMouseenter)
|
|
97
|
-
}, {
|
|
98
|
-
default: _withCtx(() => [
|
|
99
|
-
_renderSlot(_ctx.$slots, "default", {
|
|
100
|
-
viewActive: _unref(view)?.active,
|
|
101
|
-
triggerDisabled: mappedDisabled.value
|
|
102
|
-
})
|
|
103
|
-
]),
|
|
104
|
-
_: 3
|
|
105
|
-
/* FORWARDED */
|
|
106
|
-
}, 8, ["data-id", "data-active", "data-disabled", "tabindex", "as-child", "onClick", "onContextmenu", "onMouseenter"]);
|
|
107
|
-
};
|
|
31
|
+
const { instanceId, viewId, disabled, trigger } = defineProps({
|
|
32
|
+
instanceId: { type: String, required: false },
|
|
33
|
+
viewId: { type: String, required: false },
|
|
34
|
+
disabled: { type: Boolean, required: false },
|
|
35
|
+
trigger: { type: Array, required: false },
|
|
36
|
+
asChild: { type: Boolean, required: false }
|
|
37
|
+
});
|
|
38
|
+
const elRef = useTemplateRef("el");
|
|
39
|
+
const injectedInstanceId = inject(MagicMenuInstanceId, void 0);
|
|
40
|
+
const injectedViewId = inject(MagicMenuViewId, void 0);
|
|
41
|
+
const itemId = inject(MagicMenuItemId, void 0);
|
|
42
|
+
const mappedInstanceId = computed(() => instanceId ?? injectedInstanceId);
|
|
43
|
+
const mappedViewId = computed(() => viewId ?? injectedViewId);
|
|
44
|
+
if (!mappedInstanceId.value) {
|
|
45
|
+
throw new Error(
|
|
46
|
+
"MagicMenuRemote must be nested inside MagicMenuProvider or an instanceId must be provided"
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
if (!mappedViewId.value) {
|
|
50
|
+
throw new Error(
|
|
51
|
+
"MagicMenuTrigger must be nested inside MagicMenuView or a viewId must be provided"
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
const { getView, getRelativeViewIndex } = useMenuView(mappedInstanceId.value);
|
|
55
|
+
const view = getView(mappedViewId.value);
|
|
56
|
+
const viewIndex = getRelativeViewIndex(mappedViewId.value);
|
|
57
|
+
const { initializeState } = useMenuState(mappedInstanceId.value);
|
|
58
|
+
const state = initializeState();
|
|
59
|
+
const { getItem } = useMenuItem({
|
|
60
|
+
instanceId: mappedInstanceId.value,
|
|
61
|
+
viewId: mappedViewId.value
|
|
62
|
+
});
|
|
63
|
+
const item = getItem(itemId ?? "");
|
|
64
|
+
const mappedDisabled = computed(() => disabled ?? item?.disabled ?? false);
|
|
65
|
+
const mappedTrigger = computed(() => {
|
|
66
|
+
if (trigger?.length) {
|
|
67
|
+
return trigger;
|
|
68
|
+
}
|
|
69
|
+
switch (state.options.mode) {
|
|
70
|
+
case "menubar":
|
|
71
|
+
return view?.parent.item ? ["mouseenter", "click"] : state.active ? ["mouseenter", "click"] : ["click"];
|
|
72
|
+
case "dropdown":
|
|
73
|
+
return view?.parent.item ? ["mouseenter", "click"] : ["click"];
|
|
74
|
+
case "context":
|
|
75
|
+
return view?.parent.item ? ["mouseenter", "click"] : ["right-click"];
|
|
76
|
+
case "navigation":
|
|
77
|
+
return ["mouseenter"];
|
|
78
|
+
default:
|
|
79
|
+
return [];
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
const mappedTabindex = computed(() => {
|
|
83
|
+
if (viewIndex === 0 && state.options.mode !== "context" && !itemId) {
|
|
84
|
+
return 0;
|
|
85
|
+
} else {
|
|
86
|
+
return void 0;
|
|
108
87
|
}
|
|
109
88
|
});
|
|
89
|
+
const { onMouseenter, onClick, onEnter } = useMenuTrigger({
|
|
90
|
+
instanceId: mappedInstanceId.value,
|
|
91
|
+
viewId: mappedViewId.value,
|
|
92
|
+
itemId,
|
|
93
|
+
mappedDisabled,
|
|
94
|
+
mappedTrigger,
|
|
95
|
+
elRef
|
|
96
|
+
});
|
|
97
|
+
watch(
|
|
98
|
+
() => view?.active,
|
|
99
|
+
async (value) => {
|
|
100
|
+
if (value) {
|
|
101
|
+
await new Promise((resolve) => requestAnimationFrame(resolve));
|
|
102
|
+
toValue(elRef)?.$el?.blur();
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
);
|
|
106
|
+
onKeyStroke("Enter", onEnter);
|
|
110
107
|
</script>
|
|
111
108
|
|
|
112
109
|
<style>
|
|
@@ -114,7 +111,7 @@ export default /* @__PURE__ */ _defineComponent({
|
|
|
114
111
|
cursor: var(--magic-menu-trigger-cursor, pointer);
|
|
115
112
|
}
|
|
116
113
|
|
|
117
|
-
.magic-menu-trigger
|
|
114
|
+
.magic-menu-trigger[data-disabled='true'] {
|
|
118
115
|
pointer-events: none;
|
|
119
116
|
}
|
|
120
117
|
</style>
|
|
@@ -1,36 +1,22 @@
|
|
|
1
1
|
import type { Interaction } from '../types/index.js';
|
|
2
2
|
interface MagicMenuTriggerProps {
|
|
3
|
+
instanceId?: string;
|
|
4
|
+
viewId?: string;
|
|
3
5
|
disabled?: boolean;
|
|
4
6
|
trigger?: Interaction[];
|
|
5
7
|
asChild?: boolean;
|
|
6
8
|
}
|
|
7
|
-
declare
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
default?(_: {
|
|
11
|
-
viewActive: any;
|
|
12
|
-
triggerDisabled: any;
|
|
13
|
-
}): any;
|
|
14
|
-
};
|
|
15
|
-
refs: {
|
|
16
|
-
elRef: any;
|
|
17
|
-
};
|
|
18
|
-
rootEl: any;
|
|
9
|
+
declare var __VLS_13: {
|
|
10
|
+
viewActive: boolean | undefined;
|
|
11
|
+
triggerDisabled: boolean;
|
|
19
12
|
};
|
|
20
|
-
type
|
|
21
|
-
|
|
22
|
-
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
23
|
-
export default _default;
|
|
24
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
25
|
-
type __VLS_TypePropsToOption<T> = {
|
|
26
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
27
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
28
|
-
} : {
|
|
29
|
-
type: import('vue').PropType<T[K]>;
|
|
30
|
-
required: true;
|
|
31
|
-
};
|
|
13
|
+
type __VLS_Slots = {} & {
|
|
14
|
+
default?: (props: typeof __VLS_13) => any;
|
|
32
15
|
};
|
|
33
|
-
|
|
16
|
+
declare const __VLS_component: import("vue").DefineComponent<MagicMenuTriggerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicMenuTriggerProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
17
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
18
|
+
export default _default;
|
|
19
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
34
20
|
new (): {
|
|
35
21
|
$slots: S;
|
|
36
22
|
};
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<div :data-id="mappedId" class="magic-menu-view">
|
|
3
|
+
<slot :view-active="view.active" />
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup>
|
|
5
8
|
import { computed, inject, onBeforeUnmount, provide, useId } from "vue";
|
|
6
9
|
import { useMenuView } from "../composables/private/useMenuView";
|
|
7
10
|
import {
|
|
@@ -12,63 +15,48 @@ import {
|
|
|
12
15
|
MagicMenuViewActive
|
|
13
16
|
} from "../symbols";
|
|
14
17
|
import { useMenuState } from "../composables/private/useMenuState";
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
return "right-start";
|
|
47
|
-
default:
|
|
48
|
-
return void 0;
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
const view = initializeView({
|
|
52
|
-
id: mappedId.value,
|
|
53
|
-
parent: { views: parentTree, item: itemId ?? "" },
|
|
54
|
-
placement: mappedPlacement.value ?? "bottom"
|
|
55
|
-
});
|
|
56
|
-
provide(MagicMenuParentTree, mappedParentTree.value);
|
|
57
|
-
provide(MagicMenuViewId, mappedId.value);
|
|
58
|
-
provide(MagicMenuViewActive, mappedActive);
|
|
59
|
-
onBeforeUnmount(() => {
|
|
60
|
-
deleteView(mappedId.value);
|
|
61
|
-
});
|
|
62
|
-
return (_ctx, _cache) => {
|
|
63
|
-
return _openBlock(), _createElementBlock("div", {
|
|
64
|
-
id: mappedId.value,
|
|
65
|
-
class: "magic-menu-view"
|
|
66
|
-
}, [
|
|
67
|
-
_renderSlot(_ctx.$slots, "default", {
|
|
68
|
-
viewActive: _unref(view).active
|
|
69
|
-
})
|
|
70
|
-
], 8, _hoisted_1);
|
|
71
|
-
};
|
|
18
|
+
const { id, placement } = defineProps({
|
|
19
|
+
id: { type: String, required: false },
|
|
20
|
+
placement: { type: null, required: false }
|
|
21
|
+
});
|
|
22
|
+
const parentTree = inject(MagicMenuParentTree, []);
|
|
23
|
+
const instanceId = inject(MagicMenuInstanceId, void 0);
|
|
24
|
+
const itemId = inject(MagicMenuItemId, void 0);
|
|
25
|
+
if (!instanceId) {
|
|
26
|
+
throw new Error("MagicMenuView must be nested inside MagicMenuProvider");
|
|
27
|
+
}
|
|
28
|
+
const mappedId = computed(() => id ?? `magic-menu-view-${useId()}`);
|
|
29
|
+
const mappedParentTree = computed(() => [...parentTree, mappedId.value]);
|
|
30
|
+
const mappedActive = computed(() => view.active);
|
|
31
|
+
const { initializeView, deleteView } = useMenuView(instanceId);
|
|
32
|
+
const { initializeState } = useMenuState(instanceId);
|
|
33
|
+
const state = initializeState();
|
|
34
|
+
const mappedPlacement = computed(() => {
|
|
35
|
+
if (placement) {
|
|
36
|
+
return placement;
|
|
37
|
+
}
|
|
38
|
+
switch (state.options.mode) {
|
|
39
|
+
case "navigation":
|
|
40
|
+
return "bottom";
|
|
41
|
+
case "menubar":
|
|
42
|
+
return !itemId ? "bottom-start" : "right-start";
|
|
43
|
+
case "dropdown":
|
|
44
|
+
return !itemId ? "bottom" : "right-start";
|
|
45
|
+
case "context":
|
|
46
|
+
return "right-start";
|
|
47
|
+
default:
|
|
48
|
+
return void 0;
|
|
72
49
|
}
|
|
73
50
|
});
|
|
51
|
+
const view = initializeView({
|
|
52
|
+
id: mappedId.value,
|
|
53
|
+
parent: { views: parentTree, item: itemId ?? "" },
|
|
54
|
+
placement: mappedPlacement.value ?? "bottom"
|
|
55
|
+
});
|
|
56
|
+
provide(MagicMenuParentTree, mappedParentTree.value);
|
|
57
|
+
provide(MagicMenuViewId, mappedId.value);
|
|
58
|
+
provide(MagicMenuViewActive, mappedActive);
|
|
59
|
+
onBeforeUnmount(() => {
|
|
60
|
+
deleteView(mappedId.value);
|
|
61
|
+
});
|
|
74
62
|
</script>
|
|
@@ -3,30 +3,16 @@ interface MagicMenuViewProps {
|
|
|
3
3
|
id?: string;
|
|
4
4
|
placement?: Placement;
|
|
5
5
|
}
|
|
6
|
-
declare
|
|
7
|
-
|
|
8
|
-
slots: {
|
|
9
|
-
default?(_: {
|
|
10
|
-
viewActive: any;
|
|
11
|
-
}): any;
|
|
12
|
-
};
|
|
13
|
-
refs: {};
|
|
14
|
-
rootEl: any;
|
|
6
|
+
declare var __VLS_1: {
|
|
7
|
+
viewActive: boolean;
|
|
15
8
|
};
|
|
16
|
-
type
|
|
17
|
-
|
|
18
|
-
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
19
|
-
export default _default;
|
|
20
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
21
|
-
type __VLS_TypePropsToOption<T> = {
|
|
22
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
23
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
24
|
-
} : {
|
|
25
|
-
type: import('vue').PropType<T[K]>;
|
|
26
|
-
required: true;
|
|
27
|
-
};
|
|
9
|
+
type __VLS_Slots = {} & {
|
|
10
|
+
default?: (props: typeof __VLS_1) => any;
|
|
28
11
|
};
|
|
29
|
-
|
|
12
|
+
declare const __VLS_component: import("vue").DefineComponent<MagicMenuViewProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicMenuViewProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
14
|
+
export default _default;
|
|
15
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
30
16
|
new (): {
|
|
31
17
|
$slots: S;
|
|
32
18
|
};
|
|
@@ -24,10 +24,10 @@ export function useMenuCallback(args) {
|
|
|
24
24
|
emitter.emit("afterEnter", { id: toValue(instanceId), viewId });
|
|
25
25
|
const scrollLock = state.options.scrollLock ?? ModeScrollLock[state.options.mode].value;
|
|
26
26
|
if (scrollLock) {
|
|
27
|
-
lockScroll();
|
|
28
27
|
if (typeof scrollLock === "object" && scrollLock.padding) {
|
|
29
28
|
addScrollLockPadding();
|
|
30
29
|
}
|
|
30
|
+
lockScroll();
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
function onBeforeLeave() {
|
|
@@ -22,7 +22,9 @@ export function useMenuChannel(args) {
|
|
|
22
22
|
return channel;
|
|
23
23
|
}
|
|
24
24
|
function unselectSiblings(id) {
|
|
25
|
-
if (!view?.channels)
|
|
25
|
+
if (!view?.channels) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
26
28
|
for (const channel of view.channels) {
|
|
27
29
|
if (channel.id !== id) {
|
|
28
30
|
channel.active = false;
|
|
@@ -30,7 +32,9 @@ export function useMenuChannel(args) {
|
|
|
30
32
|
}
|
|
31
33
|
}
|
|
32
34
|
function getChannel(id) {
|
|
33
|
-
if (!view?.channels)
|
|
35
|
+
if (!view?.channels) {
|
|
36
|
+
return void 0;
|
|
37
|
+
}
|
|
34
38
|
const channel = view.channels.find((ch) => ch.id === id);
|
|
35
39
|
if (channel) {
|
|
36
40
|
channelMap.set(id, channel);
|
|
@@ -44,7 +48,9 @@ export function useMenuChannel(args) {
|
|
|
44
48
|
return channel;
|
|
45
49
|
}
|
|
46
50
|
function deleteChannel(id) {
|
|
47
|
-
if (!view?.channels)
|
|
51
|
+
if (!view?.channels) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
48
54
|
const index = view.channels.findIndex((channel) => channel.id === id);
|
|
49
55
|
if (index !== -1) {
|
|
50
56
|
view.channels.splice(index, 1);
|
|
@@ -53,13 +59,17 @@ export function useMenuChannel(args) {
|
|
|
53
59
|
}
|
|
54
60
|
function selectChannel(id) {
|
|
55
61
|
const channel = getChannel(id);
|
|
56
|
-
if (!channel)
|
|
62
|
+
if (!channel) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
57
65
|
channel.active = true;
|
|
58
66
|
unselectSiblings(id);
|
|
59
67
|
}
|
|
60
68
|
function unselectChannel(id) {
|
|
61
69
|
const channel = getChannel(id);
|
|
62
|
-
if (!channel)
|
|
70
|
+
if (!channel) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
63
73
|
channel.active = false;
|
|
64
74
|
}
|
|
65
75
|
return {
|
|
@@ -7,9 +7,9 @@ export declare function useMenuCursor(view: MenuView, debug?: boolean): {
|
|
|
7
7
|
x: number;
|
|
8
8
|
y: number;
|
|
9
9
|
}[]>;
|
|
10
|
-
isInsideFrom: import("vue").
|
|
11
|
-
isInsideTo: import("vue").
|
|
12
|
-
isInsideTriangle: import("vue").
|
|
10
|
+
isInsideFrom: import("vue").ShallowRef<boolean, boolean>;
|
|
11
|
+
isInsideTo: import("vue").ShallowRef<boolean, boolean>;
|
|
12
|
+
isInsideTriangle: import("vue").ShallowRef<boolean, boolean>;
|
|
13
13
|
initialize: () => void;
|
|
14
14
|
destroy: () => void;
|
|
15
15
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ref } from "vue";
|
|
1
|
+
import { ref, shallowRef } from "vue";
|
|
2
2
|
import { useEventListener } from "@vueuse/core";
|
|
3
3
|
export function useMenuCursor(view, debug = false) {
|
|
4
4
|
let cancelListener = new AbortController();
|
|
@@ -7,9 +7,9 @@ export function useMenuCursor(view, debug = false) {
|
|
|
7
7
|
{ x: 0, y: 0 },
|
|
8
8
|
{ x: 0, y: 0 }
|
|
9
9
|
]);
|
|
10
|
-
const isInsideFrom =
|
|
11
|
-
const isInsideTo =
|
|
12
|
-
const isInsideTriangle =
|
|
10
|
+
const isInsideFrom = shallowRef(false);
|
|
11
|
+
const isInsideTo = shallowRef(false);
|
|
12
|
+
const isInsideTriangle = shallowRef(false);
|
|
13
13
|
function extendTriangle(vertices, pixelAmount) {
|
|
14
14
|
const [a, b, c] = vertices;
|
|
15
15
|
switch (view?.placement) {
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import { ref } from "vue";
|
|
1
|
+
import { ref, shallowRef } from "vue";
|
|
2
2
|
import { useScrollLock } from "@vueuse/core";
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import {
|
|
4
|
+
matchClass,
|
|
5
|
+
scrollbarGutterSupport,
|
|
6
|
+
scrollbarWidth
|
|
7
|
+
} from "@maas/vue-equipment/utils";
|
|
8
|
+
const scrollLock = typeof window !== "undefined" ? useScrollLock(document?.documentElement) : shallowRef(false);
|
|
5
9
|
export function useMenuDOM() {
|
|
6
10
|
const positionFixedElements = ref([]);
|
|
7
11
|
function lockScroll() {
|
|
@@ -12,25 +16,41 @@ export function useMenuDOM() {
|
|
|
12
16
|
}
|
|
13
17
|
function addScrollLockPadding() {
|
|
14
18
|
if (typeof window === "undefined") return;
|
|
15
|
-
const exclude = new RegExp(/magic-menu
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
const exclude = new RegExp(/magic-menu/);
|
|
20
|
+
document.body.style.setProperty(
|
|
21
|
+
"--scrollbar-width",
|
|
22
|
+
`${scrollbarWidth()}px`
|
|
23
|
+
);
|
|
19
24
|
positionFixedElements.value = [
|
|
20
25
|
...document.body.getElementsByTagName("*")
|
|
21
26
|
].filter(
|
|
22
|
-
(x) => getComputedStyle(x, null).getPropertyValue("position") === "fixed" && !matchClass(x, exclude)
|
|
23
|
-
);
|
|
24
|
-
positionFixedElements.value.forEach(
|
|
25
|
-
(elem) => elem.style.paddingRight = "var(--scrollbar-width)"
|
|
27
|
+
(x) => getComputedStyle(x, null).getPropertyValue("position") === "fixed" && getComputedStyle(x, null).getPropertyValue("right") === "0px" && !matchClass(x, exclude)
|
|
26
28
|
);
|
|
29
|
+
switch (scrollbarGutterSupport()) {
|
|
30
|
+
case true:
|
|
31
|
+
document.documentElement.style.scrollbarGutter = "stable";
|
|
32
|
+
positionFixedElements.value.forEach((elem) => {
|
|
33
|
+
elem.style.scrollbarGutter = "stable";
|
|
34
|
+
elem.style.overflow = "auto";
|
|
35
|
+
});
|
|
36
|
+
break;
|
|
37
|
+
case false:
|
|
38
|
+
document.body.style.paddingRight = "var(--scrollbar-width)";
|
|
39
|
+
positionFixedElements.value.forEach(
|
|
40
|
+
(elem) => elem.style.paddingRight = "var(--scrollbar-width)"
|
|
41
|
+
);
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
27
44
|
}
|
|
28
45
|
function removeScrollLockPadding() {
|
|
29
|
-
document.
|
|
46
|
+
document.documentElement.style.scrollbarGutter = "";
|
|
30
47
|
document.body.style.removeProperty("--scrollbar-width");
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
48
|
+
document.body.style.paddingRight = "";
|
|
49
|
+
positionFixedElements.value.forEach((elem) => {
|
|
50
|
+
elem.style.paddingRight = "";
|
|
51
|
+
elem.style.scrollbarGutter = "";
|
|
52
|
+
elem.style.overflow = "";
|
|
53
|
+
});
|
|
34
54
|
}
|
|
35
55
|
return {
|
|
36
56
|
lockScroll,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import {} from "vue";
|
|
1
2
|
import { useMenuState } from "./useMenuState.mjs";
|
|
2
3
|
import { useMenuView } from "./useMenuView.mjs";
|
|
3
4
|
import { useMenuItem } from "./useMenuItem.mjs";
|
|
@@ -20,10 +21,13 @@ export function useMenuKeyListener(instanceId) {
|
|
|
20
21
|
switch (true) {
|
|
21
22
|
case (!state.active && state.options.debug):
|
|
22
23
|
throw new Error(`'MagicMenu ${state.id} is not active'`);
|
|
23
|
-
|
|
24
|
+
case state.active:
|
|
24
25
|
state.input.type = "keyboard";
|
|
25
|
-
e.preventDefault();
|
|
26
26
|
e.stopPropagation();
|
|
27
|
+
e.preventDefault();
|
|
28
|
+
break;
|
|
29
|
+
default:
|
|
30
|
+
state.input.type = "keyboard";
|
|
27
31
|
}
|
|
28
32
|
}
|
|
29
33
|
function getEnabledItems(view) {
|
|
@@ -7,7 +7,7 @@ type UseMenuTriggerArgs = {
|
|
|
7
7
|
itemId?: string;
|
|
8
8
|
mappedDisabled: ComputedRef<boolean>;
|
|
9
9
|
mappedTrigger: ComputedRef<Interaction[]>;
|
|
10
|
-
elRef: Ref<InstanceType<typeof Primitive> |
|
|
10
|
+
elRef: Ref<InstanceType<typeof Primitive> | null>;
|
|
11
11
|
};
|
|
12
12
|
export declare function useMenuTrigger(args: UseMenuTriggerArgs): {
|
|
13
13
|
onMouseenter: () => void;
|