@maas/vue-equipment 0.28.2 → 0.28.4
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/plugins/MagicCommand/src/components/MagicCommandProvider.vue +0 -3
- package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue.d.ts +0 -2
- package/dist/plugins/MagicDraggable/nuxt.mjs +1 -5
- package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue +1 -0
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDrag.d.ts +1 -0
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDrag.mjs +27 -0
- package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue +8 -4
- package/package.json +1 -1
package/dist/nuxt/module.json
CHANGED
|
@@ -14,9 +14,6 @@ import { MagicCommandInstanceId, MagicCommandOptions } from '../symbols'
|
|
|
14
14
|
|
|
15
15
|
import type { CommandOptions } from './../types/index'
|
|
16
16
|
|
|
17
|
-
import '@maas/vue-equipment/utils/css/animations/fade-in.css'
|
|
18
|
-
import '@maas/vue-equipment/utils/css/animations/fade-out.css'
|
|
19
|
-
|
|
20
17
|
// Prevent keys arrays from being merged with default
|
|
21
18
|
const customDefu = createDefu((obj, key, value) => {
|
|
22
19
|
if (key === 'open' || key === 'close' || key === 'next' || key === 'prev') {
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { type MaybeRef } from 'vue';
|
|
2
2
|
import type { CommandOptions } from './../types/index';
|
|
3
|
-
import '@maas/vue-equipment/utils/css/animations/fade-in.css';
|
|
4
|
-
import '@maas/vue-equipment/utils/css/animations/fade-out.css';
|
|
5
3
|
interface MagicCommandProps {
|
|
6
4
|
id: MaybeRef<string>;
|
|
7
5
|
options?: CommandOptions;
|
|
@@ -11,6 +11,7 @@ type UseDrawerDragArgs = {
|
|
|
11
11
|
initial: MaybeRef<DefaultOptions['initial']>;
|
|
12
12
|
animation: MaybeRef<DefaultOptions['animation']>;
|
|
13
13
|
preventDragClose: MaybeRef<DefaultOptions['preventDragClose']>;
|
|
14
|
+
disabled: MaybeRef<boolean>;
|
|
14
15
|
overshoot: MaybeRef<number>;
|
|
15
16
|
close: () => void;
|
|
16
17
|
};
|
|
@@ -32,6 +32,7 @@ export function useDrawerDrag(args) {
|
|
|
32
32
|
initial,
|
|
33
33
|
animation,
|
|
34
34
|
preventDragClose,
|
|
35
|
+
disabled,
|
|
35
36
|
close
|
|
36
37
|
} = args;
|
|
37
38
|
const { findState } = useDrawerState(toValue(id));
|
|
@@ -281,6 +282,24 @@ export function useDrawerDrag(args) {
|
|
|
281
282
|
}
|
|
282
283
|
}
|
|
283
284
|
}
|
|
285
|
+
function onCancel() {
|
|
286
|
+
switch (position) {
|
|
287
|
+
case "bottom":
|
|
288
|
+
case "top":
|
|
289
|
+
interpolateDragged({
|
|
290
|
+
to: snappedY.value
|
|
291
|
+
});
|
|
292
|
+
break;
|
|
293
|
+
case "right":
|
|
294
|
+
case "left":
|
|
295
|
+
interpolateDragged({
|
|
296
|
+
to: snappedX.value
|
|
297
|
+
});
|
|
298
|
+
break;
|
|
299
|
+
}
|
|
300
|
+
resetStateAndListeners();
|
|
301
|
+
resetScrollLock();
|
|
302
|
+
}
|
|
284
303
|
function onPointerup(e) {
|
|
285
304
|
if (shouldClose.value) {
|
|
286
305
|
close();
|
|
@@ -401,6 +420,14 @@ export function useDrawerDrag(args) {
|
|
|
401
420
|
lastDraggedX.value = x;
|
|
402
421
|
lastDraggedY.value = y;
|
|
403
422
|
});
|
|
423
|
+
watch(
|
|
424
|
+
() => toValue(disabled),
|
|
425
|
+
(value) => {
|
|
426
|
+
if (value) {
|
|
427
|
+
onCancel();
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
);
|
|
404
431
|
useResizeObserver(elRef, async () => {
|
|
405
432
|
useThrottleFn(async () => {
|
|
406
433
|
await getSizes();
|
|
@@ -47,10 +47,6 @@ async function calculate() {
|
|
|
47
47
|
progress.value = getProgress()
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
onMounted(() => {
|
|
51
|
-
calculate()
|
|
52
|
-
})
|
|
53
|
-
|
|
54
50
|
watch(
|
|
55
51
|
() => scrollReturn?.y.value,
|
|
56
52
|
() => {
|
|
@@ -60,6 +56,14 @@ watch(
|
|
|
60
56
|
}
|
|
61
57
|
)
|
|
62
58
|
|
|
59
|
+
watch(
|
|
60
|
+
() => scrollReturn?.y.value,
|
|
61
|
+
() => {
|
|
62
|
+
calculate()
|
|
63
|
+
},
|
|
64
|
+
{ once: true }
|
|
65
|
+
)
|
|
66
|
+
|
|
63
67
|
useIntersectionObserver(
|
|
64
68
|
elRef,
|
|
65
69
|
([{ isIntersecting }]) => {
|
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.28.
|
|
4
|
+
"version": "0.28.4",
|
|
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",
|