@uiw/react-color-compact
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,22 +9,12 @@ value: true | ||
exports["default"] = void 0; | ||
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2")); | ||
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties")); | ||
var _react = _interopRequireWildcard(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 _reactColorSwatch = _interopRequireDefault(require("@uiw/react-color-swatch")); | ||
var _jsxRuntime = require("react/jsx-runtime"); | ||
var _excluded = ["prefixCls", "className", "style", "onChange", "color", "colors"]; | ||
var COLORS = ['#4D4D4D', '#999999', '#FFFFFF', '#F44E3B', '#FE9200', '#FCDC00', '#DBDF00', '#A4DD00', '#68CCCA', '#73D8FF', '#AEA1FF', '#FDA1FF', '#333333', '#808080', '#cccccc', '#D33115', '#E27300', '#FCC400', '#B0BC00', '#68BC00', '#16A5A5', '#009CE0', '#7B64FF', '#FA28FF', '#000000', '#666666', '#B3B3B3', '#9F0500', '#C45100', '#FB9E00', '#808900', '#194D33', '#0C797D', '#0062B1', '#653294', '#AB149E']; | ||
function Point(props) { | ||
@@ -43,13 +31,12 @@ if (!props.checked) return null; | ||
} | ||
var Compact = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) { | ||
var _props$prefixCls = props.prefixCls, | ||
prefixCls = _props$prefixCls === void 0 ? 'w-color-compact' : _props$prefixCls, | ||
className = props.className, | ||
style = props.style, | ||
onChange = props.onChange, | ||
color = props.color, | ||
_props$colors = props.colors, | ||
colors = _props$colors === void 0 ? COLORS : _props$colors, | ||
other = (0, _objectWithoutProperties2["default"])(props, _excluded); | ||
prefixCls = _props$prefixCls === void 0 ? 'w-color-compact' : _props$prefixCls, | ||
className = props.className, | ||
style = props.style, | ||
onChange = props.onChange, | ||
color = props.color, | ||
_props$colors = props.colors, | ||
colors = _props$colors === void 0 ? COLORS : _props$colors, | ||
other = (0, _objectWithoutProperties2["default"])(props, _excluded); | ||
var hsva = typeof color === 'string' && (0, _colorConvert.validHex)(color) ? (0, _colorConvert.hexToHsva)(color) : color; | ||
@@ -60,3 +47,2 @@ var hex = color ? (0, _colorConvert.hsvaToHex)(hsva).replace(/^#/, '') : ''; | ||
}, []); | ||
var handleHex = function handleHex(value, evn) { | ||
@@ -67,3 +53,2 @@ if (typeof value === 'string' && (0, _colorConvert.validHex)(value) && /(3|6)/.test(String(value.length))) { | ||
}; | ||
var rgbProps = { | ||
@@ -151,3 +136,2 @@ style: { | ||
}); | ||
Compact.displayName = 'Compact'; | ||
@@ -154,0 +138,0 @@ var _default = Compact; |
@@ -12,3 +12,2 @@ import _extends from "@babel/runtime/helpers/extends"; | ||
var COLORS = ['#4D4D4D', '#999999', '#FFFFFF', '#F44E3B', '#FE9200', '#FCDC00', '#DBDF00', '#A4DD00', '#68CCCA', '#73D8FF', '#AEA1FF', '#FDA1FF', '#333333', '#808080', '#cccccc', '#D33115', '#E27300', '#FCC400', '#B0BC00', '#68BC00', '#16A5A5', '#009CE0', '#7B64FF', '#FA28FF', '#000000', '#666666', '#B3B3B3', '#9F0500', '#C45100', '#FB9E00', '#808900', '#194D33', '#0C797D', '#0062B1', '#653294', '#AB149E']; | ||
function Point(props) { | ||
@@ -25,18 +24,15 @@ if (!props.checked) return null; | ||
} | ||
var Compact = /*#__PURE__*/React.forwardRef((props, ref) => { | ||
var { | ||
prefixCls = 'w-color-compact', | ||
className, | ||
style, | ||
onChange, | ||
color, | ||
colors = COLORS | ||
} = props, | ||
other = _objectWithoutPropertiesLoose(props, _excluded); | ||
prefixCls = 'w-color-compact', | ||
className, | ||
style, | ||
onChange, | ||
color, | ||
colors = COLORS | ||
} = props, | ||
other = _objectWithoutPropertiesLoose(props, _excluded); | ||
var hsva = typeof color === 'string' && validHex(color) ? hexToHsva(color) : color; | ||
var hex = color ? hsvaToHex(hsva).replace(/^#/, '') : ''; | ||
var handleChangeCallback = useCallback(hsv => onChange && onChange(handleColor(hsv)), []); | ||
var handleHex = (value, evn) => { | ||
@@ -47,3 +43,2 @@ if (typeof value === 'string' && validHex(value) && /(3|6)/.test(String(value.length))) { | ||
}; | ||
var rgbProps = { | ||
@@ -50,0 +45,0 @@ style: { |
{ | ||
"name": "@uiw/react-color-compact", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Color Compact component for React.", | ||
@@ -37,8 +37,8 @@ "homepage": "https://uiwjs.github.io/react-color/#/compact", | ||
"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", | ||
"@uiw/react-color-swatch": "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", | ||
"@uiw/react-color-swatch": "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
33898
+ 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)
+ Added@uiw/react-color-swatch@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)
- Removed@uiw/react-color-swatch@1.1.0(transitive)
Updated@babel/runtime@~7.19.0
Updated@uiw/color-convert@1.1.1