@uiw/react-color-colorful
Advanced tools
Comparing version 1.1.0 to 1.1.1
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"]; | ||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"]; | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -11,26 +9,16 @@ value: true | ||
exports["default"] = void 0; | ||
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2")); | ||
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties")); | ||
var _react = _interopRequireDefault(require("react")); | ||
var _colorConvert = require("@uiw/color-convert"); | ||
var _reactColorAlpha = _interopRequireWildcard(require("@uiw/react-color-alpha")); | ||
var _reactColorSaturation = _interopRequireDefault(require("@uiw/react-color-saturation")); | ||
var _reactColorHue = _interopRequireDefault(require("@uiw/react-color-hue")); | ||
var _jsxRuntime = require("react/jsx-runtime"); | ||
var _excluded = ["style", "color"], | ||
_excluded2 = ["prefixCls", "className", "onChange", "color", "style", "disableAlpha"]; | ||
_excluded2 = ["prefixCls", "className", "onChange", "color", "style", "disableAlpha"]; | ||
var Pointer = function Pointer(_ref) { | ||
var style = _ref.style, | ||
color = _ref.color, | ||
props = (0, _objectWithoutProperties2["default"])(_ref, _excluded); | ||
color = _ref.color, | ||
props = (0, _objectWithoutProperties2["default"])(_ref, _excluded); | ||
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, props), {}, { | ||
@@ -59,18 +47,15 @@ style: (0, _objectSpread2["default"])({ | ||
}; | ||
var Colorful = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) { | ||
var _props$prefixCls = props.prefixCls, | ||
prefixCls = _props$prefixCls === void 0 ? 'w-color-colorful' : _props$prefixCls, | ||
className = props.className, | ||
onChange = props.onChange, | ||
color = props.color, | ||
style = props.style, | ||
disableAlpha = props.disableAlpha, | ||
other = (0, _objectWithoutProperties2["default"])(props, _excluded2); | ||
prefixCls = _props$prefixCls === void 0 ? 'w-color-colorful' : _props$prefixCls, | ||
className = props.className, | ||
onChange = props.onChange, | ||
color = props.color, | ||
style = props.style, | ||
disableAlpha = props.disableAlpha, | ||
other = (0, _objectWithoutProperties2["default"])(props, _excluded2); | ||
var hsva = typeof color === 'string' && (0, _colorConvert.validHex)(color) ? (0, _colorConvert.hexToHsva)(color) : color || {}; | ||
var handleChange = function handleChange(value) { | ||
return onChange && onChange((0, _colorConvert.color)(value)); | ||
}; | ||
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", (0, _objectSpread2["default"])((0, _objectSpread2["default"])({ | ||
@@ -96,4 +81,4 @@ ref: ref, | ||
var left = _ref2.left, | ||
top = _ref2.top, | ||
color = _ref2.color; | ||
top = _ref2.top, | ||
color = _ref2.color; | ||
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Pointer, { | ||
@@ -148,3 +133,2 @@ style: { | ||
}); | ||
Colorful.displayName = 'Colorful'; | ||
@@ -151,0 +135,0 @@ var _default = Colorful; |
import _extends from "@babel/runtime/helpers/extends"; | ||
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose"; | ||
var _excluded = ["style", "color"], | ||
_excluded2 = ["prefixCls", "className", "onChange", "color", "style", "disableAlpha"]; | ||
_excluded2 = ["prefixCls", "className", "onChange", "color", "style", "disableAlpha"]; | ||
import React from 'react'; | ||
@@ -12,10 +12,8 @@ import { validHex, color as handleColor, hexToHsva, hsvaToHex, hsvaToRgbaString } from '@uiw/color-convert'; | ||
import { jsxs as _jsxs } from "react/jsx-runtime"; | ||
var Pointer = _ref => { | ||
var { | ||
style, | ||
color | ||
} = _ref, | ||
props = _objectWithoutPropertiesLoose(_ref, _excluded); | ||
style, | ||
color | ||
} = _ref, | ||
props = _objectWithoutPropertiesLoose(_ref, _excluded); | ||
return /*#__PURE__*/_jsx("div", _extends({}, props, { | ||
@@ -44,18 +42,14 @@ style: _extends({ | ||
}; | ||
var Colorful = /*#__PURE__*/React.forwardRef((props, ref) => { | ||
var { | ||
prefixCls = 'w-color-colorful', | ||
className, | ||
onChange, | ||
color, | ||
style, | ||
disableAlpha | ||
} = props, | ||
other = _objectWithoutPropertiesLoose(props, _excluded2); | ||
prefixCls = 'w-color-colorful', | ||
className, | ||
onChange, | ||
color, | ||
style, | ||
disableAlpha | ||
} = props, | ||
other = _objectWithoutPropertiesLoose(props, _excluded2); | ||
var hsva = typeof color === 'string' && validHex(color) ? hexToHsva(color) : color || {}; | ||
var handleChange = value => onChange && onChange(handleColor(value)); | ||
return /*#__PURE__*/_jsxs("div", _extends({ | ||
@@ -62,0 +56,0 @@ ref: ref, |
{ | ||
"name": "@uiw/react-color-colorful", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Color Colorful", | ||
@@ -38,8 +38,8 @@ "author": "Kenny Wong <wowohoo@qq.com>", | ||
"dependencies": { | ||
"@babel/runtime": "~7.18.0", | ||
"@uiw/color-convert": "1.1.0", | ||
"@uiw/react-color-alpha": "1.1.0", | ||
"@uiw/react-color-hue": "1.1.0", | ||
"@uiw/react-color-saturation": "1.1.0" | ||
"@babel/runtime": "~7.19.0", | ||
"@uiw/color-convert": "1.1.1", | ||
"@uiw/react-color-alpha": "1.1.1", | ||
"@uiw/react-color-hue": "1.1.1", | ||
"@uiw/react-color-saturation": "1.1.1" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
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
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
29094
+ Added@babel/runtime@7.19.4(transitive)
+ Added@uiw/color-convert@1.1.1(transitive)
+ Added@uiw/react-color-alpha@1.1.1(transitive)
+ Added@uiw/react-color-hue@1.1.1(transitive)
+ Added@uiw/react-color-saturation@1.1.1(transitive)
+ Added@uiw/react-drag-event-interactive@1.1.1(transitive)
- Removed@babel/runtime@7.18.9(transitive)
- Removed@uiw/color-convert@1.1.0(transitive)
- Removed@uiw/react-color-alpha@1.1.0(transitive)
- Removed@uiw/react-color-hue@1.1.0(transitive)
- Removed@uiw/react-color-saturation@1.1.0(transitive)
- Removed@uiw/react-drag-event-interactive@1.1.0(transitive)
Updated@babel/runtime@~7.19.0
Updated@uiw/color-convert@1.1.1
Updated@uiw/react-color-alpha@1.1.1
Updated@uiw/react-color-hue@1.1.1