@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,12 +1,11 @@
|
|
|
1
|
-
import MagicCommandBody from "./src/components/MagicCommandBody.vue";
|
|
2
1
|
import MagicCommandDrawer from "./src/components/MagicCommandDrawer.vue";
|
|
3
|
-
import MagicCommandFooter from "./src/components/MagicCommandFooter.vue";
|
|
4
|
-
import MagicCommandGroup from "./src/components/MagicCommandGroup.vue";
|
|
5
|
-
import MagicCommandHead from "./src/components/MagicCommandHead.vue";
|
|
6
2
|
import MagicCommandItem from "./src/components/MagicCommandItem.vue";
|
|
7
3
|
import MagicCommandModal from "./src/components/MagicCommandModal.vue";
|
|
8
4
|
import MagicCommandProvider from "./src/components/MagicCommandProvider.vue";
|
|
9
5
|
import MagicCommandView from "./src/components/MagicCommandView.vue";
|
|
6
|
+
import MagicCommandRenderer from "./src/components/MagicCommandRenderer.vue";
|
|
7
|
+
import MagicCommandContent from "./src/components/MagicCommandContent.vue";
|
|
8
|
+
import MagicCommandTrigger from "./src/components/MagicCommandTrigger.vue";
|
|
10
9
|
import { useMagicCommand } from "./src/composables/useMagicCommand.mjs";
|
|
11
10
|
import {
|
|
12
11
|
MagicCommandInstanceId,
|
|
@@ -14,15 +13,14 @@ import {
|
|
|
14
13
|
} from "./src/symbols/index.mjs";
|
|
15
14
|
const MagicCommandPlugin = {
|
|
16
15
|
install: (app) => {
|
|
17
|
-
app.component("MagicCommandBody", MagicCommandBody);
|
|
18
|
-
app.component("MagicCommandDrawer", MagicCommandDrawer);
|
|
19
|
-
app.component("MagicCommandFooter", MagicCommandFooter);
|
|
20
|
-
app.component("MagicCommandGroup", MagicCommandGroup);
|
|
21
|
-
app.component("MagicCommandHead", MagicCommandHead);
|
|
22
|
-
app.component("MagicCommandItem", MagicCommandItem);
|
|
23
|
-
app.component("MagicCommandModal", MagicCommandModal);
|
|
24
16
|
app.component("MagicCommandProvider", MagicCommandProvider);
|
|
25
17
|
app.component("MagicCommandView", MagicCommandView);
|
|
18
|
+
app.component("MagicCommandRenderer", MagicCommandRenderer);
|
|
19
|
+
app.component("MagicCommandContent", MagicCommandContent);
|
|
20
|
+
app.component("MagicCommandTrigger", MagicCommandTrigger);
|
|
21
|
+
app.component("MagicCommandItem", MagicCommandItem);
|
|
22
|
+
app.component("MagicCommandDrawer", MagicCommandDrawer);
|
|
23
|
+
app.component("MagicCommandModal", MagicCommandModal);
|
|
26
24
|
}
|
|
27
25
|
};
|
|
28
26
|
export {
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { defineComponent as _defineComponent } from "vue";
|
|
3
|
+
import { unref as _unref, renderSlot as _renderSlot, vShow as _vShow, mergeProps as _mergeProps, openBlock as _openBlock, createElementBlock as _createElementBlock, withDirectives as _withDirectives, createCommentVNode as _createCommentVNode, Transition as _Transition, withCtx as _withCtx, createVNode as _createVNode, Teleport as _Teleport, createBlock as _createBlock } from "vue";
|
|
4
|
+
const _hoisted_1 = ["data-id", "data-idle"];
|
|
5
|
+
import { ref, inject, watch, nextTick, provide, computed } from "vue";
|
|
6
|
+
import { useMagicKeys } from "@vueuse/core";
|
|
7
|
+
import { useCommandItem } from "../composables/private/useCommandItem";
|
|
8
|
+
import { useCommandScroll } from "../composables/private/useCommandScroll";
|
|
9
|
+
import { useCommandCallback } from "../composables/private/useCommandCallback";
|
|
10
|
+
import {
|
|
11
|
+
MagicCommandInstanceId,
|
|
12
|
+
MagicCommandViewId,
|
|
13
|
+
MagicCommandContentId,
|
|
14
|
+
MagicCommandProviderOptions
|
|
15
|
+
} from "../symbols";
|
|
16
|
+
import { useCommandView } from "../composables/private/useCommandView";
|
|
17
|
+
import { useCommandState } from "../composables/private/useCommandState";
|
|
18
|
+
import "@maas/vue-equipment/utils/css/animations/fade-in.css";
|
|
19
|
+
import "@maas/vue-equipment/utils/css/animations/fade-out.css";
|
|
20
|
+
export default /* @__PURE__ */ _defineComponent({
|
|
21
|
+
...{
|
|
22
|
+
inheritAttrs: false
|
|
23
|
+
},
|
|
24
|
+
__name: "MagicCommandContent",
|
|
25
|
+
setup(__props) {
|
|
26
|
+
const instanceId = inject(MagicCommandInstanceId, void 0);
|
|
27
|
+
const viewId = inject(MagicCommandViewId, void 0);
|
|
28
|
+
const elRef = ref(void 0);
|
|
29
|
+
if (!instanceId) {
|
|
30
|
+
throw new Error(
|
|
31
|
+
"MagicCommandContent must be nested inside MagicCommandProvider"
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
if (!viewId) {
|
|
35
|
+
throw new Error("MagicCommandContent must be nested inside MagicCommandView");
|
|
36
|
+
}
|
|
37
|
+
const { getView } = useCommandView(instanceId);
|
|
38
|
+
const view = getView(viewId);
|
|
39
|
+
const { initializeState } = useCommandState(instanceId);
|
|
40
|
+
const state = initializeState();
|
|
41
|
+
const isActive = computed(() => view?.active && state.active && state.renderer);
|
|
42
|
+
const isIdle = computed(() => state.input.view !== viewId);
|
|
43
|
+
const options = inject(MagicCommandProviderOptions, void 0);
|
|
44
|
+
const { activeItem, selectNextItem, selectPrevItem } = useCommandItem({
|
|
45
|
+
instanceId,
|
|
46
|
+
viewId
|
|
47
|
+
});
|
|
48
|
+
const {
|
|
49
|
+
onBeforeEnter,
|
|
50
|
+
onEnter,
|
|
51
|
+
onAfterEnter,
|
|
52
|
+
onBeforeLeave,
|
|
53
|
+
onLeave,
|
|
54
|
+
onAfterLeave
|
|
55
|
+
} = useCommandCallback({
|
|
56
|
+
instanceId,
|
|
57
|
+
viewId
|
|
58
|
+
});
|
|
59
|
+
const {
|
|
60
|
+
findElement,
|
|
61
|
+
findScrollableAncestor,
|
|
62
|
+
isElementAbove,
|
|
63
|
+
isElementBelow,
|
|
64
|
+
scrollInFromBottom,
|
|
65
|
+
scrollInFromTop
|
|
66
|
+
} = useCommandScroll(elRef);
|
|
67
|
+
const keys = useMagicKeys();
|
|
68
|
+
const nextTimeout = ref(void 0);
|
|
69
|
+
const prevTimeout = ref(void 0);
|
|
70
|
+
const nextInterval = ref(void 0);
|
|
71
|
+
const prevInterval = ref(void 0);
|
|
72
|
+
if (options?.keyListener?.next) {
|
|
73
|
+
for (const key of options.keyListener.next) {
|
|
74
|
+
watch(keys[key], (value) => {
|
|
75
|
+
if (isIdle.value) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
if (value) {
|
|
79
|
+
state.input.type = "keyboard";
|
|
80
|
+
selectNextItem(options.loop);
|
|
81
|
+
nextTimeout.value = setTimeout(() => {
|
|
82
|
+
nextInterval.value = setInterval(() => {
|
|
83
|
+
selectNextItem(options.loop);
|
|
84
|
+
}, 100);
|
|
85
|
+
}, 500);
|
|
86
|
+
} else {
|
|
87
|
+
clearTimeout(nextTimeout.value);
|
|
88
|
+
clearInterval(nextInterval.value);
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
if (options?.keyListener?.prev) {
|
|
94
|
+
for (const key of options.keyListener.prev) {
|
|
95
|
+
watch(keys[key], (value) => {
|
|
96
|
+
if (isIdle.value) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
if (value) {
|
|
100
|
+
state.input.type = "keyboard";
|
|
101
|
+
selectPrevItem(options.loop);
|
|
102
|
+
prevTimeout.value = setTimeout(() => {
|
|
103
|
+
prevInterval.value = setInterval(() => {
|
|
104
|
+
selectPrevItem(options.loop);
|
|
105
|
+
}, 100);
|
|
106
|
+
}, 500);
|
|
107
|
+
} else {
|
|
108
|
+
clearTimeout(prevTimeout.value);
|
|
109
|
+
clearInterval(prevInterval.value);
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
watch(
|
|
115
|
+
activeItem,
|
|
116
|
+
async (value) => {
|
|
117
|
+
if (!value || isIdle.value || state.input.type !== "keyboard") {
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
nextTick(() => {
|
|
121
|
+
const element = findElement(value.id);
|
|
122
|
+
if (element) {
|
|
123
|
+
const ancestor = findScrollableAncestor(element);
|
|
124
|
+
switch (true) {
|
|
125
|
+
case isElementAbove({ element, ancestor }):
|
|
126
|
+
scrollInFromTop({ element, ancestor });
|
|
127
|
+
break;
|
|
128
|
+
case isElementBelow({ element, ancestor }):
|
|
129
|
+
scrollInFromBottom({ element, ancestor });
|
|
130
|
+
break;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
},
|
|
135
|
+
{ deep: true }
|
|
136
|
+
);
|
|
137
|
+
provide(MagicCommandContentId, `${viewId}-content`);
|
|
138
|
+
return (_ctx, _cache) => {
|
|
139
|
+
return _unref(state).renderer && _unref(state).active ? (_openBlock(), _createBlock(_Teleport, {
|
|
140
|
+
key: 0,
|
|
141
|
+
to: _unref(state).renderer
|
|
142
|
+
}, [
|
|
143
|
+
_createVNode(_Transition, {
|
|
144
|
+
name: _unref(state).options.transition?.content,
|
|
145
|
+
"on-before-enter": _unref(onBeforeEnter),
|
|
146
|
+
"on-enter": _unref(onEnter),
|
|
147
|
+
"on-after-enter": _unref(onAfterEnter),
|
|
148
|
+
"on-before-leave": _unref(onBeforeLeave),
|
|
149
|
+
"on-leave": _unref(onLeave),
|
|
150
|
+
"on-after-leave": _unref(onAfterLeave)
|
|
151
|
+
}, {
|
|
152
|
+
default: _withCtx(() => [
|
|
153
|
+
isActive.value ? _withDirectives((_openBlock(), _createElementBlock("div", _mergeProps({
|
|
154
|
+
ref_key: "elRef",
|
|
155
|
+
ref: elRef,
|
|
156
|
+
key: `${_unref(viewId)}-content`,
|
|
157
|
+
class: "magic-command-content",
|
|
158
|
+
"data-id": `${_unref(viewId)}-content`,
|
|
159
|
+
"data-idle": isIdle.value
|
|
160
|
+
}, _ctx.$attrs), [
|
|
161
|
+
_renderSlot(_ctx.$slots, "default")
|
|
162
|
+
], 16, _hoisted_1)), [
|
|
163
|
+
[_vShow, !isIdle.value]
|
|
164
|
+
]) : _createCommentVNode("v-if", true)
|
|
165
|
+
]),
|
|
166
|
+
_: 3
|
|
167
|
+
/* FORWARDED */
|
|
168
|
+
}, 8, ["name", "on-before-enter", "on-enter", "on-after-enter", "on-before-leave", "on-leave", "on-after-leave"])
|
|
169
|
+
], 8, ["to"])) : _createCommentVNode("v-if", true);
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
</script>
|
|
174
|
+
|
|
175
|
+
<style>
|
|
176
|
+
.magic-command-content {
|
|
177
|
+
position: absolute;
|
|
178
|
+
inset: 0;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.magic-command-content[data-idle='true'] {
|
|
182
|
+
pointer-events: none;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.magic-command-content-enter-active {
|
|
186
|
+
animation: fade-in 150ms ease;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.magic-command-content-leave-active {
|
|
190
|
+
animation: fade-out 150ms ease;
|
|
191
|
+
}
|
|
192
|
+
</style>
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import '@maas/vue-equipment/utils/css/animations/fade-in.css';
|
|
2
|
+
import '@maas/vue-equipment/utils/css/animations/fade-out.css';
|
|
1
3
|
declare function __VLS_template(): {
|
|
2
4
|
attrs: Partial<{}>;
|
|
3
5
|
slots: {
|
|
@@ -6,10 +8,10 @@ declare function __VLS_template(): {
|
|
|
6
8
|
refs: {
|
|
7
9
|
elRef: HTMLDivElement;
|
|
8
10
|
};
|
|
9
|
-
rootEl:
|
|
11
|
+
rootEl: any;
|
|
10
12
|
};
|
|
11
13
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
12
|
-
declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {},
|
|
14
|
+
declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
13
15
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
14
16
|
export default _default;
|
|
15
17
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
@@ -1,55 +1,62 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
1
|
+
<script>
|
|
2
|
+
import { defineComponent as _defineComponent } from "vue";
|
|
3
|
+
import { unref as _unref, renderSlot as _renderSlot, resolveComponent as _resolveComponent, mergeProps as _mergeProps, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock } from "vue";
|
|
4
|
+
import { inject, watch, onBeforeUnmount } from "vue";
|
|
5
|
+
import {
|
|
6
|
+
useMagicDrawer,
|
|
7
|
+
useMagicEmitter
|
|
8
|
+
} from "@maas/vue-equipment/plugins";
|
|
9
|
+
import { useMagicCommand } from "../composables/useMagicCommand";
|
|
10
|
+
import { MagicCommandInstanceId } from "../symbols";
|
|
11
|
+
export default /* @__PURE__ */ _defineComponent({
|
|
12
|
+
...{
|
|
13
|
+
inheritAttrs: false
|
|
14
|
+
},
|
|
15
|
+
__name: "MagicCommandDrawer",
|
|
16
|
+
props: {
|
|
17
|
+
options: { type: null, required: false }
|
|
18
|
+
},
|
|
19
|
+
setup(__props) {
|
|
20
|
+
const instanceId = inject(MagicCommandInstanceId, "");
|
|
21
|
+
const emitter = useMagicEmitter();
|
|
22
|
+
if (!instanceId) {
|
|
23
|
+
throw new Error(
|
|
24
|
+
"MagicCommandDrawer must be nested inside MagicCommandProvider"
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
function afterLeaveCallback(payload) {
|
|
28
|
+
if (typeof payload === "string" && payload === instanceId) {
|
|
29
|
+
close();
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
const { close, isActive } = useMagicCommand(instanceId);
|
|
33
|
+
const drawerApi = useMagicDrawer(instanceId);
|
|
34
|
+
watch(isActive, (value) => {
|
|
35
|
+
if (value) {
|
|
36
|
+
drawerApi.open();
|
|
37
|
+
} else {
|
|
38
|
+
drawerApi.close();
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
emitter.on("afterLeave", afterLeaveCallback);
|
|
42
|
+
onBeforeUnmount(() => {
|
|
43
|
+
emitter.off("afterLeave", afterLeaveCallback);
|
|
44
|
+
close();
|
|
45
|
+
});
|
|
46
|
+
return (_ctx, _cache) => {
|
|
47
|
+
const _component_magic_drawer = _resolveComponent("magic-drawer");
|
|
48
|
+
return _openBlock(), _createBlock(_component_magic_drawer, _mergeProps({
|
|
49
|
+
id: _unref(instanceId),
|
|
50
|
+
class: "magic-command-drawer",
|
|
51
|
+
options: _ctx.options
|
|
52
|
+
}, _ctx.$attrs), {
|
|
53
|
+
default: _withCtx(() => [
|
|
54
|
+
_renderSlot(_ctx.$slots, "default")
|
|
55
|
+
]),
|
|
56
|
+
_: 3
|
|
57
|
+
/* FORWARDED */
|
|
58
|
+
}, 16, ["id", "options"]);
|
|
59
|
+
};
|
|
46
60
|
}
|
|
47
|
-
})
|
|
48
|
-
|
|
49
|
-
emitter.on('afterLeave', afterLeaveCallback)
|
|
50
|
-
|
|
51
|
-
onBeforeUnmount(() => {
|
|
52
|
-
emitter.off('afterLeave', afterLeaveCallback)
|
|
53
|
-
close()
|
|
54
|
-
})
|
|
61
|
+
});
|
|
55
62
|
</script>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { MagicCommandDrawerOptions } from '../types';
|
|
2
|
-
interface
|
|
1
|
+
import type { MagicCommandDrawerOptions } from '../types/index.js';
|
|
2
|
+
interface MagicCommandDrawerProps {
|
|
3
3
|
options?: MagicCommandDrawerOptions;
|
|
4
4
|
}
|
|
5
5
|
declare function __VLS_template(): {
|
|
@@ -11,9 +11,18 @@ declare function __VLS_template(): {
|
|
|
11
11
|
rootEl: any;
|
|
12
12
|
};
|
|
13
13
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
14
|
-
declare const __VLS_component: import("vue").DefineComponent<
|
|
14
|
+
declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<MagicCommandDrawerProps>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<MagicCommandDrawerProps>>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
15
15
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
16
16
|
export default _default;
|
|
17
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
18
|
+
type __VLS_TypePropsToOption<T> = {
|
|
19
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
20
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
21
|
+
} : {
|
|
22
|
+
type: import('vue').PropType<T[K]>;
|
|
23
|
+
required: true;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
17
26
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
18
27
|
new (): {
|
|
19
28
|
$slots: S;
|
|
@@ -1,91 +1,120 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
</div>
|
|
10
|
-
</template>
|
|
11
|
-
|
|
12
|
-
<script lang="ts" setup>
|
|
1
|
+
<script>
|
|
2
|
+
import { defineComponent as _defineComponent } from "vue";
|
|
3
|
+
import { unref as _unref, renderSlot as _renderSlot, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode } from "vue";
|
|
4
|
+
const _hoisted_1 = ["data-id", "data-disabled", "data-active", "data-pointer-disabled"];
|
|
5
|
+
const _hoisted_2 = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "magic-command-item__pointer-guard"
|
|
8
|
+
};
|
|
13
9
|
import {
|
|
14
10
|
ref,
|
|
15
11
|
computed,
|
|
16
12
|
inject,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
onMounted,
|
|
20
|
-
onUnmounted,
|
|
13
|
+
provide,
|
|
14
|
+
onBeforeUnmount,
|
|
21
15
|
useId,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
return toValue(mappedId) === activeItem.value
|
|
51
|
-
})
|
|
52
|
-
|
|
53
|
-
function listenerCallback() {
|
|
54
|
-
selectItem(mappedId.value)
|
|
55
|
-
nextTick(() => {
|
|
56
|
-
if (props.callback) {
|
|
57
|
-
props.callback()
|
|
16
|
+
onMounted
|
|
17
|
+
} from "vue";
|
|
18
|
+
import { useCommandItem } from "../composables/private/useCommandItem";
|
|
19
|
+
import { useCommandState } from "../composables/private/useCommandState";
|
|
20
|
+
import {
|
|
21
|
+
MagicCommandInstanceId,
|
|
22
|
+
MagicCommandViewId,
|
|
23
|
+
MagicCommandContentId,
|
|
24
|
+
MagicCommandItemId,
|
|
25
|
+
MagicCommandItemActive,
|
|
26
|
+
MagicCommandItemDisabled
|
|
27
|
+
} from "../symbols";
|
|
28
|
+
export default /* @__PURE__ */ _defineComponent({
|
|
29
|
+
__name: "MagicCommandItem",
|
|
30
|
+
props: {
|
|
31
|
+
id: { type: String, required: false },
|
|
32
|
+
initial: { type: Boolean, required: false, default: false },
|
|
33
|
+
disabled: { type: Boolean, required: false, default: false }
|
|
34
|
+
},
|
|
35
|
+
emits: ["click"],
|
|
36
|
+
setup(__props, { emit: __emit }) {
|
|
37
|
+
const emit = __emit;
|
|
38
|
+
const instanceId = inject(MagicCommandInstanceId, void 0);
|
|
39
|
+
const viewId = inject(MagicCommandViewId, void 0);
|
|
40
|
+
const contentId = inject(MagicCommandContentId, void 0);
|
|
41
|
+
const elRef = ref(void 0);
|
|
42
|
+
if (!instanceId) {
|
|
43
|
+
throw new Error("MagicCommandItem must be nested inside MagicCommandProvider");
|
|
58
44
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
useEventListener(elRef, props.listener, listenerCallback)
|
|
63
|
-
|
|
64
|
-
if (props.keys.length) {
|
|
65
|
-
onKeyStroke(props.keys, () => (isActive.value ? listenerCallback() : null))
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
const { addItem, removeItem } = useCommandStore()
|
|
69
|
-
|
|
70
|
-
onMounted(() => {
|
|
71
|
-
if (toValue(commandId)) {
|
|
72
|
-
addItem(toValue(commandId), mappedId.value)
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
nextTick(() => {
|
|
76
|
-
if (props.default) {
|
|
77
|
-
selectItem(mappedId.value)
|
|
45
|
+
if (!viewId) {
|
|
46
|
+
throw new Error("MagicCommandItem must be nested inside MagicCommandView");
|
|
78
47
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
48
|
+
if (!contentId) {
|
|
49
|
+
throw new Error("MagicCommandItem must be nested inside MagicCommandContent");
|
|
50
|
+
}
|
|
51
|
+
const mappedId = computed(() => __props.id ?? `magic-command-item-${useId()}`);
|
|
52
|
+
const { initializeItem, deleteItem, selectItem } = useCommandItem({
|
|
53
|
+
instanceId,
|
|
54
|
+
viewId
|
|
55
|
+
});
|
|
56
|
+
const { initializeState } = useCommandState(instanceId);
|
|
57
|
+
const state = initializeState();
|
|
58
|
+
const item = initializeItem({
|
|
59
|
+
id: mappedId.value,
|
|
60
|
+
disabled: __props.disabled ?? false
|
|
61
|
+
});
|
|
62
|
+
const pointerDisabled = computed(() => state.input.type !== "pointer");
|
|
63
|
+
const mappedDisabled = computed(() => __props.disabled ?? item?.disabled);
|
|
64
|
+
const mappedActive = computed(() => item?.active);
|
|
65
|
+
function guardedSelect() {
|
|
66
|
+
if (state.input.type === "pointer" && !item.disabled && !item.active) {
|
|
67
|
+
selectItem(mappedId.value);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
function onClick(event) {
|
|
71
|
+
emit("click", event);
|
|
72
|
+
guardedSelect();
|
|
73
|
+
}
|
|
74
|
+
provide(MagicCommandItemId, mappedId.value);
|
|
75
|
+
provide(MagicCommandItemActive, mappedActive);
|
|
76
|
+
provide(MagicCommandItemDisabled, mappedDisabled);
|
|
77
|
+
onMounted(() => {
|
|
78
|
+
if (__props.initial) {
|
|
79
|
+
selectItem(mappedId.value);
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
onBeforeUnmount(() => {
|
|
83
|
+
deleteItem(mappedId.value);
|
|
84
|
+
});
|
|
85
|
+
return (_ctx, _cache) => {
|
|
86
|
+
return _openBlock(), _createElementBlock("div", {
|
|
87
|
+
ref_key: "elRef",
|
|
88
|
+
ref: elRef,
|
|
89
|
+
class: "magic-command-item",
|
|
90
|
+
"data-id": mappedId.value,
|
|
91
|
+
"data-disabled": _ctx.disabled,
|
|
92
|
+
"data-active": _unref(item).active,
|
|
93
|
+
"data-pointer-disabled": pointerDisabled.value,
|
|
94
|
+
onMouseenter: guardedSelect,
|
|
95
|
+
onMousemove: guardedSelect,
|
|
96
|
+
onTouchstartPassive: guardedSelect,
|
|
97
|
+
onClick
|
|
98
|
+
}, [
|
|
99
|
+
_renderSlot(_ctx.$slots, "default", {
|
|
100
|
+
itemActive: _unref(item).active,
|
|
101
|
+
itemDisabled: _ctx.disabled
|
|
102
|
+
}),
|
|
103
|
+
pointerDisabled.value ? (_openBlock(), _createElementBlock("div", _hoisted_2)) : _createCommentVNode("v-if", true)
|
|
104
|
+
], 40, _hoisted_1);
|
|
105
|
+
};
|
|
85
106
|
}
|
|
86
|
-
})
|
|
107
|
+
});
|
|
87
108
|
</script>
|
|
88
109
|
|
|
89
110
|
<style>
|
|
90
|
-
.magic-command-item{
|
|
111
|
+
.magic-command-item {
|
|
112
|
+
position: relative;
|
|
113
|
+
cursor: var(--magic-command-item-cursor, default);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.magic-command-item__pointer-guard {
|
|
117
|
+
position: absolute;
|
|
118
|
+
inset: 0;
|
|
119
|
+
}
|
|
91
120
|
</style>
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
interface MagicCommandItemProps {
|
|
2
2
|
id?: string;
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
listener?: ('click' | 'mouseenter' | 'touchstart')[];
|
|
6
|
-
keys?: string[];
|
|
3
|
+
initial?: boolean;
|
|
4
|
+
disabled?: boolean;
|
|
7
5
|
}
|
|
8
6
|
declare function __VLS_template(): {
|
|
9
7
|
attrs: Partial<{}>;
|
|
10
8
|
slots: {
|
|
11
9
|
default?(_: {
|
|
12
|
-
|
|
10
|
+
itemActive: boolean;
|
|
11
|
+
itemDisabled: boolean;
|
|
13
12
|
}): any;
|
|
14
13
|
};
|
|
15
14
|
refs: {
|
|
@@ -18,12 +17,22 @@ declare function __VLS_template(): {
|
|
|
18
17
|
rootEl: HTMLDivElement;
|
|
19
18
|
};
|
|
20
19
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
21
|
-
declare const __VLS_component: import("vue").DefineComponent<MagicCommandItemProps
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<MagicCommandItemProps>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
21
|
+
click: (event: MouseEvent) => void;
|
|
22
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<MagicCommandItemProps>>> & Readonly<{
|
|
23
|
+
onClick?: ((event: MouseEvent) => any) | undefined;
|
|
24
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
25
25
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
26
26
|
export default _default;
|
|
27
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
28
|
+
type __VLS_TypePropsToOption<T> = {
|
|
29
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
30
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
31
|
+
} : {
|
|
32
|
+
type: import('vue').PropType<T[K]>;
|
|
33
|
+
required: true;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
27
36
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
28
37
|
new (): {
|
|
29
38
|
$slots: S;
|