diff --git a/src/components/Charts/Bar/index.d.ts b/src/components/Charts/Bar/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b66ec437d72be803586e20f1b9df4a0bac7abec6 --- /dev/null +++ b/src/components/Charts/Bar/index.d.ts @@ -0,0 +1,14 @@ +import React from "react"; +export interface BarProps { + title: string | React.ReactNode; + color?: string; + margin?: [number, number, number, number]; + height: number; + data: Array<{ + x: string; + y: number; + }>; + autoLabel?: boolean; +} + +export default class Bar extends React.Component {} diff --git a/src/components/Charts/ChartCard/index.d.ts b/src/components/Charts/ChartCard/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..bb8824b68434bbe35a8b8f14715a9a27fdc24ef3 --- /dev/null +++ b/src/components/Charts/ChartCard/index.d.ts @@ -0,0 +1,11 @@ +import React from "react"; +export interface ChartCardProps { + title: string | React.ReactNode; + action?: React.ReactNode; + total?: React.ReactNode | number; + footer?: React.ReactNode; + contentHeight: number; + avatar?: React.ReactNode; +} + +export default class ChartCard extends React.Component {} diff --git a/src/components/Charts/Field/index.d.ts b/src/components/Charts/Field/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..dfe3e9cc687e9c2249918347d62c7b8519a94d33 --- /dev/null +++ b/src/components/Charts/Field/index.d.ts @@ -0,0 +1,7 @@ +import React from "react"; +export interface FieldProps { + label: string | React.ReactNode; + value: string | React.ReactNode; +} + +export default class Field extends React.Component {} diff --git a/src/components/Charts/Gauge/index.d.ts b/src/components/Charts/Gauge/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2729a75fb7d1e935ce5642239f4be18f2ef57eb0 --- /dev/null +++ b/src/components/Charts/Gauge/index.d.ts @@ -0,0 +1,10 @@ +import React from "react"; +export interface GaugeProps { + title: string | React.ReactNode; + color?: string; + height: number; + bgColor?: number; + percent: number; +} + +export default class Gauge extends React.Component {} diff --git a/src/components/Charts/MiniArea/index.d.ts b/src/components/Charts/MiniArea/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..dff1667ed994d58e050a8fe69aa2491e6489af1f --- /dev/null +++ b/src/components/Charts/MiniArea/index.d.ts @@ -0,0 +1,29 @@ +import React from "react"; + +// g2已经更新到3.0 +// 不带的写了 + +export interface Axis { + title: any; + line: any; + gridAlign: any; + labels: any; + tickLine: any; + grid: any; +} + +export interface MiniAreaProps { + color?: string; + height: number; + borderColor?: string; + line?: boolean; + animate?: boolean; + xAxis?: Axis; + yAxis?: Axis; + data: Array<{ + x: number; + y: number; + }>; +} + +export default class MiniArea extends React.Component {} diff --git a/src/components/Charts/MiniBar/index.d.ts b/src/components/Charts/MiniBar/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7b7394f43c790fec1f4260c99d9fa63ff8657726 --- /dev/null +++ b/src/components/Charts/MiniBar/index.d.ts @@ -0,0 +1,11 @@ +import React from "react"; +export interface MiniBarProps { + color?: string; + height: number; + data: Array<{ + x: number; + y: number; + }>; +} + +export default class MiniBar extends React.Component {} diff --git a/src/components/Charts/MiniProgress/index.d.ts b/src/components/Charts/MiniProgress/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d89000ccb5e49f42842de33c1658f44a5dff1b94 --- /dev/null +++ b/src/components/Charts/MiniProgress/index.d.ts @@ -0,0 +1,12 @@ +import React from "react"; +export interface MiniProgressProps { + target: number; + color?: string; + strokeWidth: number; + percent: number; +} + +export default class MiniProgress extends React.Component< + MiniProgressProps, + any +> {} diff --git a/src/components/Charts/Pie/index.d.ts b/src/components/Charts/Pie/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..16ad6a3bad477937c5bdd8c1283111bb43e54a4e --- /dev/null +++ b/src/components/Charts/Pie/index.d.ts @@ -0,0 +1,20 @@ +import React from "react"; +export interface PieProps { + animate?: boolean; + color?: string; + height: number; + hasLegend?: boolean; + margin?: [number, number, number, number]; + percent?: number; + data?: Array<{ + x: string; + y: number; + }>; + total?: string; + title?: string | React.ReactNode; + tooltip?: boolean; + valueFormat?: (value: string) => string; + subTitle?: string | React.ReactNode; +} + +export default class Pie extends React.Component {} diff --git a/src/components/Charts/Radar/index.d.ts b/src/components/Charts/Radar/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..18c056d362e606091eb533db35af958ed913a6cf --- /dev/null +++ b/src/components/Charts/Radar/index.d.ts @@ -0,0 +1,14 @@ +import React from "react"; +export interface RadarProps { + title?: string | React.ReactNode; + height: number; + margin?: [number, number, number, number]; + hasLegend?: boolean; + data: Array<{ + name: string; + label: string; + value: string; + }>; +} + +export default class Radar extends React.Component {} diff --git a/src/components/Charts/TagCloud/index.d.ts b/src/components/Charts/TagCloud/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..04c2c250758ba576b3d4e62cc4eb2cfbd20284db --- /dev/null +++ b/src/components/Charts/TagCloud/index.d.ts @@ -0,0 +1,10 @@ +import React from "react"; +export interface TagCloudProps { + data: Array<{ + name: string; + value: number; + }>; + height: number; +} + +export default class TagCloud extends React.Component {} diff --git a/src/components/Charts/TimelineChart/index.d.ts b/src/components/Charts/TimelineChart/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d03e839c73ae646f6a51f05c400f5c200b2f07c8 --- /dev/null +++ b/src/components/Charts/TimelineChart/index.d.ts @@ -0,0 +1,15 @@ +import React from "react"; +export interface TimelineChartProps { + data: Array<{ + x: string; + y1: string; + y2: string; + }>; + titleMap: { y1: string; y2: string }; + height?: number; +} + +export default class TimelineChart extends React.Component< + TimelineChartProps, + any +> {} diff --git a/src/components/Charts/WaterWave/index.d.ts b/src/components/Charts/WaterWave/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..258a5670df5808df0bb31034256590a887e01694 --- /dev/null +++ b/src/components/Charts/WaterWave/index.d.ts @@ -0,0 +1,9 @@ +import React from "react"; +export interface WaterWaveProps { + title: string | React.ReactNode; + color?: string; + height: number; + percent: number; +} + +export default class WaterWave extends React.Component {} diff --git a/src/components/Charts/index.d.ts b/src/components/Charts/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e47b947f741abbb7dc37c824c6f47797cb177b77 --- /dev/null +++ b/src/components/Charts/index.d.ts @@ -0,0 +1,17 @@ +export { default as numeral } from "numeral"; +export { default as ChartCard } from "./ChartCard"; +export { default as Bar } from "./Bar"; +export { default as Pie } from "./Pie"; +export { default as Radar } from "./Radar"; +export { default as Gauge } from "./Gauge"; +export { default as MiniArea } from "./MiniArea"; +export { default as MiniBar } from "./MiniBar"; +export { default as MiniProgress } from "./MiniProgress"; +export { default as Field } from "./Field"; +export { default as WaterWave } from "./WaterWave"; +export { default as TagCloud } from "./TagCloud"; +export { default as TimelineChart } from "./TimelineChart"; + +declare const yuan: (value: number | string) => string; + +export { yuan }; diff --git a/src/components/Charts/index.md b/src/components/Charts/index.md index d3b47e05905fff7b7d48dedf734a4b11da22a87a..218f4ebf59614e727e50a8a296f19327f00a6590 100644 --- a/src/components/Charts/index.md +++ b/src/components/Charts/index.md @@ -22,7 +22,7 @@ Ant Design Pro 提供的业务中常用的图表类型,都是基于 [G2](https | total | 数据总量 | ReactNode \| number | - | | footer | 卡片底部 | ReactNode | - | | contentHeight | 内容区域高度 | number | - | - +| avatar | 右侧图标 | React.ReactNode | - | ### MiniBar | 参数 | 说明 | 类型 | 默认值 | @@ -76,7 +76,9 @@ Ant Design Pro 提供的业务中常用的图表类型,都是基于 [G2](https | percent | 占比 | number | - | | tooltip | 是否显示 tooltip | boolean | true | | valueFormat | 显示值的格式化函数 | function | - | -| subTitle | 图表子标题 | ReactNode\|string | - | +| title | 图表标题 | ReactNode|string | - | +| subTitle | 图表子标题 | ReactNode|string | - | +| total | 图标中央的总数 | string | - | ### Radar @@ -86,6 +88,7 @@ Ant Design Pro 提供的业务中常用的图表类型,都是基于 [G2](https | height | 图表高度 | number | - | | hasLegend | 是否显示 legend | boolean | `false` | | margin | 图表内部间距 | array | \[24, 30, 16, 30\] | +| data | 图标数据 | array<{name,label,value}> | - | ### Gauge @@ -94,7 +97,7 @@ Ant Design Pro 提供的业务中常用的图表类型,都是基于 [G2](https | title | 图表标题 | ReactNode\|string | - | | height | 图表高度 | number | - | | color | 图表颜色 | string | `#2F9CFF` | -| bgColor | 图表北京颜色 | string | `#F0F2F5` | +| bgColor | 图表背景颜色 | string | `#F0F2F5` | | percent | 进度比例 | number | - | ### WaterWave @@ -110,7 +113,7 @@ Ant Design Pro 提供的业务中常用的图表类型,都是基于 [G2](https | 参数 | 说明 | 类型 | 默认值 | |----------|------------------------------------------|-------------|-------| -| tags | 标题 | Array | - | +| data | 标题 | Array | - | | height | 高度值 | number | - | ### TimelineChart diff --git a/src/components/CountDown/index.d.ts b/src/components/CountDown/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b91c812eaf64274a422f7de1cdb581fe06db0fa5 --- /dev/null +++ b/src/components/CountDown/index.d.ts @@ -0,0 +1,9 @@ +import React from "react"; +export interface CountDownProps { + format?: (time: number) => void; + target: Date | number; + onEnd?: () => void; + style?: React.CSSProperties; +} + +export default class CountDown extends React.Component {} diff --git a/src/components/CountDown/index.en-US.md b/src/components/CountDown/index.en-US.md index 8e01b4e3c569ddadf73faaa745fe46c6b287cb2c..7b452406b3528ccfb14fe3bdecb0ead9a2df4e6f 100644 --- a/src/components/CountDown/index.en-US.md +++ b/src/components/CountDown/index.en-US.md @@ -12,3 +12,4 @@ Simple CountDown Component. |----------|------------------------------------------|-------------|-------| | format | Formatter of time | Function(time) | | | target | Target time | Date | - | +| onEnd | Countdown to the end callback | funtion | -| diff --git a/src/components/CountDown/index.zh-CN.md b/src/components/CountDown/index.zh-CN.md index f9814bc69780fc2936566549a53b8763e75234cc..7e00ba1da5f3ed633dd2d2dc9c81b5acfc30c3fa 100644 --- a/src/components/CountDown/index.zh-CN.md +++ b/src/components/CountDown/index.zh-CN.md @@ -13,3 +13,4 @@ order: 3 |----------|------------------------------------------|-------------|-------| | format | 时间格式化显示 | Function(time) | | | target | 目标时间 | Date | - | +| onEnd | 倒计时结束回调 | funtion | -| diff --git a/src/components/DescriptionList/index.d.ts b/src/components/DescriptionList/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c2d75ee231eb4a8cc5634b38b266a0076d4fb3c6 --- /dev/null +++ b/src/components/DescriptionList/index.d.ts @@ -0,0 +1,22 @@ +import React from "react"; +export interface DescriptionListProps { + layout?: "horizontal" | "vertical"; + col?: number; + title: React.ReactNode; + gutter?: number; + size?: "large" | "small"; +} + +declare class Description extends React.Component< + { + term: React.ReactNode; + }, + any +> {} + +export default class DescriptionList extends React.Component< + DescriptionListProps, + any +> { + static Description: typeof Description; +} diff --git a/src/components/DescriptionList/index.md b/src/components/DescriptionList/index.md index bdadf13638af0752fd44f239577ab61a2d8c699d..bfa60cb8aa565e9a4bb88e5bc7213a4894ca516b 100644 --- a/src/components/DescriptionList/index.md +++ b/src/components/DescriptionList/index.md @@ -19,7 +19,7 @@ order: 4 | col | 指定信息最多分几列展示,最终一行几列由 col 配置结合[响应式规则](/components/DescriptionList#响应式规则)决定 | number(0 < col <= 4) | 3 | | title | 列表标题 | ReactNode | - | | gutter | 列表项间距,单位为 `px` | number | 32 | -| size | 列表型号,可以设置为 `large` `small` | string | - | +| size | 列表型号,可以设置为 `large` `small` | Enum{'large', 'small'} | - | #### 响应式规则