assui 2.0.130 → 2.0.131

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.
@@ -5,9 +5,9 @@ export interface RcQrcodeProps {
5
5
  /** 生成二维码的值 */
6
6
  value: QRCodeSegment[] | string;
7
7
  /** qrcode的QRCodeRenderersOptions */
8
- options: QRCodeRenderersOptions;
8
+ options?: QRCodeRenderersOptions;
9
9
  /** 获取HTMLCanvasElement */
10
- getCanvasInstance: (result: HTMLCanvasElement) => void;
10
+ getCanvasInstance?: (result: HTMLCanvasElement) => void;
11
11
  }
12
12
  declare const RcQrcode: {
13
13
  (props: RcQrcodeProps): JSX.Element;
@@ -21,7 +21,8 @@ import useQrcode from './useQrcode';
21
21
 
22
22
  var RcQrcode = function RcQrcode(props) {
23
23
  var value = props.value,
24
- options = props.options;
24
+ options = props.options,
25
+ getCanvasInstance = props.getCanvasInstance;
25
26
  var domElRef = React.useRef(null);
26
27
  var defaultOptions = {
27
28
  errorCorrectionLevel: 'H',
@@ -39,7 +40,7 @@ var RcQrcode = function RcQrcode(props) {
39
40
  throw err;
40
41
  }
41
42
 
42
- props === null || props === void 0 ? void 0 : props.getCanvasInstance(result);
43
+ getCanvasInstance && getCanvasInstance(result);
43
44
  (_a = domElRef.current) === null || _a === void 0 ? void 0 : _a.appendChild(result);
44
45
  });
45
46
  });
@@ -5,9 +5,9 @@ export interface RcQrcodeProps {
5
5
  /** 生成二维码的值 */
6
6
  value: QRCodeSegment[] | string;
7
7
  /** qrcode的QRCodeRenderersOptions */
8
- options: QRCodeRenderersOptions;
8
+ options?: QRCodeRenderersOptions;
9
9
  /** 获取HTMLCanvasElement */
10
- getCanvasInstance: (result: HTMLCanvasElement) => void;
10
+ getCanvasInstance?: (result: HTMLCanvasElement) => void;
11
11
  }
12
12
  declare const RcQrcode: {
13
13
  (props: RcQrcodeProps): JSX.Element;
@@ -73,7 +73,8 @@ exports.useQrcode = useQrcode_1["default"];
73
73
 
74
74
  var RcQrcode = function RcQrcode(props) {
75
75
  var value = props.value,
76
- options = props.options;
76
+ options = props.options,
77
+ getCanvasInstance = props.getCanvasInstance;
77
78
  var domElRef = React.useRef(null);
78
79
  var defaultOptions = {
79
80
  errorCorrectionLevel: 'H',
@@ -91,7 +92,7 @@ var RcQrcode = function RcQrcode(props) {
91
92
  throw err;
92
93
  }
93
94
 
94
- props === null || props === void 0 ? void 0 : props.getCanvasInstance(result);
95
+ getCanvasInstance && getCanvasInstance(result);
95
96
  (_a = domElRef.current) === null || _a === void 0 ? void 0 : _a.appendChild(result);
96
97
  });
97
98
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "assui",
3
- "version": "2.0.130",
3
+ "version": "2.0.131",
4
4
  "description": "react ui library",
5
5
  "author": "jason <usochen@gmail.com>",
6
6
  "main": "./lib/index.js",
@@ -69,5 +69,5 @@
69
69
  "node": ">=10.0.0"
70
70
  },
71
71
  "license": "MIT",
72
- "gitHead": "f9c60cd41a8da149f5b01701f883bcbb15ac87ee"
72
+ "gitHead": "24278cb26a1eec3b033e3fa024b730ca954b4eb3"
73
73
  }