@omnipad/vue 0.4.3 → 0.4.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/index.d.ts +56 -14
- package/dist/omnipad-vue.css +1 -1
- package/dist/omnipad-vue.mjs +450 -429
- package/dist/omnipad-vue.umd.js +1 -1
- package/package.json +2 -2
package/dist/omnipad-vue.mjs
CHANGED
|
@@ -1,117 +1,126 @@
|
|
|
1
|
-
import { Registry as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
const
|
|
5
|
-
function
|
|
6
|
-
|
|
1
|
+
import { Registry as pe, ElementObserver as ne, WindowManager as ye, CONTEXT as ie, CMP_TYPES as I, InputZoneCore as me, RootLayerCore as ge, TargetZoneCore as Pe, ButtonCore as be, DPadCore as he, TrackpadCore as Ce, JoystickCore as _e, setGlobalSignalHandler as we, ACTION_TYPES as se } from "@omnipad/core";
|
|
2
|
+
import { getObjectDiff as Re, createCachedProvider as ke, createPointerBridge as $e, generateUID as De, getBusinessProps as ae, resolveLayoutStyle as q, supportsContainerQueries as Q, remap as G, reclaimFocusAtPos as Ne, dispatchPointerEventAtPos as Ie, dispatchKeyboardEvent as ce } from "@omnipad/core/utils";
|
|
3
|
+
import { defineComponent as B, h as Te, shallowRef as Ee, ref as M, computed as $, watch as le, onMounted as Ae, onUnmounted as Se, readonly as X, openBlock as w, createElementBlock as E, Fragment as xe, renderList as Ue, createBlock as Z, resolveDynamicComponent as ee, renderSlot as h, inject as Be, provide as Le, useSlots as Oe, nextTick as Ve, normalizeStyle as O, normalizeClass as D, unref as o, createVNode as H, withCtx as N, createElementVNode as T, createCommentVNode as Y, Transition as Me, toDisplayString as Ye, normalizeProps as x, guardReactiveProps as U, watchEffect as de } from "vue";
|
|
4
|
+
const j = {};
|
|
5
|
+
function F(e, n) {
|
|
6
|
+
j[e] = n;
|
|
7
7
|
}
|
|
8
|
-
function
|
|
9
|
-
const
|
|
10
|
-
return
|
|
11
|
-
render: () =>
|
|
8
|
+
function ue(e) {
|
|
9
|
+
const n = j[e];
|
|
10
|
+
return n || B({
|
|
11
|
+
render: () => Te("div", { style: "color:red" }, `[Unknown: ${e}]`)
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
|
-
function
|
|
15
|
-
return !e || !
|
|
14
|
+
function re(e) {
|
|
15
|
+
return !e || !j[e] ? null : j[e];
|
|
16
16
|
}
|
|
17
|
-
function
|
|
18
|
-
return e ? !!
|
|
17
|
+
function Pt(e) {
|
|
18
|
+
return e ? !!j[e] : !1;
|
|
19
19
|
}
|
|
20
|
-
function
|
|
21
|
-
const t = e(),
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
a.value = v;
|
|
25
|
-
}, c = (v) => {
|
|
26
|
-
if (!n.value) return;
|
|
27
|
-
const p = n.value;
|
|
28
|
-
typeof p.bindDelegate == "function" && Object.entries(v).forEach(([P, f]) => {
|
|
29
|
-
p.bindDelegate(P, f);
|
|
20
|
+
function K(e, n, d = {}, s) {
|
|
21
|
+
const t = e(), r = Ee(), b = M(), i = M(), l = $(() => i.value?.layout), a = M(null), f = (y) => {
|
|
22
|
+
r.value && "bindDelegate" in r.value && Object.entries(y).forEach(([u, m]) => {
|
|
23
|
+
r.value.bindDelegate(u, m);
|
|
30
24
|
});
|
|
31
25
|
};
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
26
|
+
let _ = { ...n.value };
|
|
27
|
+
le(
|
|
28
|
+
n,
|
|
29
|
+
(y) => {
|
|
30
|
+
if (!r.value) return;
|
|
31
|
+
const u = Re(_, y);
|
|
32
|
+
Object.keys(u).length > 0 && r.value.updateConfig(u), _ = { ...n.value };
|
|
33
|
+
},
|
|
34
|
+
{ deep: !0 }
|
|
35
|
+
), Ae(() => {
|
|
36
|
+
r.value = t, pe.getInstance().register(t), "subscribeState" in t && t.subscribeState((u) => b.value = u), "subscribeConfig" in t && t.subscribeConfig((u) => i.value = u), s && f(s);
|
|
37
|
+
let y = null;
|
|
38
|
+
if (a.value && (a.value instanceof Element ? y = a.value : a.value.$el instanceof Element && (y = a.value.$el)), y instanceof Element) {
|
|
39
|
+
const u = ne.getInstance();
|
|
40
|
+
if ("bindRectProvider" in t) {
|
|
41
|
+
const m = ke(() => y.getBoundingClientRect());
|
|
42
|
+
t.bindRectProvider(m.get, m.markDirty), u.observeResize(t.uid, y, () => {
|
|
43
|
+
t.markRectDirty();
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
u.observeIntersect(t.uid, y, (m) => {
|
|
47
|
+
m || t.reset();
|
|
48
|
+
});
|
|
44
49
|
}
|
|
45
|
-
|
|
46
|
-
}),
|
|
47
|
-
|
|
48
|
-
})
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
ye.getInstance().init();
|
|
51
|
+
}), Se(() => {
|
|
52
|
+
ne.getInstance().disconnect(t.uid), r.value && r.value.destroy();
|
|
53
|
+
});
|
|
54
|
+
const R = "onPointerDown" in t ? $e(t, d) : {};
|
|
55
|
+
return {
|
|
56
|
+
core: X(r),
|
|
57
|
+
state: X(b),
|
|
58
|
+
domEvents: R,
|
|
59
|
+
effectiveConfig: X(i),
|
|
60
|
+
effectiveLayout: l,
|
|
61
|
+
elementRef: a,
|
|
62
|
+
bindDelegates: f
|
|
54
63
|
};
|
|
55
64
|
}
|
|
56
|
-
const
|
|
65
|
+
const Ze = { class: "omnipad-virtual-layer-base omnipad-prevent" }, Fe = /* @__PURE__ */ B({
|
|
57
66
|
__name: "VirtualLayerBase",
|
|
58
67
|
props: {
|
|
59
68
|
nodes: {}
|
|
60
69
|
},
|
|
61
70
|
setup(e) {
|
|
62
|
-
const
|
|
63
|
-
let
|
|
64
|
-
return !
|
|
65
|
-
node:
|
|
66
|
-
component:
|
|
71
|
+
const n = e, d = $(() => (n.nodes || []).map((s) => {
|
|
72
|
+
let t = re(s.type);
|
|
73
|
+
return !t && s.config?.baseType && (t = re(s.config.baseType)), t || (t = ue(s.type)), {
|
|
74
|
+
node: s,
|
|
75
|
+
component: t
|
|
67
76
|
};
|
|
68
77
|
}));
|
|
69
|
-
return (
|
|
70
|
-
(
|
|
71
|
-
key:
|
|
72
|
-
"tree-node":
|
|
78
|
+
return (s, t) => (w(), E("div", Ze, [
|
|
79
|
+
(w(!0), E(xe, null, Ue(d.value, (r) => (w(), Z(ee(r.component), {
|
|
80
|
+
key: r.node.uid,
|
|
81
|
+
"tree-node": r.node
|
|
73
82
|
}, null, 8, ["tree-node"]))), 128)),
|
|
74
|
-
h(
|
|
83
|
+
h(s.$slots, "default", {}, void 0, !0)
|
|
75
84
|
]));
|
|
76
85
|
}
|
|
77
|
-
}),
|
|
78
|
-
const
|
|
79
|
-
for (const [
|
|
80
|
-
|
|
81
|
-
return
|
|
82
|
-
},
|
|
83
|
-
function z(e,
|
|
84
|
-
const t =
|
|
85
|
-
t && !
|
|
86
|
+
}), V = (e, n) => {
|
|
87
|
+
const d = e.__vccOpts || e;
|
|
88
|
+
for (const [s, t] of n)
|
|
89
|
+
d[s] = t;
|
|
90
|
+
return d;
|
|
91
|
+
}, ve = /* @__PURE__ */ V(Fe, [["__scopeId", "data-v-d67cc501"]]), Ke = ["treeNode", "widgetId", "parentId"];
|
|
92
|
+
function z(e, n, d = {}, s = []) {
|
|
93
|
+
const t = n.treeNode, r = t && t.config?.baseType === e || t?.type === e ? t : void 0;
|
|
94
|
+
t && !r && console.warn(
|
|
86
95
|
`[OmniPad-Validation] Type mismatch! Component expected "${e}", but received "${t.type}". Config ignored.`
|
|
87
96
|
);
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
97
|
+
const b = Be(ie.PARENT_ID_KEY, M(void 0)), i = $(() => n.parentId || r?.config?.parentId || b.value), l = n.widgetId || r?.uid || De(e);
|
|
98
|
+
Le(ie.PARENT_ID_KEY, l);
|
|
99
|
+
const a = /* @__PURE__ */ new Set([...Ke, ...s]), f = r?.config || {}, _ = ae(n, a), R = {
|
|
100
|
+
...d,
|
|
101
|
+
...f,
|
|
102
|
+
..._,
|
|
103
|
+
id: l,
|
|
104
|
+
baseType: e,
|
|
105
|
+
parentId: i.value,
|
|
106
|
+
// 特殊处理 Layout:深度合并,确保即便只传了 { width: 100 } 也不丢失原来的 left/top
|
|
107
|
+
layout: {
|
|
108
|
+
...d.layout || {},
|
|
109
|
+
...f.layout || {},
|
|
110
|
+
..._.layout || {}
|
|
111
|
+
}
|
|
112
|
+
}, y = $(() => {
|
|
113
|
+
const u = ae(n, a);
|
|
94
114
|
return {
|
|
95
115
|
...u,
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
baseType: e,
|
|
100
|
-
parentId: y.value,
|
|
101
|
-
// 特殊处理 Layout:深度合并,确保即便只传了 { width: 100 } 也不丢失原来的 left/top
|
|
102
|
-
layout: {
|
|
103
|
-
...u.layout || {},
|
|
104
|
-
...c.layout || {},
|
|
105
|
-
...v.layout || {}
|
|
106
|
-
}
|
|
116
|
+
parentId: i.value,
|
|
117
|
+
layout: u.layout || void 0
|
|
118
|
+
// 只有当传入了新的 layout 时才包裹
|
|
107
119
|
};
|
|
108
|
-
}), b = _(() => {
|
|
109
|
-
const c = d.value.cssClasses;
|
|
110
|
-
return c ? Array.isArray(c) ? c : [c] : [];
|
|
111
120
|
});
|
|
112
|
-
return { uid:
|
|
121
|
+
return { uid: l, initialConfig: R, reactiveConfig: y };
|
|
113
122
|
}
|
|
114
|
-
const
|
|
123
|
+
const ze = ["id"], We = /* @__PURE__ */ B({
|
|
115
124
|
__name: "InputZone",
|
|
116
125
|
props: {
|
|
117
126
|
treeNode: {},
|
|
@@ -120,105 +129,111 @@ const Be = ["id"], Oe = /* @__PURE__ */ S({
|
|
|
120
129
|
preventFocusLoss: {}
|
|
121
130
|
},
|
|
122
131
|
setup(e) {
|
|
123
|
-
const
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
), { core:
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
132
|
+
const n = e, d = Oe(), s = M(null), { uid: t, initialConfig: r, reactiveConfig: b } = z(
|
|
133
|
+
I.INPUT_ZONE,
|
|
134
|
+
n
|
|
135
|
+
), { core: i, state: l, domEvents: a, effectiveConfig: f, effectiveLayout: _, elementRef: R, bindDelegates: y } = K(
|
|
136
|
+
() => new me(t, r, n.treeNode?.type),
|
|
137
|
+
b,
|
|
138
|
+
{
|
|
139
|
+
requireDirectHit: !0
|
|
140
|
+
}
|
|
141
|
+
), u = $(() => {
|
|
142
|
+
const p = n.treeNode?.config?.dynamicWidgetId;
|
|
143
|
+
return n.treeNode?.children?.filter((A) => A.uid !== p) || [];
|
|
144
|
+
}), m = $(() => {
|
|
145
|
+
const A = (d.dynamicWidget?.() || []).filter((J) => !(J.type === Comment || J.type === Text)), S = n.treeNode?.children?.find(
|
|
146
|
+
(J) => J.uid === n.treeNode?.config?.dynamicWidgetId
|
|
147
|
+
), W = A.length > 0;
|
|
148
|
+
return A.length > 1 && console.error(
|
|
149
|
+
`[OmniPad-Validation] InputZone ${t} has multiple dynamic widgets in slot. Only the first one will be activated.`
|
|
150
|
+
), W && S && console.warn(
|
|
151
|
+
`[OmniPad-Validation] InputZone ${t} has both Slot and Config dynamic widgets. Config ignored.`
|
|
137
152
|
), {
|
|
138
|
-
nodeToRender:
|
|
139
|
-
isFromSlot:
|
|
153
|
+
nodeToRender: W ? A[0] : S || null,
|
|
154
|
+
isFromSlot: W
|
|
140
155
|
};
|
|
141
|
-
}),
|
|
142
|
-
const
|
|
143
|
-
return
|
|
156
|
+
}), P = $(() => {
|
|
157
|
+
const p = m.value.nodeToRender;
|
|
158
|
+
return ue(p.config?.baseType || p.type);
|
|
144
159
|
});
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
(
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
dynamicWidgetId:
|
|
151
|
-
}),
|
|
152
|
-
dynamicWidgetPointerDown: (
|
|
153
|
-
|
|
160
|
+
le(
|
|
161
|
+
s,
|
|
162
|
+
(p) => {
|
|
163
|
+
Ve(() => {
|
|
164
|
+
p && p?.uid && (i.value?.updateConfig({
|
|
165
|
+
dynamicWidgetId: p.uid
|
|
166
|
+
}), y({
|
|
167
|
+
dynamicWidgetPointerDown: (A) => {
|
|
168
|
+
p.markRectDirty?.(), p.onPointerDown?.(A);
|
|
154
169
|
},
|
|
155
|
-
dynamicWidgetPointerMove:
|
|
156
|
-
dynamicWidgetPointerUp:
|
|
157
|
-
dynamicWidgetPointerCancel:
|
|
170
|
+
dynamicWidgetPointerMove: p.onPointerMove,
|
|
171
|
+
dynamicWidgetPointerUp: p.onPointerUp,
|
|
172
|
+
dynamicWidgetPointerCancel: p.onPointerCancel
|
|
158
173
|
}));
|
|
159
174
|
});
|
|
160
175
|
},
|
|
161
176
|
{ immediate: !0 }
|
|
162
177
|
);
|
|
163
|
-
const
|
|
164
|
-
if (!
|
|
165
|
-
if (!
|
|
166
|
-
let
|
|
167
|
-
const
|
|
168
|
-
if (
|
|
169
|
-
|
|
178
|
+
const C = $(() => _.value ? q(_.value) : {}), k = Q(), v = $(() => {
|
|
179
|
+
if (!l.value) return { display: "none" };
|
|
180
|
+
if (!l.value?.isDynamicActive) return { visibility: "hidden", opacity: 0 };
|
|
181
|
+
let p, A;
|
|
182
|
+
const S = l?.value?.dynamicPosition;
|
|
183
|
+
if (k)
|
|
184
|
+
p = `${S.x}cqw`, A = `${S.y}cqh`;
|
|
170
185
|
else {
|
|
171
|
-
const
|
|
172
|
-
|
|
186
|
+
const W = i?.value?.rect;
|
|
187
|
+
p = `${G(S?.x || 0, 0, 100, 0, W?.width || 0)}px`, A = `${G(S?.y || 0, 0, 100, 0, W?.height || 0)}px`;
|
|
173
188
|
}
|
|
174
189
|
return {
|
|
175
190
|
zIndex: 100,
|
|
176
|
-
"--dynamic-widget-mount-x":
|
|
177
|
-
"--dynamic-widget-mount-y":
|
|
191
|
+
"--dynamic-widget-mount-x": p,
|
|
192
|
+
"--dynamic-widget-mount-y": A,
|
|
178
193
|
visibility: "visible",
|
|
179
194
|
opacity: 1,
|
|
180
195
|
pointerEvents: "auto"
|
|
181
196
|
};
|
|
182
|
-
}),
|
|
183
|
-
return (
|
|
184
|
-
id: o(
|
|
197
|
+
}), c = (p) => a?.onPointerDown?.(p), L = (p) => a?.onPointerMove?.(p), g = (p) => a?.onPointerUp?.(p), oe = (p) => a?.onPointerCancel?.(p);
|
|
198
|
+
return (p, A) => (w(), E("div", {
|
|
199
|
+
id: o(t),
|
|
185
200
|
ref_key: "elementRef",
|
|
186
|
-
ref:
|
|
187
|
-
class:
|
|
188
|
-
style:
|
|
201
|
+
ref: R,
|
|
202
|
+
class: D(["omnipad-input-zone omnipad-prevent", o(f)?.cssClasses]),
|
|
203
|
+
style: O(C.value)
|
|
189
204
|
}, [
|
|
190
|
-
|
|
191
|
-
default:
|
|
192
|
-
h(
|
|
205
|
+
H(ve, { nodes: u.value }, {
|
|
206
|
+
default: N(() => [
|
|
207
|
+
h(p.$slots, "default", {}, void 0, !0)
|
|
193
208
|
]),
|
|
194
209
|
_: 3
|
|
195
210
|
}, 8, ["nodes"]),
|
|
196
|
-
|
|
211
|
+
m.value.nodeToRender || o(i)?.isInterceptorRequired ? (w(), E("div", {
|
|
197
212
|
key: 0,
|
|
198
213
|
class: "omnipad-input-zone-trigger omnipad-prevent",
|
|
199
|
-
onPointerdown:
|
|
200
|
-
onPointermove:
|
|
214
|
+
onPointerdown: c,
|
|
215
|
+
onPointermove: L,
|
|
201
216
|
onPointerup: g,
|
|
202
|
-
onPointercancel:
|
|
203
|
-
onLostpointercapture:
|
|
217
|
+
onPointercancel: oe,
|
|
218
|
+
onLostpointercapture: oe
|
|
204
219
|
}, [
|
|
205
220
|
T("div", {
|
|
206
221
|
class: "dynamic-widget-mount",
|
|
207
|
-
style:
|
|
222
|
+
style: O(v.value)
|
|
208
223
|
}, [
|
|
209
|
-
|
|
224
|
+
m.value.isFromSlot ? (w(), Z(ee(m.value.nodeToRender), {
|
|
210
225
|
key: 0,
|
|
211
|
-
ref: (
|
|
212
|
-
}, null, 512)) :
|
|
226
|
+
ref: (S) => s.value = S
|
|
227
|
+
}, null, 512)) : m.value.nodeToRender ? (w(), Z(ee(P.value), {
|
|
213
228
|
key: 1,
|
|
214
|
-
ref: (
|
|
215
|
-
"tree-node":
|
|
216
|
-
}, null, 8, ["tree-node"])) :
|
|
229
|
+
ref: (S) => s.value = S,
|
|
230
|
+
"tree-node": m.value.nodeToRender
|
|
231
|
+
}, null, 8, ["tree-node"])) : Y("", !0)
|
|
217
232
|
], 4)
|
|
218
|
-
], 32)) :
|
|
219
|
-
], 14,
|
|
233
|
+
], 32)) : Y("", !0)
|
|
234
|
+
], 14, ze));
|
|
220
235
|
}
|
|
221
|
-
}),
|
|
236
|
+
}), je = /* @__PURE__ */ V(We, [["__scopeId", "data-v-8b58e8ce"]]), qe = ["id"], Qe = /* @__PURE__ */ B({
|
|
222
237
|
__name: "RootLayer",
|
|
223
238
|
props: {
|
|
224
239
|
treeNode: {},
|
|
@@ -226,28 +241,34 @@ const Be = ["id"], Oe = /* @__PURE__ */ S({
|
|
|
226
241
|
layout: {}
|
|
227
242
|
},
|
|
228
243
|
setup(e) {
|
|
229
|
-
const
|
|
230
|
-
|
|
231
|
-
|
|
244
|
+
const n = e, { uid: d, initialConfig: s, reactiveConfig: t } = z(
|
|
245
|
+
I.ROOT_LAYER,
|
|
246
|
+
n
|
|
247
|
+
), { effectiveConfig: r, effectiveLayout: b, elementRef: i } = K(
|
|
248
|
+
() => new ge(d, s, n.treeNode?.type),
|
|
249
|
+
t
|
|
250
|
+
), l = $(() => b.value ? q(b.value) : {});
|
|
251
|
+
return (a, f) => (w(), E("div", {
|
|
252
|
+
id: o(d),
|
|
232
253
|
ref_key: "elementRef",
|
|
233
|
-
ref:
|
|
234
|
-
class:
|
|
235
|
-
style:
|
|
254
|
+
ref: i,
|
|
255
|
+
class: D(["omnipad-root-layer omnipad-prevent", o(r)?.cssClasses]),
|
|
256
|
+
style: O(l.value)
|
|
236
257
|
}, [
|
|
237
|
-
|
|
258
|
+
H(ve, {
|
|
238
259
|
nodes: e.treeNode?.children || []
|
|
239
260
|
}, {
|
|
240
|
-
default:
|
|
241
|
-
h(
|
|
261
|
+
default: N(() => [
|
|
262
|
+
h(a.$slots, "default", {}, void 0, !0)
|
|
242
263
|
]),
|
|
243
264
|
_: 3
|
|
244
265
|
}, 8, ["nodes"])
|
|
245
|
-
], 14,
|
|
266
|
+
], 14, qe));
|
|
246
267
|
}
|
|
247
|
-
}),
|
|
268
|
+
}), Je = /* @__PURE__ */ V(Qe, [["__scopeId", "data-v-2e1f7fa1"]]), Ge = ["id"], He = {
|
|
248
269
|
key: 0,
|
|
249
270
|
class: "omnipad-default-focus-border-feedback"
|
|
250
|
-
},
|
|
271
|
+
}, Xe = /* @__PURE__ */ B({
|
|
251
272
|
__name: "TargetZone",
|
|
252
273
|
props: {
|
|
253
274
|
treeNode: {},
|
|
@@ -257,100 +278,101 @@ const Be = ["id"], Oe = /* @__PURE__ */ S({
|
|
|
257
278
|
layout: {}
|
|
258
279
|
},
|
|
259
280
|
setup(e) {
|
|
260
|
-
const
|
|
281
|
+
const n = e, d = {
|
|
261
282
|
cursorAutoDelay: 2500
|
|
262
|
-
}, { uid:
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
), { core:
|
|
267
|
-
() => new
|
|
283
|
+
}, { uid: s, initialConfig: t, reactiveConfig: r } = z(
|
|
284
|
+
I.TARGET_ZONE,
|
|
285
|
+
n,
|
|
286
|
+
d
|
|
287
|
+
), { core: b, state: i, domEvents: l, effectiveConfig: a, effectiveLayout: f, elementRef: _ } = K(
|
|
288
|
+
() => new Pe(s, t, n.treeNode?.type),
|
|
289
|
+
r,
|
|
268
290
|
{},
|
|
269
291
|
{
|
|
270
|
-
dispatchKeyboardEvent:
|
|
271
|
-
dispatchPointerEventAtPos:
|
|
292
|
+
dispatchKeyboardEvent: ce,
|
|
293
|
+
dispatchPointerEventAtPos: Ie,
|
|
272
294
|
reclaimFocusAtPos: Ne
|
|
273
295
|
}
|
|
274
|
-
),
|
|
275
|
-
if (!
|
|
276
|
-
let
|
|
277
|
-
const
|
|
278
|
-
if (
|
|
279
|
-
|
|
296
|
+
), R = $(() => f.value ? q(f.value) : {}), y = Q(), u = $(() => {
|
|
297
|
+
if (!i.value) return { display: "none" };
|
|
298
|
+
let v, c;
|
|
299
|
+
const L = i?.value?.position;
|
|
300
|
+
if (y)
|
|
301
|
+
v = `${L.x}cqw`, c = `${L.y}cqh`;
|
|
280
302
|
else {
|
|
281
|
-
const g =
|
|
282
|
-
|
|
303
|
+
const g = b?.value?.rect;
|
|
304
|
+
v = `${G(L?.x || 0, 0, 100, 0, g?.width || 0)}px`, c = `${G(L?.y || 0, 0, 100, 0, g?.height || 0)}px`;
|
|
283
305
|
}
|
|
284
306
|
return {
|
|
285
|
-
"--omnipad-virtual-cursor-x":
|
|
286
|
-
"--omnipad-virtual-cursor-y":
|
|
287
|
-
opacity:
|
|
307
|
+
"--omnipad-virtual-cursor-x": v,
|
|
308
|
+
"--omnipad-virtual-cursor-y": c,
|
|
309
|
+
opacity: i.value.isVisible ? 1 : 0
|
|
288
310
|
};
|
|
289
|
-
}),
|
|
290
|
-
return (
|
|
291
|
-
id: o(
|
|
311
|
+
}), m = (v) => l?.onPointerDown?.(v), P = (v) => l?.onPointerMove?.(v), C = (v) => l?.onPointerUp?.(v), k = (v) => l?.onPointerCancel?.(v);
|
|
312
|
+
return (v, c) => (w(), E("div", {
|
|
313
|
+
id: o(s),
|
|
292
314
|
ref_key: "elementRef",
|
|
293
|
-
ref:
|
|
294
|
-
class:
|
|
295
|
-
style:
|
|
296
|
-
onPointerdown:
|
|
297
|
-
onPointermove:
|
|
298
|
-
onPointerup:
|
|
299
|
-
onPointercancel:
|
|
300
|
-
onLostpointercapture:
|
|
315
|
+
ref: _,
|
|
316
|
+
class: D(["omnipad-target-zone omnipad-prevent", o(a)?.cssClasses]),
|
|
317
|
+
style: O(R.value),
|
|
318
|
+
onPointerdown: m,
|
|
319
|
+
onPointermove: P,
|
|
320
|
+
onPointerup: C,
|
|
321
|
+
onPointercancel: k,
|
|
322
|
+
onLostpointercapture: k
|
|
301
323
|
}, [
|
|
302
|
-
h(
|
|
303
|
-
state: o(
|
|
304
|
-
isReturning: o(
|
|
305
|
-
cursorPos: o(
|
|
324
|
+
h(v.$slots, "focus-feedback", {
|
|
325
|
+
state: o(i),
|
|
326
|
+
isReturning: o(i)?.isFocusReturning,
|
|
327
|
+
cursorPos: o(i)?.position
|
|
306
328
|
}, () => [
|
|
307
|
-
|
|
308
|
-
default:
|
|
309
|
-
o(
|
|
329
|
+
H(Me, { name: "omnipad-default-focus-fade" }, {
|
|
330
|
+
default: N(() => [
|
|
331
|
+
o(i)?.isFocusReturning ? (w(), E("div", He)) : Y("", !0)
|
|
310
332
|
]),
|
|
311
333
|
_: 1
|
|
312
334
|
})
|
|
313
335
|
], !0),
|
|
314
|
-
o(
|
|
336
|
+
o(a)?.cursorEnabled ? (w(), E("div", {
|
|
315
337
|
key: 0,
|
|
316
338
|
class: "omnipad-virtual-cursor",
|
|
317
|
-
style:
|
|
339
|
+
style: O(u.value)
|
|
318
340
|
}, [
|
|
319
|
-
h(
|
|
320
|
-
state: o(
|
|
321
|
-
isDown: o(
|
|
322
|
-
isReturning: o(
|
|
323
|
-
cursorPos: o(
|
|
341
|
+
h(v.$slots, "cursor", {
|
|
342
|
+
state: o(i),
|
|
343
|
+
isDown: o(i)?.isPointerDown,
|
|
344
|
+
isReturning: o(i)?.isFocusReturning,
|
|
345
|
+
cursorPos: o(i)?.position
|
|
324
346
|
}, () => [
|
|
325
347
|
T("div", {
|
|
326
|
-
class:
|
|
348
|
+
class: D(["omnipad-default-cursor-dot", { "is-down": o(i)?.isPointerDown }])
|
|
327
349
|
}, null, 2)
|
|
328
350
|
], !0)
|
|
329
|
-
], 4)) :
|
|
330
|
-
o(
|
|
351
|
+
], 4)) : Y("", !0),
|
|
352
|
+
o(a)?.cursorEnabled ? (w(), E("div", {
|
|
331
353
|
key: 1,
|
|
332
354
|
class: "omnipad-virtual-cursor",
|
|
333
|
-
style:
|
|
355
|
+
style: O(u.value)
|
|
334
356
|
}, [
|
|
335
|
-
h(
|
|
336
|
-
state: o(
|
|
337
|
-
isDown: o(
|
|
338
|
-
isReturning: o(
|
|
339
|
-
cursorPos: o(
|
|
357
|
+
h(v.$slots, "with-cursor", {
|
|
358
|
+
state: o(i),
|
|
359
|
+
isDown: o(i)?.isPointerDown,
|
|
360
|
+
isReturning: o(i)?.isFocusReturning,
|
|
361
|
+
cursorPos: o(i)?.position
|
|
340
362
|
}, void 0, !0)
|
|
341
|
-
], 4)) :
|
|
342
|
-
h(
|
|
343
|
-
state: o(
|
|
344
|
-
isDown: o(
|
|
345
|
-
isReturning: o(
|
|
346
|
-
cursorPos: o(
|
|
363
|
+
], 4)) : Y("", !0),
|
|
364
|
+
h(v.$slots, "default", {
|
|
365
|
+
state: o(i),
|
|
366
|
+
isDown: o(i)?.isPointerDown,
|
|
367
|
+
isReturning: o(i)?.isFocusReturning,
|
|
368
|
+
cursorPos: o(i)?.position
|
|
347
369
|
}, void 0, !0)
|
|
348
|
-
], 46,
|
|
370
|
+
], 46, Ge));
|
|
349
371
|
}
|
|
350
|
-
}),
|
|
372
|
+
}), et = /* @__PURE__ */ V(Xe, [["__scopeId", "data-v-ef213f3f"]]), tt = { class: "omnipad-button-content-layer" }, ot = {
|
|
351
373
|
key: 0,
|
|
352
374
|
class: "omnipad-default-button-label"
|
|
353
|
-
},
|
|
375
|
+
}, nt = /* @__PURE__ */ B({
|
|
354
376
|
__name: "VirtualButtonBase",
|
|
355
377
|
props: {
|
|
356
378
|
layout: {},
|
|
@@ -358,31 +380,31 @@ const Be = ["id"], Oe = /* @__PURE__ */ S({
|
|
|
358
380
|
label: {}
|
|
359
381
|
},
|
|
360
382
|
setup(e) {
|
|
361
|
-
const
|
|
362
|
-
return (
|
|
383
|
+
const n = e, d = $(() => n.layout ? q(n.layout) : {});
|
|
384
|
+
return (s, t) => (w(), E("div", {
|
|
363
385
|
class: "omnipad-button-base omnipad-prevent",
|
|
364
|
-
style:
|
|
386
|
+
style: O(d.value),
|
|
365
387
|
tabindex: "-1"
|
|
366
388
|
}, [
|
|
367
|
-
h(
|
|
389
|
+
h(s.$slots, "base", {
|
|
368
390
|
isActive: e.isActive,
|
|
369
391
|
label: e.label
|
|
370
392
|
}, () => [
|
|
371
393
|
T("div", {
|
|
372
|
-
class:
|
|
394
|
+
class: D(["omnipad-default-button-base", { "is-active": e.isActive }])
|
|
373
395
|
}, null, 2)
|
|
374
396
|
], !0),
|
|
375
|
-
T("div",
|
|
376
|
-
h(
|
|
397
|
+
T("div", tt, [
|
|
398
|
+
h(s.$slots, "default", {
|
|
377
399
|
isActive: e.isActive,
|
|
378
400
|
label: e.label
|
|
379
401
|
}, () => [
|
|
380
|
-
e.label ? (
|
|
402
|
+
e.label ? (w(), E("span", ot, Ye(e.label), 1)) : Y("", !0)
|
|
381
403
|
], !0)
|
|
382
404
|
])
|
|
383
405
|
], 4));
|
|
384
406
|
}
|
|
385
|
-
}),
|
|
407
|
+
}), te = /* @__PURE__ */ V(nt, [["__scopeId", "data-v-f6a6e082"]]), it = /* @__PURE__ */ B({
|
|
386
408
|
__name: "VirtualButton",
|
|
387
409
|
props: {
|
|
388
410
|
treeNode: {},
|
|
@@ -392,46 +414,44 @@ const Be = ["id"], Oe = /* @__PURE__ */ S({
|
|
|
392
414
|
mapping: {},
|
|
393
415
|
layout: {}
|
|
394
416
|
},
|
|
395
|
-
setup(e, { expose:
|
|
396
|
-
const
|
|
417
|
+
setup(e, { expose: n }) {
|
|
418
|
+
const d = e, s = {
|
|
397
419
|
label: "BTN"
|
|
398
|
-
}, { uid:
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
), { core:
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
}), (w, C) => (R(), L(G, {
|
|
413
|
-
id: o(n),
|
|
420
|
+
}, { uid: t, initialConfig: r, reactiveConfig: b } = z(
|
|
421
|
+
I.BUTTON,
|
|
422
|
+
d,
|
|
423
|
+
s
|
|
424
|
+
), { core: i, state: l, domEvents: a, effectiveConfig: f, effectiveLayout: _, elementRef: R } = K(() => new be(t, r, d.treeNode?.type), b), y = (C) => a?.onPointerDown?.(C), u = (C) => a?.onPointerMove?.(C), m = (C) => a?.onPointerUp?.(C), P = (C) => a?.onPointerCancel?.(C);
|
|
425
|
+
return n({
|
|
426
|
+
uid: t,
|
|
427
|
+
onPointerDown: y,
|
|
428
|
+
onPointerMove: u,
|
|
429
|
+
onPointerUp: m,
|
|
430
|
+
onPointerCancel: P,
|
|
431
|
+
markRectDirty: () => i.value?.markRectDirty
|
|
432
|
+
}), (C, k) => (w(), Z(te, {
|
|
433
|
+
id: o(t),
|
|
414
434
|
ref_key: "elementRef",
|
|
415
|
-
ref:
|
|
416
|
-
class:
|
|
417
|
-
layout: o(
|
|
418
|
-
label: o(
|
|
419
|
-
"is-active": o(
|
|
420
|
-
onPointerdown:
|
|
421
|
-
onPointerup:
|
|
422
|
-
onPointercancel:
|
|
423
|
-
onLostpointercapture:
|
|
435
|
+
ref: R,
|
|
436
|
+
class: D(["omnipad-button omnipad-prevent", o(f)?.cssClasses]),
|
|
437
|
+
layout: o(_),
|
|
438
|
+
label: o(f)?.label,
|
|
439
|
+
"is-active": o(l)?.isPressed,
|
|
440
|
+
onPointerdown: y,
|
|
441
|
+
onPointerup: m,
|
|
442
|
+
onPointercancel: P,
|
|
443
|
+
onLostpointercapture: P
|
|
424
444
|
}, {
|
|
425
|
-
base:
|
|
426
|
-
h(
|
|
445
|
+
base: N((v) => [
|
|
446
|
+
h(C.$slots, "base", x(U(v)))
|
|
427
447
|
]),
|
|
428
|
-
default:
|
|
429
|
-
h(
|
|
448
|
+
default: N((v) => [
|
|
449
|
+
h(C.$slots, "default", x(U(v)))
|
|
430
450
|
]),
|
|
431
451
|
_: 3
|
|
432
452
|
}, 8, ["id", "class", "layout", "label", "is-active"]));
|
|
433
453
|
}
|
|
434
|
-
}),
|
|
454
|
+
}), st = { class: "omnipad-axis-bg" }, at = { class: "omnipad-axis-content-layer" }, rt = /* @__PURE__ */ B({
|
|
435
455
|
__name: "VirtualAxisBase",
|
|
436
456
|
props: {
|
|
437
457
|
layout: {},
|
|
@@ -441,51 +461,51 @@ const Be = ["id"], Oe = /* @__PURE__ */ S({
|
|
|
441
461
|
baseRadius: {}
|
|
442
462
|
},
|
|
443
463
|
setup(e) {
|
|
444
|
-
const
|
|
445
|
-
const
|
|
464
|
+
const n = e, d = $(() => n.layout ? q(n.layout) : {}), s = Q(), t = $(() => {
|
|
465
|
+
const r = n.vector?.x || 0, b = n.vector?.y || 0, i = n.baseRadius?.x || 0, l = n.baseRadius?.y || 0, a = s ? `${r * 50}cqw` : `${r * i}px`, f = s ? `${b * 50}cqh` : `${b * l}px`, _ = s ? "100cqw" : `${i * 2}px`, R = s ? "100cqh" : `${l * 2}px`;
|
|
446
466
|
return {
|
|
447
|
-
"--omnipad-axis-stick-container-x":
|
|
448
|
-
"--omnipad-axis-stick-container-y":
|
|
449
|
-
"--omnipad-axis-stick-width":
|
|
450
|
-
"--omnipad-axis-stick-height":
|
|
467
|
+
"--omnipad-axis-stick-container-x": a,
|
|
468
|
+
"--omnipad-axis-stick-container-y": f,
|
|
469
|
+
"--omnipad-axis-stick-width": _,
|
|
470
|
+
"--omnipad-axis-stick-height": R,
|
|
451
471
|
// 松手时加一点回弹过渡,活动时取消过渡保证绝对跟手
|
|
452
|
-
transition:
|
|
472
|
+
transition: n.isActive ? "none" : "transform 0.1s ease-out"
|
|
453
473
|
};
|
|
454
474
|
});
|
|
455
|
-
return (
|
|
456
|
-
class:
|
|
457
|
-
style:
|
|
475
|
+
return (r, b) => (w(), E("div", {
|
|
476
|
+
class: D(["omnipad-axis-base omnipad-prevent", { "is-active": e.isActive }]),
|
|
477
|
+
style: O(d.value),
|
|
458
478
|
tabindex: "-1"
|
|
459
479
|
}, [
|
|
460
|
-
T("div",
|
|
461
|
-
h(
|
|
480
|
+
T("div", st, [
|
|
481
|
+
h(r.$slots, "base", {
|
|
462
482
|
isActive: e.isActive,
|
|
463
483
|
vector: e.vector
|
|
464
484
|
}, void 0, !0)
|
|
465
485
|
]),
|
|
466
|
-
e.showStick ? (
|
|
486
|
+
e.showStick ? (w(), E("div", {
|
|
467
487
|
key: 0,
|
|
468
488
|
class: "omnipad-axis-stick-container",
|
|
469
|
-
style:
|
|
489
|
+
style: O(t.value)
|
|
470
490
|
}, [
|
|
471
|
-
h(
|
|
491
|
+
h(r.$slots, "stick", {
|
|
472
492
|
isActive: e.isActive,
|
|
473
493
|
vector: e.vector
|
|
474
494
|
}, () => [
|
|
475
495
|
T("div", {
|
|
476
|
-
class:
|
|
496
|
+
class: D(["omnipad-default-axis-stick", { "is-active": e.isActive }])
|
|
477
497
|
}, null, 2)
|
|
478
498
|
], !0)
|
|
479
|
-
], 4)) :
|
|
480
|
-
T("div",
|
|
481
|
-
h(
|
|
499
|
+
], 4)) : Y("", !0),
|
|
500
|
+
T("div", at, [
|
|
501
|
+
h(r.$slots, "default", {
|
|
482
502
|
isActive: e.isActive,
|
|
483
503
|
vector: e.vector
|
|
484
504
|
}, void 0, !0)
|
|
485
505
|
])
|
|
486
506
|
], 6));
|
|
487
507
|
}
|
|
488
|
-
}),
|
|
508
|
+
}), fe = /* @__PURE__ */ V(rt, [["__scopeId", "data-v-95bb429e"]]), ct = { class: "omnipad-dpad-cross-bg" }, lt = /* @__PURE__ */ B({
|
|
489
509
|
__name: "VirtualDPad",
|
|
490
510
|
props: {
|
|
491
511
|
treeNode: {},
|
|
@@ -496,73 +516,71 @@ const Be = ["id"], Oe = /* @__PURE__ */ S({
|
|
|
496
516
|
showStick: {},
|
|
497
517
|
layout: {}
|
|
498
518
|
},
|
|
499
|
-
setup(e, { expose:
|
|
500
|
-
const
|
|
519
|
+
setup(e, { expose: n }) {
|
|
520
|
+
const d = e, s = {
|
|
501
521
|
showStick: !1,
|
|
502
522
|
threshold: 0.3
|
|
503
|
-
}, { uid:
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
), { core:
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
const r = s.value?.rect;
|
|
511
|
-
r && (p.value = { x: r.width / 2, y: r.height / 2 });
|
|
523
|
+
}, { uid: t, initialConfig: r, reactiveConfig: b } = z(
|
|
524
|
+
I.D_PAD,
|
|
525
|
+
d,
|
|
526
|
+
s
|
|
527
|
+
), { core: i, state: l, domEvents: a, effectiveConfig: f, effectiveLayout: _, elementRef: R } = K(() => new he(t, r, d.treeNode?.type), b), y = Q(), u = M({ x: 0, y: 0 }), m = de(() => {
|
|
528
|
+
const c = i.value?.rect;
|
|
529
|
+
c && (u.value = { x: c.width / 2, y: c.height / 2 });
|
|
512
530
|
});
|
|
513
|
-
|
|
514
|
-
const
|
|
515
|
-
return
|
|
516
|
-
uid:
|
|
517
|
-
onPointerDown:
|
|
518
|
-
onPointerMove:
|
|
519
|
-
onPointerUp:
|
|
520
|
-
onPointerCancel:
|
|
521
|
-
markRectDirty: () =>
|
|
522
|
-
}), (
|
|
531
|
+
y && m();
|
|
532
|
+
const P = (c) => a?.onPointerDown?.(c), C = (c) => a?.onPointerMove?.(c), k = (c) => a?.onPointerUp?.(c), v = (c) => a?.onPointerCancel?.(c);
|
|
533
|
+
return n({
|
|
534
|
+
uid: t,
|
|
535
|
+
onPointerDown: P,
|
|
536
|
+
onPointerMove: C,
|
|
537
|
+
onPointerUp: k,
|
|
538
|
+
onPointerCancel: v,
|
|
539
|
+
markRectDirty: () => i.value?.markRectDirty()
|
|
540
|
+
}), (c, L) => (w(), Z(fe, {
|
|
523
541
|
ref_key: "elementRef",
|
|
524
|
-
ref:
|
|
525
|
-
class:
|
|
526
|
-
layout: o(
|
|
527
|
-
"is-active": o(
|
|
528
|
-
vector: o(
|
|
529
|
-
"show-stick": o(
|
|
530
|
-
"base-radius":
|
|
531
|
-
onPointerdown:
|
|
532
|
-
onPointermove:
|
|
533
|
-
onPointerup:
|
|
534
|
-
onPointercancel:
|
|
535
|
-
onLostpointercapture:
|
|
542
|
+
ref: R,
|
|
543
|
+
class: D(["omnipad-dpad omnipad-prevent", o(f)?.cssClasses]),
|
|
544
|
+
layout: o(_),
|
|
545
|
+
"is-active": o(l)?.isActive,
|
|
546
|
+
vector: o(l)?.vector,
|
|
547
|
+
"show-stick": o(f)?.showStick,
|
|
548
|
+
"base-radius": u.value,
|
|
549
|
+
onPointerdown: P,
|
|
550
|
+
onPointermove: C,
|
|
551
|
+
onPointerup: k,
|
|
552
|
+
onPointercancel: v,
|
|
553
|
+
onLostpointercapture: v
|
|
536
554
|
}, {
|
|
537
|
-
base:
|
|
538
|
-
h(
|
|
539
|
-
T("div",
|
|
555
|
+
base: N((g) => [
|
|
556
|
+
h(c.$slots, "base", x(U(g)), () => [
|
|
557
|
+
T("div", ct, [
|
|
540
558
|
T("div", {
|
|
541
|
-
class:
|
|
559
|
+
class: D(["dpad-arm top", { on: g.vector && g.vector.y < -o(f)?.threshold }])
|
|
542
560
|
}, null, 2),
|
|
543
561
|
T("div", {
|
|
544
|
-
class:
|
|
562
|
+
class: D(["dpad-arm bottom", { on: g.vector && g.vector.y > o(f)?.threshold }])
|
|
545
563
|
}, null, 2),
|
|
546
564
|
T("div", {
|
|
547
|
-
class:
|
|
565
|
+
class: D(["dpad-arm left", { on: g.vector && g.vector.x < -o(f)?.threshold }])
|
|
548
566
|
}, null, 2),
|
|
549
567
|
T("div", {
|
|
550
|
-
class:
|
|
568
|
+
class: D(["dpad-arm right", { on: g.vector && g.vector.x > o(f)?.threshold }])
|
|
551
569
|
}, null, 2),
|
|
552
|
-
|
|
570
|
+
L[0] || (L[0] = T("div", { class: "dpad-center" }, null, -1))
|
|
553
571
|
])
|
|
554
572
|
], !0)
|
|
555
573
|
]),
|
|
556
|
-
stick:
|
|
557
|
-
h(
|
|
574
|
+
stick: N((g) => [
|
|
575
|
+
h(c.$slots, "stick", x(U(g)), void 0, !0)
|
|
558
576
|
]),
|
|
559
|
-
default:
|
|
560
|
-
h(
|
|
577
|
+
default: N((g) => [
|
|
578
|
+
h(c.$slots, "default", x(U(g)), void 0, !0)
|
|
561
579
|
]),
|
|
562
580
|
_: 3
|
|
563
581
|
}, 8, ["class", "layout", "is-active", "vector", "show-stick", "base-radius"]));
|
|
564
582
|
}
|
|
565
|
-
}),
|
|
583
|
+
}), dt = /* @__PURE__ */ V(lt, [["__scopeId", "data-v-1bf11a90"]]), ut = /* @__PURE__ */ B({
|
|
566
584
|
__name: "VirtualTrackpad",
|
|
567
585
|
props: {
|
|
568
586
|
treeNode: {},
|
|
@@ -573,44 +591,46 @@ const Be = ["id"], Oe = /* @__PURE__ */ S({
|
|
|
573
591
|
mapping: {},
|
|
574
592
|
layout: {}
|
|
575
593
|
},
|
|
576
|
-
setup(e, { expose:
|
|
577
|
-
const
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
594
|
+
setup(e, { expose: n }) {
|
|
595
|
+
const d = e, { uid: s, initialConfig: t, reactiveConfig: r } = z(
|
|
596
|
+
I.TRACKPAD,
|
|
597
|
+
d,
|
|
598
|
+
{
|
|
599
|
+
label: "TRACKPAD",
|
|
600
|
+
sensitivity: 1
|
|
601
|
+
}
|
|
602
|
+
), { core: b, state: i, domEvents: l, effectiveConfig: a, effectiveLayout: f, elementRef: _ } = K(() => new Ce(s, t, d.treeNode?.type), r), R = (P) => l?.onPointerDown?.(P), y = (P) => l?.onPointerMove?.(P), u = (P) => l?.onPointerUp?.(P), m = (P) => l?.onPointerCancel?.(P);
|
|
603
|
+
return n({
|
|
604
|
+
uid: s,
|
|
605
|
+
onPointerDown: R,
|
|
606
|
+
onPointerMove: y,
|
|
607
|
+
onPointerUp: u,
|
|
608
|
+
onPointerCancel: m,
|
|
609
|
+
markRectDirty: () => b.value?.markRectDirty
|
|
610
|
+
}), (P, C) => (w(), Z(te, {
|
|
611
|
+
id: o(s),
|
|
592
612
|
ref_key: "elementRef",
|
|
593
|
-
ref:
|
|
594
|
-
class:
|
|
595
|
-
layout: o(
|
|
596
|
-
label: o(
|
|
597
|
-
"is-active": o(
|
|
598
|
-
onPointerdown:
|
|
599
|
-
onPointermove:
|
|
600
|
-
onPointerup:
|
|
601
|
-
onPointercancel:
|
|
602
|
-
onLostpointercapture:
|
|
613
|
+
ref: _,
|
|
614
|
+
class: D(["omnipad-trackpad omnipad-prevent", o(a)?.cssClasses]),
|
|
615
|
+
layout: o(f),
|
|
616
|
+
label: o(a)?.label,
|
|
617
|
+
"is-active": o(i)?.isPressed,
|
|
618
|
+
onPointerdown: R,
|
|
619
|
+
onPointermove: y,
|
|
620
|
+
onPointerup: u,
|
|
621
|
+
onPointercancel: m,
|
|
622
|
+
onLostpointercapture: m
|
|
603
623
|
}, {
|
|
604
|
-
base:
|
|
605
|
-
h(
|
|
624
|
+
base: N((k) => [
|
|
625
|
+
h(P.$slots, "base", x(U(k)), void 0, !0)
|
|
606
626
|
]),
|
|
607
|
-
default:
|
|
608
|
-
h(
|
|
627
|
+
default: N((k) => [
|
|
628
|
+
h(P.$slots, "default", x(U(k)), void 0, !0)
|
|
609
629
|
]),
|
|
610
630
|
_: 3
|
|
611
631
|
}, 8, ["id", "class", "layout", "label", "is-active"]));
|
|
612
632
|
}
|
|
613
|
-
}),
|
|
633
|
+
}), vt = /* @__PURE__ */ V(ut, [["__scopeId", "data-v-e9f8b8d7"]]), ft = /* @__PURE__ */ B({
|
|
614
634
|
__name: "VirtualJoystick",
|
|
615
635
|
props: {
|
|
616
636
|
treeNode: {},
|
|
@@ -623,88 +643,89 @@ const Be = ["id"], Oe = /* @__PURE__ */ S({
|
|
|
623
643
|
mapping: {},
|
|
624
644
|
layout: {}
|
|
625
645
|
},
|
|
626
|
-
setup(e, { expose:
|
|
627
|
-
const
|
|
646
|
+
setup(e, { expose: n }) {
|
|
647
|
+
const d = e, s = {
|
|
628
648
|
label: "PUSH",
|
|
629
649
|
threshold: 0.2,
|
|
630
650
|
cursorMode: !1,
|
|
631
651
|
cursorSensitivity: 1
|
|
632
|
-
}, { uid:
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
), { core:
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
const r = s.value?.rect;
|
|
640
|
-
r && (p.value = { x: r.width / 2, y: r.height / 2 });
|
|
652
|
+
}, { uid: t, initialConfig: r, reactiveConfig: b } = z(
|
|
653
|
+
I.JOYSTICK,
|
|
654
|
+
d,
|
|
655
|
+
s
|
|
656
|
+
), { core: i, state: l, domEvents: a, effectiveConfig: f, effectiveLayout: _, elementRef: R } = K(() => new _e(t, r, d.treeNode?.type), b), y = Q(), u = M({ x: 0, y: 0 }), m = de(() => {
|
|
657
|
+
const c = i.value?.rect;
|
|
658
|
+
c && (u.value = { x: c.width / 2, y: c.height / 2 });
|
|
641
659
|
});
|
|
642
|
-
|
|
643
|
-
const
|
|
644
|
-
return
|
|
645
|
-
uid:
|
|
646
|
-
onPointerDown:
|
|
647
|
-
onPointerMove:
|
|
648
|
-
onPointerUp:
|
|
649
|
-
onPointerCancel:
|
|
650
|
-
markRectDirty: () =>
|
|
651
|
-
}), (
|
|
660
|
+
y && m();
|
|
661
|
+
const P = (c) => a?.onPointerDown?.(c), C = (c) => a?.onPointerMove?.(c), k = (c) => a?.onPointerUp?.(c), v = (c) => a?.onPointerCancel?.(c);
|
|
662
|
+
return n({
|
|
663
|
+
uid: t,
|
|
664
|
+
onPointerDown: P,
|
|
665
|
+
onPointerMove: C,
|
|
666
|
+
onPointerUp: k,
|
|
667
|
+
onPointerCancel: v,
|
|
668
|
+
markRectDirty: () => i.value?.markRectDirty
|
|
669
|
+
}), (c, L) => (w(), Z(fe, {
|
|
652
670
|
ref_key: "elementRef",
|
|
653
|
-
ref:
|
|
654
|
-
class:
|
|
655
|
-
layout: o(
|
|
656
|
-
"is-active": o(
|
|
657
|
-
vector: o(
|
|
671
|
+
ref: R,
|
|
672
|
+
class: D(["omnipad-joystick omnipad-prevent", o(f)?.cssClasses]),
|
|
673
|
+
layout: o(_),
|
|
674
|
+
"is-active": o(l)?.isActive,
|
|
675
|
+
vector: o(l)?.vector,
|
|
658
676
|
"show-stick": "",
|
|
659
|
-
"base-radius":
|
|
660
|
-
onPointerdown:
|
|
661
|
-
onPointermove:
|
|
662
|
-
onPointerup:
|
|
663
|
-
onPointercancel:
|
|
664
|
-
onLostpointercapture:
|
|
677
|
+
"base-radius": u.value,
|
|
678
|
+
onPointerdown: P,
|
|
679
|
+
onPointermove: C,
|
|
680
|
+
onPointerup: k,
|
|
681
|
+
onPointercancel: v,
|
|
682
|
+
onLostpointercapture: v
|
|
665
683
|
}, {
|
|
666
|
-
base:
|
|
667
|
-
h(
|
|
684
|
+
base: N((g) => [
|
|
685
|
+
h(c.$slots, "base", x(U(g)), void 0, !0)
|
|
668
686
|
]),
|
|
669
|
-
stick:
|
|
670
|
-
|
|
687
|
+
stick: N(() => [
|
|
688
|
+
H(te, {
|
|
671
689
|
layout: { height: "100%", width: "100%" },
|
|
672
|
-
"is-active": o(
|
|
673
|
-
label: o(
|
|
690
|
+
"is-active": o(l)?.isPressed,
|
|
691
|
+
label: o(f)?.label
|
|
674
692
|
}, {
|
|
675
|
-
base:
|
|
676
|
-
h(
|
|
693
|
+
base: N((g) => [
|
|
694
|
+
h(c.$slots, "stick-base", x(U(g)), void 0, !0)
|
|
677
695
|
]),
|
|
678
|
-
default:
|
|
679
|
-
h(
|
|
696
|
+
default: N((g) => [
|
|
697
|
+
h(c.$slots, "stick", x(U(g)), void 0, !0)
|
|
680
698
|
]),
|
|
681
699
|
_: 3
|
|
682
700
|
}, 8, ["is-active", "label"])
|
|
683
701
|
]),
|
|
684
|
-
default:
|
|
685
|
-
h(
|
|
702
|
+
default: N((g) => [
|
|
703
|
+
h(c.$slots, "default", x(U(g)), void 0, !0)
|
|
686
704
|
]),
|
|
687
705
|
_: 3
|
|
688
706
|
}, 8, ["class", "layout", "is-active", "vector", "base-radius"]));
|
|
689
707
|
}
|
|
690
|
-
}),
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
708
|
+
}), pt = /* @__PURE__ */ V(ft, [["__scopeId", "data-v-ec529d0c"]]);
|
|
709
|
+
F(I.BUTTON, it);
|
|
710
|
+
F(I.INPUT_ZONE, je);
|
|
711
|
+
F(I.ROOT_LAYER, Je);
|
|
712
|
+
F(I.TARGET_ZONE, et);
|
|
713
|
+
F(I.TRACKPAD, vt);
|
|
714
|
+
F(I.D_PAD, dt);
|
|
715
|
+
F(I.JOYSTICK, pt);
|
|
716
|
+
we((e) => {
|
|
717
|
+
(e.type === se.KEYDOWN || e.type === se.KEYUP) && ce(e.type, e.payload);
|
|
718
|
+
});
|
|
698
719
|
export {
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
720
|
+
je as InputZone,
|
|
721
|
+
Je as RootLayer,
|
|
722
|
+
et as TargetZone,
|
|
723
|
+
it as VirtualButton,
|
|
724
|
+
dt as VirtualDPad,
|
|
725
|
+
pt as VirtualJoystick,
|
|
726
|
+
vt as VirtualTrackpad,
|
|
727
|
+
ue as getComponent,
|
|
728
|
+
re as getComponentSafe,
|
|
729
|
+
Pt as hasRegisteredComponent,
|
|
730
|
+
F as registerComponent
|
|
710
731
|
};
|