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
@@ -40,9 +40,10 @@ var _checkbox = _interopRequireDefault(require("antd/lib/checkbox"));
40
40
  var _icon = _interopRequireDefault(require("antd/lib/icon"));
41
41
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck"));
42
42
  var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass"));
43
+ var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/assertThisInitialized"));
44
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
43
45
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/possibleConstructorReturn"));
44
46
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/getPrototypeOf"));
45
- var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
46
47
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
47
48
  var _radio = _interopRequireDefault(require("antd/lib/radio"));
48
49
  var _react = _interopRequireDefault(require("react"));
@@ -56,14 +57,15 @@ var _variables = _interopRequireDefault(require("../variables"));
56
57
  var _helper = _interopRequireWildcard(require("../helper"));
57
58
  var _DragSortRow = _interopRequireDefault(require("../SuperTable/DragSortRow"));
58
59
  var _excluded = ["onRowClick"];
59
- function _interopRequireWildcard(e, t) { if ("function" == typeof _WeakMap) var r = new _WeakMap(), n = new _WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = _Object$defineProperty) && _Object$getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
60
- function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof _Symbol && _getIteratorMethod(r) || r["@@iterator"]; if (!t) { if (_Array$isArray2(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; } } }; }
61
- 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; } }
62
- 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; }
60
+ function _getRequireWildcardCache(e) { if ("function" != typeof _WeakMap) return null; var r = new _WeakMap(), t = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
61
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? _Object$getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? _Object$defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
62
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"]; if (!it) { if (_Array$isArray2(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; } } }; }
63
+ 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); }
64
+ 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; }
63
65
  function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty2(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
64
- 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) { (0, _defineProperty2["default"])(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; }
65
- function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
66
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
66
+ 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) { (0, _defineProperty2["default"])(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; }
67
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
68
+ 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; } }
67
69
  var RadioGroup = _radio["default"].Group;
