UNPKG

@angular/material

Version:
10 lines 40.1 kB
/** * @license * Copyright Google Inc. 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/platform"),require("@angular/common"),require("@angular/core"),require("@angular/animations"),require("@angular/cdk/coercion"),require("@angular/cdk/rxjs"),require("@angular/cdk/bidi"),require("rxjs/Subject"),require("@angular/platform-browser"),require("@angular/cdk/keycodes"),require("rxjs/observable/fromEvent"),require("@angular/forms")):"function"==typeof define&&define.amd?define(["exports","@angular/cdk/platform","@angular/common","@angular/core","@angular/animations","@angular/cdk/coercion","@angular/cdk/rxjs","@angular/cdk/bidi","rxjs/Subject","@angular/platform-browser","@angular/cdk/keycodes","rxjs/observable/fromEvent","@angular/forms"],e):e((t.ng=t.ng||{},t.ng.material=t.ng.material||{},t.ng.material.input=t.ng.material.input||{}),t.ng.cdk.platform,t.ng.common,t.ng.core,t.ng.animations,t.ng.cdk.coercion,t.ng.cdk.rxjs,t.ng.cdk.bidi,t.Rx,t.ng.platformBrowser,t.ng.cdk.keycodes,t.Rx.Observable,t.ng.forms)}(this,function(t,e,r,n,i,o,a,s,l,c,p,u,d){"use strict";function h(t,e){function r(){this.constructor=t}C(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}function f(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];if(null==t)throw TypeError("Cannot convert undefined or null to object");for(var n=0,i=e;n<i.length;n++){var o=i[n];if(null!=o)for(var a in o)o.hasOwnProperty(a)&&(t[a]=o[a])}return t}function m(t,e){for(var r=Array(t),n=0;n<t;n++)r[n]=e(n);return r}function g(t){window.getComputedStyle(t).getPropertyValue("opacity")}function y(t,e,r){var n=Math.max(Math.abs(t-r.left),Math.abs(t-r.right)),i=Math.max(Math.abs(e-r.top),Math.abs(e-r.bottom));return Math.sqrt(n*n+i*i)}function _(){return Error("Placeholder attribute and child element were both specified.")}function b(t){return Error("A hint was already declared for 'align=\""+t+"\"'.")}function v(){return Error("mat-form-field must contain a MatFormFieldControl. Did you forget to add matInput to the native input or textarea element?")}function w(t){return Error('Input type "'+t+"\" isn't supported by matInput.")}var C=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},D=(new n.InjectionToken("md-compatibility-mode"),new n.InjectionToken("mat-sanity-checks"),new n.InjectionToken("MAT_DATE_LOCALE")),I=function(){function t(){this._localeChanges=new l.Subject}return Object.defineProperty(t.prototype,"localeChanges",{get:function(){return this._localeChanges},enumerable:!0,configurable:!0}),t.prototype.getYear=function(t){},t.prototype.getMonth=function(t){},t.prototype.getDate=function(t){},t.prototype.getDayOfWeek=function(t){},t.prototype.getMonthNames=function(t){},t.prototype.getDateNames=function(){},t.prototype.getDayOfWeekNames=function(t){},t.prototype.getYearName=function(t){},t.prototype.getFirstDayOfWeek=function(){},t.prototype.getNumDaysInMonth=function(t){},t.prototype.clone=function(t){},t.prototype.createDate=function(t,e,r){},t.prototype.today=function(){},t.prototype.parse=function(t,e){},t.prototype.format=function(t,e){},t.prototype.addCalendarYears=function(t,e){},t.prototype.addCalendarMonths=function(t,e){},t.prototype.addCalendarDays=function(t,e){},t.prototype.toIso8601=function(t){},t.prototype.fromIso8601=function(t){},t.prototype.isDateInstance=function(t){},t.prototype.isValid=function(t){},t.prototype.setLocale=function(t){this.locale=t,this._localeChanges.next()},t.prototype.compareDate=function(t,e){return this.getYear(t)-this.getYear(e)||this.getMonth(t)-this.getMonth(e)||this.getDate(t)-this.getDate(e)},t.prototype.sameDate=function(t,e){return t&&e?!this.compareDate(t,e):t==e},t.prototype.clampDate=function(t,e,r){return e&&this.compareDate(t,e)<0?e:r&&this.compareDate(t,r)>0?r:t},t}(),x="undefined"!=typeof Intl,R={long:["January","February","March","April","May","June","July","August","September","October","November","December"],short:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],narrow:["J","F","M","A","M","J","J","A","S","O","N","D"]},k=m(31,function(t){return String(t+1)}),E={long:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],short:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],narrow:["S","M","T","W","T","F","S"]},P=/^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|(?:(?:\+|-)\d{2}:\d{2}))?)?$/,O=(function(t){function e(e){var r=t.call(this)||this;return r.useUtcForDisplay=!0,t.prototype.setLocale.call(r,e),r}h(e,t),e.prototype.getYear=function(t){return t.getFullYear()},e.prototype.getMonth=function(t){return t.getMonth()},e.prototype.getDate=function(t){return t.getDate()},e.prototype.getDayOfWeek=function(t){return t.getDay()},e.prototype.getMonthNames=function(t){var e=this;if(x){var r=new Intl.DateTimeFormat(this.locale,{month:t});return m(12,function(t){return e._stripDirectionalityCharacters(r.format(new Date(2017,t,1)))})}return R[t]},e.prototype.getDateNames=function(){var t=this;if(x){var e=new Intl.DateTimeFormat(this.locale,{day:"numeric"});return m(31,function(r){return t._stripDirectionalityCharacters(e.format(new Date(2017,0,r+1)))})}return k},e.prototype.getDayOfWeekNames=function(t){var e=this;if(x){var r=new Intl.DateTimeFormat(this.locale,{weekday:t});return m(7,function(t){return e._stripDirectionalityCharacters(r.format(new Date(2017,0,t+1)))})}return E[t]},e.prototype.getYearName=function(t){if(x){var e=new Intl.DateTimeFormat(this.locale,{year:"numeric"});return this._stripDirectionalityCharacters(e.format(t))}return String(this.getYear(t))},e.prototype.getFirstDayOfWeek=function(){return 0},e.prototype.getNumDaysInMonth=function(t){return this.getDate(this._createDateWithOverflow(this.getYear(t),this.getMonth(t)+1,0))},e.prototype.clone=function(t){return this.createDate(this.getYear(t),this.getMonth(t),this.getDate(t))},e.prototype.createDate=function(t,e,r){if(e<0||e>11)throw Error('Invalid month index "'+e+'". Month index has to be between 0 and 11.');if(r<1)throw Error('Invalid date "'+r+'". Date has to be greater than 0.');var n=this._createDateWithOverflow(t,e,r);if(n.getMonth()!=e)throw Error('Invalid date "'+r+'" for month with index "'+e+'".');return n},e.prototype.today=function(){return new Date},e.prototype.parse=function(t){return"number"==typeof t?new Date(t):t?new Date(Date.parse(t)):null},e.prototype.format=function(t,e){if(!this.isValid(t))throw Error("NativeDateAdapter: Cannot format invalid date.");if(x){this.useUtcForDisplay&&(t=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds())),e=f({},e,{timeZone:"utc"}));var r=new Intl.DateTimeFormat(this.locale,e);return this._stripDirectionalityCharacters(r.format(t))}return this._stripDirectionalityCharacters(t.toDateString())},e.prototype.addCalendarYears=function(t,e){return this.addCalendarMonths(t,12*e)},e.prototype.addCalendarMonths=function(t,e){var r=this._createDateWithOverflow(this.getYear(t),this.getMonth(t)+e,this.getDate(t));return this.getMonth(r)!=((this.getMonth(t)+e)%12+12)%12&&(r=this._createDateWithOverflow(this.getYear(r),this.getMonth(r),0)),r},e.prototype.addCalendarDays=function(t,e){return this._createDateWithOverflow(this.getYear(t),this.getMonth(t),this.getDate(t)+e)},e.prototype.toIso8601=function(t){return[t.getUTCFullYear(),this._2digit(t.getUTCMonth()+1),this._2digit(t.getUTCDate())].join("-")},e.prototype.fromIso8601=function(t){if(P.test(t)){var e=new Date(t);if(this.isValid(e))return e}return null},e.prototype.isDateInstance=function(t){return t instanceof Date},e.prototype.isValid=function(t){return!isNaN(t.getTime())},e.prototype._createDateWithOverflow=function(t,e,r){var n=new Date(t,e,r);return t>=0&&t<100&&n.setFullYear(this.getYear(n)-1900),n},e.prototype._2digit=function(t){return("00"+t).slice(-2)},e.prototype._stripDirectionalityCharacters=function(t){return t.replace(/[\u200e\u200f]/g,"")},e.decorators=[{type:n.Injectable}],e.ctorParameters=function(){return[{type:void 0,decorators:[{type:n.Optional},{type:n.Inject,args:[D]}]}]}}(I),new n.InjectionToken("mat-date-formats"),function(){function t(){}return t.prototype.isErrorState=function(t,e){return!!(t&&t.invalid&&(t.touched||e&&e.submitted))},t.decorators=[{type:n.Injectable}],t.ctorParameters=function(){return[]},t}()),M=(function(t){function e(){var e=t.call(this)||this;return e._hammer="undefined"!=typeof window?window.Hammer:null,e.events=e._hammer?["longpress","slide","slidestart","slideend","slideright","slideleft"]:[],!e._hammer&&n.isDevMode()&&console.warn("Could not find HammerJS. Certain Angular Material components may not work correctly."),e}h(e,t),e.prototype.buildHammer=function(t){var e=new this._hammer(t),r=new this._hammer.Pan,n=new this._hammer.Swipe,i=new this._hammer.Press,o=this._createRecognizer(r,{event:"slide",threshold:0},n),a=this._createRecognizer(i,{event:"longpress",time:500});return r.recognizeWith(n),e.add([n,i,r,o,a]),e},e.prototype._createRecognizer=function(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=new t.constructor(e);return r.push(t),r.forEach(function(t){return i.recognizeWith(t)}),i},e.decorators=[{type:n.Injectable}],e.ctorParameters=function(){return[]}}(c.HammerGestureConfig),{});M.FADING_IN=0,M.VISIBLE=1,M.FADING_OUT=2,M.HIDDEN=3,M[M.FADING_IN]="FADING_IN",M[M.VISIBLE]="VISIBLE",M[M.FADING_OUT]="FADING_OUT",M[M.HIDDEN]="HIDDEN";var S=function(){function t(t,e,r){this._renderer=t,this.element=e,this.config=r,this.state=M.HIDDEN}return t.prototype.fadeOut=function(){this._renderer.fadeOutRipple(this)},t}(),F=function(){function t(t,e,r){this._ngZone=e,this._isPointerDown=!1,this._triggerEvents=new Map,this._activeRipples=new Set,this.rippleConfig={},this.rippleDisabled=!1,r.isBrowser&&(this._containerElement=t.nativeElement,this._triggerEvents.set("mousedown",this.onMousedown.bind(this)),this._triggerEvents.set("touchstart",this.onTouchstart.bind(this)),this._triggerEvents.set("mouseup",this.onPointerUp.bind(this)),this._triggerEvents.set("touchend",this.onPointerUp.bind(this)),this._triggerEvents.set("mouseleave",this.onPointerLeave.bind(this)),this.setTriggerElement(this._containerElement))}return t.prototype.fadeInRipple=function(t,e,r){var n=this;void 0===r&&(r={});var i=this._containerElement.getBoundingClientRect();r.centered&&(t=i.left+i.width/2,e=i.top+i.height/2);var o=r.radius||y(t,e,i),a=1/(r.speedFactor||1)*450,s=t-i.left,l=e-i.top,c=document.createElement("div");c.classList.add("mat-ripple-element"),c.style.left=s-o+"px",c.style.top=l-o+"px",c.style.height=2*o+"px",c.style.width=2*o+"px",c.style.backgroundColor=r.color||null,c.style.transitionDuration=a+"ms",this._containerElement.appendChild(c),g(c),c.style.transform="scale(1)";var p=new S(this,c,r);return p.state=M.FADING_IN,this._activeRipples.add(p),this.runTimeoutOutsideZone(function(){p.state=M.VISIBLE,r.persistent||n._isPointerDown||p.fadeOut()},a),p},t.prototype.fadeOutRipple=function(t){if(this._activeRipples.delete(t)){var e=t.element;e.style.transitionDuration="400ms",e.style.opacity="0",t.state=M.FADING_OUT,this.runTimeoutOutsideZone(function(){t.state=M.HIDDEN,e.parentNode.removeChild(e)},400)}},t.prototype.fadeOutAll=function(){this._activeRipples.forEach(function(t){return t.fadeOut()})},t.prototype.setTriggerElement=function(t){var e=this;this._triggerElement&&this._triggerEvents.forEach(function(t,r){e._triggerElement.removeEventListener(r,t)}),t&&this._ngZone.runOutsideAngular(function(){e._triggerEvents.forEach(function(e,r){return t.addEventListener(r,e)})}),this._triggerElement=t},t.prototype.onMousedown=function(t){this.rippleDisabled||(this._isPointerDown=!0,this.fadeInRipple(t.clientX,t.clientY,this.rippleConfig))},t.prototype.onPointerUp=function(){this._isPointerDown=!1,this._activeRipples.forEach(function(t){t.config.persistent||t.state!==M.VISIBLE||t.fadeOut()})},t.prototype.onPointerLeave=function(){this._isPointerDown&&this.onPointerUp()},t.prototype.onTouchstart=function(t){if(!this.rippleDisabled){var e=t.touches[0],r=e.clientX,n=e.clientY;this._isPointerDown=!0,this.fadeInRipple(r,n,this.rippleConfig)}},t.prototype.runTimeoutOutsideZone=function(t,e){void 0===e&&(e=0),this._ngZone.runOutsideAngular(function(){return setTimeout(t,e)})},t}(),T=new n.InjectionToken("mat-ripple-global-options"),A=(function(){function t(t,e,r,n){this.radius=0,this.speedFactor=1,this._rippleRenderer=new F(t,e,r),this._globalOptions=n||{},this._updateRippleRenderer()}t.prototype.ngOnChanges=function(t){(t.trigger||t._matRippleTrigger)&&this.trigger&&this._rippleRenderer.setTriggerElement(this.trigger),this._updateRippleRenderer()},t.prototype.ngOnDestroy=function(){this._rippleRenderer.setTriggerElement(null)},t.prototype.launch=function(t,e,r){return void 0===r&&(r=this.rippleConfig),this._rippleRenderer.fadeInRipple(t,e,r)},t.prototype.fadeOutAll=function(){this._rippleRenderer.fadeOutAll()},Object.defineProperty(t.prototype,"rippleConfig",{get:function(){return{centered:this.centered,speedFactor:this.speedFactor*(this._globalOptions.baseSpeedFactor||1),radius:this.radius,color:this.color}},enumerable:!0,configurable:!0}),t.prototype._updateRippleRenderer=function(){this._rippleRenderer.rippleDisabled=this._globalOptions.disabled||this.disabled,this._rippleRenderer.rippleConfig=this.rippleConfig},t.decorators=[{type:n.Directive,args:[{selector:"[mat-ripple], [matRipple]",exportAs:"matRipple",host:{class:"mat-ripple","[class.mat-ripple-unbounded]":"unbounded"}}]}],t.ctorParameters=function(){return[{type:n.ElementRef},{type:n.NgZone},{type:e.Platform},{type:void 0,decorators:[{type:n.Optional},{type:n.Inject,args:[T]}]}]},t.propDecorators={trigger:[{type:n.Input,args:["matRippleTrigger"]}],centered:[{type:n.Input,args:["matRippleCentered"]}],disabled:[{type:n.Input,args:["matRippleDisabled"]}],radius:[{type:n.Input,args:["matRippleRadius"]}],speedFactor:[{type:n.Input,args:["matRippleSpeedFactor"]}],color:[{type:n.Input,args:["matRippleColor"]}],unbounded:[{type:n.Input,args:["matRippleUnbounded"]}]}}(),function(){function t(){}return t}()),j=function(t){return function(t){function e(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var n=t.apply(this,e)||this;return n._disabled=!1,n}return h(e,t),Object.defineProperty(e.prototype,"disabled",{get:function(){return this._disabled},set:function(t){this._disabled=o.coerceBooleanProperty(t)},enumerable:!0,configurable:!0}),e}(t)}(A),N=0,H=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._labelId="mat-optgroup-label-"+N++,e}return h(e,t),e.decorators=[{type:n.Component,args:[{selector:"mat-optgroup",exportAs:"matOptgroup",template:'<label class="mat-optgroup-label" [id]="_labelId">{{ label }}</label><ng-content select="mat-option"></ng-content>',encapsulation:n.ViewEncapsulation.None,preserveWhitespaces:!1,changeDetection:n.ChangeDetectionStrategy.OnPush,inputs:["disabled"],host:{class:"mat-optgroup",role:"group","[class.mat-optgroup-disabled]":"disabled","[attr.aria-disabled]":"disabled.toString()","[attr.aria-labelledby]":"_labelId"}}]}],e.ctorParameters=function(){return[]},e.propDecorators={label:[{type:n.Input}]},e}(j),L=0,V=function(){function t(t,e){void 0===e&&(e=!1),this.source=t,this.isUserInput=e}return t}(),q=(function(){function t(t,e,r){this._element=t,this._changeDetectorRef=e,this.group=r,this._selected=!1,this._active=!1,this._multiple=!1,this._disableRipple=!1,this._disabled=!1,this._id="mat-option-"+L++,this.onSelectionChange=new n.EventEmitter}Object.defineProperty(t.prototype,"multiple",{get:function(){return this._multiple},set:function(t){t!==this._multiple&&(this._multiple=t,this._changeDetectorRef.markForCheck())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"selected",{get:function(){return this._selected},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"disabled",{get:function(){return this.group&&this.group.disabled||this._disabled},set:function(t){this._disabled=o.coerceBooleanProperty(t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"disableRipple",{get:function(){return this._disableRipple},set:function(t){this._disableRipple=t,this._changeDetectorRef.markForCheck()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"active",{get:function(){return this._active},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"viewValue",{get:function(){return(this._getHostElement().textContent||"").trim()},enumerable:!0,configurable:!0}),t.prototype.select=function(){this._selected=!0,this._changeDetectorRef.markForCheck(),this._emitSelectionChangeEvent()},t.prototype.deselect=function(){this._selected=!1,this._changeDetectorRef.markForCheck(),this._emitSelectionChangeEvent()},t.prototype.focus=function(){var t=this._getHostElement();"function"==typeof t.focus&&t.focus()},t.prototype.setActiveStyles=function(){this._active||(this._active=!0,this._changeDetectorRef.markForCheck())},t.prototype.setInactiveStyles=function(){this._active&&(this._active=!1,this._changeDetectorRef.markForCheck())},t.prototype.getLabel=function(){return this.viewValue},t.prototype._handleKeydown=function(t){t.keyCode!==p.ENTER&&t.keyCode!==p.SPACE||(this._selectViaInteraction(),t.preventDefault())},t.prototype._selectViaInteraction=function(){this.disabled||(this._selected=!this.multiple||!this._selected,this._changeDetectorRef.markForCheck(),this._emitSelectionChangeEvent(!0))},t.prototype._getTabIndex=function(){return this.disabled?"-1":"0"},t.prototype._getHostElement=function(){return this._element.nativeElement},t.prototype._emitSelectionChangeEvent=function(t){void 0===t&&(t=!1),this.onSelectionChange.emit(new V(this,t))},t.countGroupLabelsBeforeOption=function(t,e,r){if(r.length){for(var n=e.toArray(),i=r.toArray(),o=0,a=0;a<t+1;a++)n[a].group&&n[a].group===i[o]&&o++;return o}return 0},t.decorators=[{type:n.Component,args:[{selector:"mat-option",exportAs:"matOption",host:{role:"option","[attr.tabindex]":"_getTabIndex()","[class.mat-selected]":"selected","[class.mat-option-multiple]":"multiple","[class.mat-active]":"active","[id]":"id","[attr.aria-selected]":"selected.toString()","[attr.aria-disabled]":"disabled.toString()","[class.mat-option-disabled]":"disabled","(click)":"_selectViaInteraction()","(keydown)":"_handleKeydown($event)",class:"mat-option"},template:'<span *ngIf="multiple"><mat-pseudo-checkbox class="mat-option-pseudo-checkbox" [state]="selected ? \'checked\' : \'\'" [disabled]="disabled"></mat-pseudo-checkbox></span><span class="mat-option-text"><ng-content></ng-content></span><div class="mat-option-ripple" mat-ripple [matRippleTrigger]="_getHostElement()" [matRippleDisabled]="disabled || disableRipple"></div>',encapsulation:n.ViewEncapsulation.None,preserveWhitespaces:!1,changeDetection:n.ChangeDetectionStrategy.OnPush}]}],t.ctorParameters=function(){return[{type:n.ElementRef},{type:n.ChangeDetectorRef},{type:H,decorators:[{type:n.Optional}]}]},t.propDecorators={value:[{type:n.Input}],disabled:[{type:n.Input}],onSelectionChange:[{type:n.Output}]}}(),new n.InjectionToken("mat-placeholder-global-options")),B=0,z=function(){function t(){this.id="mat-error-"+B++}return t.decorators=[{type:n.Directive,args:[{selector:"mat-error",host:{class:"mat-error",role:"alert","[attr.id]":"id"}}]}],t.ctorParameters=function(){return[]},t.propDecorators={id:[{type:n.Input}]},t}(),W=function(){function t(){}return t.prototype.setDescribedByIds=function(t){},t.prototype.onContainerClick=function(t){},t}(),Y=0,U=function(){function t(){this.align="start",this.id="mat-hint-"+Y++}return t.decorators=[{type:n.Directive,args:[{selector:"mat-hint",host:{class:"mat-hint","[class.mat-right]":'align == "end"',"[attr.id]":"id","[attr.align]":"null"}}]}],t.ctorParameters=function(){return[]},t.propDecorators={align:[{type:n.Input}],id:[{type:n.Input}]},t}(),G=function(){function t(){}return t.decorators=[{type:n.Directive,args:[{selector:"mat-placeholder"}]}],t.ctorParameters=function(){return[]},t}(),J=function(){function t(){}return t.decorators=[{type:n.Directive,args:[{selector:"[matPrefix]"}]}],t.ctorParameters=function(){return[]},t}(),Z=function(){function t(){}return t.decorators=[{type:n.Directive,args:[{selector:"[matSuffix]"}]}],t.ctorParameters=function(){return[]},t}(),X=0,$=function(){function t(t,e,r,n){this._elementRef=t,this._renderer=e,this._changeDetectorRef=r,this.color="primary",this._showAlwaysAnimate=!1,this._subscriptAnimationState="",this._hintLabel="",this._hintLabelId="mat-hint-"+X++,this._placeholderOptions=n||{},this.floatPlaceholder=this._placeholderOptions.float||"auto"}return Object.defineProperty(t.prototype,"dividerColor",{get:function(){return this.color},set:function(t){this.color=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hideRequiredMarker",{get:function(){return this._hideRequiredMarker},set:function(t){this._hideRequiredMarker=o.coerceBooleanProperty(t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_shouldAlwaysFloat",{get:function(){return"always"===this._floatPlaceholder&&!this._showAlwaysAnimate},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_canPlaceholderFloat",{get:function(){return"never"!==this._floatPlaceholder},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hintLabel",{get:function(){return this._hintLabel},set:function(t){this._hintLabel=t,this._processHints()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"floatPlaceholder",{get:function(){return this._floatPlaceholder},set:function(t){t!==this._floatPlaceholder&&(this._floatPlaceholder=t||this._placeholderOptions.float||"auto",this._changeDetectorRef.markForCheck())},enumerable:!0,configurable:!0}),t.prototype.ngAfterContentInit=function(){var t=this;this._validateControlChild(),this._control.controlType&&this._renderer.addClass(this._elementRef.nativeElement,"mat-form-field-type-"+this._control.controlType),a.startWith.call(this._control.stateChanges,null).subscribe(function(){t._validatePlaceholders(),t._syncDescribedByIds(),t._changeDetectorRef.markForCheck()});var e=this._control.ngControl;e&&e.valueChanges&&e.valueChanges.subscribe(function(){t._changeDetectorRef.markForCheck()}),a.startWith.call(this._hintChildren.changes,null).subscribe(function(){t._processHints(),t._changeDetectorRef.markForCheck()}),a.startWith.call(this._errorChildren.changes,null).subscribe(function(){t._syncDescribedByIds(),t._changeDetectorRef.markForCheck()})},t.prototype.ngAfterContentChecked=function(){this._validateControlChild()},t.prototype.ngAfterViewInit=function(){this._subscriptAnimationState="enter",this._changeDetectorRef.detectChanges()},t.prototype._shouldForward=function(t){var e=this._control?this._control.ngControl:null;return e&&e[t]},t.prototype._hasPlaceholder=function(){return!(!this._control.placeholder&&!this._placeholderChild)},t.prototype._getDisplayedMessages=function(){return this._errorChildren&&this._errorChildren.length>0&&this._control.errorState?"error":"hint"},t.prototype._animateAndLockPlaceholder=function(){var t=this;this._placeholder&&this._canPlaceholderFloat&&(this._showAlwaysAnimate=!0,this._floatPlaceholder="always",a.first.call(u.fromEvent(this._placeholder.nativeElement,"transitionend")).subscribe(function(){t._showAlwaysAnimate=!1}),this._changeDetectorRef.markForCheck())},t.prototype._validatePlaceholders=function(){if(this._control.placeholder&&this._placeholderChild)throw _()},t.prototype._processHints=function(){this._validateHints(),this._syncDescribedByIds()},t.prototype._validateHints=function(){var t=this;if(this._hintChildren){var e,r;this._hintChildren.forEach(function(n){if("start"==n.align){if(e||t.hintLabel)throw b("start");e=n}else if("end"==n.align){if(r)throw b("end");r=n}})}},t.prototype._syncDescribedByIds=function(){if(this._control){var t=[];if("hint"===this._getDisplayedMessages()){var e=this._hintChildren?this._hintChildren.find(function(t){return"start"===t.align}):null,r=this._hintChildren?this._hintChildren.find(function(t){return"end"===t.align}):null;e?t.push(e.id):this._hintLabel&&t.push(this._hintLabelId),r&&t.push(r.id)}else this._errorChildren&&(t=this._errorChildren.map(function(t){return t.id}));this._control.setDescribedByIds(t)}},t.prototype._validateControlChild=function(){if(!this._control)throw v()},t.decorators=[{type:n.Component,args:[{selector:"mat-input-container, mat-form-field",exportAs:"matFormField",template:'<div class="mat-input-wrapper mat-form-field-wrapper"><div class="mat-input-flex mat-form-field-flex" #connectionContainer (click)="_control.onContainerClick && _control.onContainerClick($event)"><div class="mat-input-prefix mat-form-field-prefix" *ngIf="_prefixChildren.length"><ng-content select="[matPrefix]"></ng-content></div><div class="mat-input-infix mat-form-field-infix"><ng-content></ng-content><span class="mat-input-placeholder-wrapper mat-form-field-placeholder-wrapper"><label class="mat-input-placeholder mat-form-field-placeholder" [attr.for]="_control.id" [attr.aria-owns]="_control.id" [class.mat-empty]="_control.empty && !_shouldAlwaysFloat" [class.mat-form-field-empty]="_control.empty && !_shouldAlwaysFloat" [class.mat-accent]="color == \'accent\'" [class.mat-warn]="color == \'warn\'" #placeholder *ngIf="_hasPlaceholder()"><ng-content select="mat-placeholder"></ng-content>{{_control.placeholder}} <span class="mat-placeholder-required mat-form-field-required-marker" aria-hidden="true" *ngIf="!hideRequiredMarker && _control.required">*</span></label></span></div><div class="mat-input-suffix mat-form-field-suffix" *ngIf="_suffixChildren.length"><ng-content select="[matSuffix]"></ng-content></div></div><div class="mat-input-underline mat-form-field-underline" #underline [class.mat-disabled]="_control.disabled"><span class="mat-input-ripple mat-form-field-ripple" [class.mat-accent]="color == \'accent\'" [class.mat-warn]="color == \'warn\'"></span></div><div class="mat-input-subscript-wrapper mat-form-field-subscript-wrapper" [ngSwitch]="_getDisplayedMessages()"><div *ngSwitchCase="\'error\'" [@transitionMessages]="_subscriptAnimationState"><ng-content select="mat-error"></ng-content></div><div class="mat-input-hint-wrapper mat-form-field-hint-wrapper" *ngSwitchCase="\'hint\'" [@transitionMessages]="_subscriptAnimationState"><div *ngIf="hintLabel" [id]="_hintLabelId" class="mat-hint">{{hintLabel}}</div><ng-content select="mat-hint:not([align=\'end\'])"></ng-content><div class="mat-input-hint-spacer mat-form-field-hint-spacer"></div><ng-content select="mat-hint[align=\'end\']"></ng-content></div></div></div>',styles:[".mat-form-field{display:inline-block;position:relative;text-align:left}[dir=rtl] .mat-form-field{text-align:right}.mat-form-field-wrapper{position:relative}.mat-form-field-flex{display:inline-flex;align-items:baseline;width:100%}.mat-form-field-prefix,.mat-form-field-suffix{white-space:nowrap;flex:none}.mat-form-field-prefix .mat-icon,.mat-form-field-suffix .mat-icon{width:1em}.mat-form-field-prefix .mat-icon-button,.mat-form-field-suffix .mat-icon-button{font:inherit;vertical-align:baseline}.mat-form-field-prefix .mat-icon-button .mat-icon,.mat-form-field-suffix .mat-icon-button .mat-icon{font-size:inherit}.mat-form-field-infix{display:block;position:relative;flex:auto;min-width:0}.mat-form-field-placeholder-wrapper{position:absolute;left:0;box-sizing:content-box;width:100%;height:100%;overflow:hidden;pointer-events:none}.mat-form-field-placeholder{position:absolute;left:0;font:inherit;pointer-events:none;width:100%;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;transform:perspective(100px);-ms-transform:none;transform-origin:0 0;transition:transform .4s cubic-bezier(.25,.8,.25,1),color .4s cubic-bezier(.25,.8,.25,1),width .4s cubic-bezier(.25,.8,.25,1);display:none}[dir=rtl] .mat-form-field-placeholder{transform-origin:100% 0;left:auto;right:0}.mat-form-field-can-float.mat-form-field-should-float .mat-form-field-placeholder,.mat-form-field-empty.mat-form-field-placeholder{display:block}.mat-form-field-autofill-control:-webkit-autofill+.mat-form-field-placeholder-wrapper .mat-form-field-placeholder{display:none}.mat-form-field-can-float .mat-form-field-autofill-control:-webkit-autofill+.mat-form-field-placeholder-wrapper .mat-form-field-placeholder{display:block;transition:none}.mat-form-field-placeholder:not(.mat-form-field-empty){transition:none}.mat-form-field-underline{position:absolute;height:1px;width:100%}.mat-form-field-underline.mat-disabled{background-position:0;background-color:transparent}.mat-form-field-underline .mat-form-field-ripple{position:absolute;height:1px;top:0;left:0;width:100%;transform-origin:50%;transform:scaleX(.5);visibility:hidden;transition:background-color .3s cubic-bezier(.55,0,.55,.2)}.mat-focused .mat-form-field-underline .mat-form-field-ripple{height:2px}.mat-focused .mat-form-field-underline .mat-form-field-ripple,.mat-form-field-invalid .mat-form-field-underline .mat-form-field-ripple{visibility:visible;transform:scaleX(1);transition:transform 150ms linear,background-color .3s cubic-bezier(.55,0,.55,.2)}.mat-form-field-subscript-wrapper{position:absolute;width:100%;overflow:hidden}.mat-form-field-placeholder-wrapper .mat-icon,.mat-form-field-subscript-wrapper .mat-icon{width:1em;height:1em;font-size:inherit;vertical-align:baseline}.mat-form-field-hint-wrapper{display:flex}.mat-form-field-hint-spacer{flex:1 0 1em}.mat-error{display:block} .mat-input-element{font:inherit;background:0 0;color:currentColor;border:none;outline:0;padding:0;margin:0;width:100%;max-width:100%;vertical-align:bottom}.mat-input-element:-moz-ui-invalid{box-shadow:none}.mat-input-element::placeholder{color:transparent!important}.mat-input-element::-moz-placeholder{color:transparent!important}.mat-input-element::-webkit-input-placeholder{color:transparent!important}.mat-input-element:-ms-input-placeholder{color:transparent!important}textarea.mat-input-element{resize:vertical;overflow:auto}"],animations:[i.trigger("transitionMessages",[i.state("enter",i.style({opacity:1,transform:"translateY(0%)"})),i.transition("void => enter",[i.style({opacity:0,transform:"translateY(-100%)"}),i.animate("300ms cubic-bezier(0.55, 0, 0.55, 0.2)")])])],host:{class:"mat-input-container mat-form-field","[class.mat-input-invalid]":"_control.errorState","[class.mat-form-field-invalid]":"_control.errorState","[class.mat-form-field-can-float]":"_canPlaceholderFloat","[class.mat-form-field-should-float]":"_control.shouldPlaceholderFloat || _shouldAlwaysFloat","[class.mat-focused]":"_control.focused","[class.mat-primary]":'color == "primary"',"[class.mat-accent]":'color == "accent"',"[class.mat-warn]":'color == "warn"',"[class.ng-untouched]":'_shouldForward("untouched")',"[class.ng-touched]":'_shouldForward("touched")',"[class.ng-pristine]":'_shouldForward("pristine")',"[class.ng-dirty]":'_shouldForward("dirty")',"[class.ng-valid]":'_shouldForward("valid")',"[class.ng-invalid]":'_shouldForward("invalid")',"[class.ng-pending]":'_shouldForward("pending")'},encapsulation:n.ViewEncapsulation.None,preserveWhitespaces:!1,changeDetection:n.ChangeDetectionStrategy.OnPush}]}],t.ctorParameters=function(){return[{type:n.ElementRef},{type:n.Renderer2},{type:n.ChangeDetectorRef},{type:void 0,decorators:[{type:n.Optional},{type:n.Inject,args:[q]}]}]},t.propDecorators={color:[{type:n.Input}],dividerColor:[{type:n.Input}],hideRequiredMarker:[{type:n.Input}],hintLabel:[{type:n.Input}],floatPlaceholder:[{type:n.Input}],underlineRef:[{type:n.ViewChild,args:["underline"]}],_connectionContainerRef:[{type:n.ViewChild,args:["connectionContainer"]}],_placeholder:[{type:n.ViewChild,args:["placeholder"]}],_control:[{type:n.ContentChild,args:[W]}],_placeholderChild:[{ type:n.ContentChild,args:[G]}],_errorChildren:[{type:n.ContentChildren,args:[z]}],_hintChildren:[{type:n.ContentChildren,args:[U]}],_prefixChildren:[{type:n.ContentChildren,args:[J]}],_suffixChildren:[{type:n.ContentChildren,args:[Z]}]},t}(),K=function(){function t(){}return t.decorators=[{type:n.NgModule,args:[{declarations:[z,U,$,G,J,Z],imports:[r.CommonModule,e.PlatformModule],exports:[z,U,$,G,J,Z]}]}],t.ctorParameters=function(){return[]},t}(),Q=function(){function t(t,e){this._elementRef=t,this._platform=e}return Object.defineProperty(t.prototype,"minRows",{get:function(){return this._minRows},set:function(t){this._minRows=t,this._setMinHeight()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"maxRows",{get:function(){return this._maxRows},set:function(t){this._maxRows=t,this._setMaxHeight()},enumerable:!0,configurable:!0}),t.prototype._setMinHeight=function(){var t=this.minRows&&this._cachedLineHeight?this.minRows*this._cachedLineHeight+"px":null;t&&this._setTextareaStyle("minHeight",t)},t.prototype._setMaxHeight=function(){var t=this.maxRows&&this._cachedLineHeight?this.maxRows*this._cachedLineHeight+"px":null;t&&this._setTextareaStyle("maxHeight",t)},t.prototype.ngAfterViewInit=function(){this._platform.isBrowser&&this.resizeToFitContent()},t.prototype._setTextareaStyle=function(t,e){this._elementRef.nativeElement.style[t]=e},t.prototype._cacheTextareaLineHeight=function(){if(!this._cachedLineHeight){var t=this._elementRef.nativeElement,e=t.cloneNode(!1);e.rows=1,e.style.position="absolute",e.style.visibility="hidden",e.style.border="none",e.style.padding="0",e.style.height="",e.style.minHeight="",e.style.maxHeight="",e.style.overflow="hidden",t.parentNode.appendChild(e),this._cachedLineHeight=e.clientHeight,t.parentNode.removeChild(e),this._setMinHeight(),this._setMaxHeight()}},t.prototype.ngDoCheck=function(){this._platform.isBrowser&&this.resizeToFitContent()},t.prototype.resizeToFitContent=function(){if(this._cacheTextareaLineHeight(),this._cachedLineHeight){var t=this._elementRef.nativeElement,e=t.value;e!==this._previousValue&&(t.style.height="auto",t.style.overflow="hidden",t.style.height=t.scrollHeight+"px",t.style.overflow="",this._previousValue=e)}},t.decorators=[{type:n.Directive,args:[{selector:"textarea[mat-autosize], textarea[matTextareaAutosize]",exportAs:"matTextareaAutosize",host:{rows:"1"}}]}],t.ctorParameters=function(){return[{type:n.ElementRef},{type:e.Platform}]},t.propDecorators={minRows:[{type:n.Input,args:["matAutosizeMinRows"]}],maxRows:[{type:n.Input,args:["matAutosizeMaxRows"]}]},t}(),tt=["button","checkbox","color","file","hidden","image","radio","range","reset","submit"],et=0,rt=function(){function t(t,r,n,i,o,a,s){this._elementRef=t,this._renderer=r,this._platform=n,this.ngControl=i,this._parentForm=o,this._parentFormGroup=a,this._defaultErrorStateMatcher=s,this._type="text",this._disabled=!1,this._required=!1,this._uid="mat-input-"+et++,this._previousNativeValue=this.value,this._readonly=!1,this.focused=!1,this.errorState=!1,this.stateChanges=new l.Subject,this.controlType="mat-input",this.placeholder="",this._neverEmptyInputTypes=["date","datetime","datetime-local","month","time","week"].filter(function(t){return e.getSupportedInputTypes().has(t)}),this.id=this.id,n.IOS&&r.listen(t.nativeElement,"keyup",function(t){var e=t.target;e.value||e.selectionStart||e.selectionEnd||(e.setSelectionRange(1,1),e.setSelectionRange(0,0))})}return Object.defineProperty(t.prototype,"disabled",{get:function(){return this.ngControl?this.ngControl.disabled:this._disabled},set:function(t){this._disabled=o.coerceBooleanProperty(t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){return this._id},set:function(t){this._id=t||this._uid},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"required",{get:function(){return this._required},set:function(t){this._required=o.coerceBooleanProperty(t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){return this._type},set:function(t){this._type=t||"text",this._validateType(),!this._isTextarea()&&e.getSupportedInputTypes().has(this._type)&&this._renderer.setProperty(this._elementRef.nativeElement,"type",this._type)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this._elementRef.nativeElement.value},set:function(t){t!==this.value&&(this._elementRef.nativeElement.value=t,this.stateChanges.next())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"readonly",{get:function(){return this._readonly},set:function(t){this._readonly=o.coerceBooleanProperty(t)},enumerable:!0,configurable:!0}),t.prototype.ngOnChanges=function(){this.stateChanges.next()},t.prototype.ngOnDestroy=function(){this.stateChanges.complete()},t.prototype.ngDoCheck=function(){this.ngControl?this._updateErrorState():this._dirtyCheckNativeValue()},t.prototype.focus=function(){this._elementRef.nativeElement.focus()},t.prototype._focusChanged=function(t){t===this.focused||this.readonly||(this.focused=t,this.stateChanges.next())},t.prototype._onInput=function(){},t.prototype._updateErrorState=function(){var t=this.errorState,e=this._parentFormGroup||this._parentForm,r=this.errorStateMatcher||this._defaultErrorStateMatcher,n=this.ngControl?this.ngControl.control:null,i=r.isErrorState(n,e);i!==t&&(this.errorState=i,this.stateChanges.next())},t.prototype._dirtyCheckNativeValue=function(){var t=this.value;this._previousNativeValue!==t&&(this._previousNativeValue=t,this.stateChanges.next())},t.prototype._validateType=function(){if(tt.indexOf(this._type)>-1)throw w(this._type)},t.prototype._isNeverEmpty=function(){return this._neverEmptyInputTypes.indexOf(this._type)>-1},t.prototype._isBadInput=function(){var t=this._elementRef.nativeElement.validity;return t&&t.badInput},t.prototype._isTextarea=function(){var t=this._elementRef.nativeElement,e=this._platform.isBrowser?t.nodeName:t.name;return!!e&&"textarea"===e.toLowerCase()},Object.defineProperty(t.prototype,"empty",{get:function(){return!(this._isNeverEmpty()||null!=this.value&&""!==this.value||this._isBadInput())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"shouldPlaceholderFloat",{get:function(){return this.focused||!this.empty},enumerable:!0,configurable:!0}),t.prototype.setDescribedByIds=function(t){this._ariaDescribedby=t.join(" ")},t.prototype.onContainerClick=function(){this.focus()},t.decorators=[{type:n.Directive,args:[{selector:"input[matInput], textarea[matInput]",exportAs:"matInput",host:{class:"mat-input-element mat-form-field-autofill-control","[attr.id]":"id","[placeholder]":"placeholder","[disabled]":"disabled","[required]":"required","[readonly]":"readonly","[attr.aria-describedby]":"_ariaDescribedby || null","[attr.aria-invalid]":"errorState","(blur)":"_focusChanged(false)","(focus)":"_focusChanged(true)","(input)":"_onInput()"},providers:[{provide:W,useExisting:t}]}]}],t.ctorParameters=function(){return[{type:n.ElementRef},{type:n.Renderer2},{type:e.Platform},{type:d.NgControl,decorators:[{type:n.Optional},{type:n.Self}]},{type:d.NgForm,decorators:[{type:n.Optional}]},{type:d.FormGroupDirective,decorators:[{type:n.Optional}]},{type:O}]},t.propDecorators={disabled:[{type:n.Input}],id:[{type:n.Input}],placeholder:[{type:n.Input}],required:[{type:n.Input}],type:[{type:n.Input}],errorStateMatcher:[{type:n.Input}],value:[{type:n.Input}],readonly:[{type:n.Input}]},t}(),nt=function(){function t(){}return t.decorators=[{type:n.NgModule,args:[{declarations:[rt,Q],imports:[r.CommonModule,K,e.PlatformModule],exports:[K,rt,Q],providers:[O]}]}],t.ctorParameters=function(){return[]},t}();t.MatInputModule=nt,t.MatTextareaAutosize=Q,t.MatInput=rt,t.getMatInputUnsupportedTypeError=w,Object.defineProperty(t,"__esModule",{value:!0})}); //# sourceMappingURL=/Users/karakara/repos/material2/dist/bundles/material-input.umd.min.js.map