react-mobile-datepicker
Advanced tools
Comparing version 2.0.3 to 2.0.4
@@ -0,1 +1,7 @@ | ||
v2.0.4 - Tue, 12 Jul 2016 09:16:42 GMT | ||
-------------------------------------- | ||
- | ||
v2.0.3 - Tue, 12 Jul 2016 09:15:00 GMT | ||
@@ -2,0 +8,0 @@ -------------------------------------- |
@@ -127,3 +127,2 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
_this.state = { | ||
angle: 0, | ||
date: _this._productDate(props.date), | ||
@@ -140,2 +139,16 @@ minDate: _this._productDate(props.minDate), | ||
_createClass(DatePicker, [{ | ||
key: 'componentWillReceiveProps', | ||
value: function componentWillReceiveProps(nextProps) { | ||
this.setState({ | ||
date: this._productDate(nextProps.date), | ||
minDate: this._productDate(nextProps.minDate), | ||
maxDate: this._productDate(nextProps.maxDate) | ||
}); | ||
} | ||
}, { | ||
key: 'shouldComponentUpdate', | ||
value: function shouldComponentUpdate(nextProps, nextState) { | ||
return nextState.date.timestamp !== this.state.date.timestamp || nextProps.date !== this.props.date || nextProps.minDate !== this.props.minDate || nextProps.maxDate !== this.props.maxDate; | ||
} | ||
}, { | ||
key: '_productDate', | ||
@@ -142,0 +155,0 @@ value: function _productDate(date) { |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.DatePicker=t(require("react")):e.DatePicker=t(e.react)}(this,function(e){return function(e){function t(r){if(n[r])return n[r].exports;var a=n[r]={exports:{},id:r,loaded:!1};return e[r].call(a.exports,a,a.exports,t),a.loaded=!0,a.exports}var n={};return t.m=e,t.c=n,t.p="/",t(0)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0}),n(1);var a=n(2),o=r(a);t["default"]=o["default"]},function(e,t){},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(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 i(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)}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(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)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(3),u=r(s),c=n(4),p=r(c),f=n(5),d=function(e){function t(e){a(this,t);var n=o(this,Object.getPrototypeOf(t).call(this,e));return n.state={angle:0,date:n._productDate(e.date),minDate:n._productDate(e.minDate),maxDate:n._productDate(e.maxDate)},n.handleFinishBtnClick=n.handleFinishBtnClick.bind(n),n.handleDateSelect=n.handleDateSelect.bind(n),n}return i(t,e),l(t,[{key:"_productDate",value:function(e){var t=(0,f.nextDate)(e,0);return{value:t,timestamp:t.getTime(),Year:(0,f.getTime)(t,"Year"),Month:(0,f.getTime)(t,"Month"),Date:(0,f.getTime)(t,"Date")}}},{key:"handleFinishBtnClick",value:function(){this.props.onSelect(this.state.date.value)}},{key:"handleDateSelect",value:function(e){this.setState({date:this._productDate(e)})}},{key:"render",value:function(){var e=this.props,t=e.layerBackground,n=e.btnColor,r=e.touchLen,a=e.dateColor,o=this.state,i=o.date,l=o.minDate,s=o.maxDate,c={backgroundColor:t};return u["default"].createElement("div",{className:"datepicker",style:c},u["default"].createElement("p",{className:"datepicker-navbar"},u["default"].createElement("span",{style:{color:n},className:"datepicker-finish-btn",onClick:this.handleFinishBtnClick},"完成")),u["default"].createElement("div",{className:"datepicker-content"},u["default"].createElement(p["default"],{date:i,typeName:"Year",minDate:l,maxDate:s,touchLen:r,dateColor:a,onSelect:this.handleDateSelect}),u["default"].createElement(p["default"],{date:i,typeName:"Month",minDate:l,maxDate:s,touchLen:r,dateColor:a,onSelect:this.handleDateSelect}),u["default"].createElement(p["default"],{date:i,typeName:"Date",minDate:l,maxDate:s,touchLen:r,dateColor:a,onSelect:this.handleDateSelect})))}}]),t}(s.Component);d.propTypes={touchLen:s.PropTypes.number,btnColor:s.PropTypes.string,dateColor:s.PropTypes.string,layerBackground:s.PropTypes.string,date:s.PropTypes.object,minDate:s.PropTypes.object,maxDate:s.PropTypes.object,onSelect:s.PropTypes.func},d.defaultProps={touchLen:40,dateColor:"#fff",btnColor:"#fff",layerBackground:"#ffa70b",date:new Date,minDate:new Date(1970,0,1),maxDate:new Date(2050,0,1),onSelect:function(){}},t["default"]=d},function(t,n){t.exports=e},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function a(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(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 l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(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 u(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)}Object.defineProperty(t,"__esModule",{value:!0});var c=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},p=function(){function e(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)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),f=n(3),d=a(f),h=n(5),y=r(h),m=n(6),v=function(e){function t(e){l(this,t);var n=s(this,Object.getPrototypeOf(t).call(this,e));return n.animating=!1,n.touchY=0,n.angle=0,n.renderDatepickerItem=n.renderDatepickerItem.bind(n),n.handleContentTouch=n.handleContentTouch.bind(n),n.handleContentTransitionEnd=n.handleContentTransitionEnd.bind(n),n.state={angle:0},n}return u(t,e),p(t,[{key:"componentWillMount",value:function(){var e=this,t=Array.apply(void 0,i(Array(5))).map(function(t,n){var r=y["next"+e.props.typeName](e.props.date.value,n-2);return c({},y.getTime(r,e.props.typeName),{angle:22.5*(2-n)})});this.setState({dates:t})}},{key:"componentWillReceiveProps",value:function(e){var t=this.refs.scroll,n=this.angle,r=this.props.typeName,a=this.props.date[r].value,o=e.date[r].value,i=this.props.date.timestamp,l=e.date.timestamp,s=void 0;o>a&&l>i||o<a&&l>i?s=1:(o>a&&l<i||o<a&&l<i)&&(s=-1),s&&this._moveTo(t,n+22.5*s)}},{key:"_setOpacity",value:function(e){return e>0?((40-e)/40*100|0)/100:((40+e)/40*100|0)/100}},{key:"_clearTransition",value:function(e){e.style[m.TRANSITION]=""}},{key:"_moveToNext",value:function(e){var t=this.props,n=t.typeName,r=t.date,a=t.maxDate,o=t.minDate,i=y["next"+n](r.value,e),l=1===e?i.getTime()<=a.timestamp:i.getTime()>=o.timestamp;l?this.props.onSelect(i):this._moveTo(this.refs.scroll,this.angle)}},{key:"_moveTo",value:function(e,t){this.animating=!0,e.style[m.TRANSITION]="all .2s ease-out",this.setState({angle:t})}},{key:"handleContentTouch",value:function(e){if(e.preventDefault(),!this.animating)if("touchstart"===e.type)this.touchY=e.targetTouches[0].pageY,this.angle=this.state.angle;else if("touchmove"===e.type){var t=e.targetTouches[0].pageY,n=t-this.touchY,r=this.angle-parseInt(22.5*n/180,10);this.setState({angle:r})}else if("touchend"===e.type){var a=e.changedTouches[0].pageY,o=a-this.touchY,i=o>0?-1:1;1===i&&this.props.touchLen<-o||i===-1&&this.props.touchLen<o?this._moveToNext(i):this._moveTo(this.refs.scroll,this.angle)}}},{key:"handleContentTransitionEnd",value:function(){var e=this,t=this.props.date,n=Array.apply(void 0,i(Array(5))).map(function(n,r){var a=y["next"+e.props.typeName](t.value,r-2);return c({},y.getTime(a,e.props.typeName),{angle:22.5*(2-r)})});this.animating=!1,this._clearTransition(this.refs.scroll),this.setState({dates:n,angle:0})}},{key:"renderDatepickerItem",value:function(e,t){var n,r=(n={},o(n,m.TRANSFORM,"rotateX("+e.angle+"deg) translate3d(0,0,100px)"),o(n,"opacity",this._setOpacity(e.angle+this.state.angle)),o(n,"color",this.props.dateColor),n);return d["default"].createElement("li",{key:t,style:r},e.value,e.suffix)}},{key:"render",value:function(){var e=o({},m.TRANSFORM,"rotateX("+this.state.angle+"deg)");return d["default"].createElement("div",{className:"datepicker-viewport",onTouchStart:this.handleContentTouch,onTouchMove:this.handleContentTouch,onTouchEnd:this.handleContentTouch,onTransitionEnd:this.handleContentTransitionEnd},d["default"].createElement("ul",{ref:"scroll",className:"datepicker-scroll",style:e},this.state.dates.map(this.renderDatepickerItem)))}}]),t}(f.Component);v.propTypes={date:f.PropTypes.object.isRequired,minDate:f.PropTypes.object.isRequired,maxDate:f.PropTypes.object.isRequired,typeName:f.PropTypes.string.isRequired,touchLen:f.PropTypes.number,dateColor:f.PropTypes.string,onSelect:f.PropTypes.func},v.defaultProps={dateColor:"#fff",touchLen:40,onSelect:function(){}},t["default"]=v},function(e,t){"use strict";function n(e,t){var n=e.getFullYear(),r=e.getMonth()+1,a=e.getDate(),o=e.getHours(),i=e.getMinutes(),l=e.getSeconds();return t.replace(/Y+/,n).replace(/M+/,r).replace(/D+/,a).replace(/h+/,o).replace(/m+/,i).replace(/s+/,l)}function r(e){if("[object Date]"!==Object.prototype.toString.call(e,null))throw new Error("参数类型不对")}function a(e){var t=arguments.length<=1||void 0===arguments[1]?0:arguments[1];r(e);var n=new Date(e.getFullYear()+t,e.getMonth(),e.getDate());return n}function o(e){var t=arguments.length<=1||void 0===arguments[1]?0:arguments[1];r(e);var n=new Date(e.getFullYear(),e.getMonth()+t,e.getDate());return n}function i(e){var t=arguments.length<=1||void 0===arguments[1]?0:arguments[1];r(e);var n=new Date(e.getFullYear(),e.getMonth(),e.getDate()+t);return n}function l(e,t){r(e);var a={Year:["YYYY","年"],Month:["MM","月"],Date:["DD","日"]};if(!a[t])throw new Error("类型不对");var o={value:parseInt(n(e,a[t][0]),10),suffix:a[t][1]};return o}Object.defineProperty(t,"__esModule",{value:!0}),t.nextYear=a,t.nextMonth=o,t.nextDate=i,t.getTime=l},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=null,r=null,a=null;"string"==typeof document.body.style.transition?(t.TRANSITION=n="transition",t.TRANSITIONEND=r="transitionend",t.TRANSITION_CSS=a="transition"):"string"==typeof document.body.style.webkitTransition&&(t.TRANSITION=n="WebkitTransition",t.TRANSITION_CSS=a="-webkit-transition",t.TRANSITIONEND=r="webkitTransitionEnd");var o=null,i=null;"string"==typeof document.body.style.transform?(t.TRANSFORM=o="transform",t.TRANSFORM_CSS=i="transform"):"string"==typeof document.body.style.webkitTransform&&(t.TRANSFORM=o="WebkitTransform",t.TRANSFORM_CSS=i="-webkit-transform"),t.TRANSITION=n,t.TRANSITIONEND=r,t.TRANSITION_CSS=a,t.TRANSFORM=o,t.TRANSFORM_CSS=i}])}); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.DatePicker=t(require("react")):e.DatePicker=t(e.react)}(this,function(e){return function(e){function t(a){if(n[a])return n[a].exports;var r=n[a]={exports:{},id:a,loaded:!1};return e[a].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var n={};return t.m=e,t.c=n,t.p="/",t(0)}([function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0}),n(1);var r=n(2),o=a(r);t["default"]=o["default"]},function(e,t){},function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(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 i(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)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),l=n(3),u=a(l),c=n(4),p=a(c),f=n(5),d=function(e){function t(e){r(this,t);var n=o(this,Object.getPrototypeOf(t).call(this,e));return n.state={date:n._productDate(e.date),minDate:n._productDate(e.minDate),maxDate:n._productDate(e.maxDate)},n.handleFinishBtnClick=n.handleFinishBtnClick.bind(n),n.handleDateSelect=n.handleDateSelect.bind(n),n}return i(t,e),s(t,[{key:"componentWillReceiveProps",value:function(e){this.setState({date:this._productDate(e.date),minDate:this._productDate(e.minDate),maxDate:this._productDate(e.maxDate)})}},{key:"shouldComponentUpdate",value:function(e,t){return t.date.timestamp!==this.state.date.timestamp||e.date!==this.props.date||e.minDate!==this.props.minDate||e.maxDate!==this.props.maxDate}},{key:"_productDate",value:function(e){var t=(0,f.nextDate)(e,0);return{value:t,timestamp:t.getTime(),Year:(0,f.getTime)(t,"Year"),Month:(0,f.getTime)(t,"Month"),Date:(0,f.getTime)(t,"Date")}}},{key:"handleFinishBtnClick",value:function(){this.props.onSelect(this.state.date.value)}},{key:"handleDateSelect",value:function(e){this.setState({date:this._productDate(e)})}},{key:"render",value:function(){var e=this.props,t=e.layerBackground,n=e.btnColor,a=e.touchLen,r=e.dateColor,o=this.state,i=o.date,s=o.minDate,l=o.maxDate,c={backgroundColor:t};return u["default"].createElement("div",{className:"datepicker",style:c},u["default"].createElement("p",{className:"datepicker-navbar"},u["default"].createElement("span",{style:{color:n},className:"datepicker-finish-btn",onClick:this.handleFinishBtnClick},"完成")),u["default"].createElement("div",{className:"datepicker-content"},u["default"].createElement(p["default"],{date:i,typeName:"Year",minDate:s,maxDate:l,touchLen:a,dateColor:r,onSelect:this.handleDateSelect}),u["default"].createElement(p["default"],{date:i,typeName:"Month",minDate:s,maxDate:l,touchLen:a,dateColor:r,onSelect:this.handleDateSelect}),u["default"].createElement(p["default"],{date:i,typeName:"Date",minDate:s,maxDate:l,touchLen:a,dateColor:r,onSelect:this.handleDateSelect})))}}]),t}(l.Component);d.propTypes={touchLen:l.PropTypes.number,btnColor:l.PropTypes.string,dateColor:l.PropTypes.string,layerBackground:l.PropTypes.string,date:l.PropTypes.object,minDate:l.PropTypes.object,maxDate:l.PropTypes.object,onSelect:l.PropTypes.func},d.defaultProps={touchLen:40,dateColor:"#fff",btnColor:"#fff",layerBackground:"#ffa70b",date:new Date,minDate:new Date(1970,0,1),maxDate:new Date(2050,0,1),onSelect:function(){}},t["default"]=d},function(t,n){t.exports=e},function(e,t,n){"use strict";function a(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(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 s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(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 u(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)}Object.defineProperty(t,"__esModule",{value:!0});var c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},p=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),f=n(3),d=r(f),h=n(5),m=a(h),y=n(6),v=function(e){function t(e){s(this,t);var n=l(this,Object.getPrototypeOf(t).call(this,e));return n.animating=!1,n.touchY=0,n.angle=0,n.renderDatepickerItem=n.renderDatepickerItem.bind(n),n.handleContentTouch=n.handleContentTouch.bind(n),n.handleContentTransitionEnd=n.handleContentTransitionEnd.bind(n),n.state={angle:0},n}return u(t,e),p(t,[{key:"componentWillMount",value:function(){var e=this,t=Array.apply(void 0,i(Array(5))).map(function(t,n){var a=m["next"+e.props.typeName](e.props.date.value,n-2);return c({},m.getTime(a,e.props.typeName),{angle:22.5*(2-n)})});this.setState({dates:t})}},{key:"componentWillReceiveProps",value:function(e){var t=this.refs.scroll,n=this.angle,a=this.props.typeName,r=this.props.date[a].value,o=e.date[a].value,i=this.props.date.timestamp,s=e.date.timestamp,l=void 0;o>r&&s>i||o<r&&s>i?l=1:(o>r&&s<i||o<r&&s<i)&&(l=-1),l&&this._moveTo(t,n+22.5*l)}},{key:"_setOpacity",value:function(e){return e>0?((40-e)/40*100|0)/100:((40+e)/40*100|0)/100}},{key:"_clearTransition",value:function(e){e.style[y.TRANSITION]=""}},{key:"_moveToNext",value:function(e){var t=this.props,n=t.typeName,a=t.date,r=t.maxDate,o=t.minDate,i=m["next"+n](a.value,e),s=1===e?i.getTime()<=r.timestamp:i.getTime()>=o.timestamp;s?this.props.onSelect(i):this._moveTo(this.refs.scroll,this.angle)}},{key:"_moveTo",value:function(e,t){this.animating=!0,e.style[y.TRANSITION]="all .2s ease-out",this.setState({angle:t})}},{key:"handleContentTouch",value:function(e){if(e.preventDefault(),!this.animating)if("touchstart"===e.type)this.touchY=e.targetTouches[0].pageY,this.angle=this.state.angle;else if("touchmove"===e.type){var t=e.targetTouches[0].pageY,n=t-this.touchY,a=this.angle-parseInt(22.5*n/180,10);this.setState({angle:a})}else if("touchend"===e.type){var r=e.changedTouches[0].pageY,o=r-this.touchY,i=o>0?-1:1;1===i&&this.props.touchLen<-o||i===-1&&this.props.touchLen<o?this._moveToNext(i):this._moveTo(this.refs.scroll,this.angle)}}},{key:"handleContentTransitionEnd",value:function(){var e=this,t=this.props.date,n=Array.apply(void 0,i(Array(5))).map(function(n,a){var r=m["next"+e.props.typeName](t.value,a-2);return c({},m.getTime(r,e.props.typeName),{angle:22.5*(2-a)})});this.animating=!1,this._clearTransition(this.refs.scroll),this.setState({dates:n,angle:0})}},{key:"renderDatepickerItem",value:function(e,t){var n,a=(n={},o(n,y.TRANSFORM,"rotateX("+e.angle+"deg) translate3d(0,0,100px)"),o(n,"opacity",this._setOpacity(e.angle+this.state.angle)),o(n,"color",this.props.dateColor),n);return d["default"].createElement("li",{key:t,style:a},e.value,e.suffix)}},{key:"render",value:function(){var e=o({},y.TRANSFORM,"rotateX("+this.state.angle+"deg)");return d["default"].createElement("div",{className:"datepicker-viewport",onTouchStart:this.handleContentTouch,onTouchMove:this.handleContentTouch,onTouchEnd:this.handleContentTouch,onTransitionEnd:this.handleContentTransitionEnd},d["default"].createElement("ul",{ref:"scroll",className:"datepicker-scroll",style:e},this.state.dates.map(this.renderDatepickerItem)))}}]),t}(f.Component);v.propTypes={date:f.PropTypes.object.isRequired,minDate:f.PropTypes.object.isRequired,maxDate:f.PropTypes.object.isRequired,typeName:f.PropTypes.string.isRequired,touchLen:f.PropTypes.number,dateColor:f.PropTypes.string,onSelect:f.PropTypes.func},v.defaultProps={dateColor:"#fff",touchLen:40,onSelect:function(){}},t["default"]=v},function(e,t){"use strict";function n(e,t){var n=e.getFullYear(),a=e.getMonth()+1,r=e.getDate(),o=e.getHours(),i=e.getMinutes(),s=e.getSeconds();return t.replace(/Y+/,n).replace(/M+/,a).replace(/D+/,r).replace(/h+/,o).replace(/m+/,i).replace(/s+/,s)}function a(e){if("[object Date]"!==Object.prototype.toString.call(e,null))throw new Error("参数类型不对")}function r(e){var t=arguments.length<=1||void 0===arguments[1]?0:arguments[1];a(e);var n=new Date(e.getFullYear()+t,e.getMonth(),e.getDate());return n}function o(e){var t=arguments.length<=1||void 0===arguments[1]?0:arguments[1];a(e);var n=new Date(e.getFullYear(),e.getMonth()+t,e.getDate());return n}function i(e){var t=arguments.length<=1||void 0===arguments[1]?0:arguments[1];a(e);var n=new Date(e.getFullYear(),e.getMonth(),e.getDate()+t);return n}function s(e,t){a(e);var r={Year:["YYYY","年"],Month:["MM","月"],Date:["DD","日"]};if(!r[t])throw new Error("类型不对");var o={value:parseInt(n(e,r[t][0]),10),suffix:r[t][1]};return o}Object.defineProperty(t,"__esModule",{value:!0}),t.nextYear=r,t.nextMonth=o,t.nextDate=i,t.getTime=s},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=null,a=null,r=null;"string"==typeof document.body.style.transition?(t.TRANSITION=n="transition",t.TRANSITIONEND=a="transitionend",t.TRANSITION_CSS=r="transition"):"string"==typeof document.body.style.webkitTransition&&(t.TRANSITION=n="WebkitTransition",t.TRANSITION_CSS=r="-webkit-transition",t.TRANSITIONEND=a="webkitTransitionEnd");var o=null,i=null;"string"==typeof document.body.style.transform?(t.TRANSFORM=o="transform",t.TRANSFORM_CSS=i="transform"):"string"==typeof document.body.style.webkitTransform&&(t.TRANSFORM=o="WebkitTransform",t.TRANSFORM_CSS=i="-webkit-transform"),t.TRANSITION=n,t.TRANSITIONEND=a,t.TRANSITION_CSS=r,t.TRANSFORM=o,t.TRANSFORM_CSS=i}])}); |
{ | ||
"name": "react-mobile-datepicker", | ||
"version": "2.0.3", | ||
"version": "2.0.4", | ||
"description": "一个移动端时间选择器react组件", | ||
@@ -5,0 +5,0 @@ "main": "./dist/mobile-datepicker.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
103616
1192