@maas/vue-equipment 1.4.0 → 1.4.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,7 +1,7 @@
1
1
  {
2
2
  "name": "@maas/vue-equipment/nuxt",
3
3
  "configKey": "vueEquipment",
4
- "version": "1.3.0",
4
+ "version": "1.4.0",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.3",
7
7
  "unbuild": "unknown"
@@ -67,17 +67,23 @@ export function useTrayGesture(args) {
67
67
  (side2) => isDraggableSide({ snapPoints: state.options.snapPoints, side: side2 })
68
68
  );
69
69
  }
70
+ function isOpen(side) {
71
+ return state.dragged[side] > dragBounds(side).min;
72
+ }
70
73
  function resolveSide(sides, dx, dy) {
71
74
  const horizontal = sides.filter((side) => !isVertical(side));
72
75
  const vertical = sides.filter(isVertical);
73
76
  const alongX = horizontal.length > 0 && (!vertical.length || Math.abs(dx) >= Math.abs(dy));
74
77
  const delta = alongX ? dx : dy;
75
- if (Math.abs(delta) <= toValue(threshold).lock) {
78
+ if (delta === 0) {
76
79
  return void 0;
77
80
  }
78
81
  const candidates = alongX ? horizontal : vertical;
79
- const preferred = alongX ? delta > 0 ? "left" : "right" : delta > 0 ? "top" : "bottom";
80
- return candidates.includes(preferred) ? preferred : candidates[0];
82
+ const [opens, closes] = alongX ? delta > 0 ? ["left", "right"] : ["right", "left"] : delta > 0 ? ["top", "bottom"] : ["bottom", "top"];
83
+ if (candidates.includes(closes) && isOpen(closes)) {
84
+ return closes;
85
+ }
86
+ return candidates.includes(opens) ? opens : candidates[0];
81
87
  }
82
88
  function resolvePending(x, y) {
83
89
  if (!pending) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@maas/vue-equipment",
3
3
  "description": "Our Frontend Toolkit, Free and Open Source",
4
- "version": "1.4.0",
4
+ "version": "1.4.1",
5
5
  "contributors": [
6
6
  {
7
7
  "name": "Robin Scholz",