Skip to content

Commit

Permalink
Merge pull request #1563 from XiaoMi/hotfix/#1558
Browse files Browse the repository at this point in the history
fix: d.ts #1558
  • Loading branch information
GleanCoder1116 authored Jan 29, 2021
2 parents 32ffd8b + 16122cd commit 2febbe2
Show file tree
Hide file tree
Showing 34 changed files with 83 additions and 8 deletions.
14 changes: 7 additions & 7 deletions components/button/ButtonGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ class ButtonGroup extends Component {
prefixCls: 'hi-btn-group'
}

render () {
const {
prefixCls,
style,
className
} = this.props
render() {
const { prefixCls, style, className } = this.props
const classes = classNames(`${prefixCls}`, className)
return <div className={classes} style={style}>{this.props.children}</div>
return (
<div className={classes} style={style}>
{this.props.children}
</div>
)
}
}

Expand Down
11 changes: 10 additions & 1 deletion components/button/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,14 @@ interface ButtonProps {
icon?: string
onClick?: () => void
}
declare const Button: React.ComponentType<Props>
interface ButtonGroupProps {
className?: string
style?: object
prefixCls?: string
}
declare class ButtonGroup extends React.Component<ButtonGroupProps, any> {
}
declare class Button extends React.Component<ButtonProps, any> {
static Group = ButtonGroup
}
export default Button
2 changes: 2 additions & 0 deletions components/card/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ interface Props {
extraType?: 'default' | 'hover'
coverUrl?: string
content?: string | JSX.Element
style?: CSSProperties
className?: string
}
declare class Card extends React.Component<Props, any> {
}
Expand Down
2 changes: 2 additions & 0 deletions components/carousel/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ interface Props {
defaultActive?: number
showPages?: boolean
children: JSX.Element[]
style?: CSSProperties
className?: string
}
declare const Carousel: React.ComponentType<Props>
export default Carousel
2 changes: 2 additions & 0 deletions components/cascader/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ interface Props {
style?: object
onChange?: (value: string[] | number[]) => void
overlayClassName?: string
style?: CSSProperties
className?: string
}
declare const Card: React.ComponentType<Props>
export default Card
2 changes: 2 additions & 0 deletions components/collapse/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ interface Props {
showArrow?: boolean
onChange?: () => void
children: Collapse.Panel
style?: CSSProperties
className?: string
}
interface PanelProps {
id?: string
Expand Down
2 changes: 2 additions & 0 deletions components/date-picker/TimePicker.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ interface TimeProps extends CommonProps {
disabledHours?: () => number[]
disabledMinutes?: (selectedHour: number) => number[]
disabledSeconds?: (selectedHour: number, selectedMinute: number) => number[]
style?: CSSProperties
className?: string
}
declare const TimePicker: React.ComponentType<TimeProps>
export default TimePicker
2 changes: 2 additions & 0 deletions components/date-picker/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ interface DateProps extends CommonProps {
dateMarkRender?: (currentDate: Date, today: Date) => JSX.Element
dateMarkPreset?: 'zh-CN'
overlayClassName?: string
style?: CSSProperties
className?: string
}

declare const DatePicker: React.ComponentType<DateProps>
Expand Down
2 changes: 2 additions & 0 deletions components/drawer/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ interface Props {
footer?: JSX.Element
placement?: 'left' | 'right'
onClose?: (e: MouseEvent) => void
style?: CSSProperties
className?: string
}
declare const Drawer: React.ComponentType<Props>
export default Drawer
2 changes: 2 additions & 0 deletions components/form/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ interface FormProps {
placement?: 'horizontal' | 'vertical'
showColon?: boolean
children: Form.Item
style?: CSSProperties
className?: string
}

interface ItemProps {
Expand Down
1 change: 1 addition & 0 deletions components/input/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ interface Props {
clearable?: boolean
placeholder?: string
style?: CSSProperties
className?: string
bordered?: boolean
ref?: string | ((instance: HTMLInputElement | null) => void) | React.RefObject<HTMLInputElement> | null | undefined
onFocus?: (e: React.FocusEvent<HTMLInputElement>) => void
Expand Down
4 changes: 4 additions & 0 deletions components/list/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ type DataItem = {
description?: string | JSX.Element
extra?: string | string[]
avatar?: string
style?: CSSProperties
className?: string
}
interface Props {
type?: 'default' | 'card'
Expand All @@ -18,6 +20,8 @@ interface Props {
hoverable?: boolean
layout?: 'vertical' | 'horizontal'
emptyText?: string | JSX.Element
style?: CSSProperties
className?: string
}
declare const List: React.ComponentType<Props>
export default List
2 changes: 2 additions & 0 deletions components/loading/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ interface Props {
content?: string | JSX.Element
visible?: boolean
full?: boolean
style?: CSSProperties
className?: string
}

type Options = {
Expand Down
2 changes: 2 additions & 0 deletions components/menu/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ interface Props {
showCollapse?: boolean
showAllSubMenus?: boolean
accordion?: boolean
style?: CSSProperties
className?: string
onClick?: (activeId: string | number, prevActiveId: string | number) => void
onClickSubMenu?: (subMenuIndexs: number) => void
onCollapse?: (collapsed: boolean) => void
Expand Down
2 changes: 2 additions & 0 deletions components/message/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ type Options = {
type?: 'info' | 'success' | 'error' | 'warning'
title: string
duration?: number
style?: CSSProperties
className?: string
}
const OpenFun: (options: Options) => void
declare class Message extends React.Component<Props, any> {
Expand Down
2 changes: 2 additions & 0 deletions components/modal/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ interface Props {
footer?: JSX.Element | null
onCancel?: (e: MouseEvent) => void
onConfirm?: (e: MouseEvent) => void
style?: CSSProperties
className?: string
}
declare const Modal: React.ComponentType<Props>
export default Modal
2 changes: 2 additions & 0 deletions components/notification/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ interface Options {
closeable?: boolean
duration?: number
confirmText?: string
style?: CSSProperties
className?: string
onClose?: (e: MouseEvent) => void
onConfirm?: () => void
}
Expand Down
2 changes: 2 additions & 0 deletions components/pagination/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ export interface PaginationProps {
pageSizeOptions?: number[]
autoHide?: boolean
showJumper?: boolean
style?: CSSProperties
className?: string
onJump?: (current: number) => void
onChange?: (currentPage: number, prevPage: number, pageSize: number) => void
onPageSizeChange?: (changeSize: number, currentPage: number) => void
Expand Down
2 changes: 2 additions & 0 deletions components/popover/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ interface Props {
placement?: 'top' | 'right' | 'bottom' | 'left'
trigger?: 'click' | 'focus' | 'hover'
visible?: boolean
style?: CSSProperties
className?: string
}
declare const Popover: React.ComponentType<Props>
export default Popover
2 changes: 2 additions & 0 deletions components/preview/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ interface Props {
images?: string[] | object[]
simpleData?: boolean
activeIndex?: number
style?: CSSProperties
className?: string
}
declare const Preview: React.ComponentType<Props>
export default Preview
2 changes: 2 additions & 0 deletions components/progress/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ interface Props {
placement?: 'inside' | 'outside'
width?: string | number
height?: string | number
style?: CSSProperties
className?: string
}
declare const Progress: React.ComponentType<Props>
export default Progress
2 changes: 2 additions & 0 deletions components/radio/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ interface Props {
autoFocus?: boolean
checked?: boolean
disabled?: boolean
style?: CSSProperties
className?: string
onChange?: (event: ChangeEvent<HTMLInputElement>) => void
}
interface GroupProps {
Expand Down
2 changes: 2 additions & 0 deletions components/rate/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ interface Props {
color?: string
characterRender?: (value: number, index: number) => JSX.Element
onChange?: (value: number) => void
style?: CSSProperties
className?: string
}
declare const Rate: React.ComponentType<Props>
export default Rate
2 changes: 2 additions & 0 deletions components/search/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ interface Props {
onSearch?: (inputVal: string, item?: DataItem) => void
onChange?: (e: string) => void
overlayClassName?: string
style?: CSSProperties
className?: string
}
declare const Search: React.ComponentType<Props>
export default Search
1 change: 1 addition & 0 deletions components/select-tree/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ interface Props {
valueRender?: (item: DataItem) => JSX.Element
style?: CSSProperties
value?: DataItem[] | string[] | number[] | string
className?: string
}
declare const SelectTree: React.ComponentType<Props>
export default SelectTree
2 changes: 2 additions & 0 deletions components/select/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ interface Props {
style?: CSSProperties
optionWidth?: number
bordered?: boolean
style?: CSSProperties
className?: string
onChange?: (selectedIds: string[], changedItem: DataItem) => void
onSearch?: (keyword: string) => void
onOverlayScroll?: (e: Event<HTMLDivElement>) => void
Expand Down
2 changes: 2 additions & 0 deletions components/slider/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ interface Props {
value?: number
min?: number
max?: number
style?: CSSProperties
className?: string
disabled?: boolean
tipFormatter?: (value: number) => JSX.Element
marks?: {
Expand Down
2 changes: 2 additions & 0 deletions components/switch/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ interface Props {
checked?: boolean
defaultChecked?: boolean
disabled?: boolean
style?: CSSProperties
className?: string
onChange?: (checked: boolean) => void
}
declare const Switch: React.ComponentType<Props>
Expand Down
2 changes: 2 additions & 0 deletions components/table/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ interface Props {
emptyContent?: string | JSX.Element
columns: ColumnItem[]
data: object[]
style?: CSSProperties
className?: string
}
declare const Table: React.ComponentType<Props>
export default Table
4 changes: 4 additions & 0 deletions components/tabs/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ interface Props {
max?: number
canScroll?: boolean
draggable?: boolean
style?: CSSProperties
className?: string
onTabClick?: (tabKey: string | number, event: MouseEvent) => void
onEdit?: (action: 'add' | 'delete', index: number, tabKey: string | number) => void
onDragStart?: (dragNode: NodeData) => void
Expand All @@ -38,6 +40,8 @@ interface PaneProps {
closeable?: boolean
disabled?: boolean
animation?: boolean
style?: CSSProperties
className?: string
}
declare class Pane extends React.Component<PaneProps, any> {
}
Expand Down
2 changes: 2 additions & 0 deletions components/tag/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
interface Props {
type?: 'primary' | 'success' | 'warning' | 'danger'
style?: CSSProperties
className?: string
appearance?: 'default' | 'line'
onClick?: (e: MouseEvent) => void
}
Expand Down
2 changes: 2 additions & 0 deletions components/tree/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ interface Props {
openIcon?: string
closeIcon?: string
apperance?: 'default' | 'line' | 'folder'
style?: CSSProperties
className?: string
contextMenu?: ContextMenuOption[] | ContextMenuOptionFun
onChange?: (data: TreeNode[]) => void
onExpand?: (expanded: boolean, expandIds: string[], expandedNode: TreeNode) => void
Expand Down
2 changes: 2 additions & 0 deletions components/upload/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ interface Props {
defaultFileList?: FileItem[]
fileList?: FileItem[]
loading?: boolean
style?: CSSProperties
className?: string
beforeUpload?: (files: FileItem[], fileList: FileItem[]) => boolean
customUpload?: (files: FileItem[]) => void
onChange?: (file: FileItem, fileList: FileItem[], response: object) => boolean
Expand Down
2 changes: 2 additions & 0 deletions components/watermark/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ interface Props {
content?: strgin | string[]
logo?: any
opacity?: number
style?: CSSProperties
className?: string
}
declare const Watermark: React.ComponentType<Props>
export default Watermark

0 comments on commit 2febbe2

Please sign in to comment.