-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* test: update snapshot * docs: add inline type * docs: add inline demo
- Loading branch information
Showing
9 changed files
with
321 additions
and
9 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -186,3 +186,4 @@ | |
@import 'label-placement'; | ||
@import 'progress-dot'; | ||
@import 'nav'; | ||
@import 'inline'; |
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,81 @@ | ||
@import 'variables'; | ||
|
||
.@{stepsPrefixClass}-inline { | ||
width: auto; | ||
display: inline-flex; | ||
|
||
.@{stepsPrefixClass}-item { | ||
flex: none; | ||
|
||
&-container { | ||
padding: 9px 4px 0; | ||
margin: 0 2px; | ||
border-radius: 4px; | ||
cursor: pointer; | ||
&:hover { | ||
background: rgba(0, 0, 0, 0.04); | ||
} | ||
&[role='button']:hover { | ||
opacity: 1; | ||
} | ||
} | ||
|
||
&-icon { | ||
width: 6px; | ||
height: 6px; | ||
margin-left: calc(50% - 3px); | ||
> .@{stepsPrefixClass}-icon { | ||
top: 0; | ||
} | ||
.@{stepsPrefixClass}-icon-dot { | ||
border-radius: 3px; | ||
} | ||
} | ||
|
||
&-content { | ||
width: auto; | ||
margin-top: 7px; | ||
} | ||
&-title { | ||
color: rgba(0, 0, 0, 0.25); | ||
font-size: 12px; | ||
line-height: 20px; | ||
font-weight: normal; | ||
margin-bottom: 2px; | ||
} | ||
&-description { | ||
display: none; | ||
} | ||
|
||
&-tail { | ||
margin-left: 0; | ||
top: 11px; | ||
&:after { | ||
height: 1px; | ||
} | ||
} | ||
&:first-child .@{stepsPrefixClass}-item-tail{ | ||
width: 50%; | ||
margin-left: 50%; | ||
} | ||
&:last-child .@{stepsPrefixClass}-item-tail{ | ||
display: block; | ||
width: 50%; | ||
} | ||
|
||
&-finish { | ||
.@{stepsPrefixClass}-item-tail:after { | ||
background-color: @process-tail-color; | ||
} | ||
.@{stepsPrefixClass}-item-icon .@{stepsPrefixClass}-icon .@{stepsPrefixClass}-icon-dot { | ||
background-color: @process-tail-color; | ||
} | ||
} | ||
&-wait { | ||
.@{stepsPrefixClass}-item-icon .@{stepsPrefixClass}-icon .@{stepsPrefixClass}-icon-dot { | ||
background-color: #fff; | ||
border: 1px solid @process-tail-color; | ||
} | ||
} | ||
} | ||
} |
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,2 @@ | ||
## inline | ||
<code src="../examples/inline.jsx"> |
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,36 @@ | ||
import '../../assets/index.less'; | ||
import React, { useState } from 'react'; | ||
import Steps from 'rc-steps'; | ||
|
||
export default () => { | ||
const [current, setCurrent] = useState(0); | ||
|
||
return ( | ||
<Steps | ||
type="inline" | ||
current={current} | ||
onChange={setCurrent} | ||
items={[ | ||
{ | ||
title: '开发', | ||
description: '开发阶段:开发中', | ||
}, | ||
{ | ||
title: '测试', | ||
description: '测试阶段:测试中', | ||
}, | ||
{ | ||
title: '预发', | ||
description: '预发阶段:预发中', | ||
}, | ||
{ | ||
title: '发布', | ||
description: '发布阶段:发布中', | ||
} | ||
]} | ||
itemRender={(item, stepItem) => ( | ||
React.cloneElement(stepItem, { title: item.description }) | ||
)} | ||
/> | ||
) | ||
}; |
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
Oops, something went wrong.