treege 3.0.0-beta.95 → 3.0.0-beta.96
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/{DefaultSubmitButton-D4Hqyara.js → DefaultSubmitButton-CAOTg3w7.js} +196 -196
- package/dist/{ThemeContext-CDewydK5.js → ThemeContext-B9-cptw0.js} +21 -7
- package/dist/editor/types/ai.d.ts +1 -1
- package/dist/editor/utils/aiFlowGenerator.d.ts +16 -1
- package/dist/{editor-BzhBNy8O.js → editor-CSc1Ygb5.js} +745 -722
- package/dist/editor.js +2 -2
- package/dist/main.js +6 -6
- package/dist/renderer/types/renderer.d.ts +3 -3
- package/dist/renderer/utils/form.d.ts +13 -1
- package/dist/renderer-DX3WeZtk.js +437 -0
- package/dist/renderer-native.js +899 -899
- package/dist/renderer.js +5 -5
- package/dist/useRenderNode-C9RSQFX3.js +600 -0
- package/package.json +1 -1
- package/dist/renderer-Cd2P21x9.js +0 -437
- package/dist/useRenderNode-BaBKq6Ed.js +0 -600
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { A as e, C as t, D as n, E as r, F 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, _ as m, b as h, g, k as _, s as v, v as y, y as b } from "./ThemeContext-B9-cptw0.js";
|
|
2
2
|
import * as x from "react";
|
|
3
3
|
import { createContext as S, forwardRef as C, useCallback as ee, useContext as w, useEffect as T, useMemo as te, useRef as E, useState as D } from "react";
|
|
4
4
|
import { Fragment as ne, jsx as O, jsxs as k } from "react/jsx-runtime";
|
|
@@ -448,22 +448,22 @@ var lt = async (e, t) => {
|
|
|
448
448
|
})));
|
|
449
449
|
});
|
|
450
450
|
}), dt = ({ field: e, extra: t }) => {
|
|
451
|
-
let [
|
|
452
|
-
g(e.value),
|
|
451
|
+
let [n, r] = D(""), [i, s] = D([]), [c, l] = D(!1), { id: u, name: d, value: f, placeholder: p } = e, { InputLabel: m, node: h, setValue: g, error: _, label: v, helperText: y } = t, { googleApiKey: b, language: x } = a(), S = o(), C = ee((e) => {
|
|
452
|
+
g(e.value), r(e.value), l(!1);
|
|
453
453
|
}, [g]), w = ee((e) => {
|
|
454
|
-
g(e),
|
|
454
|
+
g(e), r(e), e.length >= 3 && l(!0);
|
|
455
455
|
}, [g]);
|
|
456
456
|
return T(() => {
|
|
457
|
-
if (!
|
|
458
|
-
|
|
457
|
+
if (!n || n.trim().length < 3) {
|
|
458
|
+
s([]);
|
|
459
459
|
return;
|
|
460
460
|
}
|
|
461
461
|
let e = setTimeout(async () => {
|
|
462
|
-
|
|
462
|
+
s(b ? await ut(n) : await lt(n, x));
|
|
463
463
|
}, 300);
|
|
464
464
|
return () => clearTimeout(e);
|
|
465
465
|
}, [
|
|
466
|
-
|
|
466
|
+
n,
|
|
467
467
|
b,
|
|
468
468
|
x
|
|
469
469
|
]), /* @__PURE__ */ k(ne, { children: [b && /* @__PURE__ */ O("script", {
|
|
@@ -473,7 +473,7 @@ var lt = async (e, t) => {
|
|
|
473
473
|
className: "tg:mb-6",
|
|
474
474
|
children: [
|
|
475
475
|
/* @__PURE__ */ O(m, {
|
|
476
|
-
htmlFor:
|
|
476
|
+
htmlFor: u,
|
|
477
477
|
label: v,
|
|
478
478
|
required: h.data.required
|
|
479
479
|
}),
|
|
@@ -482,22 +482,22 @@ var lt = async (e, t) => {
|
|
|
482
482
|
children: [
|
|
483
483
|
/* @__PURE__ */ O(Y, {
|
|
484
484
|
type: "text",
|
|
485
|
-
id:
|
|
485
|
+
id: u,
|
|
486
486
|
name: d,
|
|
487
487
|
"aria-label": v || h.data.name,
|
|
488
488
|
value: f || "",
|
|
489
489
|
onChange: (e) => w(e.target.value),
|
|
490
490
|
onFocus: () => {
|
|
491
|
-
|
|
491
|
+
i.length > 0 && l(!0);
|
|
492
492
|
},
|
|
493
493
|
placeholder: p || S("renderer.defaultAddressInput.enterAddress"),
|
|
494
494
|
className: "tg:pr-10",
|
|
495
495
|
autoComplete: "off"
|
|
496
496
|
}),
|
|
497
497
|
/* @__PURE__ */ O(P, { 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" }),
|
|
498
|
-
|
|
498
|
+
c && /* @__PURE__ */ O("div", {
|
|
499
499
|
className: "tg:absolute tg:z-50 tg:mt-1 tg:w-full tg:rounded-md tg:border tg:bg-popover tg:shadow-md",
|
|
500
|
-
children: /* @__PURE__ */ O(rt, { children: /* @__PURE__ */ k(at, { children: [/* @__PURE__ */ O(ot, { children: S("renderer.defaultAddressInput.noAddressesFound") }), /* @__PURE__ */ O(st, { children:
|
|
500
|
+
children: /* @__PURE__ */ O(rt, { children: /* @__PURE__ */ k(at, { children: [/* @__PURE__ */ O(ot, { children: S("renderer.defaultAddressInput.noAddressesFound") }), /* @__PURE__ */ O(st, { children: i.map((e, t) => /* @__PURE__ */ k(ct, {
|
|
501
501
|
value: e.value,
|
|
502
502
|
onSelect: () => C(e),
|
|
503
503
|
onMouseDown: (e) => e.preventDefault(),
|
|
@@ -512,7 +512,7 @@ var lt = async (e, t) => {
|
|
|
512
512
|
})] });
|
|
513
513
|
}, ft = ({ missing: e }) => /* @__PURE__ */ k(ne, { children: [/* @__PURE__ */ O("p", {
|
|
514
514
|
className: "tg:font-medium",
|
|
515
|
-
children:
|
|
515
|
+
children: o()("renderer.dependencyHint.title")
|
|
516
516
|
}), /* @__PURE__ */ O("ul", {
|
|
517
517
|
className: "tg:mt-1 tg:list-disc tg:pl-4",
|
|
518
518
|
children: e.map((e) => /* @__PURE__ */ O("li", { children: e.label }, e.id))
|
|
@@ -600,91 +600,91 @@ var bt = ({ label: e, description: t, image: n }) => /* @__PURE__ */ k(ne, { chi
|
|
|
600
600
|
className: "tg:line-clamp-1",
|
|
601
601
|
children: t
|
|
602
602
|
})]
|
|
603
|
-
})] }), xt = /\{\{([\w-]+)}}/g, St = (
|
|
604
|
-
let [
|
|
603
|
+
})] }), xt = /\{\{([\w-]+)}}/g, St = (r) => {
|
|
604
|
+
let [i, o] = D({
|
|
605
605
|
error: null,
|
|
606
606
|
fetched: null,
|
|
607
607
|
isLoading: !1
|
|
608
|
-
}), { baseUrl:
|
|
609
|
-
if (!(
|
|
610
|
-
let t =
|
|
608
|
+
}), { baseUrl: l, formValues: d, headers: f } = a(), m = r.data.optionsSource, h = r.data.options, g = te(() => {
|
|
609
|
+
if (!(m?.url && m.mapping?.valueField && m.mapping?.labelField) || !Array.from(m.url.matchAll(xt), (e) => e[1]).every((e) => {
|
|
610
|
+
let t = d[e];
|
|
611
611
|
return t != null && t !== "";
|
|
612
612
|
})) return null;
|
|
613
|
-
let
|
|
613
|
+
let t = m.method ?? "GET", n = {
|
|
614
614
|
body: [
|
|
615
615
|
"POST",
|
|
616
616
|
"PUT",
|
|
617
617
|
"PATCH"
|
|
618
|
-
].includes(
|
|
619
|
-
headers:
|
|
620
|
-
mapping:
|
|
621
|
-
method:
|
|
622
|
-
queryParams:
|
|
623
|
-
responsePath:
|
|
624
|
-
url:
|
|
618
|
+
].includes(t) ? p(m.body, d, []) : void 0,
|
|
619
|
+
headers: e(c(f, d), c(m.headers, d)),
|
|
620
|
+
mapping: m.mapping,
|
|
621
|
+
method: t,
|
|
622
|
+
queryParams: c(m.queryParams, d) ?? {},
|
|
623
|
+
responsePath: m.responsePath,
|
|
624
|
+
url: u(s(m.url, d, { encode: !0 }), l)
|
|
625
625
|
};
|
|
626
|
-
return JSON.stringify(
|
|
626
|
+
return JSON.stringify(n);
|
|
627
627
|
}, [
|
|
628
|
-
s,
|
|
629
|
-
f,
|
|
630
628
|
l,
|
|
631
|
-
|
|
629
|
+
m,
|
|
630
|
+
d,
|
|
631
|
+
f
|
|
632
632
|
]);
|
|
633
633
|
T(() => {
|
|
634
634
|
if (!g) {
|
|
635
|
-
|
|
635
|
+
o({
|
|
636
636
|
error: null,
|
|
637
637
|
fetched: null,
|
|
638
638
|
isLoading: !1
|
|
639
639
|
});
|
|
640
640
|
return;
|
|
641
641
|
}
|
|
642
|
-
let e = JSON.parse(g),
|
|
643
|
-
return
|
|
642
|
+
let e = JSON.parse(g), t = new AbortController();
|
|
643
|
+
return o((e) => ({
|
|
644
644
|
...e,
|
|
645
645
|
error: null,
|
|
646
646
|
isLoading: !0
|
|
647
647
|
})), (async () => {
|
|
648
|
-
let
|
|
648
|
+
let r = await _({
|
|
649
649
|
body: e.body,
|
|
650
650
|
headers: e.headers,
|
|
651
651
|
method: e.method,
|
|
652
652
|
queryParams: e.queryParams,
|
|
653
|
-
signal:
|
|
653
|
+
signal: t.signal,
|
|
654
654
|
url: e.url
|
|
655
655
|
});
|
|
656
|
-
if (!
|
|
657
|
-
if (!
|
|
658
|
-
|
|
659
|
-
error:
|
|
656
|
+
if (!t.signal.aborted) {
|
|
657
|
+
if (!r.success) {
|
|
658
|
+
o({
|
|
659
|
+
error: r.error ?? "Fetch failed",
|
|
660
660
|
fetched: null,
|
|
661
661
|
isLoading: !1
|
|
662
662
|
});
|
|
663
663
|
return;
|
|
664
664
|
}
|
|
665
|
-
|
|
665
|
+
o({
|
|
666
666
|
error: null,
|
|
667
|
-
fetched:
|
|
667
|
+
fetched: n(r.data, e.responsePath, e.mapping),
|
|
668
668
|
isLoading: !1
|
|
669
669
|
});
|
|
670
670
|
}
|
|
671
|
-
})(), () =>
|
|
671
|
+
})(), () => t.abort();
|
|
672
672
|
}, [g]);
|
|
673
|
-
let
|
|
673
|
+
let v = r.data.normalizeOptionLabels !== !1, y = te(() => i.fetched ? v ? i.fetched.map((e) => ({
|
|
674
674
|
...e,
|
|
675
|
-
label:
|
|
676
|
-
})) :
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
675
|
+
label: t(e.label)
|
|
676
|
+
})) : i.fetched : h ?? [], [
|
|
677
|
+
i.fetched,
|
|
678
|
+
h,
|
|
679
|
+
v
|
|
680
680
|
]);
|
|
681
681
|
return {
|
|
682
|
-
error:
|
|
683
|
-
isLoading:
|
|
682
|
+
error: i.error,
|
|
683
|
+
isLoading: i.isLoading,
|
|
684
684
|
options: y
|
|
685
685
|
};
|
|
686
686
|
}, Ct = ({ field: e, extra: t }) => {
|
|
687
|
-
let [
|
|
687
|
+
let [n, r] = D(!1), { id: i, value: a, placeholder: s } = e, { InputLabel: c, node: l, setValue: u, error: d, label: f, helperText: p, missingDependencies: m } = t, { options: h, isLoading: g, error: _ } = St(l), v = o(), y = `${i}-trigger`, b = `${i}-error`, x = h.find((e) => e.value === a);
|
|
688
688
|
return /* @__PURE__ */ k(K, {
|
|
689
689
|
className: "tg:mb-6",
|
|
690
690
|
children: [
|
|
@@ -699,8 +699,8 @@ var bt = ({ label: e, description: t, image: n }) => /* @__PURE__ */ k(ne, { chi
|
|
|
699
699
|
className: "tg:relative",
|
|
700
700
|
children: [
|
|
701
701
|
/* @__PURE__ */ k(De, {
|
|
702
|
-
open:
|
|
703
|
-
onOpenChange:
|
|
702
|
+
open: n,
|
|
703
|
+
onOpenChange: r,
|
|
704
704
|
children: [/* @__PURE__ */ O(Oe, {
|
|
705
705
|
asChild: !0,
|
|
706
706
|
children: /* @__PURE__ */ k(G, {
|
|
@@ -708,14 +708,14 @@ var bt = ({ label: e, description: t, image: n }) => /* @__PURE__ */ k(ne, { chi
|
|
|
708
708
|
variant: "outline",
|
|
709
709
|
role: "combobox",
|
|
710
710
|
"aria-label": f || l.data.name,
|
|
711
|
-
"aria-expanded":
|
|
711
|
+
"aria-expanded": n,
|
|
712
712
|
"aria-invalid": !!d || void 0,
|
|
713
713
|
"aria-describedby": d ? b : void 0,
|
|
714
714
|
disabled: g || m.length > 0,
|
|
715
|
-
className: W("tg:w-full tg:justify-between tg:font-normal", (
|
|
715
|
+
className: W("tg:w-full tg:justify-between tg:font-normal", (a || g) && "tg:pr-14"),
|
|
716
716
|
children: [/* @__PURE__ */ O("span", {
|
|
717
717
|
className: "tg:flex tg:items-center tg:gap-2 tg:truncate",
|
|
718
|
-
children:
|
|
718
|
+
children: a ? x?.label ? v(x.label) : a : s || v("renderer.defaultAutocompleteInput.selectOption")
|
|
719
719
|
}), /* @__PURE__ */ O(se, { className: "tg:ml-2 tg:size-4 tg:shrink-0 tg:opacity-50" })]
|
|
720
720
|
})
|
|
721
721
|
}), /* @__PURE__ */ O(ke, {
|
|
@@ -725,9 +725,9 @@ var bt = ({ label: e, description: t, image: n }) => /* @__PURE__ */ k(ne, { chi
|
|
|
725
725
|
value: e.value,
|
|
726
726
|
disabled: e.disabled,
|
|
727
727
|
onSelect: () => {
|
|
728
|
-
u(e.value ===
|
|
728
|
+
u(e.value === a ? "" : e.value), r(!1);
|
|
729
729
|
},
|
|
730
|
-
children: [/* @__PURE__ */ O(re, { className: W("tg:mr-2 tg:size-4",
|
|
730
|
+
children: [/* @__PURE__ */ O(re, { className: W("tg:mr-2 tg:size-4", a === e.value ? "tg:opacity-100" : "tg:opacity-0") }), /* @__PURE__ */ O(bt, {
|
|
731
731
|
label: v(e.label) || e.value,
|
|
732
732
|
description: v(e.description),
|
|
733
733
|
image: e.image
|
|
@@ -736,7 +736,7 @@ var bt = ({ label: e, description: t, image: n }) => /* @__PURE__ */ k(ne, { chi
|
|
|
736
736
|
})]
|
|
737
737
|
}),
|
|
738
738
|
g && /* @__PURE__ */ O(le, { className: "tg:-translate-y-1/2 tg:pointer-events-none tg:absolute tg:top-1/2 tg:right-8 tg:size-4 tg:animate-spin tg:text-muted-foreground" }),
|
|
739
|
-
|
|
739
|
+
a && !g && m.length === 0 && /* @__PURE__ */ O("button", {
|
|
740
740
|
type: "button",
|
|
741
741
|
"aria-label": v("common.clear"),
|
|
742
742
|
onClick: () => u(""),
|
|
@@ -755,19 +755,19 @@ var bt = ({ label: e, description: t, image: n }) => /* @__PURE__ */ k(ne, { chi
|
|
|
755
755
|
]
|
|
756
756
|
});
|
|
757
757
|
}, wt = ({ field: e, extra: t }) => {
|
|
758
|
-
let { id:
|
|
759
|
-
if (g.length > 0 ||
|
|
760
|
-
let e = `${
|
|
761
|
-
|
|
758
|
+
let { id: n, name: r, value: i } = e, { InputLabel: s, node: c, setValue: l, error: u, label: d, helperText: f, renderOptionExtras: p, compactOptions: m, missingDependencies: h } = t, { options: g, isLoading: _, error: v } = St(c), { optionsDisplayLimit: y } = a(), b = o();
|
|
759
|
+
if (g.length > 0 || c.data.optionsSource) {
|
|
760
|
+
let e = `${n}-label`, t = Array.isArray(i) ? i.map(String) : [], a = y ? g.slice(0, y) : g, o = g.length - a.length, x = (e, n) => {
|
|
761
|
+
l(n ? [...t, e] : t.filter((t) => t !== e));
|
|
762
762
|
};
|
|
763
763
|
return /* @__PURE__ */ k(K, {
|
|
764
764
|
className: "tg:mb-6",
|
|
765
765
|
children: [
|
|
766
|
-
/* @__PURE__ */ O(
|
|
766
|
+
/* @__PURE__ */ O(s, {
|
|
767
767
|
className: "tg:mb-1",
|
|
768
768
|
id: e,
|
|
769
769
|
label: d,
|
|
770
|
-
required:
|
|
770
|
+
required: c.data.required
|
|
771
771
|
}),
|
|
772
772
|
/* @__PURE__ */ O(mt, { missing: h }),
|
|
773
773
|
_ && /* @__PURE__ */ k("div", {
|
|
@@ -777,16 +777,16 @@ var bt = ({ label: e, description: t, image: n }) => /* @__PURE__ */ k(ne, { chi
|
|
|
777
777
|
/* @__PURE__ */ k("div", {
|
|
778
778
|
role: "group",
|
|
779
779
|
"aria-labelledby": d ? e : void 0,
|
|
780
|
-
"aria-label": d ? void 0 :
|
|
780
|
+
"aria-label": d ? void 0 : c.data.name,
|
|
781
781
|
className: "tg:min-w-0 tg:space-y-2",
|
|
782
|
-
children: [
|
|
782
|
+
children: [a.map((e, i) => {
|
|
783
783
|
let a = b(e.description);
|
|
784
784
|
return /* @__PURE__ */ k("div", {
|
|
785
785
|
className: W("tg:group/option tg:pointer-events-auto tg:relative tg:flex tg:items-start tg:gap-3", m && "tg:pr-22"),
|
|
786
786
|
children: [
|
|
787
787
|
/* @__PURE__ */ O(Ce, {
|
|
788
|
-
id: `${
|
|
789
|
-
name:
|
|
788
|
+
id: `${n}-${e.value}`,
|
|
789
|
+
name: r,
|
|
790
790
|
checked: t.includes(String(e.value)),
|
|
791
791
|
onCheckedChange: (t) => x(String(e.value), !!t),
|
|
792
792
|
disabled: e.disabled,
|
|
@@ -800,7 +800,7 @@ var bt = ({ label: e, description: t, image: n }) => /* @__PURE__ */ k(ne, { chi
|
|
|
800
800
|
/* @__PURE__ */ k("div", {
|
|
801
801
|
className: W("tg:flex tg:flex-col", m && "tg:min-w-0 tg:flex-1 tg:overflow-hidden"),
|
|
802
802
|
children: [/* @__PURE__ */ O(we, {
|
|
803
|
-
htmlFor: `${
|
|
803
|
+
htmlFor: `${n}-${e.value}`,
|
|
804
804
|
className: W("tg:cursor-pointer tg:font-normal tg:text-sm", m && "tg:block tg:max-w-full tg:truncate"),
|
|
805
805
|
children: b(e.label) ? b(e.label) : e.value
|
|
806
806
|
}), a && /* @__PURE__ */ O("span", {
|
|
@@ -809,19 +809,19 @@ var bt = ({ label: e, description: t, image: n }) => /* @__PURE__ */ k(ne, { chi
|
|
|
809
809
|
})]
|
|
810
810
|
}),
|
|
811
811
|
p?.({
|
|
812
|
-
index:
|
|
812
|
+
index: i,
|
|
813
813
|
option: e
|
|
814
814
|
})
|
|
815
815
|
]
|
|
816
|
-
}, e.value +
|
|
817
|
-
}),
|
|
816
|
+
}, e.value + i);
|
|
817
|
+
}), o > 0 && /* @__PURE__ */ O("div", {
|
|
818
818
|
className: "tg:px-2 tg:text-muted-foreground tg:text-xs",
|
|
819
819
|
children: "…"
|
|
820
820
|
})]
|
|
821
821
|
}),
|
|
822
|
-
|
|
823
|
-
v && !
|
|
824
|
-
f && !
|
|
822
|
+
u && /* @__PURE__ */ O(J, { children: u }),
|
|
823
|
+
v && !u && /* @__PURE__ */ O(J, { children: v }),
|
|
824
|
+
f && !u && !v && /* @__PURE__ */ O(q, { children: f })
|
|
825
825
|
]
|
|
826
826
|
});
|
|
827
827
|
}
|
|
@@ -830,18 +830,18 @@ var bt = ({ label: e, description: t, image: n }) => /* @__PURE__ */ k(ne, { chi
|
|
|
830
830
|
children: [/* @__PURE__ */ k("div", {
|
|
831
831
|
className: "tg:flex tg:items-center tg:gap-3",
|
|
832
832
|
children: [/* @__PURE__ */ O(Ce, {
|
|
833
|
-
id:
|
|
834
|
-
name:
|
|
835
|
-
"aria-label": d ||
|
|
836
|
-
checked: typeof
|
|
837
|
-
onCheckedChange: (e) =>
|
|
838
|
-
}), /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O(
|
|
839
|
-
htmlFor:
|
|
833
|
+
id: n,
|
|
834
|
+
name: r,
|
|
835
|
+
"aria-label": d || c.data.name,
|
|
836
|
+
checked: typeof i == "boolean" ? i : !1,
|
|
837
|
+
onCheckedChange: (e) => l(!!e)
|
|
838
|
+
}), /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O(s, {
|
|
839
|
+
htmlFor: n,
|
|
840
840
|
label: d,
|
|
841
|
-
required:
|
|
841
|
+
required: c.data.required,
|
|
842
842
|
className: "tg:cursor-pointer tg:font-medium tg:text-sm"
|
|
843
|
-
}), f && !
|
|
844
|
-
}),
|
|
843
|
+
}), f && !u && /* @__PURE__ */ O(q, { children: f })] })]
|
|
844
|
+
}), u && /* @__PURE__ */ O(J, { children: u })]
|
|
845
845
|
});
|
|
846
846
|
};
|
|
847
847
|
//#endregion
|
|
@@ -4167,27 +4167,27 @@ function Hn({ className: e, day: t, modifiers: n, ...r }) {
|
|
|
4167
4167
|
//#endregion
|
|
4168
4168
|
//#region src/renderer/features/TreegeRenderer/web/components/inputs/DefaultDateInput.tsx
|
|
4169
4169
|
var Un = ({ field: e, extra: t }) => {
|
|
4170
|
-
let [
|
|
4170
|
+
let [n, r] = D(!1), { id: i, name: s, value: c, placeholder: l } = e, { InputLabel: u, node: d, setValue: f, error: p, label: m, helperText: h } = t, { language: g } = a(), _ = o(), v = Bn(g), y = c ? new Date(c) : void 0, b = /* @__PURE__ */ new Date();
|
|
4171
4171
|
return /* @__PURE__ */ k(K, {
|
|
4172
4172
|
className: "tg:mb-6",
|
|
4173
4173
|
children: [
|
|
4174
|
-
/* @__PURE__ */ O(
|
|
4175
|
-
htmlFor:
|
|
4174
|
+
/* @__PURE__ */ O(u, {
|
|
4175
|
+
htmlFor: i,
|
|
4176
4176
|
label: m,
|
|
4177
4177
|
required: d.data.required
|
|
4178
4178
|
}),
|
|
4179
4179
|
/* @__PURE__ */ k(De, {
|
|
4180
|
-
open:
|
|
4181
|
-
onOpenChange:
|
|
4180
|
+
open: n,
|
|
4181
|
+
onOpenChange: r,
|
|
4182
4182
|
children: [/* @__PURE__ */ O(Oe, {
|
|
4183
4183
|
asChild: !0,
|
|
4184
4184
|
children: /* @__PURE__ */ k(G, {
|
|
4185
4185
|
variant: "outline",
|
|
4186
|
-
id:
|
|
4187
|
-
name:
|
|
4186
|
+
id: i,
|
|
4187
|
+
name: s,
|
|
4188
4188
|
"aria-label": m || d.data.name,
|
|
4189
4189
|
className: "tg:w-full tg:justify-between tg:font-normal",
|
|
4190
|
-
children: [y ? _e(y, "P", { locale: v }) :
|
|
4190
|
+
children: [y ? _e(y, "P", { locale: v }) : l || _("renderer.defaultInputs.selectDate"), /* @__PURE__ */ O(A, { className: "tg:size-4" })]
|
|
4191
4191
|
})
|
|
4192
4192
|
}), /* @__PURE__ */ O(ke, {
|
|
4193
4193
|
className: "tg:w-auto tg:overflow-hidden tg:p-0",
|
|
@@ -4207,7 +4207,7 @@ var Un = ({ field: e, extra: t }) => {
|
|
|
4207
4207
|
return !1;
|
|
4208
4208
|
},
|
|
4209
4209
|
onSelect: (e) => {
|
|
4210
|
-
f(e ? e.toISOString() : ""),
|
|
4210
|
+
f(e ? e.toISOString() : ""), r(!1);
|
|
4211
4211
|
}
|
|
4212
4212
|
})
|
|
4213
4213
|
})]
|
|
@@ -4217,24 +4217,24 @@ var Un = ({ field: e, extra: t }) => {
|
|
|
4217
4217
|
]
|
|
4218
4218
|
});
|
|
4219
4219
|
}, Wn = ({ field: e, extra: t }) => {
|
|
4220
|
-
let [
|
|
4220
|
+
let [n, r] = D(!1), { id: i, value: s } = e, { InputLabel: c, node: l, setValue: u, error: d, label: f, helperText: p } = t, { language: m } = a(), h = o(), g = Bn(m), _ = Array.isArray(s) ? s : [], v = _[0] ? new Date(_[0]) : void 0, y = _[1] ? new Date(_[1]) : void 0;
|
|
4221
4221
|
return /* @__PURE__ */ k(K, {
|
|
4222
4222
|
className: "tg:mb-6",
|
|
4223
4223
|
children: [
|
|
4224
|
-
/* @__PURE__ */ O(
|
|
4225
|
-
htmlFor:
|
|
4224
|
+
/* @__PURE__ */ O(c, {
|
|
4225
|
+
htmlFor: i,
|
|
4226
4226
|
label: f,
|
|
4227
|
-
required:
|
|
4227
|
+
required: l.data.required
|
|
4228
4228
|
}),
|
|
4229
4229
|
/* @__PURE__ */ k(De, {
|
|
4230
|
-
open:
|
|
4231
|
-
onOpenChange:
|
|
4230
|
+
open: n,
|
|
4231
|
+
onOpenChange: r,
|
|
4232
4232
|
children: [/* @__PURE__ */ O(Oe, {
|
|
4233
4233
|
asChild: !0,
|
|
4234
4234
|
children: /* @__PURE__ */ k(G, {
|
|
4235
|
-
id:
|
|
4235
|
+
id: i,
|
|
4236
4236
|
variant: "outline",
|
|
4237
|
-
"aria-label": f ||
|
|
4237
|
+
"aria-label": f || l.data.name,
|
|
4238
4238
|
className: "tg:w-full tg:justify-between tg:font-normal",
|
|
4239
4239
|
children: [v && y ? `${_e(v, "P", { locale: g })} - ${_e(y, "P", { locale: g })}` : v ? _e(v, "P", { locale: g }) : h("renderer.defaultInputs.selectDateRange"), /* @__PURE__ */ O(A, { className: "tg:size-4" })]
|
|
4240
4240
|
})
|
|
@@ -4251,7 +4251,7 @@ var Un = ({ field: e, extra: t }) => {
|
|
|
4251
4251
|
},
|
|
4252
4252
|
captionLayout: "dropdown",
|
|
4253
4253
|
disabled: (e) => {
|
|
4254
|
-
if (
|
|
4254
|
+
if (l.data.disablePast) {
|
|
4255
4255
|
let t = /* @__PURE__ */ new Date();
|
|
4256
4256
|
return t.setHours(0, 0, 0, 0), e < t;
|
|
4257
4257
|
}
|
|
@@ -4259,10 +4259,10 @@ var Un = ({ field: e, extra: t }) => {
|
|
|
4259
4259
|
},
|
|
4260
4260
|
onSelect: (e, t) => {
|
|
4261
4261
|
if (v && y) {
|
|
4262
|
-
|
|
4262
|
+
u([t.toISOString(), void 0]);
|
|
4263
4263
|
return;
|
|
4264
4264
|
}
|
|
4265
|
-
|
|
4265
|
+
u([e?.from ? e.from.toISOString() : void 0, e?.to ? e.to.toISOString() : void 0]), e?.from && e?.to && r(!1);
|
|
4266
4266
|
},
|
|
4267
4267
|
numberOfMonths: 2
|
|
4268
4268
|
})
|
|
@@ -4273,34 +4273,34 @@ var Un = ({ field: e, extra: t }) => {
|
|
|
4273
4273
|
]
|
|
4274
4274
|
});
|
|
4275
4275
|
}, Gn = ({ field: e, extra: t }) => {
|
|
4276
|
-
let { id:
|
|
4276
|
+
let { id: n, name: r, value: i } = e, { InputLabel: a, node: s, setValue: c, error: l, label: u, helperText: d } = t, f = o(), p = E(null), _ = h(i), v = s.data.multiple, x = async (e) => {
|
|
4277
4277
|
let { files: t } = e.target;
|
|
4278
4278
|
if (!(!t || t.length === 0)) {
|
|
4279
|
-
if (
|
|
4280
|
-
let e = await
|
|
4281
|
-
c([...
|
|
4282
|
-
} else c(await
|
|
4279
|
+
if (v) {
|
|
4280
|
+
let e = await m(Array.from(t));
|
|
4281
|
+
c([..._, ...e]);
|
|
4282
|
+
} else c(await g(t[0]));
|
|
4283
4283
|
e.target.value = "";
|
|
4284
4284
|
}
|
|
4285
4285
|
}, S = (e) => {
|
|
4286
|
-
let t =
|
|
4286
|
+
let t = _.filter((t, n) => n !== e);
|
|
4287
4287
|
c(t.length > 0 ? t : null);
|
|
4288
4288
|
};
|
|
4289
4289
|
return /* @__PURE__ */ k(K, {
|
|
4290
4290
|
className: "tg:mb-6",
|
|
4291
4291
|
children: [
|
|
4292
|
-
/* @__PURE__ */ O(
|
|
4293
|
-
htmlFor:
|
|
4292
|
+
/* @__PURE__ */ O(a, {
|
|
4293
|
+
htmlFor: n,
|
|
4294
4294
|
label: u,
|
|
4295
4295
|
required: s.data.required
|
|
4296
4296
|
}),
|
|
4297
|
-
|
|
4297
|
+
_.length > 0 && /* @__PURE__ */ O("ul", {
|
|
4298
4298
|
className: "tg:flex tg:flex-col tg:gap-2",
|
|
4299
|
-
children:
|
|
4299
|
+
children: _.map((e, t) => /* @__PURE__ */ k("li", {
|
|
4300
4300
|
className: "tg:flex tg:items-center tg:gap-2 tg:rounded-md tg:border tg:bg-card tg:px-3 tg:py-2 tg:text-sm",
|
|
4301
4301
|
children: [
|
|
4302
4302
|
/* @__PURE__ */ O(N, { className: "tg:size-4 tg:shrink-0 tg:text-muted-foreground" }),
|
|
4303
|
-
|
|
4303
|
+
b(e.data) ? /* @__PURE__ */ O("a", {
|
|
4304
4304
|
href: e.data,
|
|
4305
4305
|
target: "_blank",
|
|
4306
4306
|
rel: "noreferrer",
|
|
@@ -4314,37 +4314,37 @@ var Un = ({ field: e, extra: t }) => {
|
|
|
4314
4314
|
}),
|
|
4315
4315
|
e.size > 0 && /* @__PURE__ */ O("span", {
|
|
4316
4316
|
className: "tg:shrink-0 tg:text-muted-foreground tg:text-xs",
|
|
4317
|
-
children:
|
|
4317
|
+
children: y(e.size)
|
|
4318
4318
|
}),
|
|
4319
4319
|
/* @__PURE__ */ O(G, {
|
|
4320
4320
|
type: "button",
|
|
4321
4321
|
variant: "ghost",
|
|
4322
4322
|
size: "icon-sm",
|
|
4323
4323
|
onClick: () => S(t),
|
|
4324
|
-
"aria-label":
|
|
4324
|
+
"aria-label": f("renderer.defaultInputs.removeFile"),
|
|
4325
4325
|
children: /* @__PURE__ */ O(de, { className: "tg:size-4" })
|
|
4326
4326
|
})
|
|
4327
4327
|
]
|
|
4328
4328
|
}, `${e.name}-${t}`))
|
|
4329
4329
|
}),
|
|
4330
4330
|
/* @__PURE__ */ O("input", {
|
|
4331
|
-
ref:
|
|
4331
|
+
ref: p,
|
|
4332
4332
|
type: "file",
|
|
4333
|
-
name:
|
|
4334
|
-
id:
|
|
4333
|
+
name: r,
|
|
4334
|
+
id: n,
|
|
4335
4335
|
className: "tg:hidden",
|
|
4336
4336
|
onChange: x,
|
|
4337
|
-
multiple:
|
|
4337
|
+
multiple: v
|
|
4338
4338
|
}),
|
|
4339
4339
|
/* @__PURE__ */ k(G, {
|
|
4340
4340
|
type: "button",
|
|
4341
4341
|
variant: "outline",
|
|
4342
|
-
onClick: () =>
|
|
4342
|
+
onClick: () => p.current?.click(),
|
|
4343
4343
|
"aria-label": u || s.data.name,
|
|
4344
|
-
children: [/* @__PURE__ */ O(ce, { className: "tg:size-4" }),
|
|
4344
|
+
children: [/* @__PURE__ */ O(ce, { className: "tg:size-4" }), _.length === 0 ? f(v ? "renderer.defaultInputs.selectFiles" : "renderer.defaultInputs.selectFile") : f(v ? "renderer.defaultInputs.addMoreFiles" : "renderer.defaultInputs.replaceFile")]
|
|
4345
4345
|
}),
|
|
4346
4346
|
l && /* @__PURE__ */ O(J, { children: l }),
|
|
4347
|
-
|
|
4347
|
+
d && !l && /* @__PURE__ */ O(q, { children: d })
|
|
4348
4348
|
]
|
|
4349
4349
|
});
|
|
4350
4350
|
}, Kn = ({ field: e }) => {
|
|
@@ -4364,8 +4364,8 @@ var Un = ({ field: e, extra: t }) => {
|
|
|
4364
4364
|
}), Yn = (e, t, n = !1) => e.replace(/{{([\w-]+)}}/g, (e, r) => {
|
|
4365
4365
|
let i = t[r], a = i == null ? "" : String(i);
|
|
4366
4366
|
return n ? encodeURIComponent(a) : a;
|
|
4367
|
-
}), Xn = ({ field: t, extra:
|
|
4368
|
-
let [
|
|
4367
|
+
}), Xn = ({ field: t, extra: n }) => {
|
|
4368
|
+
let [s, m] = D(!1), [h, g] = D(null), [_, y] = D([]), [b, x] = D(""), [S, C] = D(!1), { id: w, name: ie, value: A, placeholder: ae } = t, { InputLabel: oe, node: j, setValue: M, error: N, label: ce, helperText: P, missingDependencies: ue } = n, { formValues: F, inputNodes: fe, headers: I, baseUrl: pe } = a(), { httpConfig: L } = j.data, me = E(!1), he = E(!1), R = E(""), z = o(), B = E(L), ge = E(F), V = E(fe), H = E(I), _e = E(pe), ve = E(M), ye = E(null), U = E(null), be = E(j.data.normalizeOptionLabels !== !1), xe = te(() => L?.url ? qn(L.url) : [], [L?.url]), Se = xe.length > 0, Ce = te(() => xe.map((e) => `${e}:${String(F[e] ?? "")}`).join("|"), [xe, F]), we = te(() => L?.url ? Se ? Jn(L.url, F) : !0 : !1, [
|
|
4369
4369
|
L?.url,
|
|
4370
4370
|
Se,
|
|
4371
4371
|
F
|
|
@@ -4373,54 +4373,54 @@ var Un = ({ field: e, extra: t }) => {
|
|
|
4373
4373
|
U.current && U.current.abort();
|
|
4374
4374
|
let n = new AbortController();
|
|
4375
4375
|
U.current = n;
|
|
4376
|
-
let
|
|
4377
|
-
if (!
|
|
4378
|
-
|
|
4376
|
+
let a = B.current, o = ge.current, s = ve.current;
|
|
4377
|
+
if (!a?.url) {
|
|
4378
|
+
g(z("renderer.defaultHttpInput.noUrlConfigured")), U.current = null;
|
|
4379
4379
|
return;
|
|
4380
4380
|
}
|
|
4381
|
-
if (
|
|
4381
|
+
if (a.url && !Jn(a.url, o)) {
|
|
4382
4382
|
U.current = null;
|
|
4383
4383
|
return;
|
|
4384
4384
|
}
|
|
4385
|
-
|
|
4385
|
+
m(!0), g(null);
|
|
4386
4386
|
try {
|
|
4387
|
-
let
|
|
4387
|
+
let m = u(Yn(a.url, o, !0), _e.current), h = r(a.searchParam && t ? `${m}${m.includes("?") ? "&" : "?"}${a.searchParam}=${encodeURIComponent(t)}` : m, c(a.queryParams, o)), _ = e({ "Content-Type": "application/json" }, c(H.current, o), c(a.headers, o)), b = [
|
|
4388
4388
|
"POST",
|
|
4389
4389
|
"PUT",
|
|
4390
4390
|
"PATCH"
|
|
4391
|
-
].includes(
|
|
4391
|
+
].includes(a.method || "") ? a.sendAllFormValues ? JSON.stringify(v(o, V.current)) : p(a.body, o, V.current) : void 0, x = setTimeout(() => n.abort(), 3e4), S = await fetch(h, {
|
|
4392
4392
|
body: b || void 0,
|
|
4393
|
-
headers: Object.fromEntries(Object.entries(
|
|
4394
|
-
method:
|
|
4393
|
+
headers: Object.fromEntries(Object.entries(_).filter(([, e]) => e)),
|
|
4394
|
+
method: a.method || "GET",
|
|
4395
4395
|
signal: n.signal
|
|
4396
4396
|
});
|
|
4397
4397
|
if (clearTimeout(x), !S.ok) {
|
|
4398
|
-
|
|
4398
|
+
g(`HTTP Error ${S.status}: ${S.statusText}`);
|
|
4399
4399
|
return;
|
|
4400
4400
|
}
|
|
4401
|
-
let C =
|
|
4401
|
+
let C = i(await S.text());
|
|
4402
4402
|
if (!C.ok) {
|
|
4403
|
-
|
|
4403
|
+
g(z("renderer.defaultHttpInput.invalidJson"));
|
|
4404
4404
|
return;
|
|
4405
4405
|
}
|
|
4406
|
-
let ee =
|
|
4407
|
-
if (
|
|
4408
|
-
let { valueField:
|
|
4409
|
-
|
|
4410
|
-
let
|
|
4406
|
+
let ee = d(C.value), w = a.responsePath ? l(ee, a.responsePath) : ee;
|
|
4407
|
+
if (a.responseMapping && Array.isArray(w)) {
|
|
4408
|
+
let { valueField: e = "value", labelField: t = "label", descriptionField: n, imageField: r } = a.responseMapping, i = be.current;
|
|
4409
|
+
y(w.map((a) => {
|
|
4410
|
+
let o = n ? l(a, n) : void 0, s = r ? l(a, r) : void 0, c = String(l(a, t) || "");
|
|
4411
4411
|
return {
|
|
4412
|
-
description:
|
|
4413
|
-
image: typeof
|
|
4414
|
-
label:
|
|
4415
|
-
value: String(
|
|
4412
|
+
description: o != null && o !== "" ? String(o) : void 0,
|
|
4413
|
+
image: typeof s == "string" && s !== "" ? s : void 0,
|
|
4414
|
+
label: i ? f(c) : c,
|
|
4415
|
+
value: String(l(a, e) || "")
|
|
4416
4416
|
};
|
|
4417
4417
|
}));
|
|
4418
|
-
} else
|
|
4418
|
+
} else s(typeof w == "string" ? w : JSON.stringify(w));
|
|
4419
4419
|
} catch (e) {
|
|
4420
4420
|
if (e instanceof Error && e.name === "AbortError") return;
|
|
4421
|
-
|
|
4421
|
+
g(e instanceof Error ? e.message : z("renderer.defaultHttpInput.fetchFailed")), console.error("HTTP Input fetch error:", e);
|
|
4422
4422
|
} finally {
|
|
4423
|
-
U.current === n && (
|
|
4423
|
+
U.current === n && (m(!1), U.current = null);
|
|
4424
4424
|
}
|
|
4425
4425
|
}, [z]);
|
|
4426
4426
|
if (T(() => {
|
|
@@ -4481,9 +4481,9 @@ var Un = ({ field: e, extra: t }) => {
|
|
|
4481
4481
|
L?.searchParam,
|
|
4482
4482
|
X
|
|
4483
4483
|
]), L?.responseMapping) {
|
|
4484
|
-
let e = Array.isArray(A) ? A[0] : A, t =
|
|
4484
|
+
let e = Array.isArray(A) ? A[0] : A, t = _.find((t) => t.value === e);
|
|
4485
4485
|
if (L.searchParam) {
|
|
4486
|
-
let n =
|
|
4486
|
+
let n = s && L?.showLoading, r = t?.label || ae || z("renderer.defaultHttpInput.search");
|
|
4487
4487
|
return /* @__PURE__ */ k(K, {
|
|
4488
4488
|
className: "tg:mb-6",
|
|
4489
4489
|
children: [
|
|
@@ -4524,23 +4524,23 @@ var Un = ({ field: e, extra: t }) => {
|
|
|
4524
4524
|
placeholder: z("renderer.defaultHttpInput.search"),
|
|
4525
4525
|
value: b,
|
|
4526
4526
|
onValueChange: (e) => {
|
|
4527
|
-
x(e),
|
|
4527
|
+
x(e), g(null);
|
|
4528
4528
|
}
|
|
4529
4529
|
}), /* @__PURE__ */ k(at, { children: [
|
|
4530
|
-
|
|
4530
|
+
s && /* @__PURE__ */ O("div", {
|
|
4531
4531
|
className: "tg:flex tg:items-center tg:justify-center tg:p-4",
|
|
4532
4532
|
children: /* @__PURE__ */ O(le, { className: "tg:h-4 tg:w-4 tg:animate-spin" })
|
|
4533
4533
|
}),
|
|
4534
|
-
!
|
|
4534
|
+
!s && h && /* @__PURE__ */ k("div", {
|
|
4535
4535
|
className: "tg:p-4 tg:text-destructive tg:text-sm",
|
|
4536
|
-
children: [/* @__PURE__ */ O("div", { children:
|
|
4536
|
+
children: [/* @__PURE__ */ O("div", { children: h }), /* @__PURE__ */ O("button", {
|
|
4537
4537
|
type: "button",
|
|
4538
4538
|
onClick: () => X(b),
|
|
4539
4539
|
className: "tg:mt-2 tg:block tg:text-primary tg:hover:underline",
|
|
4540
4540
|
children: z("renderer.defaultHttpInput.retry")
|
|
4541
4541
|
})]
|
|
4542
4542
|
}),
|
|
4543
|
-
!(
|
|
4543
|
+
!(s || h) && /* @__PURE__ */ k(ne, { children: [/* @__PURE__ */ O(ot, { children: z("renderer.defaultHttpInput.noResults") }), /* @__PURE__ */ O(st, { children: _.map((e) => /* @__PURE__ */ k(ct, {
|
|
4544
4544
|
value: e.value,
|
|
4545
4545
|
onSelect: () => {
|
|
4546
4546
|
M(e.value === A ? "" : e.value), C(!1);
|
|
@@ -4571,13 +4571,13 @@ var Un = ({ field: e, extra: t }) => {
|
|
|
4571
4571
|
]
|
|
4572
4572
|
});
|
|
4573
4573
|
}
|
|
4574
|
-
let n =
|
|
4574
|
+
let n = s && L?.showLoading, r = ue.length === 0 && _.length === 0 && !n ? h ?? z("renderer.defaultHttpInput.noDataAvailable") : void 0, i = Array.isArray(A) ? A[0] ?? "" : A ?? "", a = /* @__PURE__ */ k("div", {
|
|
4575
4575
|
className: "tg:relative",
|
|
4576
4576
|
children: [
|
|
4577
4577
|
/* @__PURE__ */ k(Ae, {
|
|
4578
4578
|
value: i,
|
|
4579
4579
|
onValueChange: (e) => M(e),
|
|
4580
|
-
disabled: n ||
|
|
4580
|
+
disabled: n || _.length === 0,
|
|
4581
4581
|
name: ie,
|
|
4582
4582
|
children: [/* @__PURE__ */ O(Ne, {
|
|
4583
4583
|
id: w,
|
|
@@ -4585,7 +4585,7 @@ var Un = ({ field: e, extra: t }) => {
|
|
|
4585
4585
|
"aria-label": ce || j.data.name,
|
|
4586
4586
|
className: W("tg:w-full", (i || n) && "tg:pr-14"),
|
|
4587
4587
|
children: /* @__PURE__ */ O(Me, { placeholder: ae || z("renderer.defaultHttpInput.selectOption") })
|
|
4588
|
-
}), /* @__PURE__ */ O(Pe, { children: /* @__PURE__ */ O(je, { children:
|
|
4588
|
+
}), /* @__PURE__ */ O(Pe, { children: /* @__PURE__ */ O(je, { children: _.map((e, t) => /* @__PURE__ */ O(Ie, {
|
|
4589
4589
|
value: e.value,
|
|
4590
4590
|
children: /* @__PURE__ */ O(bt, {
|
|
4591
4591
|
label: e.label,
|
|
@@ -4772,15 +4772,15 @@ function or({ className: e, ...t }) {
|
|
|
4772
4772
|
//#endregion
|
|
4773
4773
|
//#region src/renderer/features/TreegeRenderer/web/components/inputs/DefaultRadioInput.tsx
|
|
4774
4774
|
var sr = ({ field: e, extra: t }) => {
|
|
4775
|
-
let { id:
|
|
4775
|
+
let { id: n, name: r, value: i } = e, { InputLabel: s, node: c, setValue: l, error: u, label: d, helperText: f, renderOptionExtras: p, compactOptions: m, missingDependencies: h } = t, { options: g, isLoading: _, error: v } = St(c), { optionsDisplayLimit: y } = a(), b = o(), x = i ? String(i) : "", S = c.data.variant !== "default", C = `${n}-label`, ee = y ? g.slice(0, y) : g, w = g.length - ee.length;
|
|
4776
4776
|
return /* @__PURE__ */ k(K, {
|
|
4777
4777
|
className: "tg:mb-6",
|
|
4778
4778
|
children: [
|
|
4779
|
-
/* @__PURE__ */ O(
|
|
4779
|
+
/* @__PURE__ */ O(s, {
|
|
4780
4780
|
className: "tg:mb-1",
|
|
4781
4781
|
id: C,
|
|
4782
4782
|
label: d,
|
|
4783
|
-
required:
|
|
4783
|
+
required: c.data.required
|
|
4784
4784
|
}),
|
|
4785
4785
|
/* @__PURE__ */ O(mt, { missing: h }),
|
|
4786
4786
|
_ && /* @__PURE__ */ k("div", {
|
|
@@ -4789,15 +4789,15 @@ var sr = ({ field: e, extra: t }) => {
|
|
|
4789
4789
|
}),
|
|
4790
4790
|
/* @__PURE__ */ k(ar, {
|
|
4791
4791
|
value: x,
|
|
4792
|
-
onValueChange: (e) =>
|
|
4792
|
+
onValueChange: (e) => l(e),
|
|
4793
4793
|
"aria-labelledby": d ? C : void 0,
|
|
4794
|
-
"aria-label": d ? void 0 :
|
|
4795
|
-
name:
|
|
4794
|
+
"aria-label": d ? void 0 : c.data.name,
|
|
4795
|
+
name: r,
|
|
4796
4796
|
className: W("tg:min-w-0", S && "tg:flex tg:flex-col tg:gap-2"),
|
|
4797
4797
|
children: [ee.map((e, t) => {
|
|
4798
|
-
let
|
|
4798
|
+
let r = `${n}-${e.value}`, i = b(e.label) || e.value, a = b(e.description), o = String(e.value);
|
|
4799
4799
|
return S ? /* @__PURE__ */ k(nr, {
|
|
4800
|
-
htmlFor:
|
|
4800
|
+
htmlFor: r,
|
|
4801
4801
|
className: W("tg:group/option tg:pointer-events-auto tg:relative tg:cursor-pointer tg:transition-colors tg:hover:has-data-[state=unchecked]:border-muted-foreground/40", m && "tg:group-hover/option:pr-16"),
|
|
4802
4802
|
children: [/* @__PURE__ */ k(er, {
|
|
4803
4803
|
orientation: "horizontal",
|
|
@@ -4821,7 +4821,7 @@ var sr = ({ field: e, extra: t }) => {
|
|
|
4821
4821
|
}),
|
|
4822
4822
|
/* @__PURE__ */ O(or, {
|
|
4823
4823
|
value: o,
|
|
4824
|
-
id:
|
|
4824
|
+
id: r,
|
|
4825
4825
|
disabled: e.disabled,
|
|
4826
4826
|
className: W(m && "tg:ml-auto tg:shrink-0 tg:group-hover/option:invisible")
|
|
4827
4827
|
})
|
|
@@ -4836,7 +4836,7 @@ var sr = ({ field: e, extra: t }) => {
|
|
|
4836
4836
|
children: [
|
|
4837
4837
|
/* @__PURE__ */ O(or, {
|
|
4838
4838
|
value: o,
|
|
4839
|
-
id:
|
|
4839
|
+
id: r,
|
|
4840
4840
|
disabled: e.disabled,
|
|
4841
4841
|
className: "tg:mt-0.5"
|
|
4842
4842
|
}),
|
|
@@ -4848,7 +4848,7 @@ var sr = ({ field: e, extra: t }) => {
|
|
|
4848
4848
|
/* @__PURE__ */ k("div", {
|
|
4849
4849
|
className: W("tg:flex tg:flex-col", m && "tg:min-w-0 tg:flex-1 tg:overflow-hidden"),
|
|
4850
4850
|
children: [/* @__PURE__ */ O(we, {
|
|
4851
|
-
htmlFor:
|
|
4851
|
+
htmlFor: r,
|
|
4852
4852
|
className: W("tg:cursor-pointer tg:font-normal tg:text-sm", m && "tg:block tg:max-w-full tg:truncate"),
|
|
4853
4853
|
children: i
|
|
4854
4854
|
}), a && /* @__PURE__ */ O("span", {
|
|
@@ -4868,18 +4868,18 @@ var sr = ({ field: e, extra: t }) => {
|
|
|
4868
4868
|
children: "…"
|
|
4869
4869
|
})]
|
|
4870
4870
|
}),
|
|
4871
|
-
|
|
4872
|
-
v && !
|
|
4873
|
-
f && !
|
|
4871
|
+
u && /* @__PURE__ */ O(J, { children: u }),
|
|
4872
|
+
v && !u && /* @__PURE__ */ O(J, { children: v }),
|
|
4873
|
+
f && !u && !v && /* @__PURE__ */ O(q, { children: f })
|
|
4874
4874
|
]
|
|
4875
4875
|
});
|
|
4876
4876
|
}, cr = ({ field: e, extra: t }) => {
|
|
4877
|
-
let { id:
|
|
4877
|
+
let { id: n, name: r, value: i, placeholder: a } = e, { InputLabel: s, node: c, setValue: l, error: u, label: d, helperText: f, missingDependencies: p } = t, { options: m, isLoading: h, error: g } = St(c), _ = o(), v = i ? String(i) : "";
|
|
4878
4878
|
return /* @__PURE__ */ k(K, {
|
|
4879
4879
|
className: "tg:mb-6",
|
|
4880
4880
|
children: [
|
|
4881
4881
|
/* @__PURE__ */ O(s, {
|
|
4882
|
-
htmlFor:
|
|
4882
|
+
htmlFor: n,
|
|
4883
4883
|
label: d,
|
|
4884
4884
|
required: c.data.required
|
|
4885
4885
|
}),
|
|
@@ -4889,16 +4889,16 @@ var sr = ({ field: e, extra: t }) => {
|
|
|
4889
4889
|
className: "tg:relative",
|
|
4890
4890
|
children: [
|
|
4891
4891
|
/* @__PURE__ */ k(Ae, {
|
|
4892
|
-
name:
|
|
4892
|
+
name: r,
|
|
4893
4893
|
value: v,
|
|
4894
4894
|
onValueChange: (e) => l(e),
|
|
4895
4895
|
disabled: h || p.length > 0,
|
|
4896
4896
|
children: [/* @__PURE__ */ O(Ne, {
|
|
4897
|
-
id:
|
|
4898
|
-
name:
|
|
4897
|
+
id: n,
|
|
4898
|
+
name: r,
|
|
4899
4899
|
"aria-label": d || c.data.name,
|
|
4900
4900
|
className: W("tg:w-full", (v || h) && "tg:pr-14"),
|
|
4901
|
-
children: /* @__PURE__ */ O(Me, { placeholder:
|
|
4901
|
+
children: /* @__PURE__ */ O(Me, { placeholder: a || _("renderer.defaultSelectInput.selectOption") })
|
|
4902
4902
|
}), /* @__PURE__ */ O(Pe, { children: /* @__PURE__ */ O(je, { children: m.map((e, t) => /* @__PURE__ */ O(Ie, {
|
|
4903
4903
|
value: String(e.value),
|
|
4904
4904
|
disabled: e.disabled,
|
|
@@ -5046,7 +5046,7 @@ var pr = ({ field: e, extra: t }) => {
|
|
|
5046
5046
|
]
|
|
5047
5047
|
});
|
|
5048
5048
|
}, gr = ({ field: e, extra: t }) => {
|
|
5049
|
-
let { id:
|
|
5049
|
+
let { id: n, name: r, value: i } = e, { InputLabel: a, node: s, setValue: c, error: l, label: u, helperText: d } = t, f = o(), p = Array.isArray(i) ? i : [], m = p[0] || "", h = p[1] || "", g = (e) => {
|
|
5050
5050
|
c([e, h]);
|
|
5051
5051
|
}, _ = (e) => {
|
|
5052
5052
|
c([m, e]);
|
|
@@ -5054,16 +5054,16 @@ var pr = ({ field: e, extra: t }) => {
|
|
|
5054
5054
|
return /* @__PURE__ */ k(K, {
|
|
5055
5055
|
className: "tg:mb-6",
|
|
5056
5056
|
children: [
|
|
5057
|
-
/* @__PURE__ */ O(
|
|
5058
|
-
htmlFor: `${
|
|
5057
|
+
/* @__PURE__ */ O(a, {
|
|
5058
|
+
htmlFor: `${n}-start`,
|
|
5059
5059
|
label: u,
|
|
5060
5060
|
required: s.data.required
|
|
5061
5061
|
}),
|
|
5062
5062
|
/* @__PURE__ */ k("div", {
|
|
5063
5063
|
className: "tg:flex tg:gap-2",
|
|
5064
5064
|
children: [/* @__PURE__ */ O(Y, {
|
|
5065
|
-
id: `${
|
|
5066
|
-
name: `${
|
|
5065
|
+
id: `${n}-start`,
|
|
5066
|
+
name: `${r}-start`,
|
|
5067
5067
|
"aria-label": `${u || s.data.name} - ${f("renderer.defaultInputs.startTime")}`,
|
|
5068
5068
|
"aria-invalid": !!l,
|
|
5069
5069
|
"aria-describedby": l ? `${s.id}-error` : void 0,
|
|
@@ -5073,8 +5073,8 @@ var pr = ({ field: e, extra: t }) => {
|
|
|
5073
5073
|
placeholder: f("renderer.defaultInputs.startTime"),
|
|
5074
5074
|
className: "tg:flex-1 tg:bg-background tg:[color-scheme:light] tg:dark:[color-scheme:dark]"
|
|
5075
5075
|
}), /* @__PURE__ */ O(Y, {
|
|
5076
|
-
id: `${
|
|
5077
|
-
name: `${
|
|
5076
|
+
id: `${n}-end`,
|
|
5077
|
+
name: `${r}-end`,
|
|
5078
5078
|
"aria-label": `${u || s.data.name} - ${f("renderer.defaultInputs.endTime")}`,
|
|
5079
5079
|
"aria-invalid": !!l,
|
|
5080
5080
|
"aria-describedby": l ? `${s.id}-error` : void 0,
|
|
@@ -5108,22 +5108,22 @@ var pr = ({ field: e, extra: t }) => {
|
|
|
5108
5108
|
textarea: pr,
|
|
5109
5109
|
time: hr,
|
|
5110
5110
|
timerange: gr
|
|
5111
|
-
}, vr = C(({ label: e, id: t, disabled:
|
|
5112
|
-
let p =
|
|
5111
|
+
}, vr = C(({ label: e, id: t, disabled: n, isSubmitting: r, onBlur: i, onClick: a, onFocus: s, onPointerDown: c, onPointerLeave: l, onPointerMove: u, ...d }, f) => {
|
|
5112
|
+
let p = o();
|
|
5113
5113
|
return /* @__PURE__ */ k("button", {
|
|
5114
5114
|
ref: f,
|
|
5115
5115
|
id: t,
|
|
5116
|
-
onBlur:
|
|
5117
|
-
onClick:
|
|
5116
|
+
onBlur: i,
|
|
5117
|
+
onClick: a,
|
|
5118
5118
|
onFocus: s,
|
|
5119
5119
|
onPointerDown: c,
|
|
5120
|
-
disabled:
|
|
5120
|
+
disabled: n || r,
|
|
5121
5121
|
onPointerLeave: l,
|
|
5122
5122
|
onPointerMove: u,
|
|
5123
5123
|
type: "submit",
|
|
5124
5124
|
className: "tg:inline-flex tg:items-center tg:justify-center tg:gap-2 tg:rounded-md tg:border tg:border-transparent tg:bg-gray-900 tg:px-4 tg:py-2 tg:font-medium tg:text-sm tg:text-white tg:transition-colors tg:hover:bg-gray-800 tg:focus:outline-none tg:focus-visible:ring-2 tg:focus-visible:ring-gray-900 tg:focus-visible:ring-offset-2 tg:disabled:cursor-not-allowed tg:disabled:opacity-50 tg:dark:bg-white tg:dark:text-gray-900 tg:dark:focus-visible:ring-white tg:dark:hover:bg-gray-100",
|
|
5125
5125
|
...d,
|
|
5126
|
-
children: [
|
|
5126
|
+
children: [r && /* @__PURE__ */ O(le, { className: "tg:h-4 tg:w-4 tg:animate-spin" }), e || p("renderer.defaultSubmitButton.submit")]
|
|
5127
5127
|
});
|
|
5128
5128
|
});
|
|
5129
5129
|
//#endregion
|