@maas/vue-equipment 1.0.0-beta.3 → 1.0.0-beta.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/composables/index.d.ts +5 -5
- package/dist/composables/index.js +23 -13
- package/dist/composables/index.js.map +1 -1
- package/dist/nuxt/module.d.mts +2 -1
- package/dist/nuxt/module.json +2 -2
- package/dist/nuxt/module.mjs +32 -25
- package/dist/nuxt/types.d.mts +3 -1
- package/dist/plugins/.turbo/turbo-lint.log +1 -9
- package/dist/plugins/MagicAccordion/nuxt.d.ts +1 -1
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionContent.vue +61 -84
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionContent.vue.d.ts +10 -24
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionProvider.vue +17 -31
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionProvider.vue.d.ts +6 -20
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue +57 -62
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue.d.ts +9 -24
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue +34 -45
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue.d.ts +8 -22
- package/dist/plugins/MagicAccordion/src/composables/private/useAccordionTrigger.d.ts +2 -2
- package/dist/plugins/MagicAccordion/src/composables/private/useAccordionTrigger.mjs +4 -3
- package/dist/plugins/MagicAccordion/src/composables/private/useAccordionView.mjs +1 -0
- package/dist/plugins/MagicAccordion/src/composables/useMagicAccordion.mjs +1 -0
- package/dist/plugins/MagicAccordion/src/symbols/index.d.ts +2 -2
- package/dist/plugins/MagicAccordion/src/types/index.d.ts +2 -2
- package/dist/plugins/MagicCommand/nuxt.d.ts +1 -1
- package/dist/plugins/MagicCommand/src/components/MagicCommandContent.vue +148 -154
- package/dist/plugins/MagicCommand/src/components/MagicCommandContent.vue.d.ts +7 -14
- package/dist/plugins/MagicCommand/src/components/MagicCommandDrawer.vue +42 -52
- package/dist/plugins/MagicCommand/src/components/MagicCommandDrawer.vue.d.ts +6 -20
- package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue +72 -87
- package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue.d.ts +13 -25
- package/dist/plugins/MagicCommand/src/components/MagicCommandModal.vue +37 -47
- package/dist/plugins/MagicCommand/src/components/MagicCommandModal.vue.d.ts +6 -20
- package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue +61 -77
- package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue.d.ts +6 -22
- package/dist/plugins/MagicCommand/src/components/MagicCommandRenderer.vue +23 -39
- package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.vue +80 -86
- package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.vue.d.ts +9 -25
- package/dist/plugins/MagicCommand/src/components/MagicCommandView.vue +36 -48
- package/dist/plugins/MagicCommand/src/components/MagicCommandView.vue.d.ts +8 -22
- package/dist/plugins/MagicCommand/src/composables/private/useCommandScroll.d.ts +2 -2
- package/dist/plugins/MagicCommand/src/composables/private/useCommandState.mjs +1 -1
- package/dist/plugins/MagicCommand/src/composables/private/useCommandTrigger.d.ts +2 -2
- package/dist/plugins/MagicCommand/src/composables/private/useCommandTrigger.mjs +3 -2
- package/dist/plugins/MagicCommand/src/symbols/index.d.ts +4 -4
- package/dist/plugins/MagicCommand/src/types/index.d.ts +3 -3
- package/dist/plugins/MagicCookie/nuxt.d.ts +1 -1
- package/dist/plugins/MagicCookie/src/components/MagicCookieItem.vue +34 -41
- package/dist/plugins/MagicCookie/src/components/MagicCookieItem.vue.d.ts +8 -22
- package/dist/plugins/MagicCookie/src/components/MagicCookieProvider.vue +19 -36
- package/dist/plugins/MagicCookie/src/components/MagicCookieProvider.vue.d.ts +6 -20
- package/dist/plugins/MagicCookie/src/components/MagicCookieView.vue +42 -74
- package/dist/plugins/MagicCookie/src/components/MagicCookieView.vue.d.ts +9 -14
- package/dist/plugins/MagicCookie/src/composables/private/useCookieItem.mjs +3 -2
- package/dist/plugins/MagicCookie/src/composables/useMagicCookie.d.ts +2 -1
- package/dist/plugins/MagicCookie/src/composables/useMagicCookie.mjs +9 -5
- package/dist/plugins/MagicCookie/src/symbols/index.d.ts +2 -2
- package/dist/plugins/MagicCookie/src/types/index.d.ts +3 -2
- package/dist/plugins/MagicDraggable/nuxt.d.ts +1 -1
- package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue +82 -100
- package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue.d.ts +6 -24
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableDrag.d.ts +2 -2
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableDrag.mjs +43 -63
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableScrollLock.mjs +34 -14
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableSnap.d.ts +2 -15
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableSnap.mjs +103 -53
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableState.mjs +6 -5
- package/dist/plugins/MagicDraggable/src/types/index.d.ts +4 -3
- package/dist/plugins/MagicDraggable/src/utils/defaultOptions.mjs +1 -1
- package/dist/plugins/MagicDrawer/nuxt.d.ts +1 -1
- package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue +284 -323
- package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue.d.ts +18 -35
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDOM.mjs +34 -14
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDrag.d.ts +2 -2
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDrag.mjs +3 -3
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerGuards.d.ts +1 -1
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerGuards.mjs +28 -10
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerProgress.d.ts +2 -2
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerSnap.d.ts +3 -3
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerSnap.mjs +16 -14
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerWheel.d.ts +1 -1
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerWheel.mjs +1 -1
- package/dist/plugins/MagicDrawer/src/composables/useMagicDrawer.mjs +1 -1
- package/dist/plugins/MagicDrawer/src/types/index.mjs +1 -0
- package/dist/plugins/MagicDrawer/src/utils/defaultOptions.mjs +2 -2
- package/dist/plugins/MagicEmitter/nuxt.d.ts +1 -1
- package/dist/plugins/MagicEmitter/src/composables/useMagicEmitter.d.ts +202 -100
- package/dist/plugins/MagicEmitter/src/types/index.d.ts +2 -0
- package/dist/plugins/MagicMarquee/nuxt.d.ts +1 -1
- package/dist/plugins/MagicMarquee/src/components/MagicMarquee.vue +38 -72
- package/dist/plugins/MagicMarquee/src/components/MagicMarquee.vue.d.ts +8 -24
- package/dist/plugins/MagicMarquee/src/composables/private/useMarqueeApi.d.ts +1 -1
- package/dist/plugins/MagicMarquee/src/composables/private/useMarqueeApi.mjs +8 -2
- package/dist/plugins/MagicMarquee/src/composables/useMagicMarquee.d.ts +1 -1
- package/dist/plugins/MagicMenu/nuxt.d.ts +1 -1
- package/dist/plugins/MagicMenu/src/components/MagicMenuChannel.vue +51 -63
- package/dist/plugins/MagicMenu/src/components/MagicMenuChannel.vue.d.ts +6 -20
- package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue +180 -216
- package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue.d.ts +10 -25
- package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue +171 -198
- package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue.d.ts +8 -24
- package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue +87 -113
- package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue.d.ts +13 -25
- package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.vue +82 -81
- package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.vue.d.ts +6 -22
- package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.vue +63 -86
- package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.vue.d.ts +9 -23
- package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue +94 -97
- package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue.d.ts +11 -25
- package/dist/plugins/MagicMenu/src/components/MagicMenuView.vue +49 -61
- package/dist/plugins/MagicMenu/src/components/MagicMenuView.vue.d.ts +8 -22
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCallback.mjs +1 -1
- package/dist/plugins/MagicMenu/src/composables/private/useMenuChannel.mjs +15 -5
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCursor.d.ts +3 -3
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCursor.mjs +4 -4
- package/dist/plugins/MagicMenu/src/composables/private/useMenuDOM.mjs +35 -15
- package/dist/plugins/MagicMenu/src/composables/private/useMenuKeyListener.d.ts +1 -1
- package/dist/plugins/MagicMenu/src/composables/private/useMenuKeyListener.mjs +8 -4
- package/dist/plugins/MagicMenu/src/composables/private/useMenuTrigger.d.ts +2 -2
- package/dist/plugins/MagicMenu/src/composables/private/useMenuTrigger.mjs +4 -2
- package/dist/plugins/MagicMenu/src/composables/private/useMenuView.mjs +18 -6
- package/dist/plugins/MagicMenu/src/composables/useMagicMenu.mjs +1 -0
- package/dist/plugins/MagicMenu/src/symbols/index.d.ts +4 -4
- package/dist/plugins/MagicMenu/src/types/index.d.ts +2 -2
- package/dist/plugins/MagicMenu/src/utils/modeDelayDefaults.d.ts +2 -2
- package/dist/plugins/MagicMenu/src/utils/modeDelayDefaults.mjs +2 -2
- package/dist/plugins/MagicModal/nuxt.d.ts +1 -1
- package/dist/plugins/MagicModal/src/components/MagicModal.vue +134 -171
- package/dist/plugins/MagicModal/src/components/MagicModal.vue.d.ts +10 -25
- package/dist/plugins/MagicModal/src/composables/private/useModalDOM.mjs +34 -14
- package/dist/plugins/MagicModal/src/types/index.d.ts +2 -2
- package/dist/plugins/MagicModal/src/types/index.mjs +1 -0
- package/dist/plugins/MagicNoise/nuxt.d.ts +1 -1
- package/dist/plugins/MagicNoise/src/components/MagicNoise.vue +50 -81
- package/dist/plugins/MagicNoise/src/components/MagicNoise.vue.d.ts +1 -10
- package/dist/plugins/MagicNoise/src/composables/private/useNoiseApi.d.ts +3 -3
- package/dist/plugins/MagicNoise/src/composables/private/useNoiseApi.mjs +10 -6
- package/dist/plugins/MagicNoise/src/types/index.d.ts +2 -0
- package/dist/plugins/MagicNoise/src/utils/defaultOptions.mjs +3 -1
- package/dist/plugins/MagicPie/index.d.ts +7 -0
- package/dist/plugins/MagicPie/index.mjs +8 -0
- package/dist/plugins/MagicPie/nuxt.d.ts +2 -0
- package/dist/plugins/MagicPie/nuxt.mjs +23 -0
- package/dist/plugins/MagicPie/src/components/MagicPie.vue +168 -0
- package/dist/plugins/MagicPie/src/components/MagicPie.vue.d.ts +7 -0
- package/dist/plugins/MagicPie/src/composables/private/usePieState.d.ts +6 -0
- package/dist/plugins/MagicPie/src/composables/private/usePieState.mjs +33 -0
- package/dist/plugins/MagicPie/src/composables/useMagicPie.d.ts +13 -0
- package/dist/plugins/MagicPie/src/composables/useMagicPie.mjs +43 -0
- package/dist/plugins/MagicPie/src/types/index.d.ts +9 -0
- package/dist/plugins/MagicPie/src/types/index.mjs +0 -0
- package/dist/plugins/MagicPlayer/nuxt.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudio.vue +93 -65
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue +123 -127
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue.d.ts +9 -25
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerDisplayTime.vue +32 -42
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerDisplayTime.vue.d.ts +1 -10
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.vue +117 -103
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.vue.d.ts +1 -10
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerOverlay.vue +134 -82
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerOverlay.vue.d.ts +17 -13
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerPoster.vue +20 -36
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerPoster.vue.d.ts +5 -10
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerProvider.vue +66 -56
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerProvider.vue.d.ts +6 -22
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerTimeline.vue +60 -109
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideo.vue +118 -68
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideoControls.vue +179 -210
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideoControls.vue.d.ts +24 -34
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerAudioApi.d.ts +0 -4
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerAudioApi.mjs +9 -52
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerControlsApi.d.ts +8 -34
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerControlsApi.mjs +170 -234
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerEmitter.d.ts +8 -0
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerEmitter.mjs +103 -0
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerMediaApi.d.ts +3 -17
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerMediaApi.mjs +59 -176
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerProvider.d.ts +6 -0
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerProvider.mjs +34 -0
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerRuntime.d.ts +3 -4
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerRuntime.mjs +19 -35
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerState.d.ts +7 -0
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerState.mjs +60 -0
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerVideoApi.d.ts +4 -8
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerVideoApi.mjs +43 -91
- package/dist/plugins/MagicPlayer/src/composables/useMagicPlayer.d.ts +37 -52
- package/dist/plugins/MagicPlayer/src/composables/useMagicPlayer.mjs +53 -3
- package/dist/plugins/MagicPlayer/src/css/magic-player-audio-controls.css +0 -1
- package/dist/plugins/MagicPlayer/src/css/magic-player-timeline.css +5 -0
- package/dist/plugins/MagicPlayer/src/symbols/index.d.ts +6 -2
- package/dist/plugins/MagicPlayer/src/symbols/index.mjs +12 -1
- package/dist/plugins/MagicPlayer/src/types/index.d.ts +75 -10
- package/dist/plugins/MagicPlayer/src/utils/defaultOptions.d.ts +2 -2
- package/dist/plugins/MagicPlayer/src/utils/defaultOptions.mjs +6 -1
- package/dist/plugins/MagicPlayer/src/utils/playbackDefaults.d.ts +3 -0
- package/dist/plugins/MagicPlayer/src/utils/playbackDefaults.mjs +7 -0
- package/dist/plugins/MagicScroll/nuxt.d.ts +1 -1
- package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.vue +54 -61
- package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.vue.d.ts +6 -22
- package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue +56 -71
- package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue.d.ts +6 -22
- package/dist/plugins/MagicScroll/src/components/MagicScrollProvider.vue +26 -33
- package/dist/plugins/MagicScroll/src/components/MagicScrollProvider.vue.d.ts +24 -21
- package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue +63 -71
- package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue.d.ts +8 -24
- package/dist/plugins/MagicScroll/src/composables/private/useCollisionDetection.d.ts +2 -2
- package/dist/plugins/MagicScroll/src/composables/private/useCollisionDetection.mjs +16 -6
- package/dist/plugins/MagicScroll/src/composables/private/useScrollApi.d.ts +2 -2
- package/dist/plugins/MagicScroll/src/composables/private/useScrollApi.mjs +41 -26
- package/dist/plugins/MagicScroll/src/symbols/index.d.ts +1 -1
- package/dist/plugins/MagicToast/nuxt.d.ts +1 -1
- package/dist/plugins/MagicToast/src/components/MagicToastProvider.vue +90 -109
- package/dist/plugins/MagicToast/src/components/MagicToastProvider.vue.d.ts +7 -16
- package/dist/plugins/MagicToast/src/components/MagicToastView.vue +53 -81
- package/dist/plugins/MagicToast/src/components/MagicToastView.vue.d.ts +6 -23
- package/dist/plugins/MagicToast/src/composables/private/useToastCallback.d.ts +2 -2
- package/dist/plugins/MagicToast/src/composables/private/useToastCallback.mjs +5 -5
- package/dist/plugins/MagicToast/src/composables/private/useToastDrag.mjs +23 -23
- package/dist/plugins/MagicToast/src/composables/private/useToastListener.mjs +1 -0
- package/dist/plugins/MagicToast/src/composables/private/useToastScrollLock.mjs +33 -15
- package/dist/plugins/MagicToast/src/composables/private/useToastView.mjs +1 -0
- package/dist/plugins/MagicToast/src/composables/useMagicToast.d.ts +1 -0
- package/dist/plugins/MagicToast/src/composables/useMagicToast.mjs +10 -2
- package/dist/plugins/MagicToast/src/types/index.d.ts +3 -3
- package/dist/plugins/MagicToast/src/utils/defaultOptions.mjs +1 -1
- package/dist/plugins/index.d.ts +1 -0
- package/dist/plugins/index.mjs +1 -0
- package/dist/utils/css/animations/fade-down.css +9 -0
- package/dist/utils/css/animations.css +9 -22
- package/dist/utils/css/easings.css +9 -1
- package/dist/utils/css/keyframes.css +22 -0
- package/dist/utils/index.d.ts +9 -4
- package/dist/utils/index.js +39 -3
- package/dist/utils/index.js.map +1 -1
- package/package.json +13 -9
- package/dist/nuxt/module.cjs +0 -5
- package/dist/nuxt/module.d.ts +0 -9
- package/dist/nuxt/types.d.ts +0 -1
- package/dist/plugins/MagicAccordion/demo/data/footer.json +0 -117
- package/dist/plugins/MagicCommand/demo/data/about.json +0 -3
- package/dist/plugins/MagicCommand/demo/data/search.json +0 -594
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerStateEmitter.d.ts +0 -15
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerStateEmitter.mjs +0 -9
- package/dist/utils/css/transitions.css +0 -8
- /package/dist/utils/css/{transitions → animations}/clip.css +0 -0
- /package/dist/utils/css/{transitions → animations}/fade-up.css +0 -0
- /package/dist/utils/css/{transitions → animations}/fade.css +0 -0
- /package/dist/utils/css/{transitions → animations}/slide-btt.css +0 -0
- /package/dist/utils/css/{transitions → animations}/slide-ltr.css +0 -0
- /package/dist/utils/css/{transitions → animations}/slide-rtl.css +0 -0
- /package/dist/utils/css/{transitions → animations}/slide-ttb.css +0 -0
- /package/dist/utils/css/{transitions → animations}/zoom.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/auto-size-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/clip-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/clip-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/fade-down-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/fade-down-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/fade-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/fade-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/fade-up-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/fade-up-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/flip-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/flip-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/slide-btt-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/slide-btt-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/slide-ltr-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/slide-ltr-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/slide-rtl-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/slide-rtl-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/slide-ttb-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/slide-ttb-out.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/squash-y.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/zoom-in.css +0 -0
- /package/dist/utils/css/{animations → keyframes}/zoom-out.css +0 -0
|
@@ -1,14 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import {
|
|
2
|
+
shallowRef,
|
|
3
|
+
inject,
|
|
4
|
+
toValue
|
|
5
|
+
} from "vue";
|
|
6
|
+
import { useElementBounding, useWindowSize } from "@vueuse/core";
|
|
4
7
|
import { clampValue } from "@maas/vue-equipment/utils";
|
|
5
|
-
|
|
6
|
-
|
|
8
|
+
import { MagicScrollReturn } from "../../symbols/index.mjs";
|
|
9
|
+
export function useScrollApi(args) {
|
|
10
|
+
const { child, parent, from, to } = args;
|
|
7
11
|
const scrollReturn = inject(MagicScrollReturn, void 0);
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
+
const start = shallowRef(0);
|
|
13
|
+
const end = shallowRef(0);
|
|
14
|
+
const { width, height } = useWindowSize();
|
|
15
|
+
const windowBoundingRect = {
|
|
16
|
+
width,
|
|
17
|
+
height,
|
|
18
|
+
right: width,
|
|
19
|
+
bottom: height,
|
|
20
|
+
top: shallowRef(0),
|
|
21
|
+
left: shallowRef(0)
|
|
22
|
+
};
|
|
23
|
+
const childBoundingRect = useElementBounding(child);
|
|
24
|
+
const parentBoundingRect = useElementBounding(parent);
|
|
25
|
+
const mappedParentBoundingRect = toValue(parent) ? parentBoundingRect : windowBoundingRect;
|
|
12
26
|
function splitLocation(location) {
|
|
13
27
|
return {
|
|
14
28
|
child: location.match(/^[a-z]+/)[0],
|
|
@@ -17,51 +31,52 @@ export function useScrollApi(params) {
|
|
|
17
31
|
}
|
|
18
32
|
function getOffsetTop(points) {
|
|
19
33
|
let y = 0;
|
|
20
|
-
if (!childRect.value) return y;
|
|
21
34
|
const scrollY = toValue(scrollReturn?.y) || 0;
|
|
35
|
+
const parentTop = mappedParentBoundingRect.top.value;
|
|
36
|
+
const parentHeight = mappedParentBoundingRect.height.value;
|
|
37
|
+
const childTop = childBoundingRect.top.value;
|
|
38
|
+
const childHeight = childBoundingRect.height.value;
|
|
39
|
+
if (!childHeight) {
|
|
40
|
+
return y;
|
|
41
|
+
}
|
|
22
42
|
switch (points.child) {
|
|
23
43
|
case "top":
|
|
24
|
-
y +=
|
|
44
|
+
y += childTop + scrollY;
|
|
25
45
|
break;
|
|
26
46
|
case "center":
|
|
27
|
-
y +=
|
|
47
|
+
y += childTop + childHeight / 2 + scrollY;
|
|
28
48
|
break;
|
|
29
49
|
case "bottom":
|
|
30
|
-
y +=
|
|
50
|
+
y += childTop + childHeight + scrollY;
|
|
31
51
|
break;
|
|
32
52
|
}
|
|
33
|
-
if (!
|
|
53
|
+
if (!mappedParentBoundingRect.height.value) {
|
|
34
54
|
return y;
|
|
35
55
|
}
|
|
36
|
-
const dimensions = {
|
|
37
|
-
width: toValue(parentRect.value.width),
|
|
38
|
-
height: toValue(parentRect.value.height),
|
|
39
|
-
top: toValue(parentRect.value.top)
|
|
40
|
-
};
|
|
41
56
|
switch (points.parent) {
|
|
42
57
|
case "top":
|
|
43
|
-
y -=
|
|
58
|
+
y -= parentTop;
|
|
44
59
|
break;
|
|
45
60
|
case "center":
|
|
46
|
-
y -=
|
|
61
|
+
y -= parentTop + parentHeight / 2;
|
|
47
62
|
break;
|
|
48
63
|
case "bottom":
|
|
49
|
-
y -=
|
|
64
|
+
y -= parentTop + parentHeight;
|
|
50
65
|
break;
|
|
51
66
|
case "initial":
|
|
52
|
-
y -=
|
|
67
|
+
y -= childTop + scrollY;
|
|
53
68
|
break;
|
|
54
69
|
}
|
|
55
70
|
return y;
|
|
56
71
|
}
|
|
57
72
|
function getCalculations() {
|
|
58
|
-
|
|
59
|
-
|
|
73
|
+
childBoundingRect.update();
|
|
74
|
+
parentBoundingRect.update();
|
|
60
75
|
start.value = getOffsetTop(splitLocation(from));
|
|
61
76
|
end.value = getOffsetTop(splitLocation(to));
|
|
62
77
|
}
|
|
63
78
|
function getProgress() {
|
|
64
|
-
const scrollY = toValue(scrollReturn?.y)
|
|
79
|
+
const scrollY = toValue(scrollReturn?.y) ?? 0;
|
|
65
80
|
const total = Math.abs(end.value - start.value);
|
|
66
81
|
const current = scrollY - start.value;
|
|
67
82
|
return clampValue(current / total, 0, 1);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { InjectionKey, Ref, MaybeRef } from 'vue';
|
|
2
2
|
import type { UseScrollReturn } from '@vueuse/core';
|
|
3
|
-
declare const MagicScrollTarget: InjectionKey<MaybeRef<HTMLElement | undefined>>;
|
|
3
|
+
declare const MagicScrollTarget: InjectionKey<MaybeRef<HTMLElement | null | undefined>>;
|
|
4
4
|
declare const MagicScrollProgress: InjectionKey<Ref<number>>;
|
|
5
5
|
declare const MagicScrollReturn: InjectionKey<UseScrollReturn | undefined>;
|
|
6
6
|
export { MagicScrollTarget, MagicScrollProgress, MagicScrollReturn };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("
|
|
1
|
+
declare const _default: import("nuxt/schema").NuxtModule<import("nuxt/schema").ModuleOptions, import("nuxt/schema").ModuleOptions, false>;
|
|
2
2
|
export default _default;
|
|
@@ -1,10 +1,50 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<teleport
|
|
3
|
+
:to="state.options.teleport?.target"
|
|
4
|
+
:disabled="state.options.teleport?.disabled"
|
|
5
|
+
>
|
|
6
|
+
<div
|
|
7
|
+
:data-id="mappedId"
|
|
8
|
+
:data-position="state.options.position"
|
|
9
|
+
:data-expanded="state.expanded"
|
|
10
|
+
class="magic-toast-provider"
|
|
11
|
+
v-bind="$attrs"
|
|
12
|
+
>
|
|
13
|
+
<transition-group
|
|
14
|
+
ref="list"
|
|
15
|
+
tag="ol"
|
|
16
|
+
class="magic-toast-provider__list"
|
|
17
|
+
:name="state.options.transition"
|
|
18
|
+
@before-enter="onBeforeEnter"
|
|
19
|
+
@enter="onEnter"
|
|
20
|
+
@after-enter="onAfterEnter"
|
|
21
|
+
@before-leave="onBeforeLeave"
|
|
22
|
+
@leave="onLeave"
|
|
23
|
+
@after-leave="onAfterLeave"
|
|
24
|
+
@mouseenter="onMouseenter"
|
|
25
|
+
@mouseleave="onMouseleave"
|
|
26
|
+
>
|
|
27
|
+
<magic-toast-view
|
|
28
|
+
v-for="(view, index) in state.views"
|
|
29
|
+
:id="view.id"
|
|
30
|
+
:key="view.id"
|
|
31
|
+
:index="index"
|
|
32
|
+
>
|
|
33
|
+
<component
|
|
34
|
+
:is="view.component"
|
|
35
|
+
v-bind="view.props"
|
|
36
|
+
@remove="deleteView(view.id)"
|
|
37
|
+
/>
|
|
38
|
+
</magic-toast-view>
|
|
39
|
+
</transition-group>
|
|
40
|
+
</div>
|
|
41
|
+
</teleport>
|
|
42
|
+
</template>
|
|
43
|
+
|
|
44
|
+
<script setup>
|
|
5
45
|
import {
|
|
6
46
|
toValue,
|
|
7
|
-
|
|
47
|
+
useTemplateRef,
|
|
8
48
|
provide,
|
|
9
49
|
watch,
|
|
10
50
|
onBeforeUnmount
|
|
@@ -13,109 +53,50 @@ import { onClickOutside } from "@vueuse/core";
|
|
|
13
53
|
import { useToastState } from "../composables/private/useToastState";
|
|
14
54
|
import { useToastView } from "../composables/private/useToastView";
|
|
15
55
|
import { useToastCallback } from "../composables/private/useToastCallback";
|
|
56
|
+
import { useToastListener } from "../composables/private/useToastListener";
|
|
16
57
|
import MagicToastView from "./MagicToastView.vue";
|
|
17
58
|
import { MagicToastInstanceId } from "../../symbols";
|
|
18
|
-
import "@maas/vue-equipment/utils/css/
|
|
19
|
-
import "@maas/vue-equipment/utils/css/
|
|
20
|
-
import "@maas/vue-equipment/utils/css/
|
|
21
|
-
import "@maas/vue-equipment/utils/css/
|
|
22
|
-
import "@maas/vue-equipment/utils/css/
|
|
23
|
-
import "@maas/vue-equipment/utils/css/
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
59
|
+
import "@maas/vue-equipment/utils/css/keyframes/fade-out.css";
|
|
60
|
+
import "@maas/vue-equipment/utils/css/keyframes/squash-y.css";
|
|
61
|
+
import "@maas/vue-equipment/utils/css/keyframes/slide-ltr-in.css";
|
|
62
|
+
import "@maas/vue-equipment/utils/css/keyframes/slide-ltr-out.css";
|
|
63
|
+
import "@maas/vue-equipment/utils/css/keyframes/slide-rtl-in.css";
|
|
64
|
+
import "@maas/vue-equipment/utils/css/keyframes/slide-rtl-out.css";
|
|
65
|
+
const { id, options } = defineProps({
|
|
66
|
+
id: { type: null, required: true },
|
|
67
|
+
options: { type: Object, required: false }
|
|
68
|
+
});
|
|
69
|
+
const mappedId = toValue(id);
|
|
70
|
+
defineOptions({
|
|
71
|
+
inheritAttrs: false
|
|
72
|
+
});
|
|
73
|
+
const { deleteView } = useToastView(id);
|
|
74
|
+
const { deleteState, initializeState } = useToastState(id);
|
|
75
|
+
const state = initializeState(options);
|
|
76
|
+
const listRef = useTemplateRef("list");
|
|
77
|
+
const {
|
|
78
|
+
onBeforeEnter,
|
|
79
|
+
onEnter,
|
|
80
|
+
onAfterEnter,
|
|
81
|
+
onBeforeLeave,
|
|
82
|
+
onLeave,
|
|
83
|
+
onAfterLeave
|
|
84
|
+
} = useToastCallback(id);
|
|
85
|
+
const { onMouseenter, onMouseleave, outsideClickCallback } = useToastListener(id);
|
|
86
|
+
onClickOutside(listRef, outsideClickCallback);
|
|
87
|
+
watch(
|
|
88
|
+
() => options,
|
|
89
|
+
(value) => {
|
|
90
|
+
initializeState(value);
|
|
33
91
|
},
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
const { deleteState, initializeState } = useToastState(__props.id);
|
|
37
|
-
const state = initializeState(__props.options);
|
|
38
|
-
const listRef = ref(void 0);
|
|
39
|
-
const {
|
|
40
|
-
onBeforeEnter,
|
|
41
|
-
onEnter,
|
|
42
|
-
onAfterEnter,
|
|
43
|
-
onBeforeLeave,
|
|
44
|
-
onLeave,
|
|
45
|
-
onAfterLeave
|
|
46
|
-
} = useToastCallback(__props.id);
|
|
47
|
-
const { onMouseenter, onMouseleave, outsideClickCallback } = useToastListener(__props.id);
|
|
48
|
-
onClickOutside(listRef, outsideClickCallback);
|
|
49
|
-
watch(
|
|
50
|
-
() => __props.options,
|
|
51
|
-
(value) => {
|
|
52
|
-
initializeState(value);
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
deep: true
|
|
56
|
-
}
|
|
57
|
-
);
|
|
58
|
-
onBeforeUnmount(() => {
|
|
59
|
-
deleteState();
|
|
60
|
-
});
|
|
61
|
-
provide(MagicToastInstanceId, __props.id);
|
|
62
|
-
return (_ctx, _cache) => {
|
|
63
|
-
return _openBlock(), _createBlock(_Teleport, {
|
|
64
|
-
to: _unref(state).options.teleport?.target,
|
|
65
|
-
disabled: _unref(state).options.teleport?.disabled
|
|
66
|
-
}, [
|
|
67
|
-
_createElementVNode("div", _mergeProps({
|
|
68
|
-
id: toValue(_ctx.id),
|
|
69
|
-
"data-position": _unref(state).options.position,
|
|
70
|
-
"data-expanded": _unref(state).expanded,
|
|
71
|
-
class: "magic-toast-provider"
|
|
72
|
-
}, _ctx.$attrs), [
|
|
73
|
-
_createVNode(_TransitionGroup, {
|
|
74
|
-
ref_key: "listRef",
|
|
75
|
-
ref: listRef,
|
|
76
|
-
tag: "ol",
|
|
77
|
-
class: "magic-toast-provider__list",
|
|
78
|
-
name: _unref(state).options.transition,
|
|
79
|
-
"on-before-enter": _unref(onBeforeEnter),
|
|
80
|
-
"on-enter": _unref(onEnter),
|
|
81
|
-
"on-after-enter": _unref(onAfterEnter),
|
|
82
|
-
"on-before-leave": _unref(onBeforeLeave),
|
|
83
|
-
"on-leave": _unref(onLeave),
|
|
84
|
-
"on-after-leave": _unref(onAfterLeave),
|
|
85
|
-
onMouseenter: _unref(onMouseenter),
|
|
86
|
-
onMouseleave: _unref(onMouseleave)
|
|
87
|
-
}, {
|
|
88
|
-
default: _withCtx(() => [
|
|
89
|
-
(_openBlock(true), _createElementBlock(
|
|
90
|
-
_Fragment,
|
|
91
|
-
null,
|
|
92
|
-
_renderList(_unref(state).views, (view, index) => {
|
|
93
|
-
return _openBlock(), _createBlock(MagicToastView, {
|
|
94
|
-
id: view.id,
|
|
95
|
-
key: view.id,
|
|
96
|
-
index
|
|
97
|
-
}, {
|
|
98
|
-
default: _withCtx(() => [
|
|
99
|
-
(_openBlock(), _createBlock(_resolveDynamicComponent(view.component), _mergeProps({ ref_for: true }, view.props, {
|
|
100
|
-
onRemove: ($event) => _unref(deleteView)(view.id)
|
|
101
|
-
}), null, 16, ["onRemove"]))
|
|
102
|
-
]),
|
|
103
|
-
_: 2
|
|
104
|
-
/* DYNAMIC */
|
|
105
|
-
}, 1032, ["id", "index"]);
|
|
106
|
-
}),
|
|
107
|
-
128
|
|
108
|
-
/* KEYED_FRAGMENT */
|
|
109
|
-
))
|
|
110
|
-
]),
|
|
111
|
-
_: 1
|
|
112
|
-
/* STABLE */
|
|
113
|
-
}, 8, ["name", "on-before-enter", "on-enter", "on-after-enter", "on-before-leave", "on-leave", "on-after-leave", "onMouseenter", "onMouseleave"])
|
|
114
|
-
], 16, _hoisted_1)
|
|
115
|
-
], 8, ["to", "disabled"]);
|
|
116
|
-
};
|
|
92
|
+
{
|
|
93
|
+
deep: true
|
|
117
94
|
}
|
|
95
|
+
);
|
|
96
|
+
onBeforeUnmount(() => {
|
|
97
|
+
deleteState();
|
|
118
98
|
});
|
|
99
|
+
provide(MagicToastInstanceId, id);
|
|
119
100
|
</script>
|
|
120
101
|
|
|
121
102
|
<style>
|
|
@@ -208,7 +189,7 @@ export default /* @__PURE__ */ _defineComponent({
|
|
|
208
189
|
}
|
|
209
190
|
|
|
210
191
|
.magic-toast-provider[data-position='top-left'],
|
|
211
|
-
.magic-toast-provider[data-position='top
|
|
192
|
+
.magic-toast-provider[data-position='top'],
|
|
212
193
|
.magic-toast-provider[data-position='top-right'] {
|
|
213
194
|
--mt-enter-animation: mt-slide-ttb-in var(--magic-toast-animation-duration)
|
|
214
195
|
var(--ease-in-out);
|
|
@@ -220,7 +201,7 @@ export default /* @__PURE__ */ _defineComponent({
|
|
|
220
201
|
}
|
|
221
202
|
|
|
222
203
|
.magic-toast-provider[data-position='bottom-left'],
|
|
223
|
-
.magic-toast-provider[data-position='bottom
|
|
204
|
+
.magic-toast-provider[data-position='bottom'],
|
|
224
205
|
.magic-toast-provider[data-position='bottom-right'] {
|
|
225
206
|
--mt-enter-animation: mt-slide-btt-in var(--magic-toast-animation-duration)
|
|
226
207
|
var(--ease-in-out);
|
|
@@ -240,7 +221,7 @@ export default /* @__PURE__ */ _defineComponent({
|
|
|
240
221
|
--mt-align-items: flex-end;
|
|
241
222
|
}
|
|
242
223
|
|
|
243
|
-
.magic-toast-provider[data-position='
|
|
224
|
+
.magic-toast-provider[data-position='left'] {
|
|
244
225
|
--mt-justify-content: center;
|
|
245
226
|
--mt-align-items: flex-start;
|
|
246
227
|
--mt-enter-animation: slide-ltr-in var(--magic-toast-animation-duration)
|
|
@@ -249,7 +230,7 @@ export default /* @__PURE__ */ _defineComponent({
|
|
|
249
230
|
var(--ease-in-out);
|
|
250
231
|
}
|
|
251
232
|
|
|
252
|
-
.magic-toast-provider[data-position='
|
|
233
|
+
.magic-toast-provider[data-position='right'] {
|
|
253
234
|
--mt-justify-content: center;
|
|
254
235
|
--mt-align-items: flex-end;
|
|
255
236
|
--mt-enter-animation: slide-rtl-in var(--magic-toast-animation-duration)
|
|
@@ -263,13 +244,13 @@ export default /* @__PURE__ */ _defineComponent({
|
|
|
263
244
|
position: absolute;
|
|
264
245
|
|
|
265
246
|
&[data-position='bottom-left'],
|
|
266
|
-
&[data-position='bottom
|
|
247
|
+
&[data-position='bottom'],
|
|
267
248
|
&[data-position='bottom-right'] {
|
|
268
249
|
bottom: calc(var(--mt-height) * var(--mt-index) * 1px);
|
|
269
250
|
}
|
|
270
251
|
|
|
271
252
|
&[data-position='top-left'],
|
|
272
|
-
&[data-position='top
|
|
253
|
+
&[data-position='top'],
|
|
273
254
|
&[data-position='top-right'] {
|
|
274
255
|
top: calc(var(--mt-height) * var(--mt-index) * 1px);
|
|
275
256
|
}
|
|
@@ -1,23 +1,14 @@
|
|
|
1
1
|
import { type MaybeRef } from 'vue';
|
|
2
2
|
import type { MagicToastOptions } from '../types/index.js';
|
|
3
|
-
import '@maas/vue-equipment/utils/css/
|
|
4
|
-
import '@maas/vue-equipment/utils/css/
|
|
5
|
-
import '@maas/vue-equipment/utils/css/
|
|
6
|
-
import '@maas/vue-equipment/utils/css/
|
|
7
|
-
import '@maas/vue-equipment/utils/css/
|
|
8
|
-
import '@maas/vue-equipment/utils/css/
|
|
3
|
+
import '@maas/vue-equipment/utils/css/keyframes/fade-out.css';
|
|
4
|
+
import '@maas/vue-equipment/utils/css/keyframes/squash-y.css';
|
|
5
|
+
import '@maas/vue-equipment/utils/css/keyframes/slide-ltr-in.css';
|
|
6
|
+
import '@maas/vue-equipment/utils/css/keyframes/slide-ltr-out.css';
|
|
7
|
+
import '@maas/vue-equipment/utils/css/keyframes/slide-rtl-in.css';
|
|
8
|
+
import '@maas/vue-equipment/utils/css/keyframes/slide-rtl-out.css';
|
|
9
9
|
interface MagicToastProps {
|
|
10
10
|
id: MaybeRef<string>;
|
|
11
11
|
options?: MagicToastOptions;
|
|
12
12
|
}
|
|
13
|
-
declare const _default: import("vue").DefineComponent<
|
|
13
|
+
declare const _default: import("vue").DefineComponent<MagicToastProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicToastProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
14
|
export default _default;
|
|
15
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
16
|
-
type __VLS_TypePropsToOption<T> = {
|
|
17
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
18
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
19
|
-
} : {
|
|
20
|
-
type: import('vue').PropType<T[K]>;
|
|
21
|
-
required: true;
|
|
22
|
-
};
|
|
23
|
-
};
|
|
@@ -1,83 +1,55 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<li
|
|
3
|
+
class="magic-toast-view"
|
|
4
|
+
:data-id="id"
|
|
5
|
+
:data-expanded="state.expanded"
|
|
6
|
+
:data-dragging="view.dragging"
|
|
7
|
+
:data-position="state.options.position"
|
|
8
|
+
:data-debug="state.options.debug"
|
|
9
|
+
:style="{
|
|
10
|
+
'--mt-index': reversedIndex,
|
|
11
|
+
'--mt-offset': offset,
|
|
12
|
+
'--mt-height': height
|
|
13
|
+
}"
|
|
14
|
+
>
|
|
15
|
+
<div
|
|
16
|
+
class="magic-toast-view__inner"
|
|
17
|
+
@pointerdown="onPointerdown"
|
|
18
|
+
@click="onClick"
|
|
19
|
+
>
|
|
20
|
+
<div :style="style" class="magic-toast-view__drag">
|
|
21
|
+
<slot />
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
</li>
|
|
25
|
+
</template>
|
|
26
|
+
|
|
27
|
+
<script setup>
|
|
28
|
+
import { computed, inject } from "vue";
|
|
6
29
|
import { MagicToastInstanceId } from "../../symbols";
|
|
7
30
|
import { useToastState } from "../composables/private/useToastState";
|
|
8
31
|
import { useToastDrag } from "../composables/private/useToastDrag";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
return `${mapped}px`;
|
|
31
|
-
});
|
|
32
|
-
const { style, onPointerdown, onClick } = useToastDrag({
|
|
33
|
-
view: view.value,
|
|
34
|
-
instanceId
|
|
35
|
-
});
|
|
36
|
-
return (_ctx, _cache) => {
|
|
37
|
-
return _openBlock(), _createElementBlock("li", {
|
|
38
|
-
id: _ctx.id,
|
|
39
|
-
ref_key: "elRef",
|
|
40
|
-
ref: elRef,
|
|
41
|
-
class: "magic-toast-view",
|
|
42
|
-
"data-expanded": _unref(state).expanded,
|
|
43
|
-
"data-dragging": view.value.dragging,
|
|
44
|
-
"data-position": _unref(state).options.position,
|
|
45
|
-
"data-debug": _unref(state).options.debug,
|
|
46
|
-
style: _normalizeStyle({
|
|
47
|
-
"--mt-index": reversedIndex.value,
|
|
48
|
-
"--mt-offset": offset.value,
|
|
49
|
-
"--mt-height": height.value
|
|
50
|
-
})
|
|
51
|
-
}, [
|
|
52
|
-
_createElementVNode(
|
|
53
|
-
"div",
|
|
54
|
-
{
|
|
55
|
-
class: "magic-toast-view__inner",
|
|
56
|
-
onPointerdown: _cache[0] || (_cache[0] = //@ts-ignore
|
|
57
|
-
(...args) => _unref(onPointerdown) && _unref(onPointerdown)(...args)),
|
|
58
|
-
onClick: _cache[1] || (_cache[1] = //@ts-ignore
|
|
59
|
-
(...args) => _unref(onClick) && _unref(onClick)(...args))
|
|
60
|
-
},
|
|
61
|
-
[
|
|
62
|
-
_createElementVNode(
|
|
63
|
-
"div",
|
|
64
|
-
{
|
|
65
|
-
style: _normalizeStyle(_unref(style)),
|
|
66
|
-
class: "magic-toast-view__drag"
|
|
67
|
-
},
|
|
68
|
-
[
|
|
69
|
-
_renderSlot(_ctx.$slots, "default")
|
|
70
|
-
],
|
|
71
|
-
4
|
|
72
|
-
/* STYLE */
|
|
73
|
-
)
|
|
74
|
-
],
|
|
75
|
-
32
|
|
76
|
-
/* NEED_HYDRATION */
|
|
77
|
-
)
|
|
78
|
-
], 12, _hoisted_1);
|
|
79
|
-
};
|
|
80
|
-
}
|
|
32
|
+
const { id, index } = defineProps({
|
|
33
|
+
id: { type: String, required: true },
|
|
34
|
+
index: { type: Number, required: true }
|
|
35
|
+
});
|
|
36
|
+
const instanceId = inject(MagicToastInstanceId, void 0);
|
|
37
|
+
if (!instanceId) {
|
|
38
|
+
throw new Error("MagicToastView must be used within a MagicToastProvider");
|
|
39
|
+
}
|
|
40
|
+
const { initializeState } = useToastState(instanceId);
|
|
41
|
+
const state = initializeState();
|
|
42
|
+
const count = computed(() => state.views.length);
|
|
43
|
+
const view = computed(() => state.views[index]);
|
|
44
|
+
const reversedIndex = computed(() => count.value - index - 1);
|
|
45
|
+
const height = computed(() => `${view.value.dimensions?.height}px`);
|
|
46
|
+
const offset = computed(() => {
|
|
47
|
+
const mapped = state.views.slice(0, reversedIndex.value).reduce((acc, view2) => acc + (view2.dimensions?.height ?? 0), 0);
|
|
48
|
+
return `${mapped}px`;
|
|
49
|
+
});
|
|
50
|
+
const { style, onPointerdown, onClick } = useToastDrag({
|
|
51
|
+
view: view.value,
|
|
52
|
+
instanceId
|
|
81
53
|
});
|
|
82
54
|
</script>
|
|
83
55
|
|
|
@@ -94,13 +66,13 @@ export default /* @__PURE__ */ _defineComponent({
|
|
|
94
66
|
user-select: none;
|
|
95
67
|
|
|
96
68
|
&[data-position='bottom-left'],
|
|
97
|
-
&[data-position='bottom
|
|
69
|
+
&[data-position='bottom'],
|
|
98
70
|
&[data-position='bottom-right'] {
|
|
99
71
|
padding-top: var(--magic-toast-gap);
|
|
100
72
|
}
|
|
101
73
|
|
|
102
74
|
&[data-position='top-left'],
|
|
103
|
-
&[data-position='top
|
|
75
|
+
&[data-position='top'],
|
|
104
76
|
&[data-position='top-right'] {
|
|
105
77
|
padding-bottom: var(--magic-toast-gap);
|
|
106
78
|
}
|
|
@@ -138,11 +110,11 @@ export default /* @__PURE__ */ _defineComponent({
|
|
|
138
110
|
cursor: var(--magic-toast-view-cursor-dragging, grabbing);
|
|
139
111
|
}
|
|
140
112
|
|
|
141
|
-
.magic-toast-view[data-position='
|
|
113
|
+
.magic-toast-view[data-position='left'] {
|
|
142
114
|
position: absolute;
|
|
143
115
|
}
|
|
144
116
|
|
|
145
|
-
.magic-toast-view[data-position='
|
|
117
|
+
.magic-toast-view[data-position='right'] {
|
|
146
118
|
position: absolute;
|
|
147
119
|
}
|
|
148
120
|
|
|
@@ -1,32 +1,15 @@
|
|
|
1
|
-
import '@maas/vue-equipment/utils/css/transitions/fade.css';
|
|
2
1
|
interface MagicToastViewProps {
|
|
3
2
|
id: string;
|
|
4
3
|
index: number;
|
|
5
4
|
}
|
|
6
|
-
declare
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
default?(_: {}): any;
|
|
10
|
-
};
|
|
11
|
-
refs: {
|
|
12
|
-
elRef: any;
|
|
13
|
-
};
|
|
14
|
-
rootEl: any;
|
|
5
|
+
declare var __VLS_1: {};
|
|
6
|
+
type __VLS_Slots = {} & {
|
|
7
|
+
default?: (props: typeof __VLS_1) => any;
|
|
15
8
|
};
|
|
16
|
-
|
|
17
|
-
declare const
|
|
18
|
-
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
9
|
+
declare const __VLS_component: import("vue").DefineComponent<MagicToastViewProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicToastViewProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
19
11
|
export default _default;
|
|
20
|
-
type
|
|
21
|
-
type __VLS_TypePropsToOption<T> = {
|
|
22
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
23
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
24
|
-
} : {
|
|
25
|
-
type: import('vue').PropType<T[K]>;
|
|
26
|
-
required: true;
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
12
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
30
13
|
new (): {
|
|
31
14
|
$slots: S;
|
|
32
15
|
};
|
|
@@ -2,8 +2,8 @@ import { type MaybeRef } from 'vue';
|
|
|
2
2
|
export declare function useToastCallback(instanceId: MaybeRef<string>): {
|
|
3
3
|
onBeforeEnter: () => void;
|
|
4
4
|
onEnter: () => void;
|
|
5
|
-
onAfterEnter: (el:
|
|
5
|
+
onAfterEnter: (el: HTMLElement) => void;
|
|
6
6
|
onBeforeLeave: () => void;
|
|
7
7
|
onLeave: () => void;
|
|
8
|
-
onAfterLeave: (el:
|
|
8
|
+
onAfterLeave: (el: HTMLElement) => void;
|
|
9
9
|
};
|
|
@@ -12,10 +12,13 @@ export function useToastCallback(instanceId) {
|
|
|
12
12
|
}
|
|
13
13
|
function onEnter() {
|
|
14
14
|
emitter.emit("enter", toValue(instanceId));
|
|
15
|
+
if (state.views.length && state.options.layout?.max && state.views.length > state.options.layout.max) {
|
|
16
|
+
deleteView(state.views[0].id);
|
|
17
|
+
}
|
|
15
18
|
}
|
|
16
19
|
function onAfterEnter(el) {
|
|
17
20
|
emitter.emit("afterEnter", toValue(instanceId));
|
|
18
|
-
const view = getView(el.id);
|
|
21
|
+
const view = getView(el.dataset.id ?? "");
|
|
19
22
|
if (view) {
|
|
20
23
|
const mappedEl = el;
|
|
21
24
|
const style = window.getComputedStyle(mappedEl);
|
|
@@ -28,9 +31,6 @@ export function useToastCallback(instanceId) {
|
|
|
28
31
|
};
|
|
29
32
|
view.dimensions = dimensions;
|
|
30
33
|
}
|
|
31
|
-
if (state.views.length && state.options.layout?.max && state.views.length > state.options.layout.max) {
|
|
32
|
-
deleteView(state.views[0].id);
|
|
33
|
-
}
|
|
34
34
|
}
|
|
35
35
|
function onBeforeLeave() {
|
|
36
36
|
emitter.emit("beforeLeave", toValue(instanceId));
|
|
@@ -39,7 +39,7 @@ export function useToastCallback(instanceId) {
|
|
|
39
39
|
emitter.emit("leave", toValue(instanceId));
|
|
40
40
|
}
|
|
41
41
|
function onAfterLeave(el) {
|
|
42
|
-
const view = getView(el.id);
|
|
42
|
+
const view = getView(el.dataset.id ?? "");
|
|
43
43
|
if (view) {
|
|
44
44
|
deleteView(view.id);
|
|
45
45
|
}
|