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.
@@ -89,8 +89,8 @@ export default function (List) {
89
89
  _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
90
90
  var _this2 = this;
91
91
 
92
- if (shallowEqual(prevProps.value, this.props.value)) return;
93
92
  if (!this.props.focus) this.ajustdoc = false;
93
+ if (shallowEqual(prevProps.value, this.props.value)) return;
94
94
  setTimeout(function () {
95
95
  _this2.forceUpdate();
96
96
  });
@@ -43,6 +43,7 @@ function (_PureComponent) {
43
43
  _this.handleTouchStart = _this.handleTouchStart.bind(_assertThisInitialized(_assertThisInitialized(_this)));
44
44
  _this.handleTouchMove = _this.handleTouchMove.bind(_assertThisInitialized(_assertThisInitialized(_this)));
45
45
  _this.setStartPoint = _this.setStartPoint.bind(_assertThisInitialized(_assertThisInitialized(_this)));
46
+ _this.handleInnerScroll = _this.handleInnerScroll.bind(_assertThisInitialized(_assertThisInitialized(_this)));
46
47
  return _this;
47
48
  }
48
49
 
@@ -61,6 +62,7 @@ function (_PureComponent) {
61
62
  this.wheelElement.addEventListener('touchmove', this.handleTouchMove, {
62
63
  passive: false
63
64
  });
65
+ this.inner.addEventListener('scroll', this.handleInnerScroll);
64
66
  };
65
67
 
66
68
  _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
@@ -77,6 +79,7 @@ function (_PureComponent) {
77
79
  this.wheelElement.removeEventListener('wheel', this.handleWheel);
78
80
  this.wheelElement.removeEventListener('touchstart', this.handleTouchStart);
79
81
  this.wheelElement.removeEventListener('touchmove', this.handleTouchMove);
82
+ this.inner.removeEventListener('scroll', this.handleInnerScroll);
80
83
  };
81
84
 
82
85
  _proto.getWheelRect = function getWheelRect() {
@@ -256,22 +259,39 @@ function (_PureComponent) {
256
259
 
257
260
  this.setStartPoint(position);
258
261
  this.boundleScroll();
259
- };
262
+ } // inner scroll
263
+ ;
260
264
 
261
- _proto.render = function render() {
265
+ _proto.handleInnerScroll = function handleInnerScroll(e) {
266
+ var target = e.target;
262
267
  var _this$props6 = this.props,
263
- children = _this$props6.children,
264
- scrollWidth = _this$props6.scrollWidth,
265
- scrollHeight = _this$props6.scrollHeight,
266
268
  left = _this$props6.left,
267
- top = _this$props6.top,
268
- scrollX = _this$props6.scrollX,
269
- scrollY = _this$props6.scrollY,
270
- style = _this$props6.style;
269
+ scrollWidth = _this$props6.scrollWidth;
271
270
 
272
271
  var _this$getWheelRect2 = this.getWheelRect(),
273
- width = _this$getWheelRect2.width,
274
- height = _this$getWheelRect2.height;
272
+ width = _this$getWheelRect2.width;
273
+
274
+ if (target.scrollLeft) {
275
+ this.handleScroll(left + target.scrollLeft / (scrollWidth - width), this.props.top, undefined, 0);
276
+ target.scrollLeft = 0;
277
+ target.scrollTop = 0;
278
+ }
279
+ };
280
+
281
+ _proto.render = function render() {
282
+ var _this$props7 = this.props,
283
+ children = _this$props7.children,
284
+ scrollWidth = _this$props7.scrollWidth,
285
+ scrollHeight = _this$props7.scrollHeight,
286
+ left = _this$props7.left,
287
+ top = _this$props7.top,
288
+ scrollX = _this$props7.scrollX,
289
+ scrollY = _this$props7.scrollY,
290
+ style = _this$props7.style;
291
+
292
+ var _this$getWheelRect3 = this.getWheelRect(),
293
+ width = _this$getWheelRect3.width,
294
+ height = _this$getWheelRect3.height;
275
295
 
276
296
  var rtl = isRTL();
277
297
  var className = classnames(scrollClass('_', scrollX && 'show-x', scrollY && 'show-y', rtl && 'rtl'), this.props.className);
@@ -64,7 +64,7 @@ export default (function (Table) {
64
64
  var onColumnResize = this.props.onColumnResize;
65
65
  var changed = immer(this.state, function (draft) {
66
66
  var column = draft.columns[index];
67
- draft.delta += parseFloat(width - (column.width || 0));
67
+ draft.delta += parseFloat(width - (column.width || colgroup[index] || 0));
68
68
  colgroup[index] = width;
69
69
  draft.columns.forEach(function (col, i) {
70
70
  var w = colgroup[i];
package/es/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/es/index.js CHANGED
@@ -3,7 +3,7 @@ import './styles/normalize.less';
3
3
  import * as utils from './utils';
4
4
  export default {
5
5
  utils: utils,
6
- version: '1.8.2'
6
+ version: '1.8.3'
7
7
  };
8
8
  export { utils };
9
9
  export { setLocale } from './locale';
@@ -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/lib/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/lib/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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shineout",
3
- "version": "1.8.2",
3
+ "version": "1.8.3",
4
4
  "description": "Shein 前端组件库",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./es/index.js",