lijianan
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with
9 additions and
11 deletions
-
components/index.ts
-
components/qrcode/index.tsx
-
components/qrcode/interface.ts
-
components/qrcode/style/index.ts
|
|
@ -94,7 +94,7 @@ export type { PopoverProps } from './popover'; |
|
|
|
export { default as Progress } from './progress'; |
|
|
|
export type { ProgressProps } from './progress'; |
|
|
|
export { default as QRCode } from './qrcode'; |
|
|
|
export type { QRCodeProps, QRPropsCanvas } from './qrcode/interface'; |
|
|
|
export type { QRCodeProps, QRPropsCanvas, QRPropsSvg } from './qrcode/interface'; |
|
|
|
export { default as Radio } from './radio'; |
|
|
|
export type { RadioChangeEvent, RadioGroupProps, RadioProps } from './radio'; |
|
|
|
export { default as Rate } from './rate'; |
|
|
|
|
|
@ -45,7 +45,7 @@ const QRCode: React.FC<QRCodeProps> = (props) => { |
|
|
|
width: iconSize, |
|
|
|
excavate: true, |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const qrCodeProps = { |
|
|
|
value, |
|
|
|
size: size - (token.paddingSM + token.lineWidth) * 2, |
|
|
@ -53,8 +53,8 @@ const QRCode: React.FC<QRCodeProps> = (props) => { |
|
|
|
bgColor, |
|
|
|
fgColor: color, |
|
|
|
imageSettings: icon ? imageSettings : undefined, |
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
const [locale] = useLocale('QRCode'); |
|
|
|
|
|
|
|
if (!value) { |
|
|
@ -93,11 +93,7 @@ const QRCode: React.FC<QRCodeProps> = (props) => { |
|
|
|
)} |
|
|
|
</div> |
|
|
|
)} |
|
|
|
{type === 'canvas' ? ( |
|
|
|
<QRCodeCanvas {...qrCodeProps} /> |
|
|
|
) : ( |
|
|
|
<QRCodeSVG {...qrCodeProps} /> |
|
|
|
)} |
|
|
|
{type === 'canvas' ? <QRCodeCanvas {...qrCodeProps} /> : <QRCodeSVG {...qrCodeProps} />} |
|
|
|
</div>, |
|
|
|
); |
|
|
|
}; |
|
|
|
|
|
@ -21,7 +21,9 @@ export interface QRProps { |
|
|
|
} |
|
|
|
|
|
|
|
export type QRPropsCanvas = QRProps & React.CanvasHTMLAttributes<HTMLCanvasElement>; |
|
|
|
|
|
|
|
export type QRPropsSvg = QRProps & React.SVGAttributes<SVGSVGElement>; |
|
|
|
|
|
|
|
export interface QRCodeProps extends QRProps { |
|
|
|
className?: string; |
|
|
|
rootClassName?: string; |
|
|
|
|
|
@ -1,6 +1,6 @@ |
|
|
|
import type { FullToken, GenerateStyle } from '../../theme/internal'; |
|
|
|
import { mergeToken, genComponentStyleHook } from '../../theme/internal'; |
|
|
|
import { resetComponent } from '../../style'; |
|
|
|
import type { FullToken, GenerateStyle } from '../../theme/internal'; |
|
|
|
import { genComponentStyleHook, mergeToken } from '../../theme/internal'; |
|
|
|
|
|
|
|
export interface ComponentToken {} |
|
|
|
|
|
|
|