@myghf/ui 0.1.0 → 0.3.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 +241 -5
- package/dist/components/alert/Alert.vue.d.ts +46 -0
- package/dist/components/alert/Alert.vue.d.ts.map +1 -0
- package/dist/components/button/Button.vue.d.ts +4 -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/input-number/InputNumber.vue.d.ts +31 -0
- package/dist/components/input-number/InputNumber.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/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 +17 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1286 -419
- 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/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/tailwindPreset.js +71 -68
- package/dist/tokens.css +85 -72
- package/package.json +10 -2
package/dist/index.js
CHANGED
|
@@ -1,79 +1,273 @@
|
|
|
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
|
|
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, onMounted as y, openBlock as b, provide as x, ref as S, renderList as C, renderSlot as w, resolveDynamicComponent as T, toDisplayString as E, unref as D, useAttrs as O, useSlots as ee, vModelSelect as k, vModelText as A, vShow as te, watch as j, withCtx as M, withDirectives as N, withModifiers as P } from "vue";
|
|
5
|
+
import * as ne from "lucide-vue-next";
|
|
6
|
+
import { Calendar as re, Check as F, ChevronDown as I, ChevronLeft as ie, ChevronRight as L, ChevronUp as ae, ChevronsLeft as oe, ChevronsRight as se, ChevronsUpDown as ce, Clock as le, Eye as R, EyeOff as ue, Moon as de, Search as fe, Sun as pe, X as z } from "lucide-vue-next";
|
|
7
7
|
import { tv as B } from "tailwind-variants";
|
|
8
|
-
import { CheckboxIndicator as
|
|
9
|
-
import { FlexRender as
|
|
8
|
+
import { CheckboxIndicator as V, CheckboxRoot as me, DialogClose as he, DialogContent as ge, DialogDescription as _e, DialogOverlay as ve, DialogPortal as ye, DialogRoot as be, DialogTitle as H, DialogTrigger as xe, DropdownMenuContent as Se, DropdownMenuItem as Ce, DropdownMenuPortal as we, DropdownMenuRoot as Te, DropdownMenuTrigger as Ee, NumberFieldDecrement as De, NumberFieldIncrement as Oe, NumberFieldInput as ke, NumberFieldRoot as Ae, PopoverContent as je, PopoverRoot as Me, PopoverTrigger as Ne, RadioGroupIndicator as Pe, RadioGroupItem as Fe, RadioGroupRoot as Ie, SelectContent as Le, SelectItem as Re, SelectItemIndicator as ze, SelectItemText as Be, SelectRoot as Ve, SelectTrigger as He, SelectValue as Ue, TabsContent as We, TabsList as Ge, TabsRoot as Ke, TabsTrigger as qe, ToastAction as Je, ToastClose as Ye, ToastDescription as Xe, ToastProvider as Ze, ToastRoot as Qe, ToastTitle as $e, ToastViewport as et, TreeItem as tt, TreeRoot as nt, VisuallyHidden as rt } from "reka-ui";
|
|
9
|
+
import { FlexRender as it, createExpandedRowModel as at, createPaginatedRowModel as ot, createSortedRowModel as st, rowExpandingFeature as ct, rowPaginationFeature as lt, rowSortingFeature as ut, sortFns as dt, tableFeatures as ft, useTable as pt } 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 mt(e) {
|
|
17
17
|
return new n(e.getFullYear(), e.getMonth() + 1, e.getDate());
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function ht(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 gt(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 _t(e, t) {
|
|
31
31
|
let n = new Date(e);
|
|
32
|
-
return n.setHours(Math.floor(
|
|
32
|
+
return n.setHours(Math.floor(gt(t) / 60), gt(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 vt(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 yt(e) {
|
|
42
|
+
return e === "12" ? Array.from({ length: 12 }, (e, t) => t + 1) : Array.from({ length: 24 }, (e, t) => t);
|
|
43
|
+
}
|
|
44
|
+
function bt(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 xt(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 St(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 Ct(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 wt(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 Tt(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 Et(e) {
|
|
97
|
+
return e == null || !Number.isFinite(e) ? null : e;
|
|
98
|
+
}
|
|
99
|
+
function Dt(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 Ot(e) {
|
|
44
112
|
return e.split("-").map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join("");
|
|
45
113
|
}
|
|
46
|
-
var
|
|
47
|
-
function
|
|
114
|
+
var kt = "circle";
|
|
115
|
+
function At(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() : kt;
|
|
118
|
+
}
|
|
119
|
+
//#endregion
|
|
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
|
+
}, jt = "myghf-theme", Mt = "both", Nt = "system";
|
|
153
|
+
function Y() {
|
|
154
|
+
return typeof window < "u" && typeof document < "u";
|
|
155
|
+
}
|
|
156
|
+
function Pt() {
|
|
157
|
+
return !Y() || typeof window.matchMedia != "function" ? "light" : window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
158
|
+
}
|
|
159
|
+
function Ft(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 It(e) {
|
|
168
|
+
return {
|
|
169
|
+
storageKey: e.storageKey ?? jt,
|
|
170
|
+
attribute: e.attribute ?? Mt,
|
|
171
|
+
defaultMode: e.defaultMode ?? Nt
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
function Lt(e = {}) {
|
|
175
|
+
let { storageKey: t, attribute: n, defaultMode: r } = It(e), i = Y() ? Ft(t) ?? r : r, a = S(i), s = o(() => a.value === "system" ? Pt() : 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 Rt = null;
|
|
216
|
+
function zt(e) {
|
|
217
|
+
return Rt || (Rt = Lt(e), Rt);
|
|
50
218
|
}
|
|
51
219
|
//#endregion
|
|
52
|
-
//#region src/components/
|
|
53
|
-
var
|
|
220
|
+
//#region src/components/theme-toggle/ThemeToggle.vue?vue&type=script&setup=true&lang.ts
|
|
221
|
+
var Bt = ["aria-label", "aria-pressed"], Vt = /* @__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 } = zt(), 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) => (b(), l("button", {
|
|
240
|
+
type: "button",
|
|
241
|
+
class: g(a.value),
|
|
242
|
+
"aria-label": e.label,
|
|
243
|
+
"aria-pressed": D(n),
|
|
244
|
+
onClick: i[0] ||= (e) => D(r)()
|
|
245
|
+
}, [D(n) ? (b(), s(D(pe), { key: 0 })) : (b(), s(D(de), { key: 1 }))], 10, Bt));
|
|
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(() => ne[Ot(At(t.name))] ?? ne.Circle);
|
|
255
|
+
return (t, r) => (b(), s(T(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
|
+
}), Ht = [
|
|
69
263
|
"type",
|
|
70
264
|
"disabled",
|
|
71
265
|
"data-loading"
|
|
72
|
-
],
|
|
266
|
+
], Ut = {
|
|
73
267
|
key: 0,
|
|
74
268
|
class: "size-4 animate-spin rounded-full border-2 border-current border-t-transparent",
|
|
75
269
|
"aria-hidden": "true"
|
|
76
|
-
},
|
|
270
|
+
}, Z = /* @__PURE__ */ p({
|
|
77
271
|
__name: "Button",
|
|
78
272
|
props: {
|
|
79
273
|
variant: { default: "default" },
|
|
@@ -91,7 +285,7 @@ var q = /* @__PURE__ */ p({
|
|
|
91
285
|
},
|
|
92
286
|
setup(e) {
|
|
93
287
|
let t = B({
|
|
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",
|
|
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,22 +306,22 @@ 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 = O(), i = o(() => n.disabled || n.loading || !!r.disabled);
|
|
310
|
+
return (n, a) => (b(), l("button", h({
|
|
117
311
|
type: e.type,
|
|
118
312
|
disabled: i.value,
|
|
119
313
|
"data-loading": e.loading || void 0,
|
|
120
|
-
class:
|
|
314
|
+
class: D(t)({
|
|
121
315
|
variant: e.variant,
|
|
122
316
|
size: e.size
|
|
123
317
|
})
|
|
124
|
-
},
|
|
318
|
+
}, D(r)), [e.loading ? (b(), l("span", Ut)) : w(n.$slots, "default", {}, () => [d(E(e.label), 1)], void 0, 1)], 16, Ht));
|
|
125
319
|
}
|
|
126
|
-
}),
|
|
320
|
+
}), Wt = { class: "relative w-full" }, Gt = [
|
|
127
321
|
"value",
|
|
128
322
|
"placeholder",
|
|
129
323
|
"disabled"
|
|
130
|
-
],
|
|
324
|
+
], Kt = /* @__PURE__ */ p({
|
|
131
325
|
__name: "Input",
|
|
132
326
|
props: {
|
|
133
327
|
modelValue: {},
|
|
@@ -140,14 +334,14 @@ var q = /* @__PURE__ */ p({
|
|
|
140
334
|
},
|
|
141
335
|
emits: ["update:modelValue"],
|
|
142
336
|
setup(e, { expose: t, emit: n }) {
|
|
143
|
-
let r = n, i =
|
|
144
|
-
return t({ focus: () => a.value?.focus() }), (t, n) => (
|
|
145
|
-
e.leadingIcon ? (
|
|
337
|
+
let r = n, i = O(), a = S();
|
|
338
|
+
return t({ focus: () => a.value?.focus() }), (t, n) => (b(), l("div", Wt, [
|
|
339
|
+
e.leadingIcon ? (b(), s(X, {
|
|
146
340
|
key: 0,
|
|
147
341
|
name: e.leadingIcon,
|
|
148
342
|
class: "pointer-events-none absolute start-3 top-1/2 size-4 -translate-y-1/2 text-muted"
|
|
149
343
|
}, null, 8, ["name"])) : c("", !0),
|
|
150
|
-
u("input",
|
|
344
|
+
u("input", h({
|
|
151
345
|
ref_key: "inputRef",
|
|
152
346
|
ref: a,
|
|
153
347
|
value: e.modelValue,
|
|
@@ -160,20 +354,127 @@ var q = /* @__PURE__ */ p({
|
|
|
160
354
|
e.trailingIcon ? "pe-9" : "pe-3",
|
|
161
355
|
e.invalid ? "border-error-500 focus-visible:ring-error-500" : ""
|
|
162
356
|
]
|
|
163
|
-
},
|
|
164
|
-
e.trailingIcon ? (
|
|
357
|
+
}, D(i), { onInput: n[0] ||= (e) => r("update:modelValue", e.target.value) }), null, 16, Gt),
|
|
358
|
+
e.trailingIcon ? (b(), s(X, {
|
|
165
359
|
key: 1,
|
|
166
360
|
name: e.trailingIcon,
|
|
167
361
|
class: "pointer-events-none absolute end-3 top-1/2 size-4 -translate-y-1/2 text-muted"
|
|
168
362
|
}, null, 8, ["name"])) : c("", !0)
|
|
169
363
|
]));
|
|
170
364
|
}
|
|
171
|
-
}),
|
|
365
|
+
}), qt = {
|
|
366
|
+
key: 0,
|
|
367
|
+
class: "shrink-0 select-none text-muted"
|
|
368
|
+
}, Jt = {
|
|
369
|
+
key: 1,
|
|
370
|
+
class: "shrink-0 select-none text-muted"
|
|
371
|
+
}, Yt = {
|
|
372
|
+
key: 2,
|
|
373
|
+
class: "ms-1 flex shrink-0 flex-col"
|
|
374
|
+
}, Xt = /* @__PURE__ */ p({
|
|
375
|
+
inheritAttrs: !1,
|
|
376
|
+
__name: "InputNumber",
|
|
377
|
+
props: {
|
|
378
|
+
modelValue: {},
|
|
379
|
+
min: {},
|
|
380
|
+
max: {},
|
|
381
|
+
step: { default: 1 },
|
|
382
|
+
stepSnapping: { type: Boolean },
|
|
383
|
+
integer: { type: Boolean },
|
|
384
|
+
locale: {},
|
|
385
|
+
formatOptions: {},
|
|
386
|
+
currency: {},
|
|
387
|
+
prefix: {},
|
|
388
|
+
suffix: {},
|
|
389
|
+
showButtons: { type: Boolean },
|
|
390
|
+
placeholder: {},
|
|
391
|
+
disabled: { type: Boolean },
|
|
392
|
+
readonly: { type: Boolean },
|
|
393
|
+
invalid: { type: Boolean },
|
|
394
|
+
size: { default: "default" },
|
|
395
|
+
id: {},
|
|
396
|
+
name: {}
|
|
397
|
+
},
|
|
398
|
+
emits: ["update:modelValue"],
|
|
399
|
+
setup(e, { emit: t }) {
|
|
400
|
+
let n = e, r = t, i = O(), a = o(() => Number.isFinite(n.step) && n.step > 0 ? n.step : 1), s = o(() => Dt({
|
|
401
|
+
currency: n.currency,
|
|
402
|
+
formatOptions: n.formatOptions,
|
|
403
|
+
integer: n.integer
|
|
404
|
+
})), u = o(() => {
|
|
405
|
+
if (n.modelValue != null) try {
|
|
406
|
+
return new Intl.NumberFormat(n.locale, s.value).format(n.modelValue);
|
|
407
|
+
} catch {
|
|
408
|
+
return;
|
|
409
|
+
}
|
|
410
|
+
});
|
|
411
|
+
return (t, n) => (b(), l("div", { class: g(["relative flex w-full items-center rounded-md border border-border bg-surface px-3 text-sm text-foreground shadow-sm transition-colors focus-within:ring-2 focus-within:ring-primary-500", [
|
|
412
|
+
e.size === "sm" ? "h-8 text-xs" : e.size === "lg" ? "h-10" : "h-9",
|
|
413
|
+
e.invalid ? "border-error-500 focus-within:ring-error-500" : "",
|
|
414
|
+
e.disabled ? "cursor-not-allowed opacity-50" : ""
|
|
415
|
+
]]) }, [f(D(Ae), {
|
|
416
|
+
"model-value": e.modelValue,
|
|
417
|
+
min: e.min,
|
|
418
|
+
max: e.max,
|
|
419
|
+
step: a.value,
|
|
420
|
+
"step-snapping": e.stepSnapping,
|
|
421
|
+
"format-options": s.value,
|
|
422
|
+
locale: e.locale,
|
|
423
|
+
disabled: e.disabled,
|
|
424
|
+
readonly: e.readonly,
|
|
425
|
+
id: e.id,
|
|
426
|
+
name: e.name,
|
|
427
|
+
class: "flex min-w-0 flex-1 items-center gap-1",
|
|
428
|
+
"onUpdate:modelValue": n[0] ||= (e) => r("update:modelValue", D(Et)(e))
|
|
429
|
+
}, {
|
|
430
|
+
default: M(() => [
|
|
431
|
+
e.prefix ? (b(), l("span", qt, E(e.prefix), 1)) : c("", !0),
|
|
432
|
+
f(D(ke), h(D(i), {
|
|
433
|
+
placeholder: e.placeholder,
|
|
434
|
+
"aria-invalid": e.invalid || void 0,
|
|
435
|
+
"aria-valuetext": u.value,
|
|
436
|
+
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"
|
|
437
|
+
}), null, 16, [
|
|
438
|
+
"placeholder",
|
|
439
|
+
"aria-invalid",
|
|
440
|
+
"aria-valuetext"
|
|
441
|
+
]),
|
|
442
|
+
e.suffix ? (b(), l("span", Jt, E(e.suffix), 1)) : c("", !0),
|
|
443
|
+
e.showButtons ? (b(), l("div", Yt, [f(D(Oe), { 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" }, {
|
|
444
|
+
default: M(() => [f(X, {
|
|
445
|
+
name: "chevron-up",
|
|
446
|
+
size: 12
|
|
447
|
+
})]),
|
|
448
|
+
_: 1
|
|
449
|
+
}), f(D(De), { 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" }, {
|
|
450
|
+
default: M(() => [f(X, {
|
|
451
|
+
name: "chevron-down",
|
|
452
|
+
size: 12
|
|
453
|
+
})]),
|
|
454
|
+
_: 1
|
|
455
|
+
})])) : c("", !0)
|
|
456
|
+
]),
|
|
457
|
+
_: 1
|
|
458
|
+
}, 8, [
|
|
459
|
+
"model-value",
|
|
460
|
+
"min",
|
|
461
|
+
"max",
|
|
462
|
+
"step",
|
|
463
|
+
"step-snapping",
|
|
464
|
+
"format-options",
|
|
465
|
+
"locale",
|
|
466
|
+
"disabled",
|
|
467
|
+
"readonly",
|
|
468
|
+
"id",
|
|
469
|
+
"name"
|
|
470
|
+
])], 2));
|
|
471
|
+
}
|
|
472
|
+
}), Zt = [
|
|
172
473
|
"value",
|
|
173
474
|
"placeholder",
|
|
174
475
|
"disabled",
|
|
175
476
|
"rows"
|
|
176
|
-
],
|
|
477
|
+
], Qt = /* @__PURE__ */ p({
|
|
177
478
|
__name: "Textarea",
|
|
178
479
|
props: {
|
|
179
480
|
modelValue: {},
|
|
@@ -184,26 +485,26 @@ var q = /* @__PURE__ */ p({
|
|
|
184
485
|
},
|
|
185
486
|
emits: ["update:modelValue"],
|
|
186
487
|
setup(e, { emit: t }) {
|
|
187
|
-
let n = t, r =
|
|
188
|
-
return (t, i) => (
|
|
488
|
+
let n = t, r = O();
|
|
489
|
+
return (t, i) => (b(), l("textarea", h({
|
|
189
490
|
value: e.modelValue,
|
|
190
491
|
placeholder: e.placeholder,
|
|
191
492
|
disabled: e.disabled,
|
|
192
493
|
rows: e.rows,
|
|
193
494
|
class: ["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", e.invalid ? "border-error-500 focus-visible:ring-error-500" : ""]
|
|
194
|
-
},
|
|
495
|
+
}, D(r), { onInput: i[0] ||= (e) => n("update:modelValue", e.target.value) }), null, 16, Zt));
|
|
195
496
|
}
|
|
196
|
-
}),
|
|
497
|
+
}), $t = { class: "w-full" }, en = { class: "relative w-full" }, tn = [
|
|
197
498
|
"id",
|
|
198
499
|
"type",
|
|
199
500
|
"value",
|
|
200
501
|
"placeholder",
|
|
201
502
|
"disabled"
|
|
202
|
-
],
|
|
503
|
+
], nn = ["disabled"], rn = {
|
|
203
504
|
key: 0,
|
|
204
505
|
class: "mt-1.5 flex items-center gap-1.5",
|
|
205
506
|
"aria-hidden": "true"
|
|
206
|
-
},
|
|
507
|
+
}, an = /* @__PURE__ */ p({
|
|
207
508
|
__name: "Password",
|
|
208
509
|
props: {
|
|
209
510
|
modelValue: {},
|
|
@@ -218,13 +519,13 @@ var q = /* @__PURE__ */ p({
|
|
|
218
519
|
},
|
|
219
520
|
emits: ["update:modelValue"],
|
|
220
521
|
setup(e, { emit: t }) {
|
|
221
|
-
let n = e, r = t, i =
|
|
522
|
+
let n = e, r = t, i = O(), d = S(!1), f = o(() => d.value ? "text" : "password"), p = o(() => {
|
|
222
523
|
let e = n.modelValue ?? "";
|
|
223
524
|
if (e.length === 0) return 0;
|
|
224
525
|
let t = 0;
|
|
225
526
|
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
527
|
});
|
|
227
|
-
return (t, n) => (
|
|
528
|
+
return (t, n) => (b(), l("div", $t, [u("div", en, [u("input", h({
|
|
228
529
|
id: e.id,
|
|
229
530
|
type: f.value,
|
|
230
531
|
value: e.modelValue,
|
|
@@ -235,24 +536,24 @@ var q = /* @__PURE__ */ p({
|
|
|
235
536
|
e.invalid ? "border-error-500 focus-visible:ring-error-500" : "",
|
|
236
537
|
"pe-10"
|
|
237
538
|
]
|
|
238
|
-
},
|
|
539
|
+
}, D(i), { onInput: n[0] ||= (e) => r("update:modelValue", e.target.value) }), null, 16, tn), u("button", {
|
|
239
540
|
type: "button",
|
|
240
541
|
disabled: e.disabled,
|
|
241
542
|
"aria-label": "Toggle password visibility",
|
|
242
543
|
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
544
|
onClick: n[1] ||= (e) => d.value = !d.value
|
|
244
|
-
}, [d.value ? (
|
|
545
|
+
}, [d.value ? (b(), s(D(ue), {
|
|
245
546
|
key: 0,
|
|
246
547
|
class: "size-4"
|
|
247
|
-
})) : (
|
|
548
|
+
})) : (b(), s(D(R), {
|
|
248
549
|
key: 1,
|
|
249
550
|
class: "size-4"
|
|
250
|
-
}))], 8,
|
|
551
|
+
}))], 8, nn)]), e.feedback && e.modelValue ? (b(), l("div", rn, [(b(), l(a, null, C(4, (e) => u("span", {
|
|
251
552
|
key: e,
|
|
252
|
-
class:
|
|
553
|
+
class: g(["h-1 flex-1 rounded-full transition-colors", e <= p.value ? "bg-success-500" : "bg-surface-muted"])
|
|
253
554
|
}, null, 2)), 64))])) : c("", !0)]));
|
|
254
555
|
}
|
|
255
|
-
}),
|
|
556
|
+
}), on = /* @__PURE__ */ p({
|
|
256
557
|
__name: "Checkbox",
|
|
257
558
|
props: {
|
|
258
559
|
modelValue: {
|
|
@@ -265,15 +566,15 @@ var q = /* @__PURE__ */ p({
|
|
|
265
566
|
emits: ["update:modelValue"],
|
|
266
567
|
setup(e, { emit: t }) {
|
|
267
568
|
let n = t;
|
|
268
|
-
return (t, r) => (
|
|
569
|
+
return (t, r) => (b(), s(D(me), {
|
|
269
570
|
id: e.id,
|
|
270
571
|
"model-value": e.modelValue,
|
|
271
572
|
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",
|
|
573
|
+
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
574
|
"onUpdate:modelValue": r[0] ||= (e) => n("update:modelValue", e)
|
|
274
575
|
}, {
|
|
275
|
-
default:
|
|
276
|
-
default:
|
|
576
|
+
default: M(() => [f(D(V), { class: "flex items-center justify-center text-white" }, {
|
|
577
|
+
default: M(() => [f(D(F), { class: "size-3.5" })]),
|
|
277
578
|
_: 1
|
|
278
579
|
})]),
|
|
279
580
|
_: 1
|
|
@@ -283,82 +584,170 @@ var q = /* @__PURE__ */ p({
|
|
|
283
584
|
"disabled"
|
|
284
585
|
]));
|
|
285
586
|
}
|
|
286
|
-
}),
|
|
587
|
+
}), sn = ["aria-label"], cn = /* @__PURE__ */ p({
|
|
287
588
|
__name: "Tag",
|
|
288
589
|
props: {
|
|
289
|
-
tone: {},
|
|
590
|
+
tone: { default: "secondary" },
|
|
290
591
|
icon: {},
|
|
291
592
|
removable: { type: Boolean },
|
|
292
593
|
removeLabel: { default: "Remove" }
|
|
293
594
|
},
|
|
294
595
|
emits: ["remove"],
|
|
295
596
|
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, {
|
|
597
|
+
let n = t;
|
|
598
|
+
return (t, r) => (b(), l("span", { class: g(["inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium", D(J)[e.tone].soft]) }, [
|
|
599
|
+
e.icon ? (b(), s(X, {
|
|
309
600
|
key: 0,
|
|
310
601
|
name: e.icon,
|
|
311
602
|
class: "size-3"
|
|
312
603
|
}, null, 8, ["name"])) : c("", !0),
|
|
313
|
-
|
|
314
|
-
e.removable ? (
|
|
604
|
+
w(t.$slots, "default"),
|
|
605
|
+
e.removable ? (b(), l("button", {
|
|
315
606
|
key: 1,
|
|
316
607
|
type: "button",
|
|
317
608
|
"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(
|
|
609
|
+
class: "-me-0.5 ms-0.5 rounded-full p-0.5 transition-colors hover:bg-black/10 dark:hover:bg-white/10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500",
|
|
610
|
+
onClick: r[0] ||= P((e) => n("remove"), ["stop"])
|
|
611
|
+
}, [f(D(z), { class: "size-3" })], 8, sn)) : c("", !0)
|
|
321
612
|
], 2));
|
|
322
613
|
}
|
|
323
|
-
}),
|
|
614
|
+
}), ln = ["role"], un = { class: "min-w-0 flex-1" }, dn = {
|
|
615
|
+
key: 0,
|
|
616
|
+
class: "font-medium"
|
|
617
|
+
}, fn = ["aria-label"], pn = /* @__PURE__ */ p({
|
|
618
|
+
__name: "Alert",
|
|
619
|
+
props: {
|
|
620
|
+
tone: { default: "info" },
|
|
621
|
+
title: {},
|
|
622
|
+
description: {},
|
|
623
|
+
icon: {},
|
|
624
|
+
showIcon: {
|
|
625
|
+
type: Boolean,
|
|
626
|
+
default: !1
|
|
627
|
+
},
|
|
628
|
+
closable: {
|
|
629
|
+
type: Boolean,
|
|
630
|
+
default: !1
|
|
631
|
+
},
|
|
632
|
+
duration: {},
|
|
633
|
+
closeLabel: { default: "Close" },
|
|
634
|
+
variant: { default: "soft" }
|
|
635
|
+
},
|
|
636
|
+
emits: ["close"],
|
|
637
|
+
setup(e, { emit: t }) {
|
|
638
|
+
let n = e, r = t, i = {
|
|
639
|
+
info: "info",
|
|
640
|
+
success: "circle-check",
|
|
641
|
+
warning: "triangle-alert",
|
|
642
|
+
danger: "circle-alert",
|
|
643
|
+
secondary: "info"
|
|
644
|
+
}, a = S(!1), o = S(!1), p = S(!1), m, h = 0, _ = 0;
|
|
645
|
+
function x() {
|
|
646
|
+
m !== void 0 && (clearTimeout(m), m = void 0);
|
|
647
|
+
}
|
|
648
|
+
function C(e) {
|
|
649
|
+
x(), !(e <= 0) && (_ = e, h = Date.now() + e, m = setTimeout(j, e));
|
|
650
|
+
}
|
|
651
|
+
function T() {
|
|
652
|
+
m !== void 0 && (x(), _ = Math.max(0, h - Date.now()));
|
|
653
|
+
}
|
|
654
|
+
function O() {
|
|
655
|
+
if (!(a.value || o.value || p.value || m !== void 0) && !(!n.duration || n.duration <= 0)) {
|
|
656
|
+
if (_ <= 0) {
|
|
657
|
+
j();
|
|
658
|
+
return;
|
|
659
|
+
}
|
|
660
|
+
C(_);
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
function ee() {
|
|
664
|
+
o.value = !0, T();
|
|
665
|
+
}
|
|
666
|
+
function k() {
|
|
667
|
+
o.value = !1, O();
|
|
668
|
+
}
|
|
669
|
+
function A() {
|
|
670
|
+
p.value = !0, T();
|
|
671
|
+
}
|
|
672
|
+
function te() {
|
|
673
|
+
p.value = !1, O();
|
|
674
|
+
}
|
|
675
|
+
function j() {
|
|
676
|
+
a.value || (a.value = !0, x(), r("close"));
|
|
677
|
+
}
|
|
678
|
+
return y(() => {
|
|
679
|
+
n.duration && n.duration > 0 && C(n.duration);
|
|
680
|
+
}), v(x), (t, n) => a.value ? c("", !0) : (b(), l("div", {
|
|
681
|
+
key: 0,
|
|
682
|
+
role: D(J)[e.tone].role,
|
|
683
|
+
class: g(["flex w-full items-start gap-3 rounded-lg p-4 text-sm", D(J)[e.tone][e.variant]]),
|
|
684
|
+
onMouseenter: ee,
|
|
685
|
+
onMouseleave: k,
|
|
686
|
+
onFocusin: A,
|
|
687
|
+
onFocusout: te
|
|
688
|
+
}, [
|
|
689
|
+
w(t.$slots, "icon", {}, () => [e.showIcon ? (b(), s(X, {
|
|
690
|
+
key: 0,
|
|
691
|
+
name: e.icon || i[e.tone],
|
|
692
|
+
class: g(["mt-0.5 size-4 shrink-0", D(J)[e.tone].icon])
|
|
693
|
+
}, null, 8, ["name", "class"])) : c("", !0)]),
|
|
694
|
+
u("div", un, [
|
|
695
|
+
e.title || t.$slots.title ? (b(), l("p", dn, [w(t.$slots, "title", {}, () => [d(E(e.title), 1)])])) : c("", !0),
|
|
696
|
+
e.description || t.$slots.description ? (b(), l("div", {
|
|
697
|
+
key: 1,
|
|
698
|
+
class: g(["leading-relaxed", e.title || t.$slots.title ? "mt-1" : ""])
|
|
699
|
+
}, [w(t.$slots, "description", {}, () => [d(E(e.description), 1)])], 2)) : c("", !0),
|
|
700
|
+
w(t.$slots, "default")
|
|
701
|
+
]),
|
|
702
|
+
w(t.$slots, "actions"),
|
|
703
|
+
e.closable ? (b(), l("button", {
|
|
704
|
+
key: 0,
|
|
705
|
+
type: "button",
|
|
706
|
+
"aria-label": e.closeLabel,
|
|
707
|
+
class: "-me-1 -mt-1 ms-auto shrink-0 rounded-md p-1 transition-colors hover:bg-black/10 dark:hover:bg-white/10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500",
|
|
708
|
+
onClick: j
|
|
709
|
+
}, [w(t.$slots, "close", {}, () => [f(D(z), { class: "size-4" })])], 8, fn)) : c("", !0)
|
|
710
|
+
], 42, ln));
|
|
711
|
+
}
|
|
712
|
+
}), mn = /* @__PURE__ */ p({
|
|
324
713
|
__name: "Tabs",
|
|
325
714
|
props: { modelValue: {} },
|
|
326
715
|
emits: ["update:modelValue"],
|
|
327
716
|
setup(e, { emit: t }) {
|
|
328
717
|
let n = t;
|
|
329
|
-
return (t, r) => (
|
|
718
|
+
return (t, r) => (b(), s(D(Ke), {
|
|
330
719
|
"model-value": e.modelValue,
|
|
331
720
|
"onUpdate:modelValue": r[0] ||= (e) => n("update:modelValue", e)
|
|
332
721
|
}, {
|
|
333
|
-
default:
|
|
722
|
+
default: M(() => [w(t.$slots, "default")]),
|
|
334
723
|
_: 3
|
|
335
724
|
}, 8, ["model-value"]));
|
|
336
725
|
}
|
|
337
|
-
}),
|
|
726
|
+
}), hn = /* @__PURE__ */ p({
|
|
338
727
|
__name: "TabsList",
|
|
339
728
|
setup(e) {
|
|
340
|
-
return (e, t) => (
|
|
341
|
-
default:
|
|
729
|
+
return (e, t) => (b(), s(D(Ge), { class: "inline-flex h-9 w-full items-center justify-start gap-1 rounded-lg bg-surface-muted p-1 text-muted" }, {
|
|
730
|
+
default: M(() => [w(e.$slots, "default")]),
|
|
342
731
|
_: 3
|
|
343
732
|
}));
|
|
344
733
|
}
|
|
345
|
-
}),
|
|
734
|
+
}), gn = /* @__PURE__ */ p({
|
|
346
735
|
__name: "TabsTrigger",
|
|
347
736
|
props: {
|
|
348
737
|
value: {},
|
|
349
738
|
disabled: { type: Boolean }
|
|
350
739
|
},
|
|
351
740
|
setup(e) {
|
|
352
|
-
return (t, n) => (
|
|
741
|
+
return (t, n) => (b(), s(D(qe), {
|
|
353
742
|
value: e.value,
|
|
354
743
|
disabled: e.disabled,
|
|
355
744
|
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
745
|
}, {
|
|
357
|
-
default:
|
|
746
|
+
default: M(() => [w(t.$slots, "default")]),
|
|
358
747
|
_: 3
|
|
359
748
|
}, 8, ["value", "disabled"]));
|
|
360
749
|
}
|
|
361
|
-
}),
|
|
750
|
+
}), _n = /* @__PURE__ */ p({
|
|
362
751
|
__name: "TabsContent",
|
|
363
752
|
props: {
|
|
364
753
|
value: {},
|
|
@@ -368,15 +757,15 @@ var q = /* @__PURE__ */ p({
|
|
|
368
757
|
}
|
|
369
758
|
},
|
|
370
759
|
setup(e) {
|
|
371
|
-
return (t, n) => (
|
|
760
|
+
return (t, n) => (b(), s(D(We), {
|
|
372
761
|
value: e.value,
|
|
373
|
-
class:
|
|
762
|
+
class: g(["focus-visible:outline-none", e.padding ? "pt-4" : ""])
|
|
374
763
|
}, {
|
|
375
|
-
default:
|
|
764
|
+
default: M(() => [w(t.$slots, "default")]),
|
|
376
765
|
_: 3
|
|
377
766
|
}, 8, ["value", "class"]));
|
|
378
767
|
}
|
|
379
|
-
}),
|
|
768
|
+
}), vn = { class: "truncate" }, yn = { class: "ms-auto flex shrink-0 items-center gap-1" }, bn = /* @__PURE__ */ p({
|
|
380
769
|
__name: "Select",
|
|
381
770
|
props: {
|
|
382
771
|
modelValue: {},
|
|
@@ -392,18 +781,18 @@ var q = /* @__PURE__ */ p({
|
|
|
392
781
|
},
|
|
393
782
|
emits: ["update:modelValue"],
|
|
394
783
|
setup(e, { emit: t }) {
|
|
395
|
-
let n = e, r = t, i =
|
|
784
|
+
let n = e, r = t, i = S(!1);
|
|
396
785
|
function p(e) {
|
|
397
786
|
return e && typeof e == "object" && n.optionValue ? e[n.optionValue] ?? e : e;
|
|
398
787
|
}
|
|
399
|
-
function
|
|
788
|
+
function m(e) {
|
|
400
789
|
return e && typeof e == "object" && n.optionLabel ? String(e[n.optionLabel] ?? "") : e == null ? "" : String(e);
|
|
401
790
|
}
|
|
402
|
-
let g = o(() => n.multiple ? (Array.isArray(n.modelValue) ? n.modelValue : []).map((e) =>
|
|
791
|
+
let g = o(() => n.multiple ? (Array.isArray(n.modelValue) ? n.modelValue : []).map((e) => m(n.options?.find((t) => p(t) === e))).filter(Boolean).join(", ") : n.modelValue == null ? "" : m(n.options?.find((e) => p(e) === n.modelValue))), _ = o(() => n.multiple && Array.isArray(n.modelValue) ? n.modelValue.length > 0 : n.modelValue != null);
|
|
403
792
|
function v() {
|
|
404
793
|
r("update:modelValue", n.multiple ? [] : null);
|
|
405
794
|
}
|
|
406
|
-
return (t, n) => (
|
|
795
|
+
return (t, n) => (b(), s(D(Ve), {
|
|
407
796
|
open: i.value,
|
|
408
797
|
"onUpdate:open": n[0] ||= (e) => i.value = e,
|
|
409
798
|
"model-value": e.modelValue,
|
|
@@ -411,34 +800,34 @@ var q = /* @__PURE__ */ p({
|
|
|
411
800
|
disabled: e.disabled,
|
|
412
801
|
"onUpdate:modelValue": n[1] ||= (e) => r("update:modelValue", e)
|
|
413
802
|
}, {
|
|
414
|
-
default:
|
|
415
|
-
default:
|
|
416
|
-
default:
|
|
803
|
+
default: M(() => [f(D(He), h({ class: D(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", e.invalid ? "border-error-500 focus-visible:ring-error-500" : "", t.$attrs.class || "") }, t.$attrs), {
|
|
804
|
+
default: M(() => [f(D(Ue), { placeholder: e.placeholder }, {
|
|
805
|
+
default: M(() => [u("span", vn, E(g.value || e.placeholder), 1)]),
|
|
417
806
|
_: 1
|
|
418
|
-
}, 8, ["placeholder"]), u("span",
|
|
807
|
+
}, 8, ["placeholder"]), u("span", yn, [e.clearable && _.value ? (b(), l("button", {
|
|
419
808
|
key: 0,
|
|
420
809
|
type: "button",
|
|
421
810
|
"aria-label": "Clear selection",
|
|
422
811
|
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(
|
|
812
|
+
onClick: P(v, ["stop"])
|
|
813
|
+
}, [f(D(z), { class: "size-3.5" })])) : c("", !0), f(D(I), { class: "size-4 opacity-50" })])]),
|
|
425
814
|
_: 1
|
|
426
|
-
}, 16, ["class"]), i.value ? (
|
|
815
|
+
}, 16, ["class"]), i.value ? (b(), s(D(Le), {
|
|
427
816
|
key: 0,
|
|
428
817
|
position: "popper",
|
|
429
818
|
"side-offset": 4,
|
|
430
819
|
class: "z-50 min-w-[--reka-select-trigger-width] rounded-md border border-border bg-surface p-1 shadow-popover"
|
|
431
820
|
}, {
|
|
432
|
-
default:
|
|
821
|
+
default: M(() => [(b(!0), l(a, null, C(e.options, (e) => (b(), s(D(Re), {
|
|
433
822
|
key: String(p(e)),
|
|
434
823
|
value: p(e),
|
|
435
|
-
class: "relative flex cursor-pointer select-none items-center rounded px-2 py-1.5
|
|
824
|
+
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
825
|
}, {
|
|
437
|
-
default:
|
|
438
|
-
default:
|
|
826
|
+
default: M(() => [f(D(Be), null, {
|
|
827
|
+
default: M(() => [d(E(m(e)), 1)]),
|
|
439
828
|
_: 2
|
|
440
|
-
}, 1024), f(
|
|
441
|
-
default:
|
|
829
|
+
}, 1024), f(D(ze), { class: "absolute end-2 flex items-center justify-center text-primary-600" }, {
|
|
830
|
+
default: M(() => [f(D(F), { class: "size-4" })]),
|
|
442
831
|
_: 1
|
|
443
832
|
})]),
|
|
444
833
|
_: 2
|
|
@@ -453,7 +842,7 @@ var q = /* @__PURE__ */ p({
|
|
|
453
842
|
"disabled"
|
|
454
843
|
]));
|
|
455
844
|
}
|
|
456
|
-
}),
|
|
845
|
+
}), xn = /* @__PURE__ */ p({
|
|
457
846
|
__name: "SelectButton",
|
|
458
847
|
props: {
|
|
459
848
|
modelValue: {},
|
|
@@ -464,7 +853,7 @@ var q = /* @__PURE__ */ p({
|
|
|
464
853
|
},
|
|
465
854
|
emits: ["update:modelValue"],
|
|
466
855
|
setup(e, { emit: t }) {
|
|
467
|
-
let n = e, r = t, i =
|
|
856
|
+
let n = e, r = t, i = S(null), o = S({
|
|
468
857
|
left: 0,
|
|
469
858
|
top: 0,
|
|
470
859
|
width: 0,
|
|
@@ -491,15 +880,15 @@ var q = /* @__PURE__ */ p({
|
|
|
491
880
|
ready: !0
|
|
492
881
|
};
|
|
493
882
|
}
|
|
494
|
-
function
|
|
883
|
+
function g() {
|
|
495
884
|
cancelAnimationFrame(c), c = requestAnimationFrame(h);
|
|
496
885
|
}
|
|
497
|
-
let
|
|
498
|
-
return
|
|
499
|
-
|
|
500
|
-
}),
|
|
501
|
-
cancelAnimationFrame(c),
|
|
502
|
-
}),
|
|
886
|
+
let x;
|
|
887
|
+
return y(() => {
|
|
888
|
+
g(), typeof ResizeObserver < "u" && i.value?.$el && (x = new ResizeObserver(g), x.observe(i.value.$el)), window.addEventListener("resize", g);
|
|
889
|
+
}), v(() => {
|
|
890
|
+
cancelAnimationFrame(c), x?.disconnect(), window.removeEventListener("resize", g);
|
|
891
|
+
}), j(() => n.modelValue, g), j(() => n.options, g, { deep: !0 }), (t, n) => (b(), s(D(Ie), {
|
|
503
892
|
ref_key: "rootEl",
|
|
504
893
|
ref: i,
|
|
505
894
|
"model-value": e.modelValue,
|
|
@@ -507,192 +896,355 @@ var q = /* @__PURE__ */ p({
|
|
|
507
896
|
class: "relative inline-flex flex-wrap items-center gap-1 rounded-md border border-border bg-surface p-1",
|
|
508
897
|
"onUpdate:modelValue": n[0] ||= (e) => r("update:modelValue", e)
|
|
509
898
|
}, {
|
|
510
|
-
default:
|
|
899
|
+
default: M(() => [N(u("span", {
|
|
511
900
|
"aria-hidden": "true",
|
|
512
901
|
class: "pointer-events-none absolute rounded bg-primary-500 transition-all duration-200 ease-out motion-reduce:transition-none",
|
|
513
|
-
style:
|
|
902
|
+
style: _({
|
|
514
903
|
left: `${o.value.left}px`,
|
|
515
904
|
top: `${o.value.top}px`,
|
|
516
905
|
width: `${o.value.width}px`,
|
|
517
906
|
height: `${o.value.height}px`
|
|
518
907
|
})
|
|
519
|
-
}, null, 4), [[
|
|
908
|
+
}, null, 4), [[te, o.value.ready]]), (b(!0), l(a, null, C(e.options, (t) => (b(), s(D(Fe), {
|
|
520
909
|
key: String(p(t)),
|
|
521
910
|
value: p(t),
|
|
522
911
|
disabled: e.disabled,
|
|
523
912
|
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
913
|
}, {
|
|
525
|
-
default:
|
|
914
|
+
default: M(() => [f(D(Pe), { class: "hidden" }), d(" " + E(m(t)), 1)]),
|
|
526
915
|
_: 2
|
|
527
916
|
}, 1032, ["value", "disabled"]))), 128))]),
|
|
528
917
|
_: 1
|
|
529
918
|
}, 8, ["model-value", "disabled"]));
|
|
530
919
|
}
|
|
531
|
-
}),
|
|
920
|
+
}), Sn = ["id", "disabled"], Cn = { class: "flex items-center justify-between" }, wn = ["aria-label"], Tn = {
|
|
921
|
+
"data-test": "month-label",
|
|
922
|
+
class: "text-sm font-medium"
|
|
923
|
+
}, En = ["aria-label"], Dn = {
|
|
924
|
+
"data-test": "weekdays",
|
|
925
|
+
class: "mt-2 grid grid-cols-7 gap-0.5 text-center text-xs"
|
|
926
|
+
}, On = { key: 0 }, kn = ["onClick"], An = {
|
|
532
927
|
key: 0,
|
|
533
928
|
class: "mt-3 flex items-center justify-between gap-2 border-t border-border pt-3"
|
|
534
|
-
},
|
|
929
|
+
}, jn = ["aria-label"], Mn = ["aria-label"], Nn = ["value"], Pn = ["aria-label"], Fn = ["value"], In = ["aria-label"], Ln = { value: "am" }, Rn = { value: "pm" }, zn = { class: "flex items-center gap-2" }, Bn = ["disabled"], Vn = {
|
|
535
930
|
key: 1,
|
|
536
931
|
class: "mt-3 flex justify-end border-t border-border pt-3"
|
|
537
|
-
},
|
|
932
|
+
}, Hn = /* @__PURE__ */ p({
|
|
538
933
|
__name: "DatePicker",
|
|
539
934
|
props: {
|
|
540
935
|
mode: { default: "date" },
|
|
541
936
|
modelValue: {},
|
|
542
|
-
placeholder: {
|
|
937
|
+
placeholder: {},
|
|
543
938
|
disabled: { type: Boolean },
|
|
544
939
|
invalid: { type: Boolean },
|
|
545
940
|
size: { default: "default" },
|
|
546
|
-
inputId: {}
|
|
941
|
+
inputId: {},
|
|
942
|
+
hourFormat: { default: "24" },
|
|
943
|
+
minuteStep: { default: 1 },
|
|
944
|
+
locale: { default: () => {
|
|
945
|
+
try {
|
|
946
|
+
return Intl.DateTimeFormat().resolvedOptions().locale || "en";
|
|
947
|
+
} catch {
|
|
948
|
+
return "en";
|
|
949
|
+
}
|
|
950
|
+
} },
|
|
951
|
+
labels: {},
|
|
952
|
+
weekStartsOn: {},
|
|
953
|
+
defaultOpen: {
|
|
954
|
+
type: Boolean,
|
|
955
|
+
default: !1
|
|
956
|
+
}
|
|
547
957
|
},
|
|
548
958
|
emits: ["update:modelValue"],
|
|
549
959
|
setup(e, { emit: t }) {
|
|
550
|
-
let n =
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
960
|
+
let n = {
|
|
961
|
+
en: {
|
|
962
|
+
placeholder: "Select date",
|
|
963
|
+
previousMonth: "Previous month",
|
|
964
|
+
nextMonth: "Next month",
|
|
965
|
+
clear: "Clear",
|
|
966
|
+
apply: "Apply",
|
|
967
|
+
today: "Today",
|
|
968
|
+
time: "Time",
|
|
969
|
+
hour: "Hour",
|
|
970
|
+
minute: "Minute",
|
|
971
|
+
am: "AM",
|
|
972
|
+
pm: "PM"
|
|
973
|
+
},
|
|
974
|
+
fr: {
|
|
975
|
+
placeholder: "Choisir une date",
|
|
976
|
+
previousMonth: "Mois précédent",
|
|
977
|
+
nextMonth: "Mois suivant",
|
|
978
|
+
clear: "Effacer",
|
|
979
|
+
apply: "Appliquer",
|
|
980
|
+
today: "Aujourd'hui",
|
|
981
|
+
time: "Heure",
|
|
982
|
+
hour: "Heure",
|
|
983
|
+
minute: "Minute",
|
|
984
|
+
am: "AM",
|
|
985
|
+
pm: "PM"
|
|
986
|
+
},
|
|
987
|
+
es: {
|
|
988
|
+
placeholder: "Seleccionar fecha",
|
|
989
|
+
previousMonth: "Mes anterior",
|
|
990
|
+
nextMonth: "Mes siguiente",
|
|
991
|
+
clear: "Borrar",
|
|
992
|
+
apply: "Aplicar",
|
|
993
|
+
today: "Hoy",
|
|
994
|
+
time: "Hora",
|
|
995
|
+
hour: "Hora",
|
|
996
|
+
minute: "Minuto",
|
|
997
|
+
am: "AM",
|
|
998
|
+
pm: "PM"
|
|
999
|
+
},
|
|
1000
|
+
de: {
|
|
1001
|
+
placeholder: "Datum wählen",
|
|
1002
|
+
previousMonth: "Vorheriger Monat",
|
|
1003
|
+
nextMonth: "Nächster Monat",
|
|
1004
|
+
clear: "Löschen",
|
|
1005
|
+
apply: "Übernehmen",
|
|
1006
|
+
today: "Heute",
|
|
1007
|
+
time: "Uhrzeit",
|
|
1008
|
+
hour: "Stunde",
|
|
1009
|
+
minute: "Minute",
|
|
1010
|
+
am: "AM",
|
|
1011
|
+
pm: "PM"
|
|
1012
|
+
},
|
|
1013
|
+
ar: {
|
|
1014
|
+
placeholder: "اختر التاريخ",
|
|
1015
|
+
previousMonth: "الشهر السابق",
|
|
1016
|
+
nextMonth: "الشهر التالي",
|
|
1017
|
+
clear: "مسح",
|
|
1018
|
+
apply: "تطبيق",
|
|
1019
|
+
today: "اليوم",
|
|
1020
|
+
time: "الوقت",
|
|
1021
|
+
hour: "الساعة",
|
|
1022
|
+
minute: "الدقيقة",
|
|
1023
|
+
am: "ص",
|
|
1024
|
+
pm: "م"
|
|
1025
|
+
}
|
|
1026
|
+
};
|
|
1027
|
+
function r(e) {
|
|
1028
|
+
let t = e.toLowerCase().split(/[-_]/)[0];
|
|
1029
|
+
return n[t] ?? n.en;
|
|
1030
|
+
}
|
|
1031
|
+
let i = e, d = t, p = ee(), m = S(i.defaultOpen ?? !1), h = S(/* @__PURE__ */ new Date()), _ = S(null), v = S(null), y = S("09:00"), x = o(() => i.locale || "en"), w = o(() => ({
|
|
1032
|
+
...r(x.value),
|
|
1033
|
+
...i.placeholder === void 0 ? {} : { placeholder: i.placeholder },
|
|
1034
|
+
...i.labels
|
|
1035
|
+
}));
|
|
1036
|
+
function T(e) {
|
|
1037
|
+
if (e == null || typeof e == "boolean") return "";
|
|
1038
|
+
if (typeof e == "string" || typeof e == "number") return String(e);
|
|
1039
|
+
if (Array.isArray(e)) return e.map(T).join("");
|
|
1040
|
+
let t = e;
|
|
1041
|
+
return typeof t.children == "string" ? t.children : Array.isArray(t.children) ? t.children.map(T).join("") : "";
|
|
1042
|
+
}
|
|
1043
|
+
function O(e) {
|
|
1044
|
+
let t = p[`label-${e}`];
|
|
1045
|
+
if (t) {
|
|
1046
|
+
let e = t().map(T).join("").trim();
|
|
1047
|
+
if (e) return e;
|
|
1048
|
+
}
|
|
1049
|
+
return w.value[e];
|
|
1050
|
+
}
|
|
1051
|
+
let A = o(() => i.weekStartsOn ?? St(x.value)), te = o(() => Ct(x.value, A.value)), P = o(() => wt(h.value, x.value));
|
|
1052
|
+
j(() => i.modelValue, (e) => {
|
|
1053
|
+
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
1054
|
}, { immediate: !0 });
|
|
562
|
-
let
|
|
563
|
-
let e = (new Date(
|
|
564
|
-
for (let e = 1; e <= n; e++) t.push(new Date(
|
|
1055
|
+
let ne = o(() => {
|
|
1056
|
+
let e = (new Date(h.value.getFullYear(), h.value.getMonth(), 1).getDay() - A.value + 7) % 7, t = Array.from({ length: e }, () => null), n = new Date(h.value.getFullYear(), h.value.getMonth() + 1, 0).getDate();
|
|
1057
|
+
for (let e = 1; e <= n; e++) t.push(new Date(h.value.getFullYear(), h.value.getMonth(), e));
|
|
565
1058
|
return t;
|
|
566
1059
|
});
|
|
567
|
-
function
|
|
568
|
-
if (!
|
|
569
|
-
let [t, n] = G(
|
|
1060
|
+
function F(e) {
|
|
1061
|
+
if (!_.value || !v.value) return !1;
|
|
1062
|
+
let [t, n] = G(_.value, v.value);
|
|
570
1063
|
return e.getTime() >= t.getTime() && e.getTime() <= n.getTime();
|
|
571
1064
|
}
|
|
572
|
-
function
|
|
573
|
-
|
|
574
|
-
month: "long",
|
|
575
|
-
year: "numeric"
|
|
576
|
-
});
|
|
577
|
-
}
|
|
578
|
-
function E(e) {
|
|
579
|
-
d.value = new Date(d.value.getFullYear(), d.value.getMonth() + e, 1);
|
|
1065
|
+
function I(e) {
|
|
1066
|
+
h.value = new Date(h.value.getFullYear(), h.value.getMonth() + e, 1);
|
|
580
1067
|
}
|
|
581
|
-
function
|
|
582
|
-
return
|
|
1068
|
+
function ae() {
|
|
1069
|
+
return i.mode === "range" ? !!(_.value && v.value) : !!_.value;
|
|
583
1070
|
}
|
|
584
|
-
function
|
|
585
|
-
if (
|
|
586
|
-
if (!
|
|
1071
|
+
function oe(e) {
|
|
1072
|
+
if (i.mode === "range") {
|
|
1073
|
+
if (!_.value || v.value) _.value = e, v.value = null;
|
|
587
1074
|
else {
|
|
588
|
-
let [t, n] = G(
|
|
589
|
-
|
|
1075
|
+
let [t, n] = G(_.value, e);
|
|
1076
|
+
_.value = t, v.value = n;
|
|
590
1077
|
}
|
|
591
1078
|
return;
|
|
592
1079
|
}
|
|
593
|
-
|
|
1080
|
+
_.value = e, i.mode !== "datetime" && (se(), m.value = !1);
|
|
594
1081
|
}
|
|
595
|
-
function
|
|
596
|
-
if (
|
|
597
|
-
if (
|
|
598
|
-
if (!
|
|
599
|
-
|
|
600
|
-
} else
|
|
1082
|
+
function se() {
|
|
1083
|
+
if (_.value) {
|
|
1084
|
+
if (i.mode === "range") {
|
|
1085
|
+
if (!v.value) return;
|
|
1086
|
+
d("update:modelValue", [_.value, v.value]);
|
|
1087
|
+
} else i.mode === "datetime" ? d("update:modelValue", _t(_.value, y.value)) : d("update:modelValue", _.value);
|
|
601
1088
|
}
|
|
602
1089
|
}
|
|
603
|
-
function
|
|
604
|
-
|
|
1090
|
+
function ce() {
|
|
1091
|
+
_.value = null, v.value = null, d("update:modelValue", null), m.value = !1;
|
|
605
1092
|
}
|
|
606
|
-
let
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
1093
|
+
let R = o(() => {
|
|
1094
|
+
let [e, t] = y.value.split(":").map(Number);
|
|
1095
|
+
return {
|
|
1096
|
+
hour24: Number.isFinite(e) ? (Math.trunc(e) % 24 + 24) % 24 : 0,
|
|
1097
|
+
minute: Number.isFinite(t) ? (Math.trunc(t) % 60 + 60) % 60 : 0
|
|
1098
|
+
};
|
|
1099
|
+
}), ue = o(() => yt(i.hourFormat)), de = o(() => bt(Math.min(30, Math.max(1, i.minuteStep ?? 1)))), fe = o({
|
|
1100
|
+
get: () => i.hourFormat === "12" ? K(R.value.hour24).hour : R.value.hour24,
|
|
1101
|
+
set: (e) => {
|
|
1102
|
+
let { hour24: t, minute: n } = R.value, r = i.hourFormat === "12" ? xt(e, K(t).meridiem) : e;
|
|
1103
|
+
y.value = W(r * 60 + n);
|
|
1104
|
+
}
|
|
1105
|
+
}), pe = o({
|
|
1106
|
+
get: () => R.value.minute,
|
|
1107
|
+
set: (e) => {
|
|
1108
|
+
y.value = W(R.value.hour24 * 60 + e);
|
|
1109
|
+
}
|
|
1110
|
+
}), z = o({
|
|
1111
|
+
get: () => K(R.value.hour24).meridiem,
|
|
1112
|
+
set: (e) => {
|
|
1113
|
+
let { hour: t } = K(R.value.hour24);
|
|
1114
|
+
y.value = W(xt(t, e) * 60 + R.value.minute);
|
|
611
1115
|
}
|
|
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
1116
|
});
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
1117
|
+
function B(e) {
|
|
1118
|
+
return String(e).padStart(2, "0");
|
|
1119
|
+
}
|
|
1120
|
+
let V = o(() => {
|
|
1121
|
+
if (i.mode === "range") {
|
|
1122
|
+
if (!_.value || !v.value) return "";
|
|
1123
|
+
let [e, t] = G(_.value, v.value);
|
|
1124
|
+
return `${q(e, x.value)} – ${q(t, x.value)}`;
|
|
1125
|
+
}
|
|
1126
|
+
if (!_.value) return "";
|
|
1127
|
+
let e = i.mode === "datetime" ? _t(_.value, y.value) : _.value;
|
|
1128
|
+
return i.mode === "datetime" ? `${q(e, x.value)} ${Tt(e, x.value, i.hourFormat)}` : q(e, x.value);
|
|
1129
|
+
});
|
|
1130
|
+
return (t, n) => (b(), s(D(Me), {
|
|
1131
|
+
open: m.value,
|
|
1132
|
+
"onUpdate:open": n[6] ||= (e) => m.value = e
|
|
619
1133
|
}, {
|
|
620
|
-
default:
|
|
621
|
-
default:
|
|
1134
|
+
default: M(() => [f(D(Ne), { "as-child": "" }, {
|
|
1135
|
+
default: M(() => [u("button", {
|
|
622
1136
|
type: "button",
|
|
623
1137
|
id: e.inputId,
|
|
624
1138
|
disabled: e.disabled,
|
|
625
|
-
class:
|
|
1139
|
+
class: g([
|
|
626
1140
|
"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
1141
|
e.size === "sm" ? "h-8 text-xs" : "h-9",
|
|
628
1142
|
e.invalid ? "border-error-500" : ""
|
|
629
1143
|
])
|
|
630
|
-
}, [u("span", { class:
|
|
1144
|
+
}, [u("span", { class: g(["truncate", V.value ? "text-foreground" : "text-muted"]) }, E(V.value || O("placeholder")), 3), f(D(re), { class: "size-4 shrink-0 text-muted" })], 10, Sn)]),
|
|
631
1145
|
_: 1
|
|
632
|
-
}), f(
|
|
1146
|
+
}), f(D(je), {
|
|
633
1147
|
"side-offset": 4,
|
|
634
1148
|
class: "z-50 rounded-md border border-border bg-surface p-3 shadow-popover"
|
|
635
1149
|
}, {
|
|
636
|
-
default:
|
|
637
|
-
u("div",
|
|
1150
|
+
default: M(() => [
|
|
1151
|
+
u("div", Cn, [
|
|
638
1152
|
u("button", {
|
|
639
1153
|
type: "button",
|
|
640
|
-
"aria-label": "
|
|
1154
|
+
"aria-label": O("previousMonth"),
|
|
641
1155
|
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",
|
|
1156
|
+
onClick: n[0] ||= (e) => I(-1)
|
|
1157
|
+
}, [f(D(ie), { class: "size-4 rtl:rotate-180" })], 8, wn),
|
|
1158
|
+
u("span", Tn, E(P.value), 1),
|
|
645
1159
|
u("button", {
|
|
646
1160
|
type: "button",
|
|
647
|
-
"aria-label": "
|
|
1161
|
+
"aria-label": O("nextMonth"),
|
|
648
1162
|
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(
|
|
1163
|
+
onClick: n[1] ||= (e) => I(1)
|
|
1164
|
+
}, [f(D(L), { class: "size-4 rtl:rotate-180" })], 8, En)
|
|
651
1165
|
]),
|
|
652
|
-
u("div",
|
|
653
|
-
key:
|
|
1166
|
+
u("div", Dn, [(b(!0), l(a, null, C(te.value, (e, t) => (b(), l("span", {
|
|
1167
|
+
key: t,
|
|
654
1168
|
class: "py-1 font-medium text-muted"
|
|
655
|
-
},
|
|
1169
|
+
}, E(e), 1))), 128)), (b(!0), l(a, null, C(ne.value, (e, t) => (b(), l(a, { key: t }, [e ? (b(), l("button", {
|
|
656
1170
|
key: 1,
|
|
657
1171
|
type: "button",
|
|
658
|
-
class:
|
|
1172
|
+
class: g([
|
|
659
1173
|
"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
|
-
|
|
1174
|
+
F(e) ? "bg-primary-100 text-primary-800 dark:bg-primary-900/40 dark:text-primary-200" : "hover:bg-surface-muted",
|
|
1175
|
+
_.value && _.value.getTime() === e.getTime() ? "bg-primary-500 text-white hover:bg-primary-500" : "",
|
|
1176
|
+
v.value && v.value.getTime() === e.getTime() ? "bg-primary-500 text-white hover:bg-primary-500" : ""
|
|
663
1177
|
]),
|
|
664
|
-
onClick: (t) =>
|
|
665
|
-
},
|
|
666
|
-
e.mode === "datetime" ? (
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
class: "
|
|
670
|
-
},
|
|
1178
|
+
onClick: (t) => oe(e)
|
|
1179
|
+
}, E(e.getDate()), 11, kn)) : (b(), l("span", On))], 64))), 128))]),
|
|
1180
|
+
e.mode === "datetime" ? (b(), l("div", An, [u("div", {
|
|
1181
|
+
role: "group",
|
|
1182
|
+
"aria-label": O("time"),
|
|
1183
|
+
class: "flex items-center gap-1.5 text-xs text-muted"
|
|
1184
|
+
}, [
|
|
1185
|
+
f(D(le), { class: "size-3.5" }),
|
|
1186
|
+
N(u("select", {
|
|
1187
|
+
"onUpdate:modelValue": n[2] ||= (e) => fe.value = e,
|
|
1188
|
+
"data-test": "hours",
|
|
1189
|
+
"aria-label": O("hour"),
|
|
1190
|
+
class: "rounded border border-border bg-surface px-1.5 py-1 text-sm text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500"
|
|
1191
|
+
}, [(b(!0), l(a, null, C(ue.value, (t) => (b(), l("option", {
|
|
1192
|
+
key: t,
|
|
1193
|
+
value: t
|
|
1194
|
+
}, E(e.hourFormat === "12" ? t : B(t)), 9, Nn))), 128))], 8, Mn), [[
|
|
1195
|
+
k,
|
|
1196
|
+
fe.value,
|
|
1197
|
+
void 0,
|
|
1198
|
+
{ number: !0 }
|
|
1199
|
+
]]),
|
|
1200
|
+
n[7] ||= u("span", { "aria-hidden": "true" }, ":", -1),
|
|
1201
|
+
N(u("select", {
|
|
1202
|
+
"onUpdate:modelValue": n[3] ||= (e) => pe.value = e,
|
|
1203
|
+
"data-test": "minutes",
|
|
1204
|
+
"aria-label": O("minute"),
|
|
1205
|
+
class: "rounded border border-border bg-surface px-1.5 py-1 text-sm text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500"
|
|
1206
|
+
}, [(b(!0), l(a, null, C(de.value, (e) => (b(), l("option", {
|
|
1207
|
+
key: e,
|
|
1208
|
+
value: e
|
|
1209
|
+
}, E(B(e)), 9, Fn))), 128))], 8, Pn), [[
|
|
1210
|
+
k,
|
|
1211
|
+
pe.value,
|
|
1212
|
+
void 0,
|
|
1213
|
+
{ number: !0 }
|
|
1214
|
+
]]),
|
|
1215
|
+
e.hourFormat === "12" ? N((b(), l("select", {
|
|
1216
|
+
key: 0,
|
|
1217
|
+
"onUpdate:modelValue": n[4] ||= (e) => z.value = e,
|
|
1218
|
+
"data-test": "meridiem",
|
|
1219
|
+
"aria-label": O("time"),
|
|
1220
|
+
class: "rounded border border-border bg-surface px-1.5 py-1 text-sm text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500"
|
|
1221
|
+
}, [u("option", Ln, E(O("am")), 1), u("option", Rn, E(O("pm")), 1)], 8, In)), [[k, z.value]]) : c("", !0)
|
|
1222
|
+
], 8, jn), u("div", zn, [u("button", {
|
|
671
1223
|
type: "button",
|
|
672
1224
|
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
|
-
}, "
|
|
1225
|
+
onClick: ce
|
|
1226
|
+
}, E(O("clear")), 1), u("button", {
|
|
675
1227
|
type: "button",
|
|
676
|
-
disabled: !
|
|
1228
|
+
disabled: !_.value,
|
|
677
1229
|
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
|
-
|
|
1230
|
+
onClick: n[5] ||= (e) => {
|
|
1231
|
+
se(), m.value = !1;
|
|
680
1232
|
}
|
|
681
|
-
}, "
|
|
1233
|
+
}, E(O("apply")), 9, Bn)])])) : ae() ? (b(), l("div", Vn, [u("button", {
|
|
682
1234
|
type: "button",
|
|
683
1235
|
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
|
-
}, "
|
|
1236
|
+
onClick: ce
|
|
1237
|
+
}, E(O("clear")), 1)])) : c("", !0)
|
|
686
1238
|
]),
|
|
687
1239
|
_: 1
|
|
688
1240
|
})]),
|
|
689
1241
|
_: 1
|
|
690
1242
|
}, 8, ["open"]));
|
|
691
1243
|
}
|
|
692
|
-
}),
|
|
1244
|
+
}), Un = { class: "flex items-start justify-between gap-4 border-b border-border p-5 pb-4" }, Wn = { class: "min-w-0" }, Gn = { class: "overflow-y-auto bg-surface p-5" }, Kn = {
|
|
693
1245
|
key: 0,
|
|
694
1246
|
class: "flex justify-end gap-2 border-t border-border bg-surface-muted p-4"
|
|
695
|
-
},
|
|
1247
|
+
}, qn = /* @__PURE__ */ p({
|
|
696
1248
|
__name: "Dialog",
|
|
697
1249
|
props: {
|
|
698
1250
|
visible: { type: Boolean },
|
|
@@ -714,40 +1266,40 @@ var q = /* @__PURE__ */ p({
|
|
|
714
1266
|
function p(e) {
|
|
715
1267
|
r("update:visible", e), e || r("close");
|
|
716
1268
|
}
|
|
717
|
-
return (t, n) => (
|
|
1269
|
+
return (t, n) => (b(), s(D(be), {
|
|
718
1270
|
open: i.value,
|
|
719
1271
|
"onUpdate:open": p
|
|
720
1272
|
}, {
|
|
721
|
-
default:
|
|
1273
|
+
default: M(() => [t.$slots.trigger ? (b(), s(D(xe), {
|
|
722
1274
|
key: 0,
|
|
723
1275
|
"as-child": ""
|
|
724
1276
|
}, {
|
|
725
|
-
default:
|
|
1277
|
+
default: M(() => [w(t.$slots, "trigger")]),
|
|
726
1278
|
_: 3
|
|
727
|
-
})) : c("", !0), f(
|
|
728
|
-
default:
|
|
729
|
-
default:
|
|
730
|
-
u("div",
|
|
1279
|
+
})) : c("", !0), f(D(ye), null, {
|
|
1280
|
+
default: M(() => [f(D(ve), { class: "fixed inset-0 z-50 bg-black/50 dark:bg-black/70" }), f(D(ge), { 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]]) }, {
|
|
1281
|
+
default: M(() => [
|
|
1282
|
+
u("div", Un, [u("div", Wn, [e.title || t.$slots.header ? (b(), s(D(H), {
|
|
731
1283
|
key: 0,
|
|
732
1284
|
class: "text-lg font-semibold text-foreground"
|
|
733
1285
|
}, {
|
|
734
|
-
default:
|
|
1286
|
+
default: M(() => [w(t.$slots, "header", {}, () => [d(E(e.title), 1)])]),
|
|
735
1287
|
_: 3
|
|
736
|
-
})) : c("", !0), e.description || t.$slots.description ? (
|
|
1288
|
+
})) : c("", !0), e.description || t.$slots.description ? (b(), s(D(_e), {
|
|
737
1289
|
key: 1,
|
|
738
1290
|
class: "mt-1 text-sm text-muted"
|
|
739
1291
|
}, {
|
|
740
|
-
default:
|
|
1292
|
+
default: M(() => [w(t.$slots, "description", {}, () => [d(E(e.description), 1)])]),
|
|
741
1293
|
_: 3
|
|
742
|
-
})) : c("", !0)]), f(
|
|
1294
|
+
})) : c("", !0)]), f(D(he), {
|
|
743
1295
|
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
1296
|
"aria-label": "Close"
|
|
745
1297
|
}, {
|
|
746
|
-
default:
|
|
1298
|
+
default: M(() => [f(D(z), { class: "size-4" })]),
|
|
747
1299
|
_: 1
|
|
748
1300
|
})]),
|
|
749
|
-
u("div",
|
|
750
|
-
t.$slots.footer ? (
|
|
1301
|
+
u("div", Gn, [w(t.$slots, "default")]),
|
|
1302
|
+
t.$slots.footer ? (b(), l("div", Kn, [w(t.$slots, "footer")])) : c("", !0)
|
|
751
1303
|
]),
|
|
752
1304
|
_: 3
|
|
753
1305
|
}, 8, ["class"])]),
|
|
@@ -756,28 +1308,164 @@ var q = /* @__PURE__ */ p({
|
|
|
756
1308
|
_: 3
|
|
757
1309
|
}, 8, ["open"]));
|
|
758
1310
|
}
|
|
759
|
-
}),
|
|
1311
|
+
}), Jn = {
|
|
1312
|
+
key: 1,
|
|
1313
|
+
class: "flex shrink-0 items-start justify-between gap-4 border-b border-border p-5 pb-4"
|
|
1314
|
+
}, Yn = { class: "min-w-0" }, Xn = { class: "flex-1 overflow-y-auto p-5" }, Zn = {
|
|
1315
|
+
key: 2,
|
|
1316
|
+
class: "shrink-0 border-t border-border bg-surface-muted p-4"
|
|
1317
|
+
}, Qn = /* @__PURE__ */ p({
|
|
1318
|
+
__name: "Drawer",
|
|
1319
|
+
props: {
|
|
1320
|
+
open: {
|
|
1321
|
+
type: Boolean,
|
|
1322
|
+
default: !1
|
|
1323
|
+
},
|
|
1324
|
+
position: { default: "right" },
|
|
1325
|
+
size: { default: "md" },
|
|
1326
|
+
backdrop: {
|
|
1327
|
+
type: Boolean,
|
|
1328
|
+
default: !0
|
|
1329
|
+
},
|
|
1330
|
+
closeOnEscape: {
|
|
1331
|
+
type: Boolean,
|
|
1332
|
+
default: !0
|
|
1333
|
+
},
|
|
1334
|
+
closeOnOutside: {
|
|
1335
|
+
type: Boolean,
|
|
1336
|
+
default: !0
|
|
1337
|
+
},
|
|
1338
|
+
title: {},
|
|
1339
|
+
description: {},
|
|
1340
|
+
showClose: {
|
|
1341
|
+
type: Boolean,
|
|
1342
|
+
default: !0
|
|
1343
|
+
},
|
|
1344
|
+
preventScroll: {
|
|
1345
|
+
type: Boolean,
|
|
1346
|
+
default: !0
|
|
1347
|
+
}
|
|
1348
|
+
},
|
|
1349
|
+
emits: [
|
|
1350
|
+
"update:open",
|
|
1351
|
+
"open",
|
|
1352
|
+
"close"
|
|
1353
|
+
],
|
|
1354
|
+
setup(e, { emit: t }) {
|
|
1355
|
+
let n = e, r = t, i = o({
|
|
1356
|
+
get: () => n.open,
|
|
1357
|
+
set: (e) => r("update:open", e)
|
|
1358
|
+
});
|
|
1359
|
+
function a(e) {
|
|
1360
|
+
r("update:open", e), r(e ? "open" : "close");
|
|
1361
|
+
}
|
|
1362
|
+
function p(e) {
|
|
1363
|
+
n.closeOnEscape || e.preventDefault();
|
|
1364
|
+
}
|
|
1365
|
+
function m(e) {
|
|
1366
|
+
n.closeOnOutside || e.preventDefault();
|
|
1367
|
+
}
|
|
1368
|
+
let h = {
|
|
1369
|
+
right: "inset-y-0 right-0 h-full w-full data-[state=closed]:translate-x-full data-[state=open]:translate-x-0",
|
|
1370
|
+
left: "inset-y-0 left-0 h-full w-full data-[state=closed]:-translate-x-full data-[state=open]:translate-x-0",
|
|
1371
|
+
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",
|
|
1372
|
+
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",
|
|
1373
|
+
top: "inset-x-0 top-0 w-full h-full data-[state=closed]:-translate-y-full data-[state=open]:translate-y-0",
|
|
1374
|
+
bottom: "inset-x-0 bottom-0 w-full h-full data-[state=closed]:translate-y-full data-[state=open]:translate-y-0"
|
|
1375
|
+
}, _ = {
|
|
1376
|
+
sm: "max-w-sm",
|
|
1377
|
+
md: "max-w-md",
|
|
1378
|
+
lg: "max-w-lg",
|
|
1379
|
+
full: "max-w-full"
|
|
1380
|
+
}, v = {
|
|
1381
|
+
sm: "max-h-64",
|
|
1382
|
+
md: "max-h-96",
|
|
1383
|
+
lg: "max-h-[32rem]",
|
|
1384
|
+
full: "max-h-full"
|
|
1385
|
+
}, y = o(() => n.position === "top" || n.position === "bottom"), x = o(() => y.value ? v[n.size] : _[n.size]);
|
|
1386
|
+
return (t, n) => (b(), s(D(be), {
|
|
1387
|
+
open: i.value,
|
|
1388
|
+
"onUpdate:open": a
|
|
1389
|
+
}, {
|
|
1390
|
+
default: M(() => [t.$slots.trigger ? (b(), s(D(xe), {
|
|
1391
|
+
key: 0,
|
|
1392
|
+
"as-child": ""
|
|
1393
|
+
}, {
|
|
1394
|
+
default: M(() => [w(t.$slots, "trigger")]),
|
|
1395
|
+
_: 3
|
|
1396
|
+
})) : c("", !0), f(D(ye), { "force-mount": i.value }, {
|
|
1397
|
+
default: M(() => [e.backdrop || e.preventScroll ? (b(), s(D(ve), {
|
|
1398
|
+
key: 0,
|
|
1399
|
+
class: g(["fixed inset-0 z-50", e.backdrop ? "bg-black/50 dark:bg-black/70" : "bg-transparent"])
|
|
1400
|
+
}, null, 8, ["class"])) : c("", !0), f(D(ge), {
|
|
1401
|
+
class: g([
|
|
1402
|
+
"fixed z-50 flex flex-col overflow-hidden border-border bg-surface shadow-dialog transition-transform duration-200 focus-visible:outline-none",
|
|
1403
|
+
h[e.position],
|
|
1404
|
+
x.value
|
|
1405
|
+
]),
|
|
1406
|
+
onEscapeKeyDown: p,
|
|
1407
|
+
onPointerDownOutside: m
|
|
1408
|
+
}, {
|
|
1409
|
+
default: M(() => [
|
|
1410
|
+
!e.title && !t.$slots.header ? (b(), s(D(rt), { key: 0 }, {
|
|
1411
|
+
default: M(() => [f(D(H), null, {
|
|
1412
|
+
default: M(() => [...n[0] ||= [d("Drawer", -1)]]),
|
|
1413
|
+
_: 1
|
|
1414
|
+
})]),
|
|
1415
|
+
_: 1
|
|
1416
|
+
})) : c("", !0),
|
|
1417
|
+
e.title || t.$slots.header || e.description || t.$slots.description || e.showClose ? (b(), l("header", Jn, [u("div", Yn, [e.title || t.$slots.header ? (b(), s(D(H), {
|
|
1418
|
+
key: 0,
|
|
1419
|
+
class: "text-lg font-semibold text-foreground"
|
|
1420
|
+
}, {
|
|
1421
|
+
default: M(() => [w(t.$slots, "header", {}, () => [d(E(e.title), 1)])]),
|
|
1422
|
+
_: 3
|
|
1423
|
+
})) : c("", !0), e.description || t.$slots.description ? (b(), s(D(_e), {
|
|
1424
|
+
key: 1,
|
|
1425
|
+
class: "mt-1 text-sm text-muted"
|
|
1426
|
+
}, {
|
|
1427
|
+
default: M(() => [w(t.$slots, "description", {}, () => [d(E(e.description), 1)])]),
|
|
1428
|
+
_: 3
|
|
1429
|
+
})) : c("", !0)]), e.showClose ? (b(), s(D(he), {
|
|
1430
|
+
key: 0,
|
|
1431
|
+
class: "ms-auto shrink-0 rounded-md p-1 text-muted transition-colors hover:bg-surface-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500",
|
|
1432
|
+
"aria-label": "Close"
|
|
1433
|
+
}, {
|
|
1434
|
+
default: M(() => [w(t.$slots, "close", {}, () => [f(D(z), { class: "size-4" })])]),
|
|
1435
|
+
_: 3
|
|
1436
|
+
})) : c("", !0)])) : c("", !0),
|
|
1437
|
+
u("div", Xn, [w(t.$slots, "default")]),
|
|
1438
|
+
t.$slots.footer ? (b(), l("footer", Zn, [w(t.$slots, "footer")])) : c("", !0)
|
|
1439
|
+
]),
|
|
1440
|
+
_: 3
|
|
1441
|
+
}, 8, ["class"])]),
|
|
1442
|
+
_: 3
|
|
1443
|
+
}, 8, ["force-mount"])]),
|
|
1444
|
+
_: 3
|
|
1445
|
+
}, 8, ["open"]));
|
|
1446
|
+
}
|
|
1447
|
+
}), $n = /* @__PURE__ */ p({
|
|
760
1448
|
__name: "DropdownMenu",
|
|
761
1449
|
emits: ["update:open"],
|
|
762
1450
|
setup(e, { emit: t }) {
|
|
763
1451
|
let n = t;
|
|
764
|
-
return (e, t) => (
|
|
765
|
-
default:
|
|
1452
|
+
return (e, t) => (b(), s(D(Te), h(e.$attrs, { "onUpdate:open": t[0] ||= (e) => n("update:open", e) }), {
|
|
1453
|
+
default: M(() => [w(e.$slots, "default")]),
|
|
766
1454
|
_: 3
|
|
767
1455
|
}, 16));
|
|
768
1456
|
}
|
|
769
|
-
}),
|
|
1457
|
+
}), er = /* @__PURE__ */ p({
|
|
770
1458
|
__name: "DropdownMenuTrigger",
|
|
771
1459
|
setup(e) {
|
|
772
|
-
return (e, t) => (
|
|
1460
|
+
return (e, t) => (b(), s(D(Ee), {
|
|
773
1461
|
"as-child": "",
|
|
774
1462
|
"focus-on-select": ""
|
|
775
1463
|
}, {
|
|
776
|
-
default:
|
|
1464
|
+
default: M(() => [w(e.$slots, "default")]),
|
|
777
1465
|
_: 3
|
|
778
1466
|
}));
|
|
779
1467
|
}
|
|
780
|
-
}),
|
|
1468
|
+
}), tr = /* @__PURE__ */ p({
|
|
781
1469
|
__name: "DropdownMenuContent",
|
|
782
1470
|
props: {
|
|
783
1471
|
align: { default: "start" },
|
|
@@ -785,14 +1473,14 @@ var q = /* @__PURE__ */ p({
|
|
|
785
1473
|
sideOffset: { default: 4 }
|
|
786
1474
|
},
|
|
787
1475
|
setup(e) {
|
|
788
|
-
return (t, n) => (
|
|
789
|
-
default:
|
|
1476
|
+
return (t, n) => (b(), s(D(we), null, {
|
|
1477
|
+
default: M(() => [f(D(Se), {
|
|
790
1478
|
align: e.align,
|
|
791
1479
|
side: e.side,
|
|
792
1480
|
"side-offset": e.sideOffset,
|
|
793
1481
|
class: "z-50 min-w-40 rounded-md border border-border bg-surface p-1 shadow-popover"
|
|
794
1482
|
}, {
|
|
795
|
-
default:
|
|
1483
|
+
default: M(() => [w(t.$slots, "default")]),
|
|
796
1484
|
_: 3
|
|
797
1485
|
}, 8, [
|
|
798
1486
|
"align",
|
|
@@ -802,7 +1490,7 @@ var q = /* @__PURE__ */ p({
|
|
|
802
1490
|
_: 3
|
|
803
1491
|
}));
|
|
804
1492
|
}
|
|
805
|
-
}),
|
|
1493
|
+
}), nr = /* @__PURE__ */ p({
|
|
806
1494
|
__name: "DropdownMenuItem",
|
|
807
1495
|
props: { variant: {} },
|
|
808
1496
|
emits: ["select"],
|
|
@@ -815,21 +1503,21 @@ var q = /* @__PURE__ */ p({
|
|
|
815
1503
|
} },
|
|
816
1504
|
defaultVariants: { variant: "default" }
|
|
817
1505
|
}), r = t;
|
|
818
|
-
return (t, i) => (
|
|
819
|
-
class:
|
|
1506
|
+
return (t, i) => (b(), s(D(Ce), {
|
|
1507
|
+
class: g(D(n)({ variant: e.variant })),
|
|
820
1508
|
onSelect: i[0] ||= (e) => r("select")
|
|
821
1509
|
}, {
|
|
822
|
-
default:
|
|
1510
|
+
default: M(() => [w(t.$slots, "default")]),
|
|
823
1511
|
_: 3
|
|
824
1512
|
}, 8, ["class"]));
|
|
825
1513
|
}
|
|
826
|
-
}),
|
|
1514
|
+
}), rr = { class: "flex flex-col gap-2 sm:flex-row sm:items-stretch" }, ir = { class: "border-b border-border px-3 py-2 text-xs font-medium text-muted" }, ar = { class: "max-h-64 flex-1 overflow-y-auto p-1" }, or = ["disabled", "onClick"], sr = { class: "truncate" }, cr = {
|
|
827
1515
|
key: 0,
|
|
828
1516
|
class: "px-2 py-1.5 text-sm text-muted"
|
|
829
|
-
},
|
|
1517
|
+
}, lr = { class: "flex flex-row items-center justify-center gap-1 sm:flex-col" }, ur = { class: "border-b border-border px-3 py-2 text-xs font-medium text-muted" }, dr = { class: "max-h-64 flex-1 overflow-y-auto p-1" }, fr = ["disabled", "onClick"], pr = { class: "truncate" }, mr = {
|
|
830
1518
|
key: 0,
|
|
831
1519
|
class: "px-2 py-1.5 text-sm text-muted"
|
|
832
|
-
},
|
|
1520
|
+
}, hr = /* @__PURE__ */ p({
|
|
833
1521
|
__name: "TransferList",
|
|
834
1522
|
props: {
|
|
835
1523
|
options: {},
|
|
@@ -843,106 +1531,106 @@ var q = /* @__PURE__ */ p({
|
|
|
843
1531
|
},
|
|
844
1532
|
emits: ["update:modelValue"],
|
|
845
1533
|
setup(e, { emit: t }) {
|
|
846
|
-
let n = e, r = t, i =
|
|
1534
|
+
let n = e, r = t, i = S(new Set(n.modelValue ?? [])), s = S(/* @__PURE__ */ new Set()), p = S(/* @__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
1535
|
function _() {
|
|
848
|
-
r("update:modelValue",
|
|
1536
|
+
r("update:modelValue", h.value.map((e) => e.value));
|
|
849
1537
|
}
|
|
850
1538
|
function v(e, t) {
|
|
851
1539
|
let n = new Set(e);
|
|
852
1540
|
n.has(t) ? n.delete(t) : n.add(t), e.clear();
|
|
853
1541
|
for (let t of n) e.add(t);
|
|
854
1542
|
}
|
|
855
|
-
function
|
|
1543
|
+
function y() {
|
|
856
1544
|
for (let e of s.value) i.value.add(e);
|
|
857
1545
|
s.value.clear(), _();
|
|
858
1546
|
}
|
|
859
|
-
function
|
|
1547
|
+
function x() {
|
|
860
1548
|
for (let e of p.value) i.value.delete(e);
|
|
861
1549
|
p.value.clear(), _();
|
|
862
1550
|
}
|
|
863
|
-
function
|
|
1551
|
+
function T() {
|
|
864
1552
|
for (let e of n.options) i.value.add(e.value);
|
|
865
1553
|
s.value.clear(), _();
|
|
866
1554
|
}
|
|
867
1555
|
function O() {
|
|
868
1556
|
i.value.clear(), p.value.clear(), _();
|
|
869
1557
|
}
|
|
870
|
-
return (t, n) => (
|
|
871
|
-
u("div", { class:
|
|
1558
|
+
return (t, n) => (b(), l("div", rr, [
|
|
1559
|
+
u("div", { class: g(["flex min-h-40 flex-1 flex-col rounded-md border border-border bg-surface", e.disabled && "opacity-50"]) }, [u("div", ir, [w(t.$slots, "source-header", {}, () => [d(E(e.sourceLabel), 1)])]), u("ul", ar, [(b(!0), l(a, null, C(m.value, (r) => (b(), l("li", { key: r.value }, [u("button", {
|
|
872
1560
|
type: "button",
|
|
873
1561
|
disabled: e.disabled,
|
|
874
1562
|
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
1563
|
onClick: (e) => v(s.value, r.value)
|
|
876
|
-
}, [f(
|
|
1564
|
+
}, [f(on, {
|
|
877
1565
|
"model-value": s.value.has(r.value),
|
|
878
1566
|
disabled: e.disabled,
|
|
879
|
-
onClick: n[0] ||=
|
|
1567
|
+
onClick: n[0] ||= P(() => {}, ["stop"]),
|
|
880
1568
|
"onUpdate:modelValue": (e) => v(s.value, r.value)
|
|
881
1569
|
}, null, 8, [
|
|
882
1570
|
"model-value",
|
|
883
1571
|
"disabled",
|
|
884
1572
|
"onUpdate:modelValue"
|
|
885
|
-
]),
|
|
886
|
-
u("div",
|
|
887
|
-
f(
|
|
1573
|
+
]), w(t.$slots, "item", { option: r }, () => [u("span", sr, E(r.label), 1)])], 8, or)]))), 128)), m.value.length === 0 ? (b(), l("li", cr, "Empty")) : c("", !0)])], 2),
|
|
1574
|
+
u("div", lr, [
|
|
1575
|
+
f(Z, {
|
|
888
1576
|
variant: "outline",
|
|
889
1577
|
size: "icon-sm",
|
|
890
1578
|
disabled: e.disabled || s.value.size === 0,
|
|
891
1579
|
"aria-label": "Move selected to target",
|
|
892
|
-
onClick:
|
|
1580
|
+
onClick: y
|
|
893
1581
|
}, {
|
|
894
|
-
default:
|
|
1582
|
+
default: M(() => [f(D(L), { class: "size-4" })]),
|
|
895
1583
|
_: 1
|
|
896
1584
|
}, 8, ["disabled"]),
|
|
897
|
-
f(
|
|
1585
|
+
f(Z, {
|
|
898
1586
|
variant: "outline",
|
|
899
1587
|
size: "icon-sm",
|
|
900
1588
|
disabled: e.disabled || p.value.size === 0,
|
|
901
1589
|
"aria-label": "Move selected to source",
|
|
902
|
-
onClick:
|
|
1590
|
+
onClick: x
|
|
903
1591
|
}, {
|
|
904
|
-
default:
|
|
1592
|
+
default: M(() => [f(D(ie), { class: "size-4" })]),
|
|
905
1593
|
_: 1
|
|
906
1594
|
}, 8, ["disabled"]),
|
|
907
|
-
f(
|
|
1595
|
+
f(Z, {
|
|
908
1596
|
variant: "ghost",
|
|
909
1597
|
size: "icon-sm",
|
|
910
1598
|
disabled: e.disabled,
|
|
911
1599
|
"aria-label": "Move all to target",
|
|
912
|
-
onClick:
|
|
1600
|
+
onClick: T
|
|
913
1601
|
}, {
|
|
914
|
-
default:
|
|
1602
|
+
default: M(() => [f(D(se), { class: "size-4" })]),
|
|
915
1603
|
_: 1
|
|
916
1604
|
}, 8, ["disabled"]),
|
|
917
|
-
f(
|
|
1605
|
+
f(Z, {
|
|
918
1606
|
variant: "ghost",
|
|
919
1607
|
size: "icon-sm",
|
|
920
1608
|
disabled: e.disabled,
|
|
921
1609
|
"aria-label": "Move all to source",
|
|
922
1610
|
onClick: O
|
|
923
1611
|
}, {
|
|
924
|
-
default:
|
|
1612
|
+
default: M(() => [f(D(oe), { class: "size-4" })]),
|
|
925
1613
|
_: 1
|
|
926
1614
|
}, 8, ["disabled"])
|
|
927
1615
|
]),
|
|
928
|
-
u("div", { class:
|
|
1616
|
+
u("div", { class: g(["flex min-h-40 flex-1 flex-col rounded-md border border-border bg-surface", e.disabled && "opacity-50"]) }, [u("div", ur, [w(t.$slots, "target-header", {}, () => [d(E(e.targetLabel), 1)])]), u("ul", dr, [(b(!0), l(a, null, C(h.value, (r) => (b(), l("li", { key: r.value }, [u("button", {
|
|
929
1617
|
type: "button",
|
|
930
1618
|
disabled: e.disabled,
|
|
931
1619
|
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
1620
|
onClick: (e) => v(p.value, r.value)
|
|
933
|
-
}, [f(
|
|
1621
|
+
}, [f(on, {
|
|
934
1622
|
"model-value": p.value.has(r.value),
|
|
935
1623
|
disabled: e.disabled,
|
|
936
|
-
onClick: n[1] ||=
|
|
1624
|
+
onClick: n[1] ||= P(() => {}, ["stop"]),
|
|
937
1625
|
"onUpdate:modelValue": (e) => v(p.value, r.value)
|
|
938
1626
|
}, null, 8, [
|
|
939
1627
|
"model-value",
|
|
940
1628
|
"disabled",
|
|
941
1629
|
"onUpdate:modelValue"
|
|
942
|
-
]),
|
|
1630
|
+
]), w(t.$slots, "item", { option: r }, () => [u("span", pr, E(r.label), 1)])], 8, fr)]))), 128)), h.value.length === 0 ? (b(), l("li", mr, "Empty")) : c("", !0)])], 2)
|
|
943
1631
|
]));
|
|
944
1632
|
}
|
|
945
|
-
}),
|
|
1633
|
+
}), gr = /* @__PURE__ */ p({
|
|
946
1634
|
__name: "Table",
|
|
947
1635
|
props: {
|
|
948
1636
|
striped: { type: Boolean },
|
|
@@ -953,31 +1641,31 @@ var q = /* @__PURE__ */ p({
|
|
|
953
1641
|
}
|
|
954
1642
|
},
|
|
955
1643
|
setup(e) {
|
|
956
|
-
let t = e, n = o(() =>
|
|
957
|
-
return (e, t) => (
|
|
1644
|
+
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"));
|
|
1645
|
+
return (e, t) => (b(), l("table", { class: g(n.value) }, [w(e.$slots, "default")], 2));
|
|
958
1646
|
}
|
|
959
|
-
}),
|
|
1647
|
+
}), _r = (e, t) => {
|
|
960
1648
|
let n = e.__vccOpts || e;
|
|
961
1649
|
for (let [e, r] of t) n[e] = r;
|
|
962
1650
|
return n;
|
|
963
|
-
},
|
|
964
|
-
function
|
|
965
|
-
return
|
|
1651
|
+
}, vr = {}, yr = { class: "border-b border-border bg-surface-muted/60 text-xs font-medium text-muted" };
|
|
1652
|
+
function br(e, t) {
|
|
1653
|
+
return b(), l("thead", yr, [w(e.$slots, "default")]);
|
|
966
1654
|
}
|
|
967
|
-
var
|
|
968
|
-
function
|
|
969
|
-
return
|
|
1655
|
+
var xr = /*#__PURE__*/ _r(vr, [["render", br]]), Sr = {};
|
|
1656
|
+
function Cr(e, t) {
|
|
1657
|
+
return b(), l("tbody", null, [w(e.$slots, "default")]);
|
|
970
1658
|
}
|
|
971
|
-
var
|
|
1659
|
+
var wr = /*#__PURE__*/ _r(Sr, [["render", Cr]]), Q = /* @__PURE__ */ p({
|
|
972
1660
|
__name: "TableRow",
|
|
973
1661
|
props: { clickable: {
|
|
974
1662
|
type: Boolean,
|
|
975
1663
|
default: !1
|
|
976
1664
|
} },
|
|
977
1665
|
setup(e) {
|
|
978
|
-
return (t, n) => (
|
|
1666
|
+
return (t, n) => (b(), l("tr", { class: g(["border-b border-border/60 last:border-b-0", e.clickable && "cursor-pointer transition-colors hover:bg-surface-muted/50"]) }, [w(t.$slots, "default")], 2));
|
|
979
1667
|
}
|
|
980
|
-
}),
|
|
1668
|
+
}), Tr = ["aria-sort"], Er = /* @__PURE__ */ p({
|
|
981
1669
|
__name: "TableHead",
|
|
982
1670
|
props: {
|
|
983
1671
|
sortDirection: {},
|
|
@@ -986,39 +1674,39 @@ var gn = /*#__PURE__*/ ln(mn, [["render", hn]]), X = /* @__PURE__ */ p({
|
|
|
986
1674
|
},
|
|
987
1675
|
setup(e) {
|
|
988
1676
|
let t = e, n = o(() => t.sortDirection && t.sortDirection !== "none" ? t.sortDirection : void 0);
|
|
989
|
-
return (t, r) => (
|
|
1677
|
+
return (t, r) => (b(), l("th", {
|
|
990
1678
|
scope: "col",
|
|
991
1679
|
"aria-sort": n.value,
|
|
992
|
-
style:
|
|
993
|
-
class:
|
|
994
|
-
}, [
|
|
1680
|
+
style: _(e.width ? { width: e.width } : void 0),
|
|
1681
|
+
class: g(D(U)("px-3 py-2 font-medium", e.align === "center" && "text-center", e.align === "end" && "text-end"))
|
|
1682
|
+
}, [w(t.$slots, "default")], 14, Tr));
|
|
995
1683
|
}
|
|
996
|
-
}),
|
|
1684
|
+
}), Dr = /* @__PURE__ */ p({
|
|
997
1685
|
__name: "TableCell",
|
|
998
1686
|
props: {
|
|
999
1687
|
align: { default: "start" },
|
|
1000
1688
|
truncate: { type: Boolean }
|
|
1001
1689
|
},
|
|
1002
1690
|
setup(e) {
|
|
1003
|
-
let t = e, n = o(() =>
|
|
1004
|
-
return (e, t) => (
|
|
1691
|
+
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"));
|
|
1692
|
+
return (e, t) => (b(), l("td", { class: g(n.value) }, [w(e.$slots, "default")], 2));
|
|
1005
1693
|
}
|
|
1006
|
-
}),
|
|
1694
|
+
}), Or = ["colspan"], kr = /* @__PURE__ */ p({
|
|
1007
1695
|
__name: "TableEmpty",
|
|
1008
1696
|
props: {
|
|
1009
1697
|
columns: {},
|
|
1010
1698
|
label: {}
|
|
1011
1699
|
},
|
|
1012
1700
|
setup(e) {
|
|
1013
|
-
return (t, n) => (
|
|
1701
|
+
return (t, n) => (b(), l("tr", null, [u("td", {
|
|
1014
1702
|
colspan: e.columns,
|
|
1015
1703
|
class: "px-3 py-8 text-center text-sm text-muted"
|
|
1016
|
-
}, [
|
|
1704
|
+
}, [w(t.$slots, "default", {}, () => [d(E(e.label), 1)])], 8, Or)]));
|
|
1017
1705
|
}
|
|
1018
1706
|
});
|
|
1019
1707
|
//#endregion
|
|
1020
1708
|
//#region src/lib/pagination.ts
|
|
1021
|
-
function
|
|
1709
|
+
function Ar(e, t, n) {
|
|
1022
1710
|
if (n <= 0 || t <= 0) return {
|
|
1023
1711
|
from: 0,
|
|
1024
1712
|
to: 0,
|
|
@@ -1035,17 +1723,17 @@ function xn(e, t, n) {
|
|
|
1035
1723
|
total: n
|
|
1036
1724
|
};
|
|
1037
1725
|
}
|
|
1038
|
-
function
|
|
1726
|
+
function jr(e, t) {
|
|
1039
1727
|
return t <= 0 ? 1 : Math.max(1, Math.ceil(e / t));
|
|
1040
1728
|
}
|
|
1041
|
-
function
|
|
1729
|
+
function Mr(e, t, n = 5) {
|
|
1042
1730
|
if (t <= 0) return [];
|
|
1043
1731
|
let r = Math.floor(n / 2), i = Math.max(0, Math.min(e - r, t - n)), a = Math.max(0, i);
|
|
1044
1732
|
return Array.from({ length: Math.min(n, t - a) }, (e, t) => a + t + 1);
|
|
1045
1733
|
}
|
|
1046
1734
|
//#endregion
|
|
1047
1735
|
//#region src/components/table/TablePagination.vue?vue&type=script&setup=true&lang.ts
|
|
1048
|
-
var
|
|
1736
|
+
var Nr = { class: "flex flex-wrap items-center justify-between gap-3 px-3 py-2 text-sm text-muted" }, Pr = { class: "flex items-center gap-2" }, Fr = ["value"], Ir = ["value"], Lr = { class: "flex items-center gap-2" }, Rr = { class: "flex items-center gap-1" }, zr = /* @__PURE__ */ p({
|
|
1049
1737
|
__name: "TablePagination",
|
|
1050
1738
|
props: {
|
|
1051
1739
|
pageIndex: {},
|
|
@@ -1063,63 +1751,63 @@ var wn = { class: "flex flex-wrap items-center justify-between gap-3 px-3 py-2 t
|
|
|
1063
1751
|
},
|
|
1064
1752
|
emits: ["update:pageIndex", "update:pageSize"],
|
|
1065
1753
|
setup(e, { emit: t }) {
|
|
1066
|
-
let n = e, r = t, i = o(() =>
|
|
1754
|
+
let n = e, r = t, i = o(() => jr(n.total, n.pageSize)), c = o(() => Ar(n.pageIndex, n.pageSize, n.total)), p = o(() => Mr(n.pageIndex, i.value));
|
|
1067
1755
|
function m(e) {
|
|
1068
1756
|
r("update:pageIndex", Math.max(0, Math.min(e, i.value - 1)));
|
|
1069
1757
|
}
|
|
1070
|
-
return (t, n) => (
|
|
1758
|
+
return (t, n) => (b(), l("div", Nr, [u("div", Pr, [u("span", null, E(e.rowsPerPageLabel), 1), u("select", {
|
|
1071
1759
|
value: e.pageSize,
|
|
1072
1760
|
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
1761
|
onChange: n[0] ||= (e) => r("update:pageSize", Number(e.target.value))
|
|
1074
|
-
}, [(
|
|
1762
|
+
}, [(b(!0), l(a, null, C(e.pageSizeOptions, (e) => (b(), l("option", {
|
|
1075
1763
|
key: e,
|
|
1076
1764
|
value: e
|
|
1077
|
-
},
|
|
1078
|
-
f(
|
|
1765
|
+
}, E(e), 9, Ir))), 128))], 40, Fr)]), u("div", Lr, [u("span", null, E(c.value.from) + "–" + E(c.value.to) + " " + E(e.ofLabel) + " " + E(c.value.total), 1), u("div", Rr, [
|
|
1766
|
+
f(Z, {
|
|
1079
1767
|
variant: "ghost",
|
|
1080
1768
|
size: "icon-sm",
|
|
1081
1769
|
disabled: e.pageIndex <= 0,
|
|
1082
1770
|
"aria-label": e.previousLabel,
|
|
1083
1771
|
onClick: n[1] ||= (t) => m(e.pageIndex - 1)
|
|
1084
1772
|
}, {
|
|
1085
|
-
default:
|
|
1773
|
+
default: M(() => [f(D(ie), { class: "size-4 rtl:rotate-180" })]),
|
|
1086
1774
|
_: 1
|
|
1087
1775
|
}, 8, ["disabled", "aria-label"]),
|
|
1088
|
-
(
|
|
1776
|
+
(b(!0), l(a, null, C(p.value, (t) => (b(), s(Z, {
|
|
1089
1777
|
key: t,
|
|
1090
1778
|
variant: t - 1 === e.pageIndex ? "default" : "ghost",
|
|
1091
1779
|
size: "icon-sm",
|
|
1092
1780
|
"aria-current": t - 1 === e.pageIndex ? "page" : void 0,
|
|
1093
1781
|
onClick: (e) => m(t - 1)
|
|
1094
1782
|
}, {
|
|
1095
|
-
default:
|
|
1783
|
+
default: M(() => [d(E(t), 1)]),
|
|
1096
1784
|
_: 2
|
|
1097
1785
|
}, 1032, [
|
|
1098
1786
|
"variant",
|
|
1099
1787
|
"aria-current",
|
|
1100
1788
|
"onClick"
|
|
1101
1789
|
]))), 128)),
|
|
1102
|
-
f(
|
|
1790
|
+
f(Z, {
|
|
1103
1791
|
variant: "ghost",
|
|
1104
1792
|
size: "icon-sm",
|
|
1105
1793
|
disabled: e.pageIndex >= i.value - 1,
|
|
1106
1794
|
"aria-label": e.nextLabel,
|
|
1107
1795
|
onClick: n[2] ||= (t) => m(e.pageIndex + 1)
|
|
1108
1796
|
}, {
|
|
1109
|
-
default:
|
|
1797
|
+
default: M(() => [f(D(L), { class: "size-4 rtl:rotate-180" })]),
|
|
1110
1798
|
_: 1
|
|
1111
1799
|
}, 8, ["disabled", "aria-label"])
|
|
1112
1800
|
])])]));
|
|
1113
1801
|
}
|
|
1114
|
-
}),
|
|
1115
|
-
rowSortingFeature:
|
|
1116
|
-
rowPaginationFeature:
|
|
1117
|
-
rowExpandingFeature:
|
|
1118
|
-
sortedRowModel:
|
|
1119
|
-
paginatedRowModel:
|
|
1120
|
-
expandedRowModel:
|
|
1121
|
-
sortFns:
|
|
1122
|
-
}),
|
|
1802
|
+
}), Br = ft({
|
|
1803
|
+
rowSortingFeature: ut,
|
|
1804
|
+
rowPaginationFeature: lt,
|
|
1805
|
+
rowExpandingFeature: ct,
|
|
1806
|
+
sortedRowModel: st(),
|
|
1807
|
+
paginatedRowModel: ot(),
|
|
1808
|
+
expandedRowModel: at(),
|
|
1809
|
+
sortFns: dt
|
|
1810
|
+
}), Vr = [
|
|
1123
1811
|
"a[href]",
|
|
1124
1812
|
"button",
|
|
1125
1813
|
"input",
|
|
@@ -1132,16 +1820,16 @@ var wn = { class: "flex flex-wrap items-center justify-between gap-3 px-3 py-2 t
|
|
|
1132
1820
|
"[role=\"menu\"]",
|
|
1133
1821
|
"[data-row-toggle-ignore]"
|
|
1134
1822
|
].join(",");
|
|
1135
|
-
function
|
|
1823
|
+
function Hr(e) {
|
|
1136
1824
|
let t = e;
|
|
1137
|
-
return !t || typeof t.closest != "function" ? !1 : t.closest(
|
|
1825
|
+
return !t || typeof t.closest != "function" ? !1 : t.closest(Vr) !== null;
|
|
1138
1826
|
}
|
|
1139
|
-
function
|
|
1827
|
+
function Ur(e, t) {
|
|
1140
1828
|
return e[t] ? {} : { [t]: !0 };
|
|
1141
1829
|
}
|
|
1142
1830
|
//#endregion
|
|
1143
1831
|
//#region src/components/data-table/DataTable.vue?vue&type=script&setup=true&lang.ts
|
|
1144
|
-
var
|
|
1832
|
+
var Wr = ["onClick"], Gr = /* @__PURE__ */ p({
|
|
1145
1833
|
__name: "DataTable",
|
|
1146
1834
|
props: {
|
|
1147
1835
|
data: {},
|
|
@@ -1174,8 +1862,8 @@ var Fn = ["onClick"], In = /* @__PURE__ */ p({
|
|
|
1174
1862
|
"row-click"
|
|
1175
1863
|
],
|
|
1176
1864
|
setup(e, { emit: t }) {
|
|
1177
|
-
let n = e, r = t, i =
|
|
1178
|
-
features:
|
|
1865
|
+
let n = e, r = t, i = ee(), u = S([]), p = n.getRowId ? (e) => n.getRowId(e) : void 0, m = pt({
|
|
1866
|
+
features: Br,
|
|
1179
1867
|
get columns() {
|
|
1180
1868
|
return n.columns;
|
|
1181
1869
|
},
|
|
@@ -1202,47 +1890,47 @@ var Fn = ["onClick"], In = /* @__PURE__ */ p({
|
|
|
1202
1890
|
let t = typeof e == "function" ? e(n.expanded) : e;
|
|
1203
1891
|
r("update:expanded", t === !0 ? {} : t);
|
|
1204
1892
|
}
|
|
1205
|
-
}),
|
|
1206
|
-
function
|
|
1893
|
+
}), h = o(() => m.getRowModel().rows), v = o(() => m.getAllLeafColumns().length);
|
|
1894
|
+
function y(e) {
|
|
1207
1895
|
let t = m.getColumn(e);
|
|
1208
1896
|
return t?.getIsSorted() ? t.getIsSorted() === "desc" ? "descending" : "ascending" : "none";
|
|
1209
1897
|
}
|
|
1210
|
-
let
|
|
1898
|
+
let x = (e) => !!i[`cell-${e}`], T = (e) => {
|
|
1211
1899
|
let t = e.size;
|
|
1212
1900
|
return t ? `${t}px` : void 0;
|
|
1213
1901
|
};
|
|
1214
|
-
function
|
|
1215
|
-
r("row-click",
|
|
1902
|
+
function O(e, t) {
|
|
1903
|
+
r("row-click", h.value.find((e) => e.id === t)?.original), n.expandable && (n.stopRowToggleOnInteractiveCells && Hr(e.target) || r("update:expanded", Ur(n.expanded, t)));
|
|
1216
1904
|
}
|
|
1217
|
-
return (t, n) => (
|
|
1218
|
-
class:
|
|
1219
|
-
style:
|
|
1220
|
-
}, [f(
|
|
1905
|
+
return (t, n) => (b(), l("div", {
|
|
1906
|
+
class: g(e.maxHeight ? "overflow-auto" : void 0),
|
|
1907
|
+
style: _(e.maxHeight ? { maxHeight: e.maxHeight } : void 0)
|
|
1908
|
+
}, [f(gr, {
|
|
1221
1909
|
striped: e.striped,
|
|
1222
1910
|
size: e.size
|
|
1223
1911
|
}, {
|
|
1224
|
-
default:
|
|
1225
|
-
default:
|
|
1226
|
-
default:
|
|
1912
|
+
default: M(() => [f(xr, null, {
|
|
1913
|
+
default: M(() => [f(Q, null, {
|
|
1914
|
+
default: M(() => [(b(!0), l(a, null, C(D(m).getHeaderGroups()[0]?.headers ?? [], (t) => (b(), s(Er, {
|
|
1227
1915
|
key: t.id,
|
|
1228
|
-
width:
|
|
1229
|
-
"sort-direction": t.column.getCanSort() ?
|
|
1916
|
+
width: T(t.column.columnDef),
|
|
1917
|
+
"sort-direction": t.column.getCanSort() ? y(t.column.id) : void 0
|
|
1230
1918
|
}, {
|
|
1231
|
-
default:
|
|
1919
|
+
default: M(() => [e.sortable && t.column.getCanSort() ? (b(), l("button", {
|
|
1232
1920
|
key: 0,
|
|
1233
1921
|
type: "button",
|
|
1234
1922
|
class: "inline-flex items-center gap-1 rounded focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500",
|
|
1235
1923
|
onClick: (e) => t.column.toggleSorting()
|
|
1236
|
-
}, [f(
|
|
1924
|
+
}, [f(D(it), { header: t }, null, 8, ["header"]), y(t.column.id) === "descending" ? (b(), s(D(I), {
|
|
1237
1925
|
key: 0,
|
|
1238
1926
|
class: "size-3.5"
|
|
1239
|
-
})) :
|
|
1927
|
+
})) : y(t.column.id) === "ascending" ? (b(), s(D(ae), {
|
|
1240
1928
|
key: 1,
|
|
1241
1929
|
class: "size-3.5"
|
|
1242
|
-
})) : (
|
|
1930
|
+
})) : (b(), s(D(ce), {
|
|
1243
1931
|
key: 2,
|
|
1244
1932
|
class: "size-3.5 opacity-40"
|
|
1245
|
-
}))], 8,
|
|
1933
|
+
}))], 8, Wr)) : (b(), s(D(it), {
|
|
1246
1934
|
key: 1,
|
|
1247
1935
|
header: t
|
|
1248
1936
|
}, null, 8, ["header"]))]),
|
|
@@ -1251,25 +1939,25 @@ var Fn = ["onClick"], In = /* @__PURE__ */ p({
|
|
|
1251
1939
|
_: 1
|
|
1252
1940
|
})]),
|
|
1253
1941
|
_: 1
|
|
1254
|
-
}), f(
|
|
1255
|
-
default:
|
|
1942
|
+
}), f(wr, null, {
|
|
1943
|
+
default: M(() => [h.value.length === 0 ? (b(), s(kr, {
|
|
1256
1944
|
key: 0,
|
|
1257
1945
|
columns: v.value
|
|
1258
1946
|
}, {
|
|
1259
|
-
default:
|
|
1947
|
+
default: M(() => [w(t.$slots, "empty", {}, () => [d(E(e.emptyLabel), 1)])]),
|
|
1260
1948
|
_: 3
|
|
1261
|
-
}, 8, ["columns"])) : c("", !0), (
|
|
1949
|
+
}, 8, ["columns"])) : c("", !0), (b(!0), l(a, null, C(h.value, (n) => (b(), l(a, { key: n.id }, [f(Q, {
|
|
1262
1950
|
clickable: e.expandable,
|
|
1263
1951
|
"data-row-id": n.id,
|
|
1264
1952
|
"data-state": n.getIsExpanded() ? "expanded" : void 0,
|
|
1265
|
-
onClick: (e) =>
|
|
1953
|
+
onClick: (e) => O(e, n.id)
|
|
1266
1954
|
}, {
|
|
1267
|
-
default:
|
|
1268
|
-
default:
|
|
1955
|
+
default: M(() => [(b(!0), l(a, null, C(n.getAllCells(), (e) => (b(), s(Dr, { key: e.id }, {
|
|
1956
|
+
default: M(() => [x(e.column.id) ? w(t.$slots, `cell-${e.column.id}`, {
|
|
1269
1957
|
row: n,
|
|
1270
1958
|
cell: e,
|
|
1271
1959
|
value: e.getValue()
|
|
1272
|
-
}, void 0, void 0, 0) : (
|
|
1960
|
+
}, void 0, void 0, 0) : (b(), s(D(it), {
|
|
1273
1961
|
key: 1,
|
|
1274
1962
|
cell: e
|
|
1275
1963
|
}, null, 8, ["cell"]))]),
|
|
@@ -1281,12 +1969,12 @@ var Fn = ["onClick"], In = /* @__PURE__ */ p({
|
|
|
1281
1969
|
"data-row-id",
|
|
1282
1970
|
"data-state",
|
|
1283
1971
|
"onClick"
|
|
1284
|
-
]), n.getIsExpanded() ? (
|
|
1972
|
+
]), n.getIsExpanded() ? (b(), s(Q, {
|
|
1285
1973
|
key: 0,
|
|
1286
1974
|
class: "bg-surface-muted/30"
|
|
1287
1975
|
}, {
|
|
1288
|
-
default:
|
|
1289
|
-
default:
|
|
1976
|
+
default: M(() => [f(Dr, { colspan: v.value }, {
|
|
1977
|
+
default: M(() => [w(t.$slots, "expansion", { row: n })]),
|
|
1290
1978
|
_: 2
|
|
1291
1979
|
}, 1032, ["colspan"])]),
|
|
1292
1980
|
_: 2
|
|
@@ -1299,7 +1987,7 @@ var Fn = ["onClick"], In = /* @__PURE__ */ p({
|
|
|
1299
1987
|
});
|
|
1300
1988
|
//#endregion
|
|
1301
1989
|
//#region src/lib/tree.ts
|
|
1302
|
-
function
|
|
1990
|
+
function Kr(e, t, n = 1, r = null) {
|
|
1303
1991
|
return e.flatMap((e) => {
|
|
1304
1992
|
let i = {
|
|
1305
1993
|
node: e,
|
|
@@ -1308,27 +1996,27 @@ function Q(e, t, n = 1, r = null) {
|
|
|
1308
1996
|
parentKey: r,
|
|
1309
1997
|
hasChildren: !!e.children?.length
|
|
1310
1998
|
};
|
|
1311
|
-
return !i.hasChildren || !t.includes(e.value) ? [i] : [i, ...
|
|
1999
|
+
return !i.hasChildren || !t.includes(e.value) ? [i] : [i, ...Kr(e.children, t, n + 1, e.value)];
|
|
1312
2000
|
});
|
|
1313
2001
|
}
|
|
1314
|
-
function
|
|
2002
|
+
function qr(e, t) {
|
|
1315
2003
|
for (let n of e) {
|
|
1316
2004
|
if (n.value === t) return n;
|
|
1317
|
-
let e = n.children ?
|
|
2005
|
+
let e = n.children ? qr(n.children, t) : void 0;
|
|
1318
2006
|
if (e) return e;
|
|
1319
2007
|
}
|
|
1320
2008
|
}
|
|
1321
|
-
function
|
|
1322
|
-
return e.flatMap((e) => e.children?.length ?
|
|
2009
|
+
function Jr(e) {
|
|
2010
|
+
return e.flatMap((e) => e.children?.length ? Jr(e.children) : [e.value]);
|
|
1323
2011
|
}
|
|
1324
|
-
function
|
|
1325
|
-
let n = e.children?.length ?
|
|
2012
|
+
function Yr(e, t) {
|
|
2013
|
+
let n = e.children?.length ? Jr([e]) : [e.value], r = n.filter((e) => t.includes(e)).length;
|
|
1326
2014
|
return r === 0 ? "unchecked" : r === n.length ? "checked" : "indeterminate";
|
|
1327
2015
|
}
|
|
1328
|
-
function
|
|
2016
|
+
function Xr(e, t, n = (e) => e.label ?? "") {
|
|
1329
2017
|
let r = t.trim().toLowerCase();
|
|
1330
2018
|
return r ? e.reduce((e, i) => {
|
|
1331
|
-
let a = i.children ?
|
|
2019
|
+
let a = i.children ? Xr(i.children, t, n) : void 0;
|
|
1332
2020
|
return !n(i).toLowerCase().includes(r) && (!a || a.length === 0) || e.push({
|
|
1333
2021
|
...i,
|
|
1334
2022
|
children: a
|
|
@@ -1337,10 +2025,10 @@ function zn(e, t, n = (e) => e.label ?? "") {
|
|
|
1337
2025
|
}
|
|
1338
2026
|
//#endregion
|
|
1339
2027
|
//#region src/components/tree-table/TreeTable.vue?vue&type=script&setup=true&lang.ts
|
|
1340
|
-
var
|
|
2028
|
+
var Zr = { class: "overflow-hidden rounded-md border border-border bg-surface" }, Qr = { class: "px-3 py-2" }, $r = ["aria-label", "onClick"], ei = {
|
|
1341
2029
|
key: 1,
|
|
1342
2030
|
class: "inline-block size-4"
|
|
1343
|
-
},
|
|
2031
|
+
}, ti = /* @__PURE__ */ p({
|
|
1344
2032
|
__name: "TreeTable",
|
|
1345
2033
|
props: {
|
|
1346
2034
|
nodes: {},
|
|
@@ -1354,44 +2042,44 @@ var Bn = { class: "overflow-hidden rounded-md border border-border bg-surface" }
|
|
|
1354
2042
|
},
|
|
1355
2043
|
emits: ["update:expanded"],
|
|
1356
2044
|
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) => (
|
|
2045
|
+
let n = e, r = t, i = o(() => `minmax(12rem, 1fr) ${n.columns.map((e) => e.width ?? "minmax(6rem, 1fr)").join(" ")}`), c = o(() => Kr(n.nodes, n.expanded));
|
|
2046
|
+
return (t, n) => (b(), l("div", Zr, [u("div", {
|
|
1359
2047
|
class: "grid border-b border-border bg-surface-muted/60 text-xs font-medium text-muted",
|
|
1360
|
-
style:
|
|
1361
|
-
}, [u("div",
|
|
2048
|
+
style: _({ gridTemplateColumns: i.value })
|
|
2049
|
+
}, [u("div", Qr, [w(t.$slots, "header", {}, () => [d(E(e.rowColumnHeader), 1)])]), (b(!0), l(a, null, C(e.columns, (e) => (b(), l("div", {
|
|
1362
2050
|
key: e.key,
|
|
1363
|
-
class:
|
|
1364
|
-
},
|
|
2051
|
+
class: g(["px-3 py-2", [e.align === "center" && "text-center", e.align === "end" && "text-end"]])
|
|
2052
|
+
}, E(e.header), 3))), 128))], 4), f(D(nt), {
|
|
1365
2053
|
items: e.nodes,
|
|
1366
2054
|
"get-key": (e) => e.value,
|
|
1367
2055
|
"get-children": (e) => e.children,
|
|
1368
2056
|
expanded: e.expanded,
|
|
1369
2057
|
"onUpdate:expanded": n[0] ||= (e) => r("update:expanded", e)
|
|
1370
2058
|
}, {
|
|
1371
|
-
default:
|
|
2059
|
+
default: M(() => [(b(!0), l(a, null, C(c.value, (n) => (b(), s(D(tt), {
|
|
1372
2060
|
key: n.key,
|
|
1373
2061
|
value: n.node,
|
|
1374
2062
|
level: n.level,
|
|
1375
2063
|
as: "div",
|
|
1376
2064
|
class: "grid items-center border-b border-border/60 text-sm last:border-b-0 data-[selected]:bg-surface-muted/30",
|
|
1377
|
-
style:
|
|
2065
|
+
style: _({ gridTemplateColumns: i.value })
|
|
1378
2066
|
}, {
|
|
1379
|
-
default:
|
|
2067
|
+
default: M(({ isExpanded: r, handleToggle: i }) => [u("div", {
|
|
1380
2068
|
class: "flex items-center gap-1 px-3 py-2",
|
|
1381
|
-
style:
|
|
1382
|
-
}, [n.hasChildren ? (
|
|
2069
|
+
style: _({ paddingInlineStart: `calc(0.75rem + ${(n.level - 1) * 1.25}rem)` })
|
|
2070
|
+
}, [n.hasChildren ? (b(), l("button", {
|
|
1383
2071
|
key: 0,
|
|
1384
2072
|
type: "button",
|
|
1385
2073
|
"aria-label": e.rowLabel(n.node),
|
|
1386
|
-
class:
|
|
1387
|
-
onClick:
|
|
1388
|
-
}, [f(
|
|
2074
|
+
class: g(["rounded p-0.5 text-muted transition-transform hover:bg-surface-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500", r && "rotate-90"]),
|
|
2075
|
+
onClick: P(i, ["stop"])
|
|
2076
|
+
}, [f(D(L), { class: "size-3.5 rtl:rotate-180" })], 10, $r)) : (b(), l("span", ei)), w(t.$slots, "row-label", {
|
|
1389
2077
|
node: n.node,
|
|
1390
2078
|
level: n.level
|
|
1391
|
-
}, () => [d(
|
|
2079
|
+
}, () => [d(E(e.rowLabel(n.node)), 1)])], 4), (b(!0), l(a, null, C(e.columns, (e) => (b(), l("div", {
|
|
1392
2080
|
key: e.key,
|
|
1393
|
-
class:
|
|
1394
|
-
}, [
|
|
2081
|
+
class: g(["px-3 py-2", [e.align === "center" && "text-center", e.align === "end" && "text-end"]])
|
|
2082
|
+
}, [w(t.$slots, `cell-${e.key}`, {
|
|
1395
2083
|
node: n.node,
|
|
1396
2084
|
row: n,
|
|
1397
2085
|
isExpanded: r,
|
|
@@ -1412,22 +2100,22 @@ var Bn = { class: "overflow-hidden rounded-md border border-border bg-surface" }
|
|
|
1412
2100
|
"expanded"
|
|
1413
2101
|
])]));
|
|
1414
2102
|
}
|
|
1415
|
-
}),
|
|
2103
|
+
}), ni = ["disabled"], ri = {
|
|
1416
2104
|
key: 0,
|
|
1417
2105
|
class: "truncate text-muted"
|
|
1418
|
-
},
|
|
2106
|
+
}, ii = {
|
|
1419
2107
|
key: 1,
|
|
1420
2108
|
class: "flex flex-wrap items-center gap-1"
|
|
1421
|
-
},
|
|
2109
|
+
}, ai = {
|
|
1422
2110
|
key: 0,
|
|
1423
2111
|
class: "relative mb-2"
|
|
1424
|
-
},
|
|
2112
|
+
}, oi = ["placeholder"], si = {
|
|
1425
2113
|
key: 1,
|
|
1426
2114
|
class: "block h-0.5 w-2 rounded bg-white"
|
|
1427
|
-
},
|
|
2115
|
+
}, ci = { class: "truncate" }, li = {
|
|
1428
2116
|
key: 1,
|
|
1429
2117
|
class: "mt-2 flex justify-end border-t border-border pt-2"
|
|
1430
|
-
},
|
|
2118
|
+
}, ui = /* @__PURE__ */ p({
|
|
1431
2119
|
__name: "TreeSelect",
|
|
1432
2120
|
props: {
|
|
1433
2121
|
modelValue: { default: () => [] },
|
|
@@ -1447,70 +2135,70 @@ var Bn = { class: "overflow-hidden rounded-md border border-border bg-surface" }
|
|
|
1447
2135
|
},
|
|
1448
2136
|
emits: ["update:modelValue"],
|
|
1449
2137
|
setup(e, { emit: t }) {
|
|
1450
|
-
let n = e, r = t, i =
|
|
1451
|
-
function
|
|
1452
|
-
return
|
|
2138
|
+
let n = e, r = t, i = S(!1), p = S(""), m = S([]), h = o(() => Xr(n.nodes, p.value)), v = o(() => Kr(h.value, m.value)), y = o(() => Jr(n.nodes)), x = o(() => n.modelValue.map((e) => qr(n.nodes, e)).filter((e) => !!e));
|
|
2139
|
+
function w(e) {
|
|
2140
|
+
return Yr(e, n.modelValue);
|
|
1453
2141
|
}
|
|
1454
|
-
function
|
|
2142
|
+
function T(e) {
|
|
1455
2143
|
let t = (Array.isArray(e) ? e : []).map((e) => e.value);
|
|
1456
|
-
r("update:modelValue", n.leafOnly ? t.filter((e) =>
|
|
2144
|
+
r("update:modelValue", n.leafOnly ? t.filter((e) => y.value.includes(e)) : t);
|
|
1457
2145
|
}
|
|
1458
|
-
return (t, n) => (
|
|
2146
|
+
return (t, n) => (b(), s(D(Me), {
|
|
1459
2147
|
open: i.value,
|
|
1460
2148
|
"onUpdate:open": n[3] ||= (e) => i.value = e
|
|
1461
2149
|
}, {
|
|
1462
|
-
default:
|
|
2150
|
+
default: M(() => [f(D(Ne), {
|
|
1463
2151
|
"as-child": "",
|
|
1464
2152
|
disabled: e.disabled
|
|
1465
2153
|
}, {
|
|
1466
|
-
default:
|
|
2154
|
+
default: M(() => [u("button", {
|
|
1467
2155
|
type: "button",
|
|
1468
2156
|
disabled: e.disabled,
|
|
1469
|
-
class:
|
|
1470
|
-
}, [
|
|
2157
|
+
class: g(["flex w-full items-center justify-between gap-2 rounded-md border border-border bg-surface px-3 text-start text-sm text-foreground shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 disabled:cursor-not-allowed disabled:opacity-50", e.size === "sm" ? "min-h-8 py-1 text-xs" : "min-h-9 py-1.5"])
|
|
2158
|
+
}, [x.value.length === 0 ? (b(), l("span", ri, E(e.placeholder), 1)) : (b(), l("span", ii, [(b(!0), l(a, null, C(x.value, (e) => (b(), s(cn, {
|
|
1471
2159
|
key: e.value,
|
|
1472
2160
|
tone: "secondary"
|
|
1473
2161
|
}, {
|
|
1474
|
-
default:
|
|
2162
|
+
default: M(() => [d(E(e.label ?? e.value), 1)]),
|
|
1475
2163
|
_: 2
|
|
1476
|
-
}, 1024))), 128))])), f(
|
|
2164
|
+
}, 1024))), 128))])), f(D(I), { class: "size-4 shrink-0 opacity-50" })], 10, ni)]),
|
|
1477
2165
|
_: 1
|
|
1478
|
-
}, 8, ["disabled"]), f(
|
|
2166
|
+
}, 8, ["disabled"]), f(D(je), {
|
|
1479
2167
|
"side-offset": 4,
|
|
1480
2168
|
class: "z-50 w-72 rounded-md border border-border bg-surface p-2 shadow-popover"
|
|
1481
2169
|
}, {
|
|
1482
|
-
default:
|
|
1483
|
-
e.filterable ? (
|
|
2170
|
+
default: M(() => [
|
|
2171
|
+
e.filterable ? (b(), l("div", ai, [f(D(fe), { class: "pointer-events-none absolute start-2 top-1/2 size-3.5 -translate-y-1/2 text-muted" }), N(u("input", {
|
|
1484
2172
|
"onUpdate:modelValue": n[0] ||= (e) => p.value = e,
|
|
1485
2173
|
placeholder: e.filterPlaceholder,
|
|
1486
2174
|
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:
|
|
2175
|
+
}, null, 8, oi), [[A, p.value]])])) : c("", !0),
|
|
2176
|
+
f(D(nt), {
|
|
2177
|
+
"model-value": x.value,
|
|
2178
|
+
items: h.value,
|
|
1491
2179
|
"get-key": (e) => e.value,
|
|
1492
2180
|
"get-children": (e) => e.children,
|
|
1493
2181
|
expanded: m.value,
|
|
1494
2182
|
"onUpdate:expanded": n[1] ||= (e) => m.value = e,
|
|
1495
2183
|
multiple: "",
|
|
1496
2184
|
"bubble-select": "",
|
|
1497
|
-
"onUpdate:modelValue":
|
|
2185
|
+
"onUpdate:modelValue": T
|
|
1498
2186
|
}, {
|
|
1499
|
-
default:
|
|
2187
|
+
default: M(() => [(b(!0), l(a, null, C(v.value, (e) => (b(), s(D(tt), {
|
|
1500
2188
|
key: e.key,
|
|
1501
2189
|
value: e.node,
|
|
1502
2190
|
level: e.level,
|
|
1503
2191
|
as: "div",
|
|
1504
2192
|
class: "flex items-center gap-2 rounded py-1.5 text-sm text-foreground data-[selected]:bg-surface-muted/50",
|
|
1505
|
-
style:
|
|
2193
|
+
style: _({ paddingInlineStart: `calc(0.5rem + ${(e.level - 1) * 1}rem)` })
|
|
1506
2194
|
}, {
|
|
1507
|
-
default:
|
|
1508
|
-
class:
|
|
2195
|
+
default: M(() => [u("span", {
|
|
2196
|
+
class: g(["flex size-4 shrink-0 items-center justify-center rounded border border-border", w(e.node) !== "unchecked" && "border-primary-500 bg-primary-500 text-white"]),
|
|
1509
2197
|
"aria-hidden": "true"
|
|
1510
|
-
}, [
|
|
2198
|
+
}, [w(e.node) === "checked" ? (b(), s(D(F), {
|
|
1511
2199
|
key: 0,
|
|
1512
2200
|
class: "size-3"
|
|
1513
|
-
})) :
|
|
2201
|
+
})) : w(e.node) === "indeterminate" ? (b(), l("span", si)) : c("", !0)], 2), u("span", ci, E(e.node.label ?? e.node.value), 1)]),
|
|
1514
2202
|
_: 2
|
|
1515
2203
|
}, 1032, [
|
|
1516
2204
|
"value",
|
|
@@ -1525,19 +2213,198 @@ var Bn = { class: "overflow-hidden rounded-md border border-border bg-surface" }
|
|
|
1525
2213
|
"get-children",
|
|
1526
2214
|
"expanded"
|
|
1527
2215
|
]),
|
|
1528
|
-
e.modelValue.length ? (
|
|
2216
|
+
e.modelValue.length ? (b(), l("div", li, [u("button", {
|
|
1529
2217
|
type: "button",
|
|
1530
2218
|
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
2219
|
onClick: n[2] ||= (e) => r("update:modelValue", [])
|
|
1532
|
-
}, [f(
|
|
2220
|
+
}, [f(D(z), { class: "size-3" }), n[4] ||= d("Clear ", -1)])])) : c("", !0)
|
|
1533
2221
|
]),
|
|
1534
2222
|
_: 1
|
|
1535
2223
|
})]),
|
|
1536
2224
|
_: 1
|
|
1537
2225
|
}, 8, ["open"]));
|
|
1538
2226
|
}
|
|
2227
|
+
}), $ = Symbol("myghf-toast"), di = 0;
|
|
2228
|
+
function fi(e = {}) {
|
|
2229
|
+
let t = Math.max(1, e.max ?? 4), n = e.duration ?? 5e3, r = e.position ?? "top-end", i = S([]), a = o(() => i.value.slice(0, t));
|
|
2230
|
+
function s(e) {
|
|
2231
|
+
let t = `toast-${++di}`;
|
|
2232
|
+
return i.value.push({
|
|
2233
|
+
severity: "info",
|
|
2234
|
+
position: r,
|
|
2235
|
+
duration: n,
|
|
2236
|
+
...e,
|
|
2237
|
+
id: t
|
|
2238
|
+
}), t;
|
|
2239
|
+
}
|
|
2240
|
+
function c(e) {
|
|
2241
|
+
let t = i.value.findIndex((t) => t.id === e);
|
|
2242
|
+
t !== -1 && i.value.splice(t, 1);
|
|
2243
|
+
}
|
|
2244
|
+
function l() {
|
|
2245
|
+
i.value = [];
|
|
2246
|
+
}
|
|
2247
|
+
function u(e) {
|
|
2248
|
+
return (t, n) => s({
|
|
2249
|
+
title: t,
|
|
2250
|
+
description: n,
|
|
2251
|
+
severity: e
|
|
2252
|
+
});
|
|
2253
|
+
}
|
|
2254
|
+
return {
|
|
2255
|
+
items: i,
|
|
2256
|
+
visible: a,
|
|
2257
|
+
add: s,
|
|
2258
|
+
remove: c,
|
|
2259
|
+
clear: l,
|
|
2260
|
+
info: u("info"),
|
|
2261
|
+
success: u("success"),
|
|
2262
|
+
warning: u("warning"),
|
|
2263
|
+
danger: u("danger"),
|
|
2264
|
+
secondary: u("secondary")
|
|
2265
|
+
};
|
|
2266
|
+
}
|
|
2267
|
+
function pi() {
|
|
2268
|
+
let e = m($);
|
|
2269
|
+
if (!e) throw Error("useToast() requires a <Toaster /> mounted above this component.");
|
|
2270
|
+
return e;
|
|
2271
|
+
}
|
|
2272
|
+
//#endregion
|
|
2273
|
+
//#region src/components/toast/Toast.vue?vue&type=script&setup=true&lang.ts
|
|
2274
|
+
var mi = { class: "min-w-0 flex-1" }, hi = /* @__PURE__ */ p({
|
|
2275
|
+
__name: "Toast",
|
|
2276
|
+
props: {
|
|
2277
|
+
item: {},
|
|
2278
|
+
duration: {}
|
|
2279
|
+
},
|
|
2280
|
+
emits: ["close"],
|
|
2281
|
+
setup(e, { emit: t }) {
|
|
2282
|
+
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 = {
|
|
2283
|
+
info: "info",
|
|
2284
|
+
success: "circle-check",
|
|
2285
|
+
warning: "triangle-alert",
|
|
2286
|
+
danger: "circle-alert",
|
|
2287
|
+
secondary: "info"
|
|
2288
|
+
};
|
|
2289
|
+
return (t, n) => (b(), s(D(Qe), {
|
|
2290
|
+
"default-open": !0,
|
|
2291
|
+
duration: l.value,
|
|
2292
|
+
type: a.value,
|
|
2293
|
+
"data-toast-root": "",
|
|
2294
|
+
"data-duration": l.value,
|
|
2295
|
+
class: g(["pointer-events-auto flex w-full items-start gap-3 rounded-lg p-4 text-sm shadow-popover", D(J)[i.value].soft]),
|
|
2296
|
+
"onUpdate:open": n[1] ||= (e) => !e && r("close")
|
|
2297
|
+
}, {
|
|
2298
|
+
default: M(() => [
|
|
2299
|
+
f(X, {
|
|
2300
|
+
name: e.item.icon || p[i.value],
|
|
2301
|
+
class: g(["mt-0.5 size-4 shrink-0", D(J)[i.value].icon])
|
|
2302
|
+
}, null, 8, ["name", "class"]),
|
|
2303
|
+
u("div", mi, [e.item.title ? (b(), s(D($e), {
|
|
2304
|
+
key: 0,
|
|
2305
|
+
class: "font-medium"
|
|
2306
|
+
}, {
|
|
2307
|
+
default: M(() => [d(E(e.item.title), 1)]),
|
|
2308
|
+
_: 1
|
|
2309
|
+
})) : c("", !0), e.item.description ? (b(), s(D(Xe), {
|
|
2310
|
+
key: 1,
|
|
2311
|
+
class: g(["leading-relaxed", e.item.title ? "mt-1" : ""])
|
|
2312
|
+
}, {
|
|
2313
|
+
default: M(() => [d(E(e.item.description), 1)]),
|
|
2314
|
+
_: 1
|
|
2315
|
+
}, 8, ["class"])) : c("", !0)]),
|
|
2316
|
+
e.item.action ? (b(), s(D(Je), {
|
|
2317
|
+
key: 0,
|
|
2318
|
+
"alt-text": e.item.action.label,
|
|
2319
|
+
class: "-my-1 shrink-0 rounded-md px-2 py-1 font-medium transition-colors hover:bg-black/10 dark:hover:bg-white/10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500",
|
|
2320
|
+
onClick: n[0] ||= (t) => e.item.action.onClick()
|
|
2321
|
+
}, {
|
|
2322
|
+
default: M(() => [d(E(e.item.action.label), 1)]),
|
|
2323
|
+
_: 1
|
|
2324
|
+
}, 8, ["alt-text"])) : c("", !0),
|
|
2325
|
+
e.item.closable === !1 ? c("", !0) : (b(), s(D(Ye), {
|
|
2326
|
+
key: 1,
|
|
2327
|
+
"aria-label": "Close",
|
|
2328
|
+
class: "-me-1 -mt-1 shrink-0 rounded-md p-1 transition-colors hover:bg-black/10 dark:hover:bg-white/10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500"
|
|
2329
|
+
}, {
|
|
2330
|
+
default: M(() => [f(D(z), { class: "size-4" })]),
|
|
2331
|
+
_: 1
|
|
2332
|
+
}))
|
|
2333
|
+
]),
|
|
2334
|
+
_: 1
|
|
2335
|
+
}, 8, [
|
|
2336
|
+
"duration",
|
|
2337
|
+
"type",
|
|
2338
|
+
"data-duration",
|
|
2339
|
+
"class"
|
|
2340
|
+
]));
|
|
2341
|
+
}
|
|
2342
|
+
}), gi = /* @__PURE__ */ p({
|
|
2343
|
+
__name: "Toaster",
|
|
2344
|
+
props: {
|
|
2345
|
+
position: { default: "top-end" },
|
|
2346
|
+
max: { default: 4 },
|
|
2347
|
+
duration: { default: 5e3 },
|
|
2348
|
+
gap: { default: "0.5rem" },
|
|
2349
|
+
label: { default: "Notifications" },
|
|
2350
|
+
store: {}
|
|
2351
|
+
},
|
|
2352
|
+
setup(e) {
|
|
2353
|
+
let t = e, n = t.store ?? fi({
|
|
2354
|
+
max: t.max,
|
|
2355
|
+
duration: t.duration,
|
|
2356
|
+
position: t.position
|
|
2357
|
+
});
|
|
2358
|
+
x($, n);
|
|
2359
|
+
let r = [
|
|
2360
|
+
"top-start",
|
|
2361
|
+
"top-center",
|
|
2362
|
+
"top-end",
|
|
2363
|
+
"bottom-start",
|
|
2364
|
+
"bottom-center",
|
|
2365
|
+
"bottom-end"
|
|
2366
|
+
], i = {
|
|
2367
|
+
"top-start": "top-0 start-0",
|
|
2368
|
+
"top-center": "top-0 inset-x-0 mx-auto",
|
|
2369
|
+
"top-end": "top-0 end-0",
|
|
2370
|
+
"bottom-start": "bottom-0 start-0",
|
|
2371
|
+
"bottom-center": "bottom-0 inset-x-0 mx-auto",
|
|
2372
|
+
"bottom-end": "bottom-0 end-0"
|
|
2373
|
+
};
|
|
2374
|
+
function o(e) {
|
|
2375
|
+
return n.visible.value.filter((n) => (n.position ?? t.position) === e);
|
|
2376
|
+
}
|
|
2377
|
+
return (t, u) => (b(), s(D(Ze), {
|
|
2378
|
+
label: e.label,
|
|
2379
|
+
duration: e.duration
|
|
2380
|
+
}, {
|
|
2381
|
+
default: M(() => [w(t.$slots, "default"), (b(), l(a, null, C(r, (t) => (b(), l(a, { key: t }, [o(t).length > 0 ? (b(), s(D(et), {
|
|
2382
|
+
key: 0,
|
|
2383
|
+
label: e.label,
|
|
2384
|
+
class: g(["pointer-events-none fixed z-50 flex max-h-screen w-full max-w-sm flex-col", i[t]]),
|
|
2385
|
+
style: _({ gap: e.gap })
|
|
2386
|
+
}, {
|
|
2387
|
+
default: M(() => [(b(!0), l(a, null, C(o(t), (t) => (b(), s(hi, {
|
|
2388
|
+
key: t.id,
|
|
2389
|
+
item: t,
|
|
2390
|
+
duration: e.duration,
|
|
2391
|
+
onClose: (e) => D(n).remove(t.id)
|
|
2392
|
+
}, null, 8, [
|
|
2393
|
+
"item",
|
|
2394
|
+
"duration",
|
|
2395
|
+
"onClose"
|
|
2396
|
+
]))), 128))]),
|
|
2397
|
+
_: 2
|
|
2398
|
+
}, 1032, [
|
|
2399
|
+
"label",
|
|
2400
|
+
"class",
|
|
2401
|
+
"style"
|
|
2402
|
+
])) : c("", !0)], 64))), 64))]),
|
|
2403
|
+
_: 3
|
|
2404
|
+
}, 8, ["label", "duration"]));
|
|
2405
|
+
}
|
|
1539
2406
|
});
|
|
1540
2407
|
//#endregion
|
|
1541
|
-
export {
|
|
2408
|
+
export { pn as Alert, pn as Message, Z as Button, on as Checkbox, Gr as DataTable, Hn as DatePicker, qn as Dialog, Qn as Drawer, $n as DropdownMenu, tr as DropdownMenuContent, nr as DropdownMenuItem, er as DropdownMenuTrigger, X as Icon, Kt as Input, Xt as InputNumber, an as Password, bn as Select, xn as SelectButton, gr as Table, wr as TableBody, Dr as TableCell, kr as TableEmpty, Er as TableHead, xr as TableHeader, zr as TablePagination, Q as TableRow, mn as Tabs, _n as TabsContent, hn as TabsList, gn as TabsTrigger, cn as Tag, Qt as Textarea, Vt as ThemeToggle, gi as Toaster, hr as TransferList, ui as TreeSelect, ti as TreeTable, yt as buildHourOptions, bt as buildMinuteOptions, _t as clampTime, U as cn, Lt as createTheme, fi as createToastStore, mt as dateToValue, q as formatLocalizedDate, Tt as formatLocalizedTime, xt as from12Hour, St as getFirstDayOfWeek, wt as getMonthLabel, Ct as getWeekdayLabels, Dt as mergeFormatOptions, At as resolveIconName, G as sortRange, K as to12Hour, vt as toISODate, gt as toMinutes, Et as toNumberOrNull, Ot as toPascalCase, W as toTime, $ as toastKey, J as toneClasses, zt as useTheme, pi as useToast, ht as valueToDate };
|
|
1542
2409
|
|
|
1543
2410
|
//# sourceMappingURL=index.js.map
|