x-ui-design 0.8.37 → 0.8.39
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/usePosition.d.ts +1 -1
- package/dist/esm/types/types/popover.d.ts +1 -1
- package/dist/index.esm.js +6 -8
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +6 -8
- package/dist/index.js.map +1 -1
- package/lib/components/Popover/Popover.tsx +6 -3
- package/lib/hooks/usePosition.ts +3 -9
- package/lib/types/popover.ts +1 -1
- package/package.json +1 -1
- package/src/app/page.tsx +4 -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,
|
|
4
|
+
declare const Popover: ({ prefixCls, content, children, trigger, placement, open, visible, title, style, overlayClassName, overlayStyle, onVisibleChange, getPopupContainer, controlDropdownPosition }: PopoverProps) => React.JSX.Element;
|
|
5
5
|
export default Popover;
|
|
@@ -8,7 +8,7 @@ type TPosition = {
|
|
|
8
8
|
placement?: Placement;
|
|
9
9
|
offset?: number;
|
|
10
10
|
};
|
|
11
|
-
export declare const usePosition: ({ isOpen, offset, popupRef, placement, triggerRef, getPopupContainer }: TPosition) => {
|
|
11
|
+
export declare const usePosition: ({ isOpen, offset, popupRef, placement, triggerRef, getPopupContainer, }: TPosition) => {
|
|
12
12
|
showPlacement: string;
|
|
13
13
|
dropdownPosition: CSSProperties;
|
|
14
14
|
};
|
|
@@ -10,7 +10,7 @@ export type PopoverProps = DefaultProps & {
|
|
|
10
10
|
overlayClassName?: string;
|
|
11
11
|
title?: string | ReactNode;
|
|
12
12
|
visible?: boolean;
|
|
13
|
-
|
|
13
|
+
controlDropdownPosition?: CSSProperties;
|
|
14
14
|
onVisibleChange?: ((open: boolean) => void) | undefined;
|
|
15
15
|
getPopupContainer?: ((node: HTMLElement) => HTMLElement) | undefined;
|
|
16
16
|
};
|
package/dist/index.esm.js
CHANGED
|
@@ -2614,11 +2614,6 @@ const usePosition = ({
|
|
|
2614
2614
|
const [showPlacement, setShowPlacement] = useState('');
|
|
2615
2615
|
const [_dropdownPosition, setDropdownPosition] = useState({});
|
|
2616
2616
|
const dropdownPosition = useCallback(() => {
|
|
2617
|
-
console.log({
|
|
2618
|
-
getPopupContainer,
|
|
2619
|
-
popupRef: popupRef.current,
|
|
2620
|
-
triggerRef: triggerRef.current
|
|
2621
|
-
});
|
|
2622
2617
|
if (!triggerRef.current) {
|
|
2623
2618
|
return {};
|
|
2624
2619
|
}
|
|
@@ -5551,7 +5546,7 @@ const Popover = ({
|
|
|
5551
5546
|
overlayStyle = {},
|
|
5552
5547
|
onVisibleChange,
|
|
5553
5548
|
getPopupContainer,
|
|
5554
|
-
|
|
5549
|
+
controlDropdownPosition
|
|
5555
5550
|
}) => {
|
|
5556
5551
|
const triggerRef = useRef(null);
|
|
5557
5552
|
const popupRef = useRef(null);
|
|
@@ -5614,7 +5609,10 @@ const Popover = ({
|
|
|
5614
5609
|
return /*#__PURE__*/cloneElement(child, {
|
|
5615
5610
|
key: index,
|
|
5616
5611
|
...{
|
|
5617
|
-
style
|
|
5612
|
+
style: {
|
|
5613
|
+
...style,
|
|
5614
|
+
...(controlDropdownPosition || {})
|
|
5615
|
+
},
|
|
5618
5616
|
...childProps,
|
|
5619
5617
|
ref: triggerRef,
|
|
5620
5618
|
className: `${prefixCls}-wrapper-content`
|
|
@@ -5633,7 +5631,7 @@ const Popover = ({
|
|
|
5633
5631
|
zIndex: 1000,
|
|
5634
5632
|
position: "absolute",
|
|
5635
5633
|
...overlayStyle,
|
|
5636
|
-
...
|
|
5634
|
+
...dropdownPosition
|
|
5637
5635
|
}
|
|
5638
5636
|
}), title && /*#__PURE__*/React.createElement("div", {
|
|
5639
5637
|
className: `${prefixCls}-title`
|