@opentinyvue/vue-file-upload 2.21.0 → 2.22.1
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/lib/index.js +2 -6
- package/lib/mobile-first.js +0 -1
- package/package.json +15 -16
- package/lib/mobile.js +0 -177
- package/src/mobile.vue.d.ts +0 -2
package/lib/index.js
CHANGED
|
@@ -7,9 +7,8 @@ function _extends() {
|
|
|
7
7
|
return n;
|
|
8
8
|
}, _extends.apply(null, arguments);
|
|
9
9
|
}
|
|
10
|
-
import { defineComponent, $
|
|
10
|
+
import { defineComponent, $props, $setup, $prefix } from "@opentinyvue/vue-common";
|
|
11
11
|
import PcTemplate from "./pc.js";
|
|
12
|
-
import MobileTemplate from "./mobile.js";
|
|
13
12
|
import MobileFirstTemplate from "./mobile-first.js";
|
|
14
13
|
import "@opentinyvue/vue-theme/file-upload/index.css";
|
|
15
14
|
var template = function template2(mode) {
|
|
@@ -18,9 +17,6 @@ var template = function template2(mode) {
|
|
|
18
17
|
if ("pc" === (tinyMode || mode)) {
|
|
19
18
|
return PcTemplate;
|
|
20
19
|
}
|
|
21
|
-
if ("mobile" === (tinyMode || mode)) {
|
|
22
|
-
return MobileTemplate;
|
|
23
|
-
}
|
|
24
20
|
if ("mobile-first" === (tinyMode || mode)) {
|
|
25
21
|
return MobileFirstTemplate;
|
|
26
22
|
}
|
|
@@ -378,7 +374,7 @@ var FileUpload = defineComponent({
|
|
|
378
374
|
});
|
|
379
375
|
}
|
|
380
376
|
});
|
|
381
|
-
var version = "2.
|
|
377
|
+
var version = "2.undefined";
|
|
382
378
|
FileUpload.install = function(Vue) {
|
|
383
379
|
Vue.component(FileUpload.name, FileUpload);
|
|
384
380
|
};
|
package/lib/mobile-first.js
CHANGED
|
@@ -291,7 +291,6 @@ var __vue2_script = defineComponent({
|
|
|
291
291
|
operateContent = downloadAll2 ? h("div", {
|
|
292
292
|
"class": "hidden sm:inline-block align-middle"
|
|
293
293
|
}, [h("tiny-button", {
|
|
294
|
-
"class": "ml-2",
|
|
295
294
|
"on": {
|
|
296
295
|
"click": function click() {
|
|
297
296
|
return downloadAll2(uploadFiles2);
|
package/package.json
CHANGED
|
@@ -1,27 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentinyvue/vue-file-upload",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.22.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"main": "./lib/index.js",
|
|
8
8
|
"module": "./lib/index.js",
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@opentinyvue/vue-button": "~2.
|
|
11
|
-
"@opentinyvue/vue-common": "~2.
|
|
12
|
-
"@opentinyvue/vue-dialog-box": "~2.
|
|
13
|
-
"@opentinyvue/vue-icon": "~2.
|
|
14
|
-
"@opentinyvue/vue-input": "~2.
|
|
15
|
-
"@opentinyvue/vue-modal": "~2.
|
|
16
|
-
"@opentinyvue/vue-popover": "~2.
|
|
17
|
-
"@opentinyvue/vue-progress": "~2.
|
|
18
|
-
"@opentinyvue/vue-renderless": "~3.
|
|
19
|
-
"@opentinyvue/vue-tooltip": "~2.
|
|
20
|
-
"@opentinyvue/vue-upload": "~2.
|
|
21
|
-
"@opentinyvue/vue-upload-list": "~2.
|
|
22
|
-
"@opentinyvue/vue-switch": "~2.
|
|
23
|
-
"@opentinyvue/vue-theme": "~3.
|
|
24
|
-
"@opentinyvue/vue-theme-mobile": "~3.21.0",
|
|
10
|
+
"@opentinyvue/vue-button": "~2.22.0",
|
|
11
|
+
"@opentinyvue/vue-common": "~2.22.0",
|
|
12
|
+
"@opentinyvue/vue-dialog-box": "~2.22.0",
|
|
13
|
+
"@opentinyvue/vue-icon": "~2.22.0",
|
|
14
|
+
"@opentinyvue/vue-input": "~2.22.0",
|
|
15
|
+
"@opentinyvue/vue-modal": "~2.22.0",
|
|
16
|
+
"@opentinyvue/vue-popover": "~2.22.0",
|
|
17
|
+
"@opentinyvue/vue-progress": "~2.22.0",
|
|
18
|
+
"@opentinyvue/vue-renderless": "~3.22.0",
|
|
19
|
+
"@opentinyvue/vue-tooltip": "~2.22.0",
|
|
20
|
+
"@opentinyvue/vue-upload": "~2.22.0",
|
|
21
|
+
"@opentinyvue/vue-upload-list": "~2.22.0",
|
|
22
|
+
"@opentinyvue/vue-switch": "~2.22.0",
|
|
23
|
+
"@opentinyvue/vue-theme": "~3.22.0",
|
|
25
24
|
"streamsaver": "2.0.6"
|
|
26
25
|
},
|
|
27
26
|
"types": "index.d.ts",
|
package/lib/mobile.js
DELETED
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
import { renderless, api } from '@opentinyvue/vue-renderless/file-upload/vue';
|
|
2
|
-
import { defineComponent, props, setup } from '@opentinyvue/vue-common';
|
|
3
|
-
import UploadList from '@opentinyvue/vue-upload-list';
|
|
4
|
-
import Upload from '@opentinyvue/vue-upload';
|
|
5
|
-
import Progress from '@opentinyvue/vue-progress';
|
|
6
|
-
import Modal from '@opentinyvue/vue-modal';
|
|
7
|
-
import { iconUpload } from '@opentinyvue/vue-icon';
|
|
8
|
-
import '@opentinyvue/vue-theme-mobile/file-upload/index.css';
|
|
9
|
-
import '@opentinyvue/vue-theme-mobile/upload-list/index.css';
|
|
10
|
-
import '@opentinyvue/vue-theme-mobile/upload-dragger/index.css';
|
|
11
|
-
import '@opentinyvue/vue-theme-mobile/upload/index.css';
|
|
12
|
-
|
|
13
|
-
function normalizeComponent(scriptExports, render, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) {
|
|
14
|
-
var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports;
|
|
15
|
-
if (render) {
|
|
16
|
-
options.render = render;
|
|
17
|
-
options.staticRenderFns = staticRenderFns;
|
|
18
|
-
options._compiled = true;
|
|
19
|
-
}
|
|
20
|
-
var hook;
|
|
21
|
-
if (injectStyles) {
|
|
22
|
-
hook = injectStyles;
|
|
23
|
-
}
|
|
24
|
-
if (hook) {
|
|
25
|
-
if (options.functional) {
|
|
26
|
-
options._injectStyles = hook;
|
|
27
|
-
var originalRender = options.render;
|
|
28
|
-
options.render = function renderWithStyleInjection(h, context) {
|
|
29
|
-
hook.call(context);
|
|
30
|
-
return originalRender(h, context);
|
|
31
|
-
};
|
|
32
|
-
} else {
|
|
33
|
-
var existing = options.beforeCreate;
|
|
34
|
-
options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
return {
|
|
38
|
-
exports: scriptExports,
|
|
39
|
-
options
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
function _extends() {
|
|
44
|
-
return _extends = Object.assign ? Object.assign.bind() : function(n) {
|
|
45
|
-
for (var e = 1; e < arguments.length; e++) {
|
|
46
|
-
var t = arguments[e];
|
|
47
|
-
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
48
|
-
}
|
|
49
|
-
return n;
|
|
50
|
-
}, _extends.apply(null, arguments);
|
|
51
|
-
}
|
|
52
|
-
var __vue2_script = defineComponent({
|
|
53
|
-
inheritAttrs: false,
|
|
54
|
-
props: [].concat(props, ["size", "action", "drag", "headers", "data", "multiple", "name", "withCredentials", "showFileList", "accept", "type", "beforeUpload", "beforeRemove", "fileList", "autoUpload", "listType", "httpRequest", "disabled", "limit", "fileIconList", "display", "fileTitle", "headerShow", "successStatistics", "uploadIcon", "edm"]),
|
|
55
|
-
setup: function setup$1(props2, context) {
|
|
56
|
-
return setup({
|
|
57
|
-
props: props2,
|
|
58
|
-
context,
|
|
59
|
-
renderless,
|
|
60
|
-
api,
|
|
61
|
-
extendOptions: {
|
|
62
|
-
Modal
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
},
|
|
66
|
-
components: {
|
|
67
|
-
Progress,
|
|
68
|
-
UploadList,
|
|
69
|
-
Upload,
|
|
70
|
-
IconUpload: iconUpload()
|
|
71
|
-
},
|
|
72
|
-
render: function render() {
|
|
73
|
-
var _this = this;
|
|
74
|
-
var h = arguments[0];
|
|
75
|
-
var _this$state$listeners = this.state.listeners, _this$state$listeners2 = _this$state$listeners.exceed, exceed = _this$state$listeners2 === void 0 ? function() {
|
|
76
|
-
} : _this$state$listeners2, _this$state$listeners3 = _this$state$listeners.preview, preview = _this$state$listeners3 === void 0 ? function() {
|
|
77
|
-
} : _this$state$listeners3;
|
|
78
|
-
var fileTitle = this.fileTitle, headerShow = this.headerShow, successStatistics = this.successStatistics, uploadIcon = this.uploadIcon;
|
|
79
|
-
var uploadList;
|
|
80
|
-
var uploaArr = this.state.uploadFiles;
|
|
81
|
-
var successNum = 0;
|
|
82
|
-
var pictureArr = [];
|
|
83
|
-
uploaArr && uploaArr.map(function(item) {
|
|
84
|
-
if (_this.listType === "picture-card" && item.url) {
|
|
85
|
-
pictureArr.push(item.url);
|
|
86
|
-
}
|
|
87
|
-
if (item.status === "success") {
|
|
88
|
-
successNum += 1;
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
if (this.showFileList) {
|
|
92
|
-
var listData = {
|
|
93
|
-
props: {
|
|
94
|
-
disabled: this.state.uploadDisabled,
|
|
95
|
-
listType: this.listType,
|
|
96
|
-
files: this.state.uploadFiles,
|
|
97
|
-
filesIcon: this.fileIconList,
|
|
98
|
-
display: this.display,
|
|
99
|
-
srcList: pictureArr,
|
|
100
|
-
handlePreview: preview
|
|
101
|
-
},
|
|
102
|
-
on: {
|
|
103
|
-
remove: this.handleRemove
|
|
104
|
-
}
|
|
105
|
-
};
|
|
106
|
-
uploadList = h(UploadList, _extends({}, listData), function(props2) {
|
|
107
|
-
if (_this.slots.file) {
|
|
108
|
-
return _this.slots.file({
|
|
109
|
-
file: props2.file
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
var uploadData = {
|
|
115
|
-
props: {
|
|
116
|
-
type: this.type,
|
|
117
|
-
drag: this.drag,
|
|
118
|
-
action: this.state.url,
|
|
119
|
-
multiple: this.multiple,
|
|
120
|
-
withCredentials: this.withCredentials,
|
|
121
|
-
headers: this.headers,
|
|
122
|
-
name: this.name,
|
|
123
|
-
data: this.data,
|
|
124
|
-
accept: this.accept,
|
|
125
|
-
fileList: this.state.uploadFiles,
|
|
126
|
-
autoUpload: this.autoUpload,
|
|
127
|
-
listType: this.listType,
|
|
128
|
-
disabled: this.state.uploadDisabled,
|
|
129
|
-
limit: this.limit,
|
|
130
|
-
onExceed: exceed,
|
|
131
|
-
onStart: this.handleStart,
|
|
132
|
-
onProgress: this.handleProgress,
|
|
133
|
-
onSuccess: this.handleSuccess,
|
|
134
|
-
onError: this.handleError,
|
|
135
|
-
onPreview: preview,
|
|
136
|
-
httpRequest: this.state.httpRequest,
|
|
137
|
-
size: this.size
|
|
138
|
-
},
|
|
139
|
-
ref: "upload-inner"
|
|
140
|
-
};
|
|
141
|
-
var trigger = this.slots.trigger && this.slots.trigger() || this.slots.default();
|
|
142
|
-
var uploadComponent = !headerShow || this.listType === "picture-card" ? h(Upload, _extends({}, uploadData), trigger) : "";
|
|
143
|
-
var header = h("div", {
|
|
144
|
-
"class": "tiny-mobile-file-upload__header"
|
|
145
|
-
}, [h("div", {
|
|
146
|
-
"class": "tiny-mobile-file-upload__header-title"
|
|
147
|
-
}, [fileTitle]), h("div", {
|
|
148
|
-
"class": "tiny-mobile-file-upload__header-upload"
|
|
149
|
-
}, [successStatistics ? h("span", {
|
|
150
|
-
"class": "upload-status"
|
|
151
|
-
}, [successNum, "/", uploaArr.length]) : "", this.listType !== "picture-card" && uploadIcon ? h("span", {
|
|
152
|
-
"class": "upload-icon"
|
|
153
|
-
}, [h(Upload, _extends({}, uploadData), trigger || h("icon-upload"))]) : ""])]);
|
|
154
|
-
return h("div", {
|
|
155
|
-
"class": ["tiny-mobile-file-upload", this.$attrs.class],
|
|
156
|
-
"ref": "fileUpload"
|
|
157
|
-
}, [headerShow ? header : "", h("div", {
|
|
158
|
-
"class": {
|
|
159
|
-
"tiny-mobile-file-upload__wrap": true,
|
|
160
|
-
"is-card": this.listType === "picture-card"
|
|
161
|
-
}
|
|
162
|
-
}, [this.listType === "picture-card" ? uploadList : "", this.slots.trigger ? [uploadComponent, this.slots.default && this.slots.default()] : uploadComponent, this.slots.tip && this.slots.tip(), this.listType !== "picture-card" ? uploadList : ""])]);
|
|
163
|
-
}
|
|
164
|
-
});
|
|
165
|
-
var __vue2_render, __vue2_staticRenderFns;
|
|
166
|
-
var __cssModules = {};
|
|
167
|
-
var __component__ = /* @__PURE__ */ normalizeComponent(__vue2_script, __vue2_render, __vue2_staticRenderFns, false, __vue2_injectStyles);
|
|
168
|
-
function __vue2_injectStyles(context) {
|
|
169
|
-
for (var o in __cssModules) {
|
|
170
|
-
this[o] = __cssModules[o];
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
var mobile = /* @__PURE__ */ function() {
|
|
174
|
-
return __component__.exports;
|
|
175
|
-
}();
|
|
176
|
-
|
|
177
|
-
export { mobile as default };
|
package/src/mobile.vue.d.ts
DELETED