tango-ui-cw 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -9
- package/dist/index.cjs +4 -4
- package/dist/index.js +906 -863
- 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
|
|
4
|
-
import { createPortal as
|
|
2
|
+
import { jsx as s, jsxs as L, Fragment as Ne } from "react/jsx-runtime";
|
|
3
|
+
import te, { useState as Z, useRef as $e, useEffect as ae, useContext as Ue, createContext as He, forwardRef as kt, useCallback as oe, useMemo as Se, useId as Kt } from "react";
|
|
4
|
+
import { createPortal as Ut } from "react-dom";
|
|
5
5
|
import t from "prop-types";
|
|
6
|
-
import { twMerge as
|
|
7
|
-
const Qe = "tango:theme", et = "tango:themeTokens",
|
|
6
|
+
import { twMerge as Ht } from "tailwind-merge";
|
|
7
|
+
const Qe = "tango:theme", et = "tango:themeTokens", Wt = "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
|
+
], Lt = He(null), Pt = () => typeof window < "u", tt = (e, o) => {
|
|
14
|
+
if (!Pt())
|
|
15
15
|
return o;
|
|
16
16
|
try {
|
|
17
17
|
const r = window.localStorage.getItem(e);
|
|
@@ -20,44 +20,44 @@ const Qe = "tango:theme", et = "tango:themeTokens", Ht = "light", Wt = [
|
|
|
20
20
|
return o;
|
|
21
21
|
}
|
|
22
22
|
}, ot = (e, o) => {
|
|
23
|
-
if (
|
|
23
|
+
if (Pt())
|
|
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] =
|
|
30
|
+
const [o, r] = Z(() => tt(Qe, Wt) === "dark" ? "dark" : "light"), [n, c] = Z(
|
|
31
31
|
() => tt(et, {})
|
|
32
32
|
), l = $e(/* @__PURE__ */ new Set());
|
|
33
|
-
|
|
33
|
+
ae(() => {
|
|
34
34
|
typeof document > "u" || (document.documentElement.dataset.theme = o);
|
|
35
|
-
}, [o]),
|
|
35
|
+
}, [o]), ae(() => {
|
|
36
36
|
ot(Qe, o);
|
|
37
|
-
}, [o]),
|
|
37
|
+
}, [o]), ae(() => {
|
|
38
38
|
if (typeof document > "u")
|
|
39
39
|
return;
|
|
40
40
|
const d = document.documentElement, p = new Set(Object.keys(n));
|
|
41
|
-
l.current.forEach((
|
|
42
|
-
p.has(
|
|
43
|
-
}), Object.entries(n).forEach(([
|
|
44
|
-
|
|
41
|
+
l.current.forEach((f) => {
|
|
42
|
+
p.has(f) || d.style.removeProperty(`--${f}`);
|
|
43
|
+
}), Object.entries(n).forEach(([f, w]) => {
|
|
44
|
+
w == null || w === "" ? d.style.removeProperty(`--${f}`) : d.style.setProperty(`--${f}`, String(w));
|
|
45
45
|
}), l.current = p, ot(et, n);
|
|
46
46
|
}, [n]);
|
|
47
47
|
const a = (d) => {
|
|
48
48
|
c((p) => {
|
|
49
|
-
const
|
|
49
|
+
const f = typeof d == "function" ? d(p) : d;
|
|
50
50
|
return {
|
|
51
51
|
...p,
|
|
52
|
-
...
|
|
52
|
+
...f || {}
|
|
53
53
|
};
|
|
54
54
|
});
|
|
55
|
-
}, i = (d, p =
|
|
56
|
-
a((
|
|
57
|
-
const
|
|
58
|
-
return p.forEach((
|
|
59
|
-
|
|
60
|
-
}),
|
|
55
|
+
}, i = (d, p = Zt) => {
|
|
56
|
+
a((f) => {
|
|
57
|
+
const w = { ...f };
|
|
58
|
+
return p.forEach((P) => {
|
|
59
|
+
w[P] = d;
|
|
60
|
+
}), w;
|
|
61
61
|
});
|
|
62
62
|
}, u = () => {
|
|
63
63
|
c({});
|
|
@@ -65,7 +65,7 @@ function Jr({ children: e }) {
|
|
|
65
65
|
r((d) => d === "dark" ? "light" : "dark");
|
|
66
66
|
};
|
|
67
67
|
return /* @__PURE__ */ s(
|
|
68
|
-
|
|
68
|
+
Lt.Provider,
|
|
69
69
|
{
|
|
70
70
|
value: {
|
|
71
71
|
theme: o,
|
|
@@ -81,9 +81,9 @@ function Jr({ children: e }) {
|
|
|
81
81
|
);
|
|
82
82
|
}
|
|
83
83
|
function Qr() {
|
|
84
|
-
return Ue(
|
|
84
|
+
return Ue(Lt);
|
|
85
85
|
}
|
|
86
|
-
const
|
|
86
|
+
const Gt = /* @__PURE__ */ new Set([
|
|
87
87
|
"root",
|
|
88
88
|
"slots",
|
|
89
89
|
"tw",
|
|
@@ -93,75 +93,75 @@ const Zt = /* @__PURE__ */ new Set([
|
|
|
93
93
|
]), Ee = {
|
|
94
94
|
tw: "",
|
|
95
95
|
css: {}
|
|
96
|
-
}, ye = (e) => typeof e == "object" && e !== null && !Array.isArray(e),
|
|
96
|
+
}, 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 = {
|
|
97
97
|
mt: (e, o) => {
|
|
98
|
-
e.marginTop =
|
|
98
|
+
e.marginTop = Y(o);
|
|
99
99
|
},
|
|
100
100
|
mr: (e, o) => {
|
|
101
|
-
e.marginRight =
|
|
101
|
+
e.marginRight = Y(o);
|
|
102
102
|
},
|
|
103
103
|
mb: (e, o) => {
|
|
104
|
-
e.marginBottom =
|
|
104
|
+
e.marginBottom = Y(o);
|
|
105
105
|
},
|
|
106
106
|
ml: (e, o) => {
|
|
107
|
-
e.marginLeft =
|
|
107
|
+
e.marginLeft = Y(o);
|
|
108
108
|
},
|
|
109
109
|
mx: (e, o) => {
|
|
110
|
-
e.marginLeft =
|
|
110
|
+
e.marginLeft = Y(o), e.marginRight = Y(o);
|
|
111
111
|
},
|
|
112
112
|
my: (e, o) => {
|
|
113
|
-
e.marginTop =
|
|
113
|
+
e.marginTop = Y(o), e.marginBottom = Y(o);
|
|
114
114
|
},
|
|
115
115
|
m: (e, o) => {
|
|
116
|
-
e.margin =
|
|
116
|
+
e.margin = Y(o);
|
|
117
117
|
},
|
|
118
118
|
pt: (e, o) => {
|
|
119
|
-
e.paddingTop =
|
|
119
|
+
e.paddingTop = Y(o);
|
|
120
120
|
},
|
|
121
121
|
pr: (e, o) => {
|
|
122
|
-
e.paddingRight =
|
|
122
|
+
e.paddingRight = Y(o);
|
|
123
123
|
},
|
|
124
124
|
pb: (e, o) => {
|
|
125
|
-
e.paddingBottom =
|
|
125
|
+
e.paddingBottom = Y(o);
|
|
126
126
|
},
|
|
127
127
|
pl: (e, o) => {
|
|
128
|
-
e.paddingLeft =
|
|
128
|
+
e.paddingLeft = Y(o);
|
|
129
129
|
},
|
|
130
130
|
px: (e, o) => {
|
|
131
|
-
e.paddingLeft =
|
|
131
|
+
e.paddingLeft = Y(o), e.paddingRight = Y(o);
|
|
132
132
|
},
|
|
133
133
|
py: (e, o) => {
|
|
134
|
-
e.paddingTop =
|
|
134
|
+
e.paddingTop = Y(o), e.paddingBottom = Y(o);
|
|
135
135
|
},
|
|
136
136
|
p: (e, o) => {
|
|
137
|
-
e.padding =
|
|
137
|
+
e.padding = Y(o);
|
|
138
138
|
},
|
|
139
139
|
g: (e, o) => {
|
|
140
|
-
e.gap =
|
|
140
|
+
e.gap = Y(o);
|
|
141
141
|
},
|
|
142
142
|
rg: (e, o) => {
|
|
143
|
-
e.rowGap =
|
|
143
|
+
e.rowGap = Y(o);
|
|
144
144
|
},
|
|
145
145
|
cg: (e, o) => {
|
|
146
|
-
e.columnGap =
|
|
146
|
+
e.columnGap = Y(o);
|
|
147
147
|
},
|
|
148
148
|
w: (e, o) => {
|
|
149
|
-
e.width =
|
|
149
|
+
e.width = Y(o);
|
|
150
150
|
},
|
|
151
151
|
h: (e, o) => {
|
|
152
|
-
e.height =
|
|
152
|
+
e.height = Y(o);
|
|
153
153
|
},
|
|
154
154
|
mw: (e, o) => {
|
|
155
|
-
e.minWidth =
|
|
155
|
+
e.minWidth = Y(o);
|
|
156
156
|
},
|
|
157
157
|
mh: (e, o) => {
|
|
158
|
-
e.minHeight =
|
|
158
|
+
e.minHeight = Y(o);
|
|
159
159
|
},
|
|
160
160
|
maxw: (e, o) => {
|
|
161
|
-
e.maxWidth =
|
|
161
|
+
e.maxWidth = Y(o);
|
|
162
162
|
},
|
|
163
163
|
maxh: (e, o) => {
|
|
164
|
-
e.maxHeight =
|
|
164
|
+
e.maxHeight = Y(o);
|
|
165
165
|
},
|
|
166
166
|
vw: (e, o) => {
|
|
167
167
|
e.width = typeof o == "number" ? `${o}vw` : o;
|
|
@@ -176,7 +176,7 @@ const Zt = /* @__PURE__ */ new Set([
|
|
|
176
176
|
e.height = typeof o == "number" ? `${o}%` : o;
|
|
177
177
|
},
|
|
178
178
|
size: (e, o) => {
|
|
179
|
-
e.fontSize =
|
|
179
|
+
e.fontSize = Y(o);
|
|
180
180
|
},
|
|
181
181
|
fw: (e, o) => {
|
|
182
182
|
e.fontWeight = o;
|
|
@@ -197,10 +197,10 @@ const Zt = /* @__PURE__ */ new Set([
|
|
|
197
197
|
e.textAlign = "left";
|
|
198
198
|
},
|
|
199
199
|
lh: (e, o) => {
|
|
200
|
-
e.lineHeight =
|
|
200
|
+
e.lineHeight = Y(o);
|
|
201
201
|
},
|
|
202
202
|
ls: (e, o) => {
|
|
203
|
-
e.letterSpacing =
|
|
203
|
+
e.letterSpacing = Y(o);
|
|
204
204
|
},
|
|
205
205
|
c: (e, o) => {
|
|
206
206
|
e.color = he(o);
|
|
@@ -215,10 +215,10 @@ const Zt = /* @__PURE__ */ new Set([
|
|
|
215
215
|
e.border = o === 1 ? "1px solid var(--border)" : he(o);
|
|
216
216
|
},
|
|
217
217
|
br: (e, o) => {
|
|
218
|
-
e.borderRadius =
|
|
218
|
+
e.borderRadius = Y(o);
|
|
219
219
|
},
|
|
220
220
|
bw: (e, o) => {
|
|
221
|
-
e.borderWidth =
|
|
221
|
+
e.borderWidth = Y(o);
|
|
222
222
|
},
|
|
223
223
|
bs: (e, o) => {
|
|
224
224
|
e.borderStyle = o;
|
|
@@ -254,19 +254,19 @@ const Zt = /* @__PURE__ */ new Set([
|
|
|
254
254
|
e.position = "absolute", e.inset = 0, e.margin = "auto";
|
|
255
255
|
},
|
|
256
256
|
inset: (e, o) => {
|
|
257
|
-
e.inset =
|
|
257
|
+
e.inset = Y(o);
|
|
258
258
|
},
|
|
259
259
|
top: (e, o) => {
|
|
260
|
-
e.top =
|
|
260
|
+
e.top = Y(o);
|
|
261
261
|
},
|
|
262
262
|
right: (e, o) => {
|
|
263
|
-
e.right =
|
|
263
|
+
e.right = Y(o);
|
|
264
264
|
},
|
|
265
265
|
bottom: (e, o) => {
|
|
266
|
-
e.bottom =
|
|
266
|
+
e.bottom = Y(o);
|
|
267
267
|
},
|
|
268
268
|
left: (e, o) => {
|
|
269
|
-
e.left =
|
|
269
|
+
e.left = Y(o);
|
|
270
270
|
},
|
|
271
271
|
z: (e, o) => {
|
|
272
272
|
e.zIndex = o;
|
|
@@ -365,16 +365,16 @@ const Zt = /* @__PURE__ */ new Set([
|
|
|
365
365
|
e.visibility = "visible";
|
|
366
366
|
}
|
|
367
367
|
}, Me = (e = {}) => ye(e) ? Object.entries(e).reduce((o, [r, n]) => {
|
|
368
|
-
if (
|
|
368
|
+
if (Gt.has(r))
|
|
369
369
|
return o;
|
|
370
|
-
const c =
|
|
370
|
+
const c = Jt[r];
|
|
371
371
|
if (c)
|
|
372
372
|
return c(o, n), o;
|
|
373
|
-
const l =
|
|
373
|
+
const l = Xt(r), a = typeof n == "string" && (n.startsWith("$") || qt(l)) ? he(n) : n;
|
|
374
374
|
return o[l] = a, o;
|
|
375
375
|
}, {}) : {}, E = (...e) => {
|
|
376
376
|
const o = e.filter(Boolean).join(" ").trim();
|
|
377
|
-
return o ?
|
|
377
|
+
return o ? Ht(o) : "";
|
|
378
378
|
}, Pe = (e) => {
|
|
379
379
|
if (typeof e == "string")
|
|
380
380
|
return { tw: e, css: {} };
|
|
@@ -393,18 +393,18 @@ const Zt = /* @__PURE__ */ new Set([
|
|
|
393
393
|
...c
|
|
394
394
|
}
|
|
395
395
|
};
|
|
396
|
-
},
|
|
396
|
+
}, 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
397
|
const o = {};
|
|
398
398
|
return e.forEach((r) => {
|
|
399
399
|
o[r] = { ...Ee };
|
|
400
400
|
}), o.root || (o.root = { ...Ee }), o;
|
|
401
|
-
},
|
|
402
|
-
const r =
|
|
401
|
+
}, W = (e, o = ["root"]) => {
|
|
402
|
+
const r = eo(o);
|
|
403
403
|
if (typeof e == "string")
|
|
404
404
|
return r.root.tw = e, r;
|
|
405
405
|
if (!ye(e))
|
|
406
406
|
return r;
|
|
407
|
-
if (!
|
|
407
|
+
if (!Qt(e, o))
|
|
408
408
|
return r.root.css = Me(e), r;
|
|
409
409
|
const n = Pe({
|
|
410
410
|
tw: [e.className, e.tw].filter(Boolean).join(" "),
|
|
@@ -444,7 +444,7 @@ const Zt = /* @__PURE__ */ new Set([
|
|
|
444
444
|
...c.css || {},
|
|
445
445
|
...n || {}
|
|
446
446
|
}
|
|
447
|
-
}),
|
|
447
|
+
}), to = ["root", "icon", "content"], rt = {
|
|
448
448
|
success: "text-[var(--notice-success-text)]",
|
|
449
449
|
fail: "text-[var(--notice-fail-text)]",
|
|
450
450
|
caution: "text-[var(--notice-caution-text)]"
|
|
@@ -458,7 +458,7 @@ const Zt = /* @__PURE__ */ new Set([
|
|
|
458
458
|
enter: "animate-[noticeSlideFromBottom_0.3s_ease-out_forwards]"
|
|
459
459
|
}
|
|
460
460
|
};
|
|
461
|
-
function
|
|
461
|
+
function oo(e, o) {
|
|
462
462
|
const {
|
|
463
463
|
type: r = "success",
|
|
464
464
|
icon: n,
|
|
@@ -470,43 +470,43 @@ function to(e, o) {
|
|
|
470
470
|
style: h = {},
|
|
471
471
|
className: d = "",
|
|
472
472
|
...p
|
|
473
|
-
} = e, [
|
|
474
|
-
|
|
475
|
-
const
|
|
476
|
-
return () => clearTimeout(
|
|
473
|
+
} = e, [f, w] = Z(!1), P = rt[r] ? r : "success", O = st[l] ? l : "default", D = W(u, to), S = oe(() => {
|
|
474
|
+
w(!0);
|
|
475
|
+
const z = setTimeout(() => i == null ? void 0 : i(), 300);
|
|
476
|
+
return () => clearTimeout(z);
|
|
477
477
|
}, [i]);
|
|
478
|
-
|
|
478
|
+
ae(() => {
|
|
479
479
|
if (!i || a <= 0) return;
|
|
480
|
-
const
|
|
481
|
-
return () => clearTimeout(
|
|
482
|
-
}, [i, a,
|
|
483
|
-
const
|
|
480
|
+
const z = setTimeout(S, a);
|
|
481
|
+
return () => clearTimeout(z);
|
|
482
|
+
}, [i, a, S]);
|
|
483
|
+
const v = st[O], x = O === "default" ? "animate-[noticeSlideUpFade_0.3s_ease-in_forwards]" : "animate-[noticeSlideToBottom_0.3s_ease-in_forwards]", C = b({
|
|
484
484
|
baseClassName: E(
|
|
485
485
|
"inline-flex items-center gap-2 px-3 py-2 text-sm z-[999]",
|
|
486
486
|
"rounded-[var(--notice-radius)]",
|
|
487
487
|
"bg-[var(--notice-bg)] text-[var(--notice-foreground)]",
|
|
488
488
|
"shadow-[var(--notice-shadow)]",
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
O === "md" && rt[
|
|
489
|
+
v.base,
|
|
490
|
+
f ? x : v.enter,
|
|
491
|
+
O === "md" && rt[P]
|
|
492
492
|
),
|
|
493
493
|
className: d,
|
|
494
|
-
sxSlot:
|
|
494
|
+
sxSlot: D.root,
|
|
495
495
|
baseStyle: { borderRadius: "var(--notice-radius)" },
|
|
496
496
|
style: h
|
|
497
497
|
}), m = b({
|
|
498
498
|
baseClassName: "flex-shrink-0 text-[var(--notice-foreground)]",
|
|
499
|
-
sxSlot:
|
|
499
|
+
sxSlot: D.icon
|
|
500
500
|
}), y = b({
|
|
501
501
|
baseClassName: "inline-block",
|
|
502
|
-
sxSlot:
|
|
502
|
+
sxSlot: D.content
|
|
503
503
|
});
|
|
504
|
-
return /* @__PURE__ */
|
|
504
|
+
return /* @__PURE__ */ L("div", { ref: o, role: "alert", className: C.className, style: C.style, ...p, children: [
|
|
505
505
|
O !== "md" && n && /* @__PURE__ */ s("span", { className: m.className, style: m.style, children: n }),
|
|
506
506
|
/* @__PURE__ */ s("span", { className: y.className, style: y.style, children: c })
|
|
507
507
|
] });
|
|
508
508
|
}
|
|
509
|
-
const We =
|
|
509
|
+
const We = kt(oo);
|
|
510
510
|
We.displayName = "Notice";
|
|
511
511
|
We.propTypes = {
|
|
512
512
|
type: t.oneOf(["success", "fail", "caution"]),
|
|
@@ -519,19 +519,19 @@ We.propTypes = {
|
|
|
519
519
|
style: t.object,
|
|
520
520
|
className: t.string
|
|
521
521
|
};
|
|
522
|
-
const
|
|
522
|
+
const Ot = He(null), ro = /* @__PURE__ */ s("svg", { viewBox: "0 0 1024 1024", width: "1.2em", height: "1.2em", children: /* @__PURE__ */ s(
|
|
523
523
|
"path",
|
|
524
524
|
{
|
|
525
525
|
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",
|
|
526
526
|
fill: "var(--notice-success-text)"
|
|
527
527
|
}
|
|
528
|
-
) }),
|
|
528
|
+
) }), so = /* @__PURE__ */ s("svg", { viewBox: "0 0 1024 1024", width: "1.2em", height: "1.2em", children: /* @__PURE__ */ s(
|
|
529
529
|
"path",
|
|
530
530
|
{
|
|
531
531
|
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
532
|
fill: "var(--notice-fail-text)"
|
|
533
533
|
}
|
|
534
|
-
) }),
|
|
534
|
+
) }), ao = /* @__PURE__ */ L("svg", { viewBox: "0 0 1024 1024", width: "1.2em", height: "1.2em", children: [
|
|
535
535
|
/* @__PURE__ */ s(
|
|
536
536
|
"path",
|
|
537
537
|
{
|
|
@@ -553,10 +553,10 @@ const Pt = He(null), oo = /* @__PURE__ */ s("svg", { viewBox: "0 0 1024 1024", w
|
|
|
553
553
|
fill: "var(--notice-fail-text)"
|
|
554
554
|
}
|
|
555
555
|
)
|
|
556
|
-
] }),
|
|
556
|
+
] }), no = { success: ro, fail: so, caution: ao };
|
|
557
557
|
function es({ children: e }) {
|
|
558
|
-
const [o, r] =
|
|
559
|
-
|
|
558
|
+
const [o, r] = Z([]), [n, c] = Z(!1);
|
|
559
|
+
ae(() => {
|
|
560
560
|
c(!0);
|
|
561
561
|
}, []);
|
|
562
562
|
const l = oe((i) => {
|
|
@@ -565,25 +565,25 @@ function es({ children: e }) {
|
|
|
565
565
|
const d = Date.now() + Math.random();
|
|
566
566
|
r((p) => [
|
|
567
567
|
...p,
|
|
568
|
-
{ id: d, type: i, message: u, variant: h, icon:
|
|
568
|
+
{ id: d, type: i, message: u, variant: h, icon: no[i] }
|
|
569
569
|
]);
|
|
570
570
|
}, []);
|
|
571
|
-
return /* @__PURE__ */
|
|
571
|
+
return /* @__PURE__ */ L(Ot.Provider, { value: { add: a, remove: l }, children: [
|
|
572
572
|
e,
|
|
573
|
-
n &&
|
|
573
|
+
n && Ut(
|
|
574
574
|
/* @__PURE__ */ s("div", { id: "notification-container", className: "flex flex-col items-center gap-2", children: o.map((i) => /* @__PURE__ */ s(We, { ...i, onClose: () => l(i.id) }, i.id)) }),
|
|
575
575
|
document.body
|
|
576
576
|
)
|
|
577
577
|
] });
|
|
578
578
|
}
|
|
579
|
-
function
|
|
580
|
-
const e = Ue(
|
|
579
|
+
function lo() {
|
|
580
|
+
const e = Ue(Ot);
|
|
581
581
|
if (!e)
|
|
582
582
|
throw new Error("useNotice must be used inside <NoticeProvider />");
|
|
583
583
|
return e;
|
|
584
584
|
}
|
|
585
585
|
function ts() {
|
|
586
|
-
const { add: e } =
|
|
586
|
+
const { add: e } = lo();
|
|
587
587
|
return {
|
|
588
588
|
success: (o) => e("success", o),
|
|
589
589
|
fail: (o) => e("fail", o),
|
|
@@ -595,7 +595,7 @@ function ts() {
|
|
|
595
595
|
}
|
|
596
596
|
};
|
|
597
597
|
}
|
|
598
|
-
const _t = "tango:locale", xe = "zh-CN",
|
|
598
|
+
const _t = "tango:locale", xe = "zh-CN", co = {
|
|
599
599
|
zh: "zh-CN",
|
|
600
600
|
ZH: "zh-CN",
|
|
601
601
|
"zh-CN": "zh-CN",
|
|
@@ -608,7 +608,7 @@ const _t = "tango:locale", xe = "zh-CN", lo = {
|
|
|
608
608
|
"en-us": "en-US",
|
|
609
609
|
us: "en-US",
|
|
610
610
|
US: "en-US"
|
|
611
|
-
},
|
|
611
|
+
}, At = {
|
|
612
612
|
"zh-CN": {
|
|
613
613
|
button: {
|
|
614
614
|
default: "按钮",
|
|
@@ -776,21 +776,21 @@ const _t = "tango:locale", xe = "zh-CN", lo = {
|
|
|
776
776
|
}
|
|
777
777
|
}
|
|
778
778
|
}, Ke = () => {
|
|
779
|
-
},
|
|
779
|
+
}, Mt = He({
|
|
780
780
|
locale: xe,
|
|
781
781
|
setLocale: Ke,
|
|
782
782
|
toggleLocale: Ke,
|
|
783
|
-
messages:
|
|
783
|
+
messages: At,
|
|
784
784
|
t: (e, o = "") => o
|
|
785
|
-
}), at = (e) => typeof e == "object" && e !== null && !Array.isArray(e),
|
|
785
|
+
}), at = (e) => typeof e == "object" && e !== null && !Array.isArray(e), zt = (e, o) => {
|
|
786
786
|
const r = { ...e };
|
|
787
787
|
return Object.entries(o || {}).forEach(([n, c]) => {
|
|
788
|
-
at(c) && at(r[n]) ? r[n] =
|
|
788
|
+
at(c) && at(r[n]) ? r[n] = zt(r[n], c) : r[n] = c;
|
|
789
789
|
}), r;
|
|
790
|
-
},
|
|
790
|
+
}, io = (e, o) => o.split(".").reduce((r, n) => {
|
|
791
791
|
if (r && Object.prototype.hasOwnProperty.call(r, n))
|
|
792
792
|
return r[n];
|
|
793
|
-
}, e), ze = (e) => typeof e != "string" || !e.trim() ? xe :
|
|
793
|
+
}, e), ze = (e) => typeof e != "string" || !e.trim() ? xe : co[e] || e, uo = () => {
|
|
794
794
|
if (typeof window > "u")
|
|
795
795
|
return xe;
|
|
796
796
|
try {
|
|
@@ -807,13 +807,13 @@ function os({
|
|
|
807
807
|
onLocaleChange: n = Ke,
|
|
808
808
|
messages: c = {}
|
|
809
809
|
}) {
|
|
810
|
-
const l = ze(r), a = o == null ? null : ze(o), [i, u] =
|
|
811
|
-
() =>
|
|
812
|
-
), h = a || i, d = (
|
|
813
|
-
const O = ze(
|
|
810
|
+
const l = ze(r), a = o == null ? null : ze(o), [i, u] = Z(
|
|
811
|
+
() => uo() || l
|
|
812
|
+
), h = a || i, d = (P) => {
|
|
813
|
+
const O = ze(P);
|
|
814
814
|
a == null && u(O), n(O);
|
|
815
815
|
};
|
|
816
|
-
|
|
816
|
+
ae(() => {
|
|
817
817
|
if (!(typeof window > "u"))
|
|
818
818
|
try {
|
|
819
819
|
window.localStorage.setItem(_t, h);
|
|
@@ -821,40 +821,40 @@ function os({
|
|
|
821
821
|
}
|
|
822
822
|
}, [h]);
|
|
823
823
|
const p = Se(
|
|
824
|
-
() =>
|
|
824
|
+
() => zt(At, c),
|
|
825
825
|
[c]
|
|
826
|
-
),
|
|
826
|
+
), f = () => {
|
|
827
827
|
d(h === "zh-CN" ? "en-US" : "zh-CN");
|
|
828
|
-
},
|
|
829
|
-
const
|
|
830
|
-
return
|
|
828
|
+
}, w = (P, O = "") => {
|
|
829
|
+
const D = p[h] || p[xe] || {}, S = io(D, P);
|
|
830
|
+
return S == null || S === "" ? O : String(S);
|
|
831
831
|
};
|
|
832
832
|
return /* @__PURE__ */ s(
|
|
833
|
-
|
|
833
|
+
Mt.Provider,
|
|
834
834
|
{
|
|
835
835
|
value: {
|
|
836
836
|
locale: h,
|
|
837
837
|
setLocale: d,
|
|
838
|
-
toggleLocale:
|
|
838
|
+
toggleLocale: f,
|
|
839
839
|
messages: p,
|
|
840
|
-
t:
|
|
840
|
+
t: w
|
|
841
841
|
},
|
|
842
842
|
children: e
|
|
843
843
|
}
|
|
844
844
|
);
|
|
845
845
|
}
|
|
846
|
-
function
|
|
847
|
-
return Ue(
|
|
846
|
+
function de() {
|
|
847
|
+
return Ue(Mt);
|
|
848
848
|
}
|
|
849
|
-
const
|
|
850
|
-
materialBtn:
|
|
851
|
-
materialBtnSmall:
|
|
852
|
-
materialBtnMedium:
|
|
853
|
-
materialBtnLarge:
|
|
849
|
+
const po = "_materialBtn_wlueu_4", mo = "_materialBtnSmall_wlueu_26", bo = "_materialBtnMedium_wlueu_32", go = "_materialBtnLarge_wlueu_38", fo = "_materialBtnHuge_wlueu_44", ho = "_materialBtnDisabled_wlueu_51", yo = "_ripple_wlueu_59", Ce = {
|
|
850
|
+
materialBtn: po,
|
|
851
|
+
materialBtnSmall: mo,
|
|
852
|
+
materialBtnMedium: bo,
|
|
853
|
+
materialBtnLarge: go,
|
|
854
854
|
materialBtnHuge: fo,
|
|
855
|
-
materialBtnDisabled:
|
|
856
|
-
ripple:
|
|
857
|
-
},
|
|
855
|
+
materialBtnDisabled: ho,
|
|
856
|
+
ripple: yo
|
|
857
|
+
}, nt = ["root", "content", "icon", "loading"], xo = { small: "small", medium: "medium", large: "large", huge: "huge" }, vo = { small: 12, medium: 14, large: 16, huge: 20 }, lt = {
|
|
858
858
|
default: {
|
|
859
859
|
backgroundColor: "var(--primary)",
|
|
860
860
|
color: "var(--primary-foreground)",
|
|
@@ -905,7 +905,7 @@ const uo = "_materialBtn_wlueu_4", po = "_materialBtnSmall_wlueu_26", mo = "_mat
|
|
|
905
905
|
default: "按钮",
|
|
906
906
|
loading: "加载中",
|
|
907
907
|
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",
|
|
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", ct = (e, o, r) => Object.prototype.hasOwnProperty.call(r, e) ? e : o;
|
|
909
909
|
function Ze(e) {
|
|
910
910
|
const {
|
|
911
911
|
type: o = "default",
|
|
@@ -920,87 +920,87 @@ function Ze(e) {
|
|
|
920
920
|
outline: h = !1,
|
|
921
921
|
icon: d = null,
|
|
922
922
|
iconPosition: p = null,
|
|
923
|
-
loading:
|
|
924
|
-
i18nKey:
|
|
925
|
-
localeText:
|
|
923
|
+
loading: f = !1,
|
|
924
|
+
i18nKey: w = null,
|
|
925
|
+
localeText: P = {},
|
|
926
926
|
rippleColor: O,
|
|
927
|
-
"aria-label":
|
|
928
|
-
...
|
|
929
|
-
} = e, { t:
|
|
930
|
-
default:
|
|
931
|
-
loading:
|
|
932
|
-
iconAlt:
|
|
933
|
-
...
|
|
934
|
-
}, U = (
|
|
927
|
+
"aria-label": D,
|
|
928
|
+
...S
|
|
929
|
+
} = e, { t: v } = de(), x = $e(null), C = ct(r, "medium", xo), m = ct(o, "default", lt), y = Co(f), z = To(f), A = u || y, $ = vo[C], _ = p === "right" ? "right" : d || y ? "left" : null, T = O ?? "var(--material-button-ripple)", N = {
|
|
930
|
+
default: v("materialButton.default", De.default),
|
|
931
|
+
loading: v("materialButton.loading", De.loading),
|
|
932
|
+
iconAlt: v("materialButton.iconAlt", De.iconAlt),
|
|
933
|
+
...P
|
|
934
|
+
}, U = (w && typeof N[w] == "string" ? N[w] : null) || (w ? v(`materialButton.${w}`, N.default) : N.default), j = y ? N.loading : U, B = i ?? j, M = D || (i == null ? String(B || N.default) : void 0), F = W(n, nt), H = A ? No : h ? So[m] : lt[m], K = Ce[`materialBtn${wo(C)}`], G = F.root.css || {}, R = typeof n == "string" ? n : "", Q = /* @__PURE__ */ new Set([...nt, "root", "slots", "tw", "className", "css", "style"]), ue = typeof n == "object" ? Object.fromEntries(Object.entries(n).filter(([re]) => !Q.has(re))) : {}, be = [
|
|
935
935
|
Ce.materialBtn,
|
|
936
936
|
K,
|
|
937
937
|
A && Ce.materialBtnDisabled,
|
|
938
|
-
|
|
939
|
-
|
|
938
|
+
F.root.tw,
|
|
939
|
+
R,
|
|
940
940
|
l
|
|
941
|
-
].filter(Boolean).join(" "),
|
|
942
|
-
...
|
|
943
|
-
...
|
|
944
|
-
...
|
|
941
|
+
].filter(Boolean).join(" "), ge = {
|
|
942
|
+
...H,
|
|
943
|
+
...ue,
|
|
944
|
+
...G,
|
|
945
945
|
...c
|
|
946
946
|
}, fe = b({
|
|
947
947
|
baseClassName: "inline-flex items-center relative z-[1]",
|
|
948
|
-
sxSlot:
|
|
949
|
-
}),
|
|
948
|
+
sxSlot: F.content
|
|
949
|
+
}), X = b({
|
|
950
950
|
baseClassName: "inline-flex items-center justify-center shrink-0 transition-all duration-300 relative z-[1]",
|
|
951
951
|
baseStyle: { width: `${$}px`, height: `${$}px` },
|
|
952
|
-
sxSlot:
|
|
953
|
-
}),
|
|
952
|
+
sxSlot: F.icon
|
|
953
|
+
}), J = b({
|
|
954
954
|
baseClassName: "inline-flex items-center justify-center shrink-0 animate-spin relative z-[1]",
|
|
955
955
|
baseStyle: {
|
|
956
956
|
width: `${$}px`,
|
|
957
957
|
height: `${$}px`,
|
|
958
|
-
color:
|
|
958
|
+
color: z === "light" ? "var(--button-loading-light)" : "var(--button-loading-dark)"
|
|
959
959
|
},
|
|
960
|
-
sxSlot:
|
|
961
|
-
}),
|
|
962
|
-
(
|
|
960
|
+
sxSlot: F.loading
|
|
961
|
+
}), I = oe(
|
|
962
|
+
(re) => {
|
|
963
963
|
if (A) return;
|
|
964
|
-
const
|
|
965
|
-
if (!
|
|
966
|
-
const
|
|
967
|
-
Object.assign(
|
|
968
|
-
width: `${
|
|
969
|
-
height: `${
|
|
970
|
-
left: `${
|
|
971
|
-
top: `${
|
|
972
|
-
}),
|
|
973
|
-
const
|
|
974
|
-
|
|
964
|
+
const se = x.current;
|
|
965
|
+
if (!se) return;
|
|
966
|
+
const g = document.createElement("span"), V = Math.max(se.clientWidth, se.clientHeight), ee = V / 2;
|
|
967
|
+
Object.assign(g.style, {
|
|
968
|
+
width: `${V}px`,
|
|
969
|
+
height: `${V}px`,
|
|
970
|
+
left: `${re.clientX - se.getBoundingClientRect().left - ee}px`,
|
|
971
|
+
top: `${re.clientY - se.getBoundingClientRect().top - ee}px`
|
|
972
|
+
}), g.className = Ce.ripple, g.style.background = T;
|
|
973
|
+
const ce = se.querySelector(`.${Ce.ripple}`);
|
|
974
|
+
ce && ce.remove(), se.appendChild(g);
|
|
975
975
|
},
|
|
976
976
|
[A, T]
|
|
977
|
-
),
|
|
977
|
+
), q = () => d ? typeof d == "string" ? /* @__PURE__ */ s(
|
|
978
978
|
"img",
|
|
979
979
|
{
|
|
980
980
|
src: d,
|
|
981
981
|
alt: N.iconAlt,
|
|
982
|
-
className:
|
|
983
|
-
style:
|
|
982
|
+
className: X.className,
|
|
983
|
+
style: X.style,
|
|
984
984
|
"aria-hidden": "true"
|
|
985
985
|
}
|
|
986
|
-
) :
|
|
987
|
-
className: E(
|
|
988
|
-
style: { ...
|
|
986
|
+
) : te.isValidElement(d) ? te.cloneElement(d, {
|
|
987
|
+
className: E(X.className, d.props.className),
|
|
988
|
+
style: { ...X.style, ...d.props.style },
|
|
989
989
|
"aria-hidden": !0
|
|
990
990
|
}) : typeof d == "function" ? /* @__PURE__ */ s(
|
|
991
991
|
d,
|
|
992
992
|
{
|
|
993
|
-
className:
|
|
994
|
-
style:
|
|
993
|
+
className: X.className,
|
|
994
|
+
style: X.style,
|
|
995
995
|
"aria-hidden": "true"
|
|
996
996
|
}
|
|
997
|
-
) : /* @__PURE__ */ s("span", { className:
|
|
997
|
+
) : /* @__PURE__ */ s("span", { className: X.className, style: X.style, "aria-hidden": "true", children: d }) : null, le = () => /* @__PURE__ */ s(
|
|
998
998
|
"svg",
|
|
999
999
|
{
|
|
1000
1000
|
viewBox: "0 0 1024 1024",
|
|
1001
1001
|
role: "presentation",
|
|
1002
|
-
className:
|
|
1003
|
-
style:
|
|
1002
|
+
className: J.className,
|
|
1003
|
+
style: J.style,
|
|
1004
1004
|
"aria-hidden": "true",
|
|
1005
1005
|
children: /* @__PURE__ */ s(
|
|
1006
1006
|
"path",
|
|
@@ -1011,30 +1011,30 @@ function Ze(e) {
|
|
|
1011
1011
|
)
|
|
1012
1012
|
}
|
|
1013
1013
|
);
|
|
1014
|
-
return /* @__PURE__ */
|
|
1014
|
+
return /* @__PURE__ */ L(
|
|
1015
1015
|
"button",
|
|
1016
1016
|
{
|
|
1017
1017
|
ref: x,
|
|
1018
|
-
className:
|
|
1019
|
-
style:
|
|
1020
|
-
onClick: (
|
|
1021
|
-
|
|
1018
|
+
className: be,
|
|
1019
|
+
style: ge,
|
|
1020
|
+
onClick: (re) => {
|
|
1021
|
+
I(re), a == null || a(re);
|
|
1022
1022
|
},
|
|
1023
1023
|
disabled: A,
|
|
1024
|
-
"aria-label":
|
|
1024
|
+
"aria-label": M,
|
|
1025
1025
|
"data-variant": m,
|
|
1026
|
-
"data-size":
|
|
1027
|
-
"data-icon-position":
|
|
1028
|
-
...
|
|
1026
|
+
"data-size": C,
|
|
1027
|
+
"data-icon-position": _ || void 0,
|
|
1028
|
+
...S,
|
|
1029
1029
|
children: [
|
|
1030
|
-
|
|
1031
|
-
y &&
|
|
1032
|
-
!y && d &&
|
|
1030
|
+
_ === "left" && /* @__PURE__ */ L(Ne, { children: [
|
|
1031
|
+
y && le(),
|
|
1032
|
+
!y && d && q()
|
|
1033
1033
|
] }),
|
|
1034
|
-
/* @__PURE__ */ s("span", { className: fe.className, style: fe.style, children:
|
|
1035
|
-
|
|
1036
|
-
y &&
|
|
1037
|
-
!y && d &&
|
|
1034
|
+
/* @__PURE__ */ s("span", { className: fe.className, style: fe.style, children: B }),
|
|
1035
|
+
_ === "right" && /* @__PURE__ */ L(Ne, { children: [
|
|
1036
|
+
y && le(),
|
|
1037
|
+
!y && d && q()
|
|
1038
1038
|
] })
|
|
1039
1039
|
]
|
|
1040
1040
|
}
|
|
@@ -1086,23 +1086,23 @@ const ko = ["root", "content", "icon", "loading"], Re = {
|
|
|
1086
1086
|
iconSize: 20,
|
|
1087
1087
|
className: "text-[25px] px-[45px] py-[18px] gap-3"
|
|
1088
1088
|
}
|
|
1089
|
-
},
|
|
1089
|
+
}, it = {
|
|
1090
1090
|
default: "bg-[var(--primary)] text-[var(--primary-foreground)] border-[var(--border)] hover:shadow-[0_0_0.4em_0_var(--button-shadow-default)]",
|
|
1091
1091
|
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
1092
|
danger: "bg-[var(--destructive)] text-[var(--destructive-foreground)] border-transparent hover:shadow-[0_0_0.4em_0_var(--destructive)]",
|
|
1093
1093
|
success: "bg-[var(--success)] text-[var(--success-foreground)] border-transparent hover:shadow-[0_0_0.4em_0_var(--success)]"
|
|
1094
|
-
}, Po = "bg-[var(--transparent)]",
|
|
1094
|
+
}, Po = "bg-[var(--transparent)]", Oo = {
|
|
1095
1095
|
default: "text-[var(--button-outline-foreground)] border-[var(--border)]",
|
|
1096
1096
|
transparent: "text-[var(--button-outline-foreground)] border-[var(--button-transparent-border)]",
|
|
1097
1097
|
danger: "text-[var(--destructive)] border-[var(--destructive)]",
|
|
1098
1098
|
success: "text-[var(--success)] border-[var(--success)]"
|
|
1099
|
-
},
|
|
1099
|
+
}, _o = "shadow-[var(--button-enu-shadow)] hover:shadow-[var(--button-enu-hover-shadow)] active:translate-y-px active:shadow-[var(--button-enu-active-shadow)]", Ao = {
|
|
1100
1100
|
default: "bg-[var(--button-enu-bg)] text-[var(--button-enu-fg)] border-transparent",
|
|
1101
1101
|
transparent: "bg-[var(--transparent)] text-[var(--button-enu-fg)] border-[var(--button-transparent-border)]",
|
|
1102
1102
|
danger: "bg-[var(--destructive)] text-[var(--destructive-foreground)] border-transparent",
|
|
1103
1103
|
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",
|
|
1105
|
-
function
|
|
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", dt = (e, o, r) => Object.prototype.hasOwnProperty.call(r, e) ? e : o;
|
|
1105
|
+
function ie(e) {
|
|
1106
1106
|
const {
|
|
1107
1107
|
type: o = "default",
|
|
1108
1108
|
size: r = "medium",
|
|
@@ -1116,58 +1116,58 @@ function ce(e) {
|
|
|
1116
1116
|
outline: h = !1,
|
|
1117
1117
|
enu: d = !1,
|
|
1118
1118
|
icon: p = null,
|
|
1119
|
-
iconPosition:
|
|
1120
|
-
loading:
|
|
1121
|
-
i18nKey:
|
|
1119
|
+
iconPosition: f = null,
|
|
1120
|
+
loading: w = !1,
|
|
1121
|
+
i18nKey: P = null,
|
|
1122
1122
|
localeText: O = {},
|
|
1123
|
-
"aria-label":
|
|
1124
|
-
...
|
|
1125
|
-
} = e, { t:
|
|
1126
|
-
default:
|
|
1127
|
-
loading:
|
|
1128
|
-
iconAlt:
|
|
1123
|
+
"aria-label": D,
|
|
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),
|
|
1129
1129
|
...O
|
|
1130
|
-
},
|
|
1131
|
-
let
|
|
1132
|
-
h && (
|
|
1133
|
-
|
|
1130
|
+
}, k = (P && typeof T[P] == "string" ? T[P] : null) || (P ? v(`button.${P}`, T.default) : T.default), U = m ? T.loading : k, j = i ?? U, B = D || (i == null ? String(j || T.default) : void 0);
|
|
1131
|
+
let M = it[C];
|
|
1132
|
+
h && (M = E(
|
|
1133
|
+
M,
|
|
1134
1134
|
Po,
|
|
1135
|
-
|
|
1136
|
-
)), d && (
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
Ao[
|
|
1135
|
+
Oo[C]
|
|
1136
|
+
)), d && (M = E(
|
|
1137
|
+
M,
|
|
1138
|
+
_o,
|
|
1139
|
+
Ao[C]
|
|
1140
1140
|
));
|
|
1141
|
-
const
|
|
1141
|
+
const F = b({
|
|
1142
1142
|
// 顺序固定为:baseTw -> className -> sx.tw,sx 能稳定覆盖普通 Tailwind。
|
|
1143
1143
|
baseClassName: E(
|
|
1144
1144
|
Lo,
|
|
1145
1145
|
Ve[x].className,
|
|
1146
|
-
|
|
1147
|
-
|
|
1146
|
+
M,
|
|
1147
|
+
z && Mo,
|
|
1148
1148
|
m && "cursor-wait"
|
|
1149
1149
|
),
|
|
1150
1150
|
className: l,
|
|
1151
1151
|
style: c,
|
|
1152
|
-
sxSlot:
|
|
1153
|
-
}),
|
|
1152
|
+
sxSlot: _.root
|
|
1153
|
+
}), H = b({
|
|
1154
1154
|
baseClassName: "inline-flex items-center",
|
|
1155
|
-
sxSlot:
|
|
1155
|
+
sxSlot: _.content
|
|
1156
1156
|
}), K = b({
|
|
1157
1157
|
baseClassName: "inline-flex items-center justify-center shrink-0 transition-all duration-300",
|
|
1158
1158
|
baseStyle: {
|
|
1159
1159
|
width: `${A}px`,
|
|
1160
1160
|
height: `${A}px`
|
|
1161
1161
|
},
|
|
1162
|
-
sxSlot:
|
|
1163
|
-
}),
|
|
1162
|
+
sxSlot: _.icon
|
|
1163
|
+
}), G = b({
|
|
1164
1164
|
baseClassName: "inline-flex items-center justify-center shrink-0 animate-spin",
|
|
1165
1165
|
baseStyle: {
|
|
1166
1166
|
width: `${A}px`,
|
|
1167
1167
|
height: `${A}px`,
|
|
1168
1168
|
color: y === "light" ? "var(--button-loading-light)" : "var(--button-loading-dark)"
|
|
1169
1169
|
},
|
|
1170
|
-
sxSlot:
|
|
1170
|
+
sxSlot: _.loading
|
|
1171
1171
|
}), R = () => p ? typeof p == "string" ? /* @__PURE__ */ s(
|
|
1172
1172
|
"img",
|
|
1173
1173
|
{
|
|
@@ -1177,7 +1177,7 @@ function ce(e) {
|
|
|
1177
1177
|
style: K.style,
|
|
1178
1178
|
"aria-hidden": "true"
|
|
1179
1179
|
}
|
|
1180
|
-
) :
|
|
1180
|
+
) : te.isValidElement(p) ? te.cloneElement(p, {
|
|
1181
1181
|
className: E(K.className, p.props.className),
|
|
1182
1182
|
style: {
|
|
1183
1183
|
...K.style,
|
|
@@ -1191,13 +1191,13 @@ function ce(e) {
|
|
|
1191
1191
|
style: K.style,
|
|
1192
1192
|
"aria-hidden": "true"
|
|
1193
1193
|
}
|
|
1194
|
-
) : /* @__PURE__ */ s("span", { className: K.className, style: K.style, "aria-hidden": "true", children: p }) : null,
|
|
1194
|
+
) : /* @__PURE__ */ s("span", { className: K.className, style: K.style, "aria-hidden": "true", children: p }) : null, Q = () => /* @__PURE__ */ s(
|
|
1195
1195
|
"svg",
|
|
1196
1196
|
{
|
|
1197
1197
|
viewBox: "0 0 1024 1024",
|
|
1198
1198
|
role: "presentation",
|
|
1199
|
-
className:
|
|
1200
|
-
style:
|
|
1199
|
+
className: G.className,
|
|
1200
|
+
style: G.style,
|
|
1201
1201
|
"aria-hidden": "true",
|
|
1202
1202
|
children: /* @__PURE__ */ s(
|
|
1203
1203
|
"path",
|
|
@@ -1208,33 +1208,33 @@ function ce(e) {
|
|
|
1208
1208
|
)
|
|
1209
1209
|
}
|
|
1210
1210
|
);
|
|
1211
|
-
return /* @__PURE__ */
|
|
1211
|
+
return /* @__PURE__ */ L(
|
|
1212
1212
|
"button",
|
|
1213
1213
|
{
|
|
1214
|
-
className:
|
|
1215
|
-
style:
|
|
1214
|
+
className: F.className,
|
|
1215
|
+
style: F.style,
|
|
1216
1216
|
onClick: a,
|
|
1217
|
-
disabled:
|
|
1218
|
-
"aria-label":
|
|
1219
|
-
"data-variant":
|
|
1217
|
+
disabled: z,
|
|
1218
|
+
"aria-label": B,
|
|
1219
|
+
"data-variant": C,
|
|
1220
1220
|
"data-size": x,
|
|
1221
1221
|
"data-icon-position": $ || void 0,
|
|
1222
|
-
...
|
|
1222
|
+
...S,
|
|
1223
1223
|
children: [
|
|
1224
|
-
$ === "left" && /* @__PURE__ */
|
|
1225
|
-
m &&
|
|
1224
|
+
$ === "left" && /* @__PURE__ */ L(Ne, { children: [
|
|
1225
|
+
m && Q(),
|
|
1226
1226
|
!m && p && R()
|
|
1227
1227
|
] }),
|
|
1228
|
-
/* @__PURE__ */ s("span", { className:
|
|
1229
|
-
$ === "right" && /* @__PURE__ */
|
|
1230
|
-
m &&
|
|
1228
|
+
/* @__PURE__ */ s("span", { className: H.className, style: H.style, children: j }),
|
|
1229
|
+
$ === "right" && /* @__PURE__ */ L(Ne, { children: [
|
|
1230
|
+
m && Q(),
|
|
1231
1231
|
!m && p && R()
|
|
1232
1232
|
] })
|
|
1233
1233
|
]
|
|
1234
1234
|
}
|
|
1235
1235
|
);
|
|
1236
1236
|
}
|
|
1237
|
-
|
|
1237
|
+
ie.propTypes = {
|
|
1238
1238
|
type: t.oneOf(["default", "transparent", "danger", "success"]),
|
|
1239
1239
|
size: t.oneOf(["small", "medium", "large", "huge"]),
|
|
1240
1240
|
sx: t.oneOfType([t.object, t.string]),
|
|
@@ -1259,7 +1259,7 @@ ce.propTypes = {
|
|
|
1259
1259
|
i18nKey: t.string,
|
|
1260
1260
|
localeText: t.object
|
|
1261
1261
|
};
|
|
1262
|
-
|
|
1262
|
+
ie.MaterialButton = Ze;
|
|
1263
1263
|
const $o = ["root", "input", "label"], Bo = {
|
|
1264
1264
|
small: "small",
|
|
1265
1265
|
medium: "medium",
|
|
@@ -1286,43 +1286,43 @@ function Ge(e) {
|
|
|
1286
1286
|
label: h,
|
|
1287
1287
|
localeText: d,
|
|
1288
1288
|
type: p = "text",
|
|
1289
|
-
...
|
|
1290
|
-
} = e, { t:
|
|
1291
|
-
tw: E(
|
|
1292
|
-
css: { ...
|
|
1293
|
-
}, $ = E("relative inline-flex",
|
|
1289
|
+
...f
|
|
1290
|
+
} = e, { t: w } = de(), P = Fo(o, "medium", Bo), O = a !== void 0, [D, S] = Z(i ?? ""), [v, x] = Z(!1), C = O ? a : D, m = v || String(C).length > 0, y = h ?? (d == null ? void 0 : d.label) ?? w("materialInput.label", jo.label), z = W(r, $o), A = {
|
|
1291
|
+
tw: E(z.root.tw, z.input.tw),
|
|
1292
|
+
css: { ...z.root.css, ...z.input.css }
|
|
1293
|
+
}, $ = E("relative inline-flex", z.root.tw), _ = Io[P], T = E(
|
|
1294
1294
|
"w-[300px] bg-transparent text-[var(--foreground)] outline-none transition-all duration-200 ease-in-out",
|
|
1295
1295
|
"border-b border-b-[var(--border)]",
|
|
1296
1296
|
"hover:border-b-[var(--input-accent)]",
|
|
1297
1297
|
"focus:border-b-[var(--input-accent)]",
|
|
1298
1298
|
u && "text-[var(--muted-foreground)] border-b-[var(--muted)] cursor-not-allowed hover:border-b-[var(--muted)]",
|
|
1299
|
-
|
|
1300
|
-
|
|
1299
|
+
_.wrapper,
|
|
1300
|
+
_.pt
|
|
1301
1301
|
), N = b({
|
|
1302
1302
|
baseClassName: T,
|
|
1303
1303
|
className: c,
|
|
1304
1304
|
style: n,
|
|
1305
1305
|
sxSlot: A
|
|
1306
|
-
}),
|
|
1306
|
+
}), k = E(
|
|
1307
1307
|
"absolute left-0 transition-all duration-200 ease-in-out pointer-events-none",
|
|
1308
|
-
m ? `top-1 ${
|
|
1309
|
-
|
|
1308
|
+
m ? `top-1 ${_.labelFloat} text-[var(--input-accent)]` : `top-1/2 -translate-y-1/2 ${_.label} text-[var(--muted-foreground)]`,
|
|
1309
|
+
v && m && "text-[var(--input-accent)]",
|
|
1310
1310
|
u && "text-[var(--muted-foreground)]",
|
|
1311
|
-
|
|
1311
|
+
z.label.tw
|
|
1312
1312
|
), U = b({
|
|
1313
|
-
baseClassName:
|
|
1314
|
-
sxSlot: { tw: "", css:
|
|
1315
|
-
}),
|
|
1316
|
-
const R =
|
|
1317
|
-
O ||
|
|
1318
|
-
}, [O, l]),
|
|
1313
|
+
baseClassName: k,
|
|
1314
|
+
sxSlot: { tw: "", css: z.label.css }
|
|
1315
|
+
}), j = oe((G) => {
|
|
1316
|
+
const R = G.target.value;
|
|
1317
|
+
O || S(R), l == null || l(R);
|
|
1318
|
+
}, [O, l]), B = oe((G) => {
|
|
1319
1319
|
var R;
|
|
1320
|
-
x(!0), (R =
|
|
1321
|
-
}, [
|
|
1320
|
+
x(!0), (R = f.onFocus) == null || R.call(f, G);
|
|
1321
|
+
}, [f.onFocus]), M = oe((G) => {
|
|
1322
1322
|
var R;
|
|
1323
|
-
x(!1), (R =
|
|
1324
|
-
}, [
|
|
1325
|
-
return /* @__PURE__ */
|
|
1323
|
+
x(!1), (R = f.onBlur) == null || R.call(f, G);
|
|
1324
|
+
}, [f.onBlur]), { onFocus: F, onBlur: H, ...K } = f;
|
|
1325
|
+
return /* @__PURE__ */ L("div", { className: $, children: [
|
|
1326
1326
|
/* @__PURE__ */ s(
|
|
1327
1327
|
"input",
|
|
1328
1328
|
{
|
|
@@ -1330,11 +1330,11 @@ function Ge(e) {
|
|
|
1330
1330
|
type: p,
|
|
1331
1331
|
className: N.className,
|
|
1332
1332
|
style: N.style,
|
|
1333
|
-
value:
|
|
1333
|
+
value: C,
|
|
1334
1334
|
disabled: u || void 0,
|
|
1335
|
-
onChange:
|
|
1336
|
-
onFocus:
|
|
1337
|
-
onBlur:
|
|
1335
|
+
onChange: j,
|
|
1336
|
+
onFocus: B,
|
|
1337
|
+
onBlur: M,
|
|
1338
1338
|
"aria-label": y || void 0
|
|
1339
1339
|
}
|
|
1340
1340
|
),
|
|
@@ -1380,10 +1380,10 @@ function Xe(e) {
|
|
|
1380
1380
|
defaultValue: h,
|
|
1381
1381
|
disabled: d = !1,
|
|
1382
1382
|
placeholder: p = "",
|
|
1383
|
-
maxlength:
|
|
1384
|
-
status:
|
|
1385
|
-
...
|
|
1386
|
-
} = e, O = Yo(r, "medium", Ro),
|
|
1383
|
+
maxlength: f = 524288,
|
|
1384
|
+
status: w,
|
|
1385
|
+
...P
|
|
1386
|
+
} = e, O = Yo(r, "medium", Ro), D = o === "textarea", S = o === "password", v = w === "error", x = W(n, Do), C = {
|
|
1387
1387
|
tw: E(x.root.tw, x.input.tw),
|
|
1388
1388
|
css: { ...x.root.css, ...x.input.css }
|
|
1389
1389
|
}, m = E("inline-flex", x.root.tw), y = E(
|
|
@@ -1391,28 +1391,33 @@ function Xe(e) {
|
|
|
1391
1391
|
"border-[var(--border)] shadow-[var(--input-shadow)]",
|
|
1392
1392
|
"hover:border-[var(--input-accent)]",
|
|
1393
1393
|
"focus:border-[var(--input-accent)] focus:shadow-[var(--input-focus-shadow)]",
|
|
1394
|
-
|
|
1394
|
+
v && "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)]",
|
|
1395
1395
|
d && "bg-[var(--muted)] text-[var(--muted-foreground)] border-[var(--muted)] cursor-not-allowed shadow-none hover:border-[var(--muted)] focus:shadow-none",
|
|
1396
1396
|
Vo[O]
|
|
1397
|
-
),
|
|
1397
|
+
), z = b({
|
|
1398
1398
|
baseClassName: y,
|
|
1399
1399
|
className: l,
|
|
1400
1400
|
style: c,
|
|
1401
|
-
sxSlot:
|
|
1401
|
+
sxSlot: C
|
|
1402
1402
|
}), A = u !== void 0, $ = {
|
|
1403
|
-
className:
|
|
1404
|
-
style:
|
|
1403
|
+
className: z.className,
|
|
1404
|
+
style: z.style,
|
|
1405
1405
|
onClick: a,
|
|
1406
|
-
onChange: i ? (
|
|
1406
|
+
onChange: i ? (_) => i(_.target.value) : void 0,
|
|
1407
1407
|
value: A ? u : void 0,
|
|
1408
1408
|
defaultValue: A ? void 0 : h ?? "",
|
|
1409
1409
|
disabled: d || void 0,
|
|
1410
1410
|
placeholder: p,
|
|
1411
|
-
maxLength:
|
|
1412
|
-
"aria-invalid":
|
|
1413
|
-
|
|
1411
|
+
maxLength: f,
|
|
1412
|
+
"aria-invalid": v || void 0,
|
|
1413
|
+
// 原因:password input 不在 form 内,浏览器会发出 [DOM] Password field is not contained in a form 警告
|
|
1414
|
+
// 导致的问题:控制台持续出现 DOM 警告
|
|
1415
|
+
// 解决办法:为 password 类型添加 autoComplete 属性抑制浏览器警告
|
|
1416
|
+
// fixed by clayw on 20260523 night
|
|
1417
|
+
...S ? { autoComplete: "current-password" } : {},
|
|
1418
|
+
...P
|
|
1414
1419
|
};
|
|
1415
|
-
return /* @__PURE__ */ s("div", { className: m, children:
|
|
1420
|
+
return /* @__PURE__ */ s("div", { className: m, children: D ? /* @__PURE__ */ s(
|
|
1416
1421
|
"textarea",
|
|
1417
1422
|
{
|
|
1418
1423
|
...$,
|
|
@@ -1422,7 +1427,7 @@ function Xe(e) {
|
|
|
1422
1427
|
"input",
|
|
1423
1428
|
{
|
|
1424
1429
|
...$,
|
|
1425
|
-
type:
|
|
1430
|
+
type: S ? "password" : "text"
|
|
1426
1431
|
}
|
|
1427
1432
|
) });
|
|
1428
1433
|
}
|
|
@@ -1450,8 +1455,8 @@ function Ko(e, o) {
|
|
|
1450
1455
|
className: c = "",
|
|
1451
1456
|
children: l,
|
|
1452
1457
|
...a
|
|
1453
|
-
} = e, i =
|
|
1454
|
-
baseClassName: "flex items-center
|
|
1458
|
+
} = e, i = W(r, we), u = b({
|
|
1459
|
+
baseClassName: "flex items-center px-4 bg-[var(--layout-header-bg)] text-[var(--layout-header-color)]",
|
|
1455
1460
|
className: c,
|
|
1456
1461
|
sxSlot: i.root,
|
|
1457
1462
|
baseStyle: {
|
|
@@ -1471,7 +1476,7 @@ function Ko(e, o) {
|
|
|
1471
1476
|
}
|
|
1472
1477
|
);
|
|
1473
1478
|
}
|
|
1474
|
-
const Be =
|
|
1479
|
+
const Be = te.forwardRef(Ko);
|
|
1475
1480
|
Be.displayName = "LayoutHeader";
|
|
1476
1481
|
Be.propTypes = {
|
|
1477
1482
|
sx: t.oneOfType([t.string, t.object]),
|
|
@@ -1486,8 +1491,8 @@ function Uo(e, o) {
|
|
|
1486
1491
|
className: c = "",
|
|
1487
1492
|
children: l,
|
|
1488
1493
|
...a
|
|
1489
|
-
} = e, i =
|
|
1490
|
-
baseClassName: "flex items-center
|
|
1494
|
+
} = e, i = W(r, we), u = b({
|
|
1495
|
+
baseClassName: "flex items-center px-4 bg-[var(--layout-footer-bg)] text-[var(--layout-footer-color)]",
|
|
1491
1496
|
className: c,
|
|
1492
1497
|
sxSlot: i.root,
|
|
1493
1498
|
baseStyle: {
|
|
@@ -1507,7 +1512,7 @@ function Uo(e, o) {
|
|
|
1507
1512
|
}
|
|
1508
1513
|
);
|
|
1509
1514
|
}
|
|
1510
|
-
const Ie =
|
|
1515
|
+
const Ie = te.forwardRef(Uo);
|
|
1511
1516
|
Ie.displayName = "LayoutFooter";
|
|
1512
1517
|
Ie.propTypes = {
|
|
1513
1518
|
sx: t.oneOfType([t.string, t.object]),
|
|
@@ -1523,8 +1528,8 @@ function Ho(e, o) {
|
|
|
1523
1528
|
width: l,
|
|
1524
1529
|
children: a,
|
|
1525
1530
|
...i
|
|
1526
|
-
} = e, u =
|
|
1527
|
-
baseClassName: "overflow-auto flex
|
|
1531
|
+
} = e, u = W(r, we), h = l ?? "var(--layout-sider-width)", d = b({
|
|
1532
|
+
baseClassName: "overflow-auto flex flex-col bg-[var(--layout-sider-bg)] text-[var(--layout-sider-color)]",
|
|
1528
1533
|
className: c,
|
|
1529
1534
|
sxSlot: u.root,
|
|
1530
1535
|
baseStyle: {
|
|
@@ -1546,7 +1551,7 @@ function Ho(e, o) {
|
|
|
1546
1551
|
}
|
|
1547
1552
|
);
|
|
1548
1553
|
}
|
|
1549
|
-
const ke =
|
|
1554
|
+
const ke = te.forwardRef(Ho);
|
|
1550
1555
|
ke.displayName = "LayoutSider";
|
|
1551
1556
|
ke.propTypes = {
|
|
1552
1557
|
width: t.oneOfType([t.string, t.number]),
|
|
@@ -1563,8 +1568,8 @@ function Wo(e, o) {
|
|
|
1563
1568
|
width: l,
|
|
1564
1569
|
children: a,
|
|
1565
1570
|
...i
|
|
1566
|
-
} = e, u =
|
|
1567
|
-
baseClassName: "overflow-auto flex
|
|
1571
|
+
} = e, u = W(r, we), h = l ?? "var(--layout-toc-width)", d = b({
|
|
1572
|
+
baseClassName: "overflow-auto flex flex-col bg-[var(--layout-toc-bg)] text-[var(--layout-toc-color)]",
|
|
1568
1573
|
className: c,
|
|
1569
1574
|
sxSlot: u.root,
|
|
1570
1575
|
baseStyle: {
|
|
@@ -1586,7 +1591,7 @@ function Wo(e, o) {
|
|
|
1586
1591
|
}
|
|
1587
1592
|
);
|
|
1588
1593
|
}
|
|
1589
|
-
const Le =
|
|
1594
|
+
const Le = te.forwardRef(Wo);
|
|
1590
1595
|
Le.displayName = "LayoutToc";
|
|
1591
1596
|
Le.propTypes = {
|
|
1592
1597
|
width: t.oneOfType([t.string, t.number]),
|
|
@@ -1602,7 +1607,7 @@ function Zo(e, o) {
|
|
|
1602
1607
|
className: c = "",
|
|
1603
1608
|
children: l,
|
|
1604
1609
|
...a
|
|
1605
|
-
} = e, i =
|
|
1610
|
+
} = e, i = W(r, we), u = b({
|
|
1606
1611
|
/**
|
|
1607
1612
|
*
|
|
1608
1613
|
* 这里记录了一次问题:backgroundColor、color 等写在 baseStyle(inline style)里,
|
|
@@ -1616,7 +1621,13 @@ function Zo(e, o) {
|
|
|
1616
1621
|
* noted by clayw on 20260523 night
|
|
1617
1622
|
*
|
|
1618
1623
|
*/
|
|
1619
|
-
baseClassName:
|
|
1624
|
+
baseClassName: (
|
|
1625
|
+
// 原因:Content 默认 items-center justify-center 会导致内容垂直+水平居中,长页面内容显示异常
|
|
1626
|
+
// 导致的问题:Content 区域内容始终居中,而非自然流动布局;窄屏时表格文字出现竖排
|
|
1627
|
+
// 解决办法:移除 items-center justify-center,改为 flex-col 让内容自然从上往下流动
|
|
1628
|
+
// fixed by clayw on 20260523 night
|
|
1629
|
+
"flex-1 flex flex-col bg-[var(--layout-content-bg)] text-[var(--layout-content-color)]"
|
|
1630
|
+
),
|
|
1620
1631
|
className: c,
|
|
1621
1632
|
sxSlot: i.root,
|
|
1622
1633
|
baseStyle: {},
|
|
@@ -1633,7 +1644,7 @@ function Zo(e, o) {
|
|
|
1633
1644
|
}
|
|
1634
1645
|
);
|
|
1635
1646
|
}
|
|
1636
|
-
const je =
|
|
1647
|
+
const je = te.forwardRef(Zo);
|
|
1637
1648
|
je.displayName = "LayoutContent";
|
|
1638
1649
|
je.propTypes = {
|
|
1639
1650
|
sx: t.oneOfType([t.string, t.object]),
|
|
@@ -1649,10 +1660,10 @@ function Go(e, o) {
|
|
|
1649
1660
|
hasSider: l,
|
|
1650
1661
|
children: a,
|
|
1651
1662
|
...i
|
|
1652
|
-
} = e, u =
|
|
1663
|
+
} = e, u = W(r, we), h = l ?? te.Children.toArray(a).some(
|
|
1653
1664
|
(p) => {
|
|
1654
|
-
var
|
|
1655
|
-
return
|
|
1665
|
+
var f, w;
|
|
1666
|
+
return te.isValidElement(p) && (p.type === ke || p.type === Le || ((f = p.type) == null ? void 0 : f.displayName) === "LayoutSider" || ((w = p.type) == null ? void 0 : w.displayName) === "LayoutToc");
|
|
1656
1667
|
}
|
|
1657
1668
|
), d = b({
|
|
1658
1669
|
baseClassName: E(
|
|
@@ -1674,7 +1685,7 @@ function Go(e, o) {
|
|
|
1674
1685
|
}
|
|
1675
1686
|
);
|
|
1676
1687
|
}
|
|
1677
|
-
const ne =
|
|
1688
|
+
const ne = te.forwardRef(Go);
|
|
1678
1689
|
ne.displayName = "Layout";
|
|
1679
1690
|
ne.Header = Be;
|
|
1680
1691
|
ne.Footer = Ie;
|
|
@@ -1688,10 +1699,10 @@ ne.propTypes = {
|
|
|
1688
1699
|
className: t.string,
|
|
1689
1700
|
children: t.node
|
|
1690
1701
|
};
|
|
1691
|
-
const Xo = Be, qo = Ie, Jo = ke, Qo = je, er = Le, tr = ["root", "button", "list", "item"],
|
|
1702
|
+
const Xo = Be, qo = Ie, Jo = ke, Qo = je, er = Le, tr = ["root", "button", "list", "item"], Et = Symbol("LIST_IGNORE"), ut = /* @__PURE__ */ L("svg", { viewBox: "0 0 24 24", width: "1em", height: "1em", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: [
|
|
1692
1703
|
/* @__PURE__ */ s("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z" }),
|
|
1693
1704
|
/* @__PURE__ */ s("path", { d: "M14 2v6h6" })
|
|
1694
|
-
] }),
|
|
1705
|
+
] }), pt = /* @__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" }) });
|
|
1695
1706
|
function or(e, o) {
|
|
1696
1707
|
const {
|
|
1697
1708
|
sx: r = {},
|
|
@@ -1706,46 +1717,46 @@ function or(e, o) {
|
|
|
1706
1717
|
files: h = [],
|
|
1707
1718
|
showUploadList: d = !0,
|
|
1708
1719
|
maxCount: p = 20,
|
|
1709
|
-
maxSize:
|
|
1710
|
-
btnText:
|
|
1711
|
-
btnStyle:
|
|
1720
|
+
maxSize: f = 100,
|
|
1721
|
+
btnText: w = "选择文件",
|
|
1722
|
+
btnStyle: P,
|
|
1712
1723
|
showSize: O = !0,
|
|
1713
|
-
disabled:
|
|
1714
|
-
...
|
|
1715
|
-
} = e,
|
|
1724
|
+
disabled: D = !1,
|
|
1725
|
+
...S
|
|
1726
|
+
} = e, v = Kt(), x = h || [], C = W(r, tr), m = oe(async (T, N) => {
|
|
1716
1727
|
if (!u) return !0;
|
|
1717
1728
|
try {
|
|
1718
|
-
const
|
|
1719
|
-
return
|
|
1729
|
+
const k = await u(T, N);
|
|
1730
|
+
return k === void 0 ? !0 : k;
|
|
1720
1731
|
} catch {
|
|
1721
1732
|
return !1;
|
|
1722
1733
|
}
|
|
1723
1734
|
}, [u]), y = oe(async (T) => {
|
|
1724
|
-
const
|
|
1725
|
-
for (const
|
|
1726
|
-
const
|
|
1727
|
-
if (
|
|
1728
|
-
console.warn(`[Tango Upload] ${
|
|
1735
|
+
const k = Array.from(T.target.files || []).filter((B) => B.size / 1024 / 1024 > f ? (console.warn(`[Tango Upload] ${B.name} 超过 ${f}MB,已被过滤`), !1) : !0), U = a ? k.slice(0, p) : k.slice(0, 1), j = [];
|
|
1736
|
+
for (const B of U) {
|
|
1737
|
+
const M = await m(B, U);
|
|
1738
|
+
if (M === !1) {
|
|
1739
|
+
console.warn(`[Tango Upload] ${B.name} 被 beforeUpload 拦截`);
|
|
1729
1740
|
continue;
|
|
1730
1741
|
}
|
|
1731
|
-
if (
|
|
1732
|
-
console.warn(`[Tango Upload] ${
|
|
1742
|
+
if (M === Et) {
|
|
1743
|
+
console.warn(`[Tango Upload] ${B.name} 被 LIST_IGNORE 忽略`);
|
|
1733
1744
|
continue;
|
|
1734
1745
|
}
|
|
1735
|
-
if (
|
|
1736
|
-
const
|
|
1737
|
-
|
|
1746
|
+
if (M instanceof Blob) {
|
|
1747
|
+
const F = M instanceof File ? M : new File([M], B.name, { type: B.type });
|
|
1748
|
+
j.push(F);
|
|
1738
1749
|
} else
|
|
1739
|
-
|
|
1750
|
+
j.push(B);
|
|
1740
1751
|
}
|
|
1741
|
-
T.target.value = "", i(
|
|
1742
|
-
}, [a, p,
|
|
1743
|
-
const
|
|
1744
|
-
i(
|
|
1752
|
+
T.target.value = "", i(j);
|
|
1753
|
+
}, [a, p, f, m, i]), z = oe((T, N) => {
|
|
1754
|
+
const k = x.filter((U, j) => j !== N);
|
|
1755
|
+
i(k);
|
|
1745
1756
|
}, [x, i]), A = b({
|
|
1746
1757
|
baseClassName: "inline-flex flex-col gap-3",
|
|
1747
1758
|
className: c,
|
|
1748
|
-
sxSlot:
|
|
1759
|
+
sxSlot: C.root,
|
|
1749
1760
|
style: n
|
|
1750
1761
|
}), $ = b({
|
|
1751
1762
|
baseClassName: E(
|
|
@@ -1755,48 +1766,48 @@ function or(e, o) {
|
|
|
1755
1766
|
x.length === 0 && "border-transparent"
|
|
1756
1767
|
),
|
|
1757
1768
|
baseStyle: { borderRadius: "var(--upload-radius)" },
|
|
1758
|
-
sxSlot:
|
|
1759
|
-
}),
|
|
1769
|
+
sxSlot: C.list
|
|
1770
|
+
}), _ = b({
|
|
1760
1771
|
baseClassName: E(
|
|
1761
1772
|
"flex items-center gap-2 px-3 py-1.5 text-sm",
|
|
1762
1773
|
"text-[var(--upload-item-text)] hover:bg-[var(--upload-item-hover-bg)]",
|
|
1763
1774
|
"transition-colors"
|
|
1764
1775
|
),
|
|
1765
|
-
sxSlot:
|
|
1776
|
+
sxSlot: C.item
|
|
1766
1777
|
});
|
|
1767
|
-
return /* @__PURE__ */
|
|
1778
|
+
return /* @__PURE__ */ L("div", { ref: o, className: A.className, style: A.style, ...S, children: [
|
|
1768
1779
|
/* @__PURE__ */ s(
|
|
1769
1780
|
"input",
|
|
1770
1781
|
{
|
|
1771
|
-
id:
|
|
1782
|
+
id: v,
|
|
1772
1783
|
type: "file",
|
|
1773
1784
|
accept: l,
|
|
1774
1785
|
multiple: a,
|
|
1775
1786
|
className: "hidden",
|
|
1776
1787
|
onChange: y,
|
|
1777
|
-
disabled:
|
|
1788
|
+
disabled: D,
|
|
1778
1789
|
"aria-hidden": "true",
|
|
1779
1790
|
tabIndex: -1
|
|
1780
1791
|
}
|
|
1781
1792
|
),
|
|
1782
1793
|
/* @__PURE__ */ s(
|
|
1783
|
-
|
|
1794
|
+
ie,
|
|
1784
1795
|
{
|
|
1785
|
-
disabled:
|
|
1786
|
-
style:
|
|
1787
|
-
sx:
|
|
1796
|
+
disabled: D,
|
|
1797
|
+
style: P,
|
|
1798
|
+
sx: C.button,
|
|
1788
1799
|
onClick: () => {
|
|
1789
1800
|
var T;
|
|
1790
|
-
return (T = document.getElementById(
|
|
1801
|
+
return (T = document.getElementById(v)) == null ? void 0 : T.click();
|
|
1791
1802
|
},
|
|
1792
|
-
children:
|
|
1803
|
+
children: w
|
|
1793
1804
|
}
|
|
1794
1805
|
),
|
|
1795
|
-
d && x.length > 0 && /* @__PURE__ */ s("ul", { className: $.className, style: $.style, children: a ? x.map((T, N) => /* @__PURE__ */
|
|
1796
|
-
/* @__PURE__ */ s("span", { className: "flex-shrink-0 text-[var(--upload-icon-color)]", children:
|
|
1797
|
-
/* @__PURE__ */
|
|
1806
|
+
d && x.length > 0 && /* @__PURE__ */ s("ul", { className: $.className, style: $.style, children: a ? x.map((T, N) => /* @__PURE__ */ L("li", { className: _.className, style: _.style, children: [
|
|
1807
|
+
/* @__PURE__ */ s("span", { className: "flex-shrink-0 text-[var(--upload-icon-color)]", children: ut }),
|
|
1808
|
+
/* @__PURE__ */ L("span", { className: "flex-1 truncate", children: [
|
|
1798
1809
|
T.name,
|
|
1799
|
-
O && /* @__PURE__ */
|
|
1810
|
+
O && /* @__PURE__ */ L("span", { className: "ml-1 text-xs text-[var(--muted-foreground)]", children: [
|
|
1800
1811
|
"(",
|
|
1801
1812
|
(T.size / 1024).toFixed(2),
|
|
1802
1813
|
" KB)"
|
|
@@ -1807,16 +1818,16 @@ function or(e, o) {
|
|
|
1807
1818
|
{
|
|
1808
1819
|
type: "button",
|
|
1809
1820
|
className: "flex-shrink-0 p-0.5 rounded hover:bg-[var(--upload-del-hover-bg)] text-[var(--upload-del-color)] transition-colors",
|
|
1810
|
-
onClick: () =>
|
|
1821
|
+
onClick: () => z(T, N),
|
|
1811
1822
|
"aria-label": `删除 ${T.name}`,
|
|
1812
|
-
children:
|
|
1823
|
+
children: pt
|
|
1813
1824
|
}
|
|
1814
1825
|
)
|
|
1815
|
-
] }, N)) : /* @__PURE__ */
|
|
1816
|
-
/* @__PURE__ */ s("span", { className: "flex-shrink-0 text-[var(--upload-icon-color)]", children:
|
|
1817
|
-
/* @__PURE__ */
|
|
1826
|
+
] }, N)) : /* @__PURE__ */ L("li", { className: _.className, style: _.style, children: [
|
|
1827
|
+
/* @__PURE__ */ s("span", { className: "flex-shrink-0 text-[var(--upload-icon-color)]", children: ut }),
|
|
1828
|
+
/* @__PURE__ */ L("span", { className: "flex-1 truncate", children: [
|
|
1818
1829
|
x[0].name,
|
|
1819
|
-
O && /* @__PURE__ */
|
|
1830
|
+
O && /* @__PURE__ */ L("span", { className: "ml-1 text-xs text-[var(--muted-foreground)]", children: [
|
|
1820
1831
|
"(",
|
|
1821
1832
|
(x[0].size / 1024).toFixed(2),
|
|
1822
1833
|
" KB)"
|
|
@@ -1827,17 +1838,17 @@ function or(e, o) {
|
|
|
1827
1838
|
{
|
|
1828
1839
|
type: "button",
|
|
1829
1840
|
className: "flex-shrink-0 p-0.5 rounded hover:bg-[var(--upload-del-hover-bg)] text-[var(--upload-del-color)] transition-colors",
|
|
1830
|
-
onClick: () =>
|
|
1841
|
+
onClick: () => z(x[0], 0),
|
|
1831
1842
|
"aria-label": `删除 ${x[0].name}`,
|
|
1832
|
-
children:
|
|
1843
|
+
children: pt
|
|
1833
1844
|
}
|
|
1834
1845
|
)
|
|
1835
1846
|
] }) })
|
|
1836
1847
|
] });
|
|
1837
1848
|
}
|
|
1838
|
-
const qe =
|
|
1849
|
+
const qe = kt(or);
|
|
1839
1850
|
qe.displayName = "Upload";
|
|
1840
|
-
qe.LIST_IGNORE =
|
|
1851
|
+
qe.LIST_IGNORE = Et;
|
|
1841
1852
|
qe.propTypes = {
|
|
1842
1853
|
sx: t.oneOfType([t.string, t.object]),
|
|
1843
1854
|
style: t.object,
|
|
@@ -1855,10 +1866,10 @@ qe.propTypes = {
|
|
|
1855
1866
|
showSize: t.bool,
|
|
1856
1867
|
disabled: t.bool
|
|
1857
1868
|
};
|
|
1858
|
-
const rr = ["root", "icon", "content", "actions", "closeIcon"],
|
|
1869
|
+
const rr = ["root", "icon", "content", "actions", "closeIcon"], mt = {
|
|
1859
1870
|
cancel: "取消",
|
|
1860
1871
|
action: "操作"
|
|
1861
|
-
},
|
|
1872
|
+
}, bt = {
|
|
1862
1873
|
small: {
|
|
1863
1874
|
rootClass: "px-[15px] py-[8px] h-[45px] rounded-[6px] gap-[8px] border",
|
|
1864
1875
|
iconSize: 20,
|
|
@@ -1886,7 +1897,7 @@ const rr = ["root", "icon", "content", "actions", "closeIcon"], pt = {
|
|
|
1886
1897
|
buttonGap: "12px",
|
|
1887
1898
|
buttonFontSize: "15px"
|
|
1888
1899
|
}
|
|
1889
|
-
},
|
|
1900
|
+
}, gt = {
|
|
1890
1901
|
info: {
|
|
1891
1902
|
bgVar: "--banner-info-bg",
|
|
1892
1903
|
borderVar: "--banner-info-border",
|
|
@@ -1927,49 +1938,49 @@ function sr(e) {
|
|
|
1927
1938
|
bannerBgColor: h,
|
|
1928
1939
|
bannerBorderColor: d,
|
|
1929
1940
|
bannerIconColor: p,
|
|
1930
|
-
sx:
|
|
1931
|
-
style:
|
|
1932
|
-
className:
|
|
1941
|
+
sx: f = {},
|
|
1942
|
+
style: w = {},
|
|
1943
|
+
className: P = "",
|
|
1933
1944
|
i18nKey: O,
|
|
1934
|
-
localeText:
|
|
1935
|
-
...
|
|
1936
|
-
} = e, { t:
|
|
1937
|
-
cancel:
|
|
1938
|
-
action:
|
|
1939
|
-
...
|
|
1940
|
-
}, $ = l ?? (O === "cancel" ?
|
|
1945
|
+
localeText: D = {},
|
|
1946
|
+
...S
|
|
1947
|
+
} = e, { t: v } = de(), x = ft(c, "normal", bt), C = ft(i, "info", gt), m = bt[x], y = gt[C], z = W(f, rr), A = {
|
|
1948
|
+
cancel: v("banner.cancel", mt.cancel),
|
|
1949
|
+
action: v("banner.action", mt.action),
|
|
1950
|
+
...D
|
|
1951
|
+
}, $ = l ?? (O === "cancel" ? v("banner.cancel", A.cancel) : A.cancel), _ = a ?? (O === "action" ? v("banner.action", A.action) : A.action), T = o ?? $, N = h || (u === !0 ? "transparent" : `var(${y.bgVar})`), k = d || `var(${y.borderVar})`, U = p || `var(${y.iconVar})`, j = `var(${y.textVar})`, B = b({
|
|
1941
1952
|
baseClassName: E(
|
|
1942
1953
|
"flex w-full items-center justify-start transition-colors duration-200",
|
|
1943
1954
|
m.rootClass
|
|
1944
1955
|
),
|
|
1945
|
-
className:
|
|
1956
|
+
className: P,
|
|
1946
1957
|
style: {
|
|
1947
1958
|
backgroundColor: N,
|
|
1948
|
-
borderColor:
|
|
1949
|
-
color: u === !0 ? "var(--muted-foreground)" :
|
|
1950
|
-
...
|
|
1959
|
+
borderColor: k,
|
|
1960
|
+
color: u === !0 ? "var(--muted-foreground)" : j,
|
|
1961
|
+
...w
|
|
1951
1962
|
},
|
|
1952
|
-
sxSlot:
|
|
1953
|
-
}),
|
|
1963
|
+
sxSlot: z.root
|
|
1964
|
+
}), M = b({
|
|
1954
1965
|
baseClassName: "shrink-0",
|
|
1955
1966
|
baseStyle: {
|
|
1956
1967
|
width: `${m.iconSize}px`,
|
|
1957
1968
|
height: `${m.iconSize}px`,
|
|
1958
1969
|
color: U
|
|
1959
1970
|
},
|
|
1960
|
-
sxSlot:
|
|
1961
|
-
}),
|
|
1971
|
+
sxSlot: z.icon
|
|
1972
|
+
}), F = b({
|
|
1962
1973
|
baseClassName: E(
|
|
1963
1974
|
"flex-grow text-left",
|
|
1964
1975
|
m.contentClass
|
|
1965
1976
|
),
|
|
1966
|
-
sxSlot:
|
|
1967
|
-
}),
|
|
1977
|
+
sxSlot: z.content
|
|
1978
|
+
}), H = b({
|
|
1968
1979
|
baseClassName: "flex items-center justify-end flex-1",
|
|
1969
1980
|
baseStyle: {
|
|
1970
1981
|
gap: m.buttonGap
|
|
1971
1982
|
},
|
|
1972
|
-
sxSlot:
|
|
1983
|
+
sxSlot: z.actions
|
|
1973
1984
|
}), K = b({
|
|
1974
1985
|
baseClassName: "shrink-0 cursor-pointer",
|
|
1975
1986
|
baseStyle: {
|
|
@@ -1977,38 +1988,38 @@ function sr(e) {
|
|
|
1977
1988
|
height: `${m.closeIconSize}px`,
|
|
1978
1989
|
color: "var(--banner-close-icon)"
|
|
1979
1990
|
},
|
|
1980
|
-
sxSlot:
|
|
1981
|
-
}),
|
|
1991
|
+
sxSlot: z.closeIcon
|
|
1992
|
+
}), G = /* @__PURE__ */ L("svg", { viewBox: "0 0 1024 1024", xmlns: "http://www.w3.org/2000/svg", fill: "currentColor", children: [
|
|
1982
1993
|
/* @__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" }),
|
|
1983
1994
|
/* @__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" }),
|
|
1984
1995
|
/* @__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" })
|
|
1985
|
-
] }), R = /* @__PURE__ */
|
|
1996
|
+
] }), R = /* @__PURE__ */ L("svg", { viewBox: "0 0 1024 1024", xmlns: "http://www.w3.org/2000/svg", fill: "currentColor", children: [
|
|
1986
1997
|
/* @__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" }),
|
|
1987
1998
|
/* @__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" }),
|
|
1988
1999
|
/* @__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" })
|
|
1989
|
-
] }),
|
|
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__ */ L("svg", { viewBox: "0 0 1024 1024", xmlns: "http://www.w3.org/2000/svg", fill: "currentColor", children: [
|
|
1990
2001
|
/* @__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" }),
|
|
1991
2002
|
/* @__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" })
|
|
1992
|
-
] }), 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" }) }),
|
|
1993
|
-
success:
|
|
2003
|
+
] }), 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 = {
|
|
2004
|
+
success: ue,
|
|
1994
2005
|
warning: R,
|
|
1995
|
-
error:
|
|
1996
|
-
info:
|
|
2006
|
+
error: Q,
|
|
2007
|
+
info: G
|
|
1997
2008
|
};
|
|
1998
|
-
return /* @__PURE__ */
|
|
2009
|
+
return /* @__PURE__ */ L(
|
|
1999
2010
|
"div",
|
|
2000
2011
|
{
|
|
2001
|
-
className:
|
|
2002
|
-
style:
|
|
2003
|
-
"data-level":
|
|
2012
|
+
className: B.className,
|
|
2013
|
+
style: B.style,
|
|
2014
|
+
"data-level": C,
|
|
2004
2015
|
"data-size": x,
|
|
2005
|
-
...
|
|
2016
|
+
...S,
|
|
2006
2017
|
children: [
|
|
2007
|
-
/* @__PURE__ */ s("div", { className:
|
|
2008
|
-
/* @__PURE__ */ s("div", { className:
|
|
2009
|
-
/* @__PURE__ */
|
|
2018
|
+
/* @__PURE__ */ s("div", { className: M.className, style: M.style, children: ge[C] }),
|
|
2019
|
+
/* @__PURE__ */ s("div", { className: F.className, style: F.style, children: T }),
|
|
2020
|
+
/* @__PURE__ */ L("div", { className: H.className, style: H.style, children: [
|
|
2010
2021
|
/* @__PURE__ */ s(
|
|
2011
|
-
|
|
2022
|
+
ie,
|
|
2012
2023
|
{
|
|
2013
2024
|
type: "transparent",
|
|
2014
2025
|
sx: {
|
|
@@ -2023,7 +2034,7 @@ function sr(e) {
|
|
|
2023
2034
|
}
|
|
2024
2035
|
),
|
|
2025
2036
|
/* @__PURE__ */ s(
|
|
2026
|
-
|
|
2037
|
+
ie,
|
|
2027
2038
|
{
|
|
2028
2039
|
type: "transparent",
|
|
2029
2040
|
sx: {
|
|
@@ -2035,7 +2046,7 @@ function sr(e) {
|
|
|
2035
2046
|
},
|
|
2036
2047
|
onClick: n,
|
|
2037
2048
|
size: x === "normal" ? "medium" : x,
|
|
2038
|
-
children:
|
|
2049
|
+
children: _
|
|
2039
2050
|
}
|
|
2040
2051
|
),
|
|
2041
2052
|
/* @__PURE__ */ s(
|
|
@@ -2074,7 +2085,7 @@ const ar = ["root", "input", "text"], Ye = {
|
|
|
2074
2085
|
hex: "HEX",
|
|
2075
2086
|
rgb: "RGB",
|
|
2076
2087
|
hsl: "HSL"
|
|
2077
|
-
},
|
|
2088
|
+
}, ht = {
|
|
2078
2089
|
small: { inputSize: 20, fontSize: "11px", gap: "6px" },
|
|
2079
2090
|
medium: { inputSize: 28, fontSize: "12px", gap: "10px" },
|
|
2080
2091
|
large: { inputSize: 36, fontSize: "14px", gap: "14px" }
|
|
@@ -2082,7 +2093,7 @@ const ar = ["root", "input", "text"], Ye = {
|
|
|
2082
2093
|
hex: "hex",
|
|
2083
2094
|
rgb: "rgb",
|
|
2084
2095
|
hsl: "hsl"
|
|
2085
|
-
},
|
|
2096
|
+
}, yt = (e, o, r) => Object.prototype.hasOwnProperty.call(r, e) ? e : o, lr = (e) => {
|
|
2086
2097
|
const o = parseInt(e.slice(1, 3), 16), r = parseInt(e.slice(3, 5), 16), n = parseInt(e.slice(5, 7), 16);
|
|
2087
2098
|
return `rgb(${o}, ${r}, ${n})`;
|
|
2088
2099
|
}, cr = (e) => {
|
|
@@ -2118,22 +2129,22 @@ function dr(e) {
|
|
|
2118
2129
|
style: h = {},
|
|
2119
2130
|
className: d = "",
|
|
2120
2131
|
i18nKey: p,
|
|
2121
|
-
localeText:
|
|
2122
|
-
...
|
|
2123
|
-
} = e, { t:
|
|
2124
|
-
hex:
|
|
2125
|
-
rgb:
|
|
2126
|
-
hsl:
|
|
2127
|
-
...
|
|
2128
|
-
},
|
|
2129
|
-
const U =
|
|
2132
|
+
localeText: f = {},
|
|
2133
|
+
...w
|
|
2134
|
+
} = e, { t: P } = de(), O = yt(i, "medium", ht), D = yt(a, "hex", nr), S = ht[O], [v, x] = Z(r), C = o ?? v, m = W(u, ar), y = {
|
|
2135
|
+
hex: P("colorpicker.hex", Ye.hex),
|
|
2136
|
+
rgb: P("colorpicker.rgb", Ye.rgb),
|
|
2137
|
+
hsl: P("colorpicker.hsl", Ye.hsl),
|
|
2138
|
+
...f
|
|
2139
|
+
}, z = (k) => {
|
|
2140
|
+
const U = k.target.value;
|
|
2130
2141
|
o === void 0 && x(U), n(U);
|
|
2131
2142
|
}, A = [];
|
|
2132
2143
|
if (l) {
|
|
2133
|
-
const
|
|
2144
|
+
const k = p || (typeof l == "string" ? l : null) || D;
|
|
2134
2145
|
A.push({
|
|
2135
|
-
label: y[
|
|
2136
|
-
value: ir(
|
|
2146
|
+
label: y[k],
|
|
2147
|
+
value: ir(C, k)
|
|
2137
2148
|
});
|
|
2138
2149
|
}
|
|
2139
2150
|
const $ = b({
|
|
@@ -2142,49 +2153,49 @@ function dr(e) {
|
|
|
2142
2153
|
c && "cursor-not-allowed opacity-60"
|
|
2143
2154
|
),
|
|
2144
2155
|
className: d,
|
|
2145
|
-
baseStyle: { gap:
|
|
2156
|
+
baseStyle: { gap: S.gap },
|
|
2146
2157
|
style: h,
|
|
2147
2158
|
sxSlot: m.root
|
|
2148
|
-
}),
|
|
2159
|
+
}), _ = b({
|
|
2149
2160
|
baseClassName: E(
|
|
2150
2161
|
"shrink-0 cursor-pointer border-2 border-[var(--border)] rounded-full bg-transparent overflow-hidden transition-colors duration-200",
|
|
2151
2162
|
c && "cursor-not-allowed"
|
|
2152
2163
|
),
|
|
2153
2164
|
baseStyle: {
|
|
2154
|
-
width: `${
|
|
2155
|
-
height: `${
|
|
2165
|
+
width: `${S.inputSize}px`,
|
|
2166
|
+
height: `${S.inputSize}px`,
|
|
2156
2167
|
padding: 0
|
|
2157
2168
|
},
|
|
2158
2169
|
sxSlot: m.input
|
|
2159
2170
|
}), T = b({
|
|
2160
2171
|
baseClassName: "flex flex-col text-[var(--muted-foreground)]",
|
|
2161
|
-
baseStyle: { fontSize:
|
|
2172
|
+
baseStyle: { fontSize: S.fontSize },
|
|
2162
2173
|
sxSlot: m.text
|
|
2163
2174
|
});
|
|
2164
|
-
return /* @__PURE__ */
|
|
2175
|
+
return /* @__PURE__ */ L(Ne, { children: [
|
|
2165
2176
|
/* @__PURE__ */ s("style", { children: `
|
|
2166
2177
|
.tango-cp-input::-webkit-color-swatch-wrapper { padding: 0; }
|
|
2167
2178
|
.tango-cp-input::-webkit-color-swatch { border: 0; border-radius: 9999px; }
|
|
2168
2179
|
.tango-cp-input::-moz-color-swatch { border: 0; border-radius: 9999px; }
|
|
2169
2180
|
` }),
|
|
2170
|
-
/* @__PURE__ */
|
|
2181
|
+
/* @__PURE__ */ L("div", { className: $.className, style: $.style, ...w, children: [
|
|
2171
2182
|
/* @__PURE__ */ s(
|
|
2172
2183
|
"input",
|
|
2173
2184
|
{
|
|
2174
2185
|
type: "color",
|
|
2175
|
-
value:
|
|
2176
|
-
onChange:
|
|
2186
|
+
value: C,
|
|
2187
|
+
onChange: z,
|
|
2177
2188
|
disabled: c,
|
|
2178
|
-
className: `tango-cp-input ${
|
|
2179
|
-
style:
|
|
2180
|
-
"aria-label":
|
|
2189
|
+
className: `tango-cp-input ${_.className}`,
|
|
2190
|
+
style: _.style,
|
|
2191
|
+
"aria-label": w["aria-label"] || `颜色选择器: ${C}`
|
|
2181
2192
|
}
|
|
2182
2193
|
),
|
|
2183
|
-
l && A.length > 0 && /* @__PURE__ */ s("div", { className: T.className, style: T.style, children: A.map(({ label:
|
|
2184
|
-
|
|
2194
|
+
l && A.length > 0 && /* @__PURE__ */ s("div", { className: T.className, style: T.style, children: A.map(({ label: k, value: U }) => /* @__PURE__ */ L("span", { children: [
|
|
2195
|
+
k,
|
|
2185
2196
|
": ",
|
|
2186
2197
|
U
|
|
2187
|
-
] },
|
|
2198
|
+
] }, k)) })
|
|
2188
2199
|
] })
|
|
2189
2200
|
] });
|
|
2190
2201
|
}
|
|
@@ -2202,10 +2213,10 @@ dr.propTypes = {
|
|
|
2202
2213
|
i18nKey: t.string,
|
|
2203
2214
|
localeText: t.object
|
|
2204
2215
|
};
|
|
2205
|
-
const ur = ["root", "date", "weekday", "time"],
|
|
2216
|
+
const ur = ["root", "date", "weekday", "time"], xt = {
|
|
2206
2217
|
weekdayPrefix: "星期",
|
|
2207
2218
|
weekdayShortPrefix: "周"
|
|
2208
|
-
},
|
|
2219
|
+
}, vt = {
|
|
2209
2220
|
default: "default",
|
|
2210
2221
|
line: "line",
|
|
2211
2222
|
full: "full",
|
|
@@ -2228,7 +2239,7 @@ const ur = ["root", "date", "weekday", "time"], yt = {
|
|
|
2228
2239
|
}, Te = (e, o) => {
|
|
2229
2240
|
const r = /* @__PURE__ */ new Date(), n = { hour: "2-digit", minute: "2-digit" };
|
|
2230
2241
|
return o && (n.second = "2-digit"), r.toLocaleTimeString(e, n);
|
|
2231
|
-
},
|
|
2242
|
+
}, gr = (e, o, r, n) => {
|
|
2232
2243
|
const c = e.endsWith("-line"), l = mr(o, c), a = br(o, r);
|
|
2233
2244
|
switch (e) {
|
|
2234
2245
|
case "line":
|
|
@@ -2276,7 +2287,7 @@ const ur = ["root", "date", "weekday", "time"], yt = {
|
|
|
2276
2287
|
return [{ key: "date", text: l }];
|
|
2277
2288
|
}
|
|
2278
2289
|
};
|
|
2279
|
-
function
|
|
2290
|
+
function fr(e) {
|
|
2280
2291
|
const {
|
|
2281
2292
|
type: o = "default",
|
|
2282
2293
|
single: r = !1,
|
|
@@ -2286,48 +2297,52 @@ function gr(e) {
|
|
|
2286
2297
|
i18nKey: a,
|
|
2287
2298
|
localeText: i = {},
|
|
2288
2299
|
...u
|
|
2289
|
-
} = e || {}, { t: h, locale: d } =
|
|
2300
|
+
} = e || {}, { t: h, locale: d } = de(), [p, f] = Z(!1);
|
|
2301
|
+
ae(() => {
|
|
2302
|
+
f(!0);
|
|
2303
|
+
}, []);
|
|
2304
|
+
const w = pr(o, "default", vt), P = d === "en-US" ? "en-US" : "zh-CN";
|
|
2290
2305
|
({
|
|
2291
|
-
weekdayPrefix: h("date.weekdayPrefix",
|
|
2292
|
-
weekdayShortPrefix: h("date.weekdayShortPrefix",
|
|
2306
|
+
weekdayPrefix: h("date.weekdayPrefix", xt.weekdayPrefix),
|
|
2307
|
+
weekdayShortPrefix: h("date.weekdayShortPrefix", xt.weekdayShortPrefix),
|
|
2293
2308
|
...i
|
|
2294
2309
|
});
|
|
2295
|
-
const
|
|
2310
|
+
const O = W(n, ur), D = a && vt[a] ? a : w, S = p ? gr(D, P, r) : [], v = b({
|
|
2296
2311
|
baseClassName: E("inline-flex items-center gap-1 text-[var(--foreground)]"),
|
|
2297
2312
|
className: l,
|
|
2298
2313
|
baseStyle: {},
|
|
2299
2314
|
style: c,
|
|
2300
|
-
sxSlot:
|
|
2301
|
-
}),
|
|
2315
|
+
sxSlot: O.root
|
|
2316
|
+
}), x = {
|
|
2302
2317
|
date: b({
|
|
2303
2318
|
baseClassName: "",
|
|
2304
|
-
sxSlot:
|
|
2319
|
+
sxSlot: O.date
|
|
2305
2320
|
}),
|
|
2306
2321
|
weekday: b({
|
|
2307
2322
|
baseClassName: "text-[var(--muted-foreground)]",
|
|
2308
|
-
sxSlot:
|
|
2323
|
+
sxSlot: O.weekday
|
|
2309
2324
|
}),
|
|
2310
2325
|
time: b({
|
|
2311
2326
|
baseClassName: "",
|
|
2312
|
-
sxSlot:
|
|
2327
|
+
sxSlot: O.time
|
|
2313
2328
|
})
|
|
2314
2329
|
};
|
|
2315
2330
|
return /* @__PURE__ */ s(
|
|
2316
2331
|
"div",
|
|
2317
2332
|
{
|
|
2318
|
-
className:
|
|
2319
|
-
style:
|
|
2333
|
+
className: v.className,
|
|
2334
|
+
style: v.style,
|
|
2320
2335
|
role: "timer",
|
|
2321
2336
|
"aria-live": "polite",
|
|
2322
2337
|
...u,
|
|
2323
|
-
children:
|
|
2324
|
-
const
|
|
2325
|
-
return /* @__PURE__ */ s("span", { className:
|
|
2338
|
+
children: S.map((C) => {
|
|
2339
|
+
const m = x[C.key] || { className: "", style: {} };
|
|
2340
|
+
return /* @__PURE__ */ s("span", { className: m.className, style: m.style, children: C.text }, C.key);
|
|
2326
2341
|
})
|
|
2327
2342
|
}
|
|
2328
2343
|
);
|
|
2329
2344
|
}
|
|
2330
|
-
|
|
2345
|
+
fr.propTypes = {
|
|
2331
2346
|
type: t.oneOf([
|
|
2332
2347
|
"default",
|
|
2333
2348
|
"line",
|
|
@@ -2356,7 +2371,7 @@ const hr = ["root", "input", "panel", "header", "body", "footer"], me = {
|
|
|
2356
2371
|
nextMonth: "下一月",
|
|
2357
2372
|
weekDays: ["日", "一", "二", "三", "四", "五", "六"],
|
|
2358
2373
|
monthFormat: "${year} 年 ${month} 月"
|
|
2359
|
-
},
|
|
2374
|
+
}, St = {
|
|
2360
2375
|
small: { inputPx: "px-2 py-1", textSm: "text-xs", minW: "min-w-[140px]", panelW: "w-[260px]" },
|
|
2361
2376
|
medium: { inputPx: "px-3 py-2", textSm: "text-sm", minW: "min-w-[180px]", panelW: "w-[300px]" },
|
|
2362
2377
|
large: { inputPx: "px-4 py-3", textSm: "text-base", minW: "min-w-[220px]", panelW: "w-[340px]" }
|
|
@@ -2375,175 +2390,175 @@ function xr(e) {
|
|
|
2375
2390
|
className: h = "",
|
|
2376
2391
|
i18nKey: d,
|
|
2377
2392
|
localeText: p = {},
|
|
2378
|
-
placeholder:
|
|
2379
|
-
...
|
|
2380
|
-
} = e, { t:
|
|
2381
|
-
const
|
|
2382
|
-
return new Date(
|
|
2383
|
-
}), U = $e(null),
|
|
2384
|
-
placeholder:
|
|
2385
|
-
placeholderTime:
|
|
2386
|
-
timeLabel:
|
|
2387
|
-
confirm:
|
|
2388
|
-
cancel:
|
|
2389
|
-
prevMonth:
|
|
2390
|
-
nextMonth:
|
|
2391
|
-
weekDays:
|
|
2392
|
-
monthFormat:
|
|
2393
|
+
placeholder: f,
|
|
2394
|
+
...w
|
|
2395
|
+
} = e, { t: P, locale: O } = de(), D = yr(a, "medium", St), S = St[D], v = O === "en-US", [x, C] = Z(r || ""), m = o !== void 0 ? o : x, [y, z] = Z("00"), [A, $] = Z("00"), [_, T] = Z(!1), [N, k] = Z(() => {
|
|
2396
|
+
const g = /* @__PURE__ */ new Date();
|
|
2397
|
+
return new Date(g.getFullYear(), g.getMonth(), 1);
|
|
2398
|
+
}), U = $e(null), j = {
|
|
2399
|
+
placeholder: P("datepicker.placeholder", me.placeholder),
|
|
2400
|
+
placeholderTime: P("datepicker.placeholderTime", me.placeholderTime),
|
|
2401
|
+
timeLabel: P("datepicker.timeLabel", me.timeLabel),
|
|
2402
|
+
confirm: P("datepicker.confirm", me.confirm),
|
|
2403
|
+
cancel: P("datepicker.cancel", me.cancel),
|
|
2404
|
+
prevMonth: P("datepicker.prevMonth", me.prevMonth),
|
|
2405
|
+
nextMonth: P("datepicker.nextMonth", me.nextMonth),
|
|
2406
|
+
weekDays: v ? ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"] : me.weekDays,
|
|
2407
|
+
monthFormat: v ? "${month}/${year}" : me.monthFormat,
|
|
2393
2408
|
...p
|
|
2394
2409
|
};
|
|
2395
|
-
|
|
2396
|
-
const
|
|
2397
|
-
U.current && !U.current.contains(
|
|
2410
|
+
ae(() => {
|
|
2411
|
+
const g = (V) => {
|
|
2412
|
+
U.current && !U.current.contains(V.target) && T(!1);
|
|
2398
2413
|
};
|
|
2399
|
-
return document.addEventListener("mousedown",
|
|
2414
|
+
return document.addEventListener("mousedown", g), () => document.removeEventListener("mousedown", g);
|
|
2400
2415
|
}, []);
|
|
2401
|
-
const
|
|
2402
|
-
const
|
|
2403
|
-
return `${
|
|
2404
|
-
},
|
|
2405
|
-
const
|
|
2406
|
-
return
|
|
2407
|
-
}, [N,
|
|
2408
|
-
const
|
|
2409
|
-
return [...Array(
|
|
2410
|
-
}, [N]),
|
|
2411
|
-
const
|
|
2412
|
-
return m ===
|
|
2413
|
-
},
|
|
2414
|
-
if (
|
|
2416
|
+
const B = (g) => {
|
|
2417
|
+
const V = g.getFullYear(), ee = (g.getMonth() + 1).toString().padStart(2, "0"), ce = g.getDate().toString().padStart(2, "0");
|
|
2418
|
+
return `${V}-${ee}-${ce}`;
|
|
2419
|
+
}, M = Se(() => {
|
|
2420
|
+
const g = N.getFullYear(), V = N.getMonth() + 1;
|
|
2421
|
+
return j.monthFormat.replace("${year}", String(g)).replace("${month}", String(V));
|
|
2422
|
+
}, [N, j.monthFormat]), F = Se(() => {
|
|
2423
|
+
const g = N.getFullYear(), V = N.getMonth(), ee = new Date(g, V, 1).getDay(), ce = new Date(g, V + 1, 0).getDate(), pe = Array.from({ length: ce }, (Je, Fe) => Fe + 1);
|
|
2424
|
+
return [...Array(ee).fill(null), ...pe];
|
|
2425
|
+
}, [N]), H = Se(() => m ? l ? `${m} ${y}:${A}` : m : "", [m, y, A, l]), K = (g) => {
|
|
2426
|
+
const V = new Date(N.getFullYear(), N.getMonth(), g);
|
|
2427
|
+
return m === B(V);
|
|
2428
|
+
}, G = (g, V, ee) => {
|
|
2429
|
+
if (g) {
|
|
2415
2430
|
if (l) {
|
|
2416
|
-
const
|
|
2417
|
-
n(`${Je}-${Fe}-${
|
|
2431
|
+
const ce = `${g}T${V}:${ee}`, pe = new Date(ce), Je = pe.getFullYear(), Fe = (pe.getMonth() + 1).toString().padStart(2, "0"), Rt = pe.getDate().toString().padStart(2, "0"), Vt = pe.getHours().toString().padStart(2, "0"), Yt = pe.getMinutes().toString().padStart(2, "0");
|
|
2432
|
+
n(`${Je}-${Fe}-${Rt} ${Vt}:${Yt}`, ce);
|
|
2418
2433
|
return;
|
|
2419
2434
|
}
|
|
2420
|
-
n(
|
|
2435
|
+
n(g, g);
|
|
2421
2436
|
}
|
|
2422
|
-
}, R = (
|
|
2423
|
-
const
|
|
2424
|
-
o === void 0 &&
|
|
2425
|
-
},
|
|
2426
|
-
const
|
|
2427
|
-
|
|
2428
|
-
},
|
|
2429
|
-
const
|
|
2430
|
-
$(
|
|
2437
|
+
}, R = (g) => {
|
|
2438
|
+
const V = new Date(N.getFullYear(), N.getMonth(), g), ee = B(V);
|
|
2439
|
+
o === void 0 && C(ee), G(ee, y, A), l || T(!1);
|
|
2440
|
+
}, Q = (g) => {
|
|
2441
|
+
const V = g.target.value;
|
|
2442
|
+
z(V), G(m, V, A);
|
|
2443
|
+
}, ue = (g) => {
|
|
2444
|
+
const V = g.target.value;
|
|
2445
|
+
$(V), G(m, y, V);
|
|
2431
2446
|
}, be = () => {
|
|
2432
2447
|
if (!c) {
|
|
2433
2448
|
if (m) {
|
|
2434
|
-
const [
|
|
2435
|
-
|
|
2449
|
+
const [g, V] = m.split("-").map(Number);
|
|
2450
|
+
k(new Date(g, V - 1, 1));
|
|
2436
2451
|
}
|
|
2437
2452
|
T(!0);
|
|
2438
2453
|
}
|
|
2439
|
-
},
|
|
2440
|
-
typeof i == "string" && (
|
|
2441
|
-
const
|
|
2454
|
+
}, ge = Array.from({ length: 24 }, (g, V) => String(V).padStart(2, "0")), fe = Array.from({ length: 60 }, (g, V) => String(V).padStart(2, "0")), X = W(i, hr);
|
|
2455
|
+
typeof i == "string" && (X.input.tw = E(X.input.tw, X.root.tw), X.root.tw = "");
|
|
2456
|
+
const J = b({
|
|
2442
2457
|
baseClassName: "relative inline-block",
|
|
2443
|
-
sxSlot:
|
|
2444
|
-
}),
|
|
2458
|
+
sxSlot: X.root
|
|
2459
|
+
}), I = b({
|
|
2445
2460
|
baseClassName: E(
|
|
2446
2461
|
"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",
|
|
2447
2462
|
"focus:border-[var(--primary)] focus:shadow-[0_0_0_2px_color-mix(in_srgb,var(--primary)_18%,transparent)]",
|
|
2448
2463
|
"hover:border-[var(--primary)]",
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2464
|
+
S.inputPx,
|
|
2465
|
+
S.textSm,
|
|
2466
|
+
S.minW,
|
|
2452
2467
|
c && "bg-[var(--muted)] text-[var(--muted-foreground)] cursor-not-allowed"
|
|
2453
2468
|
),
|
|
2454
2469
|
className: h,
|
|
2455
2470
|
style: u,
|
|
2456
|
-
sxSlot:
|
|
2457
|
-
}),
|
|
2471
|
+
sxSlot: X.input
|
|
2472
|
+
}), q = b({
|
|
2458
2473
|
baseClassName: E(
|
|
2459
2474
|
"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)]",
|
|
2460
|
-
|
|
2475
|
+
S.panelW
|
|
2461
2476
|
),
|
|
2462
|
-
sxSlot:
|
|
2463
|
-
}),
|
|
2477
|
+
sxSlot: X.panel
|
|
2478
|
+
}), le = b({
|
|
2464
2479
|
baseClassName: "flex items-center justify-between h-10 mb-2",
|
|
2465
|
-
sxSlot:
|
|
2466
|
-
}),
|
|
2480
|
+
sxSlot: X.header
|
|
2481
|
+
}), re = b({
|
|
2467
2482
|
baseClassName: "flex flex-wrap",
|
|
2468
|
-
sxSlot:
|
|
2469
|
-
}),
|
|
2483
|
+
sxSlot: X.body
|
|
2484
|
+
}), se = b({
|
|
2470
2485
|
baseClassName: "mt-2.5 pt-2.5 border-t border-[var(--border)]",
|
|
2471
|
-
sxSlot:
|
|
2486
|
+
sxSlot: X.footer
|
|
2472
2487
|
});
|
|
2473
|
-
return /* @__PURE__ */
|
|
2488
|
+
return /* @__PURE__ */ L("div", { className: J.className, style: J.style, ref: U, ...w, children: [
|
|
2474
2489
|
/* @__PURE__ */ s(
|
|
2475
2490
|
"input",
|
|
2476
2491
|
{
|
|
2477
2492
|
type: "text",
|
|
2478
|
-
value:
|
|
2493
|
+
value: H,
|
|
2479
2494
|
readOnly: !0,
|
|
2480
2495
|
onClick: be,
|
|
2481
|
-
className:
|
|
2482
|
-
style:
|
|
2496
|
+
className: I.className,
|
|
2497
|
+
style: I.style,
|
|
2483
2498
|
disabled: c,
|
|
2484
|
-
placeholder:
|
|
2485
|
-
"aria-label":
|
|
2499
|
+
placeholder: f || (l ? j.placeholderTime : j.placeholder),
|
|
2500
|
+
"aria-label": w["aria-label"] || f || (l ? j.placeholderTime : j.placeholder),
|
|
2486
2501
|
"aria-haspopup": "dialog",
|
|
2487
|
-
"aria-expanded":
|
|
2502
|
+
"aria-expanded": _
|
|
2488
2503
|
}
|
|
2489
2504
|
),
|
|
2490
|
-
|
|
2491
|
-
/* @__PURE__ */
|
|
2505
|
+
_ && !c && /* @__PURE__ */ L("div", { className: q.className, style: q.style, role: "dialog", "aria-label": "日期选择面板", children: [
|
|
2506
|
+
/* @__PURE__ */ L("div", { className: le.className, style: le.style, children: [
|
|
2492
2507
|
/* @__PURE__ */ s(
|
|
2493
2508
|
"button",
|
|
2494
2509
|
{
|
|
2495
2510
|
type: "button",
|
|
2496
2511
|
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))]",
|
|
2497
|
-
onClick: () =>
|
|
2498
|
-
"aria-label":
|
|
2512
|
+
onClick: () => k(new Date(N.getFullYear(), N.getMonth() - 1, 1)),
|
|
2513
|
+
"aria-label": j.prevMonth,
|
|
2499
2514
|
children: "<"
|
|
2500
2515
|
}
|
|
2501
2516
|
),
|
|
2502
|
-
/* @__PURE__ */ s("div", { className: "text-sm font-semibold text-[var(--foreground)]", children:
|
|
2517
|
+
/* @__PURE__ */ s("div", { className: "text-sm font-semibold text-[var(--foreground)]", children: M }),
|
|
2503
2518
|
/* @__PURE__ */ s(
|
|
2504
2519
|
"button",
|
|
2505
2520
|
{
|
|
2506
2521
|
type: "button",
|
|
2507
2522
|
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))]",
|
|
2508
|
-
onClick: () =>
|
|
2509
|
-
"aria-label":
|
|
2523
|
+
onClick: () => k(new Date(N.getFullYear(), N.getMonth() + 1, 1)),
|
|
2524
|
+
"aria-label": j.nextMonth,
|
|
2510
2525
|
children: ">"
|
|
2511
2526
|
}
|
|
2512
2527
|
)
|
|
2513
2528
|
] }),
|
|
2514
|
-
/* @__PURE__ */
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
if (!
|
|
2518
|
-
return /* @__PURE__ */ s("div", { className: "w-[calc(100%/7)] text-center leading-[30px]" }, `empty-${
|
|
2519
|
-
const
|
|
2529
|
+
/* @__PURE__ */ L("div", { className: re.className, style: re.style, children: [
|
|
2530
|
+
j.weekDays.map((g) => /* @__PURE__ */ s("div", { className: "w-[calc(100%/7)] text-center leading-[30px] text-xs text-[var(--muted-foreground)]", children: g }, g)),
|
|
2531
|
+
F.map((g, V) => {
|
|
2532
|
+
if (!g)
|
|
2533
|
+
return /* @__PURE__ */ s("div", { className: "w-[calc(100%/7)] text-center leading-[30px]" }, `empty-${V}`);
|
|
2534
|
+
const ee = K(g);
|
|
2520
2535
|
return /* @__PURE__ */ s(
|
|
2521
2536
|
"button",
|
|
2522
2537
|
{
|
|
2523
2538
|
type: "button",
|
|
2524
2539
|
className: E(
|
|
2525
2540
|
"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)]",
|
|
2526
|
-
|
|
2541
|
+
ee && "bg-[var(--primary)] text-[var(--primary-foreground)] hover:bg-[var(--primary)]"
|
|
2527
2542
|
),
|
|
2528
|
-
onClick: () => R(
|
|
2529
|
-
"aria-label": `${N.getFullYear()}-${(N.getMonth() + 1).toString().padStart(2, "0")}-${
|
|
2530
|
-
children:
|
|
2543
|
+
onClick: () => R(g),
|
|
2544
|
+
"aria-label": `${N.getFullYear()}-${(N.getMonth() + 1).toString().padStart(2, "0")}-${g.toString().padStart(2, "0")}`,
|
|
2545
|
+
children: g
|
|
2531
2546
|
},
|
|
2532
|
-
`${N.getFullYear()}-${N.getMonth()}-${
|
|
2547
|
+
`${N.getFullYear()}-${N.getMonth()}-${g}`
|
|
2533
2548
|
);
|
|
2534
2549
|
})
|
|
2535
2550
|
] }),
|
|
2536
|
-
l && /* @__PURE__ */
|
|
2537
|
-
/* @__PURE__ */ s("div", { className: "text-xs text-[var(--muted-foreground)] mb-2", children:
|
|
2538
|
-
/* @__PURE__ */
|
|
2551
|
+
l && /* @__PURE__ */ L("div", { className: se.className, style: se.style, children: [
|
|
2552
|
+
/* @__PURE__ */ s("div", { className: "text-xs text-[var(--muted-foreground)] mb-2", children: j.timeLabel }),
|
|
2553
|
+
/* @__PURE__ */ L("div", { className: "flex items-center gap-2", children: [
|
|
2539
2554
|
/* @__PURE__ */ s(
|
|
2540
2555
|
"select",
|
|
2541
2556
|
{
|
|
2542
2557
|
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)]",
|
|
2543
2558
|
value: y,
|
|
2544
|
-
onChange:
|
|
2559
|
+
onChange: Q,
|
|
2545
2560
|
"aria-label": "小时",
|
|
2546
|
-
children:
|
|
2561
|
+
children: ge.map((g) => /* @__PURE__ */ s("option", { value: g, children: g }, g))
|
|
2547
2562
|
}
|
|
2548
2563
|
),
|
|
2549
2564
|
/* @__PURE__ */ s("span", { className: "font-semibold text-[var(--muted-foreground)]", children: ":" }),
|
|
@@ -2552,29 +2567,38 @@ function xr(e) {
|
|
|
2552
2567
|
{
|
|
2553
2568
|
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)]",
|
|
2554
2569
|
value: A,
|
|
2555
|
-
onChange:
|
|
2570
|
+
onChange: ue,
|
|
2556
2571
|
"aria-label": "分钟",
|
|
2557
|
-
children:
|
|
2572
|
+
children: fe.map((g) => /* @__PURE__ */ s("option", { value: g, children: g }, g))
|
|
2558
2573
|
}
|
|
2559
2574
|
)
|
|
2560
2575
|
] }),
|
|
2561
|
-
/* @__PURE__ */
|
|
2576
|
+
/* @__PURE__ */ L("div", { className: "mt-2.5 flex justify-end gap-2", children: [
|
|
2562
2577
|
/* @__PURE__ */ s(
|
|
2563
|
-
|
|
2578
|
+
ie,
|
|
2564
2579
|
{
|
|
2565
2580
|
onClick: () => T(!1),
|
|
2566
2581
|
size: "small",
|
|
2567
2582
|
type: "transparent",
|
|
2568
2583
|
outline: !0,
|
|
2569
|
-
|
|
2584
|
+
style: {
|
|
2585
|
+
backgroundColor: "var(--datepicker-cancel-bg)",
|
|
2586
|
+
color: "var(--datepicker-cancel-fg)"
|
|
2587
|
+
},
|
|
2588
|
+
children: j.cancel
|
|
2570
2589
|
}
|
|
2571
2590
|
),
|
|
2572
2591
|
/* @__PURE__ */ s(
|
|
2573
|
-
|
|
2592
|
+
ie,
|
|
2574
2593
|
{
|
|
2575
2594
|
onClick: () => T(!1),
|
|
2576
2595
|
size: "small",
|
|
2577
|
-
|
|
2596
|
+
style: {
|
|
2597
|
+
backgroundColor: "var(--datepicker-confirm-bg)",
|
|
2598
|
+
color: "var(--datepicker-confirm-fg)",
|
|
2599
|
+
borderColor: "var(--datepicker-confirm-bg)"
|
|
2600
|
+
},
|
|
2601
|
+
children: j.confirm
|
|
2578
2602
|
}
|
|
2579
2603
|
)
|
|
2580
2604
|
] })
|
|
@@ -2595,7 +2619,7 @@ xr.propTypes = {
|
|
|
2595
2619
|
i18nKey: t.string,
|
|
2596
2620
|
localeText: t.object
|
|
2597
2621
|
};
|
|
2598
|
-
const vr = ["overlay", "container", "header", "title", "closeBtn", "content", "footer"],
|
|
2622
|
+
const vr = ["overlay", "container", "header", "title", "closeBtn", "content", "footer"], Oe = {
|
|
2599
2623
|
title: "基础标题",
|
|
2600
2624
|
okText: "确定",
|
|
2601
2625
|
cancelText: "取消",
|
|
@@ -2625,80 +2649,81 @@ function Tr(e) {
|
|
|
2625
2649
|
width: h,
|
|
2626
2650
|
height: d,
|
|
2627
2651
|
sx: p = {},
|
|
2628
|
-
style:
|
|
2629
|
-
className:
|
|
2630
|
-
maskClosable:
|
|
2652
|
+
style: f = {},
|
|
2653
|
+
className: w = "",
|
|
2654
|
+
maskClosable: P = !0,
|
|
2631
2655
|
footerButtons: O,
|
|
2632
|
-
localeText:
|
|
2633
|
-
...
|
|
2634
|
-
} = e, { t:
|
|
2635
|
-
|
|
2656
|
+
localeText: D = {},
|
|
2657
|
+
...S
|
|
2658
|
+
} = e, { t: v } = de(), x = Cr(u, "right", Sr), [C, m] = Z(!1), [y, z] = Z(!1);
|
|
2659
|
+
ae(() => {
|
|
2636
2660
|
if (l) {
|
|
2637
2661
|
m(!0);
|
|
2638
|
-
const R = setTimeout(() =>
|
|
2662
|
+
const R = setTimeout(() => z(!0), 30);
|
|
2639
2663
|
return () => clearTimeout(R);
|
|
2640
2664
|
}
|
|
2641
|
-
if (
|
|
2642
|
-
|
|
2665
|
+
if (C) {
|
|
2666
|
+
z(!1);
|
|
2643
2667
|
const R = setTimeout(() => m(!1), 300);
|
|
2644
2668
|
return () => clearTimeout(R);
|
|
2645
2669
|
}
|
|
2646
|
-
}, [l]),
|
|
2647
|
-
if (
|
|
2648
|
-
const R = document.body.
|
|
2649
|
-
return document.body.style.overflow = "hidden", () => {
|
|
2650
|
-
document.body.
|
|
2670
|
+
}, [l]), ae(() => {
|
|
2671
|
+
if (C) {
|
|
2672
|
+
const R = parseInt(document.body.dataset.tangoScrollLock || "0", 10);
|
|
2673
|
+
return R === 0 && (document.body.dataset.tangoOriginalOverflow = document.body.style.overflow), document.body.dataset.tangoScrollLock = String(R + 1), document.body.style.overflow = "hidden", () => {
|
|
2674
|
+
const Q = parseInt(document.body.dataset.tangoScrollLock || "0", 10);
|
|
2675
|
+
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);
|
|
2651
2676
|
};
|
|
2652
2677
|
}
|
|
2653
|
-
}, [
|
|
2678
|
+
}, [C]);
|
|
2654
2679
|
const A = {};
|
|
2655
2680
|
x === "left" || x === "right" ? A.width = h || "320px" : A.height = d || "300px";
|
|
2656
2681
|
const $ = {
|
|
2657
|
-
title: r ??
|
|
2658
|
-
okText: n ??
|
|
2659
|
-
cancelText: c ??
|
|
2660
|
-
closeAriaLabel:
|
|
2661
|
-
...
|
|
2662
|
-
},
|
|
2682
|
+
title: r ?? v("drawer.title", Oe.title),
|
|
2683
|
+
okText: n ?? v("drawer.okText", Oe.okText),
|
|
2684
|
+
cancelText: c ?? v("drawer.cancelText", Oe.cancelText),
|
|
2685
|
+
closeAriaLabel: v("drawer.closeAriaLabel", Oe.closeAriaLabel),
|
|
2686
|
+
...D
|
|
2687
|
+
}, _ = W(p, vr), T = b({
|
|
2663
2688
|
baseClassName: "fixed inset-0 z-[999] flex",
|
|
2664
|
-
sxSlot:
|
|
2689
|
+
sxSlot: _.overlay
|
|
2665
2690
|
}), N = {
|
|
2666
|
-
tw: E(
|
|
2667
|
-
css: { ...
|
|
2668
|
-
},
|
|
2691
|
+
tw: E(_.root.tw, _.container.tw),
|
|
2692
|
+
css: { ..._.root.css, ..._.container.css }
|
|
2693
|
+
}, k = b({
|
|
2669
2694
|
baseClassName: E(
|
|
2670
2695
|
"fixed bg-[var(--card)] text-[var(--foreground)] flex flex-col transition-all duration-300 ease-in-out",
|
|
2671
2696
|
Nr[x]
|
|
2672
2697
|
),
|
|
2673
|
-
className:
|
|
2698
|
+
className: w,
|
|
2674
2699
|
style: {
|
|
2675
2700
|
...A,
|
|
2676
2701
|
transform: y ? "translate(0, 0)" : wr[x],
|
|
2677
|
-
...
|
|
2702
|
+
...f
|
|
2678
2703
|
},
|
|
2679
2704
|
sxSlot: N
|
|
2680
2705
|
}), U = b({
|
|
2681
2706
|
baseClassName: "flex items-center justify-between px-5 pt-5 pb-3 shrink-0",
|
|
2682
|
-
sxSlot:
|
|
2683
|
-
}),
|
|
2707
|
+
sxSlot: _.header
|
|
2708
|
+
}), j = b({
|
|
2684
2709
|
baseClassName: "text-lg font-bold text-[var(--foreground)]",
|
|
2685
|
-
sxSlot:
|
|
2686
|
-
}), F = b({
|
|
2687
|
-
baseClassName: "cursor-pointer p-1 rounded-md hover:bg-[var(--muted)] transition-colors text-[var(--muted-foreground)]",
|
|
2688
|
-
sxSlot: P.closeBtn
|
|
2710
|
+
sxSlot: _.title
|
|
2689
2711
|
}), B = b({
|
|
2712
|
+
baseClassName: "cursor-pointer p-1 rounded-md hover:bg-[var(--muted)] transition-colors text-[var(--muted-foreground)]",
|
|
2713
|
+
sxSlot: _.closeBtn
|
|
2714
|
+
}), M = b({
|
|
2690
2715
|
baseClassName: "flex-1 overflow-auto overscroll-contain px-5 py-2 text-[var(--foreground)]",
|
|
2691
|
-
sxSlot:
|
|
2692
|
-
}),
|
|
2716
|
+
sxSlot: _.content
|
|
2717
|
+
}), F = b({
|
|
2693
2718
|
baseClassName: "flex justify-end gap-2 px-5 py-4 border-t border-[var(--border)] shrink-0",
|
|
2694
|
-
sxSlot:
|
|
2695
|
-
}),
|
|
2696
|
-
|
|
2697
|
-
}, 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" }) }),
|
|
2719
|
+
sxSlot: _.footer
|
|
2720
|
+
}), H = (R) => {
|
|
2721
|
+
P && R.target === R.currentTarget && a();
|
|
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 = O != null && O.length ? O : [
|
|
2698
2723
|
{ key: "cancel", text: $.cancelText, onClick: a },
|
|
2699
2724
|
{ key: "ok", text: $.okText, onClick: i || a }
|
|
2700
2725
|
];
|
|
2701
|
-
return
|
|
2726
|
+
return C ? /* @__PURE__ */ s(
|
|
2702
2727
|
"div",
|
|
2703
2728
|
{
|
|
2704
2729
|
className: T.className,
|
|
@@ -2708,19 +2733,19 @@ function Tr(e) {
|
|
|
2708
2733
|
opacity: y ? 1 : 0,
|
|
2709
2734
|
transition: "opacity 300ms ease-in-out"
|
|
2710
2735
|
},
|
|
2711
|
-
onClick:
|
|
2736
|
+
onClick: H,
|
|
2712
2737
|
role: "dialog",
|
|
2713
2738
|
"aria-modal": "true",
|
|
2714
2739
|
"aria-label": $.title,
|
|
2715
|
-
...
|
|
2716
|
-
children: /* @__PURE__ */
|
|
2717
|
-
/* @__PURE__ */
|
|
2718
|
-
/* @__PURE__ */ s("h3", { className:
|
|
2740
|
+
...S,
|
|
2741
|
+
children: /* @__PURE__ */ L("div", { className: k.className, style: k.style, children: [
|
|
2742
|
+
/* @__PURE__ */ L("div", { className: U.className, style: U.style, children: [
|
|
2743
|
+
/* @__PURE__ */ s("h3", { className: j.className, style: j.style, children: $.title }),
|
|
2719
2744
|
/* @__PURE__ */ s(
|
|
2720
2745
|
"div",
|
|
2721
2746
|
{
|
|
2722
|
-
className:
|
|
2723
|
-
style:
|
|
2747
|
+
className: B.className,
|
|
2748
|
+
style: B.style,
|
|
2724
2749
|
onClick: a,
|
|
2725
2750
|
role: "button",
|
|
2726
2751
|
tabIndex: 0,
|
|
@@ -2732,17 +2757,17 @@ function Tr(e) {
|
|
|
2732
2757
|
}
|
|
2733
2758
|
)
|
|
2734
2759
|
] }),
|
|
2735
|
-
/* @__PURE__ */ s("div", { className:
|
|
2736
|
-
/* @__PURE__ */ s("div", { className:
|
|
2737
|
-
const
|
|
2760
|
+
/* @__PURE__ */ s("div", { className: M.className, style: M.style, children: o }),
|
|
2761
|
+
/* @__PURE__ */ s("div", { className: F.className, style: F.style, children: G.map((R) => {
|
|
2762
|
+
const Q = R.key === "ok";
|
|
2738
2763
|
return /* @__PURE__ */ s(
|
|
2739
|
-
|
|
2764
|
+
ie,
|
|
2740
2765
|
{
|
|
2741
2766
|
onClick: R.onClick,
|
|
2742
2767
|
type: "default",
|
|
2743
|
-
outline: !
|
|
2768
|
+
outline: !Q,
|
|
2744
2769
|
size: "medium",
|
|
2745
|
-
style:
|
|
2770
|
+
style: Q ? {
|
|
2746
2771
|
backgroundColor: "var(--drawer-ok-bg)",
|
|
2747
2772
|
color: "var(--drawer-ok-fg)",
|
|
2748
2773
|
borderColor: "var(--drawer-ok-bg)"
|
|
@@ -2783,7 +2808,7 @@ Tr.propTypes = {
|
|
|
2783
2808
|
),
|
|
2784
2809
|
localeText: t.object
|
|
2785
2810
|
};
|
|
2786
|
-
const kr = ["root", "text"],
|
|
2811
|
+
const kr = ["root", "text"], Nt = {
|
|
2787
2812
|
small: "my-0.5",
|
|
2788
2813
|
medium: "my-1.5",
|
|
2789
2814
|
large: "my-2.5",
|
|
@@ -2797,7 +2822,7 @@ function Lr(e, o) {
|
|
|
2797
2822
|
size: l = "medium",
|
|
2798
2823
|
children: a,
|
|
2799
2824
|
...i
|
|
2800
|
-
} = e, u =
|
|
2825
|
+
} = e, u = W(r, kr), h = Nt[l] || Nt.medium, d = !!a, p = b({
|
|
2801
2826
|
baseClassName: E(
|
|
2802
2827
|
"flex items-center justify-center relative w-full",
|
|
2803
2828
|
h
|
|
@@ -2806,52 +2831,58 @@ function Lr(e, o) {
|
|
|
2806
2831
|
sxSlot: u.root,
|
|
2807
2832
|
baseStyle: {},
|
|
2808
2833
|
style: n
|
|
2809
|
-
}),
|
|
2834
|
+
}), f = b({
|
|
2810
2835
|
baseClassName: "px-2 whitespace-nowrap z-[1]",
|
|
2811
2836
|
sxSlot: u.text
|
|
2812
2837
|
});
|
|
2813
|
-
return
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
}
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2838
|
+
return (
|
|
2839
|
+
// 原因:Line 渲染为 <div>,在 <p> 标签内使用会导致 HTML 嵌套错误(浏览器会自动关闭 <p>)
|
|
2840
|
+
// 导致的问题:universal 页面出现 "<p> 标签内部不能嵌套 <div> 标签" 的 HTML 嵌套错误
|
|
2841
|
+
// 解决办法:将外层容器从 <div> 改为 <span>(phrasing content),内部用 flex 布局保持视觉效果
|
|
2842
|
+
// fixed by clayw on 20260523 night
|
|
2843
|
+
/* @__PURE__ */ L(
|
|
2844
|
+
"span",
|
|
2845
|
+
{
|
|
2846
|
+
ref: o,
|
|
2847
|
+
className: p.className,
|
|
2848
|
+
style: { ...p.style, display: "flex", alignItems: "center", justifyContent: "center" },
|
|
2849
|
+
...i,
|
|
2850
|
+
children: [
|
|
2851
|
+
/* @__PURE__ */ s(
|
|
2852
|
+
"span",
|
|
2853
|
+
{
|
|
2854
|
+
className: `flex-1 h-px bg-[var(--line-color)] ${d ? "mr-2.5" : ""}`
|
|
2855
|
+
}
|
|
2856
|
+
),
|
|
2857
|
+
d && /* @__PURE__ */ s("span", { className: f.className, style: f.style, children: a }),
|
|
2858
|
+
/* @__PURE__ */ s(
|
|
2859
|
+
"span",
|
|
2860
|
+
{
|
|
2861
|
+
className: `flex-1 h-px bg-[var(--line-color)] ${d ? "ml-2.5" : ""}`
|
|
2862
|
+
}
|
|
2863
|
+
)
|
|
2864
|
+
]
|
|
2865
|
+
}
|
|
2866
|
+
)
|
|
2836
2867
|
);
|
|
2837
2868
|
}
|
|
2838
|
-
const
|
|
2839
|
-
|
|
2840
|
-
|
|
2869
|
+
const $t = te.forwardRef(Lr);
|
|
2870
|
+
$t.displayName = "Line";
|
|
2871
|
+
$t.propTypes = {
|
|
2841
2872
|
size: t.oneOf(["small", "medium", "large", "huge"]),
|
|
2842
2873
|
sx: t.oneOfType([t.string, t.object]),
|
|
2843
2874
|
style: t.object,
|
|
2844
2875
|
className: t.string,
|
|
2845
2876
|
children: t.node
|
|
2846
2877
|
};
|
|
2847
|
-
const Pr = ["root"],
|
|
2878
|
+
const Pr = ["root"], wt = {
|
|
2848
2879
|
default: "bg-[var(--mark-default-bg)]",
|
|
2849
2880
|
primary: "bg-[var(--mark-primary-bg)]",
|
|
2850
2881
|
success: "bg-[var(--mark-success-bg)]",
|
|
2851
2882
|
warning: "bg-[var(--mark-warning-bg)]",
|
|
2852
2883
|
danger: "bg-[var(--mark-danger-bg)]"
|
|
2853
2884
|
};
|
|
2854
|
-
function
|
|
2885
|
+
function Or(e, o) {
|
|
2855
2886
|
const {
|
|
2856
2887
|
sx: r = {},
|
|
2857
2888
|
style: n = {},
|
|
@@ -2860,7 +2891,7 @@ function _r(e, o) {
|
|
|
2860
2891
|
beauty: a = !1,
|
|
2861
2892
|
children: i,
|
|
2862
2893
|
...u
|
|
2863
|
-
} = e, h =
|
|
2894
|
+
} = e, h = W(r, Pr), d = wt[l] || wt.default, p = b({
|
|
2864
2895
|
baseClassName: E(
|
|
2865
2896
|
"inline-block",
|
|
2866
2897
|
d,
|
|
@@ -2882,9 +2913,9 @@ function _r(e, o) {
|
|
|
2882
2913
|
}
|
|
2883
2914
|
);
|
|
2884
2915
|
}
|
|
2885
|
-
const
|
|
2886
|
-
|
|
2887
|
-
|
|
2916
|
+
const Bt = te.forwardRef(Or);
|
|
2917
|
+
Bt.displayName = "Mark";
|
|
2918
|
+
Bt.propTypes = {
|
|
2888
2919
|
color: t.oneOf(["default", "primary", "success", "warning", "danger"]),
|
|
2889
2920
|
beauty: t.bool,
|
|
2890
2921
|
sx: t.oneOfType([t.string, t.object]),
|
|
@@ -2892,7 +2923,7 @@ $t.propTypes = {
|
|
|
2892
2923
|
className: t.string,
|
|
2893
2924
|
children: t.node
|
|
2894
2925
|
};
|
|
2895
|
-
const
|
|
2926
|
+
const _r = ["overlay", "container", "header", "title", "closeBtn", "content", "footer"], _e = {
|
|
2896
2927
|
title: "基础标题",
|
|
2897
2928
|
okText: "确定",
|
|
2898
2929
|
cancelText: "取消",
|
|
@@ -2912,37 +2943,38 @@ function Ar(e) {
|
|
|
2912
2943
|
sx: h = {},
|
|
2913
2944
|
style: d = {},
|
|
2914
2945
|
className: p = "",
|
|
2915
|
-
maskClosable:
|
|
2916
|
-
footerButtons:
|
|
2917
|
-
localeText:
|
|
2946
|
+
maskClosable: f = !0,
|
|
2947
|
+
footerButtons: w,
|
|
2948
|
+
localeText: P = {},
|
|
2918
2949
|
...O
|
|
2919
|
-
} = e, { t:
|
|
2920
|
-
|
|
2950
|
+
} = e, { t: D } = de(), [S, v] = Z(!1), [x, C] = Z(!1);
|
|
2951
|
+
ae(() => {
|
|
2921
2952
|
if (l) {
|
|
2922
|
-
|
|
2923
|
-
const
|
|
2924
|
-
return () => clearTimeout(
|
|
2953
|
+
v(!0);
|
|
2954
|
+
const F = setTimeout(() => C(!0), 30);
|
|
2955
|
+
return () => clearTimeout(F);
|
|
2925
2956
|
}
|
|
2926
|
-
if (
|
|
2927
|
-
|
|
2928
|
-
const
|
|
2929
|
-
return () => clearTimeout(
|
|
2957
|
+
if (S) {
|
|
2958
|
+
C(!1);
|
|
2959
|
+
const F = setTimeout(() => v(!1), 300);
|
|
2960
|
+
return () => clearTimeout(F);
|
|
2930
2961
|
}
|
|
2931
|
-
}, [l]),
|
|
2932
|
-
if (
|
|
2933
|
-
const
|
|
2934
|
-
return document.body.style.overflow = "hidden", () => {
|
|
2935
|
-
document.body.
|
|
2962
|
+
}, [l]), ae(() => {
|
|
2963
|
+
if (S) {
|
|
2964
|
+
const F = parseInt(document.body.dataset.tangoScrollLock || "0", 10);
|
|
2965
|
+
return F === 0 && (document.body.dataset.tangoOriginalOverflow = document.body.style.overflow), document.body.dataset.tangoScrollLock = String(F + 1), document.body.style.overflow = "hidden", () => {
|
|
2966
|
+
const H = parseInt(document.body.dataset.tangoScrollLock || "0", 10);
|
|
2967
|
+
H <= 1 ? (document.body.style.overflow = document.body.dataset.tangoOriginalOverflow || "", delete document.body.dataset.tangoOriginalOverflow, delete document.body.dataset.tangoScrollLock) : document.body.dataset.tangoScrollLock = String(H - 1);
|
|
2936
2968
|
};
|
|
2937
2969
|
}
|
|
2938
|
-
}, [
|
|
2970
|
+
}, [S]);
|
|
2939
2971
|
const m = {
|
|
2940
|
-
title: r ??
|
|
2941
|
-
okText: n ??
|
|
2942
|
-
cancelText: c ??
|
|
2943
|
-
closeAriaLabel:
|
|
2944
|
-
...
|
|
2945
|
-
}, y =
|
|
2972
|
+
title: r ?? D("modal.title", _e.title),
|
|
2973
|
+
okText: n ?? D("modal.okText", _e.okText),
|
|
2974
|
+
cancelText: c ?? D("modal.cancelText", _e.cancelText),
|
|
2975
|
+
closeAriaLabel: D("modal.closeAriaLabel", _e.closeAriaLabel),
|
|
2976
|
+
...P
|
|
2977
|
+
}, y = W(h, _r), z = b({
|
|
2946
2978
|
baseClassName: "fixed inset-0 z-[999] flex justify-center items-center",
|
|
2947
2979
|
sxSlot: y.overlay
|
|
2948
2980
|
}), A = {
|
|
@@ -2961,7 +2993,7 @@ function Ar(e) {
|
|
|
2961
2993
|
...d
|
|
2962
2994
|
},
|
|
2963
2995
|
sxSlot: A
|
|
2964
|
-
}),
|
|
2996
|
+
}), _ = b({
|
|
2965
2997
|
baseClassName: "flex items-center justify-between px-5 pt-5 pb-3 shrink-0",
|
|
2966
2998
|
sxSlot: y.header
|
|
2967
2999
|
}), T = b({
|
|
@@ -2970,35 +3002,35 @@ function Ar(e) {
|
|
|
2970
3002
|
}), N = b({
|
|
2971
3003
|
baseClassName: "cursor-pointer p-1 rounded-md hover:bg-[var(--muted)] transition-colors text-[var(--muted-foreground)]",
|
|
2972
3004
|
sxSlot: y.closeBtn
|
|
2973
|
-
}),
|
|
3005
|
+
}), k = b({
|
|
2974
3006
|
baseClassName: "flex-1 overflow-auto overscroll-contain px-6 py-5 text-[var(--foreground)]",
|
|
2975
3007
|
sxSlot: y.content
|
|
2976
3008
|
}), U = b({
|
|
2977
3009
|
baseClassName: "flex justify-end gap-2 px-5 py-4 border-t border-[var(--border)] shrink-0",
|
|
2978
3010
|
sxSlot: y.footer
|
|
2979
|
-
}),
|
|
2980
|
-
|
|
2981
|
-
},
|
|
3011
|
+
}), j = (F) => {
|
|
3012
|
+
f && F.target === F.currentTarget && a();
|
|
3013
|
+
}, B = /* @__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" }) }), M = w != null && w.length ? w : [
|
|
2982
3014
|
{ key: "cancel", text: m.cancelText, onClick: a },
|
|
2983
3015
|
{ key: "ok", text: m.okText, onClick: i || a }
|
|
2984
3016
|
];
|
|
2985
|
-
return
|
|
3017
|
+
return S ? /* @__PURE__ */ s(
|
|
2986
3018
|
"div",
|
|
2987
3019
|
{
|
|
2988
|
-
className:
|
|
3020
|
+
className: z.className,
|
|
2989
3021
|
style: {
|
|
2990
|
-
...
|
|
3022
|
+
...z.style,
|
|
2991
3023
|
backgroundColor: "rgba(0, 0, 0, 0.5)",
|
|
2992
3024
|
opacity: x ? 1 : 0,
|
|
2993
3025
|
transition: "opacity 300ms ease-in-out"
|
|
2994
3026
|
},
|
|
2995
|
-
onClick:
|
|
3027
|
+
onClick: j,
|
|
2996
3028
|
role: "dialog",
|
|
2997
3029
|
"aria-modal": "true",
|
|
2998
3030
|
"aria-label": m.title,
|
|
2999
3031
|
...O,
|
|
3000
|
-
children: /* @__PURE__ */
|
|
3001
|
-
/* @__PURE__ */
|
|
3032
|
+
children: /* @__PURE__ */ L("div", { className: $.className, style: $.style, children: [
|
|
3033
|
+
/* @__PURE__ */ L("div", { className: _.className, style: _.style, children: [
|
|
3002
3034
|
/* @__PURE__ */ s("h3", { className: T.className, style: T.style, children: m.title }),
|
|
3003
3035
|
/* @__PURE__ */ s(
|
|
3004
3036
|
"div",
|
|
@@ -3009,24 +3041,24 @@ function Ar(e) {
|
|
|
3009
3041
|
role: "button",
|
|
3010
3042
|
tabIndex: 0,
|
|
3011
3043
|
"aria-label": m.closeAriaLabel,
|
|
3012
|
-
onKeyDown: (
|
|
3013
|
-
(
|
|
3044
|
+
onKeyDown: (F) => {
|
|
3045
|
+
(F.key === "Enter" || F.key === " ") && a();
|
|
3014
3046
|
},
|
|
3015
|
-
children:
|
|
3047
|
+
children: B
|
|
3016
3048
|
}
|
|
3017
3049
|
)
|
|
3018
3050
|
] }),
|
|
3019
|
-
/* @__PURE__ */ s("div", { className:
|
|
3020
|
-
/* @__PURE__ */ s("div", { className: U.className, style: U.style, children:
|
|
3021
|
-
const
|
|
3051
|
+
/* @__PURE__ */ s("div", { className: k.className, style: k.style, children: o }),
|
|
3052
|
+
/* @__PURE__ */ s("div", { className: U.className, style: U.style, children: M.map((F) => {
|
|
3053
|
+
const H = F.key === "ok";
|
|
3022
3054
|
return /* @__PURE__ */ s(
|
|
3023
|
-
|
|
3055
|
+
ie,
|
|
3024
3056
|
{
|
|
3025
|
-
onClick:
|
|
3057
|
+
onClick: F.onClick,
|
|
3026
3058
|
type: "default",
|
|
3027
|
-
outline: !
|
|
3059
|
+
outline: !H,
|
|
3028
3060
|
size: "medium",
|
|
3029
|
-
style:
|
|
3061
|
+
style: H ? {
|
|
3030
3062
|
backgroundColor: "var(--modal-ok-bg)",
|
|
3031
3063
|
color: "var(--modal-ok-fg)",
|
|
3032
3064
|
borderColor: "var(--modal-ok-bg)"
|
|
@@ -3034,9 +3066,9 @@ function Ar(e) {
|
|
|
3034
3066
|
backgroundColor: "var(--modal-cancel-bg)",
|
|
3035
3067
|
color: "var(--modal-cancel-fg)"
|
|
3036
3068
|
},
|
|
3037
|
-
children:
|
|
3069
|
+
children: F.text
|
|
3038
3070
|
},
|
|
3039
|
-
|
|
3071
|
+
F.key
|
|
3040
3072
|
);
|
|
3041
3073
|
}) })
|
|
3042
3074
|
] })
|
|
@@ -3080,7 +3112,7 @@ const Mr = ["root", "input", "button"], zr = {
|
|
|
3080
3112
|
medium: "small",
|
|
3081
3113
|
large: "medium",
|
|
3082
3114
|
huge: "medium"
|
|
3083
|
-
},
|
|
3115
|
+
}, Ct = {
|
|
3084
3116
|
placeholder: "请输入内容",
|
|
3085
3117
|
btnText: "搜索"
|
|
3086
3118
|
}, Br = (e, o, r) => Object.prototype.hasOwnProperty.call(r, e) ? e : o;
|
|
@@ -3097,9 +3129,9 @@ function Ir(e) {
|
|
|
3097
3129
|
placeholder: h,
|
|
3098
3130
|
btnText: d,
|
|
3099
3131
|
localeText: p,
|
|
3100
|
-
path:
|
|
3101
|
-
...
|
|
3102
|
-
} = e, { t:
|
|
3132
|
+
path: f = "",
|
|
3133
|
+
...w
|
|
3134
|
+
} = e, { t: P } = de(), O = $e(null), D = Br(o, "medium", zr), S = a !== void 0, v = P("search.placeholder", Ct.placeholder), x = P("search.btnText", Ct.btnText), C = h ?? (p == null ? void 0 : p.placeholder) ?? v, m = d ?? (p == null ? void 0 : p.btnText) ?? x, y = W(r, Mr), z = {
|
|
3103
3135
|
tw: E(y.root.tw, y.input.tw),
|
|
3104
3136
|
css: { ...y.root.css, ...y.input.css }
|
|
3105
3137
|
}, A = E("relative inline-flex", y.root.tw), $ = E(
|
|
@@ -3108,53 +3140,58 @@ function Ir(e) {
|
|
|
3108
3140
|
"hover:border-[var(--input-accent)]",
|
|
3109
3141
|
"focus:border-[var(--input-accent)] focus:shadow-[var(--input-focus-shadow)]",
|
|
3110
3142
|
u && "bg-[var(--muted)] text-[var(--muted-foreground)] border-[var(--muted)] cursor-not-allowed shadow-none hover:border-[var(--muted)] focus:shadow-none",
|
|
3111
|
-
Er[
|
|
3112
|
-
),
|
|
3143
|
+
Er[D]
|
|
3144
|
+
), _ = b({
|
|
3113
3145
|
baseClassName: $,
|
|
3114
3146
|
className: c,
|
|
3115
3147
|
style: n,
|
|
3116
|
-
sxSlot:
|
|
3148
|
+
sxSlot: z
|
|
3117
3149
|
}), T = b({
|
|
3118
3150
|
baseClassName: "absolute top-1/2 -translate-y-1/2",
|
|
3119
3151
|
sxSlot: y.button,
|
|
3120
3152
|
style: { right: "calc(var(--spacing) * 2)" }
|
|
3121
|
-
}), N =
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
}, [
|
|
3129
|
-
|
|
3153
|
+
}), N = {
|
|
3154
|
+
right: T.style.right
|
|
3155
|
+
}, k = { ...T.style };
|
|
3156
|
+
delete k.right;
|
|
3157
|
+
const U = oe(() => {
|
|
3158
|
+
var M;
|
|
3159
|
+
return S ? a : ((M = O.current) == null ? void 0 : M.value) ?? "";
|
|
3160
|
+
}, [S, a]), j = oe(() => {
|
|
3161
|
+
l == null || l(U());
|
|
3162
|
+
}, [l, U]), B = oe((M) => {
|
|
3163
|
+
M.key === "Enter" && j();
|
|
3164
|
+
}, [j]);
|
|
3165
|
+
return /* @__PURE__ */ L("div", { className: A, children: [
|
|
3130
3166
|
/* @__PURE__ */ s(
|
|
3131
3167
|
"input",
|
|
3132
3168
|
{
|
|
3133
|
-
ref:
|
|
3134
|
-
className:
|
|
3135
|
-
style:
|
|
3136
|
-
onKeyDown:
|
|
3137
|
-
value:
|
|
3138
|
-
defaultValue:
|
|
3169
|
+
ref: S ? void 0 : O,
|
|
3170
|
+
className: _.className,
|
|
3171
|
+
style: _.style,
|
|
3172
|
+
onKeyDown: B,
|
|
3173
|
+
value: S ? a : void 0,
|
|
3174
|
+
defaultValue: S ? void 0 : i ?? "",
|
|
3139
3175
|
disabled: u || void 0,
|
|
3140
|
-
placeholder:
|
|
3176
|
+
placeholder: C,
|
|
3141
3177
|
type: "text",
|
|
3142
3178
|
role: "searchbox",
|
|
3143
|
-
"aria-label":
|
|
3144
|
-
...
|
|
3179
|
+
"aria-label": C,
|
|
3180
|
+
...w
|
|
3145
3181
|
}
|
|
3146
3182
|
),
|
|
3147
|
-
/* @__PURE__ */ s("div", { className: T.className, style:
|
|
3148
|
-
|
|
3183
|
+
/* @__PURE__ */ s("div", { className: T.className, style: N, children: /* @__PURE__ */ s(
|
|
3184
|
+
ie,
|
|
3149
3185
|
{
|
|
3150
|
-
onClick:
|
|
3151
|
-
size: $r[
|
|
3186
|
+
onClick: j,
|
|
3187
|
+
size: $r[D],
|
|
3152
3188
|
disabled: u,
|
|
3153
3189
|
"aria-label": m,
|
|
3154
|
-
|
|
3190
|
+
style: k,
|
|
3191
|
+
children: f ? /* @__PURE__ */ s(
|
|
3155
3192
|
"img",
|
|
3156
3193
|
{
|
|
3157
|
-
src:
|
|
3194
|
+
src: f,
|
|
3158
3195
|
alt: "search-icon",
|
|
3159
3196
|
style: { width: 16, height: 16, marginTop: 2, marginBottom: -3 }
|
|
3160
3197
|
}
|
|
@@ -3180,7 +3217,7 @@ Ir.propTypes = {
|
|
|
3180
3217
|
}),
|
|
3181
3218
|
path: t.string
|
|
3182
3219
|
};
|
|
3183
|
-
const
|
|
3220
|
+
const It = {
|
|
3184
3221
|
default: "",
|
|
3185
3222
|
inline: "inline-block",
|
|
3186
3223
|
circle: "rounded-full",
|
|
@@ -3189,7 +3226,7 @@ const Bt = {
|
|
|
3189
3226
|
fixed: "fixed",
|
|
3190
3227
|
absolute: "absolute",
|
|
3191
3228
|
relative: "relative"
|
|
3192
|
-
},
|
|
3229
|
+
}, jt = Object.keys(It), jr = ["root"];
|
|
3193
3230
|
function Fr(e, o) {
|
|
3194
3231
|
const {
|
|
3195
3232
|
sx: r = {},
|
|
@@ -3208,8 +3245,8 @@ function Fr(e, o) {
|
|
|
3208
3245
|
*
|
|
3209
3246
|
*/
|
|
3210
3247
|
...i
|
|
3211
|
-
} = e, u =
|
|
3212
|
-
baseClassName:
|
|
3248
|
+
} = e, u = jt.includes(l) ? l : "default", h = W(r, jr), d = b({
|
|
3249
|
+
baseClassName: It[u],
|
|
3213
3250
|
className: c,
|
|
3214
3251
|
sxSlot: h.root
|
|
3215
3252
|
}), p = u === "halfCircle" ? { width: "var(--space-half-circle-w)", height: "var(--space-half-circle-h)", background: "var(--space-half-circle-color)" } : {};
|
|
@@ -3227,15 +3264,15 @@ function Fr(e, o) {
|
|
|
3227
3264
|
)
|
|
3228
3265
|
);
|
|
3229
3266
|
}
|
|
3230
|
-
const
|
|
3231
|
-
|
|
3232
|
-
type: t.oneOf(
|
|
3267
|
+
const Ft = te.forwardRef(Fr);
|
|
3268
|
+
Ft.propTypes = {
|
|
3269
|
+
type: t.oneOf(jt),
|
|
3233
3270
|
sx: t.oneOfType([t.string, t.object]),
|
|
3234
3271
|
style: t.object,
|
|
3235
3272
|
className: t.string,
|
|
3236
3273
|
children: t.node
|
|
3237
3274
|
};
|
|
3238
|
-
|
|
3275
|
+
Ft.displayName = "Space";
|
|
3239
3276
|
const Dr = ["root", "wrapper", "thead", "headerCell", "body", "row", "cell", "empty", "pagination"], ve = {
|
|
3240
3277
|
empty: "暂无数据",
|
|
3241
3278
|
prev: "上一页",
|
|
@@ -3263,34 +3300,34 @@ function Yr(e) {
|
|
|
3263
3300
|
cellClassName: d,
|
|
3264
3301
|
cellStyle: p,
|
|
3265
3302
|
/* hover */
|
|
3266
|
-
hoverColor:
|
|
3303
|
+
hoverColor: f = "",
|
|
3267
3304
|
/* i18n */
|
|
3268
|
-
i18nKey:
|
|
3269
|
-
localeText:
|
|
3305
|
+
i18nKey: w = null,
|
|
3306
|
+
localeText: P = {},
|
|
3270
3307
|
/* 无障碍 */
|
|
3271
3308
|
"aria-label": O,
|
|
3272
|
-
...
|
|
3273
|
-
} = e, { t:
|
|
3309
|
+
...D
|
|
3310
|
+
} = e, { t: S } = de();
|
|
3274
3311
|
o.length === 0 && r.length === 0 && console.warn("[Tango Table] dataSource 和 columns 不能同时为空,请至少提供一项。");
|
|
3275
|
-
const
|
|
3276
|
-
empty:
|
|
3277
|
-
prev:
|
|
3278
|
-
next:
|
|
3279
|
-
page:
|
|
3280
|
-
total:
|
|
3281
|
-
perPage:
|
|
3282
|
-
...
|
|
3283
|
-
}, x = Array.isArray(i) ? i : typeof i == "string" ? [i] : [],
|
|
3284
|
-
() => r.filter((
|
|
3312
|
+
const v = {
|
|
3313
|
+
empty: S("table.empty", ve.empty),
|
|
3314
|
+
prev: S("table.prev", ve.prev),
|
|
3315
|
+
next: S("table.next", ve.next),
|
|
3316
|
+
page: S("table.page", ve.page),
|
|
3317
|
+
total: S("table.total", ve.total),
|
|
3318
|
+
perPage: S("table.perPage", ve.perPage),
|
|
3319
|
+
...P
|
|
3320
|
+
}, x = Array.isArray(i) ? i : typeof i == "string" ? [i] : [], C = Se(
|
|
3321
|
+
() => r.filter((J) => !J.hide && !x.includes(J.dataIndex)),
|
|
3285
3322
|
[r, x]
|
|
3286
|
-
), m = a !== null && a !== !1, y = a && a.placement || "bottom",
|
|
3323
|
+
), m = a !== null && a !== !1, y = a && a.placement || "bottom", z = a && a.pageSize || Rr, A = a && a.pageSizeOptions || Vr, $ = (a == null ? void 0 : a.showTotal) !== !1, _ = (a == null ? void 0 : a.showSizeChanger) !== !1, [T, N] = Z(1), [k, U] = Z(z), j = o.length, B = Math.max(1, Math.ceil(j / k)), M = Math.min(T, B), F = Se(() => {
|
|
3287
3324
|
if (!m) return o;
|
|
3288
|
-
const
|
|
3289
|
-
return o.slice(
|
|
3290
|
-
}, [o,
|
|
3291
|
-
(
|
|
3292
|
-
[
|
|
3293
|
-
), K =
|
|
3325
|
+
const J = (M - 1) * k;
|
|
3326
|
+
return o.slice(J, J + k);
|
|
3327
|
+
}, [o, M, k, m]), H = oe(
|
|
3328
|
+
(J) => N(Math.max(1, Math.min(J, B))),
|
|
3329
|
+
[B]
|
|
3330
|
+
), K = W(n, Dr), G = b({
|
|
3294
3331
|
baseClassName: E(
|
|
3295
3332
|
"w-full overflow-x-auto rounded-xl border border-[var(--border)]",
|
|
3296
3333
|
"shadow-[0_0_20px_color-mix(in_oklch,var(--foreground)_8%,transparent)]"
|
|
@@ -3304,158 +3341,164 @@ function Yr(e) {
|
|
|
3304
3341
|
}), R = b({
|
|
3305
3342
|
baseClassName: "bg-[var(--primary)] text-[var(--primary-foreground)] sticky top-0 z-10",
|
|
3306
3343
|
sxSlot: K.thead
|
|
3307
|
-
}),
|
|
3344
|
+
}), Q = b({
|
|
3308
3345
|
baseClassName: "text-[var(--foreground)]",
|
|
3309
3346
|
sxSlot: K.body
|
|
3310
|
-
}),
|
|
3347
|
+
}), ue = b({
|
|
3311
3348
|
baseClassName: "text-[var(--muted-foreground)] py-16 text-center",
|
|
3312
3349
|
sxSlot: K.empty
|
|
3313
3350
|
}), be = b({
|
|
3314
3351
|
baseClassName: "flex items-center justify-between px-4 py-3 text-sm text-[var(--muted-foreground)] border-t border-[var(--border)]",
|
|
3315
3352
|
sxSlot: K.pagination
|
|
3316
|
-
}),
|
|
3353
|
+
}), ge = f ? /* @__PURE__ */ s("style", { children: `
|
|
3317
3354
|
[data-tango-table-body] tr:hover {
|
|
3318
|
-
background-color: ${
|
|
3355
|
+
background-color: ${f} !important;
|
|
3319
3356
|
transform: translateY(-1px);
|
|
3320
3357
|
box-shadow: 0 2px 8px color-mix(in oklch, var(--foreground) 5%, transparent);
|
|
3321
3358
|
}
|
|
3322
|
-
` }) : null,
|
|
3359
|
+
` }) : null, fe = () => {
|
|
3323
3360
|
if (!m) return null;
|
|
3324
|
-
const
|
|
3325
|
-
return /* @__PURE__ */
|
|
3326
|
-
/* @__PURE__ */
|
|
3327
|
-
$ && /* @__PURE__ */ s("span", { children:
|
|
3328
|
-
|
|
3361
|
+
const J = Array.from({ length: B }, (I, q) => q + 1);
|
|
3362
|
+
return /* @__PURE__ */ L("div", { className: be.className, style: be.style, children: [
|
|
3363
|
+
/* @__PURE__ */ L("div", { className: "flex items-center gap-3", children: [
|
|
3364
|
+
$ && /* @__PURE__ */ s("span", { children: v.total.replace("{total}", String(j)) }),
|
|
3365
|
+
_ && /* @__PURE__ */ s(
|
|
3329
3366
|
"select",
|
|
3330
3367
|
{
|
|
3331
|
-
value:
|
|
3332
|
-
onChange: (
|
|
3333
|
-
U(Number(
|
|
3368
|
+
value: k,
|
|
3369
|
+
onChange: (I) => {
|
|
3370
|
+
U(Number(I.target.value)), N(1);
|
|
3334
3371
|
},
|
|
3335
3372
|
className: "rounded border border-[var(--border)] bg-[var(--background)] px-2 py-1 text-sm cursor-pointer",
|
|
3336
|
-
"aria-label":
|
|
3337
|
-
children: A.map((
|
|
3338
|
-
|
|
3373
|
+
"aria-label": v.perPage,
|
|
3374
|
+
children: A.map((I) => /* @__PURE__ */ L("option", { value: I, children: [
|
|
3375
|
+
I,
|
|
3339
3376
|
" ",
|
|
3340
|
-
|
|
3341
|
-
] },
|
|
3377
|
+
v.perPage
|
|
3378
|
+
] }, I))
|
|
3342
3379
|
}
|
|
3343
3380
|
)
|
|
3344
3381
|
] }),
|
|
3345
|
-
/* @__PURE__ */
|
|
3382
|
+
/* @__PURE__ */ L("div", { className: "flex items-center gap-1", children: [
|
|
3346
3383
|
/* @__PURE__ */ s(
|
|
3347
3384
|
"button",
|
|
3348
3385
|
{
|
|
3349
|
-
|
|
3350
|
-
|
|
3386
|
+
type: "button",
|
|
3387
|
+
onClick: () => H(M - 1),
|
|
3388
|
+
disabled: M <= 1,
|
|
3351
3389
|
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",
|
|
3352
|
-
"aria-label":
|
|
3353
|
-
children:
|
|
3390
|
+
"aria-label": v.prev,
|
|
3391
|
+
children: v.prev
|
|
3354
3392
|
}
|
|
3355
3393
|
),
|
|
3356
|
-
|
|
3394
|
+
J.length <= 7 ? J.map((I) => /* @__PURE__ */ s(
|
|
3357
3395
|
"button",
|
|
3358
3396
|
{
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3397
|
+
type: "button",
|
|
3398
|
+
onClick: () => H(I),
|
|
3399
|
+
className: `min-w-[28px] px-2 py-1 rounded text-xs transition-colors ${I === M ? "bg-[var(--primary)] text-[var(--primary-foreground)] font-medium" : "border border-[var(--border)] hover:bg-[var(--accent)]"}`,
|
|
3400
|
+
children: I
|
|
3362
3401
|
},
|
|
3363
|
-
|
|
3364
|
-
)) : /* @__PURE__ */
|
|
3402
|
+
I
|
|
3403
|
+
)) : /* @__PURE__ */ L(Ne, { children: [
|
|
3365
3404
|
/* @__PURE__ */ s(
|
|
3366
3405
|
"button",
|
|
3367
3406
|
{
|
|
3368
|
-
|
|
3369
|
-
|
|
3407
|
+
type: "button",
|
|
3408
|
+
onClick: () => H(1),
|
|
3409
|
+
className: `min-w-[28px] px-2 py-1 rounded text-xs ${M === 1 ? "bg-[var(--primary)] text-[var(--primary-foreground)] font-medium" : "border border-[var(--border)] hover:bg-[var(--accent)]"} transition-colors`,
|
|
3370
3410
|
children: "1"
|
|
3371
3411
|
}
|
|
3372
3412
|
),
|
|
3373
|
-
|
|
3413
|
+
M > 3 && /* @__PURE__ */ s("span", { className: "px-1 text-xs", children: "…" }),
|
|
3374
3414
|
Array.from(
|
|
3375
|
-
{ length:
|
|
3376
|
-
(
|
|
3377
|
-
).filter((
|
|
3415
|
+
{ length: B },
|
|
3416
|
+
(I, q) => q + 1
|
|
3417
|
+
).filter((I) => I > 1 && I < B && Math.abs(I - M) <= 1).map((I) => /* @__PURE__ */ s(
|
|
3378
3418
|
"button",
|
|
3379
3419
|
{
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3420
|
+
type: "button",
|
|
3421
|
+
onClick: () => H(I),
|
|
3422
|
+
className: `min-w-[28px] px-2 py-1 rounded text-xs ${I === M ? "bg-[var(--primary)] text-[var(--primary-foreground)] font-medium" : "border border-[var(--border)] hover:bg-[var(--accent)]"} transition-colors`,
|
|
3423
|
+
children: I
|
|
3383
3424
|
},
|
|
3384
|
-
|
|
3425
|
+
I
|
|
3385
3426
|
)),
|
|
3386
|
-
|
|
3427
|
+
M < B - 2 && /* @__PURE__ */ s("span", { className: "px-1 text-xs", children: "…" }),
|
|
3387
3428
|
/* @__PURE__ */ s(
|
|
3388
3429
|
"button",
|
|
3389
3430
|
{
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3431
|
+
type: "button",
|
|
3432
|
+
onClick: () => H(B),
|
|
3433
|
+
className: `min-w-[28px] px-2 py-1 rounded text-xs ${M === B ? "bg-[var(--primary)] text-[var(--primary-foreground)] font-medium" : "border border-[var(--border)] hover:bg-[var(--accent)]"} transition-colors`,
|
|
3434
|
+
children: B
|
|
3393
3435
|
}
|
|
3394
3436
|
)
|
|
3395
3437
|
] }),
|
|
3396
3438
|
/* @__PURE__ */ s(
|
|
3397
3439
|
"button",
|
|
3398
3440
|
{
|
|
3399
|
-
|
|
3400
|
-
|
|
3441
|
+
type: "button",
|
|
3442
|
+
onClick: () => H(M + 1),
|
|
3443
|
+
disabled: M >= B,
|
|
3401
3444
|
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",
|
|
3402
|
-
"aria-label":
|
|
3403
|
-
children:
|
|
3445
|
+
"aria-label": v.next,
|
|
3446
|
+
children: v.next
|
|
3404
3447
|
}
|
|
3405
3448
|
)
|
|
3406
3449
|
] })
|
|
3407
3450
|
] });
|
|
3408
|
-
},
|
|
3409
|
-
|
|
3410
|
-
/* @__PURE__ */
|
|
3411
|
-
/* @__PURE__ */ s("thead", { className: R.className, style: R.style, children: /* @__PURE__ */ s("tr", { children:
|
|
3412
|
-
const
|
|
3451
|
+
}, X = (J) => /* @__PURE__ */ L("div", { className: G.className, style: G.style, children: [
|
|
3452
|
+
ge,
|
|
3453
|
+
/* @__PURE__ */ L("table", { className: "w-full border-collapse separate border-spacing-0 text-sm", role: "table", children: [
|
|
3454
|
+
/* @__PURE__ */ s("thead", { className: R.className, style: R.style, children: /* @__PURE__ */ s("tr", { children: C.map((I) => {
|
|
3455
|
+
const q = b({
|
|
3413
3456
|
baseClassName: E(
|
|
3414
3457
|
"px-5 py-4 text-left font-semibold tracking-wide relative",
|
|
3415
3458
|
K.headerCell.tw
|
|
3416
3459
|
),
|
|
3417
|
-
baseStyle:
|
|
3460
|
+
baseStyle: I.width ? { width: I.width } : {},
|
|
3418
3461
|
sxSlot: { tw: "", css: K.headerCell.css }
|
|
3419
3462
|
});
|
|
3420
|
-
return /* @__PURE__ */
|
|
3421
|
-
|
|
3463
|
+
return /* @__PURE__ */ L("th", { className: q.className, style: q.style, children: [
|
|
3464
|
+
I.title,
|
|
3422
3465
|
/* @__PURE__ */ s("span", { className: "absolute right-0 top-[20%] h-[60%] w-px bg-[var(--primary-foreground)]/15 last:hidden" })
|
|
3423
|
-
] },
|
|
3466
|
+
] }, I.key || I.dataIndex);
|
|
3424
3467
|
}) }) }),
|
|
3425
|
-
/* @__PURE__ */ s("tbody", { className:
|
|
3426
|
-
const
|
|
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: C.length, className: ue.className, style: ue.style, children: v.empty }) }) : J.map((I, q) => {
|
|
3469
|
+
const le = q % 2 === 0 ? "even" : "odd", re = E(
|
|
3427
3470
|
"transition-all duration-200",
|
|
3428
|
-
|
|
3471
|
+
le === "even" ? "bg-[color-mix(in_oklch,var(--table-hover)_6%,transparent)]" : "",
|
|
3429
3472
|
"hover:bg-[color-mix(in_oklch,var(--table-hover)_20%,transparent)]",
|
|
3430
3473
|
K.row.tw,
|
|
3431
|
-
Ae(u,
|
|
3432
|
-
),
|
|
3433
|
-
...Ae(h,
|
|
3474
|
+
Ae(u, I, q, le)
|
|
3475
|
+
), se = {
|
|
3476
|
+
...Ae(h, I, q, le),
|
|
3434
3477
|
...K.row.css
|
|
3435
3478
|
};
|
|
3436
|
-
return /* @__PURE__ */ s("tr", { className:
|
|
3437
|
-
const
|
|
3479
|
+
return /* @__PURE__ */ s("tr", { className: re, style: se, children: C.map((g, V) => {
|
|
3480
|
+
const ee = V % 2 === 0 ? "even" : "odd", ce = E(
|
|
3438
3481
|
"px-5 py-3.5 text-left relative",
|
|
3439
3482
|
"border-b border-[color-mix(in_oklch,var(--foreground)_5%,transparent)]",
|
|
3440
3483
|
K.cell.tw,
|
|
3441
|
-
Ae(d,
|
|
3484
|
+
Ae(d, I, g, q, V, le, ee)
|
|
3442
3485
|
), pe = {
|
|
3443
|
-
...
|
|
3444
|
-
...Ae(p,
|
|
3486
|
+
...g.width ? { width: g.width } : {},
|
|
3487
|
+
...Ae(p, I, g, q, V, le, ee),
|
|
3445
3488
|
...K.cell.css
|
|
3446
3489
|
};
|
|
3447
|
-
return /* @__PURE__ */
|
|
3448
|
-
/* @__PURE__ */ s("div", { className: "flex items-center min-h-5", children:
|
|
3490
|
+
return /* @__PURE__ */ L("td", { className: ce, style: pe, children: [
|
|
3491
|
+
/* @__PURE__ */ s("div", { className: "flex items-center min-h-5", children: g.render ? g.render(I[g.dataIndex], I, q) : I[g.dataIndex] }),
|
|
3449
3492
|
/* @__PURE__ */ s("span", { className: "absolute right-0 top-[20%] h-[60%] w-px bg-[color-mix(in_oklch,var(--foreground)_4%,transparent)] last:hidden" })
|
|
3450
|
-
] },
|
|
3451
|
-
}) },
|
|
3493
|
+
] }, g.key || g.dataIndex || V);
|
|
3494
|
+
}) }, I.key || q);
|
|
3452
3495
|
}) })
|
|
3453
3496
|
] })
|
|
3454
3497
|
] });
|
|
3455
|
-
return /* @__PURE__ */
|
|
3456
|
-
m && y === "top" &&
|
|
3457
|
-
|
|
3458
|
-
m && y === "bottom" &&
|
|
3498
|
+
return /* @__PURE__ */ L("div", { role: "region", "aria-label": O || "Table", ...D, children: [
|
|
3499
|
+
m && y === "top" && fe(),
|
|
3500
|
+
X(F),
|
|
3501
|
+
m && y === "bottom" && fe()
|
|
3459
3502
|
] });
|
|
3460
3503
|
}
|
|
3461
3504
|
Yr.propTypes = {
|
|
@@ -3495,7 +3538,7 @@ Yr.propTypes = {
|
|
|
3495
3538
|
i18nKey: t.string,
|
|
3496
3539
|
localeText: t.object
|
|
3497
3540
|
};
|
|
3498
|
-
const Kr = ["root", "tooltip"],
|
|
3541
|
+
const Kr = ["root", "tooltip"], Tt = {
|
|
3499
3542
|
top: "bottom-full left-1/2 -translate-x-1/2 mb-2",
|
|
3500
3543
|
bottom: "top-full left-1/2 -translate-x-1/2 mt-2",
|
|
3501
3544
|
left: "right-full top-1/2 -translate-y-1/2 mr-2",
|
|
@@ -3518,66 +3561,66 @@ function Hr(e, o) {
|
|
|
3518
3561
|
sx: h = {},
|
|
3519
3562
|
style: d = {},
|
|
3520
3563
|
className: p = "",
|
|
3521
|
-
onMouseEnter:
|
|
3522
|
-
onMouseLeave:
|
|
3523
|
-
onFocus:
|
|
3564
|
+
onMouseEnter: f,
|
|
3565
|
+
onMouseLeave: w,
|
|
3566
|
+
onFocus: P,
|
|
3524
3567
|
onBlur: O,
|
|
3525
|
-
...
|
|
3526
|
-
} = e, [
|
|
3527
|
-
x ||
|
|
3528
|
-
}, [x, i]), y =
|
|
3568
|
+
...D
|
|
3569
|
+
} = e, [S, v] = Z(a), x = l !== void 0, C = x ? l : S, m = oe((k) => {
|
|
3570
|
+
x || v(k), i == null || i(k);
|
|
3571
|
+
}, [x, i]), y = Tt[c] ? c : "top", z = W(h, Kr), A = b({
|
|
3529
3572
|
baseClassName: "relative inline-flex",
|
|
3530
|
-
sxSlot:
|
|
3573
|
+
sxSlot: z.root
|
|
3531
3574
|
}), $ = b({
|
|
3532
3575
|
baseClassName: E(
|
|
3533
3576
|
"absolute z-50 whitespace-nowrap px-3 py-1.5 text-sm",
|
|
3534
3577
|
"bg-[var(--tooltip-background)] text-[var(--tooltip-foreground)]",
|
|
3535
3578
|
"shadow-[var(--tooltip-shadow)]",
|
|
3536
|
-
|
|
3579
|
+
Tt[y]
|
|
3537
3580
|
),
|
|
3538
3581
|
className: p,
|
|
3539
3582
|
baseStyle: { borderRadius: "var(--tooltip-radius)" },
|
|
3540
|
-
sxSlot:
|
|
3583
|
+
sxSlot: z.tooltip,
|
|
3541
3584
|
style: d
|
|
3542
|
-
}),
|
|
3585
|
+
}), _ = {
|
|
3543
3586
|
position: "absolute",
|
|
3544
3587
|
width: "10px",
|
|
3545
3588
|
height: "10px",
|
|
3546
3589
|
backgroundColor: "inherit",
|
|
3547
3590
|
...Ur[y]
|
|
3548
3591
|
}, T = () => !u && m(!0), N = () => !u && m(!1);
|
|
3549
|
-
return /* @__PURE__ */
|
|
3592
|
+
return /* @__PURE__ */ L(
|
|
3550
3593
|
"div",
|
|
3551
3594
|
{
|
|
3552
3595
|
ref: o,
|
|
3553
3596
|
className: A.className,
|
|
3554
3597
|
style: A.style,
|
|
3555
|
-
onMouseEnter: (
|
|
3556
|
-
T(),
|
|
3598
|
+
onMouseEnter: (k) => {
|
|
3599
|
+
T(), f == null || f(k);
|
|
3557
3600
|
},
|
|
3558
|
-
onMouseLeave: (
|
|
3559
|
-
N(),
|
|
3601
|
+
onMouseLeave: (k) => {
|
|
3602
|
+
N(), w == null || w(k);
|
|
3560
3603
|
},
|
|
3561
|
-
onFocus: (
|
|
3562
|
-
T(),
|
|
3604
|
+
onFocus: (k) => {
|
|
3605
|
+
T(), P == null || P(k);
|
|
3563
3606
|
},
|
|
3564
|
-
onBlur: (
|
|
3565
|
-
N(), O == null || O(
|
|
3607
|
+
onBlur: (k) => {
|
|
3608
|
+
N(), O == null || O(k);
|
|
3566
3609
|
},
|
|
3567
|
-
...
|
|
3610
|
+
...D,
|
|
3568
3611
|
children: [
|
|
3569
3612
|
r,
|
|
3570
|
-
|
|
3613
|
+
C && n && /* @__PURE__ */ L("div", { role: "tooltip", className: $.className, style: $.style, children: [
|
|
3571
3614
|
/* @__PURE__ */ s("span", { style: { position: "relative", zIndex: 1 }, children: n }),
|
|
3572
|
-
/* @__PURE__ */ s("span", { style:
|
|
3615
|
+
/* @__PURE__ */ s("span", { style: _ })
|
|
3573
3616
|
] })
|
|
3574
3617
|
]
|
|
3575
3618
|
}
|
|
3576
3619
|
);
|
|
3577
3620
|
}
|
|
3578
|
-
const
|
|
3579
|
-
|
|
3580
|
-
|
|
3621
|
+
const Dt = te.forwardRef(Hr);
|
|
3622
|
+
Dt.displayName = "Tooltip";
|
|
3623
|
+
Dt.propTypes = {
|
|
3581
3624
|
children: t.node,
|
|
3582
3625
|
title: t.node,
|
|
3583
3626
|
placement: t.oneOf(["top", "bottom", "left", "right"]),
|
|
@@ -3593,7 +3636,7 @@ Ft.propTypes = {
|
|
|
3593
3636
|
onFocus: t.func,
|
|
3594
3637
|
onBlur: t.func
|
|
3595
3638
|
};
|
|
3596
|
-
|
|
3639
|
+
ie.MaterialButton = Ze;
|
|
3597
3640
|
Xe.MaterialInput = Ge;
|
|
3598
3641
|
ne.Header = Xo;
|
|
3599
3642
|
ne.Footer = qo;
|
|
@@ -3602,18 +3645,18 @@ ne.Content = Qo;
|
|
|
3602
3645
|
ne.Toc = er;
|
|
3603
3646
|
export {
|
|
3604
3647
|
sr as Banner,
|
|
3605
|
-
|
|
3648
|
+
ie as Button,
|
|
3606
3649
|
dr as ColorPicker,
|
|
3607
3650
|
Qo as Content,
|
|
3608
|
-
|
|
3651
|
+
fr as DateDisplay,
|
|
3609
3652
|
xr as DatePicker,
|
|
3610
3653
|
Tr as Drawer,
|
|
3611
3654
|
qo as Footer,
|
|
3612
3655
|
Xo as Header,
|
|
3613
3656
|
Xe as Input,
|
|
3614
3657
|
ne as Layout,
|
|
3615
|
-
|
|
3616
|
-
|
|
3658
|
+
$t as Line,
|
|
3659
|
+
Bt as Mark,
|
|
3617
3660
|
Ze as MaterialButton,
|
|
3618
3661
|
Ge as MaterialInput,
|
|
3619
3662
|
Ar as Modal,
|
|
@@ -3621,28 +3664,28 @@ export {
|
|
|
3621
3664
|
es as NoticeProvider,
|
|
3622
3665
|
Ir as Search,
|
|
3623
3666
|
Jo as Sider,
|
|
3624
|
-
|
|
3667
|
+
Ft as Space,
|
|
3625
3668
|
Yr as Table,
|
|
3626
3669
|
sr as TangoBanner,
|
|
3627
3670
|
dr as TangoColorPicker,
|
|
3628
|
-
|
|
3671
|
+
fr as TangoDate,
|
|
3629
3672
|
xr as TangoDatePicker,
|
|
3630
3673
|
Tr as TangoDrawer,
|
|
3631
3674
|
os as TangoI18nProvider,
|
|
3632
3675
|
Ar as TangoModal,
|
|
3633
3676
|
We as TangoNotice,
|
|
3634
3677
|
Ir as TangoSearch,
|
|
3635
|
-
|
|
3678
|
+
Dt as TangoTooltip,
|
|
3636
3679
|
Jr as ThemeProvider,
|
|
3637
3680
|
er as Toc,
|
|
3638
|
-
|
|
3681
|
+
Dt as Tooltip,
|
|
3639
3682
|
qe as Upload,
|
|
3640
3683
|
b as createSlotProps,
|
|
3641
3684
|
E as mergeTwClassNames,
|
|
3642
|
-
|
|
3685
|
+
W as normalizeSxSlots,
|
|
3643
3686
|
ze as normalizeTangoLocale,
|
|
3644
3687
|
ts as useNotice,
|
|
3645
|
-
|
|
3688
|
+
de as useTangoI18n,
|
|
3646
3689
|
Me as useTangoStyle,
|
|
3647
3690
|
Qr as useTheme
|
|
3648
3691
|
};
|