diff --git a/packages/components/src/form-step-pro/index.tsx b/packages/components/src/form-step-pro/index.tsx index f7c52da..e1eda78 100644 --- a/packages/components/src/form-step-pro/index.tsx +++ b/packages/components/src/form-step-pro/index.tsx @@ -10,19 +10,21 @@ import { import { VoidField } from "@formily/core"; import { Steps, Button, Space } from "@douyinfe/semi-ui"; import { Schema, SchemaKey } from "@formily/json-schema"; -import { FormPath } from '@formily/shared'; +import { FormPath } from "@formily/shared"; import type { ButtonProps } from "@douyinfe/semi-ui/lib/es/button"; -import type { BasicStepsProps } from "@douyinfe/semi-ui/lib/es/steps"; +import type { StepsProps } from "@douyinfe/semi-ui/lib/es/steps"; import type { StepProps } from "@douyinfe/semi-ui/lib/es/steps"; import cls from "classnames"; import { usePrefixCls } from "../__builtins__"; import { FormStep, IFormStep } from "../form-step"; -export interface IFormStepProProps extends BasicStepsProps { +interface IStepProProps { formStep?: IFormStep; onSubmit?: (value?: any) => void; } +export type IFormStepProProps = IStepProProps & StepsProps; + export interface IFormStepProContext { props: Pick; field: VoidField; @@ -160,7 +162,7 @@ const NextWithSubmit: React.FC< {...restProps} onClick={() => { formStepCtx?.props.formStep?.submit((values) => { - const target = {} + const target = {}; picks.forEach((pickPath) => { const parser = FormPath.parse(pickPath); parser.setIn(target, parser.getIn(values)); diff --git a/packages/components/src/form-step/index.tsx b/packages/components/src/form-step/index.tsx index 4d0f773..43e1b36 100644 --- a/packages/components/src/form-step/index.tsx +++ b/packages/components/src/form-step/index.tsx @@ -2,8 +2,7 @@ import React, { Fragment } from "react"; import { action, model, markRaw } from "@formily/reactive"; import { Steps } from "@douyinfe/semi-ui"; import cls from "classnames"; -import { BasicStepsProps } from "@douyinfe/semi-ui/lib/es/steps"; -import { StepProps } from "@douyinfe/semi-ui/lib/es/steps"; +import { StepsProps, StepProps } from "@douyinfe/semi-ui/lib/es/steps"; import { Form, VoidField } from "@formily/core"; import { connect, @@ -27,10 +26,12 @@ export interface IFormStep { back(): void; } -export interface IFormStepProps extends BasicStepsProps { +interface IFormSteps { formStep?: IFormStep; } +export type IFormStepProps = IFormSteps & StepsProps; + type ComposedFormTab = React.FC & { StepPane?: React.FC; createFormStep?: (defaultCurrent?: number) => IFormStep;