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

@uiw/react-color-editable-input-rgba

Package Overview
Dependencies
Maintainers
1
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@uiw/react-color-editable-input-rgba - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

49

lib/index.js

@@ -5,8 +5,10 @@ "use strict";

exports.__esModule = true;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));

@@ -40,3 +42,3 @@ var _react = _interopRequireDefault(require("react"));

onChange = props.onChange,
other = (0, _objectWithoutPropertiesLoose2["default"])(props, _excluded);
other = (0, _objectWithoutProperties2["default"])(props, _excluded);
var rgba = hsva ? (0, _colorConvert.hsvaToRgba)(hsva) : {};

@@ -61,3 +63,3 @@

if (value > 100) value = 100;
onChange && onChange((0, _colorConvert.color)((0, _colorConvert.rgbaToHsva)((0, _extends2["default"])({}, rgba, {
onChange && onChange((0, _colorConvert.color)((0, _colorConvert.rgbaToHsva)((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, rgba), {}, {
a: value / 100

@@ -78,3 +80,3 @@ }))));

if (type === 'r') {
onChange && onChange((0, _colorConvert.color)((0, _colorConvert.rgbaToHsva)((0, _extends2["default"])({}, rgba, {
onChange && onChange((0, _colorConvert.color)((0, _colorConvert.rgbaToHsva)((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, rgba), {}, {
r: value

@@ -85,3 +87,3 @@ }))));

if (type === 'g') {
onChange && onChange((0, _colorConvert.color)((0, _colorConvert.rgbaToHsva)((0, _extends2["default"])({}, rgba, {
onChange && onChange((0, _colorConvert.color)((0, _colorConvert.rgbaToHsva)((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, rgba), {}, {
g: value

@@ -92,3 +94,3 @@ }))));

if (type === 'b') {
onChange && onChange((0, _colorConvert.color)((0, _colorConvert.rgbaToHsva)((0, _extends2["default"])({}, rgba, {
onChange && onChange((0, _colorConvert.color)((0, _colorConvert.rgbaToHsva)((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, rgba), {}, {
b: value

@@ -100,11 +102,11 @@ }))));

return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", (0, _extends2["default"])({
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", (0, _objectSpread2["default"])((0, _objectSpread2["default"])({
ref: ref,
className: [prefixCls, className || ''].filter(Boolean).join(' ')
}, other, {
style: (0, _extends2["default"])({
}, other), {}, {
style: (0, _objectSpread2["default"])({
fontSize: 11,
display: 'flex'
}, style),
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactColorEditableInput["default"], (0, _extends2["default"])({
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactColorEditableInput["default"], (0, _objectSpread2["default"])((0, _objectSpread2["default"])({
label: "R",

@@ -117,5 +119,5 @@ value: rgba.r || 0,

}
}, rProps, {
style: (0, _extends2["default"])({}, rProps.style)
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactColorEditableInput["default"], (0, _extends2["default"])({
}, rProps), {}, {
style: (0, _objectSpread2["default"])({}, rProps.style)
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactColorEditableInput["default"], (0, _objectSpread2["default"])((0, _objectSpread2["default"])({
label: "G",

@@ -128,7 +130,7 @@ value: rgba.g || 0,

}
}, gProps, {
style: (0, _extends2["default"])({
}, gProps), {}, {
style: (0, _objectSpread2["default"])({
marginLeft: 5
}, rProps.style)
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactColorEditableInput["default"], (0, _extends2["default"])({
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactColorEditableInput["default"], (0, _objectSpread2["default"])((0, _objectSpread2["default"])({
label: "B",

@@ -141,7 +143,7 @@ value: rgba.b || 0,

}
}, bProps, {
style: (0, _extends2["default"])({
}, bProps), {}, {
style: (0, _objectSpread2["default"])({
marginLeft: 5
}, bProps.style)
})), aProps && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactColorEditableInput["default"], (0, _extends2["default"])({
})), aProps && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactColorEditableInput["default"], (0, _objectSpread2["default"])((0, _objectSpread2["default"])({
label: "A",

@@ -154,4 +156,4 @@ value: rgba.a ? parseInt(String(rgba.a * 100), 10) : 0,

}
}, aProps, {
style: (0, _extends2["default"])({
}, aProps), {}, {
style: (0, _objectSpread2["default"])({
marginLeft: 5

@@ -166,3 +168,2 @@ }, aProps.style)

exports["default"] = _default;
module.exports = exports.default;
//# sourceMappingURL=index.js.map
{
"name": "@uiw/react-color-editable-input-rgba",
"version": "1.0.0",
"version": "1.0.1",
"description": "Color Editable Input RGBA",

@@ -35,8 +35,8 @@ "author": "Kenny Wong <wowohoo@qq.com>",

"dependencies": {
"@babel/runtime": "7.15.3",
"@babel/runtime": "7.15.4",
"@uiw/color-convert": "^1.0.0",
"@uiw/react-color-editable-input": "^1.0.0"
"@uiw/react-color-editable-input": "^1.0.1"
},
"devDependencies": {
"@types/react": "17.0.19",
"@types/react": "17.0.20",
"@types/react-dom": "17.0.9",

@@ -43,0 +43,0 @@ "@types/react-test-renderer": "17.0.1",

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