cloud-b2b 1.1.57 → 1.1.58

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 (74) hide show
  1. package/es/Area/Area.js +11 -8
  2. package/es/CodeInput/CodeInput.js +19 -16
  3. package/es/Enhance/Dialogs.js +14 -11
  4. package/es/Enhance/Loading.js +18 -15
  5. package/es/Header/Header.js +20 -17
  6. package/es/Header/Vertical.js +14 -11
  7. package/es/ImageView/ImageView.js +13 -10
  8. package/es/InpurCascader/InputCascader.js +14 -11
  9. package/es/InputEditor/InputEditor.js +18 -16
  10. package/es/InputSearch/InputSearch.js +22 -19
  11. package/es/InputSelect/InputSelect.js +17 -14
  12. package/es/InputTreeSelect/InputTreeSelect.js +13 -10
  13. package/es/InputWriting/InputWriting.js +15 -12
  14. package/es/Layout/Layout.js +17 -14
  15. package/es/Link/Link.js +10 -7
  16. package/es/NumberInput/NumberInput.js +16 -13
  17. package/es/Search/Search.js +55 -52
  18. package/es/Sidebar/Sidebar.js +14 -11
  19. package/es/Sidebar2/Sidebar.js +16 -13
  20. package/es/SuperForm/SuperForm.js +79 -74
  21. package/es/SuperForm2/SuperForm.js +100 -95
  22. package/es/SuperPagination/SuperPagination.js +11 -8
  23. package/es/SuperTab/SuperTab.js +15 -12
  24. package/es/SuperTab2/SuperTab2.js +16 -13
  25. package/es/SuperTable/DragSortRow.js +15 -12
  26. package/es/SuperTable/FilterDropDown.js +14 -11
  27. package/es/SuperTable/SuperTable.js +71 -68
  28. package/es/SuperTable2/SuperTable2.js +89 -86
  29. package/es/SuperTable2/SuperTableCell.js +35 -25
  30. package/es/SuperTable3/FilterDropDown.js +14 -11
  31. package/es/SuperTable3/SuperTable.js +61 -58
  32. package/es/SuperToolbar/SuperToolbar.js +14 -11
  33. package/es/SuperUpload/SuperUpload.js +74 -74
  34. package/es/Viewer/ImageViews.js +19 -16
  35. package/es/Viewer/Viewer.js +14 -11
  36. package/es/helper.js +17 -18
  37. package/lib/Area/Area.js +11 -8
  38. package/lib/CodeInput/CodeInput.js +19 -16
  39. package/lib/Enhance/Dialogs.js +14 -11
  40. package/lib/Enhance/Loading.js +18 -15
  41. package/lib/Header/Header.js +20 -17
  42. package/lib/Header/Vertical.js +14 -11
  43. package/lib/ImageView/ImageView.js +13 -10
  44. package/lib/InpurCascader/InputCascader.js +14 -11
  45. package/lib/InputEditor/InputEditor.js +18 -16
  46. package/lib/InputSearch/InputSearch.js +22 -19
  47. package/lib/InputSelect/InputSelect.js +17 -14
  48. package/lib/InputTreeSelect/InputTreeSelect.js +13 -10
  49. package/lib/InputWriting/InputWriting.js +15 -12
  50. package/lib/Layout/Layout.js +17 -14
  51. package/lib/LayoutLink/LayoutLink.js +2 -1
  52. package/lib/Link/Link.js +10 -7
  53. package/lib/NumberInput/NumberInput.js +16 -13
  54. package/lib/Search/Search.js +57 -53
  55. package/lib/Sidebar/Sidebar.js +14 -11
  56. package/lib/Sidebar2/Sidebar.js +16 -13
  57. package/lib/SuperForm/SuperForm.js +81 -75
  58. package/lib/SuperForm2/SuperForm.js +102 -96
  59. package/lib/SuperPagination/SuperPagination.js +11 -8
  60. package/lib/SuperTab/SuperTab.js +15 -12
  61. package/lib/SuperTab2/SuperTab2.js +16 -13
  62. package/lib/SuperTable/DragSortRow.js +15 -12
  63. package/lib/SuperTable/FilterDropDown.js +14 -11
  64. package/lib/SuperTable/SuperTable.js +71 -68
  65. package/lib/SuperTable2/SuperTable2.js +91 -87
  66. package/lib/SuperTable2/SuperTableCell.js +35 -25
  67. package/lib/SuperTable3/FilterDropDown.js +14 -11
  68. package/lib/SuperTable3/SuperTable.js +61 -58
  69. package/lib/SuperToolbar/SuperToolbar.js +14 -11
  70. package/lib/SuperUpload/SuperUpload.js +76 -75
  71. package/lib/Viewer/ImageViews.js +19 -16
  72. package/lib/Viewer/Viewer.js +14 -11
  73. package/lib/helper.js +17 -18
  74. package/package.json +1 -1
