shineout 3.7.0-beta.13 → 3.7.0-beta.14

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.13'
517
+ version: '3.7.0-beta.14'
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.13');
12220
+ /* harmony default export */ var version = ('3.7.0-beta.14');
12221
12221
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
12222
12222
 
12223
12223
 
@@ -62723,7 +62723,7 @@ var useTableRow = function useTableRow(props) {
62723
62723
  /* harmony default export */ var use_table_row = (useTableRow);
62724
62724
  ;// CONCATENATED MODULE: ../hooks/src/common/use-component-memo/use-memo.ts
62725
62725
 
62726
- function useMemo(getValue, condition, shouldUpdate) {
62726
+ function useComponentMemo(getValue, condition, shouldUpdate) {
62727
62727
  var cacheRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef({});
62728
62728
  if (!shouldUpdate) return getValue();
62729
62729
  if (!('value' in cacheRef.current) || shouldUpdate(cacheRef.current.condition, condition)) {
@@ -62737,8 +62737,6 @@ function useMemo(getValue, condition, shouldUpdate) {
62737
62737
 
62738
62738
 
62739
62739
 
62740
-
62741
-
62742
62740
  function Td(props) {
62743
62741
  var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useState(),
62744
62742
  _React$useState2 = slicedToArray_default()(_React$useState, 2),
@@ -62762,9 +62760,7 @@ function Td(props) {
62762
62760
  onMouseEnter = props.onMouseEnter,
62763
62761
  onMouseLeave = props.onMouseLeave,
62764
62762
  renderContent = props.renderContent;
62765
- var externalDependencies = typeof_default()(props.shouldCellUpdate) === 'object' && props.shouldCellUpdate.dependencies ? props.shouldCellUpdate.dependencies : [];
62766
- var updateFn = typeof_default()(props.shouldCellUpdate) === 'object' && 'update' in props.shouldCellUpdate ? props.shouldCellUpdate.update : props.shouldCellUpdate;
62767
- var $td = useMemo(function () {
62763
+ var $td = useComponentMemo(function () {
62768
62764
  var content = renderContent(props.col, props.data);
62769
62765
  return /*#__PURE__*/(0,jsx_runtime.jsx)("td", {
62770
62766
  colSpan: colSpan,
@@ -62778,16 +62774,13 @@ function Td(props) {
62778
62774
  onClick: onClick,
62779
62775
  children: content
62780
62776
  }, col.key);
62781
- }, [data, className, style, col.type, col.treeColumnsName].concat(toConsumableArray_default()(externalDependencies)), updateFn ? function (prev, next) {
62777
+ }, [data, className, style, col.type, col.treeColumnsName], props.virtual === 'lazy' ? function (prev, next) {
62782
62778
  if (col.type || col.treeColumnsName) {
62783
62779
  return true;
62784
62780
  }
62785
62781
  return prev.some(function (_, index) {
62786
- if (index === 0) {
62787
- return updateFn(prev[index], next[index]);
62788
- }
62789
- return !shallowEqual(prev[index], next[index]);
62790
- });
62782
+ return !shallowEqual(prev === null || prev === void 0 ? void 0 : prev[index], next === null || next === void 0 ? void 0 : next[index]);
62783
+ }) || !props.scrolling;
62791
62784
  } : undefined);
62792
62785
  return $td;
62793
62786
  }
@@ -63075,8 +63068,9 @@ var Tr = function Tr(props) {
63075
63068
  onClick: props.onCellClick ? function () {
63076
63069
  return handleCellClick(data[i].data, i);
63077
63070
  } : undefined,
63078
- shouldCellUpdate: col.shouldCellUpdate || props.shouldCellUpdate,
63079
- renderContent: renderContent
63071
+ renderContent: renderContent,
63072
+ virtual: props.virtual,
63073
+ scrolling: props.scrolling
63080
63074
  }, "".concat(col.key, "-").concat(props.rowIndex, "-").concat(i));
63081
63075
  tds.push(td);
63082
63076
  if (data[i].colSpan) skip = data[i].colSpan - 1;
@@ -63174,8 +63168,6 @@ var Tr = function Tr(props) {
63174
63168
 
63175
63169
 
63176
63170
 
63177
-
63178
-
63179
63171
  /* harmony default export */ var tbody = (function (props) {
63180
63172
  var _props$columns = props.columns,
63181
63173
  columns = _props$columns === void 0 ? [] : _props$columns,
@@ -63248,25 +63240,19 @@ var Tr = function Tr(props) {
63248
63240
  resizeFlag: props.resizeFlag,
63249
63241
  treeCheckAll: props.treeCheckAll,
63250
63242
  onCellClick: props.onCellClick,
63251
- shouldCellUpdate: props.shouldCellUpdate
63243
+ virtual: props.virtual,
63244
+ scrolling: props.scrolling
63252
63245
  }, trRenderKey);
63253
63246
  };
63254
- var externalDependencies = typeof_default()(props.shouldCellUpdate) === 'object' && props.shouldCellUpdate.dependencies ? props.shouldCellUpdate.dependencies : [];
63255
- var updateFn = typeof_default()(props.shouldCellUpdate) === 'object' && 'update' in props.shouldCellUpdate ? props.shouldCellUpdate.update : props.shouldCellUpdate;
63256
- var $tbody = useMemo(function () {
63247
+ var $tbody = useComponentMemo(function () {
63257
63248
  return /*#__PURE__*/(0,jsx_runtime.jsx)("tbody", {
63258
63249
  children: (props.data || []).map(function (item, index) {
63259
63250
  return renderRow(item, index);
63260
63251
  })
63261
63252
  });
63262
- }, [props.data, currentIndex].concat(toConsumableArray_default()(externalDependencies)), updateFn || props.virtual ? function (prev, next) {
63253
+ }, [props.data, currentIndex], props.virtual === 'lazy' ? function (prev, next) {
63263
63254
  return prev.some(function (_, index) {
63264
- if (updateFn && index === 0) {
63265
- return prev[index].some(function (item, idx) {
63266
- return updateFn(item, next[index][idx]);
63267
- });
63268
- }
63269
- return !shallowEqual(prev[index], next[index]);
63255
+ return !shallowEqual(prev === null || prev === void 0 ? void 0 : prev[index], next === null || next === void 0 ? void 0 : next[index]);
63270
63256
  }) || !props.scrolling;
63271
63257
  } : undefined);
63272
63258
  return $tbody;
@@ -63711,8 +63697,7 @@ var emptyRef = {
63711
63697
  bodyScrollWidth: scrollWidth,
63712
63698
  resizeFlag: resizeFlag,
63713
63699
  treeCheckAll: props.treeCheckAll,
63714
- onCellClick: props.onCellClick,
63715
- shouldCellUpdate: props.shouldCellUpdate
63700
+ onCellClick: props.onCellClick
63716
63701
  };
63717
63702
  var headCommonProps = {
63718
63703
  disabled: props.disabled,
@@ -70377,7 +70362,7 @@ var upload_interface = __webpack_require__(8821);
70377
70362
 
70378
70363
 
70379
70364
  /* harmony default export */ var src_0 = ({
70380
- version: '3.7.0-beta.13'
70365
+ version: '3.7.0-beta.14'
70381
70366
  });
70382
70367
  }();
70383
70368
  /******/ return __webpack_exports__;