Skip to content

Commit 7a63a65

Browse files
committedSep 19, 2023
type: fix IconTagType issue.
1 parent d31ca18 commit 7a63a65

File tree

6 files changed

+15
-15
lines changed

6 files changed

+15
-15
lines changed
 

Diff for: ‎packages/react-drawer/src/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import React, { useMemo } from 'react';
22
import Overlay, { OverlayProps } from '@uiw/react-overlay';
3-
import Icon, { IconProps } from '@uiw/react-icon';
3+
import Icon, { IconProps, IconTagType } from '@uiw/react-icon';
44
import Button from '@uiw/react-button';
55
import { HTMLDivProps } from '@uiw/utils';
66
import './style/index.less';
77

88
export interface DrawerProps extends OverlayProps {
99
footer?: React.ReactNode;
10-
icon?: IconProps['type'];
10+
icon?: IconProps<IconTagType>['type'];
1111
title?: React.ReactNode;
1212
bodyProps?: HTMLDivProps;
1313
placement?: 'top' | 'right' | 'bottom' | 'left';

Diff for: ‎packages/react-file-input/src/List.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from 'react';
1+
import React, { HTMLAttributes } from 'react';
22
import Icon from '@uiw/react-icon';
33
import { FileInputListProps } from './';
44
import './style/index.less';
@@ -34,7 +34,7 @@ const Picture = (props: FileInputListProps) => {
3434
React.isValidElement(children) &&
3535
React.cloneElement(children, {
3636
onClick: onAdd,
37-
})}
37+
} as HTMLAttributes<HTMLElement>)}
3838
<div>
3939
{dataList.map((item, index) => (
4040
<div className={`${prefixCls}-${uploadType}`} key={index}>

Diff for: ‎packages/react-message/src/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import React from 'react';
22
import { CSSTransition } from 'react-transition-group';
3-
import Icon, { IconProps } from '@uiw/react-icon';
3+
import Icon, { IconProps, IconTagType } from '@uiw/react-icon';
44
import Button from '@uiw/react-button';
55
import './style/index.less';
66
import { IProps, HTMLDivProps } from '@uiw/utils';
77

88
export interface MessageProps extends IProps, Omit<HTMLDivProps, 'title'> {
99
title?: React.ReactNode;
10-
icon?: IconProps['type'];
10+
icon?: IconProps<IconTagType>['type'];
1111
type?: 'success' | 'warning' | 'info' | 'error';
1212
description?: React.ReactNode;
1313
showIcon?: boolean;

Diff for: ‎packages/react-modal/src/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { useState, useEffect } from 'react';
22
import Overlay, { OverlayProps } from '@uiw/react-overlay';
33
import Button, { ButtonType, ButtonProps } from '@uiw/react-button';
4-
import Icon, { IconProps } from '@uiw/react-icon';
4+
import Icon, { IconProps, IconTagType } from '@uiw/react-icon';
55
import { IProps, noop } from '@uiw/utils';
66
import './style/index.less';
77
import CallShow from './CallShow';
@@ -14,7 +14,7 @@ export interface ModalProps extends IProps, OverlayProps {
1414
content?: React.ReactNode;
1515
confirmText?: string;
1616
title?: string;
17-
icon?: IconProps['type'];
17+
icon?: IconProps<IconTagType>['type'];
1818
useButton?: boolean;
1919
usePortal?: boolean;
2020
autoFocus?: boolean;

Diff for: ‎packages/react-progress/src/Circle.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import './style/circle.less';
77

88
export type Status = 'success' | 'active' | 'exception';
99

10-
type TagType = React.ComponentType | keyof JSX.IntrinsicElements;
11-
export interface ProgressCircleProps<T extends TagType = 'span'> extends IProps, HTMLDivProps {
10+
export type ProgressCircleTagType = React.ComponentType | keyof JSX.IntrinsicElements;
11+
export interface ProgressCircleProps<T extends ProgressCircleTagType = 'span'> extends IProps, HTMLDivProps {
1212
type?: IconProps<T>['type'];
1313
status?: Status;
1414
showText?: boolean; // 是否显示进度条文字内容
@@ -18,7 +18,7 @@ export interface ProgressCircleProps<T extends TagType = 'span'> extends IProps,
1818
format?: (percent: number) => React.ReactNode;
1919
}
2020

21-
export default class Circle<T extends TagType = 'span'> extends React.Component<ProgressCircleProps<T>> {
21+
export default class Circle<T extends ProgressCircleTagType = 'span'> extends React.Component<ProgressCircleProps<T>> {
2222
public static defaultProps: ProgressCircleProps<'span'> = {
2323
prefixCls: 'w-progress',
2424
showText: true,

Diff for: ‎packages/react-progress/src/Line.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import React from 'react';
22
import { IconProgress } from './utils';
3-
import { ProgressCircleProps } from './Circle';
3+
import { ProgressCircleProps, ProgressCircleTagType } from './Circle';
44
import './style/index.less';
55
import './style/line.less';
66

7-
export interface ProgressLineProp<T> extends ProgressCircleProps<T> {}
7+
export interface ProgressLineProp<T extends ProgressCircleTagType = 'span'> extends ProgressCircleProps<T> {}
88

9-
export default class Line<T> extends React.Component<ProgressLineProp<T>> {
10-
public static defaultProps: ProgressLineProp<{}> = {
9+
export default class Line<T extends ProgressCircleTagType = 'span'> extends React.Component<ProgressLineProp<T>> {
10+
public static defaultProps: ProgressLineProp<ProgressCircleTagType> = {
1111
prefixCls: 'w-progress',
1212
showText: true, // 是否显示进度条文字内容
1313
percent: 0, // 百分比(必填)

0 commit comments

Comments
 (0)
Please sign in to comment.