cloud-b2b 1.1.64 → 1.1.66

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 (80) 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/Search2/Search.js +110 -109
  19. package/es/Search2/Search.less +64 -64
  20. package/es/Search2/package.json +6 -6
  21. package/es/Sidebar/Sidebar.js +14 -11
  22. package/es/Sidebar2/Sidebar.js +16 -13
  23. package/es/SuperForm/SuperForm.js +79 -74
  24. package/es/SuperForm2/SuperForm.js +100 -95
  25. package/es/SuperPagination/SuperPagination.js +11 -8
  26. package/es/SuperTab/SuperTab.js +15 -12
  27. package/es/SuperTab2/SuperTab2.js +16 -13
  28. package/es/SuperTable/DragSortRow.js +15 -12
  29. package/es/SuperTable/FilterDropDown.js +14 -11
  30. package/es/SuperTable/SuperTable.js +71 -68
  31. package/es/SuperTable2/SuperTable2.js +115 -96
  32. package/es/SuperTable2/SuperTableCell.js +30 -27
  33. package/es/SuperTable3/FilterDropDown.js +14 -11
  34. package/es/SuperTable3/SuperTable.js +61 -58
  35. package/es/SuperToolbar/SuperToolbar.js +14 -11
  36. package/es/SuperUpload/SuperUpload.js +74 -74
  37. package/es/Viewer/ImageViews.js +19 -16
  38. package/es/Viewer/Viewer.js +14 -11
  39. package/es/helper.js +17 -18
  40. package/lib/Area/Area.js +11 -8
  41. package/lib/CodeInput/CodeInput.js +19 -16
  42. package/lib/Enhance/Dialogs.js +14 -11
  43. package/lib/Enhance/Loading.js +18 -15
  44. package/lib/Header/Header.js +20 -17
  45. package/lib/Header/Vertical.js +14 -11
  46. package/lib/ImageView/ImageView.js +13 -10
  47. package/lib/InpurCascader/InputCascader.js +14 -11
  48. package/lib/InputEditor/InputEditor.js +18 -16
  49. package/lib/InputSearch/InputSearch.js +22 -19
  50. package/lib/InputSelect/InputSelect.js +17 -14
  51. package/lib/InputTreeSelect/InputTreeSelect.js +13 -10
  52. package/lib/InputWriting/InputWriting.js +15 -12
  53. package/lib/Layout/Layout.js +17 -14
  54. package/lib/LayoutLink/LayoutLink.js +2 -1
  55. package/lib/Link/Link.js +10 -7
  56. package/lib/NumberInput/NumberInput.js +16 -13
  57. package/lib/Search/Search.js +57 -53
  58. package/lib/Search2/Search.js +112 -110
  59. package/lib/Search2/Search.less +64 -64
  60. package/lib/Search2/package.json +6 -6
  61. package/lib/Sidebar/Sidebar.js +14 -11
  62. package/lib/Sidebar2/Sidebar.js +16 -13
  63. package/lib/SuperForm/SuperForm.js +81 -75
  64. package/lib/SuperForm2/SuperForm.js +102 -96
  65. package/lib/SuperPagination/SuperPagination.js +11 -8
  66. package/lib/SuperTab/SuperTab.js +15 -12
  67. package/lib/SuperTab2/SuperTab2.js +16 -13
  68. package/lib/SuperTable/DragSortRow.js +15 -12
  69. package/lib/SuperTable/FilterDropDown.js +14 -11
  70. package/lib/SuperTable/SuperTable.js +71 -68
  71. package/lib/SuperTable2/SuperTable2.js +117 -97
  72. package/lib/SuperTable2/SuperTableCell.js +30 -27
  73. package/lib/SuperTable3/FilterDropDown.js +14 -11
  74. package/lib/SuperTable3/SuperTable.js +61 -58
  75. package/lib/SuperToolbar/SuperToolbar.js +14 -11
  76. package/lib/SuperUpload/SuperUpload.js +76 -75
  77. package/lib/Viewer/ImageViews.js +19 -16
  78. package/lib/Viewer/Viewer.js +14 -11
  79. package/lib/helper.js +17 -18
  80. 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';
