shineout 3.10.1-beta.3 → 3.10.1-beta.4

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
@@ -545,5 +545,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
545
545
  // 此文件由脚本自动生成,请勿直接修改。
546
546
  // This file was generated automatically by a script. Please do not modify it directly.
547
547
  var _default = exports.default = {
548
- version: '3.10.1-beta.3'
548
+ version: '3.10.1-beta.4'
549
549
  };
package/dist/shineout.js CHANGED
@@ -13686,7 +13686,7 @@ var handleStyle = function handleStyle(style) {
13686
13686
  };
13687
13687
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
13688
13688
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
13689
- /* harmony default export */ var version = ('3.10.1-beta.3');
13689
+ /* harmony default export */ var version = ('3.10.1-beta.4');
13690
13690
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
13691
13691
 
13692
13692
 
@@ -67494,6 +67494,21 @@ var useTableLayout = function useTableLayout(props) {
67494
67494
  for (var i = 0, count = items.length; i < count; i++) {
67495
67495
  _loop();
67496
67496
  }
67497
+
67498
+ // offsetWidth 返回整数(四舍五入),多列累加可能导致总和比表格实际渲染宽度大 1~N px,
67499
+ // 这些多出的像素会让 table-layout:fixed 的表格撑宽,产生不必要的横向滚动条。
67500
+ // 用 <table> 自身的 offsetWidth 作为基准,将取整溢出部分从最后一列减去。
67501
+ if (target.current && newCols.length > 0) {
67502
+ var tableRenderedWidth = target.current.offsetWidth;
67503
+ var measuredSum = newCols.reduce(function (a, b) {
67504
+ return a + b;
67505
+ }, 0);
67506
+ var excess = measuredSum - tableRenderedWidth;
67507
+ // 仅修正取整误差范围内的溢出(最多每列 1px)
67508
+ if (tableRenderedWidth > 0 && excess > 0 && excess <= items.length) {
67509
+ newCols[newCols.length - 1] -= excess;
67510
+ }
67511
+ }
67497
67512
  if (fromDrag && props.columnResizable) {
67498
67513
  var widthArr = toConsumableArray_default()(newCols);
67499
67514
  if (typeof props.width === 'number') {
@@ -79777,7 +79792,7 @@ var watermark_interface = __webpack_require__(6640);
79777
79792
 
79778
79793
 
79779
79794
  /* harmony default export */ var src_0 = ({
79780
- version: '3.10.1-beta.3'
79795
+ version: '3.10.1-beta.4'
79781
79796
  });
79782
79797
  }();
79783
79798
  /******/ return __webpack_exports__;