-
-
Notifications
You must be signed in to change notification settings - Fork 46.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25841 from ant-design/feature
chore: merge feature into master
- Loading branch information
Showing
13 changed files
with
1,150 additions
and
11 deletions.
There are no files selected for viewing
939 changes: 939 additions & 0 deletions
939
components/steps/__tests__/__snapshots__/demo.test.js.snap
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
--- | ||
order: 99 | ||
title: | ||
zh-CN: Progress Debug | ||
en-US: Progress Debug | ||
debug: true | ||
--- | ||
|
||
## zh-CN | ||
|
||
Buggy! | ||
|
||
## en-US | ||
|
||
Buggy! | ||
|
||
```jsx | ||
import { Steps, Button } from 'antd'; | ||
|
||
const { Step } = Steps; | ||
|
||
function Demo() { | ||
const [percent, setPercentage] = React.useState(0); | ||
const [current, setCurrent] = React.useState(1); | ||
const [status, setStatus] = React.useState('process'); | ||
return ( | ||
<> | ||
<Button onClick={() => setPercentage(undefined)}>Percentage to undefined</Button> | ||
<Button onClick={() => setPercentage((percent + 10) % 100)}>Percentage +</Button> | ||
<Button | ||
onClick={() => { | ||
setCurrent((current + 1) % 3); | ||
setPercentage(0); | ||
}} | ||
> | ||
Current + | ||
</Button> | ||
<Button onClick={() => setStatus('wait')}>Status Wait</Button> | ||
<Button onClick={() => setStatus('process')}>Status Process</Button> | ||
<Button onClick={() => setStatus('finish')}>Status Finish</Button> | ||
<Button onClick={() => setStatus('error')}>Status Error</Button> | ||
<Steps current={current} percent={percent} status={status}> | ||
<Step title="Finished" description="This is a description." /> | ||
<Step title="In Progress" subTitle="Left 00:00:08" description="This is a description." /> | ||
<Step title="Waiting" description="This is a description." /> | ||
</Steps> | ||
<Steps current={current} percent={percent} status={status} size="small"> | ||
<Step title="Finished" description="This is a description." /> | ||
<Step title="In Progress" subTitle="Left 00:00:08" description="This is a description." /> | ||
<Step title="Waiting" description="This is a description." /> | ||
</Steps> | ||
<Steps current={current} percent={percent} status={status} direction="vertical"> | ||
<Step title="Finished" description="This is a description." /> | ||
<Step title="In Progress" subTitle="Left 00:00:08" description="This is a description." /> | ||
<Step title="Waiting" description="This is a description." /> | ||
</Steps> | ||
<Steps current={current} percent={percent} status={status} size="small" direction="vertical"> | ||
<Step title="Finished" description="This is a description." /> | ||
<Step title="In Progress" subTitle="Left 00:00:08" description="This is a description." /> | ||
<Step title="Waiting" description="This is a description." /> | ||
</Steps> | ||
</> | ||
); | ||
} | ||
|
||
ReactDOM.render(<Demo />, mountNode); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
order: 13 | ||
title: | ||
zh-CN: 带有进度的步骤 | ||
en-US: Steps with progress | ||
--- | ||
|
||
## zh-CN | ||
|
||
带有进度的步骤。 | ||
|
||
## en-US | ||
|
||
Steps with progress. | ||
|
||
```jsx | ||
import { Steps } from 'antd'; | ||
|
||
const { Step } = Steps; | ||
|
||
ReactDOM.render( | ||
<Steps current={1} percent={60}> | ||
<Step title="Finished" description="This is a description." /> | ||
<Step title="In Progress" subTitle="Left 00:00:08" description="This is a description." /> | ||
<Step title="Waiting" description="This is a description." /> | ||
</Steps>, | ||
mountNode, | ||
); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
import '../../style/index.less'; | ||
import './index.less'; | ||
|
||
import '../../progress/style'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
@progress-prefix-cls: ~'@{ant-prefix}-progress'; | ||
|
||
.@{steps-prefix-cls}:not(.@{steps-prefix-cls}-dot):not(.@{steps-prefix-cls}-navigation) { | ||
&:not(.@{steps-prefix-cls}-vertical) { | ||
.@{steps-prefix-cls}-item { | ||
padding-top: 4px; | ||
} | ||
} | ||
.@{steps-prefix-cls}-item { | ||
.@{steps-prefix-cls}-item-icon { | ||
position: relative; | ||
.@{progress-prefix-cls} { | ||
position: absolute; | ||
top: -4px; | ||
right: -4px; | ||
bottom: -4px; | ||
left: -4px; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters