ant-design/components/select/index.jsx

30 lines
677 B
React
Raw Normal View History

import React from 'react';
import Select from 'rc-select';
2015-06-09 21:16:59 +08:00
2015-07-29 12:50:41 +08:00
var AntSelect = React.createClass({
2015-07-24 16:05:56 +08:00
getDefaultProps() {
2015-06-15 17:17:23 +08:00
return {
2015-06-15 21:18:08 +08:00
prefixCls: 'ant-select',
2015-06-16 14:54:31 +08:00
transitionName: 'slide-up',
optionLabelProp: 'children',
2015-06-16 14:54:31 +08:00
showSearch: false
2015-06-15 17:17:23 +08:00
};
},
2015-07-24 16:05:56 +08:00
render() {
2015-08-10 15:39:50 +08:00
var sizeClass = '';
if (this.props.size === 'large') {
sizeClass = 'ant-select-lg';
} else if (this.props.size === 'small') {
sizeClass = 'ant-select-sm';
2015-08-10 13:22:50 +08:00
}
2015-06-15 17:17:23 +08:00
return (
2015-08-22 14:23:58 +08:00
<Select {...this.props} className={this.props.className + ' ' + sizeClass} />
2015-06-15 17:17:23 +08:00
);
}
});
2015-07-29 12:50:41 +08:00
AntSelect.Option = Select.Option;
2015-08-01 17:51:55 +08:00
AntSelect.OptGroup = Select.OptGroup;
2015-07-29 12:50:41 +08:00
export default AntSelect;