shineout 1.8.2 → 1.8.7-beta.1

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 (58) hide show
  1. package/css/AnimationList/AbsoluteList.js +1 -1
  2. package/css/Button/Button.js +1 -1
  3. package/css/Form/Field.js +11 -6
  4. package/css/Menu/Item.js +9 -1
  5. package/css/Scroll/Scroll.js +31 -11
  6. package/css/Select/Input.js +16 -3
  7. package/css/Table/SeperateTable.js +44 -48
  8. package/css/Table/SimpleTable.js +13 -7
  9. package/css/Table/Table.js +3 -1
  10. package/css/Table/TreeExpand.js +3 -2
  11. package/css/Table/index.d.ts +9 -0
  12. package/css/Table/index.js +1 -1
  13. package/css/Table/resizable.js +1 -1
  14. package/css/Table/styles/table.css +8 -8
  15. package/css/index.d.ts +1 -1
  16. package/css/index.js +1 -1
  17. package/dist/shineout.js +167 -112
  18. package/dist/shineout.js.map +1 -1
  19. package/dist/shineout.min.js +1 -1
  20. package/dist/theme.antd.css +1 -1
  21. package/dist/theme.antd2.css +1 -1
  22. package/dist/theme.default.css +1 -1
  23. package/dist/theme.shineout.css +1 -1
  24. package/es/AnimationList/AbsoluteList.js +1 -1
  25. package/es/Button/Button.js +1 -1
  26. package/es/Form/Field.js +11 -6
  27. package/es/Menu/Item.js +9 -1
  28. package/es/Scroll/Scroll.js +31 -11
  29. package/es/Select/Input.js +16 -3
  30. package/es/Table/SeperateTable.js +44 -48
  31. package/es/Table/SimpleTable.js +13 -7
  32. package/es/Table/Table.js +3 -1
  33. package/es/Table/TreeExpand.js +3 -2
  34. package/es/Table/index.d.ts +9 -0
  35. package/es/Table/index.js +1 -1
  36. package/es/Table/resizable.js +1 -1
  37. package/es/Table/styles/table.less +1 -1
  38. package/es/index.d.ts +1 -1
  39. package/es/index.js +1 -1
  40. package/es/styles/themes/shineout.less +1 -1
  41. package/lib/AnimationList/AbsoluteList.js +1 -1
  42. package/lib/Button/Button.js +1 -1
  43. package/lib/Form/Field.js +11 -6
  44. package/lib/Menu/Item.js +9 -1
  45. package/lib/Scroll/Scroll.js +31 -11
  46. package/lib/Select/Input.js +16 -3
  47. package/lib/Table/SeperateTable.js +44 -48
  48. package/lib/Table/SimpleTable.js +13 -7
  49. package/lib/Table/Table.js +3 -1
  50. package/lib/Table/TreeExpand.js +3 -2
  51. package/lib/Table/index.d.ts +9 -0
  52. package/lib/Table/index.js +1 -1
  53. package/lib/Table/resizable.js +1 -1
  54. package/lib/Table/styles/table.less +1 -1
  55. package/lib/index.d.ts +1 -1
  56. package/lib/index.js +1 -1
  57. package/lib/styles/themes/shineout.less +1 -1
  58. package/package.json +1 -1
@@ -115,8 +115,8 @@ function _default(List) {
115
115
  _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
116
116
  var _this2 = this;
117
117
 
118
- if ((0, _shallowEqual.default)(prevProps.value, this.props.value)) return;
119
118
  if (!this.props.focus) this.ajustdoc = false;
119
+ if ((0, _shallowEqual.default)(prevProps.value, this.props.value)) return;
120
120
  setTimeout(function () {
121
121
  _this2.forceUpdate();
122
122
  });
@@ -83,7 +83,7 @@ function (_PureComponent) {
83
83
  disabled: disabled
84
84
  }), this.props.className);
85
85
 
