@maas/vue-equipment 0.40.0 → 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 -16
- 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 +1 -3
- package/dist/plugins/MagicEmitter/src/composables/useMagicEmitter.d.ts +190 -46
- package/dist/plugins/MagicEmitter/src/types/index.d.ts +1 -1
- package/dist/plugins/MagicMarquee/index.d.ts +4 -2
- package/dist/plugins/MagicMarquee/index.mjs +2 -1
- package/dist/plugins/MagicMarquee/src/components/MagicMarquee.vue +121 -50
- package/dist/plugins/MagicMarquee/src/components/MagicMarquee.vue.d.ts +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 -57
- 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,73 +1,12 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
:class="[
|
|
11
|
-
'magic-drawer',
|
|
12
|
-
`-${mappedOptions.position}`,
|
|
13
|
-
{
|
|
14
|
-
'-dragging': dragging,
|
|
15
|
-
'-wheeling': wheeling,
|
|
16
|
-
'-disabled': disabled,
|
|
17
|
-
},
|
|
18
|
-
]"
|
|
19
|
-
v-bind="$attrs"
|
|
20
|
-
aria-modal="true"
|
|
21
|
-
>
|
|
22
|
-
<transition
|
|
23
|
-
v-if="mappedOptions.backdrop || !!$slots.backdrop"
|
|
24
|
-
:name="backdropTransition"
|
|
25
|
-
>
|
|
26
|
-
<div
|
|
27
|
-
v-show="innerActive"
|
|
28
|
-
class="magic-drawer__backdrop"
|
|
29
|
-
@click.self="guardedClose"
|
|
30
|
-
>
|
|
31
|
-
<slot name="backdrop" />
|
|
32
|
-
</div>
|
|
33
|
-
</transition>
|
|
34
|
-
|
|
35
|
-
<div class="magic-drawer__wrapper" ref="wrapperRef">
|
|
36
|
-
<transition
|
|
37
|
-
:name="contentTransition"
|
|
38
|
-
@before-leave="onBeforeLeave"
|
|
39
|
-
@leave="onLeave"
|
|
40
|
-
@after-leave="onAfterLeave"
|
|
41
|
-
@before-enter="onBeforeEnter"
|
|
42
|
-
@enter="onEnter"
|
|
43
|
-
@after-enter="onAfterEnter"
|
|
44
|
-
>
|
|
45
|
-
<div v-show="innerActive" class="magic-drawer__content">
|
|
46
|
-
<component
|
|
47
|
-
:is="mappedOptions.tag"
|
|
48
|
-
ref="elRef"
|
|
49
|
-
class="magic-drawer__drag"
|
|
50
|
-
:style="style"
|
|
51
|
-
@pointerdown="guardedPointerdown"
|
|
52
|
-
@click="guardedClick"
|
|
53
|
-
>
|
|
54
|
-
<component
|
|
55
|
-
v-if="component"
|
|
56
|
-
v-bind="props"
|
|
57
|
-
:is="component"
|
|
58
|
-
@close="guardedClose"
|
|
59
|
-
/>
|
|
60
|
-
<slot v-else />
|
|
61
|
-
<div v-if="hasDragged" class="magic-drawer__overlay" />
|
|
62
|
-
</component>
|
|
63
|
-
</div>
|
|
64
|
-
</transition>
|
|
65
|
-
</div>
|
|
66
|
-
</div>
|
|
67
|
-
</teleport>
|
|
68
|
-
</template>
|
|
69
|
-
|
|
70
|
-
<script setup lang="ts">
|
|
1
|
+
<script>
|
|
2
|
+
import { defineComponent as _defineComponent } from "vue";
|
|
3
|
+
import { unref as _unref, renderSlot as _renderSlot, vShow as _vShow, withModifiers as _withModifiers, createElementVNode as _createElementVNode, withDirectives as _withDirectives, Transition as _Transition, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, createElementBlock as _createElementBlock, resolveDynamicComponent as _resolveDynamicComponent, normalizeStyle as _normalizeStyle, createVNode as _createVNode, mergeProps as _mergeProps, Teleport as _Teleport } from "vue";
|
|
4
|
+
const _hoisted_1 = ["id", "data-dragging", "data-wheeling", "data-disabled", "data-position"];
|
|
5
|
+
const _hoisted_2 = { class: "magic-drawer__content" };
|
|
6
|
+
const _hoisted_3 = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "magic-drawer__overlay"
|
|
9
|
+
};
|
|
71
10
|
import {
|
|
72
11
|
ref,
|
|
73
12
|
watch,
|
|
@@ -77,307 +16,523 @@ import {
|
|
|
77
16
|
onBeforeMount,
|
|
78
17
|
onBeforeUnmount,
|
|
79
18
|
onUnmounted,
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
} from
|
|
83
|
-
import {
|
|
84
|
-
import {
|
|
85
|
-
import {
|
|
86
|
-
import {
|
|
87
|
-
import {
|
|
88
|
-
import {
|
|
89
|
-
import {
|
|
90
|
-
import {
|
|
91
|
-
import {
|
|
92
|
-
import {
|
|
93
|
-
import
|
|
94
|
-
|
|
95
|
-
import
|
|
96
|
-
|
|
97
|
-
import
|
|
98
|
-
import
|
|
99
|
-
import
|
|
100
|
-
import
|
|
101
|
-
import
|
|
102
|
-
import
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
})
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
19
|
+
toRefs
|
|
20
|
+
} from "vue";
|
|
21
|
+
import { createDefu } from "defu";
|
|
22
|
+
import { onKeyStroke, unrefElement } from "@vueuse/core";
|
|
23
|
+
import { useMetaViewport } from "@maas/vue-equipment/composables";
|
|
24
|
+
import { defaultOptions } from "./../utils/defaultOptions";
|
|
25
|
+
import { useDrawerDOM } from "../composables/private/useDrawerDOM";
|
|
26
|
+
import { useDrawerCallback } from "../composables/private/useDrawerCallback";
|
|
27
|
+
import { useDrawerProgress } from "../composables/private/useDrawerProgress";
|
|
28
|
+
import { useDrawerDrag } from "../composables/private/useDrawerDrag";
|
|
29
|
+
import { useDrawerWheel } from "../composables/private/useDrawerWheel";
|
|
30
|
+
import { useDrawerState } from "../composables/private/useDrawerState";
|
|
31
|
+
import { useMagicDrawer } from "../composables/useMagicDrawer";
|
|
32
|
+
import "@maas/vue-equipment/utils/css/animations/fade-in.css";
|
|
33
|
+
import "@maas/vue-equipment/utils/css/animations/fade-out.css";
|
|
34
|
+
import "@maas/vue-equipment/utils/css/animations/slide-ltr-in.css";
|
|
35
|
+
import "@maas/vue-equipment/utils/css/animations/slide-rtl-in.css";
|
|
36
|
+
import "@maas/vue-equipment/utils/css/animations/slide-ttb-in.css";
|
|
37
|
+
import "@maas/vue-equipment/utils/css/animations/slide-btt-in.css";
|
|
38
|
+
import "@maas/vue-equipment/utils/css/animations/slide-ltr-out.css";
|
|
39
|
+
import "@maas/vue-equipment/utils/css/animations/slide-rtl-out.css";
|
|
40
|
+
import "@maas/vue-equipment/utils/css/animations/slide-ttb-out.css";
|
|
41
|
+
import "@maas/vue-equipment/utils/css/animations/slide-btt-out.css";
|
|
42
|
+
export default /* @__PURE__ */ _defineComponent({
|
|
43
|
+
...{
|
|
44
|
+
inheritAttrs: false
|
|
45
|
+
},
|
|
46
|
+
__name: "MagicDrawer",
|
|
47
|
+
props: {
|
|
48
|
+
id: { type: null, required: true },
|
|
49
|
+
options: { type: Object, required: false, default: () => ({}) }
|
|
50
|
+
},
|
|
51
|
+
setup(__props) {
|
|
52
|
+
const customDefu = createDefu((obj, key, value) => {
|
|
53
|
+
if (key === "close" || key === "snapPoints") {
|
|
54
|
+
obj[key] = value;
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
const mappedOptions = customDefu(__props.options, defaultOptions);
|
|
59
|
+
const elRef = ref(void 0);
|
|
60
|
+
const drawerRef = ref(void 0);
|
|
61
|
+
const wrapperRef = ref(void 0);
|
|
62
|
+
const {
|
|
63
|
+
trapFocus,
|
|
64
|
+
releaseFocus,
|
|
65
|
+
lockScroll,
|
|
66
|
+
unlockScroll,
|
|
67
|
+
addScrollLockPadding,
|
|
68
|
+
removeScrollLockPadding
|
|
69
|
+
} = useDrawerDOM({
|
|
70
|
+
focusTarget: drawerRef,
|
|
71
|
+
focusTrap: mappedOptions.focusTrap
|
|
72
|
+
});
|
|
73
|
+
const { isActive, open, close } = useMagicDrawer(__props.id);
|
|
74
|
+
const overshoot = ref(0);
|
|
75
|
+
const {
|
|
76
|
+
position,
|
|
77
|
+
snapPoints,
|
|
78
|
+
threshold,
|
|
79
|
+
animation,
|
|
80
|
+
preventDragClose,
|
|
81
|
+
initial
|
|
82
|
+
} = mappedOptions;
|
|
83
|
+
const disabled = computed(() => {
|
|
84
|
+
if (__props.options.disabled === void 0) {
|
|
85
|
+
return defaultOptions.disabled;
|
|
86
|
+
} else {
|
|
87
|
+
return __props.options.disabled;
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
const { onPointerdown, onClick, style, hasDragged } = useDrawerDrag({
|
|
91
|
+
id: __props.id,
|
|
92
|
+
elRef,
|
|
93
|
+
wrapperRef,
|
|
94
|
+
position,
|
|
95
|
+
snapPoints,
|
|
96
|
+
threshold,
|
|
97
|
+
overshoot,
|
|
98
|
+
animation,
|
|
99
|
+
initial,
|
|
100
|
+
preventDragClose,
|
|
101
|
+
disabled
|
|
102
|
+
});
|
|
103
|
+
const { initializeWheelListener, destroyWheelListener } = useDrawerWheel({
|
|
104
|
+
id: __props.id,
|
|
105
|
+
elRef,
|
|
106
|
+
position,
|
|
107
|
+
disabled
|
|
108
|
+
});
|
|
109
|
+
const { initializeState, deleteState } = useDrawerState(__props.id);
|
|
110
|
+
const state = initializeState();
|
|
111
|
+
const { dragging, wheeling } = toRefs(state);
|
|
112
|
+
const innerActive = ref(false);
|
|
113
|
+
const wrapperActive = ref(false);
|
|
114
|
+
const wasActive = ref(false);
|
|
115
|
+
const {
|
|
116
|
+
onBeforeEnter,
|
|
117
|
+
onEnter,
|
|
118
|
+
onAfterEnter,
|
|
119
|
+
onBeforeLeave,
|
|
120
|
+
onLeave,
|
|
121
|
+
onAfterLeave
|
|
122
|
+
} = useDrawerCallback({
|
|
123
|
+
id: __props.id,
|
|
124
|
+
mappedOptions,
|
|
125
|
+
addScrollLockPadding,
|
|
126
|
+
removeScrollLockPadding,
|
|
127
|
+
lockScroll,
|
|
128
|
+
unlockScroll,
|
|
129
|
+
trapFocus,
|
|
130
|
+
releaseFocus,
|
|
131
|
+
wrapperActive,
|
|
132
|
+
wasActive
|
|
133
|
+
});
|
|
134
|
+
useDrawerProgress({ id: __props.id, elRef, drawerRef, position, overshoot });
|
|
135
|
+
const { resetMetaViewport } = useMetaViewport();
|
|
136
|
+
const preventTransition = computed(() => {
|
|
137
|
+
return mappedOptions.initial.open && !mappedOptions.initial.transition && !wasActive.value;
|
|
138
|
+
});
|
|
139
|
+
const backdropTransition = computed(() => {
|
|
140
|
+
return preventTransition.value ? void 0 : mappedOptions.transition?.backdrop;
|
|
141
|
+
});
|
|
142
|
+
const contentTransition = computed(() => {
|
|
143
|
+
return preventTransition.value ? void 0 : mappedOptions.transition?.content;
|
|
144
|
+
});
|
|
145
|
+
function convertToPixels(value) {
|
|
146
|
+
const regex = /^(\d*\.?\d+)\s*(rem|px)$/;
|
|
147
|
+
const match = value.match(regex);
|
|
148
|
+
if (!match) {
|
|
149
|
+
console.error(
|
|
150
|
+
`--magic-drawer-drag-overshoot (${value}) needs to be specified in px or rem`
|
|
151
|
+
);
|
|
152
|
+
return 0;
|
|
153
|
+
}
|
|
154
|
+
const numericValue = parseFloat(match[1]);
|
|
155
|
+
const unit = match[2];
|
|
156
|
+
const bodyFontSize = window.getComputedStyle(document.body).fontSize;
|
|
157
|
+
const rootFontSize = parseFloat(bodyFontSize) || 16;
|
|
158
|
+
switch (unit) {
|
|
159
|
+
case "rem":
|
|
160
|
+
return numericValue * rootFontSize;
|
|
161
|
+
case "px":
|
|
162
|
+
return numericValue;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
async function onOpen() {
|
|
166
|
+
wrapperActive.value = true;
|
|
167
|
+
await nextTick();
|
|
168
|
+
innerActive.value = true;
|
|
169
|
+
await nextTick();
|
|
170
|
+
if (mappedOptions.enableMousewheel) {
|
|
171
|
+
initializeWheelListener();
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
function onClose() {
|
|
175
|
+
innerActive.value = false;
|
|
176
|
+
if (mappedOptions.enableMousewheel) {
|
|
177
|
+
destroyWheelListener();
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
function guardedPointerdown(event) {
|
|
181
|
+
if (!disabled.value) {
|
|
182
|
+
onPointerdown(event);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
function guardedClick(event) {
|
|
186
|
+
if (!disabled.value) {
|
|
187
|
+
onClick(event);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
function guardedClose() {
|
|
191
|
+
if (!disabled.value) {
|
|
192
|
+
close();
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
function saveOvershoot() {
|
|
196
|
+
const element = unrefElement(drawerRef);
|
|
197
|
+
if (!element) {
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
const overshootVar = getComputedStyle(element, null).getPropertyValue(
|
|
201
|
+
"--magic-drawer-drag-overshoot"
|
|
202
|
+
);
|
|
203
|
+
overshoot.value = convertToPixels(overshootVar) || 0;
|
|
204
|
+
}
|
|
205
|
+
if (mappedOptions.keyListener.close) {
|
|
206
|
+
for (const key of mappedOptions.keyListener.close) {
|
|
207
|
+
onKeyStroke(key, (e) => {
|
|
208
|
+
close();
|
|
209
|
+
e.preventDefault();
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
watch(isActive, async (value) => {
|
|
214
|
+
if (value) {
|
|
215
|
+
await onOpen();
|
|
216
|
+
} else {
|
|
217
|
+
onClose();
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
watch(innerActive, () => {
|
|
221
|
+
saveOvershoot();
|
|
222
|
+
});
|
|
223
|
+
onBeforeMount(async () => {
|
|
224
|
+
if (mappedOptions.initial.open) {
|
|
225
|
+
open();
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
onBeforeUnmount(() => {
|
|
229
|
+
close();
|
|
230
|
+
});
|
|
231
|
+
onUnmounted(() => {
|
|
232
|
+
if (mappedOptions.scrollLock) {
|
|
233
|
+
unlockScroll();
|
|
234
|
+
if (typeof mappedOptions.scrollLock === "object" && mappedOptions.scrollLock.padding) {
|
|
235
|
+
removeScrollLockPadding();
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
if (mappedOptions.focusTrap) {
|
|
239
|
+
releaseFocus();
|
|
240
|
+
}
|
|
241
|
+
if (!mappedOptions.preventZoom) {
|
|
242
|
+
resetMetaViewport();
|
|
243
|
+
}
|
|
244
|
+
deleteState();
|
|
245
|
+
});
|
|
246
|
+
return (_ctx, _cache) => {
|
|
247
|
+
return wrapperActive.value ? (_openBlock(), _createBlock(_Teleport, {
|
|
248
|
+
key: 0,
|
|
249
|
+
to: _unref(mappedOptions).teleport?.target,
|
|
250
|
+
disabled: _unref(mappedOptions).teleport?.disabled
|
|
251
|
+
}, [
|
|
252
|
+
_createElementVNode("div", _mergeProps({
|
|
253
|
+
id: toValue(_ctx.id),
|
|
254
|
+
ref_key: "drawerRef",
|
|
255
|
+
ref: drawerRef,
|
|
256
|
+
class: "magic-drawer",
|
|
257
|
+
"data-dragging": _unref(dragging),
|
|
258
|
+
"data-wheeling": _unref(wheeling),
|
|
259
|
+
"data-disabled": disabled.value,
|
|
260
|
+
"data-position": _unref(mappedOptions).position
|
|
261
|
+
}, _ctx.$attrs, { "aria-modal": "true" }), [
|
|
262
|
+
_unref(mappedOptions).backdrop || !!_ctx.$slots.backdrop ? (_openBlock(), _createBlock(_Transition, {
|
|
263
|
+
key: 0,
|
|
264
|
+
name: backdropTransition.value,
|
|
265
|
+
persisted: ""
|
|
266
|
+
}, {
|
|
267
|
+
default: _withCtx(() => [
|
|
268
|
+
_withDirectives(_createElementVNode(
|
|
269
|
+
"div",
|
|
270
|
+
{
|
|
271
|
+
class: "magic-drawer__backdrop",
|
|
272
|
+
onClick: _withModifiers(guardedClose, ["self"])
|
|
273
|
+
},
|
|
274
|
+
[
|
|
275
|
+
_renderSlot(_ctx.$slots, "backdrop")
|
|
276
|
+
],
|
|
277
|
+
512
|
|
278
|
+
/* NEED_PATCH */
|
|
279
|
+
), [
|
|
280
|
+
[_vShow, innerActive.value]
|
|
281
|
+
])
|
|
282
|
+
]),
|
|
283
|
+
_: 3
|
|
284
|
+
/* FORWARDED */
|
|
285
|
+
}, 8, ["name"])) : _createCommentVNode("v-if", true),
|
|
286
|
+
_createElementVNode(
|
|
287
|
+
"div",
|
|
288
|
+
{
|
|
289
|
+
ref_key: "wrapperRef",
|
|
290
|
+
ref: wrapperRef,
|
|
291
|
+
class: "magic-drawer__wrapper"
|
|
292
|
+
},
|
|
293
|
+
[
|
|
294
|
+
_createVNode(_Transition, {
|
|
295
|
+
name: contentTransition.value,
|
|
296
|
+
onBeforeLeave: _unref(onBeforeLeave),
|
|
297
|
+
onLeave: _unref(onLeave),
|
|
298
|
+
onAfterLeave: _unref(onAfterLeave),
|
|
299
|
+
onBeforeEnter: _unref(onBeforeEnter),
|
|
300
|
+
onEnter: _unref(onEnter),
|
|
301
|
+
onAfterEnter: _unref(onAfterEnter),
|
|
302
|
+
persisted: ""
|
|
303
|
+
}, {
|
|
304
|
+
default: _withCtx(() => [
|
|
305
|
+
_withDirectives(_createElementVNode(
|
|
306
|
+
"div",
|
|
307
|
+
_hoisted_2,
|
|
308
|
+
[
|
|
309
|
+
(_openBlock(), _createBlock(_resolveDynamicComponent(_unref(mappedOptions).tag), {
|
|
310
|
+
ref_key: "elRef",
|
|
311
|
+
ref: elRef,
|
|
312
|
+
class: "magic-drawer__drag",
|
|
313
|
+
style: _normalizeStyle(_unref(style)),
|
|
314
|
+
onPointerdown: guardedPointerdown,
|
|
315
|
+
onClick: guardedClick
|
|
316
|
+
}, {
|
|
317
|
+
default: _withCtx(() => [
|
|
318
|
+
_renderSlot(_ctx.$slots, "default"),
|
|
319
|
+
_unref(hasDragged) ? (_openBlock(), _createElementBlock("div", _hoisted_3)) : _createCommentVNode("v-if", true)
|
|
320
|
+
]),
|
|
321
|
+
_: 3
|
|
322
|
+
/* FORWARDED */
|
|
323
|
+
}, 40, ["style"]))
|
|
324
|
+
],
|
|
325
|
+
512
|
|
326
|
+
/* NEED_PATCH */
|
|
327
|
+
), [
|
|
328
|
+
[_vShow, innerActive.value]
|
|
329
|
+
])
|
|
330
|
+
]),
|
|
331
|
+
_: 3
|
|
332
|
+
/* FORWARDED */
|
|
333
|
+
}, 8, ["name", "onBeforeLeave", "onLeave", "onAfterLeave", "onBeforeEnter", "onEnter", "onAfterEnter"])
|
|
334
|
+
],
|
|
335
|
+
512
|
|
336
|
+
/* NEED_PATCH */
|
|
337
|
+
)
|
|
338
|
+
], 16, _hoisted_1)
|
|
339
|
+
], 8, ["to", "disabled"])) : _createCommentVNode("v-if", true);
|
|
340
|
+
};
|
|
118
341
|
}
|
|
119
|
-
})
|
|
342
|
+
});
|
|
343
|
+
</script>
|
|
120
344
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
345
|
+
<style>
|
|
346
|
+
:root {
|
|
347
|
+
--magic-drawer-height: 75svh;
|
|
348
|
+
--magic-drawer-width: 100%;
|
|
349
|
+
--magic-drawer-justify-content: center;
|
|
350
|
+
--magic-drawer-align-items: flex-end;
|
|
351
|
+
--magic-drawer-enter-animation: slide-btt-in 300ms ease;
|
|
352
|
+
--magic-drawer-leave-animation: slide-btt-out 300ms ease;
|
|
353
|
+
--magic-drawer-drag-overshoot: 4rem;
|
|
125
354
|
}
|
|
126
355
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
addScrollLockPadding,
|
|
146
|
-
removeScrollLockPadding,
|
|
147
|
-
} = useDrawerDOM({
|
|
148
|
-
focusTarget: drawerRef,
|
|
149
|
-
focusTrap: mappedOptions.focusTrap,
|
|
150
|
-
})
|
|
151
|
-
|
|
152
|
-
const { isActive, open, close } = useMagicDrawer(props.id)
|
|
153
|
-
|
|
154
|
-
const overshoot = ref(0)
|
|
155
|
-
const {
|
|
156
|
-
position,
|
|
157
|
-
snapPoints,
|
|
158
|
-
threshold,
|
|
159
|
-
animation,
|
|
160
|
-
preventDragClose,
|
|
161
|
-
initial,
|
|
162
|
-
} = mappedOptions
|
|
163
|
-
|
|
164
|
-
// Make sure this is reactive
|
|
165
|
-
const disabled = computed(() => {
|
|
166
|
-
if (props.options.disabled === undefined) {
|
|
167
|
-
return defaultOptions.disabled
|
|
168
|
-
} else {
|
|
169
|
-
return props.options.disabled
|
|
170
|
-
}
|
|
171
|
-
})
|
|
172
|
-
|
|
173
|
-
const { onPointerdown, onClick, style, hasDragged } = useDrawerDrag({
|
|
174
|
-
id: props.id,
|
|
175
|
-
isActive,
|
|
176
|
-
elRef,
|
|
177
|
-
wrapperRef,
|
|
178
|
-
position,
|
|
179
|
-
snapPoints,
|
|
180
|
-
threshold,
|
|
181
|
-
overshoot,
|
|
182
|
-
animation,
|
|
183
|
-
initial,
|
|
184
|
-
preventDragClose,
|
|
185
|
-
disabled,
|
|
186
|
-
close,
|
|
187
|
-
})
|
|
188
|
-
|
|
189
|
-
const { initializeWheelListener, destroyWheelListener } = useDrawerWheel({
|
|
190
|
-
id: props.id,
|
|
191
|
-
elRef,
|
|
192
|
-
position,
|
|
193
|
-
disabled,
|
|
194
|
-
})
|
|
195
|
-
|
|
196
|
-
const { initializeState, deleteState } = useDrawerState(props.id)
|
|
197
|
-
const { dragging, wheeling } = initializeState()
|
|
198
|
-
|
|
199
|
-
// Split isActive into two values to animate drawer smoothly
|
|
200
|
-
const innerActive = ref(false)
|
|
201
|
-
const wrapperActive = ref(false)
|
|
202
|
-
const wasActive = ref(false)
|
|
203
|
-
|
|
204
|
-
const {
|
|
205
|
-
onBeforeEnter,
|
|
206
|
-
onEnter,
|
|
207
|
-
onAfterEnter,
|
|
208
|
-
onBeforeLeave,
|
|
209
|
-
onLeave,
|
|
210
|
-
onAfterLeave,
|
|
211
|
-
} = useDrawerCallback({
|
|
212
|
-
id: props.id,
|
|
213
|
-
mappedOptions,
|
|
214
|
-
addScrollLockPadding,
|
|
215
|
-
removeScrollLockPadding,
|
|
216
|
-
lockScroll,
|
|
217
|
-
unlockScroll,
|
|
218
|
-
trapFocus,
|
|
219
|
-
releaseFocus,
|
|
220
|
-
wrapperActive,
|
|
221
|
-
wasActive,
|
|
222
|
-
})
|
|
223
|
-
|
|
224
|
-
useDrawerProgress({ id: props.id, elRef, drawerRef, position, overshoot })
|
|
225
|
-
|
|
226
|
-
const { resetMetaViewport } = useMetaViewport()
|
|
227
|
-
|
|
228
|
-
// Prevent animation on initial mount if the options call for it
|
|
229
|
-
// To achieve this, the transition names are set to undefined
|
|
230
|
-
const preventTransition = computed(() => {
|
|
231
|
-
return (
|
|
232
|
-
mappedOptions.initial.open &&
|
|
233
|
-
!mappedOptions.initial.transition &&
|
|
234
|
-
!wasActive.value
|
|
235
|
-
)
|
|
236
|
-
})
|
|
237
|
-
|
|
238
|
-
const backdropTransition = computed(() => {
|
|
239
|
-
return preventTransition.value
|
|
240
|
-
? undefined
|
|
241
|
-
: mappedOptions.transition?.backdrop
|
|
242
|
-
})
|
|
243
|
-
|
|
244
|
-
const contentTransition = computed(() => {
|
|
245
|
-
return preventTransition.value ? undefined : mappedOptions.transition?.content
|
|
246
|
-
})
|
|
247
|
-
|
|
248
|
-
// Private functions
|
|
249
|
-
function convertToPixels(value: string) {
|
|
250
|
-
const regex = /^(\d*\.?\d+)\s*(rem|px)$/
|
|
356
|
+
.magic-drawer {
|
|
357
|
+
--magic-drawer-padding: 0px;
|
|
358
|
+
--magic-drawer-drag-overshoot-x: 0px;
|
|
359
|
+
--magic-drawer-drag-overshoot-y: 0px;
|
|
360
|
+
position: fixed;
|
|
361
|
+
inset: 0;
|
|
362
|
+
width: 100%;
|
|
363
|
+
height: 100%;
|
|
364
|
+
display: flex;
|
|
365
|
+
pointer-events: none;
|
|
366
|
+
justify-content: var(--magic-drawer-justify-content);
|
|
367
|
+
align-items: var(--magic-drawer-align-items);
|
|
368
|
+
z-index: var(--magic-drawer-z-index, 999);
|
|
369
|
+
background: transparent;
|
|
370
|
+
color: inherit;
|
|
371
|
+
padding: 0;
|
|
372
|
+
border: none;
|
|
373
|
+
}
|
|
251
374
|
|
|
252
|
-
|
|
375
|
+
.magic-drawer[data-position='bottom'] {
|
|
376
|
+
--magic-drawer-drag-overshoot-y: var(--magic-drawer-drag-overshoot);
|
|
377
|
+
--magic-drawer-padding: 0 0 var(--magic-drawer-drag-overshoot-y) 0;
|
|
253
378
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
)
|
|
258
|
-
return 0
|
|
379
|
+
& > .magic-drawer__wrapper {
|
|
380
|
+
height: calc(
|
|
381
|
+
var(--magic-drawer-height, 0px) + var(--magic-drawer-drag-overshoot, 0px)
|
|
382
|
+
);
|
|
259
383
|
}
|
|
384
|
+
}
|
|
260
385
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
386
|
+
.magic-drawer[data-position='top'] {
|
|
387
|
+
--magic-drawer-enter-animation: slide-ttb-in 300ms ease;
|
|
388
|
+
--magic-drawer-leave-animation: slide-ttb-out 300ms ease;
|
|
389
|
+
--magic-drawer-align-items: flex-start;
|
|
390
|
+
--magic-drawer-drag-overshoot-y: calc(
|
|
391
|
+
var(--magic-drawer-drag-overshoot) * -1
|
|
392
|
+
);
|
|
393
|
+
--magic-drawer-padding: var(--magic-drawer-drag-overshoot-y) 0 0 0;
|
|
394
|
+
|
|
395
|
+
& > .magic-drawer__wrapper {
|
|
396
|
+
height: calc(
|
|
397
|
+
var(--magic-drawer-height, 0px) + var(--magic-drawer-drag-overshoot, 0px)
|
|
398
|
+
);
|
|
271
399
|
}
|
|
272
400
|
}
|
|
273
401
|
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
402
|
+
.magic-drawer[data-position='right'] {
|
|
403
|
+
--magic-drawer-enter-animation: slide-rtl-in 300ms ease;
|
|
404
|
+
--magic-drawer-leave-animation: slide-rtl-out 300ms ease;
|
|
405
|
+
--magic-drawer-align-items: center;
|
|
406
|
+
--magic-drawer-justify-content: flex-end;
|
|
407
|
+
--magic-drawer-drag-overshoot-x: var(--magic-drawer-drag-overshoot);
|
|
408
|
+
--magic-drawer-padding: 0 var(--magic-drawer-drag-overshoot-x) 0 0;
|
|
409
|
+
|
|
410
|
+
& > .magic-drawer__wrapper {
|
|
411
|
+
width: calc(
|
|
412
|
+
var(--magic-drawer-width, 0px) + var(--magic-drawer-drag-overshoot, 0px)
|
|
413
|
+
);
|
|
281
414
|
}
|
|
282
415
|
}
|
|
283
416
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
417
|
+
.magic-drawer[data-position='left'] {
|
|
418
|
+
--magic-drawer-enter-animation: slide-ltr-in 300ms ease;
|
|
419
|
+
--magic-drawer-leave-animation: slide-ltr-out 300ms ease;
|
|
420
|
+
--magic-drawer-align-items: center;
|
|
421
|
+
--magic-drawer-justify-content: flex-start;
|
|
422
|
+
--magic-drawer-drag-overshoot-x: calc(
|
|
423
|
+
var(--magic-drawer-drag-overshoot) * -1
|
|
424
|
+
);
|
|
425
|
+
--magic-drawer-padding: 0 0 0 var(--magic-drawer-drag-overshoot-x);
|
|
426
|
+
|
|
427
|
+
& > .magic-drawer__wrapper {
|
|
428
|
+
width: calc(
|
|
429
|
+
var(--magic-drawer-width, 0px) + var(--magic-drawer-drag-overshoot, 0px)
|
|
430
|
+
);
|
|
288
431
|
}
|
|
289
432
|
}
|
|
290
433
|
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
434
|
+
.magic-drawer__wrapper {
|
|
435
|
+
height: var(--magic-drawer-height);
|
|
436
|
+
width: var(--magic-drawer-width);
|
|
437
|
+
transform: translate(
|
|
438
|
+
var(--magic-drawer-drag-overshoot-x),
|
|
439
|
+
var(--magic-drawer-drag-overshoot-y)
|
|
440
|
+
);
|
|
441
|
+
pointer-events: none;
|
|
296
442
|
}
|
|
297
443
|
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
444
|
+
.magic-drawer__content {
|
|
445
|
+
width: 100%;
|
|
446
|
+
height: 100%;
|
|
447
|
+
max-height: 100%;
|
|
448
|
+
position: relative;
|
|
302
449
|
}
|
|
303
450
|
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
451
|
+
.magic-drawer__drag {
|
|
452
|
+
-webkit-overflow-scrolling: touch;
|
|
453
|
+
scroll-behavior: smooth;
|
|
454
|
+
touch-action: none;
|
|
455
|
+
width: 100%;
|
|
456
|
+
height: 100%;
|
|
457
|
+
display: flex;
|
|
458
|
+
position: relative;
|
|
459
|
+
pointer-events: auto;
|
|
460
|
+
align-items: var(--magic-drawer-align-items);
|
|
461
|
+
justify-content: var(--magic-drawer-justify-content);
|
|
462
|
+
overflow-x: var(--magic-drawer-content-overflow-x, hidden);
|
|
463
|
+
overflow-y: var(--magic-drawer-content-overflow-y, hidden);
|
|
464
|
+
cursor: grab;
|
|
308
465
|
}
|
|
309
466
|
|
|
310
|
-
|
|
311
|
-
|
|
467
|
+
/* Reset default dialog styles */
|
|
468
|
+
dialog.magic-drawer__drag {
|
|
469
|
+
margin: 0;
|
|
470
|
+
padding: 0;
|
|
471
|
+
border: 0;
|
|
472
|
+
background: transparent;
|
|
473
|
+
outline: 0;
|
|
474
|
+
}
|
|
312
475
|
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
476
|
+
dialog.magic-drawer__drag::backdrop {
|
|
477
|
+
background-color: transparent;
|
|
478
|
+
}
|
|
316
479
|
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
overshoot.value = convertToPixels(overshootVar) || 0
|
|
480
|
+
.magic-drawer[data-dragging='true'] .magic-drawer__drag {
|
|
481
|
+
cursor: grabbing;
|
|
482
|
+
user-select: none;
|
|
321
483
|
}
|
|
322
484
|
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
for (const key of mappedOptions.keyListener.close) {
|
|
326
|
-
onKeyStroke(key, (e) => {
|
|
327
|
-
close()
|
|
328
|
-
e.preventDefault()
|
|
329
|
-
})
|
|
330
|
-
}
|
|
485
|
+
.magic-drawer[data-wheeling='true'] .magic-drawer__drag {
|
|
486
|
+
cursor: auto;
|
|
331
487
|
}
|
|
332
488
|
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
} else {
|
|
337
|
-
onClose()
|
|
338
|
-
}
|
|
339
|
-
})
|
|
489
|
+
.magic-drawer[data-disabled='true'] .magic-drawer__drag {
|
|
490
|
+
cursor: auto;
|
|
491
|
+
}
|
|
340
492
|
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
})
|
|
493
|
+
.magic-drawer__drag > * {
|
|
494
|
+
padding: var(--magic-drawer-padding);
|
|
495
|
+
}
|
|
345
496
|
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
})
|
|
497
|
+
.magic-drawer__overlay {
|
|
498
|
+
position: absolute;
|
|
499
|
+
inset: 0;
|
|
500
|
+
z-index: 9999;
|
|
501
|
+
}
|
|
352
502
|
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
503
|
+
.magic-drawer__backdrop {
|
|
504
|
+
position: fixed;
|
|
505
|
+
top: 0;
|
|
506
|
+
left: 0;
|
|
507
|
+
right: 0;
|
|
508
|
+
bottom: 0;
|
|
509
|
+
width: 100%;
|
|
510
|
+
height: 100%;
|
|
511
|
+
pointer-events: auto;
|
|
512
|
+
background-color: var(--magic-drawer-backdrop-color, rgba(0, 0, 0, 0.5));
|
|
513
|
+
backdrop-filter: var(--magic-drawer-backdrop-filter, unset);
|
|
514
|
+
z-index: -1;
|
|
515
|
+
}
|
|
357
516
|
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
if (
|
|
362
|
-
typeof mappedOptions.scrollLock === 'object' &&
|
|
363
|
-
mappedOptions.scrollLock.padding
|
|
364
|
-
) {
|
|
365
|
-
removeScrollLockPadding()
|
|
366
|
-
}
|
|
367
|
-
}
|
|
517
|
+
.magic-drawer[data-disabled='true'] .magic-drawer__backdrop {
|
|
518
|
+
pointer-events: none;
|
|
519
|
+
}
|
|
368
520
|
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
521
|
+
/* Content */
|
|
522
|
+
.magic-drawer--content-enter-active {
|
|
523
|
+
animation: var(--magic-drawer-enter-animation);
|
|
524
|
+
}
|
|
372
525
|
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
526
|
+
.magic-drawer--content-leave-active {
|
|
527
|
+
animation: var(--magic-drawer-leave-animation);
|
|
528
|
+
}
|
|
376
529
|
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
530
|
+
/* Backdrop */
|
|
531
|
+
.magic-drawer--backdrop-enter-active {
|
|
532
|
+
animation: fade-in 300ms ease;
|
|
533
|
+
}
|
|
380
534
|
|
|
381
|
-
|
|
382
|
-
|
|
535
|
+
.magic-drawer--backdrop-leave-active {
|
|
536
|
+
animation: fade-out 300ms ease;
|
|
537
|
+
}
|
|
383
538
|
</style>
|