@vunk/form 0.0.1-alpha.15 → 0.0.1-alpha.16
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/components/form-item-renderer-template-default/index.js +18 -2
- package/components/upload/index.css +10 -0
- package/components/upload/index.d.ts +4 -0
- package/components/upload/index.js +473 -0
- package/components/upload/src/ctx.d.ts +160 -0
- package/components/upload/src/ctx.js +38 -0
- package/components/upload/src/file.vue.d.ts +96 -0
- package/components/upload/src/index.vue.d.ts +401 -0
- package/components/upload/src/types.d.ts +1 -0
- package/components/upload/src/types.js +1 -0
- package/index.css +11 -0
- package/package.json +1 -1
- package/shared/element-plus/ctx.d.ts +1 -0
- package/shared/element-plus/index.js +3 -2
- package/shared/types/renderer-source/index.d.ts +3 -1
- package/shared/types/renderer-source/upload.d.ts +7 -0
|
@@ -9,6 +9,7 @@ import { pickObject } from '@vunk/core/shared/utils-object';
|
|
|
9
9
|
import { VkfInputNumber } from '@vunk/form/components/input-number';
|
|
10
10
|
import { VkfRadio } from '@vunk/form/components/radio';
|
|
11
11
|
import { VkfCheckbox } from '@vunk/form/components/checkbox';
|
|
12
|
+
import { VkfUpload } from '@vunk/form/components/upload';
|
|
12
13
|
|
|
13
14
|
const props = {
|
|
14
15
|
data: {
|
|
@@ -30,7 +31,8 @@ var script = defineComponent({
|
|
|
30
31
|
VkfDatePicker,
|
|
31
32
|
VkfInputNumber,
|
|
32
33
|
VkfRadio,
|
|
33
|
-
VkfCheckbox
|
|
34
|
+
VkfCheckbox,
|
|
35
|
+
VkfUpload
|
|
34
36
|
},
|
|
35
37
|
emits,
|
|
36
38
|
props,
|
|
@@ -43,8 +45,9 @@ var script = defineComponent({
|
|
|
43
45
|
});
|
|
44
46
|
|
|
45
47
|
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
46
|
-
const
|
|
48
|
+
const _component_VkfUpload = resolveComponent("VkfUpload");
|
|
47
49
|
const _component_VkfFormItemRendererTemplate = resolveComponent("VkfFormItemRendererTemplate");
|
|
50
|
+
const _component_VkfCheckbox = resolveComponent("VkfCheckbox");
|
|
48
51
|
const _component_VkfRadio = resolveComponent("VkfRadio");
|
|
49
52
|
const _component_VkfInput = resolveComponent("VkfInput");
|
|
50
53
|
const _component_VkfSwitch = resolveComponent("VkfSwitch");
|
|
@@ -52,6 +55,19 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
52
55
|
const _component_VkfDatePicker = resolveComponent("VkfDatePicker");
|
|
53
56
|
const _component_VkfInputNumber = resolveComponent("VkfInputNumber");
|
|
54
57
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
58
|
+
createVNode(_component_VkfFormItemRendererTemplate, { type: "VkfUpload" }, {
|
|
59
|
+
default: withCtx(({ data: sourceData, templateIf }) => [
|
|
60
|
+
templateIf(_ctx.data) ? (openBlock(), createBlock(_component_VkfUpload, mergeProps({
|
|
61
|
+
key: 0,
|
|
62
|
+
fileList: _ctx.getValue(_ctx.data, sourceData.prop),
|
|
63
|
+
"onUpdate:fileList": ($event) => _ctx.$emit("setData", {
|
|
64
|
+
k: sourceData.prop,
|
|
65
|
+
v: $event
|
|
66
|
+
})
|
|
67
|
+
}, sourceData), null, 16, ["fileList", "onUpdate:fileList"])) : createCommentVNode("v-if", true)
|
|
68
|
+
]),
|
|
69
|
+
_: 1
|
|
70
|
+
}),
|
|
55
71
|
createVNode(_component_VkfFormItemRendererTemplate, { type: "VkfCheckbox" }, {
|
|
56
72
|
default: withCtx(({ data: sourceData, templateIf }) => [
|
|
57
73
|
templateIf(_ctx.data) ? (openBlock(), createBlock(_component_VkfCheckbox, mergeProps({
|
|
@@ -0,0 +1,473 @@
|
|
|
1
|
+
import { _VkfFormItemCtx, VkfFormItem } from '@vunk/form/components/form-item';
|
|
2
|
+
import { uploadProps, ElProgress, ElIcon, useNamespace, useLocale, ElUpload, ElLink } from 'element-plus';
|
|
3
|
+
import { openBlock, createElementBlock, createElementVNode, defineComponent, resolveComponent, Fragment, createCommentVNode, normalizeClass, createBlock, withModifiers, createVNode, withCtx, toDisplayString, normalizeStyle, shallowRef, normalizeProps, guardReactiveProps, mergeProps, createSlots, renderSlot, createTextVNode } from 'vue';
|
|
4
|
+
import { pickObject } from '@vunk/core/shared/utils-object';
|
|
5
|
+
import { createUploadBindProps } from '@vunk/form/shared/element-plus';
|
|
6
|
+
import { NOOP } from '@vunk/core/shared/utils-function';
|
|
7
|
+
import { RestFetch } from '@vunk/core/shared/utils-fetch';
|
|
8
|
+
|
|
9
|
+
var __defProp = Object.defineProperty;
|
|
10
|
+
var __defProps = Object.defineProperties;
|
|
11
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
12
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
13
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
15
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
16
|
+
var __spreadValues = (a, b) => {
|
|
17
|
+
for (var prop in b || (b = {}))
|
|
18
|
+
if (__hasOwnProp.call(b, prop))
|
|
19
|
+
__defNormalProp(a, prop, b[prop]);
|
|
20
|
+
if (__getOwnPropSymbols)
|
|
21
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
22
|
+
if (__propIsEnum.call(b, prop))
|
|
23
|
+
__defNormalProp(a, prop, b[prop]);
|
|
24
|
+
}
|
|
25
|
+
return a;
|
|
26
|
+
};
|
|
27
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
28
|
+
const props = __spreadProps(__spreadValues(__spreadValues({}, _VkfFormItemCtx.props), uploadProps), {
|
|
29
|
+
tip: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: ""
|
|
32
|
+
},
|
|
33
|
+
preview: {
|
|
34
|
+
type: String,
|
|
35
|
+
default: ""
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
const emits = {
|
|
39
|
+
"update:fileList": null,
|
|
40
|
+
"remove": (e) => e
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
/*! Element Plus Icons Vue v2.0.6 */
|
|
44
|
+
|
|
45
|
+
// unplugin-vue:/plugin-vue/export-helper
|
|
46
|
+
var export_helper_default = (sfc, props) => {
|
|
47
|
+
let target = sfc.__vccOpts || sfc;
|
|
48
|
+
for (let [key, val] of props)
|
|
49
|
+
target[key] = val;
|
|
50
|
+
return target;
|
|
51
|
+
};
|
|
52
|
+
var _sfc_main43 = {
|
|
53
|
+
name: "Check"
|
|
54
|
+
}, _hoisted_143 = {
|
|
55
|
+
viewBox: "0 0 1024 1024",
|
|
56
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
57
|
+
}, _hoisted_243 = /* @__PURE__ */ createElementVNode("path", {
|
|
58
|
+
fill: "currentColor",
|
|
59
|
+
d: "M406.656 706.944 195.84 496.256a32 32 0 1 0-45.248 45.248l256 256 512-512a32 32 0 0 0-45.248-45.248L406.592 706.944z"
|
|
60
|
+
}, null, -1), _hoisted_342 = [
|
|
61
|
+
_hoisted_243
|
|
62
|
+
];
|
|
63
|
+
function _sfc_render43(_ctx, _cache, $props, $setup, $data, $options) {
|
|
64
|
+
return openBlock(), createElementBlock("svg", _hoisted_143, _hoisted_342);
|
|
65
|
+
}
|
|
66
|
+
var check_default = /* @__PURE__ */ export_helper_default(_sfc_main43, [["render", _sfc_render43], ["__file", "check.vue"]]);
|
|
67
|
+
var _sfc_main48 = {
|
|
68
|
+
name: "CircleCheck"
|
|
69
|
+
}, _hoisted_148 = {
|
|
70
|
+
viewBox: "0 0 1024 1024",
|
|
71
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
72
|
+
}, _hoisted_248 = /* @__PURE__ */ createElementVNode("path", {
|
|
73
|
+
fill: "currentColor",
|
|
74
|
+
d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768zm0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896z"
|
|
75
|
+
}, null, -1), _hoisted_347 = /* @__PURE__ */ createElementVNode("path", {
|
|
76
|
+
fill: "currentColor",
|
|
77
|
+
d: "M745.344 361.344a32 32 0 0 1 45.312 45.312l-288 288a32 32 0 0 1-45.312 0l-160-160a32 32 0 1 1 45.312-45.312L480 626.752l265.344-265.408z"
|
|
78
|
+
}, null, -1), _hoisted_414 = [
|
|
79
|
+
_hoisted_248,
|
|
80
|
+
_hoisted_347
|
|
81
|
+
];
|
|
82
|
+
function _sfc_render48(_ctx, _cache, $props, $setup, $data, $options) {
|
|
83
|
+
return openBlock(), createElementBlock("svg", _hoisted_148, _hoisted_414);
|
|
84
|
+
}
|
|
85
|
+
var circle_check_default = /* @__PURE__ */ export_helper_default(_sfc_main48, [["render", _sfc_render48], ["__file", "circle-check.vue"]]);
|
|
86
|
+
var _sfc_main55 = {
|
|
87
|
+
name: "Close"
|
|
88
|
+
}, _hoisted_155 = {
|
|
89
|
+
viewBox: "0 0 1024 1024",
|
|
90
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
91
|
+
}, _hoisted_255 = /* @__PURE__ */ createElementVNode("path", {
|
|
92
|
+
fill: "currentColor",
|
|
93
|
+
d: "M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"
|
|
94
|
+
}, null, -1), _hoisted_354 = [
|
|
95
|
+
_hoisted_255
|
|
96
|
+
];
|
|
97
|
+
function _sfc_render55(_ctx, _cache, $props, $setup, $data, $options) {
|
|
98
|
+
return openBlock(), createElementBlock("svg", _hoisted_155, _hoisted_354);
|
|
99
|
+
}
|
|
100
|
+
var close_default = /* @__PURE__ */ export_helper_default(_sfc_main55, [["render", _sfc_render55], ["__file", "close.vue"]]);
|
|
101
|
+
var _sfc_main79 = {
|
|
102
|
+
name: "Delete"
|
|
103
|
+
}, _hoisted_179 = {
|
|
104
|
+
viewBox: "0 0 1024 1024",
|
|
105
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
106
|
+
}, _hoisted_279 = /* @__PURE__ */ createElementVNode("path", {
|
|
107
|
+
fill: "currentColor",
|
|
108
|
+
d: "M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32V256zm448-64v-64H416v64h192zM224 896h576V256H224v640zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32zm192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32z"
|
|
109
|
+
}, null, -1), _hoisted_378 = [
|
|
110
|
+
_hoisted_279
|
|
111
|
+
];
|
|
112
|
+
function _sfc_render79(_ctx, _cache, $props, $setup, $data, $options) {
|
|
113
|
+
return openBlock(), createElementBlock("svg", _hoisted_179, _hoisted_378);
|
|
114
|
+
}
|
|
115
|
+
var delete_default = /* @__PURE__ */ export_helper_default(_sfc_main79, [["render", _sfc_render79], ["__file", "delete.vue"]]);
|
|
116
|
+
var _sfc_main89 = {
|
|
117
|
+
name: "Document"
|
|
118
|
+
}, _hoisted_189 = {
|
|
119
|
+
viewBox: "0 0 1024 1024",
|
|
120
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
121
|
+
}, _hoisted_289 = /* @__PURE__ */ createElementVNode("path", {
|
|
122
|
+
fill: "currentColor",
|
|
123
|
+
d: "M832 384H576V128H192v768h640V384zm-26.496-64L640 154.496V320h165.504zM160 64h480l256 256v608a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32zm160 448h384v64H320v-64zm0-192h160v64H320v-64zm0 384h384v64H320v-64z"
|
|
124
|
+
}, null, -1), _hoisted_388 = [
|
|
125
|
+
_hoisted_289
|
|
126
|
+
];
|
|
127
|
+
function _sfc_render89(_ctx, _cache, $props, $setup, $data, $options) {
|
|
128
|
+
return openBlock(), createElementBlock("svg", _hoisted_189, _hoisted_388);
|
|
129
|
+
}
|
|
130
|
+
var document_default = /* @__PURE__ */ export_helper_default(_sfc_main89, [["render", _sfc_render89], ["__file", "document.vue"]]);
|
|
131
|
+
var _sfc_main90 = {
|
|
132
|
+
name: "Download"
|
|
133
|
+
}, _hoisted_190 = {
|
|
134
|
+
viewBox: "0 0 1024 1024",
|
|
135
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
136
|
+
}, _hoisted_290 = /* @__PURE__ */ createElementVNode("path", {
|
|
137
|
+
fill: "currentColor",
|
|
138
|
+
d: "M160 832h704a32 32 0 1 1 0 64H160a32 32 0 1 1 0-64zm384-253.696 236.288-236.352 45.248 45.248L508.8 704 192 387.2l45.248-45.248L480 584.704V128h64v450.304z"
|
|
139
|
+
}, null, -1), _hoisted_389 = [
|
|
140
|
+
_hoisted_290
|
|
141
|
+
];
|
|
142
|
+
function _sfc_render90(_ctx, _cache, $props, $setup, $data, $options) {
|
|
143
|
+
return openBlock(), createElementBlock("svg", _hoisted_190, _hoisted_389);
|
|
144
|
+
}
|
|
145
|
+
var download_default = /* @__PURE__ */ export_helper_default(_sfc_main90, [["render", _sfc_render90], ["__file", "download.vue"]]);
|
|
146
|
+
var _sfc_main282 = {
|
|
147
|
+
name: "ZoomIn"
|
|
148
|
+
}, _hoisted_1282 = {
|
|
149
|
+
viewBox: "0 0 1024 1024",
|
|
150
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
151
|
+
}, _hoisted_2282 = /* @__PURE__ */ createElementVNode("path", {
|
|
152
|
+
fill: "currentColor",
|
|
153
|
+
d: "m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704zm-32-384v-96a32 32 0 0 1 64 0v96h96a32 32 0 0 1 0 64h-96v96a32 32 0 0 1-64 0v-96h-96a32 32 0 0 1 0-64h96z"
|
|
154
|
+
}, null, -1), _hoisted_3281 = [
|
|
155
|
+
_hoisted_2282
|
|
156
|
+
];
|
|
157
|
+
function _sfc_render282(_ctx, _cache, $props, $setup, $data, $options) {
|
|
158
|
+
return openBlock(), createElementBlock("svg", _hoisted_1282, _hoisted_3281);
|
|
159
|
+
}
|
|
160
|
+
var zoom_in_default = /* @__PURE__ */ export_helper_default(_sfc_main282, [["render", _sfc_render282], ["__file", "zoom-in.vue"]]);
|
|
161
|
+
|
|
162
|
+
const restFetch = new RestFetch({
|
|
163
|
+
baseURL: ""
|
|
164
|
+
});
|
|
165
|
+
var script$1 = defineComponent({
|
|
166
|
+
components: {
|
|
167
|
+
ElProgress,
|
|
168
|
+
ElIcon,
|
|
169
|
+
Check: check_default,
|
|
170
|
+
ZoomIn: zoom_in_default,
|
|
171
|
+
Delete: delete_default,
|
|
172
|
+
Close: close_default,
|
|
173
|
+
CircleCheck: circle_check_default,
|
|
174
|
+
Document: document_default,
|
|
175
|
+
Download: download_default
|
|
176
|
+
},
|
|
177
|
+
props: {
|
|
178
|
+
listType: {
|
|
179
|
+
type: String,
|
|
180
|
+
default: "text"
|
|
181
|
+
},
|
|
182
|
+
file: {
|
|
183
|
+
type: Object,
|
|
184
|
+
default: () => ({})
|
|
185
|
+
},
|
|
186
|
+
disabled: {
|
|
187
|
+
type: Boolean,
|
|
188
|
+
default: false
|
|
189
|
+
},
|
|
190
|
+
onPreview: {
|
|
191
|
+
type: Function,
|
|
192
|
+
default: () => NOOP
|
|
193
|
+
},
|
|
194
|
+
preview: {
|
|
195
|
+
type: Boolean,
|
|
196
|
+
default: false
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
emits: {
|
|
200
|
+
"remove": (e) => e
|
|
201
|
+
},
|
|
202
|
+
setup(props, { emit }) {
|
|
203
|
+
const nsUpload = useNamespace("upload");
|
|
204
|
+
const nsIcon = useNamespace("icon");
|
|
205
|
+
const { t } = useLocale();
|
|
206
|
+
const handleRemove = (file = props.file) => {
|
|
207
|
+
emit("remove", file);
|
|
208
|
+
};
|
|
209
|
+
const handleDownload = (file = props.file) => {
|
|
210
|
+
let url = "";
|
|
211
|
+
if (file.url) {
|
|
212
|
+
url = file.url;
|
|
213
|
+
} else if (file.raw) {
|
|
214
|
+
url = window.URL.createObjectURL(file.raw);
|
|
215
|
+
}
|
|
216
|
+
url && restFetch.download({
|
|
217
|
+
url,
|
|
218
|
+
fileName: file.name
|
|
219
|
+
}, {
|
|
220
|
+
method: "GET"
|
|
221
|
+
});
|
|
222
|
+
};
|
|
223
|
+
return {
|
|
224
|
+
handleRemove,
|
|
225
|
+
t,
|
|
226
|
+
nsIcon,
|
|
227
|
+
nsUpload,
|
|
228
|
+
handleDownload
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
const _hoisted_1$1 = ["src"];
|
|
234
|
+
function render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
235
|
+
const _component_Document = resolveComponent("Document");
|
|
236
|
+
const _component_el_icon = resolveComponent("el-icon");
|
|
237
|
+
const _component_Download = resolveComponent("Download");
|
|
238
|
+
const _component_el_progress = resolveComponent("el-progress");
|
|
239
|
+
const _component_circle_check = resolveComponent("circle-check");
|
|
240
|
+
const _component_Check = resolveComponent("Check");
|
|
241
|
+
const _component_Close = resolveComponent("Close");
|
|
242
|
+
const _component_zoom_in = resolveComponent("zoom-in");
|
|
243
|
+
const _component_Delete = resolveComponent("Delete");
|
|
244
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
245
|
+
createCommentVNode(" picture "),
|
|
246
|
+
_ctx.listType === "picture" || _ctx.file.status !== "uploading" && _ctx.listType === "picture-card" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
247
|
+
/\.(svg|png|jpg|jpeg)$/.test(_ctx.file.name) ? (openBlock(), createElementBlock("img", {
|
|
248
|
+
key: 0,
|
|
249
|
+
class: normalizeClass(_ctx.nsUpload.be("list", "item-thumbnail")),
|
|
250
|
+
src: _ctx.file.url,
|
|
251
|
+
alt: ""
|
|
252
|
+
}, null, 10, _hoisted_1$1)) : (openBlock(), createBlock(_component_Document, { key: 1 }))
|
|
253
|
+
], 64)) : createCommentVNode("v-if", true),
|
|
254
|
+
createCommentVNode(" text "),
|
|
255
|
+
_ctx.listType !== "picture" && (_ctx.file.status === "uploading" || _ctx.listType !== "picture-card") ? (openBlock(), createElementBlock("div", {
|
|
256
|
+
key: 1,
|
|
257
|
+
class: normalizeClass(_ctx.nsUpload.be("list", "item-info"))
|
|
258
|
+
}, [
|
|
259
|
+
createElementVNode("a", {
|
|
260
|
+
class: normalizeClass(_ctx.nsUpload.be("list", "item-name")),
|
|
261
|
+
onClick: _cache[1] || (_cache[1] = withModifiers(($event) => _ctx.onPreview(_ctx.file), ["prevent"]))
|
|
262
|
+
}, [
|
|
263
|
+
createVNode(_component_el_icon, {
|
|
264
|
+
class: normalizeClass(_ctx.nsIcon.m("document"))
|
|
265
|
+
}, {
|
|
266
|
+
default: withCtx(() => [
|
|
267
|
+
createVNode(_component_Document)
|
|
268
|
+
]),
|
|
269
|
+
_: 1
|
|
270
|
+
}, 8, ["class"]),
|
|
271
|
+
createVNode(_component_el_icon, {
|
|
272
|
+
class: normalizeClass([
|
|
273
|
+
_ctx.nsIcon.m("download"),
|
|
274
|
+
_ctx.nsIcon.m("download-primary")
|
|
275
|
+
]),
|
|
276
|
+
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.handleDownload(_ctx.file))
|
|
277
|
+
}, {
|
|
278
|
+
default: withCtx(() => [
|
|
279
|
+
createVNode(_component_Download)
|
|
280
|
+
]),
|
|
281
|
+
_: 1
|
|
282
|
+
}, 8, ["class"]),
|
|
283
|
+
createElementVNode("span", {
|
|
284
|
+
class: normalizeClass(_ctx.nsUpload.be("list", "item-file-name"))
|
|
285
|
+
}, toDisplayString(_ctx.file.name), 3)
|
|
286
|
+
], 2),
|
|
287
|
+
_ctx.file.status === "uploading" ? (openBlock(), createBlock(_component_el_progress, {
|
|
288
|
+
key: 0,
|
|
289
|
+
type: _ctx.listType === "picture-card" ? "circle" : "line",
|
|
290
|
+
"stroke-width": _ctx.listType === "picture-card" ? 6 : 2,
|
|
291
|
+
percentage: Number(_ctx.file.percentage),
|
|
292
|
+
style: normalizeStyle(_ctx.listType === "picture-card" ? "" : "margin-top: 0.5rem")
|
|
293
|
+
}, null, 8, ["type", "stroke-width", "percentage", "style"])) : createCommentVNode("v-if", true)
|
|
294
|
+
], 2)) : createCommentVNode("v-if", true),
|
|
295
|
+
createElementVNode("label", {
|
|
296
|
+
class: normalizeClass(_ctx.nsUpload.be("list", "item-status-label"))
|
|
297
|
+
}, [
|
|
298
|
+
_ctx.listType === "text" ? (openBlock(), createBlock(_component_el_icon, {
|
|
299
|
+
key: 0,
|
|
300
|
+
class: normalizeClass([
|
|
301
|
+
_ctx.nsIcon.m("upload-success"),
|
|
302
|
+
_ctx.nsIcon.m("circle-check")
|
|
303
|
+
])
|
|
304
|
+
}, {
|
|
305
|
+
default: withCtx(() => [
|
|
306
|
+
createVNode(_component_circle_check)
|
|
307
|
+
]),
|
|
308
|
+
_: 1
|
|
309
|
+
}, 8, ["class"])) : ["picture-card", "picture"].includes(_ctx.listType) ? (openBlock(), createBlock(_component_el_icon, {
|
|
310
|
+
key: 1,
|
|
311
|
+
class: normalizeClass([_ctx.nsIcon.m("upload-success"), _ctx.nsIcon.m("check")])
|
|
312
|
+
}, {
|
|
313
|
+
default: withCtx(() => [
|
|
314
|
+
createVNode(_component_Check)
|
|
315
|
+
]),
|
|
316
|
+
_: 1
|
|
317
|
+
}, 8, ["class"])) : createCommentVNode("v-if", true)
|
|
318
|
+
], 2),
|
|
319
|
+
!_ctx.disabled ? (openBlock(), createBlock(_component_el_icon, {
|
|
320
|
+
key: 2,
|
|
321
|
+
class: normalizeClass(_ctx.nsIcon.m("close")),
|
|
322
|
+
onClick: _ctx.handleRemove
|
|
323
|
+
}, {
|
|
324
|
+
default: withCtx(() => [
|
|
325
|
+
createVNode(_component_Close)
|
|
326
|
+
]),
|
|
327
|
+
_: 1
|
|
328
|
+
}, 8, ["class", "onClick"])) : createCommentVNode("v-if", true),
|
|
329
|
+
createCommentVNode(" Due to close btn only appears when li gets focused disappears after li gets blurred, thus keyboard navigation can never reach close btn"),
|
|
330
|
+
createCommentVNode(" This is a bug which needs to be fixed "),
|
|
331
|
+
createCommentVNode(" TODO: Fix the incorrect navigation interaction "),
|
|
332
|
+
createCommentVNode(` <i v-if="!disabled" :class="nsIcon.m('close-tip')">{{\r
|
|
333
|
+
t('el.upload.deleteTip')\r
|
|
334
|
+
}}</i> `),
|
|
335
|
+
createCommentVNode(" picture-card "),
|
|
336
|
+
_ctx.listType === "picture-card" ? (openBlock(), createElementBlock("span", {
|
|
337
|
+
key: 3,
|
|
338
|
+
class: normalizeClass(_ctx.nsUpload.be("list", "item-actions"))
|
|
339
|
+
}, [
|
|
340
|
+
_ctx.preview ? (openBlock(), createElementBlock("span", {
|
|
341
|
+
key: 0,
|
|
342
|
+
class: normalizeClass(_ctx.nsUpload.be("list", "item-preview")),
|
|
343
|
+
onClick: _cache[2] || (_cache[2] = ($event) => _ctx.onPreview(_ctx.file))
|
|
344
|
+
}, [
|
|
345
|
+
createVNode(_component_el_icon, {
|
|
346
|
+
class: normalizeClass(_ctx.nsIcon.m("zoom-in"))
|
|
347
|
+
}, {
|
|
348
|
+
default: withCtx(() => [
|
|
349
|
+
createVNode(_component_zoom_in)
|
|
350
|
+
]),
|
|
351
|
+
_: 1
|
|
352
|
+
}, 8, ["class"])
|
|
353
|
+
], 2)) : createCommentVNode("v-if", true),
|
|
354
|
+
createCommentVNode(" \u4E0B\u8F7D "),
|
|
355
|
+
createElementVNode("span", {
|
|
356
|
+
class: normalizeClass(_ctx.nsUpload.be("list", "item-download")),
|
|
357
|
+
onClick: _cache[3] || (_cache[3] = ($event) => _ctx.handleDownload(_ctx.file))
|
|
358
|
+
}, [
|
|
359
|
+
createVNode(_component_el_icon, {
|
|
360
|
+
class: normalizeClass(_ctx.nsIcon.m("download"))
|
|
361
|
+
}, {
|
|
362
|
+
default: withCtx(() => [
|
|
363
|
+
createVNode(_component_Download)
|
|
364
|
+
]),
|
|
365
|
+
_: 1
|
|
366
|
+
}, 8, ["class"])
|
|
367
|
+
], 2),
|
|
368
|
+
!_ctx.disabled ? (openBlock(), createElementBlock("span", {
|
|
369
|
+
key: 1,
|
|
370
|
+
class: normalizeClass(_ctx.nsUpload.be("list", "item-delete")),
|
|
371
|
+
onClick: _cache[4] || (_cache[4] = ($event) => _ctx.handleRemove(_ctx.file))
|
|
372
|
+
}, [
|
|
373
|
+
createVNode(_component_el_icon, {
|
|
374
|
+
class: normalizeClass(_ctx.nsIcon.m("delete"))
|
|
375
|
+
}, {
|
|
376
|
+
default: withCtx(() => [
|
|
377
|
+
createVNode(_component_Delete)
|
|
378
|
+
]),
|
|
379
|
+
_: 1
|
|
380
|
+
}, 8, ["class"])
|
|
381
|
+
], 2)) : createCommentVNode("v-if", true)
|
|
382
|
+
], 2)) : createCommentVNode("v-if", true)
|
|
383
|
+
], 64);
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
script$1.render = render$1;
|
|
387
|
+
script$1.__file = "upload/src/file.vue";
|
|
388
|
+
|
|
389
|
+
var script = defineComponent({
|
|
390
|
+
name: "VkfUpload",
|
|
391
|
+
components: {
|
|
392
|
+
VkfFormItem,
|
|
393
|
+
ElUpload,
|
|
394
|
+
FileVue: script$1,
|
|
395
|
+
ElLink
|
|
396
|
+
},
|
|
397
|
+
emits,
|
|
398
|
+
props,
|
|
399
|
+
setup(props2) {
|
|
400
|
+
const formItemBindProps = _VkfFormItemCtx.createBindProps(props2);
|
|
401
|
+
const coreBindProps = createUploadBindProps(props2);
|
|
402
|
+
const uploadRef = shallowRef();
|
|
403
|
+
const handleRemove = (file) => {
|
|
404
|
+
var _a;
|
|
405
|
+
(_a = uploadRef.value) == null ? void 0 : _a.handleRemove(file);
|
|
406
|
+
};
|
|
407
|
+
return {
|
|
408
|
+
formItemBindProps,
|
|
409
|
+
pickObject,
|
|
410
|
+
coreBindProps,
|
|
411
|
+
uploadRef,
|
|
412
|
+
handleRemove
|
|
413
|
+
};
|
|
414
|
+
}
|
|
415
|
+
});
|
|
416
|
+
|
|
417
|
+
const _hoisted_1 = /* @__PURE__ */ createTextVNode("+ \u9009\u62E9\u6587\u4EF6");
|
|
418
|
+
const _hoisted_2 = { class: "el-upload__tip" };
|
|
419
|
+
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
420
|
+
const _component_ElLink = resolveComponent("ElLink");
|
|
421
|
+
const _component_FileVue = resolveComponent("FileVue");
|
|
422
|
+
const _component_ElUpload = resolveComponent("ElUpload");
|
|
423
|
+
const _component_VkfFormItem = resolveComponent("VkfFormItem");
|
|
424
|
+
return openBlock(), createBlock(_component_VkfFormItem, normalizeProps(guardReactiveProps(_ctx.formItemBindProps)), {
|
|
425
|
+
default: withCtx(() => [
|
|
426
|
+
createVNode(_component_ElUpload, mergeProps(_ctx.coreBindProps, {
|
|
427
|
+
"onUpdate:fileList": _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:fileList", $event)),
|
|
428
|
+
ref: "uploadRef"
|
|
429
|
+
}), createSlots({
|
|
430
|
+
file: withCtx(({ file }) => [
|
|
431
|
+
createVNode(_component_FileVue, {
|
|
432
|
+
file,
|
|
433
|
+
listType: _ctx.listType,
|
|
434
|
+
disabled: _ctx.disabled,
|
|
435
|
+
onPreview: _ctx.onPreview,
|
|
436
|
+
onRemove: _ctx.handleRemove
|
|
437
|
+
}, null, 8, ["file", "listType", "disabled", "onPreview", "onRemove"])
|
|
438
|
+
]),
|
|
439
|
+
default: withCtx(() => [
|
|
440
|
+
createVNode(_component_ElLink, { type: "primary" }, {
|
|
441
|
+
default: withCtx(() => [
|
|
442
|
+
_hoisted_1
|
|
443
|
+
]),
|
|
444
|
+
_: 1
|
|
445
|
+
}),
|
|
446
|
+
renderSlot(_ctx.$slots, "default")
|
|
447
|
+
]),
|
|
448
|
+
_: 2
|
|
449
|
+
}, [
|
|
450
|
+
_ctx.tip ? {
|
|
451
|
+
name: "tip",
|
|
452
|
+
fn: withCtx(() => [
|
|
453
|
+
createElementVNode("div", _hoisted_2, toDisplayString(_ctx.tip), 1)
|
|
454
|
+
])
|
|
455
|
+
} : void 0
|
|
456
|
+
]), 1040)
|
|
457
|
+
]),
|
|
458
|
+
_: 3
|
|
459
|
+
}, 16);
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
script.render = render;
|
|
463
|
+
script.__file = "upload/src/index.vue";
|
|
464
|
+
|
|
465
|
+
var types = /*#__PURE__*/Object.freeze({
|
|
466
|
+
__proto__: null
|
|
467
|
+
});
|
|
468
|
+
|
|
469
|
+
script.install = (app) => {
|
|
470
|
+
app.component(script.name, script);
|
|
471
|
+
};
|
|
472
|
+
|
|
473
|
+
export { script as VkfUpload, types as __VkfUpload, script as default };
|