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