68
70
  var TypeEnum = ['readonly', 'index', 'checkbox', 'text', 'number', 'select',
69
71
  //存储value
@@ -137,6 +139,8 @@ var CallbackType = {
137
139
  * isEmphasized: [可选],是否强调,行字体加粗显示, 除了isEmphasized设置为true之外,加粗行数据里要设置__isEmphasized为true
138
140
  */
139
141
  var SuperTable2 = /*#__PURE__*/function (_React$Component) {
142
+ (0, _inherits2["default"])(SuperTable2, _React$Component);
143
+ var _super = _createSuper(SuperTable2);
140
144
  function SuperTable2() {
141
145
  var _context;
142
146
  var _this;
@@ -144,22 +148,22 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
144
148
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
145
149
  args[_key] = arguments[_key];
146
150
  }
147
- _this = _callSuper(this, SuperTable2, (0, _concat["default"])(_context = []).call(_context, args));
148
- (0, _defineProperty2["default"])(_this, "onSwitch", function (key, rowIndex) {
151
+ _this = _super.call.apply(_super, (0, _concat["default"])(_context = [this]).call(_context, args));
152
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onSwitch", function (key, rowIndex) {
149
153
  return function (value) {
150
154
  var _ref = _this.props.callback || {},
151
155
  onContentChange = _ref.onContentChange;
152
156
  onContentChange && onContentChange(_this.getIndex(rowIndex), key, value);
153
157
  };
154
158
  });
155
- (0, _defineProperty2["default"])(_this, "onCheck", function (key, rowIndex) {
159
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onCheck", function (key, rowIndex) {
156
160
  return function (e) {
157
161
  var _ref2 = _this.props.callback || {},
158
162
  onCheck = _ref2.onCheck;
159
163
  onCheck && onCheck(_this.getIndex(rowIndex), key, e.target.checked);
160
164
  };
161
165
  });
162
- (0, _defineProperty2["default"])(_this, "onChange", function (key, rowIndex) {
166
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onChange", function (key, rowIndex) {
163
167
  return function (value) {
164
168
  var _ref3 = _this.props.callback || {},
165
169
  onContentChange = _ref3.onContentChange;
@@ -167,7 +171,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
167
171
  onContentChange && onContentChange(_this.getIndex(rowIndex), key, value);
168
172
  };
169
173
  });
170
- (0, _defineProperty2["default"])(_this, "onDoubleChange1", function (key, rowIndex) {
174
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onDoubleChange1", function (key, rowIndex) {
171
175
  return function (doublekey, value) {
172
176
  var _ref4 = _this.props.callback || {},
173
177
  onContentChange = _ref4.onContentChange;
@@ -175,28 +179,28 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
175
179
  onContentChange && onContentChange(_this.getIndex(rowIndex), doublekey, value);
176
180
  };
177
181
  });
178
- (0, _defineProperty2["default"])(_this, "onSearch", function (key, rowIndex, config) {
182
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onSearch", function (key, rowIndex, config) {
179
183
  return function (value) {
180
184
  var _ref5 = _this.props.callback || {},
181
185
  onSearch = _ref5.onSearch;
182
186
  onSearch && onSearch(_this.getIndex(rowIndex), key, value, config);
183
187
  };
184
188
  });
185
- (0, _defineProperty2["default"])(_this, "onAdd", function (key) {
189
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onAdd", function (key) {
186
190
  return function () {
187
191
  var _ref6 = _this.props.callback || {},
188
192
  onAdd = _ref6.onAdd;
189
193
  onAdd && onAdd(key);
190
194
  };
191
195
  });
192
- (0, _defineProperty2["default"])(_this, "onRowAdd", function (key, index) {
196
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onRowAdd", function (key, index) {
193
197
  return function () {
194
198
  var _ref7 = _this.props.callback || {},
195
199
  onLink = _ref7.onLink;
196
200
  onLink && onLink(key, index, _this.props.items[index]);
197
201
  };
198
202
  });
199
- (0, _defineProperty2["default"])(_this, "onBlur", function (key, rowIndex) {
203
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onBlur", function (key, rowIndex) {
200
204
  return function (value) {
201
205
  var _ref8 = _this.props.callback || {},
202
206
  onBlur = _ref8.onBlur;
@@ -204,33 +208,33 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
204
208
  onBlur && onBlur(_this.getIndex(rowIndex), key, value);
205
209
  };
206
210
  });
207
- (0, _defineProperty2["default"])(_this, "onDoubleClick", function (key, value) {
211
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onDoubleClick", function (key, value) {
208
212
  return function () {
209
213
  var _ref9 = _this.props.callback || {},
210
214
  onDoubleClick = _ref9.onDoubleClick;
211
215
  onDoubleClick && onDoubleClick(key, value);
212
216
  };
213
217
  });
214
- (0, _defineProperty2["default"])(_this, "onImgTileClick", function (col, value, rowIndex) {
218
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onImgTileClick", function (col, value, rowIndex) {
215
219
  return function () {
216
- var _ref0 = _this.props.callback || {},
217
- onImgTileClick = _ref0.onImgTileClick;
220
+ var _ref10 = _this.props.callback || {},
221
+ onImgTileClick = _ref10.onImgTileClick;
218
222
  onImgTileClick && onImgTileClick(col, value, rowIndex);
219
223
  };
220
224
  });
221
- (0, _defineProperty2["default"])(_this, "onMoveRow", function (dragIndex, targetIndex) {
222
- var _ref1 = _this.props.callback || {},
223
- onMoveRow = _ref1.onMoveRow;
225
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onMoveRow", function (dragIndex, targetIndex) {
226
+ var _ref11 = _this.props.callback || {},
227
+ onMoveRow = _ref11.onMoveRow;
224
228
  onMoveRow && onMoveRow(dragIndex, targetIndex);
225
229
  });
226
- (0, _defineProperty2["default"])(_this, "closeValid", function () {
230
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "closeValid", function () {
227
231
  var _this$props = _this.props,
228
232
  valid = _this$props.valid,
229
233
  _this$props$callback = _this$props.callback,
230
234
  callback = _this$props$callback === void 0 ? {} : _this$props$callback;
231
235
  valid && callback.onExitValid();
232
236
  });
233
- (0, _defineProperty2["default"])(_this, "getOptions", function (key, colOptions, index) {
237
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getOptions", function (key, colOptions, index) {
234
238
  var options = _this.props.items[index].options;
235
239
  var options2 = _this.props.options;
236
240
  if (options && (0, _isArray["default"])(options[key])) {
@@ -241,7 +245,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
241
245
  return colOptions;
242
246
  }
243
247
  });
244
- (0, _defineProperty2["default"])(_this, "validField", function (required, value) {
248
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "validField", function (required, value) {
245
249
  if (!_this.props.valid || _this.error || !required || value) {
246
250
  return false;
247
251
  } else if (typeof value === 'number') {
@@ -251,15 +255,15 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
251
255
  return true;
252
256
  }
253
257
  });
254
- (0, _defineProperty2["default"])(_this, "toRadio", function (_ref10, index) {
255
- var value = _ref10.value,
256
- title = _ref10.title;
258
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toRadio", function (_ref12, index) {
259
+ var value = _ref12.value,
260
+ title = _ref12.title;
257
261
  return /*#__PURE__*/_react["default"].createElement(_radio["default"], {
258
262
  key: index,
259
263
  value: String(value)
260
264
  }, title);
261
265
  });
262
- (0, _defineProperty2["default"])(_this, "renderRadioGroup", function (config, value, index) {
266
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "renderRadioGroup", function (config, value, index) {
263
267
  var key = config.key,
264
268
  options = config.options;
265
269
  var radioGroupProps = {
@@ -270,7 +274,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
270
274
  };
271
275
  return /*#__PURE__*/_react["default"].createElement(RadioGroup, radioGroupProps, (0, _map["default"])(options).call(options, _this.toRadio));
272
276
  });
273
- (0, _defineProperty2["default"])(_this, "renderEditableCell", function (config, value, index) {
277
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "renderEditableCell", function (config, value, index) {
274
278
  var key = config.key,
275
279
  type = config.type,
276
280
  options = config.options,
@@ -362,7 +366,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
362
366
  }
363
367
  return /*#__PURE__*/_react["default"].createElement(_SuperTableCell["default"], cellProps);
364
368
  });
365
- (0, _defineProperty2["default"])(_this, "renderDoubleEditableCell", function (config, value, index) {
369
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "renderDoubleEditableCell", function (config, value, index) {
366
370
  var key = config.key,
367
371
  type = config.type,
368
372
  options = config.options,
@@ -392,7 +396,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
392
396
  };
393
397
  return /*#__PURE__*/_react["default"].createElement(_SuperTableCell["default"], cellProps);
394
398
  });
395
- (0, _defineProperty2["default"])(_this, "renderLinkCell", function (col, value, record, index) {
399
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "renderLinkCell", function (col, value, record, index) {
396
400
  if (col.link === 'list') {
397
401
  var list = value && (0, _isArray["default"])(value) ? value : [];
398
402
  return /*#__PURE__*/_react["default"].createElement("div", {
@@ -403,8 +407,8 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
403
407
  var _context2;
404
408
  var split = index2 === list.length - 1 ? '' : ',';
405
409
  var onClick = function onClick() {
406
- var _ref11 = _this.props.callback || {},
407
- onLink = _ref11.onLink;
410
+ var _ref13 = _this.props.callback || {},
411
+ onLink = _ref13.onLink;
408
412
  onLink && onLink(col.key, index, item2);
409
413
  };
410
414
  return /*#__PURE__*/_react["default"].createElement("a", {
@@ -415,8 +419,8 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
415
419
  } else {
416
420
  var title = typeof col.link === 'string' ? col.link : value;
417
421
  var onClick = function onClick() {
418
- var _ref12 = _this.props.callback || {},
419
- onLink = _ref12.onLink;
422
+ var _ref14 = _this.props.callback || {},
423
+ onLink = _ref14.onLink;
420
424
  onLink && onLink(col.key, index, record);
421
425
  };
422
426
  return /*#__PURE__*/_react["default"].createElement("a", {
@@ -428,12 +432,12 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
428
432
  }, title);
429
433
  }
430
434
  });
431
- (0, _defineProperty2["default"])(_this, "getIndex", function (index) {
435
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getIndex", function (index) {
432
436
  return (_this.props.base || 0) + index;
433
437
  });
434
- (0, _defineProperty2["default"])(_this, "getCellRender", function (col) {
438
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getCellRender", function (col) {
435
439
  return function (value, record, index) {
436
- var _context3, _context4, _context5, _context6, _context7, _context8, _context9, _context0;
440
+ var _context3, _context4, _context5, _context6, _context7, _context8, _context9, _context10;
437
441
  var realType = record._isEdit === true && _this.canReadonly(col.type) ? col.editType : col.type;
438
442
  if (realType === 'customType') {
439
443
  var _this$props$items$rec = _this.props.items[record.key].__customType,
@@ -558,7 +562,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
558
562
  case 'uploadImg':
559
563
  var commonProps = _this.props.callback.buildSuperUploadProps ? _this.props.callback.buildSuperUploadProps() : {};
560
564
  var uploadProps = _objectSpread(_objectSpread(_objectSpread(_objectSpread({
561
- onFileChange: _this.props.callback.onTableFileChange ? (0, _bind["default"])(_context0 = _this.props.callback.onTableFileChange).call(_context0, null, col.key, index) : undefined,
565
+ onFileChange: _this.props.callback.onTableFileChange ? (0, _bind["default"])(_context10 = _this.props.callback.onTableFileChange).call(_context10, null, col.key, index) : undefined,
562
566
  type: col.type
563
567
  }, col.props), _this.props), commonProps), {}, {
564
568
  value: _this.props.items[index][col.key]
@@ -575,7 +579,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
575
579
  }
576
580
  };
577
581
  });
578
- (0, _defineProperty2["default"])(_this, "getCheckedStatus", function (key) {
582
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getCheckedStatus", function (key) {
579
583
  var has = false,
580
584
  not = false;
581
585
  var items = _this.props.items;
@@ -596,7 +600,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
596
600
  indeterminate: has && not
597
601
  };
598
602
  });
599
- (0, _defineProperty2["default"])(_this, "toAdd", function (key, showAdd) {
603
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toAdd", function (key, showAdd) {
600
604
  if (showAdd) {
601
605
  var onClick = _this.onAdd(key);
602
606
  return /*#__PURE__*/_react["default"].createElement(_icon["default"], {
@@ -608,12 +612,12 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
608
612
  return null;
609
613
  }
610
614
  });
611
- (0, _defineProperty2["default"])(_this, "getColumnTitle", function (_ref14) {
612
- var required = _ref14.required,
613
- title = _ref14.title,
614
- type = _ref14.type,
615
- key = _ref14.key,
616
- showAdd = _ref14.showAdd;
615
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getColumnTitle", function (_ref16) {
616
+ var required = _ref16.required,
617
+ title = _ref16.title,
618
+ type = _ref16.type,
619
+ key = _ref16.key,
620
+ showAdd = _ref16.showAdd;
617
621
  if (type === 'checkbox') {
618
622
  var status = _this.getCheckedStatus(key);
619
623
  return /*#__PURE__*/_react["default"].createElement(_checkbox["default"], (0, _extends2["default"])({
@@ -626,31 +630,31 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
626
630
  }, title, _this.toAdd(key, showAdd));
627
631
  }
628
632
  });
629
- (0, _defineProperty2["default"])(_this, "getColumnClassName", function (_ref15) {
630
- var type = _ref15.type,
631
- align = _ref15.align;
633
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getColumnClassName", function (_ref17) {
634
+ var type = _ref17.type,
635
+ align = _ref17.align;
632
636
  if (type === 'index' || type === 'checkbox') {
633
637
  return 'ant-table-selection-column';
634
638
  } else {
635
639
  return align ? (0, _variables["default"])('SuperTable2')[align] : '';
636
640
  }
637
641
  });
638
- (0, _defineProperty2["default"])(_this, "canReadonly", function (type) {
639
- var _context1;
640
- return !(0, _includes["default"])(_context1 = ['index', 'checkbox', 'link', 'button', 'switch', 'custom', 'img', 'toolbar', 'uploadImg', 'double']).call(_context1, type);
642
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "canReadonly", function (type) {
643
+ var _context11;
644
+ return !(0, _includes["default"])(_context11 = ['index', 'checkbox', 'link', 'button', 'switch', 'custom', 'img', 'toolbar', 'uploadImg', 'double']).call(_context11, type);
641
645
  });
642
- (0, _defineProperty2["default"])(_this, "getColumns", function (cols) {
643
- var _context10;
646
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getColumns", function (cols) {
647
+ var _context12;
644
648
  var readonly = _this.props.readonly;
645
- return (0, _map["default"])(_context10 = (0, _filter["default"])(cols).call(cols, function (col) {
649
+ return (0, _map["default"])(_context12 = (0, _filter["default"])(cols).call(cols, function (col) {
646
650
  return !col.hide;
647
- })).call(_context10, function (_ref16, index) {
648
- var _context11;
649
- var col = (0, _extends2["default"])({}, ((0, _objectDestructuringEmpty2["default"])(_ref16), _ref16));
651
+ })).call(_context12, function (_ref18, index) {
652
+ var _context13;
653
+ var col = (0, _extends2["default"])({}, ((0, _objectDestructuringEmpty2["default"])(_ref18), _ref18));
650
654
  col.className = _this.getColumnClassName(col);
651
655
  col.title = _this.getColumnTitle(col);
652
656
  col.dataIndex = col.key;
653
- col.width = col.width ? col.width : (0, _includes["default"])(_context11 = ['index', 'checked']).call(_context11, col.key) ? 70 : col.type === 'img' ? 200 : 120;
657
+ col.width = col.width ? col.width : (0, _includes["default"])(_context13 = ['index', 'checked']).call(_context13, col.key) ? 70 : col.type === 'img' ? 200 : 120;
654
658
  // const {props = {}} =
655
659
  // const {edit = false} = props
656
660
  // if (!(readonly || col.type === 'readonly') || !this.canReadonly(col.type)) {
@@ -676,7 +680,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
676
680
  return col;
677
681
  });
678
682
  });
679
- (0, _defineProperty2["default"])(_this, "getText", function (value, options) {
683
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getText", function (value, options) {
680
684
  if ((0, _isArray["default"])(value)) {
681
685
  return (0, _map["default"])(value).call(value, function (v) {
682
686
  return (0, _Control.getTitle)(v, options);
@@ -685,14 +689,14 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
685
689
  return (0, _Control.getTitle)(value, options);
686
690
  }
687
691
  });
688
- (0, _defineProperty2["default"])(_this, "getDataSource", function (items, cols) {
692
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getDataSource", function (items, cols) {
689
693
  return (0, _map["default"])(items).call(items, function (item, index) {
690
- return (0, _reduce["default"])(cols).call(cols, function (result, _ref17) {
691
- var _context12, _context13;
692
- var key = _ref17.key,
693
- type = _ref17.type,
694
- options = _ref17.options;
695
- if (!_this.props.readonly && type && type !== 'readonly' && (!item.isReadonly || (0, _isArray["default"])(item.isReadonly) && !(0, _includes["default"])(_context12 = item.isReadonly).call(_context12, key)) || (0, _includes["default"])(_context13 = ['img', 'switch', 'custom', 'img', 'toolbar', 'uploadImg']).call(_context13, type)) {
694
+ return (0, _reduce["default"])(cols).call(cols, function (result, _ref19) {
695
+ var _context14, _context15;
696
+ var key = _ref19.key,
697
+ type = _ref19.type,
698
+ options = _ref19.options;
699
+ if (!_this.props.readonly && type && type !== 'readonly' && (!item.isReadonly || (0, _isArray["default"])(item.isReadonly) && !(0, _includes["default"])(_context14 = item.isReadonly).call(_context14, key)) || (0, _includes["default"])(_context15 = ['img', 'switch', 'custom', 'img', 'toolbar', 'uploadImg']).call(_context15, type)) {
696
700
  result[key] = item[key];
697
701
  } else {
698
702
  result[key] = _this.getText(item[key], options);
@@ -704,7 +708,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
704
708
  }));
705
709
  });
706
710
  });
707
- (0, _defineProperty2["default"])(_this, "getPropsByCheckbox", function () {
711
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getPropsByCheckbox", function () {
708
712
  var _this$props2 = _this.props,
709
713
  items = _this$props2.items,
710
714
  _this$props2$isEmphas = _this$props2.isEmphasized,
@@ -719,13 +723,13 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
719
723
  rowClassName: rowClassName
720
724
  };
721
725
  });
722
- (0, _defineProperty2["default"])(_this, "getSelectedRowKeys", function (items) {
726
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getSelectedRowKeys", function (items) {
723
727
  return (0, _reduce["default"])(items).call(items, function (result, item, index) {
724
728
  item.checked && result.push(index);
725
729
  return result;
726
730
  }, []);
727
731
  });
728
- (0, _defineProperty2["default"])(_this, "getPropsByCheckbox2", function (items) {
732
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getPropsByCheckbox2", function (items) {
729
733
  var _this$props3 = _this.props,
730
734
  _this$props3$checkbox = _this$props3.checkbox,
731
735
  checkbox = _this$props3$checkbox === void 0 ? true : _this$props3$checkbox,
@@ -810,7 +814,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
810
814
  };
811
815
  }
812
816
  });
813
- (0, _defineProperty2["default"])(_this, "getRowPropsForDrag", function () {
817
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getRowPropsForDrag", function () {
814
818
  return function (record, index) {
815
819
  return {
816
820
  index: index,
@@ -818,7 +822,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
818
822
  };
819
823
  };
820
824
  });
821
- (0, _defineProperty2["default"])(_this, "getRowProps", function (onRowClick) {
825
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getRowProps", function (onRowClick) {
822
826
  return function (record) {
823
827
  return {
824
828
  onClick: function onClick() {
@@ -830,8 +834,8 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
830
834
  };
831
835
  };
832
836
  });
833
- (0, _defineProperty2["default"])(_this, "getProps", function () {
834
- var _context14;
837
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getProps", function () {
838
+ var _context16;
835
839
  var _this$props4 = _this.props,
836
840
  cols = _this$props4.cols,
837
841
  items = _this$props4.items,
@@ -848,23 +852,39 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
848
852
  _this$props4$expanded = _this$props4.expandedRowRender,
849
853
  expandedRowRender = _this$props4$expanded === void 0 ? undefined : _this$props4$expanded,
850
854
  _this$props4$onExpand = _this$props4.onExpand,
851
- onExpand = _this$props4$onExpand === void 0 ? undefined : _this$props4$onExpand;
852
- var widthX = (0, _reduce["default"])(_context14 = (0, _filter["default"])(cols).call(cols, function (col) {
855
+ onExpand = _this$props4$onExpand === void 0 ? undefined : _this$props4$onExpand,
856
+ _this$props4$expanded2 = _this$props4.expandedRowRenderKeepScroll,
857
+ expandedRowRenderKeepScroll = _this$props4$expanded2 === void 0 ? false : _this$props4$expanded2;
858
+ var widthX = (0, _reduce["default"])(_context16 = (0, _filter["default"])(cols).call(cols, function (col) {
853
859
  return !col.hide;
854
- })).call(_context14, function (width, item) {
855
- var _context15;
856
- return width += item.width ? item.width : (0, _includes["default"])(_context15 = ['index', 'checked']).call(_context15, item.key) ? 70 : item.type === 'img' ? 200 : 120;
860
+ })).call(_context16, function (width, item) {
861
+ var _context17;
862
+ return width += item.width ? item.width : (0, _includes["default"])(_context17 = ['index', 'checked']).call(_context17, item.key) ? 70 : item.type === 'img' ? 200 : 120;
857
863
  }, 0);
858
- var scrollProps = !_helper["default"].isEmpty2(expandedRowRender) ? {
859
- expandedRowRender: expandedRowRender
860
- } : {
861
- scroll: {
862
- x: (0, _some["default"])(cols).call(cols, function (item) {
863
- return !_helper["default"].isEmpty2(item.fixed);
864
- }) ? widthX : true,
865
- y: maxHeight
866
- }
867
- };
864
+ var scrollProps = {};
865
+ if (expandedRowRenderKeepScroll) {
866
+ //拥有expandedRowRender时候保持scroll属性
867
+ scrollProps = {
868
+ expandedRowRender: expandedRowRender,
869
+ scroll: {
870
+ x: (0, _some["default"])(cols).call(cols, function (item) {
871
+ return !_helper["default"].isEmpty2(item.fixed);
872
+ }) ? widthX : true,
873
+ y: maxHeight
874
+ }
875
+ };
876
+ } else {
877
+ scrollProps = !_helper["default"].isEmpty2(expandedRowRender) ? {
878
+ expandedRowRender: expandedRowRender
879
+ } : {
880
+ scroll: {
881
+ x: (0, _some["default"])(cols).call(cols, function (item) {
882
+ return !_helper["default"].isEmpty2(item.fixed);
883
+ }) ? widthX : true,
884
+ y: maxHeight
885
+ }
886
+ };
887
+ }
868
888
  var _this$getPropsByCheck = _this.getPropsByCheckbox2(items),
869
889
  onRowClick = _this$getPropsByCheck.onRowClick,
870
890
  extraProps = (0, _objectWithoutProperties2["default"])(_this$getPropsByCheck, _excluded);
@@ -891,9 +911,9 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
891
911
  onExpand: onExpand
892
912
  }, scrollProps);
893
913
  });
894
- (0, _defineProperty2["default"])(_this, "setScroll", function () {
914
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "setScroll", function () {
895
915
  if (_this.props.maxHeight && _this.props.items.length) {
896
- var root = _reactDom["default"].findDOMNode(_this);
916
+ var root = _reactDom["default"].findDOMNode((0, _assertThisInitialized2["default"])(_this));
897
917
  var container = root.getElementsByClassName('ant-table-body')[0];
898
918
  var header = root.getElementsByClassName('ant-table-thead')[0];
899
919
  (0, _fixed["default"])(container, header, _this.props.maxHeight);
@@ -901,8 +921,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
901
921
  });
902
922
  return _this;
903
923
  }
904
- (0, _inherits2["default"])(SuperTable2, _React$Component);
905
- return (0, _createClass2["default"])(SuperTable2, [{
924
+ (0, _createClass2["default"])(SuperTable2, [{
906
925
  key: "componentDidMount",
907
926
  value: function componentDidMount() {
908
927
  this.setScroll();
@@ -921,6 +940,7 @@ var SuperTable2 = /*#__PURE__*/function (_React$Component) {
921
940
  }));
922
941
  }
923
942
  }]);
943
+ return SuperTable2;
924
944
  }(_react["default"].Component);
925
945
  (0, _defineProperty2["default"])(SuperTable2, "propTypes", {
926
946
  cols: _propTypes["default"].arrayOf(_propTypes["default"].shape(ColType)).isRequired,