@hkyhy/marsun-components-core 0.1.46 → 0.1.49

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.
Files changed (62) hide show
  1. package/dist/_virtual/zh-cn.js +3 -0
  2. package/dist/_virtual/zh-cn.js.map +1 -0
  3. package/dist/_virtual/zh-cn2.js +5 -0
  4. package/dist/_virtual/zh-cn2.js.map +1 -0
  5. package/dist/components/Filter/FilterDatePicker/index.js +10 -9
  6. package/dist/components/Filter/FilterDatePicker/index.js.map +1 -1
  7. package/dist/components/Filter/FilterDateRange/index.js +3 -2
  8. package/dist/components/Filter/FilterDateRange/index.js.map +1 -1
  9. package/dist/components/Form/index.d.ts +1 -1
  10. package/dist/components/Form/kneFormInfo.d.ts +2 -0
  11. package/dist/components/Form/kneFormInfo.js +18 -17
  12. package/dist/components/Form/kneFormInfo.js.map +1 -1
  13. package/dist/components/OrgTree/OrgTree.js +52 -43
  14. package/dist/components/OrgTree/OrgTree.js.map +1 -1
  15. package/dist/components/OrgTree/style.module.scss.js +5 -5
  16. package/dist/components/PermissionBindPanel/PermissionBindPanel.d.ts +4 -1
  17. package/dist/components/PermissionBindPanel/PermissionBindPanel.js +121 -117
  18. package/dist/components/PermissionBindPanel/PermissionBindPanel.js.map +1 -1
  19. package/dist/components/ReactFilter/common/TypeDateRangePickerField/index.js +31 -30
  20. package/dist/components/ReactFilter/common/TypeDateRangePickerField/index.js.map +1 -1
  21. package/dist/components/ReactFilter/fields/DatePickerFilterItem.js +7 -6
  22. package/dist/components/ReactFilter/fields/DatePickerFilterItem.js.map +1 -1
  23. package/dist/components/ReactFilter/fields/DateRangePickerFilterItem.js +3 -2
  24. package/dist/components/ReactFilter/fields/DateRangePickerFilterItem.js.map +1 -1
  25. package/dist/components/ReactFilter/fields/TypeDateRangePickerFilterItem.js +11 -10
  26. package/dist/components/ReactFilter/fields/TypeDateRangePickerFilterItem.js.map +1 -1
  27. package/dist/components/SegmentedRadio/SegmentedRadio.d.ts +29 -0
  28. package/dist/components/SegmentedRadio/SegmentedRadio.js +48 -0
  29. package/dist/components/SegmentedRadio/SegmentedRadio.js.map +1 -0
  30. package/dist/components/SegmentedRadio/index.d.ts +2 -0
  31. package/dist/components/SegmentedRadio/style.module.scss.js +9 -0
  32. package/dist/components/SegmentedRadio/style.module.scss.js.map +1 -0
  33. package/dist/components/Stat/StatCard/index.d.ts +4 -0
  34. package/dist/components/Stat/StatCard/index.js +45 -29
  35. package/dist/components/Stat/StatCard/index.js.map +1 -1
  36. package/dist/components/Stat/StatCardList.d.ts +0 -2
  37. package/dist/components/Stat/StatCardList.js.map +1 -1
  38. package/dist/components/Tag/Tags/index.d.ts +2 -2
  39. package/dist/components/Tag/Tags/index.js +37 -22
  40. package/dist/components/Tag/Tags/index.js.map +1 -1
  41. package/dist/components/Tag/Tags/style.module.scss.js +3 -3
  42. package/dist/components/TooltipInfo/TooltipInfo.js +14 -8
  43. package/dist/components/TooltipInfo/TooltipInfo.js.map +1 -1
  44. package/dist/components/Upload/index.d.ts +6 -23
  45. package/dist/components/Upload/index.js +254 -141
  46. package/dist/components/Upload/index.js.map +1 -1
  47. package/dist/components/Upload/style.module.scss.js +22 -15
  48. package/dist/components/Upload/style.module.scss.js.map +1 -1
  49. package/dist/components/index.d.ts +2 -1
  50. package/dist/index.d.ts +2 -1
  51. package/dist/index.js +580 -576
  52. package/dist/index.js.map +1 -1
  53. package/dist/marsun-components-core.css +1 -1
  54. package/dist/node_modules/dayjs/locale/zh-cn.js +25 -0
  55. package/dist/node_modules/dayjs/locale/zh-cn.js.map +1 -0
  56. package/dist/provider/MarsunCoreProvider.js +10 -9
  57. package/dist/provider/MarsunCoreProvider.js.map +1 -1
  58. package/dist/styles/global.css +1 -1
  59. package/dist/utils/ensureDayjsZhCn.d.ts +0 -0
  60. package/dist/utils/ensureDayjsZhCn.js +4 -0
  61. package/dist/utils/ensureDayjsZhCn.js.map +1 -0
  62. package/package.json +6 -2
