mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-11-30 11:08:45 +08:00
Imporve tree and tree-select type definitions
This commit is contained in:
parent
cbaf54415e
commit
6837aedf69
@ -66,6 +66,10 @@ export interface OptGroupProps {
|
||||
label?: React.ReactNode;
|
||||
}
|
||||
|
||||
export interface SelectLocale {
|
||||
notFoundContent?: string;
|
||||
}
|
||||
|
||||
const SelectPropTypes = {
|
||||
prefixCls: PropTypes.string,
|
||||
className: PropTypes.string,
|
||||
|
@ -2,6 +2,7 @@ import * as React from 'react';
|
||||
import RcTreeSelect, { TreeNode, SHOW_ALL, SHOW_PARENT, SHOW_CHILD } from 'rc-tree-select';
|
||||
import classNames from 'classnames';
|
||||
import { TreeSelectProps } from './interface';
|
||||
import { SelectLocale } from '../select';
|
||||
import LocaleReceiver from '../locale-provider/LocaleReceiver';
|
||||
import warning from '../_util/warning';
|
||||
|
||||
@ -23,7 +24,7 @@ export default class TreeSelect extends React.Component<TreeSelectProps, any> {
|
||||
|
||||
private rcTreeSelect: any;
|
||||
|
||||
constructor(props) {
|
||||
constructor(props: TreeSelectProps) {
|
||||
super(props);
|
||||
|
||||
warning(
|
||||
@ -40,11 +41,11 @@ export default class TreeSelect extends React.Component<TreeSelectProps, any> {
|
||||
this.rcTreeSelect.blur();
|
||||
}
|
||||
|
||||
saveTreeSelect = (node) => {
|
||||
saveTreeSelect = (node: typeof RcTreeSelect) => {
|
||||
this.rcTreeSelect = node;
|
||||
}
|
||||
|
||||
renderTreeSelect = (locale) => {
|
||||
renderTreeSelect = (locale: SelectLocale) => {
|
||||
const {
|
||||
prefixCls,
|
||||
className,
|
||||
|
@ -10,11 +10,7 @@ export interface AntTreeNodeProps {
|
||||
isLeaf?: boolean;
|
||||
}
|
||||
|
||||
export class AntTreeNode extends React.Component<AntTreeNodeProps, {}> {
|
||||
render() {
|
||||
return <AntTreeNode {...this.props} />;
|
||||
}
|
||||
}
|
||||
export interface AntTreeNode extends React.Component<AntTreeNodeProps, {}> {}
|
||||
|
||||
export interface AntTreeNodeEvent {
|
||||
event: 'check' | 'select';
|
||||
|
Loading…
Reference in New Issue
Block a user