@@ -12,6 +12,7 @@ import { modalInstance } from "components/GlobalInstances";
12
12
13
13
type ModalWrapperProps = {
14
14
$width ?: string | number ;
15
+ $animationStyle ?:any
15
16
} ;
16
17
17
18
type Model = {
@@ -30,6 +31,10 @@ const ModalWrapper = styled.div<ModalWrapperProps>`
30
31
padding: 0 0 16px;
31
32
pointer-events: auto;
32
33
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 } ;
33
38
` ;
34
39
35
40
const ModalHeaderWrapper = styled . div < { $draggable ?: boolean } > `
@@ -205,6 +210,7 @@ export type CustomModalProps = {
205
210
children ?: JSX . Element | React . ReactNode ;
206
211
okButtonType ?: TacoButtonType ;
207
212
model ?: Model ;
213
+ animationStyle ?:any
208
214
} & AntdModalProps ;
209
215
210
216
const DEFAULT_PROPS = {
@@ -217,7 +223,7 @@ const DEFAULT_PROPS = {
217
223
function CustomModalRender ( props : CustomModalProps & ModalFuncProps ) {
218
224
return (
219
225
< Draggable handle = ".handle" disabled = { ! props . draggable } >
220
- < ModalWrapper $width = { props . width } >
226
+ < ModalWrapper $width = { props . width } $animationStyle = { props ?. animationStyle } >
221
227
< >
222
228
< ModalHeaderWrapper className = "handle" $draggable = { props . draggable } >
223
229
< ModalHeader
@@ -276,6 +282,7 @@ CustomModal.confirm = (props: {
276
282
footer ?: ReactNode ;
277
283
type ?: "info" | "warn" | "error" | "success" ;
278
284
width ?: number | string ;
285
+ animationStyle ?:React . CSSProperties ;
279
286
} ) : any => {
280
287
281
288
const defaultConfirmProps : ModalFuncProps = {
@@ -333,6 +340,7 @@ CustomModal.confirm = (props: {
333
340
} }
334
341
footer = { props . footer }
335
342
width = { props . width }
343
+ animationStyle = { props . animationStyle }
336
344
/>
337
345
) ,
338
346
} ) ;
0 commit comments