@trackunit/react-form-wizard 0.1.24 → 0.1.27
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 +7 -2
- package/index.esm.js +7 -2
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -156,7 +156,7 @@ const getStateIcon = (state) => {
|
|
|
156
156
|
*/
|
|
157
157
|
const FormWizardSidebarStep = ({ stepNumber, state, basePath, title, subTitle, path, dataTestId, onNavigate, isSubStep, }) => {
|
|
158
158
|
const stateIcon = getStateIcon(state);
|
|
159
|
-
return (jsxRuntime.jsx(reactRouter.Link, { className: cvaFormWizardSidebarStep({ state, isSubStep }), "data-testid": dataTestId !== null && dataTestId !== void 0 ? dataTestId : `form-wizard-sidebar-step-${path}`, onClick: () => onNavigate(), params: { stepPath: path }, to: basePath, children: jsxRuntime.jsxs("div", { className: cvaSectionHeaderContainer(), children: [jsxRuntime.jsx("div", { children: stateIcon !== null && stateIcon !== void 0 ? stateIcon : jsxRuntime.jsx("span", { className: cvaStepNumber({ state, isSubStep }), children: stepNumber }) }), jsxRuntime.jsxs("div", { className: cvaTitleAndDescription(), children: [jsxRuntime.jsx("h1", { className: cvaHeader(), children: title }), subTitle ? jsxRuntime.jsx("p", { className: cvaSubtitle(), children: subTitle }) : null] })] }) }));
|
|
159
|
+
return (jsxRuntime.jsx(reactRouter.Link, { className: cvaFormWizardSidebarStep({ state, isSubStep }), "data-testid": dataTestId !== null && dataTestId !== void 0 ? dataTestId : `form-wizard-sidebar-step-${path}`, onClick: () => onNavigate(), params: prev => (Object.assign(Object.assign({}, prev), { stepPath: path })), search: (prev) => prev, to: basePath, children: jsxRuntime.jsxs("div", { className: cvaSectionHeaderContainer(), children: [jsxRuntime.jsx("div", { children: stateIcon !== null && stateIcon !== void 0 ? stateIcon : jsxRuntime.jsx("span", { className: cvaStepNumber({ state, isSubStep }), children: stepNumber }) }), jsxRuntime.jsxs("div", { className: cvaTitleAndDescription(), children: [jsxRuntime.jsx("h1", { className: cvaHeader(), children: title }), subTitle ? jsxRuntime.jsx("p", { className: cvaSubtitle(), children: subTitle }) : null] })] }) }));
|
|
160
160
|
};
|
|
161
161
|
|
|
162
162
|
/******************************************************************************
|
|
@@ -357,7 +357,12 @@ const FormWizard = ({ lastStepPrimaryActionLabel, steps, fullFormSchema, onCance
|
|
|
357
357
|
}
|
|
358
358
|
if (isFutureStep) {
|
|
359
359
|
return sharedUtils.objectKeys(steps)
|
|
360
|
-
.filter((stepKey, stepIndex) => {
|
|
360
|
+
.filter((stepKey, stepIndex) => {
|
|
361
|
+
var _a, _b;
|
|
362
|
+
return stepIndex < index && steps[stepKey].shouldRender
|
|
363
|
+
? (_b = (_a = steps[stepKey]).shouldRender) === null || _b === void 0 ? void 0 : _b.call(_a, fullFormState)
|
|
364
|
+
: true;
|
|
365
|
+
})
|
|
361
366
|
.every((pastStepKey) => stepStates[pastStepKey] === "valid")
|
|
362
367
|
? "ready"
|
|
363
368
|
: "disabled";
|
package/index.esm.js
CHANGED
|
@@ -152,7 +152,7 @@ const getStateIcon = (state) => {
|
|
|
152
152
|
*/
|
|
153
153
|
const FormWizardSidebarStep = ({ stepNumber, state, basePath, title, subTitle, path, dataTestId, onNavigate, isSubStep, }) => {
|
|
154
154
|
const stateIcon = getStateIcon(state);
|
|
155
|
-
return (jsx(Link, { className: cvaFormWizardSidebarStep({ state, isSubStep }), "data-testid": dataTestId !== null && dataTestId !== void 0 ? dataTestId : `form-wizard-sidebar-step-${path}`, onClick: () => onNavigate(), params: { stepPath: path }, to: basePath, children: jsxs("div", { className: cvaSectionHeaderContainer(), children: [jsx("div", { children: stateIcon !== null && stateIcon !== void 0 ? stateIcon : jsx("span", { className: cvaStepNumber({ state, isSubStep }), children: stepNumber }) }), jsxs("div", { className: cvaTitleAndDescription(), children: [jsx("h1", { className: cvaHeader(), children: title }), subTitle ? jsx("p", { className: cvaSubtitle(), children: subTitle }) : null] })] }) }));
|
|
155
|
+
return (jsx(Link, { className: cvaFormWizardSidebarStep({ state, isSubStep }), "data-testid": dataTestId !== null && dataTestId !== void 0 ? dataTestId : `form-wizard-sidebar-step-${path}`, onClick: () => onNavigate(), params: prev => (Object.assign(Object.assign({}, prev), { stepPath: path })), search: (prev) => prev, to: basePath, children: jsxs("div", { className: cvaSectionHeaderContainer(), children: [jsx("div", { children: stateIcon !== null && stateIcon !== void 0 ? stateIcon : jsx("span", { className: cvaStepNumber({ state, isSubStep }), children: stepNumber }) }), jsxs("div", { className: cvaTitleAndDescription(), children: [jsx("h1", { className: cvaHeader(), children: title }), subTitle ? jsx("p", { className: cvaSubtitle(), children: subTitle }) : null] })] }) }));
|
|
156
156
|
};
|
|
157
157
|
|
|
158
158
|
/******************************************************************************
|
|
@@ -353,7 +353,12 @@ const FormWizard = ({ lastStepPrimaryActionLabel, steps, fullFormSchema, onCance
|
|
|
353
353
|
}
|
|
354
354
|
if (isFutureStep) {
|
|
355
355
|
return objectKeys(steps)
|
|
356
|
-
.filter((stepKey, stepIndex) => {
|
|
356
|
+
.filter((stepKey, stepIndex) => {
|
|
357
|
+
var _a, _b;
|
|
358
|
+
return stepIndex < index && steps[stepKey].shouldRender
|
|
359
|
+
? (_b = (_a = steps[stepKey]).shouldRender) === null || _b === void 0 ? void 0 : _b.call(_a, fullFormState)
|
|
360
|
+
: true;
|
|
361
|
+
})
|
|
357
362
|
.every((pastStepKey) => stepStates[pastStepKey] === "valid")
|
|
358
363
|
? "ready"
|
|
359
364
|
: "disabled";
|