tango-ui-cw 1.0.4 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +3 -3
- package/dist/index.js +1077 -1036
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx as s, jsxs as
|
|
3
|
-
import te, { useState as Z, useRef as
|
|
2
|
+
import { jsx as s, jsxs as P, Fragment as Ne } from "react/jsx-runtime";
|
|
3
|
+
import te, { useState as Z, useRef as ke, useEffect as se, useContext as Ue, createContext as He, forwardRef as Lt, useCallback as oe, useMemo as Se, useId as Wt } from "react";
|
|
4
4
|
import { createPortal as Ut } from "react-dom";
|
|
5
5
|
import t from "prop-types";
|
|
6
6
|
import { twMerge as Ht } from "tailwind-merge";
|
|
7
|
-
const
|
|
7
|
+
const et = "tango:theme", tt = "tango:themeTokens", De = "light", Zt = [
|
|
8
8
|
"primary",
|
|
9
9
|
"input-accent",
|
|
10
10
|
"modal-ok-bg",
|
|
11
11
|
"drawer-ok-bg",
|
|
12
12
|
"datepicker-confirm-bg"
|
|
13
|
-
],
|
|
14
|
-
if (!
|
|
13
|
+
], Pt = He(null), Ot = () => typeof window < "u", ot = (e, o) => {
|
|
14
|
+
if (!Ot())
|
|
15
15
|
return o;
|
|
16
16
|
try {
|
|
17
17
|
const r = window.localStorage.getItem(e);
|
|
@@ -19,69 +19,74 @@ const Qe = "tango:theme", et = "tango:themeTokens", Wt = "light", Zt = [
|
|
|
19
19
|
} catch {
|
|
20
20
|
return o;
|
|
21
21
|
}
|
|
22
|
-
},
|
|
23
|
-
if (
|
|
22
|
+
}, rt = (e, o) => {
|
|
23
|
+
if (Ot())
|
|
24
24
|
try {
|
|
25
25
|
window.localStorage.setItem(e, JSON.stringify(o));
|
|
26
26
|
} catch {
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
29
|
function Jr({ children: e }) {
|
|
30
|
-
const [o, r] = Z(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
const [o, r] = Z(De), n = ke(!1);
|
|
31
|
+
se(() => {
|
|
32
|
+
const d = ot(et, De);
|
|
33
|
+
d !== De && r(d === "dark" ? "dark" : "light"), n.current = !0;
|
|
34
|
+
}, []);
|
|
35
|
+
const [c, l] = Z(
|
|
36
|
+
() => ot(tt, {})
|
|
37
|
+
), a = ke(/* @__PURE__ */ new Set());
|
|
38
|
+
se(() => {
|
|
34
39
|
typeof document > "u" || (document.documentElement.dataset.theme = o);
|
|
35
|
-
}, [o]),
|
|
36
|
-
|
|
37
|
-
}, [o]),
|
|
40
|
+
}, [o]), se(() => {
|
|
41
|
+
n.current && rt(et, o);
|
|
42
|
+
}, [o]), se(() => {
|
|
38
43
|
if (typeof document > "u")
|
|
39
44
|
return;
|
|
40
|
-
const d = document.documentElement,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}), Object.entries(
|
|
44
|
-
w == null || w === "" ? d.style.removeProperty(`--${
|
|
45
|
-
}),
|
|
46
|
-
}, [
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
const
|
|
45
|
+
const d = document.documentElement, g = new Set(Object.keys(c));
|
|
46
|
+
a.current.forEach((v) => {
|
|
47
|
+
g.has(v) || d.style.removeProperty(`--${v}`);
|
|
48
|
+
}), Object.entries(c).forEach(([v, w]) => {
|
|
49
|
+
w == null || w === "" ? d.style.removeProperty(`--${v}`) : d.style.setProperty(`--${v}`, String(w));
|
|
50
|
+
}), a.current = g, rt(tt, c);
|
|
51
|
+
}, [c]);
|
|
52
|
+
const i = (d) => {
|
|
53
|
+
l((g) => {
|
|
54
|
+
const v = typeof d == "function" ? d(g) : d;
|
|
50
55
|
return {
|
|
51
|
-
...
|
|
52
|
-
...
|
|
56
|
+
...g,
|
|
57
|
+
...v || {}
|
|
53
58
|
};
|
|
54
59
|
});
|
|
55
|
-
},
|
|
56
|
-
|
|
57
|
-
const w = { ...
|
|
58
|
-
return
|
|
59
|
-
w[
|
|
60
|
+
}, u = (d, g = Zt) => {
|
|
61
|
+
i((v) => {
|
|
62
|
+
const w = { ...v };
|
|
63
|
+
return g.forEach((C) => {
|
|
64
|
+
w[C] = d;
|
|
60
65
|
}), w;
|
|
61
66
|
});
|
|
62
|
-
}, u = () => {
|
|
63
|
-
c({});
|
|
64
67
|
}, h = () => {
|
|
68
|
+
l({});
|
|
69
|
+
}, m = () => {
|
|
65
70
|
r((d) => d === "dark" ? "light" : "dark");
|
|
66
71
|
};
|
|
67
72
|
return /* @__PURE__ */ s(
|
|
68
|
-
|
|
73
|
+
Pt.Provider,
|
|
69
74
|
{
|
|
70
75
|
value: {
|
|
71
76
|
theme: o,
|
|
72
77
|
setTheme: r,
|
|
73
|
-
toggleTheme:
|
|
74
|
-
themeTokens:
|
|
75
|
-
setThemeTokens:
|
|
76
|
-
setThemeColor:
|
|
77
|
-
resetThemeTokens:
|
|
78
|
+
toggleTheme: m,
|
|
79
|
+
themeTokens: c,
|
|
80
|
+
setThemeTokens: i,
|
|
81
|
+
setThemeColor: u,
|
|
82
|
+
resetThemeTokens: h
|
|
78
83
|
},
|
|
79
84
|
children: e
|
|
80
85
|
}
|
|
81
86
|
);
|
|
82
87
|
}
|
|
83
88
|
function Qr() {
|
|
84
|
-
return Ue(
|
|
89
|
+
return Ue(Pt);
|
|
85
90
|
}
|
|
86
91
|
const Gt = /* @__PURE__ */ new Set([
|
|
87
92
|
"root",
|
|
@@ -90,7 +95,7 @@ const Gt = /* @__PURE__ */ new Set([
|
|
|
90
95
|
"className",
|
|
91
96
|
"css",
|
|
92
97
|
"style"
|
|
93
|
-
]),
|
|
98
|
+
]), $e = {
|
|
94
99
|
tw: "",
|
|
95
100
|
css: {}
|
|
96
101
|
}, ye = (e) => typeof e == "object" && e !== null && !Array.isArray(e), Y = (e, o = "px") => typeof e == "number" ? `${e}${o}` : e, he = (e) => typeof e == "string" && e.startsWith("$") ? `var(--${e.slice(1)})` : e, Xt = (e) => e.includes("-") ? e.replace(/-([a-z])/g, (o, r) => r.toUpperCase()) : e, qt = (e) => /(color|background|border|fill|stroke|shadow)$/i.test(e), Jt = {
|
|
@@ -364,7 +369,7 @@ const Gt = /* @__PURE__ */ new Set([
|
|
|
364
369
|
shown: (e) => {
|
|
365
370
|
e.visibility = "visible";
|
|
366
371
|
}
|
|
367
|
-
},
|
|
372
|
+
}, ze = (e = {}) => ye(e) ? Object.entries(e).reduce((o, [r, n]) => {
|
|
368
373
|
if (Gt.has(r))
|
|
369
374
|
return o;
|
|
370
375
|
const c = Jt[r];
|
|
@@ -372,20 +377,20 @@ const Gt = /* @__PURE__ */ new Set([
|
|
|
372
377
|
return c(o, n), o;
|
|
373
378
|
const l = Xt(r), a = typeof n == "string" && (n.startsWith("$") || qt(l)) ? he(n) : n;
|
|
374
379
|
return o[l] = a, o;
|
|
375
|
-
}, {}) : {},
|
|
380
|
+
}, {}) : {}, I = (...e) => {
|
|
376
381
|
const o = e.filter(Boolean).join(" ").trim();
|
|
377
382
|
return o ? Ht(o) : "";
|
|
378
|
-
},
|
|
383
|
+
}, Oe = (e) => {
|
|
379
384
|
if (typeof e == "string")
|
|
380
385
|
return { tw: e, css: {} };
|
|
381
386
|
if (!ye(e))
|
|
382
|
-
return {
|
|
387
|
+
return { ...$e };
|
|
383
388
|
if (!("tw" in e || "className" in e || "css" in e || "style" in e))
|
|
384
389
|
return {
|
|
385
390
|
tw: "",
|
|
386
|
-
css:
|
|
391
|
+
css: ze(e)
|
|
387
392
|
};
|
|
388
|
-
const r = [e.className, e.tw].filter(Boolean).join(" "), n = ye(e.css) ?
|
|
393
|
+
const r = [e.className, e.tw].filter(Boolean).join(" "), n = ye(e.css) ? ze(e.css) : {}, c = ye(e.style) ? ze(e.style) : {};
|
|
389
394
|
return {
|
|
390
395
|
tw: r,
|
|
391
396
|
css: {
|
|
@@ -396,23 +401,23 @@ const Gt = /* @__PURE__ */ new Set([
|
|
|
396
401
|
}, Qt = (e, o) => ye(e) ? "root" in e || "slots" in e || "tw" in e || "className" in e || "css" in e || "style" in e ? !0 : o.some((r) => r !== "root" && r in e) : !1, eo = (e) => {
|
|
397
402
|
const o = {};
|
|
398
403
|
return e.forEach((r) => {
|
|
399
|
-
o[r] = {
|
|
400
|
-
}), o.root || (o.root = {
|
|
401
|
-
},
|
|
404
|
+
o[r] = { ...$e };
|
|
405
|
+
}), o.root || (o.root = { ...$e }), o;
|
|
406
|
+
}, H = (e, o = ["root"]) => {
|
|
402
407
|
const r = eo(o);
|
|
403
408
|
if (typeof e == "string")
|
|
404
409
|
return r.root.tw = e, r;
|
|
405
410
|
if (!ye(e))
|
|
406
411
|
return r;
|
|
407
412
|
if (!Qt(e, o))
|
|
408
|
-
return r.root.css =
|
|
409
|
-
const n =
|
|
413
|
+
return r.root.css = ze(e), r;
|
|
414
|
+
const n = Oe({
|
|
410
415
|
tw: [e.className, e.tw].filter(Boolean).join(" "),
|
|
411
416
|
css: e.css,
|
|
412
417
|
style: e.style
|
|
413
|
-
}), c =
|
|
418
|
+
}), c = Oe(e.root);
|
|
414
419
|
r.root = {
|
|
415
|
-
tw:
|
|
420
|
+
tw: I(n.tw, c.tw),
|
|
416
421
|
css: {
|
|
417
422
|
...n.css,
|
|
418
423
|
...c.css
|
|
@@ -422,9 +427,9 @@ const Gt = /* @__PURE__ */ new Set([
|
|
|
422
427
|
return Object.keys(r).forEach((a) => {
|
|
423
428
|
if (a === "root")
|
|
424
429
|
return;
|
|
425
|
-
const i =
|
|
430
|
+
const i = Oe(e[a]), u = Oe(l[a]);
|
|
426
431
|
r[a] = {
|
|
427
|
-
tw:
|
|
432
|
+
tw: I(i.tw, u.tw),
|
|
428
433
|
css: {
|
|
429
434
|
...i.css,
|
|
430
435
|
...u.css
|
|
@@ -436,19 +441,19 @@ const Gt = /* @__PURE__ */ new Set([
|
|
|
436
441
|
className: o = "",
|
|
437
442
|
baseStyle: r = {},
|
|
438
443
|
style: n = {},
|
|
439
|
-
sxSlot: c =
|
|
444
|
+
sxSlot: c = $e
|
|
440
445
|
} = {}) => ({
|
|
441
|
-
className:
|
|
446
|
+
className: I(e, o, c.tw),
|
|
442
447
|
style: {
|
|
443
448
|
...r || {},
|
|
444
449
|
...c.css || {},
|
|
445
450
|
...n || {}
|
|
446
451
|
}
|
|
447
|
-
}), to = ["root", "icon", "content"],
|
|
452
|
+
}), to = ["root", "icon", "content"], st = {
|
|
448
453
|
success: "text-[var(--notice-success-text)]",
|
|
449
454
|
fail: "text-[var(--notice-fail-text)]",
|
|
450
455
|
caution: "text-[var(--notice-caution-text)]"
|
|
451
|
-
},
|
|
456
|
+
}, at = {
|
|
452
457
|
default: {
|
|
453
458
|
base: "fixed top-5 left-1/2 -translate-x-1/2",
|
|
454
459
|
enter: "animate-[noticeSlideDown_0.3s_cubic-bezier(0.22,1,0.36,1)_forwards]"
|
|
@@ -468,47 +473,47 @@ function oo(e, o) {
|
|
|
468
473
|
onClose: i,
|
|
469
474
|
sx: u = {},
|
|
470
475
|
style: h = {},
|
|
471
|
-
className:
|
|
472
|
-
...
|
|
473
|
-
} = e, [
|
|
474
|
-
|
|
475
|
-
const
|
|
476
|
-
return () => clearTimeout(
|
|
476
|
+
className: m = "",
|
|
477
|
+
...d
|
|
478
|
+
} = e, [g, v] = Z(!1), w = st[r] ? r : "success", C = at[l] ? l : "default", F = H(u, to), O = oe(() => {
|
|
479
|
+
v(!0);
|
|
480
|
+
const _ = setTimeout(() => i == null ? void 0 : i(), 300);
|
|
481
|
+
return () => clearTimeout(_);
|
|
477
482
|
}, [i]);
|
|
478
|
-
|
|
483
|
+
se(() => {
|
|
479
484
|
if (!i || a <= 0) return;
|
|
480
|
-
const
|
|
481
|
-
return () => clearTimeout(
|
|
482
|
-
}, [i, a,
|
|
483
|
-
const
|
|
484
|
-
baseClassName:
|
|
485
|
+
const _ = setTimeout(O, a);
|
|
486
|
+
return () => clearTimeout(_);
|
|
487
|
+
}, [i, a, O]);
|
|
488
|
+
const y = at[C], x = C === "default" ? "animate-[noticeSlideUpFade_0.3s_ease-in_forwards]" : "animate-[noticeSlideToBottom_0.3s_ease-in_forwards]", T = b({
|
|
489
|
+
baseClassName: I(
|
|
485
490
|
"inline-flex items-center gap-2 px-3 py-2 text-sm z-[999]",
|
|
486
491
|
"rounded-[var(--notice-radius)]",
|
|
487
492
|
"bg-[var(--notice-bg)] text-[var(--notice-foreground)]",
|
|
488
493
|
"shadow-[var(--notice-shadow)]",
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
494
|
+
y.base,
|
|
495
|
+
g ? x : y.enter,
|
|
496
|
+
C === "md" && st[w]
|
|
492
497
|
),
|
|
493
|
-
className:
|
|
494
|
-
sxSlot:
|
|
498
|
+
className: m,
|
|
499
|
+
sxSlot: F.root,
|
|
495
500
|
baseStyle: { borderRadius: "var(--notice-radius)" },
|
|
496
501
|
style: h
|
|
497
|
-
}),
|
|
502
|
+
}), p = b({
|
|
498
503
|
baseClassName: "flex-shrink-0 text-[var(--notice-foreground)]",
|
|
499
|
-
sxSlot:
|
|
500
|
-
}),
|
|
504
|
+
sxSlot: F.icon
|
|
505
|
+
}), S = b({
|
|
501
506
|
baseClassName: "inline-block",
|
|
502
|
-
sxSlot:
|
|
507
|
+
sxSlot: F.content
|
|
503
508
|
});
|
|
504
|
-
return /* @__PURE__ */
|
|
505
|
-
|
|
506
|
-
/* @__PURE__ */ s("span", { className:
|
|
509
|
+
return /* @__PURE__ */ P("div", { ref: o, role: "alert", className: T.className, style: T.style, ...d, children: [
|
|
510
|
+
C !== "md" && n && /* @__PURE__ */ s("span", { className: p.className, style: p.style, children: n }),
|
|
511
|
+
/* @__PURE__ */ s("span", { className: S.className, style: S.style, children: c })
|
|
507
512
|
] });
|
|
508
513
|
}
|
|
509
|
-
const
|
|
510
|
-
|
|
511
|
-
|
|
514
|
+
const Ze = Lt(oo);
|
|
515
|
+
Ze.displayName = "Notice";
|
|
516
|
+
Ze.propTypes = {
|
|
512
517
|
type: t.oneOf(["success", "fail", "caution"]),
|
|
513
518
|
icon: t.node,
|
|
514
519
|
message: t.node,
|
|
@@ -519,7 +524,7 @@ We.propTypes = {
|
|
|
519
524
|
style: t.object,
|
|
520
525
|
className: t.string
|
|
521
526
|
};
|
|
522
|
-
const
|
|
527
|
+
const _t = He(null), ro = /* @__PURE__ */ s("svg", { viewBox: "0 0 1024 1024", width: "1.2em", height: "1.2em", children: /* @__PURE__ */ s(
|
|
523
528
|
"path",
|
|
524
529
|
{
|
|
525
530
|
d: "M874.119618 149.859922A510.816461 510.816461 0 0 0 511.997 0.00208a509.910462 509.910462 0 0 0-362.119618 149.857842c-199.817789 199.679789-199.817789 524.581447 0 724.260236a509.969462 509.969462 0 0 0 362.119618 149.857842A508.872463 508.872463 0 0 0 874.119618 874.120158c199.836789-199.679789 199.836789-524.581447 0-724.260236zM814.94268 378.210681L470.999043 744.132295a15.359984 15.359984 0 0 1-5.887994 4.095996c-1.751998 1.180999-2.913997 2.362998-5.276994 2.913997a34.499964 34.499964 0 0 1-13.469986 2.914997 45.547952 45.547952 0 0 1-12.897986-2.303998l-4.095996-2.363997a45.291952 45.291952 0 0 1-7.009992-4.095996l-196.902793-193.789796a34.126964 34.126964 0 0 1-10.555989-25.186973c0-9.37399 3.583996-18.74698 9.98399-25.186974a36.429962 36.429962 0 0 1 50.372947 0l169.98382 167.423824L763.389735 330.220732a37.059961 37.059961 0 0 1 50.371947-1.732998 33.647965 33.647965 0 0 1 11.165988 25.186973 35.544963 35.544963 0 0 1-9.98399 24.575974v-0.04z m0 0",
|
|
@@ -531,7 +536,7 @@ const Ot = He(null), ro = /* @__PURE__ */ s("svg", { viewBox: "0 0 1024 1024", w
|
|
|
531
536
|
d: "M549.044706 512l166.189176-166.249412a26.383059 26.383059 0 0 0 0-36.98447 26.383059 26.383059 0 0 0-37.044706 0L512 475.015529l-166.249412-166.249411a26.383059 26.383059 0 0 0-36.98447 0 26.383059 26.383059 0 0 0 0 37.044706L475.015529 512l-166.249411 166.249412a26.383059 26.383059 0 0 0 0 36.98447 26.383059 26.383059 0 0 0 37.044706 0L512 548.984471l166.249412 166.249411a26.383059 26.383059 0 0 0 36.98447 0 26.383059 26.383059 0 0 0 0-37.044706L548.984471 512zM512 1024a512 512 0 1 1 0-1024 512 512 0 0 1 0 1024z",
|
|
532
537
|
fill: "var(--notice-fail-text)"
|
|
533
538
|
}
|
|
534
|
-
) }), ao = /* @__PURE__ */
|
|
539
|
+
) }), ao = /* @__PURE__ */ P("svg", { viewBox: "0 0 1024 1024", width: "1.2em", height: "1.2em", children: [
|
|
535
540
|
/* @__PURE__ */ s(
|
|
536
541
|
"path",
|
|
537
542
|
{
|
|
@@ -556,28 +561,28 @@ const Ot = He(null), ro = /* @__PURE__ */ s("svg", { viewBox: "0 0 1024 1024", w
|
|
|
556
561
|
] }), no = { success: ro, fail: so, caution: ao };
|
|
557
562
|
function es({ children: e }) {
|
|
558
563
|
const [o, r] = Z([]), [n, c] = Z(!1);
|
|
559
|
-
|
|
564
|
+
se(() => {
|
|
560
565
|
c(!0);
|
|
561
566
|
}, []);
|
|
562
567
|
const l = oe((i) => {
|
|
563
568
|
r((u) => u.filter((h) => h.id !== i));
|
|
564
569
|
}, []), a = oe((i, u, h = "default") => {
|
|
565
|
-
const
|
|
566
|
-
r((
|
|
567
|
-
...
|
|
568
|
-
{ id:
|
|
570
|
+
const m = Date.now() + Math.random();
|
|
571
|
+
r((d) => [
|
|
572
|
+
...d,
|
|
573
|
+
{ id: m, type: i, message: u, variant: h, icon: no[i] }
|
|
569
574
|
]);
|
|
570
575
|
}, []);
|
|
571
|
-
return /* @__PURE__ */
|
|
576
|
+
return /* @__PURE__ */ P(_t.Provider, { value: { add: a, remove: l }, children: [
|
|
572
577
|
e,
|
|
573
578
|
n && Ut(
|
|
574
|
-
/* @__PURE__ */ s("div", { id: "notification-container", className: "flex flex-col items-center gap-2", children: o.map((i) => /* @__PURE__ */ s(
|
|
579
|
+
/* @__PURE__ */ s("div", { id: "notification-container", className: "flex flex-col items-center gap-2", children: o.map((i) => /* @__PURE__ */ s(Ze, { ...i, onClose: () => l(i.id) }, i.id)) }),
|
|
575
580
|
document.body
|
|
576
581
|
)
|
|
577
582
|
] });
|
|
578
583
|
}
|
|
579
584
|
function lo() {
|
|
580
|
-
const e = Ue(
|
|
585
|
+
const e = Ue(_t);
|
|
581
586
|
if (!e)
|
|
582
587
|
throw new Error("useNotice must be used inside <NoticeProvider />");
|
|
583
588
|
return e;
|
|
@@ -595,7 +600,7 @@ function ts() {
|
|
|
595
600
|
}
|
|
596
601
|
};
|
|
597
602
|
}
|
|
598
|
-
const
|
|
603
|
+
const At = "tango:locale", xe = "zh-CN", co = {
|
|
599
604
|
zh: "zh-CN",
|
|
600
605
|
ZH: "zh-CN",
|
|
601
606
|
"zh-CN": "zh-CN",
|
|
@@ -608,7 +613,7 @@ const _t = "tango:locale", xe = "zh-CN", co = {
|
|
|
608
613
|
"en-us": "en-US",
|
|
609
614
|
us: "en-US",
|
|
610
615
|
US: "en-US"
|
|
611
|
-
},
|
|
616
|
+
}, Mt = {
|
|
612
617
|
"zh-CN": {
|
|
613
618
|
button: {
|
|
614
619
|
default: "按钮",
|
|
@@ -775,27 +780,27 @@ const _t = "tango:locale", xe = "zh-CN", co = {
|
|
|
775
780
|
perPage: "/ page"
|
|
776
781
|
}
|
|
777
782
|
}
|
|
778
|
-
},
|
|
779
|
-
},
|
|
783
|
+
}, We = () => {
|
|
784
|
+
}, zt = He({
|
|
780
785
|
locale: xe,
|
|
781
|
-
setLocale:
|
|
782
|
-
toggleLocale:
|
|
783
|
-
messages:
|
|
786
|
+
setLocale: We,
|
|
787
|
+
toggleLocale: We,
|
|
788
|
+
messages: Mt,
|
|
784
789
|
t: (e, o = "") => o
|
|
785
|
-
}),
|
|
790
|
+
}), nt = (e) => typeof e == "object" && e !== null && !Array.isArray(e), Et = (e, o) => {
|
|
786
791
|
const r = { ...e };
|
|
787
792
|
return Object.entries(o || {}).forEach(([n, c]) => {
|
|
788
|
-
|
|
793
|
+
nt(c) && nt(r[n]) ? r[n] = Et(r[n], c) : r[n] = c;
|
|
789
794
|
}), r;
|
|
790
795
|
}, io = (e, o) => o.split(".").reduce((r, n) => {
|
|
791
796
|
if (r && Object.prototype.hasOwnProperty.call(r, n))
|
|
792
797
|
return r[n];
|
|
793
|
-
}, e),
|
|
798
|
+
}, e), Ee = (e) => typeof e != "string" || !e.trim() ? xe : co[e] || e, uo = () => {
|
|
794
799
|
if (typeof window > "u")
|
|
795
800
|
return xe;
|
|
796
801
|
try {
|
|
797
|
-
const e = window.localStorage.getItem(
|
|
798
|
-
return
|
|
802
|
+
const e = window.localStorage.getItem(At);
|
|
803
|
+
return Ee(e || xe);
|
|
799
804
|
} catch {
|
|
800
805
|
return xe;
|
|
801
806
|
}
|
|
@@ -804,49 +809,49 @@ function os({
|
|
|
804
809
|
children: e,
|
|
805
810
|
locale: o,
|
|
806
811
|
defaultLocale: r = xe,
|
|
807
|
-
onLocaleChange: n =
|
|
812
|
+
onLocaleChange: n = We,
|
|
808
813
|
messages: c = {}
|
|
809
814
|
}) {
|
|
810
|
-
const l =
|
|
815
|
+
const l = Ee(r), a = o == null ? null : Ee(o), [i, u] = Z(
|
|
811
816
|
() => uo() || l
|
|
812
|
-
), h = a || i,
|
|
813
|
-
const
|
|
814
|
-
a == null && u(
|
|
817
|
+
), h = a || i, m = (w) => {
|
|
818
|
+
const C = Ee(w);
|
|
819
|
+
a == null && u(C), n(C);
|
|
815
820
|
};
|
|
816
|
-
|
|
821
|
+
se(() => {
|
|
817
822
|
if (!(typeof window > "u"))
|
|
818
823
|
try {
|
|
819
|
-
window.localStorage.setItem(
|
|
824
|
+
window.localStorage.setItem(At, h);
|
|
820
825
|
} catch {
|
|
821
826
|
}
|
|
822
827
|
}, [h]);
|
|
823
|
-
const
|
|
824
|
-
() =>
|
|
828
|
+
const d = Se(
|
|
829
|
+
() => Et(Mt, c),
|
|
825
830
|
[c]
|
|
826
|
-
),
|
|
827
|
-
|
|
828
|
-
},
|
|
829
|
-
const
|
|
830
|
-
return
|
|
831
|
+
), g = () => {
|
|
832
|
+
m(h === "zh-CN" ? "en-US" : "zh-CN");
|
|
833
|
+
}, v = (w, C = "") => {
|
|
834
|
+
const F = d[h] || d[xe] || {}, O = io(F, w);
|
|
835
|
+
return O == null || O === "" ? C : String(O);
|
|
831
836
|
};
|
|
832
837
|
return /* @__PURE__ */ s(
|
|
833
|
-
|
|
838
|
+
zt.Provider,
|
|
834
839
|
{
|
|
835
840
|
value: {
|
|
836
841
|
locale: h,
|
|
837
|
-
setLocale:
|
|
838
|
-
toggleLocale:
|
|
839
|
-
messages:
|
|
840
|
-
t:
|
|
842
|
+
setLocale: m,
|
|
843
|
+
toggleLocale: g,
|
|
844
|
+
messages: d,
|
|
845
|
+
t: v
|
|
841
846
|
},
|
|
842
847
|
children: e
|
|
843
848
|
}
|
|
844
849
|
);
|
|
845
850
|
}
|
|
846
851
|
function de() {
|
|
847
|
-
return Ue(
|
|
852
|
+
return Ue(zt);
|
|
848
853
|
}
|
|
849
|
-
const po = "
|
|
854
|
+
const po = "_materialBtn_y97j8_8", mo = "_materialBtnSmall_y97j8_27", bo = "_materialBtnMedium_y97j8_33", go = "_materialBtnLarge_y97j8_39", fo = "_materialBtnHuge_y97j8_45", ho = "_materialBtnDisabled_y97j8_52", yo = "_ripple_y97j8_60", Ce = {
|
|
850
855
|
materialBtn: po,
|
|
851
856
|
materialBtnSmall: mo,
|
|
852
857
|
materialBtnMedium: bo,
|
|
@@ -854,59 +859,77 @@ const po = "_materialBtn_wlueu_4", mo = "_materialBtnSmall_wlueu_26", bo = "_mat
|
|
|
854
859
|
materialBtnHuge: fo,
|
|
855
860
|
materialBtnDisabled: ho,
|
|
856
861
|
ripple: yo
|
|
857
|
-
},
|
|
862
|
+
}, lt = ["root", "content", "icon", "loading"], xo = { small: "small", medium: "medium", large: "large", huge: "huge" }, vo = { small: 12, medium: 14, large: 16, huge: 20 }, ct = {
|
|
858
863
|
default: {
|
|
859
864
|
backgroundColor: "var(--primary)",
|
|
860
865
|
color: "var(--primary-foreground)",
|
|
861
|
-
borderColor: "var(--border)"
|
|
866
|
+
borderColor: "var(--border)",
|
|
867
|
+
borderWidth: "1px",
|
|
868
|
+
borderStyle: "solid"
|
|
862
869
|
},
|
|
863
870
|
transparent: {
|
|
864
871
|
backgroundColor: "var(--transparent)",
|
|
865
872
|
color: "var(--primary-foreground)",
|
|
866
|
-
borderColor: "var(--button-transparent-border)"
|
|
873
|
+
borderColor: "var(--button-transparent-border)",
|
|
874
|
+
borderWidth: "1px",
|
|
875
|
+
borderStyle: "solid"
|
|
867
876
|
},
|
|
868
877
|
danger: {
|
|
869
878
|
backgroundColor: "var(--destructive)",
|
|
870
879
|
color: "var(--destructive-foreground)",
|
|
871
|
-
borderColor: "transparent"
|
|
880
|
+
borderColor: "transparent",
|
|
881
|
+
borderWidth: "1px",
|
|
882
|
+
borderStyle: "solid"
|
|
872
883
|
},
|
|
873
884
|
success: {
|
|
874
885
|
backgroundColor: "var(--success)",
|
|
875
886
|
color: "var(--success-foreground)",
|
|
876
|
-
borderColor: "transparent"
|
|
887
|
+
borderColor: "transparent",
|
|
888
|
+
borderWidth: "1px",
|
|
889
|
+
borderStyle: "solid"
|
|
877
890
|
}
|
|
878
891
|
}, So = {
|
|
879
892
|
default: {
|
|
880
893
|
backgroundColor: "var(--transparent)",
|
|
881
894
|
color: "var(--button-outline-foreground)",
|
|
882
|
-
borderColor: "var(--border)"
|
|
895
|
+
borderColor: "var(--border)",
|
|
896
|
+
borderWidth: "1px",
|
|
897
|
+
borderStyle: "solid"
|
|
883
898
|
},
|
|
884
899
|
transparent: {
|
|
885
900
|
backgroundColor: "var(--transparent)",
|
|
886
901
|
color: "var(--button-outline-foreground)",
|
|
887
|
-
borderColor: "var(--button-transparent-border)"
|
|
902
|
+
borderColor: "var(--button-transparent-border)",
|
|
903
|
+
borderWidth: "1px",
|
|
904
|
+
borderStyle: "solid"
|
|
888
905
|
},
|
|
889
906
|
danger: {
|
|
890
907
|
backgroundColor: "var(--transparent)",
|
|
891
908
|
color: "var(--destructive)",
|
|
892
|
-
borderColor: "var(--destructive)"
|
|
909
|
+
borderColor: "var(--destructive)",
|
|
910
|
+
borderWidth: "1px",
|
|
911
|
+
borderStyle: "solid"
|
|
893
912
|
},
|
|
894
913
|
success: {
|
|
895
914
|
backgroundColor: "var(--transparent)",
|
|
896
915
|
color: "var(--success)",
|
|
897
|
-
borderColor: "var(--success)"
|
|
916
|
+
borderColor: "var(--success)",
|
|
917
|
+
borderWidth: "1px",
|
|
918
|
+
borderStyle: "solid"
|
|
898
919
|
}
|
|
899
920
|
}, No = {
|
|
900
921
|
backgroundColor: "var(--muted)",
|
|
901
922
|
color: "var(--muted-foreground)",
|
|
902
923
|
borderColor: "transparent",
|
|
924
|
+
borderWidth: "1px",
|
|
925
|
+
borderStyle: "solid",
|
|
903
926
|
cursor: "not-allowed"
|
|
904
|
-
},
|
|
927
|
+
}, Re = {
|
|
905
928
|
default: "按钮",
|
|
906
929
|
loading: "加载中",
|
|
907
930
|
iconAlt: "图标"
|
|
908
|
-
}, wo = (e) => e.charAt(0).toUpperCase() + e.slice(1), Co = (e) => e === !0 || e === "light" || e === "dark" ? !0 : Array.isArray(e) && e.length > 0 ? e[0] === !0 || e[0] === "light" || e[0] === "dark" : !1, To = (e) => e === "light" ? "light" : e === "dark" || e === !0 || Array.isArray(e) && e.length >= 2 && e[1] === "dark" ? "dark" : "light",
|
|
909
|
-
function
|
|
931
|
+
}, wo = (e) => e.charAt(0).toUpperCase() + e.slice(1), Co = (e) => e === !0 || e === "light" || e === "dark" ? !0 : Array.isArray(e) && e.length > 0 ? e[0] === !0 || e[0] === "light" || e[0] === "dark" : !1, To = (e) => e === "light" ? "light" : e === "dark" || e === !0 || Array.isArray(e) && e.length >= 2 && e[1] === "dark" ? "dark" : "light", it = (e, o, r) => Object.prototype.hasOwnProperty.call(r, e) ? e : o;
|
|
932
|
+
function Ge(e) {
|
|
910
933
|
const {
|
|
911
934
|
type: o = "default",
|
|
912
935
|
size: r = "medium",
|
|
@@ -918,83 +941,83 @@ function Ze(e) {
|
|
|
918
941
|
children: i,
|
|
919
942
|
disabled: u = !1,
|
|
920
943
|
outline: h = !1,
|
|
921
|
-
icon:
|
|
922
|
-
iconPosition:
|
|
923
|
-
loading:
|
|
924
|
-
i18nKey:
|
|
925
|
-
localeText:
|
|
926
|
-
rippleColor:
|
|
927
|
-
"aria-label":
|
|
928
|
-
...
|
|
929
|
-
} = e, { t:
|
|
930
|
-
default:
|
|
931
|
-
loading:
|
|
932
|
-
iconAlt:
|
|
933
|
-
...
|
|
934
|
-
},
|
|
944
|
+
icon: m = null,
|
|
945
|
+
iconPosition: d = null,
|
|
946
|
+
loading: g = !1,
|
|
947
|
+
i18nKey: v = null,
|
|
948
|
+
localeText: w = {},
|
|
949
|
+
rippleColor: C,
|
|
950
|
+
"aria-label": F,
|
|
951
|
+
...O
|
|
952
|
+
} = e, { t: y } = de(), x = ke(null), T = it(r, "medium", xo), p = it(o, "default", ct), S = Co(g), _ = To(g), M = u || S, B = vo[T], A = d === "right" ? "right" : m || S ? "left" : null, k = C ?? "var(--material-button-ripple)", N = {
|
|
953
|
+
default: y("materialButton.default", Re.default),
|
|
954
|
+
loading: y("materialButton.loading", Re.loading),
|
|
955
|
+
iconAlt: y("materialButton.iconAlt", Re.iconAlt),
|
|
956
|
+
...w
|
|
957
|
+
}, W = (v && typeof N[v] == "string" ? N[v] : null) || (v ? y(`materialButton.${v}`, N.default) : N.default), D = S ? N.loading : W, E = i ?? D, $ = F || (i == null ? String(E || N.default) : void 0), z = H(n, lt), U = M ? No : h ? So[p] : ct[p], K = Ce[`materialBtn${wo(T)}`], G = z.root.css || {}, R = typeof n == "string" ? n : "", Q = /* @__PURE__ */ new Set([...lt, "root", "slots", "tw", "className", "css", "style"]), ue = typeof n == "object" ? Object.fromEntries(Object.entries(n).filter(([re]) => !Q.has(re))) : {}, be = [
|
|
935
958
|
Ce.materialBtn,
|
|
936
959
|
K,
|
|
937
|
-
|
|
938
|
-
|
|
960
|
+
M && Ce.materialBtnDisabled,
|
|
961
|
+
z.root.tw,
|
|
939
962
|
R,
|
|
940
963
|
l
|
|
941
964
|
].filter(Boolean).join(" "), ge = {
|
|
942
|
-
...
|
|
965
|
+
...U,
|
|
943
966
|
...ue,
|
|
944
967
|
...G,
|
|
945
968
|
...c
|
|
946
969
|
}, fe = b({
|
|
947
970
|
baseClassName: "inline-flex items-center relative z-[1]",
|
|
948
|
-
sxSlot:
|
|
971
|
+
sxSlot: z.content
|
|
949
972
|
}), X = b({
|
|
950
973
|
baseClassName: "inline-flex items-center justify-center shrink-0 transition-all duration-300 relative z-[1]",
|
|
951
|
-
baseStyle: { width: `${
|
|
952
|
-
sxSlot:
|
|
974
|
+
baseStyle: { width: `${B}px`, height: `${B}px` },
|
|
975
|
+
sxSlot: z.icon
|
|
953
976
|
}), J = b({
|
|
954
977
|
baseClassName: "inline-flex items-center justify-center shrink-0 animate-spin relative z-[1]",
|
|
955
978
|
baseStyle: {
|
|
956
|
-
width: `${
|
|
957
|
-
height: `${
|
|
958
|
-
color:
|
|
979
|
+
width: `${B}px`,
|
|
980
|
+
height: `${B}px`,
|
|
981
|
+
color: _ === "light" ? "var(--button-loading-light)" : "var(--button-loading-dark)"
|
|
959
982
|
},
|
|
960
|
-
sxSlot:
|
|
961
|
-
}),
|
|
983
|
+
sxSlot: z.loading
|
|
984
|
+
}), j = oe(
|
|
962
985
|
(re) => {
|
|
963
|
-
if (
|
|
964
|
-
const
|
|
965
|
-
if (!
|
|
966
|
-
const
|
|
967
|
-
Object.assign(
|
|
986
|
+
if (M) return;
|
|
987
|
+
const ae = x.current;
|
|
988
|
+
if (!ae) return;
|
|
989
|
+
const f = document.createElement("span"), V = Math.max(ae.clientWidth, ae.clientHeight), ee = V / 2;
|
|
990
|
+
Object.assign(f.style, {
|
|
968
991
|
width: `${V}px`,
|
|
969
992
|
height: `${V}px`,
|
|
970
|
-
left: `${re.clientX -
|
|
971
|
-
top: `${re.clientY -
|
|
972
|
-
}),
|
|
973
|
-
const ce =
|
|
974
|
-
ce && ce.remove(),
|
|
993
|
+
left: `${re.clientX - ae.getBoundingClientRect().left - ee}px`,
|
|
994
|
+
top: `${re.clientY - ae.getBoundingClientRect().top - ee}px`
|
|
995
|
+
}), f.className = Ce.ripple, f.style.background = k;
|
|
996
|
+
const ce = ae.querySelector(`.${Ce.ripple}`);
|
|
997
|
+
ce && ce.remove(), ae.appendChild(f);
|
|
975
998
|
},
|
|
976
|
-
[
|
|
977
|
-
), q = () =>
|
|
999
|
+
[M, k]
|
|
1000
|
+
), q = () => m ? typeof m == "string" ? /* @__PURE__ */ s(
|
|
978
1001
|
"img",
|
|
979
1002
|
{
|
|
980
|
-
src:
|
|
1003
|
+
src: m,
|
|
981
1004
|
alt: N.iconAlt,
|
|
982
1005
|
className: X.className,
|
|
983
1006
|
style: X.style,
|
|
984
1007
|
"aria-hidden": "true"
|
|
985
1008
|
}
|
|
986
|
-
) : te.isValidElement(
|
|
987
|
-
className:
|
|
988
|
-
style: { ...X.style, ...
|
|
1009
|
+
) : te.isValidElement(m) ? te.cloneElement(m, {
|
|
1010
|
+
className: I(X.className, m.props.className),
|
|
1011
|
+
style: { ...X.style, ...m.props.style },
|
|
989
1012
|
"aria-hidden": !0
|
|
990
|
-
}) : typeof
|
|
991
|
-
|
|
1013
|
+
}) : typeof m == "function" ? /* @__PURE__ */ s(
|
|
1014
|
+
m,
|
|
992
1015
|
{
|
|
993
1016
|
className: X.className,
|
|
994
1017
|
style: X.style,
|
|
995
1018
|
"aria-hidden": "true"
|
|
996
1019
|
}
|
|
997
|
-
) : /* @__PURE__ */ s("span", { className: X.className, style: X.style, "aria-hidden": "true", children:
|
|
1020
|
+
) : /* @__PURE__ */ s("span", { className: X.className, style: X.style, "aria-hidden": "true", children: m }) : null, le = () => /* @__PURE__ */ s(
|
|
998
1021
|
"svg",
|
|
999
1022
|
{
|
|
1000
1023
|
viewBox: "0 0 1024 1024",
|
|
@@ -1011,36 +1034,36 @@ function Ze(e) {
|
|
|
1011
1034
|
)
|
|
1012
1035
|
}
|
|
1013
1036
|
);
|
|
1014
|
-
return /* @__PURE__ */
|
|
1037
|
+
return /* @__PURE__ */ P(
|
|
1015
1038
|
"button",
|
|
1016
1039
|
{
|
|
1017
1040
|
ref: x,
|
|
1018
1041
|
className: be,
|
|
1019
1042
|
style: ge,
|
|
1020
1043
|
onClick: (re) => {
|
|
1021
|
-
|
|
1044
|
+
j(re), a == null || a(re);
|
|
1022
1045
|
},
|
|
1023
|
-
disabled:
|
|
1024
|
-
"aria-label":
|
|
1025
|
-
"data-variant":
|
|
1026
|
-
"data-size":
|
|
1027
|
-
"data-icon-position":
|
|
1028
|
-
...
|
|
1046
|
+
disabled: M,
|
|
1047
|
+
"aria-label": $,
|
|
1048
|
+
"data-variant": p,
|
|
1049
|
+
"data-size": T,
|
|
1050
|
+
"data-icon-position": A || void 0,
|
|
1051
|
+
...O,
|
|
1029
1052
|
children: [
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
!
|
|
1053
|
+
A === "left" && /* @__PURE__ */ P(Ne, { children: [
|
|
1054
|
+
S && le(),
|
|
1055
|
+
!S && m && q()
|
|
1033
1056
|
] }),
|
|
1034
|
-
/* @__PURE__ */ s("span", { className: fe.className, style: fe.style, children:
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
!
|
|
1057
|
+
/* @__PURE__ */ s("span", { className: fe.className, style: fe.style, children: E }),
|
|
1058
|
+
A === "right" && /* @__PURE__ */ P(Ne, { children: [
|
|
1059
|
+
S && le(),
|
|
1060
|
+
!S && m && q()
|
|
1038
1061
|
] })
|
|
1039
1062
|
]
|
|
1040
1063
|
}
|
|
1041
1064
|
);
|
|
1042
1065
|
}
|
|
1043
|
-
|
|
1066
|
+
Ge.propTypes = {
|
|
1044
1067
|
type: t.oneOf(["default", "transparent", "danger", "success"]),
|
|
1045
1068
|
size: t.oneOf(["small", "medium", "large", "huge"]),
|
|
1046
1069
|
sx: t.oneOfType([t.object, t.string]),
|
|
@@ -1065,11 +1088,11 @@ Ze.propTypes = {
|
|
|
1065
1088
|
localeText: t.object,
|
|
1066
1089
|
rippleColor: t.string
|
|
1067
1090
|
};
|
|
1068
|
-
const ko = ["root", "content", "icon", "loading"],
|
|
1091
|
+
const ko = ["root", "content", "icon", "loading"], Ve = {
|
|
1069
1092
|
default: "按钮",
|
|
1070
1093
|
loading: "加载中",
|
|
1071
1094
|
iconAlt: "图标"
|
|
1072
|
-
}, Lo = "inline-flex select-none items-center justify-center whitespace-nowrap rounded-[var(--radius)] border align-middle font-medium tracking-[0.5px] transition-all duration-300 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--input-accent)] focus-visible:ring-offset-2",
|
|
1095
|
+
}, Lo = "inline-flex select-none items-center justify-center whitespace-nowrap rounded-[var(--radius)] border align-middle font-medium tracking-[0.5px] transition-all duration-300 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--input-accent)] focus-visible:ring-offset-2", Ye = {
|
|
1073
1096
|
small: {
|
|
1074
1097
|
iconSize: 12,
|
|
1075
1098
|
className: "text-xs px-2 py-1 gap-1"
|
|
@@ -1086,7 +1109,7 @@ const ko = ["root", "content", "icon", "loading"], Re = {
|
|
|
1086
1109
|
iconSize: 20,
|
|
1087
1110
|
className: "text-[25px] px-[45px] py-[18px] gap-3"
|
|
1088
1111
|
}
|
|
1089
|
-
},
|
|
1112
|
+
}, dt = {
|
|
1090
1113
|
default: "bg-[var(--primary)] text-[var(--primary-foreground)] border-[var(--border)] hover:shadow-[0_0_0.4em_0_var(--button-shadow-default)]",
|
|
1091
1114
|
transparent: "bg-[var(--transparent)] text-[var(--primary-foreground)] border-[var(--button-transparent-border)] hover:shadow-[0_0_0.4em_0_var(--button-shadow-default)]",
|
|
1092
1115
|
danger: "bg-[var(--destructive)] text-[var(--destructive-foreground)] border-transparent hover:shadow-[0_0_0.4em_0_var(--destructive)]",
|
|
@@ -1101,7 +1124,7 @@ const ko = ["root", "content", "icon", "loading"], Re = {
|
|
|
1101
1124
|
transparent: "bg-[var(--transparent)] text-[var(--button-enu-fg)] border-[var(--button-transparent-border)]",
|
|
1102
1125
|
danger: "bg-[var(--destructive)] text-[var(--destructive-foreground)] border-transparent",
|
|
1103
1126
|
success: "bg-[var(--success)] text-[var(--success-foreground)] border-transparent"
|
|
1104
|
-
}, Mo = "bg-[var(--muted)] text-[var(--muted-foreground)] border-transparent cursor-not-allowed shadow-none hover:shadow-none", zo = (e) => e === !0 || e === "light" || e === "dark" ? !0 : Array.isArray(e) && e.length > 0 ? e[0] === !0 || e[0] === "light" || e[0] === "dark" : !1, Eo = (e) => e === "light" ? "light" : e === "dark" || e === !0 || Array.isArray(e) && e.length >= 2 && e[1] === "dark" ? "dark" : "light",
|
|
1127
|
+
}, Mo = "bg-[var(--muted)] text-[var(--muted-foreground)] border-transparent cursor-not-allowed shadow-none hover:shadow-none", zo = (e) => e === !0 || e === "light" || e === "dark" ? !0 : Array.isArray(e) && e.length > 0 ? e[0] === !0 || e[0] === "light" || e[0] === "dark" : !1, Eo = (e) => e === "light" ? "light" : e === "dark" || e === !0 || Array.isArray(e) && e.length >= 2 && e[1] === "dark" ? "dark" : "light", ut = (e, o, r) => Object.prototype.hasOwnProperty.call(r, e) ? e : o;
|
|
1105
1128
|
function ie(e) {
|
|
1106
1129
|
const {
|
|
1107
1130
|
type: o = "default",
|
|
@@ -1114,84 +1137,84 @@ function ie(e) {
|
|
|
1114
1137
|
children: i,
|
|
1115
1138
|
disabled: u = !1,
|
|
1116
1139
|
outline: h = !1,
|
|
1117
|
-
enu:
|
|
1118
|
-
icon:
|
|
1119
|
-
iconPosition:
|
|
1120
|
-
loading:
|
|
1121
|
-
i18nKey:
|
|
1122
|
-
localeText:
|
|
1123
|
-
"aria-label":
|
|
1124
|
-
...S
|
|
1125
|
-
} = e, { t: v } = de(), x = dt(r, "medium", Ve), C = dt(o, "default", it), m = zo(w), y = Eo(w), z = u || m, A = Ve[x].iconSize, $ = f === "right" ? "right" : p || m ? "left" : null, _ = W(n, ko), T = {
|
|
1126
|
-
default: v("button.default", Re.default),
|
|
1127
|
-
loading: v("button.loading", Re.loading),
|
|
1128
|
-
iconAlt: v("button.iconAlt", Re.iconAlt),
|
|
1140
|
+
enu: m = !1,
|
|
1141
|
+
icon: d = null,
|
|
1142
|
+
iconPosition: g = null,
|
|
1143
|
+
loading: v = !1,
|
|
1144
|
+
i18nKey: w = null,
|
|
1145
|
+
localeText: C = {},
|
|
1146
|
+
"aria-label": F,
|
|
1129
1147
|
...O
|
|
1130
|
-
},
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1148
|
+
} = e, { t: y } = de(), x = ut(r, "medium", Ye), T = ut(o, "default", dt), p = zo(v), S = Eo(v), _ = u || p, M = Ye[x].iconSize, B = g === "right" ? "right" : d || p ? "left" : null, A = H(n, ko), k = {
|
|
1149
|
+
default: y("button.default", Ve.default),
|
|
1150
|
+
loading: y("button.loading", Ve.loading),
|
|
1151
|
+
iconAlt: y("button.iconAlt", Ve.iconAlt),
|
|
1152
|
+
...C
|
|
1153
|
+
}, L = (w && typeof k[w] == "string" ? k[w] : null) || (w ? y(`button.${w}`, k.default) : k.default), W = p ? k.loading : L, D = i ?? W, E = F || (i == null ? String(D || k.default) : void 0);
|
|
1154
|
+
let $ = dt[T];
|
|
1155
|
+
h && ($ = I(
|
|
1156
|
+
$,
|
|
1134
1157
|
Po,
|
|
1135
|
-
Oo[
|
|
1136
|
-
)),
|
|
1137
|
-
|
|
1158
|
+
Oo[T]
|
|
1159
|
+
)), m && ($ = I(
|
|
1160
|
+
$,
|
|
1138
1161
|
_o,
|
|
1139
|
-
Ao[
|
|
1162
|
+
Ao[T]
|
|
1140
1163
|
));
|
|
1141
|
-
const
|
|
1164
|
+
const z = b({
|
|
1142
1165
|
// 顺序固定为:baseTw -> className -> sx.tw,sx 能稳定覆盖普通 Tailwind。
|
|
1143
|
-
baseClassName:
|
|
1166
|
+
baseClassName: I(
|
|
1144
1167
|
Lo,
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1168
|
+
Ye[x].className,
|
|
1169
|
+
$,
|
|
1170
|
+
_ && Mo,
|
|
1171
|
+
p && "cursor-wait"
|
|
1149
1172
|
),
|
|
1150
1173
|
className: l,
|
|
1151
1174
|
style: c,
|
|
1152
|
-
sxSlot:
|
|
1153
|
-
}),
|
|
1175
|
+
sxSlot: A.root
|
|
1176
|
+
}), U = b({
|
|
1154
1177
|
baseClassName: "inline-flex items-center",
|
|
1155
|
-
sxSlot:
|
|
1178
|
+
sxSlot: A.content
|
|
1156
1179
|
}), K = b({
|
|
1157
1180
|
baseClassName: "inline-flex items-center justify-center shrink-0 transition-all duration-300",
|
|
1158
1181
|
baseStyle: {
|
|
1159
|
-
width: `${
|
|
1160
|
-
height: `${
|
|
1182
|
+
width: `${M}px`,
|
|
1183
|
+
height: `${M}px`
|
|
1161
1184
|
},
|
|
1162
|
-
sxSlot:
|
|
1185
|
+
sxSlot: A.icon
|
|
1163
1186
|
}), G = b({
|
|
1164
1187
|
baseClassName: "inline-flex items-center justify-center shrink-0 animate-spin",
|
|
1165
1188
|
baseStyle: {
|
|
1166
|
-
width: `${
|
|
1167
|
-
height: `${
|
|
1168
|
-
color:
|
|
1189
|
+
width: `${M}px`,
|
|
1190
|
+
height: `${M}px`,
|
|
1191
|
+
color: S === "light" ? "var(--button-loading-light)" : "var(--button-loading-dark)"
|
|
1169
1192
|
},
|
|
1170
|
-
sxSlot:
|
|
1171
|
-
}), R = () =>
|
|
1193
|
+
sxSlot: A.loading
|
|
1194
|
+
}), R = () => d ? typeof d == "string" ? /* @__PURE__ */ s(
|
|
1172
1195
|
"img",
|
|
1173
1196
|
{
|
|
1174
|
-
src:
|
|
1175
|
-
alt:
|
|
1197
|
+
src: d,
|
|
1198
|
+
alt: k.iconAlt,
|
|
1176
1199
|
className: K.className,
|
|
1177
1200
|
style: K.style,
|
|
1178
1201
|
"aria-hidden": "true"
|
|
1179
1202
|
}
|
|
1180
|
-
) : te.isValidElement(
|
|
1181
|
-
className:
|
|
1203
|
+
) : te.isValidElement(d) ? te.cloneElement(d, {
|
|
1204
|
+
className: I(K.className, d.props.className),
|
|
1182
1205
|
style: {
|
|
1183
1206
|
...K.style,
|
|
1184
|
-
...
|
|
1207
|
+
...d.props.style
|
|
1185
1208
|
},
|
|
1186
1209
|
"aria-hidden": !0
|
|
1187
|
-
}) : typeof
|
|
1188
|
-
|
|
1210
|
+
}) : typeof d == "function" ? /* @__PURE__ */ s(
|
|
1211
|
+
d,
|
|
1189
1212
|
{
|
|
1190
1213
|
className: K.className,
|
|
1191
1214
|
style: K.style,
|
|
1192
1215
|
"aria-hidden": "true"
|
|
1193
1216
|
}
|
|
1194
|
-
) : /* @__PURE__ */ s("span", { className: K.className, style: K.style, "aria-hidden": "true", children:
|
|
1217
|
+
) : /* @__PURE__ */ s("span", { className: K.className, style: K.style, "aria-hidden": "true", children: d }) : null, Q = () => /* @__PURE__ */ s(
|
|
1195
1218
|
"svg",
|
|
1196
1219
|
{
|
|
1197
1220
|
viewBox: "0 0 1024 1024",
|
|
@@ -1208,27 +1231,27 @@ function ie(e) {
|
|
|
1208
1231
|
)
|
|
1209
1232
|
}
|
|
1210
1233
|
);
|
|
1211
|
-
return /* @__PURE__ */
|
|
1234
|
+
return /* @__PURE__ */ P(
|
|
1212
1235
|
"button",
|
|
1213
1236
|
{
|
|
1214
|
-
className:
|
|
1215
|
-
style:
|
|
1237
|
+
className: z.className,
|
|
1238
|
+
style: z.style,
|
|
1216
1239
|
onClick: a,
|
|
1217
|
-
disabled:
|
|
1218
|
-
"aria-label":
|
|
1219
|
-
"data-variant":
|
|
1240
|
+
disabled: _,
|
|
1241
|
+
"aria-label": E,
|
|
1242
|
+
"data-variant": T,
|
|
1220
1243
|
"data-size": x,
|
|
1221
|
-
"data-icon-position":
|
|
1222
|
-
...
|
|
1244
|
+
"data-icon-position": B || void 0,
|
|
1245
|
+
...O,
|
|
1223
1246
|
children: [
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
!
|
|
1247
|
+
B === "left" && /* @__PURE__ */ P(Ne, { children: [
|
|
1248
|
+
p && Q(),
|
|
1249
|
+
!p && d && R()
|
|
1227
1250
|
] }),
|
|
1228
|
-
/* @__PURE__ */ s("span", { className:
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
!
|
|
1251
|
+
/* @__PURE__ */ s("span", { className: U.className, style: U.style, children: D }),
|
|
1252
|
+
B === "right" && /* @__PURE__ */ P(Ne, { children: [
|
|
1253
|
+
p && Q(),
|
|
1254
|
+
!p && d && R()
|
|
1232
1255
|
] })
|
|
1233
1256
|
]
|
|
1234
1257
|
}
|
|
@@ -1259,7 +1282,7 @@ ie.propTypes = {
|
|
|
1259
1282
|
i18nKey: t.string,
|
|
1260
1283
|
localeText: t.object
|
|
1261
1284
|
};
|
|
1262
|
-
ie.MaterialButton =
|
|
1285
|
+
ie.MaterialButton = Ge;
|
|
1263
1286
|
const $o = ["root", "input", "label"], Bo = {
|
|
1264
1287
|
small: "small",
|
|
1265
1288
|
medium: "medium",
|
|
@@ -1273,7 +1296,7 @@ const $o = ["root", "input", "label"], Bo = {
|
|
|
1273
1296
|
}, jo = {
|
|
1274
1297
|
label: ""
|
|
1275
1298
|
}, Fo = (e, o, r) => Object.prototype.hasOwnProperty.call(r, e) ? e : o;
|
|
1276
|
-
function
|
|
1299
|
+
function Xe(e) {
|
|
1277
1300
|
const {
|
|
1278
1301
|
size: o = "medium",
|
|
1279
1302
|
sx: r = {},
|
|
@@ -1284,64 +1307,64 @@ function Ge(e) {
|
|
|
1284
1307
|
defaultValue: i,
|
|
1285
1308
|
disabled: u = !1,
|
|
1286
1309
|
label: h,
|
|
1287
|
-
localeText:
|
|
1288
|
-
type:
|
|
1289
|
-
...
|
|
1290
|
-
} = e, { t:
|
|
1291
|
-
tw:
|
|
1292
|
-
css: { ...
|
|
1293
|
-
},
|
|
1310
|
+
localeText: m,
|
|
1311
|
+
type: d = "text",
|
|
1312
|
+
...g
|
|
1313
|
+
} = e, { t: v } = de(), w = Fo(o, "medium", Bo), C = a !== void 0, [F, O] = Z(i ?? ""), [y, x] = Z(!1), T = C ? a : F, p = y || String(T).length > 0, S = h ?? (m == null ? void 0 : m.label) ?? v("materialInput.label", jo.label), _ = H(r, $o), M = {
|
|
1314
|
+
tw: I(_.root.tw, _.input.tw),
|
|
1315
|
+
css: { ..._.root.css, ..._.input.css }
|
|
1316
|
+
}, B = I("relative inline-flex", _.root.tw), A = Io[w], k = I(
|
|
1294
1317
|
"w-[300px] bg-transparent text-[var(--foreground)] outline-none transition-all duration-200 ease-in-out",
|
|
1295
1318
|
"border-b border-b-[var(--border)]",
|
|
1296
1319
|
"hover:border-b-[var(--input-accent)]",
|
|
1297
1320
|
"focus:border-b-[var(--input-accent)]",
|
|
1298
1321
|
u && "text-[var(--muted-foreground)] border-b-[var(--muted)] cursor-not-allowed hover:border-b-[var(--muted)]",
|
|
1299
|
-
|
|
1300
|
-
|
|
1322
|
+
A.wrapper,
|
|
1323
|
+
A.pt
|
|
1301
1324
|
), N = b({
|
|
1302
|
-
baseClassName:
|
|
1325
|
+
baseClassName: k,
|
|
1303
1326
|
className: c,
|
|
1304
1327
|
style: n,
|
|
1305
|
-
sxSlot:
|
|
1306
|
-
}),
|
|
1328
|
+
sxSlot: M
|
|
1329
|
+
}), L = I(
|
|
1307
1330
|
"absolute left-0 transition-all duration-200 ease-in-out pointer-events-none",
|
|
1308
|
-
|
|
1309
|
-
|
|
1331
|
+
p ? `top-1 ${A.labelFloat} text-[var(--input-accent)]` : `top-1/2 -translate-y-1/2 ${A.label} text-[var(--muted-foreground)]`,
|
|
1332
|
+
y && p && "text-[var(--input-accent)]",
|
|
1310
1333
|
u && "text-[var(--muted-foreground)]",
|
|
1311
|
-
|
|
1312
|
-
),
|
|
1313
|
-
baseClassName:
|
|
1314
|
-
sxSlot: { tw: "", css:
|
|
1315
|
-
}),
|
|
1334
|
+
_.label.tw
|
|
1335
|
+
), W = b({
|
|
1336
|
+
baseClassName: L,
|
|
1337
|
+
sxSlot: { tw: "", css: _.label.css }
|
|
1338
|
+
}), D = oe((G) => {
|
|
1316
1339
|
const R = G.target.value;
|
|
1317
|
-
|
|
1318
|
-
}, [
|
|
1340
|
+
C || O(R), l == null || l(R);
|
|
1341
|
+
}, [C, l]), E = oe((G) => {
|
|
1319
1342
|
var R;
|
|
1320
|
-
x(!0), (R =
|
|
1321
|
-
}, [
|
|
1343
|
+
x(!0), (R = g.onFocus) == null || R.call(g, G);
|
|
1344
|
+
}, [g.onFocus]), $ = oe((G) => {
|
|
1322
1345
|
var R;
|
|
1323
|
-
x(!1), (R =
|
|
1324
|
-
}, [
|
|
1325
|
-
return /* @__PURE__ */
|
|
1346
|
+
x(!1), (R = g.onBlur) == null || R.call(g, G);
|
|
1347
|
+
}, [g.onBlur]), { onFocus: z, onBlur: U, ...K } = g;
|
|
1348
|
+
return /* @__PURE__ */ P("div", { className: B, children: [
|
|
1326
1349
|
/* @__PURE__ */ s(
|
|
1327
1350
|
"input",
|
|
1328
1351
|
{
|
|
1329
1352
|
...K,
|
|
1330
|
-
type:
|
|
1353
|
+
type: d,
|
|
1331
1354
|
className: N.className,
|
|
1332
1355
|
style: N.style,
|
|
1333
|
-
value:
|
|
1356
|
+
value: T,
|
|
1334
1357
|
disabled: u || void 0,
|
|
1335
|
-
onChange:
|
|
1336
|
-
onFocus:
|
|
1337
|
-
onBlur:
|
|
1338
|
-
"aria-label":
|
|
1358
|
+
onChange: D,
|
|
1359
|
+
onFocus: E,
|
|
1360
|
+
onBlur: $,
|
|
1361
|
+
"aria-label": S || void 0
|
|
1339
1362
|
}
|
|
1340
1363
|
),
|
|
1341
|
-
|
|
1364
|
+
S && /* @__PURE__ */ s("label", { className: W.className, style: W.style, children: S })
|
|
1342
1365
|
] });
|
|
1343
1366
|
}
|
|
1344
|
-
|
|
1367
|
+
Xe.propTypes = {
|
|
1345
1368
|
size: t.oneOf(["small", "medium", "large", "huge"]),
|
|
1346
1369
|
sx: t.oneOfType([t.object, t.string]),
|
|
1347
1370
|
style: t.object,
|
|
@@ -1367,7 +1390,7 @@ const Do = ["root", "input"], Ro = {
|
|
|
1367
1390
|
large: "h-12 text-base px-3.5",
|
|
1368
1391
|
huge: "h-14 text-lg px-4"
|
|
1369
1392
|
}, Yo = (e, o, r) => Object.prototype.hasOwnProperty.call(r, e) ? e : o;
|
|
1370
|
-
function
|
|
1393
|
+
function qe(e) {
|
|
1371
1394
|
const {
|
|
1372
1395
|
type: o = "default",
|
|
1373
1396
|
size: r = "medium",
|
|
@@ -1378,60 +1401,75 @@ function Xe(e) {
|
|
|
1378
1401
|
onChange: i,
|
|
1379
1402
|
value: u,
|
|
1380
1403
|
defaultValue: h,
|
|
1381
|
-
disabled:
|
|
1382
|
-
placeholder:
|
|
1383
|
-
maxlength:
|
|
1384
|
-
status:
|
|
1385
|
-
...
|
|
1386
|
-
} = e,
|
|
1387
|
-
tw:
|
|
1404
|
+
disabled: m = !1,
|
|
1405
|
+
placeholder: d = "",
|
|
1406
|
+
maxlength: g = 524288,
|
|
1407
|
+
status: v,
|
|
1408
|
+
...w
|
|
1409
|
+
} = e, C = Yo(r, "medium", Ro), F = o === "textarea", O = o === "password", y = v === "error", x = H(n, Do), T = {
|
|
1410
|
+
tw: I(x.root.tw, x.input.tw),
|
|
1388
1411
|
css: { ...x.root.css, ...x.input.css }
|
|
1389
|
-
},
|
|
1412
|
+
}, p = I("inline-flex", x.root.tw), S = I(
|
|
1390
1413
|
"w-[300px] rounded-[var(--radius)] border bg-[var(--input-bg)] text-[var(--foreground)] outline-none transition-all duration-200 ease-in-out",
|
|
1391
1414
|
"border-[var(--border)] shadow-[var(--input-shadow)]",
|
|
1392
1415
|
"hover:border-[var(--input-accent)]",
|
|
1393
1416
|
"focus:border-[var(--input-accent)] focus:shadow-[var(--input-focus-shadow)]",
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
Vo[
|
|
1397
|
-
),
|
|
1398
|
-
baseClassName:
|
|
1417
|
+
y && "border-[var(--input-error-border)] bg-[var(--input-error-bg)] text-[var(--input-error-fg)] hover:border-[var(--input-error-border)] focus:shadow-[var(--input-error-focus-shadow)]",
|
|
1418
|
+
m && "bg-[var(--muted)] text-[var(--muted-foreground)] border-[var(--muted)] cursor-not-allowed shadow-none hover:border-[var(--muted)] focus:shadow-none",
|
|
1419
|
+
Vo[C]
|
|
1420
|
+
), _ = b({
|
|
1421
|
+
baseClassName: S,
|
|
1399
1422
|
className: l,
|
|
1400
1423
|
style: c,
|
|
1401
|
-
sxSlot:
|
|
1402
|
-
}),
|
|
1403
|
-
className:
|
|
1404
|
-
style:
|
|
1424
|
+
sxSlot: T
|
|
1425
|
+
}), M = u !== void 0, B = {
|
|
1426
|
+
className: _.className,
|
|
1427
|
+
style: _.style,
|
|
1405
1428
|
onClick: a,
|
|
1406
|
-
onChange: i ? (
|
|
1407
|
-
value:
|
|
1408
|
-
defaultValue:
|
|
1409
|
-
disabled:
|
|
1410
|
-
placeholder:
|
|
1411
|
-
maxLength:
|
|
1412
|
-
"aria-invalid":
|
|
1429
|
+
onChange: i ? (A) => i(A.target.value) : void 0,
|
|
1430
|
+
value: M ? u : void 0,
|
|
1431
|
+
defaultValue: M ? void 0 : h ?? "",
|
|
1432
|
+
disabled: m || void 0,
|
|
1433
|
+
placeholder: d,
|
|
1434
|
+
maxLength: g,
|
|
1435
|
+
"aria-invalid": y || void 0,
|
|
1436
|
+
...w
|
|
1437
|
+
};
|
|
1438
|
+
return (
|
|
1413
1439
|
// 原因:password input 不在 form 内,浏览器会发出 [DOM] Password field is not contained in a form 警告
|
|
1414
|
-
// 导致的问题:控制台持续出现 DOM
|
|
1415
|
-
//
|
|
1440
|
+
// 导致的问题:控制台持续出现 DOM 警告,autoComplete 属性无法完全抑制
|
|
1441
|
+
// 解决办法:password 类型用 <form> 包裹 input,阻止默认提交行为,满足浏览器规范
|
|
1416
1442
|
// fixed by clayw on 20260523 night
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1443
|
+
/* @__PURE__ */ s("div", { className: p, children: O ? /* @__PURE__ */ s(
|
|
1444
|
+
"form",
|
|
1445
|
+
{
|
|
1446
|
+
onSubmit: (A) => A.preventDefault(),
|
|
1447
|
+
style: { display: "inline-flex" },
|
|
1448
|
+
autoComplete: "off",
|
|
1449
|
+
children: /* @__PURE__ */ s(
|
|
1450
|
+
"input",
|
|
1451
|
+
{
|
|
1452
|
+
...B,
|
|
1453
|
+
type: "password"
|
|
1454
|
+
}
|
|
1455
|
+
)
|
|
1456
|
+
}
|
|
1457
|
+
) : F ? /* @__PURE__ */ s(
|
|
1458
|
+
"textarea",
|
|
1459
|
+
{
|
|
1460
|
+
...B,
|
|
1461
|
+
className: `${B.className} min-h-[80px] py-2 resize-y`
|
|
1462
|
+
}
|
|
1463
|
+
) : /* @__PURE__ */ s(
|
|
1464
|
+
"input",
|
|
1465
|
+
{
|
|
1466
|
+
...B,
|
|
1467
|
+
type: "text"
|
|
1468
|
+
}
|
|
1469
|
+
) })
|
|
1470
|
+
);
|
|
1433
1471
|
}
|
|
1434
|
-
|
|
1472
|
+
qe.propTypes = {
|
|
1435
1473
|
type: t.oneOf(["default", "textarea", "password"]),
|
|
1436
1474
|
size: t.oneOf(["small", "medium", "large", "huge"]),
|
|
1437
1475
|
sx: t.oneOfType([t.object, t.string]),
|
|
@@ -1446,7 +1484,7 @@ Xe.propTypes = {
|
|
|
1446
1484
|
maxlength: t.number,
|
|
1447
1485
|
status: t.oneOf(["default", "error"])
|
|
1448
1486
|
};
|
|
1449
|
-
|
|
1487
|
+
qe.MaterialInput = Xe;
|
|
1450
1488
|
const we = ["root"];
|
|
1451
1489
|
function Ko(e, o) {
|
|
1452
1490
|
const {
|
|
@@ -1455,7 +1493,7 @@ function Ko(e, o) {
|
|
|
1455
1493
|
className: c = "",
|
|
1456
1494
|
children: l,
|
|
1457
1495
|
...a
|
|
1458
|
-
} = e, i =
|
|
1496
|
+
} = e, i = H(r, we), u = b({
|
|
1459
1497
|
baseClassName: "flex items-center px-4 bg-[var(--layout-header-bg)] text-[var(--layout-header-color)]",
|
|
1460
1498
|
className: c,
|
|
1461
1499
|
sxSlot: i.root,
|
|
@@ -1484,14 +1522,14 @@ Be.propTypes = {
|
|
|
1484
1522
|
className: t.string,
|
|
1485
1523
|
children: t.node
|
|
1486
1524
|
};
|
|
1487
|
-
function
|
|
1525
|
+
function Wo(e, o) {
|
|
1488
1526
|
const {
|
|
1489
1527
|
sx: r = {},
|
|
1490
1528
|
style: n = {},
|
|
1491
1529
|
className: c = "",
|
|
1492
1530
|
children: l,
|
|
1493
1531
|
...a
|
|
1494
|
-
} = e, i =
|
|
1532
|
+
} = e, i = H(r, we), u = b({
|
|
1495
1533
|
baseClassName: "flex items-center px-4 bg-[var(--layout-footer-bg)] text-[var(--layout-footer-color)]",
|
|
1496
1534
|
className: c,
|
|
1497
1535
|
sxSlot: i.root,
|
|
@@ -1512,7 +1550,7 @@ function Uo(e, o) {
|
|
|
1512
1550
|
}
|
|
1513
1551
|
);
|
|
1514
1552
|
}
|
|
1515
|
-
const Ie = te.forwardRef(
|
|
1553
|
+
const Ie = te.forwardRef(Wo);
|
|
1516
1554
|
Ie.displayName = "LayoutFooter";
|
|
1517
1555
|
Ie.propTypes = {
|
|
1518
1556
|
sx: t.oneOfType([t.string, t.object]),
|
|
@@ -1520,7 +1558,7 @@ Ie.propTypes = {
|
|
|
1520
1558
|
className: t.string,
|
|
1521
1559
|
children: t.node
|
|
1522
1560
|
};
|
|
1523
|
-
function
|
|
1561
|
+
function Uo(e, o) {
|
|
1524
1562
|
const {
|
|
1525
1563
|
sx: r = {},
|
|
1526
1564
|
style: n = {},
|
|
@@ -1528,7 +1566,7 @@ function Ho(e, o) {
|
|
|
1528
1566
|
width: l,
|
|
1529
1567
|
children: a,
|
|
1530
1568
|
...i
|
|
1531
|
-
} = e, u =
|
|
1569
|
+
} = e, u = H(r, we), h = l ?? "var(--layout-sider-width)", m = b({
|
|
1532
1570
|
baseClassName: "overflow-auto flex flex-col bg-[var(--layout-sider-bg)] text-[var(--layout-sider-color)]",
|
|
1533
1571
|
className: c,
|
|
1534
1572
|
sxSlot: u.root,
|
|
@@ -1544,23 +1582,23 @@ function Ho(e, o) {
|
|
|
1544
1582
|
"aside",
|
|
1545
1583
|
{
|
|
1546
1584
|
ref: o,
|
|
1547
|
-
className:
|
|
1548
|
-
style:
|
|
1585
|
+
className: m.className,
|
|
1586
|
+
style: m.style,
|
|
1549
1587
|
...i,
|
|
1550
1588
|
children: a
|
|
1551
1589
|
}
|
|
1552
1590
|
);
|
|
1553
1591
|
}
|
|
1554
|
-
const
|
|
1555
|
-
|
|
1556
|
-
|
|
1592
|
+
const Le = te.forwardRef(Uo);
|
|
1593
|
+
Le.displayName = "LayoutSider";
|
|
1594
|
+
Le.propTypes = {
|
|
1557
1595
|
width: t.oneOfType([t.string, t.number]),
|
|
1558
1596
|
sx: t.oneOfType([t.string, t.object]),
|
|
1559
1597
|
style: t.object,
|
|
1560
1598
|
className: t.string,
|
|
1561
1599
|
children: t.node
|
|
1562
1600
|
};
|
|
1563
|
-
function
|
|
1601
|
+
function Ho(e, o) {
|
|
1564
1602
|
const {
|
|
1565
1603
|
sx: r = {},
|
|
1566
1604
|
style: n = {},
|
|
@@ -1568,7 +1606,7 @@ function Wo(e, o) {
|
|
|
1568
1606
|
width: l,
|
|
1569
1607
|
children: a,
|
|
1570
1608
|
...i
|
|
1571
|
-
} = e, u =
|
|
1609
|
+
} = e, u = H(r, we), h = l ?? "var(--layout-toc-width)", m = b({
|
|
1572
1610
|
baseClassName: "overflow-auto flex flex-col bg-[var(--layout-toc-bg)] text-[var(--layout-toc-color)]",
|
|
1573
1611
|
className: c,
|
|
1574
1612
|
sxSlot: u.root,
|
|
@@ -1584,16 +1622,16 @@ function Wo(e, o) {
|
|
|
1584
1622
|
"nav",
|
|
1585
1623
|
{
|
|
1586
1624
|
ref: o,
|
|
1587
|
-
className:
|
|
1588
|
-
style:
|
|
1625
|
+
className: m.className,
|
|
1626
|
+
style: m.style,
|
|
1589
1627
|
...i,
|
|
1590
1628
|
children: a
|
|
1591
1629
|
}
|
|
1592
1630
|
);
|
|
1593
1631
|
}
|
|
1594
|
-
const
|
|
1595
|
-
|
|
1596
|
-
|
|
1632
|
+
const Pe = te.forwardRef(Ho);
|
|
1633
|
+
Pe.displayName = "LayoutToc";
|
|
1634
|
+
Pe.propTypes = {
|
|
1597
1635
|
width: t.oneOfType([t.string, t.number]),
|
|
1598
1636
|
sx: t.oneOfType([t.string, t.object]),
|
|
1599
1637
|
style: t.object,
|
|
@@ -1607,7 +1645,7 @@ function Zo(e, o) {
|
|
|
1607
1645
|
className: c = "",
|
|
1608
1646
|
children: l,
|
|
1609
1647
|
...a
|
|
1610
|
-
} = e, i =
|
|
1648
|
+
} = e, i = H(r, we), u = b({
|
|
1611
1649
|
/**
|
|
1612
1650
|
*
|
|
1613
1651
|
* 这里记录了一次问题:backgroundColor、color 等写在 baseStyle(inline style)里,
|
|
@@ -1660,13 +1698,13 @@ function Go(e, o) {
|
|
|
1660
1698
|
hasSider: l,
|
|
1661
1699
|
children: a,
|
|
1662
1700
|
...i
|
|
1663
|
-
} = e, u =
|
|
1664
|
-
(
|
|
1665
|
-
var
|
|
1666
|
-
return te.isValidElement(
|
|
1701
|
+
} = e, u = H(r, we), h = l ?? te.Children.toArray(a).some(
|
|
1702
|
+
(d) => {
|
|
1703
|
+
var g, v;
|
|
1704
|
+
return te.isValidElement(d) && (d.type === Le || d.type === Pe || ((g = d.type) == null ? void 0 : g.displayName) === "LayoutSider" || ((v = d.type) == null ? void 0 : v.displayName) === "LayoutToc");
|
|
1667
1705
|
}
|
|
1668
|
-
),
|
|
1669
|
-
baseClassName:
|
|
1706
|
+
), m = b({
|
|
1707
|
+
baseClassName: I(
|
|
1670
1708
|
"flex flex-1 flex-col min-h-0",
|
|
1671
1709
|
h ? "md:flex-row" : ""
|
|
1672
1710
|
),
|
|
@@ -1678,8 +1716,8 @@ function Go(e, o) {
|
|
|
1678
1716
|
"section",
|
|
1679
1717
|
{
|
|
1680
1718
|
ref: o,
|
|
1681
|
-
className:
|
|
1682
|
-
style:
|
|
1719
|
+
className: m.className,
|
|
1720
|
+
style: m.style,
|
|
1683
1721
|
...i,
|
|
1684
1722
|
children: a
|
|
1685
1723
|
}
|
|
@@ -1689,9 +1727,9 @@ const ne = te.forwardRef(Go);
|
|
|
1689
1727
|
ne.displayName = "Layout";
|
|
1690
1728
|
ne.Header = Be;
|
|
1691
1729
|
ne.Footer = Ie;
|
|
1692
|
-
ne.Sider =
|
|
1730
|
+
ne.Sider = Le;
|
|
1693
1731
|
ne.Content = je;
|
|
1694
|
-
ne.Toc =
|
|
1732
|
+
ne.Toc = Pe;
|
|
1695
1733
|
ne.propTypes = {
|
|
1696
1734
|
hasSider: t.bool,
|
|
1697
1735
|
sx: t.oneOfType([t.string, t.object]),
|
|
@@ -1699,10 +1737,10 @@ ne.propTypes = {
|
|
|
1699
1737
|
className: t.string,
|
|
1700
1738
|
children: t.node
|
|
1701
1739
|
};
|
|
1702
|
-
const Xo = Be, qo = Ie, Jo =
|
|
1740
|
+
const Xo = Be, qo = Ie, Jo = Le, Qo = je, er = Pe, tr = ["root", "button", "list", "item"], $t = Symbol("LIST_IGNORE"), pt = /* @__PURE__ */ P("svg", { viewBox: "0 0 24 24", width: "1em", height: "1em", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: [
|
|
1703
1741
|
/* @__PURE__ */ s("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z" }),
|
|
1704
1742
|
/* @__PURE__ */ s("path", { d: "M14 2v6h6" })
|
|
1705
|
-
] }),
|
|
1743
|
+
] }), mt = /* @__PURE__ */ s("svg", { viewBox: "0 0 24 24", width: "1em", height: "1em", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ s("path", { d: "M18 6 6 18M6 6l12 12" }) });
|
|
1706
1744
|
function or(e, o) {
|
|
1707
1745
|
const {
|
|
1708
1746
|
sx: r = {},
|
|
@@ -1715,77 +1753,77 @@ function or(e, o) {
|
|
|
1715
1753
|
beforeUpload: u = () => {
|
|
1716
1754
|
},
|
|
1717
1755
|
files: h = [],
|
|
1718
|
-
showUploadList:
|
|
1719
|
-
maxCount:
|
|
1720
|
-
maxSize:
|
|
1721
|
-
btnText:
|
|
1722
|
-
btnStyle:
|
|
1723
|
-
showSize:
|
|
1724
|
-
disabled:
|
|
1725
|
-
...
|
|
1726
|
-
} = e,
|
|
1756
|
+
showUploadList: m = !0,
|
|
1757
|
+
maxCount: d = 20,
|
|
1758
|
+
maxSize: g = 100,
|
|
1759
|
+
btnText: v = "选择文件",
|
|
1760
|
+
btnStyle: w,
|
|
1761
|
+
showSize: C = !0,
|
|
1762
|
+
disabled: F = !1,
|
|
1763
|
+
...O
|
|
1764
|
+
} = e, y = Wt(), x = h || [], T = H(r, tr), p = oe(async (k, N) => {
|
|
1727
1765
|
if (!u) return !0;
|
|
1728
1766
|
try {
|
|
1729
|
-
const
|
|
1730
|
-
return
|
|
1767
|
+
const L = await u(k, N);
|
|
1768
|
+
return L === void 0 ? !0 : L;
|
|
1731
1769
|
} catch {
|
|
1732
1770
|
return !1;
|
|
1733
1771
|
}
|
|
1734
|
-
}, [u]),
|
|
1735
|
-
const
|
|
1736
|
-
for (const
|
|
1737
|
-
const
|
|
1738
|
-
if (
|
|
1739
|
-
console.warn(`[Tango Upload] ${
|
|
1772
|
+
}, [u]), S = oe(async (k) => {
|
|
1773
|
+
const L = Array.from(k.target.files || []).filter((E) => E.size / 1024 / 1024 > g ? (console.warn(`[Tango Upload] ${E.name} 超过 ${g}MB,已被过滤`), !1) : !0), W = a ? L.slice(0, d) : L.slice(0, 1), D = [];
|
|
1774
|
+
for (const E of W) {
|
|
1775
|
+
const $ = await p(E, W);
|
|
1776
|
+
if ($ === !1) {
|
|
1777
|
+
console.warn(`[Tango Upload] ${E.name} 被 beforeUpload 拦截`);
|
|
1740
1778
|
continue;
|
|
1741
1779
|
}
|
|
1742
|
-
if (
|
|
1743
|
-
console.warn(`[Tango Upload] ${
|
|
1780
|
+
if ($ === $t) {
|
|
1781
|
+
console.warn(`[Tango Upload] ${E.name} 被 LIST_IGNORE 忽略`);
|
|
1744
1782
|
continue;
|
|
1745
1783
|
}
|
|
1746
|
-
if (
|
|
1747
|
-
const
|
|
1748
|
-
|
|
1784
|
+
if ($ instanceof Blob) {
|
|
1785
|
+
const z = $ instanceof File ? $ : new File([$], E.name, { type: E.type });
|
|
1786
|
+
D.push(z);
|
|
1749
1787
|
} else
|
|
1750
|
-
|
|
1788
|
+
D.push(E);
|
|
1751
1789
|
}
|
|
1752
|
-
|
|
1753
|
-
}, [a,
|
|
1754
|
-
const
|
|
1755
|
-
i(
|
|
1756
|
-
}, [x, i]),
|
|
1790
|
+
k.target.value = "", i(D);
|
|
1791
|
+
}, [a, d, g, p, i]), _ = oe((k, N) => {
|
|
1792
|
+
const L = x.filter((W, D) => D !== N);
|
|
1793
|
+
i(L);
|
|
1794
|
+
}, [x, i]), M = b({
|
|
1757
1795
|
baseClassName: "inline-flex flex-col gap-3",
|
|
1758
1796
|
className: c,
|
|
1759
|
-
sxSlot:
|
|
1797
|
+
sxSlot: T.root,
|
|
1760
1798
|
style: n
|
|
1761
|
-
}),
|
|
1762
|
-
baseClassName:
|
|
1799
|
+
}), B = b({
|
|
1800
|
+
baseClassName: I(
|
|
1763
1801
|
"list-none p-0 m-0 max-h-[150px] max-w-[400px] overflow-y-auto",
|
|
1764
1802
|
"border border-[var(--upload-border)] rounded-[var(--upload-radius)]",
|
|
1765
1803
|
"bg-[var(--upload-list-bg)]",
|
|
1766
1804
|
x.length === 0 && "border-transparent"
|
|
1767
1805
|
),
|
|
1768
1806
|
baseStyle: { borderRadius: "var(--upload-radius)" },
|
|
1769
|
-
sxSlot:
|
|
1770
|
-
}),
|
|
1771
|
-
baseClassName:
|
|
1807
|
+
sxSlot: T.list
|
|
1808
|
+
}), A = b({
|
|
1809
|
+
baseClassName: I(
|
|
1772
1810
|
"flex items-center gap-2 px-3 py-1.5 text-sm",
|
|
1773
1811
|
"text-[var(--upload-item-text)] hover:bg-[var(--upload-item-hover-bg)]",
|
|
1774
1812
|
"transition-colors"
|
|
1775
1813
|
),
|
|
1776
|
-
sxSlot:
|
|
1814
|
+
sxSlot: T.item
|
|
1777
1815
|
});
|
|
1778
|
-
return /* @__PURE__ */
|
|
1816
|
+
return /* @__PURE__ */ P("div", { ref: o, className: M.className, style: M.style, ...O, children: [
|
|
1779
1817
|
/* @__PURE__ */ s(
|
|
1780
1818
|
"input",
|
|
1781
1819
|
{
|
|
1782
|
-
id:
|
|
1820
|
+
id: y,
|
|
1783
1821
|
type: "file",
|
|
1784
1822
|
accept: l,
|
|
1785
1823
|
multiple: a,
|
|
1786
1824
|
className: "hidden",
|
|
1787
|
-
onChange:
|
|
1788
|
-
disabled:
|
|
1825
|
+
onChange: S,
|
|
1826
|
+
disabled: F,
|
|
1789
1827
|
"aria-hidden": "true",
|
|
1790
1828
|
tabIndex: -1
|
|
1791
1829
|
}
|
|
@@ -1793,23 +1831,23 @@ function or(e, o) {
|
|
|
1793
1831
|
/* @__PURE__ */ s(
|
|
1794
1832
|
ie,
|
|
1795
1833
|
{
|
|
1796
|
-
disabled:
|
|
1797
|
-
style:
|
|
1798
|
-
sx:
|
|
1834
|
+
disabled: F,
|
|
1835
|
+
style: w,
|
|
1836
|
+
sx: T.button,
|
|
1799
1837
|
onClick: () => {
|
|
1800
|
-
var
|
|
1801
|
-
return (
|
|
1838
|
+
var k;
|
|
1839
|
+
return (k = document.getElementById(y)) == null ? void 0 : k.click();
|
|
1802
1840
|
},
|
|
1803
|
-
children:
|
|
1841
|
+
children: v
|
|
1804
1842
|
}
|
|
1805
1843
|
),
|
|
1806
|
-
|
|
1807
|
-
/* @__PURE__ */ s("span", { className: "flex-shrink-0 text-[var(--upload-icon-color)]", children:
|
|
1808
|
-
/* @__PURE__ */
|
|
1809
|
-
|
|
1810
|
-
|
|
1844
|
+
m && x.length > 0 && /* @__PURE__ */ s("ul", { className: B.className, style: B.style, children: a ? x.map((k, N) => /* @__PURE__ */ P("li", { className: A.className, style: A.style, children: [
|
|
1845
|
+
/* @__PURE__ */ s("span", { className: "flex-shrink-0 text-[var(--upload-icon-color)]", children: pt }),
|
|
1846
|
+
/* @__PURE__ */ P("span", { className: "flex-1 truncate", children: [
|
|
1847
|
+
k.name,
|
|
1848
|
+
C && /* @__PURE__ */ P("span", { className: "ml-1 text-xs text-[var(--muted-foreground)]", children: [
|
|
1811
1849
|
"(",
|
|
1812
|
-
(
|
|
1850
|
+
(k.size / 1024).toFixed(2),
|
|
1813
1851
|
" KB)"
|
|
1814
1852
|
] })
|
|
1815
1853
|
] }),
|
|
@@ -1818,16 +1856,16 @@ function or(e, o) {
|
|
|
1818
1856
|
{
|
|
1819
1857
|
type: "button",
|
|
1820
1858
|
className: "flex-shrink-0 p-0.5 rounded hover:bg-[var(--upload-del-hover-bg)] text-[var(--upload-del-color)] transition-colors",
|
|
1821
|
-
onClick: () =>
|
|
1822
|
-
"aria-label": `删除 ${
|
|
1823
|
-
children:
|
|
1859
|
+
onClick: () => _(k, N),
|
|
1860
|
+
"aria-label": `删除 ${k.name}`,
|
|
1861
|
+
children: mt
|
|
1824
1862
|
}
|
|
1825
1863
|
)
|
|
1826
|
-
] }, N)) : /* @__PURE__ */
|
|
1827
|
-
/* @__PURE__ */ s("span", { className: "flex-shrink-0 text-[var(--upload-icon-color)]", children:
|
|
1828
|
-
/* @__PURE__ */
|
|
1864
|
+
] }, N)) : /* @__PURE__ */ P("li", { className: A.className, style: A.style, children: [
|
|
1865
|
+
/* @__PURE__ */ s("span", { className: "flex-shrink-0 text-[var(--upload-icon-color)]", children: pt }),
|
|
1866
|
+
/* @__PURE__ */ P("span", { className: "flex-1 truncate", children: [
|
|
1829
1867
|
x[0].name,
|
|
1830
|
-
|
|
1868
|
+
C && /* @__PURE__ */ P("span", { className: "ml-1 text-xs text-[var(--muted-foreground)]", children: [
|
|
1831
1869
|
"(",
|
|
1832
1870
|
(x[0].size / 1024).toFixed(2),
|
|
1833
1871
|
" KB)"
|
|
@@ -1838,18 +1876,18 @@ function or(e, o) {
|
|
|
1838
1876
|
{
|
|
1839
1877
|
type: "button",
|
|
1840
1878
|
className: "flex-shrink-0 p-0.5 rounded hover:bg-[var(--upload-del-hover-bg)] text-[var(--upload-del-color)] transition-colors",
|
|
1841
|
-
onClick: () =>
|
|
1879
|
+
onClick: () => _(x[0], 0),
|
|
1842
1880
|
"aria-label": `删除 ${x[0].name}`,
|
|
1843
|
-
children:
|
|
1881
|
+
children: mt
|
|
1844
1882
|
}
|
|
1845
1883
|
)
|
|
1846
1884
|
] }) })
|
|
1847
1885
|
] });
|
|
1848
1886
|
}
|
|
1849
|
-
const
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1887
|
+
const Je = Lt(or);
|
|
1888
|
+
Je.displayName = "Upload";
|
|
1889
|
+
Je.LIST_IGNORE = $t;
|
|
1890
|
+
Je.propTypes = {
|
|
1853
1891
|
sx: t.oneOfType([t.string, t.object]),
|
|
1854
1892
|
style: t.object,
|
|
1855
1893
|
className: t.string,
|
|
@@ -1866,10 +1904,10 @@ qe.propTypes = {
|
|
|
1866
1904
|
showSize: t.bool,
|
|
1867
1905
|
disabled: t.bool
|
|
1868
1906
|
};
|
|
1869
|
-
const rr = ["root", "icon", "content", "actions", "closeIcon"],
|
|
1907
|
+
const rr = ["root", "icon", "content", "actions", "closeIcon"], bt = {
|
|
1870
1908
|
cancel: "取消",
|
|
1871
1909
|
action: "操作"
|
|
1872
|
-
},
|
|
1910
|
+
}, gt = {
|
|
1873
1911
|
small: {
|
|
1874
1912
|
rootClass: "px-[15px] py-[8px] h-[45px] rounded-[6px] gap-[8px] border",
|
|
1875
1913
|
iconSize: 20,
|
|
@@ -1897,7 +1935,7 @@ const rr = ["root", "icon", "content", "actions", "closeIcon"], mt = {
|
|
|
1897
1935
|
buttonGap: "12px",
|
|
1898
1936
|
buttonFontSize: "15px"
|
|
1899
1937
|
}
|
|
1900
|
-
},
|
|
1938
|
+
}, ft = {
|
|
1901
1939
|
info: {
|
|
1902
1940
|
bgVar: "--banner-info-bg",
|
|
1903
1941
|
borderVar: "--banner-info-border",
|
|
@@ -1922,7 +1960,7 @@ const rr = ["root", "icon", "content", "actions", "closeIcon"], mt = {
|
|
|
1922
1960
|
iconVar: "--banner-error-icon",
|
|
1923
1961
|
textVar: "--banner-error-text"
|
|
1924
1962
|
}
|
|
1925
|
-
},
|
|
1963
|
+
}, ht = (e, o, r) => Object.prototype.hasOwnProperty.call(r, e) ? e : o;
|
|
1926
1964
|
function sr(e) {
|
|
1927
1965
|
const {
|
|
1928
1966
|
children: o,
|
|
@@ -1936,68 +1974,68 @@ function sr(e) {
|
|
|
1936
1974
|
level: i = "info",
|
|
1937
1975
|
transparent: u = !1,
|
|
1938
1976
|
bannerBgColor: h,
|
|
1939
|
-
bannerBorderColor:
|
|
1940
|
-
bannerIconColor:
|
|
1941
|
-
sx:
|
|
1942
|
-
style:
|
|
1943
|
-
className:
|
|
1944
|
-
i18nKey:
|
|
1945
|
-
localeText:
|
|
1946
|
-
...
|
|
1947
|
-
} = e, { t:
|
|
1948
|
-
cancel:
|
|
1949
|
-
action:
|
|
1950
|
-
...
|
|
1951
|
-
},
|
|
1952
|
-
baseClassName:
|
|
1977
|
+
bannerBorderColor: m,
|
|
1978
|
+
bannerIconColor: d,
|
|
1979
|
+
sx: g = {},
|
|
1980
|
+
style: v = {},
|
|
1981
|
+
className: w = "",
|
|
1982
|
+
i18nKey: C,
|
|
1983
|
+
localeText: F = {},
|
|
1984
|
+
...O
|
|
1985
|
+
} = e, { t: y } = de(), x = ht(c, "normal", gt), T = ht(i, "info", ft), p = gt[x], S = ft[T], _ = H(g, rr), M = {
|
|
1986
|
+
cancel: y("banner.cancel", bt.cancel),
|
|
1987
|
+
action: y("banner.action", bt.action),
|
|
1988
|
+
...F
|
|
1989
|
+
}, B = l ?? (C === "cancel" ? y("banner.cancel", M.cancel) : M.cancel), A = a ?? (C === "action" ? y("banner.action", M.action) : M.action), k = o ?? B, N = h || (u === !0 ? "transparent" : `var(${S.bgVar})`), L = m || `var(${S.borderVar})`, W = d || `var(${S.iconVar})`, D = `var(${S.textVar})`, E = b({
|
|
1990
|
+
baseClassName: I(
|
|
1953
1991
|
"flex w-full items-center justify-start transition-colors duration-200",
|
|
1954
|
-
|
|
1992
|
+
p.rootClass
|
|
1955
1993
|
),
|
|
1956
|
-
className:
|
|
1994
|
+
className: w,
|
|
1957
1995
|
style: {
|
|
1958
1996
|
backgroundColor: N,
|
|
1959
|
-
borderColor:
|
|
1960
|
-
color: u === !0 ? "var(--muted-foreground)" :
|
|
1961
|
-
...
|
|
1997
|
+
borderColor: L,
|
|
1998
|
+
color: u === !0 ? "var(--muted-foreground)" : D,
|
|
1999
|
+
...v
|
|
1962
2000
|
},
|
|
1963
|
-
sxSlot:
|
|
1964
|
-
}),
|
|
2001
|
+
sxSlot: _.root
|
|
2002
|
+
}), $ = b({
|
|
1965
2003
|
baseClassName: "shrink-0",
|
|
1966
2004
|
baseStyle: {
|
|
1967
|
-
width: `${
|
|
1968
|
-
height: `${
|
|
1969
|
-
color:
|
|
2005
|
+
width: `${p.iconSize}px`,
|
|
2006
|
+
height: `${p.iconSize}px`,
|
|
2007
|
+
color: W
|
|
1970
2008
|
},
|
|
1971
|
-
sxSlot:
|
|
1972
|
-
}),
|
|
1973
|
-
baseClassName:
|
|
2009
|
+
sxSlot: _.icon
|
|
2010
|
+
}), z = b({
|
|
2011
|
+
baseClassName: I(
|
|
1974
2012
|
"flex-grow text-left",
|
|
1975
|
-
|
|
2013
|
+
p.contentClass
|
|
1976
2014
|
),
|
|
1977
|
-
sxSlot:
|
|
1978
|
-
}),
|
|
2015
|
+
sxSlot: _.content
|
|
2016
|
+
}), U = b({
|
|
1979
2017
|
baseClassName: "flex items-center justify-end flex-1",
|
|
1980
2018
|
baseStyle: {
|
|
1981
|
-
gap:
|
|
2019
|
+
gap: p.buttonGap
|
|
1982
2020
|
},
|
|
1983
|
-
sxSlot:
|
|
2021
|
+
sxSlot: _.actions
|
|
1984
2022
|
}), K = b({
|
|
1985
2023
|
baseClassName: "shrink-0 cursor-pointer",
|
|
1986
2024
|
baseStyle: {
|
|
1987
|
-
width: `${
|
|
1988
|
-
height: `${
|
|
2025
|
+
width: `${p.closeIconSize}px`,
|
|
2026
|
+
height: `${p.closeIconSize}px`,
|
|
1989
2027
|
color: "var(--banner-close-icon)"
|
|
1990
2028
|
},
|
|
1991
|
-
sxSlot:
|
|
1992
|
-
}), G = /* @__PURE__ */
|
|
2029
|
+
sxSlot: _.closeIcon
|
|
2030
|
+
}), G = /* @__PURE__ */ P("svg", { viewBox: "0 0 1024 1024", xmlns: "http://www.w3.org/2000/svg", fill: "currentColor", children: [
|
|
1993
2031
|
/* @__PURE__ */ s("path", { d: "M512.50142 958.397886c-119.320573 0-231.499491-46.465265-315.871087-130.837884C112.258737 743.188406 65.792449 631.010511 65.792449 511.688915c0-119.319549 46.466288-231.499491 130.837884-315.871087C281.002952 111.445208 393.180847 64.979944 512.50142 64.979944s231.499491 46.465265 315.871087 130.837884c84.372619 84.372619 130.837884 196.551538 130.837884 315.871087 0 119.321596-46.465265 231.499491-130.837884 315.871087C744.000911 911.932622 631.821993 958.397886 512.50142 958.397886zM512.50142 105.962334c-223.718271 0-405.726581 182.00831-405.726581 405.726581s182.00831 405.726581 405.726581 405.726581c223.718271 0 405.727605-182.00831 405.727605-405.726581S736.220714 105.962334 512.50142 105.962334z" }),
|
|
1994
2032
|
/* @__PURE__ */ s("path", { d: "M510.150886 775.953647c-18.107403 0-32.745798-14.678304-32.745798-32.785707L477.405087 452.191846c0-18.108426 14.638395-32.785707 32.745798-32.785707 18.107403 0 32.745798 14.678304 32.745798 32.785707l0 290.976094C542.896684 761.275343 528.258289 775.953647 510.150886 775.953647z" }),
|
|
1995
2033
|
/* @__PURE__ */ s("path", { d: "M511.357364 296.458969m-45.080731 0a44.054 44.054 0 1 0 90.161463 0 44.054 44.054 0 1 0-90.161463 0Z" })
|
|
1996
|
-
] }), R = /* @__PURE__ */
|
|
2034
|
+
] }), R = /* @__PURE__ */ P("svg", { viewBox: "0 0 1024 1024", xmlns: "http://www.w3.org/2000/svg", fill: "currentColor", children: [
|
|
1997
2035
|
/* @__PURE__ */ s("path", { d: "M869.472578 920.128281 154.906046 920.128281c-31.943526 0-60.545958-16.517185-76.514651-44.181245-15.968693-27.666106-15.96153-60.696384 0.016373-88.355327l357.283266-618.47194c15.971763-27.647687 44.568055-44.152593 76.496232-44.152593 31.930223-0.001023 60.527538 16.504906 76.499301 44.151569l357.283266 618.472963c15.977903 27.659967 15.984043 60.689221 0.017396 88.355327C930.018535 903.611096 901.416104 920.128281 869.472578 920.128281zM512.187265 169.139212c-15.962553 0-30.261211 8.251941-38.247092 22.075785l0 0L116.65793 809.686936c-7.989975 13.829983-7.993045 30.345122-0.008186 44.179199 7.983835 13.83203 22.285562 22.090111 38.257326 22.090111l714.566532 0c15.971763 0 30.273491-8.258081 38.256302-22.090111 7.984858-13.83203 7.980765-30.349215-0.008186-44.179199L550.437427 191.213973C542.452569 177.391153 528.152888 169.138188 512.187265 169.139212z" }),
|
|
1998
2036
|
/* @__PURE__ */ s("path", { d: "M513.732457 621.119233c-18.296715 0-33.257451-14.832823-33.257451-33.129538L480.475006 331.789639c0-18.296715 14.960737-33.129538 33.257451-33.129538 18.296715 0 33.257451 14.832823 33.257451 33.129538l0 256.200056C546.989909 606.28641 532.029172 621.119233 513.732457 621.119233z" }),
|
|
1999
2037
|
/* @__PURE__ */ s("path", { d: "M513.686409 737.619574m-49.991578 0a48.853 48.853 0 1 0 99.983155 0 48.853 48.853 0 1 0-99.983155 0Z" })
|
|
2000
|
-
] }), Q = /* @__PURE__ */ s("svg", { viewBox: "0 0 1024 1024", xmlns: "http://www.w3.org/2000/svg", fill: "currentColor", children: /* @__PURE__ */ s("path", { d: "M85.333333 512C85.333333 276.352 276.352 85.333333 512 85.333333s426.666667 191.018667 426.666667 426.666667-191.018667 426.666667-426.666667 426.666667S85.333333 747.648 85.333333 512z m683.093334-256.426667a358.954667 358.954667 0 0 0-122.922667-80.768A359.466667 359.466667 0 0 0 512 149.333333c-46.08 0-90.624 8.490667-133.504 25.472A358.954667 358.954667 0 0 0 255.573333 255.573333c-35.413333 35.413333-62.336 76.373333-80.768 122.922667A359.466667 359.466667 0 0 0 149.333333 512c0 46.08 8.490667 90.624 25.472 133.504A358.954667 358.954667 0 0 0 255.573333 768.426667c35.413333 35.413333 76.373333 62.336 122.922667 80.768A359.466667 359.466667 0 0 0 512 874.666667c46.08 0 90.624-8.490667 133.504-25.472a358.954667 358.954667 0 0 0 122.922667-80.768c35.413333-35.413333 62.336-76.373333 80.768-122.922667A359.466667 359.466667 0 0 0 874.666667 512c0-46.08-8.490667-90.624-25.472-133.504A358.912 358.912 0 0 0 768.426667 255.573333zM338.517333 640.213333L466.773333 512 338.517333 383.786667l45.226667-45.226667L512 466.688l128.213333-128.213333 45.226667 45.226666L557.312 512l128.213333 128.213333-45.226666 45.226667L512 557.312l-128.213333 128.213333-45.226667-45.226666z" }) }), ue = /* @__PURE__ */
|
|
2038
|
+
] }), Q = /* @__PURE__ */ s("svg", { viewBox: "0 0 1024 1024", xmlns: "http://www.w3.org/2000/svg", fill: "currentColor", children: /* @__PURE__ */ s("path", { d: "M85.333333 512C85.333333 276.352 276.352 85.333333 512 85.333333s426.666667 191.018667 426.666667 426.666667-191.018667 426.666667-426.666667 426.666667S85.333333 747.648 85.333333 512z m683.093334-256.426667a358.954667 358.954667 0 0 0-122.922667-80.768A359.466667 359.466667 0 0 0 512 149.333333c-46.08 0-90.624 8.490667-133.504 25.472A358.954667 358.954667 0 0 0 255.573333 255.573333c-35.413333 35.413333-62.336 76.373333-80.768 122.922667A359.466667 359.466667 0 0 0 149.333333 512c0 46.08 8.490667 90.624 25.472 133.504A358.954667 358.954667 0 0 0 255.573333 768.426667c35.413333 35.413333 76.373333 62.336 122.922667 80.768A359.466667 359.466667 0 0 0 512 874.666667c46.08 0 90.624-8.490667 133.504-25.472a358.954667 358.954667 0 0 0 122.922667-80.768c35.413333-35.413333 62.336-76.373333 80.768-122.922667A359.466667 359.466667 0 0 0 874.666667 512c0-46.08-8.490667-90.624-25.472-133.504A358.912 358.912 0 0 0 768.426667 255.573333zM338.517333 640.213333L466.773333 512 338.517333 383.786667l45.226667-45.226667L512 466.688l128.213333-128.213333 45.226667 45.226666L557.312 512l128.213333 128.213333-45.226666 45.226667L512 557.312l-128.213333 128.213333-45.226667-45.226666z" }) }), ue = /* @__PURE__ */ P("svg", { viewBox: "0 0 1024 1024", xmlns: "http://www.w3.org/2000/svg", fill: "currentColor", children: [
|
|
2001
2039
|
/* @__PURE__ */ s("path", { d: "M512.3 961.3c-247.1 0-448.1-201-448.1-448.1s201-448.1 448.1-448.1 448.1 201 448.1 448.1-201 448.1-448.1 448.1z m0-849.7c-221.4 0-401.6 180.2-401.6 401.6s180.2 401.6 401.6 401.6 401.6-180.2 401.6-401.6-180.2-401.6-401.6-401.6z" }),
|
|
2002
2040
|
/* @__PURE__ */ s("path", { d: "M441.2 676c-16.4 0-32.7-5.8-45.5-17.4l-151.3-138c-9.5-8.6-10.2-23.3-1.5-32.8 8.6-9.5 23.3-10.2 32.8-1.5L427 624.2c7.6 6.9 20.8 6.9 28.4 0l293.5-267.5c9.5-8.6 24.2-8 32.8 1.5 8.6 9.5 8 24.2-1.5 32.8L486.7 658.5c-12.8 11.7-29.1 17.5-45.5 17.5z" })
|
|
2003
2041
|
] }), be = /* @__PURE__ */ s("svg", { viewBox: "0 0 1024 1024", xmlns: "http://www.w3.org/2000/svg", fill: "currentColor", children: /* @__PURE__ */ s("path", { d: "M558.8 509.2l302.8-302.8c3.1-3.1 3.1-8.1 0-11.2l-30.8-30.8c-3.1-3.1-8.1-3.1-11.2 0L516.8 467.2c-1.5 1.5-4.1 1.5-5.6 0L208.3 164.3c-3.1-3.1-8.1-3.1-11.2 0l-30.8 30.8c-3.1 3.1-3.1 8.1 0 11.2l302.8 302.8c1.5 1.5 1.5 4.1 0 5.6l-302.8 303c-3.1 3.1-3.1 8.1 0 11.2l30.8 30.8c3.1 3.1 8.1 3.1 11.2 0l302.8-302.8c1.5-1.5 4.1-1.5 5.6 0l302.8 302.8c3.1 3.1 8.1 3.1 11.2 0l30.8-30.8c3.1-3.1 3.1-8.1 0-11.2L558.8 514.8c-1.5-1.5-1.5-4.1 0-5.6z" }) }), ge = {
|
|
@@ -2006,31 +2044,31 @@ function sr(e) {
|
|
|
2006
2044
|
error: Q,
|
|
2007
2045
|
info: G
|
|
2008
2046
|
};
|
|
2009
|
-
return /* @__PURE__ */
|
|
2047
|
+
return /* @__PURE__ */ P(
|
|
2010
2048
|
"div",
|
|
2011
2049
|
{
|
|
2012
|
-
className:
|
|
2013
|
-
style:
|
|
2014
|
-
"data-level":
|
|
2050
|
+
className: E.className,
|
|
2051
|
+
style: E.style,
|
|
2052
|
+
"data-level": T,
|
|
2015
2053
|
"data-size": x,
|
|
2016
|
-
...
|
|
2054
|
+
...O,
|
|
2017
2055
|
children: [
|
|
2018
|
-
/* @__PURE__ */ s("div", { className:
|
|
2019
|
-
/* @__PURE__ */ s("div", { className:
|
|
2020
|
-
/* @__PURE__ */
|
|
2056
|
+
/* @__PURE__ */ s("div", { className: $.className, style: $.style, children: ge[T] }),
|
|
2057
|
+
/* @__PURE__ */ s("div", { className: z.className, style: z.style, children: k }),
|
|
2058
|
+
/* @__PURE__ */ P("div", { className: U.className, style: U.style, children: [
|
|
2021
2059
|
/* @__PURE__ */ s(
|
|
2022
2060
|
ie,
|
|
2023
2061
|
{
|
|
2024
2062
|
type: "transparent",
|
|
2025
2063
|
sx: {
|
|
2026
2064
|
c: "var(--banner-btn-text)",
|
|
2027
|
-
br:
|
|
2065
|
+
br: p.buttonBorderRadius,
|
|
2028
2066
|
bColor: "transparent",
|
|
2029
|
-
s:
|
|
2067
|
+
s: p.buttonFontSize
|
|
2030
2068
|
},
|
|
2031
2069
|
onClick: r,
|
|
2032
2070
|
size: x === "normal" ? "medium" : x,
|
|
2033
|
-
children:
|
|
2071
|
+
children: B
|
|
2034
2072
|
}
|
|
2035
2073
|
),
|
|
2036
2074
|
/* @__PURE__ */ s(
|
|
@@ -2039,14 +2077,14 @@ function sr(e) {
|
|
|
2039
2077
|
type: "transparent",
|
|
2040
2078
|
sx: {
|
|
2041
2079
|
c: "var(--banner-btn-text)",
|
|
2042
|
-
br:
|
|
2080
|
+
br: p.buttonBorderRadius,
|
|
2043
2081
|
b: 1,
|
|
2044
2082
|
bColor: "var(--banner-btn-border)",
|
|
2045
|
-
s:
|
|
2083
|
+
s: p.buttonFontSize
|
|
2046
2084
|
},
|
|
2047
2085
|
onClick: n,
|
|
2048
2086
|
size: x === "normal" ? "medium" : x,
|
|
2049
|
-
children:
|
|
2087
|
+
children: A
|
|
2050
2088
|
}
|
|
2051
2089
|
),
|
|
2052
2090
|
/* @__PURE__ */ s(
|
|
@@ -2081,11 +2119,11 @@ sr.propTypes = {
|
|
|
2081
2119
|
i18nKey: t.string,
|
|
2082
2120
|
localeText: t.object
|
|
2083
2121
|
};
|
|
2084
|
-
const ar = ["root", "input", "text"],
|
|
2122
|
+
const ar = ["root", "input", "text"], Ke = {
|
|
2085
2123
|
hex: "HEX",
|
|
2086
2124
|
rgb: "RGB",
|
|
2087
2125
|
hsl: "HSL"
|
|
2088
|
-
},
|
|
2126
|
+
}, yt = {
|
|
2089
2127
|
small: { inputSize: 20, fontSize: "11px", gap: "6px" },
|
|
2090
2128
|
medium: { inputSize: 28, fontSize: "12px", gap: "10px" },
|
|
2091
2129
|
large: { inputSize: 36, fontSize: "14px", gap: "14px" }
|
|
@@ -2093,7 +2131,7 @@ const ar = ["root", "input", "text"], Ye = {
|
|
|
2093
2131
|
hex: "hex",
|
|
2094
2132
|
rgb: "rgb",
|
|
2095
2133
|
hsl: "hsl"
|
|
2096
|
-
},
|
|
2134
|
+
}, xt = (e, o, r) => Object.prototype.hasOwnProperty.call(r, e) ? e : o, lr = (e) => {
|
|
2097
2135
|
const o = parseInt(e.slice(1, 3), 16), r = parseInt(e.slice(3, 5), 16), n = parseInt(e.slice(5, 7), 16);
|
|
2098
2136
|
return `rgb(${o}, ${r}, ${n})`;
|
|
2099
2137
|
}, cr = (e) => {
|
|
@@ -2127,75 +2165,75 @@ function dr(e) {
|
|
|
2127
2165
|
size: i = "medium",
|
|
2128
2166
|
sx: u = {},
|
|
2129
2167
|
style: h = {},
|
|
2130
|
-
className:
|
|
2131
|
-
i18nKey:
|
|
2132
|
-
localeText:
|
|
2133
|
-
...
|
|
2134
|
-
} = e, { t:
|
|
2135
|
-
hex:
|
|
2136
|
-
rgb:
|
|
2137
|
-
hsl:
|
|
2138
|
-
...
|
|
2139
|
-
},
|
|
2140
|
-
const
|
|
2141
|
-
o === void 0 && x(
|
|
2142
|
-
},
|
|
2168
|
+
className: m = "",
|
|
2169
|
+
i18nKey: d,
|
|
2170
|
+
localeText: g = {},
|
|
2171
|
+
...v
|
|
2172
|
+
} = e, { t: w } = de(), C = xt(i, "medium", yt), F = xt(a, "hex", nr), O = yt[C], [y, x] = Z(r), T = o ?? y, p = H(u, ar), S = {
|
|
2173
|
+
hex: w("colorpicker.hex", Ke.hex),
|
|
2174
|
+
rgb: w("colorpicker.rgb", Ke.rgb),
|
|
2175
|
+
hsl: w("colorpicker.hsl", Ke.hsl),
|
|
2176
|
+
...g
|
|
2177
|
+
}, _ = (L) => {
|
|
2178
|
+
const W = L.target.value;
|
|
2179
|
+
o === void 0 && x(W), n(W);
|
|
2180
|
+
}, M = [];
|
|
2143
2181
|
if (l) {
|
|
2144
|
-
const
|
|
2145
|
-
|
|
2146
|
-
label:
|
|
2147
|
-
value: ir(
|
|
2182
|
+
const L = d || (typeof l == "string" ? l : null) || F;
|
|
2183
|
+
M.push({
|
|
2184
|
+
label: S[L],
|
|
2185
|
+
value: ir(T, L)
|
|
2148
2186
|
});
|
|
2149
2187
|
}
|
|
2150
|
-
const
|
|
2151
|
-
baseClassName:
|
|
2188
|
+
const B = b({
|
|
2189
|
+
baseClassName: I(
|
|
2152
2190
|
"inline-flex items-center",
|
|
2153
2191
|
c && "cursor-not-allowed opacity-60"
|
|
2154
2192
|
),
|
|
2155
|
-
className:
|
|
2156
|
-
baseStyle: { gap:
|
|
2193
|
+
className: m,
|
|
2194
|
+
baseStyle: { gap: O.gap },
|
|
2157
2195
|
style: h,
|
|
2158
|
-
sxSlot:
|
|
2159
|
-
}),
|
|
2160
|
-
baseClassName:
|
|
2196
|
+
sxSlot: p.root
|
|
2197
|
+
}), A = b({
|
|
2198
|
+
baseClassName: I(
|
|
2161
2199
|
"shrink-0 cursor-pointer border-2 border-[var(--border)] rounded-full bg-transparent overflow-hidden transition-colors duration-200",
|
|
2162
2200
|
c && "cursor-not-allowed"
|
|
2163
2201
|
),
|
|
2164
2202
|
baseStyle: {
|
|
2165
|
-
width: `${
|
|
2166
|
-
height: `${
|
|
2203
|
+
width: `${O.inputSize}px`,
|
|
2204
|
+
height: `${O.inputSize}px`,
|
|
2167
2205
|
padding: 0
|
|
2168
2206
|
},
|
|
2169
|
-
sxSlot:
|
|
2170
|
-
}),
|
|
2207
|
+
sxSlot: p.input
|
|
2208
|
+
}), k = b({
|
|
2171
2209
|
baseClassName: "flex flex-col text-[var(--muted-foreground)]",
|
|
2172
|
-
baseStyle: { fontSize:
|
|
2173
|
-
sxSlot:
|
|
2210
|
+
baseStyle: { fontSize: O.fontSize },
|
|
2211
|
+
sxSlot: p.text
|
|
2174
2212
|
});
|
|
2175
|
-
return /* @__PURE__ */
|
|
2213
|
+
return /* @__PURE__ */ P(Ne, { children: [
|
|
2176
2214
|
/* @__PURE__ */ s("style", { children: `
|
|
2177
2215
|
.tango-cp-input::-webkit-color-swatch-wrapper { padding: 0; }
|
|
2178
2216
|
.tango-cp-input::-webkit-color-swatch { border: 0; border-radius: 9999px; }
|
|
2179
2217
|
.tango-cp-input::-moz-color-swatch { border: 0; border-radius: 9999px; }
|
|
2180
2218
|
` }),
|
|
2181
|
-
/* @__PURE__ */
|
|
2219
|
+
/* @__PURE__ */ P("div", { className: B.className, style: B.style, ...v, children: [
|
|
2182
2220
|
/* @__PURE__ */ s(
|
|
2183
2221
|
"input",
|
|
2184
2222
|
{
|
|
2185
2223
|
type: "color",
|
|
2186
|
-
value:
|
|
2187
|
-
onChange:
|
|
2224
|
+
value: T,
|
|
2225
|
+
onChange: _,
|
|
2188
2226
|
disabled: c,
|
|
2189
|
-
className: `tango-cp-input ${
|
|
2190
|
-
style:
|
|
2191
|
-
"aria-label":
|
|
2227
|
+
className: `tango-cp-input ${A.className}`,
|
|
2228
|
+
style: A.style,
|
|
2229
|
+
"aria-label": v["aria-label"] || `颜色选择器: ${T}`
|
|
2192
2230
|
}
|
|
2193
2231
|
),
|
|
2194
|
-
l &&
|
|
2195
|
-
|
|
2232
|
+
l && M.length > 0 && /* @__PURE__ */ s("div", { className: k.className, style: k.style, children: M.map(({ label: L, value: W }) => /* @__PURE__ */ P("span", { children: [
|
|
2233
|
+
L,
|
|
2196
2234
|
": ",
|
|
2197
|
-
|
|
2198
|
-
] },
|
|
2235
|
+
W
|
|
2236
|
+
] }, L)) })
|
|
2199
2237
|
] })
|
|
2200
2238
|
] });
|
|
2201
2239
|
}
|
|
@@ -2213,10 +2251,10 @@ dr.propTypes = {
|
|
|
2213
2251
|
i18nKey: t.string,
|
|
2214
2252
|
localeText: t.object
|
|
2215
2253
|
};
|
|
2216
|
-
const ur = ["root", "date", "weekday", "time"],
|
|
2254
|
+
const ur = ["root", "date", "weekday", "time"], vt = {
|
|
2217
2255
|
weekdayPrefix: "星期",
|
|
2218
2256
|
weekdayShortPrefix: "周"
|
|
2219
|
-
},
|
|
2257
|
+
}, St = {
|
|
2220
2258
|
default: "default",
|
|
2221
2259
|
line: "line",
|
|
2222
2260
|
full: "full",
|
|
@@ -2297,47 +2335,47 @@ function fr(e) {
|
|
|
2297
2335
|
i18nKey: a,
|
|
2298
2336
|
localeText: i = {},
|
|
2299
2337
|
...u
|
|
2300
|
-
} = e || {}, { t: h, locale:
|
|
2301
|
-
|
|
2302
|
-
|
|
2338
|
+
} = e || {}, { t: h, locale: m } = de(), [d, g] = Z(!1);
|
|
2339
|
+
se(() => {
|
|
2340
|
+
g(!0);
|
|
2303
2341
|
}, []);
|
|
2304
|
-
const
|
|
2342
|
+
const v = pr(o, "default", St), w = m === "en-US" ? "en-US" : "zh-CN";
|
|
2305
2343
|
({
|
|
2306
|
-
weekdayPrefix: h("date.weekdayPrefix",
|
|
2307
|
-
weekdayShortPrefix: h("date.weekdayShortPrefix",
|
|
2344
|
+
weekdayPrefix: h("date.weekdayPrefix", vt.weekdayPrefix),
|
|
2345
|
+
weekdayShortPrefix: h("date.weekdayShortPrefix", vt.weekdayShortPrefix),
|
|
2308
2346
|
...i
|
|
2309
2347
|
});
|
|
2310
|
-
const
|
|
2311
|
-
baseClassName:
|
|
2348
|
+
const C = H(n, ur), F = a && St[a] ? a : v, O = d ? gr(F, w, r) : [], y = b({
|
|
2349
|
+
baseClassName: I("inline-flex items-center gap-1 text-[var(--foreground)]"),
|
|
2312
2350
|
className: l,
|
|
2313
2351
|
baseStyle: {},
|
|
2314
2352
|
style: c,
|
|
2315
|
-
sxSlot:
|
|
2353
|
+
sxSlot: C.root
|
|
2316
2354
|
}), x = {
|
|
2317
2355
|
date: b({
|
|
2318
2356
|
baseClassName: "",
|
|
2319
|
-
sxSlot:
|
|
2357
|
+
sxSlot: C.date
|
|
2320
2358
|
}),
|
|
2321
2359
|
weekday: b({
|
|
2322
2360
|
baseClassName: "text-[var(--muted-foreground)]",
|
|
2323
|
-
sxSlot:
|
|
2361
|
+
sxSlot: C.weekday
|
|
2324
2362
|
}),
|
|
2325
2363
|
time: b({
|
|
2326
2364
|
baseClassName: "",
|
|
2327
|
-
sxSlot:
|
|
2365
|
+
sxSlot: C.time
|
|
2328
2366
|
})
|
|
2329
2367
|
};
|
|
2330
2368
|
return /* @__PURE__ */ s(
|
|
2331
2369
|
"div",
|
|
2332
2370
|
{
|
|
2333
|
-
className:
|
|
2334
|
-
style:
|
|
2371
|
+
className: y.className,
|
|
2372
|
+
style: y.style,
|
|
2335
2373
|
role: "timer",
|
|
2336
2374
|
"aria-live": "polite",
|
|
2337
2375
|
...u,
|
|
2338
|
-
children:
|
|
2339
|
-
const
|
|
2340
|
-
return /* @__PURE__ */ s("span", { className:
|
|
2376
|
+
children: O.map((T) => {
|
|
2377
|
+
const p = x[T.key] || { className: "", style: {} };
|
|
2378
|
+
return /* @__PURE__ */ s("span", { className: p.className, style: p.style, children: T.text }, T.key);
|
|
2341
2379
|
})
|
|
2342
2380
|
}
|
|
2343
2381
|
);
|
|
@@ -2371,7 +2409,7 @@ const hr = ["root", "input", "panel", "header", "body", "footer"], me = {
|
|
|
2371
2409
|
nextMonth: "下一月",
|
|
2372
2410
|
weekDays: ["日", "一", "二", "三", "四", "五", "六"],
|
|
2373
2411
|
monthFormat: "${year} 年 ${month} 月"
|
|
2374
|
-
},
|
|
2412
|
+
}, Nt = {
|
|
2375
2413
|
small: { inputPx: "px-2 py-1", textSm: "text-xs", minW: "min-w-[140px]", panelW: "w-[260px]" },
|
|
2376
2414
|
medium: { inputPx: "px-3 py-2", textSm: "text-sm", minW: "min-w-[180px]", panelW: "w-[300px]" },
|
|
2377
2415
|
large: { inputPx: "px-4 py-3", textSm: "text-base", minW: "min-w-[220px]", panelW: "w-[340px]" }
|
|
@@ -2388,91 +2426,91 @@ function xr(e) {
|
|
|
2388
2426
|
sx: i = {},
|
|
2389
2427
|
style: u = {},
|
|
2390
2428
|
className: h = "",
|
|
2391
|
-
i18nKey:
|
|
2392
|
-
localeText:
|
|
2393
|
-
placeholder:
|
|
2394
|
-
...
|
|
2395
|
-
} = e, { t:
|
|
2396
|
-
const
|
|
2397
|
-
return new Date(
|
|
2398
|
-
}),
|
|
2399
|
-
placeholder:
|
|
2400
|
-
placeholderTime:
|
|
2401
|
-
timeLabel:
|
|
2402
|
-
confirm:
|
|
2403
|
-
cancel:
|
|
2404
|
-
prevMonth:
|
|
2405
|
-
nextMonth:
|
|
2406
|
-
weekDays:
|
|
2407
|
-
monthFormat:
|
|
2408
|
-
...
|
|
2429
|
+
i18nKey: m,
|
|
2430
|
+
localeText: d = {},
|
|
2431
|
+
placeholder: g,
|
|
2432
|
+
...v
|
|
2433
|
+
} = e, { t: w, locale: C } = de(), F = yr(a, "medium", Nt), O = Nt[F], y = C === "en-US", [x, T] = Z(r || ""), p = o !== void 0 ? o : x, [S, _] = Z("00"), [M, B] = Z("00"), [A, k] = Z(!1), [N, L] = Z(() => {
|
|
2434
|
+
const f = /* @__PURE__ */ new Date();
|
|
2435
|
+
return new Date(f.getFullYear(), f.getMonth(), 1);
|
|
2436
|
+
}), W = ke(null), D = {
|
|
2437
|
+
placeholder: w("datepicker.placeholder", me.placeholder),
|
|
2438
|
+
placeholderTime: w("datepicker.placeholderTime", me.placeholderTime),
|
|
2439
|
+
timeLabel: w("datepicker.timeLabel", me.timeLabel),
|
|
2440
|
+
confirm: w("datepicker.confirm", me.confirm),
|
|
2441
|
+
cancel: w("datepicker.cancel", me.cancel),
|
|
2442
|
+
prevMonth: w("datepicker.prevMonth", me.prevMonth),
|
|
2443
|
+
nextMonth: w("datepicker.nextMonth", me.nextMonth),
|
|
2444
|
+
weekDays: y ? ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"] : me.weekDays,
|
|
2445
|
+
monthFormat: y ? "${month}/${year}" : me.monthFormat,
|
|
2446
|
+
...d
|
|
2409
2447
|
};
|
|
2410
|
-
|
|
2411
|
-
const
|
|
2412
|
-
|
|
2448
|
+
se(() => {
|
|
2449
|
+
const f = (V) => {
|
|
2450
|
+
W.current && !W.current.contains(V.target) && k(!1);
|
|
2413
2451
|
};
|
|
2414
|
-
return document.addEventListener("mousedown",
|
|
2452
|
+
return document.addEventListener("mousedown", f), () => document.removeEventListener("mousedown", f);
|
|
2415
2453
|
}, []);
|
|
2416
|
-
const
|
|
2417
|
-
const V =
|
|
2454
|
+
const E = (f) => {
|
|
2455
|
+
const V = f.getFullYear(), ee = (f.getMonth() + 1).toString().padStart(2, "0"), ce = f.getDate().toString().padStart(2, "0");
|
|
2418
2456
|
return `${V}-${ee}-${ce}`;
|
|
2419
|
-
},
|
|
2420
|
-
const
|
|
2421
|
-
return
|
|
2422
|
-
}, [N,
|
|
2423
|
-
const
|
|
2457
|
+
}, $ = Se(() => {
|
|
2458
|
+
const f = N.getFullYear(), V = N.getMonth() + 1;
|
|
2459
|
+
return D.monthFormat.replace("${year}", String(f)).replace("${month}", String(V));
|
|
2460
|
+
}, [N, D.monthFormat]), z = Se(() => {
|
|
2461
|
+
const f = N.getFullYear(), V = N.getMonth(), ee = new Date(f, V, 1).getDay(), ce = new Date(f, V + 1, 0).getDate(), pe = Array.from({ length: ce }, (Qe, Fe) => Fe + 1);
|
|
2424
2462
|
return [...Array(ee).fill(null), ...pe];
|
|
2425
|
-
}, [N]),
|
|
2426
|
-
const V = new Date(N.getFullYear(), N.getMonth(),
|
|
2427
|
-
return
|
|
2428
|
-
}, G = (
|
|
2429
|
-
if (
|
|
2463
|
+
}, [N]), U = Se(() => p ? l ? `${p} ${S}:${M}` : p : "", [p, S, M, l]), K = (f) => {
|
|
2464
|
+
const V = new Date(N.getFullYear(), N.getMonth(), f);
|
|
2465
|
+
return p === E(V);
|
|
2466
|
+
}, G = (f, V, ee) => {
|
|
2467
|
+
if (f) {
|
|
2430
2468
|
if (l) {
|
|
2431
|
-
const ce = `${
|
|
2432
|
-
n(`${
|
|
2469
|
+
const ce = `${f}T${V}:${ee}`, pe = new Date(ce), Qe = pe.getFullYear(), Fe = (pe.getMonth() + 1).toString().padStart(2, "0"), Vt = pe.getDate().toString().padStart(2, "0"), Yt = pe.getHours().toString().padStart(2, "0"), Kt = pe.getMinutes().toString().padStart(2, "0");
|
|
2470
|
+
n(`${Qe}-${Fe}-${Vt} ${Yt}:${Kt}`, ce);
|
|
2433
2471
|
return;
|
|
2434
2472
|
}
|
|
2435
|
-
n(
|
|
2473
|
+
n(f, f);
|
|
2436
2474
|
}
|
|
2437
|
-
}, R = (
|
|
2438
|
-
const V = new Date(N.getFullYear(), N.getMonth(),
|
|
2439
|
-
o === void 0 &&
|
|
2440
|
-
}, Q = (
|
|
2441
|
-
const V =
|
|
2442
|
-
|
|
2443
|
-
}, ue = (
|
|
2444
|
-
const V =
|
|
2445
|
-
|
|
2475
|
+
}, R = (f) => {
|
|
2476
|
+
const V = new Date(N.getFullYear(), N.getMonth(), f), ee = E(V);
|
|
2477
|
+
o === void 0 && T(ee), G(ee, S, M), l || k(!1);
|
|
2478
|
+
}, Q = (f) => {
|
|
2479
|
+
const V = f.target.value;
|
|
2480
|
+
_(V), G(p, V, M);
|
|
2481
|
+
}, ue = (f) => {
|
|
2482
|
+
const V = f.target.value;
|
|
2483
|
+
B(V), G(p, S, V);
|
|
2446
2484
|
}, be = () => {
|
|
2447
2485
|
if (!c) {
|
|
2448
|
-
if (
|
|
2449
|
-
const [
|
|
2450
|
-
|
|
2486
|
+
if (p) {
|
|
2487
|
+
const [f, V] = p.split("-").map(Number);
|
|
2488
|
+
L(new Date(f, V - 1, 1));
|
|
2451
2489
|
}
|
|
2452
|
-
|
|
2490
|
+
k(!0);
|
|
2453
2491
|
}
|
|
2454
|
-
}, ge = Array.from({ length: 24 }, (
|
|
2455
|
-
typeof i == "string" && (X.input.tw =
|
|
2492
|
+
}, ge = Array.from({ length: 24 }, (f, V) => String(V).padStart(2, "0")), fe = Array.from({ length: 60 }, (f, V) => String(V).padStart(2, "0")), X = H(i, hr);
|
|
2493
|
+
typeof i == "string" && (X.input.tw = I(X.input.tw, X.root.tw), X.root.tw = "");
|
|
2456
2494
|
const J = b({
|
|
2457
2495
|
baseClassName: "relative inline-block",
|
|
2458
2496
|
sxSlot: X.root
|
|
2459
|
-
}),
|
|
2460
|
-
baseClassName:
|
|
2497
|
+
}), j = b({
|
|
2498
|
+
baseClassName: I(
|
|
2461
2499
|
"border border-[var(--border)] rounded-[var(--radius)] bg-[var(--card)] text-[var(--foreground)] placeholder:text-[var(--muted-foreground)] outline-none transition-all duration-200 cursor-pointer",
|
|
2462
2500
|
"focus:border-[var(--primary)] focus:shadow-[0_0_0_2px_color-mix(in_srgb,var(--primary)_18%,transparent)]",
|
|
2463
2501
|
"hover:border-[var(--primary)]",
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2502
|
+
O.inputPx,
|
|
2503
|
+
O.textSm,
|
|
2504
|
+
O.minW,
|
|
2467
2505
|
c && "bg-[var(--muted)] text-[var(--muted-foreground)] cursor-not-allowed"
|
|
2468
2506
|
),
|
|
2469
2507
|
className: h,
|
|
2470
2508
|
style: u,
|
|
2471
2509
|
sxSlot: X.input
|
|
2472
2510
|
}), q = b({
|
|
2473
|
-
baseClassName:
|
|
2511
|
+
baseClassName: I(
|
|
2474
2512
|
"absolute top-[calc(100%+8px)] left-0 z-20 p-3 border border-[var(--border)] bg-[var(--card)] rounded-xl shadow-[0_8px_28px_rgba(0,0,0,0.12)]",
|
|
2475
|
-
|
|
2513
|
+
O.panelW
|
|
2476
2514
|
),
|
|
2477
2515
|
sxSlot: X.panel
|
|
2478
2516
|
}), le = b({
|
|
@@ -2481,84 +2519,84 @@ function xr(e) {
|
|
|
2481
2519
|
}), re = b({
|
|
2482
2520
|
baseClassName: "flex flex-wrap",
|
|
2483
2521
|
sxSlot: X.body
|
|
2484
|
-
}),
|
|
2522
|
+
}), ae = b({
|
|
2485
2523
|
baseClassName: "mt-2.5 pt-2.5 border-t border-[var(--border)]",
|
|
2486
2524
|
sxSlot: X.footer
|
|
2487
2525
|
});
|
|
2488
|
-
return /* @__PURE__ */
|
|
2526
|
+
return /* @__PURE__ */ P("div", { className: J.className, style: J.style, ref: W, ...v, children: [
|
|
2489
2527
|
/* @__PURE__ */ s(
|
|
2490
2528
|
"input",
|
|
2491
2529
|
{
|
|
2492
2530
|
type: "text",
|
|
2493
|
-
value:
|
|
2531
|
+
value: U,
|
|
2494
2532
|
readOnly: !0,
|
|
2495
2533
|
onClick: be,
|
|
2496
|
-
className:
|
|
2497
|
-
style:
|
|
2534
|
+
className: j.className,
|
|
2535
|
+
style: j.style,
|
|
2498
2536
|
disabled: c,
|
|
2499
|
-
placeholder:
|
|
2500
|
-
"aria-label":
|
|
2537
|
+
placeholder: g || (l ? D.placeholderTime : D.placeholder),
|
|
2538
|
+
"aria-label": v["aria-label"] || g || (l ? D.placeholderTime : D.placeholder),
|
|
2501
2539
|
"aria-haspopup": "dialog",
|
|
2502
|
-
"aria-expanded":
|
|
2540
|
+
"aria-expanded": A
|
|
2503
2541
|
}
|
|
2504
2542
|
),
|
|
2505
|
-
|
|
2506
|
-
/* @__PURE__ */
|
|
2543
|
+
A && !c && /* @__PURE__ */ P("div", { className: q.className, style: q.style, role: "dialog", "aria-label": "日期选择面板", children: [
|
|
2544
|
+
/* @__PURE__ */ P("div", { className: le.className, style: le.style, children: [
|
|
2507
2545
|
/* @__PURE__ */ s(
|
|
2508
2546
|
"button",
|
|
2509
2547
|
{
|
|
2510
2548
|
type: "button",
|
|
2511
2549
|
className: "w-7 h-7 border border-[var(--border)] bg-[var(--card)] text-sm cursor-pointer rounded hover:border-[var(--primary)] hover:bg-[color-mix(in_srgb,var(--primary)_14%,var(--card))]",
|
|
2512
|
-
onClick: () =>
|
|
2513
|
-
"aria-label":
|
|
2550
|
+
onClick: () => L(new Date(N.getFullYear(), N.getMonth() - 1, 1)),
|
|
2551
|
+
"aria-label": D.prevMonth,
|
|
2514
2552
|
children: "<"
|
|
2515
2553
|
}
|
|
2516
2554
|
),
|
|
2517
|
-
/* @__PURE__ */ s("div", { className: "text-sm font-semibold text-[var(--foreground)]", children:
|
|
2555
|
+
/* @__PURE__ */ s("div", { className: "text-sm font-semibold text-[var(--foreground)]", children: $ }),
|
|
2518
2556
|
/* @__PURE__ */ s(
|
|
2519
2557
|
"button",
|
|
2520
2558
|
{
|
|
2521
2559
|
type: "button",
|
|
2522
2560
|
className: "w-7 h-7 border border-[var(--border)] bg-[var(--card)] text-sm cursor-pointer rounded hover:border-[var(--primary)] hover:bg-[color-mix(in_srgb,var(--primary)_14%,var(--card))]",
|
|
2523
|
-
onClick: () =>
|
|
2524
|
-
"aria-label":
|
|
2561
|
+
onClick: () => L(new Date(N.getFullYear(), N.getMonth() + 1, 1)),
|
|
2562
|
+
"aria-label": D.nextMonth,
|
|
2525
2563
|
children: ">"
|
|
2526
2564
|
}
|
|
2527
2565
|
)
|
|
2528
2566
|
] }),
|
|
2529
|
-
/* @__PURE__ */
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
if (!
|
|
2567
|
+
/* @__PURE__ */ P("div", { className: re.className, style: re.style, children: [
|
|
2568
|
+
D.weekDays.map((f) => /* @__PURE__ */ s("div", { className: "w-[calc(100%/7)] text-center leading-[30px] text-xs text-[var(--muted-foreground)]", children: f }, f)),
|
|
2569
|
+
z.map((f, V) => {
|
|
2570
|
+
if (!f)
|
|
2533
2571
|
return /* @__PURE__ */ s("div", { className: "w-[calc(100%/7)] text-center leading-[30px]" }, `empty-${V}`);
|
|
2534
|
-
const ee = K(
|
|
2572
|
+
const ee = K(f);
|
|
2535
2573
|
return /* @__PURE__ */ s(
|
|
2536
2574
|
"button",
|
|
2537
2575
|
{
|
|
2538
2576
|
type: "button",
|
|
2539
|
-
className:
|
|
2577
|
+
className: I(
|
|
2540
2578
|
"w-[calc(100%/7)] text-center leading-[30px] border-none bg-transparent cursor-pointer rounded-md text-[13px] text-[var(--foreground)] hover:bg-[var(--muted)]",
|
|
2541
2579
|
ee && "bg-[var(--primary)] text-[var(--primary-foreground)] hover:bg-[var(--primary)]"
|
|
2542
2580
|
),
|
|
2543
|
-
onClick: () => R(
|
|
2544
|
-
"aria-label": `${N.getFullYear()}-${(N.getMonth() + 1).toString().padStart(2, "0")}-${
|
|
2545
|
-
children:
|
|
2581
|
+
onClick: () => R(f),
|
|
2582
|
+
"aria-label": `${N.getFullYear()}-${(N.getMonth() + 1).toString().padStart(2, "0")}-${f.toString().padStart(2, "0")}`,
|
|
2583
|
+
children: f
|
|
2546
2584
|
},
|
|
2547
|
-
`${N.getFullYear()}-${N.getMonth()}-${
|
|
2585
|
+
`${N.getFullYear()}-${N.getMonth()}-${f}`
|
|
2548
2586
|
);
|
|
2549
2587
|
})
|
|
2550
2588
|
] }),
|
|
2551
|
-
l && /* @__PURE__ */
|
|
2552
|
-
/* @__PURE__ */ s("div", { className: "text-xs text-[var(--muted-foreground)] mb-2", children:
|
|
2553
|
-
/* @__PURE__ */
|
|
2589
|
+
l && /* @__PURE__ */ P("div", { className: ae.className, style: ae.style, children: [
|
|
2590
|
+
/* @__PURE__ */ s("div", { className: "text-xs text-[var(--muted-foreground)] mb-2", children: D.timeLabel }),
|
|
2591
|
+
/* @__PURE__ */ P("div", { className: "flex items-center gap-2", children: [
|
|
2554
2592
|
/* @__PURE__ */ s(
|
|
2555
2593
|
"select",
|
|
2556
2594
|
{
|
|
2557
2595
|
className: "w-20 h-8 border border-[var(--border)] rounded-md px-2 text-[13px] outline-none bg-[var(--card)] text-[var(--foreground)] focus:border-[var(--primary)]",
|
|
2558
|
-
value:
|
|
2596
|
+
value: S,
|
|
2559
2597
|
onChange: Q,
|
|
2560
2598
|
"aria-label": "小时",
|
|
2561
|
-
children: ge.map((
|
|
2599
|
+
children: ge.map((f) => /* @__PURE__ */ s("option", { value: f, children: f }, f))
|
|
2562
2600
|
}
|
|
2563
2601
|
),
|
|
2564
2602
|
/* @__PURE__ */ s("span", { className: "font-semibold text-[var(--muted-foreground)]", children: ":" }),
|
|
@@ -2566,18 +2604,18 @@ function xr(e) {
|
|
|
2566
2604
|
"select",
|
|
2567
2605
|
{
|
|
2568
2606
|
className: "w-20 h-8 border border-[var(--border)] rounded-md px-2 text-[13px] outline-none bg-[var(--card)] text-[var(--foreground)] focus:border-[var(--primary)]",
|
|
2569
|
-
value:
|
|
2607
|
+
value: M,
|
|
2570
2608
|
onChange: ue,
|
|
2571
2609
|
"aria-label": "分钟",
|
|
2572
|
-
children: fe.map((
|
|
2610
|
+
children: fe.map((f) => /* @__PURE__ */ s("option", { value: f, children: f }, f))
|
|
2573
2611
|
}
|
|
2574
2612
|
)
|
|
2575
2613
|
] }),
|
|
2576
|
-
/* @__PURE__ */
|
|
2614
|
+
/* @__PURE__ */ P("div", { className: "mt-2.5 flex justify-end gap-2", children: [
|
|
2577
2615
|
/* @__PURE__ */ s(
|
|
2578
2616
|
ie,
|
|
2579
2617
|
{
|
|
2580
|
-
onClick: () =>
|
|
2618
|
+
onClick: () => k(!1),
|
|
2581
2619
|
size: "small",
|
|
2582
2620
|
type: "transparent",
|
|
2583
2621
|
outline: !0,
|
|
@@ -2585,20 +2623,20 @@ function xr(e) {
|
|
|
2585
2623
|
backgroundColor: "var(--datepicker-cancel-bg)",
|
|
2586
2624
|
color: "var(--datepicker-cancel-fg)"
|
|
2587
2625
|
},
|
|
2588
|
-
children:
|
|
2626
|
+
children: D.cancel
|
|
2589
2627
|
}
|
|
2590
2628
|
),
|
|
2591
2629
|
/* @__PURE__ */ s(
|
|
2592
2630
|
ie,
|
|
2593
2631
|
{
|
|
2594
|
-
onClick: () =>
|
|
2632
|
+
onClick: () => k(!1),
|
|
2595
2633
|
size: "small",
|
|
2596
2634
|
style: {
|
|
2597
2635
|
backgroundColor: "var(--datepicker-confirm-bg)",
|
|
2598
2636
|
color: "var(--datepicker-confirm-fg)",
|
|
2599
2637
|
borderColor: "var(--datepicker-confirm-bg)"
|
|
2600
2638
|
},
|
|
2601
|
-
children:
|
|
2639
|
+
children: D.confirm
|
|
2602
2640
|
}
|
|
2603
2641
|
)
|
|
2604
2642
|
] })
|
|
@@ -2619,7 +2657,7 @@ xr.propTypes = {
|
|
|
2619
2657
|
i18nKey: t.string,
|
|
2620
2658
|
localeText: t.object
|
|
2621
2659
|
};
|
|
2622
|
-
const vr = ["overlay", "container", "header", "title", "closeBtn", "content", "footer"],
|
|
2660
|
+
const vr = ["overlay", "container", "header", "title", "closeBtn", "content", "footer"], _e = {
|
|
2623
2661
|
title: "基础标题",
|
|
2624
2662
|
okText: "确定",
|
|
2625
2663
|
cancelText: "取消",
|
|
@@ -2647,109 +2685,109 @@ function Tr(e) {
|
|
|
2647
2685
|
onOk: i,
|
|
2648
2686
|
type: u = "right",
|
|
2649
2687
|
width: h,
|
|
2650
|
-
height:
|
|
2651
|
-
sx:
|
|
2652
|
-
style:
|
|
2653
|
-
className:
|
|
2654
|
-
maskClosable:
|
|
2655
|
-
footerButtons:
|
|
2656
|
-
localeText:
|
|
2657
|
-
...
|
|
2658
|
-
} = e, { t:
|
|
2659
|
-
|
|
2688
|
+
height: m,
|
|
2689
|
+
sx: d = {},
|
|
2690
|
+
style: g = {},
|
|
2691
|
+
className: v = "",
|
|
2692
|
+
maskClosable: w = !0,
|
|
2693
|
+
footerButtons: C,
|
|
2694
|
+
localeText: F = {},
|
|
2695
|
+
...O
|
|
2696
|
+
} = e, { t: y } = de(), x = Cr(u, "right", Sr), [T, p] = Z(!1), [S, _] = Z(!1);
|
|
2697
|
+
se(() => {
|
|
2660
2698
|
if (l) {
|
|
2661
|
-
|
|
2662
|
-
const R = setTimeout(() =>
|
|
2699
|
+
p(!0);
|
|
2700
|
+
const R = setTimeout(() => _(!0), 30);
|
|
2663
2701
|
return () => clearTimeout(R);
|
|
2664
2702
|
}
|
|
2665
|
-
if (
|
|
2666
|
-
|
|
2667
|
-
const R = setTimeout(() =>
|
|
2703
|
+
if (T) {
|
|
2704
|
+
_(!1);
|
|
2705
|
+
const R = setTimeout(() => p(!1), 300);
|
|
2668
2706
|
return () => clearTimeout(R);
|
|
2669
2707
|
}
|
|
2670
|
-
}, [l]),
|
|
2671
|
-
if (
|
|
2708
|
+
}, [l]), se(() => {
|
|
2709
|
+
if (T) {
|
|
2672
2710
|
const R = parseInt(document.body.dataset.tangoScrollLock || "0", 10);
|
|
2673
2711
|
return R === 0 && (document.body.dataset.tangoOriginalOverflow = document.body.style.overflow), document.body.dataset.tangoScrollLock = String(R + 1), document.body.style.overflow = "hidden", () => {
|
|
2674
2712
|
const Q = parseInt(document.body.dataset.tangoScrollLock || "0", 10);
|
|
2675
2713
|
Q <= 1 ? (document.body.style.overflow = document.body.dataset.tangoOriginalOverflow || "", delete document.body.dataset.tangoOriginalOverflow, delete document.body.dataset.tangoScrollLock) : document.body.dataset.tangoScrollLock = String(Q - 1);
|
|
2676
2714
|
};
|
|
2677
2715
|
}
|
|
2678
|
-
}, [
|
|
2679
|
-
const
|
|
2680
|
-
x === "left" || x === "right" ?
|
|
2681
|
-
const
|
|
2682
|
-
title: r ??
|
|
2683
|
-
okText: n ??
|
|
2684
|
-
cancelText: c ??
|
|
2685
|
-
closeAriaLabel:
|
|
2686
|
-
...
|
|
2687
|
-
},
|
|
2716
|
+
}, [T]);
|
|
2717
|
+
const M = {};
|
|
2718
|
+
x === "left" || x === "right" ? M.width = h || "320px" : M.height = m || "300px";
|
|
2719
|
+
const B = {
|
|
2720
|
+
title: r ?? y("drawer.title", _e.title),
|
|
2721
|
+
okText: n ?? y("drawer.okText", _e.okText),
|
|
2722
|
+
cancelText: c ?? y("drawer.cancelText", _e.cancelText),
|
|
2723
|
+
closeAriaLabel: y("drawer.closeAriaLabel", _e.closeAriaLabel),
|
|
2724
|
+
...F
|
|
2725
|
+
}, A = H(d, vr), k = b({
|
|
2688
2726
|
baseClassName: "fixed inset-0 z-[999] flex",
|
|
2689
|
-
sxSlot:
|
|
2727
|
+
sxSlot: A.overlay
|
|
2690
2728
|
}), N = {
|
|
2691
|
-
tw:
|
|
2692
|
-
css: { ...
|
|
2693
|
-
},
|
|
2694
|
-
baseClassName:
|
|
2729
|
+
tw: I(A.root.tw, A.container.tw),
|
|
2730
|
+
css: { ...A.root.css, ...A.container.css }
|
|
2731
|
+
}, L = b({
|
|
2732
|
+
baseClassName: I(
|
|
2695
2733
|
"fixed bg-[var(--card)] text-[var(--foreground)] flex flex-col transition-all duration-300 ease-in-out",
|
|
2696
2734
|
Nr[x]
|
|
2697
2735
|
),
|
|
2698
|
-
className:
|
|
2736
|
+
className: v,
|
|
2699
2737
|
style: {
|
|
2700
|
-
...
|
|
2701
|
-
transform:
|
|
2702
|
-
...
|
|
2738
|
+
...M,
|
|
2739
|
+
transform: S ? "translate(0, 0)" : wr[x],
|
|
2740
|
+
...g
|
|
2703
2741
|
},
|
|
2704
2742
|
sxSlot: N
|
|
2705
|
-
}),
|
|
2743
|
+
}), W = b({
|
|
2706
2744
|
baseClassName: "flex items-center justify-between px-5 pt-5 pb-3 shrink-0",
|
|
2707
|
-
sxSlot:
|
|
2708
|
-
}),
|
|
2745
|
+
sxSlot: A.header
|
|
2746
|
+
}), D = b({
|
|
2709
2747
|
baseClassName: "text-lg font-bold text-[var(--foreground)]",
|
|
2710
|
-
sxSlot:
|
|
2711
|
-
}),
|
|
2748
|
+
sxSlot: A.title
|
|
2749
|
+
}), E = b({
|
|
2712
2750
|
baseClassName: "cursor-pointer p-1 rounded-md hover:bg-[var(--muted)] transition-colors text-[var(--muted-foreground)]",
|
|
2713
|
-
sxSlot:
|
|
2714
|
-
}),
|
|
2751
|
+
sxSlot: A.closeBtn
|
|
2752
|
+
}), $ = b({
|
|
2715
2753
|
baseClassName: "flex-1 overflow-auto overscroll-contain px-5 py-2 text-[var(--foreground)]",
|
|
2716
|
-
sxSlot:
|
|
2717
|
-
}),
|
|
2754
|
+
sxSlot: A.content
|
|
2755
|
+
}), z = b({
|
|
2718
2756
|
baseClassName: "flex justify-end gap-2 px-5 py-4 border-t border-[var(--border)] shrink-0",
|
|
2719
|
-
sxSlot:
|
|
2720
|
-
}),
|
|
2721
|
-
|
|
2722
|
-
}, K = /* @__PURE__ */ s("svg", { viewBox: "0 0 1024 1024", width: "20", height: "20", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ s("path", { d: "M512 466.944l233.472-233.472a31.744 31.744 0 0 1 45.056 45.056L557.056 512l233.472 233.472a31.744 31.744 0 0 1-45.056 45.056L512 557.056l-233.472 233.472a31.744 31.744 0 0 1-45.056-45.056L466.944 512 233.472 278.528a31.744 31.744 0 0 1 45.056-45.056z" }) }), G =
|
|
2723
|
-
{ key: "cancel", text:
|
|
2724
|
-
{ key: "ok", text:
|
|
2757
|
+
sxSlot: A.footer
|
|
2758
|
+
}), U = (R) => {
|
|
2759
|
+
w && R.target === R.currentTarget && a();
|
|
2760
|
+
}, K = /* @__PURE__ */ s("svg", { viewBox: "0 0 1024 1024", width: "20", height: "20", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ s("path", { d: "M512 466.944l233.472-233.472a31.744 31.744 0 0 1 45.056 45.056L557.056 512l233.472 233.472a31.744 31.744 0 0 1-45.056 45.056L512 557.056l-233.472 233.472a31.744 31.744 0 0 1-45.056-45.056L466.944 512 233.472 278.528a31.744 31.744 0 0 1 45.056-45.056z" }) }), G = C != null && C.length ? C : [
|
|
2761
|
+
{ key: "cancel", text: B.cancelText, onClick: a },
|
|
2762
|
+
{ key: "ok", text: B.okText, onClick: i || a }
|
|
2725
2763
|
];
|
|
2726
|
-
return
|
|
2764
|
+
return T ? /* @__PURE__ */ s(
|
|
2727
2765
|
"div",
|
|
2728
2766
|
{
|
|
2729
|
-
className:
|
|
2767
|
+
className: k.className,
|
|
2730
2768
|
style: {
|
|
2731
|
-
...
|
|
2769
|
+
...k.style,
|
|
2732
2770
|
backgroundColor: "rgba(0, 0, 0, 0.5)",
|
|
2733
|
-
opacity:
|
|
2771
|
+
opacity: S ? 1 : 0,
|
|
2734
2772
|
transition: "opacity 300ms ease-in-out"
|
|
2735
2773
|
},
|
|
2736
|
-
onClick:
|
|
2774
|
+
onClick: U,
|
|
2737
2775
|
role: "dialog",
|
|
2738
2776
|
"aria-modal": "true",
|
|
2739
|
-
"aria-label":
|
|
2740
|
-
...
|
|
2741
|
-
children: /* @__PURE__ */
|
|
2742
|
-
/* @__PURE__ */
|
|
2743
|
-
/* @__PURE__ */ s("h3", { className:
|
|
2777
|
+
"aria-label": B.title,
|
|
2778
|
+
...O,
|
|
2779
|
+
children: /* @__PURE__ */ P("div", { className: L.className, style: L.style, children: [
|
|
2780
|
+
/* @__PURE__ */ P("div", { className: W.className, style: W.style, children: [
|
|
2781
|
+
/* @__PURE__ */ s("h3", { className: D.className, style: D.style, children: B.title }),
|
|
2744
2782
|
/* @__PURE__ */ s(
|
|
2745
2783
|
"div",
|
|
2746
2784
|
{
|
|
2747
|
-
className:
|
|
2748
|
-
style:
|
|
2785
|
+
className: E.className,
|
|
2786
|
+
style: E.style,
|
|
2749
2787
|
onClick: a,
|
|
2750
2788
|
role: "button",
|
|
2751
2789
|
tabIndex: 0,
|
|
2752
|
-
"aria-label":
|
|
2790
|
+
"aria-label": B.closeAriaLabel,
|
|
2753
2791
|
onKeyDown: (R) => {
|
|
2754
2792
|
(R.key === "Enter" || R.key === " ") && a();
|
|
2755
2793
|
},
|
|
@@ -2757,8 +2795,8 @@ function Tr(e) {
|
|
|
2757
2795
|
}
|
|
2758
2796
|
)
|
|
2759
2797
|
] }),
|
|
2760
|
-
/* @__PURE__ */ s("div", { className:
|
|
2761
|
-
/* @__PURE__ */ s("div", { className:
|
|
2798
|
+
/* @__PURE__ */ s("div", { className: $.className, style: $.style, children: o }),
|
|
2799
|
+
/* @__PURE__ */ s("div", { className: z.className, style: z.style, children: G.map((R) => {
|
|
2762
2800
|
const Q = R.key === "ok";
|
|
2763
2801
|
return /* @__PURE__ */ s(
|
|
2764
2802
|
ie,
|
|
@@ -2808,7 +2846,7 @@ Tr.propTypes = {
|
|
|
2808
2846
|
),
|
|
2809
2847
|
localeText: t.object
|
|
2810
2848
|
};
|
|
2811
|
-
const kr = ["root", "text"],
|
|
2849
|
+
const kr = ["root", "text"], wt = {
|
|
2812
2850
|
small: "my-0.5",
|
|
2813
2851
|
medium: "my-1.5",
|
|
2814
2852
|
large: "my-2.5",
|
|
@@ -2822,8 +2860,8 @@ function Lr(e, o) {
|
|
|
2822
2860
|
size: l = "medium",
|
|
2823
2861
|
children: a,
|
|
2824
2862
|
...i
|
|
2825
|
-
} = e, u =
|
|
2826
|
-
baseClassName:
|
|
2863
|
+
} = e, u = H(r, kr), h = wt[l] || wt.medium, m = !!a, d = b({
|
|
2864
|
+
baseClassName: I(
|
|
2827
2865
|
"flex items-center justify-center relative w-full",
|
|
2828
2866
|
h
|
|
2829
2867
|
),
|
|
@@ -2831,7 +2869,7 @@ function Lr(e, o) {
|
|
|
2831
2869
|
sxSlot: u.root,
|
|
2832
2870
|
baseStyle: {},
|
|
2833
2871
|
style: n
|
|
2834
|
-
}),
|
|
2872
|
+
}), g = b({
|
|
2835
2873
|
baseClassName: "px-2 whitespace-nowrap z-[1]",
|
|
2836
2874
|
sxSlot: u.text
|
|
2837
2875
|
});
|
|
@@ -2840,25 +2878,25 @@ function Lr(e, o) {
|
|
|
2840
2878
|
// 导致的问题:universal 页面出现 "<p> 标签内部不能嵌套 <div> 标签" 的 HTML 嵌套错误
|
|
2841
2879
|
// 解决办法:将外层容器从 <div> 改为 <span>(phrasing content),内部用 flex 布局保持视觉效果
|
|
2842
2880
|
// fixed by clayw on 20260523 night
|
|
2843
|
-
/* @__PURE__ */
|
|
2881
|
+
/* @__PURE__ */ P(
|
|
2844
2882
|
"span",
|
|
2845
2883
|
{
|
|
2846
2884
|
ref: o,
|
|
2847
|
-
className:
|
|
2848
|
-
style: { ...
|
|
2885
|
+
className: d.className,
|
|
2886
|
+
style: { ...d.style, display: "flex", alignItems: "center", justifyContent: "center" },
|
|
2849
2887
|
...i,
|
|
2850
2888
|
children: [
|
|
2851
2889
|
/* @__PURE__ */ s(
|
|
2852
2890
|
"span",
|
|
2853
2891
|
{
|
|
2854
|
-
className: `flex-1 h-px bg-[var(--line-color)] ${
|
|
2892
|
+
className: `flex-1 h-px bg-[var(--line-color)] ${m ? "mr-2.5" : ""}`
|
|
2855
2893
|
}
|
|
2856
2894
|
),
|
|
2857
|
-
|
|
2895
|
+
m && /* @__PURE__ */ s("span", { className: g.className, style: g.style, children: a }),
|
|
2858
2896
|
/* @__PURE__ */ s(
|
|
2859
2897
|
"span",
|
|
2860
2898
|
{
|
|
2861
|
-
className: `flex-1 h-px bg-[var(--line-color)] ${
|
|
2899
|
+
className: `flex-1 h-px bg-[var(--line-color)] ${m ? "ml-2.5" : ""}`
|
|
2862
2900
|
}
|
|
2863
2901
|
)
|
|
2864
2902
|
]
|
|
@@ -2866,16 +2904,16 @@ function Lr(e, o) {
|
|
|
2866
2904
|
)
|
|
2867
2905
|
);
|
|
2868
2906
|
}
|
|
2869
|
-
const
|
|
2870
|
-
|
|
2871
|
-
|
|
2907
|
+
const Bt = te.forwardRef(Lr);
|
|
2908
|
+
Bt.displayName = "Line";
|
|
2909
|
+
Bt.propTypes = {
|
|
2872
2910
|
size: t.oneOf(["small", "medium", "large", "huge"]),
|
|
2873
2911
|
sx: t.oneOfType([t.string, t.object]),
|
|
2874
2912
|
style: t.object,
|
|
2875
2913
|
className: t.string,
|
|
2876
2914
|
children: t.node
|
|
2877
2915
|
};
|
|
2878
|
-
const Pr = ["root"],
|
|
2916
|
+
const Pr = ["root"], Ct = {
|
|
2879
2917
|
default: "bg-[var(--mark-default-bg)]",
|
|
2880
2918
|
primary: "bg-[var(--mark-primary-bg)]",
|
|
2881
2919
|
success: "bg-[var(--mark-success-bg)]",
|
|
@@ -2891,10 +2929,10 @@ function Or(e, o) {
|
|
|
2891
2929
|
beauty: a = !1,
|
|
2892
2930
|
children: i,
|
|
2893
2931
|
...u
|
|
2894
|
-
} = e, h =
|
|
2895
|
-
baseClassName:
|
|
2932
|
+
} = e, h = H(r, Pr), m = Ct[l] || Ct.default, d = b({
|
|
2933
|
+
baseClassName: I(
|
|
2896
2934
|
"inline-block",
|
|
2897
|
-
|
|
2935
|
+
m,
|
|
2898
2936
|
a ? "px-2 py-1 rounded" : ""
|
|
2899
2937
|
),
|
|
2900
2938
|
className: c,
|
|
@@ -2906,16 +2944,16 @@ function Or(e, o) {
|
|
|
2906
2944
|
"mark",
|
|
2907
2945
|
{
|
|
2908
2946
|
ref: o,
|
|
2909
|
-
className:
|
|
2910
|
-
style:
|
|
2947
|
+
className: d.className,
|
|
2948
|
+
style: d.style,
|
|
2911
2949
|
...u,
|
|
2912
2950
|
children: i
|
|
2913
2951
|
}
|
|
2914
2952
|
);
|
|
2915
2953
|
}
|
|
2916
|
-
const
|
|
2917
|
-
|
|
2918
|
-
|
|
2954
|
+
const It = te.forwardRef(Or);
|
|
2955
|
+
It.displayName = "Mark";
|
|
2956
|
+
It.propTypes = {
|
|
2919
2957
|
color: t.oneOf(["default", "primary", "success", "warning", "danger"]),
|
|
2920
2958
|
beauty: t.bool,
|
|
2921
2959
|
sx: t.oneOfType([t.string, t.object]),
|
|
@@ -2923,7 +2961,7 @@ Bt.propTypes = {
|
|
|
2923
2961
|
className: t.string,
|
|
2924
2962
|
children: t.node
|
|
2925
2963
|
};
|
|
2926
|
-
const _r = ["overlay", "container", "header", "title", "closeBtn", "content", "footer"],
|
|
2964
|
+
const _r = ["overlay", "container", "header", "title", "closeBtn", "content", "footer"], Ae = {
|
|
2927
2965
|
title: "基础标题",
|
|
2928
2966
|
okText: "确定",
|
|
2929
2967
|
cancelText: "取消",
|
|
@@ -2941,48 +2979,48 @@ function Ar(e) {
|
|
|
2941
2979
|
onOk: i,
|
|
2942
2980
|
width: u,
|
|
2943
2981
|
sx: h = {},
|
|
2944
|
-
style:
|
|
2945
|
-
className:
|
|
2946
|
-
maskClosable:
|
|
2947
|
-
footerButtons:
|
|
2948
|
-
localeText:
|
|
2949
|
-
...
|
|
2950
|
-
} = e, { t:
|
|
2951
|
-
|
|
2982
|
+
style: m = {},
|
|
2983
|
+
className: d = "",
|
|
2984
|
+
maskClosable: g = !0,
|
|
2985
|
+
footerButtons: v,
|
|
2986
|
+
localeText: w = {},
|
|
2987
|
+
...C
|
|
2988
|
+
} = e, { t: F } = de(), [O, y] = Z(!1), [x, T] = Z(!1);
|
|
2989
|
+
se(() => {
|
|
2952
2990
|
if (l) {
|
|
2953
|
-
|
|
2954
|
-
const
|
|
2955
|
-
return () => clearTimeout(
|
|
2991
|
+
y(!0);
|
|
2992
|
+
const z = setTimeout(() => T(!0), 30);
|
|
2993
|
+
return () => clearTimeout(z);
|
|
2956
2994
|
}
|
|
2957
|
-
if (
|
|
2958
|
-
|
|
2959
|
-
const
|
|
2960
|
-
return () => clearTimeout(
|
|
2995
|
+
if (O) {
|
|
2996
|
+
T(!1);
|
|
2997
|
+
const z = setTimeout(() => y(!1), 300);
|
|
2998
|
+
return () => clearTimeout(z);
|
|
2961
2999
|
}
|
|
2962
|
-
}, [l]),
|
|
2963
|
-
if (
|
|
2964
|
-
const
|
|
2965
|
-
return
|
|
2966
|
-
const
|
|
2967
|
-
|
|
3000
|
+
}, [l]), se(() => {
|
|
3001
|
+
if (O) {
|
|
3002
|
+
const z = parseInt(document.body.dataset.tangoScrollLock || "0", 10);
|
|
3003
|
+
return z === 0 && (document.body.dataset.tangoOriginalOverflow = document.body.style.overflow), document.body.dataset.tangoScrollLock = String(z + 1), document.body.style.overflow = "hidden", () => {
|
|
3004
|
+
const U = parseInt(document.body.dataset.tangoScrollLock || "0", 10);
|
|
3005
|
+
U <= 1 ? (document.body.style.overflow = document.body.dataset.tangoOriginalOverflow || "", delete document.body.dataset.tangoOriginalOverflow, delete document.body.dataset.tangoScrollLock) : document.body.dataset.tangoScrollLock = String(U - 1);
|
|
2968
3006
|
};
|
|
2969
3007
|
}
|
|
2970
|
-
}, [
|
|
2971
|
-
const
|
|
2972
|
-
title: r ??
|
|
2973
|
-
okText: n ??
|
|
2974
|
-
cancelText: c ??
|
|
2975
|
-
closeAriaLabel:
|
|
2976
|
-
...
|
|
2977
|
-
},
|
|
3008
|
+
}, [O]);
|
|
3009
|
+
const p = {
|
|
3010
|
+
title: r ?? F("modal.title", Ae.title),
|
|
3011
|
+
okText: n ?? F("modal.okText", Ae.okText),
|
|
3012
|
+
cancelText: c ?? F("modal.cancelText", Ae.cancelText),
|
|
3013
|
+
closeAriaLabel: F("modal.closeAriaLabel", Ae.closeAriaLabel),
|
|
3014
|
+
...w
|
|
3015
|
+
}, S = H(h, _r), _ = b({
|
|
2978
3016
|
baseClassName: "fixed inset-0 z-[999] flex justify-center items-center",
|
|
2979
|
-
sxSlot:
|
|
2980
|
-
}),
|
|
2981
|
-
tw:
|
|
2982
|
-
css: { ...
|
|
2983
|
-
},
|
|
3017
|
+
sxSlot: S.overlay
|
|
3018
|
+
}), M = {
|
|
3019
|
+
tw: I(S.root.tw, S.container.tw),
|
|
3020
|
+
css: { ...S.root.css, ...S.container.css }
|
|
3021
|
+
}, B = b({
|
|
2984
3022
|
baseClassName: "bg-[var(--modal-bg)] text-[var(--foreground)] flex flex-col rounded-[var(--radius)] shadow-[var(--modal-shadow)] transition-all duration-300 ease-in-out",
|
|
2985
|
-
className:
|
|
3023
|
+
className: d,
|
|
2986
3024
|
style: {
|
|
2987
3025
|
width: u || "520px",
|
|
2988
3026
|
maxWidth: "90vw",
|
|
@@ -2990,48 +3028,48 @@ function Ar(e) {
|
|
|
2990
3028
|
maxHeight: "80vh",
|
|
2991
3029
|
transform: x ? "scale(1)" : "scale(0.8)",
|
|
2992
3030
|
opacity: x ? 1 : 0,
|
|
2993
|
-
...
|
|
3031
|
+
...m
|
|
2994
3032
|
},
|
|
2995
|
-
sxSlot:
|
|
2996
|
-
}),
|
|
3033
|
+
sxSlot: M
|
|
3034
|
+
}), A = b({
|
|
2997
3035
|
baseClassName: "flex items-center justify-between px-5 pt-5 pb-3 shrink-0",
|
|
2998
|
-
sxSlot:
|
|
2999
|
-
}),
|
|
3036
|
+
sxSlot: S.header
|
|
3037
|
+
}), k = b({
|
|
3000
3038
|
baseClassName: "text-lg font-bold text-[var(--foreground)]",
|
|
3001
|
-
sxSlot:
|
|
3039
|
+
sxSlot: S.title
|
|
3002
3040
|
}), N = b({
|
|
3003
3041
|
baseClassName: "cursor-pointer p-1 rounded-md hover:bg-[var(--muted)] transition-colors text-[var(--muted-foreground)]",
|
|
3004
|
-
sxSlot:
|
|
3005
|
-
}),
|
|
3042
|
+
sxSlot: S.closeBtn
|
|
3043
|
+
}), L = b({
|
|
3006
3044
|
baseClassName: "flex-1 overflow-auto overscroll-contain px-6 py-5 text-[var(--foreground)]",
|
|
3007
|
-
sxSlot:
|
|
3008
|
-
}),
|
|
3045
|
+
sxSlot: S.content
|
|
3046
|
+
}), W = b({
|
|
3009
3047
|
baseClassName: "flex justify-end gap-2 px-5 py-4 border-t border-[var(--border)] shrink-0",
|
|
3010
|
-
sxSlot:
|
|
3011
|
-
}),
|
|
3012
|
-
|
|
3013
|
-
},
|
|
3014
|
-
{ key: "cancel", text:
|
|
3015
|
-
{ key: "ok", text:
|
|
3048
|
+
sxSlot: S.footer
|
|
3049
|
+
}), D = (z) => {
|
|
3050
|
+
g && z.target === z.currentTarget && a();
|
|
3051
|
+
}, E = /* @__PURE__ */ s("svg", { viewBox: "0 0 1024 1024", width: "20", height: "20", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ s("path", { d: "M512 466.944l233.472-233.472a31.744 31.744 0 0 1 45.056 45.056L557.056 512l233.472 233.472a31.744 31.744 0 0 1-45.056 45.056L512 557.056l-233.472 233.472a31.744 31.744 0 0 1-45.056-45.056L466.944 512 233.472 278.528a31.744 31.744 0 0 1 45.056-45.056z" }) }), $ = v != null && v.length ? v : [
|
|
3052
|
+
{ key: "cancel", text: p.cancelText, onClick: a },
|
|
3053
|
+
{ key: "ok", text: p.okText, onClick: i || a }
|
|
3016
3054
|
];
|
|
3017
|
-
return
|
|
3055
|
+
return O ? /* @__PURE__ */ s(
|
|
3018
3056
|
"div",
|
|
3019
3057
|
{
|
|
3020
|
-
className:
|
|
3058
|
+
className: _.className,
|
|
3021
3059
|
style: {
|
|
3022
|
-
...
|
|
3060
|
+
..._.style,
|
|
3023
3061
|
backgroundColor: "rgba(0, 0, 0, 0.5)",
|
|
3024
3062
|
opacity: x ? 1 : 0,
|
|
3025
3063
|
transition: "opacity 300ms ease-in-out"
|
|
3026
3064
|
},
|
|
3027
|
-
onClick:
|
|
3065
|
+
onClick: D,
|
|
3028
3066
|
role: "dialog",
|
|
3029
3067
|
"aria-modal": "true",
|
|
3030
|
-
"aria-label":
|
|
3031
|
-
...
|
|
3032
|
-
children: /* @__PURE__ */
|
|
3033
|
-
/* @__PURE__ */
|
|
3034
|
-
/* @__PURE__ */ s("h3", { className:
|
|
3068
|
+
"aria-label": p.title,
|
|
3069
|
+
...C,
|
|
3070
|
+
children: /* @__PURE__ */ P("div", { className: B.className, style: B.style, children: [
|
|
3071
|
+
/* @__PURE__ */ P("div", { className: A.className, style: A.style, children: [
|
|
3072
|
+
/* @__PURE__ */ s("h3", { className: k.className, style: k.style, children: p.title }),
|
|
3035
3073
|
/* @__PURE__ */ s(
|
|
3036
3074
|
"div",
|
|
3037
3075
|
{
|
|
@@ -3040,25 +3078,25 @@ function Ar(e) {
|
|
|
3040
3078
|
onClick: a,
|
|
3041
3079
|
role: "button",
|
|
3042
3080
|
tabIndex: 0,
|
|
3043
|
-
"aria-label":
|
|
3044
|
-
onKeyDown: (
|
|
3045
|
-
(
|
|
3081
|
+
"aria-label": p.closeAriaLabel,
|
|
3082
|
+
onKeyDown: (z) => {
|
|
3083
|
+
(z.key === "Enter" || z.key === " ") && a();
|
|
3046
3084
|
},
|
|
3047
|
-
children:
|
|
3085
|
+
children: E
|
|
3048
3086
|
}
|
|
3049
3087
|
)
|
|
3050
3088
|
] }),
|
|
3051
|
-
/* @__PURE__ */ s("div", { className:
|
|
3052
|
-
/* @__PURE__ */ s("div", { className:
|
|
3053
|
-
const
|
|
3089
|
+
/* @__PURE__ */ s("div", { className: L.className, style: L.style, children: o }),
|
|
3090
|
+
/* @__PURE__ */ s("div", { className: W.className, style: W.style, children: $.map((z) => {
|
|
3091
|
+
const U = z.key === "ok";
|
|
3054
3092
|
return /* @__PURE__ */ s(
|
|
3055
3093
|
ie,
|
|
3056
3094
|
{
|
|
3057
|
-
onClick:
|
|
3095
|
+
onClick: z.onClick,
|
|
3058
3096
|
type: "default",
|
|
3059
|
-
outline: !
|
|
3097
|
+
outline: !U,
|
|
3060
3098
|
size: "medium",
|
|
3061
|
-
style:
|
|
3099
|
+
style: U ? {
|
|
3062
3100
|
backgroundColor: "var(--modal-ok-bg)",
|
|
3063
3101
|
color: "var(--modal-ok-fg)",
|
|
3064
3102
|
borderColor: "var(--modal-ok-bg)"
|
|
@@ -3066,9 +3104,9 @@ function Ar(e) {
|
|
|
3066
3104
|
backgroundColor: "var(--modal-cancel-bg)",
|
|
3067
3105
|
color: "var(--modal-cancel-fg)"
|
|
3068
3106
|
},
|
|
3069
|
-
children:
|
|
3107
|
+
children: z.text
|
|
3070
3108
|
},
|
|
3071
|
-
|
|
3109
|
+
z.key
|
|
3072
3110
|
);
|
|
3073
3111
|
}) })
|
|
3074
3112
|
] })
|
|
@@ -3112,7 +3150,7 @@ const Mr = ["root", "input", "button"], zr = {
|
|
|
3112
3150
|
medium: "small",
|
|
3113
3151
|
large: "medium",
|
|
3114
3152
|
huge: "medium"
|
|
3115
|
-
},
|
|
3153
|
+
}, Tt = {
|
|
3116
3154
|
placeholder: "请输入内容",
|
|
3117
3155
|
btnText: "搜索"
|
|
3118
3156
|
}, Br = (e, o, r) => Object.prototype.hasOwnProperty.call(r, e) ? e : o;
|
|
@@ -3123,79 +3161,81 @@ function Ir(e) {
|
|
|
3123
3161
|
style: n = {},
|
|
3124
3162
|
className: c = "",
|
|
3125
3163
|
onSearch: l,
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3164
|
+
onChange: a,
|
|
3165
|
+
value: i,
|
|
3166
|
+
defaultValue: u,
|
|
3167
|
+
disabled: h = !1,
|
|
3168
|
+
placeholder: m,
|
|
3130
3169
|
btnText: d,
|
|
3131
|
-
localeText:
|
|
3132
|
-
path:
|
|
3170
|
+
localeText: g,
|
|
3171
|
+
path: v = "",
|
|
3133
3172
|
...w
|
|
3134
|
-
} = e, { t:
|
|
3135
|
-
tw:
|
|
3136
|
-
css: { ...
|
|
3137
|
-
},
|
|
3173
|
+
} = e, { t: C } = de(), F = ke(null), O = Br(o, "medium", zr), y = i !== void 0, x = C("search.placeholder", Tt.placeholder), T = C("search.btnText", Tt.btnText), p = m ?? (g == null ? void 0 : g.placeholder) ?? x, S = d ?? (g == null ? void 0 : g.btnText) ?? T, _ = H(r, Mr), M = {
|
|
3174
|
+
tw: I(_.root.tw, _.input.tw),
|
|
3175
|
+
css: { ..._.root.css, ..._.input.css }
|
|
3176
|
+
}, B = I("relative inline-flex", _.root.tw), A = I(
|
|
3138
3177
|
"w-[300px] rounded-[var(--radius)] border bg-[var(--input-bg)] text-[var(--foreground)] outline-none transition-all duration-200 ease-in-out",
|
|
3139
3178
|
"border-[var(--border)] shadow-[var(--input-shadow)]",
|
|
3140
3179
|
"hover:border-[var(--input-accent)]",
|
|
3141
3180
|
"focus:border-[var(--input-accent)] focus:shadow-[var(--input-focus-shadow)]",
|
|
3142
|
-
|
|
3143
|
-
Er[
|
|
3144
|
-
),
|
|
3145
|
-
baseClassName:
|
|
3181
|
+
h && "bg-[var(--muted)] text-[var(--muted-foreground)] border-[var(--muted)] cursor-not-allowed shadow-none hover:border-[var(--muted)] focus:shadow-none",
|
|
3182
|
+
Er[O]
|
|
3183
|
+
), k = b({
|
|
3184
|
+
baseClassName: A,
|
|
3146
3185
|
className: c,
|
|
3147
3186
|
style: n,
|
|
3148
|
-
sxSlot:
|
|
3149
|
-
}),
|
|
3187
|
+
sxSlot: M
|
|
3188
|
+
}), N = b({
|
|
3150
3189
|
baseClassName: "absolute top-1/2 -translate-y-1/2",
|
|
3151
|
-
sxSlot:
|
|
3190
|
+
sxSlot: _.button,
|
|
3152
3191
|
style: { right: "calc(var(--spacing) * 2)" }
|
|
3153
|
-
}),
|
|
3154
|
-
right:
|
|
3155
|
-
},
|
|
3156
|
-
delete
|
|
3157
|
-
const
|
|
3158
|
-
var
|
|
3159
|
-
return
|
|
3160
|
-
}, [
|
|
3161
|
-
l == null || l(
|
|
3162
|
-
}, [l,
|
|
3163
|
-
|
|
3164
|
-
}, [
|
|
3165
|
-
return /* @__PURE__ */
|
|
3192
|
+
}), L = {
|
|
3193
|
+
right: N.style.right
|
|
3194
|
+
}, W = { ...N.style };
|
|
3195
|
+
delete W.right;
|
|
3196
|
+
const D = oe(() => {
|
|
3197
|
+
var z;
|
|
3198
|
+
return y ? i : ((z = F.current) == null ? void 0 : z.value) ?? "";
|
|
3199
|
+
}, [y, i]), E = oe(() => {
|
|
3200
|
+
l == null || l(D());
|
|
3201
|
+
}, [l, D]), $ = oe((z) => {
|
|
3202
|
+
z.key === "Enter" && E();
|
|
3203
|
+
}, [E]);
|
|
3204
|
+
return /* @__PURE__ */ P("div", { className: B, children: [
|
|
3166
3205
|
/* @__PURE__ */ s(
|
|
3167
3206
|
"input",
|
|
3168
3207
|
{
|
|
3169
|
-
ref:
|
|
3170
|
-
className:
|
|
3171
|
-
style:
|
|
3172
|
-
onKeyDown:
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3208
|
+
ref: y ? void 0 : F,
|
|
3209
|
+
className: k.className,
|
|
3210
|
+
style: k.style,
|
|
3211
|
+
onKeyDown: $,
|
|
3212
|
+
onChange: a,
|
|
3213
|
+
value: y ? i : void 0,
|
|
3214
|
+
defaultValue: y ? void 0 : u ?? "",
|
|
3215
|
+
disabled: h || void 0,
|
|
3216
|
+
placeholder: p,
|
|
3177
3217
|
type: "text",
|
|
3178
3218
|
role: "searchbox",
|
|
3179
|
-
"aria-label":
|
|
3219
|
+
"aria-label": p,
|
|
3180
3220
|
...w
|
|
3181
3221
|
}
|
|
3182
3222
|
),
|
|
3183
|
-
/* @__PURE__ */ s("div", { className:
|
|
3223
|
+
/* @__PURE__ */ s("div", { className: N.className, style: L, children: /* @__PURE__ */ s(
|
|
3184
3224
|
ie,
|
|
3185
3225
|
{
|
|
3186
|
-
onClick:
|
|
3187
|
-
size: $r[
|
|
3188
|
-
disabled:
|
|
3189
|
-
"aria-label":
|
|
3190
|
-
style:
|
|
3191
|
-
children:
|
|
3226
|
+
onClick: E,
|
|
3227
|
+
size: $r[O],
|
|
3228
|
+
disabled: h,
|
|
3229
|
+
"aria-label": S,
|
|
3230
|
+
style: W,
|
|
3231
|
+
children: v ? /* @__PURE__ */ s(
|
|
3192
3232
|
"img",
|
|
3193
3233
|
{
|
|
3194
|
-
src:
|
|
3234
|
+
src: v,
|
|
3195
3235
|
alt: "search-icon",
|
|
3196
3236
|
style: { width: 16, height: 16, marginTop: 2, marginBottom: -3 }
|
|
3197
3237
|
}
|
|
3198
|
-
) :
|
|
3238
|
+
) : S
|
|
3199
3239
|
}
|
|
3200
3240
|
) })
|
|
3201
3241
|
] });
|
|
@@ -3206,6 +3246,7 @@ Ir.propTypes = {
|
|
|
3206
3246
|
style: t.object,
|
|
3207
3247
|
className: t.string,
|
|
3208
3248
|
onSearch: t.func,
|
|
3249
|
+
onChange: t.func,
|
|
3209
3250
|
value: t.string,
|
|
3210
3251
|
defaultValue: t.string,
|
|
3211
3252
|
disabled: t.bool,
|
|
@@ -3217,7 +3258,7 @@ Ir.propTypes = {
|
|
|
3217
3258
|
}),
|
|
3218
3259
|
path: t.string
|
|
3219
3260
|
};
|
|
3220
|
-
const
|
|
3261
|
+
const jt = {
|
|
3221
3262
|
default: "",
|
|
3222
3263
|
inline: "inline-block",
|
|
3223
3264
|
circle: "rounded-full",
|
|
@@ -3226,7 +3267,7 @@ const It = {
|
|
|
3226
3267
|
fixed: "fixed",
|
|
3227
3268
|
absolute: "absolute",
|
|
3228
3269
|
relative: "relative"
|
|
3229
|
-
},
|
|
3270
|
+
}, Ft = Object.keys(jt), jr = ["root"];
|
|
3230
3271
|
function Fr(e, o) {
|
|
3231
3272
|
const {
|
|
3232
3273
|
sx: r = {},
|
|
@@ -3245,34 +3286,34 @@ function Fr(e, o) {
|
|
|
3245
3286
|
*
|
|
3246
3287
|
*/
|
|
3247
3288
|
...i
|
|
3248
|
-
} = e, u =
|
|
3249
|
-
baseClassName:
|
|
3289
|
+
} = e, u = Ft.includes(l) ? l : "default", h = H(r, jr), m = b({
|
|
3290
|
+
baseClassName: jt[u],
|
|
3250
3291
|
className: c,
|
|
3251
3292
|
sxSlot: h.root
|
|
3252
|
-
}),
|
|
3293
|
+
}), d = u === "halfCircle" ? { width: "var(--space-half-circle-w)", height: "var(--space-half-circle-h)", background: "var(--space-half-circle-color)" } : {};
|
|
3253
3294
|
return (
|
|
3254
3295
|
// 这里直接透传给原生div,用户用起来就像使用普通 div 一样,dom也是div
|
|
3255
3296
|
/* @__PURE__ */ s(
|
|
3256
3297
|
"div",
|
|
3257
3298
|
{
|
|
3258
3299
|
ref: o,
|
|
3259
|
-
className:
|
|
3260
|
-
style: { ...
|
|
3300
|
+
className: m.className,
|
|
3301
|
+
style: { ...d, ...m.style, ...n },
|
|
3261
3302
|
...i,
|
|
3262
3303
|
children: a
|
|
3263
3304
|
}
|
|
3264
3305
|
)
|
|
3265
3306
|
);
|
|
3266
3307
|
}
|
|
3267
|
-
const
|
|
3268
|
-
|
|
3269
|
-
type: t.oneOf(
|
|
3308
|
+
const Dt = te.forwardRef(Fr);
|
|
3309
|
+
Dt.propTypes = {
|
|
3310
|
+
type: t.oneOf(Ft),
|
|
3270
3311
|
sx: t.oneOfType([t.string, t.object]),
|
|
3271
3312
|
style: t.object,
|
|
3272
3313
|
className: t.string,
|
|
3273
3314
|
children: t.node
|
|
3274
3315
|
};
|
|
3275
|
-
|
|
3316
|
+
Dt.displayName = "Space";
|
|
3276
3317
|
const Dr = ["root", "wrapper", "thead", "headerCell", "body", "row", "cell", "empty", "pagination"], ve = {
|
|
3277
3318
|
empty: "暂无数据",
|
|
3278
3319
|
prev: "上一页",
|
|
@@ -3280,7 +3321,7 @@ const Dr = ["root", "wrapper", "thead", "headerCell", "body", "row", "cell", "em
|
|
|
3280
3321
|
page: "页",
|
|
3281
3322
|
total: "共 {total} 条",
|
|
3282
3323
|
perPage: "条/页"
|
|
3283
|
-
}, Rr = 10, Vr = [10, 20, 50, 100],
|
|
3324
|
+
}, Rr = 10, Vr = [10, 20, 50, 100], Me = (e, ...o) => typeof e == "function" ? e(...o) : e ?? {};
|
|
3284
3325
|
function Yr(e) {
|
|
3285
3326
|
const {
|
|
3286
3327
|
dataSource: o = [],
|
|
@@ -3297,45 +3338,45 @@ function Yr(e) {
|
|
|
3297
3338
|
rowClassName: u,
|
|
3298
3339
|
rowStyle: h,
|
|
3299
3340
|
/* 单元格回调 */
|
|
3300
|
-
cellClassName:
|
|
3301
|
-
cellStyle:
|
|
3341
|
+
cellClassName: m,
|
|
3342
|
+
cellStyle: d,
|
|
3302
3343
|
/* hover */
|
|
3303
|
-
hoverColor:
|
|
3344
|
+
hoverColor: g = "",
|
|
3304
3345
|
/* i18n */
|
|
3305
|
-
i18nKey:
|
|
3306
|
-
localeText:
|
|
3346
|
+
i18nKey: v = null,
|
|
3347
|
+
localeText: w = {},
|
|
3307
3348
|
/* 无障碍 */
|
|
3308
|
-
"aria-label":
|
|
3309
|
-
...
|
|
3310
|
-
} = e, { t:
|
|
3349
|
+
"aria-label": C,
|
|
3350
|
+
...F
|
|
3351
|
+
} = e, { t: O } = de();
|
|
3311
3352
|
o.length === 0 && r.length === 0 && console.warn("[Tango Table] dataSource 和 columns 不能同时为空,请至少提供一项。");
|
|
3312
|
-
const
|
|
3313
|
-
empty:
|
|
3314
|
-
prev:
|
|
3315
|
-
next:
|
|
3316
|
-
page:
|
|
3317
|
-
total:
|
|
3318
|
-
perPage:
|
|
3319
|
-
...
|
|
3320
|
-
}, x = Array.isArray(i) ? i : typeof i == "string" ? [i] : [],
|
|
3353
|
+
const y = {
|
|
3354
|
+
empty: O("table.empty", ve.empty),
|
|
3355
|
+
prev: O("table.prev", ve.prev),
|
|
3356
|
+
next: O("table.next", ve.next),
|
|
3357
|
+
page: O("table.page", ve.page),
|
|
3358
|
+
total: O("table.total", ve.total),
|
|
3359
|
+
perPage: O("table.perPage", ve.perPage),
|
|
3360
|
+
...w
|
|
3361
|
+
}, x = Array.isArray(i) ? i : typeof i == "string" ? [i] : [], T = Se(
|
|
3321
3362
|
() => r.filter((J) => !J.hide && !x.includes(J.dataIndex)),
|
|
3322
3363
|
[r, x]
|
|
3323
|
-
),
|
|
3324
|
-
if (!
|
|
3325
|
-
const J = (
|
|
3326
|
-
return o.slice(J, J +
|
|
3327
|
-
}, [o,
|
|
3328
|
-
(J) => N(Math.max(1, Math.min(J,
|
|
3329
|
-
[
|
|
3330
|
-
), K =
|
|
3331
|
-
baseClassName:
|
|
3364
|
+
), p = a !== null && a !== !1, S = a && a.placement || "bottom", _ = a && a.pageSize || Rr, M = a && a.pageSizeOptions || Vr, B = (a == null ? void 0 : a.showTotal) !== !1, A = (a == null ? void 0 : a.showSizeChanger) !== !1, [k, N] = Z(1), [L, W] = Z(_), D = o.length, E = Math.max(1, Math.ceil(D / L)), $ = Math.min(k, E), z = Se(() => {
|
|
3365
|
+
if (!p) return o;
|
|
3366
|
+
const J = ($ - 1) * L;
|
|
3367
|
+
return o.slice(J, J + L);
|
|
3368
|
+
}, [o, $, L, p]), U = oe(
|
|
3369
|
+
(J) => N(Math.max(1, Math.min(J, E))),
|
|
3370
|
+
[E]
|
|
3371
|
+
), K = H(n, Dr), G = b({
|
|
3372
|
+
baseClassName: I(
|
|
3332
3373
|
"w-full overflow-x-auto rounded-xl border border-[var(--border)]",
|
|
3333
3374
|
"shadow-[0_0_20px_color-mix(in_oklch,var(--foreground)_8%,transparent)]"
|
|
3334
3375
|
),
|
|
3335
3376
|
className: l,
|
|
3336
3377
|
style: c,
|
|
3337
3378
|
sxSlot: {
|
|
3338
|
-
tw:
|
|
3379
|
+
tw: I(K.root.tw, K.wrapper.tw),
|
|
3339
3380
|
css: { ...K.root.css, ...K.wrapper.css }
|
|
3340
3381
|
}
|
|
3341
3382
|
}), R = b({
|
|
@@ -3350,88 +3391,88 @@ function Yr(e) {
|
|
|
3350
3391
|
}), be = b({
|
|
3351
3392
|
baseClassName: "flex items-center justify-between px-4 py-3 text-sm text-[var(--muted-foreground)] border-t border-[var(--border)]",
|
|
3352
3393
|
sxSlot: K.pagination
|
|
3353
|
-
}), ge =
|
|
3394
|
+
}), ge = g ? /* @__PURE__ */ s("style", { children: `
|
|
3354
3395
|
[data-tango-table-body] tr:hover {
|
|
3355
|
-
background-color: ${
|
|
3396
|
+
background-color: ${g} !important;
|
|
3356
3397
|
transform: translateY(-1px);
|
|
3357
3398
|
box-shadow: 0 2px 8px color-mix(in oklch, var(--foreground) 5%, transparent);
|
|
3358
3399
|
}
|
|
3359
3400
|
` }) : null, fe = () => {
|
|
3360
|
-
if (!
|
|
3361
|
-
const J = Array.from({ length:
|
|
3362
|
-
return /* @__PURE__ */
|
|
3363
|
-
/* @__PURE__ */
|
|
3364
|
-
|
|
3365
|
-
|
|
3401
|
+
if (!p) return null;
|
|
3402
|
+
const J = Array.from({ length: E }, (j, q) => q + 1);
|
|
3403
|
+
return /* @__PURE__ */ P("div", { className: be.className, style: be.style, children: [
|
|
3404
|
+
/* @__PURE__ */ P("div", { className: "flex items-center gap-3", children: [
|
|
3405
|
+
B && /* @__PURE__ */ s("span", { children: y.total.replace("{total}", String(D)) }),
|
|
3406
|
+
A && /* @__PURE__ */ s(
|
|
3366
3407
|
"select",
|
|
3367
3408
|
{
|
|
3368
|
-
value:
|
|
3369
|
-
onChange: (
|
|
3370
|
-
|
|
3409
|
+
value: L,
|
|
3410
|
+
onChange: (j) => {
|
|
3411
|
+
W(Number(j.target.value)), N(1);
|
|
3371
3412
|
},
|
|
3372
3413
|
className: "rounded border border-[var(--border)] bg-[var(--background)] px-2 py-1 text-sm cursor-pointer",
|
|
3373
|
-
"aria-label":
|
|
3374
|
-
children:
|
|
3375
|
-
|
|
3414
|
+
"aria-label": y.perPage,
|
|
3415
|
+
children: M.map((j) => /* @__PURE__ */ P("option", { value: j, children: [
|
|
3416
|
+
j,
|
|
3376
3417
|
" ",
|
|
3377
|
-
|
|
3378
|
-
] },
|
|
3418
|
+
y.perPage
|
|
3419
|
+
] }, j))
|
|
3379
3420
|
}
|
|
3380
3421
|
)
|
|
3381
3422
|
] }),
|
|
3382
|
-
/* @__PURE__ */
|
|
3423
|
+
/* @__PURE__ */ P("div", { className: "flex items-center gap-1", children: [
|
|
3383
3424
|
/* @__PURE__ */ s(
|
|
3384
3425
|
"button",
|
|
3385
3426
|
{
|
|
3386
3427
|
type: "button",
|
|
3387
|
-
onClick: () =>
|
|
3388
|
-
disabled:
|
|
3428
|
+
onClick: () => U($ - 1),
|
|
3429
|
+
disabled: $ <= 1,
|
|
3389
3430
|
className: "px-2 py-1 rounded border border-[var(--border)] text-xs disabled:opacity-40 disabled:cursor-not-allowed hover:bg-[var(--accent)] transition-colors",
|
|
3390
|
-
"aria-label":
|
|
3391
|
-
children:
|
|
3431
|
+
"aria-label": y.prev,
|
|
3432
|
+
children: y.prev
|
|
3392
3433
|
}
|
|
3393
3434
|
),
|
|
3394
|
-
J.length <= 7 ? J.map((
|
|
3435
|
+
J.length <= 7 ? J.map((j) => /* @__PURE__ */ s(
|
|
3395
3436
|
"button",
|
|
3396
3437
|
{
|
|
3397
3438
|
type: "button",
|
|
3398
|
-
onClick: () =>
|
|
3399
|
-
className: `min-w-[28px] px-2 py-1 rounded text-xs transition-colors ${
|
|
3400
|
-
children:
|
|
3439
|
+
onClick: () => U(j),
|
|
3440
|
+
className: `min-w-[28px] px-2 py-1 rounded text-xs transition-colors ${j === $ ? "bg-[var(--primary)] text-[var(--primary-foreground)] font-medium" : "border border-[var(--border)] hover:bg-[var(--accent)]"}`,
|
|
3441
|
+
children: j
|
|
3401
3442
|
},
|
|
3402
|
-
|
|
3403
|
-
)) : /* @__PURE__ */
|
|
3443
|
+
j
|
|
3444
|
+
)) : /* @__PURE__ */ P(Ne, { children: [
|
|
3404
3445
|
/* @__PURE__ */ s(
|
|
3405
3446
|
"button",
|
|
3406
3447
|
{
|
|
3407
3448
|
type: "button",
|
|
3408
|
-
onClick: () =>
|
|
3409
|
-
className: `min-w-[28px] px-2 py-1 rounded text-xs ${
|
|
3449
|
+
onClick: () => U(1),
|
|
3450
|
+
className: `min-w-[28px] px-2 py-1 rounded text-xs ${$ === 1 ? "bg-[var(--primary)] text-[var(--primary-foreground)] font-medium" : "border border-[var(--border)] hover:bg-[var(--accent)]"} transition-colors`,
|
|
3410
3451
|
children: "1"
|
|
3411
3452
|
}
|
|
3412
3453
|
),
|
|
3413
|
-
|
|
3454
|
+
$ > 3 && /* @__PURE__ */ s("span", { className: "px-1 text-xs", children: "…" }),
|
|
3414
3455
|
Array.from(
|
|
3415
|
-
{ length:
|
|
3416
|
-
(
|
|
3417
|
-
).filter((
|
|
3456
|
+
{ length: E },
|
|
3457
|
+
(j, q) => q + 1
|
|
3458
|
+
).filter((j) => j > 1 && j < E && Math.abs(j - $) <= 1).map((j) => /* @__PURE__ */ s(
|
|
3418
3459
|
"button",
|
|
3419
3460
|
{
|
|
3420
3461
|
type: "button",
|
|
3421
|
-
onClick: () =>
|
|
3422
|
-
className: `min-w-[28px] px-2 py-1 rounded text-xs ${
|
|
3423
|
-
children:
|
|
3462
|
+
onClick: () => U(j),
|
|
3463
|
+
className: `min-w-[28px] px-2 py-1 rounded text-xs ${j === $ ? "bg-[var(--primary)] text-[var(--primary-foreground)] font-medium" : "border border-[var(--border)] hover:bg-[var(--accent)]"} transition-colors`,
|
|
3464
|
+
children: j
|
|
3424
3465
|
},
|
|
3425
|
-
|
|
3466
|
+
j
|
|
3426
3467
|
)),
|
|
3427
|
-
|
|
3468
|
+
$ < E - 2 && /* @__PURE__ */ s("span", { className: "px-1 text-xs", children: "…" }),
|
|
3428
3469
|
/* @__PURE__ */ s(
|
|
3429
3470
|
"button",
|
|
3430
3471
|
{
|
|
3431
3472
|
type: "button",
|
|
3432
|
-
onClick: () =>
|
|
3433
|
-
className: `min-w-[28px] px-2 py-1 rounded text-xs ${
|
|
3434
|
-
children:
|
|
3473
|
+
onClick: () => U(E),
|
|
3474
|
+
className: `min-w-[28px] px-2 py-1 rounded text-xs ${$ === E ? "bg-[var(--primary)] text-[var(--primary-foreground)] font-medium" : "border border-[var(--border)] hover:bg-[var(--accent)]"} transition-colors`,
|
|
3475
|
+
children: E
|
|
3435
3476
|
}
|
|
3436
3477
|
)
|
|
3437
3478
|
] }),
|
|
@@ -3439,66 +3480,66 @@ function Yr(e) {
|
|
|
3439
3480
|
"button",
|
|
3440
3481
|
{
|
|
3441
3482
|
type: "button",
|
|
3442
|
-
onClick: () =>
|
|
3443
|
-
disabled:
|
|
3483
|
+
onClick: () => U($ + 1),
|
|
3484
|
+
disabled: $ >= E,
|
|
3444
3485
|
className: "px-2 py-1 rounded border border-[var(--border)] text-xs disabled:opacity-40 disabled:cursor-not-allowed hover:bg-[var(--accent)] transition-colors",
|
|
3445
|
-
"aria-label":
|
|
3446
|
-
children:
|
|
3486
|
+
"aria-label": y.next,
|
|
3487
|
+
children: y.next
|
|
3447
3488
|
}
|
|
3448
3489
|
)
|
|
3449
3490
|
] })
|
|
3450
3491
|
] });
|
|
3451
|
-
}, X = (J) => /* @__PURE__ */
|
|
3492
|
+
}, X = (J) => /* @__PURE__ */ P("div", { className: G.className, style: G.style, children: [
|
|
3452
3493
|
ge,
|
|
3453
|
-
/* @__PURE__ */
|
|
3454
|
-
/* @__PURE__ */ s("thead", { className: R.className, style: R.style, children: /* @__PURE__ */ s("tr", { children:
|
|
3494
|
+
/* @__PURE__ */ P("table", { className: "w-full border-collapse separate border-spacing-0 text-sm", role: "table", children: [
|
|
3495
|
+
/* @__PURE__ */ s("thead", { className: R.className, style: R.style, children: /* @__PURE__ */ s("tr", { children: T.map((j) => {
|
|
3455
3496
|
const q = b({
|
|
3456
|
-
baseClassName:
|
|
3497
|
+
baseClassName: I(
|
|
3457
3498
|
"px-5 py-4 text-left font-semibold tracking-wide relative",
|
|
3458
3499
|
K.headerCell.tw
|
|
3459
3500
|
),
|
|
3460
|
-
baseStyle:
|
|
3501
|
+
baseStyle: j.width ? { width: j.width } : {},
|
|
3461
3502
|
sxSlot: { tw: "", css: K.headerCell.css }
|
|
3462
3503
|
});
|
|
3463
|
-
return /* @__PURE__ */
|
|
3464
|
-
|
|
3504
|
+
return /* @__PURE__ */ P("th", { className: q.className, style: q.style, children: [
|
|
3505
|
+
j.title,
|
|
3465
3506
|
/* @__PURE__ */ s("span", { className: "absolute right-0 top-[20%] h-[60%] w-px bg-[var(--primary-foreground)]/15 last:hidden" })
|
|
3466
|
-
] },
|
|
3507
|
+
] }, j.key || j.dataIndex);
|
|
3467
3508
|
}) }) }),
|
|
3468
|
-
/* @__PURE__ */ s("tbody", { className: Q.className, style: Q.style, "data-tango-table-body": !0, children: J.length === 0 ? /* @__PURE__ */ s("tr", { children: /* @__PURE__ */ s("td", { colSpan:
|
|
3469
|
-
const le = q % 2 === 0 ? "even" : "odd", re =
|
|
3509
|
+
/* @__PURE__ */ s("tbody", { className: Q.className, style: Q.style, "data-tango-table-body": !0, children: J.length === 0 ? /* @__PURE__ */ s("tr", { children: /* @__PURE__ */ s("td", { colSpan: T.length, className: ue.className, style: ue.style, children: y.empty }) }) : J.map((j, q) => {
|
|
3510
|
+
const le = q % 2 === 0 ? "even" : "odd", re = I(
|
|
3470
3511
|
"transition-all duration-200",
|
|
3471
3512
|
le === "even" ? "bg-[color-mix(in_oklch,var(--table-hover)_6%,transparent)]" : "",
|
|
3472
3513
|
"hover:bg-[color-mix(in_oklch,var(--table-hover)_20%,transparent)]",
|
|
3473
3514
|
K.row.tw,
|
|
3474
|
-
|
|
3475
|
-
),
|
|
3476
|
-
...
|
|
3515
|
+
Me(u, j, q, le)
|
|
3516
|
+
), ae = {
|
|
3517
|
+
...Me(h, j, q, le),
|
|
3477
3518
|
...K.row.css
|
|
3478
3519
|
};
|
|
3479
|
-
return /* @__PURE__ */ s("tr", { className: re, style:
|
|
3480
|
-
const ee = V % 2 === 0 ? "even" : "odd", ce =
|
|
3520
|
+
return /* @__PURE__ */ s("tr", { className: re, style: ae, children: T.map((f, V) => {
|
|
3521
|
+
const ee = V % 2 === 0 ? "even" : "odd", ce = I(
|
|
3481
3522
|
"px-5 py-3.5 text-left relative",
|
|
3482
3523
|
"border-b border-[color-mix(in_oklch,var(--foreground)_5%,transparent)]",
|
|
3483
3524
|
K.cell.tw,
|
|
3484
|
-
|
|
3525
|
+
Me(m, j, f, q, V, le, ee)
|
|
3485
3526
|
), pe = {
|
|
3486
|
-
...
|
|
3487
|
-
...
|
|
3527
|
+
...f.width ? { width: f.width } : {},
|
|
3528
|
+
...Me(d, j, f, q, V, le, ee),
|
|
3488
3529
|
...K.cell.css
|
|
3489
3530
|
};
|
|
3490
|
-
return /* @__PURE__ */
|
|
3491
|
-
/* @__PURE__ */ s("div", { className: "flex items-center min-h-5", children:
|
|
3531
|
+
return /* @__PURE__ */ P("td", { className: ce, style: pe, children: [
|
|
3532
|
+
/* @__PURE__ */ s("div", { className: "flex items-center min-h-5", children: f.render ? f.render(j[f.dataIndex], j, q) : j[f.dataIndex] }),
|
|
3492
3533
|
/* @__PURE__ */ s("span", { className: "absolute right-0 top-[20%] h-[60%] w-px bg-[color-mix(in_oklch,var(--foreground)_4%,transparent)] last:hidden" })
|
|
3493
|
-
] },
|
|
3494
|
-
}) },
|
|
3534
|
+
] }, f.key || f.dataIndex || V);
|
|
3535
|
+
}) }, j.key || q);
|
|
3495
3536
|
}) })
|
|
3496
3537
|
] })
|
|
3497
3538
|
] });
|
|
3498
|
-
return /* @__PURE__ */
|
|
3499
|
-
|
|
3500
|
-
X(
|
|
3501
|
-
|
|
3539
|
+
return /* @__PURE__ */ P("div", { role: "region", "aria-label": C || "Table", ...F, children: [
|
|
3540
|
+
p && S === "top" && fe(),
|
|
3541
|
+
X(z),
|
|
3542
|
+
p && S === "bottom" && fe()
|
|
3502
3543
|
] });
|
|
3503
3544
|
}
|
|
3504
3545
|
Yr.propTypes = {
|
|
@@ -3538,18 +3579,18 @@ Yr.propTypes = {
|
|
|
3538
3579
|
i18nKey: t.string,
|
|
3539
3580
|
localeText: t.object
|
|
3540
3581
|
};
|
|
3541
|
-
const Kr = ["root", "tooltip"],
|
|
3582
|
+
const Kr = ["root", "tooltip"], kt = {
|
|
3542
3583
|
top: "bottom-full left-1/2 -translate-x-1/2 mb-2",
|
|
3543
3584
|
bottom: "top-full left-1/2 -translate-x-1/2 mt-2",
|
|
3544
3585
|
left: "right-full top-1/2 -translate-y-1/2 mr-2",
|
|
3545
3586
|
right: "left-full top-1/2 -translate-y-1/2 ml-2"
|
|
3546
|
-
},
|
|
3587
|
+
}, Wr = {
|
|
3547
3588
|
top: { bottom: "-5px", left: "50%", marginLeft: "-5px", transform: "rotate(45deg)" },
|
|
3548
3589
|
bottom: { top: "-5px", left: "50%", marginLeft: "-5px", transform: "rotate(45deg)" },
|
|
3549
3590
|
left: { right: "-5px", top: "50%", marginTop: "-5px", transform: "rotate(45deg)" },
|
|
3550
3591
|
right: { left: "-5px", top: "50%", marginTop: "-5px", transform: "rotate(45deg)" }
|
|
3551
3592
|
};
|
|
3552
|
-
function
|
|
3593
|
+
function Ur(e, o) {
|
|
3553
3594
|
const {
|
|
3554
3595
|
children: r,
|
|
3555
3596
|
title: n,
|
|
@@ -3559,68 +3600,68 @@ function Hr(e, o) {
|
|
|
3559
3600
|
onOpenChange: i,
|
|
3560
3601
|
disabled: u = !1,
|
|
3561
3602
|
sx: h = {},
|
|
3562
|
-
style:
|
|
3563
|
-
className:
|
|
3564
|
-
onMouseEnter:
|
|
3565
|
-
onMouseLeave:
|
|
3566
|
-
onFocus:
|
|
3567
|
-
onBlur:
|
|
3568
|
-
...
|
|
3569
|
-
} = e, [
|
|
3570
|
-
x ||
|
|
3571
|
-
}, [x, i]),
|
|
3603
|
+
style: m = {},
|
|
3604
|
+
className: d = "",
|
|
3605
|
+
onMouseEnter: g,
|
|
3606
|
+
onMouseLeave: v,
|
|
3607
|
+
onFocus: w,
|
|
3608
|
+
onBlur: C,
|
|
3609
|
+
...F
|
|
3610
|
+
} = e, [O, y] = Z(a), x = l !== void 0, T = x ? l : O, p = oe((L) => {
|
|
3611
|
+
x || y(L), i == null || i(L);
|
|
3612
|
+
}, [x, i]), S = kt[c] ? c : "top", _ = H(h, Kr), M = b({
|
|
3572
3613
|
baseClassName: "relative inline-flex",
|
|
3573
|
-
sxSlot:
|
|
3574
|
-
}),
|
|
3575
|
-
baseClassName:
|
|
3614
|
+
sxSlot: _.root
|
|
3615
|
+
}), B = b({
|
|
3616
|
+
baseClassName: I(
|
|
3576
3617
|
"absolute z-50 whitespace-nowrap px-3 py-1.5 text-sm",
|
|
3577
3618
|
"bg-[var(--tooltip-background)] text-[var(--tooltip-foreground)]",
|
|
3578
3619
|
"shadow-[var(--tooltip-shadow)]",
|
|
3579
|
-
|
|
3620
|
+
kt[S]
|
|
3580
3621
|
),
|
|
3581
|
-
className:
|
|
3622
|
+
className: d,
|
|
3582
3623
|
baseStyle: { borderRadius: "var(--tooltip-radius)" },
|
|
3583
|
-
sxSlot:
|
|
3584
|
-
style:
|
|
3585
|
-
}),
|
|
3624
|
+
sxSlot: _.tooltip,
|
|
3625
|
+
style: m
|
|
3626
|
+
}), A = {
|
|
3586
3627
|
position: "absolute",
|
|
3587
3628
|
width: "10px",
|
|
3588
3629
|
height: "10px",
|
|
3589
3630
|
backgroundColor: "inherit",
|
|
3590
|
-
...
|
|
3591
|
-
},
|
|
3592
|
-
return /* @__PURE__ */
|
|
3631
|
+
...Wr[S]
|
|
3632
|
+
}, k = () => !u && p(!0), N = () => !u && p(!1);
|
|
3633
|
+
return /* @__PURE__ */ P(
|
|
3593
3634
|
"div",
|
|
3594
3635
|
{
|
|
3595
3636
|
ref: o,
|
|
3596
|
-
className:
|
|
3597
|
-
style:
|
|
3598
|
-
onMouseEnter: (
|
|
3599
|
-
|
|
3637
|
+
className: M.className,
|
|
3638
|
+
style: M.style,
|
|
3639
|
+
onMouseEnter: (L) => {
|
|
3640
|
+
k(), g == null || g(L);
|
|
3600
3641
|
},
|
|
3601
|
-
onMouseLeave: (
|
|
3602
|
-
N(),
|
|
3642
|
+
onMouseLeave: (L) => {
|
|
3643
|
+
N(), v == null || v(L);
|
|
3603
3644
|
},
|
|
3604
|
-
onFocus: (
|
|
3605
|
-
|
|
3645
|
+
onFocus: (L) => {
|
|
3646
|
+
k(), w == null || w(L);
|
|
3606
3647
|
},
|
|
3607
|
-
onBlur: (
|
|
3608
|
-
N(),
|
|
3648
|
+
onBlur: (L) => {
|
|
3649
|
+
N(), C == null || C(L);
|
|
3609
3650
|
},
|
|
3610
|
-
...
|
|
3651
|
+
...F,
|
|
3611
3652
|
children: [
|
|
3612
3653
|
r,
|
|
3613
|
-
|
|
3654
|
+
T && n && /* @__PURE__ */ P("div", { role: "tooltip", className: B.className, style: B.style, children: [
|
|
3614
3655
|
/* @__PURE__ */ s("span", { style: { position: "relative", zIndex: 1 }, children: n }),
|
|
3615
|
-
/* @__PURE__ */ s("span", { style:
|
|
3656
|
+
/* @__PURE__ */ s("span", { style: A })
|
|
3616
3657
|
] })
|
|
3617
3658
|
]
|
|
3618
3659
|
}
|
|
3619
3660
|
);
|
|
3620
3661
|
}
|
|
3621
|
-
const
|
|
3622
|
-
|
|
3623
|
-
|
|
3662
|
+
const Rt = te.forwardRef(Ur);
|
|
3663
|
+
Rt.displayName = "Tooltip";
|
|
3664
|
+
Rt.propTypes = {
|
|
3624
3665
|
children: t.node,
|
|
3625
3666
|
title: t.node,
|
|
3626
3667
|
placement: t.oneOf(["top", "bottom", "left", "right"]),
|
|
@@ -3636,8 +3677,8 @@ Dt.propTypes = {
|
|
|
3636
3677
|
onFocus: t.func,
|
|
3637
3678
|
onBlur: t.func
|
|
3638
3679
|
};
|
|
3639
|
-
ie.MaterialButton =
|
|
3640
|
-
|
|
3680
|
+
ie.MaterialButton = Ge;
|
|
3681
|
+
qe.MaterialInput = Xe;
|
|
3641
3682
|
ne.Header = Xo;
|
|
3642
3683
|
ne.Footer = qo;
|
|
3643
3684
|
ne.Sider = Jo;
|
|
@@ -3653,18 +3694,18 @@ export {
|
|
|
3653
3694
|
Tr as Drawer,
|
|
3654
3695
|
qo as Footer,
|
|
3655
3696
|
Xo as Header,
|
|
3656
|
-
|
|
3697
|
+
qe as Input,
|
|
3657
3698
|
ne as Layout,
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3699
|
+
Bt as Line,
|
|
3700
|
+
It as Mark,
|
|
3701
|
+
Ge as MaterialButton,
|
|
3702
|
+
Xe as MaterialInput,
|
|
3662
3703
|
Ar as Modal,
|
|
3663
|
-
|
|
3704
|
+
Ze as Notice,
|
|
3664
3705
|
es as NoticeProvider,
|
|
3665
3706
|
Ir as Search,
|
|
3666
3707
|
Jo as Sider,
|
|
3667
|
-
|
|
3708
|
+
Dt as Space,
|
|
3668
3709
|
Yr as Table,
|
|
3669
3710
|
sr as TangoBanner,
|
|
3670
3711
|
dr as TangoColorPicker,
|
|
@@ -3673,19 +3714,19 @@ export {
|
|
|
3673
3714
|
Tr as TangoDrawer,
|
|
3674
3715
|
os as TangoI18nProvider,
|
|
3675
3716
|
Ar as TangoModal,
|
|
3676
|
-
|
|
3717
|
+
Ze as TangoNotice,
|
|
3677
3718
|
Ir as TangoSearch,
|
|
3678
|
-
|
|
3719
|
+
Rt as TangoTooltip,
|
|
3679
3720
|
Jr as ThemeProvider,
|
|
3680
3721
|
er as Toc,
|
|
3681
|
-
|
|
3682
|
-
|
|
3722
|
+
Rt as Tooltip,
|
|
3723
|
+
Je as Upload,
|
|
3683
3724
|
b as createSlotProps,
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
|
|
3725
|
+
I as mergeTwClassNames,
|
|
3726
|
+
H as normalizeSxSlots,
|
|
3727
|
+
Ee as normalizeTangoLocale,
|
|
3687
3728
|
ts as useNotice,
|
|
3688
3729
|
de as useTangoI18n,
|
|
3689
|
-
|
|
3730
|
+
ze as useTangoStyle,
|
|
3690
3731
|
Qr as useTheme
|
|
3691
3732
|
};
|