mgv-backoffice 1.30.0 → 1.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +63 -0
- package/dist/components/BaseConfirmModal.vue.d.ts +3 -3
- package/dist/components/BaseCopyButton.vue.d.ts +1 -1
- package/dist/components/BaseFileDropzone.vue.d.ts +32 -0
- package/dist/components/BaseModalShell.vue.d.ts +23 -7
- package/dist/composables/useFieldClasses.d.ts +29 -0
- package/dist/index.d.ts +7 -2
- package/dist/ui-lib.css +1 -1
- package/dist/ui-lib.js +847 -699
- package/dist/ui-lib.umd.cjs +1 -1
- package/dist/utils/format.d.ts +23 -0
- package/dist/utils/httpColors.d.ts +13 -0
- package/dist/utils/kvRows.d.ts +21 -0
- package/package.json +1 -1
- package/src/components/BaseConfirmModal.vue +5 -17
- package/src/components/BaseEntityPickerModal.vue +7 -9
- package/src/components/BaseFileDropzone.vue +94 -0
- package/src/components/BaseModalShell.vue +45 -3
- package/src/components/BaseTextInputModal.vue +5 -9
- package/src/composables/useFieldClasses.test.ts +55 -0
- package/src/composables/useFieldClasses.ts +56 -0
- package/src/index.ts +11 -0
- package/src/utils/format.test.ts +55 -0
- package/src/utils/format.ts +57 -0
- package/src/utils/httpColors.test.ts +38 -0
- package/src/utils/httpColors.ts +31 -0
- package/src/utils/kvRows.test.ts +47 -0
- package/src/utils/kvRows.ts +34 -0
package/dist/ui-lib.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { Fragment as e, Teleport as t, Transition as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s,
|
|
2
|
-
import { ArrowDownIcon as
|
|
3
|
-
import { HomeIcon as
|
|
4
|
-
import { useRoute as
|
|
1
|
+
import { Fragment as e, Teleport as t, Transition as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createSlots as c, createStaticVNode as l, createTextVNode as u, createVNode as d, defineComponent as f, effectScope as p, nextTick as m, normalizeClass as h, onBeforeUnmount as g, onMounted as _, onScopeDispose as v, onUnmounted as y, openBlock as b, reactive as x, ref as S, renderList as C, renderSlot as w, resolveComponent as T, resolveDynamicComponent as E, toDisplayString as D, unref as O, useSlots as k, vModelCheckbox as A, vModelDynamic as ee, vModelText as j, vShow as te, watch as M, withCtx as N, withDirectives as P, withKeys as ne, withModifiers as F } from "vue";
|
|
2
|
+
import { ArrowDownIcon as re, ArrowUpIcon as ie, Bars3Icon as ae, BellIcon as oe, CheckCircleIcon as se, ChevronDoubleLeftIcon as ce, ChevronDoubleRightIcon as le, ChevronDownIcon as ue, ChevronRightIcon as de, ClipboardDocumentCheckIcon as fe, ClipboardDocumentIcon as pe, DocumentDuplicateIcon as me, ExclamationCircleIcon as he, ExclamationTriangleIcon as ge, FolderIcon as _e, InformationCircleIcon as ve, MagnifyingGlassIcon as ye, MinusIcon as be, MoonIcon as xe, SunIcon as Se, XMarkIcon as Ce } from "@heroicons/vue/24/outline";
|
|
3
|
+
import { HomeIcon as we } from "@heroicons/vue/24/solid";
|
|
4
|
+
import { useRoute as Te, useRouter as Ee } from "vue-router";
|
|
5
5
|
//#region src/enums/AlertEnum.ts
|
|
6
6
|
var I = /* @__PURE__ */ function(e) {
|
|
7
7
|
return e.WARNING = "WARNING", e.ERROR = "ERROR", e.SUCCESS = "SUCCESS", e.INFO = "INFO", e;
|
|
8
|
-
}({}), L =
|
|
9
|
-
function
|
|
10
|
-
if (
|
|
8
|
+
}({}), L = S(!1), De = !1, R = "mgv-theme";
|
|
9
|
+
function Oe(e) {
|
|
10
|
+
if (De) {
|
|
11
11
|
e !== R && console.warn(`[ui-lib] useTheme: storage key "${e}" ignored — theme already initialized with "${R}". Call initTheme({ storageKey }) before mounting any component.`);
|
|
12
12
|
return;
|
|
13
13
|
}
|
|
14
|
-
if (
|
|
14
|
+
if (De = !0, R = e, typeof window < "u") {
|
|
15
15
|
let e = window.localStorage?.getItem(R);
|
|
16
16
|
e ? L.value = e === "dark" : typeof window.matchMedia == "function" && (L.value = window.matchMedia("(prefers-color-scheme: dark)").matches);
|
|
17
17
|
}
|
|
18
|
-
typeof document < "u" &&
|
|
18
|
+
typeof document < "u" && p(!0).run(() => {
|
|
19
19
|
M(L, (e) => {
|
|
20
20
|
document.documentElement.classList.toggle("dark", e), window.localStorage?.setItem(R, e ? "dark" : "light");
|
|
21
21
|
}, { immediate: !0 });
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
|
-
function
|
|
25
|
-
|
|
24
|
+
function ke(e) {
|
|
25
|
+
Oe(e?.storageKey ?? R);
|
|
26
26
|
}
|
|
27
27
|
function z(e) {
|
|
28
|
-
|
|
28
|
+
Oe(e?.storageKey ?? R);
|
|
29
29
|
function t() {
|
|
30
30
|
L.value = !L.value;
|
|
31
31
|
}
|
|
@@ -36,10 +36,10 @@ function z(e) {
|
|
|
36
36
|
}
|
|
37
37
|
//#endregion
|
|
38
38
|
//#region src/components/BaseAlert.vue?vue&type=script&setup=true&lang.ts
|
|
39
|
-
var
|
|
39
|
+
var Ae = { class: "min-w-0 flex-1" }, je = {
|
|
40
40
|
key: 0,
|
|
41
41
|
class: "font-medium"
|
|
42
|
-
},
|
|
42
|
+
}, Me = /* @__PURE__ */ f({
|
|
43
43
|
__name: "BaseAlert",
|
|
44
44
|
props: {
|
|
45
45
|
title: { default: "" },
|
|
@@ -69,10 +69,10 @@ var ke = { class: "min-w-0 flex-1" }, Ae = {
|
|
|
69
69
|
}
|
|
70
70
|
}, l = r(() => n.value ? c[t.color].dark : c[t.color].light), u = r(() => {
|
|
71
71
|
switch (t.color) {
|
|
72
|
-
case I.SUCCESS: return
|
|
73
|
-
case I.WARNING: return
|
|
74
|
-
case I.INFO: return
|
|
75
|
-
default: return
|
|
72
|
+
case I.SUCCESS: return se;
|
|
73
|
+
case I.WARNING: return ge;
|
|
74
|
+
case I.INFO: return ve;
|
|
75
|
+
default: return he;
|
|
76
76
|
}
|
|
77
77
|
}), d = r(() => {
|
|
78
78
|
switch (t.color) {
|
|
@@ -82,24 +82,24 @@ var ke = { class: "min-w-0 flex-1" }, Ae = {
|
|
|
82
82
|
default: return "text-red-500";
|
|
83
83
|
}
|
|
84
84
|
});
|
|
85
|
-
return (t, n) => (
|
|
85
|
+
return (t, n) => (b(), o("div", {
|
|
86
86
|
role: "alert",
|
|
87
|
-
class:
|
|
88
|
-
}, [(
|
|
89
|
-
class:
|
|
87
|
+
class: h(["flex gap-3 mb-4 rounded-lg border text-sm transition-colors", [e.compact ? "items-start px-3 py-2 text-xs" : "items-start p-4", l.value]])
|
|
88
|
+
}, [(b(), i(E(u.value), {
|
|
89
|
+
class: h(["shrink-0", [e.compact ? "w-4 h-4 mt-px" : "w-5 h-5 mt-0.5", d.value]]),
|
|
90
90
|
"aria-hidden": "true"
|
|
91
|
-
}, null, 8, ["class"])), s("div",
|
|
91
|
+
}, null, 8, ["class"])), s("div", Ae, [e.title ? (b(), o("p", je, D(e.title), 1)) : a("", !0), w(t.$slots, "default")])], 2));
|
|
92
92
|
}
|
|
93
93
|
}), B = /* @__PURE__ */ function(e) {
|
|
94
94
|
return e.NONE = "NONE", e.RED = "RED", e.YELLOW = "YELLOW", e.BLACK = "BLACK", e.GRAY = "GRAY", e.GREEN = "GREEN", e.BLUE = "BLUE", e;
|
|
95
|
-
}({}),
|
|
95
|
+
}({}), Ne = "bg-red-100 text-red-700 border-red-200", Pe = /* @__PURE__ */ f({
|
|
96
96
|
__name: "BaseBadge",
|
|
97
97
|
props: { color: {
|
|
98
98
|
type: String,
|
|
99
99
|
required: !1
|
|
100
100
|
} },
|
|
101
101
|
setup(e) {
|
|
102
|
-
let t =
|
|
102
|
+
let t = k(), n = r(() => !!t.default), i = e, s = {
|
|
103
103
|
[B.RED]: "bg-red-100 text-red-700 border-red-200",
|
|
104
104
|
[B.GREEN]: "bg-green-100 text-green-700 border-green-200",
|
|
105
105
|
[B.BLUE]: "bg-blue-100 text-blue-700 border-blue-200",
|
|
@@ -107,19 +107,19 @@ var ke = { class: "min-w-0 flex-1" }, Ae = {
|
|
|
107
107
|
[B.GRAY]: "bg-gray-100 text-gray-700 border-gray-200",
|
|
108
108
|
[B.BLACK]: "bg-gray-800 text-gray-100 border-gray-700",
|
|
109
109
|
[B.NONE]: "bg-gray-50 text-gray-600 border-gray-200"
|
|
110
|
-
}, c = r(() => `inline-flex items-center gap-1 font-semibold text-xs leading-none px-3 py-1.5 rounded-full border ${i.color && s[i.color] ||
|
|
111
|
-
return (e, t) => n.value ? (
|
|
110
|
+
}, c = r(() => `inline-flex items-center gap-1 font-semibold text-xs leading-none px-3 py-1.5 rounded-full border ${i.color && s[i.color] || Ne}`);
|
|
111
|
+
return (e, t) => n.value ? (b(), o("span", {
|
|
112
112
|
key: 0,
|
|
113
|
-
class:
|
|
114
|
-
}, [
|
|
113
|
+
class: h(c.value)
|
|
114
|
+
}, [w(e.$slots, "default")], 2)) : a("", !0);
|
|
115
115
|
}
|
|
116
|
-
}),
|
|
116
|
+
}), Fe = {
|
|
117
117
|
class: "flex px-5 py-3 text-gray-700 border border-gray-200 rounded-lg bg-gray-50 dark:bg-gray-800 dark:border-gray-700",
|
|
118
118
|
"aria-label": "Breadcrumb"
|
|
119
|
-
},
|
|
119
|
+
}, Ie = { class: "inline-flex items-center space-x-1 md:space-x-3" }, Le = {
|
|
120
120
|
class: "inline-flex items-center",
|
|
121
121
|
style: { "margin-left": "0" }
|
|
122
|
-
},
|
|
122
|
+
}, Re = /* @__PURE__ */ f({
|
|
123
123
|
__name: "BaseBreadcrumb",
|
|
124
124
|
props: {
|
|
125
125
|
items: {
|
|
@@ -143,22 +143,22 @@ var ke = { class: "min-w-0 flex-1" }, Ae = {
|
|
|
143
143
|
}));
|
|
144
144
|
});
|
|
145
145
|
return (t, n) => {
|
|
146
|
-
let r =
|
|
147
|
-
return
|
|
146
|
+
let r = T("router-link");
|
|
147
|
+
return b(), o("nav", Fe, [s("ol", Ie, [s("li", Le, [d(r, {
|
|
148
148
|
to: "/",
|
|
149
149
|
class: "inline-flex items-center text-sm font-medium text-gray-700 hover:text-blue-600 dark:text-gray-400 dark:hover:text-white transition-colors rounded focus:outline-none focus-visible:ring-2 focus-visible:ring-emerald-500"
|
|
150
150
|
}, {
|
|
151
|
-
default: N(() => [
|
|
151
|
+
default: N(() => [d(O(we), { class: "h-4 w-4 text-gray-500 mr-2" }), n[0] ||= u(" Home ", -1)]),
|
|
152
152
|
_: 1
|
|
153
|
-
})]), (
|
|
153
|
+
})]), (b(!0), o(e, null, C(i.value, (e, t) => (b(), o("li", {
|
|
154
154
|
key: t,
|
|
155
155
|
class: "inline-flex items-center",
|
|
156
156
|
style: { "margin-left": "0" }
|
|
157
|
-
}, [
|
|
157
|
+
}, [d(O(de), { class: "h-4 w-4 text-gray-500" }), d(r, {
|
|
158
158
|
to: e.url,
|
|
159
159
|
class: "ml-1 text-sm font-medium text-gray-700 hover:text-blue-600 md:ml-2 dark:text-gray-400 dark:hover:text-white transition-colors rounded focus:outline-none focus-visible:ring-2 focus-visible:ring-emerald-500"
|
|
160
160
|
}, {
|
|
161
|
-
default: N(() => [
|
|
161
|
+
default: N(() => [u(D(e.name), 1)]),
|
|
162
162
|
_: 2
|
|
163
163
|
}, 1032, ["to"])]))), 128))])]);
|
|
164
164
|
};
|
|
@@ -167,17 +167,17 @@ var ke = { class: "min-w-0 flex-1" }, Ae = {
|
|
|
167
167
|
return e.RED = "RED", e.BLUE = "BLUE", e.WHITE = "WHITE", e.DARK = "DARK", e.GREEN = "GREEN", e.EMERALD = "EMERALD", e.YELLOW = "YELLOW", e.PURPLE = "PURPLE", e.SKY = "SKY", e.GRAY = "GRAY", e.AMBER = "AMBER", e;
|
|
168
168
|
}({}), H = /* @__PURE__ */ function(e) {
|
|
169
169
|
return e.EXTRA_SMALL = "EXTRA_SMALL", e.SMALL = "SMALL", e.BASE = "BASE", e.LARGE = "LARGE", e.EXTRA_LARGE = "EXTRA_LARGE", e;
|
|
170
|
-
}({}),
|
|
170
|
+
}({}), ze = [
|
|
171
171
|
"type",
|
|
172
172
|
"disabled",
|
|
173
173
|
"onClick"
|
|
174
|
-
],
|
|
174
|
+
], Be = {
|
|
175
175
|
key: 0,
|
|
176
176
|
class: "inline-flex items-center"
|
|
177
|
-
},
|
|
177
|
+
}, Ve = { key: 1 }, He = { key: 2 }, Ue = ["type", "disabled"], We = {
|
|
178
178
|
key: 0,
|
|
179
179
|
class: "inline-flex items-center"
|
|
180
|
-
},
|
|
180
|
+
}, Ge = { key: 1 }, Ke = { key: 2 }, U = /* @__PURE__ */ f({
|
|
181
181
|
__name: "BaseButton",
|
|
182
182
|
props: {
|
|
183
183
|
description: {
|
|
@@ -395,19 +395,19 @@ var ke = { class: "min-w-0 flex-1" }, Ae = {
|
|
|
395
395
|
return n.isRounded && (o = "rounded-full"), t + " " + a + " " + i + " font-medium " + o;
|
|
396
396
|
}
|
|
397
397
|
return (t, r) => {
|
|
398
|
-
let c =
|
|
399
|
-
return e.to ? (
|
|
398
|
+
let c = T("router-link");
|
|
399
|
+
return e.to ? (b(), i(c, {
|
|
400
400
|
key: 0,
|
|
401
401
|
to: e.to,
|
|
402
402
|
custom: ""
|
|
403
403
|
}, {
|
|
404
404
|
default: N(({ navigate: i }) => [s("button", {
|
|
405
405
|
type: n.type,
|
|
406
|
-
class:
|
|
406
|
+
class: h(l()),
|
|
407
407
|
disabled: e.isDisable || e.isLoading,
|
|
408
408
|
onClick: i
|
|
409
409
|
}, [
|
|
410
|
-
e.isLoading ? (
|
|
410
|
+
e.isLoading ? (b(), o("div", Be, [...r[0] ||= [s("svg", {
|
|
411
411
|
"aria-hidden": "true",
|
|
412
412
|
role: "status",
|
|
413
413
|
class: "inline w-4 h-4 me-3 animate-spin",
|
|
@@ -421,18 +421,18 @@ var ke = { class: "min-w-0 flex-1" }, Ae = {
|
|
|
421
421
|
d: "M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",
|
|
422
422
|
fill: "currentColor"
|
|
423
423
|
})], -1)]])) : a("", !0),
|
|
424
|
-
e.iconLeft ? a("", !0) : (
|
|
425
|
-
|
|
426
|
-
e.iconLeft ? (
|
|
427
|
-
], 10,
|
|
424
|
+
e.iconLeft ? a("", !0) : (b(), o("span", Ve, D(e.description), 1)),
|
|
425
|
+
w(t.$slots, "default"),
|
|
426
|
+
e.iconLeft ? (b(), o("span", He, D(e.description), 1)) : a("", !0)
|
|
427
|
+
], 10, ze)]),
|
|
428
428
|
_: 3
|
|
429
|
-
}, 8, ["to"])) : (
|
|
429
|
+
}, 8, ["to"])) : (b(), o("button", {
|
|
430
430
|
key: 1,
|
|
431
431
|
type: n.type,
|
|
432
|
-
class:
|
|
432
|
+
class: h(l()),
|
|
433
433
|
disabled: e.isDisable || e.isLoading
|
|
434
434
|
}, [
|
|
435
|
-
e.isLoading ? (
|
|
435
|
+
e.isLoading ? (b(), o("div", We, [...r[1] ||= [s("svg", {
|
|
436
436
|
"aria-hidden": "true",
|
|
437
437
|
role: "status",
|
|
438
438
|
class: "inline w-4 h-4 me-3 animate-spin",
|
|
@@ -446,24 +446,24 @@ var ke = { class: "min-w-0 flex-1" }, Ae = {
|
|
|
446
446
|
d: "M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",
|
|
447
447
|
fill: "currentColor"
|
|
448
448
|
})], -1)]])) : a("", !0),
|
|
449
|
-
e.iconLeft ? a("", !0) : (
|
|
450
|
-
|
|
451
|
-
e.iconLeft ? (
|
|
452
|
-
], 10,
|
|
449
|
+
e.iconLeft ? a("", !0) : (b(), o("span", Ge, D(e.description), 1)),
|
|
450
|
+
w(t.$slots, "default"),
|
|
451
|
+
e.iconLeft ? (b(), o("span", Ke, D(e.description), 1)) : a("", !0)
|
|
452
|
+
], 10, Ue));
|
|
453
453
|
};
|
|
454
454
|
}
|
|
455
455
|
}), W = /* @__PURE__ */ function(e) {
|
|
456
456
|
return e.BASE = "BASE", e.BASE_SHORTER = "BASE_SHORTER", e.SQUARE = "SQUARE", e;
|
|
457
|
-
}({}),
|
|
457
|
+
}({}), qe = {
|
|
458
458
|
key: 0,
|
|
459
459
|
class: "h-px my-8 bg-gray-200 border-0 dark:bg-gray-700"
|
|
460
|
-
},
|
|
460
|
+
}, Je = {
|
|
461
461
|
key: 1,
|
|
462
462
|
class: "w-48 h-1 mx-auto my-4 bg-gray-100 border-0 rounded md:my-10 dark:bg-gray-700"
|
|
463
|
-
},
|
|
463
|
+
}, Ye = {
|
|
464
464
|
key: 2,
|
|
465
465
|
class: "w-8 h-8 mx-auto my-8 bg-gray-200 border-0 rounded md:my-12 dark:bg-gray-700"
|
|
466
|
-
},
|
|
466
|
+
}, Xe = /* @__PURE__ */ f({
|
|
467
467
|
__name: "BaseLine",
|
|
468
468
|
props: { mode: {
|
|
469
469
|
type: String,
|
|
@@ -471,15 +471,15 @@ var ke = { class: "min-w-0 flex-1" }, Ae = {
|
|
|
471
471
|
default: W.BASE
|
|
472
472
|
} },
|
|
473
473
|
setup(t) {
|
|
474
|
-
return (n, r) => (
|
|
475
|
-
t.mode ===
|
|
476
|
-
t.mode ===
|
|
477
|
-
t.mode ===
|
|
474
|
+
return (n, r) => (b(), o(e, null, [
|
|
475
|
+
t.mode === O(W).BASE ? (b(), o("hr", qe)) : a("", !0),
|
|
476
|
+
t.mode === O(W).BASE_SHORTER ? (b(), o("hr", Je)) : a("", !0),
|
|
477
|
+
t.mode === O(W).SQUARE ? (b(), o("hr", Ye)) : a("", !0)
|
|
478
478
|
], 64));
|
|
479
479
|
}
|
|
480
480
|
}), G = /* @__PURE__ */ function(e) {
|
|
481
481
|
return e.SMALL = "SMALL", e.MEDIUM = "MEDIUM", e.LARGE = "LARGE", e;
|
|
482
|
-
}({}),
|
|
482
|
+
}({}), Ze = G, Qe = ["height", "width"], $e = /* @__PURE__ */ f({
|
|
483
483
|
__name: "BaseLogo",
|
|
484
484
|
props: { size: {
|
|
485
485
|
type: String,
|
|
@@ -504,12 +504,12 @@ var ke = { class: "min-w-0 flex-1" }, Ae = {
|
|
|
504
504
|
return e;
|
|
505
505
|
}
|
|
506
506
|
return (e, t) => {
|
|
507
|
-
let r =
|
|
508
|
-
return
|
|
507
|
+
let r = T("router-link");
|
|
508
|
+
return b(), i(r, {
|
|
509
509
|
to: "/",
|
|
510
510
|
class: "flex items-center mb-6 text-2xl font-semibold text-gray-900 dark:text-white"
|
|
511
511
|
}, {
|
|
512
|
-
default: N(() => [(
|
|
512
|
+
default: N(() => [(b(), o("svg", {
|
|
513
513
|
height: n(),
|
|
514
514
|
width: n(),
|
|
515
515
|
viewBox: "33.6 130.6 499.7 242.9",
|
|
@@ -659,23 +659,23 @@ var ke = { class: "min-w-0 flex-1" }, Ae = {
|
|
|
659
659
|
d: "m281.7 183.8h3.6v18.5h-3.6z",
|
|
660
660
|
fill: "url(#k)"
|
|
661
661
|
}, null, -1)
|
|
662
|
-
]], 8,
|
|
662
|
+
]], 8, Qe))]),
|
|
663
663
|
_: 1
|
|
664
664
|
});
|
|
665
665
|
};
|
|
666
666
|
}
|
|
667
|
-
}),
|
|
667
|
+
}), et = /* @__PURE__ */ function(e) {
|
|
668
668
|
return e.DELETE = "DELETE", e.SUCCESS = "SUCCESS", e;
|
|
669
|
-
}({}),
|
|
669
|
+
}({}), tt = {
|
|
670
670
|
key: 0,
|
|
671
671
|
class: "p-6 text-center"
|
|
672
|
-
},
|
|
672
|
+
}, nt = { class: "flex justify-center" }, rt = {
|
|
673
673
|
key: 1,
|
|
674
674
|
class: "p-6 text-center"
|
|
675
|
-
},
|
|
675
|
+
}, it = {
|
|
676
676
|
key: 0,
|
|
677
677
|
class: "mb-5 text-sm text-gray-500"
|
|
678
|
-
},
|
|
678
|
+
}, at = { class: "flex justify-center" }, ot = /* @__PURE__ */ f({
|
|
679
679
|
__name: "BaseModal",
|
|
680
680
|
props: {
|
|
681
681
|
title: {
|
|
@@ -694,7 +694,7 @@ var ke = { class: "min-w-0 flex-1" }, Ae = {
|
|
|
694
694
|
mode: {
|
|
695
695
|
type: String,
|
|
696
696
|
required: !1,
|
|
697
|
-
default:
|
|
697
|
+
default: et.SUCCESS
|
|
698
698
|
}
|
|
699
699
|
},
|
|
700
700
|
emits: ["closeModal", "confirmModal"],
|
|
@@ -703,11 +703,11 @@ var ke = { class: "min-w-0 flex-1" }, Ae = {
|
|
|
703
703
|
function c(e) {
|
|
704
704
|
e.key === "Escape" && r("closeModal");
|
|
705
705
|
}
|
|
706
|
-
return
|
|
706
|
+
return _(() => {
|
|
707
707
|
document.addEventListener("keydown", c);
|
|
708
|
-
}),
|
|
708
|
+
}), y(() => {
|
|
709
709
|
document.removeEventListener("keydown", c);
|
|
710
|
-
}), (n, r) => (
|
|
710
|
+
}), (n, r) => (b(), o(e, null, [s("div", {
|
|
711
711
|
class: "fixed inset-0 w-full h-screen bg-black/75 z-40",
|
|
712
712
|
onClick: r[0] ||= (e) => n.$emit("closeModal")
|
|
713
713
|
}), s("div", {
|
|
@@ -715,37 +715,37 @@ var ke = { class: "min-w-0 flex-1" }, Ae = {
|
|
|
715
715
|
role: "dialog",
|
|
716
716
|
"aria-modal": "true",
|
|
717
717
|
"aria-labelledby": i
|
|
718
|
-
}, [t.mode ===
|
|
719
|
-
|
|
718
|
+
}, [t.mode === O(et).DELETE ? (b(), o("div", tt, [
|
|
719
|
+
d(O(he), { class: "w-12 h-12 text-gray-400 mx-auto mb-4" }),
|
|
720
720
|
s("h3", {
|
|
721
721
|
id: i,
|
|
722
722
|
class: "mb-5 text-lg font-normal text-gray-500 dark:text-gray-400"
|
|
723
|
-
}, " Are you sure you want to delete this " +
|
|
724
|
-
s("div",
|
|
725
|
-
color:
|
|
723
|
+
}, " Are you sure you want to delete this " + D(t.title) + "? ", 1),
|
|
724
|
+
s("div", nt, [d(U, {
|
|
725
|
+
color: O(V).RED,
|
|
726
726
|
onClick: r[1] ||= (e) => n.$emit("confirmModal"),
|
|
727
727
|
description: "Yes, I'm sure"
|
|
728
|
-
}, null, 8, ["color"]),
|
|
729
|
-
color:
|
|
728
|
+
}, null, 8, ["color"]), d(U, {
|
|
729
|
+
color: O(V).WHITE,
|
|
730
730
|
onClick: r[2] ||= (e) => n.$emit("closeModal"),
|
|
731
731
|
description: "No, cancel"
|
|
732
732
|
}, null, 8, ["color"])])
|
|
733
|
-
])) : (
|
|
734
|
-
|
|
733
|
+
])) : (b(), o("div", rt, [
|
|
734
|
+
d(O(se), { class: "w-12 h-12 text-green-500 mx-auto mb-4" }),
|
|
735
735
|
s("h3", {
|
|
736
736
|
id: i,
|
|
737
737
|
class: "mb-2 text-lg font-medium text-gray-900"
|
|
738
|
-
},
|
|
739
|
-
t.description ? (
|
|
740
|
-
|
|
741
|
-
s("div",
|
|
742
|
-
color:
|
|
738
|
+
}, D(t.title), 1),
|
|
739
|
+
t.description ? (b(), o("p", it, D(t.description), 1)) : a("", !0),
|
|
740
|
+
w(n.$slots, "default"),
|
|
741
|
+
s("div", at, [d(U, {
|
|
742
|
+
color: O(V).BLUE,
|
|
743
743
|
onClick: r[3] ||= (e) => n.$emit("closeModal"),
|
|
744
744
|
description: "OK"
|
|
745
745
|
}, null, 8, ["color"])])
|
|
746
746
|
]))])], 64));
|
|
747
747
|
}
|
|
748
|
-
}),
|
|
748
|
+
}), st = /* @__PURE__ */ f({
|
|
749
749
|
__name: "BaseRow",
|
|
750
750
|
props: { bgColor: {
|
|
751
751
|
type: String,
|
|
@@ -757,9 +757,9 @@ var ke = { class: "min-w-0 flex-1" }, Ae = {
|
|
|
757
757
|
function n() {
|
|
758
758
|
return "block p-8 border border-gray-200 rounded-xl shadow-sm dark:bg-gray-800 dark:border-gray-700 " + t.bgColor;
|
|
759
759
|
}
|
|
760
|
-
return (e, t) => (
|
|
760
|
+
return (e, t) => (b(), o("div", { class: h(n()) }, [w(e.$slots, "default")], 2));
|
|
761
761
|
}
|
|
762
|
-
}),
|
|
762
|
+
}), ct = /* @__PURE__ */ f({
|
|
763
763
|
__name: "BaseSpinner",
|
|
764
764
|
props: {
|
|
765
765
|
size: { default: "sm" },
|
|
@@ -781,8 +781,8 @@ var ke = { class: "min-w-0 flex-1" }, Ae = {
|
|
|
781
781
|
red: "border-t-red-500",
|
|
782
782
|
amber: "border-t-amber-500"
|
|
783
783
|
})[t.color]);
|
|
784
|
-
return (e, t) => (
|
|
785
|
-
class:
|
|
784
|
+
return (e, t) => (b(), o("div", {
|
|
785
|
+
class: h(["border-gray-200 rounded-full animate-spin", [n.value, i.value]]),
|
|
786
786
|
role: "status",
|
|
787
787
|
"aria-label": "Loading"
|
|
788
788
|
}, null, 2));
|
|
@@ -791,7 +791,7 @@ var ke = { class: "min-w-0 flex-1" }, Ae = {
|
|
|
791
791
|
return e.SUCCESS = "SUCCESS", e.WARNING = "WARNING", e.ERROR = "ERROR", e;
|
|
792
792
|
}({}), q = /* @__PURE__ */ function(e) {
|
|
793
793
|
return e.TOP_LEFT = "TOP_LEFT", e.TOP_RIGHT = "TOP_RIGHT", e.BOTTOM_LEFT = "BOTTOM_LEFT", e.BOTTOM_RIGHT = "BOTTOM_RIGHT", e;
|
|
794
|
-
}({}),
|
|
794
|
+
}({}), lt = { class: "flex items-center w-full max-w-md p-4 mb-4 text-gray-500 bg-white rounded-lg shadow dark:text-gray-400 dark:bg-gray-800" }, ut = { class: "ml-3 text-sm font-normal" }, dt = /* @__PURE__ */ f({
|
|
795
795
|
__name: "BaseToast",
|
|
796
796
|
props: {
|
|
797
797
|
mode: {
|
|
@@ -819,13 +819,13 @@ var ke = { class: "min-w-0 flex-1" }, Ae = {
|
|
|
819
819
|
}
|
|
820
820
|
},
|
|
821
821
|
setup(e) {
|
|
822
|
-
let t = e, n =
|
|
822
|
+
let t = e, n = S(!0), r = null;
|
|
823
823
|
function i() {
|
|
824
824
|
n.value = !1, r &&= (clearTimeout(r), null);
|
|
825
825
|
}
|
|
826
|
-
|
|
826
|
+
_(() => {
|
|
827
827
|
r = setTimeout(() => n.value = !1, t.duration);
|
|
828
|
-
}),
|
|
828
|
+
}), y(() => {
|
|
829
829
|
r && clearTimeout(r);
|
|
830
830
|
});
|
|
831
831
|
function c() {
|
|
@@ -864,33 +864,33 @@ var ke = { class: "min-w-0 flex-1" }, Ae = {
|
|
|
864
864
|
}
|
|
865
865
|
return "fixed flex items-center w-full max-w-md p-4 space-x-4 divide-x rounded-lg " + e;
|
|
866
866
|
}
|
|
867
|
-
return (t, r) => n.value ? (
|
|
867
|
+
return (t, r) => n.value ? (b(), o("div", {
|
|
868
868
|
key: 0,
|
|
869
869
|
id: "toast-top-right",
|
|
870
|
-
class:
|
|
870
|
+
class: h(l()),
|
|
871
871
|
role: "alert"
|
|
872
|
-
}, [s("div",
|
|
873
|
-
e.mode ==
|
|
872
|
+
}, [s("div", lt, [
|
|
873
|
+
e.mode == O(K).ERROR ? (b(), o("div", {
|
|
874
874
|
key: 0,
|
|
875
|
-
class:
|
|
876
|
-
}, [
|
|
875
|
+
class: h(c())
|
|
876
|
+
}, [d(O(he), { class: "h-6 w-6 text-red-500" }), r[0] ||= s("span", { class: "sr-only" }, "Error icon", -1)], 2)) : e.mode == O(K).SUCCESS ? (b(), o("div", {
|
|
877
877
|
key: 1,
|
|
878
|
-
class:
|
|
879
|
-
}, [
|
|
878
|
+
class: h(c())
|
|
879
|
+
}, [d(O(se), { class: "h-6 w-6 text-green-500" }), r[1] ||= s("span", { class: "sr-only" }, "Check icon", -1)], 2)) : e.mode == O(K).WARNING ? (b(), o("div", {
|
|
880
880
|
key: 2,
|
|
881
|
-
class:
|
|
882
|
-
}, [
|
|
883
|
-
s("div",
|
|
884
|
-
e.hasCloseIcon ? (
|
|
881
|
+
class: h(c())
|
|
882
|
+
}, [d(O(ge), { class: "h-6 w-6 text-yellow-500" }), r[2] ||= s("span", { class: "sr-only" }, "Warning icon", -1)], 2)) : a("", !0),
|
|
883
|
+
s("div", ut, D(e.description), 1),
|
|
884
|
+
e.hasCloseIcon ? (b(), o("button", {
|
|
885
885
|
key: 3,
|
|
886
886
|
type: "button",
|
|
887
887
|
class: "ml-auto -mx-1.5 -my-1.5 bg-white text-gray-400 hover:text-gray-900 rounded-lg focus:ring-2 focus:ring-gray-300 p-1.5 hover:bg-gray-100 inline-flex items-center justify-center h-8 w-8 dark:text-gray-500 dark:hover:text-white dark:bg-gray-800 dark:hover:bg-gray-700 cursor-pointer",
|
|
888
888
|
"aria-label": "Close",
|
|
889
889
|
onClick: i
|
|
890
|
-
}, [r[3] ||= s("span", { class: "sr-only" }, "Close", -1),
|
|
890
|
+
}, [r[3] ||= s("span", { class: "sr-only" }, "Close", -1), d(O(Ce), { class: "h-6 w-6 text-gray-500" })])) : a("", !0)
|
|
891
891
|
])], 2)) : a("", !0);
|
|
892
892
|
}
|
|
893
|
-
}),
|
|
893
|
+
}), ft = { class: "w-13" }, pt = /* @__PURE__ */ f({
|
|
894
894
|
__name: "ColoredSquares",
|
|
895
895
|
props: { color: {
|
|
896
896
|
type: String,
|
|
@@ -907,7 +907,7 @@ var ke = { class: "min-w-0 flex-1" }, Ae = {
|
|
|
907
907
|
"bg-yellow-300",
|
|
908
908
|
"bg-purple-300",
|
|
909
909
|
"bg-pink-300"
|
|
910
|
-
], r =
|
|
910
|
+
], r = S(n[Math.floor(Math.random() * n.length)]);
|
|
911
911
|
function i() {
|
|
912
912
|
let e = "gray";
|
|
913
913
|
switch (t.color) {
|
|
@@ -927,9 +927,9 @@ var ke = { class: "min-w-0 flex-1" }, Ae = {
|
|
|
927
927
|
}
|
|
928
928
|
return "font-bold text-xs mr-2 px-2.5 py-0.5 rounded-full bg-" + e + "-100 text-" + e + "-800";
|
|
929
929
|
}
|
|
930
|
-
return (e, t) => (
|
|
930
|
+
return (e, t) => (b(), o("div", ft, [s("div", { class: h(["border border-gray-300 relative aspect-square rounded-lg bg-white shadow-sm overflow-hidden flex items-center justify-center text-center", i()]) }, [w(e.$slots, "default"), s("div", { class: h(["absolute bottom-0 left-0 h-1 w-full", r.value]) }, null, 2)], 2)]));
|
|
931
931
|
}
|
|
932
|
-
}),
|
|
932
|
+
}), mt = { class: "flex items-start justify-between" }, ht = { class: "min-w-0" }, gt = /* @__PURE__ */ f({
|
|
933
933
|
__name: "EarningsCard",
|
|
934
934
|
props: {
|
|
935
935
|
title: { default: "TOTAL EARNINGS" },
|
|
@@ -981,27 +981,27 @@ var ke = { class: "min-w-0 flex-1" }, Ae = {
|
|
|
981
981
|
minimumFractionDigits: n.decimals,
|
|
982
982
|
maximumFractionDigits: n.decimals
|
|
983
983
|
}));
|
|
984
|
-
return (n, r) => (
|
|
984
|
+
return (n, r) => (b(), o("div", { class: h(["relative rounded-xl border-2 border-dashed bg-white dark:bg-slate-800", [d.value.border, t.compact ? "p-3" : "p-6"]]) }, [t.badge ? (b(), o("div", {
|
|
985
985
|
key: 0,
|
|
986
|
-
class:
|
|
987
|
-
},
|
|
988
|
-
s("p", { class:
|
|
989
|
-
s("p", { class:
|
|
990
|
-
s("p", { class:
|
|
991
|
-
]), s("div", { class:
|
|
992
|
-
class:
|
|
986
|
+
class: h(["absolute right-4 top-4 rounded-md px-3 py-1 text-xs font-bold tracking-wide", d.value.badge])
|
|
987
|
+
}, D(t.badge), 3)) : a("", !0), s("div", mt, [s("div", ht, [
|
|
988
|
+
s("p", { class: h(["font-bold tracking-wide text-gray-800 dark:text-slate-200", t.compact ? "pr-8 text-xs" : "text-sm"]) }, D(t.title), 3),
|
|
989
|
+
s("p", { class: h(["mt-1 font-bold truncate", [d.value.amount, t.compact ? "text-lg" : "text-4xl"]]) }, D(f.value), 3),
|
|
990
|
+
s("p", { class: h(["mt-1 font-medium", [d.value.subtitle, t.compact ? "text-xs" : "text-sm"]]) }, D(t.subtitle), 3)
|
|
991
|
+
]), s("div", { class: h(["flex items-center justify-center", [d.value.iconBox, t.compact ? "absolute right-2 top-2 h-6 w-6 rounded-lg" : "mt-6 h-12 w-12 rounded-xl"]]) }, [(b(), o("svg", {
|
|
992
|
+
class: h([d.value.icon, t.compact ? "h-3.5 w-3.5" : "h-6 w-6"]),
|
|
993
993
|
viewBox: "0 0 24 24",
|
|
994
994
|
fill: "none",
|
|
995
995
|
stroke: "currentColor",
|
|
996
996
|
"stroke-width": "2.5",
|
|
997
997
|
"stroke-linecap": "round",
|
|
998
998
|
"stroke-linejoin": "round"
|
|
999
|
-
}, [l.value ? (
|
|
999
|
+
}, [l.value ? (b(), o(e, { key: 0 }, [r[0] ||= s("polyline", { points: "22 17 13.5 8.5 8.5 13.5 2 7" }, null, -1), r[1] ||= s("polyline", { points: "16 17 22 17 22 11" }, null, -1)], 64)) : (b(), o(e, { key: 1 }, [r[2] ||= s("polyline", { points: "22 7 13.5 15.5 8.5 10.5 2 17" }, null, -1), r[3] ||= s("polyline", { points: "16 7 22 7 22 13" }, null, -1)], 64))], 2))], 2)])], 2));
|
|
1000
1000
|
}
|
|
1001
|
-
}),
|
|
1001
|
+
}), _t = {
|
|
1002
1002
|
key: 0,
|
|
1003
1003
|
class: "font-bold text-green-800 dark:text-green-400"
|
|
1004
|
-
},
|
|
1004
|
+
}, vt = { key: 0 }, yt = { key: 0 }, bt = "font-bold", xt = /* @__PURE__ */ f({
|
|
1005
1005
|
__name: "EuroAmount",
|
|
1006
1006
|
props: {
|
|
1007
1007
|
amount: {
|
|
@@ -1020,21 +1020,21 @@ var ke = { class: "min-w-0 flex-1" }, Ae = {
|
|
|
1020
1020
|
}
|
|
1021
1021
|
},
|
|
1022
1022
|
setup(t) {
|
|
1023
|
-
let n = t, i = r(() => n.amount !== null && n.amount !== void 0), s = r(() => i.value && n.amount < 0), c = r(() => n.beforeAmount === null || n.beforeAmount === void 0 ? !1 : n.amount < n.beforeAmount),
|
|
1024
|
-
return (n, r) => (
|
|
1023
|
+
let n = t, i = r(() => n.amount !== null && n.amount !== void 0), s = r(() => i.value && n.amount < 0), c = r(() => n.beforeAmount === null || n.beforeAmount === void 0 ? !1 : n.amount < n.beforeAmount), l = r(() => s.value || c.value), d = r(() => !s.value && !c.value && !(n.beforeAmount === null || n.beforeAmount === void 0));
|
|
1024
|
+
return (n, r) => (b(), o(e, null, [i.value && d.value ? (b(), o("span", _t, [u(D(t.amount) + " ", 1), t.showCurrency ? (b(), o("span", vt, "€")) : a("", !0)])) : a("", !0), i.value && !d.value ? (b(), o("span", {
|
|
1025
1025
|
key: 1,
|
|
1026
|
-
class:
|
|
1027
|
-
}, [
|
|
1026
|
+
class: h([bt, l.value ? "text-red-800 dark:text-red-400" : "text-gray-800 dark:text-gray-200"])
|
|
1027
|
+
}, [u(D(t.amount) + " ", 1), t.showCurrency ? (b(), o("span", yt, "€")) : a("", !0)], 2)) : a("", !0)], 64));
|
|
1028
1028
|
}
|
|
1029
|
-
}),
|
|
1029
|
+
}), St = { "aria-label": "Pagination" }, Ct = { class: "flex list-none p-0 m-0" }, wt = [
|
|
1030
1030
|
"aria-current",
|
|
1031
1031
|
"aria-label",
|
|
1032
1032
|
"onClick"
|
|
1033
|
-
],
|
|
1033
|
+
], Tt = {
|
|
1034
1034
|
key: 1,
|
|
1035
1035
|
"aria-hidden": "true",
|
|
1036
1036
|
class: "inline-block border border-gray-300 dark:border-gray-600 rounded-lg p-3 text-black dark:text-gray-200 cursor-not-allowed"
|
|
1037
|
-
},
|
|
1037
|
+
}, Et = /* @__PURE__ */ f({
|
|
1038
1038
|
__name: "Pagination",
|
|
1039
1039
|
props: {
|
|
1040
1040
|
totalItems: {
|
|
@@ -1048,7 +1048,7 @@ var ke = { class: "min-w-0 flex-1" }, Ae = {
|
|
|
1048
1048
|
},
|
|
1049
1049
|
emits: ["page-changed"],
|
|
1050
1050
|
setup(t, { emit: n }) {
|
|
1051
|
-
let r = t, i =
|
|
1051
|
+
let r = t, i = S(1), a = S(0), c = S([]), l = n;
|
|
1052
1052
|
function u(e) {
|
|
1053
1053
|
if (a.value <= 5) {
|
|
1054
1054
|
c.value = Array.from({ length: a.value }, (e, t) => t + 1);
|
|
@@ -1064,28 +1064,28 @@ var ke = { class: "min-w-0 flex-1" }, Ae = {
|
|
|
1064
1064
|
}
|
|
1065
1065
|
return M(() => [r.totalItems, r.itemsPerPage], () => {
|
|
1066
1066
|
a.value = Math.ceil(r.totalItems / r.itemsPerPage), i.value > a.value && (i.value = Math.max(1, a.value)), u(i.value);
|
|
1067
|
-
}, { immediate: !0 }), (t, n) => (
|
|
1067
|
+
}, { immediate: !0 }), (t, n) => (b(), o("nav", St, [s("ul", Ct, [(b(!0), o(e, null, C(c.value, (e, t) => (b(), o("li", {
|
|
1068
1068
|
key: t,
|
|
1069
1069
|
class: "mr-1"
|
|
1070
|
-
}, [e === 0 ? (
|
|
1070
|
+
}, [e === 0 ? (b(), o("span", Tt, "...")) : (b(), o("button", {
|
|
1071
1071
|
key: 0,
|
|
1072
1072
|
type: "button",
|
|
1073
1073
|
"aria-current": e === i.value ? "page" : void 0,
|
|
1074
1074
|
"aria-label": `Go to page ${e}`,
|
|
1075
1075
|
onClick: (t) => d(e),
|
|
1076
|
-
class:
|
|
1077
|
-
},
|
|
1076
|
+
class: h(["inline-block min-w-[44px] border border-gray-300 dark:border-gray-600 rounded-lg p-3 text-black dark:text-gray-200 cursor-pointer transition-colors hover:bg-gray-300 dark:hover:bg-gray-700 focus:outline-none focus-visible:ring-2 focus-visible:ring-emerald-500", { "active font-bold bg-gray-200 dark:bg-gray-700": e === i.value }])
|
|
1077
|
+
}, D(e), 11, wt))]))), 128))])]));
|
|
1078
1078
|
}
|
|
1079
|
-
}),
|
|
1079
|
+
}), Dt = { key: 0 }, Ot = {
|
|
1080
1080
|
key: 0,
|
|
1081
1081
|
class: "flex items-center space-x-2"
|
|
1082
|
-
},
|
|
1082
|
+
}, kt = {
|
|
1083
1083
|
key: 1,
|
|
1084
1084
|
class: "flex items-center space-x-2"
|
|
1085
|
-
},
|
|
1085
|
+
}, At = {
|
|
1086
1086
|
key: 2,
|
|
1087
1087
|
class: "flex items-center space-x-2"
|
|
1088
|
-
},
|
|
1088
|
+
}, jt = /* @__PURE__ */ f({
|
|
1089
1089
|
__name: "TrendArrow",
|
|
1090
1090
|
props: {
|
|
1091
1091
|
number: {
|
|
@@ -1099,16 +1099,16 @@ var ke = { class: "min-w-0 flex-1" }, Ae = {
|
|
|
1099
1099
|
},
|
|
1100
1100
|
setup(e) {
|
|
1101
1101
|
let t = e, n = r(() => t.number !== null && t.number !== void 0 && t.number < 0), i = r(() => t.number === 0);
|
|
1102
|
-
return (r, s) => e.number !== null && e.number !== void 0 ? (
|
|
1103
|
-
default: N(() => [
|
|
1102
|
+
return (r, s) => e.number !== null && e.number !== void 0 ? (b(), o("div", Dt, [n.value ? (b(), o("span", Ot, [d(Pe, { color: O(B).RED }, {
|
|
1103
|
+
default: N(() => [u(D(e.number) + D(t.icon), 1)]),
|
|
1104
1104
|
_: 1
|
|
1105
|
-
}, 8, ["color"]),
|
|
1106
|
-
default: N(() => [
|
|
1105
|
+
}, 8, ["color"]), d(O(re), { class: "h-5 w-5 text-red-500" })])) : i.value ? (b(), o("span", kt, [d(Pe, { color: O(B).GRAY }, {
|
|
1106
|
+
default: N(() => [u(D(e.number) + D(t.icon), 1)]),
|
|
1107
1107
|
_: 1
|
|
1108
|
-
}, 8, ["color"]),
|
|
1109
|
-
default: N(() => [
|
|
1108
|
+
}, 8, ["color"]), d(O(be), { class: "h-5 w-5 text-gray-400" })])) : (b(), o("span", At, [d(Pe, { color: O(B).GREEN }, {
|
|
1109
|
+
default: N(() => [u(D(e.number) + D(t.icon), 1)]),
|
|
1110
1110
|
_: 1
|
|
1111
|
-
}, 8, ["color"]),
|
|
1111
|
+
}, 8, ["color"]), d(O(ie), { class: "h-5 w-5 text-green-500" })]))])) : a("", !0);
|
|
1112
1112
|
}
|
|
1113
1113
|
});
|
|
1114
1114
|
//#endregion
|
|
@@ -1141,18 +1141,21 @@ function J() {
|
|
|
1141
1141
|
}
|
|
1142
1142
|
//#endregion
|
|
1143
1143
|
//#region src/composables/useEscapeKey.ts
|
|
1144
|
-
function
|
|
1144
|
+
function Mt(e) {
|
|
1145
1145
|
function t(t) {
|
|
1146
1146
|
t.key === "Escape" && e();
|
|
1147
1147
|
}
|
|
1148
|
-
|
|
1148
|
+
_(() => document.addEventListener("keydown", t)), g(() => document.removeEventListener("keydown", t));
|
|
1149
1149
|
}
|
|
1150
1150
|
//#endregion
|
|
1151
1151
|
//#region src/components/BaseModalShell.vue?vue&type=script&setup=true&lang.ts
|
|
1152
|
-
var
|
|
1152
|
+
var Nt = { class: "flex items-start gap-4 min-w-0" }, Pt = { class: "flex-1 min-w-0" }, Ft = { class: "p-6 overflow-y-auto flex-1" }, It = { class: "p-6" }, Lt = { class: "flex items-start gap-4" }, Rt = { class: "flex-1" }, zt = { class: "mt-4" }, Bt = { class: "mt-6 flex gap-3 justify-end" }, Vt = /* @__PURE__ */ f({
|
|
1153
1153
|
__name: "BaseModalShell",
|
|
1154
1154
|
props: {
|
|
1155
1155
|
title: {},
|
|
1156
|
+
icon: {},
|
|
1157
|
+
iconBgClass: { default: "" },
|
|
1158
|
+
iconClass: { default: "text-emerald-600" },
|
|
1156
1159
|
maxWidthClass: { default: "max-w-md" },
|
|
1157
1160
|
manualClose: {
|
|
1158
1161
|
type: Boolean,
|
|
@@ -1166,49 +1169,55 @@ var jt = { class: "flex items-start gap-4 min-w-0" }, Mt = { class: "flex-1 min-
|
|
|
1166
1169
|
},
|
|
1167
1170
|
emits: ["cancel", "backdrop"],
|
|
1168
1171
|
setup(e, { emit: n }) {
|
|
1169
|
-
let c = e, l = n, { isDark: u } = z(), d = J(), f = `modal-title-${Math.random().toString(36).slice(2, 9)}`, p = r(() => u.value ? "bg-gray-900 border border-gray-700" : "bg-white border border-gray-200");
|
|
1170
|
-
function
|
|
1172
|
+
let c = e, l = n, { isDark: u } = z(), d = J(), f = `modal-title-${Math.random().toString(36).slice(2, 9)}`, p = r(() => u.value ? "bg-gray-900 border border-gray-700" : "bg-white border border-gray-200"), m = r(() => c.iconBgClass || (u.value ? "bg-emerald-900/30" : "bg-emerald-50"));
|
|
1173
|
+
function g() {
|
|
1171
1174
|
l("backdrop"), c.manualClose || l("cancel");
|
|
1172
1175
|
}
|
|
1173
|
-
return
|
|
1176
|
+
return Mt(() => {
|
|
1174
1177
|
c.manualClose || l("cancel");
|
|
1175
|
-
}), (n, r) => (
|
|
1178
|
+
}), (n, r) => (b(), i(t, { to: "body" }, [s("div", {
|
|
1176
1179
|
class: "fixed inset-0 z-50 flex items-center justify-center bg-black/50",
|
|
1177
1180
|
role: "dialog",
|
|
1178
1181
|
"aria-modal": "true",
|
|
1179
1182
|
"aria-labelledby": f,
|
|
1180
|
-
onClick:
|
|
1181
|
-
}, [e.scrollable ? (
|
|
1183
|
+
onClick: g
|
|
1184
|
+
}, [e.scrollable ? (b(), o("div", {
|
|
1182
1185
|
key: 0,
|
|
1183
|
-
class:
|
|
1186
|
+
class: h(["relative w-full mx-4 rounded-lg shadow-xl max-h-[90vh] flex flex-col", [e.maxWidthClass, p.value]]),
|
|
1184
1187
|
onClick: r[0] ||= F(() => {}, ["stop"])
|
|
1185
1188
|
}, [
|
|
1186
|
-
s("div", { class:
|
|
1189
|
+
s("div", { class: h(["flex items-start justify-between gap-4 p-6 border-b shrink-0", O(d).border]) }, [s("div", Nt, [w(n.$slots, "icon", {}, () => [s("div", { class: h(["flex-shrink-0 flex h-12 w-12 items-center justify-center rounded-full", m.value]) }, [(b(), i(E(e.icon), {
|
|
1190
|
+
class: h(["h-6 w-6", e.iconClass]),
|
|
1191
|
+
"aria-hidden": "true"
|
|
1192
|
+
}, null, 8, ["class"]))], 2)]), s("div", Pt, [s("h3", {
|
|
1187
1193
|
id: f,
|
|
1188
|
-
class:
|
|
1189
|
-
},
|
|
1194
|
+
class: h(["text-lg font-medium", O(d).primaryText])
|
|
1195
|
+
}, D(e.title), 3), e.subtitle ? (b(), o("p", {
|
|
1190
1196
|
key: 0,
|
|
1191
|
-
class:
|
|
1192
|
-
},
|
|
1193
|
-
s("div",
|
|
1194
|
-
n.$slots.footer ? (
|
|
1197
|
+
class: h(["text-sm mt-1 break-all", O(d).mutedText])
|
|
1198
|
+
}, D(e.subtitle), 3)) : a("", !0)])]), w(n.$slots, "header-actions")], 2),
|
|
1199
|
+
s("div", Ft, [w(n.$slots, "default")]),
|
|
1200
|
+
n.$slots.footer ? (b(), o("div", {
|
|
1195
1201
|
key: 0,
|
|
1196
|
-
class:
|
|
1197
|
-
}, [
|
|
1198
|
-
], 2)) : (
|
|
1202
|
+
class: h(["flex gap-3 justify-end p-6 border-t shrink-0", O(d).border])
|
|
1203
|
+
}, [w(n.$slots, "footer")], 2)) : a("", !0)
|
|
1204
|
+
], 2)) : (b(), o("div", {
|
|
1199
1205
|
key: 1,
|
|
1200
|
-
class:
|
|
1206
|
+
class: h(["relative w-full mx-4 rounded-lg shadow-xl", [e.maxWidthClass, p.value]]),
|
|
1201
1207
|
onClick: r[1] ||= F(() => {}, ["stop"])
|
|
1202
|
-
}, [s("div",
|
|
1203
|
-
s("div",
|
|
1208
|
+
}, [s("div", It, [
|
|
1209
|
+
s("div", Lt, [w(n.$slots, "icon", {}, () => [s("div", { class: h(["flex-shrink-0 flex h-12 w-12 items-center justify-center rounded-full", m.value]) }, [(b(), i(E(e.icon), {
|
|
1210
|
+
class: h(["h-6 w-6", e.iconClass]),
|
|
1211
|
+
"aria-hidden": "true"
|
|
1212
|
+
}, null, 8, ["class"]))], 2)]), s("div", Rt, [s("h3", {
|
|
1204
1213
|
id: f,
|
|
1205
|
-
class:
|
|
1206
|
-
},
|
|
1207
|
-
s("div",
|
|
1208
|
-
s("div",
|
|
1214
|
+
class: h(["text-lg font-medium", O(d).primaryText])
|
|
1215
|
+
}, D(e.title), 3)])]),
|
|
1216
|
+
s("div", zt, [w(n.$slots, "default")]),
|
|
1217
|
+
s("div", Bt, [w(n.$slots, "footer")])
|
|
1209
1218
|
])], 2))])]));
|
|
1210
1219
|
}
|
|
1211
|
-
}),
|
|
1220
|
+
}), Ht = ["aria-expanded"], Ut = { class: "flex items-center gap-3" }, Wt = /* @__PURE__ */ f({
|
|
1212
1221
|
__name: "BaseCollapsibleSection",
|
|
1213
1222
|
props: {
|
|
1214
1223
|
title: {},
|
|
@@ -1219,16 +1228,16 @@ var jt = { class: "flex items-start gap-4 min-w-0" }, Mt = { class: "flex-1 min-
|
|
|
1219
1228
|
emits: ["toggle"],
|
|
1220
1229
|
setup(e, { emit: t }) {
|
|
1221
1230
|
let n = e, i = t, { isDark: c } = z(), l = J(), u = r(() => c.value ? "text-gray-100" : "text-gray-700"), d = r(() => c.value ? "bg-gray-800/50 hover:bg-gray-800 border-gray-700" : "bg-gray-50 hover:bg-gray-100 border-gray-200"), f = r(() => c.value ? "bg-emerald-500/15 text-emerald-400" : "bg-emerald-50 text-emerald-700"), p = r(() => n.bodyClass === void 0 ? c.value ? "bg-gray-800" : "bg-white" : n.bodyClass);
|
|
1222
|
-
return (t, n) => (
|
|
1231
|
+
return (t, n) => (b(), o("section", { class: h(["rounded-xl border transition-colors", O(l).cardAlt]) }, [s("button", {
|
|
1223
1232
|
type: "button",
|
|
1224
|
-
class:
|
|
1233
|
+
class: h(["w-full flex items-center justify-between p-4 text-left transition-colors cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-emerald-500", [d.value, e.collapsed ? "rounded-xl" : "rounded-t-xl"]]),
|
|
1225
1234
|
"aria-expanded": !e.collapsed,
|
|
1226
1235
|
onClick: n[0] ||= (e) => i("toggle")
|
|
1227
|
-
}, [s("div",
|
|
1236
|
+
}, [s("div", Ut, [s("h2", { class: h(["text-base font-semibold", u.value]) }, D(e.title), 3), e.badge ? (b(), o("span", {
|
|
1228
1237
|
key: 0,
|
|
1229
|
-
class:
|
|
1230
|
-
},
|
|
1231
|
-
class:
|
|
1238
|
+
class: h(["text-xs px-2 py-0.5 rounded-full", f.value])
|
|
1239
|
+
}, D(e.badge), 3)) : a("", !0)]), (b(), o("svg", {
|
|
1240
|
+
class: h(["w-5 h-5 transition-transform", [e.collapsed ? "" : "rotate-180", O(l).dimTextAlt]]),
|
|
1232
1241
|
fill: "none",
|
|
1233
1242
|
viewBox: "0 0 24 24",
|
|
1234
1243
|
stroke: "currentColor",
|
|
@@ -1238,15 +1247,15 @@ var jt = { class: "flex items-start gap-4 min-w-0" }, Mt = { class: "flex-1 min-
|
|
|
1238
1247
|
"stroke-linecap": "round",
|
|
1239
1248
|
"stroke-linejoin": "round",
|
|
1240
1249
|
d: "M19 9l-7 7-7-7"
|
|
1241
|
-
}, null, -1)]], 2))], 10,
|
|
1250
|
+
}, null, -1)]], 2))], 10, Ht), P(s("div", { class: h(["p-6 border-t rounded-b-xl", [O(l).border, p.value]]) }, [w(t.$slots, "default")], 2), [[te, !e.collapsed]])], 2));
|
|
1242
1251
|
}
|
|
1243
|
-
}),
|
|
1252
|
+
}), Gt = ["disabled"], Kt = ["disabled"], qt = {
|
|
1244
1253
|
key: 0,
|
|
1245
1254
|
class: "w-4 h-4 animate-spin",
|
|
1246
1255
|
fill: "none",
|
|
1247
1256
|
viewBox: "0 0 24 24",
|
|
1248
1257
|
"aria-hidden": "true"
|
|
1249
|
-
},
|
|
1258
|
+
}, Jt = /* @__PURE__ */ f({
|
|
1250
1259
|
__name: "BaseConfirmModal",
|
|
1251
1260
|
props: {
|
|
1252
1261
|
title: {},
|
|
@@ -1262,33 +1271,32 @@ var jt = { class: "flex items-start gap-4 min-w-0" }, Mt = { class: "flex-1 min-
|
|
|
1262
1271
|
},
|
|
1263
1272
|
emits: ["confirm", "cancel"],
|
|
1264
1273
|
setup(e, { emit: t }) {
|
|
1265
|
-
let n = e, r = t, { isDark: c } = z(),
|
|
1266
|
-
function
|
|
1274
|
+
let n = e, r = t, { isDark: c } = z(), l = J();
|
|
1275
|
+
function d() {
|
|
1267
1276
|
n.submitting || r("confirm");
|
|
1268
1277
|
}
|
|
1269
|
-
function
|
|
1278
|
+
function f() {
|
|
1270
1279
|
n.submitting || r("cancel");
|
|
1271
1280
|
}
|
|
1272
|
-
return (t, n) => (
|
|
1281
|
+
return (t, n) => (b(), i(Vt, {
|
|
1273
1282
|
title: e.title,
|
|
1283
|
+
icon: O(ge),
|
|
1284
|
+
"icon-bg-class": e.variant === "danger" ? O(c) ? "bg-red-900/30" : "bg-red-50" : O(c) ? "bg-amber-900/30" : "bg-amber-50",
|
|
1285
|
+
"icon-class": e.variant === "danger" ? "text-red-600" : "text-amber-600",
|
|
1274
1286
|
"manual-close": e.submitting,
|
|
1275
|
-
onCancel:
|
|
1287
|
+
onCancel: f
|
|
1276
1288
|
}, {
|
|
1277
|
-
icon: N(() => [s("div", { class: m(["flex-shrink-0 flex h-12 w-12 items-center justify-center rounded-full", [e.variant === "danger" ? D(c) ? "bg-red-900/30" : "bg-red-50" : D(c) ? "bg-amber-900/30" : "bg-amber-50"]]) }, [u(D(he), {
|
|
1278
|
-
class: m(["h-6 w-6", e.variant === "danger" ? "text-red-600" : "text-amber-600"]),
|
|
1279
|
-
"aria-hidden": "true"
|
|
1280
|
-
}, null, 8, ["class"])], 2)]),
|
|
1281
1289
|
footer: N(() => [s("button", {
|
|
1282
1290
|
type: "button",
|
|
1283
1291
|
disabled: e.submitting,
|
|
1284
|
-
class:
|
|
1285
|
-
onClick:
|
|
1286
|
-
},
|
|
1292
|
+
class: h(["inline-flex items-center justify-center px-4 py-2 border rounded-md shadow-sm text-sm font-medium transition-colors duration-150 focus:outline-none focus-visible:ring-2 focus-visible:ring-emerald-500", [O(l).ghostButton, e.submitting ? "opacity-60 cursor-not-allowed" : "cursor-pointer"]]),
|
|
1293
|
+
onClick: f
|
|
1294
|
+
}, D(e.cancelText), 11, Gt), s("button", {
|
|
1287
1295
|
type: "button",
|
|
1288
1296
|
disabled: e.submitting,
|
|
1289
|
-
class:
|
|
1290
|
-
onClick:
|
|
1291
|
-
}, [e.submitting ? (
|
|
1297
|
+
class: h(["inline-flex items-center justify-center gap-2 px-4 py-2 border border-transparent rounded-md shadow-sm text-sm font-medium text-white transition-colors duration-150 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2", [e.variant === "danger" ? "focus-visible:ring-red-500" : "focus-visible:ring-emerald-500", e.variant === "danger" ? e.submitting ? "bg-red-400 cursor-not-allowed" : "bg-red-600 hover:bg-red-700 cursor-pointer" : e.submitting ? "bg-emerald-400 cursor-not-allowed" : "bg-emerald-600 hover:bg-emerald-700 cursor-pointer"]]),
|
|
1298
|
+
onClick: d
|
|
1299
|
+
}, [e.submitting ? (b(), o("svg", qt, [...n[0] ||= [s("circle", {
|
|
1292
1300
|
class: "opacity-25",
|
|
1293
1301
|
cx: "12",
|
|
1294
1302
|
cy: "12",
|
|
@@ -1299,12 +1307,18 @@ var jt = { class: "flex items-start gap-4 min-w-0" }, Mt = { class: "flex-1 min-
|
|
|
1299
1307
|
class: "opacity-75",
|
|
1300
1308
|
fill: "currentColor",
|
|
1301
1309
|
d: "M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"
|
|
1302
|
-
}, null, -1)]])) : a("", !0),
|
|
1303
|
-
default: N(() => [
|
|
1310
|
+
}, null, -1)]])) : a("", !0), u(" " + D(e.submitting ? e.submittingText : e.confirmText), 1)], 10, Kt)]),
|
|
1311
|
+
default: N(() => [w(t.$slots, "message", {}, () => [s("p", { class: h(["text-sm", O(c) ? "text-gray-300" : "text-gray-600"]) }, D(e.message), 3)]), w(t.$slots, "default")]),
|
|
1304
1312
|
_: 3
|
|
1305
|
-
}, 8, [
|
|
1313
|
+
}, 8, [
|
|
1314
|
+
"title",
|
|
1315
|
+
"icon",
|
|
1316
|
+
"icon-bg-class",
|
|
1317
|
+
"icon-class",
|
|
1318
|
+
"manual-close"
|
|
1319
|
+
]));
|
|
1306
1320
|
}
|
|
1307
|
-
}),
|
|
1321
|
+
}), Yt = { class: "mt-4" }, Xt = ["placeholder"], Zt = ["disabled"], Qt = /* @__PURE__ */ f({
|
|
1308
1322
|
__name: "BaseTextInputModal",
|
|
1309
1323
|
props: {
|
|
1310
1324
|
title: {},
|
|
@@ -1322,51 +1336,52 @@ var jt = { class: "flex items-start gap-4 min-w-0" }, Mt = { class: "flex-1 min-
|
|
|
1322
1336
|
},
|
|
1323
1337
|
emits: ["confirm", "cancel"],
|
|
1324
1338
|
setup(e, { emit: t }) {
|
|
1325
|
-
let n = e, r = t, { isDark: a } = z(), o = J(),
|
|
1326
|
-
|
|
1327
|
-
await
|
|
1339
|
+
let n = e, r = t, { isDark: a } = z(), o = J(), l = S(n.initialValue), u = S(null);
|
|
1340
|
+
_(async () => {
|
|
1341
|
+
await m(), u.value?.focus();
|
|
1328
1342
|
});
|
|
1329
1343
|
function d() {
|
|
1330
|
-
!
|
|
1344
|
+
!l.value.trim() || n.submitting || r("confirm", l.value.trim());
|
|
1331
1345
|
}
|
|
1332
1346
|
function f() {
|
|
1333
1347
|
r("cancel");
|
|
1334
1348
|
}
|
|
1335
|
-
function
|
|
1336
|
-
|
|
1349
|
+
function p() {
|
|
1350
|
+
l.value.trim() === (n.initialValue ?? "").trim() && f();
|
|
1337
1351
|
}
|
|
1338
|
-
return
|
|
1352
|
+
return Mt(f), (t, n) => (b(), i(Vt, {
|
|
1339
1353
|
title: e.title,
|
|
1354
|
+
icon: O(me),
|
|
1340
1355
|
"manual-close": "",
|
|
1341
|
-
onBackdrop:
|
|
1342
|
-
}, {
|
|
1343
|
-
icon: N(() => [C(t.$slots, "icon", {}, () => [s("div", { class: m(["flex-shrink-0 flex h-12 w-12 items-center justify-center rounded-full", D(a) ? "bg-emerald-900/30" : "bg-emerald-50"]) }, [u(D(pe), {
|
|
1344
|
-
class: "h-6 w-6 text-emerald-600",
|
|
1345
|
-
"aria-hidden": "true"
|
|
1346
|
-
})], 2)])]),
|
|
1356
|
+
onBackdrop: p
|
|
1357
|
+
}, c({
|
|
1347
1358
|
footer: N(() => [s("button", {
|
|
1348
1359
|
type: "button",
|
|
1349
|
-
class:
|
|
1360
|
+
class: h(["inline-flex items-center justify-center px-4 py-2 border rounded-md shadow-sm text-sm font-medium transition-colors duration-150 cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-emerald-500", O(o).ghostButton]),
|
|
1350
1361
|
onClick: f
|
|
1351
|
-
},
|
|
1362
|
+
}, D(e.cancelText), 3), s("button", {
|
|
1352
1363
|
type: "button",
|
|
1353
|
-
disabled: !
|
|
1354
|
-
class:
|
|
1364
|
+
disabled: !l.value.trim() || e.submitting,
|
|
1365
|
+
class: h(["inline-flex items-center justify-center px-4 py-2 border border-transparent rounded-md shadow-sm text-sm font-medium text-white transition-colors duration-150 focus:outline-none focus-visible:ring-2 focus-visible:ring-emerald-500 focus-visible:ring-offset-2", [!l.value.trim() || e.submitting ? "bg-emerald-400 cursor-not-allowed" : "bg-emerald-600 hover:bg-emerald-700 cursor-pointer"]]),
|
|
1355
1366
|
onClick: d
|
|
1356
|
-
},
|
|
1357
|
-
default: N(() => [s("p", { class:
|
|
1367
|
+
}, D(e.submitting ? e.submittingText : e.confirmText), 11, Zt)]),
|
|
1368
|
+
default: N(() => [s("p", { class: h(["text-sm", O(a) ? "text-gray-300" : "text-gray-600"]) }, D(e.message), 3), s("div", Yt, [s("label", { class: h(["block text-sm font-medium mb-1", O(o).label]) }, D(e.inputLabel), 3), P(s("input", {
|
|
1358
1369
|
ref_key: "nameInput",
|
|
1359
|
-
ref:
|
|
1360
|
-
"onUpdate:modelValue": n[0] ||= (e) =>
|
|
1370
|
+
ref: u,
|
|
1371
|
+
"onUpdate:modelValue": n[0] ||= (e) => l.value = e,
|
|
1361
1372
|
type: "text",
|
|
1362
1373
|
placeholder: e.placeholder,
|
|
1363
|
-
class:
|
|
1364
|
-
onKeyup:
|
|
1365
|
-
}, null, 42,
|
|
1366
|
-
_:
|
|
1367
|
-
},
|
|
1368
|
-
|
|
1369
|
-
|
|
1374
|
+
class: h(["w-full px-3 py-2 rounded-md border text-sm transition-colors", O(a) ? "bg-gray-800 border-gray-600 text-gray-100 placeholder-gray-500 focus:outline-none focus:border-emerald-500" : "bg-white border-gray-300 text-gray-900 placeholder-gray-400 focus:outline-none focus:border-emerald-500"]),
|
|
1375
|
+
onKeyup: ne(d, ["enter"])
|
|
1376
|
+
}, null, 42, Xt), [[j, l.value]])])]),
|
|
1377
|
+
_: 2
|
|
1378
|
+
}, [t.$slots.icon ? {
|
|
1379
|
+
name: "icon",
|
|
1380
|
+
fn: N(() => [w(t.$slots, "icon")]),
|
|
1381
|
+
key: "0"
|
|
1382
|
+
} : void 0]), 1032, ["title", "icon"]));
|
|
1383
|
+
}
|
|
1384
|
+
}), $t = { class: "flex items-center justify-center min-h-[60vh]" }, en = { class: "text-center px-6" }, tn = /* @__PURE__ */ f({
|
|
1370
1385
|
__name: "BaseNotFoundPage",
|
|
1371
1386
|
props: {
|
|
1372
1387
|
code: { default: "404" },
|
|
@@ -1375,33 +1390,33 @@ var jt = { class: "flex items-start gap-4 min-w-0" }, Mt = { class: "flex-1 min-
|
|
|
1375
1390
|
homeLabel: { default: "Go home" }
|
|
1376
1391
|
},
|
|
1377
1392
|
setup(e) {
|
|
1378
|
-
let t = e, n =
|
|
1393
|
+
let t = e, n = Ee(), { isDark: r } = z(), i = J();
|
|
1379
1394
|
function a() {
|
|
1380
1395
|
n.push({ name: t.homeRouteName });
|
|
1381
1396
|
}
|
|
1382
|
-
return (t, n) => (
|
|
1383
|
-
|
|
1384
|
-
s("h1", { class:
|
|
1385
|
-
s("p", { class:
|
|
1397
|
+
return (t, n) => (b(), o("div", $t, [s("div", en, [
|
|
1398
|
+
d(O(ge), { class: h(["w-16 h-16 mx-auto mb-4", O(i).illustration]) }, null, 8, ["class"]),
|
|
1399
|
+
s("h1", { class: h(["text-4xl font-bold mb-2", O(r) ? "text-gray-200" : "text-gray-800"]) }, D(e.code), 3),
|
|
1400
|
+
s("p", { class: h(["text-lg mb-6", O(i).dimTextAlt]) }, D(e.message), 3),
|
|
1386
1401
|
s("button", {
|
|
1387
1402
|
onClick: a,
|
|
1388
|
-
class:
|
|
1389
|
-
},
|
|
1403
|
+
class: h(["inline-flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium text-white transition-colors cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-emerald-500 focus-visible:ring-offset-2", O(r) ? "bg-emerald-600 hover:bg-emerald-500" : "bg-emerald-600 hover:bg-emerald-700"])
|
|
1404
|
+
}, D(e.homeLabel), 3)
|
|
1390
1405
|
])]));
|
|
1391
1406
|
}
|
|
1392
|
-
}),
|
|
1393
|
-
function
|
|
1407
|
+
}), nn = S(!1);
|
|
1408
|
+
function rn() {
|
|
1394
1409
|
function e() {
|
|
1395
|
-
|
|
1410
|
+
nn.value = !0;
|
|
1396
1411
|
}
|
|
1397
1412
|
function t() {
|
|
1398
|
-
|
|
1413
|
+
nn.value = !1;
|
|
1399
1414
|
}
|
|
1400
1415
|
function n() {
|
|
1401
|
-
|
|
1416
|
+
nn.value = !nn.value;
|
|
1402
1417
|
}
|
|
1403
1418
|
return {
|
|
1404
|
-
mobileOpen:
|
|
1419
|
+
mobileOpen: nn,
|
|
1405
1420
|
open: e,
|
|
1406
1421
|
close: t,
|
|
1407
1422
|
toggle: n
|
|
@@ -1409,30 +1424,30 @@ function en() {
|
|
|
1409
1424
|
}
|
|
1410
1425
|
//#endregion
|
|
1411
1426
|
//#region src/composables/useSidebarCollapse.ts
|
|
1412
|
-
var
|
|
1413
|
-
function
|
|
1414
|
-
if (!
|
|
1415
|
-
let e = window.localStorage?.getItem(
|
|
1416
|
-
e && (
|
|
1417
|
-
M(
|
|
1418
|
-
window.localStorage?.setItem(
|
|
1427
|
+
var Y = S(!1), an = !1, on = "mgv-sidebar-collapsed";
|
|
1428
|
+
function sn(e) {
|
|
1429
|
+
if (!an && (an = !0, on = e, typeof window < "u")) {
|
|
1430
|
+
let e = window.localStorage?.getItem(on);
|
|
1431
|
+
e && (Y.value = e === "true"), p(!0).run(() => {
|
|
1432
|
+
M(Y, (e) => {
|
|
1433
|
+
window.localStorage?.setItem(on, String(e));
|
|
1419
1434
|
});
|
|
1420
1435
|
});
|
|
1421
1436
|
}
|
|
1422
1437
|
}
|
|
1423
|
-
function
|
|
1424
|
-
|
|
1438
|
+
function cn(e) {
|
|
1439
|
+
sn(e?.storageKey ?? on);
|
|
1425
1440
|
function t() {
|
|
1426
|
-
|
|
1441
|
+
Y.value = !0;
|
|
1427
1442
|
}
|
|
1428
1443
|
function n() {
|
|
1429
|
-
|
|
1444
|
+
Y.value = !1;
|
|
1430
1445
|
}
|
|
1431
1446
|
function r() {
|
|
1432
|
-
|
|
1447
|
+
Y.value = !Y.value;
|
|
1433
1448
|
}
|
|
1434
1449
|
return {
|
|
1435
|
-
collapsed:
|
|
1450
|
+
collapsed: Y,
|
|
1436
1451
|
collapse: t,
|
|
1437
1452
|
expand: n,
|
|
1438
1453
|
toggle: r
|
|
@@ -1440,45 +1455,45 @@ function an(e) {
|
|
|
1440
1455
|
}
|
|
1441
1456
|
//#endregion
|
|
1442
1457
|
//#region src/composables/useNotifications.ts
|
|
1443
|
-
var
|
|
1444
|
-
function
|
|
1458
|
+
var X = S([]), Z = S(!1), ln = r(() => X.value.filter((e) => !e.read).length);
|
|
1459
|
+
function un() {
|
|
1445
1460
|
function e() {
|
|
1446
|
-
|
|
1461
|
+
Z.value = !0;
|
|
1447
1462
|
}
|
|
1448
1463
|
function t() {
|
|
1449
|
-
|
|
1464
|
+
Z.value = !1;
|
|
1450
1465
|
}
|
|
1451
1466
|
function n() {
|
|
1452
|
-
|
|
1467
|
+
Z.value = !Z.value;
|
|
1453
1468
|
}
|
|
1454
1469
|
function r(e) {
|
|
1455
|
-
|
|
1470
|
+
X.value = e;
|
|
1456
1471
|
}
|
|
1457
1472
|
function i(e) {
|
|
1458
|
-
|
|
1473
|
+
X.value = [e, ...X.value];
|
|
1459
1474
|
}
|
|
1460
1475
|
function a(e) {
|
|
1461
|
-
|
|
1476
|
+
X.value = X.value.filter((t) => t.id !== e);
|
|
1462
1477
|
}
|
|
1463
1478
|
function o(e) {
|
|
1464
|
-
|
|
1479
|
+
X.value = X.value.map((t) => t.id === e ? {
|
|
1465
1480
|
...t,
|
|
1466
1481
|
read: !0
|
|
1467
1482
|
} : t);
|
|
1468
1483
|
}
|
|
1469
1484
|
function s() {
|
|
1470
|
-
|
|
1485
|
+
X.value = X.value.map((e) => e.read ? e : {
|
|
1471
1486
|
...e,
|
|
1472
1487
|
read: !0
|
|
1473
1488
|
});
|
|
1474
1489
|
}
|
|
1475
1490
|
function c() {
|
|
1476
|
-
|
|
1491
|
+
X.value = [];
|
|
1477
1492
|
}
|
|
1478
1493
|
return {
|
|
1479
|
-
notifications:
|
|
1480
|
-
unreadCount:
|
|
1481
|
-
open:
|
|
1494
|
+
notifications: X,
|
|
1495
|
+
unreadCount: ln,
|
|
1496
|
+
open: Z,
|
|
1482
1497
|
openPanel: e,
|
|
1483
1498
|
closePanel: t,
|
|
1484
1499
|
togglePanel: n,
|
|
@@ -1492,26 +1507,26 @@ function cn() {
|
|
|
1492
1507
|
}
|
|
1493
1508
|
//#endregion
|
|
1494
1509
|
//#region src/components/BaseSidebar.vue?vue&type=script&setup=true&lang.ts
|
|
1495
|
-
var
|
|
1510
|
+
var dn = ["aria-label", "aria-expanded"], fn = { class: "flex flex-col h-full" }, pn = { class: "flex-1 overflow-y-auto px-3 space-y-6" }, mn = { class: "space-y-0.5" }, hn = [
|
|
1496
1511
|
"aria-current",
|
|
1497
1512
|
"title",
|
|
1498
1513
|
"onClick"
|
|
1499
|
-
],
|
|
1514
|
+
], gn = ["aria-label"], _n = { class: "relative shrink-0" }, vn = {
|
|
1500
1515
|
key: 0,
|
|
1501
1516
|
class: "absolute -top-1.5 -right-1.5 min-w-4 h-4 px-1 rounded-full bg-red-500 text-white text-[10px] font-semibold leading-4 text-center"
|
|
1502
|
-
},
|
|
1517
|
+
}, yn = [
|
|
1503
1518
|
"title",
|
|
1504
1519
|
"aria-label",
|
|
1505
1520
|
"aria-pressed"
|
|
1506
|
-
],
|
|
1521
|
+
], bn = [
|
|
1507
1522
|
"title",
|
|
1508
1523
|
"aria-label",
|
|
1509
1524
|
"aria-pressed"
|
|
1510
|
-
],
|
|
1525
|
+
], xn = /*#__PURE__*/ ((e, t) => {
|
|
1511
1526
|
let n = e.__vccOpts || e;
|
|
1512
1527
|
for (let [e, r] of t) n[e] = r;
|
|
1513
1528
|
return n;
|
|
1514
|
-
})(/* @__PURE__ */
|
|
1529
|
+
})(/* @__PURE__ */ f({
|
|
1515
1530
|
__name: "BaseSidebar",
|
|
1516
1531
|
props: {
|
|
1517
1532
|
sections: {},
|
|
@@ -1532,151 +1547,151 @@ var ln = ["aria-label", "aria-expanded"], un = { class: "flex flex-col h-full" }
|
|
|
1532
1547
|
}
|
|
1533
1548
|
},
|
|
1534
1549
|
setup(t) {
|
|
1535
|
-
let n = t, c =
|
|
1550
|
+
let n = t, c = Ee(), l = Te(), { isDark: f, toggleTheme: p } = z(), { mobileOpen: g, close: _, toggle: v } = rn(), { collapsed: y, toggle: x } = cn(), { unreadCount: T, togglePanel: k } = un(), A = r(() => n.collapsible && y.value), ee = S(null), j = null;
|
|
1536
1551
|
M(g, async (e) => {
|
|
1537
|
-
e ? (j = document.activeElement instanceof HTMLElement ? document.activeElement : null, await
|
|
1552
|
+
e ? (j = document.activeElement instanceof HTMLElement ? document.activeElement : null, await m(), ee.value?.focus()) : (j?.focus(), j = null);
|
|
1538
1553
|
});
|
|
1539
|
-
function
|
|
1554
|
+
function te() {
|
|
1540
1555
|
c.push({ name: n.homeRouteName }), _();
|
|
1541
1556
|
}
|
|
1542
|
-
function
|
|
1543
|
-
return
|
|
1557
|
+
function N(e) {
|
|
1558
|
+
return l.name === e;
|
|
1544
1559
|
}
|
|
1545
|
-
function
|
|
1560
|
+
function P(e) {
|
|
1546
1561
|
c.push({ name: e }), _();
|
|
1547
1562
|
}
|
|
1548
|
-
return (n, r) => (
|
|
1549
|
-
s("div", { class:
|
|
1563
|
+
return (n, r) => (b(), o("div", null, [
|
|
1564
|
+
s("div", { class: h(["mobile-topbar fixed top-0 inset-x-0 z-30 flex items-center justify-between px-4 py-3 border-b transition-colors", O(f) ? "bg-gray-900 border-gray-800" : "bg-white border-gray-200"]) }, [s("button", {
|
|
1550
1565
|
type: "button",
|
|
1551
|
-
onClick:
|
|
1566
|
+
onClick: te,
|
|
1552
1567
|
class: "cursor-pointer rounded focus:outline-none focus-visible:ring-2 focus-visible:ring-emerald-500",
|
|
1553
1568
|
"aria-label": "Go to home"
|
|
1554
|
-
}, [
|
|
1569
|
+
}, [w(n.$slots, "logo", { size: 28 }, void 0, !0)]), s("button", {
|
|
1555
1570
|
type: "button",
|
|
1556
|
-
onClick: r[0] ||= (...e) =>
|
|
1557
|
-
class:
|
|
1558
|
-
"aria-label":
|
|
1559
|
-
"aria-expanded":
|
|
1560
|
-
}, [
|
|
1571
|
+
onClick: r[0] ||= (...e) => O(v) && O(v)(...e),
|
|
1572
|
+
class: h(["p-2 rounded-lg cursor-pointer transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-emerald-500", O(f) ? "text-gray-400 hover:bg-gray-800" : "text-gray-600 hover:bg-gray-100"]),
|
|
1573
|
+
"aria-label": O(g) ? "Close navigation menu" : "Open navigation menu",
|
|
1574
|
+
"aria-expanded": O(g)
|
|
1575
|
+
}, [O(g) ? (b(), i(O(Ce), {
|
|
1561
1576
|
key: 1,
|
|
1562
1577
|
class: "w-6 h-6",
|
|
1563
1578
|
"aria-hidden": "true"
|
|
1564
|
-
})) : (
|
|
1579
|
+
})) : (b(), i(O(ae), {
|
|
1565
1580
|
key: 0,
|
|
1566
1581
|
class: "w-6 h-6",
|
|
1567
1582
|
"aria-hidden": "true"
|
|
1568
|
-
}))], 10,
|
|
1569
|
-
|
|
1583
|
+
}))], 10, dn)], 2),
|
|
1584
|
+
O(g) ? (b(), o("div", {
|
|
1570
1585
|
key: 0,
|
|
1571
1586
|
class: "mobile-overlay fixed inset-0 z-40 bg-black/50",
|
|
1572
1587
|
"aria-hidden": "true",
|
|
1573
|
-
onClick: r[1] ||= (...e) =>
|
|
1588
|
+
onClick: r[1] ||= (...e) => O(_) && O(_)(...e)
|
|
1574
1589
|
})) : a("", !0),
|
|
1575
1590
|
s("aside", {
|
|
1576
1591
|
role: "navigation",
|
|
1577
1592
|
"aria-label": "Main navigation",
|
|
1578
|
-
class:
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
t.collapsible &&
|
|
1593
|
+
class: h(["fixed top-0 left-0 h-screen w-60 flex flex-col border-r transition-all duration-300 lg:pointer-events-auto", [
|
|
1594
|
+
O(f) ? "bg-gray-900 border-gray-800" : "bg-white border-gray-200",
|
|
1595
|
+
O(g) ? "translate-x-0 z-50" : "-translate-x-full max-lg:pointer-events-none lg:translate-x-0 z-50",
|
|
1596
|
+
t.collapsible && O(y) ? "lg:w-16" : "lg:w-60"
|
|
1582
1597
|
]])
|
|
1583
|
-
}, [s("div",
|
|
1584
|
-
s("div", { class:
|
|
1598
|
+
}, [s("div", fn, [
|
|
1599
|
+
s("div", { class: h(["px-5 pt-5 pb-4 flex items-center justify-center relative", { "lg:px-2": A.value }]) }, [s("button", {
|
|
1585
1600
|
type: "button",
|
|
1586
|
-
onClick:
|
|
1601
|
+
onClick: te,
|
|
1587
1602
|
class: "cursor-pointer rounded focus:outline-none focus-visible:ring-2 focus-visible:ring-emerald-500",
|
|
1588
1603
|
"aria-label": "Go to home"
|
|
1589
|
-
}, [
|
|
1604
|
+
}, [w(n.$slots, "logo", { size: A.value ? 36 : 52 }, void 0, !0)]), s("button", {
|
|
1590
1605
|
ref_key: "closeMobileButton",
|
|
1591
|
-
ref:
|
|
1606
|
+
ref: ee,
|
|
1592
1607
|
type: "button",
|
|
1593
|
-
onClick: r[2] ||= (...e) =>
|
|
1594
|
-
class:
|
|
1608
|
+
onClick: r[2] ||= (...e) => O(_) && O(_)(...e),
|
|
1609
|
+
class: h(["lg:hidden p-1.5 rounded-lg cursor-pointer absolute right-3 top-4 focus:outline-none focus-visible:ring-2 focus-visible:ring-emerald-500", O(f) ? "text-gray-400 hover:bg-gray-800" : "text-gray-500 hover:bg-gray-100"]),
|
|
1595
1610
|
"aria-label": "Close navigation menu"
|
|
1596
|
-
}, [
|
|
1611
|
+
}, [d(O(Ce), {
|
|
1597
1612
|
class: "w-5 h-5",
|
|
1598
1613
|
"aria-hidden": "true"
|
|
1599
1614
|
})], 2)], 2),
|
|
1600
|
-
s("nav",
|
|
1615
|
+
s("nav", pn, [(b(!0), o(e, null, C(t.sections, (t) => (b(), o("div", { key: t.title }, [s("p", { class: h(["px-2 mb-2 text-[10px] font-semibold uppercase tracking-wider text-gray-500", { "lg:hidden": A.value }]) }, D(t.title), 3), s("ul", mn, [(b(!0), o(e, null, C(t.items, (e) => (b(), o("li", { key: e.name }, [s("button", {
|
|
1601
1616
|
type: "button",
|
|
1602
|
-
"aria-current":
|
|
1603
|
-
title:
|
|
1604
|
-
onClick: (t) =>
|
|
1605
|
-
class:
|
|
1606
|
-
}, [(
|
|
1607
|
-
s("div", { class:
|
|
1608
|
-
t.showNotifications ? (
|
|
1617
|
+
"aria-current": N(e.name) ? "page" : void 0,
|
|
1618
|
+
title: A.value ? e.label : void 0,
|
|
1619
|
+
onClick: (t) => P(e.name),
|
|
1620
|
+
class: h(["flex items-center gap-3 px-3 py-2.5 rounded-lg text-sm font-medium transition-colors w-full text-left cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-emerald-500", [N(e.name) ? O(f) ? "bg-emerald-500/15 text-emerald-300" : "bg-emerald-50 text-emerald-700" : O(f) ? "text-gray-400 hover:text-gray-100 hover:bg-gray-800" : "text-gray-600 hover:text-gray-900 hover:bg-gray-100", { "lg:justify-center": A.value }]])
|
|
1621
|
+
}, [(b(), i(E(e.icon), { class: "w-[18px] h-[18px] shrink-0" })), s("span", { class: h({ "lg:hidden": A.value }) }, D(e.label), 3)], 10, hn)]))), 128))])]))), 128))]),
|
|
1622
|
+
s("div", { class: h(["px-4 py-4 border-t transition-colors space-y-3", O(f) ? "border-gray-800" : "border-gray-200"]) }, [
|
|
1623
|
+
t.showNotifications ? (b(), o("button", {
|
|
1609
1624
|
key: 0,
|
|
1610
1625
|
type: "button",
|
|
1611
|
-
onClick: r[3] ||= (...e) =>
|
|
1626
|
+
onClick: r[3] ||= (...e) => O(k) && O(k)(...e),
|
|
1612
1627
|
title: "Notifications",
|
|
1613
|
-
"aria-label":
|
|
1614
|
-
class:
|
|
1615
|
-
}, [s("span",
|
|
1628
|
+
"aria-label": O(T) > 0 ? `Notifications, ${O(T)} unread` : "Notifications",
|
|
1629
|
+
class: h(["relative flex items-center gap-3 w-full px-3 py-2.5 rounded-lg text-sm font-medium transition-colors cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-emerald-500", [O(f) ? "text-gray-400 hover:text-gray-100 hover:bg-gray-800" : "text-gray-600 hover:text-gray-900 hover:bg-gray-100", { "lg:justify-center": A.value }]])
|
|
1630
|
+
}, [s("span", _n, [d(O(oe), {
|
|
1616
1631
|
class: "w-[18px] h-[18px]",
|
|
1617
1632
|
"aria-hidden": "true"
|
|
1618
|
-
}),
|
|
1619
|
-
t.showThemeToggle ? (
|
|
1633
|
+
}), O(T) > 0 ? (b(), o("span", vn, D(O(T) > 99 ? "99+" : O(T)), 1)) : a("", !0)]), s("span", { class: h({ "lg:hidden": A.value }) }, "Notifications", 2)], 10, gn)) : a("", !0),
|
|
1634
|
+
t.showThemeToggle ? (b(), o("button", {
|
|
1620
1635
|
key: 1,
|
|
1621
1636
|
type: "button",
|
|
1622
|
-
onClick: r[4] ||= (...e) =>
|
|
1623
|
-
title:
|
|
1624
|
-
"aria-label":
|
|
1625
|
-
"aria-pressed":
|
|
1626
|
-
class:
|
|
1637
|
+
onClick: r[4] ||= (...e) => O(p) && O(p)(...e),
|
|
1638
|
+
title: O(f) ? "Switch to light mode" : "Switch to dark mode",
|
|
1639
|
+
"aria-label": O(f) ? "Switch to light mode" : "Switch to dark mode",
|
|
1640
|
+
"aria-pressed": O(f),
|
|
1641
|
+
class: h(["flex items-center gap-3 w-full px-3 py-2.5 rounded-lg text-sm font-medium transition-colors cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-emerald-500", [O(f) ? "text-gray-400 hover:text-gray-100 hover:bg-gray-800" : "text-gray-600 hover:text-gray-900 hover:bg-gray-100", { "lg:justify-center": A.value }]])
|
|
1627
1642
|
}, [
|
|
1628
|
-
(
|
|
1629
|
-
class:
|
|
1643
|
+
(b(), i(E(O(f) ? O(Se) : O(xe)), {
|
|
1644
|
+
class: h(["hidden w-[18px] h-[18px] shrink-0", { "lg:block": A.value }]),
|
|
1630
1645
|
"aria-hidden": "true"
|
|
1631
1646
|
}, null, 8, ["class"])),
|
|
1632
|
-
s("span", { class:
|
|
1633
|
-
s("span", { class:
|
|
1634
|
-
], 10,
|
|
1635
|
-
t.collapsible ? (
|
|
1647
|
+
s("span", { class: h({ "lg:hidden": A.value }) }, D(O(f) ? "Switch to light" : "Switch to dark"), 3),
|
|
1648
|
+
s("span", { class: h(["ml-auto relative w-9 h-5 rounded-full transition-colors", [O(f) ? "bg-emerald-600" : "bg-gray-300", { "lg:hidden": A.value }]]) }, [s("span", { class: h(["absolute top-0.5 left-0.5 w-4 h-4 rounded-full bg-white shadow-sm transition-transform duration-300", O(f) ? "translate-x-4" : "translate-x-0"]) }, null, 2)], 2)
|
|
1649
|
+
], 10, yn)) : a("", !0),
|
|
1650
|
+
t.collapsible ? (b(), o("button", {
|
|
1636
1651
|
key: 2,
|
|
1637
1652
|
type: "button",
|
|
1638
|
-
onClick: r[5] ||= (...e) =>
|
|
1639
|
-
title:
|
|
1640
|
-
"aria-label":
|
|
1641
|
-
"aria-pressed":
|
|
1642
|
-
class:
|
|
1643
|
-
}, [(
|
|
1653
|
+
onClick: r[5] ||= (...e) => O(x) && O(x)(...e),
|
|
1654
|
+
title: O(y) ? "Expand sidebar" : "Collapse sidebar",
|
|
1655
|
+
"aria-label": O(y) ? "Expand sidebar" : "Collapse sidebar",
|
|
1656
|
+
"aria-pressed": O(y),
|
|
1657
|
+
class: h(["hidden lg:flex items-center gap-3 w-full px-3 py-2.5 rounded-lg text-sm font-medium transition-colors cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-emerald-500", [O(f) ? "text-gray-400 hover:text-gray-100 hover:bg-gray-800" : "text-gray-600 hover:text-gray-900 hover:bg-gray-100", { "lg:justify-center": A.value }]])
|
|
1658
|
+
}, [(b(), i(E(O(y) ? O(le) : O(ce)), {
|
|
1644
1659
|
class: "w-[18px] h-[18px] shrink-0",
|
|
1645
1660
|
"aria-hidden": "true"
|
|
1646
|
-
})), s("span", { class:
|
|
1647
|
-
s("div", { class:
|
|
1648
|
-
s("div", { class:
|
|
1661
|
+
})), s("span", { class: h({ "lg:hidden": A.value }) }, "Collapse", 2)], 10, bn)) : a("", !0),
|
|
1662
|
+
s("div", { class: h({ "lg:hidden": A.value }) }, [w(n.$slots, "status", {}, void 0, !0)], 2),
|
|
1663
|
+
s("div", { class: h({ "lg:hidden": A.value }) }, [w(n.$slots, "footer", {}, () => [t.appName || t.version ? (b(), o("div", {
|
|
1649
1664
|
key: 0,
|
|
1650
|
-
class:
|
|
1665
|
+
class: h(["flex items-center justify-center gap-2 text-xs", (O(f), "text-gray-500")])
|
|
1651
1666
|
}, [s("span", null, [
|
|
1652
|
-
|
|
1653
|
-
t.appName && t.version ? (
|
|
1654
|
-
t.version ? (
|
|
1667
|
+
u(D(t.appName), 1),
|
|
1668
|
+
t.appName && t.version ? (b(), o(e, { key: 0 }, [], 64)) : a("", !0),
|
|
1669
|
+
t.version ? (b(), o(e, { key: 1 }, [u("v" + D(t.version), 1)], 64)) : a("", !0)
|
|
1655
1670
|
])], 2)) : a("", !0)], !0)], 2)
|
|
1656
1671
|
], 2)
|
|
1657
1672
|
])], 2)
|
|
1658
1673
|
]));
|
|
1659
1674
|
}
|
|
1660
|
-
}), [["__scopeId", "data-v-452beaf2"]]),
|
|
1675
|
+
}), [["__scopeId", "data-v-452beaf2"]]), Sn = {
|
|
1661
1676
|
key: 1,
|
|
1662
1677
|
class: "mt-4 flex justify-center py-6"
|
|
1663
|
-
},
|
|
1678
|
+
}, Cn = {
|
|
1664
1679
|
key: 2,
|
|
1665
1680
|
class: "mt-4 text-sm text-red-500",
|
|
1666
1681
|
role: "alert"
|
|
1667
|
-
},
|
|
1682
|
+
}, wn = {
|
|
1668
1683
|
key: 3,
|
|
1669
1684
|
class: "mt-4"
|
|
1670
|
-
},
|
|
1685
|
+
}, Tn = { class: "relative" }, En = ["placeholder"], Dn = {
|
|
1671
1686
|
key: 4,
|
|
1672
1687
|
class: "mt-3 max-h-64 overflow-y-auto"
|
|
1673
|
-
},
|
|
1688
|
+
}, On = ["aria-pressed", "onClick"], kn = { class: "flex-1 min-w-0" }, An = {
|
|
1674
1689
|
key: 0,
|
|
1675
1690
|
class: "text-center py-6"
|
|
1676
|
-
},
|
|
1691
|
+
}, jn = {
|
|
1677
1692
|
key: 1,
|
|
1678
1693
|
class: "text-center py-6"
|
|
1679
|
-
},
|
|
1694
|
+
}, Mn = ["disabled"], Nn = ["disabled"], Pn = /* @__PURE__ */ f({
|
|
1680
1695
|
__name: "BaseEntityPickerModal",
|
|
1681
1696
|
props: {
|
|
1682
1697
|
title: {},
|
|
@@ -1698,10 +1713,10 @@ var ln = ["aria-label", "aria-expanded"], un = { class: "flex flex-col h-full" }
|
|
|
1698
1713
|
},
|
|
1699
1714
|
emits: ["confirm", "cancel"],
|
|
1700
1715
|
setup(t, { emit: n }) {
|
|
1701
|
-
let
|
|
1702
|
-
let e =
|
|
1703
|
-
return
|
|
1704
|
-
}),
|
|
1716
|
+
let l = t, u = n, { isDark: f } = z(), p = J(), g = S([]), v = S(!1), y = S(""), x = S(null), T = S(""), E = S(null), k = r(() => {
|
|
1717
|
+
let e = l.loader ? g.value : l.items;
|
|
1718
|
+
return l.excludeId ? e.filter((e) => e.id !== l.excludeId) : e;
|
|
1719
|
+
}), A = r(() => k.value.filter((e) => e.label.toLowerCase().includes(T.value.toLowerCase()))), ee = {
|
|
1705
1720
|
emerald: {
|
|
1706
1721
|
iconBg: "bg-emerald-50",
|
|
1707
1722
|
iconText: "text-emerald-600",
|
|
@@ -1747,7 +1762,7 @@ var ln = ["aria-label", "aria-expanded"], un = { class: "flex flex-col h-full" }
|
|
|
1747
1762
|
confirmActive: "bg-amber-600 hover:bg-amber-700 cursor-pointer",
|
|
1748
1763
|
confirmDisabled: "bg-amber-400 cursor-not-allowed"
|
|
1749
1764
|
}
|
|
1750
|
-
},
|
|
1765
|
+
}, te = {
|
|
1751
1766
|
emerald: {
|
|
1752
1767
|
iconBg: "bg-emerald-900/30",
|
|
1753
1768
|
iconText: "text-emerald-400",
|
|
@@ -1793,75 +1808,74 @@ var ln = ["aria-label", "aria-expanded"], un = { class: "flex flex-col h-full" }
|
|
|
1793
1808
|
confirmActive: "bg-amber-600 hover:bg-amber-700 cursor-pointer",
|
|
1794
1809
|
confirmDisabled: "bg-amber-400 cursor-not-allowed"
|
|
1795
1810
|
}
|
|
1796
|
-
}, M = r(() => (
|
|
1797
|
-
|
|
1798
|
-
if (
|
|
1799
|
-
|
|
1811
|
+
}, M = r(() => (f.value ? te : ee)[l.variant]);
|
|
1812
|
+
_(async () => {
|
|
1813
|
+
if (l.loader) {
|
|
1814
|
+
v.value = !0;
|
|
1800
1815
|
try {
|
|
1801
|
-
|
|
1816
|
+
g.value = await l.loader();
|
|
1802
1817
|
} catch {
|
|
1803
|
-
|
|
1818
|
+
y.value = "Failed to load items";
|
|
1804
1819
|
} finally {
|
|
1805
|
-
|
|
1820
|
+
v.value = !1;
|
|
1806
1821
|
}
|
|
1807
1822
|
}
|
|
1808
|
-
await
|
|
1823
|
+
await m(), E.value?.focus();
|
|
1809
1824
|
});
|
|
1810
|
-
function
|
|
1811
|
-
!
|
|
1825
|
+
function ne() {
|
|
1826
|
+
!x.value || l.submitting || u("confirm", x.value);
|
|
1812
1827
|
}
|
|
1813
1828
|
function F() {
|
|
1814
|
-
|
|
1829
|
+
l.submitting || u("cancel");
|
|
1815
1830
|
}
|
|
1816
|
-
return (n, r) => (
|
|
1831
|
+
return (n, r) => (b(), i(Vt, {
|
|
1817
1832
|
title: t.title,
|
|
1833
|
+
icon: O(_e),
|
|
1834
|
+
"icon-bg-class": M.value.iconBg,
|
|
1835
|
+
"icon-class": M.value.iconText,
|
|
1818
1836
|
"manual-close": t.submitting,
|
|
1819
1837
|
onCancel: F
|
|
1820
|
-
}, {
|
|
1821
|
-
icon: N(() => [C(n.$slots, "icon", {}, () => [s("div", { class: m(["flex-shrink-0 flex h-12 w-12 items-center justify-center rounded-full", M.value.iconBg]) }, [u(D(ge), {
|
|
1822
|
-
class: m(["h-6 w-6", M.value.iconText]),
|
|
1823
|
-
"aria-hidden": "true"
|
|
1824
|
-
}, null, 8, ["class"])], 2)])]),
|
|
1838
|
+
}, c({
|
|
1825
1839
|
footer: N(() => [s("button", {
|
|
1826
1840
|
type: "button",
|
|
1827
1841
|
disabled: t.submitting,
|
|
1828
|
-
class:
|
|
1842
|
+
class: h(["inline-flex items-center justify-center px-4 py-2 border rounded-md shadow-sm text-sm font-medium transition-colors duration-150 cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed focus:outline-none focus-visible:ring-2 focus-visible:ring-emerald-500", O(p).ghostButton]),
|
|
1829
1843
|
onClick: F
|
|
1830
|
-
},
|
|
1844
|
+
}, D(t.cancelText), 11, Mn), s("button", {
|
|
1831
1845
|
type: "button",
|
|
1832
|
-
disabled: !
|
|
1833
|
-
class:
|
|
1834
|
-
onClick:
|
|
1835
|
-
},
|
|
1846
|
+
disabled: !x.value || t.submitting,
|
|
1847
|
+
class: h(["inline-flex items-center justify-center px-4 py-2 border border-transparent rounded-md shadow-sm text-sm font-medium text-white transition-colors duration-150 focus:outline-none focus-visible:ring-2 focus-visible:ring-emerald-500 focus-visible:ring-offset-2", !x.value || t.submitting ? M.value.confirmDisabled : M.value.confirmActive]),
|
|
1848
|
+
onClick: ne
|
|
1849
|
+
}, D(t.submitting ? t.submittingText : t.confirmText), 11, Nn)]),
|
|
1836
1850
|
default: N(() => [
|
|
1837
|
-
t.message ? (
|
|
1851
|
+
t.message ? (b(), o("p", {
|
|
1838
1852
|
key: 0,
|
|
1839
|
-
class:
|
|
1840
|
-
},
|
|
1841
|
-
|
|
1842
|
-
!
|
|
1843
|
-
class:
|
|
1853
|
+
class: h(["text-sm", O(f) ? "text-gray-300" : "text-gray-600"])
|
|
1854
|
+
}, D(t.message), 3)) : a("", !0),
|
|
1855
|
+
v.value ? (b(), o("div", Sn, [d(ct, { color: "emerald" })])) : y.value ? (b(), o("div", Cn, D(y.value), 1)) : a("", !0),
|
|
1856
|
+
!v.value && !y.value && k.value.length > 0 ? (b(), o("div", wn, [s("div", Tn, [d(O(ye), {
|
|
1857
|
+
class: h(["absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4", O(p).dimText]),
|
|
1844
1858
|
"aria-hidden": "true"
|
|
1845
1859
|
}, null, 8, ["class"]), P(s("input", {
|
|
1846
1860
|
ref_key: "searchInputRef",
|
|
1847
|
-
ref:
|
|
1848
|
-
"onUpdate:modelValue": r[0] ||= (e) =>
|
|
1861
|
+
ref: E,
|
|
1862
|
+
"onUpdate:modelValue": r[0] ||= (e) => T.value = e,
|
|
1849
1863
|
type: "text",
|
|
1850
1864
|
placeholder: t.searchPlaceholder,
|
|
1851
|
-
class:
|
|
1852
|
-
}, null, 10,
|
|
1853
|
-
!
|
|
1865
|
+
class: h(["w-full pl-9 pr-3 py-2 text-sm rounded-md border outline-none transition-colors", [O(f) ? "bg-gray-800 border-gray-600 text-gray-200 placeholder-gray-500" : "bg-white border-gray-300 text-gray-700 placeholder-gray-400", M.value.inputFocus]])
|
|
1866
|
+
}, null, 10, En), [[j, T.value]])])])) : a("", !0),
|
|
1867
|
+
!v.value && !y.value ? (b(), o("div", Dn, [(b(!0), o(e, null, C(A.value, (e) => (b(), o("button", {
|
|
1854
1868
|
key: e.id,
|
|
1855
1869
|
type: "button",
|
|
1856
|
-
"aria-pressed":
|
|
1857
|
-
class:
|
|
1858
|
-
onClick: (t) =>
|
|
1870
|
+
"aria-pressed": x.value === e.id,
|
|
1871
|
+
class: h(["w-full text-left flex items-center gap-3 px-3 py-2.5 rounded-lg cursor-pointer transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-emerald-500", [x.value === e.id ? M.value.selectedRow : O(f) ? "hover:bg-gray-800 border border-transparent" : "hover:bg-gray-50 border border-transparent"]]),
|
|
1872
|
+
onClick: (t) => x.value = e.id
|
|
1859
1873
|
}, [
|
|
1860
|
-
|
|
1861
|
-
s("div",
|
|
1862
|
-
|
|
1874
|
+
d(O(_e), { class: h(["w-5 h-5 flex-shrink-0", O(p).dimText]) }, null, 8, ["class"]),
|
|
1875
|
+
s("div", kn, [s("p", { class: h(["text-sm font-medium truncate", O(p).bodyText]) }, D(e.label), 3)]),
|
|
1876
|
+
x.value === e.id ? (b(), o("div", {
|
|
1863
1877
|
key: 0,
|
|
1864
|
-
class:
|
|
1878
|
+
class: h(["w-5 h-5 rounded-full flex items-center justify-center", M.value.checkBg])
|
|
1865
1879
|
}, [...r[1] ||= [s("svg", {
|
|
1866
1880
|
class: "w-3 h-3 text-white",
|
|
1867
1881
|
fill: "none",
|
|
@@ -1874,15 +1888,25 @@ var ln = ["aria-label", "aria-expanded"], un = { class: "flex flex-col h-full" }
|
|
|
1874
1888
|
"stroke-linejoin": "round",
|
|
1875
1889
|
d: "M5 13l4 4L19 7"
|
|
1876
1890
|
})], -1)]], 2)) : a("", !0)
|
|
1877
|
-
], 10,
|
|
1891
|
+
], 10, On))), 128)), k.value.length === 0 ? (b(), o("div", An, [s("p", { class: h(["text-sm", O(p).dimText]) }, D(t.emptyMessage), 3)])) : A.value.length === 0 ? (b(), o("div", jn, [s("p", { class: h(["text-sm", O(p).dimText]) }, D(t.noMatchMessage), 3)])) : a("", !0)])) : a("", !0)
|
|
1878
1892
|
]),
|
|
1879
|
-
_:
|
|
1880
|
-
},
|
|
1893
|
+
_: 2
|
|
1894
|
+
}, [n.$slots.icon ? {
|
|
1895
|
+
name: "icon",
|
|
1896
|
+
fn: N(() => [w(n.$slots, "icon")]),
|
|
1897
|
+
key: "0"
|
|
1898
|
+
} : void 0]), 1032, [
|
|
1899
|
+
"title",
|
|
1900
|
+
"icon",
|
|
1901
|
+
"icon-bg-class",
|
|
1902
|
+
"icon-class",
|
|
1903
|
+
"manual-close"
|
|
1904
|
+
]));
|
|
1881
1905
|
}
|
|
1882
|
-
}),
|
|
1906
|
+
}), Fn = {
|
|
1883
1907
|
href: "#main-content",
|
|
1884
1908
|
class: "sr-only focus:not-sr-only focus:fixed focus:top-2 focus:left-2 focus:z-[100] focus:px-3 focus:py-2 focus:rounded-md focus:bg-emerald-600 focus:text-white focus:shadow-lg"
|
|
1885
|
-
},
|
|
1909
|
+
}, In = ["inert"], Ln = /* @__PURE__ */ f({
|
|
1886
1910
|
__name: "BaseAppLayout",
|
|
1887
1911
|
props: {
|
|
1888
1912
|
showSidebar: {
|
|
@@ -1892,19 +1916,19 @@ var ln = ["aria-label", "aria-expanded"], un = { class: "flex flex-col h-full" }
|
|
|
1892
1916
|
skipLinkLabel: { default: "Skip to main content" }
|
|
1893
1917
|
},
|
|
1894
1918
|
setup(e) {
|
|
1895
|
-
let t = e, { isDark: n } = z(), { mobileOpen: i } =
|
|
1896
|
-
return (t, r) => (
|
|
1897
|
-
s("a",
|
|
1898
|
-
l.value ?
|
|
1919
|
+
let t = e, { isDark: n } = z(), { mobileOpen: i } = rn(), { collapsed: c } = cn(), l = r(() => t.showSidebar);
|
|
1920
|
+
return (t, r) => (b(), o("div", { class: h(["min-h-screen transition-colors duration-300", O(n) ? "bg-gray-950 text-gray-100" : "bg-gray-50 text-gray-800"]) }, [
|
|
1921
|
+
s("a", Fn, D(e.skipLinkLabel), 1),
|
|
1922
|
+
l.value ? w(t.$slots, "sidebar", { key: 0 }) : a("", !0),
|
|
1899
1923
|
s("main", {
|
|
1900
1924
|
id: "main-content",
|
|
1901
1925
|
tabindex: "-1",
|
|
1902
|
-
inert: l.value &&
|
|
1903
|
-
class:
|
|
1904
|
-
}, [
|
|
1926
|
+
inert: l.value && O(i) ? !0 : void 0,
|
|
1927
|
+
class: h(["transition-all duration-300", l.value ? O(c) ? "pt-14 lg:pt-0 lg:ml-16" : "pt-14 lg:pt-0 lg:ml-60" : ""])
|
|
1928
|
+
}, [w(t.$slots, "default")], 10, In)
|
|
1905
1929
|
], 2));
|
|
1906
1930
|
}
|
|
1907
|
-
}),
|
|
1931
|
+
}), Rn = { class: "flex flex-wrap items-center justify-between gap-3 mb-8" }, zn = { class: "flex items-center gap-3 min-w-0" }, Bn = { class: "flex items-center gap-2" }, Vn = /* @__PURE__ */ f({
|
|
1908
1932
|
__name: "BasePageHeader",
|
|
1909
1933
|
props: {
|
|
1910
1934
|
title: {},
|
|
@@ -1954,16 +1978,16 @@ var ln = ["aria-label", "aria-expanded"], un = { class: "flex flex-col h-full" }
|
|
|
1954
1978
|
}[t.iconColor];
|
|
1955
1979
|
return n.value ? e.dark : e.light;
|
|
1956
1980
|
});
|
|
1957
|
-
return (t, n) => (
|
|
1981
|
+
return (t, n) => (b(), o("div", { class: h(["mx-auto px-4 sm:px-6", e.maxWidthClass]) }, [s("div", Rn, [s("div", zn, [s("div", { class: h(["w-10 h-10 rounded-lg flex items-center justify-center", c.value]) }, [w(t.$slots, "icon", { iconClass: l.value })], 2), s("div", null, [s("h1", { class: h(["text-2xl font-bold", O(i).primaryTextSoft]) }, D(e.title), 3), e.subtitle ? (b(), o("p", {
|
|
1958
1982
|
key: 0,
|
|
1959
|
-
class:
|
|
1960
|
-
},
|
|
1983
|
+
class: h(["text-sm", O(i).dimTextAlt])
|
|
1984
|
+
}, D(e.subtitle), 3)) : a("", !0)])]), s("div", Bn, [w(t.$slots, "actions")])])], 2));
|
|
1961
1985
|
}
|
|
1962
|
-
}),
|
|
1986
|
+
}), Hn = [
|
|
1963
1987
|
"type",
|
|
1964
1988
|
"disabled",
|
|
1965
1989
|
"title"
|
|
1966
|
-
],
|
|
1990
|
+
], Un = { key: 0 }, Wn = /* @__PURE__ */ f({
|
|
1967
1991
|
__name: "BaseToolbarButton",
|
|
1968
1992
|
props: {
|
|
1969
1993
|
label: { default: "" },
|
|
@@ -1990,20 +2014,20 @@ var ln = ["aria-label", "aria-expanded"], un = { class: "flex flex-col h-full" }
|
|
|
1990
2014
|
}[t.variant];
|
|
1991
2015
|
return n.value ? e.dark : e.light;
|
|
1992
2016
|
});
|
|
1993
|
-
return (t, n) => (
|
|
2017
|
+
return (t, n) => (b(), o("button", {
|
|
1994
2018
|
type: e.type,
|
|
1995
2019
|
disabled: e.disabled,
|
|
1996
2020
|
title: e.title,
|
|
1997
|
-
class:
|
|
2021
|
+
class: h(["inline-flex shrink-0 items-center gap-2 px-3 py-2 rounded-lg text-sm font-medium border transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed whitespace-nowrap focus:outline-none focus-visible:ring-2 focus-visible:ring-emerald-500", i.value]),
|
|
1998
2022
|
onClick: n[0] ||= (e) => t.$emit("click", e)
|
|
1999
|
-
}, [
|
|
2023
|
+
}, [w(t.$slots, "icon", { iconClass: "w-4 h-4" }), e.label ? (b(), o("span", Un, D(e.label), 1)) : a("", !0)], 10, Hn));
|
|
2000
2024
|
}
|
|
2001
|
-
}),
|
|
2025
|
+
}), Gn = [
|
|
2002
2026
|
"type",
|
|
2003
2027
|
"disabled",
|
|
2004
2028
|
"title",
|
|
2005
2029
|
"aria-label"
|
|
2006
|
-
],
|
|
2030
|
+
], Kn = { key: 0 }, qn = /* @__PURE__ */ f({
|
|
2007
2031
|
__name: "BaseActionButton",
|
|
2008
2032
|
props: {
|
|
2009
2033
|
label: { default: "" },
|
|
@@ -2095,16 +2119,16 @@ var ln = ["aria-label", "aria-expanded"], un = { class: "flex flex-col h-full" }
|
|
|
2095
2119
|
}[t.color];
|
|
2096
2120
|
return n.value ? e.dark : e.light;
|
|
2097
2121
|
}), c = r(() => t.disabled ? `${s.value} opacity-50 cursor-not-allowed` : `${i.value} cursor-pointer`);
|
|
2098
|
-
return (t, n) => (
|
|
2122
|
+
return (t, n) => (b(), o("button", {
|
|
2099
2123
|
type: e.type,
|
|
2100
2124
|
disabled: e.disabled,
|
|
2101
2125
|
title: e.title,
|
|
2102
2126
|
"aria-label": e.ariaLabel,
|
|
2103
|
-
class:
|
|
2127
|
+
class: h(["inline-flex items-center justify-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-current", [e.fullWidth ? "flex-1" : "", c.value]]),
|
|
2104
2128
|
onClick: n[0] ||= (e) => t.$emit("click", e)
|
|
2105
|
-
}, [
|
|
2129
|
+
}, [w(t.$slots, "icon", { iconClass: "w-4 h-4" }), e.label ? (b(), o("span", Kn, D(e.label), 1)) : a("", !0)], 10, Gn));
|
|
2106
2130
|
}
|
|
2107
|
-
}),
|
|
2131
|
+
}), Jn = ["title", "aria-label"], Yn = /* @__PURE__ */ f({
|
|
2108
2132
|
__name: "BaseCopyButton",
|
|
2109
2133
|
props: {
|
|
2110
2134
|
text: {},
|
|
@@ -2115,7 +2139,7 @@ var ln = ["aria-label", "aria-expanded"], un = { class: "flex flex-col h-full" }
|
|
|
2115
2139
|
},
|
|
2116
2140
|
emits: ["copied", "error"],
|
|
2117
2141
|
setup(e, { emit: t }) {
|
|
2118
|
-
let n = e, a = t, { isDark: s } = z(), c =
|
|
2142
|
+
let n = e, a = t, { isDark: s } = z(), c = S(!1), l = null, u = r(() => c.value ? "Copied!" : n.label ? `Copy ${n.label}` : "Copy"), d = r(() => n.label ? `Copy ${n.label}` : "Copy"), f = r(() => n.variant === "bordered" ? `inline-flex items-center justify-center w-9 h-9 rounded-lg border transition-colors cursor-pointer shrink-0 focus:outline-none focus-visible:ring-2 focus-visible:ring-emerald-500 ${c.value ? s.value ? "border-emerald-500/40 bg-emerald-500/10 text-emerald-400" : "border-emerald-300 bg-emerald-50 text-emerald-600" : s.value ? "border-gray-600 text-gray-400 hover:text-gray-200 hover:bg-gray-800" : "border-gray-300 text-gray-400 hover:text-gray-600 hover:bg-gray-50"}` : `p-1 rounded transition-colors cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-emerald-500 ${s.value ? "text-gray-400 hover:text-emerald-300 hover:bg-emerald-500/10" : "text-gray-500 hover:text-emerald-600 hover:bg-emerald-50"}`);
|
|
2119
2143
|
async function p(e) {
|
|
2120
2144
|
try {
|
|
2121
2145
|
if (navigator.clipboard?.writeText) {
|
|
@@ -2128,7 +2152,7 @@ var ln = ["aria-label", "aria-expanded"], un = { class: "flex flex-col h-full" }
|
|
|
2128
2152
|
let n = document.execCommand("copy");
|
|
2129
2153
|
if (document.body.removeChild(t), !n) throw Error("Copy command was rejected");
|
|
2130
2154
|
}
|
|
2131
|
-
async function
|
|
2155
|
+
async function m() {
|
|
2132
2156
|
try {
|
|
2133
2157
|
await p(n.text), c.value = !0, l && clearTimeout(l), l = setTimeout(() => {
|
|
2134
2158
|
c.value = !1;
|
|
@@ -2137,36 +2161,36 @@ var ln = ["aria-label", "aria-expanded"], un = { class: "flex flex-col h-full" }
|
|
|
2137
2161
|
a("error", e);
|
|
2138
2162
|
}
|
|
2139
2163
|
}
|
|
2140
|
-
return
|
|
2164
|
+
return y(() => {
|
|
2141
2165
|
l && clearTimeout(l);
|
|
2142
|
-
}), (t, n) => (
|
|
2166
|
+
}), (t, n) => (b(), o("button", {
|
|
2143
2167
|
type: "button",
|
|
2144
2168
|
title: u.value,
|
|
2145
2169
|
"aria-label": d.value,
|
|
2146
|
-
class:
|
|
2147
|
-
onClick:
|
|
2148
|
-
}, [c.value ? (
|
|
2170
|
+
class: h(f.value),
|
|
2171
|
+
onClick: m
|
|
2172
|
+
}, [c.value ? (b(), i(O(fe), {
|
|
2149
2173
|
key: 0,
|
|
2150
|
-
class:
|
|
2174
|
+
class: h(e.iconClass),
|
|
2151
2175
|
"aria-hidden": "true"
|
|
2152
|
-
}, null, 8, ["class"])) : (
|
|
2176
|
+
}, null, 8, ["class"])) : (b(), i(O(pe), {
|
|
2153
2177
|
key: 1,
|
|
2154
|
-
class:
|
|
2178
|
+
class: h(e.iconClass),
|
|
2155
2179
|
"aria-hidden": "true"
|
|
2156
|
-
}, null, 8, ["class"]))], 10,
|
|
2180
|
+
}, null, 8, ["class"]))], 10, Jn));
|
|
2157
2181
|
}
|
|
2158
|
-
}),
|
|
2182
|
+
}), Xn = ["disabled", "aria-busy"], Zn = {
|
|
2159
2183
|
key: 0,
|
|
2160
2184
|
class: "w-5 h-5 animate-spin shrink-0",
|
|
2161
2185
|
viewBox: "0 0 24 24",
|
|
2162
2186
|
fill: "none",
|
|
2163
2187
|
"aria-hidden": "true"
|
|
2164
|
-
},
|
|
2188
|
+
}, Qn = {
|
|
2165
2189
|
key: 1,
|
|
2166
2190
|
class: "w-5 h-5 shrink-0",
|
|
2167
2191
|
viewBox: "0 0 48 48",
|
|
2168
2192
|
"aria-hidden": "true"
|
|
2169
|
-
},
|
|
2193
|
+
}, $n = /* @__PURE__ */ f({
|
|
2170
2194
|
__name: "BaseGoogleSignInButton",
|
|
2171
2195
|
props: {
|
|
2172
2196
|
label: { default: "Sign in with Google" },
|
|
@@ -2185,17 +2209,17 @@ var ln = ["aria-label", "aria-expanded"], un = { class: "flex flex-col h-full" }
|
|
|
2185
2209
|
},
|
|
2186
2210
|
emits: ["click"],
|
|
2187
2211
|
setup(e, { emit: t }) {
|
|
2188
|
-
let n = e, i = t, { isDark: a } = z(),
|
|
2212
|
+
let n = e, i = t, { isDark: a } = z(), c = r(() => n.disabled || n.loading);
|
|
2189
2213
|
function u() {
|
|
2190
|
-
|
|
2214
|
+
c.value || i("click");
|
|
2191
2215
|
}
|
|
2192
|
-
return (t, n) => (
|
|
2216
|
+
return (t, n) => (b(), o("button", {
|
|
2193
2217
|
type: "button",
|
|
2194
|
-
disabled:
|
|
2218
|
+
disabled: c.value,
|
|
2195
2219
|
"aria-busy": e.loading,
|
|
2196
2220
|
onClick: u,
|
|
2197
|
-
class:
|
|
2198
|
-
}, [e.loading ? (
|
|
2221
|
+
class: h(["inline-flex items-center justify-center gap-3 h-11 px-4 rounded-lg border text-sm font-medium transition-colors cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-emerald-500 disabled:opacity-60 disabled:cursor-not-allowed", [e.block ? "w-full" : "", O(a) ? "bg-gray-900 border-gray-700 text-gray-100 hover:bg-gray-800" : "bg-white border-gray-300 text-gray-700 hover:bg-gray-50"]])
|
|
2222
|
+
}, [e.loading ? (b(), o("svg", Zn, [...n[0] ||= [s("circle", {
|
|
2199
2223
|
class: "opacity-25",
|
|
2200
2224
|
cx: "12",
|
|
2201
2225
|
cy: "12",
|
|
@@ -2206,18 +2230,18 @@ var ln = ["aria-label", "aria-expanded"], un = { class: "flex flex-col h-full" }
|
|
|
2206
2230
|
class: "opacity-75",
|
|
2207
2231
|
fill: "currentColor",
|
|
2208
2232
|
d: "M4 12a8 8 0 0 1 8-8V0C5.4 0 0 5.4 0 12h4z"
|
|
2209
|
-
}, null, -1)]])) : (
|
|
2233
|
+
}, null, -1)]])) : (b(), o("svg", Qn, [...n[1] ||= [l("<path fill=\"#EA4335\" d=\"M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z\"></path><path fill=\"#4285F4\" d=\"M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z\"></path><path fill=\"#FBBC05\" d=\"M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z\"></path><path fill=\"#34A853\" d=\"M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z\"></path><path fill=\"none\" d=\"M0 0h48v48H0z\"></path>", 5)]])), s("span", null, D(e.label), 1)], 10, Xn));
|
|
2210
2234
|
}
|
|
2211
|
-
}),
|
|
2235
|
+
}), er = {
|
|
2212
2236
|
key: 0,
|
|
2213
2237
|
class: "flex justify-center mb-6"
|
|
2214
|
-
},
|
|
2238
|
+
}, tr = { class: "mb-6 text-center" }, nr = { class: "flex items-center gap-3 my-5" }, rr = ["disabled"], ir = { class: "flex items-center justify-between mb-1.5" }, ar = { class: "relative" }, or = ["type", "disabled"], sr = ["aria-label", "aria-pressed"], cr = ["disabled"], lr = ["disabled", "aria-busy"], ur = {
|
|
2215
2239
|
key: 0,
|
|
2216
2240
|
class: "w-4 h-4 animate-spin",
|
|
2217
2241
|
viewBox: "0 0 24 24",
|
|
2218
2242
|
fill: "none",
|
|
2219
2243
|
"aria-hidden": "true"
|
|
2220
|
-
},
|
|
2244
|
+
}, dr = /* @__PURE__ */ f({
|
|
2221
2245
|
__name: "BaseLoginForm",
|
|
2222
2246
|
props: {
|
|
2223
2247
|
title: { default: "Sign in" },
|
|
@@ -2243,41 +2267,41 @@ var ln = ["aria-label", "aria-expanded"], un = { class: "flex flex-col h-full" }
|
|
|
2243
2267
|
},
|
|
2244
2268
|
emits: ["submit", "google-sign-in"],
|
|
2245
2269
|
setup(t, { emit: n }) {
|
|
2246
|
-
let i = t, c = n, { isDark:
|
|
2247
|
-
function
|
|
2270
|
+
let i = t, c = n, { isDark: l } = z(), f = J(), p = S(""), m = S(""), g = S(!1), _ = S(!1), v = r(() => i.loading || i.googleLoading);
|
|
2271
|
+
function y() {
|
|
2248
2272
|
v.value || c("submit", {
|
|
2249
2273
|
email: p.value,
|
|
2250
|
-
password:
|
|
2274
|
+
password: m.value,
|
|
2251
2275
|
...i.showRemember ? { remember: g.value } : {}
|
|
2252
2276
|
});
|
|
2253
2277
|
}
|
|
2254
|
-
return (n, r) => (
|
|
2255
|
-
n.$slots.logo ? (
|
|
2256
|
-
s("div",
|
|
2278
|
+
return (n, r) => (b(), o("div", { class: h(["w-full max-w-sm mx-auto rounded-xl border shadow-sm p-6 sm:p-8", O(f).card]) }, [
|
|
2279
|
+
n.$slots.logo ? (b(), o("div", er, [w(n.$slots, "logo")])) : a("", !0),
|
|
2280
|
+
s("div", tr, [s("h1", { class: h(["text-xl font-semibold", O(f).primaryText]) }, D(t.title), 3), t.subtitle ? (b(), o("p", {
|
|
2257
2281
|
key: 0,
|
|
2258
|
-
class:
|
|
2259
|
-
},
|
|
2260
|
-
t.error ? (
|
|
2282
|
+
class: h(["mt-1 text-sm", O(f).mutedText])
|
|
2283
|
+
}, D(t.subtitle), 3)) : a("", !0)]),
|
|
2284
|
+
t.error ? (b(), o("div", {
|
|
2261
2285
|
key: 1,
|
|
2262
2286
|
role: "alert",
|
|
2263
|
-
class:
|
|
2264
|
-
},
|
|
2265
|
-
t.showGoogle ? (
|
|
2287
|
+
class: h(["mb-4 rounded-lg border px-3 py-2 text-sm", O(l) ? "bg-red-500/10 border-red-500/30 text-red-300" : "bg-red-50 border-red-200 text-red-700"])
|
|
2288
|
+
}, D(t.error), 3)) : a("", !0),
|
|
2289
|
+
t.showGoogle ? (b(), o(e, { key: 2 }, [d($n, {
|
|
2266
2290
|
loading: t.googleLoading,
|
|
2267
2291
|
disabled: t.loading,
|
|
2268
2292
|
onClick: r[0] ||= (e) => c("google-sign-in")
|
|
2269
|
-
}, null, 8, ["loading", "disabled"]), s("div",
|
|
2270
|
-
s("span", { class:
|
|
2271
|
-
s("span", { class:
|
|
2272
|
-
s("span", { class:
|
|
2293
|
+
}, null, 8, ["loading", "disabled"]), s("div", nr, [
|
|
2294
|
+
s("span", { class: h(["h-px flex-1", O(l) ? "bg-gray-700" : "bg-gray-200"]) }, null, 2),
|
|
2295
|
+
s("span", { class: h(["text-xs uppercase tracking-wider", O(f).dimTextAlt]) }, "or", 2),
|
|
2296
|
+
s("span", { class: h(["h-px flex-1", O(l) ? "bg-gray-700" : "bg-gray-200"]) }, null, 2)
|
|
2273
2297
|
])], 64)) : a("", !0),
|
|
2274
2298
|
s("form", {
|
|
2275
2299
|
class: "space-y-4",
|
|
2276
|
-
onSubmit: F(
|
|
2300
|
+
onSubmit: F(y, ["prevent"])
|
|
2277
2301
|
}, [
|
|
2278
2302
|
s("div", null, [s("label", {
|
|
2279
2303
|
for: "login-email",
|
|
2280
|
-
class:
|
|
2304
|
+
class: h(["block mb-1.5 text-sm font-medium", O(f).label])
|
|
2281
2305
|
}, " Email ", 2), P(s("input", {
|
|
2282
2306
|
id: "login-email",
|
|
2283
2307
|
"onUpdate:modelValue": r[1] ||= (e) => p.value = e,
|
|
@@ -2287,43 +2311,43 @@ var ln = ["aria-label", "aria-expanded"], un = { class: "flex flex-col h-full" }
|
|
|
2287
2311
|
required: "",
|
|
2288
2312
|
disabled: v.value,
|
|
2289
2313
|
placeholder: "you@example.com",
|
|
2290
|
-
class:
|
|
2291
|
-
}, null, 10,
|
|
2292
|
-
s("div", null, [s("div",
|
|
2314
|
+
class: h(["w-full h-11 px-3 rounded-lg border text-sm transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-emerald-500 disabled:opacity-60", O(f).inputWithPlaceholder])
|
|
2315
|
+
}, null, 10, rr), [[j, p.value]])]),
|
|
2316
|
+
s("div", null, [s("div", ir, [s("label", {
|
|
2293
2317
|
for: "login-password",
|
|
2294
|
-
class:
|
|
2295
|
-
}, " Password ", 2),
|
|
2318
|
+
class: h(["block text-sm font-medium", O(f).label])
|
|
2319
|
+
}, " Password ", 2), w(n.$slots, "forgot")]), s("div", ar, [P(s("input", {
|
|
2296
2320
|
id: "login-password",
|
|
2297
|
-
"onUpdate:modelValue": r[2] ||= (e) =>
|
|
2321
|
+
"onUpdate:modelValue": r[2] ||= (e) => m.value = e,
|
|
2298
2322
|
type: _.value ? "text" : "password",
|
|
2299
2323
|
name: "password",
|
|
2300
2324
|
autocomplete: "current-password",
|
|
2301
2325
|
required: "",
|
|
2302
2326
|
disabled: v.value,
|
|
2303
2327
|
placeholder: "••••••••",
|
|
2304
|
-
class:
|
|
2305
|
-
}, null, 10,
|
|
2328
|
+
class: h(["w-full h-11 pl-3 pr-16 rounded-lg border text-sm transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-emerald-500 disabled:opacity-60", O(f).inputWithPlaceholder])
|
|
2329
|
+
}, null, 10, or), [[ee, m.value]]), s("button", {
|
|
2306
2330
|
type: "button",
|
|
2307
2331
|
onClick: r[3] ||= (e) => _.value = !_.value,
|
|
2308
2332
|
"aria-label": _.value ? "Hide password" : "Show password",
|
|
2309
2333
|
"aria-pressed": _.value,
|
|
2310
|
-
class:
|
|
2311
|
-
},
|
|
2312
|
-
t.showRemember ? (
|
|
2334
|
+
class: h(["absolute inset-y-0 right-0 px-3 text-xs font-medium cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-emerald-500 rounded-r-lg", O(f).mutedText])
|
|
2335
|
+
}, D(_.value ? "Hide" : "Show"), 11, sr)])]),
|
|
2336
|
+
t.showRemember ? (b(), o("label", {
|
|
2313
2337
|
key: 0,
|
|
2314
|
-
class:
|
|
2338
|
+
class: h(["flex items-center gap-2 text-sm cursor-pointer select-none", O(f).bodyText])
|
|
2315
2339
|
}, [P(s("input", {
|
|
2316
2340
|
"onUpdate:modelValue": r[4] ||= (e) => g.value = e,
|
|
2317
2341
|
type: "checkbox",
|
|
2318
2342
|
disabled: v.value,
|
|
2319
2343
|
class: "w-4 h-4 rounded border-gray-300 text-emerald-600 focus:ring-emerald-500"
|
|
2320
|
-
}, null, 8,
|
|
2344
|
+
}, null, 8, cr), [[A, g.value]]), r[5] ||= u(" Remember me ", -1)], 2)) : a("", !0),
|
|
2321
2345
|
s("button", {
|
|
2322
2346
|
type: "submit",
|
|
2323
2347
|
disabled: v.value,
|
|
2324
2348
|
"aria-busy": t.loading,
|
|
2325
2349
|
class: "inline-flex items-center justify-center gap-2 w-full h-11 px-4 rounded-lg text-sm font-semibold text-white bg-emerald-600 hover:bg-emerald-700 transition-colors cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-emerald-500 disabled:opacity-60 disabled:cursor-not-allowed"
|
|
2326
|
-
}, [t.loading ? (
|
|
2350
|
+
}, [t.loading ? (b(), o("svg", ur, [...r[6] ||= [s("circle", {
|
|
2327
2351
|
class: "opacity-25",
|
|
2328
2352
|
cx: "12",
|
|
2329
2353
|
cy: "12",
|
|
@@ -2334,18 +2358,18 @@ var ln = ["aria-label", "aria-expanded"], un = { class: "flex flex-col h-full" }
|
|
|
2334
2358
|
class: "opacity-75",
|
|
2335
2359
|
fill: "currentColor",
|
|
2336
2360
|
d: "M4 12a8 8 0 0 1 8-8V0C5.4 0 0 5.4 0 12h4z"
|
|
2337
|
-
}, null, -1)]])) : a("", !0),
|
|
2361
|
+
}, null, -1)]])) : a("", !0), u(" " + D(t.submitLabel), 1)], 8, lr)
|
|
2338
2362
|
], 32),
|
|
2339
|
-
n.$slots.footer ? (
|
|
2363
|
+
n.$slots.footer ? (b(), o("div", {
|
|
2340
2364
|
key: 3,
|
|
2341
|
-
class:
|
|
2342
|
-
}, [
|
|
2365
|
+
class: h(["mt-6 text-center text-sm", O(f).mutedText])
|
|
2366
|
+
}, [w(n.$slots, "footer")], 2)) : a("", !0)
|
|
2343
2367
|
], 2));
|
|
2344
2368
|
}
|
|
2345
|
-
}),
|
|
2369
|
+
}), fr = ["aria-label"], pr = { class: "flex-1 overflow-y-auto" }, mr = {
|
|
2346
2370
|
key: 0,
|
|
2347
2371
|
class: "flex flex-col items-center justify-center text-center px-6 py-16 gap-3"
|
|
2348
|
-
},
|
|
2372
|
+
}, hr = ["onClick"], gr = { class: "min-w-0 flex-1" }, _r = { class: "flex items-baseline justify-between gap-2" }, vr = /* @__PURE__ */ f({
|
|
2349
2373
|
__name: "BaseNotificationPanel",
|
|
2350
2374
|
props: {
|
|
2351
2375
|
title: { default: "Notifications" },
|
|
@@ -2356,86 +2380,86 @@ var ln = ["aria-label", "aria-expanded"], un = { class: "flex flex-col h-full" }
|
|
|
2356
2380
|
}
|
|
2357
2381
|
},
|
|
2358
2382
|
emits: ["select"],
|
|
2359
|
-
setup(c, { emit:
|
|
2360
|
-
let f =
|
|
2383
|
+
setup(c, { emit: l }) {
|
|
2384
|
+
let f = l, { isDark: p } = z(), m = J(), { notifications: g, unreadCount: _, open: v, closePanel: y, markAllRead: x, markRead: S } = un(), w = {
|
|
2361
2385
|
info: "bg-sky-500",
|
|
2362
2386
|
success: "bg-emerald-500",
|
|
2363
2387
|
warning: "bg-amber-500",
|
|
2364
2388
|
error: "bg-red-500"
|
|
2365
2389
|
}, T = r(() => g.value.length);
|
|
2366
|
-
function
|
|
2367
|
-
|
|
2390
|
+
function E(e) {
|
|
2391
|
+
S(e), f("select", e);
|
|
2368
2392
|
}
|
|
2369
|
-
return
|
|
2370
|
-
v.value &&
|
|
2371
|
-
}), (r,
|
|
2393
|
+
return Mt(() => {
|
|
2394
|
+
v.value && y();
|
|
2395
|
+
}), (r, l) => (b(), i(t, { to: "body" }, [d(n, {
|
|
2372
2396
|
"enter-active-class": "transition-opacity duration-200",
|
|
2373
2397
|
"enter-from-class": "opacity-0",
|
|
2374
2398
|
"leave-active-class": "transition-opacity duration-200",
|
|
2375
2399
|
"leave-to-class": "opacity-0"
|
|
2376
2400
|
}, {
|
|
2377
|
-
default: N(() => [
|
|
2401
|
+
default: N(() => [O(v) ? (b(), o("div", {
|
|
2378
2402
|
key: 0,
|
|
2379
2403
|
class: "fixed inset-0 z-[60] bg-black/50",
|
|
2380
2404
|
"aria-hidden": "true",
|
|
2381
|
-
onClick:
|
|
2405
|
+
onClick: l[0] ||= (...e) => O(y) && O(y)(...e)
|
|
2382
2406
|
})) : a("", !0)]),
|
|
2383
2407
|
_: 1
|
|
2384
|
-
}),
|
|
2408
|
+
}), d(n, {
|
|
2385
2409
|
"enter-active-class": "transition-transform duration-300 ease-out",
|
|
2386
2410
|
"enter-from-class": "-translate-x-full",
|
|
2387
2411
|
"leave-active-class": "transition-transform duration-300 ease-in",
|
|
2388
2412
|
"leave-to-class": "-translate-x-full"
|
|
2389
2413
|
}, {
|
|
2390
|
-
default: N(() => [
|
|
2414
|
+
default: N(() => [O(v) ? (b(), o("aside", {
|
|
2391
2415
|
key: 0,
|
|
2392
2416
|
role: "dialog",
|
|
2393
2417
|
"aria-modal": "true",
|
|
2394
2418
|
"aria-label": c.title,
|
|
2395
|
-
class:
|
|
2419
|
+
class: h(["fixed top-0 left-0 z-[70] h-screen w-full max-w-sm flex flex-col border-r shadow-xl", O(p) ? "bg-gray-900 border-gray-800" : "bg-white border-gray-200"])
|
|
2396
2420
|
}, [
|
|
2397
|
-
s("div", { class:
|
|
2421
|
+
s("div", { class: h(["flex items-center justify-between gap-3 px-5 py-4 border-b shrink-0", O(m).border]) }, [s("h2", { class: h(["text-lg font-semibold flex items-center gap-2", O(m).primaryText]) }, [u(D(c.title) + " ", 1), s("span", { class: h(["text-sm font-normal", O(m).dimTextAlt]) }, "— " + D(T.value), 3)], 2), s("button", {
|
|
2398
2422
|
type: "button",
|
|
2399
|
-
onClick:
|
|
2423
|
+
onClick: l[1] ||= (...e) => O(y) && O(y)(...e),
|
|
2400
2424
|
"aria-label": "Close notifications",
|
|
2401
|
-
class:
|
|
2402
|
-
}, [
|
|
2425
|
+
class: h(["p-1.5 rounded-lg cursor-pointer transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-emerald-500", O(p) ? "text-gray-400 hover:bg-gray-800" : "text-gray-500 hover:bg-gray-100"])
|
|
2426
|
+
}, [d(O(Ce), {
|
|
2403
2427
|
class: "w-5 h-5",
|
|
2404
2428
|
"aria-hidden": "true"
|
|
2405
2429
|
})], 2)], 2),
|
|
2406
|
-
c.showMarkAllRead &&
|
|
2430
|
+
c.showMarkAllRead && O(_) > 0 ? (b(), o("div", {
|
|
2407
2431
|
key: 0,
|
|
2408
|
-
class:
|
|
2432
|
+
class: h(["px-5 py-2 border-b shrink-0 flex justify-end", O(m).border])
|
|
2409
2433
|
}, [s("button", {
|
|
2410
2434
|
type: "button",
|
|
2411
|
-
onClick:
|
|
2412
|
-
class:
|
|
2435
|
+
onClick: l[2] ||= (...e) => O(x) && O(x)(...e),
|
|
2436
|
+
class: h(["text-xs font-medium cursor-pointer transition-colors focus:outline-none focus-visible:underline", O(m).emeraldText])
|
|
2413
2437
|
}, " Mark all as read ", 2)], 2)) : a("", !0),
|
|
2414
|
-
s("div",
|
|
2415
|
-
class:
|
|
2438
|
+
s("div", pr, [T.value === 0 ? (b(), o("div", mr, [d(O(oe), {
|
|
2439
|
+
class: h(["w-10 h-10", O(m).illustration]),
|
|
2416
2440
|
"aria-hidden": "true"
|
|
2417
|
-
}, null, 8, ["class"]), s("p", { class:
|
|
2441
|
+
}, null, 8, ["class"]), s("p", { class: h(["text-sm", O(m).mutedText]) }, D(c.emptyText), 3)])) : (b(), o("ul", {
|
|
2418
2442
|
key: 1,
|
|
2419
|
-
class:
|
|
2420
|
-
}, [(
|
|
2443
|
+
class: h(["divide-y", O(p) ? "divide-gray-800" : "divide-gray-100"])
|
|
2444
|
+
}, [(b(!0), o(e, null, C(O(g), (e) => (b(), o("li", { key: e.id }, [s("button", {
|
|
2421
2445
|
type: "button",
|
|
2422
|
-
onClick: (t) =>
|
|
2423
|
-
class:
|
|
2446
|
+
onClick: (t) => E(e.id),
|
|
2447
|
+
class: h(["w-full text-left px-5 py-4 flex gap-3 transition-colors cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-emerald-500", [e.read ? "" : O(p) ? "bg-emerald-500/5" : "bg-emerald-50/60", O(p) ? "hover:bg-gray-800" : "hover:bg-gray-50"]])
|
|
2424
2448
|
}, [s("span", {
|
|
2425
|
-
class:
|
|
2449
|
+
class: h(["mt-1.5 w-2 h-2 rounded-full shrink-0", e.read ? O(p) ? "bg-gray-700" : "bg-gray-300" : w[e.type ?? "info"]]),
|
|
2426
2450
|
"aria-hidden": "true"
|
|
2427
|
-
}, null, 2), s("span",
|
|
2451
|
+
}, null, 2), s("span", gr, [s("span", _r, [s("span", { class: h(["text-sm truncate", [e.read ? "font-medium" : "font-semibold", O(m).primaryTextSoft]]) }, D(e.title), 3), e.time ? (b(), o("span", {
|
|
2428
2452
|
key: 0,
|
|
2429
|
-
class:
|
|
2430
|
-
},
|
|
2453
|
+
class: h(["text-xs shrink-0", O(m).dimText])
|
|
2454
|
+
}, D(e.time), 3)) : a("", !0)]), e.message ? (b(), o("span", {
|
|
2431
2455
|
key: 0,
|
|
2432
|
-
class:
|
|
2433
|
-
},
|
|
2434
|
-
], 10,
|
|
2456
|
+
class: h(["mt-0.5 block text-sm", O(m).mutedText])
|
|
2457
|
+
}, D(e.message), 3)) : a("", !0)])], 10, hr)]))), 128))], 2))])
|
|
2458
|
+
], 10, fr)) : a("", !0)]),
|
|
2435
2459
|
_: 1
|
|
2436
2460
|
})]));
|
|
2437
2461
|
}
|
|
2438
|
-
}),
|
|
2462
|
+
}), yr = ["disabled"], br = /* @__PURE__ */ f({
|
|
2439
2463
|
__name: "BaseChipButton",
|
|
2440
2464
|
props: {
|
|
2441
2465
|
size: { default: "sm" },
|
|
@@ -2447,29 +2471,29 @@ var ln = ["aria-label", "aria-expanded"], un = { class: "flex flex-col h-full" }
|
|
|
2447
2471
|
emits: ["click"],
|
|
2448
2472
|
setup(e, { emit: t }) {
|
|
2449
2473
|
let n = t, { isDark: r } = z();
|
|
2450
|
-
return (t, i) => (
|
|
2474
|
+
return (t, i) => (b(), o("button", {
|
|
2451
2475
|
type: "button",
|
|
2452
2476
|
disabled: e.disabled,
|
|
2453
|
-
class:
|
|
2477
|
+
class: h(["inline-flex items-center gap-1 font-medium rounded-md border transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed focus:outline-none focus-visible:ring-2 focus-visible:ring-emerald-500", [e.size === "xs" ? "text-xs px-2 py-0.5" : "text-xs px-2.5 py-1", O(r) ? "text-emerald-300 border-emerald-700 bg-emerald-900/30 hover:bg-emerald-800/50" : "text-emerald-700 border-emerald-200 bg-emerald-50 hover:bg-emerald-100"]]),
|
|
2454
2478
|
onClick: i[0] ||= (e) => n("click")
|
|
2455
|
-
}, [
|
|
2479
|
+
}, [w(t.$slots, "default")], 10, yr));
|
|
2456
2480
|
}
|
|
2457
|
-
}),
|
|
2481
|
+
}), xr = /* @__PURE__ */ f({
|
|
2458
2482
|
__name: "BaseRemoveButton",
|
|
2459
2483
|
emits: ["click"],
|
|
2460
2484
|
setup(e, { emit: t }) {
|
|
2461
2485
|
let n = t;
|
|
2462
|
-
return (e, t) => (
|
|
2486
|
+
return (e, t) => (b(), o("button", {
|
|
2463
2487
|
type: "button",
|
|
2464
2488
|
class: "px-2 text-lg leading-none text-red-400 hover:text-red-600 transition-colors cursor-pointer rounded focus:outline-none focus-visible:ring-2 focus-visible:ring-red-400 disabled:cursor-not-allowed disabled:text-gray-400 disabled:hover:text-gray-400",
|
|
2465
2489
|
onClick: t[0] ||= (e) => n("click")
|
|
2466
2490
|
}, " × "));
|
|
2467
2491
|
}
|
|
2468
|
-
}),
|
|
2492
|
+
}), Sr = { class: "relative flex h-2 w-2" }, Cr = {
|
|
2469
2493
|
key: 0,
|
|
2470
2494
|
class: "animate-ping absolute inline-flex h-full w-full rounded-full bg-emerald-400 opacity-75",
|
|
2471
2495
|
"aria-hidden": "true"
|
|
2472
|
-
},
|
|
2496
|
+
}, wr = /* @__PURE__ */ f({
|
|
2473
2497
|
__name: "BaseStatusPill",
|
|
2474
2498
|
props: {
|
|
2475
2499
|
status: {},
|
|
@@ -2489,9 +2513,76 @@ var ln = ["aria-label", "aria-expanded"], un = { class: "flex flex-col h-full" }
|
|
|
2489
2513
|
default: return "bg-gray-400";
|
|
2490
2514
|
}
|
|
2491
2515
|
});
|
|
2492
|
-
return (t, n) => (
|
|
2493
|
-
}
|
|
2494
|
-
}),
|
|
2516
|
+
return (t, n) => (b(), o("div", { class: h(["flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs", i.value]) }, [s("span", Sr, [e.status === "ok" ? (b(), o("span", Cr)) : a("", !0), s("span", { class: h(["relative inline-flex rounded-full h-2 w-2", c.value]) }, null, 2)]), u(" " + D(e.label), 1)], 2));
|
|
2517
|
+
}
|
|
2518
|
+
}), Tr = { class: "text-sm font-medium" }, Er = [
|
|
2519
|
+
"accept",
|
|
2520
|
+
"multiple",
|
|
2521
|
+
"disabled"
|
|
2522
|
+
], Dr = /* @__PURE__ */ f({
|
|
2523
|
+
__name: "BaseFileDropzone",
|
|
2524
|
+
props: {
|
|
2525
|
+
label: {},
|
|
2526
|
+
hint: { default: "" },
|
|
2527
|
+
accept: { default: "" },
|
|
2528
|
+
multiple: {
|
|
2529
|
+
type: Boolean,
|
|
2530
|
+
default: !1
|
|
2531
|
+
},
|
|
2532
|
+
disabled: {
|
|
2533
|
+
type: Boolean,
|
|
2534
|
+
default: !1
|
|
2535
|
+
}
|
|
2536
|
+
},
|
|
2537
|
+
emits: ["files"],
|
|
2538
|
+
setup(e, { emit: t }) {
|
|
2539
|
+
let n = e, r = t, { isDark: i } = z(), c = S(!1);
|
|
2540
|
+
function l(e) {
|
|
2541
|
+
let t = e.target, n = Array.from(t.files ?? []);
|
|
2542
|
+
t.value = "", n.length && r("files", n);
|
|
2543
|
+
}
|
|
2544
|
+
function u() {
|
|
2545
|
+
n.disabled || (c.value = !0);
|
|
2546
|
+
}
|
|
2547
|
+
function d(e) {
|
|
2548
|
+
if (c.value = !1, n.disabled) return;
|
|
2549
|
+
let t = Array.from(e.dataTransfer?.files ?? []);
|
|
2550
|
+
t.length && r("files", n.multiple ? t : t.slice(0, 1));
|
|
2551
|
+
}
|
|
2552
|
+
return (t, n) => (b(), o("label", {
|
|
2553
|
+
class: h(["flex flex-col items-center justify-center gap-2 rounded-lg border-2 border-dashed px-6 py-10 text-center transition-colors", [e.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer", c.value ? O(i) ? "border-emerald-500 text-emerald-400" : "border-emerald-500 text-emerald-600" : O(i) ? "border-gray-700 hover:border-emerald-500 text-gray-400 hover:text-emerald-400" : "border-gray-300 hover:border-emerald-500 text-gray-500 hover:text-emerald-600"]]),
|
|
2554
|
+
onDragover: F(u, ["prevent"]),
|
|
2555
|
+
onDragleave: n[0] ||= F((e) => c.value = !1, ["prevent"]),
|
|
2556
|
+
onDrop: F(d, ["prevent"])
|
|
2557
|
+
}, [
|
|
2558
|
+
w(t.$slots, "icon", {}, () => [n[1] ||= s("svg", {
|
|
2559
|
+
class: "w-10 h-10",
|
|
2560
|
+
fill: "none",
|
|
2561
|
+
viewBox: "0 0 24 24",
|
|
2562
|
+
stroke: "currentColor",
|
|
2563
|
+
"stroke-width": "1.5",
|
|
2564
|
+
"aria-hidden": "true"
|
|
2565
|
+
}, [s("path", {
|
|
2566
|
+
"stroke-linecap": "round",
|
|
2567
|
+
"stroke-linejoin": "round",
|
|
2568
|
+
d: "M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m6.75 12-3-3m0 0-3 3m3-3v6m-1.5-15H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"
|
|
2569
|
+
})], -1)]),
|
|
2570
|
+
s("p", Tr, D(e.label), 1),
|
|
2571
|
+
e.hint ? (b(), o("p", {
|
|
2572
|
+
key: 0,
|
|
2573
|
+
class: h(["text-xs", O(i) ? "text-gray-500" : "text-gray-400"])
|
|
2574
|
+
}, D(e.hint), 3)) : a("", !0),
|
|
2575
|
+
s("input", {
|
|
2576
|
+
type: "file",
|
|
2577
|
+
class: "hidden",
|
|
2578
|
+
accept: e.accept,
|
|
2579
|
+
multiple: e.multiple,
|
|
2580
|
+
disabled: e.disabled,
|
|
2581
|
+
onChange: l
|
|
2582
|
+
}, null, 40, Er)
|
|
2583
|
+
], 34));
|
|
2584
|
+
}
|
|
2585
|
+
}), Or = ["value", "type"], Q = /* @__PURE__ */ f({
|
|
2495
2586
|
__name: "BaseInput",
|
|
2496
2587
|
props: {
|
|
2497
2588
|
modelValue: { default: "" },
|
|
@@ -2508,14 +2599,14 @@ var ln = ["aria-label", "aria-expanded"], un = { class: "flex flex-col h-full" }
|
|
|
2508
2599
|
function r(e) {
|
|
2509
2600
|
n("update:modelValue", e.target.value);
|
|
2510
2601
|
}
|
|
2511
|
-
return (t, n) => (
|
|
2602
|
+
return (t, n) => (b(), o("input", {
|
|
2512
2603
|
value: e.modelValue,
|
|
2513
2604
|
type: e.type,
|
|
2514
|
-
class:
|
|
2605
|
+
class: h(["rounded border border-slate-300 dark:border-slate-600 bg-slate-50 dark:bg-slate-900 text-slate-900 dark:text-slate-100 text-sm placeholder:text-slate-400 dark:placeholder:text-slate-500 transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-emerald-500 focus-visible:border-emerald-500 disabled:opacity-60 disabled:cursor-not-allowed", [e.block ? "w-full" : "", e.size === "sm" ? "px-2 py-1.5" : "px-3 py-2"]]),
|
|
2515
2606
|
onInput: r
|
|
2516
|
-
}, null, 42,
|
|
2607
|
+
}, null, 42, Or));
|
|
2517
2608
|
}
|
|
2518
|
-
}),
|
|
2609
|
+
}), kr = ["value"], Ar = /* @__PURE__ */ f({
|
|
2519
2610
|
__name: "BaseSelect",
|
|
2520
2611
|
props: {
|
|
2521
2612
|
modelValue: { default: void 0 },
|
|
@@ -2531,17 +2622,17 @@ var ln = ["aria-label", "aria-expanded"], un = { class: "flex flex-col h-full" }
|
|
|
2531
2622
|
function r(e) {
|
|
2532
2623
|
n("update:modelValue", e.target.value);
|
|
2533
2624
|
}
|
|
2534
|
-
return (t, n) => (
|
|
2625
|
+
return (t, n) => (b(), o("select", {
|
|
2535
2626
|
value: e.modelValue,
|
|
2536
|
-
class:
|
|
2627
|
+
class: h(["rounded border border-slate-300 dark:border-slate-600 bg-slate-50 dark:bg-slate-900 text-slate-900 dark:text-slate-100 text-sm cursor-pointer transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-emerald-500 focus-visible:border-emerald-500 disabled:opacity-60 disabled:cursor-not-allowed", [e.block ? "w-full" : "", e.size === "md" ? "px-3 py-2" : "px-2 py-1.5"]]),
|
|
2537
2628
|
onChange: r
|
|
2538
|
-
}, [
|
|
2629
|
+
}, [w(t.$slots, "default")], 42, kr));
|
|
2539
2630
|
}
|
|
2540
|
-
}),
|
|
2631
|
+
}), jr = [
|
|
2541
2632
|
"disabled",
|
|
2542
2633
|
"aria-label",
|
|
2543
2634
|
"aria-expanded"
|
|
2544
|
-
],
|
|
2635
|
+
], Mr = ["aria-label"], Nr = ["aria-selected", "title"], Pr = ["disabled", "onClick"], Fr = /* @__PURE__ */ f({
|
|
2545
2636
|
__name: "BaseDropdown",
|
|
2546
2637
|
props: {
|
|
2547
2638
|
options: {},
|
|
@@ -2562,43 +2653,43 @@ var ln = ["aria-label", "aria-expanded"], un = { class: "flex flex-col h-full" }
|
|
|
2562
2653
|
},
|
|
2563
2654
|
emits: ["update:modelValue"],
|
|
2564
2655
|
setup(t, { emit: n }) {
|
|
2565
|
-
let i = t, c = n, l =
|
|
2566
|
-
function
|
|
2656
|
+
let i = t, c = n, l = S(!1), u = S(null), f = r(() => i.options.find((e) => e.value === i.modelValue) ?? null), p = r(() => i.triggerClass ? "flex items-center justify-between gap-2 text-left transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-emerald-500 cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed " + i.triggerClass : "flex items-center justify-between gap-2 text-left transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-emerald-500 cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed rounded-lg border text-sm border-slate-300 dark:border-slate-600 bg-white dark:bg-slate-900 text-slate-700 dark:text-slate-100 hover:bg-slate-50 dark:hover:bg-slate-800 " + (i.size === "sm" ? "px-3 py-2" : "px-4 py-2.5"));
|
|
2657
|
+
function m(e) {
|
|
2567
2658
|
return `block w-full px-4 py-2 text-left text-sm transition-colors cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-emerald-500 disabled:opacity-50 disabled:cursor-not-allowed ${e.value === i.modelValue ? "bg-emerald-500 text-white" : "text-slate-700 dark:text-slate-200 hover:bg-slate-100 dark:hover:bg-slate-800"}`;
|
|
2568
2659
|
}
|
|
2569
2660
|
function v() {
|
|
2570
2661
|
i.disabled || (l.value = !l.value);
|
|
2571
2662
|
}
|
|
2572
|
-
function
|
|
2663
|
+
function y(e) {
|
|
2573
2664
|
e.disabled || (c("update:modelValue", e.value), l.value = !1);
|
|
2574
2665
|
}
|
|
2575
|
-
|
|
2666
|
+
Mt(() => {
|
|
2576
2667
|
l.value = !1;
|
|
2577
2668
|
});
|
|
2578
|
-
function
|
|
2579
|
-
l.value &&
|
|
2669
|
+
function x(e) {
|
|
2670
|
+
l.value && u.value && !u.value.contains(e.target) && (l.value = !1);
|
|
2580
2671
|
}
|
|
2581
|
-
return
|
|
2672
|
+
return _(() => document.addEventListener("click", x)), g(() => document.removeEventListener("click", x)), (n, r) => (b(), o("div", {
|
|
2582
2673
|
ref_key: "rootEl",
|
|
2583
|
-
ref:
|
|
2584
|
-
class:
|
|
2674
|
+
ref: u,
|
|
2675
|
+
class: h(t.block ? "relative w-full" : "relative inline-block")
|
|
2585
2676
|
}, [s("button", {
|
|
2586
2677
|
type: "button",
|
|
2587
|
-
class:
|
|
2678
|
+
class: h([p.value, t.block ? "w-full" : ""]),
|
|
2588
2679
|
disabled: t.disabled,
|
|
2589
2680
|
"aria-label": t.ariaLabel || void 0,
|
|
2590
2681
|
"aria-haspopup": "listbox",
|
|
2591
2682
|
"aria-expanded": l.value,
|
|
2592
2683
|
onClick: v
|
|
2593
|
-
}, [s("span", { class:
|
|
2594
|
-
class:
|
|
2684
|
+
}, [s("span", { class: h(["min-w-0 truncate", f.value ? "" : "text-slate-400 dark:text-slate-500"]) }, D(f.value ? f.value.label : t.placeholder), 3), d(O(ue), {
|
|
2685
|
+
class: h(["shrink-0 transition-transform", [t.chevronClass, l.value ? "rotate-180" : ""]]),
|
|
2595
2686
|
"aria-hidden": "true"
|
|
2596
|
-
}, null, 8, ["class"])], 10,
|
|
2687
|
+
}, null, 8, ["class"])], 10, jr), l.value ? (b(), o("ul", {
|
|
2597
2688
|
key: 0,
|
|
2598
2689
|
role: "listbox",
|
|
2599
2690
|
"aria-label": t.ariaLabel || t.placeholder,
|
|
2600
2691
|
class: "absolute z-20 mt-1 w-full min-w-max max-w-xs max-h-60 overflow-auto rounded-lg border border-slate-300 dark:border-slate-600 bg-white dark:bg-slate-900 py-1 shadow-lg focus:outline-none"
|
|
2601
|
-
}, [(
|
|
2692
|
+
}, [(b(!0), o(e, null, C(t.options, (e) => (b(), o("li", {
|
|
2602
2693
|
key: String(e.value),
|
|
2603
2694
|
role: "option",
|
|
2604
2695
|
"aria-selected": e.value === t.modelValue,
|
|
@@ -2606,15 +2697,15 @@ var ln = ["aria-label", "aria-expanded"], un = { class: "flex flex-col h-full" }
|
|
|
2606
2697
|
}, [s("button", {
|
|
2607
2698
|
type: "button",
|
|
2608
2699
|
disabled: e.disabled,
|
|
2609
|
-
class: m(
|
|
2610
|
-
onClick: (t) =>
|
|
2611
|
-
},
|
|
2700
|
+
class: h(m(e)),
|
|
2701
|
+
onClick: (t) => y(e)
|
|
2702
|
+
}, D(e.label), 11, Pr)], 8, Nr))), 128))], 8, Mr)) : a("", !0)], 2));
|
|
2612
2703
|
}
|
|
2613
|
-
}),
|
|
2704
|
+
}), Ir = ["role", "aria-label"], Lr = [
|
|
2614
2705
|
"aria-pressed",
|
|
2615
2706
|
"title",
|
|
2616
2707
|
"onClick"
|
|
2617
|
-
],
|
|
2708
|
+
], Rr = "bg-slate-50 dark:bg-slate-900 text-slate-600 dark:text-slate-300 hover:bg-slate-100 dark:hover:bg-slate-800", zr = /* @__PURE__ */ f({
|
|
2618
2709
|
__name: "BaseSegmentedControl",
|
|
2619
2710
|
props: {
|
|
2620
2711
|
options: {},
|
|
@@ -2631,22 +2722,22 @@ var ln = ["aria-label", "aria-expanded"], un = { class: "flex flex-col h-full" }
|
|
|
2631
2722
|
let i = t, a = n, s = r(() => i.variant === "toolbar" ? "inline-flex h-9 divide-x divide-slate-300 dark:divide-slate-600 rounded-md border border-slate-300 dark:border-slate-600 overflow-hidden" : "inline-flex rounded border border-slate-300 dark:border-slate-600 overflow-hidden"), c = r(() => i.variant === "toolbar" ? "flex items-center px-3.5 text-xs font-semibold uppercase tracking-wide transition-colors cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-emerald-500" : `${i.variant === "wide" ? "px-4 py-2" : "px-3 py-2"} text-sm font-medium transition-colors cursor-pointer border-l first:border-l-0 border-slate-300 dark:border-slate-600 focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-emerald-500`), l = r(() => i.variant === "wide" ? "bg-emerald-600 text-white" : "bg-emerald-500 text-white");
|
|
2632
2723
|
function u(e) {
|
|
2633
2724
|
let t = e.value === i.modelValue;
|
|
2634
|
-
return i.optionClass ? i.optionClass(e, t) : t ? l.value :
|
|
2725
|
+
return i.optionClass ? i.optionClass(e, t) : t ? l.value : Rr;
|
|
2635
2726
|
}
|
|
2636
|
-
return (n, r) => (
|
|
2727
|
+
return (n, r) => (b(), o("div", {
|
|
2637
2728
|
role: t.ariaLabel ? "group" : void 0,
|
|
2638
2729
|
"aria-label": t.ariaLabel || void 0,
|
|
2639
|
-
class:
|
|
2640
|
-
}, [(
|
|
2730
|
+
class: h(s.value)
|
|
2731
|
+
}, [(b(!0), o(e, null, C(t.options, (e) => (b(), o("button", {
|
|
2641
2732
|
key: String(e.value),
|
|
2642
2733
|
type: "button",
|
|
2643
|
-
class:
|
|
2734
|
+
class: h([c.value, u(e)]),
|
|
2644
2735
|
"aria-pressed": e.value === t.modelValue,
|
|
2645
2736
|
title: e.title,
|
|
2646
2737
|
onClick: (t) => a("update:modelValue", e.value)
|
|
2647
|
-
},
|
|
2738
|
+
}, D(e.label), 11, Lr))), 128))], 10, Ir));
|
|
2648
2739
|
}
|
|
2649
|
-
}),
|
|
2740
|
+
}), Br = { class: "w-full text-sm" }, Vr = { class: "bg-slate-50 dark:bg-slate-800/60 text-slate-600 dark:text-slate-300" }, Hr = { class: "text-left" }, Ur = { key: 0 }, Wr = ["colspan"], Gr = /* @__PURE__ */ f({
|
|
2650
2741
|
__name: "BaseTable",
|
|
2651
2742
|
props: {
|
|
2652
2743
|
columns: {},
|
|
@@ -2657,24 +2748,24 @@ var ln = ["aria-label", "aria-expanded"], un = { class: "flex flex-col h-full" }
|
|
|
2657
2748
|
emptyText: { default: "No rows." }
|
|
2658
2749
|
},
|
|
2659
2750
|
setup(t) {
|
|
2660
|
-
return (n, r) => (
|
|
2751
|
+
return (n, r) => (b(), o("table", Br, [s("thead", Vr, [s("tr", Hr, [(b(!0), o(e, null, C(t.columns, (e, t) => (b(), o("th", {
|
|
2661
2752
|
key: t,
|
|
2662
|
-
class:
|
|
2663
|
-
},
|
|
2753
|
+
class: h(["px-4 py-3", e.align === "right" ? "text-right" : ""])
|
|
2754
|
+
}, D(e.label), 3))), 128))])]), s("tbody", null, [t.empty ? (b(), o("tr", Ur, [s("td", {
|
|
2664
2755
|
colspan: t.columns.length,
|
|
2665
2756
|
class: "px-4 py-12 text-center text-slate-500"
|
|
2666
|
-
}, [
|
|
2757
|
+
}, [w(n.$slots, "empty", {}, () => [u(D(t.emptyText), 1)])], 8, Wr)])) : a("", !0), w(n.$slots, "default")])]));
|
|
2667
2758
|
}
|
|
2668
|
-
}),
|
|
2759
|
+
}), Kr = { class: "grid gap-3 md:grid-cols-2" }, qr = {
|
|
2669
2760
|
key: 0,
|
|
2670
2761
|
class: "block text-[11px] uppercase tracking-wide text-slate-500 mb-1"
|
|
2671
|
-
},
|
|
2762
|
+
}, Jr = ["value"], Yr = {
|
|
2672
2763
|
key: 2,
|
|
2673
2764
|
class: "flex items-center gap-2 mt-4"
|
|
2674
|
-
},
|
|
2765
|
+
}, Xr = ["checked", "onChange"], Zr = { class: "text-sm text-slate-900 dark:text-slate-100" }, Qr = {
|
|
2675
2766
|
key: 4,
|
|
2676
2767
|
class: "text-[11px] text-slate-400 mt-1"
|
|
2677
|
-
},
|
|
2768
|
+
}, $r = /* @__PURE__ */ f({
|
|
2678
2769
|
__name: "BaseSpecFields",
|
|
2679
2770
|
props: {
|
|
2680
2771
|
specs: {},
|
|
@@ -2690,24 +2781,24 @@ var ln = ["aria-label", "aria-expanded"], un = { class: "flex flex-col h-full" }
|
|
|
2690
2781
|
let n = parseFloat(t);
|
|
2691
2782
|
r("update", e, Number.isNaN(n) ? t : n);
|
|
2692
2783
|
}
|
|
2693
|
-
return (n, u) => (
|
|
2694
|
-
u.type === "boolean" ? a("", !0) : (
|
|
2695
|
-
u.type === "select" ? (
|
|
2784
|
+
return (n, u) => (b(), o("div", Kr, [(b(!0), o(e, null, C(t.specs, (u) => (b(), o("div", { key: u.key }, [
|
|
2785
|
+
u.type === "boolean" ? a("", !0) : (b(), o("label", qr, D(u.label), 1)),
|
|
2786
|
+
u.type === "select" ? (b(), i(Ar, {
|
|
2696
2787
|
key: 1,
|
|
2697
2788
|
modelValue: String(t.params[u.key] ?? ""),
|
|
2698
2789
|
"onUpdate:modelValue": (e) => r("update", u.key, e)
|
|
2699
2790
|
}, {
|
|
2700
|
-
default: N(() => [(
|
|
2791
|
+
default: N(() => [(b(!0), o(e, null, C(u.options ?? [], (e) => (b(), o("option", {
|
|
2701
2792
|
key: e,
|
|
2702
2793
|
value: e
|
|
2703
|
-
},
|
|
2794
|
+
}, D(e), 9, Jr))), 128))]),
|
|
2704
2795
|
_: 2
|
|
2705
|
-
}, 1032, ["modelValue", "onUpdate:modelValue"])) : u.type === "boolean" ? (
|
|
2796
|
+
}, 1032, ["modelValue", "onUpdate:modelValue"])) : u.type === "boolean" ? (b(), o("label", Yr, [s("input", {
|
|
2706
2797
|
checked: !!t.params[u.key],
|
|
2707
2798
|
type: "checkbox",
|
|
2708
2799
|
class: "h-4 w-4",
|
|
2709
2800
|
onChange: (e) => c(u.key, e)
|
|
2710
|
-
}, null, 40,
|
|
2801
|
+
}, null, 40, Xr), s("span", Zr, D(u.label), 1)])) : (b(), i(Q, {
|
|
2711
2802
|
key: 3,
|
|
2712
2803
|
modelValue: t.params[u.key],
|
|
2713
2804
|
type: "number",
|
|
@@ -2720,11 +2811,11 @@ var ln = ["aria-label", "aria-expanded"], un = { class: "flex flex-col h-full" }
|
|
|
2720
2811
|
"min",
|
|
2721
2812
|
"onUpdate:modelValue"
|
|
2722
2813
|
])),
|
|
2723
|
-
u.help ? (
|
|
2724
|
-
|
|
2814
|
+
u.help ? (b(), o("p", Qr, D(u.help), 1)) : a("", !0),
|
|
2815
|
+
w(n.$slots, "after", { spec: u })
|
|
2725
2816
|
]))), 128))]));
|
|
2726
2817
|
}
|
|
2727
|
-
}),
|
|
2818
|
+
}), ei = { class: "mt-1.5 space-y-0.5 px-1" }, ti = { class: "text-slate-400 dark:text-slate-500" }, ni = /* @__PURE__ */ f({
|
|
2728
2819
|
__name: "BaseStatBreakdown",
|
|
2729
2820
|
props: {
|
|
2730
2821
|
items: {},
|
|
@@ -2743,16 +2834,16 @@ var ln = ["aria-label", "aria-expanded"], un = { class: "flex flex-col h-full" }
|
|
|
2743
2834
|
function i(e) {
|
|
2744
2835
|
return !n.signed || e == null ? "text-slate-500 dark:text-slate-400" : e >= 0 ? "text-emerald-600 dark:text-emerald-400" : "text-red-600 dark:text-red-400";
|
|
2745
2836
|
}
|
|
2746
|
-
return (n, a) => (
|
|
2837
|
+
return (n, a) => (b(), o("div", ei, [(b(!0), o(e, null, C(t.items, (e) => (b(), o("div", {
|
|
2747
2838
|
key: e.label,
|
|
2748
2839
|
class: "flex items-center justify-between text-[11px]"
|
|
2749
|
-
}, [s("span",
|
|
2840
|
+
}, [s("span", ti, D(e.label), 1), s("span", { class: h(["font-mono tabular-nums font-medium", i(e.value)]) }, D(r(e.value)), 3)]))), 128))]));
|
|
2750
2841
|
}
|
|
2751
|
-
}),
|
|
2842
|
+
}), ri = [
|
|
2752
2843
|
"disabled",
|
|
2753
2844
|
"title",
|
|
2754
2845
|
"aria-pressed"
|
|
2755
|
-
],
|
|
2846
|
+
], ii = /* @__PURE__ */ f({
|
|
2756
2847
|
__name: "BaseFilterChip",
|
|
2757
2848
|
props: {
|
|
2758
2849
|
label: { default: "" },
|
|
@@ -2781,21 +2872,21 @@ var ln = ["aria-label", "aria-expanded"], un = { class: "flex flex-col h-full" }
|
|
|
2781
2872
|
red: "border-red-500 bg-red-500 text-white hover:bg-red-600 focus-visible:ring-red-500",
|
|
2782
2873
|
slate: "border-slate-600 bg-slate-600 text-white hover:bg-slate-700 focus-visible:ring-emerald-500"
|
|
2783
2874
|
};
|
|
2784
|
-
return (r, i) => (
|
|
2875
|
+
return (r, i) => (b(), o("button", {
|
|
2785
2876
|
type: "button",
|
|
2786
2877
|
disabled: e.disabled,
|
|
2787
2878
|
title: e.title,
|
|
2788
2879
|
"aria-pressed": e.active,
|
|
2789
|
-
class:
|
|
2790
|
-
}, [
|
|
2880
|
+
class: h(["whitespace-nowrap rounded-md border px-3 text-sm font-semibold text-center transition-colors focus:outline-none focus-visible:ring-2 disabled:opacity-50 disabled:cursor-not-allowed", e.active ? n[e.color] : t[e.color]])
|
|
2881
|
+
}, [w(r.$slots, "default", {}, () => [u(D(e.label), 1)])], 10, ri));
|
|
2791
2882
|
}
|
|
2792
|
-
}),
|
|
2883
|
+
}), ai = { class: "flex items-center justify-between mb-4" }, oi = { class: "text-lg font-semibold text-slate-900 dark:text-slate-100" }, si = {
|
|
2793
2884
|
key: 0,
|
|
2794
2885
|
class: "text-xs text-slate-500 dark:text-slate-400"
|
|
2795
|
-
},
|
|
2886
|
+
}, ci = {
|
|
2796
2887
|
key: 0,
|
|
2797
2888
|
class: "inline-flex items-center gap-2 text-xs text-slate-500"
|
|
2798
|
-
},
|
|
2889
|
+
}, li = { class: "grid gap-4 md:grid-cols-2" }, ui = { class: "md:col-span-2" }, di = ["for"], fi = { class: "md:col-span-2" }, pi = ["for"], mi = { class: "text-[11px] text-slate-500 mt-1" }, hi = { class: "md:col-span-2" }, gi = ["for"], _i = { class: "md:col-span-2" }, vi = ["for"], yi = { class: "md:col-span-2" }, bi = "placeholder:text-slate-400 dark:placeholder:text-slate-500 font-mono", xi = /* @__PURE__ */ f({
|
|
2799
2890
|
__name: "BaseCredentialsForm",
|
|
2800
2891
|
props: {
|
|
2801
2892
|
title: {},
|
|
@@ -2821,122 +2912,122 @@ var ln = ["aria-label", "aria-expanded"], un = { class: "flex flex-col h-full" }
|
|
|
2821
2912
|
"load-error"
|
|
2822
2913
|
],
|
|
2823
2914
|
setup(t, { expose: n, emit: r }) {
|
|
2824
|
-
let c = t,
|
|
2915
|
+
let c = t, l = r, f = S(!1), p = S(!1), m = x({
|
|
2825
2916
|
keyId: "",
|
|
2826
2917
|
secretKey: "",
|
|
2827
2918
|
baseUrl: c.defaults.baseUrl,
|
|
2828
2919
|
dataUrl: c.defaults.dataUrl
|
|
2829
2920
|
});
|
|
2830
|
-
async function
|
|
2921
|
+
async function g() {
|
|
2831
2922
|
try {
|
|
2832
2923
|
let e = await c.fetchFn();
|
|
2833
|
-
|
|
2924
|
+
m.keyId = e.keyId ?? "", m.baseUrl = e.baseUrl || c.defaults.baseUrl, m.dataUrl = e.dataUrl || c.defaults.dataUrl, m.secretKey = "", p.value = e.hasSecret;
|
|
2834
2925
|
} catch (e) {
|
|
2835
|
-
|
|
2926
|
+
l("load-error", e instanceof Error ? e.message : "");
|
|
2836
2927
|
}
|
|
2837
2928
|
}
|
|
2838
2929
|
function v(e) {
|
|
2839
2930
|
return !e || !e.trim();
|
|
2840
2931
|
}
|
|
2841
|
-
async function
|
|
2932
|
+
async function y() {
|
|
2842
2933
|
if (!f.value) {
|
|
2843
|
-
if (v(
|
|
2844
|
-
|
|
2934
|
+
if (v(m.keyId)) {
|
|
2935
|
+
l("error", c.requiredKeyMessage);
|
|
2845
2936
|
return;
|
|
2846
2937
|
}
|
|
2847
|
-
if (!p.value && v(
|
|
2848
|
-
|
|
2938
|
+
if (!p.value && v(m.secretKey)) {
|
|
2939
|
+
l("error", c.requiredSecretMessage);
|
|
2849
2940
|
return;
|
|
2850
2941
|
}
|
|
2851
|
-
if (v(
|
|
2852
|
-
|
|
2942
|
+
if (v(m.baseUrl) || v(m.dataUrl)) {
|
|
2943
|
+
l("error", "Base URL and Data URL are required.");
|
|
2853
2944
|
return;
|
|
2854
2945
|
}
|
|
2855
2946
|
f.value = !0;
|
|
2856
2947
|
try {
|
|
2857
2948
|
p.value = (await c.updateFn({
|
|
2858
|
-
keyId:
|
|
2859
|
-
secretKey: v(
|
|
2860
|
-
baseUrl:
|
|
2861
|
-
dataUrl:
|
|
2862
|
-
})).hasSecret,
|
|
2949
|
+
keyId: m.keyId.trim(),
|
|
2950
|
+
secretKey: v(m.secretKey) ? void 0 : m.secretKey.trim(),
|
|
2951
|
+
baseUrl: m.baseUrl.trim(),
|
|
2952
|
+
dataUrl: m.dataUrl.trim()
|
|
2953
|
+
})).hasSecret, m.secretKey = "", l("saved", c.savedMessage);
|
|
2863
2954
|
} catch (e) {
|
|
2864
|
-
|
|
2955
|
+
l("error", e instanceof Error ? e.message : "Failed to save");
|
|
2865
2956
|
} finally {
|
|
2866
2957
|
f.value = !1;
|
|
2867
2958
|
}
|
|
2868
2959
|
}
|
|
2869
2960
|
}
|
|
2870
|
-
return g
|
|
2961
|
+
return _(g), n({ load: g }), (n, r) => (b(), i(st, { class: "!p-6" }, {
|
|
2871
2962
|
default: N(() => [
|
|
2872
|
-
s("div",
|
|
2873
|
-
s("div",
|
|
2874
|
-
s("div",
|
|
2963
|
+
s("div", ai, [s("div", null, [s("h2", oi, D(t.title), 1), t.subtitle ? (b(), o("p", si, D(t.subtitle), 1)) : a("", !0)]), f.value ? (b(), o("span", ci, [d(ct, { class: "!h-4 !w-4" }), r[4] ||= u(" Saving… ", -1)])) : a("", !0)]),
|
|
2964
|
+
s("div", li, [
|
|
2965
|
+
s("div", ui, [s("label", {
|
|
2875
2966
|
for: `${t.idPrefix}-key-id`,
|
|
2876
2967
|
class: "block text-xs uppercase tracking-wide text-slate-500 mb-1"
|
|
2877
|
-
},
|
|
2968
|
+
}, D(t.keyLabel), 9, di), d(Q, {
|
|
2878
2969
|
id: `${t.idPrefix}-key-id`,
|
|
2879
|
-
modelValue:
|
|
2880
|
-
"onUpdate:modelValue": r[0] ||= (e) =>
|
|
2970
|
+
modelValue: m.keyId,
|
|
2971
|
+
"onUpdate:modelValue": r[0] ||= (e) => m.keyId = e,
|
|
2881
2972
|
type: "text",
|
|
2882
2973
|
autocomplete: "off",
|
|
2883
2974
|
placeholder: t.keyPlaceholder,
|
|
2884
|
-
class:
|
|
2975
|
+
class: h(bi)
|
|
2885
2976
|
}, null, 8, [
|
|
2886
2977
|
"id",
|
|
2887
2978
|
"modelValue",
|
|
2888
2979
|
"placeholder"
|
|
2889
2980
|
])]),
|
|
2890
|
-
s("div",
|
|
2981
|
+
s("div", fi, [
|
|
2891
2982
|
s("label", {
|
|
2892
2983
|
for: `${t.idPrefix}-secret`,
|
|
2893
2984
|
class: "block text-xs uppercase tracking-wide text-slate-500 mb-1"
|
|
2894
|
-
},
|
|
2895
|
-
|
|
2985
|
+
}, D(t.secretLabel), 9, pi),
|
|
2986
|
+
d(Q, {
|
|
2896
2987
|
id: `${t.idPrefix}-secret`,
|
|
2897
|
-
modelValue:
|
|
2898
|
-
"onUpdate:modelValue": r[1] ||= (e) =>
|
|
2988
|
+
modelValue: m.secretKey,
|
|
2989
|
+
"onUpdate:modelValue": r[1] ||= (e) => m.secretKey = e,
|
|
2899
2990
|
type: "password",
|
|
2900
2991
|
autocomplete: "new-password",
|
|
2901
2992
|
placeholder: p.value ? "•••••••• (unchanged — type to replace)" : t.secretPlaceholder,
|
|
2902
|
-
class:
|
|
2993
|
+
class: h(bi)
|
|
2903
2994
|
}, null, 8, [
|
|
2904
2995
|
"id",
|
|
2905
2996
|
"modelValue",
|
|
2906
2997
|
"placeholder"
|
|
2907
2998
|
]),
|
|
2908
|
-
s("p",
|
|
2999
|
+
s("p", mi, [p.value ? (b(), o(e, { key: 0 }, [u(D(t.secretSetHint), 1)], 64)) : w(n.$slots, "no-secret-hint", { key: 1 }, () => [u(D(t.permissionsHint), 1)])])
|
|
2909
3000
|
]),
|
|
2910
|
-
s("div",
|
|
3001
|
+
s("div", hi, [
|
|
2911
3002
|
s("label", {
|
|
2912
3003
|
for: `${t.idPrefix}-base-url`,
|
|
2913
3004
|
class: "block text-xs uppercase tracking-wide text-slate-500 mb-1"
|
|
2914
|
-
}, "Base URL (trading)", 8,
|
|
2915
|
-
|
|
3005
|
+
}, "Base URL (trading)", 8, gi),
|
|
3006
|
+
d(Q, {
|
|
2916
3007
|
id: `${t.idPrefix}-base-url`,
|
|
2917
|
-
modelValue:
|
|
2918
|
-
"onUpdate:modelValue": r[2] ||= (e) =>
|
|
3008
|
+
modelValue: m.baseUrl,
|
|
3009
|
+
"onUpdate:modelValue": r[2] ||= (e) => m.baseUrl = e,
|
|
2919
3010
|
type: "text",
|
|
2920
|
-
class:
|
|
3011
|
+
class: h(bi)
|
|
2921
3012
|
}, null, 8, ["id", "modelValue"]),
|
|
2922
|
-
|
|
3013
|
+
w(n.$slots, "base-url-extra", { form: m })
|
|
2923
3014
|
]),
|
|
2924
|
-
s("div",
|
|
3015
|
+
s("div", _i, [s("label", {
|
|
2925
3016
|
for: `${t.idPrefix}-data-url`,
|
|
2926
3017
|
class: "block text-xs uppercase tracking-wide text-slate-500 mb-1"
|
|
2927
|
-
}, "Data URL (market data)", 8,
|
|
3018
|
+
}, "Data URL (market data)", 8, vi), d(Q, {
|
|
2928
3019
|
id: `${t.idPrefix}-data-url`,
|
|
2929
|
-
modelValue:
|
|
2930
|
-
"onUpdate:modelValue": r[3] ||= (e) =>
|
|
3020
|
+
modelValue: m.dataUrl,
|
|
3021
|
+
"onUpdate:modelValue": r[3] ||= (e) => m.dataUrl = e,
|
|
2931
3022
|
type: "text",
|
|
2932
|
-
class:
|
|
3023
|
+
class: h(bi)
|
|
2933
3024
|
}, null, 8, ["id", "modelValue"])]),
|
|
2934
|
-
s("div",
|
|
2935
|
-
color:
|
|
3025
|
+
s("div", yi, [d(U, {
|
|
3026
|
+
color: O(V).GREEN,
|
|
2936
3027
|
description: t.saveLabel,
|
|
2937
3028
|
isDisable: f.value,
|
|
2938
3029
|
isLoading: f.value,
|
|
2939
|
-
onClick:
|
|
3030
|
+
onClick: y
|
|
2940
3031
|
}, null, 8, [
|
|
2941
3032
|
"color",
|
|
2942
3033
|
"description",
|
|
@@ -2944,7 +3035,7 @@ var ln = ["aria-label", "aria-expanded"], un = { class: "flex flex-col h-full" }
|
|
|
2944
3035
|
"isLoading"
|
|
2945
3036
|
])])
|
|
2946
3037
|
]),
|
|
2947
|
-
|
|
3038
|
+
w(n.$slots, "footer")
|
|
2948
3039
|
]),
|
|
2949
3040
|
_: 3
|
|
2950
3041
|
}));
|
|
@@ -2952,20 +3043,20 @@ var ln = ["aria-label", "aria-expanded"], un = { class: "flex flex-col h-full" }
|
|
|
2952
3043
|
});
|
|
2953
3044
|
//#endregion
|
|
2954
3045
|
//#region src/composables/useDebounce.ts
|
|
2955
|
-
function
|
|
2956
|
-
let n =
|
|
3046
|
+
function Si(e, t = 300) {
|
|
3047
|
+
let n = S(e.value), r = null;
|
|
2957
3048
|
return M(e, (e) => {
|
|
2958
3049
|
r && clearTimeout(r), r = setTimeout(() => {
|
|
2959
3050
|
n.value = e, r = null;
|
|
2960
3051
|
}, t);
|
|
2961
|
-
}),
|
|
3052
|
+
}), v(() => {
|
|
2962
3053
|
r &&= (clearTimeout(r), null);
|
|
2963
3054
|
}), n;
|
|
2964
3055
|
}
|
|
2965
3056
|
//#endregion
|
|
2966
3057
|
//#region src/composables/useToast.ts
|
|
2967
|
-
function
|
|
2968
|
-
let t =
|
|
3058
|
+
function Ci(e = 3e3) {
|
|
3059
|
+
let t = S(!1), n = S(""), r = S(K.SUCCESS), i = null;
|
|
2969
3060
|
function a() {
|
|
2970
3061
|
i &&= (clearTimeout(i), null);
|
|
2971
3062
|
}
|
|
@@ -2974,7 +3065,7 @@ function vi(e = 3e3) {
|
|
|
2974
3065
|
t.value = !1, i = null;
|
|
2975
3066
|
}, c);
|
|
2976
3067
|
}
|
|
2977
|
-
return
|
|
3068
|
+
return v(() => {
|
|
2978
3069
|
a();
|
|
2979
3070
|
}), {
|
|
2980
3071
|
showToast: t,
|
|
@@ -2985,8 +3076,8 @@ function vi(e = 3e3) {
|
|
|
2985
3076
|
}
|
|
2986
3077
|
//#endregion
|
|
2987
3078
|
//#region src/composables/useQueryParamSync.ts
|
|
2988
|
-
function
|
|
2989
|
-
let e =
|
|
3079
|
+
function wi() {
|
|
3080
|
+
let e = Te(), t = Ee();
|
|
2990
3081
|
function n(t) {
|
|
2991
3082
|
let n = e.query[t];
|
|
2992
3083
|
return typeof n == "string" ? n : "";
|
|
@@ -3006,13 +3097,26 @@ function yi() {
|
|
|
3006
3097
|
};
|
|
3007
3098
|
}
|
|
3008
3099
|
//#endregion
|
|
3100
|
+
//#region src/composables/useFieldClasses.ts
|
|
3101
|
+
function Ti() {
|
|
3102
|
+
let { isDark: e } = z(), t = r(() => e.value ? "text-gray-300" : "text-gray-600"), n = r(() => e.value ? "bg-gray-800 border-gray-600 text-gray-100 placeholder-gray-500 focus:ring-emerald-500 focus:border-emerald-500" : "bg-white border-gray-300 text-gray-800 focus:ring-emerald-500 focus:border-emerald-500");
|
|
3103
|
+
function i(t) {
|
|
3104
|
+
return t == null || String(t).trim() === "" ? e.value ? "bg-gray-800 border-red-500 text-gray-100 placeholder-gray-500 focus:ring-red-500 focus:border-red-500 ring-1 ring-red-500/30" : "bg-white border-red-400 text-gray-800 focus:ring-red-500 focus:border-red-500 ring-1 ring-red-400/30" : n.value;
|
|
3105
|
+
}
|
|
3106
|
+
return {
|
|
3107
|
+
label: t,
|
|
3108
|
+
input: n,
|
|
3109
|
+
requiredInput: i
|
|
3110
|
+
};
|
|
3111
|
+
}
|
|
3112
|
+
//#endregion
|
|
3009
3113
|
//#region src/enums/BaseBadgeEnum.ts
|
|
3010
|
-
var
|
|
3114
|
+
var Ei = /* @__PURE__ */ function(e) {
|
|
3011
3115
|
return e.WIN = "WIN", e.LOSE = "LOSE", e;
|
|
3012
3116
|
}({});
|
|
3013
3117
|
//#endregion
|
|
3014
3118
|
//#region src/utils/util.ts
|
|
3015
|
-
function
|
|
3119
|
+
function Di(e) {
|
|
3016
3120
|
let t = "red";
|
|
3017
3121
|
switch (e) {
|
|
3018
3122
|
case I.ERROR:
|
|
@@ -3030,7 +3134,7 @@ function xi(e) {
|
|
|
3030
3134
|
}
|
|
3031
3135
|
return t;
|
|
3032
3136
|
}
|
|
3033
|
-
function
|
|
3137
|
+
function Oi(e) {
|
|
3034
3138
|
let t = "red";
|
|
3035
3139
|
switch (e) {
|
|
3036
3140
|
case B.GREEN:
|
|
@@ -3059,14 +3163,14 @@ function Si(e) {
|
|
|
3059
3163
|
}
|
|
3060
3164
|
//#endregion
|
|
3061
3165
|
//#region src/utils/httpColors.ts
|
|
3062
|
-
var
|
|
3166
|
+
var ki = {
|
|
3063
3167
|
GET: "bg-blue-600",
|
|
3064
3168
|
POST: "bg-emerald-600",
|
|
3065
3169
|
PUT: "bg-amber-600",
|
|
3066
3170
|
DELETE: "bg-red-600",
|
|
3067
3171
|
PATCH: "bg-purple-600",
|
|
3068
3172
|
HEAD: "bg-gray-600"
|
|
3069
|
-
},
|
|
3173
|
+
}, Ai = {
|
|
3070
3174
|
GET: "bg-blue-500",
|
|
3071
3175
|
POST: "bg-green-500",
|
|
3072
3176
|
PUT: "bg-yellow-500",
|
|
@@ -3074,23 +3178,39 @@ var Ci = {
|
|
|
3074
3178
|
PATCH: "bg-purple-500",
|
|
3075
3179
|
HEAD: "bg-gray-500"
|
|
3076
3180
|
};
|
|
3077
|
-
function
|
|
3078
|
-
return e ?
|
|
3181
|
+
function ji(e) {
|
|
3182
|
+
return e ? ki[e.toUpperCase()] ?? "bg-gray-600" : "bg-gray-600";
|
|
3079
3183
|
}
|
|
3080
|
-
function
|
|
3081
|
-
return e ?
|
|
3184
|
+
function Mi(e) {
|
|
3185
|
+
return e ? Ai[e.toUpperCase()] ?? "bg-gray-500" : "bg-gray-500";
|
|
3082
3186
|
}
|
|
3083
|
-
function
|
|
3187
|
+
function Ni(e) {
|
|
3084
3188
|
let t = e ?? 0;
|
|
3085
3189
|
return t >= 200 && t < 300 ? "bg-emerald-600" : t >= 300 && t < 400 ? "bg-blue-600" : t >= 400 && t < 500 ? "bg-amber-600" : t >= 500 ? "bg-red-600" : "bg-gray-600";
|
|
3086
3190
|
}
|
|
3087
|
-
function
|
|
3191
|
+
function Pi(e, t) {
|
|
3192
|
+
let n = (e || "ANY").toUpperCase();
|
|
3193
|
+
return n === "GET" ? t ? "bg-blue-500/15 text-blue-400" : "bg-blue-100 text-blue-700" : n === "POST" ? t ? "bg-emerald-500/15 text-emerald-400" : "bg-emerald-100 text-emerald-700" : n === "PUT" ? t ? "bg-amber-500/15 text-amber-400" : "bg-amber-100 text-amber-700" : n === "DELETE" ? t ? "bg-red-500/15 text-red-400" : "bg-red-100 text-red-700" : n === "PATCH" ? t ? "bg-purple-500/15 text-purple-400" : "bg-purple-100 text-purple-700" : n === "HEAD" ? t ? "bg-sky-500/15 text-sky-400" : "bg-sky-100 text-sky-700" : t ? "bg-gray-500/15 text-gray-400" : "bg-gray-100 text-gray-600";
|
|
3194
|
+
}
|
|
3195
|
+
function Fi(e, t) {
|
|
3196
|
+
let n = e ?? 200;
|
|
3197
|
+
return n >= 200 && n < 300 ? t ? "bg-emerald-500/15 text-emerald-300" : "bg-emerald-100 text-emerald-700" : n >= 300 && n < 400 ? t ? "bg-sky-500/15 text-sky-300" : "bg-sky-100 text-sky-700" : n >= 400 && n < 500 ? t ? "bg-amber-500/15 text-amber-300" : "bg-amber-100 text-amber-700" : n >= 500 && n < 600 ? t ? "bg-red-500/15 text-red-300" : "bg-red-100 text-red-700" : t ? "bg-gray-800 text-gray-400" : "bg-gray-100 text-gray-600";
|
|
3198
|
+
}
|
|
3199
|
+
function Ii(e, t) {
|
|
3088
3200
|
let n = e ?? 200;
|
|
3089
3201
|
return t ? n >= 200 && n < 300 ? "bg-green-500/15 text-green-400" : n >= 300 && n < 400 ? "bg-blue-500/15 text-blue-400" : n >= 400 && n < 500 ? "bg-yellow-500/15 text-yellow-400" : "bg-red-500/15 text-red-400" : n >= 200 && n < 300 ? "bg-green-100 text-green-800" : n >= 300 && n < 400 ? "bg-blue-100 text-blue-800" : n >= 400 && n < 500 ? "bg-yellow-100 text-yellow-800" : "bg-red-100 text-red-800";
|
|
3090
3202
|
}
|
|
3091
3203
|
//#endregion
|
|
3204
|
+
//#region src/utils/kvRows.ts
|
|
3205
|
+
function Li(e) {
|
|
3206
|
+
return !(e.key ?? "").trim() || e.matcherType === "absent" ? !1 : !(e.value ?? "").trim();
|
|
3207
|
+
}
|
|
3208
|
+
function Ri(e) {
|
|
3209
|
+
return e.matcherType === "absent" || !(e.value ?? "").trim() ? !1 : !(e.key ?? "").trim();
|
|
3210
|
+
}
|
|
3211
|
+
//#endregion
|
|
3092
3212
|
//#region src/utils/sanitizeHtml.ts
|
|
3093
|
-
var
|
|
3213
|
+
var zi = /* @__PURE__ */ new Set([
|
|
3094
3214
|
"A",
|
|
3095
3215
|
"B",
|
|
3096
3216
|
"STRONG",
|
|
@@ -3105,7 +3225,7 @@ var ki = /* @__PURE__ */ new Set([
|
|
|
3105
3225
|
"LI",
|
|
3106
3226
|
"SPAN",
|
|
3107
3227
|
"DIV"
|
|
3108
|
-
]),
|
|
3228
|
+
]), Bi = /* @__PURE__ */ new Set([
|
|
3109
3229
|
"SCRIPT",
|
|
3110
3230
|
"STYLE",
|
|
3111
3231
|
"IFRAME",
|
|
@@ -3113,53 +3233,53 @@ var ki = /* @__PURE__ */ new Set([
|
|
|
3113
3233
|
"EMBED",
|
|
3114
3234
|
"NOSCRIPT",
|
|
3115
3235
|
"TEMPLATE"
|
|
3116
|
-
]),
|
|
3117
|
-
function
|
|
3236
|
+
]), Vi = { A: /* @__PURE__ */ new Set(["href", "title"]) };
|
|
3237
|
+
function Hi(e) {
|
|
3118
3238
|
let t = e.trim().toLowerCase();
|
|
3119
3239
|
return t.startsWith("http://") || t.startsWith("https://") || t.startsWith("mailto:") || t.startsWith("tel:") || t.startsWith("/") || t.startsWith("#") || t === "";
|
|
3120
3240
|
}
|
|
3121
|
-
function
|
|
3241
|
+
function Ui(e) {
|
|
3122
3242
|
if (e.nodeType !== Node.ELEMENT_NODE) return;
|
|
3123
3243
|
let t = e, n = t.tagName.toUpperCase();
|
|
3124
|
-
if (!
|
|
3125
|
-
|
|
3244
|
+
if (!zi.has(n)) {
|
|
3245
|
+
Bi.has(n) ? t.remove() : t.replaceWith(document.createTextNode(t.textContent ?? ""));
|
|
3126
3246
|
return;
|
|
3127
3247
|
}
|
|
3128
|
-
let r =
|
|
3248
|
+
let r = Vi[n] ?? /* @__PURE__ */ new Set();
|
|
3129
3249
|
for (let e of Array.from(t.attributes)) {
|
|
3130
3250
|
if (!r.has(e.name.toLowerCase())) {
|
|
3131
3251
|
t.removeAttribute(e.name);
|
|
3132
3252
|
continue;
|
|
3133
3253
|
}
|
|
3134
|
-
n === "A" && e.name.toLowerCase() === "href" && !
|
|
3254
|
+
n === "A" && e.name.toLowerCase() === "href" && !Hi(e.value) && t.removeAttribute(e.name);
|
|
3135
3255
|
}
|
|
3136
3256
|
n === "A" && t.hasAttribute("href") && (t.setAttribute("rel", "noopener noreferrer"), t.setAttribute("target", "_blank"));
|
|
3137
|
-
for (let e of Array.from(t.childNodes))
|
|
3257
|
+
for (let e of Array.from(t.childNodes)) Ui(e);
|
|
3138
3258
|
}
|
|
3139
|
-
function
|
|
3259
|
+
function Wi(e) {
|
|
3140
3260
|
if (!e) return "";
|
|
3141
3261
|
let t = new DOMParser().parseFromString(`<div>${e}</div>`, "text/html").body.firstElementChild;
|
|
3142
3262
|
if (!t) return "";
|
|
3143
|
-
for (let e of Array.from(t.childNodes))
|
|
3263
|
+
for (let e of Array.from(t.childNodes)) Ui(e);
|
|
3144
3264
|
return t.innerHTML;
|
|
3145
3265
|
}
|
|
3146
3266
|
//#endregion
|
|
3147
3267
|
//#region src/utils/format.ts
|
|
3148
|
-
var
|
|
3149
|
-
function
|
|
3150
|
-
if (e == null || typeof e == "string" && e.trim() === "") return
|
|
3268
|
+
var $ = "—";
|
|
3269
|
+
function Gi(e, t = 4) {
|
|
3270
|
+
if (e == null || typeof e == "string" && e.trim() === "") return $;
|
|
3151
3271
|
let n = typeof e == "string" ? Number(e) : e;
|
|
3152
3272
|
return isFinite(n) ? n.toLocaleString(void 0, {
|
|
3153
3273
|
minimumFractionDigits: t,
|
|
3154
3274
|
maximumFractionDigits: t
|
|
3155
|
-
}) :
|
|
3275
|
+
}) : $;
|
|
3156
3276
|
}
|
|
3157
|
-
function
|
|
3158
|
-
if (e == null || e === "") return
|
|
3277
|
+
function Ki(e) {
|
|
3278
|
+
if (e == null || e === "") return $;
|
|
3159
3279
|
let t = new Date(e);
|
|
3160
3280
|
return isNaN(t.getTime()) ? String(e) : t.toLocaleString();
|
|
3161
3281
|
}
|
|
3162
|
-
function
|
|
3282
|
+
function qi(e) {
|
|
3163
3283
|
return new Date(e).toLocaleString(void 0, {
|
|
3164
3284
|
month: "short",
|
|
3165
3285
|
day: "numeric",
|
|
@@ -3167,13 +3287,13 @@ function Ri(e) {
|
|
|
3167
3287
|
minute: "2-digit"
|
|
3168
3288
|
});
|
|
3169
3289
|
}
|
|
3170
|
-
function
|
|
3290
|
+
function Ji(e) {
|
|
3171
3291
|
return new Date(e).toLocaleDateString(void 0, {
|
|
3172
3292
|
month: "short",
|
|
3173
3293
|
day: "numeric"
|
|
3174
3294
|
});
|
|
3175
3295
|
}
|
|
3176
|
-
function
|
|
3296
|
+
function Yi(e) {
|
|
3177
3297
|
try {
|
|
3178
3298
|
return new Date(e).toLocaleString(void 0, {
|
|
3179
3299
|
year: "numeric",
|
|
@@ -3189,7 +3309,7 @@ function Bi(e) {
|
|
|
3189
3309
|
return String(e);
|
|
3190
3310
|
}
|
|
3191
3311
|
}
|
|
3192
|
-
function
|
|
3312
|
+
function Xi(e) {
|
|
3193
3313
|
if (!isFinite(e) || e === 0) return e.toFixed(2);
|
|
3194
3314
|
let t = Math.abs(e), n = 2;
|
|
3195
3315
|
return t < 1e-4 ? n = 8 : t < .01 ? n = 6 : t < 1 ? n = 4 : t < 100 && (n = 3), e.toLocaleString(void 0, {
|
|
@@ -3197,20 +3317,48 @@ function Vi(e) {
|
|
|
3197
3317
|
maximumFractionDigits: n
|
|
3198
3318
|
});
|
|
3199
3319
|
}
|
|
3200
|
-
function
|
|
3320
|
+
function Zi(e, t = 2) {
|
|
3201
3321
|
return `${e >= 0 ? "+" : ""}${e.toFixed(t)}%`;
|
|
3202
3322
|
}
|
|
3203
|
-
function
|
|
3323
|
+
function Qi(e) {
|
|
3204
3324
|
return `${e < 0 ? "-" : "+"}$${Math.abs(e).toFixed(2)}`;
|
|
3205
3325
|
}
|
|
3206
|
-
function
|
|
3207
|
-
if (e == null ||
|
|
3326
|
+
function $i(e) {
|
|
3327
|
+
if (e == null || e === "") return $;
|
|
3328
|
+
let t = new Date(e);
|
|
3329
|
+
return isNaN(t.getTime()) ? String(e) : t.toLocaleDateString("en-US", {
|
|
3330
|
+
year: "numeric",
|
|
3331
|
+
month: "short",
|
|
3332
|
+
day: "numeric"
|
|
3333
|
+
});
|
|
3334
|
+
}
|
|
3335
|
+
function ea(e) {
|
|
3336
|
+
if (e == null || e === "") return $;
|
|
3337
|
+
let t = new Date(e);
|
|
3338
|
+
return isNaN(t.getTime()) ? String(e) : t.toLocaleDateString("en-US", {
|
|
3339
|
+
year: "numeric",
|
|
3340
|
+
month: "short",
|
|
3341
|
+
day: "numeric",
|
|
3342
|
+
hour: "2-digit",
|
|
3343
|
+
minute: "2-digit"
|
|
3344
|
+
});
|
|
3345
|
+
}
|
|
3346
|
+
function ta(e) {
|
|
3347
|
+
if (typeof e != "number" || !isFinite(e) || e <= 0) return "";
|
|
3348
|
+
let t = e / 1e3, n = t < 1 ? 3 : 2;
|
|
3349
|
+
return `= ${t.toFixed(n)} s`;
|
|
3350
|
+
}
|
|
3351
|
+
function na(e) {
|
|
3352
|
+
return e ? e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB` : "";
|
|
3353
|
+
}
|
|
3354
|
+
function ra(e, t = 2) {
|
|
3355
|
+
if (e == null || !isFinite(e)) return $;
|
|
3208
3356
|
let n = Math.floor(Math.max(0, e) / 6e4), r = Math.floor(n / 1440), i = Math.floor(n % 1440 / 60), a = n % 60, o = [];
|
|
3209
3357
|
return r > 0 && o.push(`${r}d`), (r > 0 || i > 0) && o.push(`${i}h`), o.push(`${a}m`), o.slice(0, t).join(" ");
|
|
3210
3358
|
}
|
|
3211
3359
|
//#endregion
|
|
3212
3360
|
//#region src/utils/specForm.ts
|
|
3213
|
-
function
|
|
3361
|
+
function ia(e, t) {
|
|
3214
3362
|
let n = {};
|
|
3215
3363
|
if (!e) return n;
|
|
3216
3364
|
for (let r of e) {
|
|
@@ -3219,7 +3367,7 @@ function Gi(e, t) {
|
|
|
3219
3367
|
}
|
|
3220
3368
|
return n;
|
|
3221
3369
|
}
|
|
3222
|
-
function
|
|
3370
|
+
function aa(e, t) {
|
|
3223
3371
|
if (!e) return null;
|
|
3224
3372
|
for (let n of e) if (n.type === "decimal" || n.type === "integer") {
|
|
3225
3373
|
let e = t[n.key], r = e === "" || e == null;
|
|
@@ -3230,7 +3378,7 @@ function Ki(e, t) {
|
|
|
3230
3378
|
}
|
|
3231
3379
|
//#endregion
|
|
3232
3380
|
//#region src/utils/pnl.ts
|
|
3233
|
-
function
|
|
3381
|
+
function oa(e) {
|
|
3234
3382
|
if (e.buyPrice == null || e.lastPrice == null || e.filledQty == null) return {
|
|
3235
3383
|
pnlUsd: null,
|
|
3236
3384
|
pnlPct: null
|
|
@@ -3245,4 +3393,4 @@ function qi(e) {
|
|
|
3245
3393
|
};
|
|
3246
3394
|
}
|
|
3247
3395
|
//#endregion
|
|
3248
|
-
export { I as AlertEnum,
|
|
3396
|
+
export { I as AlertEnum, qn as BaseActionButton, Me as BaseAlert, Ln as BaseAppLayout, Pe as BaseBadge, Ei as BaseBadgeEnum, Re as BaseBreadcrumb, U as BaseButton, V as BaseButtonEnum, H as BaseButtonSizeEnum, br as BaseChipButton, Wt as BaseCollapsibleSection, Jt as BaseConfirmModal, Yn as BaseCopyButton, xi as BaseCredentialsForm, Fr as BaseDropdown, Pn as BaseEntityPickerModal, Dr as BaseFileDropzone, ii as BaseFilterChip, $n as BaseGoogleSignInButton, Q as BaseInput, Xe as BaseLine, Ze as BaseLoginEnum, dr as BaseLoginForm, $e as BaseLogo, G as BaseLogoEnum, ot as BaseModal, et as BaseModalEnum, Vt as BaseModalShell, tn as BaseNotFoundPage, vr as BaseNotificationPanel, Vn as BasePageHeader, xr as BaseRemoveButton, st as BaseRow, zr as BaseSegmentedControl, Ar as BaseSelect, xn as BaseSidebar, $r as BaseSpecFields, ct as BaseSpinner, ni as BaseStatBreakdown, wr as BaseStatusPill, Gr as BaseTable, Qt as BaseTextInputModal, dt as BaseToast, K as BaseToastEnum, Wn as BaseToolbarButton, pt as ColoredSquares, B as ColorsEnums, gt as EarningsCard, xt as EuroAmount, W as LineEnum, Et as Pagination, q as PositioningEnum, jt as TrendArrow, ia as buildSpecParams, oa as computePnL, aa as firstInvalidNumericSpec, na as fmtBytes, $i as fmtCalendarDate, ea as fmtCalendarDateTime, Ki as fmtDate, Ji as fmtDateShort, qi as fmtDateTime, Yi as fmtDateTimeMs, ra as fmtDuration, ta as fmtMsAsSeconds, Gi as fmtNumber, Zi as fmtPct, Xi as fmtPrice, Qi as fmtUsd, Di as getBaseColor, Oi as getBaseColorOf, ke as initTheme, Hi as isSafeHref, Mi as methodBadgeBright, ji as methodBadgeSolid, Pi as methodBadgeTinted, Ri as rowKeyMissing, Li as rowValueMissing, Wi as sanitizeHtml, Fi as statusBadgeSoft, Ni as statusBadgeSolid, Ii as statusBadgeTinted, Si as useDebouncedRef, Mt as useEscapeKey, Ti as useFieldClasses, rn as useMobileSidebar, un as useNotifications, wi as useQueryParamSync, cn as useSidebarCollapse, z as useTheme, J as useThemeClasses, Ci as useToast };
|