From 55e5d2057734a29b5f73a69b6e2a668e13a8a7eb Mon Sep 17 00:00:00 2001 From: jim chen Date: Tue, 28 Nov 2017 21:42:57 +0800 Subject: [PATCH] =?UTF-8?q?=20=E5=A2=9E=E5=8A=A0=E6=89=80=E6=9C=89?= =?UTF-8?q?=E5=89=A9=E4=BD=99=E5=AF=B9=E5=A4=96=E5=BC=80=E5=8F=91=E7=9A=84?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=20.d.ts=20=20=20=20=20(#312)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 增加AvatarList d.ts说明文件 * 修改 axis的链接 , g2修改了新的官网 * AvatarList 增加判断是否为必须属性 * 删除无用的空行. 优化格式 * 修改错误的图表文档. 增加几处漏写的文档 * 添加图表的 描述文件chart.d.ts * 改了个错别字! * 增加CountDown d.ts描述文件 * 增加 DescriptionList d.ts描述文件 * 增加所有剩余对外开发的组件 .d.ts 完善一些文档 * fontWeight 推荐使用 number 来表示数字 --- src/components/Exception/index.d.ts | 11 +++++++ src/components/FooterToolbar/index.d.ts | 9 ++++++ src/components/GlobalFooter/index.d.ts | 14 +++++++++ src/components/HeaderSearch/index.d.ts | 13 ++++++++ src/components/NoticeIcon/index.d.ts | 42 +++++++++++++++++++++++++ src/components/NoticeIcon/index.md | 2 +- src/components/NumberInfo/index.d.ts | 11 +++++++ src/components/NumberInfo/index.md | 2 +- src/components/PageHeader/index.d.ts | 16 ++++++++++ src/components/Result/demo/classic.md | 2 +- src/components/Result/demo/error.md | 2 +- src/components/Result/index.d.ts | 10 ++++++ src/components/TagSelect/index.d.ts | 20 ++++++++++++ src/components/TagSelect/index.md | 8 +++++ src/components/Trend/index.d.ts | 8 +++++ src/components/Trend/index.md | 2 +- 16 files changed, 167 insertions(+), 5 deletions(-) create mode 100644 src/components/Exception/index.d.ts create mode 100644 src/components/FooterToolbar/index.d.ts create mode 100644 src/components/GlobalFooter/index.d.ts create mode 100644 src/components/HeaderSearch/index.d.ts create mode 100644 src/components/NoticeIcon/index.d.ts create mode 100644 src/components/NumberInfo/index.d.ts create mode 100644 src/components/PageHeader/index.d.ts create mode 100644 src/components/Result/index.d.ts create mode 100644 src/components/TagSelect/index.d.ts create mode 100644 src/components/Trend/index.d.ts diff --git a/src/components/Exception/index.d.ts b/src/components/Exception/index.d.ts new file mode 100644 index 00000000..c966a00a --- /dev/null +++ b/src/components/Exception/index.d.ts @@ -0,0 +1,11 @@ +import React from "react"; +export interface ExceptionProps { + type?: "403" | "404" | "500"; + title?: React.ReactNode; + desc?: React.ReactNode; + img?: string; + actions?: React.ReactNode; + linkElement?: string | React.ReactNode; +} + +export default class Exception extends React.Component {} diff --git a/src/components/FooterToolbar/index.d.ts b/src/components/FooterToolbar/index.d.ts new file mode 100644 index 00000000..14f02755 --- /dev/null +++ b/src/components/FooterToolbar/index.d.ts @@ -0,0 +1,9 @@ +import React from "react"; +export interface FooterToolbarProps { + extra: React.ReactNode; +} + +export default class FooterToolbar extends React.Component< + FooterToolbarProps, + any +> {} diff --git a/src/components/GlobalFooter/index.d.ts b/src/components/GlobalFooter/index.d.ts new file mode 100644 index 00000000..7f6c7dd3 --- /dev/null +++ b/src/components/GlobalFooter/index.d.ts @@ -0,0 +1,14 @@ +import React from "react"; +export interface GlobalFooterProps { + links: Array<{ + title: string | React.ReactNode; + href: string; + blankTarget?: boolean; + }>; + copyright: React.ReactNode; +} + +export default class GlobalFooter extends React.Component< + GlobalFooterProps, + any +> {} diff --git a/src/components/HeaderSearch/index.d.ts b/src/components/HeaderSearch/index.d.ts new file mode 100644 index 00000000..69cff7af --- /dev/null +++ b/src/components/HeaderSearch/index.d.ts @@ -0,0 +1,13 @@ +import React from "react"; +export interface HeaderSearchProps { + placeholder?: string; + dataSource?: Array; + onSearch?: (value: string) => void; + onChange?: (value: string) => void; + onPressEnter?: (value: string) => void; +} + +export default class HeaderSearch extends React.Component< + HeaderSearchProps, + any +> {} diff --git a/src/components/NoticeIcon/index.d.ts b/src/components/NoticeIcon/index.d.ts new file mode 100644 index 00000000..6bf9dd56 --- /dev/null +++ b/src/components/NoticeIcon/index.d.ts @@ -0,0 +1,42 @@ +import React from "react"; +export interface NoticeIconData { + avatar: string; + title: React.ReactNode; + description: React.ReactNode; + datetime: React.ReactNode; + extra: React.ReactNode; +} + +export interface NoticeIconProps { + count?: number; + className?: string; + loading?: boolean; + onClear?: (tableTile: string) => void; + onItemClick?: (item: NoticeIconData, tabProps: NoticeIconProps) => void; + onTabChange?: (tableTile: string) => void; + popupAlign?: { + points?: [string, string]; + offset?: [number, number]; + targetOffset?: [number, number]; + overflow?: any; + useCssRight?: boolean; + useCssBottom?: boolean; + useCssTransform?: boolean; + }; + onPopupVisibleChange?: (visible: boolean) => void; + popupVisible?: boolean; + locale?: { emptyText: string; clear: string }; +} + +export interface NoticeIconTabProps { + list: Array; + title: string; + emptyText?: React.ReactNode; + emptyImage?: string; +} + +export class NoticeIconTab extends React.Component {} + +export default class NoticeIcon extends React.Component { + static Tab: typeof NoticeIconTab; +} diff --git a/src/components/NoticeIcon/index.md b/src/components/NoticeIcon/index.md index 3f0f8d99..fefdbdcf 100644 --- a/src/components/NoticeIcon/index.md +++ b/src/components/NoticeIcon/index.md @@ -28,7 +28,7 @@ locale | 默认文案 | Object | `{ emptyText: '暂无数据', clear: '清空' } 参数 | 说明 | 类型 | 默认值 ----|------|-----|------ title | 消息分类的页签标题 | string | - -data | 列表数据,格式参照下表 | Array | `[]` +list | 列表数据,格式参照下表 | Array | `[]` emptyText | 针对每个 Tab 定制空数据文案 | ReactNode | - emptyImage | 针对每个 Tab 定制空数据图片 | string | - diff --git a/src/components/NumberInfo/index.d.ts b/src/components/NumberInfo/index.d.ts new file mode 100644 index 00000000..c4c4c4f7 --- /dev/null +++ b/src/components/NumberInfo/index.d.ts @@ -0,0 +1,11 @@ +import React from "react"; +export interface NumberInfoProps { + title: React.ReactNode | string; + subTitle: React.ReactNode | string; + total: React.ReactNode | string; + status: "up" | "down"; + theme: string; + gap: number; +} + +export default class NumberInfo extends React.Component {} diff --git a/src/components/NumberInfo/index.md b/src/components/NumberInfo/index.md index a07ab4d9..8b29c295 100644 --- a/src/components/NumberInfo/index.md +++ b/src/components/NumberInfo/index.md @@ -16,6 +16,6 @@ order: 10 title | 标题 | ReactNode\|string | - subTitle | 子标题 | ReactNode\|string | - total | 总量 | ReactNode\|string | - -status | 增加状态 | 'up'\/'down' | - +status | 增加状态 | 'up \| down' | - theme | 状态样式 | string | 'light' gap | 设置数字和描述直接的间距(像素) | number | 8 diff --git a/src/components/PageHeader/index.d.ts b/src/components/PageHeader/index.d.ts new file mode 100644 index 00000000..b21fd160 --- /dev/null +++ b/src/components/PageHeader/index.d.ts @@ -0,0 +1,16 @@ +import React from "react"; +export interface PageHeaderProps { + title?: React.ReactNode | string; + logo?: React.ReactNode | string; + action?: React.ReactNode | string; + content?: React.ReactNode; + extraContent?: React.ReactNode; + routes?: Array; + params: any; + breadcrumbList?: Array<{ title: React.ReactNode; href?: string }>; + tabList?: Array<{ key: string; tab: React.ReactNode }>; + onTabChange?: (key: string) => void; + linkElement?: string | React.ReactNode; +} + +export default class PageHeader extends React.Component {} diff --git a/src/components/Result/demo/classic.md b/src/components/Result/demo/classic.md index 81e6a2eb..b4ccdcf1 100644 --- a/src/components/Result/demo/classic.md +++ b/src/components/Result/demo/classic.md @@ -33,7 +33,7 @@ const desc2 = ( const extra = (
-
+
项目名称
diff --git a/src/components/Result/demo/error.md b/src/components/Result/demo/error.md index f84720a7..836bd8cb 100644 --- a/src/components/Result/demo/error.md +++ b/src/components/Result/demo/error.md @@ -11,7 +11,7 @@ import { Button, Icon } from 'antd'; const extra = (
-
+
您提交的内容有如下错误:
diff --git a/src/components/Result/index.d.ts b/src/components/Result/index.d.ts new file mode 100644 index 00000000..6bd31717 --- /dev/null +++ b/src/components/Result/index.d.ts @@ -0,0 +1,10 @@ +import React from "react"; +export interface ResultProps { + type: "success" | "error"; + title: React.ReactNode; + description?: React.ReactNode; + extra?: React.ReactNode; + actions?: React.ReactNode; +} + +export default class Result extends React.Component {} diff --git a/src/components/TagSelect/index.d.ts b/src/components/TagSelect/index.d.ts new file mode 100644 index 00000000..02580942 --- /dev/null +++ b/src/components/TagSelect/index.d.ts @@ -0,0 +1,20 @@ +import React from "react"; +export interface TagSelectProps { + onChange?: (value: Array) => void; + expandable?: boolean; +} +export interface TagSelectOptionProps { + value: string; +} + +export class TagSelectOption extends React.Component< + TagSelectOptionProps, + any +> {} + +export default class TagSelect extends React.Component { + static Option: typeof TagSelectOption; + children: + | React.ReactElement + | Array>; +} diff --git a/src/components/TagSelect/index.md b/src/components/TagSelect/index.md index 396c144d..6b39e4f5 100644 --- a/src/components/TagSelect/index.md +++ b/src/components/TagSelect/index.md @@ -17,3 +17,11 @@ order: 13 |----------|------------------------------------------|-------------|-------| | onChange | 标签选择的回调函数 | Function(checkedTags) | | | expandable | 是否展示 `展开/收起` 按钮 | Boolean | false | + + +### TagSelectOption + +| 参数 | 说明 | 类型 | 默认值 | +|----------|------------------------------------------|-------------|-------| +| value | TagSelect的值 | Function(checkedTags) | - | +| children | tag的内容 | string \| ReactNode | - | diff --git a/src/components/Trend/index.d.ts b/src/components/Trend/index.d.ts new file mode 100644 index 00000000..6ac7c460 --- /dev/null +++ b/src/components/Trend/index.d.ts @@ -0,0 +1,8 @@ +import React from "react"; + +export interface TrendProps { + colorful?: boolean; + flag: "up" | "down"; +} + +export default class Trend extends React.Component {} diff --git a/src/components/Trend/index.md b/src/components/Trend/index.md index 54c241f4..683ed619 100644 --- a/src/components/Trend/index.md +++ b/src/components/Trend/index.md @@ -18,4 +18,4 @@ order: 14 | 参数 | 说明 | 类型 | 默认值 | |----------|------------------------------------------|-------------|-------| | colorful | 是否彩色标记 | Boolean | true | -| flag | 上升下降标识:`up\|down` | string | - | +| flag | 上升下降标识:`up|down` | string | - | -- GitLab