@@ -29,16 +29,13 @@ import {
29
29
import {
30
30
CanColor ,
31
31
CanColorCtor ,
32
- CanDisable ,
33
- CanDisableCtor ,
34
32
CanDisableRipple ,
35
33
CanDisableRippleCtor ,
36
34
HasTabIndex ,
37
35
HasTabIndexCtor ,
38
36
mixinTabIndex ,
39
37
MAT_RIPPLE_GLOBAL_OPTIONS ,
40
38
mixinColor ,
41
- mixinDisabled ,
42
39
mixinDisableRipple ,
43
40
RippleConfig ,
44
41
RippleGlobalOptions ,
@@ -71,12 +68,13 @@ export class MatChipSelectionChange {
71
68
// Boilerplate for applying mixins to MatChip.
72
69
/** @docs -private */
73
70
class MatChipBase {
71
+ disabled : boolean ;
74
72
constructor ( public _elementRef : ElementRef ) { }
75
73
}
76
74
77
- const _MatChipMixinBase : CanColorCtor & CanDisableRippleCtor & CanDisableCtor &
75
+ const _MatChipMixinBase : CanColorCtor & CanDisableRippleCtor &
78
76
HasTabIndexCtor & typeof MatChipBase =
79
- mixinTabIndex ( mixinColor ( mixinDisableRipple ( mixinDisabled ( MatChipBase ) ) , 'primary' ) , - 1 ) ;
77
+ mixinTabIndex ( mixinColor ( mixinDisableRipple ( MatChipBase ) , 'primary' ) , - 1 ) ;
80
78
81
79
/**
82
80
* Dummy directive to add CSS class to chip avatar.
@@ -103,7 +101,7 @@ export class MatChipTrailingIcon {}
103
101
*/
104
102
@Directive ( {
105
103
selector : `mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]` ,
106
- inputs : [ 'color' , 'disabled' , ' disableRipple', 'tabIndex' ] ,
104
+ inputs : [ 'color' , 'disableRipple' , 'tabIndex' ] ,
107
105
exportAs : 'matChip' ,
108
106
host : {
109
107
'class' : 'mat-chip mat-focus-indicator' ,
@@ -124,7 +122,7 @@ export class MatChipTrailingIcon {}
124
122
} ,
125
123
} )
126
124
export class MatChip extends _MatChipMixinBase implements FocusableOption , OnDestroy , CanColor ,
127
- CanDisable , CanDisableRipple , RippleTarget , HasTabIndex {
125
+ CanDisableRipple , RippleTarget , HasTabIndex {
128
126
129
127
/** Reference to the RippleRenderer for the chip. */
130
128
private _chipRipple : RippleRenderer ;
@@ -164,6 +162,9 @@ export class MatChip extends _MatChipMixinBase implements FocusableOption, OnDes
164
162
/** Whether the chip list is in multi-selection mode. */
165
163
_chipListMultiple : boolean = false ;
166
164
165
+ /** Whether the chip list as a whole is disabled. */
166
+ _chipListDisabled : boolean = false ;
167
+
167
168
/** The chip avatar */
168
169
@ContentChild ( MatChipAvatar ) avatar : MatChipAvatar ;
169
170
@@ -209,6 +210,14 @@ export class MatChip extends _MatChipMixinBase implements FocusableOption, OnDes
209
210
}
210
211
protected _selectable : boolean = true ;
211
212
213
+ /** Whether the chip is disabled. */
214
+ @Input ( )
215
+ get disabled ( ) : boolean { return this . _chipListDisabled || this . _disabled ; }
216
+ set disabled ( value : boolean ) {
217
+ this . _disabled = coerceBooleanProperty ( value ) ;
218
+ }
219
+ protected _disabled : boolean = false ;
220
+
212
221
/**
213
222
* Determines whether or not the chip displays the remove styling and emits (removed) events.
214
223
*/
0 commit comments