Comparing version 2.1.2 to 2.1.3
@@ -88,3 +88,4 @@ 'use strict'; | ||
this.setState({ checked: checked }, function () { | ||
onChange && onChange(value ? target.value : checked, event); | ||
var nextValue = (0, _isUndefined2.default)(value) ? checked : target.value; | ||
onChange && onChange(nextValue, event); | ||
}); | ||
@@ -91,0 +92,0 @@ } |
@@ -7,4 +7,2 @@ 'use strict'; | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
@@ -24,6 +22,8 @@ | ||
var _isUndefined = require('lodash/isUndefined'); | ||
var _isUndefined2 = _interopRequireDefault(_isUndefined); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
@@ -93,3 +93,4 @@ | ||
this.setState({ checked: target.checked }, function () { | ||
onChange && onChange(value || target.checked, event); | ||
var nextValue = (0, _isUndefined2.default)(value) ? target.checked : value; | ||
onChange && onChange(nextValue, event); | ||
}); | ||
@@ -104,10 +105,9 @@ } | ||
name = _props2.name, | ||
id = _props2.id, | ||
className = _props2.className, | ||
children = _props2.children, | ||
onChange = _props2.onChange, | ||
disabled = _props2.disabled, | ||
style = _props2.style, | ||
inputRef = _props2.inputRef, | ||
props = _objectWithoutProperties(_props2, ['inline', 'title', 'name', 'className', 'children', 'onChange', 'disabled', 'style', 'inputRef']); | ||
value = _props2.value; | ||
var checked = this.state.checked; | ||
@@ -126,9 +126,11 @@ | ||
{ className: (0, _classnames2.default)('radio-wrapper', { checked: checked }) }, | ||
_react2.default.createElement('input', _extends({}, props, { | ||
_react2.default.createElement('input', { | ||
id: id, | ||
type: 'radio', | ||
ref: inputRef, | ||
value: value, | ||
name: name, | ||
disabled: disabled, | ||
onChange: this.handleChange | ||
})) | ||
}) | ||
); | ||
@@ -135,0 +137,0 @@ |
@@ -102,3 +102,4 @@ 'use strict'; | ||
children = _props.children, | ||
props = _objectWithoutProperties(_props, ['className', 'inline', 'name', 'value', 'children']); | ||
onChange = _props.onChange, | ||
props = _objectWithoutProperties(_props, ['className', 'inline', 'name', 'value', 'children', 'onChange']); | ||
@@ -105,0 +106,0 @@ var clesses = (0, _classnames2.default)({ |
{ | ||
"name": "rsuite", | ||
"version": "2.1.2", | ||
"version": "2.1.3", | ||
"description": "A suite of react components", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
5239
291847