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

@uiw/react-button

Package Overview
Dependencies
Maintainers
1
Versions
172
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@uiw/react-button - npm Package Compare versions

Comparing version 4.1.2 to 4.2.0

6

lib/cjs/index.d.ts

@@ -18,5 +18,3 @@ import React from 'react';

}
export default class Button extends React.Component<ButtonProps> {
static defaultProps: ButtonProps;
render(): JSX.Element;
}
declare const _default: (props?: ButtonProps) => JSX.Element;
export default _default;

@@ -16,12 +16,2 @@ "use strict";

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
var _react = _interopRequireDefault(require("react"));

@@ -33,65 +23,44 @@

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); }; }
var _default = function _default() {
var _classnames;
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; } }
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var _props$prefixCls = props.prefixCls,
prefixCls = _props$prefixCls === void 0 ? 'w-btn' : _props$prefixCls,
_props$disabled = props.disabled,
disabled = _props$disabled === void 0 ? false : _props$disabled,
_props$active = props.active,
active = _props$active === void 0 ? false : _props$active,
_props$loading = props.loading,
loading = _props$loading === void 0 ? false : _props$loading,
_props$block = props.block,
block = _props$block === void 0 ? false : _props$block,
_props$basic = props.basic,
basic = _props$basic === void 0 ? false : _props$basic,
_props$htmlType = props.htmlType,
htmlType = _props$htmlType === void 0 ? 'button' : _props$htmlType,
_props$type = props.type,
type = _props$type === void 0 ? 'light' : _props$type,
_props$size = props.size,
size = _props$size === void 0 ? 'default' : _props$size,
icon = props.icon,
className = props.className,
children = props.children,
others = (0, _objectWithoutProperties2.default)(props, ["prefixCls", "disabled", "active", "loading", "block", "basic", "htmlType", "type", "size", "icon", "className", "children"]);
var cls = (0, _classnames2.default)(className, prefixCls, (_classnames = {}, (0, _defineProperty2.default)(_classnames, "".concat(prefixCls, "-size-").concat(size), size), (0, _defineProperty2.default)(_classnames, "".concat(prefixCls, "-").concat(type), type), (0, _defineProperty2.default)(_classnames, "".concat(prefixCls, "-basic"), basic), (0, _defineProperty2.default)(_classnames, "".concat(prefixCls, "-loading"), loading), (0, _defineProperty2.default)(_classnames, "disabled", disabled || loading), (0, _defineProperty2.default)(_classnames, "active", active), (0, _defineProperty2.default)(_classnames, "block", block), _classnames));
return /*#__PURE__*/_react.default.createElement("button", (0, _extends2.default)({}, others, {
type: htmlType,
disabled: disabled || loading,
className: cls
}), icon && /*#__PURE__*/_react.default.createElement(_reactIcon.default, {
type: icon
}), children && _react.default.Children.map(children, function (child) {
if (!child) return child;
if ( /*#__PURE__*/_react.default.isValidElement(child)) return child;
return /*#__PURE__*/_react.default.createElement("span", null, child);
}));
};
var Button = /*#__PURE__*/function (_React$Component) {
(0, _inherits2.default)(Button, _React$Component);
var _super = _createSuper(Button);
function Button() {
(0, _classCallCheck2.default)(this, Button);
return _super.apply(this, arguments);
}
(0, _createClass2.default)(Button, [{
key: "render",
value: function render() {
var _classnames;
var _this$props = this.props,
prefixCls = _this$props.prefixCls,
type = _this$props.type,
size = _this$props.size,
icon = _this$props.icon,
active = _this$props.active,
disabled = _this$props.disabled,
block = _this$props.block,
basic = _this$props.basic,
className = _this$props.className,
loading = _this$props.loading,
children = _this$props.children,
htmlType = _this$props.htmlType,
others = (0, _objectWithoutProperties2.default)(_this$props, ["prefixCls", "type", "size", "icon", "active", "disabled", "block", "basic", "className", "loading", "children", "htmlType"]);
var cls = (0, _classnames2.default)(className, prefixCls, (_classnames = {}, (0, _defineProperty2.default)(_classnames, "".concat(prefixCls, "-size-").concat(size), size), (0, _defineProperty2.default)(_classnames, "".concat(prefixCls, "-").concat(type), type), (0, _defineProperty2.default)(_classnames, "".concat(prefixCls, "-basic"), basic), (0, _defineProperty2.default)(_classnames, "".concat(prefixCls, "-loading"), loading), (0, _defineProperty2.default)(_classnames, "disabled", disabled || loading), (0, _defineProperty2.default)(_classnames, "active", active), (0, _defineProperty2.default)(_classnames, "block", block), _classnames));
return /*#__PURE__*/_react.default.createElement("button", (0, _extends2.default)({}, others, {
type: htmlType,
disabled: disabled || loading,
className: cls
}), icon && /*#__PURE__*/_react.default.createElement(_reactIcon.default, {
type: icon
}), children && _react.default.Children.map(children, function (child) {
if (!child) return child;
if ( /*#__PURE__*/_react.default.isValidElement(child)) return child;
return /*#__PURE__*/_react.default.createElement("span", null, child);
}));
}
}]);
return Button;
}(_react.default.Component);
exports.default = Button;
Button.defaultProps = {
prefixCls: 'w-btn',
disabled: false,
active: false,
loading: false,
block: false,
basic: false,
htmlType: 'button',
type: 'light',
size: 'default'
};
exports.default = _default;
module.exports = exports.default;
//# sourceMappingURL=index.js.map

