treege 3.0.0-beta.64 → 3.0.0-beta.65
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/dist/main.js +2 -2
- package/dist/renderer/features/TreegeRenderer/useTreegeRenderer.d.ts +2 -1
- package/dist/renderer/features/TreegeRenderer/web/TreegeRenderer.d.ts +1 -1
- package/dist/renderer/types/renderer.d.ts +5 -0
- package/dist/{renderer-DlAYvOLz.js → renderer-BZDW7wcE.js} +53 -52
- package/dist/renderer-native.js +620 -619
- package/dist/renderer.js +2 -2
- package/dist/{useRenderNode-CZt7LwVV.js → useRenderNode-DGe-7y4d.js} +113 -111
- package/package.json +1 -1
package/dist/renderer.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { D as e, E as t, P as n, a as r, c as i, h as a, i as o, m as s, n as c, o as l, p as u, r as d, s as f, t as p } from "./ThemeContext-7cghqUb0.js";
|
|
2
2
|
import { S as m, _ as h, a as g, b as _, g as v, h as y, i as b, l as x, m as S, n as C, p as w, r as T, s as E, t as D, u as O, v as k, x as A, y as j } from "./DefaultInputs-2wzCRMKH.js";
|
|
3
|
-
import { a as M, c as N, i as P, l as F, n as I, o as L, r as R, s as z } from "./useRenderNode-
|
|
4
|
-
import { i as B, n as V, r as H, t as U } from "./renderer-
|
|
3
|
+
import { a as M, c as N, i as P, l as F, n as I, o as L, r as R, s as z } from "./useRenderNode-DGe-7y4d.js";
|
|
4
|
+
import { i as B, n as V, r as H, t as U } from "./renderer-BZDW7wcE.js";
|
|
5
5
|
export { m as DefaultAddressInput, A as DefaultAutocompleteInput, _ as DefaultCheckboxInput, j as DefaultDateInput, k as DefaultDateRangeInput, h as DefaultFileInput, v as DefaultHiddenInput, y as DefaultHttpInput, S as DefaultNumberInput, w as DefaultPasswordInput, O as DefaultRadioInput, x as DefaultSelectInput, E as DefaultSwitchInput, g as DefaultTextAreaInput, b as DefaultTextInput, T as DefaultTimeInput, C as DefaultTimeRangeInput, V as Divider, p as ThemeProvider, H as Title, U as TreegeRenderer, N as TreegeRendererProvider, d as applyReferenceTransformation, o as buildInitialFormValues, r as calculateReferenceFieldUpdates, l as checkFormFieldHasValue, f as convertFormValuesToNamedFormat, D as defaultInputRenderers, B as defaultUI, L as evaluateCondition, z as evaluateConditions, u as fileToSerializable, s as filesToSerializable, R as findStartNode, P as getFlowRenderState, n as getTranslatedText, i as isFieldEmpty, M as isStartNode, t as sanitize, e as sanitizeHttpResponse, a as serializableToFile, c as useTheme, I as useTreegeRenderer, F as useTreegeRendererConfig };
|
|
@@ -2,10 +2,10 @@ import { A as e, C as t, E as n, F as r, I as i, L as a, P as o, S as s, T as c,
|
|
|
2
2
|
import { Fragment as C, createContext as w, useCallback as T, useContext as E, useEffect as D, useMemo as O, useRef as k, useState as A } from "react";
|
|
3
3
|
import { jsx as j } from "react/jsx-runtime";
|
|
4
4
|
//#region src/renderer/context/TreegeRendererProvider.tsx
|
|
5
|
-
var M = w(void 0),
|
|
5
|
+
var M = w(void 0), ee = () => E(M), N = ({ children: e, ...t }) => /* @__PURE__ */ j(M.Provider, {
|
|
6
6
|
value: t,
|
|
7
7
|
children: e
|
|
8
|
-
}),
|
|
8
|
+
}), P = async (e, n, r, i, a) => {
|
|
9
9
|
if (!e.url || e.url.trim() === "") return {
|
|
10
10
|
error: "No URL configured for submission",
|
|
11
11
|
success: !1
|
|
@@ -36,9 +36,9 @@ var M = w(void 0), N = () => E(M), P = ({ children: e, ...t }) => /* @__PURE__ *
|
|
|
36
36
|
redirectUrl: l,
|
|
37
37
|
success: !0
|
|
38
38
|
};
|
|
39
|
-
},
|
|
39
|
+
}, F = (e) => {
|
|
40
40
|
e && (e.startsWith("http://") || e.startsWith("https://") ? window.location.href = e : window.history?.pushState ? (window.history.pushState({}, "", e), window.dispatchEvent(new PopStateEvent("popstate"))) : window.location.href = e);
|
|
41
|
-
},
|
|
41
|
+
}, te = (e, t, n, r, a, s) => {
|
|
42
42
|
let [c, l] = A(!1), [u, d] = A(null), f = O(() => {
|
|
43
43
|
let t = e.find((e) => i(e) && e.data?.type === "submit");
|
|
44
44
|
return t && i(t) ? t : null;
|
|
@@ -48,7 +48,7 @@ var M = w(void 0), N = () => E(M), P = ({ children: e, ...t }) => /* @__PURE__ *
|
|
|
48
48
|
if (!i.url || i.url.trim() === "") return null;
|
|
49
49
|
d(null), i.showLoading !== !1 && l(!0);
|
|
50
50
|
try {
|
|
51
|
-
let c = await
|
|
51
|
+
let c = await P(i, t, r, a, s);
|
|
52
52
|
if (c.success) {
|
|
53
53
|
let t = o(i.successMessage, n);
|
|
54
54
|
if (t && d({
|
|
@@ -56,7 +56,7 @@ var M = w(void 0), N = () => E(M), P = ({ children: e, ...t }) => /* @__PURE__ *
|
|
|
56
56
|
type: "success"
|
|
57
57
|
}), e && e(c.data), c.redirectUrl) {
|
|
58
58
|
let e = c.redirectUrl;
|
|
59
|
-
setTimeout(() =>
|
|
59
|
+
setTimeout(() => F(e), 1e3);
|
|
60
60
|
}
|
|
61
61
|
} else d({
|
|
62
62
|
message: o(i.errorMessage, n) || c.error || "An error occurred during submission",
|
|
@@ -93,8 +93,8 @@ var M = w(void 0), N = () => E(M), P = ({ children: e, ...t }) => /* @__PURE__ *
|
|
|
93
93
|
submitButtonNode: f,
|
|
94
94
|
submitMessage: u
|
|
95
95
|
};
|
|
96
|
-
},
|
|
97
|
-
let r =
|
|
96
|
+
}, I = (e) => e == null ? null : typeof e == "boolean" || typeof e == "number" ? e : typeof e == "string" ? e === "" ? null : e : typeof e == "object" ? JSON.stringify(e) : String(e), L = (e, t, n) => {
|
|
97
|
+
let r = I(e), i = I(t);
|
|
98
98
|
if (r === null || i === null) switch (n) {
|
|
99
99
|
case "===": return r === i;
|
|
100
100
|
case "!==": return r !== i;
|
|
@@ -127,7 +127,7 @@ var M = w(void 0), N = () => E(M), P = ({ children: e, ...t }) => /* @__PURE__ *
|
|
|
127
127
|
}
|
|
128
128
|
default: return !1;
|
|
129
129
|
}
|
|
130
|
-
},
|
|
130
|
+
}, R = (e, t, n) => {
|
|
131
131
|
let { field: r, operator: a, value: o } = e;
|
|
132
132
|
if (!(r && a) || o === void 0) return !0;
|
|
133
133
|
let s = t[r];
|
|
@@ -135,25 +135,25 @@ var M = w(void 0), N = () => E(M), P = ({ children: e, ...t }) => /* @__PURE__ *
|
|
|
135
135
|
let e = n.get(r);
|
|
136
136
|
e && i(e) && (s = t[e.id]);
|
|
137
137
|
}
|
|
138
|
-
return Array.isArray(s) ? a === "===" ? s.some((e) =>
|
|
139
|
-
},
|
|
138
|
+
return Array.isArray(s) ? a === "===" ? s.some((e) => L(e, o, "===")) || L(s, o, "===") : a === "!==" ? s.every((e) => L(e, o, "!==")) && L(s, o, "!==") : s.some((e) => L(e, o, a)) : L(s, o, a);
|
|
139
|
+
}, z = (e, t, n) => {
|
|
140
140
|
if (!e || e.length === 0) return !0;
|
|
141
|
-
if (e.length === 1) return
|
|
142
|
-
let r =
|
|
141
|
+
if (e.length === 1) return R(e[0], t, n);
|
|
142
|
+
let r = R(e[0], t, n);
|
|
143
143
|
for (let i = 1; i < e.length; i += 1) {
|
|
144
|
-
let a = e[i], o =
|
|
144
|
+
let a = e[i], o = R(a, t, n), s = e[i - 1].logicalOperator || h.AND;
|
|
145
145
|
if (s === h.AND) {
|
|
146
146
|
if (r &&= o, !r) return !1;
|
|
147
147
|
} else if (s === h.OR && (r ||= o, r)) return !0;
|
|
148
148
|
}
|
|
149
149
|
return r;
|
|
150
|
-
},
|
|
150
|
+
}, B = (e) => {
|
|
151
151
|
let t = /* @__PURE__ */ new Map();
|
|
152
152
|
return e.forEach((e) => {
|
|
153
153
|
let n = t.get(e.source);
|
|
154
154
|
n ? n.push(e) : t.set(e.source, [e]);
|
|
155
155
|
}), t;
|
|
156
|
-
},
|
|
156
|
+
}, V = (e, t, n) => {
|
|
157
157
|
let r = [], a = [], o = [];
|
|
158
158
|
e.forEach((e) => {
|
|
159
159
|
let t = e.data?.isFallback, n = e.data?.conditions?.length;
|
|
@@ -175,7 +175,7 @@ var M = w(void 0), N = () => E(M), P = ({ children: e, ...t }) => /* @__PURE__ *
|
|
|
175
175
|
edgesToFollow: s,
|
|
176
176
|
waitingForInput: s.length === 0
|
|
177
177
|
};
|
|
178
|
-
let c = a.filter((e) =>
|
|
178
|
+
let c = a.filter((e) => z(e.data?.conditions, t, n));
|
|
179
179
|
return c.length > 0 ? (s.push(...c), {
|
|
180
180
|
edgesToFollow: s,
|
|
181
181
|
waitingForInput: !1
|
|
@@ -186,7 +186,7 @@ var M = w(void 0), N = () => E(M), P = ({ children: e, ...t }) => /* @__PURE__ *
|
|
|
186
186
|
}, H = (e, t) => !t.some((t) => t.target === e), U = (e, t) => {
|
|
187
187
|
let n = e.filter((e) => H(e.id, t));
|
|
188
188
|
return n.find(i) || n[0];
|
|
189
|
-
},
|
|
189
|
+
}, ne = (e, t, n, r) => {
|
|
190
190
|
e.forEach((e) => {
|
|
191
191
|
let i = r.get(e);
|
|
192
192
|
if (!i) return;
|
|
@@ -199,7 +199,7 @@ var M = w(void 0), N = () => E(M), P = ({ children: e, ...t }) => /* @__PURE__ *
|
|
|
199
199
|
a = r.get(a)?.parentId;
|
|
200
200
|
}
|
|
201
201
|
});
|
|
202
|
-
},
|
|
202
|
+
}, re = (e, t, n) => {
|
|
203
203
|
let r = U(e, t);
|
|
204
204
|
if (!r) return {
|
|
205
205
|
endOfPathReached: !0,
|
|
@@ -207,13 +207,13 @@ var M = w(void 0), N = () => E(M), P = ({ children: e, ...t }) => /* @__PURE__ *
|
|
|
207
207
|
visibleNodes: [],
|
|
208
208
|
visibleRootNodes: []
|
|
209
209
|
};
|
|
210
|
-
let i = new Map(e.map((e) => [e.id, e])), a =
|
|
210
|
+
let i = new Map(e.map((e) => [e.id, e])), a = B(t), o = [], s = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Set(), l = !1, u = (e) => {
|
|
211
211
|
if (c.has(e)) return;
|
|
212
212
|
c.add(e);
|
|
213
213
|
let t = i.get(e);
|
|
214
214
|
if (!t) return;
|
|
215
215
|
s.add(e), o.push(t);
|
|
216
|
-
let { edgesToFollow: r, waitingForInput: d } =
|
|
216
|
+
let { edgesToFollow: r, waitingForInput: d } = V(a.get(e) || [], n, i);
|
|
217
217
|
if (d) {
|
|
218
218
|
l = !0;
|
|
219
219
|
return;
|
|
@@ -224,7 +224,7 @@ var M = w(void 0), N = () => E(M), P = ({ children: e, ...t }) => /* @__PURE__ *
|
|
|
224
224
|
};
|
|
225
225
|
u(r.id);
|
|
226
226
|
let d = new Map(o.map((e, t) => [e.id, t])), f = new Set(s);
|
|
227
|
-
|
|
227
|
+
ne(s, f, d, i);
|
|
228
228
|
let p = e.filter((e) => f.has(e.id)).sort((e, t) => (d.get(e.id) ?? 2 ** 53 - 1) - (d.get(t.id) ?? 2 ** 53 - 1)), m = p.filter((e) => !(e.parentId && f.has(e.parentId)));
|
|
229
229
|
return {
|
|
230
230
|
endOfPathReached: !l,
|
|
@@ -232,7 +232,7 @@ var M = w(void 0), N = () => E(M), P = ({ children: e, ...t }) => /* @__PURE__ *
|
|
|
232
232
|
visibleNodes: p,
|
|
233
233
|
visibleRootNodes: m
|
|
234
234
|
};
|
|
235
|
-
},
|
|
235
|
+
}, ie = (e) => e.filter((e) => !r(e)).reduce((e, t) => {
|
|
236
236
|
let n = t.parentId ?? null, r = e.at(-1);
|
|
237
237
|
return r && r.groupId === n ? [...e.slice(0, -1), {
|
|
238
238
|
...r,
|
|
@@ -241,53 +241,55 @@ var M = w(void 0), N = () => E(M), P = ({ children: e, ...t }) => /* @__PURE__ *
|
|
|
241
241
|
groupId: n,
|
|
242
242
|
nodes: [t]
|
|
243
243
|
}];
|
|
244
|
-
}, []),
|
|
244
|
+
}, []), W = (e) => {
|
|
245
245
|
if (typeof e != "object" || !e) return JSON.stringify(e) ?? "null";
|
|
246
|
-
if (Array.isArray(e)) return `[${e.map(
|
|
246
|
+
if (Array.isArray(e)) return `[${e.map(W).join(",")}]`;
|
|
247
247
|
let t = e;
|
|
248
|
-
return `{${Object.keys(t).sort().map((e) => `${JSON.stringify(e)}:${
|
|
249
|
-
},
|
|
250
|
-
let
|
|
251
|
-
baseUrl: e ??
|
|
248
|
+
return `{${Object.keys(t).sort().map((e) => `${JSON.stringify(e)}:${W(t[e])}`).join(",")}}`;
|
|
249
|
+
}, G = ({ baseUrl: e, components: t, flow: n, googleApiKey: a, headers: o, language: s, onChange: f, onSubmit: p, showPoweredBy: h, theme: _, validate: y, validationMode: b, initialValues: x = {} }) => {
|
|
250
|
+
let S = ee(), C = O(() => ({
|
|
251
|
+
baseUrl: e ?? S?.baseUrl,
|
|
252
252
|
components: {
|
|
253
|
-
form: t?.form ??
|
|
253
|
+
form: t?.form ?? S?.components?.form,
|
|
254
254
|
inputs: {
|
|
255
|
-
...
|
|
255
|
+
...S?.components?.inputs,
|
|
256
256
|
...t?.inputs
|
|
257
257
|
},
|
|
258
|
-
loadingSkeleton: t?.loadingSkeleton ??
|
|
259
|
-
step: t?.step ??
|
|
260
|
-
submitButton: t?.submitButton ??
|
|
261
|
-
submitButtonWrapper: t?.submitButtonWrapper ??
|
|
258
|
+
loadingSkeleton: t?.loadingSkeleton ?? S?.components?.loadingSkeleton,
|
|
259
|
+
step: t?.step ?? S?.components?.step,
|
|
260
|
+
submitButton: t?.submitButton ?? S?.components?.submitButton,
|
|
261
|
+
submitButtonWrapper: t?.submitButtonWrapper ?? S?.components?.submitButtonWrapper,
|
|
262
262
|
ui: {
|
|
263
|
-
...
|
|
263
|
+
...S?.components?.ui,
|
|
264
264
|
...t?.ui
|
|
265
265
|
}
|
|
266
266
|
},
|
|
267
|
-
googleApiKey: a ??
|
|
268
|
-
headers: u(
|
|
269
|
-
language: s ??
|
|
270
|
-
|
|
271
|
-
|
|
267
|
+
googleApiKey: a ?? S?.googleApiKey,
|
|
268
|
+
headers: u(S?.headers, o),
|
|
269
|
+
language: s ?? S?.language ?? "en",
|
|
270
|
+
showPoweredBy: h ?? S?.showPoweredBy ?? !0,
|
|
271
|
+
theme: _ ?? S?.theme ?? "dark",
|
|
272
|
+
validationMode: b ?? S?.validationMode ?? "onSubmit"
|
|
272
273
|
}), [
|
|
273
274
|
e,
|
|
274
275
|
t,
|
|
275
|
-
|
|
276
|
+
S,
|
|
276
277
|
a,
|
|
277
278
|
o,
|
|
278
279
|
s,
|
|
279
280
|
h,
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
281
|
+
_,
|
|
282
|
+
b
|
|
283
|
+
]), w = O(() => n?.nodes ?? [], [n]), E = O(() => n?.edges ?? [], [n]), j = O(() => g(w), [w]), M = c(C.language), N = k({}), [P, F] = A({}), [I, L] = A(() => m(x, j)), R = O(() => W(x), [x]), z = k(R), { endOfPathReached: B, visibleNodes: V, visibleRootNodes: H } = O(() => re(w, E, I), [
|
|
283
284
|
w,
|
|
285
|
+
E,
|
|
284
286
|
I
|
|
285
|
-
]),
|
|
287
|
+
]), U = O(() => ie(V), [V]), ne = O(() => {
|
|
286
288
|
let e = /* @__PURE__ */ new Map();
|
|
287
|
-
return
|
|
289
|
+
return w.forEach((t) => {
|
|
288
290
|
r(t) && e.set(t.id, t);
|
|
289
291
|
}), e;
|
|
290
|
-
}, [
|
|
292
|
+
}, [w]), [G, K] = A(0), q = U.length === 0 ? 0 : Math.min(G, U.length - 1), J = U[q], Y = J?.groupId ? ne.get(J.groupId) : void 0, ae = q === 0, oe = U.length === 0 || q >= U.length - 1, { clearSubmitMessage: se, handleSubmitWithConfig: ce, hasSubmitConfig: le, isSubmitting: ue, submitMessage: de } = te(V, I, C.language, j, C.headers, C.baseUrl), fe = k(f), X = k(y), Z = O(() => v(I, j), [I, j]), pe = T((e, t) => {
|
|
291
293
|
L((n) => ({
|
|
292
294
|
...n,
|
|
293
295
|
[e]: t
|
|
@@ -311,11 +313,11 @@ var M = w(void 0), N = () => E(M), P = ({ children: e, ...t }) => /* @__PURE__ *
|
|
|
311
313
|
if (i(e)) {
|
|
312
314
|
let n = e.id, r = I[n];
|
|
313
315
|
if (e.data.required && d(r)) {
|
|
314
|
-
t[n] =
|
|
316
|
+
t[n] = M(e.data.errorMessage) || M("validation.required");
|
|
315
317
|
return;
|
|
316
318
|
}
|
|
317
319
|
if (!d(r) && e.data.pattern) try {
|
|
318
|
-
new RegExp(e.data.pattern).test(String(r)) || (t[n] =
|
|
320
|
+
new RegExp(e.data.pattern).test(String(r)) || (t[n] = M(e.data.errorMessage) || M("validation.invalidFormat"));
|
|
319
321
|
} catch (e) {
|
|
320
322
|
console.error(`Invalid pattern for field ${n}:`, e);
|
|
321
323
|
}
|
|
@@ -333,16 +335,16 @@ var M = w(void 0), N = () => E(M), P = ({ children: e, ...t }) => /* @__PURE__ *
|
|
|
333
335
|
}, [
|
|
334
336
|
V,
|
|
335
337
|
I,
|
|
336
|
-
|
|
337
|
-
]),
|
|
338
|
-
|
|
339
|
-
}, [
|
|
340
|
-
|
|
341
|
-
}, []),
|
|
338
|
+
M
|
|
339
|
+
]), me = T(() => {
|
|
340
|
+
K((e) => e >= U.length - 1 ? e : e + 1);
|
|
341
|
+
}, [U.length]), he = T(() => {
|
|
342
|
+
K((e) => Math.max(0, e - 1));
|
|
343
|
+
}, []), ge = T(async () => {
|
|
342
344
|
let { isValid: e } = $(X.current);
|
|
343
345
|
if (!e) return !1;
|
|
344
|
-
if (
|
|
345
|
-
let e = await
|
|
346
|
+
if (le) {
|
|
347
|
+
let e = await ce((e) => {
|
|
346
348
|
p && p(Z, { httpResponse: e });
|
|
347
349
|
});
|
|
348
350
|
if (e === null) return p?.(Z), !0;
|
|
@@ -351,92 +353,92 @@ var M = w(void 0), N = () => E(M), P = ({ children: e, ...t }) => /* @__PURE__ *
|
|
|
351
353
|
return !0;
|
|
352
354
|
}, [
|
|
353
355
|
$,
|
|
356
|
+
le,
|
|
354
357
|
ce,
|
|
355
|
-
se,
|
|
356
358
|
p,
|
|
357
359
|
Z
|
|
358
|
-
]),
|
|
359
|
-
if (!
|
|
360
|
+
]), _e = O(() => {
|
|
361
|
+
if (!J) return [];
|
|
360
362
|
let e = [];
|
|
361
|
-
return
|
|
362
|
-
i(t) && t.data.type !== "submit" && t.data.required && d(I[t.id]) && e.push(
|
|
363
|
+
return J.nodes.forEach((t) => {
|
|
364
|
+
i(t) && t.data.type !== "submit" && t.data.required && d(I[t.id]) && e.push(M(t.data.label) || t.id);
|
|
363
365
|
}), e;
|
|
364
366
|
}, [
|
|
365
|
-
|
|
367
|
+
J,
|
|
366
368
|
I,
|
|
367
|
-
|
|
368
|
-
]),
|
|
369
|
+
M
|
|
370
|
+
]), ve = O(() => V.some((e) => i(e) && e.data.type === "submit"), [V]), ye = O(() => J ? J.nodes.every((e) => !i(e) || !e.data.required || e.data.type === "submit" ? !0 : !d(I[e.id])) : !1, [J, I]), be = O(() => {
|
|
369
371
|
let e = Object.keys(P);
|
|
370
372
|
return e.length > 0 ? e[0] : void 0;
|
|
371
373
|
}, [P]);
|
|
372
374
|
return D(() => {
|
|
373
|
-
if (
|
|
374
|
-
|
|
375
|
+
if (U.length === 0) {
|
|
376
|
+
G !== 0 && K(0);
|
|
375
377
|
return;
|
|
376
378
|
}
|
|
377
|
-
|
|
378
|
-
}, [
|
|
379
|
-
|
|
379
|
+
G > U.length - 1 && K(U.length - 1);
|
|
380
|
+
}, [U.length, G]), D(() => {
|
|
381
|
+
fe.current = f;
|
|
380
382
|
}, [f]), D(() => {
|
|
381
|
-
X.current =
|
|
382
|
-
}, [
|
|
383
|
-
|
|
383
|
+
X.current = y;
|
|
384
|
+
}, [y]), D(() => {
|
|
385
|
+
fe.current?.(Z);
|
|
384
386
|
}, [Z]), D(() => {
|
|
385
|
-
|
|
386
|
-
}, [
|
|
387
|
-
let e = l(
|
|
388
|
-
Object.keys(e).length > 0 && Q(e),
|
|
387
|
+
C.validationMode === "onChange" && $(X.current);
|
|
388
|
+
}, [C.validationMode, $]), D(() => {
|
|
389
|
+
let e = l(j, I, N.current);
|
|
390
|
+
Object.keys(e).length > 0 && Q(e), N.current = I;
|
|
389
391
|
}, [
|
|
390
392
|
I,
|
|
391
|
-
|
|
393
|
+
j,
|
|
392
394
|
Q
|
|
393
395
|
]), D(() => {
|
|
394
|
-
z.current !== R && (z.current = R, L(m(
|
|
396
|
+
z.current !== R && (z.current = R, L(m(x, j)), F({}));
|
|
395
397
|
}, [
|
|
396
398
|
R,
|
|
397
|
-
|
|
398
|
-
|
|
399
|
+
x,
|
|
400
|
+
j
|
|
399
401
|
]), {
|
|
400
|
-
canContinueStep:
|
|
401
|
-
canSubmit: (
|
|
402
|
-
clearSubmitMessage:
|
|
403
|
-
config:
|
|
404
|
-
currentStep:
|
|
405
|
-
currentStepGroupNode:
|
|
406
|
-
currentStepIndex:
|
|
407
|
-
firstErrorFieldId:
|
|
402
|
+
canContinueStep: ye,
|
|
403
|
+
canSubmit: (ve || B) && w.length > 0,
|
|
404
|
+
clearSubmitMessage: se,
|
|
405
|
+
config: C,
|
|
406
|
+
currentStep: J,
|
|
407
|
+
currentStepGroupNode: Y,
|
|
408
|
+
currentStepIndex: q,
|
|
409
|
+
firstErrorFieldId: be,
|
|
408
410
|
formErrors: P,
|
|
409
411
|
formValues: I,
|
|
410
|
-
goToNextStep:
|
|
411
|
-
goToPreviousStep:
|
|
412
|
-
handleSubmit:
|
|
413
|
-
hasSubmitInput:
|
|
414
|
-
inputNodes:
|
|
415
|
-
isFirstStep:
|
|
416
|
-
isLastStep:
|
|
417
|
-
isSubmitting:
|
|
418
|
-
missingRequiredFields:
|
|
419
|
-
prevFormValuesRef:
|
|
412
|
+
goToNextStep: me,
|
|
413
|
+
goToPreviousStep: he,
|
|
414
|
+
handleSubmit: ge,
|
|
415
|
+
hasSubmitInput: ve,
|
|
416
|
+
inputNodes: j,
|
|
417
|
+
isFirstStep: ae,
|
|
418
|
+
isLastStep: oe,
|
|
419
|
+
isSubmitting: ue,
|
|
420
|
+
missingRequiredFields: _e,
|
|
421
|
+
prevFormValuesRef: N,
|
|
420
422
|
setFieldErrors: F,
|
|
421
|
-
setFieldValue:
|
|
423
|
+
setFieldValue: pe,
|
|
422
424
|
setMultipleFieldValues: Q,
|
|
423
|
-
steps:
|
|
424
|
-
submitMessage:
|
|
425
|
-
t:
|
|
425
|
+
steps: U,
|
|
426
|
+
submitMessage: de,
|
|
427
|
+
t: M,
|
|
426
428
|
validateForm: $,
|
|
427
429
|
visibleNodes: V,
|
|
428
|
-
visibleRootNodes:
|
|
430
|
+
visibleRootNodes: H
|
|
429
431
|
};
|
|
430
|
-
},
|
|
432
|
+
}, K = /\{\{([\w-]+)}}/g, q = (e) => e == null || e === "", J = (...e) => {
|
|
431
433
|
let t = [];
|
|
432
|
-
for (let n of e) if (n) for (let e of n.matchAll(
|
|
434
|
+
for (let n of e) if (n) for (let e of n.matchAll(K)) t.includes(e[1]) || t.push(e[1]);
|
|
433
435
|
return t;
|
|
434
|
-
},
|
|
436
|
+
}, Y = (e) => {
|
|
435
437
|
let t = e.data.httpConfig ?? e.data.optionsSource;
|
|
436
438
|
if (!t) return [];
|
|
437
439
|
let n = Object.values(t.queryParams ?? {});
|
|
438
|
-
return
|
|
439
|
-
}, ae = (e, t, n, r) =>
|
|
440
|
+
return J(t.url, t.body, ...n);
|
|
441
|
+
}, ae = (e, t, n, r) => Y(e).filter((e) => q(t[e])).map((e) => {
|
|
440
442
|
let t = n.find((t) => t.id === e);
|
|
441
443
|
return {
|
|
442
444
|
id: e,
|
|
@@ -501,4 +503,4 @@ var M = w(void 0), N = () => E(M), P = ({ children: e, ...t }) => /* @__PURE__ *
|
|
|
501
503
|
};
|
|
502
504
|
};
|
|
503
505
|
//#endregion
|
|
504
|
-
export { H as a,
|
|
506
|
+
export { H as a, N as c, re as i, ee as l, G as n, R as o, U as r, z as s, oe as t };
|