UNPKG

@angular/material

Version:
10 lines (9 loc) 23.9 kB
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/cdk/coercion"),require("@angular/cdk/keycodes"),require("@angular/cdk/platform"),require("@angular/core"),require("@angular/material/core"),require("rxjs"),require("@angular/cdk/a11y"),require("@angular/cdk/bidi"),require("@angular/cdk/collections"),require("@angular/forms"),require("@angular/material/form-field"),require("rxjs/operators")):"function"==typeof define&&define.amd?define("@angular/material/chips",["exports","@angular/cdk/coercion","@angular/cdk/keycodes","@angular/cdk/platform","@angular/core","@angular/material/core","rxjs","@angular/cdk/a11y","@angular/cdk/bidi","@angular/cdk/collections","@angular/forms","@angular/material/form-field","rxjs/operators"],e):e((t.ng=t.ng||{},t.ng.material=t.ng.material||{},t.ng.material.chips={}),t.ng.cdk.coercion,t.ng.cdk.keycodes,t.ng.cdk.platform,t.ng.core,t.ng.material.core,t.Rx,t.ng.cdk.a11y,t.ng.cdk.bidi,t.ng.cdk.collections,t.ng.forms,t.ng.material.formField,t.Rx.operators)}(this,function(t,e,i,n,r,a,o,s,c,p,l,h,u){"use strict";function d(t,e){function i(){this.constructor=t}f(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},m=function(){function t(t,e,i){void 0===i&&(i=!1),this.source=t,this.selected=e,this.isUserInput=i}return t}(),g=function(){function t(t){this._elementRef=t}return t}(),_=a.mixinColor(a.mixinDisableRipple(a.mixinDisabled(g)),"primary"),y=["mat-basic-chip"],b=function(){function t(){}return t.decorators=[{type:r.Directive,args:[{selector:"mat-chip-avatar, [matChipAvatar]",host:{class:"mat-chip-avatar"}}]}],t}(),v=function(){function t(){}return t.decorators=[{type:r.Directive,args:[{selector:"mat-chip-trailing-icon, [matChipTrailingIcon]",host:{class:"mat-chip-trailing-icon"}}]}],t}(),C=function(t){function s(e,i,n,s){var c=t.call(this,e)||this;return c._elementRef=e,c.rippleConfig={},c._hasFocus=!1,c.chipListSelectable=!0,c._selected=!1,c._selectable=!0,c._removable=!0,c._onFocus=new o.Subject,c._onBlur=new o.Subject,c.selectionChange=new r.EventEmitter,c.destroyed=new r.EventEmitter,c.removed=new r.EventEmitter,c._addHostClassName(),c._chipRipple=new a.RippleRenderer(c,i,e,n),c._chipRipple.setupTriggerEvents(e.nativeElement),s&&(c.rippleConfig={speedFactor:s.baseSpeedFactor,animation:s.animation,terminateOnPointerUp:s.terminateOnPointerUp}),c}return d(s,t),Object.defineProperty(s.prototype,"rippleDisabled",{get:function(){return this.disabled||this.disableRipple},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"selected",{get:function(){return this._selected},set:function(t){this._selected=e.coerceBooleanProperty(t),this.selectionChange.emit({source:this,isUserInput:!1,selected:t})},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"value",{get:function(){return void 0!=this._value?this._value:this._elementRef.nativeElement.textContent},set:function(t){this._value=t},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"selectable",{get:function(){return this._selectable&&this.chipListSelectable},set:function(t){this._selectable=e.coerceBooleanProperty(t)},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"removable",{get:function(){return this._removable},set:function(t){this._removable=e.coerceBooleanProperty(t)},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"ariaSelected",{get:function(){return this.selectable?this.selected.toString():null},enumerable:!0,configurable:!0}),s.prototype._addHostClassName=function(){for(var t=0,e=y;t<e.length;t++){var i=e[t];if(this._elementRef.nativeElement.hasAttribute(i)||this._elementRef.nativeElement.tagName.toLowerCase()===i)return void this._elementRef.nativeElement.classList.add(i)}this._elementRef.nativeElement.classList.add("mat-standard-chip")},s.prototype.ngOnDestroy=function(){this.destroyed.emit({chip:this}),this._chipRipple._removeTriggerEvents()},s.prototype.select=function(){this._selected=!0,this.selectionChange.emit({source:this,isUserInput:!1,selected:!0})},s.prototype.deselect=function(){this._selected=!1,this.selectionChange.emit({source:this,isUserInput:!1,selected:!1})},s.prototype.selectViaInteraction=function(){this._selected=!0,this.selectionChange.emit({source:this,isUserInput:!0,selected:!0})},s.prototype.toggleSelected=function(t){return void 0===t&&(t=!1),this._selected=!this.selected,this.selectionChange.emit({source:this,isUserInput:t,selected:this._selected}),this.selected},s.prototype.focus=function(){this._hasFocus||(this._elementRef.nativeElement.focus(),this._onFocus.next({chip:this})),this._hasFocus=!0},s.prototype.remove=function(){this.removable&&this.removed.emit({chip:this})},s.prototype._handleClick=function(t){this.disabled||(t.preventDefault(),t.stopPropagation())},s.prototype._handleKeydown=function(t){if(!this.disabled)switch(t.keyCode){case i.DELETE:case i.BACKSPACE:this.remove(),t.preventDefault();break;case i.SPACE:this.selectable&&this.toggleSelected(!0),t.preventDefault()}},s.prototype._blur=function(){this._hasFocus=!1,this._onBlur.next({chip:this})},s.decorators=[{type:r.Directive,args:[{selector:"mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]",inputs:["color","disabled","disableRipple"],exportAs:"matChip",host:{class:"mat-chip","[attr.tabindex]":"disabled ? null : -1",role:"option","[class.mat-chip-selected]":"selected","[class.mat-chip-with-avatar]":"avatar","[class.mat-chip-with-trailing-icon]":"trailingIcon || removeIcon","[class.mat-chip-disabled]":"disabled","[attr.disabled]":"disabled || null","[attr.aria-disabled]":"disabled.toString()","[attr.aria-selected]":"ariaSelected","(click)":"_handleClick($event)","(keydown)":"_handleKeydown($event)","(focus)":"focus()","(blur)":"_blur()"}}]}],s.ctorParameters=function(){return[{type:r.ElementRef},{type:r.NgZone},{type:n.Platform},{type:void 0,decorators:[{type:r.Optional},{type:r.Inject,args:[a.MAT_RIPPLE_GLOBAL_OPTIONS]}]}]},s.propDecorators={avatar:[{type:r.ContentChild,args:[b]}],trailingIcon:[{type:r.ContentChild,args:[v]}],removeIcon:[{type:r.ContentChild,args:[r.forwardRef(function(){return x})]}],selected:[{type:r.Input}],value:[{type:r.Input}],selectable:[{type:r.Input}],removable:[{type:r.Input}],selectionChange:[{type:r.Output}],destroyed:[{type:r.Output}],removed:[{type:r.Output}]},s}(_),x=function(){function t(t){this._parentChip=t}return t.prototype._handleClick=function(){this._parentChip.removable&&this._parentChip.remove()},t.decorators=[{type:r.Directive,args:[{selector:"[matChipRemove]",host:{class:"mat-chip-remove mat-chip-trailing-icon","(click)":"_handleClick()"}}]}],t.ctorParameters=function(){return[{type:C}]},t}(),I=new r.InjectionToken("mat-chips-default-options"),O=function(){function t(t,e,i,n){this._defaultErrorStateMatcher=t,this._parentForm=e,this._parentFormGroup=i,this.ngControl=n}return t}(),S=a.mixinErrorState(O),w=0,k=function(){function t(t,e){this.source=t,this.value=e}return t}(),E=function(t){function n(e,i,n,a,s,c,p){var l=t.call(this,c,a,s,p)||this;return l._elementRef=e,l._changeDetectorRef=i,l._dir=n,l.ngControl=p,l.controlType="mat-chip-list",l._lastDestroyedIndex=null,l._chipSet=new WeakMap,l._tabOutSubscription=o.Subscription.EMPTY,l._uid="mat-chip-list-"+w++,l._tabIndex=0,l._userTabIndex=null,l._onTouched=function(){},l._onChange=function(){},l._multiple=!1,l._compareWith=function(t,e){return t===e},l._required=!1,l._disabled=!1,l.ariaOrientation="horizontal",l._selectable=!0,l.change=new r.EventEmitter,l.valueChange=new r.EventEmitter,l.ngControl&&(l.ngControl.valueAccessor=l),l}return d(n,t),Object.defineProperty(n.prototype,"selected",{get:function(){return this.multiple?this._selectionModel.selected:this._selectionModel.selected[0]},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"role",{get:function(){return this.empty?null:"listbox"},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"multiple",{get:function(){return this._multiple},set:function(t){this._multiple=e.coerceBooleanProperty(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"compareWith",{get:function(){return this._compareWith},set:function(t){this._compareWith=t,this._selectionModel&&this._initializeSelection()},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){return this._value},set:function(t){this.writeValue(t),this._value=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"id",{get:function(){return this._chipInput?this._chipInput.id:this._uid},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"required",{get:function(){return this._required},set:function(t){this._required=e.coerceBooleanProperty(t),this.stateChanges.next()},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"placeholder",{get:function(){return this._chipInput?this._chipInput.placeholder:this._placeholder},set:function(t){this._placeholder=t,this.stateChanges.next()},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"focused",{get:function(){return this.chips.some(function(t){return t._hasFocus})||this._chipInput&&this._chipInput.focused},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"empty",{get:function(){return(!this._chipInput||this._chipInput.empty)&&0===this.chips.length},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"shouldLabelFloat",{get:function(){return!this.empty||this.focused},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"disabled",{get:function(){return this.ngControl?!!this.ngControl.disabled:this._disabled},set:function(t){this._disabled=e.coerceBooleanProperty(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"selectable",{get:function(){return this._selectable},set:function(t){var i=this;this._selectable=e.coerceBooleanProperty(t),this.chips&&this.chips.forEach(function(t){return t.chipListSelectable=i._selectable})},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"tabIndex",{set:function(t){this._userTabIndex=t,this._tabIndex=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"chipSelectionChanges",{get:function(){return o.merge.apply(void 0,this.chips.map(function(t){return t.selectionChange}))},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"chipFocusChanges",{get:function(){return o.merge.apply(void 0,this.chips.map(function(t){return t._onFocus}))},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"chipBlurChanges",{get:function(){return o.merge.apply(void 0,this.chips.map(function(t){return t._onBlur}))},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"chipRemoveChanges",{get:function(){return o.merge.apply(void 0,this.chips.map(function(t){return t.destroyed}))},enumerable:!0,configurable:!0}),n.prototype.ngAfterContentInit=function(){var t=this;this._keyManager=new s.FocusKeyManager(this.chips).withWrap().withVerticalOrientation().withHorizontalOrientation(this._dir?this._dir.value:"ltr"),this._tabOutSubscription=this._keyManager.tabOut.subscribe(function(){t._tabIndex=-1,setTimeout(function(){return t._tabIndex=t._userTabIndex||0})}),this._changeSubscription=this.chips.changes.pipe(u.startWith(null)).subscribe(function(){t._resetChips(),t._initializeSelection(),t._updateTabIndex(),t._updateFocusForDestroyedChips(),t.stateChanges.next()})},n.prototype.ngOnInit=function(){this._selectionModel=new p.SelectionModel(this.multiple,void 0,!1),this.stateChanges.next()},n.prototype.ngDoCheck=function(){this.ngControl&&this.updateErrorState()},n.prototype.ngOnDestroy=function(){this._tabOutSubscription.unsubscribe(),this._changeSubscription&&this._changeSubscription.unsubscribe(),this._chipRemoveSubscription&&this._chipRemoveSubscription.unsubscribe(),this._dropSubscriptions(),this.stateChanges.complete()},n.prototype.registerInput=function(t){this._chipInput=t},n.prototype.setDescribedByIds=function(t){this._ariaDescribedby=t.join(" ")},n.prototype.writeValue=function(t){this.chips&&this._setSelectionByValue(t,!1)},n.prototype.registerOnChange=function(t){this._onChange=t},n.prototype.registerOnTouched=function(t){this._onTouched=t},n.prototype.setDisabledState=function(t){this.disabled=t,this._elementRef.nativeElement.disabled=t,this.stateChanges.next()},n.prototype.onContainerClick=function(){this.focus()},n.prototype.focus=function(){this._chipInput&&this._chipInput.focused||(this.chips.length>0?(this._keyManager.setFirstItemActive(),this.stateChanges.next()):(this._focusInput(),this.stateChanges.next()))},n.prototype._focusInput=function(){this._chipInput&&this._chipInput.focus()},n.prototype._keydown=function(t){var e=t.target;t.keyCode===i.BACKSPACE&&this._isInputEmpty(e)?(this._keyManager.setLastItemActive(),t.preventDefault()):e&&e.classList.contains("mat-chip")&&(this._keyManager.onKeydown(t),this.stateChanges.next())},n.prototype._updateTabIndex=function(){this._tabIndex=this._userTabIndex||(0===this.chips.length?-1:0)},n.prototype._updateKeyManager=function(t){var e=this.chips.toArray().indexOf(t);this._isValidIndex(e)&&(t._hasFocus&&(e<this.chips.length-1?this._keyManager.setActiveItem(e):e-1>=0&&this._keyManager.setActiveItem(e-1)),this._keyManager.activeItemIndex===e&&(this._lastDestroyedIndex=e))},n.prototype._updateFocusForDestroyedChips=function(){var t=this.chips;if(null!=this._lastDestroyedIndex&&t.length>0&&this.focused){var e=Math.min(this._lastDestroyedIndex,t.length-1);this._keyManager.setActiveItem(e);var i=this._keyManager.activeItem;i&&i.focus()}this._lastDestroyedIndex=null},n.prototype._isValidIndex=function(t){return t>=0&&t<this.chips.length},n.prototype._isInputEmpty=function(t){if(t&&"input"===t.nodeName.toLowerCase()){return!t.value}return!1},n.prototype._setSelectionByValue=function(t,e){var i=this;if(void 0===e&&(e=!0),this._clearSelection(),this.chips.forEach(function(t){return t.deselect()}),Array.isArray(t))t.forEach(function(t){return i._selectValue(t,e)}),this._sortValues();else{var n=this._selectValue(t,e);n&&e&&this._keyManager.setActiveItem(n)}},n.prototype._selectValue=function(t,e){var i=this;void 0===e&&(e=!0);var n=this.chips.find(function(e){return null!=e.value&&i._compareWith(e.value,t)});return n&&(e?n.selectViaInteraction():n.select(),this._selectionModel.select(n)),n},n.prototype._initializeSelection=function(){var t=this;Promise.resolve().then(function(){(t.ngControl||t._value)&&(t._setSelectionByValue(t.ngControl?t.ngControl.value:t._value,!1),t.stateChanges.next())})},n.prototype._clearSelection=function(t){this._selectionModel.clear(),this.chips.forEach(function(e){e!==t&&e.deselect()}),this.stateChanges.next()},n.prototype._sortValues=function(){var t=this;this._multiple&&(this._selectionModel.clear(),this.chips.forEach(function(e){e.selected&&t._selectionModel.select(e)}),this.stateChanges.next())},n.prototype._propagateChanges=function(t){var e=null;e=Array.isArray(this.selected)?this.selected.map(function(t){return t.value}):this.selected?this.selected.value:t,this._value=e,this.change.emit(new k(this,e)),this.valueChange.emit(e),this._onChange(e),this._changeDetectorRef.markForCheck()},n.prototype._blur=function(){var t=this;this._keyManager.setActiveItem(-1),this.disabled||(this._chipInput?setTimeout(function(){t.focused||t._markAsTouched()}):this._markAsTouched())},n.prototype._markAsTouched=function(){this._onTouched(),this._changeDetectorRef.markForCheck(),this.stateChanges.next()},n.prototype._resetChips=function(){this._dropSubscriptions(),this._listenToChipsFocus(),this._listenToChipsSelection(),this._listenToChipsRemoved()},n.prototype._dropSubscriptions=function(){this._chipFocusSubscription&&(this._chipFocusSubscription.unsubscribe(),this._chipFocusSubscription=null),this._chipBlurSubscription&&(this._chipBlurSubscription.unsubscribe(),this._chipBlurSubscription=null),this._chipSelectionSubscription&&(this._chipSelectionSubscription.unsubscribe(),this._chipSelectionSubscription=null)},n.prototype._listenToChipsSelection=function(){var t=this;this._chipSelectionSubscription=this.chipSelectionChanges.subscribe(function(e){e.source.selected?t._selectionModel.select(e.source):t._selectionModel.deselect(e.source),t.multiple||t.chips.forEach(function(e){!t._selectionModel.isSelected(e)&&e.selected&&e.deselect()}),e.isUserInput&&t._propagateChanges()})},n.prototype._listenToChipsFocus=function(){var t=this;this._chipFocusSubscription=this.chipFocusChanges.subscribe(function(e){var i=t.chips.toArray().indexOf(e.chip);t._isValidIndex(i)&&t._keyManager.updateActiveItemIndex(i),t.stateChanges.next()}),this._chipBlurSubscription=this.chipBlurChanges.subscribe(function(){t._blur(),t.stateChanges.next()})},n.prototype._listenToChipsRemoved=function(){var t=this;this._chipRemoveSubscription=this.chipRemoveChanges.subscribe(function(e){t._updateKeyManager(e.chip)})},n.decorators=[{type:r.Component,args:[{selector:"mat-chip-list",template:'<div class="mat-chip-list-wrapper"><ng-content></ng-content></div>',exportAs:"matChipList",host:{"[attr.tabindex]":"_tabIndex","[attr.aria-describedby]":"_ariaDescribedby || null","[attr.aria-required]":"required.toString()","[attr.aria-disabled]":"disabled.toString()","[attr.aria-invalid]":"errorState","[attr.aria-multiselectable]":"multiple","[attr.role]":"role","[class.mat-chip-list-disabled]":"disabled","[class.mat-chip-list-invalid]":"errorState","[class.mat-chip-list-required]":"required","[attr.aria-orientation]":"ariaOrientation",class:"mat-chip-list","(focus)":"focus()","(blur)":"_blur()","(keydown)":"_keydown($event)","[id]":"_uid"},providers:[{provide:h.MatFormFieldControl,useExisting:n}],styles:[".mat-chip{position:relative;overflow:hidden}.mat-standard-chip{transition:box-shadow 280ms cubic-bezier(.4,0,.2,1);display:inline-flex;padding:7px 12px;border-radius:24px;align-items:center;cursor:default}.mat-standard-chip .mat-chip-remove.mat-icon{width:18px;height:18px}.mat-standard-chip:focus{box-shadow:0 3px 3px -2px rgba(0,0,0,.2),0 3px 4px 0 rgba(0,0,0,.14),0 1px 8px 0 rgba(0,0,0,.12);outline:0}@media screen and (-ms-high-contrast:active){.mat-standard-chip{outline:solid 1px}}.mat-standard-chip.mat-chip-with-avatar,.mat-standard-chip.mat-chip-with-trailing-icon.mat-chip-with-avatar{padding-top:0;padding-bottom:0}.mat-standard-chip.mat-chip-with-trailing-icon.mat-chip-with-avatar{padding-right:7px;padding-left:0}[dir=rtl] .mat-standard-chip.mat-chip-with-trailing-icon.mat-chip-with-avatar{padding-left:7px;padding-right:0}.mat-standard-chip.mat-chip-with-trailing-icon{padding-top:7px;padding-bottom:7px;padding-right:7px;padding-left:12px}[dir=rtl] .mat-standard-chip.mat-chip-with-trailing-icon{padding-left:7px;padding-right:12px}.mat-standard-chip.mat-chip-with-avatar{padding-left:0;padding-right:12px}[dir=rtl] .mat-standard-chip.mat-chip-with-avatar{padding-right:0;padding-left:12px}.mat-standard-chip .mat-chip-avatar{width:32px;height:32px;margin-right:8px;margin-left:0}[dir=rtl] .mat-standard-chip .mat-chip-avatar{margin-left:8px;margin-right:0}.mat-standard-chip .mat-chip-remove,.mat-standard-chip .mat-chip-trailing-icon{width:18px;height:18px;cursor:pointer}.mat-standard-chip .mat-chip-remove,.mat-standard-chip .mat-chip-trailing-icon{margin-left:7px;margin-right:0}[dir=rtl] .mat-standard-chip .mat-chip-remove,[dir=rtl] .mat-standard-chip .mat-chip-trailing-icon{margin-right:7px;margin-left:0}.mat-chip-list-wrapper{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;margin:-4px}.mat-chip-list-wrapper .mat-standard-chip,.mat-chip-list-wrapper input.mat-input-element{margin:4px}.mat-chip-list-stacked .mat-chip-list-wrapper{flex-direction:column;align-items:flex-start}.mat-chip-list-stacked .mat-chip-list-wrapper .mat-standard-chip{width:100%}.mat-chip-avatar{border-radius:50%;justify-content:center;align-items:center;display:flex;overflow:hidden}input.mat-chip-input{width:150px;margin:3px;flex:1 0 150px}"],encapsulation:r.ViewEncapsulation.None,changeDetection:r.ChangeDetectionStrategy.OnPush}]}],n.ctorParameters=function(){return[{type:r.ElementRef},{type:r.ChangeDetectorRef},{type:c.Directionality,decorators:[{type:r.Optional}]},{type:l.NgForm,decorators:[{type:r.Optional}]},{type:l.FormGroupDirective,decorators:[{type:r.Optional}]},{type:a.ErrorStateMatcher},{type:l.NgControl,decorators:[{type:r.Optional},{type:r.Self}]}]},n.propDecorators={errorStateMatcher:[{type:r.Input}],multiple:[{type:r.Input}],compareWith:[{type:r.Input}],value:[{type:r.Input}],required:[{type:r.Input}],placeholder:[{type:r.Input}],disabled:[{type:r.Input}],ariaOrientation:[{type:r.Input,args:["aria-orientation"]}],selectable:[{type:r.Input}],tabIndex:[{type:r.Input}],change:[{type:r.Output}],valueChange:[{type:r.Output}],chips:[{type:r.ContentChildren,args:[C]}]},n}(S),P=0,M=function(){function t(t,e){this._elementRef=t,this._defaultOptions=e,this.focused=!1,this._addOnBlur=!1,this.separatorKeyCodes=this._defaultOptions.separatorKeyCodes,this.chipEnd=new r.EventEmitter,this.placeholder="",this.id="mat-chip-list-input-"+P++,this._inputElement=this._elementRef.nativeElement}return Object.defineProperty(t.prototype,"chipList",{set:function(t){t&&(this._chipList=t,this._chipList.registerInput(this))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"addOnBlur",{get:function(){return this._addOnBlur},set:function(t){this._addOnBlur=e.coerceBooleanProperty(t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"empty",{get:function(){return!this._inputElement.value},enumerable:!0,configurable:!0}),t.prototype._keydown=function(t){this._emitChipEnd(t)},t.prototype._blur=function(){this.addOnBlur&&this._emitChipEnd(),this.focused=!1,this._chipList.focused||this._chipList._blur(),this._chipList.stateChanges.next()},t.prototype._focus=function(){this.focused=!0,this._chipList.stateChanges.next()},t.prototype._emitChipEnd=function(t){!this._inputElement.value&&t&&this._chipList._keydown(t),(!t||this.separatorKeyCodes.indexOf(t.keyCode)>-1)&&(this.chipEnd.emit({input:this._inputElement,value:this._inputElement.value}),t&&t.preventDefault())},t.prototype._onInput=function(){this._chipList.stateChanges.next()},t.prototype.focus=function(){this._inputElement.focus()},t.decorators=[{type:r.Directive,args:[{selector:"input[matChipInputFor]",exportAs:"matChipInput, matChipInputFor",host:{class:"mat-chip-input mat-input-element","(keydown)":"_keydown($event)","(blur)":"_blur()","(focus)":"_focus()","(input)":"_onInput()","[id]":"id"}}]}],t.ctorParameters=function(){return[{type:r.ElementRef},{type:void 0,decorators:[{type:r.Inject,args:[I]}]}]},t.propDecorators={chipList:[{type:r.Input,args:["matChipInputFor"]}],addOnBlur:[{type:r.Input,args:["matChipInputAddOnBlur"]}],separatorKeyCodes:[{type:r.Input,args:["matChipInputSeparatorKeyCodes"]}],chipEnd:[{type:r.Output,args:["matChipInputTokenEnd"]}],placeholder:[{type:r.Input}],id:[{type:r.Input}]},t}(),j=[E,C,M,x,b,v],R={separatorKeyCodes:[i.ENTER]},D=function(){function t(){}return t.decorators=[{type:r.NgModule,args:[{exports:j,declarations:j,providers:[a.ErrorStateMatcher,{provide:I,useValue:R}]}]}],t}();t.MatChipsModule=D,t.MatChipListBase=O,t._MatChipListMixinBase=S,t.MatChipListChange=k,t.MatChipList=E,t.MatChipSelectionChange=m,t.MatChipBase=g,t._MatChipMixinBase=_,t.MatChipAvatar=b,t.MatChipTrailingIcon=v,t.MatChip=C,t.MatChipRemove=x,t.MatChipInput=M,t.MAT_CHIPS_DEFAULT_OPTIONS=I,Object.defineProperty(t,"__esModule",{value:!0})}); //# sourceMappingURL=material-chips.umd.min.js.map