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