@myghf/ui 0.3.0 → 0.5.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 +49 -213
- package/dist/components/avatar/Avatar.vue.d.ts +12 -0
- package/dist/components/avatar/Avatar.vue.d.ts.map +1 -0
- package/dist/components/button/Button.vue.d.ts +7 -0
- package/dist/components/button/Button.vue.d.ts.map +1 -1
- package/dist/components/data-table/DataTable.vue.d.ts +3 -0
- package/dist/components/data-table/DataTable.vue.d.ts.map +1 -1
- package/dist/components/dropdown-menu/DropdownMenuGroup.vue.d.ts +18 -0
- package/dist/components/dropdown-menu/DropdownMenuGroup.vue.d.ts.map +1 -0
- package/dist/components/dropdown-menu/DropdownMenuItem.vue.d.ts +5 -1
- package/dist/components/dropdown-menu/DropdownMenuItem.vue.d.ts.map +1 -1
- package/dist/components/dropdown-menu/DropdownMenuLabel.vue.d.ts +18 -0
- package/dist/components/dropdown-menu/DropdownMenuLabel.vue.d.ts.map +1 -0
- package/dist/components/dropdown-menu/DropdownMenuSeparator.vue.d.ts +3 -0
- package/dist/components/dropdown-menu/DropdownMenuSeparator.vue.d.ts.map +1 -0
- package/dist/components/form-field/FormDescription.vue.d.ts +22 -0
- package/dist/components/form-field/FormDescription.vue.d.ts.map +1 -0
- package/dist/components/form-field/FormField.vue.d.ts +37 -0
- package/dist/components/form-field/FormField.vue.d.ts.map +1 -0
- package/dist/components/form-field/FormMessage.vue.d.ts +22 -0
- package/dist/components/form-field/FormMessage.vue.d.ts.map +1 -0
- package/dist/components/input/Input.vue.d.ts +8 -0
- package/dist/components/input/Input.vue.d.ts.map +1 -1
- package/dist/components/label/Label.vue.d.ts +24 -0
- package/dist/components/label/Label.vue.d.ts.map +1 -0
- package/dist/components/select/Select.vue.d.ts +4 -0
- package/dist/components/select/Select.vue.d.ts.map +1 -1
- package/dist/components/skeleton/Skeleton.vue.d.ts +51 -0
- package/dist/components/skeleton/Skeleton.vue.d.ts.map +1 -0
- package/dist/components/spinner/Spinner.vue.d.ts +13 -0
- package/dist/components/spinner/Spinner.vue.d.ts.map +1 -0
- package/dist/components/textarea/Textarea.vue.d.ts +9 -1
- package/dist/components/textarea/Textarea.vue.d.ts.map +1 -1
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +888 -539
- package/dist/index.js.map +1 -1
- package/dist/lib/formField.d.ts +27 -0
- package/dist/lib/formField.d.ts.map +1 -0
- package/dist/nuxt.d.ts +61 -0
- package/dist/nuxt.d.ts.map +1 -0
- package/dist/nuxt.js +98 -0
- package/dist/nuxt.js.map +1 -0
- package/package.json +21 -1
package/dist/index.js
CHANGED
|
@@ -1,85 +1,85 @@
|
|
|
1
1
|
import { clsx as e } from "clsx";
|
|
2
2
|
import { twMerge as t } from "tailwind-merge";
|
|
3
3
|
import { CalendarDate as n, CalendarDateTime as r, getLocalTimeZone as i } from "@internationalized/date";
|
|
4
|
-
import { Fragment as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createTextVNode as d, createVNode as f, defineComponent as p, inject as m, mergeProps as h, normalizeClass as g, normalizeStyle as _, onBeforeUnmount as v,
|
|
5
|
-
import * as
|
|
6
|
-
import { Calendar as re, Check as
|
|
7
|
-
import { tv as
|
|
8
|
-
import { CheckboxIndicator as
|
|
9
|
-
import { FlexRender as
|
|
4
|
+
import { Fragment as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createTextVNode as d, createVNode as f, defineComponent as p, inject as m, mergeProps as h, normalizeClass as g, normalizeStyle as _, onBeforeUnmount as v, onBeforeUpdate as y, onMounted as b, openBlock as x, provide as S, ref as C, renderList as w, renderSlot as T, resolveDynamicComponent as E, toDisplayString as D, unref as O, useAttrs as k, useId as ee, useSlots as te, vModelSelect as A, vModelText as j, vShow as ne, watch as M, withCtx as N, withDirectives as P, withModifiers as F } from "vue";
|
|
5
|
+
import * as I from "lucide-vue-next";
|
|
6
|
+
import { Calendar as re, Check as L, ChevronDown as R, ChevronLeft as ie, ChevronRight as z, ChevronUp as ae, ChevronsLeft as oe, ChevronsRight as B, ChevronsUpDown as se, Clock as ce, Eye as le, EyeOff as ue, Moon as de, Search as fe, Sun as pe, X as V } from "lucide-vue-next";
|
|
7
|
+
import { tv as me } from "tailwind-variants";
|
|
8
|
+
import { CheckboxIndicator as he, CheckboxRoot as ge, DialogClose as _e, DialogContent as ve, DialogDescription as ye, DialogOverlay as be, DialogPortal as xe, DialogRoot as Se, DialogTitle as Ce, DialogTrigger as we, DropdownMenuContent as Te, DropdownMenuGroup as Ee, DropdownMenuItem as De, DropdownMenuLabel as Oe, DropdownMenuPortal as ke, DropdownMenuRoot as Ae, DropdownMenuSeparator as je, DropdownMenuTrigger as Me, NumberFieldDecrement as Ne, NumberFieldIncrement as Pe, NumberFieldInput as Fe, NumberFieldRoot as Ie, PopoverContent as Le, PopoverRoot as Re, PopoverTrigger as ze, RadioGroupIndicator as Be, RadioGroupItem as Ve, RadioGroupRoot as He, SelectContent as Ue, SelectItem as We, SelectItemIndicator as Ge, SelectItemText as Ke, SelectRoot as qe, SelectTrigger as Je, SelectValue as Ye, TabsContent as Xe, TabsList as Ze, TabsRoot as Qe, TabsTrigger as $e, ToastAction as et, ToastClose as tt, ToastDescription as nt, ToastProvider as rt, ToastRoot as it, ToastTitle as at, ToastViewport as ot, TreeItem as st, TreeRoot as ct, VisuallyHidden as lt } from "reka-ui";
|
|
9
|
+
import { FlexRender as ut, createExpandedRowModel as dt, createPaginatedRowModel as ft, createSortedRowModel as pt, rowExpandingFeature as mt, rowPaginationFeature as ht, rowSortingFeature as gt, sortFns as _t, tableFeatures as vt, useTable as yt } from "@tanstack/vue-table";
|
|
10
10
|
//#region src/lib/cn.ts
|
|
11
|
-
function
|
|
11
|
+
function H(...n) {
|
|
12
12
|
return t(e(n));
|
|
13
13
|
}
|
|
14
14
|
//#endregion
|
|
15
15
|
//#region src/lib/date.ts
|
|
16
|
-
function
|
|
16
|
+
function bt(e) {
|
|
17
17
|
return new n(e.getFullYear(), e.getMonth() + 1, e.getDate());
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function xt(e) {
|
|
20
20
|
return e instanceof r ? e.toDate(i()) : new Date(e.year, e.month - 1, e.day);
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function St(e) {
|
|
23
23
|
let [t, n] = e.split(":").map(Number);
|
|
24
24
|
return t * 60 + (n || 0);
|
|
25
25
|
}
|
|
26
|
-
function
|
|
26
|
+
function U(e) {
|
|
27
27
|
let t = Math.floor(e / 60), n = e % 60;
|
|
28
28
|
return `${String(t).padStart(2, "0")}:${String(n).padStart(2, "0")}`;
|
|
29
29
|
}
|
|
30
|
-
function
|
|
30
|
+
function Ct(e, t) {
|
|
31
31
|
let n = new Date(e);
|
|
32
|
-
return n.setHours(Math.floor(
|
|
32
|
+
return n.setHours(Math.floor(St(t) / 60), St(t) % 60, 0, 0), n;
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function W(e, t) {
|
|
35
35
|
return !e || !t || e.getTime() <= t.getTime() ? [e, t] : [t, e];
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function wt(e) {
|
|
38
38
|
let t = e.getMonth() + 1, n = e.getDate();
|
|
39
39
|
return `${e.getFullYear()}-${String(t).padStart(2, "0")}-${String(n).padStart(2, "0")}`;
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function Tt(e) {
|
|
42
42
|
return e === "12" ? Array.from({ length: 12 }, (e, t) => t + 1) : Array.from({ length: 24 }, (e, t) => t);
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function Et(e) {
|
|
45
45
|
let t = Number.isFinite(e) && e > 0 ? e : 1, n = [];
|
|
46
46
|
for (let e = 0; e < 60; e += t) n.push(e);
|
|
47
47
|
return n;
|
|
48
48
|
}
|
|
49
|
-
function
|
|
49
|
+
function G(e) {
|
|
50
50
|
let t = (Math.trunc(e) % 24 + 24) % 24, n = t < 12 ? "am" : "pm";
|
|
51
51
|
return {
|
|
52
52
|
hour: t % 12 == 0 ? 12 : t % 12,
|
|
53
53
|
meridiem: n
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
|
-
function
|
|
56
|
+
function Dt(e, t) {
|
|
57
57
|
let n = Math.trunc(e) % 12;
|
|
58
58
|
return t === "pm" ? n + 12 : n;
|
|
59
59
|
}
|
|
60
60
|
//#endregion
|
|
61
61
|
//#region src/lib/locale.ts
|
|
62
|
-
function
|
|
62
|
+
function Ot(e) {
|
|
63
63
|
try {
|
|
64
64
|
let t = new Intl.Locale(e), n = t.weekInfo ?? t.getWeekInfo?.();
|
|
65
65
|
if (n && typeof n.firstDay == "number") return n.firstDay % 7;
|
|
66
66
|
} catch {}
|
|
67
67
|
return 1;
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function kt(e, t) {
|
|
70
70
|
let n = (Math.trunc(t) % 7 + 7) % 7, r = new Intl.DateTimeFormat(e, { weekday: "short" });
|
|
71
71
|
return Array.from({ length: 7 }, (e, t) => r.format(new Date(2026, 0, 4 + (n + t) % 7)));
|
|
72
72
|
}
|
|
73
|
-
function
|
|
73
|
+
function At(e, t) {
|
|
74
74
|
return new Intl.DateTimeFormat(t, {
|
|
75
75
|
month: "long",
|
|
76
76
|
year: "numeric"
|
|
77
77
|
}).format(e);
|
|
78
78
|
}
|
|
79
|
-
function
|
|
79
|
+
function K(e, t) {
|
|
80
80
|
return new Intl.DateTimeFormat(t, { dateStyle: "medium" }).format(e);
|
|
81
81
|
}
|
|
82
|
-
function
|
|
82
|
+
function jt(e, t, n) {
|
|
83
83
|
let r = n === "24" ? {
|
|
84
84
|
hour: "2-digit",
|
|
85
85
|
minute: "2-digit",
|
|
@@ -93,10 +93,10 @@ function Tt(e, t, n) {
|
|
|
93
93
|
}
|
|
94
94
|
//#endregion
|
|
95
95
|
//#region src/lib/number.ts
|
|
96
|
-
function
|
|
96
|
+
function Mt(e) {
|
|
97
97
|
return e == null || !Number.isFinite(e) ? null : e;
|
|
98
98
|
}
|
|
99
|
-
function
|
|
99
|
+
function Nt(e) {
|
|
100
100
|
return {
|
|
101
101
|
...e.currency ? {
|
|
102
102
|
style: "currency",
|
|
@@ -108,17 +108,17 @@ function Dt(e) {
|
|
|
108
108
|
}
|
|
109
109
|
//#endregion
|
|
110
110
|
//#region src/lib/icons.ts
|
|
111
|
-
function
|
|
111
|
+
function Pt(e) {
|
|
112
112
|
return e.split("-").map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join("");
|
|
113
113
|
}
|
|
114
|
-
var
|
|
115
|
-
function
|
|
114
|
+
var Ft = "circle";
|
|
115
|
+
function It(e) {
|
|
116
116
|
let t = e.trim();
|
|
117
|
-
return t ? t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase() :
|
|
117
|
+
return t ? t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase() : Ft;
|
|
118
118
|
}
|
|
119
119
|
//#endregion
|
|
120
120
|
//#region src/lib/tones.ts
|
|
121
|
-
var
|
|
121
|
+
var q = {
|
|
122
122
|
info: {
|
|
123
123
|
soft: "bg-primary-100 text-primary-800 dark:bg-primary-900/40 dark:text-primary-200",
|
|
124
124
|
outline: "border border-primary-300 text-primary-800 dark:border-primary-700 dark:text-primary-200",
|
|
@@ -149,14 +149,14 @@ var J = {
|
|
|
149
149
|
icon: "text-muted",
|
|
150
150
|
role: "status"
|
|
151
151
|
}
|
|
152
|
-
},
|
|
153
|
-
function
|
|
152
|
+
}, Lt = "myghf-theme", Rt = "both", zt = "system";
|
|
153
|
+
function J() {
|
|
154
154
|
return typeof window < "u" && typeof document < "u";
|
|
155
155
|
}
|
|
156
|
-
function
|
|
157
|
-
return !
|
|
156
|
+
function Bt() {
|
|
157
|
+
return !J() || typeof window.matchMedia != "function" ? "light" : window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
158
158
|
}
|
|
159
|
-
function
|
|
159
|
+
function Vt(e) {
|
|
160
160
|
try {
|
|
161
161
|
let t = window.localStorage.getItem(e);
|
|
162
162
|
return t === "light" || t === "dark" || t === "system" ? t : null;
|
|
@@ -164,22 +164,22 @@ function Ft(e) {
|
|
|
164
164
|
return null;
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
|
-
function
|
|
167
|
+
function Ht(e) {
|
|
168
168
|
return {
|
|
169
|
-
storageKey: e.storageKey ??
|
|
170
|
-
attribute: e.attribute ??
|
|
171
|
-
defaultMode: e.defaultMode ??
|
|
169
|
+
storageKey: e.storageKey ?? Lt,
|
|
170
|
+
attribute: e.attribute ?? Rt,
|
|
171
|
+
defaultMode: e.defaultMode ?? zt
|
|
172
172
|
};
|
|
173
173
|
}
|
|
174
|
-
function
|
|
175
|
-
let { storageKey: t, attribute: n, defaultMode: r } =
|
|
174
|
+
function Ut(e = {}) {
|
|
175
|
+
let { storageKey: t, attribute: n, defaultMode: r } = Ht(e), i = J() ? Vt(t) ?? r : r, a = C(i), s = o(() => a.value === "system" ? Bt() : a.value), c = o(() => s.value === "dark");
|
|
176
176
|
function l() {
|
|
177
|
-
if (!
|
|
177
|
+
if (!J()) return;
|
|
178
178
|
let e = c.value, t = document.documentElement;
|
|
179
179
|
n === "both" || n === "class" ? t.classList.toggle("dark", e) : t.classList.remove("dark"), (n === "both" || n === "data-theme") && e ? t.setAttribute("data-theme", "dark") : t.removeAttribute("data-theme");
|
|
180
180
|
}
|
|
181
181
|
function u(e) {
|
|
182
|
-
if (
|
|
182
|
+
if (J()) try {
|
|
183
183
|
e === "system" ? window.localStorage.removeItem(t) : window.localStorage.setItem(t, e);
|
|
184
184
|
} catch {}
|
|
185
185
|
}
|
|
@@ -196,7 +196,7 @@ function Lt(e = {}) {
|
|
|
196
196
|
d("light");
|
|
197
197
|
}
|
|
198
198
|
function h() {
|
|
199
|
-
if (a.value = "system",
|
|
199
|
+
if (a.value = "system", J()) try {
|
|
200
200
|
window.localStorage.removeItem(t);
|
|
201
201
|
} catch {}
|
|
202
202
|
l();
|
|
@@ -212,20 +212,20 @@ function Lt(e = {}) {
|
|
|
212
212
|
reset: h
|
|
213
213
|
};
|
|
214
214
|
}
|
|
215
|
-
var
|
|
216
|
-
function
|
|
217
|
-
return
|
|
215
|
+
var Wt = null;
|
|
216
|
+
function Gt(e) {
|
|
217
|
+
return Wt || (Wt = Ut(e), Wt);
|
|
218
218
|
}
|
|
219
219
|
//#endregion
|
|
220
220
|
//#region src/components/theme-toggle/ThemeToggle.vue?vue&type=script&setup=true&lang.ts
|
|
221
|
-
var
|
|
221
|
+
var Kt = ["aria-label", "aria-pressed"], qt = /* @__PURE__ */ p({
|
|
222
222
|
__name: "ThemeToggle",
|
|
223
223
|
props: {
|
|
224
224
|
size: { default: "default" },
|
|
225
225
|
label: { default: "Toggle theme" }
|
|
226
226
|
},
|
|
227
227
|
setup(e) {
|
|
228
|
-
let t = e, { isDark: n, toggle: r } =
|
|
228
|
+
let t = e, { isDark: n, toggle: r } = Gt(), i = {
|
|
229
229
|
sm: "h-8 px-3 text-xs",
|
|
230
230
|
default: "h-9 px-4",
|
|
231
231
|
lg: "h-10 px-6"
|
|
@@ -236,38 +236,35 @@ var Bt = ["aria-label", "aria-pressed"], Vt = /* @__PURE__ */ p({
|
|
|
236
236
|
"disabled:pointer-events-none disabled:opacity-50 [&_svg]:size-4",
|
|
237
237
|
i[t.size]
|
|
238
238
|
]);
|
|
239
|
-
return (t, i) => (
|
|
239
|
+
return (t, i) => (x(), l("button", {
|
|
240
240
|
type: "button",
|
|
241
241
|
class: g(a.value),
|
|
242
242
|
"aria-label": e.label,
|
|
243
|
-
"aria-pressed":
|
|
244
|
-
onClick: i[0] ||= (e) =>
|
|
245
|
-
}, [
|
|
243
|
+
"aria-pressed": O(n),
|
|
244
|
+
onClick: i[0] ||= (e) => O(r)()
|
|
245
|
+
}, [O(n) ? (x(), s(O(pe), { key: 0 })) : (x(), s(O(de), { key: 1 }))], 10, Kt));
|
|
246
246
|
}
|
|
247
|
-
}),
|
|
247
|
+
}), Y = /* @__PURE__ */ p({
|
|
248
248
|
__name: "Icon",
|
|
249
249
|
props: {
|
|
250
250
|
name: {},
|
|
251
251
|
size: { default: 16 }
|
|
252
252
|
},
|
|
253
253
|
setup(e) {
|
|
254
|
-
let t = e, n = o(() =>
|
|
255
|
-
return (t, r) => (
|
|
254
|
+
let t = e, n = o(() => I[Pt(It(t.name))] ?? I.Circle);
|
|
255
|
+
return (t, r) => (x(), s(E(n.value), {
|
|
256
256
|
size: e.size,
|
|
257
257
|
"aria-hidden": "true",
|
|
258
258
|
"data-icon": "",
|
|
259
259
|
name: e.name
|
|
260
260
|
}, null, 8, ["size", "name"]));
|
|
261
261
|
}
|
|
262
|
-
}),
|
|
262
|
+
}), Jt = [
|
|
263
263
|
"type",
|
|
264
264
|
"disabled",
|
|
265
|
-
"data-loading"
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
class: "size-4 animate-spin rounded-full border-2 border-current border-t-transparent",
|
|
269
|
-
"aria-hidden": "true"
|
|
270
|
-
}, Z = /* @__PURE__ */ p({
|
|
265
|
+
"data-loading",
|
|
266
|
+
"aria-busy"
|
|
267
|
+
], X = /* @__PURE__ */ p({
|
|
271
268
|
__name: "Button",
|
|
272
269
|
props: {
|
|
273
270
|
variant: { default: "default" },
|
|
@@ -281,10 +278,13 @@ var Bt = ["aria-label", "aria-pressed"], Vt = /* @__PURE__ */ p({
|
|
|
281
278
|
type: Boolean,
|
|
282
279
|
default: !1
|
|
283
280
|
},
|
|
284
|
-
label: {}
|
|
281
|
+
label: {},
|
|
282
|
+
icon: {},
|
|
283
|
+
iconTrailing: {},
|
|
284
|
+
iconPos: { default: "start" }
|
|
285
285
|
},
|
|
286
286
|
setup(e) {
|
|
287
|
-
let t =
|
|
287
|
+
let t = me({
|
|
288
288
|
base: "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-2 dark:focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 [&_svg]:size-4 data-[loading=true]:cursor-not-allowed",
|
|
289
289
|
variants: {
|
|
290
290
|
variant: {
|
|
@@ -306,72 +306,125 @@ var Bt = ["aria-label", "aria-pressed"], Vt = /* @__PURE__ */ p({
|
|
|
306
306
|
variant: "default",
|
|
307
307
|
size: "default"
|
|
308
308
|
}
|
|
309
|
-
}), n = e, r =
|
|
310
|
-
return (n, a) => (
|
|
309
|
+
}), n = e, r = k(), i = o(() => n.disabled || n.loading || !!r.disabled);
|
|
310
|
+
return (n, a) => (x(), l("button", h({
|
|
311
311
|
type: e.type,
|
|
312
312
|
disabled: i.value,
|
|
313
313
|
"data-loading": e.loading || void 0,
|
|
314
|
-
|
|
314
|
+
"aria-busy": e.loading || void 0,
|
|
315
|
+
class: O(t)({
|
|
315
316
|
variant: e.variant,
|
|
316
317
|
size: e.size
|
|
317
318
|
})
|
|
318
|
-
},
|
|
319
|
+
}, O(r)), [
|
|
320
|
+
e.loading ? (x(), s(Y, {
|
|
321
|
+
key: 0,
|
|
322
|
+
name: "loader-circle",
|
|
323
|
+
class: "animate-spin",
|
|
324
|
+
"aria-hidden": "true"
|
|
325
|
+
})) : e.iconPos === "start" && e.icon ? (x(), s(Y, {
|
|
326
|
+
key: 1,
|
|
327
|
+
name: e.icon,
|
|
328
|
+
"aria-hidden": "true"
|
|
329
|
+
}, null, 8, ["name"])) : c("", !0),
|
|
330
|
+
T(n.$slots, "default", {}, () => [d(D(e.label), 1)]),
|
|
331
|
+
e.iconTrailing ? (x(), s(Y, {
|
|
332
|
+
key: 2,
|
|
333
|
+
name: e.iconTrailing,
|
|
334
|
+
"aria-hidden": "true"
|
|
335
|
+
}, null, 8, ["name"])) : e.iconPos === "end" && e.icon ? (x(), s(Y, {
|
|
336
|
+
key: 3,
|
|
337
|
+
name: e.icon,
|
|
338
|
+
"aria-hidden": "true"
|
|
339
|
+
}, null, 8, ["name"])) : c("", !0)
|
|
340
|
+
], 16, Jt));
|
|
319
341
|
}
|
|
320
|
-
}),
|
|
342
|
+
}), Yt = Symbol("myghf-form-field");
|
|
343
|
+
function Z() {
|
|
344
|
+
return m(Yt, null);
|
|
345
|
+
}
|
|
346
|
+
//#endregion
|
|
347
|
+
//#region src/components/input/Input.vue?vue&type=script&setup=true&lang.ts
|
|
348
|
+
var Xt = { class: "relative w-full" }, Zt = [
|
|
349
|
+
"id",
|
|
350
|
+
"type",
|
|
351
|
+
"name",
|
|
352
|
+
"autocomplete",
|
|
321
353
|
"value",
|
|
322
354
|
"placeholder",
|
|
323
|
-
"disabled"
|
|
324
|
-
|
|
355
|
+
"disabled",
|
|
356
|
+
"required",
|
|
357
|
+
"aria-invalid",
|
|
358
|
+
"aria-describedby"
|
|
359
|
+
], Qt = /* @__PURE__ */ p({
|
|
325
360
|
__name: "Input",
|
|
326
361
|
props: {
|
|
327
362
|
modelValue: {},
|
|
328
363
|
placeholder: {},
|
|
329
364
|
disabled: { type: Boolean },
|
|
330
|
-
invalid: {
|
|
365
|
+
invalid: {
|
|
366
|
+
type: Boolean,
|
|
367
|
+
default: void 0
|
|
368
|
+
},
|
|
331
369
|
leadingIcon: {},
|
|
332
370
|
trailingIcon: {},
|
|
333
|
-
size: { default: "default" }
|
|
371
|
+
size: { default: "default" },
|
|
372
|
+
type: { default: "text" },
|
|
373
|
+
id: {},
|
|
374
|
+
name: {},
|
|
375
|
+
autocomplete: {},
|
|
376
|
+
required: {
|
|
377
|
+
type: Boolean,
|
|
378
|
+
default: void 0
|
|
379
|
+
}
|
|
334
380
|
},
|
|
335
381
|
emits: ["update:modelValue"],
|
|
336
382
|
setup(e, { expose: t, emit: n }) {
|
|
337
|
-
let r =
|
|
338
|
-
return t({ focus: () =>
|
|
339
|
-
e.leadingIcon ? (
|
|
383
|
+
let r = e, i = n, a = k(), d = C(), f = Z(), p = o(() => r.id ?? f?.id.value), m = o(() => r.invalid ?? f?.invalid.value ?? !1), g = o(() => r.required ?? f?.required.value ?? !1), _ = o(() => f?.describedBy.value);
|
|
384
|
+
return t({ focus: () => d.value?.focus() }), (t, n) => (x(), l("div", Xt, [
|
|
385
|
+
e.leadingIcon ? (x(), s(Y, {
|
|
340
386
|
key: 0,
|
|
341
387
|
name: e.leadingIcon,
|
|
342
388
|
class: "pointer-events-none absolute start-3 top-1/2 size-4 -translate-y-1/2 text-muted"
|
|
343
389
|
}, null, 8, ["name"])) : c("", !0),
|
|
344
390
|
u("input", h({
|
|
345
391
|
ref_key: "inputRef",
|
|
346
|
-
ref:
|
|
392
|
+
ref: d,
|
|
393
|
+
id: p.value,
|
|
394
|
+
type: e.type,
|
|
395
|
+
name: e.name,
|
|
396
|
+
autocomplete: e.autocomplete,
|
|
347
397
|
value: e.modelValue,
|
|
348
398
|
placeholder: e.placeholder,
|
|
349
399
|
disabled: e.disabled,
|
|
400
|
+
required: g.value,
|
|
401
|
+
"aria-invalid": m.value || void 0,
|
|
402
|
+
"aria-describedby": _.value,
|
|
350
403
|
class: [
|
|
351
404
|
"flex w-full rounded-md border border-border bg-surface px-3 py-1 text-sm text-foreground shadow-sm transition-colors placeholder:text-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 disabled:cursor-not-allowed disabled:opacity-50",
|
|
352
405
|
e.size === "sm" ? "h-8 text-xs" : e.size === "lg" ? "h-10" : "h-9",
|
|
353
406
|
e.leadingIcon ? "ps-9" : "ps-3",
|
|
354
407
|
e.trailingIcon ? "pe-9" : "pe-3",
|
|
355
|
-
|
|
408
|
+
m.value ? "border-error-500 focus-visible:ring-error-500" : ""
|
|
356
409
|
]
|
|
357
|
-
},
|
|
358
|
-
e.trailingIcon ? (
|
|
410
|
+
}, O(a), { onInput: n[0] ||= (e) => i("update:modelValue", e.target.value) }), null, 16, Zt),
|
|
411
|
+
e.trailingIcon ? (x(), s(Y, {
|
|
359
412
|
key: 1,
|
|
360
413
|
name: e.trailingIcon,
|
|
361
414
|
class: "pointer-events-none absolute end-3 top-1/2 size-4 -translate-y-1/2 text-muted"
|
|
362
415
|
}, null, 8, ["name"])) : c("", !0)
|
|
363
416
|
]));
|
|
364
417
|
}
|
|
365
|
-
}),
|
|
418
|
+
}), $t = {
|
|
366
419
|
key: 0,
|
|
367
420
|
class: "shrink-0 select-none text-muted"
|
|
368
|
-
},
|
|
421
|
+
}, en = {
|
|
369
422
|
key: 1,
|
|
370
423
|
class: "shrink-0 select-none text-muted"
|
|
371
|
-
},
|
|
424
|
+
}, tn = {
|
|
372
425
|
key: 2,
|
|
373
426
|
class: "ms-1 flex shrink-0 flex-col"
|
|
374
|
-
},
|
|
427
|
+
}, nn = /* @__PURE__ */ p({
|
|
375
428
|
inheritAttrs: !1,
|
|
376
429
|
__name: "InputNumber",
|
|
377
430
|
props: {
|
|
@@ -397,7 +450,7 @@ var Bt = ["aria-label", "aria-pressed"], Vt = /* @__PURE__ */ p({
|
|
|
397
450
|
},
|
|
398
451
|
emits: ["update:modelValue"],
|
|
399
452
|
setup(e, { emit: t }) {
|
|
400
|
-
let n = e, r = t, i =
|
|
453
|
+
let n = e, r = t, i = k(), a = o(() => Number.isFinite(n.step) && n.step > 0 ? n.step : 1), s = o(() => Nt({
|
|
401
454
|
currency: n.currency,
|
|
402
455
|
formatOptions: n.formatOptions,
|
|
403
456
|
integer: n.integer
|
|
@@ -408,11 +461,11 @@ var Bt = ["aria-label", "aria-pressed"], Vt = /* @__PURE__ */ p({
|
|
|
408
461
|
return;
|
|
409
462
|
}
|
|
410
463
|
});
|
|
411
|
-
return (t, n) => (
|
|
464
|
+
return (t, n) => (x(), l("div", { class: g(["relative flex w-full items-center rounded-md border border-border bg-surface px-3 text-sm text-foreground shadow-sm transition-colors focus-within:ring-2 focus-within:ring-primary-500", [
|
|
412
465
|
e.size === "sm" ? "h-8 text-xs" : e.size === "lg" ? "h-10" : "h-9",
|
|
413
466
|
e.invalid ? "border-error-500 focus-within:ring-error-500" : "",
|
|
414
467
|
e.disabled ? "cursor-not-allowed opacity-50" : ""
|
|
415
|
-
]]) }, [f(
|
|
468
|
+
]]) }, [f(O(Ie), {
|
|
416
469
|
"model-value": e.modelValue,
|
|
417
470
|
min: e.min,
|
|
418
471
|
max: e.max,
|
|
@@ -425,11 +478,11 @@ var Bt = ["aria-label", "aria-pressed"], Vt = /* @__PURE__ */ p({
|
|
|
425
478
|
id: e.id,
|
|
426
479
|
name: e.name,
|
|
427
480
|
class: "flex min-w-0 flex-1 items-center gap-1",
|
|
428
|
-
"onUpdate:modelValue": n[0] ||= (e) => r("update:modelValue",
|
|
481
|
+
"onUpdate:modelValue": n[0] ||= (e) => r("update:modelValue", O(Mt)(e))
|
|
429
482
|
}, {
|
|
430
|
-
default:
|
|
431
|
-
e.prefix ? (
|
|
432
|
-
f(
|
|
483
|
+
default: N(() => [
|
|
484
|
+
e.prefix ? (x(), l("span", $t, D(e.prefix), 1)) : c("", !0),
|
|
485
|
+
f(O(Fe), h(O(i), {
|
|
433
486
|
placeholder: e.placeholder,
|
|
434
487
|
"aria-invalid": e.invalid || void 0,
|
|
435
488
|
"aria-valuetext": u.value,
|
|
@@ -439,15 +492,15 @@ var Bt = ["aria-label", "aria-pressed"], Vt = /* @__PURE__ */ p({
|
|
|
439
492
|
"aria-invalid",
|
|
440
493
|
"aria-valuetext"
|
|
441
494
|
]),
|
|
442
|
-
e.suffix ? (
|
|
443
|
-
e.showButtons ? (
|
|
444
|
-
default:
|
|
495
|
+
e.suffix ? (x(), l("span", en, D(e.suffix), 1)) : c("", !0),
|
|
496
|
+
e.showButtons ? (x(), l("div", tn, [f(O(Pe), { class: "flex size-4 items-center justify-center rounded text-muted transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary-500 disabled:cursor-not-allowed disabled:opacity-40" }, {
|
|
497
|
+
default: N(() => [f(Y, {
|
|
445
498
|
name: "chevron-up",
|
|
446
499
|
size: 12
|
|
447
500
|
})]),
|
|
448
501
|
_: 1
|
|
449
|
-
}), f(
|
|
450
|
-
default:
|
|
502
|
+
}), f(O(Ne), { class: "flex size-4 items-center justify-center rounded text-muted transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary-500 disabled:cursor-not-allowed disabled:opacity-40" }, {
|
|
503
|
+
default: N(() => [f(Y, {
|
|
451
504
|
name: "chevron-down",
|
|
452
505
|
size: 12
|
|
453
506
|
})]),
|
|
@@ -469,42 +522,81 @@ var Bt = ["aria-label", "aria-pressed"], Vt = /* @__PURE__ */ p({
|
|
|
469
522
|
"name"
|
|
470
523
|
])], 2));
|
|
471
524
|
}
|
|
472
|
-
}),
|
|
525
|
+
}), rn = [
|
|
526
|
+
"id",
|
|
473
527
|
"value",
|
|
474
528
|
"placeholder",
|
|
475
529
|
"disabled",
|
|
476
|
-
"rows"
|
|
477
|
-
|
|
530
|
+
"rows",
|
|
531
|
+
"required",
|
|
532
|
+
"aria-invalid",
|
|
533
|
+
"aria-describedby"
|
|
534
|
+
], an = /* @__PURE__ */ p({
|
|
478
535
|
__name: "Textarea",
|
|
479
536
|
props: {
|
|
480
537
|
modelValue: {},
|
|
481
538
|
placeholder: {},
|
|
482
539
|
disabled: { type: Boolean },
|
|
483
540
|
rows: { default: 3 },
|
|
484
|
-
invalid: {
|
|
541
|
+
invalid: {
|
|
542
|
+
type: Boolean,
|
|
543
|
+
default: void 0
|
|
544
|
+
},
|
|
545
|
+
autoResize: { type: Boolean },
|
|
546
|
+
maxRows: {},
|
|
547
|
+
id: {},
|
|
548
|
+
required: {
|
|
549
|
+
type: Boolean,
|
|
550
|
+
default: void 0
|
|
551
|
+
}
|
|
485
552
|
},
|
|
486
553
|
emits: ["update:modelValue"],
|
|
487
554
|
setup(e, { emit: t }) {
|
|
488
|
-
let n =
|
|
489
|
-
|
|
555
|
+
let n = e, r = t, i = k(), a = C(), s = Z(), c = C(!1), u = o(() => n.id ?? s?.id.value), d = o(() => n.invalid ?? s?.invalid.value ?? !1), f = o(() => n.required ?? s?.required.value ?? !1), p = o(() => s?.describedBy.value);
|
|
556
|
+
function m() {
|
|
557
|
+
if (!n.autoResize || !a.value) return;
|
|
558
|
+
let e = a.value;
|
|
559
|
+
e.style.height = "auto";
|
|
560
|
+
let t = e.scrollHeight, r = t;
|
|
561
|
+
if (c.value = !1, n.maxRows && t) {
|
|
562
|
+
let i = parseFloat(getComputedStyle(e).lineHeight) || 0, a = n.maxRows * i;
|
|
563
|
+
a > 0 && t > a && (r = a, c.value = !0);
|
|
564
|
+
}
|
|
565
|
+
e.style.height = t ? `${r}px` : "";
|
|
566
|
+
}
|
|
567
|
+
function g(e) {
|
|
568
|
+
r("update:modelValue", e.target.value), m();
|
|
569
|
+
}
|
|
570
|
+
return b(m), M(() => n.modelValue, m, { flush: "post" }), (t, n) => (x(), l("textarea", h({
|
|
571
|
+
ref_key: "el",
|
|
572
|
+
ref: a,
|
|
573
|
+
id: u.value,
|
|
490
574
|
value: e.modelValue,
|
|
491
575
|
placeholder: e.placeholder,
|
|
492
576
|
disabled: e.disabled,
|
|
493
577
|
rows: e.rows,
|
|
494
|
-
|
|
495
|
-
|
|
578
|
+
required: f.value,
|
|
579
|
+
"aria-invalid": d.value || void 0,
|
|
580
|
+
"aria-describedby": p.value,
|
|
581
|
+
class: [
|
|
582
|
+
"w-full rounded-md border border-border bg-surface px-3 py-2 text-sm text-foreground shadow-sm transition-colors placeholder:text-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 disabled:cursor-not-allowed disabled:opacity-50",
|
|
583
|
+
d.value ? "border-error-500 focus-visible:ring-error-500" : "",
|
|
584
|
+
e.autoResize ? "resize-none" : "",
|
|
585
|
+
c.value ? "overflow-y-auto" : ""
|
|
586
|
+
]
|
|
587
|
+
}, O(i), { onInput: g }), null, 16, rn));
|
|
496
588
|
}
|
|
497
|
-
}),
|
|
589
|
+
}), on = { class: "w-full" }, sn = { class: "relative w-full" }, cn = [
|
|
498
590
|
"id",
|
|
499
591
|
"type",
|
|
500
592
|
"value",
|
|
501
593
|
"placeholder",
|
|
502
594
|
"disabled"
|
|
503
|
-
],
|
|
595
|
+
], ln = ["disabled"], un = {
|
|
504
596
|
key: 0,
|
|
505
597
|
class: "mt-1.5 flex items-center gap-1.5",
|
|
506
598
|
"aria-hidden": "true"
|
|
507
|
-
},
|
|
599
|
+
}, dn = /* @__PURE__ */ p({
|
|
508
600
|
__name: "Password",
|
|
509
601
|
props: {
|
|
510
602
|
modelValue: {},
|
|
@@ -519,13 +611,13 @@ var Bt = ["aria-label", "aria-pressed"], Vt = /* @__PURE__ */ p({
|
|
|
519
611
|
},
|
|
520
612
|
emits: ["update:modelValue"],
|
|
521
613
|
setup(e, { emit: t }) {
|
|
522
|
-
let n = e, r = t, i =
|
|
614
|
+
let n = e, r = t, i = k(), d = C(!1), f = o(() => d.value ? "text" : "password"), p = o(() => {
|
|
523
615
|
let e = n.modelValue ?? "";
|
|
524
616
|
if (e.length === 0) return 0;
|
|
525
617
|
let t = 0;
|
|
526
618
|
return e.length >= 8 && t++, e.length >= 12 && t++, /[A-Z]/.test(e) && /[a-z]/.test(e) && t++, /\d/.test(e) && t++, /[^A-Za-z0-9]/.test(e) && t++, Math.max(1, Math.min(4, Math.ceil(t / 5 * 4)));
|
|
527
619
|
});
|
|
528
|
-
return (t, n) => (
|
|
620
|
+
return (t, n) => (x(), l("div", on, [u("div", sn, [u("input", h({
|
|
529
621
|
id: e.id,
|
|
530
622
|
type: f.value,
|
|
531
623
|
value: e.modelValue,
|
|
@@ -536,24 +628,116 @@ var Bt = ["aria-label", "aria-pressed"], Vt = /* @__PURE__ */ p({
|
|
|
536
628
|
e.invalid ? "border-error-500 focus-visible:ring-error-500" : "",
|
|
537
629
|
"pe-10"
|
|
538
630
|
]
|
|
539
|
-
},
|
|
631
|
+
}, O(i), { onInput: n[0] ||= (e) => r("update:modelValue", e.target.value) }), null, 16, cn), u("button", {
|
|
540
632
|
type: "button",
|
|
541
633
|
disabled: e.disabled,
|
|
542
634
|
"aria-label": "Toggle password visibility",
|
|
543
635
|
class: "absolute end-2 top-1/2 -translate-y-1/2 rounded p-1 text-muted transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500",
|
|
544
636
|
onClick: n[1] ||= (e) => d.value = !d.value
|
|
545
|
-
}, [d.value ? (
|
|
637
|
+
}, [d.value ? (x(), s(O(ue), {
|
|
546
638
|
key: 0,
|
|
547
639
|
class: "size-4"
|
|
548
|
-
})) : (
|
|
640
|
+
})) : (x(), s(O(le), {
|
|
549
641
|
key: 1,
|
|
550
642
|
class: "size-4"
|
|
551
|
-
}))], 8,
|
|
643
|
+
}))], 8, ln)]), e.feedback && e.modelValue ? (x(), l("div", un, [(x(), l(a, null, w(4, (e) => u("span", {
|
|
552
644
|
key: e,
|
|
553
645
|
class: g(["h-1 flex-1 rounded-full transition-colors", e <= p.value ? "bg-success-500" : "bg-surface-muted"])
|
|
554
646
|
}, null, 2)), 64))])) : c("", !0)]));
|
|
555
647
|
}
|
|
556
|
-
}),
|
|
648
|
+
}), fn = ["for"], pn = {
|
|
649
|
+
key: 0,
|
|
650
|
+
class: "text-error-600",
|
|
651
|
+
"aria-hidden": "true"
|
|
652
|
+
}, mn = /* @__PURE__ */ p({
|
|
653
|
+
__name: "Label",
|
|
654
|
+
props: {
|
|
655
|
+
for: {},
|
|
656
|
+
required: { type: Boolean }
|
|
657
|
+
},
|
|
658
|
+
setup(e) {
|
|
659
|
+
let t = e, n = Z(), r = o(() => t.for ?? n?.id.value);
|
|
660
|
+
return (t, n) => (x(), l("label", {
|
|
661
|
+
for: r.value,
|
|
662
|
+
class: "text-sm font-medium text-foreground text-start"
|
|
663
|
+
}, [T(t.$slots, "default"), e.required ? (x(), l("span", pn, "*")) : c("", !0)], 8, fn));
|
|
664
|
+
}
|
|
665
|
+
}), hn = ["id"], gn = /* @__PURE__ */ p({
|
|
666
|
+
__name: "FormDescription",
|
|
667
|
+
props: { id: {} },
|
|
668
|
+
setup(e) {
|
|
669
|
+
return (t, n) => t.$slots.default ? (x(), l("p", {
|
|
670
|
+
key: 0,
|
|
671
|
+
id: e.id,
|
|
672
|
+
class: "text-sm text-muted"
|
|
673
|
+
}, [T(t.$slots, "default")], 8, hn)) : c("", !0);
|
|
674
|
+
}
|
|
675
|
+
}), _n = ["id"], vn = /* @__PURE__ */ p({
|
|
676
|
+
__name: "FormMessage",
|
|
677
|
+
props: { id: {} },
|
|
678
|
+
setup(e) {
|
|
679
|
+
return (t, n) => t.$slots.default ? (x(), l("p", {
|
|
680
|
+
key: 0,
|
|
681
|
+
id: e.id,
|
|
682
|
+
role: "alert",
|
|
683
|
+
class: "text-sm text-error-600"
|
|
684
|
+
}, [T(t.$slots, "default")], 8, _n)) : c("", !0);
|
|
685
|
+
}
|
|
686
|
+
}), yn = { class: "grid gap-2" }, bn = /* @__PURE__ */ p({
|
|
687
|
+
__name: "FormField",
|
|
688
|
+
props: {
|
|
689
|
+
label: {},
|
|
690
|
+
description: {},
|
|
691
|
+
error: {},
|
|
692
|
+
required: { type: Boolean },
|
|
693
|
+
invalid: {
|
|
694
|
+
type: Boolean,
|
|
695
|
+
default: void 0
|
|
696
|
+
},
|
|
697
|
+
id: {}
|
|
698
|
+
},
|
|
699
|
+
setup(e) {
|
|
700
|
+
let t = e, n = te(), r = C(0);
|
|
701
|
+
y(() => {
|
|
702
|
+
r.value++;
|
|
703
|
+
});
|
|
704
|
+
let i = ee(), a = o(() => t.id ?? i), u = o(() => t.invalid ?? !!t.error), f = o(() => t.required ?? !1), p = o(() => {
|
|
705
|
+
r.value;
|
|
706
|
+
let e = [];
|
|
707
|
+
return (t.description || n.description) && e.push(`${a.value}-description`), (t.error || n.error) && e.push(`${a.value}-error`), e.length > 0 ? e.join(" ") : void 0;
|
|
708
|
+
});
|
|
709
|
+
return S(Yt, {
|
|
710
|
+
id: a,
|
|
711
|
+
describedBy: p,
|
|
712
|
+
invalid: u,
|
|
713
|
+
required: f
|
|
714
|
+
}), (t, n) => (x(), l("div", yn, [
|
|
715
|
+
e.label || t.$slots.label ? (x(), s(mn, {
|
|
716
|
+
key: 0,
|
|
717
|
+
for: a.value,
|
|
718
|
+
required: f.value
|
|
719
|
+
}, {
|
|
720
|
+
default: N(() => [T(t.$slots, "label", {}, () => [d(D(e.label), 1)])]),
|
|
721
|
+
_: 3
|
|
722
|
+
}, 8, ["for", "required"])) : c("", !0),
|
|
723
|
+
T(t.$slots, "default"),
|
|
724
|
+
e.description || t.$slots.description ? (x(), s(gn, {
|
|
725
|
+
key: 1,
|
|
726
|
+
id: `${a.value}-description`
|
|
727
|
+
}, {
|
|
728
|
+
default: N(() => [T(t.$slots, "description", {}, () => [d(D(e.description), 1)])]),
|
|
729
|
+
_: 3
|
|
730
|
+
}, 8, ["id"])) : c("", !0),
|
|
731
|
+
e.error || t.$slots.error ? (x(), s(vn, {
|
|
732
|
+
key: 2,
|
|
733
|
+
id: `${a.value}-error`
|
|
734
|
+
}, {
|
|
735
|
+
default: N(() => [T(t.$slots, "error", {}, () => [d(D(e.error), 1)])]),
|
|
736
|
+
_: 3
|
|
737
|
+
}, 8, ["id"])) : c("", !0)
|
|
738
|
+
]));
|
|
739
|
+
}
|
|
740
|
+
}), xn = /* @__PURE__ */ p({
|
|
557
741
|
__name: "Checkbox",
|
|
558
742
|
props: {
|
|
559
743
|
modelValue: {
|
|
@@ -566,15 +750,15 @@ var Bt = ["aria-label", "aria-pressed"], Vt = /* @__PURE__ */ p({
|
|
|
566
750
|
emits: ["update:modelValue"],
|
|
567
751
|
setup(e, { emit: t }) {
|
|
568
752
|
let n = t;
|
|
569
|
-
return (t, r) => (
|
|
753
|
+
return (t, r) => (x(), s(O(ge), {
|
|
570
754
|
id: e.id,
|
|
571
755
|
"model-value": e.modelValue,
|
|
572
756
|
disabled: e.disabled,
|
|
573
757
|
class: "peer size-4 shrink-0 rounded border border-border bg-surface shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-2 dark:focus-visible:ring-offset-background data-[state=checked]:border-primary-500 data-[state=checked]:bg-primary-500 data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50",
|
|
574
758
|
"onUpdate:modelValue": r[0] ||= (e) => n("update:modelValue", e)
|
|
575
759
|
}, {
|
|
576
|
-
default:
|
|
577
|
-
default:
|
|
760
|
+
default: N(() => [f(O(he), { class: "flex items-center justify-center text-white" }, {
|
|
761
|
+
default: N(() => [f(O(L), { class: "size-3.5" })]),
|
|
578
762
|
_: 1
|
|
579
763
|
})]),
|
|
580
764
|
_: 1
|
|
@@ -584,7 +768,7 @@ var Bt = ["aria-label", "aria-pressed"], Vt = /* @__PURE__ */ p({
|
|
|
584
768
|
"disabled"
|
|
585
769
|
]));
|
|
586
770
|
}
|
|
587
|
-
}),
|
|
771
|
+
}), Sn = ["aria-label"], Cn = /* @__PURE__ */ p({
|
|
588
772
|
__name: "Tag",
|
|
589
773
|
props: {
|
|
590
774
|
tone: { default: "secondary" },
|
|
@@ -595,26 +779,26 @@ var Bt = ["aria-label", "aria-pressed"], Vt = /* @__PURE__ */ p({
|
|
|
595
779
|
emits: ["remove"],
|
|
596
780
|
setup(e, { emit: t }) {
|
|
597
781
|
let n = t;
|
|
598
|
-
return (t, r) => (
|
|
599
|
-
e.icon ? (
|
|
782
|
+
return (t, r) => (x(), l("span", { class: g(["inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium", O(q)[e.tone].soft]) }, [
|
|
783
|
+
e.icon ? (x(), s(Y, {
|
|
600
784
|
key: 0,
|
|
601
785
|
name: e.icon,
|
|
602
786
|
class: "size-3"
|
|
603
787
|
}, null, 8, ["name"])) : c("", !0),
|
|
604
|
-
|
|
605
|
-
e.removable ? (
|
|
788
|
+
T(t.$slots, "default"),
|
|
789
|
+
e.removable ? (x(), l("button", {
|
|
606
790
|
key: 1,
|
|
607
791
|
type: "button",
|
|
608
792
|
"aria-label": e.removeLabel,
|
|
609
793
|
class: "-me-0.5 ms-0.5 rounded-full p-0.5 transition-colors hover:bg-black/10 dark:hover:bg-white/10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500",
|
|
610
|
-
onClick: r[0] ||=
|
|
611
|
-
}, [f(
|
|
794
|
+
onClick: r[0] ||= F((e) => n("remove"), ["stop"])
|
|
795
|
+
}, [f(O(V), { class: "size-3" })], 8, Sn)) : c("", !0)
|
|
612
796
|
], 2));
|
|
613
797
|
}
|
|
614
|
-
}),
|
|
798
|
+
}), wn = ["role"], Tn = { class: "min-w-0 flex-1" }, En = {
|
|
615
799
|
key: 0,
|
|
616
800
|
class: "font-medium"
|
|
617
|
-
},
|
|
801
|
+
}, Dn = ["aria-label"], On = /* @__PURE__ */ p({
|
|
618
802
|
__name: "Alert",
|
|
619
803
|
props: {
|
|
620
804
|
tone: { default: "info" },
|
|
@@ -641,113 +825,201 @@ var Bt = ["aria-label", "aria-pressed"], Vt = /* @__PURE__ */ p({
|
|
|
641
825
|
warning: "triangle-alert",
|
|
642
826
|
danger: "circle-alert",
|
|
643
827
|
secondary: "info"
|
|
644
|
-
}, a =
|
|
645
|
-
function
|
|
828
|
+
}, a = C(!1), o = C(!1), p = C(!1), m, h = 0, _ = 0;
|
|
829
|
+
function y() {
|
|
646
830
|
m !== void 0 && (clearTimeout(m), m = void 0);
|
|
647
831
|
}
|
|
648
|
-
function
|
|
649
|
-
|
|
832
|
+
function S(e) {
|
|
833
|
+
y(), !(e <= 0) && (_ = e, h = Date.now() + e, m = setTimeout(j, e));
|
|
650
834
|
}
|
|
651
|
-
function
|
|
652
|
-
m !== void 0 && (
|
|
835
|
+
function w() {
|
|
836
|
+
m !== void 0 && (y(), _ = Math.max(0, h - Date.now()));
|
|
653
837
|
}
|
|
654
|
-
function
|
|
838
|
+
function E() {
|
|
655
839
|
if (!(a.value || o.value || p.value || m !== void 0) && !(!n.duration || n.duration <= 0)) {
|
|
656
840
|
if (_ <= 0) {
|
|
657
841
|
j();
|
|
658
842
|
return;
|
|
659
843
|
}
|
|
660
|
-
|
|
844
|
+
S(_);
|
|
661
845
|
}
|
|
662
846
|
}
|
|
663
|
-
function ee() {
|
|
664
|
-
o.value = !0, T();
|
|
665
|
-
}
|
|
666
847
|
function k() {
|
|
667
|
-
o.value = !
|
|
848
|
+
o.value = !0, w();
|
|
668
849
|
}
|
|
669
|
-
function
|
|
670
|
-
|
|
850
|
+
function ee() {
|
|
851
|
+
o.value = !1, E();
|
|
671
852
|
}
|
|
672
853
|
function te() {
|
|
673
|
-
p.value = !
|
|
854
|
+
p.value = !0, w();
|
|
855
|
+
}
|
|
856
|
+
function A() {
|
|
857
|
+
p.value = !1, E();
|
|
674
858
|
}
|
|
675
859
|
function j() {
|
|
676
|
-
a.value || (a.value = !0,
|
|
860
|
+
a.value || (a.value = !0, y(), r("close"));
|
|
677
861
|
}
|
|
678
|
-
return
|
|
679
|
-
n.duration && n.duration > 0 &&
|
|
680
|
-
}), v(
|
|
862
|
+
return b(() => {
|
|
863
|
+
n.duration && n.duration > 0 && S(n.duration);
|
|
864
|
+
}), v(y), (t, n) => a.value ? c("", !0) : (x(), l("div", {
|
|
681
865
|
key: 0,
|
|
682
|
-
role:
|
|
683
|
-
class: g(["flex w-full items-start gap-3 rounded-lg p-4 text-sm",
|
|
684
|
-
onMouseenter:
|
|
685
|
-
onMouseleave:
|
|
686
|
-
onFocusin:
|
|
687
|
-
onFocusout:
|
|
866
|
+
role: O(q)[e.tone].role,
|
|
867
|
+
class: g(["flex w-full items-start gap-3 rounded-lg p-4 text-sm", O(q)[e.tone][e.variant]]),
|
|
868
|
+
onMouseenter: k,
|
|
869
|
+
onMouseleave: ee,
|
|
870
|
+
onFocusin: te,
|
|
871
|
+
onFocusout: A
|
|
688
872
|
}, [
|
|
689
|
-
|
|
873
|
+
T(t.$slots, "icon", {}, () => [e.showIcon ? (x(), s(Y, {
|
|
690
874
|
key: 0,
|
|
691
875
|
name: e.icon || i[e.tone],
|
|
692
|
-
class: g(["mt-0.5 size-4 shrink-0",
|
|
876
|
+
class: g(["mt-0.5 size-4 shrink-0", O(q)[e.tone].icon])
|
|
693
877
|
}, null, 8, ["name", "class"])) : c("", !0)]),
|
|
694
|
-
u("div",
|
|
695
|
-
e.title || t.$slots.title ? (
|
|
696
|
-
e.description || t.$slots.description ? (
|
|
878
|
+
u("div", Tn, [
|
|
879
|
+
e.title || t.$slots.title ? (x(), l("p", En, [T(t.$slots, "title", {}, () => [d(D(e.title), 1)])])) : c("", !0),
|
|
880
|
+
e.description || t.$slots.description ? (x(), l("div", {
|
|
697
881
|
key: 1,
|
|
698
882
|
class: g(["leading-relaxed", e.title || t.$slots.title ? "mt-1" : ""])
|
|
699
|
-
}, [
|
|
700
|
-
|
|
883
|
+
}, [T(t.$slots, "description", {}, () => [d(D(e.description), 1)])], 2)) : c("", !0),
|
|
884
|
+
T(t.$slots, "default")
|
|
701
885
|
]),
|
|
702
|
-
|
|
703
|
-
e.closable ? (
|
|
886
|
+
T(t.$slots, "actions"),
|
|
887
|
+
e.closable ? (x(), l("button", {
|
|
704
888
|
key: 0,
|
|
705
889
|
type: "button",
|
|
706
890
|
"aria-label": e.closeLabel,
|
|
707
891
|
class: "-me-1 -mt-1 ms-auto shrink-0 rounded-md p-1 transition-colors hover:bg-black/10 dark:hover:bg-white/10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500",
|
|
708
892
|
onClick: j
|
|
709
|
-
}, [
|
|
710
|
-
], 42,
|
|
893
|
+
}, [T(t.$slots, "close", {}, () => [f(O(V), { class: "size-4" })])], 8, Dn)) : c("", !0)
|
|
894
|
+
], 42, wn));
|
|
895
|
+
}
|
|
896
|
+
}), kn = { class: "sr-only" }, An = /* @__PURE__ */ p({
|
|
897
|
+
__name: "Spinner",
|
|
898
|
+
props: {
|
|
899
|
+
size: { default: "default" },
|
|
900
|
+
label: { default: "Loading…" },
|
|
901
|
+
tone: { default: "info" }
|
|
902
|
+
},
|
|
903
|
+
setup(e) {
|
|
904
|
+
let t = e, n = {
|
|
905
|
+
sm: "size-4",
|
|
906
|
+
default: "size-5",
|
|
907
|
+
lg: "size-6"
|
|
908
|
+
}, r = o(() => H("inline-flex items-center", q[t.tone].icon));
|
|
909
|
+
return (t, i) => (x(), l("span", {
|
|
910
|
+
role: "status",
|
|
911
|
+
"aria-live": "polite",
|
|
912
|
+
class: g(r.value)
|
|
913
|
+
}, [f(Y, {
|
|
914
|
+
name: "loader-circle",
|
|
915
|
+
class: g(O(H)("animate-spin", n[e.size])),
|
|
916
|
+
"aria-hidden": "true"
|
|
917
|
+
}, null, 8, ["class"]), u("span", kn, D(e.label), 1)], 2));
|
|
918
|
+
}
|
|
919
|
+
}), jn = /* @__PURE__ */ p({
|
|
920
|
+
inheritAttrs: !1,
|
|
921
|
+
__name: "Skeleton",
|
|
922
|
+
props: {
|
|
923
|
+
rounded: { default: "md" },
|
|
924
|
+
width: {},
|
|
925
|
+
height: {}
|
|
926
|
+
},
|
|
927
|
+
setup(e) {
|
|
928
|
+
let t = me({
|
|
929
|
+
base: "animate-pulse bg-surface-muted",
|
|
930
|
+
variants: { rounded: {
|
|
931
|
+
none: "",
|
|
932
|
+
sm: "rounded-sm",
|
|
933
|
+
md: "rounded-md",
|
|
934
|
+
lg: "rounded-lg",
|
|
935
|
+
full: "rounded-full"
|
|
936
|
+
} },
|
|
937
|
+
defaultVariants: { rounded: "md" }
|
|
938
|
+
});
|
|
939
|
+
return (n, r) => (x(), l("div", h({
|
|
940
|
+
class: O(t)({ rounded: e.rounded }),
|
|
941
|
+
style: {
|
|
942
|
+
width: e.width,
|
|
943
|
+
height: e.height
|
|
944
|
+
}
|
|
945
|
+
}, n.$attrs), [T(n.$slots, "default")], 16));
|
|
711
946
|
}
|
|
712
|
-
}),
|
|
947
|
+
}), Mn = ["src", "alt"], Nn = ["role", "aria-label"], Pn = /* @__PURE__ */ p({
|
|
948
|
+
inheritAttrs: !1,
|
|
949
|
+
__name: "Avatar",
|
|
950
|
+
props: {
|
|
951
|
+
src: {},
|
|
952
|
+
alt: {},
|
|
953
|
+
name: {},
|
|
954
|
+
initials: {},
|
|
955
|
+
size: { default: "default" }
|
|
956
|
+
},
|
|
957
|
+
setup(e) {
|
|
958
|
+
let t = e, n = {
|
|
959
|
+
sm: "size-6 text-xs",
|
|
960
|
+
default: "size-8 text-sm",
|
|
961
|
+
lg: "size-10 text-base",
|
|
962
|
+
xl: "size-14 text-lg"
|
|
963
|
+
};
|
|
964
|
+
function r(e) {
|
|
965
|
+
return e ? e.trim().split(/\s+/).filter(Boolean).slice(0, 2).map((e) => e.charAt(0)).join("").toUpperCase() : "";
|
|
966
|
+
}
|
|
967
|
+
let i = o(() => t.initials ?? r(t.name)), a = o(() => n[t.size]), s = o(() => {
|
|
968
|
+
let e = t.alt ?? t.name ?? i.value;
|
|
969
|
+
return e === "" ? void 0 : e;
|
|
970
|
+
}), c = C(!1);
|
|
971
|
+
return M(() => t.src, () => {
|
|
972
|
+
c.value = !1;
|
|
973
|
+
}), (t, n) => e.src && !c.value ? (x(), l("img", h({ key: 0 }, t.$attrs, {
|
|
974
|
+
src: e.src,
|
|
975
|
+
alt: e.alt ?? e.name ?? "",
|
|
976
|
+
class: O(H)(a.value, "shrink-0 rounded-full object-cover"),
|
|
977
|
+
onError: n[0] ||= (e) => c.value = !0
|
|
978
|
+
}), null, 16, Mn)) : (x(), l("span", h({ key: 1 }, t.$attrs, {
|
|
979
|
+
role: s.value ? "img" : void 0,
|
|
980
|
+
"aria-label": s.value,
|
|
981
|
+
class: O(H)(a.value, O(q).info.soft, "inline-flex shrink-0 items-center justify-center rounded-full font-medium")
|
|
982
|
+
}), D(i.value), 17, Nn));
|
|
983
|
+
}
|
|
984
|
+
}), Fn = /* @__PURE__ */ p({
|
|
713
985
|
__name: "Tabs",
|
|
714
986
|
props: { modelValue: {} },
|
|
715
987
|
emits: ["update:modelValue"],
|
|
716
988
|
setup(e, { emit: t }) {
|
|
717
989
|
let n = t;
|
|
718
|
-
return (t, r) => (
|
|
990
|
+
return (t, r) => (x(), s(O(Qe), {
|
|
719
991
|
"model-value": e.modelValue,
|
|
720
992
|
"onUpdate:modelValue": r[0] ||= (e) => n("update:modelValue", e)
|
|
721
993
|
}, {
|
|
722
|
-
default:
|
|
994
|
+
default: N(() => [T(t.$slots, "default")]),
|
|
723
995
|
_: 3
|
|
724
996
|
}, 8, ["model-value"]));
|
|
725
997
|
}
|
|
726
|
-
}),
|
|
998
|
+
}), In = /* @__PURE__ */ p({
|
|
727
999
|
__name: "TabsList",
|
|
728
1000
|
setup(e) {
|
|
729
|
-
return (e, t) => (
|
|
730
|
-
default:
|
|
1001
|
+
return (e, t) => (x(), s(O(Ze), { class: "inline-flex h-9 w-full items-center justify-start gap-1 rounded-lg bg-surface-muted p-1 text-muted" }, {
|
|
1002
|
+
default: N(() => [T(e.$slots, "default")]),
|
|
731
1003
|
_: 3
|
|
732
1004
|
}));
|
|
733
1005
|
}
|
|
734
|
-
}),
|
|
1006
|
+
}), Ln = /* @__PURE__ */ p({
|
|
735
1007
|
__name: "TabsTrigger",
|
|
736
1008
|
props: {
|
|
737
1009
|
value: {},
|
|
738
1010
|
disabled: { type: Boolean }
|
|
739
1011
|
},
|
|
740
1012
|
setup(e) {
|
|
741
|
-
return (t, n) => (
|
|
1013
|
+
return (t, n) => (x(), s(O($e), {
|
|
742
1014
|
value: e.value,
|
|
743
1015
|
disabled: e.disabled,
|
|
744
1016
|
class: "inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 data-[state=active]:bg-surface data-[state=active]:text-foreground data-[state=active]:shadow-sm data-[disabled]:opacity-50"
|
|
745
1017
|
}, {
|
|
746
|
-
default:
|
|
1018
|
+
default: N(() => [T(t.$slots, "default")]),
|
|
747
1019
|
_: 3
|
|
748
1020
|
}, 8, ["value", "disabled"]));
|
|
749
1021
|
}
|
|
750
|
-
}),
|
|
1022
|
+
}), Rn = /* @__PURE__ */ p({
|
|
751
1023
|
__name: "TabsContent",
|
|
752
1024
|
props: {
|
|
753
1025
|
value: {},
|
|
@@ -757,15 +1029,15 @@ var Bt = ["aria-label", "aria-pressed"], Vt = /* @__PURE__ */ p({
|
|
|
757
1029
|
}
|
|
758
1030
|
},
|
|
759
1031
|
setup(e) {
|
|
760
|
-
return (t, n) => (
|
|
1032
|
+
return (t, n) => (x(), s(O(Xe), {
|
|
761
1033
|
value: e.value,
|
|
762
1034
|
class: g(["focus-visible:outline-none", e.padding ? "pt-4" : ""])
|
|
763
1035
|
}, {
|
|
764
|
-
default:
|
|
1036
|
+
default: N(() => [T(t.$slots, "default")]),
|
|
765
1037
|
_: 3
|
|
766
1038
|
}, 8, ["value", "class"]));
|
|
767
1039
|
}
|
|
768
|
-
}),
|
|
1040
|
+
}), zn = { class: "truncate" }, Bn = { class: "ms-auto flex shrink-0 items-center gap-1" }, Vn = /* @__PURE__ */ p({
|
|
769
1041
|
__name: "Select",
|
|
770
1042
|
props: {
|
|
771
1043
|
modelValue: {},
|
|
@@ -777,57 +1049,76 @@ var Bt = ["aria-label", "aria-pressed"], Vt = /* @__PURE__ */ p({
|
|
|
777
1049
|
disabled: { type: Boolean },
|
|
778
1050
|
multiple: { type: Boolean },
|
|
779
1051
|
size: { default: "default" },
|
|
780
|
-
invalid: {
|
|
1052
|
+
invalid: {
|
|
1053
|
+
type: Boolean,
|
|
1054
|
+
default: void 0
|
|
1055
|
+
},
|
|
1056
|
+
id: {},
|
|
1057
|
+
required: {
|
|
1058
|
+
type: Boolean,
|
|
1059
|
+
default: void 0
|
|
1060
|
+
}
|
|
781
1061
|
},
|
|
782
1062
|
emits: ["update:modelValue"],
|
|
783
1063
|
setup(e, { emit: t }) {
|
|
784
|
-
let n = e, r = t, i =
|
|
785
|
-
function
|
|
1064
|
+
let n = e, r = t, i = Z(), p = o(() => n.id ?? i?.id.value), m = o(() => n.invalid ?? i?.invalid.value ?? !1), g = o(() => n.required ?? i?.required.value ?? !1), _ = o(() => i?.describedBy.value), v = C(!1);
|
|
1065
|
+
function y(e) {
|
|
786
1066
|
return e && typeof e == "object" && n.optionValue ? e[n.optionValue] ?? e : e;
|
|
787
1067
|
}
|
|
788
|
-
function
|
|
1068
|
+
function b(e) {
|
|
789
1069
|
return e && typeof e == "object" && n.optionLabel ? String(e[n.optionLabel] ?? "") : e == null ? "" : String(e);
|
|
790
1070
|
}
|
|
791
|
-
let
|
|
792
|
-
function
|
|
1071
|
+
let S = o(() => n.multiple ? (Array.isArray(n.modelValue) ? n.modelValue : []).map((e) => b(n.options?.find((t) => y(t) === e))).filter(Boolean).join(", ") : n.modelValue == null ? "" : b(n.options?.find((e) => y(e) === n.modelValue))), T = o(() => n.multiple && Array.isArray(n.modelValue) ? n.modelValue.length > 0 : n.modelValue != null);
|
|
1072
|
+
function E() {
|
|
793
1073
|
r("update:modelValue", n.multiple ? [] : null);
|
|
794
1074
|
}
|
|
795
|
-
return (t, n) => (
|
|
796
|
-
open:
|
|
797
|
-
"onUpdate:open": n[0] ||= (e) =>
|
|
1075
|
+
return (t, n) => (x(), s(O(qe), {
|
|
1076
|
+
open: v.value,
|
|
1077
|
+
"onUpdate:open": n[0] ||= (e) => v.value = e,
|
|
798
1078
|
"model-value": e.modelValue,
|
|
799
1079
|
multiple: e.multiple,
|
|
800
1080
|
disabled: e.disabled,
|
|
1081
|
+
required: g.value || void 0,
|
|
801
1082
|
"onUpdate:modelValue": n[1] ||= (e) => r("update:modelValue", e)
|
|
802
1083
|
}, {
|
|
803
|
-
default:
|
|
804
|
-
|
|
805
|
-
|
|
1084
|
+
default: N(() => [f(O(Je), h({
|
|
1085
|
+
class: O(H)("flex w-full items-center justify-between gap-2 rounded-md border border-border bg-surface px-3 text-sm text-foreground shadow-sm transition-colors placeholder:text-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 disabled:cursor-not-allowed disabled:opacity-50", e.size === "sm" ? "h-8 text-xs" : "h-9", m.value ? "border-error-500 focus-visible:ring-error-500" : "", t.$attrs.class || ""),
|
|
1086
|
+
id: p.value,
|
|
1087
|
+
"aria-invalid": m.value || void 0,
|
|
1088
|
+
"aria-describedby": _.value
|
|
1089
|
+
}, t.$attrs), {
|
|
1090
|
+
default: N(() => [f(O(Ye), { placeholder: e.placeholder }, {
|
|
1091
|
+
default: N(() => [u("span", zn, D(S.value || e.placeholder), 1)]),
|
|
806
1092
|
_: 1
|
|
807
|
-
}, 8, ["placeholder"]), u("span",
|
|
1093
|
+
}, 8, ["placeholder"]), u("span", Bn, [e.clearable && T.value ? (x(), l("button", {
|
|
808
1094
|
key: 0,
|
|
809
1095
|
type: "button",
|
|
810
1096
|
"aria-label": "Clear selection",
|
|
811
1097
|
class: "rounded p-0.5 text-muted transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500",
|
|
812
|
-
onClick:
|
|
813
|
-
}, [f(
|
|
1098
|
+
onClick: F(E, ["stop"])
|
|
1099
|
+
}, [f(O(V), { class: "size-3.5" })])) : c("", !0), f(O(R), { class: "size-4 opacity-50" })])]),
|
|
814
1100
|
_: 1
|
|
815
|
-
}, 16, [
|
|
1101
|
+
}, 16, [
|
|
1102
|
+
"class",
|
|
1103
|
+
"id",
|
|
1104
|
+
"aria-invalid",
|
|
1105
|
+
"aria-describedby"
|
|
1106
|
+
]), v.value ? (x(), s(O(Ue), {
|
|
816
1107
|
key: 0,
|
|
817
1108
|
position: "popper",
|
|
818
1109
|
"side-offset": 4,
|
|
819
1110
|
class: "z-50 min-w-[--reka-select-trigger-width] rounded-md border border-border bg-surface p-1 shadow-popover"
|
|
820
1111
|
}, {
|
|
821
|
-
default:
|
|
822
|
-
key: String(
|
|
823
|
-
value:
|
|
1112
|
+
default: N(() => [(x(!0), l(a, null, w(e.options, (e) => (x(), s(O(We), {
|
|
1113
|
+
key: String(y(e)),
|
|
1114
|
+
value: y(e),
|
|
824
1115
|
class: "relative flex cursor-pointer select-none items-center rounded px-2 py-1.5 pe-8 text-sm text-foreground outline-none transition-colors focus:bg-surface-muted data-[highlighted]:bg-surface-muted data-[disabled]:opacity-50"
|
|
825
1116
|
}, {
|
|
826
|
-
default:
|
|
827
|
-
default:
|
|
1117
|
+
default: N(() => [f(O(Ke), null, {
|
|
1118
|
+
default: N(() => [d(D(b(e)), 1)]),
|
|
828
1119
|
_: 2
|
|
829
|
-
}, 1024), f(
|
|
830
|
-
default:
|
|
1120
|
+
}, 1024), f(O(Ge), { class: "absolute end-2 flex items-center justify-center text-primary-600" }, {
|
|
1121
|
+
default: N(() => [f(O(L), { class: "size-4" })]),
|
|
831
1122
|
_: 1
|
|
832
1123
|
})]),
|
|
833
1124
|
_: 2
|
|
@@ -839,10 +1130,11 @@ var Bt = ["aria-label", "aria-pressed"], Vt = /* @__PURE__ */ p({
|
|
|
839
1130
|
"open",
|
|
840
1131
|
"model-value",
|
|
841
1132
|
"multiple",
|
|
842
|
-
"disabled"
|
|
1133
|
+
"disabled",
|
|
1134
|
+
"required"
|
|
843
1135
|
]));
|
|
844
1136
|
}
|
|
845
|
-
}),
|
|
1137
|
+
}), Hn = /* @__PURE__ */ p({
|
|
846
1138
|
__name: "SelectButton",
|
|
847
1139
|
props: {
|
|
848
1140
|
modelValue: {},
|
|
@@ -853,7 +1145,7 @@ var Bt = ["aria-label", "aria-pressed"], Vt = /* @__PURE__ */ p({
|
|
|
853
1145
|
},
|
|
854
1146
|
emits: ["update:modelValue"],
|
|
855
1147
|
setup(e, { emit: t }) {
|
|
856
|
-
let n = e, r = t, i =
|
|
1148
|
+
let n = e, r = t, i = C(null), o = C({
|
|
857
1149
|
left: 0,
|
|
858
1150
|
top: 0,
|
|
859
1151
|
width: 0,
|
|
@@ -883,12 +1175,12 @@ var Bt = ["aria-label", "aria-pressed"], Vt = /* @__PURE__ */ p({
|
|
|
883
1175
|
function g() {
|
|
884
1176
|
cancelAnimationFrame(c), c = requestAnimationFrame(h);
|
|
885
1177
|
}
|
|
886
|
-
let
|
|
887
|
-
return
|
|
888
|
-
g(), typeof ResizeObserver < "u" && i.value?.$el && (
|
|
1178
|
+
let y;
|
|
1179
|
+
return b(() => {
|
|
1180
|
+
g(), typeof ResizeObserver < "u" && i.value?.$el && (y = new ResizeObserver(g), y.observe(i.value.$el)), window.addEventListener("resize", g);
|
|
889
1181
|
}), v(() => {
|
|
890
|
-
cancelAnimationFrame(c),
|
|
891
|
-
}),
|
|
1182
|
+
cancelAnimationFrame(c), y?.disconnect(), window.removeEventListener("resize", g);
|
|
1183
|
+
}), M(() => n.modelValue, g), M(() => n.options, g, { deep: !0 }), (t, n) => (x(), s(O(He), {
|
|
892
1184
|
ref_key: "rootEl",
|
|
893
1185
|
ref: i,
|
|
894
1186
|
"model-value": e.modelValue,
|
|
@@ -896,7 +1188,7 @@ var Bt = ["aria-label", "aria-pressed"], Vt = /* @__PURE__ */ p({
|
|
|
896
1188
|
class: "relative inline-flex flex-wrap items-center gap-1 rounded-md border border-border bg-surface p-1",
|
|
897
1189
|
"onUpdate:modelValue": n[0] ||= (e) => r("update:modelValue", e)
|
|
898
1190
|
}, {
|
|
899
|
-
default:
|
|
1191
|
+
default: N(() => [P(u("span", {
|
|
900
1192
|
"aria-hidden": "true",
|
|
901
1193
|
class: "pointer-events-none absolute rounded bg-primary-500 transition-all duration-200 ease-out motion-reduce:transition-none",
|
|
902
1194
|
style: _({
|
|
@@ -905,31 +1197,31 @@ var Bt = ["aria-label", "aria-pressed"], Vt = /* @__PURE__ */ p({
|
|
|
905
1197
|
width: `${o.value.width}px`,
|
|
906
1198
|
height: `${o.value.height}px`
|
|
907
1199
|
})
|
|
908
|
-
}, null, 4), [[
|
|
1200
|
+
}, null, 4), [[ne, o.value.ready]]), (x(!0), l(a, null, w(e.options, (t) => (x(), s(O(Ve), {
|
|
909
1201
|
key: String(p(t)),
|
|
910
1202
|
value: p(t),
|
|
911
1203
|
disabled: e.disabled,
|
|
912
1204
|
class: "relative inline-flex items-center justify-center rounded px-3 py-1 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 data-[state=checked]:text-white data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50"
|
|
913
1205
|
}, {
|
|
914
|
-
default:
|
|
1206
|
+
default: N(() => [f(O(Be), { class: "hidden" }), d(" " + D(m(t)), 1)]),
|
|
915
1207
|
_: 2
|
|
916
1208
|
}, 1032, ["value", "disabled"]))), 128))]),
|
|
917
1209
|
_: 1
|
|
918
1210
|
}, 8, ["model-value", "disabled"]));
|
|
919
1211
|
}
|
|
920
|
-
}),
|
|
1212
|
+
}), Un = ["id", "disabled"], Wn = { class: "flex items-center justify-between" }, Gn = ["aria-label"], Kn = {
|
|
921
1213
|
"data-test": "month-label",
|
|
922
1214
|
class: "text-sm font-medium"
|
|
923
|
-
},
|
|
1215
|
+
}, qn = ["aria-label"], Jn = {
|
|
924
1216
|
"data-test": "weekdays",
|
|
925
1217
|
class: "mt-2 grid grid-cols-7 gap-0.5 text-center text-xs"
|
|
926
|
-
},
|
|
1218
|
+
}, Yn = { key: 0 }, Xn = ["onClick"], Zn = {
|
|
927
1219
|
key: 0,
|
|
928
1220
|
class: "mt-3 flex items-center justify-between gap-2 border-t border-border pt-3"
|
|
929
|
-
},
|
|
1221
|
+
}, Qn = ["aria-label"], $n = ["aria-label"], er = ["value"], tr = ["aria-label"], nr = ["value"], rr = ["aria-label"], ir = { value: "am" }, ar = { value: "pm" }, or = { class: "flex items-center gap-2" }, sr = ["disabled"], cr = {
|
|
930
1222
|
key: 1,
|
|
931
1223
|
class: "mt-3 flex justify-end border-t border-border pt-3"
|
|
932
|
-
},
|
|
1224
|
+
}, lr = /* @__PURE__ */ p({
|
|
933
1225
|
__name: "DatePicker",
|
|
934
1226
|
props: {
|
|
935
1227
|
mode: { default: "date" },
|
|
@@ -1028,8 +1320,8 @@ var Bt = ["aria-label", "aria-pressed"], Vt = /* @__PURE__ */ p({
|
|
|
1028
1320
|
let t = e.toLowerCase().split(/[-_]/)[0];
|
|
1029
1321
|
return n[t] ?? n.en;
|
|
1030
1322
|
}
|
|
1031
|
-
let i = e, d = t, p =
|
|
1032
|
-
...r(
|
|
1323
|
+
let i = e, d = t, p = te(), m = C(i.defaultOpen ?? !1), h = C(/* @__PURE__ */ new Date()), _ = C(null), v = C(null), y = C("09:00"), b = o(() => i.locale || "en"), S = o(() => ({
|
|
1324
|
+
...r(b.value),
|
|
1033
1325
|
...i.placeholder === void 0 ? {} : { placeholder: i.placeholder },
|
|
1034
1326
|
...i.labels
|
|
1035
1327
|
}));
|
|
@@ -1040,99 +1332,99 @@ var Bt = ["aria-label", "aria-pressed"], Vt = /* @__PURE__ */ p({
|
|
|
1040
1332
|
let t = e;
|
|
1041
1333
|
return typeof t.children == "string" ? t.children : Array.isArray(t.children) ? t.children.map(T).join("") : "";
|
|
1042
1334
|
}
|
|
1043
|
-
function
|
|
1335
|
+
function E(e) {
|
|
1044
1336
|
let t = p[`label-${e}`];
|
|
1045
1337
|
if (t) {
|
|
1046
1338
|
let e = t().map(T).join("").trim();
|
|
1047
1339
|
if (e) return e;
|
|
1048
1340
|
}
|
|
1049
|
-
return
|
|
1341
|
+
return S.value[e];
|
|
1050
1342
|
}
|
|
1051
|
-
let
|
|
1052
|
-
|
|
1343
|
+
let k = o(() => i.weekStartsOn ?? Ot(b.value)), ee = o(() => kt(b.value, k.value)), j = o(() => At(h.value, b.value));
|
|
1344
|
+
M(() => i.modelValue, (e) => {
|
|
1053
1345
|
Array.isArray(e) ? (_.value = e[0] ?? null, v.value = e[1] ?? null) : e instanceof Date ? (_.value = e, v.value = null) : (_.value = null, v.value = null);
|
|
1054
1346
|
}, { immediate: !0 });
|
|
1055
1347
|
let ne = o(() => {
|
|
1056
|
-
let e = (new Date(h.value.getFullYear(), h.value.getMonth(), 1).getDay() -
|
|
1348
|
+
let e = (new Date(h.value.getFullYear(), h.value.getMonth(), 1).getDay() - k.value + 7) % 7, t = Array.from({ length: e }, () => null), n = new Date(h.value.getFullYear(), h.value.getMonth() + 1, 0).getDate();
|
|
1057
1349
|
for (let e = 1; e <= n; e++) t.push(new Date(h.value.getFullYear(), h.value.getMonth(), e));
|
|
1058
1350
|
return t;
|
|
1059
1351
|
});
|
|
1060
1352
|
function F(e) {
|
|
1061
1353
|
if (!_.value || !v.value) return !1;
|
|
1062
|
-
let [t, n] =
|
|
1354
|
+
let [t, n] = W(_.value, v.value);
|
|
1063
1355
|
return e.getTime() >= t.getTime() && e.getTime() <= n.getTime();
|
|
1064
1356
|
}
|
|
1065
1357
|
function I(e) {
|
|
1066
1358
|
h.value = new Date(h.value.getFullYear(), h.value.getMonth() + e, 1);
|
|
1067
1359
|
}
|
|
1068
|
-
function
|
|
1360
|
+
function L() {
|
|
1069
1361
|
return i.mode === "range" ? !!(_.value && v.value) : !!_.value;
|
|
1070
1362
|
}
|
|
1071
|
-
function
|
|
1363
|
+
function R(e) {
|
|
1072
1364
|
if (i.mode === "range") {
|
|
1073
1365
|
if (!_.value || v.value) _.value = e, v.value = null;
|
|
1074
1366
|
else {
|
|
1075
|
-
let [t, n] =
|
|
1367
|
+
let [t, n] = W(_.value, e);
|
|
1076
1368
|
_.value = t, v.value = n;
|
|
1077
1369
|
}
|
|
1078
1370
|
return;
|
|
1079
1371
|
}
|
|
1080
|
-
_.value = e, i.mode !== "datetime" && (
|
|
1372
|
+
_.value = e, i.mode !== "datetime" && (ae(), m.value = !1);
|
|
1081
1373
|
}
|
|
1082
|
-
function
|
|
1374
|
+
function ae() {
|
|
1083
1375
|
if (_.value) {
|
|
1084
1376
|
if (i.mode === "range") {
|
|
1085
1377
|
if (!v.value) return;
|
|
1086
1378
|
d("update:modelValue", [_.value, v.value]);
|
|
1087
|
-
} else i.mode === "datetime" ? d("update:modelValue",
|
|
1379
|
+
} else i.mode === "datetime" ? d("update:modelValue", Ct(_.value, y.value)) : d("update:modelValue", _.value);
|
|
1088
1380
|
}
|
|
1089
1381
|
}
|
|
1090
|
-
function
|
|
1382
|
+
function oe() {
|
|
1091
1383
|
_.value = null, v.value = null, d("update:modelValue", null), m.value = !1;
|
|
1092
1384
|
}
|
|
1093
|
-
let
|
|
1385
|
+
let B = o(() => {
|
|
1094
1386
|
let [e, t] = y.value.split(":").map(Number);
|
|
1095
1387
|
return {
|
|
1096
1388
|
hour24: Number.isFinite(e) ? (Math.trunc(e) % 24 + 24) % 24 : 0,
|
|
1097
1389
|
minute: Number.isFinite(t) ? (Math.trunc(t) % 60 + 60) % 60 : 0
|
|
1098
1390
|
};
|
|
1099
|
-
}),
|
|
1100
|
-
get: () => i.hourFormat === "12" ?
|
|
1391
|
+
}), se = o(() => Tt(i.hourFormat)), le = o(() => Et(Math.min(30, Math.max(1, i.minuteStep ?? 1)))), ue = o({
|
|
1392
|
+
get: () => i.hourFormat === "12" ? G(B.value.hour24).hour : B.value.hour24,
|
|
1101
1393
|
set: (e) => {
|
|
1102
|
-
let { hour24: t, minute: n } =
|
|
1103
|
-
y.value =
|
|
1394
|
+
let { hour24: t, minute: n } = B.value, r = i.hourFormat === "12" ? Dt(e, G(t).meridiem) : e;
|
|
1395
|
+
y.value = U(r * 60 + n);
|
|
1104
1396
|
}
|
|
1105
|
-
}),
|
|
1106
|
-
get: () =>
|
|
1397
|
+
}), de = o({
|
|
1398
|
+
get: () => B.value.minute,
|
|
1107
1399
|
set: (e) => {
|
|
1108
|
-
y.value =
|
|
1400
|
+
y.value = U(B.value.hour24 * 60 + e);
|
|
1109
1401
|
}
|
|
1110
|
-
}),
|
|
1111
|
-
get: () =>
|
|
1402
|
+
}), fe = o({
|
|
1403
|
+
get: () => G(B.value.hour24).meridiem,
|
|
1112
1404
|
set: (e) => {
|
|
1113
|
-
let { hour: t } =
|
|
1114
|
-
y.value =
|
|
1405
|
+
let { hour: t } = G(B.value.hour24);
|
|
1406
|
+
y.value = U(Dt(t, e) * 60 + B.value.minute);
|
|
1115
1407
|
}
|
|
1116
1408
|
});
|
|
1117
|
-
function
|
|
1409
|
+
function pe(e) {
|
|
1118
1410
|
return String(e).padStart(2, "0");
|
|
1119
1411
|
}
|
|
1120
1412
|
let V = o(() => {
|
|
1121
1413
|
if (i.mode === "range") {
|
|
1122
1414
|
if (!_.value || !v.value) return "";
|
|
1123
|
-
let [e, t] =
|
|
1124
|
-
return `${
|
|
1415
|
+
let [e, t] = W(_.value, v.value);
|
|
1416
|
+
return `${K(e, b.value)} – ${K(t, b.value)}`;
|
|
1125
1417
|
}
|
|
1126
1418
|
if (!_.value) return "";
|
|
1127
|
-
let e = i.mode === "datetime" ?
|
|
1128
|
-
return i.mode === "datetime" ? `${
|
|
1419
|
+
let e = i.mode === "datetime" ? Ct(_.value, y.value) : _.value;
|
|
1420
|
+
return i.mode === "datetime" ? `${K(e, b.value)} ${jt(e, b.value, i.hourFormat)}` : K(e, b.value);
|
|
1129
1421
|
});
|
|
1130
|
-
return (t, n) => (
|
|
1422
|
+
return (t, n) => (x(), s(O(Re), {
|
|
1131
1423
|
open: m.value,
|
|
1132
1424
|
"onUpdate:open": n[6] ||= (e) => m.value = e
|
|
1133
1425
|
}, {
|
|
1134
|
-
default:
|
|
1135
|
-
default:
|
|
1426
|
+
default: N(() => [f(O(ze), { "as-child": "" }, {
|
|
1427
|
+
default: N(() => [u("button", {
|
|
1136
1428
|
type: "button",
|
|
1137
1429
|
id: e.inputId,
|
|
1138
1430
|
disabled: e.disabled,
|
|
@@ -1141,32 +1433,32 @@ var Bt = ["aria-label", "aria-pressed"], Vt = /* @__PURE__ */ p({
|
|
|
1141
1433
|
e.size === "sm" ? "h-8 text-xs" : "h-9",
|
|
1142
1434
|
e.invalid ? "border-error-500" : ""
|
|
1143
1435
|
])
|
|
1144
|
-
}, [u("span", { class: g(["truncate", V.value ? "text-foreground" : "text-muted"]) },
|
|
1436
|
+
}, [u("span", { class: g(["truncate", V.value ? "text-foreground" : "text-muted"]) }, D(V.value || E("placeholder")), 3), f(O(re), { class: "size-4 shrink-0 text-muted" })], 10, Un)]),
|
|
1145
1437
|
_: 1
|
|
1146
|
-
}), f(
|
|
1438
|
+
}), f(O(Le), {
|
|
1147
1439
|
"side-offset": 4,
|
|
1148
1440
|
class: "z-50 rounded-md border border-border bg-surface p-3 shadow-popover"
|
|
1149
1441
|
}, {
|
|
1150
|
-
default:
|
|
1151
|
-
u("div",
|
|
1442
|
+
default: N(() => [
|
|
1443
|
+
u("div", Wn, [
|
|
1152
1444
|
u("button", {
|
|
1153
1445
|
type: "button",
|
|
1154
|
-
"aria-label":
|
|
1446
|
+
"aria-label": E("previousMonth"),
|
|
1155
1447
|
class: "rounded p-1 text-muted transition-colors hover:bg-surface-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500",
|
|
1156
1448
|
onClick: n[0] ||= (e) => I(-1)
|
|
1157
|
-
}, [f(
|
|
1158
|
-
u("span",
|
|
1449
|
+
}, [f(O(ie), { class: "size-4 rtl:rotate-180" })], 8, Gn),
|
|
1450
|
+
u("span", Kn, D(j.value), 1),
|
|
1159
1451
|
u("button", {
|
|
1160
1452
|
type: "button",
|
|
1161
|
-
"aria-label":
|
|
1453
|
+
"aria-label": E("nextMonth"),
|
|
1162
1454
|
class: "rounded p-1 text-muted transition-colors hover:bg-surface-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500",
|
|
1163
1455
|
onClick: n[1] ||= (e) => I(1)
|
|
1164
|
-
}, [f(
|
|
1456
|
+
}, [f(O(z), { class: "size-4 rtl:rotate-180" })], 8, qn)
|
|
1165
1457
|
]),
|
|
1166
|
-
u("div",
|
|
1458
|
+
u("div", Jn, [(x(!0), l(a, null, w(ee.value, (e, t) => (x(), l("span", {
|
|
1167
1459
|
key: t,
|
|
1168
1460
|
class: "py-1 font-medium text-muted"
|
|
1169
|
-
},
|
|
1461
|
+
}, D(e), 1))), 128)), (x(!0), l(a, null, w(ne.value, (e, t) => (x(), l(a, { key: t }, [e ? (x(), l("button", {
|
|
1170
1462
|
key: 1,
|
|
1171
1463
|
type: "button",
|
|
1172
1464
|
class: g([
|
|
@@ -1175,76 +1467,76 @@ var Bt = ["aria-label", "aria-pressed"], Vt = /* @__PURE__ */ p({
|
|
|
1175
1467
|
_.value && _.value.getTime() === e.getTime() ? "bg-primary-500 text-white hover:bg-primary-500" : "",
|
|
1176
1468
|
v.value && v.value.getTime() === e.getTime() ? "bg-primary-500 text-white hover:bg-primary-500" : ""
|
|
1177
1469
|
]),
|
|
1178
|
-
onClick: (t) =>
|
|
1179
|
-
},
|
|
1180
|
-
e.mode === "datetime" ? (
|
|
1470
|
+
onClick: (t) => R(e)
|
|
1471
|
+
}, D(e.getDate()), 11, Xn)) : (x(), l("span", Yn))], 64))), 128))]),
|
|
1472
|
+
e.mode === "datetime" ? (x(), l("div", Zn, [u("div", {
|
|
1181
1473
|
role: "group",
|
|
1182
|
-
"aria-label":
|
|
1474
|
+
"aria-label": E("time"),
|
|
1183
1475
|
class: "flex items-center gap-1.5 text-xs text-muted"
|
|
1184
1476
|
}, [
|
|
1185
|
-
f(
|
|
1186
|
-
|
|
1187
|
-
"onUpdate:modelValue": n[2] ||= (e) =>
|
|
1477
|
+
f(O(ce), { class: "size-3.5" }),
|
|
1478
|
+
P(u("select", {
|
|
1479
|
+
"onUpdate:modelValue": n[2] ||= (e) => ue.value = e,
|
|
1188
1480
|
"data-test": "hours",
|
|
1189
|
-
"aria-label":
|
|
1481
|
+
"aria-label": E("hour"),
|
|
1190
1482
|
class: "rounded border border-border bg-surface px-1.5 py-1 text-sm text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500"
|
|
1191
|
-
}, [(
|
|
1483
|
+
}, [(x(!0), l(a, null, w(se.value, (t) => (x(), l("option", {
|
|
1192
1484
|
key: t,
|
|
1193
1485
|
value: t
|
|
1194
|
-
},
|
|
1195
|
-
|
|
1196
|
-
|
|
1486
|
+
}, D(e.hourFormat === "12" ? t : pe(t)), 9, er))), 128))], 8, $n), [[
|
|
1487
|
+
A,
|
|
1488
|
+
ue.value,
|
|
1197
1489
|
void 0,
|
|
1198
1490
|
{ number: !0 }
|
|
1199
1491
|
]]),
|
|
1200
1492
|
n[7] ||= u("span", { "aria-hidden": "true" }, ":", -1),
|
|
1201
|
-
|
|
1202
|
-
"onUpdate:modelValue": n[3] ||= (e) =>
|
|
1493
|
+
P(u("select", {
|
|
1494
|
+
"onUpdate:modelValue": n[3] ||= (e) => de.value = e,
|
|
1203
1495
|
"data-test": "minutes",
|
|
1204
|
-
"aria-label":
|
|
1496
|
+
"aria-label": E("minute"),
|
|
1205
1497
|
class: "rounded border border-border bg-surface px-1.5 py-1 text-sm text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500"
|
|
1206
|
-
}, [(
|
|
1498
|
+
}, [(x(!0), l(a, null, w(le.value, (e) => (x(), l("option", {
|
|
1207
1499
|
key: e,
|
|
1208
1500
|
value: e
|
|
1209
|
-
},
|
|
1210
|
-
|
|
1211
|
-
|
|
1501
|
+
}, D(pe(e)), 9, nr))), 128))], 8, tr), [[
|
|
1502
|
+
A,
|
|
1503
|
+
de.value,
|
|
1212
1504
|
void 0,
|
|
1213
1505
|
{ number: !0 }
|
|
1214
1506
|
]]),
|
|
1215
|
-
e.hourFormat === "12" ?
|
|
1507
|
+
e.hourFormat === "12" ? P((x(), l("select", {
|
|
1216
1508
|
key: 0,
|
|
1217
|
-
"onUpdate:modelValue": n[4] ||= (e) =>
|
|
1509
|
+
"onUpdate:modelValue": n[4] ||= (e) => fe.value = e,
|
|
1218
1510
|
"data-test": "meridiem",
|
|
1219
|
-
"aria-label":
|
|
1511
|
+
"aria-label": E("time"),
|
|
1220
1512
|
class: "rounded border border-border bg-surface px-1.5 py-1 text-sm text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500"
|
|
1221
|
-
}, [u("option",
|
|
1222
|
-
], 8,
|
|
1513
|
+
}, [u("option", ir, D(E("am")), 1), u("option", ar, D(E("pm")), 1)], 8, rr)), [[A, fe.value]]) : c("", !0)
|
|
1514
|
+
], 8, Qn), u("div", or, [u("button", {
|
|
1223
1515
|
type: "button",
|
|
1224
1516
|
class: "rounded px-3 py-1 text-sm text-muted transition-colors hover:bg-surface-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500",
|
|
1225
|
-
onClick:
|
|
1226
|
-
}, E(
|
|
1517
|
+
onClick: oe
|
|
1518
|
+
}, D(E("clear")), 1), u("button", {
|
|
1227
1519
|
type: "button",
|
|
1228
1520
|
disabled: !_.value,
|
|
1229
1521
|
class: "rounded bg-primary-500 px-3 py-1 text-sm text-white transition-colors hover:bg-primary-600 disabled:cursor-not-allowed disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500",
|
|
1230
1522
|
onClick: n[5] ||= (e) => {
|
|
1231
|
-
|
|
1523
|
+
ae(), m.value = !1;
|
|
1232
1524
|
}
|
|
1233
|
-
}, E(
|
|
1525
|
+
}, D(E("apply")), 9, sr)])])) : L() ? (x(), l("div", cr, [u("button", {
|
|
1234
1526
|
type: "button",
|
|
1235
1527
|
class: "rounded px-3 py-1 text-sm text-muted transition-colors hover:bg-surface-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500",
|
|
1236
|
-
onClick:
|
|
1237
|
-
}, E(
|
|
1528
|
+
onClick: oe
|
|
1529
|
+
}, D(E("clear")), 1)])) : c("", !0)
|
|
1238
1530
|
]),
|
|
1239
1531
|
_: 1
|
|
1240
1532
|
})]),
|
|
1241
1533
|
_: 1
|
|
1242
1534
|
}, 8, ["open"]));
|
|
1243
1535
|
}
|
|
1244
|
-
}),
|
|
1536
|
+
}), ur = { class: "flex items-start justify-between gap-4 border-b border-border p-5 pb-4" }, dr = { class: "min-w-0" }, fr = { class: "overflow-y-auto bg-surface p-5" }, pr = {
|
|
1245
1537
|
key: 0,
|
|
1246
1538
|
class: "flex justify-end gap-2 border-t border-border bg-surface-muted p-4"
|
|
1247
|
-
},
|
|
1539
|
+
}, mr = /* @__PURE__ */ p({
|
|
1248
1540
|
__name: "Dialog",
|
|
1249
1541
|
props: {
|
|
1250
1542
|
visible: { type: Boolean },
|
|
@@ -1266,40 +1558,40 @@ var Bt = ["aria-label", "aria-pressed"], Vt = /* @__PURE__ */ p({
|
|
|
1266
1558
|
function p(e) {
|
|
1267
1559
|
r("update:visible", e), e || r("close");
|
|
1268
1560
|
}
|
|
1269
|
-
return (t, n) => (
|
|
1561
|
+
return (t, n) => (x(), s(O(Se), {
|
|
1270
1562
|
open: i.value,
|
|
1271
1563
|
"onUpdate:open": p
|
|
1272
1564
|
}, {
|
|
1273
|
-
default:
|
|
1565
|
+
default: N(() => [t.$slots.trigger ? (x(), s(O(we), {
|
|
1274
1566
|
key: 0,
|
|
1275
1567
|
"as-child": ""
|
|
1276
1568
|
}, {
|
|
1277
|
-
default:
|
|
1569
|
+
default: N(() => [T(t.$slots, "trigger")]),
|
|
1278
1570
|
_: 3
|
|
1279
|
-
})) : c("", !0), f(
|
|
1280
|
-
default:
|
|
1281
|
-
default:
|
|
1282
|
-
u("div",
|
|
1571
|
+
})) : c("", !0), f(O(xe), null, {
|
|
1572
|
+
default: N(() => [f(O(be), { class: "fixed inset-0 z-50 bg-black/50 dark:bg-black/70" }), f(O(ve), { class: g(["fixed left-1/2 top-1/2 z-50 w-full max-h-[85vh] -translate-x-1/2 -translate-y-1/2 overflow-hidden rounded-lg border border-border bg-surface shadow-dialog focus-visible:outline-none", a[e.size]]) }, {
|
|
1573
|
+
default: N(() => [
|
|
1574
|
+
u("div", ur, [u("div", dr, [e.title || t.$slots.header ? (x(), s(O(Ce), {
|
|
1283
1575
|
key: 0,
|
|
1284
1576
|
class: "text-lg font-semibold text-foreground"
|
|
1285
1577
|
}, {
|
|
1286
|
-
default:
|
|
1578
|
+
default: N(() => [T(t.$slots, "header", {}, () => [d(D(e.title), 1)])]),
|
|
1287
1579
|
_: 3
|
|
1288
|
-
})) : c("", !0), e.description || t.$slots.description ? (
|
|
1580
|
+
})) : c("", !0), e.description || t.$slots.description ? (x(), s(O(ye), {
|
|
1289
1581
|
key: 1,
|
|
1290
1582
|
class: "mt-1 text-sm text-muted"
|
|
1291
1583
|
}, {
|
|
1292
|
-
default:
|
|
1584
|
+
default: N(() => [T(t.$slots, "description", {}, () => [d(D(e.description), 1)])]),
|
|
1293
1585
|
_: 3
|
|
1294
|
-
})) : c("", !0)]), f(
|
|
1586
|
+
})) : c("", !0)]), f(O(_e), {
|
|
1295
1587
|
class: "rounded-md p-1 text-muted transition-colors hover:bg-surface-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500",
|
|
1296
1588
|
"aria-label": "Close"
|
|
1297
1589
|
}, {
|
|
1298
|
-
default:
|
|
1590
|
+
default: N(() => [f(O(V), { class: "size-4" })]),
|
|
1299
1591
|
_: 1
|
|
1300
1592
|
})]),
|
|
1301
|
-
u("div",
|
|
1302
|
-
t.$slots.footer ? (
|
|
1593
|
+
u("div", fr, [T(t.$slots, "default")]),
|
|
1594
|
+
t.$slots.footer ? (x(), l("div", pr, [T(t.$slots, "footer")])) : c("", !0)
|
|
1303
1595
|
]),
|
|
1304
1596
|
_: 3
|
|
1305
1597
|
}, 8, ["class"])]),
|
|
@@ -1308,13 +1600,13 @@ var Bt = ["aria-label", "aria-pressed"], Vt = /* @__PURE__ */ p({
|
|
|
1308
1600
|
_: 3
|
|
1309
1601
|
}, 8, ["open"]));
|
|
1310
1602
|
}
|
|
1311
|
-
}),
|
|
1603
|
+
}), hr = {
|
|
1312
1604
|
key: 1,
|
|
1313
1605
|
class: "flex shrink-0 items-start justify-between gap-4 border-b border-border p-5 pb-4"
|
|
1314
|
-
},
|
|
1606
|
+
}, gr = { class: "min-w-0" }, _r = { class: "flex-1 overflow-y-auto p-5" }, vr = {
|
|
1315
1607
|
key: 2,
|
|
1316
1608
|
class: "shrink-0 border-t border-border bg-surface-muted p-4"
|
|
1317
|
-
},
|
|
1609
|
+
}, yr = /* @__PURE__ */ p({
|
|
1318
1610
|
__name: "Drawer",
|
|
1319
1611
|
props: {
|
|
1320
1612
|
open: {
|
|
@@ -1382,60 +1674,60 @@ var Bt = ["aria-label", "aria-pressed"], Vt = /* @__PURE__ */ p({
|
|
|
1382
1674
|
md: "max-h-96",
|
|
1383
1675
|
lg: "max-h-[32rem]",
|
|
1384
1676
|
full: "max-h-full"
|
|
1385
|
-
}, y = o(() => n.position === "top" || n.position === "bottom"),
|
|
1386
|
-
return (t, n) => (
|
|
1677
|
+
}, y = o(() => n.position === "top" || n.position === "bottom"), b = o(() => y.value ? v[n.size] : _[n.size]);
|
|
1678
|
+
return (t, n) => (x(), s(O(Se), {
|
|
1387
1679
|
open: i.value,
|
|
1388
1680
|
"onUpdate:open": a
|
|
1389
1681
|
}, {
|
|
1390
|
-
default:
|
|
1682
|
+
default: N(() => [t.$slots.trigger ? (x(), s(O(we), {
|
|
1391
1683
|
key: 0,
|
|
1392
1684
|
"as-child": ""
|
|
1393
1685
|
}, {
|
|
1394
|
-
default:
|
|
1686
|
+
default: N(() => [T(t.$slots, "trigger")]),
|
|
1395
1687
|
_: 3
|
|
1396
|
-
})) : c("", !0), f(
|
|
1397
|
-
default:
|
|
1688
|
+
})) : c("", !0), f(O(xe), { "force-mount": i.value }, {
|
|
1689
|
+
default: N(() => [e.backdrop || e.preventScroll ? (x(), s(O(be), {
|
|
1398
1690
|
key: 0,
|
|
1399
1691
|
class: g(["fixed inset-0 z-50", e.backdrop ? "bg-black/50 dark:bg-black/70" : "bg-transparent"])
|
|
1400
|
-
}, null, 8, ["class"])) : c("", !0), f(
|
|
1692
|
+
}, null, 8, ["class"])) : c("", !0), f(O(ve), {
|
|
1401
1693
|
class: g([
|
|
1402
1694
|
"fixed z-50 flex flex-col overflow-hidden border-border bg-surface shadow-dialog transition-transform duration-200 focus-visible:outline-none",
|
|
1403
1695
|
h[e.position],
|
|
1404
|
-
|
|
1696
|
+
b.value
|
|
1405
1697
|
]),
|
|
1406
1698
|
onEscapeKeyDown: p,
|
|
1407
1699
|
onPointerDownOutside: m
|
|
1408
1700
|
}, {
|
|
1409
|
-
default:
|
|
1410
|
-
!e.title && !t.$slots.header ? (
|
|
1411
|
-
default:
|
|
1412
|
-
default:
|
|
1701
|
+
default: N(() => [
|
|
1702
|
+
!e.title && !t.$slots.header ? (x(), s(O(lt), { key: 0 }, {
|
|
1703
|
+
default: N(() => [f(O(Ce), null, {
|
|
1704
|
+
default: N(() => [...n[0] ||= [d("Drawer", -1)]]),
|
|
1413
1705
|
_: 1
|
|
1414
1706
|
})]),
|
|
1415
1707
|
_: 1
|
|
1416
1708
|
})) : c("", !0),
|
|
1417
|
-
e.title || t.$slots.header || e.description || t.$slots.description || e.showClose ? (
|
|
1709
|
+
e.title || t.$slots.header || e.description || t.$slots.description || e.showClose ? (x(), l("header", hr, [u("div", gr, [e.title || t.$slots.header ? (x(), s(O(Ce), {
|
|
1418
1710
|
key: 0,
|
|
1419
1711
|
class: "text-lg font-semibold text-foreground"
|
|
1420
1712
|
}, {
|
|
1421
|
-
default:
|
|
1713
|
+
default: N(() => [T(t.$slots, "header", {}, () => [d(D(e.title), 1)])]),
|
|
1422
1714
|
_: 3
|
|
1423
|
-
})) : c("", !0), e.description || t.$slots.description ? (
|
|
1715
|
+
})) : c("", !0), e.description || t.$slots.description ? (x(), s(O(ye), {
|
|
1424
1716
|
key: 1,
|
|
1425
1717
|
class: "mt-1 text-sm text-muted"
|
|
1426
1718
|
}, {
|
|
1427
|
-
default:
|
|
1719
|
+
default: N(() => [T(t.$slots, "description", {}, () => [d(D(e.description), 1)])]),
|
|
1428
1720
|
_: 3
|
|
1429
|
-
})) : c("", !0)]), e.showClose ? (
|
|
1721
|
+
})) : c("", !0)]), e.showClose ? (x(), s(O(_e), {
|
|
1430
1722
|
key: 0,
|
|
1431
1723
|
class: "ms-auto shrink-0 rounded-md p-1 text-muted transition-colors hover:bg-surface-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500",
|
|
1432
1724
|
"aria-label": "Close"
|
|
1433
1725
|
}, {
|
|
1434
|
-
default:
|
|
1726
|
+
default: N(() => [T(t.$slots, "close", {}, () => [f(O(V), { class: "size-4" })])]),
|
|
1435
1727
|
_: 3
|
|
1436
1728
|
})) : c("", !0)])) : c("", !0),
|
|
1437
|
-
u("div",
|
|
1438
|
-
t.$slots.footer ? (
|
|
1729
|
+
u("div", _r, [T(t.$slots, "default")]),
|
|
1730
|
+
t.$slots.footer ? (x(), l("footer", vr, [T(t.$slots, "footer")])) : c("", !0)
|
|
1439
1731
|
]),
|
|
1440
1732
|
_: 3
|
|
1441
1733
|
}, 8, ["class"])]),
|
|
@@ -1444,28 +1736,28 @@ var Bt = ["aria-label", "aria-pressed"], Vt = /* @__PURE__ */ p({
|
|
|
1444
1736
|
_: 3
|
|
1445
1737
|
}, 8, ["open"]));
|
|
1446
1738
|
}
|
|
1447
|
-
}),
|
|
1739
|
+
}), br = /* @__PURE__ */ p({
|
|
1448
1740
|
__name: "DropdownMenu",
|
|
1449
1741
|
emits: ["update:open"],
|
|
1450
1742
|
setup(e, { emit: t }) {
|
|
1451
1743
|
let n = t;
|
|
1452
|
-
return (e, t) => (
|
|
1453
|
-
default:
|
|
1744
|
+
return (e, t) => (x(), s(O(Ae), h(e.$attrs, { "onUpdate:open": t[0] ||= (e) => n("update:open", e) }), {
|
|
1745
|
+
default: N(() => [T(e.$slots, "default")]),
|
|
1454
1746
|
_: 3
|
|
1455
1747
|
}, 16));
|
|
1456
1748
|
}
|
|
1457
|
-
}),
|
|
1749
|
+
}), xr = /* @__PURE__ */ p({
|
|
1458
1750
|
__name: "DropdownMenuTrigger",
|
|
1459
1751
|
setup(e) {
|
|
1460
|
-
return (e, t) => (
|
|
1752
|
+
return (e, t) => (x(), s(O(Me), {
|
|
1461
1753
|
"as-child": "",
|
|
1462
1754
|
"focus-on-select": ""
|
|
1463
1755
|
}, {
|
|
1464
|
-
default:
|
|
1756
|
+
default: N(() => [T(e.$slots, "default")]),
|
|
1465
1757
|
_: 3
|
|
1466
1758
|
}));
|
|
1467
1759
|
}
|
|
1468
|
-
}),
|
|
1760
|
+
}), Sr = /* @__PURE__ */ p({
|
|
1469
1761
|
__name: "DropdownMenuContent",
|
|
1470
1762
|
props: {
|
|
1471
1763
|
align: { default: "start" },
|
|
@@ -1473,14 +1765,14 @@ var Bt = ["aria-label", "aria-pressed"], Vt = /* @__PURE__ */ p({
|
|
|
1473
1765
|
sideOffset: { default: 4 }
|
|
1474
1766
|
},
|
|
1475
1767
|
setup(e) {
|
|
1476
|
-
return (t, n) => (
|
|
1477
|
-
default:
|
|
1768
|
+
return (t, n) => (x(), s(O(ke), null, {
|
|
1769
|
+
default: N(() => [f(O(Te), {
|
|
1478
1770
|
align: e.align,
|
|
1479
1771
|
side: e.side,
|
|
1480
1772
|
"side-offset": e.sideOffset,
|
|
1481
1773
|
class: "z-50 min-w-40 rounded-md border border-border bg-surface p-1 shadow-popover"
|
|
1482
1774
|
}, {
|
|
1483
|
-
default:
|
|
1775
|
+
default: N(() => [T(t.$slots, "default")]),
|
|
1484
1776
|
_: 3
|
|
1485
1777
|
}, 8, [
|
|
1486
1778
|
"align",
|
|
@@ -1490,34 +1782,70 @@ var Bt = ["aria-label", "aria-pressed"], Vt = /* @__PURE__ */ p({
|
|
|
1490
1782
|
_: 3
|
|
1491
1783
|
}));
|
|
1492
1784
|
}
|
|
1493
|
-
}),
|
|
1785
|
+
}), Cr = /* @__PURE__ */ p({
|
|
1494
1786
|
__name: "DropdownMenuItem",
|
|
1495
|
-
props: {
|
|
1787
|
+
props: {
|
|
1788
|
+
variant: {},
|
|
1789
|
+
icon: {},
|
|
1790
|
+
disabled: {
|
|
1791
|
+
type: Boolean,
|
|
1792
|
+
default: !1
|
|
1793
|
+
}
|
|
1794
|
+
},
|
|
1496
1795
|
emits: ["select"],
|
|
1497
1796
|
setup(e, { emit: t }) {
|
|
1498
|
-
let n =
|
|
1797
|
+
let n = me({
|
|
1499
1798
|
base: "relative flex w-full cursor-pointer select-none items-center gap-2 rounded px-2 py-1.5 text-sm outline-none transition-colors focus:bg-surface-muted data-[highlighted]:bg-surface-muted data-[highlighted]:text-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
1500
1799
|
variants: { variant: {
|
|
1501
1800
|
default: "text-foreground",
|
|
1502
1801
|
destructive: "text-error-600"
|
|
1503
1802
|
} },
|
|
1504
1803
|
defaultVariants: { variant: "default" }
|
|
1505
|
-
}), r = t;
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1804
|
+
}), r = e, i = t;
|
|
1805
|
+
function a() {
|
|
1806
|
+
r.disabled || i("select");
|
|
1807
|
+
}
|
|
1808
|
+
return (t, r) => (x(), s(O(De), {
|
|
1809
|
+
disabled: e.disabled,
|
|
1810
|
+
class: g(O(n)({ variant: e.variant })),
|
|
1811
|
+
onSelect: a
|
|
1509
1812
|
}, {
|
|
1510
|
-
default:
|
|
1813
|
+
default: N(() => [e.icon ? (x(), s(Y, {
|
|
1814
|
+
key: 0,
|
|
1815
|
+
name: e.icon,
|
|
1816
|
+
class: "size-4 shrink-0"
|
|
1817
|
+
}, null, 8, ["name"])) : c("", !0), T(t.$slots, "default")]),
|
|
1818
|
+
_: 3
|
|
1819
|
+
}, 8, ["disabled", "class"]));
|
|
1820
|
+
}
|
|
1821
|
+
}), wr = /* @__PURE__ */ p({
|
|
1822
|
+
__name: "DropdownMenuSeparator",
|
|
1823
|
+
setup(e) {
|
|
1824
|
+
return (e, t) => (x(), s(O(je), { class: "my-1 h-px bg-border" }));
|
|
1825
|
+
}
|
|
1826
|
+
}), Tr = /* @__PURE__ */ p({
|
|
1827
|
+
__name: "DropdownMenuLabel",
|
|
1828
|
+
setup(e) {
|
|
1829
|
+
return (e, t) => (x(), s(O(Oe), { class: "px-2 py-1.5 text-xs font-medium text-muted" }, {
|
|
1830
|
+
default: N(() => [T(e.$slots, "default")]),
|
|
1511
1831
|
_: 3
|
|
1512
|
-
}
|
|
1832
|
+
}));
|
|
1513
1833
|
}
|
|
1514
|
-
}),
|
|
1834
|
+
}), Er = /* @__PURE__ */ p({
|
|
1835
|
+
__name: "DropdownMenuGroup",
|
|
1836
|
+
setup(e) {
|
|
1837
|
+
return (e, t) => (x(), s(O(Ee), null, {
|
|
1838
|
+
default: N(() => [T(e.$slots, "default")]),
|
|
1839
|
+
_: 3
|
|
1840
|
+
}));
|
|
1841
|
+
}
|
|
1842
|
+
}), Dr = { class: "flex flex-col gap-2 sm:flex-row sm:items-stretch" }, Or = { class: "border-b border-border px-3 py-2 text-xs font-medium text-muted" }, kr = { class: "max-h-64 flex-1 overflow-y-auto p-1" }, Ar = ["disabled", "onClick"], jr = { class: "truncate" }, Mr = {
|
|
1515
1843
|
key: 0,
|
|
1516
1844
|
class: "px-2 py-1.5 text-sm text-muted"
|
|
1517
|
-
},
|
|
1845
|
+
}, Nr = { class: "flex flex-row items-center justify-center gap-1 sm:flex-col" }, Pr = { class: "border-b border-border px-3 py-2 text-xs font-medium text-muted" }, Fr = { class: "max-h-64 flex-1 overflow-y-auto p-1" }, Ir = ["disabled", "onClick"], Lr = { class: "truncate" }, Rr = {
|
|
1518
1846
|
key: 0,
|
|
1519
1847
|
class: "px-2 py-1.5 text-sm text-muted"
|
|
1520
|
-
},
|
|
1848
|
+
}, zr = /* @__PURE__ */ p({
|
|
1521
1849
|
__name: "TransferList",
|
|
1522
1850
|
props: {
|
|
1523
1851
|
options: {},
|
|
@@ -1531,7 +1859,7 @@ var Bt = ["aria-label", "aria-pressed"], Vt = /* @__PURE__ */ p({
|
|
|
1531
1859
|
},
|
|
1532
1860
|
emits: ["update:modelValue"],
|
|
1533
1861
|
setup(e, { emit: t }) {
|
|
1534
|
-
let n = e, r = t, i =
|
|
1862
|
+
let n = e, r = t, i = C(new Set(n.modelValue ?? [])), s = C(/* @__PURE__ */ new Set()), p = C(/* @__PURE__ */ new Set()), m = o(() => n.options.filter((e) => !i.value.has(e.value))), h = o(() => n.options.filter((e) => i.value.has(e.value)));
|
|
1535
1863
|
function _() {
|
|
1536
1864
|
r("update:modelValue", h.value.map((e) => e.value));
|
|
1537
1865
|
}
|
|
@@ -1544,93 +1872,93 @@ var Bt = ["aria-label", "aria-pressed"], Vt = /* @__PURE__ */ p({
|
|
|
1544
1872
|
for (let e of s.value) i.value.add(e);
|
|
1545
1873
|
s.value.clear(), _();
|
|
1546
1874
|
}
|
|
1547
|
-
function
|
|
1875
|
+
function b() {
|
|
1548
1876
|
for (let e of p.value) i.value.delete(e);
|
|
1549
1877
|
p.value.clear(), _();
|
|
1550
1878
|
}
|
|
1551
|
-
function
|
|
1879
|
+
function S() {
|
|
1552
1880
|
for (let e of n.options) i.value.add(e.value);
|
|
1553
1881
|
s.value.clear(), _();
|
|
1554
1882
|
}
|
|
1555
|
-
function
|
|
1883
|
+
function E() {
|
|
1556
1884
|
i.value.clear(), p.value.clear(), _();
|
|
1557
1885
|
}
|
|
1558
|
-
return (t, n) => (
|
|
1559
|
-
u("div", { class: g(["flex min-h-40 flex-1 flex-col rounded-md border border-border bg-surface", e.disabled && "opacity-50"]) }, [u("div",
|
|
1886
|
+
return (t, n) => (x(), l("div", Dr, [
|
|
1887
|
+
u("div", { class: g(["flex min-h-40 flex-1 flex-col rounded-md border border-border bg-surface", e.disabled && "opacity-50"]) }, [u("div", Or, [T(t.$slots, "source-header", {}, () => [d(D(e.sourceLabel), 1)])]), u("ul", kr, [(x(!0), l(a, null, w(m.value, (r) => (x(), l("li", { key: r.value }, [u("button", {
|
|
1560
1888
|
type: "button",
|
|
1561
1889
|
disabled: e.disabled,
|
|
1562
1890
|
class: "flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-sm transition-colors hover:bg-surface-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 disabled:cursor-not-allowed",
|
|
1563
1891
|
onClick: (e) => v(s.value, r.value)
|
|
1564
|
-
}, [f(
|
|
1892
|
+
}, [f(xn, {
|
|
1565
1893
|
"model-value": s.value.has(r.value),
|
|
1566
1894
|
disabled: e.disabled,
|
|
1567
|
-
onClick: n[0] ||=
|
|
1895
|
+
onClick: n[0] ||= F(() => {}, ["stop"]),
|
|
1568
1896
|
"onUpdate:modelValue": (e) => v(s.value, r.value)
|
|
1569
1897
|
}, null, 8, [
|
|
1570
1898
|
"model-value",
|
|
1571
1899
|
"disabled",
|
|
1572
1900
|
"onUpdate:modelValue"
|
|
1573
|
-
]),
|
|
1574
|
-
u("div",
|
|
1575
|
-
f(
|
|
1901
|
+
]), T(t.$slots, "item", { option: r }, () => [u("span", jr, D(r.label), 1)])], 8, Ar)]))), 128)), m.value.length === 0 ? (x(), l("li", Mr, "Empty")) : c("", !0)])], 2),
|
|
1902
|
+
u("div", Nr, [
|
|
1903
|
+
f(X, {
|
|
1576
1904
|
variant: "outline",
|
|
1577
1905
|
size: "icon-sm",
|
|
1578
1906
|
disabled: e.disabled || s.value.size === 0,
|
|
1579
1907
|
"aria-label": "Move selected to target",
|
|
1580
1908
|
onClick: y
|
|
1581
1909
|
}, {
|
|
1582
|
-
default:
|
|
1910
|
+
default: N(() => [f(O(z), { class: "size-4" })]),
|
|
1583
1911
|
_: 1
|
|
1584
1912
|
}, 8, ["disabled"]),
|
|
1585
|
-
f(
|
|
1913
|
+
f(X, {
|
|
1586
1914
|
variant: "outline",
|
|
1587
1915
|
size: "icon-sm",
|
|
1588
1916
|
disabled: e.disabled || p.value.size === 0,
|
|
1589
1917
|
"aria-label": "Move selected to source",
|
|
1590
|
-
onClick:
|
|
1918
|
+
onClick: b
|
|
1591
1919
|
}, {
|
|
1592
|
-
default:
|
|
1920
|
+
default: N(() => [f(O(ie), { class: "size-4" })]),
|
|
1593
1921
|
_: 1
|
|
1594
1922
|
}, 8, ["disabled"]),
|
|
1595
|
-
f(
|
|
1923
|
+
f(X, {
|
|
1596
1924
|
variant: "ghost",
|
|
1597
1925
|
size: "icon-sm",
|
|
1598
1926
|
disabled: e.disabled,
|
|
1599
1927
|
"aria-label": "Move all to target",
|
|
1600
|
-
onClick:
|
|
1928
|
+
onClick: S
|
|
1601
1929
|
}, {
|
|
1602
|
-
default:
|
|
1930
|
+
default: N(() => [f(O(B), { class: "size-4" })]),
|
|
1603
1931
|
_: 1
|
|
1604
1932
|
}, 8, ["disabled"]),
|
|
1605
|
-
f(
|
|
1933
|
+
f(X, {
|
|
1606
1934
|
variant: "ghost",
|
|
1607
1935
|
size: "icon-sm",
|
|
1608
1936
|
disabled: e.disabled,
|
|
1609
1937
|
"aria-label": "Move all to source",
|
|
1610
|
-
onClick:
|
|
1938
|
+
onClick: E
|
|
1611
1939
|
}, {
|
|
1612
|
-
default:
|
|
1940
|
+
default: N(() => [f(O(oe), { class: "size-4" })]),
|
|
1613
1941
|
_: 1
|
|
1614
1942
|
}, 8, ["disabled"])
|
|
1615
1943
|
]),
|
|
1616
|
-
u("div", { class: g(["flex min-h-40 flex-1 flex-col rounded-md border border-border bg-surface", e.disabled && "opacity-50"]) }, [u("div",
|
|
1944
|
+
u("div", { class: g(["flex min-h-40 flex-1 flex-col rounded-md border border-border bg-surface", e.disabled && "opacity-50"]) }, [u("div", Pr, [T(t.$slots, "target-header", {}, () => [d(D(e.targetLabel), 1)])]), u("ul", Fr, [(x(!0), l(a, null, w(h.value, (r) => (x(), l("li", { key: r.value }, [u("button", {
|
|
1617
1945
|
type: "button",
|
|
1618
1946
|
disabled: e.disabled,
|
|
1619
1947
|
class: "flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-sm transition-colors hover:bg-surface-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 disabled:cursor-not-allowed",
|
|
1620
1948
|
onClick: (e) => v(p.value, r.value)
|
|
1621
|
-
}, [f(
|
|
1949
|
+
}, [f(xn, {
|
|
1622
1950
|
"model-value": p.value.has(r.value),
|
|
1623
1951
|
disabled: e.disabled,
|
|
1624
|
-
onClick: n[1] ||=
|
|
1952
|
+
onClick: n[1] ||= F(() => {}, ["stop"]),
|
|
1625
1953
|
"onUpdate:modelValue": (e) => v(p.value, r.value)
|
|
1626
1954
|
}, null, 8, [
|
|
1627
1955
|
"model-value",
|
|
1628
1956
|
"disabled",
|
|
1629
1957
|
"onUpdate:modelValue"
|
|
1630
|
-
]),
|
|
1958
|
+
]), T(t.$slots, "item", { option: r }, () => [u("span", Lr, D(r.label), 1)])], 8, Ir)]))), 128)), h.value.length === 0 ? (x(), l("li", Rr, "Empty")) : c("", !0)])], 2)
|
|
1631
1959
|
]));
|
|
1632
1960
|
}
|
|
1633
|
-
}),
|
|
1961
|
+
}), Br = /* @__PURE__ */ p({
|
|
1634
1962
|
__name: "Table",
|
|
1635
1963
|
props: {
|
|
1636
1964
|
striped: { type: Boolean },
|
|
@@ -1641,31 +1969,31 @@ var Bt = ["aria-label", "aria-pressed"], Vt = /* @__PURE__ */ p({
|
|
|
1641
1969
|
}
|
|
1642
1970
|
},
|
|
1643
1971
|
setup(e) {
|
|
1644
|
-
let t = e, n = o(() =>
|
|
1645
|
-
return (e, t) => (
|
|
1972
|
+
let t = e, n = o(() => H("w-full border-collapse text-start text-sm text-foreground", t.size === "sm" ? "text-xs" : "text-sm", t.striped && "[&_tbody>tr:nth-child(even)]:bg-surface-muted/40", t.contained && "overflow-hidden rounded-md border border-border bg-surface"));
|
|
1973
|
+
return (e, t) => (x(), l("table", { class: g(n.value) }, [T(e.$slots, "default")], 2));
|
|
1646
1974
|
}
|
|
1647
|
-
}),
|
|
1975
|
+
}), Vr = (e, t) => {
|
|
1648
1976
|
let n = e.__vccOpts || e;
|
|
1649
1977
|
for (let [e, r] of t) n[e] = r;
|
|
1650
1978
|
return n;
|
|
1651
|
-
},
|
|
1652
|
-
function
|
|
1653
|
-
return
|
|
1979
|
+
}, Hr = {}, Ur = { class: "border-b border-border bg-surface-muted/60 text-xs font-medium text-muted" };
|
|
1980
|
+
function Wr(e, t) {
|
|
1981
|
+
return x(), l("thead", Ur, [T(e.$slots, "default")]);
|
|
1654
1982
|
}
|
|
1655
|
-
var
|
|
1656
|
-
function
|
|
1657
|
-
return
|
|
1983
|
+
var Gr = /*#__PURE__*/ Vr(Hr, [["render", Wr]]), Kr = {};
|
|
1984
|
+
function qr(e, t) {
|
|
1985
|
+
return x(), l("tbody", null, [T(e.$slots, "default")]);
|
|
1658
1986
|
}
|
|
1659
|
-
var
|
|
1987
|
+
var Jr = /*#__PURE__*/ Vr(Kr, [["render", qr]]), Q = /* @__PURE__ */ p({
|
|
1660
1988
|
__name: "TableRow",
|
|
1661
1989
|
props: { clickable: {
|
|
1662
1990
|
type: Boolean,
|
|
1663
1991
|
default: !1
|
|
1664
1992
|
} },
|
|
1665
1993
|
setup(e) {
|
|
1666
|
-
return (t, n) => (
|
|
1994
|
+
return (t, n) => (x(), l("tr", { class: g(["border-b border-border/60 last:border-b-0", e.clickable && "cursor-pointer transition-colors hover:bg-surface-muted/50"]) }, [T(t.$slots, "default")], 2));
|
|
1667
1995
|
}
|
|
1668
|
-
}),
|
|
1996
|
+
}), Yr = ["aria-sort"], Xr = /* @__PURE__ */ p({
|
|
1669
1997
|
__name: "TableHead",
|
|
1670
1998
|
props: {
|
|
1671
1999
|
sortDirection: {},
|
|
@@ -1674,39 +2002,39 @@ var wr = /*#__PURE__*/ _r(Sr, [["render", Cr]]), Q = /* @__PURE__ */ p({
|
|
|
1674
2002
|
},
|
|
1675
2003
|
setup(e) {
|
|
1676
2004
|
let t = e, n = o(() => t.sortDirection && t.sortDirection !== "none" ? t.sortDirection : void 0);
|
|
1677
|
-
return (t, r) => (
|
|
2005
|
+
return (t, r) => (x(), l("th", {
|
|
1678
2006
|
scope: "col",
|
|
1679
2007
|
"aria-sort": n.value,
|
|
1680
2008
|
style: _(e.width ? { width: e.width } : void 0),
|
|
1681
|
-
class: g(
|
|
1682
|
-
}, [
|
|
2009
|
+
class: g(O(H)("px-3 py-2 font-medium", e.align === "center" && "text-center", e.align === "end" && "text-end"))
|
|
2010
|
+
}, [T(t.$slots, "default")], 14, Yr));
|
|
1683
2011
|
}
|
|
1684
|
-
}),
|
|
2012
|
+
}), $ = /* @__PURE__ */ p({
|
|
1685
2013
|
__name: "TableCell",
|
|
1686
2014
|
props: {
|
|
1687
2015
|
align: { default: "start" },
|
|
1688
2016
|
truncate: { type: Boolean }
|
|
1689
2017
|
},
|
|
1690
2018
|
setup(e) {
|
|
1691
|
-
let t = e, n = o(() =>
|
|
1692
|
-
return (e, t) => (
|
|
2019
|
+
let t = e, n = o(() => H("px-3 py-2 align-middle", t.align === "center" && "text-center", t.align === "end" && "text-end", t.truncate && "max-w-0 truncate"));
|
|
2020
|
+
return (e, t) => (x(), l("td", { class: g(n.value) }, [T(e.$slots, "default")], 2));
|
|
1693
2021
|
}
|
|
1694
|
-
}),
|
|
2022
|
+
}), Zr = ["colspan"], Qr = /* @__PURE__ */ p({
|
|
1695
2023
|
__name: "TableEmpty",
|
|
1696
2024
|
props: {
|
|
1697
2025
|
columns: {},
|
|
1698
2026
|
label: {}
|
|
1699
2027
|
},
|
|
1700
2028
|
setup(e) {
|
|
1701
|
-
return (t, n) => (
|
|
2029
|
+
return (t, n) => (x(), l("tr", null, [u("td", {
|
|
1702
2030
|
colspan: e.columns,
|
|
1703
2031
|
class: "px-3 py-8 text-center text-sm text-muted"
|
|
1704
|
-
}, [
|
|
2032
|
+
}, [T(t.$slots, "default", {}, () => [d(D(e.label), 1)])], 8, Zr)]));
|
|
1705
2033
|
}
|
|
1706
2034
|
});
|
|
1707
2035
|
//#endregion
|
|
1708
2036
|
//#region src/lib/pagination.ts
|
|
1709
|
-
function
|
|
2037
|
+
function $r(e, t, n) {
|
|
1710
2038
|
if (n <= 0 || t <= 0) return {
|
|
1711
2039
|
from: 0,
|
|
1712
2040
|
to: 0,
|
|
@@ -1723,17 +2051,17 @@ function Ar(e, t, n) {
|
|
|
1723
2051
|
total: n
|
|
1724
2052
|
};
|
|
1725
2053
|
}
|
|
1726
|
-
function
|
|
2054
|
+
function ei(e, t) {
|
|
1727
2055
|
return t <= 0 ? 1 : Math.max(1, Math.ceil(e / t));
|
|
1728
2056
|
}
|
|
1729
|
-
function
|
|
2057
|
+
function ti(e, t, n = 5) {
|
|
1730
2058
|
if (t <= 0) return [];
|
|
1731
2059
|
let r = Math.floor(n / 2), i = Math.max(0, Math.min(e - r, t - n)), a = Math.max(0, i);
|
|
1732
2060
|
return Array.from({ length: Math.min(n, t - a) }, (e, t) => a + t + 1);
|
|
1733
2061
|
}
|
|
1734
2062
|
//#endregion
|
|
1735
2063
|
//#region src/components/table/TablePagination.vue?vue&type=script&setup=true&lang.ts
|
|
1736
|
-
var
|
|
2064
|
+
var ni = { class: "flex flex-wrap items-center justify-between gap-3 px-3 py-2 text-sm text-muted" }, ri = { class: "flex items-center gap-2" }, ii = ["value"], ai = ["value"], oi = { class: "flex items-center gap-2" }, si = { class: "flex items-center gap-1" }, ci = /* @__PURE__ */ p({
|
|
1737
2065
|
__name: "TablePagination",
|
|
1738
2066
|
props: {
|
|
1739
2067
|
pageIndex: {},
|
|
@@ -1751,63 +2079,63 @@ var Nr = { class: "flex flex-wrap items-center justify-between gap-3 px-3 py-2 t
|
|
|
1751
2079
|
},
|
|
1752
2080
|
emits: ["update:pageIndex", "update:pageSize"],
|
|
1753
2081
|
setup(e, { emit: t }) {
|
|
1754
|
-
let n = e, r = t, i = o(() =>
|
|
2082
|
+
let n = e, r = t, i = o(() => ei(n.total, n.pageSize)), c = o(() => $r(n.pageIndex, n.pageSize, n.total)), p = o(() => ti(n.pageIndex, i.value));
|
|
1755
2083
|
function m(e) {
|
|
1756
2084
|
r("update:pageIndex", Math.max(0, Math.min(e, i.value - 1)));
|
|
1757
2085
|
}
|
|
1758
|
-
return (t, n) => (
|
|
2086
|
+
return (t, n) => (x(), l("div", ni, [u("div", ri, [u("span", null, D(e.rowsPerPageLabel), 1), u("select", {
|
|
1759
2087
|
value: e.pageSize,
|
|
1760
2088
|
class: "rounded-md border border-border bg-surface px-2 py-1 text-sm text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500",
|
|
1761
2089
|
onChange: n[0] ||= (e) => r("update:pageSize", Number(e.target.value))
|
|
1762
|
-
}, [(
|
|
2090
|
+
}, [(x(!0), l(a, null, w(e.pageSizeOptions, (e) => (x(), l("option", {
|
|
1763
2091
|
key: e,
|
|
1764
2092
|
value: e
|
|
1765
|
-
},
|
|
1766
|
-
f(
|
|
2093
|
+
}, D(e), 9, ai))), 128))], 40, ii)]), u("div", oi, [u("span", null, D(c.value.from) + "–" + D(c.value.to) + " " + D(e.ofLabel) + " " + D(c.value.total), 1), u("div", si, [
|
|
2094
|
+
f(X, {
|
|
1767
2095
|
variant: "ghost",
|
|
1768
2096
|
size: "icon-sm",
|
|
1769
2097
|
disabled: e.pageIndex <= 0,
|
|
1770
2098
|
"aria-label": e.previousLabel,
|
|
1771
2099
|
onClick: n[1] ||= (t) => m(e.pageIndex - 1)
|
|
1772
2100
|
}, {
|
|
1773
|
-
default:
|
|
2101
|
+
default: N(() => [f(O(ie), { class: "size-4 rtl:rotate-180" })]),
|
|
1774
2102
|
_: 1
|
|
1775
2103
|
}, 8, ["disabled", "aria-label"]),
|
|
1776
|
-
(
|
|
2104
|
+
(x(!0), l(a, null, w(p.value, (t) => (x(), s(X, {
|
|
1777
2105
|
key: t,
|
|
1778
2106
|
variant: t - 1 === e.pageIndex ? "default" : "ghost",
|
|
1779
2107
|
size: "icon-sm",
|
|
1780
2108
|
"aria-current": t - 1 === e.pageIndex ? "page" : void 0,
|
|
1781
2109
|
onClick: (e) => m(t - 1)
|
|
1782
2110
|
}, {
|
|
1783
|
-
default:
|
|
2111
|
+
default: N(() => [d(D(t), 1)]),
|
|
1784
2112
|
_: 2
|
|
1785
2113
|
}, 1032, [
|
|
1786
2114
|
"variant",
|
|
1787
2115
|
"aria-current",
|
|
1788
2116
|
"onClick"
|
|
1789
2117
|
]))), 128)),
|
|
1790
|
-
f(
|
|
2118
|
+
f(X, {
|
|
1791
2119
|
variant: "ghost",
|
|
1792
2120
|
size: "icon-sm",
|
|
1793
2121
|
disabled: e.pageIndex >= i.value - 1,
|
|
1794
2122
|
"aria-label": e.nextLabel,
|
|
1795
2123
|
onClick: n[2] ||= (t) => m(e.pageIndex + 1)
|
|
1796
2124
|
}, {
|
|
1797
|
-
default:
|
|
2125
|
+
default: N(() => [f(O(z), { class: "size-4 rtl:rotate-180" })]),
|
|
1798
2126
|
_: 1
|
|
1799
2127
|
}, 8, ["disabled", "aria-label"])
|
|
1800
2128
|
])])]));
|
|
1801
2129
|
}
|
|
1802
|
-
}),
|
|
1803
|
-
rowSortingFeature:
|
|
1804
|
-
rowPaginationFeature:
|
|
1805
|
-
rowExpandingFeature:
|
|
1806
|
-
sortedRowModel:
|
|
1807
|
-
paginatedRowModel:
|
|
1808
|
-
expandedRowModel:
|
|
1809
|
-
sortFns:
|
|
1810
|
-
}),
|
|
2130
|
+
}), li = vt({
|
|
2131
|
+
rowSortingFeature: gt,
|
|
2132
|
+
rowPaginationFeature: ht,
|
|
2133
|
+
rowExpandingFeature: mt,
|
|
2134
|
+
sortedRowModel: pt(),
|
|
2135
|
+
paginatedRowModel: ft(),
|
|
2136
|
+
expandedRowModel: dt(),
|
|
2137
|
+
sortFns: _t
|
|
2138
|
+
}), ui = [
|
|
1811
2139
|
"a[href]",
|
|
1812
2140
|
"button",
|
|
1813
2141
|
"input",
|
|
@@ -1820,16 +2148,21 @@ var Nr = { class: "flex flex-wrap items-center justify-between gap-3 px-3 py-2 t
|
|
|
1820
2148
|
"[role=\"menu\"]",
|
|
1821
2149
|
"[data-row-toggle-ignore]"
|
|
1822
2150
|
].join(",");
|
|
1823
|
-
function
|
|
2151
|
+
function di(e) {
|
|
1824
2152
|
let t = e;
|
|
1825
|
-
return !t || typeof t.closest != "function" ? !1 : t.closest(
|
|
2153
|
+
return !t || typeof t.closest != "function" ? !1 : t.closest(ui) !== null;
|
|
1826
2154
|
}
|
|
1827
|
-
function
|
|
2155
|
+
function fi(e, t) {
|
|
1828
2156
|
return e[t] ? {} : { [t]: !0 };
|
|
1829
2157
|
}
|
|
1830
2158
|
//#endregion
|
|
1831
2159
|
//#region src/components/data-table/DataTable.vue?vue&type=script&setup=true&lang.ts
|
|
1832
|
-
var
|
|
2160
|
+
var pi = ["aria-busy"], mi = {
|
|
2161
|
+
key: 0,
|
|
2162
|
+
class: "sr-only",
|
|
2163
|
+
role: "status",
|
|
2164
|
+
"aria-live": "polite"
|
|
2165
|
+
}, hi = ["onClick"], gi = /* @__PURE__ */ p({
|
|
1833
2166
|
__name: "DataTable",
|
|
1834
2167
|
props: {
|
|
1835
2168
|
data: {},
|
|
@@ -1854,7 +2187,13 @@ var Wr = ["onClick"], Gr = /* @__PURE__ */ p({
|
|
|
1854
2187
|
type: Boolean,
|
|
1855
2188
|
default: !0
|
|
1856
2189
|
},
|
|
1857
|
-
maxHeight: {}
|
|
2190
|
+
maxHeight: {},
|
|
2191
|
+
loading: {
|
|
2192
|
+
type: Boolean,
|
|
2193
|
+
default: !1
|
|
2194
|
+
},
|
|
2195
|
+
loadingRows: { default: 5 },
|
|
2196
|
+
loadingLabel: { default: "Loading…" }
|
|
1858
2197
|
},
|
|
1859
2198
|
emits: [
|
|
1860
2199
|
"update:sorting",
|
|
@@ -1862,8 +2201,8 @@ var Wr = ["onClick"], Gr = /* @__PURE__ */ p({
|
|
|
1862
2201
|
"row-click"
|
|
1863
2202
|
],
|
|
1864
2203
|
setup(e, { emit: t }) {
|
|
1865
|
-
let n = e, r = t, i =
|
|
1866
|
-
features:
|
|
2204
|
+
let n = e, r = t, i = te(), u = C([]), p = n.getRowId ? (e) => n.getRowId(e) : void 0, m = yt({
|
|
2205
|
+
features: li,
|
|
1867
2206
|
get columns() {
|
|
1868
2207
|
return n.columns;
|
|
1869
2208
|
},
|
|
@@ -1890,47 +2229,48 @@ var Wr = ["onClick"], Gr = /* @__PURE__ */ p({
|
|
|
1890
2229
|
let t = typeof e == "function" ? e(n.expanded) : e;
|
|
1891
2230
|
r("update:expanded", t === !0 ? {} : t);
|
|
1892
2231
|
}
|
|
1893
|
-
}), h = o(() => m.getRowModel().rows), v = o(() => m.getAllLeafColumns().length);
|
|
1894
|
-
function
|
|
2232
|
+
}), h = o(() => m.getRowModel().rows), v = o(() => m.getAllLeafColumns().length), y = o(() => Math.max(1, Math.floor(n.loadingRows)));
|
|
2233
|
+
function b(e) {
|
|
1895
2234
|
let t = m.getColumn(e);
|
|
1896
2235
|
return t?.getIsSorted() ? t.getIsSorted() === "desc" ? "descending" : "ascending" : "none";
|
|
1897
2236
|
}
|
|
1898
|
-
let
|
|
2237
|
+
let S = (e) => !!i[`cell-${e}`], E = (e) => {
|
|
1899
2238
|
let t = e.size;
|
|
1900
2239
|
return t ? `${t}px` : void 0;
|
|
1901
2240
|
};
|
|
1902
|
-
function
|
|
1903
|
-
r("row-click", h.value.find((e) => e.id === t)?.original), n.expandable && (n.stopRowToggleOnInteractiveCells &&
|
|
2241
|
+
function k(e, t) {
|
|
2242
|
+
r("row-click", h.value.find((e) => e.id === t)?.original), n.expandable && (n.stopRowToggleOnInteractiveCells && di(e.target) || r("update:expanded", fi(n.expanded, t)));
|
|
1904
2243
|
}
|
|
1905
|
-
return (t, n) => (
|
|
2244
|
+
return (t, n) => (x(), l("div", {
|
|
1906
2245
|
class: g(e.maxHeight ? "overflow-auto" : void 0),
|
|
1907
|
-
style: _(e.maxHeight ? { maxHeight: e.maxHeight } : void 0)
|
|
1908
|
-
|
|
2246
|
+
style: _(e.maxHeight ? { maxHeight: e.maxHeight } : void 0),
|
|
2247
|
+
"aria-busy": e.loading || void 0
|
|
2248
|
+
}, [e.loading ? (x(), l("span", mi, D(e.loadingLabel), 1)) : c("", !0), f(Br, {
|
|
1909
2249
|
striped: e.striped,
|
|
1910
2250
|
size: e.size
|
|
1911
2251
|
}, {
|
|
1912
|
-
default:
|
|
1913
|
-
default:
|
|
1914
|
-
default:
|
|
2252
|
+
default: N(() => [f(Gr, null, {
|
|
2253
|
+
default: N(() => [f(Q, null, {
|
|
2254
|
+
default: N(() => [(x(!0), l(a, null, w(O(m).getHeaderGroups()[0]?.headers ?? [], (t) => (x(), s(Xr, {
|
|
1915
2255
|
key: t.id,
|
|
1916
|
-
width:
|
|
1917
|
-
"sort-direction": t.column.getCanSort() ?
|
|
2256
|
+
width: E(t.column.columnDef),
|
|
2257
|
+
"sort-direction": t.column.getCanSort() ? b(t.column.id) : void 0
|
|
1918
2258
|
}, {
|
|
1919
|
-
default:
|
|
2259
|
+
default: N(() => [e.sortable && t.column.getCanSort() ? (x(), l("button", {
|
|
1920
2260
|
key: 0,
|
|
1921
2261
|
type: "button",
|
|
1922
2262
|
class: "inline-flex items-center gap-1 rounded focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500",
|
|
1923
2263
|
onClick: (e) => t.column.toggleSorting()
|
|
1924
|
-
}, [f(
|
|
2264
|
+
}, [f(O(ut), { header: t }, null, 8, ["header"]), b(t.column.id) === "descending" ? (x(), s(O(R), {
|
|
1925
2265
|
key: 0,
|
|
1926
2266
|
class: "size-3.5"
|
|
1927
|
-
})) :
|
|
2267
|
+
})) : b(t.column.id) === "ascending" ? (x(), s(O(ae), {
|
|
1928
2268
|
key: 1,
|
|
1929
2269
|
class: "size-3.5"
|
|
1930
|
-
})) : (
|
|
2270
|
+
})) : (x(), s(O(se), {
|
|
1931
2271
|
key: 2,
|
|
1932
2272
|
class: "size-3.5 opacity-40"
|
|
1933
|
-
}))], 8,
|
|
2273
|
+
}))], 8, hi)) : (x(), s(O(ut), {
|
|
1934
2274
|
key: 1,
|
|
1935
2275
|
header: t
|
|
1936
2276
|
}, null, 8, ["header"]))]),
|
|
@@ -1939,25 +2279,34 @@ var Wr = ["onClick"], Gr = /* @__PURE__ */ p({
|
|
|
1939
2279
|
_: 1
|
|
1940
2280
|
})]),
|
|
1941
2281
|
_: 1
|
|
1942
|
-
}), f(
|
|
1943
|
-
default:
|
|
2282
|
+
}), f(Jr, null, {
|
|
2283
|
+
default: N(() => [!e.loading && h.value.length === 0 ? (x(), s(Qr, {
|
|
1944
2284
|
key: 0,
|
|
1945
2285
|
columns: v.value
|
|
1946
2286
|
}, {
|
|
1947
|
-
default:
|
|
2287
|
+
default: N(() => [T(t.$slots, "empty", {}, () => [d(D(e.emptyLabel), 1)])]),
|
|
1948
2288
|
_: 3
|
|
1949
|
-
}, 8, ["columns"])) : c("", !0), (
|
|
2289
|
+
}, 8, ["columns"])) : c("", !0), e.loading ? (x(!0), l(a, { key: 1 }, w(y.value, (e) => (x(), s(Q, { key: "loading-" + e }, {
|
|
2290
|
+
default: N(() => [(x(!0), l(a, null, w(v.value, (e) => (x(), s($, { key: e }, {
|
|
2291
|
+
default: N(() => [f(jn, {
|
|
2292
|
+
height: "1rem",
|
|
2293
|
+
rounded: "sm"
|
|
2294
|
+
})]),
|
|
2295
|
+
_: 1
|
|
2296
|
+
}))), 128))]),
|
|
2297
|
+
_: 1
|
|
2298
|
+
}))), 128)) : (x(!0), l(a, { key: 2 }, w(h.value, (n) => (x(), l(a, { key: n.id }, [f(Q, {
|
|
1950
2299
|
clickable: e.expandable,
|
|
1951
2300
|
"data-row-id": n.id,
|
|
1952
2301
|
"data-state": n.getIsExpanded() ? "expanded" : void 0,
|
|
1953
|
-
onClick: (e) =>
|
|
2302
|
+
onClick: (e) => k(e, n.id)
|
|
1954
2303
|
}, {
|
|
1955
|
-
default:
|
|
1956
|
-
default:
|
|
2304
|
+
default: N(() => [(x(!0), l(a, null, w(n.getAllCells(), (e) => (x(), s($, { key: e.id }, {
|
|
2305
|
+
default: N(() => [S(e.column.id) ? T(t.$slots, `cell-${e.column.id}`, {
|
|
1957
2306
|
row: n,
|
|
1958
2307
|
cell: e,
|
|
1959
2308
|
value: e.getValue()
|
|
1960
|
-
}, void 0, void 0, 0) : (
|
|
2309
|
+
}, void 0, void 0, 0) : (x(), s(O(ut), {
|
|
1961
2310
|
key: 1,
|
|
1962
2311
|
cell: e
|
|
1963
2312
|
}, null, 8, ["cell"]))]),
|
|
@@ -1969,12 +2318,12 @@ var Wr = ["onClick"], Gr = /* @__PURE__ */ p({
|
|
|
1969
2318
|
"data-row-id",
|
|
1970
2319
|
"data-state",
|
|
1971
2320
|
"onClick"
|
|
1972
|
-
]), n.getIsExpanded() ? (
|
|
2321
|
+
]), n.getIsExpanded() ? (x(), s(Q, {
|
|
1973
2322
|
key: 0,
|
|
1974
2323
|
class: "bg-surface-muted/30"
|
|
1975
2324
|
}, {
|
|
1976
|
-
default:
|
|
1977
|
-
default:
|
|
2325
|
+
default: N(() => [f($, { colspan: v.value }, {
|
|
2326
|
+
default: N(() => [T(t.$slots, "expansion", { row: n })]),
|
|
1978
2327
|
_: 2
|
|
1979
2328
|
}, 1032, ["colspan"])]),
|
|
1980
2329
|
_: 2
|
|
@@ -1982,12 +2331,12 @@ var Wr = ["onClick"], Gr = /* @__PURE__ */ p({
|
|
|
1982
2331
|
_: 3
|
|
1983
2332
|
})]),
|
|
1984
2333
|
_: 3
|
|
1985
|
-
}, 8, ["striped", "size"])],
|
|
2334
|
+
}, 8, ["striped", "size"])], 14, pi));
|
|
1986
2335
|
}
|
|
1987
2336
|
});
|
|
1988
2337
|
//#endregion
|
|
1989
2338
|
//#region src/lib/tree.ts
|
|
1990
|
-
function
|
|
2339
|
+
function _i(e, t, n = 1, r = null) {
|
|
1991
2340
|
return e.flatMap((e) => {
|
|
1992
2341
|
let i = {
|
|
1993
2342
|
node: e,
|
|
@@ -1996,27 +2345,27 @@ function Kr(e, t, n = 1, r = null) {
|
|
|
1996
2345
|
parentKey: r,
|
|
1997
2346
|
hasChildren: !!e.children?.length
|
|
1998
2347
|
};
|
|
1999
|
-
return !i.hasChildren || !t.includes(e.value) ? [i] : [i, ...
|
|
2348
|
+
return !i.hasChildren || !t.includes(e.value) ? [i] : [i, ..._i(e.children, t, n + 1, e.value)];
|
|
2000
2349
|
});
|
|
2001
2350
|
}
|
|
2002
|
-
function
|
|
2351
|
+
function vi(e, t) {
|
|
2003
2352
|
for (let n of e) {
|
|
2004
2353
|
if (n.value === t) return n;
|
|
2005
|
-
let e = n.children ?
|
|
2354
|
+
let e = n.children ? vi(n.children, t) : void 0;
|
|
2006
2355
|
if (e) return e;
|
|
2007
2356
|
}
|
|
2008
2357
|
}
|
|
2009
|
-
function
|
|
2010
|
-
return e.flatMap((e) => e.children?.length ?
|
|
2358
|
+
function yi(e) {
|
|
2359
|
+
return e.flatMap((e) => e.children?.length ? yi(e.children) : [e.value]);
|
|
2011
2360
|
}
|
|
2012
|
-
function
|
|
2013
|
-
let n = e.children?.length ?
|
|
2361
|
+
function bi(e, t) {
|
|
2362
|
+
let n = e.children?.length ? yi([e]) : [e.value], r = n.filter((e) => t.includes(e)).length;
|
|
2014
2363
|
return r === 0 ? "unchecked" : r === n.length ? "checked" : "indeterminate";
|
|
2015
2364
|
}
|
|
2016
|
-
function
|
|
2365
|
+
function xi(e, t, n = (e) => e.label ?? "") {
|
|
2017
2366
|
let r = t.trim().toLowerCase();
|
|
2018
2367
|
return r ? e.reduce((e, i) => {
|
|
2019
|
-
let a = i.children ?
|
|
2368
|
+
let a = i.children ? xi(i.children, t, n) : void 0;
|
|
2020
2369
|
return !n(i).toLowerCase().includes(r) && (!a || a.length === 0) || e.push({
|
|
2021
2370
|
...i,
|
|
2022
2371
|
children: a
|
|
@@ -2025,10 +2374,10 @@ function Xr(e, t, n = (e) => e.label ?? "") {
|
|
|
2025
2374
|
}
|
|
2026
2375
|
//#endregion
|
|
2027
2376
|
//#region src/components/tree-table/TreeTable.vue?vue&type=script&setup=true&lang.ts
|
|
2028
|
-
var
|
|
2377
|
+
var Si = { class: "overflow-hidden rounded-md border border-border bg-surface" }, Ci = { class: "px-3 py-2" }, wi = ["aria-label", "onClick"], Ti = {
|
|
2029
2378
|
key: 1,
|
|
2030
2379
|
class: "inline-block size-4"
|
|
2031
|
-
},
|
|
2380
|
+
}, Ei = /* @__PURE__ */ p({
|
|
2032
2381
|
__name: "TreeTable",
|
|
2033
2382
|
props: {
|
|
2034
2383
|
nodes: {},
|
|
@@ -2042,21 +2391,21 @@ var Zr = { class: "overflow-hidden rounded-md border border-border bg-surface" }
|
|
|
2042
2391
|
},
|
|
2043
2392
|
emits: ["update:expanded"],
|
|
2044
2393
|
setup(e, { emit: t }) {
|
|
2045
|
-
let n = e, r = t, i = o(() => `minmax(12rem, 1fr) ${n.columns.map((e) => e.width ?? "minmax(6rem, 1fr)").join(" ")}`), c = o(() =>
|
|
2046
|
-
return (t, n) => (
|
|
2394
|
+
let n = e, r = t, i = o(() => `minmax(12rem, 1fr) ${n.columns.map((e) => e.width ?? "minmax(6rem, 1fr)").join(" ")}`), c = o(() => _i(n.nodes, n.expanded));
|
|
2395
|
+
return (t, n) => (x(), l("div", Si, [u("div", {
|
|
2047
2396
|
class: "grid border-b border-border bg-surface-muted/60 text-xs font-medium text-muted",
|
|
2048
2397
|
style: _({ gridTemplateColumns: i.value })
|
|
2049
|
-
}, [u("div",
|
|
2398
|
+
}, [u("div", Ci, [T(t.$slots, "header", {}, () => [d(D(e.rowColumnHeader), 1)])]), (x(!0), l(a, null, w(e.columns, (e) => (x(), l("div", {
|
|
2050
2399
|
key: e.key,
|
|
2051
2400
|
class: g(["px-3 py-2", [e.align === "center" && "text-center", e.align === "end" && "text-end"]])
|
|
2052
|
-
},
|
|
2401
|
+
}, D(e.header), 3))), 128))], 4), f(O(ct), {
|
|
2053
2402
|
items: e.nodes,
|
|
2054
2403
|
"get-key": (e) => e.value,
|
|
2055
2404
|
"get-children": (e) => e.children,
|
|
2056
2405
|
expanded: e.expanded,
|
|
2057
2406
|
"onUpdate:expanded": n[0] ||= (e) => r("update:expanded", e)
|
|
2058
2407
|
}, {
|
|
2059
|
-
default:
|
|
2408
|
+
default: N(() => [(x(!0), l(a, null, w(c.value, (n) => (x(), s(O(st), {
|
|
2060
2409
|
key: n.key,
|
|
2061
2410
|
value: n.node,
|
|
2062
2411
|
level: n.level,
|
|
@@ -2064,22 +2413,22 @@ var Zr = { class: "overflow-hidden rounded-md border border-border bg-surface" }
|
|
|
2064
2413
|
class: "grid items-center border-b border-border/60 text-sm last:border-b-0 data-[selected]:bg-surface-muted/30",
|
|
2065
2414
|
style: _({ gridTemplateColumns: i.value })
|
|
2066
2415
|
}, {
|
|
2067
|
-
default:
|
|
2416
|
+
default: N(({ isExpanded: r, handleToggle: i }) => [u("div", {
|
|
2068
2417
|
class: "flex items-center gap-1 px-3 py-2",
|
|
2069
2418
|
style: _({ paddingInlineStart: `calc(0.75rem + ${(n.level - 1) * 1.25}rem)` })
|
|
2070
|
-
}, [n.hasChildren ? (
|
|
2419
|
+
}, [n.hasChildren ? (x(), l("button", {
|
|
2071
2420
|
key: 0,
|
|
2072
2421
|
type: "button",
|
|
2073
2422
|
"aria-label": e.rowLabel(n.node),
|
|
2074
2423
|
class: g(["rounded p-0.5 text-muted transition-transform hover:bg-surface-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500", r && "rotate-90"]),
|
|
2075
|
-
onClick:
|
|
2076
|
-
}, [f(
|
|
2424
|
+
onClick: F(i, ["stop"])
|
|
2425
|
+
}, [f(O(z), { class: "size-3.5 rtl:rotate-180" })], 10, wi)) : (x(), l("span", Ti)), T(t.$slots, "row-label", {
|
|
2077
2426
|
node: n.node,
|
|
2078
2427
|
level: n.level
|
|
2079
|
-
}, () => [d(
|
|
2428
|
+
}, () => [d(D(e.rowLabel(n.node)), 1)])], 4), (x(!0), l(a, null, w(e.columns, (e) => (x(), l("div", {
|
|
2080
2429
|
key: e.key,
|
|
2081
2430
|
class: g(["px-3 py-2", [e.align === "center" && "text-center", e.align === "end" && "text-end"]])
|
|
2082
|
-
}, [
|
|
2431
|
+
}, [T(t.$slots, `cell-${e.key}`, {
|
|
2083
2432
|
node: n.node,
|
|
2084
2433
|
row: n,
|
|
2085
2434
|
isExpanded: r,
|
|
@@ -2100,22 +2449,22 @@ var Zr = { class: "overflow-hidden rounded-md border border-border bg-surface" }
|
|
|
2100
2449
|
"expanded"
|
|
2101
2450
|
])]));
|
|
2102
2451
|
}
|
|
2103
|
-
}),
|
|
2452
|
+
}), Di = ["disabled"], Oi = {
|
|
2104
2453
|
key: 0,
|
|
2105
2454
|
class: "truncate text-muted"
|
|
2106
|
-
},
|
|
2455
|
+
}, ki = {
|
|
2107
2456
|
key: 1,
|
|
2108
2457
|
class: "flex flex-wrap items-center gap-1"
|
|
2109
|
-
},
|
|
2458
|
+
}, Ai = {
|
|
2110
2459
|
key: 0,
|
|
2111
2460
|
class: "relative mb-2"
|
|
2112
|
-
},
|
|
2461
|
+
}, ji = ["placeholder"], Mi = {
|
|
2113
2462
|
key: 1,
|
|
2114
2463
|
class: "block h-0.5 w-2 rounded bg-white"
|
|
2115
|
-
},
|
|
2464
|
+
}, Ni = { class: "truncate" }, Pi = {
|
|
2116
2465
|
key: 1,
|
|
2117
2466
|
class: "mt-2 flex justify-end border-t border-border pt-2"
|
|
2118
|
-
},
|
|
2467
|
+
}, Fi = /* @__PURE__ */ p({
|
|
2119
2468
|
__name: "TreeSelect",
|
|
2120
2469
|
props: {
|
|
2121
2470
|
modelValue: { default: () => [] },
|
|
@@ -2135,46 +2484,46 @@ var Zr = { class: "overflow-hidden rounded-md border border-border bg-surface" }
|
|
|
2135
2484
|
},
|
|
2136
2485
|
emits: ["update:modelValue"],
|
|
2137
2486
|
setup(e, { emit: t }) {
|
|
2138
|
-
let n = e, r = t, i =
|
|
2139
|
-
function
|
|
2140
|
-
return
|
|
2487
|
+
let n = e, r = t, i = C(!1), p = C(""), m = C([]), h = o(() => xi(n.nodes, p.value)), v = o(() => _i(h.value, m.value)), y = o(() => yi(n.nodes)), b = o(() => n.modelValue.map((e) => vi(n.nodes, e)).filter((e) => !!e));
|
|
2488
|
+
function S(e) {
|
|
2489
|
+
return bi(e, n.modelValue);
|
|
2141
2490
|
}
|
|
2142
2491
|
function T(e) {
|
|
2143
2492
|
let t = (Array.isArray(e) ? e : []).map((e) => e.value);
|
|
2144
2493
|
r("update:modelValue", n.leafOnly ? t.filter((e) => y.value.includes(e)) : t);
|
|
2145
2494
|
}
|
|
2146
|
-
return (t, n) => (
|
|
2495
|
+
return (t, n) => (x(), s(O(Re), {
|
|
2147
2496
|
open: i.value,
|
|
2148
2497
|
"onUpdate:open": n[3] ||= (e) => i.value = e
|
|
2149
2498
|
}, {
|
|
2150
|
-
default:
|
|
2499
|
+
default: N(() => [f(O(ze), {
|
|
2151
2500
|
"as-child": "",
|
|
2152
2501
|
disabled: e.disabled
|
|
2153
2502
|
}, {
|
|
2154
|
-
default:
|
|
2503
|
+
default: N(() => [u("button", {
|
|
2155
2504
|
type: "button",
|
|
2156
2505
|
disabled: e.disabled,
|
|
2157
2506
|
class: g(["flex w-full items-center justify-between gap-2 rounded-md border border-border bg-surface px-3 text-start text-sm text-foreground shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 disabled:cursor-not-allowed disabled:opacity-50", e.size === "sm" ? "min-h-8 py-1 text-xs" : "min-h-9 py-1.5"])
|
|
2158
|
-
}, [
|
|
2507
|
+
}, [b.value.length === 0 ? (x(), l("span", Oi, D(e.placeholder), 1)) : (x(), l("span", ki, [(x(!0), l(a, null, w(b.value, (e) => (x(), s(Cn, {
|
|
2159
2508
|
key: e.value,
|
|
2160
2509
|
tone: "secondary"
|
|
2161
2510
|
}, {
|
|
2162
|
-
default:
|
|
2511
|
+
default: N(() => [d(D(e.label ?? e.value), 1)]),
|
|
2163
2512
|
_: 2
|
|
2164
|
-
}, 1024))), 128))])), f(
|
|
2513
|
+
}, 1024))), 128))])), f(O(R), { class: "size-4 shrink-0 opacity-50" })], 10, Di)]),
|
|
2165
2514
|
_: 1
|
|
2166
|
-
}, 8, ["disabled"]), f(
|
|
2515
|
+
}, 8, ["disabled"]), f(O(Le), {
|
|
2167
2516
|
"side-offset": 4,
|
|
2168
2517
|
class: "z-50 w-72 rounded-md border border-border bg-surface p-2 shadow-popover"
|
|
2169
2518
|
}, {
|
|
2170
|
-
default:
|
|
2171
|
-
e.filterable ? (
|
|
2519
|
+
default: N(() => [
|
|
2520
|
+
e.filterable ? (x(), l("div", Ai, [f(O(fe), { class: "pointer-events-none absolute start-2 top-1/2 size-3.5 -translate-y-1/2 text-muted" }), P(u("input", {
|
|
2172
2521
|
"onUpdate:modelValue": n[0] ||= (e) => p.value = e,
|
|
2173
2522
|
placeholder: e.filterPlaceholder,
|
|
2174
2523
|
class: "w-full rounded-md border border-border bg-surface py-1.5 pe-2 ps-7 text-sm placeholder:text-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500"
|
|
2175
|
-
}, null, 8,
|
|
2176
|
-
f(
|
|
2177
|
-
"model-value":
|
|
2524
|
+
}, null, 8, ji), [[j, p.value]])])) : c("", !0),
|
|
2525
|
+
f(O(ct), {
|
|
2526
|
+
"model-value": b.value,
|
|
2178
2527
|
items: h.value,
|
|
2179
2528
|
"get-key": (e) => e.value,
|
|
2180
2529
|
"get-children": (e) => e.children,
|
|
@@ -2184,7 +2533,7 @@ var Zr = { class: "overflow-hidden rounded-md border border-border bg-surface" }
|
|
|
2184
2533
|
"bubble-select": "",
|
|
2185
2534
|
"onUpdate:modelValue": T
|
|
2186
2535
|
}, {
|
|
2187
|
-
default:
|
|
2536
|
+
default: N(() => [(x(!0), l(a, null, w(v.value, (e) => (x(), s(O(st), {
|
|
2188
2537
|
key: e.key,
|
|
2189
2538
|
value: e.node,
|
|
2190
2539
|
level: e.level,
|
|
@@ -2192,13 +2541,13 @@ var Zr = { class: "overflow-hidden rounded-md border border-border bg-surface" }
|
|
|
2192
2541
|
class: "flex items-center gap-2 rounded py-1.5 text-sm text-foreground data-[selected]:bg-surface-muted/50",
|
|
2193
2542
|
style: _({ paddingInlineStart: `calc(0.5rem + ${(e.level - 1) * 1}rem)` })
|
|
2194
2543
|
}, {
|
|
2195
|
-
default:
|
|
2196
|
-
class: g(["flex size-4 shrink-0 items-center justify-center rounded border border-border",
|
|
2544
|
+
default: N(() => [u("span", {
|
|
2545
|
+
class: g(["flex size-4 shrink-0 items-center justify-center rounded border border-border", S(e.node) !== "unchecked" && "border-primary-500 bg-primary-500 text-white"]),
|
|
2197
2546
|
"aria-hidden": "true"
|
|
2198
|
-
}, [
|
|
2547
|
+
}, [S(e.node) === "checked" ? (x(), s(O(L), {
|
|
2199
2548
|
key: 0,
|
|
2200
2549
|
class: "size-3"
|
|
2201
|
-
})) :
|
|
2550
|
+
})) : S(e.node) === "indeterminate" ? (x(), l("span", Mi)) : c("", !0)], 2), u("span", Ni, D(e.node.label ?? e.node.value), 1)]),
|
|
2202
2551
|
_: 2
|
|
2203
2552
|
}, 1032, [
|
|
2204
2553
|
"value",
|
|
@@ -2213,22 +2562,22 @@ var Zr = { class: "overflow-hidden rounded-md border border-border bg-surface" }
|
|
|
2213
2562
|
"get-children",
|
|
2214
2563
|
"expanded"
|
|
2215
2564
|
]),
|
|
2216
|
-
e.modelValue.length ? (
|
|
2565
|
+
e.modelValue.length ? (x(), l("div", Pi, [u("button", {
|
|
2217
2566
|
type: "button",
|
|
2218
2567
|
class: "inline-flex items-center gap-1 rounded px-2 py-1 text-xs text-muted hover:bg-surface-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500",
|
|
2219
2568
|
onClick: n[2] ||= (e) => r("update:modelValue", [])
|
|
2220
|
-
}, [f(
|
|
2569
|
+
}, [f(O(V), { class: "size-3" }), n[4] ||= d("Clear ", -1)])])) : c("", !0)
|
|
2221
2570
|
]),
|
|
2222
2571
|
_: 1
|
|
2223
2572
|
})]),
|
|
2224
2573
|
_: 1
|
|
2225
2574
|
}, 8, ["open"]));
|
|
2226
2575
|
}
|
|
2227
|
-
}),
|
|
2228
|
-
function
|
|
2229
|
-
let t = Math.max(1, e.max ?? 4), n = e.duration ?? 5e3, r = e.position ?? "top-end", i =
|
|
2576
|
+
}), Ii = Symbol("myghf-toast"), Li = 0;
|
|
2577
|
+
function Ri(e = {}) {
|
|
2578
|
+
let t = Math.max(1, e.max ?? 4), n = e.duration ?? 5e3, r = e.position ?? "top-end", i = C([]), a = o(() => i.value.slice(0, t));
|
|
2230
2579
|
function s(e) {
|
|
2231
|
-
let t = `toast-${++
|
|
2580
|
+
let t = `toast-${++Li}`;
|
|
2232
2581
|
return i.value.push({
|
|
2233
2582
|
severity: "info",
|
|
2234
2583
|
position: r,
|
|
@@ -2264,14 +2613,14 @@ function fi(e = {}) {
|
|
|
2264
2613
|
secondary: u("secondary")
|
|
2265
2614
|
};
|
|
2266
2615
|
}
|
|
2267
|
-
function
|
|
2268
|
-
let e = m(
|
|
2616
|
+
function zi() {
|
|
2617
|
+
let e = m(Ii);
|
|
2269
2618
|
if (!e) throw Error("useToast() requires a <Toaster /> mounted above this component.");
|
|
2270
2619
|
return e;
|
|
2271
2620
|
}
|
|
2272
2621
|
//#endregion
|
|
2273
2622
|
//#region src/components/toast/Toast.vue?vue&type=script&setup=true&lang.ts
|
|
2274
|
-
var
|
|
2623
|
+
var Bi = { class: "min-w-0 flex-1" }, Vi = /* @__PURE__ */ p({
|
|
2275
2624
|
__name: "Toast",
|
|
2276
2625
|
props: {
|
|
2277
2626
|
item: {},
|
|
@@ -2286,48 +2635,48 @@ var mi = { class: "min-w-0 flex-1" }, hi = /* @__PURE__ */ p({
|
|
|
2286
2635
|
danger: "circle-alert",
|
|
2287
2636
|
secondary: "info"
|
|
2288
2637
|
};
|
|
2289
|
-
return (t, n) => (
|
|
2638
|
+
return (t, n) => (x(), s(O(it), {
|
|
2290
2639
|
"default-open": !0,
|
|
2291
2640
|
duration: l.value,
|
|
2292
2641
|
type: a.value,
|
|
2293
2642
|
"data-toast-root": "",
|
|
2294
2643
|
"data-duration": l.value,
|
|
2295
|
-
class: g(["pointer-events-auto flex w-full items-start gap-3 rounded-lg p-4 text-sm shadow-popover",
|
|
2644
|
+
class: g(["pointer-events-auto flex w-full items-start gap-3 rounded-lg p-4 text-sm shadow-popover", O(q)[i.value].soft]),
|
|
2296
2645
|
"onUpdate:open": n[1] ||= (e) => !e && r("close")
|
|
2297
2646
|
}, {
|
|
2298
|
-
default:
|
|
2299
|
-
f(
|
|
2647
|
+
default: N(() => [
|
|
2648
|
+
f(Y, {
|
|
2300
2649
|
name: e.item.icon || p[i.value],
|
|
2301
|
-
class: g(["mt-0.5 size-4 shrink-0",
|
|
2650
|
+
class: g(["mt-0.5 size-4 shrink-0", O(q)[i.value].icon])
|
|
2302
2651
|
}, null, 8, ["name", "class"]),
|
|
2303
|
-
u("div",
|
|
2652
|
+
u("div", Bi, [e.item.title ? (x(), s(O(at), {
|
|
2304
2653
|
key: 0,
|
|
2305
2654
|
class: "font-medium"
|
|
2306
2655
|
}, {
|
|
2307
|
-
default:
|
|
2656
|
+
default: N(() => [d(D(e.item.title), 1)]),
|
|
2308
2657
|
_: 1
|
|
2309
|
-
})) : c("", !0), e.item.description ? (
|
|
2658
|
+
})) : c("", !0), e.item.description ? (x(), s(O(nt), {
|
|
2310
2659
|
key: 1,
|
|
2311
2660
|
class: g(["leading-relaxed", e.item.title ? "mt-1" : ""])
|
|
2312
2661
|
}, {
|
|
2313
|
-
default:
|
|
2662
|
+
default: N(() => [d(D(e.item.description), 1)]),
|
|
2314
2663
|
_: 1
|
|
2315
2664
|
}, 8, ["class"])) : c("", !0)]),
|
|
2316
|
-
e.item.action ? (
|
|
2665
|
+
e.item.action ? (x(), s(O(et), {
|
|
2317
2666
|
key: 0,
|
|
2318
2667
|
"alt-text": e.item.action.label,
|
|
2319
2668
|
class: "-my-1 shrink-0 rounded-md px-2 py-1 font-medium transition-colors hover:bg-black/10 dark:hover:bg-white/10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500",
|
|
2320
2669
|
onClick: n[0] ||= (t) => e.item.action.onClick()
|
|
2321
2670
|
}, {
|
|
2322
|
-
default:
|
|
2671
|
+
default: N(() => [d(D(e.item.action.label), 1)]),
|
|
2323
2672
|
_: 1
|
|
2324
2673
|
}, 8, ["alt-text"])) : c("", !0),
|
|
2325
|
-
e.item.closable === !1 ? c("", !0) : (
|
|
2674
|
+
e.item.closable === !1 ? c("", !0) : (x(), s(O(tt), {
|
|
2326
2675
|
key: 1,
|
|
2327
2676
|
"aria-label": "Close",
|
|
2328
2677
|
class: "-me-1 -mt-1 shrink-0 rounded-md p-1 transition-colors hover:bg-black/10 dark:hover:bg-white/10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500"
|
|
2329
2678
|
}, {
|
|
2330
|
-
default:
|
|
2679
|
+
default: N(() => [f(O(V), { class: "size-4" })]),
|
|
2331
2680
|
_: 1
|
|
2332
2681
|
}))
|
|
2333
2682
|
]),
|
|
@@ -2339,7 +2688,7 @@ var mi = { class: "min-w-0 flex-1" }, hi = /* @__PURE__ */ p({
|
|
|
2339
2688
|
"class"
|
|
2340
2689
|
]));
|
|
2341
2690
|
}
|
|
2342
|
-
}),
|
|
2691
|
+
}), Hi = /* @__PURE__ */ p({
|
|
2343
2692
|
__name: "Toaster",
|
|
2344
2693
|
props: {
|
|
2345
2694
|
position: { default: "top-end" },
|
|
@@ -2350,12 +2699,12 @@ var mi = { class: "min-w-0 flex-1" }, hi = /* @__PURE__ */ p({
|
|
|
2350
2699
|
store: {}
|
|
2351
2700
|
},
|
|
2352
2701
|
setup(e) {
|
|
2353
|
-
let t = e, n = t.store ??
|
|
2702
|
+
let t = e, n = t.store ?? Ri({
|
|
2354
2703
|
max: t.max,
|
|
2355
2704
|
duration: t.duration,
|
|
2356
2705
|
position: t.position
|
|
2357
2706
|
});
|
|
2358
|
-
|
|
2707
|
+
S(Ii, n);
|
|
2359
2708
|
let r = [
|
|
2360
2709
|
"top-start",
|
|
2361
2710
|
"top-center",
|
|
@@ -2374,21 +2723,21 @@ var mi = { class: "min-w-0 flex-1" }, hi = /* @__PURE__ */ p({
|
|
|
2374
2723
|
function o(e) {
|
|
2375
2724
|
return n.visible.value.filter((n) => (n.position ?? t.position) === e);
|
|
2376
2725
|
}
|
|
2377
|
-
return (t, u) => (
|
|
2726
|
+
return (t, u) => (x(), s(O(rt), {
|
|
2378
2727
|
label: e.label,
|
|
2379
2728
|
duration: e.duration
|
|
2380
2729
|
}, {
|
|
2381
|
-
default:
|
|
2730
|
+
default: N(() => [T(t.$slots, "default"), (x(), l(a, null, w(r, (t) => (x(), l(a, { key: t }, [o(t).length > 0 ? (x(), s(O(ot), {
|
|
2382
2731
|
key: 0,
|
|
2383
2732
|
label: e.label,
|
|
2384
2733
|
class: g(["pointer-events-none fixed z-50 flex max-h-screen w-full max-w-sm flex-col", i[t]]),
|
|
2385
2734
|
style: _({ gap: e.gap })
|
|
2386
2735
|
}, {
|
|
2387
|
-
default:
|
|
2736
|
+
default: N(() => [(x(!0), l(a, null, w(o(t), (t) => (x(), s(Vi, {
|
|
2388
2737
|
key: t.id,
|
|
2389
2738
|
item: t,
|
|
2390
2739
|
duration: e.duration,
|
|
2391
|
-
onClose: (e) =>
|
|
2740
|
+
onClose: (e) => O(n).remove(t.id)
|
|
2392
2741
|
}, null, 8, [
|
|
2393
2742
|
"item",
|
|
2394
2743
|
"duration",
|
|
@@ -2405,6 +2754,6 @@ var mi = { class: "min-w-0 flex-1" }, hi = /* @__PURE__ */ p({
|
|
|
2405
2754
|
}
|
|
2406
2755
|
});
|
|
2407
2756
|
//#endregion
|
|
2408
|
-
export {
|
|
2757
|
+
export { On as Alert, On as Message, Pn as Avatar, X as Button, xn as Checkbox, gi as DataTable, lr as DatePicker, mr as Dialog, yr as Drawer, br as DropdownMenu, Sr as DropdownMenuContent, Er as DropdownMenuGroup, Cr as DropdownMenuItem, Tr as DropdownMenuLabel, wr as DropdownMenuSeparator, xr as DropdownMenuTrigger, gn as FormDescription, bn as FormField, vn as FormMessage, Y as Icon, Qt as Input, nn as InputNumber, mn as Label, dn as Password, Vn as Select, Hn as SelectButton, jn as Skeleton, An as Spinner, Br as Table, Jr as TableBody, $ as TableCell, Qr as TableEmpty, Xr as TableHead, Gr as TableHeader, ci as TablePagination, Q as TableRow, Fn as Tabs, Rn as TabsContent, In as TabsList, Ln as TabsTrigger, Cn as Tag, an as Textarea, qt as ThemeToggle, Hi as Toaster, zr as TransferList, Fi as TreeSelect, Ei as TreeTable, Tt as buildHourOptions, Et as buildMinuteOptions, Ct as clampTime, H as cn, Ut as createTheme, Ri as createToastStore, bt as dateToValue, K as formatLocalizedDate, jt as formatLocalizedTime, Dt as from12Hour, Ot as getFirstDayOfWeek, At as getMonthLabel, kt as getWeekdayLabels, Nt as mergeFormatOptions, It as resolveIconName, W as sortRange, G as to12Hour, wt as toISODate, St as toMinutes, Mt as toNumberOrNull, Pt as toPascalCase, U as toTime, Ii as toastKey, q as toneClasses, Z as useFormField, Gt as useTheme, zi as useToast, xt as valueToDate };
|
|
2409
2758
|
|
|
2410
2759
|
//# sourceMappingURL=index.js.map
|