@ant-design/pro-flow
Version:
A React based Flow components
90 lines (89 loc) • 2.16 kB
TypeScript
import { CSSProperties, ReactNode } from 'react';
export declare const useNodeFieldStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
title: string;
extra: string;
value: import("antd-style").SerializedStyles;
handle: import("antd-style").SerializedStyles;
handleRight: import("antd-style").SerializedStyles;
handleLeft: import("antd-style").SerializedStyles;
}>;
/**
* 额外操作选项
*/
export interface ExtraAction {
/**
* 操作标题
*/
title?: string;
/**
* 操作图标
*/
icon?: ReactNode;
/**
* 点击操作时的回调函数
*/
onClick?: () => void;
}
/**
* NodeField 组件的 props
*/
export interface NodeFieldProps {
/**
* 节点的唯一标识符
*/
id: string;
/**
* 节点标题,支持传入 ReactNode
*/
title?: ReactNode;
/**
* 额外的操作按钮,格式为 ExtraAction 数组
*/
extra?: ExtraAction[];
/**
* 是否折叠,默认为 false
*/
collapsed?: boolean;
/**
* 折叠状态改变时的回调函数
* @param collapsed - 折叠状态
*/
onCollapsedChange?: (collapsed: boolean) => void;
/**
* 值区域是否使用容器包裹
* @default true
*/
valueContainer?: boolean;
/**
* 自定义类名
* @param extra - 操作按钮的类名
* @param value - 值区域的类名
* @param header - 节点头部的类名
* @param title - 标题的类名
*/
classNames?: {
extra?: string;
value?: string;
header?: string;
title?: string;
};
/**
* 节点的连接点,用于连线
* @param source - 源节点的连接点,默认为 true
* @param target - 目标节点的连接点,默认为 true
*/
handles?: {
source?: true | string;
target?: true | string;
};
/**
* 自定义样式
*/
style?: CSSProperties;
className?: string;
/**
* 子元素
*/
children?: ReactNode;
}
export declare const NodeField: import("react").NamedExoticComponent<NodeFieldProps>;