shineout 3.9.14-beta.5 → 3.9.14-beta.7

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.14-beta.5'
525
+ version: '3.9.14-beta.7'
526
526
  };
package/dist/shineout.js CHANGED
@@ -12326,7 +12326,7 @@ var handleStyle = function handleStyle(style) {
12326
12326
  };
12327
12327
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
12328
12328
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
12329
- /* harmony default export */ var version = ('3.9.14-beta.5');
12329
+ /* harmony default export */ var version = ('3.9.14-beta.7');
12330
12330
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
12331
12331
 
12332
12332
 
@@ -65775,8 +65775,14 @@ var useTableLayout = function useTableLayout(props) {
65775
65775
  return v === 0;
65776
65776
  })) return;
65777
65777
  var shifted = shiftDecimalToLastColumn(cols);
65778
+ // 当 colgroup 中存在 undefined(说明从未被成功测量过),跳过相等判断,强制触发重新测量
65779
+ // 场景:Table 在 display:none 容器中挂载时 getColgroup 测量失败,
65780
+ // 后续 resetColGroup 产出值与初始值相同会被跳过,导致未设 width 的列永远无法获得实际宽度
65781
+ var hasUndefined = shifted.some(function (v) {
65782
+ return v === undefined;
65783
+ });
65778
65784
  // 值未变化时跳过,避免触发不必要的 useLayoutEffect
65779
- if (colgroup && shifted.length === colgroup.length && shifted.every(function (v, i) {
65785
+ if (!hasUndefined && colgroup && shifted.length === colgroup.length && shifted.every(function (v, i) {
65780
65786
  return v === colgroup[i];
65781
65787
  })) {
65782
65788
  return;
@@ -65963,6 +65969,32 @@ var useTableLayout = function useTableLayout(props) {
65963
65969
  (_cancelFunc = cancelFunc) === null || _cancelFunc === void 0 || _cancelFunc();
65964
65970
  };
65965
65971
  }, [scrollRef.current]);
65972
+
65973
+ // 当祖先元素的 CSS 动画结束时(如 Modal 入场动画),重新测量列宽
65974
+ // 解决 Table 在动画容器(如 Modal)中渲染时,动画期间测量的列宽不准确导致 sticky 表头与表体列宽错位的问题
65975
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
65976
+ var scrollEl = scrollRef.current;
65977
+ if (!scrollEl) return;
65978
+
65979
+ // 查找最近的 fixed 定位祖先(如 Modal wrapper),仅在该元素上监听动画结束
65980
+ var fixedAncestor = null;
65981
+ var parent = scrollEl.parentElement;
65982
+ while (parent) {
65983
+ if (window.getComputedStyle(parent).position === 'fixed') {
65984
+ fixedAncestor = parent;
65985
+ break;
65986
+ }
65987
+ parent = parent.parentElement;
65988
+ }
65989
+ if (!fixedAncestor) return;
65990
+ var handleAnimationEnd = function handleAnimationEnd() {
65991
+ getColgroup(false);
65992
+ };
65993
+ fixedAncestor.addEventListener('animationend', handleAnimationEnd);
65994
+ return function () {
65995
+ fixedAncestor.removeEventListener('animationend', handleAnimationEnd);
65996
+ };
65997
+ }, [scrollRef.current]);
65966
65998
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useLayoutEffect)(function () {
65967
65999
  if (adjust) {
65968
66000
  getColgroup(adjust === 'drag');
@@ -75722,7 +75754,7 @@ var upload_interface = __webpack_require__(8821);
75722
75754
 
75723
75755
 
75724
75756
  /* harmony default export */ var src_0 = ({
75725
- version: '3.9.14-beta.5'
75757
+ version: '3.9.14-beta.7'
75726
75758
  });
75727
75759
  }();
75728
75760
  /******/ return __webpack_exports__;