shineout 3.7.0-beta.3 → 3.7.0-beta.4

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.3'
517
+ version: '3.7.0-beta.4'
518
518
  };
package/dist/shineout.js CHANGED
@@ -12142,7 +12142,7 @@ var handleStyle = function handleStyle(style) {
12142
12142
  };
12143
12143
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
12144
12144
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
12145
- /* harmony default export */ var version = ('3.7.0-beta.3');
12145
+ /* harmony default export */ var version = ('3.7.0-beta.4');
12146
12146
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
12147
12147
 
12148
12148
 
@@ -25527,19 +25527,9 @@ var switchStyle = objectSpread2_default()(objectSpread2_default()({
25527
25527
  var useSwitchStyle = styled(src_switch_switch, 'switch');
25528
25528
 
25529
25529
  /* harmony default export */ var shineout_style_src_switch = ((/* unused pure expression or super */ null && (useSwitchStyle)));
25530
- ;// CONCATENATED MODULE: ../shineout-style/src/mixin/custom-scrollbar.ts
25531
- function customScrollBar(info) {
25532
- return {
25533
- 'scrollbar-color': info.background,
25534
- '&::-webkit-scrollbar': {
25535
- background: info.background
25536
- }
25537
- };
25538
- }
25539
25530
  ;// CONCATENATED MODULE: ../shineout-style/src/table/table.ts
25540
25531
 
25541
25532
 
25542
-
25543
25533
  var cellBaseIndex = 4;
25544
25534
  var fixedIndex = 6;
25545
25535
  var resizeIndex = 8;
@@ -25734,13 +25724,22 @@ var tableStyle = objectSpread2_default()(objectSpread2_default()({
25734
25724
  zIndex: fixedIndex + 1
25735
25725
  }
25736
25726
  }
25727
+ },
25728
+ '$wrapper & table > tfoot': {
25729
+ position: 'sticky',
25730
+ bottom: 0,
25731
+ zIndex: fixedIndex
25737
25732
  }
25738
25733
  },
25739
25734
  footWrapper: {
25740
25735
  flex: '0 0 auto',
25741
- // overflow: 'hidden',
25742
25736
  boxSizing: 'border-box',
25743
- background: src.tableTfootBackgroundColor
25737
+ background: src.tableTfootBackgroundColor,
25738
+ "[data-soui-role='scroll'] &": {
25739
+ position: 'sticky',
25740
+ bottom: 0,
25741
+ zIndex: fixedIndex + 1
25742
+ }
25744
25743
  },
25745
25744
  emptyWrapper: {
25746
25745
  minHeight: '170px',
@@ -25749,18 +25748,13 @@ var tableStyle = objectSpread2_default()(objectSpread2_default()({
25749
25748
  position: 'sticky',
25750
25749
  left: 0,
25751
25750
  top: 0,
25752
- right: 0,
25753
25751
  justifyContent: 'center',
25754
25752
  display: 'flex',
25755
25753
  alignItems: 'center',
25756
25754
  borderBottom: "1px solid ".concat(src.tableCellBorderColor)
25757
25755
  },
25758
- scrollY: {
25759
- '&$headWrapper, &$footWrapper': objectSpread2_default()({
25760
- overflowY: 'scroll'
25761
- }, customScrollBar({
25762
- background: 'transparent'
25763
- }))
25756
+ emptyNoBorder: {
25757
+ borderBottom: 'none'
25764
25758
  },
25765
25759
  cellFixedLeft: {
25766
25760
  position: 'sticky'
@@ -49694,12 +49688,10 @@ var useForm = function useForm(props) {
49694
49688
  context.removeArr.delete(n);
49695
49689
  if (df !== undefined && deepGet(context.value, n) === undefined) {
49696
49690
  if (!context.mounted) context.defaultValues[n] = df;
49697
- setTimeout(function () {
49698
- onChange(function (v) {
49699
- deepSet(v, n, df, deepSetOptions);
49700
- });
49701
- update(n);
49691
+ onChange(function (v) {
49692
+ deepSet(v, n, df, deepSetOptions);
49702
49693
  });
49694
+ update(n);
49703
49695
  }
49704
49696
  },
49705
49697
  unbind: function unbind(n, reserveAble, validateField, update) {
@@ -59964,6 +59956,12 @@ var Sticky = function Sticky(props) {
59964
59956
  }
59965
59957
  return cancelParentObserver;
59966
59958
  }, [props.parent, css, context.target, top, bottom]);
59959
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
59960
+ if (props.onChange) {
59961
+ props.onChange(show);
59962
+ }
59963
+ ;
59964
+ }, [show]);
59967
59965
 
59968
59966
  // 纯css方法 直接使用css
59969
59967
  // js方法
@@ -60134,6 +60132,147 @@ var BaseSwitch = function BaseSwitch(props) {
60134
60132
  var SwitchComp = src_switch_switch_0;
60135
60133
  SwitchComp.displayName = 'ShineoutSwitch';
60136
60134
  /* harmony default export */ var src_switch_0 = (SwitchComp);
60135
+ ;// CONCATENATED MODULE: ../base/src/virtual-scroll/scroll-table.tsx
60136
+
60137
+
60138
+
60139
+
60140
+
60141
+
60142
+ var extractHeightValue = function extractHeightValue(num) {
60143
+ if (isNumber(num)) return num;
60144
+ var match = num.match(/(\d+)/);
60145
+ if (match) {
60146
+ return parseInt(match[0], 10);
60147
+ }
60148
+ return undefined;
60149
+ };
60150
+ var scroll_table_Scroll = function Scroll(props) {
60151
+ var containerRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
60152
+ var scrollRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
60153
+ var wrapperRef = useForkRef(scrollRef, props.wrapperRef);
60154
+ var _useRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)({
60155
+ timer: null,
60156
+ isMouseDown: false
60157
+ }),
60158
+ context = _useRef.current;
60159
+ // TODO: keepScrollTop考虑做成Table的新feat?
60160
+ var _props$scrollHeight = props.scrollHeight,
60161
+ scrollHeight = _props$scrollHeight === void 0 ? 0 : _props$scrollHeight,
60162
+ _props$scrollWidth = props.scrollWidth,
60163
+ scrollWidth = _props$scrollWidth === void 0 ? 0 : _props$scrollWidth,
60164
+ _props$defaultHeight = props.defaultHeight,
60165
+ defaultHeight = _props$defaultHeight === void 0 ? 0 : _props$defaultHeight,
60166
+ _props$keepScrollTop = props.keepScrollTop,
60167
+ keepScrollTop = _props$keepScrollTop === void 0 ? false : _props$keepScrollTop;
60168
+ var _useResize = useResize({
60169
+ targetRef: containerRef,
60170
+ timer: 100
60171
+ }),
60172
+ width = _useResize.width,
60173
+ h = _useResize.height;
60174
+ var height = h || defaultHeight;
60175
+ var config = useConfig();
60176
+ var isRtl = config.direction === 'rtl';
60177
+ var scrollerStyle = {
60178
+ flex: 1,
60179
+ minWidth: 0,
60180
+ minHeight: 0,
60181
+ overflow: props.isEmptyContent ? 'hidden' : 'auto',
60182
+ width: '100%'
60183
+ };
60184
+ var containerStyle = {
60185
+ height: '100%',
60186
+ width: '100%',
60187
+ display: 'flex',
60188
+ position: 'sticky',
60189
+ flexDirection: 'column',
60190
+ top: 0,
60191
+ overflow: props.isEmptyContent ? 'auto' : undefined
60192
+ };
60193
+
60194
+ // 当滚动容器的高度为 0 时,paddingTop 为 0,避免滚动条抖动现象
60195
+ var paddingTop = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
60196
+ if (keepScrollTop) return Math.max(0, Math.floor(scrollHeight - height));
60197
+ return height === 0 ? 0 : Math.max(0, Math.floor(scrollHeight - height));
60198
+ }, [scrollHeight, height]);
60199
+ var placeStyle = {
60200
+ paddingTop: paddingTop,
60201
+ width: scrollWidth,
60202
+ overflow: props.isScrollY ? 'hidden' : 'auto hidden',
60203
+ height: props.isScrollY ? 0 : 1,
60204
+ marginTop: props.isScrollY ? 0 : -1,
60205
+ lineHeight: 0
60206
+ };
60207
+ var handleScroll = usePersistFn(function (e) {
60208
+ var onScrollToBottom = props.onScrollToBottom;
60209
+ var target = e.currentTarget;
60210
+ var scrollLeft = target.scrollLeft,
60211
+ scrollTop = target.scrollTop;
60212
+ if (props.height && onScrollToBottom) {
60213
+ var realHeight = extractHeightValue(props.height);
60214
+ if (realHeight !== undefined) {
60215
+ var touchBottom = target.scrollHeight === scrollTop + realHeight;
60216
+ if (touchBottom) onScrollToBottom();
60217
+ }
60218
+ }
60219
+ var maxY = target.scrollHeight - target.clientHeight;
60220
+ var maxX = target.scrollWidth - target.clientWidth;
60221
+ if (!isRtl) {
60222
+ // 解决浏览器缩放以后导致滚动条长度出现小数
60223
+ if (maxX - scrollLeft < 0 || maxX - scrollLeft < 1) scrollLeft = maxX;
60224
+ if (scrollLeft < 0) scrollLeft = 0;
60225
+ } else {
60226
+ if (maxX + scrollLeft < 0 || maxX + scrollLeft < 1) scrollLeft = 0 - maxX;
60227
+ if (scrollLeft > 0) scrollLeft = 0;
60228
+ }
60229
+ if (scrollTop > maxY || maxY - scrollTop < 1) scrollTop = maxY;
60230
+ if (scrollTop < 0) scrollTop = 0;
60231
+ var x = maxX === 0 ? 0 : Math.min(Math.abs(scrollLeft) / maxX, 1);
60232
+ var y = maxY === 0 ? 0 : Math.min(scrollTop / maxY, 1);
60233
+ if (props.onScroll) props.onScroll({
60234
+ scrollLeft: scrollLeft,
60235
+ scrollTop: scrollTop,
60236
+ x: x,
60237
+ y: y,
60238
+ height: height,
60239
+ width: width,
60240
+ fromDrag: context.isMouseDown
60241
+ });
60242
+ });
60243
+ var handleInnerScroll = usePersistFn(function (e) {
60244
+ var scrollTop = e.currentTarget.scrollTop;
60245
+ if (scrollRef.current) {
60246
+ e.currentTarget.scrollTop = 0;
60247
+ scrollRef.current.scrollTop += scrollTop;
60248
+ }
60249
+ });
60250
+ return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", objectSpread2_default()(objectSpread2_default()({}, getDataAttribute({
60251
+ role: 'scroll'
60252
+ })), {}, {
60253
+ style: scrollerStyle,
60254
+ onScroll: handleScroll,
60255
+ ref: wrapperRef,
60256
+ onMouseDown: function onMouseDown() {
60257
+ context.isMouseDown = true;
60258
+ },
60259
+ onMouseUp: function onMouseUp() {
60260
+ context.isMouseDown = false;
60261
+ },
60262
+ children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", objectSpread2_default()(objectSpread2_default()({}, getDataAttribute({
60263
+ role: 'scroll-container'
60264
+ })), {}, {
60265
+ style: containerStyle,
60266
+ ref: containerRef,
60267
+ onScroll: handleInnerScroll,
60268
+ children: props.children
60269
+ })), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
60270
+ style: placeStyle,
60271
+ children: "\xA0"
60272
+ })]
60273
+ }));
60274
+ };
60275
+ /* harmony default export */ var scroll_table = (scroll_table_Scroll);
60137
60276
  ;// CONCATENATED MODULE: ../hooks/src/common/use-scrollbar-width/index.ts
