shineout 3.4.2-beta.6 → 3.4.2

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
@@ -492,5 +492,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
492
492
  // 此文件由脚本自动生成,请勿直接修改。
493
493
  // This file was generated automatically by a script. Please do not modify it directly.
494
494
  var _default = exports.default = {
495
- version: '3.4.2-beta.6'
495
+ version: '3.4.2'
496
496
  };
package/dist/shineout.js CHANGED
@@ -11991,7 +11991,7 @@ var handleStyle = function handleStyle(style) {
11991
11991
  };
11992
11992
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
11993
11993
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
11994
- /* harmony default export */ var version = ('3.4.2-beta.6');
11994
+ /* harmony default export */ var version = ('3.4.2');
11995
11995
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
11996
11996
 
11997
11997
 
@@ -59438,24 +59438,42 @@ var TabsHeader = function TabsHeader(props) {
59438
59438
  var single = isRtl && !isVertical ? -1 : 1;
59439
59439
  setTransform(delta + headerRef.current.clientWidth * single);
59440
59440
  };
59441
- var renderHeaderScrollBar = function renderHeaderScrollBar() {
59441
+ var _useState3 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)({
59442
+ offsetTop: 0,
59443
+ offsetLeft: 0
59444
+ }),
59445
+ _useState4 = slicedToArray_default()(_useState3, 2),
59446
+ currentTabOffset = _useState4[0],
59447
+ setCurrentTabOffset = _useState4[1];
59448
+ var _useState5 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(null),
59449
+ _useState6 = slicedToArray_default()(_useState5, 2),
59450
+ currentTabRect = _useState6[0],
59451
+ setCurrentTabRect = _useState6[1];
59452
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
59442
59453
  var _currentTab$getBoundi;
59443
59454
  if (shape !== 'line' && shape !== 'dash') return;
59444
59455
  var currentTab = tabRef.current[active];
59445
- if (!currentTab) return;
59456
+ setCurrentTabOffset({
59457
+ offsetTop: (currentTab === null || currentTab === void 0 ? void 0 : currentTab.offsetTop) || 0,
59458
+ offsetLeft: (currentTab === null || currentTab === void 0 ? void 0 : currentTab.offsetLeft) || 0
59459
+ });
59446
59460
  var currentTabRect = currentTab === null || currentTab === void 0 || (_currentTab$getBoundi = currentTab.getBoundingClientRect) === null || _currentTab$getBoundi === void 0 ? void 0 : _currentTab$getBoundi.call(currentTab);
59461
+ setCurrentTabRect(currentTabRect);
59462
+ }, [active]);
59463
+ var renderHeaderScrollBar = function renderHeaderScrollBar() {
59464
+ if (shape !== 'line' && shape !== 'dash') return;
59447
59465
  if (!currentTabRect) return;
59448
59466
  var scrollBarStyle = isVertical ? {
59449
59467
  right: getPosition !== null && getPosition !== void 0 && getPosition.startsWith('left') ? 0 : 'auto',
59450
59468
  left: getPosition !== null && getPosition !== void 0 && getPosition.startsWith('right') ? 0 : 'auto',
59451
- top: currentTab.offsetTop + currentTabRect.height / 2,
59469
+ top: currentTabOffset.offsetTop + currentTabRect.height / 2,
59452
59470
  height: shape === 'line' ? currentTabRect.height : 24,
59453
59471
  width: 2,
59454
59472
  transform: 'translateY(-50%)'
59455
59473
  } : {
59456
59474
  bottom: getPosition !== null && getPosition !== void 0 && getPosition.startsWith('top') ? 0 : 'auto',
59457
59475
  top: getPosition !== null && getPosition !== void 0 && getPosition.startsWith('bottom') ? 0 : 'auto',
59458
- left: currentTab.offsetLeft + currentTabRect.width / 2,
59476
+ left: currentTabOffset.offsetLeft + currentTabRect.width / 2,
59459
59477
  width: shape === 'line' ? currentTabRect.width : 24,
59460
59478
  height: 2,
59461
59479
  transform: 'translateX(-50%)'
@@ -65102,7 +65120,7 @@ var upload_interface = __webpack_require__(8821);
65102
65120
 
65103
65121
 
65104
65122
  /* harmony default export */ var src_0 = ({
65105
- version: '3.4.2-beta.6'
65123
+ version: '3.4.2'
65106
65124
  });
65107
65125
  }();
65108
65126
  /******/ return __webpack_exports__;