@declarion/react 0.38.1 → 0.39.0
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-CI5a0Emm.js → DraggableChildrenTable-DziCVhq6.js} +1 -1
- package/dist-lib/{Grid-BZEMUmjI.js → Grid-BTX2tkCT.js} +2 -2
- package/dist-lib/{LayoutRenderer-CnKUYh8M.js → LayoutRenderer-CwMERoPJ.js} +387 -285
- package/dist-lib/{MarkdownRenderer-DNmOqp_M.js → MarkdownRenderer-dHOTEhUa.js} +1 -1
- package/dist-lib/{RefreshControl-DsEXi6WF.js → RefreshControl--UAgflh7.js} +257 -175
- package/dist-lib/{SmartDetailPage.impl-DhSpZTLw.js → SmartDetailPage.impl-Bj7MtHxi.js} +474 -414
- package/dist-lib/{SmartRecordListPage.impl-Bi_FPbGy.js → SmartRecordListPage.impl-CZXzVhPC.js} +164 -164
- package/dist-lib/api/params.d.ts +12 -11
- package/dist-lib/components/columns/ColumnPicker.d.ts +11 -1
- package/dist-lib/components/detail-layout/EvidenceBlock.d.ts +6 -0
- package/dist-lib/components/detail-layout/useManualColumnResize.d.ts +25 -0
- package/dist-lib/components/list/QuickPeek.d.ts +11 -2
- package/dist-lib/components/pages/list/{ListBulkBar.d.ts → ListFloatbar.d.ts} +3 -3
- package/dist-lib/components/pages/list/RowActionsCell.d.ts +8 -10
- package/dist-lib/components/pages/list/RowContextMenu.d.ts +29 -0
- package/dist-lib/components/pages/list/SaveViewDialog.d.ts +5 -1
- package/dist-lib/components/pages/list/cardProjection.d.ts +1 -1
- package/dist-lib/components/pages/list/column-sizing.d.ts +15 -0
- package/dist-lib/components/pages/list/columns.d.ts +3 -0
- package/dist-lib/components/pages/list/useHeaderReorder.d.ts +26 -0
- package/dist-lib/components/pages/list/useRowMenu.d.ts +47 -0
- package/dist-lib/components/pages/profile/Profile.d.ts +3 -0
- package/dist-lib/components/pages/tenant-params/TenantParamsPage.d.ts +2 -0
- package/dist-lib/components/params/ParamsBlock.d.ts +25 -0
- package/dist-lib/components/params/param-editors.d.ts +28 -0
- package/dist-lib/components/primitives/Dropdown.d.ts +10 -1
- package/dist-lib/components/shared/ActionDialog.d.ts +2 -2
- package/dist-lib/components/shared/ActionRunner.d.ts +15 -0
- package/dist-lib/components/shared/ResponsiveActionBar.d.ts +45 -23
- package/dist-lib/declarion-react.css +1 -1
- package/dist-lib/hooks/useParams.d.ts +45 -1
- package/dist-lib/index.d.ts +0 -2
- package/dist-lib/index.js +3074 -2189
- package/dist-lib/lib/actions.d.ts +17 -3
- package/dist-lib/lib/evidence-verdict.d.ts +11 -0
- package/dist-lib/lib/rowClickGesture.d.ts +14 -0
- package/dist-lib/{registry-B_AmhRdj.js → registry-DXNFRlbB.js} +780 -559
- package/dist-lib/stores/list-layout.d.ts +86 -0
- package/dist-lib/testing.js +1 -1
- package/dist-lib/types/api.d.ts +29 -1
- package/dist-lib/types/schema.d.ts +15 -0
- package/dist-lib/{useCurrentScreen-CcsD2NAk.js → useCurrentScreen-BA2lb-d7.js} +860 -835
- package/dist-lib/{useProperties-CPtQIWXp.js → useProperties-Br2DeOQh.js} +81 -81
- package/dist-lib/{value-BCjHI_Ai.js → value-C91loRXp.js} +1 -1
- package/package.json +1 -1
- package/dist-lib/components/list/RowMenu.d.ts +0 -23
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { s as e, t } from "./DynamicIcon-DeRpAaXm.js";
|
|
2
|
-
import { $ as n, C as r, E as i, F as a, Gn as o, Hn as s, K as c, Kn as l, Nn as u, O as d, On as f, Pn as p, S as m, T as h, U as g, Wn as _, a as v, an as y, at as b, bn as x, cn as S, ct as C, dt as w, en as T, f as E, fn as D, g as O, gn as k, gt as A, h as j, ht as M, i as N, it as P, j as F, jn as I, jt as L, k as R, ln as z, nt as B, o as ee, on as V, ot as te, p as ne, pn as H, q as U, rt as re, sn as ie, un as W, ut as ae, vn as oe, w as se, x as ce, xn as le, y as ue, zn as de } from "./useCurrentScreen-
|
|
3
|
-
import { a as fe, c as pe, d as me, f as he, i as ge, l as _e, n as ve, o as ye, p as be, r as xe, s as Se, t as Ce, u as we } from "./value-
|
|
2
|
+
import { $ as n, C as r, E as i, F as a, Gn as o, Hn as s, K as c, Kn as l, Nn as u, O as d, On as f, Pn as p, S as m, T as h, U as g, Wn as _, a as v, an as y, at as b, bn as x, cn as S, ct as C, dt as w, en as T, f as E, fn as D, g as O, gn as k, gt as A, h as j, ht as M, i as N, it as P, j as F, jn as I, jt as L, k as R, ln as z, nt as B, o as ee, on as V, ot as te, p as ne, pn as H, q as U, rt as re, sn as ie, un as W, ut as ae, vn as oe, w as se, x as ce, xn as le, y as ue, zn as de } from "./useCurrentScreen-BA2lb-d7.js";
|
|
3
|
+
import { a as fe, c as pe, d as me, f as he, i as ge, l as _e, n as ve, o as ye, p as be, r as xe, s as Se, t as Ce, u as we } from "./value-C91loRXp.js";
|
|
4
4
|
import { n as Te, r as Ee, t as De } from "./dataTableStyles-vwD1mVOP.js";
|
|
5
5
|
import { Component as Oe, Suspense as ke, lazy as Ae, useCallback as G, useEffect as K, useId as je, useLayoutEffect as Me, useMemo as q, useRef as J, useState as Y } from "react";
|
|
6
6
|
import { parsePath as Ne, useNavigate as Pe } from "react-router-dom";
|
|
@@ -714,10 +714,19 @@ function It() {
|
|
|
714
714
|
hash: window.location.hash
|
|
715
715
|
}, o, l.findTabByPathname(window.location.pathname)), p = l.findTabByPathname(o);
|
|
716
716
|
if (p) {
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
717
|
+
if (u) {
|
|
718
|
+
let t = d || p.search;
|
|
719
|
+
l.commitTabNavigation(p.id, {
|
|
720
|
+
search: t,
|
|
721
|
+
returnTo: null
|
|
722
|
+
}), e({
|
|
723
|
+
pathname: o,
|
|
724
|
+
search: t ? `?${t}` : "",
|
|
725
|
+
hash: c
|
|
726
|
+
}, { replace: a?.replace });
|
|
727
|
+
return;
|
|
728
|
+
}
|
|
729
|
+
f ? l.commitTabNavigation(p.id, {
|
|
721
730
|
search: d,
|
|
722
731
|
returnTo: f
|
|
723
732
|
}) : l.commitTabNavigation(p.id, { search: d }), e({
|
|
@@ -1142,7 +1151,7 @@ function nn(e) {
|
|
|
1142
1151
|
}
|
|
1143
1152
|
//#endregion
|
|
1144
1153
|
//#region src/components/file-widgets/GridLazy.tsx
|
|
1145
|
-
var rn = Ae(() => import("./Grid-
|
|
1154
|
+
var rn = Ae(() => import("./Grid-BTX2tkCT.js").then((e) => ({ default: e.Grid })));
|
|
1146
1155
|
function an() {
|
|
1147
1156
|
return /* @__PURE__ */ Z("div", { className: "h-24 w-full rounded-md bg-muted animate-pulse" });
|
|
1148
1157
|
}
|
|
@@ -1868,14 +1877,188 @@ function Pn(e, t) {
|
|
|
1868
1877
|
position: t
|
|
1869
1878
|
})) };
|
|
1870
1879
|
}
|
|
1880
|
+
var Fn = 1200, In = null, Ln = null;
|
|
1881
|
+
function Rn() {
|
|
1882
|
+
return !In || !Ln ? null : `declarion::${In}::${Ln}::listlayout`;
|
|
1883
|
+
}
|
|
1884
|
+
function zn() {
|
|
1885
|
+
return {
|
|
1886
|
+
v: 2,
|
|
1887
|
+
widths: {},
|
|
1888
|
+
resizeEduShown: !1
|
|
1889
|
+
};
|
|
1890
|
+
}
|
|
1891
|
+
function Bn(e) {
|
|
1892
|
+
if (typeof e != "object" || !e) return {};
|
|
1893
|
+
let t = {};
|
|
1894
|
+
for (let [n, r] of Object.entries(e)) typeof r == "number" && Number.isFinite(r) && r >= 60 && (t[n] = r);
|
|
1895
|
+
return t;
|
|
1896
|
+
}
|
|
1897
|
+
function Vn(e) {
|
|
1898
|
+
let t;
|
|
1899
|
+
try {
|
|
1900
|
+
t = JSON.parse(e);
|
|
1901
|
+
} catch {
|
|
1902
|
+
return null;
|
|
1903
|
+
}
|
|
1904
|
+
if (typeof t != "object" || !t) return null;
|
|
1905
|
+
let n = t;
|
|
1906
|
+
if (n.v !== 2) return null;
|
|
1907
|
+
let r = {};
|
|
1908
|
+
if (n.widths && typeof n.widths == "object") for (let [e, t] of Object.entries(n.widths)) r[e] = Bn(t);
|
|
1909
|
+
return {
|
|
1910
|
+
v: 2,
|
|
1911
|
+
widths: r,
|
|
1912
|
+
resizeEduShown: n.resizeEduShown === !0
|
|
1913
|
+
};
|
|
1914
|
+
}
|
|
1915
|
+
function Hn(e) {
|
|
1916
|
+
if (typeof window > "u") return;
|
|
1917
|
+
let t = Rn();
|
|
1918
|
+
if (t) try {
|
|
1919
|
+
localStorage.setItem(t, JSON.stringify(e));
|
|
1920
|
+
} catch {}
|
|
1921
|
+
}
|
|
1922
|
+
function Un(e, t) {
|
|
1923
|
+
return {
|
|
1924
|
+
v: 2,
|
|
1925
|
+
widths: {
|
|
1926
|
+
...e.widths,
|
|
1927
|
+
...t.widths
|
|
1928
|
+
},
|
|
1929
|
+
resizeEduShown: e.resizeEduShown || t.resizeEduShown
|
|
1930
|
+
};
|
|
1931
|
+
}
|
|
1932
|
+
function Wn(e) {
|
|
1933
|
+
return Math.min(Fn, Math.max(60, Math.round(e)));
|
|
1934
|
+
}
|
|
1935
|
+
var Gn = ze((e) => ({
|
|
1936
|
+
...zn(),
|
|
1937
|
+
setScope: (e, t) => {
|
|
1938
|
+
In = e, Ln = t;
|
|
1939
|
+
},
|
|
1940
|
+
hydrate: () => {
|
|
1941
|
+
if (typeof window > "u") return;
|
|
1942
|
+
let t = Rn();
|
|
1943
|
+
if (!t) {
|
|
1944
|
+
e(zn());
|
|
1945
|
+
return;
|
|
1946
|
+
}
|
|
1947
|
+
let n = localStorage.getItem(t);
|
|
1948
|
+
e((n ? Vn(n) : null) ?? zn());
|
|
1949
|
+
},
|
|
1950
|
+
setWidth: (t, n, r) => {
|
|
1951
|
+
e((e) => {
|
|
1952
|
+
let i = {
|
|
1953
|
+
...e.widths[t] ?? {},
|
|
1954
|
+
[n]: Wn(r)
|
|
1955
|
+
}, a = {
|
|
1956
|
+
...e,
|
|
1957
|
+
widths: {
|
|
1958
|
+
...e.widths,
|
|
1959
|
+
[t]: i
|
|
1960
|
+
}
|
|
1961
|
+
};
|
|
1962
|
+
return Hn(a), a;
|
|
1963
|
+
});
|
|
1964
|
+
},
|
|
1965
|
+
setWidths: (t, n) => {
|
|
1966
|
+
e((e) => {
|
|
1967
|
+
let r = {};
|
|
1968
|
+
for (let [e, t] of Object.entries(n)) r[e] = Wn(t);
|
|
1969
|
+
let i = {
|
|
1970
|
+
...e.widths[t] ?? {},
|
|
1971
|
+
...r
|
|
1972
|
+
}, a = {
|
|
1973
|
+
...e,
|
|
1974
|
+
widths: {
|
|
1975
|
+
...e.widths,
|
|
1976
|
+
[t]: i
|
|
1977
|
+
}
|
|
1978
|
+
};
|
|
1979
|
+
return Hn(a), a;
|
|
1980
|
+
});
|
|
1981
|
+
},
|
|
1982
|
+
resetWidths: (t) => {
|
|
1983
|
+
e((e) => {
|
|
1984
|
+
let n = {
|
|
1985
|
+
...e,
|
|
1986
|
+
widths: {
|
|
1987
|
+
...e.widths,
|
|
1988
|
+
[t]: {}
|
|
1989
|
+
}
|
|
1990
|
+
};
|
|
1991
|
+
return Hn(n), n;
|
|
1992
|
+
});
|
|
1993
|
+
},
|
|
1994
|
+
prune: (t, n) => {
|
|
1995
|
+
let r = new Set(n);
|
|
1996
|
+
e((e) => {
|
|
1997
|
+
let n = e.widths[t];
|
|
1998
|
+
if (!n) return e;
|
|
1999
|
+
let i = {}, a = !1;
|
|
2000
|
+
for (let [e, t] of Object.entries(n)) r.has(e) ? i[e] = t : a = !0;
|
|
2001
|
+
if (!a) return e;
|
|
2002
|
+
let o = {
|
|
2003
|
+
...e,
|
|
2004
|
+
widths: {
|
|
2005
|
+
...e.widths,
|
|
2006
|
+
[t]: i
|
|
2007
|
+
}
|
|
2008
|
+
};
|
|
2009
|
+
return Hn(o), o;
|
|
2010
|
+
});
|
|
2011
|
+
},
|
|
2012
|
+
markResizeEduShown: () => {
|
|
2013
|
+
e((e) => {
|
|
2014
|
+
if (e.resizeEduShown) return e;
|
|
2015
|
+
let t = {
|
|
2016
|
+
...e,
|
|
2017
|
+
resizeEduShown: !0
|
|
2018
|
+
};
|
|
2019
|
+
return Hn(t), t;
|
|
2020
|
+
});
|
|
2021
|
+
}
|
|
2022
|
+
})), Kn = !1;
|
|
2023
|
+
function qn() {
|
|
2024
|
+
typeof window > "u" || Kn || (Kn = !0, window.addEventListener("storage", (e) => {
|
|
2025
|
+
let t = Rn();
|
|
2026
|
+
if (!t || e.key !== t || e.newValue == null) return;
|
|
2027
|
+
let n = Vn(e.newValue);
|
|
2028
|
+
n && Gn.setState((e) => Un(e, n));
|
|
2029
|
+
}));
|
|
2030
|
+
}
|
|
2031
|
+
var Jn = {}, Yn = () => {};
|
|
2032
|
+
function Xn(e) {
|
|
2033
|
+
let t = !!e && Rn() !== null, n = Gn((t) => e ? t.widths[e] : void 0), r = Gn((e) => e.resizeEduShown === !0), i = G((n, r) => {
|
|
2034
|
+
t && e && Gn.getState().setWidth(e, n, r);
|
|
2035
|
+
}, [t, e]), a = G((n) => {
|
|
2036
|
+
t && e && Gn.getState().setWidths(e, n);
|
|
2037
|
+
}, [t, e]), o = G(() => {
|
|
2038
|
+
t && e && Gn.getState().resetWidths(e);
|
|
2039
|
+
}, [t, e]), s = G((n) => {
|
|
2040
|
+
t && e && Gn.getState().prune(e, n);
|
|
2041
|
+
}, [t, e]), c = G(() => {
|
|
2042
|
+
t && Gn.getState().markResizeEduShown();
|
|
2043
|
+
}, [t]);
|
|
2044
|
+
return {
|
|
2045
|
+
widths: t ? n ?? Jn : Jn,
|
|
2046
|
+
resizeEduShown: r,
|
|
2047
|
+
setWidth: t ? i : Yn,
|
|
2048
|
+
setWidths: t ? a : Yn,
|
|
2049
|
+
resetWidths: t ? o : Yn,
|
|
2050
|
+
prune: t ? s : Yn,
|
|
2051
|
+
markResizeEduShown: t ? c : Yn
|
|
2052
|
+
};
|
|
2053
|
+
}
|
|
1871
2054
|
//#endregion
|
|
1872
2055
|
//#region src/hooks/useChildrenData.ts
|
|
1873
|
-
var
|
|
1874
|
-
function
|
|
2056
|
+
var Zn = "entity-children";
|
|
2057
|
+
function Qn(e, t, n, r, i, a) {
|
|
1875
2058
|
let o = Array.isArray(r) ? r : [r], s = Array.isArray(r) ? D(t, o.length) : [t];
|
|
1876
2059
|
return Le({
|
|
1877
2060
|
queryKey: [
|
|
1878
|
-
|
|
2061
|
+
Zn,
|
|
1879
2062
|
e,
|
|
1880
2063
|
t,
|
|
1881
2064
|
n,
|
|
@@ -1897,7 +2080,7 @@ function In(e, t, n, r, i, a) {
|
|
|
1897
2080
|
}
|
|
1898
2081
|
//#endregion
|
|
1899
2082
|
//#region src/stores/realtime.ts
|
|
1900
|
-
var
|
|
2083
|
+
var $n = ze((e, t) => ({
|
|
1901
2084
|
degradedEntities: /* @__PURE__ */ new Set(),
|
|
1902
2085
|
markDegraded: (n) => {
|
|
1903
2086
|
if (!n || t().degradedEntities.has(n)) return;
|
|
@@ -1905,15 +2088,15 @@ var Ln = ze((e, t) => ({
|
|
|
1905
2088
|
r.add(n), e({ degradedEntities: r });
|
|
1906
2089
|
}
|
|
1907
2090
|
}));
|
|
1908
|
-
function
|
|
2091
|
+
function er(e, t, n) {
|
|
1909
2092
|
return e === !0 && !t.has(n);
|
|
1910
2093
|
}
|
|
1911
2094
|
//#endregion
|
|
1912
2095
|
//#region src/hooks/useAssociatedData.ts
|
|
1913
|
-
function
|
|
2096
|
+
function tr(e, t, n, r, i, a, o, s) {
|
|
1914
2097
|
return Fe({
|
|
1915
2098
|
queryKey: [
|
|
1916
|
-
|
|
2099
|
+
Zn,
|
|
1917
2100
|
e,
|
|
1918
2101
|
t,
|
|
1919
2102
|
n,
|
|
@@ -1942,7 +2125,7 @@ function zn(e, t, n, r, i, a, o, s) {
|
|
|
1942
2125
|
}
|
|
1943
2126
|
//#endregion
|
|
1944
2127
|
//#region src/components/shared/ActionConfirmDialog.tsx
|
|
1945
|
-
function
|
|
2128
|
+
function nr({ open: t, onOpenChange: n, actionName: r, message: i, onConfirm: a, isPending: s }) {
|
|
1946
2129
|
let c = J(null);
|
|
1947
2130
|
return K(() => {
|
|
1948
2131
|
t && c.current?.focus();
|
|
@@ -2064,60 +2247,60 @@ function Bn({ open: t, onOpenChange: n, actionName: r, message: i, onConfirm: a,
|
|
|
2064
2247
|
}
|
|
2065
2248
|
//#endregion
|
|
2066
2249
|
//#region src/hooks/useMutations.ts
|
|
2067
|
-
function
|
|
2250
|
+
function rr(e) {
|
|
2068
2251
|
g.error(e.message);
|
|
2069
2252
|
}
|
|
2070
|
-
function
|
|
2071
|
-
e.invalidateQueries({ queryKey: ["entity-data", t] }), e.invalidateQueries({ queryKey: ["entity-count", t] }), n.item && e.invalidateQueries({ queryKey: ["entity-item", t] }), n.children && e.invalidateQueries({ queryKey: [
|
|
2253
|
+
function ir(e, t, n = {}) {
|
|
2254
|
+
e.invalidateQueries({ queryKey: ["entity-data", t] }), e.invalidateQueries({ queryKey: ["entity-count", t] }), n.item && e.invalidateQueries({ queryKey: ["entity-item", t] }), n.children && e.invalidateQueries({ queryKey: [Zn, t] }), n.objectMeta && (e.invalidateQueries({ queryKey: ["object-status", t] }), e.invalidateQueries({ queryKey: ["object-properties", t] }));
|
|
2072
2255
|
}
|
|
2073
|
-
function
|
|
2256
|
+
function ar(e) {
|
|
2074
2257
|
let t = Re();
|
|
2075
2258
|
return Ie({
|
|
2076
2259
|
mutationFn: (t) => re(e, t),
|
|
2077
2260
|
onSuccess: () => {
|
|
2078
|
-
|
|
2261
|
+
ir(t, e), g.success("Record created");
|
|
2079
2262
|
},
|
|
2080
|
-
onError:
|
|
2263
|
+
onError: rr
|
|
2081
2264
|
});
|
|
2082
2265
|
}
|
|
2083
|
-
function
|
|
2266
|
+
function or(e) {
|
|
2084
2267
|
let t = Re();
|
|
2085
2268
|
return Ie({
|
|
2086
2269
|
mutationFn: ({ pkValues: t, data: n }) => M(e, t, n),
|
|
2087
2270
|
onSuccess: () => {
|
|
2088
|
-
|
|
2271
|
+
ir(t, e, {
|
|
2089
2272
|
item: !0,
|
|
2090
2273
|
children: !0,
|
|
2091
2274
|
objectMeta: !0
|
|
2092
2275
|
}), g.success("Record updated");
|
|
2093
2276
|
},
|
|
2094
|
-
onError:
|
|
2277
|
+
onError: rr
|
|
2095
2278
|
});
|
|
2096
2279
|
}
|
|
2097
|
-
function
|
|
2280
|
+
function sr(e) {
|
|
2098
2281
|
let t = Re();
|
|
2099
2282
|
return Ie({
|
|
2100
2283
|
mutationFn: (t) => P(e, t),
|
|
2101
2284
|
onSuccess: () => {
|
|
2102
|
-
|
|
2285
|
+
ir(t, e, { item: !0 }), g.success("Record deleted");
|
|
2103
2286
|
},
|
|
2104
|
-
onError:
|
|
2287
|
+
onError: rr
|
|
2105
2288
|
});
|
|
2106
2289
|
}
|
|
2107
|
-
function
|
|
2290
|
+
function cr(e) {
|
|
2108
2291
|
let t = Re();
|
|
2109
2292
|
return Ie({
|
|
2110
2293
|
mutationFn: (t) => w(e, t),
|
|
2111
2294
|
onSuccess: () => {
|
|
2112
|
-
|
|
2295
|
+
ir(t, e, {
|
|
2113
2296
|
item: !0,
|
|
2114
2297
|
objectMeta: !0
|
|
2115
2298
|
}), g.success("Record restored");
|
|
2116
2299
|
},
|
|
2117
|
-
onError:
|
|
2300
|
+
onError: rr
|
|
2118
2301
|
});
|
|
2119
2302
|
}
|
|
2120
|
-
function
|
|
2303
|
+
function lr(e) {
|
|
2121
2304
|
let t = Re();
|
|
2122
2305
|
return Ie({
|
|
2123
2306
|
mutationFn: async ({ actionCode: e, body: t }) => {
|
|
@@ -2126,24 +2309,27 @@ function qn(e) {
|
|
|
2126
2309
|
return n;
|
|
2127
2310
|
},
|
|
2128
2311
|
onSuccess: (n) => {
|
|
2129
|
-
e &&
|
|
2312
|
+
e && ir(t, e, {
|
|
2130
2313
|
item: !0,
|
|
2131
2314
|
children: !0,
|
|
2132
2315
|
objectMeta: !0
|
|
2133
2316
|
}), n.status === "accepted" ? g.success("Action started - check audit for progress") : n.status === "partial" ? g.warning("Action partially completed - some items failed or were skipped") : g.success("Action executed");
|
|
2134
2317
|
},
|
|
2135
|
-
onError:
|
|
2318
|
+
onError: rr
|
|
2136
2319
|
});
|
|
2137
2320
|
}
|
|
2138
2321
|
//#endregion
|
|
2139
2322
|
//#region src/lib/actions.ts
|
|
2140
|
-
var
|
|
2323
|
+
var ur = {
|
|
2141
2324
|
__create: "create",
|
|
2142
2325
|
__edit: "update",
|
|
2143
2326
|
__delete: "delete",
|
|
2144
2327
|
__restore: "restore"
|
|
2145
|
-
};
|
|
2146
|
-
function
|
|
2328
|
+
}, dr = "__peek", fr = "__open";
|
|
2329
|
+
function pr(e) {
|
|
2330
|
+
return e === "__peek" || e === "__open";
|
|
2331
|
+
}
|
|
2332
|
+
function mr(e, t) {
|
|
2147
2333
|
if (!e) return "";
|
|
2148
2334
|
if (t) try {
|
|
2149
2335
|
return H(t, V(t, e));
|
|
@@ -2151,26 +2337,26 @@ function Yn(e, t) {
|
|
|
2151
2337
|
let n = e.id;
|
|
2152
2338
|
return typeof n == "string" ? n : n == null ? "" : x(n);
|
|
2153
2339
|
}
|
|
2154
|
-
function
|
|
2340
|
+
function hr(e, t) {
|
|
2155
2341
|
if (!e || e.length === 0) return !0;
|
|
2156
2342
|
for (let n of e) {
|
|
2157
2343
|
if (n.status && n.status.length > 0) {
|
|
2158
2344
|
let e = t.status;
|
|
2159
2345
|
if (typeof e != "string" || !n.status.includes(e)) return !1;
|
|
2160
2346
|
}
|
|
2161
|
-
if (n.field && !
|
|
2347
|
+
if (n.field && !gr(n, t)) return !1;
|
|
2162
2348
|
}
|
|
2163
2349
|
return !0;
|
|
2164
2350
|
}
|
|
2165
|
-
function
|
|
2166
|
-
let n =
|
|
2351
|
+
function gr(e, t) {
|
|
2352
|
+
let n = _r(t, e.field), r = e.op || "eq";
|
|
2167
2353
|
if (r === "in" || r === "not_in") {
|
|
2168
2354
|
let t = Array.isArray(e.value) ? e.value : [e.value], i = x(n), a = t.some((e) => x(e) === i);
|
|
2169
2355
|
return r === "in" ? a : !a;
|
|
2170
2356
|
}
|
|
2171
|
-
return typeof e.value == "boolean" && r === "eq" ?
|
|
2357
|
+
return typeof e.value == "boolean" && r === "eq" ? yr(n) === e.value : typeof n == "number" && typeof e.value == "number" ? br(n, e.value, r) : br(x(n), x(e.value), r);
|
|
2172
2358
|
}
|
|
2173
|
-
function
|
|
2359
|
+
function _r(e, t) {
|
|
2174
2360
|
if (Object.prototype.hasOwnProperty.call(e, t)) return e[t];
|
|
2175
2361
|
if (t.startsWith("$status.")) {
|
|
2176
2362
|
let n = t.slice(8), r = e.$statuses;
|
|
@@ -2181,27 +2367,27 @@ function Qn(e, t) {
|
|
|
2181
2367
|
return Array.isArray(r) ? r.find((e) => !e || typeof e != "object" ? !1 : e.property_code === n)?.value : void 0;
|
|
2182
2368
|
}
|
|
2183
2369
|
}
|
|
2184
|
-
function
|
|
2370
|
+
function vr(e) {
|
|
2185
2371
|
let t = null, n = (n, r) => {
|
|
2186
2372
|
Object.prototype.hasOwnProperty.call(e, n) || (t === null && (t = { ...e }), t[n] = r);
|
|
2187
2373
|
}, r = e.$statuses;
|
|
2188
2374
|
if (Array.isArray(r)) for (let t of r) {
|
|
2189
2375
|
if (!t || typeof t != "object") continue;
|
|
2190
2376
|
let r = t.group_code;
|
|
2191
|
-
typeof r == "string" && n(`$status.${r}`,
|
|
2377
|
+
typeof r == "string" && n(`$status.${r}`, _r(e, `$status.${r}`));
|
|
2192
2378
|
}
|
|
2193
2379
|
let i = e.$properties;
|
|
2194
2380
|
if (Array.isArray(i)) for (let t of i) {
|
|
2195
2381
|
if (!t || typeof t != "object") continue;
|
|
2196
2382
|
let r = t.property_code;
|
|
2197
|
-
typeof r == "string" && n(`$property.${r}`,
|
|
2383
|
+
typeof r == "string" && n(`$property.${r}`, _r(e, `$property.${r}`));
|
|
2198
2384
|
}
|
|
2199
2385
|
return t ?? e;
|
|
2200
2386
|
}
|
|
2201
|
-
function
|
|
2387
|
+
function yr(e) {
|
|
2202
2388
|
return e == null ? !1 : typeof e == "boolean" ? e : typeof e == "string" ? e !== "" : typeof e != "number" || e !== 0;
|
|
2203
2389
|
}
|
|
2204
|
-
function
|
|
2390
|
+
function br(e, t, n) {
|
|
2205
2391
|
switch (n) {
|
|
2206
2392
|
case "eq": return e === t;
|
|
2207
2393
|
case "ne": return e !== t;
|
|
@@ -2214,14 +2400,14 @@ function tr(e, t, n) {
|
|
|
2214
2400
|
default: return !1;
|
|
2215
2401
|
}
|
|
2216
2402
|
}
|
|
2217
|
-
function
|
|
2403
|
+
function xr(e, t) {
|
|
2218
2404
|
return e ? Object.entries(e).filter(([, e]) => e.visibility?.includes(t)).map(([e, t]) => ({
|
|
2219
2405
|
code: e,
|
|
2220
2406
|
action: t
|
|
2221
2407
|
})) : [];
|
|
2222
2408
|
}
|
|
2223
|
-
function
|
|
2224
|
-
return !e && !r ? [] : t === void 0 ?
|
|
2409
|
+
function Sr(e, t, n, r) {
|
|
2410
|
+
return !e && !r ? [] : t === void 0 ? xr(e, n) : t.map((t) => {
|
|
2225
2411
|
let n = e?.[t] ?? r?.[t];
|
|
2226
2412
|
return n ? {
|
|
2227
2413
|
code: t,
|
|
@@ -2229,25 +2415,25 @@ function rr(e, t, n, r) {
|
|
|
2229
2415
|
} : null;
|
|
2230
2416
|
}).filter((e) => e !== null);
|
|
2231
2417
|
}
|
|
2232
|
-
function
|
|
2418
|
+
function Cr(e, t) {
|
|
2233
2419
|
return e.filter(({ code: e }) => {
|
|
2234
|
-
let n =
|
|
2420
|
+
let n = ur[e];
|
|
2235
2421
|
return !n || y(t, n);
|
|
2236
2422
|
});
|
|
2237
2423
|
}
|
|
2238
|
-
function
|
|
2424
|
+
function wr(e) {
|
|
2239
2425
|
let t = e.resolved_params;
|
|
2240
2426
|
return t ? t.length > 0 : !1;
|
|
2241
2427
|
}
|
|
2242
|
-
function
|
|
2428
|
+
function Tr(e, t, n, r) {
|
|
2243
2429
|
if (n && r) return r;
|
|
2244
2430
|
let i = W(e?.display?.description);
|
|
2245
2431
|
return i ? e?.display?.icon_only === !0 ? `${t} - ${i}` : i : t;
|
|
2246
2432
|
}
|
|
2247
|
-
function
|
|
2433
|
+
function Er(e) {
|
|
2248
2434
|
return !!e.association;
|
|
2249
2435
|
}
|
|
2250
|
-
function
|
|
2436
|
+
function Dr(e, t) {
|
|
2251
2437
|
if (e) {
|
|
2252
2438
|
for (let n of Object.values(e.screens)) if (n.entity === t && n.type === "list") {
|
|
2253
2439
|
let r = e.entities[t];
|
|
@@ -2258,21 +2444,21 @@ function cr(e, t) {
|
|
|
2258
2444
|
}
|
|
2259
2445
|
}
|
|
2260
2446
|
}
|
|
2261
|
-
function
|
|
2447
|
+
function Or(e, t, n, r, i) {
|
|
2262
2448
|
let a = [];
|
|
2263
2449
|
for (let o of e) {
|
|
2264
|
-
let e =
|
|
2450
|
+
let e = kr(o, t, n, r, i);
|
|
2265
2451
|
e !== null && a.push(e);
|
|
2266
2452
|
}
|
|
2267
2453
|
return a;
|
|
2268
2454
|
}
|
|
2269
|
-
function
|
|
2270
|
-
return e.kind === "group" ?
|
|
2455
|
+
function kr(e, t, n, r, i) {
|
|
2456
|
+
return e.kind === "group" ? Ar(e, t, n, r, i) : jr(e, t, n, r, i);
|
|
2271
2457
|
}
|
|
2272
|
-
function
|
|
2458
|
+
function Ar(e, t, n, r, i) {
|
|
2273
2459
|
let a = [];
|
|
2274
2460
|
for (let o of e.items) {
|
|
2275
|
-
let e =
|
|
2461
|
+
let e = kr(o, t, n, r, i);
|
|
2276
2462
|
e !== null && a.push(e);
|
|
2277
2463
|
}
|
|
2278
2464
|
return a.length === 0 ? null : {
|
|
@@ -2280,58 +2466,58 @@ function dr(e, t, n, r, i) {
|
|
|
2280
2466
|
items: a
|
|
2281
2467
|
};
|
|
2282
2468
|
}
|
|
2283
|
-
function
|
|
2284
|
-
let a =
|
|
2469
|
+
function jr(e, t, n, r, i) {
|
|
2470
|
+
let a = Pr(e.code, t, n);
|
|
2285
2471
|
if (!a) return null;
|
|
2286
2472
|
if (i.length > 0) {
|
|
2287
|
-
let t =
|
|
2473
|
+
let t = Mr(a, i);
|
|
2288
2474
|
return t.visible ? {
|
|
2289
2475
|
...e,
|
|
2290
2476
|
enabled: t.enabled,
|
|
2291
2477
|
reason: t.reason
|
|
2292
2478
|
} : null;
|
|
2293
2479
|
}
|
|
2294
|
-
if (!
|
|
2295
|
-
let { enabled: o, reason: s } =
|
|
2480
|
+
if (!hr(a.conditions, r) || !hr(Fr(a.visible_if), r)) return null;
|
|
2481
|
+
let { enabled: o, reason: s } = Nr(a, r);
|
|
2296
2482
|
return {
|
|
2297
2483
|
...e,
|
|
2298
2484
|
enabled: o,
|
|
2299
2485
|
reason: s
|
|
2300
2486
|
};
|
|
2301
2487
|
}
|
|
2302
|
-
function
|
|
2303
|
-
let n =
|
|
2488
|
+
function Mr(e, t) {
|
|
2489
|
+
let n = Fr(e.visible_if), r = Fr(e.enabled_if), i = e.conditions, a = Ir(e.enabled_if_reason), o = 0, s = 0;
|
|
2304
2490
|
for (let e of t) {
|
|
2305
|
-
let t =
|
|
2306
|
-
t &&
|
|
2307
|
-
let
|
|
2308
|
-
(!t || !
|
|
2491
|
+
let t = hr(n, e) && hr(i, e);
|
|
2492
|
+
t && o++;
|
|
2493
|
+
let a = hr(r, e);
|
|
2494
|
+
(!t || !a) && s++;
|
|
2309
2495
|
}
|
|
2310
|
-
if (
|
|
2496
|
+
if (o === 0) return {
|
|
2311
2497
|
visible: !1,
|
|
2312
2498
|
enabled: !1,
|
|
2313
2499
|
reason: null
|
|
2314
2500
|
};
|
|
2315
|
-
if (
|
|
2501
|
+
if (s === 0) return {
|
|
2316
2502
|
visible: !0,
|
|
2317
2503
|
enabled: !0,
|
|
2318
2504
|
reason: null
|
|
2319
2505
|
};
|
|
2320
|
-
let
|
|
2506
|
+
let c = `(${s} of ${t.length} rows fail)`;
|
|
2321
2507
|
return {
|
|
2322
2508
|
visible: !0,
|
|
2323
2509
|
enabled: !1,
|
|
2324
|
-
reason:
|
|
2510
|
+
reason: a ? `${a} ${c}` : c
|
|
2325
2511
|
};
|
|
2326
2512
|
}
|
|
2327
|
-
function
|
|
2328
|
-
let n =
|
|
2513
|
+
function Nr(e, t) {
|
|
2514
|
+
let n = Fr(e.enabled_if);
|
|
2329
2515
|
if (!n || n.length === 0) return {
|
|
2330
2516
|
enabled: !0,
|
|
2331
2517
|
reason: null
|
|
2332
2518
|
};
|
|
2333
|
-
let r =
|
|
2334
|
-
return
|
|
2519
|
+
let r = Ir(e.enabled_if_reason);
|
|
2520
|
+
return hr(n, t) ? {
|
|
2335
2521
|
enabled: !0,
|
|
2336
2522
|
reason: null
|
|
2337
2523
|
} : {
|
|
@@ -2339,52 +2525,52 @@ function mr(e, t) {
|
|
|
2339
2525
|
reason: r
|
|
2340
2526
|
};
|
|
2341
2527
|
}
|
|
2342
|
-
function
|
|
2528
|
+
function Pr(e, t, n) {
|
|
2343
2529
|
if (t && e in t) return t[e];
|
|
2344
2530
|
if (n && e in n) return n[e];
|
|
2345
2531
|
}
|
|
2346
|
-
function
|
|
2532
|
+
function Fr(e) {
|
|
2347
2533
|
return e;
|
|
2348
2534
|
}
|
|
2349
|
-
function
|
|
2535
|
+
function Ir(e) {
|
|
2350
2536
|
if (!e) return null;
|
|
2351
2537
|
if (e.en) return e.en;
|
|
2352
2538
|
let t = Object.values(e);
|
|
2353
2539
|
return t.length > 0 ? t[0] : null;
|
|
2354
2540
|
}
|
|
2355
|
-
function
|
|
2541
|
+
function Lr(e, t, n, r, i) {
|
|
2356
2542
|
let a = [];
|
|
2357
2543
|
for (let o of e) {
|
|
2358
2544
|
if (o.kind === "group") {
|
|
2359
|
-
let e =
|
|
2545
|
+
let e = Lr(o.items, t, n, r, i);
|
|
2360
2546
|
e.length > 0 && a.push({
|
|
2361
2547
|
...o,
|
|
2362
2548
|
items: e
|
|
2363
2549
|
});
|
|
2364
2550
|
continue;
|
|
2365
2551
|
}
|
|
2366
|
-
let e =
|
|
2552
|
+
let e = Pr(o.code, t, n);
|
|
2367
2553
|
e && e.visibility?.includes(r) && (i?.bulkRequired !== void 0 && (i.bulkRequiredPredicate ? i.bulkRequiredPredicate(e) : !1) !== i.bulkRequired || i?.excludeIf && i.excludeIf(e) || a.push(o));
|
|
2368
2554
|
}
|
|
2369
2555
|
return a;
|
|
2370
2556
|
}
|
|
2371
|
-
function
|
|
2557
|
+
function Rr(e, t, n, r, i, a) {
|
|
2372
2558
|
let o = e ?? t;
|
|
2373
|
-
return o ?
|
|
2559
|
+
return o ? Lr(o, n, r, i, a) : Hr(n, i);
|
|
2374
2560
|
}
|
|
2375
|
-
function
|
|
2376
|
-
return e.requires_selection === void 0 ?
|
|
2561
|
+
function zr(e) {
|
|
2562
|
+
return e.requires_selection === void 0 ? Br(e) : e.requires_selection;
|
|
2377
2563
|
}
|
|
2378
|
-
function
|
|
2564
|
+
function Br(e) {
|
|
2379
2565
|
return e.visibility?.includes("list_floatbar") ?? !1;
|
|
2380
2566
|
}
|
|
2381
|
-
function
|
|
2567
|
+
function Vr(e, t, n, r, i) {
|
|
2382
2568
|
return e.map((e) => {
|
|
2383
2569
|
if (e.kind === "group") return {
|
|
2384
2570
|
...e,
|
|
2385
|
-
items:
|
|
2571
|
+
items: Vr(e.items, t, n, r, i)
|
|
2386
2572
|
};
|
|
2387
|
-
let a =
|
|
2573
|
+
let a = Pr(e.code, t, n);
|
|
2388
2574
|
return a && r(a) ? {
|
|
2389
2575
|
...e,
|
|
2390
2576
|
enabled: !1,
|
|
@@ -2392,7 +2578,7 @@ function Sr(e, t, n, r, i) {
|
|
|
2392
2578
|
} : e;
|
|
2393
2579
|
});
|
|
2394
2580
|
}
|
|
2395
|
-
function
|
|
2581
|
+
function Hr(e, t) {
|
|
2396
2582
|
return e ? Object.entries(e).filter(([, e]) => e.visibility?.includes(t)).sort(([e, t], [n, r]) => {
|
|
2397
2583
|
let i = t.position ?? 0, a = r.position ?? 0;
|
|
2398
2584
|
return i === a ? e < n ? -1 : +(e > n) : i - a;
|
|
@@ -2405,12 +2591,12 @@ function Cr(e, t) {
|
|
|
2405
2591
|
}
|
|
2406
2592
|
//#endregion
|
|
2407
2593
|
//#region src/components/shared/ActionButton.tsx
|
|
2408
|
-
function
|
|
2409
|
-
let [h, _] = Y(!1), [y, b] = Y(!1), [x, S] = Y(!1), [C, w] = Y(null), T =
|
|
2594
|
+
function Ur({ actionCode: n, action: r, entityCode: i, objectIds: a = [], row: s, variant: c = "outline", size: u = "default", onSuccess: d, onBatchStart: f, onBatchError: p, onBatchPartial: m }) {
|
|
2595
|
+
let [h, _] = Y(!1), [y, b] = Y(!1), [x, S] = Y(!1), [C, w] = Y(null), T = lr(i), { data: D } = A(), O = It(), k = Er(r), j = wr(r), M = !!r.confirmation && Object.keys(r.confirmation).length > 0, N = !s || hr(r.conditions, s), P = G(async () => {
|
|
2410
2596
|
if (!(!r.association || a.length === 0)) {
|
|
2411
2597
|
S(!0);
|
|
2412
2598
|
try {
|
|
2413
|
-
let e = await ae(i ? `${i}.${r.association}` : r.association, a), t =
|
|
2599
|
+
let e = await ae(i ? `${i}.${r.association}` : r.association, a), t = Dr(D, e.target_entity);
|
|
2414
2600
|
if (!t) {
|
|
2415
2601
|
g.error(`No list screen found for ${e.target_entity}`);
|
|
2416
2602
|
return;
|
|
@@ -2464,7 +2650,7 @@ function wr({ actionCode: n, action: r, entityCode: i, objectIds: a = [], row: s
|
|
|
2464
2650
|
return;
|
|
2465
2651
|
}
|
|
2466
2652
|
if (r.href && !r.handler && !r.association) {
|
|
2467
|
-
let e =
|
|
2653
|
+
let e = mr(s, i ? D?.entities[i] : void 0), t = r.href;
|
|
2468
2654
|
i && (t = t.replaceAll("${entity}", i)), e && (t = t.replaceAll("${id}", encodeURIComponent(e))), O(t, {
|
|
2469
2655
|
title: W(r.display?.name) || n,
|
|
2470
2656
|
icon: r.display?.icon
|
|
@@ -2560,7 +2746,7 @@ function wr({ actionCode: n, action: r, entityCode: i, objectIds: a = [], row: s
|
|
|
2560
2746
|
isPending: T.isPending,
|
|
2561
2747
|
row: s
|
|
2562
2748
|
}),
|
|
2563
|
-
M && /* @__PURE__ */ Z(
|
|
2749
|
+
M && /* @__PURE__ */ Z(nr, {
|
|
2564
2750
|
open: y,
|
|
2565
2751
|
onOpenChange: b,
|
|
2566
2752
|
actionName: H,
|
|
@@ -2578,150 +2764,21 @@ function wr({ actionCode: n, action: r, entityCode: i, objectIds: a = [], row: s
|
|
|
2578
2764
|
] });
|
|
2579
2765
|
}
|
|
2580
2766
|
//#endregion
|
|
2581
|
-
//#region src/components/shared/RowActionsKebab.tsx
|
|
2582
|
-
function Tr({ actions: t, objectIds: n, row: r, onSuccess: i, preMenu: a, divider: c, size: l = 22, align: u = "end" }) {
|
|
2583
|
-
let d = J(null), [f, m] = Y(!1), { run: h } = N();
|
|
2584
|
-
if (!a && t.length === 0) return null;
|
|
2585
|
-
let g = (e) => () => {
|
|
2586
|
-
m(!1), e();
|
|
2587
|
-
};
|
|
2588
|
-
return /* @__PURE__ */ Q("div", {
|
|
2589
|
-
className: "sl-row-actions",
|
|
2590
|
-
"data-open": f ? "true" : void 0,
|
|
2591
|
-
style: {
|
|
2592
|
-
display: "flex",
|
|
2593
|
-
alignItems: "center",
|
|
2594
|
-
justifyContent: "flex-end"
|
|
2595
|
-
},
|
|
2596
|
-
children: [/* @__PURE__ */ Z(o, {
|
|
2597
|
-
ref: d,
|
|
2598
|
-
size: l,
|
|
2599
|
-
icon: /* @__PURE__ */ Z(e.more, { size: Math.round(l * .55) }),
|
|
2600
|
-
onClick: () => m((e) => !e),
|
|
2601
|
-
title: "Actions"
|
|
2602
|
-
}), /* @__PURE__ */ Q(s, {
|
|
2603
|
-
open: f,
|
|
2604
|
-
anchor: d.current,
|
|
2605
|
-
onClose: () => m(!1),
|
|
2606
|
-
width: 200,
|
|
2607
|
-
align: u,
|
|
2608
|
-
children: [
|
|
2609
|
-
a,
|
|
2610
|
-
a && c && t.length > 0 && /* @__PURE__ */ Z(p, { divider: !0 }),
|
|
2611
|
-
t.map(({ code: t, action: a }) => {
|
|
2612
|
-
let o = !r || Xn(a.conditions, r), s = W(a.display?.name) || t, c = a.display?.icon, l = c && e[c] ? e[c] : void 0;
|
|
2613
|
-
return /* @__PURE__ */ Z(p, {
|
|
2614
|
-
icon: l ? /* @__PURE__ */ Z(l, { size: 12 }) : null,
|
|
2615
|
-
danger: a.destructive,
|
|
2616
|
-
onClick: g(() => {
|
|
2617
|
-
if (!o) return;
|
|
2618
|
-
let e = a.entity ? `${a.entity}.${t}` : t;
|
|
2619
|
-
h({
|
|
2620
|
-
action: a,
|
|
2621
|
-
title: s,
|
|
2622
|
-
execute: async (t) => {
|
|
2623
|
-
let r = await te(e, B(t, n));
|
|
2624
|
-
return i?.(), r;
|
|
2625
|
-
}
|
|
2626
|
-
});
|
|
2627
|
-
}),
|
|
2628
|
-
children: s
|
|
2629
|
-
}, t);
|
|
2630
|
-
})
|
|
2631
|
-
]
|
|
2632
|
-
})]
|
|
2633
|
-
});
|
|
2634
|
-
}
|
|
2635
|
-
//#endregion
|
|
2636
|
-
//#region src/components/detail-layout/AssociatedToolbar.tsx
|
|
2637
|
-
function Er({ entity: t, searchable: n, filterFields: r, searchValue: i, onSearchChange: a, filters: o, onFilterChange: s, allEntities: c }) {
|
|
2638
|
-
let l = n === !0, u = r && r.length > 0;
|
|
2639
|
-
return !l && !u ? null : /* @__PURE__ */ Q("div", {
|
|
2640
|
-
style: {
|
|
2641
|
-
display: "flex",
|
|
2642
|
-
alignItems: "center",
|
|
2643
|
-
gap: 6,
|
|
2644
|
-
marginBottom: 8
|
|
2645
|
-
},
|
|
2646
|
-
children: [l && /* @__PURE__ */ Z("div", {
|
|
2647
|
-
style: {
|
|
2648
|
-
flex: 1,
|
|
2649
|
-
maxWidth: 220
|
|
2650
|
-
},
|
|
2651
|
-
children: /* @__PURE__ */ Z(I, {
|
|
2652
|
-
value: i,
|
|
2653
|
-
onChange: a,
|
|
2654
|
-
placeholder: "Search…",
|
|
2655
|
-
prefix: /* @__PURE__ */ Z(e.search, { size: 12 })
|
|
2656
|
-
})
|
|
2657
|
-
}), u && r.map((e) => {
|
|
2658
|
-
let n = t.fields.get(e);
|
|
2659
|
-
if (!n) return null;
|
|
2660
|
-
let r = o[e] ?? "__all__", i = ie(n, e, c);
|
|
2661
|
-
return n.type === "ref" && n.ref?.entity ? /* @__PURE__ */ Z(Dr, {
|
|
2662
|
-
field: n,
|
|
2663
|
-
label: i,
|
|
2664
|
-
value: r,
|
|
2665
|
-
onChange: (t) => s(e, t)
|
|
2666
|
-
}, e) : n.values ? /* @__PURE__ */ Z("div", {
|
|
2667
|
-
style: { width: 160 },
|
|
2668
|
-
children: /* @__PURE__ */ Z(f, {
|
|
2669
|
-
value: r,
|
|
2670
|
-
options: [{
|
|
2671
|
-
value: "__all__",
|
|
2672
|
-
label: `All ${i}`
|
|
2673
|
-
}, ...n.values.map((e) => ({
|
|
2674
|
-
value: e.code,
|
|
2675
|
-
label: W(e.name) || e.code
|
|
2676
|
-
}))],
|
|
2677
|
-
onChange: (t) => s(e, t),
|
|
2678
|
-
placeholder: i
|
|
2679
|
-
})
|
|
2680
|
-
}, e) : null;
|
|
2681
|
-
})]
|
|
2682
|
-
});
|
|
2683
|
-
}
|
|
2684
|
-
function Dr({ field: e, label: t, value: n, onChange: r }) {
|
|
2685
|
-
let i = F(e.ref?.entity), o = e.display?.ref_display_field ?? i?.display?.display_field, s = q(() => i ? [...i.fields].find(([, e]) => e.primary)?.[0] ?? "id" : "id", [i]), { data: c } = a(e.ref?.entity, {
|
|
2686
|
-
per_page: 200,
|
|
2687
|
-
sort: o ? `${o}:asc` : void 0
|
|
2688
|
-
}), l = c?.data ?? [], u = (e) => {
|
|
2689
|
-
if (e == null) return "—";
|
|
2690
|
-
if (typeof e == "object" && !Array.isArray(e)) {
|
|
2691
|
-
let t = Object.values(e)[0];
|
|
2692
|
-
return t == null ? "—" : x(t);
|
|
2693
|
-
}
|
|
2694
|
-
return x(e);
|
|
2695
|
-
};
|
|
2696
|
-
return /* @__PURE__ */ Z("div", {
|
|
2697
|
-
style: { width: 160 },
|
|
2698
|
-
children: /* @__PURE__ */ Z(f, {
|
|
2699
|
-
value: n,
|
|
2700
|
-
options: [{
|
|
2701
|
-
value: "__all__",
|
|
2702
|
-
label: `All ${t}`
|
|
2703
|
-
}, ...l.map((e) => {
|
|
2704
|
-
let t = String(e[s]), n = e[T];
|
|
2705
|
-
return {
|
|
2706
|
-
value: t,
|
|
2707
|
-
label: typeof n == "string" && n !== "" ? n : o ? u(e[o] ?? t) : t
|
|
2708
|
-
};
|
|
2709
|
-
})],
|
|
2710
|
-
onChange: r,
|
|
2711
|
-
placeholder: t
|
|
2712
|
-
})
|
|
2713
|
-
});
|
|
2714
|
-
}
|
|
2715
|
-
//#endregion
|
|
2716
2767
|
//#region src/components/shared/ResponsiveActionBar.tsx
|
|
2717
|
-
function
|
|
2768
|
+
function Wr(e, t) {
|
|
2718
2769
|
return e.replace(/\$\{([^}]+)\}/g, (e, n) => Object.prototype.hasOwnProperty.call(t, n) ? t[n] : e);
|
|
2719
2770
|
}
|
|
2720
|
-
function
|
|
2771
|
+
function Gr(e) {
|
|
2721
2772
|
return e.widget ? "widget" : e.href ? "href" : e.handler ? "handler" : e.association ? "association" : e.ui_steps && e.ui_steps.length > 0 ? "ui_steps" : "unknown";
|
|
2722
2773
|
}
|
|
2723
|
-
function
|
|
2724
|
-
let a =
|
|
2774
|
+
function Kr(e, t, n, r, i) {
|
|
2775
|
+
let a = Gr(t), o = mr(n, r?.entity), s = r?.entityCode ?? "";
|
|
2776
|
+
if (e === "__peek") return i?.({
|
|
2777
|
+
code: e,
|
|
2778
|
+
entity: s,
|
|
2779
|
+
mode: "peek",
|
|
2780
|
+
rowId: o
|
|
2781
|
+
}), r?.openPeek?.(n), !0;
|
|
2725
2782
|
if (i?.({
|
|
2726
2783
|
code: e,
|
|
2727
2784
|
entity: s,
|
|
@@ -2729,7 +2786,7 @@ function Ar(e, t, n, r, i) {
|
|
|
2729
2786
|
rowId: o
|
|
2730
2787
|
}), a === "widget") return console.warn(`[ResponsiveActionBar] widget "${t.widget}" requested for action "${e}" but the widget registry ships in Phase 2; falling back to onRun.`), !1;
|
|
2731
2788
|
if (a === "href" && r) {
|
|
2732
|
-
let e =
|
|
2789
|
+
let e = Wr(t.href ?? "", {
|
|
2733
2790
|
entity: s,
|
|
2734
2791
|
id: encodeURIComponent(o)
|
|
2735
2792
|
}), n = e.indexOf("?");
|
|
@@ -2737,27 +2794,27 @@ function Ar(e, t, n, r, i) {
|
|
|
2737
2794
|
}
|
|
2738
2795
|
return a === "handler" || a === "association" || a === "ui_steps" || a === "unknown" && console.warn(`[ResponsiveActionBar] no dispatch mode set on action "${e}" (none of handler/association/widget/href/ui_steps).`), !1;
|
|
2739
2796
|
}
|
|
2740
|
-
function
|
|
2797
|
+
function qr(e) {
|
|
2741
2798
|
let t = 0;
|
|
2742
|
-
for (let n of e) n.kind === "action" ? t++ : t +=
|
|
2799
|
+
for (let n of e) n.kind === "action" ? t++ : t += qr(n.items);
|
|
2743
2800
|
return t;
|
|
2744
2801
|
}
|
|
2745
|
-
function
|
|
2802
|
+
function Jr(e, t, n) {
|
|
2746
2803
|
let r = [], i = [];
|
|
2747
|
-
for (let a of e) a.kind === "action" &&
|
|
2804
|
+
for (let a of e) a.kind === "action" && Xr(a.code, t, n)?.destructive ? i.push(a) : r.push(a);
|
|
2748
2805
|
return {
|
|
2749
2806
|
normal: r,
|
|
2750
2807
|
destructive: i
|
|
2751
2808
|
};
|
|
2752
2809
|
}
|
|
2753
|
-
function
|
|
2810
|
+
function Yr(e, t, n) {
|
|
2754
2811
|
let r = [], i = [], a = [];
|
|
2755
2812
|
for (let o of e) {
|
|
2756
2813
|
if (o.kind !== "action") {
|
|
2757
2814
|
i.push(o);
|
|
2758
2815
|
continue;
|
|
2759
2816
|
}
|
|
2760
|
-
let e =
|
|
2817
|
+
let e = Xr(o.code, t, n), s = e?.destructive === !0, c = e?.display?.primary === !0;
|
|
2761
2818
|
if (s && c) {
|
|
2762
2819
|
console.warn(`[ResponsiveActionBar] action "${o.code}" declares both primary and destructive; treating as destructive.`), a.push(o);
|
|
2763
2820
|
continue;
|
|
@@ -2778,25 +2835,25 @@ function Nr(e, t, n) {
|
|
|
2778
2835
|
destructive: a
|
|
2779
2836
|
};
|
|
2780
2837
|
}
|
|
2781
|
-
function
|
|
2838
|
+
function Xr(e, t, n) {
|
|
2782
2839
|
if (t && e in t) return t[e];
|
|
2783
2840
|
if (n && e in n) return n[e];
|
|
2784
2841
|
}
|
|
2785
|
-
function
|
|
2786
|
-
return W(
|
|
2842
|
+
function Zr(e, t, n) {
|
|
2843
|
+
return W(Xr(e, t, n)?.display?.name) || e;
|
|
2787
2844
|
}
|
|
2788
|
-
function
|
|
2789
|
-
return
|
|
2845
|
+
function Qr(e, t, n) {
|
|
2846
|
+
return Xr(e, t, n)?.display?.icon || void 0;
|
|
2790
2847
|
}
|
|
2791
|
-
function
|
|
2848
|
+
function $r(e) {
|
|
2792
2849
|
return `action-tooltip-${e}`;
|
|
2793
2850
|
}
|
|
2794
|
-
function
|
|
2795
|
-
let m =
|
|
2851
|
+
function ei({ leaf: e, entityActions: n, globalActions: r, onRun: i, loading: a, onLoadingChange: o, measureRef: s, style: c, row: d, widgetContext: f, onActionClick: p }) {
|
|
2852
|
+
let m = Xr(e.code, n, r), h = Zr(e.code, n, r), g = Qr(e.code, n, r), _ = m?.destructive ?? !1, v = !_ && m?.display?.primary === !0, y = !e.enabled, b = y ? $r(e.code) : void 0, x = G(async () => {
|
|
2796
2853
|
if (!(!m || y || a)) {
|
|
2797
2854
|
o(!0);
|
|
2798
2855
|
try {
|
|
2799
|
-
|
|
2856
|
+
Kr(e.code, m, d, f, p) || await Promise.resolve(i(e.code, m));
|
|
2800
2857
|
} finally {
|
|
2801
2858
|
o(!1);
|
|
2802
2859
|
}
|
|
@@ -2834,13 +2891,13 @@ function Rr({ leaf: e, entityActions: n, globalActions: r, onRun: i, loading: a,
|
|
|
2834
2891
|
disabled: y || a,
|
|
2835
2892
|
"aria-disabled": y ? "true" : void 0,
|
|
2836
2893
|
"aria-describedby": b,
|
|
2837
|
-
title:
|
|
2894
|
+
title: Tr(m, h, y, e.reason),
|
|
2838
2895
|
onClick: x,
|
|
2839
2896
|
style: c,
|
|
2840
2897
|
children: h
|
|
2841
2898
|
})] });
|
|
2842
2899
|
}
|
|
2843
|
-
function
|
|
2900
|
+
function ti({ group: n, entityActions: r, globalActions: i, onRun: a, loading: o, onLoadingChange: c, measureRef: d, style: f, row: p, widgetContext: m, onActionClick: h }) {
|
|
2844
2901
|
let g = J(null), [_, v] = Y(!1), y = n.name ? W(n.name) : "Actions", b = G((e) => {
|
|
2845
2902
|
g.current = e, d?.(e);
|
|
2846
2903
|
}, [d]), x = G((e, t) => (v(!1), a(e, t)), [a]);
|
|
@@ -2867,7 +2924,7 @@ function zr({ group: n, entityActions: r, globalActions: i, onRun: a, loading: o
|
|
|
2867
2924
|
children: /* @__PURE__ */ Z("div", {
|
|
2868
2925
|
role: "menu",
|
|
2869
2926
|
"aria-label": y,
|
|
2870
|
-
children: n.items.map((e) => e.kind === "action" ? /* @__PURE__ */ Z(
|
|
2927
|
+
children: n.items.map((e) => e.kind === "action" ? /* @__PURE__ */ Z(ni, {
|
|
2871
2928
|
leaf: e,
|
|
2872
2929
|
entityActions: r,
|
|
2873
2930
|
globalActions: i,
|
|
@@ -2877,7 +2934,7 @@ function zr({ group: n, entityActions: r, globalActions: i, onRun: a, loading: o
|
|
|
2877
2934
|
row: p,
|
|
2878
2935
|
widgetContext: m,
|
|
2879
2936
|
onActionClick: h
|
|
2880
|
-
}, e.code) : /* @__PURE__ */ Z(
|
|
2937
|
+
}, e.code) : /* @__PURE__ */ Z(ri, {
|
|
2881
2938
|
group: e,
|
|
2882
2939
|
entityActions: r,
|
|
2883
2940
|
globalActions: i,
|
|
@@ -2891,8 +2948,8 @@ function zr({ group: n, entityActions: r, globalActions: i, onRun: a, loading: o
|
|
|
2891
2948
|
})
|
|
2892
2949
|
})] });
|
|
2893
2950
|
}
|
|
2894
|
-
function
|
|
2895
|
-
let d =
|
|
2951
|
+
function ni({ leaf: e, entityActions: n, globalActions: r, onRun: i, loading: a, onLoadingChange: o, row: s, widgetContext: c, onActionClick: l }) {
|
|
2952
|
+
let d = Xr(e.code, n, r), f = Zr(e.code, n, r), p = Qr(e.code, n, r), m = d?.destructive ?? !1, h = !e.enabled, g = h ? $r(e.code) : void 0, _ = a ? /* @__PURE__ */ Z(u, { size: 12 }) : p ? /* @__PURE__ */ Z(t, {
|
|
2896
2953
|
name: p,
|
|
2897
2954
|
size: 12
|
|
2898
2955
|
}) : null;
|
|
@@ -2911,12 +2968,12 @@ function Br({ leaf: e, entityActions: n, globalActions: r, onRun: i, loading: a,
|
|
|
2911
2968
|
role: "menuitem",
|
|
2912
2969
|
"aria-disabled": h ? "true" : void 0,
|
|
2913
2970
|
"aria-describedby": g,
|
|
2914
|
-
title:
|
|
2971
|
+
title: Tr(d, f, h, e.reason),
|
|
2915
2972
|
onClick: async () => {
|
|
2916
2973
|
if (!(!d || h || a)) {
|
|
2917
2974
|
o(!0);
|
|
2918
2975
|
try {
|
|
2919
|
-
|
|
2976
|
+
Kr(e.code, d, s, c, l) || await Promise.resolve(i(e.code, d));
|
|
2920
2977
|
} finally {
|
|
2921
2978
|
o(!1);
|
|
2922
2979
|
}
|
|
@@ -2951,7 +3008,7 @@ function Br({ leaf: e, entityActions: n, globalActions: r, onRun: i, loading: a,
|
|
|
2951
3008
|
})]
|
|
2952
3009
|
})] });
|
|
2953
3010
|
}
|
|
2954
|
-
function
|
|
3011
|
+
function ri({ group: e, entityActions: t, globalActions: n, onRun: r, loading: i, onLoadingChange: a, row: o, widgetContext: s, onActionClick: c }) {
|
|
2955
3012
|
let l = e.name ? W(e.name) : void 0;
|
|
2956
3013
|
return /* @__PURE__ */ Q(X, { children: [l && /* @__PURE__ */ Z("div", {
|
|
2957
3014
|
style: {
|
|
@@ -2963,7 +3020,7 @@ function Vr({ group: e, entityActions: t, globalActions: n, onRun: r, loading: i
|
|
|
2963
3020
|
letterSpacing: "0.05em"
|
|
2964
3021
|
},
|
|
2965
3022
|
children: l
|
|
2966
|
-
}), e.items.map((e) => e.kind === "action" ? /* @__PURE__ */ Z(
|
|
3023
|
+
}), e.items.map((e) => e.kind === "action" ? /* @__PURE__ */ Z(ni, {
|
|
2967
3024
|
leaf: e,
|
|
2968
3025
|
entityActions: t,
|
|
2969
3026
|
globalActions: n,
|
|
@@ -2973,7 +3030,7 @@ function Vr({ group: e, entityActions: t, globalActions: n, onRun: r, loading: i
|
|
|
2973
3030
|
row: o,
|
|
2974
3031
|
widgetContext: s,
|
|
2975
3032
|
onActionClick: c
|
|
2976
|
-
}, e.code) : /* @__PURE__ */ Z(
|
|
3033
|
+
}, e.code) : /* @__PURE__ */ Z(ri, {
|
|
2977
3034
|
group: e,
|
|
2978
3035
|
entityActions: t,
|
|
2979
3036
|
globalActions: n,
|
|
@@ -2985,84 +3042,92 @@ function Vr({ group: e, entityActions: t, globalActions: n, onRun: r, loading: i
|
|
|
2985
3042
|
onActionClick: c
|
|
2986
3043
|
}, e.icon ?? "nested"))] });
|
|
2987
3044
|
}
|
|
2988
|
-
function
|
|
2989
|
-
let
|
|
2990
|
-
|
|
2991
|
-
let { normal: S, destructive: C } = Mr(t, n, r), w = C.length > 0 || x;
|
|
2992
|
-
return /* @__PURE__ */ Q("div", {
|
|
3045
|
+
function ii({ layout: t, entityActions: n, globalActions: r, onRun: i, row: a, widgetContext: c, onActionClick: l }) {
|
|
3046
|
+
let d = J(null), [f, p] = Y(!1), [m, h] = Y(null), g = G((e, t) => (p(!1), i(e, t)), [i]);
|
|
3047
|
+
return qr(t) === 0 ? null : /* @__PURE__ */ Q("div", {
|
|
2993
3048
|
style: {
|
|
2994
3049
|
display: "inline-flex",
|
|
2995
3050
|
alignItems: "center"
|
|
2996
3051
|
},
|
|
2997
3052
|
children: [/* @__PURE__ */ Z(o, {
|
|
2998
|
-
ref:
|
|
2999
|
-
icon: Z(
|
|
3053
|
+
ref: d,
|
|
3054
|
+
icon: Z(m == null ? e.more : u, { size: 14 }),
|
|
3000
3055
|
title: "Actions",
|
|
3001
3056
|
size: 28,
|
|
3002
|
-
onClick: () =>
|
|
3057
|
+
onClick: () => p((e) => !e)
|
|
3003
3058
|
}), /* @__PURE__ */ Z(s, {
|
|
3004
|
-
open:
|
|
3005
|
-
anchor:
|
|
3006
|
-
onClose: () =>
|
|
3059
|
+
open: f,
|
|
3060
|
+
anchor: d.current,
|
|
3061
|
+
onClose: () => p(!1),
|
|
3007
3062
|
align: "end",
|
|
3008
3063
|
width: 220,
|
|
3009
|
-
children: /* @__PURE__ */
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
onLoadingChange: (t) => v(t ? e.code : null),
|
|
3020
|
-
row: l,
|
|
3021
|
-
widgetContext: d,
|
|
3022
|
-
onActionClick: f
|
|
3023
|
-
}, e.code) : /* @__PURE__ */ Z(Vr, {
|
|
3024
|
-
group: e,
|
|
3025
|
-
entityActions: n,
|
|
3026
|
-
globalActions: r,
|
|
3027
|
-
onRun: y,
|
|
3028
|
-
loading: _,
|
|
3029
|
-
onLoadingChange: v,
|
|
3030
|
-
row: l,
|
|
3031
|
-
widgetContext: d,
|
|
3032
|
-
onActionClick: f
|
|
3033
|
-
}, e.icon ?? "group")),
|
|
3034
|
-
b && a,
|
|
3035
|
-
w && /* @__PURE__ */ Z(p, { divider: !0 }),
|
|
3036
|
-
C.map((e) => /* @__PURE__ */ Z(Br, {
|
|
3037
|
-
leaf: e,
|
|
3038
|
-
entityActions: n,
|
|
3039
|
-
globalActions: r,
|
|
3040
|
-
onRun: y,
|
|
3041
|
-
loading: _ === e.code,
|
|
3042
|
-
onLoadingChange: (t) => v(t ? e.code : null),
|
|
3043
|
-
row: l,
|
|
3044
|
-
widgetContext: d,
|
|
3045
|
-
onActionClick: f
|
|
3046
|
-
}, e.code)),
|
|
3047
|
-
x && c
|
|
3048
|
-
]
|
|
3064
|
+
children: /* @__PURE__ */ Z(oi, {
|
|
3065
|
+
layout: t,
|
|
3066
|
+
entityActions: n,
|
|
3067
|
+
globalActions: r,
|
|
3068
|
+
onRun: g,
|
|
3069
|
+
loading: m,
|
|
3070
|
+
onLoadingChange: h,
|
|
3071
|
+
row: a,
|
|
3072
|
+
widgetContext: c,
|
|
3073
|
+
onActionClick: l
|
|
3049
3074
|
})
|
|
3050
3075
|
})]
|
|
3051
3076
|
});
|
|
3052
3077
|
}
|
|
3053
|
-
|
|
3054
|
-
|
|
3078
|
+
function ai(e) {
|
|
3079
|
+
let t = 0;
|
|
3080
|
+
for (let n of e) if (n.kind === "action" && pr(n.code)) t++;
|
|
3081
|
+
else break;
|
|
3082
|
+
return t;
|
|
3083
|
+
}
|
|
3084
|
+
function oi({ layout: e, entityActions: t, globalActions: n, onRun: r, loading: i, onLoadingChange: a, row: o, widgetContext: s, onActionClick: c, ariaLabel: l = "Row actions" }) {
|
|
3085
|
+
let { normal: u, destructive: d } = Jr(e, t, n), f = ai(u), m = u.slice(0, f), h = u.slice(f), g = d.length > 0, _ = h.length > 0 || g, v = (e) => /* @__PURE__ */ Z(ni, {
|
|
3086
|
+
leaf: e,
|
|
3087
|
+
entityActions: t,
|
|
3088
|
+
globalActions: n,
|
|
3089
|
+
onRun: r,
|
|
3090
|
+
loading: i === e.code,
|
|
3091
|
+
onLoadingChange: (t) => a(t ? e.code : null),
|
|
3092
|
+
row: o,
|
|
3093
|
+
widgetContext: s,
|
|
3094
|
+
onActionClick: c
|
|
3095
|
+
}, e.code);
|
|
3096
|
+
return /* @__PURE__ */ Q("div", {
|
|
3097
|
+
role: "menu",
|
|
3098
|
+
"aria-label": l,
|
|
3099
|
+
children: [
|
|
3100
|
+
m.map((e) => e.kind === "action" ? v(e) : null),
|
|
3101
|
+
m.length > 0 && _ && /* @__PURE__ */ Z(p, { divider: !0 }),
|
|
3102
|
+
h.map((e) => e.kind === "action" ? v(e) : /* @__PURE__ */ Z(ri, {
|
|
3103
|
+
group: e,
|
|
3104
|
+
entityActions: t,
|
|
3105
|
+
globalActions: n,
|
|
3106
|
+
onRun: r,
|
|
3107
|
+
loading: i,
|
|
3108
|
+
onLoadingChange: a,
|
|
3109
|
+
row: o,
|
|
3110
|
+
widgetContext: s,
|
|
3111
|
+
onActionClick: c
|
|
3112
|
+
}, e.icon ?? "group")),
|
|
3113
|
+
g && /* @__PURE__ */ Z(p, { divider: !0 }),
|
|
3114
|
+
d.map((e) => v(e))
|
|
3115
|
+
]
|
|
3116
|
+
});
|
|
3117
|
+
}
|
|
3118
|
+
var si = "__overflow_trigger__", ci = 90, li = 80;
|
|
3119
|
+
function ui(e) {
|
|
3055
3120
|
return e + 8;
|
|
3056
3121
|
}
|
|
3057
|
-
function
|
|
3058
|
-
let { primary: c, regular: l, destructive: u } =
|
|
3122
|
+
function di(e, t, n, r, i, a, o, s) {
|
|
3123
|
+
let { primary: c, regular: l, destructive: u } = Yr(e, i, a), d = c.length > 0 ? c.reduce((e, t) => e + (r.get($(t)) ?? 0), 0) : 0, f = u.length > 0 ? u.reduce((e, t) => e + (r.get($(t)) ?? li), 0) : 0, p = t - n - d - f, m = r.get(si) ?? ci, h = 0, g = [], _ = [], v = !1;
|
|
3059
3124
|
for (let e of l) {
|
|
3060
3125
|
let t = r.get($(e)) ?? 0;
|
|
3061
3126
|
if (o) {
|
|
3062
3127
|
o(e) ? (g.push(e), h += t) : (_.push(e), v = !0);
|
|
3063
3128
|
continue;
|
|
3064
3129
|
}
|
|
3065
|
-
let n = l.length - g.length - _.length - 1 > 0 || _.length > 0 ? m : 0, i = s && !s.has($(e)) ?
|
|
3130
|
+
let n = l.length - g.length - _.length - 1 > 0 || _.length > 0 ? m : 0, i = s && !s.has($(e)) ? ui(m) : 0;
|
|
3066
3131
|
h + t + n + i <= p ? (g.push(e), h += t) : (_.push(e), v = !0);
|
|
3067
3132
|
}
|
|
3068
3133
|
return {
|
|
@@ -3075,7 +3140,7 @@ function qr(e, t, n, r, i, a, o, s) {
|
|
|
3075
3140
|
function $(e) {
|
|
3076
3141
|
return e.kind === "action" ? `action:${e.code}` : `group:${e.name ? W(e.name) : ""}`;
|
|
3077
3142
|
}
|
|
3078
|
-
function
|
|
3143
|
+
function fi({ layout: n, entityActions: r, globalActions: i, onRun: a, reservedRightWidth: o = 0, measurementOverride: c, ariaLabel: u = "Actions", align: d = "trailing", constrain: f = !0, row: p, widgetContext: m, onActionClick: h }) {
|
|
3079
3144
|
let g = J(null), _ = J(null), [v, y] = Y(0), [b, x] = Y(/* @__PURE__ */ new Map()), [S, C] = Y(!1), [w, T] = Y(null), [E, D] = Y(() => typeof document < "u" && document.documentElement.dir === "rtl");
|
|
3080
3145
|
K(() => {
|
|
3081
3146
|
if (typeof MutationObserver > "u") return;
|
|
@@ -3087,7 +3152,7 @@ function Jr({ layout: n, entityActions: r, globalActions: i, onRun: a, reservedR
|
|
|
3087
3152
|
attributeFilter: ["dir", "lang"]
|
|
3088
3153
|
}), () => e.disconnect();
|
|
3089
3154
|
}, []);
|
|
3090
|
-
let O = J(null), [k, A] = Y(!1), j = G((e, t) => (A(!1), a(e, t)), [a]), M =
|
|
3155
|
+
let O = J(null), [k, A] = Y(!1), j = G((e, t) => (A(!1), a(e, t)), [a]), M = qr(n), N = !!c, P = G(() => {
|
|
3091
3156
|
if (N || !_.current) return;
|
|
3092
3157
|
let e = Array.from(_.current.children), t = /* @__PURE__ */ new Map();
|
|
3093
3158
|
e.forEach((e) => {
|
|
@@ -3149,7 +3214,7 @@ function Jr({ layout: n, entityActions: r, globalActions: i, onRun: a, reservedR
|
|
|
3149
3214
|
K(() => {
|
|
3150
3215
|
I.current = void 0;
|
|
3151
3216
|
}, [F]);
|
|
3152
|
-
let L = q(() => N || !f ?
|
|
3217
|
+
let L = q(() => N || !f ? di(n, 2 ** 53 - 1, o, b, r, i, c) : S ? v === 0 ? di(n, 2 ** 53 - 1, o, b, r, i, c) : di(n, v, o, b, r, i, c, I.current) : {
|
|
3153
3218
|
primaryInline: [],
|
|
3154
3219
|
inline: [],
|
|
3155
3220
|
overflow: [],
|
|
@@ -3200,14 +3265,14 @@ function Jr({ layout: n, entityActions: r, globalActions: i, onRun: a, reservedR
|
|
|
3200
3265
|
left: 0
|
|
3201
3266
|
},
|
|
3202
3267
|
children: [/* @__PURE__ */ Z(l, {
|
|
3203
|
-
"data-node-key":
|
|
3268
|
+
"data-node-key": si,
|
|
3204
3269
|
iconRight: /* @__PURE__ */ Z(e.down, { size: 10 }),
|
|
3205
3270
|
tabIndex: -1,
|
|
3206
3271
|
children: "Actions"
|
|
3207
|
-
},
|
|
3272
|
+
}, si), n.map((n) => {
|
|
3208
3273
|
let a = $(n);
|
|
3209
3274
|
if (n.kind === "action") {
|
|
3210
|
-
let e =
|
|
3275
|
+
let e = Xr(n.code, r, i), o = Zr(n.code, r, i), s = Qr(n.code, r, i);
|
|
3211
3276
|
return /* @__PURE__ */ Z(l, {
|
|
3212
3277
|
"data-node-key": a,
|
|
3213
3278
|
icon: s ? /* @__PURE__ */ Z(t, {
|
|
@@ -3229,7 +3294,7 @@ function Jr({ layout: n, entityActions: r, globalActions: i, onRun: a, reservedR
|
|
|
3229
3294
|
}
|
|
3230
3295
|
})]
|
|
3231
3296
|
}),
|
|
3232
|
-
L.primaryInline.map((e) => /* @__PURE__ */ Z(
|
|
3297
|
+
L.primaryInline.map((e) => /* @__PURE__ */ Z(ei, {
|
|
3233
3298
|
leaf: e,
|
|
3234
3299
|
entityActions: r,
|
|
3235
3300
|
globalActions: i,
|
|
@@ -3242,7 +3307,7 @@ function Jr({ layout: n, entityActions: r, globalActions: i, onRun: a, reservedR
|
|
|
3242
3307
|
}, $(e))),
|
|
3243
3308
|
L.inline.map((e) => {
|
|
3244
3309
|
let t = $(e);
|
|
3245
|
-
return e.kind === "action" ? /* @__PURE__ */ Z(
|
|
3310
|
+
return e.kind === "action" ? /* @__PURE__ */ Z(ei, {
|
|
3246
3311
|
leaf: e,
|
|
3247
3312
|
entityActions: r,
|
|
3248
3313
|
globalActions: i,
|
|
@@ -3252,7 +3317,7 @@ function Jr({ layout: n, entityActions: r, globalActions: i, onRun: a, reservedR
|
|
|
3252
3317
|
row: p,
|
|
3253
3318
|
widgetContext: m,
|
|
3254
3319
|
onActionClick: h
|
|
3255
|
-
}, t) : /* @__PURE__ */ Z(
|
|
3320
|
+
}, t) : /* @__PURE__ */ Z(ti, {
|
|
3256
3321
|
group: e,
|
|
3257
3322
|
entityActions: r,
|
|
3258
3323
|
globalActions: i,
|
|
@@ -3281,7 +3346,7 @@ function Jr({ layout: n, entityActions: r, globalActions: i, onRun: a, reservedR
|
|
|
3281
3346
|
children: /* @__PURE__ */ Z("div", {
|
|
3282
3347
|
role: "menu",
|
|
3283
3348
|
"aria-label": "More actions",
|
|
3284
|
-
children: L.overflow.map((e) => e.kind === "action" ? /* @__PURE__ */ Z(
|
|
3349
|
+
children: L.overflow.map((e) => e.kind === "action" ? /* @__PURE__ */ Z(ni, {
|
|
3285
3350
|
leaf: e,
|
|
3286
3351
|
entityActions: r,
|
|
3287
3352
|
globalActions: i,
|
|
@@ -3291,7 +3356,7 @@ function Jr({ layout: n, entityActions: r, globalActions: i, onRun: a, reservedR
|
|
|
3291
3356
|
row: p,
|
|
3292
3357
|
widgetContext: m,
|
|
3293
3358
|
onActionClick: h
|
|
3294
|
-
}, e.code) : /* @__PURE__ */ Z(
|
|
3359
|
+
}, e.code) : /* @__PURE__ */ Z(ri, {
|
|
3295
3360
|
group: e,
|
|
3296
3361
|
entityActions: r,
|
|
3297
3362
|
globalActions: i,
|
|
@@ -3304,7 +3369,7 @@ function Jr({ layout: n, entityActions: r, globalActions: i, onRun: a, reservedR
|
|
|
3304
3369
|
}, $(e)))
|
|
3305
3370
|
})
|
|
3306
3371
|
})] }),
|
|
3307
|
-
L.destructiveInline.map((e) => /* @__PURE__ */ Z(
|
|
3372
|
+
L.destructiveInline.map((e) => /* @__PURE__ */ Z(ei, {
|
|
3308
3373
|
leaf: e,
|
|
3309
3374
|
entityActions: r,
|
|
3310
3375
|
globalActions: i,
|
|
@@ -3318,7 +3383,7 @@ function Jr({ layout: n, entityActions: r, globalActions: i, onRun: a, reservedR
|
|
|
3318
3383
|
]
|
|
3319
3384
|
});
|
|
3320
3385
|
}
|
|
3321
|
-
function
|
|
3386
|
+
function pi({ layout: e, rowSelection: t = [], ...n }) {
|
|
3322
3387
|
let r = t.length > 0;
|
|
3323
3388
|
return /* @__PURE__ */ Q("div", {
|
|
3324
3389
|
style: {
|
|
@@ -3334,7 +3399,7 @@ function Yr({ layout: e, rowSelection: t = [], ...n }) {
|
|
|
3334
3399
|
flex: "1 1 auto",
|
|
3335
3400
|
minWidth: 0
|
|
3336
3401
|
},
|
|
3337
|
-
children: /* @__PURE__ */ Z(
|
|
3402
|
+
children: /* @__PURE__ */ Z(fi, {
|
|
3338
3403
|
layout: e,
|
|
3339
3404
|
rowSelection: [],
|
|
3340
3405
|
...n
|
|
@@ -3346,7 +3411,7 @@ function Yr({ layout: e, rowSelection: t = [], ...n }) {
|
|
|
3346
3411
|
flex: "1 1 auto",
|
|
3347
3412
|
minWidth: 0
|
|
3348
3413
|
},
|
|
3349
|
-
children: /* @__PURE__ */ Z(
|
|
3414
|
+
children: /* @__PURE__ */ Z(fi, {
|
|
3350
3415
|
layout: e,
|
|
3351
3416
|
rowSelection: t,
|
|
3352
3417
|
...n
|
|
@@ -3354,19 +3419,17 @@ function Yr({ layout: e, rowSelection: t = [], ...n }) {
|
|
|
3354
3419
|
})]
|
|
3355
3420
|
});
|
|
3356
3421
|
}
|
|
3357
|
-
function
|
|
3358
|
-
let
|
|
3359
|
-
return a === "row" ? /* @__PURE__ */ Z(
|
|
3422
|
+
function mi({ layout: e, row: t, rowSelection: n, onRun: r, reservedRightWidth: i = 0, kind: a = "toolbar", align: o = "trailing", constrain: s = !0, measurementOverride: c, entityActions: l, globalActions: u, ariaLabel: d = "Actions", widgetContext: f, onActionClick: p }) {
|
|
3423
|
+
let m = qr(e);
|
|
3424
|
+
return a === "row" ? /* @__PURE__ */ Z(ii, {
|
|
3360
3425
|
layout: e,
|
|
3361
3426
|
entityActions: l,
|
|
3362
3427
|
globalActions: u,
|
|
3363
3428
|
onRun: r,
|
|
3364
|
-
trailingNormalItems: f,
|
|
3365
|
-
trailingDestructiveItems: p,
|
|
3366
3429
|
row: t,
|
|
3367
|
-
widgetContext:
|
|
3368
|
-
onActionClick:
|
|
3369
|
-
}) :
|
|
3430
|
+
widgetContext: f,
|
|
3431
|
+
onActionClick: p
|
|
3432
|
+
}) : m === 0 ? null : Z(a === "toolbar" ? pi : fi, {
|
|
3370
3433
|
layout: e,
|
|
3371
3434
|
row: t,
|
|
3372
3435
|
rowSelection: n,
|
|
@@ -3378,27 +3441,179 @@ function Xr({ layout: e, row: t, rowSelection: n, onRun: r, reservedRightWidth:
|
|
|
3378
3441
|
ariaLabel: d,
|
|
3379
3442
|
align: o,
|
|
3380
3443
|
constrain: s,
|
|
3381
|
-
widgetContext:
|
|
3382
|
-
onActionClick:
|
|
3444
|
+
widgetContext: f,
|
|
3445
|
+
onActionClick: p
|
|
3446
|
+
});
|
|
3447
|
+
}
|
|
3448
|
+
//#endregion
|
|
3449
|
+
//#region src/components/shared/RowActionsKebab.tsx
|
|
3450
|
+
function hi({ actions: t, objectIds: n, row: r, onSuccess: i, preMenu: a, divider: c, size: l = 22, align: u = "end" }) {
|
|
3451
|
+
let d = J(null), [f, m] = Y(!1), [h, g] = Y(null), { run: _ } = N(), v = q(() => {
|
|
3452
|
+
let e = {};
|
|
3453
|
+
for (let { code: n, action: r } of t) e[n] = r;
|
|
3454
|
+
return e;
|
|
3455
|
+
}, [t]), y = q(() => {
|
|
3456
|
+
let e = t.map(({ code: e }) => ({
|
|
3457
|
+
kind: "action",
|
|
3458
|
+
code: e,
|
|
3459
|
+
enabled: !0,
|
|
3460
|
+
reason: null
|
|
3461
|
+
}));
|
|
3462
|
+
return r ? Or(e, v, void 0, r, []) : e;
|
|
3463
|
+
}, [
|
|
3464
|
+
t,
|
|
3465
|
+
v,
|
|
3466
|
+
r
|
|
3467
|
+
]), b = G((e, t) => {
|
|
3468
|
+
m(!1);
|
|
3469
|
+
let a = t.entity ? `${t.entity}.${e}` : e;
|
|
3470
|
+
return _({
|
|
3471
|
+
action: t,
|
|
3472
|
+
title: W(t.display?.name) || e,
|
|
3473
|
+
row: r,
|
|
3474
|
+
execute: async (e) => {
|
|
3475
|
+
let t = await te(a, B(e, n));
|
|
3476
|
+
return i?.(), t;
|
|
3477
|
+
}
|
|
3478
|
+
});
|
|
3479
|
+
}, [
|
|
3480
|
+
_,
|
|
3481
|
+
r,
|
|
3482
|
+
n,
|
|
3483
|
+
i
|
|
3484
|
+
]);
|
|
3485
|
+
return !a && y.length === 0 ? null : /* @__PURE__ */ Q("div", {
|
|
3486
|
+
className: "sl-row-actions",
|
|
3487
|
+
"data-open": f ? "true" : void 0,
|
|
3488
|
+
style: {
|
|
3489
|
+
display: "flex",
|
|
3490
|
+
alignItems: "center",
|
|
3491
|
+
justifyContent: "flex-end"
|
|
3492
|
+
},
|
|
3493
|
+
children: [/* @__PURE__ */ Z(o, {
|
|
3494
|
+
ref: d,
|
|
3495
|
+
size: l,
|
|
3496
|
+
icon: /* @__PURE__ */ Z(e.more, { size: Math.round(l * .55) }),
|
|
3497
|
+
onClick: () => m((e) => !e),
|
|
3498
|
+
title: "Actions"
|
|
3499
|
+
}), /* @__PURE__ */ Q(s, {
|
|
3500
|
+
open: f,
|
|
3501
|
+
anchor: d.current,
|
|
3502
|
+
onClose: () => m(!1),
|
|
3503
|
+
width: 200,
|
|
3504
|
+
align: u,
|
|
3505
|
+
children: [
|
|
3506
|
+
a,
|
|
3507
|
+
a && c && y.length > 0 && /* @__PURE__ */ Z(p, { divider: !0 }),
|
|
3508
|
+
/* @__PURE__ */ Z(oi, {
|
|
3509
|
+
layout: y,
|
|
3510
|
+
entityActions: v,
|
|
3511
|
+
onRun: b,
|
|
3512
|
+
loading: h,
|
|
3513
|
+
onLoadingChange: g,
|
|
3514
|
+
row: r
|
|
3515
|
+
})
|
|
3516
|
+
]
|
|
3517
|
+
})]
|
|
3518
|
+
});
|
|
3519
|
+
}
|
|
3520
|
+
//#endregion
|
|
3521
|
+
//#region src/components/detail-layout/AssociatedToolbar.tsx
|
|
3522
|
+
function gi({ entity: t, searchable: n, filterFields: r, searchValue: i, onSearchChange: a, filters: o, onFilterChange: s, allEntities: c }) {
|
|
3523
|
+
let l = n === !0, u = r && r.length > 0;
|
|
3524
|
+
return !l && !u ? null : /* @__PURE__ */ Q("div", {
|
|
3525
|
+
style: {
|
|
3526
|
+
display: "flex",
|
|
3527
|
+
alignItems: "center",
|
|
3528
|
+
gap: 6,
|
|
3529
|
+
marginBottom: 8
|
|
3530
|
+
},
|
|
3531
|
+
children: [l && /* @__PURE__ */ Z("div", {
|
|
3532
|
+
style: {
|
|
3533
|
+
flex: 1,
|
|
3534
|
+
maxWidth: 220
|
|
3535
|
+
},
|
|
3536
|
+
children: /* @__PURE__ */ Z(I, {
|
|
3537
|
+
value: i,
|
|
3538
|
+
onChange: a,
|
|
3539
|
+
placeholder: "Search…",
|
|
3540
|
+
prefix: /* @__PURE__ */ Z(e.search, { size: 12 })
|
|
3541
|
+
})
|
|
3542
|
+
}), u && r.map((e) => {
|
|
3543
|
+
let n = t.fields.get(e);
|
|
3544
|
+
if (!n) return null;
|
|
3545
|
+
let r = o[e] ?? "__all__", i = ie(n, e, c);
|
|
3546
|
+
return n.type === "ref" && n.ref?.entity ? /* @__PURE__ */ Z(_i, {
|
|
3547
|
+
field: n,
|
|
3548
|
+
label: i,
|
|
3549
|
+
value: r,
|
|
3550
|
+
onChange: (t) => s(e, t)
|
|
3551
|
+
}, e) : n.values ? /* @__PURE__ */ Z("div", {
|
|
3552
|
+
style: { width: 160 },
|
|
3553
|
+
children: /* @__PURE__ */ Z(f, {
|
|
3554
|
+
value: r,
|
|
3555
|
+
options: [{
|
|
3556
|
+
value: "__all__",
|
|
3557
|
+
label: `All ${i}`
|
|
3558
|
+
}, ...n.values.map((e) => ({
|
|
3559
|
+
value: e.code,
|
|
3560
|
+
label: W(e.name) || e.code
|
|
3561
|
+
}))],
|
|
3562
|
+
onChange: (t) => s(e, t),
|
|
3563
|
+
placeholder: i
|
|
3564
|
+
})
|
|
3565
|
+
}, e) : null;
|
|
3566
|
+
})]
|
|
3567
|
+
});
|
|
3568
|
+
}
|
|
3569
|
+
function _i({ field: e, label: t, value: n, onChange: r }) {
|
|
3570
|
+
let i = F(e.ref?.entity), o = e.display?.ref_display_field ?? i?.display?.display_field, s = q(() => i ? [...i.fields].find(([, e]) => e.primary)?.[0] ?? "id" : "id", [i]), { data: c } = a(e.ref?.entity, {
|
|
3571
|
+
per_page: 200,
|
|
3572
|
+
sort: o ? `${o}:asc` : void 0
|
|
3573
|
+
}), l = c?.data ?? [], u = (e) => {
|
|
3574
|
+
if (e == null) return "—";
|
|
3575
|
+
if (typeof e == "object" && !Array.isArray(e)) {
|
|
3576
|
+
let t = Object.values(e)[0];
|
|
3577
|
+
return t == null ? "—" : x(t);
|
|
3578
|
+
}
|
|
3579
|
+
return x(e);
|
|
3580
|
+
};
|
|
3581
|
+
return /* @__PURE__ */ Z("div", {
|
|
3582
|
+
style: { width: 160 },
|
|
3583
|
+
children: /* @__PURE__ */ Z(f, {
|
|
3584
|
+
value: n,
|
|
3585
|
+
options: [{
|
|
3586
|
+
value: "__all__",
|
|
3587
|
+
label: `All ${t}`
|
|
3588
|
+
}, ...l.map((e) => {
|
|
3589
|
+
let t = String(e[s]), n = e[T];
|
|
3590
|
+
return {
|
|
3591
|
+
value: t,
|
|
3592
|
+
label: typeof n == "string" && n !== "" ? n : o ? u(e[o] ?? t) : t
|
|
3593
|
+
};
|
|
3594
|
+
})],
|
|
3595
|
+
onChange: r,
|
|
3596
|
+
placeholder: t
|
|
3597
|
+
})
|
|
3383
3598
|
});
|
|
3384
3599
|
}
|
|
3385
3600
|
//#endregion
|
|
3386
3601
|
//#region src/lib/action-dispatch.ts
|
|
3387
|
-
function
|
|
3602
|
+
function vi(e, t, n, r) {
|
|
3388
3603
|
return ne(t) ? (E(t.ui_steps, n), null) : t.entity ? `${t.entity}.${e}` : r ? `${r}.${e}` : e;
|
|
3389
3604
|
}
|
|
3390
3605
|
//#endregion
|
|
3391
3606
|
//#region src/components/detail-layout/AssociatedBlock.tsx
|
|
3392
|
-
function
|
|
3607
|
+
function yi(e) {
|
|
3393
3608
|
if (!e) return [];
|
|
3394
3609
|
let t = [];
|
|
3395
|
-
for (let [n, r] of Object.entries(e)) (r.visibility ?? []).includes("list_row") && (r.association || t.push({
|
|
3610
|
+
for (let [n, r] of Object.entries(e)) (r.visibility ?? []).includes("list_row") && (r.association || pr(n) || t.push({
|
|
3396
3611
|
code: n,
|
|
3397
3612
|
action: r
|
|
3398
3613
|
}));
|
|
3399
3614
|
return t;
|
|
3400
3615
|
}
|
|
3401
|
-
function
|
|
3616
|
+
function bi(e, t, n) {
|
|
3402
3617
|
if (!e) return [];
|
|
3403
3618
|
let r = [];
|
|
3404
3619
|
for (let [i, a] of Object.entries(e)) {
|
|
@@ -3424,7 +3639,7 @@ function $r(e, t, n) {
|
|
|
3424
3639
|
}
|
|
3425
3640
|
return r;
|
|
3426
3641
|
}
|
|
3427
|
-
function
|
|
3642
|
+
function xi(e, t, n) {
|
|
3428
3643
|
let r = e[n];
|
|
3429
3644
|
if (!r) return null;
|
|
3430
3645
|
let i = e[t], a = i?.children?.find((e) => e.entity === n);
|
|
@@ -3446,7 +3661,7 @@ function ei(e, t, n) {
|
|
|
3446
3661
|
}
|
|
3447
3662
|
return null;
|
|
3448
3663
|
}
|
|
3449
|
-
function
|
|
3664
|
+
function Si(e, t, n) {
|
|
3450
3665
|
let r = new Set(z(e));
|
|
3451
3666
|
return new Set(t.filter((t) => {
|
|
3452
3667
|
if (t === n || r.has(t)) return !1;
|
|
@@ -3454,14 +3669,14 @@ function ti(e, t, n) {
|
|
|
3454
3669
|
return !(!i || i.auto || i.primary || i.source);
|
|
3455
3670
|
}));
|
|
3456
3671
|
}
|
|
3457
|
-
function
|
|
3672
|
+
function Ci(e, t, n) {
|
|
3458
3673
|
return new Set(t.filter((t) => {
|
|
3459
3674
|
if (t === n) return !1;
|
|
3460
3675
|
let r = e.fields.get(t);
|
|
3461
3676
|
return !(!r || r.auto);
|
|
3462
3677
|
}));
|
|
3463
3678
|
}
|
|
3464
|
-
function
|
|
3679
|
+
function wi(e, t, n, r) {
|
|
3465
3680
|
let i = [];
|
|
3466
3681
|
for (let a of t) {
|
|
3467
3682
|
let t = n.fields.get(a);
|
|
@@ -3471,7 +3686,7 @@ function ri(e, t, n, r) {
|
|
|
3471
3686
|
}
|
|
3472
3687
|
return i;
|
|
3473
3688
|
}
|
|
3474
|
-
function
|
|
3689
|
+
function Ti({ node: e, ctx: t }) {
|
|
3475
3690
|
let n = e.associated;
|
|
3476
3691
|
if (!n || t.isNew) return null;
|
|
3477
3692
|
let r = t.schema.entities[n];
|
|
@@ -3483,8 +3698,8 @@ function ii({ node: e, ctx: t }) {
|
|
|
3483
3698
|
},
|
|
3484
3699
|
children: ["Entity not found: ", n]
|
|
3485
3700
|
});
|
|
3486
|
-
let i =
|
|
3487
|
-
return i ? /* @__PURE__ */ Z(
|
|
3701
|
+
let i = xi(t.schema.entities, t.entityCode, n);
|
|
3702
|
+
return i ? /* @__PURE__ */ Z(Ei, {
|
|
3488
3703
|
node: e,
|
|
3489
3704
|
ctx: t,
|
|
3490
3705
|
assocCode: n,
|
|
@@ -3504,12 +3719,12 @@ function ii({ node: e, ctx: t }) {
|
|
|
3504
3719
|
]
|
|
3505
3720
|
});
|
|
3506
3721
|
}
|
|
3507
|
-
function
|
|
3722
|
+
function Ei({ node: n, ctx: r, assocCode: i, assocEntity: a, fkField: o }) {
|
|
3508
3723
|
let s = n.columns && n.columns.length > 0 ? n.columns.filter((e) => e !== o && !!a.fields.get(e)) : a.fields.names().filter((e) => {
|
|
3509
3724
|
if (e === o) return !1;
|
|
3510
3725
|
let t = a.fields.get(e);
|
|
3511
3726
|
return !(!t || t.primary || t.display?.is_listable === !1);
|
|
3512
|
-
}), c = y(a, "update"), u = n.interaction ?? (c ? "navigate" : "readonly"), d = (u === "inline_edit" || u === "row_edit") && c && n.editable !== !1, f = W(a.display?.name_plural) || W(a.display?.name) || i, p = n.searchable === !0 || n.filters && n.filters.length > 0, m = q(() =>
|
|
3727
|
+
}), c = y(a, "update"), u = n.interaction ?? (c ? "navigate" : "readonly"), d = (u === "inline_edit" || u === "row_edit") && c && n.editable !== !1, f = W(a.display?.name_plural) || W(a.display?.name) || i, p = n.searchable === !0 || n.filters && n.filters.length > 0, m = q(() => bi(a.actions, o, r.recordId), [
|
|
3513
3728
|
a.actions,
|
|
3514
3729
|
o,
|
|
3515
3730
|
r.recordId
|
|
@@ -3517,7 +3732,7 @@ function ai({ node: n, ctx: r, assocCode: i, assocEntity: a, fkField: o }) {
|
|
|
3517
3732
|
let e = {};
|
|
3518
3733
|
for (let { code: t, action: n } of m) e[t] = n;
|
|
3519
3734
|
return e;
|
|
3520
|
-
}, [m]), g = q(() =>
|
|
3735
|
+
}, [m]), g = q(() => Or(a.action_layout ?? null ?? Hr(h, "list_toolbar"), h, void 0, {}, []), [a.action_layout, h]), { run: _ } = N(), v = It(), b = j(), x = q(() => ({
|
|
3521
3736
|
entity: a,
|
|
3522
3737
|
entityCode: i,
|
|
3523
3738
|
screenRoute: typeof window < "u" ? window.location.pathname : "",
|
|
@@ -3541,7 +3756,7 @@ function ai({ node: n, ctx: r, assocCode: i, assocEntity: a, fkField: o }) {
|
|
|
3541
3756
|
return t[0] === "entity-children" && t[3] === i;
|
|
3542
3757
|
} });
|
|
3543
3758
|
}, [S, i]), w = G((e, t) => {
|
|
3544
|
-
let n =
|
|
3759
|
+
let n = vi(e, t, {}, i);
|
|
3545
3760
|
if (n !== null) return _({
|
|
3546
3761
|
action: t,
|
|
3547
3762
|
title: W(t.display?.name) || e,
|
|
@@ -3563,14 +3778,14 @@ function ai({ node: n, ctx: r, assocCode: i, assocEntity: a, fkField: o }) {
|
|
|
3563
3778
|
minWidth: 0,
|
|
3564
3779
|
justifyContent: "flex-end"
|
|
3565
3780
|
},
|
|
3566
|
-
children: [a.action_layout ? g.length > 0 && /* @__PURE__ */ Z(
|
|
3781
|
+
children: [a.action_layout ? g.length > 0 && /* @__PURE__ */ Z(mi, {
|
|
3567
3782
|
kind: "toolbar",
|
|
3568
3783
|
layout: g,
|
|
3569
3784
|
entityActions: h,
|
|
3570
3785
|
onRun: w,
|
|
3571
3786
|
widgetContext: x,
|
|
3572
3787
|
ariaLabel: `${f} toolbar actions`
|
|
3573
|
-
}) : m.map(({ code: e, action: t }) => /* @__PURE__ */ Z(
|
|
3788
|
+
}) : m.map(({ code: e, action: t }) => /* @__PURE__ */ Z(Ur, {
|
|
3574
3789
|
actionCode: e,
|
|
3575
3790
|
action: t,
|
|
3576
3791
|
entityCode: i,
|
|
@@ -3584,7 +3799,7 @@ function ai({ node: n, ctx: r, assocCode: i, assocEntity: a, fkField: o }) {
|
|
|
3584
3799
|
onClick: () => E((e) => e + 1),
|
|
3585
3800
|
children: "Add row"
|
|
3586
3801
|
})]
|
|
3587
|
-
}), O = p ? /* @__PURE__ */ Z(
|
|
3802
|
+
}), O = p ? /* @__PURE__ */ Z(Oi, {
|
|
3588
3803
|
entityCode: i,
|
|
3589
3804
|
entity: a,
|
|
3590
3805
|
parentEntity: r.entityCode,
|
|
@@ -3598,7 +3813,7 @@ function ai({ node: n, ctx: r, assocCode: i, assocEntity: a, fkField: o }) {
|
|
|
3598
3813
|
filterFields: n.filters,
|
|
3599
3814
|
sort: n.sort,
|
|
3600
3815
|
startDraftSignal: T
|
|
3601
|
-
}) : /* @__PURE__ */ Z(
|
|
3816
|
+
}) : /* @__PURE__ */ Z(Di, {
|
|
3602
3817
|
entityCode: i,
|
|
3603
3818
|
entity: a,
|
|
3604
3819
|
parentEntity: r.entityCode,
|
|
@@ -3628,9 +3843,9 @@ function ai({ node: n, ctx: r, assocCode: i, assocEntity: a, fkField: o }) {
|
|
|
3628
3843
|
children: O
|
|
3629
3844
|
});
|
|
3630
3845
|
}
|
|
3631
|
-
function
|
|
3632
|
-
let d = Re(), { data: f, isLoading: p, isError: m } =
|
|
3633
|
-
return /* @__PURE__ */ Z(
|
|
3846
|
+
function Di({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey: i, columns: a, editable: o, interaction: s, ctx: c, sort: l, startDraftSignal: u }) {
|
|
3847
|
+
let d = Re(), { data: f, isLoading: p, isError: m } = Qn(n, r, e, i, l), h = f?.data ?? [], g = f?.$refs;
|
|
3848
|
+
return /* @__PURE__ */ Z(ki, {
|
|
3634
3849
|
entityCode: e,
|
|
3635
3850
|
entity: t,
|
|
3636
3851
|
parentId: r,
|
|
@@ -3645,7 +3860,7 @@ function oi({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey
|
|
|
3645
3860
|
isError: m,
|
|
3646
3861
|
invalidateQuery: G(() => {
|
|
3647
3862
|
d.invalidateQueries({ queryKey: [
|
|
3648
|
-
|
|
3863
|
+
Zn,
|
|
3649
3864
|
n,
|
|
3650
3865
|
r,
|
|
3651
3866
|
e
|
|
@@ -3659,7 +3874,7 @@ function oi({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey
|
|
|
3659
3874
|
startDraftSignal: u
|
|
3660
3875
|
});
|
|
3661
3876
|
}
|
|
3662
|
-
function
|
|
3877
|
+
function Oi({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey: i, columns: a, editable: o, interaction: s, ctx: c, searchable: d, filterFields: f, sort: p, startDraftSignal: m }) {
|
|
3663
3878
|
let h = Re(), [g, _] = Y(""), [v, y] = Y(""), [b, x] = Y({}), S = J(void 0);
|
|
3664
3879
|
K(() => (S.current && clearTimeout(S.current), S.current = setTimeout(() => {
|
|
3665
3880
|
y(g);
|
|
@@ -3677,7 +3892,7 @@ function si({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey
|
|
|
3677
3892
|
[e]: t
|
|
3678
3893
|
};
|
|
3679
3894
|
});
|
|
3680
|
-
}, []), w = q(() => Object.keys(b).length > 0 ? b : void 0, [b]), { data: T, isLoading: E, isError: D, hasNextPage: O, fetchNextPage: k, isFetchingNextPage: A } =
|
|
3895
|
+
}, []), w = q(() => Object.keys(b).length > 0 ? b : void 0, [b]), { data: T, isLoading: E, isError: D, hasNextPage: O, fetchNextPage: k, isFetchingNextPage: A } = tr(n, r, e, i, p, void 0, v || void 0, w), { rows: j, refs: M } = q(() => {
|
|
3681
3896
|
if (!T?.pages) return {
|
|
3682
3897
|
rows: [],
|
|
3683
3898
|
refs: void 0
|
|
@@ -3699,7 +3914,7 @@ function si({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey
|
|
|
3699
3914
|
} });
|
|
3700
3915
|
}, [h, e]);
|
|
3701
3916
|
return /* @__PURE__ */ Q("div", { children: [
|
|
3702
|
-
/* @__PURE__ */ Z(
|
|
3917
|
+
/* @__PURE__ */ Z(gi, {
|
|
3703
3918
|
entity: t,
|
|
3704
3919
|
searchable: d,
|
|
3705
3920
|
filterFields: f,
|
|
@@ -3709,7 +3924,7 @@ function si({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey
|
|
|
3709
3924
|
onFilterChange: C,
|
|
3710
3925
|
allEntities: c.schema.entities
|
|
3711
3926
|
}),
|
|
3712
|
-
/* @__PURE__ */ Z(
|
|
3927
|
+
/* @__PURE__ */ Z(ki, {
|
|
3713
3928
|
entityCode: e,
|
|
3714
3929
|
entity: t,
|
|
3715
3930
|
parentId: r,
|
|
@@ -3738,17 +3953,17 @@ function si({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey
|
|
|
3738
3953
|
})
|
|
3739
3954
|
] });
|
|
3740
3955
|
}
|
|
3741
|
-
function
|
|
3956
|
+
function ki({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i, editable: a, interaction: o, ctx: s, rows: c, refs: l, isLoading: u, isError: d, invalidateQuery: f, startDraftSignal: p }) {
|
|
3742
3957
|
let m = de(), h = m.isPhone && s.relatedRecordsPresentation === "table", g = i.find((e) => e !== r), _ = q(() => o === "navigate" ? k(void 0, t, s.schema.screens) : null, [
|
|
3743
3958
|
o,
|
|
3744
3959
|
t,
|
|
3745
3960
|
s.schema.screens
|
|
3746
|
-
]), v = q(() => a ?
|
|
3961
|
+
]), v = q(() => a ? Si(t, i, r) : /* @__PURE__ */ new Set(), [
|
|
3747
3962
|
i,
|
|
3748
3963
|
r,
|
|
3749
3964
|
t,
|
|
3750
3965
|
a
|
|
3751
|
-
]), y = q(() =>
|
|
3966
|
+
]), y = q(() => Ci(t, i, r), [
|
|
3752
3967
|
i,
|
|
3753
3968
|
r,
|
|
3754
3969
|
t
|
|
@@ -3766,7 +3981,7 @@ function ci({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
|
|
|
3766
3981
|
typeof r == "string" && r !== "" && e.set(b(V(t, n)), r);
|
|
3767
3982
|
}
|
|
3768
3983
|
return e;
|
|
3769
|
-
}, [c, t]), w = q(() =>
|
|
3984
|
+
}, [c, t]), w = q(() => yi(t.actions), [t.actions]), [T, E] = Y(null), [D, O] = Y(null), [A, j] = Y([]), [N, F] = Y({}), I = J(N);
|
|
3770
3985
|
I.current = N;
|
|
3771
3986
|
let L = J({});
|
|
3772
3987
|
K(() => {
|
|
@@ -3863,7 +4078,7 @@ function ci({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
|
|
|
3863
4078
|
]);
|
|
3864
4079
|
let ue = G(async () => {
|
|
3865
4080
|
if (!R) return;
|
|
3866
|
-
let n =
|
|
4081
|
+
let n = wi(R, i, t, r);
|
|
3867
4082
|
if (n.length > 0) {
|
|
3868
4083
|
ee(n);
|
|
3869
4084
|
return;
|
|
@@ -3892,7 +4107,7 @@ function ci({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
|
|
|
3892
4107
|
O(null), j([]);
|
|
3893
4108
|
return;
|
|
3894
4109
|
}
|
|
3895
|
-
let o =
|
|
4110
|
+
let o = wi({
|
|
3896
4111
|
...c.find((n) => b(V(t, n)) === e) ?? {},
|
|
3897
4112
|
...a
|
|
3898
4113
|
}, i, t, r);
|
|
@@ -3971,7 +4186,7 @@ function ci({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
|
|
|
3971
4186
|
},
|
|
3972
4187
|
children: [c.map((n) => {
|
|
3973
4188
|
let r = b(V(t, n)), c = W.has(r), u = N[r], d = _ && r ? _.replace(/:\w+/, r) : void 0;
|
|
3974
|
-
return /* @__PURE__ */ Z(
|
|
4189
|
+
return /* @__PURE__ */ Z(Ai, {
|
|
3975
4190
|
rowId: r,
|
|
3976
4191
|
row: n,
|
|
3977
4192
|
entity: t,
|
|
@@ -4006,7 +4221,7 @@ function ci({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
|
|
|
4006
4221
|
entityCode: e,
|
|
4007
4222
|
onRowActionSuccess: f
|
|
4008
4223
|
}, r);
|
|
4009
|
-
}), R && /* @__PURE__ */ Z(
|
|
4224
|
+
}), R && /* @__PURE__ */ Z(Fi, {
|
|
4010
4225
|
draftRow: R,
|
|
4011
4226
|
entity: t,
|
|
4012
4227
|
columns: i,
|
|
@@ -4065,7 +4280,7 @@ function ci({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
|
|
|
4065
4280
|
} })
|
|
4066
4281
|
] }) }), /* @__PURE__ */ Q("tbody", { children: [c.map((n) => {
|
|
4067
4282
|
let r = b(V(t, n)), c = W.has(r), u = N[r], d = _ && r ? _.replace(/:\w+/, r) : void 0;
|
|
4068
|
-
return /* @__PURE__ */ Z(
|
|
4283
|
+
return /* @__PURE__ */ Z(ji, {
|
|
4069
4284
|
rowId: r,
|
|
4070
4285
|
row: n,
|
|
4071
4286
|
entity: t,
|
|
@@ -4100,7 +4315,7 @@ function ci({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
|
|
|
4100
4315
|
entityCode: e,
|
|
4101
4316
|
onRowActionSuccess: f
|
|
4102
4317
|
}, r);
|
|
4103
|
-
}), R && /* @__PURE__ */ Z(
|
|
4318
|
+
}), R && /* @__PURE__ */ Z(Pi, {
|
|
4104
4319
|
draftRow: R,
|
|
4105
4320
|
entity: t,
|
|
4106
4321
|
columns: i,
|
|
@@ -4131,12 +4346,12 @@ function ci({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
|
|
|
4131
4346
|
})
|
|
4132
4347
|
] });
|
|
4133
4348
|
}
|
|
4134
|
-
function
|
|
4349
|
+
function Ai({ rowId: t, row: n, entity: r, entities: i, screens: a, columns: s, editableColumns: c, editable: l, interaction: d, isEditing: f, editErrors: p, isDeleting: m, rowState: h, onCellChange: g, onDeleteClick: _, onStartEdit: v, onConfirmEdit: y, onCancelEdit: b, refs: S, identityCol: C, href: w, rowActions: T, onRowActionSuccess: E }) {
|
|
4135
4350
|
let D = j(), k = je(), A = q(() => !h || Object.keys(h.buffer).length === 0 ? n : {
|
|
4136
4351
|
...n,
|
|
4137
4352
|
...h.buffer
|
|
4138
4353
|
}, [n, h]);
|
|
4139
|
-
return d === "row_edit" && f ? /* @__PURE__ */ Z(
|
|
4354
|
+
return d === "row_edit" && f ? /* @__PURE__ */ Z(Ni, {
|
|
4140
4355
|
values: A,
|
|
4141
4356
|
entity: r,
|
|
4142
4357
|
columns: s,
|
|
@@ -4245,7 +4460,7 @@ function li({ rowId: t, row: n, entity: r, entities: i, screens: a, columns: s,
|
|
|
4245
4460
|
onClick: () => _(t),
|
|
4246
4461
|
title: "Delete row"
|
|
4247
4462
|
})
|
|
4248
|
-
] }), !l && T && T.length > 0 && /* @__PURE__ */ Z(
|
|
4463
|
+
] }), !l && T && T.length > 0 && /* @__PURE__ */ Z(hi, {
|
|
4249
4464
|
actions: T,
|
|
4250
4465
|
objectIds: [t],
|
|
4251
4466
|
row: A,
|
|
@@ -4254,12 +4469,12 @@ function li({ rowId: t, row: n, entity: r, entities: i, screens: a, columns: s,
|
|
|
4254
4469
|
})]
|
|
4255
4470
|
});
|
|
4256
4471
|
}
|
|
4257
|
-
function
|
|
4472
|
+
function ji({ rowId: t, row: n, entity: r, entities: i, screens: a, 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: S, onCancelEdit: C, refs: w, identityCol: T, href: E, rowActions: D, onRowActionSuccess: k }) {
|
|
4258
4473
|
let A = j(), M = q(() => !_ || Object.keys(_.buffer).length === 0 ? n : {
|
|
4259
4474
|
...n,
|
|
4260
4475
|
..._.buffer
|
|
4261
4476
|
}, [n, _]);
|
|
4262
|
-
if (d === "row_edit" && f) return /* @__PURE__ */ Z(
|
|
4477
|
+
if (d === "row_edit" && f) return /* @__PURE__ */ Z(Mi, {
|
|
4263
4478
|
values: M,
|
|
4264
4479
|
entity: r,
|
|
4265
4480
|
columns: s,
|
|
@@ -4372,7 +4587,7 @@ function ui({ rowId: t, row: n, entity: r, entities: i, screens: a, columns: s,
|
|
|
4372
4587
|
borderBottom: "1px solid var(--divider)",
|
|
4373
4588
|
verticalAlign: "middle"
|
|
4374
4589
|
},
|
|
4375
|
-
children: /* @__PURE__ */ Z(
|
|
4590
|
+
children: /* @__PURE__ */ Z(hi, {
|
|
4376
4591
|
actions: D,
|
|
4377
4592
|
objectIds: [t],
|
|
4378
4593
|
row: M,
|
|
@@ -4382,7 +4597,7 @@ function ui({ rowId: t, row: n, entity: r, entities: i, screens: a, columns: s,
|
|
|
4382
4597
|
]
|
|
4383
4598
|
});
|
|
4384
4599
|
}
|
|
4385
|
-
function
|
|
4600
|
+
function Mi({ values: t, entity: n, columns: r, editableColumns: i, errors: a, saving: s, onChange: c, onConfirm: l, onCancel: d, refs: f, accent: p }) {
|
|
4386
4601
|
let m = j(), h = a.find((e) => e.startsWith("_error:")), g = new Set(a.filter((e) => !e.startsWith("_error:"))), _ = {
|
|
4387
4602
|
padding: "6px 12px",
|
|
4388
4603
|
borderBottom: "1px solid var(--divider)",
|
|
@@ -4465,7 +4680,7 @@ function di({ values: t, entity: n, columns: r, editableColumns: i, errors: a, s
|
|
|
4465
4680
|
})]
|
|
4466
4681
|
});
|
|
4467
4682
|
}
|
|
4468
|
-
function
|
|
4683
|
+
function Ni({ values: t, entity: n, columns: r, editableColumns: i, errors: a, saving: s, onChange: c, onConfirm: l, onCancel: d, refs: f, accent: p }) {
|
|
4469
4684
|
let m = j(), h = je(), g = a.find((e) => e.startsWith("_error:")), _ = new Set(a.filter((e) => !e.startsWith("_error:")));
|
|
4470
4685
|
return /* @__PURE__ */ Q("div", {
|
|
4471
4686
|
style: {
|
|
@@ -4566,8 +4781,8 @@ function fi({ values: t, entity: n, columns: r, editableColumns: i, errors: a, s
|
|
|
4566
4781
|
})]
|
|
4567
4782
|
});
|
|
4568
4783
|
}
|
|
4569
|
-
function
|
|
4570
|
-
return /* @__PURE__ */ Z(
|
|
4784
|
+
function Pi({ draftRow: e, entity: t, columns: n, editableColumns: r, foreignKey: i, draftErrors: a, draftSaving: o, onChange: s, onConfirm: c, onCancel: l, refs: u }) {
|
|
4785
|
+
return /* @__PURE__ */ Z(Mi, {
|
|
4571
4786
|
values: e,
|
|
4572
4787
|
entity: t,
|
|
4573
4788
|
columns: n,
|
|
@@ -4584,8 +4799,8 @@ function pi({ draftRow: e, entity: t, columns: n, editableColumns: r, foreignKey
|
|
|
4584
4799
|
accent: !0
|
|
4585
4800
|
});
|
|
4586
4801
|
}
|
|
4587
|
-
function
|
|
4588
|
-
return /* @__PURE__ */ Z(
|
|
4802
|
+
function Fi({ draftRow: e, entity: t, columns: n, editableColumns: r, foreignKey: i, draftErrors: a, draftSaving: o, onChange: s, onConfirm: c, onCancel: l, refs: u }) {
|
|
4803
|
+
return /* @__PURE__ */ Z(Ni, {
|
|
4589
4804
|
values: e,
|
|
4590
4805
|
entity: t,
|
|
4591
4806
|
columns: n,
|
|
@@ -4604,21 +4819,21 @@ function mi({ draftRow: e, entity: t, columns: n, editableColumns: r, foreignKey
|
|
|
4604
4819
|
}
|
|
4605
4820
|
//#endregion
|
|
4606
4821
|
//#region src/components/shared/LoadingSkeleton.tsx
|
|
4607
|
-
var
|
|
4822
|
+
var Ii = {
|
|
4608
4823
|
display: "block",
|
|
4609
4824
|
background: "linear-gradient(90deg, var(--surface-3) 0%, var(--surface-2) 40%, var(--surface-3) 80%)",
|
|
4610
4825
|
backgroundSize: "200% 100%",
|
|
4611
4826
|
borderRadius: 6,
|
|
4612
4827
|
animation: "declarion-shimmer 1.2s ease-in-out infinite"
|
|
4613
4828
|
};
|
|
4614
|
-
function
|
|
4829
|
+
function Li({ height: e, width: t }) {
|
|
4615
4830
|
return /* @__PURE__ */ Q(X, { children: [/* @__PURE__ */ Z("style", { children: "@keyframes declarion-shimmer{from{background-position:200% 0}to{background-position:-200% 0}}" }), /* @__PURE__ */ Z("span", { style: {
|
|
4616
|
-
...
|
|
4831
|
+
...Ii,
|
|
4617
4832
|
height: e,
|
|
4618
4833
|
width: t ?? "100%"
|
|
4619
4834
|
} })] });
|
|
4620
4835
|
}
|
|
4621
|
-
function
|
|
4836
|
+
function Ri({ rows: e = 8, cols: t = 4 }) {
|
|
4622
4837
|
return /* @__PURE__ */ Q("div", {
|
|
4623
4838
|
style: {
|
|
4624
4839
|
padding: 16,
|
|
@@ -4633,7 +4848,7 @@ function _i({ rows: e = 8, cols: t = 4 }) {
|
|
|
4633
4848
|
},
|
|
4634
4849
|
children: Array.from({ length: t }).map((e, t) => /* @__PURE__ */ Z("div", {
|
|
4635
4850
|
style: { flex: 1 },
|
|
4636
|
-
children: /* @__PURE__ */ Z(
|
|
4851
|
+
children: /* @__PURE__ */ Z(Li, { height: 14 })
|
|
4637
4852
|
}, t))
|
|
4638
4853
|
}), Array.from({ length: e }).map((e, n) => /* @__PURE__ */ Z("div", {
|
|
4639
4854
|
style: {
|
|
@@ -4642,12 +4857,12 @@ function _i({ rows: e = 8, cols: t = 4 }) {
|
|
|
4642
4857
|
},
|
|
4643
4858
|
children: Array.from({ length: t }).map((e, t) => /* @__PURE__ */ Z("div", {
|
|
4644
4859
|
style: { flex: 1 },
|
|
4645
|
-
children: /* @__PURE__ */ Z(
|
|
4860
|
+
children: /* @__PURE__ */ Z(Li, { height: 28 })
|
|
4646
4861
|
}, t))
|
|
4647
4862
|
}, n))]
|
|
4648
4863
|
});
|
|
4649
4864
|
}
|
|
4650
|
-
function
|
|
4865
|
+
function zi() {
|
|
4651
4866
|
return /* @__PURE__ */ Q("div", {
|
|
4652
4867
|
style: {
|
|
4653
4868
|
padding: 20,
|
|
@@ -4656,7 +4871,7 @@ function vi() {
|
|
|
4656
4871
|
gap: 16
|
|
4657
4872
|
},
|
|
4658
4873
|
children: [
|
|
4659
|
-
/* @__PURE__ */ Z(
|
|
4874
|
+
/* @__PURE__ */ Z(Li, {
|
|
4660
4875
|
height: 12,
|
|
4661
4876
|
width: 160
|
|
4662
4877
|
}),
|
|
@@ -4667,11 +4882,11 @@ function vi() {
|
|
|
4667
4882
|
gap: 12
|
|
4668
4883
|
},
|
|
4669
4884
|
children: [/* @__PURE__ */ Z("span", { style: {
|
|
4670
|
-
...
|
|
4885
|
+
...Ii,
|
|
4671
4886
|
width: 32,
|
|
4672
4887
|
height: 32,
|
|
4673
4888
|
borderRadius: 8
|
|
4674
|
-
} }), /* @__PURE__ */ Z(
|
|
4889
|
+
} }), /* @__PURE__ */ Z(Li, {
|
|
4675
4890
|
height: 22,
|
|
4676
4891
|
width: 240
|
|
4677
4892
|
})]
|
|
@@ -4688,7 +4903,7 @@ function vi() {
|
|
|
4688
4903
|
padding: "11px 14px",
|
|
4689
4904
|
borderBottom: "1px solid var(--divider)"
|
|
4690
4905
|
},
|
|
4691
|
-
children: /* @__PURE__ */ Z(
|
|
4906
|
+
children: /* @__PURE__ */ Z(Li, {
|
|
4692
4907
|
height: 13,
|
|
4693
4908
|
width: 150
|
|
4694
4909
|
})
|
|
@@ -4704,12 +4919,12 @@ function vi() {
|
|
|
4704
4919
|
display: "flex",
|
|
4705
4920
|
gap: 16
|
|
4706
4921
|
},
|
|
4707
|
-
children: [/* @__PURE__ */ Z(
|
|
4922
|
+
children: [/* @__PURE__ */ Z(Li, {
|
|
4708
4923
|
height: 13,
|
|
4709
4924
|
width: 110
|
|
4710
4925
|
}), /* @__PURE__ */ Z("div", {
|
|
4711
4926
|
style: { flex: 1 },
|
|
4712
|
-
children: /* @__PURE__ */ Z(
|
|
4927
|
+
children: /* @__PURE__ */ Z(Li, { height: 13 })
|
|
4713
4928
|
})]
|
|
4714
4929
|
}, t))
|
|
4715
4930
|
})]
|
|
@@ -4719,11 +4934,11 @@ function vi() {
|
|
|
4719
4934
|
}
|
|
4720
4935
|
//#endregion
|
|
4721
4936
|
//#region src/lib/sort.ts
|
|
4722
|
-
var
|
|
4937
|
+
var Bi = {
|
|
4723
4938
|
nulls_first: "first",
|
|
4724
4939
|
nulls_last: "last"
|
|
4725
4940
|
};
|
|
4726
|
-
function
|
|
4941
|
+
function Vi(e) {
|
|
4727
4942
|
if (!e) return [];
|
|
4728
4943
|
let t = [];
|
|
4729
4944
|
for (let n of e.split(",")) {
|
|
@@ -4736,14 +4951,14 @@ function bi(e) {
|
|
|
4736
4951
|
dir: r[1]?.trim().toLowerCase() === "desc" ? "desc" : "asc"
|
|
4737
4952
|
}, o = r[2]?.trim().toLowerCase();
|
|
4738
4953
|
if (o) {
|
|
4739
|
-
let e =
|
|
4954
|
+
let e = Bi[o];
|
|
4740
4955
|
e && (a.nulls = e);
|
|
4741
4956
|
}
|
|
4742
4957
|
t.push(a);
|
|
4743
4958
|
}
|
|
4744
4959
|
return t;
|
|
4745
4960
|
}
|
|
4746
|
-
function
|
|
4961
|
+
function Hi(e) {
|
|
4747
4962
|
if (!e) return;
|
|
4748
4963
|
let t = [];
|
|
4749
4964
|
for (let n of e.split(",")) {
|
|
@@ -4754,30 +4969,30 @@ function xi(e) {
|
|
|
4754
4969
|
}
|
|
4755
4970
|
return t.length > 0 ? t.join(",") : void 0;
|
|
4756
4971
|
}
|
|
4757
|
-
function
|
|
4972
|
+
function Ui(e) {
|
|
4758
4973
|
return e.map((e) => {
|
|
4759
4974
|
let t = `${e.field}:${e.dir}`;
|
|
4760
4975
|
return e.nulls === "first" ? `${t}:nulls_first` : e.nulls === "last" ? `${t}:nulls_last` : t;
|
|
4761
4976
|
}).join(",");
|
|
4762
4977
|
}
|
|
4763
|
-
function
|
|
4978
|
+
function Wi(e, t) {
|
|
4764
4979
|
let n = e.findIndex((e) => e.field === t);
|
|
4765
4980
|
return n >= 0 ? [...e.slice(0, n), ...e.slice(n + 1)] : e.length >= 5 ? e : [...e, {
|
|
4766
4981
|
field: t,
|
|
4767
4982
|
dir: "asc"
|
|
4768
4983
|
}];
|
|
4769
4984
|
}
|
|
4770
|
-
function
|
|
4985
|
+
function Gi(e, t) {
|
|
4771
4986
|
let n = e.filter((e) => e.field !== t.field);
|
|
4772
4987
|
return n.length >= 5 ? e : [...n, t];
|
|
4773
4988
|
}
|
|
4774
|
-
function
|
|
4989
|
+
function Ki(e, t) {
|
|
4775
4990
|
let n = e.findIndex((e) => e.field === t);
|
|
4776
4991
|
return n < 0 ? e : [...e.slice(0, n), ...e.slice(n + 1)];
|
|
4777
4992
|
}
|
|
4778
4993
|
//#endregion
|
|
4779
4994
|
//#region src/hooks/useScreenBack.ts
|
|
4780
|
-
function
|
|
4995
|
+
function qi(e) {
|
|
4781
4996
|
let t = Pe(), r = n(), i = c(), a = Tt((e) => e.depth), { data: o } = A(), s = e?.fallback, l = wt((e) => {
|
|
4782
4997
|
let t = e.tabs.find((t) => t.id === e.activeTabId);
|
|
4783
4998
|
return t ? t.returnTo : void 0;
|
|
@@ -4825,40 +5040,40 @@ function Ei(e) {
|
|
|
4825
5040
|
}
|
|
4826
5041
|
//#endregion
|
|
4827
5042
|
//#region src/lib/field-classification.ts
|
|
4828
|
-
function
|
|
5043
|
+
function Ji(e, t) {
|
|
4829
5044
|
let n = e?.field_access?.[t];
|
|
4830
5045
|
return !n || n.read === "granted";
|
|
4831
5046
|
}
|
|
4832
|
-
function
|
|
5047
|
+
function Yi(e, t) {
|
|
4833
5048
|
let n = e?.field_access?.[t];
|
|
4834
5049
|
return !n || n.write === "granted";
|
|
4835
5050
|
}
|
|
4836
|
-
function
|
|
5051
|
+
function Xi(e, t) {
|
|
4837
5052
|
return e?.field_access?.[t]?.classification;
|
|
4838
5053
|
}
|
|
4839
|
-
function
|
|
5054
|
+
function Zi(e, t) {
|
|
4840
5055
|
return e?.field_access?.[t]?.required_permission;
|
|
4841
5056
|
}
|
|
4842
|
-
function
|
|
4843
|
-
let r =
|
|
5057
|
+
function Qi(e, t, n) {
|
|
5058
|
+
let r = Xi(t, n);
|
|
4844
5059
|
if (r) return e?.classifications?.[r];
|
|
4845
5060
|
}
|
|
4846
|
-
function
|
|
4847
|
-
return !!
|
|
5061
|
+
function $i(e, t, n) {
|
|
5062
|
+
return !!Qi(e, t, n)?.sod_protected;
|
|
4848
5063
|
}
|
|
4849
|
-
function
|
|
5064
|
+
function ea(e, t) {
|
|
4850
5065
|
return e?.field_access?.[t];
|
|
4851
5066
|
}
|
|
4852
5067
|
//#endregion
|
|
4853
5068
|
//#region src/components/pages/list/cardProjection.ts
|
|
4854
|
-
var
|
|
5069
|
+
var ta = 4, na = 2, ra = 2, ia = [
|
|
4855
5070
|
"screen_card",
|
|
4856
5071
|
"entity_card",
|
|
4857
5072
|
"saved_view_columns",
|
|
4858
5073
|
"screen_default_columns",
|
|
4859
5074
|
"screen_columns",
|
|
4860
5075
|
"entity_inference"
|
|
4861
|
-
],
|
|
5076
|
+
], aa = /* @__PURE__ */ new Set(["_select", "_actions"]), oa = /* @__PURE__ */ new Set([
|
|
4862
5077
|
"text",
|
|
4863
5078
|
"rich_text",
|
|
4864
5079
|
"multilang_text",
|
|
@@ -4867,11 +5082,11 @@ var Pi = 4, Fi = 2, Ii = 2, Li = [
|
|
|
4867
5082
|
"secret",
|
|
4868
5083
|
"password",
|
|
4869
5084
|
"bytes"
|
|
4870
|
-
]),
|
|
5085
|
+
]), sa = /* @__PURE__ */ new Set(["enum", "bool"]), ca = /* @__PURE__ */ new Set([
|
|
4871
5086
|
"date",
|
|
4872
5087
|
"time",
|
|
4873
5088
|
"timestamp"
|
|
4874
|
-
]),
|
|
5089
|
+
]), la = /* @__PURE__ */ new Set([
|
|
4875
5090
|
"string",
|
|
4876
5091
|
"text",
|
|
4877
5092
|
"email",
|
|
@@ -4897,31 +5112,31 @@ var Pi = 4, Fi = 2, Ii = 2, Li = [
|
|
|
4897
5112
|
"enum",
|
|
4898
5113
|
"status"
|
|
4899
5114
|
]);
|
|
4900
|
-
function
|
|
5115
|
+
function ua(e) {
|
|
4901
5116
|
let { entity: t, screen: n, savedViewColumns: r } = e, i = n?.card;
|
|
4902
|
-
if (i) return
|
|
4903
|
-
if (t?.card) return
|
|
4904
|
-
let a =
|
|
4905
|
-
return
|
|
4906
|
-
}
|
|
4907
|
-
function
|
|
4908
|
-
let { entity: t, screen: n, presentation: r, visibleColumns: i, card: a, rowActions: o, toolbarActions: s, bulkActions: c, sort: l, includeDetailHandoff: u = !0, screens: d } = e, f = new
|
|
4909
|
-
for (let e of p) f.addField(e, "render"),
|
|
4910
|
-
let m =
|
|
5117
|
+
if (i) return pa(t, i, "screen_card");
|
|
5118
|
+
if (t?.card) return pa(t, t.card, "entity_card");
|
|
5119
|
+
let a = ga(t, n, r);
|
|
5120
|
+
return ma(t, a.columns, a.source);
|
|
5121
|
+
}
|
|
5122
|
+
function da(e) {
|
|
5123
|
+
let { entity: t, screen: n, presentation: r, visibleColumns: i, card: a, rowActions: o, toolbarActions: s, bulkActions: c, sort: l, includeDetailHandoff: u = !0, screens: d } = e, f = new Ka(), p = r === "cards" ? a.renderFields : va(t, i, { explicit: !0 });
|
|
5124
|
+
for (let e of p) f.addField(e, "render"), Ha(t, e, f, "render");
|
|
5125
|
+
let m = ka(t, f), h = Pa(t, [
|
|
4911
5126
|
o,
|
|
4912
5127
|
s,
|
|
4913
5128
|
c
|
|
4914
|
-
], f), g =
|
|
5129
|
+
], f), g = Fa(t, l, f), _ = Ia(t, n, d, f);
|
|
4915
5130
|
if (u) for (let e of m) f.addField(e, "detail_handoff");
|
|
4916
|
-
let v = new
|
|
5131
|
+
let v = new Ga();
|
|
4917
5132
|
for (let e of m) v.add(e);
|
|
4918
5133
|
for (let e of h) v.add(e);
|
|
4919
5134
|
for (let e of g) v.add(e);
|
|
4920
5135
|
for (let e of _) v.add(e);
|
|
4921
|
-
let y = new
|
|
4922
|
-
for (let e of p)
|
|
4923
|
-
for (let e of v.values())
|
|
4924
|
-
let b = y.values(), x =
|
|
5136
|
+
let y = new Ga();
|
|
5137
|
+
for (let e of p) Va(t, e, y, f);
|
|
5138
|
+
for (let e of v.values()) Va(t, e, y, f);
|
|
5139
|
+
let b = y.values(), x = Ua(f);
|
|
4925
5140
|
return {
|
|
4926
5141
|
renderFields: p,
|
|
4927
5142
|
dependencyFields: v.values().filter((e) => !p.includes(e)),
|
|
@@ -4933,22 +5148,22 @@ function Wi(e) {
|
|
|
4933
5148
|
reasons: f.snapshot()
|
|
4934
5149
|
};
|
|
4935
5150
|
}
|
|
4936
|
-
function
|
|
5151
|
+
function fa(e, t, n) {
|
|
4937
5152
|
if (!e || t?.on_row_click !== "peek" || t.quick_peek?.enabled === !1) return [];
|
|
4938
5153
|
let r = t.quick_peek?.fields;
|
|
4939
|
-
if (r && r.length > 0) return
|
|
5154
|
+
if (r && r.length > 0) return va(e, r, { explicit: !0 });
|
|
4940
5155
|
let i = t.quick_peek?.sections;
|
|
4941
5156
|
if (i && i.length > 0) {
|
|
4942
|
-
let r = Object.values(n ?? {}).find((e) => e.type === "detail" && e.entity === t.entity), a = new
|
|
4943
|
-
|
|
4944
|
-
let o =
|
|
5157
|
+
let r = Object.values(n ?? {}).find((e) => e.type === "detail" && e.entity === t.entity), a = new Ga();
|
|
5158
|
+
La(r?.items, new Set(i.map(String)), a);
|
|
5159
|
+
let o = va(e, a.values(), { explicit: !0 });
|
|
4945
5160
|
if (o.length > 0) return o;
|
|
4946
5161
|
}
|
|
4947
|
-
return
|
|
5162
|
+
return Ba(e);
|
|
4948
5163
|
}
|
|
4949
|
-
function
|
|
4950
|
-
let r = t.max_body_fields ??
|
|
4951
|
-
return
|
|
5164
|
+
function pa(e, t, n) {
|
|
5165
|
+
let r = t.max_body_fields ?? ta, i = ya(e, t.title_field, { explicit: !0 }), a = ya(e, t.subtitle_field, { explicit: !0 }), o = va(e, t.badge_fields ?? [], { explicit: !0 }), s = va(e, t.fields ?? [], { explicit: !0 }), c = va(e, t.meta_fields ?? [], { explicit: !0 });
|
|
5166
|
+
return ha({
|
|
4952
5167
|
source: n,
|
|
4953
5168
|
explicit: !0,
|
|
4954
5169
|
titleField: i,
|
|
@@ -4961,29 +5176,29 @@ function Ki(e, t, n) {
|
|
|
4961
5176
|
maxBodyFields: r
|
|
4962
5177
|
});
|
|
4963
5178
|
}
|
|
4964
|
-
function
|
|
4965
|
-
let r =
|
|
5179
|
+
function ma(e, t, n) {
|
|
5180
|
+
let r = va(e, t, { explicit: !1 }), i = ta, a = ya(e, e?.display?.display_field, { explicit: !1 }), o = a ?? ba(e, r, {
|
|
4966
5181
|
allowLong: !1,
|
|
4967
5182
|
allowAuto: !1
|
|
4968
|
-
}), s = a !== void 0, c = o ? /* @__PURE__ */ new Set([o]) : void 0, l = r.find((t) => !c?.has(t) &&
|
|
5183
|
+
}), s = a !== void 0, c = o ? /* @__PURE__ */ new Set([o]) : void 0, l = r.find((t) => !c?.has(t) && Sa(e, t)), u = new Set([o, l].filter((e) => !!e)), d = wa(e, r).filter((e) => !u.has(e)).slice(0, na);
|
|
4969
5184
|
for (let e of d) u.add(e);
|
|
4970
|
-
let f = r.filter((t) => !u.has(t) &&
|
|
5185
|
+
let f = r.filter((t) => !u.has(t) && Ta(e, t)).slice(0, ra);
|
|
4971
5186
|
for (let e of f) u.add(e);
|
|
4972
|
-
return
|
|
5187
|
+
return ha({
|
|
4973
5188
|
source: n,
|
|
4974
5189
|
explicit: !1,
|
|
4975
5190
|
titleField: o,
|
|
4976
5191
|
titleUsesDisplay: s,
|
|
4977
5192
|
subtitleField: l,
|
|
4978
5193
|
badgeFields: d,
|
|
4979
|
-
bodyFields: r.filter((t) => !u.has(t) &&
|
|
5194
|
+
bodyFields: r.filter((t) => !u.has(t) && xa(e, t)).slice(0, i),
|
|
4980
5195
|
metaFields: f,
|
|
4981
5196
|
hideEmptyFields: !0,
|
|
4982
5197
|
maxBodyFields: i
|
|
4983
5198
|
});
|
|
4984
5199
|
}
|
|
4985
|
-
function
|
|
4986
|
-
let t = new
|
|
5200
|
+
function ha(e) {
|
|
5201
|
+
let t = new Ga(), n = [], r = (r, i) => {
|
|
4987
5202
|
!r || t.has(r) || (t.add(r), n.push({
|
|
4988
5203
|
field: r,
|
|
4989
5204
|
bucket: i,
|
|
@@ -5007,10 +5222,10 @@ function Ji(e) {
|
|
|
5007
5222
|
maxBodyFields: e.maxBodyFields,
|
|
5008
5223
|
renderFields: t.values(),
|
|
5009
5224
|
fields: n,
|
|
5010
|
-
sourcePrecedence:
|
|
5225
|
+
sourcePrecedence: ia
|
|
5011
5226
|
};
|
|
5012
5227
|
}
|
|
5013
|
-
function
|
|
5228
|
+
function ga(e, t, n) {
|
|
5014
5229
|
return n && n.length > 0 ? {
|
|
5015
5230
|
source: "saved_view_columns",
|
|
5016
5231
|
columns: n
|
|
@@ -5022,29 +5237,29 @@ function Yi(e, t, n) {
|
|
|
5022
5237
|
columns: t.columns
|
|
5023
5238
|
} : {
|
|
5024
5239
|
source: "entity_inference",
|
|
5025
|
-
columns:
|
|
5240
|
+
columns: _a(e)
|
|
5026
5241
|
};
|
|
5027
5242
|
}
|
|
5028
|
-
function
|
|
5243
|
+
function _a(e) {
|
|
5029
5244
|
if (!e) return [];
|
|
5030
5245
|
let t = [];
|
|
5031
5246
|
e.display.display_field && t.push(e.display.display_field);
|
|
5032
5247
|
for (let [n] of e.fields) t.push(n);
|
|
5033
5248
|
for (let n of Object.keys(e.status_groups ?? {})) t.push(`$status.${n}`);
|
|
5034
5249
|
for (let n of Object.keys(e.properties ?? {})) t.push(`$property.${n}`);
|
|
5035
|
-
if (e.files) for (let [n] of e.files) t.push(n);
|
|
5250
|
+
if (e.evidence_covered && t.push("$evidence"), e.files) for (let [n] of e.files) t.push(n);
|
|
5036
5251
|
return t;
|
|
5037
5252
|
}
|
|
5038
|
-
function
|
|
5039
|
-
let r = new
|
|
5253
|
+
function va(e, t, n) {
|
|
5254
|
+
let r = new Ga();
|
|
5040
5255
|
for (let i of t) {
|
|
5041
|
-
let t =
|
|
5256
|
+
let t = ya(e, i, n);
|
|
5042
5257
|
t && r.add(t);
|
|
5043
5258
|
}
|
|
5044
5259
|
return r.values();
|
|
5045
5260
|
}
|
|
5046
|
-
function
|
|
5047
|
-
if (!t ||
|
|
5261
|
+
function ya(e, t, n) {
|
|
5262
|
+
if (!t || aa.has(t)) return;
|
|
5048
5263
|
if (!e) return t.startsWith("$") ? void 0 : t;
|
|
5049
5264
|
if (t.startsWith("$status.")) {
|
|
5050
5265
|
let n = t.slice(8);
|
|
@@ -5054,61 +5269,62 @@ function Qi(e, t, n) {
|
|
|
5054
5269
|
let n = t.slice(10);
|
|
5055
5270
|
return e.properties?.[n] ? t : void 0;
|
|
5056
5271
|
}
|
|
5272
|
+
if (t === "$evidence") return e.evidence_covered ? t : void 0;
|
|
5057
5273
|
if (t.startsWith("$")) return;
|
|
5058
5274
|
let r = e.fields.get(t), i = e.files?.get(t);
|
|
5059
5275
|
if (!(!r && !i) && (n.explicit || !(r && r.display?.is_listable === !1) && !(i && i.display?.is_listable === !1))) return t;
|
|
5060
5276
|
}
|
|
5061
|
-
function
|
|
5062
|
-
return t.find((t) => n.exclude?.has(t) || !n.allowAuto &&
|
|
5063
|
-
}
|
|
5064
|
-
function ea(e, t) {
|
|
5065
|
-
return !(!aa(e, t) || oa(e, t) || sa(e, t));
|
|
5277
|
+
function ba(e, t, n) {
|
|
5278
|
+
return t.find((t) => n.exclude?.has(t) || !n.allowAuto && Da(e, t) || !n.allowLong && Oa(e, t) ? !1 : Ea(e, t));
|
|
5066
5279
|
}
|
|
5067
|
-
function
|
|
5068
|
-
return !(!
|
|
5280
|
+
function xa(e, t) {
|
|
5281
|
+
return !(!Ea(e, t) || Da(e, t) || Oa(e, t));
|
|
5069
5282
|
}
|
|
5070
|
-
function
|
|
5071
|
-
|
|
5072
|
-
let n = Ca(e, t);
|
|
5073
|
-
return n.kind === "field" && Bi.has(n.field.type);
|
|
5283
|
+
function Sa(e, t) {
|
|
5284
|
+
return !(!Ea(e, t) || Da(e, t) || Oa(e, t) || Ta(e, t) || Ca(e, t));
|
|
5074
5285
|
}
|
|
5075
|
-
function
|
|
5076
|
-
|
|
5077
|
-
|
|
5078
|
-
|
|
5286
|
+
function Ca(e, t) {
|
|
5287
|
+
if (t.startsWith("$status.") || t.startsWith("$property.") || t === "$evidence") return !0;
|
|
5288
|
+
let n = Wa(e, t);
|
|
5289
|
+
return n.kind === "field" && sa.has(n.field.type);
|
|
5290
|
+
}
|
|
5291
|
+
function wa(e, t) {
|
|
5292
|
+
let n = new Ga();
|
|
5293
|
+
for (let e of t) (e.startsWith("$status.") || e.startsWith("$property.") || e === "$evidence") && n.add(e);
|
|
5294
|
+
for (let r of t) Ca(e, r) && n.add(r);
|
|
5079
5295
|
return n.values();
|
|
5080
5296
|
}
|
|
5081
|
-
function
|
|
5082
|
-
if (
|
|
5083
|
-
let n =
|
|
5084
|
-
return n.kind === "field" &&
|
|
5297
|
+
function Ta(e, t) {
|
|
5298
|
+
if (Da(e, t)) return !1;
|
|
5299
|
+
let n = Wa(e, t);
|
|
5300
|
+
return n.kind === "field" && ca.has(n.field.type);
|
|
5085
5301
|
}
|
|
5086
|
-
function
|
|
5087
|
-
return
|
|
5302
|
+
function Ea(e, t) {
|
|
5303
|
+
return Wa(e, t).kind !== "missing";
|
|
5088
5304
|
}
|
|
5089
|
-
function
|
|
5090
|
-
let n =
|
|
5305
|
+
function Da(e, t) {
|
|
5306
|
+
let n = Wa(e, t);
|
|
5091
5307
|
return n.kind === "field" && (n.field.primary === !0 || n.field.auto === !0);
|
|
5092
5308
|
}
|
|
5093
|
-
function
|
|
5094
|
-
let n =
|
|
5095
|
-
return n.kind === "file" ? n.file.mode !== "single" : n.kind === "field" &&
|
|
5309
|
+
function Oa(e, t) {
|
|
5310
|
+
let n = Wa(e, t);
|
|
5311
|
+
return n.kind === "file" ? n.file.mode !== "single" : n.kind === "field" && oa.has(n.field.type);
|
|
5096
5312
|
}
|
|
5097
|
-
function
|
|
5313
|
+
function ka(e, t) {
|
|
5098
5314
|
if (!e) return [];
|
|
5099
|
-
let n = new
|
|
5315
|
+
let n = new Ga();
|
|
5100
5316
|
for (let r of z(e)) n.add(r), t.addField(r, "identity");
|
|
5101
|
-
let r =
|
|
5102
|
-
r && (n.add(r), t.addField(r, "display"),
|
|
5103
|
-
for (let r of
|
|
5104
|
-
let i =
|
|
5105
|
-
i && (n.add(i), t.addField(i, "display_template"),
|
|
5317
|
+
let r = ya(e, e.display.display_field, { explicit: !0 });
|
|
5318
|
+
r && (n.add(r), t.addField(r, "display"), Ha(e, r, t, "display"));
|
|
5319
|
+
for (let r of Aa(e.display.display_template)) {
|
|
5320
|
+
let i = ya(e, r, { explicit: !0 });
|
|
5321
|
+
i && (n.add(i), t.addField(i, "display_template"), Ha(e, i, t, "display_template"));
|
|
5106
5322
|
}
|
|
5107
5323
|
return n.values();
|
|
5108
5324
|
}
|
|
5109
|
-
function
|
|
5325
|
+
function Aa(e) {
|
|
5110
5326
|
if (!e) return [];
|
|
5111
|
-
let t = new
|
|
5327
|
+
let t = new Ga(), n = 0;
|
|
5112
5328
|
for (; n < e.length;) {
|
|
5113
5329
|
let r = e.indexOf("${", n);
|
|
5114
5330
|
if (r < 0) break;
|
|
@@ -5116,14 +5332,14 @@ function la(e) {
|
|
|
5116
5332
|
n = r + 2;
|
|
5117
5333
|
continue;
|
|
5118
5334
|
}
|
|
5119
|
-
let i =
|
|
5335
|
+
let i = ja(e, r + 2);
|
|
5120
5336
|
if (i < 0) break;
|
|
5121
|
-
for (let n of
|
|
5337
|
+
for (let n of Ma(e.slice(r + 2, i))) t.add(n);
|
|
5122
5338
|
n = i + 1;
|
|
5123
5339
|
}
|
|
5124
5340
|
return t.values();
|
|
5125
5341
|
}
|
|
5126
|
-
function
|
|
5342
|
+
function ja(e, t) {
|
|
5127
5343
|
let n = 0;
|
|
5128
5344
|
for (let r = t; r < e.length; r += 1) {
|
|
5129
5345
|
let t = e[r];
|
|
@@ -5138,62 +5354,62 @@ function ua(e, t) {
|
|
|
5138
5354
|
}
|
|
5139
5355
|
return -1;
|
|
5140
5356
|
}
|
|
5141
|
-
function
|
|
5142
|
-
let t = new
|
|
5357
|
+
function Ma(e) {
|
|
5358
|
+
let t = new Ga(), n = 0;
|
|
5143
5359
|
for (; n < e.length;) {
|
|
5144
5360
|
let r = e.indexOf("row.", n);
|
|
5145
5361
|
if (r < 0) break;
|
|
5146
|
-
if (r > 0 &&
|
|
5362
|
+
if (r > 0 && Na(e.charCodeAt(r - 1))) {
|
|
5147
5363
|
n = r + 4;
|
|
5148
5364
|
continue;
|
|
5149
5365
|
}
|
|
5150
5366
|
let i = r + 4, a = i;
|
|
5151
|
-
for (; a < e.length &&
|
|
5367
|
+
for (; a < e.length && Na(e.charCodeAt(a));) a += 1;
|
|
5152
5368
|
a > i && t.add(e.slice(i, a)), n = a;
|
|
5153
5369
|
}
|
|
5154
5370
|
return t.values();
|
|
5155
5371
|
}
|
|
5156
|
-
function
|
|
5372
|
+
function Na(e) {
|
|
5157
5373
|
return e >= 48 && e <= 57 || e >= 65 && e <= 90 || e >= 97 && e <= 122 || e === 95;
|
|
5158
5374
|
}
|
|
5159
|
-
function
|
|
5160
|
-
let r = new
|
|
5375
|
+
function Pa(e, t, n) {
|
|
5376
|
+
let r = new Ga();
|
|
5161
5377
|
for (let i of t) for (let t of i ?? []) for (let i of [
|
|
5162
5378
|
...t.action.visible_if ?? [],
|
|
5163
5379
|
...t.action.enabled_if ?? [],
|
|
5164
5380
|
...t.action.conditions ?? []
|
|
5165
5381
|
]) {
|
|
5166
|
-
let t =
|
|
5167
|
-
t && (r.add(t), n.addField(t, "condition"),
|
|
5382
|
+
let t = ya(e, i.field, { explicit: !0 });
|
|
5383
|
+
t && (r.add(t), n.addField(t, "condition"), Ha(e, t, n, "condition"));
|
|
5168
5384
|
}
|
|
5169
5385
|
return r.values();
|
|
5170
5386
|
}
|
|
5171
|
-
function
|
|
5172
|
-
let r = typeof t == "string" ?
|
|
5387
|
+
function Fa(e, t, n) {
|
|
5388
|
+
let r = typeof t == "string" ? Vi(t) : t ?? [], i = new Ga();
|
|
5173
5389
|
for (let t of r) {
|
|
5174
|
-
let r =
|
|
5175
|
-
r && (i.add(r), n.addField(r, "sort"),
|
|
5390
|
+
let r = ya(e, t.field, { explicit: !0 });
|
|
5391
|
+
r && (i.add(r), n.addField(r, "sort"), Ha(e, r, n, "sort"));
|
|
5176
5392
|
}
|
|
5177
5393
|
return i.values();
|
|
5178
5394
|
}
|
|
5179
|
-
function
|
|
5180
|
-
let i =
|
|
5181
|
-
for (let t of i) r.addField(t, "quick_peek"),
|
|
5395
|
+
function Ia(e, t, n, r) {
|
|
5396
|
+
let i = fa(e, t, n);
|
|
5397
|
+
for (let t of i) r.addField(t, "quick_peek"), Ha(e, t, r, "quick_peek");
|
|
5182
5398
|
return i;
|
|
5183
5399
|
}
|
|
5184
|
-
function
|
|
5400
|
+
function La(e, t, n) {
|
|
5185
5401
|
if (Array.isArray(e)) {
|
|
5186
5402
|
for (let r of e) if (!(!r || typeof r != "object")) {
|
|
5187
5403
|
if ("section" in r) {
|
|
5188
|
-
let e = r.section, i =
|
|
5189
|
-
i && t.has(i) &&
|
|
5404
|
+
let e = r.section, i = za(e?.name);
|
|
5405
|
+
i && t.has(i) && Ra(e?.items, n);
|
|
5190
5406
|
continue;
|
|
5191
5407
|
}
|
|
5192
|
-
"fields" in r &&
|
|
5408
|
+
"fields" in r && Ra([r], n);
|
|
5193
5409
|
}
|
|
5194
5410
|
}
|
|
5195
5411
|
}
|
|
5196
|
-
function
|
|
5412
|
+
function Ra(e, t) {
|
|
5197
5413
|
if (Array.isArray(e)) {
|
|
5198
5414
|
for (let n of e) if (!(!n || typeof n != "object")) {
|
|
5199
5415
|
if ("fields" in n) {
|
|
@@ -5206,11 +5422,11 @@ function _a(e, t) {
|
|
|
5206
5422
|
}
|
|
5207
5423
|
}
|
|
5208
5424
|
}
|
|
5209
|
-
"section" in n &&
|
|
5425
|
+
"section" in n && Ra(n.section?.items, t);
|
|
5210
5426
|
}
|
|
5211
5427
|
}
|
|
5212
5428
|
}
|
|
5213
|
-
function
|
|
5429
|
+
function za(e) {
|
|
5214
5430
|
if (typeof e == "string") return e;
|
|
5215
5431
|
if (e && typeof e == "object") {
|
|
5216
5432
|
let t = Object.values(e).find((e) => typeof e == "string");
|
|
@@ -5218,21 +5434,21 @@ function va(e) {
|
|
|
5218
5434
|
}
|
|
5219
5435
|
return "";
|
|
5220
5436
|
}
|
|
5221
|
-
function
|
|
5437
|
+
function Ba(e) {
|
|
5222
5438
|
let t = [];
|
|
5223
5439
|
for (let [n, r] of e.fields) {
|
|
5224
5440
|
if (r.primary || r.auto || r.ref || r.array || r.structure || r.display?.is_listable === !1) continue;
|
|
5225
5441
|
let e = (r.type || "").toLowerCase(), i = !!(r.enum || r.values);
|
|
5226
|
-
if (!(!
|
|
5442
|
+
if (!(!la.has(e) && !i) && (t.push(n), t.length >= 8)) break;
|
|
5227
5443
|
}
|
|
5228
5444
|
return t;
|
|
5229
5445
|
}
|
|
5230
|
-
function
|
|
5446
|
+
function Va(e, t, n, r) {
|
|
5231
5447
|
if (!t || t.startsWith("$")) return;
|
|
5232
|
-
let i =
|
|
5448
|
+
let i = Wa(e, t);
|
|
5233
5449
|
i.kind !== "missing" && (n.add(t), i.kind === "file" && r.addField(t, "file_metadata"));
|
|
5234
5450
|
}
|
|
5235
|
-
function
|
|
5451
|
+
function Ha(e, t, n, r) {
|
|
5236
5452
|
if (t.startsWith("$status.")) {
|
|
5237
5453
|
n.addExpand("statuses", "status_expand"), r !== "status_expand" && n.addExpand("statuses", r), r !== "status_expand" && n.addField(t, r);
|
|
5238
5454
|
return;
|
|
@@ -5243,17 +5459,22 @@ function xa(e, t, n, r) {
|
|
|
5243
5459
|
e?.properties?.[i]?.ref && (n.addExpand("refs", "ref_expand"), r !== "ref_expand" && n.addExpand("refs", r));
|
|
5244
5460
|
return;
|
|
5245
5461
|
}
|
|
5246
|
-
|
|
5462
|
+
if (t === "$evidence") {
|
|
5463
|
+
n.addExpand("evidence", "evidence_expand"), r !== "evidence_expand" && n.addExpand("evidence", r), r !== "evidence_expand" && n.addField(t, r);
|
|
5464
|
+
return;
|
|
5465
|
+
}
|
|
5466
|
+
let i = Wa(e, t);
|
|
5247
5467
|
i.kind === "field" && i.field.type === "ref" && (n.addExpand("refs", "ref_expand"), r !== "ref_expand" && n.addExpand("refs", r));
|
|
5248
5468
|
}
|
|
5249
|
-
function
|
|
5469
|
+
function Ua(e) {
|
|
5250
5470
|
let t = e.snapshot().expand, n = [];
|
|
5251
|
-
return t.refs && n.push("refs"), t.statuses && n.push("statuses"), t.properties && n.push("properties"), n;
|
|
5471
|
+
return t.refs && n.push("refs"), t.statuses && n.push("statuses"), t.properties && n.push("properties"), t.evidence && n.push("evidence"), n;
|
|
5252
5472
|
}
|
|
5253
|
-
function
|
|
5473
|
+
function Wa(e, t) {
|
|
5254
5474
|
if (!e) return { kind: t.startsWith("$") ? "synthetic" : "missing" };
|
|
5255
5475
|
if (t.startsWith("$status.")) return e.status_groups?.[t.slice(8)] ? { kind: "synthetic" } : { kind: "missing" };
|
|
5256
5476
|
if (t.startsWith("$property.")) return e.properties?.[t.slice(10)] ? { kind: "synthetic" } : { kind: "missing" };
|
|
5477
|
+
if (t === "$evidence") return e.evidence_covered ? { kind: "synthetic" } : { kind: "missing" };
|
|
5257
5478
|
let n = e.fields.get(t);
|
|
5258
5479
|
if (n) return {
|
|
5259
5480
|
kind: "field",
|
|
@@ -5265,7 +5486,7 @@ function Ca(e, t) {
|
|
|
5265
5486
|
file: r
|
|
5266
5487
|
} : { kind: "missing" };
|
|
5267
5488
|
}
|
|
5268
|
-
var
|
|
5489
|
+
var Ga = class {
|
|
5269
5490
|
#e = [];
|
|
5270
5491
|
#t = /* @__PURE__ */ new Set();
|
|
5271
5492
|
add(e) {
|
|
@@ -5277,7 +5498,7 @@ var wa = class {
|
|
|
5277
5498
|
values() {
|
|
5278
5499
|
return [...this.#e];
|
|
5279
5500
|
}
|
|
5280
|
-
},
|
|
5501
|
+
}, Ka = class {
|
|
5281
5502
|
#e = /* @__PURE__ */ new Map();
|
|
5282
5503
|
#t = /* @__PURE__ */ new Map();
|
|
5283
5504
|
addField(e, t) {
|
|
@@ -5300,7 +5521,7 @@ var wa = class {
|
|
|
5300
5521
|
}
|
|
5301
5522
|
r.includes(n) || r.push(n);
|
|
5302
5523
|
}
|
|
5303
|
-
},
|
|
5524
|
+
}, qa = class extends Oe {
|
|
5304
5525
|
constructor(e) {
|
|
5305
5526
|
super(e), this.state = {
|
|
5306
5527
|
hasError: !1,
|
|
@@ -5368,15 +5589,15 @@ var wa = class {
|
|
|
5368
5589
|
};
|
|
5369
5590
|
//#endregion
|
|
5370
5591
|
//#region src/hooks/useObject.ts
|
|
5371
|
-
function
|
|
5592
|
+
function Ja(e, t) {
|
|
5372
5593
|
return [
|
|
5373
5594
|
"entity-item",
|
|
5374
5595
|
e,
|
|
5375
5596
|
t === void 0 || t === "new" ? void 0 : typeof t == "string" ? t : Object.keys(t).sort().map((e) => [e, t[e]])
|
|
5376
5597
|
];
|
|
5377
5598
|
}
|
|
5378
|
-
function
|
|
5379
|
-
let n =
|
|
5599
|
+
function Ya(e, t) {
|
|
5600
|
+
let n = Ja(e, t), r = n[2];
|
|
5380
5601
|
return Le({
|
|
5381
5602
|
queryKey: n,
|
|
5382
5603
|
queryFn: () => C(e, t),
|
|
@@ -5385,15 +5606,15 @@ function Oa(e, t) {
|
|
|
5385
5606
|
}
|
|
5386
5607
|
//#endregion
|
|
5387
5608
|
//#region src/components/detail-layout/widgets/registry.ts
|
|
5388
|
-
var
|
|
5389
|
-
function
|
|
5390
|
-
|
|
5609
|
+
var Xa = /* @__PURE__ */ new Map();
|
|
5610
|
+
function Za(e, t) {
|
|
5611
|
+
Xa.set(e, t);
|
|
5391
5612
|
}
|
|
5392
|
-
function
|
|
5393
|
-
return
|
|
5613
|
+
function Qa(e) {
|
|
5614
|
+
return Xa.get(e);
|
|
5394
5615
|
}
|
|
5395
|
-
function
|
|
5396
|
-
return
|
|
5616
|
+
function $a(e) {
|
|
5617
|
+
return Xa.has(e);
|
|
5397
5618
|
}
|
|
5398
5619
|
//#endregion
|
|
5399
|
-
export {
|
|
5620
|
+
export { qn as $, Ur as A, Sr as B, Hi as C, ht as Ct, vi as D, We as Dt, Ti as E, st as Et, Hr as F, sr as G, mr as H, Vr as I, er as J, cr as K, Lr as L, dr as M, zr as N, mi as O, Ue as Ot, Or as P, Fn as Q, Cr as R, Ui as S, xt as St, Ri as T, rt as Tt, vr as U, Rr as V, ar as W, Zn as X, $n as Y, Qn as Z, qi as _, It as _t, Ya as a, xn as at, Vi as b, Dt as bt, da as c, Sn as ct, ea as d, en as dt, Xn as et, Xi as f, Wt as ft, Yi as g, Rt as gt, $i as h, Bt as ht, Ja as i, yn as it, fr as j, oi as k, fa as l, nn as lt, Ji as m, zt as mt, $a as n, Mn as nt, qa as o, wn as ot, Zi as p, Ut as pt, or as q, Za as r, Nn as rt, ua as s, Cn as st, Qa as t, Gn as tt, Qi as u, tn as ut, Gi as v, Ot as vt, zi as w, wt, Ki as x, Tt as xt, Wi as y, Et as yt, Dr as z };
|