@maas/vue-equipment 1.0.0-beta.1 → 1.0.0-beta.10
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.json +1 -1
- package/dist/nuxt/module.mjs +9 -2
- package/dist/plugins/.turbo/turbo-lint.log +1 -9
- package/dist/plugins/MagicAccordion/demo/data/footer.json +1 -1
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionContent.vue.d.ts +33 -22
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionProvider.vue +2 -2
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionProvider.vue.d.ts +12 -21
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue +15 -13
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue.d.ts +23 -59
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue +2 -1
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue.d.ts +17 -22
- package/dist/plugins/MagicAccordion/src/composables/private/useAccordionTrigger.d.ts +1 -1
- package/dist/plugins/MagicAccordion/src/symbols/index.d.ts +2 -2
- package/dist/plugins/MagicCommand/src/components/MagicCommandContent.vue +11 -4
- package/dist/plugins/MagicCommand/src/components/MagicCommandContent.vue.d.ts +24 -13
- package/dist/plugins/MagicCommand/src/components/MagicCommandDrawer.vue.d.ts +12 -21
- package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue +0 -4
- package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue.d.ts +29 -28
- package/dist/plugins/MagicCommand/src/components/MagicCommandModal.vue.d.ts +12 -21
- package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue +5 -7
- package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue.d.ts +12 -58
- package/dist/plugins/MagicCommand/src/components/MagicCommandRenderer.vue +7 -7
- package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.vue +7 -6
- package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.vue.d.ts +25 -60
- package/dist/plugins/MagicCommand/src/components/MagicCommandView.vue +2 -2
- package/dist/plugins/MagicCommand/src/components/MagicCommandView.vue.d.ts +15 -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/symbols/index.d.ts +4 -4
- package/dist/plugins/MagicCommand/src/types/index.d.ts +1 -1
- package/dist/plugins/MagicCookie/src/components/MagicCookieItem.vue.d.ts +13 -22
- package/dist/plugins/MagicCookie/src/components/MagicCookieProvider.vue.d.ts +9 -21
- package/dist/plugins/MagicCookie/src/components/MagicCookieView.vue.d.ts +21 -12
- package/dist/plugins/MagicCookie/src/symbols/index.d.ts +2 -2
- package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue +18 -24
- package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue.d.ts +94 -23
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableDrag.d.ts +2 -2
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableDrag.mjs +9 -5
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableScrollLock.mjs +34 -14
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableSnap.d.ts +6 -4
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableSnap.mjs +54 -19
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableState.mjs +4 -4
- package/dist/plugins/MagicDraggable/src/types/index.d.ts +1 -1
- package/dist/plugins/MagicDraggable/src/utils/defaultOptions.mjs +1 -1
- package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue +33 -24
- package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue.d.ts +165 -24
- 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/MagicMarquee/src/components/MagicMarquee.vue +15 -15
- package/dist/plugins/MagicMarquee/src/components/MagicMarquee.vue.d.ts +14 -25
- 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/MagicMenu/src/components/MagicMenuChannel.vue +4 -5
- package/dist/plugins/MagicMenu/src/components/MagicMenuChannel.vue.d.ts +18 -21
- package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue +3 -6
- package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue.d.ts +41 -24
- package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue +5 -7
- package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue.d.ts +40 -25
- package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue +3 -14
- package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue.d.ts +31 -28
- package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.vue +19 -8
- package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.vue.d.ts +12 -58
- package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.vue +28 -38
- package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.vue.d.ts +19 -23
- package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue +29 -19
- package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue.d.ts +27 -60
- package/dist/plugins/MagicMenu/src/components/MagicMenuView.vue +2 -2
- package/dist/plugins/MagicMenu/src/components/MagicMenuView.vue.d.ts +15 -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/useMenuTrigger.d.ts +1 -1
- package/dist/plugins/MagicMenu/src/composables/private/useMenuView.mjs +18 -6
- package/dist/plugins/MagicMenu/src/symbols/index.d.ts +4 -4
- 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/src/components/MagicModal.vue +9 -9
- package/dist/plugins/MagicModal/src/components/MagicModal.vue.d.ts +44 -22
- package/dist/plugins/MagicModal/src/composables/private/useModalDOM.mjs +34 -14
- package/dist/plugins/MagicNoise/src/components/MagicNoise.vue +14 -14
- 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 +2 -2
- 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 +202 -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/src/components/MagicPlayerAudio.vue +14 -8
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue +32 -38
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue.d.ts +27 -26
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerDisplayTime.vue.d.ts +1 -10
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.vue +19 -8
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.vue.d.ts +1 -10
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerOverlay.vue +2 -2
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerOverlay.vue.d.ts +29 -14
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerPoster.vue.d.ts +13 -11
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerProvider.vue +3 -4
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerProvider.vue.d.ts +23 -23
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideo.vue +3 -4
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideoControls.vue +24 -25
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideoControls.vue.d.ts +61 -33
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerAudioApi.d.ts +2 -2
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerAudioApi.mjs +3 -3
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerControlsApi.d.ts +10 -10
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerControlsApi.mjs +15 -9
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerMediaApi.d.ts +13 -13
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerMediaApi.mjs +18 -11
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerRuntime.d.ts +3 -3
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerRuntime.mjs +3 -3
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerVideoApi.d.ts +6 -6
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerVideoApi.mjs +4 -4
- package/dist/plugins/MagicPlayer/src/composables/useMagicPlayer.d.ts +20 -20
- package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.vue +17 -8
- package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.vue.d.ts +9 -23
- package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue +11 -11
- package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue.d.ts +9 -23
- package/dist/plugins/MagicScroll/src/components/MagicScrollProvider.vue.d.ts +45 -37
- package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue +18 -10
- package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue.d.ts +13 -24
- package/dist/plugins/MagicScroll/src/composables/private/useCollisionDetection.d.ts +2 -2
- package/dist/plugins/MagicScroll/src/composables/private/useCollisionDetection.mjs +3 -3
- package/dist/plugins/MagicScroll/src/composables/private/useScrollApi.mjs +14 -4
- package/dist/plugins/MagicScroll/src/symbols/index.d.ts +1 -1
- package/dist/plugins/MagicToast/src/components/MagicToastProvider.vue +23 -29
- package/dist/plugins/MagicToast/src/components/MagicToastProvider.vue.d.ts +1 -10
- package/dist/plugins/MagicToast/src/components/MagicToastView.vue +8 -11
- package/dist/plugins/MagicToast/src/components/MagicToastView.vue.d.ts +24 -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 +22 -22
- package/dist/plugins/MagicToast/src/composables/private/useToastScrollLock.mjs +33 -15
- 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 +1 -1
- 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/index.d.ts +9 -4
- package/dist/utils/index.js +39 -3
- package/dist/utils/index.js.map +1 -1
- package/package.json +16 -7
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type MaybeRef } from 'vue';
|
|
1
|
+
import { toValue, type MaybeRef } from 'vue';
|
|
2
2
|
import type { MagicDrawerOptions } from '../types/index.js';
|
|
3
3
|
import '@maas/vue-equipment/utils/css/animations/fade-in.css';
|
|
4
4
|
import '@maas/vue-equipment/utils/css/animations/fade-out.css';
|
|
@@ -14,33 +14,174 @@ interface MagicDrawerProps {
|
|
|
14
14
|
id: MaybeRef<string>;
|
|
15
15
|
options?: MagicDrawerOptions;
|
|
16
16
|
}
|
|
17
|
-
declare
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
declare const mappedOptions: Omit<MagicDrawerOptions, keyof MagicDrawerOptions> & Omit<import("../types/index").DrawerDefaultOptions, keyof MagicDrawerOptions> & {
|
|
18
|
+
threshold: ({
|
|
19
|
+
lock?: number;
|
|
20
|
+
distance?: number;
|
|
21
|
+
momentum?: number;
|
|
22
|
+
} & import("../../../../utils").RequireAll<{
|
|
23
|
+
lock?: number;
|
|
24
|
+
distance?: number;
|
|
25
|
+
momentum?: number;
|
|
26
|
+
}>) | (Omit<{
|
|
27
|
+
lock?: number;
|
|
28
|
+
distance?: number;
|
|
29
|
+
momentum?: number;
|
|
30
|
+
}, "lock" | "distance" | "momentum"> & Omit<{
|
|
31
|
+
lock?: number;
|
|
32
|
+
distance?: number;
|
|
33
|
+
momentum?: number;
|
|
34
|
+
} & import("../../../../utils").RequireAll<{
|
|
35
|
+
lock?: number;
|
|
36
|
+
distance?: number;
|
|
37
|
+
momentum?: number;
|
|
38
|
+
}>, "lock" | "distance" | "momentum"> & {
|
|
39
|
+
lock: number;
|
|
40
|
+
distance: number;
|
|
41
|
+
momentum: number;
|
|
42
|
+
});
|
|
43
|
+
transition: {
|
|
44
|
+
content?: string;
|
|
45
|
+
backdrop?: string;
|
|
22
46
|
};
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
47
|
+
disabled: boolean;
|
|
48
|
+
animation: ({
|
|
49
|
+
snap?: {
|
|
50
|
+
duration?: number;
|
|
51
|
+
easing?: (t: number) => number;
|
|
52
|
+
};
|
|
53
|
+
} & import("../../../../utils").RequireAll<{
|
|
54
|
+
snap?: {
|
|
55
|
+
duration?: number;
|
|
56
|
+
easing?: (t: number) => number;
|
|
57
|
+
};
|
|
58
|
+
}>) | (Omit<{
|
|
59
|
+
snap?: {
|
|
60
|
+
duration?: number;
|
|
61
|
+
easing?: (t: number) => number;
|
|
62
|
+
};
|
|
63
|
+
}, "snap"> & Omit<{
|
|
64
|
+
snap?: {
|
|
65
|
+
duration?: number;
|
|
66
|
+
easing?: (t: number) => number;
|
|
67
|
+
};
|
|
68
|
+
} & import("../../../../utils").RequireAll<{
|
|
69
|
+
snap?: {
|
|
70
|
+
duration?: number;
|
|
71
|
+
easing?: (t: number) => number;
|
|
72
|
+
};
|
|
73
|
+
}>, "snap"> & {
|
|
74
|
+
snap: {
|
|
75
|
+
duration?: number;
|
|
76
|
+
easing?: (t: number) => number;
|
|
77
|
+
};
|
|
78
|
+
});
|
|
79
|
+
backdrop: boolean;
|
|
80
|
+
tag: "div" | "dialog";
|
|
81
|
+
focusTrap: boolean | import("focus-trap").Options;
|
|
82
|
+
scrollLock: {
|
|
83
|
+
padding: boolean;
|
|
84
|
+
} | ((boolean | {
|
|
85
|
+
padding: boolean;
|
|
86
|
+
}) & import("../../../../utils").RequireAll<boolean | {
|
|
87
|
+
padding: boolean;
|
|
88
|
+
} | undefined>) | (Omit<{
|
|
89
|
+
padding: boolean;
|
|
90
|
+
}, "padding"> & Omit<false & import("../../../../utils").RequireAll<{
|
|
91
|
+
padding: boolean;
|
|
92
|
+
}>, "padding"> & {
|
|
93
|
+
padding: boolean;
|
|
94
|
+
}) | (Omit<{
|
|
95
|
+
padding: boolean;
|
|
96
|
+
}, "padding"> & Omit<true & import("../../../../utils").RequireAll<{
|
|
97
|
+
padding: boolean;
|
|
98
|
+
}>, "padding"> & {
|
|
99
|
+
padding: boolean;
|
|
100
|
+
}) | (Omit<{
|
|
101
|
+
padding: boolean;
|
|
102
|
+
}, "padding"> & Omit<{
|
|
103
|
+
padding: boolean;
|
|
104
|
+
} & false, "padding"> & {
|
|
105
|
+
padding: boolean;
|
|
106
|
+
}) | (Omit<{
|
|
107
|
+
padding: boolean;
|
|
108
|
+
}, "padding"> & Omit<{
|
|
109
|
+
padding: boolean;
|
|
110
|
+
} & true, "padding"> & {
|
|
111
|
+
padding: boolean;
|
|
112
|
+
});
|
|
113
|
+
teleport: {
|
|
114
|
+
target?: string;
|
|
115
|
+
disabled?: boolean;
|
|
27
116
|
};
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
117
|
+
keyListener: ({
|
|
118
|
+
close?: string[] | false;
|
|
119
|
+
} & import("../../../../utils").RequireAll<{
|
|
120
|
+
close?: string[] | false;
|
|
121
|
+
}>) | (Omit<{
|
|
122
|
+
close?: string[] | false;
|
|
123
|
+
}, "close"> & Omit<{
|
|
124
|
+
close?: string[] | false;
|
|
125
|
+
} & import("../../../../utils").RequireAll<{
|
|
126
|
+
close?: string[] | false;
|
|
127
|
+
}>, "close"> & {
|
|
128
|
+
close: (false | string[] | undefined) & (false | string[]);
|
|
129
|
+
});
|
|
130
|
+
position: "right" | "left" | "top" | "bottom";
|
|
131
|
+
snapPoints: import("../types/index").DrawerSnapPoint[];
|
|
132
|
+
initial: {
|
|
133
|
+
open?: boolean;
|
|
134
|
+
transition?: boolean;
|
|
135
|
+
snapPoint?: import("../types/index").DrawerSnapPoint;
|
|
41
136
|
};
|
|
137
|
+
enableMousewheel: boolean;
|
|
138
|
+
preventZoom: boolean;
|
|
139
|
+
preventDragClose: boolean;
|
|
42
140
|
};
|
|
43
|
-
|
|
141
|
+
declare const disabled: import("vue").ComputedRef<boolean>;
|
|
142
|
+
declare const style: import("vue").ComputedRef<string>, hasDragged: import("vue").ComputedRef<boolean>;
|
|
143
|
+
declare const dragging: import("vue").Ref<boolean, boolean>, wheeling: import("vue").Ref<boolean, boolean>;
|
|
144
|
+
declare const innerActive: import("vue").ShallowRef<boolean, boolean>;
|
|
145
|
+
declare const wrapperActive: import("vue").ShallowRef<boolean, boolean>;
|
|
146
|
+
declare const onBeforeEnter: () => void, onEnter: () => void, onAfterEnter: () => Promise<void>, onBeforeLeave: () => void, onLeave: () => void, onAfterLeave: () => void;
|
|
147
|
+
declare const backdropTransition: import("vue").ComputedRef<string | undefined>;
|
|
148
|
+
declare const contentTransition: import("vue").ComputedRef<string | undefined>;
|
|
149
|
+
declare function guardedPointerdown(event: PointerEvent): void;
|
|
150
|
+
declare function guardedClick(event: PointerEvent): void;
|
|
151
|
+
declare function guardedClose(): void;
|
|
152
|
+
declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
|
|
153
|
+
declare var __VLS_9: {}, __VLS_35: {};
|
|
154
|
+
type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
|
|
155
|
+
backdrop?: (props: typeof __VLS_9) => any;
|
|
156
|
+
} & {
|
|
157
|
+
default?: (props: typeof __VLS_35) => any;
|
|
158
|
+
}>;
|
|
159
|
+
declare const __VLS_self: import("vue").DefineComponent<MagicDrawerProps, {
|
|
160
|
+
toValue: typeof toValue;
|
|
161
|
+
mappedOptions: typeof mappedOptions;
|
|
162
|
+
disabled: typeof disabled;
|
|
163
|
+
style: typeof style;
|
|
164
|
+
hasDragged: typeof hasDragged;
|
|
165
|
+
dragging: typeof dragging;
|
|
166
|
+
wheeling: typeof wheeling;
|
|
167
|
+
innerActive: typeof innerActive;
|
|
168
|
+
wrapperActive: typeof wrapperActive;
|
|
169
|
+
onBeforeEnter: typeof onBeforeEnter;
|
|
170
|
+
onEnter: typeof onEnter;
|
|
171
|
+
onAfterEnter: typeof onAfterEnter;
|
|
172
|
+
onBeforeLeave: typeof onBeforeLeave;
|
|
173
|
+
onLeave: typeof onLeave;
|
|
174
|
+
onAfterLeave: typeof onAfterLeave;
|
|
175
|
+
backdropTransition: typeof backdropTransition;
|
|
176
|
+
contentTransition: typeof contentTransition;
|
|
177
|
+
guardedPointerdown: typeof guardedPointerdown;
|
|
178
|
+
guardedClick: typeof guardedClick;
|
|
179
|
+
guardedClose: typeof guardedClose;
|
|
180
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicDrawerProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
181
|
+
declare const __VLS_component: import("vue").DefineComponent<MagicDrawerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicDrawerProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
182
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
183
|
+
export default _default;
|
|
184
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
44
185
|
new (): {
|
|
45
186
|
$slots: S;
|
|
46
187
|
};
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
import { ref } from "vue";
|
|
1
|
+
import { ref, shallowRef } from "vue";
|
|
2
2
|
import { defu } from "defu";
|
|
3
3
|
import { useScrollLock } from "@vueuse/core";
|
|
4
4
|
import { useFocusTrap } from "@vueuse/integrations/useFocusTrap";
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
matchClass,
|
|
7
|
+
scrollbarGutterSupport,
|
|
8
|
+
scrollbarWidth
|
|
9
|
+
} from "@maas/vue-equipment/utils";
|
|
6
10
|
const defaultOptions = {
|
|
7
11
|
focusTrap: false,
|
|
8
12
|
focusTarget: void 0,
|
|
9
13
|
scrollLock: true
|
|
10
14
|
};
|
|
11
|
-
const scrollLock = typeof window !== "undefined" ? useScrollLock(document?.documentElement) :
|
|
15
|
+
const scrollLock = typeof window !== "undefined" ? useScrollLock(document?.documentElement) : shallowRef(false);
|
|
12
16
|
export function useDrawerDOM(args) {
|
|
13
17
|
const positionFixedElements = ref([]);
|
|
14
18
|
const mappedOptions = defu(args, defaultOptions);
|
|
@@ -36,24 +40,40 @@ export function useDrawerDOM(args) {
|
|
|
36
40
|
function addScrollLockPadding() {
|
|
37
41
|
if (typeof window === "undefined") return;
|
|
38
42
|
const exclude = new RegExp(/magic-drawer(__backdrop)?/);
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
43
|
+
document.body.style.setProperty(
|
|
44
|
+
"--scrollbar-width",
|
|
45
|
+
`${scrollbarWidth()}px`
|
|
46
|
+
);
|
|
42
47
|
positionFixedElements.value = [
|
|
43
48
|
...document.body.getElementsByTagName("*")
|
|
44
49
|
].filter(
|
|
45
|
-
(x) => getComputedStyle(x, null).getPropertyValue("position") === "fixed" && !matchClass(x, exclude)
|
|
46
|
-
);
|
|
47
|
-
positionFixedElements.value.forEach(
|
|
48
|
-
(elem) => elem.style.paddingRight = "var(--scrollbar-width)"
|
|
50
|
+
(x) => getComputedStyle(x, null).getPropertyValue("position") === "fixed" && getComputedStyle(x, null).getPropertyValue("right") === "0px" && !matchClass(x, exclude)
|
|
49
51
|
);
|
|
52
|
+
switch (scrollbarGutterSupport()) {
|
|
53
|
+
case true:
|
|
54
|
+
document.documentElement.style.scrollbarGutter = "stable";
|
|
55
|
+
positionFixedElements.value.forEach((elem) => {
|
|
56
|
+
elem.style.scrollbarGutter = "stable";
|
|
57
|
+
elem.style.overflow = "auto";
|
|
58
|
+
});
|
|
59
|
+
break;
|
|
60
|
+
case false:
|
|
61
|
+
document.body.style.paddingRight = "var(--scrollbar-width)";
|
|
62
|
+
positionFixedElements.value.forEach(
|
|
63
|
+
(elem) => elem.style.paddingRight = "var(--scrollbar-width)"
|
|
64
|
+
);
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
50
67
|
}
|
|
51
68
|
function removeScrollLockPadding() {
|
|
52
|
-
document.
|
|
69
|
+
document.documentElement.style.scrollbarGutter = "";
|
|
53
70
|
document.body.style.removeProperty("--scrollbar-width");
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
71
|
+
document.body.style.paddingRight = "";
|
|
72
|
+
positionFixedElements.value.forEach((elem) => {
|
|
73
|
+
elem.style.paddingRight = "";
|
|
74
|
+
elem.style.scrollbarGutter = "";
|
|
75
|
+
elem.style.overflow = "";
|
|
76
|
+
});
|
|
57
77
|
}
|
|
58
78
|
return {
|
|
59
79
|
trapFocus,
|
|
@@ -2,8 +2,8 @@ import { type Ref, type MaybeRef } from 'vue';
|
|
|
2
2
|
import type { DrawerDefaultOptions } from '../../types/index.js';
|
|
3
3
|
type UseDrawerDragArgs = {
|
|
4
4
|
id: MaybeRef<string>;
|
|
5
|
-
elRef: Ref<HTMLElement |
|
|
6
|
-
wrapperRef: Ref<HTMLDivElement |
|
|
5
|
+
elRef: Ref<HTMLElement | null>;
|
|
6
|
+
wrapperRef: Ref<HTMLDivElement | null>;
|
|
7
7
|
position: MaybeRef<DrawerDefaultOptions['position']>;
|
|
8
8
|
snapPoints: MaybeRef<DrawerDefaultOptions['snapPoints']>;
|
|
9
9
|
threshold: MaybeRef<DrawerDefaultOptions['threshold']>;
|
|
@@ -383,9 +383,9 @@ export function useDrawerDrag(args) {
|
|
|
383
383
|
shouldClose.value = false;
|
|
384
384
|
checkDirection({ x: e.screenX, y: e.screenY });
|
|
385
385
|
if (!scrollLock) {
|
|
386
|
-
const
|
|
387
|
-
if (
|
|
388
|
-
scrollLock = useScrollLock(
|
|
386
|
+
const scrollLockTarget = lockScroll(e.target);
|
|
387
|
+
if (scrollLockTarget) {
|
|
388
|
+
scrollLock = useScrollLock(scrollLockTarget);
|
|
389
389
|
scrollLock.value = true;
|
|
390
390
|
}
|
|
391
391
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Ref, type MaybeRef } from 'vue';
|
|
2
2
|
import type { DrawerSnapPoint, DrawerDefaultOptions } from '../../types/index.js';
|
|
3
3
|
interface UseDrawerGuardsArgs {
|
|
4
|
-
elRef: Ref<HTMLElement |
|
|
4
|
+
elRef: Ref<HTMLElement | null>;
|
|
5
5
|
absDirectionX: MaybeRef<'with' | 'against' | undefined>;
|
|
6
6
|
absDirectionY: MaybeRef<'with' | 'against' | undefined>;
|
|
7
7
|
position: MaybeRef<DrawerDefaultOptions['position']>;
|
|
@@ -8,6 +8,20 @@ export function useDrawerGuards(args) {
|
|
|
8
8
|
const canSnap = computed(() => {
|
|
9
9
|
return toValue(activeSnapPoint) !== 1 && !!toValue(activeSnapPoint);
|
|
10
10
|
});
|
|
11
|
+
function canScrollY(element) {
|
|
12
|
+
const style = window.getComputedStyle(element);
|
|
13
|
+
const overflowY = style.overflowY;
|
|
14
|
+
const canScroll = ["auto", "scroll"].includes(overflowY);
|
|
15
|
+
const hasOverflow = Math.round(element.scrollHeight) > Math.round(element.clientHeight);
|
|
16
|
+
return canScroll && hasOverflow;
|
|
17
|
+
}
|
|
18
|
+
function canScrollX(element) {
|
|
19
|
+
const style = window.getComputedStyle(element);
|
|
20
|
+
const overflowX = style.overflowX;
|
|
21
|
+
const canScroll = ["auto", "scroll"].includes(overflowX);
|
|
22
|
+
const hasOverflow = Math.round(element.scrollWidth) > Math.round(element.clientWidth);
|
|
23
|
+
return canScroll && hasOverflow;
|
|
24
|
+
}
|
|
11
25
|
function canDrag(el) {
|
|
12
26
|
let element = el;
|
|
13
27
|
if (hasCursor.value) {
|
|
@@ -22,7 +36,7 @@ export function useDrawerGuards(args) {
|
|
|
22
36
|
}
|
|
23
37
|
switch (position) {
|
|
24
38
|
case "bottom":
|
|
25
|
-
if (element
|
|
39
|
+
if (canScrollY(element)) {
|
|
26
40
|
if (element.scrollTop > 0) {
|
|
27
41
|
return false;
|
|
28
42
|
}
|
|
@@ -35,7 +49,7 @@ export function useDrawerGuards(args) {
|
|
|
35
49
|
}
|
|
36
50
|
break;
|
|
37
51
|
case "top":
|
|
38
|
-
if (element
|
|
52
|
+
if (canScrollY(element)) {
|
|
39
53
|
const maxScroll = element.scrollHeight - element.clientHeight;
|
|
40
54
|
if (element.scrollTop < maxScroll) {
|
|
41
55
|
return false;
|
|
@@ -49,7 +63,7 @@ export function useDrawerGuards(args) {
|
|
|
49
63
|
}
|
|
50
64
|
break;
|
|
51
65
|
case "right":
|
|
52
|
-
if (element
|
|
66
|
+
if (canScrollX(element)) {
|
|
53
67
|
if (element.scrollLeft > 0) {
|
|
54
68
|
return false;
|
|
55
69
|
}
|
|
@@ -62,7 +76,7 @@ export function useDrawerGuards(args) {
|
|
|
62
76
|
}
|
|
63
77
|
break;
|
|
64
78
|
case "left":
|
|
65
|
-
if (element
|
|
79
|
+
if (canScrollX(element)) {
|
|
66
80
|
const maxScroll = element.scrollWidth - element.clientWidth;
|
|
67
81
|
if (element.scrollLeft < maxScroll) {
|
|
68
82
|
return false;
|
|
@@ -89,13 +103,13 @@ export function useDrawerGuards(args) {
|
|
|
89
103
|
switch (position) {
|
|
90
104
|
case "bottom":
|
|
91
105
|
case "top":
|
|
92
|
-
if (element
|
|
106
|
+
if (canScrollY(element)) {
|
|
93
107
|
return false;
|
|
94
108
|
}
|
|
95
109
|
break;
|
|
96
110
|
case "left":
|
|
97
111
|
case "right":
|
|
98
|
-
if (element
|
|
112
|
+
if (canScrollX(element)) {
|
|
99
113
|
return false;
|
|
100
114
|
}
|
|
101
115
|
break;
|
|
@@ -117,41 +131,45 @@ export function useDrawerGuards(args) {
|
|
|
117
131
|
}
|
|
118
132
|
switch (position) {
|
|
119
133
|
case "bottom":
|
|
120
|
-
if (element
|
|
134
|
+
if (canScrollY(element)) {
|
|
121
135
|
if (element.scrollTop === 0 || canSnap.value) {
|
|
122
136
|
if (toValue(absDirectionY) === "against") {
|
|
123
137
|
return element;
|
|
124
138
|
}
|
|
125
139
|
}
|
|
140
|
+
return void 0;
|
|
126
141
|
}
|
|
127
142
|
break;
|
|
128
143
|
case "top":
|
|
129
|
-
if (element
|
|
144
|
+
if (canScrollY(element)) {
|
|
130
145
|
const maxScroll = element.scrollHeight - element.clientHeight;
|
|
131
146
|
if (element.scrollTop === maxScroll || canSnap.value) {
|
|
132
147
|
if (toValue(absDirectionY) === "against") {
|
|
133
148
|
return element;
|
|
134
149
|
}
|
|
135
150
|
}
|
|
151
|
+
return void 0;
|
|
136
152
|
}
|
|
137
153
|
break;
|
|
138
154
|
case "right":
|
|
139
|
-
if (element
|
|
155
|
+
if (canScrollX(element)) {
|
|
140
156
|
if (element.scrollLeft === 0 || canSnap.value) {
|
|
141
157
|
if (toValue(absDirectionX) === "against") {
|
|
142
158
|
return element;
|
|
143
159
|
}
|
|
144
160
|
}
|
|
161
|
+
return void 0;
|
|
145
162
|
}
|
|
146
163
|
break;
|
|
147
164
|
case "left":
|
|
148
|
-
if (element
|
|
165
|
+
if (canScrollX(element)) {
|
|
149
166
|
const maxScroll = element.scrollWidth - element.clientWidth;
|
|
150
167
|
if (element.scrollLeft === maxScroll || canSnap.value) {
|
|
151
168
|
if (toValue(absDirectionX) === "against") {
|
|
152
169
|
return element;
|
|
153
170
|
}
|
|
154
171
|
}
|
|
172
|
+
return void 0;
|
|
155
173
|
}
|
|
156
174
|
break;
|
|
157
175
|
}
|
|
@@ -2,8 +2,8 @@ import { type Ref, type MaybeRef } from 'vue';
|
|
|
2
2
|
import type { DrawerDefaultOptions } from '../../types/index.js';
|
|
3
3
|
interface UseDrawerProgressArgs {
|
|
4
4
|
id: MaybeRef<string>;
|
|
5
|
-
elRef: Ref<HTMLElement |
|
|
6
|
-
drawerRef: Ref<HTMLDivElement |
|
|
5
|
+
elRef: Ref<HTMLElement | null>;
|
|
6
|
+
drawerRef: Ref<HTMLDivElement | null>;
|
|
7
7
|
position: MaybeRef<DrawerDefaultOptions['position']>;
|
|
8
8
|
overshoot: MaybeRef<number>;
|
|
9
9
|
}
|
|
@@ -27,9 +27,9 @@ type InterpolateDraggedArgs = {
|
|
|
27
27
|
easing?: (t: number) => number;
|
|
28
28
|
};
|
|
29
29
|
export declare function useDrawerSnap(args: UseDrawerSnapArgs): {
|
|
30
|
-
snappedY:
|
|
31
|
-
snappedX:
|
|
32
|
-
activeSnapPoint:
|
|
30
|
+
snappedY: import("vue").ShallowRef<number, number>;
|
|
31
|
+
snappedX: import("vue").ShallowRef<number, number>;
|
|
32
|
+
activeSnapPoint: import("vue").ShallowRef<DrawerSnapPoint | undefined, DrawerSnapPoint | undefined>;
|
|
33
33
|
snapTo: (args: SnapToArgs) => Promise<void>;
|
|
34
34
|
findClosestSnapPoint: (args: FindClosestSnapPointArgs) => number | undefined;
|
|
35
35
|
interpolateDragged: (args: InterpolateDraggedArgs) => void;
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
shallowRef,
|
|
3
|
+
computed,
|
|
4
|
+
toValue,
|
|
5
|
+
nextTick
|
|
6
|
+
} from "vue";
|
|
2
7
|
import { computedWithControl } from "@vueuse/core";
|
|
3
8
|
import { mapValue, interpolate } from "@maas/vue-equipment/utils";
|
|
4
9
|
import { useMagicEmitter } from "@maas/vue-equipment/plugins";
|
|
@@ -31,22 +36,19 @@ export function useDrawerSnap(args) {
|
|
|
31
36
|
() => toValue(snapPoints),
|
|
32
37
|
() => {
|
|
33
38
|
const extended = toValue(preventDragClose) ? toValue(snapPoints) : [...toValue(snapPoints), 0];
|
|
34
|
-
const mapped = extended.reduce(
|
|
35
|
-
(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
},
|
|
42
|
-
{}
|
|
43
|
-
);
|
|
39
|
+
const mapped = extended.reduce((acc, current) => {
|
|
40
|
+
const key = mapSnapPoint(current);
|
|
41
|
+
if (key || key === 0) {
|
|
42
|
+
acc[key] = current;
|
|
43
|
+
}
|
|
44
|
+
return acc;
|
|
45
|
+
}, {});
|
|
44
46
|
return mapped;
|
|
45
47
|
}
|
|
46
48
|
);
|
|
47
|
-
const snappedY =
|
|
48
|
-
const snappedX =
|
|
49
|
-
const activeSnapPoint =
|
|
49
|
+
const snappedY = shallowRef(0);
|
|
50
|
+
const snappedX = shallowRef(0);
|
|
51
|
+
const activeSnapPoint = shallowRef(void 0);
|
|
50
52
|
const drawerHeight = computed(() => {
|
|
51
53
|
const rect = toValue(wrapperRect);
|
|
52
54
|
if (rect === void 0) {
|
|
@@ -2,7 +2,7 @@ import { type Ref, type MaybeRef, type ComputedRef } from 'vue';
|
|
|
2
2
|
import type { DrawerDefaultOptions } from '../../types/index.js';
|
|
3
3
|
type UseDrawerWheelArgs = {
|
|
4
4
|
id: MaybeRef<string>;
|
|
5
|
-
elRef: Ref<HTMLElement |
|
|
5
|
+
elRef: Ref<HTMLElement | null>;
|
|
6
6
|
position: MaybeRef<DrawerDefaultOptions['position']>;
|
|
7
7
|
disabled: ComputedRef<boolean>;
|
|
8
8
|
};
|
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import { defineComponent as _defineComponent } from "vue";
|
|
3
3
|
import { renderSlot as _renderSlot, createElementVNode as _createElementVNode, unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
4
|
-
const _hoisted_1 = {
|
|
5
|
-
|
|
4
|
+
const _hoisted_1 = {
|
|
5
|
+
ref: "parent",
|
|
6
|
+
class: "magic-marquee"
|
|
7
|
+
};
|
|
8
|
+
const _hoisted_2 = { class: "magic-marquee__track" };
|
|
9
|
+
const _hoisted_3 = {
|
|
10
|
+
ref: "child",
|
|
11
|
+
class: "magic-marquee__content"
|
|
12
|
+
};
|
|
13
|
+
import { useTemplateRef, onMounted, onBeforeUnmount } from "vue";
|
|
6
14
|
import { useMarqueeApi } from "../composables/private/useMarqueeApi";
|
|
7
15
|
import { useMarqueeState } from "../composables/private/useMarqueeState";
|
|
8
16
|
export default /* @__PURE__ */ _defineComponent({
|
|
@@ -14,8 +22,8 @@ export default /* @__PURE__ */ _defineComponent({
|
|
|
14
22
|
setup(__props) {
|
|
15
23
|
const { deleteState, initializeState } = useMarqueeState(__props.id);
|
|
16
24
|
initializeState(__props.options);
|
|
17
|
-
const parentRef =
|
|
18
|
-
const childRef =
|
|
25
|
+
const parentRef = useTemplateRef("parent");
|
|
26
|
+
const childRef = useTemplateRef("child");
|
|
19
27
|
const { duplicates, initialize } = useMarqueeApi({
|
|
20
28
|
child: childRef,
|
|
21
29
|
parent: parentRef,
|
|
@@ -30,20 +38,12 @@ export default /* @__PURE__ */ _defineComponent({
|
|
|
30
38
|
return (_ctx, _cache) => {
|
|
31
39
|
return _openBlock(), _createElementBlock(
|
|
32
40
|
"div",
|
|
33
|
-
|
|
34
|
-
ref_key: "parentRef",
|
|
35
|
-
ref: parentRef,
|
|
36
|
-
class: "magic-marquee"
|
|
37
|
-
},
|
|
41
|
+
_hoisted_1,
|
|
38
42
|
[
|
|
39
|
-
_createElementVNode("div",
|
|
43
|
+
_createElementVNode("div", _hoisted_2, [
|
|
40
44
|
_createElementVNode(
|
|
41
45
|
"div",
|
|
42
|
-
|
|
43
|
-
ref_key: "childRef",
|
|
44
|
-
ref: childRef,
|
|
45
|
-
class: "magic-marquee__content"
|
|
46
|
-
},
|
|
46
|
+
_hoisted_3,
|
|
47
47
|
[
|
|
48
48
|
_renderSlot(_ctx.$slots, "default")
|
|
49
49
|
],
|
|
@@ -4,32 +4,21 @@ interface MagicMarqueeProps {
|
|
|
4
4
|
id: MaybeRef<string>;
|
|
5
5
|
options?: MagicMarqueeOptions;
|
|
6
6
|
}
|
|
7
|
-
declare
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<MagicMarqueeProps>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<MagicMarqueeProps>>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
21
|
-
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
7
|
+
declare const duplicates: import("vue").ShallowRef<number, number>;
|
|
8
|
+
declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
|
|
9
|
+
declare var __VLS_1: {}, __VLS_3: {};
|
|
10
|
+
type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
|
|
11
|
+
default?: (props: typeof __VLS_1) => any;
|
|
12
|
+
} & {
|
|
13
|
+
default?: (props: typeof __VLS_3) => any;
|
|
14
|
+
}>;
|
|
15
|
+
declare const __VLS_self: import("vue").DefineComponent<MagicMarqueeProps, {
|
|
16
|
+
duplicates: typeof duplicates;
|
|
17
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicMarqueeProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
18
|
+
declare const __VLS_component: import("vue").DefineComponent<MagicMarqueeProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicMarqueeProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
22
20
|
export default _default;
|
|
23
|
-
type
|
|
24
|
-
type __VLS_TypePropsToOption<T> = {
|
|
25
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
26
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
27
|
-
} : {
|
|
28
|
-
type: import('vue').PropType<T[K]>;
|
|
29
|
-
required: true;
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
21
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
33
22
|
new (): {
|
|
34
23
|
$slots: S;
|
|
35
24
|
};
|
|
@@ -5,7 +5,7 @@ export type UseMarqueeApiParams = {
|
|
|
5
5
|
instanceId: MaybeRef<string>;
|
|
6
6
|
};
|
|
7
7
|
export declare function useMarqueeApi({ child, parent, instanceId, }: UseMarqueeApiParams): {
|
|
8
|
-
duplicates: import("vue").
|
|
8
|
+
duplicates: import("vue").ShallowRef<number, number>;
|
|
9
9
|
play: () => void;
|
|
10
10
|
pause: () => void;
|
|
11
11
|
initialize: () => Promise<void>;
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
shallowRef,
|
|
3
|
+
computed,
|
|
4
|
+
nextTick,
|
|
5
|
+
watch,
|
|
6
|
+
toValue
|
|
7
|
+
} from "vue";
|
|
2
8
|
import { useElementBounding, useElementSize, useThrottleFn } from "@vueuse/core";
|
|
3
9
|
import { useMarqueeState } from "./useMarqueeState.mjs";
|
|
4
10
|
export function useMarqueeApi({
|
|
@@ -8,7 +14,7 @@ export function useMarqueeApi({
|
|
|
8
14
|
}) {
|
|
9
15
|
const { initializeState } = useMarqueeState(instanceId);
|
|
10
16
|
const state = initializeState();
|
|
11
|
-
const duplicates =
|
|
17
|
+
const duplicates = shallowRef(1);
|
|
12
18
|
const childRect = useElementBounding(child);
|
|
13
19
|
const parentRect = useElementBounding(parent);
|
|
14
20
|
const { width } = useElementSize(parent);
|