text: !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],t):e.reactMobileDatePicker=t(e.React,e.ReactDOM)}(this,function(e,t){"use strict";var k="default"in e?e.default:e;function o(e){if("[object Date]"!==Object.prototype.toString.call(e,null))throw new Error("参数类型不对")}function v(e,t){var n=t,r={"Y+":e.getFullYear(),"M+":e.getMonth()+1,"D+":e.getDate(),"h+":e.getHours(),"m+":e.getMinutes(),"s+":e.getSeconds()};for(var a in/(Y+)/.test(t)&&(n=n.replace(RegExp.$1,e.getFullYear().toString().substr(4-RegExp.$1.length))),r)if(new RegExp("("+a+")").test(t)&&"MMMM"===t)switch(r[a]){case 1:n="มกราคม";break;case 2:n="กุมภาพันธ์";break;case 3:n="มีนาคม";break;case 4:n="เมษายน";break;case 5:n="พฤษภาคม";break;case 6:n="มิถุนายน";break;case 7:n="กรกฎาคม";break;case 8:n="สิงหาคม";break;case 9:n="กันยายน";break;case 10:n="ตุลาคม";break;case 11:n="พฤศจิกายน";break;case 12:n="ธันวาคม"}else new RegExp("("+a+")").test(t)&&"YYYYY"===t?(n=parseInt(r[a])+543,n=String(n)):new RegExp("("+a+")").test(t)&&(n=n.replace(RegExp.$1,1===RegExp.$1.length?r[a]:("00"+r[a]).substr(r[a].toString().length)));return n}function n(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0;return o(e),new Date(e.getTime()+24*t*60*60*1e3)}t=t&&t.hasOwnProperty("default")?t.default:t,function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===n&&r.firstChild?r.insertBefore(a,r.firstChild):r.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}}(".datepicker-modal {\n    position: absolute;\n    right: 0;\n    bottom: 0;\n    width: 100%;\n    height: 100%;\n    background-color: rgba(0, 0, 0, .6);\n    z-index: 999;\n    display: -webkit-box;\n    display: -ms-flexbox;\n    display: flex;\n    -webkit-box-align: center;\n        -ms-flex-align: center;\n            align-items: center;\n    -webkit-box-pack: center;\n        -ms-flex-pack: center;\n            justify-content: center;\n}\n\n.datepicker {\n    position: absolute;\n    left: 0;\n    bottom: 0;\n    width: 100%;\n    z-index: 1;\n    font-size: 16px;\n    text-align: center;\n    font-family: arial,verdana,sans-serif;\n    -webkit-box-sizing: content-box;\n            box-sizing: content-box;\n    -webkit-font-smoothing: antialiased;\n    -webkit-user-select: none;\n       -moz-user-select: none;\n        -ms-user-select: none;\n            user-select: none;\n}\n\n.datepicker .datepicker-header {\n        padding: 0 .5em;\n        min-height: 2em;\n        line-height: 2em;\n        font-size: 1.125em;\n    }\n\n.datepicker .datepicker-navbar {\n        padding: 0 .5em .5em .5em;\n        overflow: hidden;\n    }\n\n.datepicker .datepicker-navbar-btn {\n        height: 2.5em;\n        line-height: 2.5em;\n        float: right;\n        padding: 0 1em;\n        cursor: pointer;\n    }\n\n.datepicker .datepicker-caption {\n        display: -webkit-box;\n        display: -ms-flexbox;\n        display: flex;\n        padding: .5em .25em;\n        border-bottom: 1px solid #dee1e9;\n    }\n\n.datepicker .datepicker-caption-item {\n        -webkit-box-flex: 1;\n            -ms-flex: 1;\n                flex: 1;\n        margin: 0 .25em;\n        height: 40px;\n        line-height: 40px;\n        font-size: 1.2em;\n    }\n\n.datepicker .datepicker-content {\n        display: -webkit-box;\n        display: -ms-flexbox;\n        display: flex;\n        padding: .5em .25em;\n    }\n\n.datepicker .datepicker-col-1 {\n        -webkit-box-flex: 1;\n            -ms-flex: 1;\n                flex: 1;\n        margin: 0 .25em;\n    }\n\n.datepicker .datepicker-viewport {\n        height: 200px;\n        position: relative;\n        overflow: hidden\n    }\n\n.datepicker .datepicker-viewport::after {\n    content: '';\n    position: absolute;\n    z-index: 2;\n    top: 0;\n    right: 0;\n    bottom: 0;\n    left: 0;\n    pointer-events: none;\n}\n\n.datepicker .datepicker-wheel {\n        position: absolute;\n        height: 40px;\n        top: 50%;\n        margin-top: -20px;\n        width: 100%;\n    }\n\n.datepicker .datepicker-scroll {\n        list-style-type: none;\n        padding: 0\n    }\n\n.datepicker .datepicker-scroll>li {\n    height: 40px;\n    line-height: 40px;\n    font-size: 1.375em;\n    cursor: pointer;\n}\n\n.datepicker {\n\n    /* default */\n}\n\n.datepicker.default {\n    background-color: #f7f7f7;\n}\n\n.datepicker.default .datepicker-header {\n            color: #ff8300;\n}\n\n.datepicker.default .datepicker-wheel {\n            border-top: 1px solid #dee1e9;\n            border-bottom: 1px solid #dee1e9;\n}\n\n.datepicker.default .datepicker-caption-item {\n            color: #0e162c;\n}\n\n.datepicker.default .datepicker-scroll li {\n                color: #0e162c;\n            }\n\n.datepicker.default .datepicker-scroll li.disabled {\n                color: rgb(177, 179, 186);\n            }\n\n.datepicker.default .datepicker-viewport::after {\n    background: -webkit-gradient(linear,left top, left bottom,from(#f7f7f7),color-stop(52%, rgba(245, 245, 245, 0)),color-stop(48%, rgba(245, 245, 245, 0)),to(#f7f7f7));\n    background: linear-gradient(#f7f7f7,rgba(245, 245, 245, 0)52%,rgba(245, 245, 245, 0)48%,#f7f7f7);\n}\n\n.datepicker.default .datepicker-navbar-btn {\n            color: #ff8300;\n}\n\n.datepicker {\n\n    /* dark */\n}\n\n.datepicker.dark {\n    background-color: #263238;\n}\n\n.datepicker.dark .datepicker-header {\n            color: #50ccc4;\n}\n\n.datepicker.dark .datepicker-wheel {\n            border-top: 1px solid #50ccc4;\n            border-bottom: 1px solid #50ccc4;\n}\n\n.datepicker.dark .datepicker-caption-item {\n            color: rgb(201, 203, 204);\n}\n\n.datepicker.dark .datepicker-scroll li {\n                color: rgb(201, 203, 204);\n            }\n\n.datepicker.dark .datepicker-scroll li.disabled {\n                color: rgb(87, 96, 100);\n            }\n\n.datepicker.dark .datepicker-navbar-btn {\n            color: #50ccc4;\n}\n\n.datepicker {\n\n    /* ios */\n}\n\n.datepicker.ios {\n    background-color: #f7f7f7;\n}\n\n.datepicker.ios .datepicker-col-1 {margin: 0;\n}\n\n.datepicker.ios .datepicker-header {\n            color: rgb(59, 59, 59);\n            padding: 0 3.5em;\n}\n\n.datepicker.ios .datepicker-viewport::after {\n    background: -webkit-gradient(linear,left top, left bottom,from(#f7f7f7),color-stop(52%, rgba(245, 245, 245, 0)),color-stop(48%, rgba(245, 245, 245, 0)),to(#f7f7f7));\n    background: linear-gradient(#f7f7f7,rgba(245, 245, 245, 0)52%,rgba(245, 245, 245, 0)48%,#f7f7f7);\n}\n\n.datepicker.ios .datepicker-wheel {\n            border-top: 1px solid #dbdbdb;\n            border-bottom: 1px solid #dbdbdb;\n}\n\n.datepicker.ios .datepicker-caption-item {\n            color: rgb(59, 59, 59);\n}\n\n.datepicker.ios .datepicker-scroll li {\n                color: rgb(59, 59, 59);\n            }\n\n.datepicker.ios .datepicker-scroll li.disabled {\n                color: rgb(191, 191, 191);\n            }\n\n.datepicker.ios .datepicker-navbar {\n            position: absolute;\n            z-index: 2;\n            top: 0;\n            left: 0;\n            width: 100%;\n            padding: 0;\n            border-bottom: 1px solid #acacac;\n}\n\n.datepicker.ios .datepicker-navbar-btn {\n            color: #007aff;\n}\n\n.datepicker.ios .datepicker-navbar-btn:nth-child(2) {\n    float: left;\n}\n\n.datepicker.ios .datepicker-content {\n            padding-top: 48px;\n}\n\n.datepicker.ios .datepicker-header + .datepicker-content {\n          padding-top: 0;\n}\n\n.datepicker.ios .datepicker-caption + .datepicker-content {\n          padding-top: 0;\n}\n\n.datepicker {\n\n    /* android */\n}\n\n.datepicker.android, .datepicker.android-dark {\n    background-color: #f5f5f5;\n}\n\n.datepicker.android .datepicker-header, .datepicker.android-dark .datepicker-header {\n            color: #31b6e7;\n            border-bottom: 2px solid #31b6e7;\n}\n\n.datepicker.android .datepicker-col-1, .datepicker.android-dark .datepicker-col-1 {margin: 0 .625em;\n}\n\n.datepicker.android .datepicker-viewport::after, .datepicker.android-dark .datepicker-viewport::after {\n    background-image: -webkit-gradient(linear,left top, left bottom,from(#f5f5f5),color-stop(52%, rgba(245, 245, 245, 0)),color-stop(48%, rgba(245, 245, 245, 0)),to(#f5f5f5));\n    background-image: linear-gradient(#f5f5f5,rgba(245, 245, 245, 0)52%,rgba(245, 245, 245, 0)48%,#f5f5f5);\n}\n\n.datepicker.android .datepicker-wheel, .datepicker.android-dark .datepicker-wheel {\n            border-top: 2px solid #31b6e7;\n            border-bottom: 2px solid #31b6e7;\n}\n\n.datepicker.android .datepicker-caption-item, .datepicker.android-dark .datepicker-caption-item {\n            color: rgb(56, 56, 56);\n}\n\n.datepicker.android .datepicker-scroll li, .datepicker.android-dark .datepicker-scroll li {\n                font-size: 1.125em;\n                color: rgb(56, 56, 56);\n            }\n\n.datepicker.android .datepicker-scroll li.disabled, .datepicker.android-dark .datepicker-scroll li.disabled {\n                color: rgb(188, 188, 188);\n            }\n\n.datepicker.android .datepicker-navbar, .datepicker.android-dark .datepicker-navbar {\n            display: -webkit-box;\n            display: -ms-flexbox;\n            display: flex;\n            border-top: 1px solid #d9d4d4;\n            padding: 0;\n}\n\n.datepicker.android .datepicker-navbar-btn, .datepicker.android-dark .datepicker-navbar-btn {\n            padding: 0;\n            color: #000;\n            -webkit-box-flex: 1;\n                -ms-flex: 1;\n                    flex: 1;\n}\n\n.datepicker.android .datepicker-navbar-btn:nth-child(2), .datepicker.android-dark .datepicker-navbar-btn:nth-child(2) {\n    border-left: 1px solid #d9d4d4;\n}\n\n.datepicker {\n\n    /* android-dark */\n}\n\n.datepicker.android-dark {\n    background-color: #292829;\n}\n\n.datepicker.android-dark .datepicker-viewport::after {\n    background-image: -webkit-gradient(linear,left top, left bottom,from(#282828),color-stop(52%, rgba(40, 40, 40, 0)),color-stop(48%, rgba(40, 40, 40, 0)),to(#282828));\n    background-image: linear-gradient(#282828,rgba(40, 40, 40, 0)52%,rgba(40, 40, 40, 0)48%,#282828);\n}\n\n.datepicker.android-dark .datepicker-caption-item {\n            color: rgb(199, 199, 199);\n}\n\n.datepicker.android-dark .datepicker-scroll li {\n                color: rgb(199, 199, 199);\n            }\n\n.datepicker.android-dark .datepicker-scroll li.disabled {\n                color: rgb(88, 88, 88);\n            }\n\n.datepicker.android-dark .datepicker-navbar { border-color: #424542;\n}\n\n.datepicker.android-dark .datepicker-navbar-btn {\n            color: #fff;\n}\n\n.datepicker.android-dark .datepicker-navbar-btn:nth-child(2) {\n    border-color: #424542;\n}\n",{});var i=Object.freeze({convertDate:v,nextYear:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0;return o(e),new Date(e.getFullYear()+t,e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds())},nextMonth:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0;o(e);var n=e.getFullYear(),r=e.getMonth()+t,a=Math.min(e.getDate(),function(e,t){return new Date(e,t+1,0).getDate()}(n,r));return new Date(n,r,a,e.getHours(),e.getMinutes(),e.getSeconds())},nextDate:n,nextHour:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0;return o(e),new Date(e.getTime()+60*t*60*1e3)},nextMinute:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0;return o(e),new Date(e.getTime()+60*t*1e3)},nextSecond:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0;return o(e),new Date(e.getTime()+1e3*t)}});function a(t,n){if(t===n)return!0;var e=Object.keys(t),r=Object.keys(n);return e.length===r.length&&e.every(function(e){return t.hasOwnProperty(e)&&t[e]===n[e]})}function r(e){e.prototype.shouldComponentUpdate=function(e,t){return r.shouldComponentUpdate(e,t,this.props,this.state)}}function d(e){var t=["-webkit-","-moz-","-ms-"],n={},r=/transform|transition/;for(var a in e)if(e.hasOwnProperty(a)){var o=e[a];if(r.test(a))for(var i=0;i<t.length;i++){n[(t[i]+a).replace(/-([a-z])/g,function(e,t){return t.toUpperCase()}).replace("-","")]=o.replace(r,t[i]+"$&")}n[a]=o}return n}function c(e,t){var n=d(t);for(var r in n)n.hasOwnProperty(r)&&(e.style[r]=n[r])}r.shouldComponentUpdate=function(e,t,n,r){return!a(n,e)||!a(r,t)};"function"==typeof Symbol&&Symbol.asyncIterator&&(l.prototype[Symbol.asyncIterator]=function(){return this}),l.prototype.next=function(e){return this._invoke("next",e)},l.prototype.throw=function(e){return this._invoke("throw",e)},l.prototype.return=function(e){return this._invoke("return",e)};function s(e){this.value=e}function l(a){var o,i;function d(e,t){try{var n=a[e](t),r=n.value;r instanceof s?Promise.resolve(r.value).then(function(e){d("next",e)},function(e){d("throw",e)}):c(n.done?"return":"normal",n.value)}catch(e){c("throw",e)}}function c(e,t){switch(e){case"return":o.resolve({value:t,done:!0});break;case"throw":o.reject(t);break;default:o.resolve({value:t,done:!1})}(o=o.next)?d(o.key,o.arg):i=null}this._invoke=function(r,a){return new Promise(function(e,t){var n={key:r,arg:a,resolve:e,reject:t,next:null};i?i=i.next=n:(o=i=n,d(r,a))})},"function"!=typeof a.return&&(this.return=void 0)}function p(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var u=function(e,t,n){return t&&h(e.prototype,t),n&&h(e,n),e};function h(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function f(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function m(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function b(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function g(e){return void 0===e}var y,x=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},w=function(e,t){var n={};for(var r in e)0<=t.indexOf(r)||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},C=40,T=Math.floor(5),D=-C*T,M=(y=e.Component,f(E,y),u(E,[{key:"componentWillMount",value:function(){this._iniDates(this.props.value)}},{key:"componentDidMount",value:function(){var e=this.viewport;e.addEventListener("touchstart",this.handleContentTouch,!1),e.addEventListener("touchmove",this.handleContentTouch,!1),e.addEventListener("touchend",this.handleContentTouch,!1),e.addEventListener("mousedown",this.handleContentMouseDown,!1)}},{key:"componentWillReceiveProps",value:function(e){e.value.getTime()!==this.props.value.getTime()&&(this._iniDates(e.value),this.currentIndex=T,this.setState({translateY:D,marginTop:(this.currentIndex-T)*C}))}},{key:"shouldComponentUpdate",value:function(e,t){return e.value.getTime()!==this.props.value.getTime()||!a(t,this.state)}},{key:"componentWillUnmount",value:function(){var e=this.viewport;e.removeEventListener("touchstart",this.handleContentTouch,!1),e.removeEventListener("touchmove",this.handleContentTouch,!1),e.removeEventListener("touchend",this.handleContentTouch,!1),e.removeEventListener("mousedown",this.handleContentMouseDown,!1),clearTimeout(this._moveToTimer)}},{key:"_iniDates",value:function(n){var r=this,a=this.props.type,e=Array.apply(void 0,b(Array(10))).map(function(e,t){return i["next"+a](n,(t-T)*r.props.step)});this.setState({dates:e})}},{key:"_updateDates",value:function(e){var t=this.props.type,n=this.state.dates;1===e?(this.currentIndex++,this.setState({dates:[].concat(b(n.slice(1)),[i["next"+t](n[n.length-1],this.props.step)]),marginTop:(this.currentIndex-T)*C})):(this.currentIndex--,this.setState({dates:[i["next"+t](n[0],-this.props.step)].concat(b(n.slice(0,n.length-1))),marginTop:(this.currentIndex-T)*C}))}},{key:"_checkIsUpdateDates",value:function(e,t){return 1===e?this.currentIndex*C+20<-t:this.currentIndex*C-20>-t}},{key:"_clearTransition",value:function(e){c(e,{transition:""})}},{key:"_moveToNext",value:function(e){var t=this.state.dates[T],n=this.props,r=n.max,a=n.min;-1===e&&t.getTime()<a.getTime()&&this.moveDateCount?this._updateDates(1):1===e&&t.getTime()>r.getTime()&&this.moveDateCount&&this._updateDates(-1),this._moveTo(this.currentIndex)}},{key:"_moveTo",value:function(e){var t=this;this.animating=!0,c(this.refs.scroll,{transition:"transform .2s ease-out"}),this.setState({translateY:-e*C}),this._moveToTimer=setTimeout(function(){t.animating=!1,t.props.onSelect(t.state.dates[T]),t._clearTransition(t.refs.scroll)},200)}},{key:"handleStart",value:function(e){this.touchY=g(e.targetTouches)||g(e.targetTouches[0])?e.pageY:e.targetTouches[0].pageY,this.translateY=this.state.translateY,this.moveDateCount=0}},{key:"handleMove",value:function(e){var t=(g(e.targetTouches)||g(e.targetTouches[0])?e.pageY:e.targetTouches[0].pageY)-this.touchY,n=this.translateY+t,r=0<t?-1:1,a=this.state.dates[T],o=this.props,i=o.max,d=o.min;a.getTime()<d.getTime()||a.getTime()>i.getTime()||(this._checkIsUpdateDates(r,n)&&(this.moveDateCount=0<r?this.moveDateCount+1:this.moveDateCount-1,this._updateDates(r)),this.setState({translateY:n}))}},{key:"handleEnd",value:function(e){var t=0<(e.pageY||e.changedTouches[0].pageY)-this.touchY?-1:1;this._moveToNext(t)}},{key:"handleContentTouch",value:function(e){e.preventDefault(),this.animating||("touchstart"===e.type?this.handleStart(e):"touchmove"===e.type?this.handleMove(e):"touchend"===e.type&&this.handleEnd(e))}},{key:"handleContentMouseDown",value:function(e){this.animating||(this.handleStart(e),document.addEventListener("mousemove",this.handleContentMouseMove),document.addEventListener("mouseup",this.handleContentMouseUp))}},{key:"handleContentMouseMove",value:function(e){this.animating||this.handleMove(e)}},{key:"handleContentMouseUp",value:function(e){this.animating||(this.handleEnd(e),document.removeEventListener("mousemove",this.handleContentMouseMove),document.removeEventListener("mouseup",this.handleContentMouseUp))}},{key:"renderDatepickerItem",value:function(e,t){var n=e<this.props.min||e>this.props.max?"disabled":"",r=void 0;return r=function(e){return"[object Function]"===Object.prototype.toString.apply(e)}(this.props.format)?this.props.format(e):v(e,this.props.format),k.createElement("li",{key:t,className:n},r)}},{key:"render",value:function(){var t=this,e=d({transform:"translateY("+this.state.translateY+"px)",marginTop:this.state.marginTop});return k.createElement("div",{className:"datepicker-col-1"},k.createElement("div",{ref:function(e){return t.viewport=e},className:"datepicker-viewport"},k.createElement("div",{className:"datepicker-wheel"},k.createElement("ul",{ref:"scroll",className:"datepicker-scroll",style:e},this.state.dates.map(this.renderDatepickerItem)))))}}]),E);function E(e){p(this,E);var t=m(this,(E.__proto__||Object.getPrototypeOf(E)).call(this,e));return t.animating=!1,t.touchY=0,t.translateY=0,t.currentIndex=T,t.moveDateCount=0,t._moveToTimer=null,t.state={translateY:D,marginTop:(t.currentIndex-T)*C},t.renderDatepickerItem=t.renderDatepickerItem.bind(t),t.handleContentTouch=t.handleContentTouch.bind(t),t.handleContentMouseDown=t.handleContentMouseDown.bind(t),t.handleContentMouseMove=t.handleContentMouseMove.bind(t),t.handleContentMouseUp=t.handleContentMouseUp.bind(t),t}function Y(e){var t=function(e){return Array.isArray(e)?e:Array.from(e)}(e),n=t[0],r=t.slice(1);return n.toUpperCase()+r.join("")}var _,S={isPopup:!0,isOpen:!1,theme:"default",value:new Date,min:new Date(1970,0,1),max:new Date(2050,0,1),showFooter:!0,showHeader:!0,showCaption:!1,dateConfig:{year:{format:"YYYY",caption:"Year",step:1},month:{format:"M",caption:"Mon",step:1},date:{format:"D",caption:"Day",step:1}},headerFormat:"YYYY/MM/DD",confirmText:"完成",cancelText:"取消",onChange:function(){},onSelect:function(){},onCancel:function(){}},O={year:{format:"YYYY",caption:"Year",step:1},month:{format:"M",caption:"Mon",step:1},date:{format:"D",caption:"Day",step:1},hour:{format:"hh",caption:"Hour",step:1},minute:{format:"mm",caption:"Min",step:1},second:{format:"hh",caption:"Sec",step:1}},P=(_=e.Component,f(j,_),u(j,[{key:"componentWillReceiveProps",value:function(e){var t=n(e.value);t.getTime()!==this.state.value.getTime()&&this.setState({value:t})}},{key:"componentDidUpdate",value:function(){var e=this.state.value,t=this.props,n=t.min,r=t.max;e.getTime()>r.getTime()&&this.setState({value:r}),e.getTime()<n.getTime()&&this.setState({value:n})}},{key:"shouldComponentUpdate",value:function(e,t){return n(t.value).getTime()!==this.state.value.getTime()||r.shouldComponentUpdate(e,t,this.props,this.state)}},{key:"handleFinishBtnClick",value:function(){this.props.onSelect(this.state.value)}},{key:"handleDateSelect",value:function(e){var t=this;this.setState({value:e},function(){t.props.onChange(e)})}},{key:"normalizeDateConfig",value:function(e){var t=[];if(function(e){return"[object Array]"===Object.prototype.toString.apply(e)}(e))for(var n=0;n<e.length;n++){var r=e[n];if("string"==typeof r){var a=r.toLocaleLowerCase();t.push(x({},O[a],{type:Y(a)}))}}else for(var o in e)if(e.hasOwnProperty(o)){var i=o.toLocaleLowerCase();O.hasOwnProperty(i)&&t.push(x({},O[i],e[o],{type:Y(i)}))}return t}},{key:"render",value:function(){var n=this,e=this.props,r=e.min,a=e.max,t=e.theme,o=e.dateConfig,i=e.confirmText,d=e.cancelText,c=e.headerFormat,s=e.showHeader,l=e.showFooter,p=e.customHeader,u=e.showCaption,h=this.state.value,f=-1===["default","dark","ios","android","android-dark"].indexOf(t)?"default":t,m=this.normalizeDateConfig(o);return k.createElement("div",{className:"datepicker "+f},s&&k.createElement("div",{className:"datepicker-header"},p||v(h,c)),u&&k.createElement("div",{className:"datepicker-caption"},m.map(function(e,t){return k.createElement("div",{key:t,className:"datepicker-caption-item"},e.caption)})),k.createElement("div",{className:"datepicker-content"},m.map(function(e,t){return k.createElement(M,{key:t,value:h,min:r,max:a,step:e.step,type:e.type,format:e.format,onSelect:n.handleDateSelect})})),l&&k.createElement("div",{className:"datepicker-navbar"},k.createElement("a",{className:"datepicker-navbar-btn",onClick:this.handleFinishBtnClick},i),k.createElement("a",{className:"datepicker-navbar-btn",onClick:this.props.onCancel},d)))}}]),j);function j(e){p(this,j);var t=m(this,(j.__proto__||Object.getPrototypeOf(j)).call(this,e));return t.state={value:n(t.props.value)},"dateFormat"in e&&console.warn("dateFormat已经被弃用, 请使用dateConfig属性配置"),"dateSteps"in e&&console.warn("dateSteps已经被弃用, 请使用dateConfig属性配置"),"showFormat"in e&&console.warn("headerFormat, 请使用dateConfig属性"),t.handleFinishBtnClick=t.handleFinishBtnClick.bind(t),t.handleDateSelect=t.handleDateSelect.bind(t),t}var I,N=t.unstable_renderSubtreeIntoContainer,U=(I=e.Component,f(z,I),u(z,[{key:"componentDidMount",value:function(){this._div=document.createElement("div"),this._div.classList.add("Modal-Portal"),document.body.appendChild(this._div),this.renderPortal(this.props)}},{key:"componentWillReceiveProps",value:function(e){this.renderPortal(e)}},{key:"componentWillUnmount",value:function(){t.unmountComponentAtNode(this._div),this._div.parentNode.removeChild(this._div)}},{key:"renderPortal",value:function(e){var t=k.cloneElement(this.props.children,x({},e,{key:"portal"}),null);this.portal=N(this,t,this._div)}},{key:"render",value:function(){return k.createElement("noscript",null)}}]),z);function z(){return p(this,z),m(this,(z.__proto__||Object.getPrototypeOf(z)).apply(this,arguments))}function F(e){var t=e.isOpen,n=w(e,["isOpen"]);return k.createElement("div",{style:{display:t?"":"none"},onClick:function(e){e.target===e.currentTarget&&n.onCancel()},className:"datepicker-modal"},k.createElement(P,n))}function L(e){var t=e.isPopup,n=w(e,["isPopup"]);return t?k.createElement(U,n,k.createElement(F,null)):k.createElement(P,n)}return U.defaultProps={isOpen:!1},L.displayName="MobileDatePicker",L.defaultProps=S,L});
  //# sourceMappingURL=dist/react-mobile-datepicker.min.js.map