cy-element-ui 1.0.48 → 1.0.49
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/alert.js +108 -108
- package/lib/aside.js +77 -77
- package/lib/autocomplete.js +5199 -360
- package/lib/avatar.js +4 -4
- package/lib/backtop.js +192 -101
- package/lib/badge.js +108 -108
- package/lib/breadcrumb-item.js +108 -108
- package/lib/breadcrumb.js +94 -94
- package/lib/button-group.js +4 -4
- package/lib/button.js +4 -4
- package/lib/calendar.js +1734 -137
- package/lib/card.js +96 -96
- package/lib/carousel-item.js +452 -108
- package/lib/carousel.js +1256 -105
- package/lib/cascader-panel.js +3524 -191
- package/lib/cascader.js +8077 -717
- package/lib/checkbox-button.js +151 -119
- package/lib/checkbox-group.js +47 -15
- package/lib/checkbox.js +47 -15
- package/lib/col.js +2 -2
- package/lib/collapse-item.js +815 -110
- package/lib/collapse.js +108 -108
- package/lib/color-picker.js +4705 -828
- package/lib/container.js +88 -88
- package/lib/date-picker.js +10735 -4739
- package/lib/descriptions-item.js +2 -2
- package/lib/descriptions.js +63 -8
- package/lib/dialog.js +1200 -22
- package/lib/divider.js +104 -104
- package/lib/drawer.js +875 -105
- package/lib/dropdown-item.js +128 -96
- package/lib/dropdown-menu.js +2301 -99
- package/lib/dropdown.js +990 -54
- package/lib/element-ui.common.js +31058 -13663
- package/lib/empty.js +793 -99
- package/lib/fileUpload.js +2542 -26
- package/lib/footer.js +77 -77
- package/lib/form-item.js +3305 -202
- package/lib/form.js +129 -115
- package/lib/header.js +77 -77
- package/lib/icon.js +67 -67
- package/lib/image.js +1662 -146
- package/lib/index.js +1 -1
- package/lib/infinite-scroll.js +435 -26
- package/lib/input-number.js +1421 -32
- package/lib/input.js +509 -37
- package/lib/link.js +4 -4
- package/lib/loading.js +886 -149
- package/lib/main.js +64 -64
- package/lib/menu-item-group.js +103 -103
- package/lib/menu-item.js +3140 -137
- package/lib/menu.js +959 -268
- package/lib/message-box.js +2743 -188
- package/lib/message.js +1196 -118
- package/lib/notification.js +1196 -119
- package/lib/option-group.js +151 -119
- package/lib/option.js +392 -16
- package/lib/page-header.js +781 -87
- package/lib/pagination.js +7747 -646
- package/lib/popconfirm.js +3606 -219
- package/lib/popover.js +2604 -79
- package/lib/progress.js +4 -4
- package/lib/radio-button.js +151 -119
- package/lib/radio-group.js +151 -119
- package/lib/radio.js +47 -15
- package/lib/rate.js +756 -113
- package/lib/result.js +108 -108
- package/lib/row.js +2 -2
- package/lib/scrollbar.js +1813 -41
- package/lib/select.js +5547 -209
- package/lib/selectDisplayInput.js +4 -4
- package/lib/skeleton-item.js +108 -108
- package/lib/skeleton.js +108 -108
- package/lib/slider.js +4768 -530
- package/lib/spinner.js +100 -100
- package/lib/statistic.js +9600 -112
- package/lib/step.js +108 -108
- package/lib/steps.js +514 -99
- package/lib/subTitle.js +91 -91
- package/lib/submenu.js +2397 -76
- package/lib/switch.js +582 -127
- package/lib/tab-pane.js +108 -108
- package/lib/tabDialog.js +1630 -104
- package/lib/table-column.js +1115 -267
- package/lib/table.js +7067 -1253
- package/lib/tabs.js +1615 -113
- package/lib/tag.js +4 -4
- package/lib/time-picker.js +6481 -589
- package/lib/time-select.js +6334 -407
- package/lib/timeline-item.js +108 -108
- package/lib/timeline.js +4 -4
- package/lib/tooltip.js +2688 -44
- package/lib/transfer.js +2238 -146
- package/lib/tree.js +1563 -148
- package/lib/treeSelect.js +3421 -106
- package/lib/upload.js +1198 -31
- package/package.json +1 -1
- package/src/index.js +1 -1
package/lib/fileUpload.js
CHANGED
|
@@ -82,12 +82,462 @@ module.exports =
|
|
|
82
82
|
/******/
|
|
83
83
|
/******/
|
|
84
84
|
/******/ // Load entry module and return exports
|
|
85
|
-
/******/ return __webpack_require__(__webpack_require__.s =
|
|
85
|
+
/******/ return __webpack_require__(__webpack_require__.s = 200);
|
|
86
86
|
/******/ })
|
|
87
87
|
/************************************************************************/
|
|
88
88
|
/******/ ({
|
|
89
89
|
|
|
90
90
|
/***/ 0:
|
|
91
|
+
/***/ (function(module, exports) {
|
|
92
|
+
|
|
93
|
+
module.exports = require("vue");
|
|
94
|
+
|
|
95
|
+
/***/ }),
|
|
96
|
+
|
|
97
|
+
/***/ 11:
|
|
98
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
99
|
+
|
|
100
|
+
"use strict";
|
|
101
|
+
|
|
102
|
+
// EXPORTS
|
|
103
|
+
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ t; });
|
|
104
|
+
|
|
105
|
+
// UNUSED EXPORTS: use, i18n
|
|
106
|
+
|
|
107
|
+
// CONCATENATED MODULE: ./src/locale/lang/zh-CN.js
|
|
108
|
+
/* harmony default export */ var zh_CN = ({
|
|
109
|
+
el: {
|
|
110
|
+
colorpicker: {
|
|
111
|
+
confirm: '确定',
|
|
112
|
+
clear: '清空'
|
|
113
|
+
},
|
|
114
|
+
datepicker: {
|
|
115
|
+
now: '此刻',
|
|
116
|
+
today: '今天',
|
|
117
|
+
cancel: '取消',
|
|
118
|
+
clear: '清空',
|
|
119
|
+
confirm: '确定',
|
|
120
|
+
selectDate: '选择日期',
|
|
121
|
+
selectTime: '选择时间',
|
|
122
|
+
startDate: '开始日期',
|
|
123
|
+
startTime: '开始时间',
|
|
124
|
+
endDate: '结束日期',
|
|
125
|
+
endTime: '结束时间',
|
|
126
|
+
prevYear: '前一年',
|
|
127
|
+
nextYear: '后一年',
|
|
128
|
+
prevMonth: '上个月',
|
|
129
|
+
nextMonth: '下个月',
|
|
130
|
+
year: '年',
|
|
131
|
+
month1: '1 月',
|
|
132
|
+
month2: '2 月',
|
|
133
|
+
month3: '3 月',
|
|
134
|
+
month4: '4 月',
|
|
135
|
+
month5: '5 月',
|
|
136
|
+
month6: '6 月',
|
|
137
|
+
month7: '7 月',
|
|
138
|
+
month8: '8 月',
|
|
139
|
+
month9: '9 月',
|
|
140
|
+
month10: '10 月',
|
|
141
|
+
month11: '11 月',
|
|
142
|
+
month12: '12 月',
|
|
143
|
+
// week: '周次',
|
|
144
|
+
weeks: {
|
|
145
|
+
sun: '日',
|
|
146
|
+
mon: '一',
|
|
147
|
+
tue: '二',
|
|
148
|
+
wed: '三',
|
|
149
|
+
thu: '四',
|
|
150
|
+
fri: '五',
|
|
151
|
+
sat: '六'
|
|
152
|
+
},
|
|
153
|
+
months: {
|
|
154
|
+
jan: '一月',
|
|
155
|
+
feb: '二月',
|
|
156
|
+
mar: '三月',
|
|
157
|
+
apr: '四月',
|
|
158
|
+
may: '五月',
|
|
159
|
+
jun: '六月',
|
|
160
|
+
jul: '七月',
|
|
161
|
+
aug: '八月',
|
|
162
|
+
sep: '九月',
|
|
163
|
+
oct: '十月',
|
|
164
|
+
nov: '十一月',
|
|
165
|
+
dec: '十二月'
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
select: {
|
|
169
|
+
loading: '加载中',
|
|
170
|
+
noMatch: '无匹配数据',
|
|
171
|
+
noData: '无数据',
|
|
172
|
+
placeholder: '请选择'
|
|
173
|
+
},
|
|
174
|
+
cascader: {
|
|
175
|
+
noMatch: '无匹配数据',
|
|
176
|
+
loading: '加载中',
|
|
177
|
+
placeholder: '请选择',
|
|
178
|
+
noData: '暂无数据'
|
|
179
|
+
},
|
|
180
|
+
pagination: {
|
|
181
|
+
goto: '前往',
|
|
182
|
+
pagesize: '条/页',
|
|
183
|
+
total: '共 {total} 条',
|
|
184
|
+
pageClassifier: '页'
|
|
185
|
+
},
|
|
186
|
+
messagebox: {
|
|
187
|
+
title: '提示',
|
|
188
|
+
confirm: '确定',
|
|
189
|
+
cancel: '取消',
|
|
190
|
+
error: '输入的数据不合法!'
|
|
191
|
+
},
|
|
192
|
+
upload: {
|
|
193
|
+
deleteTip: '按 delete 键可删除',
|
|
194
|
+
delete: '删除',
|
|
195
|
+
preview: '查看图片',
|
|
196
|
+
continue: '继续上传'
|
|
197
|
+
},
|
|
198
|
+
table: {
|
|
199
|
+
emptyText: '暂无数据',
|
|
200
|
+
confirmFilter: '筛选',
|
|
201
|
+
resetFilter: '重置',
|
|
202
|
+
clearFilter: '全部',
|
|
203
|
+
sumText: '合计'
|
|
204
|
+
},
|
|
205
|
+
tree: {
|
|
206
|
+
emptyText: '暂无数据'
|
|
207
|
+
},
|
|
208
|
+
transfer: {
|
|
209
|
+
noMatch: '无匹配数据',
|
|
210
|
+
noData: '无数据',
|
|
211
|
+
titles: ['列表 1', '列表 2'],
|
|
212
|
+
filterPlaceholder: '请输入搜索内容',
|
|
213
|
+
noCheckedFormat: '共 {total} 项',
|
|
214
|
+
hasCheckedFormat: '已选 {checked}/{total} 项'
|
|
215
|
+
},
|
|
216
|
+
image: {
|
|
217
|
+
error: '加载失败'
|
|
218
|
+
},
|
|
219
|
+
pageHeader: {
|
|
220
|
+
title: '返回'
|
|
221
|
+
},
|
|
222
|
+
popconfirm: {
|
|
223
|
+
confirmButtonText: '确定',
|
|
224
|
+
cancelButtonText: '取消'
|
|
225
|
+
},
|
|
226
|
+
empty: {
|
|
227
|
+
description: '暂无数据'
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
// EXTERNAL MODULE: external "vue"
|
|
232
|
+
var external_vue_ = __webpack_require__(0);
|
|
233
|
+
var external_vue_default = /*#__PURE__*/__webpack_require__.n(external_vue_);
|
|
234
|
+
|
|
235
|
+
// EXTERNAL MODULE: ./node_modules/deepmerge/dist/cjs.js
|
|
236
|
+
var cjs = __webpack_require__(15);
|
|
237
|
+
var cjs_default = /*#__PURE__*/__webpack_require__.n(cjs);
|
|
238
|
+
|
|
239
|
+
// EXTERNAL MODULE: ./src/utils/util.js
|
|
240
|
+
var util = __webpack_require__(3);
|
|
241
|
+
|
|
242
|
+
// CONCATENATED MODULE: ./src/locale/format.js
|
|
243
|
+
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
var RE_NARGS = /(%|)\{([0-9a-zA-Z_]+)\}/g;
|
|
248
|
+
/**
|
|
249
|
+
* String format template
|
|
250
|
+
* - Inspired:
|
|
251
|
+
* https://github.com/Matt-Esch/string-template/index.js
|
|
252
|
+
*/
|
|
253
|
+
/* harmony default export */ var format = (function (Vue) {
|
|
254
|
+
/**
|
|
255
|
+
* template
|
|
256
|
+
*
|
|
257
|
+
* @param {String} string
|
|
258
|
+
* @param {Array} ...args
|
|
259
|
+
* @return {String}
|
|
260
|
+
*/
|
|
261
|
+
|
|
262
|
+
function template(string) {
|
|
263
|
+
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
264
|
+
args[_key - 1] = arguments[_key];
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
if (args.length === 1 && _typeof(args[0]) === 'object') {
|
|
268
|
+
args = args[0];
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
if (!args || !args.hasOwnProperty) {
|
|
272
|
+
args = {};
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
return string.replace(RE_NARGS, function (match, prefix, i, index) {
|
|
276
|
+
var result = void 0;
|
|
277
|
+
|
|
278
|
+
if (string[index - 1] === '{' && string[index + match.length] === '}') {
|
|
279
|
+
return i;
|
|
280
|
+
} else {
|
|
281
|
+
result = Object(util["j" /* hasOwn */])(args, i) ? args[i] : null;
|
|
282
|
+
if (result === null || result === undefined) {
|
|
283
|
+
return '';
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
return result;
|
|
287
|
+
}
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
return template;
|
|
292
|
+
});
|
|
293
|
+
// CONCATENATED MODULE: ./src/locale/index.js
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
var locale_format = format(external_vue_default.a);
|
|
300
|
+
var lang = zh_CN;
|
|
301
|
+
var merged = false;
|
|
302
|
+
var locale_i18nHandler = function i18nHandler() {
|
|
303
|
+
var vuei18n = Object.getPrototypeOf(this || external_vue_default.a).$t;
|
|
304
|
+
if (typeof vuei18n === 'function' && !!external_vue_default.a.locale) {
|
|
305
|
+
if (!merged) {
|
|
306
|
+
merged = true;
|
|
307
|
+
external_vue_default.a.locale(external_vue_default.a.config.lang, cjs_default()(lang, external_vue_default.a.locale(external_vue_default.a.config.lang) || {}, { clone: true }));
|
|
308
|
+
}
|
|
309
|
+
return vuei18n.apply(this, arguments);
|
|
310
|
+
}
|
|
311
|
+
};
|
|
312
|
+
|
|
313
|
+
var t = function t(path, options) {
|
|
314
|
+
var value = locale_i18nHandler.apply(this, arguments);
|
|
315
|
+
if (value !== null && value !== undefined) return value;
|
|
316
|
+
|
|
317
|
+
var array = path.split('.');
|
|
318
|
+
var current = lang;
|
|
319
|
+
|
|
320
|
+
for (var i = 0, j = array.length; i < j; i++) {
|
|
321
|
+
var property = array[i];
|
|
322
|
+
value = current[property];
|
|
323
|
+
if (i === j - 1) return locale_format(value, options);
|
|
324
|
+
if (!value) return '';
|
|
325
|
+
current = value;
|
|
326
|
+
}
|
|
327
|
+
return '';
|
|
328
|
+
};
|
|
329
|
+
|
|
330
|
+
var use = function use(l) {
|
|
331
|
+
lang = l || lang;
|
|
332
|
+
};
|
|
333
|
+
|
|
334
|
+
var i18n = function i18n(fn) {
|
|
335
|
+
locale_i18nHandler = fn || locale_i18nHandler;
|
|
336
|
+
};
|
|
337
|
+
|
|
338
|
+
/* harmony default export */ var locale = ({ use: use, t: t, i18n: i18n });
|
|
339
|
+
|
|
340
|
+
/***/ }),
|
|
341
|
+
|
|
342
|
+
/***/ 12:
|
|
343
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
344
|
+
|
|
345
|
+
"use strict";
|
|
346
|
+
/* harmony import */ var element_ui_src_utils_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* Show migrating guide in browser console.
|
|
350
|
+
*
|
|
351
|
+
* Usage:
|
|
352
|
+
* import Migrating from 'element-ui/src/mixins/migrating';
|
|
353
|
+
*
|
|
354
|
+
* mixins: [Migrating]
|
|
355
|
+
*
|
|
356
|
+
* add getMigratingConfig method for your component.
|
|
357
|
+
* getMigratingConfig() {
|
|
358
|
+
* return {
|
|
359
|
+
* props: {
|
|
360
|
+
* 'allow-no-selection': 'allow-no-selection is removed.',
|
|
361
|
+
* 'selection-mode': 'selection-mode is removed.'
|
|
362
|
+
* },
|
|
363
|
+
* events: {
|
|
364
|
+
* selectionchange: 'selectionchange is renamed to selection-change.'
|
|
365
|
+
* }
|
|
366
|
+
* };
|
|
367
|
+
* },
|
|
368
|
+
*/
|
|
369
|
+
/* harmony default export */ __webpack_exports__["a"] = ({
|
|
370
|
+
mounted: function mounted() {
|
|
371
|
+
if (true) return;
|
|
372
|
+
if (!this.$vnode) return;
|
|
373
|
+
|
|
374
|
+
var _getMigratingConfig = this.getMigratingConfig(),
|
|
375
|
+
_getMigratingConfig$p = _getMigratingConfig.props,
|
|
376
|
+
props = _getMigratingConfig$p === undefined ? {} : _getMigratingConfig$p,
|
|
377
|
+
_getMigratingConfig$e = _getMigratingConfig.events,
|
|
378
|
+
events = _getMigratingConfig$e === undefined ? {} : _getMigratingConfig$e;
|
|
379
|
+
|
|
380
|
+
var _$vnode = this.$vnode,
|
|
381
|
+
data = _$vnode.data,
|
|
382
|
+
componentOptions = _$vnode.componentOptions;
|
|
383
|
+
|
|
384
|
+
var definedProps = data.attrs || {};
|
|
385
|
+
var definedEvents = componentOptions.listeners || {};
|
|
386
|
+
|
|
387
|
+
for (var propName in definedProps) {
|
|
388
|
+
propName = Object(element_ui_src_utils_util__WEBPACK_IMPORTED_MODULE_0__[/* kebabCase */ "q"])(propName); // compatible with camel case
|
|
389
|
+
if (props[propName]) {
|
|
390
|
+
console.warn('[Element Migrating][' + this.$options.name + '][Attribute]: ' + props[propName]);
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
for (var eventName in definedEvents) {
|
|
395
|
+
eventName = Object(element_ui_src_utils_util__WEBPACK_IMPORTED_MODULE_0__[/* kebabCase */ "q"])(eventName); // compatible with camel case
|
|
396
|
+
if (events[eventName]) {
|
|
397
|
+
console.warn('[Element Migrating][' + this.$options.name + '][Event]: ' + events[eventName]);
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
},
|
|
401
|
+
|
|
402
|
+
methods: {
|
|
403
|
+
getMigratingConfig: function getMigratingConfig() {
|
|
404
|
+
return {
|
|
405
|
+
props: {},
|
|
406
|
+
events: {}
|
|
407
|
+
};
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
});
|
|
411
|
+
|
|
412
|
+
/***/ }),
|
|
413
|
+
|
|
414
|
+
/***/ 13:
|
|
415
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
416
|
+
|
|
417
|
+
"use strict";
|
|
418
|
+
/* harmony import */ var element_ui_src_locale__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11);
|
|
419
|
+
|
|
420
|
+
|
|
421
|
+
/* harmony default export */ __webpack_exports__["a"] = ({
|
|
422
|
+
methods: {
|
|
423
|
+
t: function t() {
|
|
424
|
+
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
|
425
|
+
args[_key] = arguments[_key];
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
return element_ui_src_locale__WEBPACK_IMPORTED_MODULE_0__[/* t */ "a"].apply(this, args);
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
});
|
|
432
|
+
|
|
433
|
+
/***/ }),
|
|
434
|
+
|
|
435
|
+
/***/ 15:
|
|
436
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
437
|
+
|
|
438
|
+
"use strict";
|
|
439
|
+
|
|
440
|
+
|
|
441
|
+
var isMergeableObject = function isMergeableObject(value) {
|
|
442
|
+
return isNonNullObject(value)
|
|
443
|
+
&& !isSpecial(value)
|
|
444
|
+
};
|
|
445
|
+
|
|
446
|
+
function isNonNullObject(value) {
|
|
447
|
+
return !!value && typeof value === 'object'
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
function isSpecial(value) {
|
|
451
|
+
var stringValue = Object.prototype.toString.call(value);
|
|
452
|
+
|
|
453
|
+
return stringValue === '[object RegExp]'
|
|
454
|
+
|| stringValue === '[object Date]'
|
|
455
|
+
|| isReactElement(value)
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
// see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25
|
|
459
|
+
var canUseSymbol = typeof Symbol === 'function' && Symbol.for;
|
|
460
|
+
var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7;
|
|
461
|
+
|
|
462
|
+
function isReactElement(value) {
|
|
463
|
+
return value.$$typeof === REACT_ELEMENT_TYPE
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
function emptyTarget(val) {
|
|
467
|
+
return Array.isArray(val) ? [] : {}
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
function cloneIfNecessary(value, optionsArgument) {
|
|
471
|
+
var clone = optionsArgument && optionsArgument.clone === true;
|
|
472
|
+
return (clone && isMergeableObject(value)) ? deepmerge(emptyTarget(value), value, optionsArgument) : value
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
function defaultArrayMerge(target, source, optionsArgument) {
|
|
476
|
+
var destination = target.slice();
|
|
477
|
+
source.forEach(function(e, i) {
|
|
478
|
+
if (typeof destination[i] === 'undefined') {
|
|
479
|
+
destination[i] = cloneIfNecessary(e, optionsArgument);
|
|
480
|
+
} else if (isMergeableObject(e)) {
|
|
481
|
+
destination[i] = deepmerge(target[i], e, optionsArgument);
|
|
482
|
+
} else if (target.indexOf(e) === -1) {
|
|
483
|
+
destination.push(cloneIfNecessary(e, optionsArgument));
|
|
484
|
+
}
|
|
485
|
+
});
|
|
486
|
+
return destination
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
function mergeObject(target, source, optionsArgument) {
|
|
490
|
+
var destination = {};
|
|
491
|
+
if (isMergeableObject(target)) {
|
|
492
|
+
Object.keys(target).forEach(function(key) {
|
|
493
|
+
destination[key] = cloneIfNecessary(target[key], optionsArgument);
|
|
494
|
+
});
|
|
495
|
+
}
|
|
496
|
+
Object.keys(source).forEach(function(key) {
|
|
497
|
+
if (!isMergeableObject(source[key]) || !target[key]) {
|
|
498
|
+
destination[key] = cloneIfNecessary(source[key], optionsArgument);
|
|
499
|
+
} else {
|
|
500
|
+
destination[key] = deepmerge(target[key], source[key], optionsArgument);
|
|
501
|
+
}
|
|
502
|
+
});
|
|
503
|
+
return destination
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
function deepmerge(target, source, optionsArgument) {
|
|
507
|
+
var sourceIsArray = Array.isArray(source);
|
|
508
|
+
var targetIsArray = Array.isArray(target);
|
|
509
|
+
var options = optionsArgument || { arrayMerge: defaultArrayMerge };
|
|
510
|
+
var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
|
|
511
|
+
|
|
512
|
+
if (!sourceAndTargetTypesMatch) {
|
|
513
|
+
return cloneIfNecessary(source, optionsArgument)
|
|
514
|
+
} else if (sourceIsArray) {
|
|
515
|
+
var arrayMerge = options.arrayMerge || defaultArrayMerge;
|
|
516
|
+
return arrayMerge(target, source, optionsArgument)
|
|
517
|
+
} else {
|
|
518
|
+
return mergeObject(target, source, optionsArgument)
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
deepmerge.all = function deepmergeAll(array, optionsArgument) {
|
|
523
|
+
if (!Array.isArray(array) || array.length < 2) {
|
|
524
|
+
throw new Error('first argument should be an array with at least two elements')
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
// we are sure there are at least 2 values, so it is safe to have no initial value
|
|
528
|
+
return array.reduce(function(prev, next) {
|
|
529
|
+
return deepmerge(prev, next, optionsArgument)
|
|
530
|
+
})
|
|
531
|
+
};
|
|
532
|
+
|
|
533
|
+
var deepmerge_1 = deepmerge;
|
|
534
|
+
|
|
535
|
+
module.exports = deepmerge_1;
|
|
536
|
+
|
|
537
|
+
|
|
538
|
+
/***/ }),
|
|
539
|
+
|
|
540
|
+
/***/ 2:
|
|
91
541
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
92
542
|
|
|
93
543
|
"use strict";
|
|
@@ -192,14 +642,7 @@ function normalizeComponent(
|
|
|
192
642
|
|
|
193
643
|
/***/ }),
|
|
194
644
|
|
|
195
|
-
/***/
|
|
196
|
-
/***/ (function(module, exports) {
|
|
197
|
-
|
|
198
|
-
module.exports = require("element-ui/lib/button");
|
|
199
|
-
|
|
200
|
-
/***/ }),
|
|
201
|
-
|
|
202
|
-
/***/ 136:
|
|
645
|
+
/***/ 200:
|
|
203
646
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
204
647
|
|
|
205
648
|
"use strict";
|
|
@@ -421,17 +864,14 @@ render._withStripped = true
|
|
|
421
864
|
|
|
422
865
|
// CONCATENATED MODULE: ./packages/fileUpload/src/main.vue?vue&type=template&id=dd74605c
|
|
423
866
|
|
|
424
|
-
// EXTERNAL MODULE:
|
|
425
|
-
var
|
|
426
|
-
var upload_default = /*#__PURE__*/__webpack_require__.n(upload_);
|
|
867
|
+
// EXTERNAL MODULE: ./packages/upload/index.js + 17 modules
|
|
868
|
+
var upload = __webpack_require__(69);
|
|
427
869
|
|
|
428
|
-
// EXTERNAL MODULE:
|
|
429
|
-
var
|
|
430
|
-
var link_default = /*#__PURE__*/__webpack_require__.n(link_);
|
|
870
|
+
// EXTERNAL MODULE: ./packages/link/index.js + 5 modules
|
|
871
|
+
var packages_link = __webpack_require__(74);
|
|
431
872
|
|
|
432
|
-
// EXTERNAL MODULE:
|
|
433
|
-
var
|
|
434
|
-
var button_default = /*#__PURE__*/__webpack_require__.n(button_);
|
|
873
|
+
// EXTERNAL MODULE: ./packages/button/index.js + 5 modules
|
|
874
|
+
var packages_button = __webpack_require__(28);
|
|
435
875
|
|
|
436
876
|
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/fileUpload/src/main.vue?vue&type=script&lang=js
|
|
437
877
|
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; }
|
|
@@ -442,7 +882,7 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, a
|
|
|
442
882
|
|
|
443
883
|
/* harmony default export */ var mainvue_type_script_lang_js = ({
|
|
444
884
|
name: 'CyFileUpload',
|
|
445
|
-
component: [
|
|
885
|
+
component: [upload["default"], packages_link["default"], packages_button["default"]],
|
|
446
886
|
props: {
|
|
447
887
|
// 值
|
|
448
888
|
value: {
|
|
@@ -857,7 +1297,7 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, a
|
|
|
857
1297
|
// CONCATENATED MODULE: ./packages/fileUpload/src/main.vue?vue&type=script&lang=js
|
|
858
1298
|
/* harmony default export */ var src_mainvue_type_script_lang_js = (mainvue_type_script_lang_js);
|
|
859
1299
|
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
|
860
|
-
var componentNormalizer = __webpack_require__(
|
|
1300
|
+
var componentNormalizer = __webpack_require__(2);
|
|
861
1301
|
|
|
862
1302
|
// CONCATENATED MODULE: ./packages/fileUpload/src/main.vue
|
|
863
1303
|
|
|
@@ -891,17 +1331,2093 @@ main.install = function (Vue) {
|
|
|
891
1331
|
|
|
892
1332
|
/***/ }),
|
|
893
1333
|
|
|
894
|
-
/***/
|
|
895
|
-
/***/ (function(module,
|
|
1334
|
+
/***/ 28:
|
|
1335
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1336
|
+
|
|
1337
|
+
"use strict";
|
|
1338
|
+
// ESM COMPAT FLAG
|
|
1339
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1340
|
+
|
|
1341
|
+
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./packages/button/src/button.vue?vue&type=template&id=7105114a
|
|
1342
|
+
var render = function render() {
|
|
1343
|
+
var _vm = this,
|
|
1344
|
+
_c = _vm._self._c
|
|
1345
|
+
return _c(
|
|
1346
|
+
"button",
|
|
1347
|
+
{
|
|
1348
|
+
staticClass: "el-button",
|
|
1349
|
+
class: [
|
|
1350
|
+
_vm.type ? "el-button--" + _vm.type : "",
|
|
1351
|
+
_vm.buttonSize ? "el-button--" + _vm.buttonSize : "",
|
|
1352
|
+
{
|
|
1353
|
+
"is-disabled": _vm.buttonDisabled,
|
|
1354
|
+
"is-loading": _vm.loading,
|
|
1355
|
+
"is-plain": _vm.plain,
|
|
1356
|
+
"is-round": _vm.round,
|
|
1357
|
+
"is-circle": _vm.circle,
|
|
1358
|
+
},
|
|
1359
|
+
],
|
|
1360
|
+
attrs: {
|
|
1361
|
+
disabled: _vm.buttonDisabled || _vm.loading,
|
|
1362
|
+
autofocus: _vm.autofocus,
|
|
1363
|
+
type: _vm.nativeType,
|
|
1364
|
+
},
|
|
1365
|
+
on: { click: _vm.handleClick },
|
|
1366
|
+
},
|
|
1367
|
+
[
|
|
1368
|
+
_vm.loading ? _c("i", { staticClass: "el-icon-loading" }) : _vm._e(),
|
|
1369
|
+
_vm.icon && !_vm.loading ? _c("i", { class: _vm.icon }) : _vm._e(),
|
|
1370
|
+
_vm.$slots.default ? _c("span", [_vm._t("default")], 2) : _vm._e(),
|
|
1371
|
+
]
|
|
1372
|
+
)
|
|
1373
|
+
}
|
|
1374
|
+
var staticRenderFns = []
|
|
1375
|
+
render._withStripped = true
|
|
1376
|
+
|
|
1377
|
+
|
|
1378
|
+
// CONCATENATED MODULE: ./packages/button/src/button.vue?vue&type=template&id=7105114a
|
|
1379
|
+
|
|
1380
|
+
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/button/src/button.vue?vue&type=script&lang=js
|
|
1381
|
+
|
|
1382
|
+
/* harmony default export */ var buttonvue_type_script_lang_js = ({
|
|
1383
|
+
name: 'ElButton',
|
|
1384
|
+
|
|
1385
|
+
inject: {
|
|
1386
|
+
elForm: {
|
|
1387
|
+
default: ''
|
|
1388
|
+
},
|
|
1389
|
+
elFormItem: {
|
|
1390
|
+
default: ''
|
|
1391
|
+
}
|
|
1392
|
+
},
|
|
1393
|
+
|
|
1394
|
+
props: {
|
|
1395
|
+
type: {
|
|
1396
|
+
type: String,
|
|
1397
|
+
default: 'default'
|
|
1398
|
+
},
|
|
1399
|
+
size: String,
|
|
1400
|
+
icon: {
|
|
1401
|
+
type: String,
|
|
1402
|
+
default: ''
|
|
1403
|
+
},
|
|
1404
|
+
nativeType: {
|
|
1405
|
+
type: String,
|
|
1406
|
+
default: 'button'
|
|
1407
|
+
},
|
|
1408
|
+
loading: Boolean,
|
|
1409
|
+
disabled: Boolean,
|
|
1410
|
+
plain: Boolean,
|
|
1411
|
+
autofocus: Boolean,
|
|
1412
|
+
round: Boolean,
|
|
1413
|
+
circle: Boolean
|
|
1414
|
+
},
|
|
1415
|
+
|
|
1416
|
+
computed: {
|
|
1417
|
+
_elFormItemSize: function _elFormItemSize() {
|
|
1418
|
+
return (this.elFormItem || {}).elFormItemSize;
|
|
1419
|
+
},
|
|
1420
|
+
buttonSize: function buttonSize() {
|
|
1421
|
+
return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
|
|
1422
|
+
},
|
|
1423
|
+
buttonDisabled: function buttonDisabled() {
|
|
1424
|
+
return this.$options.propsData.hasOwnProperty('disabled') ? this.disabled : (this.elForm || {}).disabled;
|
|
1425
|
+
}
|
|
1426
|
+
},
|
|
1427
|
+
|
|
1428
|
+
methods: {
|
|
1429
|
+
handleClick: function handleClick(evt) {
|
|
1430
|
+
this.$emit('click', evt);
|
|
1431
|
+
}
|
|
1432
|
+
}
|
|
1433
|
+
});
|
|
1434
|
+
// CONCATENATED MODULE: ./packages/button/src/button.vue?vue&type=script&lang=js
|
|
1435
|
+
/* harmony default export */ var src_buttonvue_type_script_lang_js = (buttonvue_type_script_lang_js);
|
|
1436
|
+
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
|
1437
|
+
var componentNormalizer = __webpack_require__(2);
|
|
896
1438
|
|
|
897
|
-
|
|
1439
|
+
// CONCATENATED MODULE: ./packages/button/src/button.vue
|
|
1440
|
+
|
|
1441
|
+
|
|
1442
|
+
|
|
1443
|
+
|
|
1444
|
+
|
|
1445
|
+
/* normalize component */
|
|
1446
|
+
|
|
1447
|
+
var component = Object(componentNormalizer["a" /* default */])(
|
|
1448
|
+
src_buttonvue_type_script_lang_js,
|
|
1449
|
+
render,
|
|
1450
|
+
staticRenderFns,
|
|
1451
|
+
false,
|
|
1452
|
+
null,
|
|
1453
|
+
null,
|
|
1454
|
+
null
|
|
1455
|
+
|
|
1456
|
+
)
|
|
1457
|
+
|
|
1458
|
+
/* harmony default export */ var src_button = (component.exports);
|
|
1459
|
+
// CONCATENATED MODULE: ./packages/button/index.js
|
|
1460
|
+
|
|
1461
|
+
|
|
1462
|
+
/* istanbul ignore next */
|
|
1463
|
+
src_button.install = function (Vue) {
|
|
1464
|
+
Vue.component(src_button.name, src_button);
|
|
1465
|
+
};
|
|
1466
|
+
|
|
1467
|
+
/* harmony default export */ var packages_button = __webpack_exports__["default"] = (src_button);
|
|
898
1468
|
|
|
899
1469
|
/***/ }),
|
|
900
1470
|
|
|
901
|
-
/***/
|
|
902
|
-
/***/ (function(module,
|
|
1471
|
+
/***/ 3:
|
|
1472
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1473
|
+
|
|
1474
|
+
"use strict";
|
|
1475
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "r", function() { return noop; });
|
|
1476
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return hasOwn; });
|
|
1477
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "t", function() { return toObject; });
|
|
1478
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return getValueByPath; });
|
|
1479
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return getPropByPath; });
|
|
1480
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return generateId; });
|
|
1481
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "u", function() { return valueEquals; });
|
|
1482
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return escapeRegexpString; });
|
|
1483
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return arrayFindIndex; });
|
|
1484
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return arrayFind; });
|
|
1485
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return coerceTruthyValueToArray; });
|
|
1486
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return isIE; });
|
|
1487
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return isEdge; });
|
|
1488
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return isFirefox; });
|
|
1489
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return autoprefixer; });
|
|
1490
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "q", function() { return kebabCase; });
|
|
1491
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return capitalize; });
|
|
1492
|
+
/* unused harmony export looseEqual */
|
|
1493
|
+
/* unused harmony export arrayEquals */
|
|
1494
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return isEqual; });
|
|
1495
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return isEmpty; });
|
|
1496
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "s", function() { return rafThrottle; });
|
|
1497
|
+
/* unused harmony export objToArray */
|
|
1498
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "p", function() { return isMac; });
|
|
1499
|
+
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
|
1500
|
+
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
|
|
1501
|
+
/* harmony import */ var element_ui_src_utils_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4);
|
|
1502
|
+
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
|
1503
|
+
|
|
1504
|
+
|
|
1505
|
+
|
|
1506
|
+
|
|
1507
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
1508
|
+
|
|
1509
|
+
function noop() {};
|
|
1510
|
+
|
|
1511
|
+
function hasOwn(obj, key) {
|
|
1512
|
+
return hasOwnProperty.call(obj, key);
|
|
1513
|
+
};
|
|
1514
|
+
|
|
1515
|
+
function extend(to, _from) {
|
|
1516
|
+
for (var key in _from) {
|
|
1517
|
+
to[key] = _from[key];
|
|
1518
|
+
}
|
|
1519
|
+
return to;
|
|
1520
|
+
};
|
|
1521
|
+
|
|
1522
|
+
function toObject(arr) {
|
|
1523
|
+
var res = {};
|
|
1524
|
+
for (var i = 0; i < arr.length; i++) {
|
|
1525
|
+
if (arr[i]) {
|
|
1526
|
+
extend(res, arr[i]);
|
|
1527
|
+
}
|
|
1528
|
+
}
|
|
1529
|
+
return res;
|
|
1530
|
+
};
|
|
1531
|
+
|
|
1532
|
+
var getValueByPath = function getValueByPath(object, prop) {
|
|
1533
|
+
prop = prop || '';
|
|
1534
|
+
var paths = prop.split('.');
|
|
1535
|
+
var current = object;
|
|
1536
|
+
var result = null;
|
|
1537
|
+
for (var i = 0, j = paths.length; i < j; i++) {
|
|
1538
|
+
var path = paths[i];
|
|
1539
|
+
if (!current) break;
|
|
1540
|
+
|
|
1541
|
+
if (i === j - 1) {
|
|
1542
|
+
result = current[path];
|
|
1543
|
+
break;
|
|
1544
|
+
}
|
|
1545
|
+
current = current[path];
|
|
1546
|
+
}
|
|
1547
|
+
return result;
|
|
1548
|
+
};
|
|
1549
|
+
|
|
1550
|
+
function getPropByPath(obj, path, strict) {
|
|
1551
|
+
var tempObj = obj;
|
|
1552
|
+
path = path.replace(/\[(\w+)\]/g, '.$1');
|
|
1553
|
+
path = path.replace(/^\./, '');
|
|
1554
|
+
|
|
1555
|
+
var keyArr = path.split('.');
|
|
1556
|
+
var i = 0;
|
|
1557
|
+
for (var len = keyArr.length; i < len - 1; ++i) {
|
|
1558
|
+
if (!tempObj && !strict) break;
|
|
1559
|
+
var key = keyArr[i];
|
|
1560
|
+
if (key in tempObj) {
|
|
1561
|
+
tempObj = tempObj[key];
|
|
1562
|
+
} else {
|
|
1563
|
+
if (strict) {
|
|
1564
|
+
throw new Error('please transfer a valid prop path to form item!');
|
|
1565
|
+
}
|
|
1566
|
+
break;
|
|
1567
|
+
}
|
|
1568
|
+
}
|
|
1569
|
+
return {
|
|
1570
|
+
o: tempObj,
|
|
1571
|
+
k: keyArr[i],
|
|
1572
|
+
v: tempObj ? tempObj[keyArr[i]] : null
|
|
1573
|
+
};
|
|
1574
|
+
};
|
|
1575
|
+
|
|
1576
|
+
var generateId = function generateId() {
|
|
1577
|
+
return Math.floor(Math.random() * 10000);
|
|
1578
|
+
};
|
|
1579
|
+
|
|
1580
|
+
var valueEquals = function valueEquals(a, b) {
|
|
1581
|
+
// see: https://stackoverflow.com/questions/3115982/how-to-check-if-two-arrays-are-equal-with-javascript
|
|
1582
|
+
if (a === b) return true;
|
|
1583
|
+
if (!(a instanceof Array)) return false;
|
|
1584
|
+
if (!(b instanceof Array)) return false;
|
|
1585
|
+
if (a.length !== b.length) return false;
|
|
1586
|
+
for (var i = 0; i !== a.length; ++i) {
|
|
1587
|
+
if (a[i] !== b[i]) return false;
|
|
1588
|
+
}
|
|
1589
|
+
return true;
|
|
1590
|
+
};
|
|
1591
|
+
|
|
1592
|
+
var escapeRegexpString = function escapeRegexpString() {
|
|
1593
|
+
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
1594
|
+
return String(value).replace(/[|\\{}()[\]^$+*?.]/g, '\\$&');
|
|
1595
|
+
};
|
|
1596
|
+
|
|
1597
|
+
// TODO: use native Array.find, Array.findIndex when IE support is dropped
|
|
1598
|
+
var arrayFindIndex = function arrayFindIndex(arr, pred) {
|
|
1599
|
+
for (var i = 0; i !== arr.length; ++i) {
|
|
1600
|
+
if (pred(arr[i])) {
|
|
1601
|
+
return i;
|
|
1602
|
+
}
|
|
1603
|
+
}
|
|
1604
|
+
return -1;
|
|
1605
|
+
};
|
|
1606
|
+
|
|
1607
|
+
var arrayFind = function arrayFind(arr, pred) {
|
|
1608
|
+
var idx = arrayFindIndex(arr, pred);
|
|
1609
|
+
return idx !== -1 ? arr[idx] : undefined;
|
|
1610
|
+
};
|
|
1611
|
+
|
|
1612
|
+
// coerce truthy value to array
|
|
1613
|
+
var coerceTruthyValueToArray = function coerceTruthyValueToArray(val) {
|
|
1614
|
+
if (Array.isArray(val)) {
|
|
1615
|
+
return val;
|
|
1616
|
+
} else if (val) {
|
|
1617
|
+
return [val];
|
|
1618
|
+
} else {
|
|
1619
|
+
return [];
|
|
1620
|
+
}
|
|
1621
|
+
};
|
|
1622
|
+
|
|
1623
|
+
var isIE = function isIE() {
|
|
1624
|
+
return !vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer && !isNaN(Number(document.documentMode));
|
|
1625
|
+
};
|
|
1626
|
+
|
|
1627
|
+
var isEdge = function isEdge() {
|
|
1628
|
+
return !vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer && navigator.userAgent.indexOf('Edge') > -1;
|
|
1629
|
+
};
|
|
1630
|
+
|
|
1631
|
+
var isFirefox = function isFirefox() {
|
|
1632
|
+
return !vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer && !!window.navigator.userAgent.match(/firefox/i);
|
|
1633
|
+
};
|
|
1634
|
+
|
|
1635
|
+
var autoprefixer = function autoprefixer(style) {
|
|
1636
|
+
if ((typeof style === 'undefined' ? 'undefined' : _typeof(style)) !== 'object') return style;
|
|
1637
|
+
var rules = ['transform', 'transition', 'animation'];
|
|
1638
|
+
var prefixes = ['ms-', 'webkit-'];
|
|
1639
|
+
rules.forEach(function (rule) {
|
|
1640
|
+
var value = style[rule];
|
|
1641
|
+
if (rule && value) {
|
|
1642
|
+
prefixes.forEach(function (prefix) {
|
|
1643
|
+
style[prefix + rule] = value;
|
|
1644
|
+
});
|
|
1645
|
+
}
|
|
1646
|
+
});
|
|
1647
|
+
return style;
|
|
1648
|
+
};
|
|
1649
|
+
|
|
1650
|
+
var kebabCase = function kebabCase(str) {
|
|
1651
|
+
var hyphenateRE = /([^-])([A-Z])/g;
|
|
1652
|
+
return str.replace(hyphenateRE, '$1-$2').replace(hyphenateRE, '$1-$2').toLowerCase();
|
|
1653
|
+
};
|
|
1654
|
+
|
|
1655
|
+
var capitalize = function capitalize(str) {
|
|
1656
|
+
if (!Object(element_ui_src_utils_types__WEBPACK_IMPORTED_MODULE_1__[/* isString */ "e"])(str)) return str;
|
|
1657
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
1658
|
+
};
|
|
1659
|
+
|
|
1660
|
+
var looseEqual = function looseEqual(a, b) {
|
|
1661
|
+
var isObjectA = Object(element_ui_src_utils_types__WEBPACK_IMPORTED_MODULE_1__[/* isObject */ "d"])(a);
|
|
1662
|
+
var isObjectB = Object(element_ui_src_utils_types__WEBPACK_IMPORTED_MODULE_1__[/* isObject */ "d"])(b);
|
|
1663
|
+
if (isObjectA && isObjectB) {
|
|
1664
|
+
return JSON.stringify(a) === JSON.stringify(b);
|
|
1665
|
+
} else if (!isObjectA && !isObjectB) {
|
|
1666
|
+
return String(a) === String(b);
|
|
1667
|
+
} else {
|
|
1668
|
+
return false;
|
|
1669
|
+
}
|
|
1670
|
+
};
|
|
1671
|
+
|
|
1672
|
+
var arrayEquals = function arrayEquals(arrayA, arrayB) {
|
|
1673
|
+
arrayA = arrayA || [];
|
|
1674
|
+
arrayB = arrayB || [];
|
|
1675
|
+
|
|
1676
|
+
if (arrayA.length !== arrayB.length) {
|
|
1677
|
+
return false;
|
|
1678
|
+
}
|
|
1679
|
+
|
|
1680
|
+
for (var i = 0; i < arrayA.length; i++) {
|
|
1681
|
+
if (!looseEqual(arrayA[i], arrayB[i])) {
|
|
1682
|
+
return false;
|
|
1683
|
+
}
|
|
1684
|
+
}
|
|
1685
|
+
|
|
1686
|
+
return true;
|
|
1687
|
+
};
|
|
1688
|
+
|
|
1689
|
+
var isEqual = function isEqual(value1, value2) {
|
|
1690
|
+
if (Array.isArray(value1) && Array.isArray(value2)) {
|
|
1691
|
+
return arrayEquals(value1, value2);
|
|
1692
|
+
}
|
|
1693
|
+
return looseEqual(value1, value2);
|
|
1694
|
+
};
|
|
1695
|
+
|
|
1696
|
+
var isEmpty = function isEmpty(val) {
|
|
1697
|
+
// null or undefined
|
|
1698
|
+
if (val == null) return true;
|
|
1699
|
+
|
|
1700
|
+
if (typeof val === 'boolean') return false;
|
|
1701
|
+
|
|
1702
|
+
if (typeof val === 'number') return !val;
|
|
1703
|
+
|
|
1704
|
+
if (val instanceof Error) return val.message === '';
|
|
1705
|
+
|
|
1706
|
+
switch (Object.prototype.toString.call(val)) {
|
|
1707
|
+
// String or Array
|
|
1708
|
+
case '[object String]':
|
|
1709
|
+
case '[object Array]':
|
|
1710
|
+
return !val.length;
|
|
1711
|
+
|
|
1712
|
+
// Map or Set or File
|
|
1713
|
+
case '[object File]':
|
|
1714
|
+
case '[object Map]':
|
|
1715
|
+
case '[object Set]':
|
|
1716
|
+
{
|
|
1717
|
+
return !val.size;
|
|
1718
|
+
}
|
|
1719
|
+
// Plain Object
|
|
1720
|
+
case '[object Object]':
|
|
1721
|
+
{
|
|
1722
|
+
return !Object.keys(val).length;
|
|
1723
|
+
}
|
|
1724
|
+
}
|
|
1725
|
+
|
|
1726
|
+
return false;
|
|
1727
|
+
};
|
|
1728
|
+
|
|
1729
|
+
function rafThrottle(fn) {
|
|
1730
|
+
var locked = false;
|
|
1731
|
+
return function () {
|
|
1732
|
+
var _this = this;
|
|
1733
|
+
|
|
1734
|
+
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
|
1735
|
+
args[_key] = arguments[_key];
|
|
1736
|
+
}
|
|
1737
|
+
|
|
1738
|
+
if (locked) return;
|
|
1739
|
+
locked = true;
|
|
1740
|
+
window.requestAnimationFrame(function (_) {
|
|
1741
|
+
fn.apply(_this, args);
|
|
1742
|
+
locked = false;
|
|
1743
|
+
});
|
|
1744
|
+
};
|
|
1745
|
+
}
|
|
1746
|
+
|
|
1747
|
+
function objToArray(obj) {
|
|
1748
|
+
if (Array.isArray(obj)) {
|
|
1749
|
+
return obj;
|
|
1750
|
+
}
|
|
1751
|
+
return isEmpty(obj) ? [] : [obj];
|
|
1752
|
+
}
|
|
1753
|
+
|
|
1754
|
+
var isMac = function isMac() {
|
|
1755
|
+
return !vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer && /macintosh|mac os x/i.test(navigator.userAgent);
|
|
1756
|
+
};
|
|
1757
|
+
|
|
1758
|
+
/***/ }),
|
|
1759
|
+
|
|
1760
|
+
/***/ 31:
|
|
1761
|
+
/***/ (function(module, exports) {
|
|
1762
|
+
|
|
1763
|
+
var nestRE = /^(attrs|props|on|nativeOn|class|style|hook)$/
|
|
1764
|
+
|
|
1765
|
+
module.exports = function mergeJSXProps (objs) {
|
|
1766
|
+
return objs.reduce(function (a, b) {
|
|
1767
|
+
var aa, bb, key, nestedKey, temp
|
|
1768
|
+
for (key in b) {
|
|
1769
|
+
aa = a[key]
|
|
1770
|
+
bb = b[key]
|
|
1771
|
+
if (aa && nestRE.test(key)) {
|
|
1772
|
+
// normalize class
|
|
1773
|
+
if (key === 'class') {
|
|
1774
|
+
if (typeof aa === 'string') {
|
|
1775
|
+
temp = aa
|
|
1776
|
+
a[key] = aa = {}
|
|
1777
|
+
aa[temp] = true
|
|
1778
|
+
}
|
|
1779
|
+
if (typeof bb === 'string') {
|
|
1780
|
+
temp = bb
|
|
1781
|
+
b[key] = bb = {}
|
|
1782
|
+
bb[temp] = true
|
|
1783
|
+
}
|
|
1784
|
+
}
|
|
1785
|
+
if (key === 'on' || key === 'nativeOn' || key === 'hook') {
|
|
1786
|
+
// merge functions
|
|
1787
|
+
for (nestedKey in bb) {
|
|
1788
|
+
aa[nestedKey] = mergeFn(aa[nestedKey], bb[nestedKey])
|
|
1789
|
+
}
|
|
1790
|
+
} else if (Array.isArray(aa)) {
|
|
1791
|
+
a[key] = aa.concat(bb)
|
|
1792
|
+
} else if (Array.isArray(bb)) {
|
|
1793
|
+
a[key] = [aa].concat(bb)
|
|
1794
|
+
} else {
|
|
1795
|
+
for (nestedKey in bb) {
|
|
1796
|
+
aa[nestedKey] = bb[nestedKey]
|
|
1797
|
+
}
|
|
1798
|
+
}
|
|
1799
|
+
} else {
|
|
1800
|
+
a[key] = b[key]
|
|
1801
|
+
}
|
|
1802
|
+
}
|
|
1803
|
+
return a
|
|
1804
|
+
}, {})
|
|
1805
|
+
}
|
|
1806
|
+
|
|
1807
|
+
function mergeFn (a, b) {
|
|
1808
|
+
return function () {
|
|
1809
|
+
a && a.apply(this, arguments)
|
|
1810
|
+
b && b.apply(this, arguments)
|
|
1811
|
+
}
|
|
1812
|
+
}
|
|
1813
|
+
|
|
1814
|
+
|
|
1815
|
+
/***/ }),
|
|
1816
|
+
|
|
1817
|
+
/***/ 37:
|
|
1818
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1819
|
+
|
|
1820
|
+
"use strict";
|
|
1821
|
+
// ESM COMPAT FLAG
|
|
1822
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1823
|
+
|
|
1824
|
+
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./packages/progress/src/progress.vue?vue&type=template&id=279ef2ef
|
|
1825
|
+
var render = function render() {
|
|
1826
|
+
var _vm = this,
|
|
1827
|
+
_c = _vm._self._c
|
|
1828
|
+
return _c(
|
|
1829
|
+
"div",
|
|
1830
|
+
{
|
|
1831
|
+
staticClass: "el-progress",
|
|
1832
|
+
class: [
|
|
1833
|
+
"el-progress--" + _vm.type,
|
|
1834
|
+
_vm.status ? "is-" + _vm.status : "",
|
|
1835
|
+
{
|
|
1836
|
+
"el-progress--without-text": !_vm.showText,
|
|
1837
|
+
"el-progress--text-inside": _vm.textInside,
|
|
1838
|
+
},
|
|
1839
|
+
],
|
|
1840
|
+
attrs: {
|
|
1841
|
+
role: "progressbar",
|
|
1842
|
+
"aria-valuenow": _vm.percentage,
|
|
1843
|
+
"aria-valuemin": "0",
|
|
1844
|
+
"aria-valuemax": "100",
|
|
1845
|
+
},
|
|
1846
|
+
},
|
|
1847
|
+
[
|
|
1848
|
+
_vm.type === "line"
|
|
1849
|
+
? _c("div", { staticClass: "el-progress-bar" }, [
|
|
1850
|
+
_c(
|
|
1851
|
+
"div",
|
|
1852
|
+
{
|
|
1853
|
+
staticClass: "el-progress-bar__outer",
|
|
1854
|
+
style: {
|
|
1855
|
+
height: _vm.strokeWidth + "px",
|
|
1856
|
+
backgroundColor: _vm.defineBackColor,
|
|
1857
|
+
},
|
|
1858
|
+
},
|
|
1859
|
+
[
|
|
1860
|
+
_c(
|
|
1861
|
+
"div",
|
|
1862
|
+
{
|
|
1863
|
+
staticClass: "el-progress-bar__inner",
|
|
1864
|
+
style: _vm.barStyle,
|
|
1865
|
+
},
|
|
1866
|
+
[
|
|
1867
|
+
_vm.showText && _vm.textInside
|
|
1868
|
+
? _c(
|
|
1869
|
+
"div",
|
|
1870
|
+
{
|
|
1871
|
+
staticClass: "el-progress-bar__innerText",
|
|
1872
|
+
style: { color: _vm.textColor },
|
|
1873
|
+
},
|
|
1874
|
+
[_vm._v(_vm._s(_vm.content))]
|
|
1875
|
+
)
|
|
1876
|
+
: _vm._e(),
|
|
1877
|
+
]
|
|
1878
|
+
),
|
|
1879
|
+
]
|
|
1880
|
+
),
|
|
1881
|
+
])
|
|
1882
|
+
: _c(
|
|
1883
|
+
"div",
|
|
1884
|
+
{
|
|
1885
|
+
staticClass: "el-progress-circle",
|
|
1886
|
+
style: { height: _vm.width + "px", width: _vm.width + "px" },
|
|
1887
|
+
},
|
|
1888
|
+
[
|
|
1889
|
+
_c("svg", { attrs: { viewBox: "0 0 100 100" } }, [
|
|
1890
|
+
_c("path", {
|
|
1891
|
+
staticClass: "el-progress-circle__track",
|
|
1892
|
+
style: _vm.trailPathStyle,
|
|
1893
|
+
attrs: {
|
|
1894
|
+
d: _vm.trackPath,
|
|
1895
|
+
stroke: _vm.defineBackColor,
|
|
1896
|
+
"stroke-width": _vm.relativeStrokeWidth,
|
|
1897
|
+
fill: "none",
|
|
1898
|
+
},
|
|
1899
|
+
}),
|
|
1900
|
+
_c("path", {
|
|
1901
|
+
staticClass: "el-progress-circle__path",
|
|
1902
|
+
style: _vm.circlePathStyle,
|
|
1903
|
+
attrs: {
|
|
1904
|
+
d: _vm.trackPath,
|
|
1905
|
+
stroke: _vm.stroke,
|
|
1906
|
+
fill: "none",
|
|
1907
|
+
"stroke-linecap": _vm.strokeLinecap,
|
|
1908
|
+
"stroke-width": _vm.percentage
|
|
1909
|
+
? _vm.relativeStrokeWidth
|
|
1910
|
+
: 0,
|
|
1911
|
+
},
|
|
1912
|
+
}),
|
|
1913
|
+
]),
|
|
1914
|
+
]
|
|
1915
|
+
),
|
|
1916
|
+
_vm.showText && !_vm.textInside
|
|
1917
|
+
? _c(
|
|
1918
|
+
"div",
|
|
1919
|
+
{
|
|
1920
|
+
staticClass: "el-progress__text",
|
|
1921
|
+
style: {
|
|
1922
|
+
fontSize: _vm.progressTextSize + "px",
|
|
1923
|
+
color: _vm.textColor,
|
|
1924
|
+
},
|
|
1925
|
+
},
|
|
1926
|
+
[
|
|
1927
|
+
!_vm.status
|
|
1928
|
+
? [_vm._v(_vm._s(_vm.content))]
|
|
1929
|
+
: _c("i", { class: _vm.iconClass }),
|
|
1930
|
+
],
|
|
1931
|
+
2
|
|
1932
|
+
)
|
|
1933
|
+
: _vm._e(),
|
|
1934
|
+
]
|
|
1935
|
+
)
|
|
1936
|
+
}
|
|
1937
|
+
var staticRenderFns = []
|
|
1938
|
+
render._withStripped = true
|
|
1939
|
+
|
|
1940
|
+
|
|
1941
|
+
// CONCATENATED MODULE: ./packages/progress/src/progress.vue?vue&type=template&id=279ef2ef
|
|
1942
|
+
|
|
1943
|
+
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/progress/src/progress.vue?vue&type=script&lang=js
|
|
1944
|
+
|
|
1945
|
+
/* harmony default export */ var progressvue_type_script_lang_js = ({
|
|
1946
|
+
name: 'ElProgress',
|
|
1947
|
+
props: {
|
|
1948
|
+
type: {
|
|
1949
|
+
type: String,
|
|
1950
|
+
default: 'line',
|
|
1951
|
+
validator: function validator(val) {
|
|
1952
|
+
return ['line', 'circle', 'dashboard'].indexOf(val) > -1;
|
|
1953
|
+
}
|
|
1954
|
+
},
|
|
1955
|
+
percentage: {
|
|
1956
|
+
type: Number,
|
|
1957
|
+
default: 0,
|
|
1958
|
+
required: true,
|
|
1959
|
+
validator: function validator(val) {
|
|
1960
|
+
return val >= 0 && val <= 100;
|
|
1961
|
+
}
|
|
1962
|
+
},
|
|
1963
|
+
status: {
|
|
1964
|
+
type: String,
|
|
1965
|
+
validator: function validator(val) {
|
|
1966
|
+
return ['success', 'exception', 'warning'].indexOf(val) > -1;
|
|
1967
|
+
}
|
|
1968
|
+
},
|
|
1969
|
+
strokeWidth: {
|
|
1970
|
+
type: Number,
|
|
1971
|
+
default: 6
|
|
1972
|
+
},
|
|
1973
|
+
strokeLinecap: {
|
|
1974
|
+
type: String,
|
|
1975
|
+
default: 'round'
|
|
1976
|
+
},
|
|
1977
|
+
textInside: {
|
|
1978
|
+
type: Boolean,
|
|
1979
|
+
default: false
|
|
1980
|
+
},
|
|
1981
|
+
width: {
|
|
1982
|
+
type: Number,
|
|
1983
|
+
default: 126
|
|
1984
|
+
},
|
|
1985
|
+
showText: {
|
|
1986
|
+
type: Boolean,
|
|
1987
|
+
default: true
|
|
1988
|
+
},
|
|
1989
|
+
color: {
|
|
1990
|
+
type: [String, Array, Function],
|
|
1991
|
+
default: ''
|
|
1992
|
+
},
|
|
1993
|
+
defineBackColor: {
|
|
1994
|
+
type: [String, Array, Function],
|
|
1995
|
+
default: '#ebeef5'
|
|
1996
|
+
},
|
|
1997
|
+
textColor: {
|
|
1998
|
+
type: [String, Array, Function],
|
|
1999
|
+
default: '#606266'
|
|
2000
|
+
},
|
|
2001
|
+
format: Function
|
|
2002
|
+
},
|
|
2003
|
+
computed: {
|
|
2004
|
+
barStyle: function barStyle() {
|
|
2005
|
+
var style = {};
|
|
2006
|
+
style.width = this.percentage + '%';
|
|
2007
|
+
style.backgroundColor = this.getCurrentColor(this.percentage);
|
|
2008
|
+
return style;
|
|
2009
|
+
},
|
|
2010
|
+
relativeStrokeWidth: function relativeStrokeWidth() {
|
|
2011
|
+
return (this.strokeWidth / this.width * 100).toFixed(1);
|
|
2012
|
+
},
|
|
2013
|
+
radius: function radius() {
|
|
2014
|
+
if (this.type === 'circle' || this.type === 'dashboard') {
|
|
2015
|
+
return parseInt(50 - parseFloat(this.relativeStrokeWidth) / 2, 10);
|
|
2016
|
+
} else {
|
|
2017
|
+
return 0;
|
|
2018
|
+
}
|
|
2019
|
+
},
|
|
2020
|
+
trackPath: function trackPath() {
|
|
2021
|
+
var radius = this.radius;
|
|
2022
|
+
var isDashboard = this.type === 'dashboard';
|
|
2023
|
+
return '\n\t\t\t\t\tM 50 50\n\t\t\t\t\tm 0 ' + (isDashboard ? '' : '-') + radius + '\n\t\t\t\t\ta ' + radius + ' ' + radius + ' 0 1 1 0 ' + (isDashboard ? '-' : '') + radius * 2 + '\n\t\t\t\t\ta ' + radius + ' ' + radius + ' 0 1 1 0 ' + (isDashboard ? '' : '-') + radius * 2 + '\n\t\t\t\t\t';
|
|
2024
|
+
},
|
|
2025
|
+
perimeter: function perimeter() {
|
|
2026
|
+
return 2 * Math.PI * this.radius;
|
|
2027
|
+
},
|
|
2028
|
+
rate: function rate() {
|
|
2029
|
+
return this.type === 'dashboard' ? 0.75 : 1;
|
|
2030
|
+
},
|
|
2031
|
+
strokeDashoffset: function strokeDashoffset() {
|
|
2032
|
+
var offset = -1 * this.perimeter * (1 - this.rate) / 2;
|
|
2033
|
+
return offset + 'px';
|
|
2034
|
+
},
|
|
2035
|
+
trailPathStyle: function trailPathStyle() {
|
|
2036
|
+
return {
|
|
2037
|
+
strokeDasharray: this.perimeter * this.rate + 'px, ' + this.perimeter + 'px',
|
|
2038
|
+
strokeDashoffset: this.strokeDashoffset
|
|
2039
|
+
};
|
|
2040
|
+
},
|
|
2041
|
+
circlePathStyle: function circlePathStyle() {
|
|
2042
|
+
return {
|
|
2043
|
+
strokeDasharray: this.perimeter * this.rate * (this.percentage / 100) + 'px, ' + this.perimeter + 'px',
|
|
2044
|
+
strokeDashoffset: this.strokeDashoffset,
|
|
2045
|
+
transition: 'stroke-dasharray 0.6s ease 0s, stroke 0.6s ease'
|
|
2046
|
+
};
|
|
2047
|
+
},
|
|
2048
|
+
stroke: function stroke() {
|
|
2049
|
+
var ret = void 0;
|
|
2050
|
+
if (this.color) {
|
|
2051
|
+
ret = this.getCurrentColor(this.percentage);
|
|
2052
|
+
} else {
|
|
2053
|
+
switch (this.status) {
|
|
2054
|
+
case 'success':
|
|
2055
|
+
ret = '#13ce66';
|
|
2056
|
+
break;
|
|
2057
|
+
case 'exception':
|
|
2058
|
+
ret = '#ff4949';
|
|
2059
|
+
break;
|
|
2060
|
+
case 'warning':
|
|
2061
|
+
ret = '#e6a23c';
|
|
2062
|
+
break;
|
|
2063
|
+
default:
|
|
2064
|
+
ret = '#20a0ff';
|
|
2065
|
+
}
|
|
2066
|
+
}
|
|
2067
|
+
return ret;
|
|
2068
|
+
},
|
|
2069
|
+
iconClass: function iconClass() {
|
|
2070
|
+
if (this.status === 'warning') {
|
|
2071
|
+
return 'el-icon-warning';
|
|
2072
|
+
}
|
|
2073
|
+
if (this.type === 'line') {
|
|
2074
|
+
return this.status === 'success' ? 'el-icon-circle-check' : 'el-icon-circle-close';
|
|
2075
|
+
} else {
|
|
2076
|
+
return this.status === 'success' ? 'el-icon-check' : 'el-icon-close';
|
|
2077
|
+
}
|
|
2078
|
+
},
|
|
2079
|
+
progressTextSize: function progressTextSize() {
|
|
2080
|
+
return this.type === 'line' ? 12 + this.strokeWidth * 0.4 : this.width * 0.111111 + 2;
|
|
2081
|
+
},
|
|
2082
|
+
content: function content() {
|
|
2083
|
+
if (typeof this.format === 'function') {
|
|
2084
|
+
return this.format(this.percentage) || '';
|
|
2085
|
+
} else {
|
|
2086
|
+
return this.percentage + '%';
|
|
2087
|
+
}
|
|
2088
|
+
}
|
|
2089
|
+
},
|
|
2090
|
+
methods: {
|
|
2091
|
+
getCurrentColor: function getCurrentColor(percentage) {
|
|
2092
|
+
if (typeof this.color === 'function') {
|
|
2093
|
+
return this.color(percentage);
|
|
2094
|
+
} else if (typeof this.color === 'string') {
|
|
2095
|
+
return this.color;
|
|
2096
|
+
} else {
|
|
2097
|
+
return this.getLevelColor(percentage);
|
|
2098
|
+
}
|
|
2099
|
+
},
|
|
2100
|
+
getLevelColor: function getLevelColor(percentage) {
|
|
2101
|
+
var colorArray = this.getColorArray().sort(function (a, b) {
|
|
2102
|
+
return a.percentage - b.percentage;
|
|
2103
|
+
});
|
|
2104
|
+
|
|
2105
|
+
for (var i = 0; i < colorArray.length; i++) {
|
|
2106
|
+
if (colorArray[i].percentage > percentage) {
|
|
2107
|
+
return colorArray[i].color;
|
|
2108
|
+
}
|
|
2109
|
+
}
|
|
2110
|
+
return colorArray[colorArray.length - 1].color;
|
|
2111
|
+
},
|
|
2112
|
+
getColorArray: function getColorArray() {
|
|
2113
|
+
var color = this.color;
|
|
2114
|
+
var span = 100 / color.length;
|
|
2115
|
+
return color.map(function (seriesColor, index) {
|
|
2116
|
+
if (typeof seriesColor === 'string') {
|
|
2117
|
+
return {
|
|
2118
|
+
color: seriesColor,
|
|
2119
|
+
percentage: (index + 1) * span
|
|
2120
|
+
};
|
|
2121
|
+
}
|
|
2122
|
+
return seriesColor;
|
|
2123
|
+
});
|
|
2124
|
+
}
|
|
2125
|
+
}
|
|
2126
|
+
});
|
|
2127
|
+
// CONCATENATED MODULE: ./packages/progress/src/progress.vue?vue&type=script&lang=js
|
|
2128
|
+
/* harmony default export */ var src_progressvue_type_script_lang_js = (progressvue_type_script_lang_js);
|
|
2129
|
+
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
|
2130
|
+
var componentNormalizer = __webpack_require__(2);
|
|
2131
|
+
|
|
2132
|
+
// CONCATENATED MODULE: ./packages/progress/src/progress.vue
|
|
2133
|
+
|
|
2134
|
+
|
|
2135
|
+
|
|
2136
|
+
|
|
2137
|
+
|
|
2138
|
+
/* normalize component */
|
|
2139
|
+
|
|
2140
|
+
var component = Object(componentNormalizer["a" /* default */])(
|
|
2141
|
+
src_progressvue_type_script_lang_js,
|
|
2142
|
+
render,
|
|
2143
|
+
staticRenderFns,
|
|
2144
|
+
false,
|
|
2145
|
+
null,
|
|
2146
|
+
null,
|
|
2147
|
+
null
|
|
2148
|
+
|
|
2149
|
+
)
|
|
2150
|
+
|
|
2151
|
+
/* harmony default export */ var progress = (component.exports);
|
|
2152
|
+
// CONCATENATED MODULE: ./packages/progress/index.js
|
|
2153
|
+
|
|
2154
|
+
|
|
2155
|
+
/* istanbul ignore next */
|
|
2156
|
+
progress.install = function (Vue) {
|
|
2157
|
+
Vue.component(progress.name, progress);
|
|
2158
|
+
};
|
|
2159
|
+
|
|
2160
|
+
/* harmony default export */ var packages_progress = __webpack_exports__["default"] = (progress);
|
|
2161
|
+
|
|
2162
|
+
/***/ }),
|
|
2163
|
+
|
|
2164
|
+
/***/ 4:
|
|
2165
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2166
|
+
|
|
2167
|
+
"use strict";
|
|
2168
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return isString; });
|
|
2169
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return isObject; });
|
|
2170
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return isHtmlElement; });
|
|
2171
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return isFunction; });
|
|
2172
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return isUndefined; });
|
|
2173
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isDefined; });
|
|
2174
|
+
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
|
2175
|
+
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
|
|
2176
|
+
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
|
2177
|
+
|
|
2178
|
+
|
|
2179
|
+
|
|
2180
|
+
function isString(obj) {
|
|
2181
|
+
return Object.prototype.toString.call(obj) === '[object String]';
|
|
2182
|
+
}
|
|
2183
|
+
|
|
2184
|
+
function isObject(obj) {
|
|
2185
|
+
return Object.prototype.toString.call(obj) === '[object Object]';
|
|
2186
|
+
}
|
|
2187
|
+
|
|
2188
|
+
function isHtmlElement(node) {
|
|
2189
|
+
return node && node.nodeType === Node.ELEMENT_NODE;
|
|
2190
|
+
}
|
|
2191
|
+
|
|
2192
|
+
/**
|
|
2193
|
+
* - Inspired:
|
|
2194
|
+
* https://github.com/jashkenas/underscore/blob/master/modules/isFunction.js
|
|
2195
|
+
*/
|
|
2196
|
+
var isFunction = function isFunction(functionToCheck) {
|
|
2197
|
+
var getType = {};
|
|
2198
|
+
return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
|
|
2199
|
+
};
|
|
2200
|
+
|
|
2201
|
+
if ( true && (typeof Int8Array === 'undefined' ? 'undefined' : _typeof(Int8Array)) !== 'object' && (vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer || typeof document.childNodes !== 'function')) {
|
|
2202
|
+
isFunction = function isFunction(obj) {
|
|
2203
|
+
return typeof obj === 'function' || false;
|
|
2204
|
+
};
|
|
2205
|
+
}
|
|
2206
|
+
|
|
2207
|
+
|
|
2208
|
+
|
|
2209
|
+
var isUndefined = function isUndefined(val) {
|
|
2210
|
+
return val === void 0;
|
|
2211
|
+
};
|
|
2212
|
+
|
|
2213
|
+
var isDefined = function isDefined(val) {
|
|
2214
|
+
return val !== undefined && val !== null;
|
|
2215
|
+
};
|
|
2216
|
+
|
|
2217
|
+
/***/ }),
|
|
2218
|
+
|
|
2219
|
+
/***/ 69:
|
|
2220
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2221
|
+
|
|
2222
|
+
"use strict";
|
|
2223
|
+
// ESM COMPAT FLAG
|
|
2224
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2225
|
+
|
|
2226
|
+
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./packages/upload/src/upload-list.vue?vue&type=template&id=f52834b0
|
|
2227
|
+
var upload_listvue_type_template_id_f52834b0_render = function render() {
|
|
2228
|
+
var _vm = this,
|
|
2229
|
+
_c = _vm._self._c
|
|
2230
|
+
return _c(
|
|
2231
|
+
"transition-group",
|
|
2232
|
+
{
|
|
2233
|
+
class: [
|
|
2234
|
+
"el-upload-list",
|
|
2235
|
+
"el-upload-list--" + _vm.listType,
|
|
2236
|
+
{ "is-disabled": _vm.disabled },
|
|
2237
|
+
],
|
|
2238
|
+
attrs: { tag: "ul", name: "el-list" },
|
|
2239
|
+
},
|
|
2240
|
+
_vm._l(_vm.files, function (file) {
|
|
2241
|
+
return _c(
|
|
2242
|
+
"li",
|
|
2243
|
+
{
|
|
2244
|
+
key: file.uid,
|
|
2245
|
+
class: [
|
|
2246
|
+
"el-upload-list__item",
|
|
2247
|
+
"is-" + file.status,
|
|
2248
|
+
_vm.focusing ? "focusing" : "",
|
|
2249
|
+
],
|
|
2250
|
+
attrs: { tabindex: "0" },
|
|
2251
|
+
on: {
|
|
2252
|
+
keydown: function ($event) {
|
|
2253
|
+
if (
|
|
2254
|
+
!$event.type.indexOf("key") &&
|
|
2255
|
+
_vm._k($event.keyCode, "delete", [8, 46], $event.key, [
|
|
2256
|
+
"Backspace",
|
|
2257
|
+
"Delete",
|
|
2258
|
+
"Del",
|
|
2259
|
+
])
|
|
2260
|
+
)
|
|
2261
|
+
return null
|
|
2262
|
+
!_vm.disabled && _vm.$emit("remove", file)
|
|
2263
|
+
},
|
|
2264
|
+
focus: function ($event) {
|
|
2265
|
+
_vm.focusing = true
|
|
2266
|
+
},
|
|
2267
|
+
blur: function ($event) {
|
|
2268
|
+
_vm.focusing = false
|
|
2269
|
+
},
|
|
2270
|
+
click: function ($event) {
|
|
2271
|
+
_vm.focusing = false
|
|
2272
|
+
},
|
|
2273
|
+
},
|
|
2274
|
+
},
|
|
2275
|
+
[
|
|
2276
|
+
_vm._t(
|
|
2277
|
+
"default",
|
|
2278
|
+
function () {
|
|
2279
|
+
return [
|
|
2280
|
+
file.status !== "uploading" &&
|
|
2281
|
+
["picture-card", "picture"].indexOf(_vm.listType) > -1
|
|
2282
|
+
? _c("img", {
|
|
2283
|
+
staticClass: "el-upload-list__item-thumbnail",
|
|
2284
|
+
attrs: { src: file.url, alt: "" },
|
|
2285
|
+
})
|
|
2286
|
+
: _vm._e(),
|
|
2287
|
+
_c(
|
|
2288
|
+
"a",
|
|
2289
|
+
{
|
|
2290
|
+
staticClass: "el-upload-list__item-name",
|
|
2291
|
+
on: {
|
|
2292
|
+
click: function ($event) {
|
|
2293
|
+
return _vm.handleClick(file)
|
|
2294
|
+
},
|
|
2295
|
+
},
|
|
2296
|
+
},
|
|
2297
|
+
[
|
|
2298
|
+
_c("i", { staticClass: "el-icon-document" }),
|
|
2299
|
+
_vm._v(_vm._s(file.name) + "\n\t\t\t"),
|
|
2300
|
+
]
|
|
2301
|
+
),
|
|
2302
|
+
_c(
|
|
2303
|
+
"label",
|
|
2304
|
+
{ staticClass: "el-upload-list__item-status-label" },
|
|
2305
|
+
[
|
|
2306
|
+
_c("i", {
|
|
2307
|
+
class: {
|
|
2308
|
+
"el-icon-upload-success": true,
|
|
2309
|
+
"el-icon-circle-check": _vm.listType === "text",
|
|
2310
|
+
"el-icon-check":
|
|
2311
|
+
["picture-card", "picture"].indexOf(_vm.listType) >
|
|
2312
|
+
-1,
|
|
2313
|
+
},
|
|
2314
|
+
}),
|
|
2315
|
+
]
|
|
2316
|
+
),
|
|
2317
|
+
!_vm.disabled
|
|
2318
|
+
? _c("i", {
|
|
2319
|
+
staticClass: "el-icon-close",
|
|
2320
|
+
on: {
|
|
2321
|
+
click: function ($event) {
|
|
2322
|
+
return _vm.$emit("remove", file)
|
|
2323
|
+
},
|
|
2324
|
+
},
|
|
2325
|
+
})
|
|
2326
|
+
: _vm._e(),
|
|
2327
|
+
!_vm.disabled
|
|
2328
|
+
? _c("i", { staticClass: "el-icon-close-tip" }, [
|
|
2329
|
+
_vm._v(_vm._s(_vm.t("el.upload.deleteTip"))),
|
|
2330
|
+
])
|
|
2331
|
+
: _vm._e(),
|
|
2332
|
+
file.status === "uploading"
|
|
2333
|
+
? _c("el-progress", {
|
|
2334
|
+
attrs: {
|
|
2335
|
+
type:
|
|
2336
|
+
_vm.listType === "picture-card" ? "circle" : "line",
|
|
2337
|
+
"stroke-width": _vm.listType === "picture-card" ? 6 : 2,
|
|
2338
|
+
percentage: _vm.parsePercentage(file.percentage),
|
|
2339
|
+
},
|
|
2340
|
+
})
|
|
2341
|
+
: _vm._e(),
|
|
2342
|
+
_vm.listType === "picture-card"
|
|
2343
|
+
? _c(
|
|
2344
|
+
"span",
|
|
2345
|
+
{ staticClass: "el-upload-list__item-actions" },
|
|
2346
|
+
[
|
|
2347
|
+
_vm.handlePreview && _vm.listType === "picture-card"
|
|
2348
|
+
? _c(
|
|
2349
|
+
"span",
|
|
2350
|
+
{
|
|
2351
|
+
staticClass: "el-upload-list__item-preview",
|
|
2352
|
+
on: {
|
|
2353
|
+
click: function ($event) {
|
|
2354
|
+
return _vm.handlePreview(file)
|
|
2355
|
+
},
|
|
2356
|
+
},
|
|
2357
|
+
},
|
|
2358
|
+
[_c("i", { staticClass: "el-icon-zoom-in" })]
|
|
2359
|
+
)
|
|
2360
|
+
: _vm._e(),
|
|
2361
|
+
!_vm.disabled
|
|
2362
|
+
? _c(
|
|
2363
|
+
"span",
|
|
2364
|
+
{
|
|
2365
|
+
staticClass: "el-upload-list__item-delete",
|
|
2366
|
+
on: {
|
|
2367
|
+
click: function ($event) {
|
|
2368
|
+
return _vm.$emit("remove", file)
|
|
2369
|
+
},
|
|
2370
|
+
},
|
|
2371
|
+
},
|
|
2372
|
+
[_c("i", { staticClass: "el-icon-delete" })]
|
|
2373
|
+
)
|
|
2374
|
+
: _vm._e(),
|
|
2375
|
+
]
|
|
2376
|
+
)
|
|
2377
|
+
: _vm._e(),
|
|
2378
|
+
]
|
|
2379
|
+
},
|
|
2380
|
+
{ file: file }
|
|
2381
|
+
),
|
|
2382
|
+
],
|
|
2383
|
+
2
|
|
2384
|
+
)
|
|
2385
|
+
}),
|
|
2386
|
+
0
|
|
2387
|
+
)
|
|
2388
|
+
}
|
|
2389
|
+
var staticRenderFns = []
|
|
2390
|
+
upload_listvue_type_template_id_f52834b0_render._withStripped = true
|
|
2391
|
+
|
|
2392
|
+
|
|
2393
|
+
// CONCATENATED MODULE: ./packages/upload/src/upload-list.vue?vue&type=template&id=f52834b0
|
|
2394
|
+
|
|
2395
|
+
// EXTERNAL MODULE: ./src/mixins/locale.js
|
|
2396
|
+
var locale = __webpack_require__(13);
|
|
2397
|
+
|
|
2398
|
+
// EXTERNAL MODULE: ./packages/progress/index.js + 5 modules
|
|
2399
|
+
var progress = __webpack_require__(37);
|
|
2400
|
+
|
|
2401
|
+
// 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
|
|
2402
|
+
|
|
2403
|
+
|
|
2404
|
+
|
|
2405
|
+
|
|
2406
|
+
/* harmony default export */ var upload_listvue_type_script_lang_js = ({
|
|
2407
|
+
|
|
2408
|
+
name: 'ElUploadList',
|
|
2409
|
+
|
|
2410
|
+
mixins: [locale["a" /* default */]],
|
|
2411
|
+
|
|
2412
|
+
data: function data() {
|
|
2413
|
+
return {
|
|
2414
|
+
focusing: false
|
|
2415
|
+
};
|
|
2416
|
+
},
|
|
2417
|
+
|
|
2418
|
+
components: { ElProgress: progress["default"] },
|
|
2419
|
+
|
|
2420
|
+
props: {
|
|
2421
|
+
files: {
|
|
2422
|
+
type: Array,
|
|
2423
|
+
default: function _default() {
|
|
2424
|
+
return [];
|
|
2425
|
+
}
|
|
2426
|
+
},
|
|
2427
|
+
disabled: {
|
|
2428
|
+
type: Boolean,
|
|
2429
|
+
default: false
|
|
2430
|
+
},
|
|
2431
|
+
handlePreview: Function,
|
|
2432
|
+
listType: String
|
|
2433
|
+
},
|
|
2434
|
+
methods: {
|
|
2435
|
+
parsePercentage: function parsePercentage(val) {
|
|
2436
|
+
return parseInt(val, 10);
|
|
2437
|
+
},
|
|
2438
|
+
handleClick: function handleClick(file) {
|
|
2439
|
+
this.handlePreview && this.handlePreview(file);
|
|
2440
|
+
}
|
|
2441
|
+
}
|
|
2442
|
+
});
|
|
2443
|
+
// CONCATENATED MODULE: ./packages/upload/src/upload-list.vue?vue&type=script&lang=js
|
|
2444
|
+
/* harmony default export */ var src_upload_listvue_type_script_lang_js = (upload_listvue_type_script_lang_js);
|
|
2445
|
+
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
|
2446
|
+
var componentNormalizer = __webpack_require__(2);
|
|
2447
|
+
|
|
2448
|
+
// CONCATENATED MODULE: ./packages/upload/src/upload-list.vue
|
|
2449
|
+
|
|
2450
|
+
|
|
2451
|
+
|
|
2452
|
+
|
|
2453
|
+
|
|
2454
|
+
/* normalize component */
|
|
2455
|
+
|
|
2456
|
+
var component = Object(componentNormalizer["a" /* default */])(
|
|
2457
|
+
src_upload_listvue_type_script_lang_js,
|
|
2458
|
+
upload_listvue_type_template_id_f52834b0_render,
|
|
2459
|
+
staticRenderFns,
|
|
2460
|
+
false,
|
|
2461
|
+
null,
|
|
2462
|
+
null,
|
|
2463
|
+
null
|
|
2464
|
+
|
|
2465
|
+
)
|
|
2466
|
+
|
|
2467
|
+
/* harmony default export */ var upload_list = (component.exports);
|
|
2468
|
+
// EXTERNAL MODULE: ./node_modules/babel-helper-vue-jsx-merge-props/index.js
|
|
2469
|
+
var babel_helper_vue_jsx_merge_props = __webpack_require__(31);
|
|
2470
|
+
var babel_helper_vue_jsx_merge_props_default = /*#__PURE__*/__webpack_require__.n(babel_helper_vue_jsx_merge_props);
|
|
2471
|
+
|
|
2472
|
+
// CONCATENATED MODULE: ./packages/upload/src/ajax.js
|
|
2473
|
+
function getError(action, option, xhr) {
|
|
2474
|
+
var msg = void 0;
|
|
2475
|
+
if (xhr.response) {
|
|
2476
|
+
msg = '' + (xhr.response.error || xhr.response);
|
|
2477
|
+
} else if (xhr.responseText) {
|
|
2478
|
+
msg = '' + xhr.responseText;
|
|
2479
|
+
} else {
|
|
2480
|
+
msg = 'fail to post ' + action + ' ' + xhr.status;
|
|
2481
|
+
}
|
|
2482
|
+
|
|
2483
|
+
var err = new Error(msg);
|
|
2484
|
+
err.status = xhr.status;
|
|
2485
|
+
err.method = 'post';
|
|
2486
|
+
err.url = action;
|
|
2487
|
+
return err;
|
|
2488
|
+
}
|
|
2489
|
+
|
|
2490
|
+
function getBody(xhr) {
|
|
2491
|
+
var text = xhr.responseText || xhr.response;
|
|
2492
|
+
if (!text) {
|
|
2493
|
+
return text;
|
|
2494
|
+
}
|
|
2495
|
+
|
|
2496
|
+
try {
|
|
2497
|
+
return JSON.parse(text);
|
|
2498
|
+
} catch (e) {
|
|
2499
|
+
return text;
|
|
2500
|
+
}
|
|
2501
|
+
}
|
|
2502
|
+
|
|
2503
|
+
function upload(option) {
|
|
2504
|
+
if (typeof XMLHttpRequest === 'undefined') {
|
|
2505
|
+
return;
|
|
2506
|
+
}
|
|
2507
|
+
|
|
2508
|
+
var xhr = new XMLHttpRequest();
|
|
2509
|
+
var action = option.action;
|
|
2510
|
+
|
|
2511
|
+
if (xhr.upload) {
|
|
2512
|
+
xhr.upload.onprogress = function progress(e) {
|
|
2513
|
+
if (e.total > 0) {
|
|
2514
|
+
e.percent = e.loaded / e.total * 100;
|
|
2515
|
+
}
|
|
2516
|
+
option.onProgress(e);
|
|
2517
|
+
};
|
|
2518
|
+
}
|
|
2519
|
+
|
|
2520
|
+
var formData = new FormData();
|
|
2521
|
+
|
|
2522
|
+
if (option.data) {
|
|
2523
|
+
Object.keys(option.data).forEach(function (key) {
|
|
2524
|
+
formData.append(key, option.data[key]);
|
|
2525
|
+
});
|
|
2526
|
+
}
|
|
2527
|
+
|
|
2528
|
+
formData.append(option.filename, option.file, option.file.name);
|
|
2529
|
+
|
|
2530
|
+
xhr.onerror = function error(e) {
|
|
2531
|
+
option.onError(e);
|
|
2532
|
+
};
|
|
2533
|
+
|
|
2534
|
+
xhr.onload = function onload() {
|
|
2535
|
+
if (xhr.status < 200 || xhr.status >= 300) {
|
|
2536
|
+
return option.onError(getError(action, option, xhr));
|
|
2537
|
+
}
|
|
2538
|
+
|
|
2539
|
+
option.onSuccess(getBody(xhr));
|
|
2540
|
+
};
|
|
2541
|
+
|
|
2542
|
+
xhr.open('post', action, true);
|
|
2543
|
+
|
|
2544
|
+
if (option.withCredentials && 'withCredentials' in xhr) {
|
|
2545
|
+
xhr.withCredentials = true;
|
|
2546
|
+
}
|
|
2547
|
+
|
|
2548
|
+
var headers = option.headers || {};
|
|
2549
|
+
|
|
2550
|
+
for (var item in headers) {
|
|
2551
|
+
if (headers.hasOwnProperty(item) && headers[item] !== null) {
|
|
2552
|
+
xhr.setRequestHeader(item, headers[item]);
|
|
2553
|
+
}
|
|
2554
|
+
}
|
|
2555
|
+
xhr.send(formData);
|
|
2556
|
+
return xhr;
|
|
2557
|
+
}
|
|
2558
|
+
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./packages/upload/src/upload-dragger.vue?vue&type=template&id=7a1289f9
|
|
2559
|
+
var upload_draggervue_type_template_id_7a1289f9_render = function render() {
|
|
2560
|
+
var _vm = this,
|
|
2561
|
+
_c = _vm._self._c
|
|
2562
|
+
return _c(
|
|
2563
|
+
"div",
|
|
2564
|
+
{
|
|
2565
|
+
staticClass: "el-upload-dragger",
|
|
2566
|
+
class: {
|
|
2567
|
+
"is-dragover": _vm.dragover,
|
|
2568
|
+
},
|
|
2569
|
+
on: {
|
|
2570
|
+
drop: function ($event) {
|
|
2571
|
+
$event.preventDefault()
|
|
2572
|
+
return _vm.onDrop.apply(null, arguments)
|
|
2573
|
+
},
|
|
2574
|
+
dragover: function ($event) {
|
|
2575
|
+
$event.preventDefault()
|
|
2576
|
+
return _vm.onDragover.apply(null, arguments)
|
|
2577
|
+
},
|
|
2578
|
+
dragleave: function ($event) {
|
|
2579
|
+
$event.preventDefault()
|
|
2580
|
+
_vm.dragover = false
|
|
2581
|
+
},
|
|
2582
|
+
},
|
|
2583
|
+
},
|
|
2584
|
+
[_vm._t("default")],
|
|
2585
|
+
2
|
|
2586
|
+
)
|
|
2587
|
+
}
|
|
2588
|
+
var upload_draggervue_type_template_id_7a1289f9_staticRenderFns = []
|
|
2589
|
+
upload_draggervue_type_template_id_7a1289f9_render._withStripped = true
|
|
2590
|
+
|
|
2591
|
+
|
|
2592
|
+
// CONCATENATED MODULE: ./packages/upload/src/upload-dragger.vue?vue&type=template&id=7a1289f9
|
|
2593
|
+
|
|
2594
|
+
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/upload/src/upload-dragger.vue?vue&type=script&lang=js
|
|
2595
|
+
|
|
2596
|
+
/* harmony default export */ var upload_draggervue_type_script_lang_js = ({
|
|
2597
|
+
name: 'ElUploadDrag',
|
|
2598
|
+
props: {
|
|
2599
|
+
disabled: Boolean
|
|
2600
|
+
},
|
|
2601
|
+
inject: {
|
|
2602
|
+
uploader: {
|
|
2603
|
+
default: ''
|
|
2604
|
+
}
|
|
2605
|
+
},
|
|
2606
|
+
data: function data() {
|
|
2607
|
+
return {
|
|
2608
|
+
dragover: false
|
|
2609
|
+
};
|
|
2610
|
+
},
|
|
2611
|
+
|
|
2612
|
+
methods: {
|
|
2613
|
+
onDragover: function onDragover() {
|
|
2614
|
+
if (!this.disabled) {
|
|
2615
|
+
this.dragover = true;
|
|
2616
|
+
}
|
|
2617
|
+
},
|
|
2618
|
+
onDrop: function onDrop(e) {
|
|
2619
|
+
if (this.disabled || !this.uploader) return;
|
|
2620
|
+
var accept = this.uploader.accept;
|
|
2621
|
+
this.dragover = false;
|
|
2622
|
+
if (!accept) {
|
|
2623
|
+
this.$emit('file', e.dataTransfer.files);
|
|
2624
|
+
return;
|
|
2625
|
+
}
|
|
2626
|
+
this.$emit('file', [].slice.call(e.dataTransfer.files).filter(function (file) {
|
|
2627
|
+
var type = file.type,
|
|
2628
|
+
name = file.name;
|
|
2629
|
+
|
|
2630
|
+
var extension = name.indexOf('.') > -1 ? '.' + name.split('.').pop() : '';
|
|
2631
|
+
var baseType = type.replace(/\/.*$/, '');
|
|
2632
|
+
return accept.split(',').map(function (type) {
|
|
2633
|
+
return type.trim();
|
|
2634
|
+
}).filter(function (type) {
|
|
2635
|
+
return type;
|
|
2636
|
+
}).some(function (acceptedType) {
|
|
2637
|
+
if (/\..+$/.test(acceptedType)) {
|
|
2638
|
+
return extension === acceptedType;
|
|
2639
|
+
}
|
|
2640
|
+
if (/\/\*$/.test(acceptedType)) {
|
|
2641
|
+
return baseType === acceptedType.replace(/\/\*$/, '');
|
|
2642
|
+
}
|
|
2643
|
+
if (/^[^\/]+\/[^\/]+$/.test(acceptedType)) {
|
|
2644
|
+
return type === acceptedType;
|
|
2645
|
+
}
|
|
2646
|
+
return false;
|
|
2647
|
+
});
|
|
2648
|
+
}));
|
|
2649
|
+
}
|
|
2650
|
+
}
|
|
2651
|
+
});
|
|
2652
|
+
// CONCATENATED MODULE: ./packages/upload/src/upload-dragger.vue?vue&type=script&lang=js
|
|
2653
|
+
/* harmony default export */ var src_upload_draggervue_type_script_lang_js = (upload_draggervue_type_script_lang_js);
|
|
2654
|
+
// CONCATENATED MODULE: ./packages/upload/src/upload-dragger.vue
|
|
2655
|
+
|
|
2656
|
+
|
|
2657
|
+
|
|
2658
|
+
|
|
2659
|
+
|
|
2660
|
+
/* normalize component */
|
|
2661
|
+
|
|
2662
|
+
var upload_dragger_component = Object(componentNormalizer["a" /* default */])(
|
|
2663
|
+
src_upload_draggervue_type_script_lang_js,
|
|
2664
|
+
upload_draggervue_type_template_id_7a1289f9_render,
|
|
2665
|
+
upload_draggervue_type_template_id_7a1289f9_staticRenderFns,
|
|
2666
|
+
false,
|
|
2667
|
+
null,
|
|
2668
|
+
null,
|
|
2669
|
+
null
|
|
2670
|
+
|
|
2671
|
+
)
|
|
2672
|
+
|
|
2673
|
+
/* harmony default export */ var upload_dragger = (upload_dragger_component.exports);
|
|
2674
|
+
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/upload/src/upload.vue?vue&type=script&lang=js
|
|
2675
|
+
|
|
2676
|
+
|
|
2677
|
+
|
|
2678
|
+
|
|
2679
|
+
|
|
2680
|
+
/* harmony default export */ var uploadvue_type_script_lang_js = ({
|
|
2681
|
+
inject: ['uploader'],
|
|
2682
|
+
components: {
|
|
2683
|
+
UploadDragger: upload_dragger
|
|
2684
|
+
},
|
|
2685
|
+
props: {
|
|
2686
|
+
type: String,
|
|
2687
|
+
action: {
|
|
2688
|
+
type: String,
|
|
2689
|
+
required: true
|
|
2690
|
+
},
|
|
2691
|
+
name: {
|
|
2692
|
+
type: String,
|
|
2693
|
+
default: 'file'
|
|
2694
|
+
},
|
|
2695
|
+
data: Object,
|
|
2696
|
+
headers: Object,
|
|
2697
|
+
withCredentials: Boolean,
|
|
2698
|
+
multiple: Boolean,
|
|
2699
|
+
accept: String,
|
|
2700
|
+
onStart: Function,
|
|
2701
|
+
onProgress: Function,
|
|
2702
|
+
onSuccess: Function,
|
|
2703
|
+
onError: Function,
|
|
2704
|
+
beforeUpload: Function,
|
|
2705
|
+
drag: Boolean,
|
|
2706
|
+
onPreview: {
|
|
2707
|
+
type: Function,
|
|
2708
|
+
default: function _default() {}
|
|
2709
|
+
},
|
|
2710
|
+
onRemove: {
|
|
2711
|
+
type: Function,
|
|
2712
|
+
default: function _default() {}
|
|
2713
|
+
},
|
|
2714
|
+
fileList: Array,
|
|
2715
|
+
autoUpload: Boolean,
|
|
2716
|
+
listType: String,
|
|
2717
|
+
httpRequest: {
|
|
2718
|
+
type: Function,
|
|
2719
|
+
default: upload
|
|
2720
|
+
},
|
|
2721
|
+
disabled: Boolean,
|
|
2722
|
+
limit: Number,
|
|
2723
|
+
onExceed: Function
|
|
2724
|
+
},
|
|
2725
|
+
|
|
2726
|
+
data: function data() {
|
|
2727
|
+
return {
|
|
2728
|
+
mouseover: false,
|
|
2729
|
+
reqs: {}
|
|
2730
|
+
};
|
|
2731
|
+
},
|
|
2732
|
+
|
|
2733
|
+
|
|
2734
|
+
methods: {
|
|
2735
|
+
isImage: function isImage(str) {
|
|
2736
|
+
return str.indexOf('image') !== -1;
|
|
2737
|
+
},
|
|
2738
|
+
handleChange: function handleChange(ev) {
|
|
2739
|
+
var files = ev.target.files;
|
|
2740
|
+
|
|
2741
|
+
if (!files) return;
|
|
2742
|
+
this.uploadFiles(files);
|
|
2743
|
+
},
|
|
2744
|
+
uploadFiles: function uploadFiles(files) {
|
|
2745
|
+
var _this = this;
|
|
2746
|
+
|
|
2747
|
+
if (this.limit && this.fileList.length + files.length > this.limit) {
|
|
2748
|
+
this.onExceed && this.onExceed(files, this.fileList);
|
|
2749
|
+
return;
|
|
2750
|
+
}
|
|
2751
|
+
|
|
2752
|
+
var postFiles = Array.prototype.slice.call(files);
|
|
2753
|
+
if (!this.multiple) {
|
|
2754
|
+
postFiles = postFiles.slice(0, 1);
|
|
2755
|
+
}
|
|
2756
|
+
|
|
2757
|
+
if (postFiles.length === 0) {
|
|
2758
|
+
return;
|
|
2759
|
+
}
|
|
2760
|
+
|
|
2761
|
+
postFiles.forEach(function (rawFile) {
|
|
2762
|
+
_this.onStart(rawFile);
|
|
2763
|
+
if (_this.autoUpload) _this.upload(rawFile);
|
|
2764
|
+
});
|
|
2765
|
+
},
|
|
2766
|
+
upload: function upload(rawFile) {
|
|
2767
|
+
var _this2 = this;
|
|
2768
|
+
|
|
2769
|
+
this.$refs.input.value = null;
|
|
2770
|
+
|
|
2771
|
+
if (!this.beforeUpload) {
|
|
2772
|
+
return this.post(rawFile);
|
|
2773
|
+
}
|
|
2774
|
+
|
|
2775
|
+
var before = this.beforeUpload(rawFile);
|
|
2776
|
+
if (before && before.then) {
|
|
2777
|
+
before.then(function (processedFile) {
|
|
2778
|
+
var fileType = Object.prototype.toString.call(processedFile);
|
|
2779
|
+
|
|
2780
|
+
if (fileType === '[object File]' || fileType === '[object Blob]') {
|
|
2781
|
+
if (fileType === '[object Blob]') {
|
|
2782
|
+
processedFile = new File([processedFile], rawFile.name, {
|
|
2783
|
+
type: rawFile.type
|
|
2784
|
+
});
|
|
2785
|
+
}
|
|
2786
|
+
for (var p in rawFile) {
|
|
2787
|
+
if (rawFile.hasOwnProperty(p)) {
|
|
2788
|
+
processedFile[p] = rawFile[p];
|
|
2789
|
+
}
|
|
2790
|
+
}
|
|
2791
|
+
_this2.post(processedFile);
|
|
2792
|
+
} else {
|
|
2793
|
+
_this2.post(rawFile);
|
|
2794
|
+
}
|
|
2795
|
+
}, function () {
|
|
2796
|
+
_this2.onRemove(null, rawFile);
|
|
2797
|
+
});
|
|
2798
|
+
} else if (before !== false) {
|
|
2799
|
+
this.post(rawFile);
|
|
2800
|
+
} else {
|
|
2801
|
+
this.onRemove(null, rawFile);
|
|
2802
|
+
}
|
|
2803
|
+
},
|
|
2804
|
+
abort: function abort(file) {
|
|
2805
|
+
var reqs = this.reqs;
|
|
2806
|
+
|
|
2807
|
+
if (file) {
|
|
2808
|
+
var uid = file;
|
|
2809
|
+
if (file.uid) uid = file.uid;
|
|
2810
|
+
if (reqs[uid]) {
|
|
2811
|
+
reqs[uid].abort();
|
|
2812
|
+
}
|
|
2813
|
+
} else {
|
|
2814
|
+
Object.keys(reqs).forEach(function (uid) {
|
|
2815
|
+
if (reqs[uid]) reqs[uid].abort();
|
|
2816
|
+
delete reqs[uid];
|
|
2817
|
+
});
|
|
2818
|
+
}
|
|
2819
|
+
},
|
|
2820
|
+
post: function post(rawFile) {
|
|
2821
|
+
var _this3 = this;
|
|
2822
|
+
|
|
2823
|
+
var uid = rawFile.uid;
|
|
2824
|
+
|
|
2825
|
+
var options = {
|
|
2826
|
+
headers: this.headers,
|
|
2827
|
+
withCredentials: this.withCredentials,
|
|
2828
|
+
file: rawFile,
|
|
2829
|
+
data: this.data,
|
|
2830
|
+
filename: this.name,
|
|
2831
|
+
action: this.action,
|
|
2832
|
+
onProgress: function onProgress(e) {
|
|
2833
|
+
_this3.onProgress(e, rawFile);
|
|
2834
|
+
},
|
|
2835
|
+
onSuccess: function onSuccess(res) {
|
|
2836
|
+
_this3.onSuccess(res, rawFile);
|
|
2837
|
+
delete _this3.reqs[uid];
|
|
2838
|
+
},
|
|
2839
|
+
onError: function onError(err) {
|
|
2840
|
+
_this3.onError(err, rawFile);
|
|
2841
|
+
delete _this3.reqs[uid];
|
|
2842
|
+
}
|
|
2843
|
+
};
|
|
2844
|
+
var req = this.httpRequest(options);
|
|
2845
|
+
this.reqs[uid] = req;
|
|
2846
|
+
if (req && req.then) {
|
|
2847
|
+
req.then(options.onSuccess, options.onError);
|
|
2848
|
+
}
|
|
2849
|
+
},
|
|
2850
|
+
handleClick: function handleClick() {
|
|
2851
|
+
if (!this.disabled) {
|
|
2852
|
+
this.$refs.input.value = null;
|
|
2853
|
+
this.$refs.input.click();
|
|
2854
|
+
}
|
|
2855
|
+
},
|
|
2856
|
+
handleKeydown: function handleKeydown(e) {
|
|
2857
|
+
if (e.target !== e.currentTarget) return;
|
|
2858
|
+
if (e.keyCode === 13 || e.keyCode === 32) {
|
|
2859
|
+
this.handleClick();
|
|
2860
|
+
}
|
|
2861
|
+
}
|
|
2862
|
+
},
|
|
2863
|
+
|
|
2864
|
+
render: function render(h) {
|
|
2865
|
+
var handleClick = this.handleClick,
|
|
2866
|
+
drag = this.drag,
|
|
2867
|
+
name = this.name,
|
|
2868
|
+
handleChange = this.handleChange,
|
|
2869
|
+
multiple = this.multiple,
|
|
2870
|
+
accept = this.accept,
|
|
2871
|
+
listType = this.listType,
|
|
2872
|
+
uploadFiles = this.uploadFiles,
|
|
2873
|
+
disabled = this.disabled,
|
|
2874
|
+
handleKeydown = this.handleKeydown;
|
|
2875
|
+
|
|
2876
|
+
var data = {
|
|
2877
|
+
class: {
|
|
2878
|
+
'el-upload': true
|
|
2879
|
+
},
|
|
2880
|
+
on: {
|
|
2881
|
+
click: handleClick,
|
|
2882
|
+
keydown: handleKeydown
|
|
2883
|
+
}
|
|
2884
|
+
};
|
|
2885
|
+
data.class['el-upload--' + listType] = true;
|
|
2886
|
+
return h(
|
|
2887
|
+
'div',
|
|
2888
|
+
babel_helper_vue_jsx_merge_props_default()([data, {
|
|
2889
|
+
attrs: { tabindex: '0' }
|
|
2890
|
+
}]),
|
|
2891
|
+
[drag ? h(
|
|
2892
|
+
'upload-dragger',
|
|
2893
|
+
{
|
|
2894
|
+
attrs: { disabled: disabled },
|
|
2895
|
+
on: {
|
|
2896
|
+
'file': uploadFiles
|
|
2897
|
+
}
|
|
2898
|
+
},
|
|
2899
|
+
[this.$slots.default]
|
|
2900
|
+
) : this.$slots.default, h('input', { 'class': 'el-upload__input', attrs: { type: 'file', name: name, multiple: multiple, accept: accept },
|
|
2901
|
+
ref: 'input', on: {
|
|
2902
|
+
'change': handleChange
|
|
2903
|
+
}
|
|
2904
|
+
})]
|
|
2905
|
+
);
|
|
2906
|
+
}
|
|
2907
|
+
});
|
|
2908
|
+
// CONCATENATED MODULE: ./packages/upload/src/upload.vue?vue&type=script&lang=js
|
|
2909
|
+
/* harmony default export */ var src_uploadvue_type_script_lang_js = (uploadvue_type_script_lang_js);
|
|
2910
|
+
// CONCATENATED MODULE: ./packages/upload/src/upload.vue
|
|
2911
|
+
var upload_render, upload_staticRenderFns
|
|
2912
|
+
|
|
2913
|
+
|
|
2914
|
+
|
|
2915
|
+
|
|
2916
|
+
/* normalize component */
|
|
2917
|
+
|
|
2918
|
+
var upload_component = Object(componentNormalizer["a" /* default */])(
|
|
2919
|
+
src_uploadvue_type_script_lang_js,
|
|
2920
|
+
upload_render,
|
|
2921
|
+
upload_staticRenderFns,
|
|
2922
|
+
false,
|
|
2923
|
+
null,
|
|
2924
|
+
null,
|
|
2925
|
+
null
|
|
2926
|
+
|
|
2927
|
+
)
|
|
2928
|
+
|
|
2929
|
+
/* harmony default export */ var src_upload = (upload_component.exports);
|
|
2930
|
+
// EXTERNAL MODULE: ./src/mixins/migrating.js
|
|
2931
|
+
var migrating = __webpack_require__(12);
|
|
2932
|
+
|
|
2933
|
+
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/upload/src/index.vue?vue&type=script&lang=js
|
|
2934
|
+
|
|
2935
|
+
|
|
2936
|
+
|
|
2937
|
+
|
|
2938
|
+
|
|
2939
|
+
|
|
2940
|
+
function noop() {}
|
|
2941
|
+
|
|
2942
|
+
/* harmony default export */ var srcvue_type_script_lang_js = ({
|
|
2943
|
+
name: 'ElUpload',
|
|
2944
|
+
|
|
2945
|
+
mixins: [migrating["a" /* default */]],
|
|
2946
|
+
|
|
2947
|
+
components: {
|
|
2948
|
+
ElProgress: progress["default"],
|
|
2949
|
+
UploadList: upload_list,
|
|
2950
|
+
Upload: src_upload
|
|
2951
|
+
},
|
|
2952
|
+
|
|
2953
|
+
provide: function provide() {
|
|
2954
|
+
return {
|
|
2955
|
+
uploader: this
|
|
2956
|
+
};
|
|
2957
|
+
},
|
|
2958
|
+
|
|
2959
|
+
|
|
2960
|
+
inject: {
|
|
2961
|
+
elForm: {
|
|
2962
|
+
default: ''
|
|
2963
|
+
}
|
|
2964
|
+
},
|
|
2965
|
+
|
|
2966
|
+
props: {
|
|
2967
|
+
action: {
|
|
2968
|
+
type: String,
|
|
2969
|
+
required: true
|
|
2970
|
+
},
|
|
2971
|
+
headers: {
|
|
2972
|
+
type: Object,
|
|
2973
|
+
default: function _default() {
|
|
2974
|
+
return {};
|
|
2975
|
+
}
|
|
2976
|
+
},
|
|
2977
|
+
data: Object,
|
|
2978
|
+
multiple: Boolean,
|
|
2979
|
+
name: {
|
|
2980
|
+
type: String,
|
|
2981
|
+
default: 'file'
|
|
2982
|
+
},
|
|
2983
|
+
drag: Boolean,
|
|
2984
|
+
dragger: Boolean,
|
|
2985
|
+
withCredentials: Boolean,
|
|
2986
|
+
showFileList: {
|
|
2987
|
+
type: Boolean,
|
|
2988
|
+
default: true
|
|
2989
|
+
},
|
|
2990
|
+
accept: String,
|
|
2991
|
+
type: {
|
|
2992
|
+
type: String,
|
|
2993
|
+
default: 'select'
|
|
2994
|
+
},
|
|
2995
|
+
beforeUpload: Function,
|
|
2996
|
+
beforeRemove: Function,
|
|
2997
|
+
onRemove: {
|
|
2998
|
+
type: Function,
|
|
2999
|
+
default: noop
|
|
3000
|
+
},
|
|
3001
|
+
onChange: {
|
|
3002
|
+
type: Function,
|
|
3003
|
+
default: noop
|
|
3004
|
+
},
|
|
3005
|
+
onPreview: {
|
|
3006
|
+
type: Function
|
|
3007
|
+
},
|
|
3008
|
+
onSuccess: {
|
|
3009
|
+
type: Function,
|
|
3010
|
+
default: noop
|
|
3011
|
+
},
|
|
3012
|
+
onProgress: {
|
|
3013
|
+
type: Function,
|
|
3014
|
+
default: noop
|
|
3015
|
+
},
|
|
3016
|
+
onError: {
|
|
3017
|
+
type: Function,
|
|
3018
|
+
default: noop
|
|
3019
|
+
},
|
|
3020
|
+
fileList: {
|
|
3021
|
+
type: Array,
|
|
3022
|
+
default: function _default() {
|
|
3023
|
+
return [];
|
|
3024
|
+
}
|
|
3025
|
+
},
|
|
3026
|
+
autoUpload: {
|
|
3027
|
+
type: Boolean,
|
|
3028
|
+
default: true
|
|
3029
|
+
},
|
|
3030
|
+
listType: {
|
|
3031
|
+
type: String,
|
|
3032
|
+
default: 'text' // text,picture,picture-card
|
|
3033
|
+
},
|
|
3034
|
+
httpRequest: Function,
|
|
3035
|
+
disabled: Boolean,
|
|
3036
|
+
limit: Number,
|
|
3037
|
+
onExceed: {
|
|
3038
|
+
type: Function,
|
|
3039
|
+
default: noop
|
|
3040
|
+
}
|
|
3041
|
+
},
|
|
3042
|
+
|
|
3043
|
+
data: function data() {
|
|
3044
|
+
return {
|
|
3045
|
+
uploadFiles: [],
|
|
3046
|
+
dragOver: false,
|
|
3047
|
+
draging: false,
|
|
3048
|
+
tempIndex: 1
|
|
3049
|
+
};
|
|
3050
|
+
},
|
|
3051
|
+
|
|
3052
|
+
|
|
3053
|
+
computed: {
|
|
3054
|
+
uploadDisabled: function uploadDisabled() {
|
|
3055
|
+
return this.disabled || (this.elForm || {}).disabled;
|
|
3056
|
+
}
|
|
3057
|
+
},
|
|
3058
|
+
|
|
3059
|
+
watch: {
|
|
3060
|
+
listType: function listType(type) {
|
|
3061
|
+
if (type === 'picture-card' || type === 'picture') {
|
|
3062
|
+
this.uploadFiles = this.uploadFiles.map(function (file) {
|
|
3063
|
+
if (!file.url && file.raw) {
|
|
3064
|
+
try {
|
|
3065
|
+
file.url = URL.createObjectURL(file.raw);
|
|
3066
|
+
} catch (err) {
|
|
3067
|
+
console.error('[Element Error][Upload]', err);
|
|
3068
|
+
}
|
|
3069
|
+
}
|
|
3070
|
+
return file;
|
|
3071
|
+
});
|
|
3072
|
+
}
|
|
3073
|
+
},
|
|
3074
|
+
|
|
3075
|
+
fileList: {
|
|
3076
|
+
immediate: true,
|
|
3077
|
+
handler: function handler(fileList) {
|
|
3078
|
+
var _this = this;
|
|
3079
|
+
|
|
3080
|
+
this.uploadFiles = fileList.map(function (item) {
|
|
3081
|
+
item.uid = item.uid || Date.now() + _this.tempIndex++;
|
|
3082
|
+
item.status = item.status || 'success';
|
|
3083
|
+
return item;
|
|
3084
|
+
});
|
|
3085
|
+
}
|
|
3086
|
+
}
|
|
3087
|
+
},
|
|
3088
|
+
|
|
3089
|
+
methods: {
|
|
3090
|
+
handleStart: function handleStart(rawFile) {
|
|
3091
|
+
rawFile.uid = Date.now() + this.tempIndex++;
|
|
3092
|
+
var file = {
|
|
3093
|
+
status: 'ready',
|
|
3094
|
+
name: rawFile.name,
|
|
3095
|
+
size: rawFile.size,
|
|
3096
|
+
percentage: 0,
|
|
3097
|
+
uid: rawFile.uid,
|
|
3098
|
+
raw: rawFile
|
|
3099
|
+
};
|
|
3100
|
+
|
|
3101
|
+
if (this.listType === 'picture-card' || this.listType === 'picture') {
|
|
3102
|
+
try {
|
|
3103
|
+
file.url = URL.createObjectURL(rawFile);
|
|
3104
|
+
} catch (err) {
|
|
3105
|
+
console.error('[Element Error][Upload]', err);
|
|
3106
|
+
return;
|
|
3107
|
+
}
|
|
3108
|
+
}
|
|
3109
|
+
|
|
3110
|
+
this.uploadFiles.push(file);
|
|
3111
|
+
this.onChange(file, this.uploadFiles);
|
|
3112
|
+
},
|
|
3113
|
+
handleProgress: function handleProgress(ev, rawFile) {
|
|
3114
|
+
var file = this.getFile(rawFile);
|
|
3115
|
+
this.onProgress(ev, file, this.uploadFiles);
|
|
3116
|
+
file.status = 'uploading';
|
|
3117
|
+
file.percentage = ev.percent || 0;
|
|
3118
|
+
},
|
|
3119
|
+
handleSuccess: function handleSuccess(res, rawFile) {
|
|
3120
|
+
var file = this.getFile(rawFile);
|
|
3121
|
+
|
|
3122
|
+
if (file) {
|
|
3123
|
+
file.status = 'success';
|
|
3124
|
+
file.response = res;
|
|
3125
|
+
|
|
3126
|
+
this.onSuccess(res, file, this.uploadFiles);
|
|
3127
|
+
this.onChange(file, this.uploadFiles);
|
|
3128
|
+
}
|
|
3129
|
+
},
|
|
3130
|
+
handleError: function handleError(err, rawFile) {
|
|
3131
|
+
var file = this.getFile(rawFile);
|
|
3132
|
+
var fileList = this.uploadFiles;
|
|
3133
|
+
|
|
3134
|
+
file.status = 'fail';
|
|
3135
|
+
|
|
3136
|
+
fileList.splice(fileList.indexOf(file), 1);
|
|
3137
|
+
|
|
3138
|
+
this.onError(err, file, this.uploadFiles);
|
|
3139
|
+
this.onChange(file, this.uploadFiles);
|
|
3140
|
+
},
|
|
3141
|
+
handleRemove: function handleRemove(file, raw) {
|
|
3142
|
+
var _this2 = this;
|
|
3143
|
+
|
|
3144
|
+
if (raw) {
|
|
3145
|
+
file = this.getFile(raw);
|
|
3146
|
+
}
|
|
3147
|
+
var doRemove = function doRemove() {
|
|
3148
|
+
_this2.abort(file);
|
|
3149
|
+
var fileList = _this2.uploadFiles;
|
|
3150
|
+
fileList.splice(fileList.indexOf(file), 1);
|
|
3151
|
+
_this2.onRemove(file, fileList);
|
|
3152
|
+
};
|
|
3153
|
+
|
|
3154
|
+
if (!this.beforeRemove) {
|
|
3155
|
+
doRemove();
|
|
3156
|
+
} else if (typeof this.beforeRemove === 'function') {
|
|
3157
|
+
var before = this.beforeRemove(file, this.uploadFiles);
|
|
3158
|
+
if (before && before.then) {
|
|
3159
|
+
before.then(function () {
|
|
3160
|
+
doRemove();
|
|
3161
|
+
}, noop);
|
|
3162
|
+
} else if (before !== false) {
|
|
3163
|
+
doRemove();
|
|
3164
|
+
}
|
|
3165
|
+
}
|
|
3166
|
+
},
|
|
3167
|
+
getFile: function getFile(rawFile) {
|
|
3168
|
+
var fileList = this.uploadFiles;
|
|
3169
|
+
var target = void 0;
|
|
3170
|
+
fileList.every(function (item) {
|
|
3171
|
+
target = rawFile.uid === item.uid ? item : null;
|
|
3172
|
+
return !target;
|
|
3173
|
+
});
|
|
3174
|
+
return target;
|
|
3175
|
+
},
|
|
3176
|
+
abort: function abort(file) {
|
|
3177
|
+
this.$refs['upload-inner'].abort(file);
|
|
3178
|
+
},
|
|
3179
|
+
clearFiles: function clearFiles() {
|
|
3180
|
+
this.uploadFiles = [];
|
|
3181
|
+
},
|
|
3182
|
+
submit: function submit() {
|
|
3183
|
+
var _this3 = this;
|
|
3184
|
+
|
|
3185
|
+
this.uploadFiles.filter(function (file) {
|
|
3186
|
+
return file.status === 'ready';
|
|
3187
|
+
}).forEach(function (file) {
|
|
3188
|
+
_this3.$refs['upload-inner'].upload(file.raw);
|
|
3189
|
+
});
|
|
3190
|
+
},
|
|
3191
|
+
getMigratingConfig: function getMigratingConfig() {
|
|
3192
|
+
return {
|
|
3193
|
+
props: {
|
|
3194
|
+
'default-file-list': 'default-file-list is renamed to file-list.',
|
|
3195
|
+
'show-upload-list': 'show-upload-list is renamed to show-file-list.',
|
|
3196
|
+
'thumbnail-mode': 'thumbnail-mode has been deprecated, you can implement the same effect according to this case: http://element.eleme.io/#/zh-CN/component/upload#yong-hu-tou-xiang-shang-chuan'
|
|
3197
|
+
}
|
|
3198
|
+
};
|
|
3199
|
+
}
|
|
3200
|
+
},
|
|
3201
|
+
|
|
3202
|
+
beforeDestroy: function beforeDestroy() {
|
|
3203
|
+
this.uploadFiles.forEach(function (file) {
|
|
3204
|
+
if (file.url && file.url.indexOf('blob:') === 0) {
|
|
3205
|
+
URL.revokeObjectURL(file.url);
|
|
3206
|
+
}
|
|
3207
|
+
});
|
|
3208
|
+
},
|
|
3209
|
+
render: function render(h) {
|
|
3210
|
+
var _this4 = this;
|
|
3211
|
+
|
|
3212
|
+
var uploadList = void 0;
|
|
3213
|
+
|
|
3214
|
+
if (this.showFileList) {
|
|
3215
|
+
uploadList = h(
|
|
3216
|
+
upload_list,
|
|
3217
|
+
{
|
|
3218
|
+
attrs: {
|
|
3219
|
+
disabled: this.uploadDisabled,
|
|
3220
|
+
listType: this.listType,
|
|
3221
|
+
files: this.uploadFiles,
|
|
3222
|
+
|
|
3223
|
+
handlePreview: this.onPreview },
|
|
3224
|
+
on: {
|
|
3225
|
+
'remove': this.handleRemove
|
|
3226
|
+
}
|
|
3227
|
+
},
|
|
3228
|
+
[function (props) {
|
|
3229
|
+
if (_this4.$scopedSlots.file) {
|
|
3230
|
+
return _this4.$scopedSlots.file({
|
|
3231
|
+
file: props.file
|
|
3232
|
+
});
|
|
3233
|
+
}
|
|
3234
|
+
}]
|
|
3235
|
+
);
|
|
3236
|
+
}
|
|
3237
|
+
|
|
3238
|
+
var uploadData = {
|
|
3239
|
+
props: {
|
|
3240
|
+
type: this.type,
|
|
3241
|
+
drag: this.drag,
|
|
3242
|
+
action: this.action,
|
|
3243
|
+
multiple: this.multiple,
|
|
3244
|
+
'before-upload': this.beforeUpload,
|
|
3245
|
+
'with-credentials': this.withCredentials,
|
|
3246
|
+
headers: this.headers,
|
|
3247
|
+
name: this.name,
|
|
3248
|
+
data: this.data,
|
|
3249
|
+
accept: this.accept,
|
|
3250
|
+
fileList: this.uploadFiles,
|
|
3251
|
+
autoUpload: this.autoUpload,
|
|
3252
|
+
listType: this.listType,
|
|
3253
|
+
disabled: this.uploadDisabled,
|
|
3254
|
+
limit: this.limit,
|
|
3255
|
+
'on-exceed': this.onExceed,
|
|
3256
|
+
'on-start': this.handleStart,
|
|
3257
|
+
'on-progress': this.handleProgress,
|
|
3258
|
+
'on-success': this.handleSuccess,
|
|
3259
|
+
'on-error': this.handleError,
|
|
3260
|
+
'on-preview': this.onPreview,
|
|
3261
|
+
'on-remove': this.handleRemove,
|
|
3262
|
+
'http-request': this.httpRequest
|
|
3263
|
+
},
|
|
3264
|
+
ref: 'upload-inner'
|
|
3265
|
+
};
|
|
3266
|
+
|
|
3267
|
+
var trigger = this.$slots.trigger || this.$slots.default;
|
|
3268
|
+
var uploadComponent = h(
|
|
3269
|
+
'upload',
|
|
3270
|
+
uploadData,
|
|
3271
|
+
[trigger]
|
|
3272
|
+
);
|
|
3273
|
+
|
|
3274
|
+
return h('div', [this.listType === 'picture-card' ? uploadList : '', this.$slots.trigger ? [uploadComponent, this.$slots.default] : uploadComponent, this.$slots.tip, this.listType !== 'picture-card' ? uploadList : '']);
|
|
3275
|
+
}
|
|
3276
|
+
});
|
|
3277
|
+
// CONCATENATED MODULE: ./packages/upload/src/index.vue?vue&type=script&lang=js
|
|
3278
|
+
/* harmony default export */ var upload_srcvue_type_script_lang_js = (srcvue_type_script_lang_js);
|
|
3279
|
+
// CONCATENATED MODULE: ./packages/upload/src/index.vue
|
|
3280
|
+
var src_render, src_staticRenderFns
|
|
3281
|
+
|
|
3282
|
+
|
|
3283
|
+
|
|
3284
|
+
|
|
3285
|
+
/* normalize component */
|
|
3286
|
+
|
|
3287
|
+
var src_component = Object(componentNormalizer["a" /* default */])(
|
|
3288
|
+
upload_srcvue_type_script_lang_js,
|
|
3289
|
+
src_render,
|
|
3290
|
+
src_staticRenderFns,
|
|
3291
|
+
false,
|
|
3292
|
+
null,
|
|
3293
|
+
null,
|
|
3294
|
+
null
|
|
3295
|
+
|
|
3296
|
+
)
|
|
3297
|
+
|
|
3298
|
+
/* harmony default export */ var src = (src_component.exports);
|
|
3299
|
+
// CONCATENATED MODULE: ./packages/upload/index.js
|
|
3300
|
+
|
|
3301
|
+
|
|
3302
|
+
/* istanbul ignore next */
|
|
3303
|
+
src.install = function (Vue) {
|
|
3304
|
+
Vue.component(src.name, src);
|
|
3305
|
+
};
|
|
3306
|
+
|
|
3307
|
+
/* harmony default export */ var packages_upload = __webpack_exports__["default"] = (src);
|
|
3308
|
+
|
|
3309
|
+
/***/ }),
|
|
3310
|
+
|
|
3311
|
+
/***/ 74:
|
|
3312
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3313
|
+
|
|
3314
|
+
"use strict";
|
|
3315
|
+
// ESM COMPAT FLAG
|
|
3316
|
+
__webpack_require__.r(__webpack_exports__);
|
|
3317
|
+
|
|
3318
|
+
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./packages/link/src/main.vue?vue&type=template&id=4fa504fb
|
|
3319
|
+
var render = function render() {
|
|
3320
|
+
var _vm = this,
|
|
3321
|
+
_c = _vm._self._c
|
|
3322
|
+
return _c(
|
|
3323
|
+
"a",
|
|
3324
|
+
_vm._b(
|
|
3325
|
+
{
|
|
3326
|
+
class: [
|
|
3327
|
+
"el-link",
|
|
3328
|
+
_vm.type ? `el-link--${_vm.type}` : "",
|
|
3329
|
+
_vm.disabled && "is-disabled",
|
|
3330
|
+
_vm.underline && !_vm.disabled && "is-underline",
|
|
3331
|
+
],
|
|
3332
|
+
attrs: { href: _vm.disabled ? null : _vm.href },
|
|
3333
|
+
on: { click: _vm.handleClick },
|
|
3334
|
+
},
|
|
3335
|
+
"a",
|
|
3336
|
+
_vm.$attrs,
|
|
3337
|
+
false
|
|
3338
|
+
),
|
|
3339
|
+
[
|
|
3340
|
+
_vm.icon ? _c("i", { class: _vm.icon }) : _vm._e(),
|
|
3341
|
+
_vm.$slots.default
|
|
3342
|
+
? _c("span", { staticClass: "el-link--inner" }, [_vm._t("default")], 2)
|
|
3343
|
+
: _vm._e(),
|
|
3344
|
+
_vm.$slots.icon
|
|
3345
|
+
? [_vm.$slots.icon ? _vm._t("icon") : _vm._e()]
|
|
3346
|
+
: _vm._e(),
|
|
3347
|
+
],
|
|
3348
|
+
2
|
|
3349
|
+
)
|
|
3350
|
+
}
|
|
3351
|
+
var staticRenderFns = []
|
|
3352
|
+
render._withStripped = true
|
|
3353
|
+
|
|
3354
|
+
|
|
3355
|
+
// CONCATENATED MODULE: ./packages/link/src/main.vue?vue&type=template&id=4fa504fb
|
|
3356
|
+
|
|
3357
|
+
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/link/src/main.vue?vue&type=script&lang=js
|
|
3358
|
+
|
|
3359
|
+
|
|
3360
|
+
/* harmony default export */ var mainvue_type_script_lang_js = ({
|
|
3361
|
+
name: 'ElLink',
|
|
3362
|
+
|
|
3363
|
+
props: {
|
|
3364
|
+
type: {
|
|
3365
|
+
type: String,
|
|
3366
|
+
default: 'default'
|
|
3367
|
+
},
|
|
3368
|
+
underline: {
|
|
3369
|
+
type: Boolean,
|
|
3370
|
+
default: true
|
|
3371
|
+
},
|
|
3372
|
+
disabled: Boolean,
|
|
3373
|
+
href: String,
|
|
3374
|
+
icon: String
|
|
3375
|
+
},
|
|
3376
|
+
|
|
3377
|
+
methods: {
|
|
3378
|
+
handleClick: function handleClick(event) {
|
|
3379
|
+
if (!this.disabled) {
|
|
3380
|
+
if (!this.href) {
|
|
3381
|
+
this.$emit('click', event);
|
|
3382
|
+
}
|
|
3383
|
+
}
|
|
3384
|
+
}
|
|
3385
|
+
}
|
|
3386
|
+
});
|
|
3387
|
+
// CONCATENATED MODULE: ./packages/link/src/main.vue?vue&type=script&lang=js
|
|
3388
|
+
/* harmony default export */ var src_mainvue_type_script_lang_js = (mainvue_type_script_lang_js);
|
|
3389
|
+
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
|
3390
|
+
var componentNormalizer = __webpack_require__(2);
|
|
3391
|
+
|
|
3392
|
+
// CONCATENATED MODULE: ./packages/link/src/main.vue
|
|
3393
|
+
|
|
3394
|
+
|
|
3395
|
+
|
|
3396
|
+
|
|
3397
|
+
|
|
3398
|
+
/* normalize component */
|
|
3399
|
+
|
|
3400
|
+
var component = Object(componentNormalizer["a" /* default */])(
|
|
3401
|
+
src_mainvue_type_script_lang_js,
|
|
3402
|
+
render,
|
|
3403
|
+
staticRenderFns,
|
|
3404
|
+
false,
|
|
3405
|
+
null,
|
|
3406
|
+
null,
|
|
3407
|
+
null
|
|
3408
|
+
|
|
3409
|
+
)
|
|
3410
|
+
|
|
3411
|
+
/* harmony default export */ var main = (component.exports);
|
|
3412
|
+
// CONCATENATED MODULE: ./packages/link/index.js
|
|
3413
|
+
|
|
3414
|
+
|
|
3415
|
+
/* istanbul ignore next */
|
|
3416
|
+
main.install = function (Vue) {
|
|
3417
|
+
Vue.component(main.name, main);
|
|
3418
|
+
};
|
|
903
3419
|
|
|
904
|
-
|
|
3420
|
+
/* harmony default export */ var packages_link = __webpack_exports__["default"] = (main);
|
|
905
3421
|
|
|
906
3422
|
/***/ })
|
|
907
3423
|
|