@trackunit/react-form-wizard 0.1.310 → 0.1.312

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
@@ -418,14 +418,15 @@ const FormWizard = ({ lastStepPrimaryActionLabel, isEdit, steps, fullFormSchema,
418
418
  stepNumber: isSubStep ? undefined : rootSteps.indexOf(key) + 1,
419
419
  title,
420
420
  onNavigate: () => {
421
- previousStepKey &&
422
- setFullFormState(prev => {
423
- var _a;
424
- return ({
425
- ...prev,
426
- [previousStepKey]: (_a = stepForms[previousStepKey]) === null || _a === void 0 ? void 0 : _a.getValues(),
427
- });
428
- });
421
+ if (previousStepKey) {
422
+ const previousStepForm = stepForms[previousStepKey];
423
+ setFullFormState(prev => ({
424
+ ...prev,
425
+ [previousStepKey]: previousStepForm
426
+ ? previousStepForm.getValues()
427
+ : fullFormState[previousStepKey],
428
+ }));
429
+ }
429
430
  },
430
431
  basePath,
431
432
  path: String(key),
package/index.esm.js CHANGED
@@ -416,14 +416,15 @@ const FormWizard = ({ lastStepPrimaryActionLabel, isEdit, steps, fullFormSchema,
416
416
  stepNumber: isSubStep ? undefined : rootSteps.indexOf(key) + 1,
417
417
  title,
418
418
  onNavigate: () => {
419
- previousStepKey &&
420
- setFullFormState(prev => {
421
- var _a;
422
- return ({
423
- ...prev,
424
- [previousStepKey]: (_a = stepForms[previousStepKey]) === null || _a === void 0 ? void 0 : _a.getValues(),
425
- });
426
- });
419
+ if (previousStepKey) {
420
+ const previousStepForm = stepForms[previousStepKey];
421
+ setFullFormState(prev => ({
422
+ ...prev,
423
+ [previousStepKey]: previousStepForm
424
+ ? previousStepForm.getValues()
425
+ : fullFormState[previousStepKey],
426
+ }));
427
+ }
427
428
  },
428
429
  basePath,
429
430
  path: String(key),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-form-wizard",
3
- "version": "0.1.310",
3
+ "version": "0.1.312",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "dependencies": {