From bc1ce0a6a6acbebc545d13793e5349b7f779e3cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=94=E6=A2=A6?= Date: Mon, 6 Jan 2025 16:51:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E6=94=B9onDebug=E4=B8=BAonTesting?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/xflow/api.md | 2 +- packages/x-flow/src/components/PanelContainer/index.tsx | 4 ++-- packages/x-flow/src/types.ts | 2 +- packages/x-flow/src/withProvider.tsx | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/xflow/api.md b/docs/xflow/api.md index ef88e1f21..32fb46f0a 100644 --- a/docs/xflow/api.md +++ b/docs/xflow/api.md @@ -20,7 +20,7 @@ title: API | onNodeClick | 节点点击事件 | `NodeMouseHandler` | | | antdVersion | antd 的版本 | `V4 \| V5` | `V5` | | readOnly | 只读模式 | `boolean` | `false` | -| onDebug | 单点调试方法 | `() => void` | | +| onTesting | 单点调试方法 | `() => void` | | ## TNodePanel diff --git a/packages/x-flow/src/components/PanelContainer/index.tsx b/packages/x-flow/src/components/PanelContainer/index.tsx index 6653fc4ee..a0ababc98 100644 --- a/packages/x-flow/src/components/PanelContainer/index.tsx +++ b/packages/x-flow/src/components/PanelContainer/index.tsx @@ -47,7 +47,7 @@ const Panel: FC = (props: IPanelProps) => { globalConfig, antdVersion, readOnly, - onDebug, + onTesting, }: any = useContext(ConfigContext); const nodeSetting = settingMap[nodeType] || {}; const { nodes, setNodes } = useStore( @@ -149,7 +149,7 @@ const Panel: FC = (props: IPanelProps) => {
- {!isDisabled && onDebug && ( + {!isDisabled && onTesting && ( <> diff --git a/packages/x-flow/src/types.ts b/packages/x-flow/src/types.ts index 9062a36ba..b92a51d1c 100644 --- a/packages/x-flow/src/types.ts +++ b/packages/x-flow/src/types.ts @@ -135,7 +135,7 @@ export interface FlowProps { onMenuItemClick: (itemInfo: ItemInfo, defaultAction: () => void) => void; clickAddNode:(type:string,NodeItem:TNodeItem,addNode:(initData?:Record)=>void)=>void // 单点调试方法 - onDebug?: () => void;// 单点调试方法 + onTesting?: () => void;// 单点调试方法 } interface ItemInfo { key: 'copy' | 'paste' | 'delete' | string; diff --git a/packages/x-flow/src/withProvider.tsx b/packages/x-flow/src/withProvider.tsx index a3a3c24f2..5a58a23a9 100644 --- a/packages/x-flow/src/withProvider.tsx +++ b/packages/x-flow/src/withProvider.tsx @@ -33,7 +33,7 @@ export default function withProvider( antdVersion ='V5', readOnly, clickAddNode, - onDebug, + onTesting, ...restProps } = props; const settingMap = useMemo(() => { @@ -66,7 +66,7 @@ export default function withProvider( ...defaultWidgets, ...widgets, }, - onDebug + onTesting }; return (