66 * found in the LICENSE file at https://angular.io/license
77 */
88
9- import { animate , state , style , transition , trigger } from '@angular/animations' ;
109import { FocusMonitor } from '@angular/cdk/a11y' ;
1110import { ENTER , SPACE } from '@angular/cdk/keycodes' ;
1211import { filter } from 'rxjs/operators/filter' ;
@@ -23,7 +22,8 @@ import {
2322} from '@angular/core' ;
2423import { merge } from 'rxjs/observable/merge' ;
2524import { Subscription } from 'rxjs/Subscription' ;
26- import { EXPANSION_PANEL_ANIMATION_TIMING , MatExpansionPanel } from './expansion-panel' ;
25+ import { MatExpansionPanel } from './expansion-panel' ;
26+ import { matExpansionAnimations } from './expansion-animations' ;
2727
2828
2929/**
@@ -41,6 +41,10 @@ import {EXPANSION_PANEL_ANIMATION_TIMING, MatExpansionPanel} from './expansion-p
4141 encapsulation : ViewEncapsulation . None ,
4242 preserveWhitespaces : false ,
4343 changeDetection : ChangeDetectionStrategy . OnPush ,
44+ animations : [
45+ matExpansionAnimations . indicatorRotate ,
46+ matExpansionAnimations . expansionHeaderHeight
47+ ] ,
4448 host : {
4549 'class' : 'mat-expansion-panel-header' ,
4650 'role' : 'button' ,
@@ -59,26 +63,6 @@ import {EXPANSION_PANEL_ANIMATION_TIMING, MatExpansionPanel} from './expansion-p
5963 }
6064 }` ,
6165 } ,
62- animations : [
63- trigger ( 'indicatorRotate' , [
64- state ( 'collapsed' , style ( { transform : 'rotate(0deg)' } ) ) ,
65- state ( 'expanded' , style ( { transform : 'rotate(180deg)' } ) ) ,
66- transition ( 'expanded <=> collapsed' , animate ( EXPANSION_PANEL_ANIMATION_TIMING ) ) ,
67- ] ) ,
68- trigger ( 'expansionHeight' , [
69- state ( 'collapsed' , style ( {
70- height : '{{collapsedHeight}}' ,
71- } ) , {
72- params : { collapsedHeight : '48px' } ,
73- } ) ,
74- state ( 'expanded' , style ( {
75- height : '{{expandedHeight}}'
76- } ) , {
77- params : { expandedHeight : '64px' }
78- } ) ,
79- transition ( 'expanded <=> collapsed' , animate ( EXPANSION_PANEL_ANIMATION_TIMING ) ) ,
80- ] ) ,
81- ] ,
8266} )
8367export class MatExpansionPanelHeader implements OnDestroy {
8468 private _parentChangeSubscription = Subscription . EMPTY ;
0 commit comments