@wfrog/vc-ui 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/es/chunk/{OEa4tYPF.mjs → -ga82G_B.mjs} +1 -1
- package/dist/es/chunk/B1BnPYNG.mjs +163 -0
- package/dist/es/chunk/{DFOLES4O.mjs → BA2yoAwy.mjs} +403 -502
- package/dist/es/chunk/{BpqBBo4z.mjs → BDyXj_90.mjs} +2 -2
- package/dist/es/chunk/{BI0vrXwX.mjs → BI-fNJhk.mjs} +6 -3
- package/dist/es/chunk/{BsGCX4td.mjs → BK4T_2ha.mjs} +1 -1
- package/dist/es/chunk/{73YgKz3H.mjs → BLLKi_0v.mjs} +1 -1
- package/dist/es/chunk/{DTLPXrjb.mjs → BTsEMnf_.mjs} +1 -1
- package/dist/es/chunk/{B5UQmWXg.mjs → BUf50Y7Y.mjs} +41 -21
- package/dist/es/chunk/{BzedaLtg.mjs → BYVaz5Or.mjs} +2 -2
- package/dist/es/chunk/BaJ7k5Lg.mjs +209 -0
- package/dist/es/chunk/{Bp9jXKX0.mjs → BambM7zX.mjs} +2 -2
- package/dist/es/chunk/{CizMbf5K.mjs → Bl0WQiki.mjs} +1 -1
- package/dist/es/chunk/{CLbj8G-F.mjs → Bnot0Gwc.mjs} +12 -4
- package/dist/es/chunk/{4eyJqDa9.mjs → BoGGHTrJ.mjs} +4 -2
- package/dist/es/chunk/C7Dgjpd1.mjs +242 -0
- package/dist/es/chunk/{D0LB3gF-.mjs → CKbkzlkO.mjs} +104 -72
- package/dist/es/chunk/{DrgvuOYH.mjs → CL5WTCB3.mjs} +4 -2
- package/dist/es/chunk/{XwSiBVsA.mjs → CM_I1FoA.mjs} +2 -2
- package/dist/es/chunk/{DouIsSPi.mjs → CNILa-hz.mjs} +1 -1
- package/dist/es/chunk/{DRoyW749.mjs → CcKUdl3e.mjs} +12 -6
- package/dist/es/chunk/CidLkmft.mjs +188 -0
- package/dist/es/chunk/{HAog8AWU.mjs → CitH0taR.mjs} +816 -539
- package/dist/es/chunk/{Cu6erWl4.mjs → CzqeSQn4.mjs} +73 -38
- package/dist/es/chunk/{CLCfXfvv.mjs → D7JQbDFE.mjs} +154 -118
- package/dist/es/chunk/{DaCDeO95.mjs → D9iEroQw.mjs} +1 -207
- package/dist/es/chunk/{cPBw23yt.mjs → DEPZhJ0Z.mjs} +21 -16
- package/dist/es/chunk/{CPERtDRX.mjs → DHpbQMGk.mjs} +32 -22
- package/dist/es/chunk/{BHsNc7jl.mjs → DKpRXDRE.mjs} +82 -55
- package/dist/es/chunk/{CLMc8GzD.mjs → DMYHOxhk.mjs} +462 -311
- package/dist/es/chunk/{CBSopeeE.mjs → DQHGjqG5.mjs} +9 -4
- package/dist/es/chunk/DTEM_vYZ.mjs +23 -0
- package/dist/es/chunk/{NQBKROII.mjs → DWcIzeMM.mjs} +1 -1
- package/dist/es/chunk/{FHvLvzEB.mjs → DX38FfmL.mjs} +1088 -697
- package/dist/es/chunk/{DZD-YnCt.mjs → Dcm-lOj8.mjs} +4 -4
- package/dist/es/chunk/{09Ec85_u.mjs → DdmNdV7I.mjs} +398 -278
- package/dist/es/chunk/{f0-vIQGp.mjs → DfHTA5LW.mjs} +3 -3
- package/dist/es/chunk/DgFT6snA.mjs +835 -0
- package/dist/es/chunk/{DwKWIlzw.mjs → DgSzI6Fw.mjs} +106 -71
- package/dist/es/chunk/{BcTuAX8r.mjs → Dsye5ZEp.mjs} +5 -3
- package/dist/es/chunk/{BsLJxiSC.mjs → Dw-yyl2m.mjs} +1 -1
- package/dist/es/chunk/{DXPWe_a5.mjs → U13Qpiki.mjs} +19 -13
- package/dist/es/chunk/{axpwSky6.mjs → _8u_XVHh.mjs} +168 -120
- package/dist/es/chunk/egk9EEzo.mjs +66 -0
- package/dist/es/chunk/{BUEEWLrd.mjs → ezK_XQQd.mjs} +15 -6
- package/dist/es/chunk/{Bl2KlMdP.mjs → oW98L-44.mjs} +8 -3
- package/dist/es/chunk/{Dk6Bx0KT.mjs → plK2vnjp.mjs} +8 -5
- package/dist/es/components/awesome-icon/awesome-icon.mjs +2 -1
- package/dist/es/components/backbottom/backbottom.mjs +2 -2
- package/dist/es/components/button/button.mjs +105 -76
- package/dist/es/components/choice/choice.mjs +2 -2
- package/dist/es/components/config-provider/config-provider.d.ts +1 -0
- package/dist/es/components/config-provider/config-provider.mjs +13 -5
- package/dist/es/components/cropper/cropper.mjs +44 -33
- package/dist/es/components/currency/currency.mjs +5 -5
- package/dist/es/components/daterange-picker/daterange-picker.mjs +2267 -1522
- package/dist/es/components/dialog/dialog.mjs +213 -172
- package/dist/es/components/dialog/index.css +1 -1
- package/dist/es/components/dialog-camera-upload/dialog-camera-upload.mjs +11 -11
- package/dist/es/components/dialog-map-point/dialog-map-point.mjs +5 -4
- package/dist/es/components/dialog-upload-images/dialog-upload-images.mjs +495 -314
- package/dist/es/components/dialog-upload-images/index.css +1 -1
- package/dist/es/components/drag-verify/drag-verify.mjs +3 -3
- package/dist/es/components/drawer/drawer.mjs +136 -94
- package/dist/es/components/drawer/index.css +1 -1
- package/dist/es/components/easy-pagination/easy-pagination.mjs +2 -2
- package/dist/es/components/el-icon/el-icon.mjs +1 -1
- package/dist/es/components/el-icon/index.css +3 -2
- package/dist/es/components/flag/flag.mjs +2 -1
- package/dist/es/components/icon/icon.mjs +10 -31
- package/dist/es/components/icon/icon.vue.d.ts +1 -1
- package/dist/es/components/icon/icon2.mjs +1 -1
- package/dist/es/components/icon/index.mjs +2 -2
- package/dist/es/components/icon-picker/components/collections.vue.d.ts +625 -0
- package/dist/es/components/icon-picker/components/panel.vue.d.ts +9 -0
- package/dist/es/components/icon-picker/icon-picker.d.ts +40 -0
- package/dist/es/components/icon-picker/icon-picker.mjs +1375 -0
- package/dist/es/components/icon-picker/icon-picker.vue.d.ts +9 -0
- package/dist/es/components/icon-picker/index.css +121 -0
- package/dist/es/components/icon-picker/index.d.ts +4 -0
- package/dist/es/components/icon-picker/index.mjs +6 -0
- package/dist/es/components/iconify-icon/iconify-icon.d.ts +5 -0
- package/dist/es/components/iconify-icon/iconify-icon.mjs +1860 -0
- package/dist/es/components/iconify-icon/iconify-icon.vue.d.ts +6 -0
- package/dist/es/components/iconify-icon/index.css +11 -0
- package/dist/es/components/iconify-icon/index.d.ts +4 -0
- package/dist/es/components/iconify-icon/index.mjs +6 -0
- package/dist/es/components/image/image.mjs +5 -5
- package/dist/es/components/input/input.mjs +4 -4
- package/dist/es/components/input/input.vue.d.ts +63 -54
- package/dist/es/components/input-number/input-number.mjs +5 -5
- package/dist/es/components/pca-picker/components/c.vue.d.ts +4 -4
- package/dist/es/components/pca-picker/index.css +1 -1
- package/dist/es/components/pca-picker/pca-picker.mjs +154 -160
- package/dist/es/components/pca-picker/pca-picker.vue.d.ts +12 -11
- package/dist/es/components/qr-code/qr-code.mjs +2 -1
- package/dist/es/components/screenfull/screenfull.mjs +6 -5
- package/dist/es/components/scrollbar/index.css +18 -0
- package/dist/es/components/scrollbar/index.d.ts +4 -0
- package/dist/es/components/scrollbar/index.mjs +6 -0
- package/dist/es/components/scrollbar/scrollbar.d.ts +4 -0
- package/dist/es/components/scrollbar/scrollbar.mjs +65 -0
- package/dist/es/components/scrollbar/scrollbar.vue.d.ts +588 -0
- package/dist/es/components/select/select.mjs +7 -7
- package/dist/es/components/single-player/index.css +1 -1
- package/dist/es/components/single-player/single-player.mjs +265 -166
- package/dist/es/components/svg-icon/index.css +3 -2
- package/dist/es/components/svg-icon/svg-icon.mjs +3 -3
- package/dist/es/components/switch/switch.mjs +2 -2
- package/dist/es/components/sync-scroll-container/sync-scroll-container.mjs +2 -2
- package/dist/es/components/tags/tags.mjs +9 -9
- package/dist/es/components/text-ellipsis/text-ellipsis.mjs +4 -4
- package/dist/es/components/thousand-input/thousand-input.mjs +5 -4
- package/dist/es/components/thousand-input/thousand-input.vue.d.ts +126 -108
- package/dist/es/components/tinymce/index.css +1 -1
- package/dist/es/components/tinymce/tinymce.mjs +9 -8
- package/dist/es/components/tree-picker/components/popover-cascader.vue.d.ts +179 -141
- package/dist/es/components/tree-picker/popover-cascader.css +1 -1
- package/dist/es/components/tree-picker/tree-picker.mjs +10 -10
- package/dist/es/components/tree-picker/tree-picker.vue.d.ts +12 -11
- package/dist/es/components/upload-file/upload-file.mjs +3 -3
- package/dist/es/index.d.ts +3 -0
- package/dist/es/index.mjs +41 -31
- package/dist/global.d.ts +3 -0
- package/dist/index.css +166 -22
- package/package.json +8 -2
- package/dist/es/chunk/BtTIs3tG.mjs +0 -138
- package/dist/es/chunk/C7wQNvSS.mjs +0 -728
- package/dist/es/chunk/Cbhe4I9Z.mjs +0 -16
- package/dist/es/chunk/DihosKp1.mjs +0 -140
- package/dist/es/components/icon/index.css +0 -9
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import './index.css'
|
|
2
|
-
import { c as buildProps, d as definePropType, u as useNamespace, j as isFunction, h as isString, t as throwError, i as isArray, k as isNil, N as NOOP, l as isPlainObject, e as debugWarn } from '../../chunk/
|
|
3
|
-
import { v as vLoading } from '../../chunk/
|
|
4
|
-
import { E as ElButton } from '../../chunk/
|
|
2
|
+
import { c as buildProps, d as definePropType, u as useNamespace, j as isFunction, h as isString, t as throwError, i as isArray, k as isNil, N as NOOP, l as isPlainObject, e as debugWarn } from '../../chunk/CcKUdl3e.mjs';
|
|
3
|
+
import { v as vLoading } from '../../chunk/DKpRXDRE.mjs';
|
|
4
|
+
import { E as ElButton } from '../../chunk/CKbkzlkO.mjs';
|
|
5
5
|
import { defineComponent, computed, createElementBlock, openBlock, normalizeClass, unref, createCommentVNode, createElementVNode, normalizeStyle, renderSlot, toDisplayString, createBlock, withCtx, resolveDynamicComponent, ref, TransitionGroup, Fragment, renderList, withKeys, withModifiers, createVNode, inject, shallowRef, watch, nextTick, onBeforeUnmount, provide, toRef, createSlots, mergeProps, isRef, withDirectives, createTextVNode } from 'vue';
|
|
6
6
|
import Draggable from 'vuedraggable-es-fix';
|
|
7
7
|
import { C as Component$1 } from '../dialog/dialog.mjs';
|
|
8
8
|
import { C as Component$2 } from '../el-icon/el-icon.mjs';
|
|
9
|
-
import { E as ElIcon } from '../../chunk/
|
|
9
|
+
import { E as ElIcon } from '../../chunk/DEPZhJ0Z.mjs';
|
|
10
10
|
import { WarningFilled, CircleCheck, CircleClose, Check, Close, Document, ZoomIn, Delete } from '@element-plus/icons-vue';
|
|
11
|
-
import { _ as _export_sfc, w as withInstall } from '../../chunk/
|
|
11
|
+
import { _ as _export_sfc, w as withInstall } from '../../chunk/BTsEMnf_.mjs';
|
|
12
12
|
import { m as mutable } from '../../chunk/B-rxnVJv.mjs';
|
|
13
|
-
import { u as useLocale } from '../../chunk/
|
|
14
|
-
import { b as useFormDisabled } from '../../chunk/
|
|
13
|
+
import { u as useLocale } from '../../chunk/plK2vnjp.mjs';
|
|
14
|
+
import { b as useFormDisabled } from '../../chunk/U13Qpiki.mjs';
|
|
15
|
+
import { f as flatten } from '../../chunk/BDyXj_90.mjs';
|
|
15
16
|
import { e as entriesOf } from '../../chunk/DVNTpOBR.mjs';
|
|
16
|
-
import { c as cloneDeep } from '../../chunk/
|
|
17
|
-
import { i as isEqual } from '../../chunk/
|
|
17
|
+
import { c as cloneDeep } from '../../chunk/CNILa-hz.mjs';
|
|
18
|
+
import { i as isEqual } from '../../chunk/Dw-yyl2m.mjs';
|
|
18
19
|
import { useVModel } from '@vueuse/core';
|
|
19
20
|
import { _ as _export_sfc$1 } from '../../chunk/pcqpp-6-.mjs';
|
|
20
21
|
|
|
@@ -72,20 +73,25 @@ const progressProps = buildProps({
|
|
|
72
73
|
}
|
|
73
74
|
});
|
|
74
75
|
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
const
|
|
79
|
-
|
|
76
|
+
const _hoisted_1$3 = ["aria-valuenow"];
|
|
77
|
+
const _hoisted_2$3 = { viewBox: "0 0 100 100" };
|
|
78
|
+
const _hoisted_3$1 = ["d", "stroke", "stroke-linecap", "stroke-width"];
|
|
79
|
+
const _hoisted_4$1 = ["d", "stroke", "opacity", "stroke-linecap", "stroke-width"];
|
|
80
|
+
const _hoisted_5$1 = { key: 0 };
|
|
81
|
+
const _sfc_main$5 = defineComponent({
|
|
82
|
+
...{
|
|
83
|
+
name: "ElProgress"
|
|
84
|
+
},
|
|
85
|
+
__name: "progress",
|
|
80
86
|
props: progressProps,
|
|
81
87
|
setup(__props) {
|
|
82
|
-
const props = __props;
|
|
83
88
|
const STATUS_COLOR_MAP = {
|
|
84
89
|
success: "#13ce66",
|
|
85
90
|
exception: "#ff4949",
|
|
86
91
|
warning: "#e6a23c",
|
|
87
92
|
default: "#20a0ff"
|
|
88
93
|
};
|
|
94
|
+
const props = __props;
|
|
89
95
|
const ns = useNamespace("progress");
|
|
90
96
|
const barStyle = computed(() => {
|
|
91
97
|
const barStyle2 = {
|
|
@@ -100,10 +106,15 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
100
106
|
}
|
|
101
107
|
return barStyle2;
|
|
102
108
|
});
|
|
103
|
-
const relativeStrokeWidth = computed(
|
|
109
|
+
const relativeStrokeWidth = computed(
|
|
110
|
+
() => (props.strokeWidth / props.width * 100).toFixed(1)
|
|
111
|
+
);
|
|
104
112
|
const radius = computed(() => {
|
|
105
113
|
if (["circle", "dashboard"].includes(props.type)) {
|
|
106
|
-
return Number.parseInt(
|
|
114
|
+
return Number.parseInt(
|
|
115
|
+
`${50 - Number.parseFloat(relativeStrokeWidth.value) / 2}`,
|
|
116
|
+
10
|
|
117
|
+
);
|
|
107
118
|
}
|
|
108
119
|
return 0;
|
|
109
120
|
});
|
|
@@ -200,79 +211,119 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
200
211
|
"aria-valuemin": "0",
|
|
201
212
|
"aria-valuemax": "100"
|
|
202
213
|
}, [
|
|
203
|
-
_ctx.type === "line" ? (openBlock(), createElementBlock(
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
unref(ns).be("bar", "
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
(
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
214
|
+
_ctx.type === "line" ? (openBlock(), createElementBlock(
|
|
215
|
+
"div",
|
|
216
|
+
{
|
|
217
|
+
key: 0,
|
|
218
|
+
class: normalizeClass(unref(ns).b("bar"))
|
|
219
|
+
},
|
|
220
|
+
[
|
|
221
|
+
createElementVNode(
|
|
222
|
+
"div",
|
|
223
|
+
{
|
|
224
|
+
class: normalizeClass(unref(ns).be("bar", "outer")),
|
|
225
|
+
style: normalizeStyle({ height: `${_ctx.strokeWidth}px` })
|
|
226
|
+
},
|
|
227
|
+
[
|
|
228
|
+
createElementVNode(
|
|
229
|
+
"div",
|
|
230
|
+
{
|
|
231
|
+
class: normalizeClass([
|
|
232
|
+
unref(ns).be("bar", "inner"),
|
|
233
|
+
{ [unref(ns).bem("bar", "inner", "indeterminate")]: _ctx.indeterminate },
|
|
234
|
+
{ [unref(ns).bem("bar", "inner", "striped")]: _ctx.striped },
|
|
235
|
+
{ [unref(ns).bem("bar", "inner", "striped-flow")]: _ctx.stripedFlow }
|
|
236
|
+
]),
|
|
237
|
+
style: normalizeStyle(barStyle.value)
|
|
238
|
+
},
|
|
239
|
+
[
|
|
240
|
+
(_ctx.showText || _ctx.$slots.default) && _ctx.textInside ? (openBlock(), createElementBlock(
|
|
241
|
+
"div",
|
|
242
|
+
{
|
|
243
|
+
key: 0,
|
|
244
|
+
class: normalizeClass(unref(ns).be("bar", "innerText"))
|
|
245
|
+
},
|
|
246
|
+
[
|
|
247
|
+
renderSlot(_ctx.$slots, "default", { percentage: _ctx.percentage }, () => [
|
|
248
|
+
createElementVNode(
|
|
249
|
+
"span",
|
|
250
|
+
null,
|
|
251
|
+
toDisplayString(content.value),
|
|
252
|
+
1
|
|
253
|
+
)
|
|
254
|
+
])
|
|
255
|
+
],
|
|
256
|
+
2
|
|
257
|
+
)) : createCommentVNode("v-if", true)
|
|
258
|
+
],
|
|
259
|
+
6
|
|
260
|
+
)
|
|
261
|
+
],
|
|
262
|
+
6
|
|
263
|
+
)
|
|
264
|
+
],
|
|
265
|
+
2
|
|
266
|
+
)) : (openBlock(), createElementBlock(
|
|
267
|
+
"div",
|
|
268
|
+
{
|
|
269
|
+
key: 1,
|
|
270
|
+
class: normalizeClass(unref(ns).b("circle")),
|
|
271
|
+
style: normalizeStyle({ height: `${_ctx.width}px`, width: `${_ctx.width}px` })
|
|
272
|
+
},
|
|
273
|
+
[
|
|
274
|
+
(openBlock(), createElementBlock("svg", _hoisted_2$3, [
|
|
275
|
+
createElementVNode("path", {
|
|
276
|
+
class: normalizeClass(unref(ns).be("circle", "track")),
|
|
277
|
+
d: trackPath.value,
|
|
278
|
+
stroke: `var(${unref(ns).cssVarName("fill-color-light")}, #e5e9f2)`,
|
|
279
|
+
"stroke-linecap": _ctx.strokeLinecap,
|
|
280
|
+
"stroke-width": relativeStrokeWidth.value,
|
|
281
|
+
fill: "none",
|
|
282
|
+
style: normalizeStyle(trailPathStyle.value)
|
|
283
|
+
}, null, 14, _hoisted_3$1),
|
|
284
|
+
createElementVNode("path", {
|
|
285
|
+
class: normalizeClass(unref(ns).be("circle", "path")),
|
|
286
|
+
d: trackPath.value,
|
|
287
|
+
stroke: stroke.value,
|
|
288
|
+
fill: "none",
|
|
289
|
+
opacity: _ctx.percentage ? 1 : 0,
|
|
290
|
+
"stroke-linecap": _ctx.strokeLinecap,
|
|
291
|
+
"stroke-width": relativeStrokeWidth.value,
|
|
292
|
+
style: normalizeStyle(circlePathStyle.value)
|
|
293
|
+
}, null, 14, _hoisted_4$1)
|
|
294
|
+
]))
|
|
295
|
+
],
|
|
296
|
+
6
|
|
297
|
+
)),
|
|
298
|
+
(_ctx.showText || _ctx.$slots.default) && !_ctx.textInside ? (openBlock(), createElementBlock(
|
|
299
|
+
"div",
|
|
300
|
+
{
|
|
301
|
+
key: 2,
|
|
302
|
+
class: normalizeClass(unref(ns).e("text")),
|
|
303
|
+
style: normalizeStyle({ fontSize: `${progressTextSize.value}px` })
|
|
304
|
+
},
|
|
305
|
+
[
|
|
306
|
+
renderSlot(_ctx.$slots, "default", { percentage: _ctx.percentage }, () => [
|
|
307
|
+
!_ctx.status ? (openBlock(), createElementBlock(
|
|
308
|
+
"span",
|
|
309
|
+
_hoisted_5$1,
|
|
310
|
+
toDisplayString(content.value),
|
|
311
|
+
1
|
|
312
|
+
)) : (openBlock(), createBlock(unref(ElIcon), { key: 1 }, {
|
|
313
|
+
default: withCtx(() => [
|
|
314
|
+
(openBlock(), createBlock(resolveDynamicComponent(statusIcon.value)))
|
|
315
|
+
]),
|
|
316
|
+
_: 1
|
|
317
|
+
}))
|
|
318
|
+
])
|
|
319
|
+
],
|
|
320
|
+
6
|
|
321
|
+
)) : createCommentVNode("v-if", true)
|
|
322
|
+
], 10, _hoisted_1$3);
|
|
272
323
|
};
|
|
273
324
|
}
|
|
274
325
|
});
|
|
275
|
-
var Progress = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__file", "progress.vue"]]);
|
|
326
|
+
var Progress = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/progress/src/progress.vue"]]);
|
|
276
327
|
|
|
277
328
|
const ElProgress = withInstall(Progress);
|
|
278
329
|
|
|
@@ -414,7 +465,8 @@ const uploadBaseProps = buildProps({
|
|
|
414
465
|
type: Boolean,
|
|
415
466
|
default: void 0
|
|
416
467
|
},
|
|
417
|
-
limit: Number
|
|
468
|
+
limit: Number,
|
|
469
|
+
directory: Boolean
|
|
418
470
|
});
|
|
419
471
|
const uploadProps = buildProps({
|
|
420
472
|
...uploadBaseProps,
|
|
@@ -484,15 +536,22 @@ const uploadListEmits = {
|
|
|
484
536
|
remove: (file) => !!file
|
|
485
537
|
};
|
|
486
538
|
|
|
487
|
-
const
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
const
|
|
491
|
-
|
|
539
|
+
const _hoisted_1$2 = ["tabindex", "aria-disabled", "onKeydown"];
|
|
540
|
+
const _hoisted_2$2 = ["src", "crossorigin"];
|
|
541
|
+
const _hoisted_3 = ["onClick"];
|
|
542
|
+
const _hoisted_4 = ["title"];
|
|
543
|
+
const _hoisted_5 = ["onClick"];
|
|
544
|
+
const _hoisted_6 = ["onClick"];
|
|
545
|
+
const _sfc_main$4 = defineComponent({
|
|
546
|
+
...{
|
|
547
|
+
name: "ElUploadList"
|
|
548
|
+
},
|
|
549
|
+
__name: "upload-list",
|
|
492
550
|
props: uploadListProps,
|
|
493
551
|
emits: uploadListEmits,
|
|
494
|
-
setup(__props, { emit }) {
|
|
552
|
+
setup(__props, { emit: __emit }) {
|
|
495
553
|
const props = __props;
|
|
554
|
+
const emit = __emit;
|
|
496
555
|
const { t } = useLocale();
|
|
497
556
|
const nsUpload = useNamespace("upload");
|
|
498
557
|
const nsIcon = useNamespace("icon");
|
|
@@ -510,139 +569,164 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
510
569
|
return (_ctx, _cache) => {
|
|
511
570
|
return openBlock(), createBlock(TransitionGroup, {
|
|
512
571
|
tag: "ul",
|
|
513
|
-
class: normalizeClass(
|
|
572
|
+
class: normalizeClass(containerKls.value),
|
|
514
573
|
name: unref(nsList).b()
|
|
515
574
|
}, {
|
|
516
575
|
default: withCtx(() => [
|
|
517
|
-
(openBlock(true), createElementBlock(
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
crossorigin: _ctx.crossorigin,
|
|
542
|
-
alt: ""
|
|
543
|
-
}, null, 10, ["src", "crossorigin"])) : createCommentVNode("v-if", true),
|
|
544
|
-
file.status === "uploading" || _ctx.listType !== "picture-card" ? (openBlock(), createElementBlock("div", {
|
|
545
|
-
key: 1,
|
|
546
|
-
class: normalizeClass(unref(nsUpload).be("list", "item-info"))
|
|
547
|
-
}, [
|
|
548
|
-
createElementVNode("a", {
|
|
549
|
-
class: normalizeClass(unref(nsUpload).be("list", "item-name")),
|
|
550
|
-
onClick: withModifiers(($event) => _ctx.handlePreview(file), ["prevent"])
|
|
551
|
-
}, [
|
|
552
|
-
createVNode(unref(ElIcon), {
|
|
553
|
-
class: normalizeClass(unref(nsIcon).m("document"))
|
|
554
|
-
}, {
|
|
555
|
-
default: withCtx(() => [
|
|
556
|
-
createVNode(unref(Document))
|
|
557
|
-
]),
|
|
558
|
-
_: 1
|
|
559
|
-
}, 8, ["class"]),
|
|
560
|
-
createElementVNode("span", {
|
|
561
|
-
class: normalizeClass(unref(nsUpload).be("list", "item-file-name")),
|
|
562
|
-
title: file.name
|
|
563
|
-
}, toDisplayString(file.name), 11, ["title"])
|
|
564
|
-
], 10, ["onClick"]),
|
|
565
|
-
file.status === "uploading" ? (openBlock(), createBlock(unref(ElProgress), {
|
|
566
|
-
key: 0,
|
|
567
|
-
type: _ctx.listType === "picture-card" ? "circle" : "line",
|
|
568
|
-
"stroke-width": _ctx.listType === "picture-card" ? 6 : 2,
|
|
569
|
-
percentage: Number(file.percentage),
|
|
570
|
-
style: normalizeStyle(_ctx.listType === "picture-card" ? "" : "margin-top: 0.5rem")
|
|
571
|
-
}, null, 8, ["type", "stroke-width", "percentage", "style"])) : createCommentVNode("v-if", true)
|
|
572
|
-
], 2)) : createCommentVNode("v-if", true),
|
|
573
|
-
createElementVNode("label", {
|
|
574
|
-
class: normalizeClass(unref(nsUpload).be("list", "item-status-label"))
|
|
575
|
-
}, [
|
|
576
|
-
_ctx.listType === "text" ? (openBlock(), createBlock(unref(ElIcon), {
|
|
576
|
+
(openBlock(true), createElementBlock(
|
|
577
|
+
Fragment,
|
|
578
|
+
null,
|
|
579
|
+
renderList(_ctx.files, (file, index) => {
|
|
580
|
+
return openBlock(), createElementBlock("li", {
|
|
581
|
+
key: file.uid || file.name,
|
|
582
|
+
class: normalizeClass([
|
|
583
|
+
unref(nsUpload).be("list", "item"),
|
|
584
|
+
unref(nsUpload).is(file.status),
|
|
585
|
+
{ focusing: focusing.value }
|
|
586
|
+
]),
|
|
587
|
+
tabindex: unref(disabled) ? void 0 : 0,
|
|
588
|
+
"aria-disabled": unref(disabled),
|
|
589
|
+
role: "button",
|
|
590
|
+
onKeydown: withKeys(($event) => !unref(disabled) && handleRemove(file), ["delete"]),
|
|
591
|
+
onFocus: _cache[0] || (_cache[0] = ($event) => focusing.value = true),
|
|
592
|
+
onBlur: _cache[1] || (_cache[1] = ($event) => focusing.value = false),
|
|
593
|
+
onClick: _cache[2] || (_cache[2] = ($event) => focusing.value = false)
|
|
594
|
+
}, [
|
|
595
|
+
renderSlot(_ctx.$slots, "default", {
|
|
596
|
+
file,
|
|
597
|
+
index
|
|
598
|
+
}, () => [
|
|
599
|
+
_ctx.listType === "picture" || file.status !== "uploading" && _ctx.listType === "picture-card" ? (openBlock(), createElementBlock("img", {
|
|
577
600
|
key: 0,
|
|
578
|
-
class: normalizeClass(
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
601
|
+
class: normalizeClass(unref(nsUpload).be("list", "item-thumbnail")),
|
|
602
|
+
src: file.url,
|
|
603
|
+
crossorigin: _ctx.crossorigin,
|
|
604
|
+
alt: ""
|
|
605
|
+
}, null, 10, _hoisted_2$2)) : createCommentVNode("v-if", true),
|
|
606
|
+
file.status === "uploading" || _ctx.listType !== "picture-card" ? (openBlock(), createElementBlock(
|
|
607
|
+
"div",
|
|
608
|
+
{
|
|
609
|
+
key: 1,
|
|
610
|
+
class: normalizeClass(unref(nsUpload).be("list", "item-info"))
|
|
611
|
+
},
|
|
612
|
+
[
|
|
613
|
+
createElementVNode("a", {
|
|
614
|
+
class: normalizeClass(unref(nsUpload).be("list", "item-name")),
|
|
615
|
+
onClick: withModifiers(($event) => _ctx.handlePreview(file), ["prevent"])
|
|
616
|
+
}, [
|
|
617
|
+
createVNode(unref(ElIcon), {
|
|
618
|
+
class: normalizeClass(unref(nsIcon).m("document"))
|
|
619
|
+
}, {
|
|
620
|
+
default: withCtx(() => [
|
|
621
|
+
createVNode(unref(Document))
|
|
622
|
+
]),
|
|
623
|
+
_: 1
|
|
624
|
+
}, 8, ["class"]),
|
|
625
|
+
createElementVNode("span", {
|
|
626
|
+
class: normalizeClass(unref(nsUpload).be("list", "item-file-name")),
|
|
627
|
+
title: file.name
|
|
628
|
+
}, toDisplayString(file.name), 11, _hoisted_4)
|
|
629
|
+
], 10, _hoisted_3),
|
|
630
|
+
file.status === "uploading" ? (openBlock(), createBlock(unref(ElProgress), {
|
|
631
|
+
key: 0,
|
|
632
|
+
type: _ctx.listType === "picture-card" ? "circle" : "line",
|
|
633
|
+
"stroke-width": _ctx.listType === "picture-card" ? 6 : 2,
|
|
634
|
+
percentage: Number(file.percentage),
|
|
635
|
+
style: normalizeStyle(_ctx.listType === "picture-card" ? "" : "margin-top: 0.5rem")
|
|
636
|
+
}, null, 8, ["type", "stroke-width", "percentage", "style"])) : createCommentVNode("v-if", true)
|
|
637
|
+
],
|
|
638
|
+
2
|
|
639
|
+
)) : createCommentVNode("v-if", true),
|
|
640
|
+
createElementVNode(
|
|
641
|
+
"label",
|
|
642
|
+
{
|
|
643
|
+
class: normalizeClass(unref(nsUpload).be("list", "item-status-label"))
|
|
644
|
+
},
|
|
645
|
+
[
|
|
646
|
+
_ctx.listType === "text" ? (openBlock(), createBlock(unref(ElIcon), {
|
|
647
|
+
key: 0,
|
|
648
|
+
class: normalizeClass([unref(nsIcon).m("upload-success"), unref(nsIcon).m("circle-check")])
|
|
649
|
+
}, {
|
|
650
|
+
default: withCtx(() => [
|
|
651
|
+
createVNode(unref(CircleCheck))
|
|
652
|
+
]),
|
|
653
|
+
_: 1
|
|
654
|
+
}, 8, ["class"])) : ["picture-card", "picture"].includes(_ctx.listType) ? (openBlock(), createBlock(unref(ElIcon), {
|
|
655
|
+
key: 1,
|
|
656
|
+
class: normalizeClass([unref(nsIcon).m("upload-success"), unref(nsIcon).m("check")])
|
|
657
|
+
}, {
|
|
658
|
+
default: withCtx(() => [
|
|
659
|
+
createVNode(unref(Check))
|
|
660
|
+
]),
|
|
661
|
+
_: 1
|
|
662
|
+
}, 8, ["class"])) : createCommentVNode("v-if", true)
|
|
663
|
+
],
|
|
664
|
+
2
|
|
665
|
+
),
|
|
666
|
+
!unref(disabled) ? (openBlock(), createBlock(unref(ElIcon), {
|
|
667
|
+
key: 2,
|
|
668
|
+
class: normalizeClass(unref(nsIcon).m("close")),
|
|
669
|
+
onClick: ($event) => handleRemove(file)
|
|
587
670
|
}, {
|
|
588
671
|
default: withCtx(() => [
|
|
589
|
-
createVNode(unref(
|
|
672
|
+
createVNode(unref(Close))
|
|
590
673
|
]),
|
|
591
674
|
_: 1
|
|
592
|
-
}, 8, ["class"])) : createCommentVNode("v-if", true)
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
]),
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
]),
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
]
|
|
643
|
-
])
|
|
644
|
-
|
|
645
|
-
|
|
675
|
+
}, 8, ["class", "onClick"])) : createCommentVNode("v-if", true),
|
|
676
|
+
createCommentVNode(" Due to close btn only appears when li gets focused disappears after li gets blurred, thus keyboard navigation can never reach close btn"),
|
|
677
|
+
createCommentVNode(" This is a bug which needs to be fixed "),
|
|
678
|
+
createCommentVNode(" TODO: Fix the incorrect navigation interaction "),
|
|
679
|
+
!unref(disabled) ? (openBlock(), createElementBlock(
|
|
680
|
+
"i",
|
|
681
|
+
{
|
|
682
|
+
key: 3,
|
|
683
|
+
class: normalizeClass(unref(nsIcon).m("close-tip"))
|
|
684
|
+
},
|
|
685
|
+
toDisplayString(unref(t)("el.upload.deleteTip")),
|
|
686
|
+
3
|
|
687
|
+
)) : createCommentVNode("v-if", true),
|
|
688
|
+
_ctx.listType === "picture-card" ? (openBlock(), createElementBlock(
|
|
689
|
+
"span",
|
|
690
|
+
{
|
|
691
|
+
key: 4,
|
|
692
|
+
class: normalizeClass(unref(nsUpload).be("list", "item-actions"))
|
|
693
|
+
},
|
|
694
|
+
[
|
|
695
|
+
createElementVNode("span", {
|
|
696
|
+
class: normalizeClass(unref(nsUpload).be("list", "item-preview")),
|
|
697
|
+
onClick: ($event) => _ctx.handlePreview(file)
|
|
698
|
+
}, [
|
|
699
|
+
createVNode(unref(ElIcon), {
|
|
700
|
+
class: normalizeClass(unref(nsIcon).m("zoom-in"))
|
|
701
|
+
}, {
|
|
702
|
+
default: withCtx(() => [
|
|
703
|
+
createVNode(unref(ZoomIn))
|
|
704
|
+
]),
|
|
705
|
+
_: 1
|
|
706
|
+
}, 8, ["class"])
|
|
707
|
+
], 10, _hoisted_5),
|
|
708
|
+
!unref(disabled) ? (openBlock(), createElementBlock("span", {
|
|
709
|
+
key: 0,
|
|
710
|
+
class: normalizeClass(unref(nsUpload).be("list", "item-delete")),
|
|
711
|
+
onClick: ($event) => handleRemove(file)
|
|
712
|
+
}, [
|
|
713
|
+
createVNode(unref(ElIcon), {
|
|
714
|
+
class: normalizeClass(unref(nsIcon).m("delete"))
|
|
715
|
+
}, {
|
|
716
|
+
default: withCtx(() => [
|
|
717
|
+
createVNode(unref(Delete))
|
|
718
|
+
]),
|
|
719
|
+
_: 1
|
|
720
|
+
}, 8, ["class"])
|
|
721
|
+
], 10, _hoisted_6)) : createCommentVNode("v-if", true)
|
|
722
|
+
],
|
|
723
|
+
2
|
|
724
|
+
)) : createCommentVNode("v-if", true)
|
|
725
|
+
])
|
|
726
|
+
], 42, _hoisted_1$2);
|
|
727
|
+
}),
|
|
728
|
+
128
|
|
729
|
+
)),
|
|
646
730
|
renderSlot(_ctx.$slots, "append")
|
|
647
731
|
]),
|
|
648
732
|
_: 3
|
|
@@ -650,41 +734,92 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
650
734
|
};
|
|
651
735
|
}
|
|
652
736
|
});
|
|
653
|
-
var UploadList = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__file", "upload-list.vue"]]);
|
|
737
|
+
var UploadList = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/upload/src/upload-list.vue"]]);
|
|
654
738
|
|
|
655
739
|
const uploadDraggerProps = buildProps({
|
|
656
740
|
disabled: {
|
|
657
741
|
type: Boolean,
|
|
658
742
|
default: void 0
|
|
659
|
-
}
|
|
743
|
+
},
|
|
744
|
+
directory: Boolean
|
|
660
745
|
});
|
|
661
746
|
const uploadDraggerEmits = {
|
|
662
747
|
file: (file) => isArray(file)
|
|
663
748
|
};
|
|
664
749
|
|
|
665
750
|
const COMPONENT_NAME = "ElUploadDrag";
|
|
666
|
-
const
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
751
|
+
const _sfc_main$3 = defineComponent({
|
|
752
|
+
...{
|
|
753
|
+
name: COMPONENT_NAME
|
|
754
|
+
},
|
|
755
|
+
__name: "upload-dragger",
|
|
671
756
|
props: uploadDraggerProps,
|
|
672
757
|
emits: uploadDraggerEmits,
|
|
673
|
-
setup(__props, { emit }) {
|
|
758
|
+
setup(__props, { emit: __emit }) {
|
|
759
|
+
const props = __props;
|
|
760
|
+
const emit = __emit;
|
|
674
761
|
const uploaderContext = inject(uploadContextKey);
|
|
675
762
|
if (!uploaderContext) {
|
|
676
|
-
throwError(
|
|
763
|
+
throwError(
|
|
764
|
+
COMPONENT_NAME,
|
|
765
|
+
"usage: <el-upload><el-upload-dragger /></el-upload>"
|
|
766
|
+
);
|
|
677
767
|
}
|
|
678
768
|
const ns = useNamespace("upload");
|
|
679
769
|
const dragover = ref(false);
|
|
680
770
|
const disabled = useFormDisabled();
|
|
681
|
-
const
|
|
771
|
+
const getFile = (entry) => {
|
|
772
|
+
return new Promise((resolve, reject) => entry.file(resolve, reject));
|
|
773
|
+
};
|
|
774
|
+
const getAllFiles = async (entry) => {
|
|
775
|
+
try {
|
|
776
|
+
if (entry.isFile) {
|
|
777
|
+
const file = await getFile(
|
|
778
|
+
entry
|
|
779
|
+
);
|
|
780
|
+
file.isDirectory = false;
|
|
781
|
+
return [file];
|
|
782
|
+
}
|
|
783
|
+
if (entry.isDirectory) {
|
|
784
|
+
const dirReader = entry.createReader();
|
|
785
|
+
const getEntries = () => {
|
|
786
|
+
return new Promise(
|
|
787
|
+
(resolve, reject) => dirReader.readEntries(resolve, reject)
|
|
788
|
+
);
|
|
789
|
+
};
|
|
790
|
+
const entries = [];
|
|
791
|
+
let readEntries = await getEntries();
|
|
792
|
+
while (readEntries.length > 0) {
|
|
793
|
+
entries.push(...readEntries);
|
|
794
|
+
readEntries = await getEntries();
|
|
795
|
+
}
|
|
796
|
+
const filePromises = entries.map(
|
|
797
|
+
(entry2) => getAllFiles(entry2).catch(() => [])
|
|
798
|
+
);
|
|
799
|
+
const files = await Promise.all(filePromises);
|
|
800
|
+
return flatten(files);
|
|
801
|
+
}
|
|
802
|
+
} catch (e) {
|
|
803
|
+
return [];
|
|
804
|
+
}
|
|
805
|
+
return [];
|
|
806
|
+
};
|
|
807
|
+
const onDrop = async (e) => {
|
|
682
808
|
if (disabled.value)
|
|
683
809
|
return;
|
|
684
810
|
dragover.value = false;
|
|
685
811
|
e.stopPropagation();
|
|
686
812
|
const files = Array.from(e.dataTransfer.files);
|
|
687
813
|
const items = e.dataTransfer.items || [];
|
|
814
|
+
if (props.directory) {
|
|
815
|
+
const entries = Array.from(items).map((item) => {
|
|
816
|
+
var _a;
|
|
817
|
+
return (_a = item == null ? void 0 : item.webkitGetAsEntry) == null ? void 0 : _a.call(item);
|
|
818
|
+
}).filter((entry) => entry);
|
|
819
|
+
const allFiles = await Promise.all(entries.map(getAllFiles));
|
|
820
|
+
emit("file", flatten(allFiles));
|
|
821
|
+
return;
|
|
822
|
+
}
|
|
688
823
|
files.forEach((file, index) => {
|
|
689
824
|
var _a;
|
|
690
825
|
const item = items[index];
|
|
@@ -704,18 +839,23 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
704
839
|
dragover.value = false;
|
|
705
840
|
};
|
|
706
841
|
return (_ctx, _cache) => {
|
|
707
|
-
return openBlock(), createElementBlock(
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
842
|
+
return openBlock(), createElementBlock(
|
|
843
|
+
"div",
|
|
844
|
+
{
|
|
845
|
+
class: normalizeClass([unref(ns).b("dragger"), unref(ns).is("dragover", dragover.value)]),
|
|
846
|
+
onDrop: withModifiers(onDrop, ["prevent"]),
|
|
847
|
+
onDragover: withModifiers(onDragover, ["prevent"]),
|
|
848
|
+
onDragleave: withModifiers(onDragleave, ["prevent"])
|
|
849
|
+
},
|
|
850
|
+
[
|
|
851
|
+
renderSlot(_ctx.$slots, "default")
|
|
852
|
+
],
|
|
853
|
+
34
|
|
854
|
+
);
|
|
715
855
|
};
|
|
716
856
|
}
|
|
717
857
|
});
|
|
718
|
-
var UploadDragger = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__file", "upload-dragger.vue"]]);
|
|
858
|
+
var UploadDragger = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/upload/src/upload-dragger.vue"]]);
|
|
719
859
|
|
|
720
860
|
const uploadContentProps = buildProps({
|
|
721
861
|
...uploadBaseProps,
|
|
@@ -732,7 +872,9 @@ const uploadContentProps = buildProps({
|
|
|
732
872
|
default: NOOP
|
|
733
873
|
},
|
|
734
874
|
onSuccess: {
|
|
735
|
-
type: definePropType(
|
|
875
|
+
type: definePropType(
|
|
876
|
+
Function
|
|
877
|
+
),
|
|
736
878
|
default: NOOP
|
|
737
879
|
},
|
|
738
880
|
onProgress: {
|
|
@@ -749,18 +891,22 @@ const uploadContentProps = buildProps({
|
|
|
749
891
|
}
|
|
750
892
|
});
|
|
751
893
|
|
|
752
|
-
const
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
894
|
+
const _hoisted_1$1 = ["tabindex", "aria-disabled", "onKeydown"];
|
|
895
|
+
const _hoisted_2$1 = ["name", "disabled", "multiple", "accept", "webkitdirectory"];
|
|
896
|
+
const _sfc_main$2 = defineComponent({
|
|
897
|
+
...{
|
|
898
|
+
name: "ElUploadContent",
|
|
899
|
+
inheritAttrs: false
|
|
900
|
+
},
|
|
901
|
+
__name: "upload-content",
|
|
758
902
|
props: uploadContentProps,
|
|
759
|
-
setup(__props, { expose }) {
|
|
903
|
+
setup(__props, { expose: __expose }) {
|
|
760
904
|
const props = __props;
|
|
761
905
|
const ns = useNamespace("upload");
|
|
762
906
|
const disabled = useFormDisabled();
|
|
763
|
-
const requests = shallowRef(
|
|
907
|
+
const requests = shallowRef(
|
|
908
|
+
{}
|
|
909
|
+
);
|
|
764
910
|
const inputRef = shallowRef();
|
|
765
911
|
const uploadFiles = (files) => {
|
|
766
912
|
if (files.length === 0)
|
|
@@ -813,9 +959,12 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
813
959
|
});
|
|
814
960
|
}
|
|
815
961
|
}
|
|
816
|
-
doUpload(
|
|
817
|
-
|
|
818
|
-
|
|
962
|
+
doUpload(
|
|
963
|
+
Object.assign(file, {
|
|
964
|
+
uid: rawFile.uid
|
|
965
|
+
}),
|
|
966
|
+
beforeData
|
|
967
|
+
);
|
|
819
968
|
};
|
|
820
969
|
const resolveData = async (data, rawFile) => {
|
|
821
970
|
if (isFunction(data)) {
|
|
@@ -885,14 +1034,16 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
885
1034
|
handleClick();
|
|
886
1035
|
};
|
|
887
1036
|
const abort = (file) => {
|
|
888
|
-
const _reqs = entriesOf(requests.value).filter(
|
|
1037
|
+
const _reqs = entriesOf(requests.value).filter(
|
|
1038
|
+
file ? ([uid]) => String(file.uid) === uid : () => true
|
|
1039
|
+
);
|
|
889
1040
|
_reqs.forEach(([uid, req]) => {
|
|
890
1041
|
if (req instanceof XMLHttpRequest)
|
|
891
1042
|
req.abort();
|
|
892
1043
|
delete requests.value[uid];
|
|
893
1044
|
});
|
|
894
1045
|
};
|
|
895
|
-
|
|
1046
|
+
__expose({
|
|
896
1047
|
abort,
|
|
897
1048
|
upload
|
|
898
1049
|
});
|
|
@@ -913,13 +1064,14 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
913
1064
|
_ctx.drag ? (openBlock(), createBlock(UploadDragger, {
|
|
914
1065
|
key: 0,
|
|
915
1066
|
disabled: unref(disabled),
|
|
1067
|
+
directory: _ctx.directory,
|
|
916
1068
|
onFile: uploadFiles
|
|
917
1069
|
}, {
|
|
918
1070
|
default: withCtx(() => [
|
|
919
1071
|
renderSlot(_ctx.$slots, "default")
|
|
920
1072
|
]),
|
|
921
1073
|
_: 3
|
|
922
|
-
}, 8, ["disabled"])) : renderSlot(_ctx.$slots, "default", { key: 1 }),
|
|
1074
|
+
}, 8, ["disabled", "directory"])) : renderSlot(_ctx.$slots, "default", { key: 1 }),
|
|
923
1075
|
createElementVNode("input", {
|
|
924
1076
|
ref_key: "inputRef",
|
|
925
1077
|
ref: inputRef,
|
|
@@ -928,16 +1080,17 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
928
1080
|
disabled: unref(disabled),
|
|
929
1081
|
multiple: _ctx.multiple,
|
|
930
1082
|
accept: _ctx.accept,
|
|
1083
|
+
webkitdirectory: _ctx.directory,
|
|
931
1084
|
type: "file",
|
|
932
1085
|
onChange: handleChange,
|
|
933
|
-
onClick: withModifiers(() => {
|
|
934
|
-
}, ["stop"])
|
|
935
|
-
}, null, 42,
|
|
936
|
-
], 42,
|
|
1086
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(() => {
|
|
1087
|
+
}, ["stop"]))
|
|
1088
|
+
}, null, 42, _hoisted_2$1)
|
|
1089
|
+
], 42, _hoisted_1$1);
|
|
937
1090
|
};
|
|
938
1091
|
}
|
|
939
1092
|
});
|
|
940
|
-
var UploadContent = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__file", "upload-content.vue"]]);
|
|
1093
|
+
var UploadContent = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/upload/src/upload-content.vue"]]);
|
|
941
1094
|
|
|
942
1095
|
const SCOPE = "ElUpload";
|
|
943
1096
|
const revokeFileObjectURL = (file) => {
|
|
@@ -947,17 +1100,26 @@ const revokeFileObjectURL = (file) => {
|
|
|
947
1100
|
}
|
|
948
1101
|
};
|
|
949
1102
|
const useHandlers = (props, uploadRef) => {
|
|
950
|
-
const uploadFiles = useVModel(
|
|
1103
|
+
const uploadFiles = useVModel(
|
|
1104
|
+
props,
|
|
1105
|
+
"fileList",
|
|
1106
|
+
void 0,
|
|
1107
|
+
{ passive: true }
|
|
1108
|
+
);
|
|
951
1109
|
const getFile = (rawFile) => uploadFiles.value.find((file) => file.uid === rawFile.uid);
|
|
952
1110
|
function abort(file) {
|
|
953
1111
|
var _a;
|
|
954
1112
|
(_a = uploadRef.value) == null ? void 0 : _a.abort(file);
|
|
955
1113
|
}
|
|
956
1114
|
function clearFiles(states = ["ready", "uploading", "success", "fail"]) {
|
|
957
|
-
uploadFiles.value = uploadFiles.value.filter(
|
|
1115
|
+
uploadFiles.value = uploadFiles.value.filter(
|
|
1116
|
+
(row) => !states.includes(row.status)
|
|
1117
|
+
);
|
|
958
1118
|
}
|
|
959
1119
|
function removeFile(file) {
|
|
960
|
-
uploadFiles.value = uploadFiles.value.filter(
|
|
1120
|
+
uploadFiles.value = uploadFiles.value.filter(
|
|
1121
|
+
(uploadFile) => uploadFile.uid !== file.uid
|
|
1122
|
+
);
|
|
961
1123
|
}
|
|
962
1124
|
const emitChange = (file) => {
|
|
963
1125
|
nextTick(() => props.onChange(file, uploadFiles.value));
|
|
@@ -1035,28 +1197,35 @@ const useHandlers = (props, uploadRef) => {
|
|
|
1035
1197
|
return raw && ((_a = uploadRef.value) == null ? void 0 : _a.upload(raw));
|
|
1036
1198
|
});
|
|
1037
1199
|
}
|
|
1038
|
-
watch(
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
const { raw, url } = file;
|
|
1044
|
-
if (!url && raw) {
|
|
1045
|
-
try {
|
|
1046
|
-
file.url = URL.createObjectURL(raw);
|
|
1047
|
-
} catch (err) {
|
|
1048
|
-
props.onError(err, file, uploadFiles.value);
|
|
1049
|
-
}
|
|
1200
|
+
watch(
|
|
1201
|
+
() => props.listType,
|
|
1202
|
+
(val) => {
|
|
1203
|
+
if (val !== "picture-card" && val !== "picture") {
|
|
1204
|
+
return;
|
|
1050
1205
|
}
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1206
|
+
uploadFiles.value = uploadFiles.value.map((file) => {
|
|
1207
|
+
const { raw, url } = file;
|
|
1208
|
+
if (!url && raw) {
|
|
1209
|
+
try {
|
|
1210
|
+
file.url = URL.createObjectURL(raw);
|
|
1211
|
+
} catch (err) {
|
|
1212
|
+
props.onError(err, file, uploadFiles.value);
|
|
1213
|
+
}
|
|
1214
|
+
}
|
|
1215
|
+
return file;
|
|
1216
|
+
});
|
|
1058
1217
|
}
|
|
1059
|
-
|
|
1218
|
+
);
|
|
1219
|
+
watch(
|
|
1220
|
+
uploadFiles,
|
|
1221
|
+
(files) => {
|
|
1222
|
+
for (const file of files) {
|
|
1223
|
+
file.uid || (file.uid = genFileId());
|
|
1224
|
+
file.status || (file.status = "success");
|
|
1225
|
+
}
|
|
1226
|
+
},
|
|
1227
|
+
{ immediate: true, deep: true }
|
|
1228
|
+
);
|
|
1060
1229
|
return {
|
|
1061
1230
|
uploadFiles,
|
|
1062
1231
|
abort,
|
|
@@ -1071,13 +1240,13 @@ const useHandlers = (props, uploadRef) => {
|
|
|
1071
1240
|
};
|
|
1072
1241
|
};
|
|
1073
1242
|
|
|
1074
|
-
const
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1243
|
+
const _sfc_main$1 = defineComponent({
|
|
1244
|
+
...{
|
|
1245
|
+
name: "ElUpload"
|
|
1246
|
+
},
|
|
1247
|
+
__name: "upload",
|
|
1079
1248
|
props: uploadProps,
|
|
1080
|
-
setup(__props, { expose }) {
|
|
1249
|
+
setup(__props, { expose: __expose }) {
|
|
1081
1250
|
const props = __props;
|
|
1082
1251
|
const disabled = useFormDisabled();
|
|
1083
1252
|
const uploadRef = shallowRef();
|
|
@@ -1109,7 +1278,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
1109
1278
|
provide(uploadContextKey, {
|
|
1110
1279
|
accept: toRef(props, "accept")
|
|
1111
1280
|
});
|
|
1112
|
-
|
|
1281
|
+
__expose({
|
|
1113
1282
|
abort,
|
|
1114
1283
|
submit,
|
|
1115
1284
|
clearFiles,
|
|
@@ -1118,7 +1287,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
1118
1287
|
});
|
|
1119
1288
|
return (_ctx, _cache) => {
|
|
1120
1289
|
return openBlock(), createElementBlock("div", null, [
|
|
1121
|
-
|
|
1290
|
+
isPictureCard.value && _ctx.showFileList ? (openBlock(), createBlock(UploadList, {
|
|
1122
1291
|
key: 0,
|
|
1123
1292
|
disabled: unref(disabled),
|
|
1124
1293
|
"list-type": _ctx.listType,
|
|
@@ -1128,16 +1297,21 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
1128
1297
|
onRemove: unref(handleRemove)
|
|
1129
1298
|
}, createSlots({
|
|
1130
1299
|
append: withCtx(() => [
|
|
1131
|
-
createVNode(
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1300
|
+
createVNode(
|
|
1301
|
+
UploadContent,
|
|
1302
|
+
mergeProps({
|
|
1303
|
+
ref_key: "uploadRef",
|
|
1304
|
+
ref: uploadRef
|
|
1305
|
+
}, uploadContentProps.value),
|
|
1306
|
+
{
|
|
1307
|
+
default: withCtx(() => [
|
|
1308
|
+
_ctx.$slots.trigger ? renderSlot(_ctx.$slots, "trigger", { key: 0 }) : createCommentVNode("v-if", true),
|
|
1309
|
+
!_ctx.$slots.trigger && _ctx.$slots.default ? renderSlot(_ctx.$slots, "default", { key: 1 }) : createCommentVNode("v-if", true)
|
|
1310
|
+
]),
|
|
1311
|
+
_: 3
|
|
1312
|
+
},
|
|
1313
|
+
16
|
|
1314
|
+
)
|
|
1141
1315
|
]),
|
|
1142
1316
|
_: 2
|
|
1143
1317
|
}, [
|
|
@@ -1148,23 +1322,29 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
1148
1322
|
file,
|
|
1149
1323
|
index
|
|
1150
1324
|
})
|
|
1151
|
-
])
|
|
1325
|
+
]),
|
|
1326
|
+
key: "0"
|
|
1152
1327
|
} : void 0
|
|
1153
1328
|
]), 1032, ["disabled", "list-type", "files", "crossorigin", "handle-preview", "onRemove"])) : createCommentVNode("v-if", true),
|
|
1154
|
-
!
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1329
|
+
!isPictureCard.value || isPictureCard.value && !_ctx.showFileList ? (openBlock(), createBlock(
|
|
1330
|
+
UploadContent,
|
|
1331
|
+
mergeProps({
|
|
1332
|
+
key: 1,
|
|
1333
|
+
ref_key: "uploadRef",
|
|
1334
|
+
ref: uploadRef
|
|
1335
|
+
}, uploadContentProps.value),
|
|
1336
|
+
{
|
|
1337
|
+
default: withCtx(() => [
|
|
1338
|
+
_ctx.$slots.trigger ? renderSlot(_ctx.$slots, "trigger", { key: 0 }) : createCommentVNode("v-if", true),
|
|
1339
|
+
!_ctx.$slots.trigger && _ctx.$slots.default ? renderSlot(_ctx.$slots, "default", { key: 1 }) : createCommentVNode("v-if", true)
|
|
1340
|
+
]),
|
|
1341
|
+
_: 3
|
|
1342
|
+
},
|
|
1343
|
+
16
|
|
1344
|
+
)) : createCommentVNode("v-if", true),
|
|
1165
1345
|
_ctx.$slots.trigger ? renderSlot(_ctx.$slots, "default", { key: 2 }) : createCommentVNode("v-if", true),
|
|
1166
1346
|
renderSlot(_ctx.$slots, "tip"),
|
|
1167
|
-
!
|
|
1347
|
+
!isPictureCard.value && _ctx.showFileList ? (openBlock(), createBlock(UploadList, {
|
|
1168
1348
|
key: 3,
|
|
1169
1349
|
disabled: unref(disabled),
|
|
1170
1350
|
"list-type": _ctx.listType,
|
|
@@ -1182,14 +1362,15 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
1182
1362
|
file,
|
|
1183
1363
|
index
|
|
1184
1364
|
})
|
|
1185
|
-
])
|
|
1365
|
+
]),
|
|
1366
|
+
key: "0"
|
|
1186
1367
|
} : void 0
|
|
1187
1368
|
]), 1032, ["disabled", "list-type", "files", "crossorigin", "handle-preview", "onRemove"])) : createCommentVNode("v-if", true)
|
|
1188
1369
|
]);
|
|
1189
1370
|
};
|
|
1190
1371
|
}
|
|
1191
1372
|
});
|
|
1192
|
-
var Upload = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__file", "upload.vue"]]);
|
|
1373
|
+
var Upload = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/upload/src/upload.vue"]]);
|
|
1193
1374
|
|
|
1194
1375
|
const ElUpload = withInstall(Upload);
|
|
1195
1376
|
|