@maas/vue-equipment 1.0.0-beta.7 → 1.0.0-beta.9
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/nuxt/module.mjs +7 -0
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue +11 -8
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue.d.ts +3 -0
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue +2 -1
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue.d.ts +2 -0
- package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue +2 -1
- package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.vue +3 -1
- package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue.d.ts +1 -1
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableDrag.mjs +1 -1
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableScrollLock.mjs +32 -12
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableSnap.d.ts +3 -3
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableState.mjs +4 -4
- package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue.d.ts +12 -12
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDOM.mjs +32 -12
- package/dist/plugins/MagicEmitter/src/composables/useMagicEmitter.d.ts +36 -36
- package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.vue +1 -1
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCallback.mjs +1 -1
- package/dist/plugins/MagicMenu/src/composables/private/useMenuDOM.mjs +33 -13
- package/dist/plugins/MagicModal/src/components/MagicModal.vue.d.ts +6 -6
- package/dist/plugins/MagicModal/src/composables/private/useModalDOM.mjs +32 -12
- package/dist/plugins/MagicPie/index.d.ts +7 -0
- package/dist/plugins/MagicPie/index.mjs +8 -0
- package/dist/plugins/MagicPie/nuxt.d.ts +2 -0
- package/dist/plugins/MagicPie/nuxt.mjs +23 -0
- package/dist/plugins/MagicPie/src/components/MagicPie.vue +202 -0
- package/dist/plugins/MagicPie/src/components/MagicPie.vue.d.ts +7 -0
- package/dist/plugins/MagicPie/src/composables/private/usePieState.d.ts +6 -0
- package/dist/plugins/MagicPie/src/composables/private/usePieState.mjs +33 -0
- package/dist/plugins/MagicPie/src/composables/useMagicPie.d.ts +13 -0
- package/dist/plugins/MagicPie/src/composables/useMagicPie.mjs +43 -0
- package/dist/plugins/MagicPie/src/types/index.d.ts +9 -0
- package/dist/plugins/MagicPie/src/types/index.mjs +0 -0
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue +9 -9
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue.d.ts +1 -1
- package/dist/plugins/MagicToast/src/composables/private/useToastDrag.mjs +1 -1
- package/dist/plugins/MagicToast/src/composables/private/useToastScrollLock.mjs +31 -13
- package/dist/plugins/index.d.ts +1 -0
- package/dist/plugins/index.mjs +1 -0
- package/dist/utils/index.d.ts +7 -2
- package/dist/utils/index.js +39 -3
- package/dist/utils/index.js.map +1 -1
- package/package.json +1 -1
package/dist/nuxt/module.json
CHANGED
package/dist/nuxt/module.mjs
CHANGED
|
@@ -71,6 +71,13 @@ const functions$1 = [
|
|
|
71
71
|
docs: "https://maas.egineering/vue-equipment/plugins/MagicNoise/",
|
|
72
72
|
description: "magicNoise is a rendition of pixelated static noise"
|
|
73
73
|
},
|
|
74
|
+
{
|
|
75
|
+
name: "MagicPie",
|
|
76
|
+
"package": "plugins",
|
|
77
|
+
lastUpdated: 0,
|
|
78
|
+
docs: "https://maas.egineering/vue-equipment/plugins/MagicPie/",
|
|
79
|
+
description: "magicPie renders a percentage based value as `SVG`"
|
|
80
|
+
},
|
|
74
81
|
{
|
|
75
82
|
name: "MagicPlayer",
|
|
76
83
|
"package": "plugins",
|
|
@@ -11,6 +11,7 @@ import { MagicAccordionInstanceId, MagicAccordionViewId } from "../symbols";
|
|
|
11
11
|
export default /* @__PURE__ */ _defineComponent({
|
|
12
12
|
__name: "MagicAccordionTrigger",
|
|
13
13
|
props: {
|
|
14
|
+
viewId: { type: String, required: false },
|
|
14
15
|
disabled: { type: null, required: false, default: false },
|
|
15
16
|
trigger: { type: String, required: false, default: "click" },
|
|
16
17
|
asChild: { type: Boolean, required: false, default: false }
|
|
@@ -18,28 +19,29 @@ export default /* @__PURE__ */ _defineComponent({
|
|
|
18
19
|
setup(__props) {
|
|
19
20
|
const elRef = useTemplateRef("el");
|
|
20
21
|
const instanceId = inject(MagicAccordionInstanceId, void 0);
|
|
21
|
-
const
|
|
22
|
+
const injectedViewId = inject(MagicAccordionViewId, void 0);
|
|
23
|
+
const mappedViewId = computed(() => __props.viewId ?? injectedViewId);
|
|
22
24
|
if (!instanceId) {
|
|
23
25
|
throw new Error(
|
|
24
26
|
"MagicAccordionTrigger must be nested inside MagicAccordionProvider"
|
|
25
27
|
);
|
|
26
28
|
}
|
|
27
|
-
if (!
|
|
29
|
+
if (!mappedViewId.value) {
|
|
28
30
|
throw new Error(
|
|
29
|
-
"MagicAccordionTrigger must be nested inside MagicAccordionView"
|
|
31
|
+
"MagicAccordionTrigger must be nested inside MagicAccordionView or a viewId must be provided"
|
|
30
32
|
);
|
|
31
33
|
}
|
|
32
34
|
const { initializeState } = useAccordionState(instanceId);
|
|
33
35
|
const state = initializeState();
|
|
34
36
|
const { getView } = useAccordionView(instanceId);
|
|
35
|
-
const view = getView(
|
|
37
|
+
const view = getView(mappedViewId.value);
|
|
36
38
|
const mappedDisabled = computed(
|
|
37
39
|
() => toValue(__props.disabled) || state.options.disabled
|
|
38
40
|
);
|
|
39
41
|
const { onMouseenter, onClick, onEnter } = useAccordionTrigger({
|
|
40
|
-
instanceId,
|
|
41
|
-
viewId,
|
|
42
42
|
elRef,
|
|
43
|
+
instanceId,
|
|
44
|
+
viewId: mappedViewId.value,
|
|
43
45
|
disabled: __props.disabled,
|
|
44
46
|
trigger: __props.trigger
|
|
45
47
|
});
|
|
@@ -48,9 +50,10 @@ export default /* @__PURE__ */ _defineComponent({
|
|
|
48
50
|
return _openBlock(), _createBlock(_unref(Primitive), {
|
|
49
51
|
ref: "el",
|
|
50
52
|
"as-child": _ctx.asChild,
|
|
53
|
+
"data-id": `${mappedViewId.value}-trigger`,
|
|
51
54
|
"data-disabled": mappedDisabled.value,
|
|
52
|
-
class: "magic-accordion-trigger",
|
|
53
55
|
as: "button",
|
|
56
|
+
class: "magic-accordion-trigger",
|
|
54
57
|
onMouseenter: _unref(onMouseenter),
|
|
55
58
|
onClick: _unref(onClick)
|
|
56
59
|
}, {
|
|
@@ -61,7 +64,7 @@ export default /* @__PURE__ */ _defineComponent({
|
|
|
61
64
|
]),
|
|
62
65
|
_: 3
|
|
63
66
|
/* FORWARDED */
|
|
64
|
-
}, 8, ["as-child", "data-disabled", "onMouseenter", "onClick"]);
|
|
67
|
+
}, 8, ["as-child", "data-id", "data-disabled", "onMouseenter", "onClick"]);
|
|
65
68
|
};
|
|
66
69
|
}
|
|
67
70
|
});
|
|
@@ -2,10 +2,12 @@ import { type MaybeRef } from 'vue';
|
|
|
2
2
|
import { Primitive } from '@maas/vue-primitive';
|
|
3
3
|
import type { Interaction } from '../types/index.js';
|
|
4
4
|
interface MagicAccordionTriggerProps {
|
|
5
|
+
viewId?: string;
|
|
5
6
|
disabled?: MaybeRef<boolean>;
|
|
6
7
|
trigger?: Interaction;
|
|
7
8
|
asChild?: boolean;
|
|
8
9
|
}
|
|
10
|
+
declare const mappedViewId: import("vue").ComputedRef<string | undefined>;
|
|
9
11
|
declare const view: import("../types").AccordionView | undefined;
|
|
10
12
|
declare const mappedDisabled: import("vue").ComputedRef<boolean | undefined>;
|
|
11
13
|
declare const onMouseenter: () => void, onClick: () => void;
|
|
@@ -18,6 +20,7 @@ type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$
|
|
|
18
20
|
}>;
|
|
19
21
|
declare const __VLS_self: import("vue").DefineComponent<MagicAccordionTriggerProps, {
|
|
20
22
|
Primitive: typeof Primitive;
|
|
23
|
+
mappedViewId: typeof mappedViewId;
|
|
21
24
|
view: typeof view;
|
|
22
25
|
mappedDisabled: typeof mappedDisabled;
|
|
23
26
|
onMouseenter: typeof onMouseenter;
|
|
@@ -38,6 +38,7 @@ export default /* @__PURE__ */ _defineComponent({
|
|
|
38
38
|
return (_ctx, _cache) => {
|
|
39
39
|
return _openBlock(), _createBlock(_unref(Primitive), {
|
|
40
40
|
"as-child": _ctx.asChild,
|
|
41
|
+
"data-id": mappedId.value,
|
|
41
42
|
"data-active": _unref(view)?.active,
|
|
42
43
|
class: "magic-accordion-view"
|
|
43
44
|
}, {
|
|
@@ -48,7 +49,7 @@ export default /* @__PURE__ */ _defineComponent({
|
|
|
48
49
|
]),
|
|
49
50
|
_: 3
|
|
50
51
|
/* FORWARDED */
|
|
51
|
-
}, 8, ["as-child", "data-active"]);
|
|
52
|
+
}, 8, ["as-child", "data-id", "data-active"]);
|
|
52
53
|
};
|
|
53
54
|
}
|
|
54
55
|
});
|
|
@@ -4,6 +4,7 @@ interface MagicAccordionViewProps {
|
|
|
4
4
|
asChild?: boolean;
|
|
5
5
|
active?: boolean;
|
|
6
6
|
}
|
|
7
|
+
declare const mappedId: import("vue").ComputedRef<string>;
|
|
7
8
|
declare const view: import("../types").AccordionView;
|
|
8
9
|
declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
|
|
9
10
|
declare var __VLS_6: {
|
|
@@ -14,6 +15,7 @@ type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$
|
|
|
14
15
|
}>;
|
|
15
16
|
declare const __VLS_self: import("vue").DefineComponent<MagicAccordionViewProps, {
|
|
16
17
|
Primitive: typeof Primitive;
|
|
18
|
+
mappedId: typeof mappedId;
|
|
17
19
|
view: typeof view;
|
|
18
20
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicAccordionViewProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
21
|
declare const __VLS_component: import("vue").DefineComponent<MagicAccordionViewProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicAccordionViewProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -73,6 +73,7 @@ export default /* @__PURE__ */ _defineComponent({
|
|
|
73
73
|
provide(MagicCommandProviderOptions, mappedOptions);
|
|
74
74
|
return (_ctx, _cache) => {
|
|
75
75
|
return _openBlock(), _createBlock(_unref(Primitive), {
|
|
76
|
+
"data-id": _ctx.id,
|
|
76
77
|
"as-child": _ctx.asChild,
|
|
77
78
|
class: "magic-command-provider"
|
|
78
79
|
}, {
|
|
@@ -81,7 +82,7 @@ export default /* @__PURE__ */ _defineComponent({
|
|
|
81
82
|
]),
|
|
82
83
|
_: 3
|
|
83
84
|
/* FORWARDED */
|
|
84
|
-
}, 8, ["as-child"]);
|
|
85
|
+
}, 8, ["data-id", "as-child"]);
|
|
85
86
|
};
|
|
86
87
|
}
|
|
87
88
|
});
|
|
@@ -36,7 +36,9 @@ export default /* @__PURE__ */ _defineComponent({
|
|
|
36
36
|
);
|
|
37
37
|
}
|
|
38
38
|
if (!mappedViewId.value) {
|
|
39
|
-
throw new Error(
|
|
39
|
+
throw new Error(
|
|
40
|
+
"MagicCommandTrigger must be nested inside MagicCommandView or a viewId must be provided"
|
|
41
|
+
);
|
|
40
42
|
}
|
|
41
43
|
const { getView } = useCommandView(instanceId);
|
|
42
44
|
const view = getView(mappedViewId.value);
|
|
@@ -329,10 +329,10 @@ export function useDraggableDrag(args) {
|
|
|
329
329
|
function onPointerdown(e) {
|
|
330
330
|
const scrollLockValue = toValue(scrollLock);
|
|
331
331
|
if (scrollLockValue) {
|
|
332
|
-
lockScroll();
|
|
333
332
|
if (typeof scrollLockValue === "object" && scrollLockValue.padding) {
|
|
334
333
|
addScrollLockPadding();
|
|
335
334
|
}
|
|
335
|
+
lockScroll();
|
|
336
336
|
}
|
|
337
337
|
if (dragging.value) {
|
|
338
338
|
return;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { shallowRef, ref } from "vue";
|
|
2
2
|
import { useScrollLock } from "@vueuse/core";
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
matchClass,
|
|
5
|
+
scrollbarWidth,
|
|
6
|
+
scrollbarGutterSupport
|
|
7
|
+
} from "@maas/vue-equipment/utils";
|
|
4
8
|
const scrollLock = typeof window !== "undefined" ? useScrollLock(document?.documentElement) : shallowRef(false);
|
|
5
9
|
export function useDraggableScrollLock() {
|
|
6
10
|
const positionFixedElements = ref([]);
|
|
@@ -13,24 +17,40 @@ export function useDraggableScrollLock() {
|
|
|
13
17
|
function addScrollLockPadding() {
|
|
14
18
|
if (typeof window === "undefined") return;
|
|
15
19
|
const exclude = new RegExp(/magic-draggable/);
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
20
|
+
document.body.style.setProperty(
|
|
21
|
+
"--scrollbar-width",
|
|
22
|
+
`${scrollbarWidth()}px`
|
|
23
|
+
);
|
|
19
24
|
positionFixedElements.value = [
|
|
20
25
|
...document.body.getElementsByTagName("*")
|
|
21
26
|
].filter(
|
|
22
|
-
(x) => getComputedStyle(x, null).getPropertyValue("position") === "fixed" && !matchClass(x, exclude)
|
|
23
|
-
);
|
|
24
|
-
positionFixedElements.value.forEach(
|
|
25
|
-
(elem) => elem.style.paddingRight = "var(--scrollbar-width)"
|
|
27
|
+
(x) => getComputedStyle(x, null).getPropertyValue("position") === "fixed" && getComputedStyle(x, null).getPropertyValue("right") === "0px" && !matchClass(x, exclude)
|
|
26
28
|
);
|
|
29
|
+
switch (scrollbarGutterSupport()) {
|
|
30
|
+
case true:
|
|
31
|
+
document.documentElement.style.scrollbarGutter = "stable";
|
|
32
|
+
positionFixedElements.value.forEach((elem) => {
|
|
33
|
+
elem.style.scrollbarGutter = "stable";
|
|
34
|
+
elem.style.overflow = "auto";
|
|
35
|
+
});
|
|
36
|
+
break;
|
|
37
|
+
case false:
|
|
38
|
+
document.body.style.paddingRight = "var(--scrollbar-width)";
|
|
39
|
+
positionFixedElements.value.forEach(
|
|
40
|
+
(elem) => elem.style.paddingRight = "var(--scrollbar-width)"
|
|
41
|
+
);
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
27
44
|
}
|
|
28
45
|
function removeScrollLockPadding() {
|
|
29
|
-
document.
|
|
46
|
+
document.documentElement.style.scrollbarGutter = "";
|
|
30
47
|
document.body.style.removeProperty("--scrollbar-width");
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
48
|
+
document.body.style.paddingRight = "";
|
|
49
|
+
positionFixedElements.value.forEach((elem) => {
|
|
50
|
+
elem.style.paddingRight = "";
|
|
51
|
+
elem.style.scrollbarGutter = "";
|
|
52
|
+
elem.style.overflow = "";
|
|
53
|
+
});
|
|
34
54
|
}
|
|
35
55
|
return {
|
|
36
56
|
lockScroll,
|
|
@@ -22,13 +22,13 @@ type SnapToArgs = {
|
|
|
22
22
|
};
|
|
23
23
|
export declare function useDraggableSnap(args: UseDraggableSnapArgs): {
|
|
24
24
|
mappedSnapPoints: import("@vueuse/core").ComputedRefWithControl<Coordinates[]>;
|
|
25
|
-
activeSnapPoint: Ref<("
|
|
25
|
+
activeSnapPoint: Ref<("top-left" | "top" | "top-right" | "left" | "center" | "right" | "bottom-left" | "bottom" | "bottom-right") | ["top-left" | "top" | "top-right" | "left" | "center" | "right" | "bottom-left" | "bottom" | "bottom-right", offset?: {
|
|
26
26
|
x?: number | undefined;
|
|
27
27
|
y?: number | undefined;
|
|
28
|
-
} | undefined] | undefined, "
|
|
28
|
+
} | undefined] | undefined, "top-left" | "top" | "top-right" | "left" | "center" | "right" | "bottom-left" | "bottom" | "bottom-right" | ["top-left" | "top" | "top-right" | "left" | "center" | "right" | "bottom-left" | "bottom" | "bottom-right", offset?: {
|
|
29
29
|
x?: number;
|
|
30
30
|
y?: number;
|
|
31
|
-
} | undefined] | ["
|
|
31
|
+
} | undefined] | ["top-left" | "top" | "top-right" | "left" | "center" | "right" | "bottom-left" | "bottom" | "bottom-right", offset?: {
|
|
32
32
|
x?: number | undefined;
|
|
33
33
|
y?: number | undefined;
|
|
34
34
|
} | undefined] | undefined>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ref, reactive, toValue } from "vue";
|
|
2
|
-
const
|
|
2
|
+
const draggableStateStore = ref([]);
|
|
3
3
|
export function useDraggableState(id) {
|
|
4
4
|
function createState(id2) {
|
|
5
5
|
const state = {
|
|
@@ -22,18 +22,18 @@ export function useDraggableState(id) {
|
|
|
22
22
|
}
|
|
23
23
|
function addState(id2) {
|
|
24
24
|
const state = createState(id2);
|
|
25
|
-
|
|
25
|
+
draggableStateStore.value = [...draggableStateStore.value, state];
|
|
26
26
|
return state;
|
|
27
27
|
}
|
|
28
28
|
function initializeState() {
|
|
29
|
-
let state =
|
|
29
|
+
let state = draggableStateStore.value.find((entry) => {
|
|
30
30
|
return entry.id === id;
|
|
31
31
|
});
|
|
32
32
|
if (!state) state = addState(toValue(id));
|
|
33
33
|
return state;
|
|
34
34
|
}
|
|
35
35
|
function deleteState() {
|
|
36
|
-
|
|
36
|
+
draggableStateStore.value = draggableStateStore.value.filter(
|
|
37
37
|
(x) => x.id !== id
|
|
38
38
|
);
|
|
39
39
|
}
|
|
@@ -76,9 +76,7 @@ declare const mappedOptions: Omit<MagicDrawerOptions, keyof MagicDrawerOptions>
|
|
|
76
76
|
easing?: (t: number) => number;
|
|
77
77
|
};
|
|
78
78
|
});
|
|
79
|
-
|
|
80
|
-
tag: "dialog" | "div";
|
|
81
|
-
focusTrap: boolean | import("focus-trap").Options;
|
|
79
|
+
tag: "div" | "dialog";
|
|
82
80
|
scrollLock: {
|
|
83
81
|
padding: boolean;
|
|
84
82
|
} | ((boolean | {
|
|
@@ -110,10 +108,13 @@ declare const mappedOptions: Omit<MagicDrawerOptions, keyof MagicDrawerOptions>
|
|
|
110
108
|
} & true, "padding"> & {
|
|
111
109
|
padding: boolean;
|
|
112
110
|
});
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
111
|
+
snapPoints: import("../types/index").DrawerSnapPoint[];
|
|
112
|
+
initial: {
|
|
113
|
+
open?: boolean;
|
|
114
|
+
transition?: boolean;
|
|
115
|
+
snapPoint?: import("../types/index").DrawerSnapPoint;
|
|
116
116
|
};
|
|
117
|
+
position: "top" | "left" | "right" | "bottom";
|
|
117
118
|
keyListener: ({
|
|
118
119
|
close?: string[] | false;
|
|
119
120
|
} & import("../../../../utils").RequireAll<{
|
|
@@ -127,12 +128,11 @@ declare const mappedOptions: Omit<MagicDrawerOptions, keyof MagicDrawerOptions>
|
|
|
127
128
|
}>, "close"> & {
|
|
128
129
|
close: (false | string[] | undefined) & (false | string[]);
|
|
129
130
|
});
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
snapPoint?: import("../types/index").DrawerSnapPoint;
|
|
131
|
+
backdrop: boolean;
|
|
132
|
+
focusTrap: boolean | import("focus-trap").Options;
|
|
133
|
+
teleport: {
|
|
134
|
+
target?: string;
|
|
135
|
+
disabled?: boolean;
|
|
136
136
|
};
|
|
137
137
|
enableMousewheel: boolean;
|
|
138
138
|
preventZoom: boolean;
|
|
@@ -2,7 +2,11 @@ import { ref, shallowRef } from "vue";
|
|
|
2
2
|
import { defu } from "defu";
|
|
3
3
|
import { useScrollLock } from "@vueuse/core";
|
|
4
4
|
import { useFocusTrap } from "@vueuse/integrations/useFocusTrap";
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
matchClass,
|
|
7
|
+
scrollbarGutterSupport,
|
|
8
|
+
scrollbarWidth
|
|
9
|
+
} from "@maas/vue-equipment/utils";
|
|
6
10
|
const defaultOptions = {
|
|
7
11
|
focusTrap: false,
|
|
8
12
|
focusTarget: void 0,
|
|
@@ -36,24 +40,40 @@ export function useDrawerDOM(args) {
|
|
|
36
40
|
function addScrollLockPadding() {
|
|
37
41
|
if (typeof window === "undefined") return;
|
|
38
42
|
const exclude = new RegExp(/magic-drawer(__backdrop)?/);
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
43
|
+
document.body.style.setProperty(
|
|
44
|
+
"--scrollbar-width",
|
|
45
|
+
`${scrollbarWidth()}px`
|
|
46
|
+
);
|
|
42
47
|
positionFixedElements.value = [
|
|
43
48
|
...document.body.getElementsByTagName("*")
|
|
44
49
|
].filter(
|
|
45
|
-
(x) => getComputedStyle(x, null).getPropertyValue("position") === "fixed" && !matchClass(x, exclude)
|
|
46
|
-
);
|
|
47
|
-
positionFixedElements.value.forEach(
|
|
48
|
-
(elem) => elem.style.paddingRight = "var(--scrollbar-width)"
|
|
50
|
+
(x) => getComputedStyle(x, null).getPropertyValue("position") === "fixed" && getComputedStyle(x, null).getPropertyValue("right") === "0px" && !matchClass(x, exclude)
|
|
49
51
|
);
|
|
52
|
+
switch (scrollbarGutterSupport()) {
|
|
53
|
+
case true:
|
|
54
|
+
document.documentElement.style.scrollbarGutter = "stable";
|
|
55
|
+
positionFixedElements.value.forEach((elem) => {
|
|
56
|
+
elem.style.scrollbarGutter = "stable";
|
|
57
|
+
elem.style.overflow = "auto";
|
|
58
|
+
});
|
|
59
|
+
break;
|
|
60
|
+
case false:
|
|
61
|
+
document.body.style.paddingRight = "var(--scrollbar-width)";
|
|
62
|
+
positionFixedElements.value.forEach(
|
|
63
|
+
(elem) => elem.style.paddingRight = "var(--scrollbar-width)"
|
|
64
|
+
);
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
50
67
|
}
|
|
51
68
|
function removeScrollLockPadding() {
|
|
52
|
-
document.
|
|
69
|
+
document.documentElement.style.scrollbarGutter = "";
|
|
53
70
|
document.body.style.removeProperty("--scrollbar-width");
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
71
|
+
document.body.style.paddingRight = "";
|
|
72
|
+
positionFixedElements.value.forEach((elem) => {
|
|
73
|
+
elem.style.paddingRight = "";
|
|
74
|
+
elem.style.scrollbarGutter = "";
|
|
75
|
+
elem.style.overflow = "";
|
|
76
|
+
});
|
|
57
77
|
}
|
|
58
78
|
return {
|
|
59
79
|
trapFocus,
|
|
@@ -74,26 +74,26 @@ export declare function useMagicEmitter(): {
|
|
|
74
74
|
} & Omit<{
|
|
75
75
|
beforeSnap: {
|
|
76
76
|
id: string;
|
|
77
|
-
snapPoint: import("../../../
|
|
77
|
+
snapPoint: import("../../../MagicDraggable/src/types").DraggableSnapPoint;
|
|
78
78
|
} | {
|
|
79
79
|
id: string;
|
|
80
|
-
snapPoint: import("../../../
|
|
80
|
+
snapPoint: import("../../../MagicDrawer/src/types").DrawerSnapPoint;
|
|
81
81
|
};
|
|
82
82
|
snapTo: {
|
|
83
83
|
id: string;
|
|
84
|
-
snapPoint: import("../../../
|
|
84
|
+
snapPoint: import("../../../MagicDraggable/src/types").DraggableSnapPoint;
|
|
85
85
|
duration?: number;
|
|
86
86
|
} | {
|
|
87
87
|
id: string;
|
|
88
|
-
snapPoint: import("../../../
|
|
88
|
+
snapPoint: import("../../../MagicDrawer/src/types").DrawerSnapPoint;
|
|
89
89
|
duration?: number;
|
|
90
90
|
};
|
|
91
91
|
afterSnap: {
|
|
92
92
|
id: string;
|
|
93
|
-
snapPoint: import("../../../
|
|
93
|
+
snapPoint: import("../../../MagicDraggable/src/types").DraggableSnapPoint;
|
|
94
94
|
} | {
|
|
95
95
|
id: string;
|
|
96
|
-
snapPoint: import("../../../
|
|
96
|
+
snapPoint: import("../../../MagicDrawer/src/types").DrawerSnapPoint;
|
|
97
97
|
};
|
|
98
98
|
beforeDrag: {
|
|
99
99
|
id: string;
|
|
@@ -324,26 +324,26 @@ export declare function useMagicEmitter(): {
|
|
|
324
324
|
} & Omit<{
|
|
325
325
|
beforeSnap: {
|
|
326
326
|
id: string;
|
|
327
|
-
snapPoint: import("../../../
|
|
327
|
+
snapPoint: import("../../../MagicDraggable/src/types").DraggableSnapPoint;
|
|
328
328
|
} | {
|
|
329
329
|
id: string;
|
|
330
|
-
snapPoint: import("../../../
|
|
330
|
+
snapPoint: import("../../../MagicDrawer/src/types").DrawerSnapPoint;
|
|
331
331
|
};
|
|
332
332
|
snapTo: {
|
|
333
333
|
id: string;
|
|
334
|
-
snapPoint: import("../../../
|
|
334
|
+
snapPoint: import("../../../MagicDraggable/src/types").DraggableSnapPoint;
|
|
335
335
|
duration?: number;
|
|
336
336
|
} | {
|
|
337
337
|
id: string;
|
|
338
|
-
snapPoint: import("../../../
|
|
338
|
+
snapPoint: import("../../../MagicDrawer/src/types").DrawerSnapPoint;
|
|
339
339
|
duration?: number;
|
|
340
340
|
};
|
|
341
341
|
afterSnap: {
|
|
342
342
|
id: string;
|
|
343
|
-
snapPoint: import("../../../
|
|
343
|
+
snapPoint: import("../../../MagicDraggable/src/types").DraggableSnapPoint;
|
|
344
344
|
} | {
|
|
345
345
|
id: string;
|
|
346
|
-
snapPoint: import("../../../
|
|
346
|
+
snapPoint: import("../../../MagicDrawer/src/types").DrawerSnapPoint;
|
|
347
347
|
};
|
|
348
348
|
beforeDrag: {
|
|
349
349
|
id: string;
|
|
@@ -576,26 +576,26 @@ export declare function useMagicEmitter(): {
|
|
|
576
576
|
} & Omit<{
|
|
577
577
|
beforeSnap: {
|
|
578
578
|
id: string;
|
|
579
|
-
snapPoint: import("../../../
|
|
579
|
+
snapPoint: import("../../../MagicDraggable/src/types").DraggableSnapPoint;
|
|
580
580
|
} | {
|
|
581
581
|
id: string;
|
|
582
|
-
snapPoint: import("../../../
|
|
582
|
+
snapPoint: import("../../../MagicDrawer/src/types").DrawerSnapPoint;
|
|
583
583
|
};
|
|
584
584
|
snapTo: {
|
|
585
585
|
id: string;
|
|
586
|
-
snapPoint: import("../../../
|
|
586
|
+
snapPoint: import("../../../MagicDraggable/src/types").DraggableSnapPoint;
|
|
587
587
|
duration?: number;
|
|
588
588
|
} | {
|
|
589
589
|
id: string;
|
|
590
|
-
snapPoint: import("../../../
|
|
590
|
+
snapPoint: import("../../../MagicDrawer/src/types").DrawerSnapPoint;
|
|
591
591
|
duration?: number;
|
|
592
592
|
};
|
|
593
593
|
afterSnap: {
|
|
594
594
|
id: string;
|
|
595
|
-
snapPoint: import("../../../
|
|
595
|
+
snapPoint: import("../../../MagicDraggable/src/types").DraggableSnapPoint;
|
|
596
596
|
} | {
|
|
597
597
|
id: string;
|
|
598
|
-
snapPoint: import("../../../
|
|
598
|
+
snapPoint: import("../../../MagicDrawer/src/types").DrawerSnapPoint;
|
|
599
599
|
};
|
|
600
600
|
beforeDrag: {
|
|
601
601
|
id: string;
|
|
@@ -826,26 +826,26 @@ export declare function useMagicEmitter(): {
|
|
|
826
826
|
} & Omit<{
|
|
827
827
|
beforeSnap: {
|
|
828
828
|
id: string;
|
|
829
|
-
snapPoint: import("../../../
|
|
829
|
+
snapPoint: import("../../../MagicDraggable/src/types").DraggableSnapPoint;
|
|
830
830
|
} | {
|
|
831
831
|
id: string;
|
|
832
|
-
snapPoint: import("../../../
|
|
832
|
+
snapPoint: import("../../../MagicDrawer/src/types").DrawerSnapPoint;
|
|
833
833
|
};
|
|
834
834
|
snapTo: {
|
|
835
835
|
id: string;
|
|
836
|
-
snapPoint: import("../../../
|
|
836
|
+
snapPoint: import("../../../MagicDraggable/src/types").DraggableSnapPoint;
|
|
837
837
|
duration?: number;
|
|
838
838
|
} | {
|
|
839
839
|
id: string;
|
|
840
|
-
snapPoint: import("../../../
|
|
840
|
+
snapPoint: import("../../../MagicDrawer/src/types").DrawerSnapPoint;
|
|
841
841
|
duration?: number;
|
|
842
842
|
};
|
|
843
843
|
afterSnap: {
|
|
844
844
|
id: string;
|
|
845
|
-
snapPoint: import("../../../
|
|
845
|
+
snapPoint: import("../../../MagicDraggable/src/types").DraggableSnapPoint;
|
|
846
846
|
} | {
|
|
847
847
|
id: string;
|
|
848
|
-
snapPoint: import("../../../
|
|
848
|
+
snapPoint: import("../../../MagicDrawer/src/types").DrawerSnapPoint;
|
|
849
849
|
};
|
|
850
850
|
beforeDrag: {
|
|
851
851
|
id: string;
|
|
@@ -1078,26 +1078,26 @@ export declare function useMagicEmitter(): {
|
|
|
1078
1078
|
} & Omit<{
|
|
1079
1079
|
beforeSnap: {
|
|
1080
1080
|
id: string;
|
|
1081
|
-
snapPoint: import("../../../
|
|
1081
|
+
snapPoint: import("../../../MagicDraggable/src/types").DraggableSnapPoint;
|
|
1082
1082
|
} | {
|
|
1083
1083
|
id: string;
|
|
1084
|
-
snapPoint: import("../../../
|
|
1084
|
+
snapPoint: import("../../../MagicDrawer/src/types").DrawerSnapPoint;
|
|
1085
1085
|
};
|
|
1086
1086
|
snapTo: {
|
|
1087
1087
|
id: string;
|
|
1088
|
-
snapPoint: import("../../../
|
|
1088
|
+
snapPoint: import("../../../MagicDraggable/src/types").DraggableSnapPoint;
|
|
1089
1089
|
duration?: number;
|
|
1090
1090
|
} | {
|
|
1091
1091
|
id: string;
|
|
1092
|
-
snapPoint: import("../../../
|
|
1092
|
+
snapPoint: import("../../../MagicDrawer/src/types").DrawerSnapPoint;
|
|
1093
1093
|
duration?: number;
|
|
1094
1094
|
};
|
|
1095
1095
|
afterSnap: {
|
|
1096
1096
|
id: string;
|
|
1097
|
-
snapPoint: import("../../../
|
|
1097
|
+
snapPoint: import("../../../MagicDraggable/src/types").DraggableSnapPoint;
|
|
1098
1098
|
} | {
|
|
1099
1099
|
id: string;
|
|
1100
|
-
snapPoint: import("../../../
|
|
1100
|
+
snapPoint: import("../../../MagicDrawer/src/types").DrawerSnapPoint;
|
|
1101
1101
|
};
|
|
1102
1102
|
beforeDrag: {
|
|
1103
1103
|
id: string;
|
|
@@ -1328,26 +1328,26 @@ export declare function useMagicEmitter(): {
|
|
|
1328
1328
|
} & Omit<{
|
|
1329
1329
|
beforeSnap: {
|
|
1330
1330
|
id: string;
|
|
1331
|
-
snapPoint: import("../../../
|
|
1331
|
+
snapPoint: import("../../../MagicDraggable/src/types").DraggableSnapPoint;
|
|
1332
1332
|
} | {
|
|
1333
1333
|
id: string;
|
|
1334
|
-
snapPoint: import("../../../
|
|
1334
|
+
snapPoint: import("../../../MagicDrawer/src/types").DrawerSnapPoint;
|
|
1335
1335
|
};
|
|
1336
1336
|
snapTo: {
|
|
1337
1337
|
id: string;
|
|
1338
|
-
snapPoint: import("../../../
|
|
1338
|
+
snapPoint: import("../../../MagicDraggable/src/types").DraggableSnapPoint;
|
|
1339
1339
|
duration?: number;
|
|
1340
1340
|
} | {
|
|
1341
1341
|
id: string;
|
|
1342
|
-
snapPoint: import("../../../
|
|
1342
|
+
snapPoint: import("../../../MagicDrawer/src/types").DrawerSnapPoint;
|
|
1343
1343
|
duration?: number;
|
|
1344
1344
|
};
|
|
1345
1345
|
afterSnap: {
|
|
1346
1346
|
id: string;
|
|
1347
|
-
snapPoint: import("../../../
|
|
1347
|
+
snapPoint: import("../../../MagicDraggable/src/types").DraggableSnapPoint;
|
|
1348
1348
|
} | {
|
|
1349
1349
|
id: string;
|
|
1350
|
-
snapPoint: import("../../../
|
|
1350
|
+
snapPoint: import("../../../MagicDrawer/src/types").DrawerSnapPoint;
|
|
1351
1351
|
};
|
|
1352
1352
|
beforeDrag: {
|
|
1353
1353
|
id: string;
|
|
@@ -29,7 +29,7 @@ export default /* @__PURE__ */ _defineComponent({
|
|
|
29
29
|
}
|
|
30
30
|
if (!mappedViewId.value) {
|
|
31
31
|
throw new Error(
|
|
32
|
-
"
|
|
32
|
+
"MagicMenuRemote must be nested inside MagicMenuView or a viewId must be provided"
|
|
33
33
|
);
|
|
34
34
|
}
|
|
35
35
|
if (!__props.channelId) {
|
|
@@ -24,10 +24,10 @@ export function useMenuCallback(args) {
|
|
|
24
24
|
emitter.emit("afterEnter", { id: toValue(instanceId), viewId });
|
|
25
25
|
const scrollLock = state.options.scrollLock ?? ModeScrollLock[state.options.mode].value;
|
|
26
26
|
if (scrollLock) {
|
|
27
|
-
lockScroll();
|
|
28
27
|
if (typeof scrollLock === "object" && scrollLock.padding) {
|
|
29
28
|
addScrollLockPadding();
|
|
30
29
|
}
|
|
30
|
+
lockScroll();
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
function onBeforeLeave() {
|