@lemon30_npm/csit-vue3 1.0.60 → 1.0.64

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 (37) hide show
  1. package/dist/csit-vue3.js +1103 -879
  2. package/dist/index.css +1 -1
  3. package/dist/lib/ci-common-list/ci-common-list-pagination/index.css +0 -0
  4. package/dist/lib/ci-common-list/ci-common-list-pagination/index.vue.js +1 -1
  5. package/dist/lib/ci-common-list/ci-common-list-pagination/index.vue2.js +1 -1
  6. package/dist/lib/ci-common-list/ci-common-list-query/index.css +1 -1
  7. package/dist/lib/ci-common-list/ci-common-list-query/index.vue.js +1 -1
  8. package/dist/lib/ci-common-list/ci-common-list-query/index.vue2.js +1 -1
  9. package/dist/lib/ci-dictionary-select/index.css +1 -0
  10. package/dist/lib/ci-dictionary-select/index.vue.js +1 -1
  11. package/dist/lib/ci-dictionary-select/index.vue2.js +95 -45
  12. package/dist/lib/ci-element-plus/ci-choose-all-select/index.css +1 -0
  13. package/dist/lib/ci-element-plus/ci-choose-all-select/index.js +9 -0
  14. package/dist/lib/ci-element-plus/ci-choose-all-select/index.vue.js +7 -0
  15. package/dist/lib/ci-element-plus/ci-choose-all-select/index.vue2.js +113 -0
  16. package/dist/lib/ci-upload/computed/index.js +21 -9
  17. package/dist/lib/ci-upload/hooks/useFileSize.js +10 -0
  18. package/dist/lib/ci-upload/index.css +1 -1
  19. package/dist/lib/ci-upload/index.vue.js +2 -2
  20. package/dist/lib/ci-upload/index.vue2.js +199 -164
  21. package/dist/lib/ci-upload/props/index.js +12 -3
  22. package/dist/lib/components/index.js +25 -22
  23. package/dist/lib/styles/reset-elementPlus/index.css +1 -1
  24. package/dist/types/src/components/components-project/ci-dictionary-select/index.vue.d.ts +5 -2
  25. package/dist/types/src/components/components-project/ci-dictionary-select/type.d.ts +2 -0
  26. package/dist/types/src/components/components-project/ci-element-plus/ci-choose-all-select/index.d.ts +8 -0
  27. package/dist/types/src/components/components-project/ci-element-plus/ci-choose-all-select/index.vue.d.ts +36 -0
  28. package/dist/types/src/components/components-project/ci-element-plus/ci-choose-all-select/model/index.d.ts +1 -0
  29. package/dist/types/src/components/components-project/ci-element-plus/ci-choose-all-select/type.d.ts +17 -0
  30. package/dist/types/src/components/components-project/ci-upload/computed/index.d.ts +0 -1
  31. package/dist/types/src/components/components-project/ci-upload/hooks/useFileSize.d.ts +3 -0
  32. package/dist/types/src/components/components-project/ci-upload/index.vue.d.ts +4 -0
  33. package/dist/types/src/components/components-project/ci-upload/props/index.d.ts +4 -0
  34. package/dist/types/src/components/components-project/ci-upload/type.d.ts +4 -0
  35. package/dist/types/src/views-demo/usedemo-ci-choose-all-select/index.vue.d.ts +2 -0
  36. package/dist/types/src/views-demo/usedemo-ci-choose-all-select/routes/index.d.ts +13 -0
  37. package/package.json +8 -1
