Skip to content

Commit

Permalink
type: fix IconTagType issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Sep 19, 2023
1 parent d31ca18 commit 7a63a65
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions packages/react-drawer/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import React, { useMemo } from 'react';
import Overlay, { OverlayProps } from '@uiw/react-overlay';
import Icon, { IconProps } from '@uiw/react-icon';
import Icon, { IconProps, IconTagType } from '@uiw/react-icon';
import Button from '@uiw/react-button';
import { HTMLDivProps } from '@uiw/utils';
import './style/index.less';

export interface DrawerProps extends OverlayProps {
footer?: React.ReactNode;
icon?: IconProps['type'];
icon?: IconProps<IconTagType>['type'];
title?: React.ReactNode;
bodyProps?: HTMLDivProps;
placement?: 'top' | 'right' | 'bottom' | 'left';
Expand Down
4 changes: 2 additions & 2 deletions packages/react-file-input/src/List.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import React, { HTMLAttributes } from 'react';
import Icon from '@uiw/react-icon';
import { FileInputListProps } from './';
import './style/index.less';
Expand Down Expand Up @@ -34,7 +34,7 @@ const Picture = (props: FileInputListProps) => {
React.isValidElement(children) &&
React.cloneElement(children, {
onClick: onAdd,
})}
} as HTMLAttributes<HTMLElement>)}
<div>
{dataList.map((item, index) => (
<div className={`${prefixCls}-${uploadType}`} key={index}>
Expand Down
4 changes: 2 additions & 2 deletions packages/react-message/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import React from 'react';
import { CSSTransition } from 'react-transition-group';
import Icon, { IconProps } from '@uiw/react-icon';
import Icon, { IconProps, IconTagType } from '@uiw/react-icon';
import Button from '@uiw/react-button';
import './style/index.less';
import { IProps, HTMLDivProps } from '@uiw/utils';

export interface MessageProps extends IProps, Omit<HTMLDivProps, 'title'> {
title?: React.ReactNode;
icon?: IconProps['type'];
icon?: IconProps<IconTagType>['type'];
type?: 'success' | 'warning' | 'info' | 'error';
description?: React.ReactNode;
showIcon?: boolean;
Expand Down
4 changes: 2 additions & 2 deletions packages/react-modal/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useState, useEffect } from 'react';
import Overlay, { OverlayProps } from '@uiw/react-overlay';
import Button, { ButtonType, ButtonProps } from '@uiw/react-button';
import Icon, { IconProps } from '@uiw/react-icon';
import Icon, { IconProps, IconTagType } from '@uiw/react-icon';
import { IProps, noop } from '@uiw/utils';
import './style/index.less';
import CallShow from './CallShow';
Expand All @@ -14,7 +14,7 @@ export interface ModalProps extends IProps, OverlayProps {
content?: React.ReactNode;
confirmText?: string;
title?: string;
icon?: IconProps['type'];
icon?: IconProps<IconTagType>['type'];
useButton?: boolean;
usePortal?: boolean;
autoFocus?: boolean;
Expand Down
6 changes: 3 additions & 3 deletions packages/react-progress/src/Circle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import './style/circle.less';

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

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

export default class Circle<T extends TagType = 'span'> extends React.Component<ProgressCircleProps<T>> {
export default class Circle<T extends ProgressCircleTagType = 'span'> extends React.Component<ProgressCircleProps<T>> {
public static defaultProps: ProgressCircleProps<'span'> = {
prefixCls: 'w-progress',
showText: true,
Expand Down
8 changes: 4 additions & 4 deletions packages/react-progress/src/Line.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import React from 'react';
import { IconProgress } from './utils';
import { ProgressCircleProps } from './Circle';
import { ProgressCircleProps, ProgressCircleTagType } from './Circle';
import './style/index.less';
import './style/line.less';

export interface ProgressLineProp<T> extends ProgressCircleProps<T> {}
export interface ProgressLineProp<T extends ProgressCircleTagType = 'span'> extends ProgressCircleProps<T> {}

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

0 comments on commit 7a63a65

Please sign in to comment.