Comparing version 1.7.0 to 1.8.0
@@ -91,14 +91,15 @@ import _extends from 'babel-runtime/helpers/extends'; | ||
checkedChildren = _props2.checkedChildren, | ||
tabIndex = _props2.tabIndex, | ||
unCheckedChildren = _props2.unCheckedChildren, | ||
restProps = _objectWithoutProperties(_props2, ['className', 'prefixCls', 'disabled', 'loadingIcon', 'checkedChildren', 'tabIndex', 'unCheckedChildren']); | ||
restProps = _objectWithoutProperties(_props2, ['className', 'prefixCls', 'disabled', 'loadingIcon', 'checkedChildren', 'unCheckedChildren']); | ||
var checked = this.state.checked; | ||
var switchTabIndex = disabled ? -1 : tabIndex || 0; | ||
var switchClassName = classNames((_classNames = {}, _defineProperty(_classNames, className, !!className), _defineProperty(_classNames, prefixCls, true), _defineProperty(_classNames, prefixCls + '-checked', checked), _defineProperty(_classNames, prefixCls + '-disabled', disabled), _classNames)); | ||
return React.createElement( | ||
'span', | ||
'button', | ||
_extends({}, restProps, { | ||
type: 'button', | ||
role: 'switch', | ||
'aria-checked': checked, | ||
disabled: disabled, | ||
className: switchClassName, | ||
tabIndex: switchTabIndex, | ||
ref: this.saveNode, | ||
@@ -140,5 +141,2 @@ onKeyDown: this.handleKeyDown, | ||
_this2.setChecked(true); | ||
} else if (e.keyCode === 32 || e.keyCode === 13) { | ||
// Space, Enter | ||
_this2.toggle(); | ||
} | ||
@@ -145,0 +143,0 @@ }; |
@@ -126,14 +126,15 @@ 'use strict'; | ||
checkedChildren = _props2.checkedChildren, | ||
tabIndex = _props2.tabIndex, | ||
unCheckedChildren = _props2.unCheckedChildren, | ||
restProps = (0, _objectWithoutProperties3['default'])(_props2, ['className', 'prefixCls', 'disabled', 'loadingIcon', 'checkedChildren', 'tabIndex', 'unCheckedChildren']); | ||
restProps = (0, _objectWithoutProperties3['default'])(_props2, ['className', 'prefixCls', 'disabled', 'loadingIcon', 'checkedChildren', 'unCheckedChildren']); | ||
var checked = this.state.checked; | ||
var switchTabIndex = disabled ? -1 : tabIndex || 0; | ||
var switchClassName = classNames((_classNames = {}, (0, _defineProperty3['default'])(_classNames, className, !!className), (0, _defineProperty3['default'])(_classNames, prefixCls, true), (0, _defineProperty3['default'])(_classNames, prefixCls + '-checked', checked), (0, _defineProperty3['default'])(_classNames, prefixCls + '-disabled', disabled), _classNames)); | ||
return _react2['default'].createElement( | ||
'span', | ||
'button', | ||
(0, _extends3['default'])({}, restProps, { | ||
type: 'button', | ||
role: 'switch', | ||
'aria-checked': checked, | ||
disabled: disabled, | ||
className: switchClassName, | ||
tabIndex: switchTabIndex, | ||
ref: this.saveNode, | ||
@@ -174,5 +175,2 @@ onKeyDown: this.handleKeyDown, | ||
_this2.setChecked(true); | ||
} else if (e.keyCode === 32 || e.keyCode === 13) { | ||
// Space, Enter | ||
_this2.toggle(); | ||
} | ||
@@ -179,0 +177,0 @@ }; |
{ | ||
"name": "rc-switch", | ||
"version": "1.7.0", | ||
"version": "1.8.0", | ||
"description": "switch ui component for react", | ||
@@ -65,2 +65,6 @@ "keywords": [ | ||
}, | ||
"peerDependencies": { | ||
"react": "^16.0.0", | ||
"react-dom": "^16.0.0" | ||
}, | ||
"pre-commit": [ | ||
@@ -67,0 +71,0 @@ "lint" |
Sorry, the diff of this file is not supported yet
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
19841
5
441
1