@mw-kit/mw-ui 1.7.76 → 1.7.77
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/dist/index.js +12 -9
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +12 -9
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -653,14 +653,18 @@ var AbsoluteContainer = React__default.forwardRef(function (props, fowardedRef)
|
|
|
653
653
|
setRef = _useState[1];
|
|
654
654
|
|
|
655
655
|
var getPosition = useCallback(function () {
|
|
656
|
+
if (props.position) return props.position;
|
|
656
657
|
if (!ref) return null;
|
|
657
658
|
|
|
658
|
-
var _ref = boundRef ? {
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
659
|
+
var _ref = boundRef ? function () {
|
|
660
|
+
var rect = boundRef.getBoundingClientRect();
|
|
661
|
+
return {
|
|
662
|
+
offsetTop: rect.top,
|
|
663
|
+
offsetLeft: rect.left,
|
|
664
|
+
width: boundRef.offsetWidth,
|
|
665
|
+
height: boundRef.offsetHeight
|
|
666
|
+
};
|
|
667
|
+
}() : {
|
|
664
668
|
offsetTop: 0,
|
|
665
669
|
offsetLeft: 0,
|
|
666
670
|
width: window.innerWidth,
|
|
@@ -691,9 +695,9 @@ var AbsoluteContainer = React__default.forwardRef(function (props, fowardedRef)
|
|
|
691
695
|
|
|
692
696
|
return _newPosition;
|
|
693
697
|
}
|
|
694
|
-
}, [ref, boundRef]);
|
|
698
|
+
}, [ref, boundRef, props.position]);
|
|
695
699
|
|
|
696
|
-
var _useState2 = useState(
|
|
700
|
+
var _useState2 = useState(getPosition),
|
|
697
701
|
position = _useState2[0],
|
|
698
702
|
setPosition = _useState2[1];
|
|
699
703
|
|
|
@@ -701,7 +705,6 @@ var AbsoluteContainer = React__default.forwardRef(function (props, fowardedRef)
|
|
|
701
705
|
return ref;
|
|
702
706
|
});
|
|
703
707
|
useEffect(function () {
|
|
704
|
-
if (props.position) return;
|
|
705
708
|
setPosition(getPosition);
|
|
706
709
|
}, [getPosition]);
|
|
707
710
|
var htmlProps = filterObject(props, ['center', 'position', 'children', 'content']);
|