@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
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
{
|
|
2
|
+
"footer": [
|
|
3
|
+
{
|
|
4
|
+
"label": "Catalogue",
|
|
5
|
+
"list": [
|
|
6
|
+
{
|
|
7
|
+
"url": "https://maas.engineering/mirror-ui",
|
|
8
|
+
"label": "Mirror Ui",
|
|
9
|
+
"badge": {
|
|
10
|
+
"name": "Pro",
|
|
11
|
+
"variant": "info",
|
|
12
|
+
"mode": "translucent"
|
|
13
|
+
},
|
|
14
|
+
|
|
15
|
+
"icon": "maas-mr"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"url": "https://maas.engineering/dreamtype",
|
|
19
|
+
"label": "Dreamtype™",
|
|
20
|
+
"badge": {
|
|
21
|
+
"name": "Soon",
|
|
22
|
+
"variant": "primary",
|
|
23
|
+
"mode": "outline"
|
|
24
|
+
},
|
|
25
|
+
|
|
26
|
+
"icon": "maas-dt"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"url": "https://maas.engineering/azzets",
|
|
30
|
+
"label": "Azzets",
|
|
31
|
+
"badge": {
|
|
32
|
+
"name": "Soon",
|
|
33
|
+
"variant": "primary",
|
|
34
|
+
"mode": "outline"
|
|
35
|
+
},
|
|
36
|
+
"icon": "maas-az"
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"label": "Open Source",
|
|
42
|
+
"list": [
|
|
43
|
+
{
|
|
44
|
+
"url": "https://maas.engineering/vue-equipment",
|
|
45
|
+
"label": "Vue Equipment",
|
|
46
|
+
|
|
47
|
+
"icon": "maas-ve"
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
{
|
|
51
|
+
"url": "https://maas.engineering/open-foundry",
|
|
52
|
+
"label": "Open Foundry",
|
|
53
|
+
"badge": {
|
|
54
|
+
"name": "Soon",
|
|
55
|
+
"variant": "primary",
|
|
56
|
+
"mode": "outline"
|
|
57
|
+
},
|
|
58
|
+
"icon": "maas-of"
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"label": "Company",
|
|
64
|
+
"list": [
|
|
65
|
+
{
|
|
66
|
+
"url": "https://maas.engineering/blog",
|
|
67
|
+
"label": "Readme",
|
|
68
|
+
"badge": {
|
|
69
|
+
"name": "Blog",
|
|
70
|
+
"variant": "primary",
|
|
71
|
+
"mode": "outline"
|
|
72
|
+
},
|
|
73
|
+
"icon": "edit-alt"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"url": "https://maas.engineering/about",
|
|
77
|
+
"label": "About us",
|
|
78
|
+
"icon": "maas-robot"
|
|
79
|
+
},
|
|
80
|
+
|
|
81
|
+
{
|
|
82
|
+
"url": "https://maas.engineering/contact",
|
|
83
|
+
"label": "Contact",
|
|
84
|
+
"icon": "maas-robot"
|
|
85
|
+
}
|
|
86
|
+
]
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"label": "Community",
|
|
90
|
+
"list": [
|
|
91
|
+
{
|
|
92
|
+
"url": "https://github.com/magicasaservice",
|
|
93
|
+
"label": "Github"
|
|
94
|
+
},
|
|
95
|
+
|
|
96
|
+
{
|
|
97
|
+
"url": "https://figma.com",
|
|
98
|
+
"label": "Figma"
|
|
99
|
+
}
|
|
100
|
+
]
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"label": "Legal",
|
|
104
|
+
"list": [
|
|
105
|
+
{
|
|
106
|
+
"url": "https://maas.engineering/legal-notice",
|
|
107
|
+
"label": "Legal Notice"
|
|
108
|
+
},
|
|
109
|
+
|
|
110
|
+
{
|
|
111
|
+
"url": "https://maas.engineering/privacy-policy",
|
|
112
|
+
"label": "Privacy Policy"
|
|
113
|
+
}
|
|
114
|
+
]
|
|
115
|
+
}
|
|
116
|
+
]
|
|
117
|
+
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { Plugin } from 'vue';
|
|
2
2
|
import { useMagicAccordion } from './src/composables/useMagicAccordion.js';
|
|
3
3
|
import { MagicAccordionInstanceId, MagicAccordionViewId, MagicAccordionViewActive } from './src/symbols/index.js';
|
|
4
|
+
import type { MagicAccordionOptions } from './src/types/index.js';
|
|
4
5
|
declare const MagicAccordionPlugin: Plugin;
|
|
5
6
|
export { MagicAccordionPlugin, useMagicAccordion, MagicAccordionInstanceId, MagicAccordionViewId, MagicAccordionViewActive, };
|
|
7
|
+
export type { MagicAccordionOptions };
|
|
@@ -1,77 +1,110 @@
|
|
|
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
|
-
|
|
1
|
+
<script>
|
|
2
|
+
import { defineComponent as _defineComponent } from "vue";
|
|
3
|
+
import { unref as _unref, renderSlot as _renderSlot, vShow as _vShow, withCtx as _withCtx, createVNode as _createVNode, withDirectives as _withDirectives, Transition as _Transition, normalizeStyle as _normalizeStyle, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
4
|
+
const _hoisted_1 = ["data-active"];
|
|
5
|
+
import { inject, computed } from "vue";
|
|
6
|
+
import { defu } from "defu";
|
|
7
|
+
import { AutoSize } from "@maas/vue-autosize";
|
|
8
|
+
import { Primitive } from "@maas/vue-primitive";
|
|
9
|
+
import { useAccordionView } from "../composables/private/useAccordionView";
|
|
10
|
+
import { useAccordionState } from "../composables/private/useAccordionState";
|
|
11
|
+
import { useAccordionCallback } from "../composables/private/useAccordionCallback";
|
|
12
|
+
import { MagicAccordionInstanceId, MagicAccordionViewId } from "../symbols";
|
|
13
|
+
import "@maas/vue-equipment/utils/css/animations/fade-in.css";
|
|
14
|
+
import "@maas/vue-equipment/utils/css/animations/auto-size-out.css";
|
|
15
|
+
import "@maas/vue-equipment/utils/css/easings.css";
|
|
16
|
+
export default /* @__PURE__ */ _defineComponent({
|
|
17
|
+
__name: "MagicAccordionContent",
|
|
18
|
+
props: {
|
|
19
|
+
asChild: { type: Boolean, required: false },
|
|
20
|
+
transition: { type: String, required: false },
|
|
21
|
+
animation: { type: Object, required: false }
|
|
22
|
+
},
|
|
23
|
+
setup(__props) {
|
|
24
|
+
const instanceId = inject(MagicAccordionInstanceId, void 0);
|
|
25
|
+
const viewId = inject(MagicAccordionViewId, void 0);
|
|
26
|
+
if (!instanceId) {
|
|
27
|
+
throw new Error("MagicMenuContent must be nested inside MagicMenuProvider");
|
|
28
|
+
}
|
|
29
|
+
if (!viewId) {
|
|
30
|
+
throw new Error("MagicMenuContent must be nested inside MagicMenuView");
|
|
31
|
+
}
|
|
32
|
+
const { initializeState } = useAccordionState(instanceId);
|
|
33
|
+
const state = initializeState();
|
|
34
|
+
const { getView } = useAccordionView(instanceId);
|
|
35
|
+
const view = getView(viewId);
|
|
36
|
+
const mappedTransition = computed(() => __props.transition ?? state.options.transition);
|
|
37
|
+
const mappedAnimation = computed(() => defu(__props.animation, state.options.animation));
|
|
38
|
+
const {
|
|
39
|
+
onBeforeEnter,
|
|
40
|
+
onEnter,
|
|
41
|
+
onAfterEnter,
|
|
42
|
+
onBeforeLeave,
|
|
43
|
+
onLeave,
|
|
44
|
+
onAfterLeave
|
|
45
|
+
} = useAccordionCallback({
|
|
46
|
+
instanceId,
|
|
47
|
+
viewId
|
|
48
|
+
});
|
|
49
|
+
return (_ctx, _cache) => {
|
|
50
|
+
return _openBlock(), _createElementBlock("div", {
|
|
51
|
+
class: "magic-accordion-content",
|
|
52
|
+
"data-active": _unref(view)?.active,
|
|
53
|
+
style: _normalizeStyle({ "--ma-duration": `${_unref(state).options.animation?.duration}ms` })
|
|
54
|
+
}, [
|
|
55
|
+
_createVNode(_unref(AutoSize), {
|
|
56
|
+
width: false,
|
|
57
|
+
duration: mappedAnimation.value.duration,
|
|
58
|
+
easing: mappedAnimation.value.easing
|
|
59
|
+
}, {
|
|
60
|
+
default: _withCtx(() => [
|
|
61
|
+
_createVNode(_Transition, {
|
|
62
|
+
name: mappedTransition.value,
|
|
63
|
+
"on-before-enter": _unref(onBeforeEnter),
|
|
64
|
+
"on-enter": _unref(onEnter),
|
|
65
|
+
"on-after-enter": _unref(onAfterEnter),
|
|
66
|
+
"on-before-leave": _unref(onBeforeLeave),
|
|
67
|
+
"on-leave": _unref(onLeave),
|
|
68
|
+
"on-after-leave": _unref(onAfterLeave),
|
|
69
|
+
persisted: ""
|
|
70
|
+
}, {
|
|
71
|
+
default: _withCtx(() => [
|
|
72
|
+
_withDirectives(_createVNode(_unref(Primitive), { "as-child": _ctx.asChild }, {
|
|
73
|
+
default: _withCtx(() => [
|
|
74
|
+
_renderSlot(_ctx.$slots, "default", {
|
|
75
|
+
viewActive: _unref(view)?.active
|
|
76
|
+
})
|
|
77
|
+
]),
|
|
78
|
+
_: 3
|
|
79
|
+
/* FORWARDED */
|
|
80
|
+
}, 8, ["as-child"]), [
|
|
81
|
+
[_vShow, _unref(view)?.active]
|
|
82
|
+
])
|
|
83
|
+
]),
|
|
84
|
+
_: 3
|
|
85
|
+
/* FORWARDED */
|
|
86
|
+
}, 8, ["name", "on-before-enter", "on-enter", "on-after-enter", "on-before-leave", "on-leave", "on-after-leave"])
|
|
87
|
+
]),
|
|
88
|
+
_: 3
|
|
89
|
+
/* FORWARDED */
|
|
90
|
+
}, 8, ["duration", "easing"])
|
|
91
|
+
], 12, _hoisted_1);
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
</script>
|
|
32
96
|
|
|
33
|
-
|
|
34
|
-
|
|
97
|
+
<style>
|
|
98
|
+
.magic-accordion-content {
|
|
99
|
+
clip-path: var(--magic-accordion-content-clip-path, inset(0));
|
|
35
100
|
}
|
|
36
101
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const viewId = inject(MagicAccordionViewId, undefined)
|
|
41
|
-
|
|
42
|
-
if (!instanceId) {
|
|
43
|
-
throw new Error('MagicMenuContent must be nested inside MagicMenuProvider')
|
|
102
|
+
.magic-accordion-enter-active {
|
|
103
|
+
position: relative;
|
|
104
|
+
animation: fade-in var(--ma-duration) var(--ease-in-out);
|
|
44
105
|
}
|
|
45
106
|
|
|
46
|
-
|
|
47
|
-
|
|
107
|
+
.magic-accordion-leave-active {
|
|
108
|
+
animation: auto-size-out var(--ma-duration) var(--ease-in-out-sharp);
|
|
48
109
|
}
|
|
49
|
-
|
|
50
|
-
const { initializeState } = useAccordionState(instanceId)
|
|
51
|
-
const state = initializeState()
|
|
52
|
-
|
|
53
|
-
const { getView } = useAccordionView(instanceId)
|
|
54
|
-
const view = getView(viewId)
|
|
55
|
-
|
|
56
|
-
const {
|
|
57
|
-
onBeforeEnter,
|
|
58
|
-
onEnter,
|
|
59
|
-
onAfterEnter,
|
|
60
|
-
onBeforeLeave,
|
|
61
|
-
onLeave,
|
|
62
|
-
onAfterLeave,
|
|
63
|
-
} = useAccordionCallback({
|
|
64
|
-
instanceId,
|
|
65
|
-
viewId,
|
|
66
|
-
})
|
|
67
|
-
</script>
|
|
68
|
-
|
|
69
|
-
<style>
|
|
70
|
-
.magic-accordion-content{--magic-auto-size-transition:var(
|
|
71
|
-
--magic-accordion-size-transition,all 200ms var(--ease-in-out-sharp) ;
|
|
72
|
-
);clip-path:var(--magic-accordion-content-clip-path,inset(0))}.magic-accordion-enter-active{position:relative;transition:var(
|
|
73
|
-
--magic-accordion-enter-transition,fade-in .15s var(--ease-in-out)
|
|
74
|
-
)}.magic-accordion-leave-active{height:0;transition:var(
|
|
75
|
-
--magic-accordion-leave-transition,all .2s var(--ease-in-out-sharp)
|
|
76
|
-
)}
|
|
77
110
|
</style>
|
|
@@ -1,22 +1,37 @@
|
|
|
1
1
|
import '@maas/vue-equipment/utils/css/animations/fade-in.css';
|
|
2
|
+
import '@maas/vue-equipment/utils/css/animations/auto-size-out.css';
|
|
2
3
|
import '@maas/vue-equipment/utils/css/easings.css';
|
|
3
4
|
interface MagicAccordionContentProps {
|
|
4
5
|
asChild?: boolean;
|
|
6
|
+
transition?: string;
|
|
7
|
+
animation?: {
|
|
8
|
+
duration: number;
|
|
9
|
+
easing: (t: number) => number;
|
|
10
|
+
};
|
|
5
11
|
}
|
|
6
12
|
declare function __VLS_template(): {
|
|
7
13
|
attrs: Partial<{}>;
|
|
8
14
|
slots: {
|
|
9
15
|
default?(_: {
|
|
10
|
-
|
|
16
|
+
viewActive: boolean | undefined;
|
|
11
17
|
}): any;
|
|
12
18
|
};
|
|
13
19
|
refs: {};
|
|
14
20
|
rootEl: HTMLDivElement;
|
|
15
21
|
};
|
|
16
22
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
17
|
-
declare const __VLS_component: import("vue").DefineComponent<MagicAccordionContentProps
|
|
23
|
+
declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<MagicAccordionContentProps>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<MagicAccordionContentProps>>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
18
24
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
19
25
|
export default _default;
|
|
26
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
27
|
+
type __VLS_TypePropsToOption<T> = {
|
|
28
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
29
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
30
|
+
} : {
|
|
31
|
+
type: import('vue').PropType<T[K]>;
|
|
32
|
+
required: true;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
20
35
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
21
36
|
new (): {
|
|
22
37
|
$slots: S;
|
|
@@ -1,31 +1,37 @@
|
|
|
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
|
-
|
|
1
|
+
<script>
|
|
2
|
+
import { defineComponent as _defineComponent } from "vue";
|
|
3
|
+
import { renderSlot as _renderSlot, unref as _unref, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock } from "vue";
|
|
4
|
+
import { onBeforeUnmount, provide } from "vue";
|
|
5
|
+
import { Primitive } from "@maas/vue-primitive";
|
|
6
|
+
import { MagicAccordionInstanceId } from "../symbols";
|
|
7
|
+
import { useAccordionState } from "../composables/private/useAccordionState";
|
|
8
|
+
export default /* @__PURE__ */ _defineComponent({
|
|
9
|
+
__name: "MagicAccordionProvider",
|
|
10
|
+
props: {
|
|
11
|
+
id: { type: null, required: true },
|
|
12
|
+
asChild: { type: Boolean, required: false },
|
|
13
|
+
options: { type: Object, required: false }
|
|
14
|
+
},
|
|
15
|
+
setup(__props) {
|
|
16
|
+
const { deleteState, initializeState } = useAccordionState(__props.id);
|
|
17
|
+
initializeState(__props.options);
|
|
18
|
+
onBeforeUnmount(() => {
|
|
19
|
+
deleteState();
|
|
20
|
+
});
|
|
21
|
+
provide(MagicAccordionInstanceId, __props.id);
|
|
22
|
+
return (_ctx, _cache) => {
|
|
23
|
+
return _openBlock(), _createBlock(_unref(Primitive), {
|
|
24
|
+
id: _ctx.id,
|
|
25
|
+
"as-child": _ctx.asChild,
|
|
26
|
+
class: "magic-accordion-provider"
|
|
27
|
+
}, {
|
|
28
|
+
default: _withCtx(() => [
|
|
29
|
+
_renderSlot(_ctx.$slots, "default")
|
|
30
|
+
]),
|
|
31
|
+
_: 3
|
|
32
|
+
/* FORWARDED */
|
|
33
|
+
}, 8, ["id", "as-child"]);
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
});
|
|
31
37
|
</script>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type MaybeRef } from 'vue';
|
|
2
|
-
import type { MagicAccordionOptions } from '../types';
|
|
2
|
+
import type { MagicAccordionOptions } from '../types/index.js';
|
|
3
3
|
interface MagicAccordionProviderProps {
|
|
4
4
|
id: MaybeRef<string>;
|
|
5
5
|
asChild?: boolean;
|
|
@@ -14,9 +14,18 @@ declare function __VLS_template(): {
|
|
|
14
14
|
rootEl: any;
|
|
15
15
|
};
|
|
16
16
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
17
|
-
declare const __VLS_component: import("vue").DefineComponent<MagicAccordionProviderProps
|
|
17
|
+
declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<MagicAccordionProviderProps>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<MagicAccordionProviderProps>>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
18
18
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
19
19
|
export default _default;
|
|
20
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
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
|
+
};
|
|
20
29
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
21
30
|
new (): {
|
|
22
31
|
$slots: S;
|
|
@@ -1,75 +1,75 @@
|
|
|
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
|
-
|
|
33
|
-
|
|
34
|
-
})
|
|
35
|
-
const
|
|
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
|
-
onKeyStroke('Enter', onEnter)
|
|
1
|
+
<script>
|
|
2
|
+
import { defineComponent as _defineComponent } from "vue";
|
|
3
|
+
import { unref as _unref, renderSlot as _renderSlot, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock } from "vue";
|
|
4
|
+
import { inject, ref, computed, toValue } from "vue";
|
|
5
|
+
import { Primitive } from "@maas/vue-primitive";
|
|
6
|
+
import { onKeyStroke } from "@vueuse/core";
|
|
7
|
+
import { useAccordionTrigger } from "../composables/private/useAccordionTrigger";
|
|
8
|
+
import { MagicAccordionInstanceId, MagicAccordionViewId } from "../symbols";
|
|
9
|
+
import { useAccordionState } from "../composables/private/useAccordionState";
|
|
10
|
+
import { useAccordionView } from "../composables/private/useAccordionView";
|
|
11
|
+
export default /* @__PURE__ */ _defineComponent({
|
|
12
|
+
__name: "MagicAccordionTrigger",
|
|
13
|
+
props: {
|
|
14
|
+
disabled: { type: null, required: false, default: false },
|
|
15
|
+
trigger: { type: String, required: false, default: "click" },
|
|
16
|
+
asChild: { type: Boolean, required: false, default: false }
|
|
17
|
+
},
|
|
18
|
+
setup(__props) {
|
|
19
|
+
const elRef = ref(void 0);
|
|
20
|
+
const instanceId = inject(MagicAccordionInstanceId, void 0);
|
|
21
|
+
const viewId = inject(MagicAccordionViewId, void 0);
|
|
22
|
+
if (!instanceId) {
|
|
23
|
+
throw new Error(
|
|
24
|
+
"MagicAccordionTrigger must be nested inside MagicAccordionProvider"
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
if (!viewId) {
|
|
28
|
+
throw new Error(
|
|
29
|
+
"MagicAccordionTrigger must be nested inside MagicAccordionView"
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
const { initializeState } = useAccordionState(instanceId);
|
|
33
|
+
const state = initializeState();
|
|
34
|
+
const { getView } = useAccordionView(instanceId);
|
|
35
|
+
const view = getView(viewId);
|
|
36
|
+
const mappedDisabled = computed(
|
|
37
|
+
() => toValue(__props.disabled) || state.options.disabled
|
|
38
|
+
);
|
|
39
|
+
const { onMouseenter, onClick, onEnter } = useAccordionTrigger({
|
|
40
|
+
instanceId,
|
|
41
|
+
viewId,
|
|
42
|
+
elRef,
|
|
43
|
+
disabled: __props.disabled,
|
|
44
|
+
trigger: __props.trigger
|
|
45
|
+
});
|
|
46
|
+
onKeyStroke("Enter", onEnter);
|
|
47
|
+
return (_ctx, _cache) => {
|
|
48
|
+
return _openBlock(), _createBlock(_unref(Primitive), {
|
|
49
|
+
ref_key: "elRef",
|
|
50
|
+
ref: elRef,
|
|
51
|
+
"as-child": _ctx.asChild,
|
|
52
|
+
"data-disabled": mappedDisabled.value,
|
|
53
|
+
class: "magic-accordion-trigger",
|
|
54
|
+
as: "button",
|
|
55
|
+
onMouseenter: _unref(onMouseenter),
|
|
56
|
+
onClick: _unref(onClick)
|
|
57
|
+
}, {
|
|
58
|
+
default: _withCtx(() => [
|
|
59
|
+
_renderSlot(_ctx.$slots, "default", {
|
|
60
|
+
viewActive: _unref(view)?.active
|
|
61
|
+
})
|
|
62
|
+
]),
|
|
63
|
+
_: 3
|
|
64
|
+
/* FORWARDED */
|
|
65
|
+
}, 8, ["as-child", "data-disabled", "onMouseenter", "onClick"]);
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
});
|
|
71
69
|
</script>
|
|
72
70
|
|
|
73
71
|
<style>
|
|
74
|
-
.magic-accordion-trigger
|
|
72
|
+
.magic-accordion-trigger[data-disabled='true'] {
|
|
73
|
+
cursor: var(--magic-accordion-trigger-cursor-disabled, not-allowed);
|
|
74
|
+
}
|
|
75
75
|
</style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type MaybeRef } from 'vue';
|
|
2
|
-
import type { Interaction } from '../types';
|
|
2
|
+
import type { Interaction } from '../types/index.js';
|
|
3
3
|
interface MagicAccordionTriggerProps {
|
|
4
4
|
disabled?: MaybeRef<boolean>;
|
|
5
5
|
trigger?: Interaction;
|
|
@@ -9,7 +9,7 @@ declare function __VLS_template(): {
|
|
|
9
9
|
attrs: Partial<{}>;
|
|
10
10
|
slots: {
|
|
11
11
|
default?(_: {
|
|
12
|
-
|
|
12
|
+
viewActive: boolean | undefined;
|
|
13
13
|
}): any;
|
|
14
14
|
};
|
|
15
15
|
refs: {
|
|
@@ -53,13 +53,18 @@ declare function __VLS_template(): {
|
|
|
53
53
|
rootEl: any;
|
|
54
54
|
};
|
|
55
55
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
56
|
-
declare const __VLS_component: import("vue").DefineComponent<MagicAccordionTriggerProps
|
|
57
|
-
asChild: boolean;
|
|
58
|
-
disabled: MaybeRef<boolean>;
|
|
59
|
-
trigger: Interaction;
|
|
60
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
56
|
+
declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<MagicAccordionTriggerProps>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<MagicAccordionTriggerProps>>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
61
57
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
62
58
|
export default _default;
|
|
59
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
60
|
+
type __VLS_TypePropsToOption<T> = {
|
|
61
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
62
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
63
|
+
} : {
|
|
64
|
+
type: import('vue').PropType<T[K]>;
|
|
65
|
+
required: true;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
63
68
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
64
69
|
new (): {
|
|
65
70
|
$slots: S;
|