mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-07 17:44:35 +08:00

* init * fix firefox * add active style * adjust arrow style * update select * update icon logic * render empty * init multiple * fix ff display style * sync font size * adjust padding style * add padding * padding it * hotfix of chrome * single sm * multiple size * update option group style * update snapshot * clean up transition * rm combobox in ts define * auto complete init * fix auto option def * update demo * update demo * update uncertain demo * update demo * warning if user set `size` on AutoComplete * add debug demo * updat demo * update demo of disabled * update snapshot * rm useless test * fix pagination test * fix Table test * fix calendar test case * fix calendar test case * adjust style * add big data demo * support clean up * fix ts define * fix lint * fix demo lint * fix style lint fix * rm useless deps * update snapshot * stop mock * add space
65 lines
2.0 KiB
TypeScript
65 lines
2.0 KiB
TypeScript
import * as React from 'react';
|
|
import { SelectProps } 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 Omit<SelectProps<T>, 'onChange'> {
|
|
autoFocus?: boolean;
|
|
defaultValue?: T;
|
|
dropdownStyle?: React.CSSProperties;
|
|
filterTreeNode?: (inputValue: string, treeNode: any) => boolean | boolean;
|
|
labelInValue?: boolean;
|
|
loadData?: (node: any) => void;
|
|
multiple?: boolean;
|
|
notFoundContent?: React.ReactNode;
|
|
onChange?: (value: T, label: any, extra: any) => void;
|
|
onSearch?: (value: any) => void;
|
|
onSelect?: (value: any) => void;
|
|
onTreeExpand?: (keys: Array<string>) => void;
|
|
onFocus?: React.FocusEventHandler<HTMLInputElement>;
|
|
onBlur?: React.FocusEventHandler<HTMLInputElement>;
|
|
searchPlaceholder?: string;
|
|
searchValue?: string;
|
|
showCheckedStrategy?: 'SHOW_ALL' | 'SHOW_PARENT' | 'SHOW_CHILD';
|
|
suffixIcon?: React.ReactNode;
|
|
treeCheckable?: boolean | React.ReactNode;
|
|
treeCheckStrictly?: boolean;
|
|
treeData?: Array<TreeNode>;
|
|
treeDataSimpleMode?: boolean | TreeDataSimpleMode;
|
|
treeDefaultExpandAll?: boolean;
|
|
treeDefaultExpandedKeys?: Array<string>;
|
|
treeExpandedKeys?: Array<string>;
|
|
treeIcon?: boolean;
|
|
treeNodeFilterProp?: string;
|
|
treeNodeLabelProp?: string;
|
|
value?: T;
|
|
}
|