treege 3.0.0-beta.27 → 3.0.0-beta.28

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.
@@ -1,9 +1,9 @@
1
- import { j as e } from "./node-gfy3ym4p.js";
1
+ import { j as e, T as Ze } from "./ThemeContext-BBEqRK_Q.js";
2
2
  import * as Re from "react";
3
- import { useState as z, useCallback as oe, useEffect as K, useRef as V, useMemo as me, forwardRef as Ze } from "react";
4
- import { q as R, r as ve, c as et, f as tt, k as at, p as st, t as rt, u as nt, i as lt, a as ot, v as it, w as dt } from "./useRenderNode-B9cpomOv.js";
5
- import { MapPin as Ae, ChevronsUpDown as Pe, Check as Te, ChevronLeftIcon as ct, ChevronRightIcon as ut, ChevronDownIcon as ye, Loader2 as he, CircleIcon as mt } from "lucide-react";
6
- import { F as N, L as v, I as _, C as Ne, a as we, b as Ce, c as Se, d as Ie, e as w, f as C, P as ie, g as de, B as ee, h as ce, i as _e, j as h, k as $e, l as ze, S as Oe, m as qe, n as Be, o as He, p as Ve, q as Le, r as ht, s as pt, t as pe, T as xt } from "./ThemeContext-Cc71SvqK.js";
3
+ import { useState as $, useCallback as oe, useEffect as K, useRef as V, useMemo as me, forwardRef as et } from "react";
4
+ import { q as R, r as ve, c as tt, f as at, k as st, p as rt, t as nt, u as lt, i as ot, a as it, v as dt, w as ct } from "./useRenderNode-BACcrUML.js";
5
+ import { MapPin as Ae, ChevronsUpDown as ze, Check as Pe, ChevronLeftIcon as ut, ChevronRightIcon as mt, ChevronDownIcon as ye, Loader2 as he, CircleIcon as ht } from "lucide-react";
6
+ import { F as N, L as v, I as _, C as Ne, a as we, b as Ce, c as Se, d as Ie, e as w, f as C, P as ie, g as de, B as ee, h as ce, i as _e, j as h, k as Te, l as $e, S as Oe, m as qe, n as Be, o as He, p as Ve, q as Le, r as pt, T as xt, s as pe } from "./separator-oCo7kxCK.js";
7
7
  import { getDefaultClassNames as Ee, DayPicker as ft } from "react-day-picker";
8
8
  import * as Q from "@radix-ui/react-tooltip";
9
9
  import * as je from "@radix-ui/react-radio-group";
@@ -63,7 +63,7 @@ const gt = ({ children: t, onSubmit: s }) => /* @__PURE__ */ e.jsx("form", { onS
63
63
  );
64
64
  });
