mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-15 00:29:12 +08:00
Merge branch 'master' of github.com:ant-design/ant-design
This commit is contained in:
commit
8abe21bccb
@ -73,7 +73,8 @@ export default React.createClass({
|
|||||||
if (showTime) {
|
if (showTime) {
|
||||||
timePicker = (<TimePicker
|
timePicker = (<TimePicker
|
||||||
prefixCls="ant-time-picker"
|
prefixCls="ant-time-picker"
|
||||||
placeholder={locale.lang.timePlaceholder}
|
placeholder={locale.timePickerLocale.placeholder}
|
||||||
|
locale={locale.timePickerLocale}
|
||||||
transitionName="slide-up" />);
|
transitionName="slide-up" />);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,7 +60,8 @@ function createPicker(TheCalendar, defaultFormat) {
|
|||||||
|
|
||||||
const timePicker = this.props.showTime ? (<TimePicker
|
const timePicker = this.props.showTime ? (<TimePicker
|
||||||
prefixCls="ant-time-picker"
|
prefixCls="ant-time-picker"
|
||||||
placeholder={locale.lang.timePlaceholder}
|
placeholder={locale.timePickerLocale.placeholder}
|
||||||
|
locale={locale.timePickerLocale}
|
||||||
transitionName="slide-up" />)
|
transitionName="slide-up" />)
|
||||||
: null;
|
: null;
|
||||||
|
|
||||||
|
@ -1,14 +1,16 @@
|
|||||||
import objectAssign from 'object-assign';
|
import objectAssign from 'object-assign';
|
||||||
import GregorianCalendarLocale from 'gregorian-calendar/lib/locale/en_US';
|
import GregorianCalendarLocale from 'gregorian-calendar/lib/locale/en_US';
|
||||||
import CalendarLocale from 'rc-calendar/lib/locale/en_US';
|
import CalendarLocale from 'rc-calendar/lib/locale/en_US';
|
||||||
|
import TimePickerLocale from '../../time-picker/locale/en_US';
|
||||||
|
|
||||||
// 统一合并为完整的 Locale
|
// 统一合并为完整的 Locale
|
||||||
let locale = objectAssign({}, GregorianCalendarLocale);
|
let locale = objectAssign({}, GregorianCalendarLocale);
|
||||||
locale.lang = objectAssign({
|
locale.lang = objectAssign({
|
||||||
placeholder: 'Select date',
|
placeholder: 'Select date',
|
||||||
timePlaceholder: 'Select time',
|
|
||||||
}, CalendarLocale);
|
}, CalendarLocale);
|
||||||
|
|
||||||
|
locale.timePickerLocale = objectAssign({}, TimePickerLocale);
|
||||||
|
|
||||||
// All settings at:
|
// All settings at:
|
||||||
// https://github.com/ant-design/ant-design/issues/424
|
// https://github.com/ant-design/ant-design/issues/424
|
||||||
|
|
||||||
|
@ -1,14 +1,16 @@
|
|||||||
import objectAssign from 'object-assign';
|
import objectAssign from 'object-assign';
|
||||||
import GregorianCalendarLocale from 'gregorian-calendar/lib/locale/zh_CN';
|
import GregorianCalendarLocale from 'gregorian-calendar/lib/locale/zh_CN';
|
||||||
import CalendarLocale from 'rc-calendar/lib/locale/zh_CN';
|
import CalendarLocale from 'rc-calendar/lib/locale/zh_CN';
|
||||||
|
import TimePickerLocale from '../../time-picker/locale/zh_CN';
|
||||||
|
|
||||||
// 统一合并为完整的 Locale
|
// 统一合并为完整的 Locale
|
||||||
let locale = objectAssign({}, GregorianCalendarLocale);
|
let locale = objectAssign({}, GregorianCalendarLocale);
|
||||||
locale.lang = objectAssign({
|
locale.lang = objectAssign({
|
||||||
placeholder: '请选择日期',
|
placeholder: '请选择日期',
|
||||||
timePlaceholder: '请选择时间',
|
|
||||||
}, CalendarLocale);
|
}, CalendarLocale);
|
||||||
|
|
||||||
|
locale.timePickerLocale = objectAssign({}, TimePickerLocale);
|
||||||
|
|
||||||
// should add whitespace between char in Button
|
// should add whitespace between char in Button
|
||||||
locale.lang.ok = '确 定';
|
locale.lang.ok = '确 定';
|
||||||
|
|
||||||
|
@ -27,7 +27,6 @@ const App = React.createClass({
|
|||||||
return (
|
return (
|
||||||
<Menu onClick={this.handleClick}
|
<Menu onClick={this.handleClick}
|
||||||
selectedKeys={[this.state.current]}
|
selectedKeys={[this.state.current]}
|
||||||
theme={this.state.theme}
|
|
||||||
mode="horizontal">
|
mode="horizontal">
|
||||||
<Menu.Item key="mail">
|
<Menu.Item key="mail">
|
||||||
<Icon type="mail" />导航一
|
<Icon type="mail" />导航一
|
||||||
|
@ -66,4 +66,3 @@ const Sider = React.createClass({
|
|||||||
});
|
});
|
||||||
ReactDOM.render(<Sider />, mountNode);
|
ReactDOM.render(<Sider />, mountNode);
|
||||||
````
|
````
|
||||||
|
|
||||||
|
@ -14,7 +14,6 @@ const IconSlider = React.createClass({
|
|||||||
const max = this.props.max;
|
const max = this.props.max;
|
||||||
const min = this.props.min;
|
const min = this.props.min;
|
||||||
const mid = ((max - min) / 2).toFixed(5);
|
const mid = ((max - min) / 2).toFixed(5);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
preIconClass: this.props.value >= mid ? '' : 'anticon-highlight',
|
preIconClass: this.props.value >= mid ? '' : 'anticon-highlight',
|
||||||
nextIconClass: this.props.value >= mid ? 'anticon-highlight' : '',
|
nextIconClass: this.props.value >= mid ? 'anticon-highlight' : '',
|
||||||
@ -35,15 +34,15 @@ const IconSlider = React.createClass({
|
|||||||
return (
|
return (
|
||||||
<div className="iconWrapper">
|
<div className="iconWrapper">
|
||||||
<Icon className={this.state.preIconClass} type={this.props.icon[0]} />
|
<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} />
|
<Slider {...this.props} onChange={this.handleChange} value={this.state.sliderValue} />
|
||||||
|
<Icon className={this.state.nextIconClass} type={this.props.icon[1]} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
ReactDOM.render(
|
ReactDOM.render(
|
||||||
<IconSlider min={0} max={20} value={0} icon={['lock', 'unlock']} />
|
<IconSlider min={0} max={20} value={0} icon={['frown', 'smile']} />
|
||||||
, mountNode);
|
, mountNode);
|
||||||
````
|
````
|
||||||
|
|
||||||
@ -63,10 +62,11 @@ ReactDOM.render(
|
|||||||
color: #ccc;
|
color: #ccc;
|
||||||
}
|
}
|
||||||
|
|
||||||
.iconWrapper .anticon-lock {
|
.iconWrapper .anticon:first-child {
|
||||||
left: 0;
|
left: 0;
|
||||||
}
|
}
|
||||||
.iconWrapper .anticon-unlock{
|
|
||||||
|
.iconWrapper .anticon:last-child {
|
||||||
right: 0;
|
right: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# 格式化 `Tooltip` 内容
|
# 自定义提示
|
||||||
|
|
||||||
- order: 5
|
- order: 5
|
||||||
|
|
||||||
|
@ -37,7 +37,6 @@ let AntTable = React.createClass({
|
|||||||
sortColumn: '',
|
sortColumn: '',
|
||||||
sortOrder: '',
|
sortOrder: '',
|
||||||
sorter: null,
|
sorter: null,
|
||||||
radioIndex: null,
|
|
||||||
pagination: this.hasPagination() ?
|
pagination: this.hasPagination() ?
|
||||||
objectAssign({
|
objectAssign({
|
||||||
size: this.props.size,
|
size: this.props.size,
|
||||||
@ -210,7 +209,6 @@ let AntTable = React.createClass({
|
|||||||
let key = this.getRecordKey(record, rowIndex);
|
let key = this.getRecordKey(record, rowIndex);
|
||||||
selectedRowKeys = [key];
|
selectedRowKeys = [key];
|
||||||
this.setState({
|
this.setState({
|
||||||
radioIndex: key,
|
|
||||||
selectionDirty: true,
|
selectionDirty: true,
|
||||||
});
|
});
|
||||||
this.setSelectedRowKeys(selectedRowKeys);
|
this.setSelectedRowKeys(selectedRowKeys);
|
||||||
@ -293,12 +291,6 @@ let AntTable = React.createClass({
|
|||||||
}));
|
}));
|
||||||
},
|
},
|
||||||
|
|
||||||
onRadioChange(ev) {
|
|
||||||
this.setState({
|
|
||||||
radioIndex: ev.target.value
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
renderSelectionRadio(value, record, index) {
|
renderSelectionRadio(value, record, index) {
|
||||||
let rowIndex = this.getRecordKey(record, index); // 从 1 开始
|
let rowIndex = this.getRecordKey(record, index); // 从 1 开始
|
||||||
let props = {};
|
let props = {};
|
||||||
@ -307,9 +299,9 @@ let AntTable = React.createClass({
|
|||||||
}
|
}
|
||||||
let checked;
|
let checked;
|
||||||
if (this.state.selectionDirty) {
|
if (this.state.selectionDirty) {
|
||||||
checked = this.state.radioIndex === rowIndex;
|
checked = this.state.selectedRowKeys.indexOf(rowIndex) >= 0;
|
||||||
} else {
|
} else {
|
||||||
checked = (this.state.radioIndex === rowIndex ||
|
checked = (this.state.selectedRowKeys.indexOf(rowIndex) >= 0 ||
|
||||||
this.getDefaultSelection().indexOf(rowIndex) >= 0);
|
this.getDefaultSelection().indexOf(rowIndex) >= 0);
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
|
@ -75,6 +75,7 @@
|
|||||||
"autoprefixer": "^6.3.3",
|
"autoprefixer": "^6.3.3",
|
||||||
"babel-cli": "^6.2.0",
|
"babel-cli": "^6.2.0",
|
||||||
"babel-core": "^6.2.1",
|
"babel-core": "^6.2.1",
|
||||||
|
"babel-eslint": "^6.0.2",
|
||||||
"babel-jest": "^6.0.1",
|
"babel-jest": "^6.0.1",
|
||||||
"babel-loader": "^6.2.0",
|
"babel-loader": "^6.2.0",
|
||||||
"babel-plugin-add-module-exports": "^0.1.1",
|
"babel-plugin-add-module-exports": "^0.1.1",
|
||||||
|
@ -9,5 +9,5 @@ ghPages.publish(path.join(process.cwd(), '_site'), {
|
|||||||
if (err) {
|
if (err) {
|
||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
console.log('Site has been published to http://ant.design');
|
console.log('Site has been published to http://ant.design 🎉');
|
||||||
});
|
});
|
||||||
|
@ -121,6 +121,10 @@
|
|||||||
&.@{menu-prefix-cls}-submenu-disabled {
|
&.@{menu-prefix-cls}-submenu-disabled {
|
||||||
color: #999 !important;
|
color: #999 !important;
|
||||||
cursor: not-allowed;
|
cursor: not-allowed;
|
||||||
|
> a {
|
||||||
|
color: #999 !important;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -302,16 +306,18 @@
|
|||||||
|
|
||||||
&-dark&-horizontal > &-item,
|
&-dark&-horizontal > &-item,
|
||||||
&-dark&-horizontal > &-submenu {
|
&-dark&-horizontal > &-submenu {
|
||||||
border-bottom: 0;
|
border-color: #404040;
|
||||||
top: 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
&-dark&-horizontal > &-item-active,
|
&-dark&-horizontal > &-item-active,
|
||||||
&-dark&-horizontal > &-item-selected,
|
&-dark&-horizontal > &-item-selected,
|
||||||
&-dark&-horizontal > &-submenu:hover,
|
&-dark&-horizontal > &-submenu:hover,
|
||||||
&-dark&-horizontal > &-submenu &-submenu-title:hover {
|
&-dark&-horizontal > &-submenu &-submenu-title:hover {
|
||||||
color: #fff;
|
&,
|
||||||
transform: translateZ(0);
|
& > a {
|
||||||
|
color: #fff;
|
||||||
|
transform: translateZ(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&-dark &-item > a {
|
&-dark &-item > a {
|
||||||
@ -341,6 +347,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
&-dark &-item-active,
|
&-dark &-item-active,
|
||||||
|
&-dark &-submenu-active,
|
||||||
&-dark &-submenu-title:hover {
|
&-dark &-submenu-title:hover {
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
color: @primary-color;
|
color: @primary-color;
|
||||||
|
@ -407,14 +407,6 @@
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
transition: background 0.3s ease;
|
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,
|
&:hover,
|
||||||
&-active {
|
&-active {
|
||||||
background-color: tint(@primary-color, 90%);
|
background-color: tint(@primary-color, 90%);
|
||||||
|
@ -133,6 +133,7 @@
|
|||||||
table {
|
table {
|
||||||
border: 1px solid @border-color-split;
|
border: 1px solid @border-color-split;
|
||||||
padding: 0 8px;
|
padding: 0 8px;
|
||||||
|
border-radius: @border-radius-base;
|
||||||
}
|
}
|
||||||
|
|
||||||
th {
|
th {
|
||||||
|
Loading…
Reference in New Issue
Block a user