@declarion/react 0.38.5 → 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-DvJO6-m0.js → DraggableChildrenTable-DziCVhq6.js} +1 -1
- package/dist-lib/{Grid-D2ArPFCz.js → Grid-BTX2tkCT.js} +2 -2
- package/dist-lib/{LayoutRenderer-C8DQ61Vo.js → LayoutRenderer-CwMERoPJ.js} +387 -285
- package/dist-lib/{MarkdownRenderer-CSuODN70.js → MarkdownRenderer-dHOTEhUa.js} +1 -1
- package/dist-lib/{RefreshControl-CHvOUn0o.js → RefreshControl--UAgflh7.js} +291 -209
- package/dist-lib/{SmartDetailPage.impl-Cl306lX3.js → SmartDetailPage.impl-Bj7MtHxi.js} +473 -414
- package/dist-lib/{SmartRecordListPage.impl-j8bhyL4e.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/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 +3036 -2167
- 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-C3hbFTDQ.js → registry-DXNFRlbB.js} +780 -560
- 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 +12 -0
- package/dist-lib/{useCurrentScreen-DD3KdlMj.js → useCurrentScreen-BA2lb-d7.js} +35 -23
- package/dist-lib/{useProperties-CliP5qvg.js → useProperties-Br2DeOQh.js} +81 -81
- package/dist-lib/{value-CNy3_xCA.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,151 +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
|
-
row: r,
|
|
2623
|
-
execute: async (t) => {
|
|
2624
|
-
let r = await te(e, B(t, n));
|
|
2625
|
-
return i?.(), r;
|
|
2626
|
-
}
|
|
2627
|
-
});
|
|
2628
|
-
}),
|
|
2629
|
-
children: s
|
|
2630
|
-
}, t);
|
|
2631
|
-
})
|
|
2632
|
-
]
|
|
2633
|
-
})]
|
|
2634
|
-
});
|
|
2635
|
-
}
|
|
2636
|
-
//#endregion
|
|
2637
|
-
//#region src/components/detail-layout/AssociatedToolbar.tsx
|
|
2638
|
-
function Er({ entity: t, searchable: n, filterFields: r, searchValue: i, onSearchChange: a, filters: o, onFilterChange: s, allEntities: c }) {
|
|
2639
|
-
let l = n === !0, u = r && r.length > 0;
|
|
2640
|
-
return !l && !u ? null : /* @__PURE__ */ Q("div", {
|
|
2641
|
-
style: {
|
|
2642
|
-
display: "flex",
|
|
2643
|
-
alignItems: "center",
|
|
2644
|
-
gap: 6,
|
|
2645
|
-
marginBottom: 8
|
|
2646
|
-
},
|
|
2647
|
-
children: [l && /* @__PURE__ */ Z("div", {
|
|
2648
|
-
style: {
|
|
2649
|
-
flex: 1,
|
|
2650
|
-
maxWidth: 220
|
|
2651
|
-
},
|
|
2652
|
-
children: /* @__PURE__ */ Z(I, {
|
|
2653
|
-
value: i,
|
|
2654
|
-
onChange: a,
|
|
2655
|
-
placeholder: "Search…",
|
|
2656
|
-
prefix: /* @__PURE__ */ Z(e.search, { size: 12 })
|
|
2657
|
-
})
|
|
2658
|
-
}), u && r.map((e) => {
|
|
2659
|
-
let n = t.fields.get(e);
|
|
2660
|
-
if (!n) return null;
|
|
2661
|
-
let r = o[e] ?? "__all__", i = ie(n, e, c);
|
|
2662
|
-
return n.type === "ref" && n.ref?.entity ? /* @__PURE__ */ Z(Dr, {
|
|
2663
|
-
field: n,
|
|
2664
|
-
label: i,
|
|
2665
|
-
value: r,
|
|
2666
|
-
onChange: (t) => s(e, t)
|
|
2667
|
-
}, e) : n.values ? /* @__PURE__ */ Z("div", {
|
|
2668
|
-
style: { width: 160 },
|
|
2669
|
-
children: /* @__PURE__ */ Z(f, {
|
|
2670
|
-
value: r,
|
|
2671
|
-
options: [{
|
|
2672
|
-
value: "__all__",
|
|
2673
|
-
label: `All ${i}`
|
|
2674
|
-
}, ...n.values.map((e) => ({
|
|
2675
|
-
value: e.code,
|
|
2676
|
-
label: W(e.name) || e.code
|
|
2677
|
-
}))],
|
|
2678
|
-
onChange: (t) => s(e, t),
|
|
2679
|
-
placeholder: i
|
|
2680
|
-
})
|
|
2681
|
-
}, e) : null;
|
|
2682
|
-
})]
|
|
2683
|
-
});
|
|
2684
|
-
}
|
|
2685
|
-
function Dr({ field: e, label: t, value: n, onChange: r }) {
|
|
2686
|
-
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, {
|
|
2687
|
-
per_page: 200,
|
|
2688
|
-
sort: o ? `${o}:asc` : void 0
|
|
2689
|
-
}), l = c?.data ?? [], u = (e) => {
|
|
2690
|
-
if (e == null) return "—";
|
|
2691
|
-
if (typeof e == "object" && !Array.isArray(e)) {
|
|
2692
|
-
let t = Object.values(e)[0];
|
|
2693
|
-
return t == null ? "—" : x(t);
|
|
2694
|
-
}
|
|
2695
|
-
return x(e);
|
|
2696
|
-
};
|
|
2697
|
-
return /* @__PURE__ */ Z("div", {
|
|
2698
|
-
style: { width: 160 },
|
|
2699
|
-
children: /* @__PURE__ */ Z(f, {
|
|
2700
|
-
value: n,
|
|
2701
|
-
options: [{
|
|
2702
|
-
value: "__all__",
|
|
2703
|
-
label: `All ${t}`
|
|
2704
|
-
}, ...l.map((e) => {
|
|
2705
|
-
let t = String(e[s]), n = e[T];
|
|
2706
|
-
return {
|
|
2707
|
-
value: t,
|
|
2708
|
-
label: typeof n == "string" && n !== "" ? n : o ? u(e[o] ?? t) : t
|
|
2709
|
-
};
|
|
2710
|
-
})],
|
|
2711
|
-
onChange: r,
|
|
2712
|
-
placeholder: t
|
|
2713
|
-
})
|
|
2714
|
-
});
|
|
2715
|
-
}
|
|
2716
|
-
//#endregion
|
|
2717
2767
|
//#region src/components/shared/ResponsiveActionBar.tsx
|
|
2718
|
-
function
|
|
2768
|
+
function Wr(e, t) {
|
|
2719
2769
|
return e.replace(/\$\{([^}]+)\}/g, (e, n) => Object.prototype.hasOwnProperty.call(t, n) ? t[n] : e);
|
|
2720
2770
|
}
|
|
2721
|
-
function
|
|
2771
|
+
function Gr(e) {
|
|
2722
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";
|
|
2723
2773
|
}
|
|
2724
|
-
function
|
|
2725
|
-
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;
|
|
2726
2782
|
if (i?.({
|
|
2727
2783
|
code: e,
|
|
2728
2784
|
entity: s,
|
|
@@ -2730,7 +2786,7 @@ function Ar(e, t, n, r, i) {
|
|
|
2730
2786
|
rowId: o
|
|
2731
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;
|
|
2732
2788
|
if (a === "href" && r) {
|
|
2733
|
-
let e =
|
|
2789
|
+
let e = Wr(t.href ?? "", {
|
|
2734
2790
|
entity: s,
|
|
2735
2791
|
id: encodeURIComponent(o)
|
|
2736
2792
|
}), n = e.indexOf("?");
|
|
@@ -2738,27 +2794,27 @@ function Ar(e, t, n, r, i) {
|
|
|
2738
2794
|
}
|
|
2739
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;
|
|
2740
2796
|
}
|
|
2741
|
-
function
|
|
2797
|
+
function qr(e) {
|
|
2742
2798
|
let t = 0;
|
|
2743
|
-
for (let n of e) n.kind === "action" ? t++ : t +=
|
|
2799
|
+
for (let n of e) n.kind === "action" ? t++ : t += qr(n.items);
|
|
2744
2800
|
return t;
|
|
2745
2801
|
}
|
|
2746
|
-
function
|
|
2802
|
+
function Jr(e, t, n) {
|
|
2747
2803
|
let r = [], i = [];
|
|
2748
|
-
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);
|
|
2749
2805
|
return {
|
|
2750
2806
|
normal: r,
|
|
2751
2807
|
destructive: i
|
|
2752
2808
|
};
|
|
2753
2809
|
}
|
|
2754
|
-
function
|
|
2810
|
+
function Yr(e, t, n) {
|
|
2755
2811
|
let r = [], i = [], a = [];
|
|
2756
2812
|
for (let o of e) {
|
|
2757
2813
|
if (o.kind !== "action") {
|
|
2758
2814
|
i.push(o);
|
|
2759
2815
|
continue;
|
|
2760
2816
|
}
|
|
2761
|
-
let e =
|
|
2817
|
+
let e = Xr(o.code, t, n), s = e?.destructive === !0, c = e?.display?.primary === !0;
|
|
2762
2818
|
if (s && c) {
|
|
2763
2819
|
console.warn(`[ResponsiveActionBar] action "${o.code}" declares both primary and destructive; treating as destructive.`), a.push(o);
|
|
2764
2820
|
continue;
|
|
@@ -2779,25 +2835,25 @@ function Nr(e, t, n) {
|
|
|
2779
2835
|
destructive: a
|
|
2780
2836
|
};
|
|
2781
2837
|
}
|
|
2782
|
-
function
|
|
2838
|
+
function Xr(e, t, n) {
|
|
2783
2839
|
if (t && e in t) return t[e];
|
|
2784
2840
|
if (n && e in n) return n[e];
|
|
2785
2841
|
}
|
|
2786
|
-
function
|
|
2787
|
-
return W(
|
|
2842
|
+
function Zr(e, t, n) {
|
|
2843
|
+
return W(Xr(e, t, n)?.display?.name) || e;
|
|
2788
2844
|
}
|
|
2789
|
-
function
|
|
2790
|
-
return
|
|
2845
|
+
function Qr(e, t, n) {
|
|
2846
|
+
return Xr(e, t, n)?.display?.icon || void 0;
|
|
2791
2847
|
}
|
|
2792
|
-
function
|
|
2848
|
+
function $r(e) {
|
|
2793
2849
|
return `action-tooltip-${e}`;
|
|
2794
2850
|
}
|
|
2795
|
-
function
|
|
2796
|
-
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 () => {
|
|
2797
2853
|
if (!(!m || y || a)) {
|
|
2798
2854
|
o(!0);
|
|
2799
2855
|
try {
|
|
2800
|
-
|
|
2856
|
+
Kr(e.code, m, d, f, p) || await Promise.resolve(i(e.code, m));
|
|
2801
2857
|
} finally {
|
|
2802
2858
|
o(!1);
|
|
2803
2859
|
}
|
|
@@ -2835,13 +2891,13 @@ function Rr({ leaf: e, entityActions: n, globalActions: r, onRun: i, loading: a,
|
|
|
2835
2891
|
disabled: y || a,
|
|
2836
2892
|
"aria-disabled": y ? "true" : void 0,
|
|
2837
2893
|
"aria-describedby": b,
|
|
2838
|
-
title:
|
|
2894
|
+
title: Tr(m, h, y, e.reason),
|
|
2839
2895
|
onClick: x,
|
|
2840
2896
|
style: c,
|
|
2841
2897
|
children: h
|
|
2842
2898
|
})] });
|
|
2843
2899
|
}
|
|
2844
|
-
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 }) {
|
|
2845
2901
|
let g = J(null), [_, v] = Y(!1), y = n.name ? W(n.name) : "Actions", b = G((e) => {
|
|
2846
2902
|
g.current = e, d?.(e);
|
|
2847
2903
|
}, [d]), x = G((e, t) => (v(!1), a(e, t)), [a]);
|
|
@@ -2868,7 +2924,7 @@ function zr({ group: n, entityActions: r, globalActions: i, onRun: a, loading: o
|
|
|
2868
2924
|
children: /* @__PURE__ */ Z("div", {
|
|
2869
2925
|
role: "menu",
|
|
2870
2926
|
"aria-label": y,
|
|
2871
|
-
children: n.items.map((e) => e.kind === "action" ? /* @__PURE__ */ Z(
|
|
2927
|
+
children: n.items.map((e) => e.kind === "action" ? /* @__PURE__ */ Z(ni, {
|
|
2872
2928
|
leaf: e,
|
|
2873
2929
|
entityActions: r,
|
|
2874
2930
|
globalActions: i,
|
|
@@ -2878,7 +2934,7 @@ function zr({ group: n, entityActions: r, globalActions: i, onRun: a, loading: o
|
|
|
2878
2934
|
row: p,
|
|
2879
2935
|
widgetContext: m,
|
|
2880
2936
|
onActionClick: h
|
|
2881
|
-
}, e.code) : /* @__PURE__ */ Z(
|
|
2937
|
+
}, e.code) : /* @__PURE__ */ Z(ri, {
|
|
2882
2938
|
group: e,
|
|
2883
2939
|
entityActions: r,
|
|
2884
2940
|
globalActions: i,
|
|
@@ -2892,8 +2948,8 @@ function zr({ group: n, entityActions: r, globalActions: i, onRun: a, loading: o
|
|
|
2892
2948
|
})
|
|
2893
2949
|
})] });
|
|
2894
2950
|
}
|
|
2895
|
-
function
|
|
2896
|
-
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, {
|
|
2897
2953
|
name: p,
|
|
2898
2954
|
size: 12
|
|
2899
2955
|
}) : null;
|
|
@@ -2912,12 +2968,12 @@ function Br({ leaf: e, entityActions: n, globalActions: r, onRun: i, loading: a,
|
|
|
2912
2968
|
role: "menuitem",
|
|
2913
2969
|
"aria-disabled": h ? "true" : void 0,
|
|
2914
2970
|
"aria-describedby": g,
|
|
2915
|
-
title:
|
|
2971
|
+
title: Tr(d, f, h, e.reason),
|
|
2916
2972
|
onClick: async () => {
|
|
2917
2973
|
if (!(!d || h || a)) {
|
|
2918
2974
|
o(!0);
|
|
2919
2975
|
try {
|
|
2920
|
-
|
|
2976
|
+
Kr(e.code, d, s, c, l) || await Promise.resolve(i(e.code, d));
|
|
2921
2977
|
} finally {
|
|
2922
2978
|
o(!1);
|
|
2923
2979
|
}
|
|
@@ -2952,7 +3008,7 @@ function Br({ leaf: e, entityActions: n, globalActions: r, onRun: i, loading: a,
|
|
|
2952
3008
|
})]
|
|
2953
3009
|
})] });
|
|
2954
3010
|
}
|
|
2955
|
-
function
|
|
3011
|
+
function ri({ group: e, entityActions: t, globalActions: n, onRun: r, loading: i, onLoadingChange: a, row: o, widgetContext: s, onActionClick: c }) {
|
|
2956
3012
|
let l = e.name ? W(e.name) : void 0;
|
|
2957
3013
|
return /* @__PURE__ */ Q(X, { children: [l && /* @__PURE__ */ Z("div", {
|
|
2958
3014
|
style: {
|
|
@@ -2964,7 +3020,7 @@ function Vr({ group: e, entityActions: t, globalActions: n, onRun: r, loading: i
|
|
|
2964
3020
|
letterSpacing: "0.05em"
|
|
2965
3021
|
},
|
|
2966
3022
|
children: l
|
|
2967
|
-
}), e.items.map((e) => e.kind === "action" ? /* @__PURE__ */ Z(
|
|
3023
|
+
}), e.items.map((e) => e.kind === "action" ? /* @__PURE__ */ Z(ni, {
|
|
2968
3024
|
leaf: e,
|
|
2969
3025
|
entityActions: t,
|
|
2970
3026
|
globalActions: n,
|
|
@@ -2974,7 +3030,7 @@ function Vr({ group: e, entityActions: t, globalActions: n, onRun: r, loading: i
|
|
|
2974
3030
|
row: o,
|
|
2975
3031
|
widgetContext: s,
|
|
2976
3032
|
onActionClick: c
|
|
2977
|
-
}, e.code) : /* @__PURE__ */ Z(
|
|
3033
|
+
}, e.code) : /* @__PURE__ */ Z(ri, {
|
|
2978
3034
|
group: e,
|
|
2979
3035
|
entityActions: t,
|
|
2980
3036
|
globalActions: n,
|
|
@@ -2986,84 +3042,92 @@ function Vr({ group: e, entityActions: t, globalActions: n, onRun: r, loading: i
|
|
|
2986
3042
|
onActionClick: c
|
|
2987
3043
|
}, e.icon ?? "nested"))] });
|
|
2988
3044
|
}
|
|
2989
|
-
function
|
|
2990
|
-
let
|
|
2991
|
-
|
|
2992
|
-
let { normal: S, destructive: C } = Mr(t, n, r), w = C.length > 0 || x;
|
|
2993
|
-
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", {
|
|
2994
3048
|
style: {
|
|
2995
3049
|
display: "inline-flex",
|
|
2996
3050
|
alignItems: "center"
|
|
2997
3051
|
},
|
|
2998
3052
|
children: [/* @__PURE__ */ Z(o, {
|
|
2999
|
-
ref:
|
|
3000
|
-
icon: Z(
|
|
3053
|
+
ref: d,
|
|
3054
|
+
icon: Z(m == null ? e.more : u, { size: 14 }),
|
|
3001
3055
|
title: "Actions",
|
|
3002
3056
|
size: 28,
|
|
3003
|
-
onClick: () =>
|
|
3057
|
+
onClick: () => p((e) => !e)
|
|
3004
3058
|
}), /* @__PURE__ */ Z(s, {
|
|
3005
|
-
open:
|
|
3006
|
-
anchor:
|
|
3007
|
-
onClose: () =>
|
|
3059
|
+
open: f,
|
|
3060
|
+
anchor: d.current,
|
|
3061
|
+
onClose: () => p(!1),
|
|
3008
3062
|
align: "end",
|
|
3009
3063
|
width: 220,
|
|
3010
|
-
children: /* @__PURE__ */
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
onLoadingChange: (t) => v(t ? e.code : null),
|
|
3021
|
-
row: l,
|
|
3022
|
-
widgetContext: d,
|
|
3023
|
-
onActionClick: f
|
|
3024
|
-
}, e.code) : /* @__PURE__ */ Z(Vr, {
|
|
3025
|
-
group: e,
|
|
3026
|
-
entityActions: n,
|
|
3027
|
-
globalActions: r,
|
|
3028
|
-
onRun: y,
|
|
3029
|
-
loading: _,
|
|
3030
|
-
onLoadingChange: v,
|
|
3031
|
-
row: l,
|
|
3032
|
-
widgetContext: d,
|
|
3033
|
-
onActionClick: f
|
|
3034
|
-
}, e.icon ?? "group")),
|
|
3035
|
-
b && a,
|
|
3036
|
-
w && /* @__PURE__ */ Z(p, { divider: !0 }),
|
|
3037
|
-
C.map((e) => /* @__PURE__ */ Z(Br, {
|
|
3038
|
-
leaf: e,
|
|
3039
|
-
entityActions: n,
|
|
3040
|
-
globalActions: r,
|
|
3041
|
-
onRun: y,
|
|
3042
|
-
loading: _ === e.code,
|
|
3043
|
-
onLoadingChange: (t) => v(t ? e.code : null),
|
|
3044
|
-
row: l,
|
|
3045
|
-
widgetContext: d,
|
|
3046
|
-
onActionClick: f
|
|
3047
|
-
}, e.code)),
|
|
3048
|
-
x && c
|
|
3049
|
-
]
|
|
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
|
|
3050
3074
|
})
|
|
3051
3075
|
})]
|
|
3052
3076
|
});
|
|
3053
3077
|
}
|
|
3054
|
-
|
|
3055
|
-
|
|
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) {
|
|
3056
3120
|
return e + 8;
|
|
3057
3121
|
}
|
|
3058
|
-
function
|
|
3059
|
-
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;
|
|
3060
3124
|
for (let e of l) {
|
|
3061
3125
|
let t = r.get($(e)) ?? 0;
|
|
3062
3126
|
if (o) {
|
|
3063
3127
|
o(e) ? (g.push(e), h += t) : (_.push(e), v = !0);
|
|
3064
3128
|
continue;
|
|
3065
3129
|
}
|
|
3066
|
-
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;
|
|
3067
3131
|
h + t + n + i <= p ? (g.push(e), h += t) : (_.push(e), v = !0);
|
|
3068
3132
|
}
|
|
3069
3133
|
return {
|
|
@@ -3076,7 +3140,7 @@ function qr(e, t, n, r, i, a, o, s) {
|
|
|
3076
3140
|
function $(e) {
|
|
3077
3141
|
return e.kind === "action" ? `action:${e.code}` : `group:${e.name ? W(e.name) : ""}`;
|
|
3078
3142
|
}
|
|
3079
|
-
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 }) {
|
|
3080
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");
|
|
3081
3145
|
K(() => {
|
|
3082
3146
|
if (typeof MutationObserver > "u") return;
|
|
@@ -3088,7 +3152,7 @@ function Jr({ layout: n, entityActions: r, globalActions: i, onRun: a, reservedR
|
|
|
3088
3152
|
attributeFilter: ["dir", "lang"]
|
|
3089
3153
|
}), () => e.disconnect();
|
|
3090
3154
|
}, []);
|
|
3091
|
-
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(() => {
|
|
3092
3156
|
if (N || !_.current) return;
|
|
3093
3157
|
let e = Array.from(_.current.children), t = /* @__PURE__ */ new Map();
|
|
3094
3158
|
e.forEach((e) => {
|
|
@@ -3150,7 +3214,7 @@ function Jr({ layout: n, entityActions: r, globalActions: i, onRun: a, reservedR
|
|
|
3150
3214
|
K(() => {
|
|
3151
3215
|
I.current = void 0;
|
|
3152
3216
|
}, [F]);
|
|
3153
|
-
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) : {
|
|
3154
3218
|
primaryInline: [],
|
|
3155
3219
|
inline: [],
|
|
3156
3220
|
overflow: [],
|
|
@@ -3201,14 +3265,14 @@ function Jr({ layout: n, entityActions: r, globalActions: i, onRun: a, reservedR
|
|
|
3201
3265
|
left: 0
|
|
3202
3266
|
},
|
|
3203
3267
|
children: [/* @__PURE__ */ Z(l, {
|
|
3204
|
-
"data-node-key":
|
|
3268
|
+
"data-node-key": si,
|
|
3205
3269
|
iconRight: /* @__PURE__ */ Z(e.down, { size: 10 }),
|
|
3206
3270
|
tabIndex: -1,
|
|
3207
3271
|
children: "Actions"
|
|
3208
|
-
},
|
|
3272
|
+
}, si), n.map((n) => {
|
|
3209
3273
|
let a = $(n);
|
|
3210
3274
|
if (n.kind === "action") {
|
|
3211
|
-
let e =
|
|
3275
|
+
let e = Xr(n.code, r, i), o = Zr(n.code, r, i), s = Qr(n.code, r, i);
|
|
3212
3276
|
return /* @__PURE__ */ Z(l, {
|
|
3213
3277
|
"data-node-key": a,
|
|
3214
3278
|
icon: s ? /* @__PURE__ */ Z(t, {
|
|
@@ -3230,7 +3294,7 @@ function Jr({ layout: n, entityActions: r, globalActions: i, onRun: a, reservedR
|
|
|
3230
3294
|
}
|
|
3231
3295
|
})]
|
|
3232
3296
|
}),
|
|
3233
|
-
L.primaryInline.map((e) => /* @__PURE__ */ Z(
|
|
3297
|
+
L.primaryInline.map((e) => /* @__PURE__ */ Z(ei, {
|
|
3234
3298
|
leaf: e,
|
|
3235
3299
|
entityActions: r,
|
|
3236
3300
|
globalActions: i,
|
|
@@ -3243,7 +3307,7 @@ function Jr({ layout: n, entityActions: r, globalActions: i, onRun: a, reservedR
|
|
|
3243
3307
|
}, $(e))),
|
|
3244
3308
|
L.inline.map((e) => {
|
|
3245
3309
|
let t = $(e);
|
|
3246
|
-
return e.kind === "action" ? /* @__PURE__ */ Z(
|
|
3310
|
+
return e.kind === "action" ? /* @__PURE__ */ Z(ei, {
|
|
3247
3311
|
leaf: e,
|
|
3248
3312
|
entityActions: r,
|
|
3249
3313
|
globalActions: i,
|
|
@@ -3253,7 +3317,7 @@ function Jr({ layout: n, entityActions: r, globalActions: i, onRun: a, reservedR
|
|
|
3253
3317
|
row: p,
|
|
3254
3318
|
widgetContext: m,
|
|
3255
3319
|
onActionClick: h
|
|
3256
|
-
}, t) : /* @__PURE__ */ Z(
|
|
3320
|
+
}, t) : /* @__PURE__ */ Z(ti, {
|
|
3257
3321
|
group: e,
|
|
3258
3322
|
entityActions: r,
|
|
3259
3323
|
globalActions: i,
|
|
@@ -3282,7 +3346,7 @@ function Jr({ layout: n, entityActions: r, globalActions: i, onRun: a, reservedR
|
|
|
3282
3346
|
children: /* @__PURE__ */ Z("div", {
|
|
3283
3347
|
role: "menu",
|
|
3284
3348
|
"aria-label": "More actions",
|
|
3285
|
-
children: L.overflow.map((e) => e.kind === "action" ? /* @__PURE__ */ Z(
|
|
3349
|
+
children: L.overflow.map((e) => e.kind === "action" ? /* @__PURE__ */ Z(ni, {
|
|
3286
3350
|
leaf: e,
|
|
3287
3351
|
entityActions: r,
|
|
3288
3352
|
globalActions: i,
|
|
@@ -3292,7 +3356,7 @@ function Jr({ layout: n, entityActions: r, globalActions: i, onRun: a, reservedR
|
|
|
3292
3356
|
row: p,
|
|
3293
3357
|
widgetContext: m,
|
|
3294
3358
|
onActionClick: h
|
|
3295
|
-
}, e.code) : /* @__PURE__ */ Z(
|
|
3359
|
+
}, e.code) : /* @__PURE__ */ Z(ri, {
|
|
3296
3360
|
group: e,
|
|
3297
3361
|
entityActions: r,
|
|
3298
3362
|
globalActions: i,
|
|
@@ -3305,7 +3369,7 @@ function Jr({ layout: n, entityActions: r, globalActions: i, onRun: a, reservedR
|
|
|
3305
3369
|
}, $(e)))
|
|
3306
3370
|
})
|
|
3307
3371
|
})] }),
|
|
3308
|
-
L.destructiveInline.map((e) => /* @__PURE__ */ Z(
|
|
3372
|
+
L.destructiveInline.map((e) => /* @__PURE__ */ Z(ei, {
|
|
3309
3373
|
leaf: e,
|
|
3310
3374
|
entityActions: r,
|
|
3311
3375
|
globalActions: i,
|
|
@@ -3319,7 +3383,7 @@ function Jr({ layout: n, entityActions: r, globalActions: i, onRun: a, reservedR
|
|
|
3319
3383
|
]
|
|
3320
3384
|
});
|
|
3321
3385
|
}
|
|
3322
|
-
function
|
|
3386
|
+
function pi({ layout: e, rowSelection: t = [], ...n }) {
|
|
3323
3387
|
let r = t.length > 0;
|
|
3324
3388
|
return /* @__PURE__ */ Q("div", {
|
|
3325
3389
|
style: {
|
|
@@ -3335,7 +3399,7 @@ function Yr({ layout: e, rowSelection: t = [], ...n }) {
|
|
|
3335
3399
|
flex: "1 1 auto",
|
|
3336
3400
|
minWidth: 0
|
|
3337
3401
|
},
|
|
3338
|
-
children: /* @__PURE__ */ Z(
|
|
3402
|
+
children: /* @__PURE__ */ Z(fi, {
|
|
3339
3403
|
layout: e,
|
|
3340
3404
|
rowSelection: [],
|
|
3341
3405
|
...n
|
|
@@ -3347,7 +3411,7 @@ function Yr({ layout: e, rowSelection: t = [], ...n }) {
|
|
|
3347
3411
|
flex: "1 1 auto",
|
|
3348
3412
|
minWidth: 0
|
|
3349
3413
|
},
|
|
3350
|
-
children: /* @__PURE__ */ Z(
|
|
3414
|
+
children: /* @__PURE__ */ Z(fi, {
|
|
3351
3415
|
layout: e,
|
|
3352
3416
|
rowSelection: t,
|
|
3353
3417
|
...n
|
|
@@ -3355,19 +3419,17 @@ function Yr({ layout: e, rowSelection: t = [], ...n }) {
|
|
|
3355
3419
|
})]
|
|
3356
3420
|
});
|
|
3357
3421
|
}
|
|
3358
|
-
function
|
|
3359
|
-
let
|
|
3360
|
-
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, {
|
|
3361
3425
|
layout: e,
|
|
3362
3426
|
entityActions: l,
|
|
3363
3427
|
globalActions: u,
|
|
3364
3428
|
onRun: r,
|
|
3365
|
-
trailingNormalItems: f,
|
|
3366
|
-
trailingDestructiveItems: p,
|
|
3367
3429
|
row: t,
|
|
3368
|
-
widgetContext:
|
|
3369
|
-
onActionClick:
|
|
3370
|
-
}) :
|
|
3430
|
+
widgetContext: f,
|
|
3431
|
+
onActionClick: p
|
|
3432
|
+
}) : m === 0 ? null : Z(a === "toolbar" ? pi : fi, {
|
|
3371
3433
|
layout: e,
|
|
3372
3434
|
row: t,
|
|
3373
3435
|
rowSelection: n,
|
|
@@ -3379,27 +3441,179 @@ function Xr({ layout: e, row: t, rowSelection: n, onRun: r, reservedRightWidth:
|
|
|
3379
3441
|
ariaLabel: d,
|
|
3380
3442
|
align: o,
|
|
3381
3443
|
constrain: s,
|
|
3382
|
-
widgetContext:
|
|
3383
|
-
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
|
+
})
|
|
3384
3598
|
});
|
|
3385
3599
|
}
|
|
3386
3600
|
//#endregion
|
|
3387
3601
|
//#region src/lib/action-dispatch.ts
|
|
3388
|
-
function
|
|
3602
|
+
function vi(e, t, n, r) {
|
|
3389
3603
|
return ne(t) ? (E(t.ui_steps, n), null) : t.entity ? `${t.entity}.${e}` : r ? `${r}.${e}` : e;
|
|
3390
3604
|
}
|
|
3391
3605
|
//#endregion
|
|
3392
3606
|
//#region src/components/detail-layout/AssociatedBlock.tsx
|
|
3393
|
-
function
|
|
3607
|
+
function yi(e) {
|
|
3394
3608
|
if (!e) return [];
|
|
3395
3609
|
let t = [];
|
|
3396
|
-
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({
|
|
3397
3611
|
code: n,
|
|
3398
3612
|
action: r
|
|
3399
3613
|
}));
|
|
3400
3614
|
return t;
|
|
3401
3615
|
}
|
|
3402
|
-
function
|
|
3616
|
+
function bi(e, t, n) {
|
|
3403
3617
|
if (!e) return [];
|
|
3404
3618
|
let r = [];
|
|
3405
3619
|
for (let [i, a] of Object.entries(e)) {
|
|
@@ -3425,7 +3639,7 @@ function $r(e, t, n) {
|
|
|
3425
3639
|
}
|
|
3426
3640
|
return r;
|
|
3427
3641
|
}
|
|
3428
|
-
function
|
|
3642
|
+
function xi(e, t, n) {
|
|
3429
3643
|
let r = e[n];
|
|
3430
3644
|
if (!r) return null;
|
|
3431
3645
|
let i = e[t], a = i?.children?.find((e) => e.entity === n);
|
|
@@ -3447,7 +3661,7 @@ function ei(e, t, n) {
|
|
|
3447
3661
|
}
|
|
3448
3662
|
return null;
|
|
3449
3663
|
}
|
|
3450
|
-
function
|
|
3664
|
+
function Si(e, t, n) {
|
|
3451
3665
|
let r = new Set(z(e));
|
|
3452
3666
|
return new Set(t.filter((t) => {
|
|
3453
3667
|
if (t === n || r.has(t)) return !1;
|
|
@@ -3455,14 +3669,14 @@ function ti(e, t, n) {
|
|
|
3455
3669
|
return !(!i || i.auto || i.primary || i.source);
|
|
3456
3670
|
}));
|
|
3457
3671
|
}
|
|
3458
|
-
function
|
|
3672
|
+
function Ci(e, t, n) {
|
|
3459
3673
|
return new Set(t.filter((t) => {
|
|
3460
3674
|
if (t === n) return !1;
|
|
3461
3675
|
let r = e.fields.get(t);
|
|
3462
3676
|
return !(!r || r.auto);
|
|
3463
3677
|
}));
|
|
3464
3678
|
}
|
|
3465
|
-
function
|
|
3679
|
+
function wi(e, t, n, r) {
|
|
3466
3680
|
let i = [];
|
|
3467
3681
|
for (let a of t) {
|
|
3468
3682
|
let t = n.fields.get(a);
|
|
@@ -3472,7 +3686,7 @@ function ri(e, t, n, r) {
|
|
|
3472
3686
|
}
|
|
3473
3687
|
return i;
|
|
3474
3688
|
}
|
|
3475
|
-
function
|
|
3689
|
+
function Ti({ node: e, ctx: t }) {
|
|
3476
3690
|
let n = e.associated;
|
|
3477
3691
|
if (!n || t.isNew) return null;
|
|
3478
3692
|
let r = t.schema.entities[n];
|
|
@@ -3484,8 +3698,8 @@ function ii({ node: e, ctx: t }) {
|
|
|
3484
3698
|
},
|
|
3485
3699
|
children: ["Entity not found: ", n]
|
|
3486
3700
|
});
|
|
3487
|
-
let i =
|
|
3488
|
-
return i ? /* @__PURE__ */ Z(
|
|
3701
|
+
let i = xi(t.schema.entities, t.entityCode, n);
|
|
3702
|
+
return i ? /* @__PURE__ */ Z(Ei, {
|
|
3489
3703
|
node: e,
|
|
3490
3704
|
ctx: t,
|
|
3491
3705
|
assocCode: n,
|
|
@@ -3505,12 +3719,12 @@ function ii({ node: e, ctx: t }) {
|
|
|
3505
3719
|
]
|
|
3506
3720
|
});
|
|
3507
3721
|
}
|
|
3508
|
-
function
|
|
3722
|
+
function Ei({ node: n, ctx: r, assocCode: i, assocEntity: a, fkField: o }) {
|
|
3509
3723
|
let s = n.columns && n.columns.length > 0 ? n.columns.filter((e) => e !== o && !!a.fields.get(e)) : a.fields.names().filter((e) => {
|
|
3510
3724
|
if (e === o) return !1;
|
|
3511
3725
|
let t = a.fields.get(e);
|
|
3512
3726
|
return !(!t || t.primary || t.display?.is_listable === !1);
|
|
3513
|
-
}), 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), [
|
|
3514
3728
|
a.actions,
|
|
3515
3729
|
o,
|
|
3516
3730
|
r.recordId
|
|
@@ -3518,7 +3732,7 @@ function ai({ node: n, ctx: r, assocCode: i, assocEntity: a, fkField: o }) {
|
|
|
3518
3732
|
let e = {};
|
|
3519
3733
|
for (let { code: t, action: n } of m) e[t] = n;
|
|
3520
3734
|
return e;
|
|
3521
|
-
}, [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(() => ({
|
|
3522
3736
|
entity: a,
|
|
3523
3737
|
entityCode: i,
|
|
3524
3738
|
screenRoute: typeof window < "u" ? window.location.pathname : "",
|
|
@@ -3542,7 +3756,7 @@ function ai({ node: n, ctx: r, assocCode: i, assocEntity: a, fkField: o }) {
|
|
|
3542
3756
|
return t[0] === "entity-children" && t[3] === i;
|
|
3543
3757
|
} });
|
|
3544
3758
|
}, [S, i]), w = G((e, t) => {
|
|
3545
|
-
let n =
|
|
3759
|
+
let n = vi(e, t, {}, i);
|
|
3546
3760
|
if (n !== null) return _({
|
|
3547
3761
|
action: t,
|
|
3548
3762
|
title: W(t.display?.name) || e,
|
|
@@ -3564,14 +3778,14 @@ function ai({ node: n, ctx: r, assocCode: i, assocEntity: a, fkField: o }) {
|
|
|
3564
3778
|
minWidth: 0,
|
|
3565
3779
|
justifyContent: "flex-end"
|
|
3566
3780
|
},
|
|
3567
|
-
children: [a.action_layout ? g.length > 0 && /* @__PURE__ */ Z(
|
|
3781
|
+
children: [a.action_layout ? g.length > 0 && /* @__PURE__ */ Z(mi, {
|
|
3568
3782
|
kind: "toolbar",
|
|
3569
3783
|
layout: g,
|
|
3570
3784
|
entityActions: h,
|
|
3571
3785
|
onRun: w,
|
|
3572
3786
|
widgetContext: x,
|
|
3573
3787
|
ariaLabel: `${f} toolbar actions`
|
|
3574
|
-
}) : m.map(({ code: e, action: t }) => /* @__PURE__ */ Z(
|
|
3788
|
+
}) : m.map(({ code: e, action: t }) => /* @__PURE__ */ Z(Ur, {
|
|
3575
3789
|
actionCode: e,
|
|
3576
3790
|
action: t,
|
|
3577
3791
|
entityCode: i,
|
|
@@ -3585,7 +3799,7 @@ function ai({ node: n, ctx: r, assocCode: i, assocEntity: a, fkField: o }) {
|
|
|
3585
3799
|
onClick: () => E((e) => e + 1),
|
|
3586
3800
|
children: "Add row"
|
|
3587
3801
|
})]
|
|
3588
|
-
}), O = p ? /* @__PURE__ */ Z(
|
|
3802
|
+
}), O = p ? /* @__PURE__ */ Z(Oi, {
|
|
3589
3803
|
entityCode: i,
|
|
3590
3804
|
entity: a,
|
|
3591
3805
|
parentEntity: r.entityCode,
|
|
@@ -3599,7 +3813,7 @@ function ai({ node: n, ctx: r, assocCode: i, assocEntity: a, fkField: o }) {
|
|
|
3599
3813
|
filterFields: n.filters,
|
|
3600
3814
|
sort: n.sort,
|
|
3601
3815
|
startDraftSignal: T
|
|
3602
|
-
}) : /* @__PURE__ */ Z(
|
|
3816
|
+
}) : /* @__PURE__ */ Z(Di, {
|
|
3603
3817
|
entityCode: i,
|
|
3604
3818
|
entity: a,
|
|
3605
3819
|
parentEntity: r.entityCode,
|
|
@@ -3629,9 +3843,9 @@ function ai({ node: n, ctx: r, assocCode: i, assocEntity: a, fkField: o }) {
|
|
|
3629
3843
|
children: O
|
|
3630
3844
|
});
|
|
3631
3845
|
}
|
|
3632
|
-
function
|
|
3633
|
-
let d = Re(), { data: f, isLoading: p, isError: m } =
|
|
3634
|
-
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, {
|
|
3635
3849
|
entityCode: e,
|
|
3636
3850
|
entity: t,
|
|
3637
3851
|
parentId: r,
|
|
@@ -3646,7 +3860,7 @@ function oi({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey
|
|
|
3646
3860
|
isError: m,
|
|
3647
3861
|
invalidateQuery: G(() => {
|
|
3648
3862
|
d.invalidateQueries({ queryKey: [
|
|
3649
|
-
|
|
3863
|
+
Zn,
|
|
3650
3864
|
n,
|
|
3651
3865
|
r,
|
|
3652
3866
|
e
|
|
@@ -3660,7 +3874,7 @@ function oi({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey
|
|
|
3660
3874
|
startDraftSignal: u
|
|
3661
3875
|
});
|
|
3662
3876
|
}
|
|
3663
|
-
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 }) {
|
|
3664
3878
|
let h = Re(), [g, _] = Y(""), [v, y] = Y(""), [b, x] = Y({}), S = J(void 0);
|
|
3665
3879
|
K(() => (S.current && clearTimeout(S.current), S.current = setTimeout(() => {
|
|
3666
3880
|
y(g);
|
|
@@ -3678,7 +3892,7 @@ function si({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey
|
|
|
3678
3892
|
[e]: t
|
|
3679
3893
|
};
|
|
3680
3894
|
});
|
|
3681
|
-
}, []), 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(() => {
|
|
3682
3896
|
if (!T?.pages) return {
|
|
3683
3897
|
rows: [],
|
|
3684
3898
|
refs: void 0
|
|
@@ -3700,7 +3914,7 @@ function si({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey
|
|
|
3700
3914
|
} });
|
|
3701
3915
|
}, [h, e]);
|
|
3702
3916
|
return /* @__PURE__ */ Q("div", { children: [
|
|
3703
|
-
/* @__PURE__ */ Z(
|
|
3917
|
+
/* @__PURE__ */ Z(gi, {
|
|
3704
3918
|
entity: t,
|
|
3705
3919
|
searchable: d,
|
|
3706
3920
|
filterFields: f,
|
|
@@ -3710,7 +3924,7 @@ function si({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey
|
|
|
3710
3924
|
onFilterChange: C,
|
|
3711
3925
|
allEntities: c.schema.entities
|
|
3712
3926
|
}),
|
|
3713
|
-
/* @__PURE__ */ Z(
|
|
3927
|
+
/* @__PURE__ */ Z(ki, {
|
|
3714
3928
|
entityCode: e,
|
|
3715
3929
|
entity: t,
|
|
3716
3930
|
parentId: r,
|
|
@@ -3739,17 +3953,17 @@ function si({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey
|
|
|
3739
3953
|
})
|
|
3740
3954
|
] });
|
|
3741
3955
|
}
|
|
3742
|
-
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 }) {
|
|
3743
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, [
|
|
3744
3958
|
o,
|
|
3745
3959
|
t,
|
|
3746
3960
|
s.schema.screens
|
|
3747
|
-
]), v = q(() => a ?
|
|
3961
|
+
]), v = q(() => a ? Si(t, i, r) : /* @__PURE__ */ new Set(), [
|
|
3748
3962
|
i,
|
|
3749
3963
|
r,
|
|
3750
3964
|
t,
|
|
3751
3965
|
a
|
|
3752
|
-
]), y = q(() =>
|
|
3966
|
+
]), y = q(() => Ci(t, i, r), [
|
|
3753
3967
|
i,
|
|
3754
3968
|
r,
|
|
3755
3969
|
t
|
|
@@ -3767,7 +3981,7 @@ function ci({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
|
|
|
3767
3981
|
typeof r == "string" && r !== "" && e.set(b(V(t, n)), r);
|
|
3768
3982
|
}
|
|
3769
3983
|
return e;
|
|
3770
|
-
}, [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);
|
|
3771
3985
|
I.current = N;
|
|
3772
3986
|
let L = J({});
|
|
3773
3987
|
K(() => {
|
|
@@ -3864,7 +4078,7 @@ function ci({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
|
|
|
3864
4078
|
]);
|
|
3865
4079
|
let ue = G(async () => {
|
|
3866
4080
|
if (!R) return;
|
|
3867
|
-
let n =
|
|
4081
|
+
let n = wi(R, i, t, r);
|
|
3868
4082
|
if (n.length > 0) {
|
|
3869
4083
|
ee(n);
|
|
3870
4084
|
return;
|
|
@@ -3893,7 +4107,7 @@ function ci({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
|
|
|
3893
4107
|
O(null), j([]);
|
|
3894
4108
|
return;
|
|
3895
4109
|
}
|
|
3896
|
-
let o =
|
|
4110
|
+
let o = wi({
|
|
3897
4111
|
...c.find((n) => b(V(t, n)) === e) ?? {},
|
|
3898
4112
|
...a
|
|
3899
4113
|
}, i, t, r);
|
|
@@ -3972,7 +4186,7 @@ function ci({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
|
|
|
3972
4186
|
},
|
|
3973
4187
|
children: [c.map((n) => {
|
|
3974
4188
|
let r = b(V(t, n)), c = W.has(r), u = N[r], d = _ && r ? _.replace(/:\w+/, r) : void 0;
|
|
3975
|
-
return /* @__PURE__ */ Z(
|
|
4189
|
+
return /* @__PURE__ */ Z(Ai, {
|
|
3976
4190
|
rowId: r,
|
|
3977
4191
|
row: n,
|
|
3978
4192
|
entity: t,
|
|
@@ -4007,7 +4221,7 @@ function ci({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
|
|
|
4007
4221
|
entityCode: e,
|
|
4008
4222
|
onRowActionSuccess: f
|
|
4009
4223
|
}, r);
|
|
4010
|
-
}), R && /* @__PURE__ */ Z(
|
|
4224
|
+
}), R && /* @__PURE__ */ Z(Fi, {
|
|
4011
4225
|
draftRow: R,
|
|
4012
4226
|
entity: t,
|
|
4013
4227
|
columns: i,
|
|
@@ -4066,7 +4280,7 @@ function ci({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
|
|
|
4066
4280
|
} })
|
|
4067
4281
|
] }) }), /* @__PURE__ */ Q("tbody", { children: [c.map((n) => {
|
|
4068
4282
|
let r = b(V(t, n)), c = W.has(r), u = N[r], d = _ && r ? _.replace(/:\w+/, r) : void 0;
|
|
4069
|
-
return /* @__PURE__ */ Z(
|
|
4283
|
+
return /* @__PURE__ */ Z(ji, {
|
|
4070
4284
|
rowId: r,
|
|
4071
4285
|
row: n,
|
|
4072
4286
|
entity: t,
|
|
@@ -4101,7 +4315,7 @@ function ci({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
|
|
|
4101
4315
|
entityCode: e,
|
|
4102
4316
|
onRowActionSuccess: f
|
|
4103
4317
|
}, r);
|
|
4104
|
-
}), R && /* @__PURE__ */ Z(
|
|
4318
|
+
}), R && /* @__PURE__ */ Z(Pi, {
|
|
4105
4319
|
draftRow: R,
|
|
4106
4320
|
entity: t,
|
|
4107
4321
|
columns: i,
|
|
@@ -4132,12 +4346,12 @@ function ci({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
|
|
|
4132
4346
|
})
|
|
4133
4347
|
] });
|
|
4134
4348
|
}
|
|
4135
|
-
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 }) {
|
|
4136
4350
|
let D = j(), k = je(), A = q(() => !h || Object.keys(h.buffer).length === 0 ? n : {
|
|
4137
4351
|
...n,
|
|
4138
4352
|
...h.buffer
|
|
4139
4353
|
}, [n, h]);
|
|
4140
|
-
return d === "row_edit" && f ? /* @__PURE__ */ Z(
|
|
4354
|
+
return d === "row_edit" && f ? /* @__PURE__ */ Z(Ni, {
|
|
4141
4355
|
values: A,
|
|
4142
4356
|
entity: r,
|
|
4143
4357
|
columns: s,
|
|
@@ -4246,7 +4460,7 @@ function li({ rowId: t, row: n, entity: r, entities: i, screens: a, columns: s,
|
|
|
4246
4460
|
onClick: () => _(t),
|
|
4247
4461
|
title: "Delete row"
|
|
4248
4462
|
})
|
|
4249
|
-
] }), !l && T && T.length > 0 && /* @__PURE__ */ Z(
|
|
4463
|
+
] }), !l && T && T.length > 0 && /* @__PURE__ */ Z(hi, {
|
|
4250
4464
|
actions: T,
|
|
4251
4465
|
objectIds: [t],
|
|
4252
4466
|
row: A,
|
|
@@ -4255,12 +4469,12 @@ function li({ rowId: t, row: n, entity: r, entities: i, screens: a, columns: s,
|
|
|
4255
4469
|
})]
|
|
4256
4470
|
});
|
|
4257
4471
|
}
|
|
4258
|
-
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 }) {
|
|
4259
4473
|
let A = j(), M = q(() => !_ || Object.keys(_.buffer).length === 0 ? n : {
|
|
4260
4474
|
...n,
|
|
4261
4475
|
..._.buffer
|
|
4262
4476
|
}, [n, _]);
|
|
4263
|
-
if (d === "row_edit" && f) return /* @__PURE__ */ Z(
|
|
4477
|
+
if (d === "row_edit" && f) return /* @__PURE__ */ Z(Mi, {
|
|
4264
4478
|
values: M,
|
|
4265
4479
|
entity: r,
|
|
4266
4480
|
columns: s,
|
|
@@ -4373,7 +4587,7 @@ function ui({ rowId: t, row: n, entity: r, entities: i, screens: a, columns: s,
|
|
|
4373
4587
|
borderBottom: "1px solid var(--divider)",
|
|
4374
4588
|
verticalAlign: "middle"
|
|
4375
4589
|
},
|
|
4376
|
-
children: /* @__PURE__ */ Z(
|
|
4590
|
+
children: /* @__PURE__ */ Z(hi, {
|
|
4377
4591
|
actions: D,
|
|
4378
4592
|
objectIds: [t],
|
|
4379
4593
|
row: M,
|
|
@@ -4383,7 +4597,7 @@ function ui({ rowId: t, row: n, entity: r, entities: i, screens: a, columns: s,
|
|
|
4383
4597
|
]
|
|
4384
4598
|
});
|
|
4385
4599
|
}
|
|
4386
|
-
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 }) {
|
|
4387
4601
|
let m = j(), h = a.find((e) => e.startsWith("_error:")), g = new Set(a.filter((e) => !e.startsWith("_error:"))), _ = {
|
|
4388
4602
|
padding: "6px 12px",
|
|
4389
4603
|
borderBottom: "1px solid var(--divider)",
|
|
@@ -4466,7 +4680,7 @@ function di({ values: t, entity: n, columns: r, editableColumns: i, errors: a, s
|
|
|
4466
4680
|
})]
|
|
4467
4681
|
});
|
|
4468
4682
|
}
|
|
4469
|
-
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 }) {
|
|
4470
4684
|
let m = j(), h = je(), g = a.find((e) => e.startsWith("_error:")), _ = new Set(a.filter((e) => !e.startsWith("_error:")));
|
|
4471
4685
|
return /* @__PURE__ */ Q("div", {
|
|
4472
4686
|
style: {
|
|
@@ -4567,8 +4781,8 @@ function fi({ values: t, entity: n, columns: r, editableColumns: i, errors: a, s
|
|
|
4567
4781
|
})]
|
|
4568
4782
|
});
|
|
4569
4783
|
}
|
|
4570
|
-
function
|
|
4571
|
-
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, {
|
|
4572
4786
|
values: e,
|
|
4573
4787
|
entity: t,
|
|
4574
4788
|
columns: n,
|
|
@@ -4585,8 +4799,8 @@ function pi({ draftRow: e, entity: t, columns: n, editableColumns: r, foreignKey
|
|
|
4585
4799
|
accent: !0
|
|
4586
4800
|
});
|
|
4587
4801
|
}
|
|
4588
|
-
function
|
|
4589
|
-
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, {
|
|
4590
4804
|
values: e,
|
|
4591
4805
|
entity: t,
|
|
4592
4806
|
columns: n,
|
|
@@ -4605,21 +4819,21 @@ function mi({ draftRow: e, entity: t, columns: n, editableColumns: r, foreignKey
|
|
|
4605
4819
|
}
|
|
4606
4820
|
//#endregion
|
|
4607
4821
|
//#region src/components/shared/LoadingSkeleton.tsx
|
|
4608
|
-
var
|
|
4822
|
+
var Ii = {
|
|
4609
4823
|
display: "block",
|
|
4610
4824
|
background: "linear-gradient(90deg, var(--surface-3) 0%, var(--surface-2) 40%, var(--surface-3) 80%)",
|
|
4611
4825
|
backgroundSize: "200% 100%",
|
|
4612
4826
|
borderRadius: 6,
|
|
4613
4827
|
animation: "declarion-shimmer 1.2s ease-in-out infinite"
|
|
4614
4828
|
};
|
|
4615
|
-
function
|
|
4829
|
+
function Li({ height: e, width: t }) {
|
|
4616
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: {
|
|
4617
|
-
...
|
|
4831
|
+
...Ii,
|
|
4618
4832
|
height: e,
|
|
4619
4833
|
width: t ?? "100%"
|
|
4620
4834
|
} })] });
|
|
4621
4835
|
}
|
|
4622
|
-
function
|
|
4836
|
+
function Ri({ rows: e = 8, cols: t = 4 }) {
|
|
4623
4837
|
return /* @__PURE__ */ Q("div", {
|
|
4624
4838
|
style: {
|
|
4625
4839
|
padding: 16,
|
|
@@ -4634,7 +4848,7 @@ function _i({ rows: e = 8, cols: t = 4 }) {
|
|
|
4634
4848
|
},
|
|
4635
4849
|
children: Array.from({ length: t }).map((e, t) => /* @__PURE__ */ Z("div", {
|
|
4636
4850
|
style: { flex: 1 },
|
|
4637
|
-
children: /* @__PURE__ */ Z(
|
|
4851
|
+
children: /* @__PURE__ */ Z(Li, { height: 14 })
|
|
4638
4852
|
}, t))
|
|
4639
4853
|
}), Array.from({ length: e }).map((e, n) => /* @__PURE__ */ Z("div", {
|
|
4640
4854
|
style: {
|
|
@@ -4643,12 +4857,12 @@ function _i({ rows: e = 8, cols: t = 4 }) {
|
|
|
4643
4857
|
},
|
|
4644
4858
|
children: Array.from({ length: t }).map((e, t) => /* @__PURE__ */ Z("div", {
|
|
4645
4859
|
style: { flex: 1 },
|
|
4646
|
-
children: /* @__PURE__ */ Z(
|
|
4860
|
+
children: /* @__PURE__ */ Z(Li, { height: 28 })
|
|
4647
4861
|
}, t))
|
|
4648
4862
|
}, n))]
|
|
4649
4863
|
});
|
|
4650
4864
|
}
|
|
4651
|
-
function
|
|
4865
|
+
function zi() {
|
|
4652
4866
|
return /* @__PURE__ */ Q("div", {
|
|
4653
4867
|
style: {
|
|
4654
4868
|
padding: 20,
|
|
@@ -4657,7 +4871,7 @@ function vi() {
|
|
|
4657
4871
|
gap: 16
|
|
4658
4872
|
},
|
|
4659
4873
|
children: [
|
|
4660
|
-
/* @__PURE__ */ Z(
|
|
4874
|
+
/* @__PURE__ */ Z(Li, {
|
|
4661
4875
|
height: 12,
|
|
4662
4876
|
width: 160
|
|
4663
4877
|
}),
|
|
@@ -4668,11 +4882,11 @@ function vi() {
|
|
|
4668
4882
|
gap: 12
|
|
4669
4883
|
},
|
|
4670
4884
|
children: [/* @__PURE__ */ Z("span", { style: {
|
|
4671
|
-
...
|
|
4885
|
+
...Ii,
|
|
4672
4886
|
width: 32,
|
|
4673
4887
|
height: 32,
|
|
4674
4888
|
borderRadius: 8
|
|
4675
|
-
} }), /* @__PURE__ */ Z(
|
|
4889
|
+
} }), /* @__PURE__ */ Z(Li, {
|
|
4676
4890
|
height: 22,
|
|
4677
4891
|
width: 240
|
|
4678
4892
|
})]
|
|
@@ -4689,7 +4903,7 @@ function vi() {
|
|
|
4689
4903
|
padding: "11px 14px",
|
|
4690
4904
|
borderBottom: "1px solid var(--divider)"
|
|
4691
4905
|
},
|
|
4692
|
-
children: /* @__PURE__ */ Z(
|
|
4906
|
+
children: /* @__PURE__ */ Z(Li, {
|
|
4693
4907
|
height: 13,
|
|
4694
4908
|
width: 150
|
|
4695
4909
|
})
|
|
@@ -4705,12 +4919,12 @@ function vi() {
|
|
|
4705
4919
|
display: "flex",
|
|
4706
4920
|
gap: 16
|
|
4707
4921
|
},
|
|
4708
|
-
children: [/* @__PURE__ */ Z(
|
|
4922
|
+
children: [/* @__PURE__ */ Z(Li, {
|
|
4709
4923
|
height: 13,
|
|
4710
4924
|
width: 110
|
|
4711
4925
|
}), /* @__PURE__ */ Z("div", {
|
|
4712
4926
|
style: { flex: 1 },
|
|
4713
|
-
children: /* @__PURE__ */ Z(
|
|
4927
|
+
children: /* @__PURE__ */ Z(Li, { height: 13 })
|
|
4714
4928
|
})]
|
|
4715
4929
|
}, t))
|
|
4716
4930
|
})]
|
|
@@ -4720,11 +4934,11 @@ function vi() {
|
|
|
4720
4934
|
}
|
|
4721
4935
|
//#endregion
|
|
4722
4936
|
//#region src/lib/sort.ts
|
|
4723
|
-
var
|
|
4937
|
+
var Bi = {
|
|
4724
4938
|
nulls_first: "first",
|
|
4725
4939
|
nulls_last: "last"
|
|
4726
4940
|
};
|
|
4727
|
-
function
|
|
4941
|
+
function Vi(e) {
|
|
4728
4942
|
if (!e) return [];
|
|
4729
4943
|
let t = [];
|
|
4730
4944
|
for (let n of e.split(",")) {
|
|
@@ -4737,14 +4951,14 @@ function bi(e) {
|
|
|
4737
4951
|
dir: r[1]?.trim().toLowerCase() === "desc" ? "desc" : "asc"
|
|
4738
4952
|
}, o = r[2]?.trim().toLowerCase();
|
|
4739
4953
|
if (o) {
|
|
4740
|
-
let e =
|
|
4954
|
+
let e = Bi[o];
|
|
4741
4955
|
e && (a.nulls = e);
|
|
4742
4956
|
}
|
|
4743
4957
|
t.push(a);
|
|
4744
4958
|
}
|
|
4745
4959
|
return t;
|
|
4746
4960
|
}
|
|
4747
|
-
function
|
|
4961
|
+
function Hi(e) {
|
|
4748
4962
|
if (!e) return;
|
|
4749
4963
|
let t = [];
|
|
4750
4964
|
for (let n of e.split(",")) {
|
|
@@ -4755,30 +4969,30 @@ function xi(e) {
|
|
|
4755
4969
|
}
|
|
4756
4970
|
return t.length > 0 ? t.join(",") : void 0;
|
|
4757
4971
|
}
|
|
4758
|
-
function
|
|
4972
|
+
function Ui(e) {
|
|
4759
4973
|
return e.map((e) => {
|
|
4760
4974
|
let t = `${e.field}:${e.dir}`;
|
|
4761
4975
|
return e.nulls === "first" ? `${t}:nulls_first` : e.nulls === "last" ? `${t}:nulls_last` : t;
|
|
4762
4976
|
}).join(",");
|
|
4763
4977
|
}
|
|
4764
|
-
function
|
|
4978
|
+
function Wi(e, t) {
|
|
4765
4979
|
let n = e.findIndex((e) => e.field === t);
|
|
4766
4980
|
return n >= 0 ? [...e.slice(0, n), ...e.slice(n + 1)] : e.length >= 5 ? e : [...e, {
|
|
4767
4981
|
field: t,
|
|
4768
4982
|
dir: "asc"
|
|
4769
4983
|
}];
|
|
4770
4984
|
}
|
|
4771
|
-
function
|
|
4985
|
+
function Gi(e, t) {
|
|
4772
4986
|
let n = e.filter((e) => e.field !== t.field);
|
|
4773
4987
|
return n.length >= 5 ? e : [...n, t];
|
|
4774
4988
|
}
|
|
4775
|
-
function
|
|
4989
|
+
function Ki(e, t) {
|
|
4776
4990
|
let n = e.findIndex((e) => e.field === t);
|
|
4777
4991
|
return n < 0 ? e : [...e.slice(0, n), ...e.slice(n + 1)];
|
|
4778
4992
|
}
|
|
4779
4993
|
//#endregion
|
|
4780
4994
|
//#region src/hooks/useScreenBack.ts
|
|
4781
|
-
function
|
|
4995
|
+
function qi(e) {
|
|
4782
4996
|
let t = Pe(), r = n(), i = c(), a = Tt((e) => e.depth), { data: o } = A(), s = e?.fallback, l = wt((e) => {
|
|
4783
4997
|
let t = e.tabs.find((t) => t.id === e.activeTabId);
|
|
4784
4998
|
return t ? t.returnTo : void 0;
|
|
@@ -4826,40 +5040,40 @@ function Ei(e) {
|
|
|
4826
5040
|
}
|
|
4827
5041
|
//#endregion
|
|
4828
5042
|
//#region src/lib/field-classification.ts
|
|
4829
|
-
function
|
|
5043
|
+
function Ji(e, t) {
|
|
4830
5044
|
let n = e?.field_access?.[t];
|
|
4831
5045
|
return !n || n.read === "granted";
|
|
4832
5046
|
}
|
|
4833
|
-
function
|
|
5047
|
+
function Yi(e, t) {
|
|
4834
5048
|
let n = e?.field_access?.[t];
|
|
4835
5049
|
return !n || n.write === "granted";
|
|
4836
5050
|
}
|
|
4837
|
-
function
|
|
5051
|
+
function Xi(e, t) {
|
|
4838
5052
|
return e?.field_access?.[t]?.classification;
|
|
4839
5053
|
}
|
|
4840
|
-
function
|
|
5054
|
+
function Zi(e, t) {
|
|
4841
5055
|
return e?.field_access?.[t]?.required_permission;
|
|
4842
5056
|
}
|
|
4843
|
-
function
|
|
4844
|
-
let r =
|
|
5057
|
+
function Qi(e, t, n) {
|
|
5058
|
+
let r = Xi(t, n);
|
|
4845
5059
|
if (r) return e?.classifications?.[r];
|
|
4846
5060
|
}
|
|
4847
|
-
function
|
|
4848
|
-
return !!
|
|
5061
|
+
function $i(e, t, n) {
|
|
5062
|
+
return !!Qi(e, t, n)?.sod_protected;
|
|
4849
5063
|
}
|
|
4850
|
-
function
|
|
5064
|
+
function ea(e, t) {
|
|
4851
5065
|
return e?.field_access?.[t];
|
|
4852
5066
|
}
|
|
4853
5067
|
//#endregion
|
|
4854
5068
|
//#region src/components/pages/list/cardProjection.ts
|
|
4855
|
-
var
|
|
5069
|
+
var ta = 4, na = 2, ra = 2, ia = [
|
|
4856
5070
|
"screen_card",
|
|
4857
5071
|
"entity_card",
|
|
4858
5072
|
"saved_view_columns",
|
|
4859
5073
|
"screen_default_columns",
|
|
4860
5074
|
"screen_columns",
|
|
4861
5075
|
"entity_inference"
|
|
4862
|
-
],
|
|
5076
|
+
], aa = /* @__PURE__ */ new Set(["_select", "_actions"]), oa = /* @__PURE__ */ new Set([
|
|
4863
5077
|
"text",
|
|
4864
5078
|
"rich_text",
|
|
4865
5079
|
"multilang_text",
|
|
@@ -4868,11 +5082,11 @@ var Pi = 4, Fi = 2, Ii = 2, Li = [
|
|
|
4868
5082
|
"secret",
|
|
4869
5083
|
"password",
|
|
4870
5084
|
"bytes"
|
|
4871
|
-
]),
|
|
5085
|
+
]), sa = /* @__PURE__ */ new Set(["enum", "bool"]), ca = /* @__PURE__ */ new Set([
|
|
4872
5086
|
"date",
|
|
4873
5087
|
"time",
|
|
4874
5088
|
"timestamp"
|
|
4875
|
-
]),
|
|
5089
|
+
]), la = /* @__PURE__ */ new Set([
|
|
4876
5090
|
"string",
|
|
4877
5091
|
"text",
|
|
4878
5092
|
"email",
|
|
@@ -4898,31 +5112,31 @@ var Pi = 4, Fi = 2, Ii = 2, Li = [
|
|
|
4898
5112
|
"enum",
|
|
4899
5113
|
"status"
|
|
4900
5114
|
]);
|
|
4901
|
-
function
|
|
5115
|
+
function ua(e) {
|
|
4902
5116
|
let { entity: t, screen: n, savedViewColumns: r } = e, i = n?.card;
|
|
4903
|
-
if (i) return
|
|
4904
|
-
if (t?.card) return
|
|
4905
|
-
let a =
|
|
4906
|
-
return
|
|
4907
|
-
}
|
|
4908
|
-
function
|
|
4909
|
-
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
|
|
4910
|
-
for (let e of p) f.addField(e, "render"),
|
|
4911
|
-
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, [
|
|
4912
5126
|
o,
|
|
4913
5127
|
s,
|
|
4914
5128
|
c
|
|
4915
|
-
], f), g =
|
|
5129
|
+
], f), g = Fa(t, l, f), _ = Ia(t, n, d, f);
|
|
4916
5130
|
if (u) for (let e of m) f.addField(e, "detail_handoff");
|
|
4917
|
-
let v = new
|
|
5131
|
+
let v = new Ga();
|
|
4918
5132
|
for (let e of m) v.add(e);
|
|
4919
5133
|
for (let e of h) v.add(e);
|
|
4920
5134
|
for (let e of g) v.add(e);
|
|
4921
5135
|
for (let e of _) v.add(e);
|
|
4922
|
-
let y = new
|
|
4923
|
-
for (let e of p)
|
|
4924
|
-
for (let e of v.values())
|
|
4925
|
-
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);
|
|
4926
5140
|
return {
|
|
4927
5141
|
renderFields: p,
|
|
4928
5142
|
dependencyFields: v.values().filter((e) => !p.includes(e)),
|
|
@@ -4934,22 +5148,22 @@ function Wi(e) {
|
|
|
4934
5148
|
reasons: f.snapshot()
|
|
4935
5149
|
};
|
|
4936
5150
|
}
|
|
4937
|
-
function
|
|
5151
|
+
function fa(e, t, n) {
|
|
4938
5152
|
if (!e || t?.on_row_click !== "peek" || t.quick_peek?.enabled === !1) return [];
|
|
4939
5153
|
let r = t.quick_peek?.fields;
|
|
4940
|
-
if (r && r.length > 0) return
|
|
5154
|
+
if (r && r.length > 0) return va(e, r, { explicit: !0 });
|
|
4941
5155
|
let i = t.quick_peek?.sections;
|
|
4942
5156
|
if (i && i.length > 0) {
|
|
4943
|
-
let r = Object.values(n ?? {}).find((e) => e.type === "detail" && e.entity === t.entity), a = new
|
|
4944
|
-
|
|
4945
|
-
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 });
|
|
4946
5160
|
if (o.length > 0) return o;
|
|
4947
5161
|
}
|
|
4948
|
-
return
|
|
5162
|
+
return Ba(e);
|
|
4949
5163
|
}
|
|
4950
|
-
function
|
|
4951
|
-
let r = t.max_body_fields ??
|
|
4952
|
-
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({
|
|
4953
5167
|
source: n,
|
|
4954
5168
|
explicit: !0,
|
|
4955
5169
|
titleField: i,
|
|
@@ -4962,29 +5176,29 @@ function Ki(e, t, n) {
|
|
|
4962
5176
|
maxBodyFields: r
|
|
4963
5177
|
});
|
|
4964
5178
|
}
|
|
4965
|
-
function
|
|
4966
|
-
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, {
|
|
4967
5181
|
allowLong: !1,
|
|
4968
5182
|
allowAuto: !1
|
|
4969
|
-
}), 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);
|
|
4970
5184
|
for (let e of d) u.add(e);
|
|
4971
|
-
let f = r.filter((t) => !u.has(t) &&
|
|
5185
|
+
let f = r.filter((t) => !u.has(t) && Ta(e, t)).slice(0, ra);
|
|
4972
5186
|
for (let e of f) u.add(e);
|
|
4973
|
-
return
|
|
5187
|
+
return ha({
|
|
4974
5188
|
source: n,
|
|
4975
5189
|
explicit: !1,
|
|
4976
5190
|
titleField: o,
|
|
4977
5191
|
titleUsesDisplay: s,
|
|
4978
5192
|
subtitleField: l,
|
|
4979
5193
|
badgeFields: d,
|
|
4980
|
-
bodyFields: r.filter((t) => !u.has(t) &&
|
|
5194
|
+
bodyFields: r.filter((t) => !u.has(t) && xa(e, t)).slice(0, i),
|
|
4981
5195
|
metaFields: f,
|
|
4982
5196
|
hideEmptyFields: !0,
|
|
4983
5197
|
maxBodyFields: i
|
|
4984
5198
|
});
|
|
4985
5199
|
}
|
|
4986
|
-
function
|
|
4987
|
-
let t = new
|
|
5200
|
+
function ha(e) {
|
|
5201
|
+
let t = new Ga(), n = [], r = (r, i) => {
|
|
4988
5202
|
!r || t.has(r) || (t.add(r), n.push({
|
|
4989
5203
|
field: r,
|
|
4990
5204
|
bucket: i,
|
|
@@ -5008,10 +5222,10 @@ function Ji(e) {
|
|
|
5008
5222
|
maxBodyFields: e.maxBodyFields,
|
|
5009
5223
|
renderFields: t.values(),
|
|
5010
5224
|
fields: n,
|
|
5011
|
-
sourcePrecedence:
|
|
5225
|
+
sourcePrecedence: ia
|
|
5012
5226
|
};
|
|
5013
5227
|
}
|
|
5014
|
-
function
|
|
5228
|
+
function ga(e, t, n) {
|
|
5015
5229
|
return n && n.length > 0 ? {
|
|
5016
5230
|
source: "saved_view_columns",
|
|
5017
5231
|
columns: n
|
|
@@ -5023,29 +5237,29 @@ function Yi(e, t, n) {
|
|
|
5023
5237
|
columns: t.columns
|
|
5024
5238
|
} : {
|
|
5025
5239
|
source: "entity_inference",
|
|
5026
|
-
columns:
|
|
5240
|
+
columns: _a(e)
|
|
5027
5241
|
};
|
|
5028
5242
|
}
|
|
5029
|
-
function
|
|
5243
|
+
function _a(e) {
|
|
5030
5244
|
if (!e) return [];
|
|
5031
5245
|
let t = [];
|
|
5032
5246
|
e.display.display_field && t.push(e.display.display_field);
|
|
5033
5247
|
for (let [n] of e.fields) t.push(n);
|
|
5034
5248
|
for (let n of Object.keys(e.status_groups ?? {})) t.push(`$status.${n}`);
|
|
5035
5249
|
for (let n of Object.keys(e.properties ?? {})) t.push(`$property.${n}`);
|
|
5036
|
-
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);
|
|
5037
5251
|
return t;
|
|
5038
5252
|
}
|
|
5039
|
-
function
|
|
5040
|
-
let r = new
|
|
5253
|
+
function va(e, t, n) {
|
|
5254
|
+
let r = new Ga();
|
|
5041
5255
|
for (let i of t) {
|
|
5042
|
-
let t =
|
|
5256
|
+
let t = ya(e, i, n);
|
|
5043
5257
|
t && r.add(t);
|
|
5044
5258
|
}
|
|
5045
5259
|
return r.values();
|
|
5046
5260
|
}
|
|
5047
|
-
function
|
|
5048
|
-
if (!t ||
|
|
5261
|
+
function ya(e, t, n) {
|
|
5262
|
+
if (!t || aa.has(t)) return;
|
|
5049
5263
|
if (!e) return t.startsWith("$") ? void 0 : t;
|
|
5050
5264
|
if (t.startsWith("$status.")) {
|
|
5051
5265
|
let n = t.slice(8);
|
|
@@ -5055,61 +5269,62 @@ function Qi(e, t, n) {
|
|
|
5055
5269
|
let n = t.slice(10);
|
|
5056
5270
|
return e.properties?.[n] ? t : void 0;
|
|
5057
5271
|
}
|
|
5272
|
+
if (t === "$evidence") return e.evidence_covered ? t : void 0;
|
|
5058
5273
|
if (t.startsWith("$")) return;
|
|
5059
5274
|
let r = e.fields.get(t), i = e.files?.get(t);
|
|
5060
5275
|
if (!(!r && !i) && (n.explicit || !(r && r.display?.is_listable === !1) && !(i && i.display?.is_listable === !1))) return t;
|
|
5061
5276
|
}
|
|
5062
|
-
function
|
|
5063
|
-
return t.find((t) => n.exclude?.has(t) || !n.allowAuto &&
|
|
5064
|
-
}
|
|
5065
|
-
function ea(e, t) {
|
|
5066
|
-
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));
|
|
5067
5279
|
}
|
|
5068
|
-
function
|
|
5069
|
-
return !(!
|
|
5280
|
+
function xa(e, t) {
|
|
5281
|
+
return !(!Ea(e, t) || Da(e, t) || Oa(e, t));
|
|
5070
5282
|
}
|
|
5071
|
-
function
|
|
5072
|
-
|
|
5073
|
-
let n = Ca(e, t);
|
|
5074
|
-
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));
|
|
5075
5285
|
}
|
|
5076
|
-
function
|
|
5077
|
-
|
|
5078
|
-
|
|
5079
|
-
|
|
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);
|
|
5080
5295
|
return n.values();
|
|
5081
5296
|
}
|
|
5082
|
-
function
|
|
5083
|
-
if (
|
|
5084
|
-
let n =
|
|
5085
|
-
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);
|
|
5086
5301
|
}
|
|
5087
|
-
function
|
|
5088
|
-
return
|
|
5302
|
+
function Ea(e, t) {
|
|
5303
|
+
return Wa(e, t).kind !== "missing";
|
|
5089
5304
|
}
|
|
5090
|
-
function
|
|
5091
|
-
let n =
|
|
5305
|
+
function Da(e, t) {
|
|
5306
|
+
let n = Wa(e, t);
|
|
5092
5307
|
return n.kind === "field" && (n.field.primary === !0 || n.field.auto === !0);
|
|
5093
5308
|
}
|
|
5094
|
-
function
|
|
5095
|
-
let n =
|
|
5096
|
-
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);
|
|
5097
5312
|
}
|
|
5098
|
-
function
|
|
5313
|
+
function ka(e, t) {
|
|
5099
5314
|
if (!e) return [];
|
|
5100
|
-
let n = new
|
|
5315
|
+
let n = new Ga();
|
|
5101
5316
|
for (let r of z(e)) n.add(r), t.addField(r, "identity");
|
|
5102
|
-
let r =
|
|
5103
|
-
r && (n.add(r), t.addField(r, "display"),
|
|
5104
|
-
for (let r of
|
|
5105
|
-
let i =
|
|
5106
|
-
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"));
|
|
5107
5322
|
}
|
|
5108
5323
|
return n.values();
|
|
5109
5324
|
}
|
|
5110
|
-
function
|
|
5325
|
+
function Aa(e) {
|
|
5111
5326
|
if (!e) return [];
|
|
5112
|
-
let t = new
|
|
5327
|
+
let t = new Ga(), n = 0;
|
|
5113
5328
|
for (; n < e.length;) {
|
|
5114
5329
|
let r = e.indexOf("${", n);
|
|
5115
5330
|
if (r < 0) break;
|
|
@@ -5117,14 +5332,14 @@ function la(e) {
|
|
|
5117
5332
|
n = r + 2;
|
|
5118
5333
|
continue;
|
|
5119
5334
|
}
|
|
5120
|
-
let i =
|
|
5335
|
+
let i = ja(e, r + 2);
|
|
5121
5336
|
if (i < 0) break;
|
|
5122
|
-
for (let n of
|
|
5337
|
+
for (let n of Ma(e.slice(r + 2, i))) t.add(n);
|
|
5123
5338
|
n = i + 1;
|
|
5124
5339
|
}
|
|
5125
5340
|
return t.values();
|
|
5126
5341
|
}
|
|
5127
|
-
function
|
|
5342
|
+
function ja(e, t) {
|
|
5128
5343
|
let n = 0;
|
|
5129
5344
|
for (let r = t; r < e.length; r += 1) {
|
|
5130
5345
|
let t = e[r];
|
|
@@ -5139,62 +5354,62 @@ function ua(e, t) {
|
|
|
5139
5354
|
}
|
|
5140
5355
|
return -1;
|
|
5141
5356
|
}
|
|
5142
|
-
function
|
|
5143
|
-
let t = new
|
|
5357
|
+
function Ma(e) {
|
|
5358
|
+
let t = new Ga(), n = 0;
|
|
5144
5359
|
for (; n < e.length;) {
|
|
5145
5360
|
let r = e.indexOf("row.", n);
|
|
5146
5361
|
if (r < 0) break;
|
|
5147
|
-
if (r > 0 &&
|
|
5362
|
+
if (r > 0 && Na(e.charCodeAt(r - 1))) {
|
|
5148
5363
|
n = r + 4;
|
|
5149
5364
|
continue;
|
|
5150
5365
|
}
|
|
5151
5366
|
let i = r + 4, a = i;
|
|
5152
|
-
for (; a < e.length &&
|
|
5367
|
+
for (; a < e.length && Na(e.charCodeAt(a));) a += 1;
|
|
5153
5368
|
a > i && t.add(e.slice(i, a)), n = a;
|
|
5154
5369
|
}
|
|
5155
5370
|
return t.values();
|
|
5156
5371
|
}
|
|
5157
|
-
function
|
|
5372
|
+
function Na(e) {
|
|
5158
5373
|
return e >= 48 && e <= 57 || e >= 65 && e <= 90 || e >= 97 && e <= 122 || e === 95;
|
|
5159
5374
|
}
|
|
5160
|
-
function
|
|
5161
|
-
let r = new
|
|
5375
|
+
function Pa(e, t, n) {
|
|
5376
|
+
let r = new Ga();
|
|
5162
5377
|
for (let i of t) for (let t of i ?? []) for (let i of [
|
|
5163
5378
|
...t.action.visible_if ?? [],
|
|
5164
5379
|
...t.action.enabled_if ?? [],
|
|
5165
5380
|
...t.action.conditions ?? []
|
|
5166
5381
|
]) {
|
|
5167
|
-
let t =
|
|
5168
|
-
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"));
|
|
5169
5384
|
}
|
|
5170
5385
|
return r.values();
|
|
5171
5386
|
}
|
|
5172
|
-
function
|
|
5173
|
-
let r = typeof t == "string" ?
|
|
5387
|
+
function Fa(e, t, n) {
|
|
5388
|
+
let r = typeof t == "string" ? Vi(t) : t ?? [], i = new Ga();
|
|
5174
5389
|
for (let t of r) {
|
|
5175
|
-
let r =
|
|
5176
|
-
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"));
|
|
5177
5392
|
}
|
|
5178
5393
|
return i.values();
|
|
5179
5394
|
}
|
|
5180
|
-
function
|
|
5181
|
-
let i =
|
|
5182
|
-
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");
|
|
5183
5398
|
return i;
|
|
5184
5399
|
}
|
|
5185
|
-
function
|
|
5400
|
+
function La(e, t, n) {
|
|
5186
5401
|
if (Array.isArray(e)) {
|
|
5187
5402
|
for (let r of e) if (!(!r || typeof r != "object")) {
|
|
5188
5403
|
if ("section" in r) {
|
|
5189
|
-
let e = r.section, i =
|
|
5190
|
-
i && t.has(i) &&
|
|
5404
|
+
let e = r.section, i = za(e?.name);
|
|
5405
|
+
i && t.has(i) && Ra(e?.items, n);
|
|
5191
5406
|
continue;
|
|
5192
5407
|
}
|
|
5193
|
-
"fields" in r &&
|
|
5408
|
+
"fields" in r && Ra([r], n);
|
|
5194
5409
|
}
|
|
5195
5410
|
}
|
|
5196
5411
|
}
|
|
5197
|
-
function
|
|
5412
|
+
function Ra(e, t) {
|
|
5198
5413
|
if (Array.isArray(e)) {
|
|
5199
5414
|
for (let n of e) if (!(!n || typeof n != "object")) {
|
|
5200
5415
|
if ("fields" in n) {
|
|
@@ -5207,11 +5422,11 @@ function _a(e, t) {
|
|
|
5207
5422
|
}
|
|
5208
5423
|
}
|
|
5209
5424
|
}
|
|
5210
|
-
"section" in n &&
|
|
5425
|
+
"section" in n && Ra(n.section?.items, t);
|
|
5211
5426
|
}
|
|
5212
5427
|
}
|
|
5213
5428
|
}
|
|
5214
|
-
function
|
|
5429
|
+
function za(e) {
|
|
5215
5430
|
if (typeof e == "string") return e;
|
|
5216
5431
|
if (e && typeof e == "object") {
|
|
5217
5432
|
let t = Object.values(e).find((e) => typeof e == "string");
|
|
@@ -5219,21 +5434,21 @@ function va(e) {
|
|
|
5219
5434
|
}
|
|
5220
5435
|
return "";
|
|
5221
5436
|
}
|
|
5222
|
-
function
|
|
5437
|
+
function Ba(e) {
|
|
5223
5438
|
let t = [];
|
|
5224
5439
|
for (let [n, r] of e.fields) {
|
|
5225
5440
|
if (r.primary || r.auto || r.ref || r.array || r.structure || r.display?.is_listable === !1) continue;
|
|
5226
5441
|
let e = (r.type || "").toLowerCase(), i = !!(r.enum || r.values);
|
|
5227
|
-
if (!(!
|
|
5442
|
+
if (!(!la.has(e) && !i) && (t.push(n), t.length >= 8)) break;
|
|
5228
5443
|
}
|
|
5229
5444
|
return t;
|
|
5230
5445
|
}
|
|
5231
|
-
function
|
|
5446
|
+
function Va(e, t, n, r) {
|
|
5232
5447
|
if (!t || t.startsWith("$")) return;
|
|
5233
|
-
let i =
|
|
5448
|
+
let i = Wa(e, t);
|
|
5234
5449
|
i.kind !== "missing" && (n.add(t), i.kind === "file" && r.addField(t, "file_metadata"));
|
|
5235
5450
|
}
|
|
5236
|
-
function
|
|
5451
|
+
function Ha(e, t, n, r) {
|
|
5237
5452
|
if (t.startsWith("$status.")) {
|
|
5238
5453
|
n.addExpand("statuses", "status_expand"), r !== "status_expand" && n.addExpand("statuses", r), r !== "status_expand" && n.addField(t, r);
|
|
5239
5454
|
return;
|
|
@@ -5244,17 +5459,22 @@ function xa(e, t, n, r) {
|
|
|
5244
5459
|
e?.properties?.[i]?.ref && (n.addExpand("refs", "ref_expand"), r !== "ref_expand" && n.addExpand("refs", r));
|
|
5245
5460
|
return;
|
|
5246
5461
|
}
|
|
5247
|
-
|
|
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);
|
|
5248
5467
|
i.kind === "field" && i.field.type === "ref" && (n.addExpand("refs", "ref_expand"), r !== "ref_expand" && n.addExpand("refs", r));
|
|
5249
5468
|
}
|
|
5250
|
-
function
|
|
5469
|
+
function Ua(e) {
|
|
5251
5470
|
let t = e.snapshot().expand, n = [];
|
|
5252
|
-
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;
|
|
5253
5472
|
}
|
|
5254
|
-
function
|
|
5473
|
+
function Wa(e, t) {
|
|
5255
5474
|
if (!e) return { kind: t.startsWith("$") ? "synthetic" : "missing" };
|
|
5256
5475
|
if (t.startsWith("$status.")) return e.status_groups?.[t.slice(8)] ? { kind: "synthetic" } : { kind: "missing" };
|
|
5257
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" };
|
|
5258
5478
|
let n = e.fields.get(t);
|
|
5259
5479
|
if (n) return {
|
|
5260
5480
|
kind: "field",
|
|
@@ -5266,7 +5486,7 @@ function Ca(e, t) {
|
|
|
5266
5486
|
file: r
|
|
5267
5487
|
} : { kind: "missing" };
|
|
5268
5488
|
}
|
|
5269
|
-
var
|
|
5489
|
+
var Ga = class {
|
|
5270
5490
|
#e = [];
|
|
5271
5491
|
#t = /* @__PURE__ */ new Set();
|
|
5272
5492
|
add(e) {
|
|
@@ -5278,7 +5498,7 @@ var wa = class {
|
|
|
5278
5498
|
values() {
|
|
5279
5499
|
return [...this.#e];
|
|
5280
5500
|
}
|
|
5281
|
-
},
|
|
5501
|
+
}, Ka = class {
|
|
5282
5502
|
#e = /* @__PURE__ */ new Map();
|
|
5283
5503
|
#t = /* @__PURE__ */ new Map();
|
|
5284
5504
|
addField(e, t) {
|
|
@@ -5301,7 +5521,7 @@ var wa = class {
|
|
|
5301
5521
|
}
|
|
5302
5522
|
r.includes(n) || r.push(n);
|
|
5303
5523
|
}
|
|
5304
|
-
},
|
|
5524
|
+
}, qa = class extends Oe {
|
|
5305
5525
|
constructor(e) {
|
|
5306
5526
|
super(e), this.state = {
|
|
5307
5527
|
hasError: !1,
|
|
@@ -5369,15 +5589,15 @@ var wa = class {
|
|
|
5369
5589
|
};
|
|
5370
5590
|
//#endregion
|
|
5371
5591
|
//#region src/hooks/useObject.ts
|
|
5372
|
-
function
|
|
5592
|
+
function Ja(e, t) {
|
|
5373
5593
|
return [
|
|
5374
5594
|
"entity-item",
|
|
5375
5595
|
e,
|
|
5376
5596
|
t === void 0 || t === "new" ? void 0 : typeof t == "string" ? t : Object.keys(t).sort().map((e) => [e, t[e]])
|
|
5377
5597
|
];
|
|
5378
5598
|
}
|
|
5379
|
-
function
|
|
5380
|
-
let n =
|
|
5599
|
+
function Ya(e, t) {
|
|
5600
|
+
let n = Ja(e, t), r = n[2];
|
|
5381
5601
|
return Le({
|
|
5382
5602
|
queryKey: n,
|
|
5383
5603
|
queryFn: () => C(e, t),
|
|
@@ -5386,15 +5606,15 @@ function Oa(e, t) {
|
|
|
5386
5606
|
}
|
|
5387
5607
|
//#endregion
|
|
5388
5608
|
//#region src/components/detail-layout/widgets/registry.ts
|
|
5389
|
-
var
|
|
5390
|
-
function
|
|
5391
|
-
|
|
5609
|
+
var Xa = /* @__PURE__ */ new Map();
|
|
5610
|
+
function Za(e, t) {
|
|
5611
|
+
Xa.set(e, t);
|
|
5392
5612
|
}
|
|
5393
|
-
function
|
|
5394
|
-
return
|
|
5613
|
+
function Qa(e) {
|
|
5614
|
+
return Xa.get(e);
|
|
5395
5615
|
}
|
|
5396
|
-
function
|
|
5397
|
-
return
|
|
5616
|
+
function $a(e) {
|
|
5617
|
+
return Xa.has(e);
|
|
5398
5618
|
}
|
|
5399
5619
|
//#endregion
|
|
5400
|
-
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 };
|