@maas/vue-equipment 0.4.2 → 0.6.0
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/composables/index.js.map +1 -1
- package/dist/composables/index.mjs.map +1 -1
- package/dist/nuxt/module.json +1 -1
- package/dist/nuxt/module.mjs +23 -2
- package/dist/plugins/MagicMarquee/index.d.ts +3 -0
- package/dist/plugins/MagicMarquee/index.mjs +7 -0
- package/dist/plugins/MagicMarquee/nuxt.d.ts +2 -0
- package/dist/plugins/MagicMarquee/nuxt.mjs +5 -0
- package/dist/plugins/MagicMarquee/src/components/MagicMarquee.vue +105 -0
- package/dist/plugins/MagicMarquee/src/components/MagicMarquee.vue.d.ts +34 -0
- package/dist/plugins/MagicMarquee/src/composables/useMarqueeApi.d.ts +15 -0
- package/dist/plugins/MagicMarquee/src/composables/useMarqueeApi.mjs +84 -0
- package/dist/plugins/MagicModal/src/components/MagicModal.vue +38 -58
- package/dist/plugins/MagicModal/src/components/MagicModal.vue.d.ts +15 -15
- package/dist/plugins/MagicModal/src/composables/useModalApi.d.ts +4 -3
- package/dist/plugins/MagicModal/src/composables/useModalApi.mjs +4 -3
- package/dist/plugins/MagicModal/src/composables/useModalCallback.d.ts +22 -0
- package/dist/plugins/MagicModal/src/composables/useModalCallback.mjs +60 -0
- package/dist/plugins/MagicModal/src/types/index.d.ts +7 -5
- package/dist/plugins/MagicModal/src/utils/defaultOptions.d.ts +2 -2
- package/dist/plugins/MagicPlayer/src/composables/useControlsApi.mjs +1 -2
- package/dist/plugins/MagicPlayer/src/composables/useMediaApi.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/composables/useMediaApi.mjs +2 -3
- package/dist/plugins/MagicPlayer/src/composables/useRuntimeSourceProvider.mjs +1 -2
- package/dist/plugins/MagicPlayer/src/types/index.d.ts +1 -1
- package/dist/plugins/MagicScroll/index.mjs +2 -0
- package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.vue +1 -1
- package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue +58 -0
- package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue.d.ts +42 -0
- package/dist/plugins/MagicScroll/src/components/MagicScrollTransform.vue.d.ts +9 -9
- package/dist/plugins/MagicScroll/src/composables/useProgress.d.ts +1 -1
- package/dist/plugins/MagicScroll/src/composables/useProgress.mjs +1 -2
- package/dist/plugins/MagicScroll/src/types/injectionKeys.d.ts +1 -2
- package/dist/plugins/MagicToast/demo/DemoToast.vue +22 -0
- package/dist/plugins/MagicToast/demo/DemoToast.vue.d.ts +14 -0
- package/dist/plugins/MagicToast/index.d.ts +5 -0
- package/dist/plugins/MagicToast/index.mjs +9 -0
- package/dist/plugins/MagicToast/nuxt.d.ts +2 -0
- package/dist/plugins/MagicToast/nuxt.mjs +5 -0
- package/dist/plugins/MagicToast/src/components/MagicToast.vue +229 -0
- package/dist/plugins/MagicToast/src/components/MagicToast.vue.d.ts +28 -0
- package/dist/plugins/MagicToast/src/components/MagicToastComponent.vue +101 -0
- package/dist/plugins/MagicToast/src/components/MagicToastComponent.vue.d.ts +48 -0
- package/dist/plugins/MagicToast/src/composables/useToastApi.d.ts +11 -0
- package/dist/plugins/MagicToast/src/composables/useToastApi.mjs +60 -0
- package/dist/plugins/MagicToast/src/composables/useToastCallback.d.ts +21 -0
- package/dist/plugins/MagicToast/src/composables/useToastCallback.mjs +43 -0
- package/dist/plugins/MagicToast/src/composables/useToastEmitter.d.ts +15 -0
- package/dist/plugins/MagicToast/src/composables/useToastEmitter.mjs +9 -0
- package/dist/plugins/MagicToast/src/composables/useToastInternalApi.d.ts +4 -0
- package/dist/plugins/MagicToast/src/composables/useToastInternalApi.mjs +26 -0
- package/dist/plugins/MagicToast/src/composables/useToastStore.d.ts +17 -0
- package/dist/plugins/MagicToast/src/composables/useToastStore.mjs +41 -0
- package/dist/plugins/MagicToast/src/types/index.d.ts +42 -0
- package/dist/plugins/MagicToast/src/types/index.mjs +0 -0
- package/dist/plugins/MagicToast/src/utils/defaultOptions.d.ts +3 -0
- package/dist/plugins/MagicToast/src/utils/defaultOptions.mjs +14 -0
- package/dist/plugins/index.d.ts +0 -3
- package/dist/plugins/index.mjs +0 -3
- package/package.json +19 -11
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type {
|
|
1
|
+
import { type Component, type MaybeRef } from 'vue';
|
|
2
|
+
import type { Options } from './../types/index';
|
|
3
3
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
4
|
+
props: {
|
|
5
|
+
type: import("vue").PropType<Record<string, unknown>>;
|
|
6
|
+
};
|
|
4
7
|
id: {
|
|
5
8
|
type: import("vue").PropType<MaybeRef<string>>;
|
|
6
9
|
required: true;
|
|
7
10
|
};
|
|
8
11
|
component: {
|
|
9
|
-
type: import("vue").PropType<
|
|
10
|
-
};
|
|
11
|
-
componentProps: {
|
|
12
|
-
type: import("vue").PropType<Record<string, unknown>>;
|
|
12
|
+
type: import("vue").PropType<Component>;
|
|
13
13
|
};
|
|
14
14
|
options: {
|
|
15
|
-
type: import("vue").PropType<
|
|
16
|
-
default: () =>
|
|
15
|
+
type: import("vue").PropType<Options>;
|
|
16
|
+
default: () => Options;
|
|
17
17
|
};
|
|
18
18
|
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
19
|
+
props: {
|
|
20
|
+
type: import("vue").PropType<Record<string, unknown>>;
|
|
21
|
+
};
|
|
19
22
|
id: {
|
|
20
23
|
type: import("vue").PropType<MaybeRef<string>>;
|
|
21
24
|
required: true;
|
|
22
25
|
};
|
|
23
26
|
component: {
|
|
24
|
-
type: import("vue").PropType<
|
|
25
|
-
};
|
|
26
|
-
componentProps: {
|
|
27
|
-
type: import("vue").PropType<Record<string, unknown>>;
|
|
27
|
+
type: import("vue").PropType<Component>;
|
|
28
28
|
};
|
|
29
29
|
options: {
|
|
30
|
-
type: import("vue").PropType<
|
|
31
|
-
default: () =>
|
|
30
|
+
type: import("vue").PropType<Options>;
|
|
31
|
+
default: () => Options;
|
|
32
32
|
};
|
|
33
33
|
}>>, {
|
|
34
|
-
options:
|
|
34
|
+
options: Options;
|
|
35
35
|
}, {}>, {
|
|
36
36
|
default?(_: {}): any;
|
|
37
37
|
}>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type {
|
|
3
|
-
|
|
1
|
+
import { type MaybeRef } from 'vue';
|
|
2
|
+
import type { Options } from '../types/index.js';
|
|
3
|
+
import type { MaybeElementRef } from '@vueuse/core';
|
|
4
|
+
export type useModalApiOptions = Pick<Options, 'scrollLock'> & {
|
|
4
5
|
focusTarget: MaybeElementRef;
|
|
5
6
|
};
|
|
6
7
|
export declare function useModalApi(id?: MaybeRef<string>, options?: useModalApiOptions): {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { ref, computed } from "vue";
|
|
1
|
+
import { ref, computed, toValue } from "vue";
|
|
2
|
+
import { defu } from "defu";
|
|
2
3
|
import { v4 as uuidv4 } from "uuid";
|
|
3
|
-
import {
|
|
4
|
+
import { useScrollLock } from "@vueuse/core";
|
|
4
5
|
import { useFocusTrap } from "@vueuse/integrations/useFocusTrap";
|
|
5
6
|
import { useModalStore } from "./useModalStore.mjs";
|
|
6
7
|
const defaultOptions = {
|
|
@@ -10,7 +11,7 @@ const defaultOptions = {
|
|
|
10
11
|
export function useModalApi(id, options) {
|
|
11
12
|
const positionFixedElements = ref([]);
|
|
12
13
|
const mappedId = computed(() => toValue(id) || uuidv4());
|
|
13
|
-
const mappedOptions =
|
|
14
|
+
const mappedOptions = defu(options, defaultOptions);
|
|
14
15
|
const focusTrap = mappedOptions.focusTarget ? useFocusTrap(mappedOptions.focusTarget) : void 0;
|
|
15
16
|
const scrollLock = mappedOptions.scrollLock && typeof window !== "undefined" ? useScrollLock(document.body) : ref(false);
|
|
16
17
|
const { modalStore, addIdToStore, removeIdFromStore } = useModalStore();
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type Ref, type MaybeRef } from 'vue';
|
|
2
|
+
import type { Options } from '../types.js';
|
|
3
|
+
type Args = {
|
|
4
|
+
id: MaybeRef<string>;
|
|
5
|
+
mappedOptions: Options;
|
|
6
|
+
addScrollLockPadding: () => void;
|
|
7
|
+
removeScrollLockPadding: () => void;
|
|
8
|
+
lockScroll: () => void;
|
|
9
|
+
unlockScroll: () => void;
|
|
10
|
+
trapFocus: () => void;
|
|
11
|
+
releaseFocus: () => void;
|
|
12
|
+
wrapperActive: Ref<boolean>;
|
|
13
|
+
};
|
|
14
|
+
export declare function useModalCallback({ id, mappedOptions, addScrollLockPadding, removeScrollLockPadding, lockScroll, unlockScroll, trapFocus, releaseFocus, wrapperActive, }: Args): {
|
|
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
|
+
};
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { toValue, nextTick } from "vue";
|
|
2
|
+
import { useModalEmitter } from "./useModalEmitter.mjs";
|
|
3
|
+
export function useModalCallback({
|
|
4
|
+
id,
|
|
5
|
+
mappedOptions,
|
|
6
|
+
addScrollLockPadding,
|
|
7
|
+
removeScrollLockPadding,
|
|
8
|
+
lockScroll,
|
|
9
|
+
unlockScroll,
|
|
10
|
+
trapFocus,
|
|
11
|
+
releaseFocus,
|
|
12
|
+
wrapperActive
|
|
13
|
+
}) {
|
|
14
|
+
function onBeforeEnter(_el) {
|
|
15
|
+
useModalEmitter().emit("beforeEnter", toValue(id));
|
|
16
|
+
}
|
|
17
|
+
function onEnter(_el) {
|
|
18
|
+
useModalEmitter().emit("enter", toValue(id));
|
|
19
|
+
}
|
|
20
|
+
async function onAfterEnter(el) {
|
|
21
|
+
useModalEmitter().emit("afterEnter", toValue(id));
|
|
22
|
+
if (mappedOptions.scrollLock) {
|
|
23
|
+
if (mappedOptions.scrollLockPadding) {
|
|
24
|
+
addScrollLockPadding();
|
|
25
|
+
}
|
|
26
|
+
lockScroll();
|
|
27
|
+
}
|
|
28
|
+
if (mappedOptions.focusTrap) {
|
|
29
|
+
await nextTick();
|
|
30
|
+
trapFocus();
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
function onBeforeLeave(_el) {
|
|
34
|
+
useModalEmitter().emit("beforeLeave", toValue(id));
|
|
35
|
+
}
|
|
36
|
+
function onLeave(el) {
|
|
37
|
+
useModalEmitter().emit("leave", toValue(id));
|
|
38
|
+
}
|
|
39
|
+
function onAfterLeave(_el) {
|
|
40
|
+
useModalEmitter().emit("afterLeave", toValue(id));
|
|
41
|
+
if (mappedOptions.scrollLock) {
|
|
42
|
+
unlockScroll();
|
|
43
|
+
if (mappedOptions.scrollLockPadding) {
|
|
44
|
+
removeScrollLockPadding();
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
if (mappedOptions.focusTrap) {
|
|
48
|
+
releaseFocus();
|
|
49
|
+
}
|
|
50
|
+
wrapperActive.value = false;
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
onBeforeEnter,
|
|
54
|
+
onEnter,
|
|
55
|
+
onAfterEnter,
|
|
56
|
+
onBeforeLeave,
|
|
57
|
+
onLeave,
|
|
58
|
+
onAfterLeave
|
|
59
|
+
};
|
|
60
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
type
|
|
1
|
+
type Options = {
|
|
2
2
|
backdrop?: boolean;
|
|
3
3
|
focusTrap?: boolean;
|
|
4
4
|
scrollLock?: boolean;
|
|
5
5
|
scrollLockPadding?: boolean;
|
|
6
6
|
teleport?: {
|
|
7
|
-
target
|
|
7
|
+
target?: string;
|
|
8
8
|
disabled?: boolean;
|
|
9
9
|
};
|
|
10
10
|
transitions?: {
|
|
@@ -13,9 +13,11 @@ type DefaultOptions = {
|
|
|
13
13
|
};
|
|
14
14
|
};
|
|
15
15
|
type ModalEvents = {
|
|
16
|
-
afterEnter: string;
|
|
17
|
-
afterLeave: string;
|
|
18
16
|
beforeEnter: string;
|
|
17
|
+
enter: string;
|
|
18
|
+
afterEnter: string;
|
|
19
19
|
beforeLeave: string;
|
|
20
|
+
leave: string;
|
|
21
|
+
afterLeave: string;
|
|
20
22
|
};
|
|
21
|
-
export type {
|
|
23
|
+
export type { Options, ModalEvents };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
declare const defaultOptions:
|
|
1
|
+
import type { Options } from '../types/index.js';
|
|
2
|
+
declare const defaultOptions: Options;
|
|
3
3
|
export { defaultOptions };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { ref, watch, unref } from "vue";
|
|
2
|
-
import {
|
|
3
|
-
import { useEventListener } from "@vueuse/core";
|
|
1
|
+
import { ref, watch, unref, toValue } from "vue";
|
|
2
|
+
import { useEventListener, watchIgnorable } from "@vueuse/core";
|
|
4
3
|
export function useMediaApi(target) {
|
|
5
4
|
const currentTime = ref(0);
|
|
6
5
|
const duration = ref(0);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import MagicScrollProvider from "./src/components/MagicScrollProvider.vue";
|
|
2
2
|
import MagicScrollScene from "./src/components/MagicScrollScene.vue";
|
|
3
3
|
import MagicScrollTransform from "./src/components/MagicScrollTransform.vue";
|
|
4
|
+
import MagicScrollMotion from "./src/components/MagicScrollMotion.vue";
|
|
4
5
|
import MagicScrollCollision from "./src/components/MagicScrollCollision.vue";
|
|
5
6
|
import { magicScrollStore } from "./src/store/index.mjs";
|
|
6
7
|
import { useCollisionEmitter } from "./src/composables/useCollisionEmitter.mjs";
|
|
@@ -12,6 +13,7 @@ const MagicScroll = {
|
|
|
12
13
|
app.component("MagicScrollProvider", MagicScrollProvider);
|
|
13
14
|
app.component("MagicScrollScene", MagicScrollScene);
|
|
14
15
|
app.component("MagicScrollTransform", MagicScrollTransform);
|
|
16
|
+
app.component("MagicScrollMotion", MagicScrollMotion);
|
|
15
17
|
app.component("MagicScrollCollision", MagicScrollCollision);
|
|
16
18
|
app.provide(StoreKey, magicScrollStore);
|
|
17
19
|
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
<script setup lang="ts">
|
|
8
8
|
import { ref, inject, computed, onMounted } from 'vue'
|
|
9
|
-
import { toValue } from '@vueuse/
|
|
9
|
+
import { toValue } from '@vueuse/core'
|
|
10
10
|
import { useCollisionDetect } from '../composables/useCollisionDetect'
|
|
11
11
|
import { ScrollPositionKey } from '../types'
|
|
12
12
|
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div ref="el" class="m-scroll-motion">
|
|
3
|
+
<slot />
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup lang="ts">
|
|
8
|
+
import { ref, inject, computed, onMounted, toRaw, watch } from 'vue'
|
|
9
|
+
import { animate, type Easing } from 'motion'
|
|
10
|
+
import { ScrollProgressKey } from '../types'
|
|
11
|
+
|
|
12
|
+
interface Props {
|
|
13
|
+
keyframes: Record<string, any> | null | undefined
|
|
14
|
+
offset?: number[] | undefined
|
|
15
|
+
easing?: Easing
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
19
|
+
keyframes: undefined,
|
|
20
|
+
offset: undefined,
|
|
21
|
+
easing: 'linear',
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
const animation = ref()
|
|
25
|
+
const el = ref()
|
|
26
|
+
|
|
27
|
+
const progress = inject(
|
|
28
|
+
ScrollProgressKey,
|
|
29
|
+
computed(() => 0),
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
function createAnimation(currentTime: number = 0) {
|
|
33
|
+
if (!props.keyframes) return
|
|
34
|
+
animation.value = animate(toRaw(el.value), props.keyframes, {
|
|
35
|
+
duration: 1,
|
|
36
|
+
easing: props.easing || 'linear',
|
|
37
|
+
offset: props.offset,
|
|
38
|
+
})
|
|
39
|
+
animation.value.stop()
|
|
40
|
+
animation.value.currentTime = currentTime
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
onMounted(() => {
|
|
44
|
+
createAnimation()
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
watch(progress, (value) => {
|
|
48
|
+
if (!animation.value || !props.keyframes) return
|
|
49
|
+
animation.value.currentTime = value
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
watch(
|
|
53
|
+
() => props.keyframes,
|
|
54
|
+
() => {
|
|
55
|
+
createAnimation(progress.value)
|
|
56
|
+
},
|
|
57
|
+
)
|
|
58
|
+
</script>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type Easing } from 'motion';
|
|
2
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
3
|
+
offset: {
|
|
4
|
+
type: import("vue").PropType<number[]>;
|
|
5
|
+
default: undefined;
|
|
6
|
+
};
|
|
7
|
+
keyframes: {
|
|
8
|
+
type: import("vue").PropType<Record<string, any> | null | undefined>;
|
|
9
|
+
required: true;
|
|
10
|
+
default: undefined;
|
|
11
|
+
};
|
|
12
|
+
easing: {
|
|
13
|
+
type: import("vue").PropType<Easing>;
|
|
14
|
+
default: string;
|
|
15
|
+
};
|
|
16
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
17
|
+
offset: {
|
|
18
|
+
type: import("vue").PropType<number[]>;
|
|
19
|
+
default: undefined;
|
|
20
|
+
};
|
|
21
|
+
keyframes: {
|
|
22
|
+
type: import("vue").PropType<Record<string, any> | null | undefined>;
|
|
23
|
+
required: true;
|
|
24
|
+
default: undefined;
|
|
25
|
+
};
|
|
26
|
+
easing: {
|
|
27
|
+
type: import("vue").PropType<Easing>;
|
|
28
|
+
default: string;
|
|
29
|
+
};
|
|
30
|
+
}>>, {
|
|
31
|
+
offset: number[];
|
|
32
|
+
keyframes: Record<string, any> | null | undefined;
|
|
33
|
+
easing: Easing;
|
|
34
|
+
}, {}>, {
|
|
35
|
+
default?(_: {}): any;
|
|
36
|
+
}>;
|
|
37
|
+
export default _default;
|
|
38
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
39
|
+
new (): {
|
|
40
|
+
$slots: S;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
@@ -3,10 +3,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
3
3
|
type: import("vue").PropType<number>;
|
|
4
4
|
default: number;
|
|
5
5
|
};
|
|
6
|
-
as: {
|
|
7
|
-
type: import("vue").PropType<string>;
|
|
8
|
-
default: string;
|
|
9
|
-
};
|
|
10
6
|
scaleX: {
|
|
11
7
|
type: import("vue").PropType<number>;
|
|
12
8
|
default: number;
|
|
@@ -23,6 +19,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
23
19
|
type: import("vue").PropType<number>;
|
|
24
20
|
default: number;
|
|
25
21
|
};
|
|
22
|
+
as: {
|
|
23
|
+
type: import("vue").PropType<string>;
|
|
24
|
+
default: string;
|
|
25
|
+
};
|
|
26
26
|
translateX: {
|
|
27
27
|
type: import("vue").PropType<number>;
|
|
28
28
|
default: number;
|
|
@@ -36,10 +36,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
36
36
|
type: import("vue").PropType<number>;
|
|
37
37
|
default: number;
|
|
38
38
|
};
|
|
39
|
-
as: {
|
|
40
|
-
type: import("vue").PropType<string>;
|
|
41
|
-
default: string;
|
|
42
|
-
};
|
|
43
39
|
scaleX: {
|
|
44
40
|
type: import("vue").PropType<number>;
|
|
45
41
|
default: number;
|
|
@@ -56,6 +52,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
56
52
|
type: import("vue").PropType<number>;
|
|
57
53
|
default: number;
|
|
58
54
|
};
|
|
55
|
+
as: {
|
|
56
|
+
type: import("vue").PropType<string>;
|
|
57
|
+
default: string;
|
|
58
|
+
};
|
|
59
59
|
translateX: {
|
|
60
60
|
type: import("vue").PropType<number>;
|
|
61
61
|
default: number;
|
|
@@ -66,11 +66,11 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
66
66
|
};
|
|
67
67
|
}>>, {
|
|
68
68
|
scale: number;
|
|
69
|
-
as: string;
|
|
70
69
|
scaleX: number;
|
|
71
70
|
scaleY: number;
|
|
72
71
|
skewX: number;
|
|
73
72
|
skewY: number;
|
|
73
|
+
as: string;
|
|
74
74
|
translateX: number;
|
|
75
75
|
translateY: number;
|
|
76
76
|
}, {}>, {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { ref, inject } from "vue";
|
|
1
|
+
import { ref, inject, toValue } from "vue";
|
|
2
2
|
import { useElementBounding, useWindowSize } from "@vueuse/core";
|
|
3
|
-
import { toValue } from "@vueuse/shared";
|
|
4
3
|
import { ScrollPositionKey } from "../types/index.mjs";
|
|
5
4
|
import { clampValue } from "../utils/index.mjs";
|
|
6
5
|
export function useProgress(params) {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { InjectionKey, Ref } from 'vue';
|
|
2
|
-
import type { MaybeRefOrGetter } from '@vueuse/shared';
|
|
1
|
+
import type { InjectionKey, Ref, MaybeRefOrGetter } from 'vue';
|
|
3
2
|
declare const ScrollParentKey: InjectionKey<MaybeRefOrGetter<HTMLElement | undefined>>;
|
|
4
3
|
declare const ScrollPositionKey: InjectionKey<{
|
|
5
4
|
x: import("vue").WritableComputedRef<number>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="bg-gray-300 text-black rounded-md p-3 w-[250px] max-w-sm text-sm pointer-events-auto cursor-pointer flex items-center"
|
|
4
|
+
>
|
|
5
|
+
{{ message }}
|
|
6
|
+
<button
|
|
7
|
+
@click="emit('close')"
|
|
8
|
+
class="text-xs bg-gray-900/5 ml-auto p-2 rounded-full"
|
|
9
|
+
>
|
|
10
|
+
Close
|
|
11
|
+
</button>
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script setup lang="ts">
|
|
16
|
+
interface Props {
|
|
17
|
+
message: string
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const emit = defineEmits(['close'])
|
|
21
|
+
const props = defineProps<Props>()
|
|
22
|
+
</script>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{
|
|
2
|
+
message: {
|
|
3
|
+
type: import("vue").PropType<string>;
|
|
4
|
+
required: true;
|
|
5
|
+
};
|
|
6
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "close"[], "close", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
7
|
+
message: {
|
|
8
|
+
type: import("vue").PropType<string>;
|
|
9
|
+
required: true;
|
|
10
|
+
};
|
|
11
|
+
}>> & {
|
|
12
|
+
onClose?: ((...args: any[]) => any) | undefined;
|
|
13
|
+
}, {}, {}>;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import MagicToastComponent from "./src/components/MagicToast.vue";
|
|
2
|
+
import { useToastApi } from "./src/composables/useToastApi.mjs";
|
|
3
|
+
import { useToastEmitter } from "./src/composables/useToastEmitter.mjs";
|
|
4
|
+
const MagicToast = {
|
|
5
|
+
install: (app) => {
|
|
6
|
+
app.component("MagicToast", MagicToastComponent);
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
export { MagicToast, useToastApi, useToastEmitter };
|