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