🐛 fix status normal

This commit is contained in:
stevenyuysy 2018-12-04 21:42:04 +08:00 committed by 偏右
parent 8f830ec366
commit 0929a8b2c5
5 changed files with 35 additions and 3 deletions

View File

@ -89,6 +89,33 @@ exports[`Progress render negetive successPercent 1`] = `
</div>
`;
exports[`Progress render normal progress 1`] = `
<div
class="ant-progress ant-progress-line ant-progress-status-normal ant-progress-show-info ant-progress-default"
>
<div>
<div
class="ant-progress-outer"
>
<div
class="ant-progress-inner"
>
<div
class="ant-progress-bg"
style="width: 0%; height: 8px; border-radius: 100px;"
/>
</div>
</div>
<span
class="ant-progress-text"
title="0%"
>
0%
</span>
</div>
</div>
`;
exports[`Progress render out-of-range progress 1`] = `
<div
class="ant-progress ant-progress-line ant-progress-status-success ant-progress-show-info ant-progress-default"

View File

@ -46,4 +46,9 @@ describe('Progress', () => {
const wrapper = mount(<Progress type="circle" percent={50} strokeColor="red" />);
expect(wrapper.render()).toMatchSnapshot();
});
it('render normal progress', () => {
const wrapper = mount(<Progress status="normal" />);
expect(wrapper.render()).toMatchSnapshot();
});
});

View File

@ -22,7 +22,7 @@ If it will take a long time to complete an operation, you can use `Progress` to
| gapPosition `(type=circle)` | the gap position, options: `top` `bottom` `left` `right` | string | `top` |
| percent | to set the completion percentage | number | 0 |
| showInfo | whether to display the progress value and the status icon | boolean | true |
| status | to set the status of the Progress, options: `success` `exception` `active` | string | - |
| status | to set the status of the Progress, options: `success` `exception` `active` `normal` | string | - |
| strokeWidth `(type=line)` | to set the width of the progress bar, unit: `px` | number | 10 |
| strokeWidth `(type=circle)` | to set the width of the circular progress bar, unit: percentage of the canvas width | number | 6 |
| strokeLinecap | to set the style of the progress linecap | Enum{ 'round', 'square' } | `round` |

View File

@ -23,7 +23,7 @@ title: Progress
| gapPosition `(type=circle)` | 圆形进度条缺口位置 | Enum{ 'top', 'bottom', 'left', 'right' } | `top` |
| percent | 百分比 | number | 0 |
| showInfo | 是否显示进度数值或状态图标 | boolean | true |
| status | 状态,可选:`success` `exception` `active` | string | - |
| status | 状态,可选:`success` `exception` `active` `normal` | string | - |
| strokeWidth `(type=line)` | 进度条线的宽度,单位 px | number | 10 |
| strokeWidth `(type=circle)` | 圆形进度条线的宽度,单位是进度条画布宽度的百分比 | number | 6 |
| strokeLinecap | | Enum{ 'round', 'square' } | `round` |

View File

@ -20,7 +20,7 @@ export interface ProgressProps {
percent?: number;
successPercent?: number;
format?: (percent?: number, successPercent?: number) => React.ReactNode;
status?: 'success' | 'active' | 'exception';
status?: 'success' | 'active' | 'exception' | 'normal';
showInfo?: boolean;
strokeWidth?: number;
strokeLinecap?: string;