@easyv/react-components 0.3.10 → 0.3.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -10,7 +10,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
10
10
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
11
11
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
12
12
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
-
import { useRef, useState } from 'react';
|
|
13
|
+
import { useEffect, useRef, useState } from 'react';
|
|
14
14
|
import tinycolor from 'tinycolor2';
|
|
15
15
|
import Palette from "./Palette";
|
|
16
16
|
import ControlBar from "./ControlBar";
|
|
@@ -34,6 +34,14 @@ export default function Panel(_ref) {
|
|
|
34
34
|
_useState2 = _slicedToArray(_useState, 2),
|
|
35
35
|
color = _useState2[0],
|
|
36
36
|
setColor = _useState2[1];
|
|
37
|
+
useEffect(function () {
|
|
38
|
+
if (propsColor) {
|
|
39
|
+
setColor({
|
|
40
|
+
hsv: tinycolor(propsColor).toHsv(),
|
|
41
|
+
alpha: tinycolor(propsColor).getAlpha()
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}, [propsColor]);
|
|
37
45
|
var _color$hsv = color.hsv,
|
|
38
46
|
h = _color$hsv.h,
|
|
39
47
|
s = _color$hsv.s,
|
|
@@ -15,11 +15,11 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
15
15
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
16
16
|
import { forwardRef, useCallback, useEffect, useRef, useState } from 'react';
|
|
17
17
|
import { DownOutlined, UpOutlined } from '@easyv/react-icons';
|
|
18
|
+
import classNames from 'classnames';
|
|
18
19
|
import Input from "../Input";
|
|
19
20
|
import { getSafeValue, evaluateExpression } from "./util";
|
|
20
21
|
import { PointerDrag } from "./PointDrag";
|
|
21
22
|
import "./index.less";
|
|
22
|
-
import classNames from 'classnames';
|
|
23
23
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
24
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
25
25
|
var valueRegx = /^[0-9().+\-*/]+$/;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import type { InputNumberProps } from '@arco-design/web-react';
|
|
2
3
|
interface XInputNumberProps extends Omit<InputNumberProps, 'value' | 'defaultValue' | 'onKeyDown' | 'formatter' | 'parser' | 'strictMode' | 'mode' | 'icons'> {
|
|
3
4
|
value?: number;
|
|
4
5
|
defaultValue?: number;
|
|
6
|
+
bordered?: boolean;
|
|
7
|
+
onKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
5
8
|
}
|
|
6
9
|
export { XInputNumberProps as InputNumberProps };
|