@opentinyvue/vue-file-upload 2.21.0 → 3.21.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/lib/index.js CHANGED
@@ -378,7 +378,7 @@ var FileUpload = defineComponent({
378
378
  });
379
379
  }
380
380
  });
381
- var version = "2.21.0";
381
+ var version = "3.21.0";
382
382
  FileUpload.install = function(Vue) {
383
383
  Vue.component(FileUpload.name, FileUpload);
384
384
  };
@@ -1,89 +1,3 @@
1
- import { renderless, api } from '@opentinyvue/vue-renderless/file-upload/vue';
2
- import { defineComponent, props, setup, isVue3 } 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 DialogBox from '@opentinyvue/vue-dialog-box';
8
- import Tooltip from '@opentinyvue/vue-tooltip';
9
- import { IconAttachment, IconSuccessful, IconClose, IconDownload, IconFileCloudupload, IconPlus, IconPlusCircle, IconPicture, IconMic, IconStartCircle, IconHelpQuery } from '@opentinyvue/vue-icon';
10
- import Streamsaver from 'streamsaver';
11
- import Button from '@opentinyvue/vue-button';
12
- import Input from '@opentinyvue/vue-input';
13
- import Switch from '@opentinyvue/vue-switch';
14
-
15
- function getDefaultExportFromCjs(x) {
16
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
17
- }
18
-
19
- var helper;
20
- var hasRequiredHelper;
21
- function requireHelper() {
22
- if (hasRequiredHelper) return helper;
23
- hasRequiredHelper = 1;
24
- function _extends() {
25
- return _extends = Object.assign ? Object.assign.bind() : function(a) {
26
- for (var b, c = 1; c < arguments.length; c++) for (var d in b = arguments[c], b) Object.prototype.hasOwnProperty.call(b, d) && (a[d] = b[d]);
27
- return a;
28
- }, _extends.apply(this, arguments);
29
- }
30
- var normalMerge = ["attrs", "props", "domProps"], toArrayMerge = ["class", "style", "directives"], functionalMerge = ["on", "nativeOn"], mergeJsxProps = function mergeJsxProps2(a) {
31
- return a.reduce(function(c, a2) {
32
- for (var b in a2) if (!c[b]) c[b] = a2[b];
33
- else if (-1 !== normalMerge.indexOf(b)) c[b] = _extends({}, c[b], a2[b]);
34
- else if (-1 !== toArrayMerge.indexOf(b)) {
35
- var d = c[b] instanceof Array ? c[b] : [c[b]], e = a2[b] instanceof Array ? a2[b] : [a2[b]];
36
- c[b] = [].concat(d, e);
37
- } else if (-1 !== functionalMerge.indexOf(b)) {
38
- for (var f in a2[b]) if (c[b][f]) {
39
- var g = c[b][f] instanceof Array ? c[b][f] : [c[b][f]], h = a2[b][f] instanceof Array ? a2[b][f] : [a2[b][f]];
40
- c[b][f] = [].concat(g, h);
41
- } else c[b][f] = a2[b][f];
42
- } else if ("hook" === b) for (var i in a2[b]) c[b][i] = c[b][i] ? mergeFn(c[b][i], a2[b][i]) : a2[b][i];
43
- else c[b] = a2[b];
44
- return c;
45
- }, {});
46
- }, mergeFn = function mergeFn2(a, b) {
47
- return function() {
48
- a && a.apply(this, arguments), b && b.apply(this, arguments);
49
- };
50
- };
51
- helper = mergeJsxProps;
52
- return helper;
53
- }
54
- var helperExports = requireHelper();
55
- var _mergeJSXProps5 = /* @__PURE__ */ getDefaultExportFromCjs(helperExports);
56
-
57
- function normalizeComponent(scriptExports, render, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) {
58
- var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports;
59
- if (render) {
60
- options.render = render;
61
- options.staticRenderFns = staticRenderFns;
62
- options._compiled = true;
63
- }
64
- var hook;
65
- if (injectStyles) {
66
- hook = injectStyles;
67
- }
68
- if (hook) {
69
- if (options.functional) {
70
- options._injectStyles = hook;
71
- var originalRender = options.render;
72
- options.render = function renderWithStyleInjection(h, context) {
73
- hook.call(context);
74
- return originalRender(h, context);
75
- };
76
- } else {
77
- var existing = options.beforeCreate;
78
- options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
79
- }
80
- }
81
- return {
82
- exports: scriptExports,
83
- options
84
- };
85
- }
86
-
87
1
  function _extends() {
88
2
  return _extends = Object.assign ? Object.assign.bind() : function(n) {
89
3
  for (var e = 1; e < arguments.length; e++) {
@@ -93,12 +7,29 @@ function _extends() {
93
7
  return n;
94
8
  }, _extends.apply(null, arguments);
95
9
  }
96
- var __vue2_script = defineComponent({
10
+ import { createVNode, createTextVNode, mergeProps, isVNode, resolveComponent } from "vue";
11
+ import { renderless, api } from "@opentinyvue/vue-renderless/file-upload/vue";
12
+ import { defineComponent, props, setup as _setup, h, isVue3 } from "@opentinyvue/vue-common";
13
+ import UploadList from "@opentinyvue/vue-upload-list";
14
+ import Upload from "@opentinyvue/vue-upload";
15
+ import Progress from "@opentinyvue/vue-progress";
16
+ import Modal from "@opentinyvue/vue-modal";
17
+ import DialogBox from "@opentinyvue/vue-dialog-box";
18
+ import Tooltip from "@opentinyvue/vue-tooltip";
19
+ import { IconAttachment, IconSuccessful, IconClose, IconDownload, IconFileCloudupload, IconPlus, IconPlusCircle, IconPicture, IconMic, IconStartCircle, IconHelpQuery } from "@opentinyvue/vue-icon";
20
+ import Streamsaver from "streamsaver";
21
+ import Button from "@opentinyvue/vue-button";
22
+ import Input from "@opentinyvue/vue-input";
23
+ import Switch from "@opentinyvue/vue-switch";
24
+ function _isSlot(s) {
25
+ return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
26
+ }
27
+ var _sfc_main = /* @__PURE__ */ defineComponent({
97
28
  inheritAttrs: false,
98
29
  emits: ["change", "hash-progress", "error", "progress", "success", "remove", "download", "trigger-click", "click-file-list"],
99
30
  props: [].concat(props, ["edm", "action", "headers", "data", "multiple", "name", "drag", "dragger", "withCredentials", "showFileList", "accept", "type", "beforeUpload", "beforeRemove", "fileList", "autoUpload", "listType", "httpRequest", "disabled", "limit", "openDownloadFile", "mergeService", "fileSize", "thumbOption", "isFolderTitle", "listOption", "maxNameLength", "scale", "showName", "sourceType", "showTitle", "title", "displayOnly", "customClass", "hwh5", "mode", "cacheToken", "lockScroll", "compact", "encryptConfig", "imageBgColor", "promptTip"]),
100
- setup: function setup$1(props2, context) {
101
- return setup({
31
+ setup: function setup(props2, context) {
32
+ return _setup({
102
33
  props: props2,
103
34
  context,
104
35
  renderless,
@@ -131,7 +62,6 @@ var __vue2_script = defineComponent({
131
62
  },
132
63
  render: function render() {
133
64
  var _this = this;
134
- var h = arguments[0];
135
65
  var _this$state$listeners = this.state.listeners, _this$state$listeners2 = _this$state$listeners.exceed, exceed = _this$state$listeners2 === void 0 ? function() {
136
66
  } : _this$state$listeners2, _this$state$listeners3 = _this$state$listeners.preview, preview = _this$state$listeners3 === void 0 ? void 0 : _this$state$listeners3, downloadFile = _this$state$listeners["download-file"], downloadAll = _this$state$listeners["download-all"], reUpload = _this$state$listeners["re-upload"], triggerClick = _this$state$listeners["trigger-click"], play = _this$state$listeners.play;
137
67
  var _this$state = this.state, uploadFiles = _this$state.uploadFiles, isEdm = _this$state.isEdm, dialogConfigObj = _this$state.dialogConfigObj, isSuccess = _this$state.isSuccess, uploadDisabled = _this$state.uploadDisabled, url = _this$state.url, accept = _this$state.accept, httpRequest = _this$state.httpRequest, edmToken = _this$state.edmToken, iframeUrl = _this$state.iframeUrl, isDragover = _this$state.isDragover, selected = _this$state.selected, types = _this$state.types, isHwh5 = _this$state.isHwh5;
@@ -145,7 +75,7 @@ var __vue2_script = defineComponent({
145
75
  var listType2 = _ref.listType, title2 = _ref.title, showTitle2 = _ref.showTitle, _ref$isInside = _ref.isInside, isInside = _ref$isInside === void 0 ? false : _ref$isInside, _ref$displayOnly = _ref.displayOnly, displayOnly2 = _ref$displayOnly === void 0 ? false : _ref$displayOnly, mode2 = _ref.mode;
146
76
  var defaultTitle;
147
77
  if (isInside) {
148
- defaultTitle = h("span", {
78
+ defaultTitle = createVNode("span", {
149
79
  "class": showTitle2 ? "inline-block mr-1 text-sm text-color-text-primary font-bold" : "hidden"
150
80
  }, [title2]);
151
81
  } else {
@@ -157,9 +87,9 @@ var __vue2_script = defineComponent({
157
87
  } else {
158
88
  !displayOnly2 || !showTitle2 ? cls += "hidden" : cls += "mt-4 mb-2";
159
89
  }
160
- defaultTitle = mode2 !== "bubble" ? h("div", {
90
+ defaultTitle = mode2 !== "bubble" ? createVNode("div", {
161
91
  "class": cls
162
- }, [h("span", {
92
+ }, [createVNode("span", {
163
93
  "class": "mr-1"
164
94
  }, [title2]), displayOnly2 && getDisplayOnlyTip({
165
95
  isEdm,
@@ -180,34 +110,34 @@ var __vue2_script = defineComponent({
180
110
  bubbling: true
181
111
  };
182
112
  if (listType2 === "text") {
183
- defaultTip = h("div", {
113
+ defaultTip = createVNode("div", {
184
114
  "class": "inline-block w-full sm:pl-4 text-color-none"
185
- }, [h("div", {
115
+ }, [createVNode("div", {
186
116
  "class": "block sm:hidden"
187
117
  }, [getDefaultTitle({
188
118
  listType: listType2,
189
119
  title: title2,
190
120
  showTitle: showTitle2,
191
121
  isInside: true
192
- }), h("tiny-tooltip", {
193
- "attrs": {
194
- "effect": "dark",
195
- "content": tipMsg,
196
- "placement": "top",
197
- "popper-options": popperConfig
122
+ }), createVNode(resolveComponent("tiny-tooltip"), {
123
+ "effect": "dark",
124
+ "content": tipMsg,
125
+ "placement": "top",
126
+ "popper-options": popperConfig
127
+ }, {
128
+ default: function _default() {
129
+ return [createVNode(resolveComponent("icon-help-query"), {
130
+ "class": "-mt-0.5 fill-color-none-hover"
131
+ }, null)];
198
132
  }
199
- }, [h("icon-help-query", {
200
- "class": "-mt-0.5 fill-color-none-hover"
201
- })])])]);
133
+ })])]);
202
134
  } else if (listType2 === "drag-single") {
203
- defaultTip = h("div", {
204
- "attrs": {
205
- "title": tipMsg
206
- },
135
+ defaultTip = createVNode("div", {
136
+ "title": tipMsg,
207
137
  "class": "leading-5 text-color-text-primary overflow-hidden text-ellipsis whitespace-nowrap"
208
138
  }, [slots2.tip && slots2.tip() || tipMsg]);
209
139
  } else {
210
- defaultTip = slots2.tip ? h("div", {
140
+ defaultTip = slots2.tip ? createVNode("div", {
211
141
  "class": "mb-4 text-color-none"
212
142
  }, [slots2.tip()]) : null;
213
143
  }
@@ -218,67 +148,69 @@ var __vue2_script = defineComponent({
218
148
  var popperConfig = {
219
149
  bubbling: true
220
150
  };
221
- return h("tiny-tooltip", {
151
+ return createVNode(resolveComponent("tiny-tooltip"), {
222
152
  "class": "inline-block sm:hidden",
223
- "attrs": {
224
- "effect": "dark",
225
- "content": _this.getTipMessage({
226
- accept: isEdm2 ? accept : _this.accept,
227
- fileSize: fileSize2,
228
- limit: _this.limit
229
- }),
230
- "placement": "top",
231
- "popper-options": popperConfig
153
+ "effect": "dark",
154
+ "content": _this.getTipMessage({
155
+ accept: isEdm2 ? accept : _this.accept,
156
+ fileSize: fileSize2,
157
+ limit: _this.limit
158
+ }),
159
+ "placement": "top",
160
+ "popper-options": popperConfig
161
+ }, {
162
+ default: function _default() {
163
+ return [createVNode(resolveComponent("icon-help-query"), {
164
+ "class": "-mt-0.5 fill-color-none-hover"
165
+ }, null)];
232
166
  }
233
- }, [h("icon-help-query", {
234
- "class": "-mt-0.5 fill-color-none-hover"
235
- })]);
167
+ });
236
168
  };
237
169
  var getTriggerContent = function getTriggerContent2(_ref4) {
238
170
  var listType2 = _ref4.listType, t2 = _ref4.t, type2 = _ref4.type, disabled = _ref4.disabled;
239
171
  var defaultList = {
240
- "picture": h("div", [h("icon-picture", {
172
+ "picture": createVNode("div", null, [createVNode(resolveComponent("icon-picture"), {
241
173
  "class": "w-6 h-6 fill-color-icon-secondary"
242
- }), h("div", {
174
+ }, null), createVNode("div", {
243
175
  "class": "mt-1 sm:mt-2 text-color-text-secondary text-xs"
244
176
  }, [t2("ui.upload.addPicture")])]),
245
- "audio": h("div", [h("icon-mic", {
177
+ "audio": createVNode("div", null, [createVNode(resolveComponent("icon-mic"), {
246
178
  "class": "w-6 h-6 fill-color-icon-secondary"
247
- }), h("div", {
179
+ }, null), createVNode("div", {
248
180
  "class": "mt-1 sm:mt-2 text-color-text-secondary text-xs"
249
181
  }, [t2("ui.upload.addAudio")])]),
250
- "video": h("div", [h("icon-start-circle", {
182
+ "video": createVNode("div", null, [createVNode(resolveComponent("icon-start-circle"), {
251
183
  "class": "w-6 h-6 fill-color-icon-secondary"
252
- }), h("div", {
184
+ }, null), createVNode("div", {
253
185
  "class": "mt-1 sm:mt-2 text-color-text-secondary text-xs"
254
186
  }, [t2("ui.upload.addVideo")])])
255
187
  };
256
188
  var defaultContent;
257
189
  if (listType2 === "text") {
258
- defaultContent = h("div", {
190
+ defaultContent = createVNode("div", {
259
191
  "class": "inline-block"
260
- }, [h("tiny-button", {
261
- "attrs": {
262
- "disabled": disabled
263
- },
192
+ }, [createVNode(resolveComponent("tiny-button"), {
193
+ "disabled": disabled,
264
194
  "class": "hidden sm:block"
265
- }, [h("div", {
266
- "class": "flex items-center"
267
- }, [h("icon-plus"), h("span", {
268
- "class": "ml-2"
269
- }, [t2("ui.fileUpload.uploadFile")])])]), h("icon-plus-circle", {
270
- "attrs": {
271
- "custom-class": "sm:hidden w-5 h-5"
195
+ }, {
196
+ default: function _default() {
197
+ return [createVNode("div", {
198
+ "class": "flex items-center"
199
+ }, [createVNode(resolveComponent("icon-plus"), null, null), createVNode("span", {
200
+ "class": "ml-2"
201
+ }, [t2("ui.fileUpload.uploadFile")])])];
272
202
  }
273
- })]);
203
+ }), createVNode(resolveComponent("icon-plus-circle"), {
204
+ "custom-class": "sm:hidden w-5 h-5"
205
+ }, null)]);
274
206
  } else if (listType2 === "drag-single") {
275
207
  defaultContent = null;
276
208
  } else {
277
209
  var defaultClass = "relative h-full border border-dashed border-color-border rounded bg-color-bg-2 align-top hover:cursor-pointer";
278
210
  listType2 === "picture-single" && uploadFiles.length && (defaultClass += " hidden");
279
- defaultContent = h("div", {
211
+ defaultContent = createVNode("div", {
280
212
  "class": defaultClass
281
- }, [h("div", {
213
+ }, [createVNode("div", {
282
214
  "class": "absolute w-full top-1/2 left-0 -translate-y-1/2 z-[1] text-center"
283
215
  }, [defaultList[type2 || "picture"]])]);
284
216
  }
@@ -288,20 +220,22 @@ var __vue2_script = defineComponent({
288
220
  var listType2 = _ref5.listType, downloadAll2 = _ref5.downloadAll, uploadFiles2 = _ref5.uploadFiles, t2 = _ref5.t;
289
221
  var operateContent;
290
222
  if (listType2 === "text") {
291
- operateContent = downloadAll2 ? h("div", {
223
+ operateContent = downloadAll2 ? createVNode("div", {
292
224
  "class": "hidden sm:inline-block align-middle"
293
- }, [h("tiny-button", {
225
+ }, [createVNode(resolveComponent("tiny-button"), {
294
226
  "class": "ml-2",
295
- "on": {
296
- "click": function click() {
297
- return downloadAll2(uploadFiles2);
298
- }
227
+ "onClick": function onClick() {
228
+ return downloadAll2(uploadFiles2);
229
+ }
230
+ }, {
231
+ default: function _default() {
232
+ return [createVNode("div", {
233
+ "class": "flex items-center"
234
+ }, [createVNode(resolveComponent("icon-download"), null, null), createVNode("span", {
235
+ "class": "ml-2"
236
+ }, [t2("ui.fileUpload.downloadAll")])])];
299
237
  }
300
- }, [h("div", {
301
- "class": "flex items-center"
302
- }, [h("icon-download"), h("span", {
303
- "class": "ml-2"
304
- }, [t2("ui.fileUpload.downloadAll")])])])]) : null;
238
+ })]) : null;
305
239
  }
306
240
  return operateContent;
307
241
  };
@@ -509,20 +443,18 @@ var __vue2_script = defineComponent({
509
443
  }, dialogConfigObj, {
510
444
  scopedSlots: {
511
445
  default: function _default() {
512
- return h("iframe", {
513
- "attrs": {
514
- "id": "_iframe",
515
- "allowfullscreen": true,
516
- "allowtransparency": "true",
517
- "frameborder": "0",
518
- "border": "0",
519
- "marginwidth": "0",
520
- "marginheight": "0",
521
- "scrolling": "no",
522
- "src": iframeUrl
523
- },
524
- "style": "display: block;width: 100%;height: 500px;display: inline-block;"
525
- });
446
+ return createVNode("iframe", {
447
+ "id": "_iframe",
448
+ "style": "display: block;width: 100%;height: 500px;display: inline-block;",
449
+ "allowfullscreen": true,
450
+ "allowtransparency": "true",
451
+ "frameborder": "0",
452
+ "border": "0",
453
+ "marginwidth": "0",
454
+ "marginheight": "0",
455
+ "scrolling": "no",
456
+ "src": iframeUrl
457
+ }, null);
526
458
  }
527
459
  }
528
460
  }));
@@ -548,55 +480,50 @@ var __vue2_script = defineComponent({
548
480
  },
549
481
  scopedSlots: {
550
482
  default: function _default() {
551
- return h("div", {
552
- "attrs": {
553
- "data-tag": "encrypt-config-dialog-body"
483
+ return createVNode("div", {
484
+ "data-tag": "encrypt-config-dialog-body"
485
+ }, [createVNode("div", null, [_this.t("ui.fileUpload.addWatermark")]), createVNode("div", null, [createVNode(Input, {
486
+ "modelValue": _this.encryptConfig.watermark,
487
+ "onUpdate:modelValue": function onUpdateModelValue($event) {
488
+ return _this.encryptConfig.watermark = $event;
554
489
  }
555
- }, [h("div", [_this.t("ui.fileUpload.addWatermark")]), h("div", [h(Input, {
556
- "model": {
557
- value: _this.encryptConfig.watermark,
558
- callback: function callback($$v) {
559
- _this.$set(_this.encryptConfig, "watermark", $$v);
560
- }
490
+ }, null)]), createVNode("p", null, [createTextVNode(" ")]), createVNode("div", null, [_this.t("ui.fileUpload.encrypted")]), createVNode("div", null, [createVNode(Switch, {
491
+ "modelValue": _this.encryptConfig.encrypt,
492
+ "onUpdate:modelValue": function onUpdateModelValue($event) {
493
+ return _this.encryptConfig.encrypt = $event;
561
494
  }
562
- })]), h("p", [" "]), h("div", [_this.t("ui.fileUpload.encrypted")]), h("div", [h(Switch, {
563
- "model": {
564
- value: _this.encryptConfig.encrypt,
565
- callback: function callback($$v) {
566
- _this.$set(_this.encryptConfig, "encrypt", $$v);
567
- }
568
- }
569
- })])]);
495
+ }, null)])]);
570
496
  },
571
497
  footer: function footer() {
572
- return [h(Button, {
573
- "on": {
574
- "click": function click() {
575
- return _this.state.encryptDialogConfig.show = false;
576
- }
498
+ var _slot, _slot2;
499
+ return [createVNode(Button, {
500
+ "onClick": function onClick() {
501
+ return _this.state.encryptDialogConfig.show = false;
502
+ }
503
+ }, _isSlot(_slot = _this.t("ui.base.cancel")) ? _slot : {
504
+ default: function _default() {
505
+ return [_slot];
577
506
  }
578
- }, [_this.t("ui.base.cancel")]), [h(Button, {
579
- "attrs": {
580
- "type": "primary",
581
- "customClass": "ml-2"
582
- },
583
- "on": {
584
- "click": function click() {
585
- return encryptDialogConfirm();
586
- }
507
+ }), [createVNode(Button, {
508
+ "type": "primary",
509
+ "customClass": "ml-2",
510
+ "onClick": function onClick() {
511
+ return encryptDialogConfirm();
587
512
  }
588
- }, [_this.t("ui.popupload.uploadButtonText")])]];
513
+ }, _isSlot(_slot2 = _this.t("ui.popupload.uploadButtonText")) ? _slot2 : {
514
+ default: function _default() {
515
+ return [_slot2];
516
+ }
517
+ })]];
589
518
  }
590
519
  }
591
520
  });
592
521
  }
593
522
  var attrs = a($attrs, ["^on[A-Z]"]);
594
- return h("div", _mergeJSXProps5([{}, attrs, {
595
- "attrs": {
596
- "data-tag": "tiny-file-upload"
597
- },
523
+ return createVNode("div", mergeProps(attrs, {
524
+ "data-tag": "tiny-file-upload",
598
525
  "class": isDragSingle ? "relative inline-block" : ""
599
- }]), [getDefaultTitle({
526
+ }), [getDefaultTitle({
600
527
  listType,
601
528
  title,
602
529
  showTitle,
@@ -605,16 +532,6 @@ var __vue2_script = defineComponent({
605
532
  }), noticePC, isText && !displayOnly ? slots.trigger ? [createUploadComponent()] : createUploadComponent() : null, noticeMF, uploadList, previewComponent, encryptDialogComponent]);
606
533
  }
607
534
  });
608
- var __vue2_render, __vue2_staticRenderFns;
609
- var __cssModules = {};
610
- var __component__ = /* @__PURE__ */ normalizeComponent(__vue2_script, __vue2_render, __vue2_staticRenderFns, false, __vue2_injectStyles);
611
- function __vue2_injectStyles(context) {
612
- for (var o in __cssModules) {
613
- this[o] = __cssModules[o];
614
- }
615
- }
616
- var mobileFirst = /* @__PURE__ */ function() {
617
- return __component__.exports;
618
- }();
619
-
620
- export { mobileFirst as default };
535
+ export {
536
+ _sfc_main as default
537
+ };
package/lib/mobile.js CHANGED
@@ -1,45 +1,3 @@
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
1
  function _extends() {
44
2
  return _extends = Object.assign ? Object.assign.bind() : function(n) {
45
3
  for (var e = 1; e < arguments.length; e++) {
@@ -49,11 +7,23 @@ function _extends() {
49
7
  return n;
50
8
  }, _extends.apply(null, arguments);
51
9
  }
52
- var __vue2_script = defineComponent({
10
+ import { createVNode, createTextVNode, resolveComponent } from "vue";
11
+ import { renderless, api } from "@opentinyvue/vue-renderless/file-upload/vue";
12
+ import { defineComponent, props, setup as _setup, h } from "@opentinyvue/vue-common";
13
+ import UploadList from "@opentinyvue/vue-upload-list";
14
+ import Upload from "@opentinyvue/vue-upload";
15
+ import Progress from "@opentinyvue/vue-progress";
16
+ import Modal from "@opentinyvue/vue-modal";
17
+ import { iconUpload } from "@opentinyvue/vue-icon";
18
+ import "@opentinyvue/vue-theme-mobile/file-upload/index.css";
19
+ import "@opentinyvue/vue-theme-mobile/upload-list/index.css";
20
+ import "@opentinyvue/vue-theme-mobile/upload-dragger/index.css";
21
+ import "@opentinyvue/vue-theme-mobile/upload/index.css";
22
+ var _sfc_main = /* @__PURE__ */ defineComponent({
53
23
  inheritAttrs: false,
54
24
  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({
25
+ setup: function setup(props2, context) {
26
+ return _setup({
57
27
  props: props2,
58
28
  context,
59
29
  renderless,
@@ -71,7 +41,6 @@ var __vue2_script = defineComponent({
71
41
  },
72
42
  render: function render() {
73
43
  var _this = this;
74
- var h = arguments[0];
75
44
  var _this$state$listeners = this.state.listeners, _this$state$listeners2 = _this$state$listeners.exceed, exceed = _this$state$listeners2 === void 0 ? function() {
76
45
  } : _this$state$listeners2, _this$state$listeners3 = _this$state$listeners.preview, preview = _this$state$listeners3 === void 0 ? function() {
77
46
  } : _this$state$listeners3;
@@ -140,21 +109,21 @@ var __vue2_script = defineComponent({
140
109
  };
141
110
  var trigger = this.slots.trigger && this.slots.trigger() || this.slots.default();
142
111
  var uploadComponent = !headerShow || this.listType === "picture-card" ? h(Upload, _extends({}, uploadData), trigger) : "";
143
- var header = h("div", {
112
+ var header = createVNode("div", {
144
113
  "class": "tiny-mobile-file-upload__header"
145
- }, [h("div", {
114
+ }, [createVNode("div", {
146
115
  "class": "tiny-mobile-file-upload__header-title"
147
- }, [fileTitle]), h("div", {
116
+ }, [fileTitle]), createVNode("div", {
148
117
  "class": "tiny-mobile-file-upload__header-upload"
149
- }, [successStatistics ? h("span", {
118
+ }, [successStatistics ? createVNode("span", {
150
119
  "class": "upload-status"
151
- }, [successNum, "/", uploaArr.length]) : "", this.listType !== "picture-card" && uploadIcon ? h("span", {
120
+ }, [successNum, createTextVNode("/"), uploaArr.length]) : "", this.listType !== "picture-card" && uploadIcon ? createVNode("span", {
152
121
  "class": "upload-icon"
153
- }, [h(Upload, _extends({}, uploadData), trigger || h("icon-upload"))]) : ""])]);
154
- return h("div", {
122
+ }, [h(Upload, _extends({}, uploadData), trigger || createVNode(resolveComponent("icon-upload"), null, null))]) : ""])]);
123
+ return createVNode("div", {
155
124
  "class": ["tiny-mobile-file-upload", this.$attrs.class],
156
125
  "ref": "fileUpload"
157
- }, [headerShow ? header : "", h("div", {
126
+ }, [headerShow ? header : "", createVNode("div", {
158
127
  "class": {
159
128
  "tiny-mobile-file-upload__wrap": true,
160
129
  "is-card": this.listType === "picture-card"
@@ -162,16 +131,6 @@ var __vue2_script = defineComponent({
162
131
  }, [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
132
  }
164
133
  });
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 };
134
+ export {
135
+ _sfc_main as default
136
+ };