Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rc-switch

Package Overview
Dependencies
Maintainers
5
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rc-switch - npm Package Compare versions

Comparing version 1.7.0 to 1.8.0

14

es/Switch.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc