6
6
* found in the LICENSE file at https://angular.dev/license
7
7
*/
8
8
9
- import {
10
- trigger ,
11
- state ,
12
- style ,
13
- animate ,
14
- transition ,
15
- AnimationTriggerMetadata ,
16
- } from '@angular/animations' ;
17
-
18
9
/**
19
10
* Animations used by the mat-menu component.
20
11
* Animation duration and timing values are based on:
@@ -24,9 +15,31 @@ import {
24
15
* @breaking -change 21.0.0
25
16
*/
26
17
export const matMenuAnimations : {
27
- readonly transformMenu : AnimationTriggerMetadata ;
28
- readonly fadeInItems : AnimationTriggerMetadata ;
18
+ readonly transformMenu : any ;
19
+ readonly fadeInItems : any ;
29
20
} = {
21
+ // Represents:
22
+ // trigger('transformMenu', [
23
+ // state(
24
+ // 'void',
25
+ // style({
26
+ // opacity: 0,
27
+ // transform: 'scale(0.8)',
28
+ // }),
29
+ // ),
30
+ // transition(
31
+ // 'void => enter',
32
+ // animate(
33
+ // '120ms cubic-bezier(0, 0, 0.2, 1)',
34
+ // style({
35
+ // opacity: 1,
36
+ // transform: 'scale(1)',
37
+ // }),
38
+ // ),
39
+ // ),
40
+ // transition('* => void', animate('100ms 25ms linear', style({opacity: 0}))),
41
+ // ])
42
+
30
43
/**
31
44
* This animation controls the menu panel's entry and exit from the page.
32
45
*
@@ -35,40 +48,75 @@ export const matMenuAnimations: {
35
48
* When the menu panel is removed from the DOM, it simply fades out after a brief
36
49
* delay to display the ripple.
37
50
*/
38
- transformMenu : trigger ( 'transformMenu' , [
39
- state (
40
- 'void' ,
41
- style ( {
42
- opacity : 0 ,
43
- transform : 'scale(0.8)' ,
44
- } ) ,
45
- ) ,
46
- transition (
47
- 'void => enter' ,
48
- animate (
49
- '120ms cubic-bezier(0, 0, 0.2, 1)' ,
50
- style ( {
51
- opacity : 1 ,
52
- transform : 'scale(1)' ,
53
- } ) ,
54
- ) ,
55
- ) ,
56
- transition ( '* => void' , animate ( '100ms 25ms linear' , style ( { opacity : 0 } ) ) ) ,
57
- ] ) ,
51
+ transformMenu : {
52
+ type : 7 ,
53
+ name : 'transformMenu' ,
54
+ definitions : [
55
+ {
56
+ type : 0 ,
57
+ name : 'void' ,
58
+ styles : { type : 6 , styles : { opacity : 0 , transform : 'scale(0.8)' } , offset : null } ,
59
+ } ,
60
+ {
61
+ type : 1 ,
62
+ expr : 'void => enter' ,
63
+ animation : {
64
+ type : 4 ,
65
+ styles : { type : 6 , styles : { opacity : 1 , transform : 'scale(1)' } , offset : null } ,
66
+ timings : '120ms cubic-bezier(0, 0, 0.2, 1)' ,
67
+ } ,
68
+ options : null ,
69
+ } ,
70
+ {
71
+ type : 1 ,
72
+ expr : '* => void' ,
73
+ animation : {
74
+ type : 4 ,
75
+ styles : { type : 6 , styles : { opacity : 0 } , offset : null } ,
76
+ timings : '100ms 25ms linear' ,
77
+ } ,
78
+ options : null ,
79
+ } ,
80
+ ] ,
81
+ options : { } ,
82
+ } ,
83
+
84
+ // Represents:
85
+ // trigger('fadeInItems', [
86
+ // // TODO(crisbeto): this is inside the `transformMenu`
87
+ // // now. Remove next time we do breaking changes.
88
+ // state('showing', style({opacity: 1})),
89
+ // transition('void => *', [
90
+ // style({opacity: 0}),
91
+ // animate('400ms 100ms cubic-bezier(0.55, 0, 0.55, 0.2)'),
92
+ // ]),
93
+ // ])
58
94
59
95
/**
60
96
* This animation fades in the background color and content of the menu panel
61
97
* after its containing element is scaled in.
62
98
*/
63
- fadeInItems : trigger ( 'fadeInItems' , [
64
- // TODO(crisbeto): this is inside the `transformMenu`
65
- // now. Remove next time we do breaking changes.
66
- state ( 'showing' , style ( { opacity : 1 } ) ) ,
67
- transition ( 'void => *' , [
68
- style ( { opacity : 0 } ) ,
69
- animate ( '400ms 100ms cubic-bezier(0.55, 0, 0.55, 0.2)' ) ,
70
- ] ) ,
71
- ] ) ,
99
+ fadeInItems : {
100
+ type : 7 ,
101
+ name : 'fadeInItems' ,
102
+ definitions : [
103
+ {
104
+ type : 0 ,
105
+ name : 'showing' ,
106
+ styles : { type : 6 , styles : { opacity : 1 } , offset : null } ,
107
+ } ,
108
+ {
109
+ type : 1 ,
110
+ expr : 'void => *' ,
111
+ animation : [
112
+ { type : 6 , styles : { opacity : 0 } , offset : null } ,
113
+ { type : 4 , styles : null , timings : '400ms 100ms cubic-bezier(0.55, 0, 0.55, 0.2)' } ,
114
+ ] ,
115
+ options : null ,
116
+ } ,
117
+ ] ,
118
+ options : { } ,
119
+ } ,
72
120
} ;
73
121
74
122
/**
0 commit comments