mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-01 03:29:39 +08:00
43 lines
894 B
JavaScript
43 lines
894 B
JavaScript
import React from 'react';
|
|
import Select from 'rc-select';
|
|
import classNames from 'classnames';
|
|
|
|
const AntSelect = React.createClass({
|
|
getDefaultProps() {
|
|
return {
|
|
prefixCls: 'ant-select',
|
|
transitionName: 'slide-up',
|
|
optionLabelProp: 'children',
|
|
choiceTransitionName: 'zoom',
|
|
showSearch: false,
|
|
size: 'default'
|
|
};
|
|
},
|
|
render() {
|
|
let {
|
|
size, className, combobox, notFoundContent
|
|
} = this.props;
|
|
|
|
const cls = classNames({
|
|
'ant-select-lg': size === 'large',
|
|
'ant-select-sm': size === 'small',
|
|
[className]: !!className,
|
|
});
|
|
|
|
if (combobox) {
|
|
notFoundContent = null;
|
|
}
|
|
|
|
return (
|
|
<Select {...this.props}
|
|
className={cls}
|
|
notFoundContent={notFoundContent} />
|
|
);
|
|
}
|
|
});
|
|
|
|
AntSelect.Option = Select.Option;
|
|
AntSelect.OptGroup = Select.OptGroup;
|
|
|
|
export default AntSelect;
|