60138
60277
 
60139
60278
 
@@ -60264,6 +60403,34 @@ var useColumns = function useColumns(props) {
60264
60403
 
60265
60404
 
60266
60405
 
60406
+ function getDecimalAndIntegerPart(num) {
60407
+ if (!num) return [0, 0];
60408
+ var str = num.toString();
60409
+ var dotIndex = str.indexOf('.');
60410
+ if (dotIndex === -1) return [parseInt(str), 0];
60411
+ var integerPart = parseInt(str.slice(0, dotIndex));
60412
+ var decimalPart = parseFloat("0.".concat(str.slice(dotIndex + 1)));
60413
+ return [integerPart, decimalPart];
60414
+ }
60415
+
60416
+ // 将所有的小数部分转移到最后一列
60417
+ function shiftDecimalToLastColumn(cols) {
60418
+ var decimalSum = 0;
60419
+ cols.forEach(function (v, i) {
60420
+ var _getDecimalAndInteger = getDecimalAndIntegerPart(v),
60421
+ _getDecimalAndInteger2 = slicedToArray_default()(_getDecimalAndInteger, 2),
60422
+ inter = _getDecimalAndInteger2[0],
60423
+ decimal = _getDecimalAndInteger2[1];
60424
+ if (decimal > 0) {
60425
+ decimalSum += decimal;
60426
+ cols[i] = inter;
60427
+ }
60428
+ });
60429
+ if (decimalSum > 0) {
60430
+ cols[cols.length - 1] = Number(cols[cols.length - 1]) + decimalSum;
60431
+ }
60432
+ return cols;
60433
+ }
60267
60434
  var MIN_RESIZABLE_WIDTH = 20;
60268
60435
  function compareColumnWidth(curCols, preCols) {
60269
60436
  if (curCols.length !== preCols.length) return false;
@@ -60385,7 +60552,7 @@ var useTableLayout = function useTableLayout(props) {
60385
60552
  if (cols && cols.every(function (v) {
60386
60553
  return v === 0;
60387
60554
  })) return;
60388
- setColgroup(cols);
60555
+ setColgroup(shiftDecimalToLastColumn(cols));
60389
60556
  setAdjust(adjust);
60390
60557
  if (!adjust) {
60391
60558
  updateResizeFlag();
@@ -60970,7 +61137,7 @@ var useTableVirtual = function useTableVirtual(props) {
60970
61137
  for (var i = 0; i <= index; i++) {
60971
61138
  sum += context.cachedHeight[i] || props.rowHeight;
60972
61139
  }
60973
- return sum;
61140
+ return sum + props.theadAndTfootHeight;
60974
61141
  };
60975
61142
  var setRowHeight = usePersistFn(function (index, height) {
60976
61143
  if (props.disabled) return;
@@ -61190,7 +61357,7 @@ var useTableVirtual = function useTableVirtual(props) {
61190
61357
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
61191
61358
  if (props.disabled) return;
61192
61359
  setHeight(getContentHeight(props.data.length - 1));
61193
- }, [props.data.length]);
61360
+ }, [props.data.length, props.theadAndTfootHeight]);
61194
61361
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
61195
61362
  if (props.disabled) return;
61196
61363
  if (context.heightCallback) {
@@ -61964,13 +62131,17 @@ var thead_toNum = toNum;
61964
62131
  });
61965
62132
  };
61966
62133
  var getFixedStyle = function getFixedStyle(fixed, index, colSpan, level) {
62134
+ // 累加level 至 0 的所有高度
62135
+ var top = context.trHeights.slice(0, level).reduce(function (a, b) {
62136
+ return thead_toNum(a) + thead_toNum(b);
62137
+ }, 0);
61967
62138
  if (fixed === 'left') {
61968
62139
  var left = colgroup.slice(0, index).reduce(function (a, b) {
61969
62140
  return thead_toNum(a) + thead_toNum(b);
61970
62141
  }, 0);
61971
62142
  return {
61972
62143
  left: left,
61973
- top: context.trHeights[level - 1] || 0,
62144
+ top: top,
61974
62145
  position: 'sticky'
61975
62146
  };
61976
62147
  }
@@ -61980,12 +62151,12 @@ var thead_toNum = toNum;
61980
62151
  }, 0);
