ngx-bootstrap
Version:
Native Angular Bootstrap Components
1 lines • 77 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("rxjs"),require("rxjs/operators"),require("ngx-bootstrap/chronos"),require("ngx-bootstrap/mini-ngrx"),require("ngx-bootstrap/component-loader"),require("@angular/forms"),require("@angular/common"),require("ngx-bootstrap/positioning"),require("ngx-bootstrap/utils")):"function"==typeof define&&define.amd?define("ngx-bootstrap/datepicker",["exports","@angular/core","rxjs","rxjs/operators","ngx-bootstrap/chronos","ngx-bootstrap/mini-ngrx","ngx-bootstrap/component-loader","@angular/forms","@angular/common","ngx-bootstrap/positioning","ngx-bootstrap/utils"],t):t((e["ngx-bootstrap"]=e["ngx-bootstrap"]||{},e["ngx-bootstrap"].datepicker={}),e.ng.core,e.rxjs,e.rxjs.operators,e.chronos,e.miniNgrx,e.componentLoader,e.ng.forms,e.ng.common,e.positioning,e.utils)}(this,function(e,s,a,n,m,i,t,r,o,c,d){"use strict";var l=function(){function e(){this.containerClass="theme-green",this.displayMonths=1,this.showWeekNumbers=!0,this.dateInputFormat="L",this.rangeSeparator=" - ",this.rangeInputFormat="L",this.monthTitle="MMMM",this.yearTitle="YYYY",this.dayLabel="D",this.monthLabel="MMMM",this.yearLabel="YYYY",this.weekNumbers="w"}return e.decorators=[{type:s.Injectable}],e}(),h=function(e,t){return(h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function u(e,t){function n(){this.constructor=e}h(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function p(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}function f(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var a,i,r=n.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(a=r.next()).done;)s.push(a.value)}catch(o){i={error:o}}finally{try{a&&!a.done&&(n=r["return"])&&n.call(r)}finally{if(i)throw i.error}}return s}function y(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(f(arguments[t]));return e}var b=function(){function e(){this._customRangesFish=[]}return Object.defineProperty(e.prototype,"minDate",{set:function(e){this._effects.setMinDate(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"maxDate",{set:function(e){this._effects.setMaxDate(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"daysDisabled",{set:function(e){this._effects.setDaysDisabled(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDisabled",{set:function(e){this._effects.setDisabled(e)},enumerable:!0,configurable:!0}),e.prototype.setViewMode=function(e){},e.prototype.navigateTo=function(e){},e.prototype.dayHoverHandler=function(e){},e.prototype.weekHoverHandler=function(e){},e.prototype.monthHoverHandler=function(e){},e.prototype.yearHoverHandler=function(e){},e.prototype.daySelectHandler=function(e){},e.prototype.monthSelectHandler=function(e){},e.prototype.yearSelectHandler=function(e){},e.prototype._stopPropagation=function(e){e.stopPropagation()},e}(),g=function(){function t(){}return t.prototype.calculate=function(){return{type:t.CALCULATE}},t.prototype.format=function(){return{type:t.FORMAT}},t.prototype.flag=function(){return{type:t.FLAG}},t.prototype.select=function(e){return{type:t.SELECT,payload:e}},t.prototype.changeViewMode=function(e){return{type:t.CHANGE_VIEWMODE,payload:e}},t.prototype.navigateTo=function(e){return{type:t.NAVIGATE_TO,payload:e}},t.prototype.navigateStep=function(e){return{type:t.NAVIGATE_OFFSET,payload:e}},t.prototype.setOptions=function(e){return{type:t.SET_OPTIONS,payload:e}},t.prototype.selectRange=function(e){return{type:t.SELECT_RANGE,payload:e}},t.prototype.hoverDay=function(e){return{type:t.HOVER,payload:e.isHovered?e.cell.date:null}},t.prototype.minDate=function(e){return{type:t.SET_MIN_DATE,payload:e}},t.prototype.maxDate=function(e){return{type:t.SET_MAX_DATE,payload:e}},t.prototype.daysDisabled=function(e){return{type:t.SET_DAYSDISABLED,payload:e}},t.prototype.isDisabled=function(e){return{type:t.SET_IS_DISABLED,payload:e}},t.prototype.setLocale=function(e){return{type:t.SET_LOCALE,payload:e}},t.CALCULATE="[datepicker] calculate dates matrix",t.FORMAT="[datepicker] format datepicker values",t.FLAG="[datepicker] set flags",t.SELECT="[datepicker] select date",t.NAVIGATE_OFFSET="[datepicker] shift view date",t.NAVIGATE_TO="[datepicker] change view date",t.SET_OPTIONS="[datepicker] update render options",t.HOVER="[datepicker] hover date",t.CHANGE_VIEWMODE="[datepicker] switch view mode",t.SET_MIN_DATE="[datepicker] set min date",t.SET_MAX_DATE="[datepicker] set max date",t.SET_DAYSDISABLED="[datepicker] set days disabled",t.SET_IS_DISABLED="[datepicker] set is disabled",t.SET_LOCALE="[datepicker] set datepicker locale",t.SELECT_RANGE="[daterangepicker] select dates range",t.decorators=[{type:s.Injectable}],t}(),v=function(){function e(){this._defaultLocale="en",this._locale=new a.BehaviorSubject(this._defaultLocale),this._localeChange=this._locale.asObservable()}return Object.defineProperty(e.prototype,"locale",{get:function(){return this._locale},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"localeChange",{get:function(){return this._localeChange},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentLocale",{get:function(){return this._locale.getValue()},enumerable:!0,configurable:!0}),e.prototype.use=function(e){e!==this.currentLocale&&this._locale.next(e)},e.decorators=[{type:s.Injectable}],e}(),D=function(){function e(e,t){this._actions=e,this._localeService=t,this._subs=[]}return e.prototype.init=function(e){return this._store=e,this},e.prototype.setValue=function(e){this._store.dispatch(this._actions.select(e))},e.prototype.setRangeValue=function(e){this._store.dispatch(this._actions.selectRange(e))},e.prototype.setMinDate=function(e){return this._store.dispatch(this._actions.minDate(e)),this},e.prototype.setMaxDate=function(e){return this._store.dispatch(this._actions.maxDate(e)),this},e.prototype.setDaysDisabled=function(e){return this._store.dispatch(this._actions.daysDisabled(e)),this},e.prototype.setDisabled=function(e){return this._store.dispatch(this._actions.isDisabled(e)),this},e.prototype.setOptions=function(e){var t=Object.assign({locale:this._localeService.currentLocale},e);return this._store.dispatch(this._actions.setOptions(t)),this},e.prototype.setBindings=function(e){return e.daysCalendar=this._store.select(function(e){return e.flaggedMonths}).pipe(n.filter(function(e){return!!e})),e.monthsCalendar=this._store.select(function(e){return e.flaggedMonthsCalendar}).pipe(n.filter(function(e){return!!e})),e.yearsCalendar=this._store.select(function(e){return e.yearsCalendarFlagged}).pipe(n.filter(function(e){return!!e})),e.viewMode=this._store.select(function(e){return e.view.mode}),e.options=this._store.select(function(e){return e.showWeekNumbers}).pipe(n.map(function(e){return{showWeekNumbers:e}})),this},e.prototype.setEventHandlers=function(e){var n=this;return e.setViewMode=function(e){n._store.dispatch(n._actions.changeViewMode(e))},e.navigateTo=function(e){n._store.dispatch(n._actions.navigateStep(e.step))},e.dayHoverHandler=function(e){var t=e.cell;t.isOtherMonth||t.isDisabled||(n._store.dispatch(n._actions.hoverDay(e)),t.isHovered=e.isHovered)},e.monthHoverHandler=function(e){e.cell.isHovered=e.isHovered},e.yearHoverHandler=function(e){e.cell.isHovered=e.isHovered},e.monthSelectHandler=function(e){e.isDisabled||n._store.dispatch(n._actions.navigateTo({unit:{month:m.getMonth(e.date),year:m.getFullYear(e.date)},viewMode:"day"}))},e.yearSelectHandler=function(e){e.isDisabled||n._store.dispatch(n._actions.navigateTo({unit:{year:m.getFullYear(e.date)},viewMode:"month"}))},this},e.prototype.registerDatepickerSideEffects=function(){var t=this;return this._subs.push(this._store.select(function(e){return e.view}).subscribe(function(e){t._store.dispatch(t._actions.calculate())})),this._subs.push(this._store.select(function(e){return e.monthsModel}).pipe(n.filter(function(e){return!!e})).subscribe(function(e){return t._store.dispatch(t._actions.format())})),this._subs.push(this._store.select(function(e){return e.formattedMonths}).pipe(n.filter(function(e){return!!e})).subscribe(function(e){return t._store.dispatch(t._actions.flag())})),this._subs.push(this._store.select(function(e){return e.selectedDate}).pipe(n.filter(function(e){return!!e})).subscribe(function(e){return t._store.dispatch(t._actions.flag())})),this._subs.push(this._store.select(function(e){return e.selectedRange}).pipe(n.filter(function(e){return!!e})).subscribe(function(e){return t._store.dispatch(t._actions.flag())})),this._subs.push(this._store.select(function(e){return e.monthsCalendar}).subscribe(function(){return t._store.dispatch(t._actions.flag())})),this._subs.push(this._store.select(function(e){return e.yearsCalendarModel}).pipe(n.filter(function(e){return!!e})).subscribe(function(){return t._store.dispatch(t._actions.flag())})),this._subs.push(this._store.select(function(e){return e.hoveredDate}).pipe(n.filter(function(e){return!!e})).subscribe(function(e){return t._store.dispatch(t._actions.flag())})),this._subs.push(this._localeService.localeChange.subscribe(function(e){return t._store.dispatch(t._actions.setLocale(e))})),this},e.prototype.destroy=function(){try{for(var e=p(this._subs),t=e.next();!t.done;t=e.next()){t.value.unsubscribe()}}catch(i){n={error:i}}finally{try{t&&!t.done&&(a=e["return"])&&a.call(e)}finally{if(n)throw n.error}}var n,a},e.decorators=[{type:s.Injectable}],e.ctorParameters=function(){return[{type:g},{type:v}]},e}(),k={date:new Date,mode:"day"},w=Object.assign(new l,{locale:"en",view:k,selectedRange:[],monthViewOptions:{width:7,height:6}});function _(e,t,n){var a=t&&m.isBefore(m.endOf(e,"month"),t,"day"),i=n&&m.isAfter(m.startOf(e,"month"),n,"day");return a||i}function C(e,t,n){var a=t&&m.isBefore(m.endOf(e,"year"),t,"day"),i=n&&m.isAfter(m.startOf(e,"year"),n,"day");return a||i}function M(e,t){for(var n=e.initialDate,a=new Array(e.height),i=0;i<e.height;i++){a[i]=new Array(e.width);for(var r=0;r<e.width;r++)a[i][r]=t(n),n=m.shiftDate(n,e.shift)}return a}function x(e,t){var n=m.getFirstDayOfMonth(e),a=function i(e,t){if(m.isFirstDayOfWeek(e,t.firstDayOfWeek))return e;var n=function a(e,t){if(0===t)return e;var n=e-t%7;return n<0?n+7:n}(m.getDay(e),t.firstDayOfWeek);return m.shiftDate(e,{day:-n})}(n,t);return{daysMatrix:M({width:t.width,height:t.height,initialDate:a,shift:{day:1}},function(e){return e}),month:n}}function O(e,a,i){return{month:e.month,monthTitle:m.formatDate(e.month,a.monthTitle,a.locale),yearTitle:m.formatDate(e.month,a.yearTitle,a.locale),weekNumbers:function r(e,t,n){return e.map(function(e){return e[0]?m.formatDate(e[0],t,n):""})}(e.daysMatrix,a.weekNumbers,a.locale),weekdays:function s(e){var t=m.getLocale(e),n=t.weekdaysShort(),a=t.firstDayOfWeek();return y(n.slice(a),n.slice(0,a))}(a.locale),weeks:e.daysMatrix.map(function(e,n){return{days:e.map(function(e,t){return{date:e,label:m.formatDate(e,a.dayLabel,a.locale),monthIndex:i,weekIndex:n,dayIndex:t}})}})}}function I(e,t){return!t||t<=e}var S=4,E=3,H={month:1};function V(e,t){var n=m.startOf(e,"year");return{months:M({width:E,height:S,initialDate:n,shift:H},function(e){return{date:e,label:m.formatDate(e,t.monthLabel,t.locale)}}),monthTitle:"",yearTitle:m.formatDate(e,t.yearTitle,t.locale)}}var A=4,T=4,P=A*T,R=-1*(Math.floor(P/2)-1),F={year:1};function L(e,t){var n=m.shiftDate(e,{year:R}),a=M({width:T,height:A,initialDate:n,shift:F},function(e){return{date:e,label:m.formatDate(e,t.yearLabel,t.locale)}});return{years:a,monthTitle:"",yearTitle:function i(e,t){var n=m.formatDate(e[0][0].date,t.yearTitle,t.locale),a=m.formatDate(e[A-1][T-1].date,t.yearTitle,t.locale);return n+" - "+a}(a,t)}}function j(e,t){switch(void 0===e&&(e=w),t.type){case g.CALCULATE:return function c(e){var t=e.displayMonths,n=e.view.date;if("day"===e.view.mode){e.monthViewOptions.firstDayOfWeek=m.getLocale(e.locale).firstDayOfWeek();for(var a=new Array(t),i=0;i<t;i++)a[i]=x(n,e.monthViewOptions),n=m.shiftDate(n,{month:1});return Object.assign({},e,{monthsModel:a})}if("month"===e.view.mode){for(var r=new Array(t),s=0;s<t;s++)r[s]=V(n,N(e)),n=m.shiftDate(n,{year:1});return Object.assign({},e,{monthsCalendar:r})}if("year"!==e.view.mode)return e;for(var o=new Array(t),s=0;s<t;s++)o[s]=L(n,N(e)),n=m.shiftDate(n,{year:P});return Object.assign({},e,{yearsCalendarModel:o})}(e);case g.FORMAT:return function d(n,e){if("day"===n.view.mode){var t=n.monthsModel.map(function(e,t){return O(e,N(n),t)});return Object.assign({},n,{formattedMonths:t})}var a=n.displayMonths,i=n.view.date;if("month"===n.view.mode){for(var r=new Array(a),s=0;s<a;s++)r[s]=V(i,N(n)),i=m.shiftDate(i,{year:1});return Object.assign({},n,{monthsCalendar:r})}if("year"!==n.view.mode)return n;for(var o=new Array(a),s=0;s<a;s++)o[s]=L(i,N(n)),i=m.shiftDate(i,{year:16});return Object.assign({},n,{yearsCalendarModel:o})}(e);case g.FLAG:return function s(a,e){if("day"===a.view.mode){var t=a.formattedMonths.map(function(e,t){return function n(f,y){return f.weeks.forEach(function(p){p.days.forEach(function(e,t){var n=!m.isSameMonth(e.date,f.month),a=!n&&m.isSameDay(e.date,y.hoveredDate),i=!n&&y.selectedRange&&m.isSameDay(e.date,y.selectedRange[0]),r=!n&&y.selectedRange&&m.isSameDay(e.date,y.selectedRange[1]),s=!n&&m.isSameDay(e.date,y.selectedDate)||i||r,o=!n&&y.selectedRange&&function u(e,t,n){return!(!e||!t[0])&&(t[1]?e>t[0]&&e<=t[1]:!!n&&(e>t[0]&&e<=n))}(e.date,y.selectedRange,y.hoveredDate),c=y.isDisabled||m.isBefore(e.date,y.minDate,"day")||m.isAfter(e.date,y.maxDate,"day")||m.isDisabledDay(e.date,y.daysDisabled),d=new Date,l=!n&&m.isSameDay(e.date,d),h=Object.assign({},e,{isOtherMonth:n,isHovered:a,isSelected:s,isSelectionStart:i,isSelectionEnd:r,isInRange:o,isDisabled:c,isToday:l});e.isOtherMonth===h.isOtherMonth&&e.isHovered===h.isHovered&&e.isSelected===h.isSelected&&e.isSelectionStart===h.isSelectionStart&&e.isSelectionEnd===h.isSelectionEnd&&e.isDisabled===h.isDisabled&&e.isInRange===h.isInRange||(p.days[t]=h)})}),f.hideLeftArrow=y.isDisabled||0<y.monthIndex&&y.monthIndex!==y.displayMonths,f.hideRightArrow=y.isDisabled||y.monthIndex<y.displayMonths&&y.monthIndex+1!==y.displayMonths,f.disableLeftArrow=_(m.shiftDate(f.month,{month:-1}),y.minDate,y.maxDate),f.disableRightArrow=_(m.shiftDate(f.month,{month:1}),y.minDate,y.maxDate),f}(e,{isDisabled:a.isDisabled,minDate:a.minDate,maxDate:a.maxDate,daysDisabled:a.daysDisabled,hoveredDate:a.hoveredDate,selectedDate:a.selectedDate,selectedRange:a.selectedRange,displayMonths:a.displayMonths,monthIndex:t})});return Object.assign({},a,{flaggedMonths:t})}if("month"===a.view.mode){var n=a.monthsCalendar.map(function(e,t){return function n(s,o){return s.months.forEach(function(e,r){e.forEach(function(e,t){var n=m.isSameMonth(e.date,o.hoveredMonth),a=o.isDisabled||_(e.date,o.minDate,o.maxDate),i=Object.assign(e,{isHovered:n,isDisabled:a});e.isHovered===i.isHovered&&e.isDisabled===i.isDisabled||(s.months[r][t]=i)})}),s.hideLeftArrow=0<o.monthIndex&&o.monthIndex!==o.displayMonths,s.hideRightArrow=o.monthIndex<o.displayMonths&&o.monthIndex+1!==o.displayMonths,s.disableLeftArrow=C(m.shiftDate(s.months[0][0].date,{year:-1}),o.minDate,o.maxDate),s.disableRightArrow=C(m.shiftDate(s.months[0][0].date,{year:1}),o.minDate,o.maxDate),s}(e,{isDisabled:a.isDisabled,minDate:a.minDate,maxDate:a.maxDate,hoveredMonth:a.hoveredMonth,displayMonths:a.displayMonths,monthIndex:t})});return Object.assign({},a,{flaggedMonthsCalendar:n})}if("year"!==a.view.mode)return a;var i=a.yearsCalendarModel.map(function(e,t){return function n(s,o){s.years.forEach(function(e,r){e.forEach(function(e,t){var n=m.isSameYear(e.date,o.hoveredYear),a=o.isDisabled||C(e.date,o.minDate,o.maxDate),i=Object.assign(e,{isHovered:n,isDisabled:a});e.isHovered===i.isHovered&&e.isDisabled===i.isDisabled||(s.years[r][t]=i)})}),s.hideLeftArrow=0<o.yearIndex&&o.yearIndex!==o.displayMonths,s.hideRightArrow=o.yearIndex<o.displayMonths&&o.yearIndex+1!==o.displayMonths,s.disableLeftArrow=C(m.shiftDate(s.years[0][0].date,{year:-1}),o.minDate,o.maxDate);var e=s.years.length-1,t=s.years[e].length-1;return s.disableRightArrow=C(m.shiftDate(s.years[e][t].date,{year:1}),o.minDate,o.maxDate),s}(e,{isDisabled:a.isDisabled,minDate:a.minDate,maxDate:a.maxDate,hoveredYear:a.hoveredYear,displayMonths:a.displayMonths,yearIndex:t})});return Object.assign({},a,{yearsCalendarFlagged:i})}(e);case g.NAVIGATE_OFFSET:var n=m.shiftDate(m.startOf(e.view.date,"month"),t.payload),a={view:{mode:e.view.mode,date:n}};return Object.assign({},e,a);case g.NAVIGATE_TO:var i=t.payload,r=(n=m.setFullDate(e.view.date,i.unit),a=void 0,void 0);return a=I(i.viewMode,e.minMode)?{view:{date:n,mode:r=i.viewMode}}:{selectedDate:n,view:{date:n,mode:r=e.view.mode}},Object.assign({},e,a);case g.CHANGE_VIEWMODE:if(!I(t.payload,e.minMode))return e;a={view:{date:n=e.view.date,mode:r=t.payload}};return Object.assign({},e,a);case g.HOVER:return Object.assign({},e,{hoveredDate:t.payload});case g.SELECT:a={selectedDate:t.payload,view:e.view},r=e.view.mode,n=Y(t.payload||e.view.date,e.minDate,e.maxDate);return a.view={mode:r,date:n},Object.assign({},e,a);case g.SET_OPTIONS:r=(a=t.payload).minMode?a.minMode:e.view.mode,n=Y(m.isDateValid(a.value)&&a.value||m.isArray(a.value)&&m.isDateValid(a.value[0])&&a.value[0]||e.view.date,a.minDate,a.maxDate);return a.view={mode:r,date:n},a.value&&(m.isArray(a.value)&&(a.selectedRange=a.value),a.value instanceof Date&&(a.selectedDate=a.value)),Object.assign({},e,a);case g.SELECT_RANGE:a={selectedRange:t.payload,view:e.view},r=e.view.mode,n=Y(t.payload&&t.payload[0]||e.view.date,e.minDate,e.maxDate);return a.view={mode:r,date:n},Object.assign({},e,a);case g.SET_MIN_DATE:return Object.assign({},e,{minDate:t.payload});case g.SET_MAX_DATE:return Object.assign({},e,{maxDate:t.payload});case g.SET_IS_DISABLED:return Object.assign({},e,{isDisabled:t.payload});default:return e}}function N(e){return{locale:e.locale,monthTitle:e.monthTitle,yearTitle:e.yearTitle,dayLabel:e.dayLabel,monthLabel:e.monthLabel,yearLabel:e.yearLabel,weekNumbers:e.weekNumbers}}function Y(e,t,n){var a=Array.isArray(e)?e[0]:e;return t&&m.isAfter(t,a,"day")?t:n&&m.isBefore(n,a,"day")?n:a}var z=function(n){function e(){var e=new a.BehaviorSubject({type:"[datepicker] dispatcher init"}),t=new i.MiniState(w,e,j);return n.call(this,e,j,t)||this}return u(e,n),e.decorators=[{type:s.Injectable}],e.ctorParameters=function(){return[]},e}(i.MiniStore),B=function(r){function e(e,t,n,a){var i=r.call(this)||this;return i._config=e,i._store=t,i._actions=n,i.valueChange=new s.EventEmitter,i._subs=[],i._effects=a,i}return u(e,r),Object.defineProperty(e.prototype,"value",{set:function(e){this._effects.setValue(e)},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){var t=this;this.isOtherMonthsActive=this._config.selectFromOtherMonth,this.containerClass=this._config.containerClass,this._effects.init(this._store).setOptions(this._config).setBindings(this).setEventHandlers(this).registerDatepickerSideEffects(),this._subs.push(this._store.select(function(e){return e.selectedDate}).subscribe(function(e){return t.valueChange.emit(e)}))},e.prototype.daySelectHandler=function(e){(this.isOtherMonthsActive?e.isDisabled:e.isOtherMonth||e.isDisabled)||this._store.dispatch(this._actions.select(e.date))},e.prototype.ngOnDestroy=function(){try{for(var e=p(this._subs),t=e.next();!t.done;t=e.next()){t.value.unsubscribe()}}catch(i){n={error:i}}finally{try{t&&!t.done&&(a=e["return"])&&a.call(e)}finally{if(n)throw n.error}}var n,a;this._effects.destroy()},e.decorators=[{type:s.Component,args:[{selector:"bs-datepicker-container",providers:[z,D],template:'\x3c!-- days calendar view mode --\x3e\n<div class="bs-datepicker" [ngClass]="containerClass" *ngIf="viewMode | async">\n <div class="bs-datepicker-container">\n\n \x3c!--calendars--\x3e\n <div class="bs-calendar-container" [ngSwitch]="viewMode | async" role="application">\n \x3c!--days calendar--\x3e\n <div *ngSwitchCase="\'day\'" class="bs-media-container">\n <bs-days-calendar-view\n *ngFor="let calendar of (daysCalendar | async)"\n [class.bs-datepicker-multiple]="(daysCalendar | async)?.length > 1"\n [calendar]="calendar"\n [options]="options | async"\n (onNavigate)="navigateTo($event)"\n (onViewMode)="setViewMode($event)"\n (onHover)="dayHoverHandler($event)"\n (onHoverWeek)="weekHoverHandler($event)"\n (onSelect)="daySelectHandler($event)"\n ></bs-days-calendar-view>\n </div>\n\n \x3c!--months calendar--\x3e\n <div *ngSwitchCase="\'month\'" class="bs-media-container">\n <bs-month-calendar-view\n *ngFor="let calendar of (monthsCalendar | async)"\n [class.bs-datepicker-multiple]="(daysCalendar | async)?.length > 1"\n [calendar]="calendar"\n (onNavigate)="navigateTo($event)"\n (onViewMode)="setViewMode($event)"\n (onHover)="monthHoverHandler($event)"\n (onSelect)="monthSelectHandler($event)"\n ></bs-month-calendar-view>\n </div>\n\n \x3c!--years calendar--\x3e\n <div *ngSwitchCase="\'year\'" class="bs-media-container">\n <bs-years-calendar-view\n *ngFor="let calendar of (yearsCalendar | async)"\n [class.bs-datepicker-multiple]="(daysCalendar | async )?.length > 1"\n [calendar]="calendar"\n (onNavigate)="navigateTo($event)"\n (onViewMode)="setViewMode($event)"\n (onHover)="yearHoverHandler($event)"\n (onSelect)="yearSelectHandler($event)"\n ></bs-years-calendar-view>\n </div>\n\n </div>\n\n \x3c!--applycancel buttons--\x3e\n <div class="bs-datepicker-buttons" *ngIf="false">\n <button class="btn btn-success">Apply</button>\n <button class="btn btn-default">Cancel</button>\n </div>\n\n </div>\n\n \x3c!--custom dates or date ranges picker--\x3e\n <div class="bs-datepicker-custom-range" *ngIf="false">\n <bs-custom-date-view [ranges]="_customRangesFish"></bs-custom-date-view>\n </div>\n</div>\n',host:{"(click)":"_stopPropagation($event)",style:"position: absolute; display: block;",role:"dialog","aria-label":"calendar"}}]}],e.ctorParameters=function(){return[{type:l},{type:z},{type:g},{type:D}]},e}(b),$=function(){function e(e,t,n,a,i){this._config=e,this.placement="bottom",this.triggers="click",this.outsideClick=!0,this.container="body",this.outsideEsc=!0,this.bsValueChange=new s.EventEmitter,this._subs=[],Object.assign(this,this._config),this._datepicker=i.createLoader(t,a,n),this.onShown=this._datepicker.onShown,this.onHidden=this._datepicker.onHidden}return Object.defineProperty(e.prototype,"isOpen",{get:function(){return this._datepicker.isShown},set:function(e){e?this.show():this.hide()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bsValue",{set:function(e){this._bsValue!==e&&(this._bsValue=e,this.bsValueChange.emit(e))},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){var e=this;this._datepicker.listen({outsideClick:this.outsideClick,outsideEsc:this.outsideEsc,triggers:this.triggers,show:function(){return e.show()}}),this.setConfig()},e.prototype.ngOnChanges=function(e){this._datepickerRef&&this._datepickerRef.instance&&(e.minDate&&(this._datepickerRef.instance.minDate=this.minDate),e.maxDate&&(this._datepickerRef.instance.maxDate=this.maxDate),e.daysDisabled&&(this._datepickerRef.instance.daysDisabled=this.daysDisabled),e.isDisabled&&(this._datepickerRef.instance.isDisabled=this.isDisabled))},e.prototype.show=function(){var t=this;this._datepicker.isShown||(this.setConfig(),this._datepickerRef=this._datepicker.provide({provide:l,useValue:this._config}).attach(B).to(this.container).position({attachment:this.placement}).show({placement:this.placement}),this._subs.push(this.bsValueChange.subscribe(function(e){t._datepickerRef.instance.value=e})),this._subs.push(this._datepickerRef.instance.valueChange.subscribe(function(e){t.bsValue=e,t.hide()})))},e.prototype.hide=function(){this.isOpen&&this._datepicker.hide();try{for(var e=p(this._subs),t=e.next();!t.done;t=e.next()){t.value.unsubscribe()}}catch(i){n={error:i}}finally{try{t&&!t.done&&(a=e["return"])&&a.call(e)}finally{if(n)throw n.error}}var n,a},e.prototype.toggle=function(){if(this.isOpen)return this.hide();this.show()},e.prototype.setConfig=function(){this._config=Object.assign({},this._config,this.bsConfig,{value:this._bsValue,isDisabled:this.isDisabled,minDate:this.minDate||this.bsConfig&&this.bsConfig.minDate,maxDate:this.maxDate||this.bsConfig&&this.bsConfig.maxDate,daysDisabled:this.daysDisabled||this.bsConfig&&this.bsConfig.daysDisabled,minMode:this.minMode||this.bsConfig&&this.bsConfig.minMode})},e.prototype.ngOnDestroy=function(){this._datepicker.dispose()},e.decorators=[{type:s.Directive,args:[{selector:"[bsDatepicker]",exportAs:"bsDatepicker"}]}],e.ctorParameters=function(){return[{type:l},{type:s.ElementRef},{type:s.Renderer2},{type:s.ViewContainerRef},{type:t.ComponentLoaderFactory}]},e.propDecorators={placement:[{type:s.Input}],triggers:[{type:s.Input}],outsideClick:[{type:s.Input}],container:[{type:s.Input}],outsideEsc:[{type:s.Input}],isOpen:[{type:s.Input}],onShown:[{type:s.Output}],onHidden:[{type:s.Output}],bsValue:[{type:s.Input}],bsConfig:[{type:s.Input}],isDisabled:[{type:s.Input}],minDate:[{type:s.Input}],maxDate:[{type:s.Input}],minMode:[{type:s.Input}],daysDisabled:[{type:s.Input}],bsValueChange:[{type:s.Output}]},e}(),W=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t.decorators=[{type:s.Injectable}],t}(l),G=function(i){function e(e,t,n,a){return i.call(this,e,t,n,a)||this}return u(e,i),e.decorators=[{type:s.Component,args:[{selector:"bs-datepicker-inline-container",providers:[z,D],template:'\x3c!-- days calendar view mode --\x3e\n<div class="bs-datepicker" [ngClass]="containerClass" *ngIf="viewMode | async">\n <div class="bs-datepicker-container">\n\n \x3c!--calendars--\x3e\n <div class="bs-calendar-container" [ngSwitch]="viewMode | async" role="application">\n \x3c!--days calendar--\x3e\n <div *ngSwitchCase="\'day\'" class="bs-media-container">\n <bs-days-calendar-view\n *ngFor="let calendar of (daysCalendar | async)"\n [class.bs-datepicker-multiple]="(daysCalendar | async)?.length > 1"\n [calendar]="calendar"\n [options]="options | async"\n (onNavigate)="navigateTo($event)"\n (onViewMode)="setViewMode($event)"\n (onHover)="dayHoverHandler($event)"\n (onHoverWeek)="weekHoverHandler($event)"\n (onSelect)="daySelectHandler($event)"\n ></bs-days-calendar-view>\n </div>\n\n \x3c!--months calendar--\x3e\n <div *ngSwitchCase="\'month\'" class="bs-media-container">\n <bs-month-calendar-view\n *ngFor="let calendar of (monthsCalendar | async)"\n [class.bs-datepicker-multiple]="(daysCalendar | async)?.length > 1"\n [calendar]="calendar"\n (onNavigate)="navigateTo($event)"\n (onViewMode)="setViewMode($event)"\n (onHover)="monthHoverHandler($event)"\n (onSelect)="monthSelectHandler($event)"\n ></bs-month-calendar-view>\n </div>\n\n \x3c!--years calendar--\x3e\n <div *ngSwitchCase="\'year\'" class="bs-media-container">\n <bs-years-calendar-view\n *ngFor="let calendar of (yearsCalendar | async)"\n [class.bs-datepicker-multiple]="(daysCalendar | async )?.length > 1"\n [calendar]="calendar"\n (onNavigate)="navigateTo($event)"\n (onViewMode)="setViewMode($event)"\n (onHover)="yearHoverHandler($event)"\n (onSelect)="yearSelectHandler($event)"\n ></bs-years-calendar-view>\n </div>\n\n </div>\n\n \x3c!--applycancel buttons--\x3e\n <div class="bs-datepicker-buttons" *ngIf="false">\n <button class="btn btn-success">Apply</button>\n <button class="btn btn-default">Cancel</button>\n </div>\n\n </div>\n\n \x3c!--custom dates or date ranges picker--\x3e\n <div class="bs-datepicker-custom-range" *ngIf="false">\n <bs-custom-date-view [ranges]="_customRangesFish"></bs-custom-date-view>\n </div>\n</div>\n',host:{"(click)":"_stopPropagation($event)",style:"display: inline-block;"}}]}],e.ctorParameters=function(){return[{type:l},{type:z},{type:g},{type:D}]},e}(B),q=function(){function e(e,t,n,a,i){this._config=e,this._elementRef=t,this.bsValueChange=new s.EventEmitter,this._subs=[],Object.assign(this,this._config),this._datepicker=i.createLoader(t,a,n)}return Object.defineProperty(e.prototype,"bsValue",{set:function(e){this._bsValue!==e&&(this._bsValue=e,this.bsValueChange.emit(e))},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){var t=this;this.setConfig(),this._datepickerRef=this._datepicker.provide({provide:l,useValue:this._config}).attach(G).to(this._elementRef).show(),this._subs.push(this.bsValueChange.subscribe(function(e){t._datepickerRef.instance.value=e})),this._subs.push(this._datepickerRef.instance.valueChange.subscribe(function(e){t.bsValue=e}))},e.prototype.ngOnChanges=function(e){this._datepickerRef&&this._datepickerRef.instance&&(e.minDate&&(this._datepickerRef.instance.minDate=this.minDate),e.maxDate&&(this._datepickerRef.instance.maxDate=this.maxDate),e.isDisabled&&(this._datepickerRef.instance.isDisabled=this.isDisabled))},e.prototype.setConfig=function(){this._config=Object.assign({},this._config,this.bsConfig,{value:this._bsValue,isDisabled:this.isDisabled,minDate:this.minDate||this.bsConfig&&this.bsConfig.minDate,maxDate:this.maxDate||this.bsConfig&&this.bsConfig.maxDate})},e.prototype.ngOnDestroy=function(){this._datepicker.dispose()},e.decorators=[{type:s.Directive,args:[{selector:"bs-datepicker-inline",exportAs:"bsDatepickerInline"}]}],e.ctorParameters=function(){return[{type:W},{type:s.ElementRef},{type:s.Renderer2},{type:s.ViewContainerRef},{type:t.ComponentLoaderFactory}]},e.propDecorators={bsValue:[{type:s.Input}],bsConfig:[{type:s.Input}],isDisabled:[{type:s.Input}],minDate:[{type:s.Input}],maxDate:[{type:s.Input}],bsValueChange:[{type:s.Output}]},e}(),U={provide:r.NG_VALUE_ACCESSOR,useExisting:s.forwardRef(function(){return Q}),multi:!0},Z={provide:r.NG_VALIDATORS,useExisting:s.forwardRef(function(){return Q}),multi:!0},Q=function(){function e(e,t,n,a,i){var r=this;this._picker=e,this._localeService=t,this._renderer=n,this._elRef=a,this.changeDetection=i,this._onChange=Function.prototype,this._onTouched=Function.prototype,this._validatorChange=Function.prototype,this._picker.bsValueChange.subscribe(function(e){r._setInputValue(e),r._value!==e&&(r._value=e,r._onChange(e),r._onTouched()),r.changeDetection.markForCheck()}),this._localeService.localeChange.subscribe(function(){r._setInputValue(r._value)})}return e.prototype._setInputValue=function(e){var t=e?m.formatDate(e,this._picker._config.dateInputFormat,this._localeService.currentLocale):"";this._renderer.setProperty(this._elRef.nativeElement,"value",t)},e.prototype.onChange=function(e){this.writeValue(e.target.value),this._onChange(this._value),this._onTouched()},e.prototype.validate=function(e){var t=e.value;if(null===t||t===undefined||""===t)return null;if(m.isDate(t)){if(!m.isDateValid(t))return{bsDate:{invalid:t}};if(this._picker&&this._picker.minDate&&m.isBefore(t,this._picker.minDate,"date"))return{bsDate:{minDate:this._picker.minDate}};if(this._picker&&this._picker.maxDate&&m.isAfter(t,this._picker.maxDate,"date"))return{bsDate:{maxDate:this._picker.maxDate}}}},e.prototype.registerOnValidatorChange=function(e){this._validatorChange=e},e.prototype.writeValue=function(e){if(e){var t=this._localeService.currentLocale;if(!m.getLocale(t))throw new Error('Locale "'+t+'" is not defined, please add it with "defineLocale(...)"');this._value=m.parseDate(e,this._picker._config.dateInputFormat,this._localeService.currentLocale)}else this._value=null;this._picker.bsValue=this._value},e.prototype.setDisabledState=function(e){(this._picker.isDisabled=e)?this._renderer.setAttribute(this._elRef.nativeElement,"disabled","disabled"):this._renderer.removeAttribute(this._elRef.nativeElement,"disabled")},e.prototype.registerOnChange=function(e){this._onChange=e},e.prototype.registerOnTouched=function(e){this._onTouched=e},e.prototype.onBlur=function(){this._onTouched()},e.prototype.hide=function(){this._picker.hide(),this._renderer.selectRootElement(this._elRef.nativeElement).blur()},e.decorators=[{type:s.Directive,args:[{selector:"input[bsDatepicker]",host:{"(change)":"onChange($event)","(keyup.esc)":"hide()","(blur)":"onBlur()"},providers:[U,Z]}]}],e.ctorParameters=function(){return[{type:$,decorators:[{type:s.Host}]},{type:v},{type:s.Renderer2},{type:s.ElementRef},{type:s.ChangeDetectorRef}]},e}(),K=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.displayMonths=2,e}return u(e,t),e.decorators=[{type:s.Injectable}],e}(l),X=function(r){function e(e,t,n,a){var i=r.call(this)||this;return i._config=e,i._store=t,i._actions=n,i.valueChange=new s.EventEmitter,i._rangeStack=[],i._subs=[],i._effects=a,i}return u(e,r),Object.defineProperty(e.prototype,"value",{set:function(e){this._effects.setRangeValue(e)},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){var t=this;this.containerClass=this._config.containerClass,this.isOtherMonthsActive=this._config.selectFromOtherMonth,this._effects.init(this._store).setOptions(this._config).setBindings(this).setEventHandlers(this).registerDatepickerSideEffects(),this._subs.push(this._store.select(function(e){return e.selectedRange}).subscribe(function(e){return t.valueChange.emit(e)}))},e.prototype.daySelectHandler=function(e){(this.isOtherMonthsActive?e.isDisabled:e.isOtherMonth||e.isDisabled)||(1===this._rangeStack.length&&(this._rangeStack=e.date>=this._rangeStack[0]?[this._rangeStack[0],e.date]:[e.date]),0===this._rangeStack.length&&(this._rangeStack=[e.date]),this._store.dispatch(this._actions.selectRange(this._rangeStack)),2===this._rangeStack.length&&(this._rangeStack=[]))},e.prototype.ngOnDestroy=function(){try{for(var e=p(this._subs),t=e.next();!t.done;t=e.next()){t.value.unsubscribe()}}catch(i){n={error:i}}finally{try{t&&!t.done&&(a=e["return"])&&a.call(e)}finally{if(n)throw n.error}}var n,a;this._effects.destroy()},e.decorators=[{type:s.Component,args:[{selector:"bs-daterangepicker-container",providers:[z,D],template:'\x3c!-- days calendar view mode --\x3e\n<div class="bs-datepicker" [ngClass]="containerClass" *ngIf="viewMode | async">\n <div class="bs-datepicker-container">\n\n \x3c!--calendars--\x3e\n <div class="bs-calendar-container" [ngSwitch]="viewMode | async" role="application">\n \x3c!--days calendar--\x3e\n <div *ngSwitchCase="\'day\'" class="bs-media-container">\n <bs-days-calendar-view\n *ngFor="let calendar of (daysCalendar | async)"\n [class.bs-datepicker-multiple]="(daysCalendar | async)?.length > 1"\n [calendar]="calendar"\n [options]="options | async"\n (onNavigate)="navigateTo($event)"\n (onViewMode)="setViewMode($event)"\n (onHover)="dayHoverHandler($event)"\n (onHoverWeek)="weekHoverHandler($event)"\n (onSelect)="daySelectHandler($event)"\n ></bs-days-calendar-view>\n </div>\n\n \x3c!--months calendar--\x3e\n <div *ngSwitchCase="\'month\'" class="bs-media-container">\n <bs-month-calendar-view\n *ngFor="let calendar of (monthsCalendar | async)"\n [class.bs-datepicker-multiple]="(daysCalendar | async)?.length > 1"\n [calendar]="calendar"\n (onNavigate)="navigateTo($event)"\n (onViewMode)="setViewMode($event)"\n (onHover)="monthHoverHandler($event)"\n (onSelect)="monthSelectHandler($event)"\n ></bs-month-calendar-view>\n </div>\n\n \x3c!--years calendar--\x3e\n <div *ngSwitchCase="\'year\'" class="bs-media-container">\n <bs-years-calendar-view\n *ngFor="let calendar of (yearsCalendar | async)"\n [class.bs-datepicker-multiple]="(daysCalendar | async )?.length > 1"\n [calendar]="calendar"\n (onNavigate)="navigateTo($event)"\n (onViewMode)="setViewMode($event)"\n (onHover)="yearHoverHandler($event)"\n (onSelect)="yearSelectHandler($event)"\n ></bs-years-calendar-view>\n </div>\n\n </div>\n\n \x3c!--applycancel buttons--\x3e\n <div class="bs-datepicker-buttons" *ngIf="false">\n <button class="btn btn-success">Apply</button>\n <button class="btn btn-default">Cancel</button>\n </div>\n\n </div>\n\n \x3c!--custom dates or date ranges picker--\x3e\n <div class="bs-datepicker-custom-range" *ngIf="false">\n <bs-custom-date-view [ranges]="_customRangesFish"></bs-custom-date-view>\n </div>\n</div>\n',host:{"(click)":"_stopPropagation($event)",style:"position: absolute; display: block;",role:"dialog","aria-label":"calendar"}}]}],e.ctorParameters=function(){return[{type:l},{type:z},{type:g},{type:D}]},e}(b),J=function(){function e(e,t,n,a,i){this._config=e,this.placement="bottom",this.triggers="click",this.outsideClick=!0,this.container="body",this.outsideEsc=!0,this.bsValueChange=new s.EventEmitter,this._subs=[],this._datepicker=i.createLoader(t,a,n),Object.assign(this,e),this.onShown=this._datepicker.onShown,this.onHidden=this._datepicker.onHidden}return Object.defineProperty(e.prototype,"isOpen",{get:function(){return this._datepicker.isShown},set:function(e){e?this.show():this.hide()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bsValue",{set:function(e){this._bsValue!==e&&(this._bsValue=e,this.bsValueChange.emit(e))},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){var e=this;this._datepicker.listen({outsideClick:this.outsideClick,outsideEsc:this.outsideEsc,triggers:this.triggers,show:function(){return e.show()}}),this.setConfig()},e.prototype.ngOnChanges=function(e){this._datepickerRef&&this._datepickerRef.instance&&(e.minDate&&(this._datepickerRef.instance.minDate=this.minDate),e.maxDate&&(this._datepickerRef.instance.maxDate=this.maxDate),e.isDisabled&&(this._datepickerRef.instance.isDisabled=this.isDisabled))},e.prototype.show=function(){var t=this;this._datepicker.isShown||(this.setConfig(),this._datepickerRef=this._datepicker.provide({provide:l,useValue:this._config}).attach(X).to(this.container).position({attachment:this.placement}).show({placement:this.placement}),this._subs.push(this.bsValueChange.subscribe(function(e){t._datepickerRef.instance.value=e})),this._subs.push(this._datepickerRef.instance.valueChange.pipe(n.filter(function(e){return e&&e[0]&&!!e[1]})).subscribe(function(e){t.bsValue=e,t.hide()})))},e.prototype.setConfig=function(){this._config=Object.assign({},this._config,this.bsConfig,{value:this._bsValue,isDisabled:this.isDisabled,minDate:this.minDate||this.bsConfig&&this.bsConfig.minDate,maxDate:this.maxDate||this.bsConfig&&this.bsConfig.maxDate})},e.prototype.hide=function(){this.isOpen&&this._datepicker.hide();try{for(var e=p(this._subs),t=e.next();!t.done;t=e.next()){t.value.unsubscribe()}}catch(i){n={error:i}}finally{try{t&&!t.done&&(a=e["return"])&&a.call(e)}finally{if(n)throw n.error}}var n,a},e.prototype.toggle=function(){if(this.isOpen)return this.hide();this.show()},e.prototype.ngOnDestroy=function(){this._datepicker.dispose()},e.decorators=[{type:s.Directive,args:[{selector:"[bsDaterangepicker]",exportAs:"bsDaterangepicker"}]}],e.ctorParameters=function(){return[{type:K},{type:s.ElementRef},{type:s.Renderer2},{type:s.ViewContainerRef},{type:t.ComponentLoaderFactory}]},e.propDecorators={placement:[{type:s.Input}],triggers:[{type:s.Input}],outsideClick:[{type:s.Input}],container:[{type:s.Input}],outsideEsc:[{type:s.Input}],isOpen:[{type:s.Input}],onShown:[{type:s.Output}],onHidden:[{type:s.Output}],bsValue:[{type:s.Input}],bsConfig:[{type:s.Input}],isDisabled:[{type:s.Input}],minDate:[{type:s.Input}],maxDate:[{type:s.Input}],bsValueChange:[{type:s.Output}]},e}(),ee={provide:r.NG_VALUE_ACCESSOR,useExisting:s.forwardRef(function(){return ne}),multi:!0},te={provide:r.NG_VALIDATORS,useExisting:s.forwardRef(function(){return ne}),multi:!0},ne=function(){function e(e,t,n,a,i){var r=this;this._picker=e,this._localeService=t,this._renderer=n,this._elRef=a,this.changeDetection=i,this._onChange=Function.prototype,this._onTouched=Function.prototype,this._validatorChange=Function.prototype,this._picker.bsValueChange.subscribe(function(e){r._setInputValue(e),r._value!==e&&(r._value=e,r._onChange(e),r._onTouched()),r.changeDetection.markForCheck()}),this._localeService.localeChange.subscribe(function(){r._setInputValue(r._value)})}return e.prototype._setInputValue=function(e){var t="";if(e){var n=e[0]?m.formatDate(e[0],this._picker._config.rangeInputFormat,this._localeService.currentLocale):"",a=e[1]?m.formatDate(e[1],this._picker._config.rangeInputFormat,this._localeService.currentLocale):"";t=n&&a?n+this._picker._config.rangeSeparator+a:""}this._renderer.setProperty(this._elRef.nativeElement,"value",t)},e.prototype.onChange=function(e){this.writeValue(e.target.value),this._onChange(this._value),this._onTouched()},e.prototype.validate=function(e){var t=e.value;if(null===t||t===undefined||!m.isArray(t))return null;var n=m.isDateValid(t[0]),a=m.isDateValid(t[1]);return n?a?this._picker&&this._picker.minDate&&m.isBefore(t[0],this._picker.minDate,"date")?{bsDate:{minDate:this._picker.minDate}}:this._picker&&this._picker.maxDate&&m.isAfter(t[1],this._picker.maxDate,"date")?{bsDate:{maxDate:this._picker.maxDate}}:void 0:{bsDate:{invalid:t[1]}}:{bsDate:{invalid:t[0]}}},e.prototype.registerOnValidatorChange=function(e){this._validatorChange=e},e.prototype.writeValue=function(e){var t=this;if(e){var n=this._localeService.currentLocale;if(!m.getLocale(n))throw new Error('Locale "'+n+'" is not defined, please add it with "defineLocale(...)"');var a=[];"string"==typeof e&&(a=e.split(this._picker._config.rangeSeparator)),Array.isArray(e)&&(a=e),this._value=a.map(function(e){return m.parseDate(e,t._picker._config.dateInputFormat,t._localeService.currentLocale)}).map(function(e){return isNaN(e.valueOf())?null:e})}else this._value=null;this._picker.bsValue=this._value},e.prototype.setDisabledState=function(e){(this._picker.isDisabled=e)?this._renderer.setAttribute(this._elRef.nativeElement,"disabled","disabled"):this._renderer.removeAttribute(this._elRef.nativeElement,"disabled")},e.prototype.registerOnChange=function(e){this._onChange=e},e.prototype.registerOnTouched=function(e){this._onTouched=e},e.prototype.onBlur=function(){this._onTouched()},e.prototype.hide=function(){this._picker.hide(),this._renderer.selectRootElement(this._elRef.nativeElement).blur()},e.decorators=[{type:s.Directive,args:[{selector:"input[bsDaterangepicker]",host:{"(change)":"onChange($event)","(keyup.esc)":"hide()","(blur)":"onBlur()"},providers:[ee,te]}]}],e.ctorParameters=function(){return[{type:J,decorators:[{type:s.Host}]},{type:v},{type:s.Renderer2},{type:s.ElementRef},{type:s.ChangeDetectorRef}]},e}(),ae=function(){function e(){}return e.decorators=[{type:s.Component,args:[{selector:"bs-calendar-layout",template:'\n \x3c!-- current date, will be added in nearest releases --\x3e\n <bs-current-date title="hey there" *ngIf="false"></bs-current-date>\n\n \x3c!--navigation--\x3e\n <div class="bs-datepicker-head">\n <ng-content select="bs-datepicker-navigation-view"></ng-content>\n </div>\n\n <div class="bs-datepicker-body">\n <ng-content></ng-content>\n </div>\n\n \x3c!--timepicker--\x3e\n <bs-timepicker *ngIf="false"></bs-timepicker>\n '}]}],e}(),ie=function(){function e(){}return e.decorators=[{type:s.Component,args:[{selector:"bs-current-date",template:'<div class="current-timedate"><span>{{ title }}</span></div>'}]}],e.propDecorators={title:[{type:s.Input}]},e}(),re=function(){function e(){}return e.decorators=[{type:s.Component,args:[{selector:"bs-custom-date-view",template:'\n <div class="bs-datepicker-predefined-btns">\n <button *ngFor="let range of ranges">{{ range.label }}</button>\n <button *ngIf="isCustomRangeShown">Custom Range</button>\n </div>\n ',changeDetection:s.ChangeDetectionStrategy.OnPush}]}],e.propDecorators={isCustomRangeShown:[{type:s.Input}],ranges:[{type:s.Input}]},e}(),se=function(){function e(e,t,n){this._config=e,this._elRef=t,this._renderer=n}return e.prototype.ngOnInit=function(){this.day.isToday&&this._config&&this._config.customTodayClass&&this._renderer.addClass(this._elRef.nativeElement,this._config.customTodayClass)},e.decorators=[{type:s.Component,args:[{selector:"[bsDatepickerDayDecorator]",changeDetection:s.ChangeDetectionStrategy.OnPush,host:{"[class.disabled]":"day.isDisabled","[class.is-highlighted]":"day.isHovered","[class.is-other-month]":"day.isOtherMonth","[class.is-active-other-month]":"day.isOtherMonthHovered","[class.in-range]":"day.isInRange","[class.select-start]":"day.isSelectionStart","[class.select-end]":"day.isSelectionEnd","[class.selected]":"day.isSelected"},template:"{{ day.label }}"}]}],e.ctorParameters=function(){return[{type:l},{type:s.ElementRef},{type:s.Renderer2}]},e.propDecorators={day:[{type:s.Input}]},e}(),oe={UP:0,DOWN:1};oe[oe.UP]="UP",oe[oe.DOWN]="DOWN";var ce=function(){function e(){this.onNavigate=new s.EventEmitter,this.onViewMode=new s.EventEmitter}return e.prototype.navTo=function(e){this.onNavigate.emit(e?oe.DOWN:oe.UP)},e.prototype.view=function(e){this.onViewMode.emit(e)},e.decorators=[{type:s.Component,args:[{selector:"bs-datepicker-navigation-view",changeDetection:s.ChangeDetectionStrategy.OnPush,template:'\n <button class="previous"\n [disabled]="calendar.disableLeftArrow"\n [style.visibility]="calendar.hideLeftArrow ? \'hidden\' : \'visible\'"\n (click)="navTo(true)"><span>‹</span>\n </button>\n\n ​ \x3c!-- zero-width space needed for correct alignement\n with preserveWhitespaces: false in Angular --\x3e\n\n <button class="current"\n *ngIf="calendar.monthTitle"\n (click)="view(\'month\')"\n ><span>{{ calendar.monthTitle }}</span>\n </button>\n\n ​ \x3c!-- zero-width space needed for correct alignement\n with preserveWhitespaces: false in Angular --\x3e\n\n <button class="current" (click)="view(\'year\')"\n ><span>{{ calendar.yearTitle }}</span></button>\n\n ​ \x3c!-- zero-width space needed for correct alignement\n with preserveWhitespaces: false in Angular --\x3e\n\n <button class="next"\n [disabled]="calendar.disableRightArrow"\n [style.visibility]="calendar.hideRightArrow ? \'hidden\' : \'visible\'"\n (click)="navTo(false)"><span>›</span>\n </button>\n '}]}],e.propDecorators={calendar:[{type:s.Input}],onNavigate:[{type:s.Output}],onViewMode:[{type:s.Output}]},e}(),de=function(){function e(e){this._config=e,this.onNavigate=new s.EventEmitter,this.onViewMode=new s.EventEmitter,this.onSelect=new s.EventEmitter,this.onHover=new s.EventEmitter,this.onHoverWeek=new s.EventEmitter}return e.prototype.navigateTo=function(e){var t=oe.DOWN===e?-1:1;this.onNavigate.emit({step:{month:t}})},e.prototype.changeViewMode=function(e){this.onViewMode.emit(e)},e.prototype.selectDay=function(e){this.onSelect.emit(e)},e.prototype.selectWeek=function(e){var t=this;if(this._config.selectWeek)if(e.days&&e.days[0]&&!e.days[0].isDisabled&&this._config.selectFromOtherMonth)this.onSelect.emit(e.days[0]);else if(0!==e.days.length){var n=e.days.find(function(e){return t._config.selectFromOtherMonth?!e.isDisabled:!e.isOtherMonth&&!e.isDisabled});this.onSelect.emit(n)}},e.prototype.weekHoverHandler=function(e,t){var n=this;this._config.selectWeek&&(e.days.find(function(e){return n._config.selectFromOtherMonth?!e.isDisabled:!e.isOtherMonth&&!e.isDisabled})&&(e.isHovered=t,this.isWeekHovered=t,this.onHoverWeek.emit(e)))},e.prototype.hoverDay=function(e,t){this._config.selectFromOtherMonth&&e.isOtherMonth&&(e.isOtherMonthHovered=t),this.onHover.emit({cell:e,isHovered:t})},e.decorators=[{type:s.Component,args:[{selector:"bs-days-calendar-view",template:'\n <bs-calendar-layout>\n <bs-datepicker-navigation-view\n [calendar]="calendar"\n (onNavigate)="navigateTo($event)"\n (onViewMode)="changeViewMode($event)"\n ></bs-datepicker-navigation-view>\n\n \x3c!--days matrix--\x3e\n <table role="grid" class="days weeks">\n <thead>\n <tr>\n \x3c!--if show weeks--\x3e\n <th *ngIf="options.showWeekNumbers"></th>\n <th *ngFor="let weekday of calendar.weekdays; let i = index"\n aria-label="weekday">{{ calendar.weekdays[i] }}\n </th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor="let week of calendar.weeks; let i = index">\n <td class="week" [class.active-week]="isWeekHovered" *ngIf="options.showWeekNumbers">\n <span\n (click)="selectWeek(week)"\n (mouseenter)="weekHoverHandler(week, true)"\n (mouseleave)="weekHoverHandler(week, false)">{{ calendar.weekNumbers[i] }}</span>\n </td>\n <td *ngFor="let day of week.days" role="gridcell">\n <span bsDatepickerDayDecorator\n [day]="day"\n (click)="selectDay(day)"\n (mouseenter)="hoverDay(day, true)"\n (mouseleave)="hoverDay(day, false)">{{ day.label }}</span>\n </td>\n </tr>\n </tbody>\n </table>\n\n </bs-calendar-layout>\n '}]}],e.ctorParameters=function(){return[{type:l}]},e.propDecorators=