@maas/vue-equipment 0.29.3 → 0.29.5
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 +5 -1
- package/dist/nuxt/types.d.mts +1 -16
- package/dist/nuxt/types.d.ts +1 -16
- package/dist/plugins/MagicCommand/src/components/MagicCommandDrawer.vue +5 -2
- package/dist/plugins/MagicCommand/src/components/MagicCommandDrawer.vue.d.ts +0 -2
- package/dist/plugins/MagicCommand/src/components/MagicCommandModal.vue +7 -4
- package/dist/plugins/MagicCommand/src/components/MagicCommandModal.vue.d.ts +0 -2
- package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue +6 -5
- package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue.d.ts +0 -2
- package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue +6 -4
- package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue.d.ts +0 -2
- package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue +5 -1
- package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue +47 -8
- package/dist/plugins/MagicModal/src/components/MagicModal.vue +5 -2
- package/dist/plugins/MagicModal/src/components/MagicModal.vue.d.ts +0 -1
- package/package.json +1 -1
package/dist/nuxt/module.json
CHANGED
package/dist/nuxt/types.d.mts
CHANGED
|
@@ -1,16 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import type { ModuleOptions } from './module.js'
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
declare module '@nuxt/schema' {
|
|
6
|
-
interface NuxtConfig { ['vueEquipment']?: Partial<ModuleOptions> }
|
|
7
|
-
interface NuxtOptions { ['vueEquipment']?: ModuleOptions }
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
declare module 'nuxt/schema' {
|
|
11
|
-
interface NuxtConfig { ['vueEquipment']?: Partial<ModuleOptions> }
|
|
12
|
-
interface NuxtOptions { ['vueEquipment']?: ModuleOptions }
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
export type { ModuleOptions, default } from './module.js'
|
|
1
|
+
export { type ModuleOptions, default } from './module.js'
|
package/dist/nuxt/types.d.ts
CHANGED
|
@@ -1,16 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import type { ModuleOptions } from './module'
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
declare module '@nuxt/schema' {
|
|
6
|
-
interface NuxtConfig { ['vueEquipment']?: Partial<ModuleOptions> }
|
|
7
|
-
interface NuxtOptions { ['vueEquipment']?: ModuleOptions }
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
declare module 'nuxt/schema' {
|
|
11
|
-
interface NuxtConfig { ['vueEquipment']?: Partial<ModuleOptions> }
|
|
12
|
-
interface NuxtOptions { ['vueEquipment']?: ModuleOptions }
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
export type { ModuleOptions, default } from './module'
|
|
1
|
+
export { type ModuleOptions, default } from './module'
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
<magic-drawer
|
|
3
3
|
:id="commandId"
|
|
4
4
|
class="magic-command-drawer"
|
|
5
|
-
:class="props.class"
|
|
6
5
|
:options="options"
|
|
6
|
+
v-bind="$attrs"
|
|
7
7
|
>
|
|
8
8
|
<slot />
|
|
9
9
|
</magic-drawer>
|
|
@@ -18,8 +18,11 @@ import { MagicCommandInstanceId } from './../symbols'
|
|
|
18
18
|
|
|
19
19
|
import type { MagicCommandDrawerOptions } from '../types'
|
|
20
20
|
|
|
21
|
+
defineOptions({
|
|
22
|
+
inheritAttrs: false,
|
|
23
|
+
})
|
|
24
|
+
|
|
21
25
|
interface MagicCommandProps {
|
|
22
|
-
class?: MaybeRef<string>
|
|
23
26
|
options?: MagicCommandDrawerOptions
|
|
24
27
|
}
|
|
25
28
|
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { type MaybeRef } from 'vue';
|
|
2
1
|
import type { MagicCommandDrawerOptions } from '../types';
|
|
3
2
|
interface MagicCommandProps {
|
|
4
|
-
class?: MaybeRef<string>;
|
|
5
3
|
options?: MagicCommandDrawerOptions;
|
|
6
4
|
}
|
|
7
5
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToOption<MagicCommandProps>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<MagicCommandProps>>>, {}, {}>, {
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
<magic-modal
|
|
3
3
|
:id="commandId"
|
|
4
4
|
class="magic-command-modal"
|
|
5
|
-
:class="props.class"
|
|
6
5
|
:options="options"
|
|
6
|
+
v-bind="$attrs"
|
|
7
7
|
>
|
|
8
8
|
<slot />
|
|
9
9
|
</magic-modal>
|
|
10
10
|
</template>
|
|
11
11
|
|
|
12
12
|
<script setup lang="ts">
|
|
13
|
-
import { inject, watch, onBeforeUnmount
|
|
13
|
+
import { inject, watch, onBeforeUnmount } from 'vue'
|
|
14
14
|
import { useMagicEmitter } from '@maas/vue-equipment/plugins'
|
|
15
15
|
import { useMagicModal } from '../../../MagicModal'
|
|
16
16
|
import { useMagicCommand } from '../composables/useMagicCommand'
|
|
@@ -18,12 +18,15 @@ import { MagicCommandInstanceId } from './../symbols'
|
|
|
18
18
|
|
|
19
19
|
import type { MagicCommandModalOptions } from '../types'
|
|
20
20
|
|
|
21
|
+
defineOptions({
|
|
22
|
+
inheritAttrs: false,
|
|
23
|
+
})
|
|
24
|
+
|
|
21
25
|
interface MagicCommandProps {
|
|
22
|
-
class?: MaybeRef<string>
|
|
23
26
|
options?: MagicCommandModalOptions
|
|
24
27
|
}
|
|
25
28
|
|
|
26
|
-
|
|
29
|
+
defineProps<MagicCommandProps>()
|
|
27
30
|
|
|
28
31
|
const commandId = inject(MagicCommandInstanceId, '')
|
|
29
32
|
const emitter = useMagicEmitter()
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { type MaybeRef } from 'vue';
|
|
2
1
|
import type { MagicCommandModalOptions } from '../types';
|
|
3
2
|
interface MagicCommandProps {
|
|
4
|
-
class?: MaybeRef<string>;
|
|
5
3
|
options?: MagicCommandModalOptions;
|
|
6
4
|
}
|
|
7
5
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToOption<MagicCommandProps>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<MagicCommandProps>>>, {}, {}>, {
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
3
|
ref="drawerRef"
|
|
4
|
-
class="magic-draggable"
|
|
5
4
|
:id="toValue(id)"
|
|
6
5
|
:class="[
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
'magic-draggable',
|
|
9
7
|
{
|
|
10
8
|
'-dragging': dragging,
|
|
11
9
|
'-disabled': disabled,
|
|
12
10
|
},
|
|
13
11
|
]"
|
|
12
|
+
v-bind="$attrs"
|
|
14
13
|
>
|
|
15
14
|
<div class="magic-draggable__wrapper" ref="wrapperRef">
|
|
16
15
|
<component
|
|
@@ -45,11 +44,13 @@ import { defaultOptions } from '../utils/defaultOptions'
|
|
|
45
44
|
|
|
46
45
|
import type { MagicDraggableOptions } from '../types'
|
|
47
46
|
|
|
47
|
+
defineOptions({
|
|
48
|
+
inheritAttrs: false,
|
|
49
|
+
})
|
|
50
|
+
|
|
48
51
|
interface MagicDraggableProps {
|
|
49
52
|
id: MaybeRef<string>
|
|
50
|
-
class?: MaybeRef<string>
|
|
51
53
|
component?: Component
|
|
52
|
-
props?: Record<string, unknown>
|
|
53
54
|
options?: MagicDraggableOptions
|
|
54
55
|
}
|
|
55
56
|
|
|
@@ -2,9 +2,7 @@ import { type Component, type MaybeRef } from 'vue';
|
|
|
2
2
|
import type { MagicDraggableOptions } from '../types';
|
|
3
3
|
interface MagicDraggableProps {
|
|
4
4
|
id: MaybeRef<string>;
|
|
5
|
-
class?: MaybeRef<string>;
|
|
6
5
|
component?: Component;
|
|
7
|
-
props?: Record<string, unknown>;
|
|
8
6
|
options?: MagicDraggableOptions;
|
|
9
7
|
}
|
|
10
8
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<MagicDraggableProps>, {
|
|
@@ -6,10 +6,9 @@
|
|
|
6
6
|
>
|
|
7
7
|
<div
|
|
8
8
|
ref="drawerRef"
|
|
9
|
-
class="magic-drawer"
|
|
10
9
|
:id="toValue(id)"
|
|
11
10
|
:class="[
|
|
12
|
-
|
|
11
|
+
'magic-drawer',
|
|
13
12
|
`-${mappedOptions.position}`,
|
|
14
13
|
{
|
|
15
14
|
'-dragging': dragging,
|
|
@@ -17,6 +16,7 @@
|
|
|
17
16
|
'-disabled': disabled,
|
|
18
17
|
},
|
|
19
18
|
]"
|
|
19
|
+
v-bind="$attrs"
|
|
20
20
|
aria-modal="true"
|
|
21
21
|
>
|
|
22
22
|
<transition
|
|
@@ -105,6 +105,10 @@ import '@maas/vue-equipment/utils/css/animations/slide-ttb-out.css'
|
|
|
105
105
|
import '@maas/vue-equipment/utils/css/animations/slide-btt-out.css'
|
|
106
106
|
import { useMagicDrawer } from '../composables/useMagicDrawer'
|
|
107
107
|
|
|
108
|
+
defineOptions({
|
|
109
|
+
inheritAttrs: false,
|
|
110
|
+
})
|
|
111
|
+
|
|
108
112
|
// Prevent deep merge of certain options
|
|
109
113
|
// In this case, don’t merge the `close` and `points` options
|
|
110
114
|
const customDefu = createDefu((obj, key, value) => {
|
|
@@ -116,9 +120,7 @@ const customDefu = createDefu((obj, key, value) => {
|
|
|
116
120
|
|
|
117
121
|
interface MagicDrawerProps {
|
|
118
122
|
id: MaybeRef<string>
|
|
119
|
-
class?: MaybeRef<string>
|
|
120
123
|
component?: Component
|
|
121
|
-
props?: Record<string, unknown>
|
|
122
124
|
options?: MagicDrawerOptions
|
|
123
125
|
}
|
|
124
126
|
|
|
@@ -12,9 +12,7 @@ import '@maas/vue-equipment/utils/css/animations/slide-ttb-out.css';
|
|
|
12
12
|
import '@maas/vue-equipment/utils/css/animations/slide-btt-out.css';
|
|
13
13
|
interface MagicDrawerProps {
|
|
14
14
|
id: MaybeRef<string>;
|
|
15
|
-
class?: MaybeRef<string>;
|
|
16
15
|
component?: Component;
|
|
17
|
-
props?: Record<string, unknown>;
|
|
18
16
|
options?: MagicDrawerOptions;
|
|
19
17
|
}
|
|
20
18
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<MagicDrawerProps>, {
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
<div
|
|
13
13
|
class="magic-menu-content"
|
|
14
14
|
:data-id="`${viewId}-content`"
|
|
15
|
+
v-bind="$attrs"
|
|
15
16
|
v-if="innerActive"
|
|
16
17
|
>
|
|
17
18
|
<magic-menu-float :placement="placement" :arrow="arrow">
|
|
@@ -45,13 +46,16 @@ import { useMenuState } from '../composables/private/useMenuState'
|
|
|
45
46
|
import { useMenuCallback } from '../composables/private/useMenuCallback'
|
|
46
47
|
import { useMenuDOM } from '../composables/private/useMenuDOM'
|
|
47
48
|
|
|
49
|
+
defineOptions({
|
|
50
|
+
inheritAttrs: false,
|
|
51
|
+
})
|
|
52
|
+
|
|
48
53
|
interface MagicMenuContentProps {
|
|
49
54
|
placement?: Placement
|
|
50
55
|
arrow?: boolean
|
|
51
56
|
}
|
|
52
57
|
|
|
53
58
|
defineProps<MagicMenuContentProps>()
|
|
54
|
-
|
|
55
59
|
const contentRef = ref<HTMLElement | undefined>(undefined)
|
|
56
60
|
|
|
57
61
|
const instanceId = inject(MagicMenuInstanceId, undefined)
|
|
@@ -71,18 +71,57 @@ const mappedPlacement = computed(() => {
|
|
|
71
71
|
})
|
|
72
72
|
|
|
73
73
|
const hasArrow = computed(
|
|
74
|
-
() => props.arrow
|
|
74
|
+
() => props.arrow ?? (state.options.mode === 'dropdown' && !view?.parent.item)
|
|
75
75
|
)
|
|
76
76
|
|
|
77
77
|
const mappedMiddleware = computed(() => {
|
|
78
|
-
const middleware = [
|
|
78
|
+
const middleware = []
|
|
79
79
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
80
|
+
switch (state.options.mode) {
|
|
81
|
+
case 'menubar':
|
|
82
|
+
if (!view?.parent.item) {
|
|
83
|
+
middleware.push(
|
|
84
|
+
flip({
|
|
85
|
+
crossAxis: true,
|
|
86
|
+
})
|
|
87
|
+
)
|
|
88
|
+
} else if (!!view?.parent.item) {
|
|
89
|
+
middleware.push(
|
|
90
|
+
flip({
|
|
91
|
+
crossAxis: false,
|
|
92
|
+
})
|
|
93
|
+
)
|
|
94
|
+
middleware.push(
|
|
95
|
+
shift({
|
|
96
|
+
crossAxis: true,
|
|
97
|
+
limiter: limitShift(),
|
|
98
|
+
})
|
|
99
|
+
)
|
|
100
|
+
}
|
|
101
|
+
break
|
|
102
|
+
case 'dropdown':
|
|
103
|
+
middleware.push(
|
|
104
|
+
flip({
|
|
105
|
+
mainAxis: true,
|
|
106
|
+
crossAxis: false,
|
|
107
|
+
})
|
|
108
|
+
)
|
|
109
|
+
middleware.push(
|
|
110
|
+
shift({
|
|
111
|
+
mainAxis: true,
|
|
112
|
+
crossAxis: false,
|
|
113
|
+
limiter: limitShift(),
|
|
114
|
+
})
|
|
115
|
+
)
|
|
116
|
+
break
|
|
117
|
+
case 'context':
|
|
118
|
+
middleware.push(
|
|
119
|
+
flip({
|
|
120
|
+
mainAxis: true,
|
|
121
|
+
crossAxis: true,
|
|
122
|
+
})
|
|
123
|
+
)
|
|
124
|
+
break
|
|
86
125
|
}
|
|
87
126
|
|
|
88
127
|
return middleware
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
ref="modalRef"
|
|
10
10
|
class="magic-modal"
|
|
11
11
|
:id="toValue(id)"
|
|
12
|
-
|
|
12
|
+
v-bind="$attrs"
|
|
13
13
|
@click.self="close"
|
|
14
14
|
aria-modal="true"
|
|
15
15
|
>
|
|
@@ -76,6 +76,10 @@ import type { MagicModalOptions } from './../types/index'
|
|
|
76
76
|
import '@maas/vue-equipment/utils/css/animations/fade-in.css'
|
|
77
77
|
import '@maas/vue-equipment/utils/css/animations/fade-out.css'
|
|
78
78
|
|
|
79
|
+
defineOptions({
|
|
80
|
+
inheritAttrs: false,
|
|
81
|
+
})
|
|
82
|
+
|
|
79
83
|
// Prevent keyListener array from being merged with default
|
|
80
84
|
const customDefu = createDefu((obj, key, value) => {
|
|
81
85
|
if (key === 'close') {
|
|
@@ -86,7 +90,6 @@ const customDefu = createDefu((obj, key, value) => {
|
|
|
86
90
|
|
|
87
91
|
interface MagicModalProps {
|
|
88
92
|
id: MaybeRef<string>
|
|
89
|
-
class?: MaybeRef<string>
|
|
90
93
|
component?: Component
|
|
91
94
|
props?: Record<string, unknown>
|
|
92
95
|
options?: MagicModalOptions
|
|
@@ -4,7 +4,6 @@ import '@maas/vue-equipment/utils/css/animations/fade-in.css';
|
|
|
4
4
|
import '@maas/vue-equipment/utils/css/animations/fade-out.css';
|
|
5
5
|
interface MagicModalProps {
|
|
6
6
|
id: MaybeRef<string>;
|
|
7
|
-
class?: MaybeRef<string>;
|
|
8
7
|
component?: Component;
|
|
9
8
|
props?: Record<string, unknown>;
|
|
10
9
|
options?: MagicModalOptions;
|
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.29.
|
|
4
|
+
"version": "0.29.5",
|
|
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",
|