shineout 3.9.15-beta.3 → 3.9.15-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
@@ -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.15-beta.3'
525
+ version: '3.9.15-beta.4'
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.15-beta.3');
12329
+ /* harmony default export */ var version = ('3.9.15-beta.4');
12330
12330
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
12331
12331
 
12332
12332
 
@@ -66310,6 +66310,7 @@ var useTableVirtualExternal = function useTableVirtualExternal(props) {
66310
66310
  setHeaderOffset = _useState2[1];
66311
66311
  var externalStickyRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
66312
66312
  var tableOffsetRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(0);
66313
+ var stickyCompensationTimer = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
66313
66314
  var handleExternalScroll = usePersistFn(function () {
66314
66315
  var _props$tableRef, _externalStickyRef$cu;
66315
66316
  if (props.disabled) return;
@@ -66352,6 +66353,23 @@ var useTableVirtualExternal = function useTableVirtualExternal(props) {
66352
66353
  if (max > 0 && scrollTop > max) {
66353
66354
  scrollTop = max;
66354
66355
  }
66356
+
66357
+ // 补偿 sticky 失效:滚动停止后设置补偿值,避免滚动中抖动
66358
+ if (externalStickyRef.current && props.externalStickyHeader) {
66359
+ var stickyDivFullHeight = externalStickyRef.current.offsetHeight;
66360
+ var stickyBreakPoint = sumHeight - stickyDivFullHeight;
66361
+ if (stickyCompensationTimer.current) {
66362
+ clearTimeout(stickyCompensationTimer.current);
66363
+ }
66364
+ externalStickyRef.current.style.setProperty('--sticky-compensation', '0px');
66365
+ if (rawScrollTop > stickyBreakPoint && stickyBreakPoint > 0) {
66366
+ var el = externalStickyRef.current;
66367
+ stickyCompensationTimer.current = setTimeout(function () {
66368
+ var compensation = rawScrollTop - stickyBreakPoint;
66369
+ el.style.setProperty('--sticky-compensation', "".concat(compensation, "px"));
66370
+ }, 150);
66371
+ }
66372
+ }
66355
66373
  props.updateIndexAndTopFromTop(scrollTop);
66356
66374
  });
66357
66375
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
@@ -69167,7 +69185,9 @@ function Table(props) {
69167
69185
  style: {
69168
69186
  position: 'relative',
69169
69187
  zIndex: 1,
69170
- marginTop: props.sticky ? 0 : -virtualInfo.headerOffset
69188
+ marginTop: props.sticky ? 0 : -virtualInfo.headerOffset,
69189
+ transform: 'translateY(var(--sticky-compensation, 0px))',
69190
+ willChange: 'transform'
69171
69191
  },
69172
69192
  children: $headTable
69173
69193
  }), !!((_props$data3 = props.data) !== null && _props$data3 !== void 0 && _props$data3.length) && /*#__PURE__*/(0,jsx_runtime.jsxs)("table", {
@@ -75920,7 +75940,7 @@ var upload_interface = __webpack_require__(8821);
75920
75940
 
75921
75941
 
75922
75942
  /* harmony default export */ var src_0 = ({
75923
- version: '3.9.15-beta.3'
75943
+ version: '3.9.15-beta.4'
75924
75944
  });
75925
75945
  }();
75926
75946
  /******/ return __webpack_exports__;