@maas/vue-equipment 0.39.2 → 1.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -16
- package/dist/composables/index.d.ts +2 -13
- package/dist/composables/index.js +65 -128
- package/dist/composables/index.js.map +1 -1
- package/dist/nuxt/module.json +1 -1
- package/dist/nuxt/module.mjs +26 -40
- package/dist/plugins/.turbo/turbo-build.log +0 -0
- package/dist/plugins/.turbo/turbo-lint.log +13 -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 +17 -2
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionProvider.vue +36 -30
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionProvider.vue.d.ts +11 -2
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue +71 -71
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue.d.ts +12 -7
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue +51 -50
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue.d.ts +13 -4
- 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/useAccordionView.mjs +11 -10
- package/dist/plugins/MagicAccordion/src/symbols/index.d.ts +1 -1
- 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 +192 -0
- package/dist/plugins/MagicCommand/src/components/{MagicCommandBody.vue.d.ts → MagicCommandContent.vue.d.ts} +4 -2
- package/dist/plugins/MagicCommand/src/components/MagicCommandDrawer.vue +60 -53
- package/dist/plugins/MagicCommand/src/components/MagicCommandDrawer.vue.d.ts +12 -3
- package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue +108 -79
- package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue.d.ts +18 -9
- package/dist/plugins/MagicCommand/src/components/MagicCommandModal.vue +55 -53
- package/dist/plugins/MagicCommand/src/components/MagicCommandModal.vue.d.ts +11 -2
- package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue +94 -62
- package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue.d.ts +52 -7
- 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 +110 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.vue.d.ts +75 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandView.vue +56 -73
- package/dist/plugins/MagicCommand/src/components/MagicCommandView.vue.d.ts +16 -9
- 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 +22 -4
- 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 +8 -1
- 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 +33 -0
- package/dist/plugins/MagicCookie/src/components/MagicCookieProvider.vue +43 -0
- package/dist/plugins/MagicCookie/src/components/MagicCookieProvider.vue.d.ts +32 -0
- package/dist/plugins/MagicCookie/src/components/MagicCookieView.vue +96 -0
- package/dist/plugins/{MagicCommand/src/components/MagicCommandHead.vue.d.ts → MagicCookie/src/components/MagicCookieView.vue.d.ts} +6 -2
- 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 +142 -97
- package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue.d.ts +12 -6
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableDrag.d.ts +6 -6
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableDrag.mjs +3 -1
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableSnap.d.ts +3 -4
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableSnap.mjs +11 -8
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableState.d.ts +2 -1
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableState.mjs +8 -8
- package/dist/plugins/MagicDraggable/src/types/index.d.ts +10 -5
- package/dist/plugins/MagicDraggable/src/utils/defaultOptions.d.ts +3 -8
- package/dist/plugins/MagicDraggable/src/utils/defaultOptions.mjs +5 -5
- package/dist/plugins/MagicDrawer/nuxt.mjs +1 -1
- package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue +491 -336
- package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue.d.ts +12 -6
- 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/useDrawerDrag.d.ts +7 -9
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDrag.mjs +26 -17
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerGuards.d.ts +2 -3
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerProgress.d.ts +2 -2
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerProgress.mjs +4 -2
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerSnap.d.ts +5 -6
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerSnap.mjs +46 -29
- 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 +2 -2
- 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 +2 -4
- 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 +14 -10
- package/dist/plugins/MagicMarquee/src/composables/private/useMarqueeApi.d.ts +3 -7
- package/dist/plugins/MagicMarquee/src/composables/private/useMarqueeApi.mjs +52 -44
- 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 +79 -69
- package/dist/plugins/MagicMenu/src/components/MagicMenuChannel.vue.d.ts +10 -1
- package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue +247 -215
- package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue.d.ts +12 -1
- package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue +235 -211
- package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue.d.ts +12 -2
- package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue +126 -124
- package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue.d.ts +15 -6
- package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.vue +94 -96
- package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.vue.d.ts +49 -4
- package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.vue +98 -87
- package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.vue.d.ts +11 -2
- package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue +111 -112
- package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue.d.ts +11 -2
- package/dist/plugins/MagicMenu/src/components/MagicMenuView.vue +67 -70
- package/dist/plugins/MagicMenu/src/components/MagicMenuView.vue.d.ts +13 -2
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCallback.d.ts +6 -6
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCallback.mjs +8 -8
- package/dist/plugins/MagicMenu/src/composables/private/useMenuChannel.mjs +35 -26
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCursor.mjs +12 -6
- 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.mjs +6 -3
- package/dist/plugins/MagicMenu/src/composables/private/useMenuView.d.ts +3 -3
- package/dist/plugins/MagicMenu/src/composables/private/useMenuView.mjs +99 -75
- package/dist/plugins/MagicMenu/src/symbols/index.d.ts +3 -3
- package/dist/plugins/MagicMenu/src/types/index.d.ts +1 -2
- package/dist/plugins/MagicModal/src/components/MagicModal.vue +265 -165
- package/dist/plugins/MagicModal/src/components/MagicModal.vue.d.ts +12 -6
- 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/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 +11 -4
- package/dist/plugins/MagicNoise/src/composables/private/useNoiseApi.mjs +2 -2
- 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 +78 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudio.vue.d.ts +2 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue +134 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue.d.ts +33 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerDisplayTime.vue +45 -41
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerDisplayTime.vue.d.ts +11 -5
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.vue +116 -114
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.vue.d.ts +13 -5
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerOverlay.vue +111 -58
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerOverlay.vue.d.ts +1 -4
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerPoster.vue +42 -23
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerPoster.vue.d.ts +1 -4
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerProvider.vue +83 -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 +94 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideo.vue.d.ts +2 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideoControls.vue +222 -0
- package/dist/plugins/MagicPlayer/src/components/{MagicPlayerControls.vue.d.ts → MagicPlayerVideoControls.vue.d.ts} +12 -5
- 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.mjs +5 -6
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerControlsApi.mjs +18 -22
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerMediaApi.mjs +13 -13
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerRuntime.d.ts +2 -2
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerRuntime.mjs +4 -4
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerVideoApi.mjs +6 -8
- package/dist/plugins/MagicPlayer/src/composables/useMagicPlayer.d.ts +2 -6
- 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 +67 -31
- package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.vue.d.ts +14 -4
- package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue +78 -64
- package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue.d.ts +14 -7
- package/dist/plugins/MagicScroll/src/components/MagicScrollProvider.vue +39 -39
- package/dist/plugins/MagicScroll/src/components/MagicScrollProvider.vue.d.ts +15 -9
- package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue +76 -73
- package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue.d.ts +13 -7
- 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 +5 -3
- 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 +296 -0
- package/dist/plugins/MagicToast/src/components/MagicToastProvider.vue.d.ts +23 -0
- package/dist/plugins/MagicToast/src/components/MagicToastView.vue +155 -0
- package/dist/plugins/MagicToast/src/components/MagicToastView.vue.d.ts +33 -0
- package/dist/plugins/MagicToast/src/composables/private/useToastCallback.d.ts +7 -30
- package/dist/plugins/MagicToast/src/composables/private/useToastCallback.mjs +34 -29
- 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 +41 -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 +13 -8
- package/dist/plugins/MagicToast/src/composables/useMagicToast.mjs +26 -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 +0 -1
- package/dist/plugins/index.mjs +0 -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 +1 -2
- package/dist/utils/index.js +2 -53
- package/dist/utils/index.js.map +1 -1
- package/package.json +52 -56
- 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.d.ts +0 -2
- 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/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/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/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/MagicToast.vue.d.ts +0 -14
- 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
|
@@ -1,80 +1,90 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
:id="id"
|
|
8
|
-
>
|
|
9
|
-
<slot />
|
|
10
|
-
</div>
|
|
11
|
-
</transition>
|
|
12
|
-
</template>
|
|
13
|
-
|
|
14
|
-
<script lang="ts" setup>
|
|
15
|
-
import { computed, inject, provide } from 'vue'
|
|
16
|
-
import { useMenuChannel } from '../composables/private/useMenuChannel'
|
|
1
|
+
<script>
|
|
2
|
+
import { defineComponent as _defineComponent } from "vue";
|
|
3
|
+
import { unref as _unref, renderSlot as _renderSlot, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, Transition as _Transition, withCtx as _withCtx, createBlock as _createBlock } from "vue";
|
|
4
|
+
const _hoisted_1 = ["id", "data-initialized", "data-id"];
|
|
5
|
+
import { computed, inject, provide } from "vue";
|
|
6
|
+
import { useMenuChannel } from "../composables/private/useMenuChannel";
|
|
17
7
|
import {
|
|
18
8
|
MagicMenuInstanceId,
|
|
19
9
|
MagicMenuViewId,
|
|
20
10
|
MagicMenuContentId,
|
|
21
11
|
MagicMenuChannelId,
|
|
22
|
-
MagicMenuChannelActive
|
|
23
|
-
} from
|
|
24
|
-
import { useMenuState } from
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
const
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
if (!
|
|
42
|
-
|
|
43
|
-
}
|
|
12
|
+
MagicMenuChannelActive
|
|
13
|
+
} from "../symbols";
|
|
14
|
+
import { useMenuState } from "../composables/private/useMenuState";
|
|
15
|
+
export default /* @__PURE__ */ _defineComponent({
|
|
16
|
+
__name: "MagicMenuChannel",
|
|
17
|
+
props: {
|
|
18
|
+
id: { type: String, required: true },
|
|
19
|
+
transition: { type: String, required: false }
|
|
20
|
+
},
|
|
21
|
+
setup(__props) {
|
|
22
|
+
const instanceId = inject(MagicMenuInstanceId, void 0);
|
|
23
|
+
const viewId = inject(MagicMenuViewId, void 0);
|
|
24
|
+
const contentId = inject(MagicMenuContentId, void 0);
|
|
25
|
+
if (!instanceId) {
|
|
26
|
+
throw new Error("MagicMenuChannel must be nested inside MagicMenuProvider");
|
|
27
|
+
}
|
|
28
|
+
if (!viewId) {
|
|
29
|
+
throw new Error("MagicMenuChannel must be nested inside MagicMenuView");
|
|
30
|
+
}
|
|
31
|
+
if (!__props.id) {
|
|
32
|
+
throw new Error("MagicMenuChannel requires an id");
|
|
33
|
+
}
|
|
34
|
+
const { initializeState } = useMenuState(instanceId);
|
|
35
|
+
const state = initializeState();
|
|
36
|
+
if (!contentId) {
|
|
37
|
+
if (state.options.debug) {
|
|
38
|
+
console.warn("MagicMenuChannel is not nested inside MagicMenuContent");
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
const mappedId = computed(() => `magic-menu-channel-${__props.id}`);
|
|
42
|
+
const mappedActive = computed(() => channel.active);
|
|
43
|
+
const mappedTransition = computed(
|
|
44
|
+
() => __props.transition ?? state.options.transition.channel
|
|
45
|
+
);
|
|
46
|
+
const { initializeChannel } = useMenuChannel({
|
|
47
|
+
instanceId,
|
|
48
|
+
viewId
|
|
49
|
+
});
|
|
50
|
+
const channel = initializeChannel({
|
|
51
|
+
id: mappedId.value
|
|
52
|
+
});
|
|
53
|
+
provide(MagicMenuChannelId, mappedId.value);
|
|
54
|
+
provide(MagicMenuChannelActive, mappedActive);
|
|
55
|
+
return (_ctx, _cache) => {
|
|
56
|
+
return _openBlock(), _createBlock(_Transition, { name: mappedTransition.value }, {
|
|
57
|
+
default: _withCtx(() => [
|
|
58
|
+
_unref(channel).active ? (_openBlock(), _createElementBlock("div", {
|
|
59
|
+
key: 0,
|
|
60
|
+
id: _ctx.id,
|
|
61
|
+
class: "magic-menu-channel",
|
|
62
|
+
"data-initialized": _unref(state).active,
|
|
63
|
+
"data-id": mappedId.value
|
|
64
|
+
}, [
|
|
65
|
+
_renderSlot(_ctx.$slots, "default")
|
|
66
|
+
], 8, _hoisted_1)) : _createCommentVNode("v-if", true)
|
|
67
|
+
]),
|
|
68
|
+
_: 3
|
|
69
|
+
/* FORWARDED */
|
|
70
|
+
}, 8, ["name"]);
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
</script>
|
|
44
75
|
|
|
45
|
-
|
|
46
|
-
|
|
76
|
+
<style>
|
|
77
|
+
.magic-menu-channel-enter-active {
|
|
78
|
+
animation: fade-in 300ms ease;
|
|
79
|
+
&[data-initialized='true'] {
|
|
80
|
+
position: absolute;
|
|
81
|
+
}
|
|
47
82
|
}
|
|
48
83
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
if (state.options.debug) {
|
|
54
|
-
console.warn('MagicMenuChannel is not nested inside MagicMenuContent')
|
|
84
|
+
.magic-menu-channel-leave-active {
|
|
85
|
+
animation: fade-out 300ms ease;
|
|
86
|
+
&[data-initialized='true'] {
|
|
87
|
+
position: absolute;
|
|
55
88
|
}
|
|
56
89
|
}
|
|
57
|
-
|
|
58
|
-
const mappedId = computed(() => `magic-menu-channel-${id}`)
|
|
59
|
-
const mappedTransition = computed(
|
|
60
|
-
() => transition ?? state.options.transition.channel
|
|
61
|
-
)
|
|
62
|
-
|
|
63
|
-
// Register channel
|
|
64
|
-
const { initializeChannel } = useMenuChannel({
|
|
65
|
-
instanceId,
|
|
66
|
-
viewId,
|
|
67
|
-
})
|
|
68
|
-
|
|
69
|
-
const channel = initializeChannel({
|
|
70
|
-
id: mappedId.value,
|
|
71
|
-
})
|
|
72
|
-
|
|
73
|
-
// Pass id and active state to children
|
|
74
|
-
provide(MagicMenuChannelId, mappedId.value)
|
|
75
|
-
provide(MagicMenuChannelActive, channel.active)
|
|
76
|
-
</script>
|
|
77
|
-
|
|
78
|
-
<style>
|
|
79
|
-
.magic-menu-channel-enter-active{animation:fade-in .3s ease}.magic-menu-channel-enter-active.-initialized{position:absolute}.magic-menu-channel-leave-active{animation:fade-out .3s ease}.magic-menu-channel-leave-active.-initialized{position:absolute}
|
|
80
90
|
</style>
|
|
@@ -11,9 +11,18 @@ declare function __VLS_template(): {
|
|
|
11
11
|
rootEl: any;
|
|
12
12
|
};
|
|
13
13
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
14
|
-
declare const __VLS_component: import("vue").DefineComponent<MagicMenuChannelProps
|
|
14
|
+
declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<MagicMenuChannelProps>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<MagicMenuChannelProps>>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
15
15
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
16
16
|
export default _default;
|
|
17
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
18
|
+
type __VLS_TypePropsToOption<T> = {
|
|
19
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
20
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
21
|
+
} : {
|
|
22
|
+
type: import('vue').PropType<T[K]>;
|
|
23
|
+
required: true;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
17
26
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
18
27
|
new (): {
|
|
19
28
|
$slots: S;
|
|
@@ -1,59 +1,8 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
:on-enter="onEnter"
|
|
7
|
-
:on-after-enter="onAfterEnter"
|
|
8
|
-
:on-before-leave="onBeforeLeave"
|
|
9
|
-
:on-leave="onLeave"
|
|
10
|
-
:on-after-leave="onAfterLeave"
|
|
11
|
-
>
|
|
12
|
-
<div
|
|
13
|
-
class="magic-menu-content"
|
|
14
|
-
:data-id="`${viewId}-content`"
|
|
15
|
-
v-bind="$attrs"
|
|
16
|
-
v-if="innerActive"
|
|
17
|
-
>
|
|
18
|
-
<magic-menu-float
|
|
19
|
-
:placement="view?.placement"
|
|
20
|
-
:arrow="arrow"
|
|
21
|
-
:reference-el="referenceEl"
|
|
22
|
-
>
|
|
23
|
-
<template #arrow v-if="$slots.arrow && arrow">
|
|
24
|
-
<slot name="arrow" />
|
|
25
|
-
</template>
|
|
26
|
-
<template #default>
|
|
27
|
-
<div
|
|
28
|
-
class="magic-menu-content__inner"
|
|
29
|
-
ref="contentRef"
|
|
30
|
-
:class="{ '-disabled': pointerDisabled }"
|
|
31
|
-
>
|
|
32
|
-
<slot />
|
|
33
|
-
</div>
|
|
34
|
-
</template>
|
|
35
|
-
</magic-menu-float>
|
|
36
|
-
</div>
|
|
37
|
-
</transition>
|
|
38
|
-
<span
|
|
39
|
-
v-for="point in coords"
|
|
40
|
-
v-if="state.options.debug"
|
|
41
|
-
:style="{
|
|
42
|
-
background: 'red',
|
|
43
|
-
position: 'fixed',
|
|
44
|
-
top: point.y + 'px',
|
|
45
|
-
left: point.x + 'px',
|
|
46
|
-
width: '4px',
|
|
47
|
-
height: '4px',
|
|
48
|
-
zIndex: 1000,
|
|
49
|
-
pointerEvents: 'none',
|
|
50
|
-
transform: 'translate(-50%, -50%)',
|
|
51
|
-
}"
|
|
52
|
-
/>
|
|
53
|
-
</teleport>
|
|
54
|
-
</template>
|
|
55
|
-
|
|
56
|
-
<script lang="ts" setup>
|
|
1
|
+
<script>
|
|
2
|
+
import { defineComponent as _defineComponent } from "vue";
|
|
3
|
+
import { unref as _unref, renderSlot as _renderSlot, createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, createSlots as _createSlots, createVNode as _createVNode, mergeProps as _mergeProps, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, Transition as _Transition, renderList as _renderList, Fragment as _Fragment, normalizeStyle as _normalizeStyle, Teleport as _Teleport, createBlock as _createBlock } from "vue";
|
|
4
|
+
const _hoisted_1 = ["data-id"];
|
|
5
|
+
const _hoisted_2 = ["data-pointer-disabled"];
|
|
57
6
|
import {
|
|
58
7
|
ref,
|
|
59
8
|
inject,
|
|
@@ -61,180 +10,263 @@ import {
|
|
|
61
10
|
nextTick,
|
|
62
11
|
watch,
|
|
63
12
|
computed,
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
} from
|
|
68
|
-
import {
|
|
69
|
-
import {
|
|
70
|
-
import {
|
|
71
|
-
import {
|
|
72
|
-
import {
|
|
73
|
-
import { ModeTransitions } from '../utils/modeTransitionDefaults'
|
|
74
|
-
import { ModeDelayMouseleave } from '../utils/modeDelayDefaults'
|
|
13
|
+
onBeforeUnmount
|
|
14
|
+
} from "vue";
|
|
15
|
+
import { useMenuView } from "../composables/private/useMenuView";
|
|
16
|
+
import { useMenuState } from "../composables/private/useMenuState";
|
|
17
|
+
import { useMenuCallback } from "../composables/private/useMenuCallback";
|
|
18
|
+
import { useMenuDOM } from "../composables/private/useMenuDOM";
|
|
19
|
+
import { useMenuCursor } from "../composables/private/useMenuCursor";
|
|
20
|
+
import { ModeTransitions } from "../utils/modeTransitionDefaults";
|
|
21
|
+
import { ModeDelayMouseleave } from "../utils/modeDelayDefaults";
|
|
75
22
|
import {
|
|
76
23
|
MagicMenuInstanceId,
|
|
77
24
|
MagicMenuViewId,
|
|
78
|
-
MagicMenuContentId
|
|
79
|
-
} from
|
|
80
|
-
|
|
81
|
-
import
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
25
|
+
MagicMenuContentId
|
|
26
|
+
} from "../symbols";
|
|
27
|
+
import "@maas/vue-equipment/utils/css/animations/fade-in.css";
|
|
28
|
+
import "@maas/vue-equipment/utils/css/animations/fade-out.css";
|
|
29
|
+
export default /* @__PURE__ */ _defineComponent({
|
|
30
|
+
...{
|
|
31
|
+
inheritAttrs: false
|
|
32
|
+
},
|
|
33
|
+
__name: "MagicMenuContent",
|
|
34
|
+
props: {
|
|
35
|
+
arrow: { type: Boolean, required: false, skipCheck: true, default: () => void 0 },
|
|
36
|
+
middleware: { type: Array, required: false },
|
|
37
|
+
transition: { type: String, required: false },
|
|
38
|
+
referenceEl: { type: null, required: false }
|
|
39
|
+
},
|
|
40
|
+
setup(__props) {
|
|
41
|
+
const contentRef = ref(void 0);
|
|
42
|
+
const instanceId = inject(MagicMenuInstanceId, void 0);
|
|
43
|
+
const viewId = inject(MagicMenuViewId, void 0);
|
|
44
|
+
if (!instanceId) {
|
|
45
|
+
throw new Error("MagicMenuContent must be nested inside MagicMenuProvider");
|
|
46
|
+
}
|
|
47
|
+
if (!viewId) {
|
|
48
|
+
throw new Error("MagicMenuContent must be nested inside MagicMenuView");
|
|
49
|
+
}
|
|
50
|
+
const { getView, unselectView } = useMenuView(instanceId);
|
|
51
|
+
const view = getView(viewId);
|
|
52
|
+
const { initializeState } = useMenuState(instanceId);
|
|
53
|
+
const state = initializeState();
|
|
54
|
+
const pointerDisabled = computed(() => state.input.disabled.includes("pointer"));
|
|
55
|
+
const mappedTransition = computed(() => {
|
|
56
|
+
switch (true) {
|
|
57
|
+
case !!__props.transition:
|
|
58
|
+
return __props.transition;
|
|
59
|
+
case !!view?.parent.item:
|
|
60
|
+
return state.options.transition.content.nested;
|
|
61
|
+
case !!state.options.transition.content.default:
|
|
62
|
+
return state.options.transition.content.default;
|
|
63
|
+
default:
|
|
64
|
+
return ModeTransitions[state.options.mode];
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
const innerActive = ref(false);
|
|
68
|
+
const wrapperActive = ref(false);
|
|
69
|
+
const {
|
|
70
|
+
lockScroll,
|
|
71
|
+
unlockScroll,
|
|
72
|
+
addScrollLockPadding,
|
|
73
|
+
removeScrollLockPadding
|
|
74
|
+
} = useMenuDOM();
|
|
75
|
+
const {
|
|
76
|
+
onBeforeEnter,
|
|
77
|
+
onEnter,
|
|
78
|
+
onAfterEnter,
|
|
79
|
+
onBeforeLeave,
|
|
80
|
+
onLeave,
|
|
81
|
+
onAfterLeave
|
|
82
|
+
} = useMenuCallback({
|
|
83
|
+
state,
|
|
84
|
+
instanceId,
|
|
85
|
+
viewId,
|
|
86
|
+
innerActive,
|
|
87
|
+
wrapperActive,
|
|
88
|
+
lockScroll,
|
|
89
|
+
unlockScroll,
|
|
90
|
+
addScrollLockPadding,
|
|
91
|
+
removeScrollLockPadding
|
|
92
|
+
});
|
|
93
|
+
async function onOpen() {
|
|
94
|
+
wrapperActive.value = true;
|
|
95
|
+
await nextTick();
|
|
96
|
+
innerActive.value = true;
|
|
97
|
+
await nextTick();
|
|
98
|
+
initialize();
|
|
99
|
+
}
|
|
100
|
+
function onClose() {
|
|
101
|
+
destroy();
|
|
102
|
+
innerActive.value = false;
|
|
103
|
+
}
|
|
104
|
+
watch(
|
|
105
|
+
() => view?.active,
|
|
106
|
+
async (value) => {
|
|
107
|
+
if (value) {
|
|
108
|
+
await onOpen();
|
|
109
|
+
} else {
|
|
110
|
+
onClose();
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
);
|
|
114
|
+
const {
|
|
115
|
+
coords,
|
|
116
|
+
destroy,
|
|
117
|
+
initialize,
|
|
118
|
+
isInsideTriangle,
|
|
119
|
+
isInsideTo,
|
|
120
|
+
isInsideFrom
|
|
121
|
+
} = useMenuCursor(view, state.options.debug);
|
|
122
|
+
function disableCursor() {
|
|
123
|
+
state.input.disabled = [...state.input.disabled, "pointer"];
|
|
124
|
+
}
|
|
125
|
+
function enableCursor() {
|
|
126
|
+
state.input.disabled = state.input.disabled.filter((x) => x !== "pointer");
|
|
127
|
+
}
|
|
128
|
+
watch(isInsideTriangle, (value) => {
|
|
129
|
+
if (value) {
|
|
130
|
+
disableCursor();
|
|
131
|
+
} else {
|
|
132
|
+
enableCursor();
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
watch(isInsideTo, (value) => {
|
|
136
|
+
if (value) {
|
|
137
|
+
enableCursor();
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
const isOutside = computed(
|
|
141
|
+
() => !isInsideTo.value && !isInsideFrom.value && !isInsideTriangle.value
|
|
142
|
+
);
|
|
143
|
+
watch(isOutside, (value, oldValue) => {
|
|
144
|
+
if (value && !oldValue) {
|
|
145
|
+
switch (state.options.mode) {
|
|
146
|
+
case "navigation":
|
|
147
|
+
const delay = state.options.delay?.mouseleave ?? ModeDelayMouseleave.navigation;
|
|
148
|
+
unselectView(viewId, delay);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
onBeforeUnmount(() => {
|
|
153
|
+
destroy();
|
|
154
|
+
});
|
|
155
|
+
provide(MagicMenuContentId, `${viewId}-content`);
|
|
156
|
+
return (_ctx, _cache) => {
|
|
157
|
+
const _component_magic_menu_float = _resolveComponent("magic-menu-float");
|
|
158
|
+
return wrapperActive.value ? (_openBlock(), _createBlock(_Teleport, {
|
|
159
|
+
key: 0,
|
|
160
|
+
to: "body"
|
|
161
|
+
}, [
|
|
162
|
+
_createVNode(_Transition, {
|
|
163
|
+
name: mappedTransition.value,
|
|
164
|
+
"on-before-enter": _unref(onBeforeEnter),
|
|
165
|
+
"on-enter": _unref(onEnter),
|
|
166
|
+
"on-after-enter": _unref(onAfterEnter),
|
|
167
|
+
"on-before-leave": _unref(onBeforeLeave),
|
|
168
|
+
"on-leave": _unref(onLeave),
|
|
169
|
+
"on-after-leave": _unref(onAfterLeave)
|
|
170
|
+
}, {
|
|
171
|
+
default: _withCtx(() => [
|
|
172
|
+
innerActive.value ? (_openBlock(), _createElementBlock("div", _mergeProps({
|
|
173
|
+
key: 0,
|
|
174
|
+
class: "magic-menu-content",
|
|
175
|
+
"data-id": `${_unref(viewId)}-content`
|
|
176
|
+
}, _ctx.$attrs), [
|
|
177
|
+
_createVNode(_component_magic_menu_float, {
|
|
178
|
+
placement: _unref(view)?.placement,
|
|
179
|
+
middleware: _ctx.middleware,
|
|
180
|
+
arrow: _ctx.arrow,
|
|
181
|
+
"reference-el": _ctx.referenceEl
|
|
182
|
+
}, _createSlots({
|
|
183
|
+
default: _withCtx(() => [
|
|
184
|
+
_createElementVNode("div", {
|
|
185
|
+
ref_key: "contentRef",
|
|
186
|
+
ref: contentRef,
|
|
187
|
+
class: "magic-menu-content__inner",
|
|
188
|
+
"data-pointer-disabled": pointerDisabled.value
|
|
189
|
+
}, [
|
|
190
|
+
_renderSlot(_ctx.$slots, "default")
|
|
191
|
+
], 8, _hoisted_2)
|
|
192
|
+
]),
|
|
193
|
+
_: 2
|
|
194
|
+
/* DYNAMIC */
|
|
195
|
+
}, [
|
|
196
|
+
_ctx.$slots.arrow && _ctx.arrow ? {
|
|
197
|
+
name: "arrow",
|
|
198
|
+
fn: _withCtx(() => [
|
|
199
|
+
_renderSlot(_ctx.$slots, "arrow")
|
|
200
|
+
]),
|
|
201
|
+
key: "0"
|
|
202
|
+
} : void 0
|
|
203
|
+
]), 1032, ["placement", "middleware", "arrow", "reference-el"])
|
|
204
|
+
], 16, _hoisted_1)) : _createCommentVNode("v-if", true)
|
|
205
|
+
]),
|
|
206
|
+
_: 3
|
|
207
|
+
/* FORWARDED */
|
|
208
|
+
}, 8, ["name", "on-before-enter", "on-enter", "on-after-enter", "on-before-leave", "on-leave", "on-after-leave"]),
|
|
209
|
+
_unref(state).options.debug ? (_openBlock(true), _createElementBlock(
|
|
210
|
+
_Fragment,
|
|
211
|
+
{ key: 0 },
|
|
212
|
+
_renderList(_unref(coords), (point) => {
|
|
213
|
+
return _openBlock(), _createElementBlock(
|
|
214
|
+
"span",
|
|
215
|
+
{
|
|
216
|
+
key: `${point.x}${point.y}`,
|
|
217
|
+
style: _normalizeStyle({
|
|
218
|
+
background: "red",
|
|
219
|
+
position: "fixed",
|
|
220
|
+
top: point.y + "px",
|
|
221
|
+
left: point.x + "px",
|
|
222
|
+
width: "4px",
|
|
223
|
+
height: "4px",
|
|
224
|
+
zIndex: 1e3,
|
|
225
|
+
pointerEvents: "none",
|
|
226
|
+
transform: "translate(-50%, -50%)"
|
|
227
|
+
})
|
|
228
|
+
},
|
|
229
|
+
null,
|
|
230
|
+
4
|
|
231
|
+
/* STYLE */
|
|
232
|
+
);
|
|
233
|
+
}),
|
|
234
|
+
128
|
|
235
|
+
/* KEYED_FRAGMENT */
|
|
236
|
+
)) : _createCommentVNode("v-if", true)
|
|
237
|
+
])) : _createCommentVNode("v-if", true);
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
});
|
|
241
|
+
</script>
|
|
87
242
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
referenceEl?: MaybeRef<HTMLElement | ComponentPublicInstance>
|
|
243
|
+
<style>
|
|
244
|
+
.magic-menu-content {
|
|
245
|
+
user-select: none;
|
|
92
246
|
}
|
|
93
247
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
const instanceId = inject(MagicMenuInstanceId, undefined)
|
|
99
|
-
const viewId = inject(MagicMenuViewId, undefined)
|
|
100
|
-
|
|
101
|
-
if (!instanceId) {
|
|
102
|
-
throw new Error('MagicMenuContent must be nested inside MagicMenuProvider')
|
|
248
|
+
.magic-menu-content__inner {
|
|
249
|
+
padding: 0;
|
|
250
|
+
border: 0;
|
|
103
251
|
}
|
|
104
252
|
|
|
105
|
-
|
|
106
|
-
|
|
253
|
+
.magic-menu-content__inner[data-pointer-disabled='true'] {
|
|
254
|
+
pointer-events: none;
|
|
107
255
|
}
|
|
108
256
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
const { initializeState } = useMenuState(instanceId)
|
|
113
|
-
const state = initializeState()
|
|
114
|
-
|
|
115
|
-
const pointerDisabled = computed(() => state.input.disabled.includes('pointer'))
|
|
116
|
-
|
|
117
|
-
const mappedTransition = computed(() => {
|
|
118
|
-
switch (true) {
|
|
119
|
-
case !!transition:
|
|
120
|
-
return transition
|
|
121
|
-
case !!view?.parent.item:
|
|
122
|
-
return state.options.transition.content.nested
|
|
123
|
-
case !!state.options.transition.content.default:
|
|
124
|
-
return state.options.transition.content.default
|
|
125
|
-
default:
|
|
126
|
-
return ModeTransitions[state.options.mode]
|
|
127
|
-
}
|
|
128
|
-
})
|
|
129
|
-
|
|
130
|
-
// Split isActive into two values to animate content smoothly
|
|
131
|
-
const innerActive = ref(false)
|
|
132
|
-
const wrapperActive = ref(false)
|
|
133
|
-
|
|
134
|
-
const {
|
|
135
|
-
lockScroll,
|
|
136
|
-
unlockScroll,
|
|
137
|
-
addScrollLockPadding,
|
|
138
|
-
removeScrollLockPadding,
|
|
139
|
-
} = useMenuDOM()
|
|
140
|
-
const {
|
|
141
|
-
onBeforeEnter,
|
|
142
|
-
onEnter,
|
|
143
|
-
onAfterEnter,
|
|
144
|
-
onBeforeLeave,
|
|
145
|
-
onLeave,
|
|
146
|
-
onAfterLeave,
|
|
147
|
-
} = useMenuCallback({
|
|
148
|
-
state,
|
|
149
|
-
instanceId,
|
|
150
|
-
viewId,
|
|
151
|
-
innerActive,
|
|
152
|
-
wrapperActive,
|
|
153
|
-
lockScroll,
|
|
154
|
-
unlockScroll,
|
|
155
|
-
addScrollLockPadding,
|
|
156
|
-
removeScrollLockPadding,
|
|
157
|
-
})
|
|
158
|
-
|
|
159
|
-
// Handle state
|
|
160
|
-
async function onOpen() {
|
|
161
|
-
wrapperActive.value = true
|
|
162
|
-
await nextTick()
|
|
163
|
-
innerActive.value = true
|
|
164
|
-
await nextTick()
|
|
165
|
-
initialize()
|
|
257
|
+
.magic-menu-content--default-enter-active {
|
|
258
|
+
animation: none;
|
|
166
259
|
}
|
|
167
260
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
innerActive.value = false
|
|
261
|
+
.magic-menu-content--default-leave-active {
|
|
262
|
+
animation: none;
|
|
171
263
|
}
|
|
172
264
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
async (value) => {
|
|
176
|
-
if (value) {
|
|
177
|
-
await onOpen()
|
|
178
|
-
} else {
|
|
179
|
-
onClose()
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
)
|
|
183
|
-
|
|
184
|
-
// Handle cursor
|
|
185
|
-
const {
|
|
186
|
-
coords,
|
|
187
|
-
destroy,
|
|
188
|
-
initialize,
|
|
189
|
-
isInsideTriangle,
|
|
190
|
-
isInsideTo,
|
|
191
|
-
isInsideFrom,
|
|
192
|
-
} = useMenuCursor(view!, state.options.debug)
|
|
193
|
-
|
|
194
|
-
function disableCursor() {
|
|
195
|
-
state.input.disabled = [...state.input.disabled, 'pointer']
|
|
265
|
+
.magic-menu-content--fade-enter-active {
|
|
266
|
+
animation: fade-in 200ms ease;
|
|
196
267
|
}
|
|
197
268
|
|
|
198
|
-
|
|
199
|
-
|
|
269
|
+
.magic-menu-content--fade-leave-active {
|
|
270
|
+
animation: fade-out 200ms ease;
|
|
200
271
|
}
|
|
201
|
-
|
|
202
|
-
watch(isInsideTriangle, (value) => {
|
|
203
|
-
if (value) {
|
|
204
|
-
disableCursor()
|
|
205
|
-
} else {
|
|
206
|
-
enableCursor()
|
|
207
|
-
}
|
|
208
|
-
})
|
|
209
|
-
|
|
210
|
-
watch(isInsideTo, (value) => {
|
|
211
|
-
if (value) {
|
|
212
|
-
enableCursor()
|
|
213
|
-
}
|
|
214
|
-
})
|
|
215
|
-
|
|
216
|
-
const isOutside = computed(
|
|
217
|
-
() => !isInsideTo.value && !isInsideFrom.value && !isInsideTriangle.value
|
|
218
|
-
)
|
|
219
|
-
|
|
220
|
-
watch(isOutside, (value, oldValue) => {
|
|
221
|
-
if (value && !oldValue) {
|
|
222
|
-
switch (state.options.mode) {
|
|
223
|
-
case 'navigation':
|
|
224
|
-
const delay =
|
|
225
|
-
state.options.delay?.mouseleave ?? ModeDelayMouseleave.navigation
|
|
226
|
-
unselectView(viewId, delay)
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
})
|
|
230
|
-
|
|
231
|
-
onBeforeUnmount(() => {
|
|
232
|
-
destroy()
|
|
233
|
-
})
|
|
234
|
-
|
|
235
|
-
provide(MagicMenuContentId, `${viewId}-content`)
|
|
236
|
-
</script>
|
|
237
|
-
|
|
238
|
-
<style>
|
|
239
|
-
.magic-menu-content{-webkit-user-select:none;-moz-user-select:none;user-select:none}.magic-menu-content__inner{border:0;padding:0}.magic-menu-content__inner.-disabled{pointer-events:none}.magic-menu-content--default-enter-active,.magic-menu-content--default-leave-active{animation:none}.magic-menu-content--fade-enter-active{animation:fade-in .2s ease}.magic-menu-content--fade-leave-active{animation:fade-out .2s ease}
|
|
240
272
|
</style>
|