@maas/vue-equipment 1.0.0-beta.17 → 1.0.0-beta.18
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/dist/nuxt/module.json +2 -2
- package/dist/nuxt/types.d.mts +2 -6
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionContent.vue +3 -12
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionContent.vue.d.ts +1 -1
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionProvider.vue +3 -12
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue +4 -16
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue.d.ts +1 -1
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue +3 -12
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue.d.ts +1 -1
- package/dist/plugins/MagicCommand/src/components/MagicCommandDrawer.vue +1 -4
- package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue +3 -12
- package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue.d.ts +1 -1
- package/dist/plugins/MagicCommand/src/components/MagicCommandModal.vue +1 -4
- package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue +3 -12
- package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.vue +6 -24
- package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.vue.d.ts +2 -2
- package/dist/plugins/MagicCommand/src/components/MagicCommandView.vue +2 -8
- package/dist/plugins/MagicCommand/src/components/MagicCommandView.vue.d.ts +1 -1
- package/dist/plugins/MagicCookie/src/components/MagicCookieItem.vue +3 -12
- package/dist/plugins/MagicCookie/src/components/MagicCookieItem.vue.d.ts +1 -1
- package/dist/plugins/MagicCookie/src/components/MagicCookieProvider.vue +2 -8
- package/dist/plugins/MagicCookie/src/components/MagicCookieView.vue.d.ts +1 -1
- package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue +12 -9
- package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue.d.ts +4 -4
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableDrag.mjs +38 -61
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableSnap.d.ts +2 -17
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableSnap.mjs +77 -59
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableState.mjs +2 -1
- package/dist/plugins/MagicDraggable/src/types/index.d.ts +1 -0
- package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue +2 -8
- package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue.d.ts +44 -44
- package/dist/plugins/MagicMarquee/src/components/MagicMarquee.vue +2 -8
- package/dist/plugins/MagicMenu/src/components/MagicMenuChannel.vue +2 -8
- package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue +4 -17
- package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue +4 -16
- package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue +2 -8
- package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue.d.ts +1 -1
- package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.vue +3 -12
- package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.vue +6 -24
- package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.vue.d.ts +1 -1
- package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue +5 -20
- package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue.d.ts +2 -2
- package/dist/plugins/MagicMenu/src/components/MagicMenuView.vue +2 -8
- package/dist/plugins/MagicMenu/src/components/MagicMenuView.vue.d.ts +1 -1
- package/dist/plugins/MagicModal/src/components/MagicModal.vue +3 -12
- package/dist/plugins/MagicModal/src/components/MagicModal.vue.d.ts +10 -10
- package/dist/plugins/MagicNoise/src/components/MagicNoise.vue +2 -8
- package/dist/plugins/MagicPie/src/components/MagicPie.vue +2 -8
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue +1 -4
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerDisplayTime.vue +1 -4
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.vue +1 -4
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerProvider.vue +2 -8
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideoControls.vue +3 -12
- package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.vue +2 -8
- package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue +3 -12
- package/dist/plugins/MagicScroll/src/components/MagicScrollProvider.vue +1 -4
- package/dist/plugins/MagicScroll/src/components/MagicScrollProvider.vue.d.ts +1 -18
- package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue +2 -8
- package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue.d.ts +1 -1
- package/dist/plugins/MagicToast/src/components/MagicToastProvider.vue +2 -8
- package/dist/plugins/MagicToast/src/components/MagicToastView.vue +2 -8
- package/package.json +2 -2
- package/dist/nuxt/module.cjs +0 -5
- package/dist/nuxt/module.d.ts +0 -10
- package/dist/nuxt/types.d.ts +0 -7
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
import { type MaybeRef
|
|
1
|
+
import { type MaybeRef } from 'vue';
|
|
2
2
|
import type { DraggableSnapPoint, Coordinates, DraggableDefaultOptions } from '../../types/index.js';
|
|
3
3
|
type UseDraggableSnapArgs = {
|
|
4
4
|
id: MaybeRef<string>;
|
|
5
|
-
elRect: Ref<DOMRect | undefined>;
|
|
6
|
-
wrapperRect: Ref<DOMRect | undefined>;
|
|
7
|
-
draggedX: Ref<number>;
|
|
8
|
-
draggedY: Ref<number>;
|
|
9
|
-
lastDraggedX: Ref<number>;
|
|
10
|
-
lastDraggedY: Ref<number>;
|
|
11
5
|
animation: MaybeRef<DraggableDefaultOptions['animation']>;
|
|
12
6
|
snapPoints: MaybeRef<DraggableDefaultOptions['snapPoints']>;
|
|
13
7
|
};
|
|
@@ -23,17 +17,8 @@ type SnapToArgs = {
|
|
|
23
17
|
duration?: number;
|
|
24
18
|
};
|
|
25
19
|
export declare function useDraggableSnap(args: UseDraggableSnapArgs): {
|
|
20
|
+
mappedActiveSnapPoint: import("vue").ComputedRef<Coordinates | undefined>;
|
|
26
21
|
mappedSnapPoints: import("@vueuse/core").ComputedRefWithControl<Coordinates[]>;
|
|
27
|
-
activeSnapPoint: Ref<("center" | "right" | "left" | "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right") | ["center" | "right" | "left" | "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right", offset?: {
|
|
28
|
-
x?: number | undefined;
|
|
29
|
-
y?: number | undefined;
|
|
30
|
-
} | undefined] | undefined, "center" | "right" | "left" | "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right" | ["center" | "right" | "left" | "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right", offset?: {
|
|
31
|
-
x?: number;
|
|
32
|
-
y?: number;
|
|
33
|
-
} | undefined] | ["center" | "right" | "left" | "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right", offset?: {
|
|
34
|
-
x?: number | undefined;
|
|
35
|
-
y?: number | undefined;
|
|
36
|
-
} | undefined] | undefined>;
|
|
37
22
|
snapPointsMap: import("@vueuse/core").ComputedRefWithControl<Record<string, DraggableSnapPoint>>;
|
|
38
23
|
mapSnapPoint: (snapPoint: DraggableSnapPoint) => Coordinates | undefined;
|
|
39
24
|
interpolateDragged: (args: InterpolateDraggedArgs) => void;
|
|
@@ -1,30 +1,43 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
ref,
|
|
3
|
+
toRefs,
|
|
4
|
+
computed,
|
|
5
|
+
toValue,
|
|
6
|
+
nextTick
|
|
7
|
+
} from "vue";
|
|
2
8
|
import { computedWithControl } from "@vueuse/core";
|
|
3
9
|
import { interpolate } from "@maas/vue-equipment/utils";
|
|
4
10
|
import { useMagicEmitter } from "@maas/vue-equipment/plugins";
|
|
5
11
|
import { defu } from "defu";
|
|
12
|
+
import { useDraggableState } from "./useDraggableState.mjs";
|
|
6
13
|
export function useDraggableSnap(args) {
|
|
14
|
+
const { id, animation, snapPoints } = args;
|
|
15
|
+
const { initializeState } = useDraggableState(toValue(id));
|
|
16
|
+
const state = initializeState();
|
|
7
17
|
const {
|
|
8
|
-
id,
|
|
9
|
-
draggedX,
|
|
10
|
-
draggedY,
|
|
11
18
|
lastDraggedX,
|
|
12
19
|
lastDraggedY,
|
|
20
|
+
draggedX,
|
|
21
|
+
draggedY,
|
|
13
22
|
elRect,
|
|
14
23
|
wrapperRect,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
} = args;
|
|
24
|
+
activeSnapPoint
|
|
25
|
+
} = toRefs(state);
|
|
18
26
|
const interpolationIdX = ref(void 0);
|
|
19
27
|
const interpolationIdY = ref(void 0);
|
|
20
|
-
const
|
|
28
|
+
const mappedActiveSnapPoint = computed(() => {
|
|
29
|
+
if (!activeSnapPoint.value) {
|
|
30
|
+
return void 0;
|
|
31
|
+
}
|
|
32
|
+
return mapSnapPoint(activeSnapPoint.value);
|
|
33
|
+
});
|
|
21
34
|
const mappedSnapPoints = computedWithControl(
|
|
22
35
|
() => toValue(wrapperRect),
|
|
23
36
|
() => {
|
|
24
37
|
const mapped = toValue(snapPoints).map((snapPoint) => {
|
|
25
38
|
return mapSnapPoint(snapPoint);
|
|
26
39
|
}).filter((snapPoint) => snapPoint !== void 0);
|
|
27
|
-
return mapped;
|
|
40
|
+
return mapped ?? [];
|
|
28
41
|
}
|
|
29
42
|
);
|
|
30
43
|
const snapPointsMap = computedWithControl(
|
|
@@ -54,60 +67,65 @@ export function useDraggableSnap(args) {
|
|
|
54
67
|
const mappedSnapPoint = typeof snapPoint === "string" ? [snapPoint] : snapPoint;
|
|
55
68
|
const [position, offset] = mappedSnapPoint;
|
|
56
69
|
const mappedOffset = defu(offset, { x: 0, y: 0 });
|
|
70
|
+
let x = 0;
|
|
71
|
+
let y = 0;
|
|
57
72
|
switch (position) {
|
|
58
|
-
case "top-left":
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
case "top":
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
case "top-right":
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
case "left":
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
case "center":
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
case "right":
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
case "bottom-left":
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
case "bottom":
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
case "bottom-right":
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
73
|
+
case "top-left": {
|
|
74
|
+
x = mappedOffset.x;
|
|
75
|
+
y = mappedOffset.y;
|
|
76
|
+
break;
|
|
77
|
+
}
|
|
78
|
+
case "top": {
|
|
79
|
+
x = wrapperRect.value.width / 2 + mappedOffset.x - elRect.value.width / 2;
|
|
80
|
+
y = mappedOffset.y;
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
83
|
+
case "top-right": {
|
|
84
|
+
x = wrapperRect.value.width - mappedOffset.x - elRect.value.width;
|
|
85
|
+
y = mappedOffset.y;
|
|
86
|
+
break;
|
|
87
|
+
}
|
|
88
|
+
case "left": {
|
|
89
|
+
x = mappedOffset.x;
|
|
90
|
+
y = wrapperRect.value.height / 2 + mappedOffset.y - elRect.value.height / 2;
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
case "center": {
|
|
94
|
+
x = wrapperRect.value.width / 2 - elRect.value.width / 2 + mappedOffset.x;
|
|
95
|
+
y = wrapperRect.value.height / 2 - elRect.value.height / 2 + mappedOffset.y;
|
|
96
|
+
break;
|
|
97
|
+
}
|
|
98
|
+
case "right": {
|
|
99
|
+
x = wrapperRect.value.width - mappedOffset.x - elRect.value.width;
|
|
100
|
+
y = wrapperRect.value.height / 2 + mappedOffset.y - elRect.value.height / 2;
|
|
101
|
+
break;
|
|
102
|
+
}
|
|
103
|
+
case "bottom-left": {
|
|
104
|
+
x = mappedOffset.x;
|
|
105
|
+
y = wrapperRect.value.height + mappedOffset.y - elRect.value.height;
|
|
106
|
+
break;
|
|
107
|
+
}
|
|
108
|
+
case "bottom": {
|
|
109
|
+
x = wrapperRect.value.width / 2 + mappedOffset.x - elRect.value.width / 2;
|
|
110
|
+
y = wrapperRect.value.height - mappedOffset.y - elRect.value.height;
|
|
111
|
+
break;
|
|
112
|
+
}
|
|
113
|
+
case "bottom-right": {
|
|
114
|
+
x = wrapperRect.value.width - mappedOffset.x - elRect.value.width;
|
|
115
|
+
y = wrapperRect.value.height - mappedOffset.y - elRect.value.height;
|
|
116
|
+
break;
|
|
117
|
+
}
|
|
103
118
|
}
|
|
119
|
+
return { x: Math.round(x), y: Math.round(y) };
|
|
104
120
|
}
|
|
105
121
|
function cancelInterpolation() {
|
|
106
122
|
if (interpolationIdY.value) {
|
|
107
123
|
cancelAnimationFrame(interpolationIdY.value);
|
|
124
|
+
interpolationIdY.value = void 0;
|
|
108
125
|
}
|
|
109
126
|
if (interpolationIdX.value) {
|
|
110
127
|
cancelAnimationFrame(interpolationIdX.value);
|
|
128
|
+
interpolationIdX.value = void 0;
|
|
111
129
|
}
|
|
112
130
|
}
|
|
113
131
|
function interpolateDragged(args2) {
|
|
@@ -131,8 +149,8 @@ export function useDraggableSnap(args) {
|
|
|
131
149
|
emitter.emit("afterSnap", { id: toValue(id), snapPoint });
|
|
132
150
|
}
|
|
133
151
|
if (draggedY.value === y) {
|
|
134
|
-
|
|
135
|
-
|
|
152
|
+
lastDraggedY.value = y;
|
|
153
|
+
interpolationIdY.value = void 0;
|
|
136
154
|
}
|
|
137
155
|
},
|
|
138
156
|
interpolationIdCallback(id2) {
|
|
@@ -150,8 +168,8 @@ export function useDraggableSnap(args) {
|
|
|
150
168
|
emitter.emit("afterSnap", { id: toValue(id), snapPoint });
|
|
151
169
|
}
|
|
152
170
|
if (draggedX.value === x) {
|
|
153
|
-
lastDraggedX.value =
|
|
154
|
-
|
|
171
|
+
lastDraggedX.value = x;
|
|
172
|
+
interpolationIdX.value = void 0;
|
|
155
173
|
}
|
|
156
174
|
},
|
|
157
175
|
interpolationIdCallback(id2) {
|
|
@@ -181,8 +199,8 @@ export function useDraggableSnap(args) {
|
|
|
181
199
|
activeSnapPoint.value = snapPoint;
|
|
182
200
|
}
|
|
183
201
|
return {
|
|
202
|
+
mappedActiveSnapPoint,
|
|
184
203
|
mappedSnapPoints,
|
|
185
|
-
activeSnapPoint,
|
|
186
204
|
snapPointsMap,
|
|
187
205
|
mapSnapPoint,
|
|
188
206
|
interpolateDragged,
|
|
@@ -101,14 +101,8 @@ const customDefu = createDefu((obj, key, value) => {
|
|
|
101
101
|
}
|
|
102
102
|
});
|
|
103
103
|
const { options = {}, id } = defineProps({
|
|
104
|
-
id: {
|
|
105
|
-
|
|
106
|
-
required: true
|
|
107
|
-
},
|
|
108
|
-
options: {
|
|
109
|
-
type: Object,
|
|
110
|
-
required: false
|
|
111
|
-
}
|
|
104
|
+
id: { type: null, required: true },
|
|
105
|
+
options: { type: Object, required: false }
|
|
112
106
|
});
|
|
113
107
|
const mappedOptions = customDefu(options, defaultOptions);
|
|
114
108
|
const mappedId = toValue(id);
|
|
@@ -40,9 +40,42 @@ declare const mappedOptions: Omit<MagicDrawerOptions, keyof MagicDrawerOptions>
|
|
|
40
40
|
distance: number;
|
|
41
41
|
momentum: number;
|
|
42
42
|
});
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
transition: {
|
|
44
|
+
content?: string;
|
|
45
|
+
backdrop?: string;
|
|
46
|
+
};
|
|
47
|
+
disabled: boolean;
|
|
48
|
+
animation: ({
|
|
49
|
+
snap?: {
|
|
50
|
+
duration?: number;
|
|
51
|
+
easing?: (t: number) => number;
|
|
52
|
+
};
|
|
53
|
+
} & import("../../../../utils/index.js").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/index.js").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
|
+
});
|
|
46
79
|
scrollLock: {
|
|
47
80
|
padding: boolean;
|
|
48
81
|
} | ((boolean | {
|
|
@@ -74,14 +107,6 @@ declare const mappedOptions: Omit<MagicDrawerOptions, keyof MagicDrawerOptions>
|
|
|
74
107
|
} & true, "padding"> & {
|
|
75
108
|
padding: boolean;
|
|
76
109
|
});
|
|
77
|
-
teleport: {
|
|
78
|
-
target?: string;
|
|
79
|
-
disabled?: boolean;
|
|
80
|
-
};
|
|
81
|
-
transition: {
|
|
82
|
-
content?: string;
|
|
83
|
-
backdrop?: string;
|
|
84
|
-
};
|
|
85
110
|
keyListener: ({
|
|
86
111
|
close?: string[] | false;
|
|
87
112
|
} & import("../../../../utils/index.js").RequireAll<{
|
|
@@ -95,40 +120,15 @@ declare const mappedOptions: Omit<MagicDrawerOptions, keyof MagicDrawerOptions>
|
|
|
95
120
|
}>, "close"> & {
|
|
96
121
|
close: (false | string[] | undefined) & (false | string[]);
|
|
97
122
|
});
|
|
98
|
-
position: "
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
duration?: number;
|
|
103
|
-
easing?: (t: number) => number;
|
|
104
|
-
};
|
|
105
|
-
} & import("../../../../utils/index.js").RequireAll<{
|
|
106
|
-
snap?: {
|
|
107
|
-
duration?: number;
|
|
108
|
-
easing?: (t: number) => number;
|
|
109
|
-
};
|
|
110
|
-
}>) | (Omit<{
|
|
111
|
-
snap?: {
|
|
112
|
-
duration?: number;
|
|
113
|
-
easing?: (t: number) => number;
|
|
114
|
-
};
|
|
115
|
-
}, "snap"> & Omit<{
|
|
116
|
-
snap?: {
|
|
117
|
-
duration?: number;
|
|
118
|
-
easing?: (t: number) => number;
|
|
119
|
-
};
|
|
120
|
-
} & import("../../../../utils/index.js").RequireAll<{
|
|
121
|
-
snap?: {
|
|
122
|
-
duration?: number;
|
|
123
|
-
easing?: (t: number) => number;
|
|
124
|
-
};
|
|
125
|
-
}>, "snap"> & {
|
|
126
|
-
snap: {
|
|
127
|
-
duration?: number;
|
|
128
|
-
easing?: (t: number) => number;
|
|
129
|
-
};
|
|
130
|
-
});
|
|
123
|
+
position: "left" | "top" | "right" | "bottom";
|
|
124
|
+
backdrop: boolean;
|
|
125
|
+
tag: "div" | "dialog";
|
|
126
|
+
focusTrap: boolean | import("focus-trap").Options;
|
|
131
127
|
snapPoints: import("../types/index.js").DrawerSnapPoint[];
|
|
128
|
+
teleport: {
|
|
129
|
+
target?: string;
|
|
130
|
+
disabled?: boolean;
|
|
131
|
+
};
|
|
132
132
|
initial: {
|
|
133
133
|
open?: boolean;
|
|
134
134
|
transition?: boolean;
|
|
@@ -21,14 +21,8 @@ import { useTemplateRef, onMounted, onBeforeUnmount } from "vue";
|
|
|
21
21
|
import { useMarqueeApi } from "../composables/private/useMarqueeApi";
|
|
22
22
|
import { useMarqueeState } from "../composables/private/useMarqueeState";
|
|
23
23
|
const { id, options } = defineProps({
|
|
24
|
-
id: {
|
|
25
|
-
|
|
26
|
-
required: true
|
|
27
|
-
},
|
|
28
|
-
options: {
|
|
29
|
-
type: Object,
|
|
30
|
-
required: false
|
|
31
|
-
}
|
|
24
|
+
id: { type: null, required: true },
|
|
25
|
+
options: { type: Object, required: false }
|
|
32
26
|
});
|
|
33
27
|
const { deleteState, initializeState } = useMarqueeState(id);
|
|
34
28
|
initializeState(options);
|
|
@@ -23,14 +23,8 @@ import {
|
|
|
23
23
|
} from "../symbols";
|
|
24
24
|
import { useMenuState } from "../composables/private/useMenuState";
|
|
25
25
|
const { transition, id } = defineProps({
|
|
26
|
-
id: {
|
|
27
|
-
|
|
28
|
-
required: true
|
|
29
|
-
},
|
|
30
|
-
transition: {
|
|
31
|
-
type: String,
|
|
32
|
-
required: false
|
|
33
|
-
}
|
|
26
|
+
id: { type: String, required: true },
|
|
27
|
+
transition: { type: String, required: false }
|
|
34
28
|
});
|
|
35
29
|
const instanceId = inject(MagicMenuInstanceId, void 0);
|
|
36
30
|
const viewId = inject(MagicMenuViewId, void 0);
|
|
@@ -83,23 +83,10 @@ defineOptions({
|
|
|
83
83
|
inheritAttrs: false
|
|
84
84
|
});
|
|
85
85
|
const { arrow = void 0, transition } = defineProps({
|
|
86
|
-
arrow: {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
},
|
|
91
|
-
middleware: {
|
|
92
|
-
type: Array,
|
|
93
|
-
required: false
|
|
94
|
-
},
|
|
95
|
-
transition: {
|
|
96
|
-
type: String,
|
|
97
|
-
required: false
|
|
98
|
-
},
|
|
99
|
-
referenceEl: {
|
|
100
|
-
type: null,
|
|
101
|
-
required: false
|
|
102
|
-
}
|
|
86
|
+
arrow: { type: Boolean, required: false, skipCheck: true },
|
|
87
|
+
middleware: { type: Array, required: false },
|
|
88
|
+
transition: { type: String, required: false },
|
|
89
|
+
referenceEl: { type: null, required: false }
|
|
103
90
|
});
|
|
104
91
|
const instanceId = inject(MagicMenuInstanceId, void 0);
|
|
105
92
|
const viewId = inject(MagicMenuViewId, void 0);
|
|
@@ -41,22 +41,10 @@ import { useMenuView } from "../composables/private/useMenuView";
|
|
|
41
41
|
import { useMenuState } from "../composables/private/useMenuState";
|
|
42
42
|
import { ModeFloatingStrategy } from "../utils/modeFloatingStrategyDefaults";
|
|
43
43
|
const { placement, middleware, arrow, referenceEl } = defineProps({
|
|
44
|
-
placement: {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
middleware: {
|
|
49
|
-
type: Array,
|
|
50
|
-
required: false
|
|
51
|
-
},
|
|
52
|
-
arrow: {
|
|
53
|
-
type: Boolean,
|
|
54
|
-
required: false
|
|
55
|
-
},
|
|
56
|
-
referenceEl: {
|
|
57
|
-
type: null,
|
|
58
|
-
required: false
|
|
59
|
-
}
|
|
44
|
+
placement: { type: null, required: false },
|
|
45
|
+
middleware: { type: Array, required: false },
|
|
46
|
+
arrow: { type: Boolean, required: false },
|
|
47
|
+
referenceEl: { type: null, required: false }
|
|
60
48
|
});
|
|
61
49
|
const elRef = useTemplateRef("el");
|
|
62
50
|
const arrowRef = useTemplateRef("arrow");
|
|
@@ -29,14 +29,8 @@ import {
|
|
|
29
29
|
MagicMenuItemActive
|
|
30
30
|
} from "../symbols";
|
|
31
31
|
const { id, disabled } = defineProps({
|
|
32
|
-
id: {
|
|
33
|
-
|
|
34
|
-
required: false
|
|
35
|
-
},
|
|
36
|
-
disabled: {
|
|
37
|
-
type: Boolean,
|
|
38
|
-
required: false
|
|
39
|
-
}
|
|
32
|
+
id: { type: String, required: false },
|
|
33
|
+
disabled: { type: Boolean, required: false }
|
|
40
34
|
});
|
|
41
35
|
const emit = defineEmits(["click"]);
|
|
42
36
|
const instanceId = inject(MagicMenuInstanceId, void 0);
|
|
@@ -10,7 +10,7 @@ declare function guardedUnselect(): void;
|
|
|
10
10
|
declare function onClick(event: MouseEvent): void;
|
|
11
11
|
declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
|
|
12
12
|
declare var __VLS_1: {
|
|
13
|
-
itemActive:
|
|
13
|
+
itemActive: any;
|
|
14
14
|
itemDisabled: boolean;
|
|
15
15
|
};
|
|
16
16
|
type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
|
|
@@ -27,18 +27,9 @@ import { useMenuKeyListener } from "../composables/private/useMenuKeyListener";
|
|
|
27
27
|
import { MagicMenuInstanceId } from "../symbols";
|
|
28
28
|
import { defaultOptions } from "../utils/defaultOptions";
|
|
29
29
|
const { id, options } = defineProps({
|
|
30
|
-
id: {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
},
|
|
34
|
-
asChild: {
|
|
35
|
-
type: Boolean,
|
|
36
|
-
required: false
|
|
37
|
-
},
|
|
38
|
-
options: {
|
|
39
|
-
type: Object,
|
|
40
|
-
required: false
|
|
41
|
-
}
|
|
30
|
+
id: { type: null, required: true },
|
|
31
|
+
asChild: { type: Boolean, required: false },
|
|
32
|
+
options: { type: Object, required: false }
|
|
42
33
|
});
|
|
43
34
|
const elRef = useTemplateRef("el");
|
|
44
35
|
const mappedOptions = defu(options, defaultOptions);
|
|
@@ -20,30 +20,12 @@ import { useMenuChannel } from "../composables/private/useMenuChannel";
|
|
|
20
20
|
import { MagicMenuInstanceId, MagicMenuViewId } from "../symbols";
|
|
21
21
|
import { useMenuRemote } from "../composables/private/useMenuRemote";
|
|
22
22
|
const { disabled, channelId, instanceId, viewId, trigger } = defineProps({
|
|
23
|
-
channelId: {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
required: false
|
|
30
|
-
},
|
|
31
|
-
instanceId: {
|
|
32
|
-
type: String,
|
|
33
|
-
required: false
|
|
34
|
-
},
|
|
35
|
-
disabled: {
|
|
36
|
-
type: Boolean,
|
|
37
|
-
required: false
|
|
38
|
-
},
|
|
39
|
-
trigger: {
|
|
40
|
-
type: Array,
|
|
41
|
-
required: false
|
|
42
|
-
},
|
|
43
|
-
asChild: {
|
|
44
|
-
type: Boolean,
|
|
45
|
-
required: false
|
|
46
|
-
}
|
|
23
|
+
channelId: { type: String, required: true },
|
|
24
|
+
viewId: { type: String, required: false },
|
|
25
|
+
instanceId: { type: String, required: false },
|
|
26
|
+
disabled: { type: Boolean, required: false },
|
|
27
|
+
trigger: { type: Array, required: false },
|
|
28
|
+
asChild: { type: Boolean, required: false }
|
|
47
29
|
});
|
|
48
30
|
const injectedInstanceId = inject(MagicMenuInstanceId, instanceId);
|
|
49
31
|
const injectedViewId = inject(MagicMenuViewId, viewId);
|
|
@@ -12,7 +12,7 @@ declare const onClick: () => void, onMouseenter: () => void;
|
|
|
12
12
|
declare let channel: import("../types/index.js").MenuChannel;
|
|
13
13
|
declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
|
|
14
14
|
declare var __VLS_11: {
|
|
15
|
-
channelActive:
|
|
15
|
+
channelActive: any;
|
|
16
16
|
remoteDisabled: boolean;
|
|
17
17
|
};
|
|
18
18
|
type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
|
|
@@ -29,26 +29,11 @@ import {
|
|
|
29
29
|
} from "../symbols";
|
|
30
30
|
import { onKeyStroke } from "@vueuse/core";
|
|
31
31
|
const { instanceId, viewId, disabled, trigger } = defineProps({
|
|
32
|
-
instanceId: {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
},
|
|
36
|
-
|
|
37
|
-
type: String,
|
|
38
|
-
required: false
|
|
39
|
-
},
|
|
40
|
-
disabled: {
|
|
41
|
-
type: Boolean,
|
|
42
|
-
required: false
|
|
43
|
-
},
|
|
44
|
-
trigger: {
|
|
45
|
-
type: Array,
|
|
46
|
-
required: false
|
|
47
|
-
},
|
|
48
|
-
asChild: {
|
|
49
|
-
type: Boolean,
|
|
50
|
-
required: false
|
|
51
|
-
}
|
|
32
|
+
instanceId: { type: String, required: false },
|
|
33
|
+
viewId: { type: String, required: false },
|
|
34
|
+
disabled: { type: Boolean, required: false },
|
|
35
|
+
trigger: { type: Array, required: false },
|
|
36
|
+
asChild: { type: Boolean, required: false }
|
|
52
37
|
});
|
|
53
38
|
const elRef = useTemplateRef("el");
|
|
54
39
|
const injectedInstanceId = inject(MagicMenuInstanceId, void 0);
|
|
@@ -14,8 +14,8 @@ declare const mappedTabindex: import("vue").ComputedRef<0 | undefined>;
|
|
|
14
14
|
declare const onMouseenter: () => void, onClick: (e: MouseEvent) => void;
|
|
15
15
|
declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
|
|
16
16
|
declare var __VLS_13: {
|
|
17
|
-
viewActive:
|
|
18
|
-
triggerDisabled:
|
|
17
|
+
viewActive: any;
|
|
18
|
+
triggerDisabled: any;
|
|
19
19
|
};
|
|
20
20
|
type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
|
|
21
21
|
default?: (props: typeof __VLS_13) => any;
|
|
@@ -16,14 +16,8 @@ import {
|
|
|
16
16
|
} from "../symbols";
|
|
17
17
|
import { useMenuState } from "../composables/private/useMenuState";
|
|
18
18
|
const { id, placement } = defineProps({
|
|
19
|
-
id: {
|
|
20
|
-
|
|
21
|
-
required: false
|
|
22
|
-
},
|
|
23
|
-
placement: {
|
|
24
|
-
type: null,
|
|
25
|
-
required: false
|
|
26
|
-
}
|
|
19
|
+
id: { type: String, required: false },
|
|
20
|
+
placement: { type: null, required: false }
|
|
27
21
|
});
|
|
28
22
|
const parentTree = inject(MagicMenuParentTree, []);
|
|
29
23
|
const instanceId = inject(MagicMenuInstanceId, void 0);
|
|
@@ -7,7 +7,7 @@ declare const mappedId: import("vue").ComputedRef<string>;
|
|
|
7
7
|
declare const view: import("../types/index.js").MenuView;
|
|
8
8
|
declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
|
|
9
9
|
declare var __VLS_1: {
|
|
10
|
-
viewActive:
|
|
10
|
+
viewActive: any;
|
|
11
11
|
};
|
|
12
12
|
type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
|
|
13
13
|
default?: (props: typeof __VLS_1) => any;
|
|
@@ -74,18 +74,9 @@ const customDefu = createDefu((obj, key, value) => {
|
|
|
74
74
|
}
|
|
75
75
|
});
|
|
76
76
|
const { id, options = {} } = defineProps({
|
|
77
|
-
id: {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
},
|
|
81
|
-
props: {
|
|
82
|
-
type: Object,
|
|
83
|
-
required: false
|
|
84
|
-
},
|
|
85
|
-
options: {
|
|
86
|
-
type: Object,
|
|
87
|
-
required: false
|
|
88
|
-
}
|
|
77
|
+
id: { type: null, required: true },
|
|
78
|
+
props: { type: Object, required: false },
|
|
79
|
+
options: { type: Object, required: false }
|
|
89
80
|
});
|
|
90
81
|
const mappedOptions = customDefu(options, defaultOptions);
|
|
91
82
|
const mappedId = toValue(id);
|