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