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.
- package/dist/{node-gfy3ym4p.js → ThemeContext-BBEqRK_Q.js} +267 -178
- package/dist/{TreegeEditor-PuRxHufZ.js → TreegeEditor-Bi7GcSKl.js} +35 -35
- package/dist/{TreegeRenderer-COBf5Nh3.js → TreegeRenderer-DbE0m_4e.js} +69 -69
- package/dist/editor.js +2 -2
- package/dist/main.js +53 -54
- package/dist/renderer/features/TreegeRenderer/native/TreegeRenderer.d.ts +2 -3
- package/dist/renderer-native.js +1152 -1298
- package/dist/renderer.js +33 -34
- package/dist/separator-oCo7kxCK.js +364 -0
- package/dist/shared/constants/colors.d.ts +45 -0
- package/dist/shared/context/ThemeContext.d.ts +2 -0
- package/dist/shared/context/ThemeContext.native.d.ts +22 -0
- package/dist/shared/hooks/useThemeColors.d.ts +37 -0
- package/dist/{useRenderNode-B9cpomOv.js → useRenderNode-BACcrUML.js} +1 -1
- package/package.json +1 -1
- package/dist/ThemeContext-Cc71SvqK.js +0 -410
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { j as e } from "./
|
|
1
|
+
import { j as e, T as Ze } from "./ThemeContext-BBEqRK_Q.js";
|
|
2
2
|
import * as Re from "react";
|
|
3
|
-
import { useState as
|
|
4
|
-
import { q as R, r as ve, c as
|
|
5
|
-
import { MapPin as Ae, ChevronsUpDown as
|
|
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
|
|
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] =
|
|
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 ||
|
|
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:
|
|
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] =
|
|
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(
|
|
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(
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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(
|
|
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] =
|
|
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] =
|
|
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
|
|
391
|
-
return
|
|
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
|
|
428
|
+
const p = await tt(Array.from(m));
|
|
429
429
|
s(p);
|
|
430
430
|
return;
|
|
431
431
|
}
|
|
432
|
-
const c = await
|
|
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] =
|
|
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
|
-
|
|
493
|
+
z.current && z.current.abort();
|
|
494
494
|
const O = new AbortController();
|
|
495
|
-
|
|
496
|
-
const j = J.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")),
|
|
498
|
+
p(S("renderer.defaultHttpInput.noUrlConfigured")), z.current = null;
|
|
499
499
|
return;
|
|
500
500
|
}
|
|
501
|
-
if (j.url && !fe(j.url,
|
|
502
|
-
|
|
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,
|
|
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,
|
|
509
|
+
F[le.key] = ge(le.value, P);
|
|
510
510
|
});
|
|
511
|
-
const q = ["POST", "PUT", "PATCH"].includes(j.method || "") ? j.sendAllFormValues ? JSON.stringify(
|
|
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 =
|
|
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),
|
|
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
|
-
|
|
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,
|
|
553
|
-
if (D?.fetchOnMount &&
|
|
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:
|
|
584
|
-
/* @__PURE__ */ e.jsx(de, { asChild: !0, children: /* @__PURE__ */ e.jsxs(ee, { variant: "outline", role: "combobox", "aria-expanded":
|
|
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(
|
|
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(
|
|
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,
|
|
629
|
+
const j = d && y?.showLoading, P = U.filter((F) => {
|
|
630
630
|
const q = A[F];
|
|
631
631
|
return q == null || q === "";
|
|
632
|
-
}), Y =
|
|
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
|
|
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
|
|
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(
|
|
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
|
|
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(
|
|
733
|
-
/* @__PURE__ */ e.jsx(
|
|
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
|
-
},
|
|
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 =
|
|
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 =
|
|
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(
|
|
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
|
-
|
|
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:
|
|
902
|
-
select:
|
|
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 =
|
|
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
|
-
} =
|
|
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:
|
|
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
|
|
978
|
+
H.preventDefault(), !await T() && x && document.getElementById(x)?.focus();
|
|
979
979
|
},
|
|
980
|
-
[
|
|
980
|
+
[T, x]
|
|
981
981
|
);
|
|
982
|
-
return /* @__PURE__ */ e.jsx("div", { className: h("treege", s), children: /* @__PURE__ */ e.jsx(
|
|
983
|
-
|
|
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) =>
|
|
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
|
-
|
|
1037
|
-
|
|
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-
|
|
2
|
-
import { T as m, u as s } from "./ThemeContext-
|
|
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-
|
|
2
|
-
import { T as u,
|
|
3
|
-
import { T
|
|
4
|
-
import { d as
|
|
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
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
-
|
|
28
|
-
|
|
26
|
+
_ as Title,
|
|
27
|
+
T as TreegeConfigProvider,
|
|
29
28
|
t as TreegeEditor,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
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"
|
|
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: (
|
|
20
|
+
declare const TreegeRenderer: (props: TreegeRendererNativeProps) => import("react/jsx-runtime").JSX.Element;
|
|
22
21
|
export default TreegeRenderer;
|