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