You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.2 KiB

9 years ago
import React from 'react';
import TreeSelect, { TreeNode } from 'rc-tree-select';
import classNames from 'classnames';
9 years ago
// import animation from '../common/openAnimation';
9 years ago
const AntTreeSelect = React.createClass({
getDefaultProps() {
return {
9 years ago
prefixCls: 'ant-tree-select',
9 years ago
transitionName: 'slide-up',
optionLabelProp: 'value',
choiceTransitionName: 'zoom',
showSearch: false,
9 years ago
size: 'default',
// openAnimation: animation,
9 years ago
};
},
render() {
const props = this.props;
let {
size, className, combobox, notFoundContent
} = this.props;
const cls = classNames({
'ant-tree-select-lg': size === 'large',
'ant-tree-select-sm': size === 'small',
9 years ago
[className]: !!className,
});
if (combobox) {
notFoundContent = null;
}
9 years ago
let checkable = props.treeCheckable;
9 years ago
if (checkable) {
9 years ago
checkable = <span className={`${props.prefixCls}-tree-checkbox-inner`}></span>;
9 years ago
}
return (
<TreeSelect {...this.props}
9 years ago
treeCheckable={checkable}
9 years ago
className={cls}
notFoundContent={notFoundContent} />
);
}
});
AntTreeSelect.TreeNode = TreeNode;
export default AntTreeSelect;