cloud-b2b 1.1.45 → 1.1.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/es/Area/Area.js +45 -16
  2. package/es/Card/Card.js +4 -3
  3. package/es/CodeInput/CodeInput.js +59 -30
  4. package/es/Control/Control.js +117 -58
  5. package/es/Control/event.js +14 -0
  6. package/es/Enhance/Dialogs.js +21 -6
  7. package/es/Enhance/Loading.js +46 -26
  8. package/es/Enhance/index.js +2 -0
  9. package/es/Header/Header.js +35 -3
  10. package/es/Header/Vertical.js +24 -1
  11. package/es/ImageView/ImageView.js +22 -5
  12. package/es/Indent/Indent.js +7 -3
  13. package/es/InpurCascader/InputCascader.js +36 -10
  14. package/es/InputEditor/InputEditor.js +52 -53
  15. package/es/InputSearch/InputSearch.js +71 -26
  16. package/es/InputSelect/InputSelect.js +48 -17
  17. package/es/InputTreeSelect/InputTreeSelect.js +147 -0
  18. package/es/InputTreeSelect/package.json +6 -0
  19. package/es/InputWriting/InputWriting.js +28 -6
  20. package/es/Layout/Layout.js +59 -28
  21. package/es/LayoutLink/LayoutLink.js +20 -11
  22. package/es/Link/Link.js +27 -4
  23. package/es/Loading/Loading.js +3 -1
  24. package/es/Loading2/Loading2.js +2 -0
  25. package/es/ModalWithDrag/ModalWithDrag.js +8 -3
  26. package/es/ModalWithDrag/drag.js +29 -12
  27. package/es/NumberInput/NumberInput.js +64 -24
  28. package/es/Search/Search.js +164 -54
  29. package/es/Sidebar/Sidebar.js +34 -13
  30. package/es/Sidebar2/Sidebar.js +30 -3
  31. package/es/SuperForm/SuperForm.js +164 -27
  32. package/es/SuperForm2/SuperForm.js +182 -31
  33. package/es/SuperIcon/SuperIcon.js +6 -3
  34. package/es/SuperPagination/SuperPagination.js +32 -15
  35. package/es/SuperTab/SuperTab.js +27 -4
  36. package/es/SuperTab2/SuperTab2.js +33 -11
  37. package/es/SuperTable/DragSortRow.js +34 -6
  38. package/es/SuperTable/FilterDropDown.js +34 -10
  39. package/es/SuperTable/SuperTable.js +216 -84
  40. package/es/SuperTable/fixed.js +9 -1
  41. package/es/SuperTable2/SuperTable2.js +227 -102
  42. package/es/SuperTable2/SuperTableCell.js +60 -16
  43. package/es/SuperTable3/FilterDropDown.js +34 -10
  44. package/es/SuperTable3/SuperTable.js +175 -50
  45. package/es/SuperTable3/fixed.js +9 -1
  46. package/es/SuperToolbar/SuperToolbar.js +49 -21
  47. package/es/SuperUpload/SuperUpload.js +233 -156
  48. package/es/Title/Title.js +15 -12
  49. package/es/Viewer/ImageViews.js +60 -7
  50. package/es/Viewer/Viewer.js +32 -5
  51. package/es/WingBlank/WingBlank.js +6 -2
  52. package/es/helper.js +29 -7
  53. package/es/history.js +2 -3
  54. package/lib/Area/Area.js +64 -16
  55. package/lib/Card/Card.js +13 -3
  56. package/lib/CodeInput/CodeInput.js +77 -30
  57. package/lib/Control/Control.js +160 -58
  58. package/lib/Control/event.js +16 -0
  59. package/lib/Enhance/Dialogs.js +32 -6
  60. package/lib/Enhance/Loading.js +62 -26
  61. package/lib/Enhance/index.js +9 -0
  62. package/lib/Header/Header.js +48 -3
  63. package/lib/Header/Vertical.js +36 -1
  64. package/lib/ImageView/ImageView.js +30 -5
  65. package/lib/Indent/Indent.js +13 -3
  66. package/lib/InpurCascader/InputCascader.js +50 -11
  67. package/lib/InputEditor/InputEditor.js +61 -53
  68. package/lib/InputSearch/InputSearch.js +78 -26
  69. package/lib/InputSelect/InputSelect.js +62 -17
  70. package/lib/InputTreeSelect/InputTreeSelect.js +169 -0
  71. package/lib/InputTreeSelect/package.json +6 -0
  72. package/lib/InputWriting/InputWriting.js +35 -6
  73. package/lib/Layout/Layout.js +76 -28
  74. package/lib/LayoutLink/LayoutLink.js +38 -11
  75. package/lib/Link/Link.js +40 -4
  76. package/lib/Loading/Loading.js +9 -1
  77. package/lib/Loading2/Loading2.js +8 -0
  78. package/lib/ModalWithDrag/ModalWithDrag.js +18 -3
  79. package/lib/ModalWithDrag/drag.js +34 -12
  80. package/lib/NumberInput/NumberInput.js +77 -24
  81. package/lib/Search/Search.js +171 -54
  82. package/lib/Sidebar/Sidebar.js +46 -13
  83. package/lib/Sidebar2/Sidebar.js +42 -3
  84. package/lib/SuperForm/SuperForm.js +162 -27
  85. package/lib/SuperForm2/SuperForm.js +175 -31
  86. package/lib/SuperIcon/SuperIcon.js +14 -3
  87. package/lib/SuperPagination/SuperPagination.js +42 -15
  88. package/lib/SuperTab/SuperTab.js +34 -4
  89. package/lib/SuperTab2/SuperTab2.js +48 -11
  90. package/lib/SuperTable/DragSortRow.js +42 -6
  91. package/lib/SuperTable/FilterDropDown.js +42 -10
  92. package/lib/SuperTable/SuperTable.js +211 -83
  93. package/lib/SuperTable/fixed.js +13 -1
  94. package/lib/SuperTable2/SuperTable2.js +241 -102
  95. package/lib/SuperTable2/SuperTableCell.js +67 -13
  96. package/lib/SuperTable3/FilterDropDown.js +42 -10
  97. package/lib/SuperTable3/SuperTable.js +170 -49
  98. package/lib/SuperTable3/fixed.js +13 -1
  99. package/lib/SuperToolbar/SuperToolbar.js +64 -20
  100. package/lib/SuperUpload/SuperUpload.js +267 -156
  101. package/lib/Title/Title.js +24 -12
  102. package/lib/Viewer/ImageViews.js +63 -7
  103. package/lib/Viewer/Viewer.js +41 -5
  104. package/lib/WingBlank/WingBlank.js +14 -2
  105. package/lib/helper.js +47 -6
  106. package/lib/history.js +5 -0
  107. package/lib/index.js +76 -0
  108. package/lib/variables.js +4 -0
  109. package/package.json +2 -2
