shineout 1.8.2 → 1.8.3

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.
@@ -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
  });
@@ -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);
@@ -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];
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.3' }
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.3'
226
226
  };
227
227
  exports.default = _default;
package/dist/shineout.js CHANGED
@@ -4538,8 +4538,8 @@ var dropdownPosition = ['bottom-left', 'bottom-right', 'top-left', 'top-right'];
4538
4538
  value: function componentDidUpdate(prevProps) {
4539
4539
  var _this2 = this;
4540
4540
 
4541
- if (Object(_utils_shallowEqual__WEBPACK_IMPORTED_MODULE_12__["default"])(prevProps.value, this.props.value)) return;
4542
4541
  if (!this.props.focus) this.ajustdoc = false;
4542
+ if (Object(_utils_shallowEqual__WEBPACK_IMPORTED_MODULE_12__["default"])(prevProps.value, this.props.value)) return;
4543
4543
  setTimeout(function () {
4544
4544
  _this2.forceUpdate();
4545
4545
  });
@@ -33413,6 +33413,7 @@ function (_PureComponent) {
33413
33413
  _this.handleTouchStart = _this.handleTouchStart.bind(Object(_Users_10008649_Desktop_workspace_fe_shein_shineout_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__["default"])(_this));
33414
33414
  _this.handleTouchMove = _this.handleTouchMove.bind(Object(_Users_10008649_Desktop_workspace_fe_shein_shineout_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__["default"])(_this));
33415
33415
  _this.setStartPoint = _this.setStartPoint.bind(Object(_Users_10008649_Desktop_workspace_fe_shein_shineout_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__["default"])(_this));
33416
+ _this.handleInnerScroll = _this.handleInnerScroll.bind(Object(_Users_10008649_Desktop_workspace_fe_shein_shineout_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__["default"])(_this));
33416
33417
  return _this;
33417
33418
  }
33418
33419
 
@@ -33431,6 +33432,7 @@ function (_PureComponent) {
33431
33432
  this.wheelElement.addEventListener('touchmove', this.handleTouchMove, {
33432
33433
  passive: false
33433
33434
  });
33435
+ this.inner.addEventListener('scroll', this.handleInnerScroll);
33434
33436
  }
33435
33437
  }, {
33436
33438
  key: "componentDidUpdate",
@@ -33449,6 +33451,7 @@ function (_PureComponent) {
33449
33451
  this.wheelElement.removeEventListener('wheel', this.handleWheel);
33450
33452
  this.wheelElement.removeEventListener('touchstart', this.handleTouchStart);
33451
33453
  this.wheelElement.removeEventListener('touchmove', this.handleTouchMove);
33454
+ this.inner.removeEventListener('scroll', this.handleInnerScroll);
33452
33455
  }
33453
33456
  }, {
33454
33457
  key: "getWheelRect",
@@ -33642,23 +33645,41 @@ function (_PureComponent) {
33642
33645
 
33643
33646
  this.setStartPoint(position);
33644
33647
  this.boundleScroll();
33645
- }
33648
+ } // inner scroll
33649
+
33646
33650
  }, {
33647
- key: "render",
33648
- value: function render() {
33651
+ key: "handleInnerScroll",
33652
+ value: function handleInnerScroll(e) {
33653
+ var target = e.target;
33649
33654
  var _this$props6 = this.props,
33650
- children = _this$props6.children,
33651
- scrollWidth = _this$props6.scrollWidth,
33652
- scrollHeight = _this$props6.scrollHeight,
33653
33655
  left = _this$props6.left,
33654
- top = _this$props6.top,
33655
- scrollX = _this$props6.scrollX,
33656
- scrollY = _this$props6.scrollY,
33657
- style = _this$props6.style;
33656
+ scrollWidth = _this$props6.scrollWidth;
33658
33657
 
33659
33658
  var _this$getWheelRect2 = this.getWheelRect(),
33660
- width = _this$getWheelRect2.width,
33661
- height = _this$getWheelRect2.height;
33659
+ width = _this$getWheelRect2.width;
33660
+
33661
+ if (target.scrollLeft) {
33662
+ this.handleScroll(left + target.scrollLeft / (scrollWidth - width), this.props.top, undefined, 0);
33663
+ target.scrollLeft = 0;
33664
+ target.scrollTop = 0;
33665
+ }
33666
+ }
33667
+ }, {
33668
+ key: "render",
33669
+ value: function render() {
33670
+ var _this$props7 = this.props,
33671
+ children = _this$props7.children,
33672
+ scrollWidth = _this$props7.scrollWidth,
33673
+ scrollHeight = _this$props7.scrollHeight,
33674
+ left = _this$props7.left,
33675
+ top = _this$props7.top,
33676
+ scrollX = _this$props7.scrollX,
33677
+ scrollY = _this$props7.scrollY,
33678
+ style = _this$props7.style;
33679
+
33680
+ var _this$getWheelRect3 = this.getWheelRect(),
33681
+ width = _this$getWheelRect3.width,
33682
+ height = _this$getWheelRect3.height;
33662
33683
 
33663
33684
  var rtl = Object(_config__WEBPACK_IMPORTED_MODULE_17__["isRTL"])();
33664
33685
  var className = classnames__WEBPACK_IMPORTED_MODULE_10___default()(Object(_styles__WEBPACK_IMPORTED_MODULE_15__["scrollClass"])('_', scrollX && 'show-x', scrollY && 'show-y', rtl && 'rtl'), this.props.className);
@@ -33674,7 +33695,7 @@ function (_PureComponent) {
33674
33695
  __self: this,
33675
33696
  __source: {
33676
33697
  fileName: _jsxFileName,
33677
- lineNumber: 234,
33698
+ lineNumber: 249,
33678
33699
  columnNumber: 7
33679
33700
  }
33680
33701
  },
@@ -33687,7 +33708,7 @@ function (_PureComponent) {
33687
33708
  __self: this,
33688
33709
  __source: {
33689
33710
  fileName: _jsxFileName,
33690
- lineNumber: 235,
33711
+ lineNumber: 250,
33691
33712
  columnNumber: 9
33692
33713
  }
33693
33714
  }),
@@ -33697,7 +33718,7 @@ function (_PureComponent) {
33697
33718
  __self: this,
33698
33719
  __source: {
33699
33720
  fileName: _jsxFileName,
33700
- lineNumber: 236,
33721
+ lineNumber: 251,
33701
33722
  columnNumber: 9
33702
33723
  }
33703
33724
  }),
@@ -33708,7 +33729,7 @@ function (_PureComponent) {
33708
33729
  __self: this,
33709
33730
  __source: {
33710
33731
  fileName: _jsxFileName,
33711
- lineNumber: 237,
33732
+ lineNumber: 252,
33712
33733
  columnNumber: 9
33713
33734
  }
33714
33735
  },
@@ -33722,7 +33743,7 @@ function (_PureComponent) {
33722
33743
  __self: this,
33723
33744
  __source: {
33724
33745
  fileName: _jsxFileName,
33725
- lineNumber: 238,
33746
+ lineNumber: 253,
33726
33747
  columnNumber: 11
33727
33748
  }
33728
33749
  }, children)), scrollY &&
