@declarion/react 0.40.0 → 0.40.2
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-lib/{DraggableChildrenTable-Ctmn0liO.js → DraggableChildrenTable-BkqtkJuz.js} +29 -29
- package/dist-lib/{Grid-BsIkTp3u.js → Grid-CTxov4x2.js} +2 -2
- package/dist-lib/{LayoutRenderer-D4oTfZhV.js → LayoutRenderer-Cbh-pY26.js} +307 -307
- package/dist-lib/{MarkdownRenderer-B-2CrtjU.js → MarkdownRenderer-DeguFsZL.js} +1 -1
- package/dist-lib/{RefreshControl-VQf34HKZ.js → RefreshControl-DG2kMABB.js} +165 -165
- package/dist-lib/{SmartDetailPage.impl-HMaLVDlV.js → SmartDetailPage.impl-DCJ_V-Nh.js} +458 -458
- package/dist-lib/{SmartRecordListPage.impl-Cxm7qvlZ.js → SmartRecordListPage.impl-sYCMQw8V.js} +183 -183
- package/dist-lib/components/primitives/Fields.d.ts +7 -0
- package/dist-lib/components/primitives/index.d.ts +2 -2
- package/dist-lib/index.js +1927 -1894
- package/dist-lib/lib/filters.d.ts +5 -0
- package/dist-lib/{registry-DFtAh6zc.js → registry-DbZX1hy8.js} +410 -410
- package/dist-lib/testing.js +25 -25
- package/dist-lib/{useCurrentScreen-mw8TfE8q.js → useCurrentScreen-C33VZcNn.js} +1118 -967
- package/dist-lib/{useProperties-gMdnhdhO.js → useProperties-BgAEk8X9.js} +27 -27
- package/dist-lib/{value-t9ETvWIJ.js → value-VOi8Svry.js} +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { s as e, t } from "./DynamicIcon-DeRpAaXm.js";
|
|
2
|
-
import { A as n, At as r, B as i, C as a, Ct as o, Dn as s, E as c, Et as l, Fn as u, I as d, In as f,
|
|
3
|
-
import { a as _e, c as ve, d as ye, f as be, i as xe, l as Se, n as Ce, o as we, p as Te, r as Ee, s as De, t as Oe, u as ke } from "./value-
|
|
2
|
+
import { A as n, At as r, B as i, C as a, Ct as o, Dn as s, E as c, Et as l, Fn as u, I as d, In as f, K as p, Kt as m, L as h, Nn as g, O as _, P as v, R as y, Sn as b, T as x, Tn as S, Tt as C, U as w, V as T, W as E, Wn as D, X as O, Xn as k, Yn as A, _ as j, _t as M, b as N, bn as P, bt as F, cr as I, ct as L, d as R, g as ee, hn as te, i as ne, ir as z, it as B, j as V, jn as re, jt as H, mt as ie, or as ae, qn as oe, sr as U, st as se, tr as ce, u as le, v as ue, vt as de, wn as fe, xn as pe, xt as me, yt as he, z as ge } from "./useCurrentScreen-C33VZcNn.js";
|
|
3
|
+
import { a as _e, c as ve, d as ye, f as be, i as xe, l as Se, n as Ce, o as we, p as Te, r as Ee, s as De, t as Oe, u as ke } from "./value-VOi8Svry.js";
|
|
4
4
|
import { n as Ae, r as je, t as Me } from "./dataTableStyles-vwD1mVOP.js";
|
|
5
5
|
import { Component as Ne, Suspense as Pe, lazy as Fe, useCallback as W, useEffect as G, useId as Ie, useLayoutEffect as Le, useMemo as K, useRef as q, useState as J } from "react";
|
|
6
6
|
import { parsePath as Re, useNavigate as ze } from "react-router-dom";
|
|
@@ -119,14 +119,14 @@ function Je({ title: t, subtitle: n, right: r, badge: i, count: a, children: o,
|
|
|
119
119
|
]
|
|
120
120
|
})
|
|
121
121
|
}),
|
|
122
|
-
i && /* @__PURE__ */ X(
|
|
122
|
+
i && /* @__PURE__ */ X(ae, {
|
|
123
123
|
tone: i.tone ?? "violet",
|
|
124
124
|
size: "xs",
|
|
125
125
|
dot: i.dot,
|
|
126
126
|
children: i.text
|
|
127
127
|
}),
|
|
128
128
|
r,
|
|
129
|
-
c && /* @__PURE__ */ X(
|
|
129
|
+
c && /* @__PURE__ */ X(U, {
|
|
130
130
|
size: 24,
|
|
131
131
|
icon: X(m ? e.up : e.down, { size: 14 }),
|
|
132
132
|
onClick: () => h((e) => !e),
|
|
@@ -579,7 +579,7 @@ function zt(e) {
|
|
|
579
579
|
if (!(!e || e === "?")) return e.startsWith("?") ? e : `?${e}`;
|
|
580
580
|
}
|
|
581
581
|
function Bt() {
|
|
582
|
-
let e = ze(), { data: t } =
|
|
582
|
+
let e = ze(), { data: t } = H(), n = ie(), r = L();
|
|
583
583
|
return W((i, a) => {
|
|
584
584
|
let { pathname: o, search: s, hash: c } = Rt(i, a?.search);
|
|
585
585
|
if (n.enabled) {
|
|
@@ -614,12 +614,12 @@ function Bt() {
|
|
|
614
614
|
}, { replace: a?.replace });
|
|
615
615
|
return;
|
|
616
616
|
}
|
|
617
|
-
let m = a?.title ? void 0 :
|
|
617
|
+
let m = a?.title ? void 0 : g(o, t?.screens, t?.entities), h = a?.title ?? m?.title ?? o, _ = a?.icon ?? m?.icon;
|
|
618
618
|
l.openTab({
|
|
619
619
|
pathname: o,
|
|
620
620
|
search: d,
|
|
621
621
|
title: h,
|
|
622
|
-
icon:
|
|
622
|
+
icon: _,
|
|
623
623
|
closable: !0,
|
|
624
624
|
returnTo: u ? null : f
|
|
625
625
|
}), e({
|
|
@@ -669,7 +669,7 @@ function Xt(e) {
|
|
|
669
669
|
return t.length === 0 ? "?" : t.length === 1 ? t[0].slice(0, 2).toUpperCase() : (t[0][0] + t[1][0]).toUpperCase();
|
|
670
670
|
}
|
|
671
671
|
function Zt(e) {
|
|
672
|
-
let { field: t, fieldName: n, value: r, onChange: a, mode: o, alt: s, disabled: c, visual: l, uploadFieldCode: u, uploadSlotCode: f } = e, p = Ce(r), [m,
|
|
672
|
+
let { field: t, fieldName: n, value: r, onChange: a, mode: o, alt: s, disabled: c, visual: l, uploadFieldCode: u, uploadSlotCode: f } = e, p = Ce(r), [m, g] = J("idle"), [_, y] = J(null), [b, x] = J(null), [S, C] = J(null), [w, T] = J(!1), E = q(null), D = q(!1), O = q(null), { register: k, unregister: A, isDraft: j } = v();
|
|
673
673
|
G(() => () => {
|
|
674
674
|
E.current && E.current.abort();
|
|
675
675
|
}, []);
|
|
@@ -681,7 +681,7 @@ function Zt(e) {
|
|
|
681
681
|
]), N = (t.accepts ?? ["image/*"]).join(","), P = W(async (r) => {
|
|
682
682
|
let o = i(r, t.accepts, t.max_size_bytes);
|
|
683
683
|
if (o) {
|
|
684
|
-
x(o),
|
|
684
|
+
x(o), g("error");
|
|
685
685
|
return;
|
|
686
686
|
}
|
|
687
687
|
let s = r;
|
|
@@ -695,10 +695,10 @@ function Zt(e) {
|
|
|
695
695
|
x({
|
|
696
696
|
code: "CROP_FAILED",
|
|
697
697
|
message: e instanceof Error ? e.message : "Crop failed"
|
|
698
|
-
}),
|
|
698
|
+
}), g("error");
|
|
699
699
|
return;
|
|
700
700
|
}
|
|
701
|
-
x(null), D.current = !1,
|
|
701
|
+
x(null), D.current = !1, g("uploading"), y({
|
|
702
702
|
loaded: 0,
|
|
703
703
|
total: s.size,
|
|
704
704
|
pct: 0
|
|
@@ -712,13 +712,13 @@ function Zt(e) {
|
|
|
712
712
|
fieldCode: u ?? n,
|
|
713
713
|
slotCode: f,
|
|
714
714
|
signal: c.signal,
|
|
715
|
-
onProgress:
|
|
715
|
+
onProgress: y
|
|
716
716
|
});
|
|
717
717
|
if (D.current) {
|
|
718
|
-
|
|
718
|
+
h(r.id).catch(() => {}), A(r.id);
|
|
719
719
|
return;
|
|
720
720
|
}
|
|
721
|
-
p && j(p.id) && (
|
|
721
|
+
p && j(p.id) && (h(p.id).catch(() => {}), A(p.id)), k(r.id, () => h(r.id)), C(r.id), g("idle"), y(null);
|
|
722
722
|
let i = {
|
|
723
723
|
id: r.id,
|
|
724
724
|
filename: r.filename,
|
|
@@ -740,7 +740,7 @@ function Zt(e) {
|
|
|
740
740
|
code: "UNKNOWN",
|
|
741
741
|
message: e instanceof Error ? e.message : "Upload failed"
|
|
742
742
|
};
|
|
743
|
-
x(t),
|
|
743
|
+
x(t), g("error"), y(null);
|
|
744
744
|
}
|
|
745
745
|
}, [
|
|
746
746
|
t.accepts,
|
|
@@ -758,28 +758,28 @@ function Zt(e) {
|
|
|
758
758
|
u,
|
|
759
759
|
f
|
|
760
760
|
]), F = W(() => {
|
|
761
|
-
m === "uploading" && E.current && (D.current = !0, E.current.abort(), E.current = null,
|
|
761
|
+
m === "uploading" && E.current && (D.current = !0, E.current.abort(), E.current = null, g("idle"), y(null)), S && (h(S).catch(() => {}), A(S), C(null));
|
|
762
762
|
}, [
|
|
763
763
|
m,
|
|
764
764
|
S,
|
|
765
765
|
A
|
|
766
766
|
]), I = W(() => {
|
|
767
|
-
p && j(p.id) && (
|
|
767
|
+
p && j(p.id) && (h(p.id).catch(() => {}), A(p.id), C(null)), a?.(t.mode === "array" ? [] : null);
|
|
768
768
|
}, [
|
|
769
769
|
p,
|
|
770
770
|
t.mode,
|
|
771
771
|
j,
|
|
772
772
|
a,
|
|
773
773
|
A
|
|
774
|
-
]),
|
|
775
|
-
x(null),
|
|
776
|
-
}, []),
|
|
774
|
+
]), L = W(() => {
|
|
775
|
+
x(null), g("idle"), O.current?.click();
|
|
776
|
+
}, []), R = W(() => {
|
|
777
777
|
c || O.current?.click();
|
|
778
|
-
}, [c]),
|
|
779
|
-
c || (e.key === "Enter" || e.key === " ") && (e.preventDefault(),
|
|
780
|
-
}, [c,
|
|
778
|
+
}, [c]), ee = W((e) => {
|
|
779
|
+
c || (e.key === "Enter" || e.key === " ") && (e.preventDefault(), R());
|
|
780
|
+
}, [c, R]), te = W((e) => {
|
|
781
781
|
c || (e.preventDefault(), e.dataTransfer.dropEffect = "copy");
|
|
782
|
-
}, [c]),
|
|
782
|
+
}, [c]), ne = W((e) => {
|
|
783
783
|
if (c) return;
|
|
784
784
|
e.preventDefault();
|
|
785
785
|
let t = e.dataTransfer.files?.[0];
|
|
@@ -787,10 +787,10 @@ function Zt(e) {
|
|
|
787
787
|
}, [c, P]), z = W((e) => {
|
|
788
788
|
let t = e.target.files?.[0];
|
|
789
789
|
e.target.value = "", t && P(t);
|
|
790
|
-
}, [P]),
|
|
791
|
-
aspectRatio:
|
|
790
|
+
}, [P]), B = l.aspectRatio ?? en(l.shape, t.display?.aspect_ratio), V = ye(p), re = {
|
|
791
|
+
aspectRatio: B,
|
|
792
792
|
width: l.width ?? (l.shape === "wide" ? "100%" : "120px")
|
|
793
|
-
},
|
|
793
|
+
}, H = !!p, ie = Yt(p, t.display?.listable_thumbnail), ae = Se(p, t.display?.listable_thumbnail), oe = xe(p?.id, ae, ie), U = o === "display", se = W((e) => {
|
|
794
794
|
e.stopPropagation(), T((e) => !e);
|
|
795
795
|
}, []), ce = W((e) => {
|
|
796
796
|
if (!p || !w) return;
|
|
@@ -805,15 +805,15 @@ function Zt(e) {
|
|
|
805
805
|
w,
|
|
806
806
|
a
|
|
807
807
|
]);
|
|
808
|
-
return
|
|
808
|
+
return U ? /* @__PURE__ */ X("div", {
|
|
809
809
|
className: Qt(l.shape, !1),
|
|
810
|
-
style:
|
|
810
|
+
style: re,
|
|
811
811
|
"aria-label": M,
|
|
812
|
-
children:
|
|
813
|
-
src:
|
|
812
|
+
children: H && oe ? /* @__PURE__ */ X("img", {
|
|
813
|
+
src: oe,
|
|
814
814
|
alt: M,
|
|
815
815
|
className: $t(l.shape),
|
|
816
|
-
style: { objectPosition: De(
|
|
816
|
+
style: { objectPosition: De(V) },
|
|
817
817
|
loading: "lazy"
|
|
818
818
|
}) : /* @__PURE__ */ X(nn, {
|
|
819
819
|
shape: l.shape,
|
|
@@ -822,18 +822,18 @@ function Zt(e) {
|
|
|
822
822
|
})
|
|
823
823
|
}) : /* @__PURE__ */ Z("div", {
|
|
824
824
|
className: Qt(l.shape, !c),
|
|
825
|
-
style:
|
|
825
|
+
style: re,
|
|
826
826
|
tabIndex: c ? -1 : 0,
|
|
827
827
|
role: "button",
|
|
828
828
|
"aria-label": M,
|
|
829
829
|
"aria-disabled": c || void 0,
|
|
830
830
|
"aria-busy": m === "uploading" || void 0,
|
|
831
831
|
"aria-invalid": m === "error" || void 0,
|
|
832
|
-
onClick: m === "idle" && !
|
|
832
|
+
onClick: m === "idle" && !H ? R : void 0,
|
|
833
833
|
onMouseDown: w ? ce : void 0,
|
|
834
|
-
onKeyDown:
|
|
835
|
-
onDragOver:
|
|
836
|
-
onDrop:
|
|
834
|
+
onKeyDown: ee,
|
|
835
|
+
onDragOver: te,
|
|
836
|
+
onDrop: ne,
|
|
837
837
|
"data-testid": w ? "focal-point-target" : `file-widget-${n}`,
|
|
838
838
|
children: [
|
|
839
839
|
/* @__PURE__ */ X("input", {
|
|
@@ -844,30 +844,30 @@ function Zt(e) {
|
|
|
844
844
|
style: { display: "none" },
|
|
845
845
|
"data-testid": `file-input-${n}`
|
|
846
846
|
}),
|
|
847
|
-
|
|
848
|
-
src:
|
|
847
|
+
H && oe ? /* @__PURE__ */ X("img", {
|
|
848
|
+
src: oe,
|
|
849
849
|
alt: M,
|
|
850
850
|
className: $t(l.shape),
|
|
851
|
-
style: { objectPosition: De(
|
|
851
|
+
style: { objectPosition: De(V) },
|
|
852
852
|
loading: "lazy"
|
|
853
853
|
}) : m === "uploading" ? null : /* @__PURE__ */ X(nn, {
|
|
854
854
|
shape: l.shape,
|
|
855
855
|
label: M,
|
|
856
856
|
placeholder: t.display?.placeholder
|
|
857
857
|
}),
|
|
858
|
-
m === "uploading" && /* @__PURE__ */ X(rn, { pct:
|
|
858
|
+
m === "uploading" && /* @__PURE__ */ X(rn, { pct: _?.pct ?? 0 }),
|
|
859
859
|
S && /* @__PURE__ */ X("span", {
|
|
860
860
|
className: "absolute right-1 top-1 h-2 w-2 rounded-full bg-warning",
|
|
861
861
|
"aria-hidden": "true",
|
|
862
862
|
"data-testid": "draft-indicator"
|
|
863
863
|
}),
|
|
864
|
-
|
|
864
|
+
H && m === "idle" && !c && /* @__PURE__ */ Z("div", {
|
|
865
865
|
className: "absolute inset-0 flex items-center justify-center gap-2 bg-black/40 opacity-0 transition-opacity hover:opacity-100 focus-within:opacity-100",
|
|
866
866
|
children: [
|
|
867
867
|
t.display?.focal_point && /* @__PURE__ */ X("button", {
|
|
868
868
|
type: "button",
|
|
869
869
|
className: "rounded-sm border border-border bg-card px-2 py-1 text-xs text-foreground hover:bg-surface-2",
|
|
870
|
-
onClick:
|
|
870
|
+
onClick: se,
|
|
871
871
|
"data-testid": "focal-point-toggle",
|
|
872
872
|
children: w ? "Cancel focus" : "Set focus"
|
|
873
873
|
}),
|
|
@@ -875,7 +875,7 @@ function Zt(e) {
|
|
|
875
875
|
type: "button",
|
|
876
876
|
className: "rounded-sm border border-border bg-card px-2 py-1 text-xs text-foreground hover:bg-surface-2",
|
|
877
877
|
onClick: (e) => {
|
|
878
|
-
e.stopPropagation(),
|
|
878
|
+
e.stopPropagation(), R();
|
|
879
879
|
},
|
|
880
880
|
children: "Change"
|
|
881
881
|
}),
|
|
@@ -889,11 +889,11 @@ function Zt(e) {
|
|
|
889
889
|
})
|
|
890
890
|
]
|
|
891
891
|
}),
|
|
892
|
-
|
|
892
|
+
V && H && /* @__PURE__ */ X("span", {
|
|
893
893
|
className: "absolute h-3 w-3 -translate-x-1/2 -translate-y-1/2 rounded-full border border-white bg-black/70",
|
|
894
894
|
style: {
|
|
895
|
-
left: `${
|
|
896
|
-
top: `${
|
|
895
|
+
left: `${V.x * 100}%`,
|
|
896
|
+
top: `${V.y * 100}%`
|
|
897
897
|
},
|
|
898
898
|
"data-testid": "focal-point-marker"
|
|
899
899
|
}),
|
|
@@ -906,18 +906,18 @@ function Zt(e) {
|
|
|
906
906
|
"data-testid": "cancel-upload",
|
|
907
907
|
children: "Cancel"
|
|
908
908
|
}),
|
|
909
|
-
m === "error" &&
|
|
909
|
+
m === "error" && b && /* @__PURE__ */ Z("div", {
|
|
910
910
|
className: "absolute inset-x-0 bottom-0 flex items-center justify-between gap-2 bg-destructive-soft px-2 py-1 text-xs text-destructive",
|
|
911
911
|
role: "alert",
|
|
912
912
|
children: [/* @__PURE__ */ X("span", {
|
|
913
913
|
className: "truncate",
|
|
914
|
-
title:
|
|
915
|
-
children:
|
|
914
|
+
title: b.message,
|
|
915
|
+
children: b.message
|
|
916
916
|
}), /* @__PURE__ */ X("button", {
|
|
917
917
|
type: "button",
|
|
918
918
|
className: "underline",
|
|
919
919
|
onClick: (e) => {
|
|
920
|
-
e.stopPropagation(),
|
|
920
|
+
e.stopPropagation(), L();
|
|
921
921
|
},
|
|
922
922
|
"data-testid": "retry-upload",
|
|
923
923
|
children: "Retry"
|
|
@@ -1029,7 +1029,7 @@ function sn(e) {
|
|
|
1029
1029
|
}
|
|
1030
1030
|
//#endregion
|
|
1031
1031
|
//#region src/components/file-widgets/GridLazy.tsx
|
|
1032
|
-
var cn = Fe(() => import("./Grid-
|
|
1032
|
+
var cn = Fe(() => import("./Grid-CTxov4x2.js").then((e) => ({ default: e.Grid })));
|
|
1033
1033
|
function ln() {
|
|
1034
1034
|
return /* @__PURE__ */ X("div", { className: "h-24 w-full rounded-md bg-muted animate-pulse" });
|
|
1035
1035
|
}
|
|
@@ -1048,7 +1048,7 @@ function dn({ contentType: e }) {
|
|
|
1048
1048
|
});
|
|
1049
1049
|
}
|
|
1050
1050
|
function fn(e) {
|
|
1051
|
-
let { field: t, fieldName: n, value: r, onChange: a, mode: o, disabled: s, uploadFieldCode: c, uploadSlotCode: l } = e, u = Ce(r), [f, p] = J("idle"), [m,
|
|
1051
|
+
let { field: t, fieldName: n, value: r, onChange: a, mode: o, disabled: s, uploadFieldCode: c, uploadSlotCode: l } = e, u = Ce(r), [f, p] = J("idle"), [m, g] = J(null), [_, b] = J(null), [x, S] = J(!1), [C, w] = J(u?.filename ?? ""), T = q(null), E = q(!1), D = q(null), { register: O, unregister: k, isDraft: A } = v(), { open: j } = Ee();
|
|
1052
1052
|
G(() => () => {
|
|
1053
1053
|
T.current && T.current.abort();
|
|
1054
1054
|
}, []), G(() => {
|
|
@@ -1057,10 +1057,10 @@ function fn(e) {
|
|
|
1057
1057
|
let M = (t.accepts ?? []).join(","), N = W(async (r) => {
|
|
1058
1058
|
let o = i(r, t.accepts, t.max_size_bytes);
|
|
1059
1059
|
if (o) {
|
|
1060
|
-
|
|
1060
|
+
b(o), p("error");
|
|
1061
1061
|
return;
|
|
1062
1062
|
}
|
|
1063
|
-
|
|
1063
|
+
b(null), E.current = !1, p("uploading"), g({
|
|
1064
1064
|
loaded: 0,
|
|
1065
1065
|
total: r.size,
|
|
1066
1066
|
pct: 0
|
|
@@ -1074,13 +1074,13 @@ function fn(e) {
|
|
|
1074
1074
|
fieldCode: c ?? n,
|
|
1075
1075
|
slotCode: l,
|
|
1076
1076
|
signal: s.signal,
|
|
1077
|
-
onProgress:
|
|
1077
|
+
onProgress: g
|
|
1078
1078
|
});
|
|
1079
1079
|
if (E.current) {
|
|
1080
|
-
|
|
1080
|
+
h(i.id).catch(() => {}), k(i.id);
|
|
1081
1081
|
return;
|
|
1082
1082
|
}
|
|
1083
|
-
u && A(u.id) && (
|
|
1083
|
+
u && A(u.id) && (h(u.id).catch(() => {}), k(u.id)), O(i.id, () => h(i.id)), p("idle"), g(null);
|
|
1084
1084
|
let o = {
|
|
1085
1085
|
id: i.id,
|
|
1086
1086
|
filename: i.filename,
|
|
@@ -1102,7 +1102,7 @@ function fn(e) {
|
|
|
1102
1102
|
code: "UNKNOWN",
|
|
1103
1103
|
message: e instanceof Error ? e.message : "Upload failed"
|
|
1104
1104
|
};
|
|
1105
|
-
|
|
1105
|
+
b(t), p("error"), g(null);
|
|
1106
1106
|
}
|
|
1107
1107
|
}, [
|
|
1108
1108
|
t.accepts,
|
|
@@ -1123,20 +1123,20 @@ function fn(e) {
|
|
|
1123
1123
|
let t = e.target.files?.[0];
|
|
1124
1124
|
e.target.value = "", t && N(t);
|
|
1125
1125
|
}, [N]), I = W(() => {
|
|
1126
|
-
u && A(u.id) && (
|
|
1126
|
+
u && A(u.id) && (h(u.id).catch(() => {}), k(u.id)), a?.(t.mode === "array" ? [] : null);
|
|
1127
1127
|
}, [
|
|
1128
1128
|
u,
|
|
1129
1129
|
t.mode,
|
|
1130
1130
|
A,
|
|
1131
1131
|
a,
|
|
1132
1132
|
k
|
|
1133
|
-
]),
|
|
1134
|
-
f === "uploading" && T.current && (E.current = !0, T.current.abort(), T.current = null, p("idle"),
|
|
1135
|
-
}, [f]),
|
|
1133
|
+
]), L = W(() => {
|
|
1134
|
+
f === "uploading" && T.current && (E.current = !0, T.current.abort(), T.current = null, p("idle"), g(null));
|
|
1135
|
+
}, [f]), R = W(() => {
|
|
1136
1136
|
u && j(u.id, "download", we(u));
|
|
1137
|
-
}, [u, j]),
|
|
1137
|
+
}, [u, j]), ee = u ? _e(u) : !1, te = W(() => {
|
|
1138
1138
|
!u || !_e(u) || j(u.id, "preview", ke(u));
|
|
1139
|
-
}, [u, j]),
|
|
1139
|
+
}, [u, j]), ne = W(() => {
|
|
1140
1140
|
if (!u) {
|
|
1141
1141
|
S(!1);
|
|
1142
1142
|
return;
|
|
@@ -1184,10 +1184,10 @@ function fn(e) {
|
|
|
1184
1184
|
style: { display: "none" },
|
|
1185
1185
|
"data-testid": `file-input-${n}`
|
|
1186
1186
|
}),
|
|
1187
|
-
f === "error" &&
|
|
1187
|
+
f === "error" && _ && /* @__PURE__ */ X("div", {
|
|
1188
1188
|
className: "ml-auto text-xs text-destructive",
|
|
1189
1189
|
role: "alert",
|
|
1190
|
-
children:
|
|
1190
|
+
children: _.message
|
|
1191
1191
|
})
|
|
1192
1192
|
]
|
|
1193
1193
|
}) : /* @__PURE__ */ Z("div", {
|
|
@@ -1200,15 +1200,15 @@ function fn(e) {
|
|
|
1200
1200
|
/* @__PURE__ */ Z("div", {
|
|
1201
1201
|
className: "flex min-w-0 flex-1 flex-col gap-1",
|
|
1202
1202
|
children: [
|
|
1203
|
-
|
|
1203
|
+
x && u ? /* @__PURE__ */ X("input", {
|
|
1204
1204
|
type: "text",
|
|
1205
1205
|
className: "rounded-sm border border-border bg-card px-1 py-0.5 text-sm text-foreground",
|
|
1206
1206
|
value: C,
|
|
1207
1207
|
autoFocus: !0,
|
|
1208
1208
|
onChange: (e) => w(e.target.value),
|
|
1209
|
-
onBlur:
|
|
1209
|
+
onBlur: ne,
|
|
1210
1210
|
onKeyDown: (e) => {
|
|
1211
|
-
e.key === "Enter" ?
|
|
1211
|
+
e.key === "Enter" ? ne() : e.key === "Escape" && (S(!1), w(u.filename));
|
|
1212
1212
|
},
|
|
1213
1213
|
"data-testid": "filename-input"
|
|
1214
1214
|
}) : /* @__PURE__ */ X("button", {
|
|
@@ -1223,7 +1223,7 @@ function fn(e) {
|
|
|
1223
1223
|
/* @__PURE__ */ Z("div", {
|
|
1224
1224
|
className: "flex flex-wrap gap-2 text-xs text-muted-foreground",
|
|
1225
1225
|
children: [
|
|
1226
|
-
u && /* @__PURE__ */ X("span", { children:
|
|
1226
|
+
u && /* @__PURE__ */ X("span", { children: y(u.size_bytes) }),
|
|
1227
1227
|
u?.page_count != null && /* @__PURE__ */ Z("span", { children: [u.page_count, " pages"] }),
|
|
1228
1228
|
u?.uploaded_at && /* @__PURE__ */ X("span", { children: pn(u.uploaded_at) }),
|
|
1229
1229
|
u?.uploaded_by && /* @__PURE__ */ Z("span", { children: ["by ", u.uploaded_by] }),
|
|
@@ -1246,10 +1246,10 @@ function fn(e) {
|
|
|
1246
1246
|
"%"
|
|
1247
1247
|
]
|
|
1248
1248
|
}),
|
|
1249
|
-
f === "error" &&
|
|
1249
|
+
f === "error" && _ && /* @__PURE__ */ X("div", {
|
|
1250
1250
|
className: "text-xs text-destructive",
|
|
1251
1251
|
role: "alert",
|
|
1252
|
-
children:
|
|
1252
|
+
children: _.message
|
|
1253
1253
|
})
|
|
1254
1254
|
]
|
|
1255
1255
|
}),
|
|
@@ -1259,16 +1259,16 @@ function fn(e) {
|
|
|
1259
1259
|
/* @__PURE__ */ X("button", {
|
|
1260
1260
|
type: "button",
|
|
1261
1261
|
className: "rounded-sm border border-border bg-card px-2 py-1 text-xs text-foreground hover:bg-surface-2",
|
|
1262
|
-
onClick:
|
|
1262
|
+
onClick: R,
|
|
1263
1263
|
"data-testid": "download",
|
|
1264
1264
|
children: "Download"
|
|
1265
1265
|
}),
|
|
1266
1266
|
/* @__PURE__ */ X("button", {
|
|
1267
1267
|
type: "button",
|
|
1268
1268
|
className: "rounded-sm border border-border bg-card px-2 py-1 text-xs text-foreground hover:bg-surface-2 disabled:cursor-not-allowed disabled:opacity-50",
|
|
1269
|
-
onClick:
|
|
1270
|
-
disabled: !
|
|
1271
|
-
title:
|
|
1269
|
+
onClick: te,
|
|
1270
|
+
disabled: !ee,
|
|
1271
|
+
title: ee ? void 0 : "Preview is available only for images and PDFs",
|
|
1272
1272
|
"data-testid": "preview",
|
|
1273
1273
|
children: "Preview"
|
|
1274
1274
|
}),
|
|
@@ -1290,7 +1290,7 @@ function fn(e) {
|
|
|
1290
1290
|
] }), f === "uploading" && /* @__PURE__ */ X("button", {
|
|
1291
1291
|
type: "button",
|
|
1292
1292
|
className: "rounded-sm border border-border bg-card px-2 py-1 text-xs",
|
|
1293
|
-
onClick:
|
|
1293
|
+
onClick: L,
|
|
1294
1294
|
"data-testid": "cancel-upload",
|
|
1295
1295
|
children: "Cancel"
|
|
1296
1296
|
})]
|
|
@@ -1316,13 +1316,13 @@ function mn(e) {
|
|
|
1316
1316
|
return e ? (e.split("/")[1] ?? e).toUpperCase().slice(0, 6) : "";
|
|
1317
1317
|
}
|
|
1318
1318
|
function hn(e) {
|
|
1319
|
-
let { field: t, fieldName: n, value: r, onChange: a, mode: o, disabled: s } = e, c = Oe(r), [l, u] = J([]), { register: f, unregister: p, isDraft: m } =
|
|
1320
|
-
|
|
1321
|
-
let
|
|
1322
|
-
|
|
1319
|
+
let { field: t, fieldName: n, value: r, onChange: a, mode: o, disabled: s } = e, c = Oe(r), [l, u] = J([]), { register: f, unregister: p, isDraft: m } = v(), g = q(c);
|
|
1320
|
+
g.current = c;
|
|
1321
|
+
let _ = q(null), b = q(/* @__PURE__ */ new Set()), x = q([]);
|
|
1322
|
+
x.current = l;
|
|
1323
1323
|
let { open: S } = Ee();
|
|
1324
1324
|
G(() => () => {
|
|
1325
|
-
|
|
1325
|
+
x.current.forEach((e) => e.abort());
|
|
1326
1326
|
}, []);
|
|
1327
1327
|
let C = (t.accepts ?? []).join(","), w = o === "display", T = W(async (r) => {
|
|
1328
1328
|
let o = i(r, t.accepts, t.max_size_bytes), s = `row-${Math.random().toString(36).slice(2)}-${Date.now()}`, c = new AbortController();
|
|
@@ -1358,11 +1358,11 @@ function hn(e) {
|
|
|
1358
1358
|
progress: e
|
|
1359
1359
|
} : t))
|
|
1360
1360
|
});
|
|
1361
|
-
if (
|
|
1362
|
-
|
|
1361
|
+
if (b.current.delete(s)) {
|
|
1362
|
+
h(t.id).catch(() => {}), p(t.id);
|
|
1363
1363
|
return;
|
|
1364
1364
|
}
|
|
1365
|
-
f(t.id, () =>
|
|
1365
|
+
f(t.id, () => h(t.id));
|
|
1366
1366
|
let i = {
|
|
1367
1367
|
id: t.id,
|
|
1368
1368
|
filename: t.filename,
|
|
@@ -1373,8 +1373,8 @@ function hn(e) {
|
|
|
1373
1373
|
height: t.height,
|
|
1374
1374
|
url: t.url,
|
|
1375
1375
|
metadata: t.metadata
|
|
1376
|
-
}, o = [...
|
|
1377
|
-
|
|
1376
|
+
}, o = [...g.current, i];
|
|
1377
|
+
g.current = o, a?.(o), u((e) => e.filter((e) => e.localId !== s));
|
|
1378
1378
|
} catch (e) {
|
|
1379
1379
|
if (e instanceof d && e.code === "ABORTED") {
|
|
1380
1380
|
u((e) => e.filter((e) => e.localId !== s));
|
|
@@ -1405,12 +1405,12 @@ function hn(e) {
|
|
|
1405
1405
|
]), E = W((e) => {
|
|
1406
1406
|
Array.from(e).forEach((e) => void T(e));
|
|
1407
1407
|
}, [T]), D = W(() => {
|
|
1408
|
-
s ||
|
|
1408
|
+
s || _.current?.click();
|
|
1409
1409
|
}, [s]), O = W((e) => {
|
|
1410
1410
|
let t = e.target.files;
|
|
1411
1411
|
e.target.value = "", t && t.length > 0 && E(t);
|
|
1412
1412
|
}, [E]), k = W((e) => {
|
|
1413
|
-
m(e) && (
|
|
1413
|
+
m(e) && (h(e).catch(() => {}), p(e)), a?.(c.filter((t) => t.id !== e));
|
|
1414
1414
|
}, [
|
|
1415
1415
|
m,
|
|
1416
1416
|
c,
|
|
@@ -1446,7 +1446,7 @@ function hn(e) {
|
|
|
1446
1446
|
}),
|
|
1447
1447
|
/* @__PURE__ */ X("span", {
|
|
1448
1448
|
className: "flex-none text-xs text-muted-foreground",
|
|
1449
|
-
children:
|
|
1449
|
+
children: y(e.size_bytes)
|
|
1450
1450
|
}),
|
|
1451
1451
|
/* @__PURE__ */ X("button", {
|
|
1452
1452
|
type: "button",
|
|
@@ -1493,7 +1493,7 @@ function hn(e) {
|
|
|
1493
1493
|
type: "button",
|
|
1494
1494
|
className: "flex-none rounded-sm border border-border bg-card px-2 py-0.5 text-xs",
|
|
1495
1495
|
onClick: () => {
|
|
1496
|
-
e.abort(),
|
|
1496
|
+
e.abort(), b.current.add(e.localId), u((t) => t.filter((t) => t.localId !== e.localId));
|
|
1497
1497
|
},
|
|
1498
1498
|
children: e.error ? "Dismiss" : "Cancel"
|
|
1499
1499
|
})
|
|
@@ -1508,7 +1508,7 @@ function hn(e) {
|
|
|
1508
1508
|
"data-testid": "add-files",
|
|
1509
1509
|
children: "Add files"
|
|
1510
1510
|
}), /* @__PURE__ */ X("input", {
|
|
1511
|
-
ref:
|
|
1511
|
+
ref: _,
|
|
1512
1512
|
type: "file",
|
|
1513
1513
|
accept: C || void 0,
|
|
1514
1514
|
multiple: !0,
|
|
@@ -1623,17 +1623,17 @@ function wn(e, t) {
|
|
|
1623
1623
|
function Tn(e, t, n) {
|
|
1624
1624
|
if (Cn(e, n)) return wn(t, n);
|
|
1625
1625
|
let r = e.fields.get(n);
|
|
1626
|
-
return r?.type === "rich_text" && r.files?.mode === "rich_text_inline" ?
|
|
1626
|
+
return r?.type === "rich_text" && r.files?.mode === "rich_text_inline" ? T(t[n], wn(t, n)) : t[n];
|
|
1627
1627
|
}
|
|
1628
1628
|
function En(e, t, n) {
|
|
1629
1629
|
let r = e.fields.get(t);
|
|
1630
|
-
return r?.type === "rich_text" && r.files?.mode === "rich_text_inline" ?
|
|
1630
|
+
return r?.type === "rich_text" && r.files?.mode === "rich_text_inline" ? E(n) : n;
|
|
1631
1631
|
}
|
|
1632
1632
|
function Dn(e, t, n) {
|
|
1633
1633
|
let r = Cn(e, t);
|
|
1634
1634
|
if (r) return r.name || t;
|
|
1635
1635
|
let i = e.fields.get(t);
|
|
1636
|
-
return i ?
|
|
1636
|
+
return i ? b(i, t, n) : t;
|
|
1637
1637
|
}
|
|
1638
1638
|
function On(e) {
|
|
1639
1639
|
let { entity: t, entityCode: n, fieldName: r, record: i, mode: a, onChange: o, refs: s, disabled: c, surface: l, entities: u, screens: d, locale: f, fieldId: p, labelId: m } = e, h = Cn(t, r);
|
|
@@ -1749,7 +1749,7 @@ function Ln(e) {
|
|
|
1749
1749
|
}
|
|
1750
1750
|
function Rn(e, t) {
|
|
1751
1751
|
if (e.mode !== "rich_text_inline") return { clear: !0 };
|
|
1752
|
-
let n = E(
|
|
1752
|
+
let n = w(E(t));
|
|
1753
1753
|
return n.length === 0 ? { clear: !0 } : { set: n.map((e, t) => ({
|
|
1754
1754
|
file_id: e,
|
|
1755
1755
|
position: t
|
|
@@ -1951,7 +1951,7 @@ function nr(e, t, n, r, i, a) {
|
|
|
1951
1951
|
op: "eq",
|
|
1952
1952
|
value: c[t]
|
|
1953
1953
|
}));
|
|
1954
|
-
return e.set("filters", JSON.stringify(t)), e.set("preview", "true"), i && e.set("sort", i), a && e.set("limit", String(a)),
|
|
1954
|
+
return e.set("filters", JSON.stringify(t)), e.set("preview", "true"), i && e.set("sort", i), a && e.set("limit", String(a)), m(`/api/data/${n}?${e.toString()}`);
|
|
1955
1955
|
},
|
|
1956
1956
|
enabled: !!e && !!t && !!n && !!r && c !== null
|
|
1957
1957
|
});
|
|
@@ -1994,7 +1994,7 @@ function ar(e, t, n, r, i, a, o, s) {
|
|
|
1994
1994
|
op: "eq",
|
|
1995
1995
|
value: t
|
|
1996
1996
|
});
|
|
1997
|
-
return c.set("filters", JSON.stringify(l)), i && c.set("sort", i), a && c.set("limit", String(a)), o && c.set("search", o), e && c.set("after", e),
|
|
1997
|
+
return c.set("filters", JSON.stringify(l)), i && c.set("sort", i), a && c.set("limit", String(a)), o && c.set("search", o), e && c.set("after", e), m(`/api/data/${n}?${c.toString()}`);
|
|
1998
1998
|
},
|
|
1999
1999
|
getNextPageParam: (e) => e.meta?.has_more ? e.meta.cursor : void 0,
|
|
2000
2000
|
initialPageParam: void 0,
|
|
@@ -2004,16 +2004,16 @@ function ar(e, t, n, r, i, a, o, s) {
|
|
|
2004
2004
|
//#endregion
|
|
2005
2005
|
//#region src/components/shared/ActionButton.tsx
|
|
2006
2006
|
function or({ actionCode: n, action: r, entityCode: i, objectIds: o = [], row: s, variant: c = "outline", size: l = "default", onSuccess: u }) {
|
|
2007
|
-
let [d, f] = J(!1), [p, m] = J(!1), { data: h } =
|
|
2007
|
+
let [d, f] = J(!1), [p, m] = J(!1), { data: h } = H(), g = Bt(), { run: v } = ne(), y = x(r), b = !s || N(r.conditions, s), w = W(async () => {
|
|
2008
2008
|
if (!(!r.association || o.length === 0)) {
|
|
2009
2009
|
f(!0);
|
|
2010
2010
|
try {
|
|
2011
|
-
let e = await
|
|
2011
|
+
let e = await C(i ? `${i}.${r.association}` : r.association, o), t = a(h, e.target_entity);
|
|
2012
2012
|
if (!t) {
|
|
2013
2013
|
B.error(`No list screen found for ${e.target_entity}`);
|
|
2014
2014
|
return;
|
|
2015
2015
|
}
|
|
2016
|
-
let n = h?.entities[e.target_entity], s =
|
|
2016
|
+
let n = h?.entities[e.target_entity], s = S(r.display?.name) || e.target_entity;
|
|
2017
2017
|
if (e.ids.length === 0) {
|
|
2018
2018
|
B.info(`No related ${s} found`);
|
|
2019
2019
|
return;
|
|
@@ -2037,37 +2037,37 @@ function or({ actionCode: n, action: r, entityCode: i, objectIds: o = [], row: s
|
|
|
2037
2037
|
h,
|
|
2038
2038
|
g,
|
|
2039
2039
|
u
|
|
2040
|
-
]),
|
|
2041
|
-
m(!0),
|
|
2040
|
+
]), T = r.entity ? `${r.entity}.${n}` : n, E = o.length > 0 ? o : void 0, D = W(() => {
|
|
2041
|
+
m(!0), v({
|
|
2042
2042
|
action: r,
|
|
2043
|
-
title:
|
|
2043
|
+
title: S(r.display?.name) || n,
|
|
2044
2044
|
row: s,
|
|
2045
2045
|
entity: i,
|
|
2046
|
-
execute: (e) => me(
|
|
2046
|
+
execute: (e) => me(T, M(e, E)),
|
|
2047
2047
|
onSuccess: () => u?.()
|
|
2048
2048
|
}).finally(() => m(!1));
|
|
2049
2049
|
}, [
|
|
2050
|
-
|
|
2050
|
+
v,
|
|
2051
2051
|
r,
|
|
2052
2052
|
n,
|
|
2053
2053
|
s,
|
|
2054
2054
|
i,
|
|
2055
|
-
|
|
2055
|
+
T,
|
|
2056
2056
|
E,
|
|
2057
2057
|
u
|
|
2058
2058
|
]), O = W(() => {
|
|
2059
|
-
if (
|
|
2059
|
+
if (R(r)) {
|
|
2060
2060
|
le(r.ui_steps, { row: s }).then(() => u?.());
|
|
2061
2061
|
return;
|
|
2062
2062
|
}
|
|
2063
|
-
if (
|
|
2064
|
-
|
|
2063
|
+
if (y) {
|
|
2064
|
+
w();
|
|
2065
2065
|
return;
|
|
2066
2066
|
}
|
|
2067
2067
|
if (r.href && !r.handler && !r.association) {
|
|
2068
|
-
let e =
|
|
2068
|
+
let e = _(s, i ? h?.entities[i] : void 0), t = r.href;
|
|
2069
2069
|
i && (t = t.replaceAll("${entity}", i)), e && (t = t.replaceAll("${id}", encodeURIComponent(e))), g(t, {
|
|
2070
|
-
title:
|
|
2070
|
+
title: S(r.display?.name) || n,
|
|
2071
2071
|
icon: r.display?.icon
|
|
2072
2072
|
}), u?.();
|
|
2073
2073
|
return;
|
|
@@ -2080,25 +2080,25 @@ function or({ actionCode: n, action: r, entityCode: i, objectIds: o = [], row: s
|
|
|
2080
2080
|
h?.entities,
|
|
2081
2081
|
n,
|
|
2082
2082
|
g,
|
|
2083
|
-
|
|
2084
|
-
|
|
2083
|
+
y,
|
|
2084
|
+
w,
|
|
2085
2085
|
D,
|
|
2086
2086
|
u
|
|
2087
|
-
]), k =
|
|
2087
|
+
]), k = S(r.display?.name), A = r.display?.icon, j = A && e[A], P = j ? /* @__PURE__ */ X(j, { size: 13 }) : A ? /* @__PURE__ */ X(t, {
|
|
2088
2088
|
name: A,
|
|
2089
2089
|
size: 13
|
|
2090
|
-
}) : null,
|
|
2091
|
-
return l === "icon" ? /* @__PURE__ */ X(
|
|
2092
|
-
icon:
|
|
2090
|
+
}) : null, F = !b || p || d;
|
|
2091
|
+
return l === "icon" ? /* @__PURE__ */ X(U, {
|
|
2092
|
+
icon: P ?? /* @__PURE__ */ X(e.bolt, { size: 13 }),
|
|
2093
2093
|
onClick: O,
|
|
2094
2094
|
title: k
|
|
2095
|
-
}) : /* @__PURE__ */ X(
|
|
2095
|
+
}) : /* @__PURE__ */ X(I, {
|
|
2096
2096
|
kind: c === "default" ? "primary" : c === "ghost" ? "ghost" : "default",
|
|
2097
2097
|
size: "sm",
|
|
2098
|
-
icon:
|
|
2098
|
+
icon: P,
|
|
2099
2099
|
danger: r.destructive,
|
|
2100
2100
|
onClick: O,
|
|
2101
|
-
disabled:
|
|
2101
|
+
disabled: F,
|
|
2102
2102
|
title: k,
|
|
2103
2103
|
"aria-label": k,
|
|
2104
2104
|
children: k
|
|
@@ -2113,7 +2113,7 @@ function cr(e) {
|
|
|
2113
2113
|
return e.widget ? "widget" : e.href ? "href" : e.handler ? "handler" : e.association ? "association" : e.ui_steps && e.ui_steps.length > 0 ? "ui_steps" : "unknown";
|
|
2114
2114
|
}
|
|
2115
2115
|
function lr(e, t, n, r, i) {
|
|
2116
|
-
let a = cr(t), o =
|
|
2116
|
+
let a = cr(t), o = _(n, r?.entity), s = r?.entityCode ?? "";
|
|
2117
2117
|
if (e === "__peek") return i?.({
|
|
2118
2118
|
code: e,
|
|
2119
2119
|
entity: s,
|
|
@@ -2181,7 +2181,7 @@ function pr(e, t, n) {
|
|
|
2181
2181
|
if (n && e in n) return n[e];
|
|
2182
2182
|
}
|
|
2183
2183
|
function mr(e, t, n) {
|
|
2184
|
-
return
|
|
2184
|
+
return S(pr(e, t, n)?.display?.name) || e;
|
|
2185
2185
|
}
|
|
2186
2186
|
function hr(e, t, n) {
|
|
2187
2187
|
return pr(e, t, n)?.display?.icon || void 0;
|
|
@@ -2190,8 +2190,8 @@ function gr(e) {
|
|
|
2190
2190
|
return `action-tooltip-${e}`;
|
|
2191
2191
|
}
|
|
2192
2192
|
function _r({ leaf: e, entityActions: n, globalActions: r, onRun: i, loading: a, onLoadingChange: o, measureRef: s, style: c, row: l, widgetContext: u, onActionClick: d }) {
|
|
2193
|
-
let f = pr(e.code, n, r),
|
|
2194
|
-
if (!(!f ||
|
|
2193
|
+
let f = pr(e.code, n, r), p = mr(e.code, n, r), m = hr(e.code, n, r), h = f?.destructive ?? !1, g = !h && f?.display?.primary === !0, _ = !e.enabled, v = _ ? gr(e.code) : void 0, y = W(async () => {
|
|
2194
|
+
if (!(!f || _ || a)) {
|
|
2195
2195
|
o(!0);
|
|
2196
2196
|
try {
|
|
2197
2197
|
lr(e.code, f, l, u, d) || await Promise.resolve(i(e.code, f));
|
|
@@ -2201,7 +2201,7 @@ function _r({ leaf: e, entityActions: n, globalActions: r, onRun: i, loading: a,
|
|
|
2201
2201
|
}
|
|
2202
2202
|
}, [
|
|
2203
2203
|
f,
|
|
2204
|
-
|
|
2204
|
+
_,
|
|
2205
2205
|
a,
|
|
2206
2206
|
i,
|
|
2207
2207
|
e.code,
|
|
@@ -2209,12 +2209,12 @@ function _r({ leaf: e, entityActions: n, globalActions: r, onRun: i, loading: a,
|
|
|
2209
2209
|
l,
|
|
2210
2210
|
u,
|
|
2211
2211
|
d
|
|
2212
|
-
]),
|
|
2213
|
-
name:
|
|
2212
|
+
]), b = a ? /* @__PURE__ */ X(A, { size: 12 }) : m ? /* @__PURE__ */ X(t, {
|
|
2213
|
+
name: m,
|
|
2214
2214
|
size: 12
|
|
2215
2215
|
}) : null;
|
|
2216
|
-
return /* @__PURE__ */ Z(Y, { children: [
|
|
2217
|
-
id:
|
|
2216
|
+
return /* @__PURE__ */ Z(Y, { children: [v && e.reason && /* @__PURE__ */ X("span", {
|
|
2217
|
+
id: v,
|
|
2218
2218
|
role: "tooltip",
|
|
2219
2219
|
style: {
|
|
2220
2220
|
position: "absolute",
|
|
@@ -2224,52 +2224,52 @@ function _r({ leaf: e, entityActions: n, globalActions: r, onRun: i, loading: a,
|
|
|
2224
2224
|
clip: "rect(0,0,0,0)"
|
|
2225
2225
|
},
|
|
2226
2226
|
children: e.reason
|
|
2227
|
-
}), /* @__PURE__ */ X(
|
|
2227
|
+
}), /* @__PURE__ */ X(I, {
|
|
2228
2228
|
ref: s,
|
|
2229
|
-
kind:
|
|
2230
|
-
danger:
|
|
2231
|
-
icon:
|
|
2232
|
-
disabled:
|
|
2233
|
-
"aria-disabled":
|
|
2234
|
-
"aria-describedby":
|
|
2235
|
-
title:
|
|
2236
|
-
onClick:
|
|
2229
|
+
kind: g ? "primary" : "default",
|
|
2230
|
+
danger: h,
|
|
2231
|
+
icon: b,
|
|
2232
|
+
disabled: _ || a,
|
|
2233
|
+
"aria-disabled": _ ? "true" : void 0,
|
|
2234
|
+
"aria-describedby": v,
|
|
2235
|
+
title: ee(f, p, _, e.reason),
|
|
2236
|
+
onClick: y,
|
|
2237
2237
|
style: c,
|
|
2238
|
-
children:
|
|
2238
|
+
children: p
|
|
2239
2239
|
})] });
|
|
2240
2240
|
}
|
|
2241
2241
|
function vr({ group: n, entityActions: r, globalActions: i, onRun: a, loading: o, onLoadingChange: s, measureRef: c, style: l, row: u, widgetContext: d, onActionClick: f }) {
|
|
2242
|
-
let
|
|
2243
|
-
|
|
2244
|
-
}, [c]),
|
|
2245
|
-
return /* @__PURE__ */ Z(Y, { children: [/* @__PURE__ */ X(
|
|
2246
|
-
ref:
|
|
2242
|
+
let p = q(null), [m, h] = J(!1), g = n.name ? S(n.name) : "Actions", _ = W((e) => {
|
|
2243
|
+
p.current = e, c?.(e);
|
|
2244
|
+
}, [c]), v = W((e, t) => (h(!1), a(e, t)), [a]);
|
|
2245
|
+
return /* @__PURE__ */ Z(Y, { children: [/* @__PURE__ */ X(I, {
|
|
2246
|
+
ref: _,
|
|
2247
2247
|
kind: "default",
|
|
2248
2248
|
icon: o == null ? n.icon ? /* @__PURE__ */ X(t, {
|
|
2249
2249
|
name: n.icon,
|
|
2250
2250
|
size: 12
|
|
2251
|
-
}) : void 0 : /* @__PURE__ */ X(
|
|
2251
|
+
}) : void 0 : /* @__PURE__ */ X(A, { size: 12 }),
|
|
2252
2252
|
iconRight: /* @__PURE__ */ X(e.down, { size: 10 }),
|
|
2253
2253
|
"aria-haspopup": "menu",
|
|
2254
|
-
"aria-expanded":
|
|
2255
|
-
title:
|
|
2256
|
-
onClick: () =>
|
|
2254
|
+
"aria-expanded": m ? "true" : "false",
|
|
2255
|
+
title: g,
|
|
2256
|
+
onClick: () => h((e) => !e),
|
|
2257
2257
|
style: l,
|
|
2258
|
-
children:
|
|
2259
|
-
}), /* @__PURE__ */ X(
|
|
2260
|
-
open:
|
|
2261
|
-
anchor:
|
|
2262
|
-
onClose: () =>
|
|
2258
|
+
children: g
|
|
2259
|
+
}), /* @__PURE__ */ X(z, {
|
|
2260
|
+
open: m,
|
|
2261
|
+
anchor: p.current,
|
|
2262
|
+
onClose: () => h(!1),
|
|
2263
2263
|
align: "start",
|
|
2264
2264
|
width: 200,
|
|
2265
2265
|
children: /* @__PURE__ */ X("div", {
|
|
2266
2266
|
role: "menu",
|
|
2267
|
-
"aria-label":
|
|
2267
|
+
"aria-label": g,
|
|
2268
2268
|
children: n.items.map((e) => e.kind === "action" ? /* @__PURE__ */ X(yr, {
|
|
2269
2269
|
leaf: e,
|
|
2270
2270
|
entityActions: r,
|
|
2271
2271
|
globalActions: i,
|
|
2272
|
-
onRun:
|
|
2272
|
+
onRun: v,
|
|
2273
2273
|
loading: o === e.code,
|
|
2274
2274
|
onLoadingChange: (t) => s(t ? e.code : null),
|
|
2275
2275
|
row: u,
|
|
@@ -2279,7 +2279,7 @@ function vr({ group: n, entityActions: r, globalActions: i, onRun: a, loading: o
|
|
|
2279
2279
|
group: e,
|
|
2280
2280
|
entityActions: r,
|
|
2281
2281
|
globalActions: i,
|
|
2282
|
-
onRun:
|
|
2282
|
+
onRun: v,
|
|
2283
2283
|
loading: o,
|
|
2284
2284
|
onLoadingChange: s,
|
|
2285
2285
|
row: u,
|
|
@@ -2290,12 +2290,12 @@ function vr({ group: n, entityActions: r, globalActions: i, onRun: a, loading: o
|
|
|
2290
2290
|
})] });
|
|
2291
2291
|
}
|
|
2292
2292
|
function yr({ leaf: e, entityActions: n, globalActions: r, onRun: i, loading: a, onLoadingChange: o, row: s, widgetContext: c, onActionClick: l }) {
|
|
2293
|
-
let u = pr(e.code, n, r), d = mr(e.code, n, r), f = hr(e.code, n, r),
|
|
2293
|
+
let u = pr(e.code, n, r), d = mr(e.code, n, r), f = hr(e.code, n, r), p = u?.destructive ?? !1, m = !e.enabled, h = m ? gr(e.code) : void 0, g = a ? /* @__PURE__ */ X(A, { size: 12 }) : f ? /* @__PURE__ */ X(t, {
|
|
2294
2294
|
name: f,
|
|
2295
2295
|
size: 12
|
|
2296
2296
|
}) : null;
|
|
2297
|
-
return /* @__PURE__ */ Z(Y, { children: [
|
|
2298
|
-
id:
|
|
2297
|
+
return /* @__PURE__ */ Z(Y, { children: [h && e.reason && /* @__PURE__ */ X("span", {
|
|
2298
|
+
id: h,
|
|
2299
2299
|
role: "tooltip",
|
|
2300
2300
|
style: {
|
|
2301
2301
|
position: "absolute",
|
|
@@ -2307,11 +2307,11 @@ function yr({ leaf: e, entityActions: n, globalActions: r, onRun: i, loading: a,
|
|
|
2307
2307
|
children: e.reason
|
|
2308
2308
|
}), /* @__PURE__ */ Z("div", {
|
|
2309
2309
|
role: "menuitem",
|
|
2310
|
-
"aria-disabled":
|
|
2311
|
-
"aria-describedby":
|
|
2312
|
-
title:
|
|
2310
|
+
"aria-disabled": m ? "true" : void 0,
|
|
2311
|
+
"aria-describedby": h,
|
|
2312
|
+
title: ee(u, d, m, e.reason),
|
|
2313
2313
|
onClick: async () => {
|
|
2314
|
-
if (!(!u ||
|
|
2314
|
+
if (!(!u || m || a)) {
|
|
2315
2315
|
o(!0);
|
|
2316
2316
|
try {
|
|
2317
2317
|
lr(e.code, u, s, c, l) || await Promise.resolve(i(e.code, u));
|
|
@@ -2327,22 +2327,22 @@ function yr({ leaf: e, entityActions: n, globalActions: r, onRun: i, loading: a,
|
|
|
2327
2327
|
padding: "6px 10px",
|
|
2328
2328
|
borderRadius: 5,
|
|
2329
2329
|
fontSize: 12.5,
|
|
2330
|
-
color:
|
|
2331
|
-
cursor:
|
|
2332
|
-
opacity:
|
|
2330
|
+
color: p ? "var(--danger)" : m ? "var(--text-3)" : "var(--text-2)",
|
|
2331
|
+
cursor: m ? "not-allowed" : "pointer",
|
|
2332
|
+
opacity: m ? .6 : 1
|
|
2333
2333
|
},
|
|
2334
2334
|
onMouseEnter: (e) => {
|
|
2335
|
-
|
|
2335
|
+
m || (e.currentTarget.style.background = "var(--surface-3)");
|
|
2336
2336
|
},
|
|
2337
2337
|
onMouseLeave: (e) => {
|
|
2338
2338
|
e.currentTarget.style.background = "transparent";
|
|
2339
2339
|
},
|
|
2340
|
-
children: [
|
|
2340
|
+
children: [g && /* @__PURE__ */ X("span", {
|
|
2341
2341
|
style: {
|
|
2342
|
-
color:
|
|
2342
|
+
color: p ? "var(--danger)" : "var(--text-3)",
|
|
2343
2343
|
display: "flex"
|
|
2344
2344
|
},
|
|
2345
|
-
children:
|
|
2345
|
+
children: g
|
|
2346
2346
|
}), /* @__PURE__ */ X("span", {
|
|
2347
2347
|
style: { flex: 1 },
|
|
2348
2348
|
children: d
|
|
@@ -2350,7 +2350,7 @@ function yr({ leaf: e, entityActions: n, globalActions: r, onRun: i, loading: a,
|
|
|
2350
2350
|
})] });
|
|
2351
2351
|
}
|
|
2352
2352
|
function br({ group: e, entityActions: t, globalActions: n, onRun: r, loading: i, onLoadingChange: a, row: o, widgetContext: s, onActionClick: c }) {
|
|
2353
|
-
let l = e.name ?
|
|
2353
|
+
let l = e.name ? S(e.name) : void 0;
|
|
2354
2354
|
return /* @__PURE__ */ Z(Y, { children: [l && /* @__PURE__ */ X("div", {
|
|
2355
2355
|
style: {
|
|
2356
2356
|
padding: "4px 10px 2px",
|
|
@@ -2384,19 +2384,19 @@ function br({ group: e, entityActions: t, globalActions: n, onRun: r, loading: i
|
|
|
2384
2384
|
}, e.icon ?? "nested"))] });
|
|
2385
2385
|
}
|
|
2386
2386
|
function xr({ layout: t, entityActions: n, globalActions: r, onRun: i, row: a, widgetContext: o, onActionClick: s }) {
|
|
2387
|
-
let c = q(null), [l, u] = J(!1), [d, f] = J(null),
|
|
2387
|
+
let c = q(null), [l, u] = J(!1), [d, f] = J(null), p = W((e, t) => (u(!1), i(e, t)), [i]);
|
|
2388
2388
|
return ur(t) === 0 ? null : /* @__PURE__ */ Z("div", {
|
|
2389
2389
|
style: {
|
|
2390
2390
|
display: "inline-flex",
|
|
2391
2391
|
alignItems: "center"
|
|
2392
2392
|
},
|
|
2393
|
-
children: [/* @__PURE__ */ X(
|
|
2393
|
+
children: [/* @__PURE__ */ X(U, {
|
|
2394
2394
|
ref: c,
|
|
2395
|
-
icon: X(d == null ? e.more :
|
|
2395
|
+
icon: X(d == null ? e.more : A, { size: 14 }),
|
|
2396
2396
|
title: "Actions",
|
|
2397
2397
|
size: 28,
|
|
2398
2398
|
onClick: () => u((e) => !e)
|
|
2399
|
-
}), /* @__PURE__ */ X(
|
|
2399
|
+
}), /* @__PURE__ */ X(z, {
|
|
2400
2400
|
open: l,
|
|
2401
2401
|
anchor: c.current,
|
|
2402
2402
|
onClose: () => u(!1),
|
|
@@ -2406,7 +2406,7 @@ function xr({ layout: t, entityActions: n, globalActions: r, onRun: i, row: a, w
|
|
|
2406
2406
|
layout: t,
|
|
2407
2407
|
entityActions: n,
|
|
2408
2408
|
globalActions: r,
|
|
2409
|
-
onRun:
|
|
2409
|
+
onRun: p,
|
|
2410
2410
|
loading: d,
|
|
2411
2411
|
onLoadingChange: f,
|
|
2412
2412
|
row: a,
|
|
@@ -2439,7 +2439,7 @@ function Cr({ layout: e, entityActions: t, globalActions: n, onRun: r, loading:
|
|
|
2439
2439
|
"aria-label": l,
|
|
2440
2440
|
children: [
|
|
2441
2441
|
p.map((e) => e.kind === "action" ? _(e) : null),
|
|
2442
|
-
p.length > 0 && g && /* @__PURE__ */ X(
|
|
2442
|
+
p.length > 0 && g && /* @__PURE__ */ X(k, { divider: !0 }),
|
|
2443
2443
|
m.map((e) => e.kind === "action" ? _(e) : /* @__PURE__ */ X(br, {
|
|
2444
2444
|
group: e,
|
|
2445
2445
|
entityActions: t,
|
|
@@ -2451,7 +2451,7 @@ function Cr({ layout: e, entityActions: t, globalActions: n, onRun: r, loading:
|
|
|
2451
2451
|
widgetContext: s,
|
|
2452
2452
|
onActionClick: c
|
|
2453
2453
|
}, e.icon ?? "group")),
|
|
2454
|
-
h && /* @__PURE__ */ X(
|
|
2454
|
+
h && /* @__PURE__ */ X(k, { divider: !0 }),
|
|
2455
2455
|
d.map((e) => _(e))
|
|
2456
2456
|
]
|
|
2457
2457
|
});
|
|
@@ -2479,10 +2479,10 @@ function Or(e, t, n, r, i, a, o, s) {
|
|
|
2479
2479
|
};
|
|
2480
2480
|
}
|
|
2481
2481
|
function Q(e) {
|
|
2482
|
-
return e.kind === "action" ? `action:${e.code}` : `group:${e.name ?
|
|
2482
|
+
return e.kind === "action" ? `action:${e.code}` : `group:${e.name ? S(e.name) : ""}`;
|
|
2483
2483
|
}
|
|
2484
2484
|
function kr({ layout: n, entityActions: r, globalActions: i, onRun: a, reservedRightWidth: o = 0, measurementOverride: s, ariaLabel: c = "Actions", align: l = "trailing", constrain: u = !0, row: d, widgetContext: f, onActionClick: p }) {
|
|
2485
|
-
let m = q(null), h = q(null), [g, _] = J(0), [v, y] = J(/* @__PURE__ */ new Map()), [b, x] = J(!1), [
|
|
2485
|
+
let m = q(null), h = q(null), [g, _] = J(0), [v, y] = J(/* @__PURE__ */ new Map()), [b, x] = J(!1), [C, w] = J(null), [T, E] = J(() => typeof document < "u" && document.documentElement.dir === "rtl");
|
|
2486
2486
|
G(() => {
|
|
2487
2487
|
if (typeof MutationObserver > "u") return;
|
|
2488
2488
|
let e = new MutationObserver((e) => {
|
|
@@ -2555,7 +2555,7 @@ function kr({ layout: n, entityActions: r, globalActions: i, onRun: a, reservedR
|
|
|
2555
2555
|
G(() => {
|
|
2556
2556
|
F.current = void 0;
|
|
2557
2557
|
}, [P]);
|
|
2558
|
-
let
|
|
2558
|
+
let L = K(() => M || !u ? Or(n, 2 ** 53 - 1, o, v, r, i, s) : b ? g === 0 ? Or(n, 2 ** 53 - 1, o, v, r, i, s) : Or(n, g, o, v, r, i, s, F.current) : {
|
|
2559
2559
|
primaryInline: [],
|
|
2560
2560
|
inline: [],
|
|
2561
2561
|
overflow: [],
|
|
@@ -2573,9 +2573,9 @@ function kr({ layout: n, entityActions: r, globalActions: i, onRun: a, reservedR
|
|
|
2573
2573
|
s
|
|
2574
2574
|
]);
|
|
2575
2575
|
if (G(() => {
|
|
2576
|
-
F.current = new Set([...
|
|
2577
|
-
}, [
|
|
2578
|
-
let
|
|
2576
|
+
F.current = new Set([...L.inline, ...L.primaryInline].map(Q));
|
|
2577
|
+
}, [L]), j === 0) return null;
|
|
2578
|
+
let R = L.overflow.length > 0;
|
|
2579
2579
|
return /* @__PURE__ */ Z("div", {
|
|
2580
2580
|
ref: m,
|
|
2581
2581
|
role: "toolbar",
|
|
@@ -2605,7 +2605,7 @@ function kr({ layout: n, entityActions: r, globalActions: i, onRun: a, reservedR
|
|
|
2605
2605
|
top: 0,
|
|
2606
2606
|
left: 0
|
|
2607
2607
|
},
|
|
2608
|
-
children: [/* @__PURE__ */ X(
|
|
2608
|
+
children: [/* @__PURE__ */ X(I, {
|
|
2609
2609
|
"data-node-key": wr,
|
|
2610
2610
|
iconRight: /* @__PURE__ */ X(e.down, { size: 10 }),
|
|
2611
2611
|
tabIndex: -1,
|
|
@@ -2614,7 +2614,7 @@ function kr({ layout: n, entityActions: r, globalActions: i, onRun: a, reservedR
|
|
|
2614
2614
|
let a = Q(n);
|
|
2615
2615
|
if (n.kind === "action") {
|
|
2616
2616
|
let e = pr(n.code, r, i), o = mr(n.code, r, i), s = hr(n.code, r, i);
|
|
2617
|
-
return /* @__PURE__ */ X(
|
|
2617
|
+
return /* @__PURE__ */ X(I, {
|
|
2618
2618
|
"data-node-key": a,
|
|
2619
2619
|
icon: s ? /* @__PURE__ */ X(t, {
|
|
2620
2620
|
name: s,
|
|
@@ -2625,8 +2625,8 @@ function kr({ layout: n, entityActions: r, globalActions: i, onRun: a, reservedR
|
|
|
2625
2625
|
children: o
|
|
2626
2626
|
}, a);
|
|
2627
2627
|
} else {
|
|
2628
|
-
let t = n.name ?
|
|
2629
|
-
return /* @__PURE__ */ X(
|
|
2628
|
+
let t = n.name ? S(n.name) : "Actions";
|
|
2629
|
+
return /* @__PURE__ */ X(I, {
|
|
2630
2630
|
"data-node-key": a,
|
|
2631
2631
|
iconRight: /* @__PURE__ */ X(e.down, { size: 10 }),
|
|
2632
2632
|
tabIndex: -1,
|
|
@@ -2635,26 +2635,26 @@ function kr({ layout: n, entityActions: r, globalActions: i, onRun: a, reservedR
|
|
|
2635
2635
|
}
|
|
2636
2636
|
})]
|
|
2637
2637
|
}),
|
|
2638
|
-
|
|
2638
|
+
L.primaryInline.map((e) => /* @__PURE__ */ X(_r, {
|
|
2639
2639
|
leaf: e,
|
|
2640
2640
|
entityActions: r,
|
|
2641
2641
|
globalActions: i,
|
|
2642
2642
|
onRun: a,
|
|
2643
|
-
loading:
|
|
2644
|
-
onLoadingChange: (t) =>
|
|
2643
|
+
loading: C === e.code,
|
|
2644
|
+
onLoadingChange: (t) => w(t ? e.code : null),
|
|
2645
2645
|
row: d,
|
|
2646
2646
|
widgetContext: f,
|
|
2647
2647
|
onActionClick: p
|
|
2648
2648
|
}, Q(e))),
|
|
2649
|
-
|
|
2649
|
+
L.inline.map((e) => {
|
|
2650
2650
|
let t = Q(e);
|
|
2651
2651
|
return e.kind === "action" ? /* @__PURE__ */ X(_r, {
|
|
2652
2652
|
leaf: e,
|
|
2653
2653
|
entityActions: r,
|
|
2654
2654
|
globalActions: i,
|
|
2655
2655
|
onRun: a,
|
|
2656
|
-
loading:
|
|
2657
|
-
onLoadingChange: (t) =>
|
|
2656
|
+
loading: C === e.code,
|
|
2657
|
+
onLoadingChange: (t) => w(t ? e.code : null),
|
|
2658
2658
|
row: d,
|
|
2659
2659
|
widgetContext: f,
|
|
2660
2660
|
onActionClick: p
|
|
@@ -2663,14 +2663,14 @@ function kr({ layout: n, entityActions: r, globalActions: i, onRun: a, reservedR
|
|
|
2663
2663
|
entityActions: r,
|
|
2664
2664
|
globalActions: i,
|
|
2665
2665
|
onRun: a,
|
|
2666
|
-
loading:
|
|
2667
|
-
onLoadingChange:
|
|
2666
|
+
loading: C,
|
|
2667
|
+
onLoadingChange: w,
|
|
2668
2668
|
row: d,
|
|
2669
2669
|
widgetContext: f,
|
|
2670
2670
|
onActionClick: p
|
|
2671
2671
|
}, t);
|
|
2672
2672
|
}),
|
|
2673
|
-
|
|
2673
|
+
R && /* @__PURE__ */ Z(Y, { children: [/* @__PURE__ */ X(I, {
|
|
2674
2674
|
ref: D,
|
|
2675
2675
|
kind: "default",
|
|
2676
2676
|
iconRight: /* @__PURE__ */ X(e.down, { size: 10 }),
|
|
@@ -2678,7 +2678,7 @@ function kr({ layout: n, entityActions: r, globalActions: i, onRun: a, reservedR
|
|
|
2678
2678
|
"aria-expanded": O ? "true" : "false",
|
|
2679
2679
|
onClick: () => k((e) => !e),
|
|
2680
2680
|
children: "Actions"
|
|
2681
|
-
}), /* @__PURE__ */ X(
|
|
2681
|
+
}), /* @__PURE__ */ X(z, {
|
|
2682
2682
|
open: O,
|
|
2683
2683
|
anchor: D.current,
|
|
2684
2684
|
onClose: () => k(!1),
|
|
@@ -2687,13 +2687,13 @@ function kr({ layout: n, entityActions: r, globalActions: i, onRun: a, reservedR
|
|
|
2687
2687
|
children: /* @__PURE__ */ X("div", {
|
|
2688
2688
|
role: "menu",
|
|
2689
2689
|
"aria-label": "More actions",
|
|
2690
|
-
children:
|
|
2690
|
+
children: L.overflow.map((e) => e.kind === "action" ? /* @__PURE__ */ X(yr, {
|
|
2691
2691
|
leaf: e,
|
|
2692
2692
|
entityActions: r,
|
|
2693
2693
|
globalActions: i,
|
|
2694
2694
|
onRun: A,
|
|
2695
|
-
loading:
|
|
2696
|
-
onLoadingChange: (t) =>
|
|
2695
|
+
loading: C === e.code,
|
|
2696
|
+
onLoadingChange: (t) => w(t ? e.code : null),
|
|
2697
2697
|
row: d,
|
|
2698
2698
|
widgetContext: f,
|
|
2699
2699
|
onActionClick: p
|
|
@@ -2702,21 +2702,21 @@ function kr({ layout: n, entityActions: r, globalActions: i, onRun: a, reservedR
|
|
|
2702
2702
|
entityActions: r,
|
|
2703
2703
|
globalActions: i,
|
|
2704
2704
|
onRun: A,
|
|
2705
|
-
loading:
|
|
2706
|
-
onLoadingChange:
|
|
2705
|
+
loading: C,
|
|
2706
|
+
onLoadingChange: w,
|
|
2707
2707
|
row: d,
|
|
2708
2708
|
widgetContext: f,
|
|
2709
2709
|
onActionClick: p
|
|
2710
2710
|
}, Q(e)))
|
|
2711
2711
|
})
|
|
2712
2712
|
})] }),
|
|
2713
|
-
|
|
2713
|
+
L.destructiveInline.map((e) => /* @__PURE__ */ X(_r, {
|
|
2714
2714
|
leaf: e,
|
|
2715
2715
|
entityActions: r,
|
|
2716
2716
|
globalActions: i,
|
|
2717
2717
|
onRun: a,
|
|
2718
|
-
loading:
|
|
2719
|
-
onLoadingChange: (t) =>
|
|
2718
|
+
loading: C === e.code,
|
|
2719
|
+
onLoadingChange: (t) => w(t ? e.code : null),
|
|
2720
2720
|
row: d,
|
|
2721
2721
|
widgetContext: f,
|
|
2722
2722
|
onActionClick: p
|
|
@@ -2789,7 +2789,7 @@ function jr({ layout: e, row: t, rowSelection: n, onRun: r, reservedRightWidth:
|
|
|
2789
2789
|
//#endregion
|
|
2790
2790
|
//#region src/components/shared/RowActionsKebab.tsx
|
|
2791
2791
|
function Mr({ actions: t, objectIds: n, row: r, onSuccess: i, preMenu: a, divider: o, size: s = 22, align: c = "end" }) {
|
|
2792
|
-
let l = q(null), [u, d] = J(!1), [f, p] = J(null), { run: m } =
|
|
2792
|
+
let l = q(null), [u, d] = J(!1), [f, p] = J(null), { run: m } = ne(), h = K(() => {
|
|
2793
2793
|
let e = {};
|
|
2794
2794
|
for (let { code: n, action: r } of t) e[n] = r;
|
|
2795
2795
|
return e;
|
|
@@ -2800,7 +2800,7 @@ function Mr({ actions: t, objectIds: n, row: r, onSuccess: i, preMenu: a, divide
|
|
|
2800
2800
|
enabled: !0,
|
|
2801
2801
|
reason: null
|
|
2802
2802
|
}));
|
|
2803
|
-
return r ?
|
|
2803
|
+
return r ? j(e, h, void 0, r, []) : e;
|
|
2804
2804
|
}, [
|
|
2805
2805
|
t,
|
|
2806
2806
|
h,
|
|
@@ -2810,10 +2810,10 @@ function Mr({ actions: t, objectIds: n, row: r, onSuccess: i, preMenu: a, divide
|
|
|
2810
2810
|
let a = t.entity ? `${t.entity}.${e}` : e;
|
|
2811
2811
|
return m({
|
|
2812
2812
|
action: t,
|
|
2813
|
-
title:
|
|
2813
|
+
title: S(t.display?.name) || e,
|
|
2814
2814
|
row: r,
|
|
2815
2815
|
execute: async (e) => {
|
|
2816
|
-
let t = await me(a,
|
|
2816
|
+
let t = await me(a, M(e, n));
|
|
2817
2817
|
return i?.(), t;
|
|
2818
2818
|
}
|
|
2819
2819
|
});
|
|
@@ -2831,13 +2831,13 @@ function Mr({ actions: t, objectIds: n, row: r, onSuccess: i, preMenu: a, divide
|
|
|
2831
2831
|
alignItems: "center",
|
|
2832
2832
|
justifyContent: "flex-end"
|
|
2833
2833
|
},
|
|
2834
|
-
children: [/* @__PURE__ */ X(
|
|
2834
|
+
children: [/* @__PURE__ */ X(U, {
|
|
2835
2835
|
ref: l,
|
|
2836
2836
|
size: s,
|
|
2837
2837
|
icon: /* @__PURE__ */ X(e.more, { size: Math.round(s * .55) }),
|
|
2838
2838
|
onClick: () => d((e) => !e),
|
|
2839
2839
|
title: "Actions"
|
|
2840
|
-
}), /* @__PURE__ */ Z(
|
|
2840
|
+
}), /* @__PURE__ */ Z(z, {
|
|
2841
2841
|
open: u,
|
|
2842
2842
|
anchor: l.current,
|
|
2843
2843
|
onClose: () => d(!1),
|
|
@@ -2845,7 +2845,7 @@ function Mr({ actions: t, objectIds: n, row: r, onSuccess: i, preMenu: a, divide
|
|
|
2845
2845
|
align: c,
|
|
2846
2846
|
children: [
|
|
2847
2847
|
a,
|
|
2848
|
-
a && o && g.length > 0 && /* @__PURE__ */ X(
|
|
2848
|
+
a && o && g.length > 0 && /* @__PURE__ */ X(k, { divider: !0 }),
|
|
2849
2849
|
/* @__PURE__ */ X(Cr, {
|
|
2850
2850
|
layout: g,
|
|
2851
2851
|
entityActions: h,
|
|
@@ -2874,7 +2874,7 @@ function Nr({ entity: t, searchable: n, filterFields: r, searchValue: i, onSearc
|
|
|
2874
2874
|
flex: 1,
|
|
2875
2875
|
maxWidth: 220
|
|
2876
2876
|
},
|
|
2877
|
-
children: /* @__PURE__ */ X(
|
|
2877
|
+
children: /* @__PURE__ */ X(oe, {
|
|
2878
2878
|
value: i,
|
|
2879
2879
|
onChange: a,
|
|
2880
2880
|
placeholder: "Search…",
|
|
@@ -2883,7 +2883,7 @@ function Nr({ entity: t, searchable: n, filterFields: r, searchValue: i, onSearc
|
|
|
2883
2883
|
}), u && r.map((e) => {
|
|
2884
2884
|
let n = t.fields.get(e);
|
|
2885
2885
|
if (!n) return null;
|
|
2886
|
-
let r = o[e] ?? "__all__", i =
|
|
2886
|
+
let r = o[e] ?? "__all__", i = b(n, e, c);
|
|
2887
2887
|
return n.type === "ref" && n.ref?.entity ? /* @__PURE__ */ X(Pr, {
|
|
2888
2888
|
field: n,
|
|
2889
2889
|
label: i,
|
|
@@ -2898,7 +2898,7 @@ function Nr({ entity: t, searchable: n, filterFields: r, searchValue: i, onSearc
|
|
|
2898
2898
|
label: `All ${i}`
|
|
2899
2899
|
}, ...n.values.map((e) => ({
|
|
2900
2900
|
value: e.code,
|
|
2901
|
-
label:
|
|
2901
|
+
label: S(e.name) || e.code
|
|
2902
2902
|
}))],
|
|
2903
2903
|
onChange: (t) => s(e, t),
|
|
2904
2904
|
placeholder: i
|
|
@@ -2908,7 +2908,7 @@ function Nr({ entity: t, searchable: n, filterFields: r, searchValue: i, onSearc
|
|
|
2908
2908
|
});
|
|
2909
2909
|
}
|
|
2910
2910
|
function Pr({ field: e, label: t, value: n, onChange: r }) {
|
|
2911
|
-
let i =
|
|
2911
|
+
let i = p(e.ref?.entity), a = e.display?.ref_display_field ?? i?.display?.display_field, o = K(() => i ? [...i.fields].find(([, e]) => e.primary)?.[0] ?? "id" : "id", [i]), { data: s } = O(e.ref?.entity, {
|
|
2912
2912
|
per_page: 200,
|
|
2913
2913
|
sort: a ? `${a}:asc` : void 0
|
|
2914
2914
|
}), c = s?.data ?? [], l = (e) => {
|
|
@@ -2927,7 +2927,7 @@ function Pr({ field: e, label: t, value: n, onChange: r }) {
|
|
|
2927
2927
|
value: "__all__",
|
|
2928
2928
|
label: `All ${t}`
|
|
2929
2929
|
}, ...c.map((e) => {
|
|
2930
|
-
let t = String(e[o]), n = e[
|
|
2930
|
+
let t = String(e[o]), n = e[te];
|
|
2931
2931
|
return {
|
|
2932
2932
|
value: t,
|
|
2933
2933
|
label: typeof n == "string" && n !== "" ? n : a ? l(e[a] ?? t) : t
|
|
@@ -2941,7 +2941,7 @@ function Pr({ field: e, label: t, value: n, onChange: r }) {
|
|
|
2941
2941
|
//#endregion
|
|
2942
2942
|
//#region src/lib/action-dispatch.ts
|
|
2943
2943
|
function Fr(e, t, n, r) {
|
|
2944
|
-
return
|
|
2944
|
+
return R(t) ? (le(t.ui_steps, n), null) : t.entity ? `${t.entity}.${e}` : r ? `${r}.${e}` : e;
|
|
2945
2945
|
}
|
|
2946
2946
|
//#endregion
|
|
2947
2947
|
//#region src/components/detail-layout/AssociatedBlock.tsx
|
|
@@ -3065,7 +3065,7 @@ function Ur({ node: r, ctx: i, assocCode: a, assocEntity: o, fkField: s }) {
|
|
|
3065
3065
|
if (e === s) return !1;
|
|
3066
3066
|
let t = o.fields.get(e);
|
|
3067
3067
|
return !(!t || t.primary || t.display?.is_listable === !1);
|
|
3068
|
-
}), l =
|
|
3068
|
+
}), l = P(o, "update"), u = r.interaction ?? (l ? "navigate" : "readonly"), d = (u === "inline_edit" || u === "row_edit") && l && r.editable !== !1, f = S(o.display?.name_plural) || S(o.display?.name) || a, p = r.searchable === !0 || r.filters && r.filters.length > 0, m = K(() => Lr(o.actions, s, i.recordId), [
|
|
3069
3069
|
o.actions,
|
|
3070
3070
|
s,
|
|
3071
3071
|
i.recordId
|
|
@@ -3073,7 +3073,7 @@ function Ur({ node: r, ctx: i, assocCode: a, assocEntity: o, fkField: s }) {
|
|
|
3073
3073
|
let e = {};
|
|
3074
3074
|
for (let { code: t, action: n } of m) e[t] = n;
|
|
3075
3075
|
return e;
|
|
3076
|
-
}, [m]), g = K(() =>
|
|
3076
|
+
}, [m]), g = K(() => j(o.action_layout ?? null ?? ue(h, "list_toolbar"), h, void 0, {}, []), [o.action_layout, h]), { run: _ } = ne(), v = Bt(), y = n(), b = K(() => ({
|
|
3077
3077
|
entity: o,
|
|
3078
3078
|
entityCode: a,
|
|
3079
3079
|
screenRoute: typeof window < "u" ? window.location.pathname : "",
|
|
@@ -3091,25 +3091,25 @@ function Ur({ node: r, ctx: i, assocCode: a, assocEntity: o, fkField: s }) {
|
|
|
3091
3091
|
a,
|
|
3092
3092
|
y,
|
|
3093
3093
|
v
|
|
3094
|
-
]), x = Ue(),
|
|
3094
|
+
]), x = Ue(), C = W(() => {
|
|
3095
3095
|
x.invalidateQueries({ predicate: (e) => {
|
|
3096
3096
|
let t = e.queryKey;
|
|
3097
3097
|
return t[0] === "entity-children" && t[3] === a;
|
|
3098
3098
|
} });
|
|
3099
|
-
}, [x, a]),
|
|
3099
|
+
}, [x, a]), w = W((e, t) => {
|
|
3100
3100
|
let n = Fr(e, t, {}, a);
|
|
3101
3101
|
if (n !== null) return _({
|
|
3102
3102
|
action: t,
|
|
3103
|
-
title:
|
|
3103
|
+
title: S(t.display?.name) || e,
|
|
3104
3104
|
execute: async (e) => {
|
|
3105
|
-
let t = await me(n,
|
|
3106
|
-
return
|
|
3105
|
+
let t = await me(n, M(e, void 0));
|
|
3106
|
+
return C(), t;
|
|
3107
3107
|
}
|
|
3108
3108
|
});
|
|
3109
3109
|
}, [
|
|
3110
3110
|
_,
|
|
3111
3111
|
a,
|
|
3112
|
-
|
|
3112
|
+
C
|
|
3113
3113
|
]), [T, E] = J(0), D = /* @__PURE__ */ Z("div", {
|
|
3114
3114
|
style: {
|
|
3115
3115
|
display: "flex",
|
|
@@ -3123,7 +3123,7 @@ function Ur({ node: r, ctx: i, assocCode: a, assocEntity: o, fkField: s }) {
|
|
|
3123
3123
|
kind: "toolbar",
|
|
3124
3124
|
layout: g,
|
|
3125
3125
|
entityActions: h,
|
|
3126
|
-
onRun:
|
|
3126
|
+
onRun: w,
|
|
3127
3127
|
widgetContext: b,
|
|
3128
3128
|
ariaLabel: `${f} toolbar actions`
|
|
3129
3129
|
}) : m.map(({ code: e, action: t }) => /* @__PURE__ */ X(or, {
|
|
@@ -3132,8 +3132,8 @@ function Ur({ node: r, ctx: i, assocCode: a, assocEntity: o, fkField: s }) {
|
|
|
3132
3132
|
entityCode: a,
|
|
3133
3133
|
variant: "ghost",
|
|
3134
3134
|
size: "sm",
|
|
3135
|
-
onSuccess:
|
|
3136
|
-
}, e)), d && /* @__PURE__ */ X(
|
|
3135
|
+
onSuccess: C
|
|
3136
|
+
}, e)), d && /* @__PURE__ */ X(I, {
|
|
3137
3137
|
kind: "ghost",
|
|
3138
3138
|
size: "xs",
|
|
3139
3139
|
icon: /* @__PURE__ */ X(e.plus, { size: 12 }),
|
|
@@ -3216,14 +3216,14 @@ function Wr({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey
|
|
|
3216
3216
|
});
|
|
3217
3217
|
}
|
|
3218
3218
|
function Gr({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey: i, columns: a, editable: o, interaction: s, ctx: c, searchable: l, filterFields: u, sort: d, startDraftSignal: f }) {
|
|
3219
|
-
let
|
|
3220
|
-
G(() => (
|
|
3221
|
-
|
|
3219
|
+
let p = Ue(), [m, h] = J(""), [g, _] = J(""), [v, y] = J({}), b = q(void 0);
|
|
3220
|
+
G(() => (b.current && clearTimeout(b.current), b.current = setTimeout(() => {
|
|
3221
|
+
_(m);
|
|
3222
3222
|
}, 300), () => {
|
|
3223
|
-
|
|
3224
|
-
}), [
|
|
3225
|
-
let
|
|
3226
|
-
|
|
3223
|
+
b.current && clearTimeout(b.current);
|
|
3224
|
+
}), [m]);
|
|
3225
|
+
let x = W((e, t) => {
|
|
3226
|
+
y((n) => {
|
|
3227
3227
|
if (t === "__all__") {
|
|
3228
3228
|
let { [e]: t, ...r } = n;
|
|
3229
3229
|
return r;
|
|
@@ -3233,13 +3233,13 @@ function Gr({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey
|
|
|
3233
3233
|
[e]: t
|
|
3234
3234
|
};
|
|
3235
3235
|
});
|
|
3236
|
-
}, []),
|
|
3237
|
-
if (!
|
|
3236
|
+
}, []), S = K(() => Object.keys(v).length > 0 ? v : void 0, [v]), { data: C, isLoading: w, isError: T, hasNextPage: E, fetchNextPage: D, isFetchingNextPage: O } = ar(n, r, e, i, d, void 0, g || void 0, S), { rows: k, refs: j } = K(() => {
|
|
3237
|
+
if (!C?.pages) return {
|
|
3238
3238
|
rows: [],
|
|
3239
3239
|
refs: void 0
|
|
3240
3240
|
};
|
|
3241
3241
|
let e = [], t;
|
|
3242
|
-
for (let n of
|
|
3242
|
+
for (let n of C.pages) if (e.push(...n.data), n.$refs) if (!t) t = { ...n.$refs };
|
|
3243
3243
|
else for (let [e, r] of Object.entries(n.$refs)) t[e] = {
|
|
3244
3244
|
...t[e],
|
|
3245
3245
|
...r
|
|
@@ -3248,21 +3248,21 @@ function Gr({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey
|
|
|
3248
3248
|
rows: e,
|
|
3249
3249
|
refs: t
|
|
3250
3250
|
};
|
|
3251
|
-
}, [
|
|
3252
|
-
|
|
3251
|
+
}, [C]), M = W(() => {
|
|
3252
|
+
p.invalidateQueries({ predicate: (t) => {
|
|
3253
3253
|
let n = t.queryKey;
|
|
3254
3254
|
return n[0] === "entity-children" && n[3] === e;
|
|
3255
3255
|
} });
|
|
3256
|
-
}, [
|
|
3256
|
+
}, [p, e]);
|
|
3257
3257
|
return /* @__PURE__ */ Z("div", { children: [
|
|
3258
3258
|
/* @__PURE__ */ X(Nr, {
|
|
3259
3259
|
entity: t,
|
|
3260
3260
|
searchable: l,
|
|
3261
3261
|
filterFields: u,
|
|
3262
|
-
searchValue:
|
|
3263
|
-
onSearchChange:
|
|
3264
|
-
filters:
|
|
3265
|
-
onFilterChange:
|
|
3262
|
+
searchValue: m,
|
|
3263
|
+
onSearchChange: h,
|
|
3264
|
+
filters: v,
|
|
3265
|
+
onFilterChange: x,
|
|
3266
3266
|
allEntities: c.schema.entities
|
|
3267
3267
|
}),
|
|
3268
3268
|
/* @__PURE__ */ X(Kr, {
|
|
@@ -3274,28 +3274,28 @@ function Gr({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey
|
|
|
3274
3274
|
editable: o,
|
|
3275
3275
|
interaction: s,
|
|
3276
3276
|
ctx: c,
|
|
3277
|
-
rows:
|
|
3277
|
+
rows: k,
|
|
3278
3278
|
refs: j,
|
|
3279
|
-
isLoading:
|
|
3280
|
-
isError:
|
|
3279
|
+
isLoading: w,
|
|
3280
|
+
isError: T,
|
|
3281
3281
|
invalidateQuery: M,
|
|
3282
3282
|
startDraftSignal: f
|
|
3283
3283
|
}),
|
|
3284
|
-
|
|
3284
|
+
E && /* @__PURE__ */ X("div", {
|
|
3285
3285
|
style: { marginTop: 4 },
|
|
3286
|
-
children: /* @__PURE__ */ X(
|
|
3286
|
+
children: /* @__PURE__ */ X(I, {
|
|
3287
3287
|
kind: "ghost",
|
|
3288
3288
|
size: "xs",
|
|
3289
|
-
icon:
|
|
3290
|
-
onClick: () =>
|
|
3291
|
-
disabled:
|
|
3289
|
+
icon: O ? /* @__PURE__ */ X(A, { size: 12 }) : void 0,
|
|
3290
|
+
onClick: () => D(),
|
|
3291
|
+
disabled: O,
|
|
3292
3292
|
children: "Load more"
|
|
3293
3293
|
})
|
|
3294
3294
|
})
|
|
3295
3295
|
] });
|
|
3296
3296
|
}
|
|
3297
3297
|
function Kr({ entityCode: e, entity: t, parentId: n, foreignKey: i, columns: a, editable: o, interaction: s, ctx: c, rows: l, refs: u, isLoading: d, isError: f, invalidateQuery: p, startDraftSignal: m }) {
|
|
3298
|
-
let h =
|
|
3298
|
+
let h = ce(), g = h.isPhone && c.relatedRecordsPresentation === "table", _ = a.find((e) => e !== i), v = K(() => s === "navigate" ? re(void 0, t, c.schema.screens) : null, [
|
|
3299
3299
|
s,
|
|
3300
3300
|
t,
|
|
3301
3301
|
c.schema.screens
|
|
@@ -3304,34 +3304,34 @@ function Kr({ entityCode: e, entity: t, parentId: n, foreignKey: i, columns: a,
|
|
|
3304
3304
|
i,
|
|
3305
3305
|
t,
|
|
3306
3306
|
o
|
|
3307
|
-
]),
|
|
3307
|
+
]), x = K(() => Br(t, a, i), [
|
|
3308
3308
|
a,
|
|
3309
3309
|
i,
|
|
3310
3310
|
t
|
|
3311
|
-
]),
|
|
3311
|
+
]), C = K(() => {
|
|
3312
3312
|
let e = /* @__PURE__ */ new Map();
|
|
3313
3313
|
for (let n of l) {
|
|
3314
3314
|
let r = pe(t, n);
|
|
3315
|
-
e.set(
|
|
3315
|
+
e.set(F(r), r);
|
|
3316
3316
|
}
|
|
3317
3317
|
return e;
|
|
3318
|
-
}, [l, t]),
|
|
3318
|
+
}, [l, t]), w = K(() => {
|
|
3319
3319
|
let e = /* @__PURE__ */ new Map();
|
|
3320
3320
|
for (let n of l) {
|
|
3321
3321
|
let r = n.$row_version;
|
|
3322
|
-
typeof r == "string" && r !== "" && e.set(
|
|
3322
|
+
typeof r == "string" && r !== "" && e.set(F(pe(t, n)), r);
|
|
3323
3323
|
}
|
|
3324
3324
|
return e;
|
|
3325
3325
|
}, [l, t]), T = K(() => Ir(t.actions), [t.actions]), [E, D] = J(null), [O, k] = J(null), [A, j] = J([]), [M, N] = J({}), P = q(M);
|
|
3326
3326
|
P.current = M;
|
|
3327
|
-
let
|
|
3327
|
+
let I = q({});
|
|
3328
3328
|
G(() => {
|
|
3329
|
-
let e =
|
|
3329
|
+
let e = I.current;
|
|
3330
3330
|
return () => {
|
|
3331
3331
|
for (let t of Object.values(e)) clearTimeout(t);
|
|
3332
3332
|
};
|
|
3333
3333
|
}, []);
|
|
3334
|
-
let [
|
|
3334
|
+
let [L, R] = J(null), [ee, te] = J([]), [z, B] = J(!1), { run: V } = ne(), [H, ie] = J(/* @__PURE__ */ new Set()), ae = W(async (t, n, i) => {
|
|
3335
3335
|
N((e) => ({
|
|
3336
3336
|
...e,
|
|
3337
3337
|
[t]: {
|
|
@@ -3341,11 +3341,11 @@ function Kr({ entityCode: e, entity: t, parentId: n, foreignKey: i, columns: a,
|
|
|
3341
3341
|
}
|
|
3342
3342
|
}));
|
|
3343
3343
|
try {
|
|
3344
|
-
let a =
|
|
3344
|
+
let a = w.get(t), o = a ? {
|
|
3345
3345
|
...n,
|
|
3346
3346
|
$row_version: a
|
|
3347
3347
|
} : n;
|
|
3348
|
-
return await r(e,
|
|
3348
|
+
return await r(e, C.get(t) ?? t, o), N((e) => {
|
|
3349
3349
|
let n = e[t];
|
|
3350
3350
|
if (!n) return e;
|
|
3351
3351
|
if (n.ver > i) return {
|
|
@@ -3372,9 +3372,9 @@ function Kr({ entityCode: e, entity: t, parentId: n, foreignKey: i, columns: a,
|
|
|
3372
3372
|
}, [
|
|
3373
3373
|
e,
|
|
3374
3374
|
p,
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
]),
|
|
3375
|
+
C,
|
|
3376
|
+
w
|
|
3377
|
+
]), oe = W((e, t, n) => {
|
|
3378
3378
|
N((r) => {
|
|
3379
3379
|
let i = r[e] ?? {
|
|
3380
3380
|
buffer: {},
|
|
@@ -3392,49 +3392,49 @@ function Kr({ entityCode: e, entity: t, parentId: n, foreignKey: i, columns: a,
|
|
|
3392
3392
|
ver: a
|
|
3393
3393
|
}
|
|
3394
3394
|
};
|
|
3395
|
-
}), s === "inline_edit" && (
|
|
3395
|
+
}), s === "inline_edit" && (I.current[e] && clearTimeout(I.current[e]), I.current[e] = setTimeout(() => {
|
|
3396
3396
|
let t = P.current[e];
|
|
3397
|
-
t && Object.keys(t.buffer).length > 0 &&
|
|
3397
|
+
t && Object.keys(t.buffer).length > 0 && ae(e, { ...t.buffer }, t.ver);
|
|
3398
3398
|
}, 500));
|
|
3399
|
-
}, [
|
|
3399
|
+
}, [ae, s]), U = W(() => {
|
|
3400
3400
|
let e = {};
|
|
3401
3401
|
e[i] = n;
|
|
3402
3402
|
for (let n of a) {
|
|
3403
3403
|
let r = t.fields.get(n);
|
|
3404
3404
|
r && (r.default === void 0 ? r.type === "bool" && (e[n] = !1) : e[n] = r.default);
|
|
3405
3405
|
}
|
|
3406
|
-
|
|
3406
|
+
R(e), te([]);
|
|
3407
3407
|
}, [
|
|
3408
3408
|
i,
|
|
3409
3409
|
n,
|
|
3410
3410
|
a,
|
|
3411
3411
|
t.fields
|
|
3412
|
-
]),
|
|
3412
|
+
]), se = q(m);
|
|
3413
3413
|
G(() => {
|
|
3414
|
-
m !== void 0 && m !==
|
|
3414
|
+
m !== void 0 && m !== se.current && (se.current = m, !L && U());
|
|
3415
3415
|
}, [
|
|
3416
3416
|
m,
|
|
3417
|
-
|
|
3417
|
+
L,
|
|
3418
3418
|
U
|
|
3419
3419
|
]);
|
|
3420
3420
|
let le = W(async () => {
|
|
3421
|
-
if (!
|
|
3422
|
-
let n = Vr(
|
|
3421
|
+
if (!L) return;
|
|
3422
|
+
let n = Vr(L, a, t, i);
|
|
3423
3423
|
if (n.length > 0) {
|
|
3424
|
-
|
|
3424
|
+
te(n);
|
|
3425
3425
|
return;
|
|
3426
3426
|
}
|
|
3427
3427
|
B(!0);
|
|
3428
3428
|
try {
|
|
3429
|
-
await de(e,
|
|
3429
|
+
await de(e, L), R(null), te([]), p();
|
|
3430
3430
|
} catch (e) {
|
|
3431
3431
|
let t = e instanceof Error ? e.message : "Create failed";
|
|
3432
|
-
|
|
3432
|
+
te([`_error:${t}`]);
|
|
3433
3433
|
} finally {
|
|
3434
3434
|
B(!1);
|
|
3435
3435
|
}
|
|
3436
3436
|
}, [
|
|
3437
|
-
|
|
3437
|
+
L,
|
|
3438
3438
|
a,
|
|
3439
3439
|
t,
|
|
3440
3440
|
i,
|
|
@@ -3449,20 +3449,20 @@ function Kr({ entityCode: e, entity: t, parentId: n, foreignKey: i, columns: a,
|
|
|
3449
3449
|
return;
|
|
3450
3450
|
}
|
|
3451
3451
|
let o = Vr({
|
|
3452
|
-
...l.find((n) =>
|
|
3452
|
+
...l.find((n) => F(pe(t, n)) === e) ?? {},
|
|
3453
3453
|
...r
|
|
3454
3454
|
}, a, t, i);
|
|
3455
3455
|
if (o.length > 0) {
|
|
3456
3456
|
j(o);
|
|
3457
3457
|
return;
|
|
3458
3458
|
}
|
|
3459
|
-
await
|
|
3459
|
+
await ae(e, { ...r }, n?.ver ?? 0) && (k(null), j([]));
|
|
3460
3460
|
}, [
|
|
3461
3461
|
l,
|
|
3462
3462
|
t,
|
|
3463
3463
|
a,
|
|
3464
3464
|
i,
|
|
3465
|
-
|
|
3465
|
+
ae
|
|
3466
3466
|
]), me = W((e) => {
|
|
3467
3467
|
N((t) => {
|
|
3468
3468
|
if (!t[e]) return t;
|
|
@@ -3470,19 +3470,19 @@ function Kr({ entityCode: e, entity: t, parentId: n, foreignKey: i, columns: a,
|
|
|
3470
3470
|
return r;
|
|
3471
3471
|
}), j([]), k(null);
|
|
3472
3472
|
}, []), ge = W((n, r) => {
|
|
3473
|
-
let i =
|
|
3473
|
+
let i = C.get(n) ?? n;
|
|
3474
3474
|
return V({
|
|
3475
3475
|
action: t.actions?.__delete,
|
|
3476
3476
|
destructive: !0,
|
|
3477
|
-
title:
|
|
3477
|
+
title: S(t.display?.name) || "Delete",
|
|
3478
3478
|
row: r,
|
|
3479
3479
|
entity: e,
|
|
3480
3480
|
execute: async () => {
|
|
3481
|
-
|
|
3481
|
+
ie((e) => new Set(e).add(n));
|
|
3482
3482
|
try {
|
|
3483
3483
|
return await he(e, i);
|
|
3484
3484
|
} finally {
|
|
3485
|
-
|
|
3485
|
+
ie((e) => {
|
|
3486
3486
|
let t = new Set(e);
|
|
3487
3487
|
return t.delete(n), t;
|
|
3488
3488
|
});
|
|
@@ -3495,7 +3495,7 @@ function Kr({ entityCode: e, entity: t, parentId: n, foreignKey: i, columns: a,
|
|
|
3495
3495
|
t,
|
|
3496
3496
|
e,
|
|
3497
3497
|
p,
|
|
3498
|
-
|
|
3498
|
+
C
|
|
3499
3499
|
]);
|
|
3500
3500
|
if (f) return /* @__PURE__ */ X("div", {
|
|
3501
3501
|
style: {
|
|
@@ -3522,7 +3522,7 @@ function Kr({ entityCode: e, entity: t, parentId: n, foreignKey: i, columns: a,
|
|
|
3522
3522
|
borderRadius: 6
|
|
3523
3523
|
} })]
|
|
3524
3524
|
});
|
|
3525
|
-
let _e = l.length === 0 && !
|
|
3525
|
+
let _e = l.length === 0 && !L;
|
|
3526
3526
|
return h.isPhone && !g ? /* @__PURE__ */ Z("div", { children: [_e && !o && /* @__PURE__ */ X("div", {
|
|
3527
3527
|
style: {
|
|
3528
3528
|
fontSize: 12.5,
|
|
@@ -3537,7 +3537,7 @@ function Kr({ entityCode: e, entity: t, parentId: n, foreignKey: i, columns: a,
|
|
|
3537
3537
|
gap: 10
|
|
3538
3538
|
},
|
|
3539
3539
|
children: [l.map((n) => {
|
|
3540
|
-
let r =
|
|
3540
|
+
let r = F(pe(t, n)), i = H.has(r), l = M[r], d = v && r ? v.replace(/:\w+/, r) : void 0;
|
|
3541
3541
|
return /* @__PURE__ */ X(qr, {
|
|
3542
3542
|
rowId: r,
|
|
3543
3543
|
row: n,
|
|
@@ -3554,7 +3554,7 @@ function Kr({ entityCode: e, entity: t, parentId: n, foreignKey: i, columns: a,
|
|
|
3554
3554
|
activeCell: E,
|
|
3555
3555
|
setActiveCell: D,
|
|
3556
3556
|
rowState: l,
|
|
3557
|
-
onCellChange:
|
|
3557
|
+
onCellChange: oe,
|
|
3558
3558
|
onDeleteClick: (e) => void ge(e, n),
|
|
3559
3559
|
onStartEdit: ue,
|
|
3560
3560
|
onConfirmEdit: fe,
|
|
@@ -3566,21 +3566,21 @@ function Kr({ entityCode: e, entity: t, parentId: n, foreignKey: i, columns: a,
|
|
|
3566
3566
|
entityCode: e,
|
|
3567
3567
|
onRowActionSuccess: p
|
|
3568
3568
|
}, r);
|
|
3569
|
-
}),
|
|
3570
|
-
draftRow:
|
|
3569
|
+
}), L && /* @__PURE__ */ X(Qr, {
|
|
3570
|
+
draftRow: L,
|
|
3571
3571
|
entity: t,
|
|
3572
3572
|
columns: a,
|
|
3573
|
-
editableColumns:
|
|
3573
|
+
editableColumns: x,
|
|
3574
3574
|
foreignKey: i,
|
|
3575
|
-
draftErrors:
|
|
3575
|
+
draftErrors: ee,
|
|
3576
3576
|
draftSaving: z,
|
|
3577
|
-
onChange: (e, t) =>
|
|
3577
|
+
onChange: (e, t) => R((n) => n && {
|
|
3578
3578
|
...n,
|
|
3579
3579
|
[e]: t
|
|
3580
3580
|
}),
|
|
3581
3581
|
onConfirm: le,
|
|
3582
3582
|
onCancel: () => {
|
|
3583
|
-
|
|
3583
|
+
R(null), te([]);
|
|
3584
3584
|
},
|
|
3585
3585
|
refs: u
|
|
3586
3586
|
})]
|
|
@@ -3600,7 +3600,7 @@ function Kr({ entityCode: e, entity: t, parentId: n, foreignKey: i, columns: a,
|
|
|
3600
3600
|
let n = t.fields.get(e);
|
|
3601
3601
|
return /* @__PURE__ */ X("th", {
|
|
3602
3602
|
style: Ae,
|
|
3603
|
-
children: n ?
|
|
3603
|
+
children: n ? b(n, e, c.schema.entities) : e
|
|
3604
3604
|
}, e);
|
|
3605
3605
|
}),
|
|
3606
3606
|
o && /* @__PURE__ */ X("th", { style: {
|
|
@@ -3612,7 +3612,7 @@ function Kr({ entityCode: e, entity: t, parentId: n, foreignKey: i, columns: a,
|
|
|
3612
3612
|
width: 40
|
|
3613
3613
|
} })
|
|
3614
3614
|
] }) }), /* @__PURE__ */ Z("tbody", { children: [l.map((n) => {
|
|
3615
|
-
let r =
|
|
3615
|
+
let r = F(pe(t, n)), i = H.has(r), l = M[r], d = v && r ? v.replace(/:\w+/, r) : void 0;
|
|
3616
3616
|
return /* @__PURE__ */ X(Jr, {
|
|
3617
3617
|
rowId: r,
|
|
3618
3618
|
row: n,
|
|
@@ -3629,7 +3629,7 @@ function Kr({ entityCode: e, entity: t, parentId: n, foreignKey: i, columns: a,
|
|
|
3629
3629
|
activeCell: E,
|
|
3630
3630
|
setActiveCell: D,
|
|
3631
3631
|
rowState: l,
|
|
3632
|
-
onCellChange:
|
|
3632
|
+
onCellChange: oe,
|
|
3633
3633
|
onDeleteClick: (e) => void ge(e, n),
|
|
3634
3634
|
onStartEdit: ue,
|
|
3635
3635
|
onConfirmEdit: fe,
|
|
@@ -3641,49 +3641,49 @@ function Kr({ entityCode: e, entity: t, parentId: n, foreignKey: i, columns: a,
|
|
|
3641
3641
|
entityCode: e,
|
|
3642
3642
|
onRowActionSuccess: p
|
|
3643
3643
|
}, r);
|
|
3644
|
-
}),
|
|
3645
|
-
draftRow:
|
|
3644
|
+
}), L && /* @__PURE__ */ X(Zr, {
|
|
3645
|
+
draftRow: L,
|
|
3646
3646
|
entity: t,
|
|
3647
3647
|
columns: a,
|
|
3648
|
-
editableColumns:
|
|
3648
|
+
editableColumns: x,
|
|
3649
3649
|
foreignKey: i,
|
|
3650
|
-
draftErrors:
|
|
3650
|
+
draftErrors: ee,
|
|
3651
3651
|
draftSaving: z,
|
|
3652
|
-
onChange: (e, t) =>
|
|
3652
|
+
onChange: (e, t) => R((n) => n && {
|
|
3653
3653
|
...n,
|
|
3654
3654
|
[e]: t
|
|
3655
3655
|
}),
|
|
3656
3656
|
onConfirm: le,
|
|
3657
3657
|
onCancel: () => {
|
|
3658
|
-
|
|
3658
|
+
R(null), te([]);
|
|
3659
3659
|
},
|
|
3660
3660
|
refs: u
|
|
3661
3661
|
})] })]
|
|
3662
3662
|
})
|
|
3663
3663
|
})] });
|
|
3664
3664
|
}
|
|
3665
|
-
function qr({ rowId: t, row: r, entity: i, entities: a, screens: o, columns: s, editableColumns: c, editable: l, interaction: d, isEditing: f, editErrors:
|
|
3666
|
-
let
|
|
3665
|
+
function qr({ rowId: t, row: r, entity: i, entities: a, screens: o, columns: s, editableColumns: c, editable: l, interaction: d, isEditing: f, editErrors: p, isDeleting: m, rowState: h, onCellChange: g, onDeleteClick: _, onStartEdit: v, onConfirmEdit: y, onCancelEdit: x, refs: S, identityCol: C, href: w, rowActions: T, onRowActionSuccess: E }) {
|
|
3666
|
+
let D = n(), O = Ie(), k = K(() => !h || Object.keys(h.buffer).length === 0 ? r : {
|
|
3667
3667
|
...r,
|
|
3668
|
-
...
|
|
3669
|
-
}, [r,
|
|
3668
|
+
...h.buffer
|
|
3669
|
+
}, [r, h]);
|
|
3670
3670
|
return d === "row_edit" && f ? /* @__PURE__ */ X(Xr, {
|
|
3671
|
-
values:
|
|
3671
|
+
values: k,
|
|
3672
3672
|
entity: i,
|
|
3673
3673
|
columns: s,
|
|
3674
3674
|
editableColumns: c,
|
|
3675
|
-
errors:
|
|
3676
|
-
saving:
|
|
3677
|
-
onChange: (e, n) =>
|
|
3678
|
-
onConfirm: () =>
|
|
3675
|
+
errors: h?.error ? [...p, `_error:${h.error}`] : p,
|
|
3676
|
+
saving: h?.saving ?? !1,
|
|
3677
|
+
onChange: (e, n) => g(t, e, n),
|
|
3678
|
+
onConfirm: () => y(t),
|
|
3679
3679
|
onCancel: () => x(t),
|
|
3680
|
-
refs:
|
|
3680
|
+
refs: S
|
|
3681
3681
|
}) : /* @__PURE__ */ Z("div", {
|
|
3682
3682
|
style: {
|
|
3683
3683
|
border: "1px solid var(--border)",
|
|
3684
3684
|
borderRadius: 8,
|
|
3685
3685
|
background: "var(--surface)",
|
|
3686
|
-
opacity:
|
|
3686
|
+
opacity: m ? .58 : 1,
|
|
3687
3687
|
overflow: "hidden"
|
|
3688
3688
|
},
|
|
3689
3689
|
children: [/* @__PURE__ */ X("div", {
|
|
@@ -3694,26 +3694,26 @@ function qr({ rowId: t, row: r, entity: i, entities: a, screens: o, columns: s,
|
|
|
3694
3694
|
gap: 12
|
|
3695
3695
|
},
|
|
3696
3696
|
children: s.map((e) => {
|
|
3697
|
-
let n = i.fields.get(e), r = l && d === "inline_edit" && c.has(e), s =
|
|
3697
|
+
let n = i.fields.get(e), r = l && d === "inline_edit" && c.has(e), s = w && e === C, f = n ? b(n, e, a) : e, p = `${O}-${t}-${e}`, m = `${p}-label`, h = {
|
|
3698
3698
|
fontSize: 11.5,
|
|
3699
3699
|
fontWeight: 600,
|
|
3700
3700
|
color: "var(--text-3)"
|
|
3701
|
-
},
|
|
3701
|
+
}, _ = n ? V({
|
|
3702
3702
|
field: n,
|
|
3703
3703
|
fieldName: e,
|
|
3704
|
-
value:
|
|
3704
|
+
value: k[e],
|
|
3705
3705
|
mode: r ? "edit" : "display",
|
|
3706
|
-
onChange: r ? (n) =>
|
|
3707
|
-
record:
|
|
3708
|
-
refs:
|
|
3706
|
+
onChange: r ? (n) => g(t, e, n) : void 0,
|
|
3707
|
+
record: k,
|
|
3708
|
+
refs: S,
|
|
3709
3709
|
compact: r,
|
|
3710
3710
|
entity: i,
|
|
3711
3711
|
entities: a,
|
|
3712
3712
|
screens: s ? void 0 : o,
|
|
3713
3713
|
fieldId: p,
|
|
3714
3714
|
labelId: m,
|
|
3715
|
-
locale:
|
|
3716
|
-
}) : u(
|
|
3715
|
+
locale: D
|
|
3716
|
+
}) : u(k[e]);
|
|
3717
3717
|
return /* @__PURE__ */ Z("div", {
|
|
3718
3718
|
style: {
|
|
3719
3719
|
display: "flex",
|
|
@@ -3733,18 +3733,18 @@ function qr({ rowId: t, row: r, entity: i, entities: a, screens: o, columns: s,
|
|
|
3733
3733
|
}), /* @__PURE__ */ X("div", {
|
|
3734
3734
|
style: { minWidth: 0 },
|
|
3735
3735
|
children: s && !r ? /* @__PURE__ */ X("a", {
|
|
3736
|
-
href:
|
|
3736
|
+
href: w,
|
|
3737
3737
|
style: {
|
|
3738
3738
|
color: "var(--accent)",
|
|
3739
3739
|
textDecoration: "none",
|
|
3740
3740
|
fontWeight: 500
|
|
3741
3741
|
},
|
|
3742
|
-
children:
|
|
3743
|
-
}) :
|
|
3742
|
+
children: _
|
|
3743
|
+
}) : _
|
|
3744
3744
|
})]
|
|
3745
3745
|
}, e);
|
|
3746
3746
|
})
|
|
3747
|
-
}), (l ||
|
|
3747
|
+
}), (l || T && T.length > 0) && /* @__PURE__ */ Z("div", {
|
|
3748
3748
|
style: {
|
|
3749
3749
|
minHeight: 42,
|
|
3750
3750
|
padding: "6px 8px",
|
|
@@ -3755,52 +3755,52 @@ function qr({ rowId: t, row: r, entity: i, entities: a, screens: o, columns: s,
|
|
|
3755
3755
|
gap: 6
|
|
3756
3756
|
},
|
|
3757
3757
|
children: [l && /* @__PURE__ */ Z(Y, { children: [
|
|
3758
|
-
|
|
3759
|
-
|
|
3758
|
+
h?.saving && /* @__PURE__ */ X(A, { size: 12 }),
|
|
3759
|
+
h?.error && /* @__PURE__ */ X("span", {
|
|
3760
3760
|
style: {
|
|
3761
3761
|
fontSize: 11,
|
|
3762
3762
|
color: "var(--danger)"
|
|
3763
3763
|
},
|
|
3764
|
-
title:
|
|
3764
|
+
title: h.error,
|
|
3765
3765
|
children: "!"
|
|
3766
3766
|
}),
|
|
3767
|
-
d === "row_edit" && /* @__PURE__ */ X(
|
|
3767
|
+
d === "row_edit" && /* @__PURE__ */ X(U, {
|
|
3768
3768
|
size: 32,
|
|
3769
3769
|
icon: /* @__PURE__ */ X(e.edit, { size: 14 }),
|
|
3770
|
-
onClick: () =>
|
|
3770
|
+
onClick: () => v(t),
|
|
3771
3771
|
title: "Edit row"
|
|
3772
3772
|
}),
|
|
3773
|
-
/* @__PURE__ */ X(
|
|
3773
|
+
/* @__PURE__ */ X(U, {
|
|
3774
3774
|
size: 32,
|
|
3775
3775
|
icon: /* @__PURE__ */ X(e.trash, { size: 14 }),
|
|
3776
|
-
onClick: () =>
|
|
3776
|
+
onClick: () => _(t),
|
|
3777
3777
|
title: "Delete row"
|
|
3778
3778
|
})
|
|
3779
|
-
] }), !l &&
|
|
3780
|
-
actions:
|
|
3779
|
+
] }), !l && T && T.length > 0 && /* @__PURE__ */ X(Mr, {
|
|
3780
|
+
actions: T,
|
|
3781
3781
|
objectIds: [t],
|
|
3782
|
-
row:
|
|
3783
|
-
onSuccess:
|
|
3782
|
+
row: k,
|
|
3783
|
+
onSuccess: E
|
|
3784
3784
|
})]
|
|
3785
3785
|
})]
|
|
3786
3786
|
});
|
|
3787
3787
|
}
|
|
3788
|
-
function Jr({ rowId: t, row: r, entity: i, entities: a, screens: o, columns: s, editableColumns: c, editable: l, interaction: d, isEditing: f, editErrors:
|
|
3789
|
-
let
|
|
3788
|
+
function Jr({ rowId: t, row: r, entity: i, entities: a, screens: o, columns: s, editableColumns: c, editable: l, interaction: d, isEditing: f, editErrors: p, isDeleting: m, activeCell: h, setActiveCell: g, rowState: _, onCellChange: v, onDeleteClick: y, onStartEdit: b, onConfirmEdit: x, onCancelEdit: S, refs: C, identityCol: w, href: T, rowActions: E, onRowActionSuccess: D }) {
|
|
3789
|
+
let O = n(), k = K(() => !_ || Object.keys(_.buffer).length === 0 ? r : {
|
|
3790
3790
|
...r,
|
|
3791
|
-
...
|
|
3792
|
-
}, [r,
|
|
3791
|
+
..._.buffer
|
|
3792
|
+
}, [r, _]);
|
|
3793
3793
|
if (d === "row_edit" && f) return /* @__PURE__ */ X(Yr, {
|
|
3794
|
-
values:
|
|
3794
|
+
values: k,
|
|
3795
3795
|
entity: i,
|
|
3796
3796
|
columns: s,
|
|
3797
3797
|
editableColumns: c,
|
|
3798
|
-
errors:
|
|
3799
|
-
saving:
|
|
3800
|
-
onChange: (e, n) =>
|
|
3801
|
-
onConfirm: () =>
|
|
3802
|
-
onCancel: () =>
|
|
3803
|
-
refs:
|
|
3798
|
+
errors: _?.error ? [...p, `_error:${_.error}`] : p,
|
|
3799
|
+
saving: _?.saving ?? !1,
|
|
3800
|
+
onChange: (e, n) => v(t, e, n),
|
|
3801
|
+
onConfirm: () => x(t),
|
|
3802
|
+
onCancel: () => S(t),
|
|
3803
|
+
refs: C
|
|
3804
3804
|
});
|
|
3805
3805
|
let j = Me, M = {
|
|
3806
3806
|
padding: "4px 4px",
|
|
@@ -3808,47 +3808,47 @@ function Jr({ rowId: t, row: r, entity: i, entities: a, screens: o, columns: s,
|
|
|
3808
3808
|
verticalAlign: "middle"
|
|
3809
3809
|
}, N = d === "inline_edit";
|
|
3810
3810
|
return /* @__PURE__ */ Z("tr", {
|
|
3811
|
-
style: { opacity:
|
|
3811
|
+
style: { opacity: m ? .5 : 1 },
|
|
3812
3812
|
children: [
|
|
3813
3813
|
s.map((e) => {
|
|
3814
3814
|
let n = i.fields.get(e), r = c.has(e);
|
|
3815
|
-
if (N &&
|
|
3815
|
+
if (N && h?.rowId === t && h?.col === e && r) return /* @__PURE__ */ X("td", {
|
|
3816
3816
|
style: M,
|
|
3817
3817
|
children: n ? V({
|
|
3818
3818
|
field: n,
|
|
3819
3819
|
fieldName: e,
|
|
3820
|
-
value:
|
|
3820
|
+
value: k[e],
|
|
3821
3821
|
mode: "edit",
|
|
3822
|
-
onChange: (n) =>
|
|
3823
|
-
record:
|
|
3824
|
-
refs:
|
|
3822
|
+
onChange: (n) => v(t, e, n),
|
|
3823
|
+
record: k,
|
|
3824
|
+
refs: C,
|
|
3825
3825
|
compact: !0,
|
|
3826
|
-
locale:
|
|
3827
|
-
}) : u(
|
|
3826
|
+
locale: O
|
|
3827
|
+
}) : u(k[e])
|
|
3828
3828
|
}, e);
|
|
3829
|
-
let s =
|
|
3829
|
+
let s = T && e === w, l = n ? V({
|
|
3830
3830
|
field: n,
|
|
3831
3831
|
fieldName: e,
|
|
3832
|
-
value:
|
|
3832
|
+
value: k[e],
|
|
3833
3833
|
mode: "display",
|
|
3834
|
-
record:
|
|
3835
|
-
refs:
|
|
3834
|
+
record: k,
|
|
3835
|
+
refs: C,
|
|
3836
3836
|
entity: i,
|
|
3837
3837
|
entities: a,
|
|
3838
3838
|
screens: s ? void 0 : o,
|
|
3839
|
-
locale:
|
|
3840
|
-
}) : u(
|
|
3839
|
+
locale: O
|
|
3840
|
+
}) : u(k[e]), d = N && r && !m;
|
|
3841
3841
|
return /* @__PURE__ */ X("td", {
|
|
3842
3842
|
style: {
|
|
3843
3843
|
...j,
|
|
3844
3844
|
cursor: d ? "pointer" : "default"
|
|
3845
3845
|
},
|
|
3846
|
-
onClick: d ? () =>
|
|
3846
|
+
onClick: d ? () => g({
|
|
3847
3847
|
rowId: t,
|
|
3848
3848
|
col: e
|
|
3849
3849
|
}) : void 0,
|
|
3850
3850
|
children: s ? /* @__PURE__ */ X("a", {
|
|
3851
|
-
href:
|
|
3851
|
+
href: T,
|
|
3852
3852
|
style: {
|
|
3853
3853
|
color: "var(--accent)",
|
|
3854
3854
|
textDecoration: "none",
|
|
@@ -3873,75 +3873,75 @@ function Jr({ rowId: t, row: r, entity: i, entities: a, screens: o, columns: s,
|
|
|
3873
3873
|
gap: 4
|
|
3874
3874
|
},
|
|
3875
3875
|
children: [
|
|
3876
|
-
|
|
3877
|
-
|
|
3876
|
+
_?.saving && /* @__PURE__ */ X(A, { size: 12 }),
|
|
3877
|
+
_?.error && /* @__PURE__ */ X("span", {
|
|
3878
3878
|
style: {
|
|
3879
3879
|
fontSize: 11,
|
|
3880
3880
|
color: "var(--danger)"
|
|
3881
3881
|
},
|
|
3882
|
-
title:
|
|
3882
|
+
title: _.error,
|
|
3883
3883
|
children: "!"
|
|
3884
3884
|
}),
|
|
3885
|
-
d === "row_edit" && /* @__PURE__ */ X(
|
|
3885
|
+
d === "row_edit" && /* @__PURE__ */ X(U, {
|
|
3886
3886
|
size: 24,
|
|
3887
3887
|
icon: /* @__PURE__ */ X(e.edit, { size: 12 }),
|
|
3888
|
-
onClick: () =>
|
|
3888
|
+
onClick: () => b(t),
|
|
3889
3889
|
title: "Edit row"
|
|
3890
3890
|
}),
|
|
3891
|
-
/* @__PURE__ */ X(
|
|
3891
|
+
/* @__PURE__ */ X(U, {
|
|
3892
3892
|
size: 24,
|
|
3893
3893
|
icon: /* @__PURE__ */ X(e.trash, { size: 12 }),
|
|
3894
|
-
onClick: () =>
|
|
3894
|
+
onClick: () => y(t),
|
|
3895
3895
|
title: "Delete row"
|
|
3896
3896
|
})
|
|
3897
3897
|
]
|
|
3898
3898
|
})
|
|
3899
3899
|
}),
|
|
3900
|
-
!l &&
|
|
3900
|
+
!l && E && E.length > 0 && /* @__PURE__ */ X("td", {
|
|
3901
3901
|
style: {
|
|
3902
3902
|
padding: "4px 8px",
|
|
3903
3903
|
borderBottom: "1px solid var(--divider)",
|
|
3904
3904
|
verticalAlign: "middle"
|
|
3905
3905
|
},
|
|
3906
3906
|
children: /* @__PURE__ */ X(Mr, {
|
|
3907
|
-
actions:
|
|
3907
|
+
actions: E,
|
|
3908
3908
|
objectIds: [t],
|
|
3909
|
-
row:
|
|
3910
|
-
onSuccess:
|
|
3909
|
+
row: k,
|
|
3910
|
+
onSuccess: D
|
|
3911
3911
|
})
|
|
3912
3912
|
})
|
|
3913
3913
|
]
|
|
3914
3914
|
});
|
|
3915
3915
|
}
|
|
3916
|
-
function Yr({ values: t, entity: r, columns: i, editableColumns: a, errors: o, saving: s, onChange: c, onConfirm: l, onCancel: d, refs: f, accent:
|
|
3917
|
-
let
|
|
3916
|
+
function Yr({ values: t, entity: r, columns: i, editableColumns: a, errors: o, saving: s, onChange: c, onConfirm: l, onCancel: d, refs: f, accent: p }) {
|
|
3917
|
+
let m = n(), h = o.find((e) => e.startsWith("_error:")), g = new Set(o.filter((e) => !e.startsWith("_error:"))), _ = {
|
|
3918
3918
|
padding: "6px 12px",
|
|
3919
3919
|
borderBottom: "1px solid var(--divider)",
|
|
3920
3920
|
verticalAlign: "middle",
|
|
3921
3921
|
height: 40,
|
|
3922
3922
|
minWidth: 0
|
|
3923
|
-
},
|
|
3923
|
+
}, v = {
|
|
3924
3924
|
display: "block",
|
|
3925
3925
|
width: "100%",
|
|
3926
3926
|
maxWidth: "100%",
|
|
3927
3927
|
minWidth: 0
|
|
3928
3928
|
};
|
|
3929
3929
|
return /* @__PURE__ */ Z("tr", {
|
|
3930
|
-
style:
|
|
3930
|
+
style: p ? { boxShadow: "inset 3px 0 0 var(--accent)" } : void 0,
|
|
3931
3931
|
onKeyDown: (e) => {
|
|
3932
3932
|
e.key === "Enter" && !e.shiftKey ? (e.preventDefault(), l()) : e.key === "Escape" && (e.preventDefault(), d());
|
|
3933
3933
|
},
|
|
3934
3934
|
children: [i.map((e) => {
|
|
3935
|
-
let n = r.fields.get(e), i = a.has(e), o =
|
|
3935
|
+
let n = r.fields.get(e), i = a.has(e), o = g.has(e);
|
|
3936
3936
|
return i ? /* @__PURE__ */ X("td", {
|
|
3937
3937
|
style: {
|
|
3938
|
-
...
|
|
3938
|
+
..._,
|
|
3939
3939
|
outline: o ? "1px solid var(--danger)" : "none",
|
|
3940
3940
|
outlineOffset: -1
|
|
3941
3941
|
},
|
|
3942
3942
|
title: o ? `${e} is required` : void 0,
|
|
3943
3943
|
children: /* @__PURE__ */ X("div", {
|
|
3944
|
-
style:
|
|
3944
|
+
style: v,
|
|
3945
3945
|
children: n ? V({
|
|
3946
3946
|
field: n,
|
|
3947
3947
|
fieldName: e,
|
|
@@ -3951,18 +3951,18 @@ function Yr({ values: t, entity: r, columns: i, editableColumns: a, errors: o, s
|
|
|
3951
3951
|
record: t,
|
|
3952
3952
|
refs: f,
|
|
3953
3953
|
compact: !0,
|
|
3954
|
-
locale:
|
|
3954
|
+
locale: m
|
|
3955
3955
|
}) : u(t[e])
|
|
3956
3956
|
})
|
|
3957
3957
|
}, e) : /* @__PURE__ */ X("td", {
|
|
3958
3958
|
style: {
|
|
3959
|
-
...
|
|
3959
|
+
..._,
|
|
3960
3960
|
color: "var(--text-3)"
|
|
3961
3961
|
},
|
|
3962
3962
|
children: n?.auto ? "—" : u(t[e])
|
|
3963
3963
|
}, e);
|
|
3964
3964
|
}), /* @__PURE__ */ X("td", {
|
|
3965
|
-
style:
|
|
3965
|
+
style: _,
|
|
3966
3966
|
children: /* @__PURE__ */ Z("div", {
|
|
3967
3967
|
style: {
|
|
3968
3968
|
display: "flex",
|
|
@@ -3971,21 +3971,21 @@ function Yr({ values: t, entity: r, columns: i, editableColumns: a, errors: o, s
|
|
|
3971
3971
|
justifyContent: "flex-end"
|
|
3972
3972
|
},
|
|
3973
3973
|
children: [
|
|
3974
|
-
|
|
3974
|
+
h && /* @__PURE__ */ X("span", {
|
|
3975
3975
|
style: {
|
|
3976
3976
|
fontSize: 11,
|
|
3977
3977
|
color: "var(--danger)"
|
|
3978
3978
|
},
|
|
3979
|
-
title:
|
|
3979
|
+
title: h.slice(7),
|
|
3980
3980
|
children: "!"
|
|
3981
3981
|
}),
|
|
3982
|
-
/* @__PURE__ */ X(
|
|
3982
|
+
/* @__PURE__ */ X(U, {
|
|
3983
3983
|
size: 24,
|
|
3984
|
-
icon: X(s ?
|
|
3984
|
+
icon: X(s ? A : e.check, { size: 12 }),
|
|
3985
3985
|
onClick: l,
|
|
3986
3986
|
title: "Confirm (Enter)"
|
|
3987
3987
|
}),
|
|
3988
|
-
/* @__PURE__ */ X(
|
|
3988
|
+
/* @__PURE__ */ X(U, {
|
|
3989
3989
|
size: 24,
|
|
3990
3990
|
icon: /* @__PURE__ */ X(e.x, { size: 12 }),
|
|
3991
3991
|
onClick: d,
|
|
@@ -3996,15 +3996,15 @@ function Yr({ values: t, entity: r, columns: i, editableColumns: a, errors: o, s
|
|
|
3996
3996
|
})]
|
|
3997
3997
|
});
|
|
3998
3998
|
}
|
|
3999
|
-
function Xr({ values: t, entity: r, columns: i, editableColumns: a, errors: o, saving: s, onChange: c, onConfirm: l, onCancel: d, refs: f, accent:
|
|
4000
|
-
let
|
|
3999
|
+
function Xr({ values: t, entity: r, columns: i, editableColumns: a, errors: o, saving: s, onChange: c, onConfirm: l, onCancel: d, refs: f, accent: p }) {
|
|
4000
|
+
let m = n(), h = Ie(), g = o.find((e) => e.startsWith("_error:")), _ = new Set(o.filter((e) => !e.startsWith("_error:")));
|
|
4001
4001
|
return /* @__PURE__ */ Z("div", {
|
|
4002
4002
|
style: {
|
|
4003
4003
|
border: "1px solid var(--border)",
|
|
4004
4004
|
borderRadius: 8,
|
|
4005
4005
|
background: "var(--surface)",
|
|
4006
4006
|
overflow: "hidden",
|
|
4007
|
-
boxShadow:
|
|
4007
|
+
boxShadow: p ? "inset 3px 0 0 var(--accent)" : void 0
|
|
4008
4008
|
},
|
|
4009
4009
|
onKeyDown: (e) => {
|
|
4010
4010
|
e.key === "Enter" && !e.shiftKey ? (e.preventDefault(), l()) : e.key === "Escape" && (e.preventDefault(), d());
|
|
@@ -4017,7 +4017,7 @@ function Xr({ values: t, entity: r, columns: i, editableColumns: a, errors: o, s
|
|
|
4017
4017
|
gap: 12
|
|
4018
4018
|
},
|
|
4019
4019
|
children: i.map((e) => {
|
|
4020
|
-
let n = r.fields.get(e), i = a.has(e), o =
|
|
4020
|
+
let n = r.fields.get(e), i = a.has(e), o = _.has(e), s = n ? b(n, e) : e, l = `${h}-${e}`, d = `${l}-label`, p = {
|
|
4021
4021
|
fontSize: 11.5,
|
|
4022
4022
|
fontWeight: 600,
|
|
4023
4023
|
color: "var(--text-3)"
|
|
@@ -4057,7 +4057,7 @@ function Xr({ values: t, entity: r, columns: i, editableColumns: a, errors: o, s
|
|
|
4057
4057
|
compact: !0,
|
|
4058
4058
|
fieldId: l,
|
|
4059
4059
|
labelId: d,
|
|
4060
|
-
locale:
|
|
4060
|
+
locale: m
|
|
4061
4061
|
}) : u(t[e]) : n?.auto ? "—" : u(t[e])
|
|
4062
4062
|
})]
|
|
4063
4063
|
}, e);
|
|
@@ -4073,21 +4073,21 @@ function Xr({ values: t, entity: r, columns: i, editableColumns: a, errors: o, s
|
|
|
4073
4073
|
gap: 6
|
|
4074
4074
|
},
|
|
4075
4075
|
children: [
|
|
4076
|
-
|
|
4076
|
+
g && /* @__PURE__ */ X("span", {
|
|
4077
4077
|
style: {
|
|
4078
4078
|
fontSize: 11,
|
|
4079
4079
|
color: "var(--danger)"
|
|
4080
4080
|
},
|
|
4081
|
-
title:
|
|
4081
|
+
title: g.slice(7),
|
|
4082
4082
|
children: "!"
|
|
4083
4083
|
}),
|
|
4084
|
-
/* @__PURE__ */ X(
|
|
4084
|
+
/* @__PURE__ */ X(U, {
|
|
4085
4085
|
size: 32,
|
|
4086
|
-
icon: X(s ?
|
|
4086
|
+
icon: X(s ? A : e.check, { size: 14 }),
|
|
4087
4087
|
onClick: l,
|
|
4088
4088
|
title: "Confirm (Enter)"
|
|
4089
4089
|
}),
|
|
4090
|
-
/* @__PURE__ */ X(
|
|
4090
|
+
/* @__PURE__ */ X(U, {
|
|
4091
4091
|
size: 32,
|
|
4092
4092
|
icon: /* @__PURE__ */ X(e.x, { size: 14 }),
|
|
4093
4093
|
onClick: d,
|
|
@@ -4364,7 +4364,7 @@ function hi(e, t) {
|
|
|
4364
4364
|
//#endregion
|
|
4365
4365
|
//#region src/hooks/useScreenBack.ts
|
|
4366
4366
|
function gi(e) {
|
|
4367
|
-
let t = ze(), n =
|
|
4367
|
+
let t = ze(), n = ie(), r = se(), i = At((e) => e.depth), { data: a } = H(), o = e?.fallback, s = kt((e) => {
|
|
4368
4368
|
let t = e.tabs.find((t) => t.id === e.activeTabId);
|
|
4369
4369
|
return t ? t.returnTo : void 0;
|
|
4370
4370
|
}), { hasOriginBack: c, allowFallbackBack: l } = K(() => It(s, n.enabled), [s, n.enabled]), u = W(() => {
|
|
@@ -4379,7 +4379,7 @@ function gi(e) {
|
|
|
4379
4379
|
}
|
|
4380
4380
|
if (i.kind === "live" && i.tabId) e.commitTabNavigation(i.tabId, { search: i.search ?? "" });
|
|
4381
4381
|
else if (i.kind === "reopen") {
|
|
4382
|
-
let t = i.title ? void 0 :
|
|
4382
|
+
let t = i.title ? void 0 : g(i.pathname, a?.screens, a?.entities);
|
|
4383
4383
|
e.openTab({
|
|
4384
4384
|
pathname: i.pathname,
|
|
4385
4385
|
search: i.search ?? "",
|
|
@@ -4949,7 +4949,7 @@ var $ = class {
|
|
|
4949
4949
|
},
|
|
4950
4950
|
children: this.state.error?.message || "An unexpected error occurred."
|
|
4951
4951
|
}),
|
|
4952
|
-
/* @__PURE__ */ X("div", { children: /* @__PURE__ */ X(
|
|
4952
|
+
/* @__PURE__ */ X("div", { children: /* @__PURE__ */ X(I, {
|
|
4953
4953
|
onClick: this.handleRetry,
|
|
4954
4954
|
children: "Try again"
|
|
4955
4955
|
}) })
|