86
- if (href) {
86
+ if (href && !disabled) {
87
87
  return _react.default.createElement("a", (0, _extends2.default)({
88
88
  href: href
89
89
  }, others, {
package/css/Form/Field.js CHANGED
@@ -64,13 +64,18 @@ function (_Component) {
64
64
  });
65
65
  }
66
66
 
67
+ var cloneProps = {
68
+ value: value,
69
+ error: error,
70
+ onChange: this.handleChange
71
+ };
72
+
73
+ if (disabled !== undefined) {
74
+ cloneProps.disabled = disabled;
75
+ }
76
+
67
77
  if ((0, _react.isValidElement)(children)) {
68
- return (0, _react.cloneElement)(children, {
69
- value: value,
70
- error: error,
71
- onChange: this.handleChange,
72
- disabled: disabled
73
- });
78
+ return (0, _react.cloneElement)(children, cloneProps);
74
79
  }
75
80
 
76
81
  console.error(new Error('Form.Field expect a single ReactElement or a function.'));
package/css/Menu/Item.js CHANGED
@@ -57,7 +57,9 @@ function (_PureComponent) {
57
57
 
58
58
  var key = _this.getKey(props);
59
59
 
60
- var _props$bindItem = props.bindItem(_this.id, _this.update.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this))), _this.updateOpen.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this))), _this.updateInPath.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)))),
60
+ var noop = function noop() {};
61
+
62
+ var _props$bindItem = props.bindItem(_this.id, noop, noop, noop),
61
63
  activeUpdate = _props$bindItem[0],
62
64
  openUpdate = _props$bindItem[1],
63
65
  inPathUpdate = _props$bindItem[2];
@@ -79,6 +81,12 @@ function (_PureComponent) {
79
81
 
80
82
  var _proto = Item.prototype;
81
83
 
84
+ _proto.componentDidMount = function componentDidMount() {
85
+ _PureComponent.prototype.componentDidMount.call(this);
86
+
87
+ this.props.bindItem(this.id, this.update.bind(this), this.updateOpen.bind(this), this.updateInPath.bind(this));
88
+ };
89
+
82
90
  _proto.componentWillUnmount = function componentWillUnmount() {
83
91
  _PureComponent.prototype.componentWillUnmount.call(this);
84
92
 
@@ -67,6 +67,7 @@ function (_PureComponent) {
67
67
  _this.handleTouchStart = _this.handleTouchStart.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
68
68
  _this.handleTouchMove = _this.handleTouchMove.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
69
69
  _this.setStartPoint = _this.setStartPoint.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
70
+ _this.handleInnerScroll = _this.handleInnerScroll.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
70
71
  return _this;
71
72
  }
72
73
 
@@ -85,6 +86,7 @@ function (_PureComponent) {
85
86
  this.wheelElement.addEventListener('touchmove', this.handleTouchMove, {
86
87
  passive: false
87
88
  });
89
+ this.inner.addEventListener('scroll', this.handleInnerScroll);
88
90
  };
89
91
 
90
92
  _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
@@ -101,6 +103,7 @@ function (_PureComponent) {
101
103
  this.wheelElement.removeEventListener('wheel', this.handleWheel);
102
104
  this.wheelElement.removeEventListener('touchstart', this.handleTouchStart);
103
105
  this.wheelElement.removeEventListener('touchmove', this.handleTouchMove);
106
+ this.inner.removeEventListener('scroll', this.handleInnerScroll);
104
107
  };
105
108
 
106
109
  _proto.getWheelRect = function getWheelRect() {
@@ -280,22 +283,39 @@ function (_PureComponent) {
280
283
 
281
284
  this.setStartPoint(position);
282
285
  this.boundleScroll();
283
- };
286
+ } // inner scroll
287
+ ;
284
288
 
285
- _proto.render = function render() {
289
+ _proto.handleInnerScroll = function handleInnerScroll(e) {
290
+ var target = e.target;
286
291
  var _this$props6 = this.props,
287
- children = _this$props6.children,
288
- scrollWidth = _this$props6.scrollWidth,
289
- scrollHeight = _this$props6.scrollHeight,
290
292
  left = _this$props6.left,
291
- top = _this$props6.top,
292
- scrollX = _this$props6.scrollX,
293
- scrollY = _this$props6.scrollY,
294
- style = _this$props6.style;
293
+ scrollWidth = _this$props6.scrollWidth;
295
294
 
296
295
  var _this$getWheelRect2 = this.getWheelRect(),
297
- width = _this$getWheelRect2.width,
298
- height = _this$getWheelRect2.height;
296
+ width = _this$getWheelRect2.width;
297
+
298
+ if (target.scrollLeft) {
299
+ this.handleScroll(left + target.scrollLeft / (scrollWidth - width), this.props.top, undefined, 0);
300
+ target.scrollLeft = 0;
301
+ target.scrollTop = 0;
302
+ }
303
+ };
304
+
305
+ _proto.render = function render() {
306
+ var _this$props7 = this.props,
307
+ children = _this$props7.children,
308
+ scrollWidth = _this$props7.scrollWidth,
309
+ scrollHeight = _this$props7.scrollHeight,
310
+ left = _this$props7.left,
311
+ top = _this$props7.top,
312
+ scrollX = _this$props7.scrollX,
313
+ scrollY = _this$props7.scrollY,
314
+ style = _this$props7.style;
315
+
316
+ var _this$getWheelRect3 = this.getWheelRect(),
317
+ width = _this$getWheelRect3.width,
318
+ height = _this$getWheelRect3.height;
299
319
 
300
320
  var rtl = (0, _config.isRTL)();
301
321
  var className = (0, _classnames.default)((0, _styles.scrollClass)('_', scrollX && 'show-x', scrollY && 'show-y', rtl && 'rtl'), this.props.className);
@@ -46,7 +46,9 @@ function (_Component) {
46
46
  _this.handleBlur = _this.handleBlur.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
47
47
  _this.geHandleMax = _this.geHandleMax.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
48
48
  _this.handlePaste = _this.handlePaste.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
49
- _this.focusInput = _this.focusInput.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this))); // for mutiple select
49
+ _this.focusInput = _this.focusInput.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
50
+ _this.handleCompositionStart = _this.handleCompositionStart.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
51
+ _this.handleCompositionEnd = _this.handleCompositionEnd.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this))); // for mutiple select
50
52
 
