UNPKG

@angular/material

Version:
75 lines (73 loc) 104 kB
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/cdk/a11y"),require("@angular/cdk/overlay"),require("@angular/cdk/portal"),require("@angular/common"),require("@angular/core"),require("@angular/material/button"),require("@angular/material/dialog"),require("@angular/cdk/scrolling"),require("@angular/material/core"),require("rxjs"),require("@angular/cdk/keycodes"),require("@angular/cdk/bidi"),require("rxjs/operators"),require("@angular/cdk/coercion"),require("@angular/animations"),require("@angular/forms"),require("@angular/material/form-field"),require("@angular/material/input")):"function"==typeof define&&define.amd?define("@angular/material/datepicker",["exports","@angular/cdk/a11y","@angular/cdk/overlay","@angular/cdk/portal","@angular/common","@angular/core","@angular/material/button","@angular/material/dialog","@angular/cdk/scrolling","@angular/material/core","rxjs","@angular/cdk/keycodes","@angular/cdk/bidi","rxjs/operators","@angular/cdk/coercion","@angular/animations","@angular/forms","@angular/material/form-field","@angular/material/input"],e):e(((t=t||self).ng=t.ng||{},t.ng.material=t.ng.material||{},t.ng.material.datepicker={}),t.ng.cdk.a11y,t.ng.cdk.overlay,t.ng.cdk.portal,t.ng.common,t.ng.core,t.ng.material.button,t.ng.material.dialog,t.ng.cdk.scrolling,t.ng.material.core,t.rxjs,t.ng.cdk.keycodes,t.ng.cdk.bidi,t.rxjs.operators,t.ng.cdk.coercion,t.ng.animations,t.ng.forms,t.ng.material.formField,t.ng.material.input)}(this,(function(t,e,a,n,r,i,o,s,l,d,c,p,u,h,_,m,g,y,f){"use strict"; /** * @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 */ /** * @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 */ var v=function(){function t(){this.changes=new c.Subject,this.calendarLabel="Calendar",this.openCalendarLabel="Open calendar",this.closeCalendarLabel="Close calendar",this.prevMonthLabel="Previous month",this.nextMonthLabel="Next month",this.prevYearLabel="Previous year",this.nextYearLabel="Next year",this.prevMultiYearLabel="Previous 20 years",this.nextMultiYearLabel="Next 20 years",this.switchToMonthViewLabel="Choose date",this.switchToMultiYearViewLabel="Choose month and year"}return t.prototype.formatYearRange=function(t,e){return t+" – "+e},t}();v.ɵprov=i.ɵɵdefineInjectable({factory:function t(){return new v},token:v,providedIn:"root"}),v.decorators=[{type:i.Injectable,args:[{providedIn:"root"}]}]; /** * @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 */ var b=function b(t,e,a,n,r,i,o){void 0===r&&(r={}),void 0===i&&(i=t),this.value=t,this.displayValue=e,this.ariaLabel=a,this.enabled=n,this.cssClasses=r,this.compareValue=i,this.rawValue=o},D=function(){function t(t,e){var a=this;this._elementRef=t,this._ngZone=e,this.numCols=7,this.activeCell=0,this.isRange=!1,this.cellAspectRatio=1,this.previewStart=null,this.previewEnd=null,this.selectedValueChange=new i.EventEmitter,this.previewChange=new i.EventEmitter,this._enterHandler=function(t){if(a._skipNextFocus&&"focus"===t.type)a._skipNextFocus=!1;else if(t.target&&a.isRange){var e=a._getCellFromElement(t.target);e&&a._ngZone.run((function(){return a.previewChange.emit({value:e.enabled?e:null,event:t})}))}},this._leaveHandler=function(t){null!==a.previewEnd&&a.isRange&&t.target&&C(t.target)&&a._ngZone.run((function(){return a.previewChange.emit({value:null,event:t})}))},e.runOutsideAngular((function(){var e=t.nativeElement;e.addEventListener("mouseenter",a._enterHandler,!0),e.addEventListener("focus",a._enterHandler,!0),e.addEventListener("mouseleave",a._leaveHandler,!0),e.addEventListener("blur",a._leaveHandler,!0)}))}return t.prototype._cellClicked=function(t,e){t.enabled&&this.selectedValueChange.emit({value:t.value,event:e})},t.prototype._isSelected=function(t){return this.startValue===t||this.endValue===t},t.prototype.ngOnChanges=function(t){var e=t.numCols,a=this.rows,n=this.numCols;(t.rows||e)&&(this._firstRowOffset=a&&a.length&&a[0].length?n-a[0].length:0),(t.cellAspectRatio||e||!this._cellPadding)&&(this._cellPadding=50*this.cellAspectRatio/n+"%"),!e&&this._cellWidth||(this._cellWidth=100/n+"%")},t.prototype.ngOnDestroy=function(){var t=this._elementRef.nativeElement;t.removeEventListener("mouseenter",this._enterHandler,!0),t.removeEventListener("focus",this._enterHandler,!0),t.removeEventListener("mouseleave",this._leaveHandler,!0),t.removeEventListener("blur",this._leaveHandler,!0)},t.prototype._isActiveCell=function(t,e){var a=t*this.numCols+e;return t&&(a-=this._firstRowOffset),a==this.activeCell},t.prototype._focusActiveCell=function(t){var e=this;void 0===t&&(t=!0),this._ngZone.runOutsideAngular((function(){e._ngZone.onStable.pipe(h.take(1)).subscribe((function(){var a=e._elementRef.nativeElement.querySelector(".mat-calendar-body-active");a&&(t||(e._skipNextFocus=!0),a.focus())}))}))},t.prototype._isRangeStart=function(t){return A(t,this.startValue,this.endValue)},t.prototype._isRangeEnd=function(t){return w(t,this.startValue,this.endValue)},t.prototype._isInRange=function(t){return k(t,this.startValue,this.endValue,this.isRange)},t.prototype._isComparisonStart=function(t){return A(t,this.comparisonStart,this.comparisonEnd)},t.prototype._isComparisonBridgeStart=function(t,e,a){if(!this._isComparisonStart(t)||this._isRangeStart(t)||!this._isInRange(t))return!1;var n=this.rows[e][a-1];if(!n){var r=this.rows[e-1];n=r&&r[r.length-1]}return n&&!this._isRangeEnd(n.compareValue)},t.prototype._isComparisonBridgeEnd=function(t,e,a){if(!this._isComparisonEnd(t)||this._isRangeEnd(t)||!this._isInRange(t))return!1;var n=this.rows[e][a+1];if(!n){var r=this.rows[e+1];n=r&&r[0]}return n&&!this._isRangeStart(n.compareValue)},t.prototype._isComparisonEnd=function(t){return w(t,this.comparisonStart,this.comparisonEnd)},t.prototype._isInComparisonRange=function(t){return k(t,this.comparisonStart,this.comparisonEnd,this.isRange)},t.prototype._isComparisonIdentical=function(t){return this.comparisonStart===this.comparisonEnd&&t===this.comparisonStart},t.prototype._isPreviewStart=function(t){return A(t,this.previewStart,this.previewEnd)},t.prototype._isPreviewEnd=function(t){return w(t,this.previewStart,this.previewEnd)},t.prototype._isInPreview=function(t){return k(t,this.previewStart,this.previewEnd,this.isRange)},t.prototype._getCellFromElement=function(t){var e;if(C(t)?e=t:C(t.parentNode)&&(e=t.parentNode),e){var a=e.getAttribute("data-mat-row"),n=e.getAttribute("data-mat-col");if(a&&n)return this.rows[parseInt(a)][parseInt(n)]}return null},t}();function C(t){return"TD"===t.nodeName}function A(t,e,a){return null!==a&&e!==a&&t<a&&t===e}function w(t,e,a){return null!==e&&e!==a&&t>=e&&t===a}function k(t,e,a,n){return n&&null!==e&&null!==a&&e!==a&&t>=e&&t<=a} /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */D.decorators=[{type:i.Component,args:[{selector:"[mat-calendar-body]",template:'\x3c!--\n If there\'s not enough space in the first row, create a separate label row. We mark this row as\n aria-hidden because we don\'t want it to be read out as one of the weeks in the month.\n--\x3e\n<tr *ngIf="_firstRowOffset < labelMinRequiredCells" aria-hidden="true">\n <td class="mat-calendar-body-label"\n [attr.colspan]="numCols"\n [style.paddingTop]="_cellPadding"\n [style.paddingBottom]="_cellPadding">\n {{label}}\n </td>\n</tr>\n\n\x3c!-- Create the first row separately so we can include a special spacer cell. --\x3e\n<tr *ngFor="let row of rows; let rowIndex = index" role="row">\n \x3c!--\n We mark this cell as aria-hidden so it doesn\'t get read out as one of the days in the week.\n The aspect ratio of the table cells is maintained by setting the top and bottom padding as a\n percentage of the width (a variant of the trick described here:\n https://www.w3schools.com/howto/howto_css_aspect_ratio.asp).\n --\x3e\n <td *ngIf="rowIndex === 0 && _firstRowOffset"\n aria-hidden="true"\n class="mat-calendar-body-label"\n [attr.colspan]="_firstRowOffset"\n [style.paddingTop]="_cellPadding"\n [style.paddingBottom]="_cellPadding">\n {{_firstRowOffset >= labelMinRequiredCells ? label : \'\'}}\n </td>\n <td *ngFor="let item of row; let colIndex = index"\n role="gridcell"\n class="mat-calendar-body-cell"\n [ngClass]="item.cssClasses"\n [tabindex]="_isActiveCell(rowIndex, colIndex) ? 0 : -1"\n [attr.data-mat-row]="rowIndex"\n [attr.data-mat-col]="colIndex"\n [class.mat-calendar-body-disabled]="!item.enabled"\n [class.mat-calendar-body-active]="_isActiveCell(rowIndex, colIndex)"\n [class.mat-calendar-body-range-start]="_isRangeStart(item.compareValue)"\n [class.mat-calendar-body-range-end]="_isRangeEnd(item.compareValue)"\n [class.mat-calendar-body-in-range]="_isInRange(item.compareValue)"\n [class.mat-calendar-body-comparison-bridge-start]="_isComparisonBridgeStart(item.compareValue, rowIndex, colIndex)"\n [class.mat-calendar-body-comparison-bridge-end]="_isComparisonBridgeEnd(item.compareValue, rowIndex, colIndex)"\n [class.mat-calendar-body-comparison-start]="_isComparisonStart(item.compareValue)"\n [class.mat-calendar-body-comparison-end]="_isComparisonEnd(item.compareValue)"\n [class.mat-calendar-body-in-comparison-range]="_isInComparisonRange(item.compareValue)"\n [class.mat-calendar-body-preview-start]="_isPreviewStart(item.compareValue)"\n [class.mat-calendar-body-preview-end]="_isPreviewEnd(item.compareValue)"\n [class.mat-calendar-body-in-preview]="_isInPreview(item.compareValue)"\n [attr.aria-label]="item.ariaLabel"\n [attr.aria-disabled]="!item.enabled || null"\n [attr.aria-selected]="_isSelected(item.compareValue)"\n (click)="_cellClicked(item, $event)"\n [style.width]="_cellWidth"\n [style.paddingTop]="_cellPadding"\n [style.paddingBottom]="_cellPadding">\n <div class="mat-calendar-body-cell-content mat-focus-indicator"\n [class.mat-calendar-body-selected]="_isSelected(item.compareValue)"\n [class.mat-calendar-body-comparison-identical]="_isComparisonIdentical(item.compareValue)"\n [class.mat-calendar-body-today]="todayValue === item.compareValue">\n {{item.displayValue}}\n </div>\n <div class="mat-calendar-body-cell-preview"></div>\n </td>\n</tr>\n',host:{class:"mat-calendar-body",role:"grid","aria-readonly":"true"},exportAs:"matCalendarBody",encapsulation:i.ViewEncapsulation.None,changeDetection:i.ChangeDetectionStrategy.OnPush,styles:['.mat-calendar-body{min-width:224px}.mat-calendar-body-label{height:0;line-height:0;text-align:left;padding-left:4.7142857143%;padding-right:4.7142857143%}.mat-calendar-body-cell{position:relative;height:0;line-height:0;text-align:center;outline:none;cursor:pointer}.mat-calendar-body-cell::before,.mat-calendar-body-cell::after,.mat-calendar-body-cell-preview{content:"";position:absolute;top:5%;left:0;z-index:0;box-sizing:border-box;height:90%;width:100%}.mat-calendar-body-range-start:not(.mat-calendar-body-in-comparison-range)::before,.mat-calendar-body-range-start::after,.mat-calendar-body-comparison-start:not(.mat-calendar-body-comparison-bridge-start)::before,.mat-calendar-body-comparison-start::after,.mat-calendar-body-preview-start .mat-calendar-body-cell-preview{left:5%;width:95%;border-top-left-radius:999px;border-bottom-left-radius:999px}[dir=rtl] .mat-calendar-body-range-start:not(.mat-calendar-body-in-comparison-range)::before,[dir=rtl] .mat-calendar-body-range-start::after,[dir=rtl] .mat-calendar-body-comparison-start:not(.mat-calendar-body-comparison-bridge-start)::before,[dir=rtl] .mat-calendar-body-comparison-start::after,[dir=rtl] .mat-calendar-body-preview-start .mat-calendar-body-cell-preview{left:0;border-radius:0;border-top-right-radius:999px;border-bottom-right-radius:999px}.mat-calendar-body-range-end:not(.mat-calendar-body-in-comparison-range)::before,.mat-calendar-body-range-end::after,.mat-calendar-body-comparison-end:not(.mat-calendar-body-comparison-bridge-end)::before,.mat-calendar-body-comparison-end::after,.mat-calendar-body-preview-end .mat-calendar-body-cell-preview{width:95%;border-top-right-radius:999px;border-bottom-right-radius:999px}[dir=rtl] .mat-calendar-body-range-end:not(.mat-calendar-body-in-comparison-range)::before,[dir=rtl] .mat-calendar-body-range-end::after,[dir=rtl] .mat-calendar-body-comparison-end:not(.mat-calendar-body-comparison-bridge-end)::before,[dir=rtl] .mat-calendar-body-comparison-end::after,[dir=rtl] .mat-calendar-body-preview-end .mat-calendar-body-cell-preview{left:5%;border-radius:0;border-top-left-radius:999px;border-bottom-left-radius:999px}[dir=rtl] .mat-calendar-body-comparison-bridge-start.mat-calendar-body-range-end::after,[dir=rtl] .mat-calendar-body-comparison-bridge-end.mat-calendar-body-range-start::after{width:95%;border-top-right-radius:999px;border-bottom-right-radius:999px}.mat-calendar-body-comparison-start.mat-calendar-body-range-end::after,[dir=rtl] .mat-calendar-body-comparison-start.mat-calendar-body-range-end::after,.mat-calendar-body-comparison-end.mat-calendar-body-range-start::after,[dir=rtl] .mat-calendar-body-comparison-end.mat-calendar-body-range-start::after{width:90%}.mat-calendar-body-in-preview .mat-calendar-body-cell-preview{border-top:dashed 1px;border-bottom:dashed 1px}.mat-calendar-body-preview-start .mat-calendar-body-cell-preview{border-left:dashed 1px}[dir=rtl] .mat-calendar-body-preview-start .mat-calendar-body-cell-preview{border-left:0;border-right:dashed 1px}.mat-calendar-body-preview-end .mat-calendar-body-cell-preview{border-right:dashed 1px}[dir=rtl] .mat-calendar-body-preview-end .mat-calendar-body-cell-preview{border-right:0;border-left:dashed 1px}.mat-calendar-body-disabled{cursor:default}.cdk-high-contrast-active .mat-calendar-body-disabled{opacity:.5}.mat-calendar-body-cell-content{top:5%;left:5%;z-index:1;display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:90%;height:90%;line-height:1;border-width:1px;border-style:solid;border-radius:999px}.mat-calendar-body-cell-content.mat-focus-indicator{position:absolute}.cdk-high-contrast-active .mat-calendar-body-cell-content{border:none}.mat-datepicker-dialog .mat-dialog-container{position:relative;overflow:visible}.cdk-high-contrast-active .mat-datepicker-popup:not(:empty),.cdk-high-contrast-active .mat-calendar-body-selected{outline:solid 1px}.cdk-high-contrast-active .mat-calendar-body-today{outline:dotted 1px}.cdk-high-contrast-active .cdk-keyboard-focused .mat-calendar-body-active>.mat-calendar-body-cell-content:not(.mat-calendar-body-selected),.cdk-high-contrast-active .cdk-program-focused .mat-calendar-body-active>.mat-calendar-body-cell-content:not(.mat-calendar-body-selected){outline:dotted 2px}[dir=rtl] .mat-calendar-body-label{text-align:right}@media(hover: none){.mat-calendar-body-cell:not(.mat-calendar-body-disabled):hover>.mat-calendar-body-cell-content:not(.mat-calendar-body-selected){background-color:transparent}}\n']}]}],D.ctorParameters=function(){return[{type:i.ElementRef},{type:i.NgZone}]},D.propDecorators={label:[{type:i.Input}],rows:[{type:i.Input}],todayValue:[{type:i.Input}],startValue:[{type:i.Input}],endValue:[{type:i.Input}],labelMinRequiredCells:[{type:i.Input}],numCols:[{type:i.Input}],activeCell:[{type:i.Input}],isRange:[{type:i.Input}],cellAspectRatio:[{type:i.Input}],comparisonStart:[{type:i.Input}],comparisonEnd:[{type:i.Input}],previewStart:[{type:i.Input}],previewEnd:[{type:i.Input}],selectedValueChange:[{type:i.Output}],previewChange:[{type:i.Output}]};var I=function(t,e){return(I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])})(t,e)};function O(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function a(){this.constructor=t}I(t,e),t.prototype=null===e?Object.create(e):(a.prototype=e.prototype,new a)}function x(t,e){var a="function"==typeof Symbol&&t[Symbol.iterator];if(!a)return t;var n,r,i=a.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(a=i.return)&&a.call(i)}finally{if(r)throw r.error}}return o}function S(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(x(arguments[e]));return t}var E=function E(t,e){this.start=t,this.end=e},V=function(){function t(t,e){this.selection=t,this._adapter=e,this._selectionChanged=new c.Subject,this.selectionChanged=this._selectionChanged,this.selection=t}return t.prototype.updateSelection=function(t,e){this.selection=t,this._selectionChanged.next({selection:t,source:e})},t.prototype.ngOnDestroy=function(){this._selectionChanged.complete()},t.prototype._isValidDateInstance=function(t){return this._adapter.isDateInstance(t)&&this._adapter.isValid(t)},t.prototype.clone=function(){return null},t}();V.decorators=[{type:i.Injectable}],V.ctorParameters=function(){return[{type:void 0},{type:d.DateAdapter}]};var M=function(t){function e(e){return t.call(this,null,e)||this}return O(e,t),e.prototype.add=function(e){t.prototype.updateSelection.call(this,e,this)},e.prototype.isValid=function(){return null!=this.selection&&this._isValidDateInstance(this.selection)},e.prototype.isComplete=function(){return null!=this.selection},e.prototype.clone=function(){var t=new e(this._adapter);return t.updateSelection(this.selection,this),t},e}(V);M.decorators=[{type:i.Injectable}],M.ctorParameters=function(){return[{type:d.DateAdapter}]};var R=function(t){function e(e){return t.call(this,new E(null,null),e)||this}return O(e,t),e.prototype.add=function(e){var a=this.selection,n=a.start,r=a.end;null==n?n=e:null==r?r=e:(n=e,r=null),t.prototype.updateSelection.call(this,new E(n,r),this)},e.prototype.isValid=function(){var t=this.selection,e=t.start,a=t.end;return null==e&&null==a||(null!=e&&null!=a?this._isValidDateInstance(e)&&this._isValidDateInstance(a)&&this._adapter.compareDate(e,a)<=0:(null==e||this._isValidDateInstance(e))&&(null==a||this._isValidDateInstance(a)))},e.prototype.isComplete=function(){return null!=this.selection.start&&null!=this.selection.end},e.prototype.clone=function(){var t=new e(this._adapter);return t.updateSelection(this.selection,this),t},e}(V);function P(t,e){return t||new M(e)}R.decorators=[{type:i.Injectable}],R.ctorParameters=function(){return[{type:d.DateAdapter}]};var F={provide:V,deps:[[new i.Optional,new i.SkipSelf,V],d.DateAdapter],useFactory:P};function T(t,e){return t||new R(e)}var Y={provide:V,deps:[[new i.Optional,new i.SkipSelf,V],d.DateAdapter],useFactory:T},N=new i.InjectionToken("MAT_DATE_RANGE_SELECTION_STRATEGY"),j=function(){function t(t){this._dateAdapter=t}return t.prototype.selectionFinished=function(t,e){var a=e.start,n=e.end;return null==a?a=t:null==n&&t&&this._dateAdapter.compareDate(t,a)>=0?n=t:(a=t,n=null),new E(a,n)},t.prototype.createPreview=function(t,e){var a=null,n=null;return e.start&&!e.end&&t&&(a=e.start,n=t),new E(a,n)},t}(); /** * @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 L(t,e){return t||new j(e)}j.decorators=[{type:i.Injectable}],j.ctorParameters=function(){return[{type:d.DateAdapter}]};var B={provide:N,deps:[[new i.Optional,new i.SkipSelf,N],d.DateAdapter],useFactory:L},z=function(){function t(t,e,a,n,r){this._changeDetectorRef=t,this._dateFormats=e,this._dateAdapter=a,this._dir=n,this._rangeStrategy=r,this._rerenderSubscription=c.Subscription.EMPTY,this.selectedChange=new i.EventEmitter,this._userSelection=new i.EventEmitter,this.activeDateChange=new i.EventEmitter,this._activeDate=this._dateAdapter.today()}return Object.defineProperty(t.prototype,"activeDate",{get:function(){return this._activeDate},set:function(t){var e=this._activeDate,a=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(t))||this._dateAdapter.today();this._activeDate=this._dateAdapter.clampDate(a,this.minDate,this.maxDate),this._hasSameMonthAndYear(e,this._activeDate)||this._init()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selected",{get:function(){return this._selected},set:function(t){this._selected=t instanceof E?t:this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(t)),this._setRanges(this._selected)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"minDate",{get:function(){return this._minDate},set:function(t){this._minDate=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(t))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxDate",{get:function(){return this._maxDate},set:function(t){this._maxDate=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(t))},enumerable:!1,configurable:!0}),t.prototype.ngAfterContentInit=function(){var t=this;this._rerenderSubscription=this._dateAdapter.localeChanges.pipe(h.startWith(null)).subscribe((function(){return t._init()}))},t.prototype.ngOnChanges=function(t){var e=t.comparisonStart||t.comparisonEnd;e&&!e.firstChange&&this._setRanges(this.selected)},t.prototype.ngOnDestroy=function(){this._rerenderSubscription.unsubscribe()},t.prototype._dateSelected=function(t){var e,a,n=t.value,r=this._dateAdapter.getYear(this.activeDate),i=this._dateAdapter.getMonth(this.activeDate),o=this._dateAdapter.createDate(r,i,n);this._selected instanceof E?(e=this._getDateInCurrentMonth(this._selected.start),a=this._getDateInCurrentMonth(this._selected.end)):e=a=this._getDateInCurrentMonth(this._selected),e===n&&a===n||this.selectedChange.emit(o),this._userSelection.emit({value:o,event:t.event}),this._previewStart=this._previewEnd=null,this._changeDetectorRef.markForCheck()},t.prototype._handleCalendarBodyKeydown=function(t){var e=this._activeDate,a=this._isRtl();switch(t.keyCode){case p.LEFT_ARROW:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,a?1:-1);break;case p.RIGHT_ARROW:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,a?-1:1);break;case p.UP_ARROW:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,-7);break;case p.DOWN_ARROW:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,7);break;case p.HOME:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,1-this._dateAdapter.getDate(this._activeDate));break;case p.END:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,this._dateAdapter.getNumDaysInMonth(this._activeDate)-this._dateAdapter.getDate(this._activeDate));break;case p.PAGE_UP:this.activeDate=t.altKey?this._dateAdapter.addCalendarYears(this._activeDate,-1):this._dateAdapter.addCalendarMonths(this._activeDate,-1);break;case p.PAGE_DOWN:this.activeDate=t.altKey?this._dateAdapter.addCalendarYears(this._activeDate,1):this._dateAdapter.addCalendarMonths(this._activeDate,1);break;case p.ENTER:case p.SPACE:return void(this.dateFilter&&!this.dateFilter(this._activeDate)||(this._dateSelected({value:this._dateAdapter.getDate(this._activeDate),event:t}),t.preventDefault()));case p.ESCAPE:return void(null==this._previewEnd||p.hasModifierKey(t)||(this._previewStart=this._previewEnd=null,this.selectedChange.emit(null),this._userSelection.emit({value:null,event:t}),t.preventDefault(),t.stopPropagation()));default:return}this._dateAdapter.compareDate(e,this.activeDate)&&this.activeDateChange.emit(this.activeDate),this._focusActiveCell(),t.preventDefault()},t.prototype._init=function(){this._setRanges(this.selected),this._todayDate=this._getCellCompareValue(this._dateAdapter.today()),this._monthLabel=this._dateFormats.display.monthLabel?this._dateAdapter.format(this.activeDate,this._dateFormats.display.monthLabel):this._dateAdapter.getMonthNames("short")[this._dateAdapter.getMonth(this.activeDate)].toLocaleUpperCase();var t=this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate),this._dateAdapter.getMonth(this.activeDate),1);this._firstWeekOffset=(7+this._dateAdapter.getDayOfWeek(t)-this._dateAdapter.getFirstDayOfWeek())%7,this._initWeekdays(),this._createWeekCells(),this._changeDetectorRef.markForCheck()},t.prototype._focusActiveCell=function(t){this._matCalendarBody._focusActiveCell(t)},t.prototype._previewChanged=function(t){var e=t.value;if(this._rangeStrategy){var a=this._rangeStrategy.createPreview(e?e.rawValue:null,this.selected,t.event);this._previewStart=this._getCellCompareValue(a.start),this._previewEnd=this._getCellCompareValue(a.end),this._changeDetectorRef.detectChanges()}},t.prototype._initWeekdays=function(){var t=this._dateAdapter.getFirstDayOfWeek(),e=this._dateAdapter.getDayOfWeekNames("narrow"),a=this._dateAdapter.getDayOfWeekNames("long").map((function(t,a){return{long:t,narrow:e[a]}}));this._weekdays=a.slice(t).concat(a.slice(0,t))},t.prototype._createWeekCells=function(){var t=this._dateAdapter.getNumDaysInMonth(this.activeDate),e=this._dateAdapter.getDateNames();this._weeks=[[]];for(var a=0,n=this._firstWeekOffset;a<t;a++,n++){7==n&&(this._weeks.push([]),n=0);var r=this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate),this._dateAdapter.getMonth(this.activeDate),a+1),i=this._shouldEnableDate(r),o=this._dateAdapter.format(r,this._dateFormats.display.dateA11yLabel),s=this.dateClass?this.dateClass(r,"month"):void 0;this._weeks[this._weeks.length-1].push(new b(a+1,e[a],o,i,s,this._getCellCompareValue(r),r))}},t.prototype._shouldEnableDate=function(t){return!!t&&(!this.minDate||this._dateAdapter.compareDate(t,this.minDate)>=0)&&(!this.maxDate||this._dateAdapter.compareDate(t,this.maxDate)<=0)&&(!this.dateFilter||this.dateFilter(t))},t.prototype._getDateInCurrentMonth=function(t){return t&&this._hasSameMonthAndYear(t,this.activeDate)?this._dateAdapter.getDate(t):null},t.prototype._hasSameMonthAndYear=function(t,e){return!(!t||!e||this._dateAdapter.getMonth(t)!=this._dateAdapter.getMonth(e)||this._dateAdapter.getYear(t)!=this._dateAdapter.getYear(e))},t.prototype._getCellCompareValue=function(t){if(t){var e=this._dateAdapter.getYear(t),a=this._dateAdapter.getMonth(t),n=this._dateAdapter.getDate(t);return new Date(e,a,n).getTime()}return null},t.prototype._isRtl=function(){return this._dir&&"rtl"===this._dir.value},t.prototype._setRanges=function(t){t instanceof E?(this._rangeStart=this._getCellCompareValue(t.start),this._rangeEnd=this._getCellCompareValue(t.end),this._isRange=!0):(this._rangeStart=this._rangeEnd=this._getCellCompareValue(t),this._isRange=!1),this._comparisonRangeStart=this._getCellCompareValue(this.comparisonStart),this._comparisonRangeEnd=this._getCellCompareValue(this.comparisonEnd)},t}(); /** * @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 */z.decorators=[{type:i.Component,args:[{selector:"mat-month-view",template:'<table class="mat-calendar-table" role="presentation">\n <thead class="mat-calendar-table-header">\n <tr>\n <th scope="col" *ngFor="let day of _weekdays" [attr.aria-label]="day.long">{{day.narrow}}</th>\n </tr>\n <tr><th class="mat-calendar-table-header-divider" colspan="7" aria-hidden="true"></th></tr>\n </thead>\n <tbody mat-calendar-body\n [label]="_monthLabel"\n [rows]="_weeks"\n [todayValue]="_todayDate!"\n [startValue]="_rangeStart!"\n [endValue]="_rangeEnd!"\n [comparisonStart]="_comparisonRangeStart"\n [comparisonEnd]="_comparisonRangeEnd"\n [previewStart]="_previewStart"\n [previewEnd]="_previewEnd"\n [isRange]="_isRange"\n [labelMinRequiredCells]="3"\n [activeCell]="_dateAdapter.getDate(activeDate) - 1"\n (selectedValueChange)="_dateSelected($event)"\n (previewChange)="_previewChanged($event)"\n (keydown)="_handleCalendarBodyKeydown($event)">\n </tbody>\n</table>\n',exportAs:"matMonthView",encapsulation:i.ViewEncapsulation.None,changeDetection:i.ChangeDetectionStrategy.OnPush}]}],z.ctorParameters=function(){return[{type:i.ChangeDetectorRef},{type:void 0,decorators:[{type:i.Optional},{type:i.Inject,args:[d.MAT_DATE_FORMATS]}]},{type:d.DateAdapter,decorators:[{type:i.Optional}]},{type:u.Directionality,decorators:[{type:i.Optional}]},{type:void 0,decorators:[{type:i.Inject,args:[N]},{type:i.Optional}]}]},z.propDecorators={activeDate:[{type:i.Input}],selected:[{type:i.Input}],minDate:[{type:i.Input}],maxDate:[{type:i.Input}],dateFilter:[{type:i.Input}],dateClass:[{type:i.Input}],comparisonStart:[{type:i.Input}],comparisonEnd:[{type:i.Input}],selectedChange:[{type:i.Output}],_userSelection:[{type:i.Output}],activeDateChange:[{type:i.Output}],_matCalendarBody:[{type:i.ViewChild,args:[D]}]}; /** * @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 */ var W=function(){function t(t,e,a){this._changeDetectorRef=t,this._dateAdapter=e,this._dir=a,this._rerenderSubscription=c.Subscription.EMPTY,this.selectedChange=new i.EventEmitter,this.yearSelected=new i.EventEmitter,this.activeDateChange=new i.EventEmitter,this._activeDate=this._dateAdapter.today()}return Object.defineProperty(t.prototype,"activeDate",{get:function(){return this._activeDate},set:function(t){var e=this._activeDate,a=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(t))||this._dateAdapter.today();this._activeDate=this._dateAdapter.clampDate(a,this.minDate,this.maxDate),H(this._dateAdapter,e,this._activeDate,this.minDate,this.maxDate)||this._init()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selected",{get:function(){return this._selected},set:function(t){this._selected=t instanceof E?t:this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(t)),this._setSelectedYear(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"minDate",{get:function(){return this._minDate},set:function(t){this._minDate=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(t))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxDate",{get:function(){return this._maxDate},set:function(t){this._maxDate=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(t))},enumerable:!1,configurable:!0}),t.prototype.ngAfterContentInit=function(){var t=this;this._rerenderSubscription=this._dateAdapter.localeChanges.pipe(h.startWith(null)).subscribe((function(){return t._init()}))},t.prototype.ngOnDestroy=function(){this._rerenderSubscription.unsubscribe()},t.prototype._init=function(){var t=this;this._todayYear=this._dateAdapter.getYear(this._dateAdapter.today());var e=this._dateAdapter.getYear(this._activeDate)-G(this._dateAdapter,this.activeDate,this.minDate,this.maxDate);this._years=[];for(var a=0,n=[];a<24;a++)n.push(e+a),4==n.length&&(this._years.push(n.map((function(e){return t._createCellForYear(e)}))),n=[]);this._changeDetectorRef.markForCheck()},t.prototype._yearSelected=function(t){var e=t.value;this.yearSelected.emit(this._dateAdapter.createDate(e,0,1));var a=this._dateAdapter.getMonth(this.activeDate),n=this._dateAdapter.getNumDaysInMonth(this._dateAdapter.createDate(e,a,1));this.selectedChange.emit(this._dateAdapter.createDate(e,a,Math.min(this._dateAdapter.getDate(this.activeDate),n)))},t.prototype._handleCalendarBodyKeydown=function(t){var e=this._activeDate,a=this._isRtl();switch(t.keyCode){case p.LEFT_ARROW:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,a?1:-1);break;case p.RIGHT_ARROW:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,a?-1:1);break;case p.UP_ARROW:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,-4);break;case p.DOWN_ARROW:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,4);break;case p.HOME:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,-G(this._dateAdapter,this.activeDate,this.minDate,this.maxDate));break;case p.END:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,24-G(this._dateAdapter,this.activeDate,this.minDate,this.maxDate)-1);break;case p.PAGE_UP:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,t.altKey?-240:-24);break;case p.PAGE_DOWN:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,t.altKey?240:24);break;case p.ENTER:case p.SPACE:this._yearSelected({value:this._dateAdapter.getYear(this._activeDate),event:t});break;default:return}this._dateAdapter.compareDate(e,this.activeDate)&&this.activeDateChange.emit(this.activeDate),this._focusActiveCell(),t.preventDefault()},t.prototype._getActiveCell=function(){return G(this._dateAdapter,this.activeDate,this.minDate,this.maxDate)},t.prototype._focusActiveCell=function(){this._matCalendarBody._focusActiveCell()},t.prototype._createCellForYear=function(t){var e=this._dateAdapter.createDate(t,0,1),a=this._dateAdapter.getYearName(e),n=this.dateClass?this.dateClass(e,"multi-year"):void 0;return new b(t,a,a,this._shouldEnableYear(t),n)},t.prototype._shouldEnableYear=function(t){if(null==t||this.maxDate&&t>this._dateAdapter.getYear(this.maxDate)||this.minDate&&t<this._dateAdapter.getYear(this.minDate))return!1;if(!this.dateFilter)return!0;for(var e=this._dateAdapter.createDate(t,0,1);this._dateAdapter.getYear(e)==t;e=this._dateAdapter.addCalendarDays(e,1))if(this.dateFilter(e))return!0;return!1},t.prototype._isRtl=function(){return this._dir&&"rtl"===this._dir.value},t.prototype._setSelectedYear=function(t){if(this._selectedYear=null,t instanceof E){var e=t.start||t.end;e&&(this._selectedYear=this._dateAdapter.getYear(e))}else t&&(this._selectedYear=this._dateAdapter.getYear(t))},t}();function H(t,e,a,n,r){var i=t.getYear(e),o=t.getYear(a),s=q(t,n,r);return Math.floor((i-s)/24)===Math.floor((o-s)/24)}function G(t,e,a,n){return function r(t,e){return(t%e+e)%e} /** * @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 */(t.getYear(e)-q(t,a,n),24)}function q(t,e,a){var n=0;return a?n=t.getYear(a)-24+1:e&&(n=t.getYear(e)),n}W.decorators=[{type:i.Component,args:[{selector:"mat-multi-year-view",template:'<table class="mat-calendar-table" role="presentation">\n <thead class="mat-calendar-table-header">\n <tr><th class="mat-calendar-table-header-divider" colspan="4"></th></tr>\n </thead>\n <tbody mat-calendar-body\n [rows]="_years"\n [todayValue]="_todayYear"\n [startValue]="_selectedYear!"\n [endValue]="_selectedYear!"\n [numCols]="4"\n [cellAspectRatio]="4 / 7"\n [activeCell]="_getActiveCell()"\n (selectedValueChange)="_yearSelected($event)"\n (keydown)="_handleCalendarBodyKeydown($event)">\n </tbody>\n</table>\n',exportAs:"matMultiYearView",encapsulation:i.ViewEncapsulation.None,changeDetection:i.ChangeDetectionStrategy.OnPush}]}],W.ctorParameters=function(){return[{type:i.ChangeDetectorRef},{type:d.DateAdapter,decorators:[{type:i.Optional}]},{type:u.Directionality,decorators:[{type:i.Optional}]}]},W.propDecorators={activeDate:[{type:i.Input}],selected:[{type:i.Input}],minDate:[{type:i.Input}],maxDate:[{type:i.Input}],dateFilter:[{type:i.Input}],dateClass:[{type:i.Input}],selectedChange:[{type:i.Output}],yearSelected:[{type:i.Output}],activeDateChange:[{type:i.Output}],_matCalendarBody:[{type:i.ViewChild,args:[D]}]};var K=function(){function t(t,e,a,n){this._changeDetectorRef=t,this._dateFormats=e,this._dateAdapter=a,this._dir=n,this._rerenderSubscription=c.Subscription.EMPTY,this.selectedChange=new i.EventEmitter,this.monthSelected=new i.EventEmitter,this.activeDateChange=new i.EventEmitter,this._activeDate=this._dateAdapter.today()}return Object.defineProperty(t.prototype,"activeDate",{get:function(){return this._activeDate},set:function(t){var e=this._activeDate,a=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(t))||this._dateAdapter.today();this._activeDate=this._dateAdapter.clampDate(a,this.minDate,this.maxDate),this._dateAdapter.getYear(e)!==this._dateAdapter.getYear(this._activeDate)&&this._init()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selected",{get:function(){return this._selected},set:function(t){this._selected=t instanceof E?t:this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(t)),this._setSelectedMonth(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"minDate",{get:function(){return this._minDate},set:function(t){this._minDate=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(t))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxDate",{get:function(){return this._maxDate},set:function(t){this._maxDate=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(t))},enumerable:!1,configurable:!0}),t.prototype.ngAfterContentInit=function(){var t=this;this._rerenderSubscription=this._dateAdapter.localeChanges.pipe(h.startWith(null)).subscribe((function(){return t._init()}))},t.prototype.ngOnDestroy=function(){this._rerenderSubscription.unsubscribe()},t.prototype._monthSelected=function(t){var e=t.value,a=this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate),e,1);this.monthSelected.emit(a);var n=this._dateAdapter.getNumDaysInMonth(a);this.selectedChange.emit(this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate),e,Math.min(this._dateAdapter.getDate(this.activeDate),n)))},t.prototype._handleCalendarBodyKeydown=function(t){var e=this._activeDate,a=this._isRtl();switch(t.keyCode){case p.LEFT_ARROW:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,a?1:-1);break;case p.RIGHT_ARROW:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,a?-1:1);break;case p.UP_ARROW:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,-4);break;case p.DOWN_ARROW:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,4);break;case p.HOME:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,-this._dateAdapter.getMonth(this._activeDate));break;case p.END:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,11-this._dateAdapter.getMonth(this._activeDate));break;case p.PAGE_UP:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,t.altKey?-10:-1);break;case p.PAGE_DOWN:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,t.altKey?10:1);break;case p.ENTER:case p.SPACE:this._monthSelected({value:this._dateAdapter.getMonth(this._activeDate),event:t});break;default:return}this._dateAdapter.compareDate(e,this.activeDate)&&this.activeDateChange.emit(this.activeDate),this._focusActiveCell(),t.preventDefault()},t.prototype._init=function(){var t=this;this._setSelectedMonth(this.selected),this._todayMonth=this._getMonthInCurrentYear(this._dateAdapter.today()),this._yearLabel=this._dateAdapter.getYearName(this.activeDate);var e=this._dateAdapter.getMonthNames("short");this._months=[[0,1,2,3],[4,5,6,7],[8,9,10,11]].map((function(a){return a.map((function(a){return t._createCellForMonth(a,e[a])}))})),this._changeDetectorRef.markForCheck()},t.prototype._focusActiveCell=function(){this._matCalendarBody._focusActiveCell()},t.prototype._getMonthInCurrentYear=function(t){return t&&this._dateAdapter.getYear(t)==this._dateAdapter.getYear(this.activeDate)?this._dateAdapter.getMonth(t):null},t.prototype._createCellForMonth=function(t,e){var a=this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate),t,1),n=this._dateAdapter.format(a,this._dateFormats.display.monthYearA11yLabel),r=this.dateClass?this.dateClass(a,"year"):void 0;return new b(t,e.toLocaleUpperCase(),n,this._shouldEnableMonth(t),r)},t.prototype._shouldEnableMonth=function(t){var e=this._dateAdapter.getYear(this.activeDate);if(null==t||this._isYearAndMonthAfterMaxDate(e,t)||this._isYearAndMonthBeforeMinDate(e,t))return!1;if(!this.dateFilter)return!0;for(var a=this._dateAdapter.createDate(e,t,1);this._dateAdapter.getMonth(a)==t;a=this._dateAdapter.addCalendarDays(a,1))if(this.dateFilter(a))return!0;return!1},t.prototype._isYearAndMonthAfterMaxDate=function(t,e){if(this.maxDate){var a=this._dateAdapter.getYear(this.maxDate),n=this._dateAdapter.getMonth(this.maxDate);return t>a||t===a&&e>n}return!1},t.prototype._isYearAndMonthBeforeMinDate=function(t,e){if(this.minDate){var a=this._dateAdapter.getYear(this.minDate),n=this._dateAdapter.getMonth(this.minDate);return t<a||t===a&&e<n}return!1},t.prototype._isRtl=function(){return this._dir&&"rtl"===this._dir.value},t.prototype._setSelectedMonth=function(t){this._selectedMonth=t instanceof E?this._getMonthInCurrentYear(t.start)||this._getMonthInCurrentYear(t.end):this._getMonthInCurrentYear(t)},t}();K.decorators=[{type:i.Component,args:[{selector:"mat-year-view",template:'<table class="mat-calendar-table" role="presentation">\n <thead class="mat-calendar-table-header">\n <tr><th class="mat-calendar-table-header-divider" colspan="4"></th></tr>\n </thead>\n <tbody mat-calendar-body\n [label]="_yearLabel"\n [rows]="_months"\n [todayValue]="_todayMonth!"\n [startValue]="_selectedMonth!"\n [endValue]="_selectedMonth!"\n [labelMinRequiredCells]="2"\n [numCols]="4"\n [cellAspectRatio]="4 / 7"\n [activeCell]="_dateAdapter.getMonth(activeDate)"\n (selectedValueChange)="_monthSelected($event)"\n (keydown)="_handleCalendarBodyKeydown($event)">\n </tbody>\n</table>\n',exportAs:"matYearView",encapsulation:i.ViewEncapsulation.None,changeDetection:i.ChangeDetectionStrategy.OnPush}]}],K.ctorParameters=function(){return[{type:i.ChangeDetectorRef},{type:void 0,decorators:[{type:i.Optional},{type:i.Inject,args:[d.MAT_DATE_FORMATS]}]},{type:d.DateAdapter,decorators:[{type:i.Optional}]},{type:u.Directionality,decorators:[{type:i.Optional}]}]},K.propDecorators={activeDate:[{type:i.Input}],selected:[{type:i.Input}],minDate:[{type:i.Input}],maxDate:[{type:i.Input}],dateFilter:[{type:i.Input}],dateClass:[{type:i.Input}],selectedChange:[{type:i.Output}],monthSelected:[{type:i.Output}],activeDateChange:[{type:i.Output}],_matCalendarBody:[{type:i.ViewChild,args:[D]}]}; /** * @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 */ var U=0,$=function(){function t(t,e,a,n,r){this._intl=t,this.calendar=e,this._dateAdapter=a,this._dateFormats=n,this._buttonDescriptionId="mat-calendar-button-"+U++,this.calendar.stateChanges.subscribe((function(){return r.markForCheck()}))}return Object.defineProperty(t.prototype,"periodButtonText",{get:function(){if("month"==this.calendar.currentView)return this._dateAdapter.format(this.calendar.activeDate,this._dateFormats.display.monthYearLabel).toLocaleUpperCase();if("year"==this.calendar.currentView)return this._dateAdapter.getYearName(this.calendar.activeDate);var t=this._dateAdapter.getYear(this.calendar.activeDate)-G(this._dateAdapter,this.calendar.activeDate,this.calendar.minDate,this.calendar.maxDate),e=t+24-1,a=this._dateAdapter.getYearName(this._dateAdapter.createDate(t,0,1)),n=this._dateAdapter.getYearName(this._dateAdapter.createDate(e,0,1));return this._intl.formatYearRange(a,n)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"periodButtonLabel",{get:function(){return"month"==this.calendar.currentView?this._intl.switchToMultiYearViewLabel:this._intl.switchToMonthViewLabel},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"prevButtonLabel",{get:function(){return{month:this._intl.prevMonthLabel,year:this._intl.prevYearLabel,"multi-year":this._intl.prevMultiYearLabel}[this.calendar.currentView]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nextButtonLabel",{get:function(){return{month:this._intl.nextMonthLabel,year:this._intl.nextYearLabel,"multi-year":this._intl.nextMultiYearLabel}[this.calendar.currentView]},enumerable:!1,configurable:!0}),t.prototype.currentPeriodClicked=function(){this.calendar.currentView="month"==this.calendar.currentView?"multi-year":"month"},t.prototype.previousClicked=function(){this.calendar.activeDate="month"==this.calendar.currentView?this._dateAdapter.addCalendarMonths(this.calendar.activeDate,-1):this._dateAdapter.addCalendarYears(this.calendar.activeDate,"year"==this.calendar.currentView?-1:-24)},t.prototype.nextClicked=function(){this.calendar.activeDate="month"==this.calendar.currentView?this._dateAdapter.addCalendarMonths(this.calendar.activeDate,1):this._dateAdapter.addCalendarYears(this.calendar.activeDate,"year"==this.calendar.currentView?1:24)},t.prototype.previousEnabled=function(){return!this.calendar.minDate||!this.calendar.minDate||!this._isSameView(this.calendar.activeDate,this.calendar.minDate)},t.prototype.nextEnabled=function(){return!this.calendar.maxDate||!this._isSameView(this.calendar.activeDate,this.calendar.maxDate)},t.prototype._isSameView=function(t,e){return"month"==this.calendar.currentView?this._dateAdapter.getYear(t)==this._dateAdapter.getYear(e)&&this._dateAdapter.getMonth(t)==this._dateAdapter.getMonth(e):"year"==this.calendar.currentView?this._dateAdapter.getYear(t)==this._dateAdapter.getYear(e):H(this._dateAdapter,t,e,this.calendar.minDate,this.calendar.maxDate)},t}();$.decorators=[{type:i.Component,args:[{selector:"mat-calendar-header",template:'<div class="mat-calendar-header">\n <div class="mat-calendar-controls">\n <button mat-button type="button" class="mat-calendar-period-button"\n (click)="currentPeriodClicked()" [attr.aria-label]="periodButtonLabel"\n [attr.aria-describedby]="_buttonDescriptionId"\n cdkAriaLive="polite">\n <span [attr.id]="_buttonDescriptionId">{{periodButtonText}}</span>\n <div class="mat-calendar-arrow"\n [class.mat-calendar-invert]="calendar.currentView !== \'month\'"></div>\n </button>\n\n <div class="mat-calendar-spacer"></div>\n\n <ng-content></ng-content>\n\n <button mat-icon-button type="button" class="mat-calendar-previous-button"\n [disabled]="!previousEnabled()" (click)="previousClicked()"\n [attr.aria-label]="prevButtonLabel">\n </button>\n\n <button mat-icon-button type="button" class="mat-calendar-next-button"\n [disabled]="!nextEnabled()" (click)="nextClicked()"\n [attr.aria-label]="nextButtonLabel">\n </button>\n </div>\n</div>\n',exportAs:"matCalendarHeader",encapsulation:i.ViewEncapsulation.None,changeDetection:i.ChangeDetectionStrategy.OnPush}]}],$.ctorParameters=function(){return[{type:v},{type:X,decorators:[{type:i.Inject,args:[i.forwardRef((function(){return X}))]}]},{type:d.DateAdapter,decorators:[{type:i.Optional}]},{type:void 0,decorators:[{type:i.Optional},{type:i.Inject,args:[d.MAT_DATE_FORMATS]}]},{type:i.ChangeDetectorRef}]};var X=function(){function t(t,e,a,n){var r=this;this._dateAdapter=e,this._dateFormats=a,this._changeDetectorRef=n,this._moveFocusOnNextTick=!1,this.startView="month",this.selectedChange=new i.EventEmitter,this.yearSelected=new i.EventEmitter,this.monthSelected=new i.EventEmitter,this.viewChanged=new i.EventEmitter(!0),this._userSelection=new i.EventEmitter,this.stateChanges=new c.Subject,this._intlChanges=t.changes.subscribe((function(){n.markForCheck(),r.stateChanges.next()}))}return Object.defineProperty(t.prototype,"startAt",{get:function(){return this._startAt},set:function(t){this._startAt=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(t))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selected",{get:function(){return this._selected},set:function(t){this._selected=t instanceof E?t:this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(t))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"minDate",{get:function(){return this._minDate},set:function(t){this._minDate=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(t))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxDate",{get:function(){return this._maxDate},set:function(t){this._maxDate=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(t))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"activeDate",{get:function(){return this._clampedActiveDate},set:function