shineout 3.8.4-beta.1 → 3.8.4-beta.3

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.8.4-beta.1'
525
+ version: '3.8.4-beta.3'
526
526
  };
package/dist/shineout.js CHANGED
@@ -12386,7 +12386,7 @@ var handleStyle = function handleStyle(style) {
12386
12386
  };
12387
12387
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
12388
12388
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
12389
- /* harmony default export */ var version = ('3.8.4-beta.1');
12389
+ /* harmony default export */ var version = ('3.8.4-beta.3');
12390
12390
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
12391
12391
 
12392
12392
 
@@ -26736,8 +26736,12 @@ var tableStyle = objectSpread2_default()(objectSpread2_default()({
26736
26736
  overflow: 'hidden scroll'
26737
26737
  }, customScrollBar({
26738
26738
  background: 'transparent'
26739
- }))
26739
+ })),
26740
+ '&$overlayScrollbar$headWrapper, &$overlayScrollbar$footWrapper': {
26741
+ overflow: 'hidden'
26742
+ }
26740
26743
  },
26744
+ overlayScrollbar: {},
26741
26745
  scrollX: {
26742
26746
  '&$headWrapper, &$footWrapper': {
26743
26747
  overflowX: 'hidden'
@@ -30523,6 +30527,32 @@ function isInDocument(element) {
30523
30527
  }
30524
30528
  return is_isBrowser() && document.documentElement.contains(element);
30525
30529
  }
30530
+ function document_isScrollAble(container) {
30531
+ if (!container || !is_isBrowser()) return false;
30532
+ if (container.scrollHeight > container.clientHeight) {
30533
+ return true;
30534
+ }
30535
+ var placeholderEl = document.createElement('div');
30536
+ placeholderEl.style.height = '9999px';
30537
+ placeholderEl.style.top = '0';
30538
+ placeholderEl.style.flexShrink = '0';
30539
+ placeholderEl.style.left = '0';
30540
+ placeholderEl.style.width = '1px';
30541
+ placeholderEl.style.pointerEvents = 'none';
30542
+ container.appendChild(placeholderEl);
30543
+ var absoluteEl = document.createElement('div');
30544
+ absoluteEl.style.position = 'absolute';
30545
+ absoluteEl.style.top = '0';
30546
+ absoluteEl.style.bottom = '0';
30547
+ absoluteEl.style.left = '0';
30548
+ absoluteEl.style.width = '1px';
30549
+ absoluteEl.style.pointerEvents = 'none';
30550
+ container.appendChild(absoluteEl);
30551
+ var hasScroll = absoluteEl.clientHeight < placeholderEl.clientHeight;
30552
+ placeholderEl.remove();
30553
+ absoluteEl.remove();
30554
+ return hasScroll;
30555
+ }
30526
30556
  ;// CONCATENATED MODULE: ../hooks/src/utils/position.ts
30527
30557
 
30528
30558
  // 根据位置计算合适的 position
@@ -63117,12 +63147,11 @@ var scroll_table_Scroll = function Scroll(props) {
63117
63147
 
63118
63148
  // 非定高的Table但依旧采用了virtual渲染方式,需要渲染出全部的data
63119
63149
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useLayoutEffect)(function () {
63120
- if (!props.tableRef.current) return;
63121
- var rootTableHeight = props.tableRef.current.clientHeight;
63150
+ if (!props.tableRef.current || !props.setFakeVirtual) return;
63122
63151
  var container = containerRef.current;
63123
63152
  var isContainerVisible = (container === null || container === void 0 ? void 0 : container.offsetParent) !== null;
63124
63153
  if (!isContainerVisible) return;
63125
-
63154
+ var rootTableHeight = props.tableRef.current.clientHeight;
63126
63155
  // 判断内容滚动高度是否真的超过了容器高度
63127
63156
  var isRealScroll = (container === null || container === void 0 ? void 0 : container.scrollHeight) !== undefined && container.scrollHeight > rootTableHeight;
63128
63157
  // 判断Table的根节点dom高度是否发生变化,如果变化了,则是因为不定高,被内部元素撑高了导致的
@@ -63132,7 +63161,7 @@ var scroll_table_Scroll = function Scroll(props) {
63132
63161
  } else {
63133
63162
  context.lastTableHeight = rootTableHeight;
63134
63163
  }
63135
- }, [paddingTop]);
63164
+ }, [paddingTop, props.setFakeVirtual]);
63136
63165
  if (props.isEmpty) {
63137
63166
  return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", objectSpread2_default()(objectSpread2_default()({}, scrollRoleProps), {}, {
63138
63167
  children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
@@ -66040,12 +66069,16 @@ var emptyRef = {
66040
66069
  var tableRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
66041
66070
  var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
66042
66071
  _useState2 = slicedToArray_default()(_useState, 2),
66043
- scrolling = _useState2[0],
66044
- setScrolling = _useState2[1];
66072
+ scrollAble = _useState2[0],
66073
+ setScrollAble = _useState2[1];
66045
66074
  var _useState3 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
66046
66075
  _useState4 = slicedToArray_default()(_useState3, 2),
66047
- fakeVirtual = _useState4[0],
66048
- setFakeVirtual = _useState4[1];
66076
+ scrolling = _useState4[0],
66077
+ setScrolling = _useState4[1];
66078
+ var _useState5 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
66079
+ _useState6 = slicedToArray_default()(_useState5, 2),
66080
+ fakeVirtual = _useState6[0],
66081
+ setFakeVirtual = _useState6[1];
66049
66082
  var browserScrollbarWidth = useScrollbarWidth();
66050
66083
  if (props.fixed) {
66051
66084
  table_devUseWarning.deprecated('fixed', 'virtual', 'Table');
@@ -66074,6 +66107,14 @@ var emptyRef = {
66074
66107
  }),
66075
66108
  context = _useRef.current;
66076
66109
  var virtual = !fakeVirtual && props.rowsInView !== 0 && (!!props.virtual || props.fixed === 'both' || props.fixed === 'y' || props.fixed === 'auto');
66110
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useLayoutEffect)(function () {
66111
+ if (!virtual) return;
66112
+ if (!tableRef.current) return;
66113
+ var maxHeight = tableRef.current.style.maxHeight;
66114
+ if (!maxHeight) return;
66115
+ var isScrollAble = document_isScrollAble(tableRef.current);
66116
+ setScrollAble(isScrollAble);
66117
+ }, [virtual]);
66077
66118
 
66078
66119
  // 虚拟列表高度另外计算
66079
66120
  var _useResize = useResize({
@@ -66415,7 +66456,7 @@ var emptyRef = {
66415
66456
  }
66416
66457
  };
66417
66458
  var isRenderVirtualTable = virtual || props.sticky || !((_props$data2 = props.data) !== null && _props$data2 !== void 0 && _props$data2.length);
66418
- var headWrapperClass = classnames_default()(tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.headWrapper, !!$empty && tableClasses.emptyHeader, props.sticky && isScrollY && tableClasses.scrollY, props.sticky && !isScrollY && tableClasses.scrollX);
66459
+ var headWrapperClass = classnames_default()(tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.headWrapper, !!$empty && tableClasses.emptyHeader, props.sticky && isScrollY && tableClasses.scrollY, props.sticky && isScrollY && browserScrollbarWidth === 0 && tableClasses.overlayScrollbar, props.sticky && !isScrollY && tableClasses.scrollX);
66419
66460
  var footWrapperClass = classnames_default()(tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.footWrapper);
66420
66461
  var renderHeadMirrorScroller = function renderHeadMirrorScroller() {
66421
66462
  var _scrollRef$current2, _scrollRef$current3, _scrollRef$current4;
@@ -66527,7 +66568,7 @@ var emptyRef = {
66527
66568
  isScrollX: isScrollX,
66528
66569
  isEmpty: !!$empty,
66529
66570
  tableRef: tableRef,
66530
- setFakeVirtual: setFakeVirtual,
66571
+ setFakeVirtual: scrollAble ? undefined : setFakeVirtual,
66531
66572
  children: [!props.hideHeader && !props.sticky && $headTable, !!((_props$data3 = props.data) !== null && _props$data3 !== void 0 && _props$data3.length) && /*#__PURE__*/(0,jsx_runtime.jsxs)("table", {
66532
66573
  style: objectSpread2_default()(objectSpread2_default()({}, tableStyle), {}, {
66533
66574
  transform: virtualInfo.translateStyle
@@ -73183,7 +73224,7 @@ var upload_interface = __webpack_require__(8821);
73183
73224
 
73184
73225
 
73185
73226
  /* harmony default export */ var src_0 = ({
73186
- version: '3.8.4-beta.1'
73227
+ version: '3.8.4-beta.3'
73187
73228
  });
73188
73229
  }();
73189
73230
  /******/ return __webpack_exports__;