shineout 3.9.0-beta.25 → 3.9.0-beta.26

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.0-beta.25'
525
+ version: '3.9.0-beta.26'
526
526
  };
package/dist/shineout.js CHANGED
@@ -12400,7 +12400,7 @@ var handleStyle = function handleStyle(style) {
12400
12400
  };
12401
12401
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
12402
12402
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
12403
- /* harmony default export */ var version = ('3.9.0-beta.25');
12403
+ /* harmony default export */ var version = ('3.9.0-beta.26');
12404
12404
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
12405
12405
 
12406
12406
 
@@ -63961,6 +63961,25 @@ var scroll_table_Scroll = function Scroll(props) {
63961
63961
  }
63962
63962
  });
63963
63963
 
63964
+ // 组件元素隐藏时,设置定高,解决恢复显示时滚动条位置未保持住的问题
63965
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
63966
+ if (!props.tableRef.current) return;
63967
+ var isVisible = props.tableRef.current.offsetParent !== null;
63968
+ var wasHidden = props.tableRef.current.getAttribute('data-was-hidden') === 'true';
63969
+ var h = context.lastTableHeight || props.tableRef.current.clientHeight;
63970
+ if (h > 0) {
63971
+ context.lastTableHeight = h;
63972
+ }
63973
+ if (isVisible && wasHidden) {
63974
+ props.tableRef.current.style.height = '100%';
63975
+ props.tableRef.current.removeAttribute('data-was-hidden');
63976
+ } else if (!isVisible && props.tableRef.current.style.height === '100%') {
63977
+ // 加height === '100%'判断是因为:多层父级flex嵌套才有这个问题
63978
+ props.tableRef.current.style.height = "".concat(context.lastTableHeight, "px");
63979
+ props.tableRef.current.setAttribute('data-was-hidden', 'true');
63980
+ }
63981
+ }, [paddingTop]);
63982
+
63964
63983
  // 非定高的Table但依旧采用了virtual渲染方式,需要渲染出全部的data
63965
63984
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useLayoutEffect)(function () {
63966
63985
  if (!props.tableRef.current || !props.setFakeVirtual) return;
@@ -74196,7 +74215,7 @@ var upload_interface = __webpack_require__(8821);
74196
74215
 
74197
74216
 
74198
74217
  /* harmony default export */ var src_0 = ({
74199
- version: '3.9.0-beta.25'
74218
+ version: '3.9.0-beta.26'
74200
74219
  });
74201
74220
  }();
74202
74221
  /******/ return __webpack_exports__;