@@ -30,8 +30,19 @@ import {
3030import { MdAccordion } from './accordion' ;
3131import { AccordionItem } from './accordion-item' ;
3232import { UniqueSelectionDispatcher } from '../core' ;
33+ import { mixinDisabled , CanDisable } from '../core/common-behaviors/disabled' ;
3334import { Subject } from 'rxjs/Subject' ;
3435
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 ) ;
3546
3647/** MdExpansionPanel's states. */
3748export type MdExpansionPanelState = 'expanded' | 'collapsed' ;
@@ -54,7 +65,7 @@ export const EXPANSION_PANEL_ANIMATION_TIMING = '225ms cubic-bezier(0.4,0.0,0.2,
5465 templateUrl : './expansion-panel.html' ,
5566 encapsulation : ViewEncapsulation . None ,
5667 changeDetection : ChangeDetectionStrategy . OnPush ,
57- inputs : [ 'disabled' ] ,
68+ inputs : [ 'disabled' , 'expanded' ] ,
5869 host : {
5970 'class' : 'mat-expansion-panel' ,
6071 '[class.mat-expanded]' : 'expanded' ,
@@ -71,7 +82,8 @@ export const EXPANSION_PANEL_ANIMATION_TIMING = '225ms cubic-bezier(0.4,0.0,0.2,
7182 ] ) ,
7283 ] ,
7384} )
74- export class MdExpansionPanel extends AccordionItem implements OnChanges , OnDestroy {
85+ export class MdExpansionPanel extends _MdExpansionPanelMixinBase
86+ implements CanDisable , OnChanges , OnDestroy {
7587 /** Whether the toggle indicator should be hidden. */
7688 @Input ( ) hideToggle : boolean = false ;
7789
@@ -98,7 +110,6 @@ export class MdExpansionPanel extends AccordionItem implements OnChanges, OnDest
98110 if ( this . accordion ) {
99111 return ( this . expanded ? this . accordion . displayMode : this . _getExpandedState ( ) ) === 'default' ;
100112 }
101-
102113 return false ;
103114 }
104115
0 commit comments