Browse Source
* Trend * TopNavHeader * TagSelect * SiderMenu * SettingDrawer * StandardTable * StandardFormRow * SelectLang * Reault * PageHeaderWrapper * PageHeaderWrapper * PageHeader * NumberInfo * NoticeIcon * Login * code style * GlobalHeader Footer * Exception * Ellipsis * EditableLinkGroup * EditableItem * DescriptionList * AvticleList * Update src/components/AvatarList/AvatarItem.d.ts Co-Authored-By: xiaohuoni <xiaohuoni@users.noreply.github.com> * Update src/components/Login/index.d.ts Co-Authored-By: xiaohuoni <xiaohuoni@users.noreply.github.com> * remove '* as' * Update src/components/AvatarList/index.d.ts Co-Authored-By: xiaohuoni <xiaohuoni@users.noreply.github.com> * TagSelect * SiderTheme CollapseType MenuMode * Loginpull/3827/head
committed by
陈帅
54 changed files with 429 additions and 118 deletions
@ -0,0 +1,13 @@ |
|||
import React from 'react'; |
|||
|
|||
export interface ApplicationsProps { |
|||
data: { |
|||
content?: string; |
|||
updatedAt?: any; |
|||
avatar?: string; |
|||
owner?: string; |
|||
href?: string; |
|||
}; |
|||
} |
|||
|
|||
export default class ArticleListContent extends React.Component<ApplicationsProps, any> {} |
|||
@ -1,10 +1,15 @@ |
|||
import * as React from 'react'; |
|||
export interface IAvatarItemProps { |
|||
import React from 'react'; |
|||
|
|||
export declare type SizeType = number | 'small' | 'default' | 'large'; |
|||
|
|||
export interface AvatarItemProps { |
|||
tips: React.ReactNode; |
|||
src: string; |
|||
size?: SizeType; |
|||
style?: React.CSSProperties; |
|||
onClick?: () => void; |
|||
} |
|||
|
|||
export default class AvatarItem extends React.Component<IAvatarItemProps, any> { |
|||
constructor(props: IAvatarItemProps); |
|||
export default class AvatarItem extends React.Component<AvatarItemProps, any> { |
|||
constructor(props: AvatarItemProps); |
|||
} |
|||
|
|||
@ -1,14 +1,14 @@ |
|||
import * as React from 'react'; |
|||
import AvatarItem from './AvatarItem'; |
|||
import React from 'react'; |
|||
import AvatarItem, { AvatarItemProps, SizeType } from './AvatarItem'; |
|||
|
|||
export interface IAvatarListProps { |
|||
size?: 'large' | 'small' | 'mini' | 'default'; |
|||
export interface AvatarListProps { |
|||
Item?: React.ReactElement<AvatarItemProps>; |
|||
size?: SizeType; |
|||
maxLength?: number; |
|||
excessItemsStyle?: React.CSSProperties; |
|||
style?: React.CSSProperties; |
|||
children: React.ReactElement<AvatarItem> | Array<React.ReactElement<AvatarItem>>; |
|||
children: React.ReactElement<AvatarItemProps> | Array<React.ReactElement<AvatarItemProps>>; |
|||
} |
|||
|
|||
export default class AvatarList extends React.Component<IAvatarListProps, any> { |
|||
export default class AvatarList extends React.Component<AvatarListProps, any> { |
|||
public static Item: typeof AvatarItem; |
|||
} |
|||
|
|||
@ -1,9 +1,11 @@ |
|||
import * as React from 'react'; |
|||
import React from 'react'; |
|||
import { ColProps } from 'antd/es/col'; |
|||
|
|||
export default class Description extends React.Component< |
|||
{ |
|||
term: React.ReactNode; |
|||
style?: React.CSSProperties; |
|||
}, |
|||
any |
|||
> {} |
|||
export interface DescriptionProps extends ColProps { |
|||
column?: number; |
|||
key?: string | number; |
|||
style?: React.CSSProperties; |
|||
term?: React.ReactNode; |
|||
} |
|||
|
|||
export default class Description extends React.Component<DescriptionProps, any> {} |
|||
|
|||
@ -1,15 +1,17 @@ |
|||
import * as React from 'react'; |
|||
import Description from './Description'; |
|||
import React from 'react'; |
|||
import Description, { DescriptionProps } from './Description'; |
|||
|
|||
export interface IDescriptionListProps { |
|||
layout?: 'horizontal' | 'vertical'; |
|||
export interface DescriptionListProps { |
|||
className?: string; |
|||
col?: number; |
|||
title: React.ReactNode; |
|||
description?: DescriptionProps[]; |
|||
gutter?: number; |
|||
layout?: 'horizontal' | 'vertical'; |
|||
size?: 'large' | 'small'; |
|||
style?: React.CSSProperties; |
|||
title?: React.ReactNode; |
|||
} |
|||
|
|||
export default class DescriptionList extends React.Component<IDescriptionListProps, any> { |
|||
export default class DescriptionList extends React.Component<DescriptionListProps, any> { |
|||
public static Description: typeof Description; |
|||
} |
|||
|
|||
@ -0,0 +1,7 @@ |
|||
import React from 'react'; |
|||
|
|||
export interface EditableItemProps { |
|||
onChange?: (value?: string | string[] | number) => void; |
|||
} |
|||
|
|||
export default class EditableItem extends React.Component<EditableItemProps, any> {} |
|||
@ -0,0 +1,9 @@ |
|||
import React from 'react'; |
|||
|
|||
export interface EditableLinkGroupProps { |
|||
links: any[]; |
|||
onAdd: () => void; |
|||
linkElement: string; |
|||
} |
|||
|
|||
export default class EditableLinkGroup extends React.Component<EditableLinkGroupProps, any> {} |
|||
@ -1,15 +1,23 @@ |
|||
import * as React from 'react'; |
|||
export interface IExceptionProps { |
|||
import React from 'react'; |
|||
import * as H from 'history'; |
|||
|
|||
export interface ExceptionProps< |
|||
L = { |
|||
to: H.LocationDescriptor; |
|||
href?: H.LocationDescriptor; |
|||
replace?: boolean; |
|||
innerRef?: (node: HTMLAnchorElement | null) => void; |
|||
} |
|||
> { |
|||
type?: '403' | '404' | '500'; |
|||
title?: React.ReactNode; |
|||
desc?: React.ReactNode; |
|||
img?: string; |
|||
actions?: React.ReactNode; |
|||
linkElement?: string | React.ComponentType; |
|||
linkElement?: string | React.ComponentType<L>; |
|||
style?: React.CSSProperties; |
|||
className?: string; |
|||
backText?: React.ReactNode; |
|||
redirect?: string; |
|||
} |
|||
|
|||
export default class Exception extends React.Component<IExceptionProps, any> {} |
|||
export default class Exception extends React.Component<ExceptionProps, any> {} |
|||
|
|||
@ -1,7 +1,8 @@ |
|||
import * as React from 'react'; |
|||
export interface IFooterToolbarProps { |
|||
import React from 'react'; |
|||
export interface FooterToolbarProps { |
|||
extra: React.ReactNode; |
|||
style?: React.CSSProperties; |
|||
className?: string; |
|||
} |
|||
|
|||
export default class FooterToolbar extends React.Component<IFooterToolbarProps, any> {} |
|||
export default class FooterToolbar extends React.Component<FooterToolbarProps, any> {} |
|||
|
|||
@ -0,0 +1,26 @@ |
|||
import React from 'react'; |
|||
import { DropDownProps } from 'antd/lib/dropdown'; |
|||
import { ClickParam } from 'antd/es/menu'; |
|||
import { SiderTheme } from 'antd/es/Layout/Sider'; |
|||
|
|||
export interface GlobalHeaderRightProps { |
|||
notices?: any[]; |
|||
dispatch?: (args: any) => void; |
|||
currentUser?: { |
|||
avatar?: string; |
|||
name?: string; |
|||
title?: string; |
|||
group?: string; |
|||
signature?: string; |
|||
geographic?: any; |
|||
tags?: any[]; |
|||
unreadCount: number; |
|||
}; |
|||
fetchingNotices?: boolean; |
|||
onNoticeVisibleChange?: (visible: boolean) => void; |
|||
onMenuClick?: (param: ClickParam) => void; |
|||
onNoticeClear?: (tabName: string) => void; |
|||
theme?: SiderTheme; |
|||
} |
|||
|
|||
export default class GlobalHeaderRight extends React.Component<GlobalHeaderRightProps, any> {} |
|||
@ -0,0 +1,13 @@ |
|||
import React from 'react'; |
|||
|
|||
export interface GlobalHeaderProps { |
|||
collapsed?: boolean; |
|||
onCollapse?: (collapsed: boolean) => void; |
|||
isMobile?: boolean; |
|||
logo?: string; |
|||
onNoticeClear?: (type: string) => void; |
|||
onMenuClick?: ({ key: string }) => void; |
|||
onNoticeVisibleChange?: (b: boolean) => void; |
|||
} |
|||
|
|||
export default class GlobalHeader extends React.Component<GlobalHeaderProps, any> {} |
|||
@ -1,8 +1,12 @@ |
|||
import * as React from 'react'; |
|||
import React from 'react'; |
|||
import { DropDownProps } from 'antd/lib/dropdown'; |
|||
|
|||
export interface IHeaderDropdownProps extends DropDownProps { |
|||
declare type OverlayFunc = () => React.ReactNode; |
|||
|
|||
export interface HeaderDropdownProps extends DropDownProps { |
|||
overlayClassName?: string; |
|||
overlay: React.ReactNode | OverlayFunc; |
|||
placement?: 'bottomLeft' | 'bottomRight' | 'topLeft' | 'topCenter' | 'topRight' | 'bottomCenter'; |
|||
} |
|||
|
|||
export default class HeaderDropdown extends React.Component<IHeaderDropdownProps, any> {} |
|||
export default class HeaderDropdown extends React.Component<HeaderDropdownProps, any> {} |
|||
|
|||
@ -1,11 +1,28 @@ |
|||
import * as React from 'react'; |
|||
export interface ILoginItemProps { |
|||
import React from 'react'; |
|||
import { WrappedFormUtils } from 'antd/es/form/Form'; |
|||
import ItemMap from './map'; |
|||
import { Omit } from 'antd/es/_util/type'; |
|||
|
|||
export type WrappedLoginItemProps = Omit<LoginItemProps, 'form' | 'type' | 'updateActive'>; |
|||
export type LoginItemType = { [K in keyof typeof ItemMap]: React.FC<WrappedLoginItemProps> }; |
|||
|
|||
export interface LoginItemProps { |
|||
name?: string; |
|||
rules?: any[]; |
|||
style?: React.CSSProperties; |
|||
onGetCaptcha?: () => void; |
|||
onGetCaptcha?: (event?: MouseEvent) => void; |
|||
placeholder?: string; |
|||
buttonText?: React.ReactNode; |
|||
onPressEnter?: (e: any) => void; |
|||
countDown?: number; |
|||
getCaptchaButtonText?: string; |
|||
getCaptchaSecondText?: string; |
|||
updateActive: (activeItem: any) => void; |
|||
form: WrappedFormUtils; |
|||
type: string; |
|||
defaultValue?: string; |
|||
customprops?: any; |
|||
onChange?: (e: any) => void; |
|||
} |
|||
|
|||
export default class LoginItem extends React.Component<ILoginItemProps, any> {} |
|||
export default class LoginItem extends React.Component<LoginItemProps, any> {} |
|||
|
|||
@ -1,7 +1,11 @@ |
|||
import * as React from 'react'; |
|||
import React from 'react'; |
|||
|
|||
export interface ILoginTabProps { |
|||
export interface LoginTabProps { |
|||
key?: string; |
|||
tab?: React.ReactNode; |
|||
tabUtil: { |
|||
addTab: (id: any) => void; |
|||
removeTab: (id: any) => void; |
|||
}; |
|||
} |
|||
export default class LoginTab extends React.Component<ILoginTabProps, any> {} |
|||
export default class LoginTab extends React.Component<LoginTabProps, any> {} |
|||
|
|||
@ -1,20 +1,25 @@ |
|||
import Button from 'antd/lib/button'; |
|||
import * as React from 'react'; |
|||
import LoginItem from './LoginItem'; |
|||
import React from 'react'; |
|||
import LoginItem, { LoginItemProps, LoginItemType } from './LoginItem'; |
|||
import LoginTab from './LoginTab'; |
|||
import { WrappedFormUtils } from 'antd/es/form/Form'; |
|||
import LoginSubmit from './LoginSubmit'; |
|||
|
|||
export interface ILoginProps { |
|||
export interface LoginProps { |
|||
defaultActiveKey?: string; |
|||
onTabChange?: (key: string) => void; |
|||
style?: React.CSSProperties; |
|||
onSubmit?: (error: any, values: any) => void; |
|||
className?: string; |
|||
} |
|||
|
|||
export default class Login extends React.Component<ILoginProps, any> { |
|||
interface Login extends WrappedFormUtils {} |
|||
declare class Login extends React.Component<LoginProps, any> { |
|||
public static Tab: typeof LoginTab; |
|||
public static UserName: typeof LoginItem; |
|||
public static Password: typeof LoginItem; |
|||
public static Mobile: typeof LoginItem; |
|||
public static Captcha: typeof LoginItem; |
|||
public static Submit: typeof Button; |
|||
public static UserName: React.FC<LoginItemProps>; |
|||
public static Password: React.FC<LoginItemProps>; |
|||
public static Mobile: React.FC<LoginItemProps>; |
|||
public static Captcha: React.FC<LoginItemProps>; |
|||
public static Submit: typeof LoginSubmit; |
|||
} |
|||
export default Login; |
|||
|
|||
@ -1,6 +1,6 @@ |
|||
import * as React from 'react'; |
|||
import { IPageHeaderProps } from './index'; |
|||
import React from 'react'; |
|||
import { PageHeaderProps } from './index'; |
|||
|
|||
export default class BreadcrumbView extends React.Component<IPageHeaderProps, any> {} |
|||
export default class BreadcrumbView extends React.Component<PageHeaderProps, any> {} |
|||
|
|||
export function getBreadcrumb(breadcrumbNameMap: object, url: string): object; |
|||
|
|||
@ -1,28 +1,31 @@ |
|||
/// <reference types="history" />
|
|||
import * as React from 'react'; |
|||
import React from 'react'; |
|||
import { Location } from 'history'; |
|||
export interface IPageHeaderProps { |
|||
title?: React.ReactNode | string; |
|||
|
|||
export interface PageHeaderProps { |
|||
title?: React.ReactNode | string | number; |
|||
logo?: React.ReactNode | string; |
|||
action?: React.ReactNode | string; |
|||
content?: React.ReactNode; |
|||
extraContent?: React.ReactNode; |
|||
routes?: any[]; |
|||
params?: any; |
|||
breadcrumbList?: Array<{ title: React.ReactNode; href?: string }>; |
|||
breadcrumbList?: Array<{ title: string | number; href?: string }>; |
|||
tabList?: Array<{ key: string; tab: React.ReactNode }>; |
|||
tabActiveKey?: string; |
|||
tabDefaultActiveKey?: string; |
|||
onTabChange?: (key: string) => void; |
|||
tabBarExtraContent?: React.ReactNode; |
|||
linkElement?: React.ReactNode; |
|||
linkElement?: React.ReactNode | string; |
|||
style?: React.CSSProperties; |
|||
home?: React.ReactNode; |
|||
wide?: boolean; |
|||
hiddenBreadcrumb?: boolean; |
|||
className?: string; |
|||
loading?: boolean; |
|||
breadcrumbSeparator?: React.ReactNode; |
|||
location?: Location; |
|||
itemRender: (menuItem: any) => React.ReactNode; |
|||
breadcrumbNameMap?: any; |
|||
} |
|||
|
|||
export default class PageHeader extends React.Component<IPageHeaderProps, any> {} |
|||
export default class PageHeader extends React.Component<PageHeaderProps, any> {} |
|||
|
|||
@ -0,0 +1,8 @@ |
|||
import React from 'react'; |
|||
|
|||
export interface GridContentProps { |
|||
contentWidth: string; |
|||
children: React.ReactNode; |
|||
} |
|||
|
|||
export default class GridContent extends React.Component<GridContentProps, any> {} |
|||
@ -0,0 +1,12 @@ |
|||
import React from 'react'; |
|||
export interface ResultProps { |
|||
actions?: React.ReactNode; |
|||
className?: string; |
|||
description?: React.ReactNode; |
|||
extra?: React.ReactNode; |
|||
style?: React.CSSProperties; |
|||
title?: React.ReactNode; |
|||
type: 'success' | 'error'; |
|||
} |
|||
|
|||
export default class Result extends React.Component<ResultProps, any> {} |
|||
@ -1,11 +1,12 @@ |
|||
import * as React from 'react'; |
|||
export interface IResultProps { |
|||
type: 'success' | 'error'; |
|||
title: React.ReactNode; |
|||
import React from 'react'; |
|||
export interface ResultProps { |
|||
actions?: React.ReactNode; |
|||
className?: string; |
|||
description?: React.ReactNode; |
|||
extra?: React.ReactNode; |
|||
actions?: React.ReactNode; |
|||
style?: React.CSSProperties; |
|||
title?: React.ReactNode; |
|||
type: 'success' | 'error'; |
|||
} |
|||
|
|||
export default class Result extends React.Component<IResultProps, any> {} |
|||
export default class Result extends React.Component<ResultProps, any> {} |
|||
|
|||
@ -0,0 +1,7 @@ |
|||
import React from 'react'; |
|||
|
|||
export interface SelectLangProps { |
|||
className?: string; |
|||
} |
|||
|
|||
export default class SelectLang extends React.Component<SelectLangProps, any> {} |
|||
@ -0,0 +1,9 @@ |
|||
import React from 'react'; |
|||
|
|||
export interface BlockChecboxProps { |
|||
value: string; |
|||
onChange: (key: string) => void; |
|||
list: any[]; |
|||
} |
|||
|
|||
export default class BlockChecbox extends React.Component<BlockChecboxProps, any> {} |
|||
@ -0,0 +1,10 @@ |
|||
import React from 'react'; |
|||
|
|||
export interface TagProps { |
|||
color: string; |
|||
check: boolean; |
|||
className?: string; |
|||
onClick?: () => void; |
|||
} |
|||
|
|||
export default class ThemeColor extends React.Component<TagProps, any> {} |
|||
@ -0,0 +1,24 @@ |
|||
import React from 'react'; |
|||
import { SiderTheme } from 'antd/es/Layout/Sider'; |
|||
|
|||
export interface SettingModelState { |
|||
navTheme: string | SiderTheme; |
|||
primaryColor: string; |
|||
layout: string; |
|||
contentWidth: string; |
|||
fixedHeader: boolean; |
|||
autoHideHeader: boolean; |
|||
fixSiderbar: boolean; |
|||
menu: { disableLocal: boolean }; |
|||
title: string; |
|||
pwa: boolean; |
|||
iconfontUrl: string; |
|||
colorWeak: boolean; |
|||
} |
|||
|
|||
export interface SettingDrawerProps { |
|||
setting?: SettingModelState; |
|||
dispatch?: (args: any) => void; |
|||
} |
|||
|
|||
export default class SettingDrawer extends React.Component<SettingDrawerProps, any> {} |
|||
@ -0,0 +1,23 @@ |
|||
import React from 'react'; |
|||
import * as H from 'history'; |
|||
import { SiderTheme, CollapseType } from 'antd/es/Layout/Sider'; |
|||
|
|||
import { MenuMode } from 'antd/es/menu'; |
|||
|
|||
export interface BaseMenuProps { |
|||
flatMenuKeys?: any[]; |
|||
location?: H.Location; |
|||
onCollapse?: (collapsed: boolean, type?: CollapseType) => void; |
|||
isMobile?: boolean; |
|||
openKeys?: any; |
|||
theme?: SiderTheme; |
|||
mode?: MenuMode; |
|||
className?: string; |
|||
collapsed?: boolean; |
|||
handleOpenChange?: (openKeys: any[]) => void; |
|||
menuData?: any[]; |
|||
style?: React.CSSProperties; |
|||
onOpenChange?: (openKeys: string[]) => void; |
|||
} |
|||
|
|||
export default class BaseMenu extends React.Component<BaseMenuProps, any> {} |
|||
@ -0,0 +1,11 @@ |
|||
import React from 'react'; |
|||
import * as H from 'history'; |
|||
import { BaseMenuProps } from './BaseMenu'; |
|||
import { SiderTheme } from 'antd/es/Layout/Sider'; |
|||
|
|||
export interface SiderMenuProps extends BaseMenuProps { |
|||
logo?: string; |
|||
fixSiderbar?: boolean; |
|||
} |
|||
|
|||
export default class SiderMenu extends React.Component<SiderMenuProps, any> {} |
|||
@ -0,0 +1,13 @@ |
|||
import React from 'react'; |
|||
import { SiderTheme } from 'antd/es/Layout/Sider'; |
|||
|
|||
export interface SiderMenuProps { |
|||
isMobile: boolean; |
|||
menuData: any[]; |
|||
collapsed: boolean; |
|||
logo?: string; |
|||
theme?: SiderTheme; |
|||
onCollapse: (payload: boolean) => void; |
|||
} |
|||
|
|||
export default class SiderMenuWrapper extends React.Component<SiderMenuProps, any> {} |
|||
@ -0,0 +1,11 @@ |
|||
import React from 'react'; |
|||
|
|||
export interface StandardFormRowProps { |
|||
title: string; |
|||
last?: boolean; |
|||
block?: boolean; |
|||
grid?: boolean; |
|||
style?: React.CSSProperties; |
|||
} |
|||
|
|||
export default class StandardFormRow extends React.Component<StandardFormRowProps, any> {} |
|||
@ -0,0 +1,19 @@ |
|||
import React from 'react'; |
|||
import { PaginationConfig, SorterResult, TableCurrentDataSource } from 'antd/lib/table'; |
|||
|
|||
export interface StandardTableProps { |
|||
columns: any; |
|||
onSelectRow: (row: any) => void; |
|||
data: any; |
|||
rowKey?: string; |
|||
selectedRows: any[]; |
|||
onChange?: ( |
|||
pagination: PaginationConfig, |
|||
filters: Record<keyof any, string[]>, |
|||
sorter: SorterResult<any>, |
|||
extra?: TableCurrentDataSource<any> |
|||
) => void; |
|||
loading?: boolean; |
|||
} |
|||
|
|||
export default class StandardTable extends React.Component<StandardTableProps, any> {} |
|||
@ -1,8 +1,12 @@ |
|||
import * as React from 'react'; |
|||
import React from 'react'; |
|||
|
|||
export interface ITagSelectOptionProps { |
|||
value: string | number; |
|||
export interface TagSelectOptionProps { |
|||
value?: string | number; |
|||
style?: React.CSSProperties; |
|||
checked?: boolean; |
|||
onChange?: (value: string | number, state: boolean) => void; |
|||
} |
|||
|
|||
export default class TagSelectOption extends React.Component<ITagSelectOptionProps, any> {} |
|||
export default class TagSelectOption extends React.Component<TagSelectOptionProps, any> { |
|||
public static isTagSelectOption?: boolean; |
|||
} |
|||
|
|||
@ -0,0 +1,25 @@ |
|||
import React from 'react'; |
|||
import { SiderTheme, CollapseType } from 'antd/es/Layout/Sider'; |
|||
import { MenuMode } from 'antd/es/menu'; |
|||
|
|||
export interface TopNavHeaderProps { |
|||
theme: SiderTheme; |
|||
contentWidth?: string; |
|||
menuData?: any[]; |
|||
logo?: string; |
|||
mode?: MenuMode; |
|||
flatMenuKeys?: any[]; |
|||
onCollapse?: (collapsed: boolean, type?: CollapseType) => void; |
|||
isMobile?: boolean; |
|||
openKeys?: any; |
|||
className?: string; |
|||
collapsed?: boolean; |
|||
handleOpenChange?: (openKeys: any[]) => void; |
|||
style?: React.CSSProperties; |
|||
onOpenChange?: (openKeys: string[]) => void; |
|||
onNoticeClear?: (type: string) => void; |
|||
onMenuClick?: ({ key: string }) => void; |
|||
onNoticeVisibleChange?: (b: boolean) => void; |
|||
} |
|||
|
|||
export default class TopNavHeader extends React.Component<TopNavHeaderProps, any> {} |
|||
@ -1,10 +1,11 @@ |
|||
import * as React from 'react'; |
|||
import React from 'react'; |
|||
|
|||
export interface ITrendProps { |
|||
colorful?: boolean; |
|||
flag: 'up' | 'down'; |
|||
style?: React.CSSProperties; |
|||
reverseColor?: boolean; |
|||
className?: string; |
|||
} |
|||
|
|||
export default class Trend extends React.Component<ITrendProps, any> {} |
|||
|
|||
Loading…
Reference in new issue