iov-design 2.15.46 → 2.15.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. package/lib/alert.js +2 -2
  2. package/lib/aside.js +2 -2
  3. package/lib/autocomplete.js +2 -2
  4. package/lib/avatar.js +2 -2
  5. package/lib/backtop.js +2 -2
  6. package/lib/badge.js +2 -2
  7. package/lib/breadcrumb-item.js +2 -2
  8. package/lib/breadcrumb.js +2 -2
  9. package/lib/button-group.js +2 -2
  10. package/lib/button.js +2 -2
  11. package/lib/calendar.js +4 -4
  12. package/lib/card.js +2 -2
  13. package/lib/carousel-item.js +2 -2
  14. package/lib/carousel.js +16 -16
  15. package/lib/cascader-panel.js +6 -6
  16. package/lib/cascader.js +96 -96
  17. package/lib/checkbox-button.js +2 -2
  18. package/lib/checkbox-group.js +2 -2
  19. package/lib/checkbox.js +2 -2
  20. package/lib/col.js +2 -2
  21. package/lib/collapse-item.js +23 -23
  22. package/lib/collapse.js +2 -2
  23. package/lib/color-picker.js +2 -2
  24. package/lib/container.js +2 -2
  25. package/lib/date-picker.js +70 -91
  26. package/lib/descriptions-item.js +2 -2
  27. package/lib/descriptions.js +2 -2
  28. package/lib/dialog.js +9 -9
  29. package/lib/divider.js +2 -2
  30. package/lib/dropdown-item.js +2 -2
  31. package/lib/dropdown-menu.js +2 -2
  32. package/lib/dropdown.js +11 -11
  33. package/lib/empty.js +9 -9
  34. package/lib/footer.js +2 -2
  35. package/lib/form-item.js +4 -4
  36. package/lib/form.js +2 -2
  37. package/lib/header.js +2 -2
  38. package/lib/icon.js +2 -2
  39. package/lib/image.js +9 -9
  40. package/lib/index.js +1 -1
  41. package/lib/infinite-scroll.js +2 -2
  42. package/lib/input-number.js +62 -62
  43. package/lib/iov-design.common.js +968 -163
  44. package/lib/link.js +2 -2
  45. package/lib/loading.js +11 -11
  46. package/lib/main.js +2 -2
  47. package/lib/menu-item-group.js +2 -2
  48. package/lib/menu-item.js +65 -65
  49. package/lib/menu.js +2 -2
  50. package/lib/message-box.js +11 -11
  51. package/lib/message.js +9 -9
  52. package/lib/notification.js +9 -9
  53. package/lib/option-group.js +2 -2
  54. package/lib/option.js +4 -4
  55. package/lib/page-header.js +2 -2
  56. package/lib/pagination.js +6 -6
  57. package/lib/popconfirm.js +24 -24
  58. package/lib/popover.js +9 -9
  59. package/lib/progress.js +2 -2
  60. package/lib/radio-button.js +2 -2
  61. package/lib/radio-group.js +2 -2
  62. package/lib/radio.js +9 -9
  63. package/lib/rate.js +23 -23
  64. package/lib/result.js +2 -2
  65. package/lib/row.js +2 -2
  66. package/lib/scrollbar.js +4 -4
  67. package/lib/select.js +18 -18
  68. package/lib/skeleton-item.js +2 -2
  69. package/lib/skeleton.js +2 -2
  70. package/lib/slider.js +4 -4
  71. package/lib/spinner.js +2 -2
  72. package/lib/static/excel.dc22a8c4.png +1 -0
  73. package/lib/static/excel.f44318e.png +0 -0
  74. package/lib/static/excel.f44318e0.png +0 -0
  75. package/lib/static/file.4ed3551.png +0 -0
  76. package/lib/static/file.4ed35511.png +0 -0
  77. package/lib/static/file.c0509952.png +1 -0
  78. package/lib/static/img.8229bb3e.png +1 -0
  79. package/lib/static/img.cd179e5.png +0 -0
  80. package/lib/static/img.cd179e5b.png +0 -0
  81. package/lib/static/pdf.79cb57f.png +0 -0
  82. package/lib/static/pdf.79cb57f8.png +0 -0
  83. package/lib/static/pdf.f5235ea1.png +1 -0
  84. package/lib/static/ppt.5eedddef.png +1 -0
  85. package/lib/static/ppt.eed4918.png +0 -0
  86. package/lib/static/ppt.eed4918e.png +0 -0
  87. package/lib/static/word.35070ef.png +0 -0
  88. package/lib/static/word.35070ef0.png +0 -0
  89. package/lib/static/word.5fe9189c.png +1 -0
  90. package/lib/static/zip.dca21a8.png +0 -0
  91. package/lib/static/zip.dca21a88.png +0 -0
  92. package/lib/static/zip.e2bfc796.png +1 -0
  93. package/lib/statistic.js +4 -4
  94. package/lib/step.js +2 -2
  95. package/lib/steps.js +9 -9
  96. package/lib/submenu.js +4 -4
  97. package/lib/switch.js +2 -2
  98. package/lib/tab-pane.js +2 -2
  99. package/lib/table-column.js +2 -2
  100. package/lib/table.js +23 -15
  101. package/lib/tabs.js +2 -2
  102. package/lib/tag.js +2 -2
  103. package/lib/theme-chalk/assets/img_fail.png +0 -0
  104. package/lib/theme-chalk/assets/img_placeholder.png +0 -0
  105. package/lib/theme-chalk/base.css +1 -1
  106. package/lib/theme-chalk/dialog.css +1 -1
  107. package/lib/theme-chalk/index.css +1 -1
  108. package/lib/theme-chalk/iovfont.css +1 -1
  109. package/lib/theme-chalk/upload.css +1 -1
  110. package/lib/time-picker.js +12 -12
  111. package/lib/time-select.js +9 -9
  112. package/lib/timeline-item.js +2 -2
  113. package/lib/timeline.js +2 -2
  114. package/lib/tooltip.js +2 -2
  115. package/lib/transfer.js +11 -11
  116. package/lib/tree.js +2 -2
  117. package/lib/upload.js +920 -119
  118. package/package.json +1 -1
  119. package/packages/theme-chalk/src/assets/img_fail.png +0 -0
  120. package/packages/theme-chalk/src/assets/img_placeholder.png +0 -0
  121. package/packages/theme-chalk/src/dialog.scss +4 -0
  122. package/packages/theme-chalk/src/iovfont.scss +3 -3
  123. package/packages/theme-chalk/src/upload.scss +568 -603
  124. package/packages/upload/src/assets/excel.png +0 -0
  125. package/packages/upload/src/assets/file.png +0 -0
  126. package/packages/upload/src/assets/img.png +0 -0
  127. package/packages/upload/src/assets/pdf.png +0 -0
  128. package/packages/upload/src/assets/ppt.png +0 -0
  129. package/packages/upload/src/assets/word.png +0 -0
  130. package/packages/upload/src/assets/zip.png +0 -0
  131. package/packages/upload/src/index.vue +73 -5
  132. package/packages/upload/src/upload-file.vue +90 -0
  133. package/packages/upload/src/upload-list.vue +52 -50
  134. package/packages/upload/src/upload-picture.vue +90 -0
  135. package/packages/upload/src/upload.vue +231 -211
  136. package/packages/upload/src/utils.js +30 -0
  137. package/src/index.js +1 -1
