x-ui-design 0.8.39 → 0.8.42

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, controlDropdownPosition }: PopoverProps) => React.JSX.Element;
4
+ declare const Popover: ({ prefixCls, content, children, trigger, placement, open, visible, title, style, overlayClassName, overlayStyle, onVisibleChange, getPopupContainer }: PopoverProps) => React.JSX.Element;
5
5
  export default Popover;
@@ -1,5 +1,5 @@
1
1
  import { Placement } from "../types";
2
- import { CSSProperties, RefObject } from "react";
2
+ import { CSSProperties, ReactNode, RefObject } from "react";
3
3
  type TPosition = {
4
4
  isOpen: boolean;
5
5
  popupRef: RefObject<HTMLDivElement | null>;
@@ -7,8 +7,9 @@ type TPosition = {
7
7
  getPopupContainer?: HTMLElement;
8
8
  placement?: Placement;
9
9
  offset?: number;
10
+ children?: ReactNode;
10
11
  };
11
- export declare const usePosition: ({ isOpen, offset, popupRef, placement, triggerRef, getPopupContainer, }: TPosition) => {
12
+ export declare const usePosition: ({ isOpen, offset, popupRef, placement, triggerRef, children, getPopupContainer, }: TPosition) => {
12
13
  showPlacement: string;
13
14
  dropdownPosition: CSSProperties;
14
15
  };
@@ -10,7 +10,6 @@ export type PopoverProps = DefaultProps & {
10
10
  overlayClassName?: string;
11
11
  title?: string | ReactNode;
12
12
  visible?: boolean;
13
- controlDropdownPosition?: CSSProperties;
14
13
  onVisibleChange?: ((open: boolean) => void) | undefined;
15
14
  getPopupContainer?: ((node: HTMLElement) => HTMLElement) | undefined;
16
15
  };
package/dist/index.esm.js CHANGED
@@ -2609,6 +2609,7 @@ const usePosition = ({
2609
2609
  popupRef,
2610
2610
  placement,
2611
2611
  triggerRef,
2612
+ children,
2612
2613
  getPopupContainer
2613
2614
  }) => {
2614
2615
  const [showPlacement, setShowPlacement] = useState('');
@@ -2693,7 +2694,7 @@ const usePosition = ({
2693
2694
  return () => {
2694
2695
  controller.abort();
2695
2696
  };
2696
- }, [isOpen, triggerRef, getPopupContainer, dropdownPosition]);
2697
+ }, [isOpen, children, triggerRef, getPopupContainer, dropdownPosition]);
2697
2698
  return {
2698
2699
  showPlacement,
2699
2700
  dropdownPosition: {
@@ -5545,8 +5546,7 @@ const Popover = ({
5545
5546
  overlayClassName = '',
5546
5547
  overlayStyle = {},
5547
5548
  onVisibleChange,
5548
- getPopupContainer,
5549
- controlDropdownPosition
5549
+ getPopupContainer
5550
5550
  }) => {
5551
5551
  const triggerRef = useRef(null);
5552
5552
  const popupRef = useRef(null);
@@ -5609,10 +5609,7 @@ const Popover = ({
5609
5609
  return /*#__PURE__*/cloneElement(child, {
5610
5610
  key: index,
5611
5611
  ...{
5612
- style: {
5613
- ...style,
5614
- ...(controlDropdownPosition || {})
5615
- },
5612
+ style,
5616
5613
  ...childProps,
5617
5614
  ref: triggerRef,
5618
5615
  className: `${prefixCls}-wrapper-content`