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/{DefaultInputs-2wzCRMKH.js → DefaultInputs-1F6m9Sc1.js} +64 -57
- package/dist/{editor-DPECN9XS.js → editor-CHqeuh7l.js} +2 -2
- package/dist/editor.js +1 -1
- package/dist/main.js +4 -4
- 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-C2yMYdOd.js} +54 -53
- package/dist/renderer-native.js +620 -619
- package/dist/renderer.js +3 -3
- package/dist/{useRenderNode-CZt7LwVV.js → useRenderNode-DGe-7y4d.js} +113 -111
- package/package.json +1 -1
|
@@ -2,8 +2,8 @@ import { C as e, D as t, S as n, T as r, _ as i, b as a, g as o, k as s, m as c,
|
|
|
2
2
|
import * as m from "react";
|
|
3
3
|
import { createContext as h, useCallback as g, useContext as _, useEffect as v, useMemo as y, useRef as b, useState as x } from "react";
|
|
4
4
|
import { Fragment as S, jsx as C, jsxs as w } from "react/jsx-runtime";
|
|
5
|
-
import { Check as T, CheckIcon as E, ChevronDownIcon as D, ChevronLeftIcon as ee, ChevronRightIcon as te, ChevronUpIcon as
|
|
6
|
-
import { Slot as
|
|
5
|
+
import { Check as T, CheckIcon as E, ChevronDownIcon as D, ChevronLeftIcon as ee, ChevronRightIcon as te, ChevronUpIcon as O, ChevronsUpDown as ne, CircleIcon as re, Loader2 as k, MapPin as A, SearchIcon as ie, XIcon as j } from "lucide-react";
|
|
6
|
+
import { Slot as ae } from "@radix-ui/react-slot";
|
|
7
7
|
import { cva as M } from "class-variance-authority";
|
|
8
8
|
import { clsx as oe } from "clsx";
|
|
9
9
|
import { extendTailwindMerge as N } from "tailwind-merge";
|
|
@@ -52,7 +52,7 @@ var ue = M("tg:inline-flex tg:items-center tg:justify-center tg:gap-2 tg:whitesp
|
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
54
|
function G({ className: e, variant: t, size: n, asChild: r = !1, ...i }) {
|
|
55
|
-
return /* @__PURE__ */ C(r ?
|
|
55
|
+
return /* @__PURE__ */ C(r ? ae : "button", {
|
|
56
56
|
"data-slot": "button",
|
|
57
57
|
className: W(ue({
|
|
58
58
|
className: e,
|
|
@@ -206,7 +206,7 @@ var ge = ({ ...e }) => /* @__PURE__ */ C(I.Root, {
|
|
|
206
206
|
"data-slot": "select-scroll-up-button",
|
|
207
207
|
className: W("tg:flex tg:cursor-default tg:items-center tg:justify-center tg:py-1", e),
|
|
208
208
|
...t,
|
|
209
|
-
children: /* @__PURE__ */ C(
|
|
209
|
+
children: /* @__PURE__ */ C(O, { className: "tg:size-4" })
|
|
210
210
|
}), Te = ({ className: e, ...t }) => /* @__PURE__ */ C(I.ScrollDownButton, {
|
|
211
211
|
"data-slot": "select-scroll-down-button",
|
|
212
212
|
className: W("tg:flex tg:cursor-default tg:items-center tg:justify-center tg:py-1", e),
|
|
@@ -298,7 +298,7 @@ function Pe({ className: e, children: t, showCloseButton: n = !0, ...r }) {
|
|
|
298
298
|
children: [t, n && /* @__PURE__ */ w(B.Close, {
|
|
299
299
|
"data-slot": "dialog-close",
|
|
300
300
|
className: "tg:absolute tg:top-4 tg:right-4 tg:rounded-xs tg:opacity-70 tg:ring-offset-background tg:transition-opacity tg:hover:opacity-100 tg:focus:outline-hidden tg:focus:ring-2 tg:focus:ring-ring tg:focus:ring-offset-2 tg:disabled:pointer-events-none tg:data-[state=open]:bg-accent tg:data-[state=open]:text-muted-foreground tg:[&_svg:not([class*='size-'])]:size-4 tg:[&_svg]:pointer-events-none tg:[&_svg]:shrink-0",
|
|
301
|
-
children: [/* @__PURE__ */ C(
|
|
301
|
+
children: [/* @__PURE__ */ C(j, {}), /* @__PURE__ */ C("span", {
|
|
302
302
|
className: "tg:sr-only",
|
|
303
303
|
children: "Close"
|
|
304
304
|
})]
|
|
@@ -348,7 +348,7 @@ function Be({ className: e, ...t }) {
|
|
|
348
348
|
return /* @__PURE__ */ w("div", {
|
|
349
349
|
"data-slot": "command-input-wrapper",
|
|
350
350
|
className: "tg:flex tg:h-9 tg:items-center tg:gap-2 tg:border-b tg:px-3",
|
|
351
|
-
children: [/* @__PURE__ */ C(
|
|
351
|
+
children: [/* @__PURE__ */ C(ie, { className: "tg:size-4 tg:shrink-0 tg:opacity-50" }), /* @__PURE__ */ C(z.Input, {
|
|
352
352
|
"data-slot": "command-input",
|
|
353
353
|
className: W("tg:flex tg:h-10 tg:w-full tg:rounded-md tg:bg-transparent tg:py-3 tg:text-sm tg:outline-hidden tg:placeholder:text-muted-foreground tg:disabled:cursor-not-allowed tg:disabled:opacity-50", e),
|
|
354
354
|
...t
|
|
@@ -463,14 +463,14 @@ var Ge = async (e, t) => {
|
|
|
463
463
|
className: "tg:pr-10",
|
|
464
464
|
autoComplete: "off"
|
|
465
465
|
}),
|
|
466
|
-
/* @__PURE__ */ C(
|
|
466
|
+
/* @__PURE__ */ C(A, { className: "tg:pointer-events-none tg:absolute tg:top-1/2 tg:right-3 tg:h-4 tg:w-4 tg:-translate-y-1/2 tg:text-muted-foreground" }),
|
|
467
467
|
c && /* @__PURE__ */ C("div", {
|
|
468
468
|
className: "tg:absolute tg:z-50 tg:mt-1 tg:w-full tg:rounded-md tg:border tg:bg-popover tg:shadow-md",
|
|
469
469
|
children: /* @__PURE__ */ C(ze, { children: /* @__PURE__ */ w(Ve, { children: [/* @__PURE__ */ C(He, { children: D("renderer.defaultAddressInput.noAddressesFound") }), /* @__PURE__ */ C(Ue, { children: a.map((e, t) => /* @__PURE__ */ w(We, {
|
|
470
470
|
value: e.value,
|
|
471
471
|
onSelect: () => ee(e),
|
|
472
472
|
onMouseDown: (e) => e.preventDefault(),
|
|
473
|
-
children: [/* @__PURE__ */ C(
|
|
473
|
+
children: [/* @__PURE__ */ C(A, { className: "tg:mr-2 tg:h-4 tg:w-4" }), e.label]
|
|
474
474
|
}, t)) })] }) })
|
|
475
475
|
})
|
|
476
476
|
]
|
|
@@ -675,8 +675,8 @@ var nt = ({ label: e, description: t, image: n }) => /* @__PURE__ */ w(S, { chil
|
|
|
675
675
|
className: "tg:w-full tg:justify-between tg:font-normal",
|
|
676
676
|
children: [/* @__PURE__ */ w("span", {
|
|
677
677
|
className: "tg:flex tg:items-center tg:gap-2 tg:truncate",
|
|
678
|
-
children: [h && /* @__PURE__ */ C(
|
|
679
|
-
}), /* @__PURE__ */ C(
|
|
678
|
+
children: [h && /* @__PURE__ */ C(k, { className: "tg:h-4 tg:w-4 tg:shrink-0 tg:animate-spin" }), o ? b?.label ? _(b.label) : o : s || _("renderer.defaultAutocompleteInput.selectOption")]
|
|
679
|
+
}), /* @__PURE__ */ C(ne, { className: "tg:ml-2 tg:size-4 tg:shrink-0 tg:opacity-50" })]
|
|
680
680
|
})
|
|
681
681
|
}), /* @__PURE__ */ C(he, {
|
|
682
682
|
className: "tg:w-(--radix-popover-trigger-width) tg:p-0",
|
|
@@ -707,14 +707,15 @@ var nt = ({ label: e, description: t, image: n }) => /* @__PURE__ */ w(S, { chil
|
|
|
707
707
|
}, ot = ({ field: e, extra: t }) => {
|
|
708
708
|
let { id: n, name: i, value: a } = e, { node: o, setValue: c, error: l, label: u, helperText: d, renderOptionExtras: f, compactOptions: p, missingDependencies: m } = t, { options: h, isLoading: g, error: _ } = it(o), { optionsDisplayLimit: v } = s(), y = r();
|
|
709
709
|
if (h.length > 0 || o.data.optionsSource) {
|
|
710
|
-
let e = Array.isArray(a) ? a.map(String) : [],
|
|
711
|
-
c(n ? [...
|
|
710
|
+
let e = `${n}-label`, t = Array.isArray(a) ? a.map(String) : [], r = v ? h.slice(0, v) : h, s = h.length - r.length, b = (e, n) => {
|
|
711
|
+
c(n ? [...t, e] : t.filter((t) => t !== e));
|
|
712
712
|
};
|
|
713
713
|
return /* @__PURE__ */ w(K, {
|
|
714
714
|
className: "tg:mb-4",
|
|
715
715
|
children: [
|
|
716
716
|
/* @__PURE__ */ w(X, {
|
|
717
717
|
className: "tg:mb-1",
|
|
718
|
+
id: e,
|
|
718
719
|
children: [u || o.data.name, o.data.required && /* @__PURE__ */ C("span", {
|
|
719
720
|
className: "tg:text-red-500",
|
|
720
721
|
children: "*"
|
|
@@ -723,34 +724,36 @@ var nt = ({ label: e, description: t, image: n }) => /* @__PURE__ */ w(S, { chil
|
|
|
723
724
|
/* @__PURE__ */ C(Xe, { missing: m }),
|
|
724
725
|
g && /* @__PURE__ */ w("div", {
|
|
725
726
|
className: "tg:flex tg:items-center tg:gap-2 tg:py-2 tg:text-muted-foreground tg:text-sm",
|
|
726
|
-
children: [/* @__PURE__ */ C(
|
|
727
|
+
children: [/* @__PURE__ */ C(k, { className: "tg:h-4 tg:w-4 tg:animate-spin" }), /* @__PURE__ */ C("span", { children: y("renderer.defaultCheckboxInput.loadingOptions") })]
|
|
727
728
|
}),
|
|
728
729
|
/* @__PURE__ */ w("div", {
|
|
730
|
+
role: "group",
|
|
731
|
+
"aria-labelledby": e,
|
|
729
732
|
className: "tg:min-w-0 tg:space-y-2",
|
|
730
|
-
children: [
|
|
731
|
-
let a = y(
|
|
733
|
+
children: [r.map((e, r) => {
|
|
734
|
+
let a = y(e.description);
|
|
732
735
|
return /* @__PURE__ */ w("div", {
|
|
733
736
|
className: W("tg:group/option tg:pointer-events-auto tg:relative tg:flex tg:items-start tg:gap-3", p && "tg:pr-22"),
|
|
734
737
|
children: [
|
|
735
738
|
/* @__PURE__ */ C(de, {
|
|
736
|
-
id: `${n}-${
|
|
739
|
+
id: `${n}-${e.value}`,
|
|
737
740
|
name: i,
|
|
738
|
-
checked:
|
|
739
|
-
onCheckedChange: (
|
|
740
|
-
disabled:
|
|
741
|
+
checked: t.includes(String(e.value)),
|
|
742
|
+
onCheckedChange: (t) => b(String(e.value), !!t),
|
|
743
|
+
disabled: e.disabled,
|
|
741
744
|
className: "tg:mt-0.5"
|
|
742
745
|
}),
|
|
743
|
-
|
|
744
|
-
src:
|
|
746
|
+
e.image && /* @__PURE__ */ C("img", {
|
|
747
|
+
src: e.image,
|
|
745
748
|
alt: "",
|
|
746
749
|
className: "tg:h-8 tg:w-8 tg:shrink-0 tg:rounded tg:object-cover"
|
|
747
750
|
}),
|
|
748
751
|
/* @__PURE__ */ w("div", {
|
|
749
752
|
className: W("tg:flex tg:flex-col", p && "tg:min-w-0 tg:flex-1 tg:overflow-hidden"),
|
|
750
753
|
children: [/* @__PURE__ */ C(X, {
|
|
751
|
-
htmlFor: `${n}-${
|
|
754
|
+
htmlFor: `${n}-${e.value}`,
|
|
752
755
|
className: W("tg:cursor-pointer tg:font-normal tg:text-sm", p && "tg:block tg:max-w-full tg:truncate"),
|
|
753
|
-
children: y(
|
|
756
|
+
children: y(e.label) ? y(e.label) : e.value
|
|
754
757
|
}), a && /* @__PURE__ */ C("span", {
|
|
755
758
|
className: W("tg:text-muted-foreground tg:text-xs", p && "tg:block tg:max-w-full tg:truncate"),
|
|
756
759
|
children: a
|
|
@@ -758,11 +761,11 @@ var nt = ({ label: e, description: t, image: n }) => /* @__PURE__ */ w(S, { chil
|
|
|
758
761
|
}),
|
|
759
762
|
f?.({
|
|
760
763
|
index: r,
|
|
761
|
-
option:
|
|
764
|
+
option: e
|
|
762
765
|
})
|
|
763
766
|
]
|
|
764
|
-
},
|
|
765
|
-
}),
|
|
767
|
+
}, e.value + r);
|
|
768
|
+
}), s > 0 && /* @__PURE__ */ C("div", {
|
|
766
769
|
className: "tg:px-2 tg:text-muted-foreground tg:text-xs",
|
|
767
770
|
children: "…"
|
|
768
771
|
})]
|
|
@@ -1028,7 +1031,7 @@ var lt = ({ field: e, extra: t }) => {
|
|
|
1028
1031
|
let i = t[r], a = i == null ? "" : String(i);
|
|
1029
1032
|
return n ? encodeURIComponent(a) : a;
|
|
1030
1033
|
}), gt = ({ field: n, extra: i }) => {
|
|
1031
|
-
let [c, l] = x(!1), [p, m] = x(null), [h, _] = x([]), [E, D] = x(""), [ee, te] = x(!1), { id:
|
|
1034
|
+
let [c, l] = x(!1), [p, m] = x(null), [h, _] = x([]), [E, D] = x(""), [ee, te] = x(!1), { id: O, name: re, value: A, placeholder: ie } = n, { node: j, setValue: ae, error: M, label: oe, helperText: N, missingDependencies: se } = i, { formValues: P, inputNodes: F, headers: I, baseUrl: L } = s(), { httpConfig: R } = j.data, z = b(!1), B = b(!1), ce = b(""), V = r(), H = b(R), U = b(P), le = b(F), ue = b(I), de = b(L), fe = b(ae), Z = b(null), Q = b(null), xe = y(() => R?.url ? pt(R.url) : [], [R?.url]), Ce = xe.length > 0, we = y(() => xe.map((e) => `${e}:${String(P[e] ?? "")}`).join("|"), [xe, P]), Te = y(() => R?.url ? Ce ? mt(R.url, P) : !0 : !1, [
|
|
1032
1035
|
R?.url,
|
|
1033
1036
|
Ce,
|
|
1034
1037
|
P
|
|
@@ -1082,14 +1085,14 @@ var lt = ({ field: e, extra: t }) => {
|
|
|
1082
1085
|
}
|
|
1083
1086
|
}, [V]);
|
|
1084
1087
|
if (v(() => {
|
|
1085
|
-
H.current = R, U.current = P, le.current = F, ue.current = I, de.current = L, fe.current =
|
|
1088
|
+
H.current = R, U.current = P, le.current = F, ue.current = I, de.current = L, fe.current = ae, Z.current = $;
|
|
1086
1089
|
}, [
|
|
1087
1090
|
R,
|
|
1088
1091
|
P,
|
|
1089
1092
|
F,
|
|
1090
1093
|
I,
|
|
1091
1094
|
L,
|
|
1092
|
-
|
|
1095
|
+
ae,
|
|
1093
1096
|
$
|
|
1094
1097
|
]), v(() => () => {
|
|
1095
1098
|
Q.current && Q.current.abort(), z.current = !1, B.current = !1;
|
|
@@ -1138,22 +1141,25 @@ var lt = ({ field: e, extra: t }) => {
|
|
|
1138
1141
|
R?.searchParam,
|
|
1139
1142
|
$
|
|
1140
1143
|
]), R?.responseMapping) {
|
|
1141
|
-
let e = Array.isArray(
|
|
1144
|
+
let e = Array.isArray(A) ? A[0] : A, t = h.find((t) => t.value === e);
|
|
1142
1145
|
if (R.searchParam) {
|
|
1143
1146
|
let e = c && R?.showLoading ? /* @__PURE__ */ w("div", {
|
|
1144
1147
|
className: "tg:flex tg:items-center tg:gap-2",
|
|
1145
|
-
children: [/* @__PURE__ */ C(
|
|
1148
|
+
children: [/* @__PURE__ */ C(k, { className: "tg:h-4 tg:w-4 tg:animate-spin" }), /* @__PURE__ */ C("span", {
|
|
1146
1149
|
className: "tg:text-muted-foreground",
|
|
1147
|
-
children: t?.label ||
|
|
1150
|
+
children: t?.label || ie || V("renderer.defaultHttpInput.search")
|
|
1148
1151
|
})]
|
|
1149
|
-
}) : t?.label ||
|
|
1152
|
+
}) : t?.label || ie || V("renderer.defaultHttpInput.search");
|
|
1150
1153
|
return /* @__PURE__ */ w(K, {
|
|
1151
1154
|
className: "tg:mb-4",
|
|
1152
1155
|
children: [
|
|
1153
|
-
/* @__PURE__ */ w(X, {
|
|
1154
|
-
|
|
1155
|
-
children: "
|
|
1156
|
-
|
|
1156
|
+
/* @__PURE__ */ w(X, {
|
|
1157
|
+
htmlFor: O,
|
|
1158
|
+
children: [oe || j.data.name, j.data.required && /* @__PURE__ */ C("span", {
|
|
1159
|
+
className: "tg:text-red-500",
|
|
1160
|
+
children: "*"
|
|
1161
|
+
})]
|
|
1162
|
+
}),
|
|
1157
1163
|
/* @__PURE__ */ C(Ye, {
|
|
1158
1164
|
missing: se,
|
|
1159
1165
|
children: /* @__PURE__ */ w(pe, {
|
|
@@ -1162,12 +1168,13 @@ var lt = ({ field: e, extra: t }) => {
|
|
|
1162
1168
|
children: [/* @__PURE__ */ C(me, {
|
|
1163
1169
|
asChild: !0,
|
|
1164
1170
|
children: /* @__PURE__ */ w(G, {
|
|
1171
|
+
id: O,
|
|
1165
1172
|
variant: "outline",
|
|
1166
1173
|
role: "combobox",
|
|
1167
1174
|
"aria-expanded": ee,
|
|
1168
1175
|
disabled: se.length > 0,
|
|
1169
1176
|
className: "tg:w-full tg:justify-between",
|
|
1170
|
-
children: [e, /* @__PURE__ */ C(
|
|
1177
|
+
children: [e, /* @__PURE__ */ C(ne, { className: "tg:ml-2 tg:h-4 tg:w-4 tg:shrink-0 tg:opacity-50" })]
|
|
1171
1178
|
})
|
|
1172
1179
|
}), /* @__PURE__ */ C(he, {
|
|
1173
1180
|
className: "tg:w-[var(--radix-popover-trigger-width)] tg:p-0",
|
|
@@ -1183,7 +1190,7 @@ var lt = ({ field: e, extra: t }) => {
|
|
|
1183
1190
|
}), /* @__PURE__ */ w(Ve, { children: [
|
|
1184
1191
|
c && /* @__PURE__ */ C("div", {
|
|
1185
1192
|
className: "tg:flex tg:items-center tg:justify-center tg:p-4",
|
|
1186
|
-
children: /* @__PURE__ */ C(
|
|
1193
|
+
children: /* @__PURE__ */ C(k, { className: "tg:h-4 tg:w-4 tg:animate-spin" })
|
|
1187
1194
|
}),
|
|
1188
1195
|
!c && p && /* @__PURE__ */ w("div", {
|
|
1189
1196
|
className: "tg:p-4 tg:text-destructive tg:text-sm",
|
|
@@ -1197,9 +1204,9 @@ var lt = ({ field: e, extra: t }) => {
|
|
|
1197
1204
|
!(c || p) && /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C(He, { children: V("renderer.defaultHttpInput.noResults") }), /* @__PURE__ */ C(Ue, { children: h.map((e) => /* @__PURE__ */ w(We, {
|
|
1198
1205
|
value: e.value,
|
|
1199
1206
|
onSelect: () => {
|
|
1200
|
-
|
|
1207
|
+
ae(e.value), te(!1);
|
|
1201
1208
|
},
|
|
1202
|
-
children: [/* @__PURE__ */ C(T, { className: W("tg:mr-2 tg:h-4 tg:w-4",
|
|
1209
|
+
children: [/* @__PURE__ */ C(T, { className: W("tg:mr-2 tg:h-4 tg:w-4", A === e.value ? "tg:opacity-100" : "tg:opacity-0") }), /* @__PURE__ */ C(nt, {
|
|
1203
1210
|
label: e.label,
|
|
1204
1211
|
description: e.description,
|
|
1205
1212
|
image: e.image
|
|
@@ -1216,15 +1223,15 @@ var lt = ({ field: e, extra: t }) => {
|
|
|
1216
1223
|
});
|
|
1217
1224
|
}
|
|
1218
1225
|
let n = c && R?.showLoading, r = se.length === 0 && h.length === 0 && !n ? p ?? V("renderer.defaultHttpInput.noDataAvailable") : void 0, i = /* @__PURE__ */ w(ge, {
|
|
1219
|
-
value: Array.isArray(
|
|
1220
|
-
onValueChange: (e) =>
|
|
1226
|
+
value: Array.isArray(A) ? A[0] ?? "" : A ?? "",
|
|
1227
|
+
onValueChange: (e) => ae(e),
|
|
1221
1228
|
disabled: n || h.length === 0,
|
|
1222
|
-
name:
|
|
1229
|
+
name: re,
|
|
1223
1230
|
children: [/* @__PURE__ */ w(ye, {
|
|
1224
|
-
id:
|
|
1225
|
-
name:
|
|
1231
|
+
id: O,
|
|
1232
|
+
name: re,
|
|
1226
1233
|
className: "tg:w-full",
|
|
1227
|
-
children: [n && /* @__PURE__ */ C(
|
|
1234
|
+
children: [n && /* @__PURE__ */ C(k, { className: "tg:mr-2 tg:h-4 tg:w-4 tg:animate-spin" }), /* @__PURE__ */ C(ve, { placeholder: ie || V("renderer.defaultHttpInput.selectOption") })]
|
|
1228
1235
|
}), /* @__PURE__ */ C(be, { children: /* @__PURE__ */ C(_e, { children: h.map((e, t) => /* @__PURE__ */ C(Se, {
|
|
1229
1236
|
value: e.value,
|
|
1230
1237
|
children: /* @__PURE__ */ C(nt, {
|
|
@@ -1238,8 +1245,8 @@ var lt = ({ field: e, extra: t }) => {
|
|
|
1238
1245
|
className: "tg:mb-4",
|
|
1239
1246
|
children: [
|
|
1240
1247
|
/* @__PURE__ */ w(X, {
|
|
1241
|
-
htmlFor:
|
|
1242
|
-
children: [oe ||
|
|
1248
|
+
htmlFor: O,
|
|
1249
|
+
children: [oe || j.data.name, j.data.required && /* @__PURE__ */ C("span", {
|
|
1243
1250
|
className: "tg:text-red-500",
|
|
1244
1251
|
children: "*"
|
|
1245
1252
|
})]
|
|
@@ -1263,17 +1270,17 @@ var lt = ({ field: e, extra: t }) => {
|
|
|
1263
1270
|
className: "tg:mb-4",
|
|
1264
1271
|
children: [
|
|
1265
1272
|
/* @__PURE__ */ w(X, {
|
|
1266
|
-
htmlFor:
|
|
1267
|
-
children: [oe ||
|
|
1273
|
+
htmlFor: O,
|
|
1274
|
+
children: [oe || j.data.name, j.data.required && /* @__PURE__ */ C("span", {
|
|
1268
1275
|
className: "tg:text-red-500",
|
|
1269
1276
|
children: "*"
|
|
1270
1277
|
})]
|
|
1271
1278
|
}),
|
|
1272
1279
|
/* @__PURE__ */ C(Y, {
|
|
1273
1280
|
type: "text",
|
|
1274
|
-
name:
|
|
1275
|
-
id:
|
|
1276
|
-
value: typeof
|
|
1281
|
+
name: re,
|
|
1282
|
+
id: O,
|
|
1283
|
+
value: typeof A == "string" ? A : JSON.stringify(A),
|
|
1277
1284
|
readOnly: !0,
|
|
1278
1285
|
disabled: !0
|
|
1279
1286
|
}),
|
|
@@ -1400,7 +1407,7 @@ function Et({ className: e, ...t }) {
|
|
|
1400
1407
|
children: /* @__PURE__ */ C(H.Indicator, {
|
|
1401
1408
|
"data-slot": "radio-group-indicator",
|
|
1402
1409
|
className: "tg:relative tg:flex tg:items-center tg:justify-center",
|
|
1403
|
-
children: /* @__PURE__ */ C(
|
|
1410
|
+
children: /* @__PURE__ */ C(re, { className: "tg:-translate-x-1/2 tg:-translate-y-1/2 tg:absolute tg:top-1/2 tg:left-1/2 tg:size-2 tg:fill-primary" })
|
|
1404
1411
|
})
|
|
1405
1412
|
});
|
|
1406
1413
|
}
|
|
@@ -1422,7 +1429,7 @@ var Dt = ({ field: e, extra: t }) => {
|
|
|
1422
1429
|
/* @__PURE__ */ C(Xe, { missing: m }),
|
|
1423
1430
|
g && /* @__PURE__ */ w("div", {
|
|
1424
1431
|
className: "tg:flex tg:items-center tg:gap-2 tg:py-2 tg:text-muted-foreground tg:text-sm",
|
|
1425
|
-
children: [/* @__PURE__ */ C(
|
|
1432
|
+
children: [/* @__PURE__ */ C(k, { className: "tg:h-4 tg:w-4 tg:animate-spin" }), /* @__PURE__ */ C("span", { children: y("renderer.defaultRadioInput.loadingOptions") })]
|
|
1426
1433
|
}),
|
|
1427
1434
|
/* @__PURE__ */ w(Tt, {
|
|
1428
1435
|
value: b,
|
|
@@ -1531,7 +1538,7 @@ var Dt = ({ field: e, extra: t }) => {
|
|
|
1531
1538
|
id: n,
|
|
1532
1539
|
name: i,
|
|
1533
1540
|
className: "tg:w-full",
|
|
1534
|
-
children: [m && /* @__PURE__ */ C(
|
|
1541
|
+
children: [m && /* @__PURE__ */ C(k, { className: "tg:mr-2 tg:h-4 tg:w-4 tg:animate-spin" }), /* @__PURE__ */ C(ve, { placeholder: o || g("renderer.defaultSelectInput.selectOption") })]
|
|
1535
1542
|
}), /* @__PURE__ */ C(be, { children: /* @__PURE__ */ C(_e, { children: p.map((e, t) => /* @__PURE__ */ C(Se, {
|
|
1536
1543
|
value: String(e.value),
|
|
1537
1544
|
disabled: e.disabled,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { A as e, F as t, I as n, L as r, M as i, O as a, P as o, _ as s, b as c, d as l, j as u, t as d, u as f, v as p, w as m, y as h } from "./ThemeContext-7cghqUb0.js";
|
|
2
|
-
import { $ as g, A as _, B as v, C as y, D as ee, E as te, F as b, G as x, H as S, I as C, J as w, K as T, L as E, M as D, N as O, O as ne, P as re, Q as k, R as ie, T as ae, U as oe, V as A, W as j, X as se, Y as ce, Z as le, at as M, c as N, d as ue, et as P, f as de, it as fe, j as pe, k as me, nt as F, o as he, ot as I, q as L, rt as R, t as ge, tt as z, w as _e, z as ve } from "./DefaultInputs-
|
|
2
|
+
import { $ as g, A as _, B as v, C as y, D as ee, E as te, F as b, G as x, H as S, I as C, J as w, K as T, L as E, M as D, N as O, O as ne, P as re, Q as k, R as ie, T as ae, U as oe, V as A, W as j, X as se, Y as ce, Z as le, at as M, c as N, d as ue, et as P, f as de, it as fe, j as pe, k as me, nt as F, o as he, ot as I, q as L, rt as R, t as ge, tt as z, w as _e, z as ve } from "./DefaultInputs-1F6m9Sc1.js";
|
|
3
3
|
import { Background as ye, BackgroundVariant as be, BaseEdge as xe, ControlButton as Se, Controls as Ce, EdgeLabelRenderer as we, Handle as Te, MiniMap as Ee, Panel as De, Position as Oe, ReactFlow as ke, ReactFlowProvider as Ae, addEdge as je, getBezierPath as Me, useConnection as Ne, useEdges as Pe, useNodes as Fe, useNodesInitialized as Ie, useReactFlow as Le, useStore as Re, useUpdateNodeInternals as ze } from "@xyflow/react";
|
|
4
4
|
import * as Be from "react";
|
|
5
5
|
import Ve, { createContext as He, memo as Ue, useCallback as B, useContext as We, useEffect as V, useId as Ge, useMemo as H, useRef as Ke, useState as U } from "react";
|
|
@@ -2098,7 +2098,7 @@ var mr = ({ nodeId: e, groupId: n }) => {
|
|
|
2098
2098
|
},
|
|
2099
2099
|
children: /* @__PURE__ */ G(P, {
|
|
2100
2100
|
field: {
|
|
2101
|
-
id: e
|
|
2101
|
+
id: `${e}-preview`,
|
|
2102
2102
|
name: ne,
|
|
2103
2103
|
placeholder: fe || void 0,
|
|
2104
2104
|
value: jr(x)
|
package/dist/editor.js
CHANGED
package/dist/main.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as e } from "./editor-
|
|
1
|
+
import { t as e } from "./editor-CHqeuh7l.js";
|
|
2
2
|
import { D as t, E as n, F as r, I as i, L as a, N as o, P as s, a as c, c as l, h as u, i as d, m as f, n as p, o as m, p as h, r as g, s as _, t as v } from "./ThemeContext-7cghqUb0.js";
|
|
3
|
-
import { S as y, _ as b, a as x, b as S, g as C, h as w, i as T, l as E, m as D, n as O, p as k, r as A, s as j, t as M, u as N, v as P, x as F, y as I } from "./DefaultInputs-
|
|
4
|
-
import { a as L, c as R, i as z, l as B, n as V, o as H, r as U, s as W } from "./useRenderNode-
|
|
5
|
-
import { i as G, n as K, r as q, t as J } from "./renderer-
|
|
3
|
+
import { S as y, _ as b, a as x, b as S, g as C, h as w, i as T, l as E, m as D, n as O, p as k, r as A, s as j, t as M, u as N, v as P, x as F, y as I } from "./DefaultInputs-1F6m9Sc1.js";
|
|
4
|
+
import { a as L, c as R, i as z, l as B, n as V, o as H, r as U, s as W } from "./useRenderNode-DGe-7y4d.js";
|
|
5
|
+
import { i as G, n as K, r as q, t as J } from "./renderer-C2yMYdOd.js";
|
|
6
6
|
export { y as DefaultAddressInput, F as DefaultAutocompleteInput, S as DefaultCheckboxInput, I as DefaultDateInput, P as DefaultDateRangeInput, b as DefaultFileInput, C as DefaultHiddenInput, w as DefaultHttpInput, D as DefaultNumberInput, k as DefaultPasswordInput, N as DefaultRadioInput, E as DefaultSelectInput, j as DefaultSwitchInput, x as DefaultTextAreaInput, T as DefaultTextInput, A as DefaultTimeInput, O as DefaultTimeRangeInput, K as Divider, v as ThemeProvider, q as Title, e as TreegeEditor, J as TreegeRenderer, R as TreegeRendererProvider, g as applyReferenceTransformation, d as buildInitialFormValues, c as calculateReferenceFieldUpdates, m as checkFormFieldHasValue, _ as convertFormValuesToNamedFormat, M as defaultInputRenderers, G as defaultUI, H as evaluateCondition, W as evaluateConditions, h as fileToSerializable, f as filesToSerializable, U as findStartNode, z as getFlowRenderState, o as getStaticTranslations, s as getTranslatedText, l as isFieldEmpty, r as isGroupNode, i as isInputNode, L as isStartNode, a as isUINode, n as sanitize, t as sanitizeHttpResponse, u as serializableToFile, p as useTheme, V as useTreegeRenderer, B as useTreegeRendererConfig };
|
|
@@ -19,7 +19,7 @@ import { GroupNodeData, TreegeNodeData } from '../../../shared/types/node';
|
|
|
19
19
|
* @param props - Configuration props (flow, initialValues, callbacks, etc.)
|
|
20
20
|
* @returns Complete form state and control methods
|
|
21
21
|
*/
|
|
22
|
-
export declare const useTreegeRenderer: ({ baseUrl, components, flow, googleApiKey, headers, language, onChange, onSubmit, theme, validate, validationMode, initialValues, }: Pick<TreegeRendererProps, "baseUrl" | "components" | "flow" | "googleApiKey" | "headers" | "initialValues" | "language" | "onChange" | "onSubmit" | "theme" | "validate" | "validationMode">) => {
|
|
22
|
+
export declare const useTreegeRenderer: ({ baseUrl, components, flow, googleApiKey, headers, language, onChange, onSubmit, showPoweredBy, theme, validate, validationMode, initialValues, }: Pick<TreegeRendererProps, "baseUrl" | "components" | "flow" | "googleApiKey" | "headers" | "initialValues" | "language" | "onChange" | "onSubmit" | "showPoweredBy" | "theme" | "validate" | "validationMode">) => {
|
|
23
23
|
canContinueStep: boolean;
|
|
24
24
|
canSubmit: boolean;
|
|
25
25
|
clearSubmitMessage: () => void;
|
|
@@ -77,6 +77,7 @@ export declare const useTreegeRenderer: ({ baseUrl, components, flow, googleApiK
|
|
|
77
77
|
googleApiKey: string | undefined;
|
|
78
78
|
headers: import('../../../shared/types/node').HttpHeaders;
|
|
79
79
|
language: string;
|
|
80
|
+
showPoweredBy: boolean;
|
|
80
81
|
theme: "dark" | "light";
|
|
81
82
|
validationMode: "onChange" | "onSubmit";
|
|
82
83
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { TreegeRendererProps } from '../../../types/renderer';
|
|
2
|
-
declare const TreegeRenderer: ({ baseUrl, components, className, flow, formId, googleApiKey, headers, language, onBack, onChange, onSubmit, theme, validate, validationMode, initialValues, isLoading, isSubmitting: isSubmittingProp, }: TreegeRendererProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const TreegeRenderer: ({ baseUrl, components, className, flow, formId, googleApiKey, headers, language, onBack, onChange, onSubmit, showPoweredBy, theme, validate, validationMode, initialValues, isLoading, isSubmitting: isSubmittingProp, }: TreegeRendererProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default TreegeRenderer;
|
|
@@ -330,6 +330,11 @@ export type TreegeRendererConfig = {
|
|
|
330
330
|
* @default "onSubmit"
|
|
331
331
|
*/
|
|
332
332
|
validationMode?: "onChange" | "onSubmit";
|
|
333
|
+
/**
|
|
334
|
+
* Whether to display the "Powered by Treege" credit at the bottom of the form.
|
|
335
|
+
* @default true
|
|
336
|
+
*/
|
|
337
|
+
showPoweredBy?: boolean;
|
|
333
338
|
/**
|
|
334
339
|
* Base URL prepended to every **relative** HTTP url issued by the renderer
|
|
335
340
|
* (HTTP inputs, dynamic options, and submit). Use this to keep the tree
|