@hw-component/form 1.8.5 → 1.8.6

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 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 { CopyToClipboard } from 'react-copy-to-clipboard';
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(CopyToClipboard, {
22
- text: value,
23
- onCopy: function onCopy() {
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, {})
@@ -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 reactCopyToClipboard = require('react-copy-to-clipboard');
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(reactCopyToClipboard.CopyToClipboard, {
25
- text: value,
26
- onCopy: function onCopy() {
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hw-component/form",
3
- "version": "1.8.5",
3
+ "version": "1.8.6",
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
- "core-js": "3"
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
- <CopyToClipboard
9
- text={value}
10
- onCopy={() => {
11
- message.success("复制成功!");
8
+ <div
9
+ style={{
10
+ cursor:'pointer'
11
+ }}
12
+ onClick={()=>{
13
+ copy(value);
14
+ message.success("复制成功!");
12
15
  }}
13
16
  >
14
17
  <CopyOutlined />
15
- </CopyToClipboard>
18
+ </div>
16
19
  );
17
20
  };
18
21
  export default ({ copy, value, addonAfter, ...props }: HInputProps) => {
@@ -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={{