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