rc-checkbox
Advanced tools
Comparing version 2.3.1 to 2.3.2
import _extends from "@babel/runtime/helpers/esm/extends"; | ||
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties"; | ||
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2"; | ||
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck"; | ||
import _createClass from "@babel/runtime/helpers/esm/createClass"; | ||
import _inherits from "@babel/runtime/helpers/esm/inherits"; | ||
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn"; | ||
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf"; | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } | ||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } | ||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } | ||
import _createSuper from "@babel/runtime/helpers/esm/createSuper"; | ||
// eslint-disable-next-line import/no-extraneous-dependencies | ||
@@ -104,6 +95,9 @@ import React, { Component } from 'react'; | ||
onBlur = _this$props2.onBlur, | ||
onKeyDown = _this$props2.onKeyDown, | ||
onKeyPress = _this$props2.onKeyPress, | ||
onKeyUp = _this$props2.onKeyUp, | ||
autoFocus = _this$props2.autoFocus, | ||
value = _this$props2.value, | ||
required = _this$props2.required, | ||
others = _objectWithoutProperties(_this$props2, ["prefixCls", "className", "style", "name", "id", "type", "disabled", "readOnly", "tabIndex", "onClick", "onFocus", "onBlur", "autoFocus", "value", "required"]); | ||
others = _objectWithoutProperties(_this$props2, ["prefixCls", "className", "style", "name", "id", "type", "disabled", "readOnly", "tabIndex", "onClick", "onFocus", "onBlur", "onKeyDown", "onKeyPress", "onKeyUp", "autoFocus", "value", "required"]); | ||
@@ -136,2 +130,5 @@ var globalProps = Object.keys(others).reduce(function (prev, key) { | ||
onBlur: onBlur, | ||
onKeyUp: onKeyUp, | ||
onKeyDown: onKeyDown, | ||
onKeyPress: onKeyPress, | ||
onChange: this.handleChange, | ||
@@ -169,4 +166,7 @@ autoFocus: autoFocus, | ||
onBlur: function onBlur() {}, | ||
onChange: function onChange() {} | ||
onChange: function onChange() {}, | ||
onKeyDown: function onKeyDown() {}, | ||
onKeyPress: function onKeyPress() {}, | ||
onKeyUp: function onKeyUp() {} | ||
}; | ||
export default Checkbox; |
@@ -14,5 +14,7 @@ "use strict"; | ||
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); | ||
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties")); | ||
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); | ||
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2")); | ||
@@ -25,6 +27,4 @@ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")); | ||
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn")); | ||
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper")); | ||
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf")); | ||
var _react = _interopRequireWildcard(require("react")); | ||
@@ -34,14 +34,7 @@ | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } | ||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } | ||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } | ||
// eslint-disable-next-line import/no-extraneous-dependencies | ||
var Checkbox = /*#__PURE__*/function (_Component) { | ||
(0, _inherits2.default)(Checkbox, _Component); | ||
var _super = _createSuper(Checkbox); | ||
var _super = (0, _createSuper2.default)(Checkbox); | ||
@@ -71,3 +64,3 @@ function Checkbox(props) { | ||
onChange({ | ||
target: _objectSpread(_objectSpread({}, _this.props), {}, { | ||
target: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, _this.props), {}, { | ||
checked: e.target.checked | ||
@@ -125,6 +118,9 @@ }), | ||
onBlur = _this$props2.onBlur, | ||
onKeyDown = _this$props2.onKeyDown, | ||
onKeyPress = _this$props2.onKeyPress, | ||
onKeyUp = _this$props2.onKeyUp, | ||
autoFocus = _this$props2.autoFocus, | ||
value = _this$props2.value, | ||
required = _this$props2.required, | ||
others = (0, _objectWithoutProperties2.default)(_this$props2, ["prefixCls", "className", "style", "name", "id", "type", "disabled", "readOnly", "tabIndex", "onClick", "onFocus", "onBlur", "autoFocus", "value", "required"]); | ||
others = (0, _objectWithoutProperties2.default)(_this$props2, ["prefixCls", "className", "style", "name", "id", "type", "disabled", "readOnly", "tabIndex", "onClick", "onFocus", "onBlur", "onKeyDown", "onKeyPress", "onKeyUp", "autoFocus", "value", "required"]); | ||
var globalProps = Object.keys(others).reduce(function (prev, key) { | ||
@@ -156,2 +152,5 @@ if (key.substr(0, 5) === 'aria-' || key.substr(0, 5) === 'data-' || key === 'role') { | ||
onBlur: onBlur, | ||
onKeyUp: onKeyUp, | ||
onKeyDown: onKeyDown, | ||
onKeyPress: onKeyPress, | ||
onChange: this.handleChange, | ||
@@ -169,3 +168,3 @@ autoFocus: autoFocus, | ||
if ('checked' in props) { | ||
return _objectSpread(_objectSpread({}, state), {}, { | ||
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, state), {}, { | ||
checked: props.checked | ||
@@ -189,5 +188,8 @@ }); | ||
onBlur: function onBlur() {}, | ||
onChange: function onChange() {} | ||
onChange: function onChange() {}, | ||
onKeyDown: function onKeyDown() {}, | ||
onKeyPress: function onKeyPress() {}, | ||
onKeyUp: function onKeyUp() {} | ||
}; | ||
var _default = Checkbox; | ||
exports.default = _default; |
{ | ||
"name": "rc-checkbox", | ||
"version": "2.3.1", | ||
"version": "2.3.2", | ||
"description": "checkbox ui component for react", | ||
@@ -43,3 +43,3 @@ "keywords": [ | ||
"@types/classnames": "^2.2.10", | ||
"@types/jest": "^25.2.2", | ||
"@types/jest": "^26.0.5", | ||
"@umijs/fabric": "^2.2.2", | ||
@@ -57,3 +57,7 @@ "coveralls": "^3.0.6", | ||
"react-test-renderer": "^16.0.0" | ||
}, | ||
"peerDependencies": { | ||
"react": ">=16.9.0", | ||
"react-dom": ">=16.9.0" | ||
} | ||
} |
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
486
22827
4