ant-design/components/select/index.jsx

39 lines
826 B
React
Raw Normal View History

import React from 'react';
import RcSelect, { Option, OptGroup } from 'rc-select';
2015-12-06 17:13:06 +08:00
import classNames from 'classnames';
2015-06-09 21:16:59 +08:00
export default class Select extends React.Component {
2015-07-24 16:05:56 +08:00
render() {
2015-12-06 17:13:06 +08:00
let {
size, className, combobox, notFoundContent
} = this.props;
2015-11-12 21:28:02 +08:00
2015-12-06 17:13:06 +08:00
const cls = classNames({
'ant-select-lg': size === 'large',
'ant-select-sm': size === 'small',
[className]: !!className,
});
2015-11-12 21:28:02 +08:00
2015-12-06 17:13:06 +08:00
if (combobox) {
notFoundContent = null;
2015-08-23 16:00:05 +08:00
}
2015-12-06 17:13:06 +08:00
2015-06-15 17:17:23 +08:00
return (
<RcSelect {...this.props}
2015-12-06 17:13:06 +08:00
className={cls}
notFoundContent={notFoundContent} />
2015-06-15 17:17:23 +08:00
);
}
}
2015-07-29 12:50:41 +08:00
Select.defaultProps = {
prefixCls: 'ant-select',
transitionName: 'slide-up',
optionLabelProp: 'children',
choiceTransitionName: 'zoom',
showSearch: false,
};
2015-07-29 12:50:41 +08:00
Select.Option = Option;
Select.OptGroup = OptGroup;