@maas/vue-equipment 0.27.0 → 0.27.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.
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@maas/vue-equipment/nuxt",
3
3
  "configKey": "vueEquipment",
4
- "version": "0.26.5"
4
+ "version": "0.27.0"
5
5
  }
@@ -18,7 +18,7 @@ const functions$1 = [
18
18
  {
19
19
  name: "MagicDraggable",
20
20
  "package": "plugins",
21
- lastUpdated: 1712936178000,
21
+ lastUpdated: 1714995800000,
22
22
  docs: "https://maas.egineering/vue-equipment/plugins/MagicDraggable/",
23
23
  description: "draggable"
24
24
  },
@@ -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 };
@@ -292,6 +292,15 @@ export function useDraggableDrag(args) {
292
292
  }
293
293
  }, 100)();
294
294
  });
295
+ useResizeObserver(elRef, async () => {
296
+ useThrottleFn(async () => {
297
+ await getSizes();
298
+ if (activeSnapPoint.value) {
299
+ await snapTo({ snapPoint: activeSnapPoint.value, interpolate: false });
300
+ snapPointsMap.trigger();
301
+ }
302
+ }, 100)();
303
+ });
295
304
  const { idle } = useIdle(toValue(threshold).idle);
296
305
  watch(idle, (value) => {
297
306
  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-center" | "bottom-center" | "top-left" | "top-right" | "center-left" | "center-right" | "bottom-left" | "bottom-right") | ["center" | "top-center" | "bottom-center" | "top-left" | "top-right" | "center-left" | "center-right" | "bottom-left" | "bottom-right", offset?: {
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.0",
4
+ "version": "0.27.1",
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",