65
65
  }), yt = ({ node: t, value: s, setValue: r, error: a, label: o, placeholder: i, helperText: l, id: u, name: n }) => {
66
- const [d, m] = z(""), [c, p] = z([]), [g, x] = z(!1), { googleApiKey: f, language: I } = ve(), $ = R(), M = oe(
66
+ const [d, m] = $(""), [c, p] = $([]), [g, x] = $(!1), { googleApiKey: f, language: I } = ve(), T = R(), M = oe(
67
67
  (b) => {
68
68
  r(b.value), m(b.value), x(!1);
69
69
  },
@@ -105,14 +105,14 @@ const gt = ({ children: t, onSubmit: s }) => /* @__PURE__ */ e.jsx("form", { onS
105
105
  onFocus: () => {
106
106
  c.length > 0 && x(!0);
107
107
  },
108
- placeholder: i || $("renderer.defaultAddressInput.enterAddress"),
108
+ placeholder: i || T("renderer.defaultAddressInput.enterAddress"),
109
109
  className: "pr-10",
110
110
  autoComplete: "off"
111
111
  }
112
112
  ),
113
113
  /* @__PURE__ */ e.jsx(Ae, { className: "-translate-y-1/2 pointer-events-none absolute top-1/2 right-3 h-4 w-4 text-muted-foreground" }),
114
114
  g && /* @__PURE__ */ e.jsx("div", { className: "absolute z-50 mt-1 w-full rounded-md border bg-popover shadow-md", children: /* @__PURE__ */ e.jsx(Ne, { children: /* @__PURE__ */ e.jsxs(we, { children: [
115
- /* @__PURE__ */ e.jsx(Ce, { children: $("renderer.defaultAddressInput.noAddressesFound") }),
115
+ /* @__PURE__ */ e.jsx(Ce, { children: T("renderer.defaultAddressInput.noAddressesFound") }),
116
116
  /* @__PURE__ */ e.jsx(Se, { children: c.map((b, S) => /* @__PURE__ */ e.jsxs(
117
117
  Ie,
118
118
  {
@@ -142,7 +142,7 @@ const gt = ({ children: t, onSubmit: s }) => /* @__PURE__ */ e.jsx("form", { onS
142
142
  helperText: l,
143
143
  id: u
144
144
  }) => {
145
- const n = R(), [d, m] = z(!1), c = `${u}-trigger`, p = `${u}-error`, g = t.data.options || [], x = g.find((f) => f.value === s);
145
+ const n = R(), [d, m] = $(!1), c = `${u}-trigger`, p = `${u}-error`, g = t.data.options || [], x = g.find((f) => f.value === s);
146
146
  return /* @__PURE__ */ e.jsxs(N, { className: "mb-4", children: [
147
147
  /* @__PURE__ */ e.jsxs(v, { htmlFor: c, children: [
148
148
  o || t.data.name,
@@ -161,7 +161,7 @@ const gt = ({ children: t, onSubmit: s }) => /* @__PURE__ */ e.jsx("form", { onS
161
161
  className: "w-full justify-between font-normal",
162
162
  children: [
163
163
  s ? x?.label ? n(x.label) : s : i || n("renderer.defaultAutocompleteInput.selectOption"),
164
- /* @__PURE__ */ e.jsx(Pe, { className: "ml-2 size-4 shrink-0 opacity-50" })
164
+ /* @__PURE__ */ e.jsx(ze, { className: "ml-2 size-4 shrink-0 opacity-50" })
165
165
  ]
166
166
  }
167
167
  ) }),
@@ -178,7 +178,7 @@ const gt = ({ children: t, onSubmit: s }) => /* @__PURE__ */ e.jsx("form", { onS
178
178
  r(I === s ? "" : I), m(!1);
179
179
  },
180
180
  children: [
181
- /* @__PURE__ */ e.jsx(Te, { className: h("mr-2 size-4", s === f.value ? "opacity-100" : "opacity-0") }),
181
+ /* @__PURE__ */ e.jsx(Pe, { className: h("mr-2 size-4", s === f.value ? "opacity-100" : "opacity-0") }),
182
182
  n(f.label)
183
183
  ]
184
184
  },
@@ -204,7 +204,7 @@ const gt = ({ children: t, onSubmit: s }) => /* @__PURE__ */ e.jsx("form", { onS
204
204
  ] }),
205
205
  /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: t.data.options.map((c, p) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
206
206
  /* @__PURE__ */ e.jsx(
207
- $e,
207
+ Te,
208
208
  {
209
209
  id: `${l}-${c.value}`,
210
210
  name: u,
@@ -222,7 +222,7 @@ const gt = ({ children: t, onSubmit: s }) => /* @__PURE__ */ e.jsx("form", { onS
222
222
  return /* @__PURE__ */ e.jsxs(N, { className: "mb-4", children: [
223
223
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
224
224
  /* @__PURE__ */ e.jsx(
225
- $e,
225
+ Te,
226
226
  {
227
227
  id: l,
228
228
  name: u,
@@ -269,12 +269,12 @@ function Me({
269
269
  },
270
270
  classNames: {
271
271
  button_next: h(
272
- ze({ variant: o }),
272
+ $e({ variant: o }),
273
273
  "size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",
274
274
  n.button_next
275
275
  ),
276
276
  button_previous: h(
277
- ze({ variant: o }),
277
+ $e({ variant: o }),
278
278
  "size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",
279
279
  n.button_previous
280
280
  ),
@@ -314,7 +314,7 @@ function Me({
314
314
  ...s
315
315
  },
316
316
  components: {
317
- Chevron: ({ className: d, orientation: m, ...c }) => m === "left" ? /* @__PURE__ */ e.jsx(ct, { className: h("size-4", d), ...c }) : m === "right" ? /* @__PURE__ */ e.jsx(ut, { className: h("size-4", d), ...c }) : /* @__PURE__ */ e.jsx(ye, { className: h("size-4", d), ...c }),
317
+ Chevron: ({ className: d, orientation: m, ...c }) => m === "left" ? /* @__PURE__ */ e.jsx(ut, { className: h("size-4", d), ...c }) : m === "right" ? /* @__PURE__ */ e.jsx(mt, { className: h("size-4", d), ...c }) : /* @__PURE__ */ e.jsx(ye, { className: h("size-4", d), ...c }),
318
318
  DayButton: Ct,
319
319
  Root: ({ className: d, rootRef: m, ...c }) => /* @__PURE__ */ e.jsx("div", { "data-slot": "calendar", ref: m, className: h(d), ...c }),
320
320
  WeekNumber: ({ children: d, ...m }) => /* @__PURE__ */ e.jsx("td", { ...m, children: /* @__PURE__ */ e.jsx("div", { className: "flex size-(--cell-size) items-center justify-center text-center", children: d }) }),
@@ -349,7 +349,7 @@ function Ct({ className: t, day: s, modifiers: r, ...a }) {
349
349
  );
350
350
  }
351
351
  const St = ({ node: t, value: s, setValue: r, error: a, label: o, placeholder: i, helperText: l, id: u, name: n }) => {
352
- const [d, m] = z(!1), c = R(), p = s ? new Date(s) : void 0, g = (x) => {
352
+ const [d, m] = $(!1), c = R(), p = s ? new Date(s) : void 0, g = (x) => {
353
353
  if (t.data.disablePast) {
354
354
  const f = /* @__PURE__ */ new Date();
355
355
  return f.setHours(0, 0, 0, 0), x < f;
@@ -383,12 +383,12 @@ const St = ({ node: t, value: s, setValue: r, error: a, label: o, placeholder: i
383
383
  l && !a && /* @__PURE__ */ e.jsx(C, { children: l })
384
384
  ] });
385
385
  }, It = ({ node: t, value: s, setValue: r, error: a, label: o, helperText: i, id: l }) => {
386
- const [u, n] = z(!1), d = R(), m = Array.isArray(s) ? s : [], c = m[0] ? new Date(m[0]) : void 0, p = m[1] ? new Date(m[1]) : void 0, g = (I) => {
386
+ const [u, n] = $(!1), d = R(), m = Array.isArray(s) ? s : [], c = m[0] ? new Date(m[0]) : void 0, p = m[1] ? new Date(m[1]) : void 0, g = (I) => {
387
387
  r([I?.from ? I.from.toISOString() : void 0, I?.to ? I.to.toISOString() : void 0]);
388
388
  }, x = () => c && p ? `${c.toLocaleDateString()} - ${p.toLocaleDateString()}` : c ? c.toLocaleDateString() : d("renderer.defaultInputs.selectDateRange"), f = (I) => {
389
389
  if (t.data.disablePast) {
390
- const $ = /* @__PURE__ */ new Date();
391
- return $.setHours(0, 0, 0, 0), I < $;
390
+ const T = /* @__PURE__ */ new Date();
391
+ return T.setHours(0, 0, 0, 0), I < T;
392
392
  }
393
393
  return !1;
394
394
  };
@@ -425,11 +425,11 @@ const St = ({ node: t, value: s, setValue: r, error: a, label: o, placeholder: i
425
425
  return;
426
426
  }
427
427
  if (t.data.multiple) {
428
- const p = await et(Array.from(m));
428
+ const p = await tt(Array.from(m));
429
429
  s(p);
430
430
  return;
431
431
  }
432
- const c = await tt(m[0]);
432
+ const c = await at(m[0]);
433
433
  s(c);
434
434
  };
435
435
  return /* @__PURE__ */ e.jsxs(N, { className: "mb-4", children: [
@@ -488,27 +488,27 @@ const xe = (t, s) => s ? s.split(".").reduce((a, o) => {
488
488
  const i = s[o], l = i == null ? "" : String(i);
489
489
  return r ? encodeURIComponent(l) : l;
490
490
  }), kt = ({ node: t, value: s, setValue: r, error: a, label: o, placeholder: i, helperText: l, id: u, name: n }) => {
491
- const [d, m] = z(!1), [c, p] = z(null), [g, x] = z([]), [f, I] = z(""), [$, M] = z(!1), { formValues: A, inputNodes: b } = ve(), S = R(), { httpConfig: y } = t.data, L = V(!1), G = V(""), J = V(y), X = V(A), te = V(b), ae = V(r), se = V(null), P = V(null), U = me(() => y?.url ? be(y.url) : [], [y?.url]), H = U.length > 0, re = me(() => U.map((D) => `${D}:${String(A[D] ?? "")}`).join("|"), [U, A]), ue = me(() => y?.url ? H ? fe(y.url, A) : !0 : !1, [y?.url, H, A]), E = oe(
491
+ const [d, m] = $(!1), [c, p] = $(null), [g, x] = $([]), [f, I] = $(""), [T, M] = $(!1), { formValues: A, inputNodes: b } = ve(), S = R(), { httpConfig: y } = t.data, L = V(!1), G = V(""), J = V(y), X = V(A), te = V(b), ae = V(r), se = V(null), z = V(null), U = me(() => y?.url ? be(y.url) : [], [y?.url]), H = U.length > 0, re = me(() => U.map((D) => `${D}:${String(A[D] ?? "")}`).join("|"), [U, A]), ue = me(() => y?.url ? H ? fe(y.url, A) : !0 : !1, [y?.url, H, A]), E = oe(
492
492
  async (D) => {
493
- P.current && P.current.abort();
493
+ z.current && z.current.abort();
494
494
  const O = new AbortController();
495
- P.current = O;
496
- const j = J.current, T = X.current, Y = ae.current;
495
+ z.current = O;
496
+ const j = J.current, P = X.current, Y = ae.current;
497
497
  if (!j?.url) {
498
- p(S("renderer.defaultHttpInput.noUrlConfigured")), P.current = null;
498
+ p(S("renderer.defaultHttpInput.noUrlConfigured")), z.current = null;
499
499
  return;
500
500
  }
501
- if (j.url && !fe(j.url, T)) {
502
- P.current = null;
501
+ if (j.url && !fe(j.url, P)) {
502
+ z.current = null;
503
503
  return;
504
504
  }
505
505
  m(!0), p(null);
506
506
  try {
507
- const k = ge(j.url, T, !0), W = j.searchParam && D ? `${k}${k.includes("?") ? "&" : "?"}${j.searchParam}=${encodeURIComponent(D)}` : k, F = {};
507
+ const k = ge(j.url, P, !0), W = j.searchParam && D ? `${k}${k.includes("?") ? "&" : "?"}${j.searchParam}=${encodeURIComponent(D)}` : k, F = {};
508
508
  j.headers?.forEach((le) => {
509
- F[le.key] = ge(le.value, T);
509
+ F[le.key] = ge(le.value, P);
510
510
  });
511
- const q = ["POST", "PUT", "PATCH"].includes(j.method || "") ? j.sendAllFormValues ? JSON.stringify(at(T, te.current)) : j.body ? ge(j.body, T) : void 0 : void 0, B = setTimeout(() => O.abort(), 3e4), ne = await fetch(W, {
511
+ const q = ["POST", "PUT", "PATCH"].includes(j.method || "") ? j.sendAllFormValues ? JSON.stringify(st(P, te.current)) : j.body ? ge(j.body, P) : void 0 : void 0, B = setTimeout(() => O.abort(), 3e4), ne = await fetch(W, {
512
512
  body: q || void 0,
513
513
  headers: {
514
514
  "Content-Type": "application/json",
@@ -521,7 +521,7 @@ const xe = (t, s) => s ? s.split(".").reduce((a, o) => {
521
521
  p(`HTTP Error ${ne.status}: ${ne.statusText}`), m(!1);
522
522
  return;
523
523
  }
524
- const Je = await ne.json(), Fe = st(Je), Z = j.responsePath ? xe(Fe, j.responsePath) : Fe;
524
+ const Je = await ne.json(), Fe = rt(Je), Z = j.responsePath ? xe(Fe, j.responsePath) : Fe;
525
525
  if (j.responseMapping && Array.isArray(Z)) {
526
526
  const { valueField: le = "value", labelField: Xe = "label" } = j.responseMapping, Ye = Z.map((ke) => ({
527
527
  label: String(xe(ke, Xe) || ""),
@@ -536,7 +536,7 @@ const xe = (t, s) => s ? s.split(".").reduce((a, o) => {
536
536
  const W = k instanceof Error ? k.message : S("renderer.defaultHttpInput.fetchFailed");
537
537
  p(W), console.error("HTTP Input fetch error:", k);
538
538
  } finally {
539
- m(!1), P.current = null;
539
+ m(!1), z.current = null;
540
540
  }
541
541
  },
542
542
  [S]
@@ -544,13 +544,13 @@ const xe = (t, s) => s ? s.split(".").reduce((a, o) => {
544
544
  if (K(() => {
545
545
  J.current = y, X.current = A, te.current = b, ae.current = r, se.current = E;
546
546
  }, [y, A, b, r, E]), K(() => () => {
547
- P.current && P.current.abort();
547
+ z.current && z.current.abort();
548
548
  }, []), K(() => {
549
549
  if (L.current)
550
550
  return;
551
551
  L.current = !0;
552
- const D = J.current, O = X.current, j = se.current, T = D?.url && fe(D.url, O);
553
- if (D?.fetchOnMount && T && j && (j(), D.url)) {
552
+ const D = J.current, O = X.current, j = se.current, P = D?.url && fe(D.url, O);
553
+ if (D?.fetchOnMount && P && j && (j(), D.url)) {
554
554
  const Y = be(D.url);
555
555
  G.current = Y.map((k) => `${k}:${String(O[k] ?? "")}`).join("|");
556
556
  }
@@ -580,10 +580,10 @@ const xe = (t, s) => s ? s.split(".").reduce((a, o) => {
580
580
  o || t.data.name,
581
581
  t.data.required && /* @__PURE__ */ e.jsx("span", { className: "text-red-500", children: "*" })
582
582
  ] }),
583
- /* @__PURE__ */ e.jsxs(ie, { open: $, onOpenChange: M, children: [
584
- /* @__PURE__ */ e.jsx(de, { asChild: !0, children: /* @__PURE__ */ e.jsxs(ee, { variant: "outline", role: "combobox", "aria-expanded": $, className: "w-full justify-between", children: [
583
+ /* @__PURE__ */ e.jsxs(ie, { open: T, onOpenChange: M, children: [
584
+ /* @__PURE__ */ e.jsx(de, { asChild: !0, children: /* @__PURE__ */ e.jsxs(ee, { variant: "outline", role: "combobox", "aria-expanded": T, className: "w-full justify-between", children: [
585
585
  q,
586
- /* @__PURE__ */ e.jsx(Pe, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
586
+ /* @__PURE__ */ e.jsx(ze, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
587
587
  ] }) }),
588
588
  /* @__PURE__ */ e.jsx(ce, { className: "w-[300px] p-0", align: "start", children: /* @__PURE__ */ e.jsxs(Ne, { shouldFilter: !1, children: [
589
589
  /* @__PURE__ */ e.jsx(
@@ -612,7 +612,7 @@ const xe = (t, s) => s ? s.split(".").reduce((a, o) => {
612
612
  r(B.value), M(!1);
613
613
  },
614
614
  children: [
615
- /* @__PURE__ */ e.jsx(Te, { className: h("mr-2 h-4 w-4", s === B.value ? "opacity-100" : "opacity-0") }),
615
+ /* @__PURE__ */ e.jsx(Pe, { className: h("mr-2 h-4 w-4", s === B.value ? "opacity-100" : "opacity-0") }),
616
616
  B.label
617
617
  ]
618
618
  },
@@ -626,10 +626,10 @@ const xe = (t, s) => s ? s.split(".").reduce((a, o) => {
626
626
  l && !a && /* @__PURE__ */ e.jsx(C, { children: l })
627
627
  ] });
628
628
  }
629
- const j = d && y?.showLoading, T = U.filter((F) => {
629
+ const j = d && y?.showLoading, P = U.filter((F) => {
630
630
  const q = A[F];
631
631
  return q == null || q === "";
632
- }), Y = T.map((F) => rt(F, b) || F), k = g.length === 0 && !j ? c || (T.length > 0 ? `${S("renderer.defaultHttpInput.waitingForRequiredFields")}: ${Y.join(", ")}` : S("renderer.defaultHttpInput.noDataAvailable")) : void 0, W = /* @__PURE__ */ e.jsxs(
632
+ }), Y = P.map((F) => nt(F, b) || F), k = g.length === 0 && !j ? c || (P.length > 0 ? `${S("renderer.defaultHttpInput.waitingForRequiredFields")}: ${Y.join(", ")}` : S("renderer.defaultHttpInput.noDataAvailable")) : void 0, W = /* @__PURE__ */ e.jsxs(
633
633
  Oe,
634
634
  {
635
635
  value: Array.isArray(s) ? s[0] ?? "" : s ?? "",
@@ -705,10 +705,10 @@ const xe = (t, s) => s ? s.split(".").reduce((a, o) => {
705
705
  a && /* @__PURE__ */ e.jsx(w, { children: a }),
706
706
  l && !a && /* @__PURE__ */ e.jsx(C, { children: l })
707
707
  ] });
708
- function $t({ className: t, ...s }) {
708
+ function Tt({ className: t, ...s }) {
709
709
  return /* @__PURE__ */ e.jsx(je.Root, { "data-slot": "radio-group", className: h("grid gap-3", t), ...s });
710
710
  }
711
- function zt({ className: t, ...s }) {
711
+ function $t({ className: t, ...s }) {
712
712
  return /* @__PURE__ */ e.jsx(
713
713
  je.Item,
714
714
  {
@@ -718,25 +718,25 @@ function zt({ className: t, ...s }) {
718
718
  t
719
719
  ),
720
720
  ...s,
721
- children: /* @__PURE__ */ e.jsx(je.Indicator, { "data-slot": "radio-group-indicator", className: "relative flex items-center justify-center", children: /* @__PURE__ */ e.jsx(mt, { className: "-translate-x-1/2 -translate-y-1/2 absolute top-1/2 left-1/2 size-2 fill-primary" }) })
721
+ children: /* @__PURE__ */ e.jsx(je.Indicator, { "data-slot": "radio-group-indicator", className: "relative flex items-center justify-center", children: /* @__PURE__ */ e.jsx(ht, { className: "-translate-x-1/2 -translate-y-1/2 absolute top-1/2 left-1/2 size-2 fill-primary" }) })
722
722
  }
723
723
  );
724
724
  }
725
- const Pt = ({ node: t, value: s, setValue: r, error: a, label: o, helperText: i, id: l, name: u }) => {
725
+ const zt = ({ node: t, value: s, setValue: r, error: a, label: o, helperText: i, id: l, name: u }) => {
726
726
  const n = R(), d = s ? String(s) : "";
727
727
  return /* @__PURE__ */ e.jsxs(N, { className: "mb-4", children: [
728
728
  /* @__PURE__ */ e.jsxs(v, { className: "mb-1", htmlFor: l, children: [
729
729
  o || t.data.name,
730
730
  t.data.required && /* @__PURE__ */ e.jsx("span", { className: "text-red-500", children: "*" })
731
731
  ] }),
732
- /* @__PURE__ */ e.jsx($t, { value: d, onValueChange: (m) => r(m), id: l, name: u, children: t.data.options?.map((m, c) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
733
- /* @__PURE__ */ e.jsx(zt, { value: String(m.value), id: `${l}-${m.value}`, disabled: m.disabled }),
732
+ /* @__PURE__ */ e.jsx(Tt, { value: d, onValueChange: (m) => r(m), id: l, name: u, children: t.data.options?.map((m, c) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
733
+ /* @__PURE__ */ e.jsx($t, { value: String(m.value), id: `${l}-${m.value}`, disabled: m.disabled }),
734
734
  /* @__PURE__ */ e.jsx(v, { htmlFor: `${l}-${m.value}`, className: "cursor-pointer font-normal text-sm", children: n(m.label) ? n(m.label) : m.value })
735
735
  ] }, m.value + c)) }),
736
736
  a && /* @__PURE__ */ e.jsx(w, { children: a }),
737
737
  i && !a && /* @__PURE__ */ e.jsx(C, { children: i })
738
738
  ] });
739
- }, Tt = ({ node: t, value: s, setValue: r, error: a, label: o, placeholder: i, helperText: l, name: u, id: n }) => {
739
+ }, Pt = ({ node: t, value: s, setValue: r, error: a, label: o, placeholder: i, helperText: l, name: u, id: n }) => {
740
740
  const d = R(), m = s ? String(s) : "";
741
741
  return /* @__PURE__ */ e.jsxs(N, { className: "mb-4", children: [
742
742
  /* @__PURE__ */ e.jsxs(v, { htmlFor: n, children: [
@@ -750,7 +750,7 @@ const Pt = ({ node: t, value: s, setValue: r, error: a, label: o, helperText: i,
750
750
  a && /* @__PURE__ */ e.jsx(w, { children: a }),
751
751
  l && !a && /* @__PURE__ */ e.jsx(C, { children: l })
752
752
  ] });
753
- }, Ke = Ze(
753
+ }, Ke = et(
754
754
  ({ label: t, id: s, disabled: r, onBlur: a, onClick: o, onFocus: i, onPointerDown: l, onPointerLeave: u, onPointerMove: n, ...d }, m) => {
755
755
  const c = R();
756
756
  return /* @__PURE__ */ e.jsx(
@@ -785,14 +785,14 @@ const Pt = ({ node: t, value: s, setValue: r, error: a, label: o, helperText: i,
785
785
  ] }) })
786
786
  ] }) }) : t;
787
787
  }, _t = ({ missingRequiredFields: t, isSubmitting: s, label: r }) => {
788
- const a = nt(), o = a?.components?.submitButton, i = a?.components?.submitButtonWrapper, l = o || Ke, u = i || Qe;
788
+ const a = lt(), o = a?.components?.submitButton, i = a?.components?.submitButtonWrapper, l = o || Ke, u = i || Qe;
789
789
  return /* @__PURE__ */ e.jsx(u, { missingFields: t, children: /* @__PURE__ */ e.jsx(l, { label: r, disabled: s }) });
790
790
  }, Ot = ({ node: t, value: s, setValue: r, error: a, label: o, helperText: i, name: l, id: u }) => /* @__PURE__ */ e.jsxs(N, { className: "mb-4", children: [
791
791
  /* @__PURE__ */ e.jsxs(v, { htmlFor: u, children: [
792
792
  o || t.data.name,
793
793
  t.data.required && /* @__PURE__ */ e.jsx("span", { className: "text-red-500", children: "*" })
794
794
  ] }),
795
- /* @__PURE__ */ e.jsx(ht, { id: u, name: l, checked: s, onCheckedChange: r }),
795
+ /* @__PURE__ */ e.jsx(pt, { id: u, name: l, checked: s, onCheckedChange: r }),
796
796
  i && !a && /* @__PURE__ */ e.jsx(C, { children: i }),
797
797
  a && /* @__PURE__ */ e.jsx(w, { children: a })
798
798
  ] }), qt = ({ node: t, value: s, setValue: r, error: a, label: o, placeholder: i, helperText: l, name: u, id: n }) => /* @__PURE__ */ e.jsxs(N, { className: "mb-4", children: [
@@ -801,7 +801,7 @@ const Pt = ({ node: t, value: s, setValue: r, error: a, label: o, helperText: i,
801
801
  t.data.required && /* @__PURE__ */ e.jsx("span", { className: "text-red-500", children: "*" })
802
802
  ] }),
803
803
  /* @__PURE__ */ e.jsx(
804
- pt,
804
+ xt,
805
805
  {
806
806
  id: n,
807
807
  name: u,
@@ -898,8 +898,8 @@ const Pt = ({ node: t, value: s, setValue: r, error: a, label: o, helperText: i,
898
898
  http: kt,
899
899
  number: Rt,
900
900
  password: At,
901
- radio: Pt,
902
- select: Tt,
901
+ radio: zt,
902
+ select: Pt,
903
903
  submit: _t,
904
904
  switch: Ot,
905
905
  text: Bt,
@@ -914,7 +914,7 @@ const Pt = ({ node: t, value: s, setValue: r, error: a, label: o, helperText: i,
914
914
  /* @__PURE__ */ e.jsx(pe, { className: "my-8 flex-1" })
915
915
  ] }) : /* @__PURE__ */ e.jsx(pe, { className: "my-8" });
916
916
  }, Mt = ({ node: t }) => {
917
- const { edges: s } = ve(), r = R(), a = lt(t.id, s);
917
+ const { edges: s } = ve(), r = R(), a = ot(t.id, s);
918
918
  return /* @__PURE__ */ e.jsx("h2", { className: h("mb-5 font-bold text-2xl", !a && "mt-10"), children: r(t.data?.label) });
919
919
  }, Gt = {
920
920
  divider: Et,
@@ -939,7 +939,7 @@ const Pt = ({ node: t, value: s, setValue: r, error: a, label: o, helperText: i,
939
939
  firstErrorFieldId: x,
940
940
  formErrors: f,
941
941
  formValues: I,
942
- handleSubmit: $,
942
+ handleSubmit: T,
943
943
  inputNodes: M,
944
944
  isSubmitting: A,
945
945
  mergedFlow: b,
@@ -949,7 +949,7 @@ const Pt = ({ node: t, value: s, setValue: r, error: a, label: o, helperText: i,
949
949
  t: G,
950
950
  visibleNodes: J,
951
951
  visibleRootNodes: X
952
- } = ot({
952
+ } = it({
953
953
  components: t,
954
954
  flows: r,
955
955
  googleApiKey: a,
@@ -960,7 +960,7 @@ const Pt = ({ node: t, value: s, setValue: r, error: a, label: o, helperText: i,
960
960
  theme: u,
961
961
  validate: n,
962
962
  validationMode: d
963
- }), { FormWrapper: te, SubmitButton: ae, SubmitButtonWrapper: se, renderNode: P } = it({
963
+ }), { FormWrapper: te, SubmitButton: ae, SubmitButtonWrapper: se, renderNode: z } = dt({
964
964
  config: g,
965
965
  DefaultFormWrapper: gt,
966
966
  DefaultGroup: jt,
@@ -975,12 +975,12 @@ const Pt = ({ node: t, value: s, setValue: r, error: a, label: o, helperText: i,
975
975
  visibleNodes: J
976
976
  }), U = oe(
977
977
  async (H) => {
978
- H.preventDefault(), !await $() && x && document.getElementById(x)?.focus();
978
+ H.preventDefault(), !await T() && x && document.getElementById(x)?.focus();
979
979
  },
980
- [$, x]
980
+ [T, x]
981
981
  );
982
- return /* @__PURE__ */ e.jsx("div", { className: h("treege", s), children: /* @__PURE__ */ e.jsx(xt, { theme: g.theme, storageKey: "treege-renderer-theme", children: /* @__PURE__ */ e.jsxs(
983
- dt,
982
+ return /* @__PURE__ */ e.jsx("div", { className: h("treege", s), children: /* @__PURE__ */ e.jsx(Ze, { theme: g.theme, storageKey: "treege-renderer-theme", children: /* @__PURE__ */ e.jsxs(
983
+ ct,
984
984
  {
985
985
  value: {
986
986
  flows: b,
@@ -993,10 +993,10 @@ const Pt = ({ node: t, value: s, setValue: r, error: a, label: o, helperText: i,
993
993
  },
994
994
  children: [
995
995
  /* @__PURE__ */ e.jsxs(te, { onSubmit: U, children: [
996
- X.map((H) => P(H)),
997
- c && /* @__PURE__ */ e.jsx(se, { missingFields: S, children: /* @__PURE__ */ e.jsx(ae, { label: G("renderer.defaultSubmitButton.submit"), disabled: A }) })
996
+ X.map((H) => z(H)),
997
+ c && /* @__PURE__ */ e.jsx(se, { missingFields: S, children: /* @__PURE__ */ e.jsx(ae, { label: G("renderer.defaultSubmitButton.submit"), disabled: A }) }),
998
+ /* @__PURE__ */ e.jsx("p", { className: "py-2 text-muted-foreground text-xs", children: "Powered by Treege" })
998
999
  ] }),
999
- /* @__PURE__ */ e.jsx("p", { className: "py-2 text-muted-foreground text-xs", children: "Powered by Treege" }),
1000
1000
  L && /* @__PURE__ */ e.jsx(
1001
1001
  "div",
1002
1002
  {
@@ -1033,8 +1033,8 @@ export {
1033
1033
  kt as h,
1034
1034
  Rt as i,
1035
1035
  At as j,
1036
- Pt as k,
1037
- Tt as l,
1036
+ zt as k,
1037
+ Pt as l,
1038
1038
  Ot as m,
1039
1039
  qt as n,
1040
1040
  Bt as o,
package/dist/editor.js CHANGED
@@ -1,5 +1,5 @@
1
- import { T as o } from "./TreegeEditor-PuRxHufZ.js";
2
- import { T as m, u as s } from "./ThemeContext-Cc71SvqK.js";
1
+ import { T as o } from "./TreegeEditor-Bi7GcSKl.js";
2
+ import { T as m, u as s } from "./ThemeContext-BBEqRK_Q.js";
3
3
  export {
4
4
  m as ThemeProvider,
5
5
  o as TreegeEditor,
package/dist/main.js CHANGED
@@ -1,58 +1,57 @@
1
- import { T as t } from "./TreegeEditor-PuRxHufZ.js";
2
- import { T as u, u as r } from "./ThemeContext-Cc71SvqK.js";
3
- import { T as o, l as i, n, j as p, k as f, e as d, b as T, f as D, c as I, d as m, g, h as c, i as F, m as R, o as x, p as b, s as N, u as S, a as h } from "./useRenderNode-B9cpomOv.js";
4
- import { d as w, g as z, b as C, c as k, i as H, a as A } from "./node-gfy3ym4p.js";
5
- import { a as U, b as j, c as y, d as E, e as G, f as V, D as q, g as B, h as J, i as K, j as L, k as M, l as O, m as Q, n as W, o as X, p as Y, q as Z, s as _, t as $, T as ee, r as ae, u as te } from "./TreegeRenderer-COBf5Nh3.js";
1
+ import { T as t } from "./TreegeEditor-Bi7GcSKl.js";
2
+ import { T as u, d as l, g as r, b as i, c as o, i as n, a as p, u as d } from "./ThemeContext-BBEqRK_Q.js";
3
+ import { T, l as D, n as I, j as m, k as g, e as c, b as F, f as R, c as b, d as x, g as N, h as S, i as h, m as v, o as w, p as z, s as C, u as k, a as H } from "./useRenderNode-BACcrUML.js";
4
+ import { a as P, b as U, c as j, d as y, e as E, f as G, D as V, g as q, h as B, i as J, j as K, k as L, l as M, m as O, n as Q, o as W, p as X, q as Y, s as Z, t as _, T as $, r as ee, u as ae } from "./TreegeRenderer-DbE0m_4e.js";
6
5
  export {
7
- U as DefaultAddressInput,
8
- j as DefaultAutocompleteInput,
9
- y as DefaultCheckboxInput,
10
- E as DefaultDateInput,
11
- G as DefaultDateRangeInput,
12
- V as DefaultFileInput,
13
- q as DefaultGroup,
14
- B as DefaultHiddenInput,
15
- J as DefaultHttpInput,
16
- K as DefaultNumberInput,
17
- L as DefaultPasswordInput,
18
- M as DefaultRadioInput,
19
- O as DefaultSelectInput,
20
- Q as DefaultSwitchInput,
21
- W as DefaultTextAreaInput,
22
- X as DefaultTextInput,
23
- Y as DefaultTimeInput,
24
- Z as DefaultTimeRangeInput,
25
- _ as Divider,
6
+ P as DefaultAddressInput,
7
+ U as DefaultAutocompleteInput,
8
+ j as DefaultCheckboxInput,
9
+ y as DefaultDateInput,
10
+ E as DefaultDateRangeInput,
11
+ G as DefaultFileInput,
12
+ V as DefaultGroup,
13
+ q as DefaultHiddenInput,
14
+ B as DefaultHttpInput,
15
+ J as DefaultNumberInput,
16
+ K as DefaultPasswordInput,
17
+ L as DefaultRadioInput,
18
+ M as DefaultSelectInput,
19
+ O as DefaultSwitchInput,
20
+ Q as DefaultTextAreaInput,
21
+ W as DefaultTextInput,
22
+ X as DefaultTimeInput,
23
+ Y as DefaultTimeRangeInput,
24
+ Z as Divider,
26
25
  u as ThemeProvider,
27
- $ as Title,
28
- o as TreegeConfigProvider,
26
+ _ as Title,
27
+ T as TreegeConfigProvider,
29
28
  t as TreegeEditor,
30
- ee as TreegeRenderer,
31
- i as applyReferenceTransformation,
32
- n as calculateReferenceFieldUpdates,
33
- p as checkFormFieldHasValue,
34
- f as convertFormValuesToNamedFormat,
35
- ae as defaultInputRenderers,
36
- te as defaultUI,
37
- d as evaluateCondition,
38
- T as evaluateConditions,
39
- D as fileToSerializable,
40
- I as filesToSerializable,
41
- m as findStartNode,
42
- g as getFlowRenderState,
43
- w as getStaticTranslations,
44
- z as getTranslatedText,
45
- c as isFieldEmpty,
46
- C as isFlowNode,
47
- k as isGroupNode,
48
- H as isInputNode,
49
- F as isStartNode,
50
- A as isUINode,
51
- R as mergeFlows,
52
- x as sanitize,
53
- b as sanitizeHttpResponse,
54
- N as serializableToFile,
55
- r as useTheme,
56
- S as useTreegeConfig,
57
- h as useTreegeRenderer
29
+ $ as TreegeRenderer,
30
+ D as applyReferenceTransformation,
31
+ I as calculateReferenceFieldUpdates,
32
+ m as checkFormFieldHasValue,
33
+ g as convertFormValuesToNamedFormat,
34
+ ee as defaultInputRenderers,
35
+ ae as defaultUI,
36
+ c as evaluateCondition,
37
+ F as evaluateConditions,
38
+ R as fileToSerializable,
39
+ b as filesToSerializable,
40
+ x as findStartNode,
41
+ N as getFlowRenderState,
42
+ l as getStaticTranslations,
43
+ r as getTranslatedText,
44
+ S as isFieldEmpty,
45
+ i as isFlowNode,
46
+ o as isGroupNode,
47
+ n as isInputNode,
48
+ h as isStartNode,
49
+ p as isUINode,
50
+ v as mergeFlows,
51
+ w as sanitize,
52
+ z as sanitizeHttpResponse,
53
+ C as serializableToFile,
54
+ d as useTheme,
55
+ k as useTreegeConfig,
56
+ H as useTreegeRenderer
58
57
  };
@@ -4,10 +4,9 @@ import { TreegeRendererProps } from '../../../types/renderer';
4
4
  * Props for the TreegeRenderer component (React Native)
5
5
  * Same as TreegeRendererProps but:
6
6
  * - Omits className (not used in React Native)
7
- * - Omits theme (not used in React Native)
8
7
  * - Adds style and contentContainerStyle (React Native specific)
9
8
  */
10
- export type TreegeRendererNativeProps = Omit<TreegeRendererProps, "className" | "theme"> & {
9
+ export type TreegeRendererNativeProps = Omit<TreegeRendererProps, "className"> & {
11
10
  /**
12
11
  * Style for the ScrollView container
13
12
  */
@@ -18,5 +17,5 @@ export type TreegeRendererNativeProps = Omit<TreegeRendererProps, "className" |
18
17
  */
19
18
  contentContainerStyle?: ViewStyle;
20
19
  };
21
- declare const TreegeRenderer: ({ components, contentContainerStyle, flows, googleApiKey, language, onChange, onSubmit, style, validate, validationMode, initialValues, }: TreegeRendererNativeProps) => import("react/jsx-runtime").JSX.Element;
20
+ declare const TreegeRenderer: (props: TreegeRendererNativeProps) => import("react/jsx-runtime").JSX.Element;
22
21
  export default TreegeRenderer;