UNPKG

@angular/material

Version:
10 lines 40.2 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/core"),require("@angular/common"),require("@angular/cdk/bidi"),require("@angular/cdk/coercion"),require("rxjs/Subject"),require("@angular/platform-browser"),require("@angular/cdk/platform"),require("@angular/cdk/keycodes"),require("@angular/cdk/overlay"),require("@angular/cdk/a11y"),require("@angular/cdk/rxjs"),require("rxjs/observable/merge"),require("rxjs/Subscription"),require("@angular/animations"),require("@angular/cdk/portal"),require("rxjs/observable/of")):"function"==typeof define&&define.amd?define(["exports","@angular/core","@angular/common","@angular/cdk/bidi","@angular/cdk/coercion","rxjs/Subject","@angular/platform-browser","@angular/cdk/platform","@angular/cdk/keycodes","@angular/cdk/overlay","@angular/cdk/a11y","@angular/cdk/rxjs","rxjs/observable/merge","rxjs/Subscription","@angular/animations","@angular/cdk/portal","rxjs/observable/of"],e):e((t.ng=t.ng||{},t.ng.material=t.ng.material||{},t.ng.material.menu=t.ng.material.menu||{}),t.ng.core,t.ng.common,t.ng.cdk.bidi,t.ng.cdk.coercion,t.Rx,t.ng.platformBrowser,t.ng.cdk.platform,t.ng.cdk.keycodes,t.ng.cdk.overlay,t.ng.cdk.a11y,t.ng.cdk.rxjs,t.Rx.Observable,t.Rx,t.ng.animations,t.ng.cdk.portal,t.Rx.Observable)}(this,function(t,e,n,o,i,r,a,s,u,p,l,c,m,d,h,g,f){"use strict";function y(t,e){function n(){this.constructor=t}O(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function b(t){return function(t){function e(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var o=t.apply(this,e)||this;return o._disabled=!1,o}return y(e,t),Object.defineProperty(e.prototype,"disabled",{get:function(){return this._disabled},set:function(t){this._disabled=i.coerceBooleanProperty(t)},enumerable:!0,configurable:!0}),e}(t)}function _(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(null==t)throw TypeError("Cannot convert undefined or null to object");for(var o=0,i=e;o<i.length;o++){var r=i[o];if(null!=r)for(var a in r)r.hasOwnProperty(a)&&(t[a]=r[a])}return t}function v(t,e){for(var n=Array(t),o=0;o<t;o++)n[o]=e(o);return n}function D(t){window.getComputedStyle(t).getPropertyValue("opacity")}function w(t,e,n){var o=Math.max(Math.abs(t-n.left),Math.abs(t-n.right)),i=Math.max(Math.abs(e-n.top),Math.abs(e-n.bottom));return Math.sqrt(o*o+i*i)}function M(){throw Error('mat-menu-trigger: must pass in an mat-menu instance.\n\n Example:\n <mat-menu #menu="matMenu"></mat-menu>\n <button [matMenuTriggerFor]="menu"></button>')}function C(){throw Error('x-position value must be either \'before\' or after\'.\n Example: <mat-menu x-position="before" #menu="matMenu"></mat-menu>')}function k(){throw Error('y-position value must be either \'above\' or below\'.\n Example: <mat-menu y-position="above" #menu="matMenu"></mat-menu>')}function I(t){return function(){return t.scrollStrategies.reposition()}}var O=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},x=(new e.InjectionToken("md-compatibility-mode"),function(){function t(){}return t.decorators=[{type:e.Directive,args:[{selector:"\n [mat-button],\n [mat-fab],\n [mat-icon-button],\n [mat-mini-fab],\n [mat-raised-button],\n [matCardSubtitle],\n [matCardTitle],\n [matCellDef],\n [matColumnDef],\n [matDialogActions],\n [matDialogClose],\n [matDialogContent],\n [matDialogTitle],\n [matHeaderCellDef],\n [matHeaderRowDef],\n [matLine],\n [matRowDef],\n [matStepLabel],\n [matStepperNext],\n [matStepperPrevious],\n [matTabLabel],\n [matTabLink],\n [matTabNav],\n [matTooltip],\n [matInput],\n [matPrefix],\n [matSuffix],\n mat-autocomplete,\n mat-button-toggle,\n mat-button-toggle,\n mat-button-toggle-group,\n mat-card,\n mat-card-actions,\n mat-card-content,\n mat-card-footer,\n mat-card-header,\n mat-card-subtitle,\n mat-card-title,\n mat-card-title-group,\n mat-cell,\n mat-checkbox,\n mat-chip,\n mat-dialog-actions,\n mat-dialog-container,\n mat-dialog-content,\n mat-divider,\n mat-error,\n mat-grid-list,\n mat-grid-tile,\n mat-grid-tile-footer,\n mat-grid-tile-header,\n mat-header-cell,\n mat-header-row,\n mat-hint,\n mat-horizontal-stepper,\n mat-icon,\n mat-input-container,\n mat-form-field,\n mat-list,\n mat-list-item,\n mat-menu,\n mat-nav-list,\n mat-option,\n mat-placeholder,\n mat-progress-bar,\n mat-pseudo-checkbox,\n mat-radio-button,\n mat-radio-group,\n mat-row,\n mat-select,\n mat-sidenav,\n mat-sidenav-container,\n mat-slider,\n mat-spinner,\n mat-step,\n mat-tab,\n mat-table,\n mat-tab-group,\n mat-toolbar,\n mat-vertical-stepper"}]}],t.ctorParameters=function(){return[]},t}()),E=function(){function t(){}return t.decorators=[{type:e.Directive,args:[{selector:"\n [md-button],\n [md-fab],\n [md-icon-button],\n [md-mini-fab],\n [md-raised-button],\n [mdCardSubtitle],\n [mdCardTitle],\n [mdCellDef],\n [mdColumnDef],\n [mdDialogActions],\n [mdDialogClose],\n [mdDialogContent],\n [mdDialogTitle],\n [mdHeaderCellDef],\n [mdHeaderRowDef],\n [mdLine],\n [mdRowDef],\n [mdStepLabel],\n [mdStepperNext],\n [mdStepperPrevious],\n [mdTabLabel],\n [mdTabLink],\n [mdTabNav],\n [mdTooltip],\n [mdInput],\n [mdPrefix],\n [mdSuffix],\n md-autocomplete,\n md-button-toggle,\n md-button-toggle,\n md-button-toggle-group,\n md-card,\n md-card-actions,\n md-card-content,\n md-card-footer,\n md-card-header,\n md-card-subtitle,\n md-card-title,\n md-card-title-group,\n md-cell,\n md-checkbox,\n md-chip,\n md-dialog-actions,\n md-dialog-container,\n md-dialog-content,\n md-divider,\n md-error,\n md-grid-list,\n md-grid-tile,\n md-grid-tile-footer,\n md-grid-tile-header,\n md-header-cell,\n md-header-row,\n md-hint,\n md-horizontal-stepper,\n md-icon,\n md-input-container,\n md-form-field,\n md-list,\n md-list-item,\n md-menu,\n md-nav-list,\n md-option,\n md-placeholder,\n md-progress-bar,\n md-pseudo-checkbox,\n md-radio-button,\n md-radio-group,\n md-row,\n md-select,\n md-sidenav,\n md-sidenav-container,\n md-slider,\n md-spinner,\n md-step,\n md-tab,\n md-table,\n md-tab-group,\n md-toolbar,\n md-vertical-stepper"}]}],t.ctorParameters=function(){return[]},t}(),S=function(){function t(){}return t.decorators=[{type:e.NgModule,args:[{declarations:[x,E],exports:[x,E]}]}],t.ctorParameters=function(){return[]},t}(),R=new e.InjectionToken("mat-sanity-checks"),P=function(){function t(t){this._hasDoneGlobalChecks=!1,this._document="object"==typeof document&&document?document:null,t&&!this._hasDoneGlobalChecks&&e.isDevMode()&&(this._checkDoctype(),this._checkTheme(),this._hasDoneGlobalChecks=!0)}return t.prototype._checkDoctype=function(){this._document&&!this._document.doctype&&console.warn("Current document does not have a doctype. This may cause some Angular Material components not to behave as expected.")},t.prototype._checkTheme=function(){if(this._document&&"function"==typeof getComputedStyle){var t=this._document.createElement("div");t.classList.add("mat-theme-loaded-marker"),this._document.body.appendChild(t);var e=getComputedStyle(t);e&&"none"!==e.display&&console.warn("Could not find Angular Material core theme. Most Material components may not work as expected. For more info refer to the theming guide: https://material.angular.io/guide/theming"),this._document.body.removeChild(t)}},t.decorators=[{type:e.NgModule,args:[{imports:[S,o.BidiModule],exports:[S,o.BidiModule],providers:[{provide:R,useValue:!0}]}]}],t.ctorParameters=function(){return[{type:void 0,decorators:[{type:e.Optional},{type:e.Inject,args:[R]}]}]},t}(),T=new e.InjectionToken("MAT_DATE_LOCALE"),A=function(){function t(){this._localeChanges=new r.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,n){},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,n){return e&&this.compareDate(t,e)<0?e:n&&this.compareDate(t,n)>0?n:t},t}(),F="undefined"!=typeof Intl,N={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"]},j=v(31,function(t){return String(t+1)}),L={long:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],short:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],narrow:["S","M","T","W","T","F","S"]},Y=/^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|(?:(?:\+|-)\d{2}:\d{2}))?)?$/,W=(function(t){function n(e){var n=t.call(this)||this;return n.useUtcForDisplay=!0,t.prototype.setLocale.call(n,e),n}y(n,t),n.prototype.getYear=function(t){return t.getFullYear()},n.prototype.getMonth=function(t){return t.getMonth()},n.prototype.getDate=function(t){return t.getDate()},n.prototype.getDayOfWeek=function(t){return t.getDay()},n.prototype.getMonthNames=function(t){var e=this;if(F){var n=new Intl.DateTimeFormat(this.locale,{month:t});return v(12,function(t){return e._stripDirectionalityCharacters(n.format(new Date(2017,t,1)))})}return N[t]},n.prototype.getDateNames=function(){var t=this;if(F){var e=new Intl.DateTimeFormat(this.locale,{day:"numeric"});return v(31,function(n){return t._stripDirectionalityCharacters(e.format(new Date(2017,0,n+1)))})}return j},n.prototype.getDayOfWeekNames=function(t){var e=this;if(F){var n=new Intl.DateTimeFormat(this.locale,{weekday:t});return v(7,function(t){return e._stripDirectionalityCharacters(n.format(new Date(2017,0,t+1)))})}return L[t]},n.prototype.getYearName=function(t){if(F){var e=new Intl.DateTimeFormat(this.locale,{year:"numeric"});return this._stripDirectionalityCharacters(e.format(t))}return String(this.getYear(t))},n.prototype.getFirstDayOfWeek=function(){return 0},n.prototype.getNumDaysInMonth=function(t){return this.getDate(this._createDateWithOverflow(this.getYear(t),this.getMonth(t)+1,0))},n.prototype.clone=function(t){return this.createDate(this.getYear(t),this.getMonth(t),this.getDate(t))},n.prototype.createDate=function(t,e,n){if(e<0||e>11)throw Error('Invalid month index "'+e+'". Month index has to be between 0 and 11.');if(n<1)throw Error('Invalid date "'+n+'". Date has to be greater than 0.');var o=this._createDateWithOverflow(t,e,n);if(o.getMonth()!=e)throw Error('Invalid date "'+n+'" for month with index "'+e+'".');return o},n.prototype.today=function(){return new Date},n.prototype.parse=function(t){return"number"==typeof t?new Date(t):t?new Date(Date.parse(t)):null},n.prototype.format=function(t,e){if(!this.isValid(t))throw Error("NativeDateAdapter: Cannot format invalid date.");if(F){this.useUtcForDisplay&&(t=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds())),e=_({},e,{timeZone:"utc"}));var n=new Intl.DateTimeFormat(this.locale,e);return this._stripDirectionalityCharacters(n.format(t))}return this._stripDirectionalityCharacters(t.toDateString())},n.prototype.addCalendarYears=function(t,e){return this.addCalendarMonths(t,12*e)},n.prototype.addCalendarMonths=function(t,e){var n=this._createDateWithOverflow(this.getYear(t),this.getMonth(t)+e,this.getDate(t));return this.getMonth(n)!=((this.getMonth(t)+e)%12+12)%12&&(n=this._createDateWithOverflow(this.getYear(n),this.getMonth(n),0)),n},n.prototype.addCalendarDays=function(t,e){return this._createDateWithOverflow(this.getYear(t),this.getMonth(t),this.getDate(t)+e)},n.prototype.toIso8601=function(t){return[t.getUTCFullYear(),this._2digit(t.getUTCMonth()+1),this._2digit(t.getUTCDate())].join("-")},n.prototype.fromIso8601=function(t){if(Y.test(t)){var e=new Date(t);if(this.isValid(e))return e}return null},n.prototype.isDateInstance=function(t){return t instanceof Date},n.prototype.isValid=function(t){return!isNaN(t.getTime())},n.prototype._createDateWithOverflow=function(t,e,n){var o=new Date(t,e,n);return t>=0&&t<100&&o.setFullYear(this.getYear(o)-1900),o},n.prototype._2digit=function(t){return("00"+t).slice(-2)},n.prototype._stripDirectionalityCharacters=function(t){return t.replace(/[\u200e\u200f]/g,"")},n.decorators=[{type:e.Injectable}],n.ctorParameters=function(){return[{type:void 0,decorators:[{type:e.Optional},{type:e.Inject,args:[T]}]}]}}(A),new e.InjectionToken("mat-date-formats"),function(t){function n(){var n=t.call(this)||this;return n._hammer="undefined"!=typeof window?window.Hammer:null,n.events=n._hammer?["longpress","slide","slidestart","slideend","slideright","slideleft"]:[],!n._hammer&&e.isDevMode()&&console.warn("Could not find HammerJS. Certain Angular Material components may not work correctly."),n}y(n,t),n.prototype.buildHammer=function(t){var e=new this._hammer(t),n=new this._hammer.Pan,o=new this._hammer.Swipe,i=new this._hammer.Press,r=this._createRecognizer(n,{event:"slide",threshold:0},o),a=this._createRecognizer(i,{event:"longpress",time:500});return n.recognizeWith(o),e.add([o,i,n,r,a]),e},n.prototype._createRecognizer=function(t,e){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];var i=new t.constructor(e);return n.push(t),n.forEach(function(t){return i.recognizeWith(t)}),i},n.decorators=[{type:e.Injectable}],n.ctorParameters=function(){return[]}}(a.HammerGestureConfig),{});W.FADING_IN=0,W.VISIBLE=1,W.FADING_OUT=2,W.HIDDEN=3,W[W.FADING_IN]="FADING_IN",W[W.VISIBLE]="VISIBLE",W[W.FADING_OUT]="FADING_OUT",W[W.HIDDEN]="HIDDEN";var H=function(){function t(t,e,n){this._renderer=t,this.element=e,this.config=n,this.state=W.HIDDEN}return t.prototype.fadeOut=function(){this._renderer.fadeOutRipple(this)},t}(),V=function(){function t(t,e,n){this._ngZone=e,this._isPointerDown=!1,this._triggerEvents=new Map,this._activeRipples=new Set,this.rippleConfig={},this.rippleDisabled=!1,n.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,n){var o=this;void 0===n&&(n={});var i=this._containerElement.getBoundingClientRect();n.centered&&(t=i.left+i.width/2,e=i.top+i.height/2);var r=n.radius||w(t,e,i),a=1/(n.speedFactor||1)*450,s=t-i.left,u=e-i.top,p=document.createElement("div");p.classList.add("mat-ripple-element"),p.style.left=s-r+"px",p.style.top=u-r+"px",p.style.height=2*r+"px",p.style.width=2*r+"px",p.style.backgroundColor=n.color||null,p.style.transitionDuration=a+"ms",this._containerElement.appendChild(p),D(p),p.style.transform="scale(1)";var l=new H(this,p,n);return l.state=W.FADING_IN,this._activeRipples.add(l),this.runTimeoutOutsideZone(function(){l.state=W.VISIBLE,n.persistent||o._isPointerDown||l.fadeOut()},a),l},t.prototype.fadeOutRipple=function(t){if(this._activeRipples.delete(t)){var e=t.element;e.style.transitionDuration="400ms",e.style.opacity="0",t.state=W.FADING_OUT,this.runTimeoutOutsideZone(function(){t.state=W.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,n){e._triggerElement.removeEventListener(n,t)}),t&&this._ngZone.runOutsideAngular(function(){e._triggerEvents.forEach(function(e,n){return t.addEventListener(n,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!==W.VISIBLE||t.fadeOut()})},t.prototype.onPointerLeave=function(){this._isPointerDown&&this.onPointerUp()},t.prototype.onTouchstart=function(t){if(!this.rippleDisabled){var e=t.touches[0],n=e.clientX,o=e.clientY;this._isPointerDown=!0,this.fadeInRipple(n,o,this.rippleConfig)}},t.prototype.runTimeoutOutsideZone=function(t,e){void 0===e&&(e=0),this._ngZone.runOutsideAngular(function(){return setTimeout(t,e)})},t}(),U=new e.InjectionToken("mat-ripple-global-options"),B=function(){function t(t,e,n,o){this.radius=0,this.speedFactor=1,this._rippleRenderer=new V(t,e,n),this._globalOptions=o||{},this._updateRippleRenderer()}return 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,n){return void 0===n&&(n=this.rippleConfig),this._rippleRenderer.fadeInRipple(t,e,n)},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:e.Directive,args:[{selector:"[mat-ripple], [matRipple]",exportAs:"matRipple",host:{class:"mat-ripple","[class.mat-ripple-unbounded]":"unbounded"}}]}],t.ctorParameters=function(){return[{type:e.ElementRef},{type:e.NgZone},{type:s.Platform},{type:void 0,decorators:[{type:e.Optional},{type:e.Inject,args:[U]}]}]},t.propDecorators={trigger:[{type:e.Input,args:["matRippleTrigger"]}],centered:[{type:e.Input,args:["matRippleCentered"]}],disabled:[{type:e.Input,args:["matRippleDisabled"]}],radius:[{type:e.Input,args:["matRippleRadius"]}],speedFactor:[{type:e.Input,args:["matRippleSpeedFactor"]}],color:[{type:e.Input,args:["matRippleColor"]}],unbounded:[{type:e.Input,args:["matRippleUnbounded"]}]},t}(),q=function(){function t(){}return t.decorators=[{type:e.NgModule,args:[{imports:[P,s.PlatformModule],exports:[B,P],declarations:[B]}]}],t.ctorParameters=function(){return[]},t}(),G=function(){function t(){}return t}(),z=b(G),X=0,Z=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e._labelId="mat-optgroup-label-"+X++,e}return y(n,t),n.decorators=[{type:e.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:e.ViewEncapsulation.None,preserveWhitespaces:!1,changeDetection:e.ChangeDetectionStrategy.OnPush,inputs:["disabled"],host:{class:"mat-optgroup",role:"group","[class.mat-optgroup-disabled]":"disabled","[attr.aria-disabled]":"disabled.toString()","[attr.aria-labelledby]":"_labelId"}}]}],n.ctorParameters=function(){return[]},n.propDecorators={label:[{type:e.Input}]},n}(z),J=0,K=function(){function t(t,e){void 0===e&&(e=!1),this.source=t,this.isUserInput=e}return t}(),$=(function(){function t(t,n,o){this._element=t,this._changeDetectorRef=n,this.group=o,this._selected=!1,this._active=!1,this._multiple=!1,this._disableRipple=!1,this._disabled=!1,this._id="mat-option-"+J++,this.onSelectionChange=new e.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=i.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!==u.ENTER&&t.keyCode!==u.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 K(this,t))},t.countGroupLabelsBeforeOption=function(t,e,n){if(n.length){for(var o=e.toArray(),i=n.toArray(),r=0,a=0;a<t+1;a++)o[a].group&&o[a].group===i[r]&&r++;return r}return 0},t.decorators=[{type:e.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:e.ViewEncapsulation.None,preserveWhitespaces:!1,changeDetection:e.ChangeDetectionStrategy.OnPush}]}],t.ctorParameters=function(){return[{type:e.ElementRef},{type:e.ChangeDetectorRef},{type:Z,decorators:[{type:e.Optional}]}]},t.propDecorators={value:[{type:e.Input}],disabled:[{type:e.Input}],onSelectionChange:[{type:e.Output}]}}(),new e.InjectionToken("mat-placeholder-global-options"),h.trigger("transformMenu",[h.state("void",h.style({opacity:0,transform:"scale(0.01, 0.01)"})),h.state("enter-start",h.style({opacity:1,transform:"scale(1, 0.5)"})),h.state("enter",h.style({transform:"scale(1, 1)"})),h.transition("void => enter-start",h.animate("100ms linear")),h.transition("enter-start => enter",h.animate("300ms cubic-bezier(0.25, 0.8, 0.25, 1)")),h.transition("* => void",h.animate("150ms 50ms linear",h.style({opacity:0})))])),Q=h.trigger("fadeInItems",[h.state("showing",h.style({opacity:1})),h.transition("void => *",[h.style({opacity:0}),h.animate("400ms 100ms cubic-bezier(0.55, 0, 0.55, 0.2)")])]),tt=function(){function t(){}return t}(),et=b(tt),nt=function(t){function n(e){var n=t.call(this)||this;return n._elementRef=e,n.hover=new r.Subject,n._highlighted=!1,n._triggersSubmenu=!1,n}return y(n,t),n.prototype.focus=function(){this._getHostElement().focus()},n.prototype.ngOnDestroy=function(){this.hover.complete()},n.prototype._getTabIndex=function(){return this.disabled?"-1":"0"},n.prototype._getHostElement=function(){return this._elementRef.nativeElement},n.prototype._checkDisabled=function(t){this.disabled&&(t.preventDefault(),t.stopPropagation())},n.prototype._emitHoverEvent=function(){this.disabled||this.hover.next(this)},n.prototype.getLabel=function(){var t=this._elementRef.nativeElement,e="";if(t.childNodes)for(var n=t.childNodes.length,o=0;o<n;o++)t.childNodes[o].nodeType===Node.TEXT_NODE&&(e+=t.childNodes[o].textContent);return e.trim()},n.decorators=[{type:e.Component,args:[{selector:"[mat-menu-item]",exportAs:"matMenuItem",inputs:["disabled"],host:{role:"menuitem",class:"mat-menu-item","[class.mat-menu-item-highlighted]":"_highlighted","[class.mat-menu-item-submenu-trigger]":"_triggersSubmenu","[attr.tabindex]":"_getTabIndex()","[attr.aria-disabled]":"disabled.toString()","[attr.disabled]":"disabled || null","(click)":"_checkDisabled($event)","(mouseenter)":"_emitHoverEvent()"},changeDetection:e.ChangeDetectionStrategy.OnPush,encapsulation:e.ViewEncapsulation.None,preserveWhitespaces:!1,template:'<ng-content></ng-content><div class="mat-menu-ripple" *ngIf="!disabled" mat-ripple [matRippleTrigger]="_getHostElement()"></div>'}]}],n.ctorParameters=function(){return[{type:e.ElementRef}]},n}(et),ot=new e.InjectionToken("mat-menu-default-options"),it=function(){function t(t,n,o){this._elementRef=t,this._ngZone=n,this._defaultOptions=o,this._xPosition=this._defaultOptions.xPosition,this._yPosition=this._defaultOptions.yPosition,this._tabSubscription=d.Subscription.EMPTY,this._classList={},this._panelAnimationState="void",this.overlapTrigger=this._defaultOptions.overlapTrigger,this.close=new e.EventEmitter}return Object.defineProperty(t.prototype,"xPosition",{get:function(){return this._xPosition},set:function(t){"before"!==t&&"after"!==t&&C(),this._xPosition=t,this.setPositionClasses()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"yPosition",{get:function(){return this._yPosition},set:function(t){"above"!==t&&"below"!==t&&k(),this._yPosition=t,this.setPositionClasses()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"classList",{set:function(t){t&&t.length&&(this._classList=t.split(" ").reduce(function(t,e){return t[e]=!0,t},{}),this._elementRef.nativeElement.className="",this.setPositionClasses())},enumerable:!0,configurable:!0}),t.prototype.ngAfterContentInit=function(){var t=this;this._keyManager=new l.FocusKeyManager(this.items).withWrap().withTypeAhead(),this._tabSubscription=this._keyManager.tabOut.subscribe(function(){return t.close.emit("keydown")})},t.prototype.ngOnDestroy=function(){this._tabSubscription.unsubscribe(),this.close.emit(),this.close.complete()},t.prototype.hover=function(){var t=this;return this.items?c.RxChain.from(this.items.changes).call(c.startWith,this.items).call(c.switchMap,function(t){return m.merge.apply(void 0,t.map(function(t){return t.hover}))}).result():c.RxChain.from(this._ngZone.onStable.asObservable()).call(c.first).call(c.switchMap,function(){return t.hover()}).result()},t.prototype._handleKeydown=function(t){switch(t.keyCode){case u.ESCAPE:this.close.emit("keydown"),t.stopPropagation();break;case u.LEFT_ARROW:this.parentMenu&&"ltr"===this.direction&&this.close.emit("keydown");break;case u.RIGHT_ARROW:this.parentMenu&&"rtl"===this.direction&&this.close.emit("keydown");break;default:this._keyManager.onKeydown(t)}},t.prototype.focusFirstItem=function(){this._keyManager.setFirstItemActive()},t.prototype.setPositionClasses=function(t,e){void 0===t&&(t=this.xPosition),void 0===e&&(e=this.yPosition),this._classList["mat-menu-before"]="before"===t,this._classList["mat-menu-after"]="after"===t,this._classList["mat-menu-above"]="above"===e,this._classList["mat-menu-below"]="below"===e},t.prototype.setElevation=function(t){var e="mat-elevation-z"+(2+t),n=Object.keys(this._classList).find(function(t){return t.startsWith("mat-elevation-z")});n&&n!==this._previousElevation||(this._previousElevation&&(this._classList[this._previousElevation]=!1),this._classList[e]=!0,this._previousElevation=e)},t.prototype._startAnimation=function(){this._panelAnimationState="enter-start"},t.prototype._resetAnimation=function(){this._panelAnimationState="void"},t.prototype._onAnimationDone=function(t){"enter-start"===t.toState&&(this._panelAnimationState="enter")},t.decorators=[{type:e.Component,args:[{selector:"mat-menu",template:'<ng-template><div class="mat-menu-panel" [ngClass]="_classList" (keydown)="_handleKeydown($event)" (click)="close.emit(\'click\')" [@transformMenu]="_panelAnimationState" (@transformMenu.done)="_onAnimationDone($event)" role="menu"><div class="mat-menu-content" [@fadeInItems]="\'showing\'"><ng-content></ng-content></div></div></ng-template>', styles:[".mat-menu-panel{min-width:112px;max-width:280px;overflow:auto;-webkit-overflow-scrolling:touch;max-height:calc(100vh - 48px);border-radius:2px}.mat-menu-panel:not([class*=mat-elevation-z]){box-shadow:0 3px 1px -2px rgba(0,0,0,.2),0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12)}.mat-menu-panel.mat-menu-after.mat-menu-below{transform-origin:left top}.mat-menu-panel.mat-menu-after.mat-menu-above{transform-origin:left bottom}.mat-menu-panel.mat-menu-before.mat-menu-below{transform-origin:right top}.mat-menu-panel.mat-menu-before.mat-menu-above{transform-origin:right bottom}[dir=rtl] .mat-menu-panel.mat-menu-after.mat-menu-below{transform-origin:right top}[dir=rtl] .mat-menu-panel.mat-menu-after.mat-menu-above{transform-origin:right bottom}[dir=rtl] .mat-menu-panel.mat-menu-before.mat-menu-below{transform-origin:left top}[dir=rtl] .mat-menu-panel.mat-menu-before.mat-menu-above{transform-origin:left bottom}.mat-menu-panel.ng-animating{pointer-events:none}@media screen and (-ms-high-contrast:active){.mat-menu-panel{outline:solid 1px}}.mat-menu-content{padding-top:8px;padding-bottom:8px}.mat-menu-item{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;outline:0;border:none;-webkit-tap-highlight-color:transparent;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;line-height:48px;height:48px;padding:0 16px;text-align:left;text-decoration:none;position:relative}.mat-menu-item[disabled]{cursor:default}[dir=rtl] .mat-menu-item{text-align:right}.mat-menu-item .mat-icon{margin-right:16px}[dir=rtl] .mat-menu-item .mat-icon{margin-left:16px;margin-right:0}.mat-menu-item .mat-icon{vertical-align:middle}.mat-menu-item-submenu-trigger{padding-right:32px}.mat-menu-item-submenu-trigger::after{width:0;height:0;border-style:solid;border-width:5px 0 5px 5px;border-color:transparent transparent transparent currentColor;content:'';display:inline-block;position:absolute;top:50%;right:16px;transform:translateY(-50%)}[dir=rtl] .mat-menu-item-submenu-trigger{padding-right:8px;padding-left:32px}[dir=rtl] .mat-menu-item-submenu-trigger::after{right:auto;left:16px;transform:rotateY(180deg) translateY(-50%)}button.mat-menu-item{width:100%}.mat-menu-ripple{top:0;left:0;right:0;bottom:0;position:absolute}"],changeDetection:e.ChangeDetectionStrategy.OnPush,encapsulation:e.ViewEncapsulation.None,preserveWhitespaces:!1,animations:[$,Q],exportAs:"matMenu"}]}],t.ctorParameters=function(){return[{type:e.ElementRef},{type:e.NgZone},{type:void 0,decorators:[{type:e.Inject,args:[ot]}]}]},t.propDecorators={xPosition:[{type:e.Input}],yPosition:[{type:e.Input}],templateRef:[{type:e.ViewChild,args:[e.TemplateRef]}],items:[{type:e.ContentChildren,args:[nt]}],overlapTrigger:[{type:e.Input}],classList:[{type:e.Input,args:["class"]}],close:[{type:e.Output}]},t}(),rt=new e.InjectionToken("mat-menu-scroll-strategy"),at={provide:rt,deps:[p.Overlay],useFactory:I},st=function(){function t(t,n,o,i,r,a,s){this._overlay=t,this._element=n,this._viewContainerRef=o,this._scrollStrategy=i,this._parentMenu=r,this._menuItemInstance=a,this._dir=s,this._overlayRef=null,this._menuOpen=!1,this._closeSubscription=d.Subscription.EMPTY,this._positionSubscription=d.Subscription.EMPTY,this._hoverSubscription=d.Subscription.EMPTY,this._openedByMouse=!1,this.onMenuOpen=new e.EventEmitter,this.onMenuClose=new e.EventEmitter,a&&(a._triggersSubmenu=this.triggersSubmenu())}return Object.defineProperty(t.prototype,"_deprecatedMatMenuTriggerFor",{get:function(){return this.menu},set:function(t){this.menu=t},enumerable:!0,configurable:!0}),t.prototype.ngAfterContentInit=function(){var t=this;this._checkMenu(),this.menu.close.subscribe(function(e){t._destroyMenu(),"click"===e&&t._parentMenu&&t._parentMenu.close.emit(e)}),this.triggersSubmenu()&&(this._hoverSubscription=c.filter.call(this._parentMenu.hover(),function(e){return e===t._menuItemInstance}).subscribe(function(){t._openedByMouse=!0,t.openMenu()}))},t.prototype.ngOnDestroy=function(){this._overlayRef&&(this._overlayRef.dispose(),this._overlayRef=null),this._cleanUpSubscriptions()},Object.defineProperty(t.prototype,"menuOpen",{get:function(){return this._menuOpen},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dir",{get:function(){return this._dir&&"rtl"===this._dir.value?"rtl":"ltr"},enumerable:!0,configurable:!0}),t.prototype.triggersSubmenu=function(){return!(!this._menuItemInstance||!this._parentMenu)},t.prototype.toggleMenu=function(){return this._menuOpen?this.closeMenu():this.openMenu()},t.prototype.openMenu=function(){var t=this;this._menuOpen||(this._createOverlay().attach(this._portal),this._closeSubscription=this._menuClosingActions().subscribe(function(){t.menu.close.emit()}),this._initMenu(),this.menu instanceof it&&this.menu._startAnimation())},t.prototype.closeMenu=function(){this.menu.close.emit()},t.prototype.focus=function(){this._element.nativeElement.focus()},t.prototype._destroyMenu=function(){this._overlayRef&&this.menuOpen&&(this._resetMenu(),this._overlayRef.detach(),this._closeSubscription.unsubscribe(),this.menu instanceof it&&this.menu._resetAnimation())},t.prototype._initMenu=function(){this.menu.parentMenu=this.triggersSubmenu()?this._parentMenu:void 0,this.menu.direction=this.dir,this._setMenuElevation(),this._setIsMenuOpen(!0),this._openedByMouse||this.menu.focusFirstItem()},t.prototype._setMenuElevation=function(){if(this.menu.setElevation){for(var t=0,e=this.menu.parentMenu;e;)t++,e=e.parentMenu;this.menu.setElevation(t)}},t.prototype._resetMenu=function(){this._setIsMenuOpen(!1),this._openedByMouse||this.focus(),this._openedByMouse=!1},t.prototype._setIsMenuOpen=function(t){this._menuOpen=t,this._menuOpen?this.onMenuOpen.emit():this.onMenuClose.emit(),this.triggersSubmenu()&&(this._menuItemInstance._highlighted=t)},t.prototype._checkMenu=function(){this.menu||M()},t.prototype._createOverlay=function(){if(!this._overlayRef){this._portal=new g.TemplatePortal(this.menu.templateRef,this._viewContainerRef);var t=this._getOverlayConfig();this._subscribeToPositions(t.positionStrategy),this._overlayRef=this._overlay.create(t)}return this._overlayRef},t.prototype._getOverlayConfig=function(){return new p.OverlayConfig({positionStrategy:this._getPosition(),hasBackdrop:!this.triggersSubmenu(),backdropClass:"cdk-overlay-transparent-backdrop",direction:this.dir,scrollStrategy:this._scrollStrategy()})},t.prototype._subscribeToPositions=function(t){var e=this;this._positionSubscription=t.onPositionChange.subscribe(function(t){var n="start"===t.connectionPair.overlayX?"after":"before",o="top"===t.connectionPair.overlayY?"below":"above";e.menu.setPositionClasses(n,o)})},t.prototype._getPosition=function(){var t="before"===this.menu.xPosition?["end","start"]:["start","end"],e=t[0],n=t[1],o="above"===this.menu.yPosition?["bottom","top"]:["top","bottom"],i=o[0],r=o[1],a=[i,r],s=a[0],u=a[1],p=[e,n],l=p[0],c=p[1],m=0;return this.triggersSubmenu()?(c=e="before"===this.menu.xPosition?"start":"end",n=l="end"===e?"start":"end",m="bottom"===i?8:-8):this.menu.overlapTrigger||(s="top"===i?"bottom":"top",u="top"===r?"bottom":"top"),this._overlay.position().connectedTo(this._element,{originX:e,originY:s},{overlayX:l,overlayY:i}).withDirection(this.dir).withOffsetY(m).withFallbackPosition({originX:n,originY:s},{overlayX:c,overlayY:i}).withFallbackPosition({originX:e,originY:u},{overlayX:l,overlayY:r}).withFallbackPosition({originX:n,originY:u},{overlayX:c,overlayY:r})},t.prototype._cleanUpSubscriptions=function(){this._closeSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this._hoverSubscription.unsubscribe()},t.prototype._menuClosingActions=function(){var t=this,e=this._overlayRef.backdropClick(),n=this._parentMenu?this._parentMenu.close:f.of(),o=this._parentMenu?c.RxChain.from(this._parentMenu.hover()).call(c.filter,function(e){return e!==t._menuItemInstance}).call(c.filter,function(){return t._menuOpen}).result():f.of();return m.merge(e,n,o)},t.prototype._handleMousedown=function(t){l.isFakeMousedownFromScreenReader(t)||(this._openedByMouse=!0,this.triggersSubmenu()&&t.preventDefault())},t.prototype._handleKeydown=function(t){var e=t.keyCode;this.triggersSubmenu()&&(e===u.RIGHT_ARROW&&"ltr"===this.dir||e===u.LEFT_ARROW&&"rtl"===this.dir)&&this.openMenu()},t.prototype._handleClick=function(t){this.triggersSubmenu()?(t.stopPropagation(),this.openMenu()):this.toggleMenu()},t.decorators=[{type:e.Directive,args:[{selector:"[mat-menu-trigger-for], [matMenuTriggerFor]",host:{"aria-haspopup":"true","(mousedown)":"_handleMousedown($event)","(keydown)":"_handleKeydown($event)","(click)":"_handleClick($event)"},exportAs:"matMenuTrigger"}]}],t.ctorParameters=function(){return[{type:p.Overlay},{type:e.ElementRef},{type:e.ViewContainerRef},{type:void 0,decorators:[{type:e.Inject,args:[rt]}]},{type:it,decorators:[{type:e.Optional}]},{type:nt,decorators:[{type:e.Optional},{type:e.Self}]},{type:o.Directionality,decorators:[{type:e.Optional}]}]},t.propDecorators={_deprecatedMatMenuTriggerFor:[{type:e.Input,args:["mat-menu-trigger-for"]}],menu:[{type:e.Input,args:["matMenuTriggerFor"]}],onMenuOpen:[{type:e.Output}],onMenuClose:[{type:e.Output}]},t}(),ut=function(){function t(){}return t.decorators=[{type:e.NgModule,args:[{imports:[p.OverlayModule,n.CommonModule,q,P],exports:[it,nt,st,P],declarations:[it,nt,st],providers:[at,{provide:ot,useValue:{overlapTrigger:!0,xPosition:"after",yPosition:"below"}}]}]}],t.ctorParameters=function(){return[]},t}();t.MAT_MENU_SCROLL_STRATEGY=rt,t.fadeInItems=Q,t.transformMenu=$,t.MatMenuModule=ut,t.MatMenu=it,t.MAT_MENU_DEFAULT_OPTIONS=ot,t.MatMenuItem=nt,t.MatMenuTrigger=st,t.ɵa22=tt,t.ɵb22=et,t.ɵd22=at,t.ɵc22=I,Object.defineProperty(t,"__esModule",{value:!0})}); //# sourceMappingURL=/Users/karakara/repos/material2/dist/bundles/material-menu.umd.min.js.map