shineout 3.2.4 → 3.2.5-beta.1

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
@@ -476,5 +476,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
476
476
  // 此文件由脚本自动生成,请勿直接修改。
477
477
  // This file was generated automatically by a script. Please do not modify it directly.
478
478
  var _default = exports.default = {
479
- version: '3.2.4'
479
+ version: '3.2.5-beta.1'
480
480
  };
package/dist/shineout.js CHANGED
@@ -11960,7 +11960,7 @@ var handleStyle = function handleStyle(style) {
11960
11960
  };
11961
11961
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
11962
11962
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
11963
- /* harmony default export */ var version = ('3.2.4');
11963
+ /* harmony default export */ var version = ('3.2.5-beta.1');
11964
11964
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
11965
11965
 
11966
11966
 
@@ -55179,7 +55179,6 @@ var useTableTree = function useTableTree(props) {
55179
55179
 
55180
55180
 
55181
55181
 
55182
-
55183
55182
  var useTableVirtual = function useTableVirtual(props) {
55184
55183
  var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(0),
55185
55184
  _useState2 = slicedToArray_default()(_useState, 2),
@@ -55197,7 +55196,6 @@ var useTableVirtual = function useTableVirtual(props) {
55197
55196
  _useState8 = slicedToArray_default()(_useState7, 2),
55198
55197
  startIndex = _useState8[0],
55199
55198
  setStartIndex = _useState8[1];
55200
- var preIndex = usePrevious(startIndex);
55201
55199
  var _useState9 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(0),
55202
55200
  _useState10 = slicedToArray_default()(_useState9, 2),
55203
55201
  offsetY = _useState10[0],
@@ -55210,7 +55208,8 @@ var useTableVirtual = function useTableVirtual(props) {
55210
55208
  rateTimer: null,
55211
55209
  topTimer: null,
55212
55210
  controlScrollRate: null,
55213
- heightCallback: null
55211
+ heightCallback: null,
55212
+ preIndex: null
55214
55213
  }),
55215
55214
  context = _useRef.current;
55216
55215
  var getTranslate = usePersistFn(function (left, top) {
@@ -55243,6 +55242,8 @@ var useTableVirtual = function useTableVirtual(props) {
55243
55242
  if (context.shouldUpdateHeight) {
55244
55243
  setHeight(getContentHeight(props.data.length - 1));
55245
55244
  }
55245
+ var preIndex = context.preIndex;
55246
+ // 解决: 从下往上滚 由于高度变化会导致滚动条跳动
55246
55247
  if (preIndex && preIndex > startIndex && startIndex === index) {
55247
55248
  // 发生在顶部
55248
55249
  if (context.heightCallback) return;
@@ -55347,6 +55348,16 @@ var useTableVirtual = function useTableVirtual(props) {
55347
55348
  props.scrollRef.current.scrollTop = beforeHeight;
55348
55349
  }
55349
55350
  });
55351
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
55352
+ // 记录preIndex
55353
+ context.preIndex = startIndex;
55354
+ }, [startIndex]);
55355
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
55356
+ // 数据变化的时候清空掉 preIndex, 如果之前有缓存的index, setRowHeight 会有问题
55357
+ return function () {
55358
+ context.preIndex = null;
55359
+ };
55360
+ }, [props.data]);
55350
55361
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
55351
55362
  if (props.disabled) return;
55352
55363
  if (offsetY) {
@@ -63089,7 +63100,7 @@ var upload_interface = __webpack_require__(4412);
63089
63100
 
63090
63101
 
63091
63102
  /* harmony default export */ var src_0 = ({
63092
- version: '3.2.4'
63103
+ version: '3.2.5-beta.1'
63093
63104
  });
63094
63105
  }();
63095
63106
  /******/ return __webpack_exports__;