5
5
* Use of this source code is governed by an MIT-style license that can be
6
6
* found in the LICENSE file at https://angular.dev/license
7
7
*/
8
- import {
9
- animate ,
10
- AnimationTriggerMetadata ,
11
- state ,
12
- style ,
13
- transition ,
14
- trigger ,
15
- } from '@angular/animations' ;
16
8
17
9
/**
18
10
* Animations used by MatTooltip.
@@ -21,15 +13,44 @@ import {
21
13
* @breaking -change 21.0.0
22
14
*/
23
15
export const matTooltipAnimations : {
24
- readonly tooltipState : AnimationTriggerMetadata ;
16
+ readonly tooltipState : any ;
25
17
} = {
18
+ // Represents:
19
+ // trigger('state', [
20
+ // state('initial, void, hidden', style({opacity: 0, transform: 'scale(0.8)'})),
21
+ // state('visible', style({transform: 'scale(1)'})),
22
+ // transition('* => visible', animate('150ms cubic-bezier(0, 0, 0.2, 1)')),
23
+ // transition('* => hidden', animate('75ms cubic-bezier(0.4, 0, 1, 1)')),
24
+ // ])
25
+
26
26
/** Animation that transitions a tooltip in and out. */
27
- tooltipState : trigger ( 'state' , [
28
- // TODO(crisbeto): these values are based on MDC's CSS.
29
- // We should be able to use their styles directly once we land #19432.
30
- state ( 'initial, void, hidden' , style ( { opacity : 0 , transform : 'scale(0.8)' } ) ) ,
31
- state ( 'visible' , style ( { transform : 'scale(1)' } ) ) ,
32
- transition ( '* => visible' , animate ( '150ms cubic-bezier(0, 0, 0.2, 1)' ) ) ,
33
- transition ( '* => hidden' , animate ( '75ms cubic-bezier(0.4, 0, 1, 1)' ) ) ,
34
- ] ) ,
27
+ tooltipState : {
28
+ type : 7 ,
29
+ name : 'state' ,
30
+ definitions : [
31
+ {
32
+ type : 0 ,
33
+ name : 'initial, void, hidden' ,
34
+ styles : { type : 6 , styles : { opacity : 0 , transform : 'scale(0.8)' } , offset : null } ,
35
+ } ,
36
+ {
37
+ type : 0 ,
38
+ name : 'visible' ,
39
+ styles : { type : 6 , styles : { transform : 'scale(1)' } , offset : null } ,
40
+ } ,
41
+ {
42
+ type : 1 ,
43
+ expr : '* => visible' ,
44
+ animation : { type : 4 , styles : null , timings : '150ms cubic-bezier(0, 0, 0.2, 1)' } ,
45
+ options : null ,
46
+ } ,
47
+ {
48
+ type : 1 ,
49
+ expr : '* => hidden' ,
50
+ animation : { type : 4 , styles : null , timings : '75ms cubic-bezier(0.4, 0, 1, 1)' } ,
51
+ options : null ,
52
+ } ,
53
+ ] ,
54
+ options : { } ,
55
+ } ,
35
56
} ;
0 commit comments