diff --git a/README.md b/README.md index 8816974..966dd04 100644 --- a/README.md +++ b/README.md @@ -92,12 +92,9 @@ I have already implemented the datepicker using the renderer class to support An Because the datepicker returns a moment date, not a string. - ## Release Notes - - 3.1.1 -- Fix ViewChild syntax in dualpicker. - - 3.1.0 -- Fix bug when today was not in the validation range, the user could not select a date. Also update some styling for the carat below. - - 3.0.3 -- Fix bug with changeDate being called more than once - - 3.0.0-3.0.2 -- Don't ask + - 3.0.0 - 3.2.0 -- Merge fix for changeDate being called more than once. Merge fix for the date getter using the minDate if no date value is supplied. + - 2.5.3 -- Update ViewChild syntax. Also fix extra padding, which moved the picker off the input box. - 2.5.0 -- Ability to specify a minDate without a maxDate for validation - 2.4.0 -- Add ability to specify calendar default mode (globalMode), e.g. month/year. - 2.2.3 -- Remove sourcemap from dist build. diff --git a/dist/ctng.umd.js b/dist/ctng.umd.js index 77125fe..44f21fa 100644 --- a/dist/ctng.umd.js +++ b/dist/ctng.umd.js @@ -1,3 +1,2 @@ - -!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@angular/core"),require("@angular/common"),require("@angular/forms"),require("moment"),require("jquery"));else if("function"==typeof define&&define.amd)define(["@angular/core","@angular/common","@angular/forms","moment","jquery"],t);else{var a="object"==typeof exports?t(require("@angular/core"),require("@angular/common"),require("@angular/forms"),require("moment"),require("jquery")):t(e["@angular/core"],e["@angular/common"],e["@angular/forms"],e.moment,e.jquery);for(var n in a)("object"==typeof exports?exports:e)[n]=a[n]}}(this,function(e,t,a,n,o){return function(e){function __webpack_require__(a){if(t[a])return t[a].exports;var n=t[a]={exports:{},id:a,loaded:!1};return e[a].call(n.exports,n,n.exports,__webpack_require__),n.loaded=!0,n.exports}var t={};return __webpack_require__.m=e,__webpack_require__.c=t,__webpack_require__.p="/",__webpack_require__(0)}(function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))switch(typeof e[t]){case"function":break;case"object":e[t]=function(t){var a=t.slice(1),n=e[t[0]];return function(e,t,o){n.apply(this,[e,t,o].concat(a))}}(e[t]);break;default:e[t]=e[e[t]]}return e}([function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=a(1);t.DatePickerModule=n.DatePickerModule},function(e,t,a){"use strict";var n=this&&this.__decorate||function(e,t,a,n){var o,i=arguments.length,r=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,a):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,n);else for(var d=e.length-1;d>=0;d--)(o=e[d])&&(r=(i<3?o(r):i>3?o(t,a,r):o(t,a))||r);return i>3&&r&&Object.defineProperty(t,a,r),r};Object.defineProperty(t,"__esModule",{value:!0});var o=a(2),i=a(3),r=a(4),d=a(5),l=a(18),c=a(7),s=a(9),p=function(){function DatePickerModule(){}return DatePickerModule}();p=n([o.NgModule({exports:[d.DatePickerComponent,l.DualPickerComponent],declarations:[d.DatePickerComponent,l.DualPickerComponent,c.CalendarComponent,s.CalendarGridComponent],imports:[i.CommonModule,r.FormsModule]})],p),t.DatePickerModule=p},function(t,a){t.exports=e},function(e,a){e.exports=t},function(e,t){e.exports=a},function(e,t,a){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var a in t)t.hasOwnProperty(a)&&(e[a]=t[a])};return function(t,a){function __(){this.constructor=t}e(t,a),t.prototype=null===a?Object.create(a):(__.prototype=a.prototype,new __)}}(),o=this&&this.__decorate||function(e,t,a,n){var o,i=arguments.length,r=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,a):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,n);else for(var d=e.length-1;d>=0;d--)(o=e[d])&&(r=(i<3?o(r):i>3?o(t,a,r):o(t,a))||r);return i>3&&r&&Object.defineProperty(t,a,r),r},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0});var r,d=a(2),l=a(6),c=a(7),s=a(8),p=a(10),h=a(4),u=a(14);!function(e){e[e.Visible=0]="Visible",e[e.Hidden=1]="Hidden"}(r=t.DatePickerMode||(t.DatePickerMode={}));var m=f=function(e){function DatePickerComponent(t,a){var n=e.call(this)||this;return n.myElement=t,n.renderer=a,n.CalendarMode=s.CalendarMode,n.DatePickerMode=r,n._globalMode=s.CalendarMode.Calendar,n.dateChange=new d.EventEmitter,n.mode=r.Hidden,n.dateClickListener=function(e){var t=l(e);return function(){n.setDate(t)}},n.monthChangeListener=function(){n.changeMode(s.CalendarMode.Calendar)},n.yearChangeListener=function(){n.changeMode(s.CalendarMode.Calendar)},n}return n(DatePickerComponent,e),Object.defineProperty(DatePickerComponent.prototype,"globalMode",{set:function(e){if(s.CalendarMode.hasOwnProperty(e))switch(s.CalendarMode[""+e]){case s.CalendarMode.Calendar:case s.CalendarMode.Year:this._globalMode=s.CalendarMode[""+e]}},enumerable:!0,configurable:!0}),Object.defineProperty(DatePickerComponent.prototype,"date",{get:function(){return this.dateValue},set:function(e){e instanceof l&&e.isValid()?(this.input.nativeElement.value=e.format("MM/DD/YYYY"),e=l(e.format("YYYY-MM-DD")+"T12:00:00.0Z"),this.dateValue=e,this.dateChange.emit(e)):(this.dateValue=void 0,this.input.nativeElement.value=""),this.propagateChange(e)},enumerable:!0,configurable:!0}),Object.defineProperty(DatePickerComponent.prototype,"match",{get:function(){return this.validDateExpression||/^((0?[13578]|10|12)(-|\/)(([1-9])|(0[1-9])|([12])([0-9]?)|(3[01]?))(-|\/)((19)([2-9])(\d{1})|(20)([01])(\d{1})|([8901])(\d{1}))|(0?[2469]|11)(-|\/)(([1-9])|(0[1-9])|([12])([0-9]?)|(3[0]?))(-|\/)((19)([2-9])(\d{1})|(20)([01])(\d{1})|([8901])(\d{1})))$/},set:function(e){this.validDateExpression=new RegExp(e)},enumerable:!0,configurable:!0}),DatePickerComponent.prototype.onDateStringChange=function(e){if(this.match.test(e)){var t=l(new Date(e));void 0===this.dateValue||null===this.dateValue?this.dateValue=t:this.dateValue.set(t.toObject()),this.dateChange.emit(this.dateValue),t.isValid()?this.cal.date=this.dateValue:this.cal.date=l()}else this.propagateChange(e);this.touched()},DatePickerComponent.prototype.changeGlobalMode=function(e){switch(this.mode=e,this.mode){case r.Visible:this.changeMode(this._globalMode),p(this.myElement.nativeElement).addClass("ct-dp-active"),this.positionCalendar();break;case r.Hidden:this.hideCalendar(),p(this.myElement.nativeElement).removeClass("ct-dp-active")}},DatePickerComponent.prototype.positionCalendar=function(){var e=p(this.myElement.nativeElement).find(".ct-dp-picker-wrapper");e.removeClass("hidden");var t=p(this.input.nativeElement).offset().top+p(this.input.nativeElement).outerHeight(),a=p(window).scrollTop();p(window).height()=0;d--)(o=e[d])&&(r=(i<3?o(r):i>3?o(t,a,r):o(t,a))||r);return i>3&&r&&Object.defineProperty(t,a,r),r},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0});var i=a(2),r=a(6),d=a(8),l=a(9),c=s=function(){function CalendarComponent(){this.CalendarMode=d.CalendarMode,this.months=[],this.years=[],this.monthListeners=[],this.yearListeners=[],this.generateMonthData()}return Object.defineProperty(CalendarComponent.prototype,"yearData",{get:function(){return this.years},enumerable:!0,configurable:!0}),CalendarComponent.prototype.ngOnInit=function(){},CalendarComponent.prototype.ngOnDestroy=function(){},CalendarComponent.prototype.subscribeToChangeMonth=function(e){this.monthListeners.push(e)},CalendarComponent.prototype.subscribeToChangeYear=function(e){this.yearListeners.push(e)},CalendarComponent.prototype.changeMode=function(e){switch(this.mode=e,e){case d.CalendarMode.Year:this.generateYearData(this.date.year())}},CalendarComponent.prototype.generateMonthData=function(){var e=r(new Date);e.month(0);var t=r(new Date);for(t.month(0);e.year()===t.year();)this.months.push(t.format("MMM")),t.month(t.month()+1)},CalendarComponent.prototype.generateYearData=function(e){this.years=[];for(var t=e-s.halfNumYearsShown,a=0;a=0;d--)(o=e[d])&&(r=(i<3?o(r):i>3?o(t,a,r):o(t,a))||r);return i>3&&r&&Object.defineProperty(t,a,r),r},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0});var i=a(2),r=a(6),d=a(10),l=function(){function CalendarGridComponent(e,t){this.myElement=e,this.renderer=t,this.today=r()}return CalendarGridComponent.prototype.ngOnInit=function(){},CalendarGridComponent.prototype.ngOnDestroy=function(){},CalendarGridComponent.prototype.renderCalendar=function(e,t,a,n,o,i){var l=r(e);l.date(1);for(var c=d("
"),s=0;s<7;s++){l.day(s);var p=d("
");p.text(l.format("dd")),p.attr("ct-cal-dp-day",s.toString()),p.addClass("ct-dp-cal-day"),c.append(p)}l.date(1);for(var h=d("
"),s=0;s");p.attr("ct-dp-cal-day",s.toString()),p.addClass("ct-dp-cal-day"),h.append(p)}for(;l.month()===e.month();){var p=d("");p.text(l.date().toString()),p.attr("ct-dp-cal-day",l.date().toString()),p.attr("tabIndex","-1"),p.addClass("ct-dp-cal-day"),this.today.date()===l.date()&&this.today.month()===l.month()&&p.addClass("today"),(a&&l.isSame(a,"day")||n&&l.isSame(n,"day"))&&p.addClass("active"),n&&a&&l.isBetween(n,a)&&p.addClass("between"),o&&l.isBefore(o)&&p.attr("disabled","disabled"),i&&l.isAfter(i)&&p.attr("disabled","disabled"),p.click(t(l)),l.date(l.date()+1),h.append(p)}d(this.myElement.nativeElement).empty(),c.appendTo(this.myElement.nativeElement),h.appendTo(this.myElement.nativeElement)},CalendarGridComponent.prototype.renderCalendarRenderer=function(e,t,a,n){var o=r(e.date);o.date(1),this.renderer.selectRootElement(this.myElement.nativeElement);var i=this.renderer.createElement(this.myElement.nativeElement,"div");this.renderer.setElementClass(i,".ct-dp-cal-header",!0);var d=this.renderer.createElement(this.myElement.nativeElement,"div");this.renderer.setElementClass(i,".ct-dp-cal-body",!0);for(var l=0;l<7;l++){o.day(l);var c=this.renderer.createElement(i,"div");this.renderer.setText(c,o.format("dd")),this.renderer.setElementAttribute(c,"ct-cal-dp-day",l.toString()),this.renderer.setElementClass(c,"ct-dp-cal-day",!0)}o.date(1);for(var l=0;l\n \n\n
\n \n
\n
\n \n
'},function(e,t){e.exports=""},function(e,t,a){"use strict";var n=this&&this.__decorate||function(e,t,a,n){var o,i=arguments.length,r=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,a):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,n);else for(var d=e.length-1;d>=0;d--)(o=e[d])&&(r=(i<3?o(r):i>3?o(t,a,r):o(t,a))||r);return i>3&&r&&Object.defineProperty(t,a,r),r},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0});var i=a(2),r=a(6),d=a(8),l=function(){function DatePickerBase(){this.CalendarMode=d.CalendarMode,this.propagateChange=function(){},this.propagateTouched=function(){},this.validateFn=function(){},this.shadowZIndex=100,this.zIndexVal=101,this.minDateVal=null,this.maxDateVal=null}return Object.defineProperty(DatePickerBase.prototype,"zIndex",{set:function(e){this.shadowZIndex=e,this.zIndexVal=e+1},enumerable:!0,configurable:!0}),Object.defineProperty(DatePickerBase.prototype,"minDate",{get:function(){return this.minDateVal},set:function(e){var t=r(e);t.isValid()?this.minDateVal=r(e):this.minDateVal=null},enumerable:!0,configurable:!0}),Object.defineProperty(DatePickerBase.prototype,"maxDate",{get:function(){return this.maxDateVal},set:function(e){var t=r(e);t.isValid()?this.maxDateVal=r(e):this.maxDateVal=null},enumerable:!0,configurable:!0}),DatePickerBase.prototype.registerOnChange=function(e){this.propagateChange=e},DatePickerBase.prototype.registerOnTouched=function(e){this.propagateTouched=e},DatePickerBase}();n([i.Input("zIndex"),o("design:type",Number),o("design:paramtypes",[Number])],l.prototype,"zIndex",null),n([i.Input("minDate"),o("design:type",Object),o("design:paramtypes",[Object])],l.prototype,"minDate",null),n([i.Input("maxDate"),o("design:type",Object),o("design:paramtypes",[Object])],l.prototype,"maxDate",null),t.DatePickerBase=l},function(e,t){e.exports='\n
\n
\n'},13,function(e,t){e.exports='.ct-dp-active{position:relative}.ct-dp-active input{position:relative}.ct-dp-shadow-box{position:fixed;top:0;right:0;bottom:0;left:0;background-color:transparent}.ct-dp-picker-wrapper{position:absolute}.display-below .ct-dp-picker-wrapper{padding-top:5px}.display-above .ct-dp-picker-wrapper{padding-bottom:5px}.ct-dp-picker{width:220px;border:1px solid #808080;box-sizing:content-box;position:relative;background-color:white;transition:margin-left .5s}.ct-dp-picker.ct-dp-dualpicker{width:440px}.ct-dp-picker.ct-dp-picker-to{margin-left:15px}.display-below .ct-dp-picker{margin-top:14px}.display-above .ct-dp-picker{margin-bottom:14px}.ct-dp-caret-2,.ct-dp-caret-1{left:10%;border:solid transparent;height:0;width:0;position:absolute;pointer-events:none;transition:left .5s}.display-above .ct-dp-caret-2,.display-above .ct-dp-caret-1{top:100%}.display-below .ct-dp-caret-2,.display-below .ct-dp-caret-1{bottom:100%}.ct-dp-caret-2{border-color:rgba(136,183,213,0);border-width:14px;margin-left:-14px}.display-below .ct-dp-caret-2{border-bottom-color:white}.display-above .ct-dp-caret-2{border-top-color:white}.ct-dp-caret-1{border-color:rgba(194,225,245,0);border-width:16px;margin-left:-16px}.display-below .ct-dp-caret-1{border-bottom-color:#808080}.display-above .ct-dp-caret-1{border-top-color:#808080}.ct-dp-header{border-bottom:1px solid #808080}.ct-dp-cal{padding:5px;width:220px;float:left}.ct-dp-cal-inactive{visibility:hidden}.ct-dp-cal-header{color:#808080}.ct-dp-cal-day{width:30px;height:30px;float:left;text-align:center}.ct-dp-cal-day:disabled{color:#bfbfbf}.ct-dp-cal-day.active{background-color:lightblue}.ct-dp-cal-day.between{background-color:lightgray}.ct-dp-months,.ct-dp-years{width:220px;float:left;padding:5px}.ct-dp-month,.ct-dp-year{width:33.33%;float:left;text-align:center}.ct-dp-btn{padding:4px;background-color:white;border:none}.ct-dp-btn:hover{background-color:#999}.ct-dp-btn[disabled]:hover{background-color:white}.ct-dp-btn[disabled]{color:#bfbfbf}.ct-dp-picker .ct-dp-btn-prev,.ct-dp-picker .ct-dp-btn-next{width:10%}.ct-dp-picker .ct-dp-btn-month{width:50%;font-weight:500}.ct-dp-picker .ct-dp-btn-year{width:30%;font-weight:500}.ct-dp-picker.ct-dp-dualpicker .ct-dp-btn-prev,.ct-dp-picker.ct-dp-dualpicker .ct-dp-btn-next{width:5%}.ct-dp-picker.ct-dp-dualpicker .ct-dp-btn-month{width:25%}.ct-dp-picker.ct-dp-dualpicker .ct-dp-btn-year{width:15%}.clearfix,.ct-dp-cal:after,.ct-dp-months:after,.ct-dp-years:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0}.no-button,.ct-dp-cal-day{background:transparent;border:none !important}.pull-right{float:right}.hidden{display:none !important}'},function(e,t,a){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var a in t)t.hasOwnProperty(a)&&(e[a]=t[a])};return function(t,a){function __(){this.constructor=t}e(t,a),t.prototype=null===a?Object.create(a):(__.prototype=a.prototype,new __)}}(),o=this&&this.__decorate||function(e,t,a,n){var o,i=arguments.length,r=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,a):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,n);else for(var d=e.length-1;d>=0;d--)(o=e[d])&&(r=(i<3?o(r):i>3?o(t,a,r):o(t,a))||r);return i>3&&r&&Object.defineProperty(t,a,r),r},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0});var r,d=a(2),l=a(6),c=a(10),s=a(7),p=a(8),h=a(4),u=a(14);!function(e){e[e.To=0]="To",e[e.From=1]="From",e[e.Hidden=2]="Hidden"}(r=t.DualPickerMode||(t.DualPickerMode={}));var m=f=function(e){function DualPickerComponent(t){var a=e.call(this)||this;return a.myElement=t,a.CalendarMode=p.CalendarMode,a.DualPickerMode=r,a._globalMode=p.CalendarMode.Calendar,a.today=l(),a.dateFromChange=new d.EventEmitter,a.dateToChange=new d.EventEmitter,a.mode=r.Hidden,a.timerId=null,a.month1ChangeListener=function(){a.shiftCal2(),a.changeMode(p.CalendarMode.Calendar,a.cal1),a.changeMode(p.CalendarMode.Calendar,a.cal2)},a.month2ChangeListener=function(){a.shiftCal1(),a.changeMode(p.CalendarMode.Calendar,a.cal1),a.changeMode(p.CalendarMode.Calendar,a.cal2)},a.year1ChangeListener=function(){a.shiftCal2(),a.changeMode(p.CalendarMode.Calendar,a.cal1),a.changeMode(p.CalendarMode.Calendar,a.cal2)},a.year2ChangeListener=function(){a.shiftCal1(),a.changeMode(p.CalendarMode.Calendar,a.cal1),a.changeMode(p.CalendarMode.Calendar,a.cal2)},a.dateClickListener=function(e){var t=l(e);return function(){a.setDate(t)}},a}return n(DualPickerComponent,e),Object.defineProperty(DualPickerComponent.prototype,"globalMode",{set:function(e){if(p.CalendarMode.hasOwnProperty(e))switch(p.CalendarMode[""+e]){case p.CalendarMode.Calendar:case p.CalendarMode.Year:this._globalMode=p.CalendarMode[""+e]}},enumerable:!0,configurable:!0}),Object.defineProperty(DualPickerComponent.prototype,"dateFrom",{get:function(){return this.dateFromValue},set:function(e){e instanceof l&&e.isValid()?(this.inputFrom.nativeElement.value=e.format("MM/DD/YYYY"),e=l(e.format("YYYY-MM-DD")+"T12:00:00.0Z"),this.dateFromValue=e,this.dateFromChange.emit(e)):(this.dateFromValue=void 0,this.inputFrom.nativeElement.value=""),this.propagateChange({dateFrom:this.dateFrom,dateTo:this.dateTo})},enumerable:!0,configurable:!0}),Object.defineProperty(DualPickerComponent.prototype,"dateTo",{get:function(){return this.dateToValue},set:function(e){e instanceof l&&e.isValid()&&(this.inputTo.nativeElement.value=e.format("MM/DD/YYYY"),e=l(e.format("YYYY-MM-DD")+"T12:00:00.0Z"),this.dateToValue=e,this.dateToChange.emit(e)),this.propagateChange({dateFrom:this.dateFrom,dateTo:e})},enumerable:!0,configurable:!0}),Object.defineProperty(DualPickerComponent.prototype,"match",{get:function(){return this.validDateExpression||/^((0?[13578]|10|12)(-|\/)(([1-9])|(0[1-9])|([12])([0-9]?)|(3[01]?))(-|\/)((19)([2-9])(\d{1})|(20)([01])(\d{1})|([8901])(\d{1}))|(0?[2469]|11)(-|\/)(([1-9])|(0[1-9])|([12])([0-9]?)|(3[0]?))(-|\/)((19)([2-9])(\d{1})|(20)([01])(\d{1})|([8901])(\d{1})))$/},set:function(e){this.validDateExpression=e},enumerable:!0,configurable:!0}),DualPickerComponent.prototype.changeGlobalMode=function(e,t){var a=this;void 0===t&&(t=!1),null!=this.timerId&&clearTimeout(this.timerId),t?this.timerId=setTimeout(function(){a.changeGlobalModeFn(e)},400):this.changeGlobalModeFn(e)},DualPickerComponent.prototype.changeGlobalModeFn=function(e){switch(this.mode=e,this.mode){case r.To:c(this.myElement.nativeElement).addClass("ct-dp-active"),this.positionCalendar(this.inputTo);break;case r.From:c(this.myElement.nativeElement).addClass("ct-dp-active"),this.positionCalendar(this.inputFrom);break;case r.Hidden:c(this.myElement.nativeElement).removeClass("ct-dp-active"),this.hideCalendar()}this.changeMode(this._globalMode,this.cal1),this.changeMode(this._globalMode,this.cal2)},DualPickerComponent.prototype.positionCalendar=function(e){var t=c(this.myElement.nativeElement).find(".ct-dp-picker-wrapper");t.removeClass("hidden");var a=c(e.nativeElement).offset().top+c(e.nativeElement).outerHeight(),n=c(window).scrollTop();c(window).height()\n \n
\n \n'},13]))}); +!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@angular/core"),require("@angular/common"),require("@angular/forms"),require("moment"),require("jquery"));else if("function"==typeof define&&define.amd)define(["@angular/core","@angular/common","@angular/forms","moment","jquery"],t);else{var a="object"==typeof exports?t(require("@angular/core"),require("@angular/common"),require("@angular/forms"),require("moment"),require("jquery")):t(e["@angular/core"],e["@angular/common"],e["@angular/forms"],e.moment,e.jquery);for(var n in a)("object"==typeof exports?exports:e)[n]=a[n]}}(this,function(e,t,a,n,o){return function(e){function __webpack_require__(a){if(t[a])return t[a].exports;var n=t[a]={exports:{},id:a,loaded:!1};return e[a].call(n.exports,n,n.exports,__webpack_require__),n.loaded=!0,n.exports}var t={};return __webpack_require__.m=e,__webpack_require__.c=t,__webpack_require__.p="/",__webpack_require__(0)}(function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))switch(typeof e[t]){case"function":break;case"object":e[t]=function(t){var a=t.slice(1),n=e[t[0]];return function(e,t,o){n.apply(this,[e,t,o].concat(a))}}(e[t]);break;default:e[t]=e[e[t]]}return e}([function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=a(1);t.DatePickerModule=n.DatePickerModule},function(e,t,a){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var a in t)t.hasOwnProperty(a)&&(e[a]=t[a])};return function(t,a){function __(){this.constructor=t}e(t,a),t.prototype=null===a?Object.create(a):(__.prototype=a.prototype,new __)}}(),o=this&&this.__decorate||function(e,t,a,n){var o,i=arguments.length,r=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,a):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,n);else for(var d=e.length-1;d>=0;d--)(o=e[d])&&(r=(i<3?o(r):i>3?o(t,a,r):o(t,a))||r);return i>3&&r&&Object.defineProperty(t,a,r),r};Object.defineProperty(t,"__esModule",{value:!0});var i=a(2),r=a(3),d=a(4),c=a(5),l=a(19),s=a(7),p=a(9),h=a(15),u=a(15);t.DatePickerConfig=u.DatePickerConfig;var m=function(){function DatePickerModule(){}return DatePickerModule}();m=o([i.NgModule({exports:[c.DatePickerComponent,l.DualPickerComponent],declarations:[c.DatePickerComponent,l.DualPickerComponent,s.CalendarComponent,p.CalendarGridComponent],imports:[r.CommonModule,d.FormsModule]})],m),t.DatePickerModule=m;var f=function(){function DatePickerUtil(){}return DatePickerUtil.forRoot=function(e){return void 0===e&&(e={}),{ngModule:m,providers:[{provide:h.DatePickerConfig,useValue:e}]}},DatePickerUtil}();t.DatePickerUtil=f;(function(e){function emptyConfig(){return null!==e&&e.apply(this,arguments)||this}return n(emptyConfig,e),emptyConfig})(h.DatePickerConfig)},function(t,a){t.exports=e},function(e,a){e.exports=t},function(e,t){e.exports=a},function(e,t,a){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var a in t)t.hasOwnProperty(a)&&(e[a]=t[a])};return function(t,a){function __(){this.constructor=t}e(t,a),t.prototype=null===a?Object.create(a):(__.prototype=a.prototype,new __)}}(),o=this&&this.__decorate||function(e,t,a,n){var o,i=arguments.length,r=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,a):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,n);else for(var d=e.length-1;d>=0;d--)(o=e[d])&&(r=(i<3?o(r):i>3?o(t,a,r):o(t,a))||r);return i>3&&r&&Object.defineProperty(t,a,r),r},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0});var r,d=a(2),c=a(6),l=a(7),s=a(8),p=a(10),h=a(4),u=a(14),m=a(15);!function(e){e[e.Visible=0]="Visible",e[e.Hidden=1]="Hidden"}(r=t.DatePickerMode||(t.DatePickerMode={}));var f=y=function(e){function DatePickerComponent(t,a,n){var o=e.call(this)||this;return o.myElement=t,o.renderer=a,o.config=n,o.CalendarMode=s.CalendarMode,o.DatePickerMode=r,o._globalMode=s.CalendarMode.Calendar,o.dateChange=new d.EventEmitter,o.mode=r.Hidden,o.dateClickListener=function(e){var t=c(e);return function(){o.setDate(t)}},o.monthChangeListener=function(){o.changeMode(s.CalendarMode.Calendar)},o.yearChangeListener=function(){o.changeMode(s.CalendarMode.Calendar)},o}return n(DatePickerComponent,e),Object.defineProperty(DatePickerComponent.prototype,"globalMode",{set:function(e){if(s.CalendarMode.hasOwnProperty(e))switch(s.CalendarMode[""+e]){case s.CalendarMode.Calendar:case s.CalendarMode.Year:this._globalMode=s.CalendarMode[""+e]}},enumerable:!0,configurable:!0}),Object.defineProperty(DatePickerComponent.prototype,"date",{get:function(){return this.dateValue||this.minDate},set:function(e){this.isSameDay(e,this.dateValue)||(e instanceof c&&e.isValid()?(this.input.nativeElement.value=e.format("MM/DD/YYYY"),e=c(e.format("YYYY-MM-DD")+this.config.defaultMomentTime),this.dateValue=e,this.dateChange.emit(e)):(this.dateValue=void 0,this.input.nativeElement.value=""),this.propagateChange(e))},enumerable:!0,configurable:!0}),Object.defineProperty(DatePickerComponent.prototype,"match",{get:function(){return this.validDateExpression||/^((0?[13578]|10|12)(-|\/)(([1-9])|(0[1-9])|([12])([0-9]?)|(3[01]?))(-|\/)((19)([2-9])(\d{1})|(20)([01])(\d{1})|([8901])(\d{1}))|(0?[2469]|11)(-|\/)(([1-9])|(0[1-9])|([12])([0-9]?)|(3[0]?))(-|\/)((19)([2-9])(\d{1})|(20)([01])(\d{1})|([8901])(\d{1})))$/},set:function(e){this.validDateExpression=new RegExp(e)},enumerable:!0,configurable:!0}),DatePickerComponent.prototype.onDateStringChange=function(e){if(this.match.test(e)){var t=c(new Date(e));void 0===this.dateValue||null===this.dateValue?this.dateValue=t:this.dateValue.set(t.toObject()),this.dateChange.emit(this.dateValue),t.isValid()?this.cal.date=this.dateValue:this.cal.date=c()}else this.propagateChange(e);this.touched()},DatePickerComponent.prototype.changeGlobalMode=function(e){switch(this.mode=e,this.mode){case r.Visible:this.changeMode(this._globalMode),p(this.myElement.nativeElement).addClass("ct-dp-active"),this.positionCalendar();break;case r.Hidden:this.hideCalendar(),p(this.myElement.nativeElement).removeClass("ct-dp-active")}},DatePickerComponent.prototype.positionCalendar=function(){var e=p(this.myElement.nativeElement).find(".ct-dp-picker-wrapper"),t=p(this.input.nativeElement).offset().top+p(this.input.nativeElement).outerHeight(),a=p(window).scrollTop();p(window).height()=0;d--)(o=e[d])&&(r=(i<3?o(r):i>3?o(t,a,r):o(t,a))||r);return i>3&&r&&Object.defineProperty(t,a,r),r},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0});var i=a(2),r=a(6),d=a(8),c=a(9),l=s=function(){function CalendarComponent(){this.CalendarMode=d.CalendarMode,this.months=[],this.years=[],this.monthListeners=[],this.yearListeners=[],this.generateMonthData()}return Object.defineProperty(CalendarComponent.prototype,"yearData",{get:function(){return this.years},enumerable:!0,configurable:!0}),CalendarComponent.prototype.ngOnInit=function(){},CalendarComponent.prototype.ngOnDestroy=function(){},CalendarComponent.prototype.subscribeToChangeMonth=function(e){this.monthListeners.push(e)},CalendarComponent.prototype.subscribeToChangeYear=function(e){this.yearListeners.push(e)},CalendarComponent.prototype.changeMode=function(e){switch(this.mode=e,e){case d.CalendarMode.Year:this.generateYearData(this.date.year())}},CalendarComponent.prototype.generateMonthData=function(){var e=r(new Date);e.month(0);var t=r(new Date);for(t.month(0);e.year()===t.year();)this.months.push(t.format("MMM")),t.month(t.month()+1)},CalendarComponent.prototype.generateYearData=function(e){this.years=[];for(var t=e-s.halfNumYearsShown,a=0;a=0;d--)(o=e[d])&&(r=(i<3?o(r):i>3?o(t,a,r):o(t,a))||r);return i>3&&r&&Object.defineProperty(t,a,r),r},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0});var i=a(2),r=a(6),d=a(10),c=function(){function CalendarGridComponent(e,t){this.myElement=e,this.renderer=t,this.today=r()}return CalendarGridComponent.prototype.ngOnInit=function(){},CalendarGridComponent.prototype.ngOnDestroy=function(){},CalendarGridComponent.prototype.renderCalendar=function(e,t,a,n,o,i){var c=r(e);c.date(1);for(var l=d("
"),s=0;s<7;s++){c.day(s);var p=d("
");p.text(c.format("dd")),p.attr("ct-cal-dp-day",s.toString()),p.addClass("ct-dp-cal-day"),l.append(p)}c.date(1);for(var h=d("
"),s=0;s");p.attr("ct-dp-cal-day",s.toString()),p.addClass("ct-dp-cal-day"),h.append(p)}for(;c.month()===e.month();){var p=d("");p.text(c.date().toString()),p.attr("ct-dp-cal-day",c.date().toString()),p.attr("tabIndex","-1"),p.addClass("ct-dp-cal-day"),this.today.date()===c.date()&&this.today.month()===c.month()&&p.addClass("today"),(a&&c.isSame(a,"day")||n&&c.isSame(n,"day"))&&p.addClass("active"),n&&a&&c.isBetween(n,a)&&p.addClass("between"),o&&c.isBefore(o)&&p.attr("disabled","disabled"),i&&c.isAfter(i)&&p.attr("disabled","disabled"),p.click(t(c)),c.date(c.date()+1),h.append(p)}d(this.myElement.nativeElement).empty(),l.appendTo(this.myElement.nativeElement),h.appendTo(this.myElement.nativeElement)},CalendarGridComponent.prototype.renderCalendarRenderer=function(e,t,a,n){var o=r(e.date);o.date(1),this.renderer.selectRootElement(this.myElement.nativeElement);var i=this.renderer.createElement(this.myElement.nativeElement,"div");this.renderer.setElementClass(i,".ct-dp-cal-header",!0);var d=this.renderer.createElement(this.myElement.nativeElement,"div");this.renderer.setElementClass(i,".ct-dp-cal-body",!0);for(var c=0;c<7;c++){o.day(c);var l=this.renderer.createElement(i,"div");this.renderer.setText(l,o.format("dd")),this.renderer.setElementAttribute(l,"ct-cal-dp-day",c.toString()),this.renderer.setElementClass(l,"ct-dp-cal-day",!0)}o.date(1);for(var c=0;c\n \n\n
\n \n
\n
\n \n
'},function(e,t){e.exports=""},function(e,t,a){"use strict";var n=this&&this.__decorate||function(e,t,a,n){var o,i=arguments.length,r=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,a):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,n);else for(var d=e.length-1;d>=0;d--)(o=e[d])&&(r=(i<3?o(r):i>3?o(t,a,r):o(t,a))||r);return i>3&&r&&Object.defineProperty(t,a,r),r},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0});var i=a(2),r=a(6),d=a(8),c=function(){function DatePickerBase(){this.CalendarMode=d.CalendarMode,this.propagateChange=function(){},this.propagateTouched=function(){},this.validateFn=function(){},this.shadowZIndex=100,this.zIndexVal=101,this.minDateVal=null,this.maxDateVal=null}return Object.defineProperty(DatePickerBase.prototype,"zIndex",{set:function(e){this.shadowZIndex=e,this.zIndexVal=e+1},enumerable:!0,configurable:!0}),Object.defineProperty(DatePickerBase.prototype,"minDate",{get:function(){return this.minDateVal},set:function(e){var t=r(e);t.isValid()?this.minDateVal=r(e):this.minDateVal=null},enumerable:!0,configurable:!0}),Object.defineProperty(DatePickerBase.prototype,"maxDate",{get:function(){return this.maxDateVal},set:function(e){var t=r(e);t.isValid()?this.maxDateVal=r(e):this.maxDateVal=null},enumerable:!0,configurable:!0}),DatePickerBase.prototype.registerOnChange=function(e){this.propagateChange=e},DatePickerBase.prototype.registerOnTouched=function(e){this.propagateTouched=e},DatePickerBase.prototype.isSameDay=function(e,t){return e instanceof r&&t instanceof r?e.isSame(t,"day"):e===t},DatePickerBase}();n([i.Input("zIndex"),o("design:type",Number),o("design:paramtypes",[Number])],c.prototype,"zIndex",null),n([i.Input("minDate"),o("design:type",Object),o("design:paramtypes",[Object])],c.prototype,"minDate",null),n([i.Input("maxDate"),o("design:type",Object),o("design:paramtypes",[Object])],c.prototype,"maxDate",null),t.DatePickerBase=c},function(e,t,a){"use strict";var n=this&&this.__decorate||function(e,t,a,n){var o,i=arguments.length,r=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,a):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,n);else for(var d=e.length-1;d>=0;d--)(o=e[d])&&(r=(i<3?o(r):i>3?o(t,a,r):o(t,a))||r);return i>3&&r&&Object.defineProperty(t,a,r),r},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0});var i=a(2),r=function(){function FieldModuleBase(){}return FieldModuleBase}();t.FieldModuleBase=r;var d=function(){function DatePickerConfig(e){void 0===e&&(e={}),this.defaultMomentTime="T12:00:00.0Z",Object.assign(this,e)}return DatePickerConfig}();d=n([i.Injectable(),o("design:paramtypes",[Object])],d),t.DatePickerConfig=d},function(e,t){e.exports='\n
\n
\n'},13,function(e,t){e.exports='.ct-dp-active{position:relative}.ct-dp-active input{position:relative}.ct-dp-shadow-box{position:fixed;top:0;right:0;bottom:0;left:0;background-color:transparent}.ct-dp-picker-wrapper{position:absolute}.display-below .ct-dp-picker-wrapper{padding-top:5px}.display-above .ct-dp-picker-wrapper{padding-bottom:5px}.ct-dp-picker{width:220px;border:1px solid #808080;box-sizing:content-box;position:relative;background-color:white;transition:margin-left .5s}.ct-dp-picker.ct-dp-dualpicker{width:440px}.ct-dp-picker.ct-dp-picker-to{margin-left:15px}.display-below .ct-dp-picker{margin-top:14px}.display-above .ct-dp-picker{margin-bottom:14px}.ct-dp-caret-2,.ct-dp-caret-1{left:10%;border:solid transparent;height:0;width:0;position:absolute;pointer-events:none;transition:left .5s}.display-above .ct-dp-caret-2,.display-above .ct-dp-caret-1{top:100%}.display-below .ct-dp-caret-2,.display-below .ct-dp-caret-1{bottom:100%}.ct-dp-caret-2{border-color:rgba(136,183,213,0);border-width:14px;margin-left:-14px}.display-below .ct-dp-caret-2{border-bottom-color:white}.display-above .ct-dp-caret-2{border-top-color:white}.ct-dp-caret-1{border-color:rgba(194,225,245,0);border-width:16px;margin-left:-16px}.display-below .ct-dp-caret-1{border-bottom-color:#808080}.display-above .ct-dp-caret-1{border-top-color:#808080}.ct-dp-header{border-bottom:1px solid #808080}.ct-dp-cal{padding:5px;width:220px;float:left}.ct-dp-cal-inactive{visibility:hidden}.ct-dp-cal-header{color:#808080}.ct-dp-cal-day{width:30px;height:30px;float:left;text-align:center}.ct-dp-cal-day:disabled{color:#bfbfbf}.ct-dp-cal-day.active{background-color:lightblue}.ct-dp-cal-day.between{background-color:lightgray}.ct-dp-months,.ct-dp-years{width:220px;float:left;padding:5px}.ct-dp-month,.ct-dp-year{width:33.33%;float:left;text-align:center}.ct-dp-btn{padding:4px;background-color:white;border:none}.ct-dp-btn:hover{background-color:#999}.ct-dp-btn[disabled]:hover{background-color:white}.ct-dp-btn[disabled]{color:#bfbfbf}.ct-dp-picker .ct-dp-btn-prev,.ct-dp-picker .ct-dp-btn-next{width:10%}.ct-dp-picker .ct-dp-btn-month{width:50%;font-weight:500}.ct-dp-picker .ct-dp-btn-year{width:30%;font-weight:500}.ct-dp-picker.ct-dp-dualpicker .ct-dp-btn-prev,.ct-dp-picker.ct-dp-dualpicker .ct-dp-btn-next{width:5%}.ct-dp-picker.ct-dp-dualpicker .ct-dp-btn-month{width:25%}.ct-dp-picker.ct-dp-dualpicker .ct-dp-btn-year{width:15%}.clearfix,.ct-dp-cal:after,.ct-dp-months:after,.ct-dp-years:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0}.no-button,.ct-dp-cal-day{background:transparent;border:none !important}.pull-right{float:right}.hidden{display:none !important}'},function(e,t,a){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var a in t)t.hasOwnProperty(a)&&(e[a]=t[a])};return function(t,a){function __(){this.constructor=t}e(t,a),t.prototype=null===a?Object.create(a):(__.prototype=a.prototype,new __)}}(),o=this&&this.__decorate||function(e,t,a,n){var o,i=arguments.length,r=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,a):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,n);else for(var d=e.length-1;d>=0;d--)(o=e[d])&&(r=(i<3?o(r):i>3?o(t,a,r):o(t,a))||r);return i>3&&r&&Object.defineProperty(t,a,r),r},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0});var r,d=a(2),c=a(6),l=a(10),s=a(7),p=a(8),h=a(4),u=a(14),m=a(15);!function(e){e[e.To=0]="To",e[e.From=1]="From",e[e.Hidden=2]="Hidden"}(r=t.DualPickerMode||(t.DualPickerMode={}));var f=y=function(e){function DualPickerComponent(t,a){var n=e.call(this)||this;return n.myElement=t,n.config=a,n.CalendarMode=p.CalendarMode,n.DualPickerMode=r,n._globalMode=p.CalendarMode.Calendar,n.today=c(),n.dateFromChange=new d.EventEmitter,n.dateToChange=new d.EventEmitter,n.mode=r.Hidden,n.timerId=null,n.month1ChangeListener=function(){n.shiftCal2(),n.changeMode(p.CalendarMode.Calendar,n.cal1),n.changeMode(p.CalendarMode.Calendar,n.cal2)},n.month2ChangeListener=function(){n.shiftCal1(),n.changeMode(p.CalendarMode.Calendar,n.cal1),n.changeMode(p.CalendarMode.Calendar,n.cal2)},n.year1ChangeListener=function(){n.shiftCal2(),n.changeMode(p.CalendarMode.Calendar,n.cal1),n.changeMode(p.CalendarMode.Calendar,n.cal2)},n.year2ChangeListener=function(){n.shiftCal1(),n.changeMode(p.CalendarMode.Calendar,n.cal1),n.changeMode(p.CalendarMode.Calendar,n.cal2)},n.dateClickListener=function(e){var t=c(e);return function(){n.setDate(t)}},n}return n(DualPickerComponent,e),Object.defineProperty(DualPickerComponent.prototype,"globalMode",{set:function(e){if(p.CalendarMode.hasOwnProperty(e))switch(p.CalendarMode[""+e]){case p.CalendarMode.Calendar:case p.CalendarMode.Year:this._globalMode=p.CalendarMode[""+e]}},enumerable:!0,configurable:!0}),Object.defineProperty(DualPickerComponent.prototype,"dateFrom",{get:function(){return this.dateFromValue||this.minDate},set:function(e){this.isSameDay(e,this.dateFromValue)||(e instanceof c&&e.isValid()?(this.inputFrom.nativeElement.value=e.format("MM/DD/YYYY"),e=c(e.format("YYYY-MM-DD")+this.config.defaultMomentTime),this.dateFromValue=e,this.dateFromChange.emit(e)):(this.dateFromValue=void 0,this.inputFrom.nativeElement.value=""),this.propagateChange({dateFrom:this.dateFrom,dateTo:this.dateTo}))},enumerable:!0,configurable:!0}),Object.defineProperty(DualPickerComponent.prototype,"dateTo",{get:function(){return this.dateToValue||this.minDate},set:function(e){this.isSameDay(e,this.dateToValue)||(e instanceof c&&e.isValid()?(this.inputTo.nativeElement.value=e.format("MM/DD/YYYY"),e=c(e.format("YYYY-MM-DD")+this.config.defaultMomentTime),this.dateToValue=e,this.dateToChange.emit(e)):(this.dateToValue=void 0,this.inputTo.nativeElement.value=""),this.propagateChange({dateFrom:this.dateFrom,dateTo:e}))},enumerable:!0,configurable:!0}),Object.defineProperty(DualPickerComponent.prototype,"match",{get:function(){return this.validDateExpression||/^((0?[13578]|10|12)(-|\/)(([1-9])|(0[1-9])|([12])([0-9]?)|(3[01]?))(-|\/)((19)([2-9])(\d{1})|(20)([01])(\d{1})|([8901])(\d{1}))|(0?[2469]|11)(-|\/)(([1-9])|(0[1-9])|([12])([0-9]?)|(3[0]?))(-|\/)((19)([2-9])(\d{1})|(20)([01])(\d{1})|([8901])(\d{1})))$/},set:function(e){this.validDateExpression=e},enumerable:!0,configurable:!0}),DualPickerComponent.prototype.changeGlobalMode=function(e,t){var a=this;void 0===t&&(t=!1),null!=this.timerId&&clearTimeout(this.timerId),t?this.timerId=setTimeout(function(){a.changeGlobalModeFn(e)},400):this.changeGlobalModeFn(e)},DualPickerComponent.prototype.changeGlobalModeFn=function(e){switch(this.mode=e,this.mode){case r.To:l(this.myElement.nativeElement).addClass("ct-dp-active"),this.positionCalendar(this.inputTo);break;case r.From:l(this.myElement.nativeElement).addClass("ct-dp-active"),this.positionCalendar(this.inputFrom);break;case r.Hidden:l(this.myElement.nativeElement).removeClass("ct-dp-active"),this.hideCalendar()}this.changeMode(this._globalMode,this.cal1),this.changeMode(this._globalMode,this.cal2)},DualPickerComponent.prototype.positionCalendar=function(e){var t=l(this.myElement.nativeElement).find(".ct-dp-picker-wrapper");t.removeClass("hidden");var a=l(e.nativeElement).offset().top+l(e.nativeElement).outerHeight(),n=l(window).scrollTop();l(window).height()\n \n
\n \n'},13]))}); \ No newline at end of file diff --git a/index.js b/index.js index 9d0acd0..0fdb2ea 100644 --- a/index.js +++ b/index.js @@ -1 +1,2 @@ -export {DatePickerModule, DatePickerConfig, DatePickerUtil} from './dist/ctng.umd.js'; \ No newline at end of file +export {DatePickerModule, DatePickerConfig, DatePickerUtil} from './dist/ctng.umd.js'; +// export {DatePickerModule, DatePickerConfig, DatePickerUtil} from './src/datepicker.module'; diff --git a/package.json b/package.json index fd25399..f444237 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ct-ngx-datepicker", - "version": "2.5.2", + "version": "3.2.0", "module": "index.js", "description": "Angular 2 Datepicker for Centeva projects", "main": "dist/ctng.umd.js", diff --git a/src/calendar-grid/calendar-grid.component.spec.ts b/src/calendar-grid/calendar-grid.component.spec.ts index 5e0a55a..67de0cc 100644 --- a/src/calendar-grid/calendar-grid.component.spec.ts +++ b/src/calendar-grid/calendar-grid.component.spec.ts @@ -34,7 +34,7 @@ describe('CalendarGridComponent.component', () => { let dateFrom = moment("2017-01-05"); let dateTo = moment("2017-01-10"); -// component.renderCalendar(date, () => {}, dateTo, dateFrom, null, null); + component.renderCalendar(date, () => {}, dateTo, dateFrom, null, null); //From let elFrom = $(nativeElement).find("[ct-dp-cal-day=5]"); diff --git a/src/common/datepicker-base.ts b/src/common/datepicker-base.ts index f3154a5..8a99286 100644 --- a/src/common/datepicker-base.ts +++ b/src/common/datepicker-base.ts @@ -62,11 +62,4 @@ export abstract class DatePickerBase implements ControlValueAccessor { } public abstract writeValue(value: any); - - public isSameDate(date1: moment.Moment, date2: moment.Moment) { - if (date1 instanceof moment && date2 instanceof moment) { - return date1.isSame(date2, 'day'); - } - return false; - } } \ No newline at end of file diff --git a/src/datepicker/datepicker.component.html b/src/datepicker/datepicker.component.html index 7a50152..c53d9cb 100644 --- a/src/datepicker/datepicker.component.html +++ b/src/datepicker/datepicker.component.html @@ -11,7 +11,7 @@ --> - +
\ No newline at end of file diff --git a/src/datepicker/datepicker.component.ts b/src/datepicker/datepicker.component.ts index 5fbd205..550b2e8 100644 --- a/src/datepicker/datepicker.component.ts +++ b/src/datepicker/datepicker.component.ts @@ -47,7 +47,7 @@ export class DatePickerComponent extends DatePickerBase implements AfterViewInit return this.dateValue || this.minDate; } set date(val) { - if (this.isSameDate(val, this.dateValue)) { + if (this.isSameDay(val, this.dateValue)) { return; } if (val instanceof moment && val.isValid()) { @@ -73,7 +73,7 @@ export class DatePickerComponent extends DatePickerBase implements AfterViewInit @ContentChild('date') input: ElementRef; - @ViewChild(CalendarComponent) public cal: CalendarComponent; + @ViewChild('cal') public cal: CalendarComponent; public mode: DatePickerMode = DatePickerMode.Hidden; constructor(private myElement: ElementRef, private renderer: Renderer, private config: DatePickerConfig) { @@ -137,7 +137,6 @@ export class DatePickerComponent extends DatePickerBase implements AfterViewInit let picker = $(this.myElement.nativeElement).find(".ct-dp-picker-wrapper"); picker.removeClass("display-above"); picker.addClass("display-below"); - // picker.css("top", ($(this.input.nativeElement).outerHeight()) + "px"); picker.css("left", "0px"); } diff --git a/src/dualpicker/dualpicker.component.ts b/src/dualpicker/dualpicker.component.ts index cc4d5e5..3f57dc8 100644 --- a/src/dualpicker/dualpicker.component.ts +++ b/src/dualpicker/dualpicker.component.ts @@ -63,10 +63,10 @@ export class DualPickerComponent extends DatePickerBase implements OnChanges { /** Input definition for (from) */ @Input() get dateFrom() { - return this.dateFromValue; + return this.dateFromValue || this.minDate; } set dateFrom(val) { - if (this.isSameDate(val, this.dateFromValue)) { + if (this.isSameDay(val, this.dateFromValue)) { return; } if (val instanceof moment && val.isValid()) { @@ -83,10 +83,10 @@ export class DualPickerComponent extends DatePickerBase implements OnChanges { /** Input definition for (to) */ @Input() get dateTo() { - return this.dateToValue; + return this.dateToValue || this.minDate; } set dateTo(val) { - if (this.isSameDate(val, this.dateToValue)) { + if (this.isSameDay(val, this.dateToValue)) { return; } if (val instanceof moment && val.isValid()) { @@ -190,7 +190,6 @@ export class DualPickerComponent extends DatePickerBase implements OnChanges { let caret = $(this.myElement.nativeElement).find(".ct-dp-caret"); picker.removeClass("display-above"); picker.addClass("display-below"); - picker.css("top", ($(element.nativeElement).height()) + "px"); picker.css("left", "0px"); caret.css({ "left": (left + (picker.width() * .05)) + "px" }); }