@digiform/wizard 0.3.0 → 0.3.2
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/core/src/types/guards.js +0 -12
- package/core/src/utils/apiBodyUtils.js +43 -75
- package/features/form-runtime/components/FormFooter.d.ts +5 -0
- package/features/form-runtime/hooks/useValidationEvents.d.ts +0 -1
- package/features/state-management/machines/formMachine.d.ts +3 -0
- package/features/state-management/machines/types.d.ts +4 -0
- package/features/state-management/machines/useFormMachine.d.ts +18 -0
- package/index.d.ts +2 -8
- package/index.js +2 -108
- package/package.json +1 -30
- package/styles.css +1 -1
- package/ui/src/lib/utils/templateUtils.js +11 -43
- package/wizard/src/features/api-integration/services/ApiCallService.js +65 -74
- package/wizard/src/features/dialog-system/components/ActionDialog/ActionDialog.js +39 -43
- package/wizard/src/features/dialog-system/components/ConfirmationDialog/ConfirmationDialog.js +37 -41
- package/wizard/src/features/dialog-system/components/EmailVerificationDialog/EmailVerificationDialog.js +44 -45
- package/wizard/src/features/form-runtime/FormWizard/FormWizard.js +56 -78
- package/wizard/src/features/form-runtime/components/FormField.js +28 -28
- package/wizard/src/features/form-runtime/components/FormFooter.js +53 -184
- package/wizard/src/features/form-runtime/components/FormSection/FormSection.js +152 -196
- package/wizard/src/features/form-runtime/components/FormStep/FormStep.js +82 -91
- package/wizard/src/features/form-runtime/components/StepProgressIndicator/StepProgressIndicator.js +24 -30
- package/wizard/src/features/form-runtime/config/configResolver.js +10 -14
- package/wizard/src/features/form-runtime/config/templateLoader.js +71 -108
- package/wizard/src/features/form-runtime/hooks/useComponentTriggers.js +45 -88
- package/wizard/src/features/form-runtime/hooks/useFieldEventHandlers.js +27 -41
- package/wizard/src/features/form-runtime/hooks/useFormFieldState.js +5 -5
- package/wizard/src/features/form-runtime/hooks/useValidationEvents.js +22 -25
- package/wizard/src/features/form-runtime/utils/errorUtils.js +31 -42
- package/wizard/src/features/form-runtime/utils/formDirtyStateSync.js +26 -37
- package/wizard/src/features/form-runtime/utils/logger.js +12 -12
- package/wizard/src/features/form-runtime/utils/validationUX.js +14 -55
- package/wizard/src/features/state-management/machines/actions/navigationActions.js +13 -8
- package/wizard/src/features/state-management/machines/componentTriggerEngine.js +167 -432
- package/wizard/src/features/state-management/machines/formMachine.js +558 -677
- package/wizard/src/features/state-management/machines/useFormMachine.js +172 -190
- package/wizard/src/features/trigger-action-system/components/ActionManager.js +35 -86
- package/wizard/src/features/validation-system/validation/SchemaBuilder.js +28 -82
- package/wizard/src/features/validation-system/validation/ValidationCache.js +11 -27
- package/wizard/src/features/validation-system/validation/ValidationEngine.js +24 -29
- package/wizard/src/features/validation-system/validation/ValidationExecutor.js +26 -58
- package/FormWizard.d.ts +0 -10
- package/core/src/types/api.js +0 -12
- package/core/src/types/form-config.js +0 -60
- package/core/src/types/form-wizard-config-schema.js +0 -113
- package/core/src/types/validation.js +0 -61
- package/features/api-integration.d.ts +0 -2
- package/features/api-integration.js +0 -17
- package/features/dialog-system.d.ts +0 -2
- package/features/dialog-system.js +0 -9
- package/features/form-runtime/utils/formSaver.d.ts +0 -22
- package/features/form-runtime.d.ts +0 -2
- package/features/form-runtime.js +0 -63
- package/features/index.d.ts +0 -11
- package/features/state-management/components/ValidationBuilder/ValidationBuilder.d.ts +0 -9
- package/features/state-management/machines/__tests__/setup.d.ts +0 -0
- package/features/state-management/machines/__tests__/vitest.config.d.ts +0 -2
- package/features/state-management/machines/actions/validationActions.d.ts +0 -68
- package/features/state-management/machines/lazyLoading.d.ts +0 -34
- package/features/state-management/machines/validation/index.d.ts +0 -5
- package/features/state-management/machines/validation/validateField.d.ts +0 -2
- package/features/state-management/machines/validation/validateForm.d.ts +0 -2
- package/features/state-management/machines/validation/validateSection.d.ts +0 -2
- package/features/state-management/machines/validation/validateStep.d.ts +0 -2
- package/features/state-management/machines/validation/validationTypes.d.ts +0 -1
- package/features/state-management.d.ts +0 -2
- package/features/state-management.js +0 -21
- package/features/trigger-action-system/components/FieldWarning/FieldWarning.d.ts +0 -20
- package/features/trigger-action-system.d.ts +0 -2
- package/features/trigger-action-system.js +0 -12
- package/features/validation-system.d.ts +0 -2
- package/features/validation-system.js +0 -23
- package/styles/index.d.ts +0 -0
- package/ui/src/components/badge/badge.js +0 -20
- package/ui/src/components/badge/badge.module.css.js +0 -12
- package/wizard/src/features/api-integration/services/ActionExecutor.js +0 -339
- package/wizard/src/features/api-integration/services/ApiCallExecutor.js +0 -6
- package/wizard/src/features/api-integration/services/DialogExecutor.js +0 -6
- package/wizard/src/features/api-integration/services/GenericTriggerService.js +0 -284
- package/wizard/src/features/api-integration/services/NavigationExecutor.js +0 -6
- package/wizard/src/features/form-runtime/config/templateConfig.js +0 -156
- package/wizard/src/features/form-runtime/config/templateUtils.js +0 -14
- package/wizard/src/features/form-runtime/utils/validation.js +0 -100
- package/wizard/src/features/trigger-action-system/components/ActionLoadingIndicator/ActionLoadingIndicator.js +0 -46
- package/wizard/src/features/trigger-action-system/components/ActionLoadingIndicator/ActionLoadingIndicator.module.css.js +0 -30
- package/wizard/src/features/trigger-action-system/utils/GenericTriggerEngine.js +0 -376
- package/wizard/src/features/validation-system/components/ValidationDebugger.js +0 -69
- package/wizard/src/features/validation-system/validation/tanstackSchemaAdapter.js +0 -17
- package/wizard/src/features/validation-system/validation/validationService.js +0 -74
|
@@ -1,50 +1,49 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as e, jsxs as
|
|
2
|
+
import { jsx as e, jsxs as a } from "react/jsx-runtime";
|
|
3
3
|
/* empty css */
|
|
4
4
|
import { Alert as E, AlertDescription as $ } from "../../../../../../ui/src/components/alert/alert.js";
|
|
5
5
|
import { Button as m } from "../../../../../../ui/src/components/button/button.js";
|
|
6
|
-
import { Dialog as
|
|
6
|
+
import { Dialog as x, DialogContent as D, DialogHeader as V, DialogTitle as A, DialogDescription as L } from "../../../../../../ui/src/components/dialog/dialog.js";
|
|
7
7
|
import { ValidationCode as P } from "../../../../../../ui/src/components/ValidationCode/ValidationCode.js";
|
|
8
8
|
import { CheckCircle as _, Mail as j, AlertCircle as q } from "lucide-react";
|
|
9
|
-
import { memo as H, useState as f, useEffect as I, useCallback as
|
|
9
|
+
import { memo as H, useState as f, useEffect as I, useCallback as O } from "react";
|
|
10
10
|
import i from "./EmailVerificationDialog.module.css.js";
|
|
11
|
-
const
|
|
11
|
+
const W = H(
|
|
12
12
|
({
|
|
13
13
|
config: h,
|
|
14
|
-
formData:
|
|
15
|
-
onButtonClick:
|
|
16
|
-
onClose:
|
|
17
|
-
isOpen:
|
|
14
|
+
formData: Y,
|
|
15
|
+
onButtonClick: u,
|
|
16
|
+
onClose: z,
|
|
17
|
+
isOpen: C
|
|
18
18
|
}) => {
|
|
19
|
-
|
|
20
|
-
const t = h.templateMetadata, [c, C] = f(""), [n, r] = f("idle"), [p, l] = f(""), [d, v] = f(0), [b, k] = f(0);
|
|
19
|
+
const t = h.templateMetadata, [c, p] = f(""), [n, s] = f("idle"), [g, l] = f(""), [d, v] = f(0), [b, k] = f(0);
|
|
21
20
|
I(() => {
|
|
22
21
|
if (d > 0) {
|
|
23
|
-
const
|
|
24
|
-
return () => clearTimeout(
|
|
22
|
+
const o = setTimeout(() => v(d - 1), 1e3);
|
|
23
|
+
return () => clearTimeout(o);
|
|
25
24
|
}
|
|
26
25
|
}, [d]);
|
|
27
|
-
const N =
|
|
28
|
-
|
|
29
|
-
const
|
|
30
|
-
k(
|
|
26
|
+
const N = O(async () => {
|
|
27
|
+
s("verifying");
|
|
28
|
+
const o = b + 1;
|
|
29
|
+
k(o);
|
|
31
30
|
try {
|
|
32
|
-
if (await new Promise((
|
|
33
|
-
|
|
31
|
+
if (await new Promise((r) => setTimeout(r, 1500)), c === "123456" || c === "000000" || c === "111111")
|
|
32
|
+
s("success");
|
|
34
33
|
else {
|
|
35
|
-
const
|
|
36
|
-
if (
|
|
37
|
-
|
|
34
|
+
const r = t?.maxAttempts;
|
|
35
|
+
if (r && o >= r)
|
|
36
|
+
s("blocked"), l(
|
|
38
37
|
"Maximum verification attempts exceeded. Please request a new verification code."
|
|
39
38
|
);
|
|
40
39
|
else {
|
|
41
|
-
|
|
42
|
-
const M =
|
|
40
|
+
s("error");
|
|
41
|
+
const M = r ? r - o : null, R = t?.errorMessage || "Invalid code. Please try again.", S = M ? ` (${M} attempts remaining)` : "";
|
|
43
42
|
l(R + S);
|
|
44
43
|
}
|
|
45
44
|
}
|
|
46
45
|
} catch {
|
|
47
|
-
|
|
46
|
+
s("error"), l(
|
|
48
47
|
t?.errorMessage || "Verification failed. Please try again."
|
|
49
48
|
);
|
|
50
49
|
}
|
|
@@ -53,18 +52,18 @@ const Y = H(
|
|
|
53
52
|
t?.errorMessage,
|
|
54
53
|
t?.maxAttempts,
|
|
55
54
|
b
|
|
56
|
-
]), w = (
|
|
57
|
-
|
|
58
|
-
}, T = (
|
|
59
|
-
|
|
55
|
+
]), w = (o) => {
|
|
56
|
+
p(o), (n === "error" || n === "blocked") && (s("idle"), l(""));
|
|
57
|
+
}, T = (o) => {
|
|
58
|
+
t?.enableAutoSubmit && n === "idle" && N();
|
|
60
59
|
}, y = () => {
|
|
61
|
-
v(t?.resendTimer || 60),
|
|
60
|
+
v(t?.resendTimer || 60), p(""), s("idle"), l(""), k(0);
|
|
62
61
|
}, B = () => {
|
|
63
|
-
|
|
62
|
+
u({ type: "close" });
|
|
64
63
|
};
|
|
65
|
-
return n === "success" ? /* @__PURE__ */ e(
|
|
66
|
-
/* @__PURE__ */
|
|
67
|
-
/* @__PURE__ */
|
|
64
|
+
return n === "success" ? /* @__PURE__ */ e(x, { open: C, onOpenChange: () => !1, children: /* @__PURE__ */ a(D, { className: i.dialogContent, children: [
|
|
65
|
+
/* @__PURE__ */ a(V, { children: [
|
|
66
|
+
/* @__PURE__ */ a("div", { className: i.headerRow, children: [
|
|
68
67
|
/* @__PURE__ */ e(_, { className: `${i.iconMd} ${i.iconSuccess}` }),
|
|
69
68
|
/* @__PURE__ */ e(A, { children: t?.successTitle || "Verification Successful" })
|
|
70
69
|
] }),
|
|
@@ -73,7 +72,7 @@ const Y = H(
|
|
|
73
72
|
/* @__PURE__ */ e("div", { className: i.successButtonRow, children: /* @__PURE__ */ e(
|
|
74
73
|
m,
|
|
75
74
|
{
|
|
76
|
-
onClick: () =>
|
|
75
|
+
onClick: () => u(
|
|
77
76
|
t?.onVerifiedAction || {
|
|
78
77
|
type: "navigate",
|
|
79
78
|
direction: "next"
|
|
@@ -83,16 +82,16 @@ const Y = H(
|
|
|
83
82
|
children: t?.continueButtonLabel || "Continue"
|
|
84
83
|
}
|
|
85
84
|
) })
|
|
86
|
-
] }) }) : /* @__PURE__ */ e(
|
|
87
|
-
/* @__PURE__ */
|
|
88
|
-
/* @__PURE__ */
|
|
85
|
+
] }) }) : /* @__PURE__ */ e(x, { open: C, onOpenChange: () => !1, children: /* @__PURE__ */ a(D, { className: i.dialogContent, children: [
|
|
86
|
+
/* @__PURE__ */ a(V, { children: [
|
|
87
|
+
/* @__PURE__ */ a("div", { className: i.headerRow, children: [
|
|
89
88
|
/* @__PURE__ */ e(j, { className: `${i.iconMd} ${i.iconMail}` }),
|
|
90
89
|
/* @__PURE__ */ e(A, { children: h.title })
|
|
91
90
|
] }),
|
|
92
91
|
/* @__PURE__ */ e(L, { children: h.content })
|
|
93
92
|
] }),
|
|
94
|
-
/* @__PURE__ */
|
|
95
|
-
/* @__PURE__ */
|
|
93
|
+
/* @__PURE__ */ a("div", { className: i.formContent, children: [
|
|
94
|
+
/* @__PURE__ */ a("div", { className: i.codeSection, children: [
|
|
96
95
|
/* @__PURE__ */ e("div", { className: i.codeLabel, children: "Verification Code" }),
|
|
97
96
|
/* @__PURE__ */ e("div", { className: i.codeCenter, children: /* @__PURE__ */ e(
|
|
98
97
|
P,
|
|
@@ -105,9 +104,9 @@ const Y = H(
|
|
|
105
104
|
}
|
|
106
105
|
) })
|
|
107
106
|
] }),
|
|
108
|
-
(n === "error" || n === "blocked") &&
|
|
107
|
+
(n === "error" || n === "blocked") && g && /* @__PURE__ */ a(E, { variant: "destructive", children: [
|
|
109
108
|
/* @__PURE__ */ e(q, { className: i.iconSm }),
|
|
110
|
-
/* @__PURE__ */ e($, { children:
|
|
109
|
+
/* @__PURE__ */ e($, { children: g })
|
|
111
110
|
] }),
|
|
112
111
|
t?.enableResend && n !== "blocked" && /* @__PURE__ */ e("div", { className: i.resendText, children: d > 0 ? `Resend code in ${d}s` : /* @__PURE__ */ e(
|
|
113
112
|
m,
|
|
@@ -128,7 +127,7 @@ const Y = H(
|
|
|
128
127
|
}
|
|
129
128
|
) })
|
|
130
129
|
] }),
|
|
131
|
-
/* @__PURE__ */
|
|
130
|
+
/* @__PURE__ */ a("div", { className: i.footerButtonRow, children: [
|
|
132
131
|
/* @__PURE__ */ e(m, { variant: "secondary", onClick: B, children: t?.cancelButtonLabel || "Cancel" }),
|
|
133
132
|
/* @__PURE__ */ e(
|
|
134
133
|
m,
|
|
@@ -142,8 +141,8 @@ const Y = H(
|
|
|
142
141
|
] }) });
|
|
143
142
|
}
|
|
144
143
|
);
|
|
145
|
-
|
|
144
|
+
W.displayName = "EmailVerificationDialog";
|
|
146
145
|
export {
|
|
147
|
-
|
|
148
|
-
|
|
146
|
+
W as EmailVerificationDialog,
|
|
147
|
+
W as default
|
|
149
148
|
};
|
|
@@ -1,107 +1,85 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import {
|
|
4
|
-
import { ActionManager as M } from "../../trigger-action-system/components/ActionManager.js";
|
|
2
|
+
import { jsx as r, jsxs as a } from "react/jsx-runtime";
|
|
3
|
+
import { wizardDefaultRenderer as E } from "../../../renderer/wizardRenderer.js";
|
|
5
4
|
/* empty css */
|
|
6
5
|
import { FormLayout as s } from "../../../../../ui/src/components/FormLayout/FormLayout.js";
|
|
7
|
-
import { formWizardQueryClient as
|
|
8
|
-
import { QueryClientProvider as
|
|
9
|
-
import { clsx as
|
|
10
|
-
import { memo as
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import { hasTemplateSteps as
|
|
15
|
-
import { ThemeProvider as
|
|
16
|
-
import j from "
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import {
|
|
21
|
-
|
|
6
|
+
import { formWizardQueryClient as z } from "../../../../../ui/src/lib/queryClient.js";
|
|
7
|
+
import { QueryClientProvider as N } from "@tanstack/react-query";
|
|
8
|
+
import { clsx as u } from "clsx";
|
|
9
|
+
import { memo as M, useState as h, useEffect as P, useMemo as g } from "react";
|
|
10
|
+
import t from "./FormWizard.module.css.js";
|
|
11
|
+
import W from "../components/FormStep/FormStep.js";
|
|
12
|
+
import w from "../components/StepProgressIndicator/StepProgressIndicator.js";
|
|
13
|
+
import { hasTemplateSteps as x, resolveFormWizardConfig as L } from "../config/configResolver.js";
|
|
14
|
+
import { ThemeProvider as T, useThemeConfig as I } from "../../../../../ui/src/theme/ThemeProvider.js";
|
|
15
|
+
import { useFormMachineProvider as R, FormMachineContext as j } from "../../state-management/machines/useFormMachine.js";
|
|
16
|
+
import A from "../../../../../ui/src/lib/error-boundaries/FormWizardErrorBoundary.js";
|
|
17
|
+
import { FormEditingProvider as B } from "../../../../../ui/src/lib/providers/FormEditingContext.js";
|
|
18
|
+
import l from "../../../../../ui/src/lib/error-boundaries/ComponentErrorBoundary.js";
|
|
19
|
+
import { ActionManager as H } from "../../trigger-action-system/components/ActionManager.js";
|
|
20
|
+
import { registerRenderComponent as Q } from "../../../../../ui/src/component-registry/renderComponent.js";
|
|
21
|
+
import { ValidationEngine as b } from "../../validation-system/validation/ValidationEngine.js";
|
|
22
|
+
import { Heading as D } from "@rijkshuisstijl-community/components-react";
|
|
23
|
+
Q(E);
|
|
24
|
+
const v = M(
|
|
22
25
|
({
|
|
23
|
-
config:
|
|
24
|
-
initialData:
|
|
25
|
-
onSubmit:
|
|
26
|
-
queryClient:
|
|
26
|
+
config: e,
|
|
27
|
+
initialData: n = {},
|
|
28
|
+
onSubmit: C,
|
|
29
|
+
queryClient: y = z
|
|
27
30
|
}) => {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
{
|
|
31
|
-
configId: r.id,
|
|
32
|
-
configTitle: r.title,
|
|
33
|
-
stepCount: r.steps?.length,
|
|
34
|
-
validationMessageStyle: r.validationMessageStyle,
|
|
35
|
-
hasInitialData: Object.keys(a).length > 0
|
|
36
|
-
}
|
|
37
|
-
), typeof window < "u" && setTimeout(() => {
|
|
38
|
-
console.log(
|
|
39
|
-
"🚨 [FormWizard] MOUNTED SUCCESSFULLY - Check console for detailed logs"
|
|
40
|
-
);
|
|
41
|
-
}, 100);
|
|
42
|
-
const [t, d] = h(null), [c, f] = h(null);
|
|
43
|
-
L(() => {
|
|
31
|
+
const [i, d] = h(null), [c, f] = h(null);
|
|
32
|
+
P(() => {
|
|
44
33
|
(async () => {
|
|
45
34
|
try {
|
|
46
|
-
if (f(null),
|
|
47
|
-
const o = await
|
|
35
|
+
if (f(null), x(e)) {
|
|
36
|
+
const o = await L(e);
|
|
48
37
|
d(o);
|
|
49
38
|
} else
|
|
50
|
-
d(
|
|
39
|
+
d(e);
|
|
51
40
|
} catch (o) {
|
|
52
41
|
f(
|
|
53
42
|
o instanceof Error ? o.message : "Failed to resolve configuration"
|
|
54
43
|
), console.error("Error resolving form configuration:", o);
|
|
55
44
|
}
|
|
56
45
|
})();
|
|
57
|
-
}, [
|
|
58
|
-
const p =
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
)
|
|
63
|
-
|
|
64
|
-
messageStyle: r.validationMessageStyle || "withLabel"
|
|
65
|
-
});
|
|
66
|
-
return console.log("✅ [FormWizard] ValidationEngine created:", {
|
|
67
|
-
engine: !!i,
|
|
68
|
-
validateField: typeof i.validateField,
|
|
69
|
-
messageStyle: r.validationMessageStyle || "withLabel"
|
|
70
|
-
}), i;
|
|
71
|
-
}, [r.validationMessageStyle]), S = u(() => t ? {
|
|
72
|
-
...t,
|
|
73
|
-
steps: t.steps.map((i) => {
|
|
74
|
-
const o = i;
|
|
46
|
+
}, [e]);
|
|
47
|
+
const p = g(() => new b({
|
|
48
|
+
messageStyle: e.validationMessageStyle || "withLabel"
|
|
49
|
+
}), [e.validationMessageStyle]), S = g(() => i ? {
|
|
50
|
+
...i,
|
|
51
|
+
steps: i.steps.map((m) => {
|
|
52
|
+
const o = m;
|
|
75
53
|
return {
|
|
76
54
|
...o,
|
|
77
55
|
schema: o.schema || p.getStepSchema(o)
|
|
78
56
|
};
|
|
79
57
|
})
|
|
80
|
-
} : null, [
|
|
81
|
-
config: S ||
|
|
58
|
+
} : null, [i, p]), F = R({
|
|
59
|
+
config: S || e,
|
|
82
60
|
// Fallback to original config if resolution fails
|
|
83
|
-
initialData:
|
|
84
|
-
onSubmit:
|
|
61
|
+
initialData: n,
|
|
62
|
+
onSubmit: C
|
|
85
63
|
});
|
|
86
|
-
return c ? /* @__PURE__ */
|
|
87
|
-
/* @__PURE__ */
|
|
88
|
-
/* @__PURE__ */
|
|
89
|
-
] }) :
|
|
90
|
-
/* @__PURE__ */
|
|
91
|
-
/* @__PURE__ */
|
|
92
|
-
/* @__PURE__ */
|
|
93
|
-
/* @__PURE__ */
|
|
94
|
-
/* @__PURE__ */
|
|
64
|
+
return c ? /* @__PURE__ */ a("div", { className: u("form-wizard-error", t.errorState), children: [
|
|
65
|
+
/* @__PURE__ */ r("h3", { className: t.errorHeading, children: "Configuration Error" }),
|
|
66
|
+
/* @__PURE__ */ r("p", { children: c })
|
|
67
|
+
] }) : i ? /* @__PURE__ */ r(N, { client: y, children: /* @__PURE__ */ r(A, { formId: e.id, children: /* @__PURE__ */ r(B, { children: /* @__PURE__ */ a(j.Provider, { value: F, children: [
|
|
68
|
+
/* @__PURE__ */ r(l, { componentName: "ActionManager", children: /* @__PURE__ */ r(H, {}) }),
|
|
69
|
+
/* @__PURE__ */ a(s, { className: t.formLayout, children: [
|
|
70
|
+
/* @__PURE__ */ r(s.Title, { children: /* @__PURE__ */ r(D, { level: 1, children: e.title }) }),
|
|
71
|
+
/* @__PURE__ */ r(s.LeftColumn, { children: /* @__PURE__ */ r(l, { componentName: "StepProgressIndicator", children: /* @__PURE__ */ r(w, {}) }) }),
|
|
72
|
+
/* @__PURE__ */ r(l, { componentName: "FormStep", children: /* @__PURE__ */ r(W, {}) })
|
|
95
73
|
] })
|
|
96
|
-
] }) }) }) }) : /* @__PURE__ */
|
|
74
|
+
] }) }) }) }) : /* @__PURE__ */ r("div", { className: u("form-wizard-loading", t.loadingState), children: /* @__PURE__ */ r("div", { className: t.loadingPulse, children: "Loading form templates..." }) });
|
|
97
75
|
}
|
|
98
76
|
);
|
|
99
77
|
v.displayName = "FormWizardCore";
|
|
100
|
-
const
|
|
101
|
-
const
|
|
102
|
-
return /* @__PURE__ */
|
|
78
|
+
const V = (e) => {
|
|
79
|
+
const n = I();
|
|
80
|
+
return /* @__PURE__ */ r(T, { config: n, children: /* @__PURE__ */ r(v, { ...e }) });
|
|
103
81
|
};
|
|
104
|
-
|
|
82
|
+
V.displayName = "FormWizard";
|
|
105
83
|
export {
|
|
106
|
-
|
|
84
|
+
V as default
|
|
107
85
|
};
|
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as n, jsxs as p } from "react/jsx-runtime";
|
|
3
|
-
import { useFormMachine as M } from "../../state-management/machines/useFormMachine.js";
|
|
4
3
|
import { ComponentAlerts as F } from "../../trigger-action-system/components/ComponentAlert/ComponentAlert.js";
|
|
5
4
|
/* empty css */
|
|
6
|
-
import { memo as
|
|
7
|
-
import { adaptComponentForRegistry as
|
|
8
|
-
import { useComponentTriggers as
|
|
9
|
-
import { useComponentVisibility as
|
|
10
|
-
import { useFieldEventHandlers as
|
|
11
|
-
import { useFormContext as
|
|
12
|
-
import { useFormFieldState as
|
|
13
|
-
import { useValidationEvents as
|
|
14
|
-
import { checkHasIsDirtyTriggers as
|
|
5
|
+
import { memo as M, useMemo as N } from "react";
|
|
6
|
+
import { adaptComponentForRegistry as x } from "../ComponentAdapterComplete/ComponentAdapterComplete.js";
|
|
7
|
+
import { useComponentTriggers as _ } from "../hooks/useComponentTriggers.js";
|
|
8
|
+
import { useComponentVisibility as B } from "../hooks/useComponentVisibility.js";
|
|
9
|
+
import { useFieldEventHandlers as H } from "../hooks/useFieldEventHandlers.js";
|
|
10
|
+
import { useFormContext as O } from "../hooks/useFormContext.js";
|
|
11
|
+
import { useFormFieldState as U } from "../hooks/useFormFieldState.js";
|
|
12
|
+
import { useValidationEvents as G } from "../hooks/useValidationEvents.js";
|
|
13
|
+
import { checkHasIsDirtyTriggers as z, shouldBeFormField as P, checkFieldHasValue as j, getValidationDisplayState as q, shouldShowComponentAlerts as J, shouldShowDisplayMode as W } from "../utils/fieldHelpers.js";
|
|
15
14
|
import { logger as e } from "../utils/logger.js";
|
|
16
15
|
import { updateValidationCache as C } from "../utils/validationUX.js";
|
|
17
|
-
import { ProgressLoaderRuntime as
|
|
18
|
-
import { DisplayModeRenderer as
|
|
19
|
-
import { InteractiveFieldRenderer as
|
|
16
|
+
import { ProgressLoaderRuntime as X } from "./ProgressLoaderRuntime.js";
|
|
17
|
+
import { DisplayModeRenderer as Z } from "./renderers/DisplayModeRenderer/DisplayModeRenderer.js";
|
|
18
|
+
import { InteractiveFieldRenderer as K } from "./renderers/InteractiveFieldRenderer/InteractiveFieldRenderer.js";
|
|
19
|
+
import { useFormMachine as Q } from "../../state-management/machines/useFormMachine.js";
|
|
20
20
|
import Y from "../../../../../ui/src/lib/error-boundaries/ComponentErrorBoundary.js";
|
|
21
|
-
const ii =
|
|
21
|
+
const ii = M(
|
|
22
22
|
({ component: i, readOnly: V = !1 }) => {
|
|
23
|
-
const [D, ai, g] =
|
|
23
|
+
const [D, ai, g] = Q(), c = O(), { isVisible: T } = B({
|
|
24
24
|
visibilityConditions: i.visibilityConditions,
|
|
25
25
|
formData: D.context.data
|
|
26
|
-
}), { forceShowValidation: A, resetValidationState: $ } =
|
|
26
|
+
}), { forceShowValidation: A, resetValidationState: $ } = G({
|
|
27
27
|
componentId: i.id
|
|
28
|
-
}), y =
|
|
28
|
+
}), y = z(i), { originalValueFromMachine: b, initializeField: R, getEnhancedIsDirty: S } = U({
|
|
29
29
|
componentId: i.id,
|
|
30
30
|
hasIsDirtyTriggers: y
|
|
31
|
-
}), { handleChange: L, handleBlur: k } =
|
|
31
|
+
}), { handleChange: L, handleBlur: k } = H({
|
|
32
32
|
componentId: i.id,
|
|
33
33
|
hasIsDirtyTriggers: y,
|
|
34
34
|
originalValueFromMachine: b,
|
|
35
35
|
getEnhancedIsDirty: S,
|
|
36
36
|
resetValidationState: $
|
|
37
|
-
}), f =
|
|
37
|
+
}), f = _({
|
|
38
38
|
componentId: i.id
|
|
39
|
-
}), m =
|
|
39
|
+
}), m = N(() => {
|
|
40
40
|
const a = g.validationEngine;
|
|
41
41
|
return e.debug(`ValidationEngine instance check for ${i.id}:`, {
|
|
42
42
|
validationEngine: !!a,
|
|
@@ -156,7 +156,7 @@ const ii = N(
|
|
|
156
156
|
validationRules: i.validation,
|
|
157
157
|
validationEngineExists: !!g.validationEngine
|
|
158
158
|
});
|
|
159
|
-
const w =
|
|
159
|
+
const w = P(i);
|
|
160
160
|
if (i.validation && g.validationEngine)
|
|
161
161
|
try {
|
|
162
162
|
const a = g.validationEngine.validateField(
|
|
@@ -316,21 +316,21 @@ const ii = N(
|
|
|
316
316
|
r
|
|
317
317
|
);
|
|
318
318
|
}
|
|
319
|
-
const s =
|
|
319
|
+
const s = j(t, i.type), d = W(
|
|
320
320
|
V,
|
|
321
321
|
s
|
|
322
|
-
), { isSubmitAttempted: u } =
|
|
322
|
+
), { isSubmitAttempted: u } = q(
|
|
323
323
|
a.state.meta,
|
|
324
324
|
c.state,
|
|
325
325
|
A
|
|
326
|
-
), o =
|
|
326
|
+
), o = J(
|
|
327
327
|
y,
|
|
328
328
|
l,
|
|
329
329
|
f.alerts.length
|
|
330
330
|
);
|
|
331
331
|
return d && I ? /* @__PURE__ */ p("div", { children: [
|
|
332
332
|
/* @__PURE__ */ n(
|
|
333
|
-
|
|
333
|
+
Z,
|
|
334
334
|
{
|
|
335
335
|
component: i,
|
|
336
336
|
fieldValue: t
|
|
@@ -339,7 +339,7 @@ const ii = N(
|
|
|
339
339
|
o && f.alerts.length > 0 && /* @__PURE__ */ n(F, { alerts: f.alerts })
|
|
340
340
|
] }) : /* @__PURE__ */ p("div", { children: [
|
|
341
341
|
/* @__PURE__ */ n(
|
|
342
|
-
|
|
342
|
+
K,
|
|
343
343
|
{
|
|
344
344
|
component: i,
|
|
345
345
|
field: a,
|
|
@@ -369,14 +369,14 @@ const ii = N(
|
|
|
369
369
|
) : i.type === "progress-loader" ? (
|
|
370
370
|
// Special handling for progress-loader: use runtime wrapper for auto-start
|
|
371
371
|
/* @__PURE__ */ n(
|
|
372
|
-
|
|
372
|
+
X,
|
|
373
373
|
{
|
|
374
374
|
properties: i.properties || {}
|
|
375
375
|
}
|
|
376
376
|
)
|
|
377
377
|
) : (
|
|
378
378
|
// For display-only components, render directly without form.Field wrapper
|
|
379
|
-
|
|
379
|
+
x(
|
|
380
380
|
i,
|
|
381
381
|
null,
|
|
382
382
|
// no form value
|