fundamental-ngx
Version:
SAP Fiori Fundamentals, implemented in Angular
1 lines • 188 kB
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("popper.js"),require("rxjs"),require("@angular/animations"),require("focus-trap"),require("@angular/core"),require("@angular/common"),require("@angular/forms")):"function"==typeof define&&define.amd?define("fundamental-ngx",["exports","popper.js","rxjs","@angular/animations","focus-trap","@angular/core","@angular/common","@angular/forms"],e):e(t["fundamental-ngx"]={},t.Popper,t.rxjs,t.ng.animations,t.focusTrap,t.ng.core,t.ng.common,t.ng.forms)}(this,function(t,e,n,i,o,r,s,a){"use strict";e=e&&e.hasOwnProperty("default")?e["default"]:e,o=o&&o.hasOwnProperty("default")?o["default"]:o;var l=function(t,e){return(l=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])})(t,e)};function d(t,e){function n(){this.constructor=t}l(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function c(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,o,s=n.call(t),a=[];try{for(;(void 0===e||0<e--)&&!(i=s.next()).done;)a.push(i.value)}catch(r){o={error:r}}finally{try{i&&!i.done&&(n=s["return"])&&n.call(s)}finally{if(o)throw o.error}}return a}var p=function(){function t(t){this._elementRef=t,this._setProperties()}return t.prototype._addClassToElement=function(t){var e;(e=this._elementRef.nativeElement.classList).add.apply(e,function n(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(c(arguments[e]));return t}(t.split(" ")))},t.prototype._addStyleToElement=function(t,e){this._elementRef.nativeElement.style[t]=e},t.prototype.ngOnChanges=function(){for(var t=this._elementRef.nativeElement.classList;0<t.length;)t.remove(t.item(0));this["class"]&&this._addClassToElement(this["class"]),this._setProperties()},t.prototype.ngOnInit=function(){this._setProperties()},t.propDecorators={"class":[{type:r.Input}]},t}(),u=function(n){function t(t){var e=n.call(this,t)||this;return e.elementRef=t,e}return d(t,n),t.prototype._setProperties=function(){var e=this;this._addClassToElement("fd-button"),this.compact&&this._addClassToElement("fd-button--compact"),this.glyph&&this._addClassToElement("sap-icon--"+this.glyph),this.fdType&&this._addClassToElement("fd-button--"+this.fdType),this.options&&("string"==typeof this.options?this._addClassToElement("fd-button--"+this.options):Array.isArray(this.options)&&this.options.forEach(function(t){"string"==typeof t&&e._addClassToElement("fd-button--"+t)}))},t.decorators=[{type:r.Directive,args:[{selector:"[fd-button]"}]}],t.ctorParameters=function(){return[{type:r.ElementRef}]},t.propDecorators={compact:[{type:r.Input}],glyph:[{type:r.Input}],fdType:[{type:r.Input}],semantic:[{type:r.Input}],options:[{type:r.Input}],size:[{type:r.Input}]},t}(p),h=function(){function t(){}return t.decorators=[{type:r.NgModule,args:[{imports:[s.CommonModule],exports:[u],declarations:[u]}]}],t}(),f="sap-icon--",g=function(n){function t(t){var e=n.call(this,t)||this;return e.elementRef=t,e.size="",e}return d(t,n),t.prototype._setProperties=function(){this.glyph&&this._addClassToElement(f+this.glyph),this.size&&this._addClassToElement(f+this.size)},t.decorators=[{type:r.Directive,args:[{selector:"fd-icon",host:{role:"presentation"}}]}],t.ctorParameters=function(){return[{type:r.ElementRef}]},t.propDecorators={glyph:[{type:r.Input}],size:[{type:r.Input}]},t}(p),m=function(){function t(){}return t.decorators=[{type:r.NgModule,args:[{imports:[s.CommonModule],exports:[g],declarations:[g]}]}],t}(),y=function(){function t(){}return t.decorators=[{type:r.Component,args:[{selector:"fd-action-bar",template:'<div class="fd-action-bar">\n <ng-content></ng-content>\n</div>'}]}],t}(),b=function(){function t(){this.fdActionBarTitleClass=!0}return t.decorators=[{type:r.Directive,args:[{selector:"[fd-action-bar-title]"}]}],t.propDecorators={fdActionBarTitleClass:[{type:r.HostBinding,args:["class.fd-action-bar__title"]}]},t}(),v=function(){function t(){}return t.decorators=[{type:r.Component,args:[{selector:"fd-action-bar-description",template:'<p class="fd-action-bar__description">\n <ng-content></ng-content>\n</p>'}]}],t}(),C=function(n){function t(t){var e=n.call(this,t)||this;return e.elementRef=t,e}return d(t,n),t.prototype._setProperties=function(){this._addClassToElement("fd-action-bar__header")},t.decorators=[{type:r.Component,args:[{selector:"fd-action-bar-header",template:'<ng-content></ng-content>\n<ng-content select="fd-action-bar-description"></ng-content>\n'}]}],t.ctorParameters=function(){return[{type:r.ElementRef}]},t}(p),I=function(n){function t(t){var e=n.call(this,t)||this;return e.elementRef=t,e}return d(t,n),t.prototype._setProperties=function(){this._addClassToElement("fd-action-bar__actions")},t.decorators=[{type:r.Component,args:[{selector:"fd-action-bar-actions",template:"<ng-content></ng-content>\n"}]}],t.ctorParameters=function(){return[{type:r.ElementRef}]},t}(p),D=function(n){function t(t){var e=n.call(this,t)||this;return e.elementRef=t,e}return d(t,n),t.prototype._setProperties=function(){this._addClassToElement("fd-action-bar__back")},t.decorators=[{type:r.Component,args:[{selector:"fd-action-bar-back",template:"<ng-content></ng-content>"}]}],t.ctorParameters=function(){return[{type:r.ElementRef}]},t}(p),_=function(){function t(){}return t.decorators=[{type:r.Component,args:[{selector:"fd-action-bar-mobile",template:'<div style="width:319px">\n <ng-content></ng-content>\n</div>'}]}],t}(),w=function(){function t(){}return t.decorators=[{type:r.NgModule,args:[{declarations:[y,b,v,C,I,D,_],imports:[s.CommonModule,h,m],exports:[y,b,v,C,I,D,_]}]}],t}(),k=function(){function t(){}return t.prototype.hash=function(){return"FUI"+Math.floor(1e6*Math.random())},t.decorators=[{type:r.Injectable}],t}(),E=function(){function t(){}return t.decorators=[{type:r.NgModule,args:[{providers:[k]}]}],t}(),R=function(){function t(){this._afterDismissed=new n.Subject,this.afterDismissed=this._afterDismissed.asObservable()}return t.prototype.dismiss=function(t){this._afterDismissed.next(t)},t}(),F=i.trigger("fadeAlertNgIf",[i.transition(":enter",[i.style({opacity:0}),i.animate("250ms ease-in-out",i.style({opacity:1}))]),i.transition(":leave",[i.style({opacity:1,marginTop:"*",paddingTop:"*",paddingBottom:"*",height:"*",overflow:"hidden"}),i.animate("400ms ease-in-out",i.style({opacity:0,marginTop:0,paddingTop:0,paddingBottom:0,height:0,overflow:"hidden"}))])]),T=i.trigger("alertContainerNgIf",[i.transition(":leave",[i.style({opacity:1}),i.animate("400ms ease-in-out",i.style({opacity:0}))])]),x=function(a){function t(t,e,n,i,o){var s=a.call(this,e)||this;return s.hasher=t,s.elRef=e,s.cdRef=n,s.componentFactoryResolver=i,s.alertRef=o,s.dismissible=!0,s.duration=1e4,s.mousePersist=!1,s.ariaLabelledBy=null,s.ariaLabel=null,s.dismissLabel="Dismiss",s.onDismiss=new r.EventEmitter,s.mouseInAlert=!1,s}return d(t,a),t.prototype.ngOnInit=function(){this.id||(this.id=this.hasher.hash()),this.alertRef&&this.open(),this._setProperties()},t.prototype.ngAfterViewInit=function(){this.childComponentType&&(this.childComponentType instanceof r.Type?this.loadFromComponent(this.childComponentType):this.childComponentType instanceof r.TemplateRef?this.loadFromTemplate(this.childComponentType):this.loadFromString(this.childComponentType),this.cdRef.detectChanges())},t.prototype.dismiss=function(t,e){void 0===e&&(e=!1),e&&(this.elRef.nativeElement.style.display="none"),this.alertRef?this.alertRef.dismiss(t):this.elRef.nativeElement.style.display="none",this.onDismiss.emit()},t.prototype.open=function(){var e=this;if(!this.alertRef){if("block"===this.elRef.nativeElement.style.display)return;this.elRef.nativeElement.style.display="block"}0<=this.duration&&setTimeout(function(){if(e.mousePersist){var t=function(){!0===e.mouseInAlert?setTimeout(t,500):e.dismiss()};t()}else e.dismiss()},this.duration)},t.prototype.handleAlertMouseEvent=function(t){"mouseenter"===t.type?this.mouseInAlert=!0:"mouseleave"===t.type&&(this.mouseInAlert=!1)},t.prototype._setProperties=function(){this._addClassToElement("fd-alert"),this.type&&this._addClassToElement("fd-alert--"+this.type)},t.prototype.loadFromTemplate=function(t){var e={$implicit:this.alertRef};this.componentRef=this.containerRef.createEmbeddedView(t,e)},t.prototype.loadFromComponent=function(t){var e=this.componentFactoryResolver.resolveComponentFactory(t);this.containerRef.clear(),this.componentRef=this.containerRef.createComponent(e)},t.prototype.loadFromString=function(t){this.containerRef.clear(),this.message=t},t.decorators=[{type:r.Component,args:[{selector:"fd-alert",template:'<button class="fd-alert__close"\n *ngIf="dismissible"\n (click)="dismiss(undefined, true)"\n [attr.aria-controls]="id"\n [attr.aria-label]="dismissLabel">\n</button>\n<ng-container #container>{{message}}</ng-container>\n<ng-content></ng-content>\n',providers:[k],host:{"[attr.aria-labelledby]":"ariaLabelledBy","[attr.aria-label]":"ariaLabel","[style.width]":"width",role:"alert","[attr.id]":"id","(mouseenter)":"handleAlertMouseEvent($event)","(mouseleave)":"handleAlertMouseEvent($event)","[@fadeAlertNgIf]":""},animations:[F],styles:[":host{display:block}.fd-alert .fd-popover__body{position:fixed;top:auto;left:auto}"]}]}],t.ctorParameters=function(){return[{type:k},{type:r.ElementRef},{type:r.ChangeDetectorRef},{type:r.ComponentFactoryResolver},{type:R,decorators:[{type:r.Optional}]}]},t.propDecorators={containerRef:[{type:r.ViewChild,args:["container",{read:r.ViewContainerRef}]}],dismissible:[{type:r.Input}],type:[{type:r.Input}],id:[{type:r.Input}],duration:[{type:r.Input}],mousePersist:[{type:r.Input}],ariaLabelledBy:[{type:r.Input}],ariaLabel:[{type:r.Input}],dismissLabel:[{type:r.Input}],width:[{type:r.Input}],message:[{type:r.Input}],onDismiss:[{type:r.Output}]},t}(p),L=function(){function t(){}return t.decorators=[{type:r.Component,args:[{selector:"fd-alert-container",template:"",host:{"[@alertContainerNgIf]":""},animations:[T],styles:["\n :host {\n position: fixed;\n display: flex;\n flex-direction: column;\n z-index: 5000;\n align-items: center;\n top: 0;\n right: 50%;\n left: 50%;\n }\n "]}]}],t}(),S=function Sn(){this.dismissible=!0,this.width="33vw",this.duration=1e4,this.mousePersist=!1,this.ariaLabelledBy=null,this.ariaLabel=null},O=function(){function t(t,e){this._parentInjector=t,this._additionalTokens=e}return t.prototype.get=function(t,e,n){var i=this._additionalTokens.get(t);return i||this._parentInjector.get(t,e)},t}(),M=function(){function t(t,e,n){this.componentFactoryResolver=t,this.appRef=e,this.injector=n,this.alerts=[]}return t.prototype.hasOpenAlerts=function(){return this.alerts&&0<this.alerts.length},t.prototype.open=function(t,e){var n=this;void 0===e&&(e=new S),this.alerts&&0!==this.alerts.length||this.openAlertContainer(),e&&!e.width&&(e.width="33vw");var i=new WeakMap,o=new R;o.data=e?e.data:undefined,i.set(R,o);var s=this.componentFactoryResolver.resolveComponentFactory(x).create(new O(this.injector,i));s.location.nativeElement.style.marginTop="10px",this.appRef.attachView(s.hostView);var a=o.afterDismissed.subscribe(function(){n.destroyAlertComponent(s),a.unsubscribe()}),r=Object.assign({},e);Object.keys(r).forEach(function(t){"data"!==t&&(s.instance[t]=r[t])}),s.instance.childComponentType=t;var l=s.hostView.rootNodes[0];return this.alertContainerRef.location.nativeElement.appendChild(l),this.alerts.push(s),o},t.prototype.dismissAll=function(){var e=this;this.alerts.forEach(function(t){e.destroyAlertComponent(t)})},t.prototype.destroyAlertComponent=function(t){this.alerts[this.alerts.indexOf(t)]=null,this.alerts=this.alerts.filter(function(t){return null!==t&&t!==undefined}),this.appRef.detachView(t.hostView),t.destroy(),!this.alertContainerRef||this.alerts&&0!==this.alerts.length||this.destroyAlertContainer()},t.prototype.openAlertContainer=function(){var t=this.componentFactoryResolver.resolveComponentFactory(L).create(this.injector);this.appRef.attachView(t.hostView);var e=t.hostView.rootNodes[0];document.body.appendChild(e),this.alertContainerRef=t},t.prototype.destroyAlertContainer=function(){this.appRef.detachView(this.alertContainerRef.hostView),this.alertContainerRef.destroy(),this.alertContainerRef=undefined},t.decorators=[{type:r.Injectable}],t.ctorParameters=function(){return[{type:r.ComponentFactoryResolver},{type:r.ApplicationRef},{type:r.Injector}]},t}(),P=function(){function t(){}return t.decorators=[{type:r.NgModule,args:[{declarations:[x,L],imports:[s.CommonModule,m,E],exports:[x,L],entryComponents:[L,x],providers:[M]}]}],t}(),H=function(e){function t(t){return e.call(this,t)||this}return d(t,e),t.prototype._setProperties=function(){this._addClassToElement("fd-badge"),this.status&&this._addClassToElement("fd-badge--"+this.status),this.modifier&&this._addClassToElement("fd-badge--"+this.modifier)},t.decorators=[{type:r.Component,args:[{selector:"fd-badge",template:"<span><ng-content></ng-content></span>\n"}]}],t.ctorParameters=function(){return[{type:r.ElementRef,decorators:[{type:r.Inject,args:[r.ElementRef]}]}]},t.propDecorators={status:[{type:r.Input}],modifier:[{type:r.Input}]},t}(p),A=function(n){function t(t){var e=n.call(this,t)||this;return e.status="",e.isStatusLabel=!1,e.statusIcon="",e.icon="",e}return d(t,n),t.prototype._setProperties=function(){this.isStatusLabel?(this._addClassToElement("fd-status-label"),this.status&&this._addClassToElement("fd-status-label--"+this.status),this.statusIcon&&this._addClassToElement("fd-status-label--"+this.statusIcon),this.icon&&this._addClassToElement("sap-icon--"+this.icon)):(this._addClassToElement("fd-label"),this.status&&this._addClassToElement("fd-label--"+this.status))},t.decorators=[{type:r.Component,args:[{selector:"fd-label",template:"<span><ng-content></ng-content></span>\n"}]}],t.ctorParameters=function(){return[{type:r.ElementRef,decorators:[{type:r.Inject,args:[r.ElementRef]}]}]},t.propDecorators={status:[{type:r.Input}],isStatusLabel:[{type:r.Input}],statusIcon:[{type:r.Input}],icon:[{type:r.Input}]},t}(p),V=function(){function t(){}return t.decorators=[{type:r.NgModule,args:[{imports:[s.CommonModule],exports:[H,A],declarations:[H,A]}]}],t}(),N=function(){function t(){}return t.decorators=[{type:r.Directive,args:[{selector:"fd-breadcrumb",host:{"class":"fd-breadcrumb"}}]}],t}(),B=function(){function t(){}return t.decorators=[{type:r.Directive,args:[{selector:"fd-breadcrumb-item",host:{"class":"fd-breadcrumb__item"}}]}],t}(),Y=function(){function t(){}return t.decorators=[{type:r.Directive,args:[{selector:"[fd-breadcrumb-link]",host:{"class":"fd-breadcrumb__link"}}]}],t}(),j=function(){function t(){}return t.decorators=[{type:r.NgModule,args:[{imports:[s.CommonModule],exports:[N,B,Y],declarations:[N,B,Y]}]}],t}(),$=function(){function t(){this.fdButtonGroupClass=!0}return t.decorators=[{type:r.Component,args:[{selector:"fd-button-group",template:"<ng-content></ng-content>\n",host:{role:"group"}}]}],t.propDecorators={fdButtonGroupClass:[{type:r.HostBinding,args:["class.fd-button-group"]}]},t}(),z=function(n){function t(t){var e=n.call(this,t)||this;return e.elementRef=t,e.compact=!1,e.fdButtonGroupedClass=!0,e}return d(t,n),t.prototype._setProperties=function(){this.size&&this._addClassToElement("fd-button--"+this.size),this.glyph&&this._addClassToElement("sap-icon--"+this.glyph),this.state&&this._addClassToElement("is-"+this.state)},t.decorators=[{type:r.Directive,args:[{selector:"[fd-button-grouped]"}]}],t.ctorParameters=function(){return[{type:r.ElementRef}]},t.propDecorators={size:[{type:r.Input}],glyph:[{type:r.Input}],state:[{type:r.Input}],compact:[{type:r.Input},{type:r.HostBinding,args:["class.fd-button--compact"]}],fdButtonGroupedClass:[{type:r.HostBinding,args:["class.fd-button--grouped"]}]},t}(p),K=function(){function t(){}return t.decorators=[{type:r.NgModule,args:[{imports:[s.CommonModule],exports:[$,z],declarations:[$,z]}]}],t}();function G(t){return new W(t)}var U=function(){function t(){this.i18nChange=new n.Subject}return t.decorators=[{type:r.Injectable,args:[{providedIn:"root",useFactory:G,deps:[r.LOCALE_ID]}]}],t.ngInjectableDef=r.defineInjectable({factory:function(){return G(r.inject(r.LOCALE_ID))},token:t,providedIn:"root"}),t}(),W=function(i){function t(t){var e=i.call(this)||this;if(e.locale=t,e.weekdaysFallback=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],e.monthsFullFallback=["January","February","March","April","May","June","July","August","September","October","November","December"],e.monthsShortFallback=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],t){var n=s.getLocaleDayNames(t,s.FormStyle.Standalone,s.TranslationWidth.Short);e.weekdaysShort=n.map(function(t,e){return n[(e+1)%7]}),e.monthsShort=s.getLocaleMonthNames(t,s.FormStyle.Standalone,s.TranslationWidth.Abbreviated),e.monthsFull=s.getLocaleMonthNames(t,s.FormStyle.Standalone,s.TranslationWidth.Wide),e.weekdaysShort&&e.weekdaysShort.unshift(e.weekdaysShort.pop())}return e.checkForFallback(),e}return d(t,i),t.prototype.getDayAriaLabel=function(t){return t.getDate()+" "+this.monthsFull[t.getMonth()]+" "+t.getFullYear()},t.prototype.getAllFullMonthNames=function(){return this.monthsFull},t.prototype.getAllShortMonthNames=function(){return this.monthsShort},t.prototype.getAllShortWeekdays=function(){return this.weekdaysShort},t.prototype.checkForFallback=function(){this.weekdaysShort&&0!==this.weekdaysShort.length||(this.weekdaysShort=this.weekdaysFallback),this.monthsShort&&0!==this.monthsShort.length||(this.monthsShort=this.monthsShortFallback),this.monthsFull&&0!==this.monthsFull.length||(this.monthsFull=this.monthsFullFallback)},t.decorators=[{type:r.Injectable}],t.ctorParameters=function(){return[{type:String,decorators:[{type:r.Optional},{type:r.Inject,args:[r.LOCALE_ID]}]}]},t}(U),q=function(){function t(){this.yearSelectionLabel="Year selection",this.previousYearLabel="Previous year",this.nextYearLabel="Next year",this.monthSelectionLabel="Month selection",this.previousMonthLabel="Previous month",this.nextMonthLabel="Next month"}return t.decorators=[{type:r.Injectable,args:[{providedIn:"root"}]}],t.ngInjectableDef=r.defineInjectable({factory:function(){return new t},token:t,providedIn:"root"}),t}();function J(){return new X}var Q=function(){function t(){this.rangeDelimiter=" - "}return t.decorators=[{type:r.Injectable,args:[{providedIn:"root",useFactory:J}]}],t.ngInjectableDef=r.defineInjectable({factory:J,token:t,providedIn:"root"}),t}(),X=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return d(e,t),e.prototype.parse=function(t){return new Date(t)},e.prototype.format=function(t){return t.toLocaleDateString()},e.decorators=[{type:r.Injectable}],e}(Q),Z=function(){function t(t,e,n,i,o,s){this.hasher=t,this.eRef=e,this.cd=n,this.calendarI18nLabels=i,this.calendarI18n=o,this.dateAdapter=s,this.init=!1,this.fdCalendarClass=!0,this.calType="single",this.startingDayOfWeek=0,this.isInvalidDateInput=new r.EventEmitter,this.isDateTimePicker=!1,this.invalidDate=!1,this.showCalendarMonths=!1,this.showCalendarYears=!1,this.showCalendarDates=!0,this.daysPerMonth=[31,28,31,30,31,30,31,31,30,31,30,31],this.calendarGrid=[],this.calendarYearsList=[],this.today=new Date,this.todayMonth=this.today.getMonth(),this.todayYear=this.today.getFullYear(),this.date=new Date,this.month=this.date.getMonth(),this.year=this.date.getFullYear(),this.day=this.date.getDate(),this.firstYearCalendarList=this.year,this.selectCounter=0,this.selectedDay={date:null},this.selectedDayChange=new r.EventEmitter,this.selectedRangeFirst={date:null},this.selectedRangeFirstChange=new r.EventEmitter,this.selectedRangeLast={date:null},this.selectedRangeLastChange=new r.EventEmitter,this.emittedDate={selectedDay:this.selectedDay,selectedFirstDay:this.selectedRangeFirst,selectedLastDay:this.selectedRangeLast},this.closeCalendar=new r.EventEmitter,this.disableFunction=function(t){return!1},this.disableRangeStartFunction=function(t){return!1},this.disableRangeEndFunction=function(t){return!1},this.blockRangeStartFunction=function(t){return!1},this.blockRangeEndFunction=function(t){return!1},this.blockFunction=function(t){return!1},this.onChange=function(){},this.onTouched=function(){},this.determineDaysInMonth=function(t,e){return 1===t&&(e%100!=0&&e%4==0||e%400==0)?29:this.daysPerMonth[t]}}return t.prototype.setWeekDaysOrder=function(){if(this.weekDays=this.calendarI18n.getAllShortWeekdays().map(function(t){return t[0]}),this.startingDayOfWeek<=6&&0<=this.startingDayOfWeek)for(var t=this.startingDayOfWeek;0<t;t--)this.weekDays.push(this.weekDays.shift())},t.prototype.getPreviousMonthDays=function(t){var e;this.setWeekDaysOrder();var n=(e=new Date(this.date.getFullYear(),this.date.getMonth(),0)).getMonth(),i=e.getFullYear(),o=e.getDate(),s=e.getDay()-this.startingDayOfWeek;if(s<6)for(;0<=s;){var a=new Date(i,n,o-s),r={date:a,day:a.getDate(),weekDay:a.getDay(),monthStatus:"previous",disabled:this.disableFunction(a),blocked:this.blockFunction(a),selected:this.selectedDay.date&&a.toDateString()===this.selectedDay.date.toDateString()||this.selectedRangeFirst.date&&a.toDateString()===this.selectedRangeFirst.date.toDateString()||this.selectedRangeLast.date&&a.toDateString()===this.selectedRangeLast.date.toDateString(),selectedFirst:this.selectedRangeFirst.date&&a.toDateString()===this.selectedRangeFirst.date.toDateString(),selectedLast:this.selectedRangeLast.date&&a.toDateString()===this.selectedRangeLast.date.toDateString(),selectedRange:this.selectedRangeFirst.date&&a.getTime()>this.selectedRangeFirst.date.getTime()&&this.selectedRangeLast.date&&a.getTime()<this.selectedRangeLast.date.getTime(),ariaLabel:this.calendarI18n.getDayAriaLabel(a)};0===this.selectCounter?(this.disableRangeStartFunction&&!r.disabled&&(r.disabled=this.disableRangeStartFunction(a)),this.blockRangeStartFunction&&!r.blocked&&(r.blocked=this.blockRangeStartFunction(a))):1===this.selectCounter&&(this.disableRangeEndFunction&&!r.disabled&&(r.disabled=this.disableRangeEndFunction(a)),this.blockRangeEndFunction&&!r.blocked&&(r.blocked=this.blockRangeEndFunction(a))),t.push(r),s--}return t},t.prototype.getCurrentMonthDays=function(t){for(var e=this.determineDaysInMonth(this.month,this.year),n=!1,i=1;i<=e;i++){var o=new Date(this.date.getFullYear(),this.date.getMonth(),i),s={date:o,day:o.getDate(),weekDay:o.getDay(),monthStatus:"current",disabled:this.disableFunction(o),blocked:this.blockFunction(o),selected:this.selectedDay.date&&o.toDateString()===this.selectedDay.date.toDateString()||this.selectedRangeFirst.date&&o.toDateString()===this.selectedRangeFirst.date.toDateString()||this.selectedRangeLast.date&&o.toDateString()===this.selectedRangeLast.date.toDateString(),selectedFirst:this.selectedRangeFirst.date&&o.toDateString()===this.selectedRangeFirst.date.toDateString(),selectedLast:this.selectedRangeLast.date&&o.toDateString()===this.selectedRangeLast.date.toDateString(),selectedRange:this.selectedRangeFirst.date&&o.getTime()>this.selectedRangeFirst.date.getTime()&&this.selectedRangeLast.date&&o.getTime()<this.selectedRangeLast.date.getTime(),today:o.toDateString()===this.today.toDateString(),isTabIndexed:!1,ariaLabel:this.calendarI18n.getDayAriaLabel(o)};0===this.selectCounter||2===this.selectCounter?(this.disableRangeStartFunction&&!s.disabled&&(s.disabled=this.disableRangeStartFunction(o)),this.blockRangeStartFunction&&!s.blocked&&(s.blocked=this.blockRangeStartFunction(o))):1===this.selectCounter&&(this.disableRangeEndFunction&&!s.disabled&&(s.disabled=this.disableRangeEndFunction(o)),this.blockRangeEndFunction&&!s.blocked&&(s.blocked=this.blockRangeEndFunction(o))),s.selected&&(n=!0,s.isTabIndexed=!0),t.push(s)}if(!n){var a=!1;for(i=0;i<e;i++)t[i]&&t[i].today&&(a=!0,t[i].isTabIndexed=!0);a||(t[0].isTabIndexed=!0)}return t},t.prototype.getNextMonthDays=function(t){var e=0;e=35<t.length?42-t.length:35-t.length;for(var n=1;n<=e;n++){var i=void 0,o=(i=11===this.date.getMonth()?new Date(this.date.getFullYear()+1,0,1):new Date(this.date.getFullYear(),this.date.getMonth()+1,1)).getMonth(),s=i.getFullYear(),a=new Date(s,o,n),r={date:a,day:a.getDate(),weekDay:a.getDay(),monthStatus:"next",disabled:this.disableFunction(a),blocked:this.blockFunction(a),selected:this.selectedDay.date&&a.toDateString()===this.selectedDay.date.toDateString()||this.selectedRangeFirst.date&&a.toDateString()===this.selectedRangeFirst.date.toDateString()||this.selectedRangeLast.date&&a.toDateString()===this.selectedRangeLast.date.toDateString(),selectedFirst:this.selectedRangeFirst.date&&a.toDateString()===this.selectedRangeFirst.date.toDateString(),selectedLast:this.selectedRangeLast.date&&a.toDateString()===this.selectedRangeLast.date.toDateString(),selectedRange:this.selectedRangeFirst.date&&a.getTime()>this.selectedRangeFirst.date.getTime()&&this.selectedRangeLast.date&&a.getTime()<this.selectedRangeLast.date.getTime(),ariaLabel:this.calendarI18n.getDayAriaLabel(a)};0===this.selectCounter?(this.disableRangeStartFunction&&!r.disabled&&(r.disabled=this.disableRangeStartFunction(a)),this.blockRangeStartFunction&&!r.blocked&&(r.blocked=this.blockRangeStartFunction(a))):1===this.selectCounter&&(this.disableRangeEndFunction&&!r.disabled&&(r.disabled=this.disableRangeEndFunction(a)),this.blockRangeEndFunction&&!r.blocked&&(r.blocked=this.blockRangeEndFunction(a))),t.push(r)}return t},t.prototype.populateCalendar=function(){var t=[];return t=this.getPreviousMonthDays(t),t=this.getCurrentMonthDays(t),t=this.getNextMonthDays(t)},t.prototype.constructCalendar=function(){for(var t=this.populateCalendar(),e=[];0<t.length;)e.push(t.splice(0,7));this.calendarGrid=e},t.prototype.refreshSelected=function(){var e=this;this.calendarGrid.forEach(function(t){t.forEach(function(t){t.selected=e.selectedDay.date&&t.date&&t.date.toDateString()===e.selectedDay.date.toDateString()||e.selectedRangeFirst.date&&t.date.toDateString()===e.selectedRangeFirst.date.toDateString()||e.selectedRangeLast.date&&t.date.toDateString()===e.selectedRangeLast.date.toDateString(),t.selectedFirst=e.selectedRangeFirst.date&&t.date&&t.date.toDateString()===e.selectedRangeFirst.date.toDateString(),t.selectedLast=e.selectedRangeLast.date&&t.date&&t.date.toDateString()===e.selectedRangeLast.date.toDateString(),t.selectedRange=e.selectedRangeFirst.date&&t.date.getTime()>e.selectedRangeFirst.date.getTime()&&e.selectedRangeLast.date&&t.date.getTime()<e.selectedRangeLast.date.getTime()})})},t.prototype.updateDatePickerInputEmitter=function(){"single"===this.calType?this.emittedDate.selectedDay=this.selectedDay:(this.emittedDate.selectedFirstDay=this.selectedRangeFirst,this.emittedDate.selectedLastDay=this.selectedRangeLast),this.dateFromDatePicker&&this.dateFromDatePicker.next(this.emittedDate)},t.prototype.constructCalendarYearsList=function(){this.calendarYearsList=[];for(var t=0;t<12;t++)this.calendarYearsList.push(this.firstYearCalendarList+t)},t.prototype.getYearTabIndex=function(t,e){var n=this,i=-1;if(t===this.year)i=0;else{var o=!1;this.calendarYearsList.forEach(function(t){n.year===t&&(o=!0)}),o||0===e&&(i=0)}return i},t.prototype.goToPreviousMonth=function(){this.setCurrentMonth(this.date.getMonth()-1),this.selectedMonth=this.month,this.constructCalendar()},t.prototype.goToNextMonth=function(){this.setCurrentMonth(this.date.getMonth()+1),this.selectedMonth=this.month,this.constructCalendar()},t.prototype.loadNextYearsList=function(){this.calendarYearsList=[],this.firstYearCalendarList+=12,this.constructCalendarYearsList()},t.prototype.loadPrevYearsList=function(){this.calendarYearsList=[],this.firstYearCalendarList-=12,this.constructCalendarYearsList()},t.prototype.selectDate=function(t,e,n,i){if(void 0===e&&(e=!0),n&&n.stopPropagation(),!t.blocked&&!t.disabled)if("single"===this.calType)this.selectedDay=t,this.selectedDayChange.emit(this.selectedDay),this.refreshSelected(),this.init&&this.updateDatePickerInputEmitter(),e&&this.onChange({date:t.date}),i&&this.closeCalendar.emit();else if(2===this.selectCounter&&(this.selectCounter=0),1===this.selectCounter&&t.date!==this.selectedRangeLast.date&&(this.selectedRangeLast=t,this.selectedRangeLastChange.emit(this.selectedRangeLast),this.selectCounter++,this.refreshSelected(),this.constructCalendar(),this.init&&this.updateDatePickerInputEmitter(),e&&this.onChange({date:this.selectedRangeFirst.date,rangeEnd:t.date})),0===this.selectCounter&&(this.selectedRangeLast=t,this.selectedRangeLastChange.emit(this.selectedRangeLast),this.selectedRangeFirst=t,this.selectedRangeFirstChange.emit(this.selectedRangeFirst),this.selectCounter++,this.refreshSelected(),this.constructCalendar(),this.init&&this.updateDatePickerInputEmitter(),e&&this.onChange({date:t.date,rangeEnd:t.date})),this.selectedRangeFirst.date>this.selectedRangeLast.date){var o=this.selectedRangeFirst;this.selectedRangeFirst=this.selectedRangeLast,this.selectedRangeFirstChange.emit(this.selectedRangeFirst),this.selectedRangeLast=o,this.selectedRangeLastChange.emit(this.selectedRangeLast),this.refreshSelected(),this.constructCalendar(),this.init&&this.updateDatePickerInputEmitter(),e&&this.onChange({date:this.selectedRangeFirst.date,rangeEnd:this.selectedRangeLast.date})}this.isInvalidDateInput.emit(!1)},t.prototype.setCurrentMonth=function(t){this.date.setMonth(t),this.month=this.date.getMonth(),this.monthName=this.monthsFullName[this.date.getMonth()],this.year=this.date.getFullYear()},t.prototype.selectMonth=function(t,e){e&&e.stopPropagation(),this.selectedMonth=t,this.setCurrentMonth(t),this.constructCalendar(),this.openDaySelection()},t.prototype.setCurrentYear=function(t){this.date.setFullYear(t),this.year=this.date.getFullYear()},t.prototype.selectYear=function(t,e){e&&e.stopPropagation(),this.selectedMonth=this.month,this.setCurrentYear(t),this.constructCalendar(),this.openDaySelection()},t.prototype.openMonthSelection=function(){this.showCalendarYears?(this.showCalendarYears=!1,this.showCalendarMonths=!0,this.showCalendarDates=!1):(this.showCalendarMonths=!this.showCalendarMonths,this.showCalendarYears=!1,this.showCalendarDates=!this.showCalendarDates)},t.prototype.openYearSelection=function(){this.showCalendarMonths?(this.showCalendarMonths=!1,this.showCalendarYears=!0,this.showCalendarDates=!1):(this.showCalendarYears=!this.showCalendarYears,this.showCalendarMonths=!1,this.showCalendarDates=!this.showCalendarDates)},t.prototype.openDaySelection=function(){this.showCalendarMonths=!1,this.showCalendarYears=!1,this.showCalendarDates=!0},t.prototype.onEscapeKeydownHandler=function(){this.showCalendarDates=!0,this.showCalendarMonths=!1,this.showCalendarYears=!1},t.prototype.onClickHandler=function(t){var e=t.target;this.eRef.nativeElement.contains(e)||(this.showCalendarDates=!0,this.showCalendarMonths=!1,this.showCalendarYears=!1)},t.prototype.validateDateFromDatePicker=function(t){if(!t)return!0;var e=t.getMonth(),n=t.getDate(),i=t.getFullYear();return!!(isNaN(e)||isNaN(n)||isNaN(i))||(i<1e3||3e3<i||e<0||11<e||(n<1||n>this.determineDaysInMonth(e,i)))},t.prototype.resetSelection=function(){"single"===this.calType?(this.selectedDay={date:null},this.selectedDayChange.emit(this.selectedDay)):(this.selectedRangeFirst={date:null},this.selectedRangeFirstChange.emit(this.selectedRangeFirst),this.selectedRangeLast={date:null},this.selectedRangeLastChange.emit(this.selectedRangeLast)),this.date=new Date,this.year=this.date.getFullYear(),this.month=this.date.getMonth(),this.monthName=this.monthsFullName[this.date.getMonth()],this.day=this.date.getDate(),this.selectedMonth=null,this.firstYearCalendarList=this.year,this.selectCounter=0,this.calendarYearsList=[],this.constructCalendarYearsList(),this.constructCalendar()},t.prototype.onKeydownYearHandler=function(t,e){var n;"Space"===t.code||"Enter"===t.code?(t.preventDefault(),this.selectYear(e)):"ArrowUp"===t.code?(t.preventDefault(),this.calendarYearsList.indexOf(e)<=3&&(this.loadPrevYearsList(),this.cd.detectChanges()),n="#"+this.calendarId+"-fd-year-"+(e-4)):"ArrowDown"===t.code?(t.preventDefault(),8<=this.calendarYearsList.indexOf(e)&&(this.loadNextYearsList(),this.cd.detectChanges()),n="#"+this.calendarId+"-fd-year-"+(e+4)):"ArrowLeft"===t.code?(t.preventDefault(),e===this.calendarYearsList[0]&&(this.loadPrevYearsList(),this.cd.detectChanges()),n="#"+this.calendarId+"-fd-year-"+(e-1)):"ArrowRight"===t.code?(t.preventDefault(),e===this.calendarYearsList[this.calendarYearsList.length-1]&&(this.loadNextYearsList(),this.cd.detectChanges()),n="#"+this.calendarId+"-fd-year-"+(e+1)):"Tab"!==t.code||t.shiftKey||this.isDateTimePicker||(t.preventDefault(),this.focusElement("#arrowLeft")),n&&this.focusElement(n)},t.prototype.onKeydownMonthHandler=function(t,e){var n;"Space"===t.code||"Enter"===t.code?(t.preventDefault(),this.selectMonth(e)):"ArrowUp"===t.code?(t.preventDefault(),n="#"+this.calendarId+"-fd-month-"+(e-4)):"ArrowDown"===t.code?(t.preventDefault(),n="#"+this.calendarId+"-fd-month-"+(e+4)):"ArrowLeft"===t.code?(t.preventDefault(),n=0===e?"#"+this.calendarId+"-fd-month-11":"#"+this.calendarId+"-fd-month-"+(e-1)):"ArrowRight"===t.code?(t.preventDefault(),n=11===e?"#"+this.calendarId+"-fd-month-0":"#"+this.calendarId+"-fd-month-"+(e+1)):"Tab"!==t.code||t.shiftKey||this.isDateTimePicker||(t.preventDefault(),this.focusElement("#arrowLeft")),n&&this.focusElement(n)},t.prototype.onKeydownDayHandler=function(t,e){if("Tab"!==t.code||t.shiftKey){var n=6===this.calendarGrid.length?66:56,i=parseInt(t.currentTarget.id.split("-").pop(),10);if("Space"===t.code||"Enter"===t.code){t.preventDefault();this.selectDate(e,!0,null,!0),this.newFocusedDayId="#"+this.calendarId+"-fd-day-"+i}else if("ArrowUp"===t.code)if(t.preventDefault(),10<=i&&i<=16){this.goToPreviousMonth();var o=i.toString().split("").pop();this.newFocusedDayId="#"+this.calendarId+"-fd-day-"+this.calendarGrid.length.toString()+o}else this.newFocusedDayId="#"+this.calendarId+"-fd-day-"+(i-10);else if("ArrowDown"===t.code)if(t.preventDefault(),n-6<=i&&i<=n){this.goToNextMonth();o=i.toString().split("").pop();this.newFocusedDayId="#"+this.calendarId+"-fd-day-1"+o}else this.newFocusedDayId="#"+this.calendarId+"-fd-day-"+(i+10);else"ArrowLeft"===t.code?(t.preventDefault(),10===i?(this.goToPreviousMonth(),n=6===this.calendarGrid.length?66:56,this.newFocusedDayId="#"+this.calendarId+"-fd-day-"+n):"0"===i.toString().split("").pop()?this.newFocusedDayId="#"+this.calendarId+"-fd-day-"+(i-4):this.newFocusedDayId="#"+this.calendarId+"-fd-day-"+(i-1)):"ArrowRight"===t.code&&(t.preventDefault(),i===n?(this.goToNextMonth(),this.newFocusedDayId="#"+this.calendarId+"-fd-day-10"):"6"===i.toString().split("").pop()?this.newFocusedDayId="#"+this.calendarId+"-fd-day-"+(i+4):this.newFocusedDayId="#"+this.calendarId+"-fd-day-"+(i+1));this.newFocusedDayId&&this.focusElement(this.newFocusedDayId)}else this.isDateTimePicker||(t.preventDefault(),this.focusElement("#arrowLeft"))},t.prototype.focusElement=function(t){var e=this.eRef.nativeElement.querySelector(t);e&&e.focus()},t.prototype.updateFromDatePicker=function(t){if("single"===this.calType){var e=this.dateAdapter.parse(t);this.invalidDate=this.validateDateFromDatePicker(e),this.invalidDate?(this.isInvalidDateInput.emit(this.invalidDate),this.resetSelection()):(this.selectedDay.date=new Date(e.getFullYear(),e.getMonth(),e.getDate()),this.date=new Date(e.getFullYear(),e.getMonth(),e.getDate()),this.year=this.date.getFullYear(),this.month=this.date.getMonth(),this.monthName=this.monthsFullName[this.date.getMonth()],this.isInvalidDateInput.emit(this.invalidDate),this.constructCalendar(),this.constructCalendarYearsList(),this.updateDatePickerInputEmitter())}else{var n=t.split(this.dateAdapter.rangeDelimiter),i=this.dateAdapter.parse(n[0]),o=this.dateAdapter.parse(n[1]);if(this.invalidDate=this.validateDateFromDatePicker(i)||this.validateDateFromDatePicker(o),this.invalidDate)this.resetSelection(),this.isInvalidDateInput.emit(this.invalidDate);else{var s=i,a=o;s.getTime()>a.getTime()?(this.selectedRangeFirst.date=a,this.selectedRangeLast.date=s):(this.selectedRangeFirst.date=s,this.selectedRangeLast.date=a),this.date=i,this.year=this.date.getFullYear(),this.month=this.date.getMonth(),this.monthName=this.monthsFullName[this.date.getMonth()],this.isInvalidDateInput.emit(this.invalidDate),this.constructCalendar(),this.constructCalendarYearsList(),this.updateDatePickerInputEmitter()}}},t.prototype.ngOnInit=function(){var e=this;this.setupLocalization(),this.date||(this.date=new Date),this.constructCalendar(),this.constructCalendarYearsList(),this.calendarId=this.hasher.hash(),this.month?this.selectMonth(this.month):this.selectMonth(this.date.getMonth()),this.year?this.selectYear(this.year):this.selectMonth(this.date.getFullYear()),this.dateFromDatePicker&&this.dateFromDatePicker.subscribe(function(t){t&&"string"==typeof t&&e.updateFromDatePicker(t),e.constructCalendarYearsList()}),this.init=!0},t.prototype.ngAfterViewChecked=function(){this.newFocusedDayId&&(this.focusElement(this.newFocusedDayId),this.newFocusedDayId=null)},t.prototype.ngOnDestroy=function(){this.dateFromDatePicker&&this.dateFromDatePicker.unsubscribe(),this.i18nLocalSub&&this.i18nLocalSub.unsubscribe()},t.prototype.ngOnChanges=function(t){t&&(t.disableFunction||t.blockFunction)&&this.constructCalendar()},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.setDisabledState=function(t){},t.prototype.writeValue=function(t){t&&this.calType&&(t.date&&"single"===this.calType?this.singleFormsSetup(t):t.date&&t.rangeEnd&&"range"===this.calType&&this.rangeFormsSetup(t))},t.prototype.singleFormsSetup=function(t){this.selectedDay.date=new Date(t.date.getFullYear(),t.date.getMonth(),t.date.getDate()),this.date=new Date(t.date.getFullYear(),t.date.getMonth(),t.date.getDate()),this.year=this.date.getFullYear(),this.month=this.date.getMonth(),this.monthName=this.monthsFullName[this.date.getMonth()],this.firstYearCalendarList=this.year,this.constructCalendar(),this.constructCalendarYearsList()},t.prototype.rangeFormsSetup=function(t){var e=new Date(t.date.getFullYear(),t.date.getMonth(),t.date.getDate()),n=new Date(t.rangeEnd.getFullYear(),t.rangeEnd.getMonth(),t.rangeEnd.getDate());e.getTime()>n.getTime()?(this.selectedRangeFirst.date=n,this.selectedRangeLast.date=e):(this.selectedRangeFirst.date=e,this.selectedRangeLast.date=n),this.date=new Date(t.date.getFullYear(),t.date.getMonth(),t.date.getDate()),this.year=this.date.getFullYear(),this.month=this.date.getMonth(),this.monthName=this.monthsFullName[this.date.getMonth()],this.firstYearCalendarList=this.year,this.constructCalendar(),this.constructCalendarYearsList()},t.prototype.setupLocalization=function(){var t=this;this.monthsFullName=this.calendarI18n.getAllFullMonthNames(),this.monthsShortName=this.calendarI18n.getAllShortMonthNames(),this.monthName=this.monthsFullName[this.month],this.i18nLocalSub=this.calendarI18n.i18nChange.subscribe(function(){t.monthsFullName=t.calendarI18n.getAllFullMonthNames(),t.monthsShortName=t.calendarI18n.getAllShortMonthNames(),t.monthName=t.monthsFullName[t.month],t.setWeekDaysOrder(),t.cd.detectChanges()})},t.decorators=[{type:r.Component,args:[{selector:"fd-calendar",template:'<header class="fd-calendar__header">\n <div class="fd-calendar__navigation">\n <div class="fd-calendar__action">\n <button id="arrowLeft" class="fd-button--toolbar fd-button--xs sap-icon--slim-arrow-left"\n [attr.aria-label]="showCalendarYears ? calendarI18nLabels?.previousYearLabel : calendarI18nLabels?.previousMonthLabel"\n (click)="showCalendarYears ? loadPrevYearsList() : goToPreviousMonth()"></button>\n </div>\n <div class="fd-calendar__action">\n <button class=" fd-button--light fd-button--s"\n [attr.aria-label]="calendarI18nLabels?.monthSelectionLabel"\n (click)="openMonthSelection()">{{monthName}}</button>\n </div>\n <div class="fd-calendar__action">\n <button class=" fd-button--light fd-button--s"\n [attr.aria-label]="calendarI18nLabels?.yearSelectionLabel"\n (click)="openYearSelection()">{{year}}</button>\n </div>\n <div class="fd-calendar__action">\n <button class="fd-button--toolbar fd-button--xs sap-icon--slim-arrow-right"\n [attr.aria-label]="showCalendarYears ? calendarI18nLabels?.nextYearLabel : calendarI18nLabels?.nextMonthLabel"\n (click)="showCalendarYears ? loadNextYearsList() : goToNextMonth()"></button>\n </div>\n </div>\n</header>\n<div class="fd-calendar__content">\n <div class="fd-calendar__years"\n *ngIf="showCalendarYears">\n <ul class="fd-calendar__list">\n <li class="fd-calendar__item"\n *ngFor="let listYear of calendarYearsList; let i = index;"\n [ngClass]=\'(listYear===todayYear ? " fd-calendar__item--current" : "") + (listYear===year ? " is-selected" : "")\'\n (click)="selectYear(listYear, $event)">\n <span role="button" [attr.tabIndex]="getYearTabIndex(listYear, i)"\n [attr.id]="calendarId + \'-fd-year-\' + listYear"\n (keydown)="onKeydownYearHandler($event, listYear)"\n class="fd-calendar__text">{{listYear}}</span>\n </li>\n </ul>\n </div>\n\n <div class="fd-calendar__months"\n *ngIf="showCalendarMonths">\n <ul class="fd-calendar__list">\n <li class="fd-calendar__item"\n *ngFor="let monthShortName of monthsShortName, let i=index"\n [ngClass]=\'(i===todayMonth && year===todayYear ? " fd-calendar__item--current" : "") + (i===selectedMonth ? " is-selected" : "") \'\n (click)="selectMonth(i, $event)">\n <span role="button" [attr.tabIndex]="i === selectedMonth ? 0 : -1"\n [attr.id]="calendarId + \'-fd-month-\' + i" (keydown)="onKeydownMonthHandler($event, i)"\n class="fd-calendar__text">{{monthShortName}}</span>\n </li>\n </ul>\n </div>\n\n <div class="fd-calendar__dates"\n *ngIf="showCalendarDates">\n <table class="fd-calendar__table"\n role="grid">\n <thead class="fd-calendar__group">\n <tr class="fd-calendar__row">\n <th class="fd-calendar__column-header"\n *ngFor="let day of weekDays">\n <span class="fd-calendar__day-of-week">{{day}}</span>\n </th>\n </tr>\n </thead>\n <tbody class="fd-calendar__group" [attr.id]="calendarId + \'-dates-table\'">\n <tr class="fd-calendar__row"\n *ngFor="let row of calendarGrid; let i = index;">\n <td class="fd-calendar__item"\n role="gridcell"\n [attr.aria-label]="cell.ariaLabel"\n *ngFor="let cell of row; let cellIndex = index;"\n [ngClass]=\'(cell.monthStatus !== "current" ? " fd-calendar__item--other-month": "") +\n (cell.selected ? " is-selected": "") + \n (calType==="range" && cell.selectedLast && selectedRangeFirst != selectedRangeLast ? " is-selected-range-last": "") + \n (calType==="range" && cell.selectedFirst && selectedRangeFirst != selectedRangeLast ? " is-selected-range-first": "") + \n (calType==="range" && cell.selectedRange && !cell.selectedFirst && !cell.selectedLast ? " is-selected-range": "") +\n (cell.today ? " fd-calendar__item--current": "") + \n (cell.disabled ? " is-disabled": "") +\n (cell.blocked ? " is-blocked": "")\'\n (click)="selectDate(cell, true, $event)">\n <span class="fd-calendar__text" [attr.id]="calendarId + \'-fd-day-\' + (i + 1) + cellIndex"\n role="button" [attr.tabindex]="cell.isTabIndexed ? 0 : -1"\n (keydown)="onKeydownDayHandler($event, cell)">{{cell.day}}</span>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n</div>\n',host:{"(blur)":"onTouched()","class":"fd-calendar"},providers:[{provide:a.NG_VALUE_ACCESSOR,useExisting:r.forwardRef(function(){return t}),multi:!0}],styles:[":host{display:block}.fd-calendar__content{background-color:#fff}"]}]}],t.ctorParameters=function(){return[{type:k},{type:r.ElementRef},{type:r.ChangeDetectorRef},{type:q},{type:U},{type:Q}]},t.propDecorators={fdCalendarClass:[{type:r.HostBinding,args:["class.fd-calendar"]}],dateFromDatePicker:[{type:r.Input}],calType:[{type:r.Input}],startingDayOfWeek:[{type:r.Input}],isInvalidDateInput:[{type:r.Output}],isDateTimePicker:[{type:r.Input}],selectedDay:[{type:r.Input}],selectedDayChange:[{type:r.Output}],selectedRangeFirst:[{type:r.Input}],selectedRangeFirstChange:[{type:r.Output}],selectedRangeLast:[{type:r.Input}],selectedRangeLastChange:[{type:r.Output}],closeCalendar:[{type:r.Output}],disableFunction:[{type:r.Input}],disableRangeStartFunction:[{type:r.Input}],disableRangeEndFunction:[{type:r.Input}],blockRangeStartFunction:[{type:r.Input}],blockRangeEndFunction:[{type:r.Input}],blockFunction:[{type:r.Input}],onEscapeKeydownHandler:[{type:r.HostListener,args:["document:keydown.escape",[]]}],onClickHandler:[{type:r.HostListener,args:["document:click",["$event"]]}]},t}(),tt=function(){function t(){}return t.decorators=[{type:r.NgModule,args:[{declarations:[Z],imports:[s.CommonModule,m,E],exports:[Z]}]}],t}(),et=function(){function t(t){this.itemEl=t}return t.prototype.ngAfterViewInit=function(){this.itemEl&&this.itemEl.nativeElement&&this.itemEl.nativeElement.children&&this.itemEl.nativeElement.children[0]&&"A"===this.itemEl.nativeElement.children[0].tagName?this.itemEl.nativeElement.children[0].classList.add("fd-menu__item"):this.itemEl&&this.itemEl.nativeElement&&this.itemEl.nativeElement.children&&0===this.itemEl.nativeElement.children.length&&this.itemEl.nativeElement.classList.add("fd-menu__item")},t.prototype.ngOnChanges=function(){this.ngAfterViewInit()},t.decorators=[{type:r.Directive,args:[{selector:"[fd-menu-item]"}]}],t.ctorParameters=function(){return[{type:r.ElementRef}]},t}(),nt=function(){function t(){this.dropdownValues=[],this.filterFn=this.defaultFilter,this.inShellbar=!1,this.glyph="search",this.maxHeight="200px",this.compact=!1,this.highlight=!0,this.closeOnSelect=!0,this.fillOnSelect=!0,this.displayFn=this.defaultDisplay,this.itemClicked=new r.EventEmitter,this.displayedValues=[],this.isOpen=!1,this.searchInputClass=!0,this.shellBarClass=this.inShellbar,this.onChange=function(){},this.onTouched=function(){}}return t.prototype.onInputKeydownHandler=function(t){"Enter"===t.code&&this.searchFunction?this.searchFunction():"ArrowDown"===t.code&&(t.preventDefault(),this.menuItems&&this.menuItems.first&&this.menuItems.first.itemEl.nativeElement.children[0].focus())},t.prototype.onInputKeyupHandler=function(){this.inputText.length&&(this.isOpen=!0)},t.prototype.onMenuKeydownHandler=function(t,e){var n=this;if("Enter"===t.code&&e)this.handleClickActions(e),this.itemClicked.emit({item:e,index:this.dropdownValues.indexOf(e)});else if("ArrowDown"===t.code){t.preventDefault();var i=!1,o=this.menuItems.toArray();o.forEach(function(t,e){document.activeElement!==t.itemEl.nativeElement.children[0]||i||(o[e+1]&&o[e+1].itemEl.nativeElement.children[0].focus(),i=!0)})}else if("ArrowUp"===t.code){t.preventDefault();var s=!1,a=this.menuItems.toArray();a.forEach(function(t,e){s||(document.activeElement===t.itemEl.nativeElement.children[0]&&0===e?(n.searchInputElement.nativeElement.focus(),s=!0):document.activeElement===t.itemEl.nativeElement.children[0]&&(a[e-1]&&a[e-1].itemEl.nativeElement.children[0].focus(),s=!0))})}},t.prototype.onMenuClickHandler=function(t,e){e&&(this.handleClickActions(e),this.itemClicked.emit({item:e,index:this.dropdownValues.indexOf(e)}))},t.prototype.shellbarSearchInputClicked=function(t){t.stopPropagation()},Object.defineProperty(t.prototype,"inputText",{get:function(){return this.inputTextValue},set:function(t){this.inputTextValue=t,this.onChange(t),this.onTouched()},enumerable:!0,configurable:!0}),t.prototype.writeValue=function(t){this.inputTextValue=t},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.handleClickActions=function(t){this.closeOnSelect&&(this.isOpen=!1),this.fillOnSelect&&(this.inputText=this.displayFn(t),this.handleSearchTermChange())},t.prototype.ngOnInit=function(){this.dropdownValues&&(this.displayedValues=this.dropdownValues)},t.prototype.ngOnChanges=function(t){this.dropdownValues&&(t.dropdownValues||t.searchTerm)&&(this.inputText?this.displayedValues=this.filterFn(this.dropdownValues,this.inputText):this.displayedValues=this.dropdownValues)},t.prototype.handleSearchTermChange=function(){this.displayedValues=this.filterFn(this.dropdownValues,this.inputText)},t.prototype.defaultDisplay=function(t){return t},t.prototype.defaultFilter=function(t,e){var n=this,i=e.toLocaleLowerCase();return t.filter(function(t){if(t)return n.displayFn(t).toLocaleLowerCase().includes(i)})},t.decorators=[{type:r.Component,args:[{selector:"fd-search-input",template:'<fd-popover [(isOpen)]="isOpen"\n [fillControl]="true"\n [disabled]="disabled"\n class="fd-search-input-popover-custom"\n [ngClass]="{\'fd-popover-body--display-none\': displayedValues && !displayedValues.length}">\n <fd-popover-control