rc-calendar
Advanced tools
Comparing version 9.15.8 to 9.15.9
@@ -7,2 +7,3 @@ import _classCallCheck from 'babel-runtime/helpers/classCallCheck'; | ||
import classnames from 'classnames'; | ||
import { polyfill } from 'react-lifecycles-compat'; | ||
import { getTodayTime, getMonthName } from '../util/index'; | ||
@@ -13,8 +14,2 @@ | ||
function chooseMonth(month) { | ||
var next = this.state.value.clone(); | ||
next.month(month); | ||
this.setAndSelectValue(next); | ||
} | ||
function noop() {} | ||
@@ -25,19 +20,19 @@ | ||
function MonthTable(props) { | ||
function MonthTable() { | ||
var _temp, _this, _ret; | ||
_classCallCheck(this, MonthTable); | ||
var _this = _possibleConstructorReturn(this, _Component.call(this, props)); | ||
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | ||
args[_key] = arguments[_key]; | ||
} | ||
_this.state = { | ||
value: props.value | ||
}; | ||
return _this; | ||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.state = {}, _temp), _possibleConstructorReturn(_this, _ret); | ||
} | ||
MonthTable.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { | ||
if ('value' in nextProps) { | ||
this.setState({ | ||
value: nextProps.value | ||
}); | ||
MonthTable.getDerivedStateFromProps = function getDerivedStateFromProps(props) { | ||
if ('value' in props) { | ||
return { value: props.value }; | ||
} | ||
return null; | ||
}; | ||
@@ -52,2 +47,8 @@ | ||
MonthTable.prototype.chooseMonth = function chooseMonth(month) { | ||
var next = this.state.value.clone(); | ||
next.month(month); | ||
this.setAndSelectValue(next); | ||
}; | ||
MonthTable.prototype.months = function months() { | ||
@@ -123,3 +124,5 @@ var value = this.state.value; | ||
key: monthData.value, | ||
onClick: disabled ? null : chooseMonth.bind(_this2, monthData.value), | ||
onClick: disabled ? null : function () { | ||
return _this2.chooseMonth(monthData.value); | ||
}, | ||
title: monthData.title, | ||
@@ -155,2 +158,3 @@ className: classnames(classNameMap) | ||
}; | ||
MonthTable.propTypes = { | ||
@@ -162,2 +166,5 @@ onSelect: PropTypes.func, | ||
}; | ||
polyfill(MonthTable); | ||
export default MonthTable; |
@@ -29,2 +29,4 @@ 'use strict'; | ||
var _reactLifecyclesCompat = require('react-lifecycles-compat'); | ||
var _index = require('../util/index'); | ||
@@ -37,8 +39,2 @@ | ||
function chooseMonth(month) { | ||
var next = this.state.value.clone(); | ||
next.month(month); | ||
this.setAndSelectValue(next); | ||
} | ||
function noop() {} | ||
@@ -49,19 +45,19 @@ | ||
function MonthTable(props) { | ||
function MonthTable() { | ||
var _temp, _this, _ret; | ||
(0, _classCallCheck3['default'])(this, MonthTable); | ||
var _this = (0, _possibleConstructorReturn3['default'])(this, _Component.call(this, props)); | ||
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | ||
args[_key] = arguments[_key]; | ||
} | ||
_this.state = { | ||
value: props.value | ||
}; | ||
return _this; | ||
return _ret = (_temp = (_this = (0, _possibleConstructorReturn3['default'])(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.state = {}, _temp), (0, _possibleConstructorReturn3['default'])(_this, _ret); | ||
} | ||
MonthTable.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { | ||
if ('value' in nextProps) { | ||
this.setState({ | ||
value: nextProps.value | ||
}); | ||
MonthTable.getDerivedStateFromProps = function getDerivedStateFromProps(props) { | ||
if ('value' in props) { | ||
return { value: props.value }; | ||
} | ||
return null; | ||
}; | ||
@@ -76,2 +72,8 @@ | ||
MonthTable.prototype.chooseMonth = function chooseMonth(month) { | ||
var next = this.state.value.clone(); | ||
next.month(month); | ||
this.setAndSelectValue(next); | ||
}; | ||
MonthTable.prototype.months = function months() { | ||
@@ -147,3 +149,5 @@ var value = this.state.value; | ||
key: monthData.value, | ||
onClick: disabled ? null : chooseMonth.bind(_this2, monthData.value), | ||
onClick: disabled ? null : function () { | ||
return _this2.chooseMonth(monthData.value); | ||
}, | ||
title: monthData.title, | ||
@@ -179,2 +183,3 @@ className: (0, _classnames2['default'])(classNameMap) | ||
}; | ||
MonthTable.propTypes = { | ||
@@ -186,3 +191,6 @@ onSelect: _propTypes2['default'].func, | ||
}; | ||
(0, _reactLifecyclesCompat.polyfill)(MonthTable); | ||
exports['default'] = MonthTable; | ||
module.exports = exports['default']; |
{ | ||
"name": "rc-calendar", | ||
"version": "9.15.8", | ||
"version": "9.15.9", | ||
"description": "React Calendar", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
1551210
23705