mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-11 14:48:19 +08:00
Merge branch 'master' of gitlab.alipay-inc.com:react-ui/ant-design
This commit is contained in:
commit
288d5ff2bc
@ -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, {
|
||||
render() {
|
||||
const customLocale = {
|
||||
timezoneOffset: 0 * 60,
|
||||
firstDayOfWeek: 0,
|
||||
minimalDaysInFirstWeek: 1,
|
||||
})
|
||||
};
|
||||
},
|
||||
render() {
|
||||
return <DatePicker locale={this.state.locale} />;
|
||||
return <DatePicker locale={{ ...enUS, ...customLocale }} />;
|
||||
}
|
||||
});
|
||||
|
||||
ReactDOM.render(<App />, mountNode);
|
||||
````
|
||||
|
||||
|
@ -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()
|
||||
)
|
||||
),
|
||||
];
|
||||
|
@ -49,7 +49,7 @@ const rowSelection = {
|
||||
},
|
||||
onSelectAll(selected, selectedRows, changeRows) {
|
||||
console.log(selected, selectedRows, changeRows);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
ReactDOM.render(<Table rowSelection={rowSelection} columns={columns} dataSource={data} />
|
||||
|
@ -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)} />
|
||||
);
|
||||
},
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user