@trackunit/react-form-wizard 0.1.48 → 0.1.50
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
|
@@ -228,7 +228,7 @@ const cvaFormWizardComponentStepForm = cssClassVarianceUtilities.cvaMerge(["grid
|
|
|
228
228
|
* A wrapper component used by the FormWizard component to render each step.
|
|
229
229
|
* In most cases you should not be using this component directly, but rather use the FormWizard component.
|
|
230
230
|
*/
|
|
231
|
-
const FormWizardStepWrapper = ({ stepKey, onCancel, description, title, component, formSchema, nextStepPath, previousStepPath, lastStepPrimaryActionLabel, fullFormSchema, setFullFormState, fullFormState, stepForms, setStepForms, setStepStates, basePath, }) => {
|
|
231
|
+
const FormWizardStepWrapper = ({ stepKey, onCancel, description, title, component, formSchema, nextStepPath, previousStepPath, lastStepPrimaryActionLabel, fullFormSchema, setFullFormState, fullFormState, stepForms, setStepForms, setStepStates, basePath, containerClassName, }) => {
|
|
232
232
|
const navigate = reactRouter.useNavigate();
|
|
233
233
|
const [isSubmitting, setIsSubmitting] = react.useState(false);
|
|
234
234
|
const formRef = react.useRef(null);
|
|
@@ -297,7 +297,7 @@ const FormWizardStepWrapper = ({ stepKey, onCancel, description, title, componen
|
|
|
297
297
|
submitHandlerInternal,
|
|
298
298
|
]);
|
|
299
299
|
const handleSubmit = react.useMemo(() => (isEmptyStep ? emptyStepSubmitHandler : nonEmptyStepSubmitHandler), [emptyStepSubmitHandler, isEmptyStep, nonEmptyStepSubmitHandler]);
|
|
300
|
-
return (jsxRuntime.jsxs("form", { className: cvaFormWizardComponentStepForm(), onSubmit: handleSubmit, ref: formRef, children: [jsxRuntime.jsx(FormWizardHeader, { title, description }), jsxRuntime.jsx("div", { className: cvaFormWizardComponentContainer(), children: component({
|
|
300
|
+
return (jsxRuntime.jsxs("form", { className: cvaFormWizardComponentStepForm(), onSubmit: handleSubmit, ref: formRef, children: [jsxRuntime.jsx(FormWizardHeader, { title, description }), jsxRuntime.jsx("div", { className: cvaFormWizardComponentContainer({ className: containerClassName }), children: component({
|
|
301
301
|
form,
|
|
302
302
|
fullForm,
|
|
303
303
|
setSubmitHandler: isLastStep ? setSubmitHandler : null,
|
package/index.esm.js
CHANGED
|
@@ -224,7 +224,7 @@ const cvaFormWizardComponentStepForm = cvaMerge(["grid-rows-min-fr-min", "grid",
|
|
|
224
224
|
* A wrapper component used by the FormWizard component to render each step.
|
|
225
225
|
* In most cases you should not be using this component directly, but rather use the FormWizard component.
|
|
226
226
|
*/
|
|
227
|
-
const FormWizardStepWrapper = ({ stepKey, onCancel, description, title, component, formSchema, nextStepPath, previousStepPath, lastStepPrimaryActionLabel, fullFormSchema, setFullFormState, fullFormState, stepForms, setStepForms, setStepStates, basePath, }) => {
|
|
227
|
+
const FormWizardStepWrapper = ({ stepKey, onCancel, description, title, component, formSchema, nextStepPath, previousStepPath, lastStepPrimaryActionLabel, fullFormSchema, setFullFormState, fullFormState, stepForms, setStepForms, setStepStates, basePath, containerClassName, }) => {
|
|
228
228
|
const navigate = useNavigate();
|
|
229
229
|
const [isSubmitting, setIsSubmitting] = useState(false);
|
|
230
230
|
const formRef = useRef(null);
|
|
@@ -293,7 +293,7 @@ const FormWizardStepWrapper = ({ stepKey, onCancel, description, title, componen
|
|
|
293
293
|
submitHandlerInternal,
|
|
294
294
|
]);
|
|
295
295
|
const handleSubmit = useMemo(() => (isEmptyStep ? emptyStepSubmitHandler : nonEmptyStepSubmitHandler), [emptyStepSubmitHandler, isEmptyStep, nonEmptyStepSubmitHandler]);
|
|
296
|
-
return (jsxs("form", { className: cvaFormWizardComponentStepForm(), onSubmit: handleSubmit, ref: formRef, children: [jsx(FormWizardHeader, { title, description }), jsx("div", { className: cvaFormWizardComponentContainer(), children: component({
|
|
296
|
+
return (jsxs("form", { className: cvaFormWizardComponentStepForm(), onSubmit: handleSubmit, ref: formRef, children: [jsx(FormWizardHeader, { title, description }), jsx("div", { className: cvaFormWizardComponentContainer({ className: containerClassName }), children: component({
|
|
297
297
|
form,
|
|
298
298
|
fullForm,
|
|
299
299
|
setSubmitHandler: isLastStep ? setSubmitHandler : null,
|
package/package.json
CHANGED
|
@@ -17,6 +17,7 @@ export interface SimpleStepProps {
|
|
|
17
17
|
description: string | ReactNode;
|
|
18
18
|
sidebarDescription?: string;
|
|
19
19
|
path: string;
|
|
20
|
+
containerClassName?: string;
|
|
20
21
|
}
|
|
21
22
|
interface DefinedStep<TStepSchema extends TFullSchemaValue[keyof TFullSchemaValue], TFullSchemaValue extends z.TypeOf<AnyZodObject>> extends SimpleStepProps {
|
|
22
23
|
component: (props: StepComponentPropsInner<TStepSchema, TFullSchemaValue>) => React.ReactNode;
|
|
@@ -28,4 +28,4 @@ export interface FormWizardStepWrapperProps<TStepKey extends keyof z.TypeOf<TFul
|
|
|
28
28
|
* A wrapper component used by the FormWizard component to render each step.
|
|
29
29
|
* In most cases you should not be using this component directly, but rather use the FormWizard component.
|
|
30
30
|
*/
|
|
31
|
-
export declare const FormWizardStepWrapper: <TFullSchema extends AnyZodObject, TStepKey extends keyof z.TypeOf<TFullSchema>>({ stepKey, onCancel, description, title, component, formSchema, nextStepPath, previousStepPath, lastStepPrimaryActionLabel, fullFormSchema, setFullFormState, fullFormState, stepForms, setStepForms, setStepStates, basePath, }: FormWizardStepWrapperProps<TStepKey, TFullSchema>) => JSX.Element;
|
|
31
|
+
export declare const FormWizardStepWrapper: <TFullSchema extends AnyZodObject, TStepKey extends keyof z.TypeOf<TFullSchema>>({ stepKey, onCancel, description, title, component, formSchema, nextStepPath, previousStepPath, lastStepPrimaryActionLabel, fullFormSchema, setFullFormState, fullFormState, stepForms, setStepForms, setStepStates, basePath, containerClassName, }: FormWizardStepWrapperProps<TStepKey, TFullSchema>) => JSX.Element;
|