Merge branch 'master' of gitlab.alipay-inc.com:react-ui/ant-design

This commit is contained in:
本杰 2016-04-27 14:53:43 +08:00
commit 288d5ff2bc
7 changed files with 32 additions and 20 deletions

View File

@ -2,30 +2,24 @@
- order: 10
通过 `locale` 配置时区、语言等, 默认支持 en_US, zh_CN
通过 `locale` 配置时区、语言等, 默认支持 `en_US``zh_CN`。
---
````jsx
import { DatePicker } from 'antd';
import enUS from 'antd/lib/date-picker/locale/en_US';
import assign from 'object-assign';
const App = React.createClass({
getInitialState() {
return {
locale: assign({}, enUS, {
timezoneOffset: 0 * 60,
firstDayOfWeek: 0,
minimalDaysInFirstWeek: 1,
})
};
},
render() {
return <DatePicker locale={this.state.locale} />;
const customLocale = {
timezoneOffset: 0 * 60,
firstDayOfWeek: 0,
minimalDaysInFirstWeek: 1,
};
return <DatePicker locale={{ ...enUS, ...customLocale }} />;
}
});
ReactDOM.render(<App />, mountNode);
````

View File

@ -47,6 +47,11 @@ class FormItem extends React.Component {
);
}
renderExtra() {
const { prefixCls, extra } = this.props;
return <div className={prefixClsFn(prefixCls, 'extra')}>{extra}</div>;
}
getValidateStatus() {
const { isFieldValidating, getFieldError, getFieldValue } = this.context.form;
const field = this.getId();
@ -142,7 +147,7 @@ class FormItem extends React.Component {
this.renderValidateWrapper(
children,
this.renderHelp(),
props.extra
this.renderExtra()
)
),
];

View File

@ -49,7 +49,7 @@ const rowSelection = {
},
onSelectAll(selected, selectedRows, changeRows) {
console.log(selected, selectedRows, changeRows);
}
},
};
ReactDOM.render(<Table rowSelection={rowSelection} columns={columns} dataSource={data} />

View File

@ -13,6 +13,11 @@ import { flatArray } from './util';
function noop() {
}
function stopPropagation(e) {
e.stopPropagation();
e.nativeEvent.stopImmediatePropagation();
}
const defaultLocale = {
filterTitle: '筛选',
filterConfirm: '确定',
@ -31,7 +36,7 @@ let AntTable = React.createClass({
getInitialState() {
return {
//
selectedRowKeys: this.props.selectedRowKeys || [],
selectedRowKeys: (this.props.rowSelection || {}).selectedRowKeys || [],
filters: {},
selectionDirty: false,
sortColumn: '',
@ -305,7 +310,7 @@ let AntTable = React.createClass({
this.getDefaultSelection().indexOf(rowIndex) >= 0);
}
return (
<Radio disabled={props.disabled}
<Radio disabled={props.disabled} onClick={stopPropagation}
onChange={this.handleRadioSelect.bind(this, record, rowIndex)}
value={rowIndex} checked={checked} />
);
@ -325,7 +330,7 @@ let AntTable = React.createClass({
props = this.props.rowSelection.getCheckboxProps.call(this, record);
}
return (
<Checkbox checked={checked} disabled={props.disabled}
<Checkbox checked={checked} disabled={props.disabled} onClick={stopPropagation}
onChange={this.handleSelect.bind(this, record, rowIndex)} />
);
},

View File

@ -48,12 +48,15 @@
}
}
&-anim-active {
transition: height .2s @ease-out;
}
&-content {
overflow: hidden;
color: @text-color;
padding: 0 16px;
background-color: #fff;
transition: height .2s @ease-out;
& > &-box {
padding-top: 16px;

View File

@ -102,6 +102,11 @@ input[type="checkbox"] {
margin-top: 3px;
}
.@{css-prefix}form-explain,
.@{css-prefix}form-extra {
color: #999;
}
.@{css-prefix}form-text {
display: inline-block;
padding-right: 8px;

View File

@ -22,7 +22,7 @@
// ICONFONT
@iconfont-css-prefix : anticon;
@icon-url : "//at.alicdn.com/t/font_1457169990_5499172";
@icon-url : "//at.alicdn.com/t/font_1461567603_8950496";
// LINK
@link-color : #2db7f5;