shineout 3.10.3-beta.4 → 3.10.3-beta.6

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
@@ -545,5 +545,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
545
545
  // 此文件由脚本自动生成,请勿直接修改。
546
546
  // This file was generated automatically by a script. Please do not modify it directly.
547
547
  var _default = exports.default = {
548
- version: '3.10.3-beta.4'
548
+ version: '3.10.3-beta.6'
549
549
  };
package/dist/shineout.js CHANGED
@@ -13736,7 +13736,7 @@ var handleStyle = function handleStyle(style) {
13736
13736
  };
13737
13737
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
13738
13738
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
13739
- /* harmony default export */ var version = ('3.10.3-beta.4');
13739
+ /* harmony default export */ var version = ('3.10.3-beta.6');
13740
13740
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
13741
13741
 
13742
13742
 
@@ -44108,6 +44108,7 @@ Tag.Input = tag_input;
44108
44108
 
44109
44109
 
44110
44110
  function getResetMore(onFilter, container, doms) {
44111
+ var restCount = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
44111
44112
  if (!container || !doms || !doms.length) return -1;
44112
44113
  var items = Array.from(doms);
44113
44114
  var style = getComputedStyle(container);
@@ -44119,6 +44120,7 @@ function getResetMore(onFilter, container, doms) {
44119
44120
  var hideEl = items.pop();
44120
44121
  var hideElStyle = getComputedStyle(hideEl);
44121
44122
  var hideMargin = parsePxToNumber(hideElStyle.marginLeft) + parsePxToNumber(hideElStyle.marginRight);
44123
+ var total = items.length + restCount;
44122
44124
  var num = 0;
44123
44125
  var sumWidth = 0;
44124
44126
  var itemWidthArr = items.map(function (item) {
@@ -44134,7 +44136,7 @@ function getResetMore(onFilter, container, doms) {
44134
44136
  for (var i = 0; i < itemWidthArr.length; i++) {
44135
44137
  var itemLen = itemWidthArr[i];
44136
44138
  // number length
44137
- var resetNum = items.length - 1 - i;
44139
+ var resetNum = total - 1 - i;
44138
44140
  var moreWidth = void 0;
44139
44141
  if (resetNum <= 0) {
44140
44142
  moreWidth = 0;
@@ -44149,7 +44151,7 @@ function getResetMore(onFilter, container, doms) {
44149
44151
  break;
44150
44152
  }
44151
44153
  num += 1;
44152
- if (i === items.length - 1) {
44154
+ if (i === total - 1) {
44153
44155
  // not show more
44154
44156
  num = -1;
44155
44157
  }
@@ -44329,11 +44331,17 @@ var result_Result = function Result(props) {
44329
44331
  _useState4 = slicedToArray_default()(_useState3, 2),
44330
44332
  shouldResetMore = _useState4[0],
44331
44333
  setShouldResetMore = _useState4[1];
44334
+ var _useState5 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(0),
44335
+ _useState6 = slicedToArray_default()(_useState5, 2),
44336
+ measureKey = _useState6[0],
44337
+ setMeasureKey = _useState6[1];
44332
44338
  var render = useRender();
44333
44339
  var resultRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
44334
44340
  var _useRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)({
44335
44341
  prevMore: more,
44336
- maxMore: 0
44342
+ maxMore: 0,
44343
+ // 估算偏小、需要渲染全部结果重新测量时的结果数量;按数量比较,值变化后的首次渲染不会沿用旧结论
44344
+ showAllLength: 0
44337
44345
  }),
44338
44346
  context = _useRef.current;
44339
44347
  var removeLock = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(false);
@@ -44532,12 +44540,16 @@ var result_Result = function Result(props) {
44532
44540
  ]);
44533
44541
  var result = renderMultipleResult.results;
44534
44542
  var moreNumber = getCompressedBound();
44543
+ // 测量折叠数量时只渲染容器可能放得下的数量(按每个 tag 至少 20px 估算),避免大量选中值时渲染全部 tag
44544
+ var measureLimit = context.maxMore + 1;
44545
+ var shouldLimitMeasure = compressed && !isCompressedBound() && !renderResultContentProp && more === -1 && context.maxMore > 0 && result_isArray(result) && result.length > Math.max(measureLimit, context.showAllLength);
44546
+ var moreData = shouldLimitMeasure ? result.slice(0, measureLimit) : result;
44535
44547
  var renderMultipleResultMore = /*#__PURE__*/(0,jsx_runtime.jsx)(result_more, {
44536
44548
  keygen: keygen,
44537
44549
  onRemove: onRemove,
44538
44550
  classes: props.classes,
44539
44551
  jssStyle: props.jssStyle,
44540
- data: result,
44552
+ data: moreData,
44541
44553
  datas: renderMultipleResult.datas,
44542
44554
  size: size,
44543
44555
  compressed: compressed,
@@ -44583,10 +44595,12 @@ var result_Result = function Result(props) {
44583
44595
  var exceedsCapacity = valueLength && valueLength > context.maxMore;
44584
44596
  if (hasExistingCompression && hasValidEstimate && exceedsCapacity && typeof requestIdleCallback !== 'undefined') {
44585
44597
  requestIdleCallback(function () {
44598
+ context.showAllLength = 0;
44586
44599
  setMore(-1);
44587
44600
  setShouldResetMore(true);
44588
44601
  });
44589
44602
  } else {
44603
+ context.showAllLength = 0;
44590
44604
  if (!renderCompressed) setMore(-1);
44591
44605
  setShouldResetMore(true);
44592
44606
  }
@@ -44660,7 +44674,16 @@ var result_Result = function Result(props) {
44660
44674
  if (shouldResetMore && more === -1 && compressed && resultRef.current && (props.value || []).length) {
44661
44675
  var tagClassName = ".".concat(styles.tag.split(' ')[0]);
44662
44676
  if (shouldResetMore && result_isArray(value) && (value || []).length) {
44663
- var newMore = getResetMore(showInput, resultRef.current, resultRef.current.querySelectorAll(tagClassName));
44677
+ var restCount = shouldLimitMeasure ? result.length - moreData.length : 0;
44678
+ var newMore = getResetMore(showInput, resultRef.current, resultRef.current.querySelectorAll(tagClassName), restCount);
44679
+ // 只渲染了部分 tag 且全部放得下,说明估算偏小,渲染全部后重新测量
44680
+ if (newMore === -1 && restCount > 0) {
44681
+ context.showAllLength = result.length;
44682
+ setMeasureKey(function (k) {
44683
+ return k + 1;
44684
+ });
44685
+ return;
44686
+ }
44664
44687
  context.prevMore = newMore;
44665
44688
  setMore(newMore);
44666
44689
  setShouldResetMore(false);
@@ -44670,7 +44693,7 @@ var result_Result = function Result(props) {
44670
44693
  } else if (shouldResetMore) {
44671
44694
  setShouldResetMore(false);
44672
44695
  }
44673
- }, [shouldResetMore]);
44696
+ }, [shouldResetMore, measureKey]);
44674
44697
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
44675
44698
  if (!resultRef.current) return;
44676
44699
  if (!compressed) return;
@@ -46691,7 +46714,8 @@ var useListSelectMultiple = function useListSelectMultiple(props) {
46691
46714
 
46692
46715
  // TODO: Object.values(props) 作为 deps 是反模式,value/prediction 等变化都会使 datum 引用失效。
46693
46716
  // 精确依赖应为 [props.data](方法均为 usePersistFn,引用稳定)。
46694
- // 待 Tbody/Tr 加 React.memo 后一起改,届时 datum 引用稳定才能真正减少 re-render。
46717
+ // 注意:Table 开启 rowMemo 时 Tbody 会做 memo,非受控勾选时 Table 的 props 不变,
46718
+ // 行的勾选状态只能靠 datum 引用变化刷新。收窄 deps 前需要先给 Tbody 提供其他刷新依据(如 value)。
46695
46719
  var func = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
46696
46720
  return {
46697
46721
  add: add,
@@ -58315,7 +58339,8 @@ var useListSelect = function useListSelect(props) {
58315
58339
  });
58316
58340
 
58317
58341
  // TODO: Object.values(props) 作为 deps 是反模式。精确依赖应为 [datum, multiple]。
58318
- // 待 Tbody/Tr 加 React.memo 后一起改。
58342
+ // 注意:Table 开启 rowMemo 时 Tbody 会做 memo,非受控勾选时行的勾选状态只能靠 result 引用变化刷新,
58343
+ // 收窄 deps 前需要先给 Tbody 提供其他刷新依据(见 use-list-select-multiple)。
58319
58344
  var result = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
58320
58345
  if (!multiple) {
58321
58346
  return objectSpread2_default()(objectSpread2_default()({}, datum), {}, {
@@ -70048,6 +70073,65 @@ function Td(props) {
70048
70073
  children: renderContent(props.col, props.data)
70049
70074
  }, col.key);
70050
70075
  }
70076
+ ;// CONCATENATED MODULE: ../base/src/table/fixed-style.ts
70077
+
70078
+
70079
+ var fixed_style_toNum = toNum;
70080
+
70081
+ // 表体固定列的 sticky 偏移以 CSS 变量的形式写在 tbody 所在的 table 上,单元格只引用变量。
70082
+ // 列宽测量、横向滚动状态变化时只需更新 table 的 style,单元格的 style 不变,行无需重渲染。
70083
+ // 每个 Table 都会在自己的 table 上重新声明变量,嵌套表格不会继承到外层的值。
70084
+ // position: sticky 必须内联:样式中 `table td { position: relative }` 的优先级高于 cellFixedRight 类名。
70085
+ // 未出现横向滚动时偏移为 auto,sticky 不会吸附,效果与原先不输出固定样式一致。
70086
+ var getLeftVar = function getLeftVar(index) {
70087
+ return "--soui-table-fixed-left-".concat(index);
70088
+ };
70089
+ // right 偏移取决于单元格的结束列(index + colSpan),按结束列声明
70090
+ var getRightVar = function getRightVar(end) {
70091
+ return "--soui-table-fixed-right-".concat(end);
70092
+ };
70093
+ var cellStyleCache = new Map();
70094
+ var getCellFixedStyle = function getCellFixedStyle(fixed, index, colSpan, columnCount, isRtl) {
70095
+ if (fixed !== 'left' && fixed !== 'right') return undefined;
70096
+ var end = Math.min(index + (colSpan || 1), columnCount);
70097
+ var varName = fixed === 'left' ? getLeftVar(index) : getRightVar(end);
70098
+ var key = "".concat(varName, "-").concat(isRtl ? 'rtl' : 'ltr');
70099
+ var style = cellStyleCache.get(key);
70100
+ if (!style) {
70101
+ var side = fixed === 'left' !== isRtl ? 'left' : 'right';
70102
+ style = defineProperty_default()({
70103
+ position: 'sticky'
70104
+ }, side, "var(".concat(varName, ")"));
70105
+ cellStyleCache.set(key, style);
70106
+ }
70107
+ return style;
70108
+ };
70109
+ var getFixedVarsStyle = function getFixedVarsStyle(columns, colgroup, isScrollX) {
70110
+ var rightStart = -1;
70111
+ var leftIndexes = [];
70112
+ columns.forEach(function (col) {
70113
+ if (col.fixed === 'left') leftIndexes.push(col.index);
70114
+ if (col.fixed === 'right' && (rightStart === -1 || col.index < rightStart)) {
70115
+ rightStart = col.index;
70116
+ }
70117
+ });
70118
+ if (!leftIndexes.length && rightStart === -1) return undefined;
70119
+ var style = {};
70120
+ var sum = function sum(start, end) {
70121
+ return colgroup.slice(start, end).reduce(function (a, b) {
70122
+ return a + fixed_style_toNum(b);
70123
+ }, 0);
70124
+ };
70125
+ leftIndexes.forEach(function (index) {
70126
+ style[getLeftVar(index)] = isScrollX ? "".concat(sum(0, index), "px") : 'auto';
70127
+ });
70128
+ if (rightStart > -1) {
70129
+ for (var end = rightStart + 1; end <= columns.length; end++) {
70130
+ style[getRightVar(end)] = isScrollX ? "".concat(sum(end, colgroup.length), "px") : 'auto';
70131
+ }
70132
+ }
70133
+ return style;
70134
+ };
70051
70135
  ;// CONCATENATED MODULE: ../base/src/table/tr.tsx
70052
70136
 
70053
70137
 
@@ -70067,8 +70151,6 @@ function Td(props) {
70067
70151
 
70068
70152
 
70069
70153
 
70070
-
70071
- var tr_toNum = toNum;
70072
70154
  var Tr = function Tr(props) {
70073
70155
  var _props$rowClassName;
70074
70156
  var treeFunc = props.treeFunc,
@@ -70078,29 +70160,9 @@ var Tr = function Tr(props) {
70078
70160
  var expandRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
70079
70161
  var config = useConfig();
70080
70162
  var isRtl = config.direction === 'rtl';
70081
- var getFixedStyle = function getFixedStyle(fixed, index, colSpan) {
70082
- if (!props.isScrollX) return;
70083
- if (fixed === 'left') {
70084
- var left = props.colgroup.slice(0, index).reduce(function (a, b) {
70085
- return tr_toNum(a) + tr_toNum(b);
70086
- }, 0);
70087
- return defineProperty_default()({
70088
- position: 'sticky'
70089
- }, isRtl ? 'right' : 'left', left);
70090
- }
70091
- if (fixed === 'right') {
70092
- var right = props.colgroup.slice(index + colSpan).reduce(function (a, b) {
70093
- return tr_toNum(a) + tr_toNum(b);
70094
- }, 0);
70095
- return defineProperty_default()({
70096
- position: 'sticky'
70097
- }, isRtl ? 'left' : 'right', right);
70098
- }
70099
- return undefined;
70100
- };
70101
70163
  var getTdStyle = function getTdStyle(column, colSpan) {
70102
- var index = column.index;
70103
- var fixedStyle = getFixedStyle(column.fixed, index, colSpan);
70164
+ // 固定列偏移引用 table 上的 CSS 变量,列宽/横向滚动状态变化时行无需重渲染
70165
+ var fixedStyle = getCellFixedStyle(column.fixed, column.index, colSpan, props.columns.length, isRtl);
70104
70166
  if (!fixedStyle && !column.style) return;
70105
70167
  return objectSpread2_default()(objectSpread2_default()({}, column.style), fixedStyle);
70106
70168
  };
@@ -70140,40 +70202,23 @@ var Tr = function Tr(props) {
70140
70202
  _useState2 = slicedToArray_default()(_useState, 2),
70141
70203
  isExpandLoading = _useState2[0],
70142
70204
  setIsExpandLoading = _useState2[1];
70143
- var innerExpandClick = usePersistFn( /*#__PURE__*/function () {
70144
- var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(showLoader) {
70145
- return regeneratorRuntime_default()().wrap(function _callee$(_context) {
70146
- while (1) switch (_context.prev = _context.next) {
70147
- case 0:
70148
- if (!(showLoader && props.loader && typeof props.loader === 'function')) {
70149
- _context.next = 11;
70150
- break;
70151
- }
70152
- setIsExpandLoading(true);
70153
- _context.prev = 2;
70154
- _context.next = 5;
70155
- return props.loader(props.rawData, props.rowIndex);
70156
- case 5:
70157
- treeFunc.handleTreeExpand(props.rawData, props.rowIndex);
70158
- case 6:
70159
- _context.prev = 6;
70160
- setIsExpandLoading(false);
70161
- return _context.finish(6);
70162
- case 9:
70163
- _context.next = 12;
70164
- break;
70165
- case 11:
70166
- treeFunc.handleTreeExpand(props.rawData, props.rowIndex);
70167
- case 12:
70168
- case "end":
70169
- return _context.stop();
70170
- }
70171
- }, _callee, null, [[2,, 6, 9]]);
70172
- }));
70173
- return function (_x) {
70174
- return _ref3.apply(this, arguments);
70175
- };
70176
- }());
70205
+
70206
+ // 不使用 async 函数:编译产物会在每次渲染时为每一行创建 regenerator 状态机,大数据量下开销可观
70207
+ var innerExpandClick = usePersistFn(function (showLoader) {
70208
+ var loader = props.loader;
70209
+ if (showLoader && loader && typeof loader === 'function') {
70210
+ setIsExpandLoading(true);
70211
+ // new Promise 包裹:loader 同步抛错或返回非 Promise 时,与原 await 写法行为一致
70212
+ return new Promise(function (resolve) {
70213
+ resolve(loader(props.rawData, props.rowIndex));
70214
+ }).then(function () {
70215
+ treeFunc.handleTreeExpand(props.rawData, props.rowIndex);
70216
+ }).finally(function () {
70217
+ setIsExpandLoading(false);
70218
+ });
70219
+ }
70220
+ treeFunc.handleTreeExpand(props.rawData, props.rowIndex);
70221
+ });
70177
70222
  var renderTreeExpand = function renderTreeExpand(content) {
70178
70223
  var treeIndent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 22;
70179
70224
  var level = props.treeExpandLevel.get(props.originKey) || 0;
@@ -70515,7 +70560,19 @@ var isTrPropsEqual = function isTrPropsEqual(prev, next) {
70515
70560
 
70516
70561
 
70517
70562
 
70518
- /* harmony default export */ var tbody = (function (props) {
70563
+ var hasExpandColumn = function hasExpandColumn(props) {
70564
+ return !!props.expandHideCol || (props.columns || []).some(function (col) {
70565
+ return col.type === 'expand' || col.type === 'row-expand';
70566
+ });
70567
+ };
70568
+
70569
+ // bodyScrollWidth / resizeFlag 在行内只用于虚拟列表上报行高;
70570
+ // 展开行渲染时会读取容器宽度下发给嵌套表格,有展开列时也需要随之重渲染。
70571
+ // 其余场景不再下发,Table 布局状态变化时 Tbody / Tr 都可以跳过渲染
70572
+ var needLayoutProps = function needLayoutProps(props) {
70573
+ return !!props.virtual || hasExpandColumn(props);
70574
+ };
70575
+ var Tbody = function Tbody(props) {
70519
70576
  var _jssStyle$table, _jssStyle$input, _jssStyle$select, _jssStyle$datePicker, _jssStyle$treeSelect, _jssStyle$switch, _jssStyle$checkbox, _jssStyle$radio, _jssStyle$cascader;
70520
70577
  var _props$columns = props.columns,
70521
70578
  columns = _props$columns === void 0 ? [] : _props$columns,
@@ -70524,6 +70581,7 @@ var isTrPropsEqual = function isTrPropsEqual(prev, next) {
70524
70581
  currentColIndex = props.currentColIndex,
70525
70582
  _props$hover = props.hover,
70526
70583
  hover = _props$hover === void 0 ? true : _props$hover;
70584
+ var passLayout = needLayoutProps(props);
70527
70585
  var _useTableExpand = use_table_expand({
70528
70586
  columns: props.columns,
70529
70587
  expandKeys: props.expandKeys,
@@ -70572,11 +70630,9 @@ var isTrPropsEqual = function isTrPropsEqual(prev, next) {
70572
70630
  originKey: originKey,
70573
70631
  row: rowData[index],
70574
70632
  columns: columns,
70575
- isScrollX: props.isScrollX,
70576
70633
  jssStyle: props.jssStyle,
70577
70634
  tableClasses: tableClasses,
70578
70635
  preventClasses: preventClasses,
70579
- colgroup: props.colgroup,
70580
70636
  rowClassName: props.rowClassName,
70581
70637
  rawData: item,
70582
70638
  rowIndex: rowIndex,
@@ -70605,9 +70661,9 @@ var isTrPropsEqual = function isTrPropsEqual(prev, next) {
70605
70661
  onRowClick: props.onRowClick,
70606
70662
  rowEvents: props.rowEvents,
70607
70663
  disabled: props.datum.disabledCheck(item),
70608
- bodyScrollWidth: props.bodyScrollWidth,
70664
+ bodyScrollWidth: passLayout ? props.bodyScrollWidth : undefined,
70609
70665
  scrollRef: props.scrollRef,
70610
- resizeFlag: props.resizeFlag,
70666
+ resizeFlag: passLayout ? props.resizeFlag : undefined,
70611
70667
  treeCheckAll: props.treeCheckAll,
70612
70668
  onCellClick: props.onCellClick,
70613
70669
  virtual: props.virtual,
@@ -70625,17 +70681,32 @@ var isTrPropsEqual = function isTrPropsEqual(prev, next) {
70625
70681
  return renderRow(item, index);
70626
70682
  })
70627
70683
  });
70628
- if (props.virtual === 'lazy') {
70629
- return useComponentMemo(function () {
70630
- return $tbody;
70631
- }, [currentRowIndex, currentColIndex, props.data], function (prev, next) {
70632
- return prev.some(function (_, index) {
70633
- return !shallow_equal_shallowEqual(prev === null || prev === void 0 ? void 0 : prev[index], next === null || next === void 0 ? void 0 : next[index]);
70634
- }) || !props.scrolling;
70635
- });
70636
- }
70637
- return $tbody;
70638
- });
70684
+
70685
+ // 未传 shouldUpdate 时直接返回最新结果,非 lazy 模式下行为与不做缓存一致
70686
+ return useComponentMemo(function () {
70687
+ return $tbody;
70688
+ }, [currentRowIndex, currentColIndex, props.data], props.virtual === 'lazy' ? function (prev, next) {
70689
+ return prev.some(function (_, index) {
70690
+ return !shallow_equal_shallowEqual(prev === null || prev === void 0 ? void 0 : prev[index], next === null || next === void 0 ? void 0 : next[index]);
70691
+ }) || !props.scrolling;
70692
+ } : undefined);
70693
+ };
70694
+
70695
+ // 语义化样式每次渲染都会生成新对象,按内容比较
70696
+ var SEM_STYLE_KEYS = ['bodyRowSemStyle', 'bodyCellSemStyle'];
70697
+ var LAYOUT_KEYS = ['bodyScrollWidth', 'resizeFlag'];
70698
+
70699
+ // 仅在开启 rowMemo 时生效,未开启时始终返回 false,行为与不做 memo 完全一致。
70700
+ // rowMemo 下 Tbody 的 props 不变时,下发给每一行的 props 也不变,行本来就会被 Tr 的 memo 跳过;
70701
+ // 在 Tbody 这层直接跳过,省去 Table 自身布局状态(列宽测量、横向滚动、滚动阴影等)变化时逐行生成元素和比较 props 的开销
70702
+ var isTbodyPropsEqual = function isTbodyPropsEqual(prev, next) {
70703
+ if (!prev.rowMemo || !next.rowMemo) return false;
70704
+ var skip = needLayoutProps(next) ? SEM_STYLE_KEYS : [].concat(SEM_STYLE_KEYS, LAYOUT_KEYS);
70705
+ return shallow_equal_shallowEqual(prev, next, {
70706
+ skip: skip
70707
+ }) && shallow_equal_shallowEqual(prev.bodyRowSemStyle, next.bodyRowSemStyle) && shallow_equal_shallowEqual(prev.bodyCellSemStyle, next.bodyCellSemStyle);
70708
+ };
70709
+ /* harmony default export */ var tbody = (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().memo(Tbody, isTbodyPropsEqual));
70639
70710
  ;// CONCATENATED MODULE: ../base/src/table/tfoot.tsx
70640
70711
 
70641
70712
 
@@ -70776,6 +70847,7 @@ var table_excluded = ["data"];
70776
70847
 
70777
70848
 
70778
70849
 
70850
+
70779
70851
 
70780
70852
  var table_devUseWarning = devUseWarning;
70781
70853
  var table_emptyArr = [];
@@ -71132,6 +71204,10 @@ function Table(props) {
71132
71204
  tableLayout: 'fixed'
71133
71205
  };
71134
71206
  }, [width]);
71207
+ // 表体所在的 table 额外声明固定列偏移的 CSS 变量,单元格只引用变量
71208
+ var bodyTableStyle = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
71209
+ return objectSpread2_default()(objectSpread2_default()({}, tableStyle), getFixedVarsStyle(columns, colgroup, isScrollX));
71210
+ }, [tableStyle, columns, colgroup, isScrollX]);
71135
71211
  var renderTable = function renderTable() {
71136
71212
  var _props$summary, _sticky$top, _props$data2;
71137
71213
  var Group = /*#__PURE__*/(0,jsx_runtime.jsx)(table_colgroup, {
@@ -71149,8 +71225,6 @@ function Table(props) {
71149
71225
  data: treeData,
71150
71226
  treeExpandLevel: treeExpandLevel,
71151
71227
  treeFunc: treeFunc,
71152
- colgroup: colgroup,
71153
- isScrollX: isScrollX,
71154
71228
  expandHideCol: expandHideCol,
71155
71229
  keygen: props.keygen,
71156
71230
  rowClassName: props.rowClassName,
@@ -71358,7 +71432,7 @@ function Table(props) {
71358
71432
  },
71359
71433
  children: $headTable
71360
71434
  }), !!((_props$data3 = props.data) !== null && _props$data3 !== void 0 && _props$data3.length) && /*#__PURE__*/(0,jsx_runtime.jsxs)("table", {
71361
- style: objectSpread2_default()(objectSpread2_default()({}, tableStyle), {}, {
71435
+ style: objectSpread2_default()(objectSpread2_default()({}, bodyTableStyle), {}, {
71362
71436
  transform: virtualInfo.translateStyle
71363
71437
  }),
71364
71438
  ref: tbodyRef,
@@ -71388,7 +71462,7 @@ function Table(props) {
71388
71462
  className: tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.bodyWrapper,
71389
71463
  onScroll: handleBodyScroll,
71390
71464
  children: /*#__PURE__*/(0,jsx_runtime.jsxs)("table", {
71391
- style: tableStyle,
71465
+ style: bodyTableStyle,
71392
71466
  ref: tbodyRef,
71393
71467
  children: [Group, /*#__PURE__*/(0,jsx_runtime.jsx)(tbody, objectSpread2_default()({}, bodyCommonProps)), showFoot && /*#__PURE__*/(0,jsx_runtime.jsx)(tfoot, objectSpread2_default()({}, footCommonProps))]
71394
71468
  })
@@ -71419,7 +71493,7 @@ function Table(props) {
71419
71493
  tableRef: tableRef,
71420
71494
  setFakeVirtual: scrollAble ? undefined : setFakeVirtual,
71421
71495
  children: [!props.hideHeader && !props.sticky && $headTable, !!((_props$data5 = props.data) !== null && _props$data5 !== void 0 && _props$data5.length) && /*#__PURE__*/(0,jsx_runtime.jsxs)("table", {
71422
- style: objectSpread2_default()(objectSpread2_default()({}, tableStyle), {}, {
71496
+ style: objectSpread2_default()(objectSpread2_default()({}, bodyTableStyle), {}, {
71423
71497
  transform: virtualInfo.translateStyle
71424
71498
  }),
71425
71499
  ref: tbodyRef,
@@ -71450,7 +71524,7 @@ function Table(props) {
71450
71524
  className: tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.bodyWrapper,
71451
71525
  onScroll: handleBodyScroll,
71452
71526
  children: /*#__PURE__*/(0,jsx_runtime.jsxs)("table", {
71453
- style: objectSpread2_default()({}, tableStyle),
71527
+ style: bodyTableStyle,
71454
71528
  ref: tbodyRef,
71455
71529
  children: [Group, !props.hideHeader && /*#__PURE__*/(0,jsx_runtime.jsx)(thead, objectSpread2_default()({}, headCommonProps)), bodyCommonProps.data.length === 0 ? /*#__PURE__*/(0,jsx_runtime.jsx)(TbodyEmpty, {
71456
71530
  columns: columns,
@@ -80292,7 +80366,7 @@ var watermark_interface = __webpack_require__(6640);
80292
80366
 
80293
80367
 
80294
80368
  /* harmony default export */ var src_0 = ({
80295
- version: '3.10.3-beta.4'
80369
+ version: '3.10.3-beta.6'
80296
80370
  });
80297
80371
  }();
80298
80372
  /******/ return __webpack_exports__;