@standardbeagle/edit-db 0.4.428 → 0.4.430
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/editor.es.js +131 -127
- package/dist/editor.umd.cjs +9 -9
- package/dist/lib/m2m.d.ts +9 -0
- package/package.json +1 -1
package/dist/editor.es.js
CHANGED
|
@@ -7908,7 +7908,7 @@ xu.displayName = vu;
|
|
|
7908
7908
|
function ji(e) {
|
|
7909
7909
|
return e ? "open" : "closed";
|
|
7910
7910
|
}
|
|
7911
|
-
var yu = "DialogTitleWarning", [
|
|
7911
|
+
var yu = "DialogTitleWarning", [Q_, bu] = qv(yu, {
|
|
7912
7912
|
contentName: Kt,
|
|
7913
7913
|
titleName: _i,
|
|
7914
7914
|
docsSlug: "dialog"
|
|
@@ -14479,19 +14479,23 @@ function $S(e, t, n, r) {
|
|
|
14479
14479
|
const m = `${n.junctionTargetField} { ${d.join(" ")} }`, p = [...l, ...c, m].join(" ");
|
|
14480
14480
|
return { query: `query GetLinks_${e.name}($id: ${i}, $limit: Int, $offset: Int) { ${e.name}(filter: { ${o}: { _eq: $id } } limit: $limit offset: $offset) { total offset limit data { ${p} } } }`, variables: { id: AS(r, i) } };
|
|
14481
14481
|
}
|
|
14482
|
-
function OS(e, t
|
|
14482
|
+
function OS(e, t) {
|
|
14483
|
+
const n = Wn(e)[0]?.name ?? t.targetColumnNames[0], r = e.labelColumn || n, o = r !== n ? `${n} label: ${r}` : n;
|
|
14484
|
+
return { query: `query PickTarget($limit: Int) { ${e.name}(limit: $limit sort: [${r}_asc]) { data { ${o} } } }`, idColumn: n };
|
|
14485
|
+
}
|
|
14486
|
+
function DS(e, t, n) {
|
|
14483
14487
|
const r = e[t.junctionTargetField];
|
|
14484
14488
|
if (!r) return null;
|
|
14485
14489
|
const o = lr(r, n, 0), s = r.label != null ? String(r.label) : o;
|
|
14486
14490
|
return { id: o, label: s };
|
|
14487
14491
|
}
|
|
14488
|
-
function
|
|
14492
|
+
function LS(e, t, n) {
|
|
14489
14493
|
return {
|
|
14490
14494
|
[e.junctionSourceColumnNames[0]]: t,
|
|
14491
14495
|
[e.junctionTargetColumnNames[0]]: n
|
|
14492
14496
|
};
|
|
14493
14497
|
}
|
|
14494
|
-
function
|
|
14498
|
+
function VS({ parentTable: e, m2m: t, parentRowId: n, onOpenColumn: r }) {
|
|
14495
14499
|
const o = Ve(), s = Ke(), i = oi(), [l, c] = Z(!1), [u, f] = Z(!1), d = o.findTable(t.junctionTable), m = o.findTable(t.targetTable), p = Vf(d ?? e), { query: h, variables: g } = d && m ? $S(d, m, t, n) : { query: null, variables: {} }, x = ["m2mRows", t.junctionTable, t.targetTable, n], { data: y, isLoading: b, error: w } = ut({
|
|
14496
14500
|
queryKey: x,
|
|
14497
14501
|
queryFn: () => s.query(h, { ...g, limit: 200, offset: 0 }),
|
|
@@ -14543,7 +14547,7 @@ function LS({ parentTable: e, m2m: t, parentRowId: n, onOpenColumn: r }) {
|
|
|
14543
14547
|
N && /* @__PURE__ */ a.jsx("th", { className: "px-2 py-1 w-8", "aria-label": "actions" })
|
|
14544
14548
|
] }) }),
|
|
14545
14549
|
/* @__PURE__ */ a.jsx("tbody", { children: j.map((M, P) => {
|
|
14546
|
-
const G =
|
|
14550
|
+
const G = DS(M, t, m);
|
|
14547
14551
|
return /* @__PURE__ */ a.jsxs("tr", { className: "border-b border-border/50 hover:bg-muted/30", children: [
|
|
14548
14552
|
/* @__PURE__ */ a.jsx("td", { className: "px-2 py-1", children: G ? /* @__PURE__ */ a.jsxs("span", { className: "inline-flex items-center gap-1", children: [
|
|
14549
14553
|
/* @__PURE__ */ a.jsx(dn, { to: `/${m.name}/${G.id}`, className: "text-primary hover:underline", children: G.label }),
|
|
@@ -14579,7 +14583,7 @@ function LS({ parentTable: e, m2m: t, parentRowId: n, onOpenColumn: r }) {
|
|
|
14579
14583
|
] })
|
|
14580
14584
|
] }),
|
|
14581
14585
|
u && /* @__PURE__ */ a.jsx(
|
|
14582
|
-
|
|
14586
|
+
zS,
|
|
14583
14587
|
{
|
|
14584
14588
|
target: m,
|
|
14585
14589
|
junction: d,
|
|
@@ -14591,15 +14595,15 @@ function LS({ parentTable: e, m2m: t, parentRowId: n, onOpenColumn: r }) {
|
|
|
14591
14595
|
)
|
|
14592
14596
|
] });
|
|
14593
14597
|
}
|
|
14594
|
-
function
|
|
14595
|
-
const i = Ke(), l = t.columns.filter((
|
|
14598
|
+
function zS({ target: e, junction: t, m2m: n, parentRowId: r, onClose: o, onLinked: s }) {
|
|
14599
|
+
const i = Ke(), l = t.columns.filter((w) => n.junctionSourceColumnNames.includes(w.name) || n.junctionTargetColumnNames.includes(w.name)).map((w) => ({ column: w })), c = Gf(t, l, []), [u, f] = Z(""), { query: d, idColumn: m } = OS(e, n), { data: p, isLoading: h } = ut({
|
|
14596
14600
|
queryKey: ["m2mTargets", e.name],
|
|
14597
|
-
queryFn: () => i.query(
|
|
14598
|
-
}),
|
|
14599
|
-
await c.insert(
|
|
14601
|
+
queryFn: () => i.query(d, { limit: 500 })
|
|
14602
|
+
}), g = p?.[e.name]?.data ?? [], x = u.trim().toLowerCase(), y = x ? g.filter((w) => String(w.label ?? w[m] ?? "").toLowerCase().includes(x)) : g, b = se(async (w) => {
|
|
14603
|
+
await c.insert(LS(n, r, w)), await s(), o();
|
|
14600
14604
|
}, [c, n, r, s, o]);
|
|
14601
|
-
return /* @__PURE__ */ a.jsx(cr, { open: !0, onOpenChange: (
|
|
14602
|
-
|
|
14605
|
+
return /* @__PURE__ */ a.jsx(cr, { open: !0, onOpenChange: (w) => {
|
|
14606
|
+
w || o();
|
|
14603
14607
|
}, children: /* @__PURE__ */ a.jsxs(ur, { className: "max-w-md", children: [
|
|
14604
14608
|
/* @__PURE__ */ a.jsx($o, { children: /* @__PURE__ */ a.jsxs(dr, { children: [
|
|
14605
14609
|
"Add ",
|
|
@@ -14608,27 +14612,27 @@ function VS({ target: e, junction: t, m2m: n, parentRowId: r, onClose: o, onLink
|
|
|
14608
14612
|
] }) }),
|
|
14609
14613
|
/* @__PURE__ */ a.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
14610
14614
|
/* @__PURE__ */ a.jsx(xi, { className: "size-4 text-muted-foreground" }),
|
|
14611
|
-
/* @__PURE__ */ a.jsx(Ze, { autoFocus: !0, placeholder: `Search ${e.label}…`, value: u, onChange: (
|
|
14615
|
+
/* @__PURE__ */ a.jsx(Ze, { autoFocus: !0, placeholder: `Search ${e.label}…`, value: u, onChange: (w) => f(w.target.value) })
|
|
14612
14616
|
] }),
|
|
14613
14617
|
c.error && /* @__PURE__ */ a.jsx("p", { className: "text-sm text-destructive", children: c.error.message }),
|
|
14614
14618
|
/* @__PURE__ */ a.jsxs("div", { className: "max-h-72 overflow-auto border border-border rounded-md", children: [
|
|
14615
|
-
|
|
14619
|
+
h && /* @__PURE__ */ a.jsxs("div", { className: "flex items-center gap-2 p-3 text-sm text-muted-foreground", children: [
|
|
14616
14620
|
/* @__PURE__ */ a.jsx(wt, { className: "size-4 animate-spin" }),
|
|
14617
14621
|
" Loading…"
|
|
14618
14622
|
] }),
|
|
14619
|
-
!
|
|
14620
|
-
|
|
14621
|
-
const
|
|
14623
|
+
!h && y.length === 0 && /* @__PURE__ */ a.jsx("div", { className: "p-3 text-sm text-muted-foreground", children: "No matches." }),
|
|
14624
|
+
y.map((w, _) => {
|
|
14625
|
+
const R = String(w[m] ?? ""), j = w.label != null ? String(w.label) : R;
|
|
14622
14626
|
return /* @__PURE__ */ a.jsx(
|
|
14623
14627
|
"button",
|
|
14624
14628
|
{
|
|
14625
14629
|
type: "button",
|
|
14626
14630
|
className: "block w-full text-left px-3 py-1.5 text-sm hover:bg-muted/50 disabled:opacity-50",
|
|
14627
14631
|
disabled: c.isPending,
|
|
14628
|
-
onClick: () =>
|
|
14629
|
-
children:
|
|
14632
|
+
onClick: () => b(R),
|
|
14633
|
+
children: j
|
|
14630
14634
|
},
|
|
14631
|
-
|
|
14635
|
+
_
|
|
14632
14636
|
);
|
|
14633
14637
|
})
|
|
14634
14638
|
] })
|
|
@@ -14730,7 +14734,7 @@ function Kf({ parentTable: e, selectedRowId: t, onClose: n, onOpenColumn: r }) {
|
|
|
14730
14734
|
}
|
|
14731
14735
|
) })
|
|
14732
14736
|
] }) : /* @__PURE__ */ a.jsx(
|
|
14733
|
-
|
|
14737
|
+
VS,
|
|
14734
14738
|
{
|
|
14735
14739
|
parentTable: e,
|
|
14736
14740
|
m2m: m.m2m,
|
|
@@ -14741,7 +14745,7 @@ function Kf({ parentTable: e, selectedRowId: t, onClose: n, onOpenColumn: r }) {
|
|
|
14741
14745
|
) })
|
|
14742
14746
|
] });
|
|
14743
14747
|
}
|
|
14744
|
-
const
|
|
14748
|
+
const BS = {
|
|
14745
14749
|
mainTable: null,
|
|
14746
14750
|
columns: [],
|
|
14747
14751
|
focusedIndex: 0,
|
|
@@ -14749,10 +14753,10 @@ const zS = {
|
|
|
14749
14753
|
},
|
|
14750
14754
|
closeColumn: () => {
|
|
14751
14755
|
}
|
|
14752
|
-
}, Uf = Xt(
|
|
14756
|
+
}, Uf = Xt(BS), Yf = Xt({ register: () => {
|
|
14753
14757
|
}, unregister: () => {
|
|
14754
14758
|
} });
|
|
14755
|
-
function
|
|
14759
|
+
function HS({ children: e }) {
|
|
14756
14760
|
const [t, n] = Z(null), [r, o] = Z(0), s = se((d) => {
|
|
14757
14761
|
n(d);
|
|
14758
14762
|
}, []), i = se(() => {
|
|
@@ -14775,25 +14779,25 @@ function BS({ children: e }) {
|
|
|
14775
14779
|
};
|
|
14776
14780
|
return /* @__PURE__ */ a.jsx(Yf.Provider, { value: { register: s, unregister: i }, children: /* @__PURE__ */ a.jsx(Uf.Provider, { value: f, children: e }) });
|
|
14777
14781
|
}
|
|
14778
|
-
function
|
|
14782
|
+
function GS() {
|
|
14779
14783
|
return Ge(Uf);
|
|
14780
14784
|
}
|
|
14781
|
-
function
|
|
14785
|
+
function qS() {
|
|
14782
14786
|
return Ge(Yf);
|
|
14783
14787
|
}
|
|
14784
14788
|
function Tl(e, t) {
|
|
14785
14789
|
return e.tableName === t.tableName && e.filterTable === t.filterTable && e.filterId === t.filterId && e.filterColumn === t.filterColumn;
|
|
14786
14790
|
}
|
|
14787
|
-
function
|
|
14791
|
+
function WS(e, t) {
|
|
14788
14792
|
const n = e[e.length - 1];
|
|
14789
14793
|
if (n && Tl(n, t)) return e;
|
|
14790
14794
|
const r = e.findIndex((o) => Tl(o, t));
|
|
14791
14795
|
return r >= 0 ? e.slice(0, r + 1) : [...e, t];
|
|
14792
14796
|
}
|
|
14793
|
-
function
|
|
14797
|
+
function KS(e, t) {
|
|
14794
14798
|
return t < 0 ? [] : t >= e.length ? e : e.slice(0, t);
|
|
14795
14799
|
}
|
|
14796
|
-
function
|
|
14800
|
+
function US(e, t, n) {
|
|
14797
14801
|
const r = (s) => n(s) ?? s, o = [
|
|
14798
14802
|
{ index: -1, label: r(e) }
|
|
14799
14803
|
];
|
|
@@ -14814,14 +14818,14 @@ function Js(e, t) {
|
|
|
14814
14818
|
function an() {
|
|
14815
14819
|
const e = pi(), { table: t, id: n, filterTable: r } = e, { loading: o, error: s, data: i } = Ve(), [l, c] = Z(null), [u, f] = Z([]), d = Ie(t);
|
|
14816
14820
|
t !== d.current && (d.current = t, u.length > 0 && f([]));
|
|
14817
|
-
const { register: m, unregister: p } =
|
|
14818
|
-
f((E) =>
|
|
14821
|
+
const { register: m, unregister: p } = qS(), h = Ie(null), g = Ie(/* @__PURE__ */ new Map()), x = ae(() => i ? Js(i, t) : void 0, [i, t]), y = x ? qf(x).length > 0 : !1, b = se((j) => {
|
|
14822
|
+
f((E) => WS(E, j));
|
|
14819
14823
|
}, []), w = se((j) => {
|
|
14820
14824
|
f((E) => E.filter((C, N) => N !== j));
|
|
14821
14825
|
}, []), _ = se((j) => {
|
|
14822
|
-
f((E) =>
|
|
14826
|
+
f((E) => KS(E, j + 1));
|
|
14823
14827
|
}, []), R = ae(
|
|
14824
|
-
() =>
|
|
14828
|
+
() => US(t ?? "", u, (j) => {
|
|
14825
14829
|
if (i)
|
|
14826
14830
|
return Js(i, j)?.label;
|
|
14827
14831
|
}),
|
|
@@ -14846,7 +14850,7 @@ function an() {
|
|
|
14846
14850
|
s.message
|
|
14847
14851
|
] }) }) : x ? /* @__PURE__ */ a.jsxs("div", { className: "flex flex-col flex-1 min-h-0", children: [
|
|
14848
14852
|
u.length > 0 && /* @__PURE__ */ a.jsx(
|
|
14849
|
-
|
|
14853
|
+
YS,
|
|
14850
14854
|
{
|
|
14851
14855
|
crumbs: R,
|
|
14852
14856
|
onCrumbClick: _,
|
|
@@ -14877,7 +14881,7 @@ function an() {
|
|
|
14877
14881
|
) })
|
|
14878
14882
|
] }),
|
|
14879
14883
|
u.map((j, E) => /* @__PURE__ */ a.jsx(
|
|
14880
|
-
|
|
14884
|
+
JS,
|
|
14881
14885
|
{
|
|
14882
14886
|
panel: j,
|
|
14883
14887
|
onClose: () => w(E),
|
|
@@ -14891,7 +14895,7 @@ function an() {
|
|
|
14891
14895
|
] })
|
|
14892
14896
|
] }) : /* @__PURE__ */ a.jsx("div", { className: "p-5 text-center text-muted-foreground", children: "Table not found" }) : /* @__PURE__ */ a.jsx("div", { className: "p-5 text-center text-muted-foreground", children: "Table missing" });
|
|
14893
14897
|
}
|
|
14894
|
-
function
|
|
14898
|
+
function YS({ crumbs: e, onCrumbClick: t, activeIndex: n }) {
|
|
14895
14899
|
return /* @__PURE__ */ a.jsx(
|
|
14896
14900
|
"nav",
|
|
14897
14901
|
{
|
|
@@ -14922,7 +14926,7 @@ function US({ crumbs: e, onCrumbClick: t, activeIndex: n }) {
|
|
|
14922
14926
|
}
|
|
14923
14927
|
);
|
|
14924
14928
|
}
|
|
14925
|
-
function
|
|
14929
|
+
function JS({ panel: e, onClose: t, onOpenColumn: n, onRef: r }) {
|
|
14926
14930
|
const { data: o } = Ve(), s = ae(() => o ? Js(o, e.tableName) : void 0, [o, e.tableName]);
|
|
14927
14931
|
return s ? /* @__PURE__ */ a.jsxs("div", { ref: r, className: "flex flex-col flex-1 min-h-0 min-w-0 border-l border-border", children: [
|
|
14928
14932
|
/* @__PURE__ */ a.jsxs("div", { className: "flex items-center gap-1 px-2 py-1 bg-muted/30 border-b border-border shrink-0", children: [
|
|
@@ -14952,7 +14956,7 @@ function YS({ panel: e, onClose: t, onOpenColumn: n, onRef: r }) {
|
|
|
14952
14956
|
] }) : null;
|
|
14953
14957
|
}
|
|
14954
14958
|
function bs() {
|
|
14955
|
-
const e = pi(), { loading: t, error: n, data: r } = Ve(), { mainTable: o, columns: s, focusedIndex: i, focusColumn: l, closeColumn: c } =
|
|
14959
|
+
const e = pi(), { loading: t, error: n, data: r } = Ve(), { mainTable: o, columns: s, focusedIndex: i, focusColumn: l, closeColumn: c } = GS(), [u, f] = Z(""), d = Kn(), { back: m, hasBack: p } = Lg(), h = e?.table, g = s.length > 0, x = ae(() => r?.find((R) => R.graphQlName === h), [r, h]), y = ae(
|
|
14956
14960
|
() => x?.columns?.map((R) => ({ key: R.name, value: `${R.name},${R.paramType}`, label: R.label })),
|
|
14957
14961
|
[x]
|
|
14958
14962
|
), [b, w] = Z(y?.at(0)?.value ?? "");
|
|
@@ -15069,7 +15073,7 @@ function bs() {
|
|
|
15069
15073
|
}
|
|
15070
15074
|
var be = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Mutable = 1] = "Mutable", e[e.Watching = 2] = "Watching", e[e.RecursedCheck = 4] = "RecursedCheck", e[e.Recursed = 8] = "Recursed", e[e.Dirty = 16] = "Dirty", e[e.Pending = 32] = "Pending", e))(be || {});
|
|
15071
15075
|
// @__NO_SIDE_EFFECTS__
|
|
15072
|
-
function
|
|
15076
|
+
function XS({
|
|
15073
15077
|
update: e,
|
|
15074
15078
|
notify: t,
|
|
15075
15079
|
unwatched: n
|
|
@@ -15203,7 +15207,7 @@ function Zi(e, t, n) {
|
|
|
15203
15207
|
}
|
|
15204
15208
|
const Xs = [];
|
|
15205
15209
|
let Lr = 0;
|
|
15206
|
-
const { link: kl, unlink:
|
|
15210
|
+
const { link: kl, unlink: QS, propagate: ZS, checkDirty: Jf, shallowPropagate: Pl } = /* @__PURE__ */ XS({
|
|
15207
15211
|
update(e) {
|
|
15208
15212
|
return e._update();
|
|
15209
15213
|
},
|
|
@@ -15227,7 +15231,7 @@ function lo(e) {
|
|
|
15227
15231
|
const t = e.depsTail;
|
|
15228
15232
|
let n = t !== void 0 ? t.nextDep : e.deps;
|
|
15229
15233
|
for (; n !== void 0; )
|
|
15230
|
-
n =
|
|
15234
|
+
n = QS(n, e);
|
|
15231
15235
|
}
|
|
15232
15236
|
function Xf() {
|
|
15233
15237
|
if (!(Zs > 0)) {
|
|
@@ -15250,7 +15254,7 @@ function Qf(e, t) {
|
|
|
15250
15254
|
return it !== void 0 && kl(o, it, Lr), o._snapshot;
|
|
15251
15255
|
},
|
|
15252
15256
|
subscribe(s) {
|
|
15253
|
-
const i = Zi(s), l = { current: !1 }, c =
|
|
15257
|
+
const i = Zi(s), l = { current: !1 }, c = e_(() => {
|
|
15254
15258
|
o.get(), l.current ? i.next?.(o._snapshot) : l.current = !0;
|
|
15255
15259
|
});
|
|
15256
15260
|
return {
|
|
@@ -15286,11 +15290,11 @@ function Qf(e, t) {
|
|
|
15286
15290
|
}) : o.set = function(s) {
|
|
15287
15291
|
if (o._update(s)) {
|
|
15288
15292
|
const i = o.subs;
|
|
15289
|
-
i !== void 0 && (
|
|
15293
|
+
i !== void 0 && (ZS(i), Pl(i), Xf());
|
|
15290
15294
|
}
|
|
15291
15295
|
}, o;
|
|
15292
15296
|
}
|
|
15293
|
-
function
|
|
15297
|
+
function e_(e) {
|
|
15294
15298
|
const t = () => {
|
|
15295
15299
|
const r = it;
|
|
15296
15300
|
it = n, ++Lr, n.depsTail = void 0, n.flags = be.Watching | be.RecursedCheck;
|
|
@@ -15315,7 +15319,7 @@ function ZS(e) {
|
|
|
15315
15319
|
};
|
|
15316
15320
|
return t(), n;
|
|
15317
15321
|
}
|
|
15318
|
-
class
|
|
15322
|
+
class t_ {
|
|
15319
15323
|
constructor(t) {
|
|
15320
15324
|
this.atom = Qf(
|
|
15321
15325
|
t
|
|
@@ -15334,7 +15338,7 @@ class e_ {
|
|
|
15334
15338
|
return this.atom.subscribe(Zi(t));
|
|
15335
15339
|
}
|
|
15336
15340
|
}
|
|
15337
|
-
class
|
|
15341
|
+
class n_ {
|
|
15338
15342
|
constructor(t) {
|
|
15339
15343
|
this.atom = Qf(
|
|
15340
15344
|
t
|
|
@@ -15351,9 +15355,9 @@ class t_ {
|
|
|
15351
15355
|
}
|
|
15352
15356
|
}
|
|
15353
15357
|
function Vr(e) {
|
|
15354
|
-
return typeof e == "function" ? new
|
|
15358
|
+
return typeof e == "function" ? new n_(e) : new t_(e);
|
|
15355
15359
|
}
|
|
15356
|
-
var
|
|
15360
|
+
var r_ = class {
|
|
15357
15361
|
constructor(e, t) {
|
|
15358
15362
|
this.fn = e, this.options = t, this.lastExecutionTime = 0, this.isPending = !1, this.maybeExecute = (...n) => {
|
|
15359
15363
|
const r = Date.now() - this.lastExecutionTime;
|
|
@@ -15375,10 +15379,10 @@ var n_ = class {
|
|
|
15375
15379
|
}, this.options.leading === void 0 && this.options.trailing === void 0 && (this.options.leading = !0, this.options.trailing = !0);
|
|
15376
15380
|
}
|
|
15377
15381
|
};
|
|
15378
|
-
function
|
|
15379
|
-
return new
|
|
15382
|
+
function o_(e, t) {
|
|
15383
|
+
return new r_(e, t).maybeExecute;
|
|
15380
15384
|
}
|
|
15381
|
-
class
|
|
15385
|
+
class s_ {
|
|
15382
15386
|
#s = !0;
|
|
15383
15387
|
#t;
|
|
15384
15388
|
#e;
|
|
@@ -15553,7 +15557,7 @@ class o_ {
|
|
|
15553
15557
|
);
|
|
15554
15558
|
}
|
|
15555
15559
|
}
|
|
15556
|
-
class
|
|
15560
|
+
class i_ extends s_ {
|
|
15557
15561
|
constructor() {
|
|
15558
15562
|
super({
|
|
15559
15563
|
pluginId: "form-devtools",
|
|
@@ -15561,7 +15565,7 @@ class s_ extends o_ {
|
|
|
15561
15565
|
});
|
|
15562
15566
|
}
|
|
15563
15567
|
}
|
|
15564
|
-
const Be = new
|
|
15568
|
+
const Be = new i_();
|
|
15565
15569
|
function Do(e, t) {
|
|
15566
15570
|
return typeof e == "function" ? e(t) : e;
|
|
15567
15571
|
}
|
|
@@ -15597,7 +15601,7 @@ function In(e, t, n) {
|
|
|
15597
15601
|
}
|
|
15598
15602
|
return o(e);
|
|
15599
15603
|
}
|
|
15600
|
-
function
|
|
15604
|
+
function a_(e, t) {
|
|
15601
15605
|
const n = ea(t);
|
|
15602
15606
|
function r(o) {
|
|
15603
15607
|
if (!o) return;
|
|
@@ -15628,13 +15632,13 @@ function i_(e, t) {
|
|
|
15628
15632
|
}
|
|
15629
15633
|
return r(e);
|
|
15630
15634
|
}
|
|
15631
|
-
const
|
|
15635
|
+
const l_ = /^(\d+)$/gm, c_ = /\.(\d+)(?=\.)/gm, u_ = /^(\d+)\./gm, d_ = /\.(\d+$)/gm, f_ = /\.{2,}/gm, ei = "__int__", Mr = `${ei}$1`;
|
|
15632
15636
|
function ea(e) {
|
|
15633
15637
|
if (Array.isArray(e))
|
|
15634
15638
|
return [...e];
|
|
15635
15639
|
if (typeof e != "string")
|
|
15636
15640
|
throw new Error("Path must be a string.");
|
|
15637
|
-
return e.replace(/(^\[)|]/gm, "").replace(/\[/g, ".").replace(
|
|
15641
|
+
return e.replace(/(^\[)|]/gm, "").replace(/\[/g, ".").replace(l_, Mr).replace(c_, `.${Mr}.`).replace(u_, `${Mr}.`).replace(d_, `.${Mr}`).replace(f_, ".").split(".").map((t) => {
|
|
15638
15642
|
if (t.startsWith(ei)) {
|
|
15639
15643
|
const n = t.substring(ei.length), r = parseInt(n, 10);
|
|
15640
15644
|
return String(r) === n ? r : n;
|
|
@@ -15642,7 +15646,7 @@ function ea(e) {
|
|
|
15642
15646
|
return t;
|
|
15643
15647
|
});
|
|
15644
15648
|
}
|
|
15645
|
-
function
|
|
15649
|
+
function m_(e) {
|
|
15646
15650
|
return !(Array.isArray(e) && e.length === 0);
|
|
15647
15651
|
}
|
|
15648
15652
|
function ti(e, t) {
|
|
@@ -15747,7 +15751,7 @@ function Zf() {
|
|
|
15747
15751
|
t = Nr[Gt + e], e === 6 ? n += Br[t & 15 | 64] : e === 8 ? n += Br[t & 63 | 128] : n += Br[t], e & 1 && e > 1 && e < 11 && (n += "-");
|
|
15748
15752
|
return Gt++, n;
|
|
15749
15753
|
}
|
|
15750
|
-
const
|
|
15754
|
+
const p_ = o_(
|
|
15751
15755
|
(e) => Be.emit("form-state", {
|
|
15752
15756
|
id: e.formId,
|
|
15753
15757
|
state: e.store.state
|
|
@@ -15836,7 +15840,7 @@ const cn = (e) => {
|
|
|
15836
15840
|
throw new Error(`Unknown validation event type: ${e.event.type}`);
|
|
15837
15841
|
}
|
|
15838
15842
|
};
|
|
15839
|
-
function
|
|
15843
|
+
function g_(e, t) {
|
|
15840
15844
|
const n = /* @__PURE__ */ new Map();
|
|
15841
15845
|
for (const r of e) {
|
|
15842
15846
|
const o = r.path ?? [];
|
|
@@ -15852,7 +15856,7 @@ function p_(e, t) {
|
|
|
15852
15856
|
return Object.fromEntries(n);
|
|
15853
15857
|
}
|
|
15854
15858
|
const Al = (e, t) => {
|
|
15855
|
-
const n =
|
|
15859
|
+
const n = g_(e, t);
|
|
15856
15860
|
return {
|
|
15857
15861
|
form: n,
|
|
15858
15862
|
fields: n
|
|
@@ -16020,7 +16024,7 @@ class $l {
|
|
|
16020
16024
|
constructor(t) {
|
|
16021
16025
|
this.options = {}, this.fieldInfo = {}, this.mount = () => {
|
|
16022
16026
|
const s = this.store.subscribe(() => {
|
|
16023
|
-
|
|
16027
|
+
p_(this);
|
|
16024
16028
|
}), i = Be.on(
|
|
16025
16029
|
"request-form-state",
|
|
16026
16030
|
(d) => {
|
|
@@ -16482,7 +16486,7 @@ class $l {
|
|
|
16482
16486
|
this.baseStore.setState((c) => {
|
|
16483
16487
|
const u = { ...c };
|
|
16484
16488
|
return l.forEach((f) => {
|
|
16485
|
-
u.values =
|
|
16489
|
+
u.values = a_(u.values, f), delete this.fieldInfo[f], delete u.fieldMetaBase[f];
|
|
16486
16490
|
}), u;
|
|
16487
16491
|
});
|
|
16488
16492
|
}, this.pushFieldValue = (s, i, l) => {
|
|
@@ -16678,7 +16682,7 @@ class $l {
|
|
|
16678
16682
|
const b = this.getFieldInfo(u)?.instance;
|
|
16679
16683
|
(!b || !b.options.disableErrorFlat) && (h = h.flat(1));
|
|
16680
16684
|
}
|
|
16681
|
-
const g = !
|
|
16685
|
+
const g = !m_(h), x = !f.isDirty, y = Ht(
|
|
16682
16686
|
p,
|
|
16683
16687
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
16684
16688
|
this.getFieldInfo(u)?.instance?.options.defaultValue ?? Er(this.options.defaultValues, u)
|
|
@@ -17222,7 +17226,7 @@ function Tr(e) {
|
|
|
17222
17226
|
return "onChange";
|
|
17223
17227
|
}
|
|
17224
17228
|
}
|
|
17225
|
-
function
|
|
17229
|
+
function h_(e, t) {
|
|
17226
17230
|
if (!t) return;
|
|
17227
17231
|
const n = Object.assign({}, e, {
|
|
17228
17232
|
state: Dn(e.state)
|
|
@@ -17246,7 +17250,7 @@ function g_(e, t) {
|
|
|
17246
17250
|
}
|
|
17247
17251
|
var kr = { exports: {} }, Cs = {};
|
|
17248
17252
|
var Ll;
|
|
17249
|
-
function
|
|
17253
|
+
function v_() {
|
|
17250
17254
|
if (Ll) return Cs;
|
|
17251
17255
|
Ll = 1;
|
|
17252
17256
|
var e = Fe, t = Eu();
|
|
@@ -17298,7 +17302,7 @@ function h_() {
|
|
|
17298
17302
|
}
|
|
17299
17303
|
var Ss = {};
|
|
17300
17304
|
var Vl;
|
|
17301
|
-
function
|
|
17305
|
+
function x_() {
|
|
17302
17306
|
return Vl || (Vl = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
17303
17307
|
function e(u, f) {
|
|
17304
17308
|
return u === f && (u !== 0 || 1 / u === 1 / f) || u !== u && f !== f;
|
|
@@ -17350,14 +17354,14 @@ function v_() {
|
|
|
17350
17354
|
})()), Ss;
|
|
17351
17355
|
}
|
|
17352
17356
|
var zl;
|
|
17353
|
-
function
|
|
17354
|
-
return zl || (zl = 1, process.env.NODE_ENV === "production" ? kr.exports =
|
|
17357
|
+
function y_() {
|
|
17358
|
+
return zl || (zl = 1, process.env.NODE_ENV === "production" ? kr.exports = v_() : kr.exports = x_()), kr.exports;
|
|
17355
17359
|
}
|
|
17356
|
-
var
|
|
17357
|
-
function
|
|
17360
|
+
var b_ = y_();
|
|
17361
|
+
function w_(e, t) {
|
|
17358
17362
|
return e === t;
|
|
17359
17363
|
}
|
|
17360
|
-
function Rt(e, t, n =
|
|
17364
|
+
function Rt(e, t, n = w_) {
|
|
17361
17365
|
const r = se(
|
|
17362
17366
|
(i) => {
|
|
17363
17367
|
if (!e)
|
|
@@ -17368,7 +17372,7 @@ function Rt(e, t, n = b_) {
|
|
|
17368
17372
|
},
|
|
17369
17373
|
[e]
|
|
17370
17374
|
), o = se(() => e?.get(), [e]);
|
|
17371
|
-
return
|
|
17375
|
+
return b_.useSyncExternalStoreWithSelector(
|
|
17372
17376
|
r,
|
|
17373
17377
|
o,
|
|
17374
17378
|
o,
|
|
@@ -17377,7 +17381,7 @@ function Rt(e, t, n = b_) {
|
|
|
17377
17381
|
);
|
|
17378
17382
|
}
|
|
17379
17383
|
const un = typeof window < "u" ? Hl : Ae;
|
|
17380
|
-
function
|
|
17384
|
+
function C_(e) {
|
|
17381
17385
|
const [t, n] = Z(() => ({
|
|
17382
17386
|
form: e.form,
|
|
17383
17387
|
name: e.name
|
|
@@ -17445,21 +17449,21 @@ function w_(e) {
|
|
|
17445
17449
|
r.update(e);
|
|
17446
17450
|
}), m;
|
|
17447
17451
|
}
|
|
17448
|
-
const
|
|
17452
|
+
const S_ = (({
|
|
17449
17453
|
children: e,
|
|
17450
17454
|
...t
|
|
17451
17455
|
}) => {
|
|
17452
|
-
const n =
|
|
17456
|
+
const n = C_(t), r = ae(
|
|
17453
17457
|
() => Do(e, n),
|
|
17454
17458
|
[e, n]
|
|
17455
17459
|
);
|
|
17456
17460
|
return /* @__PURE__ */ a.jsx(a.Fragment, { children: r });
|
|
17457
17461
|
});
|
|
17458
|
-
function
|
|
17462
|
+
function __() {
|
|
17459
17463
|
return Z(() => Zf())[0];
|
|
17460
17464
|
}
|
|
17461
|
-
const
|
|
17462
|
-
function
|
|
17465
|
+
const j_ = v, R_ = v.version.split(".")[0] === "17" ? __ : j_.useId;
|
|
17466
|
+
function E_({
|
|
17463
17467
|
form: e,
|
|
17464
17468
|
selector: t = (r) => r,
|
|
17465
17469
|
children: n
|
|
@@ -17467,8 +17471,8 @@ function R_({
|
|
|
17467
17471
|
const r = Rt(e.store, t);
|
|
17468
17472
|
return /* @__PURE__ */ a.jsx(a.Fragment, { children: Do(n, r) });
|
|
17469
17473
|
}
|
|
17470
|
-
function
|
|
17471
|
-
const t =
|
|
17474
|
+
function M_(e) {
|
|
17475
|
+
const t = R_(), [n, r] = Z(e?.formId), [o, s] = Z(() => new $l({ ...e, formId: e?.formId ?? t }));
|
|
17472
17476
|
if (n !== e?.formId) {
|
|
17473
17477
|
const c = e?.formId ?? t;
|
|
17474
17478
|
s(new $l({ ...e, formId: c })), r(c);
|
|
@@ -17486,10 +17490,10 @@ function E_(e) {
|
|
|
17486
17490
|
}
|
|
17487
17491
|
};
|
|
17488
17492
|
return c.Field = function(f) {
|
|
17489
|
-
return /* @__PURE__ */ a.jsx(
|
|
17493
|
+
return /* @__PURE__ */ a.jsx(S_, { ...f, form: o });
|
|
17490
17494
|
}, c.Subscribe = function(f) {
|
|
17491
17495
|
return /* @__PURE__ */ a.jsx(
|
|
17492
|
-
|
|
17496
|
+
E_,
|
|
17493
17497
|
{
|
|
17494
17498
|
form: o,
|
|
17495
17499
|
selector: f.selector,
|
|
@@ -17503,12 +17507,12 @@ function E_(e) {
|
|
|
17503
17507
|
});
|
|
17504
17508
|
const l = Ie(!1);
|
|
17505
17509
|
return un(() => {
|
|
17506
|
-
l.current && e?.transform &&
|
|
17510
|
+
l.current && e?.transform && h_(o, e.transform);
|
|
17507
17511
|
}, [o, e?.transform]), un(() => {
|
|
17508
17512
|
l.current = !0;
|
|
17509
17513
|
}), i;
|
|
17510
17514
|
}
|
|
17511
|
-
function
|
|
17515
|
+
function N_(e, t, n) {
|
|
17512
17516
|
const r = Ke(), o = ae(
|
|
17513
17517
|
() => e?.data?.find((u) => u.graphQlName === t),
|
|
17514
17518
|
[e, t]
|
|
@@ -17530,8 +17534,8 @@ function M_(e, t, n) {
|
|
|
17530
17534
|
data: c?.values?.data ?? []
|
|
17531
17535
|
};
|
|
17532
17536
|
}
|
|
17533
|
-
const
|
|
17534
|
-
function
|
|
17537
|
+
const T_ = 500;
|
|
17538
|
+
function k_(e, t, n) {
|
|
17535
17539
|
const r = Ke(), o = ae(
|
|
17536
17540
|
() => e?.data?.find((d) => d.graphQlName === t),
|
|
17537
17541
|
[e, t]
|
|
@@ -17539,7 +17543,7 @@ function T_(e, t, n) {
|
|
|
17539
17543
|
if (!o) return "";
|
|
17540
17544
|
const d = o.labelColumn ?? n[0], m = new Set(n);
|
|
17541
17545
|
return m.add(d), Array.from(m).join(" ");
|
|
17542
|
-
}, [o, n]), i = ae(() => e.loading || e.error || !o || n.length === 0 ? null : `query Get_${t}_CompositeRef { values: ${t}(limit: ${
|
|
17546
|
+
}, [o, n]), i = ae(() => e.loading || e.error || !o || n.length === 0 ? null : `query Get_${t}_CompositeRef { values: ${t}(limit: ${T_}) { data { ${s} } } }`, [o, t, s, e.loading, e.error, n.length]), { isLoading: l, error: c, data: u } = ut({
|
|
17543
17547
|
queryKey: ["compositeTableRef", t, n.join("|")],
|
|
17544
17548
|
queryFn: () => r.query(i),
|
|
17545
17549
|
enabled: !!i
|
|
@@ -17575,7 +17579,7 @@ function jn({
|
|
|
17575
17579
|
}
|
|
17576
17580
|
);
|
|
17577
17581
|
}
|
|
17578
|
-
function
|
|
17582
|
+
function P_({
|
|
17579
17583
|
name: e,
|
|
17580
17584
|
label: t,
|
|
17581
17585
|
value: n,
|
|
@@ -17590,7 +17594,7 @@ function k_({
|
|
|
17590
17594
|
b && (b.style.height = "auto", b.style.height = Math.min(b.scrollHeight, 400) + "px");
|
|
17591
17595
|
}, []);
|
|
17592
17596
|
if (Ae(h, [n, h]), c)
|
|
17593
|
-
return /* @__PURE__ */ a.jsx(
|
|
17597
|
+
return /* @__PURE__ */ a.jsx(F_, { name: e, label: t, value: n });
|
|
17594
17598
|
if (!u && f === "text")
|
|
17595
17599
|
return null;
|
|
17596
17600
|
const g = () => {
|
|
@@ -17671,7 +17675,7 @@ function k_({
|
|
|
17671
17675
|
d && /* @__PURE__ */ a.jsx("p", { className: "text-xs text-destructive", children: d })
|
|
17672
17676
|
] });
|
|
17673
17677
|
}
|
|
17674
|
-
function
|
|
17678
|
+
function F_({ name: e, label: t, value: n }) {
|
|
17675
17679
|
const r = n ? Math.ceil(n.length * 3 / 4) : 0, o = r < 1024 ? `${r} bytes` : r < 1024 * 1024 ? `${(r / 1024).toFixed(1)} KB` : `${(r / (1024 * 1024)).toFixed(1)} MB`, s = n ? n.slice(0, 256) + (n.length > 256 ? "..." : "") : "(empty)";
|
|
17676
17680
|
return /* @__PURE__ */ a.jsxs("div", { className: "grid gap-2", children: [
|
|
17677
17681
|
/* @__PURE__ */ a.jsxs(jn, { htmlFor: e, className: "flex items-center gap-1.5", children: [
|
|
@@ -17687,8 +17691,8 @@ function P_({ name: e, label: t, value: n }) {
|
|
|
17687
17691
|
/* @__PURE__ */ a.jsx("p", { className: "text-xs text-muted-foreground", children: "Binary fields are read-only in this editor." })
|
|
17688
17692
|
] });
|
|
17689
17693
|
}
|
|
17690
|
-
const _s = ["Boolean", "Boolean!"], tm = ["DateTime", "DateTime!"],
|
|
17691
|
-
function
|
|
17694
|
+
const _s = ["Boolean", "Boolean!"], tm = ["DateTime", "DateTime!"], I_ = ["Int", "Int!", "Float", "Float!"], js = { filterText: "", variables: {}, params: [] };
|
|
17695
|
+
function A_(e, t) {
|
|
17692
17696
|
return ae(() => {
|
|
17693
17697
|
const n = e?.data?.find((l) => l.graphQlName == t), o = n.columns.filter((l) => !l.isReadOnly && !l.isIdentity).map((l) => {
|
|
17694
17698
|
const c = n.singleJoins.find((f) => f.sourceColumnNames[0] === l.graphQlName);
|
|
@@ -17708,8 +17712,8 @@ function I_(e, t) {
|
|
|
17708
17712
|
];
|
|
17709
17713
|
}, [e, t]);
|
|
17710
17714
|
}
|
|
17711
|
-
function
|
|
17712
|
-
const r = Kn(), o = Ke(), s = n === void 0 || n === "", [i, l, c] =
|
|
17715
|
+
function $_({ table: e, schema: t, editid: n }) {
|
|
17716
|
+
const r = Kn(), o = Ke(), s = n === void 0 || n === "", [i, l, c] = A_(t, e), u = i.labelColumn, f = i.label, d = Gf(i, l, c, n), m = ae(() => {
|
|
17713
17717
|
if (s) return js;
|
|
17714
17718
|
const C = Ji(n, i);
|
|
17715
17719
|
return C ? Ff(C, i) ?? js : js;
|
|
@@ -17732,7 +17736,7 @@ function A_({ table: e, schema: t, editid: n }) {
|
|
|
17732
17736
|
C[N.name] = M === "0001-01-01" ? "" : M ?? "";
|
|
17733
17737
|
} else _s.some((M) => M === N.paramType) ? C[N.name] = !!y[N.name] : C[N.name] = y[N.name] ?? "";
|
|
17734
17738
|
return C;
|
|
17735
|
-
}, [y, l]), w =
|
|
17739
|
+
}, [y, l]), w = M_({
|
|
17736
17740
|
defaultValues: b,
|
|
17737
17741
|
onSubmit: async ({ value: C }) => {
|
|
17738
17742
|
await (s ? d.insert : d.update)({ ...C }), r("../..");
|
|
@@ -17790,7 +17794,7 @@ function A_({ table: e, schema: t, editid: n }) {
|
|
|
17790
17794
|
children: [
|
|
17791
17795
|
/* @__PURE__ */ a.jsxs("div", { className: "flex-1 overflow-y-auto px-5 py-4", children: [
|
|
17792
17796
|
E.length > 0 && /* @__PURE__ */ a.jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-x-4 gap-y-3", children: E.map(({ column: C, join: N, fkRole: M }) => /* @__PURE__ */ a.jsx(
|
|
17793
|
-
|
|
17797
|
+
L_,
|
|
17794
17798
|
{
|
|
17795
17799
|
column: C,
|
|
17796
17800
|
join: N,
|
|
@@ -17800,8 +17804,8 @@ function A_({ table: e, schema: t, editid: n }) {
|
|
|
17800
17804
|
},
|
|
17801
17805
|
C.name
|
|
17802
17806
|
)) }),
|
|
17803
|
-
R.length > 0 && /* @__PURE__ */ a.jsx("div", { className: E.length > 0 ? "mt-4 pt-4 border-t border-border" : "", children: /* @__PURE__ */ a.jsx("div", { className: "flex flex-wrap gap-x-6 gap-y-2", children: R.map(({ column: C }) => /* @__PURE__ */ a.jsx(
|
|
17804
|
-
j.length > 0 && /* @__PURE__ */ a.jsx("div", { className: E.length > 0 || R.length > 0 ? "mt-4 pt-4 border-t border-border" : "", children: /* @__PURE__ */ a.jsx("div", { className: "grid gap-3", children: j.map(({ column: C }) => /* @__PURE__ */ a.jsx(
|
|
17807
|
+
R.length > 0 && /* @__PURE__ */ a.jsx("div", { className: E.length > 0 ? "mt-4 pt-4 border-t border-border" : "", children: /* @__PURE__ */ a.jsx("div", { className: "flex flex-wrap gap-x-6 gap-y-2", children: R.map(({ column: C }) => /* @__PURE__ */ a.jsx(z_, { column: C, form: w }, C.name)) }) }),
|
|
17808
|
+
j.length > 0 && /* @__PURE__ */ a.jsx("div", { className: E.length > 0 || R.length > 0 ? "mt-4 pt-4 border-t border-border" : "", children: /* @__PURE__ */ a.jsx("div", { className: "grid gap-3", children: j.map(({ column: C }) => /* @__PURE__ */ a.jsx(B_, { column: C, form: w }, C.name)) }) })
|
|
17805
17809
|
] }),
|
|
17806
17810
|
/* @__PURE__ */ a.jsxs("div", { className: "flex items-center justify-end gap-2 px-5 py-3 border-t border-border bg-muted/30 shrink-0", children: [
|
|
17807
17811
|
/* @__PURE__ */ a.jsx(Y, { variant: "outline", size: "sm", asChild: !0, children: /* @__PURE__ */ a.jsx(dn, { to: "../..", children: "Cancel" }) }),
|
|
@@ -17822,9 +17826,9 @@ function Pr() {
|
|
|
17822
17826
|
return e ? n.loading ? /* @__PURE__ */ a.jsx("div", { children: "Loading..." }) : n.error ? /* @__PURE__ */ a.jsxs("div", { children: [
|
|
17823
17827
|
"Error: ",
|
|
17824
17828
|
n.error.message
|
|
17825
|
-
] }) : /* @__PURE__ */ a.jsx(
|
|
17829
|
+
] }) : /* @__PURE__ */ a.jsx($_, { table: e, schema: n, editid: t ?? "" }) : /* @__PURE__ */ a.jsx("div", { children: "Table missing" });
|
|
17826
17830
|
}
|
|
17827
|
-
function
|
|
17831
|
+
function O_({ current: e, max: t }) {
|
|
17828
17832
|
const n = t - e, r = n <= 10 && n > 0, o = n <= 0;
|
|
17829
17833
|
return /* @__PURE__ */ a.jsx("div", { className: "text-xs text-right mt-0.5", "aria-live": "polite", children: /* @__PURE__ */ a.jsxs(
|
|
17830
17834
|
"span",
|
|
@@ -17838,18 +17842,18 @@ function $_({ current: e, max: t }) {
|
|
|
17838
17842
|
}
|
|
17839
17843
|
) });
|
|
17840
17844
|
}
|
|
17841
|
-
function
|
|
17845
|
+
function D_({ min: e, max: t, step: n }) {
|
|
17842
17846
|
if (e === void 0 && t === void 0) return null;
|
|
17843
17847
|
let r = "";
|
|
17844
17848
|
return e != null && t !== void 0 && t !== null ? r = `Range: ${e} to ${t}` : e != null ? r = `Min: ${e}` : t != null && (r = `Max: ${t}`), n != null && n !== 1 && (r += ` (step: ${n})`), /* @__PURE__ */ a.jsx("div", { className: "text-xs text-muted-foreground mt-0.5", "aria-live": "polite", children: r });
|
|
17845
17849
|
}
|
|
17846
|
-
function
|
|
17850
|
+
function L_({ column: e, join: t, fkRole: n, form: r, schema: o }) {
|
|
17847
17851
|
const s = e.name, i = !e.isNullable;
|
|
17848
17852
|
if (n === "member-composite") return null;
|
|
17849
|
-
const l = tm.some((m) => m === e.paramType), c =
|
|
17853
|
+
const l = tm.some((m) => m === e.paramType), c = I_.some((m) => m === e.paramType), u = e.maxLength && e.maxLength > 0 && !l && !c;
|
|
17850
17854
|
if (e.enumValues && e.enumValues.length > 0)
|
|
17851
17855
|
return /* @__PURE__ */ a.jsx(
|
|
17852
|
-
|
|
17856
|
+
V_,
|
|
17853
17857
|
{
|
|
17854
17858
|
column: e,
|
|
17855
17859
|
form: r,
|
|
@@ -17857,7 +17861,7 @@ function D_({ column: e, join: t, fkRole: n, form: r, schema: o }) {
|
|
|
17857
17861
|
}
|
|
17858
17862
|
);
|
|
17859
17863
|
if (t && o)
|
|
17860
|
-
return n === "anchor-composite" ? /* @__PURE__ */ a.jsx(
|
|
17864
|
+
return n === "anchor-composite" ? /* @__PURE__ */ a.jsx(G_, { column: e, join: t, form: r, schema: o, isRequired: i }) : /* @__PURE__ */ a.jsx(H_, { column: e, join: t, form: r, schema: o, isRequired: i });
|
|
17861
17865
|
const f = e.inputType || (l ? "date" : c ? "number" : "text"), d = {
|
|
17862
17866
|
onSubmit: ({ value: m }) => {
|
|
17863
17867
|
if (i && (m == null || m === ""))
|
|
@@ -17910,19 +17914,19 @@ function D_({ column: e, join: t, fkRole: n, form: r, schema: o }) {
|
|
|
17910
17914
|
}
|
|
17911
17915
|
),
|
|
17912
17916
|
u && /* @__PURE__ */ a.jsx(
|
|
17913
|
-
|
|
17917
|
+
O_,
|
|
17914
17918
|
{
|
|
17915
17919
|
current: String(m.state.value ?? "").length,
|
|
17916
17920
|
max: e.maxLength
|
|
17917
17921
|
}
|
|
17918
17922
|
),
|
|
17919
|
-
c && (e.min !== void 0 || e.max !== void 0) && /* @__PURE__ */ a.jsx(
|
|
17923
|
+
c && (e.min !== void 0 || e.max !== void 0) && /* @__PURE__ */ a.jsx(D_, { min: e.min, max: e.max, step: e.step }),
|
|
17920
17924
|
/* @__PURE__ */ a.jsx(Lo, { errors: m.state.meta.errors })
|
|
17921
17925
|
] })
|
|
17922
17926
|
}
|
|
17923
17927
|
);
|
|
17924
17928
|
}
|
|
17925
|
-
function
|
|
17929
|
+
function V_({ column: e, form: t, isRequired: n }) {
|
|
17926
17930
|
const r = e.name, o = e.enumValues || [], s = e.enumLabels || o;
|
|
17927
17931
|
return /* @__PURE__ */ a.jsx(
|
|
17928
17932
|
t.Field,
|
|
@@ -17955,7 +17959,7 @@ function L_({ column: e, form: t, isRequired: n }) {
|
|
|
17955
17959
|
}
|
|
17956
17960
|
);
|
|
17957
17961
|
}
|
|
17958
|
-
function
|
|
17962
|
+
function z_({ column: e, form: t }) {
|
|
17959
17963
|
const n = e.name;
|
|
17960
17964
|
return /* @__PURE__ */ a.jsx(
|
|
17961
17965
|
t.Field,
|
|
@@ -17976,7 +17980,7 @@ function V_({ column: e, form: t }) {
|
|
|
17976
17980
|
}
|
|
17977
17981
|
);
|
|
17978
17982
|
}
|
|
17979
|
-
function
|
|
17983
|
+
function B_({ column: e, form: t }) {
|
|
17980
17984
|
const n = e.name, r = !e.isNullable;
|
|
17981
17985
|
return /* @__PURE__ */ a.jsx(
|
|
17982
17986
|
t.Field,
|
|
@@ -17994,7 +17998,7 @@ function z_({ column: e, form: t }) {
|
|
|
17994
17998
|
r && /* @__PURE__ */ a.jsx("span", { className: "text-destructive ml-0.5", children: "*" })
|
|
17995
17999
|
] }),
|
|
17996
18000
|
/* @__PURE__ */ a.jsx(
|
|
17997
|
-
|
|
18001
|
+
P_,
|
|
17998
18002
|
{
|
|
17999
18003
|
name: n,
|
|
18000
18004
|
label: e.label,
|
|
@@ -18011,8 +18015,8 @@ function z_({ column: e, form: t }) {
|
|
|
18011
18015
|
}
|
|
18012
18016
|
);
|
|
18013
18017
|
}
|
|
18014
|
-
function
|
|
18015
|
-
const s = e.name, i =
|
|
18018
|
+
function H_({ column: e, join: t, form: n, schema: r, isRequired: o }) {
|
|
18019
|
+
const s = e.name, i = N_(r, t.destinationTable, t.destinationColumnNames[0]);
|
|
18016
18020
|
return /* @__PURE__ */ a.jsx(
|
|
18017
18021
|
n.Field,
|
|
18018
18022
|
{
|
|
@@ -18044,8 +18048,8 @@ function B_({ column: e, join: t, form: n, schema: r, isRequired: o }) {
|
|
|
18044
18048
|
}
|
|
18045
18049
|
);
|
|
18046
18050
|
}
|
|
18047
|
-
function
|
|
18048
|
-
const s = t.sourceColumnNames ?? [], i = t.destinationColumnNames ?? [], l =
|
|
18051
|
+
function G_({ column: e, join: t, form: n, schema: r, isRequired: o }) {
|
|
18052
|
+
const s = t.sourceColumnNames ?? [], i = t.destinationColumnNames ?? [], l = k_(r, t.destinationTable, i), c = n.useStore((f) => {
|
|
18049
18053
|
const d = [];
|
|
18050
18054
|
for (const m of s) {
|
|
18051
18055
|
const p = f.values?.[m];
|
|
@@ -18118,7 +18122,7 @@ class Fr extends Em {
|
|
|
18118
18122
|
] }) }) : r;
|
|
18119
18123
|
}
|
|
18120
18124
|
}
|
|
18121
|
-
function
|
|
18125
|
+
function q_() {
|
|
18122
18126
|
const { loading: e, error: t, data: n } = Ve();
|
|
18123
18127
|
return e ? /* @__PURE__ */ a.jsxs("div", { className: "flex flex-col items-center justify-center h-full gap-3 text-muted-foreground", children: [
|
|
18124
18128
|
/* @__PURE__ */ a.jsx(Vn, { className: "size-10 animate-pulse" }),
|
|
@@ -18159,7 +18163,7 @@ function G_() {
|
|
|
18159
18163
|
] })
|
|
18160
18164
|
] });
|
|
18161
18165
|
}
|
|
18162
|
-
function
|
|
18166
|
+
function W_({ children: e }) {
|
|
18163
18167
|
const { loading: t, error: n } = Ve();
|
|
18164
18168
|
return t ? /* @__PURE__ */ a.jsxs("div", { className: "flex items-center justify-center flex-1 gap-3 text-muted-foreground", children: [
|
|
18165
18169
|
/* @__PURE__ */ a.jsx(wt, { className: "size-6 animate-spin" }),
|
|
@@ -18177,9 +18181,9 @@ const Bl = () => /* @__PURE__ */ a.jsxs("div", { className: "flex items-center j
|
|
|
18177
18181
|
/* @__PURE__ */ a.jsx(wt, { className: "size-4 animate-spin text-muted-foreground" }),
|
|
18178
18182
|
/* @__PURE__ */ a.jsx("span", { className: "text-sm text-muted-foreground", children: "Loading..." })
|
|
18179
18183
|
] });
|
|
18180
|
-
function
|
|
18184
|
+
function K_() {
|
|
18181
18185
|
const [e, t] = Z(!0);
|
|
18182
|
-
return /* @__PURE__ */ a.jsx(
|
|
18186
|
+
return /* @__PURE__ */ a.jsx(W_, { children: /* @__PURE__ */ a.jsx(HS, { children: /* @__PURE__ */ a.jsxs("div", { className: `grid h-full flex-1 min-h-0 grid-rows-[auto_1fr] ${e ? "grid-cols-[minmax(150px,min-content)_1fr]" : "grid-cols-[0px_1fr]"} md:grid-cols-[minmax(150px,min-content)_1fr] transition-[grid-template-columns] duration-200`, children: [
|
|
18183
18187
|
/* @__PURE__ */ a.jsxs("div", { className: "col-span-full sticky top-0 z-50 bg-background border-b border-border flex items-center", children: [
|
|
18184
18188
|
/* @__PURE__ */ a.jsx(
|
|
18185
18189
|
Y,
|
|
@@ -18208,7 +18212,7 @@ function W_() {
|
|
|
18208
18212
|
/* @__PURE__ */ a.jsx(ke, { path: "/:table/:id", element: /* @__PURE__ */ a.jsx(an, {}) }),
|
|
18209
18213
|
/* @__PURE__ */ a.jsx(ke, { path: "/:table/edit/:editid", element: /* @__PURE__ */ a.jsx(an, {}) }),
|
|
18210
18214
|
/* @__PURE__ */ a.jsx(ke, { path: "/:table", element: /* @__PURE__ */ a.jsx(an, {}) }),
|
|
18211
|
-
/* @__PURE__ */ a.jsx(ke, { path: "/", element: /* @__PURE__ */ a.jsx(
|
|
18215
|
+
/* @__PURE__ */ a.jsx(ke, { path: "/", element: /* @__PURE__ */ a.jsx(q_, {}) })
|
|
18212
18216
|
] }) }) }),
|
|
18213
18217
|
/* @__PURE__ */ a.jsx(Fr, { section: "Data Edit", children: /* @__PURE__ */ a.jsx(pa, { fallback: /* @__PURE__ */ a.jsx(Bl, {}), children: /* @__PURE__ */ a.jsxs(ts, { children: [
|
|
18214
18218
|
/* @__PURE__ */ a.jsx(ke, { path: "/:table/from/:filterTable/:id/edit/:editid", element: /* @__PURE__ */ a.jsx(Pr, {}) }),
|
|
@@ -18219,13 +18223,13 @@ function W_() {
|
|
|
18219
18223
|
] })
|
|
18220
18224
|
] }) }) });
|
|
18221
18225
|
}
|
|
18222
|
-
function
|
|
18226
|
+
function U_({ onLocate: e }) {
|
|
18223
18227
|
const t = Dg();
|
|
18224
18228
|
return Ae(() => {
|
|
18225
18229
|
e?.(t);
|
|
18226
|
-
}, [t, e]), /* @__PURE__ */ a.jsx(
|
|
18230
|
+
}, [t, e]), /* @__PURE__ */ a.jsx(K_, {});
|
|
18227
18231
|
}
|
|
18228
|
-
function
|
|
18232
|
+
function Z_({
|
|
18229
18233
|
uri: e,
|
|
18230
18234
|
fetcher: t,
|
|
18231
18235
|
uiPath: n,
|
|
@@ -18239,11 +18243,11 @@ function Q_({
|
|
|
18239
18243
|
}
|
|
18240
18244
|
}
|
|
18241
18245
|
}), []);
|
|
18242
|
-
return o ? /* @__PURE__ */ a.jsx(Nm, { client: s, children: /* @__PURE__ */ a.jsx(Yg, { value: o, children: /* @__PURE__ */ a.jsx(zg, { path: n || "/", children: /* @__PURE__ */ a.jsx(Zg, { children: /* @__PURE__ */ a.jsx(
|
|
18246
|
+
return o ? /* @__PURE__ */ a.jsx(Nm, { client: s, children: /* @__PURE__ */ a.jsx(Yg, { value: o, children: /* @__PURE__ */ a.jsx(zg, { path: n || "/", children: /* @__PURE__ */ a.jsx(Zg, { children: /* @__PURE__ */ a.jsx(U_, { onLocate: r }) }) }) }) }) : /* @__PURE__ */ a.jsx("section", { children: "CONFIG MISSING..." });
|
|
18243
18247
|
}
|
|
18244
18248
|
export {
|
|
18245
|
-
|
|
18249
|
+
Z_ as Editor,
|
|
18246
18250
|
Ug as HttpGraphQLFetcher,
|
|
18247
|
-
|
|
18251
|
+
Z_ as default,
|
|
18248
18252
|
Gf as useTableMutation
|
|
18249
18253
|
};
|