webpackJsonp([127],{ /***/ 1031: /***/ (function(module, exports, __webpack_require__) { var baseMatches = __webpack_require__(1123), baseMatchesProperty = __webpack_require__(1139), identity = __webpack_require__(948), isArray = __webpack_require__(865), property = __webpack_require__(1142); /** * The base implementation of `_.iteratee`. * * @private * @param {*} [value=_.identity] The value to convert to an iteratee. * @returns {Function} Returns the iteratee. */ function baseIteratee(value) { // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. if (typeof value == 'function') { return value; } if (value == null) { return identity; } if (typeof value == 'object') { return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value); } return property(value); } module.exports = baseIteratee; /***/ }), /***/ 1032: /***/ (function(module, exports, __webpack_require__) { var ListCache = __webpack_require__(872); /** * Removes all key-value entries from the stack. * * @private * @name clear * @memberOf Stack */ function stackClear() { this.__data__ = new ListCache; this.size = 0; } module.exports = stackClear; /***/ }), /***/ 1033: /***/ (function(module, exports) { /** * Removes `key` and its value from the stack. * * @private * @name delete * @memberOf Stack * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function stackDelete(key) { var data = this.__data__, result = data['delete'](key); this.size = data.size; return result; } module.exports = stackDelete; /***/ }), /***/ 1034: /***/ (function(module, exports) { /** * Gets the stack value for `key`. * * @private * @name get * @memberOf Stack * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function stackGet(key) { return this.__data__.get(key); } module.exports = stackGet; /***/ }), /***/ 1035: /***/ (function(module, exports) { /** * Checks if a stack value for `key` exists. * * @private * @name has * @memberOf Stack * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function stackHas(key) { return this.__data__.has(key); } module.exports = stackHas; /***/ }), /***/ 1036: /***/ (function(module, exports, __webpack_require__) { var ListCache = __webpack_require__(872), Map = __webpack_require__(876), MapCache = __webpack_require__(877); /** Used as the size to enable large array optimizations. */ var LARGE_ARRAY_SIZE = 200; /** * Sets the stack `key` to `value`. * * @private * @name set * @memberOf Stack * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the stack cache instance. */ function stackSet(key, value) { var data = this.__data__; if (data instanceof ListCache) { var pairs = data.__data__; if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { pairs.push([key, value]); this.size = ++data.size; return this; } data = this.__data__ = new MapCache(pairs); } data.set(key, value); this.size = data.size; return this; } module.exports = stackSet; /***/ }), /***/ 1037: /***/ (function(module, exports) { /** * This method returns `false`. * * @static * @memberOf _ * @since 4.13.0 * @category Util * @returns {boolean} Returns `false`. * @example * * _.times(2, _.stubFalse); * // => [false, false] */ function stubFalse() { return false; } module.exports = stubFalse; /***/ }), /***/ 1038: /***/ (function(module, exports, __webpack_require__) { var baseGetTag = __webpack_require__(304), isLength = __webpack_require__(875), isObjectLike = __webpack_require__(302); /** `Object#toString` result references. */ var argsTag = '[object Arguments]', arrayTag = '[object Array]', boolTag = '[object Boolean]', dateTag = '[object Date]', errorTag = '[object Error]', funcTag = '[object Function]', mapTag = '[object Map]', numberTag = '[object Number]', objectTag = '[object Object]', regexpTag = '[object RegExp]', setTag = '[object Set]', stringTag = '[object String]', weakMapTag = '[object WeakMap]'; var arrayBufferTag = '[object ArrayBuffer]', dataViewTag = '[object DataView]', float32Tag = '[object Float32Array]', float64Tag = '[object Float64Array]', int8Tag = '[object Int8Array]', int16Tag = '[object Int16Array]', int32Tag = '[object Int32Array]', uint8Tag = '[object Uint8Array]', uint8ClampedTag = '[object Uint8ClampedArray]', uint16Tag = '[object Uint16Array]', uint32Tag = '[object Uint32Array]'; /** Used to identify `toStringTag` values of typed arrays. */ var typedArrayTags = {}; typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true; typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; /** * The base implementation of `_.isTypedArray` without Node.js optimizations. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. */ function baseIsTypedArray(value) { return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; } module.exports = baseIsTypedArray; /***/ }), /***/ 1039: /***/ (function(module, exports) { /** * The base implementation of `_.times` without support for iteratee shorthands * or max array length checks. * * @private * @param {number} n The number of times to invoke `iteratee`. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns the array of results. */ function baseTimes(n, iteratee) { var index = -1, result = Array(n); while (++index < n) { result[index] = iteratee(index); } return result; } module.exports = baseTimes; /***/ }), /***/ 1040: /***/ (function(module, exports, __webpack_require__) { var MapCache = __webpack_require__(877), setCacheAdd = __webpack_require__(1126), setCacheHas = __webpack_require__(1127); /** * * Creates an array cache object to store unique values. * * @private * @constructor * @param {Array} [values] The values to cache. */ function SetCache(values) { var index = -1, length = values == null ? 0 : values.length; this.__data__ = new MapCache; while (++index < length) { this.add(values[index]); } } // Add methods to `SetCache`. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; SetCache.prototype.has = setCacheHas; module.exports = SetCache; /***/ }), /***/ 1041: /***/ (function(module, exports) { /** * Checks if a `cache` value for `key` exists. * * @private * @param {Object} cache The cache to query. * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function cacheHas(cache, key) { return cache.has(key); } module.exports = cacheHas; /***/ }), /***/ 1042: /***/ (function(module, exports, __webpack_require__) { var getNative = __webpack_require__(866), root = __webpack_require__(170); /* Built-in method references that are verified to be native. */ var Set = getNative(root, 'Set'); module.exports = Set; /***/ }), /***/ 1055: /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = void 0; var React = _interopRequireWildcard(__webpack_require__(0)); var _reactLifecyclesCompat = __webpack_require__(7); var _rcUpload = _interopRequireDefault(__webpack_require__(1152)); var _classnames = _interopRequireDefault(__webpack_require__(3)); var _uniqBy = _interopRequireDefault(__webpack_require__(1159)); var _findIndex = _interopRequireDefault(__webpack_require__(1168)); var _UploadList = _interopRequireDefault(__webpack_require__(1169)); var _utils = __webpack_require__(1058); var _LocaleReceiver = _interopRequireDefault(__webpack_require__(73)); var _default2 = _interopRequireDefault(__webpack_require__(180)); var _configProvider = __webpack_require__(11); var _warning = _interopRequireDefault(__webpack_require__(43)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var Upload = /*#__PURE__*/ function (_React$Component) { _inherits(Upload, _React$Component); function Upload(props) { var _this; _classCallCheck(this, Upload); _this = _possibleConstructorReturn(this, _getPrototypeOf(Upload).call(this, props)); _this.saveUpload = function (node) { _this.upload = node; }; _this.onStart = function (file) { var fileList = _this.state.fileList; var targetItem = (0, _utils.fileToObject)(file); targetItem.status = 'uploading'; var nextFileList = fileList.concat(); var fileIndex = (0, _findIndex["default"])(nextFileList, function (_ref) { var uid = _ref.uid; return uid === targetItem.uid; }); if (fileIndex === -1) { nextFileList.push(targetItem); } else { nextFileList[fileIndex] = targetItem; } _this.onChange({ file: targetItem, fileList: nextFileList }); // fix ie progress if (!window.File || Object({"NODE_ENV":"production","PUBLIC_URL":"/react/build/."}).TEST_IE) { _this.autoUpdateProgress(0, targetItem); } }; _this.onSuccess = function (response, file, xhr) { _this.clearProgressTimer(); try { if (typeof response === 'string') { response = JSON.parse(response); } } catch (e) { /* do nothing */ } var fileList = _this.state.fileList; var targetItem = (0, _utils.getFileItem)(file, fileList); // removed if (!targetItem) { return; } targetItem.status = 'done'; targetItem.response = response; targetItem.xhr = xhr; _this.onChange({ file: _extends({}, targetItem), fileList: fileList }); }; _this.onProgress = function (e, file) { var fileList = _this.state.fileList; var targetItem = (0, _utils.getFileItem)(file, fileList); // removed if (!targetItem) { return; } targetItem.percent = e.percent; _this.onChange({ event: e, file: _extends({}, targetItem), fileList: fileList }); }; _this.onError = function (error, response, file) { _this.clearProgressTimer(); var fileList = _this.state.fileList; var targetItem = (0, _utils.getFileItem)(file, fileList); // removed if (!targetItem) { return; } targetItem.error = error; targetItem.response = response; targetItem.status = 'error'; _this.onChange({ file: _extends({}, targetItem), fileList: fileList }); }; _this.handleRemove = function (file) { var onRemove = _this.props.onRemove; var fileList = _this.state.fileList; Promise.resolve(typeof onRemove === 'function' ? onRemove(file) : onRemove).then(function (ret) { // Prevent removing file if (ret === false) { return; } var removedFileList = (0, _utils.removeFileItem)(file, fileList); if (removedFileList) { file.status = 'removed'; // eslint-disable-line if (_this.upload) { _this.upload.abort(file); } _this.onChange({ file: file, fileList: removedFileList }); } }); }; _this.onChange = function (info) { if (!('fileList' in _this.props)) { _this.setState({ fileList: info.fileList }); } var onChange = _this.props.onChange; if (onChange) { onChange(info); } }; _this.onFileDrop = function (e) { _this.setState({ dragState: e.type }); }; _this.beforeUpload = function (file, fileList) { var beforeUpload = _this.props.beforeUpload; var stateFileList = _this.state.fileList; if (!beforeUpload) { return true; } var result = beforeUpload(file, fileList); if (result === false) { _this.onChange({ file: file, fileList: (0, _uniqBy["default"])(stateFileList.concat(fileList.map(_utils.fileToObject)), function (item) { return item.uid; }) }); return false; } if (result && result.then) { return result; } return true; }; _this.renderUploadList = function (locale) { var _this$props = _this.props, showUploadList = _this$props.showUploadList, listType = _this$props.listType, onPreview = _this$props.onPreview, onDownload = _this$props.onDownload, previewFile = _this$props.previewFile, disabled = _this$props.disabled, propLocale = _this$props.locale; var showRemoveIcon = showUploadList.showRemoveIcon, showPreviewIcon = showUploadList.showPreviewIcon, showDownloadIcon = showUploadList.showDownloadIcon; var fileList = _this.state.fileList; return React.createElement(_UploadList["default"], { listType: listType, items: fileList, previewFile: previewFile, onPreview: onPreview, onDownload: onDownload, onRemove: _this.handleRemove, showRemoveIcon: !disabled && showRemoveIcon, showPreviewIcon: showPreviewIcon, showDownloadIcon: showDownloadIcon, locale: _extends(_extends({}, locale), propLocale) }); }; _this.renderUpload = function (_ref2) { var _classNames2; var getPrefixCls = _ref2.getPrefixCls; var _this$props2 = _this.props, customizePrefixCls = _this$props2.prefixCls, className = _this$props2.className, showUploadList = _this$props2.showUploadList, listType = _this$props2.listType, type = _this$props2.type, disabled = _this$props2.disabled, children = _this$props2.children, style = _this$props2.style; var _this$state = _this.state, fileList = _this$state.fileList, dragState = _this$state.dragState; var prefixCls = getPrefixCls('upload', customizePrefixCls); var rcUploadProps = _extends(_extends({ onStart: _this.onStart, onError: _this.onError, onProgress: _this.onProgress, onSuccess: _this.onSuccess }, _this.props), { prefixCls: prefixCls, beforeUpload: _this.beforeUpload }); delete rcUploadProps.className; delete rcUploadProps.style; var uploadList = showUploadList ? React.createElement(_LocaleReceiver["default"], { componentName: "Upload", defaultLocale: _default2["default"].Upload }, _this.renderUploadList) : null; if (type === 'drag') { var _classNames; var dragCls = (0, _classnames["default"])(prefixCls, (_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-drag"), true), _defineProperty(_classNames, "".concat(prefixCls, "-drag-uploading"), fileList.some(function (file) { return file.status === 'uploading'; })), _defineProperty(_classNames, "".concat(prefixCls, "-drag-hover"), dragState === 'dragover'), _defineProperty(_classNames, "".concat(prefixCls, "-disabled"), disabled), _classNames), className); return React.createElement("span", null, React.createElement("div", { className: dragCls, onDrop: _this.onFileDrop, onDragOver: _this.onFileDrop, onDragLeave: _this.onFileDrop, style: style }, React.createElement(_rcUpload["default"], _extends({}, rcUploadProps, { ref: _this.saveUpload, className: "".concat(prefixCls, "-btn") }), React.createElement("div", { className: "".concat(prefixCls, "-drag-container") }, children))), uploadList); } var uploadButtonCls = (0, _classnames["default"])(prefixCls, (_classNames2 = {}, _defineProperty(_classNames2, "".concat(prefixCls, "-select"), true), _defineProperty(_classNames2, "".concat(prefixCls, "-select-").concat(listType), true), _defineProperty(_classNames2, "".concat(prefixCls, "-disabled"), disabled), _classNames2)); // Remove id to avoid open by label when trigger is hidden // https://github.com/ant-design/ant-design/issues/14298 // https://github.com/ant-design/ant-design/issues/16478 if (!children || disabled) { delete rcUploadProps.id; } var uploadButton = React.createElement("div", { className: uploadButtonCls, style: children ? undefined : { display: 'none' } }, React.createElement(_rcUpload["default"], _extends({}, rcUploadProps, { ref: _this.saveUpload }))); if (listType === 'picture-card') { return React.createElement("span", { className: (0, _classnames["default"])(className, "".concat(prefixCls, "-picture-card-wrapper")) }, uploadList, uploadButton); } return React.createElement("span", { className: className }, uploadButton, uploadList); }; _this.state = { fileList: props.fileList || props.defaultFileList || [], dragState: 'drop' }; (0, _warning["default"])('fileList' in props || !('value' in props), 'Upload', '`value` is not validate prop, do you mean `fileList`?'); return _this; } _createClass(Upload, [{ key: "componentWillUnmount", value: function componentWillUnmount() { this.clearProgressTimer(); } }, { key: "clearProgressTimer", value: function clearProgressTimer() { clearInterval(this.progressTimer); } }, { key: "autoUpdateProgress", value: function autoUpdateProgress(_, file) { var _this2 = this; var getPercent = (0, _utils.genPercentAdd)(); var curPercent = 0; this.clearProgressTimer(); this.progressTimer = setInterval(function () { curPercent = getPercent(curPercent); _this2.onProgress({ percent: curPercent * 100 }, file); }, 200); } }, { key: "render", value: function render() { return React.createElement(_configProvider.ConfigConsumer, null, this.renderUpload); } }], [{ key: "getDerivedStateFromProps", value: function getDerivedStateFromProps(nextProps) { if ('fileList' in nextProps) { return { fileList: nextProps.fileList || [] }; } return null; } }]); return Upload; }(React.Component); Upload.defaultProps = { type: 'select', multiple: false, action: '', data: {}, accept: '', beforeUpload: _utils.T, showUploadList: true, listType: 'text', className: '', disabled: false, supportServerRender: true }; (0, _reactLifecyclesCompat.polyfill)(Upload); var _default = Upload; exports["default"] = _default; //# sourceMappingURL=Upload.js.map /***/ }), /***/ 1056: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = uid; var now = +new Date(); var index = 0; function uid() { return "rc-upload-" + now + "-" + ++index; } /***/ }), /***/ 1057: /***/ (function(module, exports) { /** * The base implementation of `_.findIndex` and `_.findLastIndex` without * support for iteratee shorthands. * * @private * @param {Array} array The array to inspect. * @param {Function} predicate The function invoked per iteration. * @param {number} fromIndex The index to search from. * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {number} Returns the index of the matched value, else `-1`. */ function baseFindIndex(array, predicate, fromIndex, fromRight) { var length = array.length, index = fromIndex + (fromRight ? 1 : -1); while ((fromRight ? index-- : ++index < length)) { if (predicate(array[index], index, array)) { return index; } } return -1; } module.exports = baseFindIndex; /***/ }), /***/ 1058: /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.T = T; exports.fileToObject = fileToObject; exports.genPercentAdd = genPercentAdd; exports.getFileItem = getFileItem; exports.removeFileItem = removeFileItem; exports.previewImage = previewImage; exports.isImageUrl = void 0; function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function T() { return true; } // Fix IE file.status problem // via coping a new Object function fileToObject(file) { return _extends(_extends({}, file), { lastModified: file.lastModified, lastModifiedDate: file.lastModifiedDate, name: file.name, size: file.size, type: file.type, uid: file.uid, percent: 0, originFileObj: file }); } /** * 生成Progress percent: 0.1 -> 0.98 * - for ie */ function genPercentAdd() { var k = 0.1; var i = 0.01; var end = 0.98; return function (s) { var start = s; if (start >= end) { return start; } start += k; k -= i; if (k < 0.001) { k = 0.001; } return start; }; } function getFileItem(file, fileList) { var matchKey = file.uid !== undefined ? 'uid' : 'name'; return fileList.filter(function (item) { return item[matchKey] === file[matchKey]; })[0]; } function removeFileItem(file, fileList) { var matchKey = file.uid !== undefined ? 'uid' : 'name'; var removed = fileList.filter(function (item) { return item[matchKey] !== file[matchKey]; }); if (removed.length === fileList.length) { return null; } return removed; } // ==================== Default Image Preview ==================== var extname = function extname() { var url = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; var temp = url.split('/'); var filename = temp[temp.length - 1]; var filenameWithoutSuffix = filename.split(/#|\?/)[0]; return (/\.[^./\\]*$/.exec(filenameWithoutSuffix) || [''])[0]; }; var isImageFileType = function isImageFileType(type) { return !!type && type.indexOf('image/') === 0; }; var isImageUrl = function isImageUrl(file) { if (isImageFileType(file.type)) { return true; } var url = file.thumbUrl || file.url; var extension = extname(url); if (/^data:image\//.test(url) || /(webp|svg|png|gif|jpg|jpeg|jfif|bmp|dpg|ico)$/i.test(extension)) { return true; } if (/^data:/.test(url)) { // other file types of base64 return false; } if (extension) { // other file types which have extension return false; } return true; }; exports.isImageUrl = isImageUrl; var MEASURE_SIZE = 200; function previewImage(file) { return new Promise(function (resolve) { if (!isImageFileType(file.type)) { resolve(''); return; } var canvas = document.createElement('canvas'); canvas.width = MEASURE_SIZE; canvas.height = MEASURE_SIZE; canvas.style.cssText = "position: fixed; left: 0; top: 0; width: ".concat(MEASURE_SIZE, "px; height: ").concat(MEASURE_SIZE, "px; z-index: 9999; display: none;"); document.body.appendChild(canvas); var ctx = canvas.getContext('2d'); var img = new Image(); img.onload = function () { var width = img.width, height = img.height; var drawWidth = MEASURE_SIZE; var drawHeight = MEASURE_SIZE; var offsetX = 0; var offsetY = 0; if (width < height) { drawHeight = height * (MEASURE_SIZE / width); offsetY = -(drawHeight - drawWidth) / 2; } else { drawWidth = width * (MEASURE_SIZE / height); offsetX = -(drawWidth - drawHeight) / 2; } ctx.drawImage(img, offsetX, offsetY, drawWidth, drawHeight); var dataURL = canvas.toDataURL(); document.body.removeChild(canvas); resolve(dataURL); }; img.src = window.URL.createObjectURL(file); }); } //# sourceMappingURL=utils.js.map /***/ }), /***/ 1079: /***/ (function(module, exports, __webpack_require__) { var DataView = __webpack_require__(1135), Map = __webpack_require__(876), Promise = __webpack_require__(1136), Set = __webpack_require__(1042), WeakMap = __webpack_require__(1137), baseGetTag = __webpack_require__(304), toSource = __webpack_require__(889); /** `Object#toString` result references. */ var mapTag = '[object Map]', objectTag = '[object Object]', promiseTag = '[object Promise]', setTag = '[object Set]', weakMapTag = '[object WeakMap]'; var dataViewTag = '[object DataView]'; /** Used to detect maps, sets, and weakmaps. */ var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map), promiseCtorString = toSource(Promise), setCtorString = toSource(Set), weakMapCtorString = toSource(WeakMap); /** * Gets the `toStringTag` of `value`. * * @private * @param {*} value The value to query. * @returns {string} Returns the `toStringTag`. */ var getTag = baseGetTag; // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || (Map && getTag(new Map) != mapTag) || (Promise && getTag(Promise.resolve()) != promiseTag) || (Set && getTag(new Set) != setTag) || (WeakMap && getTag(new WeakMap) != weakMapTag)) { getTag = function(value) { var result = baseGetTag(value), Ctor = result == objectTag ? value.constructor : undefined, ctorString = Ctor ? toSource(Ctor) : ''; if (ctorString) { switch (ctorString) { case dataViewCtorString: return dataViewTag; case mapCtorString: return mapTag; case promiseCtorString: return promiseTag; case setCtorString: return setTag; case weakMapCtorString: return weakMapTag; } } return result; }; } module.exports = getTag; /***/ }), /***/ 1082: /***/ (function(module, exports, __webpack_require__) { "use strict"; __webpack_require__(29); __webpack_require__(1150); __webpack_require__(1100); __webpack_require__(173); //# sourceMappingURL=css.js.map /***/ }), /***/ 1083: /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = void 0; var _Upload = _interopRequireDefault(__webpack_require__(1055)); var _Dragger = _interopRequireDefault(__webpack_require__(1170)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } _Upload["default"].Dragger = _Dragger["default"]; var _default = _Upload["default"]; exports["default"] = _default; //# sourceMappingURL=index.js.map /***/ }), /***/ 1084: /***/ (function(module, exports, __webpack_require__) { var arrayFilter = __webpack_require__(1132), stubArray = __webpack_require__(1119); /** Used for built-in method references. */ var objectProto = Object.prototype; /** Built-in value references. */ var propertyIsEnumerable = objectProto.propertyIsEnumerable; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeGetSymbols = Object.getOwnPropertySymbols; /** * Creates an array of the own enumerable symbols of `object`. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of symbols. */ var getSymbols = !nativeGetSymbols ? stubArray : function(object) { if (object == null) { return []; } object = Object(object); return arrayFilter(nativeGetSymbols(object), function(symbol) { return propertyIsEnumerable.call(object, symbol); }); }; module.exports = getSymbols; /***/ }), /***/ 1100: /***/ (function(module, exports, __webpack_require__) { "use strict"; __webpack_require__(29); __webpack_require__(1108); //# sourceMappingURL=css.js.map /***/ }), /***/ 1101: /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = void 0; var _progress = _interopRequireDefault(__webpack_require__(1110)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } var _default = _progress["default"]; exports["default"] = _default; //# sourceMappingURL=index.js.map /***/ }), /***/ 1102: /***/ (function(module, exports) { /** * The base implementation of `_.property` without support for deep paths. * * @private * @param {string} key The key of the property to get. * @returns {Function} Returns the new accessor function. */ function baseProperty(key) { return function(object) { return object == null ? undefined : object[key]; }; } module.exports = baseProperty; /***/ }), /***/ 1108: /***/ (function(module, exports, __webpack_require__) { // style-loader: Adds some css to the DOM by adding a \n ' + domainScript + '\n \n \n
\n \n ' + domainInput + '\n \n
\n \n \n '; } }, { key: 'initIframeSrc', value: function initIframeSrc() { if (this.domain) { this.getIframeNode().src = 'javascript:void((function(){\n var d = document;\n d.open();\n d.domain=\'' + this.domain + '\';\n d.write(\'\');\n d.close();\n })())'; } } }, { key: 'initIframe', value: function initIframe() { var iframeNode = this.getIframeNode(); var win = iframeNode.contentWindow; var doc = void 0; this.domain = this.domain || ''; this.initIframeSrc(); try { doc = win.document; } catch (e) { this.domain = document.domain; this.initIframeSrc(); win = iframeNode.contentWindow; doc = win.document; } doc.open('text/html', 'replace'); doc.write(this.getIframeHTML(this.domain)); doc.close(); this.getFormInputNode().onchange = this.onChange; } }, { key: 'endUpload', value: function endUpload() { if (this.state.uploading) { this.file = {}; // hack avoid batch this.state.uploading = false; this.setState({ uploading: false }); this.initIframe(); } } }, { key: 'startUpload', value: function startUpload() { if (!this.state.uploading) { this.state.uploading = true; this.setState({ uploading: true }); } } }, { key: 'updateIframeWH', value: function updateIframeWH() { var rootNode = __WEBPACK_IMPORTED_MODULE_8_react_dom___default.a.findDOMNode(this); var iframeNode = this.getIframeNode(); iframeNode.style.height = rootNode.offsetHeight + 'px'; iframeNode.style.width = rootNode.offsetWidth + 'px'; } }, { key: 'abort', value: function abort(file) { if (file) { var uid = file; if (file && file.uid) { uid = file.uid; } if (uid === this.file.uid) { this.endUpload(); } } else { this.endUpload(); } } }, { key: 'post', value: function post(file) { var _this4 = this; var formNode = this.getFormNode(); var dataSpan = this.getFormDataNode(); var data = this.props.data; var onStart = this.props.onStart; if (typeof data === 'function') { data = data(file); } var inputs = document.createDocumentFragment(); for (var key in data) { if (data.hasOwnProperty(key)) { var input = document.createElement('input'); input.setAttribute('name', key); input.value = data[key]; inputs.appendChild(input); } } dataSpan.appendChild(inputs); new Promise(function (resolve) { var action = _this4.props.action; if (typeof action === 'function') { return resolve(action(file)); } resolve(action); }).then(function (action) { formNode.setAttribute('action', action); formNode.submit(); dataSpan.innerHTML = ''; onStart(file); }); } }, { key: 'render', value: function render() { var _classNames; var _props = this.props, Tag = _props.component, disabled = _props.disabled, className = _props.className, prefixCls = _props.prefixCls, children = _props.children, style = _props.style; var iframeStyle = __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends___default()({}, IFRAME_STYLE, { display: this.state.uploading || disabled ? 'none' : '' }); var cls = __WEBPACK_IMPORTED_MODULE_9_classnames___default()((_classNames = {}, __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_defineProperty___default()(_classNames, prefixCls, true), __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_defineProperty___default()(_classNames, prefixCls + '-disabled', disabled), __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_defineProperty___default()(_classNames, className, className), _classNames)); return __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement( Tag, { className: cls, style: __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends___default()({ position: 'relative', zIndex: 0 }, style) }, __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement('iframe', { ref: this.saveIframe, onLoad: this.onLoad, style: iframeStyle }), children ); } }]); return IframeUploader; }(__WEBPACK_IMPORTED_MODULE_6_react__["Component"]); IframeUploader.propTypes = { component: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.string, style: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.object, disabled: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.bool, prefixCls: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.string, className: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.string, accept: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.string, onStart: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.func, multiple: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.bool, children: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.any, data: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.object, __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.func]), action: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.func]), name: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.string }; /* harmony default export */ __webpack_exports__["a"] = (IframeUploader); /***/ }), /***/ 1159: /***/ (function(module, exports, __webpack_require__) { var baseIteratee = __webpack_require__(1031), baseUniq = __webpack_require__(1160); /** * This method is like `_.uniq` except that it accepts `iteratee` which is * invoked for each element in `array` to generate the criterion by which * uniqueness is computed. The order of result values is determined by the * order they occur in the array. The iteratee is invoked with one argument: * (value). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {Array} Returns the new duplicate free array. * @example * * _.uniqBy([2.1, 1.2, 2.3], Math.floor); * // => [2.1, 1.2] * * // The `_.property` iteratee shorthand. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); * // => [{ 'x': 1 }, { 'x': 2 }] */ function uniqBy(array, iteratee) { return (array && array.length) ? baseUniq(array, baseIteratee(iteratee, 2)) : []; } module.exports = uniqBy; /***/ }), /***/ 1160: /***/ (function(module, exports, __webpack_require__) { var SetCache = __webpack_require__(1040), arrayIncludes = __webpack_require__(1161), arrayIncludesWith = __webpack_require__(1165), cacheHas = __webpack_require__(1041), createSet = __webpack_require__(1166), setToArray = __webpack_require__(950); /** Used as the size to enable large array optimizations. */ var LARGE_ARRAY_SIZE = 200; /** * The base implementation of `_.uniqBy` without support for iteratee shorthands. * * @private * @param {Array} array The array to inspect. * @param {Function} [iteratee] The iteratee invoked per element. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new duplicate free array. */ function baseUniq(array, iteratee, comparator) { var index = -1, includes = arrayIncludes, length = array.length, isCommon = true, result = [], seen = result; if (comparator) { isCommon = false; includes = arrayIncludesWith; } else if (length >= LARGE_ARRAY_SIZE) { var set = iteratee ? null : createSet(array); if (set) { return setToArray(set); } isCommon = false; includes = cacheHas; seen = new SetCache; } else { seen = iteratee ? [] : result; } outer: while (++index < length) { var value = array[index], computed = iteratee ? iteratee(value) : value; value = (comparator || value !== 0) ? value : 0; if (isCommon && computed === computed) { var seenIndex = seen.length; while (seenIndex--) { if (seen[seenIndex] === computed) { continue outer; } } if (iteratee) { seen.push(computed); } result.push(value); } else if (!includes(seen, computed, comparator)) { if (seen !== result) { seen.push(computed); } result.push(value); } } return result; } module.exports = baseUniq; /***/ }), /***/ 1161: /***/ (function(module, exports, __webpack_require__) { var baseIndexOf = __webpack_require__(1162); /** * A specialized version of `_.includes` for arrays without support for * specifying an index to search from. * * @private * @param {Array} [array] The array to inspect. * @param {*} target The value to search for. * @returns {boolean} Returns `true` if `target` is found, else `false`. */ function arrayIncludes(array, value) { var length = array == null ? 0 : array.length; return !!length && baseIndexOf(array, value, 0) > -1; } module.exports = arrayIncludes; /***/ }), /***/ 1162: /***/ (function(module, exports, __webpack_require__) { var baseFindIndex = __webpack_require__(1057), baseIsNaN = __webpack_require__(1163), strictIndexOf = __webpack_require__(1164); /** * The base implementation of `_.indexOf` without `fromIndex` bounds checks. * * @private * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} fromIndex The index to search from. * @returns {number} Returns the index of the matched value, else `-1`. */ function baseIndexOf(array, value, fromIndex) { return value === value ? strictIndexOf(array, value, fromIndex) : baseFindIndex(array, baseIsNaN, fromIndex); } module.exports = baseIndexOf; /***/ }), /***/ 1163: /***/ (function(module, exports) { /** * The base implementation of `_.isNaN` without support for number objects. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. */ function baseIsNaN(value) { return value !== value; } module.exports = baseIsNaN; /***/ }), /***/ 1164: /***/ (function(module, exports) { /** * A specialized version of `_.indexOf` which performs strict equality * comparisons of values, i.e. `===`. * * @private * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} fromIndex The index to search from. * @returns {number} Returns the index of the matched value, else `-1`. */ function strictIndexOf(array, value, fromIndex) { var index = fromIndex - 1, length = array.length; while (++index < length) { if (array[index] === value) { return index; } } return -1; } module.exports = strictIndexOf; /***/ }), /***/ 1165: /***/ (function(module, exports) { /** * This function is like `arrayIncludes` except that it accepts a comparator. * * @private * @param {Array} [array] The array to inspect. * @param {*} target The value to search for. * @param {Function} comparator The comparator invoked per element. * @returns {boolean} Returns `true` if `target` is found, else `false`. */ function arrayIncludesWith(array, value, comparator) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { if (comparator(value, array[index])) { return true; } } return false; } module.exports = arrayIncludesWith; /***/ }), /***/ 1166: /***/ (function(module, exports, __webpack_require__) { var Set = __webpack_require__(1042), noop = __webpack_require__(1167), setToArray = __webpack_require__(950); /** Used as references for various `Number` constants. */ var INFINITY = 1 / 0; /** * Creates a set object of `values`. * * @private * @param {Array} values The values to add to the set. * @returns {Object} Returns the new set. */ var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) { return new Set(values); }; module.exports = createSet; /***/ }), /***/ 1167: /***/ (function(module, exports) { /** * This method returns `undefined`. * * @static * @memberOf _ * @since 2.3.0 * @category Util * @example * * _.times(2, _.noop); * // => [undefined, undefined] */ function noop() { // No operation performed. } module.exports = noop; /***/ }), /***/ 1168: /***/ (function(module, exports, __webpack_require__) { var baseFindIndex = __webpack_require__(1057), baseIteratee = __webpack_require__(1031), toInteger = __webpack_require__(1120); /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMax = Math.max; /** * This method is like `_.find` except that it returns the index of the first * element `predicate` returns truthy for instead of the element itself. * * @static * @memberOf _ * @since 1.1.0 * @category Array * @param {Array} array The array to inspect. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @param {number} [fromIndex=0] The index to search from. * @returns {number} Returns the index of the found element, else `-1`. * @example * * var users = [ * { 'user': 'barney', 'active': false }, * { 'user': 'fred', 'active': false }, * { 'user': 'pebbles', 'active': true } * ]; * * _.findIndex(users, function(o) { return o.user == 'barney'; }); * // => 0 * * // The `_.matches` iteratee shorthand. * _.findIndex(users, { 'user': 'fred', 'active': false }); * // => 1 * * // The `_.matchesProperty` iteratee shorthand. * _.findIndex(users, ['active', false]); * // => 0 * * // The `_.property` iteratee shorthand. * _.findIndex(users, 'active'); * // => 2 */ function findIndex(array, predicate, fromIndex) { var length = array == null ? 0 : array.length; if (!length) { return -1; } var index = fromIndex == null ? 0 : toInteger(fromIndex); if (index < 0) { index = nativeMax(length + index, 0); } return baseFindIndex(array, baseIteratee(predicate, 3), index); } module.exports = findIndex; /***/ }), /***/ 1169: /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = void 0; var React = _interopRequireWildcard(__webpack_require__(0)); var _rcAnimate = _interopRequireDefault(__webpack_require__(92)); var _classnames = _interopRequireDefault(__webpack_require__(3)); var _utils = __webpack_require__(1058); var _icon = _interopRequireDefault(__webpack_require__(26)); var _tooltip = _interopRequireDefault(__webpack_require__(172)); var _progress = _interopRequireDefault(__webpack_require__(1101)); var _configProvider = __webpack_require__(11); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var UploadList = /*#__PURE__*/ function (_React$Component) { _inherits(UploadList, _React$Component); function UploadList() { var _this; _classCallCheck(this, UploadList); _this = _possibleConstructorReturn(this, _getPrototypeOf(UploadList).apply(this, arguments)); _this.handlePreview = function (file, e) { var onPreview = _this.props.onPreview; if (!onPreview) { return; } e.preventDefault(); return onPreview(file); }; _this.handleDownload = function (file) { var onDownload = _this.props.onDownload; if (typeof onDownload === 'function') { onDownload(file); } else if (file.url) { window.open(file.url); } }; _this.handleClose = function (file) { var onRemove = _this.props.onRemove; if (onRemove) { onRemove(file); } }; _this.renderUploadList = function (_ref) { var _classNames4; var getPrefixCls = _ref.getPrefixCls; var _this$props = _this.props, customizePrefixCls = _this$props.prefixCls, _this$props$items = _this$props.items, items = _this$props$items === void 0 ? [] : _this$props$items, listType = _this$props.listType, showPreviewIcon = _this$props.showPreviewIcon, showRemoveIcon = _this$props.showRemoveIcon, showDownloadIcon = _this$props.showDownloadIcon, locale = _this$props.locale, progressAttr = _this$props.progressAttr; var prefixCls = getPrefixCls('upload', customizePrefixCls); var list = items.map(function (file) { var _classNames, _classNames2; var progress; var icon = React.createElement(_icon["default"], { type: file.status === 'uploading' ? 'loading' : 'paper-clip' }); if (listType === 'picture' || listType === 'picture-card') { if (listType === 'picture-card' && file.status === 'uploading') { icon = React.createElement("div", { className: "".concat(prefixCls, "-list-item-uploading-text") }, locale.uploading); } else if (!file.thumbUrl && !file.url) { icon = React.createElement(_icon["default"], { className: "".concat(prefixCls, "-list-item-thumbnail"), type: "picture", theme: "twoTone" }); } else { var thumbnail = (0, _utils.isImageUrl)(file) ? React.createElement("img", { src: file.thumbUrl || file.url, alt: file.name, className: "".concat(prefixCls, "-list-item-image") }) : React.createElement(_icon["default"], { type: "file", className: "".concat(prefixCls, "-list-item-icon"), theme: "twoTone" }); icon = React.createElement("a", { className: "".concat(prefixCls, "-list-item-thumbnail"), onClick: function onClick(e) { return _this.handlePreview(file, e); }, href: file.url || file.thumbUrl, target: "_blank", rel: "noopener noreferrer" }, thumbnail); } } if (file.status === 'uploading') { // show loading icon if upload progress listener is disabled var loadingProgress = 'percent' in file ? React.createElement(_progress["default"], _extends({ type: "line" }, progressAttr, { percent: file.percent })) : null; progress = React.createElement("div", { className: "".concat(prefixCls, "-list-item-progress"), key: "progress" }, loadingProgress); } var infoUploadingClass = (0, _classnames["default"])((_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-list-item"), true), _defineProperty(_classNames, "".concat(prefixCls, "-list-item-").concat(file.status), true), _defineProperty(_classNames, "".concat(prefixCls, "-list-item-list-type-").concat(listType), true), _classNames)); var linkProps = typeof file.linkProps === 'string' ? JSON.parse(file.linkProps) : file.linkProps; var removeIcon = showRemoveIcon ? React.createElement(_icon["default"], { type: "delete", title: locale.removeFile, onClick: function onClick() { return _this.handleClose(file); } }) : null; var downloadIcon = showDownloadIcon && file.status === 'done' ? React.createElement(_icon["default"], { type: "download", title: locale.downloadFile, onClick: function onClick() { return _this.handleDownload(file); } }) : null; var downloadOrDelete = listType !== 'picture-card' && React.createElement("span", { key: "download-delete", className: "".concat(prefixCls, "-list-item-card-actions ").concat(listType === 'picture' ? 'picture' : '') }, downloadIcon && React.createElement("a", { title: locale.downloadFile }, downloadIcon), removeIcon && React.createElement("a", { title: locale.removeFile }, removeIcon)); var listItemNameClass = (0, _classnames["default"])((_classNames2 = {}, _defineProperty(_classNames2, "".concat(prefixCls, "-list-item-name"), true), _defineProperty(_classNames2, "".concat(prefixCls, "-list-item-name-icon-count-").concat([downloadIcon, removeIcon].filter(function (x) { return x; }).length), true), _classNames2)); var preview = file.url ? [React.createElement("a", _extends({ key: "view", target: "_blank", rel: "noopener noreferrer", className: listItemNameClass, title: file.name }, linkProps, { href: file.url, onClick: function onClick(e) { return _this.handlePreview(file, e); } }), file.name), downloadOrDelete] : [React.createElement("span", { key: "view", className: listItemNameClass, onClick: function onClick(e) { return _this.handlePreview(file, e); }, title: file.name }, file.name), downloadOrDelete]; var style = { pointerEvents: 'none', opacity: 0.5 }; var previewIcon = showPreviewIcon ? React.createElement("a", { href: file.url || file.thumbUrl, target: "_blank", rel: "noopener noreferrer", style: file.url || file.thumbUrl ? undefined : style, onClick: function onClick(e) { return _this.handlePreview(file, e); }, title: locale.previewFile }, React.createElement(_icon["default"], { type: "eye-o" })) : null; var actions = listType === 'picture-card' && file.status !== 'uploading' && React.createElement("span", { className: "".concat(prefixCls, "-list-item-actions") }, previewIcon, file.status === 'done' && downloadIcon, removeIcon); var message; if (file.response && typeof file.response === 'string') { message = file.response; } else { message = file.error && file.error.statusText || locale.uploadError; } var iconAndPreview = React.createElement("span", null, icon, preview); var dom = React.createElement("div", { className: infoUploadingClass }, React.createElement("div", { className: "".concat(prefixCls, "-list-item-info") }, iconAndPreview), actions, React.createElement(_rcAnimate["default"], { transitionName: "fade", component: "" }, progress)); var listContainerNameClass = (0, _classnames["default"])(_defineProperty({}, "".concat(prefixCls, "-list-picture-card-container"), listType === 'picture-card')); return React.createElement("div", { key: file.uid, className: listContainerNameClass }, file.status === 'error' ? React.createElement(_tooltip["default"], { title: message }, dom) : React.createElement("span", null, dom)); }); var listClassNames = (0, _classnames["default"])((_classNames4 = {}, _defineProperty(_classNames4, "".concat(prefixCls, "-list"), true), _defineProperty(_classNames4, "".concat(prefixCls, "-list-").concat(listType), true), _classNames4)); var animationDirection = listType === 'picture-card' ? 'animate-inline' : 'animate'; return React.createElement(_rcAnimate["default"], { transitionName: "".concat(prefixCls, "-").concat(animationDirection), component: "div", className: listClassNames }, list); }; return _this; } _createClass(UploadList, [{ key: "componentDidUpdate", value: function componentDidUpdate() { var _this2 = this; var _this$props2 = this.props, listType = _this$props2.listType, items = _this$props2.items, previewFile = _this$props2.previewFile; if (listType !== 'picture' && listType !== 'picture-card') { return; } (items || []).forEach(function (file) { if (typeof document === 'undefined' || typeof window === 'undefined' || !window.FileReader || !window.File || !(file.originFileObj instanceof File || file.originFileObj instanceof Blob) || file.thumbUrl !== undefined) { return; } file.thumbUrl = ''; if (previewFile) { previewFile(file.originFileObj).then(function (previewDataUrl) { // Need append '' to avoid dead loop file.thumbUrl = previewDataUrl || ''; _this2.forceUpdate(); }); } }); } }, { key: "render", value: function render() { return React.createElement(_configProvider.ConfigConsumer, null, this.renderUploadList); } }]); return UploadList; }(React.Component); exports["default"] = UploadList; UploadList.defaultProps = { listType: 'text', progressAttr: { strokeWidth: 2, showInfo: false }, showRemoveIcon: true, showDownloadIcon: false, showPreviewIcon: true, previewFile: _utils.previewImage }; //# sourceMappingURL=UploadList.js.map /***/ }), /***/ 1170: /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = void 0; var React = _interopRequireWildcard(__webpack_require__(0)); var _Upload = _interopRequireDefault(__webpack_require__(1055)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } // stick class comoponent to avoid React ref warning inside Form // https://github.com/ant-design/ant-design/issues/18707 // eslint-disable-next-line react/prefer-stateless-function var Dragger = /*#__PURE__*/ function (_React$Component) { _inherits(Dragger, _React$Component); function Dragger() { _classCallCheck(this, Dragger); return _possibleConstructorReturn(this, _getPrototypeOf(Dragger).apply(this, arguments)); } _createClass(Dragger, [{ key: "render", value: function render() { var props = this.props; return React.createElement(_Upload["default"], _extends({}, props, { type: "drag", style: _extends(_extends({}, props.style), { height: props.height }) })); } }]); return Dragger; }(React.Component); exports["default"] = Dragger; //# sourceMappingURL=Dragger.js.map /***/ }), /***/ 2389: /***/ (function(module, exports, __webpack_require__) { // style-loader: Adds some css to the DOM by adding a