@@ -38,13 +38,12 @@ import {coerceBooleanProperty} from '../core/coercion/boolean-property';
38
38
import { ConnectedOverlayDirective } from '../core/overlay/overlay-directives' ;
39
39
import { ViewportRuler } from '../core/overlay/position/viewport-ruler' ;
40
40
import { SelectionModel } from '../core/selection/selection' ;
41
- import { ScrollDispatcher } from '../core/overlay/scroll/scroll-dispatcher' ;
42
41
import { getMdSelectDynamicMultipleError , getMdSelectNonArrayValueError } from './select-errors' ;
43
42
import 'rxjs/add/observable/merge' ;
44
43
import 'rxjs/add/operator/startWith' ;
45
44
import 'rxjs/add/operator/filter' ;
46
45
import { CanColor , mixinColor } from '../core/common-behaviors/color' ;
47
- import { CanDisable } from '../core/common-behaviors/disabled' ;
46
+ import { CanDisable , mixinDisabled } from '../core/common-behaviors/disabled' ;
48
47
import {
49
48
FloatPlaceholderType ,
50
49
PlaceholderOptions ,
@@ -114,14 +113,14 @@ export class MdSelectChange {
114
113
export class MdSelectBase {
115
114
constructor ( public _renderer : Renderer2 , public _elementRef : ElementRef ) { }
116
115
}
117
- export const _MdSelectMixinBase = mixinColor ( MdSelectBase , 'primary' ) ;
116
+ export const _MdSelectMixinBase = mixinColor ( mixinDisabled ( MdSelectBase ) , 'primary' ) ;
118
117
119
118
@Component ( {
120
119
moduleId : module . id ,
121
120
selector : 'md-select, mat-select' ,
122
121
templateUrl : 'select.html' ,
123
122
styleUrls : [ 'select.css' ] ,
124
- inputs : [ 'color' ] ,
123
+ inputs : [ 'color' , 'disabled' ] ,
125
124
encapsulation : ViewEncapsulation . None ,
126
125
host : {
127
126
'role' : 'listbox' ,
@@ -145,7 +144,7 @@ export const _MdSelectMixinBase = mixinColor(MdSelectBase, 'primary');
145
144
exportAs : 'mdSelect' ,
146
145
} )
147
146
export class MdSelect extends _MdSelectMixinBase implements AfterContentInit , OnDestroy , OnInit ,
148
- ControlValueAccessor , CanColor {
147
+ ControlValueAccessor , CanColor , CanDisable {
149
148
/** Whether or not the overlay panel is open. */
150
149
private _panelOpen = false ;
151
150
@@ -161,9 +160,6 @@ export class MdSelect extends _MdSelectMixinBase implements AfterContentInit, On
161
160
/** Whether filling out the select is required in the form. */
162
161
private _required : boolean = false ;
163
162
164
- /** Whether the select is disabled. */
165
- private _disabled : boolean = false ;
166
-
167
163
/** The scroll position of the overlay panel, calculated to center the selected option. */
168
164
private _scrollTop = 0 ;
169
165
@@ -268,13 +264,6 @@ export class MdSelect extends _MdSelectMixinBase implements AfterContentInit, On
268
264
Promise . resolve ( null ) . then ( ( ) => this . _setTriggerWidth ( ) ) ;
269
265
}
270
266
271
- /** Whether the component is disabled. */
272
- @Input ( )
273
- get disabled ( ) { return this . _disabled ; }
274
- set disabled ( value : any ) {
275
- this . _disabled = coerceBooleanProperty ( value ) ;
276
- }
277
-
278
267
/** Whether the component is required. */
279
268
@Input ( )
280
269
get required ( ) { return this . _required ; }
@@ -301,7 +290,7 @@ export class MdSelect extends _MdSelectMixinBase implements AfterContentInit, On
301
290
302
291
/** Tab index for the select element. */
303
292
@Input ( )
304
- get tabIndex ( ) : number { return this . _disabled ? - 1 : this . _tabIndex ; }
293
+ get tabIndex ( ) : number { return this . disabled ? - 1 : this . _tabIndex ; }
305
294
set tabIndex ( value : number ) {
306
295
if ( typeof value !== 'undefined' ) {
307
296
this . _tabIndex = value ;
0 commit comments