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