@@ -4,12 +4,19 @@ import _Button from "antd/es/button";
4
4
  import _Icon from "antd/es/icon";
5
5
  import _asyncToGenerator from "@babel/runtime-corejs3/helpers/asyncToGenerator";
6
6
  import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
7
+
7
8
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"]; if (!it) { if (_Array$isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
9
+
8
10
  function _unsupportedIterableToArray(o, minLen) { var _context7; if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = _sliceInstanceProperty(_context7 = Object.prototype.toString.call(o)).call(_context7, 8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return _Array$from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
9
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
11
+
12
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
13
+
10
14
  import _regeneratorRuntime from "@babel/runtime-corejs3/regenerator";
15
+
11
16
  function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
17
+
12
18
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context5, _context6; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context5 = ownKeys(Object(source), !0)).call(_context5, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context6 = ownKeys(Object(source))).call(_context6, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
19
+
13
20
  import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
14
21
  import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
15
22
  import _indexOfInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/index-of";
@@ -31,9 +38,8 @@ import helper from '../helper';
31
38
  import Title from '../Title';
32
39
  import variables from '../variables';
33
40
  var FORMATS = ['image/jpeg', 'image/gif', 'image/bmp', 'image/jpg', 'image/png', 'image/tiff', 'image/gif', 'image/pcx', 'image/tga', 'image/exif', 'image/fpx', 'image/svg', 'image/psd', 'image/cdr', 'image/pcd', 'image/dxf', 'image/ufo', 'image/eps', 'image/ai', 'image/raw', 'image/WMF', 'video/mp4'];
34
- var FORMATS1 = ['.jpeg', '.gif', '.bmp', '.jpg', '.png', '.tiff', '.pcx', '.tga', '.exif', '.fpx', '.svg', '.psd', '.cdr', '.pcd', '.dxf', '.ufo', '.eps', '.ai', '.raw', '.WMF'];
41
+ var FORMATS1 = ['.jpeg', '.gif', '.bmp', '.jpg', '.png', '.tiff', '.pcx', '.tga', '.exif', '.fpx', '.svg', '.psd', '.cdr', '.pcd', '.dxf', '.ufo', '.eps', '.ai', '.raw', '.WMF']; //组件属性定义
35
42
 
36
- //组件属性定义
37
43
  var propTypes = {
38
44
  fileList: PropTypes.array,
39
45
  //文件列表
@@ -58,6 +64,7 @@ var propTypes = {
58
64
  buttonTitle: PropTypes.string,
59
65
  //上传按钮的标题,默认‘上传’
60
66
  onFileChange: PropTypes.func //文件变更的回掉函数,func({fileList, fileDeleteList})
67
+
61
68
  };
62
69
 
63
70
  var convertFileList = function convertFileList(fileList) {
@@ -69,25 +76,29 @@ var convertFileList = function convertFileList(fileList) {
69
76
  };
70
77
  });
71
78
  };
79
+
72
80
  var getUploadProps = function getUploadProps(props, onPreview, fileList, setFileList) {
73
81
  var _props$readonly = props.readonly,
74
- readonly = _props$readonly === void 0 ? false : _props$readonly,
75
- _props$multiple = props.multiple,
76
- multiple = _props$multiple === void 0 ? true : _props$multiple,
77
- _props$limitSize = props.limitSize,
78
- limitSize = _props$limitSize === void 0 ? 5 : _props$limitSize,
79
- _props$listType = props.listType,
80
- listType = _props$listType === void 0 ? 'picture-card' : _props$listType,
81
- _props$fileDeleteList = props.fileDeleteList,
82
- fileDeleteList = _props$fileDeleteList === void 0 ? [] : _props$fileDeleteList,
83
- onFileChange = props.onFileChange;
82
+ readonly = _props$readonly === void 0 ? false : _props$readonly,
83
+ _props$multiple = props.multiple,
84
+ multiple = _props$multiple === void 0 ? true : _props$multiple,
85
+ _props$limitSize = props.limitSize,
86
+ limitSize = _props$limitSize === void 0 ? 5 : _props$limitSize,
87
+ _props$listType = props.listType,
88
+ listType = _props$listType === void 0 ? 'picture-card' : _props$listType,
89
+ _props$fileDeleteList = props.fileDeleteList,
90
+ fileDeleteList = _props$fileDeleteList === void 0 ? [] : _props$fileDeleteList,
91
+ onFileChange = props.onFileChange;
92
+
84
93
  var onChange = function onChange(_ref) {
85
94
  var file = _ref.file,
86
- fileList = _ref.fileList;
95
+ fileList = _ref.fileList;
87
96
  var limitNumber = props.limitNumber;
88
97
  if (fileList.length > limitNumber) return helper.showError("\u6587\u4EF6\u6700\u591A\u53EF\u4E0A\u4F20".concat(limitNumber, "\u4E2A"));
89
98
  if (!file) return; //过滤掉不符合条件的响应
99
+
90
100
  var newList = [];
101
+
91
102
  if (file.response && file.response.returnCode !== 0) {
92
103
  //检查是否上传到文件服务器成功
93
104
  helper.showError("\u4E0A\u4F20\u5931\u8D25\uFF0C".concat(file.response.returnMsg || ''));
@@ -96,6 +107,7 @@ var getUploadProps = function getUploadProps(props, onPreview, fileList, setFile
96
107
  });
97
108
  } else {
98
109
  var _context;
110
+
99
111
  newList = _mapInstanceProperty(_context = _filterInstanceProperty(fileList).call(fileList, function (item) {
100
112
  return item.status;
101
113
  })).call(_context, function (item) {
@@ -104,6 +116,7 @@ var getUploadProps = function getUploadProps(props, onPreview, fileList, setFile
104
116
  }) : item;
105
117
  });
106
118
  }
119
+
107
120
  file.response && onFileChange && onFileChange({
108
121
  fileList: convertFileList(newList),
109
122
  fileDeleteList: fileDeleteList
@@ -111,22 +124,28 @@ var getUploadProps = function getUploadProps(props, onPreview, fileList, setFile
111
124
  newList.fileName = newList.name;
112
125
  setFileList(newList);
113
126
  };
127
+
114
128
  var onRemove = /*#__PURE__*/function () {
115
129
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(fileRemove) {
116
130
  return _regeneratorRuntime.wrap(function _callee$(_context2) {
117
- while (1) switch (_context2.prev = _context2.next) {
118
- case 0:
119
- props.onRemove && props.onRemove(fileRemove, fileList, fileDeleteList);
120
- case 1:
121
- case "end":
122
- return _context2.stop();
131
+ while (1) {
132
+ switch (_context2.prev = _context2.next) {
133
+ case 0:
134
+ props.onRemove && props.onRemove(fileRemove, fileList, fileDeleteList);
135
+
136
+ case 1:
137
+ case "end":
138
+ return _context2.stop();
139
+ }
123
140
  }
124
141
  }, _callee);
125
142
  }));
143
+
126
144
  return function onRemove(_x) {
127
145
  return _ref2.apply(this, arguments);
128
146
  };
129
147
  }();
148
+
130
149
  return {
131
150
  action: props.action || '/api/proxy/zuul/archiver-service/file/upload/document',
132
151
  fileList: fileList,
@@ -137,9 +156,11 @@ var getUploadProps = function getUploadProps(props, onPreview, fileList, setFile
137
156
  onPreview: listType === 'text' ? undefined : onPreview,
138
157
  beforeUpload: function beforeUpload(currentFile) {
139
158
  var isLt = currentFile.size / 1024 / 1024 < limitSize; // 附件大小限制,单位M
159
+
140
160
  if (!isLt) {
141
161
  helper.showError("\u9644\u4EF6\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC7".concat(limitSize, "M"));
142
162
  }
163
+
143
164
  return isLt;
144
165
  },
145
166
  showUploadList: {
@@ -149,25 +170,26 @@ var getUploadProps = function getUploadProps(props, onPreview, fileList, setFile
149
170
  }
150
171
  };
151
172
  };
173
+
152
174
  function UploadButton(_ref3) {
153
175
  var _ref3$buttonLabel = _ref3.buttonLabel,
154
- buttonLabel = _ref3$buttonLabel === void 0 ? '上传' : _ref3$buttonLabel,
155
- _ref3$title = _ref3.title,
156
- title = _ref3$title === void 0 ? '附件' : _ref3$title,
157
- _ref3$required = _ref3.required,
158
- required = _ref3$required === void 0 ? false : _ref3$required,
159
- _ref3$fileList = _ref3.fileList,
160
- fileList = _ref3$fileList === void 0 ? [] : _ref3$fileList,
161
- _ref3$limitText = _ref3.limitText,
162
- limitText = _ref3$limitText === void 0 ? true : _ref3$limitText,
163
- _ref3$limitNumber = _ref3.limitNumber,
164
- limitNumber = _ref3$limitNumber === void 0 ? 10 : _ref3$limitNumber,
165
- _ref3$listType = _ref3.listType,
166
- listType = _ref3$listType === void 0 ? 'picture-card' : _ref3$listType,
167
- _ref3$needText = _ref3.needText,
168
- needText = _ref3$needText === void 0 ? false : _ref3$needText,
169
- _ref3$remark = _ref3.remark,
170
- remark = _ref3$remark === void 0 ? '大小>=5M' : _ref3$remark;
176
+ buttonLabel = _ref3$buttonLabel === void 0 ? '上传' : _ref3$buttonLabel,
177
+ _ref3$title = _ref3.title,
178
+ title = _ref3$title === void 0 ? '附件' : _ref3$title,
179
+ _ref3$required = _ref3.required,
180
+ required = _ref3$required === void 0 ? false : _ref3$required,
181
+ _ref3$fileList = _ref3.fileList,
182
+ fileList = _ref3$fileList === void 0 ? [] : _ref3$fileList,
183
+ _ref3$limitText = _ref3.limitText,
184
+ limitText = _ref3$limitText === void 0 ? true : _ref3$limitText,
185
+ _ref3$limitNumber = _ref3.limitNumber,
186
+ limitNumber = _ref3$limitNumber === void 0 ? 10 : _ref3$limitNumber,
187
+ _ref3$listType = _ref3.listType,
188
+ listType = _ref3$listType === void 0 ? 'picture-card' : _ref3$listType,
189
+ _ref3$needText = _ref3.needText,
190
+ needText = _ref3$needText === void 0 ? false : _ref3$needText,
191
+ _ref3$remark = _ref3.remark,
192
+ remark = _ref3$remark === void 0 ? '大小>=5M' : _ref3$remark;
171
193
  var canUpload = fileList.length < limitNumber;
172
194
  return canUpload ? listType === 'picture-card' ? /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(_Icon, {
173
195
  type: "plus"
@@ -186,163 +208,217 @@ function UploadButton(_ref3) {
186
208
  required: required
187
209
  }, !limitText ? null : /*#__PURE__*/React.createElement("span", null, limitText === true ? "\u9644\u4EF6\u4E2A\u6570\u82E5\u5927\u4E8E".concat(limitNumber, "\u4E2A\u8BF7\u538B\u7F29\u540E\u4E0A\u4F20") : limitText));
188
210
  }
211
+
189
212
  function SuperUpload(props) {
190
213
  var _useState = useState(true),
191
- _useState2 = _slicedToArray(_useState, 2),
192
- loading = _useState2[0],
193
- setLoading = _useState2[1];
214
+ _useState2 = _slicedToArray(_useState, 2),
215
+ loading = _useState2[0],
216
+ setLoading = _useState2[1];
217
+
194
218
  var _useState3 = useState([]),
195
- _useState4 = _slicedToArray(_useState3, 2),
196
- fileList = _useState4[0],
197
- setFileList = _useState4[1];
219
+ _useState4 = _slicedToArray(_useState3, 2),
220
+ fileList = _useState4[0],
221
+ setFileList = _useState4[1];
222
+
198
223
  var initFileList = [];
199
224
  useEffect(function () {
200
225
  function fetchImgData() {
201
226
  return _fetchImgData.apply(this, arguments);
202
227
  }
228
+
203
229
  function _fetchImgData() {
204
230
  _fetchImgData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
205
231
  var _iterator, _step, item, _iterator2, _step2, _item;
232
+
206
233
  return _regeneratorRuntime.wrap(function _callee2$(_context3) {
207
- while (1) switch (_context3.prev = _context3.next) {
208
- case 0:
209
- if (!(props.fileList.length > 0 || fileList.length > 0)) {
210
- _context3.next = 58;
234
+ while (1) {
235
+ switch (_context3.prev = _context3.next) {
236
+ case 0:
237
+ if (!(props.fileList.length > 0 || fileList.length > 0)) {
238
+ _context3.next = 58;
239
+ break;
240
+ }
241
+
242
+ _iterator = _createForOfIteratorHelper(props.fileList);
243
+ _context3.prev = 2;
244
+
245
+ _iterator.s();
246
+
247
+ case 4:
248
+ if ((_step = _iterator.n()).done) {
249
+ _context3.next = 27;
250
+ break;
251
+ }
252
+
253
+ item = _step.value;
254
+
255
+ if (!(item.fileUrl == '')) {
256
+ _context3.next = 17;
257
+ break;
258
+ }
259
+
260
+ if (!props.getFileList) {
261
+ _context3.next = 13;
262
+ break;
263
+ }
264
+
265
+ _context3.next = 10;
266
+ return props.getFileList(fileList);
267
+
268
+ case 10:
269
+ _context3.t0 = _context3.sent;
270
+ _context3.next = 14;
211
271
  break;
212
- }
213
- _iterator = _createForOfIteratorHelper(props.fileList);
214
- _context3.prev = 2;
215
- _iterator.s();
216
- case 4:
217
- if ((_step = _iterator.n()).done) {
218
- _context3.next = 27;
272
+
273
+ case 13:
274
+ _context3.t0 = [];
275
+
276
+ case 14:
277
+ initFileList = _context3.t0;
278
+ _context3.next = 25;
219
279
  break;
220
- }
221
- item = _step.value;
222
- if (!(item.fileUrl == '')) {
223
- _context3.next = 17;
280
+
281
+ case 17:
282
+ if (!props.getFileList) {
283
+ _context3.next = 23;
284
+ break;
285
+ }
286
+
287
+ _context3.next = 20;
288
+ return props.getFileList(props.fileList);
289
+
290
+ case 20:
291
+ _context3.t1 = _context3.sent;
292
+ _context3.next = 24;
293
+ break;
294
+
295
+ case 23:
296
+ _context3.t1 = [];
297
+
298
+ case 24:
299
+ initFileList = _context3.t1;
300
+
301
+ case 25:
302
+ _context3.next = 4;
224
303
  break;
225
- }
226
- if (!props.getFileList) {
227
- _context3.next = 13;
304
+
305
+ case 27:
306
+ _context3.next = 32;
228
307
  break;
229
- }
230
- _context3.next = 10;
231
- return props.getFileList(fileList);
232
- case 10:
233
- _context3.t0 = _context3.sent;
234
- _context3.next = 14;
235
- break;
236
- case 13:
237
- _context3.t0 = [];
238
- case 14:
239
- initFileList = _context3.t0;
240
- _context3.next = 25;
241
- break;
242
- case 17:
243
- if (!props.getFileList) {
244
- _context3.next = 23;
308
+
309
+ case 29:
310
+ _context3.prev = 29;
311
+ _context3.t2 = _context3["catch"](2);
312
+
313
+ _iterator.e(_context3.t2);
314
+
315
+ case 32:
316
+ _context3.prev = 32;
317
+
318
+ _iterator.f();
319
+
320
+ return _context3.finish(32);
321
+
322
+ case 35:
323
+ _iterator2 = _createForOfIteratorHelper(fileList);
324
+ _context3.prev = 36;
325
+
326
+ _iterator2.s();
327
+
328
+ case 38:
329
+ if ((_step2 = _iterator2.n()).done) {
330
+ _context3.next = 50;
331
+ break;
332
+ }
333
+
334
+ _item = _step2.value;
335
+
336
+ if (!props.getFileList) {
337
+ _context3.next = 46;
338
+ break;
339
+ }
340
+
341
+ _context3.next = 43;
342
+ return props.getFileList(fileList);
343
+
344
+ case 43:
345
+ _context3.t3 = _context3.sent;
346
+ _context3.next = 47;
245
347
  break;
246
- }
247
- _context3.next = 20;
248
- return props.getFileList(props.fileList);
249
- case 20:
250
- _context3.t1 = _context3.sent;
251
- _context3.next = 24;
252
- break;
253
- case 23:
254
- _context3.t1 = [];
255
- case 24:
256
- initFileList = _context3.t1;
257
- case 25:
258
- _context3.next = 4;
259
- break;
260
- case 27:
261
- _context3.next = 32;
262
- break;
263
- case 29:
264
- _context3.prev = 29;
265
- _context3.t2 = _context3["catch"](2);
266
- _iterator.e(_context3.t2);
267
- case 32:
268
- _context3.prev = 32;
269
- _iterator.f();
270
- return _context3.finish(32);
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;
348
+
349
+ case 46:
350
+ _context3.t3 = [];
351
+
352
+ case 47:
353
+ initFileList = _context3.t3;
354
+
355
+ case 48:
356
+ _context3.next = 38;
278
357
  break;
279
- }
280
- _item = _step2.value;
281
- if (!props.getFileList) {
282
- _context3.next = 46;
358
+
359
+ case 50:
360
+ _context3.next = 55;
283
361
  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:
310
- //const initFileList = props.getFileList ? await props.getFileList(props.fileList) : [];
311
- setFileList(initFileList ? initFileList : []);
312
- setLoading(false);
313
- case 60:
314
- case "end":
315
- return _context3.stop();
362
+
363
+ case 52:
364
+ _context3.prev = 52;
365
+ _context3.t4 = _context3["catch"](36);
366
+
367
+ _iterator2.e(_context3.t4);
368
+
369
+ case 55:
370
+ _context3.prev = 55;
371
+
372
+ _iterator2.f();
373
+
374
+ return _context3.finish(55);
375
+
376
+ case 58:
377
+ //const initFileList = props.getFileList ? await props.getFileList(props.fileList) : [];
378
+ setFileList(initFileList ? initFileList : []);
379
+ setLoading(false);
380
+
381
+ case 60:
382
+ case "end":
383
+ return _context3.stop();
384
+ }
316
385
  }
317
386
  }, _callee2, null, [[2, 29, 32, 35], [36, 52, 55, 58]]);
318
387
  }));
319
388
  return _fetchImgData.apply(this, arguments);
320
389
  }
390
+
321
391
  fetchImgData();
322
392
  }, [props.fileList]);
393
+
323
394
  var onPreview = /*#__PURE__*/function () {
324
395
  var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(file) {
325
396
  return _regeneratorRuntime.wrap(function _callee3$(_context4) {
326
- while (1) switch (_context4.prev = _context4.next) {
327
- case 0:
328
- props.onPreview && props.onPreview(file, fileList);
329
- case 1:
330
- case "end":
331
- return _context4.stop();
397
+ while (1) {
398
+ switch (_context4.prev = _context4.next) {
399
+ case 0:
400
+ props.onPreview && props.onPreview(file, fileList);
401
+
402
+ case 1:
403
+ case "end":
404
+ return _context4.stop();
405
+ }
332
406
  }
333
407
  }, _callee3);
334
408
  }));
409
+
335
410
  return function onPreview(_x2) {
336
411
  return _ref4.apply(this, arguments);
337
412
  };
338
413
  }();
414
+
339
415
  var uploadProps = getUploadProps(props, onPreview, fileList, setFileList);
340
416
  var _props$listType2 = props.listType,
341
- listType = _props$listType2 === void 0 ? 'picture-card' : _props$listType2,
342
- _props$limitNumber = props.limitNumber,
343
- limitNumber = _props$limitNumber === void 0 ? 10 : _props$limitNumber,
344
- readonly = props.readonly,
345
- title = props.title;
417
+ listType = _props$listType2 === void 0 ? 'picture-card' : _props$listType2,
418
+ _props$limitNumber = props.limitNumber,
419
+ limitNumber = _props$limitNumber === void 0 ? 10 : _props$limitNumber,
420
+ readonly = props.readonly,
421
+ title = props.title;
346
422
  var className = listType === 'picture-card' && (fileList === null || fileList === void 0 ? void 0 : fileList.length) < limitNumber ? variables('SuperUpload') : variables('SuperUpload2');
347
423
  var canUpload = (fileList === null || fileList === void 0 ? void 0 : fileList.length) >= limitNumber;
348
424
  return loading ? /*#__PURE__*/React.createElement("div", null, "loading...") : /*#__PURE__*/React.createElement("div", {
@@ -354,4 +430,5 @@ function SuperUpload(props) {
354
430
  fileList: fileList
355
431
  }))), props.needText ? /*#__PURE__*/React.createElement("span", null, props.remark) : null);
