x-ui-design 0.8.43 → 0.8.44

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, showPopoverPossitions, onVisibleChange, getPopupContainer }: PopoverProps) => React.JSX.Element;
5
5
  export default Popover;
@@ -1,5 +1,5 @@
1
1
  import { Placement } from "../types";
2
- import { CSSProperties, ReactNode, RefObject } from "react";
2
+ import { CSSProperties, RefObject } from "react";
3
3
  type TPosition = {
4
4
  isOpen: boolean;
5
5
  popupRef: RefObject<HTMLDivElement | null>;
@@ -7,9 +7,9 @@ type TPosition = {
7
7
  getPopupContainer?: HTMLElement;
8
8
  placement?: Placement;
9
9
  offset?: number;
10
- children?: ReactNode;
10
+ showPopoverPossitions?: CSSProperties;
11
11
  };
12
- export declare const usePosition: ({ isOpen, offset, popupRef, placement, triggerRef, children, getPopupContainer, }: TPosition) => {
12
+ export declare const usePosition: ({ isOpen, offset, popupRef, placement, triggerRef, showPopoverPossitions, getPopupContainer, }: TPosition) => {
13
13
  showPlacement: string;
14
14
  dropdownPosition: CSSProperties;
15
15
  };
@@ -10,6 +10,7 @@ export type PopoverProps = DefaultProps & {
10
10
  overlayClassName?: string;
11
11
  title?: string | ReactNode;
12
12
  visible?: boolean;
13
+ showPopoverPossitions?: CSSProperties;
13
14
  onVisibleChange?: ((open: boolean) => void) | undefined;
14
15
  getPopupContainer?: ((node: HTMLElement) => HTMLElement) | undefined;
15
16
  };
package/dist/index.esm.js CHANGED
@@ -2609,7 +2609,7 @@ const usePosition = ({
2609
2609
  popupRef,
2610
2610
  placement,
2611
2611
  triggerRef,
2612
- children,
2612
+ showPopoverPossitions,
2613
2613
  getPopupContainer
2614
2614
  }) => {
2615
2615
  const [showPlacement, setShowPlacement] = useState('');
@@ -2694,7 +2694,7 @@ const usePosition = ({
2694
2694
  return () => {
2695
2695
  controller.abort();
2696
2696
  };
2697
- }, [isOpen, children, triggerRef, getPopupContainer, dropdownPosition]);
2697
+ }, [isOpen, showPopoverPossitions, triggerRef, getPopupContainer, dropdownPosition]);
2698
2698
  return {
2699
2699
  showPlacement,
2700
2700
  dropdownPosition: {
@@ -5545,6 +5545,7 @@ const Popover = ({
5545
5545
  style = {},
5546
5546
  overlayClassName = '',
5547
5547
  overlayStyle = {},
5548
+ showPopoverPossitions,
5548
5549
  onVisibleChange,
5549
5550
  getPopupContainer
5550
5551
  }) => {
@@ -5561,7 +5562,7 @@ const Popover = ({
5561
5562
  popupRef,
5562
5563
  placement,
5563
5564
  triggerRef,
5564
- children,
5565
+ showPopoverPossitions,
5565
5566
  getPopupContainer: getPopupContainer?.(triggerRef.current)
5566
5567
  });
5567
5568
  useEffect(() => {