@hw-component/form 1.8.5 → 1.8.7
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/es/Input/index.js +7 -4
- package/es/config.js +3 -3
- package/lib/Input/index.js +7 -4
- package/lib/config.js +3 -3
- package/package.json +13 -4
- package/src/components/Input/index.tsx +9 -6
- package/src/components/config.ts +3 -3
- package/src/pages/Input/index.tsx +1 -1
package/es/Input/index.js
CHANGED
|
@@ -11,16 +11,19 @@ import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/objectWitho
|
|
|
11
11
|
import { jsx } from 'react/jsx-runtime';
|
|
12
12
|
import { Input, message } from 'antd';
|
|
13
13
|
import { CopyOutlined } from '@ant-design/icons';
|
|
14
|
-
import
|
|
14
|
+
import copy from 'copy-to-clipboard';
|
|
15
15
|
|
|
16
16
|
var _excluded = ["copy", "value", "addonAfter"];
|
|
17
17
|
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; }
|
|
18
18
|
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; }
|
|
19
19
|
var CopyDom = function CopyDom(_ref) {
|
|
20
20
|
var value = _ref.value;
|
|
21
|
-
return jsx(
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
return jsx("div", {
|
|
22
|
+
style: {
|
|
23
|
+
cursor: 'pointer'
|
|
24
|
+
},
|
|
25
|
+
onClick: function onClick() {
|
|
26
|
+
copy(value);
|
|
24
27
|
message.success("复制成功!");
|
|
25
28
|
},
|
|
26
29
|
children: jsx(CopyOutlined, {})
|
package/es/config.js
CHANGED
|
@@ -29,13 +29,13 @@ var baseConfig = {
|
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
dateRanges: {
|
|
32
|
-
最近三天: function
|
|
32
|
+
最近三天: function three() {
|
|
33
33
|
return [rangeStartDay(2), moment()];
|
|
34
34
|
},
|
|
35
|
-
最近七天: function
|
|
35
|
+
最近七天: function seven() {
|
|
36
36
|
return [rangeStartDay(6), moment()];
|
|
37
37
|
},
|
|
38
|
-
最近三十天: function
|
|
38
|
+
最近三十天: function thirty() {
|
|
39
39
|
return [rangeStartDay(29), moment()];
|
|
40
40
|
}
|
|
41
41
|
},
|
package/lib/Input/index.js
CHANGED
|
@@ -14,16 +14,19 @@ var _objectWithoutProperties = require('@babel/runtime-corejs3/helpers/objectWit
|
|
|
14
14
|
var jsxRuntime = require('react/jsx-runtime');
|
|
15
15
|
var antd = require('antd');
|
|
16
16
|
var icons = require('@ant-design/icons');
|
|
17
|
-
var
|
|
17
|
+
var copy = require('copy-to-clipboard');
|
|
18
18
|
|
|
19
19
|
var _excluded = ["copy", "value", "addonAfter"];
|
|
20
20
|
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; }
|
|
21
21
|
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; }
|
|
22
22
|
var CopyDom = function CopyDom(_ref) {
|
|
23
23
|
var value = _ref.value;
|
|
24
|
-
return jsxRuntime.jsx(
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
return jsxRuntime.jsx("div", {
|
|
25
|
+
style: {
|
|
26
|
+
cursor: 'pointer'
|
|
27
|
+
},
|
|
28
|
+
onClick: function onClick() {
|
|
29
|
+
copy(value);
|
|
27
30
|
antd.message.success("复制成功!");
|
|
28
31
|
},
|
|
29
32
|
children: jsxRuntime.jsx(icons.CopyOutlined, {})
|
package/lib/config.js
CHANGED
|
@@ -30,13 +30,13 @@ var baseConfig = {
|
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
32
|
dateRanges: {
|
|
33
|
-
最近三天: function
|
|
33
|
+
最近三天: function three() {
|
|
34
34
|
return [rangeStartDay(2), moment()];
|
|
35
35
|
},
|
|
36
|
-
最近七天: function
|
|
36
|
+
最近七天: function seven() {
|
|
37
37
|
return [rangeStartDay(6), moment()];
|
|
38
38
|
},
|
|
39
|
-
最近三十天: function
|
|
39
|
+
最近三十天: function thirty() {
|
|
40
40
|
return [rangeStartDay(29), moment()];
|
|
41
41
|
}
|
|
42
42
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hw-component/form",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.7",
|
|
4
4
|
"description": "基于antd二次开发",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -38,13 +38,14 @@
|
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"react": "17.0.0",
|
|
40
40
|
"react-color": "^2.19.3",
|
|
41
|
-
"react-copy-to-clipboard": "^5.1.0",
|
|
42
41
|
"react-dom": "17.0.2",
|
|
43
42
|
"react-router-dom": "^6.11.2",
|
|
44
43
|
"@types/react-color": "^3.0.9",
|
|
45
44
|
"@ant-design/icons": "4.6.2",
|
|
46
45
|
"ahooks": "2.10.9",
|
|
47
|
-
"antd": "4.20.7"
|
|
46
|
+
"antd": "4.20.7",
|
|
47
|
+
"copy-to-clipboard": "3.3.1",
|
|
48
|
+
"core-js": "3"
|
|
48
49
|
},
|
|
49
50
|
"devDependencies": {
|
|
50
51
|
"@babel/core": "^7.21.8",
|
|
@@ -88,7 +89,15 @@
|
|
|
88
89
|
"webpack-cli": "^5.1.1",
|
|
89
90
|
"webpack-dev-server": "^4.15.0",
|
|
90
91
|
"webpackbar": "^5.0.2",
|
|
91
|
-
"
|
|
92
|
+
"react": "17.0.0",
|
|
93
|
+
"react-color": "^2.19.3",
|
|
94
|
+
"react-dom": "17.0.2",
|
|
95
|
+
"react-router-dom": "^6.11.2",
|
|
96
|
+
"@types/react-color": "^3.0.9",
|
|
97
|
+
"@ant-design/icons": "4.6.2",
|
|
98
|
+
"ahooks": "2.10.9",
|
|
99
|
+
"antd": "4.20.7",
|
|
100
|
+
"copy-to-clipboard": "3.3.1"
|
|
92
101
|
},
|
|
93
102
|
"cssPrefix": "hw"
|
|
94
103
|
}
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import { Input, message } from "antd";
|
|
2
2
|
import type { HInputProps } from "./modal";
|
|
3
3
|
import { CopyOutlined } from "@ant-design/icons";
|
|
4
|
+
import copy from "copy-to-clipboard";
|
|
4
5
|
// @ts-ignore
|
|
5
|
-
import { CopyToClipboard } from "react-copy-to-clipboard";
|
|
6
6
|
const CopyDom = ({ value }: HInputProps) => {
|
|
7
7
|
return (
|
|
8
|
-
<
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
<div
|
|
9
|
+
style={{
|
|
10
|
+
cursor:'pointer'
|
|
11
|
+
}}
|
|
12
|
+
onClick={()=>{
|
|
13
|
+
copy(value);
|
|
14
|
+
message.success("复制成功!");
|
|
12
15
|
}}
|
|
13
16
|
>
|
|
14
17
|
<CopyOutlined />
|
|
15
|
-
</
|
|
18
|
+
</div>
|
|
16
19
|
);
|
|
17
20
|
};
|
|
18
21
|
export default ({ copy, value, addonAfter, ...props }: HInputProps) => {
|
package/src/components/config.ts
CHANGED
|
@@ -26,13 +26,13 @@ export const baseConfig: IFormConfigContextProps = {
|
|
|
26
26
|
},
|
|
27
27
|
},
|
|
28
28
|
dateRanges: {
|
|
29
|
-
最近三天: ()
|
|
29
|
+
最近三天: function three(){
|
|
30
30
|
return [rangeStartDay(2), moment()]
|
|
31
31
|
},
|
|
32
|
-
最近七天: ()
|
|
32
|
+
最近七天: function seven() {
|
|
33
33
|
return [rangeStartDay(6),moment()]
|
|
34
34
|
},
|
|
35
|
-
最近三十天:()
|
|
35
|
+
最近三十天:function thirty() {
|
|
36
36
|
return [rangeStartDay(29), moment()]
|
|
37
37
|
},
|
|
38
38
|
},
|
|
@@ -11,7 +11,7 @@ import { Space } from "antd";
|
|
|
11
11
|
export default () => {
|
|
12
12
|
return (
|
|
13
13
|
<Space size={"large"} direction={"vertical"} style={{ width: "100%" }}>
|
|
14
|
-
<HInput placeholder="基础输入框" />
|
|
14
|
+
<HInput placeholder="基础输入框" copy value="11111"/>
|
|
15
15
|
<HSelectInput
|
|
16
16
|
placeholder="基础输入框"
|
|
17
17
|
selectProps={{
|