add steps

This commit is contained in:
羽航 2015-06-25 16:01:04 +08:00
parent 071a145e4e
commit e8ec073adc
12 changed files with 176 additions and 28 deletions

View File

@ -1,5 +0,0 @@
# Steps 基本用法
````jsx
````

View File

@ -1,4 +0,0 @@
'use strict';
var React = require('react');
var Steps = require('rc-steps');

View File

@ -0,0 +1,9 @@
# Steps 自定义图标步进条
- order: 2
通过设置`Steps.Step`的`icon`属性,可以启用自定义图标。
````jsx
````

View File

@ -0,0 +1,46 @@
# Steps 基本用法
- order: 0
简单的步进条
---
````jsx
'use strict';
var Steps = antd.Steps;
var container = document.getElementById('components-steps-demo-simple');
var steps = [{
status: 'finish',
title: '已完成',
description: '这里是多信息的描述啊描述啊描述啊描述啊哦耶哦耶哦耶哦耶哦耶哦耶哦耶哦耶哦耶哦耶哦耶哦耶'
}, {
status: 'process',
title: '进行中',
description: '这里是多信息的描述啊描述啊描述啊描述啊哦耶哦耶哦耶哦耶哦耶哦耶哦耶哦耶哦耶哦耶哦耶哦耶'
}, {
status: 'wait',
title: '待运行',
description: '这里是多信息的描述啊描述啊描述啊描述啊哦耶哦耶哦耶哦耶哦耶哦耶哦耶哦耶哦耶哦耶哦耶哦耶'
}, {
status: 'wait',
title: '待运行',
description: '这里是多信息的描述啊描述啊描述啊描述啊哦耶哦耶哦耶哦耶哦耶哦耶哦耶哦耶哦耶哦耶哦耶哦耶'
}].map(function(s, i) {
return (<Steps.Step
key={i}
status={s.status}
title={s.title}
description={s.description}></Steps.Step>
);
});
React.render(
<Steps>
{steps}
</Steps>, container);
````

View File

@ -0,0 +1,9 @@
# Steps 迷你版步进条
- order: 1
迷你版的步进条,通过设置`<Steps size='small'>`启用
````jsx
````

View File

@ -0,0 +1,8 @@
# Steps 如何控制切换到下一步
- order: 3
````jsx
````

View File

@ -0,0 +1,3 @@
'use strict';
module.exports = require('rc-steps');

View File

@ -1,7 +1,7 @@
# Step
# Steps
- category: Components
- chinese: 步
- chinese: 步
- order: 8
---

View File

@ -10,7 +10,8 @@ var antd = {
Progress: require('./components/progress'),
Popover: require('./components/popover'),
Select: require('./components/select'),
confirm: require('./components/modal/confirm')
confirm: require('./components/modal/confirm'),
Steps: require('./components/steps')
};
module.exports = window.antd = antd;

View File

@ -21,7 +21,8 @@
"rc-progress": "~1.0.0",
"rc-select": "~4.0.0",
"rc-tabs": "~5.1.0",
"rc-tooltip": "~2.1.1"
"rc-tooltip": "~2.1.1",
"rc-steps": "~1.0.1"
},
"devDependencies": {
"babel-core": "~5.4.7",

View File

@ -11,3 +11,4 @@
@import "form";
@import "loading";
@import "progress";
@import "steps";

View File

@ -1,8 +1,16 @@
@active-color: #3fc7fa;
@wait-color: #e9e9e9;
.transition(@transition) {
-webkit-transition: @transition;
-o-transition: @transition;
transition: @transition;
}
.rc-steps {
font-size: 0;
width: 100%;
line-height: 1.5;
.rc-steps-item {
position: relative;
@ -10,26 +18,47 @@
&.rc-steps-status-wait {
.rc-steps-head {
color: @wait-color;
border-color: @wait-color;
background-color: #fff;
&.rc-steps-custom {
background: none;
border: 0;
}
> .rc-steps-icon {
color: @wait-color;
}
}
}
&.rc-steps-status-process {
.rc-steps-head {
color: #fff;
border-color: @active-color;
background: @active-color;
background-color: @active-color;
&.rc-steps-custom {
background: none;
border: 0;
}
> .rc-steps-icon {
color: #fff;
}
}
}
&.rc-steps-status-finish {
.rc-steps-head {
color: #fff;
border-color: @active-color;
background: #fff;
> i {
background-color: #fff;
&.rc-steps-custom {
background: none;
border: 0;
}
> .rc-steps-icon {
color: @active-color;
}
}
//.rc-steps-tail {
// > i {
// background: @active-color;
// }
//}
}
}
@ -37,6 +66,7 @@
.rc-steps-head, .rc-steps-main, .rc-steps-tail {
display: inline-block;
vertical-align: top;
}
.rc-steps-head {
border:2px solid @wait-color;
@ -45,20 +75,21 @@
line-height: 24px;
text-align: center;
border-radius: 24px;
font-size: 15px;
font-size: 13px;
margin-right: 12px;
> i {
font-weight: bold;
.transition(background-color 0.1s ease);
.transition(border-color 0.1s ease);
> .rc-steps-icon {
display: inline-block;
vertical-align: inherit;
color: #3fc7fa;
vertical-align: middle;
position: relative;
top: -2px;
}
}
.rc-steps-main {
max-width: 75px;
margin-top: 4px;
margin-top: 3px;
}
.rc-steps-title {
font-size: 14px;
@ -73,11 +104,11 @@
.rc-steps-tail {
width: 0;
position: relative;
top: 10px;
top: 13px;
padding:0 10px;
> i {
display: inline-block;
background: #e9e9e9;
background: @wait-color;
height: 2px;
border-radius: 1px;
width: 100%;
@ -85,4 +116,52 @@
}
&.rc-steps-small {
.rc-steps-head {
border:1px solid @wait-color;
width: 18px;
height: 18px;
line-height: 18px;
text-align: center;
border-radius: 18px;
font-size: 10px;
margin-right: 10px;
> .rc-steps-icon {
top: 0;
}
}
.rc-steps-main {
max-width: 75px;
margin-top: 0;
}
.rc-steps-title {
font-size: 12px;
margin-bottom: 4px;
color: #666;
font-weight: bold;
}
.rc-steps-description {
font-size: 10px;
color: #999;
}
.rc-steps-tail {
top: 9px;
padding:0 8px;
> i {
height: 1px;
border-radius: 1px;
width: 100%;
}
}
}
&.rc-steps-small .rc-steps-head.rc-steps-custom, .rc-steps-head.rc-steps-custom {
width: inherit;
height: inherit;
line-height: inherit;
border-radius: 0;
border: 0;
background: none;
}
}