61981
62152
  return {
61982
62153
  right: right,
61983
- top: context.trHeights[level - 1] || 0,
62154
+ top: top,
61984
62155
  position: 'sticky'
61985
62156
  };
61986
62157
  }
61987
62158
  return {
61988
- top: context.trHeights[level - 1] || 0,
62159
+ top: top,
61989
62160
  position: 'sticky'
61990
62161
  };
61991
62162
  };
@@ -62202,16 +62373,6 @@ var useTableRow = function useTableRow(props) {
62202
62373
  }
62203
62374
  setHoverIndex(hoverIndex);
62204
62375
  });
62205
- var isCellHover = usePersistFn(function (rowIndex) {
62206
- var colSpan = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
62207
- if (!props.hover) return false;
62208
- var isHover = false;
62209
- for (var i = 0; i < colSpan; i++) {
62210
- isHover = hoverIndex.has(rowIndex + i);
62211
- if (isHover) break;
62212
- }
62213
- return isHover;
62214
- });
62215
62376
  var rowData = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
62216
62377
  var rows = [];
62217
62378
  context.rowSelectMergeStartData = [];
@@ -62245,7 +62406,6 @@ var useTableRow = function useTableRow(props) {
62245
62406
  return {
62246
62407
  rowData: rowData,
62247
62408
  handleCellHover: handleCellHover,
62248
- isCellHover: isCellHover,
62249
62409
  hoverIndex: hoverIndex,
62250
62410
  rowSelectMergeStartData: context.rowSelectMergeStartData
62251
62411
  };
@@ -62565,18 +62725,28 @@ var Tr = function Tr(props) {
62565
62725
  if (data[i]) {
62566
62726
  var last = cols[i + (data[i].colSpan || 1) - 1] || {};
62567
62727
  var isRowSpanTd = data[i].rowSpan > 1;
62728
+ var shouldBindMouseEvent = props.hover && hasSiblingRowSpan || isRowSpanTd;
62729
+ var showCellHover = props.hoverIndex.has(props.rowIndex);
62730
+ if (!showCellHover && data[i].rowSpan > 1) {
62731
+ for (var j = 0; j < data[i].rowSpan; j++) {
62732
+ if (props.hoverIndex.has(props.rowIndex + j)) {
62733
+ showCellHover = true;
62734
+ break;
62735
+ }
62736
+ }
62737
+ }
62568
62738
  var td = /*#__PURE__*/(0,jsx_runtime.jsx)(Td, {
62569
62739
  col: col,
62570
62740
  data: data[i].data,
62571
62741
  colSpan: data[i].colSpan,
62572
62742
  rowSpan: data[i].rowSpan,
62573
- onMouseEnter: props.hover && hasSiblingRowSpan || isRowSpanTd ? function () {
62574
- props.handleCellHover(props.rowIndex, data[i].rowSpan);
62743
+ onMouseEnter: shouldBindMouseEvent ? function () {
62744
+ return props.handleCellHover(props.rowIndex, data[i].rowSpan);
62575
62745
  } : undefined,
62576
- onMouseLeave: props.hover && hasSiblingRowSpan || isRowSpanTd ? function () {
62577
- props.handleCellHover(-1, 0);
62746
+ onMouseLeave: shouldBindMouseEvent ? function () {
62747
+ return props.handleCellHover(-1, 0);
62578
62748
  } : undefined,
62579
- className: classnames_default()(col.className, col.type === 'checkbox' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellCheckbox), col.fixed === 'left' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellFixedLeft), col.fixed === 'right' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellFixedRight), col.align === 'center' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellAlignCenter), col.align === 'right' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellAlignRight), (col.lastFixed || col.firstFixed || last.lastFixed) && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellFixedLast), lastRowIndex === i && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellIgnoreBorder), props.hoverIndex.has(props.rowIndex) && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellHover), isRowSpanTd && props.isCellHover(props.rowIndex, data[i].rowSpan) && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellHover)),
62749
+ className: classnames_default()(col.className, col.type === 'checkbox' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellCheckbox), col.fixed === 'left' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellFixedLeft), col.fixed === 'right' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellFixedRight), col.align === 'center' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellAlignCenter), col.align === 'right' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellAlignRight), (col.lastFixed || col.firstFixed || last.lastFixed) && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellFixedLast), lastRowIndex === i && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellIgnoreBorder), showCellHover && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellHover)),
62580
62750
  style: getTdStyle(col, data[i].colSpan),
