treege 3.0.0-beta.64 → 3.0.0-beta.66

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/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
- 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-CZt7LwVV.js";
4
- import { i as B, n as V, r as H, t as U } from "./renderer-DlAYvOLz.js";
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-1F6m9Sc1.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-DGe-7y4d.js";
4
+ import { i as B, n as V, r as H, t as U } from "./renderer-C2yMYdOd.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), N = () => E(M), P = ({ children: e, ...t }) => /* @__PURE__ */ j(M.Provider, {
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
- }), F = async (e, n, r, i, a) => {
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
- }, I = (e) => {
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
- }, ee = (e, t, n, r, a, s) => {
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 F(i, t, r, a, s);
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(() => I(e), 1e3);
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
- }, L = (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), R = (e, t, n) => {
97
- let r = L(e), i = L(t);
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
- }, z = (e, t, n) => {
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) => R(e, o, "===")) || R(s, o, "===") : a === "!==" ? s.every((e) => R(e, o, "!==")) && R(s, o, "!==") : s.some((e) => R(e, o, a)) : R(s, o, a);
139
- }, B = (e, t, n) => {
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 z(e[0], t, n);
142
- let r = z(e[0], t, n);
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 = z(a, t, n), s = e[i - 1].logicalOperator || h.AND;
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
- }, V = (e) => {
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
- }, te = (e, t, n) => {
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) => B(e.data?.conditions, t, n));
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
- }, W = (e, t, n, r) => {
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
- }, G = (e, t, n) => {
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 = V(t), o = [], s = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Set(), l = !1, u = (e) => {
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 } = te(a.get(e) || [], n, i);
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
- W(s, f, d, i);
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
- }, ne = (e) => e.filter((e) => !r(e)).reduce((e, t) => {
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
- }, []), K = (e) => {
244
+ }, []), W = (e) => {
245
245
  if (typeof e != "object" || !e) return JSON.stringify(e) ?? "null";
246
- if (Array.isArray(e)) return `[${e.map(K).join(",")}]`;
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)}:${K(t[e])}`).join(",")}}`;
249
- }, q = ({ baseUrl: e, components: t, flow: n, googleApiKey: a, headers: o, language: s, onChange: f, onSubmit: p, theme: h, validate: _, validationMode: y, initialValues: b = {} }) => {
250
- let x = N(), S = O(() => ({
251
- baseUrl: e ?? x?.baseUrl,
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 ?? x?.components?.form,
253
+ form: t?.form ?? S?.components?.form,
254
254
  inputs: {
255
- ...x?.components?.inputs,
255
+ ...S?.components?.inputs,
256
256
  ...t?.inputs
257
257
  },
258
- loadingSkeleton: t?.loadingSkeleton ?? x?.components?.loadingSkeleton,
259
- step: t?.step ?? x?.components?.step,
260
- submitButton: t?.submitButton ?? x?.components?.submitButton,
261
- submitButtonWrapper: t?.submitButtonWrapper ?? x?.components?.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
- ...x?.components?.ui,
263
+ ...S?.components?.ui,
264
264
  ...t?.ui
265
265
  }
266
266
  },
267
- googleApiKey: a ?? x?.googleApiKey,
268
- headers: u(x?.headers, o),
269
- language: s ?? x?.language ?? "en",
270
- theme: h ?? x?.theme ?? "dark",
271
- validationMode: y ?? x?.validationMode ?? "onSubmit"
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
- x,
276
+ S,
276
277
  a,
277
278
  o,
278
279
  s,
279
280
  h,
280
- y
281
- ]), C = O(() => n?.nodes ?? [], [n]), w = O(() => n?.edges ?? [], [n]), E = O(() => g(C), [C]), j = c(S.language), M = k({}), [P, F] = A({}), [I, L] = A(() => m(b, E)), R = O(() => K(b), [b]), z = k(R), { endOfPathReached: B, visibleNodes: V, visibleRootNodes: te } = O(() => G(C, w, I), [
282
- C,
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
- ]), H = O(() => ne(V), [V]), U = O(() => {
287
+ ]), U = O(() => ie(V), [V]), ne = O(() => {
286
288
  let e = /* @__PURE__ */ new Map();
287
- return C.forEach((t) => {
289
+ return w.forEach((t) => {
288
290
  r(t) && e.set(t.id, t);
289
291
  }), e;
290
- }, [C]), [W, q] = A(0), J = H.length === 0 ? 0 : Math.min(W, H.length - 1), Y = H[J], re = Y?.groupId ? U.get(Y.groupId) : void 0, ie = J === 0, ae = H.length === 0 || J >= H.length - 1, { clearSubmitMessage: oe, handleSubmitWithConfig: se, hasSubmitConfig: ce, isSubmitting: le, submitMessage: ue } = ee(V, I, S.language, E, S.headers, S.baseUrl), de = k(f), X = k(_), Z = O(() => v(I, E), [I, E]), fe = T((e, t) => {
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] = j(e.data.errorMessage) || j("validation.required");
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] = j(e.data.errorMessage) || j("validation.invalidFormat"));
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
- j
337
- ]), pe = T(() => {
338
- q((e) => e >= H.length - 1 ? e : e + 1);
339
- }, [H.length]), me = T(() => {
340
- q((e) => Math.max(0, e - 1));
341
- }, []), he = T(async () => {
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 (ce) {
345
- let e = await se((e) => {
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
- ]), ge = O(() => {
359
- if (!Y) return [];
360
+ ]), _e = O(() => {
361
+ if (!J) return [];
360
362
  let e = [];
361
- return Y.nodes.forEach((t) => {
362
- i(t) && t.data.type !== "submit" && t.data.required && d(I[t.id]) && e.push(j(t.data.label) || t.id);
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
- Y,
367
+ J,
366
368
  I,
367
- j
368
- ]), _e = O(() => V.some((e) => i(e) && e.data.type === "submit"), [V]), ve = O(() => Y ? Y.nodes.every((e) => !i(e) || !e.data.required || e.data.type === "submit" ? !0 : !d(I[e.id])) : !1, [Y, I]), ye = O(() => {
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 (H.length === 0) {
374
- W !== 0 && q(0);
375
+ if (U.length === 0) {
376
+ G !== 0 && K(0);
375
377
  return;
376
378
  }
377
- W > H.length - 1 && q(H.length - 1);
378
- }, [H.length, W]), D(() => {
379
- de.current = f;
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
- }, [_]), D(() => {
383
- de.current?.(Z);
383
+ X.current = y;
384
+ }, [y]), D(() => {
385
+ fe.current?.(Z);
384
386
  }, [Z]), D(() => {
385
- S.validationMode === "onChange" && $(X.current);
386
- }, [S.validationMode, $]), D(() => {
387
- let e = l(E, I, M.current);
388
- Object.keys(e).length > 0 && Q(e), M.current = I;
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
- E,
393
+ j,
392
394
  Q
393
395
  ]), D(() => {
394
- z.current !== R && (z.current = R, L(m(b, E)), F({}));
396
+ z.current !== R && (z.current = R, L(m(x, j)), F({}));
395
397
  }, [
396
398
  R,
397
- b,
398
- E
399
+ x,
400
+ j
399
401
  ]), {
400
- canContinueStep: ve,
401
- canSubmit: (_e || B) && C.length > 0,
402
- clearSubmitMessage: oe,
403
- config: S,
404
- currentStep: Y,
405
- currentStepGroupNode: re,
406
- currentStepIndex: J,
407
- firstErrorFieldId: ye,
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: pe,
411
- goToPreviousStep: me,
412
- handleSubmit: he,
413
- hasSubmitInput: _e,
414
- inputNodes: E,
415
- isFirstStep: ie,
416
- isLastStep: ae,
417
- isSubmitting: le,
418
- missingRequiredFields: ge,
419
- prevFormValuesRef: M,
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: fe,
423
+ setFieldValue: pe,
422
424
  setMultipleFieldValues: Q,
423
- steps: H,
424
- submitMessage: ue,
425
- t: j,
425
+ steps: U,
426
+ submitMessage: de,
427
+ t: M,
426
428
  validateForm: $,
427
429
  visibleNodes: V,
428
- visibleRootNodes: te
430
+ visibleRootNodes: H
429
431
  };
430
- }, J = /\{\{([\w-]+)}}/g, Y = (e) => e == null || e === "", re = (...e) => {
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(J)) t.includes(e[1]) || t.push(e[1]);
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
- }, ie = (e) => {
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 re(t.url, t.body, ...n);
439
- }, ae = (e, t, n, r) => ie(e).filter((e) => Y(t[e])).map((e) => {
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, P as c, G as i, N as l, q as n, z as o, U as r, B as s, oe as t };
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 };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "treege",
3
3
  "description": "Powerful form generator",
4
4
  "license": "ISC",
5
- "version": "3.0.0-beta.64",
5
+ "version": "3.0.0-beta.66",
6
6
  "type": "module",
7
7
  "types": "./dist/main.d.ts",
8
8
  "module": "./dist/main.js",