|
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 |
| -/** Time and timing curve for expansion panel animations. */ |
18 |
| -// Note: Keep this in sync with the Sass variable for the panel header animation. |
| 9 | +/** |
| 10 | + * Time and timing curve for expansion panel animations. |
| 11 | + * @deprecated No longer used. Will be removed. |
| 12 | + * @breaking-change 21.0.0 |
| 13 | + */ |
19 | 14 | export const EXPANSION_PANEL_ANIMATION_TIMING = '225ms cubic-bezier(0.4,0.0,0.2,1)';
|
20 | 15 |
|
21 | 16 | /**
|
@@ -43,28 +38,79 @@ export const EXPANSION_PANEL_ANIMATION_TIMING = '225ms cubic-bezier(0.4,0.0,0.2,
|
43 | 38 | * @breaking-change 21.0.0
|
44 | 39 | */
|
45 | 40 | export const matExpansionAnimations: {
|
46 |
| - readonly indicatorRotate: AnimationTriggerMetadata; |
47 |
| - readonly bodyExpansion: AnimationTriggerMetadata; |
| 41 | + readonly indicatorRotate: any; |
| 42 | + readonly bodyExpansion: any; |
48 | 43 | } = {
|
| 44 | + // Represents: |
| 45 | + // trigger('indicatorRotate', [ |
| 46 | + // state('collapsed, void', style({transform: 'rotate(0deg)'})), |
| 47 | + // state('expanded', style({transform: 'rotate(180deg)'})), |
| 48 | + // transition( |
| 49 | + // 'expanded <=> collapsed, void => collapsed', |
| 50 | + // animate(EXPANSION_PANEL_ANIMATION_TIMING), |
| 51 | + // ), |
| 52 | + // ]) |
| 53 | + |
49 | 54 | /** Animation that rotates the indicator arrow. */
|
50 |
| - indicatorRotate: trigger('indicatorRotate', [ |
51 |
| - state('collapsed, void', style({transform: 'rotate(0deg)'})), |
52 |
| - state('expanded', style({transform: 'rotate(180deg)'})), |
53 |
| - transition( |
54 |
| - 'expanded <=> collapsed, void => collapsed', |
55 |
| - animate(EXPANSION_PANEL_ANIMATION_TIMING), |
56 |
| - ), |
57 |
| - ]), |
| 55 | + indicatorRotate: { |
| 56 | + type: 7, |
| 57 | + name: 'indicatorRotate', |
| 58 | + definitions: [ |
| 59 | + { |
| 60 | + type: 0, |
| 61 | + name: 'collapsed, void', |
| 62 | + styles: {type: 6, styles: {transform: 'rotate(0deg)'}, offset: null}, |
| 63 | + }, |
| 64 | + { |
| 65 | + type: 0, |
| 66 | + name: 'expanded', |
| 67 | + styles: {type: 6, styles: {transform: 'rotate(180deg)'}, offset: null}, |
| 68 | + }, |
| 69 | + { |
| 70 | + type: 1, |
| 71 | + expr: 'expanded <=> collapsed, void => collapsed', |
| 72 | + animation: {type: 4, styles: null, timings: '225ms cubic-bezier(0.4,0.0,0.2,1)'}, |
| 73 | + options: null, |
| 74 | + }, |
| 75 | + ], |
| 76 | + options: {}, |
| 77 | + }, |
| 78 | + |
| 79 | + // Represents: |
| 80 | + // trigger('bodyExpansion', [ |
| 81 | + // state('collapsed, void', style({height: '0px', visibility: 'hidden'})), |
| 82 | + // // Clear the `visibility` while open, otherwise the content will be visible when placed in |
| 83 | + // // a parent that's `visibility: hidden`, because `visibility` doesn't apply to descendants |
| 84 | + // // that have a `visibility` of their own (see #27436). |
| 85 | + // state('expanded', style({height: '*', visibility: ''})), |
| 86 | + // transition( |
| 87 | + // 'expanded <=> collapsed, void => collapsed', |
| 88 | + // animate(EXPANSION_PANEL_ANIMATION_TIMING), |
| 89 | + // ), |
| 90 | + // ]) |
| 91 | + |
58 | 92 | /** Animation that expands and collapses the panel content. */
|
59 |
| - bodyExpansion: trigger('bodyExpansion', [ |
60 |
| - state('collapsed, void', style({height: '0px', visibility: 'hidden'})), |
61 |
| - // Clear the `visibility` while open, otherwise the content will be visible when placed in |
62 |
| - // a parent that's `visibility: hidden`, because `visibility` doesn't apply to descendants |
63 |
| - // that have a `visibility` of their own (see #27436). |
64 |
| - state('expanded', style({height: '*', visibility: ''})), |
65 |
| - transition( |
66 |
| - 'expanded <=> collapsed, void => collapsed', |
67 |
| - animate(EXPANSION_PANEL_ANIMATION_TIMING), |
68 |
| - ), |
69 |
| - ]), |
| 93 | + bodyExpansion: { |
| 94 | + type: 7, |
| 95 | + name: 'bodyExpansion', |
| 96 | + definitions: [ |
| 97 | + { |
| 98 | + type: 0, |
| 99 | + name: 'collapsed, void', |
| 100 | + styles: {type: 6, styles: {'height': '0px', 'visibility': 'hidden'}, offset: null}, |
| 101 | + }, |
| 102 | + { |
| 103 | + type: 0, |
| 104 | + name: 'expanded', |
| 105 | + styles: {type: 6, styles: {'height': '*', 'visibility': ''}, offset: null}, |
| 106 | + }, |
| 107 | + { |
| 108 | + type: 1, |
| 109 | + expr: 'expanded <=> collapsed, void => collapsed', |
| 110 | + animation: {type: 4, styles: null, timings: '225ms cubic-bezier(0.4,0.0,0.2,1)'}, |
| 111 | + options: null, |
| 112 | + }, |
| 113 | + ], |
| 114 | + options: {}, |
| 115 | + }, |
70 | 116 | };
|
0 commit comments