bp-aicc-editor 1.2.521 → 1.2.522

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 (111) hide show
  1. package/lib/{ScreenPreview-CV95NWOd.js → ScreenPreview-yUHo60be.js} +51 -105
  2. package/lib/atlas-BMjKIOwk.js +3891 -0
  3. package/lib/{button-base-DHNVBrQ9.js → button-base-CXl1z-_m.js} +1 -1
  4. package/lib/{cache-lsjsKZHu.js → cache-DbHSDjJy.js} +1 -1
  5. package/lib/config-provider-Bui8m4GV.js +62 -0
  6. package/lib/{container-group-DqAcKEBy.js → container-group-D6Extorz.js} +1 -1
  7. package/lib/{copy-C5Pi6nJh.js → copy-CsCmPy4J.js} +1 -1
  8. package/lib/{datav-BER95ty-.js → datav-BTD-HJhV.js} +27 -27
  9. package/lib/{delete-C2EW4JCs.js → delete-COj0ilHh.js} +1 -1
  10. package/lib/{divider-BazBGRgV.js → divider-B3K_URZc.js} +1 -1
  11. package/lib/dropdown-CWvnuJsO.js +105 -0
  12. package/lib/{edit-B2pfd2q1.js → edit-vdJaEine.js} +1 -1
  13. package/lib/{el-form-item-BDdxk5F5.js → el-form-item-BbaNohQv.js} +51 -51
  14. package/lib/{el-link-D2ol9BHQ.js → el-link-Dq721Q7-.js} +12 -12
  15. package/lib/{el-loading-Cgwgez55.js → el-loading-DOxnN3bm.js} +17 -17
  16. package/lib/{fullscreen-OChDsSnk.js → fullscreen-DXSogbcG.js} +1 -1
  17. package/lib/{image-C5ZAY3yt.js → image-Cu7JTK9-.js} +1 -1
  18. package/lib/{index-Ci8AbyIq.js → index-68soBnbK.js} +8 -8
  19. package/lib/{index-BatyRVpL.js → index-B-d8WIg1.js} +7 -7
  20. package/lib/{index-BfIEunKC.js → index-B4zV3cxV.js} +18 -17
  21. package/lib/{index-CZJriuFt.js → index-B8QqTLfg.js} +4974 -4898
  22. package/lib/index-BBMItxtW.js +619 -0
  23. package/lib/{index-CGrR_i0u.js → index-BMm0MRz5.js} +14 -15
  24. package/lib/index-BMn8EzMD.js +1027 -0
  25. package/lib/index-BNTW8F-9.js +322 -0
  26. package/lib/index-BTI518b1.js +69 -0
  27. package/lib/{index-BWPVi43E.js → index-BZxUAT4z.js} +4 -4
  28. package/lib/{index-Ck7uFsPE.js → index-BdYTc41r.js} +24 -24
  29. package/lib/index-BfI55Ioc.js +404 -0
  30. package/lib/{index-BhP9eBCp.js → index-BmAcetSf.js} +19 -20
  31. package/lib/index-C35Yp3i8.js +545 -0
  32. package/lib/{index-B19lEYui.js → index-C6GUNRx9.js} +2 -2
  33. package/lib/index-CC28_8Jl.js +567 -0
  34. package/lib/index-CDhmvVt8.js +338 -0
  35. package/lib/index-CDx0y0fp.js +144 -0
  36. package/lib/{el-button-DvLKp6Ga.js → index-CJjljoJG.js} +106 -106
  37. package/lib/index-CNCgXPiO.js +235 -0
  38. package/lib/{index-CWbZmzNT.js → index-CPa_MnOD.js} +30 -29
  39. package/lib/index-CW6ljdNf.js +1582 -0
  40. package/lib/index-C_WopEui.js +513 -0
  41. package/lib/{index-CX_Ghcb6.js → index-CejowjGd.js} +56 -53
  42. package/lib/{index-BwCQWH-N.js → index-CfZXOvi-.js} +42 -40
  43. package/lib/{index-CVsy2qTh.js → index-CgzRTmPh.js} +16 -15
  44. package/lib/index-CmzuNM9v.js +32 -0
  45. package/lib/index-CrxcAFt8.js +5343 -0
  46. package/lib/{index-C7k49L2T.js → index-CuHA7QXu.js} +10 -10
  47. package/lib/{index-qVyixI57.js → index-CyBGAB7D.js} +21 -20
  48. package/lib/index-D6J7coU0.js +129 -0
  49. package/lib/index-DDHxrdAo.js +1773 -0
  50. package/lib/index-DDL-yqq0.js +1401 -0
  51. package/lib/{index-BPcvYtHf.js → index-DOxy-bey.js} +6 -6
  52. package/lib/{index-CVE37oE7.js → index-DOyr0BHr.js} +7 -7
  53. package/lib/index-DPOanmXI.js +887 -0
  54. package/lib/{index-3pzVrvby.js → index-DR_husZg.js} +46 -46
  55. package/lib/{el-tab-pane-DD2eM9rB.js → index-DUzOCQrW.js} +125 -124
  56. package/lib/{index-CGFEhUh9.js → index-DVYI-g8Q.js} +53 -52
  57. package/lib/index-DVyjilLy.js +51 -0
  58. package/lib/{index-CJyYGViv.js → index-DWAJ9GyC.js} +9 -9
  59. package/lib/index-Dj2qCwPD.js +178 -0
  60. package/lib/{index-D4X0_jbv.js → index-Dx2Gld1J.js} +32 -32
  61. package/lib/{index-C2XeCqtq.js → index-E9T-y2Yz.js} +3 -3
  62. package/lib/{index-Buoc0ISP.js → index-FlmXAW0Z.js} +60 -58
  63. package/lib/index-NqqOvc6V.js +169 -0
  64. package/lib/{index-BkdiXCRY.js → index-ObKRNOmJ.js} +6 -7
  65. package/lib/index-bOWjoplU.js +448 -0
  66. package/lib/{index-CXQ258ID.js → index-buU8mDzi.js} +15 -16
  67. package/lib/{index-tbhuYbb0.js → index-mGKAWDJZ.js} +11 -12
  68. package/lib/index.es.js +4 -4
  69. package/lib/index.umd.js +46 -40
  70. package/lib/{layer-setting-panel-VvDSQ-cn.js → layer-setting-panel-BGPj32nP.js} +2 -2
  71. package/lib/{line-show-Bp4G-LqO.js → line-show-DUn1bu_P.js} +1 -1
  72. package/lib/{multi-layout-config-drSy7ezf.js → multi-layout-config-BTWxJeuc.js} +7 -8
  73. package/lib/{multiline-text-D89kYrA2.js → multiline-text-CPJdCWJ7.js} +1 -1
  74. package/lib/{navigation-YAGxZ0OT.js → navigation-ZLJaBOUj.js} +1 -1
  75. package/lib/page-config-CHP07Ndf.js +253 -0
  76. package/lib/{page-tabs-wFeNBY4c.js → page-tabs-CKLhgrip.js} +45 -41
  77. package/lib/{plus-3mdO6yXY.js → plus-xgpQU22I.js} +1 -1
  78. package/lib/raf-CJog_tcv.js +6 -0
  79. package/lib/refs-DZMysoBI.js +8 -0
  80. package/lib/{requestOld-DRcjsmRQ.js → requestOld-CaGzCXrV.js} +97 -96
  81. package/lib/{schema-BsnIOGBI.js → schema-BaFWGeFt.js} +1 -1
  82. package/lib/{schema-_APJMUW3.js → schema-CUR-UK2S.js} +44 -41
  83. package/lib/{schema-BavJE-SK.js → schema-WUk7XVq7.js} +58 -54
  84. package/lib/{schema-qKI1F8Bt.js → schema-geZfujv8.js} +1 -1
  85. package/lib/{schema-BflqDw-a.js → schema-iosjRxCC.js} +1 -1
  86. package/lib/{schema-Bo30dbBx.js → schema-tuPllxn6.js} +1 -1
  87. package/lib/scroll-CWfl60Tu.js +58 -0
  88. package/lib/{setting-panel-BgzN3BUP.js → setting-panel-0qLcwYyT.js} +154 -151
  89. package/lib/{show-C4AeWlKj.js → show-BCwE3hGY.js} +1 -1
  90. package/lib/{stepper-D5EFeJWG.js → stepper-Bud1Jppr.js} +1 -1
  91. package/lib/strings-BvUQWzDM.js +6 -0
  92. package/lib/{switch-B0dR4LM_.js → switch-VlaUmSpJ.js} +1 -1
  93. package/lib/{unlock-Cq9PLhBA.js → unlock-B2FVPQlm.js} +1 -1
  94. package/lib/{use-env-url-BM9dgwx_.js → use-env-url-D1p8ib2L.js} +1 -1
  95. package/lib/use-global-config-D_yoqf3Q.js +90 -0
  96. package/lib/validator-BOXH2OMA.js +5 -0
  97. package/lib/{vnode-B_Dj8zxu.js → vnode-Bxs1g06p.js} +1 -1
  98. package/package.json +1 -1
  99. package/lib/atlas-DsmLq2V0.js +0 -38
  100. package/lib/el-overlay-BK0_UIU6.js +0 -704
  101. package/lib/index-B1yAU2Cb.js +0 -390
  102. package/lib/index-BCFXuK7k.js +0 -68
  103. package/lib/index-BD4Jwo8Z.js +0 -449
  104. package/lib/index-BMWqf88L.js +0 -356
  105. package/lib/index-Belsn8kt.js +0 -107
  106. package/lib/index-CIADz1i0.js +0 -8494
  107. package/lib/index-DKTrbqcA.js +0 -56
  108. package/lib/index-Ge_d2xqD.js +0 -127
  109. package/lib/page-config-Cmsi8Vpr.js +0 -582
  110. package/lib/strings-_mHAdgA4.js +0 -6
  111. package/lib/use-global-config-CflpFoxU.js +0 -115
