From 8b3e488485bd5ebb8d8f033dd67bb48a8be6b38f Mon Sep 17 00:00:00 2001 From: Benjy Cui Date: Thu, 22 Dec 2016 12:00:57 +0800 Subject: [PATCH] docs: update docs for Tooltip Popconfirm Popover --- components/popconfirm/index.en-US.md | 6 ++---- components/popconfirm/index.zh-CN.md | 7 ++----- components/popover/index.en-US.md | 11 ++--------- components/popover/index.tsx | 2 +- components/popover/index.zh-CN.md | 11 ++--------- components/tooltip/index.en-US.md | 16 +++++++++++++--- components/tooltip/index.zh-CN.md | 16 +++++++++++++--- 7 files changed, 35 insertions(+), 34 deletions(-) diff --git a/components/popconfirm/index.en-US.md b/components/popconfirm/index.en-US.md index 982b92a1d..ede6261cc 100644 --- a/components/popconfirm/index.en-US.md +++ b/components/popconfirm/index.en-US.md @@ -16,12 +16,10 @@ The difference with `confirm` is more lightweight than the static popped full-sc | Param | Description | Type | Default value | |-----------|------------------------------------------|---------------|--------| -| placement | position of the confirmation box, optional `top/left/right/bottom` `topLeft/topRight/bottomLeft/bottomRight` `leftTop/leftBottom/rightTop/rightBottom` | string | top | | title | title of the confirmation box | React.Element | none | | onConfirm | callback of confirmation | function | none | | onCancel | callback of cancel | function | none | -| onVisibleChange | callback of the visible attribute changed | function(visible) | none | | okText | text of the confirmation button | String | Confirm | | cancelText| text of the cancel button | String | Cancel | -| openClassName | class name of the trigger, using for highlighting the trigger while triggered | string | ant-popover-open | -| arrowPointAtCenter | whether arrow pointed at the center of target, supported after `antd@1.11+` | Boolean | `false` | + +Consult [Tooltip's documentation](https://ant.design/components/tooltip/#API) to find more APIs. diff --git a/components/popconfirm/index.zh-CN.md b/components/popconfirm/index.zh-CN.md index 279eec934..82e1a048a 100644 --- a/components/popconfirm/index.zh-CN.md +++ b/components/popconfirm/index.zh-CN.md @@ -13,17 +13,14 @@ title: Popconfirm 和 `confirm` 弹出的全屏居中模态对话框相比,交互形式更轻量。 - ## API | 参数 | 说明 | 类型 | 默认值 | |-----------|------------------------------------------|---------------|--------| -| placement | 气泡框位置,可选 `top/left/right/bottom` `topLeft/topRight/bottomLeft/bottomRight` `leftTop/leftBottom/rightTop/rightBottom` | string | top | | title | 确认框的描述 | React.Element | 无 | | onConfirm | 点击确认的回调 | function | 无 | | onCancel | 点击取消的回调 | function | 无 | -| onVisibleChange | 显示隐藏的回调 | function(visible) | 无 | | okText | 确认按钮文字 | String | 确定 | | cancelText| 取消按钮文字 | String | 取消 | -| openClassName | 气泡框展现时触发器添加的类名,可用于打开浮层时高亮触发器 | string | ant-popover-open | -| arrowPointAtCenter | 箭头是否指向目标元素中心,`antd@1.11+` 支持 | Boolean | `false` | + +更多属性请参考 [Tooltip](https://ant.design/components/tooltip/#API)。 diff --git a/components/popover/index.en-US.md b/components/popover/index.en-US.md index 3788a2870..1b009c1d2 100644 --- a/components/popover/index.en-US.md +++ b/components/popover/index.en-US.md @@ -16,14 +16,7 @@ Comparing with `Tooltip`, besides information `Popover` card can also provide ac | Param | Description | Type | Default value | |-----------|------------------------------------------|---------------|--------| -| trigger | triggering mode: can be hover, focus, or click. | string | hover | -| placement | position of the card,optional `top/left/right/bottom` `topLeft/topRight/bottomLeft/bottomRight` `leftTop/leftBottom/rightTop/rightBottom` | string | top | | title | title of the card | React.Element | none | | content | content of the card | React.Element | none | -| overlayClassName | class name of the card | string | none | -| overlayStyle | style of the card | object | none | -| visible | make the float card visible or not | boolean | false | -| onVisibleChange | callback of the visible attribute changed | function | none | -| getTooltipContainer | rendered to the root of the menu. Default rendered to the body dom. If gets any problem of the menu while scrolling. Try to make the root the dom scrolled, and make it position relative. [Sample](http://codepen.io/anon/pen/xVBOVQ?editors=001) | Function(triggerNode) | () => document.body | -| openClassName | class name of the trigger, using for highlighting the trigger while triggered | string | ant-popover-open | -| arrowPointAtCenter | whether arrow pointed at the center of target, supported after `antd@1.11+` | Boolean | `false` | + +Consult [Tooltip's documentation](https://ant.design/components/tooltip/#API) to find more APIs. diff --git a/components/popover/index.tsx b/components/popover/index.tsx index a8672af84..417ffa3f3 100644 --- a/components/popover/index.tsx +++ b/components/popover/index.tsx @@ -6,7 +6,7 @@ import warning from '../_util/warning'; export interface PopoverProps extends AbstractTooltipProps { title?: React.ReactNode; - content?: React.ReactNode | string; + content?: React.ReactNode; } export default class Popover extends React.Component { diff --git a/components/popover/index.zh-CN.md b/components/popover/index.zh-CN.md index fec1bde0c..825da9c55 100644 --- a/components/popover/index.zh-CN.md +++ b/components/popover/index.zh-CN.md @@ -17,14 +17,7 @@ title: Popover | 参数 | 说明 | 类型 | 默认值 | |-----------|------------------------------------------|---------------|--------| -| trigger | 触发行为,可选 `hover/focus/click` | string | hover | -| placement | 气泡框位置,可选 `top/left/right/bottom` `topLeft/topRight/bottomLeft/bottomRight` `leftTop/leftBottom/rightTop/rightBottom` | string | top | | title | 卡片标题 | React.Element | 无 | | content | 卡片内容 | React.Element | 无 | -| overlayClassName | 卡片类名 | string | 无 | -| overlayStyle | 卡片样式 | object | 无 | -| visible | 用于手动控制浮层显隐 | boolean | false | -| onVisibleChange | 显示隐藏改变的回调 | function | 无 | -| getTooltipContainer | 菜单渲染父节点。默认渲染到 body 上,如果你遇到菜单滚动定位问题,试试修改为滚动的区域,并相对其定位。[示例](http://codepen.io/anon/pen/xVBOVQ?editors=001) | Function(triggerNode) | () => document.body | -| openClassName | 气泡框展现时触发器添加的类名,可用于打开浮层时高亮触发器 | string | ant-popover-open | -| arrowPointAtCenter | 箭头是否指向目标元素中心,`antd@1.11+` 支持 | Boolean | `false` | + +更多属性请参考 [Tooltip](https://ant.design/components/tooltip/#API)。 diff --git a/components/tooltip/index.en-US.md b/components/tooltip/index.en-US.md index 3f0f655a9..8143cf5c0 100644 --- a/components/tooltip/index.en-US.md +++ b/components/tooltip/index.en-US.md @@ -15,9 +15,19 @@ A simple text popup tip. | Property | Description | Type | Default | |-----------|------------------------------------------|------------|--------| -| placement | to set the position, which can be one of `top` `left` `right` `bottom` `topLeft` `topRight` `bottomLeft` `bottomRight` `leftTop` `leftBottom` `rightTop` `rightBottom` | string | top | | title | prompt text | string/React.Element | - | + +### Common API + +The following APIs are shared by Tooltip, Popconfirm, Popover. + +| Property | Description | Type | Default | +|-----------|------------------------------------------|------------|--------| +| placement | to set the position, which can be one of `top` `left` `right` `bottom` `topLeft` `topRight` `bottomLeft` `bottomRight` `leftTop` `leftBottom` `rightTop` `rightBottom` | string | top | | getTooltipContainer | to set the container of the tip, while the default is to create a `div` element in `body` | Function(triggerNode) | () => document.body | | arrowPointAtCenter | whether arrow pointed at the center of target, supported after `antd@1.11+` | Boolean | `false` | - -You can visit https://github.com/react-component/tooltip for more API. +| visible | make the float card visible or not | boolean | false | +| onVisibleChange | callback of the visible attribute changed | function(visible) | none | +| trigger | triggering mode: can be hover, focus, or click. | string | hover | +| overlayClassName | class name of the card | string | none | +| overlayStyle | style of the card | object | none | diff --git a/components/tooltip/index.zh-CN.md b/components/tooltip/index.zh-CN.md index 5a83cdd70..e21b400eb 100644 --- a/components/tooltip/index.zh-CN.md +++ b/components/tooltip/index.zh-CN.md @@ -15,11 +15,21 @@ title: Tooltip ## API +| 参数 | 说明 | 类型 | 默认值 | +|-----------|------------------------------------------|------------|--------| +| title | 提示文字 | React.ReactNode | 无 | + +### 共同的 API + +以下 API 为 Tooltip、Popconfirm、Popover 共享的 API。 + | 参数 | 说明 | 类型 | 默认值 | |-----------|------------------------------------------|------------|--------| | placement | 气泡框位置,可选 `top` `left` `right` `bottom` `topLeft` `topRight` `bottomLeft` `bottomRight` `leftTop` `leftBottom` `rightTop` `rightBottom` | string | top | -| title | 提示文字 | string/React.Element | 无 | | getTooltipContainer | 浮层渲染父节点。默认渲染到 body 上 | Function(triggerNode) | () => document.body | | arrowPointAtCenter | 箭头是否指向目标元素中心,`antd@1.11+` 支持 | Boolean | `false` | - -更多 API 可参考:https://github.com/react-component/tooltip +| visible | 用于手动控制浮层显隐 | boolean | false | +| onVisibleChange | 显示隐藏的回调 | function(visible) | 无 | +| trigger | 触发行为,可选 `hover/focus/click` | string | hover | +| overlayClassName | 卡片类名 | string | 无 | +| overlayStyle | 卡片样式 | object | 无 |