@@ -1,188 +1,301 @@
1
- import { jsxs as h, jsx as e } from "react/jsx-runtime";
2
- import { Inbox as V, Upload as W, File as X, Trash2 as Y } from "../Icons/index.js";
3
- import { message as I, Upload as N, Button as D, Typography as H, Tag as Z } from "antd";
4
- import f from "react";
5
- import a from "./style.module.scss.js";
6
- import o from "classnames";
7
- const R = (r) => r < 1024 * 1024 ? `${(r / 1024).toFixed(0)}KB` : r < 1024 ** 3 ? `${(r / 1024 / 1024).toFixed(0)}M` : `${(r / 1024 ** 3).toFixed(1)}G`;
8
- function S(r, i, t) {
9
- const c = [];
10
- if (r) {
11
- const g = r.split(",").map((x) => x.trim().replace(/^\./, "")).filter(Boolean);
12
- g.length && c.push(`支持扩展名${g.join(",")}`);
1
+ import { jsx as t, jsxs as b } from "react/jsx-runtime";
2
+ import { Plus as re, Inbox as te, Upload as le, File as ae, Trash2 as oe } from "../Icons/index.js";
3
+ import { message as y, Upload as U, Image as ie, Button as _, Typography as J } from "antd";
4
+ import p from "react";
5
+ import o from "./style.module.scss.js";
6
+ import a from "classnames";
7
+ import ue, { SEMANTIC_COLORS as se } from "../Tag/SemanticTag.js";
8
+ const B = (l) => l < 1024 * 1024 ? `${(l / 1024).toFixed(0)}KB` : l < 1024 ** 3 ? `${(l / 1024 / 1024).toFixed(0)}M` : `${(l / 1024 ** 3).toFixed(1)}G`;
9
+ function ne(l, u, s) {
10
+ const r = [];
11
+ if (l) {
12
+ const f = l.split(",").map((g) => g.trim().replace(/^\./, "")).filter(Boolean);
13
+ f.length && r.push(`支持扩展名${f.join(",")}`);
13
14
  }
14
- return i && c.push(`单个文件大小不超过${R(i)}`), t && c.push(`最多上传${t}个附件`), c.length ? /* @__PURE__ */ e(H.Text, { type: "secondary", className: o("upload-item", a["upload-item"]), children: c.join(",") }) : null;
15
+ return u && r.push(`单个文件大小不超过${B(u)}`), s && r.push(`最多上传${s}个附件`), r.length ? /* @__PURE__ */ t(J.Text, { type: "secondary", className: a("upload-item", o["upload-item"]), children: r.join(",") }) : null;
15
16
  }
16
- function ll(r) {
17
- const i = r.lastIndexOf(".");
18
- return i >= 0 ? r.slice(i + 1).toUpperCase() : "";
17
+ function de(l) {
18
+ const u = l.lastIndexOf(".");
19
+ return u >= 0 ? l.slice(u + 1).toUpperCase() : "";
19
20
  }
20
- const v = ({ fileList: r, onRemove: i }) => r.length ? /* @__PURE__ */ e("div", { className: o("upload-link", a["upload-link"]), children: r.map((t) => /* @__PURE__ */ h(
21
- "div",
22
- {
23
- className: o(
24
- o("upload-file-row", a["upload-file-row"]),
25
- t.status === "error" && o("upload-file-row-error", a["upload-file-row-error"])
26
- ),
27
- children: [
28
- /* @__PURE__ */ h("div", { className: o("upload-label", a["upload-label"]), children: [
29
- /* @__PURE__ */ e(X, { className: o("upload-value", a["upload-value"]) }),
30
- /* @__PURE__ */ e("span", { className: o("upload-meta", a["upload-meta"]), children: t.name }),
31
- /* @__PURE__ */ e(Z, { color: "processing", className: o("upload-icon", a["upload-icon"]), children: ll(t.name) }),
32
- t.size && /* @__PURE__ */ e(
33
- H.Text,
34
- {
35
- type: "secondary",
36
- className: o("upload-title", a["upload-title"]),
37
- children: R(t.size)
38
- }
39
- )
40
- ] }),
41
- /* @__PURE__ */ e(
42
- D,
43
- {
44
- type: "text",
45
- danger: !0,
46
- size: "small",
47
- icon: /* @__PURE__ */ e(Y, {}),
48
- onClick: () => i(t.uid),
49
- className: o("upload-desc", a["upload-desc"])
50
- }
51
- )
52
- ]
53
- },
54
- t.uid
55
- )) }) : null, el = f.forwardRef(
21
+ function pe(l) {
22
+ return l.url ? l.url : l.thumbUrl ? l.thumbUrl : l.originFileObj ? URL.createObjectURL(l.originFileObj) : "";
23
+ }
24
+ const V = ({ fileList: l, onRemove: u, onPreview: s }) => l.length ? /* @__PURE__ */ t("div", { className: a("upload-link", o["upload-link"]), children: l.map((r) => {
25
+ var g, w, N;
26
+ const f = !!(r.url || r.thumbUrl || (w = (g = r.originFileObj) == null ? void 0 : g.type) != null && w.startsWith("image/"));
27
+ return /* @__PURE__ */ b(
28
+ "div",
29
+ {
30
+ className: a(
31
+ a("upload-file-row", o["upload-file-row"]),
32
+ r.status === "error" && a("upload-file-row-error", o["upload-file-row-error"])
33
+ ),
34
+ children: [
35
+ /* @__PURE__ */ b("div", { className: a("upload-label", o["upload-label"]), children: [
36
+ r.thumbUrl || r.url && ((N = r.type) != null && N.startsWith("image/")) ? /* @__PURE__ */ t(
37
+ "button",
38
+ {
39
+ type: "button",
40
+ className: a("upload-thumb-btn", o["upload-thumb-btn"]),
41
+ onClick: () => s == null ? void 0 : s(r),
42
+ title: "预览",
43
+ children: /* @__PURE__ */ t(
44
+ "img",
45
+ {
46
+ className: a("upload-thumb", o["upload-thumb"]),
47
+ src: r.thumbUrl || r.url,
48
+ alt: r.name
49
+ }
50
+ )
51
+ }
52
+ ) : /* @__PURE__ */ t(ae, { className: a("upload-value", o["upload-value"]) }),
53
+ /* @__PURE__ */ t("span", { className: a("upload-meta", o["upload-meta"]), children: r.name }),
54
+ /* @__PURE__ */ t(
55
+ ue,
56
+ {
57
+ color: se.INFO,
58
+ className: a("upload-icon", o["upload-icon"]),
59
+ children: de(r.name)
60
+ }
61
+ ),
62
+ r.size ? /* @__PURE__ */ t(
63
+ J.Text,
64
+ {
65
+ type: "secondary",
66
+ className: a("upload-title", o["upload-title"]),
67
+ children: B(r.size)
68
+ }
69
+ ) : null
70
+ ] }),
71
+ /* @__PURE__ */ b("div", { className: a("upload-row-actions", o["upload-row-actions"]), children: [
72
+ f && s ? /* @__PURE__ */ t(_, { type: "link", size: "small", onClick: () => s(r), children: "预览" }) : null,
73
+ /* @__PURE__ */ t(
74
+ _,
75
+ {
76
+ type: "text",
77
+ danger: !0,
78
+ size: "small",
79
+ icon: /* @__PURE__ */ t(oe, {}),
80
+ onClick: () => u(r.uid),
81
+ className: a("upload-desc", o["upload-desc"])
82
+ }
83
+ )
84
+ ] })
85
+ ]
86
+ },
87
+ r.uid
88
+ );
89
+ }) }) : null, ce = p.forwardRef(
56
90
  ({
57
- value: r,
58
- onChange: i,
59
- className: t,
60
- variant: c,
91
+ value: l,
92
+ onChange: u,
93
+ className: s,
94
+ variant: r,
95
+ listType: f = "text",
61
96
  size: g,
62
- children: x,
63
- renderTips: F,
64
- showFileList: L = !0,
65
- fileSize: j,
66
- maxLength: K,
67
- multiple: k,
97
+ children: w,
98
+ renderTips: N,
99
+ showFileList: q = !0,
100
+ fileSize: G,
101
+ maxLength: x,
102
+ multiple: I,
68
103
  directory: O,
69
- accept: U,
70
- onUpload: w,
71
- onSave: n,
72
- getPermission: b,
73
- concurrentCount: M
74
- }, P) => {
75
- const [A, J] = f.useState([]), [_, z] = f.useState(!1), u = r ?? A, m = f.useCallback(
76
- (l) => {
77
- const s = typeof l == "function" ? l(u) : l;
78
- i == null || i(s), J(s), n == null || n(s);
104
+ accept: R,
105
+ onUpload: L,
106
+ onSave: c,
107
+ getPermission: j,
108
+ concurrentCount: Q
109
+ }, X) => {
110
+ const [Y, Z] = p.useState([]), [M, P] = p.useState(!1), [F, W] = p.useState({
111
+ open: !1,
112
+ url: "",
113
+ title: ""
114
+ }), k = p.useRef([]), n = l ?? Y, m = p.useCallback(
115
+ (e) => {
116
+ const i = typeof e == "function" ? e(n) : e;
117
+ u == null || u(i), Z(i), c == null || c(i);
79
118
  },
80
- [u, i, n]
81
- ), $ = j ?? 500 * 1024 * 1024, C = M ?? 3, E = f.useCallback(
82
- (l) => b && !b(l) ? (I.error("无权限上传此文件"), N.LIST_IGNORE) : l.size > $ ? (I.error(`文件超出 ${R($)} 限制`), N.LIST_IGNORE) : !0,
83
- [$, b]
84
- ), T = f.useCallback(async () => {
85
- if (!(!w || !u.length)) {
86
- z(!0);
119
+ [n, u, c]
120
+ ), C = G ?? 500 * 1024 * 1024, A = Q ?? 3, $ = p.useCallback(
121
+ (e) => j && !j(e) ? (y.error("无权限上传此文件"), U.LIST_IGNORE) : e.size > C ? (y.error(`文件超出 ${B(C)} 限制`), U.LIST_IGNORE) : !0,
122
+ [C, j]
123
+ ), D = p.useCallback(async () => {
124
+ if (!(!L || !n.length)) {
125
+ P(!0);
87
126
  try {
88
- const l = [...u], s = [];
89
- for (; l.length; ) {
90
- const d = l.shift();
127
+ const e = [...n], i = [];
128
+ for (; e.length; ) {
129
+ const d = e.shift();
91
130
  if (!(d != null && d.originFileObj)) continue;
92
- const Q = d.originFileObj;
93
- s.push(
94
- new Promise((G) => {
95
- w({
96
- file: Q,
97
- onSuccess: (q) => {
131
+ const ee = d.originFileObj;
132
+ i.push(
133
+ new Promise((H) => {
134
+ L({
135
+ file: ee,
136
+ onSuccess: (K) => {
98
137
  m(
99
- (y) => y.map(
100
- (p) => p.uid === d.uid ? { ...p, status: "done", url: q ?? p.url } : p
138
+ (T) => T.map(
139
+ (h) => h.uid === d.uid ? { ...h, status: "done", url: K ?? h.url } : h
101
140
  )
102
- ), G();
141
+ ), H();
103
142
  },
104
- onError: (q) => {
105
- I.error(`${d.name} 上传失败`), m(
106
- (y) => y.map((p) => p.uid === d.uid ? { ...p, status: "error" } : p)
107
- ), G();
143
+ onError: (K) => {
144
+ y.error(`${d.name} 上传失败`), m(
145
+ (T) => T.map((h) => h.uid === d.uid ? { ...h, status: "error" } : h)
146
+ ), H();
108
147
  }
109
148
  });
110
149
  })
111
- ), s.length >= C && await Promise.race(s);
150
+ ), i.length >= A && await Promise.race(i);
112
151
  }
113
- await Promise.allSettled(s), n == null || n(u);
152
+ await Promise.allSettled(i), c == null || c(n);
114
153
  } finally {
115
- z(!1);
154
+ P(!1);
116
155
  }
117
156
  }
118
- }, [u, w, C, n, m]);
119
- f.useImperativeHandle(P, () => ({ upload: T, uploading: _ }), [
120
- T,
121
- _
157
+ }, [n, L, A, c, m]);
158
+ p.useImperativeHandle(X, () => ({ upload: D, uploading: M }), [
159
+ D,
160
+ M
122
161
  ]);
123
- const B = (F == null ? void 0 : F()) ?? S(U, j, K);
124
- return c === "panel" ? /* @__PURE__ */ h("div", { className: t, children: [
125
- /* @__PURE__ */ h(
126
- N.Dragger,
162
+ const E = p.useCallback((e) => {
163
+ const i = pe(e);
164
+ if (!i) {
165
+ y.warning("暂无法预览该文件");
166
+ return;
167
+ }
168
+ i.startsWith("blob:") && k.current.push(i), W({ open: !0, url: i, title: e.name || "预览" });
169
+ }, []);
170
+ p.useEffect(
171
+ () => () => {
172
+ k.current.forEach((e) => URL.revokeObjectURL(e)), k.current = [];
173
+ },
174
+ []
175
+ );
176
+ const v = (N == null ? void 0 : N()) ?? ne(R, G, x), S = !x || n.length < x, z = /* @__PURE__ */ t(
177
+ ie,
178
+ {
179
+ alt: F.title,
180
+ style: { display: "none" },
181
+ src: F.url,
182
+ preview: {
183
+ visible: F.open,
184
+ src: F.url,
185
+ onVisibleChange: (e) => W((i) => ({ ...i, open: e }))
186
+ }
187
+ }
188
+ );
189
+ return f === "picture-card" ? /* @__PURE__ */ b(
190
+ "div",
191
+ {
192
+ className: a("upload-picture-root", o["upload-picture-root"], s),
193
+ children: [
194
+ /* @__PURE__ */ t(
195
+ U,
196
+ {
197
+ listType: "picture-card",
198
+ fileList: n,
199
+ beforeUpload: $,
200
+ onChange: (e) => m(e.fileList),
201
+ onPreview: E,
202
+ multiple: I,
203
+ directory: O,
204
+ accept: R,
205
+ showUploadList: { showPreviewIcon: !0, showRemoveIcon: !0 },
206
+ customRequest: ({ onSuccess: e }) => e == null ? void 0 : e({}),
207
+ className: a("upload-picture-card", o["upload-picture-card"]),
208
+ children: S ? /* @__PURE__ */ b(
209
+ "div",
210
+ {
211
+ className: a("upload-picture-trigger", o["upload-picture-trigger"]),
212
+ children: [
213
+ /* @__PURE__ */ t(re, { size: 20 }),
214
+ /* @__PURE__ */ t(
215
+ "div",
216
+ {
217
+ className: a(
218
+ "upload-picture-trigger-text",
219
+ o["upload-picture-trigger-text"]
220
+ ),
221
+ children: "上传图片"
222
+ }
223
+ )
224
+ ]
225
+ }
226
+ ) : null
227
+ }
228
+ ),
229
+ v ? /* @__PURE__ */ t("div", { className: a("upload-list", o["upload-list"]), children: v }) : null,
230
+ z
231
+ ]
232
+ }
233
+ ) : r === "panel" ? /* @__PURE__ */ b("div", { className: s, children: [
234
+ /* @__PURE__ */ b(
235
+ U.Dragger,
127
236
  {
128
- fileList: u,
129
- beforeUpload: E,
130
- onChange: (l) => m(l.fileList),
131
- multiple: k,
237
+ fileList: n,
238
+ beforeUpload: $,
239
+ onChange: (e) => m(e.fileList),
240
+ multiple: I,
132
241
  directory: O,
133
- accept: U,
242
+ accept: R,
134
243
  showUploadList: !1,
135
- customRequest: ({ onSuccess: l }) => l == null ? void 0 : l({}),
244
+ customRequest: ({ onSuccess: e }) => e == null ? void 0 : e({}),
136
245
  children: [
137
- /* @__PURE__ */ e("p", { className: o("upload-drag-icon", a["upload-drag-icon"]), children: /* @__PURE__ */ e(V, {}) }),
138
- /* @__PURE__ */ e("p", { className: "ant-upload-text", children: "点击或拖拽文件到此区域上传" }),
139
- /* @__PURE__ */ e("p", { children: B })
246
+ /* @__PURE__ */ t("p", { className: a("upload-drag-icon", o["upload-drag-icon"]), children: /* @__PURE__ */ t(te, {}) }),
247
+ /* @__PURE__ */ t("p", { className: "ant-upload-text", children: "点击或拖拽文件到此区域上传" }),
248
+ /* @__PURE__ */ t("p", { children: v })
140
249
  ]
141
250
  }
142
251
  ),
143
- L && /* @__PURE__ */ e(
144
- v,
252
+ q && /* @__PURE__ */ t(
253
+ V,
145
254
  {
146
- fileList: u,
147
- onRemove: (l) => m((s) => s.filter((d) => d.uid !== l))
255
+ fileList: n,
256
+ onRemove: (e) => m((i) => i.filter((d) => d.uid !== e)),
257
+ onPreview: E
148
258
  }
149
- )
150
- ] }) : /* @__PURE__ */ h("div", { className: t, children: [
151
- /* @__PURE__ */ e(
152
- N,
259
+ ),
260
+ z
261
+ ] }) : /* @__PURE__ */ b("div", { className: s, children: [
262
+ /* @__PURE__ */ t(
263
+ U,
153
264
  {
154
- fileList: u,
155
- beforeUpload: E,
156
- onChange: (l) => m(l.fileList),
157
- multiple: k,
265
+ fileList: n,
266
+ beforeUpload: $,
267
+ onChange: (e) => m(e.fileList),
268
+ multiple: I,
158
269
  directory: O,
159
- accept: U,
270
+ accept: R,
160
271
  showUploadList: !1,
161
- customRequest: ({ onSuccess: l }) => l == null ? void 0 : l({}),
162
- children: x ?? /* @__PURE__ */ e(
163
- D,
272
+ customRequest: ({ onSuccess: e }) => e == null ? void 0 : e({}),
273
+ children: w ?? /* @__PURE__ */ t(
274
+ _,
164
275
  {
165
276
  size: g,
166
- icon: /* @__PURE__ */ e(W, {}),
167
- className: o("upload-toolbar", a["upload-toolbar"]),
277
+ icon: /* @__PURE__ */ t(le, {}),
278
+ className: a("upload-toolbar", o["upload-toolbar"]),
168
279
  children: "点击上传"
169
280
  }
170
281
  )
171
282
  }
172
283
  ),
173
- /* @__PURE__ */ e("div", { className: o("upload-list", a["upload-list"]), children: B }),
174
- L && /* @__PURE__ */ e(
175
- v,
284
+ /* @__PURE__ */ t("div", { className: a("upload-list", o["upload-list"]), children: v }),
285
+ q && /* @__PURE__ */ t(
286
+ V,
176
287
  {
177
- fileList: u,
178
- onRemove: (l) => m((s) => s.filter((d) => d.uid !== l))
288
+ fileList: n,
289
+ onRemove: (e) => m((i) => i.filter((d) => d.uid !== e)),
290
+ onPreview: E
179
291
  }
180
- )
292
+ ),
293
+ z
181
294
  ] });
182
295
  }
183
296
  );
184
- el.displayName = "CommonUpload";
297
+ ce.displayName = "CommonUpload";
185
298
  export {
186
- el as default
299
+ ce as default
187
300
  };
188
301
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/Upload/index.tsx"],"sourcesContent":["import { Trash2, File, Inbox, Upload as UploadIcon } from '@/components/Icons';\nimport { Button, message, Tag, Typography, Upload } from 'antd';\nimport type { UploadFile } from 'antd/es/upload/interface';\nimport React from 'react';\nimport styles from './style.module.scss';\nimport classNames from 'classnames';\n\n/* ---------- types ---------- */\n\n/** 上传变体 */\nexport type UploadVariant = 'panel' | 'button';\n\nexport interface CommonUploadProps {\n /* ---- antd Form.Item 兼容属性 ---- */\n value?: UploadFile[];\n onChange?: (value: UploadFile[]) => void;\n\n /* ---- 容器/样式 ---- */\n className?: string;\n\n /* ---- 上传配置 ---- */\n /** 单文件大小限制(字节),默认 500MB */\n fileSize?: number;\n /** 最大上传数量 */\n maxLength?: number;\n multiple?: boolean;\n /** 目录上传模式(webkitdirectory),选中整个文件夹并保留 webkitRelativePath */\n directory?: boolean;\n size?: 'small' | 'middle' | 'large';\n accept?: string;\n\n /* ---- UI 变体 ---- */\n /** panel = 拖拽面板(Dragger 样式),button = 按钮(默认) */\n variant?: UploadVariant;\n children?: React.ReactNode;\n renderTips?: () => React.ReactNode;\n\n /* ---- 文件列表展示 ---- */\n /** 是否展示已上传文件列表,默认 true(tips 下方) */\n showFileList?: boolean;\n\n /* ---- 回调 ---- */\n onSave?: (fileList: UploadFile[]) => void;\n ossUpload?: boolean;\n onUpload?: (options: {\n file: File;\n onSuccess: (url?: string) => void;\n onError: (err: Error) => void;\n }) => Promise<void> | void;\n getPermission?: (file: File) => boolean;\n concurrentCount?: number;\n}\n\nexport type CommonUploadRef = {\n upload: () => void;\n uploading: boolean;\n};\n\n/* ---------- utils ---------- */\n\nconst formatSize = (bytes: number): string => {\n if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(0)}KB`;\n if (bytes < 1024 ** 3) return `${(bytes / 1024 / 1024).toFixed(0)}M`;\n return `${(bytes / 1024 ** 3).toFixed(1)}G`;\n};\n\nfunction buildTips(accept?: string, fileSize?: number, maxLength?: number): React.ReactNode {\n const parts: string[] = [];\n if (accept) {\n const exts = accept\n .split(',')\n .map((s) => s.trim().replace(/^\\./, ''))\n .filter(Boolean);\n if (exts.length) parts.push(`支持扩展名${exts.join(',')}`);\n }\n if (fileSize) parts.push(`单个文件大小不超过${formatSize(fileSize)}`);\n if (maxLength) parts.push(`最多上传${maxLength}个附件`);\n return parts.length ? (\n <Typography.Text type=\"secondary\" className={classNames('upload-item', styles['upload-item'])}>\n {parts.join(',')}\n </Typography.Text>\n ) : null;\n}\n\nfunction getExt(filename: string): string {\n const idx = filename.lastIndexOf('.');\n return idx >= 0 ? filename.slice(idx + 1).toUpperCase() : '';\n}\n\n/* ---------- 子组件:已上传文件列表 ---------- */\n\ninterface UploadedFilesProps {\n fileList: UploadFile[];\n onRemove: (uid: string) => void;\n}\n\nconst UploadedFiles: React.FC<UploadedFilesProps> = ({ fileList, onRemove }) => {\n if (!fileList.length) return null;\n\n return (\n <div className={classNames('upload-link', styles['upload-link'])}>\n {fileList.map((file) => (\n <div\n key={file.uid}\n className={classNames(\n classNames('upload-file-row', styles['upload-file-row']),\n file.status === 'error' &&\n classNames('upload-file-row-error', styles['upload-file-row-error']),\n )}\n >\n <div className={classNames('upload-label', styles['upload-label'])}>\n <File className={classNames('upload-value', styles['upload-value'])} />\n <span className={classNames('upload-meta', styles['upload-meta'])}>{file.name}</span>\n <Tag color=\"processing\" className={classNames('upload-icon', styles['upload-icon'])}>\n {getExt(file.name)}\n </Tag>\n {file.size && (\n <Typography.Text\n type=\"secondary\"\n className={classNames('upload-title', styles['upload-title'])}\n >\n {formatSize(file.size)}\n </Typography.Text>\n )}\n </div>\n <Button\n type=\"text\"\n danger\n size=\"small\"\n icon={<Trash2 />}\n onClick={() => onRemove(file.uid)}\n className={classNames('upload-desc', styles['upload-desc'])}\n />\n </div>\n ))}\n </div>\n );\n};\n\n/* ---------- 主组件 ---------- */\n\n/**\n * CommonUpload — 通用上传组件\n *\n * - 在 antd `<Form.Item>` 内使用时,通过 `value`/`onChange` 自动接入表单\n * - 独立使用时,通过 `onSave` 获取文件列表\n *\n * ## 两种变体\n *\n * - **`variant=\"button\"`(默认)** — 虚线边框按钮 + 底部提示文案 + 已传文件列表\n * - **`variant=\"panel\"`** — Dragger 拖拽面板 + 底部已传文件列表\n *\n * @example\n * ```tsx\n * // 在 Form.Item 中使用\n * <Form.Item name=\"files\" label=\"简历附件\" rules={[{ required: true, message: '请上传文件' }]}>\n * <CommonUpload accept=\".pdf,.jpg,.png\" maxLength={10} />\n * </Form.Item>\n *\n * // 独立使用(Modal 内、非表单场景)\n * <CommonUpload variant=\"panel\" accept=\".doc,.pdf\" onSave={(list) => setFiles(list)} />\n *\n * // ref 手动触发上传\n * const ref = useRef<CommonUploadRef>(null);\n * <CommonUpload ref={ref} onUpload={...} />;\n * ref.current?.upload();\n * ```\n */\nconst CommonUpload = React.forwardRef<CommonUploadRef, CommonUploadProps>(\n (\n {\n value,\n onChange,\n className,\n variant,\n size,\n children,\n renderTips,\n showFileList = true,\n fileSize,\n maxLength,\n multiple,\n directory,\n accept,\n onUpload,\n onSave,\n getPermission,\n concurrentCount,\n },\n ref,\n ) => {\n const [innerFileList, setInnerFileList] = React.useState<UploadFile[]>([]);\n const [uploading, setUploading] = React.useState(false);\n\n // 受控模式:value 优先;非受控:内部状态\n const fileList = value ?? innerFileList;\n const setFileList = React.useCallback(\n (next: UploadFile[] | ((prev: UploadFile[]) => UploadFile[])) => {\n const resolved = typeof next === 'function' ? next(fileList) : next;\n onChange?.(resolved);\n setInnerFileList(resolved);\n onSave?.(resolved);\n },\n [fileList, onChange, onSave],\n );\n\n const effectiveFileSize = fileSize ?? 500 * 1024 * 1024;\n const concurrent = concurrentCount ?? 3;\n\n const beforeUploadFn = React.useCallback(\n (file: File) => {\n if (getPermission && !getPermission(file)) {\n message.error('无权限上传此文件');\n return Upload.LIST_IGNORE;\n }\n if (file.size > effectiveFileSize) {\n message.error(`文件超出 ${formatSize(effectiveFileSize)} 限制`);\n return Upload.LIST_IGNORE;\n }\n return true;\n },\n [effectiveFileSize, getPermission],\n );\n\n const triggerUpload = React.useCallback(async () => {\n if (!onUpload || !fileList.length) return;\n setUploading(true);\n try {\n const pending = [...fileList];\n const pool: Promise<void>[] = [];\n while (pending.length) {\n const item = pending.shift();\n if (!item?.originFileObj) continue;\n const rawFile = item.originFileObj;\n pool.push(\n new Promise<void>((resolve) => {\n onUpload({\n file: rawFile,\n onSuccess: (url?) => {\n setFileList((prev) =>\n prev.map((f) =>\n f.uid === item.uid ? { ...f, status: 'done' as const, url: url ?? f.url } : f,\n ),\n );\n resolve();\n },\n onError: (_err: Error) => {\n message.error(`${item.name} 上传失败`);\n setFileList((prev) =>\n prev.map((f) => (f.uid === item.uid ? { ...f, status: 'error' as const } : f)),\n );\n resolve();\n },\n });\n }),\n );\n if (pool.length >= concurrent) await Promise.race(pool);\n }\n await Promise.allSettled(pool);\n onSave?.(fileList);\n } finally {\n setUploading(false);\n }\n }, [fileList, onUpload, concurrent, onSave, setFileList]);\n\n React.useImperativeHandle(ref, () => ({ upload: triggerUpload, uploading }), [\n triggerUpload,\n uploading,\n ]);\n\n const tips = renderTips?.() ?? buildTips(accept, fileSize, maxLength);\n\n if (variant === 'panel') {\n return (\n <div className={className}>\n <Upload.Dragger\n fileList={fileList}\n beforeUpload={beforeUploadFn}\n onChange={(info) => setFileList(info.fileList)}\n multiple={multiple}\n directory={directory}\n accept={accept}\n showUploadList={false}\n customRequest={({ onSuccess }) => onSuccess?.({})}\n >\n <p className={classNames('upload-drag-icon', styles['upload-drag-icon'])}>\n <Inbox />\n </p>\n <p className=\"ant-upload-text\">点击或拖拽文件到此区域上传</p>\n <p>{tips}</p>\n </Upload.Dragger>\n {showFileList && (\n <UploadedFiles\n fileList={fileList}\n onRemove={(uid) => setFileList((prev) => prev.filter((f) => f.uid !== uid))}\n />\n )}\n </div>\n );\n }\n\n // button mode (default)\n return (\n <div className={className}>\n <Upload\n fileList={fileList}\n beforeUpload={beforeUploadFn}\n onChange={(info) => setFileList(info.fileList)}\n multiple={multiple}\n directory={directory}\n accept={accept}\n showUploadList={false}\n customRequest={({ onSuccess }) => onSuccess?.({})}\n >\n {children ?? (\n <Button\n size={size}\n icon={<UploadIcon />}\n className={classNames('upload-toolbar', styles['upload-toolbar'])}\n >\n 点击上传\n </Button>\n )}\n </Upload>\n <div className={classNames('upload-list', styles['upload-list'])}>{tips}</div>\n {showFileList && (\n <UploadedFiles\n fileList={fileList}\n onRemove={(uid) => setFileList((prev) => prev.filter((f) => f.uid !== uid))}\n />\n )}\n </div>\n );\n },\n);\n\nCommonUpload.displayName = 'CommonUpload';\n\nexport default CommonUpload;\n"],"names":["formatSize","bytes","buildTips","accept","fileSize","maxLength","parts","exts","s","jsx","Typography","classNames","styles","getExt","filename","idx","UploadedFiles","fileList","onRemove","file","jsxs","File","Tag","Button","Trash2","CommonUpload","React","value","onChange","className","variant","size","children","renderTips","showFileList","multiple","directory","onUpload","onSave","getPermission","concurrentCount","ref","innerFileList","setInnerFileList","uploading","setUploading","setFileList","next","resolved","effectiveFileSize","concurrent","beforeUploadFn","message","Upload","triggerUpload","pending","pool","item","rawFile","resolve","url","prev","f","_err","tips","info","onSuccess","Inbox","uid","UploadIcon"],"mappings":";;;;;;AA4DA,MAAMA,IAAa,CAACC,MACdA,IAAQ,OAAO,OAAa,IAAIA,IAAQ,MAAM,QAAQ,CAAC,CAAC,OACxDA,IAAQ,QAAQ,IAAU,IAAIA,IAAQ,OAAO,MAAM,QAAQ,CAAC,CAAC,MAC1D,IAAIA,IAAQ,QAAQ,GAAG,QAAQ,CAAC,CAAC;AAG1C,SAASC,EAAUC,GAAiBC,GAAmBC,GAAqC;AAC1F,QAAMC,IAAkB,CAAA;AACxB,MAAIH,GAAQ;AACV,UAAMI,IAAOJ,EACV,MAAM,GAAG,EACT,IAAI,CAACK,MAAMA,EAAE,KAAA,EAAO,QAAQ,OAAO,EAAE,CAAC,EACtC,OAAO,OAAO;AACjB,IAAID,EAAK,UAAQD,EAAM,KAAK,QAAQC,EAAK,KAAK,GAAG,CAAC,EAAE;AAAA,EACtD;AACA,SAAIH,KAAUE,EAAM,KAAK,YAAYN,EAAWI,CAAQ,CAAC,EAAE,GACvDC,KAAWC,EAAM,KAAK,OAAOD,CAAS,KAAK,GACxCC,EAAM,SACX,gBAAAG,EAACC,EAAW,MAAX,EAAgB,MAAK,aAAY,WAAWC,EAAW,eAAeC,EAAO,aAAa,CAAC,GACzF,YAAM,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MAAA,gBAAApB;AAAA,QAAC4C;AAAA,QAAA;AAAA,UACC,UAAApC;AAAA,UACA,cAAckC;AAAA,UACd,UAAU,CAACc,MAASnB,EAAYmB,EAAK,QAAQ;AAAA,UAC7C,UAAA9B;AAAA,UACA,WAAAC;AAAA,UACA,QAAAjC;AAAA,UACA,gBAAgB;AAAA,UAChB,eAAe,CAAC,EAAE,WAAA+D,QAAgBA,KAAA,gBAAAA,EAAY,CAAA;AAAA,UAE7C,UAAAlC,KACC,gBAAAvB;AAAA,YAACc;AAAA,YAAA;AAAA,cACC,MAAAQ;AAAA,cACA,wBAAOsC,GAAA,EAAW;AAAA,cAClB,WAAW1D,EAAW,kBAAkBC,EAAO,gBAAgB,CAAC;AAAA,cACjE,UAAA;AAAA,YAAA;AAAA,UAAA;AAAA,QAED;AAAA,MAAA;AAAA,MAGJ,gBAAAH,EAAC,SAAI,WAAWE,EAAW,eAAeC,EAAO,aAAa,CAAC,GAAI,UAAAoD,EAAA,CAAK;AAAA,MACvE9B,KACC,gBAAAzB;AAAA,QAACO;AAAA,QAAA;AAAA,UACC,UAAAC;AAAA,UACA,UAAU,CAACmD,MAAQtB,EAAY,CAACe,MAASA,EAAK,OAAO,CAACC,MAAMA,EAAE,QAAQM,CAAG,CAAC;AAAA,QAAA;AAAA,MAAA;AAAA,IAC5E,GAEJ;AAAA,EAEJ;AACF;AAEA3C,GAAa,cAAc;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/Upload/index.tsx"],"sourcesContent":["import { Trash2, File, Inbox, Plus, Upload as UploadIcon } from '@/components/Icons';\nimport { SEMANTIC_COLORS, SemanticTag } from '@/components/Tag';\nimport { Button, Image, message, Typography, Upload } from 'antd';\nimport type { UploadFile } from 'antd/es/upload/interface';\nimport React from 'react';\nimport styles from './style.module.scss';\nimport classNames from 'classnames';\n\n/* ---------- types ---------- */\n\n/** 上传变体 */\nexport type UploadVariant = 'panel' | 'button';\n\n/** 已选文件列表样式:text=行列表;picture-card=图片卡片(含预览) */\nexport type UploadListType = 'text' | 'picture-card';\n\nexport interface CommonUploadProps {\n /* ---- antd Form.Item 兼容属性 ---- */\n value?: UploadFile[];\n onChange?: (value: UploadFile[]) => void;\n\n /* ---- 容器/样式 ---- */\n className?: string;\n\n /* ---- 上传配置 ---- */\n /** 单文件大小限制(字节),默认 500MB */\n fileSize?: number;\n /** 最大上传数量 */\n maxLength?: number;\n multiple?: boolean;\n /** 目录上传模式(webkitdirectory),选中整个文件夹并保留 webkitRelativePath */\n directory?: boolean;\n size?: 'small' | 'middle' | 'large';\n accept?: string;\n\n /* ---- UI 变体 ---- */\n /** panel = 拖拽面板(Dragger 样式),button = 按钮(默认) */\n variant?: UploadVariant;\n /** 列表展现;图片场景用 picture-card(预览+缩略图) */\n listType?: UploadListType;\n children?: React.ReactNode;\n renderTips?: () => React.ReactNode;\n\n /* ---- 文件列表展示 ---- */\n /** 是否展示已上传文件列表,默认 true(tips 下方) */\n showFileList?: boolean;\n\n /* ---- 回调 ---- */\n onSave?: (fileList: UploadFile[]) => void;\n ossUpload?: boolean;\n onUpload?: (options: {\n file: File;\n onSuccess: (url?: string) => void;\n onError: (err: Error) => void;\n }) => Promise<void> | void;\n getPermission?: (file: File) => boolean;\n concurrentCount?: number;\n}\n\nexport type CommonUploadRef = {\n upload: () => void;\n uploading: boolean;\n};\n\n/* ---------- utils ---------- */\n\nconst formatSize = (bytes: number): string => {\n if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(0)}KB`;\n if (bytes < 1024 ** 3) return `${(bytes / 1024 / 1024).toFixed(0)}M`;\n return `${(bytes / 1024 ** 3).toFixed(1)}G`;\n};\n\nfunction buildTips(accept?: string, fileSize?: number, maxLength?: number): React.ReactNode {\n const parts: string[] = [];\n if (accept) {\n const exts = accept\n .split(',')\n .map((s) => s.trim().replace(/^\\./, ''))\n .filter(Boolean);\n if (exts.length) parts.push(`支持扩展名${exts.join(',')}`);\n }\n if (fileSize) parts.push(`单个文件大小不超过${formatSize(fileSize)}`);\n if (maxLength) parts.push(`最多上传${maxLength}个附件`);\n return parts.length ? (\n <Typography.Text type=\"secondary\" className={classNames('upload-item', styles['upload-item'])}>\n {parts.join(',')}\n </Typography.Text>\n ) : null;\n}\n\nfunction getExt(filename: string): string {\n const idx = filename.lastIndexOf('.');\n return idx >= 0 ? filename.slice(idx + 1).toUpperCase() : '';\n}\n\nfunction resolvePreviewUrl(file: UploadFile): string {\n if (file.url) return file.url;\n if (file.thumbUrl) return file.thumbUrl;\n if (file.originFileObj) return URL.createObjectURL(file.originFileObj);\n return '';\n}\n\n/* ---------- 子组件:文本行列表 ---------- */\n\ninterface UploadedFilesProps {\n fileList: UploadFile[];\n onRemove: (uid: string) => void;\n onPreview?: (file: UploadFile) => void;\n}\n\nconst UploadedFiles: React.FC<UploadedFilesProps> = ({ fileList, onRemove, onPreview }) => {\n if (!fileList.length) return null;\n\n return (\n <div className={classNames('upload-link', styles['upload-link'])}>\n {fileList.map((file) => {\n const previewable = Boolean(\n file.url || file.thumbUrl || file.originFileObj?.type?.startsWith('image/'),\n );\n return (\n <div\n key={file.uid}\n className={classNames(\n classNames('upload-file-row', styles['upload-file-row']),\n file.status === 'error' &&\n classNames('upload-file-row-error', styles['upload-file-row-error']),\n )}\n >\n <div className={classNames('upload-label', styles['upload-label'])}>\n {file.thumbUrl || (file.url && file.type?.startsWith('image/')) ? (\n <button\n type=\"button\"\n className={classNames('upload-thumb-btn', styles['upload-thumb-btn'])}\n onClick={() => onPreview?.(file)}\n title=\"预览\"\n >\n <img\n className={classNames('upload-thumb', styles['upload-thumb'])}\n src={file.thumbUrl || file.url}\n alt={file.name}\n />\n </button>\n ) : (\n <File className={classNames('upload-value', styles['upload-value'])} />\n )}\n <span className={classNames('upload-meta', styles['upload-meta'])}>{file.name}</span>\n <SemanticTag\n color={SEMANTIC_COLORS.INFO}\n className={classNames('upload-icon', styles['upload-icon'])}\n >\n {getExt(file.name)}\n </SemanticTag>\n {file.size ? (\n <Typography.Text\n type=\"secondary\"\n className={classNames('upload-title', styles['upload-title'])}\n >\n {formatSize(file.size)}\n </Typography.Text>\n ) : null}\n </div>\n <div className={classNames('upload-row-actions', styles['upload-row-actions'])}>\n {previewable && onPreview ? (\n <Button type=\"link\" size=\"small\" onClick={() => onPreview(file)}>\n 预览\n </Button>\n ) : null}\n <Button\n type=\"text\"\n danger\n size=\"small\"\n icon={<Trash2 />}\n onClick={() => onRemove(file.uid)}\n className={classNames('upload-desc', styles['upload-desc'])}\n />\n </div>\n </div>\n );\n })}\n </div>\n );\n};\n\n/* ---------- 主组件 ---------- */\n\n/**\n * CommonUpload — 通用上传组件\n *\n * - `listType=\"text\"`(默认):行列表;图片有缩略图时可「预览」\n * - `listType=\"picture-card\"`:antd 图片卡片(内置预览/删除图标)\n */\nconst CommonUpload = React.forwardRef<CommonUploadRef, CommonUploadProps>(\n (\n {\n value,\n onChange,\n className,\n variant,\n listType = 'text',\n size,\n children,\n renderTips,\n showFileList = true,\n fileSize,\n maxLength,\n multiple,\n directory,\n accept,\n onUpload,\n onSave,\n getPermission,\n concurrentCount,\n },\n ref,\n ) => {\n const [innerFileList, setInnerFileList] = React.useState<UploadFile[]>([]);\n const [uploading, setUploading] = React.useState(false);\n const [preview, setPreview] = React.useState<{ open: boolean; url: string; title: string }>({\n open: false,\n url: '',\n title: '',\n });\n const blobUrlsRef = React.useRef<string[]>([]);\n\n // 受控模式:value 优先;非受控:内部状态\n const fileList = value ?? innerFileList;\n const setFileList = React.useCallback(\n (next: UploadFile[] | ((prev: UploadFile[]) => UploadFile[])) => {\n const resolved = typeof next === 'function' ? next(fileList) : next;\n onChange?.(resolved);\n setInnerFileList(resolved);\n onSave?.(resolved);\n },\n [fileList, onChange, onSave],\n );\n\n const effectiveFileSize = fileSize ?? 500 * 1024 * 1024;\n const concurrent = concurrentCount ?? 3;\n\n const beforeUploadFn = React.useCallback(\n (file: File) => {\n if (getPermission && !getPermission(file)) {\n message.error('无权限上传此文件');\n return Upload.LIST_IGNORE;\n }\n if (file.size > effectiveFileSize) {\n message.error(`文件超出 ${formatSize(effectiveFileSize)} 限制`);\n return Upload.LIST_IGNORE;\n }\n return true;\n },\n [effectiveFileSize, getPermission],\n );\n\n const triggerUpload = React.useCallback(async () => {\n if (!onUpload || !fileList.length) return;\n setUploading(true);\n try {\n const pending = [...fileList];\n const pool: Promise<void>[] = [];\n while (pending.length) {\n const item = pending.shift();\n if (!item?.originFileObj) continue;\n const rawFile = item.originFileObj;\n pool.push(\n new Promise<void>((resolve) => {\n onUpload({\n file: rawFile,\n onSuccess: (url?) => {\n setFileList((prev) =>\n prev.map((f) =>\n f.uid === item.uid ? { ...f, status: 'done' as const, url: url ?? f.url } : f,\n ),\n );\n resolve();\n },\n onError: (_err: Error) => {\n message.error(`${item.name} 上传失败`);\n setFileList((prev) =>\n prev.map((f) => (f.uid === item.uid ? { ...f, status: 'error' as const } : f)),\n );\n resolve();\n },\n });\n }),\n );\n if (pool.length >= concurrent) await Promise.race(pool);\n }\n await Promise.allSettled(pool);\n onSave?.(fileList);\n } finally {\n setUploading(false);\n }\n }, [fileList, onUpload, concurrent, onSave, setFileList]);\n\n React.useImperativeHandle(ref, () => ({ upload: triggerUpload, uploading }), [\n triggerUpload,\n uploading,\n ]);\n\n const openPreview = React.useCallback((file: UploadFile) => {\n const url = resolvePreviewUrl(file);\n if (!url) {\n message.warning('暂无法预览该文件');\n return;\n }\n if (url.startsWith('blob:')) {\n blobUrlsRef.current.push(url);\n }\n setPreview({ open: true, url, title: file.name || '预览' });\n }, []);\n\n React.useEffect(\n () => () => {\n blobUrlsRef.current.forEach((u) => URL.revokeObjectURL(u));\n blobUrlsRef.current = [];\n },\n [],\n );\n\n const tips = renderTips?.() ?? buildTips(accept, fileSize, maxLength);\n const canAddMore = !maxLength || fileList.length < maxLength;\n\n const previewNode = (\n <Image\n alt={preview.title}\n style={{ display: 'none' }}\n src={preview.url}\n preview={{\n visible: preview.open,\n src: preview.url,\n onVisibleChange: (visible) => setPreview((prev) => ({ ...prev, open: visible })),\n }}\n />\n );\n\n if (listType === 'picture-card') {\n return (\n <div\n className={classNames('upload-picture-root', styles['upload-picture-root'], className)}\n >\n <Upload\n listType=\"picture-card\"\n fileList={fileList}\n beforeUpload={beforeUploadFn}\n onChange={(info) => setFileList(info.fileList)}\n onPreview={openPreview}\n multiple={multiple}\n directory={directory}\n accept={accept}\n showUploadList={{ showPreviewIcon: true, showRemoveIcon: true }}\n customRequest={({ onSuccess }) => onSuccess?.({})}\n className={classNames('upload-picture-card', styles['upload-picture-card'])}\n >\n {canAddMore ? (\n <div\n className={classNames('upload-picture-trigger', styles['upload-picture-trigger'])}\n >\n <Plus size={20} />\n <div\n className={classNames(\n 'upload-picture-trigger-text',\n styles['upload-picture-trigger-text'],\n )}\n >\n 上传图片\n </div>\n </div>\n ) : null}\n </Upload>\n {tips ? (\n <div className={classNames('upload-list', styles['upload-list'])}>{tips}</div>\n ) : null}\n {previewNode}\n </div>\n );\n }\n\n if (variant === 'panel') {\n return (\n <div className={className}>\n <Upload.Dragger\n fileList={fileList}\n beforeUpload={beforeUploadFn}\n onChange={(info) => setFileList(info.fileList)}\n multiple={multiple}\n directory={directory}\n accept={accept}\n showUploadList={false}\n customRequest={({ onSuccess }) => onSuccess?.({})}\n >\n <p className={classNames('upload-drag-icon', styles['upload-drag-icon'])}>\n <Inbox />\n </p>\n <p className=\"ant-upload-text\">点击或拖拽文件到此区域上传</p>\n <p>{tips}</p>\n </Upload.Dragger>\n {showFileList && (\n <UploadedFiles\n fileList={fileList}\n onRemove={(uid) => setFileList((prev) => prev.filter((f) => f.uid !== uid))}\n onPreview={openPreview}\n />\n )}\n {previewNode}\n </div>\n );\n }\n\n // button mode (default) + text list\n return (\n <div className={className}>\n <Upload\n fileList={fileList}\n beforeUpload={beforeUploadFn}\n onChange={(info) => setFileList(info.fileList)}\n multiple={multiple}\n directory={directory}\n accept={accept}\n showUploadList={false}\n customRequest={({ onSuccess }) => onSuccess?.({})}\n >\n {children ?? (\n <Button\n size={size}\n icon={<UploadIcon />}\n className={classNames('upload-toolbar', styles['upload-toolbar'])}\n >\n 点击上传\n </Button>\n )}\n </Upload>\n <div className={classNames('upload-list', styles['upload-list'])}>{tips}</div>\n {showFileList && (\n <UploadedFiles\n fileList={fileList}\n onRemove={(uid) => setFileList((prev) => prev.filter((f) => f.uid !== uid))}\n onPreview={openPreview}\n />\n )}\n {previewNode}\n </div>\n );\n },\n);\n\nCommonUpload.displayName = 'CommonUpload';\n\nexport default CommonUpload;\n"],"names":["formatSize","bytes","buildTips","accept","fileSize","maxLength","parts","exts","s","jsx","Typography","classNames","styles","getExt","filename","idx","resolvePreviewUrl","file","UploadedFiles","fileList","onRemove","onPreview","previewable","_b","_a","jsxs","_c","File","SemanticTag","SEMANTIC_COLORS","Button","Trash2","CommonUpload","React","value","onChange","className","variant","listType","size","children","renderTips","showFileList","multiple","directory","onUpload","onSave","getPermission","concurrentCount","ref","innerFileList","setInnerFileList","uploading","setUploading","preview","setPreview","blobUrlsRef","setFileList","next","resolved","effectiveFileSize","concurrent","beforeUploadFn","message","Upload","triggerUpload","pending","pool","item","rawFile","resolve","url","prev","f","_err","openPreview","u","tips","canAddMore","previewNode","Image","visible","info","onSuccess","Plus","Inbox","uid","UploadIcon"],"mappings":";;;;;;;AAkEA,MAAMA,IAAa,CAACC,MACdA,IAAQ,OAAO,OAAa,IAAIA,IAAQ,MAAM,QAAQ,CAAC,CAAC,OACxDA,IAAQ,QAAQ,IAAU,IAAIA,IAAQ,OAAO,MAAM,QAAQ,CAAC,CAAC,MAC1D,IAAIA,IAAQ,QAAQ,GAAG,QAAQ,CAAC,CAAC;AAG1C,SAASC,GAAUC,GAAiBC,GAAmBC,GAAqC;AAC1F,QAAMC,IAAkB,CAAA;AACxB,MAAIH,GAAQ;AACV,UAAMI,IAAOJ,EACV,MAAM,GAAG,EACT,IAAI,CAACK,MAAMA,EAAE,KAAA,EAAO,QAAQ,OAAO,EAAE,CAAC,EACtC,OAAO,OAAO;AACjB,IAAID,EAAK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ACC,UAAA7C;AAAA,UACA,cAAc2C;AAAA,UACd,UAAU,CAACoB,MAASzB,EAAYyB,EAAK,QAAQ;AAAA,UAC7C,UAAAvC;AAAA,UACA,WAAAC;AAAA,UACA,QAAAzC;AAAA,UACA,gBAAgB;AAAA,UAChB,eAAe,CAAC,EAAE,WAAAgF,QAAgBA,KAAA,gBAAAA,EAAY,CAAA;AAAA,UAE7C,UAAA3C,KACC,gBAAA/B;AAAA,YAACqB;AAAA,YAAA;AAAA,cACC,MAAAS;AAAA,cACA,wBAAOgD,IAAA,EAAW;AAAA,cAClB,WAAW5E,EAAW,kBAAkBC,EAAO,gBAAgB,CAAC;AAAA,cACjE,UAAA;AAAA,YAAA;AAAA,UAAA;AAAA,QAED;AAAA,MAAA;AAAA,MAGJ,gBAAAH,EAAC,SAAI,WAAWE,EAAW,eAAeC,EAAO,aAAa,CAAC,GAAI,UAAAiE,EAAA,CAAK;AAAA,MACvEnC,KACC,gBAAAjC;AAAA,QAACS;AAAA,QAAA;AAAA,UACC,UAAAC;AAAA,UACA,UAAU,CAACmE,MAAQ7B,EAAY,CAACe,MAASA,EAAK,OAAO,CAACC,MAAMA,EAAE,QAAQa,CAAG,CAAC;AAAA,UAC1E,WAAWX;AAAA,QAAA;AAAA,MAAA;AAAA,MAGdI;AAAA,IAAA,GACH;AAAA,EAEJ;AACF;AAEA/C,GAAa,cAAc;"}
@@ -1,19 +1,26 @@
1
- const o = {
2
- "upload-item": "_upload-item_xoraq_67",
3
- "upload-link": "_upload-link_xoraq_73",
4
- "upload-label": "_upload-label_xoraq_77",
5
- "upload-value": "_upload-value_xoraq_84",
6
- "upload-meta": "_upload-meta_xoraq_89",
7
- "upload-icon": "_upload-icon_xoraq_95",
8
- "upload-title": "_upload-title_xoraq_100",
9
- "upload-desc": "_upload-desc_xoraq_106",
10
- "upload-toolbar": "_upload-toolbar_xoraq_115",
11
- "upload-list": "_upload-list_xoraq_125",
12
- "upload-file-row": "_upload-file-row_xoraq_129",
13
- "upload-file-row-error": "_upload-file-row-error_xoraq_140",
14
- "upload-drag-icon": "_upload-drag-icon_xoraq_145"
1
+ const p = {
2
+ "upload-item": "_upload-item_1xwph_67",
3
+ "upload-link": "_upload-link_1xwph_73",
4
+ "upload-label": "_upload-label_1xwph_80",
5
+ "upload-thumb-btn": "_upload-thumb-btn_1xwph_87",
6
+ "upload-thumb": "_upload-thumb_1xwph_87",
7
+ "upload-row-actions": "_upload-row-actions_1xwph_107",
8
+ "upload-picture-root": "_upload-picture-root_1xwph_114",
9
+ "upload-picture-card": "_upload-picture-card_1xwph_119",
10
+ "upload-picture-trigger": "_upload-picture-trigger_1xwph_125",
11
+ "upload-picture-trigger-text": "_upload-picture-trigger-text_1xwph_134",
12
+ "upload-value": "_upload-value_1xwph_139",
13
+ "upload-meta": "_upload-meta_1xwph_144",
14
+ "upload-icon": "_upload-icon_1xwph_150",
15
+ "upload-title": "_upload-title_1xwph_155",
16
+ "upload-desc": "_upload-desc_1xwph_161",
17
+ "upload-toolbar": "_upload-toolbar_1xwph_170",
18
+ "upload-list": "_upload-list_1xwph_180",
19
+ "upload-file-row": "_upload-file-row_1xwph_184",
20
+ "upload-file-row-error": "_upload-file-row-error_1xwph_195",
21
+ "upload-drag-icon": "_upload-drag-icon_1xwph_200"
15
22
  };
16
23
  export {
17
- o as default
24
+ p as default
18
25
  };
19
26
  //# sourceMappingURL=style.module.scss.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"style.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"style.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;"}
@@ -10,13 +10,14 @@ export * from './Modal';
10
10
  export * from './Permissions';
11
11
  export * from './OrgTree';
12
12
  export * from './StateBar';
13
+ export * from './SegmentedRadio';
13
14
  export * from './Stat';
14
15
  export * from './Table';
15
16
  export * from './Tag';
16
17
  export * from './TooltipInfo';
17
18
  export * from './Tour';
18
19
  export { default as CommonUpload } from './Upload';
19
- export type { CommonUploadProps, CommonUploadRef, UploadVariant } from './Upload';
20
+ export type { CommonUploadProps, CommonUploadRef, UploadListType, UploadVariant } from './Upload';
20
21
  export * from './VirtualScrollbar';
21
22
  export * from './Icons';
22
23
  export * from './Sparkline';