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
|
- order: 10
|
||||||
|
|
||||||
通过 `locale` 配置时区、语言等, 默认支持 en_US, zh_CN
|
通过 `locale` 配置时区、语言等, 默认支持 `en_US`,`zh_CN`。
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
````jsx
|
````jsx
|
||||||
import { DatePicker } from 'antd';
|
import { DatePicker } from 'antd';
|
||||||
import enUS from 'antd/lib/date-picker/locale/en_US';
|
import enUS from 'antd/lib/date-picker/locale/en_US';
|
||||||
import assign from 'object-assign';
|
|
||||||
|
|
||||||
const App = React.createClass({
|
const App = React.createClass({
|
||||||
getInitialState() {
|
render() {
|
||||||
return {
|
const customLocale = {
|
||||||
locale: assign({}, enUS, {
|
|
||||||
timezoneOffset: 0 * 60,
|
timezoneOffset: 0 * 60,
|
||||||
firstDayOfWeek: 0,
|
firstDayOfWeek: 0,
|
||||||
minimalDaysInFirstWeek: 1,
|
minimalDaysInFirstWeek: 1,
|
||||||
})
|
|
||||||
};
|
};
|
||||||
},
|
return <DatePicker locale={{ ...enUS, ...customLocale }} />;
|
||||||
render() {
|
|
||||||
return <DatePicker locale={this.state.locale} />;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
ReactDOM.render(<App />, mountNode);
|
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() {
|
getValidateStatus() {
|
||||||
const { isFieldValidating, getFieldError, getFieldValue } = this.context.form;
|
const { isFieldValidating, getFieldError, getFieldValue } = this.context.form;
|
||||||
const field = this.getId();
|
const field = this.getId();
|
||||||
@ -142,7 +147,7 @@ class FormItem extends React.Component {
|
|||||||
this.renderValidateWrapper(
|
this.renderValidateWrapper(
|
||||||
children,
|
children,
|
||||||
this.renderHelp(),
|
this.renderHelp(),
|
||||||
props.extra
|
this.renderExtra()
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
|
@ -49,7 +49,7 @@ const rowSelection = {
|
|||||||
},
|
},
|
||||||
onSelectAll(selected, selectedRows, changeRows) {
|
onSelectAll(selected, selectedRows, changeRows) {
|
||||||
console.log(selected, selectedRows, changeRows);
|
console.log(selected, selectedRows, changeRows);
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
ReactDOM.render(<Table rowSelection={rowSelection} columns={columns} dataSource={data} />
|
ReactDOM.render(<Table rowSelection={rowSelection} columns={columns} dataSource={data} />
|
||||||
|
@ -13,6 +13,11 @@ import { flatArray } from './util';
|
|||||||
function noop() {
|
function noop() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function stopPropagation(e) {
|
||||||
|
e.stopPropagation();
|
||||||
|
e.nativeEvent.stopImmediatePropagation();
|
||||||
|
}
|
||||||
|
|
||||||
const defaultLocale = {
|
const defaultLocale = {
|
||||||
filterTitle: '筛选',
|
filterTitle: '筛选',
|
||||||
filterConfirm: '确定',
|
filterConfirm: '确定',
|
||||||
@ -31,7 +36,7 @@ let AntTable = React.createClass({
|
|||||||
getInitialState() {
|
getInitialState() {
|
||||||
return {
|
return {
|
||||||
// 减少状态
|
// 减少状态
|
||||||
selectedRowKeys: this.props.selectedRowKeys || [],
|
selectedRowKeys: (this.props.rowSelection || {}).selectedRowKeys || [],
|
||||||
filters: {},
|
filters: {},
|
||||||
selectionDirty: false,
|
selectionDirty: false,
|
||||||
sortColumn: '',
|
sortColumn: '',
|
||||||
@ -305,7 +310,7 @@ let AntTable = React.createClass({
|
|||||||
this.getDefaultSelection().indexOf(rowIndex) >= 0);
|
this.getDefaultSelection().indexOf(rowIndex) >= 0);
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<Radio disabled={props.disabled}
|
<Radio disabled={props.disabled} onClick={stopPropagation}
|
||||||
onChange={this.handleRadioSelect.bind(this, record, rowIndex)}
|
onChange={this.handleRadioSelect.bind(this, record, rowIndex)}
|
||||||
value={rowIndex} checked={checked} />
|
value={rowIndex} checked={checked} />
|
||||||
);
|
);
|
||||||
@ -325,7 +330,7 @@ let AntTable = React.createClass({
|
|||||||
props = this.props.rowSelection.getCheckboxProps.call(this, record);
|
props = this.props.rowSelection.getCheckboxProps.call(this, record);
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<Checkbox checked={checked} disabled={props.disabled}
|
<Checkbox checked={checked} disabled={props.disabled} onClick={stopPropagation}
|
||||||
onChange={this.handleSelect.bind(this, record, rowIndex)} />
|
onChange={this.handleSelect.bind(this, record, rowIndex)} />
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
@ -48,12 +48,15 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&-anim-active {
|
||||||
|
transition: height .2s @ease-out;
|
||||||
|
}
|
||||||
|
|
||||||
&-content {
|
&-content {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
color: @text-color;
|
color: @text-color;
|
||||||
padding: 0 16px;
|
padding: 0 16px;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
transition: height .2s @ease-out;
|
|
||||||
|
|
||||||
& > &-box {
|
& > &-box {
|
||||||
padding-top: 16px;
|
padding-top: 16px;
|
||||||
|
@ -102,6 +102,11 @@ input[type="checkbox"] {
|
|||||||
margin-top: 3px;
|
margin-top: 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.@{css-prefix}form-explain,
|
||||||
|
.@{css-prefix}form-extra {
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
|
||||||
.@{css-prefix}form-text {
|
.@{css-prefix}form-text {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
padding-right: 8px;
|
padding-right: 8px;
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
// ICONFONT
|
// ICONFONT
|
||||||
@iconfont-css-prefix : anticon;
|
@iconfont-css-prefix : anticon;
|
||||||
@icon-url : "//at.alicdn.com/t/font_1457169990_5499172";
|
@icon-url : "//at.alicdn.com/t/font_1461567603_8950496";
|
||||||
|
|
||||||
// LINK
|
// LINK
|
||||||
@link-color : #2db7f5;
|
@link-color : #2db7f5;
|
||||||
|
Loading…
Reference in New Issue
Block a user