@pallasoft/ps-core-components 2.31.0 → 2.32.0
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.
|
@@ -3,5 +3,6 @@ export interface PsDragOverlayProps {
|
|
|
3
3
|
children: ReactNode;
|
|
4
4
|
className: string;
|
|
5
5
|
frames: Keyframe[];
|
|
6
|
+
isDropAnimated?: boolean;
|
|
6
7
|
}
|
|
7
|
-
export declare const PsDragOverlay: ({ children, className, frames }: PsDragOverlayProps) => import("react").ReactPortal | null;
|
|
8
|
+
export declare const PsDragOverlay: ({ children, className, frames, isDropAnimated, }: PsDragOverlayProps) => import("react").ReactPortal | null;
|
|
@@ -14,7 +14,7 @@ const dropAnimation = {
|
|
|
14
14
|
styles: { active: { opacity: ps_drag_config_1.PsDragConfig.placeholderOpacity } },
|
|
15
15
|
}),
|
|
16
16
|
};
|
|
17
|
-
const PsDragOverlay = ({ children, className, frames }) => {
|
|
17
|
+
const PsDragOverlay = ({ children, className, frames, isDropAnimated, }) => {
|
|
18
18
|
const [isMounted, setIsMounted] = (0, react_1.useState)(false);
|
|
19
19
|
const isReduced = (0, use_ps_reduced_motion_1.usePsReducedMotion)();
|
|
20
20
|
(0, react_1.useEffect)(() => setIsMounted(true), []);
|
|
@@ -29,6 +29,6 @@ const PsDragOverlay = ({ children, className, frames }) => {
|
|
|
29
29
|
fill: 'forwards',
|
|
30
30
|
});
|
|
31
31
|
};
|
|
32
|
-
return (0, react_dom_1.createPortal)((0, jsx_runtime_1.jsx)(core_1.DragOverlay, { dropAnimation: isReduced ? null : dropAnimation, children: children === null ? null : ((0, jsx_runtime_1.jsx)("div", { className: className, ref: lift, children: children })) }), document.body);
|
|
32
|
+
return (0, react_dom_1.createPortal)((0, jsx_runtime_1.jsx)(core_1.DragOverlay, { dropAnimation: isReduced || isDropAnimated === false ? null : dropAnimation, children: children === null ? null : ((0, jsx_runtime_1.jsx)("div", { className: className, ref: lift, children: children })) }), document.body);
|
|
33
33
|
};
|
|
34
34
|
exports.PsDragOverlay = PsDragOverlay;
|
|
@@ -11,7 +11,7 @@ const dropAnimation = {
|
|
|
11
11
|
styles: { active: { opacity: PsDragConfig.placeholderOpacity } },
|
|
12
12
|
}),
|
|
13
13
|
};
|
|
14
|
-
export const PsDragOverlay = ({ children, className, frames }) => {
|
|
14
|
+
export const PsDragOverlay = ({ children, className, frames, isDropAnimated, }) => {
|
|
15
15
|
const [isMounted, setIsMounted] = useState(false);
|
|
16
16
|
const isReduced = usePsReducedMotion();
|
|
17
17
|
useEffect(() => setIsMounted(true), []);
|
|
@@ -26,5 +26,5 @@ export const PsDragOverlay = ({ children, className, frames }) => {
|
|
|
26
26
|
fill: 'forwards',
|
|
27
27
|
});
|
|
28
28
|
};
|
|
29
|
-
return createPortal(_jsx(DragOverlay, { dropAnimation: isReduced ? null : dropAnimation, children: children === null ? null : (_jsx("div", { className: className, ref: lift, children: children })) }), document.body);
|
|
29
|
+
return createPortal(_jsx(DragOverlay, { dropAnimation: isReduced || isDropAnimated === false ? null : dropAnimation, children: children === null ? null : (_jsx("div", { className: className, ref: lift, children: children })) }), document.body);
|
|
30
30
|
};
|