@digiform/wizard 0.3.1 → 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/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/package.json +1 -3
- package/styles.css +1 -1
- 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 +54 -79
- package/wizard/src/features/form-runtime/components/FormFooter.js +53 -184
- package/wizard/src/features/form-runtime/components/FormSection/FormSection.js +150 -194
- package/wizard/src/features/form-runtime/components/FormStep/FormStep.js +83 -92
- package/wizard/src/features/form-runtime/components/StepProgressIndicator/StepProgressIndicator.js +24 -30
- package/wizard/src/features/form-runtime/config/templateLoader.js +48 -55
- package/wizard/src/features/form-runtime/hooks/useComponentTriggers.js +44 -63
- package/wizard/src/features/form-runtime/hooks/useFieldEventHandlers.js +26 -40
- package/wizard/src/features/form-runtime/hooks/useValidationEvents.js +22 -25
- 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/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/ValidationExecutor.js +26 -58
- package/features/form-runtime/utils/formSaver.d.ts +0 -22
- 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/trigger-action-system/components/FieldWarning/FieldWarning.d.ts +0 -20
|
@@ -1,54 +1,50 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as e, jsxs as
|
|
2
|
+
import { jsx as e, jsxs as l } from "react/jsx-runtime";
|
|
3
3
|
/* empty css */
|
|
4
4
|
import { Button as N } from "../../../../../../ui/src/components/button/button.js";
|
|
5
|
-
import { Dialog as
|
|
6
|
-
import { Sheet as
|
|
7
|
-
import { memo as
|
|
5
|
+
import { Dialog as f, DialogContent as g, DialogHeader as D, DialogTitle as S, DialogDescription as T } from "../../../../../../ui/src/components/dialog/dialog.js";
|
|
6
|
+
import { Sheet as I, SheetContent as _, SheetHeader as B, SheetTitle as H } from "../../../../../../ui/src/components/sheet/sheet.js";
|
|
7
|
+
import { memo as M, useState as x } from "react";
|
|
8
8
|
import { ConfirmationDialog as $ } from "../ConfirmationDialog/ConfirmationDialog.js";
|
|
9
9
|
import { EmailVerificationDialog as b } from "../EmailVerificationDialog/EmailVerificationDialog.js";
|
|
10
|
-
import
|
|
11
|
-
const w =
|
|
12
|
-
({ config:
|
|
10
|
+
import r from "./ActionDialog.module.css.js";
|
|
11
|
+
const w = M(
|
|
12
|
+
({ config: a, formData: n, onButtonClick: s, onClose: o, isOpen: i }) => {
|
|
13
13
|
const [c, h] = x(!1);
|
|
14
|
-
if (!
|
|
15
|
-
if (
|
|
16
|
-
config: t,
|
|
17
|
-
typeId: t.templateMetadata?.typeId,
|
|
18
|
-
title: t.title
|
|
19
|
-
}), t.templateMetadata?.typeId === "verify-dialog")
|
|
14
|
+
if (!a) return null;
|
|
15
|
+
if (a.templateMetadata?.typeId === "verify-dialog")
|
|
20
16
|
return /* @__PURE__ */ e(
|
|
21
17
|
b,
|
|
22
18
|
{
|
|
23
|
-
config:
|
|
19
|
+
config: a,
|
|
24
20
|
formData: n,
|
|
25
21
|
onButtonClick: s,
|
|
26
22
|
onClose: o,
|
|
27
23
|
isOpen: i
|
|
28
24
|
}
|
|
29
25
|
);
|
|
30
|
-
if (
|
|
26
|
+
if (a.templateMetadata?.typeId === "confirmation-dialog")
|
|
31
27
|
return /* @__PURE__ */ e(
|
|
32
28
|
$,
|
|
33
29
|
{
|
|
34
|
-
config:
|
|
30
|
+
config: a,
|
|
35
31
|
formData: n,
|
|
36
32
|
onButtonClick: s,
|
|
37
33
|
onClose: o,
|
|
38
34
|
isOpen: i
|
|
39
35
|
}
|
|
40
36
|
);
|
|
41
|
-
const y = async (
|
|
37
|
+
const y = async (t) => {
|
|
42
38
|
h(!0);
|
|
43
39
|
try {
|
|
44
|
-
s(
|
|
40
|
+
s(t.action);
|
|
45
41
|
} finally {
|
|
46
42
|
h(!1);
|
|
47
43
|
}
|
|
48
44
|
}, u = () => {
|
|
49
|
-
|
|
50
|
-
}, v = (
|
|
51
|
-
switch (
|
|
45
|
+
a.dismissible !== !1 && !c && o();
|
|
46
|
+
}, v = (t) => {
|
|
47
|
+
switch (t) {
|
|
52
48
|
case "primary":
|
|
53
49
|
return "default";
|
|
54
50
|
case "secondary":
|
|
@@ -58,53 +54,53 @@ const w = H(
|
|
|
58
54
|
default:
|
|
59
55
|
return "secondary";
|
|
60
56
|
}
|
|
61
|
-
}, d =
|
|
57
|
+
}, d = a.content.replace(
|
|
62
58
|
/\$\{data\.([^}]+)\}/g,
|
|
63
|
-
(
|
|
59
|
+
(t, C) => {
|
|
64
60
|
const p = n[C];
|
|
65
|
-
return p != null ? String(p) :
|
|
61
|
+
return p != null ? String(p) : t;
|
|
66
62
|
}
|
|
67
|
-
), m = () => /* @__PURE__ */ e("div", { className:
|
|
63
|
+
), m = () => /* @__PURE__ */ e("div", { className: r.buttonRow, children: a.buttons.map((t) => /* @__PURE__ */ e(
|
|
68
64
|
N,
|
|
69
65
|
{
|
|
70
|
-
variant: v(
|
|
71
|
-
onClick: () => y(
|
|
66
|
+
variant: v(t.variant),
|
|
67
|
+
onClick: () => y(t),
|
|
72
68
|
disabled: c,
|
|
73
|
-
className:
|
|
74
|
-
children:
|
|
69
|
+
className: r.minWidthButton,
|
|
70
|
+
children: t.label
|
|
75
71
|
},
|
|
76
|
-
`${
|
|
72
|
+
`${t.label}-${t.action}`
|
|
77
73
|
)) });
|
|
78
|
-
return
|
|
79
|
-
/* @__PURE__ */
|
|
80
|
-
/* @__PURE__ */ e("h3", { className:
|
|
74
|
+
return a.type === "toast" ? i ? /* @__PURE__ */ e("div", { className: r.toastContainer, children: /* @__PURE__ */ l("div", { className: r.toastCard, children: [
|
|
75
|
+
/* @__PURE__ */ l("div", { children: [
|
|
76
|
+
/* @__PURE__ */ e("h3", { className: r.toastTitle, children: a.title }),
|
|
81
77
|
/* @__PURE__ */ e(
|
|
82
78
|
"div",
|
|
83
79
|
{
|
|
84
|
-
className:
|
|
80
|
+
className: r.toastContent,
|
|
85
81
|
dangerouslySetInnerHTML: { __html: d }
|
|
86
82
|
}
|
|
87
83
|
)
|
|
88
84
|
] }),
|
|
89
85
|
/* @__PURE__ */ e(m, {})
|
|
90
|
-
] }) }) : null :
|
|
91
|
-
/* @__PURE__ */ e(
|
|
92
|
-
/* @__PURE__ */
|
|
86
|
+
] }) }) : null : a.type === "sidebar" ? /* @__PURE__ */ e(I, { open: i, onOpenChange: (t) => !t && u(), children: /* @__PURE__ */ l(_, { className: r.sheetContent, children: [
|
|
87
|
+
/* @__PURE__ */ e(B, { children: /* @__PURE__ */ e(H, { children: a.title }) }),
|
|
88
|
+
/* @__PURE__ */ l("div", { className: r.sheetBody, children: [
|
|
93
89
|
/* @__PURE__ */ e(
|
|
94
90
|
"div",
|
|
95
91
|
{
|
|
96
|
-
className:
|
|
92
|
+
className: r.sheetText,
|
|
97
93
|
dangerouslySetInnerHTML: { __html: d }
|
|
98
94
|
}
|
|
99
95
|
),
|
|
100
96
|
/* @__PURE__ */ e(m, {})
|
|
101
97
|
] })
|
|
102
|
-
] }) }) : /* @__PURE__ */ e(
|
|
103
|
-
/* @__PURE__ */
|
|
104
|
-
/* @__PURE__ */ e(
|
|
105
|
-
/* @__PURE__ */ e(
|
|
98
|
+
] }) }) : /* @__PURE__ */ e(f, { open: i, onOpenChange: (t) => !t && u(), children: /* @__PURE__ */ l(g, { className: r[`size-${a.size || "medium"}`], children: [
|
|
99
|
+
/* @__PURE__ */ l(D, { children: [
|
|
100
|
+
/* @__PURE__ */ e(S, { children: a.title }),
|
|
101
|
+
/* @__PURE__ */ e(T, { asChild: !0, children: /* @__PURE__ */ e("div", { dangerouslySetInnerHTML: { __html: d } }) })
|
|
106
102
|
] }),
|
|
107
|
-
/* @__PURE__ */ e("div", { className:
|
|
103
|
+
/* @__PURE__ */ e("div", { className: r.modalButtonRow, children: /* @__PURE__ */ e(m, {}) })
|
|
108
104
|
] }) });
|
|
109
105
|
}
|
|
110
106
|
);
|
package/wizard/src/features/dialog-system/components/ConfirmationDialog/ConfirmationDialog.js
CHANGED
|
@@ -1,64 +1,60 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
2
|
+
import { jsx as e, jsxs as t, Fragment as h } from "react/jsx-runtime";
|
|
3
3
|
/* empty css */
|
|
4
|
-
import { Button as
|
|
5
|
-
import { Dialog as
|
|
6
|
-
import { HelpCircle as
|
|
4
|
+
import { Button as f } from "../../../../../../ui/src/components/button/button.js";
|
|
5
|
+
import { Dialog as u, DialogContent as g, DialogHeader as C, DialogTitle as l, DialogDescription as c } from "../../../../../../ui/src/components/dialog/dialog.js";
|
|
6
|
+
import { HelpCircle as s, Info as N, AlertTriangle as D } from "lucide-react";
|
|
7
7
|
import { memo as v } from "react";
|
|
8
|
-
import
|
|
9
|
-
const
|
|
8
|
+
import n from "./ConfirmationDialog.module.css.js";
|
|
9
|
+
const I = v(
|
|
10
10
|
({
|
|
11
11
|
config: i,
|
|
12
|
-
formData:
|
|
13
|
-
onButtonClick:
|
|
14
|
-
onClose:
|
|
15
|
-
isOpen:
|
|
12
|
+
formData: w,
|
|
13
|
+
onButtonClick: m,
|
|
14
|
+
onClose: y,
|
|
15
|
+
isOpen: d
|
|
16
16
|
}) => {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
console.log("🔥 ConfirmationDialog: Button clicked with action:", n), console.log("🔥 ConfirmationDialog: Action type:", n.type), console.log(
|
|
20
|
-
"🔥 ConfirmationDialog: Action details:",
|
|
21
|
-
JSON.stringify(n, null, 2)
|
|
22
|
-
), d(n), console.log("🔥 ConfirmationDialog: onButtonClick called");
|
|
17
|
+
const o = i.templateMetadata, p = (a) => {
|
|
18
|
+
m(a);
|
|
23
19
|
}, r = (() => {
|
|
24
|
-
if (!
|
|
25
|
-
switch (
|
|
20
|
+
if (!o?.showIcon) return null;
|
|
21
|
+
switch (o?.iconType) {
|
|
26
22
|
case "warning":
|
|
27
|
-
return /* @__PURE__ */
|
|
23
|
+
return /* @__PURE__ */ e(D, { className: n.iconWarning });
|
|
28
24
|
case "question":
|
|
29
|
-
return /* @__PURE__ */
|
|
25
|
+
return /* @__PURE__ */ e(s, { className: n.iconInfo });
|
|
30
26
|
case "info":
|
|
31
|
-
return /* @__PURE__ */
|
|
27
|
+
return /* @__PURE__ */ e(N, { className: n.iconInfo });
|
|
32
28
|
default:
|
|
33
|
-
return /* @__PURE__ */
|
|
29
|
+
return /* @__PURE__ */ e(s, { className: n.iconInfo });
|
|
34
30
|
}
|
|
35
31
|
})();
|
|
36
|
-
return /* @__PURE__ */
|
|
37
|
-
/* @__PURE__ */
|
|
38
|
-
/* @__PURE__ */
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
/* @__PURE__ */
|
|
41
|
-
/* @__PURE__ */
|
|
32
|
+
return /* @__PURE__ */ e(u, { open: d, onOpenChange: () => !1, children: /* @__PURE__ */ t(g, { className: n.dialogContent, children: [
|
|
33
|
+
/* @__PURE__ */ e(C, { children: r ? /* @__PURE__ */ t("div", { className: n.iconRow, children: [
|
|
34
|
+
/* @__PURE__ */ e("div", { className: n.iconCircle, children: r }),
|
|
35
|
+
/* @__PURE__ */ t("div", { children: [
|
|
36
|
+
/* @__PURE__ */ e(l, { children: i.title }),
|
|
37
|
+
/* @__PURE__ */ e(c, { className: n.descriptionSpaced, children: i.content })
|
|
42
38
|
] })
|
|
43
|
-
] }) : /* @__PURE__ */
|
|
44
|
-
/* @__PURE__ */
|
|
45
|
-
/* @__PURE__ */
|
|
39
|
+
] }) : /* @__PURE__ */ t(h, { children: [
|
|
40
|
+
/* @__PURE__ */ e(l, { children: i.title }),
|
|
41
|
+
/* @__PURE__ */ e(c, { children: i.content })
|
|
46
42
|
] }) }),
|
|
47
|
-
/* @__PURE__ */
|
|
48
|
-
|
|
43
|
+
/* @__PURE__ */ e("div", { className: n.buttonRow, children: i.buttons.map((a) => /* @__PURE__ */ e(
|
|
44
|
+
f,
|
|
49
45
|
{
|
|
50
|
-
variant:
|
|
51
|
-
onClick: () =>
|
|
52
|
-
className:
|
|
53
|
-
children:
|
|
46
|
+
variant: a.variant === "danger" ? "destructive" : a.variant === "secondary" ? "outline" : "default",
|
|
47
|
+
onClick: () => p(a.action),
|
|
48
|
+
className: n.minWidthButton,
|
|
49
|
+
children: a.label
|
|
54
50
|
},
|
|
55
|
-
|
|
51
|
+
a.id
|
|
56
52
|
)) })
|
|
57
53
|
] }) });
|
|
58
54
|
}
|
|
59
55
|
);
|
|
60
|
-
|
|
56
|
+
I.displayName = "ConfirmationDialog";
|
|
61
57
|
export {
|
|
62
|
-
|
|
63
|
-
|
|
58
|
+
I as ConfirmationDialog,
|
|
59
|
+
I as default
|
|
64
60
|
};
|
|
@@ -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,110 +1,85 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { wizardDefaultRenderer as
|
|
2
|
+
import { jsx as r, jsxs as a } from "react/jsx-runtime";
|
|
3
|
+
import { wizardDefaultRenderer as E } from "../../../renderer/wizardRenderer.js";
|
|
4
4
|
/* empty css */
|
|
5
|
-
import { FormLayout as
|
|
6
|
-
import { formWizardQueryClient as
|
|
7
|
-
import { QueryClientProvider as
|
|
8
|
-
import { clsx as
|
|
9
|
-
import { memo as
|
|
10
|
-
import
|
|
5
|
+
import { FormLayout as s } from "../../../../../ui/src/components/FormLayout/FormLayout.js";
|
|
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
11
|
import W from "../components/FormStep/FormStep.js";
|
|
12
|
-
import
|
|
13
|
-
import { hasTemplateSteps as
|
|
14
|
-
import { ThemeProvider as
|
|
15
|
-
import { useFormMachineProvider as
|
|
16
|
-
import
|
|
17
|
-
import { FormEditingProvider as
|
|
18
|
-
import
|
|
19
|
-
import { ActionManager as
|
|
20
|
-
import { registerRenderComponent as
|
|
21
|
-
import { ValidationEngine as
|
|
22
|
-
import { Heading as
|
|
23
|
-
|
|
24
|
-
const v =
|
|
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(
|
|
25
25
|
({
|
|
26
|
-
config:
|
|
27
|
-
initialData:
|
|
26
|
+
config: e,
|
|
27
|
+
initialData: n = {},
|
|
28
28
|
onSubmit: C,
|
|
29
|
-
queryClient: y =
|
|
29
|
+
queryClient: y = z
|
|
30
30
|
}) => {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
{
|
|
34
|
-
configId: r.id,
|
|
35
|
-
configTitle: r.title,
|
|
36
|
-
stepCount: r.steps?.length,
|
|
37
|
-
validationMessageStyle: r.validationMessageStyle,
|
|
38
|
-
hasInitialData: Object.keys(a).length > 0
|
|
39
|
-
}
|
|
40
|
-
), typeof window < "u" && setTimeout(() => {
|
|
41
|
-
console.log(
|
|
42
|
-
"🚨 [FormWizard] MOUNTED SUCCESSFULLY - Check console for detailed logs"
|
|
43
|
-
);
|
|
44
|
-
}, 100);
|
|
45
|
-
const [t, d] = h(null), [c, f] = h(null);
|
|
46
|
-
w(() => {
|
|
31
|
+
const [i, d] = h(null), [c, f] = h(null);
|
|
32
|
+
P(() => {
|
|
47
33
|
(async () => {
|
|
48
34
|
try {
|
|
49
|
-
if (f(null),
|
|
50
|
-
const o = await
|
|
35
|
+
if (f(null), x(e)) {
|
|
36
|
+
const o = await L(e);
|
|
51
37
|
d(o);
|
|
52
38
|
} else
|
|
53
|
-
d(
|
|
39
|
+
d(e);
|
|
54
40
|
} catch (o) {
|
|
55
41
|
f(
|
|
56
42
|
o instanceof Error ? o.message : "Failed to resolve configuration"
|
|
57
43
|
), console.error("Error resolving form configuration:", o);
|
|
58
44
|
}
|
|
59
45
|
})();
|
|
60
|
-
}, [
|
|
61
|
-
const p =
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
)
|
|
66
|
-
|
|
67
|
-
messageStyle: r.validationMessageStyle || "withLabel"
|
|
68
|
-
});
|
|
69
|
-
return console.log("✅ [FormWizard] ValidationEngine created:", {
|
|
70
|
-
engine: !!i,
|
|
71
|
-
validateField: typeof i.validateField,
|
|
72
|
-
messageStyle: r.validationMessageStyle || "withLabel"
|
|
73
|
-
}), i;
|
|
74
|
-
}, [r.validationMessageStyle]), S = u(() => t ? {
|
|
75
|
-
...t,
|
|
76
|
-
steps: t.steps.map((i) => {
|
|
77
|
-
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;
|
|
78
53
|
return {
|
|
79
54
|
...o,
|
|
80
55
|
schema: o.schema || p.getStepSchema(o)
|
|
81
56
|
};
|
|
82
57
|
})
|
|
83
|
-
} : null, [
|
|
84
|
-
config: S ||
|
|
58
|
+
} : null, [i, p]), F = R({
|
|
59
|
+
config: S || e,
|
|
85
60
|
// Fallback to original config if resolution fails
|
|
86
|
-
initialData:
|
|
61
|
+
initialData: n,
|
|
87
62
|
onSubmit: C
|
|
88
63
|
});
|
|
89
|
-
return c ? /* @__PURE__ */
|
|
90
|
-
/* @__PURE__ */
|
|
91
|
-
/* @__PURE__ */
|
|
92
|
-
] }) :
|
|
93
|
-
/* @__PURE__ */
|
|
94
|
-
/* @__PURE__ */
|
|
95
|
-
/* @__PURE__ */
|
|
96
|
-
/* @__PURE__ */
|
|
97
|
-
/* @__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, {}) })
|
|
98
73
|
] })
|
|
99
|
-
] }) }) }) }) : /* @__PURE__ */
|
|
74
|
+
] }) }) }) }) : /* @__PURE__ */ r("div", { className: u("form-wizard-loading", t.loadingState), children: /* @__PURE__ */ r("div", { className: t.loadingPulse, children: "Loading form templates..." }) });
|
|
100
75
|
}
|
|
101
76
|
);
|
|
102
77
|
v.displayName = "FormWizardCore";
|
|
103
|
-
const
|
|
104
|
-
const
|
|
105
|
-
return /* @__PURE__ */
|
|
78
|
+
const V = (e) => {
|
|
79
|
+
const n = I();
|
|
80
|
+
return /* @__PURE__ */ r(T, { config: n, children: /* @__PURE__ */ r(v, { ...e }) });
|
|
106
81
|
};
|
|
107
|
-
|
|
82
|
+
V.displayName = "FormWizard";
|
|
108
83
|
export {
|
|
109
|
-
|
|
84
|
+
V as default
|
|
110
85
|
};
|