@@ -33737,7 +33758,7 @@ function (_PureComponent) {
33737
33758
  __self: this,
33738
33759
  __source: {
33739
33760
  fileName: _jsxFileName,
33740
- lineNumber: 241,
33761
+ lineNumber: 256,
33741
33762
  columnNumber: 11
33742
33763
  }
33743
33764
  }), scrollX &&
@@ -33751,7 +33772,7 @@ function (_PureComponent) {
33751
33772
  __self: this,
33752
33773
  __source: {
33753
33774
  fileName: _jsxFileName,
33754
- lineNumber: 251,
33775
+ lineNumber: 266,
33755
33776
  columnNumber: 11
33756
33777
  }
33757
33778
  }))
@@ -45842,7 +45863,7 @@ function _createSuper2(Derived) {
45842
45863
  var onColumnResize = this.props.onColumnResize;
45843
45864
  var changed = Object(immer__WEBPACK_IMPORTED_MODULE_8__["default"])(this.state, function (draft) {
45844
45865
  var column = draft.columns[index];
45845
- draft.delta += parseFloat(width - (column.width || 0));
45866
+ draft.delta += parseFloat(width - (column.width || colgroup[index] || 0));
45846
45867
  colgroup[index] = width;
45847
45868
  draft.columns.forEach(function (col, i) {
45848
45869
  var w = colgroup[i];
@@ -60258,7 +60279,7 @@ __webpack_require__.r(__webpack_exports__);
60258
60279
 
60259
60280
  /* harmony default export */ __webpack_exports__["default"] = ({
60260
60281
  utils: _utils__WEBPACK_IMPORTED_MODULE_0__,
60261
- version: '1.8.2'
60282
+ version: '1.8.3'
60262
60283
  });
60263
60284
 
60264
60285