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