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