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