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