@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,5 +1,5 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import type { MagicDrawerOptions } from '../types/index';
|
|
1
|
+
import { type MaybeRef } from 'vue';
|
|
2
|
+
import type { MagicDrawerOptions } from '../types/index.js';
|
|
3
3
|
import '@maas/vue-equipment/utils/css/animations/fade-in.css';
|
|
4
4
|
import '@maas/vue-equipment/utils/css/animations/fade-out.css';
|
|
5
5
|
import '@maas/vue-equipment/utils/css/animations/slide-ltr-in.css';
|
|
@@ -12,7 +12,6 @@ import '@maas/vue-equipment/utils/css/animations/slide-ttb-out.css';
|
|
|
12
12
|
import '@maas/vue-equipment/utils/css/animations/slide-btt-out.css';
|
|
13
13
|
interface MagicDrawerProps {
|
|
14
14
|
id: MaybeRef<string>;
|
|
15
|
-
component?: Component;
|
|
16
15
|
options?: MagicDrawerOptions;
|
|
17
16
|
}
|
|
18
17
|
declare function __VLS_template(): {
|
|
@@ -29,11 +28,18 @@ declare function __VLS_template(): {
|
|
|
29
28
|
rootEl: any;
|
|
30
29
|
};
|
|
31
30
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
32
|
-
declare const __VLS_component: import("vue").DefineComponent<MagicDrawerProps
|
|
33
|
-
options: MagicDrawerOptions;
|
|
34
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
31
|
+
declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<MagicDrawerProps>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<MagicDrawerProps>>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
35
32
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
36
33
|
export default _default;
|
|
34
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
35
|
+
type __VLS_TypePropsToOption<T> = {
|
|
36
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
37
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
38
|
+
} : {
|
|
39
|
+
type: import('vue').PropType<T[K]>;
|
|
40
|
+
required: true;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
37
43
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
38
44
|
new (): {
|
|
39
45
|
$slots: S;
|
|
@@ -13,11 +13,11 @@ type UseDrawerCallbackArgs = {
|
|
|
13
13
|
wasActive: Ref<boolean>;
|
|
14
14
|
};
|
|
15
15
|
export declare function useDrawerCallback(args: UseDrawerCallbackArgs): {
|
|
16
|
-
onBeforeEnter: (
|
|
17
|
-
onEnter: (
|
|
18
|
-
onAfterEnter: (
|
|
19
|
-
onBeforeLeave: (
|
|
20
|
-
onLeave: (
|
|
21
|
-
onAfterLeave: (
|
|
16
|
+
onBeforeEnter: () => void;
|
|
17
|
+
onEnter: () => void;
|
|
18
|
+
onAfterEnter: () => Promise<void>;
|
|
19
|
+
onBeforeLeave: () => void;
|
|
20
|
+
onLeave: () => void;
|
|
21
|
+
onAfterLeave: () => void;
|
|
22
22
|
};
|
|
23
23
|
export {};
|
|
@@ -16,7 +16,7 @@ export function useDrawerCallback(args) {
|
|
|
16
16
|
} = args;
|
|
17
17
|
const { setMetaViewport, resetMetaViewport } = useMetaViewport();
|
|
18
18
|
const emitter = useMagicEmitter();
|
|
19
|
-
function onBeforeEnter(
|
|
19
|
+
function onBeforeEnter() {
|
|
20
20
|
emitter.emit("beforeEnter", toValue(id));
|
|
21
21
|
if (mappedOptions.scrollLock) {
|
|
22
22
|
if (typeof mappedOptions.scrollLock === "object" && mappedOptions.scrollLock.padding) {
|
|
@@ -28,10 +28,10 @@ export function useDrawerCallback(args) {
|
|
|
28
28
|
setMetaViewport();
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
function onEnter(
|
|
31
|
+
function onEnter() {
|
|
32
32
|
emitter.emit("enter", toValue(id));
|
|
33
33
|
}
|
|
34
|
-
async function onAfterEnter(
|
|
34
|
+
async function onAfterEnter() {
|
|
35
35
|
emitter.emit("afterEnter", toValue(id));
|
|
36
36
|
if (mappedOptions.focusTrap) {
|
|
37
37
|
await nextTick();
|
|
@@ -39,13 +39,13 @@ export function useDrawerCallback(args) {
|
|
|
39
39
|
}
|
|
40
40
|
wasActive.value = true;
|
|
41
41
|
}
|
|
42
|
-
function onBeforeLeave(
|
|
42
|
+
function onBeforeLeave() {
|
|
43
43
|
emitter.emit("beforeLeave", toValue(id));
|
|
44
44
|
}
|
|
45
|
-
function onLeave(
|
|
45
|
+
function onLeave() {
|
|
46
46
|
emitter.emit("leave", toValue(id));
|
|
47
47
|
}
|
|
48
|
-
function onAfterLeave(
|
|
48
|
+
function onAfterLeave() {
|
|
49
49
|
emitter.emit("afterLeave", toValue(id));
|
|
50
50
|
if (mappedOptions.scrollLock) {
|
|
51
51
|
unlockScroll();
|
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
import { type Ref, type MaybeRef } from 'vue';
|
|
2
|
-
import {
|
|
2
|
+
import type { DrawerDefaultOptions } from '../../types/index.js';
|
|
3
3
|
type UseDrawerDragArgs = {
|
|
4
4
|
id: MaybeRef<string>;
|
|
5
|
-
isActive: MaybeRef<boolean>;
|
|
6
5
|
elRef: Ref<HTMLElement | undefined>;
|
|
7
6
|
wrapperRef: Ref<HTMLDivElement | undefined>;
|
|
8
|
-
position: MaybeRef<
|
|
9
|
-
snapPoints: MaybeRef<
|
|
10
|
-
threshold: MaybeRef<
|
|
11
|
-
initial: MaybeRef<
|
|
12
|
-
animation: MaybeRef<
|
|
13
|
-
preventDragClose: MaybeRef<
|
|
7
|
+
position: MaybeRef<DrawerDefaultOptions['position']>;
|
|
8
|
+
snapPoints: MaybeRef<DrawerDefaultOptions['snapPoints']>;
|
|
9
|
+
threshold: MaybeRef<DrawerDefaultOptions['threshold']>;
|
|
10
|
+
initial: MaybeRef<DrawerDefaultOptions['initial']>;
|
|
11
|
+
animation: MaybeRef<DrawerDefaultOptions['animation']>;
|
|
12
|
+
preventDragClose: MaybeRef<DrawerDefaultOptions['preventDragClose']>;
|
|
14
13
|
disabled: MaybeRef<boolean>;
|
|
15
14
|
overshoot: MaybeRef<number>;
|
|
16
|
-
close: () => void;
|
|
17
15
|
};
|
|
18
16
|
export declare function useDrawerDrag(args: UseDrawerDragArgs): {
|
|
19
17
|
onPointerdown: (e: PointerEvent) => void;
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
watch,
|
|
5
5
|
onBeforeUnmount,
|
|
6
6
|
toValue,
|
|
7
|
+
toRefs,
|
|
7
8
|
nextTick
|
|
8
9
|
} from "vue";
|
|
9
10
|
import {
|
|
@@ -22,6 +23,7 @@ import {
|
|
|
22
23
|
import {
|
|
23
24
|
useMagicEmitter
|
|
24
25
|
} from "@maas/vue-equipment/plugins";
|
|
26
|
+
import { useMagicDrawer } from "./../useMagicDrawer.mjs";
|
|
25
27
|
import { useDrawerSnap } from "./useDrawerSnap.mjs";
|
|
26
28
|
import { useDrawerGuards } from "./useDrawerGuards.mjs";
|
|
27
29
|
import { useDrawerUtils } from "./useDrawerUtils.mjs";
|
|
@@ -29,7 +31,6 @@ import { useDrawerState } from "./useDrawerState.mjs";
|
|
|
29
31
|
export function useDrawerDrag(args) {
|
|
30
32
|
const {
|
|
31
33
|
id,
|
|
32
|
-
isActive,
|
|
33
34
|
elRef,
|
|
34
35
|
wrapperRef,
|
|
35
36
|
position,
|
|
@@ -39,10 +40,10 @@ export function useDrawerDrag(args) {
|
|
|
39
40
|
initial,
|
|
40
41
|
animation,
|
|
41
42
|
preventDragClose,
|
|
42
|
-
disabled
|
|
43
|
-
close
|
|
43
|
+
disabled
|
|
44
44
|
} = args;
|
|
45
45
|
const { initializeState } = useDrawerState(toValue(id));
|
|
46
|
+
const state = initializeState();
|
|
46
47
|
const {
|
|
47
48
|
dragStart,
|
|
48
49
|
dragging,
|
|
@@ -61,7 +62,8 @@ export function useDrawerDrag(args) {
|
|
|
61
62
|
absDirectionY,
|
|
62
63
|
elRect,
|
|
63
64
|
wrapperRect
|
|
64
|
-
} =
|
|
65
|
+
} = toRefs(state);
|
|
66
|
+
const { isActive, close } = useMagicDrawer(id);
|
|
65
67
|
let pointerdownTarget = void 0;
|
|
66
68
|
let cancelPointerup = void 0;
|
|
67
69
|
let cancelPointermove = void 0;
|
|
@@ -123,35 +125,37 @@ export function useDrawerDrag(args) {
|
|
|
123
125
|
const distanceY = Math.abs(draggedY.value - lastDraggedY.value);
|
|
124
126
|
switch (position) {
|
|
125
127
|
case "bottom":
|
|
126
|
-
case "top":
|
|
128
|
+
case "top": {
|
|
127
129
|
if (distanceY > toValue(threshold).distance) {
|
|
128
130
|
const snapPointY = findClosestSnapPoint({
|
|
129
131
|
draggedX: 0,
|
|
130
132
|
draggedY,
|
|
131
133
|
direction: relDirectionY.value
|
|
132
134
|
});
|
|
133
|
-
if (snapPointY === drawerHeight.value) {
|
|
135
|
+
if (Math.abs(snapPointY ?? 0) === drawerHeight.value) {
|
|
134
136
|
shouldClose.value = true;
|
|
135
137
|
} else {
|
|
136
138
|
interpolateTo.value = snapPointY;
|
|
137
139
|
}
|
|
138
140
|
}
|
|
139
141
|
break;
|
|
142
|
+
}
|
|
140
143
|
case "right":
|
|
141
|
-
case "left":
|
|
144
|
+
case "left": {
|
|
142
145
|
if (distanceX > toValue(threshold).distance) {
|
|
143
146
|
const snapPointX = findClosestSnapPoint({
|
|
144
147
|
draggedX,
|
|
145
148
|
draggedY: 0,
|
|
146
149
|
direction: relDirectionX.value
|
|
147
150
|
});
|
|
148
|
-
if (snapPointX === drawerWidth.value) {
|
|
151
|
+
if (Math.abs(snapPointX ?? 0) === drawerWidth.value) {
|
|
149
152
|
shouldClose.value = true;
|
|
150
153
|
} else {
|
|
151
154
|
interpolateTo.value = snapPointX;
|
|
152
155
|
}
|
|
153
156
|
}
|
|
154
157
|
break;
|
|
158
|
+
}
|
|
155
159
|
}
|
|
156
160
|
}
|
|
157
161
|
function checkMomentum() {
|
|
@@ -162,63 +166,69 @@ export function useDrawerDrag(args) {
|
|
|
162
166
|
const velocityY = elapsed && distanceY ? distanceY / elapsed : 0;
|
|
163
167
|
switch (position) {
|
|
164
168
|
case "bottom":
|
|
165
|
-
case "top":
|
|
169
|
+
case "top": {
|
|
166
170
|
if (velocityY > toValue(threshold).momentum) {
|
|
167
171
|
const snapPointY = findClosestSnapPoint({
|
|
168
172
|
draggedX: 0,
|
|
169
173
|
draggedY,
|
|
170
174
|
direction: relDirectionY.value
|
|
171
175
|
});
|
|
172
|
-
if (snapPointY === drawerHeight.value) {
|
|
176
|
+
if (Math.abs(snapPointY ?? 0) === drawerHeight.value) {
|
|
173
177
|
shouldClose.value = true;
|
|
174
178
|
} else {
|
|
175
179
|
interpolateTo.value = snapPointY;
|
|
176
180
|
}
|
|
177
181
|
}
|
|
178
182
|
break;
|
|
183
|
+
}
|
|
179
184
|
case "right":
|
|
180
|
-
case "left":
|
|
185
|
+
case "left": {
|
|
181
186
|
if (velocityX > toValue(threshold).momentum) {
|
|
182
187
|
const snapPointX = findClosestSnapPoint({
|
|
183
188
|
draggedX,
|
|
184
189
|
draggedY,
|
|
185
190
|
direction: relDirectionX.value
|
|
186
191
|
});
|
|
187
|
-
if (snapPointX === drawerWidth.value) {
|
|
192
|
+
if (Math.abs(snapPointX ?? 0) === drawerWidth.value) {
|
|
188
193
|
shouldClose.value = true;
|
|
189
194
|
} else {
|
|
190
195
|
interpolateTo.value = snapPointX;
|
|
191
196
|
}
|
|
192
197
|
}
|
|
193
198
|
break;
|
|
199
|
+
}
|
|
194
200
|
}
|
|
195
201
|
}
|
|
196
202
|
function setDragged({ x, y }) {
|
|
197
203
|
switch (position) {
|
|
198
|
-
case "bottom":
|
|
204
|
+
case "bottom": {
|
|
199
205
|
const newDraggedB = clamp(y - originY.value, 0, toValue(overshoot) * -1);
|
|
200
206
|
if (newDraggedB === draggedY.value) break;
|
|
201
207
|
relDirectionY.value = newDraggedB < draggedY.value ? "below" : "above";
|
|
202
208
|
draggedY.value = newDraggedB;
|
|
203
209
|
break;
|
|
204
|
-
|
|
210
|
+
}
|
|
211
|
+
case "top": {
|
|
205
212
|
const newDraggedT = clamp(y - originY.value, 0, toValue(overshoot));
|
|
206
213
|
if (newDraggedT === draggedY.value) break;
|
|
207
214
|
relDirectionY.value = newDraggedT < draggedY.value ? "below" : "above";
|
|
208
215
|
draggedY.value = newDraggedT;
|
|
209
216
|
break;
|
|
210
|
-
|
|
217
|
+
}
|
|
218
|
+
case "right": {
|
|
211
219
|
const newDraggedR = clamp(x - originX.value, 0, toValue(overshoot) * -1);
|
|
212
220
|
if (newDraggedR === draggedX.value) break;
|
|
213
221
|
relDirectionX.value = newDraggedR < draggedX.value ? "below" : "above";
|
|
214
222
|
draggedX.value = newDraggedR;
|
|
215
223
|
break;
|
|
216
|
-
|
|
224
|
+
}
|
|
225
|
+
case "left": {
|
|
217
226
|
const newDraggedL = clamp(x - originX.value, 0, toValue(overshoot));
|
|
218
227
|
if (newDraggedL === draggedX.value) break;
|
|
219
228
|
relDirectionX.value = newDraggedL < draggedX.value ? "below" : "above";
|
|
220
229
|
draggedX.value = newDraggedL;
|
|
221
230
|
break;
|
|
231
|
+
}
|
|
222
232
|
}
|
|
223
233
|
}
|
|
224
234
|
function checkDirection({ x, y }) {
|
|
@@ -370,7 +380,6 @@ export function useDrawerDrag(args) {
|
|
|
370
380
|
}
|
|
371
381
|
e.stopImmediatePropagation();
|
|
372
382
|
e.stopPropagation();
|
|
373
|
-
e.preventDefault();
|
|
374
383
|
shouldClose.value = false;
|
|
375
384
|
checkDirection({ x: e.screenX, y: e.screenY });
|
|
376
385
|
if (!scrollLock) {
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { type Ref, type MaybeRef } from 'vue';
|
|
2
|
-
import {
|
|
3
|
-
import { type DrawerSnapPoint } from '../../types/index.js';
|
|
2
|
+
import type { DrawerSnapPoint, DrawerDefaultOptions } from '../../types/index.js';
|
|
4
3
|
interface UseDrawerGuardsArgs {
|
|
5
4
|
elRef: Ref<HTMLElement | undefined>;
|
|
6
5
|
absDirectionX: MaybeRef<'with' | 'against' | undefined>;
|
|
7
6
|
absDirectionY: MaybeRef<'with' | 'against' | undefined>;
|
|
8
|
-
position: MaybeRef<
|
|
7
|
+
position: MaybeRef<DrawerDefaultOptions['position']>;
|
|
9
8
|
activeSnapPoint: MaybeRef<DrawerSnapPoint | undefined>;
|
|
10
9
|
}
|
|
11
10
|
export declare function useDrawerGuards(args: UseDrawerGuardsArgs): {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { type Ref, type MaybeRef } from 'vue';
|
|
2
|
-
import type {
|
|
2
|
+
import type { DrawerDefaultOptions } from '../../types/index.js';
|
|
3
3
|
interface UseDrawerProgressArgs {
|
|
4
4
|
id: MaybeRef<string>;
|
|
5
5
|
elRef: Ref<HTMLElement | undefined>;
|
|
6
6
|
drawerRef: Ref<HTMLDivElement | undefined>;
|
|
7
|
-
position: MaybeRef<
|
|
7
|
+
position: MaybeRef<DrawerDefaultOptions['position']>;
|
|
8
8
|
overshoot: MaybeRef<number>;
|
|
9
9
|
}
|
|
10
10
|
export declare function useDrawerProgress(args: UseDrawerProgressArgs): {
|
|
@@ -4,7 +4,8 @@ import {
|
|
|
4
4
|
computed,
|
|
5
5
|
onMounted,
|
|
6
6
|
onBeforeUnmount,
|
|
7
|
-
nextTick
|
|
7
|
+
nextTick,
|
|
8
|
+
toRefs
|
|
8
9
|
} from "vue";
|
|
9
10
|
import { useElementBounding, useRafFn } from "@vueuse/core";
|
|
10
11
|
import { clampValue, mapValue } from "@maas/vue-equipment/utils";
|
|
@@ -23,7 +24,8 @@ export function useDrawerProgress(args) {
|
|
|
23
24
|
const maxY = computed(
|
|
24
25
|
() => drawerRect.height.value - elRect.height.value + toValue(overshoot)
|
|
25
26
|
);
|
|
26
|
-
const
|
|
27
|
+
const state = initializeState();
|
|
28
|
+
const { progress } = toRefs(state);
|
|
27
29
|
function rafCallback() {
|
|
28
30
|
drawerRect.update();
|
|
29
31
|
elRect.update();
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { type MaybeRef, type Ref } from 'vue';
|
|
2
|
-
import {
|
|
3
|
-
import { type DrawerSnapPoint } from '../../types/index.js';
|
|
2
|
+
import type { DrawerSnapPoint, DrawerDefaultOptions } from '../../types/index.js';
|
|
4
3
|
type UseDrawerSnapArgs = {
|
|
5
4
|
id: MaybeRef<string>;
|
|
6
5
|
wrapperRect: Ref<DOMRect | undefined>;
|
|
7
6
|
draggedY: Ref<number>;
|
|
8
7
|
draggedX: Ref<number>;
|
|
9
|
-
position: MaybeRef<
|
|
10
|
-
animation: MaybeRef<
|
|
11
|
-
snapPoints: MaybeRef<
|
|
12
|
-
preventDragClose: MaybeRef<
|
|
8
|
+
position: MaybeRef<DrawerDefaultOptions['position']>;
|
|
9
|
+
animation: MaybeRef<DrawerDefaultOptions['animation']>;
|
|
10
|
+
snapPoints: MaybeRef<DrawerDefaultOptions['snapPoints']>;
|
|
11
|
+
preventDragClose: MaybeRef<DrawerDefaultOptions['preventDragClose']>;
|
|
13
12
|
overshoot: MaybeRef<number>;
|
|
14
13
|
};
|
|
15
14
|
type FindClosestSnapPointArgs = {
|
|
@@ -31,13 +31,16 @@ export function useDrawerSnap(args) {
|
|
|
31
31
|
() => toValue(snapPoints),
|
|
32
32
|
() => {
|
|
33
33
|
const extended = toValue(preventDragClose) ? toValue(snapPoints) : [...toValue(snapPoints), 0];
|
|
34
|
-
const mapped = extended.reduce(
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
34
|
+
const mapped = extended.reduce(
|
|
35
|
+
(acc, current) => {
|
|
36
|
+
const key = mapSnapPoint(current);
|
|
37
|
+
if (key || key === 0) {
|
|
38
|
+
acc[key] = current;
|
|
39
|
+
}
|
|
40
|
+
return acc;
|
|
41
|
+
},
|
|
42
|
+
{}
|
|
43
|
+
);
|
|
41
44
|
return mapped;
|
|
42
45
|
}
|
|
43
46
|
);
|
|
@@ -45,18 +48,18 @@ export function useDrawerSnap(args) {
|
|
|
45
48
|
const snappedX = ref(0);
|
|
46
49
|
const activeSnapPoint = ref(void 0);
|
|
47
50
|
const drawerHeight = computed(() => {
|
|
48
|
-
|
|
51
|
+
const rect = toValue(wrapperRect);
|
|
52
|
+
if (rect === void 0) {
|
|
49
53
|
return 0;
|
|
50
|
-
} else {
|
|
51
|
-
return toValue(wrapperRect)?.height - toValue(overshoot);
|
|
52
54
|
}
|
|
55
|
+
return rect.height - toValue(overshoot);
|
|
53
56
|
});
|
|
54
57
|
const drawerWidth = computed(() => {
|
|
55
|
-
|
|
58
|
+
const rect = toValue(wrapperRect);
|
|
59
|
+
if (rect === void 0) {
|
|
56
60
|
return 0;
|
|
57
|
-
} else {
|
|
58
|
-
return toValue(wrapperRect)?.width - toValue(overshoot);
|
|
59
61
|
}
|
|
62
|
+
return rect.width - toValue(overshoot);
|
|
60
63
|
});
|
|
61
64
|
const emitter = useMagicEmitter();
|
|
62
65
|
function findClosestNumber(args2) {
|
|
@@ -97,22 +100,34 @@ export function useDrawerSnap(args) {
|
|
|
97
100
|
return void 0;
|
|
98
101
|
}
|
|
99
102
|
switch (position) {
|
|
100
|
-
case "bottom":
|
|
103
|
+
case "bottom": {
|
|
104
|
+
const rect = toValue(wrapperRect);
|
|
101
105
|
if (reversedSnapPoint === 1) return drawerHeight.value;
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
106
|
+
if (reversedSnapPoint === 0) return 0;
|
|
107
|
+
if (!rect) return 0;
|
|
108
|
+
return vh * reversedSnapPoint - rect.top;
|
|
109
|
+
}
|
|
110
|
+
case "top": {
|
|
111
|
+
const rect = toValue(wrapperRect);
|
|
105
112
|
if (reversedSnapPoint === 1) return drawerHeight.value * -1;
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
113
|
+
if (reversedSnapPoint === 0) return 0;
|
|
114
|
+
if (!rect) return 0;
|
|
115
|
+
return vh * reversedSnapPoint - rect.bottom;
|
|
116
|
+
}
|
|
117
|
+
case "right": {
|
|
118
|
+
const rect = toValue(wrapperRect);
|
|
109
119
|
if (reversedSnapPoint === 1) return drawerWidth.value;
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
120
|
+
if (reversedSnapPoint === 0) return 0;
|
|
121
|
+
if (!rect) return 0;
|
|
122
|
+
return vw * reversedSnapPoint - rect.left;
|
|
123
|
+
}
|
|
124
|
+
case "left": {
|
|
125
|
+
const rect = toValue(wrapperRect);
|
|
113
126
|
if (reversedSnapPoint === 1) return drawerWidth.value * -1;
|
|
114
|
-
|
|
115
|
-
|
|
127
|
+
if (reversedSnapPoint === 0) return 0;
|
|
128
|
+
if (!rect) return 0;
|
|
129
|
+
return vw * reversedSnapPoint - rect.right;
|
|
130
|
+
}
|
|
116
131
|
default:
|
|
117
132
|
return 0;
|
|
118
133
|
}
|
|
@@ -140,7 +155,7 @@ export function useDrawerSnap(args) {
|
|
|
140
155
|
await nextTick();
|
|
141
156
|
switch (position) {
|
|
142
157
|
case "top":
|
|
143
|
-
case "bottom":
|
|
158
|
+
case "bottom": {
|
|
144
159
|
const mappedSnapPointY = mapSnapPoint(snapPoint);
|
|
145
160
|
if (!mappedSnapPointY && mappedSnapPointY !== 0) return;
|
|
146
161
|
const closestY = findClosestSnapPoint({
|
|
@@ -155,8 +170,9 @@ export function useDrawerSnap(args) {
|
|
|
155
170
|
snappedY.value = closestY;
|
|
156
171
|
activeSnapPoint.value = toValue(snapPoint);
|
|
157
172
|
break;
|
|
173
|
+
}
|
|
158
174
|
case "left":
|
|
159
|
-
case "right":
|
|
175
|
+
case "right": {
|
|
160
176
|
const mappedSnapPointX = mapSnapPoint(toValue(snapPoint));
|
|
161
177
|
if (!mappedSnapPointX && mappedSnapPointX !== 0) return;
|
|
162
178
|
const closestX = findClosestSnapPoint({
|
|
@@ -172,6 +188,7 @@ export function useDrawerSnap(args) {
|
|
|
172
188
|
snappedX.value = closestX;
|
|
173
189
|
activeSnapPoint.value = toValue(snapPoint);
|
|
174
190
|
break;
|
|
191
|
+
}
|
|
175
192
|
}
|
|
176
193
|
}
|
|
177
194
|
function interpolateDragged(args2) {
|
|
@@ -233,8 +250,8 @@ export function useDrawerSnap(args) {
|
|
|
233
250
|
numbers: mappedSnapPoints.value,
|
|
234
251
|
direction
|
|
235
252
|
});
|
|
236
|
-
break;
|
|
237
253
|
}
|
|
254
|
+
break;
|
|
238
255
|
case "right":
|
|
239
256
|
case "left":
|
|
240
257
|
if (!!toValue(draggedX2) || toValue(draggedX2) === 0) {
|
|
@@ -243,8 +260,8 @@ export function useDrawerSnap(args) {
|
|
|
243
260
|
numbers: mappedSnapPoints.value,
|
|
244
261
|
direction
|
|
245
262
|
});
|
|
246
|
-
break;
|
|
247
263
|
}
|
|
264
|
+
break;
|
|
248
265
|
}
|
|
249
266
|
return closest;
|
|
250
267
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Ref, type MaybeRef } from 'vue';
|
|
2
2
|
import type { DrawerState } from '../../types/index.js';
|
|
3
3
|
export declare function useDrawerState(id: MaybeRef<string>): {
|
|
4
|
-
initializeState: () =>
|
|
4
|
+
initializeState: () => DrawerState;
|
|
5
5
|
deleteState: () => void;
|
|
6
6
|
drawerStateStore: Ref<DrawerState[], DrawerState[]>;
|
|
7
7
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ref, reactive,
|
|
1
|
+
import { ref, reactive, toValue } from "vue";
|
|
2
2
|
const drawerStateStore = ref([]);
|
|
3
3
|
export function useDrawerState(id) {
|
|
4
4
|
function createState(id2) {
|
|
@@ -30,16 +30,16 @@ export function useDrawerState(id) {
|
|
|
30
30
|
return reactive(state);
|
|
31
31
|
}
|
|
32
32
|
function addState(id2) {
|
|
33
|
-
const
|
|
34
|
-
drawerStateStore.value = [...drawerStateStore.value,
|
|
35
|
-
return
|
|
33
|
+
const state = createState(id2);
|
|
34
|
+
drawerStateStore.value = [...drawerStateStore.value, state];
|
|
35
|
+
return state;
|
|
36
36
|
}
|
|
37
37
|
function initializeState() {
|
|
38
|
-
let
|
|
39
|
-
return
|
|
38
|
+
let state = drawerStateStore.value.find((entry) => {
|
|
39
|
+
return entry.id === id;
|
|
40
40
|
});
|
|
41
|
-
if (!
|
|
42
|
-
return
|
|
41
|
+
if (!state) state = addState(toValue(id));
|
|
42
|
+
return state;
|
|
43
43
|
}
|
|
44
44
|
function deleteState() {
|
|
45
45
|
drawerStateStore.value = drawerStateStore.value.filter((x) => x.id !== id);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type Ref, type MaybeRef, type ComputedRef } from 'vue';
|
|
2
|
-
import {
|
|
2
|
+
import type { DrawerDefaultOptions } from '../../types/index.js';
|
|
3
3
|
type UseDrawerWheelArgs = {
|
|
4
4
|
id: MaybeRef<string>;
|
|
5
5
|
elRef: Ref<HTMLElement | undefined>;
|
|
6
|
-
position: MaybeRef<
|
|
6
|
+
position: MaybeRef<DrawerDefaultOptions['position']>;
|
|
7
7
|
disabled: ComputedRef<boolean>;
|
|
8
8
|
};
|
|
9
9
|
export declare function useDrawerWheel(args: UseDrawerWheelArgs): {
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
computed,
|
|
3
|
-
toValue
|
|
3
|
+
toValue,
|
|
4
|
+
toRefs
|
|
4
5
|
} from "vue";
|
|
5
6
|
import { unrefElement } from "@vueuse/core";
|
|
6
|
-
import WheelGestures from "
|
|
7
|
+
import WheelGestures from "wheel-gestures";
|
|
7
8
|
import { useDrawerState } from "./useDrawerState.mjs";
|
|
8
9
|
export function useDrawerWheel(args) {
|
|
9
10
|
const { id, elRef, position, disabled } = args;
|
|
10
11
|
const { initializeState } = useDrawerState(toValue(id));
|
|
11
|
-
const
|
|
12
|
+
const state = initializeState();
|
|
13
|
+
const { dragging, wheeling } = toRefs(state);
|
|
12
14
|
let startEvent;
|
|
13
15
|
const axis = computed(() => {
|
|
14
16
|
switch (toValue(position)) {
|
|
@@ -18,6 +20,8 @@ export function useDrawerWheel(args) {
|
|
|
18
20
|
case "top":
|
|
19
21
|
case "bottom":
|
|
20
22
|
return "y";
|
|
23
|
+
default:
|
|
24
|
+
return void 0;
|
|
21
25
|
}
|
|
22
26
|
});
|
|
23
27
|
const wheelGestures = WheelGestures({
|
|
@@ -27,9 +31,8 @@ export function useDrawerWheel(args) {
|
|
|
27
31
|
});
|
|
28
32
|
let unobserveTargetNode;
|
|
29
33
|
let cancelWheel;
|
|
30
|
-
function createPointerEvent(type,
|
|
31
|
-
|
|
32
|
-
[moveX, moveY] = state.axisMovement;
|
|
34
|
+
function createPointerEvent(type, state2) {
|
|
35
|
+
const [moveX, moveY] = state2.axisMovement;
|
|
33
36
|
if (!startEvent) {
|
|
34
37
|
return new PointerEvent(type);
|
|
35
38
|
}
|
|
@@ -47,40 +50,41 @@ export function useDrawerWheel(args) {
|
|
|
47
50
|
function dispatchEvent(event) {
|
|
48
51
|
unrefElement(elRef)?.dispatchEvent(event);
|
|
49
52
|
}
|
|
50
|
-
function onWheelStarted(
|
|
53
|
+
function onWheelStarted(state2) {
|
|
51
54
|
try {
|
|
52
|
-
startEvent = new PointerEvent("pointerdown",
|
|
55
|
+
startEvent = new PointerEvent("pointerdown", state2.event);
|
|
53
56
|
dispatchEvent(startEvent);
|
|
54
57
|
wheeling.value = true;
|
|
55
58
|
} catch (e) {
|
|
59
|
+
console.error(e);
|
|
56
60
|
return destroyWheelListener();
|
|
57
61
|
}
|
|
58
62
|
}
|
|
59
|
-
function onWheelMove(
|
|
60
|
-
dispatchEvent(createPointerEvent("pointermove",
|
|
63
|
+
function onWheelMove(state2) {
|
|
64
|
+
dispatchEvent(createPointerEvent("pointermove", state2));
|
|
61
65
|
}
|
|
62
|
-
function onWheelEnded(
|
|
63
|
-
dispatchEvent(createPointerEvent("pointerup",
|
|
66
|
+
function onWheelEnded(state2) {
|
|
67
|
+
dispatchEvent(createPointerEvent("pointerup", state2));
|
|
64
68
|
wheeling.value = false;
|
|
65
69
|
}
|
|
66
|
-
function handleWheel(
|
|
70
|
+
function handleWheel(state2) {
|
|
67
71
|
const {
|
|
68
72
|
axisDelta: [deltaX, deltaY]
|
|
69
|
-
} =
|
|
73
|
+
} = state2;
|
|
70
74
|
const primaryAxisDelta = axis.value === "x" ? deltaX : deltaY;
|
|
71
75
|
const crossAxisDelta = axis.value === "x" ? deltaY : deltaX;
|
|
72
|
-
const isEndingOrRelease =
|
|
76
|
+
const isEndingOrRelease = state2.isEnding && !state2.isMomentum || state2.isMomentum && state2.previous && !state2.previous.isMomentum;
|
|
73
77
|
const primaryAxisDeltaIsDominant = Math.abs(primaryAxisDelta) > Math.abs(crossAxisDelta);
|
|
74
|
-
if (primaryAxisDeltaIsDominant && !dragging.value && !
|
|
75
|
-
onWheelStarted(
|
|
78
|
+
if (primaryAxisDeltaIsDominant && !dragging.value && !state2.isMomentum) {
|
|
79
|
+
onWheelStarted(state2);
|
|
76
80
|
}
|
|
77
81
|
if (!dragging.value || !wheeling.value) {
|
|
78
82
|
return;
|
|
79
83
|
}
|
|
80
84
|
if (isEndingOrRelease) {
|
|
81
|
-
onWheelEnded(
|
|
85
|
+
onWheelEnded(state2);
|
|
82
86
|
} else {
|
|
83
|
-
onWheelMove(
|
|
87
|
+
onWheelMove(state2);
|
|
84
88
|
}
|
|
85
89
|
}
|
|
86
90
|
function initializeWheelListener() {
|