From 4e880f2167789867d6074a655c18c16717a92e49 Mon Sep 17 00:00:00 2001 From: Javier Marquez Date: Thu, 2 Sep 2021 21:47:42 +0200 Subject: [PATCH] chore: Bumps version to v3.1.0 --- CHANGELOG.md | 3 +++ dist/react-datetime.cjs.js | 2 +- dist/react-datetime.cjs.js.map | 2 +- dist/react-datetime.umd.js | 2 +- dist/react-datetime.umd.js.map | 2 +- package.json | 2 +- 6 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b95136da..cb93b2192 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ Changelog ========= +## 3.1.0 +* Adds support for React 17 + ## 3.0.3 * Localize AM and PM strings * Make calendar fluid width diff --git a/dist/react-datetime.cjs.js b/dist/react-datetime.cjs.js index 7c4763eb7..285e9481f 100644 --- a/dist/react-datetime.cjs.js +++ b/dist/react-datetime.cjs.js @@ -1,2 +1,2 @@ -module.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=4)}([function(e,t){e.exports=require("react")},function(e,t){e.exports=require("moment")},function(e,t,n){e.exports=n(5)()},function(e,t){e.exports=require("react-dom")},function(e,t,n){e.exports=n(7)},function(e,t,n){"use strict";var r=n(6);function o(){}function a(){}a.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,a,i){if(i!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:o};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";n.r(t);var r=n(2),o=n.n(r),a=n(1),i=n.n(a),s=n(0),c=n.n(s);function u(){return(u=Object.assign||function(e){for(var t=1;t1;)if(t(n.date(r)))return!1;return!0}},{key:"getMonthText",value:function(e){var t=this.props.viewDate,n=t.localeData().monthsShort(t.month(e));return this.capitalize(n.substring(0,3))}}])&&D(t.prototype,n),r&&D(t,r),a}(c.a.Component);function T(e){return(T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function N(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function x(e,t){for(var n=0;n1;)if(n(r.dayOfYear(o)))return t[e]=!1,!1;return t[e]=!0,!0}}])&&x(t.prototype,n),r&&x(t,r),a}(c.a.Component);function H(e){return(H="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function U(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Z(e){for(var t=1;t=12?e-=12:e+=12,this.props.setTime("hours",e)}},{key:"increase",value:function(e){var t=this.constraints[e],n=parseInt(this.state[e],10)+t.step;return n>t.max&&(n=t.min+(n-(t.max+1))),this.pad(e,n)}},{key:"decrease",value:function(e){var t=this.constraints[e],n=parseInt(this.state[e],10)-t.step;return n=0||(o[n]=e[n]);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,["excludeScrollbar"]));return e.prototype.isReactComponent?n.ref=this.getRef:n.wrappedRef=this.getRef,n.disableOnClickOutside=this.disableOnClickOutside,n.enableOnClickOutside=this.enableOnClickOutside,Object(s.createElement)(e,n)},i}(s.Component),n.displayName="OnClickOutside("+o+")",n.defaultProps={eventTypes:["mousedown","touchstart"],excludeScrollbar:t&&t.excludeScrollbar||!1,outsideClickIgnoreClass:"ignore-react-onclickoutside",preventDefault:!1,stopPropagation:!1},n.getClass=function(){return e.getClass?e.getClass():e},r};function ue(e){return(ue="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function le(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function pe(e){for(var t=1;t0?r.props.onNavigateForward(e,t):r.props.onNavigateBack(-e,t),r.setState({viewDate:n})})),we(ge(r),"_setTime",(function(e,t){var n=(r.getSelectedDate()||r.state.viewDate).clone();n[e](t),r.props.value||r.setState({selectedDate:n,viewDate:n.clone(),inputValue:n.format(r.getFormat("datetime"))}),r.props.onChange(n)})),we(ge(r),"_openCalendar",(function(){r.isOpen()||r.setState({open:!0},r.props.onOpen)})),we(ge(r),"_closeCalendar",(function(){r.isOpen()&&r.setState({open:!1},(function(){r.props.onClose(r.state.selectedDate||r.state.inputValue)}))})),we(ge(r),"_handleClickOutside",(function(){var e=r.props;e.input&&r.state.open&&void 0===e.open&&e.closeOnClickOutside&&r._closeCalendar()})),we(ge(r),"_onInputFocus",(function(e){r.callHandler(r.props.inputProps.onFocus,e)&&r._openCalendar()})),we(ge(r),"_onInputChange",(function(e){if(r.callHandler(r.props.inputProps.onChange,e)){var t=e.target?e.target.value:e,n=r.localMoment(t,r.getFormat("datetime")),o={inputValue:t};n.isValid()?(o.selectedDate=n,o.viewDate=n.clone().startOf("month")):o.selectedDate=null,r.setState(o,(function(){r.props.onChange(n.isValid()?n:r.state.inputValue)}))}})),we(ge(r),"_onInputKeyDown",(function(e){r.callHandler(r.props.inputProps.onKeyDown,e)&&9===e.which&&r.props.closeOnTab&&r._closeCalendar()})),we(ge(r),"_onInputClick",(function(e){console.log("CLICKING 2!"),r.callHandler(r.props.inputProps.onClick,e)&&r._openCalendar()})),r.state=r.getInitialState(e),r}return he(n,[{key:"render",value:function(){return c.a.createElement(Ve,{className:this.getClassName(),onClickOut:this._handleClickOutside},this.renderInput(),c.a.createElement("div",{className:"rdtPicker"},this.renderView(this.state.currentView,this._renderCalendar)))}},{key:"renderInput",value:function(){if(this.props.input){var e=pe(pe({type:"text",className:"form-control",value:this.getInputValue()},this.props.inputProps),{},{onFocus:this._onInputFocus,onChange:this._onInputChange,onKeyDown:this._onInputKeyDown,onClick:this._onInputClick});return this.props.renderInput?c.a.createElement("div",null,this.props.renderInput(e,this._openCalendar,this._closeCalendar)):c.a.createElement("input",e)}}},{key:"renderView",value:function(e,t){return this.props.renderView?this.props.renderView(e,(function(){return t(e)})):t(this.state.currentView)}},{key:"getInitialState",value:function(e){var t=e||this.props,n=this.getFormat("datetime"),r=this.parseDate(t.value||t.initialValue,n);return this.checkTZ(t),{open:!t.input,currentView:t.initialViewMode||this.getInitialView(this.getFormat("date")),viewDate:this.getInitialViewDate(t.initialViewDate,r,n),selectedDate:r&&r.isValid()?r:void 0,inputValue:this.getInitialInputValue(t,r,n)}}},{key:"getInitialViewDate",value:function(e,t,n){var r;if(e){if((r=this.parseDate(e,n))&&r.isValid())return r;this.log('The initialViewDated given "'+e+'" is not valid. Using current date instead.')}else if(t&&t.isValid())return t.clone();return this.getInitialDate()}},{key:"getInitialDate",value:function(){var e=this.localMoment();return e.hour(0).minute(0).second(0).millisecond(0),e}},{key:"getInitialView",value:function(e){return e?this.getUpdateOn(e):_e}},{key:"parseDate",value:function(e,t){var n;return e&&"string"==typeof e?n=this.localMoment(e,t):e&&(n=this.localMoment(e)),n&&!n.isValid()&&(n=null),n}},{key:"getClassName",value:function(){var e="rdt",t=this.props,n=t.className;return Array.isArray(n)?e+=" "+n.join(" "):n&&(e+=" "+n),t.input||(e+=" rdtStatic"),this.isOpen()&&(e+=" rdtOpen"),e}},{key:"isOpen",value:function(){return!this.props.input||(void 0===this.props.open?this.state.open:this.props.open)}},{key:"getUpdateOn",value:function(e){return this.props.updateOnView?this.props.updateOnView:e.match(/[lLD]/)?Ce:-1!==e.indexOf("M")?De:-1!==e.indexOf("Y")?ke:Ce}},{key:"getLocaleData",value:function(e){var t=e||this.props;return this.localMoment(t.value||t.defaultValue||new Date).localeData()}},{key:"getDateFormat",value:function(e){var t=this.props.dateFormat;return!0===t?e.longDateFormat("L"):t||""}},{key:"getTimeFormat",value:function(e){var t=this.props.timeFormat;return!0===t?e.longDateFormat("LT"):t||""}},{key:"getFormat",value:function(e){if("date"===e)return this.getDateFormat(this.getLocaleData());if("time"===e)return this.getTimeFormat(this.getLocaleData());var t=this.getLocaleData(),n=this.getDateFormat(t),r=this.getTimeFormat(t);return n&&r?n+" "+r:n||r}},{key:"updateTime",value:function(e,t,n,r){var o={},a=r?"selectedDate":"viewDate";o[a]=this.state[a].clone()[e](t,n),this.setState(o)}},{key:"localMoment",value:function(e,t,n){var r=null;return r=(n=n||this.props).utc?i.a.utc(e,t,n.strictParsing):n.displayTimeZone?i.a.tz(e,t,n.displayTimeZone):i()(e,t,n.strictParsing),n.locale&&r.locale(n.locale),r}},{key:"checkTZ",value:function(e){!e.displayTimeZone||this.tzWarning||i.a.tz||(this.tzWarning=!0,this.log('displayTimeZone prop with value "'+e.displayTimeZone+'" is used but moment.js timezone is not loaded.',"error"))}},{key:"componentDidUpdate",value:function(e){if(e!==this.props){var t=!1,n=this.props;["locale","utc","displayZone","dateFormat","timeFormat"].forEach((function(r){e[r]!==n[r]&&(t=!0)})),t&&this.regenerateDates(this.props),n.value&&n.value!==e.value&&this.setViewDate(n.value),this.checkTZ(this.props)}}},{key:"regenerateDates",value:function(e){var t=this.state.viewDate.clone(),n=this.state.selectedDate&&this.state.selectedDate.clone();e.locale&&(t.locale(e.locale),n&&n.locale(e.locale)),e.utc?(t.utc(),n&&n.utc()):e.displayTimeZone?(t.tz(e.displayTimeZone),n&&n.tz(e.displayTimeZone)):(t.locale(),n&&n.locale());var r={viewDate:t,selectedDate:n};n&&n.isValid()&&(r.inputValue=n.format(this.getFormat("datetime"))),this.setState(r)}},{key:"getSelectedDate",value:function(){if(void 0===this.props.value)return this.state.selectedDate;var e=this.parseDate(this.props.value,this.getFormat("datetime"));return!(!e||!e.isValid())&&e}},{key:"getInitialInputValue",value:function(e,t,n){return e.inputProps.value?e.inputProps.value:t&&t.isValid()?t.format(n):e.value&&"string"==typeof e.value?e.value:e.initialValue&&"string"==typeof e.initialValue?e.initialValue:""}},{key:"getInputValue",value:function(){var e=this.getSelectedDate();return e?e.format(this.getFormat("datetime")):this.state.inputValue}},{key:"setViewDate",value:function(e){var t,n=this,r=function(){return n.log("Invalid date passed to the `setViewDate` method: "+e)};return e&&(t="string"==typeof e?this.localMoment(e,this.getFormat("datetime")):this.localMoment(e))&&t.isValid()?void this.setState({viewDate:t}):r()}},{key:"navigate",value:function(e){this._showView(e)}},{key:"log",value:function(e,t){var n="undefined"!=typeof window&&window.console;n&&(t||(t="warn"),n[t]("***react-datetime:"+e))}},{key:"callHandler",value:function(e,t){return!e||!1!==e(t)}}]),n}(c.a.Component);we(je,"propTypes",{value:Se,initialValue:Se,initialViewDate:Se,initialViewMode:Ee.oneOf([ke,De,Ce,_e]),onOpen:Ee.func,onClose:Ee.func,onChange:Ee.func,onNavigate:Ee.func,onBeforeNavigate:Ee.func,onNavigateBack:Ee.func,onNavigateForward:Ee.func,updateOnView:Ee.string,locale:Ee.string,utc:Ee.bool,displayTimeZone:Ee.string,input:Ee.bool,dateFormat:Ee.oneOfType([Ee.string,Ee.bool]),timeFormat:Ee.oneOfType([Ee.string,Ee.bool]),inputProps:Ee.object,timeConstraints:Ee.object,isValidDate:Ee.func,open:Ee.bool,strictParsing:Ee.bool,closeOnSelect:Ee.bool,closeOnTab:Ee.bool,renderView:Ee.func,renderInput:Ee.func,renderDay:Ee.func,renderMonth:Ee.func,renderYear:Ee.func}),we(je,"defaultProps",{onOpen:Pe,onClose:Pe,onCalendarOpen:Pe,onCalendarClose:Pe,onChange:Pe,onNavigate:Pe,onBeforeNavigate:function(e){return e},onNavigateBack:Pe,onNavigateForward:Pe,dateFormat:!0,timeFormat:!0,utc:!1,className:"",input:!0,inputProps:{},timeConstraints:{},isValidDate:function(){return!0},strictParsing:!0,closeOnSelect:!1,closeOnTab:!0,closeOnClickOutside:!0}),we(je,"moment",i.a);var Ve=ce(function(e){me(n,e);var t=ve(n);function n(){var e;fe(this,n);for(var r=arguments.length,o=new Array(r),a=0;a1;)if(t(n.date(r)))return!1;return!0}},{key:"getMonthText",value:function(e){var t,n=this.props.viewDate,r=n.localeData().monthsShort(n.month(e));return(t=r.substring(0,3)).charAt(0).toUpperCase()+t.slice(1)}}])&&C(t.prototype,n),r&&C(t,r),a}(c.a.Component);function N(e,t){return t<4?e[0]:t<8?e[1]:e[2]}function x(e){return(x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function F(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function I(e,t){for(var n=0;n1;)if(n(r.dayOfYear(o)))return t[e]=!1,!1;return t[e]=!0,!0}}])&&I(t.prototype,n),r&&I(t,r),a}(c.a.Component);function Z(e,t){return t<3?e[0]:t<7?e[1]:e[2]}function B(e){return(B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function W(e,t){for(var n=0;n=12?e-=12:e+=12,this.props.setTime("hours",e)}},{key:"increase",value:function(e){var t=this.constraints[e],n=parseInt(this.state[e],10)+t.step;return n>t.max&&(n=t.min+(n-(t.max+1))),te(e,n)}},{key:"decrease",value:function(e){var t=this.constraints[e],n=parseInt(this.state[e],10)-t.step;return n=0||(o[n]=e[n]);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,["excludeScrollbar"]));return e.prototype.isReactComponent?n.ref=this.getRef:n.wrappedRef=this.getRef,n.disableOnClickOutside=this.disableOnClickOutside,n.enableOnClickOutside=this.enableOnClickOutside,Object(s.createElement)(e,n)},i}(s.Component),n.displayName="OnClickOutside("+o+")",n.defaultProps={eventTypes:["mousedown","touchstart"],excludeScrollbar:t&&t.excludeScrollbar||!1,outsideClickIgnoreClass:"ignore-react-onclickoutside",preventDefault:!1,stopPropagation:!1},n.getClass=function(){return e.getClass?e.getClass():e},r};function fe(e){return(fe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function de(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function he(e){for(var t=1;t0?r.props.onNavigateForward(e,t):r.props.onNavigateBack(-e,t),r.setState({viewDate:n})})),Ce(De(r),"_setTime",(function(e,t){var n=(r.getSelectedDate()||r.state.viewDate).clone();n[e](t),r.props.value||r.setState({selectedDate:n,viewDate:n.clone(),inputValue:n.format(r.getFormat("datetime"))}),r.props.onChange(n)})),Ce(De(r),"_openCalendar",(function(){r.isOpen()||r.setState({open:!0},r.props.onOpen)})),Ce(De(r),"_closeCalendar",(function(){r.isOpen()&&r.setState({open:!1},(function(){r.props.onClose(r.state.selectedDate||r.state.inputValue)}))})),Ce(De(r),"_handleClickOutside",(function(){var e=r.props;e.input&&r.state.open&&void 0===e.open&&e.closeOnClickOutside&&r._closeCalendar()})),Ce(De(r),"_onInputFocus",(function(e){r.callHandler(r.props.inputProps.onFocus,e)&&r._openCalendar()})),Ce(De(r),"_onInputChange",(function(e){if(r.callHandler(r.props.inputProps.onChange,e)){var t=e.target?e.target.value:e,n=r.localMoment(t,r.getFormat("datetime")),o={inputValue:t};n.isValid()?(o.selectedDate=n,o.viewDate=n.clone().startOf("month")):o.selectedDate=null,r.setState(o,(function(){r.props.onChange(n.isValid()?n:r.state.inputValue)}))}})),Ce(De(r),"_onInputKeyDown",(function(e){r.callHandler(r.props.inputProps.onKeyDown,e)&&9===e.which&&r.props.closeOnTab&&r._closeCalendar()})),Ce(De(r),"_onInputClick",(function(e){r.callHandler(r.props.inputProps.onClick,e)&&r._openCalendar()})),r.state=r.getInitialState(),r}return ve(n,[{key:"render",value:function(){return c.a.createElement(Fe,{className:this.getClassName(),onClickOut:this._handleClickOutside},this.renderInput(),c.a.createElement("div",{className:"rdtPicker"},this.renderView()))}},{key:"renderInput",value:function(){if(this.props.input){var e=he(he({type:"text",className:"form-control",value:this.getInputValue()},this.props.inputProps),{},{onFocus:this._onInputFocus,onChange:this._onInputChange,onKeyDown:this._onInputKeyDown,onClick:this._onInputClick});return this.props.renderInput?c.a.createElement("div",null,this.props.renderInput(e,this._openCalendar,this._closeCalendar)):c.a.createElement("input",e)}}},{key:"renderView",value:function(){return this.props.renderView(this.state.currentView,this._renderCalendar)}},{key:"getInitialState",value:function(){var e=this.props,t=this.getFormat("datetime"),n=this.parseDate(e.value||e.initialValue,t);return this.checkTZ(),{open:!e.input,currentView:e.initialViewMode||this.getInitialView(),viewDate:this.getInitialViewDate(n),selectedDate:n&&n.isValid()?n:void 0,inputValue:this.getInitialInputValue(n)}}},{key:"getInitialViewDate",value:function(e){var t,n=this.props.initialViewDate;if(n){if((t=this.parseDate(n,this.getFormat("datetime")))&&t.isValid())return t;xe('The initialViewDated given "'+n+'" is not valid. Using current date instead.')}else if(e&&e.isValid())return e.clone();return this.getInitialDate()}},{key:"getInitialDate",value:function(){var e=this.localMoment();return e.hour(0).minute(0).second(0).millisecond(0),e}},{key:"getInitialView",value:function(){var e=this.getFormat("date");return e?this.getUpdateOn(e):Se}},{key:"parseDate",value:function(e,t){var n;return e&&"string"==typeof e?n=this.localMoment(e,t):e&&(n=this.localMoment(e)),n&&!n.isValid()&&(n=null),n}},{key:"getClassName",value:function(){var e="rdt",t=this.props,n=t.className;return Array.isArray(n)?e+=" "+n.join(" "):n&&(e+=" "+n),t.input||(e+=" rdtStatic"),this.isOpen()&&(e+=" rdtOpen"),e}},{key:"isOpen",value:function(){return!this.props.input||(void 0===this.props.open?this.state.open:this.props.open)}},{key:"getUpdateOn",value:function(e){return this.props.updateOnView?this.props.updateOnView:e.match(/[lLD]/)?Pe:-1!==e.indexOf("M")?Ee:-1!==e.indexOf("Y")?_e:Pe}},{key:"getLocaleData",value:function(){var e=this.props;return this.localMoment(e.value||e.defaultValue||new Date).localeData()}},{key:"getDateFormat",value:function(){var e=this.getLocaleData(),t=this.props.dateFormat;return!0===t?e.longDateFormat("L"):t||""}},{key:"getTimeFormat",value:function(){var e=this.getLocaleData(),t=this.props.timeFormat;return!0===t?e.longDateFormat("LT"):t||""}},{key:"getFormat",value:function(e){if("date"===e)return this.getDateFormat();if("time"===e)return this.getTimeFormat();var t=this.getDateFormat(),n=this.getTimeFormat();return t&&n?t+" "+n:t||n}},{key:"updateTime",value:function(e,t,n,r){var o={},a=r?"selectedDate":"viewDate";o[a]=this.state[a].clone()[e](t,n),this.setState(o)}},{key:"localMoment",value:function(e,t,n){var r=null;return r=(n=n||this.props).utc?i.a.utc(e,t,n.strictParsing):n.displayTimeZone?i.a.tz(e,t,n.displayTimeZone):i()(e,t,n.strictParsing),n.locale&&r.locale(n.locale),r}},{key:"checkTZ",value:function(){var e=this.props.displayTimeZone;!e||this.tzWarning||i.a.tz||(this.tzWarning=!0,xe('displayTimeZone prop with value "'+e+'" is used but moment.js timezone is not loaded.',"error"))}},{key:"componentDidUpdate",value:function(e){if(e!==this.props){var t=!1,n=this.props;["locale","utc","displayZone","dateFormat","timeFormat"].forEach((function(r){e[r]!==n[r]&&(t=!0)})),t&&this.regenerateDates(),n.value&&n.value!==e.value&&this.setViewDate(n.value),this.checkTZ()}}},{key:"regenerateDates",value:function(){var e=this.props,t=this.state.viewDate.clone(),n=this.state.selectedDate&&this.state.selectedDate.clone();e.locale&&(t.locale(e.locale),n&&n.locale(e.locale)),e.utc?(t.utc(),n&&n.utc()):e.displayTimeZone?(t.tz(e.displayTimeZone),n&&n.tz(e.displayTimeZone)):(t.locale(),n&&n.locale());var r={viewDate:t,selectedDate:n};n&&n.isValid()&&(r.inputValue=n.format(this.getFormat("datetime"))),this.setState(r)}},{key:"getSelectedDate",value:function(){if(void 0===this.props.value)return this.state.selectedDate;var e=this.parseDate(this.props.value,this.getFormat("datetime"));return!(!e||!e.isValid())&&e}},{key:"getInitialInputValue",value:function(e){var t=this.props;return t.inputProps.value?t.inputProps.value:e&&e.isValid()?e.format(this.getFormat("datetime")):t.value&&"string"==typeof t.value?t.value:t.initialValue&&"string"==typeof t.initialValue?t.initialValue:""}},{key:"getInputValue",value:function(){var e=this.getSelectedDate();return e?e.format(this.getFormat("datetime")):this.state.inputValue}},{key:"setViewDate",value:function(e){var t,n=this,r=function(){return n.log("Invalid date passed to the `setViewDate` method: "+e)};return e&&(t="string"==typeof e?this.localMoment(e,this.getFormat("datetime")):this.localMoment(e))&&t.isValid()?void this.setState({viewDate:t}):r()}},{key:"navigate",value:function(e){this._showView(e)}},{key:"callHandler",value:function(e,t){return!e||!1!==e(t)}}]),n}(c.a.Component);function xe(e,t){var n="undefined"!=typeof window&&window.console;n&&(t||(t="warn"),n[t]("***react-datetime:"+e))}Ce(Ne,"propTypes",{value:Te,initialValue:Te,initialViewDate:Te,initialViewMode:je.oneOf([_e,Ee,Pe,Se]),onOpen:je.func,onClose:je.func,onChange:je.func,onNavigate:je.func,onBeforeNavigate:je.func,onNavigateBack:je.func,onNavigateForward:je.func,updateOnView:je.string,locale:je.string,utc:je.bool,displayTimeZone:je.string,input:je.bool,dateFormat:je.oneOfType([je.string,je.bool]),timeFormat:je.oneOfType([je.string,je.bool]),inputProps:je.object,timeConstraints:je.object,isValidDate:je.func,open:je.bool,strictParsing:je.bool,closeOnSelect:je.bool,closeOnTab:je.bool,renderView:je.func,renderInput:je.func,renderDay:je.func,renderMonth:je.func,renderYear:je.func}),Ce(Ne,"defaultProps",{onOpen:Ve,onClose:Ve,onCalendarOpen:Ve,onCalendarClose:Ve,onChange:Ve,onNavigate:Ve,onBeforeNavigate:function(e){return e},onNavigateBack:Ve,onNavigateForward:Ve,dateFormat:!0,timeFormat:!0,utc:!1,className:"",input:!0,inputProps:{},timeConstraints:{},isValidDate:function(){return!0},strictParsing:!0,closeOnSelect:!1,closeOnTab:!0,closeOnClickOutside:!0,renderView:function(e,t){return t()}}),Ce(Ne,"moment",i.a);var Fe=pe(function(e){be(n,e);var t=Oe(n);function n(){var e;me(this,n);for(var r=arguments.length,o=new Array(r),a=0;a\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t{ switchContent }\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t);\n}\n","import React from 'react';\nimport ViewNavigation from './ViewNavigation';\n\nexport default class DaysView extends React.Component {\n\tstatic defaultProps = {\n\t\tisValidDate: () => true\n\t}\n\n\trender() {\n\t\tconst date = this.props.viewDate;\n\t\tconst locale = date.localeData();\n\n\t\tlet startOfMonth = date.clone().startOf('month');\n\t\tlet endOfMonth = date.clone().endOf('month');\n\n\t\treturn (\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{ this.renderNavigation( date, locale ) }\n\t\t\t\t\t\t{ this.renderDayHeaders( locale ) }\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{ this.renderDays( date, startOfMonth, endOfMonth ) }\n\t\t\t\t\t\n\t\t\t\t\t{ this.renderFooter( date ) }\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n\n\trenderNavigation( date, locale ) {\n\t\treturn (\n\t\t\t this.props.navigate( -1, 'months' ) }\n\t\t\t\tonClickSwitch={ () => this.props.showView( 'months' ) }\n\t\t\t\tonClickNext={ () => this.props.navigate( 1, 'months' ) }\n\t\t\t\tswitchContent={ locale.months( date ) + ' ' + date.year() }\n\t\t\t\tswitchColSpan={5}\n\t\t\t\tswitchProps={ { 'data-value': this.props.viewDate.month() } }\n\t\t\t/>\n\t\t);\n\t}\n\n\trenderDayHeaders( locale ) {\n\t\tlet dayItems = this.getDaysOfWeek( locale ).map( (day, index) => (\n\t\t\t{ day }\n\t\t));\n\n\t\treturn (\n\t\t\t\n\t\t\t\t{ dayItems }\n\t\t\t\n\t\t);\n\t}\n\n\trenderDays( date, startOfMonth, endOfMonth ) {\n\t\t// We need 42 days in 6 rows\n\t\t// starting in the last week of the previous month\n\t\tlet rows = [[], [], [], [], [], []];\n\n\t\tlet startDate = date.clone().subtract( 1, 'months');\n\t\tstartDate.date( startDate.daysInMonth() ).startOf('week');\n\n\t\tlet endDate = startDate.clone().add( 42, 'd' );\n\t\tlet i = 0;\n\n\t\twhile ( startDate.isBefore( endDate ) ) {\n\t\t\tlet row = this.getRow( rows, i++ );\n\t\t\trow.push( this.renderDay( startDate, startOfMonth, endOfMonth ) );\n\t\t\tstartDate.add( 1, 'd' );\n\t\t}\n\n\t\treturn rows.map( (r, i) => (\n\t\t\t{ r }\n\t\t));\n\t}\n\n\trenderDay( date, startOfMonth, endOfMonth ) {\n\t\tlet selectedDate = this.props.selectedDate;\n\n\t\tlet dayProps = {\n\t\t\tkey: date.format('M_D'),\n\t\t\t'data-value': date.date(),\n\t\t\t'data-month': date.month(),\n\t\t\t'data-year': date.year()\n\t\t};\n\n\t\tlet className = 'rdtDay';\n\t\tif ( date.isBefore( startOfMonth ) ) {\n\t\t\tclassName += ' rdtOld';\n\t\t}\n\t\telse if ( date.isAfter( endOfMonth ) ) {\n\t\t\tclassName += ' rdtNew';\n\t\t}\n\t\tif ( selectedDate && date.isSame( selectedDate, 'day' ) ) {\n\t\t\tclassName += ' rdtActive';\n\t\t}\n\t\tif ( date.isSame( this.props.moment(), 'day' ) ) {\n\t\t\tclassName += ' rdtToday';\n\t\t}\n\n\t\tif ( this.props.isValidDate(date) ) {\n\t\t\tdayProps.onClick = this._setDate;\n\t\t}\n\t\telse {\n\t\t\tclassName += ' rdtDisabled';\n\t\t}\n\n\t\tdayProps.className = className;\n\n\t\tif ( this.props.renderDay ) {\n\t\t\treturn this.props.renderDay(\n\t\t\t\tdayProps, date.clone(), selectedDate && selectedDate.clone()\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t{ date.date() }\n\t\t);\n\t}\n\n\trenderFooter( date ) {\n\t\tif ( !this.props.timeFormat ) return;\n\n\t\treturn (\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t this.props.showView('time') }\n\t\t\t\t\t\tcolSpan={7}\n\t\t\t\t\t\tclassName=\"rdtTimeToggle\">\n\t\t\t\t\t\t{ date.format( this.props.timeFormat ) }\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t);\n\t}\n\n\t_setDate = e => {\n\t\tthis.props.updateDate( e );\n\t}\n\n\t/**\n\t * Get a list of the days of the week\n\t * depending on the current locale\n\t * @return {array} A list with the shortname of the days\n\t */\n\tgetDaysOfWeek(locale) {\n\t\tconst first = locale.firstDayOfWeek();\n\t\tlet dow = [];\n\t\tlet i = 0;\n\n\t\tlocale._weekdaysMin.forEach(function (day) {\n\t\t\tdow[(7 + (i++) - first) % 7] = day;\n\t\t});\n\n\t\treturn dow;\n\t}\n\n\tgetRow( rows, day ) {\n\t\treturn rows[ Math.floor( day / 7 ) ];\n\t}\n}\n","import React from 'react';\nimport ViewNavigation from './ViewNavigation';\n\nexport default class MonthsView extends React.Component {\n\trender() {\n\t\treturn (\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{ this.renderNavigation() }\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{ this.renderMonths() }\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n\n\trenderNavigation() {\n\t\tlet year = this.props.viewDate.year();\n\n\t\treturn (\n\t\t\t this.props.navigate( -1, 'years' ) }\n\t\t\t\tonClickSwitch={ () => this.props.showView( 'years' ) }\n\t\t\t\tonClickNext={ () => this.props.navigate( 1, 'years' ) }\n\t\t\t\tswitchContent={ year }\n\t\t\t\tswitchColSpan=\"2\"\n\t\t\t/>\n\t\t);\n\t}\n\n\trenderMonths( viewYear ) {\n\t\t// 12 months in 3 rows for every view\n\t\tlet rows = [ [], [], [] ];\n\n\t\tfor ( let month = 0; month < 12; month++ ) {\n\t\t\tlet row = this.getRow( rows, month );\n\n\t\t\trow.push(\n\t\t\t\tthis.renderMonth( month, this.props.selectedDate )\n\t\t\t);\n\t\t}\n\n\t\treturn rows.map( (months, i) => (\n\t\t\t{ months }\n\t\t));\n\t}\n\n\trenderMonth( month, selectedDate ) {\n\t\tlet className = 'rdtMonth';\n\t\tlet onClick;\n\n\t\tif ( this.isDisabledMonth( month ) ) {\n\t\t\tclassName += ' rdtDisabled';\n\t\t}\n\t\telse {\n\t\t\tonClick = this._updateSelectedMonth;\n\t\t}\n\n\t\tif ( selectedDate && selectedDate.year() === this.props.viewDate.year() && selectedDate.month() === month ) {\n\t\t\tclassName += ' rdtActive';\n\t\t}\n\n\t\tlet props = {key: month, className, 'data-value': month, onClick };\n\n\t\tif ( this.props.renderMonth ) {\n\t\t\treturn this.props.renderMonth(\n\t\t\t\tprops,\n\t\t\t\tmonth,\n\t\t\t\tthis.props.viewDate.year(),\n\t\t\t\tthis.props.selectedDate && this.props.selectedDate.clone()\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t\n\t\t\t\t{ this.getMonthText( month ) }\n\t\t\t\n\t\t);\n\t}\n\n\tgetRow( rows, year ) {\n\t\tif ( year < 4 ) {\n\t\t\treturn rows[0];\n\t\t}\n\t\tif ( year < 8 ) {\n\t\t\treturn rows[1];\n\t\t}\n\n\t\treturn rows[2];\n\t}\n\n\tcapitalize( str ) {\n\t\treturn str.charAt( 0 ).toUpperCase() + str.slice( 1 );\n\t}\n\n\tisDisabledMonth( month ) {\n\t\tlet isValidDate = this.props.isValidDate;\n\n\t\tif ( !isValidDate ) {\n\t\t\t// If no validator is set, all days are valid\n\t\t\treturn false;\n\t\t}\n\n\t\t// If one day in the month is valid, the year should be clickable\n\t\tlet date = this.props.viewDate.clone().set({month});\n\t\tlet day = date.endOf( 'month' ).date() + 1;\n\n\t\twhile ( day-- > 1 ) {\n\t\t\tif ( isValidDate( date.date(day) ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\tgetMonthText( month ) {\n\t\tconst localMoment = this.props.viewDate;\n\t\tconst monthStr = localMoment.localeData().monthsShort( localMoment.month( month ) );\n\n\t\t// Because some months are up to 5 characters long, we want to\n\t\t// use a fixed string length for consistency\n\t\treturn this.capitalize( monthStr.substring( 0, 3 ) );\n\t}\n\n\t_updateSelectedMonth = event => {\n\t\tthis.props.updateDate( event );\n\t}\n}\n","import React from 'react';\nimport ViewNavigation from './ViewNavigation';\n\nexport default class YearsView extends React.Component {\n\trender() {\n\t\tconst viewYear = parseInt( this.props.viewDate.year() / 10, 10 ) * 10;\n\n\t\treturn (\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{ this.renderNavigation( viewYear ) }\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{ this.renderYears( viewYear ) }\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n\n\trenderNavigation( viewYear ) {\n\t\treturn (\n\t\t\t this.props.navigate( -10, 'years' ) }\n\t\t\t\tonClickSwitch={ () => this.props.showView( 'years' ) }\n\t\t\t\tonClickNext={ () => this.props.navigate( 10, 'years' ) }\n\t\t\t\tswitchContent={ `${viewYear}-${viewYear + 9}` }\n\t\t\t/>\n\t\t);\n\t}\n\n\trenderYears( viewYear ) {\n\t\t// 12 years in 3 rows for every view\n\t\tlet rows = [ [], [], [] ];\n\t\tlet selectedYear = this.props.selectedDate && this.props.selectedDate.year();\n\n\t\tfor ( let year = viewYear - 1; year < viewYear + 11; year++ ) {\n\t\t\tlet row = this.getRow( rows, year - viewYear );\n\n\t\t\trow.push(\n\t\t\t\tthis.renderYear( year, selectedYear )\n\t\t\t);\n\t\t}\n\n\t\treturn rows.map( (years, i) => (\n\t\t\t{ years }\n\t\t));\n\t}\n\n\trenderYear( year, selectedYear ) {\n\t\tlet className = 'rdtYear';\n\t\tlet onClick;\n\n\t\tif ( this.isDisabledYear( year ) ) {\n\t\t\tclassName += ' rdtDisabled';\n\t\t}\n\t\telse {\n\t\t\tonClick = this._updateSelectedYear;\n\t\t}\n\n\t\tif ( selectedYear === year ) {\n\t\t\tclassName += ' rdtActive';\n\t\t}\n\n\t\tlet props = {key: year, className, 'data-value': year, onClick };\n\n\t\tif ( this.props.renderYear ) {\n\t\t\treturn this.props.renderYear(\n\t\t\t\tprops,\n\t\t\t\tyear,\n\t\t\t\tthis.props.selectedDate && this.props.selectedDate.clone()\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t\n\t\t\t\t{ year }\n\t\t\t\n\t\t);\n\t}\n\n\tgetRow( rows, year ) {\n\t\tif ( year < 3 ) {\n\t\t\treturn rows[0];\n\t\t}\n\t\tif ( year < 7 ) {\n\t\t\treturn rows[1];\n\t\t}\n\n\t\treturn rows[2];\n\t}\n\n\tdisabledYearsCache = {};\n\tisDisabledYear( year ) {\n\t\tlet cache = this.disabledYearsCache;\n\t\tif ( cache[year] !== undefined ) {\n\t\t\treturn cache[year];\n\t\t}\n\n\t\tlet isValidDate = this.props.isValidDate;\n\n\t\tif ( !isValidDate ) {\n\t\t\t// If no validator is set, all days are valid\n\t\t\treturn false;\n\t\t}\n\n\t\t// If one day in the year is valid, the year should be clickable\n\t\tlet date = this.props.viewDate.clone().set({year});\n\t\tlet day = date.endOf( 'year' ).dayOfYear() + 1;\n\n\t\twhile ( day-- > 1 ) {\n\t\t\tif ( isValidDate( date.dayOfYear(day) ) ) {\n\t\t\t\tcache[year] = false;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tcache[year] = true;\n\t\treturn true;\n\t}\n\n\t_updateSelectedYear = event => {\n\t\tthis.props.updateDate( event );\n\t}\n}\n","import React from 'react';\n\nconst timeConstraints = {\n\thours: {\n\t\tmin: 0,\n\t\tmax: 23,\n\t\tstep: 1\n\t},\n\tminutes: {\n\t\tmin: 0,\n\t\tmax: 59,\n\t\tstep: 1\n\t},\n\tseconds: {\n\t\tmin: 0,\n\t\tmax: 59,\n\t\tstep: 1\n\t},\n\tmilliseconds: {\n\t\tmin: 0,\n\t\tmax: 999,\n\t\tstep: 1\n\t}\n};\n\nexport default class TimeView extends React.Component {\n\tconstructor( props ) {\n\t\tsuper( props );\n\n\t\tthis.constraints = this.createConstraints(props);\n\n\t\t// This component buffers the time part values in the state \n\t\t// while the user is pressing down the buttons\n\t\t// and call the prop `setTime` when the buttons are released\n\t\tthis.state = this.getTimeParts( props.selectedDate || props.viewDate );\n\t}\n\n\tcreateConstraints( props ) {\n\t\tlet constraints = {};\n\n\t\tObject.keys( timeConstraints ).forEach( type => {\n\t\t\tconstraints[ type ] = { ...timeConstraints[type], ...(props.timeConstraints[type] || {}) };\n\t\t});\n\n\t\treturn constraints;\n\t}\n\n\trender() {\n\t\tlet items = [];\n\t\tconst timeParts = this.state;\n\t\t\n\t\tthis.getCounters().forEach( (c, i) => {\n\t\t\tif ( i && c !== 'ampm' ) {\n\t\t\t\titems.push(\n\t\t\t\t\t
:
\n\t\t\t\t);\n\t\t\t}\n\n\t\t\titems.push( this.renderCounter(c, timeParts[c]) );\n\t\t});\n\n\t\treturn (\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t{ this.renderHeader() }\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t{ items }\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n\n\trenderCounter( type, value ) {\n\t\tif ( type === 'hours' && this.isAMPM() ) {\n\t\t\tvalue = ( value - 1 ) % 12 + 1;\n\n\t\t\tif ( value === 0 ) {\n\t\t\t\tvalue = 12;\n\t\t\t}\n\t\t}\n\n\t\tif ( type === 'ampm' ) {\n\t\t\tif ( this.props.timeFormat.indexOf(' A') !== -1 ) {\n\t\t\t\tvalue = this.props.viewDate.format('A');\n\t\t\t}\n\t\t\telse {\n\t\t\t\tvalue = this.props.viewDate.format('a');\n\t\t\t}\n\t\t}\n\n\t\treturn (\n\t\t\t
\n\t\t\t\t this.onStartClicking( e, 'increase', type)}>▲\n\t\t\t\t
{ value }
\n\t\t\t\t this.onStartClicking( e, 'decrease', type)}>▼\n\t\t\t
\n\t\t);\n\t}\n\n\trenderHeader() {\n\t\tif ( !this.props.dateFormat ) return;\n\n\t\tconst date = this.props.selectedDate || this.props.viewDate;\n\n\t\treturn (\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t this.props.showView('days') }>\n\t\t\t\t\t\t{ date.format( this.props.dateFormat ) }\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t);\n\t}\n\n\tonStartClicking( e, action, type ) {\n\t\tif ( e && e.button && e.button !== 0 ) {\n\t\t\t// Only left clicks, thanks\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif ( type === 'ampm' ) return this.toggleDayPart();\n\n\t\tlet update = {};\n\t\tlet body = document.body;\n\t\tupdate[ type ] = this[ action ]( type );\n\t\tthis.setState( update );\n\n\t\tthis.timer = setTimeout( () => {\n\t\t\tthis.increaseTimer = setInterval( () => {\n\t\t\t\tupdate[ type ] = this[ action ]( type );\n\t\t\t\tthis.setState( update );\n\t\t\t}, 70);\n\t\t}, 500);\n\n\t\tthis.mouseUpListener = () => {\n\t\t\tclearTimeout( this.timer );\n\t\t\tclearInterval( this.increaseTimer );\n\t\t\tthis.props.setTime( type, parseInt( this.state[ type ], 10 ) );\n\t\t\tbody.removeEventListener( 'mouseup', this.mouseUpListener );\n\t\t\tbody.removeEventListener( 'touchend', this.mouseUpListener );\n\t\t};\n\n\t\tbody.addEventListener( 'mouseup', this.mouseUpListener );\n\t\tbody.addEventListener( 'touchend', this.mouseUpListener );\n\t}\n\n\tpadValues = {\n\t\thours: 1,\n\t\tminutes: 2,\n\t\tseconds: 2,\n\t\tmilliseconds: 3\n\t}\n\n\ttoggleDayPart() {\n\t\tlet hours = parseInt( this.state.hours, 10 );\n\t\t\n\t\tif ( hours >= 12 ) {\n\t\t\thours -= 12;\n\t\t}\n\t\telse {\n\t\t\thours += 12;\n\t\t}\n\n\t\tthis.props.setTime( 'hours', hours );\n\t}\n\n\tincrease( type ) {\n\t\tconst tc = this.constraints[ type ];\n\t\tlet value = parseInt( this.state[ type ], 10) + tc.step;\n\t\tif ( value > tc.max )\n\t\t\tvalue = tc.min + ( value - ( tc.max + 1 ) );\n\t\treturn this.pad( type, value );\n\t}\n\n\tdecrease( type ) {\n\t\tconst tc = this.constraints[ type ];\n\t\tlet value = parseInt( this.state[ type ], 10) - tc.step;\n\t\tif ( value < tc.min )\n\t\t\tvalue = tc.max + 1 - ( tc.min - value );\n\t\treturn this.pad( type, value );\n\t}\n\n\tpad( type, value ) {\n\t\tlet str = value + '';\n\t\twhile ( str.length < this.padValues[ type ] )\n\t\t\tstr = '0' + str;\n\t\treturn str;\n\t}\n\n\tgetCounters() {\n\t\tlet counters = [];\n\t\tlet format = this.props.timeFormat;\n\t\t\n\t\tif ( format.toLowerCase().indexOf('h') !== -1 ) {\n\t\t\tcounters.push('hours');\n\t\t\tif ( format.indexOf('m') !== -1 ) {\n\t\t\t\tcounters.push('minutes');\n\t\t\t\tif ( format.indexOf('s') !== -1 ) {\n\t\t\t\t\tcounters.push('seconds');\n\t\t\t\t\tif ( format.indexOf('S') !== -1 ) {\n\t\t\t\t\t\tcounters.push('milliseconds');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( this.isAMPM() ) {\n\t\t\tcounters.push('ampm');\n\t\t}\n\n\t\treturn counters;\n\t}\n\n\tisAMPM() {\n\t\treturn this.props.timeFormat.toLowerCase().indexOf( ' a' ) !== -1;\n\t}\n\n\tgetTimeParts( date ) {\n\t\tconst hours = date.hours();\n\n\t\treturn {\n\t\t\thours: this.pad( 'hours', hours ),\n\t\t\tminutes: this.pad( 'minutes', date.minutes() ),\n\t\t\tseconds: this.pad( 'seconds', date.seconds() ),\n\t\t\tmilliseconds: this.pad('milliseconds', date.milliseconds() ),\n\t\t\tampm: hours < 12 ? 'am' : 'pm'\n\t\t};\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tif ( this.props.selectedDate ) {\n\t\t\tif ( this.props.selectedDate !== prevProps.selectedDate ) {\n\t\t\t\tthis.setState( this.getTimeParts( this.props.selectedDate ) );\n\t\t\t}\n\t\t}\n\t\telse if ( prevProps.viewDate !== this.props.viewDate ) {\n\t\t\tthis.setState( this.getTimeParts( this.props.viewDate ) );\n\t\t}\n\t}\n}\n","import { Component, createElement } from 'react';\nimport { findDOMNode } from 'react-dom';\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\n/**\n * Check whether some DOM node is our Component's node.\n */\nfunction isNodeFound(current, componentNode, ignoreClass) {\n if (current === componentNode) {\n return true;\n } // SVG elements do not technically reside in the rendered DOM, so\n // they do not have classList directly, but they offer a link to their\n // corresponding element, which can have classList. This extra check is for\n // that case.\n // See: http://www.w3.org/TR/SVG11/struct.html#InterfaceSVGUseElement\n // Discussion: https://github.com/Pomax/react-onclickoutside/pull/17\n\n\n if (current.correspondingElement) {\n return current.correspondingElement.classList.contains(ignoreClass);\n }\n\n return current.classList.contains(ignoreClass);\n}\n/**\n * Try to find our node in a hierarchy of nodes, returning the document\n * node as highest node if our node is not found in the path up.\n */\n\nfunction findHighest(current, componentNode, ignoreClass) {\n if (current === componentNode) {\n return true;\n } // If source=local then this event came from 'somewhere'\n // inside and should be ignored. We could handle this with\n // a layered approach, too, but that requires going back to\n // thinking in terms of Dom node nesting, running counter\n // to React's 'you shouldn't care about the DOM' philosophy.\n\n\n while (current.parentNode) {\n if (isNodeFound(current, componentNode, ignoreClass)) {\n return true;\n }\n\n current = current.parentNode;\n }\n\n return current;\n}\n/**\n * Check if the browser scrollbar was clicked\n */\n\nfunction clickedScrollbar(evt) {\n return document.documentElement.clientWidth <= evt.clientX || document.documentElement.clientHeight <= evt.clientY;\n}\n\n// ideally will get replaced with external dep\n// when rafrex/detect-passive-events#4 and rafrex/detect-passive-events#5 get merged in\nvar testPassiveEventSupport = function testPassiveEventSupport() {\n if (typeof window === 'undefined' || typeof window.addEventListener !== 'function') {\n return;\n }\n\n var passive = false;\n var options = Object.defineProperty({}, 'passive', {\n get: function get() {\n passive = true;\n }\n });\n\n var noop = function noop() {};\n\n window.addEventListener('testPassiveEventSupport', noop, options);\n window.removeEventListener('testPassiveEventSupport', noop, options);\n return passive;\n};\n\nfunction autoInc(seed) {\n if (seed === void 0) {\n seed = 0;\n }\n\n return function () {\n return ++seed;\n };\n}\n\nvar uid = autoInc();\n\nvar passiveEventSupport;\nvar handlersMap = {};\nvar enabledInstances = {};\nvar touchEvents = ['touchstart', 'touchmove'];\nvar IGNORE_CLASS_NAME = 'ignore-react-onclickoutside';\n/**\n * Options for addEventHandler and removeEventHandler\n */\n\nfunction getEventHandlerOptions(instance, eventName) {\n var handlerOptions = null;\n var isTouchEvent = touchEvents.indexOf(eventName) !== -1;\n\n if (isTouchEvent && passiveEventSupport) {\n handlerOptions = {\n passive: !instance.props.preventDefault\n };\n }\n\n return handlerOptions;\n}\n/**\n * This function generates the HOC function that you'll use\n * in order to impart onOutsideClick listening to an\n * arbitrary component. It gets called at the end of the\n * bootstrapping code to yield an instance of the\n * onClickOutsideHOC function defined inside setupHOC().\n */\n\n\nfunction onClickOutsideHOC(WrappedComponent, config) {\n var _class, _temp;\n\n var componentName = WrappedComponent.displayName || WrappedComponent.name || 'Component';\n return _temp = _class =\n /*#__PURE__*/\n function (_Component) {\n _inheritsLoose(onClickOutside, _Component);\n\n function onClickOutside(props) {\n var _this;\n\n _this = _Component.call(this, props) || this;\n\n _this.__outsideClickHandler = function (event) {\n if (typeof _this.__clickOutsideHandlerProp === 'function') {\n _this.__clickOutsideHandlerProp(event);\n\n return;\n }\n\n var instance = _this.getInstance();\n\n if (typeof instance.props.handleClickOutside === 'function') {\n instance.props.handleClickOutside(event);\n return;\n }\n\n if (typeof instance.handleClickOutside === 'function') {\n instance.handleClickOutside(event);\n return;\n }\n\n throw new Error(\"WrappedComponent: \" + componentName + \" lacks a handleClickOutside(event) function for processing outside click events.\");\n };\n\n _this.__getComponentNode = function () {\n var instance = _this.getInstance();\n\n if (config && typeof config.setClickOutsideRef === 'function') {\n return config.setClickOutsideRef()(instance);\n }\n\n if (typeof instance.setClickOutsideRef === 'function') {\n return instance.setClickOutsideRef();\n }\n\n return findDOMNode(instance);\n };\n\n _this.enableOnClickOutside = function () {\n if (typeof document === 'undefined' || enabledInstances[_this._uid]) {\n return;\n }\n\n if (typeof passiveEventSupport === 'undefined') {\n passiveEventSupport = testPassiveEventSupport();\n }\n\n enabledInstances[_this._uid] = true;\n var events = _this.props.eventTypes;\n\n if (!events.forEach) {\n events = [events];\n }\n\n handlersMap[_this._uid] = function (event) {\n if (_this.componentNode === null) return;\n\n if (_this.props.preventDefault) {\n event.preventDefault();\n }\n\n if (_this.props.stopPropagation) {\n event.stopPropagation();\n }\n\n if (_this.props.excludeScrollbar && clickedScrollbar(event)) return;\n var current = event.target;\n\n if (findHighest(current, _this.componentNode, _this.props.outsideClickIgnoreClass) !== document) {\n return;\n }\n\n _this.__outsideClickHandler(event);\n };\n\n events.forEach(function (eventName) {\n document.addEventListener(eventName, handlersMap[_this._uid], getEventHandlerOptions(_this, eventName));\n });\n };\n\n _this.disableOnClickOutside = function () {\n delete enabledInstances[_this._uid];\n var fn = handlersMap[_this._uid];\n\n if (fn && typeof document !== 'undefined') {\n var events = _this.props.eventTypes;\n\n if (!events.forEach) {\n events = [events];\n }\n\n events.forEach(function (eventName) {\n return document.removeEventListener(eventName, fn, getEventHandlerOptions(_this, eventName));\n });\n delete handlersMap[_this._uid];\n }\n };\n\n _this.getRef = function (ref) {\n return _this.instanceRef = ref;\n };\n\n _this._uid = uid();\n return _this;\n }\n /**\n * Access the WrappedComponent's instance.\n */\n\n\n var _proto = onClickOutside.prototype;\n\n _proto.getInstance = function getInstance() {\n if (!WrappedComponent.prototype.isReactComponent) {\n return this;\n }\n\n var ref = this.instanceRef;\n return ref.getInstance ? ref.getInstance() : ref;\n };\n\n /**\n * Add click listeners to the current document,\n * linked to this component's state.\n */\n _proto.componentDidMount = function componentDidMount() {\n // If we are in an environment without a DOM such\n // as shallow rendering or snapshots then we exit\n // early to prevent any unhandled errors being thrown.\n if (typeof document === 'undefined' || !document.createElement) {\n return;\n }\n\n var instance = this.getInstance();\n\n if (config && typeof config.handleClickOutside === 'function') {\n this.__clickOutsideHandlerProp = config.handleClickOutside(instance);\n\n if (typeof this.__clickOutsideHandlerProp !== 'function') {\n throw new Error(\"WrappedComponent: \" + componentName + \" lacks a function for processing outside click events specified by the handleClickOutside config option.\");\n }\n }\n\n this.componentNode = this.__getComponentNode(); // return early so we dont initiate onClickOutside\n\n if (this.props.disableOnClickOutside) return;\n this.enableOnClickOutside();\n };\n\n _proto.componentDidUpdate = function componentDidUpdate() {\n this.componentNode = this.__getComponentNode();\n };\n /**\n * Remove all document's event listeners for this component\n */\n\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.disableOnClickOutside();\n };\n /**\n * Can be called to explicitly enable event listening\n * for clicks and touches outside of this element.\n */\n\n\n /**\n * Pass-through render\n */\n _proto.render = function render() {\n // eslint-disable-next-line no-unused-vars\n var _props = this.props,\n excludeScrollbar = _props.excludeScrollbar,\n props = _objectWithoutProperties(_props, [\"excludeScrollbar\"]);\n\n if (WrappedComponent.prototype.isReactComponent) {\n props.ref = this.getRef;\n } else {\n props.wrappedRef = this.getRef;\n }\n\n props.disableOnClickOutside = this.disableOnClickOutside;\n props.enableOnClickOutside = this.enableOnClickOutside;\n return createElement(WrappedComponent, props);\n };\n\n return onClickOutside;\n }(Component), _class.displayName = \"OnClickOutside(\" + componentName + \")\", _class.defaultProps = {\n eventTypes: ['mousedown', 'touchstart'],\n excludeScrollbar: config && config.excludeScrollbar || false,\n outsideClickIgnoreClass: IGNORE_CLASS_NAME,\n preventDefault: false,\n stopPropagation: false\n }, _class.getClass = function () {\n return WrappedComponent.getClass ? WrappedComponent.getClass() : WrappedComponent;\n }, _temp;\n}\n\nexport { IGNORE_CLASS_NAME };\nexport default onClickOutsideHOC;\n","import PropTypes from 'prop-types';\nimport moment from 'moment';\nimport React from 'react';\nimport DaysView from './DaysView';\nimport MonthsView from './MonthsView';\nimport YearsView from './YearsView';\nimport TimeView from './TimeView';\nimport onClickOutside from 'react-onclickoutside';\n\nconst viewModes = {\n\tYEARS: 'years',\n\tMONTHS: 'months',\n\tDAYS: 'days',\n\tTIME: 'time',\n};\n\nconst TYPES = PropTypes;\nconst nofn = function () {};\nconst datetype = TYPES.oneOfType([ TYPES.instanceOf(moment), TYPES.instanceOf(Date), TYPES.string ]);\n\nexport default class Datetime extends React.Component {\n\tstatic propTypes = {\n\t\tvalue: datetype,\n\t\tinitialValue: datetype,\n\t\tinitialViewDate: datetype,\n\t\tinitialViewMode: TYPES.oneOf([viewModes.YEARS, viewModes.MONTHS, viewModes.DAYS, viewModes.TIME]),\n\t\tonOpen: TYPES.func,\n\t\tonClose: TYPES.func,\n\t\tonChange: TYPES.func,\n\t\tonNavigate: TYPES.func,\n\t\tonBeforeNavigate: TYPES.func,\n\t\tonNavigateBack: TYPES.func,\n\t\tonNavigateForward: TYPES.func,\n\t\tupdateOnView: TYPES.string,\n\t\tlocale: TYPES.string,\n\t\tutc: TYPES.bool,\n\t\tdisplayTimeZone: TYPES.string,\n\t\tinput: TYPES.bool,\n\t\tdateFormat: TYPES.oneOfType([TYPES.string, TYPES.bool]),\n\t\ttimeFormat: TYPES.oneOfType([TYPES.string, TYPES.bool]),\n\t\tinputProps: TYPES.object,\n\t\ttimeConstraints: TYPES.object,\n\t\tisValidDate: TYPES.func,\n\t\topen: TYPES.bool,\n\t\tstrictParsing: TYPES.bool,\n\t\tcloseOnSelect: TYPES.bool,\n\t\tcloseOnTab: TYPES.bool,\n\t\trenderView: TYPES.func,\n\t\trenderInput: TYPES.func,\n\t\trenderDay: TYPES.func,\n\t\trenderMonth: TYPES.func,\n\t\trenderYear: TYPES.func,\n\t}\n\n\tstatic defaultProps = {\n\t\tonOpen: nofn,\n\t\tonClose: nofn,\n\t\tonCalendarOpen: nofn,\n\t\tonCalendarClose: nofn,\n\t\tonChange: nofn,\n\t\tonNavigate: nofn,\n\t\tonBeforeNavigate: function(next) { return next; }, \n\t\tonNavigateBack: nofn,\n\t\tonNavigateForward: nofn,\n\t\tdateFormat: true,\n\t\ttimeFormat: true,\n\t\tutc: false,\n\t\tclassName: '',\n\t\tinput: true,\n\t\tinputProps: {},\n\t\ttimeConstraints: {},\n\t\tisValidDate: function() { return true; },\n\t\tstrictParsing: true,\n\t\tcloseOnSelect: false,\n\t\tcloseOnTab: true,\n\t\tcloseOnClickOutside: true\n\t}\n\n\t// Make moment accessible through the Datetime class\n\tstatic moment = moment;\n\n\tconstructor( props ) {\n\t\tsuper( props );\n\t\tthis.state = this.getInitialState( props );\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t\n\t\t\t\t{ this.renderInput() }\n\t\t\t\t
\n\t\t\t\t\t{ this.renderView( this.state.currentView, this._renderCalendar ) }\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n\n\trenderInput() {\n\t\tif ( !this.props.input ) return;\n\n\t\tconst finalInputProps = {\n\t\t\ttype: 'text',\n\t\t\tclassName: 'form-control',\n\t\t\tvalue: this.getInputValue(),\n\t\t\t...this.props.inputProps,\n\t\t\tonFocus: this._onInputFocus,\n\t\t\tonChange: this._onInputChange,\n\t\t\tonKeyDown: this._onInputKeyDown,\n\t\t\tonClick: this._onInputClick\n\t\t};\n\n\t\tif ( this.props.renderInput ) { \n\t\t\treturn (\n\t\t\t\t
\n\t\t\t\t\t{ this.props.renderInput( finalInputProps, this._openCalendar, this._closeCalendar ) }\n\t\t\t\t
\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t\n\t\t);\n\t}\n\n\trenderView( currentView, renderer ) {\n\t\tif ( this.props.renderView ) {\n\t\t\treturn this.props.renderView( currentView, () => renderer(currentView) );\n\t\t}\n\t\treturn renderer( this.state.currentView );\n\t}\n\n\t_renderCalendar = currentView => {\n\t\tconst props = this.props;\n\t\tconst state = this.state;\n\n\t\tlet viewProps = {\n\t\t\tviewDate: state.viewDate.clone(),\n\t\t\tselectedDate: this.getSelectedDate(),\n\t\t\tisValidDate: props.isValidDate,\n\t\t\tupdateDate: this._updateDate,\n\t\t\tnavigate: this._viewNavigate,\n\t\t\tmoment: moment,\n\t\t\tshowView: this._showView\n\t\t};\n\n\t\t// Probably updateOn, updateSelectedDate and setDate can be merged in the same method\n\t\t// that would update viewDate or selectedDate depending on the view and the dateFormat\n\t\tswitch ( currentView ) {\n\t\t\tcase viewModes.YEARS:\n\t\t\t\t// Used viewProps\n\t\t\t\t// { viewDate, selectedDate, renderYear, isValidDate, navigate, showView, updateDate }\n\t\t\t\tviewProps.renderYear = props.renderYear;\n\t\t\t\treturn ;\n\t\t\t\n\t\t\tcase viewModes.MONTHS:\n\t\t\t\t// { viewDate, selectedDate, renderMonth, isValidDate, navigate, showView, updateDate }\n\t\t\t\tviewProps.renderMonth = props.renderMonth;\n\t\t\t\treturn ;\n\t\t\t\n\t\t\tcase viewModes.DAYS:\n\t\t\t\t// { viewDate, selectedDate, renderDay, isValidDate, navigate, showView, updateDate, timeFormat \n\t\t\t\tviewProps.renderDay = props.renderDay;\n\t\t\t\tviewProps.timeFormat = this.getFormat('time');\n\t\t\t\treturn ;\n\t\t\t\n\t\t\tdefault:\n\t\t\t\t// { viewDate, selectedDate, timeFormat, dateFormat, timeConstraints, setTime, showView }\n\t\t\t\tviewProps.dateFormat = this.getFormat('date');\n\t\t\t\tviewProps.timeFormat = this.getFormat('time');\n\t\t\t\tviewProps.timeConstraints = props.timeConstraints;\n\t\t\t\tviewProps.setTime = this._setTime;\n\t\t\t\treturn ;\n\t\t}\n\t}\n\n\tgetInitialState( p ) {\n\t\tlet props = p || this.props;\n\t\tlet inputFormat = this.getFormat('datetime');\n\t\tlet selectedDate = this.parseDate( props.value || props.initialValue, inputFormat );\n\n\t\tthis.checkTZ( props );\n\n\t\treturn {\n\t\t\topen: !props.input,\n\t\t\tcurrentView: props.initialViewMode || this.getInitialView( this.getFormat('date') ),\n\t\t\tviewDate: this.getInitialViewDate( props.initialViewDate, selectedDate, inputFormat ),\n\t\t\tselectedDate: selectedDate && selectedDate.isValid() ? selectedDate : undefined,\n\t\t\tinputValue: this.getInitialInputValue( props, selectedDate, inputFormat )\n\t\t};\n\t}\n\t\n\tgetInitialViewDate( propDate, selectedDate, format ) {\n\t\tlet viewDate;\n\t\tif ( propDate ) {\n\t\t\tviewDate = this.parseDate( propDate, format );\n\t\t\tif ( viewDate && viewDate.isValid() ) {\n\t\t\t\treturn viewDate;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.log('The initialViewDated given \"' + propDate + '\" is not valid. Using current date instead.');\n\t\t\t}\n\t\t}\n\t\telse if ( selectedDate && selectedDate.isValid() ) {\n\t\t\treturn selectedDate.clone();\n\t\t}\n\t\treturn this.getInitialDate();\n\t}\n\n\tgetInitialDate() {\n\t\tlet m = this.localMoment();\n\t\tm.hour(0).minute(0).second(0).millisecond(0);\n\t\treturn m;\n\t}\n\n\tgetInitialView( dateFormat ) {\n\t\tif ( !dateFormat ) return viewModes.TIME;\n\t\treturn this.getUpdateOn( dateFormat );\n\t}\n\n\tparseDate(date, dateFormat) {\n\t\tlet parsedDate;\n\n\t\tif (date && typeof date === 'string')\n\t\t\tparsedDate = this.localMoment(date, dateFormat);\n\t\telse if (date)\n\t\t\tparsedDate = this.localMoment(date);\n\n\t\tif (parsedDate && !parsedDate.isValid())\n\t\t\tparsedDate = null;\n\n\t\treturn parsedDate;\n\t}\n\n\tgetClassName() {\n\t\tlet cn = 'rdt';\n\t\tlet props = this.props;\n\t\tlet propCn = props.className;\n\n\t\tif ( Array.isArray( propCn ) ) {\n\t\t\tcn += ' ' + propCn.join(' ');\n\t\t}\n\t\telse if ( propCn ) {\n\t\t\tcn += ' ' + propCn;\n\t\t}\n\n\t\tif ( !props.input ) {\n\t\t\tcn += ' rdtStatic';\n\t\t}\n\t\tif ( this.isOpen() ) {\n\t\t\tcn += ' rdtOpen';\n\t\t}\n\n\t\treturn cn;\n\t}\n\t\n\tisOpen() {\n\t\treturn !this.props.input || (this.props.open === undefined ? this.state.open : this.props.open);\n\t}\n\n\tgetUpdateOn( dateFormat ) {\n\t\tif ( this.props.updateOnView ) {\n\t\t\treturn this.props.updateOnView;\n\t\t}\n\n\t\tif ( dateFormat.match(/[lLD]/) ) {\n\t\t\treturn viewModes.DAYS;\n\t\t}\n\n\t\tif ( dateFormat.indexOf('M') !== -1 ) {\n\t\t\treturn viewModes.MONTHS;\n\t\t}\n\n\t\tif ( dateFormat.indexOf('Y') !== -1 ) {\n\t\t\treturn viewModes.YEARS;\n\t\t}\n\n\t\treturn viewModes.DAYS;\n\t}\n\n\tgetLocaleData( props ) {\n\t\tlet p = props || this.props;\n\t\treturn this.localMoment( p.value || p.defaultValue || new Date() ).localeData();\n\t}\n\n\tgetDateFormat( locale ) {\n\t\tlet format = this.props.dateFormat;\n\t\tif ( format === true ) return locale.longDateFormat('L');\n\t\tif ( format ) return format;\n\t\treturn '';\n\t}\n\n\tgetTimeFormat( locale ) {\n\t\tlet format = this.props.timeFormat;\n\t\tif ( format === true ) {\n\t\t\treturn locale.longDateFormat('LT');\n\t\t}\n\t\treturn format || '';\n\t}\n\n\tgetFormat( type ) {\n\t\tif ( type === 'date' ) {\n\t\t\treturn this.getDateFormat( this.getLocaleData() );\n\t\t}\n\t\telse if ( type === 'time' ) {\n\t\t\treturn this.getTimeFormat( this.getLocaleData() );\n\t\t}\n\t\t\n\t\tlet locale = this.getLocaleData();\n\t\tlet dateFormat = this.getDateFormat( locale );\n\t\tlet timeFormat = this.getTimeFormat( locale );\n\t\treturn dateFormat && timeFormat ? dateFormat + ' ' + timeFormat : (dateFormat || timeFormat );\n\t}\n\n\t_showView = ( view, date ) => {\n\t\tconst d = ( date || this.state.viewDate ).clone();\n\t\tconst nextView = this.props.onBeforeNavigate( view, this.state.currentView, d );\n\n\t\tif ( nextView && this.state.currentView !== nextView ) {\n\t\t\tthis.props.onNavigate( nextView );\n\t\t\tthis.setState({ currentView: nextView });\n\t\t}\n\t}\n\n\tupdateTime( op, amount, type, toSelected ) {\n\t\tlet update = {};\n\t\tconst date = toSelected ? 'selectedDate' : 'viewDate';\n\n\t\tupdate[ date ] = this.state[ date ].clone()[ op ]( amount, type );\n\n\t\tthis.setState( update );\n\t}\n\n\tviewToMethod = {days: 'date', months: 'month', years: 'year'};\n\tnextView = { days: 'time', months: 'days', years: 'months'};\n\t_updateDate = e => {\n\t\tlet state = this.state;\n\t\tlet currentView = state.currentView;\n\t\tlet updateOnView = this.getUpdateOn( this.getFormat('date') );\n\t\tlet viewDate = this.state.viewDate.clone();\n\n\t\t// Set the value into day/month/year\n\t\tviewDate[ this.viewToMethod[currentView] ](\n\t\t\tparseInt( e.target.getAttribute('data-value'), 10 )\n\t\t);\n\n\t\t// Need to set month and year will for days view (prev/next month)\n\t\tif ( currentView === 'days' ) {\n\t\t\tviewDate.month( parseInt( e.target.getAttribute('data-month'), 10 ) );\n\t\t\tviewDate.year( parseInt( e.target.getAttribute('data-year'), 10 ) );\n\t\t}\n\n\t\tlet update = {viewDate: viewDate};\n\t\tif ( currentView === updateOnView ) {\n\t\t\tupdate.selectedDate = viewDate.clone();\n\t\t\tupdate.inputValue = viewDate.format( this.getFormat('datetime') );\n\n\t\t\tif ( this.props.open === undefined && this.props.input && this.props.closeOnSelect ) {\n\t\t\t\tthis._closeCalendar();\n\t\t\t}\n\n\t\t\tthis.props.onChange( viewDate.clone() );\n\t\t}\n\t\telse {\n\t\t\tthis._showView( this.nextView[ currentView ], viewDate );\n\t\t}\n\n\t\tthis.setState( update );\n\t}\n\n\t_viewNavigate = ( modifier, unit ) => {\n\t\tlet viewDate = this.state.viewDate.clone();\n\t\t\n\t\t// Subtracting is just adding negative time\n\t\tviewDate.add( modifier, unit );\n\n\t\tif ( modifier > 0 ) {\n\t\t\tthis.props.onNavigateForward( modifier, unit );\n\t\t}\n\t\telse {\n\t\t\tthis.props.onNavigateBack( -(modifier), unit );\n\t\t}\n\n\t\tthis.setState({viewDate});\n\t}\n\t\n\t_setTime = ( type, value ) => {\n\t\tlet date = (this.getSelectedDate() || this.state.viewDate).clone();\n\t\t\n\t\tdate[ type ]( value );\n\n\t\tif ( !this.props.value ) {\n\t\t\tthis.setState({\n\t\t\t\tselectedDate: date,\n\t\t\t\tviewDate: date.clone(),\n\t\t\t\tinputValue: date.format( this.getFormat('datetime') )\n\t\t\t});\n\t\t}\n\n\t\tthis.props.onChange( date );\n\t}\n\n\t_openCalendar = () => {\n\t\tif ( this.isOpen() ) return;\n\t\tthis.setState({open: true}, this.props.onOpen );\n\t}\n\n\t_closeCalendar = () => {\n\t\tif ( !this.isOpen() ) return;\n\n\t\tthis.setState({open: false}, () => {\n\t\t\t this.props.onClose( this.state.selectedDate || this.state.inputValue );\n\t\t});\n\t}\n\n\t_handleClickOutside = () => {\n\t\tlet props = this.props;\n\n\t\tif ( props.input && this.state.open && props.open === undefined && props.closeOnClickOutside ) {\n\t\t\tthis._closeCalendar();\n\t\t}\n\t}\n\n\tlocalMoment( date, format, props ) {\n\t\tprops = props || this.props;\n\t\tlet m = null;\n\n\t\tif (props.utc) {\n\t\t\tm = moment.utc(date, format, props.strictParsing);\n\t\t} else if (props.displayTimeZone) {\n\t\t\tm = moment.tz(date, format, props.displayTimeZone);\n\t\t} else {\n\t\t\tm = moment(date, format, props.strictParsing);\n\t\t}\n\n\t\tif ( props.locale )\n\t\t\tm.locale( props.locale );\n\t\treturn m;\n\t}\n\n\tcheckTZ( props ) {\n\t\tif ( props.displayTimeZone && !this.tzWarning && !moment.tz ) {\n\t\t\tthis.tzWarning = true;\n\t\t\tthis.log('displayTimeZone prop with value \"' + props.displayTimeZone + '\" is used but moment.js timezone is not loaded.', 'error');\n\t\t}\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tif ( prevProps === this.props ) return;\n\n\t\tlet needsUpdate = false;\n\t\tlet thisProps = this.props;\n\n\t\t['locale', 'utc', 'displayZone', 'dateFormat', 'timeFormat'].forEach( function(p) {\n\t\t\tprevProps[p] !== thisProps[p] && (needsUpdate = true);\n\t\t});\n\n\t\tif ( needsUpdate ) {\n\t\t\tthis.regenerateDates( this.props );\n\t\t}\n\n\t\tif ( thisProps.value && thisProps.value !== prevProps.value ) {\n\t\t\tthis.setViewDate( thisProps.value );\n\t\t}\n\n\t\tthis.checkTZ( this.props );\n\t}\n\n\tregenerateDates(props) {\n\t\tlet viewDate = this.state.viewDate.clone();\n\t\tlet selectedDate = this.state.selectedDate && this.state.selectedDate.clone();\n\n\t\tif ( props.locale ) {\n\t\t\tviewDate.locale( props.locale );\n\t\t\tselectedDate &&\tselectedDate.locale( props.locale );\n\t\t}\n\t\tif ( props.utc ) {\n\t\t\tviewDate.utc();\n\t\t\tselectedDate &&\tselectedDate.utc();\n\t\t}\n\t\telse if ( props.displayTimeZone ) {\n\t\t\tviewDate.tz( props.displayTimeZone );\n\t\t\tselectedDate &&\tselectedDate.tz( props.displayTimeZone );\n\t\t}\n\t\telse {\n\t\t\tviewDate.locale();\n\t\t\tselectedDate &&\tselectedDate.locale();\n\t\t}\n\n\t\tlet update = { viewDate: viewDate, selectedDate: selectedDate};\n\t\tif ( selectedDate && selectedDate.isValid() ) {\n\t\t\tupdate.inputValue = selectedDate.format( this.getFormat('datetime') );\n\t\t}\n\t\t\n\t\tthis.setState( update );\n\t}\n\n\tgetSelectedDate() {\n\t\tif ( this.props.value === undefined ) return this.state.selectedDate;\n\t\tlet selectedDate = this.parseDate( this.props.value, this.getFormat('datetime') );\n\t\treturn selectedDate && selectedDate.isValid() ? selectedDate : false;\n\t}\n\n\tgetInitialInputValue( props, selectedDate, inputFormat ) {\n\t\tif ( props.inputProps.value )\n\t\t\treturn props.inputProps.value;\n\t\t\n\t\tif ( selectedDate && selectedDate.isValid() )\n\t\t\treturn selectedDate.format( inputFormat );\n\t\t\n\t\tif ( props.value && typeof props.value === 'string' )\n\t\t\treturn props.value;\n\t\t\n\t\tif ( props.initialValue && typeof props.initialValue === 'string' )\n\t\t\treturn props.initialValue;\n\t\t\n\t\treturn '';\n\t}\n\n\tgetInputValue() {\n\t\tlet selectedDate = this.getSelectedDate();\n\t\treturn selectedDate ? selectedDate.format( this.getFormat('datetime') ) : this.state.inputValue;\n\t}\n\n\t/**\n\t * Set the date that is currently shown in the calendar.\n\t * This is independent from the selected date and it's the one used to navigate through months or days in the calendar.\n\t * @param dateType date\n\t * @public\n\t */\n\tsetViewDate( date ) {\n\t\tlet me = this;\n\t\tlet logError = function() {\n\t\t\treturn me.log( 'Invalid date passed to the `setViewDate` method: ' + date );\n\t\t};\n\n\t\tif ( !date ) return logError();\n\t\t\n\t\tlet viewDate;\n\t\tif ( typeof date === 'string' ) {\n\t\t\tviewDate = this.localMoment(date, this.getFormat('datetime') );\n\t\t}\n\t\telse {\n\t\t\tviewDate = this.localMoment( date );\n\t\t}\n\n\t\tif ( !viewDate || !viewDate.isValid() ) return logError();\n\t\tthis.setState({ viewDate: viewDate });\n\t}\n\n\t/**\n\t * Set the view currently shown by the calendar. View modes shipped with react-datetime are 'years', 'months', 'days' and 'time'.\n\t * @param TYPES.string mode \n\t */\n\tnavigate( mode ) {\n\t\tthis._showView( mode );\n\t}\n\n\tlog( message, method ) {\n\t\tlet con = typeof window !== 'undefined' && window.console;\n\t\tif ( !con ) return;\n\n\t\tif ( !method ) {\n\t\t\tmethod = 'warn';\n\t\t}\n\t\tcon[ method ]( '***react-datetime:' + message );\n\t}\n\n\t_onInputFocus = e => {\n\t\tif ( !this.callHandler( this.props.inputProps.onFocus, e ) ) return;\n\t\tthis._openCalendar();\n\t}\n\n\t_onInputChange = e => {\n\t\tif ( !this.callHandler( this.props.inputProps.onChange, e ) ) return;\n\n\t\tconst value = e.target ? e.target.value : e;\n\t\tconst localMoment = this.localMoment( value, this.getFormat('datetime') );\n\t\tlet update = { inputValue: value };\n\n\t\tif ( localMoment.isValid() ) {\n\t\t\tupdate.selectedDate = localMoment;\n\t\t\tupdate.viewDate = localMoment.clone().startOf('month');\n\t\t}\n\t\telse {\n\t\t\tupdate.selectedDate = null;\n\t\t}\n\n\t\tthis.setState( update, () => {\n\t\t\tthis.props.onChange( localMoment.isValid() ? localMoment : this.state.inputValue );\n\t\t});\n\t}\n\n\t_onInputKeyDown = e => {\n\t\tif ( !this.callHandler( this.props.inputProps.onKeyDown, e ) ) return;\n\n\t\tif ( e.which === 9 && this.props.closeOnTab ) {\n\t\t\tthis._closeCalendar();\n\t\t}\n\t}\n\n\t_onInputClick = e => {\n\t\t// Focus event should open the calendar, but there is some case where\n\t\t// the input is already focused and the picker is closed, so clicking the input\n\t\t// should open it again see https://github.com/arqex/react-datetime/issues/717\n\t\tconsole.log('CLICKING 2!');\n\t\tif ( !this.callHandler( this.props.inputProps.onClick, e ) ) return;\n\t\tthis._openCalendar();\n\t}\n\n\tcallHandler( method, e ) {\n\t\tif ( !method ) return true;\n\t\treturn method(e) !== false;\n\t}\n}\n\nclass ClickOutBase extends React.Component {\n\tcontainer = React.createRef();\n\n\trender() {\n\t\treturn (\n\t\t\t
\n\t\t\t\t{ this.props.children }\n\t\t\t
\n\t\t);\n\t}\n\thandleClickOutside(e) {\n\t\tthis.props.onClickOut( e );\n\t}\n\n\tsetClickOutsideRef() {\n\t\treturn this.container.current;\n\t}\n}\n\nconst ClickableWrapper = onClickOutside( ClickOutBase );\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://Datetime/webpack/bootstrap","webpack://Datetime/external \"react\"","webpack://Datetime/external \"moment\"","webpack://Datetime/./node_modules/prop-types/index.js","webpack://Datetime/external \"react-dom\"","webpack://Datetime/./node_modules/prop-types/factoryWithThrowingShims.js","webpack://Datetime/./node_modules/prop-types/lib/ReactPropTypesSecret.js","webpack://Datetime/./src/parts/ViewNavigation.js","webpack://Datetime/./src/views/DaysView.js","webpack://Datetime/./src/views/MonthsView.js","webpack://Datetime/./src/views/YearsView.js","webpack://Datetime/./src/views/TimeView.js","webpack://Datetime/./node_modules/react-onclickoutside/dist/react-onclickoutside.es.js","webpack://Datetime/./src/DateTime.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","require","ReactPropTypesSecret","emptyFunction","emptyFunctionWithReset","resetWarningCache","shim","props","propName","componentName","location","propFullName","secret","err","Error","getShim","isRequired","ReactPropTypes","array","bool","func","number","string","symbol","any","arrayOf","element","elementType","instanceOf","node","objectOf","oneOf","oneOfType","shape","exact","checkPropTypes","PropTypes","ViewNavigation","onClickPrev","onClickSwitch","onClickNext","switchContent","switchColSpan","switchProps","className","onClick","colSpan","DaysView","e","updateDate","this","renderNavigation","renderDayHeaders","renderDays","renderFooter","date","viewDate","locale","localeData","navigate","showView","months","year","month","dayItems","first","firstDayOfWeek","dow","_weekdaysMin","forEach","day","getDaysOfWeek","map","index","startOfMonth","clone","startOf","endOfMonth","endOf","rows","startDate","subtract","daysInMonth","endDate","add","isBefore","getRow","push","renderDay","selectedDate","dayProps","format","isAfter","isSame","moment","isValidDate","_setDate","timeFormat","React","Component","Math","floor","MonthsView","event","renderMonths","renderMonth","isDisabledMonth","_updateSelectedMonth","getMonthText","set","str","localMoment","monthStr","monthsShort","substring","charAt","toUpperCase","slice","YearsView","renderYears","viewYear","getViewYear","renderYear","years","selectedYear","getSelectedYear","isDisabledYear","_updateSelectedYear","parseInt","cache","disabledYearsCache","undefined","dayOfYear","timeConstraints","hours","min","max","step","minutes","seconds","milliseconds","TimeView","overrideTimeConstraints","constraints","keys","type","state","getTimeParts","items","timeParts","getCounters","renderCounter","renderHeader","isAMPM","indexOf","onMouseDown","onStartClicking","dateFormat","action","button","toggleDayPart","update","body","document","setState","timer","setTimeout","increaseTimer","setInterval","mouseUpListener","clearTimeout","clearInterval","setTime","removeEventListener","addEventListener","tc","pad","counters","toLowerCase","ampm","prevProps","padValues","length","isNodeFound","current","componentNode","ignoreClass","correspondingElement","classList","contains","seed","passiveEventSupport","uid","handlersMap","enabledInstances","touchEvents","getEventHandlerOptions","instance","eventName","handlerOptions","passive","preventDefault","WrappedComponent","config","_class","_temp","displayName","_Component","subClass","superClass","onClickOutside","_this","__outsideClickHandler","__clickOutsideHandlerProp","getInstance","handleClickOutside","__getComponentNode","setClickOutsideRef","enableOnClickOutside","_uid","window","options","noop","testPassiveEventSupport","events","eventTypes","evt","stopPropagation","excludeScrollbar","documentElement","clientWidth","clientX","clientHeight","clientY","parentNode","findHighest","target","outsideClickIgnoreClass","disableOnClickOutside","fn","getRef","ref","instanceRef","constructor","__proto__","_proto","isReactComponent","componentDidMount","createElement","componentDidUpdate","componentWillUnmount","render","_props","source","excluded","sourceKeys","getOwnPropertySymbols","sourceSymbolKeys","propertyIsEnumerable","_objectWithoutProperties","wrappedRef","defaultProps","getClass","viewModes","TYPES","nofn","datetype","Date","Datetime","viewProps","getSelectedDate","_updateDate","_viewNavigate","_showView","currentView","getFormat","_setTime","view","nextView","onBeforeNavigate","onNavigate","days","updateOnView","getUpdateOn","viewToMethod","getAttribute","inputValue","open","input","closeOnSelect","_closeCalendar","onChange","modifier","unit","onNavigateForward","onNavigateBack","isOpen","onOpen","onClose","closeOnClickOutside","callHandler","inputProps","onFocus","_openCalendar","isValid","onKeyDown","which","closeOnTab","getInitialState","ClickableWrapper","getClassName","onClickOut","_handleClickOutside","renderInput","renderView","finalInputProps","getInputValue","_onInputFocus","_onInputChange","_onInputKeyDown","_onInputClick","_renderCalendar","inputFormat","parseDate","initialValue","checkTZ","initialViewMode","getInitialView","getInitialViewDate","getInitialInputValue","propDate","initialViewDate","log","getInitialDate","hour","minute","second","millisecond","parsedDate","cn","propCn","Array","isArray","join","match","defaultValue","getLocaleData","longDateFormat","getDateFormat","getTimeFormat","op","amount","toSelected","utc","strictParsing","displayTimeZone","tz","tzWarning","needsUpdate","thisProps","regenerateDates","setViewDate","me","logError","method","message","con","console","onCalendarOpen","onCalendarClose","next","_","renderFunc","createRef","container","children"],"mappings":"2BACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QA0Df,OArDAF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OA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U9L,Y,GAfGtF,IAAMC","file":"react-datetime.cjs.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 4);\n","module.exports = require(\"react\");","module.exports = require(\"moment\");","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nif (process.env.NODE_ENV !== 'production') {\n var ReactIs = require('react-is');\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(ReactIs.isElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}\n","module.exports = require(\"react-dom\");","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n\nfunction emptyFunction() {}\nfunction emptyFunctionWithReset() {}\nemptyFunctionWithReset.resetWarningCache = emptyFunction;\n\nmodule.exports = function() {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret) {\n // It is still safe when called from React.\n return;\n }\n var err = new Error(\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n err.name = 'Invariant Violation';\n throw err;\n };\n shim.isRequired = shim;\n function getShim() {\n return shim;\n };\n // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n var ReactPropTypes = {\n array: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n\n any: shim,\n arrayOf: getShim,\n element: shim,\n elementType: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim,\n exact: getShim,\n\n checkPropTypes: emptyFunctionWithReset,\n resetWarningCache: emptyFunction\n };\n\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n","import React from 'react';\n\nexport default function ViewNavigation( { onClickPrev, onClickSwitch, onClickNext, switchContent, switchColSpan, switchProps } ) {\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t{ switchContent }\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t);\n}\n","import React from 'react';\nimport ViewNavigation from '../parts/ViewNavigation';\n\nexport default class DaysView extends React.Component {\n\tstatic defaultProps = {\n\t\tisValidDate: () => true,\n\t\trenderDay: ( props, date ) => { date.date() },\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{ this.renderNavigation() }\n\t\t\t\t\t\t{ this.renderDayHeaders() }\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{ this.renderDays() }\n\t\t\t\t\t\n\t\t\t\t\t{ this.renderFooter() }\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n\n\trenderNavigation() {\n\t\tconst date = this.props.viewDate;\n\t\tconst locale = date.localeData();\n\t\treturn (\n\t\t\t this.props.navigate( -1, 'months' ) }\n\t\t\t\tonClickSwitch={ () => this.props.showView( 'months' ) }\n\t\t\t\tonClickNext={ () => this.props.navigate( 1, 'months' ) }\n\t\t\t\tswitchContent={ locale.months( date ) + ' ' + date.year() }\n\t\t\t\tswitchColSpan={5}\n\t\t\t\tswitchProps={ { 'data-value': this.props.viewDate.month() } }\n\t\t\t/>\n\t\t);\n\t}\n\n\trenderDayHeaders() {\n\t\tconst locale = this.props.viewDate.localeData();\n\t\tlet dayItems = getDaysOfWeek( locale ).map( (day, index) => (\n\t\t\t{ day }\n\t\t));\n\n\t\treturn (\n\t\t\t\n\t\t\t\t{ dayItems }\n\t\t\t\n\t\t);\n\t}\n\n\trenderDays() {\n\t\tconst date = this.props.viewDate;\n\t\tconst startOfMonth = date.clone().startOf('month');\n\t\tconst endOfMonth = date.clone().endOf('month');\n\n\t\t// We need 42 days in 6 rows\n\t\t// starting in the last week of the previous month\n\t\tlet rows = [[], [], [], [], [], []];\n\n\t\tlet startDate = date.clone().subtract( 1, 'months');\n\t\tstartDate.date( startDate.daysInMonth() ).startOf('week');\n\n\t\tlet endDate = startDate.clone().add( 42, 'd' );\n\t\tlet i = 0;\n\n\t\twhile ( startDate.isBefore( endDate ) ) {\n\t\t\tlet row = getRow( rows, i++ );\n\t\t\trow.push( this.renderDay( startDate, startOfMonth, endOfMonth ) );\n\t\t\tstartDate.add( 1, 'd' );\n\t\t}\n\n\t\treturn rows.map( (r, i) => (\n\t\t\t{ r }\n\t\t));\n\t}\n\n\trenderDay( date, startOfMonth, endOfMonth ) {\n\t\tlet selectedDate = this.props.selectedDate;\n\n\t\tlet dayProps = {\n\t\t\tkey: date.format('M_D'),\n\t\t\t'data-value': date.date(),\n\t\t\t'data-month': date.month(),\n\t\t\t'data-year': date.year()\n\t\t};\n\n\t\tlet className = 'rdtDay';\n\t\tif ( date.isBefore( startOfMonth ) ) {\n\t\t\tclassName += ' rdtOld';\n\t\t}\n\t\telse if ( date.isAfter( endOfMonth ) ) {\n\t\t\tclassName += ' rdtNew';\n\t\t}\n\t\tif ( selectedDate && date.isSame( selectedDate, 'day' ) ) {\n\t\t\tclassName += ' rdtActive';\n\t\t}\n\t\tif ( date.isSame( this.props.moment(), 'day' ) ) {\n\t\t\tclassName += ' rdtToday';\n\t\t}\n\n\t\tif ( this.props.isValidDate(date) ) {\n\t\t\tdayProps.onClick = this._setDate;\n\t\t}\n\t\telse {\n\t\t\tclassName += ' rdtDisabled';\n\t\t}\n\n\t\tdayProps.className = className;\n\n\t\treturn this.props.renderDay(\n\t\t\tdayProps, date.clone(), selectedDate && selectedDate.clone()\n\t\t);\n\t}\n\n\trenderFooter() {\n\t\tif ( !this.props.timeFormat ) return;\n\n\t\tconst date = this.props.viewDate;\n\t\treturn (\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t this.props.showView('time') }\n\t\t\t\t\t\tcolSpan={7}\n\t\t\t\t\t\tclassName=\"rdtTimeToggle\">\n\t\t\t\t\t\t{ date.format( this.props.timeFormat ) }\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t);\n\t}\n\n\t_setDate = e => {\n\t\tthis.props.updateDate( e );\n\t}\n}\n\nfunction getRow( rows, day ) {\n\treturn rows[ Math.floor( day / 7 ) ];\n}\n\n/**\n * Get a list of the days of the week\n * depending on the current locale\n * @return {array} A list with the shortname of the days\n */\nfunction getDaysOfWeek( locale ) {\n\tconst first = locale.firstDayOfWeek();\n\tlet dow = [];\n\tlet i = 0;\n\n\tlocale._weekdaysMin.forEach(function (day) {\n\t\tdow[(7 + (i++) - first) % 7] = day;\n\t});\n\n\treturn dow;\n}\n","import React from 'react';\nimport ViewNavigation from '../parts/ViewNavigation';\n\nexport default class MonthsView extends React.Component {\n\trender() {\n\t\treturn (\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{ this.renderNavigation() }\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{ this.renderMonths() }\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n\n\trenderNavigation() {\n\t\tlet year = this.props.viewDate.year();\n\n\t\treturn (\n\t\t\t this.props.navigate( -1, 'years' ) }\n\t\t\t\tonClickSwitch={ () => this.props.showView( 'years' ) }\n\t\t\t\tonClickNext={ () => this.props.navigate( 1, 'years' ) }\n\t\t\t\tswitchContent={ year }\n\t\t\t\tswitchColSpan=\"2\"\n\t\t\t/>\n\t\t);\n\t}\n\n\trenderMonths() {\n\t\t// 12 months in 3 rows for every view\n\t\tlet rows = [ [], [], [] ];\n\n\t\tfor ( let month = 0; month < 12; month++ ) {\n\t\t\tlet row = getRow( rows, month );\n\n\t\t\trow.push( this.renderMonth( month ) );\n\t\t}\n\n\t\treturn rows.map( (months, i) => (\n\t\t\t{ months }\n\t\t));\n\t}\n\n\trenderMonth( month ) {\n\t\tconst selectedDate = this.props.selectedDate;\n\t\tlet className = 'rdtMonth';\n\t\tlet onClick;\n\n\t\tif ( this.isDisabledMonth( month ) ) {\n\t\t\tclassName += ' rdtDisabled';\n\t\t}\n\t\telse {\n\t\t\tonClick = this._updateSelectedMonth;\n\t\t}\n\n\t\tif ( selectedDate && selectedDate.year() === this.props.viewDate.year() && selectedDate.month() === month ) {\n\t\t\tclassName += ' rdtActive';\n\t\t}\n\n\t\tlet props = {key: month, className, 'data-value': month, onClick };\n\n\t\tif ( this.props.renderMonth ) {\n\t\t\treturn this.props.renderMonth(\n\t\t\t\tprops,\n\t\t\t\tmonth,\n\t\t\t\tthis.props.viewDate.year(),\n\t\t\t\tthis.props.selectedDate && this.props.selectedDate.clone()\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t\n\t\t\t\t{ this.getMonthText( month ) }\n\t\t\t\n\t\t);\n\t}\n\t\n\tisDisabledMonth( month ) {\n\t\tlet isValidDate = this.props.isValidDate;\n\n\t\tif ( !isValidDate ) {\n\t\t\t// If no validator is set, all days are valid\n\t\t\treturn false;\n\t\t}\n\n\t\t// If one day in the month is valid, the year should be clickable\n\t\tlet date = this.props.viewDate.clone().set({month});\n\t\tlet day = date.endOf( 'month' ).date() + 1;\n\n\t\twhile ( day-- > 1 ) {\n\t\t\tif ( isValidDate( date.date(day) ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\tgetMonthText( month ) {\n\t\tconst localMoment = this.props.viewDate;\n\t\tconst monthStr = localMoment.localeData().monthsShort( localMoment.month( month ) );\n\n\t\t// Because some months are up to 5 characters long, we want to\n\t\t// use a fixed string length for consistency\n\t\treturn capitalize( monthStr.substring( 0, 3 ) );\n\t}\n\n\t_updateSelectedMonth = event => {\n\t\tthis.props.updateDate( event );\n\t}\n}\n\nfunction getRow( rows, year ) {\n\tif ( year < 4 ) {\n\t\treturn rows[0];\n\t}\n\tif ( year < 8 ) {\n\t\treturn rows[1];\n\t}\n\n\treturn rows[2];\n}\n\nfunction capitalize( str ) {\n\treturn str.charAt( 0 ).toUpperCase() + str.slice( 1 );\n}\n","import React from 'react';\nimport ViewNavigation from '../parts/ViewNavigation';\n\nexport default class YearsView extends React.Component {\n\tstatic defaultProps = {\n\t\trenderYear: ( props, year ) => { year },\n\t};\n\n\trender() {\n\t\treturn (\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{ this.renderNavigation() }\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{ this.renderYears() }\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n\n\trenderNavigation() {\n\t\tconst viewYear = this.getViewYear();\n\t\treturn (\n\t\t\t this.props.navigate( -10, 'years' ) }\n\t\t\t\tonClickSwitch={ () => this.props.showView( 'years' ) }\n\t\t\t\tonClickNext={ () => this.props.navigate( 10, 'years' ) }\n\t\t\t\tswitchContent={ `${viewYear}-${viewYear + 9}` }\n\t\t\t/>\n\t\t);\n\t}\n\n\trenderYears() {\n\t\tconst viewYear = this.getViewYear();\n\t\t// 12 years in 3 rows for every view\n\t\tlet rows = [ [], [], [] ];\n\t\tfor ( let year = viewYear - 1; year < viewYear + 11; year++ ) {\n\t\t\tlet row = getRow( rows, year - viewYear );\n\n\t\t\trow.push(\n\t\t\t\tthis.renderYear( year )\n\t\t\t);\n\t\t}\n\n\t\treturn rows.map( (years, i) => (\n\t\t\t{ years }\n\t\t));\n\t}\n\n\trenderYear( year ) {\n\t\tconst selectedYear = this.getSelectedYear();\n\t\tlet className = 'rdtYear';\n\t\tlet onClick;\n\n\t\tif ( this.isDisabledYear( year ) ) {\n\t\t\tclassName += ' rdtDisabled';\n\t\t}\n\t\telse {\n\t\t\tonClick = this._updateSelectedYear;\n\t\t}\n\n\t\tif ( selectedYear === year ) {\n\t\t\tclassName += ' rdtActive';\n\t\t}\n\n\t\tlet props = {key: year, className, 'data-value': year, onClick };\n\n\t\treturn this.props.renderYear(\n\t\t\tprops,\n\t\t\tyear,\n\t\t\tthis.props.selectedDate && this.props.selectedDate.clone()\n\t\t);\n\t}\n\n\tgetViewYear() {\n\t\treturn parseInt( this.props.viewDate.year() / 10, 10 ) * 10;\n\t}\n\n\tgetSelectedYear() {\n\t\treturn this.props.selectedDate && this.props.selectedDate.year();\n\t}\n\n\tdisabledYearsCache = {};\n\tisDisabledYear( year ) {\n\t\tlet cache = this.disabledYearsCache;\n\t\tif ( cache[year] !== undefined ) {\n\t\t\treturn cache[year];\n\t\t}\n\n\t\tlet isValidDate = this.props.isValidDate;\n\n\t\tif ( !isValidDate ) {\n\t\t\t// If no validator is set, all days are valid\n\t\t\treturn false;\n\t\t}\n\n\t\t// If one day in the year is valid, the year should be clickable\n\t\tlet date = this.props.viewDate.clone().set({year});\n\t\tlet day = date.endOf( 'year' ).dayOfYear() + 1;\n\n\t\twhile ( day-- > 1 ) {\n\t\t\tif ( isValidDate( date.dayOfYear(day) ) ) {\n\t\t\t\tcache[year] = false;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tcache[year] = true;\n\t\treturn true;\n\t}\n\n\t_updateSelectedYear = event => {\n\t\tthis.props.updateDate( event );\n\t}\n}\n\nfunction getRow( rows, year ) {\n\tif ( year < 3 ) {\n\t\treturn rows[0];\n\t}\n\tif ( year < 7 ) {\n\t\treturn rows[1];\n\t}\n\n\treturn rows[2];\n}\n","import React from 'react';\n\nconst timeConstraints = {\n\thours: {\n\t\tmin: 0,\n\t\tmax: 23,\n\t\tstep: 1\n\t},\n\tminutes: {\n\t\tmin: 0,\n\t\tmax: 59,\n\t\tstep: 1\n\t},\n\tseconds: {\n\t\tmin: 0,\n\t\tmax: 59,\n\t\tstep: 1\n\t},\n\tmilliseconds: {\n\t\tmin: 0,\n\t\tmax: 999,\n\t\tstep: 1\n\t}\n};\n\nfunction createConstraints( overrideTimeConstraints ) {\n\tlet constraints = {};\n\n\tObject.keys( timeConstraints ).forEach( type => {\n\t\tconstraints[ type ] = { ...timeConstraints[type], ...(overrideTimeConstraints[type] || {}) };\n\t});\n\n\treturn constraints;\n}\n\nexport default class TimeView extends React.Component {\n\tconstructor( props ) {\n\t\tsuper( props );\n\n\t\tthis.constraints = createConstraints( props.timeConstraints );\n\n\t\t// This component buffers the time part values in the state \n\t\t// while the user is pressing down the buttons\n\t\t// and call the prop `setTime` when the buttons are released\n\t\tthis.state = this.getTimeParts( props.selectedDate || props.viewDate );\n\t}\n\n\trender() {\n\t\tlet items = [];\n\t\tconst timeParts = this.state;\n\t\t\n\t\tthis.getCounters().forEach( (c, i) => {\n\t\t\tif ( i && c !== 'ampm' ) {\n\t\t\t\titems.push(\n\t\t\t\t\t
:
\n\t\t\t\t);\n\t\t\t}\n\n\t\t\titems.push( this.renderCounter(c, timeParts[c]) );\n\t\t});\n\n\t\treturn (\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t{ this.renderHeader() }\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t{ items }\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n\n\trenderCounter( type, value ) {\n\t\tif ( type === 'hours' && this.isAMPM() ) {\n\t\t\tvalue = ( value - 1 ) % 12 + 1;\n\n\t\t\tif ( value === 0 ) {\n\t\t\t\tvalue = 12;\n\t\t\t}\n\t\t}\n\n\t\tif ( type === 'ampm' ) {\n\t\t\tif ( this.props.timeFormat.indexOf(' A') !== -1 ) {\n\t\t\t\tvalue = this.props.viewDate.format('A');\n\t\t\t}\n\t\t\telse {\n\t\t\t\tvalue = this.props.viewDate.format('a');\n\t\t\t}\n\t\t}\n\n\t\treturn (\n\t\t\t
\n\t\t\t\t this.onStartClicking( e, 'increase', type)}>▲\n\t\t\t\t
{ value }
\n\t\t\t\t this.onStartClicking( e, 'decrease', type)}>▼\n\t\t\t
\n\t\t);\n\t}\n\n\trenderHeader() {\n\t\tif ( !this.props.dateFormat ) return;\n\n\t\tconst date = this.props.selectedDate || this.props.viewDate;\n\n\t\treturn (\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t this.props.showView('days') }>\n\t\t\t\t\t\t{ date.format( this.props.dateFormat ) }\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t);\n\t}\n\n\tonStartClicking( e, action, type ) {\n\t\tif ( e && e.button && e.button !== 0 ) {\n\t\t\t// Only left clicks, thanks\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif ( type === 'ampm' ) return this.toggleDayPart();\n\n\t\tlet update = {};\n\t\tlet body = document.body;\n\t\tupdate[ type ] = this[ action ]( type );\n\t\tthis.setState( update );\n\n\t\tthis.timer = setTimeout( () => {\n\t\t\tthis.increaseTimer = setInterval( () => {\n\t\t\t\tupdate[ type ] = this[ action ]( type );\n\t\t\t\tthis.setState( update );\n\t\t\t}, 70);\n\t\t}, 500);\n\n\t\tthis.mouseUpListener = () => {\n\t\t\tclearTimeout( this.timer );\n\t\t\tclearInterval( this.increaseTimer );\n\t\t\tthis.props.setTime( type, parseInt( this.state[ type ], 10 ) );\n\t\t\tbody.removeEventListener( 'mouseup', this.mouseUpListener );\n\t\t\tbody.removeEventListener( 'touchend', this.mouseUpListener );\n\t\t};\n\n\t\tbody.addEventListener( 'mouseup', this.mouseUpListener );\n\t\tbody.addEventListener( 'touchend', this.mouseUpListener );\n\t}\n\n\ttoggleDayPart() {\n\t\tlet hours = parseInt( this.state.hours, 10 );\n\t\t\n\t\tif ( hours >= 12 ) {\n\t\t\thours -= 12;\n\t\t}\n\t\telse {\n\t\t\thours += 12;\n\t\t}\n\n\t\tthis.props.setTime( 'hours', hours );\n\t}\n\n\tincrease( type ) {\n\t\tconst tc = this.constraints[ type ];\n\t\tlet value = parseInt( this.state[ type ], 10) + tc.step;\n\t\tif ( value > tc.max )\n\t\t\tvalue = tc.min + ( value - ( tc.max + 1 ) );\n\t\treturn pad( type, value );\n\t}\n\n\tdecrease( type ) {\n\t\tconst tc = this.constraints[ type ];\n\t\tlet value = parseInt( this.state[ type ], 10) - tc.step;\n\t\tif ( value < tc.min )\n\t\t\tvalue = tc.max + 1 - ( tc.min - value );\n\t\treturn pad( type, value );\n\t}\n\n\tgetCounters() {\n\t\tlet counters = [];\n\t\tlet format = this.props.timeFormat;\n\t\t\n\t\tif ( format.toLowerCase().indexOf('h') !== -1 ) {\n\t\t\tcounters.push('hours');\n\t\t\tif ( format.indexOf('m') !== -1 ) {\n\t\t\t\tcounters.push('minutes');\n\t\t\t\tif ( format.indexOf('s') !== -1 ) {\n\t\t\t\t\tcounters.push('seconds');\n\t\t\t\t\tif ( format.indexOf('S') !== -1 ) {\n\t\t\t\t\t\tcounters.push('milliseconds');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( this.isAMPM() ) {\n\t\t\tcounters.push('ampm');\n\t\t}\n\n\t\treturn counters;\n\t}\n\n\tisAMPM() {\n\t\treturn this.props.timeFormat.toLowerCase().indexOf( ' a' ) !== -1;\n\t}\n\n\tgetTimeParts( date ) {\n\t\tconst hours = date.hours();\n\n\t\treturn {\n\t\t\thours: pad( 'hours', hours ),\n\t\t\tminutes: pad( 'minutes', date.minutes() ),\n\t\t\tseconds: pad( 'seconds', date.seconds() ),\n\t\t\tmilliseconds: pad('milliseconds', date.milliseconds() ),\n\t\t\tampm: hours < 12 ? 'am' : 'pm'\n\t\t};\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tif ( this.props.selectedDate ) {\n\t\t\tif ( this.props.selectedDate !== prevProps.selectedDate ) {\n\t\t\t\tthis.setState( this.getTimeParts( this.props.selectedDate ) );\n\t\t\t}\n\t\t}\n\t\telse if ( prevProps.viewDate !== this.props.viewDate ) {\n\t\t\tthis.setState( this.getTimeParts( this.props.viewDate ) );\n\t\t}\n\t}\n}\n\nfunction pad( type, value ) {\n\tconst padValues = {\n\t\thours: 1,\n\t\tminutes: 2,\n\t\tseconds: 2,\n\t\tmilliseconds: 3\n\t};\n\n\tlet str = value + '';\n\twhile ( str.length < padValues[ type ] )\n\t\tstr = '0' + str;\n\treturn str;\n}\n","import { Component, createElement } from 'react';\nimport { findDOMNode } from 'react-dom';\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\n/**\n * Check whether some DOM node is our Component's node.\n */\nfunction isNodeFound(current, componentNode, ignoreClass) {\n if (current === componentNode) {\n return true;\n } // SVG elements do not technically reside in the rendered DOM, so\n // they do not have classList directly, but they offer a link to their\n // corresponding element, which can have classList. This extra check is for\n // that case.\n // See: http://www.w3.org/TR/SVG11/struct.html#InterfaceSVGUseElement\n // Discussion: https://github.com/Pomax/react-onclickoutside/pull/17\n\n\n if (current.correspondingElement) {\n return current.correspondingElement.classList.contains(ignoreClass);\n }\n\n return current.classList.contains(ignoreClass);\n}\n/**\n * Try to find our node in a hierarchy of nodes, returning the document\n * node as highest node if our node is not found in the path up.\n */\n\nfunction findHighest(current, componentNode, ignoreClass) {\n if (current === componentNode) {\n return true;\n } // If source=local then this event came from 'somewhere'\n // inside and should be ignored. We could handle this with\n // a layered approach, too, but that requires going back to\n // thinking in terms of Dom node nesting, running counter\n // to React's 'you shouldn't care about the DOM' philosophy.\n\n\n while (current.parentNode) {\n if (isNodeFound(current, componentNode, ignoreClass)) {\n return true;\n }\n\n current = current.parentNode;\n }\n\n return current;\n}\n/**\n * Check if the browser scrollbar was clicked\n */\n\nfunction clickedScrollbar(evt) {\n return document.documentElement.clientWidth <= evt.clientX || document.documentElement.clientHeight <= evt.clientY;\n}\n\n// ideally will get replaced with external dep\n// when rafrex/detect-passive-events#4 and rafrex/detect-passive-events#5 get merged in\nvar testPassiveEventSupport = function testPassiveEventSupport() {\n if (typeof window === 'undefined' || typeof window.addEventListener !== 'function') {\n return;\n }\n\n var passive = false;\n var options = Object.defineProperty({}, 'passive', {\n get: function get() {\n passive = true;\n }\n });\n\n var noop = function noop() {};\n\n window.addEventListener('testPassiveEventSupport', noop, options);\n window.removeEventListener('testPassiveEventSupport', noop, options);\n return passive;\n};\n\nfunction autoInc(seed) {\n if (seed === void 0) {\n seed = 0;\n }\n\n return function () {\n return ++seed;\n };\n}\n\nvar uid = autoInc();\n\nvar passiveEventSupport;\nvar handlersMap = {};\nvar enabledInstances = {};\nvar touchEvents = ['touchstart', 'touchmove'];\nvar IGNORE_CLASS_NAME = 'ignore-react-onclickoutside';\n/**\n * Options for addEventHandler and removeEventHandler\n */\n\nfunction getEventHandlerOptions(instance, eventName) {\n var handlerOptions = null;\n var isTouchEvent = touchEvents.indexOf(eventName) !== -1;\n\n if (isTouchEvent && passiveEventSupport) {\n handlerOptions = {\n passive: !instance.props.preventDefault\n };\n }\n\n return handlerOptions;\n}\n/**\n * This function generates the HOC function that you'll use\n * in order to impart onOutsideClick listening to an\n * arbitrary component. It gets called at the end of the\n * bootstrapping code to yield an instance of the\n * onClickOutsideHOC function defined inside setupHOC().\n */\n\n\nfunction onClickOutsideHOC(WrappedComponent, config) {\n var _class, _temp;\n\n var componentName = WrappedComponent.displayName || WrappedComponent.name || 'Component';\n return _temp = _class =\n /*#__PURE__*/\n function (_Component) {\n _inheritsLoose(onClickOutside, _Component);\n\n function onClickOutside(props) {\n var _this;\n\n _this = _Component.call(this, props) || this;\n\n _this.__outsideClickHandler = function (event) {\n if (typeof _this.__clickOutsideHandlerProp === 'function') {\n _this.__clickOutsideHandlerProp(event);\n\n return;\n }\n\n var instance = _this.getInstance();\n\n if (typeof instance.props.handleClickOutside === 'function') {\n instance.props.handleClickOutside(event);\n return;\n }\n\n if (typeof instance.handleClickOutside === 'function') {\n instance.handleClickOutside(event);\n return;\n }\n\n throw new Error(\"WrappedComponent: \" + componentName + \" lacks a handleClickOutside(event) function for processing outside click events.\");\n };\n\n _this.__getComponentNode = function () {\n var instance = _this.getInstance();\n\n if (config && typeof config.setClickOutsideRef === 'function') {\n return config.setClickOutsideRef()(instance);\n }\n\n if (typeof instance.setClickOutsideRef === 'function') {\n return instance.setClickOutsideRef();\n }\n\n return findDOMNode(instance);\n };\n\n _this.enableOnClickOutside = function () {\n if (typeof document === 'undefined' || enabledInstances[_this._uid]) {\n return;\n }\n\n if (typeof passiveEventSupport === 'undefined') {\n passiveEventSupport = testPassiveEventSupport();\n }\n\n enabledInstances[_this._uid] = true;\n var events = _this.props.eventTypes;\n\n if (!events.forEach) {\n events = [events];\n }\n\n handlersMap[_this._uid] = function (event) {\n if (_this.componentNode === null) return;\n\n if (_this.props.preventDefault) {\n event.preventDefault();\n }\n\n if (_this.props.stopPropagation) {\n event.stopPropagation();\n }\n\n if (_this.props.excludeScrollbar && clickedScrollbar(event)) return;\n var current = event.target;\n\n if (findHighest(current, _this.componentNode, _this.props.outsideClickIgnoreClass) !== document) {\n return;\n }\n\n _this.__outsideClickHandler(event);\n };\n\n events.forEach(function (eventName) {\n document.addEventListener(eventName, handlersMap[_this._uid], getEventHandlerOptions(_this, eventName));\n });\n };\n\n _this.disableOnClickOutside = function () {\n delete enabledInstances[_this._uid];\n var fn = handlersMap[_this._uid];\n\n if (fn && typeof document !== 'undefined') {\n var events = _this.props.eventTypes;\n\n if (!events.forEach) {\n events = [events];\n }\n\n events.forEach(function (eventName) {\n return document.removeEventListener(eventName, fn, getEventHandlerOptions(_this, eventName));\n });\n delete handlersMap[_this._uid];\n }\n };\n\n _this.getRef = function (ref) {\n return _this.instanceRef = ref;\n };\n\n _this._uid = uid();\n return _this;\n }\n /**\n * Access the WrappedComponent's instance.\n */\n\n\n var _proto = onClickOutside.prototype;\n\n _proto.getInstance = function getInstance() {\n if (!WrappedComponent.prototype.isReactComponent) {\n return this;\n }\n\n var ref = this.instanceRef;\n return ref.getInstance ? ref.getInstance() : ref;\n };\n\n /**\n * Add click listeners to the current document,\n * linked to this component's state.\n */\n _proto.componentDidMount = function componentDidMount() {\n // If we are in an environment without a DOM such\n // as shallow rendering or snapshots then we exit\n // early to prevent any unhandled errors being thrown.\n if (typeof document === 'undefined' || !document.createElement) {\n return;\n }\n\n var instance = this.getInstance();\n\n if (config && typeof config.handleClickOutside === 'function') {\n this.__clickOutsideHandlerProp = config.handleClickOutside(instance);\n\n if (typeof this.__clickOutsideHandlerProp !== 'function') {\n throw new Error(\"WrappedComponent: \" + componentName + \" lacks a function for processing outside click events specified by the handleClickOutside config option.\");\n }\n }\n\n this.componentNode = this.__getComponentNode(); // return early so we dont initiate onClickOutside\n\n if (this.props.disableOnClickOutside) return;\n this.enableOnClickOutside();\n };\n\n _proto.componentDidUpdate = function componentDidUpdate() {\n this.componentNode = this.__getComponentNode();\n };\n /**\n * Remove all document's event listeners for this component\n */\n\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.disableOnClickOutside();\n };\n /**\n * Can be called to explicitly enable event listening\n * for clicks and touches outside of this element.\n */\n\n\n /**\n * Pass-through render\n */\n _proto.render = function render() {\n // eslint-disable-next-line no-unused-vars\n var _props = this.props,\n excludeScrollbar = _props.excludeScrollbar,\n props = _objectWithoutProperties(_props, [\"excludeScrollbar\"]);\n\n if (WrappedComponent.prototype.isReactComponent) {\n props.ref = this.getRef;\n } else {\n props.wrappedRef = this.getRef;\n }\n\n props.disableOnClickOutside = this.disableOnClickOutside;\n props.enableOnClickOutside = this.enableOnClickOutside;\n return createElement(WrappedComponent, props);\n };\n\n return onClickOutside;\n }(Component), _class.displayName = \"OnClickOutside(\" + componentName + \")\", _class.defaultProps = {\n eventTypes: ['mousedown', 'touchstart'],\n excludeScrollbar: config && config.excludeScrollbar || false,\n outsideClickIgnoreClass: IGNORE_CLASS_NAME,\n preventDefault: false,\n stopPropagation: false\n }, _class.getClass = function () {\n return WrappedComponent.getClass ? WrappedComponent.getClass() : WrappedComponent;\n }, _temp;\n}\n\nexport { IGNORE_CLASS_NAME };\nexport default onClickOutsideHOC;\n","import PropTypes from 'prop-types';\nimport moment from 'moment';\nimport React from 'react';\nimport DaysView from './views/DaysView';\nimport MonthsView from './views/MonthsView';\nimport YearsView from './views/YearsView';\nimport TimeView from './views/TimeView';\nimport onClickOutside from 'react-onclickoutside';\n\nconst viewModes = {\n\tYEARS: 'years',\n\tMONTHS: 'months',\n\tDAYS: 'days',\n\tTIME: 'time',\n};\n\nconst TYPES = PropTypes;\nconst nofn = function () {};\nconst datetype = TYPES.oneOfType([ TYPES.instanceOf(moment), TYPES.instanceOf(Date), TYPES.string ]);\n\nexport default class Datetime extends React.Component {\n\tstatic propTypes = {\n\t\tvalue: datetype,\n\t\tinitialValue: datetype,\n\t\tinitialViewDate: datetype,\n\t\tinitialViewMode: TYPES.oneOf([viewModes.YEARS, viewModes.MONTHS, viewModes.DAYS, viewModes.TIME]),\n\t\tonOpen: TYPES.func,\n\t\tonClose: TYPES.func,\n\t\tonChange: TYPES.func,\n\t\tonNavigate: TYPES.func,\n\t\tonBeforeNavigate: TYPES.func,\n\t\tonNavigateBack: TYPES.func,\n\t\tonNavigateForward: TYPES.func,\n\t\tupdateOnView: TYPES.string,\n\t\tlocale: TYPES.string,\n\t\tutc: TYPES.bool,\n\t\tdisplayTimeZone: TYPES.string,\n\t\tinput: TYPES.bool,\n\t\tdateFormat: TYPES.oneOfType([TYPES.string, TYPES.bool]),\n\t\ttimeFormat: TYPES.oneOfType([TYPES.string, TYPES.bool]),\n\t\tinputProps: TYPES.object,\n\t\ttimeConstraints: TYPES.object,\n\t\tisValidDate: TYPES.func,\n\t\topen: TYPES.bool,\n\t\tstrictParsing: TYPES.bool,\n\t\tcloseOnSelect: TYPES.bool,\n\t\tcloseOnTab: TYPES.bool,\n\t\trenderView: TYPES.func,\n\t\trenderInput: TYPES.func,\n\t\trenderDay: TYPES.func,\n\t\trenderMonth: TYPES.func,\n\t\trenderYear: TYPES.func,\n\t}\n\n\tstatic defaultProps = {\n\t\tonOpen: nofn,\n\t\tonClose: nofn,\n\t\tonCalendarOpen: nofn,\n\t\tonCalendarClose: nofn,\n\t\tonChange: nofn,\n\t\tonNavigate: nofn,\n\t\tonBeforeNavigate: function(next) { return next; }, \n\t\tonNavigateBack: nofn,\n\t\tonNavigateForward: nofn,\n\t\tdateFormat: true,\n\t\ttimeFormat: true,\n\t\tutc: false,\n\t\tclassName: '',\n\t\tinput: true,\n\t\tinputProps: {},\n\t\ttimeConstraints: {},\n\t\tisValidDate: function() { return true; },\n\t\tstrictParsing: true,\n\t\tcloseOnSelect: false,\n\t\tcloseOnTab: true,\n\t\tcloseOnClickOutside: true,\n\t\trenderView: ( _, renderFunc ) => renderFunc(),\n\t}\n\n\t// Make moment accessible through the Datetime class\n\tstatic moment = moment;\n\n\tconstructor( props ) {\n\t\tsuper( props );\n\t\tthis.state = this.getInitialState();\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t\n\t\t\t\t{ this.renderInput() }\n\t\t\t\t
\n\t\t\t\t\t{ this.renderView() }\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n\n\trenderInput() {\n\t\tif ( !this.props.input ) return;\n\n\t\tconst finalInputProps = {\n\t\t\ttype: 'text',\n\t\t\tclassName: 'form-control',\n\t\t\tvalue: this.getInputValue(),\n\t\t\t...this.props.inputProps,\n\t\t\tonFocus: this._onInputFocus,\n\t\t\tonChange: this._onInputChange,\n\t\t\tonKeyDown: this._onInputKeyDown,\n\t\t\tonClick: this._onInputClick\n\t\t};\n\n\t\tif ( this.props.renderInput ) { \n\t\t\treturn (\n\t\t\t\t
\n\t\t\t\t\t{ this.props.renderInput( finalInputProps, this._openCalendar, this._closeCalendar ) }\n\t\t\t\t
\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t\n\t\t);\n\t}\n\n\trenderView() {\n\t\treturn this.props.renderView( this.state.currentView, this._renderCalendar );\n\t}\n\n\t_renderCalendar = () => {\n\t\tconst props = this.props;\n\t\tconst state = this.state;\n\n\t\tlet viewProps = {\n\t\t\tviewDate: state.viewDate.clone(),\n\t\t\tselectedDate: this.getSelectedDate(),\n\t\t\tisValidDate: props.isValidDate,\n\t\t\tupdateDate: this._updateDate,\n\t\t\tnavigate: this._viewNavigate,\n\t\t\tmoment: moment,\n\t\t\tshowView: this._showView\n\t\t};\n\n\t\t// Probably updateOn, updateSelectedDate and setDate can be merged in the same method\n\t\t// that would update viewDate or selectedDate depending on the view and the dateFormat\n\t\tswitch ( state.currentView ) {\n\t\t\tcase viewModes.YEARS:\n\t\t\t\t// Used viewProps\n\t\t\t\t// { viewDate, selectedDate, renderYear, isValidDate, navigate, showView, updateDate }\n\t\t\t\tviewProps.renderYear = props.renderYear;\n\t\t\t\treturn ;\n\t\t\t\n\t\t\tcase viewModes.MONTHS:\n\t\t\t\t// { viewDate, selectedDate, renderMonth, isValidDate, navigate, showView, updateDate }\n\t\t\t\tviewProps.renderMonth = props.renderMonth;\n\t\t\t\treturn ;\n\t\t\t\n\t\t\tcase viewModes.DAYS:\n\t\t\t\t// { viewDate, selectedDate, renderDay, isValidDate, navigate, showView, updateDate, timeFormat \n\t\t\t\tviewProps.renderDay = props.renderDay;\n\t\t\t\tviewProps.timeFormat = this.getFormat('time');\n\t\t\t\treturn ;\n\t\t\t\n\t\t\tdefault:\n\t\t\t\t// { viewDate, selectedDate, timeFormat, dateFormat, timeConstraints, setTime, showView }\n\t\t\t\tviewProps.dateFormat = this.getFormat('date');\n\t\t\t\tviewProps.timeFormat = this.getFormat('time');\n\t\t\t\tviewProps.timeConstraints = props.timeConstraints;\n\t\t\t\tviewProps.setTime = this._setTime;\n\t\t\t\treturn ;\n\t\t}\n\t}\n\n\tgetInitialState() {\n\t\tlet props = this.props;\n\t\tlet inputFormat = this.getFormat('datetime');\n\t\tlet selectedDate = this.parseDate( props.value || props.initialValue, inputFormat );\n\n\t\tthis.checkTZ();\n\n\t\treturn {\n\t\t\topen: !props.input,\n\t\t\tcurrentView: props.initialViewMode || this.getInitialView(),\n\t\t\tviewDate: this.getInitialViewDate( selectedDate ),\n\t\t\tselectedDate: selectedDate && selectedDate.isValid() ? selectedDate : undefined,\n\t\t\tinputValue: this.getInitialInputValue( selectedDate )\n\t\t};\n\t}\n\t\n\tgetInitialViewDate( selectedDate ) {\n\t\tconst propDate = this.props.initialViewDate;\n\t\tlet viewDate;\n\t\tif ( propDate ) {\n\t\t\tviewDate = this.parseDate( propDate, this.getFormat('datetime') );\n\t\t\tif ( viewDate && viewDate.isValid() ) {\n\t\t\t\treturn viewDate;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tlog('The initialViewDated given \"' + propDate + '\" is not valid. Using current date instead.');\n\t\t\t}\n\t\t}\n\t\telse if ( selectedDate && selectedDate.isValid() ) {\n\t\t\treturn selectedDate.clone();\n\t\t}\n\t\treturn this.getInitialDate();\n\t}\n\n\tgetInitialDate() {\n\t\tlet m = this.localMoment();\n\t\tm.hour(0).minute(0).second(0).millisecond(0);\n\t\treturn m;\n\t}\n\n\tgetInitialView() {\n\t\tconst dateFormat = this.getFormat( 'date' );\n\t\treturn dateFormat ? this.getUpdateOn( dateFormat ) : viewModes.TIME;\n\t}\n\n\tparseDate(date, dateFormat) {\n\t\tlet parsedDate;\n\n\t\tif (date && typeof date === 'string')\n\t\t\tparsedDate = this.localMoment(date, dateFormat);\n\t\telse if (date)\n\t\t\tparsedDate = this.localMoment(date);\n\n\t\tif (parsedDate && !parsedDate.isValid())\n\t\t\tparsedDate = null;\n\n\t\treturn parsedDate;\n\t}\n\n\tgetClassName() {\n\t\tlet cn = 'rdt';\n\t\tlet props = this.props;\n\t\tlet propCn = props.className;\n\n\t\tif ( Array.isArray( propCn ) ) {\n\t\t\tcn += ' ' + propCn.join(' ');\n\t\t}\n\t\telse if ( propCn ) {\n\t\t\tcn += ' ' + propCn;\n\t\t}\n\n\t\tif ( !props.input ) {\n\t\t\tcn += ' rdtStatic';\n\t\t}\n\t\tif ( this.isOpen() ) {\n\t\t\tcn += ' rdtOpen';\n\t\t}\n\n\t\treturn cn;\n\t}\n\t\n\tisOpen() {\n\t\treturn !this.props.input || (this.props.open === undefined ? this.state.open : this.props.open);\n\t}\n\n\tgetUpdateOn( dateFormat ) {\n\t\tif ( this.props.updateOnView ) {\n\t\t\treturn this.props.updateOnView;\n\t\t}\n\n\t\tif ( dateFormat.match(/[lLD]/) ) {\n\t\t\treturn viewModes.DAYS;\n\t\t}\n\n\t\tif ( dateFormat.indexOf('M') !== -1 ) {\n\t\t\treturn viewModes.MONTHS;\n\t\t}\n\n\t\tif ( dateFormat.indexOf('Y') !== -1 ) {\n\t\t\treturn viewModes.YEARS;\n\t\t}\n\n\t\treturn viewModes.DAYS;\n\t}\n\n\tgetLocaleData() {\n\t\tlet p = this.props;\n\t\treturn this.localMoment( p.value || p.defaultValue || new Date() ).localeData();\n\t}\n\n\tgetDateFormat() {\n\t\tconst locale = this.getLocaleData();\n\t\tlet format = this.props.dateFormat;\n\t\tif ( format === true ) return locale.longDateFormat('L');\n\t\tif ( format ) return format;\n\t\treturn '';\n\t}\n\n\tgetTimeFormat() {\n\t\tconst locale = this.getLocaleData();\n\t\tlet format = this.props.timeFormat;\n\t\tif ( format === true ) {\n\t\t\treturn locale.longDateFormat('LT');\n\t\t}\n\t\treturn format || '';\n\t}\n\n\tgetFormat( type ) {\n\t\tif ( type === 'date' ) {\n\t\t\treturn this.getDateFormat();\n\t\t}\n\t\telse if ( type === 'time' ) {\n\t\t\treturn this.getTimeFormat();\n\t\t}\n\t\t\n\t\tlet dateFormat = this.getDateFormat();\n\t\tlet timeFormat = this.getTimeFormat();\n\t\treturn dateFormat && timeFormat ? dateFormat + ' ' + timeFormat : (dateFormat || timeFormat );\n\t}\n\n\t_showView = ( view, date ) => {\n\t\tconst d = ( date || this.state.viewDate ).clone();\n\t\tconst nextView = this.props.onBeforeNavigate( view, this.state.currentView, d );\n\n\t\tif ( nextView && this.state.currentView !== nextView ) {\n\t\t\tthis.props.onNavigate( nextView );\n\t\t\tthis.setState({ currentView: nextView });\n\t\t}\n\t}\n\n\tupdateTime( op, amount, type, toSelected ) {\n\t\tlet update = {};\n\t\tconst date = toSelected ? 'selectedDate' : 'viewDate';\n\n\t\tupdate[ date ] = this.state[ date ].clone()[ op ]( amount, type );\n\n\t\tthis.setState( update );\n\t}\n\n\tviewToMethod = {days: 'date', months: 'month', years: 'year'};\n\tnextView = { days: 'time', months: 'days', years: 'months'};\n\t_updateDate = e => {\n\t\tlet state = this.state;\n\t\tlet currentView = state.currentView;\n\t\tlet updateOnView = this.getUpdateOn( this.getFormat('date') );\n\t\tlet viewDate = this.state.viewDate.clone();\n\n\t\t// Set the value into day/month/year\n\t\tviewDate[ this.viewToMethod[currentView] ](\n\t\t\tparseInt( e.target.getAttribute('data-value'), 10 )\n\t\t);\n\n\t\t// Need to set month and year will for days view (prev/next month)\n\t\tif ( currentView === 'days' ) {\n\t\t\tviewDate.month( parseInt( e.target.getAttribute('data-month'), 10 ) );\n\t\t\tviewDate.year( parseInt( e.target.getAttribute('data-year'), 10 ) );\n\t\t}\n\n\t\tlet update = {viewDate: viewDate};\n\t\tif ( currentView === updateOnView ) {\n\t\t\tupdate.selectedDate = viewDate.clone();\n\t\t\tupdate.inputValue = viewDate.format( this.getFormat('datetime') );\n\n\t\t\tif ( this.props.open === undefined && this.props.input && this.props.closeOnSelect ) {\n\t\t\t\tthis._closeCalendar();\n\t\t\t}\n\n\t\t\tthis.props.onChange( viewDate.clone() );\n\t\t}\n\t\telse {\n\t\t\tthis._showView( this.nextView[ currentView ], viewDate );\n\t\t}\n\n\t\tthis.setState( update );\n\t}\n\n\t_viewNavigate = ( modifier, unit ) => {\n\t\tlet viewDate = this.state.viewDate.clone();\n\t\t\n\t\t// Subtracting is just adding negative time\n\t\tviewDate.add( modifier, unit );\n\n\t\tif ( modifier > 0 ) {\n\t\t\tthis.props.onNavigateForward( modifier, unit );\n\t\t}\n\t\telse {\n\t\t\tthis.props.onNavigateBack( -(modifier), unit );\n\t\t}\n\n\t\tthis.setState({viewDate});\n\t}\n\t\n\t_setTime = ( type, value ) => {\n\t\tlet date = (this.getSelectedDate() || this.state.viewDate).clone();\n\t\t\n\t\tdate[ type ]( value );\n\n\t\tif ( !this.props.value ) {\n\t\t\tthis.setState({\n\t\t\t\tselectedDate: date,\n\t\t\t\tviewDate: date.clone(),\n\t\t\t\tinputValue: date.format( this.getFormat('datetime') )\n\t\t\t});\n\t\t}\n\n\t\tthis.props.onChange( date );\n\t}\n\n\t_openCalendar = () => {\n\t\tif ( this.isOpen() ) return;\n\t\tthis.setState({open: true}, this.props.onOpen );\n\t}\n\n\t_closeCalendar = () => {\n\t\tif ( !this.isOpen() ) return;\n\n\t\tthis.setState({open: false}, () => {\n\t\t\t this.props.onClose( this.state.selectedDate || this.state.inputValue );\n\t\t});\n\t}\n\n\t_handleClickOutside = () => {\n\t\tlet props = this.props;\n\n\t\tif ( props.input && this.state.open && props.open === undefined && props.closeOnClickOutside ) {\n\t\t\tthis._closeCalendar();\n\t\t}\n\t}\n\n\tlocalMoment( date, format, props ) {\n\t\tprops = props || this.props;\n\t\tlet m = null;\n\n\t\tif (props.utc) {\n\t\t\tm = moment.utc(date, format, props.strictParsing);\n\t\t} else if (props.displayTimeZone) {\n\t\t\tm = moment.tz(date, format, props.displayTimeZone);\n\t\t} else {\n\t\t\tm = moment(date, format, props.strictParsing);\n\t\t}\n\n\t\tif ( props.locale )\n\t\t\tm.locale( props.locale );\n\t\treturn m;\n\t}\n\n\tcheckTZ() {\n\t\tconst { displayTimeZone } = this.props;\n\t\tif ( displayTimeZone && !this.tzWarning && !moment.tz ) {\n\t\t\tthis.tzWarning = true;\n\t\t\tlog('displayTimeZone prop with value \"' + displayTimeZone + '\" is used but moment.js timezone is not loaded.', 'error');\n\t\t}\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tif ( prevProps === this.props ) return;\n\n\t\tlet needsUpdate = false;\n\t\tlet thisProps = this.props;\n\n\t\t['locale', 'utc', 'displayZone', 'dateFormat', 'timeFormat'].forEach( function(p) {\n\t\t\tprevProps[p] !== thisProps[p] && (needsUpdate = true);\n\t\t});\n\n\t\tif ( needsUpdate ) {\n\t\t\tthis.regenerateDates();\n\t\t}\n\n\t\tif ( thisProps.value && thisProps.value !== prevProps.value ) {\n\t\t\tthis.setViewDate( thisProps.value );\n\t\t}\n\n\t\tthis.checkTZ();\n\t}\n\n\tregenerateDates() {\n\t\tconst props = this.props;\n\t\tlet viewDate = this.state.viewDate.clone();\n\t\tlet selectedDate = this.state.selectedDate && this.state.selectedDate.clone();\n\n\t\tif ( props.locale ) {\n\t\t\tviewDate.locale( props.locale );\n\t\t\tselectedDate &&\tselectedDate.locale( props.locale );\n\t\t}\n\t\tif ( props.utc ) {\n\t\t\tviewDate.utc();\n\t\t\tselectedDate &&\tselectedDate.utc();\n\t\t}\n\t\telse if ( props.displayTimeZone ) {\n\t\t\tviewDate.tz( props.displayTimeZone );\n\t\t\tselectedDate &&\tselectedDate.tz( props.displayTimeZone );\n\t\t}\n\t\telse {\n\t\t\tviewDate.locale();\n\t\t\tselectedDate &&\tselectedDate.locale();\n\t\t}\n\n\t\tlet update = { viewDate: viewDate, selectedDate: selectedDate};\n\t\tif ( selectedDate && selectedDate.isValid() ) {\n\t\t\tupdate.inputValue = selectedDate.format( this.getFormat('datetime') );\n\t\t}\n\t\t\n\t\tthis.setState( update );\n\t}\n\n\tgetSelectedDate() {\n\t\tif ( this.props.value === undefined ) return this.state.selectedDate;\n\t\tlet selectedDate = this.parseDate( this.props.value, this.getFormat('datetime') );\n\t\treturn selectedDate && selectedDate.isValid() ? selectedDate : false;\n\t}\n\n\tgetInitialInputValue( selectedDate ) {\n\t\tconst props = this.props;\n\t\tif ( props.inputProps.value )\n\t\t\treturn props.inputProps.value;\n\t\t\n\t\tif ( selectedDate && selectedDate.isValid() )\n\t\t\treturn selectedDate.format( this.getFormat('datetime') );\n\t\t\n\t\tif ( props.value && typeof props.value === 'string' )\n\t\t\treturn props.value;\n\t\t\n\t\tif ( props.initialValue && typeof props.initialValue === 'string' )\n\t\t\treturn props.initialValue;\n\t\t\n\t\treturn '';\n\t}\n\n\tgetInputValue() {\n\t\tlet selectedDate = this.getSelectedDate();\n\t\treturn selectedDate ? selectedDate.format( this.getFormat('datetime') ) : this.state.inputValue;\n\t}\n\n\t/**\n\t * Set the date that is currently shown in the calendar.\n\t * This is independent from the selected date and it's the one used to navigate through months or days in the calendar.\n\t * @param dateType date\n\t * @public\n\t */\n\tsetViewDate( date ) {\n\t\tlet me = this;\n\t\tlet logError = function() {\n\t\t\treturn me.log( 'Invalid date passed to the `setViewDate` method: ' + date );\n\t\t};\n\n\t\tif ( !date ) return logError();\n\t\t\n\t\tlet viewDate;\n\t\tif ( typeof date === 'string' ) {\n\t\t\tviewDate = this.localMoment(date, this.getFormat('datetime') );\n\t\t}\n\t\telse {\n\t\t\tviewDate = this.localMoment( date );\n\t\t}\n\n\t\tif ( !viewDate || !viewDate.isValid() ) return logError();\n\t\tthis.setState({ viewDate: viewDate });\n\t}\n\n\t/**\n\t * Set the view currently shown by the calendar. View modes shipped with react-datetime are 'years', 'months', 'days' and 'time'.\n\t * @param TYPES.string mode \n\t */\n\tnavigate( mode ) {\n\t\tthis._showView( mode );\n\t}\n\n\t_onInputFocus = e => {\n\t\tif ( !this.callHandler( this.props.inputProps.onFocus, e ) ) return;\n\t\tthis._openCalendar();\n\t}\n\n\t_onInputChange = e => {\n\t\tif ( !this.callHandler( this.props.inputProps.onChange, e ) ) return;\n\n\t\tconst value = e.target ? e.target.value : e;\n\t\tconst localMoment = this.localMoment( value, this.getFormat('datetime') );\n\t\tlet update = { inputValue: value };\n\n\t\tif ( localMoment.isValid() ) {\n\t\t\tupdate.selectedDate = localMoment;\n\t\t\tupdate.viewDate = localMoment.clone().startOf('month');\n\t\t}\n\t\telse {\n\t\t\tupdate.selectedDate = null;\n\t\t}\n\n\t\tthis.setState( update, () => {\n\t\t\tthis.props.onChange( localMoment.isValid() ? localMoment : this.state.inputValue );\n\t\t});\n\t}\n\n\t_onInputKeyDown = e => {\n\t\tif ( !this.callHandler( this.props.inputProps.onKeyDown, e ) ) return;\n\n\t\tif ( e.which === 9 && this.props.closeOnTab ) {\n\t\t\tthis._closeCalendar();\n\t\t}\n\t}\n\n\t_onInputClick = e => {\n\t\t// Focus event should open the calendar, but there is some case where\n\t\t// the input is already focused and the picker is closed, so clicking the input\n\t\t// should open it again see https://github.com/arqex/react-datetime/issues/717\n\t\tif ( !this.callHandler( this.props.inputProps.onClick, e ) ) return;\n\t\tthis._openCalendar();\n\t}\n\n\tcallHandler( method, e ) {\n\t\tif ( !method ) return true;\n\t\treturn method(e) !== false;\n\t}\n}\n\nfunction log( message, method ) {\n\tlet con = typeof window !== 'undefined' && window.console;\n\tif ( !con ) return;\n\n\tif ( !method ) {\n\t\tmethod = 'warn';\n\t}\n\tcon[ method ]( '***react-datetime:' + message );\n}\n\nclass ClickOutBase extends React.Component {\n\tcontainer = React.createRef();\n\n\trender() {\n\t\treturn (\n\t\t\t
\n\t\t\t\t{ this.props.children }\n\t\t\t
\n\t\t);\n\t}\n\thandleClickOutside(e) {\n\t\tthis.props.onClickOut( e );\n\t}\n\n\tsetClickOutsideRef() {\n\t\treturn this.container.current;\n\t}\n}\n\nconst ClickableWrapper = onClickOutside( ClickOutBase );\n"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/react-datetime.umd.js b/dist/react-datetime.umd.js index 53422efc6..2e9f47dee 100644 --- a/dist/react-datetime.umd.js +++ b/dist/react-datetime.umd.js @@ -1,2 +1,2 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("moment"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","moment","react-dom"],t):"object"==typeof exports?exports.Datetime=t(require("react"),require("moment"),require("react-dom")):e.Datetime=t(e.react,e.moment,e["react-dom"])}(window,(function(e,t,n){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=4)}([function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t,n){e.exports=n(5)()},function(e,t){e.exports=n},function(e,t,n){e.exports=n(7)},function(e,t,n){"use strict";var r=n(6);function o(){}function a(){}a.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,a,i){if(i!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:o};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";n.r(t);var r=n(2),o=n.n(r),a=n(1),i=n.n(a),s=n(0),c=n.n(s);function u(){return(u=Object.assign||function(e){for(var t=1;t1;)if(t(n.date(r)))return!1;return!0}},{key:"getMonthText",value:function(e){var t=this.props.viewDate,n=t.localeData().monthsShort(t.month(e));return this.capitalize(n.substring(0,3))}}])&&k(t.prototype,n),r&&k(t,r),a}(c.a.Component);function T(e){return(T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function N(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function x(e,t){for(var n=0;n1;)if(n(r.dayOfYear(o)))return t[e]=!1,!1;return t[e]=!0,!0}}])&&x(t.prototype,n),r&&x(t,r),a}(c.a.Component);function H(e){return(H="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function U(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Z(e){for(var t=1;t=12?e-=12:e+=12,this.props.setTime("hours",e)}},{key:"increase",value:function(e){var t=this.constraints[e],n=parseInt(this.state[e],10)+t.step;return n>t.max&&(n=t.min+(n-(t.max+1))),this.pad(e,n)}},{key:"decrease",value:function(e){var t=this.constraints[e],n=parseInt(this.state[e],10)-t.step;return n=0||(o[n]=e[n]);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,["excludeScrollbar"]));return e.prototype.isReactComponent?n.ref=this.getRef:n.wrappedRef=this.getRef,n.disableOnClickOutside=this.disableOnClickOutside,n.enableOnClickOutside=this.enableOnClickOutside,Object(s.createElement)(e,n)},i}(s.Component),n.displayName="OnClickOutside("+o+")",n.defaultProps={eventTypes:["mousedown","touchstart"],excludeScrollbar:t&&t.excludeScrollbar||!1,outsideClickIgnoreClass:"ignore-react-onclickoutside",preventDefault:!1,stopPropagation:!1},n.getClass=function(){return e.getClass?e.getClass():e},r};function ue(e){return(ue="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function le(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function pe(e){for(var t=1;t0?r.props.onNavigateForward(e,t):r.props.onNavigateBack(-e,t),r.setState({viewDate:n})})),we(ge(r),"_setTime",(function(e,t){var n=(r.getSelectedDate()||r.state.viewDate).clone();n[e](t),r.props.value||r.setState({selectedDate:n,viewDate:n.clone(),inputValue:n.format(r.getFormat("datetime"))}),r.props.onChange(n)})),we(ge(r),"_openCalendar",(function(){r.isOpen()||r.setState({open:!0},r.props.onOpen)})),we(ge(r),"_closeCalendar",(function(){r.isOpen()&&r.setState({open:!1},(function(){r.props.onClose(r.state.selectedDate||r.state.inputValue)}))})),we(ge(r),"_handleClickOutside",(function(){var e=r.props;e.input&&r.state.open&&void 0===e.open&&e.closeOnClickOutside&&r._closeCalendar()})),we(ge(r),"_onInputFocus",(function(e){r.callHandler(r.props.inputProps.onFocus,e)&&r._openCalendar()})),we(ge(r),"_onInputChange",(function(e){if(r.callHandler(r.props.inputProps.onChange,e)){var t=e.target?e.target.value:e,n=r.localMoment(t,r.getFormat("datetime")),o={inputValue:t};n.isValid()?(o.selectedDate=n,o.viewDate=n.clone().startOf("month")):o.selectedDate=null,r.setState(o,(function(){r.props.onChange(n.isValid()?n:r.state.inputValue)}))}})),we(ge(r),"_onInputKeyDown",(function(e){r.callHandler(r.props.inputProps.onKeyDown,e)&&9===e.which&&r.props.closeOnTab&&r._closeCalendar()})),we(ge(r),"_onInputClick",(function(e){console.log("CLICKING 2!"),r.callHandler(r.props.inputProps.onClick,e)&&r._openCalendar()})),r.state=r.getInitialState(e),r}return he(n,[{key:"render",value:function(){return c.a.createElement(Ve,{className:this.getClassName(),onClickOut:this._handleClickOutside},this.renderInput(),c.a.createElement("div",{className:"rdtPicker"},this.renderView(this.state.currentView,this._renderCalendar)))}},{key:"renderInput",value:function(){if(this.props.input){var e=pe(pe({type:"text",className:"form-control",value:this.getInputValue()},this.props.inputProps),{},{onFocus:this._onInputFocus,onChange:this._onInputChange,onKeyDown:this._onInputKeyDown,onClick:this._onInputClick});return this.props.renderInput?c.a.createElement("div",null,this.props.renderInput(e,this._openCalendar,this._closeCalendar)):c.a.createElement("input",e)}}},{key:"renderView",value:function(e,t){return this.props.renderView?this.props.renderView(e,(function(){return t(e)})):t(this.state.currentView)}},{key:"getInitialState",value:function(e){var t=e||this.props,n=this.getFormat("datetime"),r=this.parseDate(t.value||t.initialValue,n);return this.checkTZ(t),{open:!t.input,currentView:t.initialViewMode||this.getInitialView(this.getFormat("date")),viewDate:this.getInitialViewDate(t.initialViewDate,r,n),selectedDate:r&&r.isValid()?r:void 0,inputValue:this.getInitialInputValue(t,r,n)}}},{key:"getInitialViewDate",value:function(e,t,n){var r;if(e){if((r=this.parseDate(e,n))&&r.isValid())return r;this.log('The initialViewDated given "'+e+'" is not valid. Using current date instead.')}else if(t&&t.isValid())return t.clone();return this.getInitialDate()}},{key:"getInitialDate",value:function(){var e=this.localMoment();return e.hour(0).minute(0).second(0).millisecond(0),e}},{key:"getInitialView",value:function(e){return e?this.getUpdateOn(e):_e}},{key:"parseDate",value:function(e,t){var n;return e&&"string"==typeof e?n=this.localMoment(e,t):e&&(n=this.localMoment(e)),n&&!n.isValid()&&(n=null),n}},{key:"getClassName",value:function(){var e="rdt",t=this.props,n=t.className;return Array.isArray(n)?e+=" "+n.join(" "):n&&(e+=" "+n),t.input||(e+=" rdtStatic"),this.isOpen()&&(e+=" rdtOpen"),e}},{key:"isOpen",value:function(){return!this.props.input||(void 0===this.props.open?this.state.open:this.props.open)}},{key:"getUpdateOn",value:function(e){return this.props.updateOnView?this.props.updateOnView:e.match(/[lLD]/)?Ce:-1!==e.indexOf("M")?ke:-1!==e.indexOf("Y")?De:Ce}},{key:"getLocaleData",value:function(e){var t=e||this.props;return this.localMoment(t.value||t.defaultValue||new Date).localeData()}},{key:"getDateFormat",value:function(e){var t=this.props.dateFormat;return!0===t?e.longDateFormat("L"):t||""}},{key:"getTimeFormat",value:function(e){var t=this.props.timeFormat;return!0===t?e.longDateFormat("LT"):t||""}},{key:"getFormat",value:function(e){if("date"===e)return this.getDateFormat(this.getLocaleData());if("time"===e)return this.getTimeFormat(this.getLocaleData());var t=this.getLocaleData(),n=this.getDateFormat(t),r=this.getTimeFormat(t);return n&&r?n+" "+r:n||r}},{key:"updateTime",value:function(e,t,n,r){var o={},a=r?"selectedDate":"viewDate";o[a]=this.state[a].clone()[e](t,n),this.setState(o)}},{key:"localMoment",value:function(e,t,n){var r=null;return r=(n=n||this.props).utc?i.a.utc(e,t,n.strictParsing):n.displayTimeZone?i.a.tz(e,t,n.displayTimeZone):i()(e,t,n.strictParsing),n.locale&&r.locale(n.locale),r}},{key:"checkTZ",value:function(e){!e.displayTimeZone||this.tzWarning||i.a.tz||(this.tzWarning=!0,this.log('displayTimeZone prop with value "'+e.displayTimeZone+'" is used but moment.js timezone is not loaded.',"error"))}},{key:"componentDidUpdate",value:function(e){if(e!==this.props){var t=!1,n=this.props;["locale","utc","displayZone","dateFormat","timeFormat"].forEach((function(r){e[r]!==n[r]&&(t=!0)})),t&&this.regenerateDates(this.props),n.value&&n.value!==e.value&&this.setViewDate(n.value),this.checkTZ(this.props)}}},{key:"regenerateDates",value:function(e){var t=this.state.viewDate.clone(),n=this.state.selectedDate&&this.state.selectedDate.clone();e.locale&&(t.locale(e.locale),n&&n.locale(e.locale)),e.utc?(t.utc(),n&&n.utc()):e.displayTimeZone?(t.tz(e.displayTimeZone),n&&n.tz(e.displayTimeZone)):(t.locale(),n&&n.locale());var r={viewDate:t,selectedDate:n};n&&n.isValid()&&(r.inputValue=n.format(this.getFormat("datetime"))),this.setState(r)}},{key:"getSelectedDate",value:function(){if(void 0===this.props.value)return this.state.selectedDate;var e=this.parseDate(this.props.value,this.getFormat("datetime"));return!(!e||!e.isValid())&&e}},{key:"getInitialInputValue",value:function(e,t,n){return e.inputProps.value?e.inputProps.value:t&&t.isValid()?t.format(n):e.value&&"string"==typeof e.value?e.value:e.initialValue&&"string"==typeof e.initialValue?e.initialValue:""}},{key:"getInputValue",value:function(){var e=this.getSelectedDate();return e?e.format(this.getFormat("datetime")):this.state.inputValue}},{key:"setViewDate",value:function(e){var t,n=this,r=function(){return n.log("Invalid date passed to the `setViewDate` method: "+e)};return e&&(t="string"==typeof e?this.localMoment(e,this.getFormat("datetime")):this.localMoment(e))&&t.isValid()?void this.setState({viewDate:t}):r()}},{key:"navigate",value:function(e){this._showView(e)}},{key:"log",value:function(e,t){var n="undefined"!=typeof window&&window.console;n&&(t||(t="warn"),n[t]("***react-datetime:"+e))}},{key:"callHandler",value:function(e,t){return!e||!1!==e(t)}}]),n}(c.a.Component);we(je,"propTypes",{value:Se,initialValue:Se,initialViewDate:Se,initialViewMode:Ee.oneOf([De,ke,Ce,_e]),onOpen:Ee.func,onClose:Ee.func,onChange:Ee.func,onNavigate:Ee.func,onBeforeNavigate:Ee.func,onNavigateBack:Ee.func,onNavigateForward:Ee.func,updateOnView:Ee.string,locale:Ee.string,utc:Ee.bool,displayTimeZone:Ee.string,input:Ee.bool,dateFormat:Ee.oneOfType([Ee.string,Ee.bool]),timeFormat:Ee.oneOfType([Ee.string,Ee.bool]),inputProps:Ee.object,timeConstraints:Ee.object,isValidDate:Ee.func,open:Ee.bool,strictParsing:Ee.bool,closeOnSelect:Ee.bool,closeOnTab:Ee.bool,renderView:Ee.func,renderInput:Ee.func,renderDay:Ee.func,renderMonth:Ee.func,renderYear:Ee.func}),we(je,"defaultProps",{onOpen:Pe,onClose:Pe,onCalendarOpen:Pe,onCalendarClose:Pe,onChange:Pe,onNavigate:Pe,onBeforeNavigate:function(e){return e},onNavigateBack:Pe,onNavigateForward:Pe,dateFormat:!0,timeFormat:!0,utc:!1,className:"",input:!0,inputProps:{},timeConstraints:{},isValidDate:function(){return!0},strictParsing:!0,closeOnSelect:!1,closeOnTab:!0,closeOnClickOutside:!0}),we(je,"moment",i.a);var Ve=ce(function(e){me(n,e);var t=ve(n);function n(){var e;fe(this,n);for(var r=arguments.length,o=new Array(r),a=0;a1;)if(t(n.date(r)))return!1;return!0}},{key:"getMonthText",value:function(e){var t,n=this.props.viewDate,r=n.localeData().monthsShort(n.month(e));return(t=r.substring(0,3)).charAt(0).toUpperCase()+t.slice(1)}}])&&C(t.prototype,n),r&&C(t,r),a}(c.a.Component);function N(e,t){return t<4?e[0]:t<8?e[1]:e[2]}function x(e){return(x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function F(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function I(e,t){for(var n=0;n1;)if(n(r.dayOfYear(o)))return t[e]=!1,!1;return t[e]=!0,!0}}])&&I(t.prototype,n),r&&I(t,r),a}(c.a.Component);function Z(e,t){return t<3?e[0]:t<7?e[1]:e[2]}function B(e){return(B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function W(e,t){for(var n=0;n=12?e-=12:e+=12,this.props.setTime("hours",e)}},{key:"increase",value:function(e){var t=this.constraints[e],n=parseInt(this.state[e],10)+t.step;return n>t.max&&(n=t.min+(n-(t.max+1))),te(e,n)}},{key:"decrease",value:function(e){var t=this.constraints[e],n=parseInt(this.state[e],10)-t.step;return n=0||(o[n]=e[n]);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,["excludeScrollbar"]));return e.prototype.isReactComponent?n.ref=this.getRef:n.wrappedRef=this.getRef,n.disableOnClickOutside=this.disableOnClickOutside,n.enableOnClickOutside=this.enableOnClickOutside,Object(s.createElement)(e,n)},i}(s.Component),n.displayName="OnClickOutside("+o+")",n.defaultProps={eventTypes:["mousedown","touchstart"],excludeScrollbar:t&&t.excludeScrollbar||!1,outsideClickIgnoreClass:"ignore-react-onclickoutside",preventDefault:!1,stopPropagation:!1},n.getClass=function(){return e.getClass?e.getClass():e},r};function fe(e){return(fe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function de(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function he(e){for(var t=1;t0?r.props.onNavigateForward(e,t):r.props.onNavigateBack(-e,t),r.setState({viewDate:n})})),Ce(De(r),"_setTime",(function(e,t){var n=(r.getSelectedDate()||r.state.viewDate).clone();n[e](t),r.props.value||r.setState({selectedDate:n,viewDate:n.clone(),inputValue:n.format(r.getFormat("datetime"))}),r.props.onChange(n)})),Ce(De(r),"_openCalendar",(function(){r.isOpen()||r.setState({open:!0},r.props.onOpen)})),Ce(De(r),"_closeCalendar",(function(){r.isOpen()&&r.setState({open:!1},(function(){r.props.onClose(r.state.selectedDate||r.state.inputValue)}))})),Ce(De(r),"_handleClickOutside",(function(){var e=r.props;e.input&&r.state.open&&void 0===e.open&&e.closeOnClickOutside&&r._closeCalendar()})),Ce(De(r),"_onInputFocus",(function(e){r.callHandler(r.props.inputProps.onFocus,e)&&r._openCalendar()})),Ce(De(r),"_onInputChange",(function(e){if(r.callHandler(r.props.inputProps.onChange,e)){var t=e.target?e.target.value:e,n=r.localMoment(t,r.getFormat("datetime")),o={inputValue:t};n.isValid()?(o.selectedDate=n,o.viewDate=n.clone().startOf("month")):o.selectedDate=null,r.setState(o,(function(){r.props.onChange(n.isValid()?n:r.state.inputValue)}))}})),Ce(De(r),"_onInputKeyDown",(function(e){r.callHandler(r.props.inputProps.onKeyDown,e)&&9===e.which&&r.props.closeOnTab&&r._closeCalendar()})),Ce(De(r),"_onInputClick",(function(e){r.callHandler(r.props.inputProps.onClick,e)&&r._openCalendar()})),r.state=r.getInitialState(),r}return ve(n,[{key:"render",value:function(){return c.a.createElement(Fe,{className:this.getClassName(),onClickOut:this._handleClickOutside},this.renderInput(),c.a.createElement("div",{className:"rdtPicker"},this.renderView()))}},{key:"renderInput",value:function(){if(this.props.input){var e=he(he({type:"text",className:"form-control",value:this.getInputValue()},this.props.inputProps),{},{onFocus:this._onInputFocus,onChange:this._onInputChange,onKeyDown:this._onInputKeyDown,onClick:this._onInputClick});return this.props.renderInput?c.a.createElement("div",null,this.props.renderInput(e,this._openCalendar,this._closeCalendar)):c.a.createElement("input",e)}}},{key:"renderView",value:function(){return this.props.renderView(this.state.currentView,this._renderCalendar)}},{key:"getInitialState",value:function(){var e=this.props,t=this.getFormat("datetime"),n=this.parseDate(e.value||e.initialValue,t);return this.checkTZ(),{open:!e.input,currentView:e.initialViewMode||this.getInitialView(),viewDate:this.getInitialViewDate(n),selectedDate:n&&n.isValid()?n:void 0,inputValue:this.getInitialInputValue(n)}}},{key:"getInitialViewDate",value:function(e){var t,n=this.props.initialViewDate;if(n){if((t=this.parseDate(n,this.getFormat("datetime")))&&t.isValid())return t;xe('The initialViewDated given "'+n+'" is not valid. Using current date instead.')}else if(e&&e.isValid())return e.clone();return this.getInitialDate()}},{key:"getInitialDate",value:function(){var e=this.localMoment();return e.hour(0).minute(0).second(0).millisecond(0),e}},{key:"getInitialView",value:function(){var e=this.getFormat("date");return e?this.getUpdateOn(e):Se}},{key:"parseDate",value:function(e,t){var n;return e&&"string"==typeof e?n=this.localMoment(e,t):e&&(n=this.localMoment(e)),n&&!n.isValid()&&(n=null),n}},{key:"getClassName",value:function(){var e="rdt",t=this.props,n=t.className;return Array.isArray(n)?e+=" "+n.join(" "):n&&(e+=" "+n),t.input||(e+=" rdtStatic"),this.isOpen()&&(e+=" rdtOpen"),e}},{key:"isOpen",value:function(){return!this.props.input||(void 0===this.props.open?this.state.open:this.props.open)}},{key:"getUpdateOn",value:function(e){return this.props.updateOnView?this.props.updateOnView:e.match(/[lLD]/)?Pe:-1!==e.indexOf("M")?Ee:-1!==e.indexOf("Y")?_e:Pe}},{key:"getLocaleData",value:function(){var e=this.props;return this.localMoment(e.value||e.defaultValue||new Date).localeData()}},{key:"getDateFormat",value:function(){var e=this.getLocaleData(),t=this.props.dateFormat;return!0===t?e.longDateFormat("L"):t||""}},{key:"getTimeFormat",value:function(){var e=this.getLocaleData(),t=this.props.timeFormat;return!0===t?e.longDateFormat("LT"):t||""}},{key:"getFormat",value:function(e){if("date"===e)return this.getDateFormat();if("time"===e)return this.getTimeFormat();var t=this.getDateFormat(),n=this.getTimeFormat();return t&&n?t+" "+n:t||n}},{key:"updateTime",value:function(e,t,n,r){var o={},a=r?"selectedDate":"viewDate";o[a]=this.state[a].clone()[e](t,n),this.setState(o)}},{key:"localMoment",value:function(e,t,n){var r=null;return r=(n=n||this.props).utc?i.a.utc(e,t,n.strictParsing):n.displayTimeZone?i.a.tz(e,t,n.displayTimeZone):i()(e,t,n.strictParsing),n.locale&&r.locale(n.locale),r}},{key:"checkTZ",value:function(){var e=this.props.displayTimeZone;!e||this.tzWarning||i.a.tz||(this.tzWarning=!0,xe('displayTimeZone prop with value "'+e+'" is used but moment.js timezone is not loaded.',"error"))}},{key:"componentDidUpdate",value:function(e){if(e!==this.props){var t=!1,n=this.props;["locale","utc","displayZone","dateFormat","timeFormat"].forEach((function(r){e[r]!==n[r]&&(t=!0)})),t&&this.regenerateDates(),n.value&&n.value!==e.value&&this.setViewDate(n.value),this.checkTZ()}}},{key:"regenerateDates",value:function(){var e=this.props,t=this.state.viewDate.clone(),n=this.state.selectedDate&&this.state.selectedDate.clone();e.locale&&(t.locale(e.locale),n&&n.locale(e.locale)),e.utc?(t.utc(),n&&n.utc()):e.displayTimeZone?(t.tz(e.displayTimeZone),n&&n.tz(e.displayTimeZone)):(t.locale(),n&&n.locale());var r={viewDate:t,selectedDate:n};n&&n.isValid()&&(r.inputValue=n.format(this.getFormat("datetime"))),this.setState(r)}},{key:"getSelectedDate",value:function(){if(void 0===this.props.value)return this.state.selectedDate;var e=this.parseDate(this.props.value,this.getFormat("datetime"));return!(!e||!e.isValid())&&e}},{key:"getInitialInputValue",value:function(e){var t=this.props;return t.inputProps.value?t.inputProps.value:e&&e.isValid()?e.format(this.getFormat("datetime")):t.value&&"string"==typeof t.value?t.value:t.initialValue&&"string"==typeof t.initialValue?t.initialValue:""}},{key:"getInputValue",value:function(){var e=this.getSelectedDate();return e?e.format(this.getFormat("datetime")):this.state.inputValue}},{key:"setViewDate",value:function(e){var t,n=this,r=function(){return n.log("Invalid date passed to the `setViewDate` method: "+e)};return e&&(t="string"==typeof e?this.localMoment(e,this.getFormat("datetime")):this.localMoment(e))&&t.isValid()?void this.setState({viewDate:t}):r()}},{key:"navigate",value:function(e){this._showView(e)}},{key:"callHandler",value:function(e,t){return!e||!1!==e(t)}}]),n}(c.a.Component);function xe(e,t){var n="undefined"!=typeof window&&window.console;n&&(t||(t="warn"),n[t]("***react-datetime:"+e))}Ce(Ne,"propTypes",{value:Te,initialValue:Te,initialViewDate:Te,initialViewMode:je.oneOf([_e,Ee,Pe,Se]),onOpen:je.func,onClose:je.func,onChange:je.func,onNavigate:je.func,onBeforeNavigate:je.func,onNavigateBack:je.func,onNavigateForward:je.func,updateOnView:je.string,locale:je.string,utc:je.bool,displayTimeZone:je.string,input:je.bool,dateFormat:je.oneOfType([je.string,je.bool]),timeFormat:je.oneOfType([je.string,je.bool]),inputProps:je.object,timeConstraints:je.object,isValidDate:je.func,open:je.bool,strictParsing:je.bool,closeOnSelect:je.bool,closeOnTab:je.bool,renderView:je.func,renderInput:je.func,renderDay:je.func,renderMonth:je.func,renderYear:je.func}),Ce(Ne,"defaultProps",{onOpen:Ve,onClose:Ve,onCalendarOpen:Ve,onCalendarClose:Ve,onChange:Ve,onNavigate:Ve,onBeforeNavigate:function(e){return e},onNavigateBack:Ve,onNavigateForward:Ve,dateFormat:!0,timeFormat:!0,utc:!1,className:"",input:!0,inputProps:{},timeConstraints:{},isValidDate:function(){return!0},strictParsing:!0,closeOnSelect:!1,closeOnTab:!0,closeOnClickOutside:!0,renderView:function(e,t){return t()}}),Ce(Ne,"moment",i.a);var Fe=pe(function(e){be(n,e);var t=Oe(n);function n(){var e;me(this,n);for(var r=arguments.length,o=new Array(r),a=0;a\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t{ switchContent }\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t);\n}\n","import React from 'react';\nimport ViewNavigation from './ViewNavigation';\n\nexport default class DaysView extends React.Component {\n\tstatic defaultProps = {\n\t\tisValidDate: () => true\n\t}\n\n\trender() {\n\t\tconst date = this.props.viewDate;\n\t\tconst locale = date.localeData();\n\n\t\tlet startOfMonth = date.clone().startOf('month');\n\t\tlet endOfMonth = date.clone().endOf('month');\n\n\t\treturn (\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{ this.renderNavigation( date, locale ) }\n\t\t\t\t\t\t{ this.renderDayHeaders( locale ) }\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{ this.renderDays( date, startOfMonth, endOfMonth ) }\n\t\t\t\t\t\n\t\t\t\t\t{ this.renderFooter( date ) }\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n\n\trenderNavigation( date, locale ) {\n\t\treturn (\n\t\t\t this.props.navigate( -1, 'months' ) }\n\t\t\t\tonClickSwitch={ () => this.props.showView( 'months' ) }\n\t\t\t\tonClickNext={ () => this.props.navigate( 1, 'months' ) }\n\t\t\t\tswitchContent={ locale.months( date ) + ' ' + date.year() }\n\t\t\t\tswitchColSpan={5}\n\t\t\t\tswitchProps={ { 'data-value': this.props.viewDate.month() } }\n\t\t\t/>\n\t\t);\n\t}\n\n\trenderDayHeaders( locale ) {\n\t\tlet dayItems = this.getDaysOfWeek( locale ).map( (day, index) => (\n\t\t\t{ day }\n\t\t));\n\n\t\treturn (\n\t\t\t\n\t\t\t\t{ dayItems }\n\t\t\t\n\t\t);\n\t}\n\n\trenderDays( date, startOfMonth, endOfMonth ) {\n\t\t// We need 42 days in 6 rows\n\t\t// starting in the last week of the previous month\n\t\tlet rows = [[], [], [], [], [], []];\n\n\t\tlet startDate = date.clone().subtract( 1, 'months');\n\t\tstartDate.date( startDate.daysInMonth() ).startOf('week');\n\n\t\tlet endDate = startDate.clone().add( 42, 'd' );\n\t\tlet i = 0;\n\n\t\twhile ( startDate.isBefore( endDate ) ) {\n\t\t\tlet row = this.getRow( rows, i++ );\n\t\t\trow.push( this.renderDay( startDate, startOfMonth, endOfMonth ) );\n\t\t\tstartDate.add( 1, 'd' );\n\t\t}\n\n\t\treturn rows.map( (r, i) => (\n\t\t\t{ r }\n\t\t));\n\t}\n\n\trenderDay( date, startOfMonth, endOfMonth ) {\n\t\tlet selectedDate = this.props.selectedDate;\n\n\t\tlet dayProps = {\n\t\t\tkey: date.format('M_D'),\n\t\t\t'data-value': date.date(),\n\t\t\t'data-month': date.month(),\n\t\t\t'data-year': date.year()\n\t\t};\n\n\t\tlet className = 'rdtDay';\n\t\tif ( date.isBefore( startOfMonth ) ) {\n\t\t\tclassName += ' rdtOld';\n\t\t}\n\t\telse if ( date.isAfter( endOfMonth ) ) {\n\t\t\tclassName += ' rdtNew';\n\t\t}\n\t\tif ( selectedDate && date.isSame( selectedDate, 'day' ) ) {\n\t\t\tclassName += ' rdtActive';\n\t\t}\n\t\tif ( date.isSame( this.props.moment(), 'day' ) ) {\n\t\t\tclassName += ' rdtToday';\n\t\t}\n\n\t\tif ( this.props.isValidDate(date) ) {\n\t\t\tdayProps.onClick = this._setDate;\n\t\t}\n\t\telse {\n\t\t\tclassName += ' rdtDisabled';\n\t\t}\n\n\t\tdayProps.className = className;\n\n\t\tif ( this.props.renderDay ) {\n\t\t\treturn this.props.renderDay(\n\t\t\t\tdayProps, date.clone(), selectedDate && selectedDate.clone()\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t{ date.date() }\n\t\t);\n\t}\n\n\trenderFooter( date ) {\n\t\tif ( !this.props.timeFormat ) return;\n\n\t\treturn (\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t this.props.showView('time') }\n\t\t\t\t\t\tcolSpan={7}\n\t\t\t\t\t\tclassName=\"rdtTimeToggle\">\n\t\t\t\t\t\t{ date.format( this.props.timeFormat ) }\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t);\n\t}\n\n\t_setDate = e => {\n\t\tthis.props.updateDate( e );\n\t}\n\n\t/**\n\t * Get a list of the days of the week\n\t * depending on the current locale\n\t * @return {array} A list with the shortname of the days\n\t */\n\tgetDaysOfWeek(locale) {\n\t\tconst first = locale.firstDayOfWeek();\n\t\tlet dow = [];\n\t\tlet i = 0;\n\n\t\tlocale._weekdaysMin.forEach(function (day) {\n\t\t\tdow[(7 + (i++) - first) % 7] = day;\n\t\t});\n\n\t\treturn dow;\n\t}\n\n\tgetRow( rows, day ) {\n\t\treturn rows[ Math.floor( day / 7 ) ];\n\t}\n}\n","import React from 'react';\nimport ViewNavigation from './ViewNavigation';\n\nexport default class MonthsView extends React.Component {\n\trender() {\n\t\treturn (\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{ this.renderNavigation() }\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{ this.renderMonths() }\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n\n\trenderNavigation() {\n\t\tlet year = this.props.viewDate.year();\n\n\t\treturn (\n\t\t\t this.props.navigate( -1, 'years' ) }\n\t\t\t\tonClickSwitch={ () => this.props.showView( 'years' ) }\n\t\t\t\tonClickNext={ () => this.props.navigate( 1, 'years' ) }\n\t\t\t\tswitchContent={ year }\n\t\t\t\tswitchColSpan=\"2\"\n\t\t\t/>\n\t\t);\n\t}\n\n\trenderMonths( viewYear ) {\n\t\t// 12 months in 3 rows for every view\n\t\tlet rows = [ [], [], [] ];\n\n\t\tfor ( let month = 0; month < 12; month++ ) {\n\t\t\tlet row = this.getRow( rows, month );\n\n\t\t\trow.push(\n\t\t\t\tthis.renderMonth( month, this.props.selectedDate )\n\t\t\t);\n\t\t}\n\n\t\treturn rows.map( (months, i) => (\n\t\t\t{ months }\n\t\t));\n\t}\n\n\trenderMonth( month, selectedDate ) {\n\t\tlet className = 'rdtMonth';\n\t\tlet onClick;\n\n\t\tif ( this.isDisabledMonth( month ) ) {\n\t\t\tclassName += ' rdtDisabled';\n\t\t}\n\t\telse {\n\t\t\tonClick = this._updateSelectedMonth;\n\t\t}\n\n\t\tif ( selectedDate && selectedDate.year() === this.props.viewDate.year() && selectedDate.month() === month ) {\n\t\t\tclassName += ' rdtActive';\n\t\t}\n\n\t\tlet props = {key: month, className, 'data-value': month, onClick };\n\n\t\tif ( this.props.renderMonth ) {\n\t\t\treturn this.props.renderMonth(\n\t\t\t\tprops,\n\t\t\t\tmonth,\n\t\t\t\tthis.props.viewDate.year(),\n\t\t\t\tthis.props.selectedDate && this.props.selectedDate.clone()\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t\n\t\t\t\t{ this.getMonthText( month ) }\n\t\t\t\n\t\t);\n\t}\n\n\tgetRow( rows, year ) {\n\t\tif ( year < 4 ) {\n\t\t\treturn rows[0];\n\t\t}\n\t\tif ( year < 8 ) {\n\t\t\treturn rows[1];\n\t\t}\n\n\t\treturn rows[2];\n\t}\n\n\tcapitalize( str ) {\n\t\treturn str.charAt( 0 ).toUpperCase() + str.slice( 1 );\n\t}\n\n\tisDisabledMonth( month ) {\n\t\tlet isValidDate = this.props.isValidDate;\n\n\t\tif ( !isValidDate ) {\n\t\t\t// If no validator is set, all days are valid\n\t\t\treturn false;\n\t\t}\n\n\t\t// If one day in the month is valid, the year should be clickable\n\t\tlet date = this.props.viewDate.clone().set({month});\n\t\tlet day = date.endOf( 'month' ).date() + 1;\n\n\t\twhile ( day-- > 1 ) {\n\t\t\tif ( isValidDate( date.date(day) ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\tgetMonthText( month ) {\n\t\tconst localMoment = this.props.viewDate;\n\t\tconst monthStr = localMoment.localeData().monthsShort( localMoment.month( month ) );\n\n\t\t// Because some months are up to 5 characters long, we want to\n\t\t// use a fixed string length for consistency\n\t\treturn this.capitalize( monthStr.substring( 0, 3 ) );\n\t}\n\n\t_updateSelectedMonth = event => {\n\t\tthis.props.updateDate( event );\n\t}\n}\n","import React from 'react';\nimport ViewNavigation from './ViewNavigation';\n\nexport default class YearsView extends React.Component {\n\trender() {\n\t\tconst viewYear = parseInt( this.props.viewDate.year() / 10, 10 ) * 10;\n\n\t\treturn (\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{ this.renderNavigation( viewYear ) }\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{ this.renderYears( viewYear ) }\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n\n\trenderNavigation( viewYear ) {\n\t\treturn (\n\t\t\t this.props.navigate( -10, 'years' ) }\n\t\t\t\tonClickSwitch={ () => this.props.showView( 'years' ) }\n\t\t\t\tonClickNext={ () => this.props.navigate( 10, 'years' ) }\n\t\t\t\tswitchContent={ `${viewYear}-${viewYear + 9}` }\n\t\t\t/>\n\t\t);\n\t}\n\n\trenderYears( viewYear ) {\n\t\t// 12 years in 3 rows for every view\n\t\tlet rows = [ [], [], [] ];\n\t\tlet selectedYear = this.props.selectedDate && this.props.selectedDate.year();\n\n\t\tfor ( let year = viewYear - 1; year < viewYear + 11; year++ ) {\n\t\t\tlet row = this.getRow( rows, year - viewYear );\n\n\t\t\trow.push(\n\t\t\t\tthis.renderYear( year, selectedYear )\n\t\t\t);\n\t\t}\n\n\t\treturn rows.map( (years, i) => (\n\t\t\t{ years }\n\t\t));\n\t}\n\n\trenderYear( year, selectedYear ) {\n\t\tlet className = 'rdtYear';\n\t\tlet onClick;\n\n\t\tif ( this.isDisabledYear( year ) ) {\n\t\t\tclassName += ' rdtDisabled';\n\t\t}\n\t\telse {\n\t\t\tonClick = this._updateSelectedYear;\n\t\t}\n\n\t\tif ( selectedYear === year ) {\n\t\t\tclassName += ' rdtActive';\n\t\t}\n\n\t\tlet props = {key: year, className, 'data-value': year, onClick };\n\n\t\tif ( this.props.renderYear ) {\n\t\t\treturn this.props.renderYear(\n\t\t\t\tprops,\n\t\t\t\tyear,\n\t\t\t\tthis.props.selectedDate && this.props.selectedDate.clone()\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t\n\t\t\t\t{ year }\n\t\t\t\n\t\t);\n\t}\n\n\tgetRow( rows, year ) {\n\t\tif ( year < 3 ) {\n\t\t\treturn rows[0];\n\t\t}\n\t\tif ( year < 7 ) {\n\t\t\treturn rows[1];\n\t\t}\n\n\t\treturn rows[2];\n\t}\n\n\tdisabledYearsCache = {};\n\tisDisabledYear( year ) {\n\t\tlet cache = this.disabledYearsCache;\n\t\tif ( cache[year] !== undefined ) {\n\t\t\treturn cache[year];\n\t\t}\n\n\t\tlet isValidDate = this.props.isValidDate;\n\n\t\tif ( !isValidDate ) {\n\t\t\t// If no validator is set, all days are valid\n\t\t\treturn false;\n\t\t}\n\n\t\t// If one day in the year is valid, the year should be clickable\n\t\tlet date = this.props.viewDate.clone().set({year});\n\t\tlet day = date.endOf( 'year' ).dayOfYear() + 1;\n\n\t\twhile ( day-- > 1 ) {\n\t\t\tif ( isValidDate( date.dayOfYear(day) ) ) {\n\t\t\t\tcache[year] = false;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tcache[year] = true;\n\t\treturn true;\n\t}\n\n\t_updateSelectedYear = event => {\n\t\tthis.props.updateDate( event );\n\t}\n}\n","import React from 'react';\n\nconst timeConstraints = {\n\thours: {\n\t\tmin: 0,\n\t\tmax: 23,\n\t\tstep: 1\n\t},\n\tminutes: {\n\t\tmin: 0,\n\t\tmax: 59,\n\t\tstep: 1\n\t},\n\tseconds: {\n\t\tmin: 0,\n\t\tmax: 59,\n\t\tstep: 1\n\t},\n\tmilliseconds: {\n\t\tmin: 0,\n\t\tmax: 999,\n\t\tstep: 1\n\t}\n};\n\nexport default class TimeView extends React.Component {\n\tconstructor( props ) {\n\t\tsuper( props );\n\n\t\tthis.constraints = this.createConstraints(props);\n\n\t\t// This component buffers the time part values in the state \n\t\t// while the user is pressing down the buttons\n\t\t// and call the prop `setTime` when the buttons are released\n\t\tthis.state = this.getTimeParts( props.selectedDate || props.viewDate );\n\t}\n\n\tcreateConstraints( props ) {\n\t\tlet constraints = {};\n\n\t\tObject.keys( timeConstraints ).forEach( type => {\n\t\t\tconstraints[ type ] = { ...timeConstraints[type], ...(props.timeConstraints[type] || {}) };\n\t\t});\n\n\t\treturn constraints;\n\t}\n\n\trender() {\n\t\tlet items = [];\n\t\tconst timeParts = this.state;\n\t\t\n\t\tthis.getCounters().forEach( (c, i) => {\n\t\t\tif ( i && c !== 'ampm' ) {\n\t\t\t\titems.push(\n\t\t\t\t\t
:
\n\t\t\t\t);\n\t\t\t}\n\n\t\t\titems.push( this.renderCounter(c, timeParts[c]) );\n\t\t});\n\n\t\treturn (\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t{ this.renderHeader() }\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t{ items }\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n\n\trenderCounter( type, value ) {\n\t\tif ( type === 'hours' && this.isAMPM() ) {\n\t\t\tvalue = ( value - 1 ) % 12 + 1;\n\n\t\t\tif ( value === 0 ) {\n\t\t\t\tvalue = 12;\n\t\t\t}\n\t\t}\n\n\t\tif ( type === 'ampm' ) {\n\t\t\tif ( this.props.timeFormat.indexOf(' A') !== -1 ) {\n\t\t\t\tvalue = this.props.viewDate.format('A');\n\t\t\t}\n\t\t\telse {\n\t\t\t\tvalue = this.props.viewDate.format('a');\n\t\t\t}\n\t\t}\n\n\t\treturn (\n\t\t\t
\n\t\t\t\t this.onStartClicking( e, 'increase', type)}>▲\n\t\t\t\t
{ value }
\n\t\t\t\t this.onStartClicking( e, 'decrease', type)}>▼\n\t\t\t
\n\t\t);\n\t}\n\n\trenderHeader() {\n\t\tif ( !this.props.dateFormat ) return;\n\n\t\tconst date = this.props.selectedDate || this.props.viewDate;\n\n\t\treturn (\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t this.props.showView('days') }>\n\t\t\t\t\t\t{ date.format( this.props.dateFormat ) }\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t);\n\t}\n\n\tonStartClicking( e, action, type ) {\n\t\tif ( e && e.button && e.button !== 0 ) {\n\t\t\t// Only left clicks, thanks\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif ( type === 'ampm' ) return this.toggleDayPart();\n\n\t\tlet update = {};\n\t\tlet body = document.body;\n\t\tupdate[ type ] = this[ action ]( type );\n\t\tthis.setState( update );\n\n\t\tthis.timer = setTimeout( () => {\n\t\t\tthis.increaseTimer = setInterval( () => {\n\t\t\t\tupdate[ type ] = this[ action ]( type );\n\t\t\t\tthis.setState( update );\n\t\t\t}, 70);\n\t\t}, 500);\n\n\t\tthis.mouseUpListener = () => {\n\t\t\tclearTimeout( this.timer );\n\t\t\tclearInterval( this.increaseTimer );\n\t\t\tthis.props.setTime( type, parseInt( this.state[ type ], 10 ) );\n\t\t\tbody.removeEventListener( 'mouseup', this.mouseUpListener );\n\t\t\tbody.removeEventListener( 'touchend', this.mouseUpListener );\n\t\t};\n\n\t\tbody.addEventListener( 'mouseup', this.mouseUpListener );\n\t\tbody.addEventListener( 'touchend', this.mouseUpListener );\n\t}\n\n\tpadValues = {\n\t\thours: 1,\n\t\tminutes: 2,\n\t\tseconds: 2,\n\t\tmilliseconds: 3\n\t}\n\n\ttoggleDayPart() {\n\t\tlet hours = parseInt( this.state.hours, 10 );\n\t\t\n\t\tif ( hours >= 12 ) {\n\t\t\thours -= 12;\n\t\t}\n\t\telse {\n\t\t\thours += 12;\n\t\t}\n\n\t\tthis.props.setTime( 'hours', hours );\n\t}\n\n\tincrease( type ) {\n\t\tconst tc = this.constraints[ type ];\n\t\tlet value = parseInt( this.state[ type ], 10) + tc.step;\n\t\tif ( value > tc.max )\n\t\t\tvalue = tc.min + ( value - ( tc.max + 1 ) );\n\t\treturn this.pad( type, value );\n\t}\n\n\tdecrease( type ) {\n\t\tconst tc = this.constraints[ type ];\n\t\tlet value = parseInt( this.state[ type ], 10) - tc.step;\n\t\tif ( value < tc.min )\n\t\t\tvalue = tc.max + 1 - ( tc.min - value );\n\t\treturn this.pad( type, value );\n\t}\n\n\tpad( type, value ) {\n\t\tlet str = value + '';\n\t\twhile ( str.length < this.padValues[ type ] )\n\t\t\tstr = '0' + str;\n\t\treturn str;\n\t}\n\n\tgetCounters() {\n\t\tlet counters = [];\n\t\tlet format = this.props.timeFormat;\n\t\t\n\t\tif ( format.toLowerCase().indexOf('h') !== -1 ) {\n\t\t\tcounters.push('hours');\n\t\t\tif ( format.indexOf('m') !== -1 ) {\n\t\t\t\tcounters.push('minutes');\n\t\t\t\tif ( format.indexOf('s') !== -1 ) {\n\t\t\t\t\tcounters.push('seconds');\n\t\t\t\t\tif ( format.indexOf('S') !== -1 ) {\n\t\t\t\t\t\tcounters.push('milliseconds');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( this.isAMPM() ) {\n\t\t\tcounters.push('ampm');\n\t\t}\n\n\t\treturn counters;\n\t}\n\n\tisAMPM() {\n\t\treturn this.props.timeFormat.toLowerCase().indexOf( ' a' ) !== -1;\n\t}\n\n\tgetTimeParts( date ) {\n\t\tconst hours = date.hours();\n\n\t\treturn {\n\t\t\thours: this.pad( 'hours', hours ),\n\t\t\tminutes: this.pad( 'minutes', date.minutes() ),\n\t\t\tseconds: this.pad( 'seconds', date.seconds() ),\n\t\t\tmilliseconds: this.pad('milliseconds', date.milliseconds() ),\n\t\t\tampm: hours < 12 ? 'am' : 'pm'\n\t\t};\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tif ( this.props.selectedDate ) {\n\t\t\tif ( this.props.selectedDate !== prevProps.selectedDate ) {\n\t\t\t\tthis.setState( this.getTimeParts( this.props.selectedDate ) );\n\t\t\t}\n\t\t}\n\t\telse if ( prevProps.viewDate !== this.props.viewDate ) {\n\t\t\tthis.setState( this.getTimeParts( this.props.viewDate ) );\n\t\t}\n\t}\n}\n","import { Component, createElement } from 'react';\nimport { findDOMNode } from 'react-dom';\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\n/**\n * Check whether some DOM node is our Component's node.\n */\nfunction isNodeFound(current, componentNode, ignoreClass) {\n if (current === componentNode) {\n return true;\n } // SVG elements do not technically reside in the rendered DOM, so\n // they do not have classList directly, but they offer a link to their\n // corresponding element, which can have classList. This extra check is for\n // that case.\n // See: http://www.w3.org/TR/SVG11/struct.html#InterfaceSVGUseElement\n // Discussion: https://github.com/Pomax/react-onclickoutside/pull/17\n\n\n if (current.correspondingElement) {\n return current.correspondingElement.classList.contains(ignoreClass);\n }\n\n return current.classList.contains(ignoreClass);\n}\n/**\n * Try to find our node in a hierarchy of nodes, returning the document\n * node as highest node if our node is not found in the path up.\n */\n\nfunction findHighest(current, componentNode, ignoreClass) {\n if (current === componentNode) {\n return true;\n } // If source=local then this event came from 'somewhere'\n // inside and should be ignored. We could handle this with\n // a layered approach, too, but that requires going back to\n // thinking in terms of Dom node nesting, running counter\n // to React's 'you shouldn't care about the DOM' philosophy.\n\n\n while (current.parentNode) {\n if (isNodeFound(current, componentNode, ignoreClass)) {\n return true;\n }\n\n current = current.parentNode;\n }\n\n return current;\n}\n/**\n * Check if the browser scrollbar was clicked\n */\n\nfunction clickedScrollbar(evt) {\n return document.documentElement.clientWidth <= evt.clientX || document.documentElement.clientHeight <= evt.clientY;\n}\n\n// ideally will get replaced with external dep\n// when rafrex/detect-passive-events#4 and rafrex/detect-passive-events#5 get merged in\nvar testPassiveEventSupport = function testPassiveEventSupport() {\n if (typeof window === 'undefined' || typeof window.addEventListener !== 'function') {\n return;\n }\n\n var passive = false;\n var options = Object.defineProperty({}, 'passive', {\n get: function get() {\n passive = true;\n }\n });\n\n var noop = function noop() {};\n\n window.addEventListener('testPassiveEventSupport', noop, options);\n window.removeEventListener('testPassiveEventSupport', noop, options);\n return passive;\n};\n\nfunction autoInc(seed) {\n if (seed === void 0) {\n seed = 0;\n }\n\n return function () {\n return ++seed;\n };\n}\n\nvar uid = autoInc();\n\nvar passiveEventSupport;\nvar handlersMap = {};\nvar enabledInstances = {};\nvar touchEvents = ['touchstart', 'touchmove'];\nvar IGNORE_CLASS_NAME = 'ignore-react-onclickoutside';\n/**\n * Options for addEventHandler and removeEventHandler\n */\n\nfunction getEventHandlerOptions(instance, eventName) {\n var handlerOptions = null;\n var isTouchEvent = touchEvents.indexOf(eventName) !== -1;\n\n if (isTouchEvent && passiveEventSupport) {\n handlerOptions = {\n passive: !instance.props.preventDefault\n };\n }\n\n return handlerOptions;\n}\n/**\n * This function generates the HOC function that you'll use\n * in order to impart onOutsideClick listening to an\n * arbitrary component. It gets called at the end of the\n * bootstrapping code to yield an instance of the\n * onClickOutsideHOC function defined inside setupHOC().\n */\n\n\nfunction onClickOutsideHOC(WrappedComponent, config) {\n var _class, _temp;\n\n var componentName = WrappedComponent.displayName || WrappedComponent.name || 'Component';\n return _temp = _class =\n /*#__PURE__*/\n function (_Component) {\n _inheritsLoose(onClickOutside, _Component);\n\n function onClickOutside(props) {\n var _this;\n\n _this = _Component.call(this, props) || this;\n\n _this.__outsideClickHandler = function (event) {\n if (typeof _this.__clickOutsideHandlerProp === 'function') {\n _this.__clickOutsideHandlerProp(event);\n\n return;\n }\n\n var instance = _this.getInstance();\n\n if (typeof instance.props.handleClickOutside === 'function') {\n instance.props.handleClickOutside(event);\n return;\n }\n\n if (typeof instance.handleClickOutside === 'function') {\n instance.handleClickOutside(event);\n return;\n }\n\n throw new Error(\"WrappedComponent: \" + componentName + \" lacks a handleClickOutside(event) function for processing outside click events.\");\n };\n\n _this.__getComponentNode = function () {\n var instance = _this.getInstance();\n\n if (config && typeof config.setClickOutsideRef === 'function') {\n return config.setClickOutsideRef()(instance);\n }\n\n if (typeof instance.setClickOutsideRef === 'function') {\n return instance.setClickOutsideRef();\n }\n\n return findDOMNode(instance);\n };\n\n _this.enableOnClickOutside = function () {\n if (typeof document === 'undefined' || enabledInstances[_this._uid]) {\n return;\n }\n\n if (typeof passiveEventSupport === 'undefined') {\n passiveEventSupport = testPassiveEventSupport();\n }\n\n enabledInstances[_this._uid] = true;\n var events = _this.props.eventTypes;\n\n if (!events.forEach) {\n events = [events];\n }\n\n handlersMap[_this._uid] = function (event) {\n if (_this.componentNode === null) return;\n\n if (_this.props.preventDefault) {\n event.preventDefault();\n }\n\n if (_this.props.stopPropagation) {\n event.stopPropagation();\n }\n\n if (_this.props.excludeScrollbar && clickedScrollbar(event)) return;\n var current = event.target;\n\n if (findHighest(current, _this.componentNode, _this.props.outsideClickIgnoreClass) !== document) {\n return;\n }\n\n _this.__outsideClickHandler(event);\n };\n\n events.forEach(function (eventName) {\n document.addEventListener(eventName, handlersMap[_this._uid], getEventHandlerOptions(_this, eventName));\n });\n };\n\n _this.disableOnClickOutside = function () {\n delete enabledInstances[_this._uid];\n var fn = handlersMap[_this._uid];\n\n if (fn && typeof document !== 'undefined') {\n var events = _this.props.eventTypes;\n\n if (!events.forEach) {\n events = [events];\n }\n\n events.forEach(function (eventName) {\n return document.removeEventListener(eventName, fn, getEventHandlerOptions(_this, eventName));\n });\n delete handlersMap[_this._uid];\n }\n };\n\n _this.getRef = function (ref) {\n return _this.instanceRef = ref;\n };\n\n _this._uid = uid();\n return _this;\n }\n /**\n * Access the WrappedComponent's instance.\n */\n\n\n var _proto = onClickOutside.prototype;\n\n _proto.getInstance = function getInstance() {\n if (!WrappedComponent.prototype.isReactComponent) {\n return this;\n }\n\n var ref = this.instanceRef;\n return ref.getInstance ? ref.getInstance() : ref;\n };\n\n /**\n * Add click listeners to the current document,\n * linked to this component's state.\n */\n _proto.componentDidMount = function componentDidMount() {\n // If we are in an environment without a DOM such\n // as shallow rendering or snapshots then we exit\n // early to prevent any unhandled errors being thrown.\n if (typeof document === 'undefined' || !document.createElement) {\n return;\n }\n\n var instance = this.getInstance();\n\n if (config && typeof config.handleClickOutside === 'function') {\n this.__clickOutsideHandlerProp = config.handleClickOutside(instance);\n\n if (typeof this.__clickOutsideHandlerProp !== 'function') {\n throw new Error(\"WrappedComponent: \" + componentName + \" lacks a function for processing outside click events specified by the handleClickOutside config option.\");\n }\n }\n\n this.componentNode = this.__getComponentNode(); // return early so we dont initiate onClickOutside\n\n if (this.props.disableOnClickOutside) return;\n this.enableOnClickOutside();\n };\n\n _proto.componentDidUpdate = function componentDidUpdate() {\n this.componentNode = this.__getComponentNode();\n };\n /**\n * Remove all document's event listeners for this component\n */\n\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.disableOnClickOutside();\n };\n /**\n * Can be called to explicitly enable event listening\n * for clicks and touches outside of this element.\n */\n\n\n /**\n * Pass-through render\n */\n _proto.render = function render() {\n // eslint-disable-next-line no-unused-vars\n var _props = this.props,\n excludeScrollbar = _props.excludeScrollbar,\n props = _objectWithoutProperties(_props, [\"excludeScrollbar\"]);\n\n if (WrappedComponent.prototype.isReactComponent) {\n props.ref = this.getRef;\n } else {\n props.wrappedRef = this.getRef;\n }\n\n props.disableOnClickOutside = this.disableOnClickOutside;\n props.enableOnClickOutside = this.enableOnClickOutside;\n return createElement(WrappedComponent, props);\n };\n\n return onClickOutside;\n }(Component), _class.displayName = \"OnClickOutside(\" + componentName + \")\", _class.defaultProps = {\n eventTypes: ['mousedown', 'touchstart'],\n excludeScrollbar: config && config.excludeScrollbar || false,\n outsideClickIgnoreClass: IGNORE_CLASS_NAME,\n preventDefault: false,\n stopPropagation: false\n }, _class.getClass = function () {\n return WrappedComponent.getClass ? WrappedComponent.getClass() : WrappedComponent;\n }, _temp;\n}\n\nexport { IGNORE_CLASS_NAME };\nexport default onClickOutsideHOC;\n","import PropTypes from 'prop-types';\nimport moment from 'moment';\nimport React from 'react';\nimport DaysView from './DaysView';\nimport MonthsView from './MonthsView';\nimport YearsView from './YearsView';\nimport TimeView from './TimeView';\nimport onClickOutside from 'react-onclickoutside';\n\nconst viewModes = {\n\tYEARS: 'years',\n\tMONTHS: 'months',\n\tDAYS: 'days',\n\tTIME: 'time',\n};\n\nconst TYPES = PropTypes;\nconst nofn = function () {};\nconst datetype = TYPES.oneOfType([ TYPES.instanceOf(moment), TYPES.instanceOf(Date), TYPES.string ]);\n\nexport default class Datetime extends React.Component {\n\tstatic propTypes = {\n\t\tvalue: datetype,\n\t\tinitialValue: datetype,\n\t\tinitialViewDate: datetype,\n\t\tinitialViewMode: TYPES.oneOf([viewModes.YEARS, viewModes.MONTHS, viewModes.DAYS, viewModes.TIME]),\n\t\tonOpen: TYPES.func,\n\t\tonClose: TYPES.func,\n\t\tonChange: TYPES.func,\n\t\tonNavigate: TYPES.func,\n\t\tonBeforeNavigate: TYPES.func,\n\t\tonNavigateBack: TYPES.func,\n\t\tonNavigateForward: TYPES.func,\n\t\tupdateOnView: TYPES.string,\n\t\tlocale: TYPES.string,\n\t\tutc: TYPES.bool,\n\t\tdisplayTimeZone: TYPES.string,\n\t\tinput: TYPES.bool,\n\t\tdateFormat: TYPES.oneOfType([TYPES.string, TYPES.bool]),\n\t\ttimeFormat: TYPES.oneOfType([TYPES.string, TYPES.bool]),\n\t\tinputProps: TYPES.object,\n\t\ttimeConstraints: TYPES.object,\n\t\tisValidDate: TYPES.func,\n\t\topen: TYPES.bool,\n\t\tstrictParsing: TYPES.bool,\n\t\tcloseOnSelect: TYPES.bool,\n\t\tcloseOnTab: TYPES.bool,\n\t\trenderView: TYPES.func,\n\t\trenderInput: TYPES.func,\n\t\trenderDay: TYPES.func,\n\t\trenderMonth: TYPES.func,\n\t\trenderYear: TYPES.func,\n\t}\n\n\tstatic defaultProps = {\n\t\tonOpen: nofn,\n\t\tonClose: nofn,\n\t\tonCalendarOpen: nofn,\n\t\tonCalendarClose: nofn,\n\t\tonChange: nofn,\n\t\tonNavigate: nofn,\n\t\tonBeforeNavigate: function(next) { return next; }, \n\t\tonNavigateBack: nofn,\n\t\tonNavigateForward: nofn,\n\t\tdateFormat: true,\n\t\ttimeFormat: true,\n\t\tutc: false,\n\t\tclassName: '',\n\t\tinput: true,\n\t\tinputProps: {},\n\t\ttimeConstraints: {},\n\t\tisValidDate: function() { return true; },\n\t\tstrictParsing: true,\n\t\tcloseOnSelect: false,\n\t\tcloseOnTab: true,\n\t\tcloseOnClickOutside: true\n\t}\n\n\t// Make moment accessible through the Datetime class\n\tstatic moment = moment;\n\n\tconstructor( props ) {\n\t\tsuper( props );\n\t\tthis.state = this.getInitialState( props );\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t\n\t\t\t\t{ this.renderInput() }\n\t\t\t\t
\n\t\t\t\t\t{ this.renderView( this.state.currentView, this._renderCalendar ) }\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n\n\trenderInput() {\n\t\tif ( !this.props.input ) return;\n\n\t\tconst finalInputProps = {\n\t\t\ttype: 'text',\n\t\t\tclassName: 'form-control',\n\t\t\tvalue: this.getInputValue(),\n\t\t\t...this.props.inputProps,\n\t\t\tonFocus: this._onInputFocus,\n\t\t\tonChange: this._onInputChange,\n\t\t\tonKeyDown: this._onInputKeyDown,\n\t\t\tonClick: this._onInputClick\n\t\t};\n\n\t\tif ( this.props.renderInput ) { \n\t\t\treturn (\n\t\t\t\t
\n\t\t\t\t\t{ this.props.renderInput( finalInputProps, this._openCalendar, this._closeCalendar ) }\n\t\t\t\t
\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t\n\t\t);\n\t}\n\n\trenderView( currentView, renderer ) {\n\t\tif ( this.props.renderView ) {\n\t\t\treturn this.props.renderView( currentView, () => renderer(currentView) );\n\t\t}\n\t\treturn renderer( this.state.currentView );\n\t}\n\n\t_renderCalendar = currentView => {\n\t\tconst props = this.props;\n\t\tconst state = this.state;\n\n\t\tlet viewProps = {\n\t\t\tviewDate: state.viewDate.clone(),\n\t\t\tselectedDate: this.getSelectedDate(),\n\t\t\tisValidDate: props.isValidDate,\n\t\t\tupdateDate: this._updateDate,\n\t\t\tnavigate: this._viewNavigate,\n\t\t\tmoment: moment,\n\t\t\tshowView: this._showView\n\t\t};\n\n\t\t// Probably updateOn, updateSelectedDate and setDate can be merged in the same method\n\t\t// that would update viewDate or selectedDate depending on the view and the dateFormat\n\t\tswitch ( currentView ) {\n\t\t\tcase viewModes.YEARS:\n\t\t\t\t// Used viewProps\n\t\t\t\t// { viewDate, selectedDate, renderYear, isValidDate, navigate, showView, updateDate }\n\t\t\t\tviewProps.renderYear = props.renderYear;\n\t\t\t\treturn ;\n\t\t\t\n\t\t\tcase viewModes.MONTHS:\n\t\t\t\t// { viewDate, selectedDate, renderMonth, isValidDate, navigate, showView, updateDate }\n\t\t\t\tviewProps.renderMonth = props.renderMonth;\n\t\t\t\treturn ;\n\t\t\t\n\t\t\tcase viewModes.DAYS:\n\t\t\t\t// { viewDate, selectedDate, renderDay, isValidDate, navigate, showView, updateDate, timeFormat \n\t\t\t\tviewProps.renderDay = props.renderDay;\n\t\t\t\tviewProps.timeFormat = this.getFormat('time');\n\t\t\t\treturn ;\n\t\t\t\n\t\t\tdefault:\n\t\t\t\t// { viewDate, selectedDate, timeFormat, dateFormat, timeConstraints, setTime, showView }\n\t\t\t\tviewProps.dateFormat = this.getFormat('date');\n\t\t\t\tviewProps.timeFormat = this.getFormat('time');\n\t\t\t\tviewProps.timeConstraints = props.timeConstraints;\n\t\t\t\tviewProps.setTime = this._setTime;\n\t\t\t\treturn ;\n\t\t}\n\t}\n\n\tgetInitialState( p ) {\n\t\tlet props = p || this.props;\n\t\tlet inputFormat = this.getFormat('datetime');\n\t\tlet selectedDate = this.parseDate( props.value || props.initialValue, inputFormat );\n\n\t\tthis.checkTZ( props );\n\n\t\treturn {\n\t\t\topen: !props.input,\n\t\t\tcurrentView: props.initialViewMode || this.getInitialView( this.getFormat('date') ),\n\t\t\tviewDate: this.getInitialViewDate( props.initialViewDate, selectedDate, inputFormat ),\n\t\t\tselectedDate: selectedDate && selectedDate.isValid() ? selectedDate : undefined,\n\t\t\tinputValue: this.getInitialInputValue( props, selectedDate, inputFormat )\n\t\t};\n\t}\n\t\n\tgetInitialViewDate( propDate, selectedDate, format ) {\n\t\tlet viewDate;\n\t\tif ( propDate ) {\n\t\t\tviewDate = this.parseDate( propDate, format );\n\t\t\tif ( viewDate && viewDate.isValid() ) {\n\t\t\t\treturn viewDate;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.log('The initialViewDated given \"' + propDate + '\" is not valid. Using current date instead.');\n\t\t\t}\n\t\t}\n\t\telse if ( selectedDate && selectedDate.isValid() ) {\n\t\t\treturn selectedDate.clone();\n\t\t}\n\t\treturn this.getInitialDate();\n\t}\n\n\tgetInitialDate() {\n\t\tlet m = this.localMoment();\n\t\tm.hour(0).minute(0).second(0).millisecond(0);\n\t\treturn m;\n\t}\n\n\tgetInitialView( dateFormat ) {\n\t\tif ( !dateFormat ) return viewModes.TIME;\n\t\treturn this.getUpdateOn( dateFormat );\n\t}\n\n\tparseDate(date, dateFormat) {\n\t\tlet parsedDate;\n\n\t\tif (date && typeof date === 'string')\n\t\t\tparsedDate = this.localMoment(date, dateFormat);\n\t\telse if (date)\n\t\t\tparsedDate = this.localMoment(date);\n\n\t\tif (parsedDate && !parsedDate.isValid())\n\t\t\tparsedDate = null;\n\n\t\treturn parsedDate;\n\t}\n\n\tgetClassName() {\n\t\tlet cn = 'rdt';\n\t\tlet props = this.props;\n\t\tlet propCn = props.className;\n\n\t\tif ( Array.isArray( propCn ) ) {\n\t\t\tcn += ' ' + propCn.join(' ');\n\t\t}\n\t\telse if ( propCn ) {\n\t\t\tcn += ' ' + propCn;\n\t\t}\n\n\t\tif ( !props.input ) {\n\t\t\tcn += ' rdtStatic';\n\t\t}\n\t\tif ( this.isOpen() ) {\n\t\t\tcn += ' rdtOpen';\n\t\t}\n\n\t\treturn cn;\n\t}\n\t\n\tisOpen() {\n\t\treturn !this.props.input || (this.props.open === undefined ? this.state.open : this.props.open);\n\t}\n\n\tgetUpdateOn( dateFormat ) {\n\t\tif ( this.props.updateOnView ) {\n\t\t\treturn this.props.updateOnView;\n\t\t}\n\n\t\tif ( dateFormat.match(/[lLD]/) ) {\n\t\t\treturn viewModes.DAYS;\n\t\t}\n\n\t\tif ( dateFormat.indexOf('M') !== -1 ) {\n\t\t\treturn viewModes.MONTHS;\n\t\t}\n\n\t\tif ( dateFormat.indexOf('Y') !== -1 ) {\n\t\t\treturn viewModes.YEARS;\n\t\t}\n\n\t\treturn viewModes.DAYS;\n\t}\n\n\tgetLocaleData( props ) {\n\t\tlet p = props || this.props;\n\t\treturn this.localMoment( p.value || p.defaultValue || new Date() ).localeData();\n\t}\n\n\tgetDateFormat( locale ) {\n\t\tlet format = this.props.dateFormat;\n\t\tif ( format === true ) return locale.longDateFormat('L');\n\t\tif ( format ) return format;\n\t\treturn '';\n\t}\n\n\tgetTimeFormat( locale ) {\n\t\tlet format = this.props.timeFormat;\n\t\tif ( format === true ) {\n\t\t\treturn locale.longDateFormat('LT');\n\t\t}\n\t\treturn format || '';\n\t}\n\n\tgetFormat( type ) {\n\t\tif ( type === 'date' ) {\n\t\t\treturn this.getDateFormat( this.getLocaleData() );\n\t\t}\n\t\telse if ( type === 'time' ) {\n\t\t\treturn this.getTimeFormat( this.getLocaleData() );\n\t\t}\n\t\t\n\t\tlet locale = this.getLocaleData();\n\t\tlet dateFormat = this.getDateFormat( locale );\n\t\tlet timeFormat = this.getTimeFormat( locale );\n\t\treturn dateFormat && timeFormat ? dateFormat + ' ' + timeFormat : (dateFormat || timeFormat );\n\t}\n\n\t_showView = ( view, date ) => {\n\t\tconst d = ( date || this.state.viewDate ).clone();\n\t\tconst nextView = this.props.onBeforeNavigate( view, this.state.currentView, d );\n\n\t\tif ( nextView && this.state.currentView !== nextView ) {\n\t\t\tthis.props.onNavigate( nextView );\n\t\t\tthis.setState({ currentView: nextView });\n\t\t}\n\t}\n\n\tupdateTime( op, amount, type, toSelected ) {\n\t\tlet update = {};\n\t\tconst date = toSelected ? 'selectedDate' : 'viewDate';\n\n\t\tupdate[ date ] = this.state[ date ].clone()[ op ]( amount, type );\n\n\t\tthis.setState( update );\n\t}\n\n\tviewToMethod = {days: 'date', months: 'month', years: 'year'};\n\tnextView = { days: 'time', months: 'days', years: 'months'};\n\t_updateDate = e => {\n\t\tlet state = this.state;\n\t\tlet currentView = state.currentView;\n\t\tlet updateOnView = this.getUpdateOn( this.getFormat('date') );\n\t\tlet viewDate = this.state.viewDate.clone();\n\n\t\t// Set the value into day/month/year\n\t\tviewDate[ this.viewToMethod[currentView] ](\n\t\t\tparseInt( e.target.getAttribute('data-value'), 10 )\n\t\t);\n\n\t\t// Need to set month and year will for days view (prev/next month)\n\t\tif ( currentView === 'days' ) {\n\t\t\tviewDate.month( parseInt( e.target.getAttribute('data-month'), 10 ) );\n\t\t\tviewDate.year( parseInt( e.target.getAttribute('data-year'), 10 ) );\n\t\t}\n\n\t\tlet update = {viewDate: viewDate};\n\t\tif ( currentView === updateOnView ) {\n\t\t\tupdate.selectedDate = viewDate.clone();\n\t\t\tupdate.inputValue = viewDate.format( this.getFormat('datetime') );\n\n\t\t\tif ( this.props.open === undefined && this.props.input && this.props.closeOnSelect ) {\n\t\t\t\tthis._closeCalendar();\n\t\t\t}\n\n\t\t\tthis.props.onChange( viewDate.clone() );\n\t\t}\n\t\telse {\n\t\t\tthis._showView( this.nextView[ currentView ], viewDate );\n\t\t}\n\n\t\tthis.setState( update );\n\t}\n\n\t_viewNavigate = ( modifier, unit ) => {\n\t\tlet viewDate = this.state.viewDate.clone();\n\t\t\n\t\t// Subtracting is just adding negative time\n\t\tviewDate.add( modifier, unit );\n\n\t\tif ( modifier > 0 ) {\n\t\t\tthis.props.onNavigateForward( modifier, unit );\n\t\t}\n\t\telse {\n\t\t\tthis.props.onNavigateBack( -(modifier), unit );\n\t\t}\n\n\t\tthis.setState({viewDate});\n\t}\n\t\n\t_setTime = ( type, value ) => {\n\t\tlet date = (this.getSelectedDate() || this.state.viewDate).clone();\n\t\t\n\t\tdate[ type ]( value );\n\n\t\tif ( !this.props.value ) {\n\t\t\tthis.setState({\n\t\t\t\tselectedDate: date,\n\t\t\t\tviewDate: date.clone(),\n\t\t\t\tinputValue: date.format( this.getFormat('datetime') )\n\t\t\t});\n\t\t}\n\n\t\tthis.props.onChange( date );\n\t}\n\n\t_openCalendar = () => {\n\t\tif ( this.isOpen() ) return;\n\t\tthis.setState({open: true}, this.props.onOpen );\n\t}\n\n\t_closeCalendar = () => {\n\t\tif ( !this.isOpen() ) return;\n\n\t\tthis.setState({open: false}, () => {\n\t\t\t this.props.onClose( this.state.selectedDate || this.state.inputValue );\n\t\t});\n\t}\n\n\t_handleClickOutside = () => {\n\t\tlet props = this.props;\n\n\t\tif ( props.input && this.state.open && props.open === undefined && props.closeOnClickOutside ) {\n\t\t\tthis._closeCalendar();\n\t\t}\n\t}\n\n\tlocalMoment( date, format, props ) {\n\t\tprops = props || this.props;\n\t\tlet m = null;\n\n\t\tif (props.utc) {\n\t\t\tm = moment.utc(date, format, props.strictParsing);\n\t\t} else if (props.displayTimeZone) {\n\t\t\tm = moment.tz(date, format, props.displayTimeZone);\n\t\t} else {\n\t\t\tm = moment(date, format, props.strictParsing);\n\t\t}\n\n\t\tif ( props.locale )\n\t\t\tm.locale( props.locale );\n\t\treturn m;\n\t}\n\n\tcheckTZ( props ) {\n\t\tif ( props.displayTimeZone && !this.tzWarning && !moment.tz ) {\n\t\t\tthis.tzWarning = true;\n\t\t\tthis.log('displayTimeZone prop with value \"' + props.displayTimeZone + '\" is used but moment.js timezone is not loaded.', 'error');\n\t\t}\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tif ( prevProps === this.props ) return;\n\n\t\tlet needsUpdate = false;\n\t\tlet thisProps = this.props;\n\n\t\t['locale', 'utc', 'displayZone', 'dateFormat', 'timeFormat'].forEach( function(p) {\n\t\t\tprevProps[p] !== thisProps[p] && (needsUpdate = true);\n\t\t});\n\n\t\tif ( needsUpdate ) {\n\t\t\tthis.regenerateDates( this.props );\n\t\t}\n\n\t\tif ( thisProps.value && thisProps.value !== prevProps.value ) {\n\t\t\tthis.setViewDate( thisProps.value );\n\t\t}\n\n\t\tthis.checkTZ( this.props );\n\t}\n\n\tregenerateDates(props) {\n\t\tlet viewDate = this.state.viewDate.clone();\n\t\tlet selectedDate = this.state.selectedDate && this.state.selectedDate.clone();\n\n\t\tif ( props.locale ) {\n\t\t\tviewDate.locale( props.locale );\n\t\t\tselectedDate &&\tselectedDate.locale( props.locale );\n\t\t}\n\t\tif ( props.utc ) {\n\t\t\tviewDate.utc();\n\t\t\tselectedDate &&\tselectedDate.utc();\n\t\t}\n\t\telse if ( props.displayTimeZone ) {\n\t\t\tviewDate.tz( props.displayTimeZone );\n\t\t\tselectedDate &&\tselectedDate.tz( props.displayTimeZone );\n\t\t}\n\t\telse {\n\t\t\tviewDate.locale();\n\t\t\tselectedDate &&\tselectedDate.locale();\n\t\t}\n\n\t\tlet update = { viewDate: viewDate, selectedDate: selectedDate};\n\t\tif ( selectedDate && selectedDate.isValid() ) {\n\t\t\tupdate.inputValue = selectedDate.format( this.getFormat('datetime') );\n\t\t}\n\t\t\n\t\tthis.setState( update );\n\t}\n\n\tgetSelectedDate() {\n\t\tif ( this.props.value === undefined ) return this.state.selectedDate;\n\t\tlet selectedDate = this.parseDate( this.props.value, this.getFormat('datetime') );\n\t\treturn selectedDate && selectedDate.isValid() ? selectedDate : false;\n\t}\n\n\tgetInitialInputValue( props, selectedDate, inputFormat ) {\n\t\tif ( props.inputProps.value )\n\t\t\treturn props.inputProps.value;\n\t\t\n\t\tif ( selectedDate && selectedDate.isValid() )\n\t\t\treturn selectedDate.format( inputFormat );\n\t\t\n\t\tif ( props.value && typeof props.value === 'string' )\n\t\t\treturn props.value;\n\t\t\n\t\tif ( props.initialValue && typeof props.initialValue === 'string' )\n\t\t\treturn props.initialValue;\n\t\t\n\t\treturn '';\n\t}\n\n\tgetInputValue() {\n\t\tlet selectedDate = this.getSelectedDate();\n\t\treturn selectedDate ? selectedDate.format( this.getFormat('datetime') ) : this.state.inputValue;\n\t}\n\n\t/**\n\t * Set the date that is currently shown in the calendar.\n\t * This is independent from the selected date and it's the one used to navigate through months or days in the calendar.\n\t * @param dateType date\n\t * @public\n\t */\n\tsetViewDate( date ) {\n\t\tlet me = this;\n\t\tlet logError = function() {\n\t\t\treturn me.log( 'Invalid date passed to the `setViewDate` method: ' + date );\n\t\t};\n\n\t\tif ( !date ) return logError();\n\t\t\n\t\tlet viewDate;\n\t\tif ( typeof date === 'string' ) {\n\t\t\tviewDate = this.localMoment(date, this.getFormat('datetime') );\n\t\t}\n\t\telse {\n\t\t\tviewDate = this.localMoment( date );\n\t\t}\n\n\t\tif ( !viewDate || !viewDate.isValid() ) return logError();\n\t\tthis.setState({ viewDate: viewDate });\n\t}\n\n\t/**\n\t * Set the view currently shown by the calendar. View modes shipped with react-datetime are 'years', 'months', 'days' and 'time'.\n\t * @param TYPES.string mode \n\t */\n\tnavigate( mode ) {\n\t\tthis._showView( mode );\n\t}\n\n\tlog( message, method ) {\n\t\tlet con = typeof window !== 'undefined' && window.console;\n\t\tif ( !con ) return;\n\n\t\tif ( !method ) {\n\t\t\tmethod = 'warn';\n\t\t}\n\t\tcon[ method ]( '***react-datetime:' + message );\n\t}\n\n\t_onInputFocus = e => {\n\t\tif ( !this.callHandler( this.props.inputProps.onFocus, e ) ) return;\n\t\tthis._openCalendar();\n\t}\n\n\t_onInputChange = e => {\n\t\tif ( !this.callHandler( this.props.inputProps.onChange, e ) ) return;\n\n\t\tconst value = e.target ? e.target.value : e;\n\t\tconst localMoment = this.localMoment( value, this.getFormat('datetime') );\n\t\tlet update = { inputValue: value };\n\n\t\tif ( localMoment.isValid() ) {\n\t\t\tupdate.selectedDate = localMoment;\n\t\t\tupdate.viewDate = localMoment.clone().startOf('month');\n\t\t}\n\t\telse {\n\t\t\tupdate.selectedDate = null;\n\t\t}\n\n\t\tthis.setState( update, () => {\n\t\t\tthis.props.onChange( localMoment.isValid() ? localMoment : this.state.inputValue );\n\t\t});\n\t}\n\n\t_onInputKeyDown = e => {\n\t\tif ( !this.callHandler( this.props.inputProps.onKeyDown, e ) ) return;\n\n\t\tif ( e.which === 9 && this.props.closeOnTab ) {\n\t\t\tthis._closeCalendar();\n\t\t}\n\t}\n\n\t_onInputClick = e => {\n\t\t// Focus event should open the calendar, but there is some case where\n\t\t// the input is already focused and the picker is closed, so clicking the input\n\t\t// should open it again see https://github.com/arqex/react-datetime/issues/717\n\t\tconsole.log('CLICKING 2!');\n\t\tif ( !this.callHandler( this.props.inputProps.onClick, e ) ) return;\n\t\tthis._openCalendar();\n\t}\n\n\tcallHandler( method, e ) {\n\t\tif ( !method ) return true;\n\t\treturn method(e) !== false;\n\t}\n}\n\nclass ClickOutBase extends React.Component {\n\tcontainer = React.createRef();\n\n\trender() {\n\t\treturn (\n\t\t\t
\n\t\t\t\t{ this.props.children }\n\t\t\t
\n\t\t);\n\t}\n\thandleClickOutside(e) {\n\t\tthis.props.onClickOut( e );\n\t}\n\n\tsetClickOutsideRef() {\n\t\treturn this.container.current;\n\t}\n}\n\nconst ClickableWrapper = onClickOutside( ClickOutBase );\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://Datetime/webpack/universalModuleDefinition","webpack://Datetime/webpack/bootstrap","webpack://Datetime/external \"react\"","webpack://Datetime/external \"moment\"","webpack://Datetime/./node_modules/prop-types/index.js","webpack://Datetime/external \"react-dom\"","webpack://Datetime/./node_modules/prop-types/factoryWithThrowingShims.js","webpack://Datetime/./node_modules/prop-types/lib/ReactPropTypesSecret.js","webpack://Datetime/./src/parts/ViewNavigation.js","webpack://Datetime/./src/views/DaysView.js","webpack://Datetime/./src/views/MonthsView.js","webpack://Datetime/./src/views/YearsView.js","webpack://Datetime/./src/views/TimeView.js","webpack://Datetime/./node_modules/react-onclickoutside/dist/react-onclickoutside.es.js","webpack://Datetime/./src/DateTime.js"],"names":["root","factory","exports","module","require","define","amd","window","__WEBPACK_EXTERNAL_MODULE__0__","__WEBPACK_EXTERNAL_MODULE__1__","__WEBPACK_EXTERNAL_MODULE__3__","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","ReactPropTypesSecret","emptyFunction","emptyFunctionWithReset","resetWarningCache","shim","props","propName","componentName","location","propFullName","secret","err","Error","getShim","isRequired","ReactPropTypes","array","bool","func","number","string","symbol","any","arrayOf","element","elementType","instanceOf","node","objectOf","oneOf","oneOfType","shape","exact","checkPropTypes","PropTypes","ViewNavigation","onClickPrev","onClickSwitch","onClickNext","switchContent","switchColSpan","switchProps","className","onClick","colSpan","DaysView","e","updateDate","this","renderNavigation","renderDayHeaders","renderDays","renderFooter","date","viewDate","locale","localeData","navigate","showView","months","year","month","dayItems","first","firstDayOfWeek","dow","_weekdaysMin","forEach","day","getDaysOfWeek","map","index","startOfMonth","clone","startOf","endOfMonth","endOf","rows","startDate","subtract","daysInMonth","endDate","add","isBefore","getRow","push","renderDay","selectedDate","dayProps","format","isAfter","isSame","moment","isValidDate","_setDate","timeFormat","React","Component","Math","floor","MonthsView","event","renderMonths","renderMonth","isDisabledMonth","_updateSelectedMonth","getMonthText","set","str","localMoment","monthStr","monthsShort","substring","charAt","toUpperCase","slice","YearsView","renderYears","viewYear","getViewYear","renderYear","years","selectedYear","getSelectedYear","isDisabledYear","_updateSelectedYear","parseInt","cache","disabledYearsCache","undefined","dayOfYear","timeConstraints","hours","min","max","step","minutes","seconds","milliseconds","TimeView","overrideTimeConstraints","constraints","keys","type","state","getTimeParts","items","timeParts","getCounters","renderCounter","renderHeader","isAMPM","indexOf","onMouseDown","onStartClicking","dateFormat","action","button","toggleDayPart","update","body","document","setState","timer","setTimeout","increaseTimer","setInterval","mouseUpListener","clearTimeout","clearInterval","setTime","removeEventListener","addEventListener","tc","pad","counters","toLowerCase","ampm","prevProps","padValues","length","isNodeFound","current","componentNode","ignoreClass","correspondingElement","classList","contains","seed","passiveEventSupport","uid","handlersMap","enabledInstances","touchEvents","getEventHandlerOptions","instance","eventName","handlerOptions","passive","preventDefault","WrappedComponent","config","_class","_temp","displayName","_Component","subClass","superClass","onClickOutside","_this","__outsideClickHandler","__clickOutsideHandlerProp","getInstance","handleClickOutside","__getComponentNode","setClickOutsideRef","enableOnClickOutside","_uid","options","noop","testPassiveEventSupport","events","eventTypes","evt","stopPropagation","excludeScrollbar","documentElement","clientWidth","clientX","clientHeight","clientY","parentNode","findHighest","target","outsideClickIgnoreClass","disableOnClickOutside","fn","getRef","ref","instanceRef","constructor","__proto__","_proto","isReactComponent","componentDidMount","createElement","componentDidUpdate","componentWillUnmount","render","_props","source","excluded","sourceKeys","getOwnPropertySymbols","sourceSymbolKeys","propertyIsEnumerable","_objectWithoutProperties","wrappedRef","defaultProps","getClass","viewModes","TYPES","nofn","datetype","Date","Datetime","viewProps","getSelectedDate","_updateDate","_viewNavigate","_showView","currentView","getFormat","_setTime","view","nextView","onBeforeNavigate","onNavigate","days","updateOnView","getUpdateOn","viewToMethod","getAttribute","inputValue","open","input","closeOnSelect","_closeCalendar","onChange","modifier","unit","onNavigateForward","onNavigateBack","isOpen","onOpen","onClose","closeOnClickOutside","callHandler","inputProps","onFocus","_openCalendar","isValid","onKeyDown","which","closeOnTab","getInitialState","ClickableWrapper","getClassName","onClickOut","_handleClickOutside","renderInput","renderView","finalInputProps","getInputValue","_onInputFocus","_onInputChange","_onInputKeyDown","_onInputClick","_renderCalendar","inputFormat","parseDate","initialValue","checkTZ","initialViewMode","getInitialView","getInitialViewDate","getInitialInputValue","propDate","initialViewDate","log","getInitialDate","hour","minute","second","millisecond","parsedDate","cn","propCn","Array","isArray","join","match","defaultValue","getLocaleData","longDateFormat","getDateFormat","getTimeFormat","op","amount","toSelected","utc","strictParsing","displayTimeZone","tz","tzWarning","needsUpdate","thisProps","regenerateDates","setViewDate","me","logError","method","message","con","console","onCalendarOpen","onCalendarClose","next","_","renderFunc","createRef","container","children"],"mappings":"CAAA,SAA2CA,EAAMC,GAE1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,EAAQG,QAAQ,SAAUA,QAAQ,UAAWA,QAAQ,cAE7C,mBAAXC,QAAyBA,OAAOC,IAC9CD,OAAO,CAAC,QAAS,SAAU,aAAcJ,GAEf,iBAAZC,QACdA,QAAkB,SAAID,EAAQG,QAAQ,SAAUA,QAAQ,UAAWA,QAAQ,cAG3EJ,EAAe,SAAIC,EAAQD,EAAY,MAAGA,EAAa,OAAGA,EAAK,cAZjE,CAaGO,QAAQ,SAASC,EAAgC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P,KAClBsS,WAAYlD,GAAMnP,KAClBoS,YAAajD,GAAMnP,KACnBoE,UAAW+K,GAAMnP,KACjBqF,YAAa8J,GAAMnP,KACnBsG,WAAY6I,GAAMnP,O,GA/BCuP,G,eAkCE,CACrB6B,OAAQhC,GACRiC,QAASjC,GACTuG,eAAgBvG,GAChBwG,gBAAiBxG,GACjB0B,SAAU1B,GACVe,WAAYf,GACZc,iBAAkB,SAAS2F,GAAQ,OAAOA,GAC1C3E,eAAgB9B,GAChB6B,kBAAmB7B,GACnB3G,YAAY,EACZ5D,YAAY,EACZ+P,KAAK,EACLpT,UAAW,GACXmP,OAAO,EACPa,WAAY,GACZvK,gBAAiB,GACjBtC,YAAa,WAAa,OAAO,GACjCkQ,eAAe,EACfjE,eAAe,EACfkB,YAAY,EACZR,qBAAqB,EACrBe,WAAY,SAAEyD,EAAGC,GAAL,OAAqBA,O,GAxDdxG,G,SA4DJ7K,K,IA4iBXsN,GAAmBlG,G,mMAlBZhH,IAAMkR,a,8CAGjB,OACC,yBAAKxU,UAAYM,KAAK3C,MAAMqC,UAAYoM,IAAM9L,KAAKmU,WAChDnU,KAAK3C,MAAM+W,Y,yCAIGtU,GAClBE,KAAK3C,MAAM+S,WAAYtQ,K,2CAIvB,OAAOE,KAAKmU,UAAU7L,Y,GAfGtF,IAAMC,e","file":"react-datetime.umd.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\t//React datetime\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"), require(\"moment\"), require(\"react-dom\"));\n\t//React datetime\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\", \"moment\", \"react-dom\"], factory);\n\t//React datetime\n\telse if(typeof exports === 'object')\n\t\texports[\"Datetime\"] = factory(require(\"react\"), require(\"moment\"), require(\"react-dom\"));\n\t//React datetime\n\telse\n\t\troot[\"Datetime\"] = factory(root[\"react\"], root[\"moment\"], root[\"react-dom\"]);\n})(window, function(__WEBPACK_EXTERNAL_MODULE__0__, __WEBPACK_EXTERNAL_MODULE__1__, __WEBPACK_EXTERNAL_MODULE__3__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 4);\n","module.exports = __WEBPACK_EXTERNAL_MODULE__0__;","module.exports = __WEBPACK_EXTERNAL_MODULE__1__;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nif (process.env.NODE_ENV !== 'production') {\n var ReactIs = require('react-is');\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(ReactIs.isElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}\n","module.exports = __WEBPACK_EXTERNAL_MODULE__3__;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n\nfunction emptyFunction() {}\nfunction emptyFunctionWithReset() {}\nemptyFunctionWithReset.resetWarningCache = emptyFunction;\n\nmodule.exports = function() {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret) {\n // It is still safe when called from React.\n return;\n }\n var err = new Error(\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n err.name = 'Invariant Violation';\n throw err;\n };\n shim.isRequired = shim;\n function getShim() {\n return shim;\n };\n // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n var ReactPropTypes = {\n array: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n\n any: shim,\n arrayOf: getShim,\n element: shim,\n elementType: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim,\n exact: getShim,\n\n checkPropTypes: emptyFunctionWithReset,\n resetWarningCache: emptyFunction\n };\n\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n","import React from 'react';\n\nexport default function ViewNavigation( { onClickPrev, onClickSwitch, onClickNext, switchContent, switchColSpan, switchProps } ) {\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t{ switchContent }\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t);\n}\n","import React from 'react';\nimport ViewNavigation from '../parts/ViewNavigation';\n\nexport default class DaysView extends React.Component {\n\tstatic defaultProps = {\n\t\tisValidDate: () => true,\n\t\trenderDay: ( props, date ) => { date.date() },\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{ this.renderNavigation() }\n\t\t\t\t\t\t{ this.renderDayHeaders() }\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{ this.renderDays() }\n\t\t\t\t\t\n\t\t\t\t\t{ this.renderFooter() }\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n\n\trenderNavigation() {\n\t\tconst date = this.props.viewDate;\n\t\tconst locale = date.localeData();\n\t\treturn (\n\t\t\t this.props.navigate( -1, 'months' ) }\n\t\t\t\tonClickSwitch={ () => this.props.showView( 'months' ) }\n\t\t\t\tonClickNext={ () => this.props.navigate( 1, 'months' ) }\n\t\t\t\tswitchContent={ locale.months( date ) + ' ' + date.year() }\n\t\t\t\tswitchColSpan={5}\n\t\t\t\tswitchProps={ { 'data-value': this.props.viewDate.month() } }\n\t\t\t/>\n\t\t);\n\t}\n\n\trenderDayHeaders() {\n\t\tconst locale = this.props.viewDate.localeData();\n\t\tlet dayItems = getDaysOfWeek( locale ).map( (day, index) => (\n\t\t\t{ day }\n\t\t));\n\n\t\treturn (\n\t\t\t\n\t\t\t\t{ dayItems }\n\t\t\t\n\t\t);\n\t}\n\n\trenderDays() {\n\t\tconst date = this.props.viewDate;\n\t\tconst startOfMonth = date.clone().startOf('month');\n\t\tconst endOfMonth = date.clone().endOf('month');\n\n\t\t// We need 42 days in 6 rows\n\t\t// starting in the last week of the previous month\n\t\tlet rows = [[], [], [], [], [], []];\n\n\t\tlet startDate = date.clone().subtract( 1, 'months');\n\t\tstartDate.date( startDate.daysInMonth() ).startOf('week');\n\n\t\tlet endDate = startDate.clone().add( 42, 'd' );\n\t\tlet i = 0;\n\n\t\twhile ( startDate.isBefore( endDate ) ) {\n\t\t\tlet row = getRow( rows, i++ );\n\t\t\trow.push( this.renderDay( startDate, startOfMonth, endOfMonth ) );\n\t\t\tstartDate.add( 1, 'd' );\n\t\t}\n\n\t\treturn rows.map( (r, i) => (\n\t\t\t{ r }\n\t\t));\n\t}\n\n\trenderDay( date, startOfMonth, endOfMonth ) {\n\t\tlet selectedDate = this.props.selectedDate;\n\n\t\tlet dayProps = {\n\t\t\tkey: date.format('M_D'),\n\t\t\t'data-value': date.date(),\n\t\t\t'data-month': date.month(),\n\t\t\t'data-year': date.year()\n\t\t};\n\n\t\tlet className = 'rdtDay';\n\t\tif ( date.isBefore( startOfMonth ) ) {\n\t\t\tclassName += ' rdtOld';\n\t\t}\n\t\telse if ( date.isAfter( endOfMonth ) ) {\n\t\t\tclassName += ' rdtNew';\n\t\t}\n\t\tif ( selectedDate && date.isSame( selectedDate, 'day' ) ) {\n\t\t\tclassName += ' rdtActive';\n\t\t}\n\t\tif ( date.isSame( this.props.moment(), 'day' ) ) {\n\t\t\tclassName += ' rdtToday';\n\t\t}\n\n\t\tif ( this.props.isValidDate(date) ) {\n\t\t\tdayProps.onClick = this._setDate;\n\t\t}\n\t\telse {\n\t\t\tclassName += ' rdtDisabled';\n\t\t}\n\n\t\tdayProps.className = className;\n\n\t\treturn this.props.renderDay(\n\t\t\tdayProps, date.clone(), selectedDate && selectedDate.clone()\n\t\t);\n\t}\n\n\trenderFooter() {\n\t\tif ( !this.props.timeFormat ) return;\n\n\t\tconst date = this.props.viewDate;\n\t\treturn (\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t this.props.showView('time') }\n\t\t\t\t\t\tcolSpan={7}\n\t\t\t\t\t\tclassName=\"rdtTimeToggle\">\n\t\t\t\t\t\t{ date.format( this.props.timeFormat ) }\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t);\n\t}\n\n\t_setDate = e => {\n\t\tthis.props.updateDate( e );\n\t}\n}\n\nfunction getRow( rows, day ) {\n\treturn rows[ Math.floor( day / 7 ) ];\n}\n\n/**\n * Get a list of the days of the week\n * depending on the current locale\n * @return {array} A list with the shortname of the days\n */\nfunction getDaysOfWeek( locale ) {\n\tconst first = locale.firstDayOfWeek();\n\tlet dow = [];\n\tlet i = 0;\n\n\tlocale._weekdaysMin.forEach(function (day) {\n\t\tdow[(7 + (i++) - first) % 7] = day;\n\t});\n\n\treturn dow;\n}\n","import React from 'react';\nimport ViewNavigation from '../parts/ViewNavigation';\n\nexport default class MonthsView extends React.Component {\n\trender() {\n\t\treturn (\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{ this.renderNavigation() }\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{ this.renderMonths() }\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n\n\trenderNavigation() {\n\t\tlet year = this.props.viewDate.year();\n\n\t\treturn (\n\t\t\t this.props.navigate( -1, 'years' ) }\n\t\t\t\tonClickSwitch={ () => this.props.showView( 'years' ) }\n\t\t\t\tonClickNext={ () => this.props.navigate( 1, 'years' ) }\n\t\t\t\tswitchContent={ year }\n\t\t\t\tswitchColSpan=\"2\"\n\t\t\t/>\n\t\t);\n\t}\n\n\trenderMonths() {\n\t\t// 12 months in 3 rows for every view\n\t\tlet rows = [ [], [], [] ];\n\n\t\tfor ( let month = 0; month < 12; month++ ) {\n\t\t\tlet row = getRow( rows, month );\n\n\t\t\trow.push( this.renderMonth( month ) );\n\t\t}\n\n\t\treturn rows.map( (months, i) => (\n\t\t\t{ months }\n\t\t));\n\t}\n\n\trenderMonth( month ) {\n\t\tconst selectedDate = this.props.selectedDate;\n\t\tlet className = 'rdtMonth';\n\t\tlet onClick;\n\n\t\tif ( this.isDisabledMonth( month ) ) {\n\t\t\tclassName += ' rdtDisabled';\n\t\t}\n\t\telse {\n\t\t\tonClick = this._updateSelectedMonth;\n\t\t}\n\n\t\tif ( selectedDate && selectedDate.year() === this.props.viewDate.year() && selectedDate.month() === month ) {\n\t\t\tclassName += ' rdtActive';\n\t\t}\n\n\t\tlet props = {key: month, className, 'data-value': month, onClick };\n\n\t\tif ( this.props.renderMonth ) {\n\t\t\treturn this.props.renderMonth(\n\t\t\t\tprops,\n\t\t\t\tmonth,\n\t\t\t\tthis.props.viewDate.year(),\n\t\t\t\tthis.props.selectedDate && this.props.selectedDate.clone()\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t\n\t\t\t\t{ this.getMonthText( month ) }\n\t\t\t\n\t\t);\n\t}\n\t\n\tisDisabledMonth( month ) {\n\t\tlet isValidDate = this.props.isValidDate;\n\n\t\tif ( !isValidDate ) {\n\t\t\t// If no validator is set, all days are valid\n\t\t\treturn false;\n\t\t}\n\n\t\t// If one day in the month is valid, the year should be clickable\n\t\tlet date = this.props.viewDate.clone().set({month});\n\t\tlet day = date.endOf( 'month' ).date() + 1;\n\n\t\twhile ( day-- > 1 ) {\n\t\t\tif ( isValidDate( date.date(day) ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\tgetMonthText( month ) {\n\t\tconst localMoment = this.props.viewDate;\n\t\tconst monthStr = localMoment.localeData().monthsShort( localMoment.month( month ) );\n\n\t\t// Because some months are up to 5 characters long, we want to\n\t\t// use a fixed string length for consistency\n\t\treturn capitalize( monthStr.substring( 0, 3 ) );\n\t}\n\n\t_updateSelectedMonth = event => {\n\t\tthis.props.updateDate( event );\n\t}\n}\n\nfunction getRow( rows, year ) {\n\tif ( year < 4 ) {\n\t\treturn rows[0];\n\t}\n\tif ( year < 8 ) {\n\t\treturn rows[1];\n\t}\n\n\treturn rows[2];\n}\n\nfunction capitalize( str ) {\n\treturn str.charAt( 0 ).toUpperCase() + str.slice( 1 );\n}\n","import React from 'react';\nimport ViewNavigation from '../parts/ViewNavigation';\n\nexport default class YearsView extends React.Component {\n\tstatic defaultProps = {\n\t\trenderYear: ( props, year ) => { year },\n\t};\n\n\trender() {\n\t\treturn (\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{ this.renderNavigation() }\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{ this.renderYears() }\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n\n\trenderNavigation() {\n\t\tconst viewYear = this.getViewYear();\n\t\treturn (\n\t\t\t this.props.navigate( -10, 'years' ) }\n\t\t\t\tonClickSwitch={ () => this.props.showView( 'years' ) }\n\t\t\t\tonClickNext={ () => this.props.navigate( 10, 'years' ) }\n\t\t\t\tswitchContent={ `${viewYear}-${viewYear + 9}` }\n\t\t\t/>\n\t\t);\n\t}\n\n\trenderYears() {\n\t\tconst viewYear = this.getViewYear();\n\t\t// 12 years in 3 rows for every view\n\t\tlet rows = [ [], [], [] ];\n\t\tfor ( let year = viewYear - 1; year < viewYear + 11; year++ ) {\n\t\t\tlet row = getRow( rows, year - viewYear );\n\n\t\t\trow.push(\n\t\t\t\tthis.renderYear( year )\n\t\t\t);\n\t\t}\n\n\t\treturn rows.map( (years, i) => (\n\t\t\t{ years }\n\t\t));\n\t}\n\n\trenderYear( year ) {\n\t\tconst selectedYear = this.getSelectedYear();\n\t\tlet className = 'rdtYear';\n\t\tlet onClick;\n\n\t\tif ( this.isDisabledYear( year ) ) {\n\t\t\tclassName += ' rdtDisabled';\n\t\t}\n\t\telse {\n\t\t\tonClick = this._updateSelectedYear;\n\t\t}\n\n\t\tif ( selectedYear === year ) {\n\t\t\tclassName += ' rdtActive';\n\t\t}\n\n\t\tlet props = {key: year, className, 'data-value': year, onClick };\n\n\t\treturn this.props.renderYear(\n\t\t\tprops,\n\t\t\tyear,\n\t\t\tthis.props.selectedDate && this.props.selectedDate.clone()\n\t\t);\n\t}\n\n\tgetViewYear() {\n\t\treturn parseInt( this.props.viewDate.year() / 10, 10 ) * 10;\n\t}\n\n\tgetSelectedYear() {\n\t\treturn this.props.selectedDate && this.props.selectedDate.year();\n\t}\n\n\tdisabledYearsCache = {};\n\tisDisabledYear( year ) {\n\t\tlet cache = this.disabledYearsCache;\n\t\tif ( cache[year] !== undefined ) {\n\t\t\treturn cache[year];\n\t\t}\n\n\t\tlet isValidDate = this.props.isValidDate;\n\n\t\tif ( !isValidDate ) {\n\t\t\t// If no validator is set, all days are valid\n\t\t\treturn false;\n\t\t}\n\n\t\t// If one day in the year is valid, the year should be clickable\n\t\tlet date = this.props.viewDate.clone().set({year});\n\t\tlet day = date.endOf( 'year' ).dayOfYear() + 1;\n\n\t\twhile ( day-- > 1 ) {\n\t\t\tif ( isValidDate( date.dayOfYear(day) ) ) {\n\t\t\t\tcache[year] = false;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tcache[year] = true;\n\t\treturn true;\n\t}\n\n\t_updateSelectedYear = event => {\n\t\tthis.props.updateDate( event );\n\t}\n}\n\nfunction getRow( rows, year ) {\n\tif ( year < 3 ) {\n\t\treturn rows[0];\n\t}\n\tif ( year < 7 ) {\n\t\treturn rows[1];\n\t}\n\n\treturn rows[2];\n}\n","import React from 'react';\n\nconst timeConstraints = {\n\thours: {\n\t\tmin: 0,\n\t\tmax: 23,\n\t\tstep: 1\n\t},\n\tminutes: {\n\t\tmin: 0,\n\t\tmax: 59,\n\t\tstep: 1\n\t},\n\tseconds: {\n\t\tmin: 0,\n\t\tmax: 59,\n\t\tstep: 1\n\t},\n\tmilliseconds: {\n\t\tmin: 0,\n\t\tmax: 999,\n\t\tstep: 1\n\t}\n};\n\nfunction createConstraints( overrideTimeConstraints ) {\n\tlet constraints = {};\n\n\tObject.keys( timeConstraints ).forEach( type => {\n\t\tconstraints[ type ] = { ...timeConstraints[type], ...(overrideTimeConstraints[type] || {}) };\n\t});\n\n\treturn constraints;\n}\n\nexport default class TimeView extends React.Component {\n\tconstructor( props ) {\n\t\tsuper( props );\n\n\t\tthis.constraints = createConstraints( props.timeConstraints );\n\n\t\t// This component buffers the time part values in the state \n\t\t// while the user is pressing down the buttons\n\t\t// and call the prop `setTime` when the buttons are released\n\t\tthis.state = this.getTimeParts( props.selectedDate || props.viewDate );\n\t}\n\n\trender() {\n\t\tlet items = [];\n\t\tconst timeParts = this.state;\n\t\t\n\t\tthis.getCounters().forEach( (c, i) => {\n\t\t\tif ( i && c !== 'ampm' ) {\n\t\t\t\titems.push(\n\t\t\t\t\t
:
\n\t\t\t\t);\n\t\t\t}\n\n\t\t\titems.push( this.renderCounter(c, timeParts[c]) );\n\t\t});\n\n\t\treturn (\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t{ this.renderHeader() }\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t{ items }\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n\n\trenderCounter( type, value ) {\n\t\tif ( type === 'hours' && this.isAMPM() ) {\n\t\t\tvalue = ( value - 1 ) % 12 + 1;\n\n\t\t\tif ( value === 0 ) {\n\t\t\t\tvalue = 12;\n\t\t\t}\n\t\t}\n\n\t\tif ( type === 'ampm' ) {\n\t\t\tif ( this.props.timeFormat.indexOf(' A') !== -1 ) {\n\t\t\t\tvalue = this.props.viewDate.format('A');\n\t\t\t}\n\t\t\telse {\n\t\t\t\tvalue = this.props.viewDate.format('a');\n\t\t\t}\n\t\t}\n\n\t\treturn (\n\t\t\t
\n\t\t\t\t this.onStartClicking( e, 'increase', type)}>▲\n\t\t\t\t
{ value }
\n\t\t\t\t this.onStartClicking( e, 'decrease', type)}>▼\n\t\t\t
\n\t\t);\n\t}\n\n\trenderHeader() {\n\t\tif ( !this.props.dateFormat ) return;\n\n\t\tconst date = this.props.selectedDate || this.props.viewDate;\n\n\t\treturn (\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t this.props.showView('days') }>\n\t\t\t\t\t\t{ date.format( this.props.dateFormat ) }\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t);\n\t}\n\n\tonStartClicking( e, action, type ) {\n\t\tif ( e && e.button && e.button !== 0 ) {\n\t\t\t// Only left clicks, thanks\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif ( type === 'ampm' ) return this.toggleDayPart();\n\n\t\tlet update = {};\n\t\tlet body = document.body;\n\t\tupdate[ type ] = this[ action ]( type );\n\t\tthis.setState( update );\n\n\t\tthis.timer = setTimeout( () => {\n\t\t\tthis.increaseTimer = setInterval( () => {\n\t\t\t\tupdate[ type ] = this[ action ]( type );\n\t\t\t\tthis.setState( update );\n\t\t\t}, 70);\n\t\t}, 500);\n\n\t\tthis.mouseUpListener = () => {\n\t\t\tclearTimeout( this.timer );\n\t\t\tclearInterval( this.increaseTimer );\n\t\t\tthis.props.setTime( type, parseInt( this.state[ type ], 10 ) );\n\t\t\tbody.removeEventListener( 'mouseup', this.mouseUpListener );\n\t\t\tbody.removeEventListener( 'touchend', this.mouseUpListener );\n\t\t};\n\n\t\tbody.addEventListener( 'mouseup', this.mouseUpListener );\n\t\tbody.addEventListener( 'touchend', this.mouseUpListener );\n\t}\n\n\ttoggleDayPart() {\n\t\tlet hours = parseInt( this.state.hours, 10 );\n\t\t\n\t\tif ( hours >= 12 ) {\n\t\t\thours -= 12;\n\t\t}\n\t\telse {\n\t\t\thours += 12;\n\t\t}\n\n\t\tthis.props.setTime( 'hours', hours );\n\t}\n\n\tincrease( type ) {\n\t\tconst tc = this.constraints[ type ];\n\t\tlet value = parseInt( this.state[ type ], 10) + tc.step;\n\t\tif ( value > tc.max )\n\t\t\tvalue = tc.min + ( value - ( tc.max + 1 ) );\n\t\treturn pad( type, value );\n\t}\n\n\tdecrease( type ) {\n\t\tconst tc = this.constraints[ type ];\n\t\tlet value = parseInt( this.state[ type ], 10) - tc.step;\n\t\tif ( value < tc.min )\n\t\t\tvalue = tc.max + 1 - ( tc.min - value );\n\t\treturn pad( type, value );\n\t}\n\n\tgetCounters() {\n\t\tlet counters = [];\n\t\tlet format = this.props.timeFormat;\n\t\t\n\t\tif ( format.toLowerCase().indexOf('h') !== -1 ) {\n\t\t\tcounters.push('hours');\n\t\t\tif ( format.indexOf('m') !== -1 ) {\n\t\t\t\tcounters.push('minutes');\n\t\t\t\tif ( format.indexOf('s') !== -1 ) {\n\t\t\t\t\tcounters.push('seconds');\n\t\t\t\t\tif ( format.indexOf('S') !== -1 ) {\n\t\t\t\t\t\tcounters.push('milliseconds');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( this.isAMPM() ) {\n\t\t\tcounters.push('ampm');\n\t\t}\n\n\t\treturn counters;\n\t}\n\n\tisAMPM() {\n\t\treturn this.props.timeFormat.toLowerCase().indexOf( ' a' ) !== -1;\n\t}\n\n\tgetTimeParts( date ) {\n\t\tconst hours = date.hours();\n\n\t\treturn {\n\t\t\thours: pad( 'hours', hours ),\n\t\t\tminutes: pad( 'minutes', date.minutes() ),\n\t\t\tseconds: pad( 'seconds', date.seconds() ),\n\t\t\tmilliseconds: pad('milliseconds', date.milliseconds() ),\n\t\t\tampm: hours < 12 ? 'am' : 'pm'\n\t\t};\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tif ( this.props.selectedDate ) {\n\t\t\tif ( this.props.selectedDate !== prevProps.selectedDate ) {\n\t\t\t\tthis.setState( this.getTimeParts( this.props.selectedDate ) );\n\t\t\t}\n\t\t}\n\t\telse if ( prevProps.viewDate !== this.props.viewDate ) {\n\t\t\tthis.setState( this.getTimeParts( this.props.viewDate ) );\n\t\t}\n\t}\n}\n\nfunction pad( type, value ) {\n\tconst padValues = {\n\t\thours: 1,\n\t\tminutes: 2,\n\t\tseconds: 2,\n\t\tmilliseconds: 3\n\t};\n\n\tlet str = value + '';\n\twhile ( str.length < padValues[ type ] )\n\t\tstr = '0' + str;\n\treturn str;\n}\n","import { Component, createElement } from 'react';\nimport { findDOMNode } from 'react-dom';\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\n/**\n * Check whether some DOM node is our Component's node.\n */\nfunction isNodeFound(current, componentNode, ignoreClass) {\n if (current === componentNode) {\n return true;\n } // SVG elements do not technically reside in the rendered DOM, so\n // they do not have classList directly, but they offer a link to their\n // corresponding element, which can have classList. This extra check is for\n // that case.\n // See: http://www.w3.org/TR/SVG11/struct.html#InterfaceSVGUseElement\n // Discussion: https://github.com/Pomax/react-onclickoutside/pull/17\n\n\n if (current.correspondingElement) {\n return current.correspondingElement.classList.contains(ignoreClass);\n }\n\n return current.classList.contains(ignoreClass);\n}\n/**\n * Try to find our node in a hierarchy of nodes, returning the document\n * node as highest node if our node is not found in the path up.\n */\n\nfunction findHighest(current, componentNode, ignoreClass) {\n if (current === componentNode) {\n return true;\n } // If source=local then this event came from 'somewhere'\n // inside and should be ignored. We could handle this with\n // a layered approach, too, but that requires going back to\n // thinking in terms of Dom node nesting, running counter\n // to React's 'you shouldn't care about the DOM' philosophy.\n\n\n while (current.parentNode) {\n if (isNodeFound(current, componentNode, ignoreClass)) {\n return true;\n }\n\n current = current.parentNode;\n }\n\n return current;\n}\n/**\n * Check if the browser scrollbar was clicked\n */\n\nfunction clickedScrollbar(evt) {\n return document.documentElement.clientWidth <= evt.clientX || document.documentElement.clientHeight <= evt.clientY;\n}\n\n// ideally will get replaced with external dep\n// when rafrex/detect-passive-events#4 and rafrex/detect-passive-events#5 get merged in\nvar testPassiveEventSupport = function testPassiveEventSupport() {\n if (typeof window === 'undefined' || typeof window.addEventListener !== 'function') {\n return;\n }\n\n var passive = false;\n var options = Object.defineProperty({}, 'passive', {\n get: function get() {\n passive = true;\n }\n });\n\n var noop = function noop() {};\n\n window.addEventListener('testPassiveEventSupport', noop, options);\n window.removeEventListener('testPassiveEventSupport', noop, options);\n return passive;\n};\n\nfunction autoInc(seed) {\n if (seed === void 0) {\n seed = 0;\n }\n\n return function () {\n return ++seed;\n };\n}\n\nvar uid = autoInc();\n\nvar passiveEventSupport;\nvar handlersMap = {};\nvar enabledInstances = {};\nvar touchEvents = ['touchstart', 'touchmove'];\nvar IGNORE_CLASS_NAME = 'ignore-react-onclickoutside';\n/**\n * Options for addEventHandler and removeEventHandler\n */\n\nfunction getEventHandlerOptions(instance, eventName) {\n var handlerOptions = null;\n var isTouchEvent = touchEvents.indexOf(eventName) !== -1;\n\n if (isTouchEvent && passiveEventSupport) {\n handlerOptions = {\n passive: !instance.props.preventDefault\n };\n }\n\n return handlerOptions;\n}\n/**\n * This function generates the HOC function that you'll use\n * in order to impart onOutsideClick listening to an\n * arbitrary component. It gets called at the end of the\n * bootstrapping code to yield an instance of the\n * onClickOutsideHOC function defined inside setupHOC().\n */\n\n\nfunction onClickOutsideHOC(WrappedComponent, config) {\n var _class, _temp;\n\n var componentName = WrappedComponent.displayName || WrappedComponent.name || 'Component';\n return _temp = _class =\n /*#__PURE__*/\n function (_Component) {\n _inheritsLoose(onClickOutside, _Component);\n\n function onClickOutside(props) {\n var _this;\n\n _this = _Component.call(this, props) || this;\n\n _this.__outsideClickHandler = function (event) {\n if (typeof _this.__clickOutsideHandlerProp === 'function') {\n _this.__clickOutsideHandlerProp(event);\n\n return;\n }\n\n var instance = _this.getInstance();\n\n if (typeof instance.props.handleClickOutside === 'function') {\n instance.props.handleClickOutside(event);\n return;\n }\n\n if (typeof instance.handleClickOutside === 'function') {\n instance.handleClickOutside(event);\n return;\n }\n\n throw new Error(\"WrappedComponent: \" + componentName + \" lacks a handleClickOutside(event) function for processing outside click events.\");\n };\n\n _this.__getComponentNode = function () {\n var instance = _this.getInstance();\n\n if (config && typeof config.setClickOutsideRef === 'function') {\n return config.setClickOutsideRef()(instance);\n }\n\n if (typeof instance.setClickOutsideRef === 'function') {\n return instance.setClickOutsideRef();\n }\n\n return findDOMNode(instance);\n };\n\n _this.enableOnClickOutside = function () {\n if (typeof document === 'undefined' || enabledInstances[_this._uid]) {\n return;\n }\n\n if (typeof passiveEventSupport === 'undefined') {\n passiveEventSupport = testPassiveEventSupport();\n }\n\n enabledInstances[_this._uid] = true;\n var events = _this.props.eventTypes;\n\n if (!events.forEach) {\n events = [events];\n }\n\n handlersMap[_this._uid] = function (event) {\n if (_this.componentNode === null) return;\n\n if (_this.props.preventDefault) {\n event.preventDefault();\n }\n\n if (_this.props.stopPropagation) {\n event.stopPropagation();\n }\n\n if (_this.props.excludeScrollbar && clickedScrollbar(event)) return;\n var current = event.target;\n\n if (findHighest(current, _this.componentNode, _this.props.outsideClickIgnoreClass) !== document) {\n return;\n }\n\n _this.__outsideClickHandler(event);\n };\n\n events.forEach(function (eventName) {\n document.addEventListener(eventName, handlersMap[_this._uid], getEventHandlerOptions(_this, eventName));\n });\n };\n\n _this.disableOnClickOutside = function () {\n delete enabledInstances[_this._uid];\n var fn = handlersMap[_this._uid];\n\n if (fn && typeof document !== 'undefined') {\n var events = _this.props.eventTypes;\n\n if (!events.forEach) {\n events = [events];\n }\n\n events.forEach(function (eventName) {\n return document.removeEventListener(eventName, fn, getEventHandlerOptions(_this, eventName));\n });\n delete handlersMap[_this._uid];\n }\n };\n\n _this.getRef = function (ref) {\n return _this.instanceRef = ref;\n };\n\n _this._uid = uid();\n return _this;\n }\n /**\n * Access the WrappedComponent's instance.\n */\n\n\n var _proto = onClickOutside.prototype;\n\n _proto.getInstance = function getInstance() {\n if (!WrappedComponent.prototype.isReactComponent) {\n return this;\n }\n\n var ref = this.instanceRef;\n return ref.getInstance ? ref.getInstance() : ref;\n };\n\n /**\n * Add click listeners to the current document,\n * linked to this component's state.\n */\n _proto.componentDidMount = function componentDidMount() {\n // If we are in an environment without a DOM such\n // as shallow rendering or snapshots then we exit\n // early to prevent any unhandled errors being thrown.\n if (typeof document === 'undefined' || !document.createElement) {\n return;\n }\n\n var instance = this.getInstance();\n\n if (config && typeof config.handleClickOutside === 'function') {\n this.__clickOutsideHandlerProp = config.handleClickOutside(instance);\n\n if (typeof this.__clickOutsideHandlerProp !== 'function') {\n throw new Error(\"WrappedComponent: \" + componentName + \" lacks a function for processing outside click events specified by the handleClickOutside config option.\");\n }\n }\n\n this.componentNode = this.__getComponentNode(); // return early so we dont initiate onClickOutside\n\n if (this.props.disableOnClickOutside) return;\n this.enableOnClickOutside();\n };\n\n _proto.componentDidUpdate = function componentDidUpdate() {\n this.componentNode = this.__getComponentNode();\n };\n /**\n * Remove all document's event listeners for this component\n */\n\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.disableOnClickOutside();\n };\n /**\n * Can be called to explicitly enable event listening\n * for clicks and touches outside of this element.\n */\n\n\n /**\n * Pass-through render\n */\n _proto.render = function render() {\n // eslint-disable-next-line no-unused-vars\n var _props = this.props,\n excludeScrollbar = _props.excludeScrollbar,\n props = _objectWithoutProperties(_props, [\"excludeScrollbar\"]);\n\n if (WrappedComponent.prototype.isReactComponent) {\n props.ref = this.getRef;\n } else {\n props.wrappedRef = this.getRef;\n }\n\n props.disableOnClickOutside = this.disableOnClickOutside;\n props.enableOnClickOutside = this.enableOnClickOutside;\n return createElement(WrappedComponent, props);\n };\n\n return onClickOutside;\n }(Component), _class.displayName = \"OnClickOutside(\" + componentName + \")\", _class.defaultProps = {\n eventTypes: ['mousedown', 'touchstart'],\n excludeScrollbar: config && config.excludeScrollbar || false,\n outsideClickIgnoreClass: IGNORE_CLASS_NAME,\n preventDefault: false,\n stopPropagation: false\n }, _class.getClass = function () {\n return WrappedComponent.getClass ? WrappedComponent.getClass() : WrappedComponent;\n }, _temp;\n}\n\nexport { IGNORE_CLASS_NAME };\nexport default onClickOutsideHOC;\n","import PropTypes from 'prop-types';\nimport moment from 'moment';\nimport React from 'react';\nimport DaysView from './views/DaysView';\nimport MonthsView from './views/MonthsView';\nimport YearsView from './views/YearsView';\nimport TimeView from './views/TimeView';\nimport onClickOutside from 'react-onclickoutside';\n\nconst viewModes = {\n\tYEARS: 'years',\n\tMONTHS: 'months',\n\tDAYS: 'days',\n\tTIME: 'time',\n};\n\nconst TYPES = PropTypes;\nconst nofn = function () {};\nconst datetype = TYPES.oneOfType([ TYPES.instanceOf(moment), TYPES.instanceOf(Date), TYPES.string ]);\n\nexport default class Datetime extends React.Component {\n\tstatic propTypes = {\n\t\tvalue: datetype,\n\t\tinitialValue: datetype,\n\t\tinitialViewDate: datetype,\n\t\tinitialViewMode: TYPES.oneOf([viewModes.YEARS, viewModes.MONTHS, viewModes.DAYS, viewModes.TIME]),\n\t\tonOpen: TYPES.func,\n\t\tonClose: TYPES.func,\n\t\tonChange: TYPES.func,\n\t\tonNavigate: TYPES.func,\n\t\tonBeforeNavigate: TYPES.func,\n\t\tonNavigateBack: TYPES.func,\n\t\tonNavigateForward: TYPES.func,\n\t\tupdateOnView: TYPES.string,\n\t\tlocale: TYPES.string,\n\t\tutc: TYPES.bool,\n\t\tdisplayTimeZone: TYPES.string,\n\t\tinput: TYPES.bool,\n\t\tdateFormat: TYPES.oneOfType([TYPES.string, TYPES.bool]),\n\t\ttimeFormat: TYPES.oneOfType([TYPES.string, TYPES.bool]),\n\t\tinputProps: TYPES.object,\n\t\ttimeConstraints: TYPES.object,\n\t\tisValidDate: TYPES.func,\n\t\topen: TYPES.bool,\n\t\tstrictParsing: TYPES.bool,\n\t\tcloseOnSelect: TYPES.bool,\n\t\tcloseOnTab: TYPES.bool,\n\t\trenderView: TYPES.func,\n\t\trenderInput: TYPES.func,\n\t\trenderDay: TYPES.func,\n\t\trenderMonth: TYPES.func,\n\t\trenderYear: TYPES.func,\n\t}\n\n\tstatic defaultProps = {\n\t\tonOpen: nofn,\n\t\tonClose: nofn,\n\t\tonCalendarOpen: nofn,\n\t\tonCalendarClose: nofn,\n\t\tonChange: nofn,\n\t\tonNavigate: nofn,\n\t\tonBeforeNavigate: function(next) { return next; }, \n\t\tonNavigateBack: nofn,\n\t\tonNavigateForward: nofn,\n\t\tdateFormat: true,\n\t\ttimeFormat: true,\n\t\tutc: false,\n\t\tclassName: '',\n\t\tinput: true,\n\t\tinputProps: {},\n\t\ttimeConstraints: {},\n\t\tisValidDate: function() { return true; },\n\t\tstrictParsing: true,\n\t\tcloseOnSelect: false,\n\t\tcloseOnTab: true,\n\t\tcloseOnClickOutside: true,\n\t\trenderView: ( _, renderFunc ) => renderFunc(),\n\t}\n\n\t// Make moment accessible through the Datetime class\n\tstatic moment = moment;\n\n\tconstructor( props ) {\n\t\tsuper( props );\n\t\tthis.state = this.getInitialState();\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t\n\t\t\t\t{ this.renderInput() }\n\t\t\t\t
\n\t\t\t\t\t{ this.renderView() }\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n\n\trenderInput() {\n\t\tif ( !this.props.input ) return;\n\n\t\tconst finalInputProps = {\n\t\t\ttype: 'text',\n\t\t\tclassName: 'form-control',\n\t\t\tvalue: this.getInputValue(),\n\t\t\t...this.props.inputProps,\n\t\t\tonFocus: this._onInputFocus,\n\t\t\tonChange: this._onInputChange,\n\t\t\tonKeyDown: this._onInputKeyDown,\n\t\t\tonClick: this._onInputClick\n\t\t};\n\n\t\tif ( this.props.renderInput ) { \n\t\t\treturn (\n\t\t\t\t
\n\t\t\t\t\t{ this.props.renderInput( finalInputProps, this._openCalendar, this._closeCalendar ) }\n\t\t\t\t
\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t\n\t\t);\n\t}\n\n\trenderView() {\n\t\treturn this.props.renderView( this.state.currentView, this._renderCalendar );\n\t}\n\n\t_renderCalendar = () => {\n\t\tconst props = this.props;\n\t\tconst state = this.state;\n\n\t\tlet viewProps = {\n\t\t\tviewDate: state.viewDate.clone(),\n\t\t\tselectedDate: this.getSelectedDate(),\n\t\t\tisValidDate: props.isValidDate,\n\t\t\tupdateDate: this._updateDate,\n\t\t\tnavigate: this._viewNavigate,\n\t\t\tmoment: moment,\n\t\t\tshowView: this._showView\n\t\t};\n\n\t\t// Probably updateOn, updateSelectedDate and setDate can be merged in the same method\n\t\t// that would update viewDate or selectedDate depending on the view and the dateFormat\n\t\tswitch ( state.currentView ) {\n\t\t\tcase viewModes.YEARS:\n\t\t\t\t// Used viewProps\n\t\t\t\t// { viewDate, selectedDate, renderYear, isValidDate, navigate, showView, updateDate }\n\t\t\t\tviewProps.renderYear = props.renderYear;\n\t\t\t\treturn ;\n\t\t\t\n\t\t\tcase viewModes.MONTHS:\n\t\t\t\t// { viewDate, selectedDate, renderMonth, isValidDate, navigate, showView, updateDate }\n\t\t\t\tviewProps.renderMonth = props.renderMonth;\n\t\t\t\treturn ;\n\t\t\t\n\t\t\tcase viewModes.DAYS:\n\t\t\t\t// { viewDate, selectedDate, renderDay, isValidDate, navigate, showView, updateDate, timeFormat \n\t\t\t\tviewProps.renderDay = props.renderDay;\n\t\t\t\tviewProps.timeFormat = this.getFormat('time');\n\t\t\t\treturn ;\n\t\t\t\n\t\t\tdefault:\n\t\t\t\t// { viewDate, selectedDate, timeFormat, dateFormat, timeConstraints, setTime, showView }\n\t\t\t\tviewProps.dateFormat = this.getFormat('date');\n\t\t\t\tviewProps.timeFormat = this.getFormat('time');\n\t\t\t\tviewProps.timeConstraints = props.timeConstraints;\n\t\t\t\tviewProps.setTime = this._setTime;\n\t\t\t\treturn ;\n\t\t}\n\t}\n\n\tgetInitialState() {\n\t\tlet props = this.props;\n\t\tlet inputFormat = this.getFormat('datetime');\n\t\tlet selectedDate = this.parseDate( props.value || props.initialValue, inputFormat );\n\n\t\tthis.checkTZ();\n\n\t\treturn {\n\t\t\topen: !props.input,\n\t\t\tcurrentView: props.initialViewMode || this.getInitialView(),\n\t\t\tviewDate: this.getInitialViewDate( selectedDate ),\n\t\t\tselectedDate: selectedDate && selectedDate.isValid() ? selectedDate : undefined,\n\t\t\tinputValue: this.getInitialInputValue( selectedDate )\n\t\t};\n\t}\n\t\n\tgetInitialViewDate( selectedDate ) {\n\t\tconst propDate = this.props.initialViewDate;\n\t\tlet viewDate;\n\t\tif ( propDate ) {\n\t\t\tviewDate = this.parseDate( propDate, this.getFormat('datetime') );\n\t\t\tif ( viewDate && viewDate.isValid() ) {\n\t\t\t\treturn viewDate;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tlog('The initialViewDated given \"' + propDate + '\" is not valid. Using current date instead.');\n\t\t\t}\n\t\t}\n\t\telse if ( selectedDate && selectedDate.isValid() ) {\n\t\t\treturn selectedDate.clone();\n\t\t}\n\t\treturn this.getInitialDate();\n\t}\n\n\tgetInitialDate() {\n\t\tlet m = this.localMoment();\n\t\tm.hour(0).minute(0).second(0).millisecond(0);\n\t\treturn m;\n\t}\n\n\tgetInitialView() {\n\t\tconst dateFormat = this.getFormat( 'date' );\n\t\treturn dateFormat ? this.getUpdateOn( dateFormat ) : viewModes.TIME;\n\t}\n\n\tparseDate(date, dateFormat) {\n\t\tlet parsedDate;\n\n\t\tif (date && typeof date === 'string')\n\t\t\tparsedDate = this.localMoment(date, dateFormat);\n\t\telse if (date)\n\t\t\tparsedDate = this.localMoment(date);\n\n\t\tif (parsedDate && !parsedDate.isValid())\n\t\t\tparsedDate = null;\n\n\t\treturn parsedDate;\n\t}\n\n\tgetClassName() {\n\t\tlet cn = 'rdt';\n\t\tlet props = this.props;\n\t\tlet propCn = props.className;\n\n\t\tif ( Array.isArray( propCn ) ) {\n\t\t\tcn += ' ' + propCn.join(' ');\n\t\t}\n\t\telse if ( propCn ) {\n\t\t\tcn += ' ' + propCn;\n\t\t}\n\n\t\tif ( !props.input ) {\n\t\t\tcn += ' rdtStatic';\n\t\t}\n\t\tif ( this.isOpen() ) {\n\t\t\tcn += ' rdtOpen';\n\t\t}\n\n\t\treturn cn;\n\t}\n\t\n\tisOpen() {\n\t\treturn !this.props.input || (this.props.open === undefined ? this.state.open : this.props.open);\n\t}\n\n\tgetUpdateOn( dateFormat ) {\n\t\tif ( this.props.updateOnView ) {\n\t\t\treturn this.props.updateOnView;\n\t\t}\n\n\t\tif ( dateFormat.match(/[lLD]/) ) {\n\t\t\treturn viewModes.DAYS;\n\t\t}\n\n\t\tif ( dateFormat.indexOf('M') !== -1 ) {\n\t\t\treturn viewModes.MONTHS;\n\t\t}\n\n\t\tif ( dateFormat.indexOf('Y') !== -1 ) {\n\t\t\treturn viewModes.YEARS;\n\t\t}\n\n\t\treturn viewModes.DAYS;\n\t}\n\n\tgetLocaleData() {\n\t\tlet p = this.props;\n\t\treturn this.localMoment( p.value || p.defaultValue || new Date() ).localeData();\n\t}\n\n\tgetDateFormat() {\n\t\tconst locale = this.getLocaleData();\n\t\tlet format = this.props.dateFormat;\n\t\tif ( format === true ) return locale.longDateFormat('L');\n\t\tif ( format ) return format;\n\t\treturn '';\n\t}\n\n\tgetTimeFormat() {\n\t\tconst locale = this.getLocaleData();\n\t\tlet format = this.props.timeFormat;\n\t\tif ( format === true ) {\n\t\t\treturn locale.longDateFormat('LT');\n\t\t}\n\t\treturn format || '';\n\t}\n\n\tgetFormat( type ) {\n\t\tif ( type === 'date' ) {\n\t\t\treturn this.getDateFormat();\n\t\t}\n\t\telse if ( type === 'time' ) {\n\t\t\treturn this.getTimeFormat();\n\t\t}\n\t\t\n\t\tlet dateFormat = this.getDateFormat();\n\t\tlet timeFormat = this.getTimeFormat();\n\t\treturn dateFormat && timeFormat ? dateFormat + ' ' + timeFormat : (dateFormat || timeFormat );\n\t}\n\n\t_showView = ( view, date ) => {\n\t\tconst d = ( date || this.state.viewDate ).clone();\n\t\tconst nextView = this.props.onBeforeNavigate( view, this.state.currentView, d );\n\n\t\tif ( nextView && this.state.currentView !== nextView ) {\n\t\t\tthis.props.onNavigate( nextView );\n\t\t\tthis.setState({ currentView: nextView });\n\t\t}\n\t}\n\n\tupdateTime( op, amount, type, toSelected ) {\n\t\tlet update = {};\n\t\tconst date = toSelected ? 'selectedDate' : 'viewDate';\n\n\t\tupdate[ date ] = this.state[ date ].clone()[ op ]( amount, type );\n\n\t\tthis.setState( update );\n\t}\n\n\tviewToMethod = {days: 'date', months: 'month', years: 'year'};\n\tnextView = { days: 'time', months: 'days', years: 'months'};\n\t_updateDate = e => {\n\t\tlet state = this.state;\n\t\tlet currentView = state.currentView;\n\t\tlet updateOnView = this.getUpdateOn( this.getFormat('date') );\n\t\tlet viewDate = this.state.viewDate.clone();\n\n\t\t// Set the value into day/month/year\n\t\tviewDate[ this.viewToMethod[currentView] ](\n\t\t\tparseInt( e.target.getAttribute('data-value'), 10 )\n\t\t);\n\n\t\t// Need to set month and year will for days view (prev/next month)\n\t\tif ( currentView === 'days' ) {\n\t\t\tviewDate.month( parseInt( e.target.getAttribute('data-month'), 10 ) );\n\t\t\tviewDate.year( parseInt( e.target.getAttribute('data-year'), 10 ) );\n\t\t}\n\n\t\tlet update = {viewDate: viewDate};\n\t\tif ( currentView === updateOnView ) {\n\t\t\tupdate.selectedDate = viewDate.clone();\n\t\t\tupdate.inputValue = viewDate.format( this.getFormat('datetime') );\n\n\t\t\tif ( this.props.open === undefined && this.props.input && this.props.closeOnSelect ) {\n\t\t\t\tthis._closeCalendar();\n\t\t\t}\n\n\t\t\tthis.props.onChange( viewDate.clone() );\n\t\t}\n\t\telse {\n\t\t\tthis._showView( this.nextView[ currentView ], viewDate );\n\t\t}\n\n\t\tthis.setState( update );\n\t}\n\n\t_viewNavigate = ( modifier, unit ) => {\n\t\tlet viewDate = this.state.viewDate.clone();\n\t\t\n\t\t// Subtracting is just adding negative time\n\t\tviewDate.add( modifier, unit );\n\n\t\tif ( modifier > 0 ) {\n\t\t\tthis.props.onNavigateForward( modifier, unit );\n\t\t}\n\t\telse {\n\t\t\tthis.props.onNavigateBack( -(modifier), unit );\n\t\t}\n\n\t\tthis.setState({viewDate});\n\t}\n\t\n\t_setTime = ( type, value ) => {\n\t\tlet date = (this.getSelectedDate() || this.state.viewDate).clone();\n\t\t\n\t\tdate[ type ]( value );\n\n\t\tif ( !this.props.value ) {\n\t\t\tthis.setState({\n\t\t\t\tselectedDate: date,\n\t\t\t\tviewDate: date.clone(),\n\t\t\t\tinputValue: date.format( this.getFormat('datetime') )\n\t\t\t});\n\t\t}\n\n\t\tthis.props.onChange( date );\n\t}\n\n\t_openCalendar = () => {\n\t\tif ( this.isOpen() ) return;\n\t\tthis.setState({open: true}, this.props.onOpen );\n\t}\n\n\t_closeCalendar = () => {\n\t\tif ( !this.isOpen() ) return;\n\n\t\tthis.setState({open: false}, () => {\n\t\t\t this.props.onClose( this.state.selectedDate || this.state.inputValue );\n\t\t});\n\t}\n\n\t_handleClickOutside = () => {\n\t\tlet props = this.props;\n\n\t\tif ( props.input && this.state.open && props.open === undefined && props.closeOnClickOutside ) {\n\t\t\tthis._closeCalendar();\n\t\t}\n\t}\n\n\tlocalMoment( date, format, props ) {\n\t\tprops = props || this.props;\n\t\tlet m = null;\n\n\t\tif (props.utc) {\n\t\t\tm = moment.utc(date, format, props.strictParsing);\n\t\t} else if (props.displayTimeZone) {\n\t\t\tm = moment.tz(date, format, props.displayTimeZone);\n\t\t} else {\n\t\t\tm = moment(date, format, props.strictParsing);\n\t\t}\n\n\t\tif ( props.locale )\n\t\t\tm.locale( props.locale );\n\t\treturn m;\n\t}\n\n\tcheckTZ() {\n\t\tconst { displayTimeZone } = this.props;\n\t\tif ( displayTimeZone && !this.tzWarning && !moment.tz ) {\n\t\t\tthis.tzWarning = true;\n\t\t\tlog('displayTimeZone prop with value \"' + displayTimeZone + '\" is used but moment.js timezone is not loaded.', 'error');\n\t\t}\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tif ( prevProps === this.props ) return;\n\n\t\tlet needsUpdate = false;\n\t\tlet thisProps = this.props;\n\n\t\t['locale', 'utc', 'displayZone', 'dateFormat', 'timeFormat'].forEach( function(p) {\n\t\t\tprevProps[p] !== thisProps[p] && (needsUpdate = true);\n\t\t});\n\n\t\tif ( needsUpdate ) {\n\t\t\tthis.regenerateDates();\n\t\t}\n\n\t\tif ( thisProps.value && thisProps.value !== prevProps.value ) {\n\t\t\tthis.setViewDate( thisProps.value );\n\t\t}\n\n\t\tthis.checkTZ();\n\t}\n\n\tregenerateDates() {\n\t\tconst props = this.props;\n\t\tlet viewDate = this.state.viewDate.clone();\n\t\tlet selectedDate = this.state.selectedDate && this.state.selectedDate.clone();\n\n\t\tif ( props.locale ) {\n\t\t\tviewDate.locale( props.locale );\n\t\t\tselectedDate &&\tselectedDate.locale( props.locale );\n\t\t}\n\t\tif ( props.utc ) {\n\t\t\tviewDate.utc();\n\t\t\tselectedDate &&\tselectedDate.utc();\n\t\t}\n\t\telse if ( props.displayTimeZone ) {\n\t\t\tviewDate.tz( props.displayTimeZone );\n\t\t\tselectedDate &&\tselectedDate.tz( props.displayTimeZone );\n\t\t}\n\t\telse {\n\t\t\tviewDate.locale();\n\t\t\tselectedDate &&\tselectedDate.locale();\n\t\t}\n\n\t\tlet update = { viewDate: viewDate, selectedDate: selectedDate};\n\t\tif ( selectedDate && selectedDate.isValid() ) {\n\t\t\tupdate.inputValue = selectedDate.format( this.getFormat('datetime') );\n\t\t}\n\t\t\n\t\tthis.setState( update );\n\t}\n\n\tgetSelectedDate() {\n\t\tif ( this.props.value === undefined ) return this.state.selectedDate;\n\t\tlet selectedDate = this.parseDate( this.props.value, this.getFormat('datetime') );\n\t\treturn selectedDate && selectedDate.isValid() ? selectedDate : false;\n\t}\n\n\tgetInitialInputValue( selectedDate ) {\n\t\tconst props = this.props;\n\t\tif ( props.inputProps.value )\n\t\t\treturn props.inputProps.value;\n\t\t\n\t\tif ( selectedDate && selectedDate.isValid() )\n\t\t\treturn selectedDate.format( this.getFormat('datetime') );\n\t\t\n\t\tif ( props.value && typeof props.value === 'string' )\n\t\t\treturn props.value;\n\t\t\n\t\tif ( props.initialValue && typeof props.initialValue === 'string' )\n\t\t\treturn props.initialValue;\n\t\t\n\t\treturn '';\n\t}\n\n\tgetInputValue() {\n\t\tlet selectedDate = this.getSelectedDate();\n\t\treturn selectedDate ? selectedDate.format( this.getFormat('datetime') ) : this.state.inputValue;\n\t}\n\n\t/**\n\t * Set the date that is currently shown in the calendar.\n\t * This is independent from the selected date and it's the one used to navigate through months or days in the calendar.\n\t * @param dateType date\n\t * @public\n\t */\n\tsetViewDate( date ) {\n\t\tlet me = this;\n\t\tlet logError = function() {\n\t\t\treturn me.log( 'Invalid date passed to the `setViewDate` method: ' + date );\n\t\t};\n\n\t\tif ( !date ) return logError();\n\t\t\n\t\tlet viewDate;\n\t\tif ( typeof date === 'string' ) {\n\t\t\tviewDate = this.localMoment(date, this.getFormat('datetime') );\n\t\t}\n\t\telse {\n\t\t\tviewDate = this.localMoment( date );\n\t\t}\n\n\t\tif ( !viewDate || !viewDate.isValid() ) return logError();\n\t\tthis.setState({ viewDate: viewDate });\n\t}\n\n\t/**\n\t * Set the view currently shown by the calendar. View modes shipped with react-datetime are 'years', 'months', 'days' and 'time'.\n\t * @param TYPES.string mode \n\t */\n\tnavigate( mode ) {\n\t\tthis._showView( mode );\n\t}\n\n\t_onInputFocus = e => {\n\t\tif ( !this.callHandler( this.props.inputProps.onFocus, e ) ) return;\n\t\tthis._openCalendar();\n\t}\n\n\t_onInputChange = e => {\n\t\tif ( !this.callHandler( this.props.inputProps.onChange, e ) ) return;\n\n\t\tconst value = e.target ? e.target.value : e;\n\t\tconst localMoment = this.localMoment( value, this.getFormat('datetime') );\n\t\tlet update = { inputValue: value };\n\n\t\tif ( localMoment.isValid() ) {\n\t\t\tupdate.selectedDate = localMoment;\n\t\t\tupdate.viewDate = localMoment.clone().startOf('month');\n\t\t}\n\t\telse {\n\t\t\tupdate.selectedDate = null;\n\t\t}\n\n\t\tthis.setState( update, () => {\n\t\t\tthis.props.onChange( localMoment.isValid() ? localMoment : this.state.inputValue );\n\t\t});\n\t}\n\n\t_onInputKeyDown = e => {\n\t\tif ( !this.callHandler( this.props.inputProps.onKeyDown, e ) ) return;\n\n\t\tif ( e.which === 9 && this.props.closeOnTab ) {\n\t\t\tthis._closeCalendar();\n\t\t}\n\t}\n\n\t_onInputClick = e => {\n\t\t// Focus event should open the calendar, but there is some case where\n\t\t// the input is already focused and the picker is closed, so clicking the input\n\t\t// should open it again see https://github.com/arqex/react-datetime/issues/717\n\t\tif ( !this.callHandler( this.props.inputProps.onClick, e ) ) return;\n\t\tthis._openCalendar();\n\t}\n\n\tcallHandler( method, e ) {\n\t\tif ( !method ) return true;\n\t\treturn method(e) !== false;\n\t}\n}\n\nfunction log( message, method ) {\n\tlet con = typeof window !== 'undefined' && window.console;\n\tif ( !con ) return;\n\n\tif ( !method ) {\n\t\tmethod = 'warn';\n\t}\n\tcon[ method ]( '***react-datetime:' + message );\n}\n\nclass ClickOutBase extends React.Component {\n\tcontainer = React.createRef();\n\n\trender() {\n\t\treturn (\n\t\t\t
\n\t\t\t\t{ this.props.children }\n\t\t\t
\n\t\t);\n\t}\n\thandleClickOutside(e) {\n\t\tthis.props.onClickOut( e );\n\t}\n\n\tsetClickOutsideRef() {\n\t\treturn this.container.current;\n\t}\n}\n\nconst ClickableWrapper = onClickOutside( ClickOutBase );\n"],"sourceRoot":""} \ No newline at end of file diff --git a/package.json b/package.json index 6ce2ededa..dce20ce62 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-datetime", - "version": "3.0.4", + "version": "3.1.0", "description": "A lightweight but complete datetime picker React.js component", "homepage": "https://github.com/arqex/react-datetime", "repository": {