@maas/vue-equipment 0.27.0 → 0.27.2
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 +1 -1
- package/dist/nuxt/module.mjs +1 -1
- package/dist/plugins/MagicDraggable/index.d.ts +2 -0
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableDrag.mjs +10 -0
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableSnap.d.ts +1 -1
- package/dist/plugins/MagicDraggable/src/types/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/nuxt/module.json
CHANGED
package/dist/nuxt/module.mjs
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { Plugin } from 'vue';
|
|
2
2
|
import MagicDraggable from './src/components/MagicDraggable.vue.js';
|
|
3
3
|
import { useDraggableApi } from './src/composables/useDraggableApi.js';
|
|
4
|
+
import type { DraggableOptions } from './src/types.js';
|
|
4
5
|
declare const MagicDraggablePlugin: Plugin;
|
|
5
6
|
export { MagicDraggablePlugin, MagicDraggable, useDraggableApi };
|
|
7
|
+
export type { DraggableOptions };
|
|
@@ -276,6 +276,7 @@ export function useDraggableDrag(args) {
|
|
|
276
276
|
}
|
|
277
277
|
await nextTick();
|
|
278
278
|
if (toValue(initial).snapPoint) {
|
|
279
|
+
activeSnapPoint.value = toValue(initial).snapPoint;
|
|
279
280
|
const mappedSnapPoint = mapSnapPoint(toValue(initial).snapPoint);
|
|
280
281
|
if (mappedSnapPoint) {
|
|
281
282
|
draggedX.value = mappedSnapPoint.x;
|
|
@@ -292,6 +293,15 @@ export function useDraggableDrag(args) {
|
|
|
292
293
|
}
|
|
293
294
|
}, 100)();
|
|
294
295
|
});
|
|
296
|
+
useResizeObserver(elRef, async () => {
|
|
297
|
+
useThrottleFn(async () => {
|
|
298
|
+
await getSizes();
|
|
299
|
+
if (activeSnapPoint.value) {
|
|
300
|
+
await snapTo({ snapPoint: activeSnapPoint.value, interpolate: false });
|
|
301
|
+
snapPointsMap.trigger();
|
|
302
|
+
}
|
|
303
|
+
}, 100)();
|
|
304
|
+
});
|
|
295
305
|
const { idle } = useIdle(toValue(threshold).idle);
|
|
296
306
|
watch(idle, (value) => {
|
|
297
307
|
if (value && dragging.value) {
|
|
@@ -22,7 +22,7 @@ type SnapToArgs = {
|
|
|
22
22
|
};
|
|
23
23
|
export declare function useDraggableSnap(args: UseDraggableSnapArgs): {
|
|
24
24
|
mappedSnapPoints: import("@vueuse/core").ComputedRefWithControl<Coordinates[]>;
|
|
25
|
-
activeSnapPoint: Ref<("center" | "top-
|
|
25
|
+
activeSnapPoint: Ref<("center" | "top-left" | "top-center" | "top-right" | "center-left" | "center-right" | "bottom-left" | "bottom-center" | "bottom-right") | ["center" | "top-left" | "top-center" | "top-right" | "center-left" | "center-right" | "bottom-left" | "bottom-center" | "bottom-right", offset?: {
|
|
26
26
|
x?: number | undefined;
|
|
27
27
|
y?: number | undefined;
|
|
28
28
|
} | undefined] | undefined>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maas/vue-equipment",
|
|
3
3
|
"description": "A magic collection of Vue composables, plugins, components and directives",
|
|
4
|
-
"version": "0.27.
|
|
4
|
+
"version": "0.27.2",
|
|
5
5
|
"author": "Robin Scholz <https://github.com/robinscholz>, Christoph Jeworutzki <https://github.com/ChristophJeworutzki>",
|
|
6
6
|
"devDependencies": {
|
|
7
7
|
"@antfu/ni": "^0.21.12",
|