mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-29 13:47:02 +08:00
Merge branch 'develop-1.0.0' of github.com:ant-design/ant-design into develop-1.0.0
This commit is contained in:
commit
dab9259c7c
@ -7,8 +7,9 @@ title: 所有组件
|
||||
|
||||
````jsx
|
||||
import { LocaleProvider, Pagination, DatePicker, TimePicker, Calendar,
|
||||
Popconfirm, Table, Modal, Button, Select, Transfer } from 'antd';
|
||||
Popconfirm, Table, Modal, Button, Select, Transfer, Radio } from 'antd';
|
||||
import enUS from 'antd/lib/locale-provider/en_US';
|
||||
import ruRU from 'antd/lib/locale-provider/ru_RU';
|
||||
const Option = Select.Option;
|
||||
const RangePicker = DatePicker.RangePicker;
|
||||
|
||||
@ -55,6 +56,10 @@ const Page = React.createClass({
|
||||
<Pagination defaultCurrent={1} total={50} showSizeChanger />
|
||||
</div>
|
||||
<div className="example">
|
||||
<Select showSearch style={{ width: 200 }}>
|
||||
<Option value="jack">jack</Option>
|
||||
<Option value="lucy">lucy</Option>
|
||||
</Select>
|
||||
<DatePicker />
|
||||
<TimePicker />
|
||||
<RangePicker style={{ width: 200 }} />
|
||||
@ -95,18 +100,19 @@ const App = React.createClass({
|
||||
locale: enUS,
|
||||
};
|
||||
},
|
||||
changeLocale(locale) {
|
||||
this.setState({ locale });
|
||||
changeLocale(e) {
|
||||
this.setState({ locale: e.target.value });
|
||||
},
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
<div className="change-locale">
|
||||
<span>Change locale of components: </span>
|
||||
<Select defaultValue={enUS} onChange={this.changeLocale} dropdownMatchSelectWidth={false}>
|
||||
<Option value={enUS}>English</Option>
|
||||
<Option value={null}>中文</Option>
|
||||
</Select>
|
||||
<span style={{ marginRight: 16 }}>Change locale of components: </span>
|
||||
<Radio.Group defaultValue={enUS} onChange={this.changeLocale}>
|
||||
<Radio.Button key="en" value={enUS}>English</Radio.Button>
|
||||
<Radio.Button key="ru" value={ruRU}>русский язык</Radio.Button>
|
||||
<Radio.Button key="cn" value={null}>中文</Radio.Button>
|
||||
</Radio.Group>
|
||||
</div>
|
||||
<LocaleProvider locale={this.state.locale}><Page /></LocaleProvider>
|
||||
</div>
|
||||
|
@ -29,4 +29,7 @@ export default {
|
||||
itemUnit: 'item',
|
||||
itemsUnit: 'items',
|
||||
},
|
||||
Select: {
|
||||
notFoundContent: 'Not Found',
|
||||
},
|
||||
};
|
||||
|
@ -33,4 +33,7 @@ export default {
|
||||
itemUnit: 'item',
|
||||
itemsUnit: 'items',
|
||||
},
|
||||
Select: {
|
||||
notFoundContent: 'Not Found',
|
||||
},
|
||||
};
|
||||
|
@ -14,6 +14,10 @@ export default class Select extends React.Component {
|
||||
showSearch: false,
|
||||
}
|
||||
|
||||
static contextTypes = {
|
||||
antLocale: React.PropTypes.object,
|
||||
}
|
||||
|
||||
render() {
|
||||
let {
|
||||
size, className, combobox, notFoundContent, prefixCls, showSearch, optionLabelProp,
|
||||
@ -26,6 +30,11 @@ export default class Select extends React.Component {
|
||||
[`${prefixCls}-show-search`]: showSearch,
|
||||
});
|
||||
|
||||
const { antLocale } = this.context;
|
||||
if (antLocale && antLocale.Select) {
|
||||
notFoundContent = notFoundContent || antLocale.Select.notFoundContent;
|
||||
}
|
||||
|
||||
if (combobox) {
|
||||
notFoundContent = null;
|
||||
// children 带 dom 结构时,无法填入输入框
|
||||
|
@ -13,6 +13,11 @@ export default class TreeSelect extends React.Component {
|
||||
transitionName: 'slide-up',
|
||||
choiceTransitionName: 'zoom',
|
||||
showSearch: false,
|
||||
dropdownClassName: 'ant-select-tree-dropdown',
|
||||
}
|
||||
|
||||
static contextTypes = {
|
||||
antLocale: React.PropTypes.object,
|
||||
}
|
||||
|
||||
render() {
|
||||
@ -27,6 +32,11 @@ export default class TreeSelect extends React.Component {
|
||||
[className]: !!className,
|
||||
});
|
||||
|
||||
const { antLocale } = this.context;
|
||||
if (antLocale && antLocale.Select) {
|
||||
notFoundContent = notFoundContent || antLocale.Select.notFoundContent;
|
||||
}
|
||||
|
||||
if (combobox) {
|
||||
notFoundContent = null;
|
||||
}
|
||||
|
@ -19,8 +19,7 @@
|
||||
outline: 0;
|
||||
&.filter-node {
|
||||
> a {
|
||||
color: @error-color!important;
|
||||
font-weight: bold!important;
|
||||
font-weight: bold !important;
|
||||
}
|
||||
}
|
||||
ul {
|
||||
@ -113,3 +112,10 @@
|
||||
vertical-align: top;
|
||||
}
|
||||
}
|
||||
|
||||
.@{select-tree-prefix-cls}-dropdown .ant-select-dropdown-search + span {
|
||||
padding: 7px 15px;
|
||||
color: #ccc;
|
||||
cursor: not-allowed;
|
||||
display: block;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user