shineout 3.9.6-beta.7 → 3.9.6-beta.8

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.6-beta.7'
525
+ version: '3.9.6-beta.8'
526
526
  };
package/dist/shineout.js CHANGED
@@ -12401,7 +12401,7 @@ var handleStyle = function handleStyle(style) {
12401
12401
  };
12402
12402
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
12403
12403
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
12404
- /* harmony default export */ var version = ('3.9.6-beta.7');
12404
+ /* harmony default export */ var version = ('3.9.6-beta.8');
12405
12405
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
12406
12406
 
12407
12407
 
@@ -66895,28 +66895,48 @@ var useTableRow = function useTableRow(props) {
66895
66895
  var checkCol = columns.find(function (col) {
66896
66896
  return col.type === 'checkbox';
66897
66897
  });
66898
- for (var i = data.length - 1; i >= 0; i--) {
66899
- var d = data[i];
66900
- rows.unshift(use_table_row_format(columns, d, rows[0], currentIndex + i).map(function (col) {
66901
- delete col.content;
66902
- return col;
66903
- }));
66904
- {
66905
- //记录合并行合并到的数据需要从0 开始
66906
- var i0 = data.length - 1 - i;
66907
- var d0 = data[i0];
66908
- context.rowSelectMergeStartData[i0] = d0;
66909
- if (i0 > 0 && checkCol && typeof checkCol.rowSpan === 'function') {
66910
- var beforeData = data[i0 - 1];
66911
- if (beforeData !== null && checkCol.rowSpan(beforeData, d0)) {
66912
- var _context$rowSelectMer;
66913
- context.rowSelectMergeStartData[i0] = (_context$rowSelectMer = context.rowSelectMergeStartData[i0 - 1]) !== null && _context$rowSelectMer !== void 0 ? _context$rowSelectMer : beforeData;
66898
+
66899
+ // 计算 rowSelectMergeStartData
66900
+ if (checkCol !== null && checkCol !== void 0 && checkCol.rowSpan) {
66901
+ // checkbox 列有 rowSpan,需要计算合并起始数据
66902
+ if (props.rowSpanIndexArray && props.originData) {
66903
+ // 虚拟滚动:使用 rowSpanIndexArray(由 useTableVirtual 预计算)
66904
+ var originData = props.originData;
66905
+ for (var i = 0; i < data.length; i++) {
66906
+ var globalIndex = currentIndex + i;
66907
+ var startIndex = props.rowSpanIndexArray[globalIndex];
66908
+ context.rowSelectMergeStartData[i] = originData[startIndex] || data[i];
66909
+ }
66910
+ } else {
66911
+ // 非虚拟滚动:基于当前数据计算
66912
+ for (var _i = 0; _i < data.length; _i++) {
66913
+ var currentData = data[_i];
66914
+ // 如果当前行还没有被设置起始数据,说明它是一个新的合并组的起始
66915
+ if (context.rowSelectMergeStartData[_i] === undefined) {
66916
+ context.rowSelectMergeStartData[_i] = currentData;
66917
+ }
66918
+ // 检查当前行是否应该和下一行合并
66919
+ if (_i < data.length - 1 && checkCol.rowSpan(currentData, data[_i + 1])) {
66920
+ // 下一行应该指向当前行的起始数据
66921
+ context.rowSelectMergeStartData[_i + 1] = context.rowSelectMergeStartData[_i];
66914
66922
  }
66915
66923
  }
66916
66924
  }
66925
+ } else {
66926
+ // checkbox 列无 rowSpan,每行都是自己的起始数据
66927
+ for (var _i2 = 0; _i2 < data.length; _i2++) {
66928
+ context.rowSelectMergeStartData[_i2] = data[_i2];
66929
+ }
66930
+ }
66931
+ for (var _i3 = data.length - 1; _i3 >= 0; _i3--) {
66932
+ var d = data[_i3];
66933
+ rows.unshift(use_table_row_format(columns, d, rows[0], currentIndex + _i3).map(function (col) {
66934
+ delete col.content;
66935
+ return col;
66936
+ }));
66917
66937
  }
66918
66938
  return rows;
66919
- }, [props.columns, props.data]);
66939
+ }, [props.columns, props.data, props.originData, props.rowSpanIndexArray, currentIndex]);
66920
66940
  return {
66921
66941
  rowData: rowData,
66922
66942
  handleCellHover: handleCellHover,
@@ -67161,7 +67181,8 @@ var Tr = function Tr(props) {
67161
67181
  return expandInstance;
67162
67182
  }
67163
67183
  if (col.type === 'checkbox') {
67164
- var selectData = props.selectData || data;
67184
+ // 对于合并行,使用合并起始数据进行选择操作
67185
+ var selectData = props.rowSelectMergeStartData || data;
67165
67186
  var instance = /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
67166
67187
  className: tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.iconWrapper,
67167
67188
  children: props.radio ? /*#__PURE__*/(0,jsx_runtime.jsx)(base_src_radio_radio, {
@@ -67379,7 +67400,9 @@ var Tr = function Tr(props) {
67379
67400
  columns: props.columns,
67380
67401
  data: props.data,
67381
67402
  currentIndex: currentRowIndex,
67382
- hover: hover
67403
+ hover: hover,
67404
+ originData: props.originData,
67405
+ rowSpanIndexArray: props.rowSpanIndexArray
67383
67406
  }),
67384
67407
  rowData = _useTableRow.rowData,
67385
67408
  handleCellHover = _useTableRow.handleCellHover,
@@ -67393,17 +67416,6 @@ var Tr = function Tr(props) {
67393
67416
  var rowIndex = index + currentRowIndex;
67394
67417
  var originKey = getKey(props.keygen, item, rowIndex);
67395
67418
  var trRenderKey = props.loader || (_props$rowEvents = props.rowEvents) !== null && _props$rowEvents !== void 0 && _props$rowEvents.draggable ? originKey : "".concat(originKey, "-").concat(rowIndex);
67396
-
67397
- // 在虚拟列表模式下,使用 virtualRowSpanInfo 来获取正确的选择数据
67398
- var selectData = item;
67399
- if (props.virtualRowSpanInfo && props.fullData) {
67400
- // rowSpanIndexArray[rowIndex] 表示第 rowIndex 行所属合并组的起始行索引
67401
- var selectIndex = props.virtualRowSpanInfo.rowSpanIndexArray[rowIndex];
67402
- selectData = props.fullData[selectIndex];
67403
- } else {
67404
- // 非虚拟列表模式使用原有逻辑
67405
- selectData = rowSelectMergeStartData[index];
67406
- }
67407
67419
  return /*#__PURE__*/(0,jsx_runtime.jsx)(tr, {
67408
67420
  originKey: originKey,
67409
67421
  row: rowData[index],
@@ -67431,11 +67443,9 @@ var Tr = function Tr(props) {
67431
67443
  striped: props.striped,
67432
67444
  radio: props.radio,
67433
67445
  hover: hover,
67434
- isSelect: props.datum.check(selectData),
67435
- selectData: selectData,
67436
- handleCellHover: handleCellHover
67437
- // to update
67438
- ,
67446
+ isSelect: props.datum.check(rowSelectMergeStartData[index]),
67447
+ rowSelectMergeStartData: rowSelectMergeStartData[index],
67448
+ handleCellHover: handleCellHover,
67439
67449
  hoverIndex: hoverIndex,
67440
67450
  rowClickAttr: props.rowClickAttr,
67441
67451
  onRowClick: props.onRowClick,
@@ -68137,7 +68147,7 @@ function Table(props) {
68137
68147
  })
68138
68148
  }));
68139
68149
  if (isRenderVirtualTable) {
68140
- var _props$data3;
68150
+ var _props$data3, _virtualInfo$rowSpanI;
68141
68151
  var showStickyHeader = !props.hideHeader && props.sticky;
68142
68152
  return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
68143
68153
  children: [renderHeadMirrorScroller(), showStickyHeader && /*#__PURE__*/(0,jsx_runtime.jsx)(StickyWrapper, objectSpread2_default()(objectSpread2_default()({}, stickyProps), {}, {
@@ -68168,10 +68178,10 @@ function Table(props) {
68168
68178
  currentRowIndex: virtualInfo.startIndex,
68169
68179
  currentColIndex: currentColIndex,
68170
68180
  data: virtualInfo.data,
68181
+ originData: treeData,
68182
+ rowSpanIndexArray: (_virtualInfo$rowSpanI = virtualInfo.rowSpanInfo) === null || _virtualInfo$rowSpanI === void 0 ? void 0 : _virtualInfo$rowSpanI.rowSpanIndexArray,
68171
68183
  setRowHeight: virtualInfo.setRowHeight,
68172
- scrolling: scrolling,
68173
- virtualRowSpanInfo: virtualInfo.rowSpanInfo,
68174
- fullData: treeData
68184
+ scrolling: scrolling
68175
68185
  }))]
68176
68186
  }), showFoot ? /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
68177
68187
  className: footWrapperClass,
@@ -74845,7 +74855,7 @@ var upload_interface = __webpack_require__(8821);
74845
74855
 
74846
74856
 
74847
74857
  /* harmony default export */ var src_0 = ({
74848
- version: '3.9.6-beta.7'
74858
+ version: '3.9.6-beta.8'
74849
74859
  });
74850
74860
  }();
74851
74861
  /******/ return __webpack_exports__;