@@ -16,16 +16,18 @@ import {
1616
1717import { resolveTransit } from "./transit" ;
1818import { TransitionObserver } from "./transitionobserver" ;
19+ import { TransitionDelay , getEnterDelay , getLeaveDelay } from "./utils" ;
1920
2021const TICK = 17 ;
2122
23+ export type CSSTransitionDelay = TransitionDelay ;
2224export type CSSTransitionEventHandler = ( ) => void ;
2325
2426export interface CSSTransitionProps
2527 extends HTMLAttributes < any > {
2628 active ?: boolean ;
2729 transitionAppear ?: boolean ;
28- transitionDelay ?: number ;
30+ transitionDelay ?: CSSTransitionDelay ;
2931 onTransitionComplete ?: CSSTransitionEventHandler ;
3032 component ?: string | ComponentClass < any > | StatelessComponent < any > ;
3133 children ?: ReactNode ;
@@ -84,22 +86,22 @@ const transitToActiveAppearingState = (props: CSSTransitionProps) => ({
8486
8587const transitToActiveRunningState = ( props : CSSTransitionProps ) => ( {
8688 id : StateID . TransitToActiveRunning ,
87- style : { ...props . style , ...resolveTransit ( props . enterStyle , props . transitionDelay ) } ,
89+ style : { ...props . style , ...resolveTransit ( props . enterStyle , getEnterDelay ( props . transitionDelay ) ) } ,
8890} ) ;
8991
9092const transitToActiveStartedState = ( props : CSSTransitionProps ) => ( {
9193 id : StateID . TransitToActiveStarted ,
92- style : { ...props . style , ...resolveTransit ( props . enterStyle , props . transitionDelay ) } ,
94+ style : { ...props . style , ...resolveTransit ( props . enterStyle , getEnterDelay ( props . transitionDelay ) ) } ,
9395} ) ;
9496
9597const transitToDefaultRunningState = ( props : CSSTransitionProps ) => ( {
9698 id : StateID . TransitToDefaultRunning ,
97- style : { ...props . style , ...resolveTransit ( props . leaveStyle , props . transitionDelay ) } ,
99+ style : { ...props . style , ...resolveTransit ( props . leaveStyle , getLeaveDelay ( props . transitionDelay ) ) } ,
98100} ) ;
99101
100102const transitToDefaultStartedState = ( props : CSSTransitionProps ) => ( {
101103 id : StateID . TransitToDefaultStarted ,
102- style : { ...props . style , ...resolveTransit ( props . leaveStyle , props . transitionDelay ) } ,
104+ style : { ...props . style , ...resolveTransit ( props . leaveStyle , getLeaveDelay ( props . transitionDelay ) ) } ,
103105} ) ;
104106
105107export class CSSTransition extends Component < CSSTransitionProps , CSSTransitionState > {
0 commit comments