@maas/vue-equipment 0.11.2 → 0.11.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/MagicModal/src/components/MagicModal.vue +41 -50
- package/dist/plugins/MagicModal/src/components/MagicModal.vue.d.ts +6 -6
- package/dist/plugins/MagicModal/src/composables/private/useModalCallback.d.ts +2 -2
- package/dist/plugins/MagicModal/src/composables/useModalApi.d.ts +2 -2
- package/dist/plugins/MagicModal/src/types/index.d.ts +2 -3
- package/dist/plugins/MagicModal/src/utils/defaultOptions.d.ts +3 -2
- package/dist/plugins/MagicNoise/src/components/MagicNoise.vue +7 -18
- package/dist/plugins/MagicNoise/src/components/MagicNoise.vue.d.ts +7 -34
- package/dist/plugins/MagicNoise/src/composables/useNoiseApi.d.ts +2 -7
- package/dist/plugins/MagicNoise/src/composables/useNoiseApi.mjs +2 -7
- package/dist/plugins/MagicNoise/src/types/index.d.ts +6 -0
- package/dist/plugins/MagicNoise/src/utils/defaultOptions.d.ts +4 -0
- package/dist/plugins/MagicNoise/src/utils/defaultOptions.mjs +7 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerControls.vue +2 -2
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerTimeline.vue +1 -1
- package/dist/plugins/MagicToast/src/components/MagicToast.vue +26 -27
- package/dist/plugins/MagicToast/src/components/MagicToast.vue.d.ts +3 -3
- package/dist/plugins/MagicToast/src/components/MagicToastComponent.vue +1 -1
- package/dist/plugins/MagicToast/src/types/index.d.ts +2 -2
- package/dist/plugins/MagicToast/src/utils/defaultOptions.d.ts +3 -2
- package/dist/utils/css/animations/clip-in.css +8 -0
- package/dist/utils/css/animations/clip-out.css +8 -0
- package/dist/utils/css/animations/fade-down-in.css +10 -0
- package/dist/utils/css/animations/fade-down-out.css +10 -0
- package/dist/utils/css/animations/fade-in.css +9 -0
- package/dist/utils/css/animations/fade-out.css +8 -0
- package/dist/utils/css/animations/fade-up-in.css +9 -0
- package/dist/utils/css/animations/fade-up-out.css +10 -0
- package/dist/utils/css/animations/flip-in.css +8 -0
- package/dist/utils/css/animations/flip-out.css +8 -0
- package/dist/utils/css/animations/slide-btt-in.css +8 -0
- package/dist/utils/css/animations/slide-btt-out.css +9 -0
- package/dist/utils/css/animations/slide-ltr-in.css +8 -0
- package/dist/utils/css/animations/slide-ltr-out.css +8 -0
- package/dist/utils/css/animations/slide-rtl-in.css +8 -0
- package/dist/utils/css/animations/slide-rtl-out.css +8 -0
- package/dist/utils/css/animations/slide-ttb-in.css +8 -0
- package/dist/utils/css/animations/slide-ttb-out.css +8 -0
- package/dist/utils/css/animations/zoom-in.css +10 -0
- package/dist/utils/css/animations/zoom-out.css +10 -0
- package/dist/utils/css/animations.css +21 -0
- package/dist/utils/css/transitions.css +79 -0
- package/dist/utils/types/PickPartial.ts +1 -3
- package/dist/utils/types/RequireAll.ts +3 -0
- package/package.json +5 -1
package/dist/nuxt/module.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
:disabled="mappedOptions.teleport?.disabled"
|
|
7
7
|
>
|
|
8
8
|
<component
|
|
9
|
-
:is="
|
|
9
|
+
:is="mappedOptions.tag"
|
|
10
10
|
ref="modal"
|
|
11
11
|
class="magic-modal"
|
|
12
12
|
:id="toValue(id)"
|
|
@@ -68,7 +68,7 @@ import { defaultOptions } from './../utils/defaultOptions'
|
|
|
68
68
|
import { useModalApi } from './../composables/useModalApi'
|
|
69
69
|
import { useModalCallback } from '../composables/private/useModalCallback'
|
|
70
70
|
|
|
71
|
-
import type {
|
|
71
|
+
import type { ModalOptions } from './../types/index'
|
|
72
72
|
|
|
73
73
|
import { createDefu } from 'defu'
|
|
74
74
|
|
|
@@ -85,7 +85,7 @@ interface MagicModalProps {
|
|
|
85
85
|
class?: MaybeRef<string>
|
|
86
86
|
component?: Component
|
|
87
87
|
props?: Record<string, unknown>
|
|
88
|
-
options?:
|
|
88
|
+
options?: ModalOptions
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
const props = withDefaults(defineProps<MagicModalProps>(), {
|
|
@@ -159,7 +159,10 @@ watch(isActive, async (value) => {
|
|
|
159
159
|
})
|
|
160
160
|
</script>
|
|
161
161
|
|
|
162
|
-
<style
|
|
162
|
+
<style>
|
|
163
|
+
@import '@maas/vue-equipment/utils/css/animations/fade-in.css';
|
|
164
|
+
@import '@maas/vue-equipment/utils/css/animations/fade-out.css';
|
|
165
|
+
|
|
163
166
|
:root {
|
|
164
167
|
--magic-modal-z-index: 999;
|
|
165
168
|
--magic-modal-backdrop-color: rgba(0, 0, 0, 0.5);
|
|
@@ -169,6 +172,28 @@ watch(isActive, async (value) => {
|
|
|
169
172
|
--magic-modal-content-overflow-y: auto;
|
|
170
173
|
}
|
|
171
174
|
|
|
175
|
+
@keyframes magic-modal-content-enter {
|
|
176
|
+
0% {
|
|
177
|
+
opacity: 0;
|
|
178
|
+
transform: translateY(2rem);
|
|
179
|
+
}
|
|
180
|
+
100% {
|
|
181
|
+
opacity: 1;
|
|
182
|
+
transform: translateY(0);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
@keyframes magic-modal-content-leave {
|
|
187
|
+
0% {
|
|
188
|
+
opacity: 1;
|
|
189
|
+
transform: scale(1);
|
|
190
|
+
}
|
|
191
|
+
100% {
|
|
192
|
+
opacity: 0;
|
|
193
|
+
transform: scale(1.02);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
172
197
|
.magic-modal {
|
|
173
198
|
position: fixed;
|
|
174
199
|
inset: 0;
|
|
@@ -209,64 +234,30 @@ watch(isActive, async (value) => {
|
|
|
209
234
|
}
|
|
210
235
|
|
|
211
236
|
/* Content */
|
|
212
|
-
.magic-modal--content-enter-active
|
|
213
|
-
|
|
214
|
-
transition: all 300ms ease-out;
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
.magic-modal--content-enter-from {
|
|
218
|
-
opacity: 0;
|
|
219
|
-
transform: translateY(2rem);
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
.magic-modal--content-enter-to {
|
|
223
|
-
opacity: 1;
|
|
224
|
-
transform: translateY(0);
|
|
237
|
+
.magic-modal--content-enter-active {
|
|
238
|
+
animation: magic-modal-content-enter 300ms ease;
|
|
225
239
|
}
|
|
226
240
|
|
|
227
|
-
.magic-modal--content-leave-
|
|
228
|
-
|
|
229
|
-
transform: scale(1);
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
.magic-modal--content-leave-to {
|
|
233
|
-
opacity: 0;
|
|
234
|
-
transform: scale(1.02);
|
|
241
|
+
.magic-modal--content-leave-active {
|
|
242
|
+
animation: magic-modal-content-leave 300ms ease;
|
|
235
243
|
}
|
|
236
244
|
|
|
237
245
|
@media (prefers-reduced-motion) {
|
|
238
|
-
.magic-modal--content-enter-active
|
|
239
|
-
|
|
240
|
-
transition: opacity 300ms ease-out;
|
|
246
|
+
.magic-modal--content-enter-active {
|
|
247
|
+
animation: fade-in 300ms ease;
|
|
241
248
|
}
|
|
242
249
|
|
|
243
|
-
.magic-modal--content-
|
|
244
|
-
|
|
245
|
-
.magic-modal--content-leave-from,
|
|
246
|
-
.magic-modal--content-leave-to {
|
|
247
|
-
transform: none;
|
|
250
|
+
.magic-modal--content-leave-active {
|
|
251
|
+
animation: fade-out 300ms ease;
|
|
248
252
|
}
|
|
249
253
|
}
|
|
250
254
|
|
|
251
255
|
/* Backdrop */
|
|
252
|
-
.magic-modal--backdrop-enter-active
|
|
253
|
-
|
|
254
|
-
transition: opacity 300ms ease-out;
|
|
256
|
+
.magic-modal--backdrop-enter-active {
|
|
257
|
+
animation: fade-in 300ms ease;
|
|
255
258
|
}
|
|
256
259
|
|
|
257
|
-
.magic-modal--backdrop-
|
|
258
|
-
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
.magic-modal--backdrop-enter-to {
|
|
262
|
-
opacity: 1;
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
.magic-modal--backdrop-leave-from {
|
|
266
|
-
opacity: 1;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
.magic-modal--backdrop-leave-to {
|
|
270
|
-
opacity: 0;
|
|
260
|
+
.magic-modal--backdrop-leave-active {
|
|
261
|
+
animation: fade-out 300ms ease;
|
|
271
262
|
}
|
|
272
263
|
</style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Component, type MaybeRef } from 'vue';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ModalOptions } from './../types/index';
|
|
3
3
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
4
4
|
props: {
|
|
5
5
|
type: import("vue").PropType<Record<string, unknown>>;
|
|
@@ -15,8 +15,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
15
15
|
type: import("vue").PropType<Component>;
|
|
16
16
|
};
|
|
17
17
|
options: {
|
|
18
|
-
type: import("vue").PropType<
|
|
19
|
-
default: () =>
|
|
18
|
+
type: import("vue").PropType<ModalOptions>;
|
|
19
|
+
default: () => RequireAll<ModalOptions>;
|
|
20
20
|
};
|
|
21
21
|
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
22
22
|
props: {
|
|
@@ -33,11 +33,11 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
33
33
|
type: import("vue").PropType<Component>;
|
|
34
34
|
};
|
|
35
35
|
options: {
|
|
36
|
-
type: import("vue").PropType<
|
|
37
|
-
default: () =>
|
|
36
|
+
type: import("vue").PropType<ModalOptions>;
|
|
37
|
+
default: () => RequireAll<ModalOptions>;
|
|
38
38
|
};
|
|
39
39
|
}>>, {
|
|
40
|
-
options:
|
|
40
|
+
options: ModalOptions;
|
|
41
41
|
}, {}>, {
|
|
42
42
|
backdrop?(_: {}): any;
|
|
43
43
|
default?(_: {}): any;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type Ref, type MaybeRef } from 'vue';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ModalOptions } from '../../types.js';
|
|
3
3
|
type Args = {
|
|
4
4
|
id: MaybeRef<string>;
|
|
5
|
-
mappedOptions:
|
|
5
|
+
mappedOptions: ModalOptions;
|
|
6
6
|
addScrollLockPadding: () => void;
|
|
7
7
|
removeScrollLockPadding: () => void;
|
|
8
8
|
lockScroll: () => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type MaybeRef } from 'vue';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ModalOptions } from '../types/index.js';
|
|
3
3
|
import type { MaybeElementRef } from '@vueuse/core';
|
|
4
|
-
export type useModalApiOptions = Pick<
|
|
4
|
+
export type useModalApiOptions = Pick<ModalOptions, 'scrollLock'> & {
|
|
5
5
|
focusTarget: MaybeElementRef;
|
|
6
6
|
};
|
|
7
7
|
export declare function useModalApi(id?: MaybeRef<string>, options?: useModalApiOptions): {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
type
|
|
1
|
+
export type ModalOptions = {
|
|
2
2
|
backdrop?: boolean;
|
|
3
3
|
focusTrap?: boolean;
|
|
4
4
|
scrollLock?: boolean;
|
|
@@ -14,7 +14,7 @@ type Options = {
|
|
|
14
14
|
tag?: 'dialog' | 'div';
|
|
15
15
|
keys?: string[] | false;
|
|
16
16
|
};
|
|
17
|
-
type ModalEvents = {
|
|
17
|
+
export type ModalEvents = {
|
|
18
18
|
beforeEnter: string;
|
|
19
19
|
enter: string;
|
|
20
20
|
afterEnter: string;
|
|
@@ -22,4 +22,3 @@ type ModalEvents = {
|
|
|
22
22
|
leave: string;
|
|
23
23
|
afterLeave: string;
|
|
24
24
|
};
|
|
25
|
-
export type { Options, ModalEvents };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type { ModalOptions } from '../types/index.js';
|
|
2
|
+
import type { RequireAll } from '@maas/vue-equipment/utils/types/RequireAll';
|
|
3
|
+
declare const defaultOptions: RequireAll<ModalOptions>;
|
|
3
4
|
export { defaultOptions };
|
|
@@ -8,39 +8,28 @@
|
|
|
8
8
|
</template>
|
|
9
9
|
|
|
10
10
|
<script lang="ts" setup>
|
|
11
|
-
import { onMounted, onUnmounted,
|
|
11
|
+
import { onMounted, onUnmounted, watch, shallowRef } from 'vue'
|
|
12
12
|
import { useResizeObserver, useDebounceFn } from '@vueuse/core'
|
|
13
13
|
import { useNoiseApi } from '../composables/useNoiseApi'
|
|
14
|
+
import type { NoiseOptions } from '../types'
|
|
14
15
|
|
|
15
16
|
interface Props {
|
|
16
|
-
|
|
17
|
-
tiles?: number
|
|
18
|
-
fps?: number
|
|
19
|
-
color?: string
|
|
17
|
+
options: NoiseOptions
|
|
20
18
|
pause?: boolean
|
|
21
19
|
}
|
|
22
20
|
|
|
23
21
|
const props = withDefaults(defineProps<Props>(), {
|
|
24
|
-
pixelSize: 2,
|
|
25
|
-
tiles: 32,
|
|
26
|
-
fps: 8,
|
|
27
|
-
color: '#000',
|
|
28
22
|
pause: false,
|
|
29
23
|
})
|
|
30
24
|
|
|
31
25
|
const canvasRef = shallowRef<HTMLCanvasElement | undefined>(undefined)
|
|
32
26
|
const offCanvasRef = shallowRef<HTMLCanvasElement | undefined>(undefined)
|
|
33
27
|
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
fps: props.fps,
|
|
39
|
-
color: props.color,
|
|
40
|
-
}
|
|
28
|
+
const noiseApi = useNoiseApi({
|
|
29
|
+
canvasRef,
|
|
30
|
+
offCanvasRef,
|
|
31
|
+
options: props.options,
|
|
41
32
|
})
|
|
42
|
-
|
|
43
|
-
const noiseApi = useNoiseApi({ canvasRef, offCanvasRef, options })
|
|
44
33
|
const {
|
|
45
34
|
initialize,
|
|
46
35
|
drawControls,
|
|
@@ -1,50 +1,23 @@
|
|
|
1
|
+
import type { NoiseOptions } from '../types';
|
|
1
2
|
declare const _default: import("vue").DefineComponent<{
|
|
2
3
|
pause: {
|
|
3
4
|
type: import("vue").PropType<boolean>;
|
|
4
5
|
default: boolean;
|
|
5
6
|
};
|
|
6
|
-
|
|
7
|
-
type: import("vue").PropType<
|
|
8
|
-
|
|
9
|
-
};
|
|
10
|
-
tiles: {
|
|
11
|
-
type: import("vue").PropType<number>;
|
|
12
|
-
default: number;
|
|
13
|
-
};
|
|
14
|
-
fps: {
|
|
15
|
-
type: import("vue").PropType<number>;
|
|
16
|
-
default: number;
|
|
17
|
-
};
|
|
18
|
-
color: {
|
|
19
|
-
type: import("vue").PropType<string>;
|
|
20
|
-
default: string;
|
|
7
|
+
options: {
|
|
8
|
+
type: import("vue").PropType<NoiseOptions>;
|
|
9
|
+
required: true;
|
|
21
10
|
};
|
|
22
11
|
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
23
12
|
pause: {
|
|
24
13
|
type: import("vue").PropType<boolean>;
|
|
25
14
|
default: boolean;
|
|
26
15
|
};
|
|
27
|
-
|
|
28
|
-
type: import("vue").PropType<
|
|
29
|
-
|
|
30
|
-
};
|
|
31
|
-
tiles: {
|
|
32
|
-
type: import("vue").PropType<number>;
|
|
33
|
-
default: number;
|
|
34
|
-
};
|
|
35
|
-
fps: {
|
|
36
|
-
type: import("vue").PropType<number>;
|
|
37
|
-
default: number;
|
|
38
|
-
};
|
|
39
|
-
color: {
|
|
40
|
-
type: import("vue").PropType<string>;
|
|
41
|
-
default: string;
|
|
16
|
+
options: {
|
|
17
|
+
type: import("vue").PropType<NoiseOptions>;
|
|
18
|
+
required: true;
|
|
42
19
|
};
|
|
43
20
|
}>>, {
|
|
44
21
|
pause: boolean;
|
|
45
|
-
pixelSize: number;
|
|
46
|
-
tiles: number;
|
|
47
|
-
fps: number;
|
|
48
|
-
color: string;
|
|
49
22
|
}, {}>;
|
|
50
23
|
export default _default;
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
import { type Ref, type MaybeRef } from 'vue';
|
|
2
|
-
import type { RafControls } from '../types.js';
|
|
2
|
+
import type { NoiseOptions, RafControls } from '../types.js';
|
|
3
3
|
type UseNoiseApiArgs = {
|
|
4
4
|
canvasRef: Ref<HTMLCanvasElement | undefined>;
|
|
5
5
|
offCanvasRef: Ref<HTMLCanvasElement | undefined>;
|
|
6
|
-
options?: MaybeRef<
|
|
7
|
-
pixelSize?: number;
|
|
8
|
-
tiles?: number;
|
|
9
|
-
color?: string;
|
|
10
|
-
fps?: number;
|
|
11
|
-
}>;
|
|
6
|
+
options?: MaybeRef<NoiseOptions>;
|
|
12
7
|
};
|
|
13
8
|
export declare function useNoiseApi({ canvasRef, offCanvasRef, options, }: UseNoiseApiArgs): {
|
|
14
9
|
initialize: () => void;
|
|
@@ -6,12 +6,7 @@ import {
|
|
|
6
6
|
useThrottleFn,
|
|
7
7
|
useRafFn
|
|
8
8
|
} from "@vueuse/core";
|
|
9
|
-
|
|
10
|
-
pixelSize: 2,
|
|
11
|
-
tiles: 32,
|
|
12
|
-
fps: 12,
|
|
13
|
-
color: "white"
|
|
14
|
-
};
|
|
9
|
+
import { defaultOptions } from "../utils/defaultOptions.mjs";
|
|
15
10
|
export function useNoiseApi({
|
|
16
11
|
canvasRef,
|
|
17
12
|
offCanvasRef,
|
|
@@ -54,7 +49,7 @@ export function useNoiseApi({
|
|
|
54
49
|
pixelSize,
|
|
55
50
|
rotation
|
|
56
51
|
}) {
|
|
57
|
-
if (pixelSize <= 0
|
|
52
|
+
if (pixelSize <= 0) {
|
|
58
53
|
return [];
|
|
59
54
|
}
|
|
60
55
|
const pixels2 = [];
|
|
@@ -137,7 +137,7 @@ defineExpose({
|
|
|
137
137
|
--magic-player-controls-overlay-background-color: rgba(0, 0, 0, 0.3);
|
|
138
138
|
--magic-player-controls-overlay-color: rgba(255, 255, 255, 1);
|
|
139
139
|
--magic-player-controls-transition-duration: 300ms;
|
|
140
|
-
--magic-player-controls-transition-timing-function: ease
|
|
140
|
+
--magic-player-controls-transition-timing-function: ease: ;
|
|
141
141
|
}
|
|
142
142
|
|
|
143
143
|
@media (max-width: 640px) {
|
|
@@ -160,7 +160,7 @@ defineExpose({
|
|
|
160
160
|
color: var(--magic-player-controls-overlay-color);
|
|
161
161
|
transition-duration: 300ms;
|
|
162
162
|
transition-property: opacity;
|
|
163
|
-
transition-timing-function: ease
|
|
163
|
+
transition-timing-function: ease;
|
|
164
164
|
display: flex;
|
|
165
165
|
align-items: center;
|
|
166
166
|
justify-content: center;
|
|
@@ -111,7 +111,7 @@ const {
|
|
|
111
111
|
top: 50%;
|
|
112
112
|
left: 50%;
|
|
113
113
|
transform: translate(-50%, -50%) scale(0);
|
|
114
|
-
transition: transform 300ms ease
|
|
114
|
+
transition: transform 300ms ease;
|
|
115
115
|
z-index: 10;
|
|
116
116
|
background-color: var(--magic-player-thumb-bg-color);
|
|
117
117
|
border-radius: 50rem;
|
|
@@ -53,12 +53,12 @@ import { useToastCallback } from './../composables/private/useToastCallback'
|
|
|
53
53
|
|
|
54
54
|
import MagicToastComponent from './MagicToastComponent.vue'
|
|
55
55
|
|
|
56
|
-
import type {
|
|
56
|
+
import type { ToastOptions } from './../types/index'
|
|
57
57
|
|
|
58
58
|
interface MagicToastProps {
|
|
59
59
|
id: MaybeRef<string>
|
|
60
60
|
class: MaybeRef<string>
|
|
61
|
-
options?:
|
|
61
|
+
options?: ToastOptions
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
const props = defineProps<MagicToastProps>()
|
|
@@ -112,13 +112,19 @@ watch(
|
|
|
112
112
|
</script>
|
|
113
113
|
|
|
114
114
|
<style lang="css">
|
|
115
|
+
@import '@maas/vue-equipment/utils/css/animations/fade-out.css';
|
|
116
|
+
@import '@maas/vue-equipment/utils/css/animations/slide-ltr-in.css';
|
|
117
|
+
@import '@maas/vue-equipment/utils/css/animations/slide-rtl-in.css';
|
|
118
|
+
@import '@maas/vue-equipment/utils/css/animations/slide-ttb-in.css';
|
|
119
|
+
@import '@maas/vue-equipment/utils/css/animations/slide-btt-in.css';
|
|
120
|
+
|
|
115
121
|
:root {
|
|
116
|
-
--magic-toast-enter-
|
|
117
|
-
--magic-toast-
|
|
122
|
+
--magic-toast-enter-animation: unset;
|
|
123
|
+
--magic-toast-leave-animation: fade-out 300ms ease;
|
|
118
124
|
--magic-toast-scale: 0.1;
|
|
119
125
|
--magic-toast-transform-x: 0;
|
|
120
126
|
--magic-toast-transform-y: 0;
|
|
121
|
-
--magic-toast-transition: transform 300ms ease
|
|
127
|
+
--magic-toast-transition: transform 300ms ease;
|
|
122
128
|
--magic-toast-z-index: 999;
|
|
123
129
|
--magic-toast-gap: 0.75rem;
|
|
124
130
|
--magic-toast-padding-x: 1rem;
|
|
@@ -166,10 +172,11 @@ watch(
|
|
|
166
172
|
.magic-toast.-top-center,
|
|
167
173
|
.magic-toast.-top-right {
|
|
168
174
|
--magic-toast-transform-y: 10;
|
|
169
|
-
--magic-toast-enter-
|
|
175
|
+
--magic-toast-enter-animation: slide-ttb-in 300ms ease;
|
|
170
176
|
--mt-multiplier: 1;
|
|
171
177
|
& .magic-toast-component {
|
|
172
|
-
top:
|
|
178
|
+
top: 0;
|
|
179
|
+
padding-top: var(--magic-toast-padding-y, 1rem);
|
|
173
180
|
--mt-transform-y: 0;
|
|
174
181
|
}
|
|
175
182
|
}
|
|
@@ -178,11 +185,12 @@ watch(
|
|
|
178
185
|
.magic-toast.-bottom-center,
|
|
179
186
|
.magic-toast.-bottom-right {
|
|
180
187
|
--magic-toast-transform-y: 10;
|
|
181
|
-
--magic-toast-enter-
|
|
188
|
+
--magic-toast-enter-animation: slide-btt-in 300ms ease;
|
|
182
189
|
--mt-multiplier: -1;
|
|
183
190
|
& .magic-toast-component {
|
|
184
191
|
top: unset;
|
|
185
|
-
bottom:
|
|
192
|
+
bottom: 0;
|
|
193
|
+
padding-bottom: var(--magic-toast-padding-y, 1rem);
|
|
186
194
|
--mt-transform-y: 0;
|
|
187
195
|
}
|
|
188
196
|
}
|
|
@@ -190,7 +198,8 @@ watch(
|
|
|
190
198
|
.magic-toast.-top-left,
|
|
191
199
|
.magic-toast.-bottom-left {
|
|
192
200
|
& .magic-toast-component {
|
|
193
|
-
left:
|
|
201
|
+
left: 0;
|
|
202
|
+
padding-left: var(--magic-toast-padding-x, 1rem);
|
|
194
203
|
--mt-transform-x: 0;
|
|
195
204
|
}
|
|
196
205
|
}
|
|
@@ -199,39 +208,29 @@ watch(
|
|
|
199
208
|
.magic-toast.-bottom-right {
|
|
200
209
|
& .magic-toast-component {
|
|
201
210
|
left: unset;
|
|
202
|
-
right:
|
|
211
|
+
right: 0;
|
|
212
|
+
padding-right: var(--magic-toast-padding-x, 1rem);
|
|
203
213
|
--mt-transform-x: 0;
|
|
204
214
|
}
|
|
205
215
|
}
|
|
206
216
|
|
|
207
217
|
.magic-toast.-from-left {
|
|
208
|
-
--magic-toast-enter-
|
|
209
|
-
--magic-toast-enter-y: 0;
|
|
218
|
+
--magic-toast-enter-animation: slide-ltr-in 300ms ease;
|
|
210
219
|
--magic-toast-transform-y: 0;
|
|
211
220
|
--magic-toast-transform-x: -30;
|
|
212
221
|
}
|
|
213
222
|
|
|
214
223
|
.magic-toast.-from-right {
|
|
215
|
-
--magic-toast-enter-
|
|
216
|
-
--magic-toast-enter-y: 0;
|
|
224
|
+
--magic-toast-enter-animation: slide-rtl-in 300ms ease;
|
|
217
225
|
--magic-toast-transform-y: 0;
|
|
218
226
|
--magic-toast-transform-x: 30;
|
|
219
227
|
}
|
|
220
228
|
|
|
221
|
-
.magic-toast--list-enter-active
|
|
222
|
-
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
.magic-toast--list-enter-from * {
|
|
226
|
-
transform: translateY(var(--magic-toast-enter-y, 0))
|
|
227
|
-
translateX(var(--magic-toast-enter-x, 0));
|
|
229
|
+
.magic-toast--list-enter-active {
|
|
230
|
+
animation: var(--magic-toast-enter-animation);
|
|
228
231
|
}
|
|
229
232
|
|
|
230
233
|
.magic-toast--list-leave-active {
|
|
231
|
-
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
.magic-toast--list-leave-to {
|
|
235
|
-
opacity: 0;
|
|
234
|
+
animation: var(--magic-toast-leave-animation);
|
|
236
235
|
}
|
|
237
236
|
</style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type MaybeRef } from 'vue';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ToastOptions } from './../types/index';
|
|
3
3
|
declare const _default: import("vue").DefineComponent<{
|
|
4
4
|
id: {
|
|
5
5
|
type: import("vue").PropType<MaybeRef<string>>;
|
|
@@ -10,7 +10,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
10
10
|
required: true;
|
|
11
11
|
};
|
|
12
12
|
options: {
|
|
13
|
-
type: import("vue").PropType<
|
|
13
|
+
type: import("vue").PropType<ToastOptions>;
|
|
14
14
|
};
|
|
15
15
|
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
16
16
|
id: {
|
|
@@ -22,7 +22,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
22
22
|
required: true;
|
|
23
23
|
};
|
|
24
24
|
options: {
|
|
25
|
-
type: import("vue").PropType<
|
|
25
|
+
type: import("vue").PropType<ToastOptions>;
|
|
26
26
|
};
|
|
27
27
|
}>>, {}, {}>;
|
|
28
28
|
export default _default;
|
|
@@ -78,7 +78,7 @@ watchEffect(() => {
|
|
|
78
78
|
position: relative;
|
|
79
79
|
width: 100%;
|
|
80
80
|
height: 100%;
|
|
81
|
-
transition: var(--magic-toast-transition, transform 300ms ease
|
|
81
|
+
transition: var(--magic-toast-transition, transform 300ms ease);
|
|
82
82
|
transform: matrix(
|
|
83
83
|
var(--mt-matrix-scale),
|
|
84
84
|
0,
|
|
@@ -12,7 +12,7 @@ type ToastInstance = {
|
|
|
12
12
|
add: (args: AddArgs) => string;
|
|
13
13
|
remove: (id: string) => void;
|
|
14
14
|
};
|
|
15
|
-
type
|
|
15
|
+
type ToastOptions = {
|
|
16
16
|
teleport?: {
|
|
17
17
|
target?: string;
|
|
18
18
|
disabled?: boolean;
|
|
@@ -40,4 +40,4 @@ type ToastEvents = {
|
|
|
40
40
|
type AddArgs = Pick<Toast, 'component'> & PickPartial<Toast, 'props'> & {
|
|
41
41
|
duration?: number;
|
|
42
42
|
};
|
|
43
|
-
export type { Toast, ToastInstance,
|
|
43
|
+
export type { Toast, ToastInstance, ToastOptions, ActiveElement, ToastEvents, AddArgs, };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type { ToastOptions } from '../types/index.js';
|
|
2
|
+
import type { RequireAll } from '@maas/vue-equipment/utils/types/RequireAll';
|
|
3
|
+
declare const defaultOptions: RequireAll<ToastOptions>;
|
|
3
4
|
export { defaultOptions };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
@import './animations/clip-in.css';
|
|
2
|
+
@import './animations/clip-out.css';
|
|
3
|
+
@import './animations/fade-down-in.css';
|
|
4
|
+
@import './animations/fade-down-out.css';
|
|
5
|
+
@import './animations/fade-in.css';
|
|
6
|
+
@import './animations/fade-out.css';
|
|
7
|
+
@import './animations/fade-up-in.css';
|
|
8
|
+
@import './animations/fade-up-out.css';
|
|
9
|
+
@import './animations/flip-in.css';
|
|
10
|
+
@import './animations/flip-out.css';
|
|
11
|
+
@import './animations/slide-btt-in.css';
|
|
12
|
+
@import './animations/slide-btt-out.css';
|
|
13
|
+
@import './animations/slide-ltr-in.css';
|
|
14
|
+
@import './animations/slide-ltr-out.css';
|
|
15
|
+
@import './animations/slide-rtl-in.css';
|
|
16
|
+
@import './animations/slide-rtl-out.css';
|
|
17
|
+
@import './animations/slide-ttb-in.css';
|
|
18
|
+
@import './animations/slide-ttb-out.css';
|
|
19
|
+
@import './animations/zoom-in.css';
|
|
20
|
+
@import './animations/zoom-out.css';
|
|
21
|
+
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
.fade-enter-active {
|
|
2
|
+
animation: fade-in 300ms ease;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.fade-leave-active {
|
|
6
|
+
animation: fade-out 300ms ease;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.fade-up-enter-active {
|
|
10
|
+
animation: fade-up-in 300ms ease;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.fade-up-leave-active {
|
|
14
|
+
animation: fade-up-out 300ms ease;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.slide-btt-enter-active {
|
|
18
|
+
animation: slide-btt-in 300ms ease;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.slide-btt-leave-active {
|
|
22
|
+
animation: slide-btt-out 300ms ease;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.slide-ttb-enter-active {
|
|
26
|
+
animation: slide-ttb-in 300ms ease;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.slide-ttb-leave-active {
|
|
30
|
+
animation: slide-ttb-out 300ms ease;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.slide-rtl-enter-active {
|
|
34
|
+
animation: slide-rtl-in 300ms ease;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.slide-rtl-leave-active {
|
|
38
|
+
animation: slide-rtl-out 300ms ease;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.slide-ltr-enter-active {
|
|
42
|
+
animation: slide-ltr-in 300ms ease;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.slide-ltr-leave-active {
|
|
46
|
+
animation: slide-ltr-out 300ms ease;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.scroll-up-enter-active {
|
|
50
|
+
animation: scroll-up-in 300ms ease;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.scroll-up-leave-active {
|
|
54
|
+
animation: scroll-up-out 300ms ease;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.scroll-down-enter-active {
|
|
58
|
+
animation: scroll-down-in 300ms ease;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.scroll-down-leave-active {
|
|
62
|
+
animation: scroll-down-out 300ms ease;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.zoom-enter-active {
|
|
66
|
+
animation: zoom-in 300ms ease;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.zoom-leave-active {
|
|
70
|
+
animation: zoom-out 300ms ease;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.clip-enter-active {
|
|
74
|
+
animation: clip-in 0.6s cubic-bezier(0.83, 0, 0.17, 1) forwards;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.clip-leave-active {
|
|
78
|
+
animation: clip-out 0.6s cubic-bezier(0.83, 0, 0.17, 1) forwards;
|
|
79
|
+
}
|
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.11.
|
|
4
|
+
"version": "0.11.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.5",
|
|
@@ -50,6 +50,10 @@
|
|
|
50
50
|
"types": "./dist/utils/index.d.ts",
|
|
51
51
|
"require": "./dist/utils/index.js",
|
|
52
52
|
"import": "./dist/utils/index.mjs"
|
|
53
|
+
},
|
|
54
|
+
"./utils/css/*.css": {
|
|
55
|
+
"import": "./dist/utils/css/*.css",
|
|
56
|
+
"require": "./dist/utils/css/*.css"
|
|
53
57
|
}
|
|
54
58
|
},
|
|
55
59
|
"files": [
|