@@ -14,19 +14,26 @@ import {
1414 AnimationTriggerMetadata ,
1515} from '@angular/animations' ;
1616
17+ const animationBody = [
18+ // Note: The `enter` animation transitions to `transform: none`, because for some reason
19+ // specifying the transform explicitly, causes IE both to blur the dialog content and
20+ // decimate the animation performance. Leaving it as `none` solves both issues.
21+ state ( 'void, exit' , style ( { opacity : 0 , transform : 'scale(0.7)' } ) ) ,
22+ state ( 'enter' , style ( { transform : 'none' } ) ) ,
23+ transition ( '* => enter' , animate ( '150ms cubic-bezier(0, 0, 0.2, 1)' ,
24+ style ( { transform : 'none' , opacity : 1 } ) ) ) ,
25+ transition ( '* => void, * => exit' ,
26+ animate ( '75ms cubic-bezier(0.4, 0.0, 0.2, 1)' , style ( { opacity : 0 } ) ) ) ,
27+ ] ;
28+
1729/** Animations used by MatDialog. */
1830export const matDialogAnimations : {
31+ readonly dialogContainer : AnimationTriggerMetadata ;
1932 readonly slideDialog : AnimationTriggerMetadata ;
2033} = {
21- /** Animation that slides the dialog in and out of view and fades the opacity. */
22- slideDialog : trigger ( 'slideDialog' , [
23- // Note: The `enter` animation doesn't transition to something like `translate3d(0, 0, 0)
24- // scale(1)`, because for some reason specifying the transform explicitly, causes IE both
25- // to blur the dialog content and decimate the animation performance. Leaving it as `none`
26- // solves both issues.
27- state ( 'enter' , style ( { transform : 'none' , opacity : 1 } ) ) ,
28- state ( 'void' , style ( { transform : 'translate3d(0, 25%, 0) scale(0.9)' , opacity : 0 } ) ) ,
29- state ( 'exit' , style ( { transform : 'translate3d(0, 25%, 0)' , opacity : 0 } ) ) ,
30- transition ( '* => *' , animate ( '400ms cubic-bezier(0.25, 0.8, 0.25, 1)' ) ) ,
31- ] )
34+ /** Animation that is applied on the dialog container by defalt. */
35+ dialogContainer : trigger ( 'dialogContainer' , animationBody ) ,
36+
37+ /** @deprecated @breaking -change 8.0.0 Use `matDialogAnimations.dialogContainer` instead. */
38+ slideDialog : trigger ( 'slideDialog' , animationBody )
3239} ;
0 commit comments