@topconsultnpm/sdkui-react 6.21.0-dev3.36 → 6.21.0-dev3.37

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.
@@ -10,6 +10,7 @@ interface TMWizardProps {
10
10
  initialData: any;
11
11
  title: string;
12
12
  description: string;
13
+ initialStep?: number;
13
14
  validateOnlyCurrentStep?: boolean;
14
15
  onClose: () => void;
15
16
  onFinish: (data: any) => void;
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  // TMWizard.tsx
3
- import React, { useState } from 'react';
3
+ import React, { useState, useEffect } from 'react';
4
4
  import styled from 'styled-components';
5
5
  import { ResultTypes } from '@topconsultnpm/sdk-ts';
6
6
  import TMButton from '../base/TMButton';
@@ -40,9 +40,11 @@ const ControlsContainer = styled.div `
40
40
  padding: 15px 20px;
41
41
  border-top: 1px solid #eee;
42
42
  `;
43
- const TMWizard = ({ steps, validateOnlyCurrentStep = true, onClose, onFinish, initialData, title, description }) => {
44
- const [currentStep, setCurrentStep] = useState(0);
43
+ const TMWizard = ({ steps, validateOnlyCurrentStep = true, onClose, onFinish, initialData, title, description, initialStep = 0 }) => {
44
+ const [currentStep, setCurrentStep] = useState(initialStep);
45
45
  const [formData, setFormData] = useState(initialData);
46
+ useEffect(() => { setCurrentStep(initialStep); }, [initialStep]);
47
+ useEffect(() => { setFormData(initialData); }, [initialData]);
46
48
  const stepValidationErrors = steps.map((step, index) => {
47
49
  if (validateOnlyCurrentStep) {
48
50
  if (index <= currentStep) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topconsultnpm/sdkui-react",
3
- "version": "6.21.0-dev3.36",
3
+ "version": "6.21.0-dev3.37",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",