x-ui-design 0.9.62 → 0.9.64
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/esm/types/components/Popover/Popover.d.ts +1 -1
- package/dist/esm/types/hooks/usePopupPosition.d.ts +2 -1
- package/dist/esm/types/types/popover.d.ts +1 -0
- package/dist/index.esm.js +5 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- package/lib/components/Popover/Popover.tsx +2 -0
- package/lib/hooks/usePopupPosition.ts +4 -2
- package/lib/types/popover.ts +1 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { PopoverProps } from "../../types/popover";
|
|
3
3
|
import './style.css';
|
|
4
|
-
declare const Popover: ({ prefixCls, content, children, trigger, placement, open, visible, title, style, overlayClassName, overlayStyle, onVisibleChange, getPopupContainer }: PopoverProps) => React.JSX.Element;
|
|
4
|
+
declare const Popover: ({ prefixCls, content, children, trigger, placement, open, visible, title, style, overlayClassName, overlayStyle, overlayPopupStyle, onVisibleChange, getPopupContainer }: PopoverProps) => React.JSX.Element;
|
|
5
5
|
export default Popover;
|
|
@@ -8,8 +8,9 @@ type TPopupPosition = {
|
|
|
8
8
|
placement?: Placement;
|
|
9
9
|
popupContainer?: HTMLElement | null;
|
|
10
10
|
useTargetWidth?: boolean;
|
|
11
|
+
positionObserver?: CSSProperties;
|
|
11
12
|
};
|
|
12
|
-
export declare const usePopupPosition: ({ open, setOpen, popupRef, targetRef, placement, popupContainer, useTargetWidth }: TPopupPosition) => {
|
|
13
|
+
export declare const usePopupPosition: ({ open, setOpen, popupRef, targetRef, placement, popupContainer, useTargetWidth, positionObserver }: TPopupPosition) => {
|
|
13
14
|
_placement: Placement;
|
|
14
15
|
popupStyle: CSSProperties;
|
|
15
16
|
};
|
package/dist/index.esm.js
CHANGED
|
@@ -2627,7 +2627,8 @@ const usePopupPosition = ({
|
|
|
2627
2627
|
targetRef,
|
|
2628
2628
|
placement,
|
|
2629
2629
|
popupContainer,
|
|
2630
|
-
useTargetWidth
|
|
2630
|
+
useTargetWidth,
|
|
2631
|
+
positionObserver
|
|
2631
2632
|
}) => {
|
|
2632
2633
|
const [_placement, _setPlacement] = useState(placement ?? "bottomLeft");
|
|
2633
2634
|
const [popupPosition, setPopupPosition] = useState({});
|
|
@@ -2800,7 +2801,7 @@ const usePopupPosition = ({
|
|
|
2800
2801
|
controller.abort();
|
|
2801
2802
|
setPopupPosition({});
|
|
2802
2803
|
};
|
|
2803
|
-
}, [open, targetRef, calculatePosition]);
|
|
2804
|
+
}, [open, targetRef, positionObserver, calculatePosition]);
|
|
2804
2805
|
return {
|
|
2805
2806
|
_placement,
|
|
2806
2807
|
popupStyle: {
|
|
@@ -5670,6 +5671,7 @@ const Popover = ({
|
|
|
5670
5671
|
style = {},
|
|
5671
5672
|
overlayClassName = '',
|
|
5672
5673
|
overlayStyle = {},
|
|
5674
|
+
overlayPopupStyle = {},
|
|
5673
5675
|
onVisibleChange,
|
|
5674
5676
|
getPopupContainer
|
|
5675
5677
|
}) => {
|
|
@@ -5686,6 +5688,7 @@ const Popover = ({
|
|
|
5686
5688
|
placement,
|
|
5687
5689
|
open: isOpen,
|
|
5688
5690
|
setOpen: setInnerOpen,
|
|
5691
|
+
positionObserver: overlayPopupStyle,
|
|
5689
5692
|
popupContainer: getPopupContainer?.(targetRef.current)
|
|
5690
5693
|
});
|
|
5691
5694
|
useEffect(() => {
|