@trackunit/react-form-wizard 1.7.132 → 1.7.135
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
|
@@ -191,9 +191,9 @@ const cvaNavigationContainer = cssClassVarianceUtilities.cvaMerge(["flex", "gap-
|
|
|
191
191
|
* The footer component for the FormWizard.
|
|
192
192
|
* In most cases you should not be using this component directly, but rather use the FormWizard component.
|
|
193
193
|
*/
|
|
194
|
-
const FormWizardFooter = ({ disablePrimaryAction = false, onBack, onCancel, primaryActionLabel, }) => {
|
|
194
|
+
const FormWizardFooter = ({ disablePrimaryAction = false, loading = false, onBack, onCancel, primaryActionLabel, }) => {
|
|
195
195
|
const [t] = useTranslation();
|
|
196
|
-
return (jsxRuntime.jsxs("div", { className: cvaFooterContainer(), children: [jsxRuntime.jsx(reactComponents.Button, { "data-testid": "wizard-cancel", onClick: onCancel, variant: "ghost-neutral", children: t("wizard.defaults.cancel") }), jsxRuntime.jsxs("div", { className: cvaNavigationContainer(), children: [onBack ? (jsxRuntime.jsx(reactComponents.Button, { "data-testid": "wizard-back", onClick: onBack, variant: "secondary", children: t("wizard.defaults.back") })) : null, jsxRuntime.jsx(reactComponents.Button, { "data-testid": "wizard-next", disabled: disablePrimaryAction, type: "submit", children: primaryActionLabel ? primaryActionLabel : t("wizard.defaults.next") })] })] }));
|
|
196
|
+
return (jsxRuntime.jsxs("div", { className: cvaFooterContainer(), children: [jsxRuntime.jsx(reactComponents.Button, { "data-testid": "wizard-cancel", onClick: onCancel, variant: "ghost-neutral", children: t("wizard.defaults.cancel") }), jsxRuntime.jsxs("div", { className: cvaNavigationContainer(), children: [onBack ? (jsxRuntime.jsx(reactComponents.Button, { "data-testid": "wizard-back", onClick: onBack, variant: "secondary", children: t("wizard.defaults.back") })) : null, jsxRuntime.jsx(reactComponents.Button, { "data-testid": "wizard-next", disabled: disablePrimaryAction, loading: loading, type: "submit", children: primaryActionLabel ? primaryActionLabel : t("wizard.defaults.next") })] })] }));
|
|
197
197
|
};
|
|
198
198
|
|
|
199
199
|
const cvaFormWizardHeader = cssClassVarianceUtilities.cvaMerge([
|
|
@@ -336,11 +336,11 @@ const FormWizardStepWrapper = ({ stepKey, onCancel, description, title, componen
|
|
|
336
336
|
resetFullFormState,
|
|
337
337
|
}) }) }), jsxRuntime.jsx(FormWizardFooter, { stepForms,
|
|
338
338
|
onBack: previousStepPath
|
|
339
|
-
?
|
|
340
|
-
() => navigate({ to: basePath, params: { stepPath: previousStepPath } })
|
|
339
|
+
? () => navigate({ to: basePath, params: { stepPath: previousStepPath } })
|
|
341
340
|
: null,
|
|
342
341
|
primaryActionLabel: isLastStep ? lastStepPrimaryActionLabel : undefined,
|
|
343
342
|
onCancel: handleCancel,
|
|
343
|
+
loading: isLastStep ? isSubmitting : false,
|
|
344
344
|
disablePrimaryAction: isSubmitting })] }, String(stepKey)));
|
|
345
345
|
};
|
|
346
346
|
|
package/index.esm.js
CHANGED
|
@@ -189,9 +189,9 @@ const cvaNavigationContainer = cvaMerge(["flex", "gap-2"]);
|
|
|
189
189
|
* The footer component for the FormWizard.
|
|
190
190
|
* In most cases you should not be using this component directly, but rather use the FormWizard component.
|
|
191
191
|
*/
|
|
192
|
-
const FormWizardFooter = ({ disablePrimaryAction = false, onBack, onCancel, primaryActionLabel, }) => {
|
|
192
|
+
const FormWizardFooter = ({ disablePrimaryAction = false, loading = false, onBack, onCancel, primaryActionLabel, }) => {
|
|
193
193
|
const [t] = useTranslation();
|
|
194
|
-
return (jsxs("div", { className: cvaFooterContainer(), children: [jsx(Button, { "data-testid": "wizard-cancel", onClick: onCancel, variant: "ghost-neutral", children: t("wizard.defaults.cancel") }), jsxs("div", { className: cvaNavigationContainer(), children: [onBack ? (jsx(Button, { "data-testid": "wizard-back", onClick: onBack, variant: "secondary", children: t("wizard.defaults.back") })) : null, jsx(Button, { "data-testid": "wizard-next", disabled: disablePrimaryAction, type: "submit", children: primaryActionLabel ? primaryActionLabel : t("wizard.defaults.next") })] })] }));
|
|
194
|
+
return (jsxs("div", { className: cvaFooterContainer(), children: [jsx(Button, { "data-testid": "wizard-cancel", onClick: onCancel, variant: "ghost-neutral", children: t("wizard.defaults.cancel") }), jsxs("div", { className: cvaNavigationContainer(), children: [onBack ? (jsx(Button, { "data-testid": "wizard-back", onClick: onBack, variant: "secondary", children: t("wizard.defaults.back") })) : null, jsx(Button, { "data-testid": "wizard-next", disabled: disablePrimaryAction, loading: loading, type: "submit", children: primaryActionLabel ? primaryActionLabel : t("wizard.defaults.next") })] })] }));
|
|
195
195
|
};
|
|
196
196
|
|
|
197
197
|
const cvaFormWizardHeader = cvaMerge([
|
|
@@ -334,11 +334,11 @@ const FormWizardStepWrapper = ({ stepKey, onCancel, description, title, componen
|
|
|
334
334
|
resetFullFormState,
|
|
335
335
|
}) }) }), jsx(FormWizardFooter, { stepForms,
|
|
336
336
|
onBack: previousStepPath
|
|
337
|
-
?
|
|
338
|
-
() => navigate({ to: basePath, params: { stepPath: previousStepPath } })
|
|
337
|
+
? () => navigate({ to: basePath, params: { stepPath: previousStepPath } })
|
|
339
338
|
: null,
|
|
340
339
|
primaryActionLabel: isLastStep ? lastStepPrimaryActionLabel : undefined,
|
|
341
340
|
onCancel: handleCancel,
|
|
341
|
+
loading: isLastStep ? isSubmitting : false,
|
|
342
342
|
disablePrimaryAction: isSubmitting })] }, String(stepKey)));
|
|
343
343
|
};
|
|
344
344
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-form-wizard",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.135",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"dependencies": {
|
|
@@ -10,13 +10,13 @@
|
|
|
10
10
|
"react-hook-form": "7.62.0",
|
|
11
11
|
"@tanstack/react-router": "1.114.29",
|
|
12
12
|
"@tanstack/router-core": "1.114.29",
|
|
13
|
-
"@trackunit/shared-utils": "1.9.
|
|
14
|
-
"@trackunit/css-class-variance-utilities": "1.7.
|
|
15
|
-
"@trackunit/react-components": "1.10.
|
|
16
|
-
"@trackunit/i18n-library-translation": "1.7.
|
|
13
|
+
"@trackunit/shared-utils": "1.9.88",
|
|
14
|
+
"@trackunit/css-class-variance-utilities": "1.7.88",
|
|
15
|
+
"@trackunit/react-components": "1.10.63",
|
|
16
|
+
"@trackunit/i18n-library-translation": "1.7.106"
|
|
17
17
|
},
|
|
18
18
|
"engines": {
|
|
19
|
-
"node": ">=
|
|
19
|
+
"node": ">=24.x",
|
|
20
20
|
"yarn": "3.8.6"
|
|
21
21
|
},
|
|
22
22
|
"module": "./index.esm.js",
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { CommonProps } from "@trackunit/react-components";
|
|
2
|
+
import { ReactElement } from "react";
|
|
2
3
|
interface FormWizardFooterProps extends CommonProps {
|
|
3
4
|
primaryActionLabel?: string;
|
|
4
5
|
onCancel: () => void;
|
|
5
6
|
onBack: (() => void) | null;
|
|
6
7
|
disablePrimaryAction?: boolean;
|
|
8
|
+
loading: boolean;
|
|
7
9
|
}
|
|
8
10
|
/**
|
|
9
11
|
* The footer component for the FormWizard.
|
|
10
12
|
* In most cases you should not be using this component directly, but rather use the FormWizard component.
|
|
11
13
|
*/
|
|
12
|
-
export declare const FormWizardFooter: ({ disablePrimaryAction, onBack, onCancel, primaryActionLabel, }: FormWizardFooterProps) =>
|
|
14
|
+
export declare const FormWizardFooter: ({ disablePrimaryAction, loading, onBack, onCancel, primaryActionLabel, }: FormWizardFooterProps) => ReactElement;
|
|
13
15
|
export {};
|