@@ -29,16 +29,13 @@ import {
2929import {
3030 CanColor ,
3131 CanColorCtor ,
32- CanDisable ,
33- CanDisableCtor ,
3432 CanDisableRipple ,
3533 CanDisableRippleCtor ,
3634 HasTabIndex ,
3735 HasTabIndexCtor ,
3836 mixinTabIndex ,
3937 MAT_RIPPLE_GLOBAL_OPTIONS ,
4038 mixinColor ,
41- mixinDisabled ,
4239 mixinDisableRipple ,
4340 RippleConfig ,
4441 RippleGlobalOptions ,
@@ -71,12 +68,13 @@ export class MatChipSelectionChange {
7168// Boilerplate for applying mixins to MatChip.
7269/** @docs -private */
7370class MatChipBase {
71+ disabled : boolean ;
7472 constructor ( public _elementRef : ElementRef ) { }
7573}
7674
77- const _MatChipMixinBase : CanColorCtor & CanDisableRippleCtor & CanDisableCtor &
75+ const _MatChipMixinBase : CanColorCtor & CanDisableRippleCtor &
7876 HasTabIndexCtor & typeof MatChipBase =
79- mixinTabIndex ( mixinColor ( mixinDisableRipple ( mixinDisabled ( MatChipBase ) ) , 'primary' ) , - 1 ) ;
77+ mixinTabIndex ( mixinColor ( mixinDisableRipple ( MatChipBase ) , 'primary' ) , - 1 ) ;
8078
8179/**
8280 * Dummy directive to add CSS class to chip avatar.
@@ -103,7 +101,7 @@ export class MatChipTrailingIcon {}
103101 */
104102@Directive ( {
105103 selector : `mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]` ,
106- inputs : [ 'color' , 'disabled' , ' disableRipple', 'tabIndex' ] ,
104+ inputs : [ 'color' , 'disableRipple' , 'tabIndex' ] ,
107105 exportAs : 'matChip' ,
108106 host : {
109107 'class' : 'mat-chip mat-focus-indicator' ,
@@ -124,7 +122,7 @@ export class MatChipTrailingIcon {}
124122 } ,
125123} )
126124export class MatChip extends _MatChipMixinBase implements FocusableOption , OnDestroy , CanColor ,
127- CanDisable , CanDisableRipple , RippleTarget , HasTabIndex {
125+ CanDisableRipple , RippleTarget , HasTabIndex {
128126
129127 /** Reference to the RippleRenderer for the chip. */
130128 private _chipRipple : RippleRenderer ;
@@ -164,6 +162,9 @@ export class MatChip extends _MatChipMixinBase implements FocusableOption, OnDes
164162 /** Whether the chip list is in multi-selection mode. */
165163 _chipListMultiple : boolean = false ;
166164
165+ /** Whether the chip list as a whole is disabled. */
166+ _chipListDisabled : boolean = false ;
167+
167168 /** The chip avatar */
168169 @ContentChild ( MatChipAvatar ) avatar : MatChipAvatar ;
169170
@@ -209,6 +210,14 @@ export class MatChip extends _MatChipMixinBase implements FocusableOption, OnDes
209210 }
210211 protected _selectable : boolean = true ;
211212
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+
212221 /**
213222 * Determines whether or not the chip displays the remove styling and emits (removed) events.
214223 */
0 commit comments