@trackunit/react-form-wizard 0.1.81 → 0.1.83
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 +1 -2
- package/index.esm.js +2 -3
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -236,7 +236,6 @@ const cvaFormWizardComponentStepForm = cssClassVarianceUtilities.cvaMerge(["grid
|
|
|
236
236
|
const FormWizardStepWrapper = ({ stepKey, onCancel, description, title, component, formSchema, nextStepPath, previousStepPath, lastStepPrimaryActionLabel, fullFormSchema, setFullFormState, fullFormState, stepForms, setStepForms, setStepStates, basePath, containerClassName, }) => {
|
|
237
237
|
const navigate = reactRouter.useNavigate();
|
|
238
238
|
const [isSubmitting, setIsSubmitting] = react.useState(false);
|
|
239
|
-
const formRef = react.useRef(null);
|
|
240
239
|
const [submitHandlerInternal, setSubmitHandlerInternal] = react.useState(null);
|
|
241
240
|
const form = reactHookForm.useForm({
|
|
242
241
|
resolver: zod.zodResolver(formSchema),
|
|
@@ -322,7 +321,7 @@ const FormWizardStepWrapper = ({ stepKey, onCancel, description, title, componen
|
|
|
322
321
|
return (jsxRuntime.jsxs("form", { className: cvaFormWizardComponentStepForm(), noValidate: true, onSubmit: e => {
|
|
323
322
|
e.preventDefault();
|
|
324
323
|
handleSubmit();
|
|
325
|
-
},
|
|
324
|
+
}, children: [jsxRuntime.jsx(FormWizardHeader, { title, description }), jsxRuntime.jsx("div", { className: cvaFormWizardComponentContainer({ className: containerClassName }), children: jsxRuntime.jsx(reactHookForm.FormProvider, Object.assign({}, form, { children: component({
|
|
326
325
|
form,
|
|
327
326
|
fullForm,
|
|
328
327
|
setSubmitHandler: isLastStep ? setSubmitHandler : null,
|
package/index.esm.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import { registerTranslations, useNamespaceTranslation } from '@trackunit/i18n-library-translation';
|
|
3
3
|
import { Link, useNavigate, useParams } from '@tanstack/react-router';
|
|
4
4
|
import { objectKeys, objectFromEntries, objectEntries, objectValues } from '@trackunit/shared-utils';
|
|
5
|
-
import { useState,
|
|
5
|
+
import { useState, useEffect, useCallback, useMemo } from 'react';
|
|
6
6
|
import { cvaMerge } from '@trackunit/css-class-variance-utilities';
|
|
7
7
|
import { Icon, Button, Heading } from '@trackunit/react-components';
|
|
8
8
|
import { zodResolver } from '@hookform/resolvers/zod';
|
|
@@ -232,7 +232,6 @@ const cvaFormWizardComponentStepForm = cvaMerge(["grid-rows-min-fr-min", "grid",
|
|
|
232
232
|
const FormWizardStepWrapper = ({ stepKey, onCancel, description, title, component, formSchema, nextStepPath, previousStepPath, lastStepPrimaryActionLabel, fullFormSchema, setFullFormState, fullFormState, stepForms, setStepForms, setStepStates, basePath, containerClassName, }) => {
|
|
233
233
|
const navigate = useNavigate();
|
|
234
234
|
const [isSubmitting, setIsSubmitting] = useState(false);
|
|
235
|
-
const formRef = useRef(null);
|
|
236
235
|
const [submitHandlerInternal, setSubmitHandlerInternal] = useState(null);
|
|
237
236
|
const form = useForm({
|
|
238
237
|
resolver: zodResolver(formSchema),
|
|
@@ -318,7 +317,7 @@ const FormWizardStepWrapper = ({ stepKey, onCancel, description, title, componen
|
|
|
318
317
|
return (jsxs("form", { className: cvaFormWizardComponentStepForm(), noValidate: true, onSubmit: e => {
|
|
319
318
|
e.preventDefault();
|
|
320
319
|
handleSubmit();
|
|
321
|
-
},
|
|
320
|
+
}, children: [jsx(FormWizardHeader, { title, description }), jsx("div", { className: cvaFormWizardComponentContainer({ className: containerClassName }), children: jsx(FormProvider, Object.assign({}, form, { children: component({
|
|
322
321
|
form,
|
|
323
322
|
fullForm,
|
|
324
323
|
setSubmitHandler: isLastStep ? setSubmitHandler : null,
|