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