@@ -15,24 +15,25 @@ import {
15
15
transition ,
16
16
trigger
17
17
} from '@angular/animations' ;
18
+ import { numbers as menuSurfaceConstants } from '@material/menu-surface' ;
18
19
19
20
// Animation values come from
20
21
// https://github.com/material-components/material-components-web/blob/master/packages/mdc-menu-surface/_mixins.scss
21
22
// TODO(mmalerba): Ideally find a way to import the values from MDC's code.
22
23
export const panelAnimation : AnimationTriggerMetadata = trigger ( 'panelAnimation' , [
23
- state ( 'hidden' , style ( { } ) ) ,
24
- state ( 'visible' , style ( { } ) ) ,
24
+ state ( 'void, hidden' , style ( {
25
+ opacity : 0 ,
26
+ transform : 'scale(0.8)' ,
27
+ } ) ) ,
25
28
transition ( ':enter, hidden => visible' , [
26
- style ( {
27
- opacity : 0 ,
28
- transform : 'scale(0.8)' ,
29
- } ) ,
30
29
group ( [
31
30
animate ( '0.03s linear' , style ( { opacity : 1 } ) ) ,
32
- animate ( '0.12s cubic-bezier(0, 0, 0.2, 1)' , style ( { transform : 'scale(1)' } ) ) ,
31
+ animate (
32
+ `${ menuSurfaceConstants . TRANSITION_OPEN_DURATION } ms cubic-bezier(0, 0, 0.2, 1)` ,
33
+ style ( { transform : 'scale(1)' } ) ) ,
33
34
] ) ,
34
35
] ) ,
35
36
transition ( ':leave, visible => hidden' , [
36
- animate ( '0.075s linear' , style ( { opacity : 0 } ) ) ,
37
+ animate ( ` ${ menuSurfaceConstants . TRANSITION_CLOSE_DURATION } ms linear` , style ( { opacity : 0 } ) ) ,
37
38
] ) ,
38
39
] ) ;
0 commit comments