62581
62751
  direction: config.direction,
62582
62752
  "data-role": col.type === 'checkbox' ? 'checkbox' : undefined,
@@ -62703,7 +62873,6 @@ var Tr = function Tr(props) {
62703
62873
  hover: hover
62704
62874
  }),
62705
62875
  rowData = _useTableRow.rowData,
62706
- isCellHover = _useTableRow.isCellHover,
62707
62876
  handleCellHover = _useTableRow.handleCellHover,
62708
62877
  hoverIndex = _useTableRow.hoverIndex,
62709
62878
  rowSelectMergeStartData = _useTableRow.rowSelectMergeStartData;
@@ -62740,7 +62909,6 @@ var Tr = function Tr(props) {
62740
62909
  setRowHeight: props.setRowHeight,
62741
62910
  striped: props.striped,
62742
62911
  radio: props.radio,
62743
- isCellHover: isCellHover,
62744
62912
  hover: hover,
62745
62913
  isSelect: props.datum.check(rowSelectMergeStartData[index]),
62746
62914
  handleCellHover: handleCellHover
@@ -62897,19 +63065,6 @@ var table_excluded = ["data"];
62897
63065
 
62898
63066
  var table_devUseWarning = devUseWarning;
62899
63067
  var table_emptyArr = [];
62900
- var virtualScrollerStyle = {
62901
- flex: 1,
62902
- minWidth: 0,
62903
- minHeight: 0,
62904
- overflow: 'auto',
62905
- width: '100%'
62906
- };
62907
- var scrollWrapperStyle = {
62908
- flex: 1,
62909
- minHeight: 0,
62910
- minWidth: 0,
62911
- display: 'flex'
62912
- };
62913
63068
  var emptyRef = {
62914
63069
  current: null
62915
63070
  };
@@ -62931,15 +63086,6 @@ var emptyRef = {
62931
63086
  var mirrorScrollRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
62932
63087
  var tableRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
62933
63088
  var browserScrollbarWidth = useScrollbarWidth();
62934
- var emptyStyle = objectSpread2_default()(objectSpread2_default()({}, virtualScrollerStyle), {}, {
62935
- overflow: 'auto hidden',
62936
- position: 'absolute',
62937
- zIndex: 1,
62938
- bottom: 0,
62939
- left: 0,
62940
- right: 0,
62941
- height: browserScrollbarWidth
62942
- });
62943
63089
  if (props.fixed) {
62944
63090
  table_devUseWarning.deprecated('fixed', 'virtual', 'Table');
62945
63091
  }
@@ -62960,7 +63106,8 @@ var emptyRef = {
62960
63106
  };
62961
63107
  };
62962
63108
  var _useRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)({
62963
- emptyHeight: 0
63109
+ emptyHeight: 0,
63110
+ theadAndTfootHeight: 0
62964
63111
  }),
