@maas/vue-equipment 0.25.4 → 0.26.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.
- package/dist/nuxt/module.json +1 -1
- package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue +30 -0
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerCallback.d.ts +5 -5
- package/dist/plugins/MagicDrawer/src/composables/useDrawerApi.d.ts +2 -0
- package/dist/plugins/MagicDrawer/src/composables/useDrawerApi.mjs +8 -12
- package/dist/plugins/MagicMarquee/src/components/MagicMarquee.vue +6 -2
- package/dist/plugins/MagicMarquee/src/composables/useMarqueeApi.d.ts +1 -0
- package/dist/plugins/MagicMarquee/src/composables/useMarqueeApi.mjs +6 -5
- package/dist/plugins/MagicModal/src/components/MagicModal.vue +14 -0
- package/dist/plugins/MagicModal/src/composables/private/useModalCallback.d.ts +6 -6
- package/dist/utils/css/transitions/clip.css +2 -2
- package/dist/utils/css/transitions/fade-up.css +2 -3
- package/dist/utils/css/transitions/fade.css +2 -3
- package/dist/utils/css/transitions/slide-btt.css +2 -2
- package/dist/utils/css/transitions/slide-ltr.css +3 -3
- package/dist/utils/css/transitions/slide-rtl.css +2 -3
- package/dist/utils/css/transitions/slide-ttb.css +2 -4
- package/dist/utils/css/transitions/zoom.css +3 -3
- package/package.json +1 -1
package/dist/nuxt/module.json
CHANGED
|
@@ -75,12 +75,15 @@ import {
|
|
|
75
75
|
nextTick,
|
|
76
76
|
toValue,
|
|
77
77
|
onBeforeMount,
|
|
78
|
+
onMounted,
|
|
78
79
|
onBeforeUnmount,
|
|
80
|
+
onUnmounted,
|
|
79
81
|
type Component,
|
|
80
82
|
type MaybeRef,
|
|
81
83
|
} from 'vue'
|
|
82
84
|
import { createDefu } from 'defu'
|
|
83
85
|
import { onKeyStroke, unrefElement } from '@vueuse/core'
|
|
86
|
+
import { useMetaViewport } from '@maas/vue-equipment/composables'
|
|
84
87
|
import { defaultOptions } from './../utils/defaultOptions'
|
|
85
88
|
import { useDrawerApi } from './../composables/useDrawerApi'
|
|
86
89
|
import { useDrawerCallback } from '../composables/private/useDrawerCallback'
|
|
@@ -149,6 +152,8 @@ const {
|
|
|
149
152
|
unlockScroll,
|
|
150
153
|
addScrollLockPadding,
|
|
151
154
|
removeScrollLockPadding,
|
|
155
|
+
initialize,
|
|
156
|
+
destroy,
|
|
152
157
|
} = drawerApi
|
|
153
158
|
|
|
154
159
|
// Make sure this is reactive
|
|
@@ -210,6 +215,8 @@ const {
|
|
|
210
215
|
|
|
211
216
|
useDrawerProgress({ id: props.id, elRef, drawerRef, position, overshoot })
|
|
212
217
|
|
|
218
|
+
const { resetMetaViewport } = useMetaViewport()
|
|
219
|
+
|
|
213
220
|
// Prevent animation on initial mount if the options call for it
|
|
214
221
|
// To achieve this, the transition names are set to undefined
|
|
215
222
|
const preventTransition = computed(() => {
|
|
@@ -332,10 +339,33 @@ onBeforeMount(async () => {
|
|
|
332
339
|
}
|
|
333
340
|
})
|
|
334
341
|
|
|
342
|
+
onMounted(() => {
|
|
343
|
+
initialize()
|
|
344
|
+
})
|
|
345
|
+
|
|
335
346
|
// Reset state on unmount
|
|
336
347
|
onBeforeUnmount(() => {
|
|
337
348
|
close()
|
|
338
349
|
})
|
|
350
|
+
|
|
351
|
+
onUnmounted(() => {
|
|
352
|
+
if (mappedOptions.scrollLock) {
|
|
353
|
+
unlockScroll()
|
|
354
|
+
if (mappedOptions.scrollLockPadding) {
|
|
355
|
+
removeScrollLockPadding()
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
if (mappedOptions.focusTrap) {
|
|
360
|
+
releaseFocus()
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
if (mappedOptions.preventZoom) {
|
|
364
|
+
resetMetaViewport()
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
destroy()
|
|
368
|
+
})
|
|
339
369
|
</script>
|
|
340
370
|
|
|
341
371
|
<style>
|
|
@@ -13,11 +13,11 @@ type UseDrawerCallbackArgs = {
|
|
|
13
13
|
wasActive: Ref<boolean>;
|
|
14
14
|
};
|
|
15
15
|
export declare function useDrawerCallback(args: UseDrawerCallbackArgs): {
|
|
16
|
-
onBeforeEnter: (_el
|
|
17
|
-
onEnter: (_el
|
|
18
|
-
onAfterEnter: (_el
|
|
19
|
-
onBeforeLeave: (_el
|
|
16
|
+
onBeforeEnter: (_el?: Element) => void;
|
|
17
|
+
onEnter: (_el?: Element) => void;
|
|
18
|
+
onAfterEnter: (_el?: Element) => Promise<void>;
|
|
19
|
+
onBeforeLeave: (_el?: Element) => void;
|
|
20
20
|
onLeave: (_el: Element) => void;
|
|
21
|
-
onAfterLeave: (_el
|
|
21
|
+
onAfterLeave: (_el?: Element) => void;
|
|
22
22
|
};
|
|
23
23
|
export {};
|
|
@@ -20,5 +20,7 @@ export declare function useDrawerApi(id?: MaybeRef<string>, options?: UseDrawerA
|
|
|
20
20
|
unlockScroll: () => void;
|
|
21
21
|
addScrollLockPadding: () => void;
|
|
22
22
|
removeScrollLockPadding: () => void;
|
|
23
|
+
initialize: () => void;
|
|
24
|
+
destroy: () => void;
|
|
23
25
|
};
|
|
24
26
|
export type UseDrawerApiReturn = ReturnType<typeof useDrawerApi>;
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ref,
|
|
3
|
-
computed,
|
|
4
|
-
toValue,
|
|
5
|
-
onMounted,
|
|
6
|
-
onBeforeUnmount
|
|
7
|
-
} from "vue";
|
|
1
|
+
import { ref, computed, toValue } from "vue";
|
|
8
2
|
import { defu } from "defu";
|
|
9
3
|
import { useScrollLock } from "@vueuse/core";
|
|
10
4
|
import { useFocusTrap } from "@vueuse/integrations/useFocusTrap";
|
|
@@ -86,12 +80,12 @@ export function useDrawerApi(id, options) {
|
|
|
86
80
|
(elem) => elem.style.paddingRight = ""
|
|
87
81
|
);
|
|
88
82
|
}
|
|
89
|
-
|
|
83
|
+
function initialize() {
|
|
90
84
|
useDrawerEmitter().on("progress", progressCallback);
|
|
91
|
-
}
|
|
92
|
-
|
|
85
|
+
}
|
|
86
|
+
function destroy() {
|
|
93
87
|
useDrawerEmitter().off("progress", progressCallback);
|
|
94
|
-
}
|
|
88
|
+
}
|
|
95
89
|
return {
|
|
96
90
|
id: mappedId,
|
|
97
91
|
isActive,
|
|
@@ -104,6 +98,8 @@ export function useDrawerApi(id, options) {
|
|
|
104
98
|
lockScroll,
|
|
105
99
|
unlockScroll,
|
|
106
100
|
addScrollLockPadding,
|
|
107
|
-
removeScrollLockPadding
|
|
101
|
+
removeScrollLockPadding,
|
|
102
|
+
initialize,
|
|
103
|
+
destroy
|
|
108
104
|
};
|
|
109
105
|
}
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
</template>
|
|
17
17
|
|
|
18
18
|
<script setup lang="ts">
|
|
19
|
-
import { ref, computed } from 'vue'
|
|
19
|
+
import { ref, computed, onMounted } from 'vue'
|
|
20
20
|
import { useMarqueeApi } from '../composables/useMarqueeApi'
|
|
21
21
|
|
|
22
22
|
interface Props {
|
|
@@ -32,7 +32,7 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
32
32
|
const parentRef = ref<HTMLElement | undefined>(undefined)
|
|
33
33
|
const childRef = ref<HTMLElement | undefined>(undefined)
|
|
34
34
|
|
|
35
|
-
const { duplicates, playing, play, pause } = useMarqueeApi({
|
|
35
|
+
const { duplicates, playing, play, pause, initialize } = useMarqueeApi({
|
|
36
36
|
child: childRef,
|
|
37
37
|
parent: parentRef,
|
|
38
38
|
options: {
|
|
@@ -41,6 +41,10 @@ const { duplicates, playing, play, pause } = useMarqueeApi({
|
|
|
41
41
|
},
|
|
42
42
|
})
|
|
43
43
|
|
|
44
|
+
onMounted(() => {
|
|
45
|
+
initialize()
|
|
46
|
+
})
|
|
47
|
+
|
|
44
48
|
defineExpose({
|
|
45
49
|
playing,
|
|
46
50
|
play,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ref,
|
|
1
|
+
import { ref, computed, nextTick, watch } from "vue";
|
|
2
2
|
import {
|
|
3
3
|
useElementBounding,
|
|
4
4
|
useElementSize,
|
|
@@ -51,11 +51,11 @@ export function useMarqueeApi({ child, parent, options }) {
|
|
|
51
51
|
"running"
|
|
52
52
|
);
|
|
53
53
|
}
|
|
54
|
-
|
|
54
|
+
async function initialize() {
|
|
55
55
|
calculateDuplicates();
|
|
56
|
-
nextTick();
|
|
56
|
+
await nextTick();
|
|
57
57
|
setCssVariables();
|
|
58
|
-
}
|
|
58
|
+
}
|
|
59
59
|
watch(
|
|
60
60
|
width,
|
|
61
61
|
useThrottleFn(() => {
|
|
@@ -84,6 +84,7 @@ export function useMarqueeApi({ child, parent, options }) {
|
|
|
84
84
|
duplicates,
|
|
85
85
|
playing,
|
|
86
86
|
play,
|
|
87
|
-
pause
|
|
87
|
+
pause,
|
|
88
|
+
initialize
|
|
88
89
|
};
|
|
89
90
|
}
|
|
@@ -60,6 +60,7 @@ import {
|
|
|
60
60
|
nextTick,
|
|
61
61
|
toValue,
|
|
62
62
|
onBeforeUnmount,
|
|
63
|
+
onUnmounted,
|
|
63
64
|
type Component,
|
|
64
65
|
type MaybeRef,
|
|
65
66
|
} from 'vue'
|
|
@@ -167,6 +168,19 @@ watch(isActive, async (value) => {
|
|
|
167
168
|
onBeforeUnmount(() => {
|
|
168
169
|
close()
|
|
169
170
|
})
|
|
171
|
+
|
|
172
|
+
onUnmounted(() => {
|
|
173
|
+
if (mappedOptions.scrollLock) {
|
|
174
|
+
unlockScroll()
|
|
175
|
+
if (mappedOptions.scrollLockPadding) {
|
|
176
|
+
removeScrollLockPadding()
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
if (mappedOptions.focusTrap) {
|
|
181
|
+
releaseFocus()
|
|
182
|
+
}
|
|
183
|
+
})
|
|
170
184
|
</script>
|
|
171
185
|
|
|
172
186
|
<style>
|
|
@@ -12,11 +12,11 @@ type UseModalCallbackArgs = {
|
|
|
12
12
|
wrapperActive: Ref<boolean>;
|
|
13
13
|
};
|
|
14
14
|
export declare function useModalCallback(args: UseModalCallbackArgs): {
|
|
15
|
-
onBeforeEnter: (_el
|
|
16
|
-
onEnter: (_el
|
|
17
|
-
onAfterEnter: (_el
|
|
18
|
-
onBeforeLeave: (_el
|
|
19
|
-
onLeave: (_el
|
|
20
|
-
onAfterLeave: (_el
|
|
15
|
+
onBeforeEnter: (_el?: Element) => void;
|
|
16
|
+
onEnter: (_el?: Element) => void;
|
|
17
|
+
onAfterEnter: (_el?: Element) => Promise<void>;
|
|
18
|
+
onBeforeLeave: (_el?: Element) => void;
|
|
19
|
+
onLeave: (_el?: Element) => void;
|
|
20
|
+
onAfterLeave: (_el?: Element) => void;
|
|
21
21
|
};
|
|
22
22
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
.clip-enter-active {
|
|
2
|
-
animation: clip-in
|
|
2
|
+
animation: clip-in var(--duration, 600ms) var(--easing, cubic-bezier(0.83, 0, 0.17, 1)) forwards;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
.clip-leave-active {
|
|
6
|
-
animation: clip-out
|
|
6
|
+
animation: clip-out var(--duration, 600ms) var(--easing, cubic-bezier(0.83, 0, 0.17, 1)) forwards;
|
|
7
7
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
.fade-up-enter-active {
|
|
2
|
-
animation: fade-up-in 300ms
|
|
2
|
+
animation: fade-up-in var(--duration, 300ms) var(--easing, cubic-bezier(0.45, 0, 0.55, 1));
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
.fade-up-leave-active {
|
|
6
|
-
animation: fade-up-out 300ms
|
|
6
|
+
animation: fade-up-out var(--duration, 300ms) var(--easing, cubic-bezier(0.45, 0, 0.55, 1));
|
|
7
7
|
}
|
|
8
|
-
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
.fade-enter-active {
|
|
2
|
-
animation: fade-in 300ms
|
|
2
|
+
animation: fade-in var(--duration, 300ms) var(--easing, cubic-bezier(0.45, 0, 0.55, 1));
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
.fade-leave-active {
|
|
6
|
-
animation: fade-out 300ms
|
|
6
|
+
animation: fade-out var(--duration, 300ms) var(--easing, cubic-bezier(0.45, 0, 0.55, 1));
|
|
7
7
|
}
|
|
8
|
-
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
.slide-btt-enter-active {
|
|
2
|
-
animation: slide-btt-in 300ms
|
|
2
|
+
animation: slide-btt-in var(--duration, 300ms) var(--easing, cubic-bezier(0.45, 0, 0.55, 1));
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
.slide-btt-leave-active {
|
|
6
|
-
animation: slide-btt-out 300ms
|
|
6
|
+
animation: slide-btt-out var(--duration, 300ms) var(--easing, cubic-bezier(0.45, 0, 0.55, 1));
|
|
7
7
|
}
|
|
8
8
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
.slide-ltr-enter-active {
|
|
2
|
-
animation: slide-ltr-in 300ms
|
|
2
|
+
animation: slide-ltr-in var(--duration, 300ms) var(--easing, cubic-bezier(0.45, 0, 0.55, 1));
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
.slide-ltr-leave-active {
|
|
6
|
-
animation: slide-ltr-out 300ms
|
|
7
|
-
}
|
|
6
|
+
animation: slide-ltr-out var(--duration, 300ms) var(--easing, cubic-bezier(0.45, 0, 0.55, 1));
|
|
7
|
+
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
.slide-rtl-enter-active {
|
|
2
|
-
animation: slide-rtl-in 300ms
|
|
2
|
+
animation: slide-rtl-in var(--duration, 300ms) var(--easing, cubic-bezier(0.45, 0, 0.55, 1));
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
.slide-rtl-leave-active {
|
|
6
|
-
animation: slide-rtl-out 300ms
|
|
6
|
+
animation: slide-rtl-out var(--duration, 300ms) var(--easing, cubic-bezier(0.45, 0, 0.55, 1));
|
|
7
7
|
}
|
|
8
|
-
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
.slide-ttb-enter-active {
|
|
2
|
-
animation: slide-ttb-in 300ms
|
|
2
|
+
animation: slide-ttb-in var(--duration, 300ms) var(--easing, cubic-bezier(0.45, 0, 0.55, 1));
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
.slide-ttb-leave-active {
|
|
6
|
-
animation: slide-ttb-out 300ms
|
|
6
|
+
animation: slide-ttb-out var(--duration, 300ms) var(--easing, cubic-bezier(0.45, 0, 0.55, 1));
|
|
7
7
|
}
|
|
8
|
-
|
|
9
|
-
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
.zoom-enter-active {
|
|
2
|
-
animation: zoom-in 300ms
|
|
2
|
+
animation: zoom-in var(--duration, 300ms) var(--easing, cubic-bezier(0.45, 0, 0.55, 1));
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
.zoom-leave-active {
|
|
6
|
-
animation: zoom-out 300ms
|
|
7
|
-
}
|
|
6
|
+
animation: zoom-out var(--duration, 300ms) var(--easing, cubic-bezier(0.45, 0, 0.55, 1));
|
|
7
|
+
}
|
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.
|
|
4
|
+
"version": "0.26.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",
|