mirror of
https://github.com/ant-design/ant-design.git
synced 2025-08-06 16:06:28 +08:00
Merge branch 'master' of github.com:ant-design/ant-design
This commit is contained in:
commit
02a8ae56e7
@ -7,9 +7,15 @@ var GregorianCalendar = require('gregorian-calendar');
|
||||
var zhCn = require('gregorian-calendar/lib/locale/zh-cn');
|
||||
var CalendarLocale = require('rc-calendar/lib/locale/zh-cn');
|
||||
var DateTimeFormat = require('gregorian-calendar-format');
|
||||
// 和顶部文案保持一致
|
||||
require('gregorian-calendar-format/lib/locale/zh-cn').shortMonths =
|
||||
['1月', '2月', '3月', '4月', '5月', '6月',
|
||||
'7月', '8月', '9月', '10月', '11月', '12月'];
|
||||
var defaultCalendarValue = new GregorianCalendar(zhCn);
|
||||
defaultCalendarValue.setTime(Date.now());
|
||||
|
||||
console.log(DateTimeFormat);
|
||||
|
||||
module.exports = React.createClass({
|
||||
getInitialState: function () {
|
||||
return {
|
||||
|
38
components/progress/demo/circle-dynamic.md
Normal file
38
components/progress/demo/circle-dynamic.md
Normal file
@ -0,0 +1,38 @@
|
||||
# 进度圈动态展示
|
||||
|
||||
- order: 4
|
||||
|
||||
会动的进度条才是好进度条。
|
||||
|
||||
---
|
||||
|
||||
````jsx
|
||||
var ProgressCircle = antd.Progress.Circle;
|
||||
|
||||
var MyProgress = React.createClass({
|
||||
getInitialState() {
|
||||
return {
|
||||
percent: 0
|
||||
};
|
||||
},
|
||||
componentDidMount: function() {
|
||||
var self = this;
|
||||
setInterval(function() {
|
||||
if (self.state.percent < 100) {
|
||||
self.state.percent += 2;
|
||||
}
|
||||
self.setState({
|
||||
percent: self.state.percent
|
||||
});
|
||||
}, 100);
|
||||
},
|
||||
render() {
|
||||
return <ProgressCircle percent={this.state.percent} />;
|
||||
}
|
||||
});
|
||||
|
||||
React.render(
|
||||
<MyProgress />
|
||||
, document.getElementById('components-progress-demo-circle-dynamic'));
|
||||
````
|
||||
|
@ -17,11 +17,3 @@ React.render(
|
||||
</div>
|
||||
, document.getElementById('components-progress-demo-circle-mini'));
|
||||
````
|
||||
|
||||
<style>
|
||||
.ant-progress-circle-wrap,
|
||||
.ant-progress-line-wrap {
|
||||
margin-right: 15px;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
</style>
|
||||
|
@ -1,6 +1,6 @@
|
||||
# 进度圈
|
||||
|
||||
- order: 2
|
||||
- order: 1
|
||||
|
||||
圈形的进度。
|
||||
|
||||
@ -11,9 +11,9 @@ var ProgressCircle = antd.Progress.Circle;
|
||||
|
||||
React.render(
|
||||
<div>
|
||||
<ProgressCircle percent="30" width="126" />
|
||||
<ProgressCircle percent="70" width="126" status="exception" />
|
||||
<ProgressCircle percent="100" width="126" />
|
||||
<ProgressCircle percent="30" />
|
||||
<ProgressCircle percent="70" status="exception" />
|
||||
<ProgressCircle percent="100" />
|
||||
</div>
|
||||
, document.getElementById('components-progress-demo-circle'));
|
||||
````
|
||||
|
@ -27,7 +27,7 @@ var MyProgress = React.createClass({
|
||||
}, 100);
|
||||
},
|
||||
render() {
|
||||
return <Progress percent={this.state.percent} width="300" strokeWidth="3" />;
|
||||
return <Progress percent={this.state.percent} />;
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
# 小型进度条
|
||||
|
||||
- order: 1
|
||||
- order: 2
|
||||
|
||||
适合放在较狭窄的区域内。
|
||||
|
||||
|
@ -11,9 +11,9 @@ var Progress = antd.Progress.Line;
|
||||
|
||||
React.render(
|
||||
<div>
|
||||
<Progress percent="30" width="300" strokeWidth="3" />
|
||||
<Progress percent="70" width="300" strokeWidth="3" status="exception" />
|
||||
<Progress percent="100" width="300" strokeWidth="3" />
|
||||
<Progress percent="30" />
|
||||
<Progress percent="70" status="exception" />
|
||||
<Progress percent="100" />
|
||||
</div>
|
||||
, document.getElementById('components-progress-demo-line'));
|
||||
````
|
||||
|
@ -7,8 +7,9 @@ var React = require('react');
|
||||
var Line = React.createClass({
|
||||
getDefaultProps: function () {
|
||||
return {
|
||||
width: 300,
|
||||
percent: 0,
|
||||
strokeWidth: 4,
|
||||
strokeWidth: 3,
|
||||
status: 'normal' // exception
|
||||
};
|
||||
},
|
||||
@ -26,8 +27,9 @@ var Line = React.createClass({
|
||||
var style = {
|
||||
'width': this.props.width
|
||||
};
|
||||
var wrapStyle = {
|
||||
'font-size': this.props.width / 100 * this.props.strokeWidth
|
||||
var fontSize = (this.props.width / 100 * this.props.strokeWidth);
|
||||
var iconStyle = {
|
||||
'font-size': (fontSize < 14) ? 14 : fontSize
|
||||
};
|
||||
var textStyle = {
|
||||
'color': statusColorMap[this.props.status]
|
||||
@ -36,13 +38,14 @@ var Line = React.createClass({
|
||||
if (this.props.status === 'exception') {
|
||||
progressInfo = (
|
||||
<span style={textStyle} className='ant-progress-line-text'>
|
||||
<i className='anticon anticon-exclamation-round'></i>
|
||||
<i style={iconStyle} className='anticon anticon-exclamation-round'></i>
|
||||
</span>
|
||||
);
|
||||
|
||||
} else if(this.props.status === 'success'){
|
||||
progressInfo = (
|
||||
<span style={textStyle} className='ant-progress-line-text'>
|
||||
<i className='anticon anticon-check-round'></i>
|
||||
<i style={iconStyle} className='anticon anticon-check-round'></i>
|
||||
</span>
|
||||
);
|
||||
}else {
|
||||
@ -52,7 +55,7 @@ var Line = React.createClass({
|
||||
}
|
||||
|
||||
return (
|
||||
<div className='ant-progress-line-wrap' style={wrapStyle}>
|
||||
<div className='ant-progress-line-wrap' >
|
||||
<div className='ant-progress-line-inner' style={style}>
|
||||
<Progressline percent={this.props.percent} strokeWidth={this.props.strokeWidth}
|
||||
strokeColor={statusColorMap[this.props.status]} trailColor="#e9e9e9" />
|
||||
@ -66,6 +69,7 @@ var Line = React.createClass({
|
||||
var Circle = React.createClass({
|
||||
getDefaultProps: function () {
|
||||
return {
|
||||
width: 126,
|
||||
percent: 0,
|
||||
strokeWidth: 4,
|
||||
status: 'normal' // exception
|
||||
@ -87,7 +91,7 @@ var Circle = React.createClass({
|
||||
'height': this.props.width
|
||||
};
|
||||
var wrapStyle = {
|
||||
'font-size': this.props.width * 0.3
|
||||
'font-size': this.props.width * 0.2
|
||||
};
|
||||
var textStyle = {
|
||||
'color': statusColorMap[this.props.status]
|
||||
@ -99,6 +103,12 @@ var Circle = React.createClass({
|
||||
<i className='anticon anticon-exclamation'></i>
|
||||
</span>
|
||||
);
|
||||
}else if(this.props.status === 'success'){
|
||||
progressInfo = (
|
||||
<span style={textStyle} className='ant-progress-circle-text'>
|
||||
<i className="anticon anticon-check"></i>
|
||||
</span>
|
||||
);
|
||||
}else {
|
||||
progressInfo = (
|
||||
<span className="ant-progress-circle-text">{this.props.percent}%</span>
|
||||
|
@ -148,13 +148,13 @@
|
||||
text-align: center;
|
||||
|
||||
&:hover {
|
||||
background: #ebfaff;
|
||||
background: fadeout(#3fc7fa, 90%);
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
&-today &-date {
|
||||
background: #FFE3CA;
|
||||
color: #3fc7fa;
|
||||
}
|
||||
|
||||
&-selected-day &-date {
|
||||
|
@ -5,6 +5,10 @@
|
||||
&-circle-wrap {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
&-line-wrap {
|
||||
font-size: 12px;
|
||||
}
|
||||
&-line-inner {
|
||||
display: inline-block;
|
||||
|
||||
@ -20,7 +24,7 @@
|
||||
line-height: 1;
|
||||
|
||||
.anticon {
|
||||
font-size: 1.5em;
|
||||
font-size: 1.2em;
|
||||
}
|
||||
}
|
||||
|
||||
@ -35,11 +39,11 @@
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
line-height: 1;
|
||||
top: 33%;
|
||||
top: 38%;
|
||||
left: 0;
|
||||
|
||||
.anticon {
|
||||
font-size: 1em;
|
||||
font-size: 14/12em;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -43,8 +43,7 @@ module.exports = {
|
||||
},
|
||||
|
||||
plugins: [
|
||||
new ExtractTextPlugin('[name].css'),
|
||||
new webpack.NewWatchingPlugin()
|
||||
new ExtractTextPlugin('[name].css')
|
||||
],
|
||||
|
||||
devtool: '#source-map'
|
||||
|
Loading…
Reference in New Issue
Block a user