@@ -20,17 +20,18 @@ import _Checkbox from "antd/es/checkbox";
20
20
  import _Icon from "antd/es/icon";
21
21
  import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
22
22
  import _createClass from "@babel/runtime-corejs3/helpers/createClass";
23
+ import _assertThisInitialized from "@babel/runtime-corejs3/helpers/assertThisInitialized";
24
+ import _inherits from "@babel/runtime-corejs3/helpers/inherits";
23
25
  import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
24
26
  import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
25
- import _inherits from "@babel/runtime-corejs3/helpers/inherits";
26
27
  import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
27
28
  import _Radio from "antd/es/radio";
28
29
  var _excluded = ["onRowClick"];
29
- function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof _Symbol && _getIteratorMethod(r) || r["@@iterator"]; if (!t) { if (_Array$isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, 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 o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
30
- function _unsupportedIterableToArray(r, a) { if (r) { var _context18; if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = _sliceInstanceProperty(_context18 = {}.toString.call(r)).call(_context18, 8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? _Array$from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
31
- function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
30
+ 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; } } }; }
31
+ function _unsupportedIterableToArray(o, minLen) { var _context20; if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = _sliceInstanceProperty(_context20 = Object.prototype.toString.call(o)).call(_context20, 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); }
32
+ 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; }
32
33
  function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
33
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context16, _context17; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context16 = ownKeys(Object(t), !0)).call(_context16, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context17 = ownKeys(Object(t))).call(_context17, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
34
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context18, _context19; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context18 = ownKeys(Object(t), !0)).call(_context18, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context19 = ownKeys(Object(t))).call(_context19, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
34
35
  import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
35
36
  import _Array$isArray from "@babel/runtime-corejs3/core-js-stable/array/is-array";
36
37
  import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
@@ -40,8 +41,8 @@ import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/insta
40
41
  import _reduceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/reduce";
41
42
  import _someInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/some";
42
43
  import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
43
- function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
44
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
44
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
45
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
45
46
  import React from 'react';
46
47
  import PropTypes from 'prop-types';
47
48
  import ReactDOM from 'react-dom';
@@ -63,7 +64,7 @@ var TypeEnum = ['readonly', 'index', 'checkbox', 'text', 'number', 'select',
63
64
  //按钮组
64
65
  'img',
65
66
  //图片标题组 value为{src,title}时显示图片标题 为字符串时 只显示图片
66
- 'uploadImg', 'double', 'radioGroup'];
67
+ 'uploadImg', 'double', 'radioGroup', 'selectWriting'];
67
68
 
68
69
  /**
69
70
  * key:标识所在列,在一个表格中必须唯一
@@ -125,6 +126,8 @@ var CallbackType = {
125
126
  * isEmphasized: [可选],是否强调,行字体加粗显示, 除了isEmphasized设置为true之外,加粗行数据里要设置__isEmphasized为true
126
127
  */
