blob: 5e05c16e046e27abf936dbb385da66729014bc15 [file] [log] [blame]
/**
* @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("rxjs/operators"),require("@angular/platform-browser/animations"),require("@angular/cdk/a11y"),require("@angular/cdk/bidi"),require("@angular/cdk/collections"),require("@angular/forms"),require("@angular/material/form-field")):"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","rxjs/operators","@angular/platform-browser/animations","@angular/cdk/a11y","@angular/cdk/bidi","@angular/cdk/collections","@angular/forms","@angular/material/form-field"],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.rxjs,t.rxjs.operators,t.ng.platformBrowser.animations,t.ng.cdk.a11y,t.ng.cdk.bidi,t.ng.cdk.collections,t.ng.forms,t.ng.material.formField)}(this,function(t,e,i,n,r,a,o,s,c,p,h,l,u,d){"use strict";function f(t,e){function i(){this.constructor=t}m(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var m=function(t,e){return(m=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])})(t,e)},g=function(){function t(t,e,i){void 0===i&&(i=!1),this.source=t,this.selected=e,this.isUserInput=i}return t}(),_=function(){function t(t){this._elementRef=t}return t}(),y=a.mixinColor(a.mixinDisableRipple(a.mixinDisabled(_)),"primary"),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 p(e,i,n,s,c){var p=t.call(this,e)||this;return p._elementRef=e,p._ngZone=i,p._hasFocus=!1,p.chipListSelectable=!0,p._chipListMultiple=!1,p._selected=!1,p._selectable=!0,p._removable=!0,p._onFocus=new o.Subject,p._onBlur=new o.Subject,p.selectionChange=new r.EventEmitter,p.destroyed=new r.EventEmitter,p.removed=new r.EventEmitter,p._addHostClassName(),p._chipRipple=new a.RippleRenderer(p,i,e,n),p._chipRipple.setupTriggerEvents(e.nativeElement),p.rippleConfig=s||{},p._animationsDisabled="NoopAnimations"===c,p}return f(p,t),Object.defineProperty(p.prototype,"rippleDisabled",{get:function(){return this.disabled||this.disableRipple||!!this.rippleConfig.disabled},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"selected",{get:function(){return this._selected},set:function(t){var i=e.coerceBooleanProperty(t);i!==this._selected&&(this._selected=i,this._dispatchSelectionChange())},enumerable:!0,configurable:!0}),Object.defineProperty(p.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(p.prototype,"selectable",{get:function(){return this._selectable&&this.chipListSelectable},set:function(t){this._selectable=e.coerceBooleanProperty(t)},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"removable",{get:function(){return this._removable},set:function(t){this._removable=e.coerceBooleanProperty(t)},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"ariaSelected",{get:function(){return this.selectable&&(this._chipListMultiple||this.selected)?this.selected.toString():null},enumerable:!0,configurable:!0}),p.prototype._addHostClassName=function(){var t=this._elementRef.nativeElement;if(t.hasAttribute("mat-basic-chip")||"mat-basic-chip"===t.tagName.toLowerCase())return void t.classList.add("mat-basic-chip");t.classList.add("mat-standard-chip")},p.prototype.ngOnDestroy=function(){this.destroyed.emit({chip:this}),this._chipRipple._removeTriggerEvents()},p.prototype.select=function(){this._selected||(this._selected=!0,this._dispatchSelectionChange())},p.prototype.deselect=function(){this._selected&&(this._selected=!1,this._dispatchSelectionChange())},p.prototype.selectViaInteraction=function(){this._selected||(this._selected=!0,this._dispatchSelectionChange(!0))},p.prototype.toggleSelected=function(t){return void 0===t&&(t=!1),this._selected=!this.selected,this._dispatchSelectionChange(t),this.selected},p.prototype.focus=function(){this._hasFocus||(this._elementRef.nativeElement.focus(),this._onFocus.next({chip:this})),this._hasFocus=!0},p.prototype.remove=function(){this.removable&&this.removed.emit({chip:this})},p.prototype._handleClick=function(t){this.disabled?t.preventDefault():t.stopPropagation()},p.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()}},p.prototype._blur=function(){var t=this;this._ngZone.onStable.asObservable().pipe(s.take(1)).subscribe(function(){t._ngZone.run(function(){t._hasFocus=!1,t._onBlur.next({chip:t})})})},p.prototype._dispatchSelectionChange=function(t){void 0===t&&(t=!1),this.selectionChange.emit({source:this,isUserInput:t,selected:this._selected})},p.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","[class._mat-animation-noopable]":"_animationsDisabled","[attr.disabled]":"disabled || null","[attr.aria-disabled]":"disabled.toString()","[attr.aria-selected]":"ariaSelected","(click)":"_handleClick($event)","(keydown)":"_handleKeydown($event)","(focus)":"focus()","(blur)":"_blur()"}}]}],p.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]}]},{type:String,decorators:[{type:r.Optional},{type:r.Inject,args:[c.ANIMATION_MODULE_TYPE]}]}]},p.propDecorators={avatar:[{type:r.ContentChild,args:[b,{static:!1}]}],trailingIcon:[{type:r.ContentChild,args:[v,{static:!1}]}],removeIcon:[{type:r.ContentChild,args:[r.forwardRef(function(){return x}),{static:!1}]}],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}]},p}(y),x=function(){function t(t){this._parentChip=t}return t.prototype._handleClick=function(t){var e=this._parentChip;e.removable&&!e.disabled&&e.remove(),t.stopPropagation()},t.decorators=[{type:r.Directive,args:[{selector:"[matChipRemove]",host:{class:"mat-chip-remove mat-chip-trailing-icon","(click)":"_handleClick($event)"}}]}],t.ctorParameters=function(){return[{type:C}]},t}(),I=new r.InjectionToken("mat-chips-default-options"),S=function(){function t(t,e,i,n){this._defaultErrorStateMatcher=t,this._parentForm=e,this._parentFormGroup=i,this.ngControl=n}return t}(),O=a.mixinErrorState(S),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 h=t.call(this,c,a,s,p)||this;return h._elementRef=e,h._changeDetectorRef=i,h._dir=n,h.ngControl=p,h.controlType="mat-chip-list",h._lastDestroyedChipIndex=null,h._destroyed=new o.Subject,h._uid="mat-chip-list-"+w++,h._tabIndex=0,h._userTabIndex=null,h._onTouched=function(){},h._onChange=function(){},h._multiple=!1,h._compareWith=function(t,e){return t===e},h._required=!1,h._disabled=!1,h.ariaOrientation="horizontal",h._selectable=!0,h.change=new r.EventEmitter,h.valueChange=new r.EventEmitter,h.ngControl&&(h.ngControl.valueAccessor=h),h}return f(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),this._syncChipsState()},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._chipInput&&this._chipInput.focused||this._hasFocusedChip()},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),this._syncChipsState()},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 p.FocusKeyManager(this.chips).withWrap().withVerticalOrientation().withHorizontalOrientation(this._dir?this._dir.value:"ltr"),this._dir&&this._dir.change.pipe(s.takeUntil(this._destroyed)).subscribe(function(e){return t._keyManager.withHorizontalOrientation(e)}),this._keyManager.tabOut.pipe(s.takeUntil(this._destroyed)).subscribe(function(){t._allowFocusEscape()}),this.chips.changes.pipe(s.startWith(null),s.takeUntil(this._destroyed)).subscribe(function(){t.disabled&&Promise.resolve().then(function(){t._syncChipsState()}),t._resetChips(),t._initializeSelection(),t._updateTabIndex(),t._updateFocusForDestroyedChips(),t.stateChanges.next()})},n.prototype.ngOnInit=function(){this._selectionModel=new l.SelectionModel(this.multiple,void 0,!1),this.stateChanges.next()},n.prototype.ngDoCheck=function(){this.ngControl&&this.updateErrorState()},n.prototype.ngOnDestroy=function(){this._destroyed.next(),this._destroyed.complete(),this.stateChanges.complete(),this._dropSubscriptions()},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.stateChanges.next()},n.prototype.onContainerClick=function(t){this._originatesFromChip(t)||this.focus()},n.prototype.focus=function(){this.disabled||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")&&(t.keyCode===i.HOME?(this._keyManager.setFirstItemActive(),t.preventDefault()):t.keyCode===i.END?(this._keyManager.setLastItemActive(),t.preventDefault()):this._keyManager.onKeydown(t),this.stateChanges.next())},n.prototype._updateTabIndex=function(){this._tabIndex=this._userTabIndex||(0===this.chips.length?-1:0)},n.prototype._updateFocusForDestroyedChips=function(){if(null!=this._lastDestroyedChipIndex)if(this.chips.length){var t=Math.min(this._lastDestroyedChipIndex,this.chips.length-1);this._keyManager.setActiveItem(t)}else this.focus();this._lastDestroyedChipIndex=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._hasFocusedChip()||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._allowFocusEscape=function(){var t=this;-1!==this._tabIndex&&(this._tabIndex=-1,setTimeout(function(){t._tabIndex=t._userTabIndex||0,t._changeDetectorRef.markForCheck()}))},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),this._chipRemoveSubscription&&(this._chipRemoveSubscription.unsubscribe(),this._chipRemoveSubscription=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){var i=e.chip,n=t.chips.toArray().indexOf(e.chip);t._isValidIndex(n)&&i._hasFocus&&(t._lastDestroyedChipIndex=n)})},n.prototype._originatesFromChip=function(t){for(var e=t.target;e&&e!==this._elementRef.nativeElement;){if(e.classList.contains("mat-chip"))return!0;e=e.parentElement}return!1},n.prototype._hasFocusedChip=function(){return this.chips.some(function(t){return t._hasFocus})},n.prototype._syncChipsState=function(){var t=this;this.chips&&this.chips.forEach(function(e){e.disabled=t._disabled,e._chipListMultiple=t.multiple})},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]":"disabled ? null : _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:d.MatFormFieldControl,useExisting:n}],styles:[".mat-chip{position:relative;overflow:hidden;box-sizing:border-box;-webkit-tap-highlight-color:transparent;transform:translateZ(0)}.mat-standard-chip{transition:box-shadow 280ms cubic-bezier(.4,0,.2,1);display:inline-flex;padding:7px 12px;border-radius:16px;align-items:center;cursor:default;min-height:32px;height:1px}._mat-animation-noopable.mat-standard-chip{transition:none;animation:none}.mat-standard-chip .mat-chip-remove.mat-icon{width:18px;height:18px}.mat-standard-chip::after{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:inherit;opacity:0;content:'';pointer-events:none;transition:opacity .2s cubic-bezier(.35,0,.25,1)}.mat-standard-chip:hover::after{opacity:.12}.mat-standard-chip:focus{outline:0}.mat-standard-chip:focus::after{opacity:.16}@media (-ms-high-contrast:active){.mat-standard-chip{outline:solid 1px}.mat-standard-chip:focus{outline:dotted 2px}}.mat-standard-chip.mat-chip-disabled::after{opacity:0}.mat-standard-chip.mat-chip-disabled .mat-chip-remove,.mat-standard-chip.mat-chip-disabled .mat-chip-trailing-icon{cursor:default}.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:8px;padding-left:0}[dir=rtl] .mat-standard-chip.mat-chip-with-trailing-icon.mat-chip-with-avatar{padding-left:8px;padding-right:0}.mat-standard-chip.mat-chip-with-trailing-icon{padding-top:7px;padding-bottom:7px;padding-right:8px;padding-left:12px}[dir=rtl] .mat-standard-chip.mat-chip-with-trailing-icon{padding-left:8px;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:24px;height:24px;margin-right:8px;margin-left:4px}[dir=rtl] .mat-standard-chip .mat-chip-avatar{margin-left:8px;margin-right:4px}.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:8px;margin-right:0}[dir=rtl] .mat-standard-chip .mat-chip-remove,[dir=rtl] .mat-standard-chip .mat-chip-trailing-icon{margin-right:8px;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;object-fit:cover}input.mat-chip-input{width:150px;margin:4px;flex:1 0 150px}"],encapsulation:r.ViewEncapsulation.None,changeDetection:r.ChangeDetectionStrategy.OnPush}]}],n.ctorParameters=function(){return[{type:r.ElementRef},{type:r.ChangeDetectorRef},{type:h.Directionality,decorators:[{type:r.Optional}]},{type:u.NgForm,decorators:[{type:r.Optional}]},{type:u.FormGroupDirective,decorators:[{type:r.Optional}]},{type:a.ErrorStateMatcher},{type:u.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,{descendants:!0}]}]},n}(O),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._disabled=!1,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,"disabled",{get:function(){return this._disabled||this._chipList&&this._chipList.disabled},set:function(t){this._disabled=e.coerceBooleanProperty(t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"empty",{get:function(){return!this._inputElement.value},enumerable:!0,configurable:!0}),t.prototype.ngOnChanges=function(){this._chipList.stateChanges.next()},t.prototype._keydown=function(t){t&&t.keyCode===i.TAB&&!i.hasModifierKey(t,"shiftKey")&&this._chipList._allowFocusEscape(),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._isSeparatorKey(t)||(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.prototype._isSeparatorKey=function(t){if(i.hasModifierKey(t))return!1;var e=this.separatorKeyCodes,n=t.keyCode;return Array.isArray(e)?e.indexOf(n)>-1:e.has(n)},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","[attr.disabled]":"disabled || null","[attr.placeholder]":"placeholder || null","[attr.aria-invalid]":"_chipList && _chipList.ngControl ? _chipList.ngControl.invalid : null"}}]}],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}],disabled:[{type:r.Input}]},t}(),j=[E,C,M,x,b,v],D={separatorKeyCodes:[i.ENTER]},F=function(){function t(){}return t.decorators=[{type:r.NgModule,args:[{exports:j,declarations:j,providers:[a.ErrorStateMatcher,{provide:I,useValue:D}]}]}],t}();t.MatChipsModule=F,t.MatChipListChange=k,t.MatChipList=E,t.MatChipSelectionChange=g,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