@tresjs/leches 0.7.0 → 0.9.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/components/BooleanControl.vue.d.ts +1 -1
- package/dist/components/ColorControl.vue.d.ts +1 -1
- package/dist/components/ControlInput.vue.d.ts +1 -1
- package/dist/components/FPSGraph.vue.d.ts +1 -1
- package/dist/components/Folder.vue.d.ts +13 -5
- package/dist/components/NumberControl.vue.d.ts +1 -1
- package/dist/components/SelectControl.vue.d.ts +1 -1
- package/dist/components/SliderControl.vue.d.ts +1 -1
- package/dist/components/TextControl.vue.d.ts +1 -1
- package/dist/components/TresLeches.vue.d.ts +9 -1
- package/dist/components/VectorControl.vue.d.ts +1 -1
- package/dist/composables/useControls.d.ts +15 -4
- package/dist/composables/useDraggable/component.d.ts +15 -0
- package/dist/composables/useDraggable/index.d.ts +101 -0
- package/dist/index.d.ts +2 -2
- package/dist/style.css +2 -2
- package/dist/tresleches.js +461 -499
- package/dist/tresleches.umd.cjs +2 -2
- package/dist/utils/is.d.ts +6 -0
- package/dist/utils/normalize.d.ts +2 -2
- package/package.json +30 -19
package/dist/tresleches.js
CHANGED
|
@@ -1,65 +1,99 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* name: @tresjs/leches
|
|
3
|
-
* version: v0.
|
|
3
|
+
* version: v0.9.0
|
|
4
4
|
* (c) 2023
|
|
5
5
|
* description: Tasty GUI for Vue controls 🍰
|
|
6
6
|
* author: Alvaro Saburido <hola@alvarosaburido.dev> (https://github.com/alvarosabu/)
|
|
7
7
|
*/
|
|
8
|
-
import { unref as
|
|
9
|
-
import {
|
|
10
|
-
function
|
|
11
|
-
return
|
|
8
|
+
import { unref as T, isRef as P, toRefs as E, customRef as ae, ref as h, watch as W, computed as D, defineComponent as M, reactive as U, h as ce, provide as ie, isReactive as ue, openBlock as f, createElementBlock as m, createElementVNode as c, toDisplayString as k, normalizeClass as S, withDirectives as q, vShow as J, createTextVNode as pe, normalizeStyle as fe, Fragment as A, renderList as X, createCommentVNode as N, createBlock as C, createVNode as de, Transition as ve, withCtx as Q } from "vue";
|
|
9
|
+
import { useWindowSize as Z, useEventListener as B, useStorage as ge, isClient as he, useMouse as j, useFps as ye, useRafFn as be } from "@vueuse/core";
|
|
10
|
+
function I(e) {
|
|
11
|
+
return typeof e == "function" ? e() : T(e);
|
|
12
12
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
13
|
+
const ee = typeof window < "u" && typeof document < "u";
|
|
14
|
+
function me(e, l = {}) {
|
|
15
|
+
if (!P(e))
|
|
16
|
+
return E(e);
|
|
17
|
+
const n = Array.isArray(e.value) ? Array.from({ length: e.value.length }) : {};
|
|
18
|
+
for (const t in e.value)
|
|
19
|
+
n[t] = ae(() => ({
|
|
20
|
+
get() {
|
|
21
|
+
return e.value[t];
|
|
22
|
+
},
|
|
23
|
+
set(s) {
|
|
24
|
+
var r;
|
|
25
|
+
if ((r = I(l.replaceRef)) != null ? r : !0)
|
|
26
|
+
if (Array.isArray(e.value)) {
|
|
27
|
+
const p = [...e.value];
|
|
28
|
+
p[t] = s, e.value = p;
|
|
29
|
+
} else {
|
|
30
|
+
const p = { ...e.value, [t]: s };
|
|
31
|
+
Object.setPrototypeOf(p, Object.getPrototypeOf(e.value)), e.value = p;
|
|
32
|
+
}
|
|
33
|
+
else
|
|
34
|
+
e.value[t] = s;
|
|
35
|
+
}
|
|
36
|
+
}));
|
|
37
|
+
return n;
|
|
32
38
|
}
|
|
33
|
-
const
|
|
34
|
-
function
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
a
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
39
|
+
const _e = ee ? window : void 0;
|
|
40
|
+
function xe(e, l = {}) {
|
|
41
|
+
const {
|
|
42
|
+
pointerTypes: n,
|
|
43
|
+
preventDefault: t,
|
|
44
|
+
stopPropagation: s,
|
|
45
|
+
exact: r,
|
|
46
|
+
onMove: a,
|
|
47
|
+
onEnd: p,
|
|
48
|
+
onStart: d,
|
|
49
|
+
initialValue: _,
|
|
50
|
+
axis: i = "both",
|
|
51
|
+
draggingElement: o = _e,
|
|
52
|
+
handle: u = e
|
|
53
|
+
} = l, { width: w } = Z();
|
|
54
|
+
let v = w.value;
|
|
55
|
+
const b = h(
|
|
56
|
+
I(_) ?? { x: 0, y: 0 }
|
|
57
|
+
);
|
|
58
|
+
W(w, () => {
|
|
59
|
+
const y = w.value - v;
|
|
60
|
+
b.value.x += y, v = w.value;
|
|
61
|
+
});
|
|
62
|
+
const x = h(), g = (y) => n ? n.includes(y.pointerType) : !0, $ = (y) => {
|
|
63
|
+
I(t) && y.preventDefault(), I(s) && y.stopPropagation();
|
|
64
|
+
}, le = (y) => {
|
|
65
|
+
if (!g(y) || I(r) && y.target !== I(e))
|
|
66
|
+
return;
|
|
67
|
+
const V = I(e).getBoundingClientRect(), z = {
|
|
68
|
+
x: y.clientX - V.left,
|
|
69
|
+
y: y.clientY - V.top
|
|
70
|
+
};
|
|
71
|
+
(d == null ? void 0 : d(z, y)) !== !1 && (x.value = z, $(y));
|
|
72
|
+
}, se = (y) => {
|
|
73
|
+
if (!g(y) || !x.value)
|
|
74
|
+
return;
|
|
75
|
+
let { x: V, y: z } = b.value;
|
|
76
|
+
(i === "x" || i === "both") && (V = y.clientX - x.value.x), (i === "y" || i === "both") && (z = y.clientY - x.value.y), b.value = {
|
|
77
|
+
x: V,
|
|
78
|
+
y: z
|
|
79
|
+
}, a == null || a(b.value, y), $(y);
|
|
80
|
+
}, re = (y) => {
|
|
81
|
+
g(y) && x.value && (x.value = void 0, p == null || p(b.value, y), $(y));
|
|
82
|
+
};
|
|
83
|
+
if (ee) {
|
|
84
|
+
const y = { capture: l.capture ?? !0 };
|
|
85
|
+
B(u, "pointerdown", le, y), B(o, "pointermove", se, y), B(o, "pointerup", re, y);
|
|
86
|
+
}
|
|
87
|
+
return {
|
|
88
|
+
...me(b),
|
|
89
|
+
position: b,
|
|
90
|
+
isDragging: D(() => !!x.value),
|
|
91
|
+
style: D(
|
|
92
|
+
() => `left:${b.value.x}px;top:${b.value.y}px;`
|
|
93
|
+
)
|
|
51
94
|
};
|
|
52
|
-
return Z(x), x;
|
|
53
95
|
}
|
|
54
|
-
|
|
55
|
-
for (var e in o || (o = {}))
|
|
56
|
-
je.call(o, e) && W(t, e, o[e]);
|
|
57
|
-
if (U)
|
|
58
|
-
for (var e of U(o))
|
|
59
|
-
De.call(o, e) && W(t, e, o[e]);
|
|
60
|
-
return t;
|
|
61
|
-
}, Ee = (t, o) => Ie(t, Te(o));
|
|
62
|
-
const Ae = /* @__PURE__ */ w({
|
|
96
|
+
const we = /* @__PURE__ */ M({
|
|
63
97
|
name: "UseDraggable",
|
|
64
98
|
props: [
|
|
65
99
|
"storageKey",
|
|
@@ -76,601 +110,529 @@ const Ae = /* @__PURE__ */ w({
|
|
|
76
110
|
"onMove",
|
|
77
111
|
"onEnd"
|
|
78
112
|
],
|
|
79
|
-
setup(
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
onEnd: s
|
|
94
|
-
})));
|
|
113
|
+
setup(e, { slots: l }) {
|
|
114
|
+
const n = h(), t = D(() => e.handle ?? n.value), s = e.storageKey && ge(
|
|
115
|
+
e.storageKey,
|
|
116
|
+
I(e.initialValue) || { x: 0, y: 0 },
|
|
117
|
+
he ? e.storageType === "session" ? sessionStorage : localStorage : void 0
|
|
118
|
+
), r = s || e.initialValue || { x: 0, y: 0 }, p = U(xe(n, {
|
|
119
|
+
...e,
|
|
120
|
+
handle: t,
|
|
121
|
+
initialValue: r,
|
|
122
|
+
onEnd: (d, _) => {
|
|
123
|
+
var i;
|
|
124
|
+
(i = e.onEnd) == null || i.call(e, d, _), s && (s.value.x = d.x, s.value.y = d.y);
|
|
125
|
+
}
|
|
126
|
+
}));
|
|
95
127
|
return () => {
|
|
96
|
-
if (
|
|
97
|
-
return
|
|
128
|
+
if (l.default)
|
|
129
|
+
return ce(e.as || "div", { ref: n, style: `touch-action:none;${p.style}` }, l.default(p));
|
|
98
130
|
};
|
|
99
131
|
}
|
|
100
|
-
});
|
|
101
|
-
function
|
|
102
|
-
|
|
103
|
-
if (o.overflowX === "scroll" || o.overflowY === "scroll" || o.overflowX === "auto" && t.clientWidth < t.scrollWidth || o.overflowY === "auto" && t.clientHeight < t.scrollHeight)
|
|
104
|
-
return !0;
|
|
105
|
-
{
|
|
106
|
-
const e = t.parentNode;
|
|
107
|
-
return !e || e.tagName === "BODY" ? !1 : N(e);
|
|
108
|
-
}
|
|
132
|
+
}), $e = Symbol("CONTROLS_CONTEXT_KEY"), te = "default", F = U({});
|
|
133
|
+
function Ce(e = te) {
|
|
134
|
+
return ie($e, F), F[e];
|
|
109
135
|
}
|
|
110
|
-
|
|
111
|
-
const
|
|
112
|
-
return
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}
|
|
122
|
-
}, {
|
|
123
|
-
immediate: !0
|
|
124
|
-
});
|
|
125
|
-
const a = () => {
|
|
126
|
-
const i = P(t);
|
|
127
|
-
!i || e.value || (X && (n = Me(
|
|
128
|
-
i,
|
|
129
|
-
"touchmove",
|
|
130
|
-
(p) => {
|
|
131
|
-
Le(p);
|
|
132
|
-
},
|
|
133
|
-
{ passive: !1 }
|
|
134
|
-
)), i.style.overflow = "hidden", e.value = !0);
|
|
135
|
-
}, s = () => {
|
|
136
|
-
const i = P(t);
|
|
137
|
-
!i || !e.value || (X && (n == null || n()), i.style.overflow = l, e.value = !1);
|
|
136
|
+
const K = (e) => {
|
|
137
|
+
const l = /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$|^0x([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;
|
|
138
|
+
return typeof e == "boolean" ? "boolean" : typeof e == "number" ? "number" : typeof e == "string" && l.test(e) ? "color" : typeof e == "string" ? "string" : e.isVector3 || e.isVector2 || e.isEuler || e instanceof Array ? "vector" : e.min !== void 0 || e.max !== void 0 || e.step !== void 0 ? "range" : e.options && Array.isArray(e.options) && e.options.every((n) => "text" in n && "value" in n) ? "select" : "unknown";
|
|
139
|
+
}, L = (e, l, n, t) => {
|
|
140
|
+
const s = {
|
|
141
|
+
label: h(e),
|
|
142
|
+
name: h(e),
|
|
143
|
+
type: h(n),
|
|
144
|
+
value: h(l),
|
|
145
|
+
visible: h(!0),
|
|
146
|
+
[e]: h(l)
|
|
138
147
|
};
|
|
139
|
-
return
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
148
|
+
return t && (s.folder = h(t)), s;
|
|
149
|
+
}, Mt = (e, l, n) => {
|
|
150
|
+
const t = {}, s = typeof e == "string" ? e : null, r = s ? l : e, a = s && s !== "fpsgraph" ? n : l, p = (a == null ? void 0 : a.uuid) || te;
|
|
151
|
+
if (F[p] || (F[p] = U({})), e === "fpsgraph") {
|
|
152
|
+
const o = L("fpsgraph", null, "fpsgraph", null);
|
|
153
|
+
return F[p].fpsgraph = o, t.fpsgraph = o, E(U(t));
|
|
154
|
+
}
|
|
155
|
+
const d = F[p], _ = ue(r), i = _ ? E(r) : {};
|
|
156
|
+
for (const o in r) {
|
|
157
|
+
let u = r[o];
|
|
158
|
+
if (_ && i[o] && (u = i[o]), typeof u == "object" && !P(u) && !Array.isArray(u) && u.value !== void 0) {
|
|
159
|
+
const v = u, b = P(v.value) ? v.value : h(v.value), x = K(v), g = L(o, b, x, s);
|
|
160
|
+
x === "select" && (g.options = h(v.options)), x === "range" && (g.min = h(v.min), g.max = h(v.max), g.step = h(v.step)), d[o] = g, t[o] = g;
|
|
161
|
+
continue;
|
|
145
162
|
}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
T(o, (a) => l.value = a);
|
|
157
|
-
};
|
|
158
|
-
}
|
|
159
|
-
ze();
|
|
160
|
-
const Re = Symbol("CONTROLS_CONTEXT_KEY"), y = H({});
|
|
161
|
-
function Xe() {
|
|
162
|
-
return ue(Re, y), y;
|
|
163
|
-
}
|
|
164
|
-
function V(t) {
|
|
165
|
-
return Object.entries(t).map(([o, e]) => {
|
|
166
|
-
let n = "string", l;
|
|
167
|
-
const a = /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$|^0x([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;
|
|
168
|
-
return !L(e) && e.value || L(e) ? (n = typeof e.value, l = e.value) : (n = typeof e, l = e), n === "number" && (e.step || e.max || e.min) && (n = "range"), n === "string" && a.test(l) && (n = "color"), (l.isVector3 || l instanceof Array) && (n = "vector"), !L(e) && e.value ? {
|
|
169
|
-
...e,
|
|
170
|
-
label: e.label || o,
|
|
171
|
-
value: e.value,
|
|
172
|
-
type: n,
|
|
173
|
-
visible: !0
|
|
174
|
-
} : {
|
|
175
|
-
label: e.label || o,
|
|
176
|
-
value: e,
|
|
177
|
-
type: n,
|
|
178
|
-
visible: !0
|
|
179
|
-
};
|
|
180
|
-
});
|
|
181
|
-
}
|
|
182
|
-
function Ue() {
|
|
183
|
-
for (const t in y)
|
|
184
|
-
delete y[t];
|
|
185
|
-
}
|
|
186
|
-
function Bt(t, o, e) {
|
|
187
|
-
const n = g();
|
|
188
|
-
if (typeof t == "string")
|
|
189
|
-
t === "fpsgraph" ? (y[t] = {
|
|
190
|
-
label: "fpsgraph",
|
|
191
|
-
visible: !0,
|
|
192
|
-
type: "fpsgraph"
|
|
193
|
-
}, n.value = y[t]) : (y[t] = {
|
|
194
|
-
label: t,
|
|
195
|
-
visible: !0,
|
|
196
|
-
type: "folder",
|
|
197
|
-
controls: o ? V(o) : []
|
|
198
|
-
}, n.value = y[t]);
|
|
199
|
-
else if (typeof t == "object" && t.options)
|
|
200
|
-
y[t.label || "Dropdown"] = {
|
|
201
|
-
...e,
|
|
202
|
-
label: t.label || "Dropdown",
|
|
203
|
-
visible: !0,
|
|
204
|
-
value: t.value,
|
|
205
|
-
type: "select",
|
|
206
|
-
ref: t,
|
|
207
|
-
options: t.options
|
|
208
|
-
}, n.value = y[t.label || "Dropdown"];
|
|
209
|
-
else if (typeof t == "object" && typeof o == "string")
|
|
210
|
-
y[o] = {
|
|
211
|
-
...e,
|
|
212
|
-
label: o,
|
|
213
|
-
visible: !0,
|
|
214
|
-
value: t[o],
|
|
215
|
-
type: typeof t[o],
|
|
216
|
-
ref: t
|
|
217
|
-
}, n.value = y[o];
|
|
218
|
-
else if (ie(t)) {
|
|
219
|
-
const l = ce(t), a = V(l);
|
|
220
|
-
for (const s of a)
|
|
221
|
-
y[s.label] = s;
|
|
222
|
-
n.value = a;
|
|
223
|
-
} else {
|
|
224
|
-
const l = V(t);
|
|
225
|
-
for (const a of l)
|
|
226
|
-
y[a.label] = a;
|
|
227
|
-
n.value = l;
|
|
163
|
+
if (P(u)) {
|
|
164
|
+
const v = L(o, u, K(u.value), s);
|
|
165
|
+
d[o] = v, t[o] = v;
|
|
166
|
+
continue;
|
|
167
|
+
} else if (typeof u == "object" && !Array.isArray(u)) {
|
|
168
|
+
const v = E(u);
|
|
169
|
+
v[o] && (u = v[o]);
|
|
170
|
+
}
|
|
171
|
+
const w = L(o, u, K(u), s);
|
|
172
|
+
d[o] = w, t[o] = w;
|
|
228
173
|
}
|
|
229
|
-
return
|
|
230
|
-
}
|
|
231
|
-
const We = { class: "flex px-4 justify-between gap-4 items-center mb-2" }, Be = { class: "text-gray-500 w-1/3" }, Ke = ["value", "min", "max", "step"], Ye = /* @__PURE__ */ w({
|
|
174
|
+
return Object.keys(t).length > 1 ? E(U(t)) : Object.values(t)[0];
|
|
175
|
+
}, ke = { class: "flex px-4 justify-between gap-4 items-center mb-2" }, Me = { class: "text-gray-500 w-1/3" }, Te = ["value", "min", "max", "step"], Ie = /* @__PURE__ */ M({
|
|
232
176
|
__name: "NumberControl",
|
|
233
177
|
props: {
|
|
234
178
|
label: {},
|
|
235
179
|
control: {}
|
|
236
180
|
},
|
|
237
181
|
emits: ["change"],
|
|
238
|
-
setup(
|
|
239
|
-
const
|
|
240
|
-
function
|
|
241
|
-
const { target:
|
|
242
|
-
|
|
182
|
+
setup(e, { emit: l }) {
|
|
183
|
+
const n = e;
|
|
184
|
+
function t(i) {
|
|
185
|
+
const { target: o } = i;
|
|
186
|
+
l("change", o.valueAsNumber);
|
|
243
187
|
}
|
|
244
|
-
const
|
|
245
|
-
|
|
246
|
-
},
|
|
247
|
-
|
|
248
|
-
},
|
|
249
|
-
return
|
|
250
|
-
if (
|
|
251
|
-
const
|
|
252
|
-
|
|
188
|
+
const s = j(), r = h(0), a = h(!1), p = (i) => {
|
|
189
|
+
r.value = i.clientX, a.value = !0;
|
|
190
|
+
}, d = () => {
|
|
191
|
+
a.value = !1;
|
|
192
|
+
}, _ = (i) => Math.floor(Math.abs(i) / 10);
|
|
193
|
+
return W(s.x, (i) => {
|
|
194
|
+
if (a.value) {
|
|
195
|
+
const o = i - r.value, u = _(o);
|
|
196
|
+
o > 0 ? l("change", n.control.value + 1 + u) : o < 0 && l("change", n.control.value - 1 + u), n.control.min !== void 0 && n.control.value < n.control.min && l("change", n.control.min), n.control.max !== void 0 && n.control.value > n.control.max && l("change", n.control.max), r.value = i;
|
|
253
197
|
}
|
|
254
|
-
}), (
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
value:
|
|
258
|
-
class:
|
|
198
|
+
}), (i, o) => (f(), m("div", ke, [
|
|
199
|
+
c("label", Me, k(i.label), 1),
|
|
200
|
+
c("input", {
|
|
201
|
+
value: i.control.value,
|
|
202
|
+
class: S(["p-2 w-1/3 rounded text-right text-xs text-gray-400 bg-gray-100 focus:border-gray-200 outline-none border-none font-sans", { "cursor-ew-resize": a.value }]),
|
|
259
203
|
type: "number",
|
|
260
|
-
min:
|
|
261
|
-
max:
|
|
262
|
-
step:
|
|
263
|
-
onInput:
|
|
264
|
-
onMousedown:
|
|
265
|
-
onMouseup:
|
|
266
|
-
}, null, 42,
|
|
204
|
+
min: i.control.min,
|
|
205
|
+
max: i.control.max,
|
|
206
|
+
step: i.control.step,
|
|
207
|
+
onInput: t,
|
|
208
|
+
onMousedown: p,
|
|
209
|
+
onMouseup: d
|
|
210
|
+
}, null, 42, Te)
|
|
267
211
|
]));
|
|
268
212
|
}
|
|
269
|
-
}),
|
|
213
|
+
}), Se = { class: "flex px-4 justify-between gap-4 items-center mb-2 min-h-32px" }, Ae = { class: "text-gray-500 w-1/3" }, De = ["value"], Ee = /* @__PURE__ */ M({
|
|
270
214
|
__name: "TextControl",
|
|
271
215
|
props: {
|
|
272
216
|
label: {},
|
|
273
217
|
control: {}
|
|
274
218
|
},
|
|
275
219
|
emits: ["change"],
|
|
276
|
-
setup(
|
|
277
|
-
function
|
|
278
|
-
|
|
220
|
+
setup(e, { emit: l }) {
|
|
221
|
+
function n(t) {
|
|
222
|
+
const { target: s } = t;
|
|
223
|
+
l("change", s.value);
|
|
279
224
|
}
|
|
280
|
-
return (
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
value:
|
|
284
|
-
type: "
|
|
225
|
+
return (t, s) => (f(), m("div", Se, [
|
|
226
|
+
c("label", Ae, k(t.label), 1),
|
|
227
|
+
c("input", {
|
|
228
|
+
value: t.control.value,
|
|
229
|
+
type: "text",
|
|
285
230
|
class: "p-2 w-2/3 rounded text-right text-xs text-gray-400 bg-gray-100 focus:border-gray-200 outline-none border-none font-sans",
|
|
286
|
-
onChange:
|
|
287
|
-
}, null, 40,
|
|
231
|
+
onChange: n
|
|
232
|
+
}, null, 40, De)
|
|
288
233
|
]));
|
|
289
234
|
}
|
|
290
|
-
}),
|
|
235
|
+
}), Fe = { class: "flex px-4 justify-start gap-2 items-center mb-2 min-h-32px" }, Ve = { class: "text-gray-500 w-1/3" }, ze = ["id", "checked"], Oe = ["for"], Ue = { class: "i-ic:baseline-check text-light" }, Xe = /* @__PURE__ */ M({
|
|
291
236
|
__name: "BooleanControl",
|
|
292
237
|
props: {
|
|
293
238
|
label: {},
|
|
294
239
|
control: {}
|
|
295
240
|
},
|
|
296
241
|
emits: ["change"],
|
|
297
|
-
setup(
|
|
298
|
-
function
|
|
299
|
-
const { target:
|
|
300
|
-
|
|
242
|
+
setup(e, { emit: l }) {
|
|
243
|
+
function n(t) {
|
|
244
|
+
const { target: s } = t;
|
|
245
|
+
l("change", s.checked);
|
|
301
246
|
}
|
|
302
|
-
return (
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
id:
|
|
306
|
-
checked:
|
|
247
|
+
return (t, s) => (f(), m("div", Fe, [
|
|
248
|
+
c("label", Ve, k(t.label), 1),
|
|
249
|
+
c("input", {
|
|
250
|
+
id: t.control.label,
|
|
251
|
+
checked: t.control.value,
|
|
307
252
|
class: "hidden",
|
|
308
253
|
type: "checkbox",
|
|
309
|
-
onInput:
|
|
310
|
-
}, null, 40,
|
|
311
|
-
|
|
312
|
-
for:
|
|
254
|
+
onInput: n
|
|
255
|
+
}, null, 40, ze),
|
|
256
|
+
c("label", {
|
|
257
|
+
for: t.control.label,
|
|
313
258
|
class: "inline-flex items-center cursor-pointer"
|
|
314
259
|
}, [
|
|
315
|
-
|
|
316
|
-
class:
|
|
260
|
+
c("span", {
|
|
261
|
+
class: S([{ "bg-dark-500": t.control.value, "bg-gray-200": !t.control.value }, "w-4 h-4 flex justify-center items-center rounded border border-gray-300 mr-2 transition-colors duration-200"])
|
|
317
262
|
}, [
|
|
318
|
-
|
|
319
|
-
[
|
|
263
|
+
q(c("i", Ue, null, 512), [
|
|
264
|
+
[J, t.control.value]
|
|
320
265
|
])
|
|
321
266
|
], 2)
|
|
322
|
-
], 8,
|
|
267
|
+
], 8, Oe)
|
|
323
268
|
]));
|
|
324
269
|
}
|
|
325
|
-
}),
|
|
270
|
+
}), Le = { class: "px-4 relative flex justify-between gap-4 items-center mb-2" }, Pe = ["value", "min", "max", "step"], Ne = ["value", "min", "max", "step"], We = /* @__PURE__ */ M({
|
|
326
271
|
__name: "SliderControl",
|
|
327
272
|
props: {
|
|
328
273
|
label: {},
|
|
329
274
|
control: {}
|
|
330
275
|
},
|
|
331
276
|
emits: ["change"],
|
|
332
|
-
setup(
|
|
333
|
-
const
|
|
334
|
-
function
|
|
335
|
-
const { target:
|
|
336
|
-
|
|
277
|
+
setup(e, { emit: l }) {
|
|
278
|
+
const n = e;
|
|
279
|
+
function t(o) {
|
|
280
|
+
const { target: u } = o;
|
|
281
|
+
l("change", u.valueAsNumber);
|
|
337
282
|
}
|
|
338
|
-
const
|
|
339
|
-
backgroundImage: `linear-gradient(to right, #333 0% ${100 * (
|
|
340
|
-
})),
|
|
341
|
-
|
|
342
|
-
},
|
|
343
|
-
|
|
344
|
-
},
|
|
345
|
-
return
|
|
346
|
-
if (
|
|
347
|
-
const
|
|
348
|
-
|
|
283
|
+
const s = D(() => ({
|
|
284
|
+
backgroundImage: `linear-gradient(to right, #333 0% ${100 * (n.control.value - (n.control.min || 0)) / ((n.control.max || 100) - (n.control.min || 0))}%, #e2e2e2 0%)`
|
|
285
|
+
})), r = j(), a = h(0), p = h(!1), d = (o) => {
|
|
286
|
+
a.value = o.clientX, p.value = !0;
|
|
287
|
+
}, _ = () => {
|
|
288
|
+
p.value = !1;
|
|
289
|
+
}, i = (o) => Math.floor(Math.abs(o) / 10);
|
|
290
|
+
return W(r.x, (o) => {
|
|
291
|
+
if (p.value) {
|
|
292
|
+
const u = o - a.value, w = i(u);
|
|
293
|
+
u > 0 ? l("change", n.control.value + 1 + w) : u < 0 && l("change", n.control.value - 1 + w), n.control.min !== void 0 && n.control.value < n.control.min && l("change", n.control.min), n.control.max !== void 0 && n.control.value > n.control.max && l("change", n.control.max), a.value = o;
|
|
349
294
|
}
|
|
350
|
-
}), (
|
|
351
|
-
|
|
352
|
-
class:
|
|
295
|
+
}), (o, u) => (f(), m("div", Le, [
|
|
296
|
+
c("label", {
|
|
297
|
+
class: S(["text-gray-500 w-1/3", { "flex justify-between items-center": o.control.icon }])
|
|
353
298
|
}, [
|
|
354
|
-
pe(
|
|
355
|
-
|
|
356
|
-
class:
|
|
299
|
+
pe(k(o.label) + " ", 1),
|
|
300
|
+
c("i", {
|
|
301
|
+
class: S(`i-${o.control.icon}`)
|
|
357
302
|
}, null, 2)
|
|
358
303
|
], 2),
|
|
359
|
-
|
|
360
|
-
value:
|
|
304
|
+
c("input", {
|
|
305
|
+
value: o.control.value,
|
|
361
306
|
class: "w-1/2 h-0.75 bg-dark-200 rounded-full appearance-none",
|
|
362
|
-
style:
|
|
307
|
+
style: fe(s.value),
|
|
363
308
|
type: "range",
|
|
364
|
-
min:
|
|
365
|
-
max:
|
|
366
|
-
step:
|
|
367
|
-
onInput:
|
|
368
|
-
}, null, 44,
|
|
369
|
-
|
|
370
|
-
value:
|
|
371
|
-
class:
|
|
309
|
+
min: o.control.min,
|
|
310
|
+
max: o.control.max,
|
|
311
|
+
step: o.control.step,
|
|
312
|
+
onInput: t
|
|
313
|
+
}, null, 44, Pe),
|
|
314
|
+
c("input", {
|
|
315
|
+
value: o.control.value,
|
|
316
|
+
class: S(["p-2 w-1/4 rounded text-right text-xs text-gray-400 bg-gray-100 focus:border-gray-200 outline-none border-none font-sans", { "cursor-ew-resize": p.value }]),
|
|
372
317
|
type: "number",
|
|
373
|
-
min:
|
|
374
|
-
max:
|
|
375
|
-
step:
|
|
376
|
-
onInput:
|
|
377
|
-
onMousedown:
|
|
378
|
-
onMouseup:
|
|
379
|
-
}, null, 42,
|
|
318
|
+
min: o.control.min,
|
|
319
|
+
max: o.control.max,
|
|
320
|
+
step: o.control.step,
|
|
321
|
+
onInput: t,
|
|
322
|
+
onMousedown: d,
|
|
323
|
+
onMouseup: _
|
|
324
|
+
}, null, 42, Ne)
|
|
380
325
|
]));
|
|
381
326
|
}
|
|
382
327
|
});
|
|
383
|
-
const
|
|
384
|
-
const
|
|
385
|
-
for (const [
|
|
386
|
-
|
|
387
|
-
return
|
|
388
|
-
},
|
|
328
|
+
const Be = (e, l) => {
|
|
329
|
+
const n = e.__vccOpts || e;
|
|
330
|
+
for (const [t, s] of l)
|
|
331
|
+
n[t] = s;
|
|
332
|
+
return n;
|
|
333
|
+
}, Ke = /* @__PURE__ */ Be(We, [["__scopeId", "data-v-9e6267fe"]]), Re = { class: "flex px-4 justify-between gap-4 items-center mb-2" }, je = { class: "text-gray-500 w-1/3" }, Ye = ["value"], He = ["value"], Ge = /* @__PURE__ */ M({
|
|
389
334
|
__name: "ColorControl",
|
|
390
335
|
props: {
|
|
391
336
|
label: {},
|
|
392
337
|
control: {}
|
|
393
338
|
},
|
|
394
339
|
emits: ["change"],
|
|
395
|
-
setup(
|
|
396
|
-
function
|
|
397
|
-
const { target:
|
|
398
|
-
|
|
340
|
+
setup(e, { emit: l }) {
|
|
341
|
+
function n(t) {
|
|
342
|
+
const { target: s } = t;
|
|
343
|
+
l("change", s.value);
|
|
399
344
|
}
|
|
400
|
-
return (
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
value:
|
|
345
|
+
return (t, s) => (f(), m("div", Re, [
|
|
346
|
+
c("label", je, k(t.label), 1),
|
|
347
|
+
c("input", {
|
|
348
|
+
value: t.control.value,
|
|
404
349
|
type: "color",
|
|
405
|
-
onInput:
|
|
406
|
-
}, null, 40,
|
|
407
|
-
|
|
408
|
-
value:
|
|
350
|
+
onInput: n
|
|
351
|
+
}, null, 40, Ye),
|
|
352
|
+
c("input", {
|
|
353
|
+
value: t.control.value,
|
|
409
354
|
class: "p-2 w-2/3 rounded text-right text-xs text-gray-400 bg-gray-100 focus:border-gray-200 outline-none border-none font-sans",
|
|
410
355
|
type: "text",
|
|
411
|
-
onInput:
|
|
412
|
-
}, null, 40,
|
|
356
|
+
onInput: n
|
|
357
|
+
}, null, 40, He)
|
|
413
358
|
]));
|
|
414
359
|
}
|
|
415
360
|
});
|
|
416
|
-
function
|
|
417
|
-
if (typeof
|
|
418
|
-
return [
|
|
419
|
-
if (
|
|
420
|
-
const { x:
|
|
421
|
-
return [
|
|
361
|
+
function qe(e) {
|
|
362
|
+
if (typeof e == "number")
|
|
363
|
+
return [e, e, e];
|
|
364
|
+
if (ne(e)) {
|
|
365
|
+
const { x: l, y: n, z: t } = e;
|
|
366
|
+
return [l, n, t];
|
|
422
367
|
}
|
|
423
|
-
return
|
|
368
|
+
return e;
|
|
424
369
|
}
|
|
425
|
-
function
|
|
426
|
-
return
|
|
370
|
+
function Je(e) {
|
|
371
|
+
return e && typeof e.x == "number" && typeof e.y == "number" && typeof e.z > "u";
|
|
427
372
|
}
|
|
428
|
-
function
|
|
429
|
-
return
|
|
373
|
+
function ne(e) {
|
|
374
|
+
return e && typeof e.x == "number" && typeof e.y == "number" && typeof e.z == "number";
|
|
430
375
|
}
|
|
431
|
-
const
|
|
376
|
+
const Qe = { class: "flex px-4 justify-between gap-1 items-center mb-2" }, Ze = { class: "text-gray-500 w-1/3" }, et = { class: "w-2/3 flex justify-between gap-0.5" }, tt = {
|
|
432
377
|
key: 0,
|
|
433
|
-
class: "font-bold px-
|
|
434
|
-
},
|
|
378
|
+
class: "font-bold px-1 py-1 text-0.65rem text-gray-300"
|
|
379
|
+
}, nt = ["value", "onInput", "onMousedown", "onMouseup"], ot = /* @__PURE__ */ M({
|
|
435
380
|
__name: "VectorControl",
|
|
436
381
|
props: {
|
|
437
382
|
label: {},
|
|
438
383
|
control: {}
|
|
439
384
|
},
|
|
440
385
|
emits: ["change"],
|
|
441
|
-
setup(
|
|
442
|
-
const
|
|
443
|
-
|
|
444
|
-
},
|
|
445
|
-
|
|
446
|
-
},
|
|
447
|
-
function
|
|
448
|
-
const { value:
|
|
449
|
-
|
|
386
|
+
setup(e, { emit: l }) {
|
|
387
|
+
const n = e, t = j(), s = h(0), r = h(!1), a = h(0), p = (v, b) => {
|
|
388
|
+
a.value = b, s.value = v.clientX, r.value = !0;
|
|
389
|
+
}, d = (v, b) => {
|
|
390
|
+
a.value = b, r.value = !1;
|
|
391
|
+
}, _ = (v) => Math.floor(Math.abs(v) / 10), i = D(() => qe(n.control.value)), o = h(["x", "y", "z"]), u = D(() => Je(n.control.value) || ne(n.control.value));
|
|
392
|
+
function w(v, b) {
|
|
393
|
+
const { value: x } = n.control, { target: g } = v;
|
|
394
|
+
a.value = b, x[u.value ? o.value[a.value] : a.value] = parseInt(g.value, 10), l("change", x);
|
|
450
395
|
}
|
|
451
|
-
return
|
|
452
|
-
if (
|
|
453
|
-
const
|
|
454
|
-
|
|
396
|
+
return W(t.x, (v) => {
|
|
397
|
+
if (r.value) {
|
|
398
|
+
const b = v - s.value, x = _(b), { value: g } = n.control, $ = u.value ? o.value[a.value] : a.value;
|
|
399
|
+
b > 0 ? g[$] += 0.1 + x : b < 0 && (g[$] -= 0.1 + x), n.control.min !== void 0 && g < n.control.min && (g[$] = n.control.min), n.control.max !== void 0 && g > n.control.max && (g[$] = n.control.max), l("change", g), s.value = v;
|
|
455
400
|
}
|
|
456
|
-
}), (
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
(f(!0),
|
|
460
|
-
key:
|
|
401
|
+
}), (v, b) => (f(), m("div", Qe, [
|
|
402
|
+
c("label", Ze, k(v.label), 1),
|
|
403
|
+
c("div", et, [
|
|
404
|
+
(f(!0), m(A, null, X(i.value, (x, g) => (f(), m("div", {
|
|
405
|
+
key: v.label + g,
|
|
461
406
|
class: "flex items-center w-1/3 bg-gray-100 rounded"
|
|
462
407
|
}, [
|
|
463
|
-
|
|
464
|
-
|
|
408
|
+
o.value[g] && u.value ? (f(), m("span", tt, k(o.value[g]), 1)) : N("", !0),
|
|
409
|
+
c("input", {
|
|
465
410
|
type: "text",
|
|
466
|
-
class:
|
|
467
|
-
value:
|
|
468
|
-
onInput: (
|
|
469
|
-
onMousedown: (
|
|
470
|
-
onMouseup: (
|
|
471
|
-
}, null, 42,
|
|
411
|
+
class: S(["w-full pl-0 p-1 text-right text-0.65rem text-gray-400 bg-transparent focus:border-gray-200 outline-none border-none font-sans", { "cursor-ew-resize": r.value }]),
|
|
412
|
+
value: i.value[g].toFixed(2),
|
|
413
|
+
onInput: ($) => w($, g),
|
|
414
|
+
onMousedown: ($) => p($, g),
|
|
415
|
+
onMouseup: ($) => d($, g)
|
|
416
|
+
}, null, 42, nt)
|
|
472
417
|
]))), 128))
|
|
473
418
|
])
|
|
474
419
|
]));
|
|
475
420
|
}
|
|
476
|
-
}),
|
|
477
|
-
__name: "Folder",
|
|
478
|
-
props: {
|
|
479
|
-
control: {}
|
|
480
|
-
},
|
|
481
|
-
setup(t) {
|
|
482
|
-
function o(l, a) {
|
|
483
|
-
a.value = l;
|
|
484
|
-
}
|
|
485
|
-
const e = g(!1), n = () => {
|
|
486
|
-
e.value = !e.value;
|
|
487
|
-
};
|
|
488
|
-
return (l, a) => (f(), d("div", mt, [
|
|
489
|
-
u("button", {
|
|
490
|
-
class: "flex items-center justify-between w-full p-4 bg-gray-100 border-none text-gray-400 font-bold text-xs focus:outline-none font-sans cursor-pointer",
|
|
491
|
-
onClick: n
|
|
492
|
-
}, [
|
|
493
|
-
u("span", null, m(l.control.label), 1),
|
|
494
|
-
u("i", {
|
|
495
|
-
class: M(e.value ? "i-ic:baseline-keyboard-arrow-up" : "i-ic:baseline-keyboard-arrow-down")
|
|
496
|
-
}, null, 2)
|
|
497
|
-
]),
|
|
498
|
-
de(be, {
|
|
499
|
-
name: "slide",
|
|
500
|
-
"enter-active-class": " animate-fade-in animate-duration-200 animate-ease-in-out",
|
|
501
|
-
"leave-active-class": " animate-fade-out animate-duration-200 animate-ease-in-out"
|
|
502
|
-
}, {
|
|
503
|
-
default: Q(() => [
|
|
504
|
-
G(u("div", wt, [
|
|
505
|
-
(f(!0), d(E, null, A(l.control.controls, (s) => (f(), _(te, {
|
|
506
|
-
key: s.label,
|
|
507
|
-
control: s,
|
|
508
|
-
onChange: (i) => o(i, s)
|
|
509
|
-
}, null, 8, ["control", "onChange"]))), 128))
|
|
510
|
-
], 512), [
|
|
511
|
-
[q, e.value]
|
|
512
|
-
])
|
|
513
|
-
]),
|
|
514
|
-
_: 1
|
|
515
|
-
})
|
|
516
|
-
]));
|
|
517
|
-
}
|
|
518
|
-
}), $t = { class: "flex px-4 justify-between gap-4 items-center mb-2" }, kt = { class: "text-gray-500 w-1/3" }, Ct = { class: "relative w-2/3 p-1 rounded text-right text-xs text-gray-400 bg-gray-100 focus:border-gray-200 outline-none border-none font-sans" }, Mt = { class: "absolute bottom-0.5 right-0.5 font-sans text-xs" }, St = ["points"], B = 160, z = 40, j = 2, K = 100, Y = 20, It = /* @__PURE__ */ w({
|
|
421
|
+
}), lt = { class: "flex px-4 justify-between gap-4 items-center mb-2" }, st = { class: "text-gray-500 w-1/3" }, rt = { class: "relative w-2/3 p-1 rounded text-right text-xs text-gray-400 bg-gray-100 focus:border-gray-200 outline-none border-none font-sans" }, at = { class: "absolute bottom-0.5 right-0.5 font-sans text-xs" }, ct = ["points"], Y = 160, R = 40, O = 2, H = 100, G = 20, it = /* @__PURE__ */ M({
|
|
519
422
|
__name: "FPSGraph",
|
|
520
423
|
props: {
|
|
521
424
|
label: {},
|
|
522
425
|
control: {}
|
|
523
426
|
},
|
|
524
|
-
setup(
|
|
525
|
-
const
|
|
526
|
-
let
|
|
527
|
-
return
|
|
528
|
-
|
|
529
|
-
(
|
|
427
|
+
setup(e) {
|
|
428
|
+
const l = ye({ every: H }), n = h(""), t = h([]), s = h(Y / O);
|
|
429
|
+
let r = performance.now();
|
|
430
|
+
return be(({ timestamp: a }) => {
|
|
431
|
+
a - r >= H && (r = a, t.value.push(l.value), t.value.length > s.value && t.value.shift(), n.value = t.value.map(
|
|
432
|
+
(p, d) => `${d * O},${R + G - O / 2 - p * (R + G - O) / 120}`
|
|
530
433
|
).join(" "));
|
|
531
|
-
}), (
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
(f(),
|
|
536
|
-
width:
|
|
537
|
-
height:
|
|
434
|
+
}), (a, p) => (f(), m("div", lt, [
|
|
435
|
+
c("label", st, k(a.label), 1),
|
|
436
|
+
c("div", rt, [
|
|
437
|
+
c("div", at, k(Math.round(T(l))) + " FPS ", 1),
|
|
438
|
+
(f(), m("svg", {
|
|
439
|
+
width: Y,
|
|
440
|
+
height: R,
|
|
538
441
|
xmlns: "http://www.w3.org/2000/svg",
|
|
539
442
|
class: "bg-gray-100"
|
|
540
443
|
}, [
|
|
541
|
-
|
|
542
|
-
points:
|
|
444
|
+
c("polyline", {
|
|
445
|
+
points: n.value,
|
|
543
446
|
fill: "none",
|
|
544
447
|
stroke: "lightgray",
|
|
545
|
-
"stroke-width":
|
|
448
|
+
"stroke-width": O,
|
|
546
449
|
"stroke-linecap": "round",
|
|
547
450
|
"stroke-linejoin": "round"
|
|
548
|
-
}, null, 8,
|
|
451
|
+
}, null, 8, ct)
|
|
549
452
|
]))
|
|
550
453
|
])
|
|
551
454
|
]));
|
|
552
455
|
}
|
|
553
|
-
}),
|
|
456
|
+
}), ut = { class: "flex px-4 justify-between gap-4 items-center mb-2 min-h-32px" }, pt = { class: "text-gray-500 w-1/3" }, ft = ["value"], dt = ["value"], vt = /* @__PURE__ */ M({
|
|
554
457
|
__name: "SelectControl",
|
|
555
458
|
props: {
|
|
556
459
|
label: {},
|
|
557
460
|
control: {}
|
|
558
461
|
},
|
|
559
462
|
emits: ["change"],
|
|
560
|
-
setup(
|
|
561
|
-
function
|
|
562
|
-
|
|
463
|
+
setup(e, { emit: l }) {
|
|
464
|
+
function n(t) {
|
|
465
|
+
l("change", t.target.value);
|
|
563
466
|
}
|
|
564
|
-
return (
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
value:
|
|
467
|
+
return (t, s) => (f(), m("div", ut, [
|
|
468
|
+
c("label", pt, k(t.label), 1),
|
|
469
|
+
c("select", {
|
|
470
|
+
value: t.control.value,
|
|
568
471
|
class: "p-2 w-2/3 rounded text-left text-xs text-gray-400 bg-gray-100 focus:border-gray-200 outline-none border-none font-sans",
|
|
569
|
-
onChange:
|
|
472
|
+
onChange: n
|
|
570
473
|
}, [
|
|
571
|
-
(f(!0),
|
|
572
|
-
key:
|
|
573
|
-
value:
|
|
574
|
-
},
|
|
575
|
-
], 40,
|
|
474
|
+
(f(!0), m(A, null, X(t.control.options, (r) => (f(), m("option", {
|
|
475
|
+
key: r.value,
|
|
476
|
+
value: r.value
|
|
477
|
+
}, k(r.text), 9, dt))), 128))
|
|
478
|
+
], 40, ft)
|
|
576
479
|
]));
|
|
577
480
|
}
|
|
578
|
-
}),
|
|
481
|
+
}), oe = /* @__PURE__ */ M({
|
|
579
482
|
__name: "ControlInput",
|
|
580
483
|
props: {
|
|
581
484
|
control: {}
|
|
582
485
|
},
|
|
583
486
|
emits: ["change"],
|
|
584
|
-
setup(
|
|
585
|
-
function
|
|
586
|
-
|
|
487
|
+
setup(e, { emit: l }) {
|
|
488
|
+
function n(t) {
|
|
489
|
+
l("change", t);
|
|
587
490
|
}
|
|
588
|
-
return (
|
|
589
|
-
|
|
491
|
+
return (t, s) => t.control.visible ? (f(), m(A, { key: 0 }, [
|
|
492
|
+
t.control.type === "color" ? (f(), C(Ge, {
|
|
590
493
|
key: 0,
|
|
591
|
-
label:
|
|
592
|
-
control:
|
|
593
|
-
onChange:
|
|
594
|
-
}, null, 8, ["label", "control"])) :
|
|
494
|
+
label: t.control.label,
|
|
495
|
+
control: t.control,
|
|
496
|
+
onChange: n
|
|
497
|
+
}, null, 8, ["label", "control"])) : t.control.type === "select" ? (f(), C(vt, {
|
|
595
498
|
key: 1,
|
|
596
|
-
label:
|
|
597
|
-
control:
|
|
598
|
-
onChange:
|
|
599
|
-
}, null, 8, ["label", "control"])) :
|
|
499
|
+
label: t.control.label,
|
|
500
|
+
control: t.control,
|
|
501
|
+
onChange: n
|
|
502
|
+
}, null, 8, ["label", "control"])) : t.control.type === "vector" ? (f(), C(ot, {
|
|
600
503
|
key: 2,
|
|
601
|
-
label:
|
|
602
|
-
control:
|
|
603
|
-
onChange:
|
|
604
|
-
}, null, 8, ["label", "control"])) :
|
|
504
|
+
label: t.control.label,
|
|
505
|
+
control: t.control,
|
|
506
|
+
onChange: n
|
|
507
|
+
}, null, 8, ["label", "control"])) : t.control.type === "boolean" ? (f(), C(Xe, {
|
|
605
508
|
key: 3,
|
|
606
|
-
label:
|
|
607
|
-
control:
|
|
608
|
-
|
|
509
|
+
label: t.control.label,
|
|
510
|
+
control: t.control,
|
|
511
|
+
onChange: n
|
|
512
|
+
}, null, 8, ["label", "control"])) : t.control.type === "fpsgraph" ? (f(), C(it, {
|
|
609
513
|
key: 4,
|
|
610
|
-
label:
|
|
611
|
-
control:
|
|
612
|
-
}, null, 8, ["label", "control"])) :
|
|
514
|
+
label: t.control.label,
|
|
515
|
+
control: t.control
|
|
516
|
+
}, null, 8, ["label", "control"])) : t.control.type === "number" ? (f(), C(Ie, {
|
|
613
517
|
key: 5,
|
|
614
|
-
label:
|
|
615
|
-
control:
|
|
616
|
-
onChange:
|
|
617
|
-
}, null, 8, ["label", "control"])) :
|
|
518
|
+
label: t.control.label,
|
|
519
|
+
control: t.control,
|
|
520
|
+
onChange: n
|
|
521
|
+
}, null, 8, ["label", "control"])) : t.control.type === "range" ? (f(), C(Ke, {
|
|
618
522
|
key: 6,
|
|
619
|
-
label:
|
|
620
|
-
control:
|
|
621
|
-
onChange:
|
|
622
|
-
}, null, 8, ["label", "control"])) :
|
|
523
|
+
label: t.control.label,
|
|
524
|
+
control: t.control,
|
|
525
|
+
onChange: n
|
|
526
|
+
}, null, 8, ["label", "control"])) : (f(), C(Ee, {
|
|
623
527
|
key: 7,
|
|
624
|
-
label:
|
|
625
|
-
control:
|
|
626
|
-
onChange:
|
|
627
|
-
}, null, 8, ["label", "control"])) : (f(), _(Je, {
|
|
628
|
-
key: 8,
|
|
629
|
-
label: n.control.label,
|
|
630
|
-
control: n.control,
|
|
631
|
-
onChange: e
|
|
528
|
+
label: t.control.label,
|
|
529
|
+
control: t.control,
|
|
530
|
+
onChange: n
|
|
632
531
|
}, null, 8, ["label", "control"]))
|
|
633
|
-
], 64)) :
|
|
532
|
+
], 64)) : N("", !0);
|
|
533
|
+
}
|
|
534
|
+
}), gt = { class: "mb-4" }, ht = { class: "bg-white rounded-b pt-4" }, yt = /* @__PURE__ */ M({
|
|
535
|
+
__name: "Folder",
|
|
536
|
+
props: {
|
|
537
|
+
controls: {},
|
|
538
|
+
label: {}
|
|
539
|
+
},
|
|
540
|
+
setup(e) {
|
|
541
|
+
function l(s, r) {
|
|
542
|
+
r.value = s;
|
|
543
|
+
}
|
|
544
|
+
const n = h(!1), t = () => {
|
|
545
|
+
n.value = !n.value;
|
|
546
|
+
};
|
|
547
|
+
return (s, r) => (f(), m("div", gt, [
|
|
548
|
+
c("button", {
|
|
549
|
+
class: "flex items-center justify-between w-full py-2 px-4 bg-gray-100 border-none text-gray-400 font-bold text-xs focus:outline-none font-sans cursor-pointer",
|
|
550
|
+
onClick: t
|
|
551
|
+
}, [
|
|
552
|
+
c("span", null, k(s.label), 1),
|
|
553
|
+
c("i", {
|
|
554
|
+
class: S(n.value ? "i-ic:baseline-keyboard-arrow-up" : "i-ic:baseline-keyboard-arrow-down")
|
|
555
|
+
}, null, 2)
|
|
556
|
+
]),
|
|
557
|
+
de(ve, {
|
|
558
|
+
name: "slide",
|
|
559
|
+
"enter-active-class": " animate-fade-in animate-duration-200 animate-ease-in-out",
|
|
560
|
+
"leave-active-class": " animate-fade-out animate-duration-200 animate-ease-in-out"
|
|
561
|
+
}, {
|
|
562
|
+
default: Q(() => [
|
|
563
|
+
q(c("div", ht, [
|
|
564
|
+
(f(!0), m(A, null, X(s.controls, (a) => (f(), C(oe, {
|
|
565
|
+
key: a.label,
|
|
566
|
+
control: a,
|
|
567
|
+
onChange: (p) => l(p, a)
|
|
568
|
+
}, null, 8, ["control", "onChange"]))), 128))
|
|
569
|
+
], 512), [
|
|
570
|
+
[J, n.value]
|
|
571
|
+
])
|
|
572
|
+
]),
|
|
573
|
+
_: 1
|
|
574
|
+
})
|
|
575
|
+
]));
|
|
634
576
|
}
|
|
635
|
-
}),
|
|
636
|
-
/* @__PURE__ */
|
|
637
|
-
/* @__PURE__ */
|
|
638
|
-
/* @__PURE__ */
|
|
639
|
-
], -1),
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
],
|
|
577
|
+
}), bt = { class: "bg-white shadow-xl rounded border-4 border-solid border-black" }, mt = /* @__PURE__ */ c("i", { class: "h-4 w-4 p-1.5 flex items-center line-height-0 rounded-full bg-gray-100 text-xs" }, "🍰", -1), _t = /* @__PURE__ */ c("div", null, [
|
|
578
|
+
/* @__PURE__ */ c("i", { class: "i-ic-baseline-drag-indicator" }),
|
|
579
|
+
/* @__PURE__ */ c("i", { class: "i-ic-baseline-drag-indicator" }),
|
|
580
|
+
/* @__PURE__ */ c("i", { class: "i-ic-baseline-drag-indicator" })
|
|
581
|
+
], -1), xt = /* @__PURE__ */ c("div", null, null, -1), wt = [
|
|
582
|
+
mt,
|
|
583
|
+
_t,
|
|
584
|
+
xt
|
|
585
|
+
], $t = 280, Tt = /* @__PURE__ */ M({
|
|
644
586
|
__name: "TresLeches",
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
587
|
+
props: {
|
|
588
|
+
uuid: {}
|
|
589
|
+
},
|
|
590
|
+
setup(e) {
|
|
591
|
+
const l = e, { uuid: n } = E(l), { width: t } = Z(), s = h(null), r = Ce(n == null ? void 0 : n.value);
|
|
592
|
+
function a(d, _) {
|
|
593
|
+
r[T(d)].value = _, r[T(d)][T(d)] = _;
|
|
649
594
|
}
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
595
|
+
const p = D(() => {
|
|
596
|
+
const d = {};
|
|
597
|
+
for (const _ in r) {
|
|
598
|
+
const i = r[_], o = i.folder || "default";
|
|
599
|
+
d[o] || (d[o] = []), d[o].push(i);
|
|
600
|
+
}
|
|
601
|
+
return d;
|
|
602
|
+
});
|
|
603
|
+
return (d, _) => (f(), C(T(we), {
|
|
604
|
+
id: T(n),
|
|
605
|
+
"initial-value": { x: T(t) - $t - 40, y: 10 },
|
|
606
|
+
class: S(["absolute select-none z-24 w-280px font-sans text-xs", d.$attrs.class]),
|
|
607
|
+
handle: s.value
|
|
654
608
|
}, {
|
|
655
609
|
default: Q(() => [
|
|
656
|
-
|
|
657
|
-
|
|
610
|
+
c("div", bt, [
|
|
611
|
+
c("header", {
|
|
658
612
|
ref_key: "handle",
|
|
659
|
-
ref:
|
|
613
|
+
ref: s,
|
|
660
614
|
class: "relative cursor-grabbing p-4 flex justify-between text-gray-200 relative"
|
|
661
|
-
},
|
|
662
|
-
(f(!0),
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
615
|
+
}, wt, 512),
|
|
616
|
+
(f(!0), m(A, null, X(p.value, (i, o) => (f(), m(A, { key: o }, [
|
|
617
|
+
o !== "default" ? (f(), C(yt, {
|
|
618
|
+
key: 0,
|
|
619
|
+
label: o,
|
|
620
|
+
controls: i
|
|
621
|
+
}, null, 8, ["label", "controls"])) : N("", !0),
|
|
622
|
+
o === "default" ? (f(!0), m(A, { key: 1 }, X(i, (u) => (f(), C(oe, {
|
|
623
|
+
key: u.label,
|
|
624
|
+
control: u,
|
|
625
|
+
onChange: (w) => a(u.label, w)
|
|
626
|
+
}, null, 8, ["control", "onChange"]))), 128)) : N("", !0)
|
|
627
|
+
], 64))), 128))
|
|
667
628
|
])
|
|
668
629
|
]),
|
|
669
630
|
_: 1
|
|
670
|
-
}, 8, ["initial-value", "class", "handle"]));
|
|
631
|
+
}, 8, ["id", "initial-value", "class", "handle"]));
|
|
671
632
|
}
|
|
672
633
|
});
|
|
673
634
|
export {
|
|
674
|
-
|
|
675
|
-
|
|
635
|
+
Tt as TresLeches,
|
|
636
|
+
Mt as useControls,
|
|
637
|
+
Ce as useControlsProvider
|
|
676
638
|
};
|