shineout 3.7.4-beta.1 → 3.7.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.7.4-beta.1'
525
+ version: '3.7.4-beta.3'
526
526
  };
package/dist/shineout.js CHANGED
@@ -12234,7 +12234,7 @@ var handleStyle = function handleStyle(style) {
12234
12234
  };
12235
12235
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
12236
12236
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
12237
- /* harmony default export */ var version = ('3.7.4-beta.1');
12237
+ /* harmony default export */ var version = ('3.7.4-beta.3');
12238
12238
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
12239
12239
 
12240
12240
 
@@ -30845,14 +30845,14 @@ var useCheckElementBorderWidth = function useCheckElementBorderWidth(elementRef)
30845
30845
 
30846
30846
  // 获取指定方向上的border宽度之和
30847
30847
  var getBorderWidth = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(function () {
30848
- if (elementRef.current) {
30848
+ if (elementRef.current && options.enable) {
30849
30849
  var _options$direction = options.direction,
30850
30850
  direction = _options$direction === void 0 ? 'horizontal' : _options$direction;
30851
30851
  var style = window.getComputedStyle(elementRef.current);
30852
30852
  var _borderWidth = direction === 'horizontal' ? parseFloat(style.borderLeftWidth) + parseFloat(style.borderRightWidth) : parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth);
30853
30853
  setBorderWidth(_borderWidth);
30854
30854
  }
30855
- }, [elementRef]);
30855
+ }, [elementRef, options.enable]);
30856
30856
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
30857
30857
  getBorderWidth();
30858
30858
  }, [getBorderWidth]);
@@ -31100,7 +31100,8 @@ var usePositionStyle = function usePositionStyle(config) {
31100
31100
  enable: show && adjust
31101
31101
  });
31102
31102
  var parentElBorderWidth = useCheckElementBorderWidth(parentElRef, {
31103
- direction: 'horizontal'
31103
+ direction: 'horizontal',
31104
+ enable: show
31104
31105
  });
31105
31106
  var popupElSize = useCheckElementSize(popupElRef, {
31106
31107
  enable: show
@@ -31279,16 +31280,18 @@ var usePositionStyle = function usePositionStyle(config) {
31279
31280
  };
31280
31281
  };
31281
31282
  var getAbsoluteStyle = function getAbsoluteStyle(position) {
31282
- var _scrollElRef$current;
31283
+ var _scrollElRef$current, _scrollElRef$current2, _scrollElRef$current3;
31283
31284
  if (!parentElRef.current) return {
31284
31285
  style: hideStyle
31285
31286
  };
31286
31287
  var rect = context.parentRect;
31287
31288
  var needCheck = !show || !shallow_equal(context.prevParentPosition, parentElNewPosition);
31288
- if (needCheck && scrollElRef !== null && scrollElRef !== void 0 && scrollElRef.current && (_scrollElRef$current = scrollElRef.current) !== null && _scrollElRef$current !== void 0 && _scrollElRef$current.contains(parentElRef.current)) {
31289
- var _scrollElRef$current2;
31290
- var visibleRect = ((_scrollElRef$current2 = scrollElRef.current) === null || _scrollElRef$current2 === void 0 ? void 0 : _scrollElRef$current2.getBoundingClientRect()) || {};
31291
- if (rect.bottom < visibleRect.top || rect.top > visibleRect.bottom || rect.right < visibleRect.left || rect.left > visibleRect.right) {
31289
+ var scrollTop = (scrollElRef === null || scrollElRef === void 0 || (_scrollElRef$current = scrollElRef.current) === null || _scrollElRef$current === void 0 ? void 0 : _scrollElRef$current.scrollTop) || 0;
31290
+ var scrollLeft = (scrollElRef === null || scrollElRef === void 0 || (_scrollElRef$current2 = scrollElRef.current) === null || _scrollElRef$current2 === void 0 ? void 0 : _scrollElRef$current2.scrollLeft) || 0;
31291
+ if (needCheck && scrollElRef !== null && scrollElRef !== void 0 && scrollElRef.current && (_scrollElRef$current3 = scrollElRef.current) !== null && _scrollElRef$current3 !== void 0 && _scrollElRef$current3.contains(parentElRef.current)) {
31292
+ var _scrollElRef$current4;
31293
+ var visibleRect = ((_scrollElRef$current4 = scrollElRef.current) === null || _scrollElRef$current4 === void 0 ? void 0 : _scrollElRef$current4.getBoundingClientRect()) || {};
31294
+ if (rect.bottom < visibleRect.top || rect.top > visibleRect.bottom + scrollTop || rect.right < visibleRect.left || rect.left > visibleRect.right + scrollLeft) {
31292
31295
  return {
31293
31296
  style: hideStyle
31294
31297
  };
@@ -32043,12 +32046,12 @@ var AbsoluteList = function AbsoluteList(props) {
32043
32046
  return scrollElRefProp || scrollElRefContext || closestScrollContainerRef;
32044
32047
  }, [scrollElRefProp, scrollElRefContext]);
32045
32048
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
32046
- if (scrollElRefProp || scrollElRefContext) return;
32049
+ if (scrollElRefProp || scrollElRefContext || !focus) return;
32047
32050
  var closestScrollContainer = getClosestScrollContainer(parentElRef.current);
32048
32051
  if (closestScrollContainer) {
32049
32052
  closestScrollContainerRef.current = closestScrollContainer;
32050
32053
  }
32051
- }, [parentElRef, scrollElRefProp, scrollElRefContext]);
32054
+ }, [parentElRef, scrollElRefProp, scrollElRefContext, focus]);
32052
32055
  var _usePositionStyle = usePositionStyle({
32053
32056
  getContainer: getRoot,
32054
32057
  position: position,
@@ -71617,7 +71620,7 @@ var upload_interface = __webpack_require__(8821);
71617
71620
 
71618
71621
 
71619
71622
  /* harmony default export */ var src_0 = ({
71620
- version: '3.7.4-beta.1'
71623
+ version: '3.7.4-beta.3'
71621
71624
  });
71622
71625
  }();
71623
71626
  /******/ return __webpack_exports__;