@jswork/antd-components 1.0.211 → 1.0.212

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jswork/antd-components",
3
- "version": "1.0.211",
3
+ "version": "1.0.212",
4
4
  "main": "dist/main.cjs.js",
5
5
  "module": "dist/main.esm.js",
6
6
  "types": "dist/main.d.ts",
@@ -1,11 +1,12 @@
1
1
  import { Typography } from 'antd';
2
+ import { ValueType } from 'rc-input/lib/interface';
2
3
  import React from 'react';
3
4
  import { AcInput, AcInputProps } from './input';
4
5
 
5
6
  const CLASS_NAME = 'ac-input-copyable';
6
7
 
7
8
  interface AcInputCopyableState {
8
- value?: string;
9
+ value?: ValueType;
9
10
  }
10
11
 
11
12
  export class AcInputCopyable extends React.Component<AcInputProps, AcInputCopyableState> {
@@ -22,7 +23,13 @@ export class AcInputCopyable extends React.Component<AcInputProps, AcInputCopyab
22
23
 
23
24
  get copyView() {
24
25
  const { value } = this.state;
25
- return <Typography.Text copyable={{ text: value }} />;
26
+ return <Typography.Text copyable={{ text: String(value) }} />;
27
+ }
28
+
29
+ shouldComponentUpdate(props: Readonly<AcInputProps>): boolean {
30
+ const { value } = props;
31
+ if (value !== this.props.value) this.setState({ value });
32
+ return true;
26
33
  }
27
34
 
28
35
  handleInputChange = (e) => {