package/lib/upload.js CHANGED
@@ -82,7 +82,7 @@ module.exports =
82
82
  /******/
83
83
  /******/
84
84
  /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 60);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 65);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -203,14 +203,63 @@ module.exports = require("babel-helper-vue-jsx-merge-props");
203
203
 
204
204
  /***/ }),
205
205
 
206
- /***/ 44:
206
+ /***/ 33:
207
207
  /***/ (function(module, exports) {
208
208
 
209
209
  module.exports = require("iov-design/lib/progress");
210
210
 
211
211
  /***/ }),
212
212
 
213
+ /***/ 45:
214
+ /***/ (function(module, exports, __webpack_require__) {
215
+
216
+ module.exports = __webpack_require__.p + "static/zip.e2bfc796.png";
217
+
218
+ /***/ }),
219
+
220
+ /***/ 57:
221
+ /***/ (function(module, exports, __webpack_require__) {
222
+
223
+ module.exports = __webpack_require__.p + "static/img.8229bb3e.png";
224
+
225
+ /***/ }),
226
+
227
+ /***/ 58:
228
+ /***/ (function(module, exports, __webpack_require__) {
229
+
230
+ module.exports = __webpack_require__.p + "static/pdf.f5235ea1.png";
231
+
232
+ /***/ }),
233
+
234
+ /***/ 59:
235
+ /***/ (function(module, exports, __webpack_require__) {
236
+
237
+ module.exports = __webpack_require__.p + "static/excel.dc22a8c4.png";
238
+
239
+ /***/ }),
240
+
213
241
  /***/ 60:
242
+ /***/ (function(module, exports, __webpack_require__) {
243
+
244
+ module.exports = __webpack_require__.p + "static/ppt.5eedddef.png";
245
+
246
+ /***/ }),
247
+
248
+ /***/ 61:
249
+ /***/ (function(module, exports, __webpack_require__) {
250
+
251
+ module.exports = __webpack_require__.p + "static/word.5fe9189c.png";
252
+
253
+ /***/ }),
254
+
255
+ /***/ 62:
256
+ /***/ (function(module, exports, __webpack_require__) {
257
+
258
+ module.exports = __webpack_require__.p + "static/file.c0509952.png";
259
+
260
+ /***/ }),
261
+
262
+ /***/ 65:
214
263
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
215
264
 
216
265
  "use strict";
