rc-calendar
Advanced tools
Comparing version 9.10.4 to 9.10.5
@@ -116,2 +116,3 @@ import _extends from 'babel-runtime/helpers/extends'; | ||
onChange: this.onDateInputChange, | ||
onSelect: this.onDateInputSelect, | ||
clearIcon: clearIcon | ||
@@ -336,5 +337,5 @@ }) : null; | ||
this.onDateInputChange = function (value) { | ||
this.onDateInputSelect = function (value) { | ||
_this2.onSelect(value, { | ||
source: 'dateInput' | ||
source: 'dateInputSelect' | ||
}); | ||
@@ -341,0 +342,0 @@ }; |
@@ -7,2 +7,3 @@ import _classCallCheck from 'babel-runtime/helpers/classCallCheck'; | ||
import PropTypes from 'prop-types'; | ||
import KeyCode from 'rc-util/es/KeyCode'; | ||
import { polyfill } from 'react-lifecycles-compat'; | ||
@@ -89,2 +90,3 @@ import moment from 'moment'; | ||
onChange: this.onInputChange, | ||
onKeyDown: this.onKeyDown, | ||
onFocus: this.onFocus, | ||
@@ -177,2 +179,3 @@ onBlur: this.onBlur | ||
_this2.setState({ | ||
invalid: false, | ||
str: str | ||
@@ -197,2 +200,13 @@ }); | ||
this.onKeyDown = function (_ref) { | ||
var keyCode = _ref.keyCode; | ||
var _props2 = _this2.props, | ||
onSelect = _props2.onSelect, | ||
value = _props2.value; | ||
if (keyCode === KeyCode.ENTER && onSelect) { | ||
onSelect(value.clone()); | ||
} | ||
}; | ||
this.getRootDOMNode = function () { | ||
@@ -199,0 +213,0 @@ return ReactDOM.findDOMNode(_this2); |
@@ -156,3 +156,3 @@ import _classCallCheck from 'babel-runtime/helpers/classCallCheck'; | ||
} | ||
if (cause.source === 'keyboard' || !props.calendar.props.timePicker && cause.source !== 'dateInput' || cause.source === 'todayButton') { | ||
if (cause.source === 'keyboard' || cause.source === 'dateInputSelect' || !props.calendar.props.timePicker && cause.source !== 'dateInput' || cause.source === 'todayButton') { | ||
_this2.close(_this2.focus); | ||
@@ -164,3 +164,3 @@ } | ||
this.onKeyDown = function (event) { | ||
if (event.keyCode === KeyCode.DOWN && !_this2.state.open) { | ||
if (!_this2.state.open && (event.keyCode === KeyCode.DOWN || event.keyCode === KeyCode.ENTER)) { | ||
_this2.open(); | ||
@@ -167,0 +167,0 @@ event.preventDefault(); |
@@ -20,2 +20,3 @@ // Type definitions for rc-calendar 9.6 | ||
locale?: object; | ||
format?: string; | ||
showDateInput?: boolean; | ||
@@ -22,0 +23,0 @@ showWeekNumber?: boolean; |
@@ -165,2 +165,3 @@ 'use strict'; | ||
onChange: this.onDateInputChange, | ||
onSelect: this.onDateInputSelect, | ||
clearIcon: clearIcon | ||
@@ -385,5 +386,5 @@ }) : null; | ||
this.onDateInputChange = function (value) { | ||
this.onDateInputSelect = function (value) { | ||
_this2.onSelect(value, { | ||
source: 'dateInput' | ||
source: 'dateInputSelect' | ||
}); | ||
@@ -390,0 +391,0 @@ }; |
@@ -29,2 +29,6 @@ 'use strict'; | ||
var _KeyCode = require('rc-util/lib/KeyCode'); | ||
var _KeyCode2 = _interopRequireDefault(_KeyCode); | ||
var _reactLifecyclesCompat = require('react-lifecycles-compat'); | ||
@@ -117,2 +121,3 @@ | ||
onChange: this.onInputChange, | ||
onKeyDown: this.onKeyDown, | ||
onFocus: this.onFocus, | ||
@@ -205,2 +210,3 @@ onBlur: this.onBlur | ||
_this2.setState({ | ||
invalid: false, | ||
str: str | ||
@@ -225,2 +231,13 @@ }); | ||
this.onKeyDown = function (_ref) { | ||
var keyCode = _ref.keyCode; | ||
var _props2 = _this2.props, | ||
onSelect = _props2.onSelect, | ||
value = _props2.value; | ||
if (keyCode === _KeyCode2['default'].ENTER && onSelect) { | ||
onSelect(value.clone()); | ||
} | ||
}; | ||
this.getRootDOMNode = function () { | ||
@@ -227,0 +244,0 @@ return _reactDom2['default'].findDOMNode(_this2); |
@@ -192,3 +192,3 @@ 'use strict'; | ||
} | ||
if (cause.source === 'keyboard' || !props.calendar.props.timePicker && cause.source !== 'dateInput' || cause.source === 'todayButton') { | ||
if (cause.source === 'keyboard' || cause.source === 'dateInputSelect' || !props.calendar.props.timePicker && cause.source !== 'dateInput' || cause.source === 'todayButton') { | ||
_this2.close(_this2.focus); | ||
@@ -200,3 +200,3 @@ } | ||
this.onKeyDown = function (event) { | ||
if (event.keyCode === _KeyCode2['default'].DOWN && !_this2.state.open) { | ||
if (!_this2.state.open && (event.keyCode === _KeyCode2['default'].DOWN || event.keyCode === _KeyCode2['default'].ENTER)) { | ||
_this2.open(); | ||
@@ -203,0 +203,0 @@ event.preventDefault(); |
{ | ||
"name": "rc-calendar", | ||
"version": "9.10.4", | ||
"version": "9.10.5", | ||
"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
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
1478459
22665