@@ -1,49 +1,50 @@
1
- import { ElUpload as se, ElButton as le, ElLink as ae, ElDivider as ne, ElTooltip as ie } from "element-plus/es";
2
- import { defineComponent as re, mergeDefaults as de, useSlots as ue, ref as D, watch as ce, createElementBlock as l, openBlock as s, createBlock as C, createCommentVNode as n, mergeProps as pe, unref as y, createSlots as me, withCtx as c, renderSlot as _, Fragment as m, createElementVNode as a, toDisplayString as v, renderList as N, normalizeProps as fe, guardReactiveProps as ge, normalizeClass as S, createVNode as h, createTextVNode as B, normalizeStyle as R, nextTick as L } from "vue";
3
- import I from "./icons/icon-upload-btn.svg.js";
4
- import T from "./icons/icon-upload-btn-hover.svg.js";
5
- import K from "./icons/icon-upload-btn-disabled.svg.js";
6
- import ye from "./icons/icon-loading-blue.svg.js";
7
- import ve from "./icons/icon-upload-success.svg.js";
8
- import we from "./icons/icon-upload-retry.svg.js";
9
- import ke from "./icons/icon-upload-fail.svg.js";
10
- import { ElMessageBox as he, ElMessage as $ } from "element-plus";
11
- import { useUpload as be } from "./hooks/useUpload.js";
12
- import { useUploadRetry as Be } from "./hooks/useUploadRetry.js";
13
- import { downloadFileWithAxios as Ce } from "./utils/file.js";
14
- import { getFileIconByName as _e } from "./utils/file-icon-maps.js";
15
- import { useExposeMethods as Se } from "./expose/index.js";
16
- import { useCiUploadComputed as ze } from "./computed/index.js";
17
- import { defaultProps as De } from "./props/index.js";
18
- const Le = { class: "CiUpload" }, $e = {
1
+ import { ElUpload as re, ElButton as de, ElLink as ue, ElTooltip as me, ElDivider as ce } from "element-plus/es";
2
+ import { defineComponent as pe, mergeDefaults as fe, useSlots as ge, ref as V, watch as ye, createElementBlock as l, openBlock as s, createBlock as L, createCommentVNode as n, mergeProps as ve, unref as y, createSlots as ke, withCtx as m, renderSlot as P, Fragment as v, createElementVNode as a, toDisplayString as b, renderList as M, normalizeProps as we, guardReactiveProps as he, normalizeClass as $, createTextVNode as _, createVNode as N, normalizeStyle as q, nextTick as D } from "vue";
3
+ import A from "./icons/icon-upload-btn.svg.js";
4
+ import H from "./icons/icon-upload-btn-hover.svg.js";
5
+ import O from "./icons/icon-upload-btn-disabled.svg.js";
6
+ import be from "./icons/icon-loading-blue.svg.js";
7
+ import Be from "./icons/icon-upload-success.svg.js";
8
+ import Se from "./icons/icon-upload-retry.svg.js";
9
+ import Ce from "./icons/icon-upload-fail.svg.js";
10
+ import { ElMessageBox as Le, ElMessage as z } from "element-plus";
11
+ import { useUpload as _e } from "./hooks/useUpload.js";
12
+ import { useUploadRetry as Ne } from "./hooks/useUploadRetry.js";
13
+ import { downloadFileWithAxios as ze } from "./utils/file.js";
14
+ import { getFileIconByName as $e } from "./utils/file-icon-maps.js";
15
+ import { useExposeMethods as De } from "./expose/index.js";
16
+ import { useCiUploadComputed as Ee } from "./computed/index.js";
17
+ import { defaultProps as Te } from "./props/index.js";
18
+ import { useFileSize as Pe } from "./hooks/useFileSize.js";
19
+ const Ue = { class: "CiUpload" }, Ie = {
19
20
  key: 0,
20
21
  class: "tip-slot-textInfo"
21
- }, Ee = {
22
+ }, Re = {
22
23
  key: 1,
23
24
  class: "default-tip-slot-textInfo"
24
- }, Pe = { class: "upload-btn-text" }, Ue = {
25
+ }, Ve = { class: "upload-btn-text" }, Fe = {
25
26
  key: 0,
26
27
  class: "tip-slot-textInfo"
27
- }, Ne = {
28
+ }, Ke = {
28
29
  key: 1,
29
30
  class: "default-tip-slot-textInfo"
30
- }, Re = { class: "file-item-top" }, Ie = { class: "file-name-file-icon" }, Te = ["src"], Ke = { class: "top-right" }, Me = {
31
+ }, Me = { class: "file-item-top" }, qe = { class: "file-name-file-icon" }, Ae = ["src"], He = { class: "top-right" }, Oe = {
31
32
  key: 0,
32
33
  class: "file-size"
33
- }, Ve = {
34
+ }, We = {
34
35
  key: 1,
35
36
  class: "file-operate-btn"
36
- }, qe = { class: "file-status-icon-wrapper" }, Ae = { class: "uploading-percentage" }, He = ["onClick"], We = {
37
+ }, je = { class: "file-status-icon-wrapper" }, Ge = { class: "uploading-percentage" }, Je = ["onClick"], Qe = {
37
38
  key: 0,
38
39
  class: "file-item-bottom file-progress-bar"
39
- }, Fe = {
40
+ }, Xe = {
40
41
  key: 0,
41
42
  class: "file-item-bottom file-progress-bar download-progress-bar"
42
- }, Oe = {
43
+ }, Ye = {
43
44
  name: "CiUpload"
44
- }, dt = /* @__PURE__ */ re({
45
- ...Oe,
46
- props: /* @__PURE__ */ de({
45
+ }, kt = /* @__PURE__ */ pe({
46
+ ...Ye,
47
+ props: /* @__PURE__ */ fe({
47
48
  action: {},
48
49
  downloadUrl: {},
49
50
  data: {},
@@ -66,54 +67,68 @@ const Le = { class: "CiUpload" }, $e = {
66
67
  drag: { type: Boolean },
67
68
  disabled: { type: Boolean },
68
69
  readonly: { type: Boolean },
69
- axiosInstance: {}
70
- }, De),
70
+ axiosInstance: {},
71
+ minSize: {},
72
+ showFileNameEllipsisTooltip: { type: Boolean },
73
+ maxFileNameLength: {},
74
+ minFileNameLength: {}
75
+ }, Te),
71
76
  emits: ["update:fileList", "onSuccess", "onRemove", "onChange", "onError", "onCustomDownload"],
72
- setup(M, { expose: V, emit: q }) {
73
- const A = ue(), E = D(), b = D(!1), w = D([]), { checkUploadStatus: H } = Se(w), r = M, { customHttpRequest: W } = be(r.axiosInstance), d = q;
74
- V({
75
- checkUploadStatus: H
77
+ setup(W, { expose: j, emit: G }) {
78
+ const { formatFileSize: U } = Pe(), J = ge(), F = V(), f = V(!1), S = V([]), { checkUploadStatus: Q } = De(S), i = W, { customHttpRequest: X } = _e(i.axiosInstance), r = G;
79
+ j({
80
+ checkUploadStatus: Q
76
81
  });
77
- const { retryUpload: F } = Be(w, d, r);
78
- ce(
79
- () => r.fileList,
82
+ const { retryUpload: Y } = Ne(S, r, i);
83
+ ye(
84
+ () => i.fileList,
80
85
  (e) => {
81
- w.value = e.map((t) => ({ ...t }));
86
+ S.value = e.map((t) => ({ ...t }));
82
87
  },
83
88
  { immediate: !0 }
84
89
  );
85
- const z = (e) => {
90
+ const I = (e) => {
86
91
  var t;
87
- (t = E.value) == null || t.handleRemove(e);
88
- }, P = (e) => {
89
- if (r.customDownload) {
90
- d("onCustomDownload", e);
92
+ (t = F.value) == null || t.handleRemove(e);
93
+ }, R = (e) => {
94
+ if (i.customDownload) {
95
+ r("onCustomDownload", e);
91
96
  return;
92
97
  }
93
- e.downloadPercentage = 0, e.status = "downloading", Ce(
98
+ e.downloadPercentage = 0, e.status = "downloading", ze(
94
99
  {
95
100
  fileKey: e.fileKey || "当前此条数据没有fileKey字段",
96
101
  fileName: e.fileName || "当前此条数据没有fileName字段"
97
102
  },
98
- r.downloadUrl,
103
+ i.downloadUrl,
99
104
  (t) => {
100
105
  e.downloadPercentage = t, t === 100 && (e.status = "success");
101
106
  },
102
107
  (t) => {
103
108
  e.status = "success";
104
109
  },
105
- r.axiosInstance
110
+ i.axiosInstance
106
111
  );
107
- }, O = (e) => {
108
- const t = r.accept.split(",").map((i) => i.trim().toLowerCase()), u = e.type.toLowerCase(), f = e.name.toLowerCase();
109
- return t.some((i) => u === i || f.endsWith(i)) ? e.size <= r.maxSize ? !0 : ($.error(`文件大小超出限制,最大文件大小为${ee.value}`), b.value = !0, L(() => {
110
- const i = r.fileList.filter((o) => o.uid !== e.uid);
111
- d("update:fileList", i), b.value = !1;
112
- }), !1) : ($.error("不支持上传该类型文件"), b.value = !0, L(() => {
113
- const i = r.fileList.filter((o) => o.uid !== e.uid);
114
- d("update:fileList", i), b.value = !1;
112
+ }, Z = (e) => {
113
+ const t = i.accept.split(",").map((u) => u.trim().toLowerCase()), c = e.type.toLowerCase(), k = e.name.toLowerCase();
114
+ if (!t.some((u) => c === u || k.endsWith(u)))
115
+ return z.error("不支持上传该类型文件"), f.value = !0, D(() => {
116
+ const u = i.fileList.filter((B) => B.uid !== e.uid);
117
+ r("update:fileList", u), f.value = !1;
118
+ }), !1;
119
+ const g = e.name || "", w = g.lastIndexOf("."), d = (w > 0 ? g.slice(0, w) : g).length, h = i.maxFileNameLength, C = i.minFileNameLength;
120
+ let E = !0, T = "";
121
+ return h > 0 && C > 0 ? (d > h || d < C) && (E = !1, T = `文件名长度需在 ${C} 到 ${h} 个字符之间`) : h > 0 ? d > h && (E = !1, T = `文件名长度不能超过 ${h} 个字符`) : C > 0 && d < C && (E = !1, T = `文件名长度不能小于 ${C} 个字符`), E ? e.size < i.minSize || e.size === 0 ? (e.size === 0 ? z.error("文件大小不能为空") : z.error(`文件大小不能小于 ${U(i.minSize)}`), f.value = !0, D(() => {
122
+ const u = i.fileList.filter((B) => B.uid !== e.uid);
123
+ r("update:fileList", u), f.value = !1;
124
+ }), !1) : e.size <= i.maxSize ? !0 : (z.error(`文件大小超出限制,最大文件大小为${U(i.maxSize)}`), f.value = !0, D(() => {
125
+ const u = i.fileList.filter((B) => B.uid !== e.uid);
126
+ r("update:fileList", u), f.value = !1;
127
+ }), !1) : (z.error(T), f.value = !0, D(() => {
128
+ const u = i.fileList.filter((B) => B.uid !== e.uid);
129
+ r("update:fileList", u), f.value = !1;
115
130
  }), !1);
116
- }, j = (e, t) => b.value ? !0 : he.confirm(
131
+ }, x = (e, t) => f.value ? !0 : Le.confirm(
117
132
  `确定删除 ${e.fileName || e.name} 文件?`,
118
133
  "确定删除",
119
134
  {
@@ -126,96 +141,96 @@ const Le = { class: "CiUpload" }, $e = {
126
141
  // 用户点击“确定”按钮,允许删除
127
142
  () => !1
128
143
  // 用户点击“取消”按钮,取消删除
129
- ), G = (e, t) => {
130
- $.error(`文件数量超出限制,最大文件数量为${r.limit}个`);
131
- }, J = (e, t, u) => {
132
- t.status = "fail", t.percentage = 0, L(() => {
133
- d("update:fileList", [...u, t]), d("onError", t, u);
144
+ ), ee = (e, t) => {
145
+ z.error(`文件数量超出限制,最大文件数量为${i.limit}个`);
146
+ }, te = (e, t, c) => {
147
+ t.status = "fail", t.percentage = 0, D(() => {
148
+ r("update:fileList", [...c, t]), r("onError", t, c);
134
149
  });
135
- }, Q = (e, t, u) => {
136
- var p, k, i;
150
+ }, oe = (e, t, c) => {
151
+ var p, g, w;
137
152
  if (!e) return;
138
- const f = u.find((o) => o.uid === t.uid);
139
- f && (f.fileName = ((p = e == null ? void 0 : e.data) == null ? void 0 : p.fileName) || t.name, f.fileKey = ((k = e == null ? void 0 : e.data) == null ? void 0 : k.fileKey) || "当前接口没有返回fileKey字段", f.fileSize = ((i = e == null ? void 0 : e.data) == null ? void 0 : i.fileSize) || t.size), d("update:fileList", u), d("onSuccess", t, u);
140
- }, X = (e, t) => {
141
- e.status === "success" && !e.response || (d("update:fileList", t), d("onChange", e, t));
142
- }, Y = (e, t) => {
143
- d("update:fileList", t), d("onRemove", e, t);
144
- }, { hasRealDefaultSlot: Z, finalBeforeUpload: x, maxSizeInMB: ee, defaultTipSlotTextInfo: U, otherSlots: te } = ze(r, A, O);
153
+ const k = c.find((o) => o.uid === t.uid);
154
+ k && (k.fileName = ((p = e == null ? void 0 : e.data) == null ? void 0 : p.fileName) || t.name, k.fileKey = ((g = e == null ? void 0 : e.data) == null ? void 0 : g.fileKey) || "当前接口没有返回fileKey字段", k.fileSize = ((w = e == null ? void 0 : e.data) == null ? void 0 : w.fileSize) || t.size), r("update:fileList", c), r("onSuccess", t, c);
155
+ }, se = (e, t) => {
156
+ e.status === "success" && !e.response || (r("update:fileList", t), r("onChange", e, t));
157
+ }, le = (e, t) => {
158
+ r("update:fileList", t), r("onRemove", e, t);
159
+ }, { hasRealDefaultSlot: ae, finalBeforeUpload: ie, defaultTipSlotTextInfo: K, otherSlots: ne } = Ee(i, J, Z);
145
160
  return (e, t) => {
146
- const u = le, f = se, p = ae, k = ne, i = ie;
147
- return s(), l("div", Le, [
148
- e.readonly ? n("", !0) : (s(), C(f, pe({
161
+ const c = de, k = re, p = ue, g = me, w = ce;
162
+ return s(), l("div", Ue, [
163
+ e.readonly ? n("", !0) : (s(), L(k, ve({
149
164
  key: 0,
150
165
  class: ["ci-el-upload-component", { "is-disabled": e.disabled }],
151
166
  ref_key: "uploadRef",
152
- ref: E,
167
+ ref: F,
153
168
  action: e.action,
154
169
  data: e.data,
155
170
  headers: e.headers,
156
- "file-list": w.value,
171
+ "file-list": S.value,
157
172
  accept: e.accept,
158
173
  limit: e.limit,
159
174
  multiple: e.multiple,
160
175
  drag: e.drag,
161
176
  disabled: e.disabled,
162
- "before-upload": y(x),
163
- "before-remove": j,
164
- "on-success": Q,
165
- "on-change": X,
166
- "on-remove": Y,
167
- "on-exceed": G,
168
- "on-error": J,
169
- "http-request": y(W),
177
+ "before-upload": y(ie),
178
+ "before-remove": x,
179
+ "on-success": oe,
180
+ "on-change": se,
181
+ "on-remove": le,
182
+ "on-exceed": ee,
183
+ "on-error": te,
184
+ "http-request": y(X),
170
185
  "show-file-list": !1
171
- }, e.$attrs), me({
172
- default: c(() => [
173
- y(Z) ? _(e.$slots, "default", { key: 0 }, void 0, !0) : (s(), l(m, { key: 1 }, [
174
- e.drag ? (s(), l(m, { key: 0 }, [
186
+ }, e.$attrs), ke({
187
+ default: m(() => [
188
+ y(ae) ? P(e.$slots, "default", { key: 0 }, void 0, !0) : (s(), l(v, { key: 1 }, [
189
+ e.drag ? (s(), l(v, { key: 0 }, [
175
190
  t[0] || (t[0] = a("img", {
176
191
  class: "upload-btn-icon",
177
- src: I,
192
+ src: A,
178
193
  alt: ""
179
194
  }, null, -1)),
180
195
  t[1] || (t[1] = a("img", {
181
196
  class: "upload-btn-icon-hover",
182
- src: T,
197
+ src: H,
183
198
  alt: ""
184
199
  }, null, -1)),
185
200
  t[2] || (t[2] = a("img", {
186
201
  class: "upload-btn-icon-disabled",
187
- src: K,
202
+ src: O,
188
203
  alt: ""
189
204
  }, null, -1)),
190
205
  t[3] || (t[3] = a("div", { class: "drag-text-info" }, [
191
206
  a("span", { class: "drag-text-info-click" }, "点击上传"),
192
207
  a("span", { class: "drag-text-info-black" }, "或将文件拖拽到这里上传")
193
208
  ], -1)),
194
- e.$slots.tip ? (s(), l("div", $e, [
195
- _(e.$slots, "tip", {}, void 0, !0)
196
- ])) : (s(), l("div", Ee, v(y(U)), 1))
197
- ], 64)) : (s(), C(u, {
209
+ e.$slots.tip ? (s(), l("div", Ie, [
210
+ P(e.$slots, "tip", {}, void 0, !0)
211
+ ])) : (s(), l("div", Re, b(y(K)), 1))
212
+ ], 64)) : (s(), L(c, {
198
213
  key: 1,
199
214
  class: "upload-btn",
200
215
  disabled: e.disabled
201
216
  }, {
202
- default: c(() => [
217
+ default: m(() => [
203
218
  t[4] || (t[4] = a("img", {
204
219
  class: "upload-btn-icon",
205
- src: I,
220
+ src: A,
206
221
  alt: ""
207
222
  }, null, -1)),
208
223
  t[5] || (t[5] = a("img", {
209
224
  class: "upload-btn-icon-hover",
210
- src: T,
225
+ src: H,
211
226
  alt: ""
212
227
  }, null, -1)),
213
228
  t[6] || (t[6] = a("img", {
214
229
  class: "upload-btn-icon-disabled",
215
- src: K,
230
+ src: O,
216
231
  alt: ""
217
232
  }, null, -1)),
218
- a("span", Pe, v(e.uploadBtnText), 1)
233
+ a("span", Ve, b(e.uploadBtnText), 1)
219
234
  ]),
220
235
  _: 1,
221
236
  __: [4, 5, 6]
@@ -226,159 +241,179 @@ const Le = { class: "CiUpload" }, $e = {
226
241
  }, [
227
242
  e.drag ? void 0 : {
228
243
  name: "tip",
229
- fn: c(() => [
230
- e.$slots.tip ? (s(), l("div", Ue, [
231
- _(e.$slots, "tip", {}, void 0, !0)
232
- ])) : (s(), l("div", Ne, v(y(U)), 1))
244
+ fn: m(() => [
245
+ e.$slots.tip ? (s(), l("div", Fe, [
246
+ P(e.$slots, "tip", {}, void 0, !0)
247
+ ])) : (s(), l("div", Ke, b(y(K)), 1))
233
248
  ]),
234
249
  key: "0"
235
250
  },
236
- N(y(te), (o, g) => ({
237
- name: g,
238
- fn: c((oe) => [
239
- _(e.$slots, g, fe(ge(oe || {})), void 0, !0)
251
+ M(y(ne), (o, d) => ({
252
+ name: d,
253
+ fn: m((h) => [
254
+ P(e.$slots, d, we(he(h || {})), void 0, !0)
240
255
  ])
241
256
  }))
242
257
  ]), 1040, ["class", "action", "data", "headers", "file-list", "accept", "limit", "multiple", "drag", "disabled", "before-upload", "http-request"])),
243
- w.value.length ? (s(), l("div", {
258
+ S.value.length ? (s(), l("div", {
244
259
  key: 1,
245
- class: S(["custom-file-list-default", { "is-readonly": e.readonly }])
260
+ class: $(["custom-file-list-default", { "is-readonly": e.readonly }])
246
261
  }, [
247
- (s(!0), l(m, null, N(w.value, (o) => (s(), l("div", {
262
+ (s(!0), l(v, null, M(S.value, (o) => (s(), l("div", {
248
263
  class: "file-item-wrapper",
249
264
  key: o.uid
250
265
  }, [
251
- a("div", Re, [
252
- a("div", Ie, [
266
+ a("div", Me, [
267
+ a("div", qe, [
253
268
  e.showFileExtIcon ? (s(), l("img", {
254
269
  key: 0,
255
270
  class: "file-icon",
256
- src: y(_e)(o.fileName || o.name)
257
- }, null, 8, Te)) : n("", !0),
258
- h(p, {
271
+ src: y($e)(o.fileName || o.name)
272
+ }, null, 8, Ae)) : n("", !0),
273
+ e.showFileNameEllipsisTooltip ? (s(), L(g, {
274
+ key: 2,
275
+ effect: "dark",
276
+ content: o.fileName || o.name,
277
+ placement: "right"
278
+ }, {
279
+ default: m(() => [
280
+ N(p, {
281
+ class: $(["top-left file-name", { "is-show-file-name-ellipsis-tooltip": e.showFileNameEllipsisTooltip }]),
282
+ disabled: o.status === "downloading" || o.status === "uploading",
283
+ onClick: (d) => R(o)
284
+ }, {
285
+ default: m(() => [
286
+ _(b(o.fileName || o.name), 1)
287
+ ]),
288
+ _: 2
289
+ }, 1032, ["class", "disabled", "onClick"])
290
+ ]),
291
+ _: 2
292
+ }, 1032, ["content"])) : (s(), L(p, {
293
+ key: 1,
259
294
  class: "top-left file-name",
260
295
  disabled: o.status === "downloading" || o.status === "uploading",
261
- onClick: (g) => P(o)
296
+ onClick: (d) => R(o)
262
297
  }, {
263
- default: c(() => [
264
- B(v(o.fileName || o.name), 1)
298
+ default: m(() => [
299
+ _(b(o.fileName || o.name), 1)
265
300
  ]),
266
301
  _: 2
267
- }, 1032, ["disabled", "onClick"])
302
+ }, 1032, ["disabled", "onClick"]))
268
303
  ]),
269
- a("div", Ke, [
270
- e.showFileSize ? (s(), l("span", Me, v(o.fileSize || o.size ? ((o.fileSize || o.size) / 1024 / 1024).toFixed(2) + "MB" : "无文件大小"), 1)) : n("", !0),
271
- o.status !== "fail" ? (s(), l("div", Ve, [
272
- o.status !== "uploading" ? (s(), l(m, { key: 0 }, [
273
- e.showPreviewBtn ? (s(), l(m, { key: 0 }, [
274
- h(p, {
275
- onClick: (g) => z(o)
304
+ a("div", He, [
305
+ e.showFileSize ? (s(), l("span", Oe, b(y(U)(o.fileSize || o.size)), 1)) : n("", !0),
306
+ o.status !== "fail" ? (s(), l("div", We, [
307
+ o.status !== "uploading" ? (s(), l(v, { key: 0 }, [
308
+ e.showPreviewBtn ? (s(), l(v, { key: 0 }, [
309
+ N(p, {
310
+ onClick: (d) => I(o)
276
311
  }, {
277
- default: c(() => t[7] || (t[7] = [
278
- B(" 在线预览 ")
312
+ default: m(() => t[7] || (t[7] = [
313
+ _(" 在线预览 ")
279
314
  ])),
280
315
  _: 2,
281
316
  __: [7]
282
317
  }, 1032, ["onClick"]),
283
- h(k, { direction: "vertical" })
318
+ N(w, { direction: "vertical" })
284
319
  ], 64)) : n("", !0),
285
- e.showDownloadBtn ? (s(), l(m, { key: 1 }, [
286
- h(p, {
320
+ e.showDownloadBtn ? (s(), l(v, { key: 1 }, [
321
+ N(p, {
287
322
  disabled: o.status === "downloading",
288
- onClick: (g) => P(o)
323
+ onClick: (d) => R(o)
289
324
  }, {
290
- default: c(() => [
291
- B(v(o.status === "downloading" && e.showDownloadProgress && e.customDownload ? `下载中...${o.downloadPercentage || 0}%` : "下载"), 1)
325
+ default: m(() => [
326
+ _(b(o.status === "downloading" && e.showDownloadProgress && e.customDownload ? `下载中...${o.downloadPercentage || 0}%` : "下载"), 1)
292
327
  ]),
293
328
  _: 2
294
329
  }, 1032, ["disabled", "onClick"]),
295
- e.showDeleteBtn && !e.readonly ? (s(), C(k, {
330
+ e.showDeleteBtn && !e.readonly ? (s(), L(w, {
296
331
  key: 0,
297
332
  direction: "vertical"
298
333
  })) : n("", !0)
299
334
  ], 64)) : n("", !0),
300
- e.showDeleteBtn && !e.readonly ? (s(), C(p, {
335
+ e.showDeleteBtn && !e.readonly ? (s(), L(p, {
301
336
  key: 2,
302
- onClick: (g) => z(o)
337
+ onClick: (d) => I(o)
303
338
  }, {
304
- default: c(() => t[8] || (t[8] = [
305
- B("删除")
339
+ default: m(() => t[8] || (t[8] = [
340
+ _("删除")
306
341
  ])),
307
342
  _: 2,
308
343
  __: [8]
309
344
  }, 1032, ["onClick"])) : n("", !0)
310
345
  ], 64)) : n("", !0)
311
346
  ])) : n("", !0),
312
- a("div", qe, [
347
+ a("div", je, [
313
348
  o.status === "uploading" ? (s(), l("div", {
314
349
  key: 0,
315
- class: S(o.status)
350
+ class: $(o.status)
316
351
  }, [
317
352
  t[9] || (t[9] = a("img", {
318
353
  class: "uploading-icon",
319
- src: ye
354
+ src: be
320
355
  }, null, -1)),
321
- a("span", Ae, v(o.percentage) + "%", 1)
356
+ a("span", Ge, b(o.percentage) + "%", 1)
322
357
  ], 2)) : n("", !0),
323
- e.readonly ? n("", !0) : (s(), l(m, { key: 1 }, [
358
+ e.readonly ? n("", !0) : (s(), l(v, { key: 1 }, [
324
359
  o.status === "success" || o.status === "downloading" ? (s(), l("span", {
325
360
  key: 0,
326
- class: S(o.status)
361
+ class: $(o.status)
327
362
  }, t[10] || (t[10] = [
328
363
  a("img", {
329
364
  class: "success-icon",
330
- src: ve
365
+ src: Be
331
366
  }, null, -1)
332
367
  ]), 2)) : n("", !0)
333
368
  ], 64)),
334
369
  o.status === "fail" ? (s(), l("div", {
335
370
  key: 2,
336
- class: S(["fail-icon-wrapper", o.status])
371
+ class: $(["fail-icon-wrapper", o.status])
337
372
  }, [
338
- h(p, {
339
- onClick: (g) => z(o)
373
+ N(p, {
374
+ onClick: (d) => I(o)
340
375
  }, {
341
- default: c(() => t[11] || (t[11] = [
342
- B(" 删除 ")
376
+ default: m(() => t[11] || (t[11] = [
377
+ _(" 删除 ")
343
378
  ])),
344
379
  _: 2,
345
380
  __: [11]
346
381
  }, 1032, ["onClick"]),
347
- h(i, {
382
+ N(g, {
348
383
  effect: "dark",
349
384
  content: "点击重新上传",
350
385
  placement: "bottom"
351
386
  }, {
352
- default: c(() => [
387
+ default: m(() => [
353
388
  a("img", {
354
389
  class: "retry-icon",
355
- src: we,
356
- onClick: (g) => y(F)(o)
357
- }, null, 8, He)
390
+ src: Se,
391
+ onClick: (d) => y(Y)(o)
392
+ }, null, 8, Je)
358
393
  ]),
359
394
  _: 2
360
395
  }, 1024),
361
396
  t[12] || (t[12] = a("img", {
362
397
  class: "fail-icon",
363
- src: ke
398
+ src: Ce
364
399
  }, null, -1))
365
400
  ], 2)) : n("", !0)
366
401
  ])
367
402
  ])
368
403
  ]),
369
- e.showUploadProgress ? (s(), l(m, { key: 0 }, [
370
- o.status === "uploading" ? (s(), l("div", We, [
404
+ e.showUploadProgress ? (s(), l(v, { key: 0 }, [
405
+ o.status === "uploading" ? (s(), l("div", Qe, [
371
406
  a("div", {
372
407
  class: "file-progress-inner",
373
- style: R({ width: (o.percentage || 0) + "%" })
408
+ style: q({ width: (o.percentage || 0) + "%" })
374
409
  }, null, 4)
375
410
  ])) : n("", !0)
376
411
  ], 64)) : n("", !0),
377
- e.showDownloadProgress ? (s(), l(m, { key: 1 }, [
378
- o.status === "downloading" ? (s(), l("div", Fe, [
412
+ e.showDownloadProgress ? (s(), l(v, { key: 1 }, [
413
+ o.status === "downloading" ? (s(), l("div", Xe, [
379
414
  a("div", {
380
415
  class: "file-progress-inner",
381
- style: R({ width: (o.downloadPercentage || 0) + "%" })
416
+ style: q({ width: (o.downloadPercentage || 0) + "%" })
382
417
  }, null, 4)
383
418
  ])) : n("", !0)
384
419
  ], 64)) : n("", !0)
@@ -389,5 +424,5 @@ const Le = { class: "CiUpload" }, $e = {
389
424
  }
390
425
  });
391
426
  export {
392
- dt as default
427
+ kt as default
393
428
  };
@@ -1,4 +1,4 @@
1
- const o = {
1
+ const e = {
2
2
  // 请求 URL - 默认值: 是我本机本地跑一个 Node 服务, 提供了一个上传接口
3
3
  action: "http://localhost:3001/upload",
4
4
  // 下载 URL - 默认值: 是我本机本地跑一个 Node 服务, 提供了一个下载接口
@@ -47,8 +47,17 @@ const o = {
47
47
  * 若传入了:将使用该实例发起上传请求(支持统一拦截器等配置)
48
48
  * 若未传入:则默认使用全局的 axios 对象
49
49
  */
50
- axiosInstance: void 0
50
+ axiosInstance: void 0,
51
+ // 限制上传文件最小大小(单位 byte)- 默认 0: 代表: 不支持上传空文件, 则就是必须大于 0;
52
+ minSize: 0,
53
+ // 0 代表: 不支持上传空文件, 则就是必须大于 0; 如果开发者配置的值大于0, 则就是: 大于等于minSize即可.
54
+ // 文件名区域超过最大宽度时是否省略号 和 Tooltip 展示
55
+ showFileNameEllipsisTooltip: !1,
56
+ // 限制上传的文件名最大长度 - 默认 0: 代表: 不限制文件名长度; 如果开发者配置的值大于0, 则就是: 文件名长度必须小于等于maxFileNameLength即可.
57
+ maxFileNameLength: 0,
58
+ // 限制上传的文件名最小长度 - 默认 0: 代表: 不限制文件名长度; 如果开发者配置的值大于0, 则就是: 文件名长度必须大于等于minFileNameLength即可.
59
+ minFileNameLength: 0
51
60
  };
52
61
  export {
53
- o as defaultProps
62
+ e as defaultProps
54
63
  };