Преглед на файлове

增加所有剩余对外开发的组件 .d.ts (#312)

* 增加AvatarList d.ts说明文件

* 修改 axis的链接 , g2修改了新的官网

* AvatarList 增加判断是否为必须属性

* 删除无用的空行.  优化格式

* 修改错误的图表文档. 增加几处漏写的文档

* 添加图表的 描述文件chart.d.ts

* 改了个错别字!

* 增加CountDown d.ts描述文件

* 增加 DescriptionList  d.ts描述文件

* 增加所有剩余对外开发的组件 .d.ts
完善一些文档

* fontWeight 推荐使用 number 来表示数字
jim chen преди 8 години
родител
ревизия
55e5d20577

+ 11 - 0
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<ExceptionProps, any> {}

+ 9 - 0
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
+> {}

+ 14 - 0
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
+> {}

+ 13 - 0
src/components/HeaderSearch/index.d.ts

@@ -0,0 +1,13 @@
+import React from "react";
+export interface HeaderSearchProps {
+  placeholder?: string;
+  dataSource?: Array<string>;
+  onSearch?: (value: string) => void;
+  onChange?: (value: string) => void;
+  onPressEnter?: (value: string) => void;
+}
+
+export default class HeaderSearch extends React.Component<
+  HeaderSearchProps,
+  any
+> {}

+ 42 - 0
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<NoticeIconData>;
+  title: string;
+  emptyText?: React.ReactNode;
+  emptyImage?: string;
+}
+
+export class NoticeIconTab extends React.Component<NoticeIconTabProps, any> {}
+
+export default class NoticeIcon extends React.Component<NoticeIconProps, any> {
+  static Tab: typeof NoticeIconTab;
+}

+ 1 - 1
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 | -
 

+ 11 - 0
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<NumberInfoProps, any> {}

+ 1 - 1
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

+ 16 - 0
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<any>;
+  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<PageHeaderProps, any> {}

+ 1 - 1
src/components/Result/demo/classic.md

@@ -33,7 +33,7 @@ const desc2 = (
 
 const extra = (
   <div>
-    <div style={{ fontSize: 16, color: 'rgba(0, 0, 0, 0.85)', fontWeight: '500', marginBottom: 20 }}>
+    <div style={{ fontSize: 16, color: 'rgba(0, 0, 0, 0.85)', fontWeight: 500, marginBottom: 20 }}>
       项目名称
     </div>
     <Row style={{ marginBottom: 16 }}>

+ 1 - 1
src/components/Result/demo/error.md

@@ -11,7 +11,7 @@ import { Button, Icon } from 'antd';
 
 const extra = (
   <div>
-    <div style={{ fontSize: 16, color: 'rgba(0, 0, 0, 0.85)', fontWeight: '500', marginBottom: 16 }}>
+    <div style={{ fontSize: 16, color: 'rgba(0, 0, 0, 0.85)', fontWeight: 500, marginBottom: 16 }}>
       您提交的内容有如下错误:
     </div>
     <div style={{ marginBottom: 16 }}>

+ 10 - 0
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<ResultProps, any> {}

+ 20 - 0
src/components/TagSelect/index.d.ts

@@ -0,0 +1,20 @@
+import React from "react";
+export interface TagSelectProps {
+  onChange?: (value: Array<string>) => void;
+  expandable?: boolean;
+}
+export interface TagSelectOptionProps {
+  value: string;
+}
+
+export class TagSelectOption extends React.Component<
+  TagSelectOptionProps,
+  any
+> {}
+
+export default class TagSelect extends React.Component<TagSelectProps, any> {
+  static Option: typeof TagSelectOption;
+  children:
+    | React.ReactElement<TagSelectOption>
+    | Array<React.ReactElement<TagSelectOption>>;
+}

+ 8 - 0
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 | - |

+ 8 - 0
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<TrendProps, any> {}

+ 1 - 1
src/components/Trend/index.md

@@ -18,4 +18,4 @@ order: 14
 | 参数      | 说明                                      | 类型         | 默认值 |
 |----------|------------------------------------------|-------------|-------|
 | colorful | 是否彩色标记 | Boolean | true |
-| flag | 上升下降标识:`up\|down` | string | - |
+| flag | 上升下降标识:`up|down` | string | - |