@easyv/react-components 0.0.3 → 0.0.5
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.
- package/dist/Collapse/index.d.ts +9 -3
- package/dist/Collapse/index.js +15 -1
- package/dist/Collapse/index.less +5 -0
- package/dist/ColorPicker/ColorPreview.d.ts +19 -0
- package/dist/ColorPicker/ColorPreview.js +27 -0
- package/dist/ColorPicker/ColorPreview.less +5 -0
- package/dist/ColorPicker/index.js +25 -7
- package/dist/Input/index.js +4 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -2
- package/package.json +4 -4
package/dist/Collapse/index.d.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
|
2
|
+
import type { CollapseProps } from '@arco-design/web-react';
|
|
2
3
|
import './index.less';
|
|
3
|
-
|
|
4
|
-
|
|
4
|
+
declare function XCollapse(props: PropsWithChildren<CollapseProps>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare namespace XCollapse {
|
|
6
|
+
var Item: React.ForwardRefExoticComponent<import("@arco-design/web-react").CollapseItemProps & {
|
|
7
|
+
children?: any;
|
|
8
|
+
} & React.RefAttributes<unknown>>;
|
|
9
|
+
}
|
|
10
|
+
export default XCollapse;
|
package/dist/Collapse/index.js
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
|
+
import React from 'react';
|
|
1
8
|
import { Collapse } from '@arco-design/web-react';
|
|
9
|
+
import { RightOutlined } from '@easyv/react-icons';
|
|
2
10
|
import "./index.less";
|
|
3
|
-
|
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
export default function XCollapse(props) {
|
|
13
|
+
return /*#__PURE__*/_jsx(Collapse, _objectSpread({
|
|
14
|
+
expandIcon: /*#__PURE__*/_jsx(RightOutlined, {})
|
|
15
|
+
}, props));
|
|
16
|
+
}
|
|
17
|
+
XCollapse.Item = Collapse.Item;
|
package/dist/Collapse/index.less
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import './ColorPreview.less';
|
|
2
|
+
declare type ColorPreviewProps = PureColorProps | LinearColorProps;
|
|
3
|
+
interface PureColorProps {
|
|
4
|
+
type: 'pure';
|
|
5
|
+
value: string;
|
|
6
|
+
}
|
|
7
|
+
interface LinearColorProps {
|
|
8
|
+
type: 'linear';
|
|
9
|
+
value: {
|
|
10
|
+
stops: {
|
|
11
|
+
color: string;
|
|
12
|
+
offset: number;
|
|
13
|
+
}[];
|
|
14
|
+
angle: number;
|
|
15
|
+
opacity: number;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export default function ColorPreview({ type, value }: ColorPreviewProps): import("react/jsx-runtime").JSX.Element | null;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import "./ColorPreview.less";
|
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
+
export default function ColorPreview(_ref) {
|
|
5
|
+
var type = _ref.type,
|
|
6
|
+
value = _ref.value;
|
|
7
|
+
switch (type) {
|
|
8
|
+
case 'pure':
|
|
9
|
+
{
|
|
10
|
+
return /*#__PURE__*/_jsx("div", {
|
|
11
|
+
className: "arco-color-picker-preview",
|
|
12
|
+
style: {
|
|
13
|
+
backgroundColor: value
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
case 'linear':
|
|
18
|
+
{
|
|
19
|
+
return /*#__PURE__*/_jsx("div", {
|
|
20
|
+
children: "\u6E10\u53D8"
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
default:
|
|
24
|
+
console.error('未知的颜色类型' + type);
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -4,13 +4,15 @@ import 'rc-color-picker/assets/index.css';
|
|
|
4
4
|
import Color from 'rc-color-picker/lib/helpers/color';
|
|
5
5
|
import { useDebounceFn } from 'ahooks';
|
|
6
6
|
import "./index.less";
|
|
7
|
+
import ColorPreview from "./ColorPreview";
|
|
7
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
10
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
11
|
export default function ColorPicker(_ref) {
|
|
9
12
|
var _ref$value = _ref.value,
|
|
10
13
|
value = _ref$value === void 0 ? 'rgba(255,0,255,0.5)' : _ref$value,
|
|
11
14
|
onChange = _ref.onChange;
|
|
12
15
|
var colorObj = new Color(value);
|
|
13
|
-
console.log('colorObj', colorObj, colorObj.toRgbString());
|
|
14
16
|
var _useDebounceFn = useDebounceFn(function (_ref2) {
|
|
15
17
|
var color = _ref2.color,
|
|
16
18
|
alpha = _ref2.alpha;
|
|
@@ -29,11 +31,27 @@ export default function ColorPicker(_ref) {
|
|
|
29
31
|
trailing: false
|
|
30
32
|
}),
|
|
31
33
|
run = _useDebounceFn.run;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
var linearValue = {
|
|
35
|
+
stops: [{
|
|
36
|
+
offset: 0,
|
|
37
|
+
color: '#fff'
|
|
38
|
+
}, {
|
|
39
|
+
offset: 100,
|
|
40
|
+
color: '#000'
|
|
41
|
+
}],
|
|
42
|
+
angle: 0,
|
|
43
|
+
opacity: 100
|
|
44
|
+
};
|
|
45
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
46
|
+
children: [/*#__PURE__*/_jsx(ColorPreview, {
|
|
47
|
+
type: "linear",
|
|
48
|
+
value: linearValue
|
|
49
|
+
}), /*#__PURE__*/_jsx(ColorPickerPanel, {
|
|
50
|
+
className: "arco-color-picker",
|
|
51
|
+
mode: "RGB",
|
|
52
|
+
color: colorObj.toHexString(),
|
|
53
|
+
alpha: colorObj.alpha,
|
|
54
|
+
onChange: run
|
|
55
|
+
})]
|
|
38
56
|
});
|
|
39
57
|
}
|
package/dist/Input/index.js
CHANGED
|
@@ -23,7 +23,10 @@ var XInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
23
23
|
ref: ref,
|
|
24
24
|
className: classNames(className, {
|
|
25
25
|
'arco-input-borderless': !bordered
|
|
26
|
-
})
|
|
26
|
+
}),
|
|
27
|
+
onPressEnter: function onPressEnter(e) {
|
|
28
|
+
e.target.blur();
|
|
29
|
+
}
|
|
27
30
|
}, restProps));
|
|
28
31
|
});
|
|
29
32
|
var InputSearch = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -65,5 +65,4 @@ export { default as Radio } from "./Radio";
|
|
|
65
65
|
export { default as Select } from "./Select";
|
|
66
66
|
export { default as Space } from "./Space";
|
|
67
67
|
export { default as Tag } from "./Tag";
|
|
68
|
-
|
|
69
|
-
// export { default as ColorPicker } from './ColorPicker';
|
|
68
|
+
export { default as ColorPicker } from "./ColorPicker";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@easyv/react-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "a react component library base on arco design",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
"rc-color-picker": "^1.2.6"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@arco-design/web-react": "2.
|
|
57
|
-
"@arco-themes/react-dtable": "0.0.
|
|
56
|
+
"@arco-design/web-react": "2.55.1",
|
|
57
|
+
"@arco-themes/react-dtable": "0.0.31",
|
|
58
58
|
"@commitlint/cli": "^17.1.2",
|
|
59
59
|
"@commitlint/config-conventional": "^17.1.0",
|
|
60
60
|
"@easyv/sync-to-mirror": "^0.0.2",
|
|
@@ -97,6 +97,6 @@
|
|
|
97
97
|
"registry": "https://registry.npmjs.org"
|
|
98
98
|
},
|
|
99
99
|
"authors": [
|
|
100
|
-
"
|
|
100
|
+
"xiaoyao@dtstack.com"
|
|
101
101
|
]
|
|
102
102
|
}
|