TreeSelect.d.ts
2.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import * as React from 'react';
import { SelectProps, RefSelectProps } from 'rc-select/lib/generate';
import { IconType } from 'rc-tree/lib/interface';
import { FilterFunc } from 'rc-select/lib/interface/generator';
import { Key, DefaultValueType, DataNode, LabelValueType, SimpleModeConfig, ChangeEventExtra, LegacyDataNode } from './interface';
import { CheckedStrategy, SHOW_ALL, SHOW_PARENT, SHOW_CHILD } from './utils/strategyUtil';
export interface TreeSelectProps<ValueType = DefaultValueType> extends Omit<SelectProps<DataNode[], ValueType>, 'onChange' | 'mode' | 'menuItemSelectedIcon' | 'dropdownAlign' | 'backfill' | 'getInputElement' | 'optionLabelProp' | 'tokenSeparators' | 'filterOption'> {
multiple?: boolean;
showArrow?: boolean;
showSearch?: boolean;
open?: boolean;
defaultOpen?: boolean;
value?: ValueType;
defaultValue?: ValueType;
disabled?: boolean;
placeholder?: React.ReactNode;
/** @deprecated Use `searchValue` instead */
inputValue?: string;
searchValue?: string;
autoClearSearchValue?: boolean;
maxTagTextLength?: number;
maxTagCount?: number;
maxTagPlaceholder?: (omittedValues: LabelValueType[]) => React.ReactNode;
loadData?: (dataNode: LegacyDataNode) => Promise<unknown>;
treeNodeFilterProp?: string;
treeNodeLabelProp?: string;
treeDataSimpleMode?: boolean | SimpleModeConfig;
treeExpandedKeys?: Key[];
treeDefaultExpandedKeys?: Key[];
treeLoadedKeys?: Key[];
treeCheckable?: boolean | React.ReactNode;
treeCheckStrictly?: boolean;
showCheckedStrategy?: CheckedStrategy;
treeDefaultExpandAll?: boolean;
treeData?: DataNode[];
treeLine?: boolean;
treeIcon?: IconType;
showTreeIcon?: boolean;
switcherIcon?: IconType;
treeMotion?: any;
children?: React.ReactNode;
filterTreeNode?: boolean | FilterFunc<LegacyDataNode>;
dropdownPopupAlign?: any;
onSearch?: (value: string) => void;
onChange?: (value: ValueType, labelList: React.ReactNode[], extra: ChangeEventExtra) => void;
onTreeExpand?: (expandedKeys: Key[]) => void;
onTreeLoad?: (loadedKeys: Key[]) => void;
onDropdownVisibleChange?: (open: boolean) => void;
/** `searchPlaceholder` has been removed since search box has been merged into input box */
searchPlaceholder?: React.ReactNode;
}
declare class TreeSelect<ValueType = DefaultValueType> extends React.Component<TreeSelectProps<ValueType>, {}> {
static TreeNode: React.FC<import("./TreeNode").TreeNodeProps>;
static SHOW_ALL: typeof SHOW_ALL;
static SHOW_PARENT: typeof SHOW_PARENT;
static SHOW_CHILD: typeof SHOW_CHILD;
selectRef: React.RefObject<RefSelectProps>;
focus: () => void;
blur: () => void;
render(): JSX.Element;
}
export default TreeSelect;