shineout 3.8.2-beta.5 → 3.8.2-beta.7

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.2-beta.5'
525
+ version: '3.8.2-beta.7'
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.2-beta.5');
12389
+ /* harmony default export */ var version = ('3.8.2-beta.7');
12390
12390
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
12391
12391
 
12392
12392
 
@@ -62913,8 +62913,7 @@ var scroll_table_Scroll = function Scroll(props) {
62913
62913
  var wrapperRef = useForkRef(scrollRef, props.wrapperRef);
62914
62914
  var _useRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)({
62915
62915
  isMouseDown: false,
62916
- lastTableHeight: 0,
62917
- unmounted: false
62916
+ lastTableHeight: 0
62918
62917
  }),
62919
62918
  context = _useRef.current;
62920
62919
  var _props$scrollHeight = props.scrollHeight,
@@ -63023,9 +63022,12 @@ var scroll_table_Scroll = function Scroll(props) {
63023
63022
 
63024
63023
  // 非定高的Table但依旧采用了virtual渲染方式,需要渲染出全部的data
63025
63024
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useLayoutEffect)(function () {
63026
- if (!props.tableRef.current || context.unmounted) return;
63025
+ if (!props.tableRef.current) return;
63027
63026
  var rootTableHeight = props.tableRef.current.clientHeight;
63028
63027
  var container = containerRef.current;
63028
+ var isContainerVisible = (container === null || container === void 0 ? void 0 : container.offsetParent) !== null;
63029
+ if (!isContainerVisible) return;
63030
+
63029
63031
  // 判断内容滚动高度是否真的超过了容器高度
63030
63032
  var isRealScroll = (container === null || container === void 0 ? void 0 : container.scrollHeight) !== undefined && container.scrollHeight > rootTableHeight;
63031
63033
  // 判断Table的根节点dom高度是否发生变化,如果变化了,则是因为不定高,被内部元素撑高了导致的
@@ -63035,9 +63037,6 @@ var scroll_table_Scroll = function Scroll(props) {
63035
63037
  } else {
63036
63038
  context.lastTableHeight = rootTableHeight;
63037
63039
  }
63038
- return function () {
63039
- context.unmounted = true;
63040
- };
63041
63040
  }, [paddingTop]);
63042
63041
  if (props.isEmpty) {
63043
63042
  return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", objectSpread2_default()(objectSpread2_default()({}, scrollRoleProps), {}, {
@@ -66359,11 +66358,12 @@ var emptyRef = {
66359
66358
  }));
66360
66359
  };
66361
66360
  var renderBottomMirrorScroller = function renderBottomMirrorScroller() {
66362
- var _scrollRef$current5, _scrollRef$current6, _scrollRef$current7;
66361
+ var _scrollRef$current5, _scrollRef$current6, _scrollRef$current7, _scrollRef$current8, _scrollRef$current9;
66363
66362
  if (!props.showBottomScrollbar) return null;
66364
66363
  var scrollRefWidth = (scrollRef === null || scrollRef === void 0 || (_scrollRef$current5 = scrollRef.current) === null || _scrollRef$current5 === void 0 ? void 0 : _scrollRef$current5.clientWidth) || 0;
66365
66364
  var scrollRefScrollWidth = (scrollRef === null || scrollRef === void 0 || (_scrollRef$current6 = scrollRef.current) === null || _scrollRef$current6 === void 0 ? void 0 : _scrollRef$current6.scrollWidth) || 0;
66366
- var mirrorScrollRefWidth = scrollRefWidth + scrollBarWidth;
66365
+ var hasVerticalScroll = ((scrollRef === null || scrollRef === void 0 || (_scrollRef$current7 = scrollRef.current) === null || _scrollRef$current7 === void 0 ? void 0 : _scrollRef$current7.scrollHeight) || 0) > ((scrollRef === null || scrollRef === void 0 || (_scrollRef$current8 = scrollRef.current) === null || _scrollRef$current8 === void 0 ? void 0 : _scrollRef$current8.clientHeight) || 0);
66366
+ var mirrorScrollRefWidth = scrollRefWidth + (hasVerticalScroll ? 0 : scrollBarWidth);
66367
66367
  var showScroll = scrollRefScrollWidth > scrollRefWidth;
66368
66368
  // 开启了双滚,但是没有滚动条,不显示
66369
66369
  if (!scrollRefWidth || !mirrorScrollRefWidth || !showScroll) return null;
@@ -66371,7 +66371,8 @@ var emptyRef = {
66371
66371
  var scrollerStickyProps = {
66372
66372
  bottom: options.bottom || 0,
66373
66373
  zIndex: options.zIndex || defaultZIndex + 1,
66374
- parent: tableRef === null || tableRef === void 0 ? void 0 : tableRef.current
66374
+ parent: tableRef === null || tableRef === void 0 ? void 0 : tableRef.current,
66375
+ scrollContainer: options.scrollContainer
66375
66376
  };
66376
66377
  return /*#__PURE__*/(0,jsx_runtime.jsx)(src_sticky_sticky, objectSpread2_default()(objectSpread2_default()({}, scrollerStickyProps), {}, {
66377
66378
  children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
@@ -66390,7 +66391,7 @@ var emptyRef = {
66390
66391
  ref: bottomMirrorScrollRef,
66391
66392
  children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
66392
66393
  style: {
66393
- width: scrollRef === null || scrollRef === void 0 || (_scrollRef$current7 = scrollRef.current) === null || _scrollRef$current7 === void 0 ? void 0 : _scrollRef$current7.scrollWidth,
66394
+ width: scrollRef === null || scrollRef === void 0 || (_scrollRef$current9 = scrollRef.current) === null || _scrollRef$current9 === void 0 ? void 0 : _scrollRef$current9.scrollWidth,
66394
66395
  height: 1
66395
66396
  }
66396
66397
  })
@@ -66505,10 +66506,10 @@ var emptyRef = {
66505
66506
  theadRef.current.parentElement.scrollLeft = left;
66506
66507
  });
66507
66508
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
66508
- var _scrollRef$current8;
66509
+ var _scrollRef$current10;
66509
66510
  if (!props.sticky || !scrollRef.current || !isScrollX) return;
66510
66511
  // sticky场景下,从空数据到有数据切换时,同步一次滚动条的位置
66511
- syncHeaderScroll(((_scrollRef$current8 = scrollRef.current) === null || _scrollRef$current8 === void 0 ? void 0 : _scrollRef$current8.scrollLeft) || 0);
66512
+ syncHeaderScroll(((_scrollRef$current10 = scrollRef.current) === null || _scrollRef$current10 === void 0 ? void 0 : _scrollRef$current10.scrollLeft) || 0);
66512
66513
  }, [isScrollX, props.sticky, $empty]);
66513
66514
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
66514
66515
  // 绑定 wheel 事件
@@ -73086,7 +73087,7 @@ var upload_interface = __webpack_require__(8821);
73086
73087
 
73087
73088
 
73088
73089
  /* harmony default export */ var src_0 = ({
73089
- version: '3.8.2-beta.5'
73090
+ version: '3.8.2-beta.7'
73090
73091
  });
73091
73092
  }();
73092
73093
  /******/ return __webpack_exports__;