!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/platform-browser"),require("@angular/forms"),require("ngx-bootstrap")):"function"==typeof define&&define.amd?define("datepicker-lib",["exports","@angular/core","@angular/platform-browser","@angular/forms","ngx-bootstrap"],t):t(e["datepicker-lib"]={},e.ng.core,e.ng.platformBrowser,e.ng.forms,e.ngxBootstrap)}(this,function(e,t,n,a,r){"use strict";var i=function(){function e(){}return e.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],e.ctorParameters=function(){return[]},e.ngInjectableDef=t.defineInjectable({factory:function(){return new e},token:e,providedIn:"root"}),e}(),o=function(){function e(e){this.elmRef=e,this.p_container_id="",this.p_tabindex=0,this.p_name="",this.p_placeholder="",this.p_min_date=null,this.p_max_date=null,this.change=new t.EventEmitter,this.disableController=!1,this.propagateChange=function(){},this.m_date_format="DD/MM/YYYY",this.m_placement="bottom"}return Object.defineProperty(e.prototype,"calendarValue",{get:function(){return this._calendarValue},set:function(e){this._calendarValue=e,this.propagateChange(e)},enumerable:!0,configurable:!0}),e.prototype.writeValue=function(e){e!==undefined&&(this.calendarValue=e)},e.prototype.registerOnChange=function(e){this.propagateChange=e},e.prototype.registerOnTouched=function(e){},e.prototype.setDisabledState=function(e){this.disableController=e},e.prototype.ngOnInit=function(){this.SetCalendarPlacement()},e.prototype.ngOnChanges=function(e){e.p_min_date!=undefined&&e.p_min_date.currentValue!=undefined&&(this.p_min_date=new Date(e.p_min_date.currentValue)),e.p_max_date!=undefined&&e.p_max_date.currentValue!=undefined&&(this.p_max_date=new Date(e.p_max_date.currentValue)),null!=this.p_min_date&&null==this.p_max_date?(this.p_min_date=new Date(this.p_min_date),this.p_max_date=new Date(new Date(this.p_min_date).getFullYear()+100,1,1)):null==this.p_min_date&&null!=this.p_max_date&&(this.p_max_date=new Date(this.p_max_date),this.p_min_date=new Date(new Date(this.p_max_date).getFullYear()-100,1,1))},e.prototype.onValueChange=function(){this.change.emit(this._calendarValue)},e.prototype.SetCalendarPlacement=function(){var e=300;0<$("body").find(".bs-datepicker").length&&(e=$("body").find(".bs-datepicker").first().height()),$("body").height()-$(this.elmRef.nativeElement).find(".fieldset").first().offset().top<e?this.m_placement="top":this.m_placement="bottom"},e.decorators=[{type:t.Component,args:[{selector:"lib-datepicker-lib",template:'\n  <div class="fieldset">\n  <input type="text" bsDatepicker\n         [placement]="m_placement"\n         [tabindex]="p_tabindex"\n         [name]="p_name"\n         [placeholder]="p_placeholder"\n         [disabled]="disableController"\n         [minDate]="p_min_date"\n         [maxDate]="p_max_date"\n         [bsConfig]="{ dateInputFormat: m_date_format, containerClass: \'theme-dark-blue\' }"\n         [(ngModel)]="calendarValue"\n         (ngModelChange)="onValueChange()"\n         (onShown)="SetCalendarPlacement()">\n</div> \n  ',providers:[{provide:a.ControlContainer,useExisting:t.forwardRef(function(){return e})},{provide:a.NG_VALUE_ACCESSOR,useExisting:t.forwardRef(function(){return e}),multi:!0}]}]}],e.ctorParameters=function(){return[{type:t.ElementRef}]},e.propDecorators={p_container_id:[{type:t.Input}],p_tabindex:[{type:t.Input}],p_name:[{type:t.Input}],p_placeholder:[{type:t.Input}],p_min_date:[{type:t.Input}],p_max_date:[{type:t.Input}],_calendarValue:[{type:t.Input,args:["calendarValue"]}],change:[{type:t.Output,args:["change"]}]},e}(),p=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{declarations:[o],imports:[n.BrowserModule,a.FormsModule,a.ReactiveFormsModule,r.BsDatepickerModule],exports:[o]}]}],e}();e.DatepickerLibService=i,e.DatepickerLibComponent=o,e.DatepickerLibModule=p,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=datepicker-lib.umd.min.js.map