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