@@ -222,7 +271,7 @@ var upload_listvue_type_template_id_173fedf5_render = function() {
222
271
  var _h = _vm.$createElement
223
272
  var _c = _vm._self._c || _h
224
273
  return _c(
225
- "transition-group",
274
+ "ul",
226
275
  {
227
276
  class: [
228
277
  "el-upload-list",
@@ -238,24 +287,12 @@ var upload_listvue_type_template_id_173fedf5_render = function() {
238
287
  key: file.uid,
239
288
  class: [
240
289
  "el-upload-list__item",
290
+ "el-upload-list__item-" + _vm.size,
241
291
  "is-" + file.status,
242
292
  _vm.focusing ? "focusing" : ""
243
293
  ],
244
294
  attrs: { tabindex: "0" },
245
295
  on: {
246
- keydown: function($event) {
247
- if (
248
- !("button" in $event) &&
249
- _vm._k($event.keyCode, "delete", [8, 46], $event.key, [
250
- "Backspace",
251
- "Delete",
252
- "Del"
253
- ])
254
- ) {
255
- return null
256
- }
257
- !_vm.disabled && _vm.$emit("remove", file)
258
- },
259
296
  focus: function($event) {
260
297
  _vm.focusing = true
261
298
  },
@@ -271,45 +308,120 @@ var upload_listvue_type_template_id_173fedf5_render = function() {
271
308
  _vm._t(
272
309
  "default",
273
310
  [
274
- file.status !== "uploading" &&
275
- ["picture-card", "picture"].indexOf(_vm.listType) > -1
276
- ? _c("img", {
277
- staticClass: "el-upload-list__item-thumbnail",
278
- attrs: { src: file.url, alt: "" }
279
- })
280
- : _vm._e(),
281
- _c(
282
- "a",
283
- {
284
- staticClass: "el-upload-list__item-name",
285
- on: {
286
- click: function($event) {
287
- _vm.handleClick(file)
288
- }
289
- }
290
- },
291
- [
292
- _c("i", { staticClass: "el-icon-document" }),
293
- _vm._v(_vm._s(file.name) + "\n ")
294
- ]
295
- ),
296
- _c(
297
- "label",
298
- { staticClass: "el-upload-list__item-status-label" },
299
- [
300
- _c("i", {
301
- class: {
302
- "el-icon-upload-success": true,
303
- "el-icon-circle-check": _vm.listType === "text",
304
- "el-icon-check":
305
- ["picture-card", "picture"].indexOf(_vm.listType) > -1
311
+ _c("div", { staticClass: "el-upload-list__file" }, [
312
+ _c(
313
+ "div",
314
+ {
315
+ staticClass: "el-upload-list__item-name",
316
+ on: {
317
+ click: function($event) {
318
+ _vm.handleClick(file)
319
+ }
306
320
  }
307
- })
308
- ]
309
- ),
310
- !_vm.disabled
321
+ },
322
+ [
323
+ ["picture-card", "picture"].includes(_vm.listType)
324
+ ? _c(
325
+ "span",
326
+ { staticClass: "el-upload-list__item-thumbnail" },
327
+ [
328
+ _c(
329
+ "el-image",
330
+ {
331
+ attrs: {
332
+ src: file.url,
333
+ "preview-src-list": _vm.handlePreview
334
+ ? []
335
+ : [file.url],
336
+ fit: "contain"
337
+ }
338
+ },
339
+ [
340
+ _c("i", {
341
+ staticClass: "el-image__placeholder",
342
+ attrs: { slot: "placeholder" },
343
+ slot: "placeholder"
344
+ }),
345
+ _c("i", {
346
+ staticClass: "el-image__error",
347
+ attrs: { slot: "error" },
348
+ slot: "error"
349
+ })
350
+ ]
351
+ )
352
+ ],
353
+ 1
354
+ )
355
+ : ["text"].includes(_vm.listType)
356
+ ? _c("i", {
357
+ staticClass: "el-upload-list__icon",
358
+ style: _vm.iconStyle(file.name)
359
+ })
360
+ : _vm._e(),
361
+ ["text", "picture"].includes(_vm.listType)
362
+ ? _c("div", { staticClass: "el-upload-list__name" }, [
363
+ _c("span", { staticClass: "file-name" }, [
364
+ _vm._v(_vm._s(file.name))
365
+ ])
366
+ ])
367
+ : _vm._e()
368
+ ]
369
+ ),
370
+ ["text", "picture"].includes(_vm.listType)
371
+ ? _c(
372
+ "div",
373
+ { staticClass: "el-upload-list__item-status-label" },
374
+ [
375
+ file.status === "uploading"
376
+ ? _c("el-progress", {
377
+ staticClass: "el-upload-progress",
378
+ attrs: {
379
+ percentage: file.percentage,
380
+ width: 14,
381
+ "stroke-width": 7,
382
+ "show-text": false,
383
+ type: "circle",
384
+ "stroke-linecap": "butt"
385
+ }
386
+ })
387
+ : file.status === "success"
388
+ ? _c("i", {
389
+ staticClass: "el-upload-success iov-icon-success"
390
+ })
391
+ : _vm._e()
392
+ ],
393
+ 1
394
+ )
395
+ : ["picture-card"].includes(_vm.listType) &&
396
+ file.status === "uploading"
397
+ ? _c(
398
+ "div",
399
+ { staticClass: "el-upload-list__item-status-label" },
400
+ [
401
+ _c("el-progress", {
402
+ staticClass: "el-upload-progress",
403
+ attrs: {
404
+ percentage: file.percentage,
405
+ "stroke-width": 2,
406
+ "show-text": false,
407
+ type: "line",
408
+ color: "#3F57FF",
409
+ "define-back-color": "#F2F3F5"
410
+ }
411
+ }),
412
+ _c(
413
+ "span",
414
+ { staticClass: "el-upload-progress__text" },
415
+ [_vm._v("上传中")]
416
+ )
417
+ ],
418
+ 1
419
+ )
420
+ : _vm._e()
421
+ ]),
422
+ !_vm.disabled && ["text", "picture"].includes(_vm.listType)
311
423
  ? _c("i", {
312
- staticClass: "el-icon-close",
424
+ staticClass: "iov-icon-delete",
313
425
  on: {
314
426
  click: function($event) {
315
427
  _vm.$emit("remove", file)
@@ -317,49 +429,37 @@ var upload_listvue_type_template_id_173fedf5_render = function() {
317
429
  }
318
430
  })
319
431
  : _vm._e(),
320
- !_vm.disabled
321
- ? _c("i", { staticClass: "el-icon-close-tip" }, [
322
- _vm._v(_vm._s(_vm.t("el.upload.deleteTip")))
323
- ])
324
- : _vm._e(),
325
- file.status === "uploading"
326
- ? _c("el-progress", {
327
- attrs: {
328
- type: _vm.listType === "picture-card" ? "circle" : "line",
329
- "stroke-width": _vm.listType === "picture-card" ? 6 : 2,
330
- percentage: _vm.parsePercentage(file.percentage)
331
- }
332
- })
333
- : _vm._e(),
334
- _vm.listType === "picture-card"
432
+ _vm.listType === "picture-card" && file.status === "success"
335
433
  ? _c("span", { staticClass: "el-upload-list__item-actions" }, [
336
- _vm.handlePreview && _vm.listType === "picture-card"
337
- ? _c(
338
- "span",
339
- {
340
- staticClass: "el-upload-list__item-preview",
341
- on: {
342
- click: function($event) {
343
- _vm.handlePreview(file)
344
- }
434
+ _vm.handlePreview
435
+ ? _c("i", {
436
+ staticClass:
437
+ "el-upload-list__item-preview iov-icon-eye",
438
+ on: {
439
+ click: function($event) {
440
+ $event.stopPropagation()
441
+ _vm.handlePreview(file)
345
442
  }
346
- },
347
- [_c("i", { staticClass: "el-icon-zoom-in" })]
348
- )
443
+ }
444
+ })
349
445
  : _vm._e(),
350
446
  !_vm.disabled
351
- ? _c(
352
- "span",
353
- {
354
- staticClass: "el-upload-list__item-delete",
355
- on: {
356
- click: function($event) {
357
- _vm.$emit("remove", file)
358
- }
447
+ ? _c("i", {
448
+ staticClass:
449
+ "el-upload-list__item-delete iov-icon-delete",
450
+ on: {
451
+ click: function($event) {
452
+ $event.stopPropagation()
453
+ _vm.$emit("remove", file)
359
454
  }
360
- },
361
- [_c("i", { staticClass: "el-icon-delete" })]
362
- )
455
+ }
456
+ })
457
+ : _vm._e(),
458
+ !_vm.disabled
459
+ ? _c("i", {
460
+ staticClass:
461
+ "el-upload-list__item-update iov-icon-update"
462
+ })
363
463
  : _vm._e()
364
464
  ])
365
465
  : _vm._e()
@@ -379,14 +479,56 @@ upload_listvue_type_template_id_173fedf5_render._withStripped = true
379
479
 
380
480
  // CONCATENATED MODULE: ./packages/upload/src/upload-list.vue?vue&type=template&id=173fedf5&
381
481
 
382
- // EXTERNAL MODULE: external "iov-design/lib/mixins/locale"
383
- var locale_ = __webpack_require__(7);
384
- var locale_default = /*#__PURE__*/__webpack_require__.n(locale_);
385
-
386
482
  // EXTERNAL MODULE: external "iov-design/lib/progress"
387
- var progress_ = __webpack_require__(44);
483
+ var progress_ = __webpack_require__(33);
388
484
  var progress_default = /*#__PURE__*/__webpack_require__.n(progress_);
389
485
 
486
+ // CONCATENATED MODULE: ./packages/upload/src/utils.js
487
+ var ICON_MAP = {
488
+ img: __webpack_require__(57),
489
+ pdf: __webpack_require__(58),
490
+ excel: __webpack_require__(59),
491
+ zip: __webpack_require__(45),
492
+ rar: __webpack_require__(45),
493
+ '7z': __webpack_require__(45),
494
+ ppt: __webpack_require__(60),
495
+ word: __webpack_require__(61),
496
+ default: __webpack_require__(62)
497
+ };
498
+
499
+ function iconStyle(fileName) {
500
+ var suffixMap = {
501
+ img: ['png', 'jpg', 'jpeg'],
502
+ word: ['doc', 'docx'],
503
+ excel: ['xls', 'xlsx'],
504
+ ppt: ['ppt', 'pptx']
505
+ };
506
+
507
+ var ext = fileName.split('.').pop().toLowerCase();
508
+
509
+ for (var _iterator = Object.entries(suffixMap), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
510
+ var _ref2;
511
+
512
+ if (_isArray) {
513
+ if (_i >= _iterator.length) break;
514
+ _ref2 = _iterator[_i++];
515
+ } else {
516
+ _i = _iterator.next();
517
+ if (_i.done) break;
518
+ _ref2 = _i.value;
519
+ }
520
+
521
+ var _ref = _ref2;
522
+ var key = _ref[0];
523
+ var list = _ref[1];
524
+
525
+ if (list.includes(ext)) {
526
+ return { 'background-image': 'url(' + ICON_MAP[key] + ')' };
527
+ }
528
+ }
529
+
530
+ return { 'background-image': 'url(' + (ICON_MAP[ext] || ICON_MAP.default) + ')' };
531
+ }
390
532
  // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/upload/src/upload-list.vue?vue&type=script&lang=js&
391
533
  //
392
534
  //
@@ -452,19 +594,20 @@ var progress_default = /*#__PURE__*/__webpack_require__.n(progress_);
452
594
  //
453
595
  //
454
596
  //
455
-
597
+ //
598
+ //
599
+ //
600
+ //
601
+ //
456
602
 
457
603
 
458
604
 
459
605
  /* harmony default export */ var upload_listvue_type_script_lang_js_ = ({
460
-
461
606
  name: 'ElUploadList',
462
-
463
- mixins: [locale_default.a],
464
-
465
607
  data: function data() {
466
608
  return {
467
- focusing: false
609
+ focusing: false,
610
+ iconStyle: iconStyle
468
611
  };
469
612
  },
470
613
 
@@ -481,7 +624,8 @@ var progress_default = /*#__PURE__*/__webpack_require__.n(progress_);
481
624
  type: Boolean,
482
625
  default: false
483
626
  },
484
- handlePreview: Function,
627
+ size: String,
628
+ handlePreview: null,
485
629
  listType: String
486
630
  },
487
631
  methods: {
@@ -521,6 +665,579 @@ var component = Object(componentNormalizer["a" /* default */])(
521
665
  if (false) { var api; }
522
666
  component.options.__file = "packages/upload/src/upload-list.vue"
523
667
  /* harmony default export */ var upload_list = (component.exports);
668
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/upload/src/upload-file.vue?vue&type=template&id=c998d85a&
669
+ var upload_filevue_type_template_id_c998d85a_render = function() {
670
+ var _vm = this
671
+ var _h = _vm.$createElement
672
+ var _c = _vm._self._c || _h
673
+ return _c(
674
+ "ul",
675
+ {
676
+ class: [
677
+ "el-upload-list",
678
+ "el-upload-list--" + _vm.listType,
679
+ { "is-disabled": _vm.disabled }
680
+ ]
681
+ },
682
+ _vm._l(_vm.files, function(file) {
683
+ return _c(
684
+ "li",
685
+ {
686
+ key: file.uid,
687
+ class: [
688
+ "el-upload-list__item",
689
+ "is-" + file.status,
690
+ _vm.focusing ? "focusing" : ""
691
+ ],
692
+ attrs: { tabindex: "0" },
693
+ on: {
694
+ focus: function($event) {
695
+ _vm.focusing = true
696
+ },
697
+ blur: function($event) {
698
+ _vm.focusing = false
699
+ },
700
+ click: function($event) {
701
+ _vm.focusing = false
702
+ }
703
+ }
704
+ },
705
+ [
706
+ _vm._t(
707
+ "default",
708
+ [
709
+ _c("div", { staticClass: "el-upload-list__file" }, [
710
+ file.status === "success"
711
+ ? _c(
712
+ "div",
713
+ { staticClass: "el-upload-list__item-name" },
714
+ [
715
+ ["picture-card", "picture"].includes(_vm.listType)
716
+ ? _c(
717
+ "span",
718
+ { staticClass: "el-upload-list__item-thumbnail" },
719
+ [
720
+ _c(
721
+ "el-image",
722
+ {
723
+ attrs: {
724
+ src: file.url,
725
+ "preview-src-list": [file.url],
726
+ fit: "contain"
727
+ }
728
+ },
729
+ [
730
+ _c("i", {
731
+ staticClass: "el-image__placeholder",
732
+ attrs: { slot: "placeholder" },
733
+ slot: "placeholder"
734
+ }),
735
+ _c("i", {
736
+ staticClass: "el-image__error",
737
+ attrs: { slot: "error" },
738
+ slot: "error"
739
+ })
740
+ ]
741
+ )
742
+ ],
743
+ 1
744
+ )
745
+ : ["text"].includes(_vm.listType)
746
+ ? _c("i", {
747
+ staticClass: "el-upload-list__icon",
748
+ style: _vm.iconStyle(file.name),
749
+ on: {
750
+ click: function($event) {
751
+ _vm.handleClick(file)
752
+ }
753
+ }
754
+ })
755
+ : _vm._e(),
756
+ _c(
757
+ "div",
758
+ {
759
+ staticClass: "el-upload-list__name",
760
+ on: {
761
+ click: function($event) {
762
+ _vm.handleClick(file)
763
+ }
764
+ }
765
+ },
766
+ [
767
+ _c("span", { staticClass: "file-name" }, [
768
+ _vm._v(_vm._s(file.name))
769
+ ])
770
+ ]
771
+ ),
772
+ _vm.size === "medium"
773
+ ? _c(
774
+ "el-button",
775
+ {
776
+ staticClass: "el-upload__btn",
777
+ attrs: {
778
+ slot: "trigger",
779
+ round: "",
780
+ size: "small"
781
+ },
782
+ slot: "trigger"
783
+ },
784
+ [_vm._v("重新上传")]
785
+ )
786
+ : _vm._e()
787
+ ],
788
+ 1
789
+ )
790
+ : _vm._e(),
791
+ file.status === "uploading"
792
+ ? _c(
793
+ "div",
794
+ { staticClass: "el-upload-list__item-status-label" },
795
+ [
796
+ _c("el-progress", {
797
+ staticClass: "el-upload-progress",
798
+ attrs: {
799
+ percentage: file.percentage,
800
+ "stroke-width": 2,
801
+ "show-text": false,
802
+ type: "line",
803
+ color: "#3F57FF",
804
+ "define-back-color": "#F2F3F5"
805
+ }
806
+ }),
807
+ _c(
808
+ "span",
809
+ { staticClass: "el-upload-progress__text" },
810
+ [_vm._v("文件上传中")]
811
+ )
812
+ ],
813
+ 1
814
+ )
815
+ : _vm._e()
816
+ ]),
817
+ !_vm.disabled
818
+ ? _c("i", {
819
+ staticClass: "el-upload__remove iov-icon-close-mini",
820
+ on: {
821
+ click: function($event) {
822
+ $event.stopPropagation()
823
+ _vm.$emit("remove", file)
824
+ }
825
+ }
826
+ })
827
+ : _vm._e()
828
+ ],
829
+ { file: file }
830
+ )
831
+ ],
832
+ 2
833
+ )
834
+ }),
835
+ 0
836
+ )
837
+ }
838
+ var upload_filevue_type_template_id_c998d85a_staticRenderFns = []
839
+ upload_filevue_type_template_id_c998d85a_render._withStripped = true
840
+
841
+
842
+ // CONCATENATED MODULE: ./packages/upload/src/upload-file.vue?vue&type=template&id=c998d85a&
843
+
844
+ // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/upload/src/upload-file.vue?vue&type=script&lang=js&
845
+ //
846
+ //
847
+ //
848
+ //
849
+ //
850
+ //
851
+ //
852
+ //
853
+ //
854
+ //
855
+ //
856
+ //
857
+ //
858
+ //
859
+ //
860
+ //
861
+ //
862
+ //
863
+ //
864
+ //
865
+ //
866
+ //
867
+ //
868
+ //
869
+ //
870
+ //
871
+ //
872
+ //
873
+ //
874
+ //
875
+ //
876
+ //
877
+ //
878
+ //
879
+ //
880
+ //
881
+ //
882
+ //
883
+ //
884
+ //
885
+ //
886
+ //
887
+ //
888
+ //
889
+ //
890
+ //
891
+ //
892
+ //
893
+ //
894
+ //
895
+
896
+
897
+
898
+ /* harmony default export */ var upload_filevue_type_script_lang_js_ = ({
899
+ name: 'ElUploadFile',
900
+ data: function data() {
901
+ return {
902
+ focusing: false,
903
+ iconStyle: iconStyle
904
+ };
905
+ },
906
+
907
+ components: { ElProgress: progress_default.a },
908
+
909
+ props: {
910
+ files: {
911
+ type: Array,
912
+ default: function _default() {
913
+ return [];
914
+ }
915
+ },
916
+ disabled: {
917
+ type: Boolean,
918
+ default: false
919
+ },
920
+ size: String,
921
+ width: String,
922
+ height: String,
923
+ handlePreview: Function,
924
+ listType: String
925
+ },
926
+ methods: {
927
+ parsePercentage: function parsePercentage(val) {
928
+ return parseInt(val, 10);
929
+ },
930
+ handleClick: function handleClick(file) {
931
+ this.handlePreview && this.handlePreview(file);
932
+ }
933
+ }
934
+ });
935
+ // CONCATENATED MODULE: ./packages/upload/src/upload-file.vue?vue&type=script&lang=js&
936
+ /* harmony default export */ var src_upload_filevue_type_script_lang_js_ = (upload_filevue_type_script_lang_js_);
937
+ // CONCATENATED MODULE: ./packages/upload/src/upload-file.vue
938
+
939
+
940
+
941
+
942
+
943
+ /* normalize component */
944
+
945
+ var upload_file_component = Object(componentNormalizer["a" /* default */])(
946
+ src_upload_filevue_type_script_lang_js_,
947
+ upload_filevue_type_template_id_c998d85a_render,
948
+ upload_filevue_type_template_id_c998d85a_staticRenderFns,
949
+ false,
950
+ null,
951
+ null,
952
+ null
953
+
954
+ )
955
+
956
+ /* hot reload */
957
+ if (false) { var upload_file_api; }
958
+ upload_file_component.options.__file = "packages/upload/src/upload-file.vue"
959
+ /* harmony default export */ var upload_file = (upload_file_component.exports);
960
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/upload/src/upload-picture.vue?vue&type=template&id=4be68a77&
961
+ var upload_picturevue_type_template_id_4be68a77_render = function() {
962
+ var _vm = this
963
+ var _h = _vm.$createElement
964
+ var _c = _vm._self._c || _h
965
+ return _c(
966
+ "ul",
967
+ {
968
+ class: [
969
+ "el-upload-list",
970
+ "el-upload-list--" + _vm.listType,
971
+ { "is-disabled": _vm.disabled }
972
+ ],
973
+ attrs: { tag: "ul", name: "el-list" }
974
+ },
975
+ _vm._l(_vm.files, function(file) {
976
+ return _c(
977
+ "li",
978
+ {
979
+ key: file.uid,
980
+ class: [
981
+ "el-upload-list__item",
982
+ "el-upload-list__item-" + _vm.size,
983
+ "is-" + file.status,
984
+ _vm.focusing ? "focusing" : ""
985
+ ],
986
+ attrs: { tabindex: "0" },
987
+ on: {
988
+ focus: function($event) {
989
+ _vm.focusing = true
990
+ },
991
+ blur: function($event) {
992
+ _vm.focusing = false
993
+ },
994
+ click: function($event) {
995
+ _vm.focusing = false
996
+ }
997
+ }
998
+ },
999
+ [
1000
+ _vm._t(
1001
+ "default",
1002
+ [
1003
+ _c("div", { staticClass: "el-upload-list__file" }, [
1004
+ file.status === "success"
1005
+ ? _c(
1006
+ "div",
1007
+ {
1008
+ staticClass: "el-upload-list__item-name",
1009
+ on: {
1010
+ click: function($event) {
1011
+ _vm.handleClick(file)
1012
+ }
1013
+ }
1014
+ },
1015
+ [
1016
+ _c(
1017
+ "span",
1018
+ { staticClass: "el-upload-list__item-thumbnail" },
1019
+ [
1020
+ _c(
1021
+ "el-image",
1022
+ {
1023
+ attrs: {
1024
+ src: file.url,
1025
+ "preview-src-list": _vm.handlePreview
1026
+ ? []
1027
+ : [file.url],
1028
+ fit: "contain"
1029
+ }
1030
+ },
1031
+ [
1032
+ _c("i", {
1033
+ staticClass: "el-image__placeholder",
1034
+ attrs: { slot: "placeholder" },
1035
+ slot: "placeholder"
1036
+ }),
1037
+ _c("i", {
1038
+ staticClass: "el-image__error",
1039
+ attrs: { slot: "error" },
1040
+ slot: "error"
1041
+ })
1042
+ ]
1043
+ )
1044
+ ],
1045
+ 1
1046
+ )
1047
+ ]
1048
+ )
1049
+ : _vm._e(),
1050
+ file.status === "uploading"
1051
+ ? _c(
1052
+ "div",
1053
+ { staticClass: "el-upload-list__item-status-label" },
1054
+ [
1055
+ _c("el-progress", {
1056
+ staticClass: "el-upload-progress",
1057
+ attrs: {
1058
+ percentage: file.percentage,
1059
+ "stroke-width": 2,
1060
+ "show-text": false,
1061
+ type: "line",
1062
+ color: "#3F57FF",
1063
+ "define-back-color": "#F2F3F5"
1064
+ }
1065
+ }),
1066
+ _c(
1067
+ "span",
1068
+ { staticClass: "el-upload-progress__text" },
1069
+ [_vm._v("上传中")]
1070
+ )
1071
+ ],
1072
+ 1
1073
+ )
1074
+ : _vm._e()
1075
+ ]),
1076
+ file.status === "success"
1077
+ ? _c("span", { staticClass: "el-upload-list__item-actions" }, [
1078
+ _vm.handlePreview
1079
+ ? _c("i", {
1080
+ staticClass:
1081
+ "el-upload-list__item-preview iov-icon-eye",
1082
+ on: {
1083
+ click: function($event) {
1084
+ _vm.handlePreview(file)
1085
+ }
1086
+ }
1087
+ })
1088
+ : _vm._e(),
1089
+ !_vm.disabled
1090
+ ? _c("i", {
1091
+ staticClass:
1092
+ "el-upload-list__item-delete iov-icon-delete",
1093
+ on: {
1094
+ click: function($event) {
1095
+ $event.stopPropagation()
1096
+ _vm.$emit("remove", file)
1097
+ }
1098
+ }
1099
+ })
1100
+ : _vm._e(),
1101
+ !_vm.disabled
1102
+ ? _c("i", {
1103
+ staticClass:
1104
+ "el-upload-list__item-update iov-icon-update"
1105
+ })
1106
+ : _vm._e()
1107
+ ])
1108
+ : _vm._e()
1109
+ ],
1110
+ { file: file }
1111
+ )
1112
+ ],
1113
+ 2
1114
+ )
1115
+ }),
1116
+ 0
1117
+ )
1118
+ }
1119
+ var upload_picturevue_type_template_id_4be68a77_staticRenderFns = []
1120
+ upload_picturevue_type_template_id_4be68a77_render._withStripped = true
1121
+
1122
+
1123
+ // CONCATENATED MODULE: ./packages/upload/src/upload-picture.vue?vue&type=template&id=4be68a77&
1124
+
1125
+ // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/upload/src/upload-picture.vue?vue&type=script&lang=js&
1126
+ //
1127
+ //
1128
+ //
1129
+ //
1130
+ //
1131
+ //
1132
+ //
1133
+ //
1134
+ //
1135
+ //
1136
+ //
1137
+ //
1138
+ //
1139
+ //
1140
+ //
1141
+ //
1142
+ //
1143
+ //
1144
+ //
1145
+ //
1146
+ //
1147
+ //
1148
+ //
1149
+ //
1150
+ //
1151
+ //
1152
+ //
1153
+ //
1154
+ //
1155
+ //
1156
+ //
1157
+ //
1158
+ //
1159
+ //
1160
+ //
1161
+ //
1162
+ //
1163
+ //
1164
+ //
1165
+ //
1166
+ //
1167
+ //
1168
+ //
1169
+ //
1170
+ //
1171
+ //
1172
+ //
1173
+ //
1174
+ //
1175
+ //
1176
+ //
1177
+
1178
+
1179
+
1180
+
1181
+ /* harmony default export */ var upload_picturevue_type_script_lang_js_ = ({
1182
+ name: 'ElUploadPicture',
1183
+ data: function data() {
1184
+ return {
1185
+ focusing: false,
1186
+ iconStyle: iconStyle
1187
+ };
1188
+ },
1189
+
1190
+ components: { ElProgress: progress_default.a },
1191
+
1192
+ props: {
1193
+ files: {
1194
+ type: Array,
1195
+ default: function _default() {
1196
+ return [];
1197
+ }
1198
+ },
1199
+ disabled: {
1200
+ type: Boolean,
1201
+ default: false
1202
+ },
1203
+ size: String,
1204
+ handlePreview: Function,
1205
+ listType: String
1206
+ },
1207
+ methods: {
1208
+ parsePercentage: function parsePercentage(val) {
1209
+ return parseInt(val, 10);
1210
+ },
1211
+ handleClick: function handleClick(file) {
1212
+ this.handlePreview && this.handlePreview(file);
1213
+ }
1214
+ }
1215
+ });
1216
+ // CONCATENATED MODULE: ./packages/upload/src/upload-picture.vue?vue&type=script&lang=js&
1217
+ /* harmony default export */ var src_upload_picturevue_type_script_lang_js_ = (upload_picturevue_type_script_lang_js_);
1218
+ // CONCATENATED MODULE: ./packages/upload/src/upload-picture.vue
1219
+
1220
+
1221
+
1222
+
1223
+
1224
+ /* normalize component */
1225
+
1226
+ var upload_picture_component = Object(componentNormalizer["a" /* default */])(
1227
+ src_upload_picturevue_type_script_lang_js_,
1228
+ upload_picturevue_type_template_id_4be68a77_render,
1229
+ upload_picturevue_type_template_id_4be68a77_staticRenderFns,
1230
+ false,
1231
+ null,
1232
+ null,
1233
+ null
1234
+
1235
+ )
1236
+
1237
+ /* hot reload */
1238
+ if (false) { var upload_picture_api; }
1239
+ upload_picture_component.options.__file = "packages/upload/src/upload-picture.vue"
1240
+ /* harmony default export */ var upload_picture = (upload_picture_component.exports);
524
1241
  // EXTERNAL MODULE: external "babel-helper-vue-jsx-merge-props"
525
1242
  var external_babel_helper_vue_jsx_merge_props_ = __webpack_require__(26);
526
1243
  var external_babel_helper_vue_jsx_merge_props_default = /*#__PURE__*/__webpack_require__.n(external_babel_helper_vue_jsx_merge_props_);
@@ -776,6 +1493,7 @@ upload_dragger_component.options.__file = "packages/upload/src/upload-dragger.vu
776
1493
  onError: Function,
777
1494
  beforeUpload: Function,
778
1495
  drag: Boolean,
1496
+ size: String,
779
1497
  onPreview: {
780
1498
  type: Function,
781
1499
  default: function _default() {}
@@ -804,6 +1522,12 @@ upload_dragger_component.options.__file = "packages/upload/src/upload-dragger.vu
804
1522
  },
805
1523
 
806
1524
 
1525
+ computed: {
1526
+ hideUploadInput: function hideUploadInput() {
1527
+ return !this.showFileList && this.listType === 'picture-card' && this.limit === 1 && this.fileList.length === 1;
1528
+ }
1529
+ },
1530
+
807
1531
  methods: {
808
1532
  isImage: function isImage(str) {
809
1533
  return str.indexOf('image') !== -1;
@@ -812,6 +1536,10 @@ upload_dragger_component.options.__file = "packages/upload/src/upload-dragger.vu
812
1536
  var files = ev.target.files;
813
1537
 
814
1538
  if (!files) return;
1539
+
1540
+ if (this.drag && this.limit === 1 || this.hideUploadInput) {
1541
+ this.fileList.length = [];
1542
+ }
815
1543
  this.uploadFiles(files);
816
1544
  },
817
1545
  uploadFiles: function uploadFiles(files) {
@@ -935,6 +1663,8 @@ upload_dragger_component.options.__file = "packages/upload/src/upload-dragger.vu
935
1663
  },
936
1664
 
937
1665
  render: function render(h) {
1666
+ var _class;
1667
+
938
1668
  var handleClick = this.handleClick,
939
1669
  drag = this.drag,
940
1670
  name = this.name,
@@ -944,12 +1674,14 @@ upload_dragger_component.options.__file = "packages/upload/src/upload-dragger.vu
944
1674
  listType = this.listType,
945
1675
  uploadFiles = this.uploadFiles,
946
1676
  disabled = this.disabled,
947
- handleKeydown = this.handleKeydown;
1677
+ handleKeydown = this.handleKeydown,
1678
+ size = this.size;
948
1679
 
949
1680
  var data = {
950
- class: {
951
- 'el-upload': true
952
- },
1681
+ class: (_class = {
1682
+ 'el-upload': true,
1683
+ 'el-upload--drag': drag
1684
+ }, _class['el-upload--drag__' + size] = drag, _class['el-upload--' + size] = !drag, _class['el-upload--picture-card'] = listType === 'picture-card', _class['el-upload--picture-card__no-border'] = this.hideUploadInput, _class),
953
1685
  on: {
954
1686
  click: handleClick,
955
1687
  keydown: handleKeydown
@@ -969,7 +1701,7 @@ upload_dragger_component.options.__file = "packages/upload/src/upload-dragger.vu
969
1701
  'file': uploadFiles
970
1702
  }
971
1703
  },
972
- [this.$slots.default]
1704
+ [this.$slots.default, this.$slots.tip]
973
1705
  ) : this.$slots.default, h('input', { 'class': 'el-upload__input', attrs: { type: 'file', name: name, multiple: multiple, accept: accept },
974
1706
  ref: 'input', on: {
975
1707
  'change': handleChange
@@ -1014,6 +1746,8 @@ var migrating_default = /*#__PURE__*/__webpack_require__.n(migrating_);
1014
1746
 
1015
1747
 
1016
1748
 
1749
+
1750
+
1017
1751
  function noop() {}
1018
1752
 
1019
1753
  /* harmony default export */ var srcvue_type_script_lang_js_ = ({
@@ -1024,6 +1758,8 @@ function noop() {}
1024
1758
  components: {
1025
1759
  ElProgress: progress_default.a,
1026
1760
  UploadList: upload_list,
1761
+ UploadFile: upload_file,
1762
+ UploadPicture: upload_picture,
1027
1763
  Upload: src_upload
1028
1764
  },
1029
1765
 
@@ -1114,6 +1850,11 @@ function noop() {}
1114
1850
  onExceed: {
1115
1851
  type: Function,
1116
1852
  default: noop
1853
+ },
1854
+ background: Boolean,
1855
+ size: {
1856
+ type: String,
1857
+ default: 'medium'
1117
1858
  }
1118
1859
  },
1119
1860
 
@@ -1287,7 +2028,52 @@ function noop() {}
1287
2028
  var _this4 = this;
1288
2029
 
1289
2030
  var uploadList = void 0;
1290
-
2031
+ var uploadFile = h(
2032
+ upload_file,
2033
+ {
2034
+ attrs: {
2035
+ disabled: this.uploadDisabled,
2036
+ listType: this.listType,
2037
+ files: this.uploadFiles,
2038
+ width: this.width,
2039
+ height: this.height,
2040
+ size: this.size,
2041
+
2042
+ handlePreview: this.onPreview },
2043
+ on: {
2044
+ 'remove': this.handleRemove
2045
+ }
2046
+ },
2047
+ [function (props) {
2048
+ if (_this4.$scopedSlots.file) {
2049
+ return _this4.$scopedSlots.file({
2050
+ file: props.file
2051
+ });
2052
+ }
2053
+ }]
2054
+ );
2055
+ var uploadPicture = h(
2056
+ upload_picture,
2057
+ {
2058
+ attrs: {
2059
+ disabled: this.uploadDisabled,
2060
+ listType: this.listType,
2061
+ files: this.uploadFiles,
2062
+ size: this.size,
2063
+
2064
+ handlePreview: this.onPreview },
2065
+ on: {
2066
+ 'remove': this.handleRemove
2067
+ }
2068
+ },
2069
+ [function (props) {
2070
+ if (_this4.$scopedSlots.file) {
2071
+ return _this4.$scopedSlots.file({
2072
+ file: props.file
2073
+ });
2074
+ }
2075
+ }]
2076
+ );
1291
2077
  if (this.showFileList) {
1292
2078
  uploadList = h(
1293
2079
  upload_list,
@@ -1296,6 +2082,7 @@ function noop() {}
1296
2082
  disabled: this.uploadDisabled,
1297
2083
  listType: this.listType,
1298
2084
  files: this.uploadFiles,
2085
+ size: this.size,
1299
2086
 
1300
2087
  handlePreview: this.onPreview },
1301
2088
  on: {
@@ -1316,6 +2103,7 @@ function noop() {}
1316
2103
  props: {
1317
2104
  type: this.type,
1318
2105
  drag: this.drag,
2106
+ size: this.size,
1319
2107
  action: this.action,
1320
2108
  multiple: this.multiple,
1321
2109
  'before-upload': this.beforeUpload,
@@ -1325,6 +2113,7 @@ function noop() {}
1325
2113
  data: this.data,
1326
2114
  accept: this.accept,
1327
2115
  fileList: this.uploadFiles,
2116
+ showFileList: this.showFileList,
1328
2117
  autoUpload: this.autoUpload,
1329
2118
  listType: this.listType,
1330
2119
  disabled: this.uploadDisabled,
@@ -1341,14 +2130,33 @@ function noop() {}
1341
2130
  ref: 'upload-inner'
1342
2131
  };
1343
2132
 
1344
- var trigger = this.$slots.trigger || this.$slots.default;
2133
+ var hideUploadInput = !this.showFileList && this.listType === 'picture-card' && this.limit === 1;
2134
+ var slotDefault = this.$slots.default;
2135
+ if (this.drag) {
2136
+ // 拖动文件上传
2137
+ if (this.limit === 1 && !this.showFileList) {
2138
+ slotDefault = this.uploadFiles.length > 0 ? uploadFile : [this.$slots.default, this.$slots.tip];
2139
+ } else {
2140
+ slotDefault = [this.$slots.default, this.$slots.tip];
2141
+ }
2142
+ } else if (hideUploadInput) {
2143
+ // 单个图片上传(不显示图片墙)
2144
+ slotDefault = [uploadPicture, this.$slots.default];
2145
+ } else {
2146
+ slotDefault = this.$slots.default;
2147
+ }
2148
+
2149
+ var trigger = this.$slots.trigger || slotDefault;
1345
2150
  var uploadComponent = h(
1346
2151
  'upload',
1347
2152
  uploadData,
1348
2153
  [trigger]
1349
2154
  );
1350
-
1351
- return h('div', [this.listType === 'picture-card' ? uploadList : '', this.$slots.trigger ? [uploadComponent, this.$slots.default] : uploadComponent, this.$slots.tip, this.listType !== 'picture-card' ? uploadList : '']);
2155
+ return h(
2156
+ 'div',
2157
+ { 'class': { 'el-upload--wrap': true, 'el-upload-bg': this.background } },
2158
+ [this.listType === 'picture-card' ? uploadList : '', this.$slots.trigger ? [uploadComponent, this.$slots.default] : uploadComponent, !this.drag && this.$slots.tip, this.listType !== 'picture-card' ? uploadList : '']
2159
+ );
1352
2160
  }
1353
2161
  });
1354
2162
  // CONCATENATED MODULE: ./packages/upload/src/index.vue?vue&type=script&lang=js&
@@ -1386,13 +2194,6 @@ src.install = function (Vue) {
1386
2194
 
1387
2195
  /* harmony default export */ var packages_upload = __webpack_exports__["default"] = (src);
1388
2196
 
1389
- /***/ }),
1390
-
1391
- /***/ 7:
1392
- /***/ (function(module, exports) {
1393
-
1394
- module.exports = require("iov-design/lib/mixins/locale");
1395
-
1396
2197
  /***/ })
1397
2198
 
1398
2199
  /******/ });