cloud-b2b 1.1.41 → 1.1.43

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.
@@ -108,6 +108,7 @@ var getUploadProps = function getUploadProps(props, onPreview, fileList, setFile
108
108
  fileList: convertFileList(newList),
109
109
  fileDeleteList: fileDeleteList
110
110
  });
111
+ newList.fileName = newList.name;
111
112
  setFileList(newList);
112
113
  };
113
114
  var onRemove = /*#__PURE__*/function () {
@@ -201,12 +202,12 @@ function SuperUpload(props) {
201
202
  }
202
203
  function _fetchImgData() {
203
204
  _fetchImgData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
204
- var _iterator, _step, item;
205
+ var _iterator, _step, item, _iterator2, _step2, _item;
205
206
  return _regeneratorRuntime.wrap(function _callee2$(_context3) {
206
207
  while (1) switch (_context3.prev = _context3.next) {
207
208
  case 0:
208
- if (!(props.fileList.length > 0)) {
209
- _context3.next = 35;
209
+ if (!(props.fileList.length > 0 || fileList.length > 0)) {
210
+ _context3.next = 58;
210
211
  break;
211
212
  }
212
213
  _iterator = _createForOfIteratorHelper(props.fileList);
@@ -268,14 +269,52 @@ function SuperUpload(props) {
268
269
  _iterator.f();
269
270
  return _context3.finish(32);
270
271
  case 35:
272
+ _iterator2 = _createForOfIteratorHelper(fileList);
273
+ _context3.prev = 36;
274
+ _iterator2.s();
275
+ case 38:
276
+ if ((_step2 = _iterator2.n()).done) {
277
+ _context3.next = 50;
278
+ break;
279
+ }
280
+ _item = _step2.value;
281
+ if (!props.getFileList) {
282
+ _context3.next = 46;
283
+ break;
284
+ }
285
+ _context3.next = 43;
286
+ return props.getFileList(fileList);
287
+ case 43:
288
+ _context3.t3 = _context3.sent;
289
+ _context3.next = 47;
290
+ break;
291
+ case 46:
292
+ _context3.t3 = [];
293
+ case 47:
294
+ initFileList = _context3.t3;
295
+ case 48:
296
+ _context3.next = 38;
297
+ break;
298
+ case 50:
299
+ _context3.next = 55;
300
+ break;
301
+ case 52:
302
+ _context3.prev = 52;
303
+ _context3.t4 = _context3["catch"](36);
304
+ _iterator2.e(_context3.t4);
305
+ case 55:
306
+ _context3.prev = 55;
307
+ _iterator2.f();
308
+ return _context3.finish(55);
309
+ case 58:
271
310
  //const initFileList = props.getFileList ? await props.getFileList(props.fileList) : [];
272
311
  setFileList(initFileList ? initFileList : []);
273
312
  setLoading(false);
274
- case 37:
313
+ case 60:
275
314
  case "end":
276
315
  return _context3.stop();
277
316
  }
278
- }, _callee2, null, [[2, 29, 32, 35]]);
317
+ }, _callee2, null, [[2, 29, 32, 35], [36, 52, 55, 58]]);
279
318
  }));
280
319
  return _fetchImgData.apply(this, arguments);
281
320
  }
@@ -120,6 +120,7 @@ var getUploadProps = function getUploadProps(props, onPreview, fileList, setFile
120
120
  fileList: convertFileList(newList),
121
121
  fileDeleteList: fileDeleteList
122
122
  });
123
+ newList.fileName = newList.name;
123
124
  setFileList(newList);
124
125
  };
125
126
  var onRemove = /*#__PURE__*/function () {
@@ -213,12 +214,12 @@ function SuperUpload(props) {
213
214
  }
214
215
  function _fetchImgData() {
215
216
  _fetchImgData = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
216
- var _iterator, _step, item;
217
+ var _iterator, _step, item, _iterator2, _step2, _item;
217
218
  return _regenerator["default"].wrap(function _callee2$(_context3) {
218
219
  while (1) switch (_context3.prev = _context3.next) {
219
220
  case 0:
220
- if (!(props.fileList.length > 0)) {
221
- _context3.next = 35;
221
+ if (!(props.fileList.length > 0 || fileList.length > 0)) {
222
+ _context3.next = 58;
222
223
  break;
223
224
  }
224
225
  _iterator = _createForOfIteratorHelper(props.fileList);
@@ -280,14 +281,52 @@ function SuperUpload(props) {
280
281
  _iterator.f();
281
282
  return _context3.finish(32);
282
283
  case 35:
284
+ _iterator2 = _createForOfIteratorHelper(fileList);
285
+ _context3.prev = 36;
286
+ _iterator2.s();
287
+ case 38:
288
+ if ((_step2 = _iterator2.n()).done) {
289
+ _context3.next = 50;
290
+ break;
291
+ }
292
+ _item = _step2.value;
293
+ if (!props.getFileList) {
294
+ _context3.next = 46;
295
+ break;
296
+ }
297
+ _context3.next = 43;
298
+ return props.getFileList(fileList);
299
+ case 43:
300
+ _context3.t3 = _context3.sent;
301
+ _context3.next = 47;
302
+ break;
303
+ case 46:
304
+ _context3.t3 = [];
305
+ case 47:
306
+ initFileList = _context3.t3;
307
+ case 48:
308
+ _context3.next = 38;
309
+ break;
310
+ case 50:
311
+ _context3.next = 55;
312
+ break;
313
+ case 52:
314
+ _context3.prev = 52;
315
+ _context3.t4 = _context3["catch"](36);
316
+ _iterator2.e(_context3.t4);
317
+ case 55:
318
+ _context3.prev = 55;
319
+ _iterator2.f();
320
+ return _context3.finish(55);
321
+ case 58:
283
322
  //const initFileList = props.getFileList ? await props.getFileList(props.fileList) : [];
284
323
  setFileList(initFileList ? initFileList : []);
285
324
  setLoading(false);
286
- case 37:
325
+ case 60:
287
326
  case "end":
288
327
  return _context3.stop();
289
328
  }
290
- }, _callee2, null, [[2, 29, 32, 35]]);
329
+ }, _callee2, null, [[2, 29, 32, 35], [36, 52, 55, 58]]);
291
330
  }));
292
331
  return _fetchImgData.apply(this, arguments);
293
332
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloud-b2b",
3
- "version": "1.1.41",
3
+ "version": "1.1.43",
4
4
  "description": "A react component library dependent antd",
5
5
  "keywords": [
6
6
  "react",