angular-bootstrap-datetimepicker
Version:
Native Angular (8+) datetime picker component styled by Twitter Bootstrap 4.
24 lines (22 loc) • 26.5 kB
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("moment"),require("@angular/core"),require("@angular/forms"),require("@angular/common"),require("rxjs/operators")):"function"==typeof define&&define.amd?define("angular-bootstrap-datetimepicker",["exports","moment","@angular/core","@angular/forms","@angular/common","rxjs/operators"],e):e((t=t||self)["angular-bootstrap-datetimepicker"]={},t.moment,t.ng.core,t.ng.forms,t.ng.common,t.rxjs.operators)}(this,(function(t,e,o,n,a,r){"use strict";var i="default"in e?e.default:e,l=function(t,e){return(l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)};
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */function u(t,e){function o(){this.constructor=t}l(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}function s(t,e,o,n){var a,r=arguments.length,i=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,e,o,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(i=(r<3?a(i):r>3?a(e,o,i):a(e,o))||i);return r>3&&i&&Object.defineProperty(e,o,i),i}function d(t,e){return function(o,n){e(o,n,t)}}var p=function(){},c=e,f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return u(e,t),e.prototype.fromMilliseconds=function(t){return c(t)},e.prototype.toMilliseconds=function(t){return t?t.valueOf():void 0},e}(p),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return u(e,t),e.prototype.fromMilliseconds=function(t){return new Date(t)},e.prototype.toMilliseconds=function(t){return t?t.getTime():void 0},e}(p),v=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return u(e,t),e.prototype.fromMilliseconds=function(t){return t},e.prototype.toMilliseconds=function(t){return t},e}(p),m=e;"default"in e&&(m=i);var g=new o.InjectionToken("DL_DATE_TIME_DISPLAY_FORMAT"),b=m.localeData().longDateFormat("lll"),y=new o.InjectionToken("DL_DATE__TIME_INPUT_FORMATS"),_=["YYYY-MM-DDTHH:mm","YYYY-MM-DDTHH:mm:ss","YYYY-MM-DDTHH:mm:ss.SSS","YYYY-MM-DD","M/D/YYYY h:m:s A","M/D/YYYY h:m A","M/D/YYYY h:m A","M/D/YYYY","M/D/YY h:m:s A","M/D/YY h:m A","M/D/YY h A","M/D/YY",b,m.ISO_8601],O=new o.InjectionToken("DL_DATE_TIME_MODEL_FORMAT"),M=e,D=function(t){function e(e,o){var n=t.call(this)||this;return n.inputFormats=e,n.modelFormat=o,n}return u(e,t),e.prototype.fromMilliseconds=function(t){return M(t).format(this.modelFormat)},e.prototype.toMilliseconds=function(t){if(null!=t){var e=M(t,this.inputFormats,!0);return e.isValid()?e.valueOf():void 0}},e=s([d(0,o.Inject(y)),d(1,o.Inject(O))],e)}(p),w=b,Y=_,L="YYYY-MM-DDTHH:mm:ss.SSSZ",T=function(){function t(){}return t=s([o.NgModule({providers:[{provide:g,useValue:w},{provide:y,useValue:Y},{provide:O,useValue:L}]})],t)}(),C=function(){function t(){}return t=s([o.NgModule({imports:[T],providers:[{provide:p,useClass:v}],exports:[T]})],t)}(),A=function(){function t(){}return t=s([o.NgModule({imports:[T],providers:[{provide:p,useClass:h}]})],t)}(),I=function(){function t(){}return t=s([o.NgModule({imports:[T],providers:[{provide:p,useClass:f}]})],t)}(),E=_,V=b,S=function(){function t(){}return t=s([o.NgModule({imports:[T],providers:[{provide:y,useValue:E},{provide:O,useValue:V},{provide:p,useClass:D}]})],t)}(),P=function(){function t(t){this._value=t}return Object.defineProperty(t.prototype,"value",{get:function(){return this._value},enumerable:!0,configurable:!0}),t}(),F=e,R=function(){function t(t,e,a,r,i){var l=this;this._renderer=t,this._elementRef=e,this._dateAdapter=a,this._displayFormat=r,this._inputFormats=i,this._filterValidator=function(t){return(l._inputFilter||function(){return!0})(l._value)?null:{dlDateTimeInputFilter:{value:t.value}}},this._inputFilter=function(){return!0},this._isValid=!0,this._parseValidator=function(){return l._isValid?null:{dlDateTimeInputParse:{text:l._elementRef.nativeElement.value}}},this._changed=[],this._touched=[],this._validator=n.Validators.compose([this._parseValidator,this._filterValidator]),this._onValidatorChange=function(){},this._value=void 0,this.dateChange=new o.EventEmitter}var e;return e=t,Object.defineProperty(t.prototype,"dlDateTimeInputFilter",{set:function(t){this._inputFilter=t||function(){return!0},this._onValidatorChange()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this._value},set:function(t){var e=this;t!==this._value&&(this._value=t,this._changed.forEach((function(t){return t(e._value)})))},enumerable:!0,configurable:!0}),t.prototype._onChange=function(){this.dateChange.emit(new P(this._value))},t.prototype._onBlur=function(){this._value&&this._setElementValue(this._value),this._touched.forEach((function(t){return t()}))},t.prototype._onInput=function(t){var e=null==t||""===t?void 0:F(t,this._inputFormats,!0);this._isValid=e&&e.isValid(),this.value=this._isValid?this._dateAdapter.fromMilliseconds(e.valueOf()):void 0},t.prototype._setElementValue=function(t){null!=t&&this._renderer.setProperty(this._elementRef.nativeElement,"value",F(t).format(this._displayFormat))},t.prototype.registerOnChange=function(t){this._changed.push(t)},t.prototype.registerOnTouched=function(t){this._touched.push(t)},t.prototype.registerOnValidatorChange=function(t){this._onValidatorChange=t},t.prototype.setDisabledState=function(t){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",t)},t.prototype.validate=function(t){return this._validator(t)},t.prototype.writeValue=function(t){this._isValid=!0,this.value=t,this._setElementValue(t)},t.ctorParameters=function(){return[{type:o.Renderer2},{type:o.ElementRef},{type:p},{type:String,decorators:[{type:o.Inject,args:[g]}]},{type:Array,decorators:[{type:o.Inject,args:[y]}]}]},s([o.Output()],t.prototype,"dateChange",void 0),s([o.Input()],t.prototype,"dlDateTimeInputFilter",null),s([o.HostListener("change")],t.prototype,"_onChange",null),s([o.HostListener("blur")],t.prototype,"_onBlur",null),s([o.HostListener("input",["$event.target.value"])],t.prototype,"_onInput",null),t=e=s([o.Directive({selector:"input[dlDateTimeInput]",providers:[{provide:n.NG_VALUE_ACCESSOR,useExisting:e,multi:!0},{provide:n.NG_VALIDATORS,useExisting:e,multi:!0}]}),d(3,o.Inject(g)),d(4,o.Inject(y))],t)}(),N=function(){function t(){}return t=s([o.NgModule({declarations:[R],imports:[a.CommonModule],exports:[R]})],t)}(),k=function(){function t(t){this._value=t}return Object.defineProperty(t.prototype,"value",{get:function(){return this._value},enumerable:!0,configurable:!0}),t}(),B=e,x=function(){function t(){}return t.prototype.onChanges=function(t){},t.prototype.getModel=function(t,e){var o=B(t).startOf("month"),n=B(t).endOf("month"),a=B(o).subtract(Math.abs(o.weekday()),"days"),r=[0,1,2,3,4,5,6],i=B(o).subtract(1,"month"),l=B(o).add(1,"month"),u=B(t).startOf("day").valueOf(),s=null==e?e:B(e).startOf("day").valueOf();return{viewName:"day",viewLabel:o.format("MMM YYYY"),activeDate:u,leftButton:{value:i.valueOf(),ariaLabel:"Go to "+i.format("MMM YYYY"),classes:{}},upButton:{value:o.valueOf(),ariaLabel:"Go to month view",classes:{}},rightButton:{value:l.valueOf(),ariaLabel:"Go to "+l.format("MMM YYYY"),classes:{}},rowLabels:r.map((function(t){return B().weekday(t).format("dd")})),rows:[0,1,2,3,4,5].map((function(t){var e=B();return{cells:r.map((function(i){var l=B(a).add(t*r.length+i,"days");return{display:l.format("D"),ariaLabel:l.format("ll"),value:l.valueOf(),classes:{"dl-abdtp-active":u===l.valueOf(),"dl-abdtp-future":l.isAfter(n),"dl-abdtp-past":l.isBefore(o),"dl-abdtp-selected":s===l.valueOf(),"dl-abdtp-now":l.isSame(e,"day")}}}))}}))}},t.prototype.goDown=function(t,e){return this.getModel(B(t).add(7,"days").valueOf(),e)},t.prototype.goUp=function(t,e){return this.getModel(B(t).subtract(7,"days").valueOf(),e)},t.prototype.goLeft=function(t,e){return this.getModel(B(t).subtract(1,"day").valueOf(),e)},t.prototype.goRight=function(t,e){return this.getModel(B(t).add(1,"day").valueOf(),e)},t.prototype.pageDown=function(t,e){return this.getModel(B(t).add(1,"month").valueOf(),e)},t.prototype.pageUp=function(t,e){return this.getModel(B(t).subtract(1,"month").valueOf(),e)},t.prototype.goEnd=function(t,e){return this.getModel(B(t).endOf("month").startOf("day").valueOf(),e)},t.prototype.goHome=function(t,e){return this.getModel(B(t).startOf("month").valueOf(),e)},t}(),U=e,j=function(){function t(){}return t.prototype.onChanges=function(t){},t.prototype.getModel=function(t,e){var o=U(t).startOf("day"),n=[0,1,2,3],a=U(o).subtract(1,"day"),r=U(o).add(1,"day"),i=U(t).startOf("hour").valueOf(),l=null==e?e:U(e).startOf("hour").valueOf();return{viewName:"hour",viewLabel:o.format("ll"),activeDate:i,leftButton:{value:a.valueOf(),ariaLabel:"Go to "+a.format("ll"),classes:{}},upButton:{value:o.valueOf(),ariaLabel:"Go to "+o.format("MMM YYYY"),classes:{}},rightButton:{value:r.valueOf(),ariaLabel:"Go to "+r.format("ll"),classes:{}},rows:[0,1,2,3,4,5].map((function(t){var e=U();return{cells:n.map((function(a){var r=U(o).add(t*n.length+a,"hours");return{display:r.format("LT"),ariaLabel:r.format("LLL"),value:r.valueOf(),classes:{"dl-abdtp-active":i===r.valueOf(),"dl-abdtp-selected":l===r.valueOf(),"dl-abdtp-now":r.isSame(e,"hour")}}}))}}))}},t.prototype.goDown=function(t,e){return this.getModel(U(t).add(4,"hour").valueOf(),e)},t.prototype.goUp=function(t,e){return this.getModel(U(t).subtract(4,"hour").valueOf(),e)},t.prototype.goLeft=function(t,e){return this.getModel(U(t).subtract(1,"hour").valueOf(),e)},t.prototype.goRight=function(t,e){return this.getModel(U(t).add(1,"hour").valueOf(),e)},t.prototype.pageDown=function(t,e){return this.getModel(U(t).add(1,"day").valueOf(),e)},t.prototype.pageUp=function(t,e){return this.getModel(U(t).subtract(1,"day").valueOf(),e)},t.prototype.goEnd=function(t,e){return this.getModel(U(t).endOf("day").startOf("hour").valueOf(),e)},t.prototype.goHome=function(t,e){return this.getModel(U(t).startOf("day").valueOf(),e)},t}(),H=e,G=function(){function t(){this.step=5}return t.prototype.onChanges=function(t){var e=t.minuteStep;e&&e.previousValue!==e.currentValue&&(this.step=e.currentValue,null!==this.step&&void 0!==this.step||(this.step=5))},t.prototype.getModel=function(t,e){var o=this,n=H(t).startOf("hour"),a=H().valueOf(),r=new Array(Math.ceil(60/this.step)).fill(0).map((function(t,e){return t+e*o.step})),i=r.map((function(t){return H(n).add(t,"minutes").valueOf()})),l=H(i.filter((function(e){return e<=t})).pop()).valueOf(),u=a>=n.valueOf()&&a<=H(n).endOf("hour").valueOf()?H(i.filter((function(t){return t<=a})).pop()).valueOf():null,s=H(n).subtract(1,"hour"),d=H(n).add(1,"hour"),p=null==e?e:H(i.filter((function(t){return t<=e})).pop()).valueOf(),c=new Array(Math.ceil(r.length/4)).fill(0).map((function(t,e){return t+e})).map((function(t){return{cells:r.slice(4*t,4*t+4).map(f)}}));return{viewName:"minute",viewLabel:n.format("lll"),activeDate:l,leftButton:{value:s.valueOf(),ariaLabel:"Go to "+s.format("lll"),classes:{}},upButton:{value:n.valueOf(),ariaLabel:"Go to "+n.format("ll"),classes:{}},rightButton:{value:d.valueOf(),ariaLabel:"Go to "+d.format("lll"),classes:{}},rows:c};function f(t){var e=H(n).add(t,"minutes");return{display:e.format("LT"),ariaLabel:e.format("LLL"),value:e.valueOf(),classes:{"dl-abdtp-active":l===e.valueOf(),"dl-abdtp-selected":p===e.valueOf(),"dl-abdtp-now":u===e.valueOf()}}}},t.prototype.goDown=function(t,e){return this.getModel(H(t).add(4*this.step,"minutes").valueOf(),e)},t.prototype.goUp=function(t,e){return this.getModel(H(t).subtract(4*this.step,"minutes").valueOf(),e)},t.prototype.goLeft=function(t,e){return this.getModel(H(t).subtract(this.step,"minutes").valueOf(),e)},t.prototype.goRight=function(t,e){return this.getModel(H(t).add(this.step,"minutes").valueOf(),e)},t.prototype.pageDown=function(t,e){return this.getModel(H(t).add(1,"hour").valueOf(),e)},t.prototype.pageUp=function(t,e){return this.getModel(H(t).subtract(1,"hour").valueOf(),e)},t.prototype.goEnd=function(t,e){return this.getModel(H(t).endOf("hour").valueOf(),e)},t.prototype.goHome=function(t,e){return this.getModel(H(t).startOf("hour").valueOf(),e)},t}(),q=e,Z=function(){function t(){}return t.prototype.onChanges=function(t){},t.prototype.getModel=function(t,e){var o=q(t).startOf("year"),n=[0,1,2,3],a=q(o).subtract(1,"year"),r=q(o).add(1,"year"),i=q(t).startOf("month").valueOf(),l=null==e?e:q(e).startOf("month").valueOf();return{viewName:"month",viewLabel:o.format("YYYY"),activeDate:i,leftButton:{value:a.valueOf(),ariaLabel:"Go to "+a.format("YYYY"),classes:{}},upButton:{value:o.valueOf(),ariaLabel:"Go to "+o.format("YYYY"),classes:{}},rightButton:{value:r.valueOf(),ariaLabel:"Go to "+r.format("YYYY"),classes:{}},rows:[0,1,2].map((function(t){var e=q();return{cells:n.map((function(a){var r=q(o).add(t*n.length+a,"months");return{display:r.format("MMM"),ariaLabel:r.format("MMM YYYY"),value:r.valueOf(),classes:{"dl-abdtp-active":i===r.valueOf(),"dl-abdtp-selected":l===r.valueOf(),"dl-abdtp-now":r.isSame(e,"month")}}}))}}))}},t.prototype.goDown=function(t,e){return this.getModel(q(t).add(4,"month").valueOf(),e)},t.prototype.goUp=function(t,e){return this.getModel(q(t).subtract(4,"month").valueOf(),e)},t.prototype.goLeft=function(t,e){return this.getModel(q(t).subtract(1,"month").valueOf(),e)},t.prototype.goRight=function(t,e){return this.getModel(q(t).add(1,"month").valueOf(),e)},t.prototype.pageDown=function(t,e){return this.getModel(q(t).add(12,"months").valueOf(),e)},t.prototype.pageUp=function(t,e){return this.getModel(q(t).subtract(12,"months").valueOf(),e)},t.prototype.goEnd=function(t,e){return this.getModel(q(t).endOf("year").valueOf(),e)},t.prototype.goHome=function(t,e){return this.getModel(q(t).startOf("year").valueOf(),e)},t}(),K=e,$=function(){function t(){}return t.getStartOfDecade=function(t){var e=10*Math.trunc(K(t).year()/10);return K({year:e}).startOf("year")},t.prototype.onChanges=function(t){},t.prototype.getModel=function(e,o){var n=[0,1,2,3,4],a=K(e).startOf("year"),r=t.getStartOfDecade(e),i=r.year()+9,l=r.year(),u=a.valueOf(),s=null==o?o:K(o).startOf("year").valueOf();return{viewName:"year",viewLabel:l+"-"+i,activeDate:u,leftButton:{value:K(r).subtract(10,"years").valueOf(),ariaLabel:"Go to "+(l-10)+"-"+(l-1),classes:{}},rightButton:{value:K(r).add(10,"years").valueOf(),ariaLabel:"Go to "+(i+1)+"-"+(i+10),classes:{}},rows:[0,1].map(function(t){var e=K();return{cells:n.map((function(o){var a=K(r).add(t*n.length+o,"years");return{display:a.format("YYYY"),value:a.valueOf(),classes:{"dl-abdtp-active":u===a.valueOf(),"dl-abdtp-selected":s===a.valueOf(),"dl-abdtp-now":a.isSame(e,"year")}}}))}}.bind(this))}},t.prototype.goDown=function(t,e){return this.getModel(K(t).add(5,"year").valueOf(),e)},t.prototype.goUp=function(t,e){return this.getModel(K(t).subtract(5,"year").valueOf(),e)},t.prototype.goLeft=function(t,e){return this.getModel(K(t).subtract(1,"year").valueOf(),e)},t.prototype.goRight=function(t,e){return this.getModel(K(t).add(1,"year").valueOf(),e)},t.prototype.pageDown=function(t,e){return this.getModel(K(t).add(10,"year").valueOf(),e)},t.prototype.pageUp=function(t,e){return this.getModel(K(t).subtract(10,"year").valueOf(),e)},t.prototype.goEnd=function(e,o){return this.getModel(t.getStartOfDecade(e).add(9,"years").endOf("year").valueOf(),o)},t.prototype.goHome=function(e,o){return this.getModel(t.getStartOfDecade(e).startOf("year").valueOf(),o)},t}(),z=e,W={ArrowDown:"goDown",ArrowLeft:"goLeft",ArrowRight:"goRight",ArrowUp:"goUp",Down:"goDown",End:"goEnd",Home:"goHome",Left:"goLeft",PageDown:"pageDown",PageUp:"pageUp",Right:"goRight",Up:"goUp",33:"pageUp",34:"pageDown",35:"goEnd",36:"goHome",37:"goLeft",38:"goUp",39:"goRight",40:"goDown"},J=["minute","hour","day","month","year"],Q=function(){function t(t,e,n,a,r,i,l,u){this._elementRef=t,this._ngZone=e,this._dateAdapter=n,this.yearModelComponent=a,this.monthModelComponent=r,this.dayModelComponent=i,this.hourModelComponent=l,this.minuteModelComponent=u,this._changed=[],this._nextView={year:"month",month:"day",day:"hour",hour:"minute"},this._previousView={minute:"hour",hour:"day",day:"month",month:"year"},this._touched=[],this.change=new o.EventEmitter,this.leftIconClass=["oi","oi-chevron-left"],this.maxView="year",this.minView="minute",this.minuteStep=5,this.rightIconClass=["oi","oi-chevron-right"],this.selectFilter=function(){return!0},this.startView="day",this.upIconClass=["oi","oi-chevron-top"],this._viewToModelProvider={year:a,month:r,day:i,hour:l,minute:u}}var e;return e=t,Object.defineProperty(t.prototype,"model",{set:function(t){this._model=this.applySelectFilter(t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this._value},set:function(t){this._value!==t&&(this._value=t,this.model=this._viewToModelProvider[this._model.viewName].getModel(this.getStartDate(),this.valueOf),this._changed.forEach((function(e){return e(t)})),this.change.emit(new k(t)))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"valueOf",{get:function(){return this._dateAdapter.toMilliseconds(this._value)},enumerable:!0,configurable:!0}),t.prototype.applySelectFilter=function(t){var e=this;return this.selectFilter&&(t.rows=t.rows.map((function(o){return o.cells.map((function(o){var n=!e.selectFilter(o,t.viewName);return o.classes["dl-abdtp-disabled"]=n,n&&(o.classes["aria-disabled"]=!0),o})),o}))),t},t.prototype.focusActiveCell=function(){var t=this;this._ngZone.runOutsideAngular((function(){t._ngZone.onStable.asObservable().pipe(r.take(1)).subscribe((function(){t._elementRef.nativeElement.querySelector(".dl-abdtp-active").focus()}))}))},t.prototype.getStartDate=function(){return X(this._value)?this._dateAdapter.toMilliseconds(this._value):X(this.startDate)?this.startDate:z().valueOf()},t.prototype.getStartView=function(){var t=Math.max(J.indexOf(this.minView||"minute"),J.indexOf(this.startView||"day"));return J[t]},t.prototype.onTouch=function(){this._touched.forEach((function(t){return t()}))},t.prototype.ngOnChanges=function(t){Object.values(this._viewToModelProvider).forEach((function(e){return e.onChanges(t)})),this._model&&(this.model=this._viewToModelProvider[this._model.viewName].getModel(this._model.activeDate,this.valueOf))},t.prototype.ngOnInit=function(){this.model=this._viewToModelProvider[this.getStartView()].getModel(this.getStartDate(),this.valueOf)},t.prototype._onDateClick=function(t){if(!t.classes["dl-abdtp-disabled"]){var e=this._nextView[this._model.viewName];(this.minView||"minute")===this._model.viewName&&(this.value=this._dateAdapter.fromMilliseconds(t.value),e=this.startView),this.model=this._viewToModelProvider[e].getModel(t.value,this.valueOf),this.onTouch()}},t.prototype._onLeftClick=function(){this.model=this._viewToModelProvider[this._model.viewName].getModel(this._model.leftButton.value,this.valueOf),this.onTouch()},t.prototype._onUpClick=function(){this.model=this._viewToModelProvider[this._previousView[this._model.viewName]].getModel(this._model.upButton.value,this.valueOf)},t.prototype._onRightClick=function(){this.model=this._viewToModelProvider[this._model.viewName].getModel(this._model.rightButton.value,this.valueOf),this.onTouch()},t.prototype._handleKeyDown=function(t){var e=W[t.key];if(e){var o=this._viewToModelProvider[this._model.viewName];this.model=o[e](this._model.activeDate,this.valueOf),this.focusActiveCell(),t.preventDefault()}},t.prototype.registerOnChange=function(t){this._changed.push(t)},t.prototype.registerOnTouched=function(t){this._touched.push(t)},t.prototype.writeValue=function(t){this.value=t},t.ctorParameters=function(){return[{type:o.ElementRef},{type:o.NgZone},{type:p},{type:$},{type:Z},{type:x},{type:j},{type:G}]},s([o.Output()],t.prototype,"change",void 0),s([o.Input()],t.prototype,"leftIconClass",void 0),s([o.Input()],t.prototype,"maxView",void 0),s([o.Input()],t.prototype,"minView",void 0),s([o.Input()],t.prototype,"minuteStep",void 0),s([o.Input()],t.prototype,"rightIconClass",void 0),s([o.Input()],t.prototype,"selectFilter",void 0),s([o.Input()],t.prototype,"startDate",void 0),s([o.Input()],t.prototype,"startView",void 0),s([o.Input()],t.prototype,"upIconClass",void 0),t=e=s([o.Component({changeDetection:o.ChangeDetectionStrategy.OnPush,preserveWhitespaces:!1,providers:[{provide:n.NG_VALUE_ACCESSOR,useExisting:e,multi:!0}],selector:"dl-date-time-picker",template:'<div class="text-center dl-abdtp-{{_model.viewName}}-view" [attr.data-dl-abdtp-view]="_model.viewName">\n <div class="row align-items-center no-gutters">\n <button class="col dl-abdtp-left-button align-items-center"\n type="button"\n [attr.aria-label]="_model.leftButton.ariaLabel"\n [attr.dl-abdtp-value]="_model.leftButton.value"\n [attr.title]="_model.leftButton.ariaLabel"\n (click)="_onLeftClick()"\n ><span class="left-icon" [ngClass]="leftIconClass"></span>\n </button>\n\n <div *ngIf="_model.viewName === (this.maxView || \'year\'); then maxViewLabel else defaultViewLabel;"></div>\n\n <button class="col dl-abdtp-right-button"\n type="button"\n [attr.aria-label]="_model.rightButton.ariaLabel"\n [attr.dl-abdtp-value]="_model.rightButton.value"\n [attr.title]="_model.rightButton.ariaLabel"\n (click)="_onRightClick()"\n ><span class="right-icon" [ngClass]="rightIconClass"></span>\n </button>\n </div>\n <div (keydown)="_handleKeyDown($event)">\n <div *ngIf="_model.rowLabels?.length" class="row no-gutters">\n <div *ngFor="let label of _model.rowLabels"\n class="col align-items-center no-gutters dl-abdtp-col-label">{{label}}</div>\n </div>\n <div *ngFor="let row of _model.rows" class="row align-items-center no-gutters">\n <div *ngFor="let cell of row.cells"\n role="gridcell"\n class="col dl-abdtp-date-button dl-abdtp-{{_model.viewName}}"\n [ngClass]="cell.classes"\n [attr.aria-label]="cell.ariaLabel"\n [attr.aria-disabled]="cell.classes[\'dl-abdtp-disabled\']"\n [attr.dl-abdtp-value]="cell.value"\n [attr.tabindex]="cell.classes[\'dl-abdtp-active\'] ? 0 : -1"\n (click)="_onDateClick(cell)"\n (keydown.space)="_onDateClick(cell)"\n (keydown.enter)="_onDateClick(cell)"\n >{{cell.display}}</div>\n </div>\n </div>\n</div>\n\n<ng-template #maxViewLabel>\n <div class="col-10 dl-abdtp-view-label">{{_model.viewLabel}}</div>\n</ng-template>\n<ng-template #defaultViewLabel>\n <button class="col-10 dl-abdtp-view-label dl-abdtp-up-button"\n type="button"\n [attr.aria-label]="_model.upButton.ariaLabel"\n [attr.dl-abdtp-value]="_model.upButton.value"\n [attr.title]="_model.upButton.ariaLabel"\n (click)="_onUpClick()"\n [ngClass]="_model.upButton.classes"\n >{{_model.viewLabel}} <span class="up-icon" [ngClass]="upIconClass"></span>\n </button>\n</ng-template>\n',styles:[":host{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.dl-abdtp-col-label,.dl-abdtp-view-label{font-weight:700}.dl-abdtp-date-button,.dl-abdtp-left-button,.dl-abdtp-right-button,.dl-abdtp-view-label{padding:5px;border-radius:999px;cursor:pointer;color:rgba(0,0,0,.87);outline:0}.dl-abdtp-date-button,.dl-abdtp-left-button,.dl-abdtp-right-button,.dl-abdtp-up-button{border-width:0}.dl-abdtp-active:focus,.dl-abdtp-date-button:focus,.dl-abdtp-date-button:hover,.dl-abdtp-left-button:focus,.dl-abdtp-left-button:hover,.dl-abdtp-right-button:focus,.dl-abdtp-right-button:hover,.dl-abdtp-up-button:focus,.dl-abdtp-up-button:hover,.dl-abdtp-view-label:focus{background:rgba(0,0,0,.04)}.dl-abdtp-future,.dl-abdtp-past{color:rgba(0,0,0,.04)}.dl-abdtp-now,.dl-abdtp-now.disabled,.dl-abdtp-now.disabled:hover,.dl-abdtp-now:hover{border-radius:999px;border:1px solid rgba(0,0,0,.25)}.dl-abdtp-selected{color:#fff;background:rgba(0,82,204,.75)}.dl-abdtp-selected:focus,.dl-abdtp-selected:hover{background:#0052cc}.dl-abdtp-disabled{cursor:default;color:rgba(0,0,0,.25)}"]})],t)}();function X(t){return null!=t}
/**
* @license
* Copyright 2013-present Dale Lotts All Rights Reserved.
* http://www.dalelotts.com
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/dalelotts/angular-bootstrap-datetimepicker/blob/master/LICENSE
*/var tt=function(){function t(){}return t=s([o.NgModule({declarations:[Q],imports:[a.CommonModule],exports:[Q],providers:[$,Z,x,j,G]})],t)}();t.DL_DATE_TIME_DISPLAY_FORMAT=g,t.DL_DATE_TIME_DISPLAY_FORMAT_DEFAULT=b,t.DL_DATE_TIME_INPUT_FORMATS=y,t.DL_DATE_TIME_INPUT_FORMATS_DEFAULT=_,t.DL_DATE_TIME_MODEL_FORMAT=O,t.DL_DATE_TIME_MODEL_FORMAT_DEFAULT="YYYY-MM-DDTHH:mm:ss.SSSZ",t.DlDateAdapter=p,t.DlDateAdapterMoment=f,t.DlDateAdapterNative=h,t.DlDateAdapterNumber=v,t.DlDateAdapterString=D,t.DlDateTimeCoreModule=T,t.DlDateTimeDateModule=A,t.DlDateTimeInputChange=P,t.DlDateTimeInputDirective=R,t.DlDateTimeInputModule=N,t.DlDateTimeMomentModule=I,t.DlDateTimeNumberModule=C,t.DlDateTimePickerChange=k,t.DlDateTimePickerComponent=Q,t.DlDateTimePickerModule=tt,t.DlDateTimeStringModule=S,t.DlDayModelProvider=x,t.DlHourModelProvider=j,t.DlMinuteModelProvider=G,t.DlMonthModelProvider=Z,t.DlYearModelProvider=$,t.ɵ0=w,t.ɵ1=Y,t.ɵ2=L,t.ɵ3=E,t.ɵ4=V,Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=angular-bootstrap-datetimepicker.umd.min.js.map