shineout 3.7.0-beta.8 → 3.7.0-beta.9

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
@@ -514,5 +514,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
514
514
  // 此文件由脚本自动生成,请勿直接修改。
515
515
  // This file was generated automatically by a script. Please do not modify it directly.
516
516
  var _default = exports.default = {
517
- version: '3.7.0-beta.8'
517
+ version: '3.7.0-beta.9'
518
518
  };
package/dist/shineout.js CHANGED
@@ -12217,7 +12217,7 @@ var handleStyle = function handleStyle(style) {
12217
12217
  };
12218
12218
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
12219
12219
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
12220
- /* harmony default export */ var version = ('3.7.0-beta.8');
12220
+ /* harmony default export */ var version = ('3.7.0-beta.9');
12221
12221
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
12222
12222
 
12223
12223
 
@@ -63030,6 +63030,8 @@ var Tr = function Tr(props) {
63030
63030
 
63031
63031
 
63032
63032
 
63033
+
63034
+
63033
63035
  /* harmony default export */ var tbody = (function (props) {
63034
63036
  var _props$columns = props.columns,
63035
63037
  columns = _props$columns === void 0 ? [] : _props$columns,
@@ -63105,11 +63107,25 @@ var Tr = function Tr(props) {
63105
63107
  shouldCellUpdate: props.shouldCellUpdate
63106
63108
  }, trRenderKey);
63107
63109
  };
63108
- return /*#__PURE__*/(0,jsx_runtime.jsx)("tbody", {
63109
- children: (props.data || []).map(function (item, index) {
63110
- return renderRow(item, index);
63111
- })
63112
- });
63110
+ var externalDependencies = typeof_default()(props.shouldCellUpdate) === 'object' && props.shouldCellUpdate.dependencies ? props.shouldCellUpdate.dependencies : [];
63111
+ var updateFn = typeof_default()(props.shouldCellUpdate) === 'object' && 'update' in props.shouldCellUpdate ? props.shouldCellUpdate.update : props.shouldCellUpdate;
63112
+ var $tbody = useMemo(function () {
63113
+ return /*#__PURE__*/(0,jsx_runtime.jsx)("tbody", {
63114
+ children: (props.data || []).map(function (item, index) {
63115
+ return renderRow(item, index);
63116
+ })
63117
+ });
63118
+ }, [props.data, currentIndex].concat(toConsumableArray_default()(externalDependencies)), updateFn ? function (prev, next) {
63119
+ return prev.some(function (_, index) {
63120
+ if (index === 0) {
63121
+ return prev[index].some(function (item, idx) {
63122
+ return updateFn(item, next[index][idx]);
63123
+ });
63124
+ }
63125
+ return !shallowEqual(prev[index], next[index]);
63126
+ }) || !props.scrolling;
63127
+ } : undefined);
63128
+ return $tbody;
63113
63129
  });
63114
63130
  ;// CONCATENATED MODULE: ../base/src/table/tfoot.tsx
63115
63131
 
@@ -63224,6 +63240,7 @@ function TbodyEmpty(_ref) {
63224
63240
 
63225
63241
 
63226
63242
 
63243
+
63227
63244
  var table_excluded = ["data"];
63228
63245
 
63229
63246
 
@@ -63267,6 +63284,10 @@ var emptyRef = {
63267
63284
  var headMirrorScrollRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
63268
63285
  var bottomMirrorScrollRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
63269
63286
  var tableRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
63287
+ var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
63288
+ _useState2 = slicedToArray_default()(_useState, 2),
63289
+ scrolling = _useState2[0],
63290
+ setScrolling = _useState2[1];
63270
63291
  var browserScrollbarWidth = useScrollbarWidth();
63271
63292
  if (props.fixed) {
63272
63293
  table_devUseWarning.deprecated('fixed', 'virtual', 'Table');
@@ -63289,7 +63310,8 @@ var emptyRef = {
63289
63310
  };
63290
63311
  var _useRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)({
63291
63312
  emptyHeight: 0,
63292
- theadAndTfootHeight: 0
63313
+ theadAndTfootHeight: 0,
63314
+ scrollingTimer: null
63293
63315
  }),
63294
63316
  context = _useRef.current;
63295
63317
  var virtual = ((_props$data = props.data) === null || _props$data === void 0 ? void 0 : _props$data.length) && props.rowsInView !== 0 && (!!props.virtual || props.fixed === 'both' || props.fixed === 'y' || props.fixed === 'auto');
@@ -63480,6 +63502,13 @@ var emptyRef = {
63480
63502
  props.onScroll(info.x, info.y, info.scrollLeft, info.scrollTop);
63481
63503
  }
63482
63504
  syncHeaderScroll(info.scrollLeft);
63505
+ if (context.scrollingTimer) {
63506
+ clearTimeout(context.scrollingTimer);
63507
+ }
63508
+ setScrolling(true);
63509
+ context.scrollingTimer = setTimeout(function () {
63510
+ setScrolling(false);
63511
+ }, 100);
63483
63512
  });
63484
63513
  var renderEmpty = function renderEmpty() {
63485
63514
  var _props$data2;
@@ -63697,7 +63726,8 @@ var emptyRef = {
63697
63726
  children: [Group, /*#__PURE__*/(0,jsx_runtime.jsx)(tbody, objectSpread2_default()(objectSpread2_default()({}, bodyCommonProps), {}, {
63698
63727
  currentIndex: virtualInfo.startIndex,
63699
63728
  data: virtualInfo.data,
63700
- setRowHeight: virtualInfo.setRowHeight
63729
+ setRowHeight: virtualInfo.setRowHeight,
63730
+ scrolling: scrolling
63701
63731
  }))]
63702
63732
  }), showFoot ? /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
63703
63733
  className: footWrapperClass,
@@ -70171,7 +70201,7 @@ var upload_interface = __webpack_require__(8821);
70171
70201
 
70172
70202
 
70173
70203
  /* harmony default export */ var src_0 = ({
70174
- version: '3.7.0-beta.8'
70204
+ version: '3.7.0-beta.9'
70175
70205
  });
70176
70206
  }();
70177
70207
  /******/ return __webpack_exports__;