@maas/vue-equipment 0.40.0 → 1.0.0-beta.10
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 +6 -16
- package/dist/composables/index.d.ts +7 -18
- package/dist/composables/index.js +79 -132
- package/dist/composables/index.js.map +1 -1
- package/dist/nuxt/module.json +1 -1
- package/dist/nuxt/module.mjs +35 -42
- package/dist/plugins/.turbo/turbo-build.log +0 -0
- package/dist/plugins/.turbo/turbo-lint.log +5 -0
- package/dist/plugins/.turbo/turbo-release.log +7 -0
- package/dist/plugins/MagicAccordion/demo/data/footer.json +117 -0
- package/dist/plugins/MagicAccordion/index.d.ts +2 -0
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionContent.vue +103 -70
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionContent.vue.d.ts +39 -13
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionProvider.vue +36 -30
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionProvider.vue.d.ts +12 -12
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue +73 -71
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue.d.ts +24 -55
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue +52 -50
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue.d.ts +18 -14
- package/dist/plugins/MagicAccordion/src/composables/private/useAccordionCallback.d.ts +6 -6
- package/dist/plugins/MagicAccordion/src/composables/private/useAccordionCallback.mjs +6 -6
- package/dist/plugins/MagicAccordion/src/composables/private/useAccordionState.mjs +10 -10
- package/dist/plugins/MagicAccordion/src/composables/private/useAccordionTrigger.d.ts +1 -1
- package/dist/plugins/MagicAccordion/src/composables/private/useAccordionView.mjs +11 -10
- package/dist/plugins/MagicAccordion/src/symbols/index.d.ts +2 -2
- package/dist/plugins/MagicAccordion/src/types/index.d.ts +4 -0
- package/dist/plugins/MagicAccordion/src/utils/defaultOptions.d.ts +2 -2
- package/dist/plugins/MagicAccordion/src/utils/defaultOptions.mjs +7 -2
- package/dist/plugins/MagicCommand/demo/data/about.json +3 -0
- package/dist/plugins/MagicCommand/demo/data/search.json +594 -0
- package/dist/plugins/MagicCommand/index.d.ts +2 -0
- package/dist/plugins/MagicCommand/index.mjs +9 -11
- package/dist/plugins/MagicCommand/src/components/MagicCommandContent.vue +199 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandContent.vue.d.ts +32 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandDrawer.vue +60 -53
- package/dist/plugins/MagicCommand/src/components/MagicCommandDrawer.vue.d.ts +14 -14
- package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue +105 -80
- package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue.d.ts +32 -22
- package/dist/plugins/MagicCommand/src/components/MagicCommandModal.vue +55 -53
- package/dist/plugins/MagicCommand/src/components/MagicCommandModal.vue.d.ts +12 -12
- package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue +92 -62
- package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue.d.ts +15 -16
- package/dist/plugins/MagicCommand/src/components/MagicCommandRenderer.vue +63 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandRenderer.vue.d.ts +2 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.vue +111 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.vue.d.ts +40 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandView.vue +56 -73
- package/dist/plugins/MagicCommand/src/components/MagicCommandView.vue.d.ts +16 -16
- package/dist/plugins/MagicCommand/src/composables/private/useCommandCallback.d.ts +14 -0
- package/dist/plugins/MagicCommand/src/composables/private/useCommandCallback.mjs +32 -0
- package/dist/plugins/MagicCommand/src/composables/private/useCommandItem.d.ts +15 -6
- package/dist/plugins/MagicCommand/src/composables/private/useCommandItem.mjs +77 -44
- package/dist/plugins/MagicCommand/src/composables/private/useCommandScroll.d.ts +24 -6
- package/dist/plugins/MagicCommand/src/composables/private/useCommandScroll.mjs +45 -28
- package/dist/plugins/MagicCommand/src/composables/private/useCommandState.d.ts +7 -0
- package/dist/plugins/MagicCommand/src/composables/private/useCommandState.mjs +49 -0
- package/dist/plugins/MagicCommand/src/composables/private/useCommandTrigger.d.ts +18 -0
- package/dist/plugins/MagicCommand/src/composables/private/useCommandTrigger.mjs +76 -0
- package/dist/plugins/MagicCommand/src/composables/private/useCommandView.d.ts +21 -5
- package/dist/plugins/MagicCommand/src/composables/private/useCommandView.mjs +193 -18
- package/dist/plugins/MagicCommand/src/composables/useMagicCommand.d.ts +14 -5
- package/dist/plugins/MagicCommand/src/composables/useMagicCommand.mjs +43 -13
- package/dist/plugins/MagicCommand/src/symbols/index.d.ts +9 -2
- package/dist/plugins/MagicCommand/src/symbols/index.mjs +18 -1
- package/dist/plugins/MagicCommand/src/types/index.d.ts +73 -13
- package/dist/plugins/MagicCommand/src/utils/defaultOptions.d.ts +3 -5
- package/dist/plugins/MagicCommand/src/utils/defaultOptions.mjs +8 -3
- package/dist/plugins/MagicCookie/index.d.ts +5 -3
- package/dist/plugins/MagicCookie/index.mjs +7 -3
- package/dist/plugins/MagicCookie/nuxt.mjs +5 -9
- package/dist/plugins/MagicCookie/src/components/MagicCookieItem.vue +56 -0
- package/dist/plugins/MagicCookie/src/components/MagicCookieItem.vue.d.ts +24 -0
- package/dist/plugins/MagicCookie/src/components/MagicCookieProvider.vue +43 -0
- package/dist/plugins/MagicCookie/src/components/MagicCookieProvider.vue.d.ts +20 -0
- package/dist/plugins/MagicCookie/src/components/MagicCookieView.vue +96 -0
- package/dist/plugins/MagicCookie/src/components/MagicCookieView.vue.d.ts +30 -0
- package/dist/plugins/MagicCookie/src/composables/private/useCookieCallback.d.ts +9 -0
- package/dist/plugins/MagicCookie/src/composables/private/useCookieCallback.mjs +31 -0
- package/dist/plugins/MagicCookie/src/composables/private/useCookieItem.d.ts +16 -0
- package/dist/plugins/MagicCookie/src/composables/private/useCookieItem.mjs +87 -0
- package/dist/plugins/MagicCookie/src/composables/private/useCookieState.d.ts +7 -0
- package/dist/plugins/MagicCookie/src/composables/private/useCookieState.mjs +43 -0
- package/dist/plugins/MagicCookie/src/composables/useMagicCookie.d.ts +15 -15
- package/dist/plugins/MagicCookie/src/composables/useMagicCookie.mjs +59 -60
- package/dist/plugins/MagicCookie/src/symbols/index.d.ts +5 -0
- package/dist/plugins/MagicCookie/src/symbols/index.mjs +4 -0
- package/dist/plugins/MagicCookie/src/types/index.d.ts +31 -13
- package/dist/plugins/MagicCookie/src/utils/defaultOptions.d.ts +4 -0
- package/dist/plugins/MagicCookie/src/utils/defaultOptions.mjs +10 -0
- package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue +136 -97
- package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue.d.ts +95 -18
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableDrag.d.ts +8 -8
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableDrag.mjs +12 -6
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableScrollLock.mjs +34 -14
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableSnap.d.ts +9 -8
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableSnap.mjs +46 -8
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableState.d.ts +2 -1
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableState.mjs +10 -10
- package/dist/plugins/MagicDraggable/src/types/index.d.ts +11 -6
- package/dist/plugins/MagicDraggable/src/utils/defaultOptions.d.ts +3 -8
- package/dist/plugins/MagicDraggable/src/utils/defaultOptions.mjs +6 -6
- package/dist/plugins/MagicDrawer/nuxt.mjs +1 -1
- package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue +501 -337
- package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue.d.ts +166 -19
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerCallback.d.ts +6 -6
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerCallback.mjs +6 -6
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDOM.mjs +34 -14
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDrag.d.ts +9 -11
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDrag.mjs +29 -19
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerGuards.d.ts +3 -4
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerGuards.mjs +28 -10
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerProgress.d.ts +4 -4
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerProgress.mjs +4 -2
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerSnap.d.ts +8 -9
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerSnap.mjs +45 -26
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerState.d.ts +1 -1
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerState.mjs +8 -8
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerWheel.d.ts +3 -3
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerWheel.mjs +23 -19
- package/dist/plugins/MagicDrawer/src/composables/useMagicDrawer.mjs +4 -3
- package/dist/plugins/MagicDrawer/src/types/index.d.ts +10 -3
- package/dist/plugins/MagicDrawer/src/utils/defaultOptions.d.ts +3 -11
- package/dist/plugins/MagicDrawer/src/utils/defaultOptions.mjs +1 -3
- package/dist/plugins/MagicEmitter/src/composables/useMagicEmitter.d.ts +190 -46
- package/dist/plugins/MagicEmitter/src/types/index.d.ts +1 -1
- package/dist/plugins/MagicMarquee/index.d.ts +4 -2
- package/dist/plugins/MagicMarquee/index.mjs +2 -1
- package/dist/plugins/MagicMarquee/src/components/MagicMarquee.vue +121 -50
- package/dist/plugins/MagicMarquee/src/components/MagicMarquee.vue.d.ts +18 -25
- package/dist/plugins/MagicMarquee/src/composables/private/useMarqueeApi.d.ts +4 -8
- package/dist/plugins/MagicMarquee/src/composables/private/useMarqueeApi.mjs +57 -43
- package/dist/plugins/MagicMarquee/src/composables/private/useMarqueeState.d.ts +7 -0
- package/dist/plugins/MagicMarquee/src/composables/private/useMarqueeState.mjs +42 -0
- package/dist/plugins/MagicMarquee/src/composables/useMagicMarquee.d.ts +11 -0
- package/dist/plugins/MagicMarquee/src/composables/useMagicMarquee.mjs +45 -0
- package/dist/plugins/MagicMarquee/src/types/index.d.ts +9 -0
- package/dist/plugins/MagicMarquee/src/types/index.mjs +0 -0
- package/dist/plugins/MagicMarquee/src/utils/defaultOptions.d.ts +4 -0
- package/dist/plugins/MagicMarquee/src/utils/defaultOptions.mjs +5 -0
- package/dist/plugins/MagicMenu/index.d.ts +2 -0
- package/dist/plugins/MagicMenu/nuxt.mjs +1 -1
- package/dist/plugins/MagicMenu/src/components/MagicMenuChannel.vue +78 -69
- package/dist/plugins/MagicMenu/src/components/MagicMenuChannel.vue.d.ts +17 -11
- package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue +245 -216
- package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue.d.ts +42 -14
- package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue +234 -212
- package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue.d.ts +42 -17
- package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue +115 -124
- package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue.d.ts +28 -16
- package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.vue +105 -96
- package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.vue.d.ts +14 -15
- package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.vue +88 -87
- package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.vue.d.ts +19 -14
- package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue +121 -112
- package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue.d.ts +27 -51
- package/dist/plugins/MagicMenu/src/components/MagicMenuView.vue +67 -70
- package/dist/plugins/MagicMenu/src/components/MagicMenuView.vue.d.ts +15 -11
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCallback.d.ts +6 -6
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCallback.mjs +9 -9
- package/dist/plugins/MagicMenu/src/composables/private/useMenuChannel.mjs +44 -25
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCursor.d.ts +3 -3
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCursor.mjs +16 -10
- package/dist/plugins/MagicMenu/src/composables/private/useMenuDOM.mjs +35 -15
- package/dist/plugins/MagicMenu/src/composables/private/useMenuItem.d.ts +1 -1
- package/dist/plugins/MagicMenu/src/composables/private/useMenuItem.mjs +20 -14
- package/dist/plugins/MagicMenu/src/composables/private/useMenuKeyListener.mjs +20 -13
- package/dist/plugins/MagicMenu/src/composables/private/useMenuState.mjs +10 -10
- package/dist/plugins/MagicMenu/src/composables/private/useMenuTrigger.d.ts +1 -1
- package/dist/plugins/MagicMenu/src/composables/private/useMenuTrigger.mjs +6 -3
- package/dist/plugins/MagicMenu/src/composables/private/useMenuView.d.ts +3 -3
- package/dist/plugins/MagicMenu/src/composables/private/useMenuView.mjs +111 -75
- package/dist/plugins/MagicMenu/src/symbols/index.d.ts +4 -4
- package/dist/plugins/MagicMenu/src/types/index.d.ts +1 -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/src/components/MagicModal.vue +266 -166
- package/dist/plugins/MagicModal/src/components/MagicModal.vue.d.ts +45 -17
- package/dist/plugins/MagicModal/src/composables/private/useModalCallback.d.ts +6 -6
- package/dist/plugins/MagicModal/src/composables/private/useModalCallback.mjs +6 -6
- package/dist/plugins/MagicModal/src/composables/private/useModalDOM.mjs +34 -14
- package/dist/plugins/MagicModal/src/composables/private/useModalStore.mjs +1 -1
- package/dist/plugins/MagicModal/src/types/index.d.ts +2 -2
- package/dist/plugins/MagicModal/src/utils/defaultOptions.mjs +2 -2
- package/dist/plugins/MagicNoise/index.d.ts +3 -1
- package/dist/plugins/MagicNoise/src/components/MagicNoise.vue +120 -63
- package/dist/plugins/MagicNoise/src/components/MagicNoise.vue.d.ts +2 -4
- package/dist/plugins/MagicNoise/src/composables/private/useNoiseApi.d.ts +3 -3
- package/dist/plugins/MagicNoise/src/composables/private/useNoiseApi.mjs +4 -4
- package/dist/plugins/MagicPie/index.d.ts +7 -0
- package/dist/plugins/MagicPie/index.mjs +8 -0
- package/dist/plugins/MagicPie/nuxt.mjs +23 -0
- package/dist/plugins/MagicPie/src/components/MagicPie.vue +202 -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/index.d.ts +4 -9
- package/dist/plugins/MagicPlayer/index.mjs +11 -17
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudio.vue +84 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudio.vue.d.ts +2 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue +128 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue.d.ts +34 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerDisplayTime.vue +45 -41
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerDisplayTime.vue.d.ts +2 -5
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.vue +127 -114
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.vue.d.ts +4 -5
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerOverlay.vue +111 -58
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerOverlay.vue.d.ts +30 -18
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerPoster.vue +42 -23
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerPoster.vue.d.ts +14 -15
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerProvider.vue +82 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerProvider.vue.d.ts +34 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerTimeline.vue +111 -65
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerTimeline.vue.d.ts +1 -4
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideo.vue +93 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideo.vue.d.ts +2 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideoControls.vue +221 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideoControls.vue.d.ts +73 -0
- package/dist/plugins/MagicPlayer/src/components/icons/FullscreenEnter.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/icons/FullscreenExit.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/icons/Pause.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/icons/Play.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/icons/VolumeOff.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/icons/VolumeOn.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/icons/Waiting.vue +23 -1
- package/dist/plugins/MagicPlayer/src/components/icons/Waiting.vue.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerAudioApi.d.ts +2 -2
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerAudioApi.mjs +8 -9
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerControlsApi.d.ts +10 -10
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerControlsApi.mjs +33 -31
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerMediaApi.d.ts +13 -13
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerMediaApi.mjs +31 -24
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerRuntime.d.ts +5 -5
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerRuntime.mjs +7 -7
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerVideoApi.d.ts +6 -6
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerVideoApi.mjs +10 -12
- package/dist/plugins/MagicPlayer/src/composables/useMagicPlayer.d.ts +22 -26
- package/dist/plugins/MagicPlayer/src/composables/useMagicPlayer.mjs +5 -5
- package/dist/plugins/MagicPlayer/src/css/magic-player-audio-controls.css +95 -0
- package/dist/plugins/MagicPlayer/src/css/magic-player-display-time.css +10 -0
- package/dist/plugins/MagicPlayer/src/css/magic-player-timeline.css +89 -0
- package/dist/plugins/MagicPlayer/src/css/magic-player-video-controls.css +115 -0
- package/dist/plugins/MagicPlayer/src/symbols/index.d.ts +5 -0
- package/dist/plugins/MagicPlayer/src/symbols/index.mjs +3 -0
- package/dist/plugins/MagicPlayer/src/types/index.d.ts +11 -1
- package/dist/plugins/MagicPlayer/src/utils/defaultOptions.d.ts +3 -0
- package/dist/plugins/MagicPlayer/src/utils/defaultOptions.mjs +12 -0
- package/dist/plugins/MagicScroll/index.d.ts +4 -10
- package/dist/plugins/MagicScroll/index.mjs +2 -11
- package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.vue +76 -31
- package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.vue.d.ts +13 -17
- package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue +78 -64
- package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue.d.ts +13 -20
- package/dist/plugins/MagicScroll/src/components/MagicScrollProvider.vue +39 -39
- package/dist/plugins/MagicScroll/src/components/MagicScrollProvider.vue.d.ts +48 -34
- package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue +84 -73
- package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue.d.ts +16 -21
- package/dist/plugins/MagicScroll/src/composables/private/useCollisionDetection.d.ts +13 -0
- package/dist/plugins/MagicScroll/src/composables/private/useCollisionDetection.mjs +130 -0
- package/dist/plugins/MagicScroll/src/composables/private/useScrollApi.d.ts +3 -3
- package/dist/plugins/MagicScroll/src/composables/private/useScrollApi.mjs +19 -7
- package/dist/plugins/MagicScroll/src/symbols/index.d.ts +2 -2
- package/dist/plugins/MagicScroll/src/symbols/index.mjs +2 -2
- package/dist/plugins/MagicScroll/src/types/index.d.ts +12 -22
- package/dist/plugins/MagicToast/index.d.ts +3 -2
- package/dist/plugins/MagicToast/index.mjs +3 -3
- package/dist/plugins/MagicToast/nuxt.mjs +2 -2
- package/dist/plugins/MagicToast/src/components/MagicToastProvider.vue +290 -0
- package/dist/plugins/MagicToast/src/components/{MagicToast.vue.d.ts → MagicToastProvider.vue.d.ts} +4 -4
- package/dist/plugins/MagicToast/src/components/MagicToastView.vue +152 -0
- package/dist/plugins/MagicToast/src/components/MagicToastView.vue.d.ts +34 -0
- package/dist/plugins/MagicToast/src/composables/private/useToastCallback.d.ts +8 -31
- package/dist/plugins/MagicToast/src/composables/private/useToastCallback.mjs +33 -28
- package/dist/plugins/MagicToast/src/composables/private/useToastDrag.d.ts +12 -0
- package/dist/plugins/MagicToast/src/composables/private/useToastDrag.mjs +312 -0
- package/dist/plugins/MagicToast/src/composables/private/useToastListener.d.ts +6 -0
- package/dist/plugins/MagicToast/src/composables/private/useToastListener.mjs +25 -0
- package/dist/plugins/MagicToast/src/composables/private/useToastScrollLock.d.ts +6 -0
- package/dist/plugins/MagicToast/src/composables/private/useToastScrollLock.mjs +59 -0
- package/dist/plugins/MagicToast/src/composables/private/useToastState.d.ts +7 -0
- package/dist/plugins/MagicToast/src/composables/private/useToastState.mjs +45 -0
- package/dist/plugins/MagicToast/src/composables/private/useToastView.d.ts +12 -0
- package/dist/plugins/MagicToast/src/composables/private/useToastView.mjs +51 -0
- package/dist/plugins/MagicToast/src/composables/useMagicToast.d.ts +14 -8
- package/dist/plugins/MagicToast/src/composables/useMagicToast.mjs +34 -23
- package/dist/plugins/MagicToast/src/types/index.d.ts +58 -17
- package/dist/plugins/MagicToast/src/utils/defaultOptions.d.ts +2 -3
- package/dist/plugins/MagicToast/src/utils/defaultOptions.mjs +21 -4
- package/dist/plugins/MagicToast/symbols/index.d.ts +3 -0
- package/dist/plugins/MagicToast/symbols/index.mjs +2 -0
- package/dist/plugins/index.d.ts +1 -1
- package/dist/plugins/index.mjs +1 -1
- package/dist/utils/css/animations/auto-size-out.css +12 -0
- package/dist/utils/css/animations/squash-y.css +5 -0
- package/dist/utils/css/animations.css +2 -1
- package/dist/utils/index.d.ts +10 -6
- package/dist/utils/index.js +41 -56
- package/dist/utils/index.js.map +1 -1
- package/package.json +62 -58
- package/dist/composables/index.d.mts +0 -108
- package/dist/composables/index.mjs +0 -383
- package/dist/composables/index.mjs.map +0 -1
- package/dist/plugins/MagicAutoSize/index.d.ts +0 -4
- package/dist/plugins/MagicAutoSize/index.mjs +0 -7
- package/dist/plugins/MagicAutoSize/nuxt.mjs +0 -14
- package/dist/plugins/MagicAutoSize/src/components/MagicAutoSize.vue +0 -152
- package/dist/plugins/MagicAutoSize/src/components/MagicAutoSize.vue.d.ts +0 -29
- package/dist/plugins/MagicCommand/src/components/MagicCommandBody.vue +0 -91
- package/dist/plugins/MagicCommand/src/components/MagicCommandBody.vue.d.ts +0 -19
- package/dist/plugins/MagicCommand/src/components/MagicCommandFooter.vue +0 -5
- package/dist/plugins/MagicCommand/src/components/MagicCommandFooter.vue.d.ts +0 -17
- package/dist/plugins/MagicCommand/src/components/MagicCommandGroup.vue +0 -5
- package/dist/plugins/MagicCommand/src/components/MagicCommandGroup.vue.d.ts +0 -17
- package/dist/plugins/MagicCommand/src/components/MagicCommandHead.vue +0 -5
- package/dist/plugins/MagicCommand/src/components/MagicCommandHead.vue.d.ts +0 -17
- package/dist/plugins/MagicCommand/src/composables/private/useCommandStore.d.ts +0 -35
- package/dist/plugins/MagicCommand/src/composables/private/useCommandStore.mjs +0 -67
- package/dist/plugins/MagicCookie/src/components/MagicCookie.vue +0 -117
- package/dist/plugins/MagicCookie/src/components/MagicCookie.vue.d.ts +0 -27
- package/dist/plugins/MagicCookie/src/composables/private/useCookieApi.d.ts +0 -29
- package/dist/plugins/MagicCookie/src/composables/private/useCookieApi.mjs +0 -22
- package/dist/plugins/MagicPlayer/src/components/MagicAudioPlayer.vue +0 -89
- package/dist/plugins/MagicPlayer/src/components/MagicAudioPlayer.vue.d.ts +0 -28
- package/dist/plugins/MagicPlayer/src/components/MagicAudioPlayerControls.vue +0 -95
- package/dist/plugins/MagicPlayer/src/components/MagicAudioPlayerControls.vue.d.ts +0 -24
- package/dist/plugins/MagicPlayer/src/components/MagicPlayer.vue +0 -125
- package/dist/plugins/MagicPlayer/src/components/MagicPlayer.vue.d.ts +0 -35
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerControls.vue +0 -152
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerControls.vue.d.ts +0 -38
- package/dist/plugins/MagicScroll/src/components/MagicScrollTransform.vue +0 -42
- package/dist/plugins/MagicScroll/src/components/MagicScrollTransform.vue.d.ts +0 -36
- package/dist/plugins/MagicScroll/src/composables/private/useCollisionDetect.d.ts +0 -56
- package/dist/plugins/MagicScroll/src/composables/private/useCollisionDetect.mjs +0 -140
- package/dist/plugins/MagicToast/src/components/MagicToast.vue +0 -141
- package/dist/plugins/MagicToast/src/components/MagicToastComponent.vue +0 -64
- package/dist/plugins/MagicToast/src/components/MagicToastComponent.vue.d.ts +0 -30
- package/dist/plugins/MagicToast/src/composables/private/useToastApi.d.ts +0 -5
- package/dist/plugins/MagicToast/src/composables/private/useToastApi.mjs +0 -22
- package/dist/plugins/MagicToast/src/composables/private/useToastInternalApi.d.ts +0 -4
- package/dist/plugins/MagicToast/src/composables/private/useToastInternalApi.mjs +0 -28
- package/dist/plugins/MagicToast/src/composables/private/useToastStore.d.ts +0 -27
- package/dist/plugins/MagicToast/src/composables/private/useToastStore.mjs +0 -41
- package/dist/utils/index.d.mts +0 -80
- package/dist/utils/index.mjs +0 -200
- package/dist/utils/index.mjs.map +0 -1
- /package/dist/plugins/{MagicAutoSize → MagicPie}/nuxt.d.ts +0 -0
|
@@ -1,77 +1,74 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
<script lang="ts" setup>
|
|
8
|
-
import { computed, inject, onBeforeUnmount, provide, useId } from 'vue'
|
|
9
|
-
import { useMenuView } from '../composables/private/useMenuView'
|
|
1
|
+
<script>
|
|
2
|
+
import { defineComponent as _defineComponent } from "vue";
|
|
3
|
+
import { unref as _unref, renderSlot as _renderSlot, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
4
|
+
const _hoisted_1 = ["data-id"];
|
|
5
|
+
import { computed, inject, onBeforeUnmount, provide, useId } from "vue";
|
|
6
|
+
import { useMenuView } from "../composables/private/useMenuView";
|
|
10
7
|
import {
|
|
11
8
|
MagicMenuInstanceId,
|
|
12
9
|
MagicMenuViewId,
|
|
13
10
|
MagicMenuParentTree,
|
|
14
11
|
MagicMenuItemId,
|
|
15
|
-
MagicMenuViewActive
|
|
16
|
-
} from
|
|
17
|
-
import
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
const
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
12
|
+
MagicMenuViewActive
|
|
13
|
+
} from "../symbols";
|
|
14
|
+
import { useMenuState } from "../composables/private/useMenuState";
|
|
15
|
+
export default /* @__PURE__ */ _defineComponent({
|
|
16
|
+
__name: "MagicMenuView",
|
|
17
|
+
props: {
|
|
18
|
+
id: { type: String, required: false },
|
|
19
|
+
placement: { type: null, required: false }
|
|
20
|
+
},
|
|
21
|
+
setup(__props) {
|
|
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(() => __props.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 (__props.placement) {
|
|
36
|
+
return __props.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;
|
|
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
|
+
"data-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
|
+
};
|
|
46
72
|
}
|
|
47
|
-
|
|
48
|
-
switch (state.options.mode) {
|
|
49
|
-
case 'navigation':
|
|
50
|
-
return 'bottom'
|
|
51
|
-
case 'menubar':
|
|
52
|
-
return !itemId ? 'bottom-start' : 'right-start'
|
|
53
|
-
case 'dropdown':
|
|
54
|
-
return !itemId ? 'bottom' : 'right-start'
|
|
55
|
-
case 'context':
|
|
56
|
-
return 'right-start'
|
|
57
|
-
default:
|
|
58
|
-
return 'bottom'
|
|
59
|
-
}
|
|
60
|
-
})
|
|
61
|
-
|
|
62
|
-
const view = initializeView({
|
|
63
|
-
id: mappedId.value,
|
|
64
|
-
parent: { views: parentTree, item: itemId ?? '' },
|
|
65
|
-
placement: mappedPlacement.value,
|
|
66
|
-
})
|
|
67
|
-
|
|
68
|
-
// Pass id, active state and parent tree to children
|
|
69
|
-
provide(MagicMenuParentTree, mappedParentTree.value)
|
|
70
|
-
provide(MagicMenuViewId, mappedId.value)
|
|
71
|
-
provide(MagicMenuViewActive, view.active)
|
|
72
|
-
|
|
73
|
-
// Lifecycle
|
|
74
|
-
onBeforeUnmount(() => {
|
|
75
|
-
deleteView(mappedId.value)
|
|
76
|
-
})
|
|
73
|
+
});
|
|
77
74
|
</script>
|
|
@@ -3,19 +3,23 @@ interface MagicMenuViewProps {
|
|
|
3
3
|
id?: string;
|
|
4
4
|
placement?: Placement;
|
|
5
5
|
}
|
|
6
|
-
declare
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
refs: {};
|
|
12
|
-
rootEl: HTMLDivElement;
|
|
6
|
+
declare const mappedId: import("vue").ComputedRef<string>;
|
|
7
|
+
declare const view: import("../types").MenuView;
|
|
8
|
+
declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
|
|
9
|
+
declare var __VLS_1: {
|
|
10
|
+
viewActive: boolean;
|
|
13
11
|
};
|
|
14
|
-
type
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
|
|
13
|
+
default?: (props: typeof __VLS_1) => any;
|
|
14
|
+
}>;
|
|
15
|
+
declare const __VLS_self: import("vue").DefineComponent<MagicMenuViewProps, {
|
|
16
|
+
mappedId: typeof mappedId;
|
|
17
|
+
view: typeof view;
|
|
18
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicMenuViewProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
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>;
|
|
20
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
17
21
|
export default _default;
|
|
18
|
-
type
|
|
22
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
19
23
|
new (): {
|
|
20
24
|
$slots: S;
|
|
21
25
|
};
|
|
@@ -12,11 +12,11 @@ type UseMenuCallbackArgs = {
|
|
|
12
12
|
removeScrollLockPadding: () => void;
|
|
13
13
|
};
|
|
14
14
|
export declare function useMenuCallback(args: UseMenuCallbackArgs): {
|
|
15
|
-
onBeforeEnter: (
|
|
16
|
-
onEnter: (
|
|
17
|
-
onAfterEnter: (
|
|
18
|
-
onBeforeLeave: (
|
|
19
|
-
onLeave: (
|
|
20
|
-
onAfterLeave: (
|
|
15
|
+
onBeforeEnter: () => void;
|
|
16
|
+
onEnter: () => void;
|
|
17
|
+
onAfterEnter: () => void;
|
|
18
|
+
onBeforeLeave: () => void;
|
|
19
|
+
onLeave: () => void;
|
|
20
|
+
onAfterLeave: () => void;
|
|
21
21
|
};
|
|
22
22
|
export {};
|
|
@@ -14,32 +14,32 @@ export function useMenuCallback(args) {
|
|
|
14
14
|
removeScrollLockPadding
|
|
15
15
|
} = args;
|
|
16
16
|
const emitter = useMagicEmitter();
|
|
17
|
-
function onBeforeEnter(
|
|
17
|
+
function onBeforeEnter() {
|
|
18
18
|
emitter.emit("beforeEnter", { id: toValue(instanceId), viewId });
|
|
19
19
|
}
|
|
20
|
-
function onEnter(
|
|
20
|
+
function onEnter() {
|
|
21
21
|
emitter.emit("enter", { id: toValue(instanceId), viewId });
|
|
22
22
|
}
|
|
23
|
-
function onAfterEnter(
|
|
23
|
+
function onAfterEnter() {
|
|
24
24
|
emitter.emit("afterEnter", { id: toValue(instanceId), viewId });
|
|
25
25
|
const scrollLock = state.options.scrollLock ?? ModeScrollLock[state.options.mode].value;
|
|
26
|
-
if (
|
|
27
|
-
lockScroll();
|
|
26
|
+
if (scrollLock) {
|
|
28
27
|
if (typeof scrollLock === "object" && scrollLock.padding) {
|
|
29
28
|
addScrollLockPadding();
|
|
30
29
|
}
|
|
30
|
+
lockScroll();
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
function onBeforeLeave(
|
|
33
|
+
function onBeforeLeave() {
|
|
34
34
|
emitter.emit("beforeLeave", { id: toValue(instanceId), viewId });
|
|
35
35
|
}
|
|
36
|
-
function onLeave(
|
|
36
|
+
function onLeave() {
|
|
37
37
|
emitter.emit("leave", { id: toValue(instanceId), viewId });
|
|
38
38
|
}
|
|
39
|
-
function onAfterLeave(
|
|
39
|
+
function onAfterLeave() {
|
|
40
40
|
emitter.emit("afterLeave", { id: toValue(instanceId), viewId });
|
|
41
41
|
const scrollLock = state.options.scrollLock ?? ModeScrollLock[state.options.mode].value;
|
|
42
|
-
if (
|
|
42
|
+
if (scrollLock) {
|
|
43
43
|
unlockScroll();
|
|
44
44
|
if (typeof scrollLock === "object" && scrollLock.padding) {
|
|
45
45
|
removeScrollLockPadding();
|
|
@@ -4,54 +4,73 @@ export function useMenuChannel(args) {
|
|
|
4
4
|
const { instanceId, viewId } = args;
|
|
5
5
|
const { getView } = useMenuView(instanceId);
|
|
6
6
|
const view = getView(viewId);
|
|
7
|
+
const channelMap = /* @__PURE__ */ new Map();
|
|
7
8
|
function createChannel(args2) {
|
|
8
9
|
const { id } = args2;
|
|
9
|
-
const channel = {
|
|
10
|
+
const channel = reactive({
|
|
10
11
|
id,
|
|
11
12
|
active: false
|
|
12
|
-
};
|
|
13
|
-
|
|
13
|
+
});
|
|
14
|
+
channelMap.set(id, channel);
|
|
15
|
+
return channel;
|
|
14
16
|
}
|
|
15
17
|
function addChannel(args2) {
|
|
16
18
|
const channel = createChannel(args2);
|
|
17
19
|
if (view?.channels) {
|
|
18
|
-
view.channels
|
|
20
|
+
view.channels.push(channel);
|
|
19
21
|
}
|
|
20
22
|
return channel;
|
|
21
23
|
}
|
|
22
24
|
function unselectSiblings(id) {
|
|
23
|
-
|
|
25
|
+
if (!view?.channels) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
for (const channel of view.channels) {
|
|
29
|
+
if (channel.id !== id) {
|
|
30
|
+
channel.active = false;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
24
33
|
}
|
|
25
|
-
function
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
34
|
+
function getChannel(id) {
|
|
35
|
+
if (!view?.channels) {
|
|
36
|
+
return void 0;
|
|
37
|
+
}
|
|
38
|
+
const channel = view.channels.find((ch) => ch.id === id);
|
|
39
|
+
if (channel) {
|
|
40
|
+
channelMap.set(id, channel);
|
|
30
41
|
return channel;
|
|
31
42
|
}
|
|
32
|
-
return
|
|
43
|
+
return void 0;
|
|
33
44
|
}
|
|
34
|
-
function
|
|
35
|
-
|
|
36
|
-
|
|
45
|
+
function initializeChannel(args2) {
|
|
46
|
+
const { id } = args2;
|
|
47
|
+
const channel = getChannel(id) ?? addChannel(args2);
|
|
48
|
+
return channel;
|
|
37
49
|
}
|
|
38
|
-
function
|
|
39
|
-
|
|
40
|
-
return
|
|
41
|
-
}
|
|
50
|
+
function deleteChannel(id) {
|
|
51
|
+
if (!view?.channels) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
const index = view.channels.findIndex((channel) => channel.id === id);
|
|
55
|
+
if (index !== -1) {
|
|
56
|
+
view.channels.splice(index, 1);
|
|
57
|
+
channelMap.delete(id);
|
|
58
|
+
}
|
|
42
59
|
}
|
|
43
60
|
function selectChannel(id) {
|
|
44
|
-
const
|
|
45
|
-
if (
|
|
46
|
-
|
|
47
|
-
unselectSiblings(id);
|
|
61
|
+
const channel = getChannel(id);
|
|
62
|
+
if (!channel) {
|
|
63
|
+
return;
|
|
48
64
|
}
|
|
65
|
+
channel.active = true;
|
|
66
|
+
unselectSiblings(id);
|
|
49
67
|
}
|
|
50
68
|
function unselectChannel(id) {
|
|
51
|
-
const
|
|
52
|
-
if (
|
|
53
|
-
|
|
69
|
+
const channel = getChannel(id);
|
|
70
|
+
if (!channel) {
|
|
71
|
+
return;
|
|
54
72
|
}
|
|
73
|
+
channel.active = false;
|
|
55
74
|
}
|
|
56
75
|
return {
|
|
57
76
|
initializeChannel,
|
|
@@ -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) {
|
|
@@ -20,18 +20,20 @@ export function useMenuCursor(view, debug = false) {
|
|
|
20
20
|
case "top-start":
|
|
21
21
|
case "top-end":
|
|
22
22
|
switch (true) {
|
|
23
|
-
case (a.y < b.y && a.y < c.y):
|
|
23
|
+
case (a.y < b.y && a.y < c.y): {
|
|
24
24
|
b.y += pixelAmount;
|
|
25
25
|
b.x -= pixelAmount;
|
|
26
26
|
c.y += pixelAmount;
|
|
27
27
|
c.x += pixelAmount;
|
|
28
28
|
break;
|
|
29
|
-
|
|
29
|
+
}
|
|
30
|
+
case (a.y > b.y && a.y > c.y): {
|
|
30
31
|
b.y -= pixelAmount;
|
|
31
32
|
b.x -= pixelAmount;
|
|
32
33
|
c.y -= pixelAmount;
|
|
33
34
|
c.x += pixelAmount;
|
|
34
35
|
break;
|
|
36
|
+
}
|
|
35
37
|
}
|
|
36
38
|
break;
|
|
37
39
|
case "right":
|
|
@@ -41,18 +43,20 @@ export function useMenuCursor(view, debug = false) {
|
|
|
41
43
|
case "left-start":
|
|
42
44
|
case "left-end":
|
|
43
45
|
switch (true) {
|
|
44
|
-
case (a.x < b.x && a.x < c.x):
|
|
46
|
+
case (a.x < b.x && a.x < c.x): {
|
|
45
47
|
b.x += pixelAmount;
|
|
46
48
|
b.y -= pixelAmount;
|
|
47
49
|
c.x += pixelAmount;
|
|
48
50
|
c.y += pixelAmount;
|
|
49
51
|
break;
|
|
50
|
-
|
|
52
|
+
}
|
|
53
|
+
case (a.x > b.x && a.x > c.x): {
|
|
51
54
|
b.x -= pixelAmount;
|
|
52
55
|
b.y -= pixelAmount;
|
|
53
56
|
c.x -= pixelAmount;
|
|
54
57
|
c.y += pixelAmount;
|
|
55
58
|
break;
|
|
59
|
+
}
|
|
56
60
|
}
|
|
57
61
|
break;
|
|
58
62
|
}
|
|
@@ -90,25 +94,27 @@ export function useMenuCursor(view, debug = false) {
|
|
|
90
94
|
case "top-end":
|
|
91
95
|
case "bottom":
|
|
92
96
|
case "bottom-start":
|
|
93
|
-
case "bottom-end":
|
|
97
|
+
case "bottom-end": {
|
|
94
98
|
const topDist = Math.abs(top - centerPoint.y);
|
|
95
99
|
const bottomDist = Math.abs(bottom - centerPoint.y);
|
|
96
100
|
const mappedY = topDist < bottomDist ? top : bottom;
|
|
97
101
|
sidePoints.push({ x: left, y: mappedY });
|
|
98
102
|
sidePoints.push({ x: right, y: mappedY });
|
|
99
103
|
break;
|
|
104
|
+
}
|
|
100
105
|
case "right":
|
|
101
106
|
case "right-start":
|
|
102
107
|
case "right-end":
|
|
103
108
|
case "left":
|
|
104
109
|
case "left-start":
|
|
105
|
-
case "left-end":
|
|
110
|
+
case "left-end": {
|
|
106
111
|
const rightDist = Math.abs(right - centerPoint.x);
|
|
107
112
|
const leftDist = Math.abs(left - centerPoint.x);
|
|
108
113
|
const mappedX = rightDist < leftDist ? right : left;
|
|
109
114
|
sidePoints.push({ x: mappedX, y: top });
|
|
110
115
|
sidePoints.push({ x: mappedX, y: bottom });
|
|
111
116
|
break;
|
|
117
|
+
}
|
|
112
118
|
}
|
|
113
119
|
const [a, b, c] = extendTriangle(
|
|
114
120
|
[centerPoint, sidePoints[0], sidePoints[1]],
|
|
@@ -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,
|
|
@@ -9,7 +9,7 @@ export declare function useMenuItem(args: UseMenuItemArgs): {
|
|
|
9
9
|
initializeItem: (args: InitializeItemArgs) => MenuItem;
|
|
10
10
|
deleteItem: (id: string) => void;
|
|
11
11
|
getItem: (id: string) => MenuItem | undefined;
|
|
12
|
-
selectItem: (id: string) => void;
|
|
12
|
+
selectItem: (id: string, disablePointer?: boolean) => void;
|
|
13
13
|
unselectItem: (id: string) => void;
|
|
14
14
|
};
|
|
15
15
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { reactive } from "vue";
|
|
2
|
+
import { usePointer, watchOnce } from "@vueuse/core";
|
|
2
3
|
import { useMenuView } from "./useMenuView.mjs";
|
|
3
4
|
import { useMenuState } from "./useMenuState.mjs";
|
|
4
5
|
export function useMenuItem(args) {
|
|
@@ -22,7 +23,7 @@ export function useMenuItem(args) {
|
|
|
22
23
|
function addItem(args2) {
|
|
23
24
|
const item = createItem(args2);
|
|
24
25
|
if (view?.items) {
|
|
25
|
-
view.items = [...view
|
|
26
|
+
view.items = [...view.items, item];
|
|
26
27
|
}
|
|
27
28
|
return item;
|
|
28
29
|
}
|
|
@@ -31,12 +32,8 @@ export function useMenuItem(args) {
|
|
|
31
32
|
}
|
|
32
33
|
function initializeItem(args2) {
|
|
33
34
|
const { id } = args2;
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
const item = addItem(args2);
|
|
37
|
-
return item;
|
|
38
|
-
}
|
|
39
|
-
return instance;
|
|
35
|
+
const item = getItem(id) ?? addItem(args2);
|
|
36
|
+
return item;
|
|
40
37
|
}
|
|
41
38
|
function deleteItem(id) {
|
|
42
39
|
if (!view?.items) return;
|
|
@@ -47,21 +44,30 @@ export function useMenuItem(args) {
|
|
|
47
44
|
return item.id === id;
|
|
48
45
|
});
|
|
49
46
|
}
|
|
50
|
-
function selectItem(id) {
|
|
51
|
-
const
|
|
52
|
-
if (
|
|
53
|
-
|
|
47
|
+
function selectItem(id, disablePointer) {
|
|
48
|
+
const item = getItem(id);
|
|
49
|
+
if (item) {
|
|
50
|
+
item.active = true;
|
|
54
51
|
unselectSiblings(id);
|
|
55
52
|
unselectDescendingViews(viewId);
|
|
56
53
|
if (view) {
|
|
57
54
|
state.input.view = view.id;
|
|
58
55
|
}
|
|
56
|
+
if (disablePointer) {
|
|
57
|
+
const { x, y } = usePointer();
|
|
58
|
+
state.input.disabled = [...state.input.disabled, "pointer"];
|
|
59
|
+
watchOnce([x, y], () => {
|
|
60
|
+
state.input.disabled = state.input.disabled.filter(
|
|
61
|
+
(x2) => x2 !== "pointer"
|
|
62
|
+
);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
59
65
|
}
|
|
60
66
|
}
|
|
61
67
|
function unselectItem(id) {
|
|
62
|
-
const
|
|
63
|
-
if (
|
|
64
|
-
|
|
68
|
+
const item = getItem(id);
|
|
69
|
+
if (item) {
|
|
70
|
+
item.active = false;
|
|
65
71
|
}
|
|
66
72
|
}
|
|
67
73
|
return {
|