@uiw/react-color-material
Advanced tools
Comparing version 1.1.0 to 1.1.1
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"]; | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -9,17 +8,9 @@ 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 _reactColorEditableInput = _interopRequireDefault(require("@uiw/react-color-editable-input")); | ||
var _reactColorEditableInputRgba = _interopRequireDefault(require("@uiw/react-color-editable-input-rgba")); | ||
var _jsxRuntime = require("react/jsx-runtime"); | ||
var _excluded = ["prefixCls", "className", "style", "color", "onChange"]; | ||
@@ -36,18 +27,15 @@ var styleRBG = { | ||
}; | ||
var Material = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) { | ||
var _props$prefixCls = props.prefixCls, | ||
prefixCls = _props$prefixCls === void 0 ? 'w-color-material' : _props$prefixCls, | ||
className = props.className, | ||
style = props.style, | ||
color = props.color, | ||
onChange = props.onChange, | ||
other = (0, _objectWithoutProperties2["default"])(props, _excluded); | ||
prefixCls = _props$prefixCls === void 0 ? 'w-color-material' : _props$prefixCls, | ||
className = props.className, | ||
style = props.style, | ||
color = props.color, | ||
onChange = props.onChange, | ||
other = (0, _objectWithoutProperties2["default"])(props, _excluded); | ||
var hsva = typeof color === 'string' && (0, _colorConvert.validHex)(color) ? (0, _colorConvert.hexToHsva)(color) : color; | ||
var hex = color ? (0, _colorConvert.hsvaToHex)(hsva).replace(/^#/, '') : ''; | ||
var handleChange = function handleChange(hsv) { | ||
onChange && onChange((0, _colorConvert.color)(hsv)); | ||
}; | ||
var handleHex = function handleHex(value, evn) { | ||
@@ -58,3 +46,2 @@ if (typeof value === 'string' && (0, _colorConvert.validHex)(value) && /(3|6)/.test(String(value.length))) { | ||
}; | ||
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", (0, _objectSpread2["default"])((0, _objectSpread2["default"])({ | ||
@@ -127,3 +114,2 @@ ref: ref, | ||
}); | ||
Material.displayName = 'Material'; | ||
@@ -130,0 +116,0 @@ var _default = Material; |
@@ -22,17 +22,14 @@ import _extends from "@babel/runtime/helpers/extends"; | ||
var { | ||
prefixCls = 'w-color-material', | ||
className, | ||
style, | ||
color, | ||
onChange | ||
} = props, | ||
other = _objectWithoutPropertiesLoose(props, _excluded); | ||
prefixCls = 'w-color-material', | ||
className, | ||
style, | ||
color, | ||
onChange | ||
} = props, | ||
other = _objectWithoutPropertiesLoose(props, _excluded); | ||
var hsva = typeof color === 'string' && validHex(color) ? hexToHsva(color) : color; | ||
var hex = color ? hsvaToHex(hsva).replace(/^#/, '') : ''; | ||
var handleChange = hsv => { | ||
onChange && onChange(handleColor(hsv)); | ||
}; | ||
var handleHex = (value, evn) => { | ||
@@ -43,3 +40,2 @@ if (typeof value === 'string' && validHex(value) && /(3|6)/.test(String(value.length))) { | ||
}; | ||
return /*#__PURE__*/_jsxs("div", _extends({ | ||
@@ -46,0 +42,0 @@ ref: ref, |
{ | ||
"name": "@uiw/react-color-material", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Color Material", | ||
@@ -37,7 +37,7 @@ "author": "Kenny Wong <wowohoo@qq.com>", | ||
"dependencies": { | ||
"@babel/runtime": "~7.18.0", | ||
"@uiw/color-convert": "1.1.0", | ||
"@uiw/react-color-editable-input": "1.1.0", | ||
"@uiw/react-color-editable-input-rgba": "1.1.0" | ||
"@babel/runtime": "~7.19.0", | ||
"@uiw/color-convert": "1.1.1", | ||
"@uiw/react-color-editable-input": "1.1.1", | ||
"@uiw/react-color-editable-input-rgba": "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
26913
+ Added@babel/runtime@7.19.4(transitive)
+ Added@uiw/color-convert@1.1.1(transitive)
+ Added@uiw/react-color-editable-input@1.1.1(transitive)
+ Added@uiw/react-color-editable-input-rgba@1.1.1(transitive)
- Removed@babel/runtime@7.18.9(transitive)
- Removed@uiw/color-convert@1.1.0(transitive)
- Removed@uiw/react-color-editable-input@1.1.0(transitive)
- Removed@uiw/react-color-editable-input-rgba@1.1.0(transitive)
Updated@babel/runtime@~7.19.0
Updated@uiw/color-convert@1.1.1