356
432
  }
433
+
357
434
  export default SuperUpload;
package/es/Title/Title.js CHANGED
@@ -5,20 +5,22 @@ var _excluded = ["title", "children", "className", "required", "fold", "isFold",
5
5
  import _bindInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/bind";
6
6
  import React from 'react';
7
7
  import variables from '../variables';
8
+
8
9
  function Title(_ref) {
9
10
  var title = _ref.title,
10
- children = _ref.children,
11
- className = _ref.className,
12
- _ref$required = _ref.required,
13
- required = _ref$required === void 0 ? false : _ref$required,
14
- _ref$fold = _ref.fold,
15
- fold = _ref$fold === void 0 ? false : _ref$fold,
16
- _ref$isFold = _ref.isFold,
17
- isFold = _ref$isFold === void 0 ? false : _ref$isFold,
18
- _ref$noBorder = _ref.noBorder,
19
- noBorder = _ref$noBorder === void 0 ? false : _ref$noBorder,
20
- onFold = _ref.onFold,
21
- props = _objectWithoutProperties(_ref, _excluded);
11
+ children = _ref.children,
12
+ className = _ref.className,
13
+ _ref$required = _ref.required,
14
+ required = _ref$required === void 0 ? false : _ref$required,
15
+ _ref$fold = _ref.fold,
16
+ fold = _ref$fold === void 0 ? false : _ref$fold,
17
+ _ref$isFold = _ref.isFold,
18
+ isFold = _ref$isFold === void 0 ? false : _ref$isFold,
19
+ _ref$noBorder = _ref.noBorder,
20
+ noBorder = _ref$noBorder === void 0 ? false : _ref$noBorder,
21
+ onFold = _ref.onFold,
22
+ props = _objectWithoutProperties(_ref, _excluded);
23
+
22
24
  return /*#__PURE__*/React.createElement("div", _extends({
23
25
  className: variables('title')
24
26
  }, props), /*#__PURE__*/React.createElement("span", {
@@ -30,4 +32,5 @@ function Title(_ref) {
30
32
  type: isFold ? 'down' : 'up'
31
33
  }) : null), isFold ? null : children);
32
34
  }
35
+
33
36
  export default Title;