tango-ui-cw 0.9.8 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +124 -39
- package/dist/component/CSSFab/index.d.ts +55 -0
- package/dist/component/CSSFab/useTangoStyle.d.ts +1 -0
- package/dist/component/TBanner/index.d.ts +50 -0
- package/dist/component/TButton/index.d.ts +107 -0
- package/dist/component/TColorPicker/index.d.ts +41 -0
- package/dist/component/TDate/index.d.ts +41 -0
- package/dist/component/TDatePicker/index.d.ts +49 -0
- package/dist/component/TDrawer/index.d.ts +58 -0
- package/dist/component/TInput/index.d.ts +81 -0
- package/dist/component/TLayout/index.d.ts +133 -0
- package/dist/component/TLine/index.d.ts +33 -0
- package/dist/component/TMark/index.d.ts +38 -0
- package/dist/component/TModal/index.d.ts +52 -0
- package/dist/component/TNotice/index.d.ts +30 -0
- package/dist/component/TSearch/index.d.ts +42 -0
- package/dist/component/TSpace/index.d.ts +56 -0
- package/dist/component/TTable/index.d.ts +76 -0
- package/dist/component/TTooltip/index.d.ts +31 -0
- package/dist/component/TUpload/index.d.ts +45 -0
- package/dist/component/index.d.ts +147 -0
- package/dist/index.cjs +12 -0
- package/dist/index.d.cts +18 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.js +3648 -2
- package/dist/providers/NoticeProvider/NoticeProvider.d.ts +19 -0
- package/dist/providers/TangoI18nProvider/TangoI18nProvider.d.ts +28 -0
- package/dist/providers/ThemeProvider/ThemeProvider.d.ts +22 -0
- package/dist/scripts/check-peers.js +75 -0
- package/dist/styles/global.css +372 -0
- package/dist/styles/theme.css +13 -0
- package/package.json +65 -48
- package/dist/assets/Upload/delLogo.png.js +0 -1
- package/dist/assets/Upload/delLogo.png.mjs +0 -4
- package/dist/assets/Upload/fileslogo.png.js +0 -1
- package/dist/assets/Upload/fileslogo.png.mjs +0 -4
- package/dist/component/CSSFab/useTangoStyle.js +0 -2
- package/dist/component/CSSFab/useTangoStyle.mjs +0 -171
- package/dist/component/MaterialButton/MaterialButton.module.css.js +0 -1
- package/dist/component/MaterialButton/MaterialButton.module.css.mjs +0 -17
- package/dist/component/MaterialButton/index.js +0 -2
- package/dist/component/MaterialButton/index.mjs +0 -62
- package/dist/component/MaterialInput/MaterialInput.module.css.js +0 -1
- package/dist/component/MaterialInput/MaterialInput.module.css.mjs +0 -17
- package/dist/component/MaterialInput/index.js +0 -2
- package/dist/component/MaterialInput/index.mjs +0 -37
- package/dist/component/TBanner/TBanner.module.css.js +0 -1
- package/dist/component/TBanner/TBanner.module.css.mjs +0 -35
- package/dist/component/TBanner/index.js +0 -2
- package/dist/component/TBanner/index.mjs +0 -341
- package/dist/component/TButton/TButton.module.css.js +0 -1
- package/dist/component/TButton/TButton.module.css.mjs +0 -26
- package/dist/component/TButton/index.js +0 -2
- package/dist/component/TButton/index.mjs +0 -186
- package/dist/component/TColorPicker/TColorPicker.module.css.js +0 -1
- package/dist/component/TColorPicker/TColorPicker.module.css.mjs +0 -13
- package/dist/component/TColorPicker/index.js +0 -2
- package/dist/component/TColorPicker/index.mjs +0 -62
- package/dist/component/TDate/index.js +0 -2
- package/dist/component/TDate/index.mjs +0 -145
- package/dist/component/TDatePicker/TDatePicker.module.css.js +0 -1
- package/dist/component/TDatePicker/TDatePicker.module.css.mjs +0 -45
- package/dist/component/TDatePicker/index.js +0 -2
- package/dist/component/TDatePicker/index.mjs +0 -167
- package/dist/component/TDrawer/TDrawer.module.css.js +0 -1
- package/dist/component/TDrawer/TDrawer.module.css.mjs +0 -49
- package/dist/component/TDrawer/index.js +0 -2
- package/dist/component/TDrawer/index.mjs +0 -111
- package/dist/component/TInput/TInput.module.css.js +0 -1
- package/dist/component/TInput/TInput.module.css.mjs +0 -21
- package/dist/component/TInput/index.js +0 -2
- package/dist/component/TInput/index.mjs +0 -75
- package/dist/component/TLayout/index.js +0 -2
- package/dist/component/TLayout/index.mjs +0 -53
- package/dist/component/TLine/TLine.module.css.js +0 -1
- package/dist/component/TLine/TLine.module.css.mjs +0 -19
- package/dist/component/TLine/index.js +0 -2
- package/dist/component/TLine/index.mjs +0 -35
- package/dist/component/TMark/TMark.module.css.js +0 -1
- package/dist/component/TMark/TMark.module.css.mjs +0 -7
- package/dist/component/TMark/index.js +0 -2
- package/dist/component/TMark/index.mjs +0 -52
- package/dist/component/TModal/TModal.module.css.js +0 -1
- package/dist/component/TModal/TModal.module.css.mjs +0 -33
- package/dist/component/TModal/index.js +0 -2
- package/dist/component/TModal/index.mjs +0 -110
- package/dist/component/TNotice/TNotice.module.css.js +0 -1
- package/dist/component/TNotice/TNotice.module.css.mjs +0 -27
- package/dist/component/TNotice/index.js +0 -4
- package/dist/component/TNotice/index.mjs +0 -40
- package/dist/component/TNotice/useNotice.js +0 -2
- package/dist/component/TNotice/useNotice.mjs +0 -19
- package/dist/component/TSearch/TSearch.module.css.js +0 -1
- package/dist/component/TSearch/TSearch.module.css.mjs +0 -21
- package/dist/component/TSearch/index.js +0 -2
- package/dist/component/TSearch/index.mjs +0 -73
- package/dist/component/TSpace/TSpace.module.css.js +0 -1
- package/dist/component/TSpace/TSpace.module.css.mjs +0 -23
- package/dist/component/TSpace/index.js +0 -2
- package/dist/component/TSpace/index.mjs +0 -49
- package/dist/component/TTable/TTable.module.css.js +0 -1
- package/dist/component/TTable/TTable.module.css.mjs +0 -25
- package/dist/component/TTable/index.js +0 -8
- package/dist/component/TTable/index.mjs +0 -154
- package/dist/component/TTooltip/TTooltip.module.css.js +0 -1
- package/dist/component/TTooltip/TTooltip.module.css.mjs +0 -17
- package/dist/component/TTooltip/index.js +0 -2
- package/dist/component/TTooltip/index.mjs +0 -34
- package/dist/component/TUpload/TUpload.module.css.js +0 -1
- package/dist/component/TUpload/TUpload.module.css.mjs +0 -15
- package/dist/component/TUpload/index.js +0 -2
- package/dist/component/TUpload/index.mjs +0 -152
- package/dist/index.mjs +0 -50
- package/dist/providers/NoticeProvider.js +0 -2
- package/dist/providers/NoticeProvider.mjs +0 -117
- package/dist/providers/ThemeProvider.js +0 -2
- package/dist/providers/ThemeProvider.mjs +0 -21
- package/dist/tango-ui-cw.css +0 -1
package/dist/index.js
CHANGED
|
@@ -1,2 +1,3648 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as s, jsxs as k, Fragment as Ne } from "react/jsx-runtime";
|
|
3
|
+
import Q, { useState as G, useRef as $e, useEffect as le, useContext as Ue, createContext as He, forwardRef as Tt, useCallback as oe, useMemo as Se, useId as Yt } from "react";
|
|
4
|
+
import { createPortal as Kt } from "react-dom";
|
|
5
|
+
import t from "prop-types";
|
|
6
|
+
import { twMerge as Ut } from "tailwind-merge";
|
|
7
|
+
const Qe = "tango:theme", et = "tango:themeTokens", Ht = "light", Wt = [
|
|
8
|
+
"primary",
|
|
9
|
+
"input-accent",
|
|
10
|
+
"modal-ok-bg",
|
|
11
|
+
"drawer-ok-bg",
|
|
12
|
+
"datepicker-confirm-bg"
|
|
13
|
+
], kt = He(null), Lt = () => typeof window < "u", tt = (e, o) => {
|
|
14
|
+
if (!Lt())
|
|
15
|
+
return o;
|
|
16
|
+
try {
|
|
17
|
+
const r = window.localStorage.getItem(e);
|
|
18
|
+
return r ? JSON.parse(r) : o;
|
|
19
|
+
} catch {
|
|
20
|
+
return o;
|
|
21
|
+
}
|
|
22
|
+
}, ot = (e, o) => {
|
|
23
|
+
if (Lt())
|
|
24
|
+
try {
|
|
25
|
+
window.localStorage.setItem(e, JSON.stringify(o));
|
|
26
|
+
} catch {
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
function Jr({ children: e }) {
|
|
30
|
+
const [o, r] = G(() => tt(Qe, Ht) === "dark" ? "dark" : "light"), [n, c] = G(
|
|
31
|
+
() => tt(et, {})
|
|
32
|
+
), l = $e(/* @__PURE__ */ new Set());
|
|
33
|
+
le(() => {
|
|
34
|
+
typeof document > "u" || (document.documentElement.dataset.theme = o);
|
|
35
|
+
}, [o]), le(() => {
|
|
36
|
+
ot(Qe, o);
|
|
37
|
+
}, [o]), le(() => {
|
|
38
|
+
if (typeof document > "u")
|
|
39
|
+
return;
|
|
40
|
+
const d = document.documentElement, p = new Set(Object.keys(n));
|
|
41
|
+
l.current.forEach((g) => {
|
|
42
|
+
p.has(g) || d.style.removeProperty(`--${g}`);
|
|
43
|
+
}), Object.entries(n).forEach(([g, v]) => {
|
|
44
|
+
v == null || v === "" ? d.style.removeProperty(`--${g}`) : d.style.setProperty(`--${g}`, String(v));
|
|
45
|
+
}), l.current = p, ot(et, n);
|
|
46
|
+
}, [n]);
|
|
47
|
+
const a = (d) => {
|
|
48
|
+
c((p) => {
|
|
49
|
+
const g = typeof d == "function" ? d(p) : d;
|
|
50
|
+
return {
|
|
51
|
+
...p,
|
|
52
|
+
...g || {}
|
|
53
|
+
};
|
|
54
|
+
});
|
|
55
|
+
}, i = (d, p = Wt) => {
|
|
56
|
+
a((g) => {
|
|
57
|
+
const v = { ...g };
|
|
58
|
+
return p.forEach((L) => {
|
|
59
|
+
v[L] = d;
|
|
60
|
+
}), v;
|
|
61
|
+
});
|
|
62
|
+
}, u = () => {
|
|
63
|
+
c({});
|
|
64
|
+
}, h = () => {
|
|
65
|
+
r((d) => d === "dark" ? "light" : "dark");
|
|
66
|
+
};
|
|
67
|
+
return /* @__PURE__ */ s(
|
|
68
|
+
kt.Provider,
|
|
69
|
+
{
|
|
70
|
+
value: {
|
|
71
|
+
theme: o,
|
|
72
|
+
setTheme: r,
|
|
73
|
+
toggleTheme: h,
|
|
74
|
+
themeTokens: n,
|
|
75
|
+
setThemeTokens: a,
|
|
76
|
+
setThemeColor: i,
|
|
77
|
+
resetThemeTokens: u
|
|
78
|
+
},
|
|
79
|
+
children: e
|
|
80
|
+
}
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
function Qr() {
|
|
84
|
+
return Ue(kt);
|
|
85
|
+
}
|
|
86
|
+
const Zt = /* @__PURE__ */ new Set([
|
|
87
|
+
"root",
|
|
88
|
+
"slots",
|
|
89
|
+
"tw",
|
|
90
|
+
"className",
|
|
91
|
+
"css",
|
|
92
|
+
"style"
|
|
93
|
+
]), Ee = {
|
|
94
|
+
tw: "",
|
|
95
|
+
css: {}
|
|
96
|
+
}, ye = (e) => typeof e == "object" && e !== null && !Array.isArray(e), V = (e, o = "px") => typeof e == "number" ? `${e}${o}` : e, he = (e) => typeof e == "string" && e.startsWith("$") ? `var(--${e.slice(1)})` : e, Gt = (e) => e.includes("-") ? e.replace(/-([a-z])/g, (o, r) => r.toUpperCase()) : e, Xt = (e) => /(color|background|border|fill|stroke|shadow)$/i.test(e), qt = {
|
|
97
|
+
mt: (e, o) => {
|
|
98
|
+
e.marginTop = V(o);
|
|
99
|
+
},
|
|
100
|
+
mr: (e, o) => {
|
|
101
|
+
e.marginRight = V(o);
|
|
102
|
+
},
|
|
103
|
+
mb: (e, o) => {
|
|
104
|
+
e.marginBottom = V(o);
|
|
105
|
+
},
|
|
106
|
+
ml: (e, o) => {
|
|
107
|
+
e.marginLeft = V(o);
|
|
108
|
+
},
|
|
109
|
+
mx: (e, o) => {
|
|
110
|
+
e.marginLeft = V(o), e.marginRight = V(o);
|
|
111
|
+
},
|
|
112
|
+
my: (e, o) => {
|
|
113
|
+
e.marginTop = V(o), e.marginBottom = V(o);
|
|
114
|
+
},
|
|
115
|
+
m: (e, o) => {
|
|
116
|
+
e.margin = V(o);
|
|
117
|
+
},
|
|
118
|
+
pt: (e, o) => {
|
|
119
|
+
e.paddingTop = V(o);
|
|
120
|
+
},
|
|
121
|
+
pr: (e, o) => {
|
|
122
|
+
e.paddingRight = V(o);
|
|
123
|
+
},
|
|
124
|
+
pb: (e, o) => {
|
|
125
|
+
e.paddingBottom = V(o);
|
|
126
|
+
},
|
|
127
|
+
pl: (e, o) => {
|
|
128
|
+
e.paddingLeft = V(o);
|
|
129
|
+
},
|
|
130
|
+
px: (e, o) => {
|
|
131
|
+
e.paddingLeft = V(o), e.paddingRight = V(o);
|
|
132
|
+
},
|
|
133
|
+
py: (e, o) => {
|
|
134
|
+
e.paddingTop = V(o), e.paddingBottom = V(o);
|
|
135
|
+
},
|
|
136
|
+
p: (e, o) => {
|
|
137
|
+
e.padding = V(o);
|
|
138
|
+
},
|
|
139
|
+
g: (e, o) => {
|
|
140
|
+
e.gap = V(o);
|
|
141
|
+
},
|
|
142
|
+
rg: (e, o) => {
|
|
143
|
+
e.rowGap = V(o);
|
|
144
|
+
},
|
|
145
|
+
cg: (e, o) => {
|
|
146
|
+
e.columnGap = V(o);
|
|
147
|
+
},
|
|
148
|
+
w: (e, o) => {
|
|
149
|
+
e.width = V(o);
|
|
150
|
+
},
|
|
151
|
+
h: (e, o) => {
|
|
152
|
+
e.height = V(o);
|
|
153
|
+
},
|
|
154
|
+
mw: (e, o) => {
|
|
155
|
+
e.minWidth = V(o);
|
|
156
|
+
},
|
|
157
|
+
mh: (e, o) => {
|
|
158
|
+
e.minHeight = V(o);
|
|
159
|
+
},
|
|
160
|
+
maxw: (e, o) => {
|
|
161
|
+
e.maxWidth = V(o);
|
|
162
|
+
},
|
|
163
|
+
maxh: (e, o) => {
|
|
164
|
+
e.maxHeight = V(o);
|
|
165
|
+
},
|
|
166
|
+
vw: (e, o) => {
|
|
167
|
+
e.width = typeof o == "number" ? `${o}vw` : o;
|
|
168
|
+
},
|
|
169
|
+
vh: (e, o) => {
|
|
170
|
+
e.height = typeof o == "number" ? `${o}vh` : o;
|
|
171
|
+
},
|
|
172
|
+
presentw: (e, o) => {
|
|
173
|
+
e.width = typeof o == "number" ? `${o}%` : o;
|
|
174
|
+
},
|
|
175
|
+
presenth: (e, o) => {
|
|
176
|
+
e.height = typeof o == "number" ? `${o}%` : o;
|
|
177
|
+
},
|
|
178
|
+
size: (e, o) => {
|
|
179
|
+
e.fontSize = V(o);
|
|
180
|
+
},
|
|
181
|
+
fw: (e, o) => {
|
|
182
|
+
e.fontWeight = o;
|
|
183
|
+
},
|
|
184
|
+
fwb: (e) => {
|
|
185
|
+
e.fontWeight = "bold";
|
|
186
|
+
},
|
|
187
|
+
fwn: (e) => {
|
|
188
|
+
e.fontWeight = "normal";
|
|
189
|
+
},
|
|
190
|
+
tac: (e) => {
|
|
191
|
+
e.textAlign = "center";
|
|
192
|
+
},
|
|
193
|
+
tar: (e) => {
|
|
194
|
+
e.textAlign = "right";
|
|
195
|
+
},
|
|
196
|
+
tal: (e) => {
|
|
197
|
+
e.textAlign = "left";
|
|
198
|
+
},
|
|
199
|
+
lh: (e, o) => {
|
|
200
|
+
e.lineHeight = V(o);
|
|
201
|
+
},
|
|
202
|
+
ls: (e, o) => {
|
|
203
|
+
e.letterSpacing = V(o);
|
|
204
|
+
},
|
|
205
|
+
c: (e, o) => {
|
|
206
|
+
e.color = he(o);
|
|
207
|
+
},
|
|
208
|
+
bg: (e, o) => {
|
|
209
|
+
e.background = he(o);
|
|
210
|
+
},
|
|
211
|
+
bgc: (e, o) => {
|
|
212
|
+
e.backgroundColor = he(o);
|
|
213
|
+
},
|
|
214
|
+
b: (e, o) => {
|
|
215
|
+
e.border = o === 1 ? "1px solid var(--border)" : he(o);
|
|
216
|
+
},
|
|
217
|
+
br: (e, o) => {
|
|
218
|
+
e.borderRadius = V(o);
|
|
219
|
+
},
|
|
220
|
+
bw: (e, o) => {
|
|
221
|
+
e.borderWidth = V(o);
|
|
222
|
+
},
|
|
223
|
+
bs: (e, o) => {
|
|
224
|
+
e.borderStyle = o;
|
|
225
|
+
},
|
|
226
|
+
bColor: (e, o) => {
|
|
227
|
+
e.borderColor = he(o);
|
|
228
|
+
},
|
|
229
|
+
boxshadow: (e, o) => {
|
|
230
|
+
e.boxShadow = he(o);
|
|
231
|
+
},
|
|
232
|
+
bgSize: (e, o) => {
|
|
233
|
+
e.backgroundSize = o;
|
|
234
|
+
},
|
|
235
|
+
bgPosition: (e, o) => {
|
|
236
|
+
e.backgroundPosition = o;
|
|
237
|
+
},
|
|
238
|
+
bgRepeat: (e, o) => {
|
|
239
|
+
e.backgroundRepeat = o;
|
|
240
|
+
},
|
|
241
|
+
rel: (e) => {
|
|
242
|
+
e.position = "relative";
|
|
243
|
+
},
|
|
244
|
+
ab: (e) => {
|
|
245
|
+
e.position = "absolute";
|
|
246
|
+
},
|
|
247
|
+
fixed: (e) => {
|
|
248
|
+
e.position = "fixed";
|
|
249
|
+
},
|
|
250
|
+
sticky: (e) => {
|
|
251
|
+
e.position = "sticky";
|
|
252
|
+
},
|
|
253
|
+
center: (e) => {
|
|
254
|
+
e.position = "absolute", e.inset = 0, e.margin = "auto";
|
|
255
|
+
},
|
|
256
|
+
inset: (e, o) => {
|
|
257
|
+
e.inset = V(o);
|
|
258
|
+
},
|
|
259
|
+
top: (e, o) => {
|
|
260
|
+
e.top = V(o);
|
|
261
|
+
},
|
|
262
|
+
right: (e, o) => {
|
|
263
|
+
e.right = V(o);
|
|
264
|
+
},
|
|
265
|
+
bottom: (e, o) => {
|
|
266
|
+
e.bottom = V(o);
|
|
267
|
+
},
|
|
268
|
+
left: (e, o) => {
|
|
269
|
+
e.left = V(o);
|
|
270
|
+
},
|
|
271
|
+
z: (e, o) => {
|
|
272
|
+
e.zIndex = o;
|
|
273
|
+
},
|
|
274
|
+
flex: (e) => {
|
|
275
|
+
e.display = "flex";
|
|
276
|
+
},
|
|
277
|
+
iflex: (e) => {
|
|
278
|
+
e.display = "inline-flex";
|
|
279
|
+
},
|
|
280
|
+
fd: (e, o) => {
|
|
281
|
+
e.flexDirection = o;
|
|
282
|
+
},
|
|
283
|
+
fwrap: (e, o = "wrap") => {
|
|
284
|
+
e.flexWrap = o;
|
|
285
|
+
},
|
|
286
|
+
aic: (e) => {
|
|
287
|
+
e.alignItems = "center";
|
|
288
|
+
},
|
|
289
|
+
ai: (e, o) => {
|
|
290
|
+
e.alignItems = o;
|
|
291
|
+
},
|
|
292
|
+
jcc: (e) => {
|
|
293
|
+
e.justifyContent = "center";
|
|
294
|
+
},
|
|
295
|
+
jc: (e, o) => {
|
|
296
|
+
e.justifyContent = o;
|
|
297
|
+
},
|
|
298
|
+
ac: (e, o) => {
|
|
299
|
+
e.alignContent = o;
|
|
300
|
+
},
|
|
301
|
+
as: (e, o) => {
|
|
302
|
+
e.alignSelf = o;
|
|
303
|
+
},
|
|
304
|
+
f: (e, o) => {
|
|
305
|
+
e.flex = typeof o == "number" ? o : `${o}`;
|
|
306
|
+
},
|
|
307
|
+
fl: (e) => {
|
|
308
|
+
e.float = "left";
|
|
309
|
+
},
|
|
310
|
+
fr: (e) => {
|
|
311
|
+
e.float = "right";
|
|
312
|
+
},
|
|
313
|
+
ar: (e, o) => {
|
|
314
|
+
e.aspectRatio = o;
|
|
315
|
+
},
|
|
316
|
+
tran: (e, o) => {
|
|
317
|
+
e.transition = typeof o == "number" ? `${o}s` : o;
|
|
318
|
+
},
|
|
319
|
+
op: (e, o) => {
|
|
320
|
+
e.opacity = o;
|
|
321
|
+
},
|
|
322
|
+
oh: (e) => {
|
|
323
|
+
e.overflow = "hidden";
|
|
324
|
+
},
|
|
325
|
+
ohauto: (e) => {
|
|
326
|
+
e.overflow = "auto";
|
|
327
|
+
},
|
|
328
|
+
oxh: (e) => {
|
|
329
|
+
e.overflowX = "hidden";
|
|
330
|
+
},
|
|
331
|
+
oxa: (e) => {
|
|
332
|
+
e.overflowX = "auto";
|
|
333
|
+
},
|
|
334
|
+
oyh: (e) => {
|
|
335
|
+
e.overflowY = "hidden";
|
|
336
|
+
},
|
|
337
|
+
oya: (e) => {
|
|
338
|
+
e.overflowY = "auto";
|
|
339
|
+
},
|
|
340
|
+
cur: (e, o) => {
|
|
341
|
+
e.cursor = o;
|
|
342
|
+
},
|
|
343
|
+
pe: (e, o) => {
|
|
344
|
+
e.pointerEvents = o;
|
|
345
|
+
},
|
|
346
|
+
boxsizing: (e) => {
|
|
347
|
+
e.boxSizing = "border-box";
|
|
348
|
+
},
|
|
349
|
+
none: (e) => {
|
|
350
|
+
e.display = "none";
|
|
351
|
+
},
|
|
352
|
+
block: (e) => {
|
|
353
|
+
e.display = "block";
|
|
354
|
+
},
|
|
355
|
+
inline: (e) => {
|
|
356
|
+
e.display = "inline";
|
|
357
|
+
},
|
|
358
|
+
ib: (e) => {
|
|
359
|
+
e.display = "inline-block";
|
|
360
|
+
},
|
|
361
|
+
hidden: (e) => {
|
|
362
|
+
e.visibility = "hidden";
|
|
363
|
+
},
|
|
364
|
+
shown: (e) => {
|
|
365
|
+
e.visibility = "visible";
|
|
366
|
+
}
|
|
367
|
+
}, Me = (e = {}) => ye(e) ? Object.entries(e).reduce((o, [r, n]) => {
|
|
368
|
+
if (Zt.has(r))
|
|
369
|
+
return o;
|
|
370
|
+
const c = qt[r];
|
|
371
|
+
if (c)
|
|
372
|
+
return c(o, n), o;
|
|
373
|
+
const l = Gt(r), a = typeof n == "string" && (n.startsWith("$") || Xt(l)) ? he(n) : n;
|
|
374
|
+
return o[l] = a, o;
|
|
375
|
+
}, {}) : {}, E = (...e) => {
|
|
376
|
+
const o = e.filter(Boolean).join(" ").trim();
|
|
377
|
+
return o ? Ut(o) : "";
|
|
378
|
+
}, Pe = (e) => {
|
|
379
|
+
if (typeof e == "string")
|
|
380
|
+
return { tw: e, css: {} };
|
|
381
|
+
if (!ye(e))
|
|
382
|
+
return { ...Ee };
|
|
383
|
+
if (!("tw" in e || "className" in e || "css" in e || "style" in e))
|
|
384
|
+
return {
|
|
385
|
+
tw: "",
|
|
386
|
+
css: Me(e)
|
|
387
|
+
};
|
|
388
|
+
const r = [e.className, e.tw].filter(Boolean).join(" "), n = ye(e.css) ? Me(e.css) : {}, c = ye(e.style) ? Me(e.style) : {};
|
|
389
|
+
return {
|
|
390
|
+
tw: r,
|
|
391
|
+
css: {
|
|
392
|
+
...n,
|
|
393
|
+
...c
|
|
394
|
+
}
|
|
395
|
+
};
|
|
396
|
+
}, Jt = (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, Qt = (e) => {
|
|
397
|
+
const o = {};
|
|
398
|
+
return e.forEach((r) => {
|
|
399
|
+
o[r] = { ...Ee };
|
|
400
|
+
}), o.root || (o.root = { ...Ee }), o;
|
|
401
|
+
}, H = (e, o = ["root"]) => {
|
|
402
|
+
const r = Qt(o);
|
|
403
|
+
if (typeof e == "string")
|
|
404
|
+
return r.root.tw = e, r;
|
|
405
|
+
if (!ye(e))
|
|
406
|
+
return r;
|
|
407
|
+
if (!Jt(e, o))
|
|
408
|
+
return r.root.css = Me(e), r;
|
|
409
|
+
const n = Pe({
|
|
410
|
+
tw: [e.className, e.tw].filter(Boolean).join(" "),
|
|
411
|
+
css: e.css,
|
|
412
|
+
style: e.style
|
|
413
|
+
}), c = Pe(e.root);
|
|
414
|
+
r.root = {
|
|
415
|
+
tw: E(n.tw, c.tw),
|
|
416
|
+
css: {
|
|
417
|
+
...n.css,
|
|
418
|
+
...c.css
|
|
419
|
+
}
|
|
420
|
+
};
|
|
421
|
+
const l = ye(e.slots) ? e.slots : {};
|
|
422
|
+
return Object.keys(r).forEach((a) => {
|
|
423
|
+
if (a === "root")
|
|
424
|
+
return;
|
|
425
|
+
const i = Pe(e[a]), u = Pe(l[a]);
|
|
426
|
+
r[a] = {
|
|
427
|
+
tw: E(i.tw, u.tw),
|
|
428
|
+
css: {
|
|
429
|
+
...i.css,
|
|
430
|
+
...u.css
|
|
431
|
+
}
|
|
432
|
+
};
|
|
433
|
+
}), r;
|
|
434
|
+
}, b = ({
|
|
435
|
+
baseClassName: e = "",
|
|
436
|
+
className: o = "",
|
|
437
|
+
baseStyle: r = {},
|
|
438
|
+
style: n = {},
|
|
439
|
+
sxSlot: c = Ee
|
|
440
|
+
} = {}) => ({
|
|
441
|
+
className: E(e, o, c.tw),
|
|
442
|
+
style: {
|
|
443
|
+
...r || {},
|
|
444
|
+
...c.css || {},
|
|
445
|
+
...n || {}
|
|
446
|
+
}
|
|
447
|
+
}), eo = ["root", "icon", "content"], rt = {
|
|
448
|
+
success: "text-[var(--notice-success-text)]",
|
|
449
|
+
fail: "text-[var(--notice-fail-text)]",
|
|
450
|
+
caution: "text-[var(--notice-caution-text)]"
|
|
451
|
+
}, st = {
|
|
452
|
+
default: {
|
|
453
|
+
base: "fixed top-5 left-1/2 -translate-x-1/2",
|
|
454
|
+
enter: "animate-[noticeSlideDown_0.3s_cubic-bezier(0.22,1,0.36,1)_forwards]"
|
|
455
|
+
},
|
|
456
|
+
md: {
|
|
457
|
+
base: "fixed bottom-5 left-5",
|
|
458
|
+
enter: "animate-[noticeSlideFromBottom_0.3s_ease-out_forwards]"
|
|
459
|
+
}
|
|
460
|
+
};
|
|
461
|
+
function to(e, o) {
|
|
462
|
+
const {
|
|
463
|
+
type: r = "success",
|
|
464
|
+
icon: n,
|
|
465
|
+
message: c,
|
|
466
|
+
variant: l = "default",
|
|
467
|
+
duration: a = 3e3,
|
|
468
|
+
onClose: i,
|
|
469
|
+
sx: u = {},
|
|
470
|
+
style: h = {},
|
|
471
|
+
className: d = "",
|
|
472
|
+
...p
|
|
473
|
+
} = e, [g, v] = G(!1), L = rt[r] ? r : "success", O = st[l] ? l : "default", j = H(u, eo), w = oe(() => {
|
|
474
|
+
v(!0);
|
|
475
|
+
const M = setTimeout(() => i == null ? void 0 : i(), 300);
|
|
476
|
+
return () => clearTimeout(M);
|
|
477
|
+
}, [i]);
|
|
478
|
+
le(() => {
|
|
479
|
+
if (!i || a <= 0) return;
|
|
480
|
+
const M = setTimeout(w, a);
|
|
481
|
+
return () => clearTimeout(M);
|
|
482
|
+
}, [i, a, w]);
|
|
483
|
+
const S = st[O], x = O === "default" ? "animate-[noticeSlideUpFade_0.3s_ease-in_forwards]" : "animate-[noticeSlideToBottom_0.3s_ease-in_forwards]", _ = b({
|
|
484
|
+
baseClassName: E(
|
|
485
|
+
"inline-flex items-center gap-2 px-3 py-2 text-sm z-[999]",
|
|
486
|
+
"rounded-[var(--notice-radius)]",
|
|
487
|
+
"bg-[var(--notice-bg)] text-[var(--notice-foreground)]",
|
|
488
|
+
"shadow-[var(--notice-shadow)]",
|
|
489
|
+
S.base,
|
|
490
|
+
g ? x : S.enter,
|
|
491
|
+
O === "md" && rt[L]
|
|
492
|
+
),
|
|
493
|
+
className: d,
|
|
494
|
+
sxSlot: j.root,
|
|
495
|
+
baseStyle: { borderRadius: "var(--notice-radius)" },
|
|
496
|
+
style: h
|
|
497
|
+
}), m = b({
|
|
498
|
+
baseClassName: "flex-shrink-0 text-[var(--notice-foreground)]",
|
|
499
|
+
sxSlot: j.icon
|
|
500
|
+
}), y = b({
|
|
501
|
+
baseClassName: "inline-block",
|
|
502
|
+
sxSlot: j.content
|
|
503
|
+
});
|
|
504
|
+
return /* @__PURE__ */ k("div", { ref: o, role: "alert", className: _.className, style: _.style, ...p, children: [
|
|
505
|
+
O !== "md" && n && /* @__PURE__ */ s("span", { className: m.className, style: m.style, children: n }),
|
|
506
|
+
/* @__PURE__ */ s("span", { className: y.className, style: y.style, children: c })
|
|
507
|
+
] });
|
|
508
|
+
}
|
|
509
|
+
const We = Tt(to);
|
|
510
|
+
We.displayName = "Notice";
|
|
511
|
+
We.propTypes = {
|
|
512
|
+
type: t.oneOf(["success", "fail", "caution"]),
|
|
513
|
+
icon: t.node,
|
|
514
|
+
message: t.node,
|
|
515
|
+
variant: t.oneOf(["default", "md"]),
|
|
516
|
+
duration: t.number,
|
|
517
|
+
onClose: t.func,
|
|
518
|
+
sx: t.oneOfType([t.string, t.object]),
|
|
519
|
+
style: t.object,
|
|
520
|
+
className: t.string
|
|
521
|
+
};
|
|
522
|
+
const Pt = He(null), oo = /* @__PURE__ */ s("svg", { viewBox: "0 0 1024 1024", width: "1.2em", height: "1.2em", children: /* @__PURE__ */ s(
|
|
523
|
+
"path",
|
|
524
|
+
{
|
|
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
|
+
fill: "var(--notice-success-text)"
|
|
527
|
+
}
|
|
528
|
+
) }), ro = /* @__PURE__ */ s("svg", { viewBox: "0 0 1024 1024", width: "1.2em", height: "1.2em", children: /* @__PURE__ */ s(
|
|
529
|
+
"path",
|
|
530
|
+
{
|
|
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
|
+
fill: "var(--notice-fail-text)"
|
|
533
|
+
}
|
|
534
|
+
) }), so = /* @__PURE__ */ k("svg", { viewBox: "0 0 1024 1024", width: "1.2em", height: "1.2em", children: [
|
|
535
|
+
/* @__PURE__ */ s(
|
|
536
|
+
"path",
|
|
537
|
+
{
|
|
538
|
+
d: "M512 909.061224c-218.906122 0-397.061224-178.155102-397.061224-397.061224s178.155102-397.061224 397.061224-397.061224 397.061224 178.155102 397.061224 397.061224-178.155102 397.061224-397.061224 397.061224z",
|
|
539
|
+
fill: "var(--notice-caution-text)"
|
|
540
|
+
}
|
|
541
|
+
),
|
|
542
|
+
/* @__PURE__ */ s(
|
|
543
|
+
"path",
|
|
544
|
+
{
|
|
545
|
+
d: "M512 690.677551m-31.346939 0a31.346939 31.346939 0 1 0 62.693878 0 31.346939 31.346939 0 1 0-62.693878 0Z",
|
|
546
|
+
fill: "var(--notice-fail-text)"
|
|
547
|
+
}
|
|
548
|
+
),
|
|
549
|
+
/* @__PURE__ */ s(
|
|
550
|
+
"path",
|
|
551
|
+
{
|
|
552
|
+
d: "M512 584.097959c-11.493878 0-20.897959-9.404082-20.897959-20.897959v-261.22449c0-11.493878 9.404082-20.897959 20.897959-20.897959s20.897959 9.404082 20.897959 20.897959v261.22449c0 12.016327-9.404082 20.897959-20.897959 20.897959z",
|
|
553
|
+
fill: "var(--notice-fail-text)"
|
|
554
|
+
}
|
|
555
|
+
)
|
|
556
|
+
] }), ao = { success: oo, fail: ro, caution: so };
|
|
557
|
+
function es({ children: e }) {
|
|
558
|
+
const [o, r] = G([]), [n, c] = G(!1);
|
|
559
|
+
le(() => {
|
|
560
|
+
c(!0);
|
|
561
|
+
}, []);
|
|
562
|
+
const l = oe((i) => {
|
|
563
|
+
r((u) => u.filter((h) => h.id !== i));
|
|
564
|
+
}, []), a = oe((i, u, h = "default") => {
|
|
565
|
+
const d = Date.now() + Math.random();
|
|
566
|
+
r((p) => [
|
|
567
|
+
...p,
|
|
568
|
+
{ id: d, type: i, message: u, variant: h, icon: ao[i] }
|
|
569
|
+
]);
|
|
570
|
+
}, []);
|
|
571
|
+
return /* @__PURE__ */ k(Pt.Provider, { value: { add: a, remove: l }, children: [
|
|
572
|
+
e,
|
|
573
|
+
n && Kt(
|
|
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
|
+
document.body
|
|
576
|
+
)
|
|
577
|
+
] });
|
|
578
|
+
}
|
|
579
|
+
function no() {
|
|
580
|
+
const e = Ue(Pt);
|
|
581
|
+
if (!e)
|
|
582
|
+
throw new Error("useNotice must be used inside <NoticeProvider />");
|
|
583
|
+
return e;
|
|
584
|
+
}
|
|
585
|
+
function ts() {
|
|
586
|
+
const { add: e } = no();
|
|
587
|
+
return {
|
|
588
|
+
success: (o) => e("success", o),
|
|
589
|
+
fail: (o) => e("fail", o),
|
|
590
|
+
caution: (o) => e("caution", o),
|
|
591
|
+
md: {
|
|
592
|
+
success: (o) => e("success", o, "md"),
|
|
593
|
+
fail: (o) => e("fail", o, "md"),
|
|
594
|
+
caution: (o) => e("caution", o, "md")
|
|
595
|
+
}
|
|
596
|
+
};
|
|
597
|
+
}
|
|
598
|
+
const _t = "tango:locale", xe = "zh-CN", lo = {
|
|
599
|
+
zh: "zh-CN",
|
|
600
|
+
ZH: "zh-CN",
|
|
601
|
+
"zh-CN": "zh-CN",
|
|
602
|
+
"zh-cn": "zh-CN",
|
|
603
|
+
cn: "zh-CN",
|
|
604
|
+
CN: "zh-CN",
|
|
605
|
+
en: "en-US",
|
|
606
|
+
EN: "en-US",
|
|
607
|
+
"en-US": "en-US",
|
|
608
|
+
"en-us": "en-US",
|
|
609
|
+
us: "en-US",
|
|
610
|
+
US: "en-US"
|
|
611
|
+
}, Ot = {
|
|
612
|
+
"zh-CN": {
|
|
613
|
+
button: {
|
|
614
|
+
default: "按钮",
|
|
615
|
+
loading: "加载中",
|
|
616
|
+
iconAlt: "图标",
|
|
617
|
+
toggle: "切换",
|
|
618
|
+
light: "浅色",
|
|
619
|
+
dark: "暗色",
|
|
620
|
+
blue: "蓝色",
|
|
621
|
+
green: "绿色",
|
|
622
|
+
token: "自定义词条",
|
|
623
|
+
reset: "重置",
|
|
624
|
+
locale: "语言",
|
|
625
|
+
chinese: "中文",
|
|
626
|
+
english: "英文",
|
|
627
|
+
successDemo: "成功",
|
|
628
|
+
outlineDemo: "描边",
|
|
629
|
+
submit: "提交",
|
|
630
|
+
confirm: "确认",
|
|
631
|
+
cancel: "取消",
|
|
632
|
+
search: "搜索",
|
|
633
|
+
save: "保存",
|
|
634
|
+
delete: "删除",
|
|
635
|
+
back: "返回",
|
|
636
|
+
next: "下一步",
|
|
637
|
+
prev: "上一步",
|
|
638
|
+
add: "新增"
|
|
639
|
+
},
|
|
640
|
+
banner: {
|
|
641
|
+
cancel: "取消",
|
|
642
|
+
action: "操作"
|
|
643
|
+
},
|
|
644
|
+
colorpicker: {
|
|
645
|
+
hex: "HEX",
|
|
646
|
+
rgb: "RGB",
|
|
647
|
+
hsl: "HSL"
|
|
648
|
+
},
|
|
649
|
+
date: {
|
|
650
|
+
weekdayPrefix: "星期",
|
|
651
|
+
weekdayShortPrefix: "周"
|
|
652
|
+
},
|
|
653
|
+
datepicker: {
|
|
654
|
+
placeholder: "YYYY-MM-DD",
|
|
655
|
+
placeholderTime: "YYYY-MM-DD HH:mm",
|
|
656
|
+
timeLabel: "时间",
|
|
657
|
+
confirm: "确定",
|
|
658
|
+
cancel: "关闭",
|
|
659
|
+
prevMonth: "上一月",
|
|
660
|
+
nextMonth: "下一月"
|
|
661
|
+
},
|
|
662
|
+
drawer: {
|
|
663
|
+
title: "基础标题",
|
|
664
|
+
okText: "确定",
|
|
665
|
+
cancelText: "取消",
|
|
666
|
+
closeAriaLabel: "关闭"
|
|
667
|
+
},
|
|
668
|
+
modal: {
|
|
669
|
+
title: "基础标题",
|
|
670
|
+
okText: "确定",
|
|
671
|
+
cancelText: "取消",
|
|
672
|
+
closeAriaLabel: "关闭"
|
|
673
|
+
},
|
|
674
|
+
search: {
|
|
675
|
+
placeholder: "请输入内容",
|
|
676
|
+
btnText: "搜索"
|
|
677
|
+
},
|
|
678
|
+
materialInput: {
|
|
679
|
+
label: ""
|
|
680
|
+
},
|
|
681
|
+
materialButton: {
|
|
682
|
+
default: "按钮",
|
|
683
|
+
loading: "加载中",
|
|
684
|
+
iconAlt: "图标"
|
|
685
|
+
},
|
|
686
|
+
table: {
|
|
687
|
+
empty: "暂无数据",
|
|
688
|
+
prev: "上一页",
|
|
689
|
+
next: "下一页",
|
|
690
|
+
page: "页",
|
|
691
|
+
total: "共 {total} 条",
|
|
692
|
+
perPage: "条/页"
|
|
693
|
+
}
|
|
694
|
+
},
|
|
695
|
+
"en-US": {
|
|
696
|
+
button: {
|
|
697
|
+
default: "Button",
|
|
698
|
+
loading: "Loading",
|
|
699
|
+
iconAlt: "icon",
|
|
700
|
+
toggle: "Toggle",
|
|
701
|
+
light: "Light",
|
|
702
|
+
dark: "Dark",
|
|
703
|
+
blue: "Blue",
|
|
704
|
+
green: "Green",
|
|
705
|
+
token: "Token",
|
|
706
|
+
reset: "Reset",
|
|
707
|
+
locale: "Locale",
|
|
708
|
+
chinese: "Chinese",
|
|
709
|
+
english: "English",
|
|
710
|
+
successDemo: "Success",
|
|
711
|
+
outlineDemo: "Outline",
|
|
712
|
+
submit: "Submit",
|
|
713
|
+
confirm: "Confirm",
|
|
714
|
+
cancel: "Cancel",
|
|
715
|
+
search: "Search",
|
|
716
|
+
save: "Save",
|
|
717
|
+
delete: "Delete",
|
|
718
|
+
back: "Back",
|
|
719
|
+
next: "Next",
|
|
720
|
+
prev: "Previous",
|
|
721
|
+
add: "Add"
|
|
722
|
+
},
|
|
723
|
+
banner: {
|
|
724
|
+
cancel: "Cancel",
|
|
725
|
+
action: "Action"
|
|
726
|
+
},
|
|
727
|
+
colorpicker: {
|
|
728
|
+
hex: "HEX",
|
|
729
|
+
rgb: "RGB",
|
|
730
|
+
hsl: "HSL"
|
|
731
|
+
},
|
|
732
|
+
date: {
|
|
733
|
+
weekdayPrefix: "",
|
|
734
|
+
weekdayShortPrefix: ""
|
|
735
|
+
},
|
|
736
|
+
datepicker: {
|
|
737
|
+
placeholder: "YYYY-MM-DD",
|
|
738
|
+
placeholderTime: "YYYY-MM-DD HH:mm",
|
|
739
|
+
timeLabel: "Time",
|
|
740
|
+
confirm: "Confirm",
|
|
741
|
+
cancel: "Close",
|
|
742
|
+
prevMonth: "Previous month",
|
|
743
|
+
nextMonth: "Next month"
|
|
744
|
+
},
|
|
745
|
+
drawer: {
|
|
746
|
+
title: "Drawer",
|
|
747
|
+
okText: "OK",
|
|
748
|
+
cancelText: "Cancel",
|
|
749
|
+
closeAriaLabel: "Close"
|
|
750
|
+
},
|
|
751
|
+
modal: {
|
|
752
|
+
title: "Modal",
|
|
753
|
+
okText: "OK",
|
|
754
|
+
cancelText: "Cancel",
|
|
755
|
+
closeAriaLabel: "Close"
|
|
756
|
+
},
|
|
757
|
+
search: {
|
|
758
|
+
placeholder: "Search...",
|
|
759
|
+
btnText: "Search"
|
|
760
|
+
},
|
|
761
|
+
materialInput: {
|
|
762
|
+
label: ""
|
|
763
|
+
},
|
|
764
|
+
materialButton: {
|
|
765
|
+
default: "Button",
|
|
766
|
+
loading: "Loading",
|
|
767
|
+
iconAlt: "icon"
|
|
768
|
+
},
|
|
769
|
+
table: {
|
|
770
|
+
empty: "No data",
|
|
771
|
+
prev: "Previous",
|
|
772
|
+
next: "Next",
|
|
773
|
+
page: "Page",
|
|
774
|
+
total: "{total} items",
|
|
775
|
+
perPage: "/ page"
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
}, Ke = () => {
|
|
779
|
+
}, At = He({
|
|
780
|
+
locale: xe,
|
|
781
|
+
setLocale: Ke,
|
|
782
|
+
toggleLocale: Ke,
|
|
783
|
+
messages: Ot,
|
|
784
|
+
t: (e, o = "") => o
|
|
785
|
+
}), at = (e) => typeof e == "object" && e !== null && !Array.isArray(e), Mt = (e, o) => {
|
|
786
|
+
const r = { ...e };
|
|
787
|
+
return Object.entries(o || {}).forEach(([n, c]) => {
|
|
788
|
+
at(c) && at(r[n]) ? r[n] = Mt(r[n], c) : r[n] = c;
|
|
789
|
+
}), r;
|
|
790
|
+
}, co = (e, o) => o.split(".").reduce((r, n) => {
|
|
791
|
+
if (r && Object.prototype.hasOwnProperty.call(r, n))
|
|
792
|
+
return r[n];
|
|
793
|
+
}, e), ze = (e) => typeof e != "string" || !e.trim() ? xe : lo[e] || e, io = () => {
|
|
794
|
+
if (typeof window > "u")
|
|
795
|
+
return xe;
|
|
796
|
+
try {
|
|
797
|
+
const e = window.localStorage.getItem(_t);
|
|
798
|
+
return ze(e || xe);
|
|
799
|
+
} catch {
|
|
800
|
+
return xe;
|
|
801
|
+
}
|
|
802
|
+
};
|
|
803
|
+
function os({
|
|
804
|
+
children: e,
|
|
805
|
+
locale: o,
|
|
806
|
+
defaultLocale: r = xe,
|
|
807
|
+
onLocaleChange: n = Ke,
|
|
808
|
+
messages: c = {}
|
|
809
|
+
}) {
|
|
810
|
+
const l = ze(r), a = o == null ? null : ze(o), [i, u] = G(
|
|
811
|
+
() => io() || l
|
|
812
|
+
), h = a || i, d = (L) => {
|
|
813
|
+
const O = ze(L);
|
|
814
|
+
a == null && u(O), n(O);
|
|
815
|
+
};
|
|
816
|
+
le(() => {
|
|
817
|
+
if (!(typeof window > "u"))
|
|
818
|
+
try {
|
|
819
|
+
window.localStorage.setItem(_t, h);
|
|
820
|
+
} catch {
|
|
821
|
+
}
|
|
822
|
+
}, [h]);
|
|
823
|
+
const p = Se(
|
|
824
|
+
() => Mt(Ot, c),
|
|
825
|
+
[c]
|
|
826
|
+
), g = () => {
|
|
827
|
+
d(h === "zh-CN" ? "en-US" : "zh-CN");
|
|
828
|
+
}, v = (L, O = "") => {
|
|
829
|
+
const j = p[h] || p[xe] || {}, w = co(j, L);
|
|
830
|
+
return w == null || w === "" ? O : String(w);
|
|
831
|
+
};
|
|
832
|
+
return /* @__PURE__ */ s(
|
|
833
|
+
At.Provider,
|
|
834
|
+
{
|
|
835
|
+
value: {
|
|
836
|
+
locale: h,
|
|
837
|
+
setLocale: d,
|
|
838
|
+
toggleLocale: g,
|
|
839
|
+
messages: p,
|
|
840
|
+
t: v
|
|
841
|
+
},
|
|
842
|
+
children: e
|
|
843
|
+
}
|
|
844
|
+
);
|
|
845
|
+
}
|
|
846
|
+
function ie() {
|
|
847
|
+
return Ue(At);
|
|
848
|
+
}
|
|
849
|
+
const uo = "_materialBtn_wlueu_4", po = "_materialBtnSmall_wlueu_26", mo = "_materialBtnMedium_wlueu_32", bo = "_materialBtnLarge_wlueu_38", fo = "_materialBtnHuge_wlueu_44", go = "_materialBtnDisabled_wlueu_51", ho = "_ripple_wlueu_59", Ce = {
|
|
850
|
+
materialBtn: uo,
|
|
851
|
+
materialBtnSmall: po,
|
|
852
|
+
materialBtnMedium: mo,
|
|
853
|
+
materialBtnLarge: bo,
|
|
854
|
+
materialBtnHuge: fo,
|
|
855
|
+
materialBtnDisabled: go,
|
|
856
|
+
ripple: ho
|
|
857
|
+
}, yo = ["root", "content", "icon", "loading"], xo = { small: "small", medium: "medium", large: "large", huge: "huge" }, vo = { small: 12, medium: 14, large: 16, huge: 20 }, nt = {
|
|
858
|
+
default: {
|
|
859
|
+
backgroundColor: "var(--primary)",
|
|
860
|
+
color: "var(--primary-foreground)",
|
|
861
|
+
borderColor: "var(--border)"
|
|
862
|
+
},
|
|
863
|
+
transparent: {
|
|
864
|
+
backgroundColor: "var(--transparent)",
|
|
865
|
+
color: "var(--primary-foreground)",
|
|
866
|
+
borderColor: "var(--button-transparent-border)"
|
|
867
|
+
},
|
|
868
|
+
danger: {
|
|
869
|
+
backgroundColor: "var(--destructive)",
|
|
870
|
+
color: "var(--destructive-foreground)",
|
|
871
|
+
borderColor: "transparent"
|
|
872
|
+
},
|
|
873
|
+
success: {
|
|
874
|
+
backgroundColor: "var(--success)",
|
|
875
|
+
color: "var(--success-foreground)",
|
|
876
|
+
borderColor: "transparent"
|
|
877
|
+
}
|
|
878
|
+
}, So = {
|
|
879
|
+
default: {
|
|
880
|
+
backgroundColor: "var(--transparent)",
|
|
881
|
+
color: "var(--button-outline-foreground)",
|
|
882
|
+
borderColor: "var(--border)"
|
|
883
|
+
},
|
|
884
|
+
transparent: {
|
|
885
|
+
backgroundColor: "var(--transparent)",
|
|
886
|
+
color: "var(--button-outline-foreground)",
|
|
887
|
+
borderColor: "var(--button-transparent-border)"
|
|
888
|
+
},
|
|
889
|
+
danger: {
|
|
890
|
+
backgroundColor: "var(--transparent)",
|
|
891
|
+
color: "var(--destructive)",
|
|
892
|
+
borderColor: "var(--destructive)"
|
|
893
|
+
},
|
|
894
|
+
success: {
|
|
895
|
+
backgroundColor: "var(--transparent)",
|
|
896
|
+
color: "var(--success)",
|
|
897
|
+
borderColor: "var(--success)"
|
|
898
|
+
}
|
|
899
|
+
}, No = {
|
|
900
|
+
backgroundColor: "var(--muted)",
|
|
901
|
+
color: "var(--muted-foreground)",
|
|
902
|
+
borderColor: "transparent",
|
|
903
|
+
cursor: "not-allowed"
|
|
904
|
+
}, De = {
|
|
905
|
+
default: "按钮",
|
|
906
|
+
loading: "加载中",
|
|
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", lt = (e, o, r) => Object.prototype.hasOwnProperty.call(r, e) ? e : o;
|
|
909
|
+
function Ze(e) {
|
|
910
|
+
const {
|
|
911
|
+
type: o = "default",
|
|
912
|
+
size: r = "medium",
|
|
913
|
+
sx: n = {},
|
|
914
|
+
style: c = {},
|
|
915
|
+
className: l = "",
|
|
916
|
+
onClick: a = () => {
|
|
917
|
+
},
|
|
918
|
+
children: i,
|
|
919
|
+
disabled: u = !1,
|
|
920
|
+
outline: h = !1,
|
|
921
|
+
icon: d = null,
|
|
922
|
+
iconPosition: p = null,
|
|
923
|
+
loading: g = !1,
|
|
924
|
+
i18nKey: v = null,
|
|
925
|
+
localeText: L = {},
|
|
926
|
+
rippleColor: O,
|
|
927
|
+
"aria-label": j,
|
|
928
|
+
...w
|
|
929
|
+
} = e, { t: S } = ie(), x = $e(null), _ = lt(r, "medium", xo), m = lt(o, "default", nt), y = Co(g), M = To(g), A = u || y, $ = vo[_], P = p === "right" ? "right" : d || y ? "left" : null, T = O ?? "var(--material-button-ripple)", N = {
|
|
930
|
+
default: S("materialButton.default", De.default),
|
|
931
|
+
loading: S("materialButton.loading", De.loading),
|
|
932
|
+
iconAlt: S("materialButton.iconAlt", De.iconAlt),
|
|
933
|
+
...L
|
|
934
|
+
}, U = (v && typeof N[v] == "string" ? N[v] : null) || (v ? S(`materialButton.${v}`, N.default) : N.default), I = y ? N.loading : U, F = i ?? I, B = j || (i == null ? String(F || N.default) : void 0), D = H(n, yo), W = A ? No : h ? So[m] : nt[m], K = Ce[`materialBtn${wo(_)}`], Z = typeof n == "object" ? n : {}, R = D.root.css || {}, re = typeof n == "string" ? n : "", de = [
|
|
935
|
+
Ce.materialBtn,
|
|
936
|
+
K,
|
|
937
|
+
A && Ce.materialBtnDisabled,
|
|
938
|
+
D.root.tw,
|
|
939
|
+
re,
|
|
940
|
+
l
|
|
941
|
+
].filter(Boolean).join(" "), be = {
|
|
942
|
+
...W,
|
|
943
|
+
...Z,
|
|
944
|
+
...R,
|
|
945
|
+
...c
|
|
946
|
+
}, fe = b({
|
|
947
|
+
baseClassName: "inline-flex items-center relative z-[1]",
|
|
948
|
+
sxSlot: D.content
|
|
949
|
+
}), se = b({
|
|
950
|
+
baseClassName: "inline-flex items-center justify-center shrink-0 transition-all duration-300 relative z-[1]",
|
|
951
|
+
baseStyle: { width: `${$}px`, height: `${$}px` },
|
|
952
|
+
sxSlot: D.icon
|
|
953
|
+
}), ee = b({
|
|
954
|
+
baseClassName: "inline-flex items-center justify-center shrink-0 animate-spin relative z-[1]",
|
|
955
|
+
baseStyle: {
|
|
956
|
+
width: `${$}px`,
|
|
957
|
+
height: `${$}px`,
|
|
958
|
+
color: M === "light" ? "var(--button-loading-light)" : "var(--button-loading-dark)"
|
|
959
|
+
},
|
|
960
|
+
sxSlot: D.loading
|
|
961
|
+
}), q = oe(
|
|
962
|
+
(te) => {
|
|
963
|
+
if (A) return;
|
|
964
|
+
const ae = x.current;
|
|
965
|
+
if (!ae) return;
|
|
966
|
+
const ue = document.createElement("span"), f = Math.max(ae.clientWidth, ae.clientHeight), Y = f / 2;
|
|
967
|
+
Object.assign(ue.style, {
|
|
968
|
+
width: `${f}px`,
|
|
969
|
+
height: `${f}px`,
|
|
970
|
+
left: `${te.clientX - ae.getBoundingClientRect().left - Y}px`,
|
|
971
|
+
top: `${te.clientY - ae.getBoundingClientRect().top - Y}px`
|
|
972
|
+
}), ue.className = Ce.ripple, ue.style.background = T;
|
|
973
|
+
const J = ae.querySelector(`.${Ce.ripple}`);
|
|
974
|
+
J && J.remove(), ae.appendChild(ue);
|
|
975
|
+
},
|
|
976
|
+
[A, T]
|
|
977
|
+
), z = () => d ? typeof d == "string" ? /* @__PURE__ */ s(
|
|
978
|
+
"img",
|
|
979
|
+
{
|
|
980
|
+
src: d,
|
|
981
|
+
alt: N.iconAlt,
|
|
982
|
+
className: se.className,
|
|
983
|
+
style: se.style,
|
|
984
|
+
"aria-hidden": "true"
|
|
985
|
+
}
|
|
986
|
+
) : Q.isValidElement(d) ? Q.cloneElement(d, {
|
|
987
|
+
className: E(se.className, d.props.className),
|
|
988
|
+
style: { ...se.style, ...d.props.style },
|
|
989
|
+
"aria-hidden": !0
|
|
990
|
+
}) : typeof d == "function" ? /* @__PURE__ */ s(
|
|
991
|
+
d,
|
|
992
|
+
{
|
|
993
|
+
className: se.className,
|
|
994
|
+
style: se.style,
|
|
995
|
+
"aria-hidden": "true"
|
|
996
|
+
}
|
|
997
|
+
) : /* @__PURE__ */ s("span", { className: se.className, style: se.style, "aria-hidden": "true", children: d }) : null, X = () => /* @__PURE__ */ s(
|
|
998
|
+
"svg",
|
|
999
|
+
{
|
|
1000
|
+
viewBox: "0 0 1024 1024",
|
|
1001
|
+
role: "presentation",
|
|
1002
|
+
className: ee.className,
|
|
1003
|
+
style: ee.style,
|
|
1004
|
+
"aria-hidden": "true",
|
|
1005
|
+
children: /* @__PURE__ */ s(
|
|
1006
|
+
"path",
|
|
1007
|
+
{
|
|
1008
|
+
d: "M512 1024A512 512 0 0 1 0 512a32 32 0 0 1 64 0 448 448 0 0 0 896 0 32 32 0 0 1 64 0 512 512 0 0 1-512 512z",
|
|
1009
|
+
fill: "currentColor"
|
|
1010
|
+
}
|
|
1011
|
+
)
|
|
1012
|
+
}
|
|
1013
|
+
);
|
|
1014
|
+
return /* @__PURE__ */ k(
|
|
1015
|
+
"button",
|
|
1016
|
+
{
|
|
1017
|
+
ref: x,
|
|
1018
|
+
className: de,
|
|
1019
|
+
style: be,
|
|
1020
|
+
onClick: (te) => {
|
|
1021
|
+
q(te), a == null || a(te);
|
|
1022
|
+
},
|
|
1023
|
+
disabled: A,
|
|
1024
|
+
"aria-label": B,
|
|
1025
|
+
"data-variant": m,
|
|
1026
|
+
"data-size": _,
|
|
1027
|
+
"data-icon-position": P || void 0,
|
|
1028
|
+
...w,
|
|
1029
|
+
children: [
|
|
1030
|
+
P === "left" && /* @__PURE__ */ k(Ne, { children: [
|
|
1031
|
+
y && X(),
|
|
1032
|
+
!y && d && z()
|
|
1033
|
+
] }),
|
|
1034
|
+
/* @__PURE__ */ s("span", { className: fe.className, style: fe.style, children: F }),
|
|
1035
|
+
P === "right" && /* @__PURE__ */ k(Ne, { children: [
|
|
1036
|
+
y && X(),
|
|
1037
|
+
!y && d && z()
|
|
1038
|
+
] })
|
|
1039
|
+
]
|
|
1040
|
+
}
|
|
1041
|
+
);
|
|
1042
|
+
}
|
|
1043
|
+
Ze.propTypes = {
|
|
1044
|
+
type: t.oneOf(["default", "transparent", "danger", "success"]),
|
|
1045
|
+
size: t.oneOf(["small", "medium", "large", "huge"]),
|
|
1046
|
+
sx: t.oneOfType([t.object, t.string]),
|
|
1047
|
+
style: t.object,
|
|
1048
|
+
onClick: t.func,
|
|
1049
|
+
className: t.string,
|
|
1050
|
+
children: t.node,
|
|
1051
|
+
disabled: t.bool,
|
|
1052
|
+
outline: t.bool,
|
|
1053
|
+
icon: t.oneOfType([
|
|
1054
|
+
t.elementType,
|
|
1055
|
+
t.node,
|
|
1056
|
+
t.string
|
|
1057
|
+
]),
|
|
1058
|
+
iconPosition: t.oneOf(["left", "right"]),
|
|
1059
|
+
loading: t.oneOfType([
|
|
1060
|
+
t.bool,
|
|
1061
|
+
t.oneOf(["light", "dark"]),
|
|
1062
|
+
t.array
|
|
1063
|
+
]),
|
|
1064
|
+
i18nKey: t.string,
|
|
1065
|
+
localeText: t.object,
|
|
1066
|
+
rippleColor: t.string
|
|
1067
|
+
};
|
|
1068
|
+
const ko = ["root", "content", "icon", "loading"], Re = {
|
|
1069
|
+
default: "按钮",
|
|
1070
|
+
loading: "加载中",
|
|
1071
|
+
iconAlt: "图标"
|
|
1072
|
+
}, Lo = "inline-flex select-none items-center justify-center whitespace-nowrap rounded-[var(--radius)] border align-middle font-medium tracking-[0.5px] transition-all duration-300 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--input-accent)] focus-visible:ring-offset-2", Ve = {
|
|
1073
|
+
small: {
|
|
1074
|
+
iconSize: 12,
|
|
1075
|
+
className: "text-xs px-2 py-1 gap-1"
|
|
1076
|
+
},
|
|
1077
|
+
medium: {
|
|
1078
|
+
iconSize: 14,
|
|
1079
|
+
className: "text-sm px-4 py-2 gap-1.5"
|
|
1080
|
+
},
|
|
1081
|
+
large: {
|
|
1082
|
+
iconSize: 16,
|
|
1083
|
+
className: "text-base px-5 py-3 gap-2"
|
|
1084
|
+
},
|
|
1085
|
+
huge: {
|
|
1086
|
+
iconSize: 20,
|
|
1087
|
+
className: "text-[25px] px-[45px] py-[18px] gap-3"
|
|
1088
|
+
}
|
|
1089
|
+
}, ct = {
|
|
1090
|
+
default: "bg-[var(--primary)] text-[var(--primary-foreground)] border-[var(--border)] hover:shadow-[0_0_0.4em_0_var(--button-shadow-default)]",
|
|
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
|
+
danger: "bg-[var(--destructive)] text-[var(--destructive-foreground)] border-transparent hover:shadow-[0_0_0.4em_0_var(--destructive)]",
|
|
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)]", _o = {
|
|
1095
|
+
default: "text-[var(--button-outline-foreground)] border-[var(--border)]",
|
|
1096
|
+
transparent: "text-[var(--button-outline-foreground)] border-[var(--button-transparent-border)]",
|
|
1097
|
+
danger: "text-[var(--destructive)] border-[var(--destructive)]",
|
|
1098
|
+
success: "text-[var(--success)] border-[var(--success)]"
|
|
1099
|
+
}, Oo = "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
|
+
default: "bg-[var(--button-enu-bg)] text-[var(--button-enu-fg)] border-transparent",
|
|
1101
|
+
transparent: "bg-[var(--transparent)] text-[var(--button-enu-fg)] border-[var(--button-transparent-border)]",
|
|
1102
|
+
danger: "bg-[var(--destructive)] text-[var(--destructive-foreground)] border-transparent",
|
|
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", it = (e, o, r) => Object.prototype.hasOwnProperty.call(r, e) ? e : o;
|
|
1105
|
+
function ce(e) {
|
|
1106
|
+
const {
|
|
1107
|
+
type: o = "default",
|
|
1108
|
+
size: r = "medium",
|
|
1109
|
+
sx: n = {},
|
|
1110
|
+
style: c = {},
|
|
1111
|
+
className: l = "",
|
|
1112
|
+
onClick: a = () => {
|
|
1113
|
+
},
|
|
1114
|
+
children: i,
|
|
1115
|
+
disabled: u = !1,
|
|
1116
|
+
outline: h = !1,
|
|
1117
|
+
enu: d = !1,
|
|
1118
|
+
icon: p = null,
|
|
1119
|
+
iconPosition: g = null,
|
|
1120
|
+
loading: v = !1,
|
|
1121
|
+
i18nKey: L = null,
|
|
1122
|
+
localeText: O = {},
|
|
1123
|
+
"aria-label": j,
|
|
1124
|
+
...w
|
|
1125
|
+
} = e, { t: S } = ie(), x = it(r, "medium", Ve), _ = it(o, "default", ct), m = zo(v), y = Eo(v), M = u || m, A = Ve[x].iconSize, $ = g === "right" ? "right" : p || m ? "left" : null, P = H(n, ko), T = {
|
|
1126
|
+
default: S("button.default", Re.default),
|
|
1127
|
+
loading: S("button.loading", Re.loading),
|
|
1128
|
+
iconAlt: S("button.iconAlt", Re.iconAlt),
|
|
1129
|
+
...O
|
|
1130
|
+
}, C = (L && typeof T[L] == "string" ? T[L] : null) || (L ? S(`button.${L}`, T.default) : T.default), U = m ? T.loading : C, I = i ?? U, F = j || (i == null ? String(I || T.default) : void 0);
|
|
1131
|
+
let B = ct[_];
|
|
1132
|
+
h && (B = E(
|
|
1133
|
+
B,
|
|
1134
|
+
Po,
|
|
1135
|
+
_o[_]
|
|
1136
|
+
)), d && (B = E(
|
|
1137
|
+
B,
|
|
1138
|
+
Oo,
|
|
1139
|
+
Ao[_]
|
|
1140
|
+
));
|
|
1141
|
+
const D = b({
|
|
1142
|
+
// 顺序固定为:baseTw -> className -> sx.tw,sx 能稳定覆盖普通 Tailwind。
|
|
1143
|
+
baseClassName: E(
|
|
1144
|
+
Lo,
|
|
1145
|
+
Ve[x].className,
|
|
1146
|
+
B,
|
|
1147
|
+
M && Mo,
|
|
1148
|
+
m && "cursor-wait"
|
|
1149
|
+
),
|
|
1150
|
+
className: l,
|
|
1151
|
+
style: c,
|
|
1152
|
+
sxSlot: P.root
|
|
1153
|
+
}), W = b({
|
|
1154
|
+
baseClassName: "inline-flex items-center",
|
|
1155
|
+
sxSlot: P.content
|
|
1156
|
+
}), K = b({
|
|
1157
|
+
baseClassName: "inline-flex items-center justify-center shrink-0 transition-all duration-300",
|
|
1158
|
+
baseStyle: {
|
|
1159
|
+
width: `${A}px`,
|
|
1160
|
+
height: `${A}px`
|
|
1161
|
+
},
|
|
1162
|
+
sxSlot: P.icon
|
|
1163
|
+
}), Z = b({
|
|
1164
|
+
baseClassName: "inline-flex items-center justify-center shrink-0 animate-spin",
|
|
1165
|
+
baseStyle: {
|
|
1166
|
+
width: `${A}px`,
|
|
1167
|
+
height: `${A}px`,
|
|
1168
|
+
color: y === "light" ? "var(--button-loading-light)" : "var(--button-loading-dark)"
|
|
1169
|
+
},
|
|
1170
|
+
sxSlot: P.loading
|
|
1171
|
+
}), R = () => p ? typeof p == "string" ? /* @__PURE__ */ s(
|
|
1172
|
+
"img",
|
|
1173
|
+
{
|
|
1174
|
+
src: p,
|
|
1175
|
+
alt: T.iconAlt,
|
|
1176
|
+
className: K.className,
|
|
1177
|
+
style: K.style,
|
|
1178
|
+
"aria-hidden": "true"
|
|
1179
|
+
}
|
|
1180
|
+
) : Q.isValidElement(p) ? Q.cloneElement(p, {
|
|
1181
|
+
className: E(K.className, p.props.className),
|
|
1182
|
+
style: {
|
|
1183
|
+
...K.style,
|
|
1184
|
+
...p.props.style
|
|
1185
|
+
},
|
|
1186
|
+
"aria-hidden": !0
|
|
1187
|
+
}) : typeof p == "function" ? /* @__PURE__ */ s(
|
|
1188
|
+
p,
|
|
1189
|
+
{
|
|
1190
|
+
className: K.className,
|
|
1191
|
+
style: K.style,
|
|
1192
|
+
"aria-hidden": "true"
|
|
1193
|
+
}
|
|
1194
|
+
) : /* @__PURE__ */ s("span", { className: K.className, style: K.style, "aria-hidden": "true", children: p }) : null, re = () => /* @__PURE__ */ s(
|
|
1195
|
+
"svg",
|
|
1196
|
+
{
|
|
1197
|
+
viewBox: "0 0 1024 1024",
|
|
1198
|
+
role: "presentation",
|
|
1199
|
+
className: Z.className,
|
|
1200
|
+
style: Z.style,
|
|
1201
|
+
"aria-hidden": "true",
|
|
1202
|
+
children: /* @__PURE__ */ s(
|
|
1203
|
+
"path",
|
|
1204
|
+
{
|
|
1205
|
+
d: "M512 1024A512 512 0 0 1 0 512a32 32 0 0 1 64 0 448 448 0 0 0 896 0 32 32 0 0 1 64 0 512 512 0 0 1-512 512z",
|
|
1206
|
+
fill: "currentColor"
|
|
1207
|
+
}
|
|
1208
|
+
)
|
|
1209
|
+
}
|
|
1210
|
+
);
|
|
1211
|
+
return /* @__PURE__ */ k(
|
|
1212
|
+
"button",
|
|
1213
|
+
{
|
|
1214
|
+
className: D.className,
|
|
1215
|
+
style: D.style,
|
|
1216
|
+
onClick: a,
|
|
1217
|
+
disabled: M,
|
|
1218
|
+
"aria-label": F,
|
|
1219
|
+
"data-variant": _,
|
|
1220
|
+
"data-size": x,
|
|
1221
|
+
"data-icon-position": $ || void 0,
|
|
1222
|
+
...w,
|
|
1223
|
+
children: [
|
|
1224
|
+
$ === "left" && /* @__PURE__ */ k(Ne, { children: [
|
|
1225
|
+
m && re(),
|
|
1226
|
+
!m && p && R()
|
|
1227
|
+
] }),
|
|
1228
|
+
/* @__PURE__ */ s("span", { className: W.className, style: W.style, children: I }),
|
|
1229
|
+
$ === "right" && /* @__PURE__ */ k(Ne, { children: [
|
|
1230
|
+
m && re(),
|
|
1231
|
+
!m && p && R()
|
|
1232
|
+
] })
|
|
1233
|
+
]
|
|
1234
|
+
}
|
|
1235
|
+
);
|
|
1236
|
+
}
|
|
1237
|
+
ce.propTypes = {
|
|
1238
|
+
type: t.oneOf(["default", "transparent", "danger", "success"]),
|
|
1239
|
+
size: t.oneOf(["small", "medium", "large", "huge"]),
|
|
1240
|
+
sx: t.oneOfType([t.object, t.string]),
|
|
1241
|
+
style: t.object,
|
|
1242
|
+
onClick: t.func,
|
|
1243
|
+
className: t.string,
|
|
1244
|
+
children: t.node,
|
|
1245
|
+
disabled: t.bool,
|
|
1246
|
+
outline: t.bool,
|
|
1247
|
+
enu: t.bool,
|
|
1248
|
+
icon: t.oneOfType([
|
|
1249
|
+
t.elementType,
|
|
1250
|
+
t.node,
|
|
1251
|
+
t.string
|
|
1252
|
+
]),
|
|
1253
|
+
iconPosition: t.oneOf(["left", "right"]),
|
|
1254
|
+
loading: t.oneOfType([
|
|
1255
|
+
t.bool,
|
|
1256
|
+
t.oneOf(["light", "dark"]),
|
|
1257
|
+
t.array
|
|
1258
|
+
]),
|
|
1259
|
+
i18nKey: t.string,
|
|
1260
|
+
localeText: t.object
|
|
1261
|
+
};
|
|
1262
|
+
ce.MaterialButton = Ze;
|
|
1263
|
+
const $o = ["root", "input", "label"], Bo = {
|
|
1264
|
+
small: "small",
|
|
1265
|
+
medium: "medium",
|
|
1266
|
+
large: "large",
|
|
1267
|
+
huge: "huge"
|
|
1268
|
+
}, Io = {
|
|
1269
|
+
small: { wrapper: "h-10 text-sm", label: "text-sm", labelFloat: "text-[10px]", pt: "pt-5" },
|
|
1270
|
+
medium: { wrapper: "h-12 text-base", label: "text-base", labelFloat: "text-xs", pt: "pt-6" },
|
|
1271
|
+
large: { wrapper: "h-14 text-lg", label: "text-lg", labelFloat: "text-sm", pt: "pt-7" },
|
|
1272
|
+
huge: { wrapper: "h-16 text-xl", label: "text-xl", labelFloat: "text-base", pt: "pt-8" }
|
|
1273
|
+
}, jo = {
|
|
1274
|
+
label: ""
|
|
1275
|
+
}, Fo = (e, o, r) => Object.prototype.hasOwnProperty.call(r, e) ? e : o;
|
|
1276
|
+
function Ge(e) {
|
|
1277
|
+
const {
|
|
1278
|
+
size: o = "medium",
|
|
1279
|
+
sx: r = {},
|
|
1280
|
+
style: n = {},
|
|
1281
|
+
className: c = "",
|
|
1282
|
+
onChange: l,
|
|
1283
|
+
value: a,
|
|
1284
|
+
defaultValue: i,
|
|
1285
|
+
disabled: u = !1,
|
|
1286
|
+
label: h,
|
|
1287
|
+
localeText: d,
|
|
1288
|
+
type: p = "text",
|
|
1289
|
+
...g
|
|
1290
|
+
} = e, { t: v } = ie(), L = Fo(o, "medium", Bo), O = a !== void 0, [j, w] = G(i ?? ""), [S, x] = G(!1), _ = O ? a : j, m = S || String(_).length > 0, y = h ?? (d == null ? void 0 : d.label) ?? v("materialInput.label", jo.label), M = H(r, $o), A = {
|
|
1291
|
+
tw: E(M.root.tw, M.input.tw),
|
|
1292
|
+
css: { ...M.root.css, ...M.input.css }
|
|
1293
|
+
}, $ = E("relative inline-flex", M.root.tw), P = Io[L], T = E(
|
|
1294
|
+
"w-[300px] bg-transparent text-[var(--foreground)] outline-none transition-all duration-200 ease-in-out",
|
|
1295
|
+
"border-b border-b-[var(--border)]",
|
|
1296
|
+
"hover:border-b-[var(--input-accent)]",
|
|
1297
|
+
"focus:border-b-[var(--input-accent)]",
|
|
1298
|
+
u && "text-[var(--muted-foreground)] border-b-[var(--muted)] cursor-not-allowed hover:border-b-[var(--muted)]",
|
|
1299
|
+
P.wrapper,
|
|
1300
|
+
P.pt
|
|
1301
|
+
), N = b({
|
|
1302
|
+
baseClassName: T,
|
|
1303
|
+
className: c,
|
|
1304
|
+
style: n,
|
|
1305
|
+
sxSlot: A
|
|
1306
|
+
}), C = E(
|
|
1307
|
+
"absolute left-0 transition-all duration-200 ease-in-out pointer-events-none",
|
|
1308
|
+
m ? `top-1 ${P.labelFloat} text-[var(--input-accent)]` : `top-1/2 -translate-y-1/2 ${P.label} text-[var(--muted-foreground)]`,
|
|
1309
|
+
S && m && "text-[var(--input-accent)]",
|
|
1310
|
+
u && "text-[var(--muted-foreground)]",
|
|
1311
|
+
M.label.tw
|
|
1312
|
+
), U = b({
|
|
1313
|
+
baseClassName: C,
|
|
1314
|
+
sxSlot: { tw: "", css: M.label.css }
|
|
1315
|
+
}), I = oe((Z) => {
|
|
1316
|
+
const R = Z.target.value;
|
|
1317
|
+
O || w(R), l == null || l(R);
|
|
1318
|
+
}, [O, l]), F = oe((Z) => {
|
|
1319
|
+
var R;
|
|
1320
|
+
x(!0), (R = g.onFocus) == null || R.call(g, Z);
|
|
1321
|
+
}, [g.onFocus]), B = oe((Z) => {
|
|
1322
|
+
var R;
|
|
1323
|
+
x(!1), (R = g.onBlur) == null || R.call(g, Z);
|
|
1324
|
+
}, [g.onBlur]), { onFocus: D, onBlur: W, ...K } = g;
|
|
1325
|
+
return /* @__PURE__ */ k("div", { className: $, children: [
|
|
1326
|
+
/* @__PURE__ */ s(
|
|
1327
|
+
"input",
|
|
1328
|
+
{
|
|
1329
|
+
...K,
|
|
1330
|
+
type: p,
|
|
1331
|
+
className: N.className,
|
|
1332
|
+
style: N.style,
|
|
1333
|
+
value: _,
|
|
1334
|
+
disabled: u || void 0,
|
|
1335
|
+
onChange: I,
|
|
1336
|
+
onFocus: F,
|
|
1337
|
+
onBlur: B,
|
|
1338
|
+
"aria-label": y || void 0
|
|
1339
|
+
}
|
|
1340
|
+
),
|
|
1341
|
+
y && /* @__PURE__ */ s("label", { className: U.className, style: U.style, children: y })
|
|
1342
|
+
] });
|
|
1343
|
+
}
|
|
1344
|
+
Ge.propTypes = {
|
|
1345
|
+
size: t.oneOf(["small", "medium", "large", "huge"]),
|
|
1346
|
+
sx: t.oneOfType([t.object, t.string]),
|
|
1347
|
+
style: t.object,
|
|
1348
|
+
className: t.string,
|
|
1349
|
+
onChange: t.func,
|
|
1350
|
+
value: t.string,
|
|
1351
|
+
defaultValue: t.string,
|
|
1352
|
+
disabled: t.bool,
|
|
1353
|
+
label: t.string,
|
|
1354
|
+
localeText: t.shape({
|
|
1355
|
+
label: t.string
|
|
1356
|
+
}),
|
|
1357
|
+
type: t.string
|
|
1358
|
+
};
|
|
1359
|
+
const Do = ["root", "input"], Ro = {
|
|
1360
|
+
small: "small",
|
|
1361
|
+
medium: "medium",
|
|
1362
|
+
large: "large",
|
|
1363
|
+
huge: "huge"
|
|
1364
|
+
}, Vo = {
|
|
1365
|
+
small: "h-8 text-xs px-2.5",
|
|
1366
|
+
medium: "h-10 text-sm px-3",
|
|
1367
|
+
large: "h-12 text-base px-3.5",
|
|
1368
|
+
huge: "h-14 text-lg px-4"
|
|
1369
|
+
}, Yo = (e, o, r) => Object.prototype.hasOwnProperty.call(r, e) ? e : o;
|
|
1370
|
+
function Xe(e) {
|
|
1371
|
+
const {
|
|
1372
|
+
type: o = "default",
|
|
1373
|
+
size: r = "medium",
|
|
1374
|
+
sx: n = {},
|
|
1375
|
+
style: c = {},
|
|
1376
|
+
className: l = "",
|
|
1377
|
+
onClick: a,
|
|
1378
|
+
onChange: i,
|
|
1379
|
+
value: u,
|
|
1380
|
+
defaultValue: h,
|
|
1381
|
+
disabled: d = !1,
|
|
1382
|
+
placeholder: p = "",
|
|
1383
|
+
maxlength: g = 524288,
|
|
1384
|
+
status: v,
|
|
1385
|
+
...L
|
|
1386
|
+
} = e, O = Yo(r, "medium", Ro), j = o === "textarea", w = o === "password", S = v === "error", x = H(n, Do), _ = {
|
|
1387
|
+
tw: E(x.root.tw, x.input.tw),
|
|
1388
|
+
css: { ...x.root.css, ...x.input.css }
|
|
1389
|
+
}, m = E("inline-flex", x.root.tw), y = E(
|
|
1390
|
+
"w-[300px] rounded-[var(--radius)] border bg-[var(--input-bg)] text-[var(--foreground)] outline-none transition-all duration-200 ease-in-out",
|
|
1391
|
+
"border-[var(--border)] shadow-[var(--input-shadow)]",
|
|
1392
|
+
"hover:border-[var(--input-accent)]",
|
|
1393
|
+
"focus:border-[var(--input-accent)] focus:shadow-[var(--input-focus-shadow)]",
|
|
1394
|
+
S && "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
|
+
d && "bg-[var(--muted)] text-[var(--muted-foreground)] border-[var(--muted)] cursor-not-allowed shadow-none hover:border-[var(--muted)] focus:shadow-none",
|
|
1396
|
+
Vo[O]
|
|
1397
|
+
), M = b({
|
|
1398
|
+
baseClassName: y,
|
|
1399
|
+
className: l,
|
|
1400
|
+
style: c,
|
|
1401
|
+
sxSlot: _
|
|
1402
|
+
}), A = u !== void 0, $ = {
|
|
1403
|
+
className: M.className,
|
|
1404
|
+
style: M.style,
|
|
1405
|
+
onClick: a,
|
|
1406
|
+
onChange: i ? (P) => i(P.target.value) : void 0,
|
|
1407
|
+
value: A ? u : void 0,
|
|
1408
|
+
defaultValue: A ? void 0 : h ?? "",
|
|
1409
|
+
disabled: d || void 0,
|
|
1410
|
+
placeholder: p,
|
|
1411
|
+
maxLength: g,
|
|
1412
|
+
"aria-invalid": S || void 0,
|
|
1413
|
+
...L
|
|
1414
|
+
};
|
|
1415
|
+
return /* @__PURE__ */ s("div", { className: m, children: j ? /* @__PURE__ */ s(
|
|
1416
|
+
"textarea",
|
|
1417
|
+
{
|
|
1418
|
+
...$,
|
|
1419
|
+
className: `${$.className} min-h-[80px] py-2 resize-y`
|
|
1420
|
+
}
|
|
1421
|
+
) : /* @__PURE__ */ s(
|
|
1422
|
+
"input",
|
|
1423
|
+
{
|
|
1424
|
+
...$,
|
|
1425
|
+
type: w ? "password" : "text"
|
|
1426
|
+
}
|
|
1427
|
+
) });
|
|
1428
|
+
}
|
|
1429
|
+
Xe.propTypes = {
|
|
1430
|
+
type: t.oneOf(["default", "textarea", "password"]),
|
|
1431
|
+
size: t.oneOf(["small", "medium", "large", "huge"]),
|
|
1432
|
+
sx: t.oneOfType([t.object, t.string]),
|
|
1433
|
+
style: t.object,
|
|
1434
|
+
className: t.string,
|
|
1435
|
+
onClick: t.func,
|
|
1436
|
+
onChange: t.func,
|
|
1437
|
+
value: t.string,
|
|
1438
|
+
defaultValue: t.string,
|
|
1439
|
+
disabled: t.bool,
|
|
1440
|
+
placeholder: t.string,
|
|
1441
|
+
maxlength: t.number,
|
|
1442
|
+
status: t.oneOf(["default", "error"])
|
|
1443
|
+
};
|
|
1444
|
+
Xe.MaterialInput = Ge;
|
|
1445
|
+
const we = ["root"];
|
|
1446
|
+
function Ko(e, o) {
|
|
1447
|
+
const {
|
|
1448
|
+
sx: r = {},
|
|
1449
|
+
style: n = {},
|
|
1450
|
+
className: c = "",
|
|
1451
|
+
children: l,
|
|
1452
|
+
...a
|
|
1453
|
+
} = e, i = H(r, we), u = b({
|
|
1454
|
+
baseClassName: "flex items-center justify-center px-4 bg-[var(--layout-header-bg)] text-[var(--layout-header-color)]",
|
|
1455
|
+
className: c,
|
|
1456
|
+
sxSlot: i.root,
|
|
1457
|
+
baseStyle: {
|
|
1458
|
+
height: "var(--layout-header-height)",
|
|
1459
|
+
borderBottom: "1px solid var(--layout-border)"
|
|
1460
|
+
},
|
|
1461
|
+
style: n
|
|
1462
|
+
});
|
|
1463
|
+
return /* @__PURE__ */ s(
|
|
1464
|
+
"header",
|
|
1465
|
+
{
|
|
1466
|
+
ref: o,
|
|
1467
|
+
className: u.className,
|
|
1468
|
+
style: u.style,
|
|
1469
|
+
...a,
|
|
1470
|
+
children: l
|
|
1471
|
+
}
|
|
1472
|
+
);
|
|
1473
|
+
}
|
|
1474
|
+
const Be = Q.forwardRef(Ko);
|
|
1475
|
+
Be.displayName = "LayoutHeader";
|
|
1476
|
+
Be.propTypes = {
|
|
1477
|
+
sx: t.oneOfType([t.string, t.object]),
|
|
1478
|
+
style: t.object,
|
|
1479
|
+
className: t.string,
|
|
1480
|
+
children: t.node
|
|
1481
|
+
};
|
|
1482
|
+
function Uo(e, o) {
|
|
1483
|
+
const {
|
|
1484
|
+
sx: r = {},
|
|
1485
|
+
style: n = {},
|
|
1486
|
+
className: c = "",
|
|
1487
|
+
children: l,
|
|
1488
|
+
...a
|
|
1489
|
+
} = e, i = H(r, we), u = b({
|
|
1490
|
+
baseClassName: "flex items-center justify-center px-4 bg-[var(--layout-footer-bg)] text-[var(--layout-footer-color)]",
|
|
1491
|
+
className: c,
|
|
1492
|
+
sxSlot: i.root,
|
|
1493
|
+
baseStyle: {
|
|
1494
|
+
height: "var(--layout-footer-height)",
|
|
1495
|
+
borderTop: "1px solid var(--layout-border)"
|
|
1496
|
+
},
|
|
1497
|
+
style: n
|
|
1498
|
+
});
|
|
1499
|
+
return /* @__PURE__ */ s(
|
|
1500
|
+
"footer",
|
|
1501
|
+
{
|
|
1502
|
+
ref: o,
|
|
1503
|
+
className: u.className,
|
|
1504
|
+
style: u.style,
|
|
1505
|
+
...a,
|
|
1506
|
+
children: l
|
|
1507
|
+
}
|
|
1508
|
+
);
|
|
1509
|
+
}
|
|
1510
|
+
const Ie = Q.forwardRef(Uo);
|
|
1511
|
+
Ie.displayName = "LayoutFooter";
|
|
1512
|
+
Ie.propTypes = {
|
|
1513
|
+
sx: t.oneOfType([t.string, t.object]),
|
|
1514
|
+
style: t.object,
|
|
1515
|
+
className: t.string,
|
|
1516
|
+
children: t.node
|
|
1517
|
+
};
|
|
1518
|
+
function Ho(e, o) {
|
|
1519
|
+
const {
|
|
1520
|
+
sx: r = {},
|
|
1521
|
+
style: n = {},
|
|
1522
|
+
className: c = "",
|
|
1523
|
+
width: l,
|
|
1524
|
+
children: a,
|
|
1525
|
+
...i
|
|
1526
|
+
} = e, u = H(r, we), h = l ?? "var(--layout-sider-width)", d = b({
|
|
1527
|
+
baseClassName: "overflow-auto flex items-center justify-center bg-[var(--layout-sider-bg)] text-[var(--layout-sider-color)]",
|
|
1528
|
+
className: c,
|
|
1529
|
+
sxSlot: u.root,
|
|
1530
|
+
baseStyle: {
|
|
1531
|
+
width: h,
|
|
1532
|
+
minWidth: h,
|
|
1533
|
+
maxWidth: "100%",
|
|
1534
|
+
borderRight: "1px solid var(--layout-border)"
|
|
1535
|
+
},
|
|
1536
|
+
style: n
|
|
1537
|
+
});
|
|
1538
|
+
return /* @__PURE__ */ s(
|
|
1539
|
+
"aside",
|
|
1540
|
+
{
|
|
1541
|
+
ref: o,
|
|
1542
|
+
className: d.className,
|
|
1543
|
+
style: d.style,
|
|
1544
|
+
...i,
|
|
1545
|
+
children: a
|
|
1546
|
+
}
|
|
1547
|
+
);
|
|
1548
|
+
}
|
|
1549
|
+
const ke = Q.forwardRef(Ho);
|
|
1550
|
+
ke.displayName = "LayoutSider";
|
|
1551
|
+
ke.propTypes = {
|
|
1552
|
+
width: t.oneOfType([t.string, t.number]),
|
|
1553
|
+
sx: t.oneOfType([t.string, t.object]),
|
|
1554
|
+
style: t.object,
|
|
1555
|
+
className: t.string,
|
|
1556
|
+
children: t.node
|
|
1557
|
+
};
|
|
1558
|
+
function Wo(e, o) {
|
|
1559
|
+
const {
|
|
1560
|
+
sx: r = {},
|
|
1561
|
+
style: n = {},
|
|
1562
|
+
className: c = "",
|
|
1563
|
+
width: l,
|
|
1564
|
+
children: a,
|
|
1565
|
+
...i
|
|
1566
|
+
} = e, u = H(r, we), h = l ?? "var(--layout-toc-width)", d = b({
|
|
1567
|
+
baseClassName: "overflow-auto flex items-center justify-center bg-[var(--layout-toc-bg)] text-[var(--layout-toc-color)]",
|
|
1568
|
+
className: c,
|
|
1569
|
+
sxSlot: u.root,
|
|
1570
|
+
baseStyle: {
|
|
1571
|
+
width: h,
|
|
1572
|
+
minWidth: h,
|
|
1573
|
+
maxWidth: "100%",
|
|
1574
|
+
borderLeft: "1px solid var(--layout-border)"
|
|
1575
|
+
},
|
|
1576
|
+
style: n
|
|
1577
|
+
});
|
|
1578
|
+
return /* @__PURE__ */ s(
|
|
1579
|
+
"nav",
|
|
1580
|
+
{
|
|
1581
|
+
ref: o,
|
|
1582
|
+
className: d.className,
|
|
1583
|
+
style: d.style,
|
|
1584
|
+
...i,
|
|
1585
|
+
children: a
|
|
1586
|
+
}
|
|
1587
|
+
);
|
|
1588
|
+
}
|
|
1589
|
+
const Le = Q.forwardRef(Wo);
|
|
1590
|
+
Le.displayName = "LayoutToc";
|
|
1591
|
+
Le.propTypes = {
|
|
1592
|
+
width: t.oneOfType([t.string, t.number]),
|
|
1593
|
+
sx: t.oneOfType([t.string, t.object]),
|
|
1594
|
+
style: t.object,
|
|
1595
|
+
className: t.string,
|
|
1596
|
+
children: t.node
|
|
1597
|
+
};
|
|
1598
|
+
function Zo(e, o) {
|
|
1599
|
+
const {
|
|
1600
|
+
sx: r = {},
|
|
1601
|
+
style: n = {},
|
|
1602
|
+
className: c = "",
|
|
1603
|
+
children: l,
|
|
1604
|
+
...a
|
|
1605
|
+
} = e, i = H(r, we), u = b({
|
|
1606
|
+
/**
|
|
1607
|
+
*
|
|
1608
|
+
* 这里记录了一次问题:backgroundColor、color 等写在 baseStyle(inline style)里,
|
|
1609
|
+
* CSS 优先级高于任何 Tailwind class,所以 sx="bg-amber-400" 无法覆盖。
|
|
1610
|
+
* sx.css 和 style 可以覆盖(同层级后展开覆盖前),但 Tailwind class 不行。
|
|
1611
|
+
*
|
|
1612
|
+
* 修复方案:将 backgroundColor 和 color 从 baseStyle 移到 baseClassName
|
|
1613
|
+
* 用 Tailwind 任意值语法,这样默认值和用户覆盖都在 class 层级,tailwind-merge
|
|
1614
|
+
* 可正确处理冲突。
|
|
1615
|
+
*
|
|
1616
|
+
* noted by clayw on 20260523 night
|
|
1617
|
+
*
|
|
1618
|
+
*/
|
|
1619
|
+
baseClassName: "flex-1 flex items-center justify-center bg-[var(--layout-content-bg)] text-[var(--layout-content-color)]",
|
|
1620
|
+
className: c,
|
|
1621
|
+
sxSlot: i.root,
|
|
1622
|
+
baseStyle: {},
|
|
1623
|
+
style: n
|
|
1624
|
+
});
|
|
1625
|
+
return /* @__PURE__ */ s(
|
|
1626
|
+
"main",
|
|
1627
|
+
{
|
|
1628
|
+
ref: o,
|
|
1629
|
+
className: u.className,
|
|
1630
|
+
style: u.style,
|
|
1631
|
+
...a,
|
|
1632
|
+
children: l
|
|
1633
|
+
}
|
|
1634
|
+
);
|
|
1635
|
+
}
|
|
1636
|
+
const je = Q.forwardRef(Zo);
|
|
1637
|
+
je.displayName = "LayoutContent";
|
|
1638
|
+
je.propTypes = {
|
|
1639
|
+
sx: t.oneOfType([t.string, t.object]),
|
|
1640
|
+
style: t.object,
|
|
1641
|
+
className: t.string,
|
|
1642
|
+
children: t.node
|
|
1643
|
+
};
|
|
1644
|
+
function Go(e, o) {
|
|
1645
|
+
const {
|
|
1646
|
+
sx: r = {},
|
|
1647
|
+
style: n = {},
|
|
1648
|
+
className: c = "",
|
|
1649
|
+
hasSider: l,
|
|
1650
|
+
children: a,
|
|
1651
|
+
...i
|
|
1652
|
+
} = e, u = H(r, we), h = l ?? Q.Children.toArray(a).some(
|
|
1653
|
+
(p) => {
|
|
1654
|
+
var g, v;
|
|
1655
|
+
return Q.isValidElement(p) && (p.type === ke || p.type === Le || ((g = p.type) == null ? void 0 : g.displayName) === "LayoutSider" || ((v = p.type) == null ? void 0 : v.displayName) === "LayoutToc");
|
|
1656
|
+
}
|
|
1657
|
+
), d = b({
|
|
1658
|
+
baseClassName: E(
|
|
1659
|
+
"flex flex-1 flex-col min-h-0",
|
|
1660
|
+
h ? "md:flex-row" : ""
|
|
1661
|
+
),
|
|
1662
|
+
className: c,
|
|
1663
|
+
sxSlot: u.root,
|
|
1664
|
+
style: n
|
|
1665
|
+
});
|
|
1666
|
+
return /* @__PURE__ */ s(
|
|
1667
|
+
"section",
|
|
1668
|
+
{
|
|
1669
|
+
ref: o,
|
|
1670
|
+
className: d.className,
|
|
1671
|
+
style: d.style,
|
|
1672
|
+
...i,
|
|
1673
|
+
children: a
|
|
1674
|
+
}
|
|
1675
|
+
);
|
|
1676
|
+
}
|
|
1677
|
+
const ne = Q.forwardRef(Go);
|
|
1678
|
+
ne.displayName = "Layout";
|
|
1679
|
+
ne.Header = Be;
|
|
1680
|
+
ne.Footer = Ie;
|
|
1681
|
+
ne.Sider = ke;
|
|
1682
|
+
ne.Content = je;
|
|
1683
|
+
ne.Toc = Le;
|
|
1684
|
+
ne.propTypes = {
|
|
1685
|
+
hasSider: t.bool,
|
|
1686
|
+
sx: t.oneOfType([t.string, t.object]),
|
|
1687
|
+
style: t.object,
|
|
1688
|
+
className: t.string,
|
|
1689
|
+
children: t.node
|
|
1690
|
+
};
|
|
1691
|
+
const Xo = Be, qo = Ie, Jo = ke, Qo = je, er = Le, tr = ["root", "button", "list", "item"], zt = Symbol("LIST_IGNORE"), dt = /* @__PURE__ */ k("svg", { viewBox: "0 0 24 24", width: "1em", height: "1em", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: [
|
|
1692
|
+
/* @__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
|
+
/* @__PURE__ */ s("path", { d: "M14 2v6h6" })
|
|
1694
|
+
] }), ut = /* @__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
|
+
function or(e, o) {
|
|
1696
|
+
const {
|
|
1697
|
+
sx: r = {},
|
|
1698
|
+
style: n = {},
|
|
1699
|
+
className: c = "",
|
|
1700
|
+
accept: l = "image/*",
|
|
1701
|
+
multiple: a = !1,
|
|
1702
|
+
onChange: i = () => {
|
|
1703
|
+
},
|
|
1704
|
+
beforeUpload: u = () => {
|
|
1705
|
+
},
|
|
1706
|
+
files: h = [],
|
|
1707
|
+
showUploadList: d = !0,
|
|
1708
|
+
maxCount: p = 20,
|
|
1709
|
+
maxSize: g = 100,
|
|
1710
|
+
btnText: v = "选择文件",
|
|
1711
|
+
btnStyle: L,
|
|
1712
|
+
showSize: O = !0,
|
|
1713
|
+
disabled: j = !1,
|
|
1714
|
+
...w
|
|
1715
|
+
} = e, S = Yt(), x = h || [], _ = H(r, tr), m = oe(async (T, N) => {
|
|
1716
|
+
if (!u) return !0;
|
|
1717
|
+
try {
|
|
1718
|
+
const C = await u(T, N);
|
|
1719
|
+
return C === void 0 ? !0 : C;
|
|
1720
|
+
} catch {
|
|
1721
|
+
return !1;
|
|
1722
|
+
}
|
|
1723
|
+
}, [u]), y = oe(async (T) => {
|
|
1724
|
+
const C = Array.from(T.target.files || []).filter((F) => F.size / 1024 / 1024 > g ? (console.warn(`[Tango Upload] ${F.name} 超过 ${g}MB,已被过滤`), !1) : !0), U = a ? C.slice(0, p) : C.slice(0, 1), I = [];
|
|
1725
|
+
for (const F of U) {
|
|
1726
|
+
const B = await m(F, U);
|
|
1727
|
+
if (B === !1) {
|
|
1728
|
+
console.warn(`[Tango Upload] ${F.name} 被 beforeUpload 拦截`);
|
|
1729
|
+
continue;
|
|
1730
|
+
}
|
|
1731
|
+
if (B === zt) {
|
|
1732
|
+
console.warn(`[Tango Upload] ${F.name} 被 LIST_IGNORE 忽略`);
|
|
1733
|
+
continue;
|
|
1734
|
+
}
|
|
1735
|
+
if (B instanceof Blob) {
|
|
1736
|
+
const D = B instanceof File ? B : new File([B], F.name, { type: F.type });
|
|
1737
|
+
I.push(D);
|
|
1738
|
+
} else
|
|
1739
|
+
I.push(F);
|
|
1740
|
+
}
|
|
1741
|
+
T.target.value = "", i(I);
|
|
1742
|
+
}, [a, p, g, m, i]), M = oe((T, N) => {
|
|
1743
|
+
const C = x.filter((U, I) => I !== N);
|
|
1744
|
+
i(C);
|
|
1745
|
+
}, [x, i]), A = b({
|
|
1746
|
+
baseClassName: "inline-flex flex-col gap-3",
|
|
1747
|
+
className: c,
|
|
1748
|
+
sxSlot: _.root,
|
|
1749
|
+
style: n
|
|
1750
|
+
}), $ = b({
|
|
1751
|
+
baseClassName: E(
|
|
1752
|
+
"list-none p-0 m-0 max-h-[150px] max-w-[400px] overflow-y-auto",
|
|
1753
|
+
"border border-[var(--upload-border)] rounded-[var(--upload-radius)]",
|
|
1754
|
+
"bg-[var(--upload-list-bg)]",
|
|
1755
|
+
x.length === 0 && "border-transparent"
|
|
1756
|
+
),
|
|
1757
|
+
baseStyle: { borderRadius: "var(--upload-radius)" },
|
|
1758
|
+
sxSlot: _.list
|
|
1759
|
+
}), P = b({
|
|
1760
|
+
baseClassName: E(
|
|
1761
|
+
"flex items-center gap-2 px-3 py-1.5 text-sm",
|
|
1762
|
+
"text-[var(--upload-item-text)] hover:bg-[var(--upload-item-hover-bg)]",
|
|
1763
|
+
"transition-colors"
|
|
1764
|
+
),
|
|
1765
|
+
sxSlot: _.item
|
|
1766
|
+
});
|
|
1767
|
+
return /* @__PURE__ */ k("div", { ref: o, className: A.className, style: A.style, ...w, children: [
|
|
1768
|
+
/* @__PURE__ */ s(
|
|
1769
|
+
"input",
|
|
1770
|
+
{
|
|
1771
|
+
id: S,
|
|
1772
|
+
type: "file",
|
|
1773
|
+
accept: l,
|
|
1774
|
+
multiple: a,
|
|
1775
|
+
className: "hidden",
|
|
1776
|
+
onChange: y,
|
|
1777
|
+
disabled: j,
|
|
1778
|
+
"aria-hidden": "true",
|
|
1779
|
+
tabIndex: -1
|
|
1780
|
+
}
|
|
1781
|
+
),
|
|
1782
|
+
/* @__PURE__ */ s(
|
|
1783
|
+
ce,
|
|
1784
|
+
{
|
|
1785
|
+
disabled: j,
|
|
1786
|
+
style: L,
|
|
1787
|
+
sx: _.button,
|
|
1788
|
+
onClick: () => {
|
|
1789
|
+
var T;
|
|
1790
|
+
return (T = document.getElementById(S)) == null ? void 0 : T.click();
|
|
1791
|
+
},
|
|
1792
|
+
children: v
|
|
1793
|
+
}
|
|
1794
|
+
),
|
|
1795
|
+
d && x.length > 0 && /* @__PURE__ */ s("ul", { className: $.className, style: $.style, children: a ? x.map((T, N) => /* @__PURE__ */ k("li", { className: P.className, style: P.style, children: [
|
|
1796
|
+
/* @__PURE__ */ s("span", { className: "flex-shrink-0 text-[var(--upload-icon-color)]", children: dt }),
|
|
1797
|
+
/* @__PURE__ */ k("span", { className: "flex-1 truncate", children: [
|
|
1798
|
+
T.name,
|
|
1799
|
+
O && /* @__PURE__ */ k("span", { className: "ml-1 text-xs text-[var(--muted-foreground)]", children: [
|
|
1800
|
+
"(",
|
|
1801
|
+
(T.size / 1024).toFixed(2),
|
|
1802
|
+
" KB)"
|
|
1803
|
+
] })
|
|
1804
|
+
] }),
|
|
1805
|
+
/* @__PURE__ */ s(
|
|
1806
|
+
"button",
|
|
1807
|
+
{
|
|
1808
|
+
type: "button",
|
|
1809
|
+
className: "flex-shrink-0 p-0.5 rounded hover:bg-[var(--upload-del-hover-bg)] text-[var(--upload-del-color)] transition-colors",
|
|
1810
|
+
onClick: () => M(T, N),
|
|
1811
|
+
"aria-label": `删除 ${T.name}`,
|
|
1812
|
+
children: ut
|
|
1813
|
+
}
|
|
1814
|
+
)
|
|
1815
|
+
] }, N)) : /* @__PURE__ */ k("li", { className: P.className, style: P.style, children: [
|
|
1816
|
+
/* @__PURE__ */ s("span", { className: "flex-shrink-0 text-[var(--upload-icon-color)]", children: dt }),
|
|
1817
|
+
/* @__PURE__ */ k("span", { className: "flex-1 truncate", children: [
|
|
1818
|
+
x[0].name,
|
|
1819
|
+
O && /* @__PURE__ */ k("span", { className: "ml-1 text-xs text-[var(--muted-foreground)]", children: [
|
|
1820
|
+
"(",
|
|
1821
|
+
(x[0].size / 1024).toFixed(2),
|
|
1822
|
+
" KB)"
|
|
1823
|
+
] })
|
|
1824
|
+
] }),
|
|
1825
|
+
/* @__PURE__ */ s(
|
|
1826
|
+
"button",
|
|
1827
|
+
{
|
|
1828
|
+
type: "button",
|
|
1829
|
+
className: "flex-shrink-0 p-0.5 rounded hover:bg-[var(--upload-del-hover-bg)] text-[var(--upload-del-color)] transition-colors",
|
|
1830
|
+
onClick: () => M(x[0], 0),
|
|
1831
|
+
"aria-label": `删除 ${x[0].name}`,
|
|
1832
|
+
children: ut
|
|
1833
|
+
}
|
|
1834
|
+
)
|
|
1835
|
+
] }) })
|
|
1836
|
+
] });
|
|
1837
|
+
}
|
|
1838
|
+
const qe = Tt(or);
|
|
1839
|
+
qe.displayName = "Upload";
|
|
1840
|
+
qe.LIST_IGNORE = zt;
|
|
1841
|
+
qe.propTypes = {
|
|
1842
|
+
sx: t.oneOfType([t.string, t.object]),
|
|
1843
|
+
style: t.object,
|
|
1844
|
+
className: t.string,
|
|
1845
|
+
accept: t.string,
|
|
1846
|
+
multiple: t.bool,
|
|
1847
|
+
onChange: t.func,
|
|
1848
|
+
beforeUpload: t.func,
|
|
1849
|
+
files: t.array,
|
|
1850
|
+
showUploadList: t.bool,
|
|
1851
|
+
maxCount: t.number,
|
|
1852
|
+
maxSize: t.number,
|
|
1853
|
+
btnText: t.string,
|
|
1854
|
+
btnStyle: t.object,
|
|
1855
|
+
showSize: t.bool,
|
|
1856
|
+
disabled: t.bool
|
|
1857
|
+
};
|
|
1858
|
+
const rr = ["root", "icon", "content", "actions", "closeIcon"], pt = {
|
|
1859
|
+
cancel: "取消",
|
|
1860
|
+
action: "操作"
|
|
1861
|
+
}, mt = {
|
|
1862
|
+
small: {
|
|
1863
|
+
rootClass: "px-[15px] py-[8px] h-[45px] rounded-[6px] gap-[8px] border",
|
|
1864
|
+
iconSize: 20,
|
|
1865
|
+
contentClass: "text-[14px]",
|
|
1866
|
+
closeIconSize: 18,
|
|
1867
|
+
buttonBorderRadius: "0.8rem",
|
|
1868
|
+
buttonGap: "8px",
|
|
1869
|
+
buttonFontSize: "13px"
|
|
1870
|
+
},
|
|
1871
|
+
normal: {
|
|
1872
|
+
rootClass: "px-[20px] py-[10px] h-[52px] rounded-[8px] gap-[10px] border",
|
|
1873
|
+
iconSize: 22,
|
|
1874
|
+
contentClass: "text-[15px]",
|
|
1875
|
+
closeIconSize: 20,
|
|
1876
|
+
buttonBorderRadius: "1rem",
|
|
1877
|
+
buttonGap: "10px",
|
|
1878
|
+
buttonFontSize: "14px"
|
|
1879
|
+
},
|
|
1880
|
+
large: {
|
|
1881
|
+
rootClass: "px-[25px] py-[12px] h-[60px] rounded-[10px] gap-[12px] border-[1.5px]",
|
|
1882
|
+
iconSize: 26,
|
|
1883
|
+
contentClass: "text-[16px]",
|
|
1884
|
+
closeIconSize: 22,
|
|
1885
|
+
buttonBorderRadius: "1.2rem",
|
|
1886
|
+
buttonGap: "12px",
|
|
1887
|
+
buttonFontSize: "15px"
|
|
1888
|
+
}
|
|
1889
|
+
}, bt = {
|
|
1890
|
+
info: {
|
|
1891
|
+
bgVar: "--banner-info-bg",
|
|
1892
|
+
borderVar: "--banner-info-border",
|
|
1893
|
+
iconVar: "--banner-info-icon",
|
|
1894
|
+
textVar: "--banner-info-text"
|
|
1895
|
+
},
|
|
1896
|
+
success: {
|
|
1897
|
+
bgVar: "--banner-success-bg",
|
|
1898
|
+
borderVar: "--banner-success-border",
|
|
1899
|
+
iconVar: "--banner-success-icon",
|
|
1900
|
+
textVar: "--banner-success-text"
|
|
1901
|
+
},
|
|
1902
|
+
warning: {
|
|
1903
|
+
bgVar: "--banner-warning-bg",
|
|
1904
|
+
borderVar: "--banner-warning-border",
|
|
1905
|
+
iconVar: "--banner-warning-icon",
|
|
1906
|
+
textVar: "--banner-warning-text"
|
|
1907
|
+
},
|
|
1908
|
+
error: {
|
|
1909
|
+
bgVar: "--banner-error-bg",
|
|
1910
|
+
borderVar: "--banner-error-border",
|
|
1911
|
+
iconVar: "--banner-error-icon",
|
|
1912
|
+
textVar: "--banner-error-text"
|
|
1913
|
+
}
|
|
1914
|
+
}, ft = (e, o, r) => Object.prototype.hasOwnProperty.call(r, e) ? e : o;
|
|
1915
|
+
function sr(e) {
|
|
1916
|
+
const {
|
|
1917
|
+
children: o,
|
|
1918
|
+
onCancel: r = () => {
|
|
1919
|
+
},
|
|
1920
|
+
onAction: n = () => {
|
|
1921
|
+
},
|
|
1922
|
+
size: c = "normal",
|
|
1923
|
+
cancelText: l,
|
|
1924
|
+
actionText: a,
|
|
1925
|
+
level: i = "info",
|
|
1926
|
+
transparent: u = !1,
|
|
1927
|
+
bannerBgColor: h,
|
|
1928
|
+
bannerBorderColor: d,
|
|
1929
|
+
bannerIconColor: p,
|
|
1930
|
+
sx: g = {},
|
|
1931
|
+
style: v = {},
|
|
1932
|
+
className: L = "",
|
|
1933
|
+
i18nKey: O,
|
|
1934
|
+
localeText: j = {},
|
|
1935
|
+
...w
|
|
1936
|
+
} = e, { t: S } = ie(), x = ft(c, "normal", mt), _ = ft(i, "info", bt), m = mt[x], y = bt[_], M = H(g, rr), A = {
|
|
1937
|
+
cancel: S("banner.cancel", pt.cancel),
|
|
1938
|
+
action: S("banner.action", pt.action),
|
|
1939
|
+
...j
|
|
1940
|
+
}, $ = l ?? (O === "cancel" ? S("banner.cancel", A.cancel) : A.cancel), P = a ?? (O === "action" ? S("banner.action", A.action) : A.action), T = o ?? $, N = h || (u === !0 ? "transparent" : `var(${y.bgVar})`), C = d || `var(${y.borderVar})`, U = p || `var(${y.iconVar})`, I = `var(${y.textVar})`, F = b({
|
|
1941
|
+
baseClassName: E(
|
|
1942
|
+
"flex w-full items-center justify-start transition-colors duration-200",
|
|
1943
|
+
m.rootClass
|
|
1944
|
+
),
|
|
1945
|
+
className: L,
|
|
1946
|
+
style: {
|
|
1947
|
+
backgroundColor: N,
|
|
1948
|
+
borderColor: C,
|
|
1949
|
+
color: u === !0 ? "var(--muted-foreground)" : I,
|
|
1950
|
+
...v
|
|
1951
|
+
},
|
|
1952
|
+
sxSlot: M.root
|
|
1953
|
+
}), B = b({
|
|
1954
|
+
baseClassName: "shrink-0",
|
|
1955
|
+
baseStyle: {
|
|
1956
|
+
width: `${m.iconSize}px`,
|
|
1957
|
+
height: `${m.iconSize}px`,
|
|
1958
|
+
color: U
|
|
1959
|
+
},
|
|
1960
|
+
sxSlot: M.icon
|
|
1961
|
+
}), D = b({
|
|
1962
|
+
baseClassName: E(
|
|
1963
|
+
"flex-grow text-left",
|
|
1964
|
+
m.contentClass
|
|
1965
|
+
),
|
|
1966
|
+
sxSlot: M.content
|
|
1967
|
+
}), W = b({
|
|
1968
|
+
baseClassName: "flex items-center justify-end flex-1",
|
|
1969
|
+
baseStyle: {
|
|
1970
|
+
gap: m.buttonGap
|
|
1971
|
+
},
|
|
1972
|
+
sxSlot: M.actions
|
|
1973
|
+
}), K = b({
|
|
1974
|
+
baseClassName: "shrink-0 cursor-pointer",
|
|
1975
|
+
baseStyle: {
|
|
1976
|
+
width: `${m.closeIconSize}px`,
|
|
1977
|
+
height: `${m.closeIconSize}px`,
|
|
1978
|
+
color: "var(--banner-close-icon)"
|
|
1979
|
+
},
|
|
1980
|
+
sxSlot: M.closeIcon
|
|
1981
|
+
}), Z = /* @__PURE__ */ k("svg", { viewBox: "0 0 1024 1024", xmlns: "http://www.w3.org/2000/svg", fill: "currentColor", children: [
|
|
1982
|
+
/* @__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
|
+
/* @__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
|
+
/* @__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__ */ k("svg", { viewBox: "0 0 1024 1024", xmlns: "http://www.w3.org/2000/svg", fill: "currentColor", children: [
|
|
1986
|
+
/* @__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
|
+
/* @__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
|
+
/* @__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
|
+
] }), re = /* @__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" }) }), de = /* @__PURE__ */ k("svg", { viewBox: "0 0 1024 1024", xmlns: "http://www.w3.org/2000/svg", fill: "currentColor", children: [
|
|
1990
|
+
/* @__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
|
+
/* @__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" }) }), fe = {
|
|
1993
|
+
success: de,
|
|
1994
|
+
warning: R,
|
|
1995
|
+
error: re,
|
|
1996
|
+
info: Z
|
|
1997
|
+
};
|
|
1998
|
+
return /* @__PURE__ */ k(
|
|
1999
|
+
"div",
|
|
2000
|
+
{
|
|
2001
|
+
className: F.className,
|
|
2002
|
+
style: F.style,
|
|
2003
|
+
"data-level": _,
|
|
2004
|
+
"data-size": x,
|
|
2005
|
+
...w,
|
|
2006
|
+
children: [
|
|
2007
|
+
/* @__PURE__ */ s("div", { className: B.className, style: B.style, children: fe[_] }),
|
|
2008
|
+
/* @__PURE__ */ s("div", { className: D.className, style: D.style, children: T }),
|
|
2009
|
+
/* @__PURE__ */ k("div", { className: W.className, style: W.style, children: [
|
|
2010
|
+
/* @__PURE__ */ s(
|
|
2011
|
+
ce,
|
|
2012
|
+
{
|
|
2013
|
+
type: "transparent",
|
|
2014
|
+
sx: {
|
|
2015
|
+
c: "var(--banner-btn-text)",
|
|
2016
|
+
br: m.buttonBorderRadius,
|
|
2017
|
+
bColor: "transparent",
|
|
2018
|
+
s: m.buttonFontSize
|
|
2019
|
+
},
|
|
2020
|
+
onClick: r,
|
|
2021
|
+
size: x === "normal" ? "medium" : x,
|
|
2022
|
+
children: $
|
|
2023
|
+
}
|
|
2024
|
+
),
|
|
2025
|
+
/* @__PURE__ */ s(
|
|
2026
|
+
ce,
|
|
2027
|
+
{
|
|
2028
|
+
type: "transparent",
|
|
2029
|
+
sx: {
|
|
2030
|
+
c: "var(--banner-btn-text)",
|
|
2031
|
+
br: m.buttonBorderRadius,
|
|
2032
|
+
b: 1,
|
|
2033
|
+
bColor: "var(--banner-btn-border)",
|
|
2034
|
+
s: m.buttonFontSize
|
|
2035
|
+
},
|
|
2036
|
+
onClick: n,
|
|
2037
|
+
size: x === "normal" ? "medium" : x,
|
|
2038
|
+
children: P
|
|
2039
|
+
}
|
|
2040
|
+
),
|
|
2041
|
+
/* @__PURE__ */ s(
|
|
2042
|
+
"div",
|
|
2043
|
+
{
|
|
2044
|
+
className: K.className,
|
|
2045
|
+
style: K.style,
|
|
2046
|
+
onClick: r,
|
|
2047
|
+
children: be
|
|
2048
|
+
}
|
|
2049
|
+
)
|
|
2050
|
+
] })
|
|
2051
|
+
]
|
|
2052
|
+
}
|
|
2053
|
+
);
|
|
2054
|
+
}
|
|
2055
|
+
sr.propTypes = {
|
|
2056
|
+
children: t.node,
|
|
2057
|
+
onCancel: t.func,
|
|
2058
|
+
onAction: t.func,
|
|
2059
|
+
size: t.oneOf(["small", "normal", "large"]),
|
|
2060
|
+
cancelText: t.string,
|
|
2061
|
+
actionText: t.string,
|
|
2062
|
+
level: t.oneOf(["info", "success", "warning", "error"]),
|
|
2063
|
+
transparent: t.bool,
|
|
2064
|
+
bannerBgColor: t.string,
|
|
2065
|
+
bannerBorderColor: t.string,
|
|
2066
|
+
bannerIconColor: t.string,
|
|
2067
|
+
sx: t.oneOfType([t.object, t.string]),
|
|
2068
|
+
style: t.object,
|
|
2069
|
+
className: t.string,
|
|
2070
|
+
i18nKey: t.string,
|
|
2071
|
+
localeText: t.object
|
|
2072
|
+
};
|
|
2073
|
+
const ar = ["root", "input", "text"], Ye = {
|
|
2074
|
+
hex: "HEX",
|
|
2075
|
+
rgb: "RGB",
|
|
2076
|
+
hsl: "HSL"
|
|
2077
|
+
}, gt = {
|
|
2078
|
+
small: { inputSize: 20, fontSize: "11px", gap: "6px" },
|
|
2079
|
+
medium: { inputSize: 28, fontSize: "12px", gap: "10px" },
|
|
2080
|
+
large: { inputSize: 36, fontSize: "14px", gap: "14px" }
|
|
2081
|
+
}, nr = {
|
|
2082
|
+
hex: "hex",
|
|
2083
|
+
rgb: "rgb",
|
|
2084
|
+
hsl: "hsl"
|
|
2085
|
+
}, ht = (e, o, r) => Object.prototype.hasOwnProperty.call(r, e) ? e : o, lr = (e) => {
|
|
2086
|
+
const o = parseInt(e.slice(1, 3), 16), r = parseInt(e.slice(3, 5), 16), n = parseInt(e.slice(5, 7), 16);
|
|
2087
|
+
return `rgb(${o}, ${r}, ${n})`;
|
|
2088
|
+
}, cr = (e) => {
|
|
2089
|
+
let o = parseInt(e.slice(1, 3), 16) / 255, r = parseInt(e.slice(3, 5), 16) / 255, n = parseInt(e.slice(5, 7), 16) / 255;
|
|
2090
|
+
const c = Math.max(o, r, n), l = Math.min(o, r, n);
|
|
2091
|
+
let a = 0, i = 0, u = (c + l) / 2;
|
|
2092
|
+
if (c !== l) {
|
|
2093
|
+
const h = c - l;
|
|
2094
|
+
i = u > 0.5 ? h / (2 - c - l) : h / (c + l), c === o ? a = (r - n) / h + (r < n ? 6 : 0) : c === r ? a = (n - o) / h + 2 : a = (o - r) / h + 4, a /= 6;
|
|
2095
|
+
}
|
|
2096
|
+
return `hsl(${Math.round(a * 360)}, ${Math.round(i * 100)}%, ${Math.round(u * 100)}%)`;
|
|
2097
|
+
}, ir = (e, o) => {
|
|
2098
|
+
switch (o) {
|
|
2099
|
+
case "rgb":
|
|
2100
|
+
return lr(e);
|
|
2101
|
+
case "hsl":
|
|
2102
|
+
return cr(e);
|
|
2103
|
+
default:
|
|
2104
|
+
return e.toUpperCase();
|
|
2105
|
+
}
|
|
2106
|
+
};
|
|
2107
|
+
function dr(e) {
|
|
2108
|
+
const {
|
|
2109
|
+
value: o,
|
|
2110
|
+
defaultValue: r = "#000000",
|
|
2111
|
+
onChange: n = () => {
|
|
2112
|
+
},
|
|
2113
|
+
disabled: c = !1,
|
|
2114
|
+
showText: l = !1,
|
|
2115
|
+
format: a = "hex",
|
|
2116
|
+
size: i = "medium",
|
|
2117
|
+
sx: u = {},
|
|
2118
|
+
style: h = {},
|
|
2119
|
+
className: d = "",
|
|
2120
|
+
i18nKey: p,
|
|
2121
|
+
localeText: g = {},
|
|
2122
|
+
...v
|
|
2123
|
+
} = e, { t: L } = ie(), O = ht(i, "medium", gt), j = ht(a, "hex", nr), w = gt[O], [S, x] = G(r), _ = o ?? S, m = H(u, ar), y = {
|
|
2124
|
+
hex: L("colorpicker.hex", Ye.hex),
|
|
2125
|
+
rgb: L("colorpicker.rgb", Ye.rgb),
|
|
2126
|
+
hsl: L("colorpicker.hsl", Ye.hsl),
|
|
2127
|
+
...g
|
|
2128
|
+
}, M = (C) => {
|
|
2129
|
+
const U = C.target.value;
|
|
2130
|
+
o === void 0 && x(U), n(U);
|
|
2131
|
+
}, A = [];
|
|
2132
|
+
if (l) {
|
|
2133
|
+
const C = p || (typeof l == "string" ? l : null) || j;
|
|
2134
|
+
A.push({
|
|
2135
|
+
label: y[C],
|
|
2136
|
+
value: ir(_, C)
|
|
2137
|
+
});
|
|
2138
|
+
}
|
|
2139
|
+
const $ = b({
|
|
2140
|
+
baseClassName: E(
|
|
2141
|
+
"inline-flex items-center",
|
|
2142
|
+
c && "cursor-not-allowed opacity-60"
|
|
2143
|
+
),
|
|
2144
|
+
className: d,
|
|
2145
|
+
baseStyle: { gap: w.gap },
|
|
2146
|
+
style: h,
|
|
2147
|
+
sxSlot: m.root
|
|
2148
|
+
}), P = b({
|
|
2149
|
+
baseClassName: E(
|
|
2150
|
+
"shrink-0 cursor-pointer border-2 border-[var(--border)] rounded-full bg-transparent overflow-hidden transition-colors duration-200",
|
|
2151
|
+
c && "cursor-not-allowed"
|
|
2152
|
+
),
|
|
2153
|
+
baseStyle: {
|
|
2154
|
+
width: `${w.inputSize}px`,
|
|
2155
|
+
height: `${w.inputSize}px`,
|
|
2156
|
+
padding: 0
|
|
2157
|
+
},
|
|
2158
|
+
sxSlot: m.input
|
|
2159
|
+
}), T = b({
|
|
2160
|
+
baseClassName: "flex flex-col text-[var(--muted-foreground)]",
|
|
2161
|
+
baseStyle: { fontSize: w.fontSize },
|
|
2162
|
+
sxSlot: m.text
|
|
2163
|
+
});
|
|
2164
|
+
return /* @__PURE__ */ k(Ne, { children: [
|
|
2165
|
+
/* @__PURE__ */ s("style", { children: `
|
|
2166
|
+
.tango-cp-input::-webkit-color-swatch-wrapper { padding: 0; }
|
|
2167
|
+
.tango-cp-input::-webkit-color-swatch { border: 0; border-radius: 9999px; }
|
|
2168
|
+
.tango-cp-input::-moz-color-swatch { border: 0; border-radius: 9999px; }
|
|
2169
|
+
` }),
|
|
2170
|
+
/* @__PURE__ */ k("div", { className: $.className, style: $.style, ...v, children: [
|
|
2171
|
+
/* @__PURE__ */ s(
|
|
2172
|
+
"input",
|
|
2173
|
+
{
|
|
2174
|
+
type: "color",
|
|
2175
|
+
value: _,
|
|
2176
|
+
onChange: M,
|
|
2177
|
+
disabled: c,
|
|
2178
|
+
className: `tango-cp-input ${P.className}`,
|
|
2179
|
+
style: P.style,
|
|
2180
|
+
"aria-label": v["aria-label"] || `颜色选择器: ${_}`
|
|
2181
|
+
}
|
|
2182
|
+
),
|
|
2183
|
+
l && A.length > 0 && /* @__PURE__ */ s("div", { className: T.className, style: T.style, children: A.map(({ label: C, value: U }) => /* @__PURE__ */ k("span", { children: [
|
|
2184
|
+
C,
|
|
2185
|
+
": ",
|
|
2186
|
+
U
|
|
2187
|
+
] }, C)) })
|
|
2188
|
+
] })
|
|
2189
|
+
] });
|
|
2190
|
+
}
|
|
2191
|
+
dr.propTypes = {
|
|
2192
|
+
value: t.string,
|
|
2193
|
+
defaultValue: t.string,
|
|
2194
|
+
onChange: t.func,
|
|
2195
|
+
disabled: t.bool,
|
|
2196
|
+
showText: t.oneOfType([t.bool, t.oneOf(["hex", "rgb", "hsl"])]),
|
|
2197
|
+
format: t.oneOf(["hex", "rgb", "hsl"]),
|
|
2198
|
+
size: t.oneOf(["small", "medium", "large"]),
|
|
2199
|
+
sx: t.oneOfType([t.object, t.string]),
|
|
2200
|
+
style: t.object,
|
|
2201
|
+
className: t.string,
|
|
2202
|
+
i18nKey: t.string,
|
|
2203
|
+
localeText: t.object
|
|
2204
|
+
};
|
|
2205
|
+
const ur = ["root", "date", "weekday", "time"], yt = {
|
|
2206
|
+
weekdayPrefix: "星期",
|
|
2207
|
+
weekdayShortPrefix: "周"
|
|
2208
|
+
}, xt = {
|
|
2209
|
+
default: "default",
|
|
2210
|
+
line: "line",
|
|
2211
|
+
full: "full",
|
|
2212
|
+
"full-line": "full-line",
|
|
2213
|
+
"year-week": "year-week",
|
|
2214
|
+
"year-week-line": "year-week-line",
|
|
2215
|
+
"week-time": "week-time",
|
|
2216
|
+
"no-s": "no-s",
|
|
2217
|
+
"no-s-line": "no-s-line"
|
|
2218
|
+
}, pr = (e, o, r) => Object.prototype.hasOwnProperty.call(r, e) ? e : o, mr = (e, o) => {
|
|
2219
|
+
const n = (/* @__PURE__ */ new Date()).toLocaleDateString(e, {
|
|
2220
|
+
year: "numeric",
|
|
2221
|
+
month: "2-digit",
|
|
2222
|
+
day: "2-digit"
|
|
2223
|
+
});
|
|
2224
|
+
return o ? n.replaceAll("/", "-") : n;
|
|
2225
|
+
}, br = (e, o) => {
|
|
2226
|
+
let n = (/* @__PURE__ */ new Date()).toLocaleString(e, { weekday: "long" });
|
|
2227
|
+
return o && e.startsWith("zh") && (n = n.replace("星期", "周")), n;
|
|
2228
|
+
}, Te = (e, o) => {
|
|
2229
|
+
const r = /* @__PURE__ */ new Date(), n = { hour: "2-digit", minute: "2-digit" };
|
|
2230
|
+
return o && (n.second = "2-digit"), r.toLocaleTimeString(e, n);
|
|
2231
|
+
}, fr = (e, o, r, n) => {
|
|
2232
|
+
const c = e.endsWith("-line"), l = mr(o, c), a = br(o, r);
|
|
2233
|
+
switch (e) {
|
|
2234
|
+
case "line":
|
|
2235
|
+
return [{ key: "date", text: l }];
|
|
2236
|
+
case "full":
|
|
2237
|
+
return [
|
|
2238
|
+
{ key: "date", text: l + " " },
|
|
2239
|
+
{ key: "weekday", text: a + " " },
|
|
2240
|
+
{ key: "time", text: Te(o, !0) }
|
|
2241
|
+
];
|
|
2242
|
+
case "full-line":
|
|
2243
|
+
return [
|
|
2244
|
+
{ key: "date", text: l + " " },
|
|
2245
|
+
{ key: "weekday", text: a + " " },
|
|
2246
|
+
{ key: "time", text: Te(o, !0) }
|
|
2247
|
+
];
|
|
2248
|
+
case "year-week":
|
|
2249
|
+
return [
|
|
2250
|
+
{ key: "date", text: l + " " },
|
|
2251
|
+
{ key: "weekday", text: a }
|
|
2252
|
+
];
|
|
2253
|
+
case "year-week-line":
|
|
2254
|
+
return [
|
|
2255
|
+
{ key: "date", text: l + " " },
|
|
2256
|
+
{ key: "weekday", text: a }
|
|
2257
|
+
];
|
|
2258
|
+
case "week-time":
|
|
2259
|
+
return [
|
|
2260
|
+
{ key: "weekday", text: a + " " },
|
|
2261
|
+
{ key: "time", text: Te(o, !0) }
|
|
2262
|
+
];
|
|
2263
|
+
case "no-s":
|
|
2264
|
+
return [
|
|
2265
|
+
{ key: "date", text: l + " " },
|
|
2266
|
+
{ key: "weekday", text: a + " " },
|
|
2267
|
+
{ key: "time", text: Te(o, !1) }
|
|
2268
|
+
];
|
|
2269
|
+
case "no-s-line":
|
|
2270
|
+
return [
|
|
2271
|
+
{ key: "date", text: l + " " },
|
|
2272
|
+
{ key: "weekday", text: a + " " },
|
|
2273
|
+
{ key: "time", text: Te(o, !1) }
|
|
2274
|
+
];
|
|
2275
|
+
default:
|
|
2276
|
+
return [{ key: "date", text: l }];
|
|
2277
|
+
}
|
|
2278
|
+
};
|
|
2279
|
+
function gr(e) {
|
|
2280
|
+
const {
|
|
2281
|
+
type: o = "default",
|
|
2282
|
+
single: r = !1,
|
|
2283
|
+
sx: n = {},
|
|
2284
|
+
style: c = {},
|
|
2285
|
+
className: l = "",
|
|
2286
|
+
i18nKey: a,
|
|
2287
|
+
localeText: i = {},
|
|
2288
|
+
...u
|
|
2289
|
+
} = e || {}, { t: h, locale: d } = ie(), p = pr(o, "default", xt), g = d === "en-US" ? "en-US" : "zh-CN";
|
|
2290
|
+
({
|
|
2291
|
+
weekdayPrefix: h("date.weekdayPrefix", yt.weekdayPrefix),
|
|
2292
|
+
weekdayShortPrefix: h("date.weekdayShortPrefix", yt.weekdayShortPrefix),
|
|
2293
|
+
...i
|
|
2294
|
+
});
|
|
2295
|
+
const v = H(n, ur), L = a && xt[a] ? a : p, O = fr(L, g, r), j = b({
|
|
2296
|
+
baseClassName: E("inline-flex items-center gap-1 text-[var(--foreground)]"),
|
|
2297
|
+
className: l,
|
|
2298
|
+
baseStyle: {},
|
|
2299
|
+
style: c,
|
|
2300
|
+
sxSlot: v.root
|
|
2301
|
+
}), w = {
|
|
2302
|
+
date: b({
|
|
2303
|
+
baseClassName: "",
|
|
2304
|
+
sxSlot: v.date
|
|
2305
|
+
}),
|
|
2306
|
+
weekday: b({
|
|
2307
|
+
baseClassName: "text-[var(--muted-foreground)]",
|
|
2308
|
+
sxSlot: v.weekday
|
|
2309
|
+
}),
|
|
2310
|
+
time: b({
|
|
2311
|
+
baseClassName: "",
|
|
2312
|
+
sxSlot: v.time
|
|
2313
|
+
})
|
|
2314
|
+
};
|
|
2315
|
+
return /* @__PURE__ */ s(
|
|
2316
|
+
"div",
|
|
2317
|
+
{
|
|
2318
|
+
className: j.className,
|
|
2319
|
+
style: j.style,
|
|
2320
|
+
role: "timer",
|
|
2321
|
+
"aria-live": "polite",
|
|
2322
|
+
...u,
|
|
2323
|
+
children: O.map((S) => {
|
|
2324
|
+
const x = w[S.key] || { className: "", style: {} };
|
|
2325
|
+
return /* @__PURE__ */ s("span", { className: x.className, style: x.style, children: S.text }, S.key);
|
|
2326
|
+
})
|
|
2327
|
+
}
|
|
2328
|
+
);
|
|
2329
|
+
}
|
|
2330
|
+
gr.propTypes = {
|
|
2331
|
+
type: t.oneOf([
|
|
2332
|
+
"default",
|
|
2333
|
+
"line",
|
|
2334
|
+
"full",
|
|
2335
|
+
"full-line",
|
|
2336
|
+
"year-week",
|
|
2337
|
+
"year-week-line",
|
|
2338
|
+
"week-time",
|
|
2339
|
+
"no-s",
|
|
2340
|
+
"no-s-line"
|
|
2341
|
+
]),
|
|
2342
|
+
single: t.bool,
|
|
2343
|
+
sx: t.oneOfType([t.object, t.string]),
|
|
2344
|
+
style: t.object,
|
|
2345
|
+
className: t.string,
|
|
2346
|
+
i18nKey: t.string,
|
|
2347
|
+
localeText: t.object
|
|
2348
|
+
};
|
|
2349
|
+
const hr = ["root", "input", "panel", "header", "body", "footer"], me = {
|
|
2350
|
+
placeholder: "YYYY-MM-DD",
|
|
2351
|
+
placeholderTime: "YYYY-MM-DD HH:mm",
|
|
2352
|
+
timeLabel: "时间",
|
|
2353
|
+
confirm: "确定",
|
|
2354
|
+
cancel: "关闭",
|
|
2355
|
+
prevMonth: "上一月",
|
|
2356
|
+
nextMonth: "下一月",
|
|
2357
|
+
weekDays: ["日", "一", "二", "三", "四", "五", "六"],
|
|
2358
|
+
monthFormat: "${year} 年 ${month} 月"
|
|
2359
|
+
}, vt = {
|
|
2360
|
+
small: { inputPx: "px-2 py-1", textSm: "text-xs", minW: "min-w-[140px]", panelW: "w-[260px]" },
|
|
2361
|
+
medium: { inputPx: "px-3 py-2", textSm: "text-sm", minW: "min-w-[180px]", panelW: "w-[300px]" },
|
|
2362
|
+
large: { inputPx: "px-4 py-3", textSm: "text-base", minW: "min-w-[220px]", panelW: "w-[340px]" }
|
|
2363
|
+
}, yr = (e, o, r) => Object.prototype.hasOwnProperty.call(r, e) ? e : o;
|
|
2364
|
+
function xr(e) {
|
|
2365
|
+
const {
|
|
2366
|
+
value: o,
|
|
2367
|
+
defaultValue: r,
|
|
2368
|
+
onChange: n = () => {
|
|
2369
|
+
},
|
|
2370
|
+
disabled: c = !1,
|
|
2371
|
+
time: l = !1,
|
|
2372
|
+
size: a = "medium",
|
|
2373
|
+
sx: i = {},
|
|
2374
|
+
style: u = {},
|
|
2375
|
+
className: h = "",
|
|
2376
|
+
i18nKey: d,
|
|
2377
|
+
localeText: p = {},
|
|
2378
|
+
placeholder: g,
|
|
2379
|
+
...v
|
|
2380
|
+
} = e, { t: L, locale: O } = ie(), j = yr(a, "medium", vt), w = vt[j], S = O === "en-US", [x, _] = G(r || ""), m = o !== void 0 ? o : x, [y, M] = G("00"), [A, $] = G("00"), [P, T] = G(!1), [N, C] = G(() => {
|
|
2381
|
+
const f = /* @__PURE__ */ new Date();
|
|
2382
|
+
return new Date(f.getFullYear(), f.getMonth(), 1);
|
|
2383
|
+
}), U = $e(null), I = {
|
|
2384
|
+
placeholder: L("datepicker.placeholder", me.placeholder),
|
|
2385
|
+
placeholderTime: L("datepicker.placeholderTime", me.placeholderTime),
|
|
2386
|
+
timeLabel: L("datepicker.timeLabel", me.timeLabel),
|
|
2387
|
+
confirm: L("datepicker.confirm", me.confirm),
|
|
2388
|
+
cancel: L("datepicker.cancel", me.cancel),
|
|
2389
|
+
prevMonth: L("datepicker.prevMonth", me.prevMonth),
|
|
2390
|
+
nextMonth: L("datepicker.nextMonth", me.nextMonth),
|
|
2391
|
+
weekDays: S ? ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"] : me.weekDays,
|
|
2392
|
+
monthFormat: S ? "${month}/${year}" : me.monthFormat,
|
|
2393
|
+
...p
|
|
2394
|
+
};
|
|
2395
|
+
le(() => {
|
|
2396
|
+
const f = (Y) => {
|
|
2397
|
+
U.current && !U.current.contains(Y.target) && T(!1);
|
|
2398
|
+
};
|
|
2399
|
+
return document.addEventListener("mousedown", f), () => document.removeEventListener("mousedown", f);
|
|
2400
|
+
}, []);
|
|
2401
|
+
const F = (f) => {
|
|
2402
|
+
const Y = f.getFullYear(), J = (f.getMonth() + 1).toString().padStart(2, "0"), ge = f.getDate().toString().padStart(2, "0");
|
|
2403
|
+
return `${Y}-${J}-${ge}`;
|
|
2404
|
+
}, B = Se(() => {
|
|
2405
|
+
const f = N.getFullYear(), Y = N.getMonth() + 1;
|
|
2406
|
+
return I.monthFormat.replace("${year}", String(f)).replace("${month}", String(Y));
|
|
2407
|
+
}, [N, I.monthFormat]), D = Se(() => {
|
|
2408
|
+
const f = N.getFullYear(), Y = N.getMonth(), J = new Date(f, Y, 1).getDay(), ge = new Date(f, Y + 1, 0).getDate(), pe = Array.from({ length: ge }, (Je, Fe) => Fe + 1);
|
|
2409
|
+
return [...Array(J).fill(null), ...pe];
|
|
2410
|
+
}, [N]), W = Se(() => m ? l ? `${m} ${y}:${A}` : m : "", [m, y, A, l]), K = (f) => {
|
|
2411
|
+
const Y = new Date(N.getFullYear(), N.getMonth(), f);
|
|
2412
|
+
return m === F(Y);
|
|
2413
|
+
}, Z = (f, Y, J) => {
|
|
2414
|
+
if (f) {
|
|
2415
|
+
if (l) {
|
|
2416
|
+
const ge = `${f}T${Y}:${J}`, pe = new Date(ge), Je = pe.getFullYear(), Fe = (pe.getMonth() + 1).toString().padStart(2, "0"), Dt = pe.getDate().toString().padStart(2, "0"), Rt = pe.getHours().toString().padStart(2, "0"), Vt = pe.getMinutes().toString().padStart(2, "0");
|
|
2417
|
+
n(`${Je}-${Fe}-${Dt} ${Rt}:${Vt}`, ge);
|
|
2418
|
+
return;
|
|
2419
|
+
}
|
|
2420
|
+
n(f, f);
|
|
2421
|
+
}
|
|
2422
|
+
}, R = (f) => {
|
|
2423
|
+
const Y = new Date(N.getFullYear(), N.getMonth(), f), J = F(Y);
|
|
2424
|
+
o === void 0 && _(J), Z(J, y, A), l || T(!1);
|
|
2425
|
+
}, re = (f) => {
|
|
2426
|
+
const Y = f.target.value;
|
|
2427
|
+
M(Y), Z(m, Y, A);
|
|
2428
|
+
}, de = (f) => {
|
|
2429
|
+
const Y = f.target.value;
|
|
2430
|
+
$(Y), Z(m, y, Y);
|
|
2431
|
+
}, be = () => {
|
|
2432
|
+
if (!c) {
|
|
2433
|
+
if (m) {
|
|
2434
|
+
const [f, Y] = m.split("-").map(Number);
|
|
2435
|
+
C(new Date(f, Y - 1, 1));
|
|
2436
|
+
}
|
|
2437
|
+
T(!0);
|
|
2438
|
+
}
|
|
2439
|
+
}, fe = Array.from({ length: 24 }, (f, Y) => String(Y).padStart(2, "0")), se = Array.from({ length: 60 }, (f, Y) => String(Y).padStart(2, "0")), ee = H(i, hr);
|
|
2440
|
+
typeof i == "string" && (ee.input.tw = E(ee.input.tw, ee.root.tw), ee.root.tw = "");
|
|
2441
|
+
const q = b({
|
|
2442
|
+
baseClassName: "relative inline-block",
|
|
2443
|
+
sxSlot: ee.root
|
|
2444
|
+
}), z = b({
|
|
2445
|
+
baseClassName: E(
|
|
2446
|
+
"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
|
+
"focus:border-[var(--primary)] focus:shadow-[0_0_0_2px_color-mix(in_srgb,var(--primary)_18%,transparent)]",
|
|
2448
|
+
"hover:border-[var(--primary)]",
|
|
2449
|
+
w.inputPx,
|
|
2450
|
+
w.textSm,
|
|
2451
|
+
w.minW,
|
|
2452
|
+
c && "bg-[var(--muted)] text-[var(--muted-foreground)] cursor-not-allowed"
|
|
2453
|
+
),
|
|
2454
|
+
className: h,
|
|
2455
|
+
style: u,
|
|
2456
|
+
sxSlot: ee.input
|
|
2457
|
+
}), X = b({
|
|
2458
|
+
baseClassName: E(
|
|
2459
|
+
"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
|
+
w.panelW
|
|
2461
|
+
),
|
|
2462
|
+
sxSlot: ee.panel
|
|
2463
|
+
}), te = b({
|
|
2464
|
+
baseClassName: "flex items-center justify-between h-10 mb-2",
|
|
2465
|
+
sxSlot: ee.header
|
|
2466
|
+
}), ae = b({
|
|
2467
|
+
baseClassName: "flex flex-wrap",
|
|
2468
|
+
sxSlot: ee.body
|
|
2469
|
+
}), ue = b({
|
|
2470
|
+
baseClassName: "mt-2.5 pt-2.5 border-t border-[var(--border)]",
|
|
2471
|
+
sxSlot: ee.footer
|
|
2472
|
+
});
|
|
2473
|
+
return /* @__PURE__ */ k("div", { className: q.className, style: q.style, ref: U, ...v, children: [
|
|
2474
|
+
/* @__PURE__ */ s(
|
|
2475
|
+
"input",
|
|
2476
|
+
{
|
|
2477
|
+
type: "text",
|
|
2478
|
+
value: W,
|
|
2479
|
+
readOnly: !0,
|
|
2480
|
+
onClick: be,
|
|
2481
|
+
className: z.className,
|
|
2482
|
+
style: z.style,
|
|
2483
|
+
disabled: c,
|
|
2484
|
+
placeholder: g || (l ? I.placeholderTime : I.placeholder),
|
|
2485
|
+
"aria-label": v["aria-label"] || g || (l ? I.placeholderTime : I.placeholder),
|
|
2486
|
+
"aria-haspopup": "dialog",
|
|
2487
|
+
"aria-expanded": P
|
|
2488
|
+
}
|
|
2489
|
+
),
|
|
2490
|
+
P && !c && /* @__PURE__ */ k("div", { className: X.className, style: X.style, role: "dialog", "aria-label": "日期选择面板", children: [
|
|
2491
|
+
/* @__PURE__ */ k("div", { className: te.className, style: te.style, children: [
|
|
2492
|
+
/* @__PURE__ */ s(
|
|
2493
|
+
"button",
|
|
2494
|
+
{
|
|
2495
|
+
type: "button",
|
|
2496
|
+
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: () => C(new Date(N.getFullYear(), N.getMonth() - 1, 1)),
|
|
2498
|
+
"aria-label": I.prevMonth,
|
|
2499
|
+
children: "<"
|
|
2500
|
+
}
|
|
2501
|
+
),
|
|
2502
|
+
/* @__PURE__ */ s("div", { className: "text-sm font-semibold text-[var(--foreground)]", children: B }),
|
|
2503
|
+
/* @__PURE__ */ s(
|
|
2504
|
+
"button",
|
|
2505
|
+
{
|
|
2506
|
+
type: "button",
|
|
2507
|
+
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: () => C(new Date(N.getFullYear(), N.getMonth() + 1, 1)),
|
|
2509
|
+
"aria-label": I.nextMonth,
|
|
2510
|
+
children: ">"
|
|
2511
|
+
}
|
|
2512
|
+
)
|
|
2513
|
+
] }),
|
|
2514
|
+
/* @__PURE__ */ k("div", { className: ae.className, style: ae.style, children: [
|
|
2515
|
+
I.weekDays.map((f) => /* @__PURE__ */ s("div", { className: "w-[calc(100%/7)] text-center leading-[30px] text-xs text-[var(--muted-foreground)]", children: f }, f)),
|
|
2516
|
+
D.map((f, Y) => {
|
|
2517
|
+
if (!f)
|
|
2518
|
+
return /* @__PURE__ */ s("div", { className: "w-[calc(100%/7)] text-center leading-[30px]" }, `empty-${Y}`);
|
|
2519
|
+
const J = K(f);
|
|
2520
|
+
return /* @__PURE__ */ s(
|
|
2521
|
+
"button",
|
|
2522
|
+
{
|
|
2523
|
+
type: "button",
|
|
2524
|
+
className: E(
|
|
2525
|
+
"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
|
+
J && "bg-[var(--primary)] text-[var(--primary-foreground)] hover:bg-[var(--primary)]"
|
|
2527
|
+
),
|
|
2528
|
+
onClick: () => R(f),
|
|
2529
|
+
"aria-label": `${N.getFullYear()}-${(N.getMonth() + 1).toString().padStart(2, "0")}-${f.toString().padStart(2, "0")}`,
|
|
2530
|
+
children: f
|
|
2531
|
+
},
|
|
2532
|
+
`${N.getFullYear()}-${N.getMonth()}-${f}`
|
|
2533
|
+
);
|
|
2534
|
+
})
|
|
2535
|
+
] }),
|
|
2536
|
+
l && /* @__PURE__ */ k("div", { className: ue.className, style: ue.style, children: [
|
|
2537
|
+
/* @__PURE__ */ s("div", { className: "text-xs text-[var(--muted-foreground)] mb-2", children: I.timeLabel }),
|
|
2538
|
+
/* @__PURE__ */ k("div", { className: "flex items-center gap-2", children: [
|
|
2539
|
+
/* @__PURE__ */ s(
|
|
2540
|
+
"select",
|
|
2541
|
+
{
|
|
2542
|
+
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
|
+
value: y,
|
|
2544
|
+
onChange: re,
|
|
2545
|
+
"aria-label": "小时",
|
|
2546
|
+
children: fe.map((f) => /* @__PURE__ */ s("option", { value: f, children: f }, f))
|
|
2547
|
+
}
|
|
2548
|
+
),
|
|
2549
|
+
/* @__PURE__ */ s("span", { className: "font-semibold text-[var(--muted-foreground)]", children: ":" }),
|
|
2550
|
+
/* @__PURE__ */ s(
|
|
2551
|
+
"select",
|
|
2552
|
+
{
|
|
2553
|
+
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
|
+
value: A,
|
|
2555
|
+
onChange: de,
|
|
2556
|
+
"aria-label": "分钟",
|
|
2557
|
+
children: se.map((f) => /* @__PURE__ */ s("option", { value: f, children: f }, f))
|
|
2558
|
+
}
|
|
2559
|
+
)
|
|
2560
|
+
] }),
|
|
2561
|
+
/* @__PURE__ */ k("div", { className: "mt-2.5 flex justify-end gap-2", children: [
|
|
2562
|
+
/* @__PURE__ */ s(
|
|
2563
|
+
ce,
|
|
2564
|
+
{
|
|
2565
|
+
onClick: () => T(!1),
|
|
2566
|
+
size: "small",
|
|
2567
|
+
type: "transparent",
|
|
2568
|
+
outline: !0,
|
|
2569
|
+
children: I.cancel
|
|
2570
|
+
}
|
|
2571
|
+
),
|
|
2572
|
+
/* @__PURE__ */ s(
|
|
2573
|
+
ce,
|
|
2574
|
+
{
|
|
2575
|
+
onClick: () => T(!1),
|
|
2576
|
+
size: "small",
|
|
2577
|
+
children: I.confirm
|
|
2578
|
+
}
|
|
2579
|
+
)
|
|
2580
|
+
] })
|
|
2581
|
+
] })
|
|
2582
|
+
] })
|
|
2583
|
+
] });
|
|
2584
|
+
}
|
|
2585
|
+
xr.propTypes = {
|
|
2586
|
+
value: t.string,
|
|
2587
|
+
defaultValue: t.string,
|
|
2588
|
+
onChange: t.func,
|
|
2589
|
+
disabled: t.bool,
|
|
2590
|
+
time: t.bool,
|
|
2591
|
+
size: t.oneOf(["small", "medium", "large"]),
|
|
2592
|
+
sx: t.oneOfType([t.object, t.string]),
|
|
2593
|
+
style: t.object,
|
|
2594
|
+
className: t.string,
|
|
2595
|
+
i18nKey: t.string,
|
|
2596
|
+
localeText: t.object
|
|
2597
|
+
};
|
|
2598
|
+
const vr = ["overlay", "container", "header", "title", "closeBtn", "content", "footer"], _e = {
|
|
2599
|
+
title: "基础标题",
|
|
2600
|
+
okText: "确定",
|
|
2601
|
+
cancelText: "取消",
|
|
2602
|
+
closeAriaLabel: "关闭"
|
|
2603
|
+
}, Sr = { right: "right", left: "left", top: "top", bottom: "bottom" }, Nr = {
|
|
2604
|
+
right: "right-0 top-0 h-full",
|
|
2605
|
+
left: "left-0 top-0 h-full",
|
|
2606
|
+
top: "top-0 left-0 w-full",
|
|
2607
|
+
bottom: "bottom-0 left-0 w-full"
|
|
2608
|
+
}, wr = {
|
|
2609
|
+
right: "translateX(100%)",
|
|
2610
|
+
left: "translateX(-100%)",
|
|
2611
|
+
top: "translateY(-100%)",
|
|
2612
|
+
bottom: "translateY(100%)"
|
|
2613
|
+
}, Cr = (e, o, r) => Object.prototype.hasOwnProperty.call(r, e) ? e : o;
|
|
2614
|
+
function Tr(e) {
|
|
2615
|
+
const {
|
|
2616
|
+
children: o,
|
|
2617
|
+
title: r,
|
|
2618
|
+
okText: n,
|
|
2619
|
+
cancelText: c,
|
|
2620
|
+
open: l = !1,
|
|
2621
|
+
onClose: a = () => {
|
|
2622
|
+
},
|
|
2623
|
+
onOk: i,
|
|
2624
|
+
type: u = "right",
|
|
2625
|
+
width: h,
|
|
2626
|
+
height: d,
|
|
2627
|
+
sx: p = {},
|
|
2628
|
+
style: g = {},
|
|
2629
|
+
className: v = "",
|
|
2630
|
+
maskClosable: L = !0,
|
|
2631
|
+
footerButtons: O,
|
|
2632
|
+
localeText: j = {},
|
|
2633
|
+
...w
|
|
2634
|
+
} = e, { t: S } = ie(), x = Cr(u, "right", Sr), [_, m] = G(!1), [y, M] = G(!1);
|
|
2635
|
+
le(() => {
|
|
2636
|
+
if (l) {
|
|
2637
|
+
m(!0);
|
|
2638
|
+
const R = setTimeout(() => M(!0), 30);
|
|
2639
|
+
return () => clearTimeout(R);
|
|
2640
|
+
}
|
|
2641
|
+
if (_) {
|
|
2642
|
+
M(!1);
|
|
2643
|
+
const R = setTimeout(() => m(!1), 300);
|
|
2644
|
+
return () => clearTimeout(R);
|
|
2645
|
+
}
|
|
2646
|
+
}, [l]), le(() => {
|
|
2647
|
+
if (_) {
|
|
2648
|
+
const R = document.body.style.overflow;
|
|
2649
|
+
return document.body.style.overflow = "hidden", () => {
|
|
2650
|
+
document.body.style.overflow = R;
|
|
2651
|
+
};
|
|
2652
|
+
}
|
|
2653
|
+
}, [_]);
|
|
2654
|
+
const A = {};
|
|
2655
|
+
x === "left" || x === "right" ? A.width = h || "320px" : A.height = d || "300px";
|
|
2656
|
+
const $ = {
|
|
2657
|
+
title: r ?? S("drawer.title", _e.title),
|
|
2658
|
+
okText: n ?? S("drawer.okText", _e.okText),
|
|
2659
|
+
cancelText: c ?? S("drawer.cancelText", _e.cancelText),
|
|
2660
|
+
closeAriaLabel: S("drawer.closeAriaLabel", _e.closeAriaLabel),
|
|
2661
|
+
...j
|
|
2662
|
+
}, P = H(p, vr), T = b({
|
|
2663
|
+
baseClassName: "fixed inset-0 z-[999] flex",
|
|
2664
|
+
sxSlot: P.overlay
|
|
2665
|
+
}), N = {
|
|
2666
|
+
tw: E(P.root.tw, P.container.tw),
|
|
2667
|
+
css: { ...P.root.css, ...P.container.css }
|
|
2668
|
+
}, C = b({
|
|
2669
|
+
baseClassName: E(
|
|
2670
|
+
"fixed bg-[var(--card)] text-[var(--foreground)] flex flex-col transition-all duration-300 ease-in-out",
|
|
2671
|
+
Nr[x]
|
|
2672
|
+
),
|
|
2673
|
+
className: v,
|
|
2674
|
+
style: {
|
|
2675
|
+
...A,
|
|
2676
|
+
transform: y ? "translate(0, 0)" : wr[x],
|
|
2677
|
+
...g
|
|
2678
|
+
},
|
|
2679
|
+
sxSlot: N
|
|
2680
|
+
}), U = b({
|
|
2681
|
+
baseClassName: "flex items-center justify-between px-5 pt-5 pb-3 shrink-0",
|
|
2682
|
+
sxSlot: P.header
|
|
2683
|
+
}), I = b({
|
|
2684
|
+
baseClassName: "text-lg font-bold text-[var(--foreground)]",
|
|
2685
|
+
sxSlot: P.title
|
|
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
|
|
2689
|
+
}), B = b({
|
|
2690
|
+
baseClassName: "flex-1 overflow-auto overscroll-contain px-5 py-2 text-[var(--foreground)]",
|
|
2691
|
+
sxSlot: P.content
|
|
2692
|
+
}), D = b({
|
|
2693
|
+
baseClassName: "flex justify-end gap-2 px-5 py-4 border-t border-[var(--border)] shrink-0",
|
|
2694
|
+
sxSlot: P.footer
|
|
2695
|
+
}), W = (R) => {
|
|
2696
|
+
L && R.target === R.currentTarget && a();
|
|
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" }) }), Z = O != null && O.length ? O : [
|
|
2698
|
+
{ key: "cancel", text: $.cancelText, onClick: a },
|
|
2699
|
+
{ key: "ok", text: $.okText, onClick: i || a }
|
|
2700
|
+
];
|
|
2701
|
+
return _ ? /* @__PURE__ */ s(
|
|
2702
|
+
"div",
|
|
2703
|
+
{
|
|
2704
|
+
className: T.className,
|
|
2705
|
+
style: {
|
|
2706
|
+
...T.style,
|
|
2707
|
+
backgroundColor: "rgba(0, 0, 0, 0.5)",
|
|
2708
|
+
opacity: y ? 1 : 0,
|
|
2709
|
+
transition: "opacity 300ms ease-in-out"
|
|
2710
|
+
},
|
|
2711
|
+
onClick: W,
|
|
2712
|
+
role: "dialog",
|
|
2713
|
+
"aria-modal": "true",
|
|
2714
|
+
"aria-label": $.title,
|
|
2715
|
+
...w,
|
|
2716
|
+
children: /* @__PURE__ */ k("div", { className: C.className, style: C.style, children: [
|
|
2717
|
+
/* @__PURE__ */ k("div", { className: U.className, style: U.style, children: [
|
|
2718
|
+
/* @__PURE__ */ s("h3", { className: I.className, style: I.style, children: $.title }),
|
|
2719
|
+
/* @__PURE__ */ s(
|
|
2720
|
+
"div",
|
|
2721
|
+
{
|
|
2722
|
+
className: F.className,
|
|
2723
|
+
style: F.style,
|
|
2724
|
+
onClick: a,
|
|
2725
|
+
role: "button",
|
|
2726
|
+
tabIndex: 0,
|
|
2727
|
+
"aria-label": $.closeAriaLabel,
|
|
2728
|
+
onKeyDown: (R) => {
|
|
2729
|
+
(R.key === "Enter" || R.key === " ") && a();
|
|
2730
|
+
},
|
|
2731
|
+
children: K
|
|
2732
|
+
}
|
|
2733
|
+
)
|
|
2734
|
+
] }),
|
|
2735
|
+
/* @__PURE__ */ s("div", { className: B.className, style: B.style, children: o }),
|
|
2736
|
+
/* @__PURE__ */ s("div", { className: D.className, style: D.style, children: Z.map((R) => {
|
|
2737
|
+
const re = R.key === "ok";
|
|
2738
|
+
return /* @__PURE__ */ s(
|
|
2739
|
+
ce,
|
|
2740
|
+
{
|
|
2741
|
+
onClick: R.onClick,
|
|
2742
|
+
type: "default",
|
|
2743
|
+
outline: !re,
|
|
2744
|
+
size: "medium",
|
|
2745
|
+
style: re ? {
|
|
2746
|
+
backgroundColor: "var(--drawer-ok-bg)",
|
|
2747
|
+
color: "var(--drawer-ok-fg)",
|
|
2748
|
+
borderColor: "var(--drawer-ok-bg)"
|
|
2749
|
+
} : {
|
|
2750
|
+
backgroundColor: "var(--drawer-cancel-bg)",
|
|
2751
|
+
color: "var(--drawer-cancel-fg)"
|
|
2752
|
+
},
|
|
2753
|
+
children: R.text
|
|
2754
|
+
},
|
|
2755
|
+
R.key
|
|
2756
|
+
);
|
|
2757
|
+
}) })
|
|
2758
|
+
] })
|
|
2759
|
+
}
|
|
2760
|
+
) : null;
|
|
2761
|
+
}
|
|
2762
|
+
Tr.propTypes = {
|
|
2763
|
+
children: t.node,
|
|
2764
|
+
title: t.string,
|
|
2765
|
+
okText: t.string,
|
|
2766
|
+
cancelText: t.string,
|
|
2767
|
+
open: t.bool,
|
|
2768
|
+
onClose: t.func,
|
|
2769
|
+
onOk: t.func,
|
|
2770
|
+
type: t.oneOf(["top", "bottom", "left", "right"]),
|
|
2771
|
+
width: t.oneOfType([t.string, t.number]),
|
|
2772
|
+
height: t.oneOfType([t.string, t.number]),
|
|
2773
|
+
sx: t.oneOfType([t.object, t.string]),
|
|
2774
|
+
style: t.object,
|
|
2775
|
+
className: t.string,
|
|
2776
|
+
maskClosable: t.bool,
|
|
2777
|
+
footerButtons: t.arrayOf(
|
|
2778
|
+
t.shape({
|
|
2779
|
+
key: t.string.isRequired,
|
|
2780
|
+
text: t.string.isRequired,
|
|
2781
|
+
onClick: t.func.isRequired
|
|
2782
|
+
})
|
|
2783
|
+
),
|
|
2784
|
+
localeText: t.object
|
|
2785
|
+
};
|
|
2786
|
+
const kr = ["root", "text"], St = {
|
|
2787
|
+
small: "my-0.5",
|
|
2788
|
+
medium: "my-1.5",
|
|
2789
|
+
large: "my-2.5",
|
|
2790
|
+
huge: "my-4"
|
|
2791
|
+
};
|
|
2792
|
+
function Lr(e, o) {
|
|
2793
|
+
const {
|
|
2794
|
+
sx: r = {},
|
|
2795
|
+
style: n = {},
|
|
2796
|
+
className: c = "",
|
|
2797
|
+
size: l = "medium",
|
|
2798
|
+
children: a,
|
|
2799
|
+
...i
|
|
2800
|
+
} = e, u = H(r, kr), h = St[l] || St.medium, d = !!a, p = b({
|
|
2801
|
+
baseClassName: E(
|
|
2802
|
+
"flex items-center justify-center relative w-full",
|
|
2803
|
+
h
|
|
2804
|
+
),
|
|
2805
|
+
className: c,
|
|
2806
|
+
sxSlot: u.root,
|
|
2807
|
+
baseStyle: {},
|
|
2808
|
+
style: n
|
|
2809
|
+
}), g = b({
|
|
2810
|
+
baseClassName: "px-2 whitespace-nowrap z-[1]",
|
|
2811
|
+
sxSlot: u.text
|
|
2812
|
+
});
|
|
2813
|
+
return /* @__PURE__ */ k(
|
|
2814
|
+
"div",
|
|
2815
|
+
{
|
|
2816
|
+
ref: o,
|
|
2817
|
+
className: p.className,
|
|
2818
|
+
style: p.style,
|
|
2819
|
+
...i,
|
|
2820
|
+
children: [
|
|
2821
|
+
/* @__PURE__ */ s(
|
|
2822
|
+
"span",
|
|
2823
|
+
{
|
|
2824
|
+
className: `flex-1 h-px bg-[var(--line-color)] ${d ? "mr-2.5" : ""}`
|
|
2825
|
+
}
|
|
2826
|
+
),
|
|
2827
|
+
d && /* @__PURE__ */ s("span", { className: g.className, style: g.style, children: a }),
|
|
2828
|
+
/* @__PURE__ */ s(
|
|
2829
|
+
"span",
|
|
2830
|
+
{
|
|
2831
|
+
className: `flex-1 h-px bg-[var(--line-color)] ${d ? "ml-2.5" : ""}`
|
|
2832
|
+
}
|
|
2833
|
+
)
|
|
2834
|
+
]
|
|
2835
|
+
}
|
|
2836
|
+
);
|
|
2837
|
+
}
|
|
2838
|
+
const Et = Q.forwardRef(Lr);
|
|
2839
|
+
Et.displayName = "Line";
|
|
2840
|
+
Et.propTypes = {
|
|
2841
|
+
size: t.oneOf(["small", "medium", "large", "huge"]),
|
|
2842
|
+
sx: t.oneOfType([t.string, t.object]),
|
|
2843
|
+
style: t.object,
|
|
2844
|
+
className: t.string,
|
|
2845
|
+
children: t.node
|
|
2846
|
+
};
|
|
2847
|
+
const Pr = ["root"], Nt = {
|
|
2848
|
+
default: "bg-[var(--mark-default-bg)]",
|
|
2849
|
+
primary: "bg-[var(--mark-primary-bg)]",
|
|
2850
|
+
success: "bg-[var(--mark-success-bg)]",
|
|
2851
|
+
warning: "bg-[var(--mark-warning-bg)]",
|
|
2852
|
+
danger: "bg-[var(--mark-danger-bg)]"
|
|
2853
|
+
};
|
|
2854
|
+
function _r(e, o) {
|
|
2855
|
+
const {
|
|
2856
|
+
sx: r = {},
|
|
2857
|
+
style: n = {},
|
|
2858
|
+
className: c = "",
|
|
2859
|
+
color: l = "default",
|
|
2860
|
+
beauty: a = !1,
|
|
2861
|
+
children: i,
|
|
2862
|
+
...u
|
|
2863
|
+
} = e, h = H(r, Pr), d = Nt[l] || Nt.default, p = b({
|
|
2864
|
+
baseClassName: E(
|
|
2865
|
+
"inline-block",
|
|
2866
|
+
d,
|
|
2867
|
+
a ? "px-2 py-1 rounded" : ""
|
|
2868
|
+
),
|
|
2869
|
+
className: c,
|
|
2870
|
+
sxSlot: h.root,
|
|
2871
|
+
baseStyle: {},
|
|
2872
|
+
style: n
|
|
2873
|
+
});
|
|
2874
|
+
return /* @__PURE__ */ s(
|
|
2875
|
+
"mark",
|
|
2876
|
+
{
|
|
2877
|
+
ref: o,
|
|
2878
|
+
className: p.className,
|
|
2879
|
+
style: p.style,
|
|
2880
|
+
...u,
|
|
2881
|
+
children: i
|
|
2882
|
+
}
|
|
2883
|
+
);
|
|
2884
|
+
}
|
|
2885
|
+
const $t = Q.forwardRef(_r);
|
|
2886
|
+
$t.displayName = "Mark";
|
|
2887
|
+
$t.propTypes = {
|
|
2888
|
+
color: t.oneOf(["default", "primary", "success", "warning", "danger"]),
|
|
2889
|
+
beauty: t.bool,
|
|
2890
|
+
sx: t.oneOfType([t.string, t.object]),
|
|
2891
|
+
style: t.object,
|
|
2892
|
+
className: t.string,
|
|
2893
|
+
children: t.node
|
|
2894
|
+
};
|
|
2895
|
+
const Or = ["overlay", "container", "header", "title", "closeBtn", "content", "footer"], Oe = {
|
|
2896
|
+
title: "基础标题",
|
|
2897
|
+
okText: "确定",
|
|
2898
|
+
cancelText: "取消",
|
|
2899
|
+
closeAriaLabel: "关闭"
|
|
2900
|
+
};
|
|
2901
|
+
function Ar(e) {
|
|
2902
|
+
const {
|
|
2903
|
+
children: o,
|
|
2904
|
+
title: r,
|
|
2905
|
+
okText: n,
|
|
2906
|
+
cancelText: c,
|
|
2907
|
+
open: l = !1,
|
|
2908
|
+
onClose: a = () => {
|
|
2909
|
+
},
|
|
2910
|
+
onOk: i,
|
|
2911
|
+
width: u,
|
|
2912
|
+
sx: h = {},
|
|
2913
|
+
style: d = {},
|
|
2914
|
+
className: p = "",
|
|
2915
|
+
maskClosable: g = !0,
|
|
2916
|
+
footerButtons: v,
|
|
2917
|
+
localeText: L = {},
|
|
2918
|
+
...O
|
|
2919
|
+
} = e, { t: j } = ie(), [w, S] = G(!1), [x, _] = G(!1);
|
|
2920
|
+
le(() => {
|
|
2921
|
+
if (l) {
|
|
2922
|
+
S(!0);
|
|
2923
|
+
const D = setTimeout(() => _(!0), 30);
|
|
2924
|
+
return () => clearTimeout(D);
|
|
2925
|
+
}
|
|
2926
|
+
if (w) {
|
|
2927
|
+
_(!1);
|
|
2928
|
+
const D = setTimeout(() => S(!1), 300);
|
|
2929
|
+
return () => clearTimeout(D);
|
|
2930
|
+
}
|
|
2931
|
+
}, [l]), le(() => {
|
|
2932
|
+
if (w) {
|
|
2933
|
+
const D = document.body.style.overflow;
|
|
2934
|
+
return document.body.style.overflow = "hidden", () => {
|
|
2935
|
+
document.body.style.overflow = D;
|
|
2936
|
+
};
|
|
2937
|
+
}
|
|
2938
|
+
}, [w]);
|
|
2939
|
+
const m = {
|
|
2940
|
+
title: r ?? j("modal.title", Oe.title),
|
|
2941
|
+
okText: n ?? j("modal.okText", Oe.okText),
|
|
2942
|
+
cancelText: c ?? j("modal.cancelText", Oe.cancelText),
|
|
2943
|
+
closeAriaLabel: j("modal.closeAriaLabel", Oe.closeAriaLabel),
|
|
2944
|
+
...L
|
|
2945
|
+
}, y = H(h, Or), M = b({
|
|
2946
|
+
baseClassName: "fixed inset-0 z-[999] flex justify-center items-center",
|
|
2947
|
+
sxSlot: y.overlay
|
|
2948
|
+
}), A = {
|
|
2949
|
+
tw: E(y.root.tw, y.container.tw),
|
|
2950
|
+
css: { ...y.root.css, ...y.container.css }
|
|
2951
|
+
}, $ = b({
|
|
2952
|
+
baseClassName: "bg-[var(--modal-bg)] text-[var(--foreground)] flex flex-col rounded-[var(--radius)] shadow-[var(--modal-shadow)] transition-all duration-300 ease-in-out",
|
|
2953
|
+
className: p,
|
|
2954
|
+
style: {
|
|
2955
|
+
width: u || "520px",
|
|
2956
|
+
maxWidth: "90vw",
|
|
2957
|
+
minHeight: "200px",
|
|
2958
|
+
maxHeight: "80vh",
|
|
2959
|
+
transform: x ? "scale(1)" : "scale(0.8)",
|
|
2960
|
+
opacity: x ? 1 : 0,
|
|
2961
|
+
...d
|
|
2962
|
+
},
|
|
2963
|
+
sxSlot: A
|
|
2964
|
+
}), P = b({
|
|
2965
|
+
baseClassName: "flex items-center justify-between px-5 pt-5 pb-3 shrink-0",
|
|
2966
|
+
sxSlot: y.header
|
|
2967
|
+
}), T = b({
|
|
2968
|
+
baseClassName: "text-lg font-bold text-[var(--foreground)]",
|
|
2969
|
+
sxSlot: y.title
|
|
2970
|
+
}), N = b({
|
|
2971
|
+
baseClassName: "cursor-pointer p-1 rounded-md hover:bg-[var(--muted)] transition-colors text-[var(--muted-foreground)]",
|
|
2972
|
+
sxSlot: y.closeBtn
|
|
2973
|
+
}), C = b({
|
|
2974
|
+
baseClassName: "flex-1 overflow-auto overscroll-contain px-6 py-5 text-[var(--foreground)]",
|
|
2975
|
+
sxSlot: y.content
|
|
2976
|
+
}), U = b({
|
|
2977
|
+
baseClassName: "flex justify-end gap-2 px-5 py-4 border-t border-[var(--border)] shrink-0",
|
|
2978
|
+
sxSlot: y.footer
|
|
2979
|
+
}), I = (D) => {
|
|
2980
|
+
g && D.target === D.currentTarget && a();
|
|
2981
|
+
}, F = /* @__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" }) }), B = v != null && v.length ? v : [
|
|
2982
|
+
{ key: "cancel", text: m.cancelText, onClick: a },
|
|
2983
|
+
{ key: "ok", text: m.okText, onClick: i || a }
|
|
2984
|
+
];
|
|
2985
|
+
return w ? /* @__PURE__ */ s(
|
|
2986
|
+
"div",
|
|
2987
|
+
{
|
|
2988
|
+
className: M.className,
|
|
2989
|
+
style: {
|
|
2990
|
+
...M.style,
|
|
2991
|
+
backgroundColor: "rgba(0, 0, 0, 0.5)",
|
|
2992
|
+
opacity: x ? 1 : 0,
|
|
2993
|
+
transition: "opacity 300ms ease-in-out"
|
|
2994
|
+
},
|
|
2995
|
+
onClick: I,
|
|
2996
|
+
role: "dialog",
|
|
2997
|
+
"aria-modal": "true",
|
|
2998
|
+
"aria-label": m.title,
|
|
2999
|
+
...O,
|
|
3000
|
+
children: /* @__PURE__ */ k("div", { className: $.className, style: $.style, children: [
|
|
3001
|
+
/* @__PURE__ */ k("div", { className: P.className, style: P.style, children: [
|
|
3002
|
+
/* @__PURE__ */ s("h3", { className: T.className, style: T.style, children: m.title }),
|
|
3003
|
+
/* @__PURE__ */ s(
|
|
3004
|
+
"div",
|
|
3005
|
+
{
|
|
3006
|
+
className: N.className,
|
|
3007
|
+
style: N.style,
|
|
3008
|
+
onClick: a,
|
|
3009
|
+
role: "button",
|
|
3010
|
+
tabIndex: 0,
|
|
3011
|
+
"aria-label": m.closeAriaLabel,
|
|
3012
|
+
onKeyDown: (D) => {
|
|
3013
|
+
(D.key === "Enter" || D.key === " ") && a();
|
|
3014
|
+
},
|
|
3015
|
+
children: F
|
|
3016
|
+
}
|
|
3017
|
+
)
|
|
3018
|
+
] }),
|
|
3019
|
+
/* @__PURE__ */ s("div", { className: C.className, style: C.style, children: o }),
|
|
3020
|
+
/* @__PURE__ */ s("div", { className: U.className, style: U.style, children: B.map((D) => {
|
|
3021
|
+
const W = D.key === "ok";
|
|
3022
|
+
return /* @__PURE__ */ s(
|
|
3023
|
+
ce,
|
|
3024
|
+
{
|
|
3025
|
+
onClick: D.onClick,
|
|
3026
|
+
type: "default",
|
|
3027
|
+
outline: !W,
|
|
3028
|
+
size: "medium",
|
|
3029
|
+
style: W ? {
|
|
3030
|
+
backgroundColor: "var(--modal-ok-bg)",
|
|
3031
|
+
color: "var(--modal-ok-fg)",
|
|
3032
|
+
borderColor: "var(--modal-ok-bg)"
|
|
3033
|
+
} : {
|
|
3034
|
+
backgroundColor: "var(--modal-cancel-bg)",
|
|
3035
|
+
color: "var(--modal-cancel-fg)"
|
|
3036
|
+
},
|
|
3037
|
+
children: D.text
|
|
3038
|
+
},
|
|
3039
|
+
D.key
|
|
3040
|
+
);
|
|
3041
|
+
}) })
|
|
3042
|
+
] })
|
|
3043
|
+
}
|
|
3044
|
+
) : null;
|
|
3045
|
+
}
|
|
3046
|
+
Ar.propTypes = {
|
|
3047
|
+
children: t.node,
|
|
3048
|
+
title: t.string,
|
|
3049
|
+
okText: t.string,
|
|
3050
|
+
cancelText: t.string,
|
|
3051
|
+
open: t.bool,
|
|
3052
|
+
onClose: t.func,
|
|
3053
|
+
onOk: t.func,
|
|
3054
|
+
width: t.oneOfType([t.string, t.number]),
|
|
3055
|
+
sx: t.oneOfType([t.object, t.string]),
|
|
3056
|
+
style: t.object,
|
|
3057
|
+
className: t.string,
|
|
3058
|
+
maskClosable: t.bool,
|
|
3059
|
+
footerButtons: t.arrayOf(
|
|
3060
|
+
t.shape({
|
|
3061
|
+
key: t.string.isRequired,
|
|
3062
|
+
text: t.string.isRequired,
|
|
3063
|
+
onClick: t.func.isRequired
|
|
3064
|
+
})
|
|
3065
|
+
),
|
|
3066
|
+
localeText: t.object
|
|
3067
|
+
};
|
|
3068
|
+
const Mr = ["root", "input", "button"], zr = {
|
|
3069
|
+
small: "small",
|
|
3070
|
+
medium: "medium",
|
|
3071
|
+
large: "large",
|
|
3072
|
+
huge: "huge"
|
|
3073
|
+
}, Er = {
|
|
3074
|
+
small: "h-8 text-xs pl-2.5 pr-20",
|
|
3075
|
+
medium: "h-10 text-sm pl-3 pr-24",
|
|
3076
|
+
large: "h-12 text-base pl-3.5 pr-28",
|
|
3077
|
+
huge: "h-14 text-lg pl-4 pr-32"
|
|
3078
|
+
}, $r = {
|
|
3079
|
+
small: "small",
|
|
3080
|
+
medium: "small",
|
|
3081
|
+
large: "medium",
|
|
3082
|
+
huge: "medium"
|
|
3083
|
+
}, wt = {
|
|
3084
|
+
placeholder: "请输入内容",
|
|
3085
|
+
btnText: "搜索"
|
|
3086
|
+
}, Br = (e, o, r) => Object.prototype.hasOwnProperty.call(r, e) ? e : o;
|
|
3087
|
+
function Ir(e) {
|
|
3088
|
+
const {
|
|
3089
|
+
size: o = "medium",
|
|
3090
|
+
sx: r = {},
|
|
3091
|
+
style: n = {},
|
|
3092
|
+
className: c = "",
|
|
3093
|
+
onSearch: l,
|
|
3094
|
+
value: a,
|
|
3095
|
+
defaultValue: i,
|
|
3096
|
+
disabled: u = !1,
|
|
3097
|
+
placeholder: h,
|
|
3098
|
+
btnText: d,
|
|
3099
|
+
localeText: p,
|
|
3100
|
+
path: g = "",
|
|
3101
|
+
...v
|
|
3102
|
+
} = e, { t: L } = ie(), O = $e(null), j = Br(o, "medium", zr), w = a !== void 0, S = L("search.placeholder", wt.placeholder), x = L("search.btnText", wt.btnText), _ = h ?? (p == null ? void 0 : p.placeholder) ?? S, m = d ?? (p == null ? void 0 : p.btnText) ?? x, y = H(r, Mr), M = {
|
|
3103
|
+
tw: E(y.root.tw, y.input.tw),
|
|
3104
|
+
css: { ...y.root.css, ...y.input.css }
|
|
3105
|
+
}, A = E("relative inline-flex", y.root.tw), $ = E(
|
|
3106
|
+
"w-[300px] rounded-[var(--radius)] border bg-[var(--input-bg)] text-[var(--foreground)] outline-none transition-all duration-200 ease-in-out",
|
|
3107
|
+
"border-[var(--border)] shadow-[var(--input-shadow)]",
|
|
3108
|
+
"hover:border-[var(--input-accent)]",
|
|
3109
|
+
"focus:border-[var(--input-accent)] focus:shadow-[var(--input-focus-shadow)]",
|
|
3110
|
+
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[j]
|
|
3112
|
+
), P = b({
|
|
3113
|
+
baseClassName: $,
|
|
3114
|
+
className: c,
|
|
3115
|
+
style: n,
|
|
3116
|
+
sxSlot: M
|
|
3117
|
+
}), T = b({
|
|
3118
|
+
baseClassName: "absolute top-1/2 -translate-y-1/2",
|
|
3119
|
+
sxSlot: y.button,
|
|
3120
|
+
style: { right: "calc(var(--spacing) * 2)" }
|
|
3121
|
+
}), N = oe(() => {
|
|
3122
|
+
var I;
|
|
3123
|
+
return w ? a : ((I = O.current) == null ? void 0 : I.value) ?? "";
|
|
3124
|
+
}, [w, a]), C = oe(() => {
|
|
3125
|
+
l == null || l(N());
|
|
3126
|
+
}, [l, N]), U = oe((I) => {
|
|
3127
|
+
I.key === "Enter" && C();
|
|
3128
|
+
}, [C]);
|
|
3129
|
+
return /* @__PURE__ */ k("div", { className: A, children: [
|
|
3130
|
+
/* @__PURE__ */ s(
|
|
3131
|
+
"input",
|
|
3132
|
+
{
|
|
3133
|
+
ref: w ? void 0 : O,
|
|
3134
|
+
className: P.className,
|
|
3135
|
+
style: P.style,
|
|
3136
|
+
onKeyDown: U,
|
|
3137
|
+
value: w ? a : void 0,
|
|
3138
|
+
defaultValue: w ? void 0 : i ?? "",
|
|
3139
|
+
disabled: u || void 0,
|
|
3140
|
+
placeholder: _,
|
|
3141
|
+
type: "text",
|
|
3142
|
+
role: "searchbox",
|
|
3143
|
+
"aria-label": _,
|
|
3144
|
+
...v
|
|
3145
|
+
}
|
|
3146
|
+
),
|
|
3147
|
+
/* @__PURE__ */ s("div", { className: T.className, style: T.style, children: /* @__PURE__ */ s(
|
|
3148
|
+
ce,
|
|
3149
|
+
{
|
|
3150
|
+
onClick: C,
|
|
3151
|
+
size: $r[j],
|
|
3152
|
+
disabled: u,
|
|
3153
|
+
"aria-label": m,
|
|
3154
|
+
children: g ? /* @__PURE__ */ s(
|
|
3155
|
+
"img",
|
|
3156
|
+
{
|
|
3157
|
+
src: g,
|
|
3158
|
+
alt: "search-icon",
|
|
3159
|
+
style: { width: 16, height: 16, marginTop: 2, marginBottom: -3 }
|
|
3160
|
+
}
|
|
3161
|
+
) : m
|
|
3162
|
+
}
|
|
3163
|
+
) })
|
|
3164
|
+
] });
|
|
3165
|
+
}
|
|
3166
|
+
Ir.propTypes = {
|
|
3167
|
+
size: t.oneOf(["small", "medium", "large", "huge"]),
|
|
3168
|
+
sx: t.oneOfType([t.object, t.string]),
|
|
3169
|
+
style: t.object,
|
|
3170
|
+
className: t.string,
|
|
3171
|
+
onSearch: t.func,
|
|
3172
|
+
value: t.string,
|
|
3173
|
+
defaultValue: t.string,
|
|
3174
|
+
disabled: t.bool,
|
|
3175
|
+
placeholder: t.string,
|
|
3176
|
+
btnText: t.string,
|
|
3177
|
+
localeText: t.shape({
|
|
3178
|
+
placeholder: t.string,
|
|
3179
|
+
btnText: t.string
|
|
3180
|
+
}),
|
|
3181
|
+
path: t.string
|
|
3182
|
+
};
|
|
3183
|
+
const Bt = {
|
|
3184
|
+
default: "",
|
|
3185
|
+
inline: "inline-block",
|
|
3186
|
+
circle: "rounded-full",
|
|
3187
|
+
triangle: "w-0 h-0 border-l-[var(--space-triangle-size)] border-r-[var(--space-triangle-size)] border-b-[calc(var(--space-triangle-size)*2)] border-l-transparent border-r-transparent border-b-[var(--space-triangle-color)]",
|
|
3188
|
+
halfCircle: "rounded-t-full rounded-b-none",
|
|
3189
|
+
fixed: "fixed",
|
|
3190
|
+
absolute: "absolute",
|
|
3191
|
+
relative: "relative"
|
|
3192
|
+
}, It = Object.keys(Bt), jr = ["root"];
|
|
3193
|
+
function Fr(e, o) {
|
|
3194
|
+
const {
|
|
3195
|
+
sx: r = {},
|
|
3196
|
+
style: n = {},
|
|
3197
|
+
className: c = "",
|
|
3198
|
+
type: l = "default",
|
|
3199
|
+
children: a,
|
|
3200
|
+
/* 其余全部透传给 div(事件、data-*、aria-* 等) */
|
|
3201
|
+
/**
|
|
3202
|
+
*
|
|
3203
|
+
* Space 只会“消耗”自己定义的 4 个 prop(sx、style、className、type、children),
|
|
3204
|
+
* 其余所有属性——包括 onClick、onDoubleClick、onMouseMove、data-testid、
|
|
3205
|
+
* aria-label、role、tabIndex 等原生 HTML 属性——都不会被拦截,全部进入 restProps。
|
|
3206
|
+
*
|
|
3207
|
+
* noted by clayw on 20260523 night
|
|
3208
|
+
*
|
|
3209
|
+
*/
|
|
3210
|
+
...i
|
|
3211
|
+
} = e, u = It.includes(l) ? l : "default", h = H(r, jr), d = b({
|
|
3212
|
+
baseClassName: Bt[u],
|
|
3213
|
+
className: c,
|
|
3214
|
+
sxSlot: h.root
|
|
3215
|
+
}), p = u === "halfCircle" ? { width: "var(--space-half-circle-w)", height: "var(--space-half-circle-h)", background: "var(--space-half-circle-color)" } : {};
|
|
3216
|
+
return (
|
|
3217
|
+
// 这里直接透传给原生div,用户用起来就像使用普通 div 一样,dom也是div
|
|
3218
|
+
/* @__PURE__ */ s(
|
|
3219
|
+
"div",
|
|
3220
|
+
{
|
|
3221
|
+
ref: o,
|
|
3222
|
+
className: d.className,
|
|
3223
|
+
style: { ...p, ...d.style, ...n },
|
|
3224
|
+
...i,
|
|
3225
|
+
children: a
|
|
3226
|
+
}
|
|
3227
|
+
)
|
|
3228
|
+
);
|
|
3229
|
+
}
|
|
3230
|
+
const jt = Q.forwardRef(Fr);
|
|
3231
|
+
jt.propTypes = {
|
|
3232
|
+
type: t.oneOf(It),
|
|
3233
|
+
sx: t.oneOfType([t.string, t.object]),
|
|
3234
|
+
style: t.object,
|
|
3235
|
+
className: t.string,
|
|
3236
|
+
children: t.node
|
|
3237
|
+
};
|
|
3238
|
+
jt.displayName = "Space";
|
|
3239
|
+
const Dr = ["root", "wrapper", "thead", "headerCell", "body", "row", "cell", "empty", "pagination"], ve = {
|
|
3240
|
+
empty: "暂无数据",
|
|
3241
|
+
prev: "上一页",
|
|
3242
|
+
next: "下一页",
|
|
3243
|
+
page: "页",
|
|
3244
|
+
total: "共 {total} 条",
|
|
3245
|
+
perPage: "条/页"
|
|
3246
|
+
}, Rr = 10, Vr = [10, 20, 50, 100], Ae = (e, ...o) => typeof e == "function" ? e(...o) : e ?? {};
|
|
3247
|
+
function Yr(e) {
|
|
3248
|
+
const {
|
|
3249
|
+
dataSource: o = [],
|
|
3250
|
+
columns: r = [],
|
|
3251
|
+
/* sx / 样式 */
|
|
3252
|
+
sx: n = {},
|
|
3253
|
+
style: c = {},
|
|
3254
|
+
className: l = "",
|
|
3255
|
+
/* 分页 */
|
|
3256
|
+
pagination: a = null,
|
|
3257
|
+
/* 隐藏列 */
|
|
3258
|
+
hide: i = [],
|
|
3259
|
+
/* 行回调 */
|
|
3260
|
+
rowClassName: u,
|
|
3261
|
+
rowStyle: h,
|
|
3262
|
+
/* 单元格回调 */
|
|
3263
|
+
cellClassName: d,
|
|
3264
|
+
cellStyle: p,
|
|
3265
|
+
/* hover */
|
|
3266
|
+
hoverColor: g = "",
|
|
3267
|
+
/* i18n */
|
|
3268
|
+
i18nKey: v = null,
|
|
3269
|
+
localeText: L = {},
|
|
3270
|
+
/* 无障碍 */
|
|
3271
|
+
"aria-label": O,
|
|
3272
|
+
...j
|
|
3273
|
+
} = e, { t: w } = ie();
|
|
3274
|
+
o.length === 0 && r.length === 0 && console.warn("[Tango Table] dataSource 和 columns 不能同时为空,请至少提供一项。");
|
|
3275
|
+
const S = {
|
|
3276
|
+
empty: w("table.empty", ve.empty),
|
|
3277
|
+
prev: w("table.prev", ve.prev),
|
|
3278
|
+
next: w("table.next", ve.next),
|
|
3279
|
+
page: w("table.page", ve.page),
|
|
3280
|
+
total: w("table.total", ve.total),
|
|
3281
|
+
perPage: w("table.perPage", ve.perPage),
|
|
3282
|
+
...L
|
|
3283
|
+
}, x = Array.isArray(i) ? i : typeof i == "string" ? [i] : [], _ = Se(
|
|
3284
|
+
() => r.filter((q) => !q.hide && !x.includes(q.dataIndex)),
|
|
3285
|
+
[r, x]
|
|
3286
|
+
), m = a !== null && a !== !1, y = a && a.placement || "bottom", M = a && a.pageSize || Rr, A = a && a.pageSizeOptions || Vr, $ = (a == null ? void 0 : a.showTotal) !== !1, P = (a == null ? void 0 : a.showSizeChanger) !== !1, [T, N] = G(1), [C, U] = G(M), I = o.length, F = Math.max(1, Math.ceil(I / C)), B = Math.min(T, F), D = Se(() => {
|
|
3287
|
+
if (!m) return o;
|
|
3288
|
+
const q = (B - 1) * C;
|
|
3289
|
+
return o.slice(q, q + C);
|
|
3290
|
+
}, [o, B, C, m]), W = oe(
|
|
3291
|
+
(q) => N(Math.max(1, Math.min(q, F))),
|
|
3292
|
+
[F]
|
|
3293
|
+
), K = H(n, Dr), Z = b({
|
|
3294
|
+
baseClassName: E(
|
|
3295
|
+
"w-full overflow-x-auto rounded-xl border border-[var(--border)]",
|
|
3296
|
+
"shadow-[0_0_20px_color-mix(in_oklch,var(--foreground)_8%,transparent)]"
|
|
3297
|
+
),
|
|
3298
|
+
className: l,
|
|
3299
|
+
style: c,
|
|
3300
|
+
sxSlot: {
|
|
3301
|
+
tw: E(K.root.tw, K.wrapper.tw),
|
|
3302
|
+
css: { ...K.root.css, ...K.wrapper.css }
|
|
3303
|
+
}
|
|
3304
|
+
}), R = b({
|
|
3305
|
+
baseClassName: "bg-[var(--primary)] text-[var(--primary-foreground)] sticky top-0 z-10",
|
|
3306
|
+
sxSlot: K.thead
|
|
3307
|
+
}), re = b({
|
|
3308
|
+
baseClassName: "text-[var(--foreground)]",
|
|
3309
|
+
sxSlot: K.body
|
|
3310
|
+
}), de = b({
|
|
3311
|
+
baseClassName: "text-[var(--muted-foreground)] py-16 text-center",
|
|
3312
|
+
sxSlot: K.empty
|
|
3313
|
+
}), be = b({
|
|
3314
|
+
baseClassName: "flex items-center justify-between px-4 py-3 text-sm text-[var(--muted-foreground)] border-t border-[var(--border)]",
|
|
3315
|
+
sxSlot: K.pagination
|
|
3316
|
+
}), fe = g ? /* @__PURE__ */ s("style", { children: `
|
|
3317
|
+
[data-tango-table-body] tr:hover {
|
|
3318
|
+
background-color: ${g} !important;
|
|
3319
|
+
transform: translateY(-1px);
|
|
3320
|
+
box-shadow: 0 2px 8px color-mix(in oklch, var(--foreground) 5%, transparent);
|
|
3321
|
+
}
|
|
3322
|
+
` }) : null, se = () => {
|
|
3323
|
+
if (!m) return null;
|
|
3324
|
+
const q = Array.from({ length: F }, (z, X) => X + 1);
|
|
3325
|
+
return /* @__PURE__ */ k("div", { className: be.className, style: be.style, children: [
|
|
3326
|
+
/* @__PURE__ */ k("div", { className: "flex items-center gap-3", children: [
|
|
3327
|
+
$ && /* @__PURE__ */ s("span", { children: S.total.replace("{total}", String(I)) }),
|
|
3328
|
+
P && /* @__PURE__ */ s(
|
|
3329
|
+
"select",
|
|
3330
|
+
{
|
|
3331
|
+
value: C,
|
|
3332
|
+
onChange: (z) => {
|
|
3333
|
+
U(Number(z.target.value)), N(1);
|
|
3334
|
+
},
|
|
3335
|
+
className: "rounded border border-[var(--border)] bg-[var(--background)] px-2 py-1 text-sm cursor-pointer",
|
|
3336
|
+
"aria-label": S.perPage,
|
|
3337
|
+
children: A.map((z) => /* @__PURE__ */ k("option", { value: z, children: [
|
|
3338
|
+
z,
|
|
3339
|
+
" ",
|
|
3340
|
+
S.perPage
|
|
3341
|
+
] }, z))
|
|
3342
|
+
}
|
|
3343
|
+
)
|
|
3344
|
+
] }),
|
|
3345
|
+
/* @__PURE__ */ k("div", { className: "flex items-center gap-1", children: [
|
|
3346
|
+
/* @__PURE__ */ s(
|
|
3347
|
+
"button",
|
|
3348
|
+
{
|
|
3349
|
+
onClick: () => W(B - 1),
|
|
3350
|
+
disabled: B <= 1,
|
|
3351
|
+
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": S.prev,
|
|
3353
|
+
children: S.prev
|
|
3354
|
+
}
|
|
3355
|
+
),
|
|
3356
|
+
q.length <= 7 ? q.map((z) => /* @__PURE__ */ s(
|
|
3357
|
+
"button",
|
|
3358
|
+
{
|
|
3359
|
+
onClick: () => W(z),
|
|
3360
|
+
className: `min-w-[28px] px-2 py-1 rounded text-xs transition-colors ${z === B ? "bg-[var(--primary)] text-[var(--primary-foreground)] font-medium" : "border border-[var(--border)] hover:bg-[var(--accent)]"}`,
|
|
3361
|
+
children: z
|
|
3362
|
+
},
|
|
3363
|
+
z
|
|
3364
|
+
)) : /* @__PURE__ */ k(Ne, { children: [
|
|
3365
|
+
/* @__PURE__ */ s(
|
|
3366
|
+
"button",
|
|
3367
|
+
{
|
|
3368
|
+
onClick: () => W(1),
|
|
3369
|
+
className: `min-w-[28px] px-2 py-1 rounded text-xs ${B === 1 ? "bg-[var(--primary)] text-[var(--primary-foreground)] font-medium" : "border border-[var(--border)] hover:bg-[var(--accent)]"} transition-colors`,
|
|
3370
|
+
children: "1"
|
|
3371
|
+
}
|
|
3372
|
+
),
|
|
3373
|
+
B > 3 && /* @__PURE__ */ s("span", { className: "px-1 text-xs", children: "…" }),
|
|
3374
|
+
Array.from(
|
|
3375
|
+
{ length: F },
|
|
3376
|
+
(z, X) => X + 1
|
|
3377
|
+
).filter((z) => z > 1 && z < F && Math.abs(z - B) <= 1).map((z) => /* @__PURE__ */ s(
|
|
3378
|
+
"button",
|
|
3379
|
+
{
|
|
3380
|
+
onClick: () => W(z),
|
|
3381
|
+
className: `min-w-[28px] px-2 py-1 rounded text-xs ${z === B ? "bg-[var(--primary)] text-[var(--primary-foreground)] font-medium" : "border border-[var(--border)] hover:bg-[var(--accent)]"} transition-colors`,
|
|
3382
|
+
children: z
|
|
3383
|
+
},
|
|
3384
|
+
z
|
|
3385
|
+
)),
|
|
3386
|
+
B < F - 2 && /* @__PURE__ */ s("span", { className: "px-1 text-xs", children: "…" }),
|
|
3387
|
+
/* @__PURE__ */ s(
|
|
3388
|
+
"button",
|
|
3389
|
+
{
|
|
3390
|
+
onClick: () => W(F),
|
|
3391
|
+
className: `min-w-[28px] px-2 py-1 rounded text-xs ${B === F ? "bg-[var(--primary)] text-[var(--primary-foreground)] font-medium" : "border border-[var(--border)] hover:bg-[var(--accent)]"} transition-colors`,
|
|
3392
|
+
children: F
|
|
3393
|
+
}
|
|
3394
|
+
)
|
|
3395
|
+
] }),
|
|
3396
|
+
/* @__PURE__ */ s(
|
|
3397
|
+
"button",
|
|
3398
|
+
{
|
|
3399
|
+
onClick: () => W(B + 1),
|
|
3400
|
+
disabled: B >= F,
|
|
3401
|
+
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": S.next,
|
|
3403
|
+
children: S.next
|
|
3404
|
+
}
|
|
3405
|
+
)
|
|
3406
|
+
] })
|
|
3407
|
+
] });
|
|
3408
|
+
}, ee = (q) => /* @__PURE__ */ k("div", { className: Z.className, style: Z.style, children: [
|
|
3409
|
+
fe,
|
|
3410
|
+
/* @__PURE__ */ k("table", { className: "w-full border-collapse separate border-spacing-0 text-sm", role: "table", children: [
|
|
3411
|
+
/* @__PURE__ */ s("thead", { className: R.className, style: R.style, children: /* @__PURE__ */ s("tr", { children: _.map((z) => {
|
|
3412
|
+
const X = b({
|
|
3413
|
+
baseClassName: E(
|
|
3414
|
+
"px-5 py-4 text-left font-semibold tracking-wide relative",
|
|
3415
|
+
K.headerCell.tw
|
|
3416
|
+
),
|
|
3417
|
+
baseStyle: z.width ? { width: z.width } : {},
|
|
3418
|
+
sxSlot: { tw: "", css: K.headerCell.css }
|
|
3419
|
+
});
|
|
3420
|
+
return /* @__PURE__ */ k("th", { className: X.className, style: X.style, children: [
|
|
3421
|
+
z.title,
|
|
3422
|
+
/* @__PURE__ */ s("span", { className: "absolute right-0 top-[20%] h-[60%] w-px bg-[var(--primary-foreground)]/15 last:hidden" })
|
|
3423
|
+
] }, z.key || z.dataIndex);
|
|
3424
|
+
}) }) }),
|
|
3425
|
+
/* @__PURE__ */ s("tbody", { className: re.className, style: re.style, "data-tango-table-body": !0, children: q.length === 0 ? /* @__PURE__ */ s("tr", { children: /* @__PURE__ */ s("td", { colSpan: _.length, className: de.className, style: de.style, children: S.empty }) }) : q.map((z, X) => {
|
|
3426
|
+
const te = X % 2 === 0 ? "even" : "odd", ae = E(
|
|
3427
|
+
"transition-all duration-200",
|
|
3428
|
+
te === "even" ? "bg-[color-mix(in_oklch,var(--table-hover)_6%,transparent)]" : "",
|
|
3429
|
+
"hover:bg-[color-mix(in_oklch,var(--table-hover)_20%,transparent)]",
|
|
3430
|
+
K.row.tw,
|
|
3431
|
+
Ae(u, z, X, te)
|
|
3432
|
+
), ue = {
|
|
3433
|
+
...Ae(h, z, X, te),
|
|
3434
|
+
...K.row.css
|
|
3435
|
+
};
|
|
3436
|
+
return /* @__PURE__ */ s("tr", { className: ae, style: ue, children: _.map((f, Y) => {
|
|
3437
|
+
const J = Y % 2 === 0 ? "even" : "odd", ge = E(
|
|
3438
|
+
"px-5 py-3.5 text-left relative",
|
|
3439
|
+
"border-b border-[color-mix(in_oklch,var(--foreground)_5%,transparent)]",
|
|
3440
|
+
K.cell.tw,
|
|
3441
|
+
Ae(d, z, f, X, Y, te, J)
|
|
3442
|
+
), pe = {
|
|
3443
|
+
...f.width ? { width: f.width } : {},
|
|
3444
|
+
...Ae(p, z, f, X, Y, te, J),
|
|
3445
|
+
...K.cell.css
|
|
3446
|
+
};
|
|
3447
|
+
return /* @__PURE__ */ k("td", { className: ge, style: pe, children: [
|
|
3448
|
+
/* @__PURE__ */ s("div", { className: "flex items-center min-h-5", children: f.render ? f.render(z[f.dataIndex], z, X) : z[f.dataIndex] }),
|
|
3449
|
+
/* @__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
|
+
] }, f.key || f.dataIndex || Y);
|
|
3451
|
+
}) }, z.key || X);
|
|
3452
|
+
}) })
|
|
3453
|
+
] })
|
|
3454
|
+
] });
|
|
3455
|
+
return /* @__PURE__ */ k("div", { role: "region", "aria-label": O || "Table", ...j, children: [
|
|
3456
|
+
m && y === "top" && se(),
|
|
3457
|
+
ee(D),
|
|
3458
|
+
m && y === "bottom" && se()
|
|
3459
|
+
] });
|
|
3460
|
+
}
|
|
3461
|
+
Yr.propTypes = {
|
|
3462
|
+
dataSource: t.array,
|
|
3463
|
+
columns: t.arrayOf(
|
|
3464
|
+
t.shape({
|
|
3465
|
+
title: t.string.isRequired,
|
|
3466
|
+
dataIndex: t.string.isRequired,
|
|
3467
|
+
key: t.oneOfType([t.string, t.number]),
|
|
3468
|
+
render: t.func,
|
|
3469
|
+
width: t.oneOfType([t.string, t.number]),
|
|
3470
|
+
hide: t.bool
|
|
3471
|
+
})
|
|
3472
|
+
),
|
|
3473
|
+
sx: t.oneOfType([t.object, t.string]),
|
|
3474
|
+
style: t.object,
|
|
3475
|
+
className: t.string,
|
|
3476
|
+
pagination: t.oneOfType([
|
|
3477
|
+
t.bool,
|
|
3478
|
+
t.shape({
|
|
3479
|
+
placement: t.oneOf(["top", "bottom"]),
|
|
3480
|
+
pageSize: t.number,
|
|
3481
|
+
pageSizeOptions: t.arrayOf(t.number),
|
|
3482
|
+
showTotal: t.bool,
|
|
3483
|
+
showSizeChanger: t.bool
|
|
3484
|
+
})
|
|
3485
|
+
]),
|
|
3486
|
+
hide: t.oneOfType([
|
|
3487
|
+
t.arrayOf(t.string),
|
|
3488
|
+
t.string
|
|
3489
|
+
]),
|
|
3490
|
+
rowClassName: t.oneOfType([t.func, t.string]),
|
|
3491
|
+
rowStyle: t.oneOfType([t.func, t.object]),
|
|
3492
|
+
cellClassName: t.oneOfType([t.func, t.string]),
|
|
3493
|
+
cellStyle: t.oneOfType([t.func, t.object]),
|
|
3494
|
+
hoverColor: t.string,
|
|
3495
|
+
i18nKey: t.string,
|
|
3496
|
+
localeText: t.object
|
|
3497
|
+
};
|
|
3498
|
+
const Kr = ["root", "tooltip"], Ct = {
|
|
3499
|
+
top: "bottom-full left-1/2 -translate-x-1/2 mb-2",
|
|
3500
|
+
bottom: "top-full left-1/2 -translate-x-1/2 mt-2",
|
|
3501
|
+
left: "right-full top-1/2 -translate-y-1/2 mr-2",
|
|
3502
|
+
right: "left-full top-1/2 -translate-y-1/2 ml-2"
|
|
3503
|
+
}, Ur = {
|
|
3504
|
+
top: { bottom: "-5px", left: "50%", marginLeft: "-5px", transform: "rotate(45deg)" },
|
|
3505
|
+
bottom: { top: "-5px", left: "50%", marginLeft: "-5px", transform: "rotate(45deg)" },
|
|
3506
|
+
left: { right: "-5px", top: "50%", marginTop: "-5px", transform: "rotate(45deg)" },
|
|
3507
|
+
right: { left: "-5px", top: "50%", marginTop: "-5px", transform: "rotate(45deg)" }
|
|
3508
|
+
};
|
|
3509
|
+
function Hr(e, o) {
|
|
3510
|
+
const {
|
|
3511
|
+
children: r,
|
|
3512
|
+
title: n,
|
|
3513
|
+
placement: c = "top",
|
|
3514
|
+
open: l,
|
|
3515
|
+
defaultOpen: a = !1,
|
|
3516
|
+
onOpenChange: i,
|
|
3517
|
+
disabled: u = !1,
|
|
3518
|
+
sx: h = {},
|
|
3519
|
+
style: d = {},
|
|
3520
|
+
className: p = "",
|
|
3521
|
+
onMouseEnter: g,
|
|
3522
|
+
onMouseLeave: v,
|
|
3523
|
+
onFocus: L,
|
|
3524
|
+
onBlur: O,
|
|
3525
|
+
...j
|
|
3526
|
+
} = e, [w, S] = G(a), x = l !== void 0, _ = x ? l : w, m = oe((C) => {
|
|
3527
|
+
x || S(C), i == null || i(C);
|
|
3528
|
+
}, [x, i]), y = Ct[c] ? c : "top", M = H(h, Kr), A = b({
|
|
3529
|
+
baseClassName: "relative inline-flex",
|
|
3530
|
+
sxSlot: M.root
|
|
3531
|
+
}), $ = b({
|
|
3532
|
+
baseClassName: E(
|
|
3533
|
+
"absolute z-50 whitespace-nowrap px-3 py-1.5 text-sm",
|
|
3534
|
+
"bg-[var(--tooltip-background)] text-[var(--tooltip-foreground)]",
|
|
3535
|
+
"shadow-[var(--tooltip-shadow)]",
|
|
3536
|
+
Ct[y]
|
|
3537
|
+
),
|
|
3538
|
+
className: p,
|
|
3539
|
+
baseStyle: { borderRadius: "var(--tooltip-radius)" },
|
|
3540
|
+
sxSlot: M.tooltip,
|
|
3541
|
+
style: d
|
|
3542
|
+
}), P = {
|
|
3543
|
+
position: "absolute",
|
|
3544
|
+
width: "10px",
|
|
3545
|
+
height: "10px",
|
|
3546
|
+
backgroundColor: "inherit",
|
|
3547
|
+
...Ur[y]
|
|
3548
|
+
}, T = () => !u && m(!0), N = () => !u && m(!1);
|
|
3549
|
+
return /* @__PURE__ */ k(
|
|
3550
|
+
"div",
|
|
3551
|
+
{
|
|
3552
|
+
ref: o,
|
|
3553
|
+
className: A.className,
|
|
3554
|
+
style: A.style,
|
|
3555
|
+
onMouseEnter: (C) => {
|
|
3556
|
+
T(), g == null || g(C);
|
|
3557
|
+
},
|
|
3558
|
+
onMouseLeave: (C) => {
|
|
3559
|
+
N(), v == null || v(C);
|
|
3560
|
+
},
|
|
3561
|
+
onFocus: (C) => {
|
|
3562
|
+
T(), L == null || L(C);
|
|
3563
|
+
},
|
|
3564
|
+
onBlur: (C) => {
|
|
3565
|
+
N(), O == null || O(C);
|
|
3566
|
+
},
|
|
3567
|
+
...j,
|
|
3568
|
+
children: [
|
|
3569
|
+
r,
|
|
3570
|
+
_ && n && /* @__PURE__ */ k("div", { role: "tooltip", className: $.className, style: $.style, children: [
|
|
3571
|
+
/* @__PURE__ */ s("span", { style: { position: "relative", zIndex: 1 }, children: n }),
|
|
3572
|
+
/* @__PURE__ */ s("span", { style: P })
|
|
3573
|
+
] })
|
|
3574
|
+
]
|
|
3575
|
+
}
|
|
3576
|
+
);
|
|
3577
|
+
}
|
|
3578
|
+
const Ft = Q.forwardRef(Hr);
|
|
3579
|
+
Ft.displayName = "Tooltip";
|
|
3580
|
+
Ft.propTypes = {
|
|
3581
|
+
children: t.node,
|
|
3582
|
+
title: t.node,
|
|
3583
|
+
placement: t.oneOf(["top", "bottom", "left", "right"]),
|
|
3584
|
+
open: t.bool,
|
|
3585
|
+
defaultOpen: t.bool,
|
|
3586
|
+
onOpenChange: t.func,
|
|
3587
|
+
disabled: t.bool,
|
|
3588
|
+
sx: t.oneOfType([t.string, t.object]),
|
|
3589
|
+
style: t.object,
|
|
3590
|
+
className: t.string,
|
|
3591
|
+
onMouseEnter: t.func,
|
|
3592
|
+
onMouseLeave: t.func,
|
|
3593
|
+
onFocus: t.func,
|
|
3594
|
+
onBlur: t.func
|
|
3595
|
+
};
|
|
3596
|
+
ce.MaterialButton = Ze;
|
|
3597
|
+
Xe.MaterialInput = Ge;
|
|
3598
|
+
ne.Header = Xo;
|
|
3599
|
+
ne.Footer = qo;
|
|
3600
|
+
ne.Sider = Jo;
|
|
3601
|
+
ne.Content = Qo;
|
|
3602
|
+
ne.Toc = er;
|
|
3603
|
+
export {
|
|
3604
|
+
sr as Banner,
|
|
3605
|
+
ce as Button,
|
|
3606
|
+
dr as ColorPicker,
|
|
3607
|
+
Qo as Content,
|
|
3608
|
+
gr as DateDisplay,
|
|
3609
|
+
xr as DatePicker,
|
|
3610
|
+
Tr as Drawer,
|
|
3611
|
+
qo as Footer,
|
|
3612
|
+
Xo as Header,
|
|
3613
|
+
Xe as Input,
|
|
3614
|
+
ne as Layout,
|
|
3615
|
+
Et as Line,
|
|
3616
|
+
$t as Mark,
|
|
3617
|
+
Ze as MaterialButton,
|
|
3618
|
+
Ge as MaterialInput,
|
|
3619
|
+
Ar as Modal,
|
|
3620
|
+
We as Notice,
|
|
3621
|
+
es as NoticeProvider,
|
|
3622
|
+
Ir as Search,
|
|
3623
|
+
Jo as Sider,
|
|
3624
|
+
jt as Space,
|
|
3625
|
+
Yr as Table,
|
|
3626
|
+
sr as TangoBanner,
|
|
3627
|
+
dr as TangoColorPicker,
|
|
3628
|
+
gr as TangoDate,
|
|
3629
|
+
xr as TangoDatePicker,
|
|
3630
|
+
Tr as TangoDrawer,
|
|
3631
|
+
os as TangoI18nProvider,
|
|
3632
|
+
Ar as TangoModal,
|
|
3633
|
+
We as TangoNotice,
|
|
3634
|
+
Ir as TangoSearch,
|
|
3635
|
+
Ft as TangoTooltip,
|
|
3636
|
+
Jr as ThemeProvider,
|
|
3637
|
+
er as Toc,
|
|
3638
|
+
Ft as Tooltip,
|
|
3639
|
+
qe as Upload,
|
|
3640
|
+
b as createSlotProps,
|
|
3641
|
+
E as mergeTwClassNames,
|
|
3642
|
+
H as normalizeSxSlots,
|
|
3643
|
+
ze as normalizeTangoLocale,
|
|
3644
|
+
ts as useNotice,
|
|
3645
|
+
ie as useTangoI18n,
|
|
3646
|
+
Me as useTangoStyle,
|
|
3647
|
+
Qr as useTheme
|
|
3648
|
+
};
|