127
128
  var SuperTable2 = /*#__PURE__*/function (_React$Component) {
129
+ _inherits(SuperTable2, _React$Component);
130
+ var _super = _createSuper(SuperTable2);
128
131
  function SuperTable2() {
129
132
  var _context;
130
133
  var _this;
@@ -132,22 +135,22 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
132
135
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
133
136
  args[_key] = arguments[_key];
134
137
  }
135
- _this = _callSuper(this, SuperTable2, _concatInstanceProperty(_context = []).call(_context, args));
136
- _defineProperty(_this, "onSwitch", function (key, rowIndex) {
138
+ _this = _super.call.apply(_super, _concatInstanceProperty(_context = [this]).call(_context, args));
139
+ _defineProperty(_assertThisInitialized(_this), "onSwitch", function (key, rowIndex) {
137
140
  return function (value) {
138
141
  var _ref = _this.props.callback || {},
139
142
  onContentChange = _ref.onContentChange;
140
143
  onContentChange && onContentChange(_this.getIndex(rowIndex), key, value);
141
144
  };
142
145
  });
143
- _defineProperty(_this, "onCheck", function (key, rowIndex) {
146
+ _defineProperty(_assertThisInitialized(_this), "onCheck", function (key, rowIndex) {
144
147
  return function (e) {
145
148
  var _ref2 = _this.props.callback || {},
146
149
  onCheck = _ref2.onCheck;
147
150
  onCheck && onCheck(_this.getIndex(rowIndex), key, e.target.checked);
148
151
  };
149
152
  });
150
- _defineProperty(_this, "onChange", function (key, rowIndex) {
153
+ _defineProperty(_assertThisInitialized(_this), "onChange", function (key, rowIndex) {
151
154
  return function (value) {
152
155
  var _ref3 = _this.props.callback || {},
153
156
  onContentChange = _ref3.onContentChange;
@@ -155,7 +158,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
155
158
  onContentChange && onContentChange(_this.getIndex(rowIndex), key, value);
156
159
  };
157
160
  });
158
- _defineProperty(_this, "onDoubleChange1", function (key, rowIndex) {
161
+ _defineProperty(_assertThisInitialized(_this), "onDoubleChange1", function (key, rowIndex) {
159
162
  return function (doublekey, value) {
160
163
  var _ref4 = _this.props.callback || {},
161
164
  onContentChange = _ref4.onContentChange;
@@ -163,28 +166,28 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
163
166
  onContentChange && onContentChange(_this.getIndex(rowIndex), doublekey, value);
164
167
  };
165
168
  });
166
- _defineProperty(_this, "onSearch", function (key, rowIndex, config) {
169
+ _defineProperty(_assertThisInitialized(_this), "onSearch", function (key, rowIndex, config) {
167
170
  return function (value) {
168
171
  var _ref5 = _this.props.callback || {},
169
172
  onSearch = _ref5.onSearch;
170
173
  onSearch && onSearch(_this.getIndex(rowIndex), key, value, config);
171
174
  };
172
175
  });
173
- _defineProperty(_this, "onAdd", function (key) {
176
+ _defineProperty(_assertThisInitialized(_this), "onAdd", function (key) {
174
177
  return function () {
175
178
  var _ref6 = _this.props.callback || {},
176
179
  onAdd = _ref6.onAdd;
177
180
  onAdd && onAdd(key);
178
181
  };
179
182
  });
180
- _defineProperty(_this, "onRowAdd", function (key, index) {
183
+ _defineProperty(_assertThisInitialized(_this), "onRowAdd", function (key, index) {
181
184
  return function () {
182
185
  var _ref7 = _this.props.callback || {},
183
186
  onLink = _ref7.onLink;
184
187
  onLink && onLink(key, index, _this.props.items[index]);
185
188
  };
186
189
  });
187
- _defineProperty(_this, "onBlur", function (key, rowIndex) {
190
+ _defineProperty(_assertThisInitialized(_this), "onBlur", function (key, rowIndex) {
188
191
  return function (value) {
189
192
  var _ref8 = _this.props.callback || {},
190
193
  onBlur = _ref8.onBlur;
@@ -192,33 +195,33 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
192
195
  onBlur && onBlur(_this.getIndex(rowIndex), key, value);
193
196
  };
194
197
  });
195
- _defineProperty(_this, "onDoubleClick", function (key, value) {
198
+ _defineProperty(_assertThisInitialized(_this), "onDoubleClick", function (key, value) {
196
199
  return function () {
197
200
  var _ref9 = _this.props.callback || {},
198
201
  onDoubleClick = _ref9.onDoubleClick;
199
202
  onDoubleClick && onDoubleClick(key, value);
200
203
  };
201
204
  });
202
- _defineProperty(_this, "onImgTileClick", function (col, value, rowIndex) {
205
+ _defineProperty(_assertThisInitialized(_this), "onImgTileClick", function (col, value, rowIndex) {
203
206
  return function () {
204
- var _ref0 = _this.props.callback || {},
205
- onImgTileClick = _ref0.onImgTileClick;
207
+ var _ref10 = _this.props.callback || {},
208
+ onImgTileClick = _ref10.onImgTileClick;
206
209
  onImgTileClick && onImgTileClick(col, value, rowIndex);
207
210
  };
208
211
  });
209
- _defineProperty(_this, "onMoveRow", function (dragIndex, targetIndex) {
210
- var _ref1 = _this.props.callback || {},
211
- onMoveRow = _ref1.onMoveRow;
212
+ _defineProperty(_assertThisInitialized(_this), "onMoveRow", function (dragIndex, targetIndex) {
213
+ var _ref11 = _this.props.callback || {},
214
+ onMoveRow = _ref11.onMoveRow;
212
215
  onMoveRow && onMoveRow(dragIndex, targetIndex);
213
216
  });
214
- _defineProperty(_this, "closeValid", function () {
217
+ _defineProperty(_assertThisInitialized(_this), "closeValid", function () {
215
218
  var _this$props = _this.props,
216
219
  valid = _this$props.valid,
217
220
  _this$props$callback = _this$props.callback,
218
221
  callback = _this$props$callback === void 0 ? {} : _this$props$callback;
219
222
  valid && callback.onExitValid();
220
223
  });
221
- _defineProperty(_this, "getOptions", function (key, colOptions, index) {
224
+ _defineProperty(_assertThisInitialized(_this), "getOptions", function (key, colOptions, index) {
222
225
  var options = _this.props.items[index].options;
223
226
  var options2 = _this.props.options;
224
227
  if (options && _Array$isArray(options[key])) {
@@ -229,7 +232,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
229
232
  return colOptions;
230
233
  }
231
234
  });
232
- _defineProperty(_this, "validField", function (required, value) {
235
+ _defineProperty(_assertThisInitialized(_this), "validField", function (required, value) {
233
236
  if (!_this.props.valid || _this.error || !required || value) {
234
237
  return false;
235
238
  } else if (typeof value === 'number') {
@@ -239,15 +242,15 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
239
242
  return true;
240
243
  }
241
244
  });
242
- _defineProperty(_this, "toRadio", function (_ref10, index) {
243
- var value = _ref10.value,
244
- title = _ref10.title;
245
+ _defineProperty(_assertThisInitialized(_this), "toRadio", function (_ref12, index) {
246
+ var value = _ref12.value,
247
+ title = _ref12.title;
245
248
  return /*#__PURE__*/React.createElement(_Radio, {
246
249
  key: index,
247
250
  value: String(value)
248
251
  }, title);
249
252
  });
250
- _defineProperty(_this, "renderRadioGroup", function (config, value, index) {
253
+ _defineProperty(_assertThisInitialized(_this), "renderRadioGroup", function (config, value, index) {
251
254
  var key = config.key,
252
255
  options = config.options;
253
256
  var radioGroupProps = {
@@ -258,7 +261,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
258
261
  };
259
262
  return /*#__PURE__*/React.createElement(RadioGroup, radioGroupProps, _mapInstanceProperty(options).call(options, _this.toRadio));
260
263
  });
261
- _defineProperty(_this, "renderEditableCell", function (config, value, index) {
264
+ _defineProperty(_assertThisInitialized(_this), "renderEditableCell", function (config, value, index) {
262
265
  var key = config.key,
263
266
  type = config.type,
264
267
  options = config.options,
@@ -350,7 +353,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
350
353
  }
351
354
  return /*#__PURE__*/React.createElement(SuperTableCell, cellProps);
352
355
  });
353
- _defineProperty(_this, "renderDoubleEditableCell", function (config, value, index) {
356
+ _defineProperty(_assertThisInitialized(_this), "renderDoubleEditableCell", function (config, value, index) {
354
357
  var key = config.key,
355
358
  type = config.type,
356
359
  options = config.options,
@@ -380,7 +383,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
380
383
  };
381
384
  return /*#__PURE__*/React.createElement(SuperTableCell, cellProps);
382
385
  });
383
- _defineProperty(_this, "renderLinkCell", function (col, value, record, index) {
386
+ _defineProperty(_assertThisInitialized(_this), "renderLinkCell", function (col, value, record, index) {
384
387
  if (col.link === 'list') {
385
388
  var list = value && _Array$isArray(value) ? value : [];
386
389
  return /*#__PURE__*/React.createElement("div", {
@@ -391,8 +394,8 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
391
394
  var _context2;
392
395
  var split = index2 === list.length - 1 ? '' : ',';
393
396
  var onClick = function onClick() {
394
- var _ref11 = _this.props.callback || {},
395
- onLink = _ref11.onLink;
397
+ var _ref13 = _this.props.callback || {},
398
+ onLink = _ref13.onLink;
396
399
  onLink && onLink(col.key, index, item2);
397
400
  };
398
401
  return /*#__PURE__*/React.createElement("a", {
@@ -403,8 +406,8 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
403
406
  } else {
404
407
  var title = typeof col.link === 'string' ? col.link : value;
405
408
  var onClick = function onClick() {
406
- var _ref12 = _this.props.callback || {},
407
- onLink = _ref12.onLink;
409
+ var _ref14 = _this.props.callback || {},
410
+ onLink = _ref14.onLink;
408
411
  onLink && onLink(col.key, index, record);
409
412
  };
410
413
  return /*#__PURE__*/React.createElement("a", {
@@ -416,12 +419,12 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
416
419
  }, title);
417
420
  }
418
421
  });
419
- _defineProperty(_this, "getIndex", function (index) {
422
+ _defineProperty(_assertThisInitialized(_this), "getIndex", function (index) {
420
423
  return (_this.props.base || 0) + index;
421
424
  });
422
- _defineProperty(_this, "getCellRender", function (col) {
425
+ _defineProperty(_assertThisInitialized(_this), "getCellRender", function (col) {
423
426
  return function (value, record, index) {
424
- var _context3, _context4, _context5, _context6, _context7, _context8, _context9, _context0;
427
+ var _context3, _context4, _context5, _context6, _context7, _context8, _context9, _context10;
425
428
  var realType = record._isEdit === true && _this.canReadonly(col.type) ? col.editType : col.type;
426
429
  if (!realType) {
427
430
  return /*#__PURE__*/React.createElement("div", {
@@ -541,7 +544,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
541
544
  case 'uploadImg':
542
545
  var commonProps = _this.props.callback.buildSuperUploadProps ? _this.props.callback.buildSuperUploadProps() : {};
543
546
  var uploadProps = _objectSpread(_objectSpread(_objectSpread(_objectSpread({
544
- onFileChange: _this.props.callback.onTableFileChange ? _bindInstanceProperty(_context0 = _this.props.callback.onTableFileChange).call(_context0, null, col.key, index) : undefined,
547
+ onFileChange: _this.props.callback.onTableFileChange ? _bindInstanceProperty(_context10 = _this.props.callback.onTableFileChange).call(_context10, null, col.key, index) : undefined,
545
548
  type: col.type
546
549
  }, col.props), _this.props), commonProps), {}, {
547
550
  value: _this.props.items[index][col.key]
@@ -558,7 +561,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
558
561
  }
559
562
  };
560
563
  });
561
- _defineProperty(_this, "getCheckedStatus", function (key) {
564
+ _defineProperty(_assertThisInitialized(_this), "getCheckedStatus", function (key) {
562
565
  var has = false,
563
566
  not = false;
564
567
  var items = _this.props.items;
@@ -579,7 +582,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
579
582
  indeterminate: has && not
580
583
  };
581
584
  });
582
- _defineProperty(_this, "toAdd", function (key, showAdd) {
585
+ _defineProperty(_assertThisInitialized(_this), "toAdd", function (key, showAdd) {
583
586
  if (showAdd) {
584
587
  var onClick = _this.onAdd(key);
585
588
  return /*#__PURE__*/React.createElement(_Icon, {
@@ -591,12 +594,12 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
591
594
  return null;
592
595
  }
593
596
  });
594
- _defineProperty(_this, "getColumnTitle", function (_ref13) {
595
- var required = _ref13.required,
596
- title = _ref13.title,
597
- type = _ref13.type,
598
- key = _ref13.key,
599
- showAdd = _ref13.showAdd;
597
+ _defineProperty(_assertThisInitialized(_this), "getColumnTitle", function (_ref15) {
598
+ var required = _ref15.required,
599
+ title = _ref15.title,
600
+ type = _ref15.type,
601
+ key = _ref15.key,
602
+ showAdd = _ref15.showAdd;
600
603
  if (type === 'checkbox') {
601
604
  var status = _this.getCheckedStatus(key);
602
605
  return /*#__PURE__*/React.createElement(_Checkbox, _extends({
@@ -609,31 +612,31 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
609
612
  }, title, _this.toAdd(key, showAdd));
610
613
  }
611
614
  });
612
- _defineProperty(_this, "getColumnClassName", function (_ref14) {
613
- var type = _ref14.type,
614
- align = _ref14.align;
615
+ _defineProperty(_assertThisInitialized(_this), "getColumnClassName", function (_ref16) {
616
+ var type = _ref16.type,
617
+ align = _ref16.align;
615
618
  if (type === 'index' || type === 'checkbox') {
616
619
  return 'ant-table-selection-column';
617
620
  } else {
618
621
  return align ? variables('SuperTable2')[align] : '';
619
622
  }
620
623
  });
621
- _defineProperty(_this, "canReadonly", function (type) {
622
- var _context1;
623
- return !_includesInstanceProperty(_context1 = ['index', 'checkbox', 'link', 'button', 'switch', 'custom', 'img', 'toolbar', 'uploadImg', 'double']).call(_context1, type);
624
+ _defineProperty(_assertThisInitialized(_this), "canReadonly", function (type) {
625
+ var _context11;
626
+ return !_includesInstanceProperty(_context11 = ['index', 'checkbox', 'link', 'button', 'switch', 'custom', 'img', 'toolbar', 'uploadImg', 'double']).call(_context11, type);
624
627
  });
625
- _defineProperty(_this, "getColumns", function (cols) {
626
- var _context10;
628
+ _defineProperty(_assertThisInitialized(_this), "getColumns", function (cols) {
629
+ var _context12;
627
630
  var readonly = _this.props.readonly;
628
- return _mapInstanceProperty(_context10 = _filterInstanceProperty(cols).call(cols, function (col) {
631
+ return _mapInstanceProperty(_context12 = _filterInstanceProperty(cols).call(cols, function (col) {
629
632
  return !col.hide;
630
- })).call(_context10, function (_ref15, index) {
631
- var _context11;
632
- var col = _extends({}, (_objectDestructuringEmpty(_ref15), _ref15));
633
+ })).call(_context12, function (_ref17, index) {
634
+ var _context13;
635
+ var col = _extends({}, (_objectDestructuringEmpty(_ref17), _ref17));
633
636
  col.className = _this.getColumnClassName(col);
634
637
  col.title = _this.getColumnTitle(col);
635
638
  col.dataIndex = col.key;
636
- col.width = col.width ? col.width : _includesInstanceProperty(_context11 = ['index', 'checked']).call(_context11, col.key) ? 70 : col.type === 'img' ? 200 : 120;
639
+ col.width = col.width ? col.width : _includesInstanceProperty(_context13 = ['index', 'checked']).call(_context13, col.key) ? 70 : col.type === 'img' ? 200 : 120;
637
640
  // const {props = {}} =
638
641
  // const {edit = false} = props
639
642
  // if (!(readonly || col.type === 'readonly') || !this.canReadonly(col.type)) {
@@ -659,7 +662,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
659
662
  return col;
660
663
  });
661
664
  });
662
- _defineProperty(_this, "getText", function (value, options) {
665
+ _defineProperty(_assertThisInitialized(_this), "getText", function (value, options) {
663
666
  if (_Array$isArray(value)) {
664
667
  return _mapInstanceProperty(value).call(value, function (v) {
665
668
  return getTitle(v, options);
@@ -668,14 +671,14 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
668
671
  return getTitle(value, options);
669
672
  }
670
673
  });
671
- _defineProperty(_this, "getDataSource", function (items, cols) {
674
+ _defineProperty(_assertThisInitialized(_this), "getDataSource", function (items, cols) {
672
675
  return _mapInstanceProperty(items).call(items, function (item, index) {
673
- return _reduceInstanceProperty(cols).call(cols, function (result, _ref16) {
674
- var _context12, _context13;
675
- var key = _ref16.key,
676
- type = _ref16.type,
677
- options = _ref16.options;
678
- if (!_this.props.readonly && type && type !== 'readonly' && (!item.isReadonly || _Array$isArray(item.isReadonly) && !_includesInstanceProperty(_context12 = item.isReadonly).call(_context12, key)) || _includesInstanceProperty(_context13 = ['img', 'switch', 'custom', 'img', 'toolbar', 'uploadImg']).call(_context13, type)) {
676
+ return _reduceInstanceProperty(cols).call(cols, function (result, _ref18) {
677
+ var _context14, _context15;
678
+ var key = _ref18.key,
679
+ type = _ref18.type,
680
+ options = _ref18.options;
681
+ if (!_this.props.readonly && type && type !== 'readonly' && (!item.isReadonly || _Array$isArray(item.isReadonly) && !_includesInstanceProperty(_context14 = item.isReadonly).call(_context14, key)) || _includesInstanceProperty(_context15 = ['img', 'switch', 'custom', 'img', 'toolbar', 'uploadImg']).call(_context15, type)) {
679
682
  result[key] = item[key];
680
683
  } else {
681
684
  result[key] = _this.getText(item[key], options);
@@ -687,7 +690,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
687
690
  }));
688
691
  });
689
692
  });
690
- _defineProperty(_this, "getPropsByCheckbox", function () {
693
+ _defineProperty(_assertThisInitialized(_this), "getPropsByCheckbox", function () {
691
694
  var _this$props2 = _this.props,
692
695
  items = _this$props2.items,
693
696
  _this$props2$isEmphas = _this$props2.isEmphasized,
@@ -702,13 +705,13 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
702
705
  rowClassName: rowClassName
703
706
  };
704
707
  });
705
- _defineProperty(_this, "getSelectedRowKeys", function (items) {
708
+ _defineProperty(_assertThisInitialized(_this), "getSelectedRowKeys", function (items) {
706
709
  return _reduceInstanceProperty(items).call(items, function (result, item, index) {
707
710
  item.checked && result.push(index);
708
711
  return result;
709
712
  }, []);
710
713
  });
711
- _defineProperty(_this, "getPropsByCheckbox2", function (items) {
714
+ _defineProperty(_assertThisInitialized(_this), "getPropsByCheckbox2", function (items) {
712
715
  var _this$props3 = _this.props,
713
716
  _this$props3$checkbox = _this$props3.checkbox,
714
717
  checkbox = _this$props3$checkbox === void 0 ? true : _this$props3$checkbox,
@@ -793,7 +796,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
793
796
  };
794
797
  }
795
798
  });
796
- _defineProperty(_this, "getRowPropsForDrag", function () {
799
+ _defineProperty(_assertThisInitialized(_this), "getRowPropsForDrag", function () {
797
800
  return function (record, index) {
798
801
  return {
799
802
  index: index,
@@ -801,7 +804,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
801
804
  };
802
805
  };
803
806
  });
804
- _defineProperty(_this, "getRowProps", function (onRowClick) {
807
+ _defineProperty(_assertThisInitialized(_this), "getRowProps", function (onRowClick) {
805
808
  return function (record) {
806
809
  return {
807
810
  onClick: function onClick() {
@@ -813,8 +816,8 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
813
816
  };
814
817
  };
815
818
  });
816
- _defineProperty(_this, "getProps", function () {
817
- var _context14;
819
+ _defineProperty(_assertThisInitialized(_this), "getProps", function () {
820
+ var _context16;
818
821
  var _this$props4 = _this.props,
819
822
  cols = _this$props4.cols,
820
823
  items = _this$props4.items,
@@ -832,11 +835,11 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
832
835
  expandedRowRender = _this$props4$expanded === void 0 ? undefined : _this$props4$expanded,
833
836
  _this$props4$onExpand = _this$props4.onExpand,
834
837
  onExpand = _this$props4$onExpand === void 0 ? undefined : _this$props4$onExpand;
835
- var widthX = _reduceInstanceProperty(_context14 = _filterInstanceProperty(cols).call(cols, function (col) {
838
+ var widthX = _reduceInstanceProperty(_context16 = _filterInstanceProperty(cols).call(cols, function (col) {
836
839
  return !col.hide;
837
- })).call(_context14, function (width, item) {
838
- var _context15;
839
- return width += item.width ? item.width : _includesInstanceProperty(_context15 = ['index', 'checked']).call(_context15, item.key) ? 70 : item.type === 'img' ? 200 : 120;
840
+ })).call(_context16, function (width, item) {
841
+ var _context17;
842
+ return width += item.width ? item.width : _includesInstanceProperty(_context17 = ['index', 'checked']).call(_context17, item.key) ? 70 : item.type === 'img' ? 200 : 120;
840
843
  }, 0);
841
844
  var scrollProps = !helper.isEmpty2(expandedRowRender) ? {
842
845
  expandedRowRender: expandedRowRender
@@ -874,9 +877,9 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
874
877
  onExpand: onExpand
875
878
  }, scrollProps);
876
879
  });
877
- _defineProperty(_this, "setScroll", function () {
880
+ _defineProperty(_assertThisInitialized(_this), "setScroll", function () {
878
881
  if (_this.props.maxHeight && _this.props.items.length) {
879
- var root = ReactDOM.findDOMNode(_this);
882
+ var root = ReactDOM.findDOMNode(_assertThisInitialized(_this));
880
883
  var container = root.getElementsByClassName('ant-table-body')[0];
881
884
  var header = root.getElementsByClassName('ant-table-thead')[0];
882
885
  fixed(container, header, _this.props.maxHeight);
@@ -884,8 +887,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
884
887
  });
885
888
  return _this;
886
889
  }
887
- _inherits(SuperTable2, _React$Component);
888
- return _createClass(SuperTable2, [{
890
+ _createClass(SuperTable2, [{
889
891
  key: "componentDidMount",
890
892
  value: function componentDidMount() {
891
893
  this.setScroll();
@@ -904,6 +906,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
904
906
  }));
905
907
  }
906
908
  }]);
909
+ return SuperTable2;
907
910
  }(React.Component);
908
911
  _defineProperty(SuperTable2, "propTypes", {
909
912
  cols: PropTypes.arrayOf(PropTypes.shape(ColType)).isRequired,