///
export interface DataNode {
checkable?: boolean;
children?: DataNode[];
disabled?: boolean;
disableCheckbox?: boolean;
icon?: IconType;
leaf?: boolean;
key: string | number;
title?: React.ReactNode;
selectable?: boolean;
switcherIcon?: IconType;
/** Set style of TreeNode. This is not recommend if you don't have any force requirement */
className?: string;
style?: React.CSSProperties;
}
export interface EventDataNode extends Omit {
expanded: boolean;
selected: boolean;
checked: boolean;
loaded: boolean;
loading: boolean;
halfChecked: boolean;
pos: string;
active: boolean;
}
export interface TreeNodeProps {
displayName?: string;
eventKey?: Key;
prefixCls?: string;
className?: string;
style?: React.CSSProperties;
expanded?: boolean;
selected?: boolean;
checked?: boolean;
loaded?: boolean;
loading?: boolean;
halfChecked?: boolean;
title?: React.ReactNode | ((data: DataNode) => React.ReactNode);
pos?: string;
domRef?: React.Ref;
/** New added in Tree for easy data access */
data?: DataNode;
isStart?: boolean[];
isEnd?: boolean[];
active?: boolean;
leaf?: boolean;
checkable?: boolean;
selectable?: boolean;
disabled?: boolean;
disableCheckbox?: boolean;
icon?: IconType;
switcherIcon?: IconType;
children?: React.ReactNode;
treeNodeRequiredProps?: any;
}
export declare type IconType = React.ReactNode | ((props: TreeNodeProps) => React.ReactNode);
export interface FishTreeNodeAttribute {
eventKey: string;
prefixCls: string;
className: string;
expanded: boolean;
selected: boolean;
checked: boolean;
children: React.ReactNode;
title: React.ReactNode;
leaf: boolean;
checkable: boolean;
selectable: boolean;
disabled: boolean;
disableCheckbox: boolean;
}
export interface FishTreeNodeProps {
className?: string;
checkable?: boolean;
disabled?: boolean;
disableCheckbox?: boolean;
title?: string | React.ReactNode;
key?: string;
eventKey?: string;
isLeaf?: boolean;
checked?: boolean;
expanded?: boolean;
loading?: boolean;
selected?: boolean;
selectable?: boolean;
icon?: ((treeNode: FishTreeNodeAttribute) => React.ReactNode) | React.ReactNode;
children?: React.ReactNode;
[customProp: string]: any;
}
export interface FishTreeNodeBaseEvent {
node: EventDataNode;
nativeEvent: MouseEvent;
}
export interface FishTreeNodeCheckedEvent extends FishTreeNodeBaseEvent {
event: 'check';
checked?: boolean;
checkedNodes?: EventDataNode[];
}
export interface FishTreeNodeSelectedEvent extends FishTreeNodeBaseEvent {
event: 'select';
selected?: boolean;
selectedNodes?: DataNode[];
}
export interface FishTreeNodeExpandedEvent extends FishTreeNodeBaseEvent {
expanded?: boolean;
}
export declare type TreeNodeNormal = DataNode;
export declare type Key = string | number;
export interface TreeProps {
className?: string;
/** 是否支持多选 */
multiple?: boolean;
/** 是否禁用树 */
disabled?: boolean;
/** checkable状态下节点选择完全受控(父子节点选中状态不再关联) */
checkStrictly?: boolean;
/** 默认展开指定的树节点 */
defaultExpandedKeys?: string[];
/** (受控)展开指定的树节点 */
expandedKeys?: string[];
/** (受控)选中复选框的树节点 */
value?: string[];
defaultValue?: string[];
labelInValue?: boolean;
loadData?: (node: EventDataNode) => Promise;
treeData?: DataNode[];
selectable?: boolean;
style?: React.CSSProperties;
prefixCls?: string;
children?: React.ReactNode;
onChange?: (value: Key[], info: any) => void;
onSelect?: (value: Key[], info: any) => void;
onExpand?: (expandedKeys: string[]) => void;
filterTreeNode?: (node: EventDataNode) => boolean;
}
export interface SearchTreeProps extends Omit {
showSearch?: boolean;
searchPlaceholder?: string;
searchValue?: string;
onSearch?: (inputValue: string) => void;
filterTreeNode?: (inputValue: string, node: EventDataNode) => boolean;
}