@trackunit/react-form-wizard 0.1.254 → 0.1.255

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.cjs.js CHANGED
@@ -335,7 +335,7 @@ const FormWizard = ({ lastStepPrimaryActionLabel, isEdit, steps, fullFormSchema,
335
335
  const [stepStates, setStepStates] = react.useState({});
336
336
  const [stepForms, setStepForms] = react.useState({});
337
337
  const [fullFormState, setFullFormState] = react.useState(
338
- // DeepPartial does not allow empty object and properly working around it would severely complicate the code
338
+ // DeepPartial does not allow empty object and properly working around it would severely complicate the code (DefaultValues uses DeepPartial under the hood)
339
339
  // A possible workaround could be to type it Partial<<DeepPartial<...>>> everywhere
340
340
  // Any weakening of the type in a union would be worse and likely just push the issue forward until it hits react-hook-form
341
341
  // eslint-disable-next-line local-rules/no-typescript-assertion
package/index.esm.js CHANGED
@@ -333,7 +333,7 @@ const FormWizard = ({ lastStepPrimaryActionLabel, isEdit, steps, fullFormSchema,
333
333
  const [stepStates, setStepStates] = useState({});
334
334
  const [stepForms, setStepForms] = useState({});
335
335
  const [fullFormState, setFullFormState] = useState(
336
- // DeepPartial does not allow empty object and properly working around it would severely complicate the code
336
+ // DeepPartial does not allow empty object and properly working around it would severely complicate the code (DefaultValues uses DeepPartial under the hood)
337
337
  // A possible workaround could be to type it Partial<<DeepPartial<...>>> everywhere
338
338
  // Any weakening of the type in a union would be worse and likely just push the issue forward until it hits react-hook-form
339
339
  // eslint-disable-next-line local-rules/no-typescript-assertion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-form-wizard",
3
- "version": "0.1.254",
3
+ "version": "0.1.255",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "dependencies": {
@@ -9,7 +9,7 @@
9
9
  "@trackunit/css-class-variance-utilities": "*",
10
10
  "@trackunit/react-components": "*",
11
11
  "@hookform/resolvers": "^3.3.4",
12
- "react-hook-form": "7.40.0",
12
+ "react-hook-form": "7.53.0",
13
13
  "@trackunit/i18n-library-translation": "*",
14
14
  "@tanstack/react-router": "1.47.1",
15
15
  "@trackunit/shared-utils": "*"
@@ -1,6 +1,6 @@
1
1
  import { RegisteredRouter, RoutePaths } from "@tanstack/react-router";
2
2
  import { Dispatch, ReactNode, SetStateAction } from "react";
3
- import { DeepPartial, UseFormReturn } from "react-hook-form";
3
+ import { DeepPartial, DefaultValues, UseFormReturn } from "react-hook-form";
4
4
  import { AnyZodObject, z } from "zod";
5
5
  import { FormWizardStepFormReturnMap } from "../FormWizard/FormWizard";
6
6
  import { SimpleStepProps, StepComponentPropsInner, StepDefinitions, StringWithStepKey } from "../FormWizard/useFormWizard";
@@ -13,8 +13,8 @@ export interface FormWizardStepWrapperProps<TStepKey extends keyof z.TypeOf<TFul
13
13
  previousStepPath: string | null;
14
14
  onCancel?: () => void;
15
15
  fullFormSchema: TFullSchema;
16
- fullFormState: DeepPartial<z.TypeOf<TFullSchema>>;
17
- setFullFormState: Dispatch<SetStateAction<DeepPartial<z.TypeOf<TFullSchema>>>>;
16
+ fullFormState: DefaultValues<z.TypeOf<TFullSchema>>;
17
+ setFullFormState: Dispatch<SetStateAction<DefaultValues<z.TypeOf<TFullSchema>>>>;
18
18
  stepKey: TStepKey;
19
19
  setStepStates: Dispatch<SetStateAction<Partial<Record<keyof StepDefinitions<TFullSchema>, StepFormValidity>>>>;
20
20
  component: (props: StepComponentPropsInner<DeepPartial<z.TypeOf<TFullSchema>[TStepKey]>, z.TypeOf<TFullSchema>>) => ReactNode;
@@ -1,12 +1,12 @@
1
1
  import { ReactNode } from "react";
2
- import { DeepPartial } from "react-hook-form";
2
+ import { DefaultValues } from "react-hook-form";
3
3
  import { AnyZodObject, z } from "zod";
4
4
  import { StepComponentProps } from "../FormWizard/useFormWizard";
5
5
  export interface TestHelperFormWizardStepProps<TStepKey extends keyof z.infer<TFullSchema>, TFullSchema extends AnyZodObject> {
6
6
  overrides?: Partial<StepComponentProps<() => TFullSchema, TStepKey>>;
7
7
  fullFormSchema: TFullSchema;
8
8
  stepKey: TStepKey;
9
- defaultValues?: DeepPartial<z.TypeOf<TFullSchema>>;
9
+ defaultValues?: DefaultValues<z.TypeOf<TFullSchema>>;
10
10
  children: (props: StepComponentProps<() => TFullSchema, TStepKey>) => ReactNode;
11
11
  }
12
12
  /**