@maas/vue-equipment 1.0.0-beta.3 → 1.0.0-beta.30
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 +1 -1
- package/dist/plugins/MagicAccordion/src/composables/private/useAccordionTrigger.mjs +1 -0
- 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 +1 -1
- package/dist/plugins/MagicCommand/src/composables/private/useCommandTrigger.mjs +1 -0
- 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 +0 -1
- package/dist/plugins/MagicCookie/src/symbols/index.d.ts +2 -2
- package/dist/plugins/MagicCookie/src/types/index.d.ts +2 -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.mjs +6 -2
- package/dist/plugins/MagicMenu/src/composables/private/useMenuTrigger.d.ts +1 -1
- package/dist/plugins/MagicMenu/src/composables/private/useMenuTrigger.mjs +2 -0
- 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 +11 -7
- 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,8 +1,40 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<teleport v-if="state.renderer && state.active" :to="state.renderer">
|
|
3
|
+
<transition
|
|
4
|
+
:name="state.options.transition?.content"
|
|
5
|
+
:on-before-enter="onBeforeEnter"
|
|
6
|
+
:on-enter="onEnter"
|
|
7
|
+
:on-after-enter="onAfterEnter"
|
|
8
|
+
:on-before-leave="onBeforeLeave"
|
|
9
|
+
:on-leave="onLeave"
|
|
10
|
+
:on-after-leave="onAfterLeave"
|
|
11
|
+
>
|
|
12
|
+
<div
|
|
13
|
+
v-if="isActive"
|
|
14
|
+
v-show="!isIdle"
|
|
15
|
+
ref="el"
|
|
16
|
+
:key="`${viewId}-content`"
|
|
17
|
+
class="magic-command-content"
|
|
18
|
+
:data-id="`${viewId}-content`"
|
|
19
|
+
:data-idle="isIdle"
|
|
20
|
+
v-bind="$attrs"
|
|
21
|
+
>
|
|
22
|
+
<slot />
|
|
23
|
+
</div>
|
|
24
|
+
</transition>
|
|
25
|
+
</teleport>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<script setup>
|
|
29
|
+
import {
|
|
30
|
+
ref,
|
|
31
|
+
inject,
|
|
32
|
+
watch,
|
|
33
|
+
nextTick,
|
|
34
|
+
provide,
|
|
35
|
+
computed,
|
|
36
|
+
useTemplateRef
|
|
37
|
+
} from "vue";
|
|
6
38
|
import { useMagicKeys } from "@vueuse/core";
|
|
7
39
|
import { useCommandItem } from "../composables/private/useCommandItem";
|
|
8
40
|
import { useCommandScroll } from "../composables/private/useCommandScroll";
|
|
@@ -15,161 +47,123 @@ import {
|
|
|
15
47
|
} from "../symbols";
|
|
16
48
|
import { useCommandView } from "../composables/private/useCommandView";
|
|
17
49
|
import { useCommandState } from "../composables/private/useCommandState";
|
|
18
|
-
import "@maas/vue-equipment/utils/css/
|
|
19
|
-
import "@maas/vue-equipment/utils/css/
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
50
|
+
import "@maas/vue-equipment/utils/css/keyframes/fade-in.css";
|
|
51
|
+
import "@maas/vue-equipment/utils/css/keyframes/fade-out.css";
|
|
52
|
+
defineOptions({
|
|
53
|
+
inheritAttrs: false
|
|
54
|
+
});
|
|
55
|
+
const instanceId = inject(MagicCommandInstanceId, void 0);
|
|
56
|
+
const viewId = inject(MagicCommandViewId, void 0);
|
|
57
|
+
const elRef = useTemplateRef("el");
|
|
58
|
+
if (!instanceId) {
|
|
59
|
+
throw new Error(
|
|
60
|
+
"MagicCommandContent must be nested inside MagicCommandProvider"
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
if (!viewId) {
|
|
64
|
+
throw new Error("MagicCommandContent must be nested inside MagicCommandView");
|
|
65
|
+
}
|
|
66
|
+
const { getView } = useCommandView(instanceId);
|
|
67
|
+
const view = getView(viewId);
|
|
68
|
+
const { initializeState } = useCommandState(instanceId);
|
|
69
|
+
const state = initializeState();
|
|
70
|
+
const isActive = computed(() => view?.active && state.active && state.renderer);
|
|
71
|
+
const isIdle = computed(() => state.input.view !== viewId);
|
|
72
|
+
const options = inject(MagicCommandProviderOptions, void 0);
|
|
73
|
+
const { activeItem, selectNextItem, selectPrevItem } = useCommandItem({
|
|
74
|
+
instanceId,
|
|
75
|
+
viewId
|
|
76
|
+
});
|
|
77
|
+
const {
|
|
78
|
+
onBeforeEnter,
|
|
79
|
+
onEnter,
|
|
80
|
+
onAfterEnter,
|
|
81
|
+
onBeforeLeave,
|
|
82
|
+
onLeave,
|
|
83
|
+
onAfterLeave
|
|
84
|
+
} = useCommandCallback({
|
|
85
|
+
instanceId,
|
|
86
|
+
viewId
|
|
87
|
+
});
|
|
88
|
+
const {
|
|
89
|
+
findElement,
|
|
90
|
+
findScrollableAncestor,
|
|
91
|
+
isElementAbove,
|
|
92
|
+
isElementBelow,
|
|
93
|
+
scrollInFromBottom,
|
|
94
|
+
scrollInFromTop
|
|
95
|
+
} = useCommandScroll(elRef);
|
|
96
|
+
const keys = useMagicKeys();
|
|
97
|
+
const nextTimeout = ref(void 0);
|
|
98
|
+
const prevTimeout = ref(void 0);
|
|
99
|
+
const nextInterval = ref(void 0);
|
|
100
|
+
const prevInterval = ref(void 0);
|
|
101
|
+
if (options?.keyListener?.next) {
|
|
102
|
+
for (const key of options.keyListener.next) {
|
|
103
|
+
watch(keys[key], (value) => {
|
|
104
|
+
if (isIdle.value) {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
if (value) {
|
|
108
|
+
state.input.type = "keyboard";
|
|
109
|
+
selectNextItem(options.loop);
|
|
110
|
+
nextTimeout.value = setTimeout(() => {
|
|
111
|
+
nextInterval.value = setInterval(() => {
|
|
80
112
|
selectNextItem(options.loop);
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
} else {
|
|
87
|
-
clearTimeout(nextTimeout.value);
|
|
88
|
-
clearInterval(nextInterval.value);
|
|
89
|
-
}
|
|
90
|
-
});
|
|
113
|
+
}, 100);
|
|
114
|
+
}, 500);
|
|
115
|
+
} else {
|
|
116
|
+
clearTimeout(nextTimeout.value);
|
|
117
|
+
clearInterval(nextInterval.value);
|
|
91
118
|
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
if (options?.keyListener?.prev) {
|
|
123
|
+
for (const key of options.keyListener.prev) {
|
|
124
|
+
watch(keys[key], (value) => {
|
|
125
|
+
if (isIdle.value) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
if (value) {
|
|
129
|
+
state.input.type = "keyboard";
|
|
130
|
+
selectPrevItem(options.loop);
|
|
131
|
+
prevTimeout.value = setTimeout(() => {
|
|
132
|
+
prevInterval.value = setInterval(() => {
|
|
101
133
|
selectPrevItem(options.loop);
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
} else {
|
|
108
|
-
clearTimeout(prevTimeout.value);
|
|
109
|
-
clearInterval(prevInterval.value);
|
|
110
|
-
}
|
|
111
|
-
});
|
|
134
|
+
}, 100);
|
|
135
|
+
}, 500);
|
|
136
|
+
} else {
|
|
137
|
+
clearTimeout(prevTimeout.value);
|
|
138
|
+
clearInterval(prevInterval.value);
|
|
112
139
|
}
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
watch(
|
|
144
|
+
activeItem,
|
|
145
|
+
async (value) => {
|
|
146
|
+
if (!value || isIdle.value || state.input.type !== "keyboard") {
|
|
147
|
+
return;
|
|
113
148
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
149
|
+
nextTick(() => {
|
|
150
|
+
const element = findElement(value.id);
|
|
151
|
+
if (element) {
|
|
152
|
+
const ancestor = findScrollableAncestor(element);
|
|
153
|
+
switch (true) {
|
|
154
|
+
case isElementAbove({ element, ancestor }):
|
|
155
|
+
scrollInFromTop({ element, ancestor });
|
|
156
|
+
break;
|
|
157
|
+
case isElementBelow({ element, ancestor }):
|
|
158
|
+
scrollInFromBottom({ element, ancestor });
|
|
159
|
+
break;
|
|
119
160
|
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
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
|
-
});
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
},
|
|
164
|
+
{ deep: true }
|
|
165
|
+
);
|
|
166
|
+
provide(MagicCommandContentId, `${viewId}-content`);
|
|
173
167
|
</script>
|
|
174
168
|
|
|
175
169
|
<style>
|
|
@@ -1,20 +1,13 @@
|
|
|
1
|
-
import '@maas/vue-equipment/utils/css/
|
|
2
|
-
import '@maas/vue-equipment/utils/css/
|
|
3
|
-
declare
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
default?(_: {}): any;
|
|
7
|
-
};
|
|
8
|
-
refs: {
|
|
9
|
-
elRef: any;
|
|
10
|
-
};
|
|
11
|
-
rootEl: any;
|
|
1
|
+
import '@maas/vue-equipment/utils/css/keyframes/fade-in.css';
|
|
2
|
+
import '@maas/vue-equipment/utils/css/keyframes/fade-out.css';
|
|
3
|
+
declare var __VLS_9: {};
|
|
4
|
+
type __VLS_Slots = {} & {
|
|
5
|
+
default?: (props: typeof __VLS_9) => any;
|
|
12
6
|
};
|
|
13
|
-
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
14
7
|
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>;
|
|
15
|
-
declare const _default:
|
|
8
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
16
9
|
export default _default;
|
|
17
|
-
type
|
|
10
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
18
11
|
new (): {
|
|
19
12
|
$slots: S;
|
|
20
13
|
};
|
|
@@ -1,6 +1,15 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<magic-drawer
|
|
3
|
+
:id="instanceId"
|
|
4
|
+
class="magic-command-drawer"
|
|
5
|
+
:options="options"
|
|
6
|
+
v-bind="$attrs"
|
|
7
|
+
>
|
|
8
|
+
<slot />
|
|
9
|
+
</magic-drawer>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script setup>
|
|
4
13
|
import { inject, watch, onBeforeUnmount } from "vue";
|
|
5
14
|
import {
|
|
6
15
|
useMagicDrawer,
|
|
@@ -8,55 +17,36 @@ import {
|
|
|
8
17
|
} from "@maas/vue-equipment/plugins";
|
|
9
18
|
import { useMagicCommand } from "../composables/useMagicCommand";
|
|
10
19
|
import { MagicCommandInstanceId } from "../symbols";
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
};
|
|
20
|
+
defineOptions({
|
|
21
|
+
inheritAttrs: false
|
|
22
|
+
});
|
|
23
|
+
defineProps({
|
|
24
|
+
options: { type: null, required: false }
|
|
25
|
+
});
|
|
26
|
+
const instanceId = inject(MagicCommandInstanceId, "");
|
|
27
|
+
const emitter = useMagicEmitter();
|
|
28
|
+
if (!instanceId) {
|
|
29
|
+
throw new Error(
|
|
30
|
+
"MagicCommandDrawer must be nested inside MagicCommandProvider"
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
function afterLeaveCallback(payload) {
|
|
34
|
+
if (typeof payload === "string" && payload === instanceId) {
|
|
35
|
+
close();
|
|
60
36
|
}
|
|
37
|
+
}
|
|
38
|
+
const { close, isActive } = useMagicCommand(instanceId);
|
|
39
|
+
const drawerApi = useMagicDrawer(instanceId);
|
|
40
|
+
watch(isActive, (value) => {
|
|
41
|
+
if (value) {
|
|
42
|
+
drawerApi.open();
|
|
43
|
+
} else {
|
|
44
|
+
drawerApi.close();
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
emitter.on("afterLeave", afterLeaveCallback);
|
|
48
|
+
onBeforeUnmount(() => {
|
|
49
|
+
emitter.off("afterLeave", afterLeaveCallback);
|
|
50
|
+
close();
|
|
61
51
|
});
|
|
62
52
|
</script>
|
|
@@ -2,28 +2,14 @@ import type { MagicCommandDrawerOptions } from '../types/index.js';
|
|
|
2
2
|
interface MagicCommandDrawerProps {
|
|
3
3
|
options?: MagicCommandDrawerOptions;
|
|
4
4
|
}
|
|
5
|
-
declare
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
default?(_: {}): any;
|
|
9
|
-
};
|
|
10
|
-
refs: {};
|
|
11
|
-
rootEl: any;
|
|
5
|
+
declare var __VLS_6: {};
|
|
6
|
+
type __VLS_Slots = {} & {
|
|
7
|
+
default?: (props: typeof __VLS_6) => any;
|
|
12
8
|
};
|
|
13
|
-
|
|
14
|
-
declare const
|
|
15
|
-
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
9
|
+
declare const __VLS_component: import("vue").DefineComponent<MagicCommandDrawerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicCommandDrawerProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
16
11
|
export default _default;
|
|
17
|
-
type
|
|
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
|
-
};
|
|
26
|
-
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
12
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
27
13
|
new (): {
|
|
28
14
|
$slots: S;
|
|
29
15
|
};
|
|
@@ -1,13 +1,22 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="magic-command-item"
|
|
4
|
+
:data-id="mappedId"
|
|
5
|
+
:data-disabled="disabled"
|
|
6
|
+
:data-active="item.active"
|
|
7
|
+
:data-pointer-disabled="pointerDisabled"
|
|
8
|
+
@mouseenter="guardedSelect"
|
|
9
|
+
@mousemove="guardedSelect"
|
|
10
|
+
@touchstart.passive="guardedSelect"
|
|
11
|
+
@click="onClick"
|
|
12
|
+
>
|
|
13
|
+
<slot :item-active="item.active" :item-disabled="disabled" />
|
|
14
|
+
<div v-if="pointerDisabled" class="magic-command-item__pointer-guard" />
|
|
15
|
+
</div>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script setup>
|
|
9
19
|
import {
|
|
10
|
-
ref,
|
|
11
20
|
computed,
|
|
12
21
|
inject,
|
|
13
22
|
provide,
|
|
@@ -25,85 +34,61 @@ import {
|
|
|
25
34
|
MagicCommandItemActive,
|
|
26
35
|
MagicCommandItemDisabled
|
|
27
36
|
} from "../symbols";
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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
|
-
};
|
|
37
|
+
const {
|
|
38
|
+
id,
|
|
39
|
+
initial = false,
|
|
40
|
+
disabled = false
|
|
41
|
+
} = defineProps({
|
|
42
|
+
id: { type: String, required: false },
|
|
43
|
+
initial: { type: Boolean, required: false },
|
|
44
|
+
disabled: { type: Boolean, required: false }
|
|
45
|
+
});
|
|
46
|
+
const emit = defineEmits(["click"]);
|
|
47
|
+
const instanceId = inject(MagicCommandInstanceId, void 0);
|
|
48
|
+
const viewId = inject(MagicCommandViewId, void 0);
|
|
49
|
+
const contentId = inject(MagicCommandContentId, void 0);
|
|
50
|
+
if (!instanceId) {
|
|
51
|
+
throw new Error("MagicCommandItem must be nested inside MagicCommandProvider");
|
|
52
|
+
}
|
|
53
|
+
if (!viewId) {
|
|
54
|
+
throw new Error("MagicCommandItem must be nested inside MagicCommandView");
|
|
55
|
+
}
|
|
56
|
+
if (!contentId) {
|
|
57
|
+
throw new Error("MagicCommandItem must be nested inside MagicCommandContent");
|
|
58
|
+
}
|
|
59
|
+
const mappedId = computed(() => id ?? `magic-command-item-${useId()}`);
|
|
60
|
+
const { initializeItem, deleteItem, selectItem } = useCommandItem({
|
|
61
|
+
instanceId,
|
|
62
|
+
viewId
|
|
63
|
+
});
|
|
64
|
+
const { initializeState } = useCommandState(instanceId);
|
|
65
|
+
const state = initializeState();
|
|
66
|
+
const item = initializeItem({
|
|
67
|
+
id: mappedId.value,
|
|
68
|
+
disabled: disabled ?? false
|
|
69
|
+
});
|
|
70
|
+
const pointerDisabled = computed(() => state.input.type !== "pointer");
|
|
71
|
+
const mappedDisabled = computed(() => disabled ?? item?.disabled);
|
|
72
|
+
const mappedActive = computed(() => item?.active);
|
|
73
|
+
function guardedSelect() {
|
|
74
|
+
if (state.input.type === "pointer" && !item.disabled && !item.active) {
|
|
75
|
+
selectItem(mappedId.value);
|
|
106
76
|
}
|
|
77
|
+
}
|
|
78
|
+
function onClick(event) {
|
|
79
|
+
emit("click", event);
|
|
80
|
+
guardedSelect();
|
|
81
|
+
}
|
|
82
|
+
provide(MagicCommandItemId, mappedId.value);
|
|
83
|
+
provide(MagicCommandItemActive, mappedActive);
|
|
84
|
+
provide(MagicCommandItemDisabled, mappedDisabled);
|
|
85
|
+
onMounted(() => {
|
|
86
|
+
if (initial) {
|
|
87
|
+
selectItem(mappedId.value);
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
onBeforeUnmount(() => {
|
|
91
|
+
deleteItem(mappedId.value);
|
|
107
92
|
});
|
|
108
93
|
</script>
|
|
109
94
|
|