@vasakgroup/vue-libvasak 0.3.3 → 0.3.5
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.
|
@@ -3,9 +3,9 @@ type __VLS_Props = {
|
|
|
3
3
|
collapsed?: boolean;
|
|
4
4
|
defaultOpen?: boolean;
|
|
5
5
|
};
|
|
6
|
-
declare var
|
|
6
|
+
declare var __VLS_6: {};
|
|
7
7
|
type __VLS_Slots = {} & {
|
|
8
|
-
default?: (props: typeof
|
|
8
|
+
default?: (props: typeof __VLS_6) => any;
|
|
9
9
|
};
|
|
10
10
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
11
11
|
collapsed: boolean;
|
package/dist/vue-libvasak.es.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { ref as y, onMounted as V, onUnmounted as
|
|
2
|
-
import { listen as
|
|
3
|
-
import { getSymbolSource as
|
|
4
|
-
import { getCurrentWindow as
|
|
5
|
-
function
|
|
1
|
+
import { ref as y, onMounted as V, onUnmounted as R, watch as M, defineComponent as g, toRef as E, computed as k, createElementBlock as l, unref as w, openBlock as a, normalizeStyle as O, createCommentVNode as m, createElementVNode as r, createVNode as B, toDisplayString as b, normalizeClass as f, renderSlot as x, createBlock as T, onBeforeUnmount as G, Fragment as z, renderList as A, withCtx as U, mergeModels as q, useAttrs as H, useId as J, useModel as K, withDirectives as Q, mergeProps as X, isRef as Y, vModelSelect as Z, withModifiers as _ } from "vue";
|
|
2
|
+
import { listen as ee } from "@tauri-apps/api/event";
|
|
3
|
+
import { getSymbolSource as te, getIconSource as S } from "@vasakgroup/plugin-vicons";
|
|
4
|
+
import { getCurrentWindow as ae } from "@tauri-apps/api/window";
|
|
5
|
+
function le(e, s) {
|
|
6
6
|
const t = y("");
|
|
7
7
|
let n = null, i = !1, c = 0;
|
|
8
|
-
async function
|
|
9
|
-
const
|
|
8
|
+
async function d() {
|
|
9
|
+
const u = ++c, o = e.value;
|
|
10
10
|
if (!o) {
|
|
11
11
|
t.value = "";
|
|
12
12
|
return;
|
|
13
13
|
}
|
|
14
|
-
const h = s.value === "symbol" ? await
|
|
15
|
-
|
|
14
|
+
const h = s.value === "symbol" ? await te(o) : await S(o);
|
|
15
|
+
u === c && (t.value = h);
|
|
16
16
|
}
|
|
17
17
|
return V(async () => {
|
|
18
|
-
const
|
|
18
|
+
const u = await ee("vicons:theme-changed", d);
|
|
19
19
|
if (i) {
|
|
20
|
-
|
|
20
|
+
u();
|
|
21
21
|
return;
|
|
22
22
|
}
|
|
23
|
-
n =
|
|
24
|
-
}),
|
|
23
|
+
n = u, await d();
|
|
24
|
+
}), R(() => {
|
|
25
25
|
i = !0, n?.();
|
|
26
|
-
}),
|
|
26
|
+
}), M(e, d), t;
|
|
27
27
|
}
|
|
28
|
-
const
|
|
28
|
+
const ne = ["src", "alt"], C = /* @__PURE__ */ g({
|
|
29
29
|
__name: "ThemeIcon",
|
|
30
30
|
props: {
|
|
31
31
|
name: {},
|
|
@@ -34,23 +34,23 @@ const le = ["src", "alt"], C = /* @__PURE__ */ g({
|
|
|
34
34
|
alt: { default: "" }
|
|
35
35
|
},
|
|
36
36
|
setup(e) {
|
|
37
|
-
const s = e, t =
|
|
37
|
+
const s = e, t = le(E(s, "name"), E(s, "type")), n = k(() => `${s.size}px`);
|
|
38
38
|
return (i, c) => w(t) ? (a(), l("img", {
|
|
39
39
|
key: 0,
|
|
40
40
|
src: w(t),
|
|
41
41
|
alt: e.alt,
|
|
42
|
-
style:
|
|
42
|
+
style: O({ width: n.value, height: n.value }),
|
|
43
43
|
class: "shrink-0 object-contain"
|
|
44
|
-
}, null, 12,
|
|
44
|
+
}, null, 12, ne)) : (a(), l("span", {
|
|
45
45
|
key: 1,
|
|
46
|
-
style:
|
|
46
|
+
style: O({ width: n.value, height: n.value }),
|
|
47
47
|
class: "shrink-0"
|
|
48
48
|
}, null, 4));
|
|
49
49
|
}
|
|
50
|
-
}),
|
|
50
|
+
}), se = { class: "flex flex-col gap-2" }, oe = ["aria-expanded"], ie = {
|
|
51
51
|
key: 1,
|
|
52
52
|
class: "flex flex-col gap-1"
|
|
53
|
-
},
|
|
53
|
+
}, N = /* @__PURE__ */ g({
|
|
54
54
|
__name: "SideGroup",
|
|
55
55
|
props: {
|
|
56
56
|
title: {},
|
|
@@ -59,12 +59,12 @@ const le = ["src", "alt"], C = /* @__PURE__ */ g({
|
|
|
59
59
|
},
|
|
60
60
|
setup(e) {
|
|
61
61
|
const s = e, t = y(s.defaultOpen);
|
|
62
|
-
return
|
|
62
|
+
return M(
|
|
63
63
|
() => s.collapsed,
|
|
64
64
|
(n) => {
|
|
65
65
|
n && (t.value = !0);
|
|
66
66
|
}
|
|
67
|
-
), (n, i) => (a(), l("section",
|
|
67
|
+
), (n, i) => (a(), l("section", se, [
|
|
68
68
|
e.collapsed ? m("", !0) : (a(), l("button", {
|
|
69
69
|
key: 0,
|
|
70
70
|
type: "button",
|
|
@@ -73,19 +73,22 @@ const le = ["src", "alt"], C = /* @__PURE__ */ g({
|
|
|
73
73
|
onClick: i[0] || (i[0] = (c) => t.value = !t.value)
|
|
74
74
|
}, [
|
|
75
75
|
r("span", null, b(e.title), 1),
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
76
|
+
B(C, {
|
|
77
|
+
name: "pan-down-symbolic",
|
|
78
|
+
type: "symbol",
|
|
79
|
+
size: 12,
|
|
80
|
+
class: f(["transition-transform duration-200", t.value ? "" : "-rotate-90"])
|
|
81
|
+
}, null, 8, ["class"])
|
|
82
|
+
], 8, oe)),
|
|
83
|
+
t.value || e.collapsed ? (a(), l("div", ie, [
|
|
81
84
|
x(n.$slots, "default")
|
|
82
85
|
])) : m("", !0)
|
|
83
86
|
]));
|
|
84
87
|
}
|
|
85
|
-
}),
|
|
88
|
+
}), re = ["title", "aria-label", "disabled", "aria-current"], ce = { key: 1 }, de = {
|
|
86
89
|
key: 0,
|
|
87
90
|
class: "min-w-0 flex-1 truncate font-medium"
|
|
88
|
-
},
|
|
91
|
+
}, ue = {
|
|
89
92
|
key: 1,
|
|
90
93
|
class: "rounded-corner bg-ui-surface px-2 py-0.5 font-semibold text-tx-muted text-xs"
|
|
91
94
|
}, P = /* @__PURE__ */ g({
|
|
@@ -117,32 +120,32 @@ const le = ["src", "alt"], C = /* @__PURE__ */ g({
|
|
|
117
120
|
class: f(["flex h-8 w-8 shrink-0 items-center justify-center rounded-corner font-semibold text-xs uppercase tracking-wide", e.active ? "border-secondary bg-primary/20" : ""]),
|
|
118
121
|
"aria-hidden": "true"
|
|
119
122
|
}, [
|
|
120
|
-
e.icon ? (a(),
|
|
123
|
+
e.icon ? (a(), T(C, {
|
|
121
124
|
key: 0,
|
|
122
125
|
name: e.icon,
|
|
123
126
|
size: 20
|
|
124
|
-
}, null, 8, ["name"])) : (a(), l("span",
|
|
127
|
+
}, null, 8, ["name"])) : (a(), l("span", ce, b(e.label.charAt(0).toUpperCase()), 1))
|
|
125
128
|
], 2),
|
|
126
|
-
e.collapsed ? m("", !0) : (a(), l("span",
|
|
127
|
-
!e.collapsed && e.badge !== "" ? (a(), l("span",
|
|
128
|
-
], 10,
|
|
129
|
+
e.collapsed ? m("", !0) : (a(), l("span", de, b(e.label), 1)),
|
|
130
|
+
!e.collapsed && e.badge !== "" ? (a(), l("span", ue, b(e.badge), 1)) : m("", !0)
|
|
131
|
+
], 10, re));
|
|
129
132
|
}
|
|
130
|
-
}),
|
|
133
|
+
}), me = {
|
|
131
134
|
key: 0,
|
|
132
135
|
class: "flex flex-col gap-2 border-ui-border border-b p-2"
|
|
133
|
-
},
|
|
136
|
+
}, fe = { class: "flex items-center gap-2" }, be = ["aria-label", "aria-expanded"], ge = {
|
|
134
137
|
key: 0,
|
|
135
138
|
class: "min-w-0 flex-1"
|
|
136
|
-
},
|
|
139
|
+
}, he = {
|
|
137
140
|
key: 0,
|
|
138
141
|
class: "truncate font-semibold text-sm"
|
|
139
|
-
},
|
|
142
|
+
}, ve = {
|
|
140
143
|
key: 1,
|
|
141
144
|
class: "truncate text-tx-muted text-xs"
|
|
142
|
-
},
|
|
145
|
+
}, ye = { key: 0 }, xe = {
|
|
143
146
|
key: 1,
|
|
144
147
|
class: "flex border-ui-border border-b p-2"
|
|
145
|
-
},
|
|
148
|
+
}, pe = ["aria-label", "aria-expanded"], ke = { class: "flex min-h-0 flex-1 flex-col gap-3 overflow-y-auto p-2" }, D = "hidden h-8 w-8 shrink-0 items-center justify-center rounded-corner border border-ui-border bg-ui-surface/70 transition-colors hover:bg-ui-surface md:inline-flex", F = 767, we = /* @__PURE__ */ g({
|
|
146
149
|
__name: "SideBar",
|
|
147
150
|
props: {
|
|
148
151
|
title: { default: "" },
|
|
@@ -155,75 +158,77 @@ const le = ["src", "alt"], C = /* @__PURE__ */ g({
|
|
|
155
158
|
},
|
|
156
159
|
emits: ["update:modelValue", "update:collapsed", "change"],
|
|
157
160
|
setup(e, { expose: s, emit: t }) {
|
|
158
|
-
const n = e, i = t, c = y(n.collapsed ?? !1),
|
|
159
|
-
let
|
|
160
|
-
const o = k(() =>
|
|
161
|
+
const n = e, i = t, c = y(n.collapsed ?? !1), d = y(!1);
|
|
162
|
+
let u = null;
|
|
163
|
+
const o = k(() => d.value || c.value), h = k(() => !!(n.title || n.subtitle));
|
|
161
164
|
k(() => n.categories.length > 0);
|
|
162
|
-
function
|
|
163
|
-
|
|
165
|
+
function $() {
|
|
166
|
+
d.value = window.innerWidth <= F;
|
|
164
167
|
}
|
|
165
|
-
function
|
|
168
|
+
function j() {
|
|
166
169
|
c.value = !c.value, i("update:collapsed", c.value);
|
|
167
170
|
}
|
|
168
|
-
function
|
|
171
|
+
function W(v) {
|
|
169
172
|
i("update:modelValue", v), i("change", v);
|
|
170
173
|
}
|
|
171
|
-
return
|
|
174
|
+
return M(
|
|
172
175
|
() => n.collapsed,
|
|
173
176
|
(v) => {
|
|
174
177
|
v !== void 0 && (c.value = v);
|
|
175
178
|
}
|
|
176
179
|
), V(() => {
|
|
177
|
-
|
|
178
|
-
}),
|
|
180
|
+
u = window.matchMedia(`(max-width: ${F}px)`), $(), u.addEventListener("change", $), window.addEventListener("resize", $);
|
|
181
|
+
}), G(() => {
|
|
182
|
+
u?.removeEventListener("change", $), window.removeEventListener("resize", $);
|
|
183
|
+
}), s({ collapsed: o }), (v, Ct) => (a(), l("aside", {
|
|
179
184
|
class: f(["relative z-30 flex h-full shrink-0 flex-col rounded-corner border border-ui-border bg-ui-surface/70 transition-all duration-300", ["w-[84px]", o.value ? "md:w-[84px]" : "md:w-72"]])
|
|
180
185
|
}, [
|
|
181
|
-
h.value || v.$slots.header ? (a(), l("header",
|
|
182
|
-
r("div",
|
|
186
|
+
h.value || v.$slots.header ? (a(), l("header", me, [
|
|
187
|
+
r("div", fe, [
|
|
183
188
|
r("button", {
|
|
184
189
|
type: "button",
|
|
185
|
-
class: f(
|
|
190
|
+
class: f(D),
|
|
186
191
|
"aria-label": o.value ? e.expandLabel : e.collapseLabel,
|
|
187
192
|
"aria-expanded": !o.value,
|
|
188
|
-
onClick:
|
|
193
|
+
onClick: j
|
|
189
194
|
}, [
|
|
190
195
|
B(C, {
|
|
191
196
|
name: o.value ? "pan-end-symbolic" : "pan-start-symbolic",
|
|
192
197
|
type: "symbol",
|
|
193
198
|
size: 16
|
|
194
199
|
}, null, 8, ["name"])
|
|
195
|
-
], 8,
|
|
196
|
-
h.value && !o.value ? (a(), l("div",
|
|
197
|
-
e.title ? (a(), l("p",
|
|
198
|
-
e.subtitle ? (a(), l("p",
|
|
200
|
+
], 8, be),
|
|
201
|
+
h.value && !o.value ? (a(), l("div", ge, [
|
|
202
|
+
e.title ? (a(), l("p", he, b(e.title), 1)) : m("", !0),
|
|
203
|
+
e.subtitle ? (a(), l("p", ve, b(e.subtitle), 1)) : m("", !0)
|
|
199
204
|
])) : m("", !0)
|
|
200
205
|
]),
|
|
201
|
-
v.$slots.header && !o.value ? (a(), l("div",
|
|
206
|
+
v.$slots.header && !o.value ? (a(), l("div", ye, [
|
|
202
207
|
x(v.$slots, "header", { collapsed: o.value })
|
|
203
208
|
])) : m("", !0)
|
|
204
|
-
])) : (a(), l("div",
|
|
209
|
+
])) : (a(), l("div", xe, [
|
|
205
210
|
r("button", {
|
|
206
211
|
type: "button",
|
|
207
|
-
class: f(
|
|
212
|
+
class: f(D),
|
|
208
213
|
"aria-label": o.value ? e.expandLabel : e.collapseLabel,
|
|
209
214
|
"aria-expanded": !o.value,
|
|
210
|
-
onClick:
|
|
215
|
+
onClick: j
|
|
211
216
|
}, [
|
|
212
217
|
B(C, {
|
|
213
218
|
name: o.value ? "pan-end-symbolic" : "pan-start-symbolic",
|
|
214
219
|
type: "symbol",
|
|
215
220
|
size: 16
|
|
216
221
|
}, null, 8, ["name"])
|
|
217
|
-
], 8,
|
|
222
|
+
], 8, pe)
|
|
218
223
|
])),
|
|
219
|
-
r("div",
|
|
220
|
-
(a(!0), l(
|
|
221
|
-
key:
|
|
222
|
-
title:
|
|
224
|
+
r("div", ke, [
|
|
225
|
+
(a(!0), l(z, null, A(e.categories, (L) => (a(), T(N, {
|
|
226
|
+
key: L.id,
|
|
227
|
+
title: L.title,
|
|
223
228
|
collapsed: o.value
|
|
224
229
|
}, {
|
|
225
|
-
default:
|
|
226
|
-
(a(!0), l(
|
|
230
|
+
default: U(() => [
|
|
231
|
+
(a(!0), l(z, null, A(L.items, (p) => (a(), T(P, {
|
|
227
232
|
key: p.id,
|
|
228
233
|
label: p.label,
|
|
229
234
|
icon: p.icon,
|
|
@@ -231,7 +236,7 @@ const le = ["src", "alt"], C = /* @__PURE__ */ g({
|
|
|
231
236
|
disabled: p.disabled,
|
|
232
237
|
collapsed: o.value,
|
|
233
238
|
active: e.modelValue === p.id,
|
|
234
|
-
onClick: (
|
|
239
|
+
onClick: ($t) => W(p.id)
|
|
235
240
|
}, null, 8, ["label", "icon", "badge", "disabled", "collapsed", "active", "onClick"]))), 128))
|
|
236
241
|
]),
|
|
237
242
|
_: 2
|
|
@@ -240,10 +245,10 @@ const le = ["src", "alt"], C = /* @__PURE__ */ g({
|
|
|
240
245
|
])
|
|
241
246
|
], 2));
|
|
242
247
|
}
|
|
243
|
-
}),
|
|
248
|
+
}), Ce = { class: "flex min-w-0 flex-col gap-1" }, $e = ["for"], Be = { class: "relative flex min-w-0 items-center" }, Se = ["id"], ze = /* @__PURE__ */ g({
|
|
244
249
|
inheritAttrs: !1,
|
|
245
250
|
__name: "SelectField",
|
|
246
|
-
props: /* @__PURE__ */
|
|
251
|
+
props: /* @__PURE__ */ q({
|
|
247
252
|
label: {}
|
|
248
253
|
}, {
|
|
249
254
|
modelValue: {
|
|
@@ -253,26 +258,26 @@ const le = ["src", "alt"], C = /* @__PURE__ */ g({
|
|
|
253
258
|
}),
|
|
254
259
|
emits: ["update:modelValue"],
|
|
255
260
|
setup(e) {
|
|
256
|
-
const s = e, t =
|
|
257
|
-
set(
|
|
258
|
-
return
|
|
261
|
+
const s = e, t = H(), n = J(), i = k(() => t.id ?? n), [c, d] = K(e, "modelValue", {
|
|
262
|
+
set(u) {
|
|
263
|
+
return d.number ? Number(u) : u;
|
|
259
264
|
}
|
|
260
265
|
});
|
|
261
|
-
return (
|
|
266
|
+
return (u, o) => (a(), l("div", Ce, [
|
|
262
267
|
s.label ? (a(), l("label", {
|
|
263
268
|
key: 0,
|
|
264
269
|
for: i.value,
|
|
265
270
|
class: "text-tx-muted text-xs"
|
|
266
|
-
}, b(s.label), 9,
|
|
267
|
-
r("div",
|
|
268
|
-
|
|
271
|
+
}, b(s.label), 9, $e)) : m("", !0),
|
|
272
|
+
r("div", Be, [
|
|
273
|
+
Q(r("select", X({
|
|
269
274
|
id: i.value,
|
|
270
|
-
"onUpdate:modelValue": o[0] || (o[0] = (h) =>
|
|
275
|
+
"onUpdate:modelValue": o[0] || (o[0] = (h) => Y(c) ? c.value = h : null),
|
|
271
276
|
class: "min-w-0 flex-1 appearance-none truncate rounded-corner border border-ui-border bg-ui-surface/60 py-1.5 pr-8 pl-2 text-sm text-tx-main"
|
|
272
277
|
}, w(t)), [
|
|
273
|
-
x(
|
|
274
|
-
], 16,
|
|
275
|
-
[
|
|
278
|
+
x(u.$slots, "default")
|
|
279
|
+
], 16, Se), [
|
|
280
|
+
[Z, w(c)]
|
|
276
281
|
]),
|
|
277
282
|
B(C, {
|
|
278
283
|
name: "pan-down-symbolic",
|
|
@@ -283,31 +288,31 @@ const le = ["src", "alt"], C = /* @__PURE__ */ g({
|
|
|
283
288
|
])
|
|
284
289
|
]));
|
|
285
290
|
}
|
|
286
|
-
}),
|
|
291
|
+
}), Ie = { "data-tauri-drag-region": "" }, Le = ["src", "alt"], Te = { "data-tauri-drag-region": "" }, Ae = { "data-tauri-drag-region": "" }, Ve = ["src"], Me = ["src"], je = ["src"], Ee = /* @__PURE__ */ g({
|
|
287
292
|
__name: "TopBar",
|
|
288
293
|
props: {
|
|
289
294
|
title: String,
|
|
290
295
|
image: String
|
|
291
296
|
},
|
|
292
297
|
setup(e) {
|
|
293
|
-
const s = y(null), t =
|
|
298
|
+
const s = y(null), t = ae(), n = y(""), i = y(""), c = y(""), d = e;
|
|
294
299
|
return V(async () => {
|
|
295
|
-
n.value = await
|
|
296
|
-
}), (
|
|
300
|
+
n.value = await S("window-close"), i.value = await S("window-minimize"), c.value = await S("window-maximize");
|
|
301
|
+
}), (u, o) => (a(), l("div", {
|
|
297
302
|
"data-tauri-drag-region": "",
|
|
298
303
|
class: "flex h-8 px-4 py-1 bg-primary dark:bg-primary-dark rounded-t-corner-window justify-between align-center",
|
|
299
304
|
ref_key: "bar",
|
|
300
305
|
ref: s
|
|
301
306
|
}, [
|
|
302
|
-
r("div",
|
|
307
|
+
r("div", Ie, [
|
|
303
308
|
r("img", {
|
|
304
|
-
src:
|
|
309
|
+
src: d.image,
|
|
305
310
|
"data-tauri-drag-region": "",
|
|
306
311
|
class: "h-6 w-auto",
|
|
307
|
-
alt:
|
|
308
|
-
}, null, 8,
|
|
312
|
+
alt: d.title
|
|
313
|
+
}, null, 8, Le)
|
|
309
314
|
]),
|
|
310
|
-
r("div", Te, b(
|
|
315
|
+
r("div", Te, b(d.title), 1),
|
|
311
316
|
r("div", Ae, [
|
|
312
317
|
r("span", {
|
|
313
318
|
class: "win-button",
|
|
@@ -317,7 +322,7 @@ const le = ["src", "alt"], C = /* @__PURE__ */ g({
|
|
|
317
322
|
src: i.value,
|
|
318
323
|
class: "h-6 w-6 inline-block",
|
|
319
324
|
alt: "Minimize"
|
|
320
|
-
}, null, 8,
|
|
325
|
+
}, null, 8, Ve)
|
|
321
326
|
]),
|
|
322
327
|
r("span", {
|
|
323
328
|
class: "win-button",
|
|
@@ -327,7 +332,7 @@ const le = ["src", "alt"], C = /* @__PURE__ */ g({
|
|
|
327
332
|
src: c.value,
|
|
328
333
|
class: "h-6 w-6 inline-block",
|
|
329
334
|
alt: "Maximize"
|
|
330
|
-
}, null, 8,
|
|
335
|
+
}, null, 8, Me)
|
|
331
336
|
]),
|
|
332
337
|
r("span", {
|
|
333
338
|
class: "win-button",
|
|
@@ -342,7 +347,7 @@ const le = ["src", "alt"], C = /* @__PURE__ */ g({
|
|
|
342
347
|
])
|
|
343
348
|
], 512));
|
|
344
349
|
}
|
|
345
|
-
}),
|
|
350
|
+
}), Oe = /* @__PURE__ */ g({
|
|
346
351
|
__name: "WindowFrame",
|
|
347
352
|
props: {
|
|
348
353
|
title: { default: "Vasak" },
|
|
@@ -350,18 +355,18 @@ const le = ["src", "alt"], C = /* @__PURE__ */ g({
|
|
|
350
355
|
},
|
|
351
356
|
setup(e) {
|
|
352
357
|
const s = e;
|
|
353
|
-
return (t, n) => (a(), l(
|
|
354
|
-
B(
|
|
358
|
+
return (t, n) => (a(), l(z, null, [
|
|
359
|
+
B(Ee, {
|
|
355
360
|
title: s.title,
|
|
356
361
|
image: s.image
|
|
357
362
|
}, null, 8, ["title", "image"]),
|
|
358
363
|
x(t.$slots, "default")
|
|
359
364
|
], 64));
|
|
360
365
|
}
|
|
361
|
-
}),
|
|
366
|
+
}), De = ["type", "disabled"], Fe = {
|
|
362
367
|
key: 0,
|
|
363
368
|
class: "w-4 h-4 animate-spin rounded-full border-2 border-current border-t-transparent"
|
|
364
|
-
},
|
|
369
|
+
}, Ne = ["src", "alt"], Pe = { key: 2 }, We = ["src", "alt"], Re = /* @__PURE__ */ g({
|
|
365
370
|
__name: "ActionButton",
|
|
366
371
|
props: {
|
|
367
372
|
label: {},
|
|
@@ -388,12 +393,12 @@ const le = ["src", "alt"], C = /* @__PURE__ */ g({
|
|
|
388
393
|
sm: "px-2 py-1 text-xs",
|
|
389
394
|
md: "px-3 py-1 text-sm",
|
|
390
395
|
lg: "px-4 py-2 text-base"
|
|
391
|
-
},
|
|
392
|
-
t.stopPropagation &&
|
|
396
|
+
}, d = (u) => {
|
|
397
|
+
t.stopPropagation && u.stopPropagation(), t.preventDefault && u.preventDefault(), !t.disabled && !t.loading && n("click");
|
|
393
398
|
};
|
|
394
|
-
return (
|
|
399
|
+
return (u, o) => (a(), l("button", {
|
|
395
400
|
type: t.type,
|
|
396
|
-
onClick:
|
|
401
|
+
onClick: d,
|
|
397
402
|
class: f(["rounded-corner transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2", [
|
|
398
403
|
i[t.variant],
|
|
399
404
|
c[t.size],
|
|
@@ -403,28 +408,28 @@ const le = ["src", "alt"], C = /* @__PURE__ */ g({
|
|
|
403
408
|
]]),
|
|
404
409
|
disabled: t.disabled || t.loading
|
|
405
410
|
}, [
|
|
406
|
-
e.loading ? (a(), l("span",
|
|
411
|
+
e.loading ? (a(), l("span", Fe)) : m("", !0),
|
|
407
412
|
t.iconSrc && !t.iconRight ? (a(), l("img", {
|
|
408
413
|
key: 1,
|
|
409
414
|
src: t.iconSrc,
|
|
410
415
|
alt: t.iconAlt || t.label,
|
|
411
416
|
class: "w-4 h-4"
|
|
412
|
-
}, null, 8,
|
|
417
|
+
}, null, 8, Ne)) : m("", !0),
|
|
413
418
|
t.label ? (a(), l("span", Pe, b(t.label), 1)) : m("", !0),
|
|
414
419
|
t.iconSrc && t.iconRight ? (a(), l("img", {
|
|
415
420
|
key: 3,
|
|
416
421
|
src: t.iconSrc,
|
|
417
422
|
alt: t.iconAlt || t.label,
|
|
418
423
|
class: "w-4 h-4"
|
|
419
|
-
}, null, 8,
|
|
420
|
-
], 10,
|
|
424
|
+
}, null, 8, We)) : m("", !0)
|
|
425
|
+
], 10, De));
|
|
421
426
|
}
|
|
422
|
-
}),
|
|
427
|
+
}), I = (e, s) => {
|
|
423
428
|
const t = e.__vccOpts || e;
|
|
424
429
|
for (const [n, i] of s)
|
|
425
430
|
t[n] = i;
|
|
426
431
|
return t;
|
|
427
|
-
},
|
|
432
|
+
}, Ge = /* @__PURE__ */ I(Re, [["__scopeId", "data-v-2eaf6e27"]]), Ue = { class: "text-base font-semibold m-0 text-primary dark:text-primary-dark" }, qe = /* @__PURE__ */ g({
|
|
428
433
|
__name: "ConfigSection",
|
|
429
434
|
props: {
|
|
430
435
|
title: {},
|
|
@@ -435,23 +440,23 @@ const le = ["src", "alt"], C = /* @__PURE__ */ g({
|
|
|
435
440
|
return (s, t) => (a(), l("div", {
|
|
436
441
|
class: f(["flex flex-col gap-4 p-4 background rounded-corner", e.customClass])
|
|
437
442
|
}, [
|
|
438
|
-
r("h3",
|
|
443
|
+
r("h3", Ue, b(e.icon ? `${e.icon} ${e.title}` : e.title), 1),
|
|
439
444
|
x(s.$slots, "default", {}, void 0, !0)
|
|
440
445
|
], 2));
|
|
441
446
|
}
|
|
442
|
-
}),
|
|
447
|
+
}), He = /* @__PURE__ */ I(qe, [["__scopeId", "data-v-45bd4eab"]]), Je = { class: "flex items-center gap-3 flex-1 min-w-0" }, Ke = ["src", "alt"], Qe = { class: "min-w-0" }, Xe = { class: "font-semibold truncate" }, Ye = {
|
|
443
448
|
key: 0,
|
|
444
449
|
class: "text-xs text-gray-400 truncate"
|
|
445
|
-
},
|
|
450
|
+
}, Ze = {
|
|
446
451
|
key: 1,
|
|
447
452
|
class: "text-xs text-gray-400 truncate"
|
|
448
|
-
},
|
|
453
|
+
}, _e = {
|
|
449
454
|
key: 2,
|
|
450
455
|
class: "text-xs text-gray-400 flex gap-2 mt-1"
|
|
451
|
-
},
|
|
456
|
+
}, et = {
|
|
452
457
|
key: 1,
|
|
453
458
|
class: "w-2 h-2 rounded-full bg-green-500"
|
|
454
|
-
},
|
|
459
|
+
}, tt = /* @__PURE__ */ g({
|
|
455
460
|
__name: "DeviceCard",
|
|
456
461
|
props: {
|
|
457
462
|
icon: {},
|
|
@@ -473,34 +478,34 @@ const le = ["src", "alt"], C = /* @__PURE__ */ g({
|
|
|
473
478
|
}, i = () => {
|
|
474
479
|
t("click");
|
|
475
480
|
};
|
|
476
|
-
return (c,
|
|
481
|
+
return (c, d) => (a(), l("div", {
|
|
477
482
|
class: f(["flex items-center justify-between background rounded-vsk px-6 py-3 mb-4", [{ "border-l-4 border-green-500": e.isConnected }, e.customClass]]),
|
|
478
483
|
onClick: i
|
|
479
484
|
}, [
|
|
480
|
-
r("div",
|
|
485
|
+
r("div", Je, [
|
|
481
486
|
r("img", {
|
|
482
487
|
src: e.icon,
|
|
483
488
|
alt: e.title,
|
|
484
489
|
class: "h-7 w-7 shrink-0"
|
|
485
|
-
}, null, 8,
|
|
486
|
-
r("div",
|
|
487
|
-
r("div",
|
|
488
|
-
e.subtitle ? (a(), l("div",
|
|
489
|
-
e.metadata ? (a(), l("div",
|
|
490
|
-
e.extraInfo && e.extraInfo.length > 0 ? (a(), l("div",
|
|
491
|
-
(a(!0), l(
|
|
490
|
+
}, null, 8, Ke),
|
|
491
|
+
r("div", Qe, [
|
|
492
|
+
r("div", Xe, b(e.title), 1),
|
|
493
|
+
e.subtitle ? (a(), l("div", Ye, b(e.subtitle), 1)) : m("", !0),
|
|
494
|
+
e.metadata ? (a(), l("div", Ze, b(e.metadata), 1)) : m("", !0),
|
|
495
|
+
e.extraInfo && e.extraInfo.length > 0 ? (a(), l("div", _e, [
|
|
496
|
+
(a(!0), l(z, null, A(e.extraInfo, (u, o) => (a(), l("span", { key: o }, b(u), 1))), 128))
|
|
492
497
|
])) : m("", !0)
|
|
493
498
|
])
|
|
494
499
|
]),
|
|
495
500
|
e.showActionButton ? (a(), l("button", {
|
|
496
501
|
key: 0,
|
|
497
502
|
class: "bg-vsk-primary rounded-vsk px-4 py-2 text-sm font-semibold cursor-pointer hover:opacity-70",
|
|
498
|
-
onClick:
|
|
503
|
+
onClick: _(n, ["stop"])
|
|
499
504
|
}, b(e.actionLabel), 1)) : m("", !0),
|
|
500
|
-
e.showStatusIndicator && e.isConnected ? (a(), l("div",
|
|
505
|
+
e.showStatusIndicator && e.isConnected ? (a(), l("div", et)) : m("", !0)
|
|
501
506
|
], 2));
|
|
502
507
|
}
|
|
503
|
-
}),
|
|
508
|
+
}), at = ["for"], lt = /* @__PURE__ */ g({
|
|
504
509
|
__name: "FormGroup",
|
|
505
510
|
props: {
|
|
506
511
|
label: {},
|
|
@@ -516,11 +521,11 @@ const le = ["src", "alt"], C = /* @__PURE__ */ g({
|
|
|
516
521
|
key: 0,
|
|
517
522
|
for: e.htmlFor,
|
|
518
523
|
class: f(["text-sm font-medium text-primary dark:text-primary-dark", e.labelClass])
|
|
519
|
-
}, b(e.label), 11,
|
|
524
|
+
}, b(e.label), 11, at)) : m("", !0),
|
|
520
525
|
x(s.$slots, "default", {}, void 0, !0)
|
|
521
526
|
], 2));
|
|
522
527
|
}
|
|
523
|
-
}),
|
|
528
|
+
}), nt = /* @__PURE__ */ I(lt, [["__scopeId", "data-v-c0d9d9cb"]]), st = /* @__PURE__ */ g({
|
|
524
529
|
__name: "ListCard",
|
|
525
530
|
props: {
|
|
526
531
|
clickable: { type: Boolean, default: !1 },
|
|
@@ -531,7 +536,7 @@ const le = ["src", "alt"], C = /* @__PURE__ */ g({
|
|
|
531
536
|
const t = e, n = s, i = () => {
|
|
532
537
|
t.clickable && n("click");
|
|
533
538
|
};
|
|
534
|
-
return (c,
|
|
539
|
+
return (c, d) => (a(), l("div", {
|
|
535
540
|
class: f([
|
|
536
541
|
"flex items-center justify-between background p-3 rounded-vsk border border-vsk-primary/70 transition-colors duration-200",
|
|
537
542
|
{
|
|
@@ -544,10 +549,10 @@ const le = ["src", "alt"], C = /* @__PURE__ */ g({
|
|
|
544
549
|
x(c.$slots, "default", {}, void 0, !0)
|
|
545
550
|
], 2));
|
|
546
551
|
}
|
|
547
|
-
}),
|
|
552
|
+
}), ot = /* @__PURE__ */ I(st, [["__scopeId", "data-v-f86d47da"]]), it = { class: "background rounded-corner flex flex-row items-center gap-2 justify-between w-full h-auto p-4 transition-all duration-200 hover:bg-ui-surface/80 dark:hover:bg-ui-surface-dark/80" }, rt = ["src", "alt", "title"], ct = {
|
|
548
553
|
key: 1,
|
|
549
554
|
class: "w-8 h-8 flex items-center justify-center"
|
|
550
|
-
},
|
|
555
|
+
}, dt = ["src", "alt"], ut = ["min", "max", "value"], mt = /* @__PURE__ */ g({
|
|
551
556
|
__name: "SliderControl",
|
|
552
557
|
props: {
|
|
553
558
|
icon: {},
|
|
@@ -566,16 +571,16 @@ const le = ["src", "alt"], C = /* @__PURE__ */ g({
|
|
|
566
571
|
if (t.max <= t.min) return 0;
|
|
567
572
|
const o = t.max - t.min, h = t.modelValue - t.min;
|
|
568
573
|
return Math.round(h / o * 100);
|
|
569
|
-
}), c = k(() => t.getPercentageClass ? t.getPercentageClass(i.value) : ""),
|
|
574
|
+
}), c = k(() => t.getPercentageClass ? t.getPercentageClass(i.value) : ""), d = (o) => {
|
|
570
575
|
const h = o.target;
|
|
571
576
|
n("update:modelValue", Number(h.value));
|
|
572
|
-
},
|
|
577
|
+
}, u = () => {
|
|
573
578
|
n("buttonClick");
|
|
574
579
|
};
|
|
575
|
-
return (o, h) => (a(), l("div",
|
|
580
|
+
return (o, h) => (a(), l("div", it, [
|
|
576
581
|
e.showButton ? (a(), l("button", {
|
|
577
582
|
key: 0,
|
|
578
|
-
onClick:
|
|
583
|
+
onClick: u,
|
|
579
584
|
class: "w-8 h-8 flex items-center justify-center rounded-corner transition-all duration-200 hover:bg-ui-surface/80 dark:hover:bg-ui-surface-dark/80 hover:scale-110 active:scale-95"
|
|
580
585
|
}, [
|
|
581
586
|
r("img", {
|
|
@@ -583,28 +588,28 @@ const le = ["src", "alt"], C = /* @__PURE__ */ g({
|
|
|
583
588
|
alt: e.alt,
|
|
584
589
|
title: e.tooltip,
|
|
585
590
|
class: f(["w-6 h-6 transition-all duration-200", e.iconClass])
|
|
586
|
-
}, null, 10,
|
|
587
|
-
])) : (a(), l("div",
|
|
591
|
+
}, null, 10, rt)
|
|
592
|
+
])) : (a(), l("div", ct, [
|
|
588
593
|
r("img", {
|
|
589
594
|
src: e.icon,
|
|
590
595
|
alt: e.alt,
|
|
591
596
|
class: "w-6 h-6 transition-all duration-200"
|
|
592
|
-
}, null, 8,
|
|
597
|
+
}, null, 8, dt)
|
|
593
598
|
])),
|
|
594
599
|
r("input", {
|
|
595
600
|
type: "range",
|
|
596
601
|
min: e.min,
|
|
597
602
|
max: e.max,
|
|
598
603
|
value: e.modelValue,
|
|
599
|
-
onInput:
|
|
604
|
+
onInput: d,
|
|
600
605
|
class: "flex-1 transition-all duration-200 hover:scale-105"
|
|
601
|
-
}, null, 40,
|
|
606
|
+
}, null, 40, ut),
|
|
602
607
|
r("span", {
|
|
603
608
|
class: f(["w-12 text-right transition-all duration-200 font-medium", c.value])
|
|
604
609
|
}, b(i.value) + "% ", 3)
|
|
605
610
|
]));
|
|
606
611
|
}
|
|
607
|
-
}),
|
|
612
|
+
}), ft = ["disabled"], bt = /* @__PURE__ */ g({
|
|
608
613
|
__name: "SwitchToggle",
|
|
609
614
|
props: {
|
|
610
615
|
isOn: { type: Boolean },
|
|
@@ -619,7 +624,7 @@ const le = ["src", "alt"], C = /* @__PURE__ */ g({
|
|
|
619
624
|
const t = e, n = s, i = () => {
|
|
620
625
|
n("toggle", !t.isOn);
|
|
621
626
|
};
|
|
622
|
-
return (c,
|
|
627
|
+
return (c, d) => (a(), l("button", {
|
|
623
628
|
type: "button",
|
|
624
629
|
onClick: i,
|
|
625
630
|
disabled: e.disabled,
|
|
@@ -638,9 +643,9 @@ const le = ["src", "alt"], C = /* @__PURE__ */ g({
|
|
|
638
643
|
e.isOn ? e.size === "small" ? "translate-x-6" : "translate-x-5" : "translate-x-1"
|
|
639
644
|
])
|
|
640
645
|
}, null, 2)
|
|
641
|
-
], 10,
|
|
646
|
+
], 10, ft));
|
|
642
647
|
}
|
|
643
|
-
}),
|
|
648
|
+
}), gt = ["disabled"], ht = ["src", "alt", "title"], vt = /* @__PURE__ */ g({
|
|
644
649
|
__name: "ToggleControl",
|
|
645
650
|
props: {
|
|
646
651
|
icon: {},
|
|
@@ -676,13 +681,13 @@ const le = ["src", "alt"], C = /* @__PURE__ */ g({
|
|
|
676
681
|
"drop-shadow-lg": e.isActive,
|
|
677
682
|
...e.iconClass
|
|
678
683
|
}])
|
|
679
|
-
}, null, 10,
|
|
680
|
-
], 10,
|
|
684
|
+
}, null, 10, ht)
|
|
685
|
+
], 10, gt));
|
|
681
686
|
}
|
|
682
|
-
}),
|
|
687
|
+
}), yt = ["title"], xt = ["src", "alt"], pt = {
|
|
683
688
|
key: 0,
|
|
684
689
|
class: "absolute bottom-1 right-1 bg-primary dark:bg-primary-dark text-white text-xs rounded-full w-4 h-4 flex items-center justify-center font-bold animate-bounce"
|
|
685
|
-
},
|
|
690
|
+
}, kt = /* @__PURE__ */ g({
|
|
686
691
|
__name: "TrayIconButton",
|
|
687
692
|
props: {
|
|
688
693
|
icon: {},
|
|
@@ -700,19 +705,19 @@ const le = ["src", "alt"], C = /* @__PURE__ */ g({
|
|
|
700
705
|
const t = s, n = y(!1), i = () => {
|
|
701
706
|
t("click");
|
|
702
707
|
};
|
|
703
|
-
return (c,
|
|
708
|
+
return (c, d) => (a(), l("div", {
|
|
704
709
|
class: f(["p-1 rounded-corner relative hover:bg-primary dark:hover:bg-primary-dark group transition-all duration-300", e.customClass]),
|
|
705
710
|
title: e.tooltip,
|
|
706
711
|
onClick: i,
|
|
707
|
-
onMouseenter:
|
|
708
|
-
onMouseleave:
|
|
712
|
+
onMouseenter: d[0] || (d[0] = (u) => n.value = !0),
|
|
713
|
+
onMouseleave: d[1] || (d[1] = (u) => n.value = !1)
|
|
709
714
|
}, [
|
|
710
715
|
r("img", {
|
|
711
716
|
src: e.icon,
|
|
712
717
|
alt: e.alt,
|
|
713
718
|
class: f(["m-auto h-5.5 w-auto transition-all duration-300", e.iconClass])
|
|
714
|
-
}, null, 10,
|
|
715
|
-
e.badge !== null && e.badge > 0 ? (a(), l("div",
|
|
719
|
+
}, null, 10, xt),
|
|
720
|
+
e.badge !== null && e.badge > 0 ? (a(), l("div", pt, b(e.badge), 1)) : m("", !0),
|
|
716
721
|
e.showCustomTooltip && e.customTooltipText ? (a(), l("div", {
|
|
717
722
|
key: 1,
|
|
718
723
|
class: f(["absolute top-1 left-1/2 transform -translate-x-1/2 text-xs font-semibold p-1 rounded-corner transition-all duration-300 pointer-events-none background", [
|
|
@@ -724,46 +729,46 @@ const le = ["src", "alt"], C = /* @__PURE__ */ g({
|
|
|
724
729
|
]])
|
|
725
730
|
}, b(e.customTooltipText), 3)) : m("", !0),
|
|
726
731
|
x(c.$slots, "default")
|
|
727
|
-
], 42,
|
|
732
|
+
], 42, yt));
|
|
728
733
|
}
|
|
729
|
-
}),
|
|
730
|
-
|
|
734
|
+
}), wt = [
|
|
735
|
+
we,
|
|
731
736
|
P,
|
|
732
|
-
|
|
733
|
-
|
|
737
|
+
N,
|
|
738
|
+
ze,
|
|
734
739
|
C,
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
],
|
|
740
|
+
Oe,
|
|
741
|
+
Ge,
|
|
742
|
+
He,
|
|
743
|
+
tt,
|
|
744
|
+
nt,
|
|
745
|
+
ot,
|
|
746
|
+
mt,
|
|
747
|
+
bt,
|
|
748
|
+
vt,
|
|
749
|
+
kt
|
|
750
|
+
], Lt = {
|
|
746
751
|
install(e) {
|
|
747
|
-
|
|
752
|
+
wt.forEach((s) => {
|
|
748
753
|
e.component(s.name, s);
|
|
749
754
|
});
|
|
750
755
|
}
|
|
751
756
|
};
|
|
752
757
|
export {
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
758
|
+
Ge as ActionButton,
|
|
759
|
+
He as ConfigSection,
|
|
760
|
+
tt as DeviceCard,
|
|
761
|
+
nt as FormGroup,
|
|
762
|
+
ot as ListCard,
|
|
763
|
+
ze as SelectField,
|
|
764
|
+
we as SideBar,
|
|
760
765
|
P as SideButton,
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
766
|
+
N as SideGroup,
|
|
767
|
+
mt as SliderControl,
|
|
768
|
+
bt as SwitchToggle,
|
|
764
769
|
C as ThemeIcon,
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
770
|
+
vt as ToggleControl,
|
|
771
|
+
kt as TrayIconButton,
|
|
772
|
+
Oe as WindowFrame,
|
|
773
|
+
Lt as default
|
|
769
774
|
};
|
package/dist/vue-libvasak.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(r,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@tauri-apps/api/event"),require("@vasakgroup/plugin-vicons"),require("@tauri-apps/api/window")):typeof define=="function"&&define.amd?define(["exports","vue","@tauri-apps/api/event","@vasakgroup/plugin-vicons","@tauri-apps/api/window"],e):(r=typeof globalThis<"u"?globalThis:r||self,e(r.VueLibVasak={},r.Vue,r.TauriEvent,r.VasakVicons,r.TauriWindow))})(this,(function(r,e,M,p,j){"use strict";function F(t,o){const a=e.ref("");let l=null,s=!1,i=0;async function d(){const c=++i,n=t.value;if(!n){a.value="";return}const m=o.value==="symbol"?await p.getSymbolSource(n):await p.getIconSource(n);c===i&&(a.value=m)}return e.onMounted(async()=>{const c=await M.listen("vicons:theme-changed",d);if(s){c();return}l=c,await d()}),e.onUnmounted(()=>{s=!0,l?.()}),e.watch(t,d),a}const O=["src","alt"],k=e.defineComponent({__name:"ThemeIcon",props:{name:{},type:{default:"icon"},size:{default:18},alt:{default:""}},setup(t){const o=t,a=F(e.toRef(o,"name"),e.toRef(o,"type")),l=e.computed(()=>`${o.size}px`);return(s,i)=>e.unref(a)?(e.openBlock(),e.createElementBlock("img",{key:0,src:e.unref(a),alt:t.alt,style:e.normalizeStyle({width:l.value,height:l.value}),class:"shrink-0 object-contain"},null,12,O)):(e.openBlock(),e.createElementBlock("span",{key:1,style:e.normalizeStyle({width:l.value,height:l.value}),class:"shrink-0"},null,4))}}),P={class:"flex flex-col gap-2"},W=["aria-expanded"],R={key:1,class:"flex flex-col gap-1"},g=e.defineComponent({__name:"SideGroup",props:{title:{},collapsed:{type:Boolean,default:!1},defaultOpen:{type:Boolean,default:!0}},setup(t){const o=t,a=e.ref(o.defaultOpen);return e.watch(()=>o.collapsed,l=>{l&&(a.value=!0)}),(l,s)=>(e.openBlock(),e.createElementBlock("section",P,[t.collapsed?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"group flex w-full items-center justify-between rounded-corner px-2 py-1 text-tx-muted text-xs uppercase tracking-[0.08em] hover:bg-ui-surface/60","aria-expanded":a.value,onClick:s[0]||(s[0]=i=>a.value=!a.value)},[e.createElementVNode("span",null,e.toDisplayString(t.title),1),e.createElementVNode("span",{class:e.normalizeClass(["text-[10px] transition-transform duration-200",a.value?"rotate-180":""])}," v ",2)],8,W)),a.value||t.collapsed?(e.openBlock(),e.createElementBlock("div",R,[e.renderSlot(l.$slots,"default")])):e.createCommentVNode("",!0)]))}}),q=["title","aria-label","disabled","aria-current"],G={key:1},U={key:0,class:"min-w-0 flex-1 truncate font-medium"},_={key:1,class:"rounded-corner bg-ui-surface px-2 py-0.5 font-semibold text-tx-muted text-xs"},h=e.defineComponent({__name:"SideButton",props:{label:{},icon:{default:""},active:{type:Boolean,default:!1},collapsed:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},badge:{default:""}},emits:["click"],setup(t){return(o,a)=>(e.openBlock(),e.createElementBlock("button",{type:"button",title:t.collapsed?t.label:void 0,"aria-label":t.collapsed?t.label:void 0,disabled:t.disabled,"aria-current":t.active?"page":void 0,class:e.normalizeClass(["group relative flex w-full items-center gap-3 rounded-corner border px-3 py-2 text-left text-sm transition-all duration-200",[t.active?"border-secondary bg-primary/15 text-tx-main shadow-sm":"border-transparent bg-transparent hover:border-ui-border hover:bg-ui-surface/70",t.disabled?"cursor-not-allowed opacity-60":"cursor-pointer",t.collapsed?"justify-center px-2":""]]),onClick:a[0]||(a[0]=l=>o.$emit("click"))},[e.createElementVNode("span",{class:e.normalizeClass(["flex h-8 w-8 shrink-0 items-center justify-center rounded-corner font-semibold text-xs uppercase tracking-wide",t.active?"border-secondary bg-primary/20":""]),"aria-hidden":"true"},[t.icon?(e.openBlock(),e.createBlock(k,{key:0,name:t.icon,size:20},null,8,["name"])):(e.openBlock(),e.createElementBlock("span",G,e.toDisplayString(t.label.charAt(0).toUpperCase()),1))],2),t.collapsed?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",U,e.toDisplayString(t.label),1)),!t.collapsed&&t.badge!==""?(e.openBlock(),e.createElementBlock("span",_,e.toDisplayString(t.badge),1)):e.createCommentVNode("",!0)],10,q))}}),H={key:0,class:"flex flex-col gap-2 border-ui-border border-b p-2"},J={class:"flex items-center gap-2"},K=["aria-label","aria-expanded"],Q={key:0,class:"min-w-0 flex-1"},X={key:0,class:"truncate font-semibold text-sm"},Y={key:1,class:"truncate text-tx-muted text-xs"},Z={key:0},v={key:1,class:"flex border-ui-border border-b p-2"},ee=["aria-label","aria-expanded"],te={class:"flex min-h-0 flex-1 flex-col gap-3 overflow-y-auto p-2"},C="hidden h-8 w-8 shrink-0 items-center justify-center rounded-corner border border-ui-border bg-ui-surface/70 transition-colors hover:bg-ui-surface md:inline-flex",B=e.defineComponent({__name:"SideBar",props:{title:{default:""},subtitle:{default:""},categories:{default:()=>[]},modelValue:{default:""},collapsed:{type:Boolean,default:void 0},collapseLabel:{default:"Collapse"},expandLabel:{default:"Expand"}},emits:["update:modelValue","update:collapsed","change"],setup(t,{expose:o,emit:a}){const l=t,s=a,i=e.ref(l.collapsed??!1),d=e.ref(!1);let c=null;const n=e.computed(()=>d.value||i.value),m=e.computed(()=>!!(l.title||l.subtitle));e.computed(()=>l.categories.length>0);function y(){d.value=c?.matches??!1}function A(){i.value=!i.value,s("update:collapsed",i.value)}function Ge(f){s("update:modelValue",f),s("change",f)}return e.watch(()=>l.collapsed,f=>{f!==void 0&&(i.value=f)}),e.onMounted(()=>{c=window.matchMedia("(max-width: 767px)"),y(),c.addEventListener("change",y)}),e.onBeforeUnmount(()=>c?.removeEventListener("change",y)),o({collapsed:n}),(f,Je)=>(e.openBlock(),e.createElementBlock("aside",{class:e.normalizeClass(["relative z-30 flex h-full shrink-0 flex-col rounded-corner border border-ui-border bg-ui-surface/70 transition-all duration-300",["w-[84px]",n.value?"md:w-[84px]":"md:w-72"]])},[m.value||f.$slots.header?(e.openBlock(),e.createElementBlock("header",H,[e.createElementVNode("div",J,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(C),"aria-label":n.value?t.expandLabel:t.collapseLabel,"aria-expanded":!n.value,onClick:A},[e.createVNode(k,{name:n.value?"pan-end-symbolic":"pan-start-symbolic",type:"symbol",size:16},null,8,["name"])],8,K),m.value&&!n.value?(e.openBlock(),e.createElementBlock("div",Q,[t.title?(e.openBlock(),e.createElementBlock("p",X,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),t.subtitle?(e.openBlock(),e.createElementBlock("p",Y,e.toDisplayString(t.subtitle),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),f.$slots.header&&!n.value?(e.openBlock(),e.createElementBlock("div",Z,[e.renderSlot(f.$slots,"header",{collapsed:n.value})])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",v,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(C),"aria-label":n.value?t.expandLabel:t.collapseLabel,"aria-expanded":!n.value,onClick:A},[e.createVNode(k,{name:n.value?"pan-end-symbolic":"pan-start-symbolic",type:"symbol",size:16},null,8,["name"])],8,ee)])),e.createElementVNode("div",te,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.categories,x=>(e.openBlock(),e.createBlock(g,{key:x.id,title:x.title,collapsed:n.value},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.items,u=>(e.openBlock(),e.createBlock(h,{key:u.id,label:u.label,icon:u.icon,badge:u.badge,disabled:u.disabled,collapsed:n.value,active:t.modelValue===u.id,onClick:Ke=>Ge(u.id)},null,8,["label","icon","badge","disabled","collapsed","active","onClick"]))),128))]),_:2},1032,["title","collapsed"]))),128)),e.renderSlot(f.$slots,"default",{collapsed:n.value})])],2))}}),ae={class:"flex min-w-0 flex-col gap-1"},le=["for"],oe={class:"relative flex min-w-0 items-center"},ne=["id"],w=e.defineComponent({inheritAttrs:!1,__name:"SelectField",props:e.mergeModels({label:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const o=t,a=e.useAttrs(),l=e.useId(),s=e.computed(()=>a.id??l),[i,d]=e.useModel(t,"modelValue",{set(c){return d.number?Number(c):c}});return(c,n)=>(e.openBlock(),e.createElementBlock("div",ae,[o.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:s.value,class:"text-tx-muted text-xs"},e.toDisplayString(o.label),9,le)):e.createCommentVNode("",!0),e.createElementVNode("div",oe,[e.withDirectives(e.createElementVNode("select",e.mergeProps({id:s.value,"onUpdate:modelValue":n[0]||(n[0]=m=>e.isRef(i)?i.value=m:null),class:"min-w-0 flex-1 appearance-none truncate rounded-corner border border-ui-border bg-ui-surface/60 py-1.5 pr-8 pl-2 text-sm text-tx-main"},e.unref(a)),[e.renderSlot(c.$slots,"default")],16,ne),[[e.vModelSelect,e.unref(i)]]),e.createVNode(k,{name:"pan-down-symbolic",type:"symbol",size:14,class:"pointer-events-none absolute right-2"})])]))}}),se={"data-tauri-drag-region":""},ie=["src","alt"],re={"data-tauri-drag-region":""},ce={"data-tauri-drag-region":""},de=["src"],me=["src"],fe=["src"],ue=e.defineComponent({__name:"TopBar",props:{title:String,image:String},setup(t){const o=e.ref(null),a=j.getCurrentWindow(),l=e.ref(""),s=e.ref(""),i=e.ref(""),d=t;return e.onMounted(async()=>{l.value=await p.getIconSource("window-close"),s.value=await p.getIconSource("window-minimize"),i.value=await p.getIconSource("window-maximize")}),(c,n)=>(e.openBlock(),e.createElementBlock("div",{"data-tauri-drag-region":"",class:"flex h-8 px-4 py-1 bg-primary dark:bg-primary-dark rounded-t-corner-window justify-between align-center",ref_key:"bar",ref:o},[e.createElementVNode("div",se,[e.createElementVNode("img",{src:d.image,"data-tauri-drag-region":"",class:"h-6 w-auto",alt:d.title},null,8,ie)]),e.createElementVNode("div",re,e.toDisplayString(d.title),1),e.createElementVNode("div",ce,[e.createElementVNode("span",{class:"win-button",onClick:n[0]||(n[0]=m=>e.unref(a).minimize())},[e.createElementVNode("img",{src:s.value,class:"h-6 w-6 inline-block",alt:"Minimize"},null,8,de)]),e.createElementVNode("span",{class:"win-button",onClick:n[1]||(n[1]=m=>e.unref(a).toggleMaximize())},[e.createElementVNode("img",{src:i.value,class:"h-6 w-6 inline-block",alt:"Maximize"},null,8,me)]),e.createElementVNode("span",{class:"win-button",onClick:n[2]||(n[2]=m=>e.unref(a).close())},[e.createElementVNode("img",{src:l.value,class:"h-6 w-6 inline-block",alt:"Close"},null,8,fe)])])],512))}}),E=e.defineComponent({__name:"WindowFrame",props:{title:{default:"Vasak"},image:{default:""}},setup(t){const o=t;return(a,l)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(ue,{title:o.title,image:o.image},null,8,["title","image"]),e.renderSlot(a.$slots,"default")],64))}}),ke=["type","disabled"],pe={key:0,class:"w-4 h-4 animate-spin rounded-full border-2 border-current border-t-transparent"},be=["src","alt"],ge={key:2},he=["src","alt"],ye=e.defineComponent({__name:"ActionButton",props:{label:{},disabled:{type:Boolean,default:!1},variant:{default:"primary"},loading:{type:Boolean,default:!1},customClass:{default:()=>({})},size:{default:"md"},fullWidth:{type:Boolean,default:!1},iconSrc:{default:""},iconAlt:{default:""},iconRight:{type:Boolean,default:!1},type:{default:"button"},stopPropagation:{type:Boolean,default:!1},preventDefault:{type:Boolean,default:!1}},emits:["click"],setup(t,{emit:o}){const a=t,l=o,s={primary:"bg-primary dark:bg-primary-dark text-tx-on-primary dark:text-tx-on-primary-dark hover:bg-primary/90 dark:hover:bg-primary-dark/90",secondary:"bg-secondary dark:bg-secondary-dark text-tx-on-primary dark:text-tx-on-primary-dark hover:bg-secondary/80 dark:hover:bg-secondary-dark/80",danger:"bg-status-error dark:bg-status-error-dark text-tx-on-primary dark:text-tx-on-primary-dark hover:bg-status-error/90 dark:hover:bg-status-error-dark/90"},i={sm:"px-2 py-1 text-xs",md:"px-3 py-1 text-sm",lg:"px-4 py-2 text-base"},d=c=>{a.stopPropagation&&c.stopPropagation(),a.preventDefault&&c.preventDefault(),!a.disabled&&!a.loading&&l("click")};return(c,n)=>(e.openBlock(),e.createElementBlock("button",{type:a.type,onClick:d,class:e.normalizeClass(["rounded-corner transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2",[s[a.variant],i[a.size],a.fullWidth?"w-full":"",a.iconSrc&&!a.label?"px-2 py-2":"",t.customClass]]),disabled:a.disabled||a.loading},[t.loading?(e.openBlock(),e.createElementBlock("span",pe)):e.createCommentVNode("",!0),a.iconSrc&&!a.iconRight?(e.openBlock(),e.createElementBlock("img",{key:1,src:a.iconSrc,alt:a.iconAlt||a.label,class:"w-4 h-4"},null,8,be)):e.createCommentVNode("",!0),a.label?(e.openBlock(),e.createElementBlock("span",ge,e.toDisplayString(a.label),1)):e.createCommentVNode("",!0),a.iconSrc&&a.iconRight?(e.openBlock(),e.createElementBlock("img",{key:3,src:a.iconSrc,alt:a.iconAlt||a.label,class:"w-4 h-4"},null,8,he)):e.createCommentVNode("",!0)],10,ke))}}),b=(t,o)=>{const a=t.__vccOpts||t;for(const[l,s]of o)a[l]=s;return a},$=b(ye,[["__scopeId","data-v-2eaf6e27"]]),xe={class:"text-base font-semibold m-0 text-primary dark:text-primary-dark"},V=b(e.defineComponent({__name:"ConfigSection",props:{title:{},icon:{default:""},customClass:{default:()=>({})}},setup(t){return(o,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-4 p-4 background rounded-corner",t.customClass])},[e.createElementVNode("h3",xe,e.toDisplayString(t.icon?`${t.icon} ${t.title}`:t.title),1),e.renderSlot(o.$slots,"default",{},void 0,!0)],2))}}),[["__scopeId","data-v-45bd4eab"]]),Ce={class:"flex items-center gap-3 flex-1 min-w-0"},Be=["src","alt"],we={class:"min-w-0"},Ee={class:"font-semibold truncate"},$e={key:0,class:"text-xs text-gray-400 truncate"},Ve={key:1,class:"text-xs text-gray-400 truncate"},Se={key:2,class:"text-xs text-gray-400 flex gap-2 mt-1"},Ne={key:1,class:"w-2 h-2 rounded-full bg-green-500"},S=e.defineComponent({__name:"DeviceCard",props:{icon:{},title:{},subtitle:{default:""},metadata:{default:""},extraInfo:{default:()=>[]},isConnected:{type:Boolean,default:!1},showActionButton:{type:Boolean,default:!0},actionLabel:{default:"Conectar"},showStatusIndicator:{type:Boolean,default:!1},customClass:{default:""},clickable:{type:Boolean,default:!1}},emits:["action","click"],setup(t,{emit:o}){const a=o,l=()=>{a("action")},s=()=>{a("click")};return(i,d)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex items-center justify-between background rounded-vsk px-6 py-3 mb-4",[{"border-l-4 border-green-500":t.isConnected},t.customClass]]),onClick:s},[e.createElementVNode("div",Ce,[e.createElementVNode("img",{src:t.icon,alt:t.title,class:"h-7 w-7 shrink-0"},null,8,Be),e.createElementVNode("div",we,[e.createElementVNode("div",Ee,e.toDisplayString(t.title),1),t.subtitle?(e.openBlock(),e.createElementBlock("div",$e,e.toDisplayString(t.subtitle),1)):e.createCommentVNode("",!0),t.metadata?(e.openBlock(),e.createElementBlock("div",Ve,e.toDisplayString(t.metadata),1)):e.createCommentVNode("",!0),t.extraInfo&&t.extraInfo.length>0?(e.openBlock(),e.createElementBlock("div",Se,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.extraInfo,(c,n)=>(e.openBlock(),e.createElementBlock("span",{key:n},e.toDisplayString(c),1))),128))])):e.createCommentVNode("",!0)])]),t.showActionButton?(e.openBlock(),e.createElementBlock("button",{key:0,class:"bg-vsk-primary rounded-vsk px-4 py-2 text-sm font-semibold cursor-pointer hover:opacity-70",onClick:e.withModifiers(l,["stop"])},e.toDisplayString(t.actionLabel),1)):e.createCommentVNode("",!0),t.showStatusIndicator&&t.isConnected?(e.openBlock(),e.createElementBlock("div",Ne)):e.createCommentVNode("",!0)],2))}}),ze=["for"],N=b(e.defineComponent({__name:"FormGroup",props:{label:{},htmlFor:{default:""},customClass:{default:()=>({})},labelClass:{default:()=>({})}},setup(t){return(o,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-2",t.customClass])},[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:t.htmlFor,class:e.normalizeClass(["text-sm font-medium text-primary dark:text-primary-dark",t.labelClass])},e.toDisplayString(t.label),11,ze)):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"default",{},void 0,!0)],2))}}),[["__scopeId","data-v-c0d9d9cb"]]),z=b(e.defineComponent({__name:"ListCard",props:{clickable:{type:Boolean,default:!1},customClass:{default:()=>({})}},emits:["click"],setup(t,{emit:o}){const a=t,l=o,s=()=>{a.clickable&&l("click")};return(i,d)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex items-center justify-between background p-3 rounded-vsk border border-vsk-primary/70 transition-colors duration-200",{"hover:bg-vsk-primary/5 cursor-pointer":a.clickable},t.customClass]),onClick:s},[e.renderSlot(i.$slots,"default",{},void 0,!0)],2))}}),[["__scopeId","data-v-f86d47da"]]),De={class:"background rounded-corner flex flex-row items-center gap-2 justify-between w-full h-auto p-4 transition-all duration-200 hover:bg-ui-surface/80 dark:hover:bg-ui-surface-dark/80"},Te=["src","alt","title"],Ie={key:1,class:"w-8 h-8 flex items-center justify-center"},Le=["src","alt"],Ae=["min","max","value"],D=e.defineComponent({__name:"SliderControl",props:{icon:{},alt:{default:""},tooltip:{default:""},modelValue:{},min:{default:0},max:{default:100},showButton:{type:Boolean,default:!1},iconClass:{default:()=>({})},getPercentageClass:{type:Function,default:()=>""}},emits:["update:modelValue","buttonClick"],setup(t,{emit:o}){const a=t,l=o,s=e.computed(()=>{if(a.max<=a.min)return 0;const n=a.max-a.min,m=a.modelValue-a.min;return Math.round(m/n*100)}),i=e.computed(()=>a.getPercentageClass?a.getPercentageClass(s.value):""),d=n=>{const m=n.target;l("update:modelValue",Number(m.value))},c=()=>{l("buttonClick")};return(n,m)=>(e.openBlock(),e.createElementBlock("div",De,[t.showButton?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:c,class:"w-8 h-8 flex items-center justify-center rounded-corner transition-all duration-200 hover:bg-ui-surface/80 dark:hover:bg-ui-surface-dark/80 hover:scale-110 active:scale-95"},[e.createElementVNode("img",{src:t.icon,alt:t.alt,title:t.tooltip,class:e.normalizeClass(["w-6 h-6 transition-all duration-200",t.iconClass])},null,10,Te)])):(e.openBlock(),e.createElementBlock("div",Ie,[e.createElementVNode("img",{src:t.icon,alt:t.alt,class:"w-6 h-6 transition-all duration-200"},null,8,Le)])),e.createElementVNode("input",{type:"range",min:t.min,max:t.max,value:t.modelValue,onInput:d,class:"flex-1 transition-all duration-200 hover:scale-105"},null,40,Ae),e.createElementVNode("span",{class:e.normalizeClass(["w-12 text-right transition-all duration-200 font-medium",i.value])},e.toDisplayString(s.value)+"% ",3)]))}}),Me=["disabled"],T=e.defineComponent({__name:"SwitchToggle",props:{isOn:{type:Boolean},disabled:{type:Boolean,default:!1},size:{default:"small"},activeClass:{default:"bg-primary dark:bg-primary-dark"},inactiveClass:{default:"background"},customClass:{default:""}},emits:["toggle"],setup(t,{emit:o}){const a=t,l=o,s=()=>{l("toggle",!a.isOn)};return(i,d)=>(e.openBlock(),e.createElementBlock("button",{type:"button",onClick:s,disabled:t.disabled,class:e.normalizeClass(["relative inline-flex items-center rounded-full transition-colors",t.size==="small"?"h-6 w-11":"h-7 w-12",t.isOn?t.activeClass:t.inactiveClass,t.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer",t.customClass])},[e.createElementVNode("span",{class:e.normalizeClass(["inline-block transform rounded-full bg-white shadow transition-transform",t.size==="small"?"h-4 w-4":"h-6 w-6",t.isOn?t.size==="small"?"translate-x-6":"translate-x-5":"translate-x-1"])},null,2)],10,Me))}}),je=["disabled"],Fe=["src","alt","title"],I=e.defineComponent({__name:"ToggleControl",props:{icon:{},alt:{default:""},tooltip:{default:""},isActive:{type:Boolean,default:!1},isLoading:{type:Boolean,default:!1},iconClass:{default:()=>({})},customClass:{default:()=>({})}},emits:["click"],setup(t,{emit:o}){const a=o,l=()=>{a("click")};return(s,i)=>(e.openBlock(),e.createElementBlock("button",{onClick:l,class:e.normalizeClass(["p-2 rounded-corner background hover:opacity-50 transition-all duration-300 h-17.5 w-17.5 group relative overflow-hidden hover:scale-105 hover:shadow-lg active:scale-95",{"animate-pulse":t.isLoading,"ring-2 ring-primary dark:ring-primary-dark":t.isActive,"opacity-60":!t.isActive,...t.customClass}]),disabled:t.isLoading},[e.createElementVNode("img",{src:t.icon,alt:t.alt,title:t.tooltip,class:e.normalizeClass(["m-auto w-12.5 h-12.5 transition-all duration-300 group-hover:scale-110 relative z-10",{"animate-spin":t.isLoading,"filter brightness-75":!t.isActive,"drop-shadow-lg":t.isActive,...t.iconClass}])},null,10,Fe)],10,je))}}),Oe=["title"],Pe=["src","alt"],We={key:0,class:"absolute bottom-1 right-1 bg-primary dark:bg-primary-dark text-white text-xs rounded-full w-4 h-4 flex items-center justify-center font-bold animate-bounce"},L=e.defineComponent({__name:"TrayIconButton",props:{icon:{},alt:{default:""},tooltip:{default:""},badge:{default:null},iconClass:{default:()=>({})},customClass:{default:""},tooltipClass:{default:""},showCustomTooltip:{type:Boolean,default:!1},customTooltipText:{default:""}},emits:["click"],setup(t,{emit:o}){const a=o,l=e.ref(!1),s=()=>{a("click")};return(i,d)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["p-1 rounded-corner relative hover:bg-primary dark:hover:bg-primary-dark group transition-all duration-300",t.customClass]),title:t.tooltip,onClick:s,onMouseenter:d[0]||(d[0]=c=>l.value=!0),onMouseleave:d[1]||(d[1]=c=>l.value=!1)},[e.createElementVNode("img",{src:t.icon,alt:t.alt,class:e.normalizeClass(["m-auto h-5.5 w-auto transition-all duration-300",t.iconClass])},null,10,Pe),t.badge!==null&&t.badge>0?(e.openBlock(),e.createElementBlock("div",We,e.toDisplayString(t.badge),1)):e.createCommentVNode("",!0),t.showCustomTooltip&&t.customTooltipText?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["absolute top-1 left-1/2 transform -translate-x-1/2 text-xs font-semibold p-1 rounded-corner transition-all duration-300 pointer-events-none background",[t.tooltipClass,{"opacity-0 -translate-y-2":!l.value,"opacity-100 translate-y-0":l.value}]])},e.toDisplayString(t.customTooltipText),3)):e.createCommentVNode("",!0),e.renderSlot(i.$slots,"default")],42,Oe))}}),Re=[B,h,g,w,k,E,$,V,S,N,z,D,T,I,L],qe={install(t){Re.forEach(o=>{t.component(o.name,o)})}};r.ActionButton=$,r.ConfigSection=V,r.DeviceCard=S,r.FormGroup=N,r.ListCard=z,r.SelectField=w,r.SideBar=B,r.SideButton=h,r.SideGroup=g,r.SliderControl=D,r.SwitchToggle=T,r.ThemeIcon=k,r.ToggleControl=I,r.TrayIconButton=L,r.WindowFrame=E,r.default=qe,Object.defineProperties(r,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
1
|
+
(function(r,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@tauri-apps/api/event"),require("@vasakgroup/plugin-vicons"),require("@tauri-apps/api/window")):typeof define=="function"&&define.amd?define(["exports","vue","@tauri-apps/api/event","@vasakgroup/plugin-vicons","@tauri-apps/api/window"],e):(r=typeof globalThis<"u"?globalThis:r||self,e(r.VueLibVasak={},r.Vue,r.TauriEvent,r.VasakVicons,r.TauriWindow))})(this,(function(r,e,j,p,F){"use strict";function O(t,o){const a=e.ref("");let l=null,s=!1,i=0;async function c(){const d=++i,n=t.value;if(!n){a.value="";return}const m=o.value==="symbol"?await p.getSymbolSource(n):await p.getIconSource(n);d===i&&(a.value=m)}return e.onMounted(async()=>{const d=await j.listen("vicons:theme-changed",c);if(s){d();return}l=d,await c()}),e.onUnmounted(()=>{s=!0,l?.()}),e.watch(t,c),a}const P=["src","alt"],u=e.defineComponent({__name:"ThemeIcon",props:{name:{},type:{default:"icon"},size:{default:18},alt:{default:""}},setup(t){const o=t,a=O(e.toRef(o,"name"),e.toRef(o,"type")),l=e.computed(()=>`${o.size}px`);return(s,i)=>e.unref(a)?(e.openBlock(),e.createElementBlock("img",{key:0,src:e.unref(a),alt:t.alt,style:e.normalizeStyle({width:l.value,height:l.value}),class:"shrink-0 object-contain"},null,12,P)):(e.openBlock(),e.createElementBlock("span",{key:1,style:e.normalizeStyle({width:l.value,height:l.value}),class:"shrink-0"},null,4))}}),W={class:"flex flex-col gap-2"},R=["aria-expanded"],q={key:1,class:"flex flex-col gap-1"},h=e.defineComponent({__name:"SideGroup",props:{title:{},collapsed:{type:Boolean,default:!1},defaultOpen:{type:Boolean,default:!0}},setup(t){const o=t,a=e.ref(o.defaultOpen);return e.watch(()=>o.collapsed,l=>{l&&(a.value=!0)}),(l,s)=>(e.openBlock(),e.createElementBlock("section",W,[t.collapsed?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"group flex w-full items-center justify-between rounded-corner px-2 py-1 text-tx-muted text-xs uppercase tracking-[0.08em] hover:bg-ui-surface/60","aria-expanded":a.value,onClick:s[0]||(s[0]=i=>a.value=!a.value)},[e.createElementVNode("span",null,e.toDisplayString(t.title),1),e.createVNode(u,{name:"pan-down-symbolic",type:"symbol",size:12,class:e.normalizeClass(["transition-transform duration-200",a.value?"":"-rotate-90"])},null,8,["class"])],8,R)),a.value||t.collapsed?(e.openBlock(),e.createElementBlock("div",q,[e.renderSlot(l.$slots,"default")])):e.createCommentVNode("",!0)]))}}),G=["title","aria-label","disabled","aria-current"],U={key:1},_={key:0,class:"min-w-0 flex-1 truncate font-medium"},H={key:1,class:"rounded-corner bg-ui-surface px-2 py-0.5 font-semibold text-tx-muted text-xs"},y=e.defineComponent({__name:"SideButton",props:{label:{},icon:{default:""},active:{type:Boolean,default:!1},collapsed:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},badge:{default:""}},emits:["click"],setup(t){return(o,a)=>(e.openBlock(),e.createElementBlock("button",{type:"button",title:t.collapsed?t.label:void 0,"aria-label":t.collapsed?t.label:void 0,disabled:t.disabled,"aria-current":t.active?"page":void 0,class:e.normalizeClass(["group relative flex w-full items-center gap-3 rounded-corner border px-3 py-2 text-left text-sm transition-all duration-200",[t.active?"border-secondary bg-primary/15 text-tx-main shadow-sm":"border-transparent bg-transparent hover:border-ui-border hover:bg-ui-surface/70",t.disabled?"cursor-not-allowed opacity-60":"cursor-pointer",t.collapsed?"justify-center px-2":""]]),onClick:a[0]||(a[0]=l=>o.$emit("click"))},[e.createElementVNode("span",{class:e.normalizeClass(["flex h-8 w-8 shrink-0 items-center justify-center rounded-corner font-semibold text-xs uppercase tracking-wide",t.active?"border-secondary bg-primary/20":""]),"aria-hidden":"true"},[t.icon?(e.openBlock(),e.createBlock(u,{key:0,name:t.icon,size:20},null,8,["name"])):(e.openBlock(),e.createElementBlock("span",U,e.toDisplayString(t.label.charAt(0).toUpperCase()),1))],2),t.collapsed?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",_,e.toDisplayString(t.label),1)),!t.collapsed&&t.badge!==""?(e.openBlock(),e.createElementBlock("span",H,e.toDisplayString(t.badge),1)):e.createCommentVNode("",!0)],10,G))}}),J={key:0,class:"flex flex-col gap-2 border-ui-border border-b p-2"},K={class:"flex items-center gap-2"},Q=["aria-label","aria-expanded"],X={key:0,class:"min-w-0 flex-1"},Y={key:0,class:"truncate font-semibold text-sm"},Z={key:1,class:"truncate text-tx-muted text-xs"},v={key:0},ee={key:1,class:"flex border-ui-border border-b p-2"},te=["aria-label","aria-expanded"],ae={class:"flex min-h-0 flex-1 flex-col gap-3 overflow-y-auto p-2"},C="hidden h-8 w-8 shrink-0 items-center justify-center rounded-corner border border-ui-border bg-ui-surface/70 transition-colors hover:bg-ui-surface md:inline-flex",B=767,w=e.defineComponent({__name:"SideBar",props:{title:{default:""},subtitle:{default:""},categories:{default:()=>[]},modelValue:{default:""},collapsed:{type:Boolean,default:void 0},collapseLabel:{default:"Collapse"},expandLabel:{default:"Expand"}},emits:["update:modelValue","update:collapsed","change"],setup(t,{expose:o,emit:a}){const l=t,s=a,i=e.ref(l.collapsed??!1),c=e.ref(!1);let d=null;const n=e.computed(()=>c.value||i.value),m=e.computed(()=>!!(l.title||l.subtitle));e.computed(()=>l.categories.length>0);function b(){c.value=window.innerWidth<=B}function M(){i.value=!i.value,s("update:collapsed",i.value)}function Ue(f){s("update:modelValue",f),s("change",f)}return e.watch(()=>l.collapsed,f=>{f!==void 0&&(i.value=f)}),e.onMounted(()=>{d=window.matchMedia(`(max-width: ${B}px)`),b(),d.addEventListener("change",b),window.addEventListener("resize",b)}),e.onBeforeUnmount(()=>{d?.removeEventListener("change",b),window.removeEventListener("resize",b)}),o({collapsed:n}),(f,Ke)=>(e.openBlock(),e.createElementBlock("aside",{class:e.normalizeClass(["relative z-30 flex h-full shrink-0 flex-col rounded-corner border border-ui-border bg-ui-surface/70 transition-all duration-300",["w-[84px]",n.value?"md:w-[84px]":"md:w-72"]])},[m.value||f.$slots.header?(e.openBlock(),e.createElementBlock("header",J,[e.createElementVNode("div",K,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(C),"aria-label":n.value?t.expandLabel:t.collapseLabel,"aria-expanded":!n.value,onClick:M},[e.createVNode(u,{name:n.value?"pan-end-symbolic":"pan-start-symbolic",type:"symbol",size:16},null,8,["name"])],8,Q),m.value&&!n.value?(e.openBlock(),e.createElementBlock("div",X,[t.title?(e.openBlock(),e.createElementBlock("p",Y,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),t.subtitle?(e.openBlock(),e.createElementBlock("p",Z,e.toDisplayString(t.subtitle),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),f.$slots.header&&!n.value?(e.openBlock(),e.createElementBlock("div",v,[e.renderSlot(f.$slots,"header",{collapsed:n.value})])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",ee,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(C),"aria-label":n.value?t.expandLabel:t.collapseLabel,"aria-expanded":!n.value,onClick:M},[e.createVNode(u,{name:n.value?"pan-end-symbolic":"pan-start-symbolic",type:"symbol",size:16},null,8,["name"])],8,te)])),e.createElementVNode("div",ae,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.categories,x=>(e.openBlock(),e.createBlock(h,{key:x.id,title:x.title,collapsed:n.value},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.items,k=>(e.openBlock(),e.createBlock(y,{key:k.id,label:k.label,icon:k.icon,badge:k.badge,disabled:k.disabled,collapsed:n.value,active:t.modelValue===k.id,onClick:Qe=>Ue(k.id)},null,8,["label","icon","badge","disabled","collapsed","active","onClick"]))),128))]),_:2},1032,["title","collapsed"]))),128)),e.renderSlot(f.$slots,"default",{collapsed:n.value})])],2))}}),le={class:"flex min-w-0 flex-col gap-1"},oe=["for"],ne={class:"relative flex min-w-0 items-center"},se=["id"],E=e.defineComponent({inheritAttrs:!1,__name:"SelectField",props:e.mergeModels({label:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const o=t,a=e.useAttrs(),l=e.useId(),s=e.computed(()=>a.id??l),[i,c]=e.useModel(t,"modelValue",{set(d){return c.number?Number(d):d}});return(d,n)=>(e.openBlock(),e.createElementBlock("div",le,[o.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:s.value,class:"text-tx-muted text-xs"},e.toDisplayString(o.label),9,oe)):e.createCommentVNode("",!0),e.createElementVNode("div",ne,[e.withDirectives(e.createElementVNode("select",e.mergeProps({id:s.value,"onUpdate:modelValue":n[0]||(n[0]=m=>e.isRef(i)?i.value=m:null),class:"min-w-0 flex-1 appearance-none truncate rounded-corner border border-ui-border bg-ui-surface/60 py-1.5 pr-8 pl-2 text-sm text-tx-main"},e.unref(a)),[e.renderSlot(d.$slots,"default")],16,se),[[e.vModelSelect,e.unref(i)]]),e.createVNode(u,{name:"pan-down-symbolic",type:"symbol",size:14,class:"pointer-events-none absolute right-2"})])]))}}),ie={"data-tauri-drag-region":""},re=["src","alt"],ce={"data-tauri-drag-region":""},de={"data-tauri-drag-region":""},me=["src"],fe=["src"],ue=["src"],ke=e.defineComponent({__name:"TopBar",props:{title:String,image:String},setup(t){const o=e.ref(null),a=F.getCurrentWindow(),l=e.ref(""),s=e.ref(""),i=e.ref(""),c=t;return e.onMounted(async()=>{l.value=await p.getIconSource("window-close"),s.value=await p.getIconSource("window-minimize"),i.value=await p.getIconSource("window-maximize")}),(d,n)=>(e.openBlock(),e.createElementBlock("div",{"data-tauri-drag-region":"",class:"flex h-8 px-4 py-1 bg-primary dark:bg-primary-dark rounded-t-corner-window justify-between align-center",ref_key:"bar",ref:o},[e.createElementVNode("div",ie,[e.createElementVNode("img",{src:c.image,"data-tauri-drag-region":"",class:"h-6 w-auto",alt:c.title},null,8,re)]),e.createElementVNode("div",ce,e.toDisplayString(c.title),1),e.createElementVNode("div",de,[e.createElementVNode("span",{class:"win-button",onClick:n[0]||(n[0]=m=>e.unref(a).minimize())},[e.createElementVNode("img",{src:s.value,class:"h-6 w-6 inline-block",alt:"Minimize"},null,8,me)]),e.createElementVNode("span",{class:"win-button",onClick:n[1]||(n[1]=m=>e.unref(a).toggleMaximize())},[e.createElementVNode("img",{src:i.value,class:"h-6 w-6 inline-block",alt:"Maximize"},null,8,fe)]),e.createElementVNode("span",{class:"win-button",onClick:n[2]||(n[2]=m=>e.unref(a).close())},[e.createElementVNode("img",{src:l.value,class:"h-6 w-6 inline-block",alt:"Close"},null,8,ue)])])],512))}}),$=e.defineComponent({__name:"WindowFrame",props:{title:{default:"Vasak"},image:{default:""}},setup(t){const o=t;return(a,l)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(ke,{title:o.title,image:o.image},null,8,["title","image"]),e.renderSlot(a.$slots,"default")],64))}}),pe=["type","disabled"],be={key:0,class:"w-4 h-4 animate-spin rounded-full border-2 border-current border-t-transparent"},ge=["src","alt"],he={key:2},ye=["src","alt"],xe=e.defineComponent({__name:"ActionButton",props:{label:{},disabled:{type:Boolean,default:!1},variant:{default:"primary"},loading:{type:Boolean,default:!1},customClass:{default:()=>({})},size:{default:"md"},fullWidth:{type:Boolean,default:!1},iconSrc:{default:""},iconAlt:{default:""},iconRight:{type:Boolean,default:!1},type:{default:"button"},stopPropagation:{type:Boolean,default:!1},preventDefault:{type:Boolean,default:!1}},emits:["click"],setup(t,{emit:o}){const a=t,l=o,s={primary:"bg-primary dark:bg-primary-dark text-tx-on-primary dark:text-tx-on-primary-dark hover:bg-primary/90 dark:hover:bg-primary-dark/90",secondary:"bg-secondary dark:bg-secondary-dark text-tx-on-primary dark:text-tx-on-primary-dark hover:bg-secondary/80 dark:hover:bg-secondary-dark/80",danger:"bg-status-error dark:bg-status-error-dark text-tx-on-primary dark:text-tx-on-primary-dark hover:bg-status-error/90 dark:hover:bg-status-error-dark/90"},i={sm:"px-2 py-1 text-xs",md:"px-3 py-1 text-sm",lg:"px-4 py-2 text-base"},c=d=>{a.stopPropagation&&d.stopPropagation(),a.preventDefault&&d.preventDefault(),!a.disabled&&!a.loading&&l("click")};return(d,n)=>(e.openBlock(),e.createElementBlock("button",{type:a.type,onClick:c,class:e.normalizeClass(["rounded-corner transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2",[s[a.variant],i[a.size],a.fullWidth?"w-full":"",a.iconSrc&&!a.label?"px-2 py-2":"",t.customClass]]),disabled:a.disabled||a.loading},[t.loading?(e.openBlock(),e.createElementBlock("span",be)):e.createCommentVNode("",!0),a.iconSrc&&!a.iconRight?(e.openBlock(),e.createElementBlock("img",{key:1,src:a.iconSrc,alt:a.iconAlt||a.label,class:"w-4 h-4"},null,8,ge)):e.createCommentVNode("",!0),a.label?(e.openBlock(),e.createElementBlock("span",he,e.toDisplayString(a.label),1)):e.createCommentVNode("",!0),a.iconSrc&&a.iconRight?(e.openBlock(),e.createElementBlock("img",{key:3,src:a.iconSrc,alt:a.iconAlt||a.label,class:"w-4 h-4"},null,8,ye)):e.createCommentVNode("",!0)],10,pe))}}),g=(t,o)=>{const a=t.__vccOpts||t;for(const[l,s]of o)a[l]=s;return a},V=g(xe,[["__scopeId","data-v-2eaf6e27"]]),Ce={class:"text-base font-semibold m-0 text-primary dark:text-primary-dark"},S=g(e.defineComponent({__name:"ConfigSection",props:{title:{},icon:{default:""},customClass:{default:()=>({})}},setup(t){return(o,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-4 p-4 background rounded-corner",t.customClass])},[e.createElementVNode("h3",Ce,e.toDisplayString(t.icon?`${t.icon} ${t.title}`:t.title),1),e.renderSlot(o.$slots,"default",{},void 0,!0)],2))}}),[["__scopeId","data-v-45bd4eab"]]),Be={class:"flex items-center gap-3 flex-1 min-w-0"},we=["src","alt"],Ee={class:"min-w-0"},$e={class:"font-semibold truncate"},Ve={key:0,class:"text-xs text-gray-400 truncate"},Se={key:1,class:"text-xs text-gray-400 truncate"},Ne={key:2,class:"text-xs text-gray-400 flex gap-2 mt-1"},ze={key:1,class:"w-2 h-2 rounded-full bg-green-500"},N=e.defineComponent({__name:"DeviceCard",props:{icon:{},title:{},subtitle:{default:""},metadata:{default:""},extraInfo:{default:()=>[]},isConnected:{type:Boolean,default:!1},showActionButton:{type:Boolean,default:!0},actionLabel:{default:"Conectar"},showStatusIndicator:{type:Boolean,default:!1},customClass:{default:""},clickable:{type:Boolean,default:!1}},emits:["action","click"],setup(t,{emit:o}){const a=o,l=()=>{a("action")},s=()=>{a("click")};return(i,c)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex items-center justify-between background rounded-vsk px-6 py-3 mb-4",[{"border-l-4 border-green-500":t.isConnected},t.customClass]]),onClick:s},[e.createElementVNode("div",Be,[e.createElementVNode("img",{src:t.icon,alt:t.title,class:"h-7 w-7 shrink-0"},null,8,we),e.createElementVNode("div",Ee,[e.createElementVNode("div",$e,e.toDisplayString(t.title),1),t.subtitle?(e.openBlock(),e.createElementBlock("div",Ve,e.toDisplayString(t.subtitle),1)):e.createCommentVNode("",!0),t.metadata?(e.openBlock(),e.createElementBlock("div",Se,e.toDisplayString(t.metadata),1)):e.createCommentVNode("",!0),t.extraInfo&&t.extraInfo.length>0?(e.openBlock(),e.createElementBlock("div",Ne,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.extraInfo,(d,n)=>(e.openBlock(),e.createElementBlock("span",{key:n},e.toDisplayString(d),1))),128))])):e.createCommentVNode("",!0)])]),t.showActionButton?(e.openBlock(),e.createElementBlock("button",{key:0,class:"bg-vsk-primary rounded-vsk px-4 py-2 text-sm font-semibold cursor-pointer hover:opacity-70",onClick:e.withModifiers(l,["stop"])},e.toDisplayString(t.actionLabel),1)):e.createCommentVNode("",!0),t.showStatusIndicator&&t.isConnected?(e.openBlock(),e.createElementBlock("div",ze)):e.createCommentVNode("",!0)],2))}}),De=["for"],z=g(e.defineComponent({__name:"FormGroup",props:{label:{},htmlFor:{default:""},customClass:{default:()=>({})},labelClass:{default:()=>({})}},setup(t){return(o,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-2",t.customClass])},[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:t.htmlFor,class:e.normalizeClass(["text-sm font-medium text-primary dark:text-primary-dark",t.labelClass])},e.toDisplayString(t.label),11,De)):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"default",{},void 0,!0)],2))}}),[["__scopeId","data-v-c0d9d9cb"]]),D=g(e.defineComponent({__name:"ListCard",props:{clickable:{type:Boolean,default:!1},customClass:{default:()=>({})}},emits:["click"],setup(t,{emit:o}){const a=t,l=o,s=()=>{a.clickable&&l("click")};return(i,c)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex items-center justify-between background p-3 rounded-vsk border border-vsk-primary/70 transition-colors duration-200",{"hover:bg-vsk-primary/5 cursor-pointer":a.clickable},t.customClass]),onClick:s},[e.renderSlot(i.$slots,"default",{},void 0,!0)],2))}}),[["__scopeId","data-v-f86d47da"]]),Ie={class:"background rounded-corner flex flex-row items-center gap-2 justify-between w-full h-auto p-4 transition-all duration-200 hover:bg-ui-surface/80 dark:hover:bg-ui-surface-dark/80"},Te=["src","alt","title"],Le={key:1,class:"w-8 h-8 flex items-center justify-center"},Ae=["src","alt"],Me=["min","max","value"],I=e.defineComponent({__name:"SliderControl",props:{icon:{},alt:{default:""},tooltip:{default:""},modelValue:{},min:{default:0},max:{default:100},showButton:{type:Boolean,default:!1},iconClass:{default:()=>({})},getPercentageClass:{type:Function,default:()=>""}},emits:["update:modelValue","buttonClick"],setup(t,{emit:o}){const a=t,l=o,s=e.computed(()=>{if(a.max<=a.min)return 0;const n=a.max-a.min,m=a.modelValue-a.min;return Math.round(m/n*100)}),i=e.computed(()=>a.getPercentageClass?a.getPercentageClass(s.value):""),c=n=>{const m=n.target;l("update:modelValue",Number(m.value))},d=()=>{l("buttonClick")};return(n,m)=>(e.openBlock(),e.createElementBlock("div",Ie,[t.showButton?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:d,class:"w-8 h-8 flex items-center justify-center rounded-corner transition-all duration-200 hover:bg-ui-surface/80 dark:hover:bg-ui-surface-dark/80 hover:scale-110 active:scale-95"},[e.createElementVNode("img",{src:t.icon,alt:t.alt,title:t.tooltip,class:e.normalizeClass(["w-6 h-6 transition-all duration-200",t.iconClass])},null,10,Te)])):(e.openBlock(),e.createElementBlock("div",Le,[e.createElementVNode("img",{src:t.icon,alt:t.alt,class:"w-6 h-6 transition-all duration-200"},null,8,Ae)])),e.createElementVNode("input",{type:"range",min:t.min,max:t.max,value:t.modelValue,onInput:c,class:"flex-1 transition-all duration-200 hover:scale-105"},null,40,Me),e.createElementVNode("span",{class:e.normalizeClass(["w-12 text-right transition-all duration-200 font-medium",i.value])},e.toDisplayString(s.value)+"% ",3)]))}}),je=["disabled"],T=e.defineComponent({__name:"SwitchToggle",props:{isOn:{type:Boolean},disabled:{type:Boolean,default:!1},size:{default:"small"},activeClass:{default:"bg-primary dark:bg-primary-dark"},inactiveClass:{default:"background"},customClass:{default:""}},emits:["toggle"],setup(t,{emit:o}){const a=t,l=o,s=()=>{l("toggle",!a.isOn)};return(i,c)=>(e.openBlock(),e.createElementBlock("button",{type:"button",onClick:s,disabled:t.disabled,class:e.normalizeClass(["relative inline-flex items-center rounded-full transition-colors",t.size==="small"?"h-6 w-11":"h-7 w-12",t.isOn?t.activeClass:t.inactiveClass,t.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer",t.customClass])},[e.createElementVNode("span",{class:e.normalizeClass(["inline-block transform rounded-full bg-white shadow transition-transform",t.size==="small"?"h-4 w-4":"h-6 w-6",t.isOn?t.size==="small"?"translate-x-6":"translate-x-5":"translate-x-1"])},null,2)],10,je))}}),Fe=["disabled"],Oe=["src","alt","title"],L=e.defineComponent({__name:"ToggleControl",props:{icon:{},alt:{default:""},tooltip:{default:""},isActive:{type:Boolean,default:!1},isLoading:{type:Boolean,default:!1},iconClass:{default:()=>({})},customClass:{default:()=>({})}},emits:["click"],setup(t,{emit:o}){const a=o,l=()=>{a("click")};return(s,i)=>(e.openBlock(),e.createElementBlock("button",{onClick:l,class:e.normalizeClass(["p-2 rounded-corner background hover:opacity-50 transition-all duration-300 h-17.5 w-17.5 group relative overflow-hidden hover:scale-105 hover:shadow-lg active:scale-95",{"animate-pulse":t.isLoading,"ring-2 ring-primary dark:ring-primary-dark":t.isActive,"opacity-60":!t.isActive,...t.customClass}]),disabled:t.isLoading},[e.createElementVNode("img",{src:t.icon,alt:t.alt,title:t.tooltip,class:e.normalizeClass(["m-auto w-12.5 h-12.5 transition-all duration-300 group-hover:scale-110 relative z-10",{"animate-spin":t.isLoading,"filter brightness-75":!t.isActive,"drop-shadow-lg":t.isActive,...t.iconClass}])},null,10,Oe)],10,Fe))}}),Pe=["title"],We=["src","alt"],Re={key:0,class:"absolute bottom-1 right-1 bg-primary dark:bg-primary-dark text-white text-xs rounded-full w-4 h-4 flex items-center justify-center font-bold animate-bounce"},A=e.defineComponent({__name:"TrayIconButton",props:{icon:{},alt:{default:""},tooltip:{default:""},badge:{default:null},iconClass:{default:()=>({})},customClass:{default:""},tooltipClass:{default:""},showCustomTooltip:{type:Boolean,default:!1},customTooltipText:{default:""}},emits:["click"],setup(t,{emit:o}){const a=o,l=e.ref(!1),s=()=>{a("click")};return(i,c)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["p-1 rounded-corner relative hover:bg-primary dark:hover:bg-primary-dark group transition-all duration-300",t.customClass]),title:t.tooltip,onClick:s,onMouseenter:c[0]||(c[0]=d=>l.value=!0),onMouseleave:c[1]||(c[1]=d=>l.value=!1)},[e.createElementVNode("img",{src:t.icon,alt:t.alt,class:e.normalizeClass(["m-auto h-5.5 w-auto transition-all duration-300",t.iconClass])},null,10,We),t.badge!==null&&t.badge>0?(e.openBlock(),e.createElementBlock("div",Re,e.toDisplayString(t.badge),1)):e.createCommentVNode("",!0),t.showCustomTooltip&&t.customTooltipText?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["absolute top-1 left-1/2 transform -translate-x-1/2 text-xs font-semibold p-1 rounded-corner transition-all duration-300 pointer-events-none background",[t.tooltipClass,{"opacity-0 -translate-y-2":!l.value,"opacity-100 translate-y-0":l.value}]])},e.toDisplayString(t.customTooltipText),3)):e.createCommentVNode("",!0),e.renderSlot(i.$slots,"default")],42,Pe))}}),qe=[w,y,h,E,u,$,V,S,N,z,D,I,T,L,A],Ge={install(t){qe.forEach(o=>{t.component(o.name,o)})}};r.ActionButton=V,r.ConfigSection=S,r.DeviceCard=N,r.FormGroup=z,r.ListCard=D,r.SelectField=E,r.SideBar=w,r.SideButton=y,r.SideGroup=h,r.SliderControl=I,r.SwitchToggle=T,r.ThemeIcon=u,r.ToggleControl=L,r.TrayIconButton=A,r.WindowFrame=$,r.default=Ge,Object.defineProperties(r,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|