ant-design/components/tree-select/interface.tsx

69 lines
2.1 KiB
TypeScript
Raw Normal View History

import * as React from 'react';
import { AbstractSelectProps } from '../select';
export type TreeNode = TreeNodeNormal | TreeNodeSimpleMode;
export type TreeNodeValue = string | number | string[] | number[];
export interface TreeNodeNormal {
value: TreeNodeValue;
/**
* @deprecated Please use `title` instead.
*/
label?: React.ReactNode;
title?: React.ReactNode;
key: string;
isLeaf?: boolean;
disabled?: boolean;
disableCheckbox?: boolean;
selectable?: boolean;
children?: TreeNodeNormal[];
}
export interface TreeNodeSimpleMode {
/* It is possible to change `id` and `pId` prop keys using TreeDataSimpleMode so those keys can be anything */
[key: string]: string | boolean | React.ReactNode;
}
export interface TreeDataSimpleMode {
id?: string;
pId?: string;
rootPId?: string;
}
export interface TreeSelectProps<T extends TreeNodeValue> extends AbstractSelectProps {
2018-11-13 10:42:10 +08:00
autoFocus?: boolean;
defaultValue?: T;
dropdownStyle?: React.CSSProperties;
2019-06-24 11:29:58 +08:00
filterTreeNode?: (inputValue: string, treeNode: any) => boolean | boolean;
labelInValue?: boolean;
2019-06-24 11:29:58 +08:00
loadData?: (node: any) => void;
2018-09-06 11:49:08 +08:00
maxTagCount?: number;
2019-06-24 11:29:58 +08:00
maxTagPlaceholder?: React.ReactNode | ((omittedValues: any[]) => React.ReactNode);
multiple?: boolean;
2018-12-26 16:01:00 +08:00
notFoundContent?: React.ReactNode;
2019-06-24 11:29:58 +08:00
onChange?: (value: T, label: any, extra: any) => void;
onSearch?: (value: any) => void;
2019-10-24 14:55:48 +08:00
onSelect?: (value: any, node: any, extra: any) => void;
onTreeExpand?: (keys: Array<string>) => void;
onFocus?: React.FocusEventHandler<HTMLInputElement>;
onBlur?: React.FocusEventHandler<HTMLInputElement>;
searchPlaceholder?: string;
2018-12-02 02:22:51 +08:00
searchValue?: string;
showCheckedStrategy?: 'SHOW_ALL' | 'SHOW_PARENT' | 'SHOW_CHILD';
suffixIcon?: React.ReactNode;
removeIcon?: React.ReactNode;
clearIcon?: React.ReactNode;
treeCheckable?: boolean | React.ReactNode;
treeCheckStrictly?: boolean;
treeData?: Array<TreeNode>;
treeDataSimpleMode?: boolean | TreeDataSimpleMode;
treeDefaultExpandAll?: boolean;
treeDefaultExpandedKeys?: Array<string>;
2018-10-15 17:16:20 +08:00
treeExpandedKeys?: Array<string>;
2019-01-29 11:21:07 +08:00
treeIcon?: boolean;
treeNodeFilterProp?: string;
treeNodeLabelProp?: string;
value?: T;
}