@@ -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 === 'customType') {
427
430
  var _this$props$items$rec = _this.props.items[record.key].__customType,
@@ -546,7 +549,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
546
549
  case 'uploadImg':
547
550
  var commonProps = _this.props.callback.buildSuperUploadProps ? _this.props.callback.buildSuperUploadProps() : {};
548
551
  var uploadProps = _objectSpread(_objectSpread(_objectSpread(_objectSpread({
549
- onFileChange: _this.props.callback.onTableFileChange ? _bindInstanceProperty(_context0 = _this.props.callback.onTableFileChange).call(_context0, null, col.key, index) : undefined,
552
+ onFileChange: _this.props.callback.onTableFileChange ? _bindInstanceProperty(_context10 = _this.props.callback.onTableFileChange).call(_context10, null, col.key, index) : undefined,
550
553
  type: col.type
551
554
  }, col.props), _this.props), commonProps), {}, {
552
555
  value: _this.props.items[index][col.key]
@@ -563,7 +566,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
563
566
  }
564
567
  };
565
568
  });
566
- _defineProperty(_this, "getCheckedStatus", function (key) {
569
+ _defineProperty(_assertThisInitialized(_this), "getCheckedStatus", function (key) {
567
570
  var has = false,
568
571
  not = false;
569
572
  var items = _this.props.items;
@@ -584,7 +587,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
584
587
  indeterminate: has && not
585
588
  };
586
589
  });
587
- _defineProperty(_this, "toAdd", function (key, showAdd) {
590
+ _defineProperty(_assertThisInitialized(_this), "toAdd", function (key, showAdd) {
588
591
  if (showAdd) {
589
592
  var onClick = _this.onAdd(key);
590
593
  return /*#__PURE__*/React.createElement(_Icon, {
@@ -596,12 +599,12 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
596
599
  return null;
597
600
  }
598
601
  });
599
- _defineProperty(_this, "getColumnTitle", function (_ref14) {
600
- var required = _ref14.required,
601
- title = _ref14.title,
602
- type = _ref14.type,
603
- key = _ref14.key,
604
- showAdd = _ref14.showAdd;
602
+ _defineProperty(_assertThisInitialized(_this), "getColumnTitle", function (_ref16) {
603
+ var required = _ref16.required,
604
+ title = _ref16.title,
605
+ type = _ref16.type,
606
+ key = _ref16.key,
607
+ showAdd = _ref16.showAdd;
605
608
  if (type === 'checkbox') {
606
609
  var status = _this.getCheckedStatus(key);
607
610
  return /*#__PURE__*/React.createElement(_Checkbox, _extends({
@@ -614,31 +617,31 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
614
617
  }, title, _this.toAdd(key, showAdd));
615
618
  }
616
619
  });
617
- _defineProperty(_this, "getColumnClassName", function (_ref15) {
618
- var type = _ref15.type,
619
- align = _ref15.align;
620
+ _defineProperty(_assertThisInitialized(_this), "getColumnClassName", function (_ref17) {
621
+ var type = _ref17.type,
622
+ align = _ref17.align;
620
623
  if (type === 'index' || type === 'checkbox') {
621
624
  return 'ant-table-selection-column';
622
625
  } else {
623
626
  return align ? variables('SuperTable2')[align] : '';
624
627
  }
625
628
  });
626
- _defineProperty(_this, "canReadonly", function (type) {
627
- var _context1;
628
- return !_includesInstanceProperty(_context1 = ['index', 'checkbox', 'link', 'button', 'switch', 'custom', 'img', 'toolbar', 'uploadImg', 'double']).call(_context1, type);
629
+ _defineProperty(_assertThisInitialized(_this), "canReadonly", function (type) {
630
+ var _context11;
631
+ return !_includesInstanceProperty(_context11 = ['index', 'checkbox', 'link', 'button', 'switch', 'custom', 'img', 'toolbar', 'uploadImg', 'double']).call(_context11, type);
629
632
  });
630
- _defineProperty(_this, "getColumns", function (cols) {
631
- var _context10;
633
+ _defineProperty(_assertThisInitialized(_this), "getColumns", function (cols) {
634
+ var _context12;
632
635
  var readonly = _this.props.readonly;
633
- return _mapInstanceProperty(_context10 = _filterInstanceProperty(cols).call(cols, function (col) {
636
+ return _mapInstanceProperty(_context12 = _filterInstanceProperty(cols).call(cols, function (col) {
634
637
  return !col.hide;
635
- })).call(_context10, function (_ref16, index) {
636
- var _context11;
637
- var col = _extends({}, (_objectDestructuringEmpty(_ref16), _ref16));
638
+ })).call(_context12, function (_ref18, index) {
639
+ var _context13;
640
+ var col = _extends({}, (_objectDestructuringEmpty(_ref18), _ref18));
638
641
  col.className = _this.getColumnClassName(col);
639
642
  col.title = _this.getColumnTitle(col);
640
643
  col.dataIndex = col.key;
641
- col.width = col.width ? col.width : _includesInstanceProperty(_context11 = ['index', 'checked']).call(_context11, col.key) ? 70 : col.type === 'img' ? 200 : 120;
644
+ col.width = col.width ? col.width : _includesInstanceProperty(_context13 = ['index', 'checked']).call(_context13, col.key) ? 70 : col.type === 'img' ? 200 : 120;
642
645
  // const {props = {}} =
643
646
  // const {edit = false} = props
644
647
  // if (!(readonly || col.type === 'readonly') || !this.canReadonly(col.type)) {
@@ -664,7 +667,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
664
667
  return col;
665
668
  });
666
669
  });
667
- _defineProperty(_this, "getText", function (value, options) {
670
+ _defineProperty(_assertThisInitialized(_this), "getText", function (value, options) {
668
671
  if (_Array$isArray(value)) {
669
672
  return _mapInstanceProperty(value).call(value, function (v) {
670
673
  return getTitle(v, options);
@@ -673,14 +676,14 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
673
676
  return getTitle(value, options);
674
677
  }
675
678
  });
676
- _defineProperty(_this, "getDataSource", function (items, cols) {
679
+ _defineProperty(_assertThisInitialized(_this), "getDataSource", function (items, cols) {
677
680
  return _mapInstanceProperty(items).call(items, function (item, index) {
678
- return _reduceInstanceProperty(cols).call(cols, function (result, _ref17) {
679
- var _context12, _context13;
680
- var key = _ref17.key,
681
- type = _ref17.type,
682
- options = _ref17.options;
683
- 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)) {
681
+ return _reduceInstanceProperty(cols).call(cols, function (result, _ref19) {
682
+ var _context14, _context15;
683
+ var key = _ref19.key,
684
+ type = _ref19.type,
685
+ options = _ref19.options;
686
+ 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)) {
684
687
  result[key] = item[key];
685
688
  } else {
686
689
  result[key] = _this.getText(item[key], options);
@@ -692,7 +695,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
692
695
  }));
693
696
  });
694
697
  });
695
- _defineProperty(_this, "getPropsByCheckbox", function () {
698
+ _defineProperty(_assertThisInitialized(_this), "getPropsByCheckbox", function () {
696
699
  var _this$props2 = _this.props,
697
700
  items = _this$props2.items,
698
701
  _this$props2$isEmphas = _this$props2.isEmphasized,
@@ -707,13 +710,13 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
707
710
  rowClassName: rowClassName
708
711
  };
709
712
  });
710
- _defineProperty(_this, "getSelectedRowKeys", function (items) {
713
+ _defineProperty(_assertThisInitialized(_this), "getSelectedRowKeys", function (items) {
711
714
  return _reduceInstanceProperty(items).call(items, function (result, item, index) {
712
715
  item.checked && result.push(index);
713
716
  return result;
714
717
  }, []);
715
718
  });
716
- _defineProperty(_this, "getPropsByCheckbox2", function (items) {
719
+ _defineProperty(_assertThisInitialized(_this), "getPropsByCheckbox2", function (items) {
717
720
  var _this$props3 = _this.props,
718
721
  _this$props3$checkbox = _this$props3.checkbox,
719
722
  checkbox = _this$props3$checkbox === void 0 ? true : _this$props3$checkbox,
@@ -798,7 +801,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
798
801
  };
799
802
  }
800
803
  });
801
- _defineProperty(_this, "getRowPropsForDrag", function () {
804
+ _defineProperty(_assertThisInitialized(_this), "getRowPropsForDrag", function () {
802
805
  return function (record, index) {
803
806
  return {
804
807
  index: index,
@@ -806,7 +809,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
806
809
  };
807
810
  };
808
811
  });
809
- _defineProperty(_this, "getRowProps", function (onRowClick) {
812
+ _defineProperty(_assertThisInitialized(_this), "getRowProps", function (onRowClick) {
810
813
  return function (record) {
811
814
  return {
812
815
  onClick: function onClick() {
@@ -818,8 +821,8 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
818
821
  };
819
822
  };
820
823
  });
821
- _defineProperty(_this, "getProps", function () {
822
- var _context14;
824
+ _defineProperty(_assertThisInitialized(_this), "getProps", function () {
825
+ var _context16;
823
826
  var _this$props4 = _this.props,
824
827
  cols = _this$props4.cols,
825
828
  items = _this$props4.items,
@@ -836,23 +839,39 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
836
839
  _this$props4$expanded = _this$props4.expandedRowRender,
837
840
  expandedRowRender = _this$props4$expanded === void 0 ? undefined : _this$props4$expanded,
838
841
  _this$props4$onExpand = _this$props4.onExpand,
839
- onExpand = _this$props4$onExpand === void 0 ? undefined : _this$props4$onExpand;
840
- var widthX = _reduceInstanceProperty(_context14 = _filterInstanceProperty(cols).call(cols, function (col) {
842
+ onExpand = _this$props4$onExpand === void 0 ? undefined : _this$props4$onExpand,
843
+ _this$props4$expanded2 = _this$props4.expandedRowRenderKeepScroll,
844
+ expandedRowRenderKeepScroll = _this$props4$expanded2 === void 0 ? false : _this$props4$expanded2;
845
+ var widthX = _reduceInstanceProperty(_context16 = _filterInstanceProperty(cols).call(cols, function (col) {
841
846
  return !col.hide;
842
- })).call(_context14, function (width, item) {
843
- var _context15;
844
- return width += item.width ? item.width : _includesInstanceProperty(_context15 = ['index', 'checked']).call(_context15, item.key) ? 70 : item.type === 'img' ? 200 : 120;
847
+ })).call(_context16, function (width, item) {
848
+ var _context17;
849
+ return width += item.width ? item.width : _includesInstanceProperty(_context17 = ['index', 'checked']).call(_context17, item.key) ? 70 : item.type === 'img' ? 200 : 120;
845
850
  }, 0);
846
- var scrollProps = !helper.isEmpty2(expandedRowRender) ? {
847
- expandedRowRender: expandedRowRender
848
- } : {
849
- scroll: {
850
- x: _someInstanceProperty(cols).call(cols, function (item) {
851
- return !helper.isEmpty2(item.fixed);
852
- }) ? widthX : true,
853
- y: maxHeight
854
- }
855
- };
851
+ var scrollProps = {};
852
+ if (expandedRowRenderKeepScroll) {
853
+ //拥有expandedRowRender时候保持scroll属性
854
+ scrollProps = {
855
+ expandedRowRender: expandedRowRender,
856
+ scroll: {
857
+ x: _someInstanceProperty(cols).call(cols, function (item) {
858
+ return !helper.isEmpty2(item.fixed);
859
+ }) ? widthX : true,
860
+ y: maxHeight
861
+ }
862
+ };
863
+ } else {
864
+ scrollProps = !helper.isEmpty2(expandedRowRender) ? {
865
+ expandedRowRender: expandedRowRender
866
+ } : {
867
+ scroll: {
868
+ x: _someInstanceProperty(cols).call(cols, function (item) {
869
+ return !helper.isEmpty2(item.fixed);
870
+ }) ? widthX : true,
871
+ y: maxHeight
872
+ }
873
+ };
874
+ }
856
875
  var _this$getPropsByCheck = _this.getPropsByCheckbox2(items),
857
876
  onRowClick = _this$getPropsByCheck.onRowClick,
858
877
  extraProps = _objectWithoutProperties(_this$getPropsByCheck, _excluded);
@@ -879,9 +898,9 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
879
898
  onExpand: onExpand
880
899
  }, scrollProps);
881
900
  });
882
- _defineProperty(_this, "setScroll", function () {
901
+ _defineProperty(_assertThisInitialized(_this), "setScroll", function () {
883
902
  if (_this.props.maxHeight && _this.props.items.length) {
884
- var root = ReactDOM.findDOMNode(_this);
903
+ var root = ReactDOM.findDOMNode(_assertThisInitialized(_this));
885
904
  var container = root.getElementsByClassName('ant-table-body')[0];
886
905
  var header = root.getElementsByClassName('ant-table-thead')[0];
887
906
  fixed(container, header, _this.props.maxHeight);
@@ -889,8 +908,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
889
908
  });
890
909
  return _this;
891
910
  }
892
- _inherits(SuperTable2, _React$Component);
893
- return _createClass(SuperTable2, [{
911
+ _createClass(SuperTable2, [{
894
912
  key: "componentDidMount",
895
913
  value: function componentDidMount() {
896
914
  this.setScroll();
@@ -909,6 +927,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
909
927
  }));
910
928
  }
911
929
  }]);
930
+ return SuperTable2;
912
931
  }(React.Component);
913
932
  _defineProperty(SuperTable2, "propTypes", {
914
933
  cols: PropTypes.arrayOf(PropTypes.shape(ColType)).isRequired,