62965
63112
  context = _useRef.current;
62966
63113
  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');
@@ -63092,6 +63239,10 @@ var emptyRef = {
63092
63239
  onChange: inputableData.onChange,
63093
63240
  disabled: props.disabled
63094
63241
  });
63242
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
63243
+ var _theadRef$current, _tfootRef$current;
63244
+ context.theadAndTfootHeight = ((theadRef === null || theadRef === void 0 || (_theadRef$current = theadRef.current) === null || _theadRef$current === void 0 ? void 0 : _theadRef$current.clientHeight) || 0) + (((_tfootRef$current = tfootRef.current) === null || _tfootRef$current === void 0 ? void 0 : _tfootRef$current.clientHeight) || 0);
63245
+ }, [theadRef.current, tfootRef.current]);
63095
63246
  var virtualInfo = use_table_virtual({
63096
63247
  disabled: !virtual,
63097
63248
  data: treeData,
@@ -63102,8 +63253,11 @@ var emptyRef = {
63102
63253
  scrollRef: scrollRef,
63103
63254
  innerRef: tbodyRef,
63104
63255
  scrollLeft: props.scrollLeft,
63105
- isRtl: isRtl
63256
+ isRtl: isRtl,
63257
+ theadAndTfootHeight: context.theadAndTfootHeight
63106
63258
  });
63259
+
63260
+ // 简单表格的滚动事件
63107
63261
  var handleBodyScroll = usePersistFn(function (e) {
63108
63262
  var target = e.currentTarget;
63109
63263
  if (!target) return;
@@ -63119,6 +63273,8 @@ var emptyRef = {
63119
63273
  props.onScroll(x, y, target.scrollLeft, target.scrollTop);
63120
63274
  }
63121
63275
  });
63276
+
63277
+ // 虚拟表格的滚动事件
63122
63278
  var handleVirtualScroll = usePersistFn(function (info) {
63123
63279
  virtualInfo.handleScroll(info);
63124
63280
  layoutFunc.checkFloat();
@@ -63133,7 +63289,7 @@ var emptyRef = {
63133
63289
  var _props$data2;
63134
63290
  if (!((_props$data2 = props.data) !== null && _props$data2 !== void 0 && _props$data2.length) || filteredData !== undefined && filteredData.length === 0) {
63135
63291
  return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
63136
- className: tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.emptyWrapper,
63292
+ className: classnames_default()(tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.emptyWrapper, isScrollX && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.emptyNoBorder)),
63137
63293
  ref: function ref(el) {
63138
63294
  context.emptyHeight = (el === null || el === void 0 ? void 0 : el.clientHeight) || 0;
63139
63295
  },
@@ -63223,9 +63379,8 @@ var emptyRef = {
63223
63379
  parent: tableRef === null || tableRef === void 0 ? void 0 : tableRef.current
63224
63380
  };
63225
63381
  var isRenderVirtualTable = virtual || props.sticky || !((_props$data3 = props.data) !== null && _props$data3 !== void 0 && _props$data3.length);
63226
- var headWrapperClass = classnames_default()(tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.headWrapper // isScrollY && scrollBarWidth && tableClasses?.scrollY,
63227
- );
63228
- var footWrapperClass = classnames_default()(tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.footWrapper, isScrollY && scrollBarWidth && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.scrollY));
63382
+ var headWrapperClass = classnames_default()(tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.headWrapper);
63383
+ var footWrapperClass = classnames_default()(tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.footWrapper);
63229
63384
  var renderHeadMirrorScroller = function renderHeadMirrorScroller() {
63230
63385
  var _scrollRef$current, _scrollRef$current2, _scrollRef$current3;
63231
63386
  if (!props.showTopScrollbar) return null;
@@ -63263,17 +63418,16 @@ var emptyRef = {
63263
63418
  }));
63264
63419
  };
63265
63420
  if (isRenderVirtualTable) {
63266
- var _props$data4;
63421
+ var _props$data4, _props$data5;
63267
63422
  return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
63268
- children: [renderHeadMirrorScroller(), /*#__PURE__*/(0,jsx_runtime.jsxs)(virtual_scroll_scroll, {
63269
- style: scrollWrapperStyle,
63270
- scrollerStyle: (_props$data4 = props.data) !== null && _props$data4 !== void 0 && _props$data4.length ? virtualScrollerStyle : emptyStyle,
63423
+ children: [renderHeadMirrorScroller(), /*#__PURE__*/(0,jsx_runtime.jsxs)(scroll_table, {
63271
63424
  wrapperRef: scrollRef,
63272
63425
  scrollWidth: width || 1,
63273
63426
  scrollHeight: virtual ? virtualInfo.scrollHeight : tbodyHeight,
63274
63427
  onScroll: handleVirtualScroll,
63275
63428
  defaultHeight: context.emptyHeight,
63276
63429
  isScrollY: isScrollY,
63430
+ isEmptyContent: !((_props$data4 = props.data) !== null && _props$data4 !== void 0 && _props$data4.length),
63277
63431
  children: [!props.hideHeader && /*#__PURE__*/(0,jsx_runtime.jsx)(StickyWrapper, objectSpread2_default()(objectSpread2_default()({}, props.sticky ? stickyProps : {}), {}, {
63278
63432
  children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
63279
63433
  className: headWrapperClass,
@@ -63285,7 +63439,7 @@ var emptyRef = {
63285
63439
  children: [Group, /*#__PURE__*/(0,jsx_runtime.jsx)(thead, objectSpread2_default()({}, headCommonProps))]
63286
63440
  })
63287
63441
  })
63288
- })), /*#__PURE__*/(0,jsx_runtime.jsxs)("table", {
63442
+ })), !!((_props$data5 = props.data) !== null && _props$data5 !== void 0 && _props$data5.length) && /*#__PURE__*/(0,jsx_runtime.jsxs)("table", {
63289
63443
  style: {
63290
63444
  width: width,
63291
63445
  transform: virtualInfo.getTranslate()
@@ -63305,8 +63459,8 @@ var emptyRef = {
63305
63459
  ref: tfootRef,
63306
63460
  children: [Group, /*#__PURE__*/(0,jsx_runtime.jsx)(tfoot, objectSpread2_default()({}, footCommonProps))]
63307
63461
  })
63308
- }) : null]
63309
- }), renderEmpty()]
63462
+ }) : null, renderEmpty()]
63463
+ })]
63310
63464
  });
63311
63465
  }
63312
63466
  return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
@@ -69718,7 +69872,7 @@ var upload_interface = __webpack_require__(8821);
69718
69872
 
69719
69873
 
69720
69874
  /* harmony default export */ var src_0 = ({
69721
- version: '3.7.0-beta.3'
69875
+ version: '3.7.0-beta.4'
69722
69876
  });
69723
69877
  }();
69724
69878
  /******/ return __webpack_exports__;