Added pendingDot to Timeline (#9546)

* Added selectionColumnWidth to TableRowSelection

* Updated documents

* Renamed selectionColumnWidth to columnWidth

* Added pendingDot to Timeline

* Added pendingDot to Timeline

* Minor update according to the feedback

* Updated according to feedback
This commit is contained in:
SimpleFrontend 2018-03-09 08:03:19 +01:00 committed by 偏右
parent 6998f66eb5
commit 528c6fa1e0
4 changed files with 7 additions and 4 deletions

View File

@ -8,6 +8,7 @@ export interface TimelineProps {
className?: string;
/** 指定最后一个幽灵节点是否存在或内容 */
pending?: React.ReactNode;
pendingDot?: React.ReactNode;
style?: React.CSSProperties;
}
@ -18,7 +19,7 @@ export default class Timeline extends React.Component<TimelineProps, any> {
};
render() {
const { prefixCls, children, pending, className, ...restProps } = this.props;
const { prefixCls, children, pending, pendingDot, className, ...restProps } = this.props;
const pendingNode = typeof pending === 'boolean' ? null : pending;
const classString = classNames(prefixCls, {
[`${prefixCls}-pending`]: !!pending,
@ -33,7 +34,7 @@ export default class Timeline extends React.Component<TimelineProps, any> {
const pendingItem = (!!pending) ? (
<TimelineItem
pending={!!pending}
dot={<Icon type="loading" />}
dot={pendingDot || <Icon type="loading" />}
>
{pendingNode}
</TimelineItem>

View File

@ -7,11 +7,11 @@ title:
## zh-CN
当任务状态正在发生,还在记录过程中,可用幽灵节点来表示当前的时间节点(用于时间正序排列)
当任务状态正在发生,还在记录过程中,可用幽灵节点来表示当前的时间节点(用于时间正序排列)。当 pending 值为 false ,可用定制元件替换默认时间图点。
## en-US
When the timeline is incomplete and ongoing, put a ghost node at last. set `pending={true}` or `pending={a React Element}`. Used in ascend chronological order.
When the timeline is incomplete and ongoing, put a ghost node at last. set `pending={true}` or `pending={a React Element}`. Used in ascend chronological order. When `pending` is not false, set `pendingDot={a React Element}` to replace the default pending dot.
````jsx
import { Timeline } from 'antd';

View File

@ -29,6 +29,7 @@ Timeline
| Property | Description | Type | Default |
| -------- | ----------- | ---- | ------- |
| pending | Set the last ghost node's existence or its content | boolean\|string\|ReactNode | `false` |
| pendingDot | Set the dot of the last ghost node when pending is true | \|string\|ReactNode | `<Icon type="loading" />` |
### Timeline.Item

View File

@ -30,6 +30,7 @@ title: Timeline
| 参数 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
| pending | 指定最后一个幽灵节点是否存在或内容 | boolean\|string\|ReactNode | false |
| pendingDot | 当最后一个幽灵节点存在時,指定其时间图点 | \|string\|ReactNode | `<Icon type="loading" />` |
### Timeline.Item