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.
@@ -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
  };
@@ -8,6 +8,7 @@ export type PopoverProps = DefaultProps & {
8
8
  open?: boolean;
9
9
  overlayStyle?: CSSProperties;
10
10
  overlayClassName?: string;
11
+ overlayPopupStyle?: CSSProperties;
11
12
  title?: string | ReactNode;
12
13
  visible?: boolean;
13
14
  listenPopoverPositions?: CSSProperties;
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(() => {