@@ -18,5 +18,3 @@ import React from 'react';

}
export default class Button extends React.Component<ButtonProps> {
static defaultProps: ButtonProps;
render(): JSX.Element;
}
declare const _default: (props?: ButtonProps) => JSX.Element;
export default _default;
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 _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 _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 React from 'react';

@@ -18,64 +8,43 @@ import classnames from 'classnames';

import "./style/index.css";
export default (function () {
var _classnames;
var Button = /*#__PURE__*/function (_React$Component) {
_inherits(Button, _React$Component);
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var _super = _createSuper(Button);
var _props$prefixCls = props.prefixCls,
prefixCls = _props$prefixCls === void 0 ? 'w-btn' : _props$prefixCls,
_props$disabled = props.disabled,
disabled = _props$disabled === void 0 ? false : _props$disabled,
_props$active = props.active,
active = _props$active === void 0 ? false : _props$active,
_props$loading = props.loading,
loading = _props$loading === void 0 ? false : _props$loading,
_props$block = props.block,
block = _props$block === void 0 ? false : _props$block,
_props$basic = props.basic,
basic = _props$basic === void 0 ? false : _props$basic,
_props$htmlType = props.htmlType,
htmlType = _props$htmlType === void 0 ? 'button' : _props$htmlType,
_props$type = props.type,
type = _props$type === void 0 ? 'light' : _props$type,
_props$size = props.size,
size = _props$size === void 0 ? 'default' : _props$size,
icon = props.icon,
className = props.className,
children = props.children,
others = _objectWithoutProperties(props, ["prefixCls", "disabled", "active", "loading", "block", "basic", "htmlType", "type", "size", "icon", "className", "children"]);
function Button() {
_classCallCheck(this, Button);
return _super.apply(this, arguments);
}
_createClass(Button, [{
key: "render",
value: function render() {
var _classnames;
var _this$props = this.props,
prefixCls = _this$props.prefixCls,
type = _this$props.type,
size = _this$props.size,
icon = _this$props.icon,
active = _this$props.active,
disabled = _this$props.disabled,
block = _this$props.block,
basic = _this$props.basic,
className = _this$props.className,
loading = _this$props.loading,
children = _this$props.children,
htmlType = _this$props.htmlType,
others = _objectWithoutProperties(_this$props, ["prefixCls", "type", "size", "icon", "active", "disabled", "block", "basic", "className", "loading", "children", "htmlType"]);
var cls = classnames(className, prefixCls, (_classnames = {}, _defineProperty(_classnames, "".concat(prefixCls, "-size-").concat(size), size), _defineProperty(_classnames, "".concat(prefixCls, "-").concat(type), type), _defineProperty(_classnames, "".concat(prefixCls, "-basic"), basic), _defineProperty(_classnames, "".concat(prefixCls, "-loading"), loading), _defineProperty(_classnames, "disabled", disabled || loading), _defineProperty(_classnames, "active", active), _defineProperty(_classnames, "block", block), _classnames));
return /*#__PURE__*/React.createElement("button", _extends({}, others, {
type: htmlType,
disabled: disabled || loading,
className: cls
}), icon && /*#__PURE__*/React.createElement(Icon, {
type: icon
}), children && React.Children.map(children, function (child) {
if (!child) return child;
if ( /*#__PURE__*/React.isValidElement(child)) return child;
return /*#__PURE__*/React.createElement("span", null, child);
}));
}
}]);
return Button;
}(React.Component);
Button.defaultProps = {
prefixCls: 'w-btn',
disabled: false,
active: false,
loading: false,
block: false,
basic: false,
htmlType: 'button',
type: 'light',
size: 'default'
};
export { Button as default };
var cls = classnames(className, prefixCls, (_classnames = {}, _defineProperty(_classnames, "".concat(prefixCls, "-size-").concat(size), size), _defineProperty(_classnames, "".concat(prefixCls, "-").concat(type), type), _defineProperty(_classnames, "".concat(prefixCls, "-basic"), basic), _defineProperty(_classnames, "".concat(prefixCls, "-loading"), loading), _defineProperty(_classnames, "disabled", disabled || loading), _defineProperty(_classnames, "active", active), _defineProperty(_classnames, "block", block), _classnames));
return /*#__PURE__*/React.createElement("button", _extends({}, others, {
type: htmlType,
disabled: disabled || loading,
className: cls
}), icon && /*#__PURE__*/React.createElement(Icon, {
type: icon
}), children && React.Children.map(children, function (child) {
if (!child) return child;
if ( /*#__PURE__*/React.isValidElement(child)) return child;
return /*#__PURE__*/React.createElement("span", null, child);
}));
});
//# sourceMappingURL=index.js.map
{
"name": "@uiw/react-button",
"version": "4.1.2",
"version": "4.2.0",
"description": "Button component",

@@ -46,3 +46,3 @@ "author": "Kenny Wong <wowohoo@qq.com>",

"dependencies": {
"@uiw/react-icon": "^4.1.1",
"@uiw/react-icon": "^4.2.0",
"@uiw/utils": "^4.1.2",

@@ -62,3 +62,3 @@ "classnames": "^2.2.6"

},
"gitHead": "caafb4b0a1360c2a2bd46903932e4531860ce608"
"gitHead": "ef630720992e1b680084bf028b6304fdcbcf71b9"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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