@@ -0,0 +1,1027 @@
1
+ import { defineComponent as K, computed as P, createElementBlock as S, openBlock as v, normalizeClass as p, unref as s, createCommentVNode as b, createElementVNode as N, normalizeStyle as j, renderSlot as F, toDisplayString as W, createBlock as _, withCtx as L, resolveDynamicComponent as Re, ref as pe, TransitionGroup as Te, Fragment as Fe, renderList as Le, withKeys as fe, withModifiers as q, createVNode as O, inject as Ue, shallowRef as Q, watch as ee, nextTick as De, onBeforeUnmount as _e, provide as Be, toRef as Oe, createSlots as te, mergeProps as se } from "vue";
2
+ import { e as z, f as m, g as H, h as M, av as Ne, aw as ve, ax as je, ay as me, c as ye, az as ge, V as ae, E as A, w as he, al as x, R as be, aA as ke, aB as R, m as Y, t as Ae, aC as V, aD as Ie, I as qe, aE as Me, ap as oe, aF as ne, $ as ze, aG as Ke, a5 as He } from "./index-B8QqTLfg.js";
3
+ import { e as We } from "./use-global-config-D_yoqf3Q.js";
4
+ const Ve = z({
5
+ type: {
6
+ type: String,
7
+ default: "line",
8
+ values: ["line", "circle", "dashboard"]
9
+ },
10
+ percentage: {
11
+ type: Number,
12
+ default: 0,
13
+ validator: (r) => r >= 0 && r <= 100
14
+ },
15
+ status: {
16
+ type: String,
17
+ default: "",
18
+ values: ["", "success", "exception", "warning"]
19
+ },
20
+ indeterminate: Boolean,
21
+ duration: {
22
+ type: Number,
23
+ default: 3
24
+ },
25
+ strokeWidth: {
26
+ type: Number,
27
+ default: 6
28
+ },
29
+ strokeLinecap: {
30
+ type: m(String),
31
+ default: "round"
32
+ },
33
+ textInside: Boolean,
34
+ width: {
35
+ type: Number,
36
+ default: 126
37
+ },
38
+ showText: {
39
+ type: Boolean,
40
+ default: !0
41
+ },
42
+ color: {
43
+ type: m([
44
+ String,
45
+ Array,
46
+ Function
47
+ ]),
48
+ default: ""
49
+ },
50
+ striped: Boolean,
51
+ stripedFlow: Boolean,
52
+ format: {
53
+ type: m(Function),
54
+ default: (r) => `${r}%`
55
+ }
56
+ }), Xe = ["aria-valuenow"], Ge = { viewBox: "0 0 100 100" }, Je = ["d", "stroke", "stroke-linecap", "stroke-width"], Qe = ["d", "stroke", "opacity", "stroke-linecap", "stroke-width"], Ye = { key: 0 }, Ze = K({
57
+ name: "ElProgress",
58
+ __name: "progress",
59
+ props: Ve,
60
+ setup(r) {
61
+ const d = {
62
+ success: "#13ce66",
63
+ exception: "#ff4949",
64
+ warning: "#e6a23c",
65
+ default: "#20a0ff"
66
+ }, t = r, i = M("progress"), y = P(() => {
67
+ const n = {
68
+ width: `${t.percentage}%`,
69
+ animationDuration: `${t.duration}s`
70
+ }, h = E(t.percentage);
71
+ return h.includes("gradient") ? n.background = h : n.backgroundColor = h, n;
72
+ }), u = P(
73
+ () => (t.strokeWidth / t.width * 100).toFixed(1)
74
+ ), c = P(() => ["circle", "dashboard"].includes(t.type) ? Number.parseInt(
75
+ `${50 - Number.parseFloat(u.value) / 2}`,
76
+ 10
77
+ ) : 0), T = P(() => {
78
+ const n = c.value, h = t.type === "dashboard";
79
+ return `
80
+ M 50 50
81
+ m 0 ${h ? "" : "-"}${n}
82
+ a ${n} ${n} 0 1 1 0 ${h ? "-" : ""}${n * 2}
83
+ a ${n} ${n} 0 1 1 0 ${h ? "" : "-"}${n * 2}
84
+ `;
85
+ }), g = P(() => 2 * Math.PI * c.value), w = P(() => t.type === "dashboard" ? 0.75 : 1), k = P(() => `${-1 * g.value * (1 - w.value) / 2}px`), $ = P(() => ({
86
+ strokeDasharray: `${g.value * w.value}px, ${g.value}px`,
87
+ strokeDashoffset: k.value
88
+ })), f = P(() => ({
89
+ strokeDasharray: `${g.value * w.value * (t.percentage / 100)}px, ${g.value}px`,
90
+ strokeDashoffset: k.value,
91
+ transition: "stroke-dasharray 0.6s ease 0s, stroke 0.6s ease, opacity ease 0.6s"
92
+ })), C = P(() => {
93
+ let n;
94
+ return t.color ? n = E(t.percentage) : n = d[t.status] || d.default, n;
95
+ }), o = P(() => t.status === "warning" ? Ne : t.type === "line" ? t.status === "success" ? ve : je : t.status === "success" ? me : ye), e = P(() => t.type === "line" ? 12 + t.strokeWidth * 0.4 : t.width * 0.111111 + 2), a = P(() => t.format(t.percentage));
96
+ function l(n) {
97
+ const h = 100 / n.length;
98
+ return n.map((U, D) => ae(U) ? {
99
+ color: U,
100
+ percentage: (D + 1) * h
101
+ } : U).sort((U, D) => U.percentage - D.percentage);
102
+ }
103
+ const E = (n) => {
104
+ var h;
105
+ const { color: B } = t;
106
+ if (ge(B))
107
+ return B(n);
108
+ if (ae(B))
109
+ return B;
110
+ {
111
+ const U = l(B);
112
+ for (const D of U)
113
+ if (D.percentage > n)
114
+ return D.color;
115
+ return (h = U[U.length - 1]) == null ? void 0 : h.color;
116
+ }
117
+ };
118
+ return (n, h) => (v(), S("div", {
119
+ class: p([
120
+ s(i).b(),
121
+ s(i).m(n.type),
122
+ s(i).is(n.status),
123
+ {
124
+ [s(i).m("without-text")]: !n.showText,
125
+ [s(i).m("text-inside")]: n.textInside
126
+ }
127
+ ]),
128
+ role: "progressbar",
129
+ "aria-valuenow": n.percentage,
130
+ "aria-valuemin": "0",
131
+ "aria-valuemax": "100"
132
+ }, [
133
+ n.type === "line" ? (v(), S(
134
+ "div",
135
+ {
136
+ key: 0,
137
+ class: p(s(i).b("bar"))
138
+ },
139
+ [
140
+ N(
141
+ "div",
142
+ {
143
+ class: p(s(i).be("bar", "outer")),
144
+ style: j({ height: `${n.strokeWidth}px` })
145
+ },
146
+ [
147
+ N(
148
+ "div",
149
+ {
150
+ class: p([
151
+ s(i).be("bar", "inner"),
152
+ { [s(i).bem("bar", "inner", "indeterminate")]: n.indeterminate },
153
+ { [s(i).bem("bar", "inner", "striped")]: n.striped },
154
+ { [s(i).bem("bar", "inner", "striped-flow")]: n.stripedFlow }
155
+ ]),
156
+ style: j(y.value)
157
+ },
158
+ [
159
+ (n.showText || n.$slots.default) && n.textInside ? (v(), S(
160
+ "div",
161
+ {
162
+ key: 0,
163
+ class: p(s(i).be("bar", "innerText"))
164
+ },
165
+ [
166
+ F(n.$slots, "default", { percentage: n.percentage }, () => [
167
+ N(
168
+ "span",
169
+ null,
170
+ W(a.value),
171
+ 1
172
+ )
173
+ ])
174
+ ],
175
+ 2
176
+ )) : b("v-if", !0)
177
+ ],
178
+ 6
179
+ )
180
+ ],
181
+ 6
182
+ )
183
+ ],
184
+ 2
185
+ )) : (v(), S(
186
+ "div",
187
+ {
188
+ key: 1,
189
+ class: p(s(i).b("circle")),
190
+ style: j({ height: `${n.width}px`, width: `${n.width}px` })
191
+ },
192
+ [
193
+ (v(), S("svg", Ge, [
194
+ N("path", {
195
+ class: p(s(i).be("circle", "track")),
196
+ d: T.value,
197
+ stroke: `var(${s(i).cssVarName("fill-color-light")}, #e5e9f2)`,
198
+ "stroke-linecap": n.strokeLinecap,
199
+ "stroke-width": u.value,
200
+ fill: "none",
201
+ style: j($.value)
202
+ }, null, 14, Je),
203
+ N("path", {
204
+ class: p(s(i).be("circle", "path")),
205
+ d: T.value,
206
+ stroke: C.value,
207
+ fill: "none",
208
+ opacity: n.percentage ? 1 : 0,
209
+ "stroke-linecap": n.strokeLinecap,
210
+ "stroke-width": u.value,
211
+ style: j(f.value)
212
+ }, null, 14, Qe)
213
+ ]))
214
+ ],
215
+ 6
216
+ )),
217
+ (n.showText || n.$slots.default) && !n.textInside ? (v(), S(
218
+ "div",
219
+ {
220
+ key: 2,
221
+ class: p(s(i).e("text")),
222
+ style: j({ fontSize: `${e.value}px` })
223
+ },
224
+ [
225
+ F(n.$slots, "default", { percentage: n.percentage }, () => [
226
+ n.status ? (v(), _(s(A), { key: 1 }, {
227
+ default: L(() => [
228
+ (v(), _(Re(o.value)))
229
+ ]),
230
+ _: 1
231
+ })) : (v(), S(
232
+ "span",
233
+ Ye,
234
+ W(a.value),
235
+ 1
236
+ ))
237
+ ])
238
+ ],
239
+ 6
240
+ )) : b("v-if", !0)
241
+ ], 10, Xe));
242
+ }
243
+ });
244
+ var xe = /* @__PURE__ */ H(Ze, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/progress/src/progress.vue"]]);
245
+ const et = he(xe), $e = Symbol("uploadContextKey"), tt = "ElUpload";
246
+ class st extends Error {
247
+ constructor(d, t, i, y) {
248
+ super(d), this.name = "UploadAjaxError", this.status = t, this.method = i, this.url = y;
249
+ }
250
+ }
251
+ function re(r, d, t) {
252
+ let i;
253
+ return t.response ? i = `${t.response.error || t.response}` : t.responseText ? i = `${t.responseText}` : i = `fail to ${d.method} ${r} ${t.status}`, new st(i, t.status, d.method, r);
254
+ }
255
+ function at(r) {
256
+ const d = r.responseText || r.response;
257
+ if (!d)
258
+ return d;
259
+ try {
260
+ return JSON.parse(d);
261
+ } catch {
262
+ return d;
263
+ }
264
+ }
265
+ const ot = (r) => {
266
+ typeof XMLHttpRequest > "u" && x(tt, "XMLHttpRequest is undefined");
267
+ const d = new XMLHttpRequest(), t = r.action;
268
+ d.upload && d.upload.addEventListener("progress", (u) => {
269
+ const c = u;
270
+ c.percent = u.total > 0 ? u.loaded / u.total * 100 : 0, r.onProgress(c);
271
+ });
272
+ const i = new FormData();
273
+ if (r.data)
274
+ for (const [u, c] of Object.entries(r.data))
275
+ be(c) && c.length ? i.append(u, ...c) : i.append(u, c);
276
+ i.append(r.filename, r.file, r.file.name), d.addEventListener("error", () => {
277
+ r.onError(re(t, r, d));
278
+ }), d.addEventListener("load", () => {
279
+ if (d.status < 200 || d.status >= 300)
280
+ return r.onError(re(t, r, d));
281
+ r.onSuccess(at(d));
282
+ }), d.open(r.method, t, !0), r.withCredentials && "withCredentials" in d && (d.withCredentials = !0);
283
+ const y = r.headers || {};
284
+ if (y instanceof Headers)
285
+ y.forEach((u, c) => d.setRequestHeader(c, u));
286
+ else
287
+ for (const [u, c] of Object.entries(y))
288
+ ke(c) || d.setRequestHeader(u, String(c));
289
+ return d.send(i), d;
290
+ }, we = ["text", "picture", "picture-card"];
291
+ let nt = 1;
292
+ const Z = () => Date.now() + nt++, Ee = z({
293
+ action: {
294
+ type: String,
295
+ default: "#"
296
+ },
297
+ headers: {
298
+ type: m(Object)
299
+ },
300
+ method: {
301
+ type: String,
302
+ default: "post"
303
+ },
304
+ data: {
305
+ type: m([Object, Function, Promise]),
306
+ default: () => Y({})
307
+ },
308
+ multiple: Boolean,
309
+ name: {
310
+ type: String,
311
+ default: "file"
312
+ },
313
+ drag: Boolean,
314
+ withCredentials: Boolean,
315
+ showFileList: {
316
+ type: Boolean,
317
+ default: !0
318
+ },
319
+ accept: {
320
+ type: String,
321
+ default: ""
322
+ },
323
+ fileList: {
324
+ type: m(Array),
325
+ default: () => Y([])
326
+ },
327
+ autoUpload: {
328
+ type: Boolean,
329
+ default: !0
330
+ },
331
+ listType: {
332
+ type: String,
333
+ values: we,
334
+ default: "text"
335
+ },
336
+ httpRequest: {
337
+ type: m(Function),
338
+ default: ot
339
+ },
340
+ disabled: {
341
+ type: Boolean,
342
+ default: void 0
343
+ },
344
+ limit: Number
345
+ }), rt = z({
346
+ ...Ee,
347
+ beforeUpload: {
348
+ type: m(Function),
349
+ default: R
350
+ },
351
+ beforeRemove: {
352
+ type: m(Function)
353
+ },
354
+ onRemove: {
355
+ type: m(Function),
356
+ default: R
357
+ },
358
+ onChange: {
359
+ type: m(Function),
360
+ default: R
361
+ },
362
+ onPreview: {
363
+ type: m(Function),
364
+ default: R
365
+ },
366
+ onSuccess: {
367
+ type: m(Function),
368
+ default: R
369
+ },
370
+ onProgress: {
371
+ type: m(Function),
372
+ default: R
373
+ },
374
+ onError: {
375
+ type: m(Function),
376
+ default: R
377
+ },
378
+ onExceed: {
379
+ type: m(Function),
380
+ default: R
381
+ },
382
+ crossorigin: {
383
+ type: m(String)
384
+ }
385
+ }), lt = z({
386
+ files: {
387
+ type: m(Array),
388
+ default: () => Y([])
389
+ },
390
+ disabled: {
391
+ type: Boolean,
392
+ default: void 0
393
+ },
394
+ handlePreview: {
395
+ type: m(Function),
396
+ default: R
397
+ },
398
+ listType: {
399
+ type: String,
400
+ values: we,
401
+ default: "text"
402
+ },
403
+ crossorigin: {
404
+ type: m(String)
405
+ }
406
+ }), it = {
407
+ remove: (r) => !!r
408
+ }, ut = ["tabindex", "aria-disabled", "onKeydown"], dt = ["src", "crossorigin"], ct = ["onClick"], pt = ["title"], ft = ["onClick"], vt = ["onClick"], mt = K({
409
+ name: "ElUploadList",
410
+ __name: "upload-list",
411
+ props: lt,
412
+ emits: it,
413
+ setup(r, { emit: d }) {
414
+ const t = r, i = d, { t: y } = Ae(), u = M("upload"), c = M("icon"), T = M("list"), g = V(), w = pe(!1), k = P(() => [
415
+ u.b("list"),
416
+ u.bm("list", t.listType),
417
+ u.is("disabled", g.value)
418
+ ]), $ = (f) => {
419
+ i("remove", f);
420
+ };
421
+ return (f, C) => (v(), _(Te, {
422
+ tag: "ul",
423
+ class: p(k.value),
424
+ name: s(T).b()
425
+ }, {
426
+ default: L(() => [
427
+ (v(!0), S(
428
+ Fe,
429
+ null,
430
+ Le(f.files, (o, e) => (v(), S("li", {
431
+ key: o.uid || o.name,
432
+ class: p([
433
+ s(u).be("list", "item"),
434
+ s(u).is(o.status),
435
+ { focusing: w.value }
436
+ ]),
437
+ tabindex: s(g) ? void 0 : 0,
438
+ "aria-disabled": s(g),
439
+ role: "button",
440
+ onKeydown: fe((a) => !s(g) && $(o), ["delete"]),
441
+ onFocus: C[0] || (C[0] = (a) => w.value = !0),
442
+ onBlur: C[1] || (C[1] = (a) => w.value = !1),
443
+ onClick: C[2] || (C[2] = (a) => w.value = !1)
444
+ }, [
445
+ F(f.$slots, "default", {
446
+ file: o,
447
+ index: e
448
+ }, () => [
449
+ f.listType === "picture" || o.status !== "uploading" && f.listType === "picture-card" ? (v(), S("img", {
450
+ key: 0,
451
+ class: p(s(u).be("list", "item-thumbnail")),
452
+ src: o.url,
453
+ crossorigin: f.crossorigin,
454
+ alt: ""
455
+ }, null, 10, dt)) : b("v-if", !0),
456
+ o.status === "uploading" || f.listType !== "picture-card" ? (v(), S(
457
+ "div",
458
+ {
459
+ key: 1,
460
+ class: p(s(u).be("list", "item-info"))
461
+ },
462
+ [
463
+ N("a", {
464
+ class: p(s(u).be("list", "item-name")),
465
+ onClick: q((a) => f.handlePreview(o), ["prevent"])
466
+ }, [
467
+ O(s(A), {
468
+ class: p(s(c).m("document"))
469
+ }, {
470
+ default: L(() => [
471
+ O(s(Ie))
472
+ ]),
473
+ _: 1
474
+ }, 8, ["class"]),
475
+ N("span", {
476
+ class: p(s(u).be("list", "item-file-name")),
477
+ title: o.name
478
+ }, W(o.name), 11, pt)
479
+ ], 10, ct),
480
+ o.status === "uploading" ? (v(), _(s(et), {
481
+ key: 0,
482
+ type: f.listType === "picture-card" ? "circle" : "line",
483
+ "stroke-width": f.listType === "picture-card" ? 6 : 2,
484
+ percentage: Number(o.percentage),
485
+ style: j(f.listType === "picture-card" ? "" : "margin-top: 0.5rem")
486
+ }, null, 8, ["type", "stroke-width", "percentage", "style"])) : b("v-if", !0)
487
+ ],
488
+ 2
489
+ )) : b("v-if", !0),
490
+ N(
491
+ "label",
492
+ {
493
+ class: p(s(u).be("list", "item-status-label"))
494
+ },
495
+ [
496
+ f.listType === "text" ? (v(), _(s(A), {
497
+ key: 0,
498
+ class: p([s(c).m("upload-success"), s(c).m("circle-check")])
499
+ }, {
500
+ default: L(() => [
501
+ O(s(ve))
502
+ ]),
503
+ _: 1
504
+ }, 8, ["class"])) : ["picture-card", "picture"].includes(f.listType) ? (v(), _(s(A), {
505
+ key: 1,
506
+ class: p([s(c).m("upload-success"), s(c).m("check")])
507
+ }, {
508
+ default: L(() => [
509
+ O(s(me))
510
+ ]),
511
+ _: 1
512
+ }, 8, ["class"])) : b("v-if", !0)
513
+ ],
514
+ 2
515
+ ),
516
+ s(g) ? b("v-if", !0) : (v(), _(s(A), {
517
+ key: 2,
518
+ class: p(s(c).m("close")),
519
+ onClick: (a) => $(o)
520
+ }, {
521
+ default: L(() => [
522
+ O(s(ye))
523
+ ]),
524
+ _: 1
525
+ }, 8, ["class", "onClick"])),
526
+ b(" Due to close btn only appears when li gets focused disappears after li gets blurred, thus keyboard navigation can never reach close btn"),
527
+ b(" This is a bug which needs to be fixed "),
528
+ b(" TODO: Fix the incorrect navigation interaction "),
529
+ s(g) ? b("v-if", !0) : (v(), S(
530
+ "i",
531
+ {
532
+ key: 3,
533
+ class: p(s(c).m("close-tip"))
534
+ },
535
+ W(s(y)("el.upload.deleteTip")),
536
+ 3
537
+ )),
538
+ f.listType === "picture-card" ? (v(), S(
539
+ "span",
540
+ {
541
+ key: 4,
542
+ class: p(s(u).be("list", "item-actions"))
543
+ },
544
+ [
545
+ N("span", {
546
+ class: p(s(u).be("list", "item-preview")),
547
+ onClick: (a) => f.handlePreview(o)
548
+ }, [
549
+ O(s(A), {
550
+ class: p(s(c).m("zoom-in"))
551
+ }, {
552
+ default: L(() => [
553
+ O(s(qe))
554
+ ]),
555
+ _: 1
556
+ }, 8, ["class"])
557
+ ], 10, ft),
558
+ s(g) ? b("v-if", !0) : (v(), S("span", {
559
+ key: 0,
560
+ class: p(s(u).be("list", "item-delete")),
561
+ onClick: (a) => $(o)
562
+ }, [
563
+ O(s(A), {
564
+ class: p(s(c).m("delete"))
565
+ }, {
566
+ default: L(() => [
567
+ O(s(Me))
568
+ ]),
569
+ _: 1
570
+ }, 8, ["class"])
571
+ ], 10, vt))
572
+ ],
573
+ 2
574
+ )) : b("v-if", !0)
575
+ ])
576
+ ], 42, ut))),
577
+ 128
578
+ )),
579
+ F(f.$slots, "append")
580
+ ]),
581
+ _: 3
582
+ }, 8, ["class", "name"]));
583
+ }
584
+ });
585
+ var le = /* @__PURE__ */ H(mt, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/upload/src/upload-list.vue"]]);
586
+ const yt = z({
587
+ disabled: {
588
+ type: Boolean,
589
+ default: void 0
590
+ }
591
+ }), gt = {
592
+ file: (r) => be(r)
593
+ }, ie = "ElUploadDrag", ht = K({
594
+ name: ie,
595
+ __name: "upload-dragger",
596
+ props: yt,
597
+ emits: gt,
598
+ setup(r, { emit: d }) {
599
+ const t = d;
600
+ Ue($e) || x(
601
+ ie,
602
+ "usage: <el-upload><el-upload-dragger /></el-upload>"
603
+ );
604
+ const y = M("upload"), u = pe(!1), c = V(), T = (k) => {
605
+ if (c.value)
606
+ return;
607
+ u.value = !1, k.stopPropagation();
608
+ const $ = Array.from(k.dataTransfer.files), f = k.dataTransfer.items || [];
609
+ $.forEach((C, o) => {
610
+ var e;
611
+ const a = f[o], l = (e = a?.webkitGetAsEntry) == null ? void 0 : e.call(a);
612
+ l && (C.isDirectory = l.isDirectory);
613
+ }), t("file", $);
614
+ }, g = () => {
615
+ c.value || (u.value = !0);
616
+ }, w = (k) => {
617
+ k.currentTarget.contains(k.relatedTarget) || (u.value = !1);
618
+ };
619
+ return (k, $) => (v(), S(
620
+ "div",
621
+ {
622
+ class: p([s(y).b("dragger"), s(y).is("dragover", u.value)]),
623
+ onDrop: q(T, ["prevent"]),
624
+ onDragover: q(g, ["prevent"]),
625
+ onDragleave: q(w, ["prevent"])
626
+ },
627
+ [
628
+ F(k.$slots, "default")
629
+ ],
630
+ 34
631
+ ));
632
+ }
633
+ });
634
+ var bt = /* @__PURE__ */ H(ht, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/upload/src/upload-dragger.vue"]]);
635
+ const kt = z({
636
+ ...Ee,
637
+ beforeUpload: {
638
+ type: m(Function),
639
+ default: R
640
+ },
641
+ onRemove: {
642
+ type: m(Function),
643
+ default: R
644
+ },
645
+ onStart: {
646
+ type: m(Function),
647
+ default: R
648
+ },
649
+ onSuccess: {
650
+ type: m(
651
+ Function
652
+ ),
653
+ default: R
654
+ },
655
+ onProgress: {
656
+ type: m(Function),
657
+ default: R
658
+ },
659
+ onError: {
660
+ type: m(Function),
661
+ default: R
662
+ },
663
+ onExceed: {
664
+ type: m(Function),
665
+ default: R
666
+ }
667
+ }), $t = ["tabindex", "aria-disabled", "onKeydown"], wt = ["name", "disabled", "multiple", "accept"], Et = K({
668
+ name: "ElUploadContent",
669
+ inheritAttrs: !1,
670
+ __name: "upload-content",
671
+ props: kt,
672
+ setup(r, { expose: d }) {
673
+ const t = r, i = M("upload"), y = V(), u = Q(
674
+ {}
675
+ ), c = Q(), T = (e) => {
676
+ if (e.length === 0)
677
+ return;
678
+ const { autoUpload: a, limit: l, fileList: E, multiple: n, onStart: h, onExceed: B } = t;
679
+ if (l && E.length + e.length > l) {
680
+ B(e, E);
681
+ return;
682
+ }
683
+ n || (e = e.slice(0, 1));
684
+ for (const U of e) {
685
+ const D = U;
686
+ D.uid = Z(), h(D), a && g(D);
687
+ }
688
+ }, g = async (e) => {
689
+ if (c.value.value = "", !t.beforeUpload)
690
+ return k(e);
691
+ let a, l = {};
692
+ try {
693
+ const n = t.data, h = t.beforeUpload(e);
694
+ l = ne(t.data) ? oe(t.data) : t.data, a = await h, ne(t.data) && ze(n, l) && (l = oe(t.data));
695
+ } catch {
696
+ a = !1;
697
+ }
698
+ if (a === !1) {
699
+ t.onRemove(e);
700
+ return;
701
+ }
702
+ let E = e;
703
+ a instanceof Blob && (a instanceof File ? E = a : E = new File([a], e.name, {
704
+ type: e.type
705
+ })), k(
706
+ Object.assign(E, {
707
+ uid: e.uid
708
+ }),
709
+ l
710
+ );
711
+ }, w = async (e, a) => ge(e) ? e(a) : e, k = async (e, a) => {
712
+ const {
713
+ headers: l,
714
+ data: E,
715
+ method: n,
716
+ withCredentials: h,
717
+ name: B,
718
+ action: U,
719
+ onProgress: D,
720
+ onSuccess: Se,
721
+ onError: Ce,
722
+ httpRequest: Pe
723
+ } = t;
724
+ try {
725
+ a = await w(a ?? E, e);
726
+ } catch {
727
+ t.onRemove(e);
728
+ return;
729
+ }
730
+ const { uid: X } = e, G = {
731
+ headers: l || {},
732
+ withCredentials: h,
733
+ file: e,
734
+ data: a,
735
+ method: n,
736
+ filename: B,
737
+ action: U,
738
+ onProgress: (I) => {
739
+ D(I, e);
740
+ },
741
+ onSuccess: (I) => {
742
+ Se(I, e), delete u.value[X];
743
+ },
744
+ onError: (I) => {
745
+ Ce(I, e), delete u.value[X];
746
+ }
747
+ }, J = Pe(G);
748
+ u.value[X] = J, J instanceof Promise && J.then(G.onSuccess, G.onError);
749
+ }, $ = (e) => {
750
+ const a = e.target.files;
751
+ a && T(Array.from(a));
752
+ }, f = () => {
753
+ y.value || (c.value.value = "", c.value.click());
754
+ }, C = () => {
755
+ f();
756
+ };
757
+ return d({
758
+ abort: (e) => {
759
+ We(u.value).filter(
760
+ e ? ([l]) => String(e.uid) === l : () => !0
761
+ ).forEach(([l, E]) => {
762
+ E instanceof XMLHttpRequest && E.abort(), delete u.value[l];
763
+ });
764
+ },
765
+ upload: g
766
+ }), (e, a) => (v(), S("div", {
767
+ class: p([
768
+ s(i).b(),
769
+ s(i).m(e.listType),
770
+ s(i).is("drag", e.drag),
771
+ s(i).is("disabled", s(y))
772
+ ]),
773
+ tabindex: s(y) ? void 0 : 0,
774
+ "aria-disabled": s(y),
775
+ role: "button",
776
+ onClick: f,
777
+ onKeydown: fe(q(C, ["self"]), ["enter", "space"])
778
+ }, [
779
+ e.drag ? (v(), _(bt, {
780
+ key: 0,
781
+ disabled: s(y),
782
+ onFile: T
783
+ }, {
784
+ default: L(() => [
785
+ F(e.$slots, "default")
786
+ ]),
787
+ _: 3
788
+ }, 8, ["disabled"])) : F(e.$slots, "default", { key: 1 }),
789
+ N("input", {
790
+ ref_key: "inputRef",
791
+ ref: c,
792
+ class: p(s(i).e("input")),
793
+ name: e.name,
794
+ disabled: s(y),
795
+ multiple: e.multiple,
796
+ accept: e.accept,
797
+ type: "file",
798
+ onChange: $,
799
+ onClick: a[0] || (a[0] = q(() => {
800
+ }, ["stop"]))
801
+ }, null, 42, wt)
802
+ ], 42, $t));
803
+ }
804
+ });
805
+ var ue = /* @__PURE__ */ H(Et, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/upload/src/upload-content.vue"]]);
806
+ const de = "ElUpload", ce = (r) => {
807
+ var d;
808
+ (d = r.url) != null && d.startsWith("blob:") && URL.revokeObjectURL(r.url);
809
+ }, St = (r, d) => {
810
+ const t = Ke(
811
+ r,
812
+ "fileList",
813
+ void 0,
814
+ { passive: !0 }
815
+ ), i = (o) => t.value.find((e) => e.uid === o.uid);
816
+ function y(o) {
817
+ var e;
818
+ (e = d.value) == null || e.abort(o);
819
+ }
820
+ function u(o = ["ready", "uploading", "success", "fail"]) {
821
+ t.value = t.value.filter(
822
+ (e) => !o.includes(e.status)
823
+ );
824
+ }
825
+ function c(o) {
826
+ t.value = t.value.filter(
827
+ (e) => e.uid !== o.uid
828
+ );
829
+ }
830
+ const T = (o) => {
831
+ De(() => r.onChange(o, t.value));
832
+ }, g = (o, e) => {
833
+ const a = i(e);
834
+ a && (console.error(o), a.status = "fail", c(a), r.onError(o, a, t.value), T(a));
835
+ }, w = (o, e) => {
836
+ const a = i(e);
837
+ a && (r.onProgress(o, a, t.value), a.status = "uploading", a.percentage = Math.round(o.percent));
838
+ }, k = (o, e) => {
839
+ const a = i(e);
840
+ a && (a.status = "success", a.response = o, r.onSuccess(o, a, t.value), T(a));
841
+ }, $ = (o) => {
842
+ ke(o.uid) && (o.uid = Z());
843
+ const e = {
844
+ name: o.name,
845
+ percentage: 0,
846
+ status: "ready",
847
+ size: o.size,
848
+ raw: o,
849
+ uid: o.uid
850
+ };
851
+ if (r.listType === "picture-card" || r.listType === "picture")
852
+ try {
853
+ e.url = URL.createObjectURL(o);
854
+ } catch (a) {
855
+ He(de, a.message), r.onError(a, e, t.value);
856
+ }
857
+ t.value = [...t.value, e], T(e);
858
+ }, f = async (o) => {
859
+ const e = o instanceof File ? i(o) : o;
860
+ e || x(de, "file to be removed not found");
861
+ const a = (l) => {
862
+ y(l), c(l), r.onRemove(l, t.value), ce(l);
863
+ };
864
+ r.beforeRemove ? await r.beforeRemove(e, t.value) !== !1 && a(e) : a(e);
865
+ };
866
+ function C() {
867
+ t.value.filter(({ status: o }) => o === "ready").forEach(({ raw: o }) => {
868
+ var e;
869
+ return o && ((e = d.value) == null ? void 0 : e.upload(o));
870
+ });
871
+ }
872
+ return ee(
873
+ () => r.listType,
874
+ (o) => {
875
+ o !== "picture-card" && o !== "picture" || (t.value = t.value.map((e) => {
876
+ const { raw: a, url: l } = e;
877
+ if (!l && a)
878
+ try {
879
+ e.url = URL.createObjectURL(a);
880
+ } catch (E) {
881
+ r.onError(E, e, t.value);
882
+ }
883
+ return e;
884
+ }));
885
+ }
886
+ ), ee(
887
+ t,
888
+ (o) => {
889
+ for (const e of o)
890
+ e.uid || (e.uid = Z()), e.status || (e.status = "success");
891
+ },
892
+ { immediate: !0, deep: !0 }
893
+ ), {
894
+ uploadFiles: t,
895
+ abort: y,
896
+ clearFiles: u,
897
+ handleError: g,
898
+ handleProgress: w,
899
+ handleStart: $,
900
+ handleSuccess: k,
901
+ handleRemove: f,
902
+ submit: C,
903
+ revokeFileObjectURL: ce
904
+ };
905
+ }, Ct = K({
906
+ name: "ElUpload",
907
+ __name: "upload",
908
+ props: rt,
909
+ setup(r, { expose: d }) {
910
+ const t = r, i = V(), y = Q(), {
911
+ abort: u,
912
+ submit: c,
913
+ clearFiles: T,
914
+ uploadFiles: g,
915
+ handleStart: w,
916
+ handleError: k,
917
+ handleRemove: $,
918
+ handleSuccess: f,
919
+ handleProgress: C,
920
+ revokeFileObjectURL: o
921
+ } = St(t, y), e = P(() => t.listType === "picture-card"), a = P(() => ({
922
+ ...t,
923
+ fileList: g.value,
924
+ onStart: w,
925
+ onProgress: C,
926
+ onSuccess: f,
927
+ onError: k,
928
+ onRemove: $
929
+ }));
930
+ return _e(() => {
931
+ g.value.forEach(o);
932
+ }), Be($e, {
933
+ accept: Oe(t, "accept")
934
+ }), d({
935
+ abort: u,
936
+ submit: c,
937
+ clearFiles: T,
938
+ handleStart: w,
939
+ handleRemove: $
940
+ }), (l, E) => (v(), S("div", null, [
941
+ e.value && l.showFileList ? (v(), _(le, {
942
+ key: 0,
943
+ disabled: s(i),
944
+ "list-type": l.listType,
945
+ files: s(g),
946
+ crossorigin: l.crossorigin,
947
+ "handle-preview": l.onPreview,
948
+ onRemove: s($)
949
+ }, te({
950
+ append: L(() => [
951
+ O(
952
+ ue,
953
+ se({
954
+ ref_key: "uploadRef",
955
+ ref: y
956
+ }, a.value),
957
+ {
958
+ default: L(() => [
959
+ l.$slots.trigger ? F(l.$slots, "trigger", { key: 0 }) : b("v-if", !0),
960
+ !l.$slots.trigger && l.$slots.default ? F(l.$slots, "default", { key: 1 }) : b("v-if", !0)
961
+ ]),
962
+ _: 3
963
+ },
964
+ 16
965
+ )
966
+ ]),
967
+ _: 2
968
+ }, [
969
+ l.$slots.file ? {
970
+ name: "default",
971
+ fn: L(({ file: n, index: h }) => [
972
+ F(l.$slots, "file", {
973
+ file: n,
974
+ index: h
975
+ })
976
+ ]),
977
+ key: "0"
978
+ } : void 0
979
+ ]), 1032, ["disabled", "list-type", "files", "crossorigin", "handle-preview", "onRemove"])) : b("v-if", !0),
980
+ !e.value || e.value && !l.showFileList ? (v(), _(
981
+ ue,
982
+ se({
983
+ key: 1,
984
+ ref_key: "uploadRef",
985
+ ref: y
986
+ }, a.value),
987
+ {
988
+ default: L(() => [
989
+ l.$slots.trigger ? F(l.$slots, "trigger", { key: 0 }) : b("v-if", !0),
990
+ !l.$slots.trigger && l.$slots.default ? F(l.$slots, "default", { key: 1 }) : b("v-if", !0)
991
+ ]),
992
+ _: 3
993
+ },
994
+ 16
995
+ )) : b("v-if", !0),
996
+ l.$slots.trigger ? F(l.$slots, "default", { key: 2 }) : b("v-if", !0),
997
+ F(l.$slots, "tip"),
998
+ !e.value && l.showFileList ? (v(), _(le, {
999
+ key: 3,
1000
+ disabled: s(i),
1001
+ "list-type": l.listType,
1002
+ files: s(g),
1003
+ crossorigin: l.crossorigin,
1004
+ "handle-preview": l.onPreview,
1005
+ onRemove: s($)
1006
+ }, te({
1007
+ _: 2
1008
+ }, [
1009
+ l.$slots.file ? {
1010
+ name: "default",
1011
+ fn: L(({ file: n, index: h }) => [
1012
+ F(l.$slots, "file", {
1013
+ file: n,
1014
+ index: h
1015
+ })
1016
+ ]),
1017
+ key: "0"
1018
+ } : void 0
1019
+ ]), 1032, ["disabled", "list-type", "files", "crossorigin", "handle-preview", "onRemove"])) : b("v-if", !0)
1020
+ ]));
1021
+ }
1022
+ });
1023
+ var Pt = /* @__PURE__ */ H(Ct, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/upload/src/upload.vue"]]);
1024
+ const Lt = he(Pt);
1025
+ export {
1026
+ Lt as E
1027
+ };