Skip to content

Commit 22ca375

Browse files
committed
animation styles in modal
1 parent 4764c9e commit 22ca375

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

client/packages/lowcoder-comps/src/comps/calendarComp/calendarComp.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ let CalendarBasicComp = (function () {
353353
const eventId = editEvent.current?.id;
354354
CustomModal.confirm({
355355
title: modalTitle,
356-
style: {
356+
animationStyle: {
357357
animation: props.animationStyle?.animation || "none",
358358
animationDelay: props.animationStyle?.animationDelay || "0s",
359359
animationDuration: props.animationStyle?.animationDuration || "0s",

client/packages/lowcoder-design/src/components/CustomModal.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { modalInstance } from "components/GlobalInstances";
1212

1313
type ModalWrapperProps = {
1414
$width?: string | number;
15+
$animationStyle?:any
1516
};
1617

1718
type Model = {
@@ -30,6 +31,10 @@ const ModalWrapper = styled.div<ModalWrapperProps>`
3031
padding: 0 0 16px;
3132
pointer-events: auto;
3233
will-change: transform;
34+
animation: ${(props) => props.$animationStyle?.animation};
35+
animation-delay: ${(props) => props.$animationStyle?.animationDelay};
36+
animation-duration: ${(props) => props.$animationStyle?.animationDuration};
37+
animation-iteration-count: ${(props) => props.$animationStyle?.animationIterationCount};
3338
`;
3439

3540
const ModalHeaderWrapper = styled.div<{ $draggable?: boolean }>`
@@ -205,6 +210,7 @@ export type CustomModalProps = {
205210
children?: JSX.Element | React.ReactNode;
206211
okButtonType?: TacoButtonType;
207212
model?: Model;
213+
animationStyle?:any
208214
} & AntdModalProps;
209215

210216
const DEFAULT_PROPS = {
@@ -217,7 +223,7 @@ const DEFAULT_PROPS = {
217223
function CustomModalRender(props: CustomModalProps & ModalFuncProps) {
218224
return (
219225
<Draggable handle=".handle" disabled={!props.draggable}>
220-
<ModalWrapper $width={props.width}>
226+
<ModalWrapper $width={props.width} $animationStyle={props?.animationStyle}>
221227
<>
222228
<ModalHeaderWrapper className="handle" $draggable={props.draggable}>
223229
<ModalHeader
@@ -276,6 +282,7 @@ CustomModal.confirm = (props: {
276282
footer?: ReactNode;
277283
type?: "info" | "warn" | "error" | "success";
278284
width?: number | string;
285+
animationStyle?:React.CSSProperties;
279286
}): any => {
280287

281288
const defaultConfirmProps: ModalFuncProps = {
@@ -333,6 +340,7 @@ CustomModal.confirm = (props: {
333340
}}
334341
footer={props.footer}
335342
width={props.width}
343+
animationStyle={props.animationStyle}
336344
/>
337345
),
338346
});

0 commit comments

Comments
 (0)