Skip to content

Commit 372e4be

Browse files
authored
Merge pull request #5 from Snoopyjoy/fix/steps_props
fix: steps props type
2 parents bb0b3bd + 397f223 commit 372e4be

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

packages/components/src/form-step-pro/index.tsx

+6-4
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,21 @@ import {
1010
import { VoidField } from "@formily/core";
1111
import { Steps, Button, Space } from "@douyinfe/semi-ui";
1212
import { Schema, SchemaKey } from "@formily/json-schema";
13-
import { FormPath } from '@formily/shared';
13+
import { FormPath } from "@formily/shared";
1414
import type { ButtonProps } from "@douyinfe/semi-ui/lib/es/button";
15-
import type { BasicStepsProps } from "@douyinfe/semi-ui/lib/es/steps";
15+
import type { StepsProps } from "@douyinfe/semi-ui/lib/es/steps";
1616
import type { StepProps } from "@douyinfe/semi-ui/lib/es/steps";
1717
import cls from "classnames";
1818
import { usePrefixCls } from "../__builtins__";
1919
import { FormStep, IFormStep } from "../form-step";
2020

21-
export interface IFormStepProProps extends BasicStepsProps {
21+
interface IStepProProps {
2222
formStep?: IFormStep;
2323
onSubmit?: (value?: any) => void;
2424
}
2525

26+
export type IFormStepProProps = IStepProProps & StepsProps;
27+
2628
export interface IFormStepProContext {
2729
props: Pick<IFormStepProProps, "formStep" | "onSubmit">;
2830
field: VoidField;
@@ -160,7 +162,7 @@ const NextWithSubmit: React.FC<
160162
{...restProps}
161163
onClick={() => {
162164
formStepCtx?.props.formStep?.submit((values) => {
163-
const target = {}
165+
const target = {};
164166
picks.forEach((pickPath) => {
165167
const parser = FormPath.parse(pickPath);
166168
parser.setIn(target, parser.getIn(values));

packages/components/src/form-step/index.tsx

+4-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ import React, { Fragment } from "react";
22
import { action, model, markRaw } from "@formily/reactive";
33
import { Steps } from "@douyinfe/semi-ui";
44
import cls from "classnames";
5-
import { BasicStepsProps } from "@douyinfe/semi-ui/lib/es/steps";
6-
import { StepProps } from "@douyinfe/semi-ui/lib/es/steps";
5+
import { StepsProps, StepProps } from "@douyinfe/semi-ui/lib/es/steps";
76
import { Form, VoidField } from "@formily/core";
87
import {
98
connect,
@@ -27,10 +26,12 @@ export interface IFormStep {
2726
back(): void;
2827
}
2928

30-
export interface IFormStepProps extends BasicStepsProps {
29+
interface IFormSteps {
3130
formStep?: IFormStep;
3231
}
3332

33+
export type IFormStepProps = IFormSteps & StepsProps;
34+
3435
type ComposedFormTab = React.FC<IFormStepProps> & {
3536
StepPane?: React.FC<StepProps>;
3637
createFormStep?: (defaultCurrent?: number) => IFormStep;

0 commit comments

Comments
 (0)