Merge branch 'master' of github.com:ant-design/ant-design

This commit is contained in:
偏右 2016-04-08 17:21:10 +08:00
commit 8abe21bccb
14 changed files with 32 additions and 35 deletions

View File

@ -73,7 +73,8 @@ export default React.createClass({
if (showTime) {
timePicker = (<TimePicker
prefixCls="ant-time-picker"
placeholder={locale.lang.timePlaceholder}
placeholder={locale.timePickerLocale.placeholder}
locale={locale.timePickerLocale}
transitionName="slide-up" />);
}

View File

@ -60,7 +60,8 @@ function createPicker(TheCalendar, defaultFormat) {
const timePicker = this.props.showTime ? (<TimePicker
prefixCls="ant-time-picker"
placeholder={locale.lang.timePlaceholder}
placeholder={locale.timePickerLocale.placeholder}
locale={locale.timePickerLocale}
transitionName="slide-up" />)
: null;

View File

@ -1,14 +1,16 @@
import objectAssign from 'object-assign';
import GregorianCalendarLocale from 'gregorian-calendar/lib/locale/en_US';
import CalendarLocale from 'rc-calendar/lib/locale/en_US';
import TimePickerLocale from '../../time-picker/locale/en_US';
// 统一合并为完整的 Locale
let locale = objectAssign({}, GregorianCalendarLocale);
locale.lang = objectAssign({
placeholder: 'Select date',
timePlaceholder: 'Select time',
}, CalendarLocale);
locale.timePickerLocale = objectAssign({}, TimePickerLocale);
// All settings at:
// https://github.com/ant-design/ant-design/issues/424

View File

@ -1,14 +1,16 @@
import objectAssign from 'object-assign';
import GregorianCalendarLocale from 'gregorian-calendar/lib/locale/zh_CN';
import CalendarLocale from 'rc-calendar/lib/locale/zh_CN';
import TimePickerLocale from '../../time-picker/locale/zh_CN';
// 统一合并为完整的 Locale
let locale = objectAssign({}, GregorianCalendarLocale);
locale.lang = objectAssign({
placeholder: '请选择日期',
timePlaceholder: '请选择时间',
}, CalendarLocale);
locale.timePickerLocale = objectAssign({}, TimePickerLocale);
// should add whitespace between char in Button
locale.lang.ok = '确 定';

View File

@ -27,7 +27,6 @@ const App = React.createClass({
return (
<Menu onClick={this.handleClick}
selectedKeys={[this.state.current]}
theme={this.state.theme}
mode="horizontal">
<Menu.Item key="mail">
<Icon type="mail" />导航一

View File

@ -66,4 +66,3 @@ const Sider = React.createClass({
});
ReactDOM.render(<Sider />, mountNode);
````

View File

@ -14,7 +14,6 @@ const IconSlider = React.createClass({
const max = this.props.max;
const min = this.props.min;
const mid = ((max - min) / 2).toFixed(5);
return {
preIconClass: this.props.value >= mid ? '' : 'anticon-highlight',
nextIconClass: this.props.value >= mid ? 'anticon-highlight' : '',
@ -35,15 +34,15 @@ const IconSlider = React.createClass({
return (
<div className="iconWrapper">
<Icon className={this.state.preIconClass} type={this.props.icon[0]} />
<Icon className={this.state.nextIconClass} type={this.props.icon[1]} />
<Slider {...this.props} onChange={this.handleChange} value={this.state.sliderValue} />
<Icon className={this.state.nextIconClass} type={this.props.icon[1]} />
</div>
);
}
});
ReactDOM.render(
<IconSlider min={0} max={20} value={0} icon={['lock', 'unlock']} />
<IconSlider min={0} max={20} value={0} icon={['frown', 'smile']} />
, mountNode);
````
@ -63,10 +62,11 @@ ReactDOM.render(
color: #ccc;
}
.iconWrapper .anticon-lock {
.iconWrapper .anticon:first-child {
left: 0;
}
.iconWrapper .anticon-unlock{
.iconWrapper .anticon:last-child {
right: 0;
}

View File

@ -1,4 +1,4 @@
# 格式化 `Tooltip` 内容
# 自定义提示
- order: 5

View File

@ -37,7 +37,6 @@ let AntTable = React.createClass({
sortColumn: '',
sortOrder: '',
sorter: null,
radioIndex: null,
pagination: this.hasPagination() ?
objectAssign({
size: this.props.size,
@ -210,7 +209,6 @@ let AntTable = React.createClass({
let key = this.getRecordKey(record, rowIndex);
selectedRowKeys = [key];
this.setState({
radioIndex: key,
selectionDirty: true,
});
this.setSelectedRowKeys(selectedRowKeys);
@ -293,12 +291,6 @@ let AntTable = React.createClass({
}));
},
onRadioChange(ev) {
this.setState({
radioIndex: ev.target.value
});
},
renderSelectionRadio(value, record, index) {
let rowIndex = this.getRecordKey(record, index); // 1
let props = {};
@ -307,9 +299,9 @@ let AntTable = React.createClass({
}
let checked;
if (this.state.selectionDirty) {
checked = this.state.radioIndex === rowIndex;
checked = this.state.selectedRowKeys.indexOf(rowIndex) >= 0;
} else {
checked = (this.state.radioIndex === rowIndex ||
checked = (this.state.selectedRowKeys.indexOf(rowIndex) >= 0 ||
this.getDefaultSelection().indexOf(rowIndex) >= 0);
}
return (

View File

@ -75,6 +75,7 @@
"autoprefixer": "^6.3.3",
"babel-cli": "^6.2.0",
"babel-core": "^6.2.1",
"babel-eslint": "^6.0.2",
"babel-jest": "^6.0.1",
"babel-loader": "^6.2.0",
"babel-plugin-add-module-exports": "^0.1.1",

View File

@ -9,5 +9,5 @@ ghPages.publish(path.join(process.cwd(), '_site'), {
if (err) {
throw err;
}
console.log('Site has been published to http://ant.design');
console.log('Site has been published to http://ant.design 🎉');
});

View File

@ -121,6 +121,10 @@
&.@{menu-prefix-cls}-submenu-disabled {
color: #999 !important;
cursor: not-allowed;
> a {
color: #999 !important;
pointer-events: none;
}
}
}
@ -302,17 +306,19 @@
&-dark&-horizontal > &-item,
&-dark&-horizontal > &-submenu {
border-bottom: 0;
top: 0;
border-color: #404040;
}
&-dark&-horizontal > &-item-active,
&-dark&-horizontal > &-item-selected,
&-dark&-horizontal > &-submenu:hover,
&-dark&-horizontal > &-submenu &-submenu-title:hover {
&,
& > a {
color: #fff;
transform: translateZ(0);
}
}
&-dark &-item > a {
color: #999;
@ -341,6 +347,7 @@
}
&-dark &-item-active,
&-dark &-submenu-active,
&-dark &-submenu-title:hover {
background-color: transparent;
color: @primary-color;

View File

@ -407,14 +407,6 @@
overflow: hidden;
transition: background 0.3s ease;
&:first-child {
border-top-left-radius: 4px;
border-top-right-radius: 4px;
}
&:last-child {
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
}
&:hover,
&-active {
background-color: tint(@primary-color, 90%);

View File

@ -133,6 +133,7 @@
table {
border: 1px solid @border-color-split;
padding: 0 8px;
border-radius: @border-radius-base;
}
th {