@maas/vue-equipment 0.11.2 → 0.11.3
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 +3 -3
- 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/MagicToast/src/components/MagicToast.vue +2 -2
- package/dist/plugins/MagicToast/src/components/MagicToast.vue.d.ts +3 -3
- 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/types/PickPartial.ts +1 -3
- package/dist/utils/types/RequireAll.ts +3 -0
- package/package.json +1 -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>(), {
|
|
@@ -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 = [];
|
|
@@ -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>()
|
|
@@ -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;
|
|
@@ -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 };
|
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.3",
|
|
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",
|