shineout 3.9.3-beta.14 → 3.9.3-beta.16

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/cjs/index.js CHANGED
@@ -522,5 +522,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
522
522
  // 此文件由脚本自动生成,请勿直接修改。
523
523
  // This file was generated automatically by a script. Please do not modify it directly.
524
524
  var _default = exports.default = {
525
- version: '3.9.3-beta.14'
525
+ version: '3.9.3-beta.16'
526
526
  };
package/dist/shineout.js CHANGED
@@ -12401,7 +12401,7 @@ var handleStyle = function handleStyle(style) {
12401
12401
  };
12402
12402
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
12403
12403
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
12404
- /* harmony default export */ var version = ('3.9.3-beta.14');
12404
+ /* harmony default export */ var version = ('3.9.3-beta.16');
12405
12405
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
12406
12406
 
12407
12407
 
@@ -64653,7 +64653,7 @@ var useColumns = function useColumns(props) {
64653
64653
  sum += curCol.width || 100;
64654
64654
  if (scrollLeft < sum) {
64655
64655
  // 计算可视区域内需要渲染的列数
64656
- for (var j = i + 1; j < len; j++) {
64656
+ for (var j = i + 1; j <= len; j++) {
64657
64657
  var _props$scrollRef$curr;
64658
64658
  var nextCol = middleColumns[j];
64659
64659
  sum += nextCol.width || 100;
@@ -64662,6 +64662,11 @@ var useColumns = function useColumns(props) {
64662
64662
  var visibleCount = j - i;
64663
64663
  setRenderedCount(Math.min(visibleCount + overscan * 2, len));
64664
64664
  break;
64665
+ } else if (j === len) {
64666
+ // 到达最后一列
64667
+ var _visibleCount = j - i + 1;
64668
+ setRenderedCount(Math.min(_visibleCount + overscan * 2, len));
64669
+ break;
64665
64670
  }
64666
64671
  }
64667
64672
 
@@ -64680,14 +64685,14 @@ var useColumns = function useColumns(props) {
64680
64685
  });
64681
64686
  }, []);
64682
64687
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
64683
- var _props$scrollRef$curr2;
64684
64688
  if (!props.virtualColumn) return;
64685
- if (((_props$scrollRef$curr2 = props.scrollRef.current) === null || _props$scrollRef$curr2 === void 0 ? void 0 : _props$scrollRef$curr2.scrollLeft) === 0) {
64689
+ if (props.scrollRef.current) {
64690
+ var _props$scrollRef$curr2;
64686
64691
  handleScroll({
64687
- scrollLeft: 0
64692
+ scrollLeft: (_props$scrollRef$curr2 = props.scrollRef.current) === null || _props$scrollRef$curr2 === void 0 ? void 0 : _props$scrollRef$curr2.scrollLeft
64688
64693
  });
64689
64694
  }
64690
- }, [(_props$data = props.data) === null || _props$data === void 0 ? void 0 : _props$data.length]);
64695
+ }, [(_props$data = props.data) === null || _props$data === void 0 ? void 0 : _props$data.length, columns]);
64691
64696
  var processedColumns = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
64692
64697
  if (!props.virtualColumn) return columns;
64693
64698
  return columns.map(function (col, index) {
@@ -64696,14 +64701,21 @@ var useColumns = function useColumns(props) {
64696
64701
  }
64697
64702
  if (index < startIndex || index > startIndex + renderedCount) {
64698
64703
  var colSpan;
64704
+ var colSpanWidth;
64699
64705
  if (index > startIndex + renderedCount && index === startIndex + renderedCount + 1) {
64700
64706
  colSpan = function colSpan() {
64701
- return middleColumns.length - (startIndex + renderedCount) + 1;
64707
+ return middleColumns.length - index;
64702
64708
  };
64709
+ colSpanWidth = middleColumns.slice(index).reduce(function (sum, c) {
64710
+ return sum + (c.width || 0);
64711
+ }, 0);
64703
64712
  } else if (index < startIndex && index === leftFixedColumns.length && startIndex > 0) {
64704
64713
  colSpan = function colSpan() {
64705
64714
  return startIndex;
64706
64715
  };
64716
+ colSpanWidth = middleColumns.slice(0, startIndex).reduce(function (sum, c) {
64717
+ return sum + (c.width || 0);
64718
+ }, 0);
64707
64719
  }
64708
64720
  var hiddenTitle = context.groupLevel > 0 ? col.title : null;
64709
64721
  return objectSpread2_default()(objectSpread2_default()({}, col), {}, {
@@ -64711,7 +64723,10 @@ var useColumns = function useColumns(props) {
64711
64723
  render: function render() {
64712
64724
  return null;
64713
64725
  },
64714
- title: hiddenTitle
64726
+ title: hiddenTitle,
64727
+ style: {
64728
+ width: colSpanWidth
64729
+ }
64715
64730
  });
64716
64731
  }
64717
64732
  return col;
@@ -74731,7 +74746,7 @@ var upload_interface = __webpack_require__(8821);
74731
74746
 
74732
74747
 
74733
74748
  /* harmony default export */ var src_0 = ({
74734
- version: '3.9.3-beta.14'
74749
+ version: '3.9.3-beta.16'
74735
74750
  });
74736
74751
  }();
74737
74752
  /******/ return __webpack_exports__;