vuesp-components 5.2.1 → 5.2.2
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/CHANGELOG.md +23 -0
- package/README.md +1 -0
- package/dist/{VDialog.vue_vue_type_script_setup_true_lang-CvNEU_qY.js → VDialog.vue_vue_type_script_setup_true_lang-Bh-tnwGM.js} +1 -1
- package/dist/components/dashboard/cards/CardDimmer.vue.d.ts.map +1 -1
- package/dist/components/dashboard/cards/CardPalette.vue.d.ts +48 -0
- package/dist/components/dashboard/cards/CardPalette.vue.d.ts.map +1 -0
- package/dist/components/dashboard/index.d.ts +2 -1
- package/dist/components/dashboard/index.d.ts.map +1 -1
- package/dist/components/index.es.js +1055 -956
- package/dist/components/script/editor/suggestions.d.ts.map +1 -1
- package/dist/index.es.js +1 -1
- package/dist/pages/kit/KitShowcase.vue.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineComponent as O, resolveComponent as lt, openBlock as f, createElementBlock as g, Fragment as
|
|
2
|
-
import { a as ya, V as Ht, i as R, j as V, g as Gt, f as
|
|
3
|
-
import { I as
|
|
1
|
+
import { defineComponent as O, resolveComponent as lt, openBlock as f, createElementBlock as g, Fragment as D, createCommentVNode as T, createElementVNode as n, normalizeClass as B, createVNode as p, withCtx as x, createBlock as M, renderSlot as I, computed as S, withModifiers as Q, toDisplayString as C, unref as J, TransitionGroup as Kt, renderList as U, mergeProps as Y, ref as F, watch as ye, reactive as xt, onMounted as be, onUnmounted as Pe, resolveDynamicComponent as Be, Transition as kt, normalizeStyle as Ve, createTextVNode as L, normalizeProps as se, guardReactiveProps as ne, withDirectives as it, vShow as fa, vModelText as $t, nextTick as wt, toValue as ga, useTemplateRef as Wt, createSlots as va, isRef as pa, Teleport as ha } from "vue";
|
|
2
|
+
import { a as ya, V as Ht, i as R, j as V, g as Gt, f as Ct, k as St, b as ba, h as xa, d as he, u as ka, _ as ze, e as ie } from "../VDialog.vue_vue_type_script_setup_true_lang-Bh-tnwGM.js";
|
|
3
|
+
import { I as Kd, l as Wd, m as Hd } from "../VDialog.vue_vue_type_script_setup_true_lang-Bh-tnwGM.js";
|
|
4
4
|
import { f as $a, t as wa, g as Ca, u as tt, s as Sa, d as _a, m as Ta, c as za } from "../app-3Zj29UoC.js";
|
|
5
|
-
import { e as
|
|
5
|
+
import { e as rt, f as Aa, g as Ea, o as Ba } from "../useDialog-Buvn63AR.js";
|
|
6
6
|
import { useForm as Va } from "../composables/index.es.js";
|
|
7
7
|
import { required as Ia, maxLen as La } from "../validate/index.es.js";
|
|
8
8
|
import { a as Ma } from "../paths-D9y4c97_.js";
|
|
9
|
-
const Oa = { class: "no-scrollbar flex flex-col overflow-y-auto duration-300 ease-linear h-full" },
|
|
9
|
+
const Oa = { class: "no-scrollbar flex flex-col overflow-y-auto duration-300 ease-linear h-full" }, ld = /* @__PURE__ */ O({
|
|
10
10
|
__name: "AppAside",
|
|
11
11
|
props: {
|
|
12
12
|
isSidebar: { type: Boolean, default: !1 }
|
|
@@ -18,7 +18,7 @@ const Oa = { class: "no-scrollbar flex flex-col overflow-y-auto duration-300 eas
|
|
|
18
18
|
};
|
|
19
19
|
return (t, o) => {
|
|
20
20
|
const i = lt("router-link");
|
|
21
|
-
return f(), g(
|
|
21
|
+
return f(), g(D, null, [
|
|
22
22
|
e.isSidebar ? (f(), g("div", {
|
|
23
23
|
key: 0,
|
|
24
24
|
class: "lg:hidden overlay fixed left-0 top-0 h-full w-full bg-black/40 z-10 bg-blur",
|
|
@@ -30,8 +30,8 @@ const Oa = { class: "no-scrollbar flex flex-col overflow-y-auto duration-300 eas
|
|
|
30
30
|
n("div", {
|
|
31
31
|
class: B([e.isSidebar ? "justify-center" : "justify-between", "sidebar-header flex items-center gap-2 border-b border-gray-light-10/60 pt-6 pb-6 justify-between dark:border-white/5"])
|
|
32
32
|
}, [
|
|
33
|
-
|
|
34
|
-
default:
|
|
33
|
+
p(i, { to: "/" }, {
|
|
34
|
+
default: x(() => [
|
|
35
35
|
e.isSidebar ? (f(), M(ya, {
|
|
36
36
|
key: 0,
|
|
37
37
|
class: "h-7 text-cyan-main"
|
|
@@ -50,7 +50,7 @@ const Oa = { class: "no-scrollbar flex flex-col overflow-y-auto duration-300 eas
|
|
|
50
50
|
], 64);
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
|
-
}), Fa = { class: "glass-header relative sticky top-0 left-0 z-10 w-full border-b shadow-card" },
|
|
53
|
+
}), Fa = { class: "glass-header relative sticky top-0 left-0 z-10 w-full border-b shadow-card" }, Da = { class: "py-4" }, ja = { class: "container mx-auto flex flex-auto items-center" }, Na = { class: "lg:hidden h-7" }, Pa = { class: "gap-4 hidden items-center lg:flex" }, Ra = { class: "lg:hidden flex gap-4" }, Ua = { class: "ms-2" }, od = /* @__PURE__ */ O({
|
|
54
54
|
__name: "AppHeader",
|
|
55
55
|
props: {
|
|
56
56
|
changeTheme: { type: Function },
|
|
@@ -69,17 +69,17 @@ const Oa = { class: "no-scrollbar flex flex-col overflow-y-auto duration-300 eas
|
|
|
69
69
|
c == 1 && m(), c == 2 && i(u), c == 3 && d();
|
|
70
70
|
};
|
|
71
71
|
return (c, u) => {
|
|
72
|
-
const
|
|
72
|
+
const h = lt("router-link");
|
|
73
73
|
return f(), g("header", Fa, [
|
|
74
74
|
u[3] || (u[3] = n("div", { class: "pointer-events-none absolute inset-x-0 top-0 h-px bg-gradient-to-r from-transparent via-white/35 to-transparent" }, null, -1)),
|
|
75
|
-
n("div",
|
|
76
|
-
n("div",
|
|
77
|
-
|
|
75
|
+
n("div", Da, [
|
|
76
|
+
n("div", ja, [
|
|
77
|
+
p(R, {
|
|
78
78
|
type: "icon",
|
|
79
79
|
onClick: o
|
|
80
80
|
}, {
|
|
81
|
-
default:
|
|
82
|
-
|
|
81
|
+
default: x(() => [
|
|
82
|
+
p(V, {
|
|
83
83
|
name: "menu",
|
|
84
84
|
class: "size-5"
|
|
85
85
|
})
|
|
@@ -88,9 +88,9 @@ const Oa = { class: "no-scrollbar flex flex-col overflow-y-auto duration-300 eas
|
|
|
88
88
|
}),
|
|
89
89
|
u[1] || (u[1] = n("div", { class: "lg:hidden flex-auto" }, null, -1)),
|
|
90
90
|
n("div", Na, [
|
|
91
|
-
|
|
92
|
-
default:
|
|
93
|
-
|
|
91
|
+
p(h, { to: "/" }, {
|
|
92
|
+
default: x(() => [
|
|
93
|
+
p(Ht, { class: "h-7 text-cyan-main" })
|
|
94
94
|
]),
|
|
95
95
|
_: 1
|
|
96
96
|
})
|
|
@@ -99,33 +99,33 @@ const Oa = { class: "no-scrollbar flex flex-col overflow-y-auto duration-300 eas
|
|
|
99
99
|
u[2] || (u[2] = n("div", { class: "flex-auto" }, null, -1)),
|
|
100
100
|
n("div", Pa, [
|
|
101
101
|
I(c.$slots, "actions"),
|
|
102
|
-
|
|
102
|
+
p(R, {
|
|
103
103
|
type: "icon",
|
|
104
104
|
onClick: m
|
|
105
105
|
}, {
|
|
106
|
-
default:
|
|
107
|
-
|
|
106
|
+
default: x(() => [
|
|
107
|
+
p(V, {
|
|
108
108
|
name: "sun",
|
|
109
109
|
class: "size-5 dark:hidden"
|
|
110
110
|
}),
|
|
111
|
-
|
|
111
|
+
p(V, {
|
|
112
112
|
name: "moon",
|
|
113
113
|
class: "hidden size-5 dark:flex"
|
|
114
114
|
})
|
|
115
115
|
]),
|
|
116
116
|
_: 1
|
|
117
117
|
}),
|
|
118
|
-
|
|
118
|
+
p(R, {
|
|
119
119
|
type: "icon",
|
|
120
120
|
onClick: i
|
|
121
121
|
}, {
|
|
122
|
-
default:
|
|
122
|
+
default: x(() => [
|
|
123
123
|
n("span", {
|
|
124
124
|
class: B([t.value ? "flex" : "hidden", "absolute right-0 top-0.5 z-1 h-2 w-2 rounded-full bg-orange-400"])
|
|
125
125
|
}, [...u[0] || (u[0] = [
|
|
126
126
|
n("span", { class: "absolute -z-1 inline-flex h-full w-full animate-ping rounded-full bg-orange-400 opacity-75" }, null, -1)
|
|
127
127
|
])], 2),
|
|
128
|
-
|
|
128
|
+
p(V, {
|
|
129
129
|
name: "noti",
|
|
130
130
|
class: "size-5"
|
|
131
131
|
})
|
|
@@ -136,10 +136,10 @@ const Oa = { class: "no-scrollbar flex flex-col overflow-y-auto duration-300 eas
|
|
|
136
136
|
e.showLogout ? (f(), M(R, {
|
|
137
137
|
key: 0,
|
|
138
138
|
type: "icon",
|
|
139
|
-
onClick:
|
|
139
|
+
onClick: Q(d, ["prevent"])
|
|
140
140
|
}, {
|
|
141
|
-
default:
|
|
142
|
-
|
|
141
|
+
default: x(() => [
|
|
142
|
+
p(V, {
|
|
143
143
|
name: "logout",
|
|
144
144
|
class: "size-5"
|
|
145
145
|
})
|
|
@@ -149,19 +149,19 @@ const Oa = { class: "no-scrollbar flex flex-col overflow-y-auto duration-300 eas
|
|
|
149
149
|
])
|
|
150
150
|
]),
|
|
151
151
|
n("div", Ra, [
|
|
152
|
-
|
|
152
|
+
p(Gt, {
|
|
153
153
|
left: "unset",
|
|
154
154
|
right: "0",
|
|
155
155
|
top: "0"
|
|
156
156
|
}, {
|
|
157
|
-
activator:
|
|
158
|
-
|
|
157
|
+
activator: x(({ on: k }) => [
|
|
158
|
+
p(R, {
|
|
159
159
|
type: "icon",
|
|
160
160
|
class: "flex",
|
|
161
161
|
onClick: k.click
|
|
162
162
|
}, {
|
|
163
|
-
default:
|
|
164
|
-
|
|
163
|
+
default: x(() => [
|
|
164
|
+
p(V, {
|
|
165
165
|
name: "more",
|
|
166
166
|
class: "size-5"
|
|
167
167
|
})
|
|
@@ -169,12 +169,12 @@ const Oa = { class: "no-scrollbar flex flex-col overflow-y-auto duration-300 eas
|
|
|
169
169
|
_: 1
|
|
170
170
|
}, 8, ["onClick"])
|
|
171
171
|
]),
|
|
172
|
-
default:
|
|
173
|
-
|
|
172
|
+
default: x(() => [
|
|
173
|
+
p(Ct, {
|
|
174
174
|
items: l,
|
|
175
175
|
onClick: r
|
|
176
176
|
}, {
|
|
177
|
-
default:
|
|
177
|
+
default: x(({ item: k }) => [
|
|
178
178
|
n("span", Ua, C(k.name), 1)
|
|
179
179
|
]),
|
|
180
180
|
_: 1
|
|
@@ -205,18 +205,18 @@ const Oa = { class: "no-scrollbar flex flex-col overflow-y-auto duration-300 eas
|
|
|
205
205
|
n("div", {
|
|
206
206
|
class: B(["absolute left-0 top-0 w-1 h-full", o(a.color)])
|
|
207
207
|
}, null, 2),
|
|
208
|
-
|
|
208
|
+
p(R, {
|
|
209
209
|
class: "shrink-0",
|
|
210
210
|
type: "icon",
|
|
211
211
|
onClick: d
|
|
212
212
|
}, {
|
|
213
|
-
default:
|
|
213
|
+
default: x(() => [
|
|
214
214
|
n("span", {
|
|
215
215
|
class: B([a.isNew ? "flex" : "hidden", "absolute right-0 top-0.5 z-1 h-2 w-2 rounded-full bg-orange-400"])
|
|
216
216
|
}, [...r[0] || (r[0] = [
|
|
217
217
|
n("span", { class: "absolute -z-1 inline-flex h-full w-full animate-ping rounded-full bg-orange-400 opacity-75" }, null, -1)
|
|
218
218
|
])], 2),
|
|
219
|
-
|
|
219
|
+
p(V, {
|
|
220
220
|
name: "noti",
|
|
221
221
|
class: "size-5"
|
|
222
222
|
})
|
|
@@ -227,14 +227,14 @@ const Oa = { class: "no-scrollbar flex flex-col overflow-y-auto duration-300 eas
|
|
|
227
227
|
n("div", null, C(a.text), 1),
|
|
228
228
|
n("div", Ha, C(J($a)(a.date)) + " (" + C(J(wa)(a.date)) + ")", 1)
|
|
229
229
|
]),
|
|
230
|
-
|
|
230
|
+
p(R, {
|
|
231
231
|
class: "shrink-0",
|
|
232
232
|
type: "icon",
|
|
233
233
|
size: "sm",
|
|
234
234
|
onClick: i
|
|
235
235
|
}, {
|
|
236
|
-
default:
|
|
237
|
-
|
|
236
|
+
default: x(() => [
|
|
237
|
+
p(V, {
|
|
238
238
|
name: "close",
|
|
239
239
|
class: "size-4"
|
|
240
240
|
})
|
|
@@ -246,7 +246,7 @@ const Oa = { class: "no-scrollbar flex flex-col overflow-y-auto duration-300 eas
|
|
|
246
246
|
}), Ja = { class: "no-scrollbar flex flex-col overflow-y-auto duration-300 ease-linear h-full" }, qa = {
|
|
247
247
|
key: 0,
|
|
248
248
|
class: "flex flex-col gap-2 p-2"
|
|
249
|
-
},
|
|
249
|
+
}, id = /* @__PURE__ */ O({
|
|
250
250
|
__name: "AppNotification",
|
|
251
251
|
props: {
|
|
252
252
|
value: { type: Boolean },
|
|
@@ -255,7 +255,7 @@ const Oa = { class: "no-scrollbar flex flex-col overflow-y-auto duration-300 eas
|
|
|
255
255
|
emits: ["close", "remove", "read"],
|
|
256
256
|
setup(e, { emit: s }) {
|
|
257
257
|
const a = e, l = s, t = S(() => !!a.notifications.find((r) => r.isNew)), o = S(() => !!a.notifications.length), i = (r) => l("close", r), d = (r) => l("remove", r), m = (r) => l("read", r);
|
|
258
|
-
return (r, c) => (f(), g(
|
|
258
|
+
return (r, c) => (f(), g(D, null, [
|
|
259
259
|
a.value ? (f(), g("div", {
|
|
260
260
|
key: 0,
|
|
261
261
|
class: "overlay fixed left-0 top-0 h-full w-full bg-black/40 bg-blur",
|
|
@@ -267,7 +267,7 @@ const Oa = { class: "no-scrollbar flex flex-col overflow-y-auto duration-300 eas
|
|
|
267
267
|
n("div", Ja, [
|
|
268
268
|
I(r.$slots, "header", { isNew: t.value }),
|
|
269
269
|
o.value ? (f(), g("div", qa, [
|
|
270
|
-
|
|
270
|
+
p(Kt, {
|
|
271
271
|
"enter-active-class": "transition-all duration-300 ",
|
|
272
272
|
"enter-from-class": "opacity-0 translate-x-1/2",
|
|
273
273
|
"enter-to-class": "opacity-100 translate-x-0",
|
|
@@ -275,16 +275,16 @@ const Oa = { class: "no-scrollbar flex flex-col overflow-y-auto duration-300 eas
|
|
|
275
275
|
"leave-from-class": "opacity-100 translate-x-0",
|
|
276
276
|
"leave-to-class": "opacity-0 translate-x-1/2"
|
|
277
277
|
}, {
|
|
278
|
-
default:
|
|
279
|
-
(f(!0), g(
|
|
278
|
+
default: x(() => [
|
|
279
|
+
(f(!0), g(D, null, U(a.notifications, (u) => (f(), g("div", {
|
|
280
280
|
key: u.date,
|
|
281
281
|
class: "relative"
|
|
282
282
|
}, [
|
|
283
283
|
I(r.$slots, "card", { item: u }, () => [
|
|
284
|
-
|
|
284
|
+
p(Ga, Y({ ref_for: !0 }, u, {
|
|
285
285
|
class: "rounded-md border border-gray-light-10/60 bg-white/50 dark:border-white/5 dark:bg-white/[0.03]",
|
|
286
|
-
onRemove: (
|
|
287
|
-
onRead: (
|
|
286
|
+
onRemove: (h) => d(u),
|
|
287
|
+
onRead: (h) => m(u)
|
|
288
288
|
}), null, 16, ["onRemove", "onRead"])
|
|
289
289
|
])
|
|
290
290
|
]))), 128))
|
|
@@ -305,7 +305,7 @@ function Qa(e, s) {
|
|
|
305
305
|
])
|
|
306
306
|
]);
|
|
307
307
|
}
|
|
308
|
-
const
|
|
308
|
+
const rd = /* @__PURE__ */ St(Xa, [["render", Qa]]), es = {
|
|
309
309
|
key: 0,
|
|
310
310
|
class: "min-w-0 flex-1 truncate text-sm"
|
|
311
311
|
}, ts = ["title"], as = {
|
|
@@ -325,26 +325,26 @@ const ad = /* @__PURE__ */ Ct(Xa, [["render", Qa]]), es = {
|
|
|
325
325
|
const a = e, l = s, t = S(() => a.item.icon ?? "layout-grid"), o = S(() => {
|
|
326
326
|
var u;
|
|
327
327
|
return !!((u = a.item.children) != null && u.length);
|
|
328
|
-
}), i = F(!1), d = (u,
|
|
328
|
+
}), i = F(!1), d = (u, h) => {
|
|
329
329
|
var k;
|
|
330
|
-
return u.path ? u.path === "/" ?
|
|
330
|
+
return u.path ? u.path === "/" ? h === "/" : h === u.path || h.startsWith(u.path) ? !0 : !!((k = u.children) != null && k.some((v) => d(v, h))) : !1;
|
|
331
331
|
}, m = S(() => {
|
|
332
332
|
const u = a.item.path;
|
|
333
333
|
return u ? u === "/" ? a.activePath === "/" : a.activePath === u || a.activePath.startsWith(u) : !1;
|
|
334
334
|
}), r = S(() => {
|
|
335
335
|
var u;
|
|
336
|
-
return !!((u = a.item.children) != null && u.some((
|
|
336
|
+
return !!((u = a.item.children) != null && u.some((h) => d(h, a.activePath)));
|
|
337
337
|
}), c = () => {
|
|
338
338
|
o.value && (i.value = !i.value);
|
|
339
339
|
};
|
|
340
340
|
return ye(
|
|
341
341
|
[m, r],
|
|
342
|
-
([u,
|
|
343
|
-
(u ||
|
|
342
|
+
([u, h]) => {
|
|
343
|
+
(u || h) && o.value && (i.value = !0);
|
|
344
344
|
},
|
|
345
345
|
{ immediate: !0 }
|
|
346
|
-
), (u,
|
|
347
|
-
const k = lt("router-link"),
|
|
346
|
+
), (u, h) => {
|
|
347
|
+
const k = lt("router-link"), v = lt("AppNavItem", !0);
|
|
348
348
|
return f(), g("li", null, [
|
|
349
349
|
n("div", {
|
|
350
350
|
class: B(["group relative flex items-center rounded-md transition-colors", [
|
|
@@ -357,10 +357,10 @@ const ad = /* @__PURE__ */ Ct(Xa, [["render", Qa]]), es = {
|
|
|
357
357
|
to: e.item.path,
|
|
358
358
|
class: B(["flex min-w-0 flex-1 items-center gap-2.5 px-3 py-2", e.compact ? "lg:justify-center lg:px-0" : ""]),
|
|
359
359
|
title: e.compact ? e.item.name : void 0,
|
|
360
|
-
onClick:
|
|
360
|
+
onClick: h[0] || (h[0] = (y) => l("select"))
|
|
361
361
|
}, {
|
|
362
|
-
default:
|
|
363
|
-
|
|
362
|
+
default: x(() => [
|
|
363
|
+
p(V, {
|
|
364
364
|
name: t.value,
|
|
365
365
|
class: "size-5 shrink-0 opacity-70"
|
|
366
366
|
}, null, 8, ["name"]),
|
|
@@ -374,7 +374,7 @@ const ad = /* @__PURE__ */ Ct(Xa, [["render", Qa]]), es = {
|
|
|
374
374
|
title: e.compact ? e.item.name : void 0,
|
|
375
375
|
onClick: c
|
|
376
376
|
}, [
|
|
377
|
-
|
|
377
|
+
p(V, {
|
|
378
378
|
name: t.value,
|
|
379
379
|
class: "size-5 shrink-0 opacity-70"
|
|
380
380
|
}, null, 8, ["name"]),
|
|
@@ -386,9 +386,9 @@ const ad = /* @__PURE__ */ Ct(Xa, [["render", Qa]]), es = {
|
|
|
386
386
|
class: "mr-1 grid size-7 shrink-0 place-items-center rounded text-gray-main transition hover:text-cyan-main",
|
|
387
387
|
"aria-expanded": i.value,
|
|
388
388
|
"aria-label": e.item.name,
|
|
389
|
-
onClick:
|
|
389
|
+
onClick: Q(c, ["prevent", "stop"])
|
|
390
390
|
}, [
|
|
391
|
-
|
|
391
|
+
p(V, {
|
|
392
392
|
name: "chevron-down",
|
|
393
393
|
class: B(["size-4 transition-transform", i.value ? "" : "-rotate-90"])
|
|
394
394
|
}, null, 8, ["class"])
|
|
@@ -401,13 +401,13 @@ const ad = /* @__PURE__ */ Ct(Xa, [["render", Qa]]), es = {
|
|
|
401
401
|
}, [
|
|
402
402
|
n("div", null, [
|
|
403
403
|
n("ul", ls, [
|
|
404
|
-
(f(!0), g(
|
|
405
|
-
key: `${
|
|
406
|
-
item:
|
|
404
|
+
(f(!0), g(D, null, U(e.item.children, (y) => (f(), M(v, {
|
|
405
|
+
key: `${y.name}:${y.path ?? ""}`,
|
|
406
|
+
item: y,
|
|
407
407
|
level: e.level + 1,
|
|
408
408
|
"active-path": e.activePath,
|
|
409
409
|
compact: e.compact,
|
|
410
|
-
onSelect:
|
|
410
|
+
onSelect: h[1] || (h[1] = (z) => l("select"))
|
|
411
411
|
}, null, 8, ["item", "level", "active-path", "compact"]))), 128))
|
|
412
412
|
])
|
|
413
413
|
])
|
|
@@ -415,7 +415,7 @@ const ad = /* @__PURE__ */ Ct(Xa, [["render", Qa]]), es = {
|
|
|
415
415
|
]);
|
|
416
416
|
};
|
|
417
417
|
}
|
|
418
|
-
}), is = /* @__PURE__ */
|
|
418
|
+
}), is = /* @__PURE__ */ St(os, [["__scopeId", "data-v-a72068d0"]]), rs = { class: "flex flex-col" }, ds = ["aria-expanded", "onClick"], cs = ["inert"], us = { class: "space-y-1 pb-1" }, ms = {
|
|
419
419
|
key: 1,
|
|
420
420
|
class: "mb-4 flex flex-col gap-2"
|
|
421
421
|
}, fs = { class: "size-5 flex-[0_0_20px] opacity-60" }, gs = ["onClick"], vs = { class: "flex flex-col gap-2" }, ps = { class: "flex gap-2 ms-8" }, hs = { class: "size-5 flex-[0_0_20px]" }, ys = { class: "flex-1 first-letter:uppercase text-sm" }, bs = {
|
|
@@ -432,49 +432,49 @@ const ad = /* @__PURE__ */ Ct(Xa, [["render", Qa]]), es = {
|
|
|
432
432
|
},
|
|
433
433
|
emits: ["sidebar"],
|
|
434
434
|
setup(e, { emit: s }) {
|
|
435
|
-
const a = s, l = F(""), t = F(!1), o =
|
|
435
|
+
const a = s, l = F(""), t = F(!1), o = xt({}), i = S(() => e.isSidebar && t.value), d = (N) => N.key ?? N.title, m = (N) => !!o[d(N)], r = (N, Z) => {
|
|
436
436
|
var w;
|
|
437
|
-
return
|
|
437
|
+
return N.path ? N.path === "/" ? Z === "/" : Z === N.path || Z.startsWith(N.path) ? !0 : !!((w = N.children) != null && w.some((A) => r(A, Z))) : !1;
|
|
438
438
|
}, c = () => {
|
|
439
|
-
for (const
|
|
440
|
-
|
|
439
|
+
for (const N of e.groups)
|
|
440
|
+
N.items.some((Z) => r(Z, e.fullPath)) && (o[d(N)] = !1);
|
|
441
441
|
}, u = () => {
|
|
442
442
|
try {
|
|
443
443
|
localStorage.setItem(e.storageKey, JSON.stringify(o));
|
|
444
444
|
} catch {
|
|
445
445
|
return;
|
|
446
446
|
}
|
|
447
|
-
},
|
|
448
|
-
const Z = d(
|
|
447
|
+
}, h = (N) => {
|
|
448
|
+
const Z = d(N);
|
|
449
449
|
o[Z] = !o[Z], u();
|
|
450
450
|
}, k = () => {
|
|
451
451
|
typeof window > "u" || (t.value = window.matchMedia("(min-width: 1024px)").matches);
|
|
452
|
-
},
|
|
452
|
+
}, v = () => {
|
|
453
453
|
t.value || a("sidebar", !1);
|
|
454
|
-
},
|
|
455
|
-
|
|
454
|
+
}, y = (N) => {
|
|
455
|
+
v(), l.value !== N.name && (l.value = l.value === N.name ? "" : N.name);
|
|
456
456
|
}, z = () => {
|
|
457
|
-
const
|
|
457
|
+
const N = { services: !0, settings: !0 };
|
|
458
458
|
try {
|
|
459
459
|
const Z = localStorage.getItem(e.storageKey);
|
|
460
|
-
Object.assign(o, Z ? { ...
|
|
460
|
+
Object.assign(o, Z ? { ...N, ...JSON.parse(Z) } : N);
|
|
461
461
|
} catch {
|
|
462
|
-
Object.assign(o,
|
|
462
|
+
Object.assign(o, N);
|
|
463
463
|
}
|
|
464
464
|
c();
|
|
465
|
-
}, j = (
|
|
465
|
+
}, j = (N) => e.fullPath === N, H = (N) => N ? e.fullPath === N || e.fullPath.startsWith(N) : !1;
|
|
466
466
|
return ye(() => e.fullPath, c), ye(() => e.groups, c, { deep: !0 }), be(() => {
|
|
467
467
|
k(), z(), window.addEventListener("resize", k, { passive: !0 });
|
|
468
|
-
}),
|
|
468
|
+
}), Pe(() => {
|
|
469
469
|
window.removeEventListener("resize", k);
|
|
470
470
|
}), ye(
|
|
471
471
|
() => e.menu,
|
|
472
472
|
() => {
|
|
473
|
-
var
|
|
474
|
-
return l.value = ((
|
|
473
|
+
var N;
|
|
474
|
+
return l.value = ((N = Ca(e.menu, e.fullPath)) == null ? void 0 : N.name) || "";
|
|
475
475
|
}
|
|
476
|
-
), (
|
|
477
|
-
e.groups.length ? (f(!0), g(
|
|
476
|
+
), (N, Z) => (f(), g("nav", rs, [
|
|
477
|
+
e.groups.length ? (f(!0), g(D, { key: 0 }, U(e.groups, (w, A) => (f(), g("div", {
|
|
478
478
|
key: w.key ?? w.title,
|
|
479
479
|
class: B(i.value && A ? "mt-2 border-t border-gray-light-10/60 pt-2 dark:border-white/10" : "")
|
|
480
480
|
}, [
|
|
@@ -483,10 +483,10 @@ const ad = /* @__PURE__ */ Ct(Xa, [["render", Qa]]), es = {
|
|
|
483
483
|
type: "button",
|
|
484
484
|
class: "mb-1 flex w-full items-center justify-between rounded-md px-3 py-2 text-xs font-semibold uppercase tracking-[0.16em] text-gray-main transition hover:text-gray-dark-25 dark:hover:text-gray-light-10",
|
|
485
485
|
"aria-expanded": !m(w),
|
|
486
|
-
onClick: (P) =>
|
|
486
|
+
onClick: (P) => h(w)
|
|
487
487
|
}, [
|
|
488
488
|
n("span", null, C(w.title), 1),
|
|
489
|
-
|
|
489
|
+
p(V, {
|
|
490
490
|
name: "chevron-down",
|
|
491
491
|
class: B(["size-3.5 transition-transform", m(w) ? "-rotate-90" : ""])
|
|
492
492
|
}, null, 8, ["class"])
|
|
@@ -497,36 +497,36 @@ const ad = /* @__PURE__ */ Ct(Xa, [["render", Qa]]), es = {
|
|
|
497
497
|
}, [
|
|
498
498
|
n("div", null, [
|
|
499
499
|
n("ul", us, [
|
|
500
|
-
(f(!0), g(
|
|
500
|
+
(f(!0), g(D, null, U(w.items, (P) => (f(), M(is, {
|
|
501
501
|
key: `${P.name}:${P.path ?? ""}`,
|
|
502
502
|
item: P,
|
|
503
503
|
level: 0,
|
|
504
504
|
"active-path": e.fullPath,
|
|
505
505
|
compact: i.value,
|
|
506
|
-
onSelect:
|
|
506
|
+
onSelect: v
|
|
507
507
|
}, null, 8, ["item", "active-path", "compact"]))), 128))
|
|
508
508
|
])
|
|
509
509
|
])
|
|
510
510
|
], 10, cs)
|
|
511
511
|
], 2))), 128)) : (f(), g("ul", ms, [
|
|
512
|
-
(f(!0), g(
|
|
512
|
+
(f(!0), g(D, null, U(e.menu, (w) => (f(), g("li", {
|
|
513
513
|
key: w.name
|
|
514
514
|
}, [
|
|
515
515
|
(f(), M(Be(w.path ? "router-link" : "span"), {
|
|
516
516
|
to: w.path,
|
|
517
517
|
class: B(["flex gap-2 items-center px-3 py-2 rounded", j(w.path) ? "bg-cyan-main/10 text-cyan-main" : "hover:bg-white/5"]),
|
|
518
|
-
onClick:
|
|
518
|
+
onClick: Q((A) => y(w), ["prevent", "stop"])
|
|
519
519
|
}, {
|
|
520
|
-
default:
|
|
520
|
+
default: x(() => [
|
|
521
521
|
n("div", fs, [
|
|
522
|
-
I(
|
|
522
|
+
I(N.$slots, "icon", { item: w }, void 0, !0)
|
|
523
523
|
]),
|
|
524
524
|
n("span", {
|
|
525
525
|
class: B(["flex-1 first-letter:uppercase text-sm", e.isSidebar ? "lg:hidden" : ""])
|
|
526
526
|
}, C(w.name), 3),
|
|
527
527
|
n("button", {
|
|
528
528
|
class: B(["cursor-pointer", [e.isSidebar ? "lg:hidden" : ""]]),
|
|
529
|
-
onClick:
|
|
529
|
+
onClick: Q((A) => y(w), ["prevent", "stop"])
|
|
530
530
|
}, [
|
|
531
531
|
w.children ? (f(), M(V, {
|
|
532
532
|
key: 0,
|
|
@@ -542,15 +542,15 @@ const ad = /* @__PURE__ */ Ct(Xa, [["render", Qa]]), es = {
|
|
|
542
542
|
class: B(["translate transform overflow-hidden mt-2", [e.isSidebar ? "lg:hidden" : "", l.value === w.name ? "block" : "hidden"]])
|
|
543
543
|
}, [
|
|
544
544
|
n("ul", vs, [
|
|
545
|
-
(f(!0), g(
|
|
545
|
+
(f(!0), g(D, null, U(w.children, ({ name: A, path: P, icon: ae, children: xe }) => (f(), g("li", { key: A }, [
|
|
546
546
|
(f(), M(Be(P ? "router-link" : "span"), {
|
|
547
547
|
to: P,
|
|
548
548
|
class: B(["flex gap-2 items-center px-3 py-2 rounded", j(P) ? "bg-cyan-main/10 text-cyan-main" : "hover:bg-white/5"])
|
|
549
549
|
}, {
|
|
550
|
-
default:
|
|
550
|
+
default: x(() => [
|
|
551
551
|
n("div", ps, [
|
|
552
552
|
n("div", hs, [
|
|
553
|
-
I(
|
|
553
|
+
I(N.$slots, "icon-children", {
|
|
554
554
|
item: { name: A, path: P, icon: ae }
|
|
555
555
|
}, void 0, !0)
|
|
556
556
|
]),
|
|
@@ -561,17 +561,17 @@ const ad = /* @__PURE__ */ Ct(Xa, [["render", Qa]]), es = {
|
|
|
561
561
|
}, 1032, ["to", "class"])),
|
|
562
562
|
xe != null && xe.length && H(P) ? (f(), g("div", bs, [
|
|
563
563
|
n("ul", xs, [
|
|
564
|
-
(f(!0), g(
|
|
564
|
+
(f(!0), g(D, null, U(xe, (re) => (f(), g("li", {
|
|
565
565
|
key: re.name
|
|
566
566
|
}, [
|
|
567
567
|
(f(), M(Be(re.path ? "router-link" : "span"), {
|
|
568
568
|
to: re.path,
|
|
569
569
|
class: B(["flex gap-2 items-center px-3 py-2 rounded", j(re.path) ? "bg-cyan-main/10 text-cyan-main" : "hover:bg-white/5"])
|
|
570
570
|
}, {
|
|
571
|
-
default:
|
|
571
|
+
default: x(() => [
|
|
572
572
|
n("div", ks, [
|
|
573
573
|
n("div", $s, [
|
|
574
|
-
I(
|
|
574
|
+
I(N.$slots, "icon-children", { item: re }, void 0, !0)
|
|
575
575
|
]),
|
|
576
576
|
n("span", ws, C(re.name), 1)
|
|
577
577
|
])
|
|
@@ -588,7 +588,7 @@ const ad = /* @__PURE__ */ Ct(Xa, [["render", Qa]]), es = {
|
|
|
588
588
|
]))
|
|
589
589
|
]));
|
|
590
590
|
}
|
|
591
|
-
}),
|
|
591
|
+
}), dd = /* @__PURE__ */ St(Cs, [["__scopeId", "data-v-4c019515"]]), Ss = {
|
|
592
592
|
key: 0,
|
|
593
593
|
class: "glass-inset w-full min-w-64 max-w-xs rounded-xl p-4 shadow-lg",
|
|
594
594
|
role: "alert"
|
|
@@ -598,7 +598,7 @@ const ad = /* @__PURE__ */ Ct(Xa, [["render", Qa]]), es = {
|
|
|
598
598
|
}, zs = {
|
|
599
599
|
key: 0,
|
|
600
600
|
class: "relative mt-2 block h-4 w-full select-none overflow-hidden rounded-md bg-gray-light-10/70 dark:bg-white/10"
|
|
601
|
-
}, As = { class: "absolute left-36 top-1/2 -translate-1/2 text-sm font-bold text-black dark:text-white text-center leading-none" }, Es = { class: "absolute left-36 top-1/2 -translate-1/2 text-sm font-bold text-white text-center leading-none" },
|
|
601
|
+
}, As = { class: "absolute left-36 top-1/2 -translate-1/2 text-sm font-bold text-black dark:text-white text-center leading-none" }, Es = { class: "absolute left-36 top-1/2 -translate-1/2 text-sm font-bold text-white text-center leading-none" }, cd = /* @__PURE__ */ O({
|
|
602
602
|
__name: "AppProgress",
|
|
603
603
|
props: {
|
|
604
604
|
status: { default: 0 },
|
|
@@ -611,7 +611,7 @@ const ad = /* @__PURE__ */ Ct(Xa, [["render", Qa]]), es = {
|
|
|
611
611
|
setup(e, { emit: s }) {
|
|
612
612
|
const a = s, l = F(!1), t = () => {
|
|
613
613
|
l.value = !1, a("close");
|
|
614
|
-
}, o = S(() => !!e.length), i = S(() => !!(o.value && d.value === 100 && !e.status)), d = S(() => e.status ? Math.ceil(e.size * 100 / e.length) : 100), m =
|
|
614
|
+
}, o = S(() => !!e.length), i = S(() => !!(o.value && d.value === 100 && !e.status)), d = S(() => e.status ? Math.ceil(e.size * 100 / e.length) : 100), m = rt(() => {
|
|
615
615
|
l.value = !1;
|
|
616
616
|
}, e.timeout);
|
|
617
617
|
return ye(
|
|
@@ -619,7 +619,7 @@ const ad = /* @__PURE__ */ Ct(Xa, [["render", Qa]]), es = {
|
|
|
619
619
|
() => {
|
|
620
620
|
l.value = !0, m();
|
|
621
621
|
}
|
|
622
|
-
), (r, c) => (f(), M(
|
|
622
|
+
), (r, c) => (f(), M(kt, {
|
|
623
623
|
"enter-active-class": "duration-300 ease-out",
|
|
624
624
|
"enter-from-class": "transform opacity-0 translate-x-full",
|
|
625
625
|
"enter-to-class": "opacity-100 translate-x-0",
|
|
@@ -627,7 +627,7 @@ const ad = /* @__PURE__ */ Ct(Xa, [["render", Qa]]), es = {
|
|
|
627
627
|
"leave-from-class": "opacity-100 translate-y-0",
|
|
628
628
|
"leave-to-class": "transform opacity-0 -translate-y-8"
|
|
629
629
|
}, {
|
|
630
|
-
default:
|
|
630
|
+
default: x(() => [
|
|
631
631
|
l.value ? (f(), g("div", Ss, [
|
|
632
632
|
n("div", _s, [
|
|
633
633
|
I(r.$slots, "default", { isDone: i.value }, () => [
|
|
@@ -638,7 +638,7 @@ const ad = /* @__PURE__ */ Ct(Xa, [["render", Qa]]), es = {
|
|
|
638
638
|
class: "cursor-pointer transition text-gray-dark-30 dark:text-gray-main self-start hover:text-gray-dark-25",
|
|
639
639
|
onClick: t
|
|
640
640
|
}, [
|
|
641
|
-
|
|
641
|
+
p(V, {
|
|
642
642
|
name: "close",
|
|
643
643
|
class: "size-4"
|
|
644
644
|
})
|
|
@@ -648,7 +648,7 @@ const ad = /* @__PURE__ */ Ct(Xa, [["render", Qa]]), es = {
|
|
|
648
648
|
n("div", As, C(d.value) + "%", 1),
|
|
649
649
|
n("div", {
|
|
650
650
|
class: "bg-blue-600 rounded h-4 overflow-hidden relative transition-all duration-500",
|
|
651
|
-
style:
|
|
651
|
+
style: Ve(`width: ${d.value}%`)
|
|
652
652
|
}, [
|
|
653
653
|
n("div", Es, C(d.value) + "%", 1)
|
|
654
654
|
], 4)
|
|
@@ -658,7 +658,7 @@ const ad = /* @__PURE__ */ Ct(Xa, [["render", Qa]]), es = {
|
|
|
658
658
|
_: 3
|
|
659
659
|
}));
|
|
660
660
|
}
|
|
661
|
-
}), Bs = { class: "my-4 text-gray-dark-30 dark:text-gray-main" }, Vs = { class: "flex flex-col md:flex-row flex-wrap md:gap-4 text-sm" }, Is = { class: "flex gap-2" }, Ls = { class: "text-gray-dark-30 dark:text-gray-main" }, Ms = { class: "flex gap-2" }, Os = { class: "flex gap-2" }, Fs = { class: "text-gray-dark-30 dark:text-gray-main" },
|
|
661
|
+
}), Bs = { class: "my-4 text-gray-dark-30 dark:text-gray-main" }, Vs = { class: "flex flex-col md:flex-row flex-wrap md:gap-4 text-sm" }, Is = { class: "flex gap-2" }, Ls = { class: "text-gray-dark-30 dark:text-gray-main" }, Ms = { class: "flex gap-2" }, Os = { class: "flex gap-2" }, Fs = { class: "text-gray-dark-30 dark:text-gray-main" }, Ds = { class: "flex gap-2" }, js = { class: "text-gray-dark-30 dark:text-gray-main" }, Ns = { class: "flex flex-col gap-4 text-sm" }, Ps = { class: "flex gap-4" }, ud = /* @__PURE__ */ O({
|
|
662
662
|
__name: "BlockInfo",
|
|
663
663
|
props: {
|
|
664
664
|
id: { default: 0 },
|
|
@@ -692,9 +692,9 @@ const ad = /* @__PURE__ */ Ct(Xa, [["render", Qa]]), es = {
|
|
|
692
692
|
])
|
|
693
693
|
]),
|
|
694
694
|
t[3] || (t[3] = n("div", { class: "flex-auto" }, null, -1)),
|
|
695
|
-
n("div",
|
|
695
|
+
n("div", Ds, [
|
|
696
696
|
t[2] || (t[2] = L(" ID: ", -1)),
|
|
697
|
-
n("span",
|
|
697
|
+
n("span", js, C(e.id.toString(16)), 1)
|
|
698
698
|
])
|
|
699
699
|
]),
|
|
700
700
|
t[4] || (t[4] = n("hr", { class: "dark:text-gray-dark-30 text-gray-light-10 my-2" }, null, -1)),
|
|
@@ -709,7 +709,7 @@ const ad = /* @__PURE__ */ Ct(Xa, [["render", Qa]]), es = {
|
|
|
709
709
|
}), Rs = ["onClick"], Us = { class: "mr-2" }, Ks = { class: "text-sm" }, Ws = { class: "text-gray-main text-xs" }, Hs = {
|
|
710
710
|
key: 0,
|
|
711
711
|
class: "flex justify-center"
|
|
712
|
-
}, Gs = { class: "flex justify-end mt-4" },
|
|
712
|
+
}, Gs = { class: "flex justify-end mt-4" }, md = /* @__PURE__ */ O({
|
|
713
713
|
__name: "BlockScan",
|
|
714
714
|
props: {
|
|
715
715
|
items: { default: () => [] }
|
|
@@ -718,37 +718,37 @@ const ad = /* @__PURE__ */ Ct(Xa, [["render", Qa]]), es = {
|
|
|
718
718
|
setup(e, { emit: s }) {
|
|
719
719
|
const a = s, l = ["OPEN", "WEP", "WPA_PSK", "WPA2_PSK", "WPA_WPA2_PSK", "MAX", "", "NO", "AUTO"], t = (i) => a("select", i), o = (i) => a("scan", i);
|
|
720
720
|
return (i, d) => {
|
|
721
|
-
const m = ba, r =
|
|
721
|
+
const m = ba, r = Ct, c = xa, u = R;
|
|
722
722
|
return f(), g("div", null, [
|
|
723
|
-
|
|
723
|
+
p(r, {
|
|
724
724
|
items: e.items,
|
|
725
725
|
class: "bg-transparent! ring-0!"
|
|
726
726
|
}, {
|
|
727
|
-
default:
|
|
727
|
+
default: x(({ item: h }) => [
|
|
728
728
|
n("div", {
|
|
729
729
|
class: "flex items-center w-full",
|
|
730
|
-
onClick: (k) => t(
|
|
730
|
+
onClick: (k) => t(h)
|
|
731
731
|
}, [
|
|
732
732
|
n("div", Us, [
|
|
733
|
-
|
|
733
|
+
p(m, se(ne(h)), null, 16)
|
|
734
734
|
]),
|
|
735
735
|
n("div", null, [
|
|
736
|
-
n("div", Ks, C(
|
|
737
|
-
n("div", Ws, C(i.$t("security")) + " : " + C(l[
|
|
736
|
+
n("div", Ks, C(h.ssid), 1),
|
|
737
|
+
n("div", Ws, C(i.$t("security")) + " : " + C(l[h.encryptionType] || "unknown"), 1)
|
|
738
738
|
])
|
|
739
739
|
], 8, Rs)
|
|
740
740
|
]),
|
|
741
741
|
_: 1
|
|
742
742
|
}, 8, ["items"]),
|
|
743
743
|
e.items.length ? T("", !0) : (f(), g("div", Hs, [
|
|
744
|
-
|
|
744
|
+
p(c, { class: "text-cyan-main" })
|
|
745
745
|
])),
|
|
746
746
|
n("div", Gs, [
|
|
747
|
-
|
|
747
|
+
p(u, {
|
|
748
748
|
color: "blue",
|
|
749
749
|
onClick: o
|
|
750
750
|
}, {
|
|
751
|
-
default:
|
|
751
|
+
default: x(() => [
|
|
752
752
|
L(C(i.$t("scan")), 1)
|
|
753
753
|
]),
|
|
754
754
|
_: 1
|
|
@@ -757,7 +757,7 @@ const ad = /* @__PURE__ */ Ct(Xa, [["render", Qa]]), es = {
|
|
|
757
757
|
]);
|
|
758
758
|
};
|
|
759
759
|
}
|
|
760
|
-
}), Js = { class: "md:flex items-center mb-4" }, qs = { class: "flex-auto text-gray-dark-25 dark:text-gray-light-10 mb-2" }, Xs = { class: "md:max-w-50" }, Ys = { class: "flex items-center mb-4" }, Zs = { class: "flex-auto text-gray-dark-25 dark:text-gray-light-10" }, Qs = { class: "flex items-center mb-4" }, en = { class: "flex-auto text-gray-dark-25 dark:text-gray-light-10" },
|
|
760
|
+
}), Js = { class: "md:flex items-center mb-4" }, qs = { class: "flex-auto text-gray-dark-25 dark:text-gray-light-10 mb-2" }, Xs = { class: "md:max-w-50" }, Ys = { class: "flex items-center mb-4" }, Zs = { class: "flex-auto text-gray-dark-25 dark:text-gray-light-10" }, Qs = { class: "flex items-center mb-4" }, en = { class: "flex-auto text-gray-dark-25 dark:text-gray-light-10" }, fd = /* @__PURE__ */ O({
|
|
761
761
|
__name: "BlockService",
|
|
762
762
|
props: {
|
|
763
763
|
locale: {},
|
|
@@ -771,11 +771,11 @@ const ad = /* @__PURE__ */ Ct(Xa, [["render", Qa]]), es = {
|
|
|
771
771
|
};
|
|
772
772
|
return (o, i) => {
|
|
773
773
|
const d = he, m = R;
|
|
774
|
-
return f(), g(
|
|
774
|
+
return f(), g(D, null, [
|
|
775
775
|
n("div", Js, [
|
|
776
776
|
n("div", qs, C(o.$t("selectLang")), 1),
|
|
777
777
|
n("div", Xs, [
|
|
778
|
-
|
|
778
|
+
p(d, {
|
|
779
779
|
"model-value": t(e.locale),
|
|
780
780
|
label: o.$t("lang"),
|
|
781
781
|
items: e.locales,
|
|
@@ -785,13 +785,13 @@ const ad = /* @__PURE__ */ Ct(Xa, [["render", Qa]]), es = {
|
|
|
785
785
|
]),
|
|
786
786
|
n("div", Ys, [
|
|
787
787
|
n("div", Zs, C(o.$t("rebootDev")), 1),
|
|
788
|
-
|
|
788
|
+
p(m, {
|
|
789
789
|
class: "min-w-24",
|
|
790
790
|
color: "red",
|
|
791
791
|
variant: "ghost",
|
|
792
792
|
onClick: i[0] || (i[0] = (r) => a("reboot", r))
|
|
793
793
|
}, {
|
|
794
|
-
default:
|
|
794
|
+
default: x(() => [
|
|
795
795
|
L(C(o.$t("reboot")), 1)
|
|
796
796
|
]),
|
|
797
797
|
_: 1
|
|
@@ -799,13 +799,13 @@ const ad = /* @__PURE__ */ Ct(Xa, [["render", Qa]]), es = {
|
|
|
799
799
|
]),
|
|
800
800
|
n("div", Qs, [
|
|
801
801
|
n("div", en, C(o.$t("resetConf")), 1),
|
|
802
|
-
|
|
802
|
+
p(m, {
|
|
803
803
|
class: "min-w-24",
|
|
804
804
|
color: "red",
|
|
805
805
|
variant: "muted",
|
|
806
806
|
onClick: i[1] || (i[1] = (r) => a("reset", r))
|
|
807
807
|
}, {
|
|
808
|
-
default:
|
|
808
|
+
default: x(() => [
|
|
809
809
|
L(C(o.$t("reset")), 1)
|
|
810
810
|
]),
|
|
811
811
|
_: 1
|
|
@@ -814,7 +814,7 @@ const ad = /* @__PURE__ */ Ct(Xa, [["render", Qa]]), es = {
|
|
|
814
814
|
], 64);
|
|
815
815
|
};
|
|
816
816
|
}
|
|
817
|
-
}), tn = { class: "grid grid-cols-1 gap-4 lg:max-w-90 min-w-64" }, an = { class: "flex flex-col w-full items-center gap-2" }, sn = ["title"], nn = { class: "absolute left-28 top-1/2 -translate-1/2 text-center text-sm font-bold leading-none text-gray-dark-40 dark:text-white" }, ln = { class: "absolute left-28 top-1/2 -translate-1/2 text-sm font-bold text-white text-center leading-none" }, on = { class: "flex justify-between w-full text-xs" }, rn = { class: "text-gray-dark-25 dark:text-white/50" }, dn = { class: "text-sm" }, cn = { class: "text-gray-dark-25 dark:text-white/50 text-left" }, un = { class: "text-right text-xs" },
|
|
817
|
+
}), tn = { class: "grid grid-cols-1 gap-4 lg:max-w-90 min-w-64" }, an = { class: "flex flex-col w-full items-center gap-2" }, sn = ["title"], nn = { class: "absolute left-28 top-1/2 -translate-1/2 text-center text-sm font-bold leading-none text-gray-dark-40 dark:text-white" }, ln = { class: "absolute left-28 top-1/2 -translate-1/2 text-sm font-bold text-white text-center leading-none" }, on = { class: "flex justify-between w-full text-xs" }, rn = { class: "text-gray-dark-25 dark:text-white/50" }, dn = { class: "text-sm" }, cn = { class: "text-gray-dark-25 dark:text-white/50 text-left" }, un = { class: "text-right text-xs" }, gd = /* @__PURE__ */ O({
|
|
818
818
|
__name: "BlockStatus",
|
|
819
819
|
props: {
|
|
820
820
|
id: { default: 0 },
|
|
@@ -846,10 +846,10 @@ const ad = /* @__PURE__ */ Ct(Xa, [["render", Qa]]), es = {
|
|
|
846
846
|
};
|
|
847
847
|
return be(() => {
|
|
848
848
|
d();
|
|
849
|
-
}),
|
|
849
|
+
}), Pe(() => {
|
|
850
850
|
s.value = 0, a && clearTimeout(a);
|
|
851
851
|
}), (m, r) => {
|
|
852
|
-
var c, u,
|
|
852
|
+
var c, u, h;
|
|
853
853
|
return f(), g("div", tn, [
|
|
854
854
|
n("div", an, [
|
|
855
855
|
n("div", {
|
|
@@ -859,13 +859,13 @@ const ad = /* @__PURE__ */ Ct(Xa, [["render", Qa]]), es = {
|
|
|
859
859
|
n("div", nn, C(i.value) + "%", 1),
|
|
860
860
|
n("div", {
|
|
861
861
|
class: "relative h-4 overflow-hidden rounded-md bg-cyan-main transition-all duration-500",
|
|
862
|
-
style:
|
|
862
|
+
style: Ve(`width: ${i.value}%`)
|
|
863
863
|
}, [
|
|
864
864
|
n("div", ln, C(i.value) + "%", 1)
|
|
865
865
|
], 4)
|
|
866
866
|
], 8, sn),
|
|
867
867
|
n("div", on, [
|
|
868
|
-
(f(!0), g(
|
|
868
|
+
(f(!0), g(D, null, U(t.value, (k) => (f(), g("div", {
|
|
869
869
|
key: k.name,
|
|
870
870
|
class: "flex-auto"
|
|
871
871
|
}, [
|
|
@@ -877,7 +877,7 @@ const ad = /* @__PURE__ */ Ct(Xa, [["render", Qa]]), es = {
|
|
|
877
877
|
])
|
|
878
878
|
]),
|
|
879
879
|
n("div", dn, [
|
|
880
|
-
(f(!0), g(
|
|
880
|
+
(f(!0), g(D, null, U(o.value, (k) => (f(), g("div", {
|
|
881
881
|
key: k.name,
|
|
882
882
|
class: "flex justify-between items-center"
|
|
883
883
|
}, [
|
|
@@ -890,7 +890,7 @@ const ad = /* @__PURE__ */ Ct(Xa, [["render", Qa]]), es = {
|
|
|
890
890
|
n("div", null, [
|
|
891
891
|
I(m.$slots, "default", {
|
|
892
892
|
home: (c = e.pkg) == null ? void 0 : c.homepage,
|
|
893
|
-
repo: (
|
|
893
|
+
repo: (h = (u = e.pkg) == null ? void 0 : u.repository) == null ? void 0 : h.url
|
|
894
894
|
})
|
|
895
895
|
])
|
|
896
896
|
]);
|
|
@@ -920,11 +920,11 @@ const ad = /* @__PURE__ */ Ct(Xa, [["render", Qa]]), es = {
|
|
|
920
920
|
I(t.$slots, "default")
|
|
921
921
|
]));
|
|
922
922
|
}
|
|
923
|
-
}), vn = { class: "md:flex" }, pn = { class: "text-gray-dark-25 dark:text-gray-light-10 first-letter:uppercase min-w-19" },
|
|
923
|
+
}), vn = { class: "md:flex" }, pn = { class: "text-gray-dark-25 dark:text-gray-light-10 first-letter:uppercase min-w-19" }, vd = /* @__PURE__ */ O({
|
|
924
924
|
__name: "BlockUpdate",
|
|
925
925
|
emits: ["update"],
|
|
926
926
|
setup(e, { emit: s }) {
|
|
927
|
-
const a = s, l =
|
|
927
|
+
const a = s, l = xt({ firmware: null, littlefs: null }), t = (d) => d ? Array.from(d).map((m) => `${m.name} (${tt(m.size)})`).join("") : "", o = (d, m) => {
|
|
928
928
|
const r = new FormData();
|
|
929
929
|
for (let c = 0; c < d.length; c++) {
|
|
930
930
|
const u = d.item(c);
|
|
@@ -940,16 +940,16 @@ const ad = /* @__PURE__ */ Ct(Xa, [["render", Qa]]), es = {
|
|
|
940
940
|
return (d, m) => {
|
|
941
941
|
const r = R;
|
|
942
942
|
return f(), g("div", null, [
|
|
943
|
-
(f(!0), g(
|
|
943
|
+
(f(!0), g(D, null, U(l, (c, u) => (f(), g("div", {
|
|
944
944
|
key: u,
|
|
945
945
|
class: "mb-4 flex items-center"
|
|
946
946
|
}, [
|
|
947
|
-
|
|
947
|
+
p(gn, {
|
|
948
948
|
accept: ".bin",
|
|
949
|
-
onChange: (
|
|
949
|
+
onChange: (h) => l[u] = h,
|
|
950
950
|
class: "flex-auto"
|
|
951
951
|
}, {
|
|
952
|
-
default:
|
|
952
|
+
default: x(() => [
|
|
953
953
|
n("div", vn, [
|
|
954
954
|
n("h6", pn, C(u) + ":", 1),
|
|
955
955
|
I(d.$slots, "default", {
|
|
@@ -959,13 +959,13 @@ const ad = /* @__PURE__ */ Ct(Xa, [["render", Qa]]), es = {
|
|
|
959
959
|
]),
|
|
960
960
|
_: 2
|
|
961
961
|
}, 1032, ["onChange"]),
|
|
962
|
-
|
|
962
|
+
p(r, {
|
|
963
963
|
class: "min-w-24",
|
|
964
964
|
color: "blue",
|
|
965
965
|
disabled: !c,
|
|
966
|
-
onClick: (
|
|
966
|
+
onClick: (h) => i(`${u}.bin`, c)
|
|
967
967
|
}, {
|
|
968
|
-
default:
|
|
968
|
+
default: x(() => [
|
|
969
969
|
L(C(d.$t("btnUpdate")), 1)
|
|
970
970
|
]),
|
|
971
971
|
_: 1
|
|
@@ -974,7 +974,7 @@ const ad = /* @__PURE__ */ Ct(Xa, [["render", Qa]]), es = {
|
|
|
974
974
|
]);
|
|
975
975
|
};
|
|
976
976
|
}
|
|
977
|
-
}), hn = { class: "flex items-center gap-1.5" },
|
|
977
|
+
}), hn = { class: "flex items-center gap-1.5" }, pd = /* @__PURE__ */ O({
|
|
978
978
|
__name: "BlockBreadcrumb",
|
|
979
979
|
props: {
|
|
980
980
|
items: { default: () => [] }
|
|
@@ -984,7 +984,7 @@ const ad = /* @__PURE__ */ Ct(Xa, [["render", Qa]]), es = {
|
|
|
984
984
|
const a = s, l = (t) => a("click", t);
|
|
985
985
|
return (t, o) => (f(), g("nav", null, [
|
|
986
986
|
n("ol", hn, [
|
|
987
|
-
(f(!0), g(
|
|
987
|
+
(f(!0), g(D, null, U(e.items, (i, d) => (f(), g("li", {
|
|
988
988
|
key: d,
|
|
989
989
|
class: B(["inline-flex items-center gap-1.5 text-sm text-gray-dark-25 dark:text-gray-main", i.path ? "" : "text-gray-dark-30 dark:text-white/90"])
|
|
990
990
|
}, [
|
|
@@ -993,7 +993,7 @@ const ad = /* @__PURE__ */ Ct(Xa, [["render", Qa]]), es = {
|
|
|
993
993
|
href: i.path,
|
|
994
994
|
onClick: (m) => l(i)
|
|
995
995
|
}, {
|
|
996
|
-
default:
|
|
996
|
+
default: x(() => [
|
|
997
997
|
L(C(i.name), 1)
|
|
998
998
|
]),
|
|
999
999
|
_: 2
|
|
@@ -1015,7 +1015,7 @@ const ad = /* @__PURE__ */ Ct(Xa, [["render", Qa]]), es = {
|
|
|
1015
1015
|
}, xn = { class: "dark:text-gray-light-10" }, kn = { class: "flex items-center z-10" }, $n = {
|
|
1016
1016
|
key: 0,
|
|
1017
1017
|
class: "flex ps-5"
|
|
1018
|
-
}, wn = { class: "font-medium dark:text-gray-light-10" },
|
|
1018
|
+
}, wn = { class: "font-medium dark:text-gray-light-10" }, ft = "ms-2 opacity-20 transition-all hover:opacity-70", _t = /* @__PURE__ */ O({
|
|
1019
1019
|
__name: "VListObject",
|
|
1020
1020
|
props: {
|
|
1021
1021
|
items: { default: () => ({}) },
|
|
@@ -1025,17 +1025,17 @@ const ad = /* @__PURE__ */ Ct(Xa, [["render", Qa]]), es = {
|
|
|
1025
1025
|
},
|
|
1026
1026
|
emits: ["click"],
|
|
1027
1027
|
setup(e, { emit: s }) {
|
|
1028
|
-
const a = s, l = () => "relative before:pointer-events-none before:absolute before:w-full before:h-8 before:top-0 before:left-0 before:border-b before:border-gray-light-10 dark:before:border-gray-dark-30/50 hover:before:bg-gray-main/10", t = F({}), { text: o, copy: i, copied: d, isSupported: m } = Aa(), r = (
|
|
1029
|
-
if (c(
|
|
1030
|
-
t.value[
|
|
1028
|
+
const a = s, l = () => "relative before:pointer-events-none before:absolute before:w-full before:h-8 before:top-0 before:left-0 before:border-b before:border-gray-light-10 dark:before:border-gray-dark-30/50 hover:before:bg-gray-main/10", t = F({}), { text: o, copy: i, copied: d, isSupported: m } = Aa(), r = (v, y) => {
|
|
1029
|
+
if (c(y)) {
|
|
1030
|
+
t.value[v] = !t.value[v];
|
|
1031
1031
|
return;
|
|
1032
1032
|
}
|
|
1033
|
-
|
|
1034
|
-
}, c = (
|
|
1035
|
-
a("click", { key:
|
|
1033
|
+
h(v) && a("click", { key: v, path: u(v), isObject: !1 });
|
|
1034
|
+
}, c = (v) => typeof v == "object" && v !== null, u = (v) => `${e.path ? e.path + "." : ""}${v}`, h = (v) => !e.canAdd || e.canAdd(u(v)), k = (v, y) => {
|
|
1035
|
+
a("click", { key: v, path: u(v), isObject: y });
|
|
1036
1036
|
};
|
|
1037
|
-
return (
|
|
1038
|
-
(f(!0), g(
|
|
1037
|
+
return (v, y) => (f(), g("ul", null, [
|
|
1038
|
+
(f(!0), g(D, null, U(e.items, (z, j) => (f(), g("li", {
|
|
1039
1039
|
key: j,
|
|
1040
1040
|
class: B(c(z) ? "" : `flex items-center ${l()}`)
|
|
1041
1041
|
}, [
|
|
@@ -1044,7 +1044,7 @@ const ad = /* @__PURE__ */ Ct(Xa, [["render", Qa]]), es = {
|
|
|
1044
1044
|
onClick: (H) => r(j, z)
|
|
1045
1045
|
}, [
|
|
1046
1046
|
c(z) ? (f(), g("div", bn, [
|
|
1047
|
-
|
|
1047
|
+
p(V, {
|
|
1048
1048
|
name: "folder",
|
|
1049
1049
|
class: "size-5"
|
|
1050
1050
|
})
|
|
@@ -1052,13 +1052,13 @@ const ad = /* @__PURE__ */ Ct(Xa, [["render", Qa]]), es = {
|
|
|
1052
1052
|
n("div", xn, C(j), 1),
|
|
1053
1053
|
J(m) ? (f(), M(R, {
|
|
1054
1054
|
key: 1,
|
|
1055
|
-
class: B(
|
|
1055
|
+
class: B(ft),
|
|
1056
1056
|
variant: "ghost",
|
|
1057
1057
|
size: "sm",
|
|
1058
|
-
onClick:
|
|
1058
|
+
onClick: Q((H) => J(i)(u(j)), ["stop"])
|
|
1059
1059
|
}, {
|
|
1060
|
-
default:
|
|
1061
|
-
|
|
1060
|
+
default: x(() => [
|
|
1061
|
+
p(V, {
|
|
1062
1062
|
name: "copy",
|
|
1063
1063
|
class: "size-5"
|
|
1064
1064
|
})
|
|
@@ -1068,19 +1068,19 @@ const ad = /* @__PURE__ */ Ct(Xa, [["render", Qa]]), es = {
|
|
|
1068
1068
|
J(o) === u(j) ? (f(), g("span", {
|
|
1069
1069
|
key: 2,
|
|
1070
1070
|
class: B(["text-gray-dark-25 transition-all duration-1000 text-sm", J(d) ? "opacity-100" : "opacity-0"])
|
|
1071
|
-
}, C(
|
|
1072
|
-
!e.onlyValue && c(z) &&
|
|
1073
|
-
|
|
1071
|
+
}, C(v.$t("copied")), 3)) : T("", !0),
|
|
1072
|
+
!e.onlyValue && c(z) && h(j) ? (f(), g(D, { key: 3 }, [
|
|
1073
|
+
y[1] || (y[1] = n("div", { class: "flex-auto" }, null, -1)),
|
|
1074
1074
|
n("div", kn, [
|
|
1075
|
-
|
|
1076
|
-
class: B(
|
|
1075
|
+
p(R, {
|
|
1076
|
+
class: B(ft),
|
|
1077
1077
|
variant: "ghost",
|
|
1078
1078
|
size: "sm",
|
|
1079
|
-
title:
|
|
1080
|
-
onClick:
|
|
1079
|
+
title: v.$t("add"),
|
|
1080
|
+
onClick: Q((H) => k(j, c(z)), ["stop"])
|
|
1081
1081
|
}, {
|
|
1082
|
-
default:
|
|
1083
|
-
|
|
1082
|
+
default: x(() => [
|
|
1083
|
+
p(V, {
|
|
1084
1084
|
name: "add",
|
|
1085
1085
|
class: "size-5"
|
|
1086
1086
|
})
|
|
@@ -1091,29 +1091,29 @@ const ad = /* @__PURE__ */ Ct(Xa, [["render", Qa]]), es = {
|
|
|
1091
1091
|
], 64)) : T("", !0)
|
|
1092
1092
|
], 10, yn),
|
|
1093
1093
|
c(z) ? (f(), g("div", $n, [
|
|
1094
|
-
it(
|
|
1094
|
+
it(p(_t, {
|
|
1095
1095
|
class: "flex-auto",
|
|
1096
1096
|
path: u(j),
|
|
1097
1097
|
items: z,
|
|
1098
1098
|
onlyValue: e.onlyValue,
|
|
1099
1099
|
canAdd: e.canAdd,
|
|
1100
|
-
onClick:
|
|
1100
|
+
onClick: y[0] || (y[0] = (H) => a("click", H))
|
|
1101
1101
|
}, null, 8, ["path", "items", "onlyValue", "canAdd"]), [
|
|
1102
1102
|
[fa, t.value[j]]
|
|
1103
1103
|
])
|
|
1104
|
-
])) : (f(), g(
|
|
1105
|
-
|
|
1104
|
+
])) : (f(), g(D, { key: 1 }, [
|
|
1105
|
+
y[2] || (y[2] = n("div", { class: "flex-auto gap-3" }, null, -1)),
|
|
1106
1106
|
n("div", wn, C(z), 1),
|
|
1107
|
-
|
|
1107
|
+
h(j) ? (f(), M(R, {
|
|
1108
1108
|
key: 0,
|
|
1109
|
-
class: B(
|
|
1109
|
+
class: B(ft),
|
|
1110
1110
|
variant: "ghost",
|
|
1111
1111
|
size: "sm",
|
|
1112
|
-
title:
|
|
1113
|
-
onClick:
|
|
1112
|
+
title: v.$t("add"),
|
|
1113
|
+
onClick: Q((H) => k(j, c(z)), ["stop"])
|
|
1114
1114
|
}, {
|
|
1115
|
-
default:
|
|
1116
|
-
|
|
1115
|
+
default: x(() => [
|
|
1116
|
+
p(V, {
|
|
1117
1117
|
name: "add",
|
|
1118
1118
|
class: "size-5"
|
|
1119
1119
|
})
|
|
@@ -1159,7 +1159,7 @@ const ad = /* @__PURE__ */ Ct(Xa, [["render", Qa]]), es = {
|
|
|
1159
1159
|
onClick: r[0] || (r[0] = (c) => l("icon", c))
|
|
1160
1160
|
}, [
|
|
1161
1161
|
I(m.$slots, "icon", {}, () => [
|
|
1162
|
-
|
|
1162
|
+
p(V, {
|
|
1163
1163
|
name: "add",
|
|
1164
1164
|
class: "size-4"
|
|
1165
1165
|
})
|
|
@@ -1178,7 +1178,7 @@ const ad = /* @__PURE__ */ Ct(Xa, [["render", Qa]]), es = {
|
|
|
1178
1178
|
size: "md",
|
|
1179
1179
|
onClose: t[0] || (t[0] = (o) => a("close"))
|
|
1180
1180
|
}, {
|
|
1181
|
-
default:
|
|
1181
|
+
default: x(() => [...t[1] || (t[1] = [
|
|
1182
1182
|
n("div", { class: "flex flex-col gap-4 text-sm leading-relaxed text-gray-dark-25 dark:text-gray-light-10" }, [
|
|
1183
1183
|
n("section", null, [
|
|
1184
1184
|
n("h5", { class: "mb-1 text-base font-semibold text-gray-dark-40 dark:text-white" }, "Блоки и данные"),
|
|
@@ -1317,8 +1317,8 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
1317
1317
|
"onUpdate:modelValue": t[1] || (t[1] = (o) => a("update:modelValue", o)),
|
|
1318
1318
|
onOnIcon: t[2] || (t[2] = (o) => a("pick"))
|
|
1319
1319
|
}, {
|
|
1320
|
-
icon:
|
|
1321
|
-
|
|
1320
|
+
icon: x(() => [
|
|
1321
|
+
p(V, {
|
|
1322
1322
|
name: "search",
|
|
1323
1323
|
size: 16
|
|
1324
1324
|
})
|
|
@@ -1343,8 +1343,8 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
1343
1343
|
title: "Сбросить поле",
|
|
1344
1344
|
onClick: t[4] || (t[4] = (o) => a("reset"))
|
|
1345
1345
|
}, {
|
|
1346
|
-
default:
|
|
1347
|
-
|
|
1346
|
+
default: x(() => [
|
|
1347
|
+
p(V, {
|
|
1348
1348
|
name: "refresh",
|
|
1349
1349
|
size: 14
|
|
1350
1350
|
})
|
|
@@ -1379,7 +1379,7 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
1379
1379
|
} catch (c) {
|
|
1380
1380
|
return console.warn(c), !1;
|
|
1381
1381
|
}
|
|
1382
|
-
}, d =
|
|
1382
|
+
}, d = rt((r) => {
|
|
1383
1383
|
const c = r.target;
|
|
1384
1384
|
i(c.value) && a("change", c.value);
|
|
1385
1385
|
}, 500), m = (r) => a("icon", r);
|
|
@@ -1396,7 +1396,7 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
1396
1396
|
hideIcon: e.hideIcon,
|
|
1397
1397
|
onIcon: m
|
|
1398
1398
|
}, {
|
|
1399
|
-
icon:
|
|
1399
|
+
icon: x(() => [
|
|
1400
1400
|
e.value ? (f(), M(V, {
|
|
1401
1401
|
key: 0,
|
|
1402
1402
|
name: "close",
|
|
@@ -1407,27 +1407,27 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
1407
1407
|
class: "size-4"
|
|
1408
1408
|
}))
|
|
1409
1409
|
]),
|
|
1410
|
-
default:
|
|
1411
|
-
e.value ? (f(), g(
|
|
1410
|
+
default: x(() => [
|
|
1411
|
+
e.value ? (f(), g(D, { key: 0 }, [
|
|
1412
1412
|
n("div", En, [
|
|
1413
1413
|
c[4] || (c[4] = L(" ( ", -1)),
|
|
1414
|
-
(f(!0), g(
|
|
1414
|
+
(f(!0), g(D, null, U(e.prefix, (u, h) => {
|
|
1415
1415
|
var k;
|
|
1416
|
-
return f(), g(
|
|
1417
|
-
key: `prefix-${
|
|
1416
|
+
return f(), g(D, {
|
|
1417
|
+
key: `prefix-${h}`
|
|
1418
1418
|
}, [
|
|
1419
1419
|
n("span", {
|
|
1420
1420
|
class: "text-blue-400/80",
|
|
1421
|
-
title: (k = e.prefixTitles) == null ? void 0 : k[
|
|
1421
|
+
title: (k = e.prefixTitles) == null ? void 0 : k[h]
|
|
1422
1422
|
}, C(u), 9, Bn),
|
|
1423
1423
|
c[2] || (c[2] = n("span", { class: "last:hidden" }, ",", -1))
|
|
1424
1424
|
], 64);
|
|
1425
1425
|
}), 128)),
|
|
1426
|
-
(f(!0), g(
|
|
1426
|
+
(f(!0), g(D, null, U(e.args, (u, h) => (f(), g(D, { key: u }, [
|
|
1427
1427
|
n("span", {
|
|
1428
1428
|
class: "text-blue-400/80",
|
|
1429
1429
|
title: e.argumentTitle ? `${e.argumentTitle}: ${u}` : u
|
|
1430
|
-
}, C(t(
|
|
1430
|
+
}, C(t(h)), 9, Vn),
|
|
1431
1431
|
c[3] || (c[3] = n("span", { class: "last:hidden" }, ",", -1))
|
|
1432
1432
|
], 64))), 128)),
|
|
1433
1433
|
c[5] || (c[5] = L(" ) => ", -1))
|
|
@@ -1441,7 +1441,7 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
1441
1441
|
onInput: c[1] || (c[1] = //@ts-ignore
|
|
1442
1442
|
(...u) => J(d) && J(d)(...u))
|
|
1443
1443
|
}, null, 40, Ln), [
|
|
1444
|
-
[
|
|
1444
|
+
[$t, o.value]
|
|
1445
1445
|
])
|
|
1446
1446
|
])
|
|
1447
1447
|
], 64)) : T("", !0)
|
|
@@ -1471,7 +1471,7 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
1471
1471
|
normal: "font-normal",
|
|
1472
1472
|
medium: "font-medium",
|
|
1473
1473
|
semibold: "font-semibold"
|
|
1474
|
-
},
|
|
1474
|
+
}, Dn = {
|
|
1475
1475
|
left: "text-left",
|
|
1476
1476
|
right: "text-right"
|
|
1477
1477
|
}, Mt = [
|
|
@@ -1491,18 +1491,18 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
1491
1491
|
{ value: "normal", name: "Обычное" },
|
|
1492
1492
|
{ value: "medium", name: "Среднее" },
|
|
1493
1493
|
{ value: "semibold", name: "Полужирное" }
|
|
1494
|
-
],
|
|
1494
|
+
], Dt = [
|
|
1495
1495
|
{ value: "left", name: "Слева" },
|
|
1496
1496
|
{ value: "right", name: "Справа" }
|
|
1497
|
-
],
|
|
1497
|
+
], ht = (e) => {
|
|
1498
1498
|
const s = { ...zt, ...e };
|
|
1499
1499
|
return [
|
|
1500
1500
|
Mn[s.size],
|
|
1501
1501
|
On[s.color],
|
|
1502
1502
|
Fn[s.weight],
|
|
1503
|
-
|
|
1503
|
+
Dn[s.align]
|
|
1504
1504
|
].join(" ");
|
|
1505
|
-
}, Jt = /^[A-Za-z_$][\w$]*(\.[\w$]+)+$/,
|
|
1505
|
+
}, Jt = /^[A-Za-z_$][\w$]*(\.[\w$]+)+$/, jn = /^[A-Za-z_$][\w$]*$/, Nn = /* @__PURE__ */ new Set([
|
|
1506
1506
|
"await",
|
|
1507
1507
|
"break",
|
|
1508
1508
|
"case",
|
|
@@ -1543,7 +1543,7 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
1543
1543
|
"while",
|
|
1544
1544
|
"with",
|
|
1545
1545
|
"yield"
|
|
1546
|
-
]),
|
|
1546
|
+
]), yt = 10, Ge = 4, bt = ["a", "b", "c", "d"], Pn = (e) => jn.test(e) && !Nn.has(e), qt = (e, s) => {
|
|
1547
1547
|
try {
|
|
1548
1548
|
const a = Object.keys(s).filter(Pn), l = a.map((o) => s[o]);
|
|
1549
1549
|
return new Function(...a, `"use strict"; return (${e});`)(...l);
|
|
@@ -1574,13 +1574,13 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
1574
1574
|
scale: (s, a = 1, l = 0) => Qe(s) * a + l,
|
|
1575
1575
|
round: (s, a = 0) => Number(Qe(s).toFixed(a)),
|
|
1576
1576
|
clamp: (s, a, l) => Math.min(l, Math.max(a, Qe(s)))
|
|
1577
|
-
}),
|
|
1577
|
+
}), hd = (e, s, a) => {
|
|
1578
1578
|
const l = { ...At(s), ...a };
|
|
1579
1579
|
return e.slice(0, Ge).map((t) => st(at(t, l, s)));
|
|
1580
1580
|
}, Wn = (e, s, a, l) => {
|
|
1581
1581
|
const t = { ...At(a), ...l };
|
|
1582
1582
|
s.slice(0, Ge).forEach((d, m) => {
|
|
1583
|
-
t[
|
|
1583
|
+
t[bt[m]] = st(at(d, t, a));
|
|
1584
1584
|
});
|
|
1585
1585
|
let o = st(at(e.value, t, a));
|
|
1586
1586
|
o === void 0 && (o = t.a), t.v = o, t.a = t.a ?? o;
|
|
@@ -1603,8 +1603,8 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
1603
1603
|
...Object.keys(s.metrics ?? {})
|
|
1604
1604
|
]), o = {};
|
|
1605
1605
|
for (const c of t) {
|
|
1606
|
-
const u = ((i = s.metrics) == null ? void 0 : i[c]) ?? ((d = e.metrics) == null ? void 0 : d[c]) ?? [],
|
|
1607
|
-
o[c] = u.slice(0,
|
|
1606
|
+
const u = ((i = s.metrics) == null ? void 0 : i[c]) ?? ((d = e.metrics) == null ? void 0 : d[c]) ?? [], h = ((m = s.metricArgs) == null ? void 0 : m[c]) ?? ((r = e.metricArgs) == null ? void 0 : r[c]) ?? [];
|
|
1607
|
+
o[c] = u.slice(0, yt).map((k) => Wn(k, h, a, l));
|
|
1608
1608
|
}
|
|
1609
1609
|
return o;
|
|
1610
1610
|
}, Et = (e, s, a) => {
|
|
@@ -1630,7 +1630,7 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
1630
1630
|
return (t, o) => (f(), g("div", Gn, [
|
|
1631
1631
|
n("div", Jn, [
|
|
1632
1632
|
n("div", qn, [
|
|
1633
|
-
|
|
1633
|
+
p(ie, {
|
|
1634
1634
|
active: "",
|
|
1635
1635
|
"hide-message": "",
|
|
1636
1636
|
"model-value": e.metric.label,
|
|
@@ -1638,30 +1638,30 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
1638
1638
|
"onUpdate:modelValue": o[0] || (o[0] = (i) => a("change", { label: i }))
|
|
1639
1639
|
}, null, 8, ["model-value"])
|
|
1640
1640
|
]),
|
|
1641
|
-
|
|
1641
|
+
p(R, {
|
|
1642
1642
|
type: "icon",
|
|
1643
1643
|
size: "sm",
|
|
1644
1644
|
"aria-label": "Стиль показателя",
|
|
1645
1645
|
title: "Стиль показателя",
|
|
1646
1646
|
onClick: o[1] || (o[1] = (i) => a("open-style"))
|
|
1647
1647
|
}, {
|
|
1648
|
-
default:
|
|
1649
|
-
|
|
1648
|
+
default: x(() => [
|
|
1649
|
+
p(V, {
|
|
1650
1650
|
name: "palette",
|
|
1651
1651
|
size: 18
|
|
1652
1652
|
})
|
|
1653
1653
|
]),
|
|
1654
1654
|
_: 1
|
|
1655
1655
|
}),
|
|
1656
|
-
|
|
1656
|
+
p(R, {
|
|
1657
1657
|
type: "icon",
|
|
1658
1658
|
size: "sm",
|
|
1659
1659
|
"aria-label": "Удалить показатель",
|
|
1660
1660
|
title: "Удалить показатель",
|
|
1661
1661
|
onClick: o[2] || (o[2] = (i) => a("remove"))
|
|
1662
1662
|
}, {
|
|
1663
|
-
default:
|
|
1664
|
-
|
|
1663
|
+
default: x(() => [
|
|
1664
|
+
p(V, {
|
|
1665
1665
|
name: "trash",
|
|
1666
1666
|
size: 14
|
|
1667
1667
|
})
|
|
@@ -1675,26 +1675,26 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
1675
1675
|
onDragstart: o[3] || (o[3] = (i) => a("dragstart", i, e.index)),
|
|
1676
1676
|
onDragend: o[4] || (o[4] = (i) => a("dragend"))
|
|
1677
1677
|
}, [
|
|
1678
|
-
|
|
1678
|
+
p(V, {
|
|
1679
1679
|
name: "grip",
|
|
1680
1680
|
size: 16
|
|
1681
1681
|
})
|
|
1682
1682
|
], 32)
|
|
1683
1683
|
]),
|
|
1684
1684
|
n("div", Xn, [
|
|
1685
|
-
|
|
1685
|
+
p(He, {
|
|
1686
1686
|
value: e.metric.value,
|
|
1687
1687
|
args: e.args,
|
|
1688
|
-
params: [...J(
|
|
1688
|
+
params: [...J(bt)],
|
|
1689
1689
|
label: "Значение",
|
|
1690
1690
|
onIcon: o[5] || (o[5] = (i) => a("toggle-field", "value")),
|
|
1691
1691
|
onChange: o[6] || (o[6] = (i) => a("change", { value: i })),
|
|
1692
1692
|
onHover: l
|
|
1693
1693
|
}, null, 8, ["value", "args", "params"]),
|
|
1694
|
-
|
|
1694
|
+
p(He, {
|
|
1695
1695
|
value: e.metric.format,
|
|
1696
1696
|
args: e.args,
|
|
1697
|
-
params: [...J(
|
|
1697
|
+
params: [...J(bt)],
|
|
1698
1698
|
prefix: ["v"],
|
|
1699
1699
|
label: "Формат",
|
|
1700
1700
|
onIcon: o[7] || (o[7] = (i) => a("toggle-field", "format")),
|
|
@@ -1713,61 +1713,61 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
1713
1713
|
},
|
|
1714
1714
|
emits: ["close", "update"],
|
|
1715
1715
|
setup(e, { emit: s }) {
|
|
1716
|
-
const a = s, l = S(() => ({ ...zt, ...e.style })), t = (
|
|
1716
|
+
const a = s, l = S(() => ({ ...zt, ...e.style })), t = (v, y) => {
|
|
1717
1717
|
var z;
|
|
1718
|
-
return ((z =
|
|
1719
|
-
}, o = S(() => t(Mt, l.value.size)), i = S(() => t(Ot, l.value.color)), d = S(() => t(Ft, l.value.weight)), m = S(() => t(
|
|
1720
|
-
a("update", { ...l.value, ...
|
|
1721
|
-
}, c = (
|
|
1722
|
-
return (
|
|
1718
|
+
return ((z = v.find((j) => j.value === y)) == null ? void 0 : z.name) ?? "";
|
|
1719
|
+
}, o = S(() => t(Mt, l.value.size)), i = S(() => t(Ot, l.value.color)), d = S(() => t(Ft, l.value.weight)), m = S(() => t(Dt, l.value.align)), r = (v) => {
|
|
1720
|
+
a("update", { ...l.value, ...v });
|
|
1721
|
+
}, c = (v) => r({ size: v.value }), u = (v) => r({ color: v.value }), h = (v) => r({ weight: v.value }), k = (v) => r({ align: v.value });
|
|
1722
|
+
return (v, y) => (f(), M(ze, {
|
|
1723
1723
|
title: "Стиль показателя",
|
|
1724
1724
|
size: "md",
|
|
1725
|
-
onClose:
|
|
1725
|
+
onClose: y[1] || (y[1] = (z) => a("close"))
|
|
1726
1726
|
}, {
|
|
1727
|
-
default:
|
|
1727
|
+
default: x(() => [
|
|
1728
1728
|
n("div", Zn, [
|
|
1729
1729
|
n("p", Qn, [
|
|
1730
|
-
|
|
1730
|
+
y[2] || (y[2] = L(" Показатель: ", -1)),
|
|
1731
1731
|
n("span", el, C(e.label), 1)
|
|
1732
1732
|
]),
|
|
1733
1733
|
n("div", tl, [
|
|
1734
|
-
|
|
1734
|
+
y[3] || (y[3] = n("span", { class: "block text-xs text-gray-dark-25 dark:text-gray-main" }, "Предпросмотр", -1)),
|
|
1735
1735
|
n("span", {
|
|
1736
|
-
class: B(["mt-1 block whitespace-pre", J(
|
|
1736
|
+
class: B(["mt-1 block whitespace-pre", J(ht)(l.value)])
|
|
1737
1737
|
}, C(e.preview || "1 234 кВт·ч"), 3)
|
|
1738
1738
|
]),
|
|
1739
1739
|
n("div", al, [
|
|
1740
|
-
|
|
1740
|
+
p(he, {
|
|
1741
1741
|
"model-value": o.value,
|
|
1742
1742
|
items: J(Mt),
|
|
1743
1743
|
label: "Размер",
|
|
1744
1744
|
onChange: c
|
|
1745
1745
|
}, null, 8, ["model-value", "items"]),
|
|
1746
|
-
|
|
1746
|
+
p(he, {
|
|
1747
1747
|
"model-value": i.value,
|
|
1748
1748
|
items: J(Ot),
|
|
1749
1749
|
label: "Цвет",
|
|
1750
1750
|
onChange: u
|
|
1751
1751
|
}, null, 8, ["model-value", "items"]),
|
|
1752
|
-
|
|
1752
|
+
p(he, {
|
|
1753
1753
|
"model-value": d.value,
|
|
1754
1754
|
items: J(Ft),
|
|
1755
1755
|
label: "Начертание",
|
|
1756
|
-
onChange:
|
|
1756
|
+
onChange: h
|
|
1757
1757
|
}, null, 8, ["model-value", "items"]),
|
|
1758
|
-
|
|
1758
|
+
p(he, {
|
|
1759
1759
|
"model-value": m.value,
|
|
1760
|
-
items: J(
|
|
1760
|
+
items: J(Dt),
|
|
1761
1761
|
label: "Выравнивание",
|
|
1762
1762
|
onChange: k
|
|
1763
1763
|
}, null, 8, ["model-value", "items"])
|
|
1764
1764
|
]),
|
|
1765
1765
|
n("div", sl, [
|
|
1766
|
-
|
|
1766
|
+
p(R, {
|
|
1767
1767
|
color: "blue",
|
|
1768
|
-
onClick:
|
|
1768
|
+
onClick: y[0] || (y[0] = (z) => a("close"))
|
|
1769
1769
|
}, {
|
|
1770
|
-
default:
|
|
1770
|
+
default: x(() => [...y[4] || (y[4] = [
|
|
1771
1771
|
L("Готово", -1)
|
|
1772
1772
|
])]),
|
|
1773
1773
|
_: 1
|
|
@@ -1836,144 +1836,144 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
1836
1836
|
{ value: "reverse", name: "Обратное" },
|
|
1837
1837
|
{ value: "idle", name: "Нет потока" }
|
|
1838
1838
|
]
|
|
1839
|
-
}, o = (
|
|
1840
|
-
const $ = JSON.parse(JSON.stringify(
|
|
1839
|
+
}, o = (b) => {
|
|
1840
|
+
const $ = JSON.parse(JSON.stringify(b));
|
|
1841
1841
|
$.metricArgs = { ...$.metricArgs ?? {} }, $.metrics = { ...$.metrics ?? {} };
|
|
1842
1842
|
for (const [_, W] of Object.entries(e.definition.metrics ?? {}))
|
|
1843
1843
|
$.metrics[_] || ($.metrics[_] = JSON.parse(JSON.stringify(W)));
|
|
1844
1844
|
return $;
|
|
1845
|
-
}, i = F(o(e.config)), d = F("general"), m = F(!1), r = F(!1), c = F(null), u = F(null),
|
|
1845
|
+
}, i = F(o(e.config)), d = F("general"), m = F(!1), r = F(!1), c = F(null), u = F(null), h = F(null), k = F(null), v = F(null), y = F(null);
|
|
1846
1846
|
let z = JSON.stringify(i.value), j = null;
|
|
1847
|
-
const H = S(() => Et(e.definition, i.value, e.context)),
|
|
1848
|
-
() => l.map((
|
|
1849
|
-
...
|
|
1850
|
-
count: e.definition.fields.filter(($) => ($.block ?? "general") ===
|
|
1851
|
-
})).filter((
|
|
1852
|
-
), w = S(() => Object.keys(e.definition.metrics ?? {})), A = S(() => w.value.includes(d.value)), P = S(() => e.definition.fields.filter((
|
|
1853
|
-
const
|
|
1854
|
-
return
|
|
1855
|
-
}),
|
|
1856
|
-
var
|
|
1857
|
-
return ((
|
|
1858
|
-
}),
|
|
1859
|
-
re.value && Se(re.value,
|
|
1860
|
-
},
|
|
1861
|
-
var
|
|
1862
|
-
return A.value ? ((
|
|
1847
|
+
const H = S(() => Et(e.definition, i.value, e.context)), N = S(() => H.value.metrics ?? {}), Z = S(
|
|
1848
|
+
() => l.map((b) => ({
|
|
1849
|
+
...b,
|
|
1850
|
+
count: e.definition.fields.filter(($) => ($.block ?? "general") === b.key).length
|
|
1851
|
+
})).filter((b) => b.count > 0)
|
|
1852
|
+
), w = S(() => Object.keys(e.definition.metrics ?? {})), A = S(() => w.value.includes(d.value)), P = S(() => e.definition.fields.filter((b) => (b.block ?? "general") === d.value && !b.formatFor)), ae = S(() => P.value.find((b) => b.key.endsWith("Title"))), xe = S(() => d.value === "general"), re = S(() => P.value.find((b) => b.key === `${d.value}Flow`)), qe = S(() => t[d.value] ?? []), dt = S(() => {
|
|
1853
|
+
const b = re.value;
|
|
1854
|
+
return b ? Ae(b) || String(b.default ?? "") : "";
|
|
1855
|
+
}), Le = S(() => {
|
|
1856
|
+
var b;
|
|
1857
|
+
return ((b = qe.value.find(($) => $.value === dt.value)) == null ? void 0 : b.name) ?? "";
|
|
1858
|
+
}), Me = (b) => {
|
|
1859
|
+
re.value && Se(re.value, b.value);
|
|
1860
|
+
}, Oe = S(() => xe.value ? P.value : []), ee = S(() => {
|
|
1861
|
+
var b;
|
|
1862
|
+
return A.value ? ((b = i.value.metricArgs) == null ? void 0 : b[d.value]) ?? [] : [];
|
|
1863
1863
|
}), de = S(() => {
|
|
1864
|
-
var
|
|
1865
|
-
return A.value ? ((
|
|
1864
|
+
var b;
|
|
1865
|
+
return A.value ? ((b = i.value.metrics) == null ? void 0 : b[d.value]) ?? [] : [];
|
|
1866
1866
|
});
|
|
1867
|
-
ye(Z, (
|
|
1868
|
-
|
|
1867
|
+
ye(Z, (b) => {
|
|
1868
|
+
b.length && !b.some(($) => $.key === d.value) && (d.value = b[0].key);
|
|
1869
1869
|
});
|
|
1870
|
-
const
|
|
1871
|
-
if (
|
|
1870
|
+
const ct = (b) => {
|
|
1871
|
+
if (b.startsWith('"') && b.endsWith('"'))
|
|
1872
1872
|
try {
|
|
1873
|
-
const $ = JSON.parse(
|
|
1874
|
-
return typeof $ == "string" ? $ :
|
|
1873
|
+
const $ = JSON.parse(b);
|
|
1874
|
+
return typeof $ == "string" ? $ : b;
|
|
1875
1875
|
} catch {
|
|
1876
|
-
return
|
|
1876
|
+
return b;
|
|
1877
1877
|
}
|
|
1878
|
-
return
|
|
1879
|
-
}, Ae = (
|
|
1880
|
-
const $ = i.value.bindings[
|
|
1881
|
-
return typeof $ != "string" ?
|
|
1882
|
-
}, Se = (
|
|
1878
|
+
return b.startsWith("'") && b.endsWith("'") ? b.slice(1, -1) : b;
|
|
1879
|
+
}, Ae = (b) => {
|
|
1880
|
+
const $ = i.value.bindings[b.key];
|
|
1881
|
+
return typeof $ != "string" ? b.plain ? String(b.default ?? "") : "" : b.plain ? ct($) : $;
|
|
1882
|
+
}, Se = (b, $) => {
|
|
1883
1883
|
if (!$.trim()) {
|
|
1884
|
-
delete i.value.bindings[
|
|
1884
|
+
delete i.value.bindings[b.key];
|
|
1885
1885
|
return;
|
|
1886
1886
|
}
|
|
1887
|
-
i.value.bindings[
|
|
1888
|
-
},
|
|
1889
|
-
const $ =
|
|
1887
|
+
i.value.bindings[b.key] = b.plain ? JSON.stringify($) : $;
|
|
1888
|
+
}, Fe = (b) => e.definition.fields.find(($) => $.formatFor === b.key), q = (b) => {
|
|
1889
|
+
const $ = Fe(b);
|
|
1890
1890
|
return $ ? Ae($) : "";
|
|
1891
|
-
}, X = (
|
|
1892
|
-
const _ =
|
|
1891
|
+
}, X = (b, $) => {
|
|
1892
|
+
const _ = Fe(b);
|
|
1893
1893
|
_ && Se(_, $);
|
|
1894
|
-
}, E = (
|
|
1895
|
-
const $ = H.value[
|
|
1894
|
+
}, E = (b) => {
|
|
1895
|
+
const $ = H.value[b];
|
|
1896
1896
|
return $ === void 0 ? "—" : typeof $ == "boolean" ? $ ? "да" : "нет" : String($);
|
|
1897
|
-
},
|
|
1897
|
+
}, K = (b) => `v + ' ${b.unit ?? "ед."}'`, ve = () => {
|
|
1898
1898
|
j && (clearTimeout(j), j = null);
|
|
1899
|
-
const
|
|
1900
|
-
$ !== z && (z = $, a("update:config",
|
|
1899
|
+
const b = o(i.value), $ = JSON.stringify(b);
|
|
1900
|
+
$ !== z && (z = $, a("update:config", b));
|
|
1901
1901
|
};
|
|
1902
1902
|
ye(i, () => {
|
|
1903
1903
|
j && clearTimeout(j), j = setTimeout(ve, 500);
|
|
1904
1904
|
}, { deep: !0 });
|
|
1905
1905
|
const Ue = () => {
|
|
1906
1906
|
ve(), a("close");
|
|
1907
|
-
}, Ke = (
|
|
1908
|
-
c.value = { kind: "field", key:
|
|
1909
|
-
}, Xe = (
|
|
1910
|
-
A.value && (
|
|
1911
|
-
},
|
|
1907
|
+
}, Ke = (b) => {
|
|
1908
|
+
c.value = { kind: "field", key: b }, r.value = !0;
|
|
1909
|
+
}, Xe = (b) => {
|
|
1910
|
+
A.value && (ee.value.length >= Ge || (c.value = { kind: "groupArg", argIndex: ee.value.length }, r.value = !0));
|
|
1911
|
+
}, ut = ({ path: b }) => {
|
|
1912
1912
|
const $ = c.value;
|
|
1913
1913
|
if (!$) return;
|
|
1914
1914
|
if (r.value = !1, $.kind === "field") {
|
|
1915
1915
|
const W = e.definition.fields.find((ce) => ce.key === $.key);
|
|
1916
|
-
W && Se(W,
|
|
1916
|
+
W && Se(W, b);
|
|
1917
1917
|
return;
|
|
1918
1918
|
}
|
|
1919
|
-
const _ = [...
|
|
1920
|
-
_[$.argIndex] =
|
|
1919
|
+
const _ = [...ee.value];
|
|
1920
|
+
_[$.argIndex] = b, i.value.metricArgs = {
|
|
1921
1921
|
...i.value.metricArgs ?? {},
|
|
1922
1922
|
[d.value]: _.slice(0, Ge)
|
|
1923
1923
|
};
|
|
1924
|
-
}, me = (
|
|
1924
|
+
}, me = (b) => {
|
|
1925
1925
|
i.value.metricArgs = {
|
|
1926
1926
|
...i.value.metricArgs ?? {},
|
|
1927
|
-
[d.value]:
|
|
1927
|
+
[d.value]: ee.value.filter(($, _) => _ !== b)
|
|
1928
1928
|
};
|
|
1929
|
-
}, _e = (
|
|
1930
|
-
|
|
1929
|
+
}, _e = (b, $) => {
|
|
1930
|
+
h.value = b === "enter" ? $ : null;
|
|
1931
1931
|
}, G = () => `metric-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 6)}`, Te = () => {
|
|
1932
1932
|
var $;
|
|
1933
|
-
const
|
|
1934
|
-
!A.value || !
|
|
1935
|
-
}, we = (
|
|
1933
|
+
const b = ($ = i.value.metrics) == null ? void 0 : $[d.value];
|
|
1934
|
+
!A.value || !b || b.length >= yt || b.push({ id: G(), label: "Показатель", value: "", format: "" });
|
|
1935
|
+
}, we = (b) => {
|
|
1936
1936
|
var _;
|
|
1937
1937
|
const $ = (_ = i.value.metrics) == null ? void 0 : _[d.value];
|
|
1938
1938
|
$ && (i.value.metrics = {
|
|
1939
1939
|
...i.value.metrics ?? {},
|
|
1940
|
-
[d.value]: $.filter((W) => W.id !==
|
|
1940
|
+
[d.value]: $.filter((W) => W.id !== b)
|
|
1941
1941
|
});
|
|
1942
|
-
}, fe = (
|
|
1942
|
+
}, fe = (b, $) => {
|
|
1943
1943
|
if ($ === "value") {
|
|
1944
|
-
Ze(
|
|
1944
|
+
Ze(b, { value: b.value ? "" : "a" });
|
|
1945
1945
|
return;
|
|
1946
1946
|
}
|
|
1947
|
-
Ze(
|
|
1948
|
-
}, ge = (
|
|
1949
|
-
u.value =
|
|
1950
|
-
},
|
|
1951
|
-
u.value && Ze(u.value, { style:
|
|
1952
|
-
}, te = (
|
|
1953
|
-
|
|
1954
|
-
}, Ye = (
|
|
1955
|
-
|
|
1956
|
-
},
|
|
1957
|
-
const $ =
|
|
1958
|
-
if (
|
|
1947
|
+
Ze(b, { format: b.format ? "" : "v" });
|
|
1948
|
+
}, ge = (b) => {
|
|
1949
|
+
u.value = b;
|
|
1950
|
+
}, le = (b) => {
|
|
1951
|
+
u.value && Ze(u.value, { style: b });
|
|
1952
|
+
}, te = (b, $) => {
|
|
1953
|
+
v.value = $, b.dataTransfer && (b.dataTransfer.effectAllowed = "move", b.dataTransfer.setData("text/plain", String($)));
|
|
1954
|
+
}, Ye = (b) => {
|
|
1955
|
+
v.value !== null && (y.value = b);
|
|
1956
|
+
}, mt = (b) => {
|
|
1957
|
+
const $ = v.value;
|
|
1958
|
+
if (v.value = null, y.value = null, $ === null || $ === b) return;
|
|
1959
1959
|
const _ = [...de.value], [W] = _.splice($, 1);
|
|
1960
|
-
_.splice(
|
|
1960
|
+
_.splice(b, 0, W), i.value.metrics = { ...i.value.metrics ?? {}, [d.value]: _ };
|
|
1961
1961
|
}, ra = () => {
|
|
1962
|
-
|
|
1963
|
-
}, da = (
|
|
1962
|
+
v.value = null, y.value = null;
|
|
1963
|
+
}, da = (b) => {
|
|
1964
1964
|
var $, _;
|
|
1965
|
-
return ((_ = ($ =
|
|
1966
|
-
}, Ze = (
|
|
1967
|
-
Object.assign(
|
|
1965
|
+
return ((_ = ($ = N.value[d.value]) == null ? void 0 : $.find((W) => W.id === b.id)) == null ? void 0 : _.value) ?? "";
|
|
1966
|
+
}, Ze = (b, $) => {
|
|
1967
|
+
Object.assign(b, $);
|
|
1968
1968
|
}, ca = () => {
|
|
1969
|
-
const
|
|
1969
|
+
const b = JSON.stringify(i.value, null, 2), $ = new Blob([b], { type: "application/json" }), _ = URL.createObjectURL($), W = document.createElement("a");
|
|
1970
1970
|
W.href = _, W.download = `${e.definition.type}.json`, W.click(), URL.revokeObjectURL(_);
|
|
1971
1971
|
}, ua = () => {
|
|
1972
|
-
var
|
|
1973
|
-
return (
|
|
1974
|
-
}, It = (
|
|
1972
|
+
var b;
|
|
1973
|
+
return (b = k.value) == null ? void 0 : b.click();
|
|
1974
|
+
}, It = (b) => typeof b == "object" && b !== null && !Array.isArray(b), ma = async (b) => {
|
|
1975
1975
|
var W;
|
|
1976
|
-
const $ =
|
|
1976
|
+
const $ = b.target, _ = (W = $.files) == null ? void 0 : W[0];
|
|
1977
1977
|
if (_)
|
|
1978
1978
|
try {
|
|
1979
1979
|
const ce = JSON.parse(await _.text());
|
|
@@ -1988,52 +1988,52 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
1988
1988
|
$.value = "";
|
|
1989
1989
|
}
|
|
1990
1990
|
};
|
|
1991
|
-
return
|
|
1991
|
+
return Pe(ve), (b, $) => (f(), M(ze, {
|
|
1992
1992
|
title: "Настройка блока",
|
|
1993
1993
|
size: "lg",
|
|
1994
1994
|
onClose: Ue
|
|
1995
1995
|
}, {
|
|
1996
|
-
"header-btn":
|
|
1996
|
+
"header-btn": x(() => [
|
|
1997
1997
|
n("div", ll, [
|
|
1998
|
-
|
|
1998
|
+
p(R, {
|
|
1999
1999
|
type: "icon",
|
|
2000
2000
|
size: "sm",
|
|
2001
2001
|
"aria-label": "Справка",
|
|
2002
2002
|
title: "Справка",
|
|
2003
2003
|
onClick: $[0] || ($[0] = (_) => m.value = !0)
|
|
2004
2004
|
}, {
|
|
2005
|
-
default:
|
|
2006
|
-
|
|
2005
|
+
default: x(() => [
|
|
2006
|
+
p(V, {
|
|
2007
2007
|
name: "help",
|
|
2008
2008
|
size: 16
|
|
2009
2009
|
})
|
|
2010
2010
|
]),
|
|
2011
2011
|
_: 1
|
|
2012
2012
|
}),
|
|
2013
|
-
|
|
2013
|
+
p(R, {
|
|
2014
2014
|
type: "icon",
|
|
2015
2015
|
size: "sm",
|
|
2016
2016
|
"aria-label": "Импорт",
|
|
2017
2017
|
title: "Импорт",
|
|
2018
2018
|
onClick: ua
|
|
2019
2019
|
}, {
|
|
2020
|
-
default:
|
|
2021
|
-
|
|
2020
|
+
default: x(() => [
|
|
2021
|
+
p(V, {
|
|
2022
2022
|
name: "upload",
|
|
2023
2023
|
size: 16
|
|
2024
2024
|
})
|
|
2025
2025
|
]),
|
|
2026
2026
|
_: 1
|
|
2027
2027
|
}),
|
|
2028
|
-
|
|
2028
|
+
p(R, {
|
|
2029
2029
|
type: "icon",
|
|
2030
2030
|
size: "sm",
|
|
2031
2031
|
"aria-label": "Экспорт",
|
|
2032
2032
|
title: "Экспорт",
|
|
2033
2033
|
onClick: ca
|
|
2034
2034
|
}, {
|
|
2035
|
-
default:
|
|
2036
|
-
|
|
2035
|
+
default: x(() => [
|
|
2036
|
+
p(V, {
|
|
2037
2037
|
name: "download",
|
|
2038
2038
|
size: 16
|
|
2039
2039
|
})
|
|
@@ -2042,7 +2042,7 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
2042
2042
|
})
|
|
2043
2043
|
])
|
|
2044
2044
|
]),
|
|
2045
|
-
default:
|
|
2045
|
+
default: x(() => [
|
|
2046
2046
|
n("input", {
|
|
2047
2047
|
ref_key: "fileInput",
|
|
2048
2048
|
ref: k,
|
|
@@ -2053,14 +2053,14 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
2053
2053
|
}, null, 544),
|
|
2054
2054
|
n("div", ol, [
|
|
2055
2055
|
n("nav", il, [
|
|
2056
|
-
(f(!0), g(
|
|
2056
|
+
(f(!0), g(D, null, U(Z.value, (_) => (f(), g("button", {
|
|
2057
2057
|
key: _.key,
|
|
2058
2058
|
type: "button",
|
|
2059
2059
|
class: B(["flex items-center gap-2 rounded-md px-3 py-2 text-left transition", d.value === _.key ? "bg-cyan-main/10 text-cyan-main" : "hover:bg-white/5"]),
|
|
2060
2060
|
onClick: (W) => d.value = _.key
|
|
2061
2061
|
}, [
|
|
2062
2062
|
n("span", dl, [
|
|
2063
|
-
|
|
2063
|
+
p(V, {
|
|
2064
2064
|
name: _.icon,
|
|
2065
2065
|
size: 16
|
|
2066
2066
|
}, null, 8, ["name"])
|
|
@@ -2070,56 +2070,56 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
2070
2070
|
], 10, rl))), 128))
|
|
2071
2071
|
]),
|
|
2072
2072
|
n("div", ml, [
|
|
2073
|
-
xe.value ? (f(!0), g(
|
|
2073
|
+
xe.value ? (f(!0), g(D, { key: 0 }, U(Oe.value, (_) => (f(), M(Lt, {
|
|
2074
2074
|
key: _.key,
|
|
2075
2075
|
field: _,
|
|
2076
2076
|
"model-value": Ae(_),
|
|
2077
2077
|
"format-value": q(_),
|
|
2078
|
-
"has-format": !!
|
|
2078
|
+
"has-format": !!Fe(_),
|
|
2079
2079
|
placeholder: E(_.previewKey ?? _.key),
|
|
2080
|
-
"placeholder-format":
|
|
2080
|
+
"placeholder-format": K(_),
|
|
2081
2081
|
"show-reset": !1,
|
|
2082
2082
|
"onUpdate:modelValue": (W) => Se(_, W),
|
|
2083
2083
|
"onUpdate:format": (W) => X(_, W),
|
|
2084
2084
|
onPick: (W) => Ke(_.key)
|
|
2085
|
-
}, null, 8, ["field", "model-value", "format-value", "has-format", "placeholder", "placeholder-format", "onUpdate:modelValue", "onUpdate:format", "onPick"]))), 128)) : (f(), g(
|
|
2085
|
+
}, null, 8, ["field", "model-value", "format-value", "has-format", "placeholder", "placeholder-format", "onUpdate:modelValue", "onUpdate:format", "onPick"]))), 128)) : (f(), g(D, { key: 1 }, [
|
|
2086
2086
|
ae.value ? (f(), M(Lt, {
|
|
2087
2087
|
key: 0,
|
|
2088
2088
|
field: ae.value,
|
|
2089
2089
|
"model-value": Ae(ae.value),
|
|
2090
2090
|
"format-value": q(ae.value),
|
|
2091
|
-
"has-format": !!
|
|
2091
|
+
"has-format": !!Fe(ae.value),
|
|
2092
2092
|
placeholder: E(ae.value.previewKey ?? ae.value.key),
|
|
2093
|
-
"placeholder-format":
|
|
2093
|
+
"placeholder-format": K(ae.value),
|
|
2094
2094
|
"show-reset": !1,
|
|
2095
2095
|
"onUpdate:modelValue": $[1] || ($[1] = (_) => Se(ae.value, _)),
|
|
2096
2096
|
"onUpdate:format": $[2] || ($[2] = (_) => X(ae.value, _)),
|
|
2097
2097
|
onPick: $[3] || ($[3] = (_) => Ke(ae.value.key))
|
|
2098
2098
|
}, null, 8, ["field", "model-value", "format-value", "has-format", "placeholder", "placeholder-format"])) : T("", !0),
|
|
2099
2099
|
A.value ? (f(), g("section", fl, [
|
|
2100
|
-
|
|
2101
|
-
active: !!
|
|
2102
|
-
"icon-disabled":
|
|
2100
|
+
p(Tt, {
|
|
2101
|
+
active: !!ee.value.length,
|
|
2102
|
+
"icon-disabled": ee.value.length >= J(Ge),
|
|
2103
2103
|
label: "Аргументы",
|
|
2104
2104
|
"icon-label": "Добавить аргумент",
|
|
2105
2105
|
onIcon: $[4] || ($[4] = (_) => Xe())
|
|
2106
2106
|
}, {
|
|
2107
|
-
default:
|
|
2108
|
-
|
|
2109
|
-
(f(!0), g(
|
|
2107
|
+
default: x(() => [
|
|
2108
|
+
ee.value.length ? (f(), g("div", gl, [
|
|
2109
|
+
(f(!0), g(D, null, U(ee.value, (_, W) => (f(), g("div", {
|
|
2110
2110
|
key: _,
|
|
2111
2111
|
class: "flex items-center rounded-full bg-gray-light-10 dark:bg-gray-dark-40/50 px-2 py-1 text-xs"
|
|
2112
2112
|
}, [
|
|
2113
2113
|
n("div", vl, [
|
|
2114
2114
|
n("span", pl, C(_), 1)
|
|
2115
2115
|
]),
|
|
2116
|
-
W ||
|
|
2116
|
+
W || ee.value.length < 2 ? (f(), g("button", {
|
|
2117
2117
|
key: 0,
|
|
2118
2118
|
type: "button",
|
|
2119
2119
|
class: "ms-1 shrink-0 cursor-pointer text-gray-main transition hover:text-rose-500",
|
|
2120
2120
|
onClick: (ce) => me(W)
|
|
2121
2121
|
}, [
|
|
2122
|
-
|
|
2122
|
+
p(V, {
|
|
2123
2123
|
name: "close",
|
|
2124
2124
|
class: "size-5"
|
|
2125
2125
|
})
|
|
@@ -2133,16 +2133,16 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
2133
2133
|
A.value ? (f(), g("section", yl, [
|
|
2134
2134
|
n("div", bl, [
|
|
2135
2135
|
$[8] || ($[8] = n("h4", { class: "text-sm font-semibold" }, "Показатели", -1)),
|
|
2136
|
-
|
|
2136
|
+
p(R, {
|
|
2137
2137
|
type: "icon",
|
|
2138
2138
|
size: "sm",
|
|
2139
2139
|
"aria-label": "Добавить показатель",
|
|
2140
2140
|
title: "Добавить показатель",
|
|
2141
|
-
disabled: de.value.length >= J(
|
|
2141
|
+
disabled: de.value.length >= J(yt),
|
|
2142
2142
|
onClick: Te
|
|
2143
2143
|
}, {
|
|
2144
|
-
default:
|
|
2145
|
-
|
|
2144
|
+
default: x(() => [
|
|
2145
|
+
p(V, {
|
|
2146
2146
|
name: "add",
|
|
2147
2147
|
size: 14
|
|
2148
2148
|
})
|
|
@@ -2151,16 +2151,16 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
2151
2151
|
}, 8, ["disabled"])
|
|
2152
2152
|
]),
|
|
2153
2153
|
de.value.length ? (f(), g("div", kl, [
|
|
2154
|
-
(f(!0), g(
|
|
2154
|
+
(f(!0), g(D, null, U(de.value, (_, W) => (f(), g("div", {
|
|
2155
2155
|
key: _.id,
|
|
2156
|
-
class: B(["rounded-xl transition", { "ring-1 ring-cyan-main/50":
|
|
2157
|
-
onDragover:
|
|
2158
|
-
onDrop:
|
|
2156
|
+
class: B(["rounded-xl transition", { "ring-1 ring-cyan-main/50": y.value === W }]),
|
|
2157
|
+
onDragover: Q((ce) => Ye(W), ["prevent"]),
|
|
2158
|
+
onDrop: Q((ce) => mt(W), ["prevent"])
|
|
2159
2159
|
}, [
|
|
2160
|
-
|
|
2160
|
+
p(Yn, {
|
|
2161
2161
|
metric: _,
|
|
2162
2162
|
index: W,
|
|
2163
|
-
args:
|
|
2163
|
+
args: ee.value,
|
|
2164
2164
|
onRemove: (ce) => we(_.id),
|
|
2165
2165
|
onOpenStyle: (ce) => ge(_),
|
|
2166
2166
|
onToggleField: (ce) => fe(_, ce),
|
|
@@ -2173,11 +2173,11 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
2173
2173
|
])) : (f(), g("p", xl, "Показателей нет. Добавьте первый."))
|
|
2174
2174
|
])) : T("", !0),
|
|
2175
2175
|
re.value ? (f(), g("div", wl, [
|
|
2176
|
-
|
|
2177
|
-
"model-value":
|
|
2176
|
+
p(he, {
|
|
2177
|
+
"model-value": Le.value,
|
|
2178
2178
|
items: qe.value,
|
|
2179
2179
|
label: "Направление",
|
|
2180
|
-
onChange:
|
|
2180
|
+
onChange: Me
|
|
2181
2181
|
}, null, 8, ["model-value", "items"])
|
|
2182
2182
|
])) : T("", !0)
|
|
2183
2183
|
], 64))
|
|
@@ -2186,9 +2186,9 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
2186
2186
|
u.value ? (f(), M(nl, {
|
|
2187
2187
|
key: 0,
|
|
2188
2188
|
label: u.value.label,
|
|
2189
|
-
style:
|
|
2189
|
+
style: Ve(u.value.style),
|
|
2190
2190
|
preview: da(u.value),
|
|
2191
|
-
onUpdate:
|
|
2191
|
+
onUpdate: le,
|
|
2192
2192
|
onClose: $[5] || ($[5] = (_) => u.value = null)
|
|
2193
2193
|
}, null, 8, ["label", "style", "preview"])) : T("", !0),
|
|
2194
2194
|
r.value ? (f(), M(ze, {
|
|
@@ -2197,11 +2197,11 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
2197
2197
|
size: "md",
|
|
2198
2198
|
onClose: $[6] || ($[6] = (_) => r.value = !1)
|
|
2199
2199
|
}, {
|
|
2200
|
-
default:
|
|
2200
|
+
default: x(() => [
|
|
2201
2201
|
n("div", Cl, [
|
|
2202
|
-
|
|
2202
|
+
p(_t, {
|
|
2203
2203
|
items: e.context.roots,
|
|
2204
|
-
onClick:
|
|
2204
|
+
onClick: ut
|
|
2205
2205
|
}, null, 8, ["items"])
|
|
2206
2206
|
])
|
|
2207
2207
|
]),
|
|
@@ -2228,7 +2228,7 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
2228
2228
|
const a = s, l = F(!1), t = S(() => e.definition.component), o = S(() => Et(e.definition, e.config, e.context)), i = (d) => {
|
|
2229
2229
|
a("update:config", d);
|
|
2230
2230
|
};
|
|
2231
|
-
return (d, m) => (f(), g(
|
|
2231
|
+
return (d, m) => (f(), g(D, null, [
|
|
2232
2232
|
(f(), M(Be(t.value), Y(o.value, {
|
|
2233
2233
|
editable: "",
|
|
2234
2234
|
onSettings: m[0] || (m[0] = (r) => l.value = !0)
|
|
@@ -2251,7 +2251,7 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
2251
2251
|
}, Bl = {
|
|
2252
2252
|
key: 0,
|
|
2253
2253
|
class: "py-8 text-center text-sm text-gray-dark-25 dark:text-gray-main"
|
|
2254
|
-
},
|
|
2254
|
+
}, yd = /* @__PURE__ */ O({
|
|
2255
2255
|
__name: "BlockPicker",
|
|
2256
2256
|
props: {
|
|
2257
2257
|
definitions: {}
|
|
@@ -2264,16 +2264,16 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
2264
2264
|
size: "md",
|
|
2265
2265
|
onClose: t[0] || (t[0] = (o) => a("close"))
|
|
2266
2266
|
}, {
|
|
2267
|
-
default:
|
|
2267
|
+
default: x(() => [
|
|
2268
2268
|
n("div", _l, [
|
|
2269
|
-
(f(!0), g(
|
|
2269
|
+
(f(!0), g(D, null, U(e.definitions, (o) => (f(), g("button", {
|
|
2270
2270
|
key: o.type,
|
|
2271
2271
|
type: "button",
|
|
2272
2272
|
class: "glass-inset flex flex-col items-start rounded-xl p-4 text-left transition hover:border-cyan-main/30 hover:bg-cyan-main/5",
|
|
2273
2273
|
onClick: (i) => a("select", o.type)
|
|
2274
2274
|
}, [
|
|
2275
2275
|
n("span", zl, [
|
|
2276
|
-
|
|
2276
|
+
p(V, {
|
|
2277
2277
|
name: o.icon ?? "box",
|
|
2278
2278
|
size: 20
|
|
2279
2279
|
}, null, 8, ["name"])
|
|
@@ -2287,7 +2287,7 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
2287
2287
|
_: 1
|
|
2288
2288
|
}));
|
|
2289
2289
|
}
|
|
2290
|
-
}),
|
|
2290
|
+
}), bd = /* @__PURE__ */ O({
|
|
2291
2291
|
__name: "BlockView",
|
|
2292
2292
|
props: {
|
|
2293
2293
|
definition: {},
|
|
@@ -2321,7 +2321,7 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
2321
2321
|
emits: ["update:config"],
|
|
2322
2322
|
setup(e, { emit: s }) {
|
|
2323
2323
|
const a = s, l = F(!1), t = S(() => e.definition.component);
|
|
2324
|
-
return (o, i) => (f(), g(
|
|
2324
|
+
return (o, i) => (f(), g(D, null, [
|
|
2325
2325
|
(f(), M(Be(t.value), Y(o.$attrs, {
|
|
2326
2326
|
editable: e.editable,
|
|
2327
2327
|
onSettings: i[0] || (i[0] = (d) => l.value = !0)
|
|
@@ -2340,7 +2340,7 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
2340
2340
|
}), Il = { class: "flex flex-col gap-3" }, Ll = {
|
|
2341
2341
|
key: 0,
|
|
2342
2342
|
class: "text-sm text-red-500"
|
|
2343
|
-
}, Ml = { class: "flex justify-end gap-2" },
|
|
2343
|
+
}, Ml = { class: "flex justify-end gap-2" }, xd = /* @__PURE__ */ O({
|
|
2344
2344
|
__name: "BlockImport",
|
|
2345
2345
|
emits: ["close", "import"],
|
|
2346
2346
|
setup(e, { emit: s }) {
|
|
@@ -2369,7 +2369,7 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
2369
2369
|
size: "md",
|
|
2370
2370
|
onClose: r[2] || (r[2] = (c) => a("close"))
|
|
2371
2371
|
}, {
|
|
2372
|
-
default:
|
|
2372
|
+
default: x(() => [
|
|
2373
2373
|
n("div", Il, [
|
|
2374
2374
|
r[5] || (r[5] = n("p", { class: "text-sm text-gray-dark-25 dark:text-gray-main" }, " Вставь JSON, который был скопирован кнопкой «Экспорт». ", -1)),
|
|
2375
2375
|
it(n("textarea", {
|
|
@@ -2378,25 +2378,25 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
2378
2378
|
spellcheck: "false",
|
|
2379
2379
|
placeholder: '{"type":"energy-flow","bindings":{...}}'
|
|
2380
2380
|
}, null, 512), [
|
|
2381
|
-
[
|
|
2381
|
+
[$t, l.value]
|
|
2382
2382
|
]),
|
|
2383
2383
|
t.value ? (f(), g("p", Ll, C(t.value), 1)) : T("", !0),
|
|
2384
2384
|
n("div", Ml, [
|
|
2385
|
-
|
|
2385
|
+
p(R, {
|
|
2386
2386
|
color: "gray",
|
|
2387
2387
|
variant: "outline",
|
|
2388
2388
|
onClick: r[1] || (r[1] = (c) => a("close"))
|
|
2389
2389
|
}, {
|
|
2390
|
-
default:
|
|
2390
|
+
default: x(() => [...r[3] || (r[3] = [
|
|
2391
2391
|
L("Отмена", -1)
|
|
2392
2392
|
])]),
|
|
2393
2393
|
_: 1
|
|
2394
2394
|
}),
|
|
2395
|
-
|
|
2395
|
+
p(R, {
|
|
2396
2396
|
color: "blue",
|
|
2397
2397
|
onClick: d
|
|
2398
2398
|
}, {
|
|
2399
|
-
default:
|
|
2399
|
+
default: x(() => [...r[4] || (r[4] = [
|
|
2400
2400
|
L("Добавить", -1)
|
|
2401
2401
|
])]),
|
|
2402
2402
|
_: 1
|
|
@@ -2413,10 +2413,10 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
2413
2413
|
}, Fl = {
|
|
2414
2414
|
key: 0,
|
|
2415
2415
|
class: "min-w-0"
|
|
2416
|
-
},
|
|
2416
|
+
}, Dl = {
|
|
2417
2417
|
key: 0,
|
|
2418
2418
|
class: "text-lg font-semibold text-gray-dark-30 dark:text-white"
|
|
2419
|
-
},
|
|
2419
|
+
}, jl = {
|
|
2420
2420
|
key: 1,
|
|
2421
2421
|
class: "mt-1 text-sm text-gray-dark-25 dark:text-gray-main"
|
|
2422
2422
|
}, Nl = {
|
|
@@ -2464,11 +2464,11 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
2464
2464
|
class: B(t.value),
|
|
2465
2465
|
"aria-disabled": e.disabled || void 0
|
|
2466
2466
|
}, {
|
|
2467
|
-
default:
|
|
2467
|
+
default: x(() => [
|
|
2468
2468
|
e.title || e.subtitle || o.$slots.header ? (f(), g("div", Ol, [
|
|
2469
2469
|
e.title || e.subtitle ? (f(), g("div", Fl, [
|
|
2470
|
-
e.title ? (f(), g("h3",
|
|
2471
|
-
e.subtitle ? (f(), g("p",
|
|
2470
|
+
e.title ? (f(), g("h3", Dl, C(e.title), 1)) : T("", !0),
|
|
2471
|
+
e.subtitle ? (f(), g("p", jl, C(e.subtitle), 1)) : T("", !0)
|
|
2472
2472
|
])) : T("", !0),
|
|
2473
2473
|
o.$slots.header ? (f(), g("div", Nl, [
|
|
2474
2474
|
I(o.$slots, "header")
|
|
@@ -2521,17 +2521,17 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
2521
2521
|
return ((X = e.metrics) == null ? void 0 : X[q]) ?? [];
|
|
2522
2522
|
}, d = (q, X, E) => {
|
|
2523
2523
|
var Re;
|
|
2524
|
-
const
|
|
2524
|
+
const K = ((Re = e.metrics) == null ? void 0 : Re[q]) ?? [], ve = K.find((Ue) => Ue.id === X) ?? K[E];
|
|
2525
2525
|
return ve == null ? void 0 : ve.raw;
|
|
2526
2526
|
}, m = (q, X) => {
|
|
2527
2527
|
const E = typeof q == "number" ? q : Number.parseFloat(String(q));
|
|
2528
2528
|
return Number.isFinite(E) ? E : X;
|
|
2529
|
-
}, r = S(() => m(d("solar", "solar-power", 0), e.solarPower)), c = S(() => m(d("grid", "grid-power", 0), e.gridPower)), u = S(() => m(d("battery", "battery-power", 0), e.batteryPower)),
|
|
2530
|
-
{ id: "solar", active:
|
|
2531
|
-
{ id: "battery", active: j.value, reverse:
|
|
2529
|
+
}, r = S(() => m(d("solar", "solar-power", 0), e.solarPower)), c = S(() => m(d("grid", "grid-power", 0), e.gridPower)), u = S(() => m(d("battery", "battery-power", 0), e.batteryPower)), h = S(() => m(d("battery", "battery-soc", 1), e.batterySoc)), k = S(() => m(d("house", "house-load", 0), e.loadPower)), v = S(() => r.value > 0 && e.solarFlow !== "idle"), y = S(() => e.solarFlow === "reverse"), z = S(() => c.value !== 0 || ["import", "export"].includes(e.gridFlow)), j = S(() => u.value !== 0 || ["charge", "discharge"].includes(e.batteryFlow)), H = S(() => e.gridFlow === "export" ? !0 : e.gridFlow === "import" ? !1 : c.value < 0), N = S(() => e.batteryFlow === "charge" ? !0 : e.batteryFlow === "discharge" ? !1 : u.value > 0), Z = S(() => k.value > 0 && e.houseFlow !== "idle"), w = S(() => e.houseFlow !== "reverse"), A = S(() => o(k.value)), P = S(() => i("inverter")), ae = Ea(), xe = S(() => ae.value === "reduce"), re = S(() => [
|
|
2530
|
+
{ id: "solar", active: v.value, reverse: y.value, speed: l(r.value) },
|
|
2531
|
+
{ id: "battery", active: j.value, reverse: N.value, speed: l(u.value) },
|
|
2532
2532
|
{ id: "grid", active: z.value, reverse: H.value, speed: l(c.value) },
|
|
2533
2533
|
{ id: "home", active: Z.value, reverse: w.value, speed: l(k.value) }
|
|
2534
|
-
]), qe = S(() => re.value.filter((q) => q.active)),
|
|
2534
|
+
]), qe = S(() => re.value.filter((q) => q.active)), dt = S(() => [
|
|
2535
2535
|
{
|
|
2536
2536
|
key: "solar",
|
|
2537
2537
|
wrapper: "col-start-1 row-start-1 self-start justify-self-start",
|
|
@@ -2572,54 +2572,54 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
2572
2572
|
surface: "bg-violet-500/10",
|
|
2573
2573
|
card: "border-violet-500/25 bg-violet-500/[0.04]"
|
|
2574
2574
|
}
|
|
2575
|
-
]),
|
|
2575
|
+
]), Le = F(null), Me = F(null), Oe = /* @__PURE__ */ new Map(), ee = F(null);
|
|
2576
2576
|
let de = null;
|
|
2577
|
-
const
|
|
2578
|
-
X instanceof HTMLElement ?
|
|
2577
|
+
const ct = (q, X) => {
|
|
2578
|
+
X instanceof HTMLElement ? Oe.set(q, X) : Oe.delete(q);
|
|
2579
2579
|
}, Ae = (q, X) => {
|
|
2580
2580
|
const E = q.getBoundingClientRect();
|
|
2581
2581
|
return { x: E.left - X.left, y: E.top - X.top, width: E.width, height: E.height };
|
|
2582
2582
|
}, Se = () => {
|
|
2583
|
-
const q =
|
|
2583
|
+
const q = Le.value, X = Me.value;
|
|
2584
2584
|
if (!q || !X) return;
|
|
2585
2585
|
const E = q.getBoundingClientRect();
|
|
2586
2586
|
if (E.width < 2 || E.height < 2) return;
|
|
2587
|
-
const
|
|
2588
|
-
const _e =
|
|
2587
|
+
const K = Ae(X, E), ve = K.x + K.width / 2, Re = K.y + K.height / 2, Ue = re.value.map((me) => {
|
|
2588
|
+
const _e = Oe.get(me.id);
|
|
2589
2589
|
if (!_e) return null;
|
|
2590
|
-
const G = Ae(_e, E), Te = G.x + G.width / 2, we = G.y + G.height / 2, fe = ve - Te, ge = Re - we,
|
|
2591
|
-
return { id: me.id, rect: G, nodeSide: te, portSide: Ye, pos:
|
|
2590
|
+
const G = Ae(_e, E), Te = G.x + G.width / 2, we = G.y + G.height / 2, fe = ve - Te, ge = Re - we, le = Math.abs(fe) >= Math.abs(ge), te = le ? fe > 0 ? "right" : "left" : ge > 0 ? "bottom" : "top", Ye = te === "left" ? "right" : te === "right" ? "left" : te === "top" ? "bottom" : "top";
|
|
2591
|
+
return { id: me.id, rect: G, nodeSide: te, portSide: Ye, pos: le ? we : Te };
|
|
2592
2592
|
}).filter((me) => me !== null), Ke = { left: [], right: [], top: [], bottom: [] };
|
|
2593
2593
|
for (const me of Ue) Ke[me.portSide].push(me);
|
|
2594
|
-
const Xe = {},
|
|
2595
|
-
for (const me of
|
|
2594
|
+
const Xe = {}, ut = ["left", "right", "top", "bottom"];
|
|
2595
|
+
for (const me of ut) {
|
|
2596
2596
|
const _e = Ke[me].sort((G, Te) => G.pos - Te.pos);
|
|
2597
2597
|
_e.forEach((G, Te) => {
|
|
2598
2598
|
const we = _e.length === 1 ? 0.5 : (Te + 1) / (_e.length + 1);
|
|
2599
2599
|
let fe = 0, ge = 0;
|
|
2600
|
-
me === "left" ? (fe =
|
|
2601
|
-
let
|
|
2602
|
-
G.nodeSide === "left" ? (
|
|
2603
|
-
const
|
|
2604
|
-
Xe[G.id] =
|
|
2600
|
+
me === "left" ? (fe = K.x, ge = K.y + K.height * we) : me === "right" ? (fe = K.x + K.width, ge = K.y + K.height * we) : me === "top" ? (fe = K.x + K.width * we, ge = K.y) : (fe = K.x + K.width * we, ge = K.y + K.height);
|
|
2601
|
+
let le = 0, te = 0;
|
|
2602
|
+
G.nodeSide === "left" ? (le = G.rect.x, te = G.rect.y + G.rect.height / 2) : G.nodeSide === "right" ? (le = G.rect.x + G.rect.width, te = G.rect.y + G.rect.height / 2) : G.nodeSide === "top" ? (le = G.rect.x + G.rect.width / 2, te = G.rect.y) : (le = G.rect.x + G.rect.width / 2, te = G.rect.y + G.rect.height);
|
|
2603
|
+
const mt = G.portSide === "left" || G.portSide === "right" ? `M${le.toFixed(1)} ${te.toFixed(1)} C${(le + (fe - le) * 0.55).toFixed(1)} ${te.toFixed(1)} ${(le + (fe - le) * 0.55).toFixed(1)} ${ge.toFixed(1)} ${fe.toFixed(1)} ${ge.toFixed(1)}` : `M${le.toFixed(1)} ${te.toFixed(1)} C${le.toFixed(1)} ${(te + (ge - te) * 0.55).toFixed(1)} ${fe.toFixed(1)} ${(te + (ge - te) * 0.55).toFixed(1)} ${fe.toFixed(1)} ${ge.toFixed(1)}`;
|
|
2604
|
+
Xe[G.id] = mt;
|
|
2605
2605
|
});
|
|
2606
2606
|
}
|
|
2607
|
-
|
|
2608
|
-
},
|
|
2607
|
+
ee.value = { width: E.width, height: E.height, paths: Xe };
|
|
2608
|
+
}, Fe = () => {
|
|
2609
2609
|
if (de) {
|
|
2610
|
-
de.disconnect(),
|
|
2611
|
-
for (const q of
|
|
2610
|
+
de.disconnect(), Le.value && de.observe(Le.value), Me.value && de.observe(Me.value);
|
|
2611
|
+
for (const q of Oe.values()) de.observe(q);
|
|
2612
2612
|
}
|
|
2613
2613
|
};
|
|
2614
2614
|
return be(async () => {
|
|
2615
|
-
de = new ResizeObserver(() => Se()), await
|
|
2616
|
-
}),
|
|
2615
|
+
de = new ResizeObserver(() => Se()), await wt(), Se(), Fe();
|
|
2616
|
+
}), Pe(() => {
|
|
2617
2617
|
de == null || de.disconnect(), de = null;
|
|
2618
2618
|
}), (q, X) => (f(), M(Ul, {
|
|
2619
2619
|
title: e.title,
|
|
2620
2620
|
hover: ""
|
|
2621
2621
|
}, {
|
|
2622
|
-
header:
|
|
2622
|
+
header: x(() => [
|
|
2623
2623
|
n("div", Kl, [
|
|
2624
2624
|
n("span", {
|
|
2625
2625
|
class: B(["inline-flex items-center gap-2 rounded-full border px-2.5 py-1 text-xs font-medium", e.online ? "border-emerald-500/25 bg-emerald-500/10 text-emerald-600 dark:text-emerald-400" : "border-gray-light-10/60 bg-gray-dark-25/10 text-gray-dark-25 dark:border-white/10 dark:text-gray-main"])
|
|
@@ -2637,23 +2637,23 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
2637
2637
|
title: "Настроить блок",
|
|
2638
2638
|
onClick: X[0] || (X[0] = (E) => a("settings"))
|
|
2639
2639
|
}, {
|
|
2640
|
-
default:
|
|
2641
|
-
|
|
2640
|
+
default: x(() => [
|
|
2641
|
+
p(V, {
|
|
2642
2642
|
name: "settings",
|
|
2643
2643
|
size: 16
|
|
2644
2644
|
})
|
|
2645
2645
|
]),
|
|
2646
2646
|
_: 1
|
|
2647
2647
|
})) : T("", !0),
|
|
2648
|
-
|
|
2648
|
+
p(R, {
|
|
2649
2649
|
type: "icon",
|
|
2650
2650
|
size: "sm",
|
|
2651
2651
|
"aria-label": "Обновить данные",
|
|
2652
2652
|
title: "Обновить данные",
|
|
2653
2653
|
onClick: X[1] || (X[1] = (E) => a("refresh"))
|
|
2654
2654
|
}, {
|
|
2655
|
-
default:
|
|
2656
|
-
|
|
2655
|
+
default: x(() => [
|
|
2656
|
+
p(V, {
|
|
2657
2657
|
name: "refresh",
|
|
2658
2658
|
size: 16
|
|
2659
2659
|
})
|
|
@@ -2662,46 +2662,46 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
2662
2662
|
})
|
|
2663
2663
|
])
|
|
2664
2664
|
]),
|
|
2665
|
-
default:
|
|
2665
|
+
default: x(() => [
|
|
2666
2666
|
n("div", {
|
|
2667
2667
|
ref_key: "containerRef",
|
|
2668
|
-
ref:
|
|
2668
|
+
ref: Le,
|
|
2669
2669
|
class: "relative min-h-120 lg:min-h-104"
|
|
2670
2670
|
}, [
|
|
2671
|
-
|
|
2671
|
+
ee.value ? (f(), g("svg", {
|
|
2672
2672
|
key: 0,
|
|
2673
2673
|
class: "pointer-events-none absolute inset-0 size-full",
|
|
2674
|
-
viewBox: `0 0 ${
|
|
2674
|
+
viewBox: `0 0 ${ee.value.width} ${ee.value.height}`,
|
|
2675
2675
|
"aria-hidden": "true"
|
|
2676
2676
|
}, [
|
|
2677
|
-
(f(!0), g(
|
|
2677
|
+
(f(!0), g(D, null, U(re.value, (E) => (f(), g("path", {
|
|
2678
2678
|
id: `energy-path-${E.id}`,
|
|
2679
2679
|
key: `rail-${E.id}`,
|
|
2680
2680
|
class: "stroke-current text-gray-main dark:text-white/20 [stroke-width:1.5] [stroke-linecap:round] [stroke-dasharray:2_6] opacity-45",
|
|
2681
|
-
d:
|
|
2681
|
+
d: ee.value.paths[E.id],
|
|
2682
2682
|
fill: "none"
|
|
2683
2683
|
}, null, 8, Hl))), 128)),
|
|
2684
|
-
(f(!0), g(
|
|
2684
|
+
(f(!0), g(D, null, U(qe.value, (E) => (f(), g("g", {
|
|
2685
2685
|
key: `flow-${E.id}`
|
|
2686
2686
|
}, [
|
|
2687
2687
|
n("path", {
|
|
2688
2688
|
class: "stroke-cyan-main [stroke-width:2.5] [stroke-linecap:round] opacity-55",
|
|
2689
|
-
d:
|
|
2689
|
+
d: ee.value.paths[E.id],
|
|
2690
2690
|
fill: "none"
|
|
2691
2691
|
}, null, 8, Gl),
|
|
2692
2692
|
n("path", {
|
|
2693
2693
|
class: "stroke-cyan-main [stroke-width:10] [stroke-linecap:round] opacity-20 blur-sm",
|
|
2694
|
-
d:
|
|
2694
|
+
d: ee.value.paths[E.id],
|
|
2695
2695
|
fill: "none"
|
|
2696
2696
|
}, null, 8, Jl),
|
|
2697
2697
|
n("path", {
|
|
2698
2698
|
class: B(["animate-energy-flow stroke-gray-light-30 stroke-2 [stroke-linecap:round] [stroke-dasharray:16_22] opacity-75 drop-shadow-cyan-glow-xs motion-reduce:animate-none motion-reduce:[stroke-dasharray:none]", { "[animation-direction:reverse]": E.reverse }]),
|
|
2699
|
-
d:
|
|
2700
|
-
style:
|
|
2699
|
+
d: ee.value.paths[E.id],
|
|
2700
|
+
style: Ve({ animationDuration: `${E.speed}s` }),
|
|
2701
2701
|
fill: "none"
|
|
2702
2702
|
}, null, 14, ql),
|
|
2703
|
-
xe.value ? T("", !0) : (f(), g(
|
|
2704
|
-
key: `dot-${E.id}-${
|
|
2703
|
+
xe.value ? T("", !0) : (f(), g(D, { key: 0 }, U([0, 1, 2], (K, ve) => n("circle", {
|
|
2704
|
+
key: `dot-${E.id}-${K}`,
|
|
2705
2705
|
r: "2.6",
|
|
2706
2706
|
opacity: "0",
|
|
2707
2707
|
class: "fill-gray-light-30 drop-shadow-cyan-glow-dot"
|
|
@@ -2730,10 +2730,10 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
2730
2730
|
]))), 128))
|
|
2731
2731
|
], 8, Wl)) : T("", !0),
|
|
2732
2732
|
n("div", Ql, [
|
|
2733
|
-
(f(!0), g(
|
|
2733
|
+
(f(!0), g(D, null, U(dt.value, (E) => (f(), g("div", {
|
|
2734
2734
|
key: E.key,
|
|
2735
2735
|
ref_for: !0,
|
|
2736
|
-
ref: (
|
|
2736
|
+
ref: (K) => ct(E.key, K),
|
|
2737
2737
|
class: B(E.wrapper)
|
|
2738
2738
|
}, [
|
|
2739
2739
|
n("div", {
|
|
@@ -2743,7 +2743,7 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
2743
2743
|
n("span", {
|
|
2744
2744
|
class: B(["grid size-8 shrink-0 place-items-center rounded-lg", E.surface])
|
|
2745
2745
|
}, [
|
|
2746
|
-
|
|
2746
|
+
p(V, {
|
|
2747
2747
|
name: E.icon,
|
|
2748
2748
|
size: 16,
|
|
2749
2749
|
class: B(E.tone)
|
|
@@ -2752,14 +2752,14 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
2752
2752
|
n("span", to, C(E.label), 1)
|
|
2753
2753
|
]),
|
|
2754
2754
|
E.metrics.length ? (f(), g("div", ao, [
|
|
2755
|
-
(f(!0), g(
|
|
2756
|
-
key:
|
|
2755
|
+
(f(!0), g(D, null, U(E.metrics, (K) => (f(), g("div", {
|
|
2756
|
+
key: K.id,
|
|
2757
2757
|
class: "glass-inset rounded-lg px-3 py-2"
|
|
2758
2758
|
}, [
|
|
2759
|
-
n("span", so, C(
|
|
2759
|
+
n("span", so, C(K.label), 1),
|
|
2760
2760
|
n("span", {
|
|
2761
|
-
class: B(["mt-0.5 block whitespace-pre", J(
|
|
2762
|
-
}, C(
|
|
2761
|
+
class: B(["mt-0.5 block whitespace-pre", J(ht)(K.style)])
|
|
2762
|
+
}, C(K.value), 3)
|
|
2763
2763
|
]))), 128))
|
|
2764
2764
|
])) : T("", !0)
|
|
2765
2765
|
], 2)
|
|
@@ -2767,14 +2767,14 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
2767
2767
|
n("div", no, [
|
|
2768
2768
|
n("div", {
|
|
2769
2769
|
ref_key: "inverterRef",
|
|
2770
|
-
ref:
|
|
2770
|
+
ref: Me,
|
|
2771
2771
|
class: "relative w-full max-w-72 rounded-2xl border border-cyan-main/30 bg-cyan-main/10 p-4 text-cyan-main shadow-cyan-glow"
|
|
2772
2772
|
}, [
|
|
2773
2773
|
X[3] || (X[3] = n("span", { class: "absolute -inset-2 rounded-3xl border border-cyan-main/15" }, null, -1)),
|
|
2774
2774
|
n("div", lo, [
|
|
2775
2775
|
n("div", oo, [
|
|
2776
2776
|
n("span", io, [
|
|
2777
|
-
|
|
2777
|
+
p(V, {
|
|
2778
2778
|
name: "inverter",
|
|
2779
2779
|
size: 20
|
|
2780
2780
|
})
|
|
@@ -2786,25 +2786,25 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
2786
2786
|
n("span", mo, C(e.loadLabel), 1)
|
|
2787
2787
|
]),
|
|
2788
2788
|
n("dl", fo, [
|
|
2789
|
-
(f(!0), g(
|
|
2789
|
+
(f(!0), g(D, null, U(P.value, (E) => (f(), g("div", {
|
|
2790
2790
|
key: E.id,
|
|
2791
2791
|
class: "glass-inset rounded-md px-3 py-2"
|
|
2792
2792
|
}, [
|
|
2793
2793
|
n("dt", go, C(E.label), 1),
|
|
2794
2794
|
n("dd", {
|
|
2795
|
-
class: B(["mt-0.5 whitespace-pre", J(
|
|
2795
|
+
class: B(["mt-0.5 whitespace-pre", J(ht)(E.style)])
|
|
2796
2796
|
}, C(E.value), 3)
|
|
2797
2797
|
]))), 128))
|
|
2798
2798
|
]),
|
|
2799
2799
|
n("div", vo, [
|
|
2800
2800
|
n("div", po, [
|
|
2801
2801
|
X[2] || (X[2] = n("span", { class: "text-gray-dark-25 dark:text-gray-main" }, "Батарея", -1)),
|
|
2802
|
-
n("span", ho, C(
|
|
2802
|
+
n("span", ho, C(h.value) + " %", 1)
|
|
2803
2803
|
]),
|
|
2804
2804
|
n("div", yo, [
|
|
2805
2805
|
n("div", {
|
|
2806
2806
|
class: "h-full rounded-full bg-emerald-500 transition-all duration-500",
|
|
2807
|
-
style:
|
|
2807
|
+
style: Ve({ width: `${h.value}%` })
|
|
2808
2808
|
}, null, 4)
|
|
2809
2809
|
])
|
|
2810
2810
|
])
|
|
@@ -2868,7 +2868,7 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
2868
2868
|
{ key: "inverterTitle", plain: !0, block: "inverter", label: "Заголовок", type: "string", default: "Инвертор" },
|
|
2869
2869
|
{ key: "loadLabel", plain: !0, block: "inverter", label: "Подпись нагрузки", type: "string", default: "нагрузка" }
|
|
2870
2870
|
]
|
|
2871
|
-
},
|
|
2871
|
+
}, kd = /* @__PURE__ */ O({
|
|
2872
2872
|
inheritAttrs: !1,
|
|
2873
2873
|
__name: "EnergyFlowBlock",
|
|
2874
2874
|
props: {
|
|
@@ -2913,7 +2913,7 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
2913
2913
|
id: "vuesp.device",
|
|
2914
2914
|
label: "Устройство vuesp",
|
|
2915
2915
|
createContext: (e) => Co(e)
|
|
2916
|
-
}, _o = "/tmp/blocks.json",
|
|
2916
|
+
}, _o = "/tmp/blocks.json", jt = "/fs", To = 1, zo = 8, Yt = 10, Zt = 4, ot = 512, Ao = 64, Eo = 8192, Qt = ["vuesp.blocks", "vuesp.block.energy"], Bo = ["xs", "sm", "base", "lg", "xl"], Vo = ["default", "muted", "primary", "success", "warning", "danger"], Io = ["normal", "medium", "semibold"], Lo = ["left", "right"], $e = (e) => typeof e == "object" && e !== null && !Array.isArray(e), ea = (e) => {
|
|
2917
2917
|
if (!$e(e)) return;
|
|
2918
2918
|
const s = {};
|
|
2919
2919
|
return typeof e.size == "string" && Bo.includes(e.size) && (s.size = e.size), typeof e.color == "string" && Vo.includes(e.color) && (s.color = e.color), typeof e.weight == "string" && Io.includes(e.weight) && (s.weight = e.weight), typeof e.align == "string" && Lo.includes(e.align) && (s.align = e.align), Object.keys(s).length ? s : void 0;
|
|
@@ -2938,7 +2938,7 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
2938
2938
|
(t.length || Array.isArray(l)) && (s[a] = t);
|
|
2939
2939
|
}
|
|
2940
2940
|
return Object.keys(s).length ? s : void 0;
|
|
2941
|
-
},
|
|
2941
|
+
}, Do = (e) => {
|
|
2942
2942
|
if (!e) return;
|
|
2943
2943
|
const s = {};
|
|
2944
2944
|
for (const [a, l] of Object.entries(e))
|
|
@@ -2950,7 +2950,7 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
2950
2950
|
...t.style && Object.keys(t.style).length ? { s: t.style } : {}
|
|
2951
2951
|
})));
|
|
2952
2952
|
return Object.keys(s).length ? s : void 0;
|
|
2953
|
-
},
|
|
2953
|
+
}, jo = (e) => ({
|
|
2954
2954
|
id: e.id.slice(0, 64),
|
|
2955
2955
|
label: String(e.label ?? "").slice(0, Ao),
|
|
2956
2956
|
value: String(e.value ?? "").slice(0, ot),
|
|
@@ -2966,7 +2966,7 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
2966
2966
|
if (!e) return;
|
|
2967
2967
|
const s = {};
|
|
2968
2968
|
for (const [a, l] of Object.entries(e))
|
|
2969
|
-
l && (s[a] = l.slice(0, Yt).map(
|
|
2969
|
+
l && (s[a] = l.slice(0, Yt).map(jo));
|
|
2970
2970
|
return Object.keys(s).length ? s : void 0;
|
|
2971
2971
|
}, ta = (e) => Array.isArray(e) ? e : $e(e) && typeof e.type == "string" && $e(e.bindings) ? [e] : !$e(e) || !Array.isArray(e.b) ? [] : e.b.filter($e).map((s) => ({
|
|
2972
2972
|
id: String(s.i ?? ""),
|
|
@@ -2985,7 +2985,7 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
2985
2985
|
m: s.bindings,
|
|
2986
2986
|
...s.units && Object.keys(s.units).length ? { u: s.units } : {},
|
|
2987
2987
|
...s.metricArgs && Object.keys(s.metricArgs).length ? { A: s.metricArgs } : {},
|
|
2988
|
-
...s.metrics && Object.keys(s.metrics).length ? { g:
|
|
2988
|
+
...s.metrics && Object.keys(s.metrics).length ? { g: Do(s.metrics) } : {}
|
|
2989
2989
|
}))
|
|
2990
2990
|
}), Ro = (e) => {
|
|
2991
2991
|
const s = e.slice(0, zo).map((a) => ({
|
|
@@ -3019,12 +3019,12 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
3019
3019
|
const s = async (l) => {
|
|
3020
3020
|
const t = new FormData();
|
|
3021
3021
|
t.append("file[0]", new Blob([JSON.stringify(aa(Ro(l)))], { type: "application/json" }), e);
|
|
3022
|
-
const o = await fetch(
|
|
3022
|
+
const o = await fetch(jt, { method: "POST", body: t });
|
|
3023
3023
|
if (!o.ok) throw new Error(`Не удалось сохранить настройки блока: HTTP ${o.status}`);
|
|
3024
3024
|
};
|
|
3025
3025
|
return { read: async () => {
|
|
3026
3026
|
try {
|
|
3027
|
-
const t = await fetch(`${
|
|
3027
|
+
const t = await fetch(`${jt}?file=${e}`);
|
|
3028
3028
|
if (t.ok) {
|
|
3029
3029
|
const o = ta(await t.json());
|
|
3030
3030
|
if (o.length) return o;
|
|
@@ -3039,7 +3039,7 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
3039
3039
|
}
|
|
3040
3040
|
return l;
|
|
3041
3041
|
}, write: s };
|
|
3042
|
-
},
|
|
3042
|
+
}, $d = Wo(), wd = (e, s, a = {}) => {
|
|
3043
3043
|
const l = a.provider ?? So, t = a.id ?? e.defaultId ?? e.type, o = F({
|
|
3044
3044
|
id: t,
|
|
3045
3045
|
type: e.type,
|
|
@@ -3050,27 +3050,27 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
3050
3050
|
}), i = S(() => l.createContext(ga(s))), d = S(() => Et(e, o.value, i.value)), m = S(() => ({ ...o.value.units ?? {} })), r = async () => {
|
|
3051
3051
|
if (a.storage)
|
|
3052
3052
|
try {
|
|
3053
|
-
const
|
|
3054
|
-
if (!
|
|
3053
|
+
const h = (await a.storage.read()).find((k) => k.id === t);
|
|
3054
|
+
if (!h) return;
|
|
3055
3055
|
o.value = {
|
|
3056
3056
|
...o.value,
|
|
3057
|
-
...
|
|
3057
|
+
...h,
|
|
3058
3058
|
id: t,
|
|
3059
3059
|
type: e.type,
|
|
3060
3060
|
provider: l.id,
|
|
3061
|
-
bindings: { ...o.value.bindings, ...
|
|
3061
|
+
bindings: { ...o.value.bindings, ...h.bindings }
|
|
3062
3062
|
};
|
|
3063
3063
|
} catch {
|
|
3064
3064
|
}
|
|
3065
3065
|
}, c = async (u) => {
|
|
3066
3066
|
if (o.value = u, !!a.storage)
|
|
3067
3067
|
try {
|
|
3068
|
-
const
|
|
3069
|
-
await a.storage.write([...
|
|
3068
|
+
const h = await a.storage.read();
|
|
3069
|
+
await a.storage.write([...h.filter((k) => k.id !== u.id), u]);
|
|
3070
3070
|
} catch {
|
|
3071
3071
|
}
|
|
3072
3072
|
};
|
|
3073
|
-
return be(r),
|
|
3073
|
+
return be(r), xt({
|
|
3074
3074
|
config: o,
|
|
3075
3075
|
context: i,
|
|
3076
3076
|
data: d,
|
|
@@ -3081,7 +3081,7 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
3081
3081
|
}, Ho = { class: "flex-auto flex justify-between" }, Go = { class: "text-sm text-gray-dark-25 font-medium line-clamp-2 overflow-hidden dark:text-gray-light-10" }, Jo = { class: "text-sm text-ellipsis overflow-hidden text-nowrap" }, qo = {
|
|
3082
3082
|
key: 0,
|
|
3083
3083
|
class: "pointer-events-none absolute left-1/2 top-1/2 size-1/2 text-gray-light-10/10 dark:text-white/2 -translate-1/2"
|
|
3084
|
-
}, Xo = { class: "min-h-60 relative" }, Yo = { class: "pt-6" }, Zo = { class: "text-center text-3xl text-ellipsis overflow-hidden" }, Qo = { class: "text-center text-xl mt-4" },
|
|
3084
|
+
}, Xo = { class: "min-h-60 relative" }, Yo = { class: "pt-6" }, Zo = { class: "text-center text-3xl text-ellipsis overflow-hidden" }, Qo = { class: "text-center text-xl mt-4" }, Ie = /* @__PURE__ */ O({
|
|
3085
3085
|
__name: "CardBase",
|
|
3086
3086
|
props: {
|
|
3087
3087
|
size: {},
|
|
@@ -3104,7 +3104,7 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
3104
3104
|
const a = e, l = s, t = F(!1), o = S(() => ["button", "dimmer"].includes(a.type || "") && a.value ? "text-amber-500" : "text-gray-main dark:text-gray-light-10"), i = (u) => l("edit", u), d = (u) => l("clone", u), m = () => t.value = !0, r = (u) => l("open", u), c = (u) => {
|
|
3105
3105
|
t.value = !1, l("close", u);
|
|
3106
3106
|
};
|
|
3107
|
-
return (u,
|
|
3107
|
+
return (u, h) => (f(), g("div", {
|
|
3108
3108
|
class: "glass-inset relative flex aspect-square rounded-xl cursor-pointer flex-col p-2 transition-all hover:border-cyan-main/25 hover:shadow-cyan-glow",
|
|
3109
3109
|
onClick: m
|
|
3110
3110
|
}, [
|
|
@@ -3112,26 +3112,26 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
3112
3112
|
n("div", {
|
|
3113
3113
|
class: B([o.value, "size-8 animate-shake"])
|
|
3114
3114
|
}, [
|
|
3115
|
-
I(u.$slots, "icon",
|
|
3115
|
+
I(u.$slots, "icon", se(ne(a)))
|
|
3116
3116
|
], 2),
|
|
3117
|
-
I(u.$slots, "header",
|
|
3117
|
+
I(u.$slots, "header", se(ne(a)))
|
|
3118
3118
|
]),
|
|
3119
3119
|
n("div", null, [
|
|
3120
|
-
I(u.$slots, "body",
|
|
3120
|
+
I(u.$slots, "body", se(ne(a)), () => [
|
|
3121
3121
|
n("h6", Go, [
|
|
3122
|
-
I(u.$slots, "name",
|
|
3122
|
+
I(u.$slots, "name", se(ne(a)), () => [
|
|
3123
3123
|
L(C(a.name), 1)
|
|
3124
3124
|
])
|
|
3125
3125
|
]),
|
|
3126
3126
|
n("div", Jo, [
|
|
3127
|
-
I(u.$slots, "value",
|
|
3127
|
+
I(u.$slots, "value", se(ne(a)), () => [
|
|
3128
3128
|
L(C(a.valueTo || a.value), 1)
|
|
3129
3129
|
])
|
|
3130
3130
|
])
|
|
3131
3131
|
])
|
|
3132
3132
|
]),
|
|
3133
3133
|
a.icon ? (f(), g("div", qo, [
|
|
3134
|
-
I(u.$slots, "icon",
|
|
3134
|
+
I(u.$slots, "icon", se(ne(a)))
|
|
3135
3135
|
])) : T("", !0),
|
|
3136
3136
|
t.value ? (f(), M(ze, {
|
|
3137
3137
|
key: 1,
|
|
@@ -3140,8 +3140,8 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
3140
3140
|
onClose: c,
|
|
3141
3141
|
onOpen: r
|
|
3142
3142
|
}, {
|
|
3143
|
-
"header-btn":
|
|
3144
|
-
|
|
3143
|
+
"header-btn": x(() => [
|
|
3144
|
+
p(R, {
|
|
3145
3145
|
class: "size-8",
|
|
3146
3146
|
variant: "ghost",
|
|
3147
3147
|
size: "none",
|
|
@@ -3149,15 +3149,15 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
3149
3149
|
"aria-label": "Edit",
|
|
3150
3150
|
onClick: i
|
|
3151
3151
|
}, {
|
|
3152
|
-
default:
|
|
3153
|
-
|
|
3152
|
+
default: x(() => [
|
|
3153
|
+
p(V, {
|
|
3154
3154
|
name: "more",
|
|
3155
3155
|
class: "size-4"
|
|
3156
3156
|
})
|
|
3157
3157
|
]),
|
|
3158
3158
|
_: 1
|
|
3159
3159
|
}),
|
|
3160
|
-
|
|
3160
|
+
p(R, {
|
|
3161
3161
|
class: "size-8",
|
|
3162
3162
|
variant: "ghost",
|
|
3163
3163
|
size: "none",
|
|
@@ -3165,8 +3165,8 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
3165
3165
|
"aria-label": "Copy",
|
|
3166
3166
|
onClick: d
|
|
3167
3167
|
}, {
|
|
3168
|
-
default:
|
|
3169
|
-
|
|
3168
|
+
default: x(() => [
|
|
3169
|
+
p(V, {
|
|
3170
3170
|
name: "copy",
|
|
3171
3171
|
class: "size-4"
|
|
3172
3172
|
})
|
|
@@ -3174,17 +3174,17 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
3174
3174
|
_: 1
|
|
3175
3175
|
})
|
|
3176
3176
|
]),
|
|
3177
|
-
default:
|
|
3177
|
+
default: x(() => [
|
|
3178
3178
|
n("div", Xo, [
|
|
3179
3179
|
n("div", Yo, [
|
|
3180
3180
|
n("h3", Zo, [
|
|
3181
|
-
I(u.$slots, "dialog-name",
|
|
3181
|
+
I(u.$slots, "dialog-name", se(ne(a)), () => [
|
|
3182
3182
|
L(C(a.name), 1)
|
|
3183
3183
|
])
|
|
3184
3184
|
]),
|
|
3185
|
-
I(u.$slots, "dialog",
|
|
3185
|
+
I(u.$slots, "dialog", se(ne(a))),
|
|
3186
3186
|
n("p", Qo, [
|
|
3187
|
-
I(u.$slots, "dialog-value",
|
|
3187
|
+
I(u.$slots, "dialog-value", se(ne(a)), () => [
|
|
3188
3188
|
L(C(a.valueTo || a.value), 1)
|
|
3189
3189
|
])
|
|
3190
3190
|
])
|
|
@@ -3195,7 +3195,7 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
3195
3195
|
}, 8, ["size", "title"])) : T("", !0)
|
|
3196
3196
|
]));
|
|
3197
3197
|
}
|
|
3198
|
-
}), ei = { class: "flex justify-end" }, ti = { class: "flex justify-center py-4" },
|
|
3198
|
+
}), ei = { class: "flex justify-end" }, ti = { class: "flex justify-center py-4" }, Cd = /* @__PURE__ */ O({
|
|
3199
3199
|
__name: "CardButton",
|
|
3200
3200
|
props: {
|
|
3201
3201
|
size: {},
|
|
@@ -3219,23 +3219,23 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
3219
3219
|
const { disabled: d } = i;
|
|
3220
3220
|
return { disabled: !!d };
|
|
3221
3221
|
}, o = () => l("setState", !a.value);
|
|
3222
|
-
return (i, d) => (f(), M(
|
|
3222
|
+
return (i, d) => (f(), M(Ie, Y(a, {
|
|
3223
3223
|
onClick: d[0] || (d[0] = (m) => l("click", m)),
|
|
3224
3224
|
onEdit: d[1] || (d[1] = (m) => l("edit", m)),
|
|
3225
3225
|
onClone: d[2] || (d[2] = (m) => l("clone", m))
|
|
3226
3226
|
}), {
|
|
3227
|
-
icon:
|
|
3228
|
-
I(i.$slots, "icon",
|
|
3227
|
+
icon: x((m) => [
|
|
3228
|
+
I(i.$slots, "icon", se(ne(m)))
|
|
3229
3229
|
]),
|
|
3230
|
-
header:
|
|
3230
|
+
header: x((m) => [
|
|
3231
3231
|
n("div", ei, [
|
|
3232
|
-
|
|
3232
|
+
p(R, Y(t(m), {
|
|
3233
3233
|
type: "icon",
|
|
3234
3234
|
class: a.value ? "text-amber-500" : "text-gray-dark-25 dark:text-gray-light-10",
|
|
3235
|
-
onClick:
|
|
3235
|
+
onClick: Q(o, ["stop"])
|
|
3236
3236
|
}), {
|
|
3237
|
-
default:
|
|
3238
|
-
|
|
3237
|
+
default: x(() => [
|
|
3238
|
+
p(V, {
|
|
3239
3239
|
name: "shut",
|
|
3240
3240
|
class: "size-8"
|
|
3241
3241
|
})
|
|
@@ -3244,15 +3244,15 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
3244
3244
|
}, 16, ["class"])
|
|
3245
3245
|
])
|
|
3246
3246
|
]),
|
|
3247
|
-
dialog:
|
|
3247
|
+
dialog: x((m) => [
|
|
3248
3248
|
n("div", ti, [
|
|
3249
|
-
|
|
3249
|
+
p(R, Y(t(m), {
|
|
3250
3250
|
type: "icon",
|
|
3251
3251
|
class: ["size-18", a.value ? "text-amber-500" : "text-gray-dark-25 dark:text-gray-light-10"],
|
|
3252
|
-
onClick:
|
|
3252
|
+
onClick: Q(o, ["stop"])
|
|
3253
3253
|
}), {
|
|
3254
|
-
default:
|
|
3255
|
-
|
|
3254
|
+
default: x(() => [
|
|
3255
|
+
p(V, {
|
|
3256
3256
|
name: "shut",
|
|
3257
3257
|
class: "size-16"
|
|
3258
3258
|
})
|
|
@@ -3264,7 +3264,7 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
3264
3264
|
_: 3
|
|
3265
3265
|
}, 16));
|
|
3266
3266
|
}
|
|
3267
|
-
}), ai = { class: "flex justify-center relative mx-2 my-6" },
|
|
3267
|
+
}), ai = { class: "flex justify-center relative mx-2 my-6" }, Sd = /* @__PURE__ */ O({
|
|
3268
3268
|
__name: "CardDate",
|
|
3269
3269
|
props: {
|
|
3270
3270
|
size: {},
|
|
@@ -3289,37 +3289,37 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
3289
3289
|
const c = (u = r == null ? void 0 : r.target) == null ? void 0 : u.valueAsNumber;
|
|
3290
3290
|
c && l("setState", c / 1e3);
|
|
3291
3291
|
}, d = ({ name: r, value: c, opts: u = {} }) => {
|
|
3292
|
-
const { disabled:
|
|
3293
|
-
return { label: r, modelValue: o(c), disabled:
|
|
3292
|
+
const { disabled: h } = u;
|
|
3293
|
+
return { label: r, modelValue: o(c), disabled: h };
|
|
3294
3294
|
}, m = () => {
|
|
3295
3295
|
var c, u;
|
|
3296
3296
|
const r = (u = (c = t.value) == null ? void 0 : c.$el) == null ? void 0 : u.querySelector("input");
|
|
3297
3297
|
r != null && r.showPicker && r.showPicker();
|
|
3298
3298
|
};
|
|
3299
|
-
return (r, c) => (f(), M(
|
|
3299
|
+
return (r, c) => (f(), M(Ie, Y(a, {
|
|
3300
3300
|
onClick: c[0] || (c[0] = (u) => l("click", u)),
|
|
3301
3301
|
onEdit: c[1] || (c[1] = (u) => l("edit", u)),
|
|
3302
3302
|
onClone: c[2] || (c[2] = (u) => l("clone", u))
|
|
3303
3303
|
}), {
|
|
3304
|
-
icon:
|
|
3305
|
-
I(r.$slots, "icon",
|
|
3304
|
+
icon: x((u) => [
|
|
3305
|
+
I(r.$slots, "icon", se(ne(u)))
|
|
3306
3306
|
]),
|
|
3307
|
-
header:
|
|
3307
|
+
header: x((u) => [
|
|
3308
3308
|
n("div", null, [
|
|
3309
|
-
|
|
3309
|
+
p(R, {
|
|
3310
3310
|
type: "icon",
|
|
3311
3311
|
class: "text-gray-dark-25 dark:text-gray-light-10",
|
|
3312
|
-
onClick:
|
|
3312
|
+
onClick: Q(m, ["stop"])
|
|
3313
3313
|
}, {
|
|
3314
|
-
default:
|
|
3315
|
-
|
|
3314
|
+
default: x(() => [
|
|
3315
|
+
p(V, {
|
|
3316
3316
|
name: "clock",
|
|
3317
3317
|
class: "size-7"
|
|
3318
3318
|
})
|
|
3319
3319
|
]),
|
|
3320
3320
|
_: 1
|
|
3321
3321
|
}),
|
|
3322
|
-
|
|
3322
|
+
p(ie, Y({
|
|
3323
3323
|
ref_key: "time",
|
|
3324
3324
|
ref: t
|
|
3325
3325
|
}, d(u), {
|
|
@@ -3330,9 +3330,9 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
3330
3330
|
}), null, 16)
|
|
3331
3331
|
])
|
|
3332
3332
|
]),
|
|
3333
|
-
dialog:
|
|
3333
|
+
dialog: x((u) => [
|
|
3334
3334
|
n("div", ai, [
|
|
3335
|
-
|
|
3335
|
+
p(ie, Y(d(u), {
|
|
3336
3336
|
type: "datetime-local",
|
|
3337
3337
|
onChange: i
|
|
3338
3338
|
}), null, 16)
|
|
@@ -3341,15 +3341,15 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
3341
3341
|
_: 3
|
|
3342
3342
|
}, 16));
|
|
3343
3343
|
}
|
|
3344
|
-
}), si = { class: "flex justify-end" }, ni = {
|
|
3344
|
+
}), si = { class: "flex justify-end" }, ni = {
|
|
3345
3345
|
class: /* @__PURE__ */ B("text-blue-600 dark:text-blue-400")
|
|
3346
|
-
},
|
|
3346
|
+
}, li = {
|
|
3347
3347
|
width: "30",
|
|
3348
3348
|
height: "30",
|
|
3349
3349
|
viewBox: "-7.5 -7.5 75 75",
|
|
3350
3350
|
version: "1.1",
|
|
3351
3351
|
style: { transform: "rotate(-90deg)" }
|
|
3352
|
-
},
|
|
3352
|
+
}, oi = ["stroke-dashoffset"], ii = { class: "absolute top-1/2 left-1/2 -translate-1/2 text-white z-10 font-bold text-xl" }, _d = /* @__PURE__ */ O({
|
|
3353
3353
|
__name: "CardDimmer",
|
|
3354
3354
|
props: {
|
|
3355
3355
|
size: {},
|
|
@@ -3370,67 +3370,65 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
3370
3370
|
emits: ["edit", "close", "click", "clone", "open", "setState"],
|
|
3371
3371
|
setup(e, { emit: s }) {
|
|
3372
3372
|
const a = e, l = s, t = F(0), o = ({ opts: c, value: u }) => Math.round(100 * +u / ((c == null ? void 0 : c.max) || 255)), i = ({ opts: c, value: u }) => Math.round(187 - +u / ((c == null ? void 0 : c.max) || 255) * 187), d = ({ value: c, opts: u }) => {
|
|
3373
|
-
const { min:
|
|
3374
|
-
return { min:
|
|
3373
|
+
const { min: h = 0, max: k = 255, step: v = 1, disabled: y } = u || {};
|
|
3374
|
+
return { min: h, max: k, step: v, value: c, disabled: !!y, class: y ? "" : "cursor-pointer" };
|
|
3375
3375
|
}, m = (c) => l("setState", +c.target.value || 0), r = ({ value: c }) => {
|
|
3376
3376
|
+c != 0 ? (t.value = +c, l("setState", 0)) : l("setState", c ? 0 : t.value || 255);
|
|
3377
3377
|
};
|
|
3378
|
-
return (c, u) => (f(), M(
|
|
3379
|
-
onClick: u[0] || (u[0] = (
|
|
3380
|
-
onEdit: u[1] || (u[1] = (
|
|
3381
|
-
onClone: u[2] || (u[2] = (
|
|
3378
|
+
return (c, u) => (f(), M(Ie, Y(a, {
|
|
3379
|
+
onClick: u[0] || (u[0] = (h) => l("click", h)),
|
|
3380
|
+
onEdit: u[1] || (u[1] = (h) => l("edit", h)),
|
|
3381
|
+
onClone: u[2] || (u[2] = (h) => l("clone", h))
|
|
3382
3382
|
}), {
|
|
3383
|
-
icon:
|
|
3384
|
-
I(c.$slots, "icon",
|
|
3383
|
+
icon: x((h) => [
|
|
3384
|
+
I(c.$slots, "icon", se(ne(h)))
|
|
3385
3385
|
]),
|
|
3386
|
-
header:
|
|
3386
|
+
header: x((h) => [
|
|
3387
3387
|
n("div", si, [
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
(
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
}, 1040, ["onClick"])
|
|
3420
|
-
])
|
|
3388
|
+
p(R, Y(d(h), {
|
|
3389
|
+
type: "icon",
|
|
3390
|
+
onClick: Q((k) => r(h), ["stop"])
|
|
3391
|
+
}), {
|
|
3392
|
+
default: x(() => [
|
|
3393
|
+
n("div", ni, [
|
|
3394
|
+
(f(), g("svg", li, [
|
|
3395
|
+
u[3] || (u[3] = n("circle", {
|
|
3396
|
+
class: "stroke-gray-light-10 dark:stroke-gray-dark-30",
|
|
3397
|
+
r: "30",
|
|
3398
|
+
cx: "30",
|
|
3399
|
+
cy: "30",
|
|
3400
|
+
fill: "transparent",
|
|
3401
|
+
"stroke-width": "10"
|
|
3402
|
+
}, null, -1)),
|
|
3403
|
+
n("circle", {
|
|
3404
|
+
r: "30",
|
|
3405
|
+
cx: "30",
|
|
3406
|
+
cy: "30",
|
|
3407
|
+
stroke: "currentColor",
|
|
3408
|
+
"stroke-width": "8",
|
|
3409
|
+
"stroke-linecap": "butt",
|
|
3410
|
+
"stroke-dashoffset": i(h),
|
|
3411
|
+
fill: "transparent",
|
|
3412
|
+
"stroke-dasharray": "187"
|
|
3413
|
+
}, null, 8, oi)
|
|
3414
|
+
]))
|
|
3415
|
+
])
|
|
3416
|
+
]),
|
|
3417
|
+
_: 2
|
|
3418
|
+
}, 1040, ["onClick"])
|
|
3421
3419
|
])
|
|
3422
3420
|
]),
|
|
3423
|
-
dialog:
|
|
3421
|
+
dialog: x((h) => [
|
|
3424
3422
|
n("div", {
|
|
3425
|
-
class: B(["flex justify-center relative mx-2 my-6", d(
|
|
3423
|
+
class: B(["flex justify-center relative mx-2 my-6", d(h).disabled ? "opacity-40" : ""])
|
|
3426
3424
|
}, [
|
|
3427
3425
|
u[4] || (u[4] = n("div", { class: "absolute h-10 w-full top-0 left-0 bg-gray-main dark:bg-gray-dark-30 z-0 rounded-md" }, null, -1)),
|
|
3428
3426
|
n("div", {
|
|
3429
3427
|
class: "absolute h-10 top-0 left-0 bg-blue-600 dark:bg-blue-400 z-0 rounded-md transition-[width_0.3s_linear]",
|
|
3430
|
-
style:
|
|
3428
|
+
style: Ve(`width: ${o(h)}%`)
|
|
3431
3429
|
}, null, 4),
|
|
3432
|
-
n("div",
|
|
3433
|
-
n("input", Y({ type: "range" }, d(
|
|
3430
|
+
n("div", ii, C(o(h)) + " %", 1),
|
|
3431
|
+
n("input", Y({ type: "range" }, d(h), {
|
|
3434
3432
|
class: "w-full h-10 z-10 appearance-none opacity-0",
|
|
3435
3433
|
onChange: m
|
|
3436
3434
|
}), null, 16)
|
|
@@ -3439,7 +3437,7 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
3439
3437
|
_: 3
|
|
3440
3438
|
}, 16));
|
|
3441
3439
|
}
|
|
3442
|
-
}),
|
|
3440
|
+
}), Td = /* @__PURE__ */ O({
|
|
3443
3441
|
__name: "CardInfo",
|
|
3444
3442
|
props: {
|
|
3445
3443
|
size: {},
|
|
@@ -3460,21 +3458,21 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
3460
3458
|
emits: ["edit", "close", "click", "clone", "open", "setState"],
|
|
3461
3459
|
setup(e, { emit: s }) {
|
|
3462
3460
|
const a = e, l = s;
|
|
3463
|
-
return (t, o) => (f(), M(
|
|
3461
|
+
return (t, o) => (f(), M(Ie, Y(a, {
|
|
3464
3462
|
onClick: o[0] || (o[0] = (i) => l("click", i)),
|
|
3465
3463
|
onEdit: o[1] || (o[1] = (i) => l("edit", i)),
|
|
3466
3464
|
onClone: o[2] || (o[2] = (i) => l("clone", i))
|
|
3467
3465
|
}), {
|
|
3468
|
-
icon:
|
|
3469
|
-
I(t.$slots, "icon",
|
|
3466
|
+
icon: x((i) => [
|
|
3467
|
+
I(t.$slots, "icon", se(ne(i)))
|
|
3470
3468
|
]),
|
|
3471
|
-
default:
|
|
3469
|
+
default: x(() => [
|
|
3472
3470
|
I(t.$slots, "dialog")
|
|
3473
3471
|
]),
|
|
3474
3472
|
_: 3
|
|
3475
3473
|
}, 16));
|
|
3476
3474
|
}
|
|
3477
|
-
}),
|
|
3475
|
+
}), ri = { class: "flex justify-center relative mx-2 my-6" }, zd = /* @__PURE__ */ O({
|
|
3478
3476
|
__name: "CardInput",
|
|
3479
3477
|
props: {
|
|
3480
3478
|
size: {},
|
|
@@ -3503,25 +3501,25 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
3503
3501
|
(d) => {
|
|
3504
3502
|
t.value = d;
|
|
3505
3503
|
}
|
|
3506
|
-
), (d, m) => (f(), M(
|
|
3504
|
+
), (d, m) => (f(), M(Ie, Y(a, {
|
|
3507
3505
|
onClick: m[1] || (m[1] = (r) => l("click", r)),
|
|
3508
3506
|
onEdit: m[2] || (m[2] = (r) => l("edit", r)),
|
|
3509
3507
|
onClone: m[3] || (m[3] = (r) => l("clone", r))
|
|
3510
3508
|
}), {
|
|
3511
|
-
icon:
|
|
3512
|
-
I(d.$slots, "icon",
|
|
3509
|
+
icon: x((r) => [
|
|
3510
|
+
I(d.$slots, "icon", se(ne(r)))
|
|
3513
3511
|
]),
|
|
3514
|
-
dialog:
|
|
3515
|
-
n("div",
|
|
3516
|
-
|
|
3512
|
+
dialog: x((r) => [
|
|
3513
|
+
n("div", ri, [
|
|
3514
|
+
p(ie, Y({
|
|
3517
3515
|
modelValue: t.value,
|
|
3518
3516
|
"onUpdate:modelValue": m[0] || (m[0] = (c) => t.value = c)
|
|
3519
3517
|
}, o(r), {
|
|
3520
3518
|
onEnter: i,
|
|
3521
3519
|
onBlur: i
|
|
3522
3520
|
}), {
|
|
3523
|
-
icon:
|
|
3524
|
-
|
|
3521
|
+
icon: x(() => [
|
|
3522
|
+
p(V, {
|
|
3525
3523
|
name: "chevron-down",
|
|
3526
3524
|
class: "size-8 -rotate-90"
|
|
3527
3525
|
})
|
|
@@ -3533,7 +3531,7 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
3533
3531
|
_: 3
|
|
3534
3532
|
}, 16));
|
|
3535
3533
|
}
|
|
3536
|
-
}),
|
|
3534
|
+
}), di = { class: "flex justify-center py-4" }, Ad = /* @__PURE__ */ O({
|
|
3537
3535
|
__name: "CardList",
|
|
3538
3536
|
props: {
|
|
3539
3537
|
size: {},
|
|
@@ -3558,42 +3556,42 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
3558
3556
|
return Array.isArray(d == null ? void 0 : d.items) && ((r = d == null ? void 0 : d.items.find((c) => c.value == m)) == null ? void 0 : r.name) || m;
|
|
3559
3557
|
}, i = ({ name: d, value: m, opts: r = {} }) => {
|
|
3560
3558
|
var k;
|
|
3561
|
-
const { items: c = [], disabled: u } = r,
|
|
3562
|
-
return { label: d, modelValue:
|
|
3559
|
+
const { items: c = [], disabled: u } = r, h = ((k = c.find((v) => v.value == m)) == null ? void 0 : k.name) || m;
|
|
3560
|
+
return { label: d, modelValue: h, items: c, disabled: !!u };
|
|
3563
3561
|
};
|
|
3564
|
-
return (d, m) => (f(), M(
|
|
3562
|
+
return (d, m) => (f(), M(Ie, Y(a, {
|
|
3565
3563
|
onClick: m[1] || (m[1] = (r) => l("click", r)),
|
|
3566
3564
|
onEdit: m[2] || (m[2] = (r) => l("edit", r)),
|
|
3567
3565
|
onClone: m[3] || (m[3] = (r) => l("clone", r))
|
|
3568
3566
|
}), {
|
|
3569
|
-
icon:
|
|
3570
|
-
I(d.$slots, "icon",
|
|
3567
|
+
icon: x((r) => [
|
|
3568
|
+
I(d.$slots, "icon", se(ne(r)))
|
|
3571
3569
|
]),
|
|
3572
|
-
value:
|
|
3570
|
+
value: x((r) => [
|
|
3573
3571
|
L(C(o(r)), 1)
|
|
3574
3572
|
]),
|
|
3575
|
-
"dialog-value":
|
|
3573
|
+
"dialog-value": x((r) => [
|
|
3576
3574
|
L(C(o(r)), 1)
|
|
3577
3575
|
]),
|
|
3578
|
-
header:
|
|
3576
|
+
header: x((r) => [
|
|
3579
3577
|
n("div", {
|
|
3580
|
-
onClick: m[0] || (m[0] =
|
|
3578
|
+
onClick: m[0] || (m[0] = Q(() => {
|
|
3581
3579
|
}, ["prevent", "stop"]))
|
|
3582
3580
|
}, [
|
|
3583
|
-
|
|
3581
|
+
p(he, Y(i(r), {
|
|
3584
3582
|
"is-popup": "",
|
|
3585
3583
|
top: "0",
|
|
3586
3584
|
left: "-115px",
|
|
3587
3585
|
onChange: t
|
|
3588
3586
|
}), {
|
|
3589
|
-
activator:
|
|
3590
|
-
|
|
3587
|
+
activator: x(({ on: c }) => [
|
|
3588
|
+
p(R, {
|
|
3591
3589
|
type: "icon",
|
|
3592
3590
|
class: "text-gray-dark-25 dark:text-gray-light-10",
|
|
3593
|
-
onClick:
|
|
3591
|
+
onClick: Q(c.click, ["stop"])
|
|
3594
3592
|
}, {
|
|
3595
|
-
default:
|
|
3596
|
-
|
|
3593
|
+
default: x(() => [
|
|
3594
|
+
p(V, {
|
|
3597
3595
|
name: "list-check",
|
|
3598
3596
|
class: "size-5"
|
|
3599
3597
|
})
|
|
@@ -3605,9 +3603,9 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
3605
3603
|
}, 16)
|
|
3606
3604
|
])
|
|
3607
3605
|
]),
|
|
3608
|
-
dialog:
|
|
3609
|
-
n("div",
|
|
3610
|
-
|
|
3606
|
+
dialog: x((r) => [
|
|
3607
|
+
n("div", di, [
|
|
3608
|
+
p(he, Y(i(r), {
|
|
3611
3609
|
top: "-50%",
|
|
3612
3610
|
left: "50%",
|
|
3613
3611
|
onChange: t
|
|
@@ -3617,7 +3615,95 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
3617
3615
|
_: 3
|
|
3618
3616
|
}, 16));
|
|
3619
3617
|
}
|
|
3620
|
-
}),
|
|
3618
|
+
}), ci = { class: "flex justify-end" }, ui = { class: "font-mono" }, mi = { class: "px-2 pb-2" }, fi = { class: "grid grid-cols-4 gap-2" }, gi = ["title", "aria-label", "onClick"], vi = { class: "mt-3 flex items-center justify-center gap-2" }, pi = ["value"], Ed = /* @__PURE__ */ O({
|
|
3619
|
+
__name: "CardPalette",
|
|
3620
|
+
props: {
|
|
3621
|
+
size: {},
|
|
3622
|
+
id: {},
|
|
3623
|
+
name: {},
|
|
3624
|
+
type: {},
|
|
3625
|
+
entityType: {},
|
|
3626
|
+
icon: {},
|
|
3627
|
+
opts: {},
|
|
3628
|
+
args: {},
|
|
3629
|
+
get: {},
|
|
3630
|
+
getTo: {},
|
|
3631
|
+
set: {},
|
|
3632
|
+
meta: {},
|
|
3633
|
+
value: {},
|
|
3634
|
+
valueTo: {}
|
|
3635
|
+
},
|
|
3636
|
+
emits: ["edit", "close", "click", "clone", "open", "setState"],
|
|
3637
|
+
setup(e, { emit: s }) {
|
|
3638
|
+
const a = e, l = s, t = ["#FF0000", "#FFD400", "#7CFF00", "#0000FF"], o = F(""), i = S(() => {
|
|
3639
|
+
const k = String(a.valueTo ?? a.value ?? "").trim().toUpperCase(), v = k.startsWith("#") ? k : k ? `#${k}` : "";
|
|
3640
|
+
return /^#[0-9A-F]{6}$/.test(v) && v !== "#000000" ? v : "";
|
|
3641
|
+
}), d = S(() => i.value || "#000000"), m = (k) => i.value === k.toUpperCase(), r = (k) => l("setState", k), c = rt((k) => r(k), 120), u = (k) => {
|
|
3642
|
+
const v = k.target;
|
|
3643
|
+
c(v.value.toUpperCase());
|
|
3644
|
+
}, h = () => {
|
|
3645
|
+
i.value ? (o.value = i.value, r("")) : r(o.value || t[0]);
|
|
3646
|
+
};
|
|
3647
|
+
return (k, v) => (f(), M(Ie, Y(a, {
|
|
3648
|
+
onClick: v[0] || (v[0] = (y) => l("click", y)),
|
|
3649
|
+
onEdit: v[1] || (v[1] = (y) => l("edit", y)),
|
|
3650
|
+
onClone: v[2] || (v[2] = (y) => l("clone", y)),
|
|
3651
|
+
onOpen: v[3] || (v[3] = (y) => l("open", y)),
|
|
3652
|
+
onClose: v[4] || (v[4] = (y) => l("close", y))
|
|
3653
|
+
}), {
|
|
3654
|
+
icon: x((y) => [
|
|
3655
|
+
I(k.$slots, "icon", se(ne(y)))
|
|
3656
|
+
]),
|
|
3657
|
+
header: x(() => [
|
|
3658
|
+
n("div", ci, [
|
|
3659
|
+
p(R, {
|
|
3660
|
+
type: "icon",
|
|
3661
|
+
title: i.value ? "Disable" : "Enable",
|
|
3662
|
+
"aria-label": i.value ? "Disable" : "Enable",
|
|
3663
|
+
onClick: Q(h, ["stop"])
|
|
3664
|
+
}, {
|
|
3665
|
+
default: x(() => [
|
|
3666
|
+
p(V, {
|
|
3667
|
+
name: "palette",
|
|
3668
|
+
class: "size-6"
|
|
3669
|
+
})
|
|
3670
|
+
]),
|
|
3671
|
+
_: 1
|
|
3672
|
+
}, 8, ["title", "aria-label"])
|
|
3673
|
+
])
|
|
3674
|
+
]),
|
|
3675
|
+
value: x(() => [
|
|
3676
|
+
n("span", ui, C(i.value || "OFF"), 1)
|
|
3677
|
+
]),
|
|
3678
|
+
dialog: x(() => [
|
|
3679
|
+
n("div", mi, [
|
|
3680
|
+
n("div", fi, [
|
|
3681
|
+
(f(), g(D, null, U(t, (y) => n("button", {
|
|
3682
|
+
key: y,
|
|
3683
|
+
type: "button",
|
|
3684
|
+
class: B(["aspect-square rounded-lg border border-white/20 transition-transform hover:scale-105", m(y) ? "ring-2 ring-white ring-offset-2 ring-offset-gray-dark-40" : ""]),
|
|
3685
|
+
style: Ve({ background: y }),
|
|
3686
|
+
title: y,
|
|
3687
|
+
"aria-label": y,
|
|
3688
|
+
onClick: (z) => r(y)
|
|
3689
|
+
}, null, 14, gi)), 64))
|
|
3690
|
+
]),
|
|
3691
|
+
n("div", vi, [
|
|
3692
|
+
n("input", {
|
|
3693
|
+
type: "color",
|
|
3694
|
+
value: d.value,
|
|
3695
|
+
class: "h-12 w-12 cursor-pointer rounded-md border border-gray-light-10 bg-transparent p-1 dark:border-gray-dark-30",
|
|
3696
|
+
title: "Custom color",
|
|
3697
|
+
"aria-label": "Custom color",
|
|
3698
|
+
onInput: u
|
|
3699
|
+
}, null, 40, pi)
|
|
3700
|
+
])
|
|
3701
|
+
])
|
|
3702
|
+
]),
|
|
3703
|
+
_: 3
|
|
3704
|
+
}, 16));
|
|
3705
|
+
}
|
|
3706
|
+
}), hi = { class: "glass-inset rounded-md p-1" }, yi = { class: "flex gap-1" }, bi = ["onClick"], xi = { class: "relative my-4" }, ki = { key: 0 }, $i = /* @__PURE__ */ O({
|
|
3621
3707
|
__name: "VTabs",
|
|
3622
3708
|
props: {
|
|
3623
3709
|
value: {},
|
|
@@ -3635,9 +3721,9 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
3635
3721
|
setActiveTab: i,
|
|
3636
3722
|
activeTab: t
|
|
3637
3723
|
}), (d, m) => (f(), g("div", null, [
|
|
3638
|
-
n("div",
|
|
3639
|
-
n("div",
|
|
3640
|
-
(f(!0), g(
|
|
3724
|
+
n("div", hi, [
|
|
3725
|
+
n("div", yi, [
|
|
3726
|
+
(f(!0), g(D, null, U(e.items, (r, c) => (f(), g("div", {
|
|
3641
3727
|
key: c,
|
|
3642
3728
|
class: "relative flex-auto"
|
|
3643
3729
|
}, [
|
|
@@ -3658,16 +3744,16 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
3658
3744
|
}, C(r.title), 3)
|
|
3659
3745
|
])
|
|
3660
3746
|
], 2)
|
|
3661
|
-
], 8,
|
|
3747
|
+
], 8, bi)
|
|
3662
3748
|
]))), 128))
|
|
3663
3749
|
])
|
|
3664
3750
|
]),
|
|
3665
|
-
n("div",
|
|
3666
|
-
(f(!0), g(
|
|
3751
|
+
n("div", xi, [
|
|
3752
|
+
(f(!0), g(D, null, U(e.items, (r, c) => (f(), g("div", {
|
|
3667
3753
|
key: c,
|
|
3668
3754
|
class: "tab-panel"
|
|
3669
3755
|
}, [
|
|
3670
|
-
|
|
3756
|
+
p(kt, {
|
|
3671
3757
|
"enter-active-class": "transition-all duration-300 ease-out",
|
|
3672
3758
|
"enter-from-class": "transform opacity-0 translate-x-2",
|
|
3673
3759
|
"enter-to-class": "transform opacity-100 translate-x-0",
|
|
@@ -3675,8 +3761,8 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
3675
3761
|
"leave-from-class": "transform opacity-100 translate-x-0",
|
|
3676
3762
|
"leave-to-class": "transform opacity-0 -translate-x-2"
|
|
3677
3763
|
}, {
|
|
3678
|
-
default:
|
|
3679
|
-
t.value === c ? (f(), g("div",
|
|
3764
|
+
default: x(() => [
|
|
3765
|
+
t.value === c ? (f(), g("div", ki, [
|
|
3680
3766
|
I(d.$slots, `tab-${c}`)
|
|
3681
3767
|
])) : T("", !0)
|
|
3682
3768
|
]),
|
|
@@ -3686,7 +3772,7 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
3686
3772
|
])
|
|
3687
3773
|
]));
|
|
3688
3774
|
}
|
|
3689
|
-
}),
|
|
3775
|
+
}), wi = ["checked", "disabled"], Ci = { class: "text-sm ms-2 peer-disabled:opacity-40" }, Si = /* @__PURE__ */ O({
|
|
3690
3776
|
__name: "VCheckbox",
|
|
3691
3777
|
props: {
|
|
3692
3778
|
modelValue: { type: [Number, Boolean], default: !1 },
|
|
@@ -3708,7 +3794,7 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
3708
3794
|
disabled: e.disabled,
|
|
3709
3795
|
class: "peer size-5 appearance-none rounded-md border border-gray-light-10/80 bg-transparent transition-all checked:border-blue-main disabled:opacity-40 not-disabled:cursor-pointer dark:border-white/15",
|
|
3710
3796
|
onChange: l
|
|
3711
|
-
}, null, 40,
|
|
3797
|
+
}, null, 40, wi),
|
|
3712
3798
|
i[0] || (i[0] = n("button", { class: "pointer-events-none absolute left-2.5 top-1/2 -translate-x-1/2 -translate-y-1/2 text-blue-main opacity-0 peer-checked:opacity-100 peer-disabled:opacity-40 dark:text-white" }, [
|
|
3713
3799
|
n("svg", {
|
|
3714
3800
|
class: "h-3.5 w-3.5",
|
|
@@ -3724,15 +3810,15 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
3724
3810
|
})
|
|
3725
3811
|
])
|
|
3726
3812
|
], -1)),
|
|
3727
|
-
n("span",
|
|
3813
|
+
n("span", Ci, [
|
|
3728
3814
|
I(o.$slots, "default")
|
|
3729
3815
|
])
|
|
3730
3816
|
], 2));
|
|
3731
3817
|
}
|
|
3732
|
-
}),
|
|
3818
|
+
}), _i = { class: "flex flex-col" }, Ti = { class: "flex gap-4 mb-6" }, zi = {
|
|
3733
3819
|
key: 0,
|
|
3734
3820
|
class: "flex gap-4"
|
|
3735
|
-
},
|
|
3821
|
+
}, Ai = { key: 1 }, Ei = { class: "flex flex-col md:flex-row gap-4" }, Bi = { class: "flex gap-4" }, Vi = { class: "flex justify-between flex-auto" }, Ii = ["onClick"], Li = /* @__PURE__ */ O({
|
|
3736
3822
|
__name: "ItemOptions",
|
|
3737
3823
|
props: {
|
|
3738
3824
|
min: { default: 0 },
|
|
@@ -3745,72 +3831,72 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
3745
3831
|
},
|
|
3746
3832
|
emits: ["update"],
|
|
3747
3833
|
setup(e, { emit: s }) {
|
|
3748
|
-
const a = s, l = S(() => e.items.map((
|
|
3749
|
-
var
|
|
3750
|
-
return !((
|
|
3751
|
-
}), d = (
|
|
3752
|
-
const
|
|
3753
|
-
t.value = { name: `New_${
|
|
3754
|
-
},
|
|
3755
|
-
t.value.name ===
|
|
3756
|
-
}, k =
|
|
3757
|
-
const
|
|
3758
|
-
if (!
|
|
3759
|
-
const
|
|
3760
|
-
m("items", r(
|
|
3834
|
+
const a = s, l = S(() => e.items.map((v, y) => ({ ...v, id: ++y }))), t = F({ name: "", value: "" }), o = S(() => e.items.length + 1), i = S(() => {
|
|
3835
|
+
var v;
|
|
3836
|
+
return !((v = t.value) != null && v.id);
|
|
3837
|
+
}), d = (v) => e.type === v, m = (v, y) => a("update", v, y), r = (v) => v.map(({ name: y, value: z }) => ({ name: y, value: z })), c = ({ id: v, name: y, value: z }) => t.value = { id: v, name: y, value: z }, u = () => {
|
|
3838
|
+
const v = o.value;
|
|
3839
|
+
t.value = { name: `New_${v}`, value: `${v}`, id: v }, m("items", r([...l.value, t.value]));
|
|
3840
|
+
}, h = (v) => {
|
|
3841
|
+
t.value.name === v.name && (t.value = { name: "", value: "" }), m("items", r(l.value.filter((y) => y.value !== v.value)));
|
|
3842
|
+
}, k = rt(() => {
|
|
3843
|
+
const v = t.value;
|
|
3844
|
+
if (!v.name || !v.value) return;
|
|
3845
|
+
const y = l.value.map((z) => z.id === v.id ? v : z);
|
|
3846
|
+
m("items", r(y));
|
|
3761
3847
|
}, 300);
|
|
3762
|
-
return (
|
|
3763
|
-
n("div",
|
|
3764
|
-
|
|
3848
|
+
return (v, y) => (f(), g("div", _i, [
|
|
3849
|
+
n("div", Ti, [
|
|
3850
|
+
p(Si, {
|
|
3765
3851
|
modelValue: e.disabled,
|
|
3766
|
-
"onUpdate:modelValue":
|
|
3852
|
+
"onUpdate:modelValue": y[0] || (y[0] = (z) => m("disabled", z ? 1 : 0))
|
|
3767
3853
|
}, {
|
|
3768
|
-
default:
|
|
3854
|
+
default: x(() => [...y[6] || (y[6] = [
|
|
3769
3855
|
L("Disabled", -1)
|
|
3770
3856
|
])]),
|
|
3771
3857
|
_: 1
|
|
3772
3858
|
}, 8, ["modelValue"])
|
|
3773
3859
|
]),
|
|
3774
|
-
d("dimmer") ? (f(), g("div",
|
|
3775
|
-
|
|
3860
|
+
d("dimmer") ? (f(), g("div", zi, [
|
|
3861
|
+
p(ie, {
|
|
3776
3862
|
modelValue: e.min,
|
|
3777
3863
|
label: "Min",
|
|
3778
|
-
"onUpdate:modelValue":
|
|
3864
|
+
"onUpdate:modelValue": y[1] || (y[1] = (z) => m("min", +z))
|
|
3779
3865
|
}, null, 8, ["modelValue"]),
|
|
3780
|
-
|
|
3866
|
+
p(ie, {
|
|
3781
3867
|
modelValue: e.max,
|
|
3782
3868
|
label: "Max",
|
|
3783
|
-
"onUpdate:modelValue":
|
|
3869
|
+
"onUpdate:modelValue": y[2] || (y[2] = (z) => m("max", +z))
|
|
3784
3870
|
}, null, 8, ["modelValue"]),
|
|
3785
|
-
|
|
3871
|
+
p(ie, {
|
|
3786
3872
|
modelValue: e.step,
|
|
3787
3873
|
label: "Step",
|
|
3788
|
-
"onUpdate:modelValue":
|
|
3874
|
+
"onUpdate:modelValue": y[3] || (y[3] = (z) => m("step", +z))
|
|
3789
3875
|
}, null, 8, ["modelValue"])
|
|
3790
3876
|
])) : T("", !0),
|
|
3791
|
-
d("list") ? (f(), g("div",
|
|
3792
|
-
n("div",
|
|
3793
|
-
|
|
3877
|
+
d("list") ? (f(), g("div", Ai, [
|
|
3878
|
+
n("div", Ei, [
|
|
3879
|
+
p(ie, {
|
|
3794
3880
|
modelValue: t.value.name,
|
|
3795
3881
|
"onUpdate:modelValue": [
|
|
3796
|
-
|
|
3882
|
+
y[4] || (y[4] = (z) => t.value.name = z),
|
|
3797
3883
|
J(k)
|
|
3798
3884
|
],
|
|
3799
3885
|
disabled: i.value,
|
|
3800
3886
|
label: "Name"
|
|
3801
3887
|
}, null, 8, ["modelValue", "disabled", "onUpdate:modelValue"]),
|
|
3802
|
-
|
|
3888
|
+
p(ie, {
|
|
3803
3889
|
modelValue: t.value.value,
|
|
3804
3890
|
"onUpdate:modelValue": [
|
|
3805
|
-
|
|
3891
|
+
y[5] || (y[5] = (z) => t.value.value = z),
|
|
3806
3892
|
J(k)
|
|
3807
3893
|
],
|
|
3808
3894
|
disabled: i.value,
|
|
3809
3895
|
label: "Value"
|
|
3810
3896
|
}, null, 8, ["modelValue", "disabled", "onUpdate:modelValue"])
|
|
3811
3897
|
]),
|
|
3812
|
-
n("div",
|
|
3813
|
-
|
|
3898
|
+
n("div", Bi, [
|
|
3899
|
+
p(he, {
|
|
3814
3900
|
"model-value": t.value.value,
|
|
3815
3901
|
label: "List",
|
|
3816
3902
|
items: l.value,
|
|
@@ -3818,29 +3904,29 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
3818
3904
|
bottom: "0",
|
|
3819
3905
|
onChange: c
|
|
3820
3906
|
}, {
|
|
3821
|
-
item:
|
|
3822
|
-
n("div",
|
|
3907
|
+
item: x(({ item: z }) => [
|
|
3908
|
+
n("div", Vi, [
|
|
3823
3909
|
n("span", null, C(z.name), 1),
|
|
3824
3910
|
n("button", {
|
|
3825
3911
|
class: "cursor-pointer size-4",
|
|
3826
|
-
onClick:
|
|
3912
|
+
onClick: Q((j) => h(z), ["prevent", "stop"])
|
|
3827
3913
|
}, [
|
|
3828
|
-
|
|
3914
|
+
p(V, {
|
|
3829
3915
|
name: "close",
|
|
3830
3916
|
class: "size-5"
|
|
3831
3917
|
})
|
|
3832
|
-
], 8,
|
|
3918
|
+
], 8, Ii)
|
|
3833
3919
|
])
|
|
3834
3920
|
]),
|
|
3835
3921
|
_: 1
|
|
3836
3922
|
}, 8, ["model-value", "items"]),
|
|
3837
|
-
|
|
3923
|
+
p(R, {
|
|
3838
3924
|
class: "px-4",
|
|
3839
3925
|
color: "blue",
|
|
3840
3926
|
onClick: u
|
|
3841
3927
|
}, {
|
|
3842
|
-
default:
|
|
3843
|
-
|
|
3928
|
+
default: x(() => [
|
|
3929
|
+
p(V, {
|
|
3844
3930
|
name: "add",
|
|
3845
3931
|
class: "size-5"
|
|
3846
3932
|
})
|
|
@@ -3851,7 +3937,7 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
3851
3937
|
])) : T("", !0)
|
|
3852
3938
|
]));
|
|
3853
3939
|
}
|
|
3854
|
-
}),
|
|
3940
|
+
}), Mi = { class: "flex flex-col" }, Oi = { class: "flex flex-col md:flex-row gap-6 min-h-72" }, Fi = { class: "flex-auto order-1" }, Di = { class: "flex-auto gap-x-2 order-1" }, ji = { class: "grid grid-cols-1 md:grid-cols-2 gap-6" }, Ni = { class: "flex gap-2 items-center" }, Pi = { class: "flex flex-col gap-4" }, Ri = { class: "flex gap-2 flex-wrap flex-auto px-2 py-1" }, Ui = { class: "relative group" }, Ki = { class: "select-none" }, Wi = ["onClick"], Hi = { class: "flex justify-center order-0 md:order-1" }, Gi = { class: "size-32 shrink-0" }, Ji = { class: "flex gap-4 justify-end" }, qi = { class: "relative min-h-52 max-h-100dvh overflow-auto scrollbar" }, Bd = /* @__PURE__ */ O({
|
|
3855
3941
|
__name: "ItemEdit",
|
|
3856
3942
|
props: {
|
|
3857
3943
|
items: {},
|
|
@@ -3885,16 +3971,16 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
3885
3971
|
if (d.value) return !0;
|
|
3886
3972
|
const { id: w, args: A } = t.value;
|
|
3887
3973
|
return !w || !A.length;
|
|
3888
|
-
}),
|
|
3974
|
+
}), h = ({ value: w }) => t.value.icon = w, k = ({ value: w }) => {
|
|
3889
3975
|
const A = w;
|
|
3890
3976
|
t.value.type = A, delete t.value.opts, ["button", "list", "dimmer"].includes(A) && (w === "button" && (t.value.opts = {}), w === "list" && (t.value.opts = { items: [] }), w === "dimmer" && (t.value.opts = { min: 0, max: 255, step: 1 }));
|
|
3891
|
-
},
|
|
3977
|
+
}, v = (w) => {
|
|
3892
3978
|
w === "set" && (t.value.set ? delete t.value.set : t.value.set = "v"), w === "get" && (t.value.get ? delete t.value.get : t.value.get = "a"), w === "getTo" && (t.value.getTo ? delete t.value.getTo : t.value.getTo = "v");
|
|
3893
|
-
},
|
|
3979
|
+
}, y = (w) => a("button", w, t.value), z = (w) => t.value.args = t.value.args.filter((A) => A !== w), j = ({ path: w }) => {
|
|
3894
3980
|
!t.value.args.length && !t.value.id && (t.value.id = w), t.value.args.push(w), o.value = !1;
|
|
3895
3981
|
}, H = (w, A) => {
|
|
3896
3982
|
w === "set" && (t.value.set = A), w === "get" && (t.value.get = A), w === "getTo" && (t.value.getTo = A), A || delete t.value[w];
|
|
3897
|
-
},
|
|
3983
|
+
}, N = () => {
|
|
3898
3984
|
o.value = !0;
|
|
3899
3985
|
}, Z = (w, A) => {
|
|
3900
3986
|
t.value.opts || (t.value.opts = {}), t.value.opts[w] = A, w === "disabled" && !A && delete t.value.opts[w];
|
|
@@ -3902,17 +3988,17 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
3902
3988
|
return be(() => {
|
|
3903
3989
|
var w;
|
|
3904
3990
|
(w = e.item) != null && w.id && (t.value = _a(e.item));
|
|
3905
|
-
}), (w, A) => (f(), g("div",
|
|
3906
|
-
n("div",
|
|
3907
|
-
n("div",
|
|
3908
|
-
|
|
3991
|
+
}), (w, A) => (f(), g("div", Mi, [
|
|
3992
|
+
n("div", Oi, [
|
|
3993
|
+
n("div", Fi, [
|
|
3994
|
+
p($i, {
|
|
3909
3995
|
class: "flex-auto min-h-75",
|
|
3910
3996
|
value: 0,
|
|
3911
3997
|
items: l
|
|
3912
3998
|
}, {
|
|
3913
|
-
"tab-0":
|
|
3914
|
-
n("div",
|
|
3915
|
-
|
|
3999
|
+
"tab-0": x(() => [
|
|
4000
|
+
n("div", Di, [
|
|
4001
|
+
p(ie, {
|
|
3916
4002
|
modelValue: t.value.id,
|
|
3917
4003
|
"onUpdate:modelValue": A[0] || (A[0] = (P) => t.value.id = P),
|
|
3918
4004
|
label: "ID",
|
|
@@ -3920,13 +4006,13 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
3920
4006
|
}, va({ _: 2 }, [
|
|
3921
4007
|
r.value ? void 0 : {
|
|
3922
4008
|
name: "icon",
|
|
3923
|
-
fn:
|
|
3924
|
-
|
|
4009
|
+
fn: x(() => [
|
|
4010
|
+
p(R, {
|
|
3925
4011
|
variant: "ghost",
|
|
3926
|
-
onClick:
|
|
4012
|
+
onClick: N
|
|
3927
4013
|
}, {
|
|
3928
|
-
default:
|
|
3929
|
-
|
|
4014
|
+
default: x(() => [
|
|
4015
|
+
p(V, {
|
|
3930
4016
|
name: "search",
|
|
3931
4017
|
class: "size-5"
|
|
3932
4018
|
})
|
|
@@ -3937,23 +4023,23 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
3937
4023
|
key: "0"
|
|
3938
4024
|
}
|
|
3939
4025
|
]), 1032, ["modelValue", "message"]),
|
|
3940
|
-
|
|
4026
|
+
p(ie, {
|
|
3941
4027
|
modelValue: t.value.name,
|
|
3942
4028
|
"onUpdate:modelValue": A[1] || (A[1] = (P) => t.value.name = P),
|
|
3943
4029
|
label: "Name"
|
|
3944
4030
|
}, null, 8, ["modelValue"]),
|
|
3945
|
-
n("div",
|
|
3946
|
-
|
|
4031
|
+
n("div", ji, [
|
|
4032
|
+
p(he, {
|
|
3947
4033
|
"model-value": t.value.icon,
|
|
3948
4034
|
bottom: "0",
|
|
3949
4035
|
top: "unset",
|
|
3950
4036
|
label: "Icon",
|
|
3951
4037
|
class: "mb-6",
|
|
3952
4038
|
items: e.listIcons,
|
|
3953
|
-
onChange:
|
|
4039
|
+
onChange: h
|
|
3954
4040
|
}, {
|
|
3955
|
-
item:
|
|
3956
|
-
n("div",
|
|
4041
|
+
item: x(({ item: P }) => [
|
|
4042
|
+
n("div", Ni, [
|
|
3957
4043
|
I(w.$slots, "icon", {
|
|
3958
4044
|
icon: P.value
|
|
3959
4045
|
}),
|
|
@@ -3962,7 +4048,7 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
3962
4048
|
]),
|
|
3963
4049
|
_: 3
|
|
3964
4050
|
}, 8, ["model-value", "items"]),
|
|
3965
|
-
|
|
4051
|
+
p(he, {
|
|
3966
4052
|
"model-value": t.value.type,
|
|
3967
4053
|
bottom: "0",
|
|
3968
4054
|
top: "unset",
|
|
@@ -3973,39 +4059,39 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
3973
4059
|
])
|
|
3974
4060
|
])
|
|
3975
4061
|
]),
|
|
3976
|
-
"tab-1":
|
|
3977
|
-
n("div",
|
|
3978
|
-
|
|
4062
|
+
"tab-1": x(() => [
|
|
4063
|
+
n("div", Pi, [
|
|
4064
|
+
p(Tt, {
|
|
3979
4065
|
active: !!t.value.args.length,
|
|
3980
4066
|
disabled: c.value,
|
|
3981
4067
|
label: "Arguments",
|
|
3982
4068
|
onIcon: A[2] || (A[2] = (P) => o.value = !0)
|
|
3983
4069
|
}, {
|
|
3984
|
-
default:
|
|
3985
|
-
n("div",
|
|
3986
|
-
(f(!0), g(
|
|
4070
|
+
default: x(() => [
|
|
4071
|
+
n("div", Ri, [
|
|
4072
|
+
(f(!0), g(D, null, U(t.value.args, (P, ae) => (f(), g("div", {
|
|
3987
4073
|
key: P,
|
|
3988
4074
|
class: "flex items-center rounded-full bg-gray-light-10 dark:bg-gray-dark-40/50 px-2 py-1 text-xs"
|
|
3989
4075
|
}, [
|
|
3990
|
-
n("div",
|
|
3991
|
-
n("span",
|
|
4076
|
+
n("div", Ui, [
|
|
4077
|
+
n("span", Ki, C(P), 1)
|
|
3992
4078
|
]),
|
|
3993
4079
|
ae || t.value.args.length < 2 ? (f(), g("button", {
|
|
3994
4080
|
key: 0,
|
|
3995
4081
|
class: "ms-1 shrink-0 cursor-pointer text-gray-main transition hover:text-rose-500",
|
|
3996
4082
|
onClick: (xe) => z(P)
|
|
3997
4083
|
}, [
|
|
3998
|
-
|
|
4084
|
+
p(V, {
|
|
3999
4085
|
name: "close",
|
|
4000
4086
|
class: "size-5"
|
|
4001
4087
|
})
|
|
4002
|
-
], 8,
|
|
4088
|
+
], 8, Wi)) : T("", !0)
|
|
4003
4089
|
]))), 128))
|
|
4004
4090
|
])
|
|
4005
4091
|
]),
|
|
4006
4092
|
_: 1
|
|
4007
4093
|
}, 8, ["active", "disabled"]),
|
|
4008
|
-
|
|
4094
|
+
p(He, {
|
|
4009
4095
|
value: t.value.set,
|
|
4010
4096
|
args: t.value.args,
|
|
4011
4097
|
prefix: ["v"],
|
|
@@ -4013,19 +4099,19 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
4013
4099
|
"argument-title": w.$t("dashboard.argument"),
|
|
4014
4100
|
disabled: !r.value || m.value,
|
|
4015
4101
|
label: "Set",
|
|
4016
|
-
onIcon: A[3] || (A[3] = (P) =>
|
|
4102
|
+
onIcon: A[3] || (A[3] = (P) => v("set")),
|
|
4017
4103
|
onChange: A[4] || (A[4] = (P) => H("set", P))
|
|
4018
4104
|
}, null, 8, ["value", "args", "prefix-titles", "argument-title", "disabled"]),
|
|
4019
|
-
|
|
4105
|
+
p(He, {
|
|
4020
4106
|
value: t.value.get,
|
|
4021
4107
|
args: t.value.args,
|
|
4022
4108
|
"argument-title": w.$t("dashboard.argument"),
|
|
4023
4109
|
disabled: !r.value,
|
|
4024
4110
|
label: "Get",
|
|
4025
|
-
onIcon: A[5] || (A[5] = (P) =>
|
|
4111
|
+
onIcon: A[5] || (A[5] = (P) => v("get")),
|
|
4026
4112
|
onChange: A[6] || (A[6] = (P) => H("get", P))
|
|
4027
4113
|
}, null, 8, ["value", "args", "argument-title", "disabled"]),
|
|
4028
|
-
|
|
4114
|
+
p(He, {
|
|
4029
4115
|
value: t.value.getTo,
|
|
4030
4116
|
args: t.value.args,
|
|
4031
4117
|
prefix: ["v"],
|
|
@@ -4033,13 +4119,13 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
4033
4119
|
"argument-title": w.$t("dashboard.argument"),
|
|
4034
4120
|
disabled: !r.value,
|
|
4035
4121
|
label: "GetTo",
|
|
4036
|
-
onIcon: A[7] || (A[7] = (P) =>
|
|
4122
|
+
onIcon: A[7] || (A[7] = (P) => v("getTo")),
|
|
4037
4123
|
onChange: A[8] || (A[8] = (P) => H("getTo", P))
|
|
4038
4124
|
}, null, 8, ["value", "args", "prefix-titles", "argument-title", "disabled"])
|
|
4039
4125
|
])
|
|
4040
4126
|
]),
|
|
4041
|
-
"tab-2":
|
|
4042
|
-
|
|
4127
|
+
"tab-2": x(() => [
|
|
4128
|
+
p(Li, Y(t.value.opts, {
|
|
4043
4129
|
value: t.value.value,
|
|
4044
4130
|
type: t.value.type,
|
|
4045
4131
|
onUpdate: Z
|
|
@@ -4048,31 +4134,31 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
4048
4134
|
_: 3
|
|
4049
4135
|
})
|
|
4050
4136
|
]),
|
|
4051
|
-
n("div",
|
|
4052
|
-
n("div",
|
|
4137
|
+
n("div", Hi, [
|
|
4138
|
+
n("div", Gi, [
|
|
4053
4139
|
I(w.$slots, "default", { item: t.value })
|
|
4054
4140
|
])
|
|
4055
4141
|
])
|
|
4056
4142
|
]),
|
|
4057
|
-
n("div",
|
|
4058
|
-
|
|
4143
|
+
n("div", Ji, [
|
|
4144
|
+
p(R, {
|
|
4059
4145
|
class: "px-4",
|
|
4060
4146
|
color: "blue",
|
|
4061
4147
|
disabled: u.value,
|
|
4062
|
-
onClick: A[9] || (A[9] = (P) =>
|
|
4148
|
+
onClick: A[9] || (A[9] = (P) => y(i.value ? "add" : "save"))
|
|
4063
4149
|
}, {
|
|
4064
|
-
default:
|
|
4150
|
+
default: x(() => [
|
|
4065
4151
|
L(C(i.value ? w.$t("add") : w.$t("save")), 1)
|
|
4066
4152
|
]),
|
|
4067
4153
|
_: 1
|
|
4068
4154
|
}, 8, ["disabled"]),
|
|
4069
|
-
|
|
4155
|
+
p(R, {
|
|
4070
4156
|
class: "px-4",
|
|
4071
4157
|
color: "red",
|
|
4072
4158
|
variant: "outline",
|
|
4073
|
-
onClick: A[10] || (A[10] = (P) =>
|
|
4159
|
+
onClick: A[10] || (A[10] = (P) => y("remove"))
|
|
4074
4160
|
}, {
|
|
4075
|
-
default:
|
|
4161
|
+
default: x(() => [
|
|
4076
4162
|
L(C(w.$t("remove")), 1)
|
|
4077
4163
|
]),
|
|
4078
4164
|
_: 1
|
|
@@ -4084,9 +4170,9 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
4084
4170
|
title: w.$t("select"),
|
|
4085
4171
|
onClose: A[11] || (A[11] = (P) => o.value = !1)
|
|
4086
4172
|
}, {
|
|
4087
|
-
default:
|
|
4088
|
-
n("div",
|
|
4089
|
-
|
|
4173
|
+
default: x(() => [
|
|
4174
|
+
n("div", qi, [
|
|
4175
|
+
p(_t, {
|
|
4090
4176
|
items: e.object,
|
|
4091
4177
|
onlyValue: !r.value,
|
|
4092
4178
|
onClick: j
|
|
@@ -4097,12 +4183,12 @@ v + ' кВт·ч<br>выработка за день'`),
|
|
|
4097
4183
|
}, 8, ["title"])) : T("", !0)
|
|
4098
4184
|
]));
|
|
4099
4185
|
}
|
|
4100
|
-
}), Nt = { position: "relative", boxSizing: "border-box", overflow: "hidden", fontSize: "16px", fontFamily: 'Menlo, Consolas, "Liberation Mono", Monaco, "Lucida Console", monospace' },
|
|
4186
|
+
}), Nt = { position: "relative", boxSizing: "border-box", overflow: "hidden", fontSize: "16px", fontFamily: 'Menlo, Consolas, "Liberation Mono", Monaco, "Lucida Console", monospace' }, Xi = { lineHeight: "inherit", whiteSpace: "pre-wrap", wordBreak: "keep-all", overflowWrap: "break-word", background: "none", position: "absolute", width: "100%", height: "100%", zIndex: "1", resize: "none", caretColor: "currentColor", padding: "inherit", outline: "none", fontSize: "inherit", fontFamily: "inherit", letterSpacing: "inherit", boxSizing: "border-box", border: "none", top: "0px", left: "0px", color: "inherit", overflow: "hidden", "-webkit-font-smoothing": "antialiased", "-webkit-text-fill-color": "transparent" }, Yi = { lineHeight: "inherit", position: "relative", whiteSpace: "pre-wrap", wordBreak: "keep-all", padding: "0", width: "100%", margin: "0", pointerEvents: "none", boxSizing: "border-box", overflowWrap: "break-word", fontFamily: "inherit" }, Zi = { lineHeight: "inherit", position: "absolute", width: "100%", height: "100%", whiteSpace: "pre-wrap", wordBreak: "keep-all", padding: "inherit", margin: "0", top: "0px", left: "0px", pointerEvents: "none", boxSizing: "border-box", overflowWrap: "break-word", fontFamily: "inherit" }, sa = (e) => na(e);
|
|
4101
4187
|
function Pt(e) {
|
|
4102
4188
|
const s = Array.isArray(e) ? e : [e];
|
|
4103
4189
|
return s.length === 0 ? sa : (a) => s.reduce((l, t, o) => t(l, { html: o > 0 }), a);
|
|
4104
4190
|
}
|
|
4105
|
-
class
|
|
4191
|
+
class Qi {
|
|
4106
4192
|
constructor(s, a = {}) {
|
|
4107
4193
|
if (this.lines = null, !s) throw new Error("selector is not defined");
|
|
4108
4194
|
if (this.root = s instanceof Node ? s : document.querySelector(s), !this.root) throw new Error(`element with "${s}" selector is not exist`);
|
|
@@ -4116,7 +4202,7 @@ class Gi {
|
|
|
4116
4202
|
const a = this.root.style;
|
|
4117
4203
|
s.forEach((l) => {
|
|
4118
4204
|
this.initialRootStyles[l] = a[l] || "";
|
|
4119
|
-
}), Object.assign(this.root.style, Nt, this.options.styles), Object.assign(this.textarea.style,
|
|
4205
|
+
}), Object.assign(this.root.style, Nt, this.options.styles), Object.assign(this.textarea.style, Xi), Object.assign(this.pre.style, Yi), this.basePaddingLeft = this.root.style.paddingLeft || "", this.root.appendChild(this.textarea), this.root.appendChild(this.pre), this.addTextareaEvents(), this.update({ value: this.options.value }), this.updateLines();
|
|
4120
4206
|
}
|
|
4121
4207
|
addTextareaEvents() {
|
|
4122
4208
|
this.handleEvent = (s) => {
|
|
@@ -4152,7 +4238,7 @@ class Gi {
|
|
|
4152
4238
|
}
|
|
4153
4239
|
updateLines() {
|
|
4154
4240
|
if (!this.options.lineNumbers) return;
|
|
4155
|
-
this.lines || (this.lines = document.createElement("pre"), this.root.appendChild(this.lines), Object.assign(this.lines.style,
|
|
4241
|
+
this.lines || (this.lines = document.createElement("pre"), this.root.appendChild(this.lines), Object.assign(this.lines.style, Zi));
|
|
4156
4242
|
const s = this.value.split(`
|
|
4157
4243
|
`), a = s.length.toString().length;
|
|
4158
4244
|
this.root.style.paddingLeft = `${a + 1}ch`, this.lines.innerHTML = s.map((l, t) => `${`<span class="yace-line" style="position: absolute; opacity: .3; left: 0; width: ${a}ch; text-align: right">${1 + t}</span>`}${`<span style="color: transparent; pointer-events: none">${na(l)}</span>`}`).join(`
|
|
@@ -4171,16 +4257,16 @@ function et(e) {
|
|
|
4171
4257
|
function na(e) {
|
|
4172
4258
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
4173
4259
|
}
|
|
4174
|
-
const Rt = { alt: "altKey", control: "ctrlKey", ctrl: "ctrlKey", meta: "metaKey", shift: "shiftKey", "ctrl/cmd": typeof window < "u" && window.navigator && /Mac|iPod|iPhone|iPad/.test(window.navigator.platform) ? "metaKey" : "ctrlKey" },
|
|
4260
|
+
const Rt = { alt: "altKey", control: "ctrlKey", ctrl: "ctrlKey", meta: "metaKey", shift: "shiftKey", "ctrl/cmd": typeof window < "u" && window.navigator && /Mac|iPod|iPhone|iPad/.test(window.navigator.platform) ? "metaKey" : "ctrlKey" }, er = { add: "=" }, tr = { ";": "semicolon", "=": "equal", ",": "comma", "-": "minus", ".": "period", "/": "slash", "`": "backquote", "[": "bracketleft", "\\": "backslash", "]": "bracketright", "'": "quote" };
|
|
4175
4261
|
function Je(e, s) {
|
|
4176
|
-
const a = e.split("+").reduce((m, r) => Rt[r] ? (m.modifiers[Rt[r]] = !0, m) : { ...m, key:
|
|
4262
|
+
const a = e.split("+").reduce((m, r) => Rt[r] ? (m.modifiers[Rt[r]] = !0, m) : { ...m, key: er[r] || r.toLowerCase() }, { modifiers: { altKey: !1, ctrlKey: !1, metaKey: !1, shiftKey: !1 }, key: null }), l = Object.keys(a.modifiers).every((m) => a.modifiers[m] ? s[m] : !s[m]);
|
|
4177
4263
|
if (!a.key) return l;
|
|
4178
|
-
const t = s.key != null && s.key.toLowerCase() === a.key, o = (i = a.key, /^[a-z]$/.test(i) ? `key${i}` : /^[0-9]$/.test(i) ? `digit${i}` :
|
|
4264
|
+
const t = s.key != null && s.key.toLowerCase() === a.key, o = (i = a.key, /^[a-z]$/.test(i) ? `key${i}` : /^[0-9]$/.test(i) ? `digit${i}` : tr[i] || null);
|
|
4179
4265
|
var i;
|
|
4180
4266
|
const d = !s.isComposing && o != null && s.code != null && s.code.toLowerCase() === o;
|
|
4181
4267
|
return l && (t || d);
|
|
4182
4268
|
}
|
|
4183
|
-
function
|
|
4269
|
+
function ar(e = {}) {
|
|
4184
4270
|
const s = Math.max(1, e.limit == null ? 300 : e.limit), a = e.coalesceMs == null ? 300 : e.coalesceMs;
|
|
4185
4271
|
let l = [], t = null, o = null;
|
|
4186
4272
|
const i = (d) => {
|
|
@@ -4193,13 +4279,13 @@ function Xi(e = {}) {
|
|
|
4193
4279
|
if (c) return o = null, l[t].value !== d.value ? void i(d) : (t = Math.min(l.length - 1, t + 1), l[t]);
|
|
4194
4280
|
if (m.type === "keydown") return l[t].value !== d.value ? (o = null, void i(d)) : void (l[t] = d);
|
|
4195
4281
|
if (m.type === "input") {
|
|
4196
|
-
const u = m.timeStamp,
|
|
4197
|
-
if (o = u ?? null,
|
|
4282
|
+
const u = m.timeStamp, h = u != null && o != null && u - o <= a;
|
|
4283
|
+
if (o = u ?? null, h) return void (l[t] = d);
|
|
4198
4284
|
i(d);
|
|
4199
4285
|
}
|
|
4200
4286
|
};
|
|
4201
4287
|
}
|
|
4202
|
-
const
|
|
4288
|
+
const sr = () => (e, s) => {
|
|
4203
4289
|
const { value: a, selectionStart: l, selectionEnd: t } = e;
|
|
4204
4290
|
if (!Je("enter", s) || s.type !== "keydown") return;
|
|
4205
4291
|
const o = a.substring(0, l).split(`
|
|
@@ -4209,7 +4295,7 @@ const Yi = () => (e, s) => {
|
|
|
4209
4295
|
const d = `
|
|
4210
4296
|
` + i[0];
|
|
4211
4297
|
return { value: a.substring(0, l) + d + a.substring(t), selectionStart: l + d.length, selectionEnd: l + d.length };
|
|
4212
|
-
},
|
|
4298
|
+
}, nr = () => (e, s) => {
|
|
4213
4299
|
if (typeof KeyboardEvent > "u" || !(s instanceof KeyboardEvent) || s.key !== "Enter")
|
|
4214
4300
|
return;
|
|
4215
4301
|
const { value: a, selectionStart: l, selectionEnd: t } = e;
|
|
@@ -4223,55 +4309,55 @@ const Yi = () => (e, s) => {
|
|
|
4223
4309
|
const c = a.substring(o, d).trimEnd();
|
|
4224
4310
|
if (c.endsWith(";") || c.length === 0)
|
|
4225
4311
|
return;
|
|
4226
|
-
const u = a.slice(0, d) + ";" + a.slice(d),
|
|
4312
|
+
const u = a.slice(0, d) + ";" + a.slice(d), h = l + 1;
|
|
4227
4313
|
return {
|
|
4228
4314
|
value: u,
|
|
4229
|
-
selectionStart:
|
|
4230
|
-
selectionEnd:
|
|
4315
|
+
selectionStart: h,
|
|
4316
|
+
selectionEnd: h
|
|
4231
4317
|
};
|
|
4232
4318
|
};
|
|
4233
|
-
let Bt = [], ue = null,
|
|
4234
|
-
const
|
|
4319
|
+
let Bt = [], ue = null, oe = 0, ke = [], Ee = null, De = null, Vt, la, pe = null, Ne = null;
|
|
4320
|
+
const lr = (e) => {
|
|
4235
4321
|
const { customSuggestions: s = [], minPrefixLength: a = 1, maxSuggestions: l = 20, tabSize: t = 2, tooltip: o = { enabled: !0 }, i18n: i, renderMenu: d, renderTooltip: m } = e;
|
|
4236
4322
|
if (!d || !m)
|
|
4237
4323
|
throw new Error("renderMenu and renderTooltip are required");
|
|
4238
4324
|
return Bt = [...s].map((r) => i(r)), Vt = d, la = m, (r, c) => {
|
|
4239
4325
|
if (typeof KeyboardEvent > "u" || !(c instanceof KeyboardEvent))
|
|
4240
4326
|
return;
|
|
4241
|
-
const { value: u, selectionStart:
|
|
4242
|
-
if (
|
|
4327
|
+
const { value: u, selectionStart: h } = r, k = c.target;
|
|
4328
|
+
if (De = k, o.enabled !== !1 && !k.dataset.tooltipInitialized && (k.dataset.tooltipInitialized = "true", k.addEventListener("mouseup", () => {
|
|
4243
4329
|
setTimeout(() => Ut(k), 100);
|
|
4244
4330
|
}), k.addEventListener("keyup", () => {
|
|
4245
4331
|
setTimeout(() => Ut(k), 100);
|
|
4246
4332
|
})), ue) {
|
|
4247
4333
|
switch (c.key) {
|
|
4248
4334
|
case "ArrowDown":
|
|
4249
|
-
return c.preventDefault(),
|
|
4335
|
+
return c.preventDefault(), oe < ke.length - 1 && (oe++, je()), { ...r };
|
|
4250
4336
|
case "ArrowUp":
|
|
4251
|
-
return c.preventDefault(),
|
|
4337
|
+
return c.preventDefault(), oe > 0 && (oe--, je()), { ...r };
|
|
4252
4338
|
case "Enter":
|
|
4253
|
-
if (c.preventDefault(), ke[
|
|
4254
|
-
const
|
|
4255
|
-
return Ce(),
|
|
4339
|
+
if (c.preventDefault(), ke[oe]) {
|
|
4340
|
+
const v = vt(r, ke[oe]);
|
|
4341
|
+
return Ce(), v;
|
|
4256
4342
|
}
|
|
4257
4343
|
return;
|
|
4258
4344
|
case "Tab":
|
|
4259
|
-
if (c.preventDefault(), ke[
|
|
4260
|
-
const
|
|
4261
|
-
return Ce(),
|
|
4345
|
+
if (c.preventDefault(), ke[oe]) {
|
|
4346
|
+
const v = vt(r, ke[oe]);
|
|
4347
|
+
return Ce(), v;
|
|
4262
4348
|
}
|
|
4263
4349
|
return;
|
|
4264
4350
|
case "Escape":
|
|
4265
4351
|
return c.preventDefault(), Ce(), { ...r };
|
|
4266
4352
|
case "Backspace":
|
|
4267
4353
|
setTimeout(() => {
|
|
4268
|
-
if (
|
|
4269
|
-
const
|
|
4354
|
+
if (De) {
|
|
4355
|
+
const v = De.value, y = De.selectionStart, z = nt(v, y), j = v.slice(z, y);
|
|
4270
4356
|
if (j.length < a)
|
|
4271
4357
|
Ce();
|
|
4272
4358
|
else {
|
|
4273
|
-
const H =
|
|
4274
|
-
H.length === 0 ? Ce() : (ke = H,
|
|
4359
|
+
const H = gt(j).slice(0, l);
|
|
4360
|
+
H.length === 0 ? Ce() : (ke = H, oe = 0, je());
|
|
4275
4361
|
}
|
|
4276
4362
|
}
|
|
4277
4363
|
}, 0);
|
|
@@ -4282,13 +4368,13 @@ const Qi = (e) => {
|
|
|
4282
4368
|
}
|
|
4283
4369
|
if (Je("tab", c)) {
|
|
4284
4370
|
c.preventDefault();
|
|
4285
|
-
const
|
|
4286
|
-
if (
|
|
4287
|
-
const
|
|
4288
|
-
if (
|
|
4289
|
-
return
|
|
4371
|
+
const v = nt(u, h), y = u.slice(v, h);
|
|
4372
|
+
if (y.length > 0) {
|
|
4373
|
+
const N = gt(y);
|
|
4374
|
+
if (N.length > 0)
|
|
4375
|
+
return vt(r, N[0]);
|
|
4290
4376
|
}
|
|
4291
|
-
const z = " ".repeat(t), j = u.slice(0,
|
|
4377
|
+
const z = " ".repeat(t), j = u.slice(0, h) + z + u.slice(h), H = h + t;
|
|
4292
4378
|
return {
|
|
4293
4379
|
value: j,
|
|
4294
4380
|
selectionStart: H,
|
|
@@ -4298,21 +4384,21 @@ const Qi = (e) => {
|
|
|
4298
4384
|
if (!(c.key.length !== 1 || c.ctrlKey || c.metaKey || c.altKey))
|
|
4299
4385
|
return Ee && clearTimeout(Ee), Ee = setTimeout(() => {
|
|
4300
4386
|
Ee = null;
|
|
4301
|
-
const
|
|
4387
|
+
const v = k.value, y = k.selectionStart, z = nt(v, y), j = v.slice(z, y);
|
|
4302
4388
|
if (j.length < a) {
|
|
4303
4389
|
Ce();
|
|
4304
4390
|
return;
|
|
4305
4391
|
}
|
|
4306
|
-
let H =
|
|
4392
|
+
let H = gt(j);
|
|
4307
4393
|
if (H = H.slice(0, l), H.length === 0) {
|
|
4308
4394
|
Ce();
|
|
4309
4395
|
return;
|
|
4310
4396
|
}
|
|
4311
|
-
ke = H,
|
|
4397
|
+
ke = H, oe = 0, ue ? je() : or(k, H);
|
|
4312
4398
|
}, 0), { ...r };
|
|
4313
4399
|
};
|
|
4314
4400
|
};
|
|
4315
|
-
function
|
|
4401
|
+
function gt(e) {
|
|
4316
4402
|
const s = e.toLowerCase();
|
|
4317
4403
|
return Bt.filter((a) => {
|
|
4318
4404
|
const l = a.label.toLowerCase();
|
|
@@ -4331,11 +4417,11 @@ function nt(e, s) {
|
|
|
4331
4417
|
a--;
|
|
4332
4418
|
return a;
|
|
4333
4419
|
}
|
|
4334
|
-
function
|
|
4335
|
-
Ce(), ke = s,
|
|
4420
|
+
function or(e, s) {
|
|
4421
|
+
Ce(), ke = s, oe = 0;
|
|
4336
4422
|
const a = oa(e);
|
|
4337
|
-
ue = Vt(s,
|
|
4338
|
-
|
|
4423
|
+
ue = Vt(s, oe, (l) => {
|
|
4424
|
+
oe = l, je();
|
|
4339
4425
|
}), Object.assign(ue.style, {
|
|
4340
4426
|
position: "fixed",
|
|
4341
4427
|
left: `${a.left}px`,
|
|
@@ -4343,10 +4429,10 @@ function er(e, s) {
|
|
|
4343
4429
|
zIndex: "10000"
|
|
4344
4430
|
}), document.body.appendChild(ue);
|
|
4345
4431
|
}
|
|
4346
|
-
function
|
|
4347
|
-
if (!ue || !
|
|
4348
|
-
const e = Vt(ke,
|
|
4349
|
-
|
|
4432
|
+
function je() {
|
|
4433
|
+
if (!ue || !De) return;
|
|
4434
|
+
const e = Vt(ke, oe, (a) => {
|
|
4435
|
+
oe = a, je();
|
|
4350
4436
|
}), s = ue.getBoundingClientRect();
|
|
4351
4437
|
ue.replaceWith(e), ue = e, Object.assign(ue.style, {
|
|
4352
4438
|
position: "fixed",
|
|
@@ -4355,33 +4441,33 @@ function Fe() {
|
|
|
4355
4441
|
zIndex: "10000"
|
|
4356
4442
|
});
|
|
4357
4443
|
}
|
|
4358
|
-
function
|
|
4444
|
+
function vt(e, s) {
|
|
4359
4445
|
const { value: a, selectionStart: l } = e, t = nt(a, l), o = s.insert || s.label, i = /\$\{([^}]*)\}/g;
|
|
4360
4446
|
let d = o;
|
|
4361
4447
|
const m = [];
|
|
4362
4448
|
let r;
|
|
4363
4449
|
for (; (r = i.exec(o)) !== null; ) {
|
|
4364
|
-
const
|
|
4365
|
-
m.push({ index:
|
|
4450
|
+
const v = r[1], y = r.index, z = r[0].length;
|
|
4451
|
+
m.push({ index: y, text: v, length: z });
|
|
4366
4452
|
}
|
|
4367
4453
|
d = o.replace(/\$\{([^}]*)\}/g, "$1");
|
|
4368
4454
|
const c = m[0];
|
|
4369
|
-
let u = t + d.length,
|
|
4455
|
+
let u = t + d.length, h = t + d.length;
|
|
4370
4456
|
if (c) {
|
|
4371
|
-
let
|
|
4372
|
-
for (;
|
|
4373
|
-
const j = m.find((H) => H.index ===
|
|
4374
|
-
j ? (
|
|
4457
|
+
let v = 0, y = 0, z = !1;
|
|
4458
|
+
for (; y < o.length && !z; ) {
|
|
4459
|
+
const j = m.find((H) => H.index === y);
|
|
4460
|
+
j ? (v += j.text.length, y += j.length, j === c && (u = t + v - j.text.length, h = t + v, z = !0)) : (v++, y++);
|
|
4375
4461
|
}
|
|
4376
4462
|
}
|
|
4377
4463
|
return {
|
|
4378
4464
|
value: a.slice(0, t) + d + a.slice(l),
|
|
4379
4465
|
selectionStart: u,
|
|
4380
|
-
selectionEnd:
|
|
4466
|
+
selectionEnd: h
|
|
4381
4467
|
};
|
|
4382
4468
|
}
|
|
4383
4469
|
function Ce() {
|
|
4384
|
-
Ee && (clearTimeout(Ee), Ee = null), ue && (ue.remove(), ue = null, ke = [],
|
|
4470
|
+
Ee && (clearTimeout(Ee), Ee = null), ue && (ue.remove(), ue = null, ke = [], oe = 0, De = null);
|
|
4385
4471
|
}
|
|
4386
4472
|
function oa(e) {
|
|
4387
4473
|
const s = e.getBoundingClientRect(), { value: a, selectionStart: l } = e, o = a.substring(0, l).split(`
|
|
@@ -4392,7 +4478,7 @@ function oa(e) {
|
|
|
4392
4478
|
};
|
|
4393
4479
|
}
|
|
4394
4480
|
function Ut(e) {
|
|
4395
|
-
|
|
4481
|
+
Ne && clearTimeout(Ne), Ne = setTimeout(() => {
|
|
4396
4482
|
const s = e.selectionStart, a = e.selectionEnd;
|
|
4397
4483
|
if (s === a) {
|
|
4398
4484
|
We();
|
|
@@ -4415,7 +4501,7 @@ function Ut(e) {
|
|
|
4415
4501
|
}, 300);
|
|
4416
4502
|
}
|
|
4417
4503
|
function We() {
|
|
4418
|
-
|
|
4504
|
+
Ne && (clearTimeout(Ne), Ne = null), pe && (pe.style.opacity = "0", setTimeout(() => {
|
|
4419
4505
|
pe && (pe.remove(), pe = null);
|
|
4420
4506
|
}, 150));
|
|
4421
4507
|
}
|
|
@@ -4423,7 +4509,7 @@ typeof document < "u" && document.addEventListener("mousedown", (e) => {
|
|
|
4423
4509
|
const s = e.target;
|
|
4424
4510
|
ue && !ue.contains(s) && Ce(), pe && !pe.contains(s) && We();
|
|
4425
4511
|
});
|
|
4426
|
-
const
|
|
4512
|
+
const pt = (e) => e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">"), ir = {
|
|
4427
4513
|
comment: "text-gray-dark-25 dark:text-gray-main",
|
|
4428
4514
|
str: "text-amber-dark-75 dark:text-amber-dark-35",
|
|
4429
4515
|
num: "text-green-dark-55 dark:text-green-light-25",
|
|
@@ -4431,24 +4517,24 @@ const vt = (e) => e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, "
|
|
|
4431
4517
|
var: "text-cyan-dark-30 dark:text-cyan-light-40",
|
|
4432
4518
|
event: "text-amber-dark-75 dark:text-amber-light-45",
|
|
4433
4519
|
operator: "text-amber-dark-40"
|
|
4434
|
-
},
|
|
4435
|
-
const s = e.filter((d) => d.type !== "var").map((d) => d.label), i = `(\\/\\/[^\\n]*)|('[^'\\n]*')|(\\b\\d+(?:\\.\\d+)?\\b)|(\\b(?:${Array.from(/* @__PURE__ */ new Set([...
|
|
4520
|
+
}, rr = ["else", "end", "call", "fade"], dr = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), cr = (e) => {
|
|
4521
|
+
const s = e.filter((d) => d.type !== "var").map((d) => d.label), i = `(\\/\\/[^\\n]*)|('[^'\\n]*')|(\\b\\d+(?:\\.\\d+)?\\b)|(\\b(?:${Array.from(/* @__PURE__ */ new Set([...rr, ...s])).map(dr).join("|")})\\b)|(\\$[a-zA-Z_][a-zA-Z0-9_]*)|(\\b(?:btn_\\d+(?:_\\d+)?)\\b)|([;:(){}])`;
|
|
4436
4522
|
return new RegExp(i, "g");
|
|
4437
|
-
},
|
|
4438
|
-
const a =
|
|
4523
|
+
}, ur = (e) => (s) => {
|
|
4524
|
+
const a = cr(e);
|
|
4439
4525
|
let l = "", t = 0;
|
|
4440
4526
|
for (const o of s.matchAll(a)) {
|
|
4441
|
-
const [i, d, m, r, c, u,
|
|
4442
|
-
let
|
|
4443
|
-
d ?
|
|
4527
|
+
const [i, d, m, r, c, u, h, k] = o;
|
|
4528
|
+
let v = "";
|
|
4529
|
+
d ? v = "comment" : m ? v = "str" : r ? v = "num" : c ? v = "word" : u ? v = "var" : h ? v = "event" : k && (v = "operator"), l += pt(s.slice(t, o.index)), l += `<span class="${ir[v] ?? ""}">${pt(i)}</span>`, t = o.index + i.length;
|
|
4444
4530
|
}
|
|
4445
|
-
return l +=
|
|
4531
|
+
return l += pt(s.slice(t)), l;
|
|
4446
4532
|
}, ia = {
|
|
4447
4533
|
word: "text-blue-600 dark:text-blue-400",
|
|
4448
4534
|
func: "text-yellow-600 dark:text-yellow-400",
|
|
4449
4535
|
var: "text-cyan-600 dark:text-cyan-400",
|
|
4450
4536
|
event: "text-purple-600 dark:text-purple-400"
|
|
4451
|
-
},
|
|
4537
|
+
}, mr = (e, s, a) => {
|
|
4452
4538
|
const l = document.createElement("div");
|
|
4453
4539
|
return l.className = `
|
|
4454
4540
|
fixed z-[10000] min-w-64 max-w-100 max-h-64
|
|
@@ -4471,7 +4557,7 @@ const vt = (e) => e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, "
|
|
|
4471
4557
|
${t.description ? `<span class="text-xs text-gray-main dark:text-gray-dark-25">${t.description}</span>` : ""}
|
|
4472
4558
|
`, d.addEventListener("click", () => a(o)), l.appendChild(d);
|
|
4473
4559
|
}), l;
|
|
4474
|
-
},
|
|
4560
|
+
}, fr = (e, s) => {
|
|
4475
4561
|
const a = document.createElement("div");
|
|
4476
4562
|
a.className = `
|
|
4477
4563
|
fixed z-[10001] px-3 py-2 font-mono text-sm max-w-75
|
|
@@ -4490,20 +4576,32 @@ const vt = (e) => e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, "
|
|
|
4490
4576
|
absolute -bottom-1 left-1/2 w-2.5 h-2.5 -translate-x-1/2 rotate-45
|
|
4491
4577
|
bg-white dark:bg-gray-dark-30 border-r border-b border-gray-light-10 dark:border-gray-dark-30
|
|
4492
4578
|
`, a.appendChild(o), a;
|
|
4493
|
-
},
|
|
4494
|
-
{ label: "if", type: "word", insert: `if:\${$
|
|
4579
|
+
}, gr = [
|
|
4580
|
+
{ label: "if", type: "word", insert: `if:\${$u0<10};
|
|
4495
4581
|
|
|
4496
4582
|
else;
|
|
4497
4583
|
|
|
4498
|
-
end;`, detail: "if:${$
|
|
4499
|
-
{ label: "while", type: "word", insert: `$
|
|
4500
|
-
while:\${$
|
|
4501
|
-
log($
|
|
4502
|
-
$
|
|
4584
|
+
end;`, detail: "if:${$u0<10};else;end;" },
|
|
4585
|
+
{ label: "while", type: "word", insert: `$u0=0;
|
|
4586
|
+
while:\${$u0<10};
|
|
4587
|
+
log($u0);
|
|
4588
|
+
$u0=$u0+1;
|
|
4503
4589
|
wait(1s);
|
|
4504
|
-
end;`, detail: "while:${$
|
|
4505
|
-
{
|
|
4506
|
-
|
|
4590
|
+
end;`, detail: "while:${$u0<2}; end;" },
|
|
4591
|
+
{
|
|
4592
|
+
label: "udp",
|
|
4593
|
+
type: "func",
|
|
4594
|
+
insert: "udp(${0}, '${1}')",
|
|
4595
|
+
detail: "udp(id:number, text:string) => ok:number",
|
|
4596
|
+
description: "Send a text message to a device discovered by Vuesp Discovery. Discovery must be enabled."
|
|
4597
|
+
},
|
|
4598
|
+
{
|
|
4599
|
+
label: "fade",
|
|
4600
|
+
type: "func",
|
|
4601
|
+
insert: "fade(${0}, ${1}, ${2})",
|
|
4602
|
+
detail: "fade(gpio:number, value:number, time:number) => boolean",
|
|
4603
|
+
description: "Smoothly change a PWM or DAC port value over the given time in milliseconds."
|
|
4604
|
+
},
|
|
4507
4605
|
{ label: "http", type: "func", insert: "http('${0}', '${1}')", detail: "http(method:string, url:string, count?:number, num?:number, data?:number[]) => status:number" },
|
|
4508
4606
|
{ label: "on", type: "func", insert: `on('\${event}');
|
|
4509
4607
|
|
|
@@ -4527,7 +4625,7 @@ end;`, detail: "event(name: string)" },
|
|
|
4527
4625
|
{ label: "$e", type: "var", insert: "$e${0}", detail: "var event" },
|
|
4528
4626
|
{ label: "$c", type: "var", insert: "$c${0}", detail: "var call" },
|
|
4529
4627
|
{ label: "$p", type: "var", insert: "$p${0}", detail: "gpio" }
|
|
4530
|
-
],
|
|
4628
|
+
], Vd = /* @__PURE__ */ O({
|
|
4531
4629
|
__name: "ScriptEditor",
|
|
4532
4630
|
props: {
|
|
4533
4631
|
modelValue: {},
|
|
@@ -4537,21 +4635,21 @@ end;`, detail: "event(name: string)" },
|
|
|
4537
4635
|
setup(e, { emit: s }) {
|
|
4538
4636
|
const a = s;
|
|
4539
4637
|
let l;
|
|
4540
|
-
const t = [...
|
|
4638
|
+
const t = [...gr, ...e.suggestions];
|
|
4541
4639
|
return ye(
|
|
4542
4640
|
() => e.modelValue,
|
|
4543
4641
|
(o) => {
|
|
4544
4642
|
l.update({ value: o });
|
|
4545
4643
|
}
|
|
4546
4644
|
), be(() => {
|
|
4547
|
-
l = new
|
|
4645
|
+
l = new Qi("#editor", {
|
|
4548
4646
|
value: e.modelValue,
|
|
4549
4647
|
lineNumbers: !0,
|
|
4550
|
-
highlighters: [
|
|
4648
|
+
highlighters: [ur(t)],
|
|
4551
4649
|
plugins: [
|
|
4552
|
-
|
|
4553
|
-
|
|
4554
|
-
|
|
4650
|
+
ar(),
|
|
4651
|
+
sr(),
|
|
4652
|
+
lr({
|
|
4555
4653
|
customSuggestions: t,
|
|
4556
4654
|
minPrefixLength: 1,
|
|
4557
4655
|
maxSuggestions: 20,
|
|
@@ -4559,31 +4657,31 @@ end;`, detail: "event(name: string)" },
|
|
|
4559
4657
|
tooltip: {
|
|
4560
4658
|
enabled: !0
|
|
4561
4659
|
},
|
|
4562
|
-
renderMenu:
|
|
4563
|
-
renderTooltip:
|
|
4660
|
+
renderMenu: mr,
|
|
4661
|
+
renderTooltip: fr
|
|
4564
4662
|
}),
|
|
4565
|
-
|
|
4663
|
+
nr()
|
|
4566
4664
|
],
|
|
4567
4665
|
styles: { fontSize: "14px" }
|
|
4568
4666
|
}), l.onUpdate((o) => {
|
|
4569
4667
|
a("update:modelValue", o);
|
|
4570
4668
|
});
|
|
4571
|
-
}),
|
|
4669
|
+
}), Pe(() => {
|
|
4572
4670
|
l.destroy();
|
|
4573
4671
|
}), (o, i) => (f(), g("div", null, [...i[0] || (i[0] = [
|
|
4574
4672
|
n("div", { id: "editor" }, null, -1)
|
|
4575
4673
|
])]));
|
|
4576
4674
|
}
|
|
4577
|
-
}),
|
|
4675
|
+
}), vr = { class: "max-w-4xl mx-auto" }, pr = {
|
|
4578
4676
|
key: 0,
|
|
4579
4677
|
class: "text-sm"
|
|
4580
|
-
},
|
|
4678
|
+
}, hr = {
|
|
4581
4679
|
key: 0,
|
|
4582
4680
|
class: "text-gray-dark-25"
|
|
4583
|
-
},
|
|
4681
|
+
}, yr = {
|
|
4584
4682
|
key: 1,
|
|
4585
4683
|
class: "text-red-600"
|
|
4586
|
-
},
|
|
4684
|
+
}, br = ["innerHTML"], xr = "https://raw.githubusercontent.com/bondrogeen/vuesp/refs/heads/master/github/docs/scriptrunner/", kr = "https://cdn.jsdelivr.net/npm/marked/lib/marked.umd.js", Id = /* @__PURE__ */ O({
|
|
4587
4685
|
__name: "ScriptViewDocs",
|
|
4588
4686
|
props: {
|
|
4589
4687
|
lang: { default: "en" }
|
|
@@ -4604,31 +4702,31 @@ end;`, detail: "event(name: string)" },
|
|
|
4604
4702
|
}), c(window.marked);
|
|
4605
4703
|
return;
|
|
4606
4704
|
}
|
|
4607
|
-
const
|
|
4608
|
-
|
|
4705
|
+
const h = document.createElement("script");
|
|
4706
|
+
h.src = kr, h.async = !0, h.onload = () => {
|
|
4609
4707
|
window.marked ? (window.marked.setOptions({
|
|
4610
4708
|
gfm: !0,
|
|
4611
4709
|
breaks: !0,
|
|
4612
4710
|
headerIds: !1
|
|
4613
4711
|
}), c(window.marked)) : u(new Error("Marked library not found after loading"));
|
|
4614
|
-
},
|
|
4712
|
+
}, h.onerror = () => {
|
|
4615
4713
|
u(new Error("Failed to load Marked library from CDN"));
|
|
4616
|
-
}, document.head.appendChild(
|
|
4714
|
+
}, document.head.appendChild(h);
|
|
4617
4715
|
}), m = (c) => {
|
|
4618
4716
|
const u = c.split(`
|
|
4619
|
-
`),
|
|
4717
|
+
`), h = {};
|
|
4620
4718
|
let k = !0;
|
|
4621
|
-
for (const
|
|
4622
|
-
if (k &&
|
|
4719
|
+
for (const v of u) {
|
|
4720
|
+
if (k && v.startsWith("#")) {
|
|
4623
4721
|
k = !1;
|
|
4624
4722
|
continue;
|
|
4625
4723
|
}
|
|
4626
|
-
if (k &&
|
|
4627
|
-
const [
|
|
4628
|
-
|
|
4724
|
+
if (k && v.includes(":")) {
|
|
4725
|
+
const [y, z] = v.split(":").map((j) => j.trim());
|
|
4726
|
+
y && z && (y.toLowerCase().includes("version") && (h.version = z), (y.toLowerCase().includes("обновлено") || y.toLowerCase().includes("updated")) && (h.updated = z));
|
|
4629
4727
|
}
|
|
4630
4728
|
}
|
|
4631
|
-
return
|
|
4729
|
+
return h;
|
|
4632
4730
|
}, r = async (c) => {
|
|
4633
4731
|
if (!i) {
|
|
4634
4732
|
o.value = "error";
|
|
@@ -4636,14 +4734,14 @@ end;`, detail: "event(name: string)" },
|
|
|
4636
4734
|
}
|
|
4637
4735
|
t.value = !0, o.value = null, a.value = "";
|
|
4638
4736
|
try {
|
|
4639
|
-
const u = `${
|
|
4640
|
-
if (!
|
|
4641
|
-
throw new Error(`HTTP ${
|
|
4642
|
-
const k = await
|
|
4737
|
+
const u = `${xr}${c}.md`, h = await fetch(u);
|
|
4738
|
+
if (!h.ok)
|
|
4739
|
+
throw new Error(`HTTP ${h.status}: ${h.statusText}`);
|
|
4740
|
+
const k = await h.text();
|
|
4643
4741
|
s.value = k, l.value = m(k), a.value = i.parse(k);
|
|
4644
4742
|
} catch (u) {
|
|
4645
|
-
const
|
|
4646
|
-
o.value =
|
|
4743
|
+
const h = u instanceof Error ? u.message : "";
|
|
4744
|
+
o.value = h, console.error("Error loading docs:", u);
|
|
4647
4745
|
} finally {
|
|
4648
4746
|
t.value = !1;
|
|
4649
4747
|
}
|
|
@@ -4657,18 +4755,18 @@ end;`, detail: "event(name: string)" },
|
|
|
4657
4755
|
const u = c instanceof Error ? c.message : "";
|
|
4658
4756
|
o.value = u, console.error("Initialization error:", c);
|
|
4659
4757
|
}
|
|
4660
|
-
}), (c, u) => (f(), g("div",
|
|
4661
|
-
t.value || o.value ? (f(), g("div",
|
|
4662
|
-
t.value ? (f(), g("span",
|
|
4663
|
-
o.value ? (f(), g("span",
|
|
4758
|
+
}), (c, u) => (f(), g("div", vr, [
|
|
4759
|
+
t.value || o.value ? (f(), g("div", pr, [
|
|
4760
|
+
t.value ? (f(), g("span", hr, "⏳")) : T("", !0),
|
|
4761
|
+
o.value ? (f(), g("span", yr, "❌ " + C(o.value), 1)) : T("", !0)
|
|
4664
4762
|
])) : T("", !0),
|
|
4665
4763
|
n("div", {
|
|
4666
4764
|
class: "docs-content",
|
|
4667
4765
|
innerHTML: a.value
|
|
4668
|
-
}, null, 8,
|
|
4766
|
+
}, null, 8, br)
|
|
4669
4767
|
]));
|
|
4670
4768
|
}
|
|
4671
|
-
}),
|
|
4769
|
+
}), $r = { class: "my-4" }, Ld = /* @__PURE__ */ O({
|
|
4672
4770
|
__name: "ScriptDialog",
|
|
4673
4771
|
props: {
|
|
4674
4772
|
idScript: {}
|
|
@@ -4687,22 +4785,22 @@ end;`, detail: "event(name: string)" },
|
|
|
4687
4785
|
return be(() => {
|
|
4688
4786
|
e.idScript || (i.value = "boot");
|
|
4689
4787
|
}), (c, u) => {
|
|
4690
|
-
const
|
|
4691
|
-
return f(), g("div",
|
|
4692
|
-
|
|
4788
|
+
const h = ie, k = R;
|
|
4789
|
+
return f(), g("div", $r, [
|
|
4790
|
+
p(h, Y({
|
|
4693
4791
|
modelValue: J(i),
|
|
4694
|
-
"onUpdate:modelValue": u[0] || (u[0] = (
|
|
4792
|
+
"onUpdate:modelValue": u[0] || (u[0] = (v) => pa(i) ? i.value = v : null)
|
|
4695
4793
|
}, J(d), {
|
|
4696
4794
|
disabled: !e.idScript,
|
|
4697
4795
|
label: c.$t("name")
|
|
4698
4796
|
}), null, 16, ["modelValue", "disabled", "label"]),
|
|
4699
|
-
|
|
4797
|
+
p(k, {
|
|
4700
4798
|
class: "w-full",
|
|
4701
4799
|
color: "blue",
|
|
4702
4800
|
disabled: !J(o),
|
|
4703
4801
|
onClick: J(r)
|
|
4704
4802
|
}, {
|
|
4705
|
-
default:
|
|
4803
|
+
default: x(() => [
|
|
4706
4804
|
L(C(c.$t("add")), 1)
|
|
4707
4805
|
]),
|
|
4708
4806
|
_: 1
|
|
@@ -4710,16 +4808,16 @@ end;`, detail: "event(name: string)" },
|
|
|
4710
4808
|
]);
|
|
4711
4809
|
};
|
|
4712
4810
|
}
|
|
4713
|
-
}),
|
|
4811
|
+
}), wr = ["aria-label"], Cr = { class: "hidden lg:inline" }, Sr = ["aria-label"], _r = { class: "flex items-center gap-3 border-b border-gray-light-10/70 px-4 dark:border-white/10" }, Tr = ["placeholder"], zr = { class: "max-h-[55vh] overflow-y-auto p-2" }, Ar = ["href"], Er = { class: "min-w-0" }, Br = { class: "flex flex-wrap items-baseline gap-2" }, Vr = { class: "text-sm font-medium text-gray-dark-40 dark:text-white" }, Ir = {
|
|
4714
4812
|
key: 0,
|
|
4715
4813
|
class: "text-xs uppercase tracking-wider text-gray-main"
|
|
4716
|
-
},
|
|
4814
|
+
}, Lr = {
|
|
4717
4815
|
key: 0,
|
|
4718
4816
|
class: "mt-0.5 block truncate text-xs text-gray-dark-25 dark:text-gray-main"
|
|
4719
|
-
},
|
|
4817
|
+
}, Mr = {
|
|
4720
4818
|
key: 0,
|
|
4721
4819
|
class: "px-4 py-10 text-center text-sm text-gray-dark-25 dark:text-gray-main"
|
|
4722
|
-
},
|
|
4820
|
+
}, Md = /* @__PURE__ */ O({
|
|
4723
4821
|
__name: "VisionSearch",
|
|
4724
4822
|
props: {
|
|
4725
4823
|
items: {},
|
|
@@ -4734,7 +4832,7 @@ end;`, detail: "event(name: string)" },
|
|
|
4734
4832
|
return (r ? s.items.filter((u) => `${u.title} ${u.description ?? ""} ${u.group ?? ""}`.toLowerCase().includes(r)) : s.items).slice(0, 14);
|
|
4735
4833
|
}), i = async () => {
|
|
4736
4834
|
var r;
|
|
4737
|
-
a.value = !0, l.value = "", await
|
|
4835
|
+
a.value = !0, l.value = "", await wt(), (r = t.value) == null || r.focus();
|
|
4738
4836
|
}, d = () => {
|
|
4739
4837
|
a.value = !1, l.value = "";
|
|
4740
4838
|
}, m = (r) => {
|
|
@@ -4746,27 +4844,27 @@ end;`, detail: "event(name: string)" },
|
|
|
4746
4844
|
};
|
|
4747
4845
|
return ye(a, (r) => {
|
|
4748
4846
|
typeof document < "u" && (document.body.style.overflow = r ? "hidden" : "");
|
|
4749
|
-
}), be(() => window.addEventListener("keydown", m)),
|
|
4847
|
+
}), be(() => window.addEventListener("keydown", m)), Pe(() => {
|
|
4750
4848
|
window.removeEventListener("keydown", m), typeof document < "u" && (document.body.style.overflow = "");
|
|
4751
|
-
}), (r, c) => (f(), g(
|
|
4849
|
+
}), (r, c) => (f(), g(D, null, [
|
|
4752
4850
|
n("button", {
|
|
4753
4851
|
type: "button",
|
|
4754
4852
|
class: "inline-flex h-9 items-center gap-2 rounded-md px-2.5 text-xs text-gray-dark-25 transition-colors hover:bg-white/50 hover:text-violet-main dark:text-gray-main dark:hover:bg-white/5 dark:hover:text-white",
|
|
4755
4853
|
"aria-label": e.label,
|
|
4756
4854
|
onClick: i
|
|
4757
4855
|
}, [
|
|
4758
|
-
|
|
4856
|
+
p(V, {
|
|
4759
4857
|
name: "search",
|
|
4760
4858
|
size: 17
|
|
4761
4859
|
}),
|
|
4762
|
-
n("span",
|
|
4860
|
+
n("span", Cr, C(e.label), 1),
|
|
4763
4861
|
c[1] || (c[1] = n("kbd", { class: "hidden rounded border border-gray-light-10/60 px-1.5 py-0.5 font-mono text-xs text-gray-main dark:border-white/10 dark:text-gray-dark-25 lg:inline" }, "⌘K", -1))
|
|
4764
|
-
], 8,
|
|
4862
|
+
], 8, wr),
|
|
4765
4863
|
(f(), M(ha, { to: "body" }, [
|
|
4766
4864
|
a.value ? (f(), g("div", {
|
|
4767
4865
|
key: 0,
|
|
4768
4866
|
class: "fixed inset-0 z-[100] flex items-start justify-center overflow-y-auto bg-slate-900/40 px-4 pt-[12vh] backdrop-blur-sm dark:bg-black/60",
|
|
4769
|
-
onClick:
|
|
4867
|
+
onClick: Q(d, ["self"])
|
|
4770
4868
|
}, [
|
|
4771
4869
|
n("div", {
|
|
4772
4870
|
class: "glass-inset w-full max-w-2xl overflow-hidden rounded-xl border border-gray-light-10/70 bg-white/95 dark:border-white/10 dark:bg-night-light-10/95",
|
|
@@ -4774,8 +4872,8 @@ end;`, detail: "event(name: string)" },
|
|
|
4774
4872
|
"aria-modal": "true",
|
|
4775
4873
|
"aria-label": e.dialogLabel
|
|
4776
4874
|
}, [
|
|
4777
|
-
n("div",
|
|
4778
|
-
|
|
4875
|
+
n("div", _r, [
|
|
4876
|
+
p(V, {
|
|
4779
4877
|
name: "search",
|
|
4780
4878
|
size: 18,
|
|
4781
4879
|
class: "shrink-0 text-gray-main"
|
|
@@ -4787,39 +4885,39 @@ end;`, detail: "event(name: string)" },
|
|
|
4787
4885
|
type: "search",
|
|
4788
4886
|
placeholder: e.placeholder,
|
|
4789
4887
|
class: "h-14 min-w-0 flex-1 bg-transparent text-sm text-gray-dark-40 placeholder:text-gray-main focus:outline-none dark:text-white dark:placeholder:text-gray-main"
|
|
4790
|
-
}, null, 8,
|
|
4791
|
-
[
|
|
4888
|
+
}, null, 8, Tr), [
|
|
4889
|
+
[$t, l.value]
|
|
4792
4890
|
]),
|
|
4793
4891
|
c[2] || (c[2] = n("kbd", { class: "hidden rounded border border-gray-light-10/60 px-1.5 py-0.5 font-mono text-xs text-gray-main dark:border-white/10 dark:text-gray-dark-25 sm:inline" }, "Esc", -1))
|
|
4794
4892
|
]),
|
|
4795
|
-
n("div",
|
|
4796
|
-
(f(!0), g(
|
|
4893
|
+
n("div", zr, [
|
|
4894
|
+
(f(!0), g(D, null, U(o.value, (u) => (f(), g("a", {
|
|
4797
4895
|
key: `${u.group}-${u.to}-${u.title}`,
|
|
4798
4896
|
href: u.to,
|
|
4799
4897
|
class: "flex items-start gap-3 rounded-md px-3 py-2.5 transition-colors hover:bg-white/50 dark:hover:bg-white/5",
|
|
4800
4898
|
onClick: d
|
|
4801
4899
|
}, [
|
|
4802
|
-
|
|
4900
|
+
p(V, {
|
|
4803
4901
|
name: "arrow-right",
|
|
4804
4902
|
size: 16,
|
|
4805
4903
|
class: "mt-0.5 shrink-0 text-gray-main"
|
|
4806
4904
|
}),
|
|
4807
|
-
n("span",
|
|
4808
|
-
n("span",
|
|
4809
|
-
n("span",
|
|
4810
|
-
u.group ? (f(), g("span",
|
|
4905
|
+
n("span", Er, [
|
|
4906
|
+
n("span", Br, [
|
|
4907
|
+
n("span", Vr, C(u.title), 1),
|
|
4908
|
+
u.group ? (f(), g("span", Ir, C(u.group), 1)) : T("", !0)
|
|
4811
4909
|
]),
|
|
4812
|
-
u.description ? (f(), g("span",
|
|
4910
|
+
u.description ? (f(), g("span", Lr, C(u.description), 1)) : T("", !0)
|
|
4813
4911
|
])
|
|
4814
|
-
], 8,
|
|
4815
|
-
o.value.length ? T("", !0) : (f(), g("p",
|
|
4912
|
+
], 8, Ar))), 128)),
|
|
4913
|
+
o.value.length ? T("", !0) : (f(), g("p", Mr, C(e.emptyText), 1))
|
|
4816
4914
|
])
|
|
4817
|
-
], 8,
|
|
4915
|
+
], 8, Sr)
|
|
4818
4916
|
])) : T("", !0)
|
|
4819
4917
|
]))
|
|
4820
4918
|
], 64));
|
|
4821
4919
|
}
|
|
4822
|
-
}),
|
|
4920
|
+
}), Or = ["aria-label", "title"], Od = /* @__PURE__ */ O({
|
|
4823
4921
|
__name: "VisionThemeToggle",
|
|
4824
4922
|
props: {
|
|
4825
4923
|
labelLight: { default: "Включить светлую тему" },
|
|
@@ -4832,7 +4930,7 @@ end;`, detail: "event(name: string)" },
|
|
|
4832
4930
|
s.value = l, za(l);
|
|
4833
4931
|
};
|
|
4834
4932
|
return be(async () => {
|
|
4835
|
-
await
|
|
4933
|
+
await wt(), setTimeout(() => a(s.value), 0);
|
|
4836
4934
|
}), (l, t) => (f(), g("button", {
|
|
4837
4935
|
type: "button",
|
|
4838
4936
|
class: "grid size-9 place-items-center rounded-md text-gray-dark-25 transition-colors hover:bg-white/50 hover:text-violet-main dark:text-gray-light-10 dark:hover:bg-white/5 dark:hover:text-white",
|
|
@@ -4840,13 +4938,13 @@ end;`, detail: "event(name: string)" },
|
|
|
4840
4938
|
title: s.value === "dark" ? e.titleLight : e.titleDark,
|
|
4841
4939
|
onClick: t[0] || (t[0] = (o) => a(s.value === "dark" ? "light" : "dark"))
|
|
4842
4940
|
}, [
|
|
4843
|
-
|
|
4941
|
+
p(V, {
|
|
4844
4942
|
name: s.value === "dark" ? "sun" : "moon",
|
|
4845
4943
|
size: 18
|
|
4846
4944
|
}, null, 8, ["name"])
|
|
4847
|
-
], 8,
|
|
4945
|
+
], 8, Or));
|
|
4848
4946
|
}
|
|
4849
|
-
}),
|
|
4947
|
+
}), Fd = /* @__PURE__ */ O({
|
|
4850
4948
|
__name: "VAutocomplete",
|
|
4851
4949
|
props: {
|
|
4852
4950
|
modelValue: { default: "" },
|
|
@@ -4864,8 +4962,8 @@ end;`, detail: "event(name: string)" },
|
|
|
4864
4962
|
top: "50px",
|
|
4865
4963
|
"hide-on-click": ""
|
|
4866
4964
|
}), {
|
|
4867
|
-
activator:
|
|
4868
|
-
|
|
4965
|
+
activator: x(({ on: d }) => [
|
|
4966
|
+
p(ie, {
|
|
4869
4967
|
"model-value": e.modelValue,
|
|
4870
4968
|
name: e.name,
|
|
4871
4969
|
message: e.message,
|
|
@@ -4874,13 +4972,13 @@ end;`, detail: "event(name: string)" },
|
|
|
4874
4972
|
onClick: d.open
|
|
4875
4973
|
}, null, 8, ["model-value", "name", "message", "label", "onClick"])
|
|
4876
4974
|
]),
|
|
4877
|
-
default:
|
|
4878
|
-
|
|
4975
|
+
default: x(({ on: d, isLgOrLarger: m }) => [
|
|
4976
|
+
p(Ct, {
|
|
4879
4977
|
items: e.items,
|
|
4880
4978
|
plain: !m,
|
|
4881
4979
|
onClick: (r) => t(d, r)
|
|
4882
4980
|
}, {
|
|
4883
|
-
default:
|
|
4981
|
+
default: x(({ item: r }) => [
|
|
4884
4982
|
I(o.$slots, "default", { item: r }, () => [
|
|
4885
4983
|
L(C(r.name), 1)
|
|
4886
4984
|
])
|
|
@@ -4891,7 +4989,7 @@ end;`, detail: "event(name: string)" },
|
|
|
4891
4989
|
_: 3
|
|
4892
4990
|
}, 16));
|
|
4893
4991
|
}
|
|
4894
|
-
}),
|
|
4992
|
+
}), Fr = { class: "v-expansion__content max-h-0 overflow-hidden transition-all duration-300" }, Dr = { class: "p-4" }, Dd = /* @__PURE__ */ O({
|
|
4895
4993
|
__name: "VExpansion",
|
|
4896
4994
|
props: {
|
|
4897
4995
|
label: { default: "" },
|
|
@@ -4920,23 +5018,23 @@ end;`, detail: "event(name: string)" },
|
|
|
4920
5018
|
n("div", {
|
|
4921
5019
|
class: B(["transition text-gray-main", { "rotate-x-180": a.value }])
|
|
4922
5020
|
}, [
|
|
4923
|
-
|
|
5021
|
+
p(V, {
|
|
4924
5022
|
name: "chevron-down",
|
|
4925
5023
|
class: "size-5"
|
|
4926
5024
|
})
|
|
4927
5025
|
], 2)
|
|
4928
5026
|
]),
|
|
4929
|
-
n("div",
|
|
4930
|
-
n("div",
|
|
5027
|
+
n("div", Fr, [
|
|
5028
|
+
n("div", Dr, [
|
|
4931
5029
|
I(o.$slots, "default")
|
|
4932
5030
|
])
|
|
4933
5031
|
])
|
|
4934
5032
|
], 512));
|
|
4935
5033
|
}
|
|
4936
|
-
}),
|
|
5034
|
+
}), jr = ["onDragstart", "onDragenter"], Nr = {
|
|
4937
5035
|
key: 0,
|
|
4938
5036
|
class: "absolute inset-0 border border-dashed border-blue-600 rounded"
|
|
4939
|
-
},
|
|
5037
|
+
}, jd = /* @__PURE__ */ O({
|
|
4940
5038
|
__name: "VDragDrop",
|
|
4941
5039
|
props: {
|
|
4942
5040
|
items: {},
|
|
@@ -4947,28 +5045,28 @@ end;`, detail: "event(name: string)" },
|
|
|
4947
5045
|
const a = s, l = F(null), t = F(0), o = F(-1), i = ({ id: u }) => ({
|
|
4948
5046
|
"opacity-30 scale-105 z-10": l.value === u,
|
|
4949
5047
|
"transition-transform duration-200": l.value !== u
|
|
4950
|
-
}), d = (u,
|
|
4951
|
-
l.value =
|
|
5048
|
+
}), d = (u, h, k) => {
|
|
5049
|
+
l.value = h, t.value = k, u.dataTransfer.effectAllowed = "move";
|
|
4952
5050
|
}, m = (u) => {
|
|
4953
5051
|
l.value !== null && (o.value = u);
|
|
4954
5052
|
}, r = () => {
|
|
4955
5053
|
l.value = null, o.value = -1;
|
|
4956
5054
|
}, c = (u) => {
|
|
4957
5055
|
if (u.preventDefault(), l.value && o.value !== -1) {
|
|
4958
|
-
const
|
|
4959
|
-
if (
|
|
4960
|
-
const
|
|
4961
|
-
|
|
5056
|
+
const h = e.items.findIndex((v) => v[e.itemKey] === l.value), k = o.value;
|
|
5057
|
+
if (h !== k && k !== -1) {
|
|
5058
|
+
const v = [...e.items], [y] = v.splice(h, 1);
|
|
5059
|
+
v.splice(k, 0, y), a("update:items", v), a("order-change", { fromIndex: h, toIndex: k, movedItem: y, newOrder: v });
|
|
4962
5060
|
}
|
|
4963
5061
|
}
|
|
4964
5062
|
o.value = -1;
|
|
4965
5063
|
};
|
|
4966
|
-
return (u,
|
|
4967
|
-
onDragover:
|
|
5064
|
+
return (u, h) => (f(), g("div", {
|
|
5065
|
+
onDragover: h[1] || (h[1] = Q(() => {
|
|
4968
5066
|
}, ["prevent"])),
|
|
4969
5067
|
onDrop: c
|
|
4970
5068
|
}, [
|
|
4971
|
-
|
|
5069
|
+
p(Kt, {
|
|
4972
5070
|
"enter-active-class": "transition-all duration-300 ease",
|
|
4973
5071
|
"enter-from-class": "opacity-0 translate-x-8",
|
|
4974
5072
|
"enter-to-class": "opacity-100 translate-x-0",
|
|
@@ -4977,34 +5075,34 @@ end;`, detail: "event(name: string)" },
|
|
|
4977
5075
|
"leave-to-class": "opacity-0 translate-x-8",
|
|
4978
5076
|
"move-class": "transition-all duration-300 ease"
|
|
4979
5077
|
}, {
|
|
4980
|
-
default:
|
|
4981
|
-
(f(!0), g(
|
|
5078
|
+
default: x(() => [
|
|
5079
|
+
(f(!0), g(D, null, U(e.items, (k, v) => (f(), g("div", {
|
|
4982
5080
|
key: `${k.id}_drug`,
|
|
4983
5081
|
class: B(["relative group", i(k)]),
|
|
4984
5082
|
draggable: "true",
|
|
4985
|
-
onDragstart: (
|
|
4986
|
-
onDragenter: (
|
|
5083
|
+
onDragstart: (y) => d(y, k.id, v),
|
|
5084
|
+
onDragenter: (y) => m(v),
|
|
4987
5085
|
onDragend: r,
|
|
4988
|
-
onDragover:
|
|
5086
|
+
onDragover: h[0] || (h[0] = Q(() => {
|
|
4989
5087
|
}, ["prevent"]))
|
|
4990
5088
|
}, [
|
|
4991
5089
|
I(u.$slots, "default", {
|
|
4992
5090
|
item: k,
|
|
4993
5091
|
key: k.id,
|
|
4994
|
-
index:
|
|
5092
|
+
index: v,
|
|
4995
5093
|
isDragging: l.value === k.id
|
|
4996
5094
|
}),
|
|
4997
|
-
o.value ===
|
|
4998
|
-
], 42,
|
|
5095
|
+
o.value === v && l.value !== k.id ? (f(), g("div", Nr)) : T("", !0)
|
|
5096
|
+
], 42, jr))), 128))
|
|
4999
5097
|
]),
|
|
5000
5098
|
_: 3
|
|
5001
5099
|
})
|
|
5002
5100
|
], 32));
|
|
5003
5101
|
}
|
|
5004
|
-
}),
|
|
5102
|
+
}), Pr = { class: "glass-inset overflow-x-auto rounded-md" }, Rr = { class: "min-w-full" }, Ur = { class: "border-y border-gray-light-10/70 py-3 dark:border-white/10" }, Kr = { class: "bg-gray-light-30/70 dark:bg-white/[0.04]" }, Wr = { class: "flex items-center" }, Hr = { class: "divide-y divide-gray-light-30 dark:divide-white/5" }, Gr = ["onClick"], Jr = { class: "flex items-center text-gray-dark-30 dark:text-white/70" }, qr = { key: 1 }, Xr = {
|
|
5005
5103
|
class: "py-3 whitespace-nowrap",
|
|
5006
5104
|
colspan: "9"
|
|
5007
|
-
},
|
|
5105
|
+
}, Yr = { class: "flex items-center justify-center px-2 text-sm text-gray-dark-25 dark:text-white/50" }, Nd = /* @__PURE__ */ O({
|
|
5008
5106
|
__name: "VTable",
|
|
5009
5107
|
props: {
|
|
5010
5108
|
headers: { default: () => [] },
|
|
@@ -5013,11 +5111,11 @@ end;`, detail: "event(name: string)" },
|
|
|
5013
5111
|
emits: ["click"],
|
|
5014
5112
|
setup(e, { emit: s }) {
|
|
5015
5113
|
const a = s, l = (i, d) => a("click", i, d), t = (i) => (i == null ? void 0 : i.className) || "", o = (i, { key: d }) => i == null ? void 0 : i[d];
|
|
5016
|
-
return (i, d) => (f(), g("div",
|
|
5017
|
-
n("table",
|
|
5018
|
-
n("thead",
|
|
5019
|
-
n("tr",
|
|
5020
|
-
(f(!0), g(
|
|
5114
|
+
return (i, d) => (f(), g("div", Pr, [
|
|
5115
|
+
n("table", Rr, [
|
|
5116
|
+
n("thead", Ur, [
|
|
5117
|
+
n("tr", Kr, [
|
|
5118
|
+
(f(!0), g(D, null, U(e.headers, (m, r) => (f(), g("th", {
|
|
5021
5119
|
key: r,
|
|
5022
5120
|
class: B(["px-4 py-2 whitespace-nowrap font-normal text-gray-dark-25 dark:text-white/50", t(m)])
|
|
5023
5121
|
}, [
|
|
@@ -5025,22 +5123,22 @@ end;`, detail: "event(name: string)" },
|
|
|
5025
5123
|
item: m,
|
|
5026
5124
|
i: r
|
|
5027
5125
|
}, () => [
|
|
5028
|
-
n("div",
|
|
5126
|
+
n("div", Wr, C(m.name), 1)
|
|
5029
5127
|
])
|
|
5030
5128
|
], 2))), 128))
|
|
5031
5129
|
])
|
|
5032
5130
|
]),
|
|
5033
|
-
n("tbody",
|
|
5034
|
-
e.items.length ? (f(!0), g(
|
|
5131
|
+
n("tbody", Hr, [
|
|
5132
|
+
e.items.length ? (f(!0), g(D, { key: 0 }, U(e.items, (m, r) => (f(), g("tr", {
|
|
5035
5133
|
key: r,
|
|
5036
5134
|
class: "transition-colors hover:bg-cyan-main/[0.04] dark:hover:bg-white/[0.04]",
|
|
5037
5135
|
onClick: (c) => l(m, c)
|
|
5038
5136
|
}, [
|
|
5039
|
-
(f(!0), g(
|
|
5137
|
+
(f(!0), g(D, null, U(e.headers, (c, u) => (f(), g("td", {
|
|
5040
5138
|
key: u,
|
|
5041
5139
|
class: "py-2 px-4"
|
|
5042
5140
|
}, [
|
|
5043
|
-
n("div",
|
|
5141
|
+
n("div", Jr, [
|
|
5044
5142
|
I(i.$slots, c.key, {
|
|
5045
5143
|
item: m,
|
|
5046
5144
|
i: r
|
|
@@ -5049,9 +5147,9 @@ end;`, detail: "event(name: string)" },
|
|
|
5049
5147
|
])
|
|
5050
5148
|
])
|
|
5051
5149
|
]))), 128))
|
|
5052
|
-
], 8,
|
|
5053
|
-
n("td",
|
|
5054
|
-
n("div",
|
|
5150
|
+
], 8, Gr))), 128)) : (f(), g("tr", qr, [
|
|
5151
|
+
n("td", Xr, [
|
|
5152
|
+
n("div", Yr, [
|
|
5055
5153
|
I(i.$slots, "empty", {}, () => [
|
|
5056
5154
|
d[0] || (d[0] = L("The list is empty", -1))
|
|
5057
5155
|
])
|
|
@@ -5062,7 +5160,7 @@ end;`, detail: "event(name: string)" },
|
|
|
5062
5160
|
])
|
|
5063
5161
|
]));
|
|
5064
5162
|
}
|
|
5065
|
-
}),
|
|
5163
|
+
}), Pd = /* @__PURE__ */ O({
|
|
5066
5164
|
__name: "VTooltip",
|
|
5067
5165
|
props: {
|
|
5068
5166
|
timeout: {},
|
|
@@ -5086,7 +5184,7 @@ end;`, detail: "event(name: string)" },
|
|
|
5086
5184
|
}, [
|
|
5087
5185
|
I(o.$slots, "activator")
|
|
5088
5186
|
]),
|
|
5089
|
-
|
|
5187
|
+
p(kt, {
|
|
5090
5188
|
"enter-active-class": "duration-300 ease-out",
|
|
5091
5189
|
"enter-from-class": "transform opacity-0 -translate-y-2",
|
|
5092
5190
|
"enter-to-class": "opacity-100 translate-y-0",
|
|
@@ -5094,7 +5192,7 @@ end;`, detail: "event(name: string)" },
|
|
|
5094
5192
|
"leave-from-class": "opacity-100 translate-y-0",
|
|
5095
5193
|
"leave-to-class": "transform opacity-0 -translate-y-2"
|
|
5096
5194
|
}, {
|
|
5097
|
-
default:
|
|
5195
|
+
default: x(() => [
|
|
5098
5196
|
I(o.$slots, "default", { show: s.value })
|
|
5099
5197
|
]),
|
|
5100
5198
|
_: 3
|
|
@@ -5103,80 +5201,81 @@ end;`, detail: "event(name: string)" },
|
|
|
5103
5201
|
}
|
|
5104
5202
|
});
|
|
5105
5203
|
export {
|
|
5106
|
-
|
|
5107
|
-
|
|
5108
|
-
|
|
5109
|
-
|
|
5110
|
-
|
|
5111
|
-
|
|
5112
|
-
|
|
5204
|
+
ld as AppAside,
|
|
5205
|
+
od as AppHeader,
|
|
5206
|
+
dd as AppNav,
|
|
5207
|
+
id as AppNotification,
|
|
5208
|
+
rd as AppOverlay,
|
|
5209
|
+
cd as AppProgress,
|
|
5210
|
+
pd as BlockBreadcrumb,
|
|
5113
5211
|
Xt as BlockDataSettings,
|
|
5114
5212
|
Sl as BlockHost,
|
|
5115
|
-
|
|
5116
|
-
|
|
5117
|
-
|
|
5118
|
-
|
|
5119
|
-
|
|
5213
|
+
xd as BlockImport,
|
|
5214
|
+
ud as BlockInfo,
|
|
5215
|
+
yd as BlockPicker,
|
|
5216
|
+
md as BlockScan,
|
|
5217
|
+
fd as BlockService,
|
|
5120
5218
|
Vl as BlockShell,
|
|
5121
|
-
|
|
5122
|
-
|
|
5123
|
-
|
|
5124
|
-
|
|
5125
|
-
|
|
5126
|
-
|
|
5127
|
-
|
|
5128
|
-
|
|
5129
|
-
|
|
5130
|
-
|
|
5219
|
+
gd as BlockStatus,
|
|
5220
|
+
vd as BlockUpdate,
|
|
5221
|
+
bd as BlockView,
|
|
5222
|
+
Ie as CardBase,
|
|
5223
|
+
Cd as CardButton,
|
|
5224
|
+
Sd as CardDate,
|
|
5225
|
+
_d as CardDimmer,
|
|
5226
|
+
Td as CardInfo,
|
|
5227
|
+
zd as CardInput,
|
|
5228
|
+
Ad as CardList,
|
|
5131
5229
|
Ga as CardNotification,
|
|
5230
|
+
Ed as CardPalette,
|
|
5132
5231
|
zt as DEFAULT_METRIC_STYLE,
|
|
5133
|
-
|
|
5134
|
-
|
|
5135
|
-
|
|
5136
|
-
|
|
5137
|
-
|
|
5138
|
-
|
|
5232
|
+
gr as DEFAULT_SUGGESTIONS,
|
|
5233
|
+
kd as EnergyFlowBlock,
|
|
5234
|
+
Kd as ICONS,
|
|
5235
|
+
Wd as ICON_NAMES,
|
|
5236
|
+
Bd as ItemEdit,
|
|
5237
|
+
yt as MAX_METRICS,
|
|
5139
5238
|
Ge as MAX_METRIC_ARGS,
|
|
5140
|
-
|
|
5141
|
-
|
|
5142
|
-
|
|
5143
|
-
|
|
5239
|
+
Ld as ScriptDialog,
|
|
5240
|
+
Vd as ScriptEditor,
|
|
5241
|
+
Id as ScriptViewDocs,
|
|
5242
|
+
Fd as VAutocomplete,
|
|
5144
5243
|
R as VButton,
|
|
5145
5244
|
Ul as VCard,
|
|
5146
|
-
|
|
5245
|
+
Si as VCheckbox,
|
|
5147
5246
|
ze as VDialog,
|
|
5148
|
-
|
|
5247
|
+
jd as VDragDrop,
|
|
5149
5248
|
Gt as VDropdown,
|
|
5150
|
-
|
|
5249
|
+
Dd as VExpansion,
|
|
5151
5250
|
gn as VFile,
|
|
5152
5251
|
He as VFunc,
|
|
5153
5252
|
V as VIcon,
|
|
5154
5253
|
Ht as VIconLogo,
|
|
5155
5254
|
ya as VIconLogoMini,
|
|
5156
|
-
|
|
5255
|
+
Ct as VList,
|
|
5157
5256
|
_t as VListObject,
|
|
5158
5257
|
xa as VLoader,
|
|
5159
|
-
|
|
5258
|
+
Hd as VPopup,
|
|
5160
5259
|
he as VSelect,
|
|
5161
|
-
|
|
5162
|
-
|
|
5260
|
+
Nd as VTable,
|
|
5261
|
+
$i as VTabs,
|
|
5163
5262
|
ie as VTextField,
|
|
5164
5263
|
Tt as VTextWrapper,
|
|
5165
|
-
|
|
5264
|
+
Pd as VTooltip,
|
|
5166
5265
|
ba as VWifiIcon,
|
|
5167
|
-
|
|
5168
|
-
|
|
5266
|
+
Md as VisionSearch,
|
|
5267
|
+
Od as VisionThemeToggle,
|
|
5169
5268
|
wo as createBlockContext,
|
|
5170
5269
|
Wo as createDeviceBlockStorage,
|
|
5171
5270
|
Co as createDeviceContext,
|
|
5172
|
-
|
|
5271
|
+
$d as deviceBlockStorage,
|
|
5173
5272
|
So as deviceProvider,
|
|
5174
5273
|
$o as energyFlowDefinition,
|
|
5175
|
-
|
|
5176
|
-
|
|
5274
|
+
ur as fullHighlighter,
|
|
5275
|
+
ht as metricClasses,
|
|
5177
5276
|
Et as resolveBlockBindings,
|
|
5178
5277
|
Hn as resolveBlockMetrics,
|
|
5179
5278
|
Wn as resolveMetric,
|
|
5180
|
-
|
|
5181
|
-
|
|
5279
|
+
hd as resolveMetricArgValues,
|
|
5280
|
+
wd as useBlock
|
|
5182
5281
|
};
|