You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ant-design/components/tree-select/index.jsx

47 lines
1.1 KiB
React

9 years ago
import React from 'react';
import RcTreeSelect, { TreeNode, SHOW_ALL, SHOW_PARENT, SHOW_CHILD } from 'rc-tree-select';
9 years ago
import classNames from 'classnames';
export default class TreeSelect extends React.Component {
static TreeNode = TreeNode;
static SHOW_ALL = SHOW_ALL;
static SHOW_PARENT = SHOW_PARENT;
static SHOW_CHILD = SHOW_CHILD;
static defaultProps = {
prefixCls: 'ant-select',
transitionName: 'slide-up',
choiceTransitionName: 'zoom',
showSearch: false,
}
9 years ago
render() {
const props = this.props;
let {
size, className, combobox, notFoundContent, prefixCls
9 years ago
} = this.props;
const cls = classNames({
[`${prefixCls}-lg`]: size === 'large',
[`${prefixCls}-sm`]: size === 'small',
9 years ago
[className]: !!className,
});
if (combobox) {
notFoundContent = null;
}
9 years ago
let checkable = props.treeCheckable;
9 years ago
if (checkable) {
checkable = <span className={`${prefixCls}-tree-checkbox-inner`}></span>;
9 years ago
}
return (
<RcTreeSelect {...this.props}
9 years ago
treeCheckable={checkable}
9 years ago
className={cls}
notFoundContent={notFoundContent} />
);
}
}