cloud-b2b 1.1.42 → 1.1.44

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.
@@ -65,22 +65,22 @@ var InputEditor = /*#__PURE__*/function (_React$Component) {
65
65
  var elem = this.refs[inputKey];
66
66
  this[inputKey] = new E(elem);
67
67
  //配置菜单
68
- menus && (this[inputKey].customConfig.menus = menus);
68
+ menus && (this[inputKey].config.menus = menus);
69
69
  //配置颜色
70
- color && (this[inputKey].customConfig.menus = color);
70
+ color && (this[inputKey].config.menus = color);
71
71
  //配置菜单
72
- this[inputKey].customConfig.menus = defaultMenus;
72
+ this[inputKey].config.menus = defaultMenus;
73
73
  if (menus) {
74
- this[inputKey].customConfig.menus = menus;
74
+ this[inputKey].config.menus = menus;
75
75
  }
76
- this[inputKey].customConfig.uploadImgShowBase64 = uploadImgShowBase64; //是否可以上传图片
77
- this[inputKey].customConfig.showLinkImg = showLinkImg; //隐藏网络图片
76
+ this[inputKey].config.uploadImgShowBase64 = uploadImgShowBase64; //是否可以上传图片
77
+ this[inputKey].config.showLinkImg = showLinkImg; //隐藏网络图片
78
78
 
79
- this[inputKey].customConfig.onchange = function (html) {
79
+ this[inputKey].config.onchange = function (html) {
80
80
  onChange && onChange(html);
81
81
  };
82
82
  //配置编辑区域的 z-index
83
- this[inputKey].customConfig.zIndex = 0;
83
+ this[inputKey].config.zIndex = 0;
84
84
  this[inputKey].create();
85
85
  this[inputKey].txt.html(value);
86
86
  }
@@ -88,20 +88,16 @@ var InputEditor = /*#__PURE__*/function (_React$Component) {
88
88
  }, {
89
89
  key: "componentDidUpdate",
90
90
  value: function componentDidUpdate() {
91
- var _this$props2 = this.props,
92
- inputKey = _this$props2.inputKey,
93
- _this$props2$value = _this$props2.value,
94
- value = _this$props2$value === void 0 ? '' : _this$props2$value,
95
- readonly = _this$props2.readonly;
96
- !readonly && !value && this[inputKey].txt.html(value); //支持清空操作
91
+ // const {inputKey,value='', readonly} = this.props;
92
+ // !readonly && value && this[inputKey].txt.html(value); //支持清空操作
97
93
  }
98
94
  }, {
99
95
  key: "render",
100
96
  value: function render() {
101
- var _this$props3 = this.props,
102
- inputKey = _this$props3.inputKey,
103
- readonly = _this$props3.readonly,
104
- value = _this$props3.value;
97
+ var _this$props2 = this.props,
98
+ inputKey = _this$props2.inputKey,
99
+ readonly = _this$props2.readonly,
100
+ value = _this$props2.value;
105
101
  return /*#__PURE__*/React.createElement("div", {
106
102
  className: variables('InputEditor')
107
103
  }, readonly ? /*#__PURE__*/React.createElement("div", {
@@ -632,7 +632,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
632
632
  text = helper.toThousands(text, col.decimalPlaces ? col.decimalPlaces : 2);
633
633
  return "\uFFE5".concat(text);
634
634
  } else {
635
- return "\uFFE5".concat(text.toFixed(2));
635
+ return text ? "\uFFE5".concat(text.toFixed(2)) : text;
636
636
  }
637
637
  };
638
638
  }
@@ -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,19 +269,57 @@ 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
  }
282
321
  fetchImgData();
283
- }, [props.fileList.length > 0 ? props.fileList : fileList]);
322
+ }, [props.fileList]);
284
323
  var onPreview = /*#__PURE__*/function () {
285
324
  var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(file) {
286
325
  return _regeneratorRuntime.wrap(function _callee3$(_context4) {
@@ -73,22 +73,22 @@ var InputEditor = /*#__PURE__*/function (_React$Component) {
73
73
  var elem = this.refs[inputKey];
74
74
  this[inputKey] = new E(elem);
75
75
  //配置菜单
76
- menus && (this[inputKey].customConfig.menus = menus);
76
+ menus && (this[inputKey].config.menus = menus);
77
77
  //配置颜色
78
- color && (this[inputKey].customConfig.menus = color);
78
+ color && (this[inputKey].config.menus = color);
79
79
  //配置菜单
80
- this[inputKey].customConfig.menus = defaultMenus;
80
+ this[inputKey].config.menus = defaultMenus;
81
81
  if (menus) {
82
- this[inputKey].customConfig.menus = menus;
82
+ this[inputKey].config.menus = menus;
83
83
  }
84
- this[inputKey].customConfig.uploadImgShowBase64 = uploadImgShowBase64; //是否可以上传图片
85
- this[inputKey].customConfig.showLinkImg = showLinkImg; //隐藏网络图片
84
+ this[inputKey].config.uploadImgShowBase64 = uploadImgShowBase64; //是否可以上传图片
85
+ this[inputKey].config.showLinkImg = showLinkImg; //隐藏网络图片
86
86
 
87
- this[inputKey].customConfig.onchange = function (html) {
87
+ this[inputKey].config.onchange = function (html) {
88
88
  onChange && onChange(html);
89
89
  };
90
90
  //配置编辑区域的 z-index
91
- this[inputKey].customConfig.zIndex = 0;
91
+ this[inputKey].config.zIndex = 0;
92
92
  this[inputKey].create();
93
93
  this[inputKey].txt.html(value);
94
94
  }
@@ -96,20 +96,16 @@ var InputEditor = /*#__PURE__*/function (_React$Component) {
96
96
  }, {
97
97
  key: "componentDidUpdate",
98
98
  value: function componentDidUpdate() {
99
- var _this$props2 = this.props,
100
- inputKey = _this$props2.inputKey,
101
- _this$props2$value = _this$props2.value,
102
- value = _this$props2$value === void 0 ? '' : _this$props2$value,
103
- readonly = _this$props2.readonly;
104
- !readonly && !value && this[inputKey].txt.html(value); //支持清空操作
99
+ // const {inputKey,value='', readonly} = this.props;
100
+ // !readonly && value && this[inputKey].txt.html(value); //支持清空操作
105
101
  }
106
102
  }, {
107
103
  key: "render",
108
104
  value: function render() {
109
- var _this$props3 = this.props,
110
- inputKey = _this$props3.inputKey,
111
- readonly = _this$props3.readonly,
112
- value = _this$props3.value;
105
+ var _this$props2 = this.props,
106
+ inputKey = _this$props2.inputKey,
107
+ readonly = _this$props2.readonly,
108
+ value = _this$props2.value;
113
109
  return /*#__PURE__*/_react["default"].createElement("div", {
114
110
  className: (0, _variables["default"])('InputEditor')
115
111
  }, readonly ? /*#__PURE__*/_react["default"].createElement("div", {
@@ -645,7 +645,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
645
645
  text = _helper["default"].toThousands(text, col.decimalPlaces ? col.decimalPlaces : 2);
646
646
  return "\uFFE5".concat(text);
647
647
  } else {
648
- return "\uFFE5".concat(text.toFixed(2));
648
+ return text ? "\uFFE5".concat(text.toFixed(2)) : text;
649
649
  }
650
650
  };
651
651
  }
@@ -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,19 +281,57 @@ 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
  }
294
333
  fetchImgData();
295
- }, [props.fileList.length > 0 ? props.fileList : fileList]);
334
+ }, [props.fileList]);
296
335
  var onPreview = /*#__PURE__*/function () {
297
336
  var _ref4 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(file) {
298
337
  return _regenerator["default"].wrap(function _callee3$(_context4) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloud-b2b",
3
- "version": "1.1.42",
3
+ "version": "1.1.44",
4
4
  "description": "A react component library dependent antd",
5
5
  "keywords": [
6
6
  "react",