@maas/vue-equipment 1.0.0-beta.1 → 1.0.0-beta.10
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/README.md +2 -2
- package/dist/composables/index.d.ts +5 -5
- package/dist/composables/index.js +23 -13
- package/dist/composables/index.js.map +1 -1
- package/dist/nuxt/module.json +1 -1
- package/dist/nuxt/module.mjs +9 -2
- package/dist/plugins/.turbo/turbo-lint.log +1 -9
- package/dist/plugins/MagicAccordion/demo/data/footer.json +1 -1
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionContent.vue.d.ts +33 -22
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionProvider.vue +2 -2
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionProvider.vue.d.ts +12 -21
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue +15 -13
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue.d.ts +23 -59
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue +2 -1
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue.d.ts +17 -22
- package/dist/plugins/MagicAccordion/src/composables/private/useAccordionTrigger.d.ts +1 -1
- package/dist/plugins/MagicAccordion/src/symbols/index.d.ts +2 -2
- package/dist/plugins/MagicCommand/src/components/MagicCommandContent.vue +11 -4
- package/dist/plugins/MagicCommand/src/components/MagicCommandContent.vue.d.ts +24 -13
- package/dist/plugins/MagicCommand/src/components/MagicCommandDrawer.vue.d.ts +12 -21
- package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue +0 -4
- package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue.d.ts +29 -28
- package/dist/plugins/MagicCommand/src/components/MagicCommandModal.vue.d.ts +12 -21
- package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue +5 -7
- package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue.d.ts +12 -58
- package/dist/plugins/MagicCommand/src/components/MagicCommandRenderer.vue +7 -7
- package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.vue +7 -6
- package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.vue.d.ts +25 -60
- package/dist/plugins/MagicCommand/src/components/MagicCommandView.vue +2 -2
- package/dist/plugins/MagicCommand/src/components/MagicCommandView.vue.d.ts +15 -22
- package/dist/plugins/MagicCommand/src/composables/private/useCommandScroll.d.ts +2 -2
- package/dist/plugins/MagicCommand/src/composables/private/useCommandState.mjs +1 -1
- package/dist/plugins/MagicCommand/src/composables/private/useCommandTrigger.d.ts +1 -1
- package/dist/plugins/MagicCommand/src/symbols/index.d.ts +4 -4
- package/dist/plugins/MagicCommand/src/types/index.d.ts +1 -1
- package/dist/plugins/MagicCookie/src/components/MagicCookieItem.vue.d.ts +13 -22
- package/dist/plugins/MagicCookie/src/components/MagicCookieProvider.vue.d.ts +9 -21
- package/dist/plugins/MagicCookie/src/components/MagicCookieView.vue.d.ts +21 -12
- package/dist/plugins/MagicCookie/src/symbols/index.d.ts +2 -2
- package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue +18 -24
- package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue.d.ts +94 -23
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableDrag.d.ts +2 -2
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableDrag.mjs +9 -5
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableScrollLock.mjs +34 -14
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableSnap.d.ts +6 -4
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableSnap.mjs +54 -19
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableState.mjs +4 -4
- package/dist/plugins/MagicDraggable/src/types/index.d.ts +1 -1
- package/dist/plugins/MagicDraggable/src/utils/defaultOptions.mjs +1 -1
- package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue +33 -24
- package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue.d.ts +165 -24
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDOM.mjs +34 -14
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDrag.d.ts +2 -2
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDrag.mjs +3 -3
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerGuards.d.ts +1 -1
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerGuards.mjs +28 -10
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerProgress.d.ts +2 -2
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerSnap.d.ts +3 -3
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerSnap.mjs +16 -14
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerWheel.d.ts +1 -1
- package/dist/plugins/MagicMarquee/src/components/MagicMarquee.vue +15 -15
- package/dist/plugins/MagicMarquee/src/components/MagicMarquee.vue.d.ts +14 -25
- package/dist/plugins/MagicMarquee/src/composables/private/useMarqueeApi.d.ts +1 -1
- package/dist/plugins/MagicMarquee/src/composables/private/useMarqueeApi.mjs +8 -2
- package/dist/plugins/MagicMenu/src/components/MagicMenuChannel.vue +4 -5
- package/dist/plugins/MagicMenu/src/components/MagicMenuChannel.vue.d.ts +18 -21
- package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue +3 -6
- package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue.d.ts +41 -24
- package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue +5 -7
- package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue.d.ts +40 -25
- package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue +3 -14
- package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue.d.ts +31 -28
- package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.vue +19 -8
- package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.vue.d.ts +12 -58
- package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.vue +28 -38
- package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.vue.d.ts +19 -23
- package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue +29 -19
- package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue.d.ts +27 -60
- package/dist/plugins/MagicMenu/src/components/MagicMenuView.vue +2 -2
- package/dist/plugins/MagicMenu/src/components/MagicMenuView.vue.d.ts +15 -22
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCallback.mjs +1 -1
- package/dist/plugins/MagicMenu/src/composables/private/useMenuChannel.mjs +15 -5
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCursor.d.ts +3 -3
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCursor.mjs +4 -4
- package/dist/plugins/MagicMenu/src/composables/private/useMenuDOM.mjs +35 -15
- package/dist/plugins/MagicMenu/src/composables/private/useMenuTrigger.d.ts +1 -1
- package/dist/plugins/MagicMenu/src/composables/private/useMenuView.mjs +18 -6
- package/dist/plugins/MagicMenu/src/symbols/index.d.ts +4 -4
- package/dist/plugins/MagicMenu/src/utils/modeDelayDefaults.d.ts +2 -2
- package/dist/plugins/MagicMenu/src/utils/modeDelayDefaults.mjs +2 -2
- package/dist/plugins/MagicModal/src/components/MagicModal.vue +9 -9
- package/dist/plugins/MagicModal/src/components/MagicModal.vue.d.ts +44 -22
- package/dist/plugins/MagicModal/src/composables/private/useModalDOM.mjs +34 -14
- package/dist/plugins/MagicNoise/src/components/MagicNoise.vue +14 -14
- package/dist/plugins/MagicNoise/src/components/MagicNoise.vue.d.ts +1 -10
- package/dist/plugins/MagicNoise/src/composables/private/useNoiseApi.d.ts +3 -3
- package/dist/plugins/MagicNoise/src/composables/private/useNoiseApi.mjs +2 -2
- 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/MagicPlayerAudio.vue +14 -8
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue +32 -38
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue.d.ts +27 -26
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerDisplayTime.vue.d.ts +1 -10
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.vue +19 -8
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.vue.d.ts +1 -10
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerOverlay.vue +2 -2
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerOverlay.vue.d.ts +29 -14
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerPoster.vue.d.ts +13 -11
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerProvider.vue +3 -4
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerProvider.vue.d.ts +23 -23
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideo.vue +3 -4
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideoControls.vue +24 -25
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideoControls.vue.d.ts +61 -33
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerAudioApi.d.ts +2 -2
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerAudioApi.mjs +3 -3
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerControlsApi.d.ts +10 -10
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerControlsApi.mjs +15 -9
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerMediaApi.d.ts +13 -13
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerMediaApi.mjs +18 -11
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerRuntime.d.ts +3 -3
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerRuntime.mjs +3 -3
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerVideoApi.d.ts +6 -6
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerVideoApi.mjs +4 -4
- package/dist/plugins/MagicPlayer/src/composables/useMagicPlayer.d.ts +20 -20
- package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.vue +17 -8
- package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.vue.d.ts +9 -23
- package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue +11 -11
- package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue.d.ts +9 -23
- package/dist/plugins/MagicScroll/src/components/MagicScrollProvider.vue.d.ts +45 -37
- package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue +18 -10
- package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue.d.ts +13 -24
- package/dist/plugins/MagicScroll/src/composables/private/useCollisionDetection.d.ts +2 -2
- package/dist/plugins/MagicScroll/src/composables/private/useCollisionDetection.mjs +3 -3
- package/dist/plugins/MagicScroll/src/composables/private/useScrollApi.mjs +14 -4
- package/dist/plugins/MagicScroll/src/symbols/index.d.ts +1 -1
- package/dist/plugins/MagicToast/src/components/MagicToastProvider.vue +23 -29
- package/dist/plugins/MagicToast/src/components/MagicToastProvider.vue.d.ts +1 -10
- package/dist/plugins/MagicToast/src/components/MagicToastView.vue +8 -11
- package/dist/plugins/MagicToast/src/components/MagicToastView.vue.d.ts +24 -23
- package/dist/plugins/MagicToast/src/composables/private/useToastCallback.d.ts +2 -2
- package/dist/plugins/MagicToast/src/composables/private/useToastCallback.mjs +5 -5
- package/dist/plugins/MagicToast/src/composables/private/useToastDrag.mjs +22 -22
- package/dist/plugins/MagicToast/src/composables/private/useToastScrollLock.mjs +33 -15
- package/dist/plugins/MagicToast/src/composables/useMagicToast.d.ts +1 -0
- package/dist/plugins/MagicToast/src/composables/useMagicToast.mjs +10 -2
- package/dist/plugins/MagicToast/src/types/index.d.ts +1 -1
- package/dist/plugins/MagicToast/src/utils/defaultOptions.mjs +1 -1
- package/dist/plugins/index.d.ts +1 -0
- package/dist/plugins/index.mjs +1 -0
- package/dist/utils/index.d.ts +9 -4
- package/dist/utils/index.js +39 -3
- package/dist/utils/index.js.map +1 -1
- package/package.json +16 -7
|
@@ -68,7 +68,9 @@ export function useMenuView(instanceId) {
|
|
|
68
68
|
}
|
|
69
69
|
function getRelativeViewIndex(id) {
|
|
70
70
|
const view = getView(id);
|
|
71
|
-
if (!view)
|
|
71
|
+
if (!view) {
|
|
72
|
+
return -1;
|
|
73
|
+
}
|
|
72
74
|
const nestingLevel = view.parent.views.length;
|
|
73
75
|
return state.views.findIndex(
|
|
74
76
|
(v) => v.parent.views.length === nestingLevel && v.id === id
|
|
@@ -90,25 +92,33 @@ export function useMenuView(instanceId) {
|
|
|
90
92
|
}
|
|
91
93
|
function getParentView(id) {
|
|
92
94
|
const view = getView(id);
|
|
93
|
-
if (!view)
|
|
95
|
+
if (!view) {
|
|
96
|
+
return void 0;
|
|
97
|
+
}
|
|
94
98
|
const parentId = view.parent.views[view.parent.views.length - 1];
|
|
95
99
|
return parentId ? getView(parentId) : void 0;
|
|
96
100
|
}
|
|
97
101
|
function getUnrelatedViews(id) {
|
|
98
102
|
const view = getView(id);
|
|
99
|
-
if (!view)
|
|
103
|
+
if (!view) {
|
|
104
|
+
return [];
|
|
105
|
+
}
|
|
100
106
|
const parentViewsSet = new Set(view.parent.views);
|
|
101
107
|
return state.views.filter((v) => v.id !== id && !parentViewsSet.has(v.id));
|
|
102
108
|
}
|
|
103
109
|
function getDescendingViews(id) {
|
|
104
110
|
const view = getView(id);
|
|
105
|
-
if (!view)
|
|
111
|
+
if (!view) {
|
|
112
|
+
return [];
|
|
113
|
+
}
|
|
106
114
|
const parentViewsSet = new Set(view.parent.views);
|
|
107
115
|
return state.views.filter((v) => v.id !== id && !parentViewsSet.has(v.id));
|
|
108
116
|
}
|
|
109
117
|
async function selectView(id, delayMs = 0) {
|
|
110
118
|
const view = getView(id);
|
|
111
|
-
if (!view)
|
|
119
|
+
if (!view) {
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
112
122
|
if (view.state.unselectAbortController) {
|
|
113
123
|
view.state.unselectAbortController.abort();
|
|
114
124
|
}
|
|
@@ -128,7 +138,9 @@ export function useMenuView(instanceId) {
|
|
|
128
138
|
}
|
|
129
139
|
async function unselectView(id, delayMs = 0) {
|
|
130
140
|
const view = getView(id);
|
|
131
|
-
if (!view)
|
|
141
|
+
if (!view) {
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
132
144
|
if (view.state.selectAbortController) {
|
|
133
145
|
view.state.selectAbortController.abort();
|
|
134
146
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { InjectionKey, MaybeRef } from 'vue';
|
|
1
|
+
import type { InjectionKey, MaybeRef, Ref } from 'vue';
|
|
2
2
|
declare const MagicMenuInstanceId: InjectionKey<MaybeRef<string>>;
|
|
3
3
|
declare const MagicMenuParentTree: InjectionKey<string[]>;
|
|
4
4
|
declare const MagicMenuViewId: InjectionKey<string>;
|
|
5
|
-
declare const MagicMenuViewActive: InjectionKey<
|
|
5
|
+
declare const MagicMenuViewActive: InjectionKey<Ref<boolean>>;
|
|
6
6
|
declare const MagicMenuContentId: InjectionKey<string>;
|
|
7
7
|
declare const MagicMenuItemId: InjectionKey<string>;
|
|
8
|
-
declare const MagicMenuItemActive: InjectionKey<
|
|
8
|
+
declare const MagicMenuItemActive: InjectionKey<Ref<boolean>>;
|
|
9
9
|
declare const MagicMenuChannelId: InjectionKey<string>;
|
|
10
|
-
declare const MagicMenuChannelActive: InjectionKey<
|
|
10
|
+
declare const MagicMenuChannelActive: InjectionKey<Ref<boolean>>;
|
|
11
11
|
export { MagicMenuInstanceId, MagicMenuParentTree, MagicMenuViewId, MagicMenuViewActive, MagicMenuContentId, MagicMenuItemId, MagicMenuItemActive, MagicMenuChannelId, MagicMenuChannelActive, };
|
|
@@ -2,10 +2,10 @@ export declare enum ModeDelayMouseenter {
|
|
|
2
2
|
menubar = 0,
|
|
3
3
|
dropdown = 0,
|
|
4
4
|
context = 0,
|
|
5
|
-
navigation =
|
|
5
|
+
navigation = 0
|
|
6
6
|
}
|
|
7
7
|
export declare enum ModeDelayMouseleave {
|
|
8
|
-
navigation =
|
|
8
|
+
navigation = 100
|
|
9
9
|
}
|
|
10
10
|
export declare enum ModeDelayClick {
|
|
11
11
|
menubar = 0,
|
|
@@ -2,11 +2,11 @@ export var ModeDelayMouseenter = /* @__PURE__ */ ((ModeDelayMouseenter2) => {
|
|
|
2
2
|
ModeDelayMouseenter2[ModeDelayMouseenter2["menubar"] = 0] = "menubar";
|
|
3
3
|
ModeDelayMouseenter2[ModeDelayMouseenter2["dropdown"] = 0] = "dropdown";
|
|
4
4
|
ModeDelayMouseenter2[ModeDelayMouseenter2["context"] = 0] = "context";
|
|
5
|
-
ModeDelayMouseenter2[ModeDelayMouseenter2["navigation"] =
|
|
5
|
+
ModeDelayMouseenter2[ModeDelayMouseenter2["navigation"] = 0] = "navigation";
|
|
6
6
|
return ModeDelayMouseenter2;
|
|
7
7
|
})(ModeDelayMouseenter || {});
|
|
8
8
|
export var ModeDelayMouseleave = /* @__PURE__ */ ((ModeDelayMouseleave2) => {
|
|
9
|
-
ModeDelayMouseleave2[ModeDelayMouseleave2["navigation"] =
|
|
9
|
+
ModeDelayMouseleave2[ModeDelayMouseleave2["navigation"] = 100] = "navigation";
|
|
10
10
|
return ModeDelayMouseleave2;
|
|
11
11
|
})(ModeDelayMouseleave || {});
|
|
12
12
|
export var ModeDelayClick = /* @__PURE__ */ ((ModeDelayClick2) => {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import { defineComponent as _defineComponent } from "vue";
|
|
3
3
|
import { unref as _unref, renderSlot as _renderSlot, vShow as _vShow, withModifiers as _withModifiers, createElementVNode as _createElementVNode, withDirectives as _withDirectives, Transition as _Transition, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, resolveDynamicComponent as _resolveDynamicComponent, createVNode as _createVNode, mergeProps as _mergeProps, Teleport as _Teleport } from "vue";
|
|
4
|
-
const _hoisted_1 = ["id"];
|
|
4
|
+
const _hoisted_1 = ["data-id"];
|
|
5
5
|
import {
|
|
6
|
-
|
|
6
|
+
useTemplateRef,
|
|
7
|
+
shallowRef,
|
|
7
8
|
watch,
|
|
8
9
|
nextTick,
|
|
9
10
|
toValue,
|
|
@@ -36,7 +37,7 @@ export default /* @__PURE__ */ _defineComponent({
|
|
|
36
37
|
}
|
|
37
38
|
});
|
|
38
39
|
const mappedOptions = customDefu(__props.options, defaultOptions);
|
|
39
|
-
const modalRef =
|
|
40
|
+
const modalRef = useTemplateRef("modal");
|
|
40
41
|
const {
|
|
41
42
|
trapFocus,
|
|
42
43
|
releaseFocus,
|
|
@@ -49,8 +50,8 @@ export default /* @__PURE__ */ _defineComponent({
|
|
|
49
50
|
focusTrap: mappedOptions.focusTrap
|
|
50
51
|
});
|
|
51
52
|
const { isActive, close } = useMagicModal(__props.id);
|
|
52
|
-
const innerActive =
|
|
53
|
-
const wrapperActive =
|
|
53
|
+
const innerActive = shallowRef(false);
|
|
54
|
+
const wrapperActive = shallowRef(false);
|
|
54
55
|
const {
|
|
55
56
|
onBeforeEnter,
|
|
56
57
|
onEnter,
|
|
@@ -113,10 +114,9 @@ export default /* @__PURE__ */ _defineComponent({
|
|
|
113
114
|
disabled: _unref(mappedOptions).teleport?.disabled
|
|
114
115
|
}, [
|
|
115
116
|
_createElementVNode("div", _mergeProps({
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
class: "magic-modal"
|
|
117
|
+
ref: "modal",
|
|
118
|
+
class: "magic-modal",
|
|
119
|
+
"data-id": toValue(_ctx.id)
|
|
120
120
|
}, _ctx.$attrs, {
|
|
121
121
|
"aria-modal": "true",
|
|
122
122
|
onClick: _cache[1] || (_cache[1] = _withModifiers(
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type MaybeRef } from 'vue';
|
|
1
|
+
import { toValue, type MaybeRef } from 'vue';
|
|
2
2
|
import type { MagicModalOptions } from './../types/index.js';
|
|
3
3
|
import '@maas/vue-equipment/utils/css/animations/fade-in.css';
|
|
4
4
|
import '@maas/vue-equipment/utils/css/animations/fade-out.css';
|
|
@@ -7,31 +7,53 @@ interface MagicModalProps {
|
|
|
7
7
|
props?: Record<string, unknown>;
|
|
8
8
|
options?: MagicModalOptions;
|
|
9
9
|
}
|
|
10
|
-
declare
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
backdrop
|
|
14
|
-
default?(_: {}): any;
|
|
10
|
+
declare const mappedOptions: Omit<MagicModalOptions, keyof MagicModalOptions> & Omit<import("../../../../utils").RequireAll<MagicModalOptions>, keyof MagicModalOptions> & {
|
|
11
|
+
transition: {
|
|
12
|
+
content?: string;
|
|
13
|
+
backdrop?: string;
|
|
15
14
|
};
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
backdrop: boolean;
|
|
16
|
+
tag: "div" | "dialog";
|
|
17
|
+
focusTrap: boolean | import("focus-trap").Options;
|
|
18
|
+
scrollLock: boolean | {
|
|
19
|
+
padding: boolean;
|
|
18
20
|
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
26
|
-
type __VLS_TypePropsToOption<T> = {
|
|
27
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
28
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
29
|
-
} : {
|
|
30
|
-
type: import('vue').PropType<T[K]>;
|
|
31
|
-
required: true;
|
|
21
|
+
teleport: {
|
|
22
|
+
target?: string;
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
};
|
|
25
|
+
keyListener: {
|
|
26
|
+
close?: string[] | false;
|
|
32
27
|
};
|
|
33
28
|
};
|
|
34
|
-
|
|
29
|
+
declare const close: () => void;
|
|
30
|
+
declare const innerActive: import("vue").ShallowRef<boolean, boolean>;
|
|
31
|
+
declare const wrapperActive: import("vue").ShallowRef<boolean, boolean>;
|
|
32
|
+
declare const onBeforeEnter: () => void, onEnter: () => void, onAfterEnter: () => Promise<void>, onBeforeLeave: () => void, onLeave: () => void, onAfterLeave: () => void;
|
|
33
|
+
declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
|
|
34
|
+
declare var __VLS_9: {}, __VLS_32: {};
|
|
35
|
+
type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
|
|
36
|
+
backdrop?: (props: typeof __VLS_9) => any;
|
|
37
|
+
} & {
|
|
38
|
+
default?: (props: typeof __VLS_32) => any;
|
|
39
|
+
}>;
|
|
40
|
+
declare const __VLS_self: import("vue").DefineComponent<MagicModalProps, {
|
|
41
|
+
toValue: typeof toValue;
|
|
42
|
+
mappedOptions: typeof mappedOptions;
|
|
43
|
+
close: typeof close;
|
|
44
|
+
innerActive: typeof innerActive;
|
|
45
|
+
wrapperActive: typeof wrapperActive;
|
|
46
|
+
onBeforeEnter: typeof onBeforeEnter;
|
|
47
|
+
onEnter: typeof onEnter;
|
|
48
|
+
onAfterEnter: typeof onAfterEnter;
|
|
49
|
+
onBeforeLeave: typeof onBeforeLeave;
|
|
50
|
+
onLeave: typeof onLeave;
|
|
51
|
+
onAfterLeave: typeof onAfterLeave;
|
|
52
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicModalProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
53
|
+
declare const __VLS_component: import("vue").DefineComponent<MagicModalProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicModalProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
54
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
55
|
+
export default _default;
|
|
56
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
35
57
|
new (): {
|
|
36
58
|
$slots: S;
|
|
37
59
|
};
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
import { ref } from "vue";
|
|
1
|
+
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,
|
|
9
13
|
scrollLock: true
|
|
10
14
|
};
|
|
11
|
-
const scrollLock = typeof window !== "undefined" ? useScrollLock(document?.documentElement) :
|
|
15
|
+
const scrollLock = typeof window !== "undefined" ? useScrollLock(document?.documentElement) : shallowRef(false);
|
|
12
16
|
export function useModalDOM(args) {
|
|
13
17
|
const positionFixedElements = ref([]);
|
|
14
18
|
const mappedOptions = defu(args, defaultOptions);
|
|
@@ -36,24 +40,40 @@ export function useModalDOM(args) {
|
|
|
36
40
|
function addScrollLockPadding() {
|
|
37
41
|
if (typeof window === "undefined") return;
|
|
38
42
|
const exclude = new RegExp(/magic-modal(__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,
|
|
@@ -3,7 +3,15 @@ import { defineComponent as _defineComponent } from "vue";
|
|
|
3
3
|
import { unref as _unref, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
4
4
|
const _hoisted_1 = ["data-loading"];
|
|
5
5
|
const _hoisted_2 = { class: "magic-noise__inner" };
|
|
6
|
-
|
|
6
|
+
const _hoisted_3 = {
|
|
7
|
+
ref: "canvas",
|
|
8
|
+
class: "magic-noise__canvas"
|
|
9
|
+
};
|
|
10
|
+
const _hoisted_4 = {
|
|
11
|
+
ref: "offCanvas",
|
|
12
|
+
class: "magic-noise__off-canvas"
|
|
13
|
+
};
|
|
14
|
+
import { onMounted, onUnmounted, watch, useTemplateRef } from "vue";
|
|
7
15
|
import { useResizeObserver, useDebounceFn } from "@vueuse/core";
|
|
8
16
|
import { useNoiseApi } from "../composables/private/useNoiseApi";
|
|
9
17
|
export default /* @__PURE__ */ _defineComponent({
|
|
@@ -13,8 +21,8 @@ export default /* @__PURE__ */ _defineComponent({
|
|
|
13
21
|
pause: { type: Boolean, required: false, default: false }
|
|
14
22
|
},
|
|
15
23
|
setup(__props) {
|
|
16
|
-
const canvasRef =
|
|
17
|
-
const offCanvasRef =
|
|
24
|
+
const canvasRef = useTemplateRef("canvas");
|
|
25
|
+
const offCanvasRef = useTemplateRef("offCanvas");
|
|
18
26
|
const noiseApi = useNoiseApi({
|
|
19
27
|
canvasRef,
|
|
20
28
|
offCanvasRef,
|
|
@@ -58,22 +66,14 @@ export default /* @__PURE__ */ _defineComponent({
|
|
|
58
66
|
_createElementVNode("div", _hoisted_2, [
|
|
59
67
|
_createElementVNode(
|
|
60
68
|
"canvas",
|
|
61
|
-
|
|
62
|
-
ref_key: "canvasRef",
|
|
63
|
-
ref: canvasRef,
|
|
64
|
-
class: "magic-noise__canvas"
|
|
65
|
-
},
|
|
69
|
+
_hoisted_3,
|
|
66
70
|
null,
|
|
67
71
|
512
|
|
68
72
|
/* NEED_PATCH */
|
|
69
73
|
),
|
|
70
74
|
_createElementVNode(
|
|
71
75
|
"canvas",
|
|
72
|
-
|
|
73
|
-
ref_key: "offCanvasRef",
|
|
74
|
-
ref: offCanvasRef,
|
|
75
|
-
class: "magic-noise__off-canvas"
|
|
76
|
-
},
|
|
76
|
+
_hoisted_4,
|
|
77
77
|
null,
|
|
78
78
|
512
|
|
79
79
|
/* NEED_PATCH */
|
|
@@ -94,7 +94,7 @@ export default /* @__PURE__ */ _defineComponent({
|
|
|
94
94
|
position: relative;
|
|
95
95
|
user-select: none;
|
|
96
96
|
transition: var(--magic-noise-loading-transition);
|
|
97
|
-
background: var(--magic-noise-background,
|
|
97
|
+
background: var(--magic-noise-background, #000);
|
|
98
98
|
&[data-loading='true'] {
|
|
99
99
|
background: var(--magic-noise-loading-background, #000);
|
|
100
100
|
& > .magic-noise__inner {
|
|
@@ -3,14 +3,5 @@ interface MagicNoiseProps {
|
|
|
3
3
|
options?: MagicNoiseOptions;
|
|
4
4
|
pause?: boolean;
|
|
5
5
|
}
|
|
6
|
-
declare const _default: import("vue").DefineComponent<
|
|
6
|
+
declare const _default: import("vue").DefineComponent<MagicNoiseProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicNoiseProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
7
|
export default _default;
|
|
8
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
9
|
-
type __VLS_TypePropsToOption<T> = {
|
|
10
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
11
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
12
|
-
} : {
|
|
13
|
-
type: import('vue').PropType<T[K]>;
|
|
14
|
-
required: true;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type Ref, type MaybeRef } from 'vue';
|
|
2
2
|
import type { MagicNoiseOptions, RafControls } from '../../types/index.js';
|
|
3
3
|
type UseNoiseApiArgs = {
|
|
4
|
-
canvasRef: Ref<HTMLCanvasElement |
|
|
5
|
-
offCanvasRef: Ref<HTMLCanvasElement |
|
|
4
|
+
canvasRef: Ref<HTMLCanvasElement | null>;
|
|
5
|
+
offCanvasRef: Ref<HTMLCanvasElement | null>;
|
|
6
6
|
options?: MaybeRef<MagicNoiseOptions>;
|
|
7
7
|
};
|
|
8
8
|
export declare function useNoiseApi({ canvasRef, offCanvasRef, options, }: UseNoiseApiArgs): {
|
|
@@ -11,7 +11,7 @@ export declare function useNoiseApi({ canvasRef, offCanvasRef, options, }: UseNo
|
|
|
11
11
|
rotateAndTransfer: () => void;
|
|
12
12
|
throttledDraw: () => void;
|
|
13
13
|
throttledRotateAndTransfer: () => void;
|
|
14
|
-
isReady:
|
|
14
|
+
isReady: import("vue").ShallowRef<boolean, boolean>;
|
|
15
15
|
drawControls: import("vue").ShallowRef<RafControls | undefined, RafControls | undefined>;
|
|
16
16
|
transferControls: import("vue").ShallowRef<RafControls | undefined, RafControls | undefined>;
|
|
17
17
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { shallowRef,
|
|
1
|
+
import { shallowRef, reactive } from "vue";
|
|
2
2
|
import { defu } from "defu";
|
|
3
3
|
import {
|
|
4
4
|
useElementSize,
|
|
@@ -14,7 +14,7 @@ export function useNoiseApi({
|
|
|
14
14
|
}) {
|
|
15
15
|
const tiles = shallowRef([]);
|
|
16
16
|
const pixels = shallowRef([]);
|
|
17
|
-
const isReady =
|
|
17
|
+
const isReady = shallowRef(false);
|
|
18
18
|
const context = shallowRef(null);
|
|
19
19
|
const offContext = shallowRef(null);
|
|
20
20
|
const { width, height } = useElementSize(canvasRef);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import MagicPie from './src/components/MagicPie.vue.js';
|
|
2
|
+
import { useMagicPie } from './src/composables/useMagicPie.js';
|
|
3
|
+
import type { Plugin } from 'vue';
|
|
4
|
+
import type { MagicPieOptions } from './src/types/index.js';
|
|
5
|
+
declare const MagicPiePlugin: Plugin;
|
|
6
|
+
export { MagicPiePlugin, MagicPie, useMagicPie };
|
|
7
|
+
export type { MagicPieOptions };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import MagicPie from "./src/components/MagicPie.vue";
|
|
2
|
+
import { useMagicPie } from "./src/composables/useMagicPie.mjs";
|
|
3
|
+
const MagicPiePlugin = {
|
|
4
|
+
install: (app) => {
|
|
5
|
+
app.component("MagicPie", MagicPie);
|
|
6
|
+
}
|
|
7
|
+
};
|
|
8
|
+
export { MagicPiePlugin, MagicPie, useMagicPie };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {
|
|
2
|
+
defineNuxtModule,
|
|
3
|
+
createResolver,
|
|
4
|
+
addComponent,
|
|
5
|
+
addImports
|
|
6
|
+
} from "@nuxt/kit";
|
|
7
|
+
export default defineNuxtModule({
|
|
8
|
+
meta: {
|
|
9
|
+
name: "@maas/vue-equipment/nuxt/MagicPie"
|
|
10
|
+
},
|
|
11
|
+
setup() {
|
|
12
|
+
const resolver = createResolver(import.meta.url);
|
|
13
|
+
addComponent({
|
|
14
|
+
filePath: resolver.resolve("src/components/MagicPie.vue"),
|
|
15
|
+
name: "MagicPie",
|
|
16
|
+
global: true
|
|
17
|
+
});
|
|
18
|
+
addImports({
|
|
19
|
+
from: "@maas/vue-equipment/plugins/MagicPie",
|
|
20
|
+
name: "useMagicPie"
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
});
|