51
53
  _this.props.setInputReset(_this.reset.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)))); // set focus func to Select
52
54
 
@@ -98,7 +100,7 @@ function (_Component) {
98
100
  _proto.geHandleMax = function geHandleMax(e) {
99
101
  var maxLength = this.props.maxLength;
100
102
 
101
- if (!maxLength) {
103
+ if (!maxLength || this.composition) {
102
104
  return true;
103
105
  }
104
106
 
@@ -219,6 +221,15 @@ function (_Component) {
219
221
  this.props.onInputBlur(text);
220
222
  };
221
223
 
224
+ _proto.handleCompositionStart = function handleCompositionStart() {
225
+ this.composition = true;
226
+ };
227
+
228
+ _proto.handleCompositionEnd = function handleCompositionEnd(e) {
229
+ this.composition = false;
230
+ this.handleInput(e);
231
+ };
232
+
222
233
  _proto.render = function render() {
223
234
  var _this$props = this.props,
224
235
  text = _this$props.text,
@@ -233,7 +244,9 @@ function (_Component) {
233
244
  contentEditable: focus || this.state.editable,
234
245
  onFocus: handleFocus,
235
246
  onBlur: this.handleBlur,
236
- title: !focus && (0, _is.isString)(value) ? value : null
247
+ title: !focus && (0, _is.isString)(value) ? value : null,
248
+ onCompositionStart: this.handleCompositionStart,
249
+ onCompositionEnd: this.handleCompositionEnd
237
250
  };
238
251
 
239
252
  if ((0, _react.isValidElement)(value)) {
@@ -225,6 +225,22 @@ function (_PureComponent) {
225
225
 
226
226
  };
227
227
 
228
+ _proto.setTop = function setTop(scrollHeight, fullHeight, top) {
229
+ var _this2 = this;
230
+
231
+ var offsetLeft = this.state.offsetLeft;
232
+ this.tbody.style.marginTop = scrollHeight * top + "px";
233
+ this.lastScrollTop = fullHeight * top;
234
+ (0, _translate.setTranslate)(this.tbody, "-" + offsetLeft + "px", "-" + this.lastScrollTop + "px");
235
+ setTimeout(function () {
236
+ _this2.setState({
237
+ scrollTop: top
238
+ });
239
+
240
+ _this2.lastScrollArgs[1] = top;
241
+ });
242
+ };
243
+
228
244
  _proto.checkScrollToIndex = function checkScrollToIndex(index, outerHeight) {
229
245
  var _this$props3 = this.props,
230
246
  data = _this$props3.data,
@@ -245,7 +261,7 @@ function (_PureComponent) {
245
261
  };
246
262
 
247
263
  _proto.ajustBottom = function ajustBottom(dataChange) {
248
- var _this2 = this;
264
+ var _this3 = this;
249
265
 
250
266
  var reachBottom = this.lastScrollArgs[1] === 1;
251
267
  var drag = this.lastScrollArgs[8];
@@ -254,7 +270,7 @@ function (_PureComponent) {
254
270
  if (this.ajustBottomScroll) return;
255
271
  this.ajustBottomScroll = true;
256
272
  setTimeout(function () {
257
- _this2.handleScroll.apply(_this2, _this2.lastScrollArgs);
273
+ _this3.handleScroll.apply(_this3, _this3.lastScrollArgs);
258
274
  });
259
275
  }
260
276
  };
@@ -314,11 +330,9 @@ function (_PureComponent) {
314
330
  };
315
331
 
316
332
  _proto.resetHeight = function resetHeight() {
317
- var _this3 = this;
333
+ var _this4 = this;
318
334
 
319
- var _this$state2 = this.state,
320
- scrollTop = _this$state2.scrollTop,
321
- offsetLeft = _this$state2.offsetLeft;
335
+ var scrollTop = this.state.scrollTop;
322
336
  var _this$props4 = this.props,
323
337
  treeColumnsName = _this$props4.treeColumnsName,
324
338
  changedByExpand = _this$props4.changedByExpand;
@@ -349,32 +363,16 @@ function (_PureComponent) {
349
363
  if (fullHeight <= scrollHeight) {
350
364
  index = 0;
351
365
  } else {
352
- this.tbody.style.marginTop = scrollHeight + "px";
353
- (0, _translate.setTranslate)(this.tbody, "-" + offsetLeft + "px", "-" + fullHeight + "px");
354
- this.lastScrollTop = fullHeight;
366
+ this.setTop(scrollHeight, fullHeight, 1);
355
367
  return;
356
368
  }
357
369
  }
358
370
  }
359
371
 
360
372
  if (index === 0) {
361
- this.lastScrollTop = 0;
362
- setTimeout(function () {
363
- _this3.setState({
364
- scrollTop: 0
365
- });
366
- });
367
- this.tbody.style.marginTop = '0px';
368
- (0, _translate.setTranslate)(this.tbody, "-" + offsetLeft + "px", '0px');
373
+ this.setTop(scrollHeight, fullHeight, 0);
369
374
  } else if (fullHeight - this.lastScrollTop < (1 - this.lastScrollArgs[1]) * scrollHeight) {
370
- this.tbody.style.marginTop = scrollHeight + "px";
371
- (0, _translate.setTranslate)(this.tbody, "-" + offsetLeft + "px", "-" + fullHeight + "px");
372
- this.lastScrollTop = fullHeight;
373
- setTimeout(function () {
374
- _this3.setState({
375
- scrollTop: 1
376
- });
377
- });
375
+ this.setTop(scrollHeight, fullHeight, 1);
378
376
  } else {
379
377
  var keepTop = this.lastScrollTop - this.lastScrollArgs[1] * scrollHeight; // keepTop = scrollTopLength - scrollTopLength/fullHeight * scrollHeight
380
378
  // keepTop = (1 - scrollHeight / fullHeight) * scrollTopLength
@@ -382,18 +380,14 @@ function (_PureComponent) {
382
380
  var scrollTopLength = keepTop / (1 - scrollHeight / fullHeight);
383
381
  this.lastScrollTop = scrollTopLength;
384
382
  var st = this.lastScrollTop / fullHeight;
385
- this.tbody.style.marginTop = st * scrollHeight + "px";
386
- (0, _translate.setTranslate)(this.tbody, "-" + offsetLeft + "px", "-" + this.lastScrollTop + "px");
387
- setTimeout(function () {
388
- _this3.setState({
389
- scrollTop: st
390
- });
391
- });
383
+ this.setTop(scrollHeight, fullHeight, st);
392
384
  }
393
385
  } else if (this.lastScrollTop - height < 1) {
394
386
  setTimeout(function () {
395
- _this3.setState({
396
- scrollTop: _this3.lastScrollTop / fullHeight
387
+ _this4.lastScrollArgs[1] = _this4.lastScrollTop / fullHeight;
388
+
389
+ _this4.setState({
390
+ scrollTop: _this4.lastScrollTop / fullHeight
397
391
  });
398
392
  });
399
393
  }
@@ -635,15 +629,16 @@ function (_PureComponent) {
635
629
  rowHeight = _this$props7.rowHeight,
636
630
  columnResizable = _this$props7.columnResizable,
637
631
  innerScrollAttr = _this$props7.innerScrollAttr,
638
- others = (0, _objectWithoutPropertiesLoose2.default)(_this$props7, ["data", "rowsInView", "columns", "width", "fixed", "rowHeight", "columnResizable", "innerScrollAttr"]);
639
- var _this$state3 = this.state,
640
- colgroup = _this$state3.colgroup,
641
- scrollTop = _this$state3.scrollTop,
642
- scrollLeft = _this$state3.scrollLeft,
643
- offsetLeft = _this$state3.offsetLeft,
644
- offsetRight = _this$state3.offsetRight,
645
- currentIndex = _this$state3.currentIndex,
646
- resize = _this$state3.resize;
632
+ bordered = _this$props7.bordered,
633
+ others = (0, _objectWithoutPropertiesLoose2.default)(_this$props7, ["data", "rowsInView", "columns", "width", "fixed", "rowHeight", "columnResizable", "innerScrollAttr", "bordered"]);
634
+ var _this$state2 = this.state,
635
+ colgroup = _this$state2.colgroup,
636
+ scrollTop = _this$state2.scrollTop,
637
+ scrollLeft = _this$state2.scrollLeft,
638
+ offsetLeft = _this$state2.offsetLeft,
639
+ offsetRight = _this$state2.offsetRight,
640
+ currentIndex = _this$state2.currentIndex,
641
+ resize = _this$state2.resize;
647
642
  var contentWidth = this.getContentWidth();
648
643
  var minWidthSup = columns.find(function (d) {
649
644
  return d.minWidth;
@@ -681,7 +676,7 @@ function (_PureComponent) {
681
676
  height: prevHeight
682
677
  }
683
678
  }), _react.default.createElement("table", {
684
- className: (0, _styles.tableClass)(!colgroup && minWidthSup && 'init'),
679
+ className: (0, _styles.tableClass)(!colgroup && minWidthSup && 'init', bordered && 'table-bordered'),
685
680
  style: {
686
681
  width: width
687
682
  },
@@ -724,7 +719,8 @@ function (_PureComponent) {
724
719
  style: {
725
720
  width: width
726
721
  },
727
- ref: this.bindThead
722
+ ref: this.bindThead,
723
+ className: (0, _styles.tableClass)('table-bordered')
728
724
  }, _react.default.createElement(_Colgroup.default, {
729
725
  colgroup: colgroup,
730
726
  columns: columns,
@@ -751,9 +747,9 @@ function (_PureComponent) {
751
747
  var _this$props9 = this.props,
752
748
  fixed = _this$props9.fixed,
753
749
  hideHeader = _this$props9.hideHeader;
754
- var _this$state4 = this.state,
755
- scrollLeft = _this$state4.scrollLeft,
756
- floatFixed = _this$state4.floatFixed;
750
+ var _this$state3 = this.state,
751
+ scrollLeft = _this$state3.scrollLeft,
752
+ floatFixed = _this$state3.floatFixed;
757
753
  var floatClass = [];
758
754
 
759
755
  if (floatFixed) {
@@ -166,7 +166,8 @@ function (_PureComponent) {
166
166
  data = _this$props2.data,
167
167
  onResize = _this$props2.onResize,
168
168
  columnResizable = _this$props2.columnResizable,
169
- sticky = _this$props2.sticky;
169
+ sticky = _this$props2.sticky,
170
+ bordered = _this$props2.bordered;
170
171
  var _this$state = this.state,
171
172
  colgroup = _this$state.colgroup,
172
173
  scrollAble = _this$state.scrollAble;
@@ -174,7 +175,8 @@ function (_PureComponent) {
174
175
  var inner = _react.default.createElement("table", {
175
176
  style: {
176
177
  width: width
177
- }
178
+ },
179
+ className: (0, _styles.tableClass)(bordered && 'table-bordered')
178
180
  }, _react.default.createElement(_Colgroup.default, {
179
181
  colgroup: colgroup,
180
182
  columns: columns,
@@ -214,7 +216,8 @@ function (_PureComponent) {
214
216
  width = _this$props3.width,
215
217
  fixed = _this$props3.fixed,
216
218
  columnResizable = _this$props3.columnResizable,
217
- others = (0, _objectWithoutPropertiesLoose2.default)(_this$props3, ["columns", "width", "fixed", "columnResizable"]);
219
+ bordered = _this$props3.bordered,
220
+ others = (0, _objectWithoutPropertiesLoose2.default)(_this$props3, ["columns", "width", "fixed", "columnResizable", "bordered"]);
218
221
  var _this$state2 = this.state,
219
222
  colgroup = _this$state2.colgroup,
220
223
  resize = _this$state2.resize;
@@ -230,7 +233,7 @@ function (_PureComponent) {
230
233
  style: {
231
234
  width: width
232
235
  },
233
- className: (0, _styles.tableClass)(!colgroup && minWidthSup && 'init')
236
+ className: (0, _styles.tableClass)(!colgroup && minWidthSup && 'init', bordered && 'table-bordered')
234
237
  }, _react.default.createElement(_Colgroup.default, {
235
238
  colgroup: colgroup,
236
239
  columns: columns,
@@ -250,11 +253,13 @@ function (_PureComponent) {
250
253
  columns = _this$props4.columns,
251
254
  width = _this$props4.width,
252
255
  children = _this$props4.children,
253
- hideHeader = _this$props4.hideHeader;
256
+ hideHeader = _this$props4.hideHeader,
257
+ bordered = _this$props4.bordered;
254
258
  if (!columns || columns.length === 0) return _react.default.createElement("table", {
255
259
  style: {
256
260
  width: width
257
- }
261
+ },
262
+ className: (0, _styles.tableClass)(bordered && 'table-bordered')
258
263
  }, children);
259
264
  return [hideHeader ? null : this.renderHeader(), this.renderBody(), children];
260
265
  };
@@ -273,7 +278,8 @@ SimpleTable.propTypes = {
273
278
  dataChangeResize: _propTypes.default.bool,
274
279
  columnResizable: _propTypes.default.bool,
275
280
  sticky: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.bool]),
276
- hideHeader: _propTypes.default.bool
281
+ hideHeader: _propTypes.default.bool,
282
+ bordered: _propTypes.default.bool
277
283
  };
278
284
  SimpleTable.defaultProps = {
279
285
  data: undefined,
@@ -163,7 +163,9 @@ function (_Component) {
163
163
  className: className,
164
164
  ref: this.bindTable,
165
165
  style: newStyle
166
- }, events), _react.default.createElement(RenderTable, props), loading && _react.default.createElement("div", {
166
+ }, events), _react.default.createElement(RenderTable, (0, _extends2.default)({}, props, {
167
+ bordered: bordered
168
+ })), loading && _react.default.createElement("div", {
167
169
  className: (0, _styles.tableClass)('loading')
168
170
  }, typeof loading === 'boolean' ? _react.default.createElement(_Spin.default, {
169
171
  size: 40
@@ -169,7 +169,7 @@ var _default = function _default(WrappedComponent) {
169
169
  }).length === 0;
170
170
  var treeIndent = this.getTreeIndent();
171
171
  return _react.default.createElement(WrappedComponent, (0, _extends2.default)({}, this.props, {
172
- changedByExpand: this.changedByExpand,
172
+ changedByExpand: this.changedByExpand || this.props.changedByExpand,
173
173
  data: data,
174
174
  onTreeExpand: this.handleTreeExpand,
175
175
  treeExpandKeys: expandKeys,
@@ -187,7 +187,8 @@ var _default = function _default(WrappedComponent) {
187
187
  treeColumnsName: _propTypes.default.string,
188
188
  defaultTreeExpandKeys: _propTypes.default.array,
189
189
  treeExpandKeys: _propTypes.default.array,
190
- onTreeExpand: _propTypes.default.func
190
+ onTreeExpand: _propTypes.default.func,
191
+ changedByExpand: _propTypes.default.bool
191
192
  });
192
193
  TreeExpand.defaultProps = {
193
194
  defaultTreeExpandKeys: []
@@ -542,6 +542,15 @@ export interface TableProps<Value, TRD> extends StandardProps, ListItemStandardP
542
542
  */
543
543
  columnResizable?: boolean
544
544
 
545
+ /**
546
+ * Enable in specific scenarios (tree data expansion is controlled) Used to change the default behavior of scroll reset
547
+ *
548
+ * 在特定场景(树形数据展开受控)下开启 用来改变滚动条重置的默认行为
549
+ *
550
+ * default: false
551
+ */
552
+ changedByExpand?: boolean
553
+
545
554
  }
546
555
 
547
556
  declare class Table<Value = any, TRD = TableRowData> extends React.Component<TableProps<Value, TRD>, {}> {
@@ -33,7 +33,7 @@ var _TreeExpand = _interopRequireDefault(require("./TreeExpand"));
33
33
 
34
34
  var TableWithPagination = (0, _pagable.default)(_Table.default);
35
35
  var TableWithTree = (0, _TreeExpand.default)(_Table.default);
36
- var TableWithPT = (0, _func.compose)(_TreeExpand.default, _pagable.default)(_Table.default);
36
+ var TableWithPT = (0, _func.compose)(_pagable.default, _TreeExpand.default)(_Table.default);
37
37
 
38
38
  var _default =
39
39
  /*#__PURE__*/
@@ -79,7 +79,7 @@ var _default = function _default(Table) {
79
79
  var onColumnResize = this.props.onColumnResize;
80
80
  var changed = (0, _immer.default)(this.state, function (draft) {
81
81
  var column = draft.columns[index];
82
- draft.delta += parseFloat(width - (column.width || 0));
82
+ draft.delta += parseFloat(width - (column.width || colgroup[index] || 0));
83
83
  colgroup[index] = width;
84
84
  draft.columns.forEach(function (col, i) {
85
85
  var w = colgroup[i];
@@ -237,19 +237,19 @@ table > thead > tr > th.so-table-condensed {
237
237
  .so-table-bordered .so-table-head table {
238
238
  border-bottom-width: 1px;
239
239
  }
240
- .so-table-bordered table > thead > tr > th,
241
- .so-table-bordered table > tbody > tr > th,
242
- .so-table-bordered table > tfoot > tr > th,
243
- .so-table-bordered table > thead > tr > td,
244
- .so-table-bordered table > tbody > tr > td,
245
- .so-table-bordered table > tfoot > tr > td {
240
+ .so-table-bordered .so-table-table-bordered > thead > tr > th,
241
+ .so-table-bordered .so-table-table-bordered > tbody > tr > th,
242
+ .so-table-bordered .so-table-table-bordered > tfoot > tr > th,
243
+ .so-table-bordered .so-table-table-bordered > thead > tr > td,
244
+ .so-table-bordered .so-table-table-bordered > tbody > tr > td,
245
+ .so-table-bordered .so-table-table-bordered > tfoot > tr > td {
246
246
  border-right: 1px solid var(--table-border-color, #ddd);
247
247
  border-bottom-width: 1px;
248
248
  }
249
- .so-table-bordered table > tbody > tr > td.so-table-ignore-bottom-border {
249
+ .so-table-bordered .so-table-table-bordered > tbody > tr > td.so-table-ignore-bottom-border {
250
250
  border-bottom: none;
251
251
  }
252
- .so-table-bordered table > thead + tbody > tr:first-child > td {
252
+ .so-table-bordered .so-table-table-bordered > thead + tbody > tr:first-child > td {
253
253
  border-top-width: 1px;
254
254
  }
255
255
  .so-table-bordered .so-table-body table {
package/css/index.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  import './styles/normalize.less'
3
3
  import * as utils from './utils'
4
4
 
5
- export default { utils, version: '1.8.2' }
5
+ export default { utils, version: '1.8.7-beta.1' }
6
6
  export { utils }
7
7
  export { setLocale } from './locale'
8
8
  export { color, style } from './utils/expose'
package/css/index.js CHANGED
@@ -222,6 +222,6 @@ exports.Upload = _Upload.default;
222
222
  // Created by scripts/src-index.js.
223
223
  var _default = {
224
224
  utils: utils,
225
- version: '1.8.2'
225
+ version: '1.8.7-beta.1'
226
226
  };
227
227
  exports.default = _default;