@@ -30,8 +30,19 @@ import {
30
30
import { MdAccordion } from './accordion' ;
31
31
import { AccordionItem } from './accordion-item' ;
32
32
import { UniqueSelectionDispatcher } from '../core' ;
33
+ import { mixinDisabled , CanDisable } from '../core/common-behaviors/disabled' ;
33
34
import { Subject } from 'rxjs/Subject' ;
34
35
36
+ // Boilerplate for applying mixins to MdExpansionPanel.
37
+ /** @docs -private */
38
+ export class MdExpansionPanelBase extends AccordionItem {
39
+ constructor ( accordion : MdAccordion ,
40
+ _changeDetectorRef : ChangeDetectorRef ,
41
+ _uniqueSelectionDispatcher : UniqueSelectionDispatcher ) {
42
+ super ( accordion , _changeDetectorRef , _uniqueSelectionDispatcher ) ;
43
+ }
44
+ }
45
+ export const _MdExpansionPanelMixinBase = mixinDisabled ( MdExpansionPanelBase ) ;
35
46
36
47
/** MdExpansionPanel's states. */
37
48
export type MdExpansionPanelState = 'expanded' | 'collapsed' ;
@@ -54,7 +65,7 @@ export const EXPANSION_PANEL_ANIMATION_TIMING = '225ms cubic-bezier(0.4,0.0,0.2,
54
65
templateUrl : './expansion-panel.html' ,
55
66
encapsulation : ViewEncapsulation . None ,
56
67
changeDetection : ChangeDetectionStrategy . OnPush ,
57
- inputs : [ 'disabled' ] ,
68
+ inputs : [ 'disabled' , 'expanded' ] ,
58
69
host : {
59
70
'class' : 'mat-expansion-panel' ,
60
71
'[class.mat-expanded]' : 'expanded' ,
@@ -71,7 +82,8 @@ export const EXPANSION_PANEL_ANIMATION_TIMING = '225ms cubic-bezier(0.4,0.0,0.2,
71
82
] ) ,
72
83
] ,
73
84
} )
74
- export class MdExpansionPanel extends AccordionItem implements OnChanges , OnDestroy {
85
+ export class MdExpansionPanel extends _MdExpansionPanelMixinBase
86
+ implements CanDisable , OnChanges , OnDestroy {
75
87
/** Whether the toggle indicator should be hidden. */
76
88
@Input ( ) hideToggle : boolean = false ;
77
89
@@ -98,7 +110,6 @@ export class MdExpansionPanel extends AccordionItem implements OnChanges, OnDest
98
110
if ( this . accordion ) {
99
111
return ( this . expanded ? this . accordion . displayMode : this . _getExpandedState ( ) ) === 'default' ;
100
112
}
101
-
102
113
return false ;
103
114
}
104
115
0 commit comments