@bit-sun/business-component 2.3.5 → 2.3.6

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.
package/dist/index.esm.js CHANGED
@@ -17008,14 +17008,14 @@ var index$6 = /*#__PURE__*/forwardRef(function (props, ref) {
17008
17008
  setLeftWidth(realLeftTableWidth);
17009
17009
  });
17010
17010
  }, []);
17011
- var onScroll = function onScroll() {
17011
+ var onScroll = function onScroll(e) {
17012
17012
  if (topScrollBar.current) {
17013
17013
  topScrollBar.current.scrollTo(viewPort.current.scrollLeft, 0);
17014
17014
  }
17015
17015
  var scrollWidth = viewPort.current.scrollLeft;
17016
17016
  var startIndex = Math.floor(scrollWidth / itemWidth);
17017
17017
  if (startIndex + viewCount >= colTableData.length) {
17018
- startIndex = colTableData.length - viewCount;
17018
+ startIndex = colTableData.length - viewCount <= 0 ? 0 : colTableData.length - viewCount;
17019
17019
  }
17020
17020
  var offsetWidth = startIndex * itemWidth;
17021
17021
  setStartIndex(startIndex);
package/dist/index.js CHANGED
@@ -17027,14 +17027,14 @@ var index$6 = /*#__PURE__*/React.forwardRef(function (props, ref) {
17027
17027
  setLeftWidth(realLeftTableWidth);
17028
17028
  });
17029
17029
  }, []);
17030
- var onScroll = function onScroll() {
17030
+ var onScroll = function onScroll(e) {
17031
17031
  if (topScrollBar.current) {
17032
17032
  topScrollBar.current.scrollTo(viewPort.current.scrollLeft, 0);
17033
17033
  }
17034
17034
  var scrollWidth = viewPort.current.scrollLeft;
17035
17035
  var startIndex = Math.floor(scrollWidth / itemWidth);
17036
17036
  if (startIndex + viewCount >= colTableData.length) {
17037
- startIndex = colTableData.length - viewCount;
17037
+ startIndex = colTableData.length - viewCount <= 0 ? 0 : colTableData.length - viewCount;
17038
17038
  }
17039
17039
  var offsetWidth = startIndex * itemWidth;
17040
17040
  setStartIndex(startIndex);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bit-sun/business-component",
3
- "version": "2.3.5",
3
+ "version": "2.3.6",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -47,14 +47,14 @@ export default forwardRef((props, ref) => {
47
47
  })
48
48
  }, [])
49
49
 
50
- const onScroll = () => {
50
+ const onScroll = (e) => {
51
51
  if(topScrollBar.current){
52
52
  topScrollBar.current.scrollTo(viewPort.current.scrollLeft, 0)
53
53
  }
54
54
  const scrollWidth = viewPort.current.scrollLeft;
55
55
  let startIndex = Math.floor(scrollWidth/itemWidth);
56
56
  if ( startIndex + viewCount >= colTableData.length) {
57
- startIndex = colTableData.length - viewCount;
57
+ startIndex = colTableData.length - viewCount <= 0 ? 0 : colTableData.length - viewCount;
58
58
  }
59
59
  const offsetWidth = startIndex * itemWidth;
60
60
  setStartIndex(startIndex);