vuesp-components 2.2.0 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/VDialog.vue_vue_type_script_setup_true_lang-BLLrcXdW.js +652 -0
- package/dist/components/index.es.js +3095 -0
- package/dist/composables/index.es.js +1 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +28 -3866
- package/dist/style.css +1 -1
- package/dist/{useSwipeDown-BctVX4c1.js → useDialog-ALG4kFE7.js} +29 -29
- package/package.json +9 -3
- package/dist/helpers/validate.d.ts +0 -13
- package/dist/helpers/validate.d.ts.map +0 -1
package/dist/index.es.js
CHANGED
|
@@ -1,3870 +1,32 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
const Me = /* @__PURE__ */ we(Et, [["render", Lt]]), Mt = {}, At = {
|
|
30
|
-
width: "40",
|
|
31
|
-
height: "40",
|
|
32
|
-
viewBox: "0 0 40 40",
|
|
33
|
-
fill: "currentColor"
|
|
34
|
-
};
|
|
35
|
-
function Dt(e, n) {
|
|
36
|
-
return m(), v("svg", At, [...n[0] || (n[0] = [
|
|
37
|
-
a("g", { transform: "matrix(0.13287749,0,0,0.13643171,26.823508,13.407673)" }, [
|
|
38
|
-
a("path", { d: "m -19.25933,-16.057909 c 0,39.1906 -14.287,86.055995 -38.669,116.999999 -7.898,10.024 -30.4718,32.819 -43.7731,17.695 -9.4823,-10.781 -3.53183,-36.917714 -0.86893,-48.907714 9.1618,-41.251693 19.72123,-78.8733849 30.31103,-119.787285 -27.50968,14.537655 -68.26323,-24.154322 -70.36602,-2.214449 -12.32038,69.23655 -28.82323,204.245118 16.36602,215.925448 81.802,10.63 120.333,-82.698004 129.4249996,-148.710999 2.182,-15.84009991 4.123,-31.9832 2.401,-48 -2.342,-21.78506 -24.7959996,-32.68227 -43.7859996,-21.58643 -11.424,6.67523 -12.148,29.93713 -1.935,38.01393 5.462,4.3199 14.927,3.091 20.895,0.5725 z" })
|
|
39
|
-
], -1)
|
|
40
|
-
])]);
|
|
41
|
-
}
|
|
42
|
-
const Ye = /* @__PURE__ */ we(Mt, [["render", Dt]]), It = { class: "no-scrollbar flex flex-col overflow-y-auto duration-300 ease-linear h-full" }, Ma = /* @__PURE__ */ B({
|
|
43
|
-
__name: "AppAside",
|
|
44
|
-
props: {
|
|
45
|
-
isSidebar: { type: Boolean, default: !1 }
|
|
46
|
-
},
|
|
47
|
-
emits: ["sidebar"],
|
|
48
|
-
setup(e, { emit: n }) {
|
|
49
|
-
const l = n, s = () => {
|
|
50
|
-
e.isSidebar && l("sidebar", !e.isSidebar);
|
|
51
|
-
};
|
|
52
|
-
return (t, o) => {
|
|
53
|
-
const i = Ue("router-link");
|
|
54
|
-
return m(), v(N, null, [
|
|
55
|
-
e.isSidebar ? (m(), v("div", {
|
|
56
|
-
key: 0,
|
|
57
|
-
class: "lg:hidden overlay fixed left-0 top-0 h-full w-full bg-black/40 z-10 bg-blur",
|
|
58
|
-
onClick: s
|
|
59
|
-
})) : T("", !0),
|
|
60
|
-
a("aside", {
|
|
61
|
-
class: E([e.isSidebar ? "translate-x-0 lg:w-[90px]" : "-translate-x-full", "overflow-x-hidden fixed top-0 left-0 z-10 flex lg:static h-full w-[290px] flex-col overflow-y-auto border-r border-gray-200 px-5 transition-all duration-350 lg:translate-x-0 dark:border-gray-800 bg-white dark:bg-gray-900"])
|
|
62
|
-
}, [
|
|
63
|
-
a("div", {
|
|
64
|
-
class: E([e.isSidebar ? "justify-center" : "justify-between", "sidebar-header flex items-center gap-2 pt-6 pb-6 justify-between"])
|
|
65
|
-
}, [
|
|
66
|
-
b(i, { to: "/" }, {
|
|
67
|
-
default: y(() => [
|
|
68
|
-
e.isSidebar ? (m(), A(Ye, {
|
|
69
|
-
key: 0,
|
|
70
|
-
class: "h-[30px] text-primary"
|
|
71
|
-
})) : (m(), A(Me, {
|
|
72
|
-
key: 1,
|
|
73
|
-
class: "h-[30px] text-primary"
|
|
74
|
-
}))
|
|
75
|
-
]),
|
|
76
|
-
_: 1
|
|
77
|
-
})
|
|
78
|
-
], 2),
|
|
79
|
-
a("div", It, [
|
|
80
|
-
_(t.$slots, "default")
|
|
81
|
-
])
|
|
82
|
-
], 2)
|
|
83
|
-
], 64);
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
}), Ot = {
|
|
87
|
-
viewBox: "0 0 24 24",
|
|
88
|
-
width: "1.2em",
|
|
89
|
-
height: "1.2em"
|
|
90
|
-
};
|
|
91
|
-
function jt(e, n) {
|
|
92
|
-
return m(), v("svg", Ot, [...n[0] || (n[0] = [
|
|
93
|
-
a("path", {
|
|
94
|
-
fill: "currentColor",
|
|
95
|
-
d: "M4.5 10.5c-.825 0-1.5.675-1.5 1.5s.675 1.5 1.5 1.5S6 12.825 6 12s-.675-1.5-1.5-1.5m15 0c-.825 0-1.5.675-1.5 1.5s.675 1.5 1.5 1.5S21 12.825 21 12s-.675-1.5-1.5-1.5m-7.5 0c-.825 0-1.5.675-1.5 1.5s.675 1.5 1.5 1.5s1.5-.675 1.5-1.5s-.675-1.5-1.5-1.5"
|
|
96
|
-
}, null, -1)
|
|
97
|
-
])]);
|
|
98
|
-
}
|
|
99
|
-
const Qe = K({ name: "ri-more-line", render: jt }), Pt = {
|
|
100
|
-
viewBox: "0 0 24 24",
|
|
101
|
-
width: "1.2em",
|
|
102
|
-
height: "1.2em"
|
|
103
|
-
};
|
|
104
|
-
function Ht(e, n) {
|
|
105
|
-
return m(), v("svg", Pt, [...n[0] || (n[0] = [
|
|
106
|
-
a("path", {
|
|
107
|
-
fill: "currentColor",
|
|
108
|
-
d: "M4 18h2v2h12V4H6v2H4V3a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1zm2-7h7v2H6v3l-5-4l5-4z"
|
|
109
|
-
}, null, -1)
|
|
110
|
-
])]);
|
|
111
|
-
}
|
|
112
|
-
const Nt = K({ name: "ri-logout-box-line", render: Ht }), Ft = {
|
|
113
|
-
viewBox: "0 0 24 24",
|
|
114
|
-
width: "1.2em",
|
|
115
|
-
height: "1.2em"
|
|
116
|
-
};
|
|
117
|
-
function Rt(e, n) {
|
|
118
|
-
return m(), v("svg", Ft, [...n[0] || (n[0] = [
|
|
119
|
-
a("path", {
|
|
120
|
-
fill: "currentColor",
|
|
121
|
-
d: "M5 18h14v-6.969C19 7.148 15.866 4 12 4s-7 3.148-7 7.031zm7-16c4.97 0 9 4.043 9 9.031V20H3v-8.969C3 6.043 7.03 2 12 2M9.5 21h5a2.5 2.5 0 0 1-5 0"
|
|
122
|
-
}, null, -1)
|
|
123
|
-
])]);
|
|
124
|
-
}
|
|
125
|
-
const et = K({ name: "ri-notification-line", render: Rt }), Ut = {
|
|
126
|
-
viewBox: "0 0 24 24",
|
|
127
|
-
width: "1.2em",
|
|
128
|
-
height: "1.2em"
|
|
129
|
-
};
|
|
130
|
-
function Kt(e, n) {
|
|
131
|
-
return m(), v("svg", Ut, [...n[0] || (n[0] = [
|
|
132
|
-
a("path", {
|
|
133
|
-
fill: "currentColor",
|
|
134
|
-
d: "M10 7a7 7 0 0 0 12 4.9v.1c0 5.523-4.477 10-10 10S2 17.523 2 12S6.477 2 12 2h.1A6.98 6.98 0 0 0 10 7m-6 5a8 8 0 0 0 15.062 3.762A9 9 0 0 1 8.238 4.938A8 8 0 0 0 4 12"
|
|
135
|
-
}, null, -1)
|
|
136
|
-
])]);
|
|
137
|
-
}
|
|
138
|
-
const Wt = K({ name: "ri-moon-line", render: Kt }), qt = {
|
|
139
|
-
viewBox: "0 0 24 24",
|
|
140
|
-
width: "1.2em",
|
|
141
|
-
height: "1.2em"
|
|
142
|
-
};
|
|
143
|
-
function Gt(e, n) {
|
|
144
|
-
return m(), v("svg", qt, [...n[0] || (n[0] = [
|
|
145
|
-
a("path", {
|
|
146
|
-
fill: "currentColor",
|
|
147
|
-
d: "M12 18a6 6 0 1 1 0-12a6 6 0 0 1 0 12m0-2a4 4 0 1 0 0-8a4 4 0 0 0 0 8M11 1h2v3h-2zm0 19h2v3h-2zM3.515 4.929l1.414-1.414L7.05 5.636L5.636 7.05zM16.95 18.364l1.414-1.414l2.121 2.121l-1.414 1.414zm2.121-14.85l1.414 1.415l-2.121 2.121l-1.414-1.414zM5.636 16.95l1.414 1.414l-2.121 2.121l-1.414-1.414zM23 11v2h-3v-2zM4 11v2H1v-2z"
|
|
148
|
-
}, null, -1)
|
|
149
|
-
])]);
|
|
150
|
-
}
|
|
151
|
-
const Zt = K({ name: "ri-sun-line", render: Gt }), Jt = {
|
|
152
|
-
viewBox: "0 0 24 24",
|
|
153
|
-
width: "1.2em",
|
|
154
|
-
height: "1.2em"
|
|
155
|
-
};
|
|
156
|
-
function Xt(e, n) {
|
|
157
|
-
return m(), v("svg", Jt, [...n[0] || (n[0] = [
|
|
158
|
-
a("path", {
|
|
159
|
-
fill: "currentColor",
|
|
160
|
-
d: "M3 4h18v2H3zm0 7h18v2H3zm0 7h18v2H3z"
|
|
161
|
-
}, null, -1)
|
|
162
|
-
])]);
|
|
163
|
-
}
|
|
164
|
-
const Yt = K({ name: "ri-menu-line", render: Xt }), Qt = {}, en = {
|
|
165
|
-
class: "animate-spin h-6 w-6",
|
|
166
|
-
fill: "none",
|
|
167
|
-
viewBox: "0 0 24 24"
|
|
168
|
-
};
|
|
169
|
-
function tn(e, n) {
|
|
170
|
-
return m(), v("svg", en, [...n[0] || (n[0] = [
|
|
171
|
-
a("circle", {
|
|
172
|
-
class: "opacity-25",
|
|
173
|
-
cx: "12",
|
|
174
|
-
cy: "12",
|
|
175
|
-
r: "10",
|
|
176
|
-
stroke: "currentColor",
|
|
177
|
-
"stroke-width": "2"
|
|
178
|
-
}, null, -1),
|
|
179
|
-
a("path", {
|
|
180
|
-
class: "opacity-75",
|
|
181
|
-
fill: "currentColor",
|
|
182
|
-
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
183
|
-
}, null, -1)
|
|
184
|
-
])]);
|
|
185
|
-
}
|
|
186
|
-
const Ae = /* @__PURE__ */ we(Qt, [["render", tn]]), nn = "relative flex justify-center items-center transition not-disabled:cursor-pointer not-disabled:hover:opacity-90 disabled:opacity-40 rounded", j = /* @__PURE__ */ B({
|
|
187
|
-
__name: "VButton",
|
|
188
|
-
props: {
|
|
189
|
-
outline: { type: Boolean, default: !1 },
|
|
190
|
-
color: { default: "transparent" },
|
|
191
|
-
size: { default: "md" },
|
|
192
|
-
type: { default: "button" },
|
|
193
|
-
href: { default: "" },
|
|
194
|
-
to: { default: "" },
|
|
195
|
-
loading: { type: Boolean, default: !1 }
|
|
196
|
-
},
|
|
197
|
-
emits: ["click"],
|
|
198
|
-
setup(e, { emit: n }) {
|
|
199
|
-
const l = n, s = (z) => l("click", z), t = e.outline ? "dark:text-white border border-green-600 text-green-600" : "text-white bg-green-600 dark:bg-green-800", o = e.outline ? "dark:text-white border border-red-600 text-red-600" : "text-white bg-red-600 dark:bg-red-800", i = e.outline ? "dark:text-white border border-gray-600 text-gray-600" : "bg-gray-100 dark:bg-gray-800", r = e.outline ? "dark:text-white border border-blue-600 text-blue-600" : "text-white bg-blue-700 dark:bg-blue-800", u = (e.outline, ""), c = { green: t, red: o, gray: i, blue: r, transparent: u }, d = {
|
|
200
|
-
button: "px-3",
|
|
201
|
-
icon: "rounded-full border border-gray-200 dark:border-gray-800"
|
|
202
|
-
}, f = {
|
|
203
|
-
button: { sm: "h-8", md: "h-10", lg: "h-12", xl: "h-14" },
|
|
204
|
-
icon: { sm: "size-8", md: "size-10", lg: "size-12", xl: "size-14" }
|
|
205
|
-
}, p = M(() => [nn, k(e.color), $(e.type), h(e.type, e.size)]), g = M(() => e.href || e.to ? "router-link" : "button"), h = (z, S) => {
|
|
206
|
-
var P;
|
|
207
|
-
return ((P = f[z]) == null ? void 0 : P[S]) || "";
|
|
208
|
-
}, $ = (z) => (d == null ? void 0 : d[z]) || "", k = (z) => c == null ? void 0 : c[z];
|
|
209
|
-
return (z, S) => (m(), A(ge(g.value), U(z.$attrs, {
|
|
210
|
-
href: e.href,
|
|
211
|
-
to: e.to,
|
|
212
|
-
class: p.value,
|
|
213
|
-
onClick: s
|
|
214
|
-
}), {
|
|
215
|
-
default: y(() => [
|
|
216
|
-
a("span", {
|
|
217
|
-
class: E(e.loading ? "opacity-0" : "")
|
|
218
|
-
}, [
|
|
219
|
-
_(z.$slots, "default")
|
|
220
|
-
], 2),
|
|
221
|
-
e.loading ? (m(), A(Ae, {
|
|
222
|
-
key: 0,
|
|
223
|
-
class: "absolute left-1/2 -translate-x-1/2"
|
|
224
|
-
})) : T("", !0)
|
|
225
|
-
]),
|
|
226
|
-
_: 3
|
|
227
|
-
}, 16, ["href", "to", "class"]));
|
|
228
|
-
}
|
|
229
|
-
}), ln = {
|
|
230
|
-
viewBox: "0 0 24 24",
|
|
231
|
-
width: "1.2em",
|
|
232
|
-
height: "1.2em"
|
|
233
|
-
};
|
|
234
|
-
function sn(e, n) {
|
|
235
|
-
return m(), v("svg", ln, [...n[0] || (n[0] = [
|
|
236
|
-
a("path", {
|
|
237
|
-
fill: "currentColor",
|
|
238
|
-
d: "m12 10.587l4.95-4.95l1.414 1.414l-4.95 4.95l4.95 4.95l-1.415 1.414l-4.95-4.95l-4.949 4.95l-1.414-1.415l4.95-4.95l-4.95-4.95L7.05 5.638z"
|
|
239
|
-
}, null, -1)
|
|
240
|
-
])]);
|
|
241
|
-
}
|
|
242
|
-
const oe = K({ name: "ri-close-line", render: sn }), on = { class: "flex items-center absolute right-3 top-5 z-10" }, tt = /* @__PURE__ */ B({
|
|
243
|
-
__name: "VPopup",
|
|
244
|
-
props: {
|
|
245
|
-
hiddenCloser: { type: Boolean },
|
|
246
|
-
size: { default: "auto" }
|
|
247
|
-
},
|
|
248
|
-
emits: ["close", "click", "open"],
|
|
249
|
-
setup(e, { emit: n }) {
|
|
250
|
-
const l = n, { show: s, overlay: t, onClose: o, onOpen: i } = Ze(l), r = je(null), u = je(null), { opacity: c, transform: d } = xt(r, u, o), g = { click: (k) => {
|
|
251
|
-
l("click", k);
|
|
252
|
-
}, open: i, set: (k) => {
|
|
253
|
-
k ? i() : o(new Event("hide"));
|
|
254
|
-
} }, h = M(() => ({
|
|
255
|
-
auto: "max-h-[calc(100dvh-50px)]",
|
|
256
|
-
full: "h-[calc(100dvh-24px)] md:h-[calc(100dvh-100px)]",
|
|
257
|
-
screen: "h-dvh"
|
|
258
|
-
})), $ = M(() => ({
|
|
259
|
-
auto: "max-h-[calc(100dvh-50px-16px)]",
|
|
260
|
-
full: "h-[calc(100dvh-24px-16px)] md:h-[calc(100dvh-100px-16px)]",
|
|
261
|
-
screen: "h-[calc(100dvh-16px)]"
|
|
262
|
-
}));
|
|
263
|
-
return (k, z) => {
|
|
264
|
-
const S = oe, P = j;
|
|
265
|
-
return m(), A(Ke, { to: "body" }, [
|
|
266
|
-
b(de, {
|
|
267
|
-
"enter-active-class": "duration-300 ease-out",
|
|
268
|
-
"enter-from-class": "transform opacity-0 translate-y-full xl:-translate-y-2",
|
|
269
|
-
"enter-to-class": "opacity-100 translate-y-0",
|
|
270
|
-
"leave-active-class": "duration-200 ease-in",
|
|
271
|
-
"leave-from-class": "opacity-100 translate-y-0",
|
|
272
|
-
"leave-to-class": "transform opacity-0 translate-y-full xl:-translate-y-2"
|
|
273
|
-
}, {
|
|
274
|
-
default: y(() => [
|
|
275
|
-
L(s) ? (m(), v("div", {
|
|
276
|
-
key: 0,
|
|
277
|
-
ref_key: "container",
|
|
278
|
-
ref: u,
|
|
279
|
-
class: "fixed bottom-0 left-0 w-full z-15"
|
|
280
|
-
}, [
|
|
281
|
-
L(t) ? (m(), v("div", {
|
|
282
|
-
key: 0,
|
|
283
|
-
class: "fixed h-full w-full top-0 left-0 bg-black/40 bg-blur xl:hidden animate-opacity overscroll-contain",
|
|
284
|
-
style: ne({ opacity: L(c) }),
|
|
285
|
-
onClick: z[0] || (z[0] = //@ts-ignore
|
|
286
|
-
(...X) => L(o) && L(o)(...X)),
|
|
287
|
-
onWheel: z[1] || (z[1] = F(() => {
|
|
288
|
-
}, ["prevent"])),
|
|
289
|
-
onTouchmove: z[2] || (z[2] = F(() => {
|
|
290
|
-
}, ["prevent"]))
|
|
291
|
-
}, null, 36)) : T("", !0),
|
|
292
|
-
a("div", {
|
|
293
|
-
class: E(["bg-white dark:bg-gray-900 w-full shadow-nav relative", h.value[e.size]]),
|
|
294
|
-
style: ne({ transform: L(d) })
|
|
295
|
-
}, [
|
|
296
|
-
a("div", {
|
|
297
|
-
ref_key: "target",
|
|
298
|
-
ref: r,
|
|
299
|
-
class: "flex justify-center py-3 md:pb-6",
|
|
300
|
-
onWheel: z[3] || (z[3] = F(() => {
|
|
301
|
-
}, ["prevent"])),
|
|
302
|
-
onTouchmove: z[4] || (z[4] = F(() => {
|
|
303
|
-
}, ["prevent"]))
|
|
304
|
-
}, [...z[5] || (z[5] = [
|
|
305
|
-
a("div", { class: "self-end h-1 w-12 bg-gray-400" }, null, -1)
|
|
306
|
-
])], 544),
|
|
307
|
-
a("div", on, [
|
|
308
|
-
_(k.$slots, "button", { close: L(o) }),
|
|
309
|
-
b(P, {
|
|
310
|
-
class: "size-5 md:size-6",
|
|
311
|
-
color: "transparent",
|
|
312
|
-
size: "none",
|
|
313
|
-
icon: "",
|
|
314
|
-
"aria-label": "Close",
|
|
315
|
-
onClick: L(o)
|
|
316
|
-
}, {
|
|
317
|
-
default: y(() => [
|
|
318
|
-
b(S, { class: "size-5" })
|
|
319
|
-
]),
|
|
320
|
-
_: 1
|
|
321
|
-
}, 8, ["onClick"])
|
|
322
|
-
]),
|
|
323
|
-
a("div", {
|
|
324
|
-
class: E(["overflow-y-auto max-h-[calc(100dvh-24px-16px)] overscroll-contain scrollbar", $.value[e.size]])
|
|
325
|
-
}, [
|
|
326
|
-
_(k.$slots, "default", {
|
|
327
|
-
close: L(o),
|
|
328
|
-
on: g
|
|
329
|
-
})
|
|
330
|
-
], 2)
|
|
331
|
-
], 6)
|
|
332
|
-
], 512)) : T("", !0)
|
|
333
|
-
]),
|
|
334
|
-
_: 3
|
|
335
|
-
})
|
|
336
|
-
]);
|
|
337
|
-
};
|
|
338
|
-
}
|
|
339
|
-
}), an = { class: "relative" }, rn = { class: "flex items-center cursor-pointer" }, Ce = /* @__PURE__ */ B({
|
|
340
|
-
__name: "VDropdown",
|
|
341
|
-
props: {
|
|
342
|
-
title: { default: "" },
|
|
343
|
-
top: { default: "calc(100% + 8px)" },
|
|
344
|
-
left: { default: "" },
|
|
345
|
-
right: { default: "0" },
|
|
346
|
-
bottom: { default: "" },
|
|
347
|
-
height: { default: "200px" },
|
|
348
|
-
hideOnClick: { type: Boolean, default: !0 },
|
|
349
|
-
disabled: { type: Boolean, default: !1 },
|
|
350
|
-
isPopup: { type: Boolean }
|
|
351
|
-
},
|
|
352
|
-
emits: ["click", "show", "close"],
|
|
353
|
-
setup(e, { emit: n }) {
|
|
354
|
-
const l = n, t = Je(Xe).greaterOrEqual("lg"), o = O(!1), i = M(() => ({ top: e.top, left: e.left, right: e.right, bottom: e.bottom, "max-height": e.height })), r = (h) => {
|
|
355
|
-
t.value && o.value && d(h);
|
|
356
|
-
}, u = (h) => {
|
|
357
|
-
l("click", o.value), !e.disabled && (o.value ? e.hideOnClick && d(h) : c(h));
|
|
358
|
-
}, c = (h) => {
|
|
359
|
-
o.value = !0, l("show", h);
|
|
360
|
-
}, d = (h) => {
|
|
361
|
-
o.value = !1, l("close", h);
|
|
362
|
-
}, f = (h) => {
|
|
363
|
-
h ? c(new Event("show")) : d(new Event("hide"));
|
|
364
|
-
}, p = () => {
|
|
365
|
-
d(new Event("hide"));
|
|
366
|
-
}, g = { click: u, open: c, set: f };
|
|
367
|
-
return (h, $) => {
|
|
368
|
-
const k = mt("outside");
|
|
369
|
-
return Te((m(), v("div", an, [
|
|
370
|
-
a("div", rn, [
|
|
371
|
-
_(h.$slots, "activator", {
|
|
372
|
-
on: g,
|
|
373
|
-
isShow: o.value
|
|
374
|
-
})
|
|
375
|
-
]),
|
|
376
|
-
L(t) ? (m(), A(de, {
|
|
377
|
-
key: 0,
|
|
378
|
-
"enter-active-class": "duration-300 ease-out",
|
|
379
|
-
"enter-from-class": "transform opacity-0 -translate-y-2",
|
|
380
|
-
"enter-to-class": "opacity-100 translate-y-0",
|
|
381
|
-
"leave-active-class": "duration-200 ease-in",
|
|
382
|
-
"leave-from-class": "opacity-100 translate-y-0",
|
|
383
|
-
"leave-to-class": "transform opacity-0 -translate-y-2"
|
|
384
|
-
}, {
|
|
385
|
-
default: y(() => [
|
|
386
|
-
o.value ? (m(), v("div", {
|
|
387
|
-
key: 0,
|
|
388
|
-
class: "z-30 min-w-full absolute",
|
|
389
|
-
style: ne(i.value)
|
|
390
|
-
}, [
|
|
391
|
-
_(h.$slots, "default", {
|
|
392
|
-
on: g,
|
|
393
|
-
show: c,
|
|
394
|
-
hide: d,
|
|
395
|
-
isShow: o.value
|
|
396
|
-
})
|
|
397
|
-
], 4)) : T("", !0)
|
|
398
|
-
]),
|
|
399
|
-
_: 3
|
|
400
|
-
})) : T("", !0),
|
|
401
|
-
!L(t) && o.value ? (m(), A(tt, {
|
|
402
|
-
key: 1,
|
|
403
|
-
title: e.title,
|
|
404
|
-
onClose: p
|
|
405
|
-
}, {
|
|
406
|
-
default: y(({ on: z }) => [
|
|
407
|
-
_(h.$slots, "default", {
|
|
408
|
-
on: z,
|
|
409
|
-
show: c,
|
|
410
|
-
hide: d,
|
|
411
|
-
isShow: o.value
|
|
412
|
-
})
|
|
413
|
-
]),
|
|
414
|
-
_: 3
|
|
415
|
-
}, 8, ["title"])) : T("", !0)
|
|
416
|
-
])), [
|
|
417
|
-
[k, r]
|
|
418
|
-
]);
|
|
419
|
-
};
|
|
420
|
-
}
|
|
421
|
-
}), cn = { class: "bg-white dark:bg-gray-900 ring-1 ring-gray-200 dark:ring-gray-800" }, dn = ["onClick"], be = /* @__PURE__ */ B({
|
|
422
|
-
__name: "VList",
|
|
423
|
-
props: {
|
|
424
|
-
items: {}
|
|
425
|
-
},
|
|
426
|
-
emits: ["click"],
|
|
427
|
-
setup(e, { emit: n }) {
|
|
428
|
-
const l = n, s = (t, o) => l("click", t, o);
|
|
429
|
-
return (t, o) => (m(), v("ul", cn, [
|
|
430
|
-
(m(!0), v(N, null, W(e.items, (i) => (m(), v("li", {
|
|
431
|
-
key: i.name,
|
|
432
|
-
class: "whitespace-nowrap cursor-pointer flex items-center min-h-[40px] border-b last:border-b-0 dark:border-gray-700 border-gray-200 hover:bg-gray-50 dark:hover:bg-gray-700/30 w-full px-4",
|
|
433
|
-
onClick: (r) => s(i, r)
|
|
434
|
-
}, [
|
|
435
|
-
_(t.$slots, "default", { item: i }, () => [
|
|
436
|
-
H(C(i.name), 1)
|
|
437
|
-
])
|
|
438
|
-
], 8, dn))), 128))
|
|
439
|
-
]));
|
|
440
|
-
}
|
|
441
|
-
}), un = { class: "bg-white dark:bg-gray-900 border-b border-gray-300 dark:border-gray-700 left-0 w-full z-10 sticky top-0" }, fn = { class: "px-4 py-4 sm:px-6 lg:px-8" }, mn = { class: "container mx-auto flex flex-auto items-center" }, vn = { class: "lg:hidden h-[30px]" }, pn = { class: "gap-4 hidden lg:flex" }, hn = { class: "lg:hidden flex gap-4" }, gn = { class: "ms-2" }, Aa = /* @__PURE__ */ B({
|
|
442
|
-
__name: "AppHeader",
|
|
443
|
-
props: {
|
|
444
|
-
changeTheme: { type: Function },
|
|
445
|
-
notifications: {}
|
|
446
|
-
},
|
|
447
|
-
emits: ["sidebar", "notif"],
|
|
448
|
-
setup(e, { emit: n }) {
|
|
449
|
-
const l = n, s = [
|
|
450
|
-
{ name: "Theme", value: 1 },
|
|
451
|
-
{ name: "Notification", value: 2 },
|
|
452
|
-
{ name: "Logout", value: 3 }
|
|
453
|
-
], t = M(() => !!e.notifications.find((d) => d.isNew)), o = (d) => l("sidebar", d), i = (d) => l("notif", d), r = async () => await fetch("/", { headers: { Authorization: "Basic AAAAAAAAAAAAAAAAAAA=" } }), u = () => {
|
|
454
|
-
e.changeTheme && e.changeTheme();
|
|
455
|
-
}, c = ({ value: d }, f) => {
|
|
456
|
-
d == 1 && u(), d == 2 && i(f), d == 3 && r();
|
|
457
|
-
};
|
|
458
|
-
return (d, f) => {
|
|
459
|
-
const p = Yt, g = Ue("router-link"), h = Zt, $ = Wt, k = et, z = Nt, S = Qe;
|
|
460
|
-
return m(), v("header", un, [
|
|
461
|
-
a("div", fn, [
|
|
462
|
-
a("div", mn, [
|
|
463
|
-
b(j, {
|
|
464
|
-
type: "icon",
|
|
465
|
-
onClick: o
|
|
466
|
-
}, {
|
|
467
|
-
default: y(() => [
|
|
468
|
-
b(p, { class: "size-5" })
|
|
469
|
-
]),
|
|
470
|
-
_: 1
|
|
471
|
-
}),
|
|
472
|
-
f[1] || (f[1] = a("div", { class: "lg:hidden flex-auto" }, null, -1)),
|
|
473
|
-
a("div", vn, [
|
|
474
|
-
b(g, { to: "/" }, {
|
|
475
|
-
default: y(() => [
|
|
476
|
-
b(Me, { class: "h-[30px] text-primary" })
|
|
477
|
-
]),
|
|
478
|
-
_: 1
|
|
479
|
-
})
|
|
480
|
-
]),
|
|
481
|
-
f[2] || (f[2] = a("div", { class: "flex-auto" }, null, -1)),
|
|
482
|
-
a("div", pn, [
|
|
483
|
-
b(j, {
|
|
484
|
-
type: "icon",
|
|
485
|
-
onClick: u
|
|
486
|
-
}, {
|
|
487
|
-
default: y(() => [
|
|
488
|
-
b(h, { class: "dark:hidden" }),
|
|
489
|
-
b($, { class: "hidden dark:flex" })
|
|
490
|
-
]),
|
|
491
|
-
_: 1
|
|
492
|
-
}),
|
|
493
|
-
b(j, {
|
|
494
|
-
type: "icon",
|
|
495
|
-
onClick: i
|
|
496
|
-
}, {
|
|
497
|
-
default: y(() => [
|
|
498
|
-
a("span", {
|
|
499
|
-
class: E([t.value ? "flex" : "hidden", "absolute right-0 top-0.5 z-1 h-2 w-2 rounded-full bg-orange-400"])
|
|
500
|
-
}, [...f[0] || (f[0] = [
|
|
501
|
-
a("span", { class: "absolute -z-1 inline-flex h-full w-full animate-ping rounded-full bg-orange-400 opacity-75" }, null, -1)
|
|
502
|
-
])], 2),
|
|
503
|
-
b(k, { class: "size-5" })
|
|
504
|
-
]),
|
|
505
|
-
_: 1
|
|
506
|
-
}),
|
|
507
|
-
b(j, {
|
|
508
|
-
type: "icon",
|
|
509
|
-
onClick: F(r, ["prevent"])
|
|
510
|
-
}, {
|
|
511
|
-
default: y(() => [
|
|
512
|
-
b(z, { class: "size-5" })
|
|
513
|
-
]),
|
|
514
|
-
_: 1
|
|
515
|
-
})
|
|
516
|
-
]),
|
|
517
|
-
a("div", hn, [
|
|
518
|
-
b(Ce, {
|
|
519
|
-
left: "unset",
|
|
520
|
-
right: "0",
|
|
521
|
-
top: "0"
|
|
522
|
-
}, {
|
|
523
|
-
activator: y(({ on: P }) => [
|
|
524
|
-
b(j, {
|
|
525
|
-
type: "icon",
|
|
526
|
-
class: "flex",
|
|
527
|
-
onClick: P.click
|
|
528
|
-
}, {
|
|
529
|
-
default: y(() => [
|
|
530
|
-
b(S)
|
|
531
|
-
]),
|
|
532
|
-
_: 1
|
|
533
|
-
}, 8, ["onClick"])
|
|
534
|
-
]),
|
|
535
|
-
default: y(() => [
|
|
536
|
-
b(be, {
|
|
537
|
-
items: s,
|
|
538
|
-
onClick: c
|
|
539
|
-
}, {
|
|
540
|
-
default: y(({ item: P }) => [
|
|
541
|
-
a("span", gn, C(P.name), 1)
|
|
542
|
-
]),
|
|
543
|
-
_: 1
|
|
544
|
-
})
|
|
545
|
-
]),
|
|
546
|
-
_: 1
|
|
547
|
-
})
|
|
548
|
-
])
|
|
549
|
-
])
|
|
550
|
-
])
|
|
551
|
-
]);
|
|
552
|
-
};
|
|
553
|
-
}
|
|
554
|
-
}), bn = { class: "relative flex items-center gap-2 w-full p-2 overflow-hidden" }, yn = { class: "flex-auto text-xs" }, xn = { class: "text-gray-500 dark:text-gray-400 mt-1" }, $n = /* @__PURE__ */ B({
|
|
555
|
-
__name: "CardNotification",
|
|
556
|
-
props: {
|
|
557
|
-
empty: {},
|
|
558
|
-
key: {},
|
|
559
|
-
isNew: {},
|
|
560
|
-
color: {},
|
|
561
|
-
timeout: {},
|
|
562
|
-
date: {},
|
|
563
|
-
text: {}
|
|
564
|
-
},
|
|
565
|
-
emits: ["remove", "read"],
|
|
566
|
-
setup(e, { emit: n }) {
|
|
567
|
-
const l = e, s = n, t = ["", "bg-green-500", "bg-red-500", "bg-yellow-500", "bg-blue-500"], o = (u) => t[u], i = (u) => s("remove", u), r = (u) => s("read", u);
|
|
568
|
-
return (u, c) => {
|
|
569
|
-
const d = et, f = oe;
|
|
570
|
-
return m(), v("div", bn, [
|
|
571
|
-
a("div", {
|
|
572
|
-
class: E(["absolute left-0 top-0 w-[3px] h-full", o(l.color)])
|
|
573
|
-
}, null, 2),
|
|
574
|
-
b(j, {
|
|
575
|
-
class: "shrink-0",
|
|
576
|
-
type: "icon",
|
|
577
|
-
onClick: r
|
|
578
|
-
}, {
|
|
579
|
-
default: y(() => [
|
|
580
|
-
a("span", {
|
|
581
|
-
class: E([l.isNew ? "flex" : "hidden", "absolute right-0 top-0.5 z-1 h-2 w-2 rounded-full bg-orange-400"])
|
|
582
|
-
}, [...c[0] || (c[0] = [
|
|
583
|
-
a("span", { class: "absolute -z-1 inline-flex h-full w-full animate-ping rounded-full bg-orange-400 opacity-75" }, null, -1)
|
|
584
|
-
])], 2),
|
|
585
|
-
b(d, { class: "size-5" })
|
|
586
|
-
]),
|
|
587
|
-
_: 1
|
|
588
|
-
}),
|
|
589
|
-
a("div", yn, [
|
|
590
|
-
a("div", null, C(l.text), 1),
|
|
591
|
-
a("div", xn, C(L(_t)(l.date)) + " (" + C(L(wt)(l.date)) + ")", 1)
|
|
592
|
-
]),
|
|
593
|
-
b(j, {
|
|
594
|
-
class: "shrink-0",
|
|
595
|
-
type: "icon",
|
|
596
|
-
size: "sm",
|
|
597
|
-
onClick: i
|
|
598
|
-
}, {
|
|
599
|
-
default: y(() => [
|
|
600
|
-
b(f, { class: "size-4" })
|
|
601
|
-
]),
|
|
602
|
-
_: 1
|
|
603
|
-
})
|
|
604
|
-
]);
|
|
605
|
-
};
|
|
606
|
-
}
|
|
607
|
-
}), kn = { class: "no-scrollbar flex flex-col overflow-y-auto duration-300 ease-linear h-full" }, _n = {
|
|
608
|
-
key: 0,
|
|
609
|
-
class: "flex flex-col gap-2 p-2"
|
|
610
|
-
}, Da = /* @__PURE__ */ B({
|
|
611
|
-
__name: "AppNotification",
|
|
612
|
-
props: {
|
|
613
|
-
value: { type: Boolean },
|
|
614
|
-
notifications: {}
|
|
615
|
-
},
|
|
616
|
-
emits: ["close", "remove", "read"],
|
|
617
|
-
setup(e, { emit: n }) {
|
|
618
|
-
const l = e, s = n, t = M(() => !!l.notifications.find((c) => c.isNew)), o = M(() => !!l.notifications.length), i = (c) => s("close", c), r = (c) => s("remove", c), u = (c) => s("read", c);
|
|
619
|
-
return (c, d) => (m(), v(N, null, [
|
|
620
|
-
l.value ? (m(), v("div", {
|
|
621
|
-
key: 0,
|
|
622
|
-
class: "overlay fixed left-0 top-0 h-full w-full bg-black/40 bg-blur",
|
|
623
|
-
onClick: i
|
|
624
|
-
})) : T("", !0),
|
|
625
|
-
a("aside", {
|
|
626
|
-
class: E([l.value ? "translate-x-0 " : "translate-x-full", "overflow-x-hidden fixed top-[73px] right-0 flex h-[calc(100%-73px)] w-[290px] md:w-80 border-l border-gray-200 flex-col overflow-y-auto transition-all duration-350 dark:border-gray-800 bg-white dark:bg-gray-900"])
|
|
627
|
-
}, [
|
|
628
|
-
a("div", kn, [
|
|
629
|
-
_(c.$slots, "header", { isNew: t.value }),
|
|
630
|
-
o.value ? (m(), v("div", _n, [
|
|
631
|
-
b(We, {
|
|
632
|
-
"enter-active-class": "transition-all duration-300 ",
|
|
633
|
-
"enter-from-class": "opacity-0 translate-x-1/2",
|
|
634
|
-
"enter-to-class": "opacity-100 translate-x-0",
|
|
635
|
-
"leave-active-class": "transition-all duration-300 absolute",
|
|
636
|
-
"leave-from-class": "opacity-100 translate-x-0",
|
|
637
|
-
"leave-to-class": "opacity-0 translate-x-1/2"
|
|
638
|
-
}, {
|
|
639
|
-
default: y(() => [
|
|
640
|
-
(m(!0), v(N, null, W(l.notifications, (f) => (m(), v("div", {
|
|
641
|
-
key: f.date,
|
|
642
|
-
class: "relative"
|
|
643
|
-
}, [
|
|
644
|
-
_(c.$slots, "card", { item: f }, () => [
|
|
645
|
-
b($n, U({ ref_for: !0 }, f, {
|
|
646
|
-
class: "bg-gray-200/50 dark:bg-gray-800/50 rounded-md",
|
|
647
|
-
onRemove: (p) => r(f),
|
|
648
|
-
onRead: (p) => u(f)
|
|
649
|
-
}), null, 16, ["onRemove", "onRead"])
|
|
650
|
-
])
|
|
651
|
-
]))), 128))
|
|
652
|
-
]),
|
|
653
|
-
_: 3
|
|
654
|
-
})
|
|
655
|
-
])) : _(c.$slots, "empty", {}, void 0, void 0, 1)
|
|
656
|
-
])
|
|
657
|
-
], 2)
|
|
658
|
-
], 64));
|
|
659
|
-
}
|
|
660
|
-
}), wn = {}, Cn = { class: "fixed h-full w-full top-0 left-0 z-20" }, zn = { class: "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2" };
|
|
661
|
-
function Sn(e, n) {
|
|
662
|
-
return m(), v("div", Cn, [
|
|
663
|
-
n[0] || (n[0] = a("div", { class: "absolute h-full w-full top-0 left-0 bg-black/60 bg-blur" }, null, -1)),
|
|
664
|
-
a("div", zn, [
|
|
665
|
-
_(e.$slots, "default")
|
|
666
|
-
])
|
|
667
|
-
]);
|
|
668
|
-
}
|
|
669
|
-
const Ia = /* @__PURE__ */ we(wn, [["render", Sn]]), Vn = {
|
|
670
|
-
viewBox: "0 0 24 24",
|
|
671
|
-
width: "1.2em",
|
|
672
|
-
height: "1.2em"
|
|
673
|
-
};
|
|
674
|
-
function Bn(e, n) {
|
|
675
|
-
return m(), v("svg", Vn, [...n[0] || (n[0] = [
|
|
676
|
-
a("path", {
|
|
677
|
-
fill: "currentColor",
|
|
678
|
-
d: "m13.172 12l-4.95-4.95l1.414-1.413L16 12l-6.364 6.364l-1.414-1.415z"
|
|
679
|
-
}, null, -1)
|
|
680
|
-
])]);
|
|
681
|
-
}
|
|
682
|
-
const En = K({ name: "ri-arrow-right-s-line", render: Bn }), Tn = { class: "mb-4 flex flex-col gap-2" }, Ln = { class: "size-6 flex-[0_0_24px] opacity-60" }, Mn = ["onClick"], An = { class: "flex flex-col gap-2" }, Dn = { class: "flex gap-2 ms-8" }, In = { class: "size-5 flex-[0_0_24px]" }, On = { class: "flex-1 first-letter:uppercase text-sm" }, Oa = /* @__PURE__ */ B({
|
|
683
|
-
__name: "AppNav",
|
|
684
|
-
props: {
|
|
685
|
-
menu: { default: () => [] },
|
|
686
|
-
fullPath: { default: "" },
|
|
687
|
-
isSidebar: { type: Boolean, default: !1 }
|
|
688
|
-
},
|
|
689
|
-
emits: ["sidebar"],
|
|
690
|
-
setup(e, { emit: n }) {
|
|
691
|
-
const l = n, s = O(""), t = ({ name: i }) => {
|
|
692
|
-
e.isSidebar && l("sidebar", !e.isSidebar), s.value !== i && (s.value = s.value === i ? "" : i);
|
|
693
|
-
}, o = (i) => e.fullPath === i;
|
|
694
|
-
return ue(
|
|
695
|
-
() => e.menu,
|
|
696
|
-
() => {
|
|
697
|
-
var i;
|
|
698
|
-
return s.value = ((i = Ct(e.menu, e.fullPath)) == null ? void 0 : i.name) || "";
|
|
699
|
-
}
|
|
700
|
-
), (i, r) => {
|
|
701
|
-
const u = En;
|
|
702
|
-
return m(), v("nav", null, [
|
|
703
|
-
a("ul", Tn, [
|
|
704
|
-
(m(!0), v(N, null, W(e.menu, (c) => (m(), v("li", {
|
|
705
|
-
key: c.name
|
|
706
|
-
}, [
|
|
707
|
-
(m(), A(ge(c.path ? "router-link" : "span"), {
|
|
708
|
-
to: c.path,
|
|
709
|
-
class: E(["flex gap-2 items-center px-3 py-2 rounded", o(c.path) ? "bg-blue-500/10" : "hover:bg-gray-500/10"]),
|
|
710
|
-
onClick: F((d) => t(c), ["prevent", "stop"])
|
|
711
|
-
}, {
|
|
712
|
-
default: y(() => [
|
|
713
|
-
a("div", Ln, [
|
|
714
|
-
_(i.$slots, "icon", { item: c })
|
|
715
|
-
]),
|
|
716
|
-
a("span", {
|
|
717
|
-
class: E(["flex-1 first-letter:uppercase text-sm", e.isSidebar ? "lg:hidden" : ""])
|
|
718
|
-
}, C(c.name), 3),
|
|
719
|
-
a("button", {
|
|
720
|
-
class: E(["cursor-pointer", [e.isSidebar ? "lg:hidden" : ""]]),
|
|
721
|
-
onClick: F((d) => t(c), ["prevent", "stop"])
|
|
722
|
-
}, [
|
|
723
|
-
c.children ? (m(), A(u, { key: 0 })) : T("", !0)
|
|
724
|
-
], 10, Mn)
|
|
725
|
-
]),
|
|
726
|
-
_: 2
|
|
727
|
-
}, 1032, ["to", "class", "onClick"])),
|
|
728
|
-
c.children ? (m(), v("div", {
|
|
729
|
-
key: 0,
|
|
730
|
-
class: E(["translate transform overflow-hidden mt-2", [e.isSidebar ? "lg:hidden" : "", s.value === c.name ? "block" : "hidden"]])
|
|
731
|
-
}, [
|
|
732
|
-
a("ul", An, [
|
|
733
|
-
(m(!0), v(N, null, W(c.children, ({ name: d, path: f, icon: p }) => (m(), v("li", { key: d }, [
|
|
734
|
-
(m(), A(ge(f ? "router-link" : "span"), {
|
|
735
|
-
to: f,
|
|
736
|
-
class: E(["flex gap-2 items-center px-3 py-2 rounded", o(f) ? "bg-blue-500/10" : "hover:bg-gray-500/10"])
|
|
737
|
-
}, {
|
|
738
|
-
default: y(() => [
|
|
739
|
-
a("div", Dn, [
|
|
740
|
-
a("div", In, [
|
|
741
|
-
_(i.$slots, "icon-children", {
|
|
742
|
-
item: { name: d, path: f, icon: p }
|
|
743
|
-
})
|
|
744
|
-
]),
|
|
745
|
-
a("span", On, C(d), 1)
|
|
746
|
-
])
|
|
747
|
-
]),
|
|
748
|
-
_: 2
|
|
749
|
-
}, 1032, ["to", "class"]))
|
|
750
|
-
]))), 128))
|
|
751
|
-
])
|
|
752
|
-
], 2)) : T("", !0)
|
|
753
|
-
]))), 128))
|
|
754
|
-
])
|
|
755
|
-
]);
|
|
756
|
-
};
|
|
757
|
-
}
|
|
758
|
-
}), jn = {
|
|
759
|
-
key: 0,
|
|
760
|
-
class: "w-full min-w-[260px] max-w-xs p-4 bg-white rounded shadow-lg dark:bg-gray-800",
|
|
761
|
-
role: "alert"
|
|
762
|
-
}, Pn = { class: "flex items-center gap-4 text-sm" }, Hn = {
|
|
763
|
-
key: 0,
|
|
764
|
-
class: "text-green-600"
|
|
765
|
-
}, Nn = {
|
|
766
|
-
key: 1,
|
|
767
|
-
class: "relative block h-4 w-full rounded overflow-hidden bg-gray-200 dark:bg-gray-900/50 select-none mt-2"
|
|
768
|
-
}, Fn = { class: "absolute left-[140px] top-1/2 -translate-1/2 text-sm font-bold text-black dark:text-white text-center leading-none" }, Rn = { class: "absolute left-[140px] top-1/2 -translate-1/2 text-sm font-bold text-white text-center leading-none" }, ja = /* @__PURE__ */ B({
|
|
769
|
-
__name: "AppProgress",
|
|
770
|
-
props: {
|
|
771
|
-
timeout: { default: 5e3 },
|
|
772
|
-
key: {},
|
|
773
|
-
status: { default: 0 },
|
|
774
|
-
empty: {},
|
|
775
|
-
size: { default: 0 },
|
|
776
|
-
length: { default: 0 }
|
|
777
|
-
},
|
|
778
|
-
setup(e) {
|
|
779
|
-
const n = O(!1), l = M(() => !!e.length), s = M(() => !!(l.value && t.value === 100 && !e.status)), t = M(() => e.status ? Math.ceil(e.size * 100 / e.length) : 100), o = Le(() => {
|
|
780
|
-
n.value = !1;
|
|
781
|
-
}, e.timeout);
|
|
782
|
-
return ue(
|
|
783
|
-
() => [e.size, e.status],
|
|
784
|
-
() => {
|
|
785
|
-
n.value = !0, o();
|
|
786
|
-
}
|
|
787
|
-
), (i, r) => {
|
|
788
|
-
const u = oe;
|
|
789
|
-
return m(), A(de, {
|
|
790
|
-
"enter-active-class": "duration-300 ease-out",
|
|
791
|
-
"enter-from-class": "transform opacity-0 translate-x-full",
|
|
792
|
-
"enter-to-class": "opacity-100 translate-x-0",
|
|
793
|
-
"leave-active-class": "duration-200 ease-in",
|
|
794
|
-
"leave-from-class": "opacity-100 translate-y-0",
|
|
795
|
-
"leave-to-class": "transform opacity-0 -translate-y-8"
|
|
796
|
-
}, {
|
|
797
|
-
default: y(() => [
|
|
798
|
-
n.value ? (m(), v("div", jn, [
|
|
799
|
-
a("div", Pn, [
|
|
800
|
-
_(i.$slots, "default", { isDone: s.value }, () => [
|
|
801
|
-
r[1] || (r[1] = a("div", { class: "flex-auto" }, "Progress...", -1)),
|
|
802
|
-
s.value ? (m(), v("span", Hn, "Done")) : T("", !0)
|
|
803
|
-
]),
|
|
804
|
-
a("button", {
|
|
805
|
-
class: "cursor-pointer transition text-gray-700 dark:text-gray-400 self-start hover:text-gray-600",
|
|
806
|
-
onClick: r[0] || (r[0] = (c) => n.value = !1)
|
|
807
|
-
}, [
|
|
808
|
-
b(u, { class: "size-4" })
|
|
809
|
-
])
|
|
810
|
-
]),
|
|
811
|
-
l.value ? (m(), v("div", {
|
|
812
|
-
key: 0,
|
|
813
|
-
class: "h-[2px] fixed top-0 left-0 w-full bg-blue-600 transition-all duration-500",
|
|
814
|
-
style: ne(`width: ${t.value}%`)
|
|
815
|
-
}, null, 4)) : T("", !0),
|
|
816
|
-
l.value ? (m(), v("div", Nn, [
|
|
817
|
-
a("div", Fn, C(t.value) + "%", 1),
|
|
818
|
-
a("div", {
|
|
819
|
-
class: "bg-blue-600 rounded h-4 overflow-hidden relative transition-all duration-500",
|
|
820
|
-
style: ne(`width: ${t.value}%`)
|
|
821
|
-
}, [
|
|
822
|
-
a("div", Rn, C(t.value) + "%", 1)
|
|
823
|
-
], 4)
|
|
824
|
-
])) : T("", !0)
|
|
825
|
-
])) : T("", !0)
|
|
826
|
-
]),
|
|
827
|
-
_: 3
|
|
828
|
-
});
|
|
829
|
-
};
|
|
830
|
-
}
|
|
831
|
-
}), Un = { class: "my-4 text-gray-700 dark:text-gray-400" }, Kn = { class: "flex flex-col md:flex-row flex-wrap md:gap-4 text-sm" }, Wn = { class: "flex gap-2" }, qn = { class: "text-gray-700 dark:text-gray-400" }, Gn = { class: "flex gap-2" }, Zn = { class: "flex gap-2" }, Jn = { class: "text-gray-700 dark:text-gray-400" }, Xn = { class: "flex gap-2" }, Yn = { class: "text-gray-700 dark:text-gray-400" }, Qn = { class: "flex flex-col gap-4 text-sm" }, el = { class: "flex gap-4" }, Pa = /* @__PURE__ */ B({
|
|
832
|
-
__name: "BlockInfo",
|
|
833
|
-
props: {
|
|
834
|
-
pkg: {},
|
|
835
|
-
key: {},
|
|
836
|
-
id: { default: 0 },
|
|
837
|
-
firmware: { default: () => [] },
|
|
838
|
-
totalBytes: {},
|
|
839
|
-
usedBytes: {},
|
|
840
|
-
uptime: {},
|
|
841
|
-
name: {},
|
|
842
|
-
board: {}
|
|
843
|
-
},
|
|
844
|
-
setup(e) {
|
|
845
|
-
const n = M(() => e.firmware.join(".")), l = M(() => {
|
|
846
|
-
var t, o, i, r, u, c, d;
|
|
847
|
-
const s = [];
|
|
848
|
-
return (t = e.pkg) != null && t.homepage && s.push({ name: "homepage", href: e.pkg.homepage }), (i = (o = e.pkg) == null ? void 0 : o.repository) != null && i.url && s.push({ name: "repository", href: e.pkg.repository.url }), (u = (r = e.pkg) == null ? void 0 : r.bugs) != null && u.url && s.push({ name: "bugs", href: e.pkg.bugs.url }), (c = e.pkg) != null && c.author && s.push({ name: "author", href: `mailto:${(d = e.pkg) == null ? void 0 : d.author}` }), s;
|
|
849
|
-
});
|
|
850
|
-
return (s, t) => {
|
|
851
|
-
var o, i;
|
|
852
|
-
return m(), v("div", null, [
|
|
853
|
-
a("p", Un, C((o = e.pkg) == null ? void 0 : o.description), 1),
|
|
854
|
-
a("div", Kn, [
|
|
855
|
-
a("div", Wn, [
|
|
856
|
-
t[0] || (t[0] = H(" Firmware (hw): ", -1)),
|
|
857
|
-
a("span", qn, C(n.value), 1)
|
|
858
|
-
]),
|
|
859
|
-
a("div", Gn, [
|
|
860
|
-
a("div", Zn, [
|
|
861
|
-
t[1] || (t[1] = H(" Version (web): ", -1)),
|
|
862
|
-
a("span", Jn, C((i = e.pkg) == null ? void 0 : i.version), 1)
|
|
863
|
-
])
|
|
864
|
-
]),
|
|
865
|
-
t[3] || (t[3] = a("div", { class: "flex-auto" }, null, -1)),
|
|
866
|
-
a("div", Xn, [
|
|
867
|
-
t[2] || (t[2] = H(" ID: ", -1)),
|
|
868
|
-
a("span", Yn, C(e.id.toString(16)), 1)
|
|
869
|
-
])
|
|
870
|
-
]),
|
|
871
|
-
t[4] || (t[4] = a("hr", { class: "dark:text-gray-700 text-gray-200 my-2" }, null, -1)),
|
|
872
|
-
a("div", Qn, [
|
|
873
|
-
a("div", el, [
|
|
874
|
-
_(s.$slots, "links", { links: l.value })
|
|
875
|
-
])
|
|
876
|
-
])
|
|
877
|
-
]);
|
|
878
|
-
};
|
|
879
|
-
}
|
|
880
|
-
}), tl = { class: "relative flex items-end gap-0.5 w-10" }, nl = ["title"], ll = { class: "absolute -top-1 -left-1 text-xs text-gray-600 dark:text-gray-300" }, nt = /* @__PURE__ */ B({
|
|
881
|
-
__name: "VWifiIcon",
|
|
882
|
-
props: {
|
|
883
|
-
rssi: { default: 0 },
|
|
884
|
-
channel: { default: 0 }
|
|
885
|
-
},
|
|
886
|
-
setup(e) {
|
|
887
|
-
const n = 2 * (e.rssi + 100), l = (s) => s < n;
|
|
888
|
-
return (s, t) => (m(), v("div", tl, [
|
|
889
|
-
(m(), v(N, null, W([10, 15, 25, 40, 70], (o, i) => a("div", {
|
|
890
|
-
key: o,
|
|
891
|
-
class: E(["w-1 h-5 rounded-lg", [l(o) ? "bg-gray-900 dark:bg-gray-100" : "bg-gray-300 dark:bg-gray-700"]]),
|
|
892
|
-
style: ne(`height: ${(i + 1) * 5}px`),
|
|
893
|
-
title: `rssi: ${e.rssi} channel: ${e.channel}`
|
|
894
|
-
}, null, 14, nl)), 64)),
|
|
895
|
-
a("div", ll, C(e.channel), 1)
|
|
896
|
-
]));
|
|
897
|
-
}
|
|
898
|
-
}), sl = ["onClick"], ol = { class: "mr-2" }, al = { class: "text-sm" }, il = { class: "text-gray-400 text-xs" }, rl = {
|
|
899
|
-
key: 0,
|
|
900
|
-
class: "flex justify-center"
|
|
901
|
-
}, cl = { class: "flex justify-end mt-4" }, Ha = /* @__PURE__ */ B({
|
|
902
|
-
__name: "BlockScan",
|
|
903
|
-
props: {
|
|
904
|
-
items: { default: () => [] }
|
|
905
|
-
},
|
|
906
|
-
emits: ["scan", "select"],
|
|
907
|
-
setup(e, { emit: n }) {
|
|
908
|
-
const l = n, s = ["OPEN", "WEP", "WPA_PSK", "WPA2_PSK", "WPA_WPA2_PSK", "MAX", "", "NO", "AUTO"], t = (i) => l("select", i), o = (i) => l("scan", i);
|
|
909
|
-
return (i, r) => {
|
|
910
|
-
const u = nt, c = be, d = Ae, f = j;
|
|
911
|
-
return m(), v("div", null, [
|
|
912
|
-
b(c, {
|
|
913
|
-
items: e.items,
|
|
914
|
-
class: "bg-transparent! ring-0!"
|
|
915
|
-
}, {
|
|
916
|
-
default: y(({ item: p }) => [
|
|
917
|
-
a("div", {
|
|
918
|
-
class: "flex items-center w-full",
|
|
919
|
-
onClick: (g) => t(p)
|
|
920
|
-
}, [
|
|
921
|
-
a("div", ol, [
|
|
922
|
-
b(u, q(G(p)), null, 16)
|
|
923
|
-
]),
|
|
924
|
-
a("div", null, [
|
|
925
|
-
a("div", al, C(p.ssid), 1),
|
|
926
|
-
a("div", il, C(i.$t("security")) + " : " + C(s[p.encryptionType] || "unknown"), 1)
|
|
927
|
-
])
|
|
928
|
-
], 8, sl)
|
|
929
|
-
]),
|
|
930
|
-
_: 1
|
|
931
|
-
}, 8, ["items"]),
|
|
932
|
-
e.items.length ? T("", !0) : (m(), v("div", rl, [
|
|
933
|
-
b(d, { class: "text-primary" })
|
|
934
|
-
])),
|
|
935
|
-
a("div", cl, [
|
|
936
|
-
b(f, {
|
|
937
|
-
color: "blue",
|
|
938
|
-
onClick: o
|
|
939
|
-
}, {
|
|
940
|
-
default: y(() => [
|
|
941
|
-
H(C(i.$t("scan")), 1)
|
|
942
|
-
]),
|
|
943
|
-
_: 1
|
|
944
|
-
})
|
|
945
|
-
])
|
|
946
|
-
]);
|
|
947
|
-
};
|
|
948
|
-
}
|
|
949
|
-
}), dl = {
|
|
950
|
-
viewBox: "0 0 24 24",
|
|
951
|
-
width: "1.2em",
|
|
952
|
-
height: "1.2em"
|
|
953
|
-
};
|
|
954
|
-
function ul(e, n) {
|
|
955
|
-
return m(), v("svg", dl, [...n[0] || (n[0] = [
|
|
956
|
-
a("path", {
|
|
957
|
-
fill: "currentColor",
|
|
958
|
-
d: "m12 10.828l-4.95 4.95l-1.414-1.414L12 8l6.364 6.364l-1.414 1.414z"
|
|
959
|
-
}, null, -1)
|
|
960
|
-
])]);
|
|
961
|
-
}
|
|
962
|
-
const fl = K({ name: "ri-arrow-up-s-line", render: ul }), ml = { class: "w-full relative" }, vl = ["disabled"], pl = {
|
|
963
|
-
key: 0,
|
|
964
|
-
class: "text-red-400 h-[24px] px-2 text-xs"
|
|
965
|
-
}, hl = "after:absolute after:h-1 after:w-full after:left-0 after:translate-y-[6px] after:-z-10 dark:after:bg-gray-800 after:bg-white after:transition-all", Y = /* @__PURE__ */ B({
|
|
966
|
-
__name: "VTextField",
|
|
967
|
-
props: {
|
|
968
|
-
modelValue: { default: null },
|
|
969
|
-
label: { default: "" },
|
|
970
|
-
component: { default: "input" },
|
|
971
|
-
type: { default: "text" },
|
|
972
|
-
message: { default: "" },
|
|
973
|
-
readonly: { type: Boolean },
|
|
974
|
-
disabled: { type: [Boolean, Number], default: !1 },
|
|
975
|
-
active: { type: Boolean, default: !1 },
|
|
976
|
-
hideMessage: { type: Boolean, default: !1 }
|
|
977
|
-
},
|
|
978
|
-
emits: ["update:modelValue", "click", "on-icon", "enter", "blur", "focus"],
|
|
979
|
-
setup(e, { emit: n }) {
|
|
980
|
-
const l = n, s = {
|
|
981
|
-
input: "w-full h-full px-4 outline-none overflow-ellipsis flex-auto overflow-hidden w-[calc(100% - 20px)] bg-transparent",
|
|
982
|
-
textarea: "h-full w-full px-4 py-2 outline-none flex-auto bg-transparent"
|
|
983
|
-
}, t = O(!1), o = M(() => [
|
|
984
|
-
e.component === "input" ? "h-[40px]" : "min-h-[40px]",
|
|
985
|
-
e.message ? "border-red-500 hover:border-red-400" : "",
|
|
986
|
-
e.disabled ? "border-gray-400 opacity-40" : "border-gray-300 hover:border-gray-400 dark:border-gray-700/50 hover:dark:border-gray-600/50"
|
|
987
|
-
]), i = M(() => s[e.component]), r = (k) => k || k === 0, u = M(() => [hl, t.value || r(e.modelValue) || e.active ? "top-0 left-3 text-xs" : "top-1/2"]), c = M(() => e.component === "input"), d = (k) => {
|
|
988
|
-
t.value = !1, l("blur", k);
|
|
989
|
-
}, f = (k) => {
|
|
990
|
-
t.value = !0, l("focus", k);
|
|
991
|
-
}, p = ({ target: k }) => l("update:modelValue", k.value), g = (k) => l("enter", k), h = (k) => l("click", k), $ = (k) => {
|
|
992
|
-
e.disabled || l("on-icon", k);
|
|
993
|
-
};
|
|
994
|
-
return (k, z) => (m(), v("div", ml, [
|
|
995
|
-
a("label", {
|
|
996
|
-
class: E(["relative w-full border border-gray-300 dark:border-gray-700 flex items-center rounded transition bg-white dark:bg-gray-800", o.value])
|
|
997
|
-
}, [
|
|
998
|
-
a("span", {
|
|
999
|
-
class: E(["absolute left-4 transition-all rounded -translate-y-1/2 text-gray-600 dark:text-gray-400", u.value])
|
|
1000
|
-
}, C(e.label), 3),
|
|
1001
|
-
(m(), A(ge(e.component), U(k.$attrs, {
|
|
1002
|
-
value: e.modelValue,
|
|
1003
|
-
disabled: !!e.disabled,
|
|
1004
|
-
type: e.type,
|
|
1005
|
-
readonly: e.readonly,
|
|
1006
|
-
rows: c.value ? null : "2",
|
|
1007
|
-
wrap: c.value ? null : "soft",
|
|
1008
|
-
class: i.value,
|
|
1009
|
-
onFocus: f,
|
|
1010
|
-
onBlur: d,
|
|
1011
|
-
onInput: p,
|
|
1012
|
-
onClick: h,
|
|
1013
|
-
onKeypress: vt(g, ["enter"])
|
|
1014
|
-
}), null, 16, ["value", "disabled", "type", "readonly", "rows", "wrap", "class"])),
|
|
1015
|
-
k.$slots.icon ? (m(), v("button", {
|
|
1016
|
-
key: 0,
|
|
1017
|
-
disabled: !!e.disabled,
|
|
1018
|
-
class: E([{ "cursor-pointer": !e.disabled }, "flex-[0_0_50px] h-full flex items-center justify-center text-gray-400 border-l border-gray-300 dark:border-gray-700/50"]),
|
|
1019
|
-
onClick: $
|
|
1020
|
-
}, [
|
|
1021
|
-
_(k.$slots, "icon")
|
|
1022
|
-
], 10, vl)) : T("", !0)
|
|
1023
|
-
], 2),
|
|
1024
|
-
e.hideMessage ? T("", !0) : (m(), v("div", pl, [
|
|
1025
|
-
_(k.$slots, "message", {}, () => [
|
|
1026
|
-
H(C(e.message), 1)
|
|
1027
|
-
])
|
|
1028
|
-
]))
|
|
1029
|
-
]));
|
|
1030
|
-
}
|
|
1031
|
-
}), gl = { class: "bg-white dark:bg-gray-900 rounded min-w-50 shadow-nav transition-all duration-400 dark:shadow-lg dark:shadow-primary/20 pb-6 lg:pb-0" }, bl = {
|
|
1032
|
-
key: 0,
|
|
1033
|
-
class: "lg:hidden text-title-md font-bold mb-4 uppercase px-4 sticky top-0"
|
|
1034
|
-
}, yl = { class: "h-full h-hull lg:max-h-44 lg:overflow-auto scrollbar lg:overscroll-contain" }, se = /* @__PURE__ */ B({
|
|
1035
|
-
inheritAttrs: !1,
|
|
1036
|
-
__name: "VSelect",
|
|
1037
|
-
props: {
|
|
1038
|
-
modelValue: {},
|
|
1039
|
-
label: {},
|
|
1040
|
-
disabled: { type: Boolean },
|
|
1041
|
-
items: {},
|
|
1042
|
-
title: {},
|
|
1043
|
-
top: {},
|
|
1044
|
-
left: {},
|
|
1045
|
-
right: {},
|
|
1046
|
-
bottom: {},
|
|
1047
|
-
height: {},
|
|
1048
|
-
hideOnClick: { type: Boolean },
|
|
1049
|
-
isPopup: { type: Boolean }
|
|
1050
|
-
},
|
|
1051
|
-
emits: ["change"],
|
|
1052
|
-
setup(e, { emit: n }) {
|
|
1053
|
-
const l = pt(e, ["modelValue", "label", "items", "disabled"]), s = n;
|
|
1054
|
-
function t(o, i) {
|
|
1055
|
-
s("change", o), i == null || i.set(!1);
|
|
1056
|
-
}
|
|
1057
|
-
return (o, i) => {
|
|
1058
|
-
const r = fl;
|
|
1059
|
-
return m(), A(Ce, U(l, {
|
|
1060
|
-
"hide-on-click": !1,
|
|
1061
|
-
class: "relative"
|
|
1062
|
-
}), {
|
|
1063
|
-
activator: y(({ on: u, isShow: c }) => [
|
|
1064
|
-
_(o.$slots, "activator", q(G({ on: u, isShow: c })), () => [
|
|
1065
|
-
b(Y, {
|
|
1066
|
-
"model-value": e.modelValue,
|
|
1067
|
-
disabled: e.disabled,
|
|
1068
|
-
label: e.label,
|
|
1069
|
-
readonly: "",
|
|
1070
|
-
hideMessage: "",
|
|
1071
|
-
active: "",
|
|
1072
|
-
onClick: u.click,
|
|
1073
|
-
onOnIcon: u.click
|
|
1074
|
-
}, {
|
|
1075
|
-
icon: y(() => [
|
|
1076
|
-
b(r, {
|
|
1077
|
-
class: E(["transition duration-300", c ? "rotate-x-180" : ""])
|
|
1078
|
-
}, null, 8, ["class"])
|
|
1079
|
-
]),
|
|
1080
|
-
_: 2
|
|
1081
|
-
}, 1032, ["model-value", "disabled", "label", "onClick", "onOnIcon"])
|
|
1082
|
-
])
|
|
1083
|
-
]),
|
|
1084
|
-
default: y(({ on: u }) => [
|
|
1085
|
-
a("div", gl, [
|
|
1086
|
-
e.label ? (m(), v("h4", bl, C(e.label), 1)) : T("", !0),
|
|
1087
|
-
a("div", yl, [
|
|
1088
|
-
b(be, {
|
|
1089
|
-
items: e.items,
|
|
1090
|
-
onClick: (c) => t(c, u)
|
|
1091
|
-
}, {
|
|
1092
|
-
default: y(({ item: c }) => [
|
|
1093
|
-
_(o.$slots, "item", { item: c }, () => [
|
|
1094
|
-
H(C(c.name), 1)
|
|
1095
|
-
])
|
|
1096
|
-
]),
|
|
1097
|
-
_: 3
|
|
1098
|
-
}, 8, ["items", "onClick"])
|
|
1099
|
-
])
|
|
1100
|
-
])
|
|
1101
|
-
]),
|
|
1102
|
-
_: 3
|
|
1103
|
-
}, 16);
|
|
1104
|
-
};
|
|
1105
|
-
}
|
|
1106
|
-
}), xl = { class: "md:flex items-center mb-4" }, $l = { class: "flex-auto text-gray-600 bg:text-gray-400 mb-2" }, kl = { class: "md:max-w-50" }, _l = { class: "flex items-center mb-4" }, wl = { class: "flex-auto text-gray-600 bg:text-gray-400" }, Cl = { class: "flex items-center mb-4" }, zl = { class: "flex-auto text-gray-600 bg:text-gray-400" }, Na = /* @__PURE__ */ B({
|
|
1107
|
-
__name: "BlockService",
|
|
1108
|
-
props: {
|
|
1109
|
-
locale: {},
|
|
1110
|
-
locales: {}
|
|
1111
|
-
},
|
|
1112
|
-
emits: ["reboot", "reset", "locale"],
|
|
1113
|
-
setup(e, { emit: n }) {
|
|
1114
|
-
const l = n, s = (o) => l("locale", o), t = (o) => {
|
|
1115
|
-
var i;
|
|
1116
|
-
return (i = e.locales.find((r) => r.value === o)) == null ? void 0 : i.name;
|
|
1117
|
-
};
|
|
1118
|
-
return (o, i) => {
|
|
1119
|
-
const r = se, u = j;
|
|
1120
|
-
return m(), v(N, null, [
|
|
1121
|
-
a("div", xl, [
|
|
1122
|
-
a("div", $l, C(o.$t("selectLang")), 1),
|
|
1123
|
-
a("div", kl, [
|
|
1124
|
-
b(r, {
|
|
1125
|
-
"model-value": t(e.locale),
|
|
1126
|
-
label: o.$t("lang"),
|
|
1127
|
-
items: e.locales,
|
|
1128
|
-
onChange: s
|
|
1129
|
-
}, null, 8, ["model-value", "label", "items"])
|
|
1130
|
-
])
|
|
1131
|
-
]),
|
|
1132
|
-
a("div", _l, [
|
|
1133
|
-
a("div", wl, C(o.$t("rebootDev")), 1),
|
|
1134
|
-
b(u, {
|
|
1135
|
-
class: "min-w-[100px]",
|
|
1136
|
-
color: "red",
|
|
1137
|
-
outline: "",
|
|
1138
|
-
onClick: i[0] || (i[0] = (c) => l("reboot", c))
|
|
1139
|
-
}, {
|
|
1140
|
-
default: y(() => [
|
|
1141
|
-
H(C(o.$t("reboot")), 1)
|
|
1142
|
-
]),
|
|
1143
|
-
_: 1
|
|
1144
|
-
})
|
|
1145
|
-
]),
|
|
1146
|
-
a("div", Cl, [
|
|
1147
|
-
a("div", zl, C(o.$t("resetConf")), 1),
|
|
1148
|
-
b(u, {
|
|
1149
|
-
class: "min-w-[100px]",
|
|
1150
|
-
color: "red",
|
|
1151
|
-
onClick: i[1] || (i[1] = (c) => l("reset", c))
|
|
1152
|
-
}, {
|
|
1153
|
-
default: y(() => [
|
|
1154
|
-
H(C(o.$t("reset")), 1)
|
|
1155
|
-
]),
|
|
1156
|
-
_: 1
|
|
1157
|
-
})
|
|
1158
|
-
])
|
|
1159
|
-
], 64);
|
|
1160
|
-
};
|
|
1161
|
-
}
|
|
1162
|
-
}), Sl = { class: "grid grid-cols-1 gap-4 lg:max-w-[360px] min-w-[250px]" }, Vl = { class: "flex flex-col w-full items-center gap-2" }, Bl = ["title"], El = { class: "absolute left-[110px] top-1/2 -translate-1/2 text-sm font-bold text-black dark:text-white text-center leading-none" }, Tl = { class: "absolute left-[110px] top-1/2 -translate-1/2 text-sm font-bold text-white text-center leading-none" }, Ll = { class: "flex justify-between w-full text-xs" }, Ml = { class: "text-gray-500 dark:text-gray-400" }, Al = { class: "text-sm" }, Dl = { class: "text-gray-500 dark:text-gray-400 text-left" }, Il = { class: "text-right text-xs" }, Fa = /* @__PURE__ */ B({
|
|
1163
|
-
__name: "BlockStatus",
|
|
1164
|
-
props: {
|
|
1165
|
-
pkg: {},
|
|
1166
|
-
key: {},
|
|
1167
|
-
id: { default: 0 },
|
|
1168
|
-
firmware: { default: () => [] },
|
|
1169
|
-
totalBytes: { default: 0 },
|
|
1170
|
-
usedBytes: { default: 0 },
|
|
1171
|
-
uptime: { default: 0 },
|
|
1172
|
-
name: {},
|
|
1173
|
-
board: {}
|
|
1174
|
-
},
|
|
1175
|
-
setup(e) {
|
|
1176
|
-
const n = O(e.uptime);
|
|
1177
|
-
let l = null;
|
|
1178
|
-
const s = M(() => e.firmware.join(".")), t = M(() => [
|
|
1179
|
-
{ name: "used", value: ke(e.usedBytes) },
|
|
1180
|
-
{ name: "available", value: ke(e.totalBytes - e.usedBytes) },
|
|
1181
|
-
{ name: "total", value: ke(e.totalBytes) }
|
|
1182
|
-
]), o = M(() => {
|
|
1183
|
-
var u;
|
|
1184
|
-
return [
|
|
1185
|
-
{ name: "uptime", value: zt(n.value) },
|
|
1186
|
-
{ name: "id", value: `${e.id.toString(16)} (${e.id})` },
|
|
1187
|
-
{ name: "firmware", value: s.value },
|
|
1188
|
-
{ name: "version", value: (u = e.pkg) == null ? void 0 : u.version }
|
|
1189
|
-
];
|
|
1190
|
-
}), i = M(() => e.usedBytes ? Math.round(e.usedBytes * 100 / e.totalBytes) : 0), r = () => {
|
|
1191
|
-
n.value++, l = setTimeout(r, 1e3);
|
|
1192
|
-
};
|
|
1193
|
-
return fe(() => {
|
|
1194
|
-
r();
|
|
1195
|
-
}), qe(() => {
|
|
1196
|
-
n.value = 0, l && clearTimeout(l);
|
|
1197
|
-
}), (u, c) => {
|
|
1198
|
-
var d, f, p;
|
|
1199
|
-
return m(), v("div", Sl, [
|
|
1200
|
-
a("div", Vl, [
|
|
1201
|
-
a("div", {
|
|
1202
|
-
class: "relative block h-4 w-full rounded overflow-hidden bg-gray-200 dark:bg-gray-800 select-none",
|
|
1203
|
-
title: `${i.value}%`
|
|
1204
|
-
}, [
|
|
1205
|
-
a("div", El, C(i.value) + "%", 1),
|
|
1206
|
-
a("div", {
|
|
1207
|
-
class: "bg-blue-600 rounded h-4 overflow-hidden relative transition-all duration-500",
|
|
1208
|
-
style: ne(`width: ${i.value}%`)
|
|
1209
|
-
}, [
|
|
1210
|
-
a("div", Tl, C(i.value) + "%", 1)
|
|
1211
|
-
], 4)
|
|
1212
|
-
], 8, Bl),
|
|
1213
|
-
a("div", Ll, [
|
|
1214
|
-
(m(!0), v(N, null, W(t.value, (g) => (m(), v("div", {
|
|
1215
|
-
key: g.name,
|
|
1216
|
-
class: "flex-auto"
|
|
1217
|
-
}, [
|
|
1218
|
-
a("div", Ml, [
|
|
1219
|
-
_(u.$slots, "name", { item: g })
|
|
1220
|
-
]),
|
|
1221
|
-
a("div", null, C(g.value), 1)
|
|
1222
|
-
]))), 128))
|
|
1223
|
-
])
|
|
1224
|
-
]),
|
|
1225
|
-
a("div", Al, [
|
|
1226
|
-
(m(!0), v(N, null, W(o.value, (g) => (m(), v("div", {
|
|
1227
|
-
key: g.name,
|
|
1228
|
-
class: "flex justify-between items-center"
|
|
1229
|
-
}, [
|
|
1230
|
-
a("div", Dl, [
|
|
1231
|
-
_(u.$slots, "name", { item: g })
|
|
1232
|
-
]),
|
|
1233
|
-
a("div", Il, C(g.value), 1)
|
|
1234
|
-
]))), 128))
|
|
1235
|
-
]),
|
|
1236
|
-
a("div", null, [
|
|
1237
|
-
_(u.$slots, "default", {
|
|
1238
|
-
home: (d = e.pkg) == null ? void 0 : d.homepage,
|
|
1239
|
-
repo: (p = (f = e.pkg) == null ? void 0 : f.repository) == null ? void 0 : p.url
|
|
1240
|
-
})
|
|
1241
|
-
])
|
|
1242
|
-
]);
|
|
1243
|
-
};
|
|
1244
|
-
}
|
|
1245
|
-
}), Ol = { class: "flex items-center cursor-pointer" }, jl = /* @__PURE__ */ B({
|
|
1246
|
-
__name: "VFile",
|
|
1247
|
-
emits: ["change"],
|
|
1248
|
-
setup(e, { emit: n }) {
|
|
1249
|
-
const l = n, s = async (t) => {
|
|
1250
|
-
const o = t.target;
|
|
1251
|
-
o.files && l("change", o.files);
|
|
1252
|
-
};
|
|
1253
|
-
return (t, o) => (m(), v("label", Ol, [
|
|
1254
|
-
a("input", U({
|
|
1255
|
-
type: "file",
|
|
1256
|
-
class: "hidden"
|
|
1257
|
-
}, t.$attrs, { onChange: s }), null, 16),
|
|
1258
|
-
_(t.$slots, "default")
|
|
1259
|
-
]));
|
|
1260
|
-
}
|
|
1261
|
-
}), Pl = { class: "md:flex" }, Hl = { class: "text-gray-600 bg:text-gray-400 first-letter:uppercase min-w-19" }, Ra = /* @__PURE__ */ B({
|
|
1262
|
-
__name: "BlockUpdate",
|
|
1263
|
-
emits: ["update"],
|
|
1264
|
-
setup(e, { emit: n }) {
|
|
1265
|
-
const l = n, s = ve({ firmware: null, littlefs: null }), t = (r) => r ? Array.from(r).map((u) => `${u.name} (${ke(u.size)})`).join("") : "", o = (r, u) => {
|
|
1266
|
-
const c = new FormData();
|
|
1267
|
-
for (let d = 0; d < r.length; d++) {
|
|
1268
|
-
const f = r.item(d);
|
|
1269
|
-
if (!f) return;
|
|
1270
|
-
c.append(`file[${d}]`, f, u);
|
|
1271
|
-
}
|
|
1272
|
-
return c;
|
|
1273
|
-
}, i = (r, u) => {
|
|
1274
|
-
if (!u) return;
|
|
1275
|
-
const c = o(u, r);
|
|
1276
|
-
c && l("update", r, c);
|
|
1277
|
-
};
|
|
1278
|
-
return (r, u) => {
|
|
1279
|
-
const c = j;
|
|
1280
|
-
return m(), v("div", null, [
|
|
1281
|
-
(m(!0), v(N, null, W(s, (d, f) => (m(), v("div", {
|
|
1282
|
-
key: f,
|
|
1283
|
-
class: "mb-4 flex items-center"
|
|
1284
|
-
}, [
|
|
1285
|
-
b(jl, {
|
|
1286
|
-
accept: ".bin",
|
|
1287
|
-
onChange: (p) => s[f] = p,
|
|
1288
|
-
class: "flex-auto"
|
|
1289
|
-
}, {
|
|
1290
|
-
default: y(() => [
|
|
1291
|
-
a("div", Pl, [
|
|
1292
|
-
a("h6", Hl, C(f) + ":", 1),
|
|
1293
|
-
_(r.$slots, "default", {
|
|
1294
|
-
file: t(d)
|
|
1295
|
-
})
|
|
1296
|
-
])
|
|
1297
|
-
]),
|
|
1298
|
-
_: 2
|
|
1299
|
-
}, 1032, ["onChange"]),
|
|
1300
|
-
b(c, {
|
|
1301
|
-
class: "min-w-[100px]",
|
|
1302
|
-
color: "blue",
|
|
1303
|
-
disabled: !d,
|
|
1304
|
-
onClick: (p) => i(`${f}.bin`, d)
|
|
1305
|
-
}, {
|
|
1306
|
-
default: y(() => [
|
|
1307
|
-
H(C(r.$t("btnUpdate")), 1)
|
|
1308
|
-
]),
|
|
1309
|
-
_: 1
|
|
1310
|
-
}, 8, ["disabled", "onClick"])
|
|
1311
|
-
]))), 128))
|
|
1312
|
-
]);
|
|
1313
|
-
};
|
|
1314
|
-
}
|
|
1315
|
-
}), Nl = {
|
|
1316
|
-
viewBox: "0 0 24 24",
|
|
1317
|
-
width: "1.2em",
|
|
1318
|
-
height: "1.2em"
|
|
1319
|
-
};
|
|
1320
|
-
function Fl(e, n) {
|
|
1321
|
-
return m(), v("svg", Nl, [...n[0] || (n[0] = [
|
|
1322
|
-
a("path", {
|
|
1323
|
-
fill: "currentColor",
|
|
1324
|
-
d: "M12.172 12L9.343 9.173l1.415-1.414L15 12l-4.242 4.242l-1.415-1.414z"
|
|
1325
|
-
}, null, -1)
|
|
1326
|
-
])]);
|
|
1327
|
-
}
|
|
1328
|
-
const lt = K({ name: "ri-arrow-drop-right-line", render: Fl }), Rl = { class: "flex items-center gap-1.5" }, Ua = /* @__PURE__ */ B({
|
|
1329
|
-
__name: "BlockBreadcrumb",
|
|
1330
|
-
props: {
|
|
1331
|
-
items: { default: () => [] }
|
|
1332
|
-
},
|
|
1333
|
-
emits: ["click"],
|
|
1334
|
-
setup(e, { emit: n }) {
|
|
1335
|
-
const l = n, s = (t) => l("click", t);
|
|
1336
|
-
return (t, o) => {
|
|
1337
|
-
const i = lt;
|
|
1338
|
-
return m(), v("nav", null, [
|
|
1339
|
-
a("ol", Rl, [
|
|
1340
|
-
(m(!0), v(N, null, W(e.items, (r, u) => (m(), v("li", {
|
|
1341
|
-
key: u,
|
|
1342
|
-
class: E(["inline-flex items-center gap-1.5 text-sm text-gray-500 dark:text-gray-400", r.path ? "" : "text-gray-800 dark:text-white/90"])
|
|
1343
|
-
}, [
|
|
1344
|
-
_(t.$slots, "default", { item: r }, () => [
|
|
1345
|
-
(m(), A(ge(r.path ? "a" : "span"), {
|
|
1346
|
-
href: r.path,
|
|
1347
|
-
onClick: (c) => s(r)
|
|
1348
|
-
}, {
|
|
1349
|
-
default: y(() => [
|
|
1350
|
-
H(C(r.name), 1)
|
|
1351
|
-
]),
|
|
1352
|
-
_: 2
|
|
1353
|
-
}, 1032, ["href", "onClick"]))
|
|
1354
|
-
]),
|
|
1355
|
-
r.path ? (m(), A(i, {
|
|
1356
|
-
key: 0,
|
|
1357
|
-
class: "rotate-270"
|
|
1358
|
-
})) : T("", !0)
|
|
1359
|
-
], 2))), 128))
|
|
1360
|
-
])
|
|
1361
|
-
]);
|
|
1362
|
-
};
|
|
1363
|
-
}
|
|
1364
|
-
}), Ul = {
|
|
1365
|
-
key: 0,
|
|
1366
|
-
class: "loader-line w-full absolute top-0 left-0 h-[3px] bg-gray-100 dark:bg-gray-800 before:bg-blue-600 dark:before:bg-blue-800 before:h-1 rounded-xl z-20 before:absolute before:w-[40%] before:-left-1/2 before:content-[''] before:animate-[lineAnim_1s_linear_infinite]"
|
|
1367
|
-
}, Kl = {
|
|
1368
|
-
key: 1,
|
|
1369
|
-
class: "absolute top-0 left-0 w-full h-full bg-gray-50 dark:bg-gray-900 z-10 opacity-50"
|
|
1370
|
-
}, Wl = {
|
|
1371
|
-
key: 2,
|
|
1372
|
-
class: "mb-4 flex items-center justify-between"
|
|
1373
|
-
}, ql = { class: "text-lg font-semibold text-gray-800 dark:text-white/90 mb-0" }, Gl = { class: "max-w-full" }, Zl = /* @__PURE__ */ B({
|
|
1374
|
-
__name: "CardMain",
|
|
1375
|
-
props: {
|
|
1376
|
-
title: {},
|
|
1377
|
-
loading: { type: Boolean }
|
|
1378
|
-
},
|
|
1379
|
-
setup(e) {
|
|
1380
|
-
return (n, l) => (m(), v("div", {
|
|
1381
|
-
class: E(["relative rounded-md border border-gray-200 dark:border-gray-800 bg-white dark:bg-white/[0.03] p-5 sm:p-6 hover-effect", { "overflow-hidden": e.loading }])
|
|
1382
|
-
}, [
|
|
1383
|
-
e.loading ? (m(), v("div", Ul)) : T("", !0),
|
|
1384
|
-
e.loading ? (m(), v("div", Kl)) : T("", !0),
|
|
1385
|
-
e.title ? (m(), v("div", Wl, [
|
|
1386
|
-
a("h3", ql, C(e.title), 1),
|
|
1387
|
-
a("div", null, [
|
|
1388
|
-
_(n.$slots, "header")
|
|
1389
|
-
])
|
|
1390
|
-
])) : T("", !0),
|
|
1391
|
-
a("div", Gl, [
|
|
1392
|
-
_(n.$slots, "default")
|
|
1393
|
-
])
|
|
1394
|
-
], 2));
|
|
1395
|
-
}
|
|
1396
|
-
}), Jl = {
|
|
1397
|
-
viewBox: "0 0 24 24",
|
|
1398
|
-
width: "1.2em",
|
|
1399
|
-
height: "1.2em"
|
|
1400
|
-
};
|
|
1401
|
-
function Xl(e, n) {
|
|
1402
|
-
return m(), v("svg", Jl, [...n[0] || (n[0] = [
|
|
1403
|
-
a("path", {
|
|
1404
|
-
fill: "currentColor",
|
|
1405
|
-
d: "M7 6V3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-3v3c0 .552-.45 1-1.007 1H4.007A1 1 0 0 1 3 21l.003-14c0-.552.45-1 1.006-1zM5.002 8L5 20h10V8zM9 6h8v10h2V4H9zm-2 5h6v2H7zm0 4h6v2H7z"
|
|
1406
|
-
}, null, -1)
|
|
1407
|
-
])]);
|
|
1408
|
-
}
|
|
1409
|
-
const Yl = K({ name: "ri-file-copy2-line", render: Xl }), Ql = { class: "text-title-md uppercase font-bold flex-auto" }, es = { class: "px-4 pb-4 md:px-6" }, ts = {
|
|
1410
|
-
key: 0,
|
|
1411
|
-
class: "text-title-md uppercase font-bold"
|
|
1412
|
-
}, De = /* @__PURE__ */ B({
|
|
1413
|
-
__name: "VDialog",
|
|
1414
|
-
props: {
|
|
1415
|
-
title: {},
|
|
1416
|
-
size: { default: "md" },
|
|
1417
|
-
popupSize: { default: "auto" },
|
|
1418
|
-
color: { default: "white" },
|
|
1419
|
-
type: {},
|
|
1420
|
-
hiddenCloser: { type: Boolean },
|
|
1421
|
-
isOnlyDialog: { type: Boolean },
|
|
1422
|
-
timeout: {}
|
|
1423
|
-
},
|
|
1424
|
-
emits: ["close", "click", "open"],
|
|
1425
|
-
setup(e, { expose: n, emit: l }) {
|
|
1426
|
-
const s = l, t = Je(Xe), { show: o, onClose: i, onOpen: r } = Ze(s, e.timeout), u = {
|
|
1427
|
-
sm: "max-w-full md:max-w-[330px] h-full md:h-[unset]",
|
|
1428
|
-
md: "max-w-full md:max-w-[672px] h-full md:h-[unset]",
|
|
1429
|
-
lg: "max-w-full md:max-w-[960px] h-full md:h-[unset]",
|
|
1430
|
-
full: "relative max-w-full w-full h-3/4 "
|
|
1431
|
-
}, c = {
|
|
1432
|
-
none: "",
|
|
1433
|
-
white: "bg-white dark:bg-gray-900",
|
|
1434
|
-
gray: ""
|
|
1435
|
-
}, d = M(() => [u[e.size], c[e.color]]), f = t.greaterOrEqual("lg");
|
|
1436
|
-
return n({
|
|
1437
|
-
show: o,
|
|
1438
|
-
onClose: i
|
|
1439
|
-
}), (p, g) => {
|
|
1440
|
-
const h = oe;
|
|
1441
|
-
return e.isOnlyDialog || L(f) ? (m(), A(Ke, {
|
|
1442
|
-
key: 0,
|
|
1443
|
-
to: "body"
|
|
1444
|
-
}, [
|
|
1445
|
-
b(de, {
|
|
1446
|
-
"enter-active-class": "duration-300 ease-out",
|
|
1447
|
-
"enter-from-class": "transform opacity-0 -translate-y-2",
|
|
1448
|
-
"enter-to-class": "opacity-100 translate-y-0",
|
|
1449
|
-
"leave-active-class": "duration-200 ease-in",
|
|
1450
|
-
"leave-from-class": "opacity-100 translate-y-0",
|
|
1451
|
-
"leave-to-class": "transform opacity-0 -translate-y-2",
|
|
1452
|
-
onAfterEnter: L(r)
|
|
1453
|
-
}, {
|
|
1454
|
-
default: y(() => [
|
|
1455
|
-
L(o) ? (m(), v("div", {
|
|
1456
|
-
key: 0,
|
|
1457
|
-
class: "z-20 fixed top-0 h-dvh w-full left-0 flex flex-col",
|
|
1458
|
-
onWheel: g[4] || (g[4] = F(() => {
|
|
1459
|
-
}, ["stop"]))
|
|
1460
|
-
}, [
|
|
1461
|
-
a("div", {
|
|
1462
|
-
class: "absolute h-full w-full top-0 left-0 bg-black/40 bg-blur",
|
|
1463
|
-
onClick: g[0] || (g[0] = //@ts-ignore
|
|
1464
|
-
(...$) => L(i) && L(i)(...$))
|
|
1465
|
-
}),
|
|
1466
|
-
a("div", {
|
|
1467
|
-
class: E(["flex-auto flex align-center overflow-y-auto overscroll-contain", (e.size === "full", "")])
|
|
1468
|
-
}, [
|
|
1469
|
-
a("div", {
|
|
1470
|
-
class: E(["m-auto w-full flex flex-col z-20 overflow-auto h-full scrollbar overscroll-contain bg-gray-50 dark:bg-gray-900 shadow-lg rounded-sm", d.value])
|
|
1471
|
-
}, [
|
|
1472
|
-
a("div", {
|
|
1473
|
-
class: E(["flex items-center min-h-14 ps-6 pe-3", e.size === "full" ? "absolute top-0 right-4" : ""]),
|
|
1474
|
-
onWheel: g[1] || (g[1] = F(() => {
|
|
1475
|
-
}, ["prevent"])),
|
|
1476
|
-
onTouchmove: g[2] || (g[2] = F(() => {
|
|
1477
|
-
}, ["prevent"]))
|
|
1478
|
-
}, [
|
|
1479
|
-
a("h4", Ql, C(e.title), 1),
|
|
1480
|
-
_(p.$slots, "header-btn", { close: L(i) }),
|
|
1481
|
-
b(j, {
|
|
1482
|
-
color: "transparent",
|
|
1483
|
-
size: "md",
|
|
1484
|
-
onClick: L(i)
|
|
1485
|
-
}, {
|
|
1486
|
-
default: y(() => [
|
|
1487
|
-
b(h)
|
|
1488
|
-
]),
|
|
1489
|
-
_: 1
|
|
1490
|
-
}, 8, ["onClick"])
|
|
1491
|
-
], 34),
|
|
1492
|
-
a("div", {
|
|
1493
|
-
class: E(["relative overflow-auto h-full md:h-auto max-h-dvh scrollbar overflow-y-auto overscroll-contain", e.size === "full" ? "flex-auto" : "md:max-h-147.5 px-6 pb-6"]),
|
|
1494
|
-
onClose: g[3] || (g[3] = //@ts-ignore
|
|
1495
|
-
(...$) => L(i) && L(i)(...$))
|
|
1496
|
-
}, [
|
|
1497
|
-
_(p.$slots, "default", { close: L(i) })
|
|
1498
|
-
], 34)
|
|
1499
|
-
], 2)
|
|
1500
|
-
], 2)
|
|
1501
|
-
], 32)) : T("", !0)
|
|
1502
|
-
]),
|
|
1503
|
-
_: 3
|
|
1504
|
-
}, 8, ["onAfterEnter"])
|
|
1505
|
-
])) : (m(), A(tt, {
|
|
1506
|
-
key: 1,
|
|
1507
|
-
size: e.popupSize,
|
|
1508
|
-
onClose: L(i)
|
|
1509
|
-
}, {
|
|
1510
|
-
button: y(() => [
|
|
1511
|
-
_(p.$slots, "header-btn", { close: L(i) })
|
|
1512
|
-
]),
|
|
1513
|
-
default: y(({ close: $ }) => [
|
|
1514
|
-
a("div", es, [
|
|
1515
|
-
a("div", {
|
|
1516
|
-
class: E(["flex items-center mb-4", e.size === "full" ? "absolute top-0 right-4" : ""]),
|
|
1517
|
-
onWheel: g[5] || (g[5] = F(() => {
|
|
1518
|
-
}, ["prevent"])),
|
|
1519
|
-
onTouchmove: g[6] || (g[6] = F(() => {
|
|
1520
|
-
}, ["prevent"]))
|
|
1521
|
-
}, [
|
|
1522
|
-
e.title ? (m(), v("h4", ts, C(e.title), 1)) : T("", !0)
|
|
1523
|
-
], 34),
|
|
1524
|
-
_(p.$slots, "default", { close: $ })
|
|
1525
|
-
])
|
|
1526
|
-
]),
|
|
1527
|
-
_: 3
|
|
1528
|
-
}, 8, ["size", "onClose"]));
|
|
1529
|
-
};
|
|
1530
|
-
}
|
|
1531
|
-
}), ns = { class: "flex-auto flex justify-between" }, ls = { class: "text-sm text-gray-500 font-medium line-clamp-2 overflow-hidden" }, ss = { class: "text-sm text-ellipsis overflow-hidden text-nowrap" }, os = {
|
|
1532
|
-
key: 0,
|
|
1533
|
-
class: "absolute left-1/2 top-1/2 size-[calc(50%)] text-gray-200/30 dark:text-gray-800/30 -translate-1/2"
|
|
1534
|
-
}, as = { class: "min-h-60 relative" }, is = { class: "pt-6" }, rs = { class: "text-center text-3xl text-ellipsis overflow-hidden" }, cs = { class: "text-center text-xl mt-4" }, me = /* @__PURE__ */ B({
|
|
1535
|
-
__name: "CardBase",
|
|
1536
|
-
props: {
|
|
1537
|
-
size: {},
|
|
1538
|
-
id: {},
|
|
1539
|
-
name: {},
|
|
1540
|
-
type: {},
|
|
1541
|
-
icon: {},
|
|
1542
|
-
value: {},
|
|
1543
|
-
valueTo: {},
|
|
1544
|
-
opts: {},
|
|
1545
|
-
args: {},
|
|
1546
|
-
set: {},
|
|
1547
|
-
get: {},
|
|
1548
|
-
getTo: {}
|
|
1549
|
-
},
|
|
1550
|
-
emits: ["edit", "close", "click", "clone", "open", "setState"],
|
|
1551
|
-
setup(e, { emit: n }) {
|
|
1552
|
-
const l = e, s = n, t = O(!1), o = M(() => ["button", "dimmer"].includes(l.type || "") && l.value ? "text-amber-500" : "text-gray-400"), i = (f) => s("edit", f), r = (f) => s("clone", f), u = () => t.value = !0, c = (f) => s("open", f), d = (f) => {
|
|
1553
|
-
t.value = !1, s("close", f);
|
|
1554
|
-
};
|
|
1555
|
-
return (f, p) => {
|
|
1556
|
-
const g = Qe, h = Yl;
|
|
1557
|
-
return m(), v("div", {
|
|
1558
|
-
class: "flex flex-col border relative aspect-square rounded-md bg-white dark:bg-gray-900 border-b border-gray-300 dark:border-gray-700 p-2 hover-effect transition-all cursor-pointer",
|
|
1559
|
-
onClick: u
|
|
1560
|
-
}, [
|
|
1561
|
-
a("div", ns, [
|
|
1562
|
-
a("div", {
|
|
1563
|
-
class: E([o.value, "size-8 animate-shake"])
|
|
1564
|
-
}, [
|
|
1565
|
-
_(f.$slots, "icon", q(G(l)))
|
|
1566
|
-
], 2),
|
|
1567
|
-
_(f.$slots, "header", q(G(l)))
|
|
1568
|
-
]),
|
|
1569
|
-
a("div", null, [
|
|
1570
|
-
_(f.$slots, "body", q(G(l)), () => [
|
|
1571
|
-
a("h6", ls, [
|
|
1572
|
-
_(f.$slots, "name", q(G(l)), () => [
|
|
1573
|
-
H(C(l.name), 1)
|
|
1574
|
-
])
|
|
1575
|
-
]),
|
|
1576
|
-
a("div", ss, [
|
|
1577
|
-
_(f.$slots, "value", q(G(l)), () => [
|
|
1578
|
-
H(C(l.valueTo || l.value), 1)
|
|
1579
|
-
])
|
|
1580
|
-
])
|
|
1581
|
-
])
|
|
1582
|
-
]),
|
|
1583
|
-
l.icon ? (m(), v("div", os, [
|
|
1584
|
-
_(f.$slots, "icon", q(G(l)))
|
|
1585
|
-
])) : T("", !0),
|
|
1586
|
-
t.value ? (m(), A(De, {
|
|
1587
|
-
key: 1,
|
|
1588
|
-
size: l.size || "sm",
|
|
1589
|
-
title: e.name,
|
|
1590
|
-
onClose: d,
|
|
1591
|
-
onOpen: c
|
|
1592
|
-
}, {
|
|
1593
|
-
"header-btn": y(() => [
|
|
1594
|
-
b(j, {
|
|
1595
|
-
color: "transparent",
|
|
1596
|
-
onClick: i
|
|
1597
|
-
}, {
|
|
1598
|
-
default: y(() => [
|
|
1599
|
-
b(g)
|
|
1600
|
-
]),
|
|
1601
|
-
_: 1
|
|
1602
|
-
}),
|
|
1603
|
-
b(j, {
|
|
1604
|
-
color: "transparent",
|
|
1605
|
-
onClick: r
|
|
1606
|
-
}, {
|
|
1607
|
-
default: y(() => [
|
|
1608
|
-
b(h, { class: "size-4 text-gray-500" })
|
|
1609
|
-
]),
|
|
1610
|
-
_: 1
|
|
1611
|
-
})
|
|
1612
|
-
]),
|
|
1613
|
-
default: y(() => [
|
|
1614
|
-
a("div", as, [
|
|
1615
|
-
a("div", is, [
|
|
1616
|
-
a("h3", rs, [
|
|
1617
|
-
_(f.$slots, "dialog-name", q(G(l)), () => [
|
|
1618
|
-
H(C(l.name), 1)
|
|
1619
|
-
])
|
|
1620
|
-
]),
|
|
1621
|
-
_(f.$slots, "dialog", q(G(l))),
|
|
1622
|
-
a("p", cs, [
|
|
1623
|
-
_(f.$slots, "dialog-value", q(G(l)), () => [
|
|
1624
|
-
H(C(l.valueTo || l.value), 1)
|
|
1625
|
-
])
|
|
1626
|
-
])
|
|
1627
|
-
])
|
|
1628
|
-
])
|
|
1629
|
-
]),
|
|
1630
|
-
_: 3
|
|
1631
|
-
}, 8, ["size", "title"])) : T("", !0)
|
|
1632
|
-
]);
|
|
1633
|
-
};
|
|
1634
|
-
}
|
|
1635
|
-
}), ds = {
|
|
1636
|
-
viewBox: "0 0 24 24",
|
|
1637
|
-
width: "1.2em",
|
|
1638
|
-
height: "1.2em"
|
|
1639
|
-
};
|
|
1640
|
-
function us(e, n) {
|
|
1641
|
-
return m(), v("svg", ds, [...n[0] || (n[0] = [
|
|
1642
|
-
a("path", {
|
|
1643
|
-
fill: "currentColor",
|
|
1644
|
-
d: "m6.265 3.807l1.147 1.639a8 8 0 1 0 9.176 0l1.147-1.639A9.99 9.99 0 0 1 22 12c0 5.523-4.477 10-10 10S2 17.523 2 12a9.99 9.99 0 0 1 4.265-8.193M11 12V2h2v10z"
|
|
1645
|
-
}, null, -1)
|
|
1646
|
-
])]);
|
|
1647
|
-
}
|
|
1648
|
-
const fs = K({ name: "ri-shut-down-line", render: us }), ms = { class: "flex justify-end" }, vs = { class: "flex justify-center py-4" }, Ka = /* @__PURE__ */ B({
|
|
1649
|
-
__name: "CardButton",
|
|
1650
|
-
props: {
|
|
1651
|
-
size: {},
|
|
1652
|
-
id: {},
|
|
1653
|
-
name: {},
|
|
1654
|
-
type: {},
|
|
1655
|
-
icon: {},
|
|
1656
|
-
value: {},
|
|
1657
|
-
valueTo: {},
|
|
1658
|
-
opts: {},
|
|
1659
|
-
args: {},
|
|
1660
|
-
set: {},
|
|
1661
|
-
get: {},
|
|
1662
|
-
getTo: {}
|
|
1663
|
-
},
|
|
1664
|
-
emits: ["edit", "close", "click", "clone", "open", "setState"],
|
|
1665
|
-
setup(e, { emit: n }) {
|
|
1666
|
-
const l = e, s = n, t = ({ opts: i = {} }) => {
|
|
1667
|
-
const { disabled: r } = i;
|
|
1668
|
-
return { disabled: r };
|
|
1669
|
-
}, o = () => s("setState", !l.value);
|
|
1670
|
-
return (i, r) => {
|
|
1671
|
-
const u = fs;
|
|
1672
|
-
return m(), A(me, U(l, {
|
|
1673
|
-
onClick: r[0] || (r[0] = (c) => s("click", c)),
|
|
1674
|
-
onEdit: r[1] || (r[1] = (c) => s("edit", c)),
|
|
1675
|
-
onClone: r[2] || (r[2] = (c) => s("clone", c))
|
|
1676
|
-
}), {
|
|
1677
|
-
icon: y((c) => [
|
|
1678
|
-
_(i.$slots, "icon", q(G(c)))
|
|
1679
|
-
]),
|
|
1680
|
-
header: y((c) => [
|
|
1681
|
-
a("div", ms, [
|
|
1682
|
-
b(j, U(t(c), {
|
|
1683
|
-
type: "icon",
|
|
1684
|
-
class: l.value ? "text-amber-500" : "text-gray-500",
|
|
1685
|
-
onClick: F(o, ["stop"])
|
|
1686
|
-
}), {
|
|
1687
|
-
default: y(() => [
|
|
1688
|
-
b(u, { class: "size-8" })
|
|
1689
|
-
]),
|
|
1690
|
-
_: 1
|
|
1691
|
-
}, 16, ["class"])
|
|
1692
|
-
])
|
|
1693
|
-
]),
|
|
1694
|
-
dialog: y((c) => [
|
|
1695
|
-
a("div", vs, [
|
|
1696
|
-
b(j, U(t(c), {
|
|
1697
|
-
type: "icon",
|
|
1698
|
-
class: ["size-18", l.value ? "text-amber-500" : "text-gray-500"],
|
|
1699
|
-
onClick: F(o, ["stop"])
|
|
1700
|
-
}), {
|
|
1701
|
-
default: y(() => [
|
|
1702
|
-
b(u, { class: "size-16" })
|
|
1703
|
-
]),
|
|
1704
|
-
_: 1
|
|
1705
|
-
}, 16, ["class"])
|
|
1706
|
-
])
|
|
1707
|
-
]),
|
|
1708
|
-
_: 3
|
|
1709
|
-
}, 16);
|
|
1710
|
-
};
|
|
1711
|
-
}
|
|
1712
|
-
}), ps = {
|
|
1713
|
-
viewBox: "0 0 24 24",
|
|
1714
|
-
width: "1.2em",
|
|
1715
|
-
height: "1.2em"
|
|
1716
|
-
};
|
|
1717
|
-
function hs(e, n) {
|
|
1718
|
-
return m(), v("svg", ps, [...n[0] || (n[0] = [
|
|
1719
|
-
a("path", {
|
|
1720
|
-
fill: "currentColor",
|
|
1721
|
-
d: "M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m1-8h4v2h-6V7h2z"
|
|
1722
|
-
}, null, -1)
|
|
1723
|
-
])]);
|
|
1724
|
-
}
|
|
1725
|
-
const gs = K({ name: "ri-time-line", render: hs }), bs = { class: "flex justify-center relative mx-2 my-6" }, Wa = /* @__PURE__ */ B({
|
|
1726
|
-
__name: "CardDate",
|
|
1727
|
-
props: {
|
|
1728
|
-
size: {},
|
|
1729
|
-
id: {},
|
|
1730
|
-
name: {},
|
|
1731
|
-
type: {},
|
|
1732
|
-
icon: {},
|
|
1733
|
-
value: {},
|
|
1734
|
-
valueTo: {},
|
|
1735
|
-
opts: {},
|
|
1736
|
-
args: {},
|
|
1737
|
-
set: {},
|
|
1738
|
-
get: {},
|
|
1739
|
-
getTo: {}
|
|
1740
|
-
},
|
|
1741
|
-
emits: ["edit", "close", "click", "clone", "open", "setState"],
|
|
1742
|
-
setup(e, { emit: n }) {
|
|
1743
|
-
const l = e, s = n, t = Ge("time"), o = (c) => new Date(+c * 1e3).toISOString().slice(0, 16), i = (c) => {
|
|
1744
|
-
var f;
|
|
1745
|
-
const d = (f = c == null ? void 0 : c.target) == null ? void 0 : f.valueAsNumber;
|
|
1746
|
-
d && s("setState", d / 1e3);
|
|
1747
|
-
}, r = ({ name: c, value: d, opts: f = {} }) => {
|
|
1748
|
-
const { disabled: p } = f;
|
|
1749
|
-
return { label: c, modelValue: o(d), disabled: p };
|
|
1750
|
-
}, u = () => {
|
|
1751
|
-
var d, f;
|
|
1752
|
-
const c = (f = (d = t.value) == null ? void 0 : d.$el) == null ? void 0 : f.querySelector("input");
|
|
1753
|
-
c != null && c.showPicker && c.showPicker();
|
|
1754
|
-
};
|
|
1755
|
-
return (c, d) => {
|
|
1756
|
-
const f = gs;
|
|
1757
|
-
return m(), A(me, U(l, {
|
|
1758
|
-
onClick: d[0] || (d[0] = (p) => s("click", p)),
|
|
1759
|
-
onEdit: d[1] || (d[1] = (p) => s("edit", p)),
|
|
1760
|
-
onClone: d[2] || (d[2] = (p) => s("clone", p))
|
|
1761
|
-
}), {
|
|
1762
|
-
icon: y((p) => [
|
|
1763
|
-
_(c.$slots, "icon", q(G(p)))
|
|
1764
|
-
]),
|
|
1765
|
-
header: y((p) => [
|
|
1766
|
-
a("div", null, [
|
|
1767
|
-
b(j, {
|
|
1768
|
-
type: "icon",
|
|
1769
|
-
class: "text-gray-500",
|
|
1770
|
-
onClick: F(u, ["stop"])
|
|
1771
|
-
}, {
|
|
1772
|
-
default: y(() => [
|
|
1773
|
-
b(f, { class: "size-7" })
|
|
1774
|
-
]),
|
|
1775
|
-
_: 1
|
|
1776
|
-
}),
|
|
1777
|
-
b(Y, U({
|
|
1778
|
-
ref_key: "time",
|
|
1779
|
-
ref: t
|
|
1780
|
-
}, r(p), {
|
|
1781
|
-
type: "datetime-local",
|
|
1782
|
-
class: "size-0",
|
|
1783
|
-
hidden: "",
|
|
1784
|
-
onChange: i
|
|
1785
|
-
}), null, 16)
|
|
1786
|
-
])
|
|
1787
|
-
]),
|
|
1788
|
-
dialog: y((p) => [
|
|
1789
|
-
a("div", bs, [
|
|
1790
|
-
b(Y, U(r(p), {
|
|
1791
|
-
type: "datetime-local",
|
|
1792
|
-
onChange: i
|
|
1793
|
-
}), null, 16)
|
|
1794
|
-
])
|
|
1795
|
-
]),
|
|
1796
|
-
_: 3
|
|
1797
|
-
}, 16);
|
|
1798
|
-
};
|
|
1799
|
-
}
|
|
1800
|
-
}), ys = { class: "flex justify-end" }, xs = { class: "flex justify-end" }, $s = {
|
|
1801
|
-
class: /* @__PURE__ */ E("text-blue-600 dark:text-blue-400")
|
|
1802
|
-
}, ks = {
|
|
1803
|
-
width: "30",
|
|
1804
|
-
height: "30",
|
|
1805
|
-
viewBox: "-7.5 -7.5 75 75",
|
|
1806
|
-
version: "1.1",
|
|
1807
|
-
style: { transform: "rotate(-90deg)" }
|
|
1808
|
-
}, _s = ["stroke-dashoffset"], ws = { class: "absolute top-1/2 left-1/2 -translate-1/2 text-white z-10 font-bold text-xl" }, qa = /* @__PURE__ */ B({
|
|
1809
|
-
__name: "CardDimmer",
|
|
1810
|
-
props: {
|
|
1811
|
-
size: {},
|
|
1812
|
-
id: {},
|
|
1813
|
-
name: {},
|
|
1814
|
-
type: {},
|
|
1815
|
-
icon: {},
|
|
1816
|
-
value: {},
|
|
1817
|
-
valueTo: {},
|
|
1818
|
-
opts: {},
|
|
1819
|
-
args: {},
|
|
1820
|
-
set: {},
|
|
1821
|
-
get: {},
|
|
1822
|
-
getTo: {}
|
|
1823
|
-
},
|
|
1824
|
-
emits: ["edit", "close", "click", "clone", "open", "setState"],
|
|
1825
|
-
setup(e, { emit: n }) {
|
|
1826
|
-
const l = e, s = n, t = O(0), o = ({ opts: d, value: f }) => Math.round(100 * +f / ((d == null ? void 0 : d.max) || 255)), i = ({ opts: d, value: f }) => Math.round(187 - +f / ((d == null ? void 0 : d.max) || 255) * 187), r = ({ value: d, opts: f }) => {
|
|
1827
|
-
const { min: p = 0, max: g = 255, step: h = 1, disabled: $ } = f || {};
|
|
1828
|
-
return { min: p, max: g, step: h, value: d, disabled: !!$, class: $ ? "" : "cursor-pointer" };
|
|
1829
|
-
}, u = (d) => s("setState", +d.target.value || 0), c = ({ value: d }) => {
|
|
1830
|
-
+d != 0 ? (t.value = +d, s("setState", 0)) : s("setState", d ? 0 : t.value || 255);
|
|
1831
|
-
};
|
|
1832
|
-
return (d, f) => (m(), A(me, U(l, {
|
|
1833
|
-
onClick: f[0] || (f[0] = (p) => s("click", p)),
|
|
1834
|
-
onEdit: f[1] || (f[1] = (p) => s("edit", p)),
|
|
1835
|
-
onClone: f[2] || (f[2] = (p) => s("clone", p))
|
|
1836
|
-
}), {
|
|
1837
|
-
icon: y((p) => [
|
|
1838
|
-
_(d.$slots, "icon", q(G(p)))
|
|
1839
|
-
]),
|
|
1840
|
-
header: y((p) => [
|
|
1841
|
-
a("div", ys, [
|
|
1842
|
-
a("div", xs, [
|
|
1843
|
-
b(j, U(r(p), {
|
|
1844
|
-
type: "icon",
|
|
1845
|
-
onClick: F((g) => c(p), ["stop"])
|
|
1846
|
-
}), {
|
|
1847
|
-
default: y(() => [
|
|
1848
|
-
a("div", $s, [
|
|
1849
|
-
(m(), v("svg", ks, [
|
|
1850
|
-
f[3] || (f[3] = a("circle", {
|
|
1851
|
-
class: "stroke-gray-300 dark:stroke-gray-700",
|
|
1852
|
-
r: "30",
|
|
1853
|
-
cx: "30",
|
|
1854
|
-
cy: "30",
|
|
1855
|
-
fill: "transparent",
|
|
1856
|
-
"stroke-width": "10"
|
|
1857
|
-
}, null, -1)),
|
|
1858
|
-
a("circle", {
|
|
1859
|
-
r: "30",
|
|
1860
|
-
cx: "30",
|
|
1861
|
-
cy: "30",
|
|
1862
|
-
stroke: "currentColor",
|
|
1863
|
-
"stroke-width": "8",
|
|
1864
|
-
"stroke-linecap": "butt",
|
|
1865
|
-
"stroke-dashoffset": i(p),
|
|
1866
|
-
fill: "transparent",
|
|
1867
|
-
"stroke-dasharray": "187"
|
|
1868
|
-
}, null, 8, _s)
|
|
1869
|
-
]))
|
|
1870
|
-
])
|
|
1871
|
-
]),
|
|
1872
|
-
_: 2
|
|
1873
|
-
}, 1040, ["onClick"])
|
|
1874
|
-
])
|
|
1875
|
-
])
|
|
1876
|
-
]),
|
|
1877
|
-
dialog: y((p) => [
|
|
1878
|
-
a("div", {
|
|
1879
|
-
class: E(["flex justify-center relative mx-2 my-6", r(p).disabled ? "opacity-40" : ""])
|
|
1880
|
-
}, [
|
|
1881
|
-
f[4] || (f[4] = a("div", { class: "absolute h-10 w-full top-0 left-0 bg-gray-400 dark:bg-gray-700 z-0 rounded-md" }, null, -1)),
|
|
1882
|
-
a("div", {
|
|
1883
|
-
class: "absolute h-10 top-0 left-0 bg-blue-600 dark:bg-blue-400 z-0 rounded-md transition-[width_0.3s_linear]",
|
|
1884
|
-
style: ne(`width: ${o(p)}%`)
|
|
1885
|
-
}, null, 4),
|
|
1886
|
-
a("div", ws, C(o(p)) + " %", 1),
|
|
1887
|
-
a("input", U({ type: "range" }, r(p), {
|
|
1888
|
-
class: "w-full h-10 z-10 appearance-none opacity-0",
|
|
1889
|
-
onChange: u
|
|
1890
|
-
}), null, 16)
|
|
1891
|
-
], 2)
|
|
1892
|
-
]),
|
|
1893
|
-
_: 3
|
|
1894
|
-
}, 16));
|
|
1895
|
-
}
|
|
1896
|
-
}), Ga = /* @__PURE__ */ B({
|
|
1897
|
-
__name: "CardInfo",
|
|
1898
|
-
props: {
|
|
1899
|
-
size: {},
|
|
1900
|
-
id: {},
|
|
1901
|
-
name: {},
|
|
1902
|
-
type: {},
|
|
1903
|
-
icon: {},
|
|
1904
|
-
value: {},
|
|
1905
|
-
valueTo: {},
|
|
1906
|
-
opts: {},
|
|
1907
|
-
args: {},
|
|
1908
|
-
set: {},
|
|
1909
|
-
get: {},
|
|
1910
|
-
getTo: {}
|
|
1911
|
-
},
|
|
1912
|
-
emits: ["edit", "close", "click", "clone", "open", "setState"],
|
|
1913
|
-
setup(e, { emit: n }) {
|
|
1914
|
-
const l = e, s = n;
|
|
1915
|
-
return (t, o) => (m(), A(me, U(l, {
|
|
1916
|
-
onClick: o[0] || (o[0] = (i) => s("click", i)),
|
|
1917
|
-
onEdit: o[1] || (o[1] = (i) => s("edit", i)),
|
|
1918
|
-
onClone: o[2] || (o[2] = (i) => s("clone", i))
|
|
1919
|
-
}), {
|
|
1920
|
-
icon: y((i) => [
|
|
1921
|
-
_(t.$slots, "icon", q(G(i)))
|
|
1922
|
-
]),
|
|
1923
|
-
default: y(() => [
|
|
1924
|
-
_(t.$slots, "dialog")
|
|
1925
|
-
]),
|
|
1926
|
-
_: 3
|
|
1927
|
-
}, 16));
|
|
1928
|
-
}
|
|
1929
|
-
}), Cs = { class: "flex justify-center relative mx-2 my-6" }, Za = /* @__PURE__ */ B({
|
|
1930
|
-
__name: "CardInput",
|
|
1931
|
-
props: {
|
|
1932
|
-
size: {},
|
|
1933
|
-
id: {},
|
|
1934
|
-
name: {},
|
|
1935
|
-
type: {},
|
|
1936
|
-
icon: {},
|
|
1937
|
-
value: {},
|
|
1938
|
-
valueTo: {},
|
|
1939
|
-
opts: {},
|
|
1940
|
-
args: {},
|
|
1941
|
-
set: {},
|
|
1942
|
-
get: {},
|
|
1943
|
-
getTo: {}
|
|
1944
|
-
},
|
|
1945
|
-
emits: ["edit", "close", "click", "clone", "open", "setState"],
|
|
1946
|
-
setup(e, { emit: n }) {
|
|
1947
|
-
const l = e, s = n, t = O(l.value || ""), o = ({ name: r, opts: u = {} }) => {
|
|
1948
|
-
const { disabled: c } = u;
|
|
1949
|
-
return { label: r, disabled: c };
|
|
1950
|
-
}, i = (r) => s("setState", r.target.value);
|
|
1951
|
-
return ue(
|
|
1952
|
-
() => l.value,
|
|
1953
|
-
(r) => {
|
|
1954
|
-
t.value = r;
|
|
1955
|
-
}
|
|
1956
|
-
), (r, u) => {
|
|
1957
|
-
const c = lt;
|
|
1958
|
-
return m(), A(me, U(l, {
|
|
1959
|
-
onClick: u[1] || (u[1] = (d) => s("click", d)),
|
|
1960
|
-
onEdit: u[2] || (u[2] = (d) => s("edit", d)),
|
|
1961
|
-
onClone: u[3] || (u[3] = (d) => s("clone", d))
|
|
1962
|
-
}), {
|
|
1963
|
-
icon: y((d) => [
|
|
1964
|
-
_(r.$slots, "icon", q(G(d)))
|
|
1965
|
-
]),
|
|
1966
|
-
dialog: y((d) => [
|
|
1967
|
-
a("div", Cs, [
|
|
1968
|
-
b(Y, U({
|
|
1969
|
-
modelValue: t.value,
|
|
1970
|
-
"onUpdate:modelValue": u[0] || (u[0] = (f) => t.value = f)
|
|
1971
|
-
}, o(d), {
|
|
1972
|
-
onEnter: i,
|
|
1973
|
-
onBlur: i
|
|
1974
|
-
}), {
|
|
1975
|
-
icon: y(() => [
|
|
1976
|
-
b(c, { class: "size-8" })
|
|
1977
|
-
]),
|
|
1978
|
-
_: 1
|
|
1979
|
-
}, 16, ["modelValue"])
|
|
1980
|
-
])
|
|
1981
|
-
]),
|
|
1982
|
-
_: 3
|
|
1983
|
-
}, 16);
|
|
1984
|
-
};
|
|
1985
|
-
}
|
|
1986
|
-
}), zs = {
|
|
1987
|
-
viewBox: "0 0 24 24",
|
|
1988
|
-
width: "1.2em",
|
|
1989
|
-
height: "1.2em"
|
|
1990
|
-
};
|
|
1991
|
-
function Ss(e, n) {
|
|
1992
|
-
return m(), v("svg", zs, [...n[0] || (n[0] = [
|
|
1993
|
-
a("path", {
|
|
1994
|
-
fill: "currentColor",
|
|
1995
|
-
d: "M8 4h13v2H8zm-5-.5h3v3H3zm0 7h3v3H3zm0 7h3v3H3zM8 11h13v2H8zm0 7h13v2H8z"
|
|
1996
|
-
}, null, -1)
|
|
1997
|
-
])]);
|
|
1998
|
-
}
|
|
1999
|
-
const Vs = K({ name: "ri-list-check", render: Ss }), Bs = { class: "flex justify-center py-4" }, Ja = /* @__PURE__ */ B({
|
|
2000
|
-
__name: "CardList",
|
|
2001
|
-
props: {
|
|
2002
|
-
size: {},
|
|
2003
|
-
id: {},
|
|
2004
|
-
name: {},
|
|
2005
|
-
type: {},
|
|
2006
|
-
icon: {},
|
|
2007
|
-
value: {},
|
|
2008
|
-
valueTo: {},
|
|
2009
|
-
opts: {},
|
|
2010
|
-
args: {},
|
|
2011
|
-
set: {},
|
|
2012
|
-
get: {},
|
|
2013
|
-
getTo: {}
|
|
2014
|
-
},
|
|
2015
|
-
emits: ["edit", "close", "click", "clone", "open", "setState"],
|
|
2016
|
-
setup(e, { emit: n }) {
|
|
2017
|
-
const l = e, s = n, t = ({ value: r }) => s("setState", r), o = ({ opts: r, value: u }) => {
|
|
2018
|
-
var c;
|
|
2019
|
-
return Array.isArray(r == null ? void 0 : r.items) && ((c = r == null ? void 0 : r.items.find((d) => d.value == u)) == null ? void 0 : c.name) || u;
|
|
2020
|
-
}, i = ({ name: r, value: u, opts: c = {} }) => {
|
|
2021
|
-
var g;
|
|
2022
|
-
const { items: d = [], disabled: f } = c, p = ((g = d.find((h) => h.value == u)) == null ? void 0 : g.name) || u;
|
|
2023
|
-
return { label: r, modelValue: p, items: d, disabled: !!f };
|
|
2024
|
-
};
|
|
2025
|
-
return (r, u) => {
|
|
2026
|
-
const c = Vs;
|
|
2027
|
-
return m(), A(me, U(l, {
|
|
2028
|
-
onClick: u[1] || (u[1] = (d) => s("click", d)),
|
|
2029
|
-
onEdit: u[2] || (u[2] = (d) => s("edit", d)),
|
|
2030
|
-
onClone: u[3] || (u[3] = (d) => s("clone", d))
|
|
2031
|
-
}), {
|
|
2032
|
-
icon: y((d) => [
|
|
2033
|
-
_(r.$slots, "icon", q(G(d)))
|
|
2034
|
-
]),
|
|
2035
|
-
value: y((d) => [
|
|
2036
|
-
H(C(o(d)), 1)
|
|
2037
|
-
]),
|
|
2038
|
-
"dialog-value": y((d) => [
|
|
2039
|
-
H(C(o(d)), 1)
|
|
2040
|
-
]),
|
|
2041
|
-
header: y((d) => [
|
|
2042
|
-
a("div", {
|
|
2043
|
-
onClick: u[0] || (u[0] = F(() => {
|
|
2044
|
-
}, ["prevent", "stop"]))
|
|
2045
|
-
}, [
|
|
2046
|
-
b(se, U(i(d), {
|
|
2047
|
-
"is-popup": "",
|
|
2048
|
-
top: "0",
|
|
2049
|
-
left: "-115px",
|
|
2050
|
-
onChange: t
|
|
2051
|
-
}), {
|
|
2052
|
-
activator: y(({ on: f }) => [
|
|
2053
|
-
b(j, {
|
|
2054
|
-
type: "icon",
|
|
2055
|
-
class: "text-gray-500",
|
|
2056
|
-
onClick: F(f.click, ["stop"])
|
|
2057
|
-
}, {
|
|
2058
|
-
default: y(() => [
|
|
2059
|
-
b(c, { class: "size-6" })
|
|
2060
|
-
]),
|
|
2061
|
-
_: 1
|
|
2062
|
-
}, 8, ["onClick"])
|
|
2063
|
-
]),
|
|
2064
|
-
_: 1
|
|
2065
|
-
}, 16)
|
|
2066
|
-
])
|
|
2067
|
-
]),
|
|
2068
|
-
dialog: y((d) => [
|
|
2069
|
-
a("div", Bs, [
|
|
2070
|
-
b(se, U(i(d), {
|
|
2071
|
-
top: "-50%",
|
|
2072
|
-
left: "50%",
|
|
2073
|
-
onChange: t
|
|
2074
|
-
}), null, 16)
|
|
2075
|
-
])
|
|
2076
|
-
]),
|
|
2077
|
-
_: 3
|
|
2078
|
-
}, 16);
|
|
2079
|
-
};
|
|
2080
|
-
}
|
|
2081
|
-
}), Es = {
|
|
2082
|
-
viewBox: "0 0 24 24",
|
|
2083
|
-
width: "1.2em",
|
|
2084
|
-
height: "1.2em"
|
|
2085
|
-
};
|
|
2086
|
-
function Ts(e, n) {
|
|
2087
|
-
return m(), v("svg", Es, [...n[0] || (n[0] = [
|
|
2088
|
-
a("path", {
|
|
2089
|
-
fill: "currentColor",
|
|
2090
|
-
d: "M15.5 5a3.5 3.5 0 1 0 0 7a3.5 3.5 0 0 0 0-7M10 8.5a5.5 5.5 0 1 1 10.032 3.117l2.675 2.676l-1.414 1.414l-2.675-2.675A5.5 5.5 0 0 1 10 8.5M3 4h5v2H3zm0 7h5v2H3zm18 7v2H3v-2z"
|
|
2091
|
-
}, null, -1)
|
|
2092
|
-
])]);
|
|
2093
|
-
}
|
|
2094
|
-
const Ls = K({ name: "ri-menu-search-line", render: Ts }), Ms = {
|
|
2095
|
-
viewBox: "0 0 24 24",
|
|
2096
|
-
width: "1.2em",
|
|
2097
|
-
height: "1.2em"
|
|
2098
|
-
};
|
|
2099
|
-
function As(e, n) {
|
|
2100
|
-
return m(), v("svg", Ms, [...n[0] || (n[0] = [
|
|
2101
|
-
a("path", {
|
|
2102
|
-
fill: "currentColor",
|
|
2103
|
-
d: "M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"
|
|
2104
|
-
}, null, -1)
|
|
2105
|
-
])]);
|
|
2106
|
-
}
|
|
2107
|
-
const ze = K({ name: "ri-add-line", render: As }), Ds = { class: "flex w-full relative" }, Is = { class: "flex gap-2 flex-wrap flex-auto px-2 py-1" }, Os = ["disabled"], st = /* @__PURE__ */ B({
|
|
2108
|
-
__name: "VTextWrapper",
|
|
2109
|
-
props: {
|
|
2110
|
-
active: { type: Boolean },
|
|
2111
|
-
label: { default: "label" },
|
|
2112
|
-
disabled: { type: Boolean, default: !1 },
|
|
2113
|
-
hideIcon: { type: Boolean, default: !1 }
|
|
2114
|
-
},
|
|
2115
|
-
emits: ["icon"],
|
|
2116
|
-
setup(e, { emit: n }) {
|
|
2117
|
-
const l = n, s = M(() => e.active ? "top-0 left-3 text-xs" : "top-1/2"), t = M(() => [e.disabled ? "border-gray-400 opacity-40" : "border-gray-300 hover:border-gray-400 dark:border-gray-700/50 hover:dark:border-gray-600/50"]);
|
|
2118
|
-
return (o, i) => {
|
|
2119
|
-
const r = ze;
|
|
2120
|
-
return m(), v("div", Ds, [
|
|
2121
|
-
a("div", {
|
|
2122
|
-
class: E(["relative w-full min-h-[40px] border border-gray-300 dark:border-gray-700 flex items-center rounded transition bg-white dark:bg-gray-800", t.value])
|
|
2123
|
-
}, [
|
|
2124
|
-
a("span", {
|
|
2125
|
-
class: E(["absolute left-4 transition-all rounded -translate-y-1/2 text-gray-600 dark:text-gray-400", s.value])
|
|
2126
|
-
}, C(e.label), 3),
|
|
2127
|
-
a("div", Is, [
|
|
2128
|
-
_(o.$slots, "default")
|
|
2129
|
-
]),
|
|
2130
|
-
e.hideIcon ? T("", !0) : (m(), v("button", {
|
|
2131
|
-
key: 0,
|
|
2132
|
-
disabled: e.disabled,
|
|
2133
|
-
class: E([{ "cursor-pointer": !e.disabled }, "h-full flex items-center justify-center text-gray-400 border-l border-gray-300 dark:border-gray-700/50 flex-[0_0_50px]"]),
|
|
2134
|
-
onClick: i[0] || (i[0] = (u) => l("icon", u))
|
|
2135
|
-
}, [
|
|
2136
|
-
_(o.$slots, "icon", {}, () => [
|
|
2137
|
-
b(r, { class: "size-4" })
|
|
2138
|
-
])
|
|
2139
|
-
], 10, Os))
|
|
2140
|
-
], 2)
|
|
2141
|
-
]);
|
|
2142
|
-
};
|
|
2143
|
-
}
|
|
2144
|
-
}), js = {
|
|
2145
|
-
viewBox: "0 0 24 24",
|
|
2146
|
-
width: "1.2em",
|
|
2147
|
-
height: "1.2em"
|
|
2148
|
-
};
|
|
2149
|
-
function Ps(e, n) {
|
|
2150
|
-
return m(), v("svg", js, [...n[0] || (n[0] = [
|
|
2151
|
-
a("path", {
|
|
2152
|
-
fill: "currentColor",
|
|
2153
|
-
d: "M7 6V3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-3v3c0 .552-.45 1-1.007 1H4.007A1 1 0 0 1 3 21l.003-14c0-.552.45-1 1.006-1zM5.002 8L5 20h10V8zM9 6h8v10h2V4H9z"
|
|
2154
|
-
}, null, -1)
|
|
2155
|
-
])]);
|
|
2156
|
-
}
|
|
2157
|
-
const Hs = K({ name: "ri-file-copy-line", render: Ps }), Ns = {
|
|
2158
|
-
viewBox: "0 0 24 24",
|
|
2159
|
-
width: "1.2em",
|
|
2160
|
-
height: "1.2em"
|
|
2161
|
-
};
|
|
2162
|
-
function Fs(e, n) {
|
|
2163
|
-
return m(), v("svg", Ns, [...n[0] || (n[0] = [
|
|
2164
|
-
a("path", {
|
|
2165
|
-
fill: "currentColor",
|
|
2166
|
-
d: "M2 4a1 1 0 0 1 1-1h7.414l2 2H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3c-.55 0-1-.45-1-1zm8.586 2l-1-1H4v2h5.586zM4 9v10h16V7h-7.586l-2 2z"
|
|
2167
|
-
}, null, -1)
|
|
2168
|
-
])]);
|
|
2169
|
-
}
|
|
2170
|
-
const Rs = K({ name: "ri-folder6-line", render: Fs }), Us = ["onClick"], Ks = {
|
|
2171
|
-
key: 0,
|
|
2172
|
-
class: "me-1"
|
|
2173
|
-
}, Ws = { class: "dark:text-gray-300" }, qs = { class: "flex gap-3 items-center z-10" }, Gs = {
|
|
2174
|
-
key: 0,
|
|
2175
|
-
class: "flex ps-5"
|
|
2176
|
-
}, Zs = { class: "font-medium dark:text-gray-300" }, ot = /* @__PURE__ */ B({
|
|
2177
|
-
__name: "VListObject",
|
|
2178
|
-
props: {
|
|
2179
|
-
items: { default: () => ({}) },
|
|
2180
|
-
path: { default: "" },
|
|
2181
|
-
onlyValue: { type: Boolean, default: !1 }
|
|
2182
|
-
},
|
|
2183
|
-
emits: ["click"],
|
|
2184
|
-
setup(e, { emit: n }) {
|
|
2185
|
-
const l = n, s = () => "before:absolute before:w-full before:h-8 before:t-0 before:left-0 before:border-b before:border-gray-200 dark:before:border-gray-800/50 hover:before:bg-gray-400/10", t = O({}), { text: o, copy: i, copied: r, isSupported: u } = $t(), c = (g) => {
|
|
2186
|
-
t.value[g] = !t.value[g];
|
|
2187
|
-
}, d = (g) => typeof g == "object", f = (g) => `${e.path ? e.path + "." : ""}${g}`, p = (g, h) => {
|
|
2188
|
-
l("click", { key: g, path: f(g), isObject: h });
|
|
2189
|
-
};
|
|
2190
|
-
return (g, h) => {
|
|
2191
|
-
const $ = Rs, k = Hs, z = ze;
|
|
2192
|
-
return m(), v("ul", null, [
|
|
2193
|
-
(m(!0), v(N, null, W(e.items, (S, P) => (m(), v("li", {
|
|
2194
|
-
key: P,
|
|
2195
|
-
class: E(d(S) ? "" : `flex items-center ${s()}`)
|
|
2196
|
-
}, [
|
|
2197
|
-
a("div", {
|
|
2198
|
-
class: E(["flex items-center cursor-pointer ps-2 h-8", d(S) ? `${s()}` : ""]),
|
|
2199
|
-
onClick: (X) => c(P)
|
|
2200
|
-
}, [
|
|
2201
|
-
d(S) ? (m(), v("div", Ks, [
|
|
2202
|
-
b($, { class: "size-5" })
|
|
2203
|
-
])) : T("", !0),
|
|
2204
|
-
a("div", Ws, C(P), 1),
|
|
2205
|
-
L(u) ? (m(), A(j, {
|
|
2206
|
-
key: 1,
|
|
2207
|
-
class: "opacity-20 hover:opacity-70 transition-all",
|
|
2208
|
-
color: "transparent",
|
|
2209
|
-
size: "sm",
|
|
2210
|
-
onClick: F((X) => L(i)(f(P)), ["stop"])
|
|
2211
|
-
}, {
|
|
2212
|
-
default: y(() => [
|
|
2213
|
-
b(k, { class: "size-5" })
|
|
2214
|
-
]),
|
|
2215
|
-
_: 1
|
|
2216
|
-
}, 8, ["onClick"])) : T("", !0),
|
|
2217
|
-
L(o) === f(P) ? (m(), v("span", {
|
|
2218
|
-
key: 2,
|
|
2219
|
-
class: E(["text-gray-500 transition-all duration-1000 text-sm", L(r) ? "opacity-100" : "opacity-0"])
|
|
2220
|
-
}, C(g.$t("copied")), 3)) : T("", !0),
|
|
2221
|
-
!e.onlyValue && d(S) ? (m(), v(N, { key: 3 }, [
|
|
2222
|
-
h[1] || (h[1] = a("div", { class: "flex-auto" }, null, -1)),
|
|
2223
|
-
a("div", qs, [
|
|
2224
|
-
b(j, {
|
|
2225
|
-
class: "opacity-20 hover:opacity-70 transition-all",
|
|
2226
|
-
color: "transparent",
|
|
2227
|
-
size: "sm",
|
|
2228
|
-
title: g.$t("add"),
|
|
2229
|
-
onClick: F((X) => p(P, d(S)), ["stop"])
|
|
2230
|
-
}, {
|
|
2231
|
-
default: y(() => [
|
|
2232
|
-
b(z, { class: "size-5" })
|
|
2233
|
-
]),
|
|
2234
|
-
_: 1
|
|
2235
|
-
}, 8, ["title", "onClick"])
|
|
2236
|
-
])
|
|
2237
|
-
], 64)) : T("", !0)
|
|
2238
|
-
], 10, Us),
|
|
2239
|
-
d(S) ? (m(), v("div", Gs, [
|
|
2240
|
-
Te(b(ot, {
|
|
2241
|
-
class: "flex-auto",
|
|
2242
|
-
path: f(P),
|
|
2243
|
-
items: S,
|
|
2244
|
-
onlyValue: e.onlyValue,
|
|
2245
|
-
onClick: h[0] || (h[0] = (X) => l("click", X))
|
|
2246
|
-
}, null, 8, ["path", "items", "onlyValue"]), [
|
|
2247
|
-
[ht, t.value[P]]
|
|
2248
|
-
])
|
|
2249
|
-
])) : (m(), v(N, { key: 1 }, [
|
|
2250
|
-
h[2] || (h[2] = a("div", { class: "flex-auto gap-3" }, null, -1)),
|
|
2251
|
-
a("div", Zs, C(S), 1),
|
|
2252
|
-
b(j, {
|
|
2253
|
-
class: "opacity-20 hover:opacity-70 transition-all",
|
|
2254
|
-
color: "gray",
|
|
2255
|
-
size: "sm",
|
|
2256
|
-
title: g.$t("add"),
|
|
2257
|
-
onClick: F((X) => p(P, d(S)), ["stop"])
|
|
2258
|
-
}, {
|
|
2259
|
-
default: y(() => [
|
|
2260
|
-
b(z, { class: "size-5" })
|
|
2261
|
-
]),
|
|
2262
|
-
_: 1
|
|
2263
|
-
}, 8, ["title", "onClick"])
|
|
2264
|
-
], 64))
|
|
2265
|
-
], 2))), 128))
|
|
2266
|
-
]);
|
|
2267
|
-
};
|
|
2268
|
-
}
|
|
2269
|
-
}), Js = { class: "" }, Xs = { class: "flex border-b border-gray-200 dark:border-gray-700" }, Ys = ["onClick"], Qs = { class: "px-4 py-2" }, eo = { class: "relative my-4" }, to = { key: 0 }, no = /* @__PURE__ */ B({
|
|
2270
|
-
__name: "VTabs",
|
|
2271
|
-
props: {
|
|
2272
|
-
value: {},
|
|
2273
|
-
items: {}
|
|
2274
|
-
},
|
|
2275
|
-
emits: ["click"],
|
|
2276
|
-
setup(e, { expose: n, emit: l }) {
|
|
2277
|
-
const s = l, t = O(e.value || 0), o = (r) => [t.value === r ? "" : "before:hidden"], i = (r) => {
|
|
2278
|
-
t.value = r, s("click", r);
|
|
2279
|
-
};
|
|
2280
|
-
return n({
|
|
2281
|
-
setActiveTab: i,
|
|
2282
|
-
activeTab: t
|
|
2283
|
-
}), (r, u) => (m(), v("div", Js, [
|
|
2284
|
-
a("div", Xs, [
|
|
2285
|
-
(m(!0), v(N, null, W(e.items, (c, d) => (m(), v("div", {
|
|
2286
|
-
key: d,
|
|
2287
|
-
class: "relative flex-auto"
|
|
2288
|
-
}, [
|
|
2289
|
-
a("button", {
|
|
2290
|
-
class: "w-full",
|
|
2291
|
-
onClick: (f) => i(d)
|
|
2292
|
-
}, [
|
|
2293
|
-
a("div", {
|
|
2294
|
-
class: E([o(d), "font-medium text-lg transition cursor-pointer before:h-[2px] before:absolute before:w-full before:bg-blue-700 before:left-0 before:bottom-0"])
|
|
2295
|
-
}, [
|
|
2296
|
-
_(r.$slots, "header", {
|
|
2297
|
-
tab: c,
|
|
2298
|
-
i: d
|
|
2299
|
-
}, () => [
|
|
2300
|
-
a("div", Qs, C(c.title), 1)
|
|
2301
|
-
])
|
|
2302
|
-
], 2)
|
|
2303
|
-
], 8, Ys)
|
|
2304
|
-
]))), 128))
|
|
2305
|
-
]),
|
|
2306
|
-
a("div", eo, [
|
|
2307
|
-
(m(!0), v(N, null, W(e.items, (c, d) => (m(), v("div", {
|
|
2308
|
-
key: d,
|
|
2309
|
-
class: "tab-panel"
|
|
2310
|
-
}, [
|
|
2311
|
-
b(de, {
|
|
2312
|
-
"enter-active-class": "transition-all duration-300 ease-out",
|
|
2313
|
-
"enter-from-class": "transform opacity-0 translate-x-2",
|
|
2314
|
-
"enter-to-class": "transform opacity-100 translate-x-0",
|
|
2315
|
-
"leave-active-class": "transition-all duration-0 ease-in absolute inset-0",
|
|
2316
|
-
"leave-from-class": "transform opacity-100 translate-x-0",
|
|
2317
|
-
"leave-to-class": "transform opacity-0 -translate-x-2"
|
|
2318
|
-
}, {
|
|
2319
|
-
default: y(() => [
|
|
2320
|
-
t.value === d ? (m(), v("div", to, [
|
|
2321
|
-
_(r.$slots, `tab-${d}`)
|
|
2322
|
-
])) : T("", !0)
|
|
2323
|
-
]),
|
|
2324
|
-
_: 2
|
|
2325
|
-
}, 1024)
|
|
2326
|
-
]))), 128))
|
|
2327
|
-
])
|
|
2328
|
-
]));
|
|
2329
|
-
}
|
|
2330
|
-
}), lo = { class: "flex gap-1 text-amber-500 self-start text-nowrap select-none" }, so = ["title", "onMouseenter", "onMouseleave"], oo = { class: "flex flex-auto" }, ao = ["disabled"], Se = /* @__PURE__ */ B({
|
|
2331
|
-
__name: "VFunc",
|
|
2332
|
-
props: {
|
|
2333
|
-
label: {},
|
|
2334
|
-
args: {},
|
|
2335
|
-
value: {},
|
|
2336
|
-
disabled: { type: Boolean, default: !1 },
|
|
2337
|
-
hideIcon: { type: Boolean, default: !1 }
|
|
2338
|
-
},
|
|
2339
|
-
emits: ["change", "icon", "hover"],
|
|
2340
|
-
setup(e, { emit: n }) {
|
|
2341
|
-
const l = n, s = ["v", "a", "b", "c"], t = O(e.value || ""), o = (u) => {
|
|
2342
|
-
try {
|
|
2343
|
-
return new Function(u), !0;
|
|
2344
|
-
} catch (c) {
|
|
2345
|
-
return console.warn(c), !1;
|
|
2346
|
-
}
|
|
2347
|
-
}, i = Le((u) => {
|
|
2348
|
-
const c = u.target;
|
|
2349
|
-
o(c.value) && l("change", c.value);
|
|
2350
|
-
}, 500), r = (u) => l("icon", u);
|
|
2351
|
-
return ue(
|
|
2352
|
-
() => e.value,
|
|
2353
|
-
() => {
|
|
2354
|
-
e.value && (t.value = e.value);
|
|
2355
|
-
}
|
|
2356
|
-
), (u, c) => {
|
|
2357
|
-
const d = oe, f = ze;
|
|
2358
|
-
return m(), A(st, {
|
|
2359
|
-
active: !!e.value,
|
|
2360
|
-
disabled: e.disabled,
|
|
2361
|
-
label: e.label,
|
|
2362
|
-
hideIcon: e.hideIcon,
|
|
2363
|
-
onIcon: r
|
|
2364
|
-
}, {
|
|
2365
|
-
icon: y(() => [
|
|
2366
|
-
e.value ? (m(), A(d, {
|
|
2367
|
-
key: 0,
|
|
2368
|
-
class: "size-4"
|
|
2369
|
-
})) : (m(), A(f, {
|
|
2370
|
-
key: 1,
|
|
2371
|
-
class: "size-4"
|
|
2372
|
-
}))
|
|
2373
|
-
]),
|
|
2374
|
-
default: y(() => [
|
|
2375
|
-
e.value ? (m(), v(N, { key: 0 }, [
|
|
2376
|
-
a("div", lo, [
|
|
2377
|
-
c[3] || (c[3] = H(" ( ", -1)),
|
|
2378
|
-
(m(!0), v(N, null, W(e.args, (p, g) => (m(), v(N, { key: p }, [
|
|
2379
|
-
a("span", {
|
|
2380
|
-
class: "text-blue-400/80",
|
|
2381
|
-
title: p,
|
|
2382
|
-
onMouseenter: (h) => l("hover", "enter", g),
|
|
2383
|
-
onMouseleave: (h) => l("hover", "leave", g)
|
|
2384
|
-
}, C(s[g]), 41, so),
|
|
2385
|
-
c[2] || (c[2] = a("span", { class: "last:hidden" }, ",", -1))
|
|
2386
|
-
], 64))), 128)),
|
|
2387
|
-
c[4] || (c[4] = H(" ) => ", -1))
|
|
2388
|
-
]),
|
|
2389
|
-
a("div", oo, [
|
|
2390
|
-
Te(a("textarea", {
|
|
2391
|
-
"onUpdate:modelValue": c[0] || (c[0] = (p) => t.value = p),
|
|
2392
|
-
class: "outline-0 w-full resize-none field-sizing-content",
|
|
2393
|
-
type: "text",
|
|
2394
|
-
disabled: e.disabled,
|
|
2395
|
-
onInput: c[1] || (c[1] = //@ts-ignore
|
|
2396
|
-
(...p) => L(i) && L(i)(...p))
|
|
2397
|
-
}, null, 40, ao), [
|
|
2398
|
-
[gt, t.value]
|
|
2399
|
-
])
|
|
2400
|
-
])
|
|
2401
|
-
], 64)) : T("", !0)
|
|
2402
|
-
]),
|
|
2403
|
-
_: 1
|
|
2404
|
-
}, 8, ["active", "disabled", "label", "hideIcon"]);
|
|
2405
|
-
};
|
|
2406
|
-
}
|
|
2407
|
-
}), io = ["checked", "disabled"], ro = { class: "text-sm ms-2 peer-disabled:opacity-40" }, co = /* @__PURE__ */ B({
|
|
2408
|
-
__name: "VCheckbox",
|
|
2409
|
-
props: {
|
|
2410
|
-
modelValue: { type: [Number, Boolean], default: !1 },
|
|
2411
|
-
disabled: { type: Boolean, default: !1 }
|
|
2412
|
-
},
|
|
2413
|
-
emits: ["update:modelValue", "click"],
|
|
2414
|
-
setup(e, { emit: n }) {
|
|
2415
|
-
const l = n, s = (o) => {
|
|
2416
|
-
const i = o.target;
|
|
2417
|
-
l("update:modelValue", i.checked);
|
|
2418
|
-
}, t = (o) => l("click", o);
|
|
2419
|
-
return (o, i) => (m(), v("label", {
|
|
2420
|
-
class: E(["inline-flex items-center relative", { "cursor-pointer": !e.disabled }]),
|
|
2421
|
-
onClick: t
|
|
2422
|
-
}, [
|
|
2423
|
-
a("input", {
|
|
2424
|
-
type: "checkbox",
|
|
2425
|
-
checked: !!e.modelValue,
|
|
2426
|
-
disabled: e.disabled,
|
|
2427
|
-
class: "peer size-5 transition-all appearance-none rounded border border-gray-300 dark:border-gray-700 disabled:opacity-40 not-disabled:cursor-pointer",
|
|
2428
|
-
onChange: s
|
|
2429
|
-
}, null, 40, io),
|
|
2430
|
-
i[0] || (i[0] = a("button", { class: "absolute opacity-0 peer-checked:opacity-100 peer-disabled:opacity-40 top-1/2 left-[10px] transform -translate-x-1/2 -translate-y-1/2 pointer-events-none" }, [
|
|
2431
|
-
a("svg", {
|
|
2432
|
-
class: "h-3.5 w-3.5",
|
|
2433
|
-
viewBox: "0 0 20 20",
|
|
2434
|
-
fill: "currentColor",
|
|
2435
|
-
stroke: "currentColor",
|
|
2436
|
-
"stroke-width": "1"
|
|
2437
|
-
}, [
|
|
2438
|
-
a("path", {
|
|
2439
|
-
"fill-rule": "evenodd",
|
|
2440
|
-
d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",
|
|
2441
|
-
"clip-rule": "evenodd"
|
|
2442
|
-
})
|
|
2443
|
-
])
|
|
2444
|
-
], -1)),
|
|
2445
|
-
a("span", ro, [
|
|
2446
|
-
_(o.$slots, "default")
|
|
2447
|
-
])
|
|
2448
|
-
], 2));
|
|
2449
|
-
}
|
|
2450
|
-
}), uo = { class: "flex flex-col" }, fo = { class: "flex gap-4 mb-6" }, mo = {
|
|
2451
|
-
key: 0,
|
|
2452
|
-
class: "flex gap-4"
|
|
2453
|
-
}, vo = {
|
|
2454
|
-
key: 1,
|
|
2455
|
-
class: ""
|
|
2456
|
-
}, po = { class: "flex flex-col md:flex-row gap-4" }, ho = { class: "flex gap-4" }, go = { class: "flex justify-between flex-auto" }, bo = ["onClick"], yo = /* @__PURE__ */ B({
|
|
2457
|
-
__name: "ItemOptions",
|
|
2458
|
-
props: {
|
|
2459
|
-
min: { default: 0 },
|
|
2460
|
-
max: { default: 255 },
|
|
2461
|
-
step: { default: 1 },
|
|
2462
|
-
disabled: {},
|
|
2463
|
-
items: { default: () => [] },
|
|
2464
|
-
value: {},
|
|
2465
|
-
type: {}
|
|
2466
|
-
},
|
|
2467
|
-
emits: ["update"],
|
|
2468
|
-
setup(e, { emit: n }) {
|
|
2469
|
-
const l = n, s = M(() => e.items.map((h, $) => ({ ...h, id: ++$ }))), t = O({ name: "", value: "" }), o = M(() => e.items.length + 1), i = M(() => {
|
|
2470
|
-
var h;
|
|
2471
|
-
return !((h = t.value) != null && h.id);
|
|
2472
|
-
}), r = (h) => e.type === h, u = (h, $) => l("update", h, $), c = (h) => h.map(({ name: $, value: k }) => ({ name: $, value: k })), d = ({ id: h, name: $, value: k }) => t.value = { id: h, name: $, value: k }, f = () => {
|
|
2473
|
-
const h = o.value;
|
|
2474
|
-
t.value = { name: `New_${h}`, value: `${h}`, id: h }, u("items", c([...s.value, t.value]));
|
|
2475
|
-
}, p = (h) => {
|
|
2476
|
-
t.value.name === h.name && (t.value = { name: "", value: "" }), u("items", c(s.value.filter(($) => $.value !== h.value)));
|
|
2477
|
-
}, g = Le(() => {
|
|
2478
|
-
const h = t.value;
|
|
2479
|
-
if (!h.name || !h.value) return;
|
|
2480
|
-
const $ = s.value.map((k) => k.id === h.id ? h : k);
|
|
2481
|
-
u("items", c($));
|
|
2482
|
-
}, 300);
|
|
2483
|
-
return (h, $) => {
|
|
2484
|
-
const k = oe, z = ze;
|
|
2485
|
-
return m(), v("div", uo, [
|
|
2486
|
-
a("div", fo, [
|
|
2487
|
-
b(co, {
|
|
2488
|
-
modelValue: e.disabled,
|
|
2489
|
-
"onUpdate:modelValue": $[0] || ($[0] = (S) => u("disabled", S ? 1 : 0))
|
|
2490
|
-
}, {
|
|
2491
|
-
default: y(() => [...$[6] || ($[6] = [
|
|
2492
|
-
H("Disabled", -1)
|
|
2493
|
-
])]),
|
|
2494
|
-
_: 1
|
|
2495
|
-
}, 8, ["modelValue"])
|
|
2496
|
-
]),
|
|
2497
|
-
r("dimmer") ? (m(), v("div", mo, [
|
|
2498
|
-
b(Y, {
|
|
2499
|
-
modelValue: e.min,
|
|
2500
|
-
label: "Min",
|
|
2501
|
-
"onUpdate:modelValue": $[1] || ($[1] = (S) => u("min", +S))
|
|
2502
|
-
}, null, 8, ["modelValue"]),
|
|
2503
|
-
b(Y, {
|
|
2504
|
-
modelValue: e.max,
|
|
2505
|
-
label: "Max",
|
|
2506
|
-
"onUpdate:modelValue": $[2] || ($[2] = (S) => u("max", +S))
|
|
2507
|
-
}, null, 8, ["modelValue"]),
|
|
2508
|
-
b(Y, {
|
|
2509
|
-
modelValue: e.step,
|
|
2510
|
-
label: "Step",
|
|
2511
|
-
"onUpdate:modelValue": $[3] || ($[3] = (S) => u("step", +S))
|
|
2512
|
-
}, null, 8, ["modelValue"])
|
|
2513
|
-
])) : T("", !0),
|
|
2514
|
-
r("list") ? (m(), v("div", vo, [
|
|
2515
|
-
a("div", po, [
|
|
2516
|
-
b(Y, {
|
|
2517
|
-
modelValue: t.value.name,
|
|
2518
|
-
"onUpdate:modelValue": [
|
|
2519
|
-
$[4] || ($[4] = (S) => t.value.name = S),
|
|
2520
|
-
L(g)
|
|
2521
|
-
],
|
|
2522
|
-
disabled: i.value,
|
|
2523
|
-
label: "Name"
|
|
2524
|
-
}, null, 8, ["modelValue", "disabled", "onUpdate:modelValue"]),
|
|
2525
|
-
b(Y, {
|
|
2526
|
-
modelValue: t.value.value,
|
|
2527
|
-
"onUpdate:modelValue": [
|
|
2528
|
-
$[5] || ($[5] = (S) => t.value.value = S),
|
|
2529
|
-
L(g)
|
|
2530
|
-
],
|
|
2531
|
-
disabled: i.value,
|
|
2532
|
-
label: "Value"
|
|
2533
|
-
}, null, 8, ["modelValue", "disabled", "onUpdate:modelValue"])
|
|
2534
|
-
]),
|
|
2535
|
-
a("div", ho, [
|
|
2536
|
-
b(se, {
|
|
2537
|
-
"model-value": t.value.value,
|
|
2538
|
-
label: "List",
|
|
2539
|
-
items: s.value,
|
|
2540
|
-
top: "unset",
|
|
2541
|
-
bottom: "0",
|
|
2542
|
-
onChange: d
|
|
2543
|
-
}, {
|
|
2544
|
-
item: y(({ item: S }) => [
|
|
2545
|
-
a("div", go, [
|
|
2546
|
-
a("span", null, C(S.name), 1),
|
|
2547
|
-
a("button", {
|
|
2548
|
-
class: "cursor-pointer size-4",
|
|
2549
|
-
onClick: F((P) => p(S), ["prevent", "stop"])
|
|
2550
|
-
}, [
|
|
2551
|
-
b(k)
|
|
2552
|
-
], 8, bo)
|
|
2553
|
-
])
|
|
2554
|
-
]),
|
|
2555
|
-
_: 1
|
|
2556
|
-
}, 8, ["model-value", "items"]),
|
|
2557
|
-
b(j, {
|
|
2558
|
-
class: "px-4",
|
|
2559
|
-
color: "blue",
|
|
2560
|
-
onClick: f
|
|
2561
|
-
}, {
|
|
2562
|
-
default: y(() => [
|
|
2563
|
-
b(z)
|
|
2564
|
-
]),
|
|
2565
|
-
_: 1
|
|
2566
|
-
})
|
|
2567
|
-
])
|
|
2568
|
-
])) : T("", !0)
|
|
2569
|
-
]);
|
|
2570
|
-
};
|
|
2571
|
-
}
|
|
2572
|
-
}), xo = { class: "flex flex-col" }, $o = { class: "flex flex-col md:flex-row gap-6 min-h-[300px]" }, ko = { class: "flex-auto order-1" }, _o = { class: "flex-auto gap-x-2 order-1" }, wo = { class: "grid grid-cols-1 md:grid-cols-2 gap-6" }, Co = { class: "flex gap-2 items-center" }, zo = { class: "flex flex-col gap-4" }, So = { class: "flex gap-2 flex-wrap flex-auto px-2 py-1" }, Vo = { class: "relative group" }, Bo = { class: "select-none" }, Eo = ["onClick"], To = { class: "flex justify-center order-0 md:order-1 md:mt-11" }, Lo = { class: "flex-[0_0_130px] size-[130px]" }, Mo = { class: "flex gap-4 justify-end" }, Ao = { class: "relative min-h-[200px] max-h-100dvh overflow-auto scrollbar" }, Xa = /* @__PURE__ */ B({
|
|
2573
|
-
__name: "ItemEdit",
|
|
2574
|
-
props: {
|
|
2575
|
-
items: {},
|
|
2576
|
-
item: {},
|
|
2577
|
-
object: {},
|
|
2578
|
-
listDashboard: {},
|
|
2579
|
-
listIcons: {}
|
|
2580
|
-
},
|
|
2581
|
-
emits: ["button"],
|
|
2582
|
-
setup(e, { emit: n }) {
|
|
2583
|
-
const l = n, s = [{ title: "Main" }, { title: "Data" }, { title: "Options" }], t = O({
|
|
2584
|
-
id: "",
|
|
2585
|
-
name: "",
|
|
2586
|
-
type: "button",
|
|
2587
|
-
icon: "bulb",
|
|
2588
|
-
value: "",
|
|
2589
|
-
args: [],
|
|
2590
|
-
set: "",
|
|
2591
|
-
get: "",
|
|
2592
|
-
getTo: ""
|
|
2593
|
-
}), o = O(!1), i = M(() => {
|
|
2594
|
-
var x;
|
|
2595
|
-
return !((x = e.item) != null && x.id);
|
|
2596
|
-
}), r = M(() => !!e.items.filter((x) => {
|
|
2597
|
-
var w;
|
|
2598
|
-
return x.id !== ((w = e.item) == null ? void 0 : w.id);
|
|
2599
|
-
}).find((x) => x.id === (t == null ? void 0 : t.value.id))), u = M(() => t.value.type === "info"), c = M(() => {
|
|
2600
|
-
var x;
|
|
2601
|
-
return (x = t.value.args) == null ? void 0 : x.length;
|
|
2602
|
-
}), d = M(() => t.value.args.length > 3), f = M(() => {
|
|
2603
|
-
if (r.value) return !0;
|
|
2604
|
-
const { id: x, args: w } = t.value;
|
|
2605
|
-
return !x || !w.length;
|
|
2606
|
-
}), p = ({ value: x }) => t.value.icon = x, g = ({ value: x }) => {
|
|
2607
|
-
const w = x;
|
|
2608
|
-
t.value.type = w, delete t.value.opts, ["button", "list", "dimmer"].includes(w) && (x === "button" && (t.value.opts = {}), x === "list" && (t.value.opts = { items: [] }), x === "dimmer" && (t.value.opts = { min: 0, max: 255, step: 1 }));
|
|
2609
|
-
}, h = (x) => {
|
|
2610
|
-
x === "get" && (t.value.get ? delete t.value.get : t.value.get = "v"), x === "set" && (t.value.set ? delete t.value.set : t.value.set = "v"), x === "getTo" && (t.value.getTo ? delete t.value.getTo : t.value.getTo = "v");
|
|
2611
|
-
}, $ = (x) => l("button", x, t.value), k = (x) => t.value.args = t.value.args.filter((w) => w !== x), z = ({ path: x }) => {
|
|
2612
|
-
!t.value.args.length && !t.value.id && (t.value.id = x), t.value.args.push(x), o.value = !1;
|
|
2613
|
-
}, S = O(-1), P = (x) => S.value === x, X = (x, w) => {
|
|
2614
|
-
x === "enter" && (S.value = w), x === "leave" && (S.value = -1);
|
|
2615
|
-
}, V = (x, w) => {
|
|
2616
|
-
x === "set" && (t.value.set = w), x === "get" && (t.value.get = w), x === "getTo" && (t.value.getTo = w), w || delete t.value[x];
|
|
2617
|
-
}, D = () => {
|
|
2618
|
-
o.value = !0;
|
|
2619
|
-
}, R = (x, w) => {
|
|
2620
|
-
t.value.opts || (t.value.opts = {}), t.value.opts[x] = w, x === "disabled" && !w && delete t.value.opts[x];
|
|
2621
|
-
};
|
|
2622
|
-
return fe(() => {
|
|
2623
|
-
var x;
|
|
2624
|
-
(x = e.item) != null && x.id && (t.value = St(e.item));
|
|
2625
|
-
}), (x, w) => {
|
|
2626
|
-
const ae = Ls, ye = oe;
|
|
2627
|
-
return m(), v("div", xo, [
|
|
2628
|
-
a("div", $o, [
|
|
2629
|
-
a("div", ko, [
|
|
2630
|
-
b(no, {
|
|
2631
|
-
class: "flex-auto min-h-75",
|
|
2632
|
-
value: 0,
|
|
2633
|
-
items: s
|
|
2634
|
-
}, {
|
|
2635
|
-
"tab-0": y(() => [
|
|
2636
|
-
a("div", _o, [
|
|
2637
|
-
b(Y, {
|
|
2638
|
-
modelValue: t.value.id,
|
|
2639
|
-
"onUpdate:modelValue": w[0] || (w[0] = (I) => t.value.id = I),
|
|
2640
|
-
label: "ID",
|
|
2641
|
-
message: r.value ? x.$t("used") : ""
|
|
2642
|
-
}, bt({ _: 2 }, [
|
|
2643
|
-
c.value ? void 0 : {
|
|
2644
|
-
name: "icon",
|
|
2645
|
-
fn: y(() => [
|
|
2646
|
-
b(j, {
|
|
2647
|
-
color: "transparent",
|
|
2648
|
-
onClick: D
|
|
2649
|
-
}, {
|
|
2650
|
-
default: y(() => [
|
|
2651
|
-
b(ae)
|
|
2652
|
-
]),
|
|
2653
|
-
_: 1
|
|
2654
|
-
})
|
|
2655
|
-
]),
|
|
2656
|
-
key: "0"
|
|
2657
|
-
}
|
|
2658
|
-
]), 1032, ["modelValue", "message"]),
|
|
2659
|
-
b(Y, {
|
|
2660
|
-
modelValue: t.value.name,
|
|
2661
|
-
"onUpdate:modelValue": w[1] || (w[1] = (I) => t.value.name = I),
|
|
2662
|
-
label: "Name"
|
|
2663
|
-
}, null, 8, ["modelValue"]),
|
|
2664
|
-
a("div", wo, [
|
|
2665
|
-
b(se, {
|
|
2666
|
-
"model-value": t.value.icon,
|
|
2667
|
-
bottom: "0",
|
|
2668
|
-
top: "unset",
|
|
2669
|
-
label: "Icon",
|
|
2670
|
-
class: "mb-6",
|
|
2671
|
-
items: e.listIcons,
|
|
2672
|
-
onChange: p
|
|
2673
|
-
}, {
|
|
2674
|
-
item: y(({ item: I }) => [
|
|
2675
|
-
a("div", Co, [
|
|
2676
|
-
_(x.$slots, "icon", {
|
|
2677
|
-
icon: I.value
|
|
2678
|
-
}),
|
|
2679
|
-
a("div", null, C(I.name), 1)
|
|
2680
|
-
])
|
|
2681
|
-
]),
|
|
2682
|
-
_: 3
|
|
2683
|
-
}, 8, ["model-value", "items"]),
|
|
2684
|
-
b(se, {
|
|
2685
|
-
"model-value": t.value.type,
|
|
2686
|
-
bottom: "0",
|
|
2687
|
-
top: "unset",
|
|
2688
|
-
label: "Type",
|
|
2689
|
-
items: e.listDashboard,
|
|
2690
|
-
onChange: g
|
|
2691
|
-
}, null, 8, ["model-value", "items"])
|
|
2692
|
-
])
|
|
2693
|
-
])
|
|
2694
|
-
]),
|
|
2695
|
-
"tab-1": y(() => [
|
|
2696
|
-
a("div", zo, [
|
|
2697
|
-
b(st, {
|
|
2698
|
-
active: !!t.value.args.length,
|
|
2699
|
-
disabled: d.value,
|
|
2700
|
-
label: "Arguments",
|
|
2701
|
-
onIcon: w[2] || (w[2] = (I) => o.value = !0)
|
|
2702
|
-
}, {
|
|
2703
|
-
default: y(() => [
|
|
2704
|
-
a("div", So, [
|
|
2705
|
-
(m(!0), v(N, null, W(t.value.args, (I, xe) => (m(), v("div", {
|
|
2706
|
-
key: I,
|
|
2707
|
-
class: "flex items-center rounded-full bg-gray-200 dark:bg-gray-900/50 px-2 py-[2px] text-xs"
|
|
2708
|
-
}, [
|
|
2709
|
-
a("div", Vo, [
|
|
2710
|
-
a("span", Bo, C(I), 1),
|
|
2711
|
-
a("div", {
|
|
2712
|
-
class: E(["fixed left-1/2 top-1/2 p-4 text-white bg-gray-900 rounded-md group-hover:visible invisible opacity-0 group-hover:opacity-100 z-50 transition-all -translate-1/2", P(xe) ? "visible opacity-100" : ""])
|
|
2713
|
-
}, [
|
|
2714
|
-
a("pre", null, C(L(ut)(I, e.object)), 1)
|
|
2715
|
-
], 2)
|
|
2716
|
-
]),
|
|
2717
|
-
xe || t.value.args.length < 2 ? (m(), v("button", {
|
|
2718
|
-
key: 0,
|
|
2719
|
-
class: "cursor-pointer ms-1",
|
|
2720
|
-
onClick: (Va) => k(I)
|
|
2721
|
-
}, [
|
|
2722
|
-
b(ye, { class: "size-5" })
|
|
2723
|
-
], 8, Eo)) : T("", !0)
|
|
2724
|
-
]))), 128))
|
|
2725
|
-
])
|
|
2726
|
-
]),
|
|
2727
|
-
_: 1
|
|
2728
|
-
}, 8, ["active", "disabled"]),
|
|
2729
|
-
b(Se, {
|
|
2730
|
-
value: t.value.set,
|
|
2731
|
-
args: t.value.args,
|
|
2732
|
-
disabled: !c.value || u.value,
|
|
2733
|
-
label: "Set",
|
|
2734
|
-
onIcon: w[3] || (w[3] = (I) => h("set")),
|
|
2735
|
-
onHover: X,
|
|
2736
|
-
onChange: w[4] || (w[4] = (I) => V("set", I))
|
|
2737
|
-
}, null, 8, ["value", "args", "disabled"]),
|
|
2738
|
-
b(Se, {
|
|
2739
|
-
value: t.value.get,
|
|
2740
|
-
args: t.value.args,
|
|
2741
|
-
disabled: !c.value,
|
|
2742
|
-
label: "Get",
|
|
2743
|
-
onIcon: w[5] || (w[5] = (I) => h("get")),
|
|
2744
|
-
onHover: X,
|
|
2745
|
-
onChange: w[6] || (w[6] = (I) => V("get", I))
|
|
2746
|
-
}, null, 8, ["value", "args", "disabled"]),
|
|
2747
|
-
b(Se, {
|
|
2748
|
-
value: t.value.getTo,
|
|
2749
|
-
args: t.value.args,
|
|
2750
|
-
disabled: !c.value,
|
|
2751
|
-
label: "GetTo",
|
|
2752
|
-
onIcon: w[7] || (w[7] = (I) => h("getTo")),
|
|
2753
|
-
onHover: X,
|
|
2754
|
-
onChange: w[8] || (w[8] = (I) => V("getTo", I))
|
|
2755
|
-
}, null, 8, ["value", "args", "disabled"])
|
|
2756
|
-
])
|
|
2757
|
-
]),
|
|
2758
|
-
"tab-2": y(() => [
|
|
2759
|
-
b(yo, U(t.value.opts, {
|
|
2760
|
-
value: t.value.value,
|
|
2761
|
-
type: t.value.type,
|
|
2762
|
-
onUpdate: R
|
|
2763
|
-
}), null, 16, ["value", "type"])
|
|
2764
|
-
]),
|
|
2765
|
-
_: 3
|
|
2766
|
-
})
|
|
2767
|
-
]),
|
|
2768
|
-
a("div", To, [
|
|
2769
|
-
a("div", Lo, [
|
|
2770
|
-
_(x.$slots, "default", { item: t.value })
|
|
2771
|
-
])
|
|
2772
|
-
])
|
|
2773
|
-
]),
|
|
2774
|
-
a("div", Mo, [
|
|
2775
|
-
b(j, {
|
|
2776
|
-
class: "px-4",
|
|
2777
|
-
color: "blue",
|
|
2778
|
-
disabled: f.value,
|
|
2779
|
-
onClick: w[9] || (w[9] = (I) => $(i.value ? "add" : "save"))
|
|
2780
|
-
}, {
|
|
2781
|
-
default: y(() => [
|
|
2782
|
-
H(C(i.value ? x.$t("add") : x.$t("save")), 1)
|
|
2783
|
-
]),
|
|
2784
|
-
_: 1
|
|
2785
|
-
}, 8, ["disabled"]),
|
|
2786
|
-
b(j, {
|
|
2787
|
-
class: "px-4",
|
|
2788
|
-
color: "red",
|
|
2789
|
-
outline: "",
|
|
2790
|
-
onClick: w[10] || (w[10] = (I) => $("remove"))
|
|
2791
|
-
}, {
|
|
2792
|
-
default: y(() => [
|
|
2793
|
-
H(C(x.$t("remove")), 1)
|
|
2794
|
-
]),
|
|
2795
|
-
_: 1
|
|
2796
|
-
})
|
|
2797
|
-
]),
|
|
2798
|
-
o.value ? (m(), A(De, {
|
|
2799
|
-
key: 0,
|
|
2800
|
-
size: "md",
|
|
2801
|
-
title: x.$t("select"),
|
|
2802
|
-
onClose: w[11] || (w[11] = (I) => o.value = !1)
|
|
2803
|
-
}, {
|
|
2804
|
-
default: y(() => [
|
|
2805
|
-
a("div", Ao, [
|
|
2806
|
-
b(ot, {
|
|
2807
|
-
items: e.object,
|
|
2808
|
-
onlyValue: !c.value,
|
|
2809
|
-
onClick: z
|
|
2810
|
-
}, null, 8, ["items", "onlyValue"])
|
|
2811
|
-
])
|
|
2812
|
-
]),
|
|
2813
|
-
_: 1
|
|
2814
|
-
}, 8, ["title"])) : T("", !0)
|
|
2815
|
-
]);
|
|
2816
|
-
};
|
|
2817
|
-
}
|
|
2818
|
-
}), Pe = { position: "relative", boxSizing: "border-box", overflow: "hidden", fontSize: "16px", fontFamily: 'Menlo, Consolas, "Liberation Mono", Monaco, "Lucida Console", monospace' }, Do = { 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" }, Io = { 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" }, Oo = { 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" }, at = (e) => it(e);
|
|
2819
|
-
function He(e) {
|
|
2820
|
-
const n = Array.isArray(e) ? e : [e];
|
|
2821
|
-
return n.length === 0 ? at : (l) => n.reduce((s, t, o) => t(s, { html: o > 0 }), l);
|
|
2822
|
-
}
|
|
2823
|
-
class jo {
|
|
2824
|
-
constructor(n, l = {}) {
|
|
2825
|
-
if (this.lines = null, !n) throw new Error("selector is not defined");
|
|
2826
|
-
if (this.root = n instanceof Node ? n : document.querySelector(n), !this.root) throw new Error(`element with "${n}" selector is not exist`);
|
|
2827
|
-
const s = { value: "", styles: {}, plugins: [], highlighter: at }, { highlighters: t, ...o } = l;
|
|
2828
|
-
this.options = { ...s, ...o, highlighter: t ? He(t) : s.highlighter }, this.options.value = this.options.value == null ? "" : String(this.options.value), this.init();
|
|
2829
|
-
}
|
|
2830
|
-
init() {
|
|
2831
|
-
this.textarea = document.createElement("textarea"), this.textarea.setAttribute("spellcheck", "false"), this.textarea.setAttribute("autocapitalize", "off"), this.textarea.setAttribute("autocorrect", "off"), this.textarea.setAttribute("autocomplete", "off"), this.pre = document.createElement("pre");
|
|
2832
|
-
const n = Object.keys(Pe).concat(Object.keys(this.options.styles)).concat(["paddingLeft"]);
|
|
2833
|
-
this.initialRootStyles = {};
|
|
2834
|
-
const l = this.root.style;
|
|
2835
|
-
n.forEach((s) => {
|
|
2836
|
-
this.initialRootStyles[s] = l[s] || "";
|
|
2837
|
-
}), Object.assign(this.root.style, Pe, this.options.styles), Object.assign(this.textarea.style, Do), Object.assign(this.pre.style, Io), 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();
|
|
2838
|
-
}
|
|
2839
|
-
addTextareaEvents() {
|
|
2840
|
-
this.handleEvent = (n) => {
|
|
2841
|
-
if (n.type === "keydown" && this.textarea.readOnly) return;
|
|
2842
|
-
const l = n;
|
|
2843
|
-
if (l.isComposing || l.keyCode === 229) return;
|
|
2844
|
-
const s = function(t, o) {
|
|
2845
|
-
const { value: i, selectionStart: r, selectionEnd: u } = o.target;
|
|
2846
|
-
return t.reduce((c, d) => ({ ...c, ...d(c, o) }), { value: i, selectionStart: r, selectionEnd: u });
|
|
2847
|
-
}(this.options.plugins, n);
|
|
2848
|
-
this.update(s);
|
|
2849
|
-
}, this.textarea.addEventListener("input", this.handleEvent), this.textarea.addEventListener("keydown", this.handleEvent), this.textarea.addEventListener("compositionend", this.handleEvent);
|
|
2850
|
-
}
|
|
2851
|
-
update(n) {
|
|
2852
|
-
if (!this.textarea) return;
|
|
2853
|
-
let { value: l, selectionStart: s, selectionEnd: t } = n;
|
|
2854
|
-
l != null && (l = String(l), s == null && (s = this.textarea.selectionStart), t == null && (t = this.textarea.selectionEnd), this.textarea.value !== l && (this.textarea.value = l)), s != null && (this.textarea.selectionStart = s), t != null && (this.textarea.selectionEnd = t), l !== this.value && l != null && (this.value = l, this.render(), this.updateCallback && this.updateCallback(l));
|
|
2855
|
-
}
|
|
2856
|
-
updateOptions(n) {
|
|
2857
|
-
if (!this.textarea) return;
|
|
2858
|
-
const { highlighters: l, ...s } = n;
|
|
2859
|
-
if (this.options = { ...this.options, ...s, highlighter: l ? He(l) : this.options.highlighter }, n.styles) {
|
|
2860
|
-
const t = this.root.style;
|
|
2861
|
-
Object.keys(n.styles).forEach((o) => {
|
|
2862
|
-
o in this.initialRootStyles || (this.initialRootStyles[o] = t[o] || "");
|
|
2863
|
-
}), Object.assign(this.root.style, n.styles), ("paddingLeft" in n.styles || "padding" in n.styles) && (this.basePaddingLeft = this.root.style.paddingLeft || "");
|
|
2864
|
-
}
|
|
2865
|
-
this.lines && !this.options.lineNumbers && ($e(this.lines), this.lines = null, this.root.style.paddingLeft = this.basePaddingLeft), n.value != null && this.update({ value: n.value }), this.render();
|
|
2866
|
-
}
|
|
2867
|
-
render() {
|
|
2868
|
-
const n = this.options.highlighter(this.value);
|
|
2869
|
-
this.pre.innerHTML = n + "<br/>", this.updateLines();
|
|
2870
|
-
}
|
|
2871
|
-
updateLines() {
|
|
2872
|
-
if (!this.options.lineNumbers) return;
|
|
2873
|
-
this.lines || (this.lines = document.createElement("pre"), this.root.appendChild(this.lines), Object.assign(this.lines.style, Oo));
|
|
2874
|
-
const n = this.value.split(`
|
|
2875
|
-
`), l = n.length.toString().length;
|
|
2876
|
-
this.root.style.paddingLeft = `${l + 1}ch`, this.lines.innerHTML = n.map((s, t) => `${`<span class="yace-line" style="position: absolute; opacity: .3; left: 0; width: ${l}ch; text-align: right">${1 + t}</span>`}${`<span style="color: transparent; pointer-events: none">${it(s)}</span>`}`).join(`
|
|
2877
|
-
`);
|
|
2878
|
-
}
|
|
2879
|
-
destroy() {
|
|
2880
|
-
this.textarea && (this.textarea.removeEventListener("input", this.handleEvent), this.textarea.removeEventListener("keydown", this.handleEvent), this.textarea.removeEventListener("compositionend", this.handleEvent), $e(this.textarea), $e(this.pre), $e(this.lines), Object.assign(this.root.style, this.initialRootStyles), Object.assign(this, { textarea: null, pre: null, lines: null, updateCallback: null, handleEvent: null, initialRootStyles: null, options: null, root: null }));
|
|
2881
|
-
}
|
|
2882
|
-
onUpdate(n) {
|
|
2883
|
-
this.updateCallback = n;
|
|
2884
|
-
}
|
|
2885
|
-
}
|
|
2886
|
-
function $e(e) {
|
|
2887
|
-
e && e.parentNode && e.parentNode.removeChild(e);
|
|
2888
|
-
}
|
|
2889
|
-
function it(e) {
|
|
2890
|
-
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
2891
|
-
}
|
|
2892
|
-
const Ne = { 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" }, Po = { add: "=" }, Ho = { ";": "semicolon", "=": "equal", ",": "comma", "-": "minus", ".": "period", "/": "slash", "`": "backquote", "[": "bracketleft", "\\": "backslash", "]": "bracketright", "'": "quote" };
|
|
2893
|
-
function he(e, n) {
|
|
2894
|
-
const l = e.split("+").reduce((u, c) => Ne[c] ? (u.modifiers[Ne[c]] = !0, u) : { ...u, key: Po[c] || c.toLowerCase() }, { modifiers: { altKey: !1, ctrlKey: !1, metaKey: !1, shiftKey: !1 }, key: null }), s = Object.keys(l.modifiers).every((u) => l.modifiers[u] ? n[u] : !n[u]);
|
|
2895
|
-
if (!l.key) return s;
|
|
2896
|
-
const t = n.key != null && n.key.toLowerCase() === l.key, o = (i = l.key, /^[a-z]$/.test(i) ? `key${i}` : /^[0-9]$/.test(i) ? `digit${i}` : Ho[i] || null);
|
|
2897
|
-
var i;
|
|
2898
|
-
const r = !n.isComposing && o != null && n.code != null && n.code.toLowerCase() === o;
|
|
2899
|
-
return s && (t || r);
|
|
2900
|
-
}
|
|
2901
|
-
function No(e = {}) {
|
|
2902
|
-
const n = Math.max(1, e.limit == null ? 300 : e.limit), l = e.coalesceMs == null ? 300 : e.coalesceMs;
|
|
2903
|
-
let s = [], t = null, o = null;
|
|
2904
|
-
const i = (r) => {
|
|
2905
|
-
s = s.slice(0, t + 1), s.push(r), s.length > n && (s = s.slice(s.length - n)), t = s.length - 1;
|
|
2906
|
-
};
|
|
2907
|
-
return (r, u) => {
|
|
2908
|
-
const c = u.type === "keydown" && he("ctrl/cmd+z", u), d = u.type === "keydown" && (he("ctrl/cmd+shift+z", u) || he("ctrl+y", u));
|
|
2909
|
-
if ((c || d) && u.preventDefault(), t === null) return s = [r], void (t = 0);
|
|
2910
|
-
if (c) return o = null, s[t].value !== r.value ? i(r) : s[t] = r, t = Math.max(0, t - 1), s[t];
|
|
2911
|
-
if (d) return o = null, s[t].value !== r.value ? void i(r) : (t = Math.min(s.length - 1, t + 1), s[t]);
|
|
2912
|
-
if (u.type === "keydown") return s[t].value !== r.value ? (o = null, void i(r)) : void (s[t] = r);
|
|
2913
|
-
if (u.type === "input") {
|
|
2914
|
-
const f = u.timeStamp, p = f != null && o != null && f - o <= l;
|
|
2915
|
-
if (o = f ?? null, p) return void (s[t] = r);
|
|
2916
|
-
i(r);
|
|
2917
|
-
}
|
|
2918
|
-
};
|
|
2919
|
-
}
|
|
2920
|
-
const Fo = () => (e, n) => {
|
|
2921
|
-
const { value: l, selectionStart: s, selectionEnd: t } = e;
|
|
2922
|
-
if (!he("enter", n) || n.type !== "keydown") return;
|
|
2923
|
-
const o = l.substring(0, s).split(`
|
|
2924
|
-
`).pop(), i = /^\s+/.exec(o);
|
|
2925
|
-
if (!i) return;
|
|
2926
|
-
n.preventDefault();
|
|
2927
|
-
const r = `
|
|
2928
|
-
` + i[0];
|
|
2929
|
-
return { value: l.substring(0, s) + r + l.substring(t), selectionStart: s + r.length, selectionEnd: s + r.length };
|
|
2930
|
-
}, Ro = () => (e, n) => {
|
|
2931
|
-
if (!(n instanceof KeyboardEvent) || n.key !== "Enter")
|
|
2932
|
-
return;
|
|
2933
|
-
const { value: l, selectionStart: s, selectionEnd: t } = e;
|
|
2934
|
-
if (s !== t)
|
|
2935
|
-
return;
|
|
2936
|
-
const o = l.lastIndexOf(`
|
|
2937
|
-
`, s - 1) + 1, i = l.indexOf(`
|
|
2938
|
-
`, s), r = i === -1 ? l.length : i;
|
|
2939
|
-
if (l.slice(s, r).trim().length > 0)
|
|
2940
|
-
return;
|
|
2941
|
-
const d = l.substring(o, r).trimEnd();
|
|
2942
|
-
if (d.endsWith(";") || d.length === 0)
|
|
2943
|
-
return;
|
|
2944
|
-
const f = l.slice(0, r) + ";" + l.slice(r), p = s + 1;
|
|
2945
|
-
return {
|
|
2946
|
-
value: f,
|
|
2947
|
-
selectionStart: p,
|
|
2948
|
-
selectionEnd: p
|
|
2949
|
-
};
|
|
2950
|
-
};
|
|
2951
|
-
let Ie = [], J = null, Z = 0, ee = [], le = null, ie = null, Oe, rt, Q = null, ce = null;
|
|
2952
|
-
const Uo = (e) => {
|
|
2953
|
-
const { customSuggestions: n = [], minPrefixLength: l = 1, maxSuggestions: s = 20, tabSize: t = 2, tooltip: o = { enabled: !0 }, i18n: i, renderMenu: r, renderTooltip: u } = e;
|
|
2954
|
-
if (!r || !u)
|
|
2955
|
-
throw new Error("renderMenu and renderTooltip are required");
|
|
2956
|
-
return Ie = [...n].map((c) => i(c)), Oe = r, rt = u, (c, d) => {
|
|
2957
|
-
if (!(d instanceof KeyboardEvent))
|
|
2958
|
-
return;
|
|
2959
|
-
const { value: f, selectionStart: p } = c, g = d.target;
|
|
2960
|
-
if (ie = g, o.enabled !== !1 && !g.dataset.tooltipInitialized && (g.dataset.tooltipInitialized = "true", g.addEventListener("mouseup", () => {
|
|
2961
|
-
setTimeout(() => Fe(g), 100);
|
|
2962
|
-
}), g.addEventListener("keyup", () => {
|
|
2963
|
-
setTimeout(() => Fe(g), 100);
|
|
2964
|
-
})), J) {
|
|
2965
|
-
switch (d.key) {
|
|
2966
|
-
case "ArrowDown":
|
|
2967
|
-
return d.preventDefault(), Z < ee.length - 1 && (Z++, re()), { ...c };
|
|
2968
|
-
case "ArrowUp":
|
|
2969
|
-
return d.preventDefault(), Z > 0 && (Z--, re()), { ...c };
|
|
2970
|
-
case "Enter":
|
|
2971
|
-
if (d.preventDefault(), ee[Z]) {
|
|
2972
|
-
const h = Be(c, ee[Z]);
|
|
2973
|
-
return te(), h;
|
|
2974
|
-
}
|
|
2975
|
-
return;
|
|
2976
|
-
case "Tab":
|
|
2977
|
-
if (d.preventDefault(), ee[Z]) {
|
|
2978
|
-
const h = Be(c, ee[Z]);
|
|
2979
|
-
return te(), h;
|
|
2980
|
-
}
|
|
2981
|
-
return;
|
|
2982
|
-
case "Escape":
|
|
2983
|
-
return d.preventDefault(), te(), { ...c };
|
|
2984
|
-
case "Backspace":
|
|
2985
|
-
setTimeout(() => {
|
|
2986
|
-
if (ie) {
|
|
2987
|
-
const h = ie.value, $ = ie.selectionStart, k = _e(h, $), z = h.slice(k, $);
|
|
2988
|
-
if (z.length < l)
|
|
2989
|
-
te();
|
|
2990
|
-
else {
|
|
2991
|
-
const S = Ve(z).slice(0, s);
|
|
2992
|
-
S.length === 0 ? te() : (ee = S, Z = 0, re());
|
|
2993
|
-
}
|
|
2994
|
-
}
|
|
2995
|
-
}, 0);
|
|
2996
|
-
return;
|
|
2997
|
-
}
|
|
2998
|
-
if (["ArrowDown", "ArrowUp", "Enter", "Tab", "Escape", "Backspace"].includes(d.key))
|
|
2999
|
-
return { ...c };
|
|
3000
|
-
}
|
|
3001
|
-
if (he("tab", d)) {
|
|
3002
|
-
d.preventDefault();
|
|
3003
|
-
const h = _e(f, p), $ = f.slice(h, p);
|
|
3004
|
-
if ($.length > 0) {
|
|
3005
|
-
const P = Ve($);
|
|
3006
|
-
if (P.length > 0)
|
|
3007
|
-
return Be(c, P[0]);
|
|
3008
|
-
}
|
|
3009
|
-
const k = " ".repeat(t), z = f.slice(0, p) + k + f.slice(p), S = p + t;
|
|
3010
|
-
return {
|
|
3011
|
-
value: z,
|
|
3012
|
-
selectionStart: S,
|
|
3013
|
-
selectionEnd: S
|
|
3014
|
-
};
|
|
3015
|
-
}
|
|
3016
|
-
if (!(d.key.length !== 1 || d.ctrlKey || d.metaKey || d.altKey))
|
|
3017
|
-
return le && clearTimeout(le), le = setTimeout(() => {
|
|
3018
|
-
le = null;
|
|
3019
|
-
const h = g.value, $ = g.selectionStart, k = _e(h, $), z = h.slice(k, $);
|
|
3020
|
-
if (z.length < l) {
|
|
3021
|
-
te();
|
|
3022
|
-
return;
|
|
3023
|
-
}
|
|
3024
|
-
let S = Ve(z);
|
|
3025
|
-
if (S = S.slice(0, s), S.length === 0) {
|
|
3026
|
-
te();
|
|
3027
|
-
return;
|
|
3028
|
-
}
|
|
3029
|
-
ee = S, Z = 0, J ? re() : Ko(g, S);
|
|
3030
|
-
}, 0), { ...c };
|
|
3031
|
-
};
|
|
3032
|
-
};
|
|
3033
|
-
function Ve(e) {
|
|
3034
|
-
const n = e.toLowerCase();
|
|
3035
|
-
return Ie.filter((l) => {
|
|
3036
|
-
const s = l.label.toLowerCase();
|
|
3037
|
-
return s.startsWith(n) || s.includes(n) || s.split("_").map((t) => t[0]).join("").startsWith(n);
|
|
3038
|
-
}).sort((l, s) => {
|
|
3039
|
-
const t = l.label.toLowerCase(), o = s.label.toLowerCase(), i = t.startsWith(n), r = o.startsWith(n);
|
|
3040
|
-
if (i && !r) return -1;
|
|
3041
|
-
if (!i && r) return 1;
|
|
3042
|
-
const u = t.indexOf(n), c = o.indexOf(n);
|
|
3043
|
-
return u !== c ? u - c : t.length !== o.length ? t.length - o.length : t.localeCompare(o);
|
|
3044
|
-
});
|
|
3045
|
-
}
|
|
3046
|
-
function _e(e, n) {
|
|
3047
|
-
let l = n;
|
|
3048
|
-
for (; l > 0 && /[a-zA-Z0-9_$]/.test(e[l - 1]); )
|
|
3049
|
-
l--;
|
|
3050
|
-
return l;
|
|
3051
|
-
}
|
|
3052
|
-
function Ko(e, n) {
|
|
3053
|
-
te(), ee = n, Z = 0;
|
|
3054
|
-
const l = ct(e);
|
|
3055
|
-
J = Oe(n, Z, (s) => {
|
|
3056
|
-
Z = s, re();
|
|
3057
|
-
}), Object.assign(J.style, {
|
|
3058
|
-
position: "fixed",
|
|
3059
|
-
left: `${l.left}px`,
|
|
3060
|
-
top: `${l.top + 24}px`,
|
|
3061
|
-
zIndex: "10000"
|
|
3062
|
-
}), document.body.appendChild(J);
|
|
3063
|
-
}
|
|
3064
|
-
function re() {
|
|
3065
|
-
if (!J || !ie) return;
|
|
3066
|
-
const e = Oe(ee, Z, (l) => {
|
|
3067
|
-
Z = l, re();
|
|
3068
|
-
}), n = J.getBoundingClientRect();
|
|
3069
|
-
J.replaceWith(e), J = e, Object.assign(J.style, {
|
|
3070
|
-
position: "fixed",
|
|
3071
|
-
left: `${n.left}px`,
|
|
3072
|
-
top: `${n.top}px`,
|
|
3073
|
-
zIndex: "10000"
|
|
3074
|
-
});
|
|
3075
|
-
}
|
|
3076
|
-
function Be(e, n) {
|
|
3077
|
-
const { value: l, selectionStart: s } = e, t = _e(l, s), o = n.insert || n.label, i = /\$\{([^}]*)\}/g;
|
|
3078
|
-
let r = o;
|
|
3079
|
-
const u = [];
|
|
3080
|
-
let c;
|
|
3081
|
-
for (; (c = i.exec(o)) !== null; ) {
|
|
3082
|
-
const h = c[1], $ = c.index, k = c[0].length;
|
|
3083
|
-
u.push({ index: $, text: h, length: k });
|
|
3084
|
-
}
|
|
3085
|
-
r = o.replace(/\$\{([^}]*)\}/g, "$1");
|
|
3086
|
-
const d = u[0];
|
|
3087
|
-
let f = t + r.length, p = t + r.length;
|
|
3088
|
-
if (d) {
|
|
3089
|
-
let h = 0, $ = 0, k = !1;
|
|
3090
|
-
for (; $ < o.length && !k; ) {
|
|
3091
|
-
const z = u.find((S) => S.index === $);
|
|
3092
|
-
z ? (h += z.text.length, $ += z.length, z === d && (f = t + h - z.text.length, p = t + h, k = !0)) : (h++, $++);
|
|
3093
|
-
}
|
|
3094
|
-
}
|
|
3095
|
-
return {
|
|
3096
|
-
value: l.slice(0, t) + r + l.slice(s),
|
|
3097
|
-
selectionStart: f,
|
|
3098
|
-
selectionEnd: p
|
|
3099
|
-
};
|
|
3100
|
-
}
|
|
3101
|
-
function te() {
|
|
3102
|
-
le && (clearTimeout(le), le = null), J && (J.remove(), J = null, ee = [], Z = 0, ie = null);
|
|
3103
|
-
}
|
|
3104
|
-
function ct(e) {
|
|
3105
|
-
const n = e.getBoundingClientRect(), { value: l, selectionStart: s } = e, o = l.substring(0, s).split(`
|
|
3106
|
-
`), i = o.length, r = o[o.length - 1] || "", u = parseInt(getComputedStyle(e).lineHeight) || 20;
|
|
3107
|
-
return {
|
|
3108
|
-
left: n.left + 10 + r.length * 8,
|
|
3109
|
-
top: n.top + (i - 1) * u
|
|
3110
|
-
};
|
|
3111
|
-
}
|
|
3112
|
-
function Fe(e) {
|
|
3113
|
-
ce && clearTimeout(ce), ce = setTimeout(() => {
|
|
3114
|
-
const n = e.selectionStart, l = e.selectionEnd;
|
|
3115
|
-
if (n === l) {
|
|
3116
|
-
pe();
|
|
3117
|
-
return;
|
|
3118
|
-
}
|
|
3119
|
-
const s = e.value.substring(n, l).trim();
|
|
3120
|
-
if (!s) {
|
|
3121
|
-
pe();
|
|
3122
|
-
return;
|
|
3123
|
-
}
|
|
3124
|
-
const t = Ie.find((r) => r.label === s);
|
|
3125
|
-
if (!t) {
|
|
3126
|
-
pe();
|
|
3127
|
-
return;
|
|
3128
|
-
}
|
|
3129
|
-
const o = ct(e), i = rt(t, o);
|
|
3130
|
-
i.style.opacity = "0", Q && Q.remove(), Q = i, document.body.appendChild(Q), requestAnimationFrame(() => {
|
|
3131
|
-
Q && (Q.style.opacity = "1");
|
|
3132
|
-
}), setTimeout(() => pe(), 3e3);
|
|
3133
|
-
}, 300);
|
|
3134
|
-
}
|
|
3135
|
-
function pe() {
|
|
3136
|
-
ce && (clearTimeout(ce), ce = null), Q && (Q.style.opacity = "0", setTimeout(() => {
|
|
3137
|
-
Q && (Q.remove(), Q = null);
|
|
3138
|
-
}, 150));
|
|
3139
|
-
}
|
|
3140
|
-
document.addEventListener("mousedown", (e) => {
|
|
3141
|
-
const n = e.target;
|
|
3142
|
-
J && !J.contains(n) && te(), Q && !Q.contains(n) && pe();
|
|
3143
|
-
});
|
|
3144
|
-
const Ee = (e) => e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">"), Wo = ["else", "end", "call", "fade"], qo = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), Go = (e) => {
|
|
3145
|
-
const n = e.filter((r) => r.type !== "var").map((r) => r.label), i = `(\\/\\/[^\\n]*)|('[^'\\n]*')|(\\b\\d+(?:\\.\\d+)?\\b)|(\\b(?:${Array.from(/* @__PURE__ */ new Set([...Wo, ...n])).map(qo).join("|")})\\b)|(\\$[a-zA-Z_][a-zA-Z0-9_]*)|(\\b(?:btn_\\d+(?:_\\d+)?)\\b)|([;:(){}])`;
|
|
3146
|
-
return new RegExp(i, "g");
|
|
3147
|
-
}, Zo = (e) => (n) => {
|
|
3148
|
-
const l = Go(e);
|
|
3149
|
-
let s = "", t = 0;
|
|
3150
|
-
for (const o of n.matchAll(l)) {
|
|
3151
|
-
const [i, r, u, c, d, f, p, g] = o;
|
|
3152
|
-
let h = "";
|
|
3153
|
-
r ? h = "comment" : u ? h = "str" : c ? h = "num" : d ? h = "word" : f ? h = "var" : p ? h = "event" : g && (h = "operator"), s += Ee(n.slice(t, o.index)), s += `<span class="tok--${h}">${Ee(i)}</span>`, t = o.index + i.length;
|
|
3154
|
-
}
|
|
3155
|
-
return s += Ee(n.slice(t)), s;
|
|
3156
|
-
}, dt = {
|
|
3157
|
-
word: "text-blue-600 dark:text-blue-400",
|
|
3158
|
-
func: "text-yellow-600 dark:text-yellow-400",
|
|
3159
|
-
var: "text-cyan-600 dark:text-cyan-400",
|
|
3160
|
-
event: "text-purple-600 dark:text-purple-400"
|
|
3161
|
-
}, Jo = (e, n, l) => {
|
|
3162
|
-
const s = document.createElement("div");
|
|
3163
|
-
return s.className = `
|
|
3164
|
-
fixed z-[10000] min-w-[250px] max-w-[400px] max-h-[250px]
|
|
3165
|
-
overflow-y-auto p-1 rounded-lg shadow-lg border
|
|
3166
|
-
border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800
|
|
3167
|
-
text-sm font-mono scrollbar pointer-events-none
|
|
3168
|
-
`, e.forEach((t, o) => {
|
|
3169
|
-
const i = o === n, r = document.createElement("div");
|
|
3170
|
-
r.className = `
|
|
3171
|
-
flex items-center justify-between gap-2 px-3 py-1.5 cursor-pointer
|
|
3172
|
-
rounded transition-colors duration-100 border-l-2
|
|
3173
|
-
${i ? "border-blue-500 dark:border-blue-400 bg-blue-50 dark:bg-blue-900/30" : "border-transparent hover:bg-gray-100 dark:hover:bg-gray-700"}
|
|
3174
|
-
`;
|
|
3175
|
-
const u = dt[t.type] || "text-gray-700 dark:text-gray-300";
|
|
3176
|
-
r.innerHTML = `
|
|
3177
|
-
<div class="flex items-center gap-2 flex-1">
|
|
3178
|
-
<span class="${u} font-medium">${t.label}</span>
|
|
3179
|
-
${t.detail ? `<span class="text-xs text-gray-500 dark:text-gray-400 ml-2">${t.detail}</span>` : ""}
|
|
3180
|
-
</div>
|
|
3181
|
-
${t.description ? `<span class="text-xs text-gray-400 dark:text-gray-500">${t.description}</span>` : ""}
|
|
3182
|
-
`, r.addEventListener("click", () => l(o)), s.appendChild(r);
|
|
3183
|
-
}), s;
|
|
3184
|
-
}, Xo = (e, n) => {
|
|
3185
|
-
const l = document.createElement("div");
|
|
3186
|
-
l.className = `
|
|
3187
|
-
fixed z-[10001] px-3 py-2 font-mono text-sm max-w-[300px]
|
|
3188
|
-
min-w-[50px] min-h-[20px] rounded-lg shadow-lg border
|
|
3189
|
-
pointer-events-none transition-opacity duration-150
|
|
3190
|
-
bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700
|
|
3191
|
-
text-gray-700 dark:text-gray-300 pointer-events-none
|
|
3192
|
-
`, l.style.cssText = `
|
|
3193
|
-
left: ${n.left + 40}px; top: ${n.top - 10}px;
|
|
3194
|
-
transform: translateX(-50%) translateY(-100%); opacity: 0;
|
|
3195
|
-
`;
|
|
3196
|
-
let t = `<div class="font-medium ${dt[e.type] || "text-gray-700 dark:text-gray-300"}">${e.label}</div>`;
|
|
3197
|
-
e.detail && (t += `<div class="text-gray-500 dark:text-gray-400 mt-0.5 text-xs">${e.detail}</div>`), e.description && (t += `<div class="text-gray-400 dark:text-gray-500 text-xs mt-1 pt-1 border-t border-gray-200 dark:border-gray-700">${e.description}</div>`), l.innerHTML = t;
|
|
3198
|
-
const o = document.createElement("div");
|
|
3199
|
-
return o.className = `
|
|
3200
|
-
absolute bottom-[-6px] left-1/2 w-2.5 h-2.5 -translate-x-1/2 rotate-45
|
|
3201
|
-
bg-white dark:bg-gray-800 border-r border-b border-gray-200 dark:border-gray-700
|
|
3202
|
-
`, l.appendChild(o), l;
|
|
3203
|
-
}, Yo = [
|
|
3204
|
-
{ label: "if", type: "word", insert: `if:\${$v0<10};
|
|
3205
|
-
|
|
3206
|
-
else;
|
|
3207
|
-
|
|
3208
|
-
end;`, detail: "if:${$v0<10};else;end;" },
|
|
3209
|
-
{ label: "while", type: "word", insert: `$v0=0;
|
|
3210
|
-
while:\${$v0<10};
|
|
3211
|
-
log($v0);
|
|
3212
|
-
$v0=$v0+1;
|
|
3213
|
-
wait(1s);
|
|
3214
|
-
end;`, detail: "while:${$v0<2}; end;" },
|
|
3215
|
-
{ label: "udp", type: "func", insert: "udp(${},'call(1)')", detail: "udp(id:number, text:string)" },
|
|
3216
|
-
{ label: "on", type: "func", insert: `on('\${event}');
|
|
3217
|
-
|
|
3218
|
-
end;`, detail: "event(name: string)" },
|
|
3219
|
-
{ label: "wait", type: "func", insert: "wait(${1s});", detail: "wait(10ms | 1s | 1m | 1h)" },
|
|
3220
|
-
{ label: "log", type: "func", insert: "log(${});", detail: "log(text: string | number)" },
|
|
3221
|
-
{ label: "len", type: "func", insert: "len(${$a0});", detail: "len(arr: array)" },
|
|
3222
|
-
{ label: "set", type: "func", insert: "set(${$a0},${2},${10});", detail: "set(arr: array, index: number, value: number)" },
|
|
3223
|
-
{ label: "get", type: "func", insert: "get(${$a0},${0});", detail: "get(arr: array, index: number)" },
|
|
3224
|
-
{ label: "ord", type: "func", insert: "ord(${$s0});", detail: "ord(char: string)" },
|
|
3225
|
-
{ label: "chr", type: "func", insert: "chr(${65});", detail: "chr(v: number)" },
|
|
3226
|
-
{ label: "btn", type: "event", detail: "Change state " },
|
|
3227
|
-
{ label: "btn_c", type: "event", detail: "Count click button <br>$e0=gpio:number<br>$e1=value:number<br>$e2=type?:number" },
|
|
3228
|
-
{ label: "btn_l", type: "event", detail: "Long press of the button <br>$e0=gpio:number<br>$e1=value:number" },
|
|
3229
|
-
{ label: "btn_r", type: "event", detail: "Repeat while holding the button <br>$e0=gpio:number<br>$e1=value:number" },
|
|
3230
|
-
{ label: "$u", type: "var", insert: "$u${0}", detail: "var (uint) " },
|
|
3231
|
-
{ label: "$i", type: "var", insert: "$i${0}", detail: "var (int)" },
|
|
3232
|
-
{ label: "$f", type: "var", insert: "$f${0}", detail: "var (float)" },
|
|
3233
|
-
{ label: "$s", type: "var", insert: "$s${0}", detail: "var (string)" },
|
|
3234
|
-
{ label: "$a", type: "var", insert: "$a${0}", detail: "var (array)" },
|
|
3235
|
-
{ label: "$e", type: "var", insert: "$e${0}", detail: "var event" },
|
|
3236
|
-
{ label: "$c", type: "var", insert: "$c${0}", detail: "var call" },
|
|
3237
|
-
{ label: "$p", type: "var", insert: "$p${0}", detail: "gpio" }
|
|
3238
|
-
], Ya = /* @__PURE__ */ B({
|
|
3239
|
-
__name: "ScriptEditor",
|
|
3240
|
-
props: {
|
|
3241
|
-
modelValue: {},
|
|
3242
|
-
suggestions: { default: () => [] }
|
|
3243
|
-
},
|
|
3244
|
-
emits: ["update:modelValue", "update"],
|
|
3245
|
-
setup(e, { emit: n }) {
|
|
3246
|
-
const l = n;
|
|
3247
|
-
let s;
|
|
3248
|
-
const t = [...Yo, ...e.suggestions];
|
|
3249
|
-
return ue(
|
|
3250
|
-
() => e.modelValue,
|
|
3251
|
-
(o) => {
|
|
3252
|
-
s.update({ value: o });
|
|
3253
|
-
}
|
|
3254
|
-
), fe(() => {
|
|
3255
|
-
s = new jo("#editor", {
|
|
3256
|
-
value: e.modelValue,
|
|
3257
|
-
lineNumbers: !0,
|
|
3258
|
-
highlighters: [Zo(t)],
|
|
3259
|
-
plugins: [
|
|
3260
|
-
No(),
|
|
3261
|
-
Fo(),
|
|
3262
|
-
Uo({
|
|
3263
|
-
customSuggestions: t,
|
|
3264
|
-
minPrefixLength: 1,
|
|
3265
|
-
maxSuggestions: 20,
|
|
3266
|
-
i18n: (o) => o,
|
|
3267
|
-
tooltip: {
|
|
3268
|
-
enabled: !0
|
|
3269
|
-
},
|
|
3270
|
-
renderMenu: Jo,
|
|
3271
|
-
renderTooltip: Xo
|
|
3272
|
-
}),
|
|
3273
|
-
Ro()
|
|
3274
|
-
],
|
|
3275
|
-
styles: { fontSize: "14px" }
|
|
3276
|
-
}), s.onUpdate((o) => {
|
|
3277
|
-
l("update:modelValue", o);
|
|
3278
|
-
});
|
|
3279
|
-
}), qe(() => {
|
|
3280
|
-
s.destroy();
|
|
3281
|
-
}), (o, i) => (m(), v("div", null, [...i[0] || (i[0] = [
|
|
3282
|
-
a("div", {
|
|
3283
|
-
class: "",
|
|
3284
|
-
id: "editor"
|
|
3285
|
-
}, null, -1)
|
|
3286
|
-
])]));
|
|
3287
|
-
}
|
|
3288
|
-
}), Qo = { class: "max-w-4xl mx-auto" }, ea = {
|
|
3289
|
-
key: 0,
|
|
3290
|
-
class: "text-sm"
|
|
3291
|
-
}, ta = {
|
|
3292
|
-
key: 0,
|
|
3293
|
-
class: "text-gray-500"
|
|
3294
|
-
}, na = {
|
|
3295
|
-
key: 1,
|
|
3296
|
-
class: "text-red-600"
|
|
3297
|
-
}, la = ["innerHTML"], sa = "https://raw.githubusercontent.com/bondrogeen/vuesp/refs/heads/master/github/docs/scriptrunner/", oa = "https://cdn.jsdelivr.net/npm/marked/lib/marked.umd.js", Qa = /* @__PURE__ */ B({
|
|
3298
|
-
__name: "ScriptViewDocs",
|
|
3299
|
-
props: {
|
|
3300
|
-
lang: { default: "en" }
|
|
3301
|
-
},
|
|
3302
|
-
setup(e) {
|
|
3303
|
-
const n = O(""), l = O(""), s = O(null), t = O(!1), o = O(null);
|
|
3304
|
-
let i = null;
|
|
3305
|
-
const r = () => new Promise((d, f) => {
|
|
3306
|
-
if (window.marked) {
|
|
3307
|
-
window.marked.setOptions({
|
|
3308
|
-
gfm: !0,
|
|
3309
|
-
breaks: !0,
|
|
3310
|
-
headerIds: !1
|
|
3311
|
-
}), d(window.marked);
|
|
3312
|
-
return;
|
|
3313
|
-
}
|
|
3314
|
-
const p = document.createElement("script");
|
|
3315
|
-
p.src = oa, p.async = !0, p.onload = () => {
|
|
3316
|
-
window.marked ? (window.marked.setOptions({
|
|
3317
|
-
gfm: !0,
|
|
3318
|
-
breaks: !0,
|
|
3319
|
-
headerIds: !1
|
|
3320
|
-
}), d(window.marked)) : f(new Error("Marked library not found after loading"));
|
|
3321
|
-
}, p.onerror = () => {
|
|
3322
|
-
f(new Error("Failed to load Marked library from CDN"));
|
|
3323
|
-
}, document.head.appendChild(p);
|
|
3324
|
-
}), u = (d) => {
|
|
3325
|
-
const f = d.split(`
|
|
3326
|
-
`), p = {};
|
|
3327
|
-
let g = !0;
|
|
3328
|
-
for (const h of f) {
|
|
3329
|
-
if (g && h.startsWith("#")) {
|
|
3330
|
-
g = !1;
|
|
3331
|
-
continue;
|
|
3332
|
-
}
|
|
3333
|
-
if (g && h.includes(":")) {
|
|
3334
|
-
const [$, k] = h.split(":").map((z) => z.trim());
|
|
3335
|
-
$ && k && ($.toLowerCase().includes("version") && (p.version = k), ($.toLowerCase().includes("обновлено") || $.toLowerCase().includes("updated")) && (p.updated = k));
|
|
3336
|
-
}
|
|
3337
|
-
}
|
|
3338
|
-
return p;
|
|
3339
|
-
}, c = async (d) => {
|
|
3340
|
-
if (!i) {
|
|
3341
|
-
o.value = "error";
|
|
3342
|
-
return;
|
|
3343
|
-
}
|
|
3344
|
-
t.value = !0, o.value = null, l.value = "";
|
|
3345
|
-
try {
|
|
3346
|
-
const f = `${sa}${d}.md`, p = await fetch(f);
|
|
3347
|
-
if (!p.ok)
|
|
3348
|
-
throw new Error(`HTTP ${p.status}: ${p.statusText}`);
|
|
3349
|
-
const g = await p.text();
|
|
3350
|
-
n.value = g, s.value = u(g), l.value = i.parse(g);
|
|
3351
|
-
} catch (f) {
|
|
3352
|
-
const p = f instanceof Error ? f.message : "";
|
|
3353
|
-
o.value = p, console.error("Error loading docs:", f);
|
|
3354
|
-
} finally {
|
|
3355
|
-
t.value = !1;
|
|
3356
|
-
}
|
|
3357
|
-
};
|
|
3358
|
-
return fe(async () => {
|
|
3359
|
-
try {
|
|
3360
|
-
i = await r();
|
|
3361
|
-
const d = e.lang ? "ru" : "en";
|
|
3362
|
-
await c(d);
|
|
3363
|
-
} catch (d) {
|
|
3364
|
-
const f = d instanceof Error ? d.message : "";
|
|
3365
|
-
o.value = f, console.error("Initialization error:", d);
|
|
3366
|
-
}
|
|
3367
|
-
}), (d, f) => (m(), v("div", Qo, [
|
|
3368
|
-
t.value || o.value ? (m(), v("div", ea, [
|
|
3369
|
-
t.value ? (m(), v("span", ta, "⏳")) : T("", !0),
|
|
3370
|
-
o.value ? (m(), v("span", na, "❌ " + C(o.value), 1)) : T("", !0)
|
|
3371
|
-
])) : T("", !0),
|
|
3372
|
-
a("div", {
|
|
3373
|
-
class: "docs-content",
|
|
3374
|
-
innerHTML: l.value
|
|
3375
|
-
}, null, 8, la)
|
|
3376
|
-
]));
|
|
3377
|
-
}
|
|
3378
|
-
}), aa = (e, n) => n && n.length <= e, ia = (e) => !!(e && e.length) || "Required", ra = (e) => (n) => aa(e, n) || `Max length ${e}`;
|
|
3379
|
-
function ca(e) {
|
|
3380
|
-
const { validationSchema: n, initialValues: l = {} } = e, s = typeof n == "function", t = O(
|
|
3381
|
-
s ? n(l) : n
|
|
3382
|
-
), o = O(!0), i = (V) => {
|
|
3383
|
-
t.value = V;
|
|
3384
|
-
const D = Object.keys(V), R = Object.keys(r);
|
|
3385
|
-
D.forEach((x) => {
|
|
3386
|
-
x in r || (r[x] = l[x] ?? "", u[x] = [], c[x] = !1, d[x] = !1);
|
|
3387
|
-
}), R.forEach((x) => {
|
|
3388
|
-
D.includes(x) || (delete r[x], delete u[x], delete c[x], delete d[x]);
|
|
3389
|
-
}), k(), z();
|
|
3390
|
-
}, r = ve({}), u = ve({}), c = ve({}), d = ve({}), f = /* @__PURE__ */ new Map(), p = () => {
|
|
3391
|
-
Object.keys(t.value).forEach((V) => {
|
|
3392
|
-
r[V] = l[V] ?? "", u[V] = [], c[V] = !1, d[V] = !1;
|
|
3393
|
-
}), o.value = !0;
|
|
3394
|
-
}, g = () => s ? n(r) : t.value, h = (V, D) => {
|
|
3395
|
-
const R = g()[V] || [], x = [];
|
|
3396
|
-
for (const w of R) {
|
|
3397
|
-
const ae = w(D, r);
|
|
3398
|
-
ae !== !0 && x.push(ae);
|
|
3399
|
-
}
|
|
3400
|
-
return u[V] = x, x.length === 0;
|
|
3401
|
-
}, $ = (V, D) => {
|
|
3402
|
-
const R = g();
|
|
3403
|
-
if (!R[V]) return;
|
|
3404
|
-
h(V, D);
|
|
3405
|
-
const x = f.get(V);
|
|
3406
|
-
x && x.forEach((w) => {
|
|
3407
|
-
R[w] && h(w, r[w]);
|
|
3408
|
-
}), z();
|
|
3409
|
-
}, k = () => {
|
|
3410
|
-
f.clear();
|
|
3411
|
-
const V = g();
|
|
3412
|
-
Object.keys(V).forEach((D) => {
|
|
3413
|
-
(V[D] || []).forEach((R) => {
|
|
3414
|
-
if (typeof R == "function" && R.name === "sameAs") {
|
|
3415
|
-
const x = R.toString().match(/['"](.*?)['"]/);
|
|
3416
|
-
if (x) {
|
|
3417
|
-
const w = x[1];
|
|
3418
|
-
f.has(w) || f.set(w, /* @__PURE__ */ new Set()), f.get(w).add(D);
|
|
3419
|
-
}
|
|
3420
|
-
}
|
|
3421
|
-
});
|
|
3422
|
-
});
|
|
3423
|
-
}, z = () => {
|
|
3424
|
-
const V = g();
|
|
3425
|
-
let D = !0;
|
|
3426
|
-
return Object.keys(V).forEach((R) => {
|
|
3427
|
-
h(R, r[R]) || (D = !1);
|
|
3428
|
-
}), o.value = D, D;
|
|
3429
|
-
}, S = (V, D = {}) => {
|
|
3430
|
-
g()[V] || console.warn(`Field "${V}" not found in current validationSchema`);
|
|
3431
|
-
const R = M({
|
|
3432
|
-
get: () => r[V],
|
|
3433
|
-
set: (w) => {
|
|
3434
|
-
r[V] = w, d[V] = !0, $(V, w);
|
|
3435
|
-
}
|
|
3436
|
-
}), x = M(() => {
|
|
3437
|
-
var w;
|
|
3438
|
-
const ae = {
|
|
3439
|
-
errors: u[V] || [],
|
|
3440
|
-
touched: c[V] || !1,
|
|
3441
|
-
dirty: d[V] || !1
|
|
3442
|
-
}, ye = {
|
|
3443
|
-
message: (w = u[V]) == null ? void 0 : w[0],
|
|
3444
|
-
onInput: (I) => {
|
|
3445
|
-
const xe = I.target;
|
|
3446
|
-
R.value = xe.value;
|
|
3447
|
-
},
|
|
3448
|
-
onBlur: () => {
|
|
3449
|
-
c[V] = !0, $(V, r[V]);
|
|
3450
|
-
}
|
|
3451
|
-
};
|
|
3452
|
-
if (D.props) {
|
|
3453
|
-
const I = D.props(ae);
|
|
3454
|
-
return { ...ye, ...I };
|
|
3455
|
-
}
|
|
3456
|
-
return ye;
|
|
3457
|
-
});
|
|
3458
|
-
return [R, x];
|
|
3459
|
-
}, P = (V) => async (D) => {
|
|
3460
|
-
D && D.preventDefault();
|
|
3461
|
-
const R = g();
|
|
3462
|
-
Object.keys(R).forEach((x) => {
|
|
3463
|
-
c[x] = !0;
|
|
3464
|
-
}), z() && await V(r);
|
|
3465
|
-
}, X = () => {
|
|
3466
|
-
const V = g();
|
|
3467
|
-
Object.keys(V).forEach((D) => {
|
|
3468
|
-
r[D] = l[D] || "", u[D] = [], c[D] = !1, d[D] = !1;
|
|
3469
|
-
}), o.value = !0;
|
|
3470
|
-
};
|
|
3471
|
-
return p(), k(), s && ue(
|
|
3472
|
-
() => r,
|
|
3473
|
-
() => {
|
|
3474
|
-
const V = n(r), D = t.value, R = Object.keys(V), x = Object.keys(D);
|
|
3475
|
-
(R.length !== x.length || R.some((w) => !x.includes(w))) && i(V);
|
|
3476
|
-
},
|
|
3477
|
-
{ deep: !0 }
|
|
3478
|
-
), {
|
|
3479
|
-
values: r,
|
|
3480
|
-
errors: u,
|
|
3481
|
-
defineField: S,
|
|
3482
|
-
handleSubmit: P,
|
|
3483
|
-
resetForm: X,
|
|
3484
|
-
validate: z,
|
|
3485
|
-
updateSchema: i,
|
|
3486
|
-
isValid: o
|
|
3487
|
-
};
|
|
3488
|
-
}
|
|
3489
|
-
const da = { class: "my-4" }, ei = /* @__PURE__ */ B({
|
|
3490
|
-
__name: "ScriptDialog",
|
|
3491
|
-
props: {
|
|
3492
|
-
idScript: {}
|
|
3493
|
-
},
|
|
3494
|
-
emits: ["add", "close"],
|
|
3495
|
-
setup(e, { emit: n }) {
|
|
3496
|
-
const l = n, { defineField: s, handleSubmit: t, isValid: o } = ca({
|
|
3497
|
-
validationSchema: () => ({
|
|
3498
|
-
name: [ia, ra(8)]
|
|
3499
|
-
})
|
|
3500
|
-
}), [i, r] = s("name"), u = () => {
|
|
3501
|
-
l("add", i.value);
|
|
3502
|
-
}, c = t(() => {
|
|
3503
|
-
u(), i.value = "", l("close", new Event("close"));
|
|
3504
|
-
});
|
|
3505
|
-
return fe(() => {
|
|
3506
|
-
e.idScript || (i.value = "boot");
|
|
3507
|
-
}), (d, f) => {
|
|
3508
|
-
const p = Y, g = j;
|
|
3509
|
-
return m(), v("div", da, [
|
|
3510
|
-
b(p, U({
|
|
3511
|
-
modelValue: L(i),
|
|
3512
|
-
"onUpdate:modelValue": f[0] || (f[0] = (h) => yt(i) ? i.value = h : null)
|
|
3513
|
-
}, L(r), {
|
|
3514
|
-
disabled: !e.idScript,
|
|
3515
|
-
label: d.$t("name")
|
|
3516
|
-
}), null, 16, ["modelValue", "disabled", "label"]),
|
|
3517
|
-
b(g, {
|
|
3518
|
-
class: "w-full",
|
|
3519
|
-
color: "blue",
|
|
3520
|
-
disabled: !L(o),
|
|
3521
|
-
onClick: L(c)
|
|
3522
|
-
}, {
|
|
3523
|
-
default: y(() => [
|
|
3524
|
-
H(C(d.$t("add")), 1)
|
|
3525
|
-
]),
|
|
3526
|
-
_: 1
|
|
3527
|
-
}, 8, ["disabled", "onClick"])
|
|
3528
|
-
]);
|
|
3529
|
-
};
|
|
3530
|
-
}
|
|
3531
|
-
}), ti = /* @__PURE__ */ B({
|
|
3532
|
-
__name: "VAutocomplete",
|
|
3533
|
-
props: {
|
|
3534
|
-
modelValue: { default: "" },
|
|
3535
|
-
label: {},
|
|
3536
|
-
name: { default: "" },
|
|
3537
|
-
message: { default: "" },
|
|
3538
|
-
items: {}
|
|
3539
|
-
},
|
|
3540
|
-
emits: ["update:modelValue", "select"],
|
|
3541
|
-
setup(e, { emit: n }) {
|
|
3542
|
-
const l = n, s = (o) => l("update:modelValue", o), t = (o, i) => {
|
|
3543
|
-
o.click(new Event("click")), l("select", i);
|
|
3544
|
-
};
|
|
3545
|
-
return (o, i) => (m(), A(Ce, U(o.$attrs, {
|
|
3546
|
-
top: "50px",
|
|
3547
|
-
"hide-on-click": ""
|
|
3548
|
-
}), {
|
|
3549
|
-
activator: y(({ on: r }) => [
|
|
3550
|
-
b(Y, {
|
|
3551
|
-
"model-value": e.modelValue,
|
|
3552
|
-
name: e.name,
|
|
3553
|
-
message: e.message,
|
|
3554
|
-
label: e.label,
|
|
3555
|
-
"onUpdate:modelValue": s,
|
|
3556
|
-
onClick: r.open
|
|
3557
|
-
}, null, 8, ["model-value", "name", "message", "label", "onClick"])
|
|
3558
|
-
]),
|
|
3559
|
-
default: y(({ on: r }) => [
|
|
3560
|
-
b(be, {
|
|
3561
|
-
items: e.items,
|
|
3562
|
-
onClick: (u) => t(r, u)
|
|
3563
|
-
}, {
|
|
3564
|
-
default: y(({ item: u }) => [
|
|
3565
|
-
_(o.$slots, "default", { item: u }, () => [
|
|
3566
|
-
H(C(u.name), 1)
|
|
3567
|
-
])
|
|
3568
|
-
]),
|
|
3569
|
-
_: 3
|
|
3570
|
-
}, 8, ["items", "onClick"])
|
|
3571
|
-
]),
|
|
3572
|
-
_: 3
|
|
3573
|
-
}, 16));
|
|
3574
|
-
}
|
|
3575
|
-
}), ua = {
|
|
3576
|
-
viewBox: "0 0 24 24",
|
|
3577
|
-
width: "1.2em",
|
|
3578
|
-
height: "1.2em"
|
|
3579
|
-
};
|
|
3580
|
-
function fa(e, n) {
|
|
3581
|
-
return m(), v("svg", ua, [...n[0] || (n[0] = [
|
|
3582
|
-
a("path", {
|
|
3583
|
-
fill: "currentColor",
|
|
3584
|
-
d: "m12 15l-4.243-4.242l1.415-1.414L12 12.172l2.828-2.828l1.415 1.414z"
|
|
3585
|
-
}, null, -1)
|
|
3586
|
-
])]);
|
|
3587
|
-
}
|
|
3588
|
-
const ma = K({ name: "ri-arrow-drop-down-line", render: fa }), va = { class: "v-expansion__content max-h-0 overflow-hidden transition-all duration-300" }, pa = { class: "p-4" }, ni = /* @__PURE__ */ B({
|
|
3589
|
-
__name: "VExpansion",
|
|
3590
|
-
props: {
|
|
3591
|
-
label: { default: "" },
|
|
3592
|
-
value: { type: Boolean, default: !1 }
|
|
3593
|
-
},
|
|
3594
|
-
setup(e) {
|
|
3595
|
-
const n = O(null), l = O(e.value), s = () => {
|
|
3596
|
-
if (!n.value) return;
|
|
3597
|
-
const o = n.value.querySelector(".v-expansion__content");
|
|
3598
|
-
o && (o.style.maxHeight = l.value ? `${o.scrollHeight}px` : "0");
|
|
3599
|
-
}, t = () => {
|
|
3600
|
-
l.value = !l.value, s();
|
|
3601
|
-
};
|
|
3602
|
-
return fe(() => {
|
|
3603
|
-
s();
|
|
3604
|
-
}), (o, i) => {
|
|
3605
|
-
const r = ma;
|
|
3606
|
-
return m(), v("div", {
|
|
3607
|
-
ref_key: "root",
|
|
3608
|
-
ref: n,
|
|
3609
|
-
class: "border-b dark:border-gray-700 border-gray-200"
|
|
3610
|
-
}, [
|
|
3611
|
-
a("div", {
|
|
3612
|
-
class: "cursor-pointer min-h-[60px] px-4 flex items-center justify-between",
|
|
3613
|
-
onClick: t
|
|
3614
|
-
}, [
|
|
3615
|
-
a("h4", null, C(e.label), 1),
|
|
3616
|
-
a("div", {
|
|
3617
|
-
class: E(["transition text-gray-400", { "rotate-x-180": l.value }])
|
|
3618
|
-
}, [
|
|
3619
|
-
b(r, { class: "size-6" })
|
|
3620
|
-
], 2)
|
|
3621
|
-
]),
|
|
3622
|
-
a("div", va, [
|
|
3623
|
-
a("div", pa, [
|
|
3624
|
-
_(o.$slots, "default")
|
|
3625
|
-
])
|
|
3626
|
-
])
|
|
3627
|
-
], 512);
|
|
3628
|
-
};
|
|
3629
|
-
}
|
|
3630
|
-
}), ha = ["onDragstart", "onDragenter"], ga = {
|
|
3631
|
-
key: 0,
|
|
3632
|
-
class: "absolute inset-0 border border-dashed border-blue-600 rounded"
|
|
3633
|
-
}, li = /* @__PURE__ */ B({
|
|
3634
|
-
__name: "VDragDrop",
|
|
3635
|
-
props: {
|
|
3636
|
-
items: {},
|
|
3637
|
-
itemKey: { default: "id" }
|
|
3638
|
-
},
|
|
3639
|
-
emits: ["update:items", "order-change"],
|
|
3640
|
-
setup(e, { emit: n }) {
|
|
3641
|
-
const l = n, s = O(null), t = O(0), o = O(-1), i = ({ id: f }) => ({
|
|
3642
|
-
"opacity-30 scale-105 z-10": s.value === f,
|
|
3643
|
-
"transition-transform duration-200": s.value !== f
|
|
3644
|
-
}), r = (f, p, g) => {
|
|
3645
|
-
s.value = p, t.value = g, f.dataTransfer.effectAllowed = "move";
|
|
3646
|
-
}, u = (f) => {
|
|
3647
|
-
s.value !== null && (o.value = f);
|
|
3648
|
-
}, c = () => {
|
|
3649
|
-
s.value = null, o.value = -1;
|
|
3650
|
-
}, d = (f) => {
|
|
3651
|
-
if (f.preventDefault(), s.value && o.value !== -1) {
|
|
3652
|
-
const p = e.items.findIndex((h) => h[e.itemKey] === s.value), g = o.value;
|
|
3653
|
-
if (p !== g && g !== -1) {
|
|
3654
|
-
const h = [...e.items], [$] = h.splice(p, 1);
|
|
3655
|
-
h.splice(g, 0, $), l("update:items", h), l("order-change", { fromIndex: p, toIndex: g, movedItem: $, newOrder: h });
|
|
3656
|
-
}
|
|
3657
|
-
}
|
|
3658
|
-
o.value = -1;
|
|
3659
|
-
};
|
|
3660
|
-
return (f, p) => (m(), v("div", {
|
|
3661
|
-
onDragover: p[1] || (p[1] = F(() => {
|
|
3662
|
-
}, ["prevent"])),
|
|
3663
|
-
onDrop: d
|
|
3664
|
-
}, [
|
|
3665
|
-
b(We, {
|
|
3666
|
-
"enter-active-class": "transition-all duration-300 ease",
|
|
3667
|
-
"enter-from-class": "opacity-0 translate-x-8",
|
|
3668
|
-
"enter-to-class": "opacity-100 translate-x-0",
|
|
3669
|
-
"leave-active-class": "transition-all duration-300 ease absolute",
|
|
3670
|
-
"leave-from-class": "opacity-100 translate-x-0",
|
|
3671
|
-
"leave-to-class": "opacity-0 translate-x-8",
|
|
3672
|
-
"move-class": "transition-all duration-300 ease"
|
|
3673
|
-
}, {
|
|
3674
|
-
default: y(() => [
|
|
3675
|
-
(m(!0), v(N, null, W(e.items, (g, h) => (m(), v("div", {
|
|
3676
|
-
key: `${g.id}_drug`,
|
|
3677
|
-
class: E(["relative group", i(g)]),
|
|
3678
|
-
draggable: "true",
|
|
3679
|
-
onDragstart: ($) => r($, g.id, h),
|
|
3680
|
-
onDragenter: ($) => u(h),
|
|
3681
|
-
onDragend: c,
|
|
3682
|
-
onDragover: p[0] || (p[0] = F(() => {
|
|
3683
|
-
}, ["prevent"]))
|
|
3684
|
-
}, [
|
|
3685
|
-
_(f.$slots, "default", {
|
|
3686
|
-
item: g,
|
|
3687
|
-
key: g.id,
|
|
3688
|
-
index: h,
|
|
3689
|
-
isDragging: s.value === g.id
|
|
3690
|
-
}),
|
|
3691
|
-
o.value === h && s.value !== g.id ? (m(), v("div", ga)) : T("", !0)
|
|
3692
|
-
], 42, ha))), 128))
|
|
3693
|
-
]),
|
|
3694
|
-
_: 3
|
|
3695
|
-
})
|
|
3696
|
-
], 32));
|
|
3697
|
-
}
|
|
3698
|
-
}), ba = { class: "min-w-full" }, ya = { class: "border-y border-gray-200 py-3 dark:border-gray-800" }, xa = { class: "bg-gray-200 dark:bg-gray-800" }, $a = { class: "flex items-center" }, ka = { class: "divide-y divide-gray-100 dark:divide-gray-800" }, _a = ["onClick"], wa = { class: "flex items-center text-gray-700 dark:text-gray-400" }, Ca = { key: 1 }, za = {
|
|
3699
|
-
class: "py-3 whitespace-nowrap",
|
|
3700
|
-
colspan: "9"
|
|
3701
|
-
}, Sa = { class: "flex items-center justify-center text-theme-sm text-gray-700 dark:text-gray-400 px-2" }, si = /* @__PURE__ */ B({
|
|
3702
|
-
__name: "VTable",
|
|
3703
|
-
props: {
|
|
3704
|
-
headers: { default: () => [] },
|
|
3705
|
-
items: { default: () => [] }
|
|
3706
|
-
},
|
|
3707
|
-
emits: ["click"],
|
|
3708
|
-
setup(e, { emit: n }) {
|
|
3709
|
-
const l = n, s = (i, r) => l("click", i, r), t = (i) => (i == null ? void 0 : i.className) || "", o = (i, { key: r }) => i == null ? void 0 : i[r];
|
|
3710
|
-
return (i, r) => (m(), v("table", ba, [
|
|
3711
|
-
a("thead", ya, [
|
|
3712
|
-
a("tr", xa, [
|
|
3713
|
-
(m(!0), v(N, null, W(e.headers, (u, c) => (m(), v("th", {
|
|
3714
|
-
key: c,
|
|
3715
|
-
class: E(["py-2 whitespace-nowrap text-gray-500 dark:text-gray-400 font-normal px-4", t(u)])
|
|
3716
|
-
}, [
|
|
3717
|
-
_(i.$slots, "header", {
|
|
3718
|
-
item: u,
|
|
3719
|
-
i: c
|
|
3720
|
-
}, () => [
|
|
3721
|
-
a("div", $a, C(u.name), 1)
|
|
3722
|
-
])
|
|
3723
|
-
], 2))), 128))
|
|
3724
|
-
])
|
|
3725
|
-
]),
|
|
3726
|
-
a("tbody", ka, [
|
|
3727
|
-
e.items.length ? (m(!0), v(N, { key: 0 }, W(e.items, (u, c) => (m(), v("tr", {
|
|
3728
|
-
key: c,
|
|
3729
|
-
class: "hover:bg-gray-50/50 dark:hover:bg-gray-800/50",
|
|
3730
|
-
onClick: (d) => s(u, d)
|
|
3731
|
-
}, [
|
|
3732
|
-
(m(!0), v(N, null, W(e.headers, (d, f) => (m(), v("td", {
|
|
3733
|
-
key: f,
|
|
3734
|
-
class: "py-2 px-4"
|
|
3735
|
-
}, [
|
|
3736
|
-
a("div", wa, [
|
|
3737
|
-
_(i.$slots, d.key, {
|
|
3738
|
-
item: u,
|
|
3739
|
-
i: c
|
|
3740
|
-
}, () => [
|
|
3741
|
-
H(C(o(u, d)), 1)
|
|
3742
|
-
])
|
|
3743
|
-
])
|
|
3744
|
-
]))), 128))
|
|
3745
|
-
], 8, _a))), 128)) : (m(), v("tr", Ca, [
|
|
3746
|
-
a("td", za, [
|
|
3747
|
-
a("div", Sa, [
|
|
3748
|
-
_(i.$slots, "empty", {}, () => [
|
|
3749
|
-
r[0] || (r[0] = H("The list is empty", -1))
|
|
3750
|
-
])
|
|
3751
|
-
])
|
|
3752
|
-
])
|
|
3753
|
-
]))
|
|
3754
|
-
])
|
|
3755
|
-
]));
|
|
3756
|
-
}
|
|
3757
|
-
}), oi = /* @__PURE__ */ B({
|
|
3758
|
-
__name: "VTooltip",
|
|
3759
|
-
props: {
|
|
3760
|
-
timeout: {},
|
|
3761
|
-
disabled: { type: Boolean }
|
|
3762
|
-
},
|
|
3763
|
-
setup(e) {
|
|
3764
|
-
const n = O(!1), l = () => {
|
|
3765
|
-
e.disabled || (n.value = !0);
|
|
3766
|
-
}, s = () => {
|
|
3767
|
-
n.value = !1;
|
|
3768
|
-
}, t = Ge("tooltip");
|
|
3769
|
-
return kt(t, () => s()), (o, i) => (m(), v("div", {
|
|
3770
|
-
ref: "tooltip",
|
|
3771
|
-
class: "relative v-tooltip",
|
|
3772
|
-
onMouseenter: l,
|
|
3773
|
-
onMouseleave: s
|
|
3774
|
-
}, [
|
|
3775
|
-
a("button", {
|
|
3776
|
-
type: "button",
|
|
3777
|
-
onClick: l
|
|
3778
|
-
}, [
|
|
3779
|
-
_(o.$slots, "activator")
|
|
3780
|
-
]),
|
|
3781
|
-
b(de, {
|
|
3782
|
-
"enter-active-class": "duration-300 ease-out",
|
|
3783
|
-
"enter-from-class": "transform opacity-0 -translate-y-2",
|
|
3784
|
-
"enter-to-class": "opacity-100 translate-y-0",
|
|
3785
|
-
"leave-active-class": "duration-200 ease-in",
|
|
3786
|
-
"leave-from-class": "opacity-100 translate-y-0",
|
|
3787
|
-
"leave-to-class": "transform opacity-0 -translate-y-2"
|
|
3788
|
-
}, {
|
|
3789
|
-
default: y(() => [
|
|
3790
|
-
_(o.$slots, "default", { show: n.value })
|
|
3791
|
-
]),
|
|
3792
|
-
_: 3
|
|
3793
|
-
})
|
|
3794
|
-
], 544));
|
|
3795
|
-
}
|
|
3796
|
-
}), Re = {
|
|
3797
|
-
VButton: j,
|
|
3798
|
-
VLoader: Ae,
|
|
3799
|
-
VDropdown: Ce,
|
|
3800
|
-
VList: be,
|
|
3801
|
-
VTextField: Y,
|
|
3802
|
-
VSelect: se,
|
|
3803
|
-
VWifiIcon: nt,
|
|
3804
|
-
CardMain: Zl,
|
|
3805
|
-
VIconLogoMini: Ye,
|
|
3806
|
-
VIconLogo: Me,
|
|
3807
|
-
VDialog: De
|
|
3808
|
-
}, ai = {
|
|
3809
|
-
install: (e) => {
|
|
3810
|
-
Object.keys(Re).forEach((n) => {
|
|
3811
|
-
e.component(n, Re[n]);
|
|
3812
|
-
}), Bt.forEach(({ name: n, directive: l }) => e.directive(n, l));
|
|
1
|
+
import { _ as s, V as e, a, b as o, c as d, d as m, e as r, f as _, g as f, h as u, i as V } from "./VDialog.vue_vue_type_script_setup_true_lang-BLLrcXdW.js";
|
|
2
|
+
const l = {
|
|
3
|
+
mounted(c, i) {
|
|
4
|
+
c.clickOutsideEvent = function(t) {
|
|
5
|
+
c === t.target || c.contains(t.target) || i.value(t, c);
|
|
6
|
+
}, document.addEventListener("click", c.clickOutsideEvent);
|
|
7
|
+
},
|
|
8
|
+
unmounted(c) {
|
|
9
|
+
document.removeEventListener("click", c.clickOutsideEvent), delete c.clickOutsideEvent;
|
|
10
|
+
}
|
|
11
|
+
}, v = [{ name: "outside", directive: l }], n = {
|
|
12
|
+
VButton: V,
|
|
13
|
+
VLoader: u,
|
|
14
|
+
VDropdown: f,
|
|
15
|
+
VList: _,
|
|
16
|
+
VTextField: r,
|
|
17
|
+
VSelect: m,
|
|
18
|
+
VWifiIcon: d,
|
|
19
|
+
CardMain: o,
|
|
20
|
+
VIconLogoMini: a,
|
|
21
|
+
VIconLogo: e,
|
|
22
|
+
VDialog: s
|
|
23
|
+
}, E = {
|
|
24
|
+
install: (c) => {
|
|
25
|
+
Object.keys(n).forEach((i) => {
|
|
26
|
+
c.component(i, n[i]);
|
|
27
|
+
}), v.forEach(({ name: i, directive: t }) => c.directive(i, t));
|
|
3813
28
|
}
|
|
3814
29
|
};
|
|
3815
30
|
export {
|
|
3816
|
-
|
|
3817
|
-
Aa as AppHeader,
|
|
3818
|
-
Oa as AppNav,
|
|
3819
|
-
Da as AppNotification,
|
|
3820
|
-
Ia as AppOverlay,
|
|
3821
|
-
ja as AppProgress,
|
|
3822
|
-
Ua as BlockBreadcrumb,
|
|
3823
|
-
Pa as BlockInfo,
|
|
3824
|
-
Ha as BlockScan,
|
|
3825
|
-
Na as BlockService,
|
|
3826
|
-
Fa as BlockStatus,
|
|
3827
|
-
Ra as BlockUpdate,
|
|
3828
|
-
me as CardBase,
|
|
3829
|
-
Ka as CardButton,
|
|
3830
|
-
Wa as CardDate,
|
|
3831
|
-
qa as CardDimmer,
|
|
3832
|
-
Ga as CardInfo,
|
|
3833
|
-
Za as CardInput,
|
|
3834
|
-
Ja as CardList,
|
|
3835
|
-
Zl as CardMain,
|
|
3836
|
-
$n as CardNotification,
|
|
3837
|
-
Xa as ItemEdit,
|
|
3838
|
-
ei as ScriptDialog,
|
|
3839
|
-
Ya as ScriptEditor,
|
|
3840
|
-
Qa as ScriptViewDocs,
|
|
3841
|
-
ti as VAutocomplete,
|
|
3842
|
-
j as VButton,
|
|
3843
|
-
co as VCheckbox,
|
|
3844
|
-
De as VDialog,
|
|
3845
|
-
li as VDragDrop,
|
|
3846
|
-
Ce as VDropdown,
|
|
3847
|
-
ni as VExpansion,
|
|
3848
|
-
jl as VFile,
|
|
3849
|
-
Se as VFunc,
|
|
3850
|
-
Me as VIconLogo,
|
|
3851
|
-
Ye as VIconLogoMini,
|
|
3852
|
-
be as VList,
|
|
3853
|
-
ot as VListObject,
|
|
3854
|
-
Ae as VLoader,
|
|
3855
|
-
tt as VPopup,
|
|
3856
|
-
se as VSelect,
|
|
3857
|
-
si as VTable,
|
|
3858
|
-
no as VTabs,
|
|
3859
|
-
Y as VTextField,
|
|
3860
|
-
st as VTextWrapper,
|
|
3861
|
-
oi as VTooltip,
|
|
3862
|
-
nt as VWifiIcon,
|
|
3863
|
-
ci as dashboardCards,
|
|
3864
|
-
ai as default,
|
|
3865
|
-
ut as getDataValue,
|
|
3866
|
-
di as getFunction,
|
|
3867
|
-
ui as getParamsData,
|
|
3868
|
-
fi as getStateItem,
|
|
3869
|
-
mi as setStateItem
|
|
31
|
+
E as default
|
|
3870
32
|
};
|