@maas/vue-equipment 0.21.0 → 0.21.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
CHANGED
|
@@ -55,7 +55,17 @@ export function useDrawerDrag(args) {
|
|
|
55
55
|
const draggedX = ref(0);
|
|
56
56
|
const draggedY = ref(0);
|
|
57
57
|
const hasDragged = computed(() => {
|
|
58
|
-
|
|
58
|
+
const hasDraggedX = !isWithinRange({
|
|
59
|
+
input: draggedX.value,
|
|
60
|
+
base: lastDraggedX.value,
|
|
61
|
+
threshold: toValue(threshold).lock
|
|
62
|
+
});
|
|
63
|
+
const hasDraggedY = !isWithinRange({
|
|
64
|
+
input: draggedY.value,
|
|
65
|
+
base: lastDraggedY.value,
|
|
66
|
+
threshold: toValue(threshold).lock
|
|
67
|
+
});
|
|
68
|
+
return hasDraggedX || hasDraggedY;
|
|
59
69
|
});
|
|
60
70
|
const style = computed(
|
|
61
71
|
() => `transform: translate(${draggedX.value}px, ${draggedY.value}px)`
|
|
@@ -87,6 +97,10 @@ export function useDrawerDrag(args) {
|
|
|
87
97
|
position,
|
|
88
98
|
activeSnapPoint
|
|
89
99
|
});
|
|
100
|
+
function isWithinRange(args2) {
|
|
101
|
+
const { input, base, threshold: threshold2 } = args2;
|
|
102
|
+
return input >= base - threshold2 && input <= base + threshold2;
|
|
103
|
+
}
|
|
90
104
|
async function getSizes() {
|
|
91
105
|
elRect.value = unrefElement(elRef)?.getBoundingClientRect();
|
|
92
106
|
wrapperRect.value = unrefElement(wrapperRef)?.getBoundingClientRect();
|
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.21.
|
|
4
|
+
"version": "0.21.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",
|