@declarion/react 0.45.0 → 0.47.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-BDnJK0AU.js → DraggableChildrenTable-B6KjWkwD.js} +2 -2
- package/dist-lib/{DynamicIcon-DeRpAaXm.js → DynamicIcon-Dc2j-rg_.js} +19 -17
- package/dist-lib/{Grid-CcCveEE7.js → Grid-OdquWJNX.js} +2 -2
- package/dist-lib/{LayoutRenderer-BReuhVdX.js → LayoutRenderer-CzAdhjNT.js} +525 -518
- package/dist-lib/{MarkdownRenderer-DPKDFR60.js → MarkdownRenderer-C6bhrAIe.js} +10 -10
- package/dist-lib/{RefreshControl-KddgOhUG.js → RefreshControl-F9Ib9asP.js} +18 -18
- package/dist-lib/{SmartDetailPage.impl-D_hMxiHy.js → SmartDetailPage.impl-DdSu3kmW.js} +305 -294
- package/dist-lib/{SmartRecordListPage.impl-GIo_mPIJ.js → SmartRecordListPage.impl-SkIp0_Rd.js} +165 -154
- package/dist-lib/api/agents.d.ts +39 -7
- package/dist-lib/components/agents/AgentChatPanel.d.ts +6 -1
- package/dist-lib/components/agents/transcript-runs.d.ts +29 -0
- package/dist-lib/components/file-widgets/host.d.ts +1 -0
- package/dist-lib/components/list/QuickPeek.d.ts +1 -1
- package/dist-lib/components/pages/list/ListFloatbar.d.ts +4 -2
- package/dist-lib/components/pages/list/cardProjection.d.ts +2 -1
- package/dist-lib/components/shared/RowActionsKebab.d.ts +3 -2
- package/dist-lib/components/views/ViewSwitcher.d.ts +2 -1
- package/dist-lib/hooks/useAgentConversation.d.ts +7 -19
- package/dist-lib/hooks/useFilters.d.ts +1 -0
- package/dist-lib/icons.js +1 -1
- package/dist-lib/index.d.ts +8 -1
- package/dist-lib/index.js +3031 -2674
- package/dist-lib/lib/actions.d.ts +1 -1
- package/dist-lib/lib/filter-evaluator.d.ts +16 -0
- package/dist-lib/lib/filters.d.ts +10 -4
- package/dist-lib/lib/messages.d.ts +1 -0
- package/dist-lib/lib/variants.d.ts +7 -0
- package/dist-lib/{registry-DJKp0yaV.js → registry-C2VD-5MD.js} +571 -347
- package/dist-lib/testing.js +1 -1
- package/dist-lib/types/schema.d.ts +26 -0
- package/dist-lib/{useCurrentScreen-A3xZDs7U.js → useCurrentScreen-ow4r-nWa.js} +721 -693
- package/dist-lib/{useProperties-TlltWwLv.js → useProperties-lEKfzm2X.js} +92 -61
- package/dist-lib/{value-CHY7LgZ-.js → value-CXohNH6a.js} +1 -1
- package/dist-lib/vite/index.js +23 -22
- package/package.json +12 -12
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { s as e, t } from "./DynamicIcon-
|
|
2
|
-
import { A as n, At as r, B as i, C as a, Dn as o, E as s, Gt as c, I as l, K as u, Kn as d, L as f, Ln as p, Nn as m, O as h, P as g, Qn as _, R as v, Rn as y, Sn as b, St as x, T as S, Tn as C, Tt as w, U as T, V as E, W as D, X as O, Yn as k, Zn as A, _ as j, _t as M, b as N, bn as P, bt as F, cr as I, d as L, g as ee, gt as R, i as te, j as z, jn as ne, kt as re, lr as B, mn as ie, or as V, ot as ae, pt as oe, rr as se, rt as H, st as ce, u as le, ur as U, v as ue, vt as de, wn as fe, wt as pe, xn as me, yt as he, z as ge } from "./useCurrentScreen-
|
|
3
|
-
import { a as _e, c as ve, d as ye, f as be, i as xe, l as Se, n as Ce, o as we, p as Te, r as Ee, s as De, t as Oe, u as ke } from "./value-
|
|
1
|
+
import { s as e, t } from "./DynamicIcon-Dc2j-rg_.js";
|
|
2
|
+
import { A as n, At as r, B as i, C as a, Dn as o, E as s, Gt as c, I as l, K as u, Kn as d, L as f, Ln as p, Nn as m, O as h, P as g, Qn as _, R as v, Rn as y, Sn as b, St as x, T as S, Tn as C, Tt as w, U as T, V as E, W as D, X as O, Yn as k, Zn as A, _ as j, _t as M, b as N, bn as P, bt as F, cr as I, d as L, g as ee, gt as R, i as te, j as z, jn as ne, kt as re, lr as B, mn as ie, or as V, ot as ae, pt as oe, rr as se, rt as H, st as ce, u as le, ur as U, v as ue, vt as de, wn as fe, wt as pe, xn as me, yt as he, z as ge } from "./useCurrentScreen-ow4r-nWa.js";
|
|
3
|
+
import { a as _e, c as ve, d as ye, f as be, i as xe, l as Se, n as Ce, o as we, p as Te, r as Ee, s as De, t as Oe, u as ke } from "./value-CXohNH6a.js";
|
|
4
4
|
import { n as Ae, r as je, t as Me } from "./dataTableStyles-vwD1mVOP.js";
|
|
5
5
|
import { Component as Ne, Suspense as Pe, lazy as Fe, useCallback as W, useEffect as G, useId as Ie, useLayoutEffect as Le, useMemo as K, useRef as q, useState as J } from "react";
|
|
6
6
|
import { parsePath as Re, useNavigate as ze } from "react-router";
|
|
@@ -1029,7 +1029,7 @@ function sn(e) {
|
|
|
1029
1029
|
}
|
|
1030
1030
|
//#endregion
|
|
1031
1031
|
//#region src/components/file-widgets/GridLazy.tsx
|
|
1032
|
-
var cn = Fe(() => import("./Grid-
|
|
1032
|
+
var cn = Fe(() => import("./Grid-OdquWJNX.js").then((e) => ({ default: e.Grid })));
|
|
1033
1033
|
function ln() {
|
|
1034
1034
|
return /* @__PURE__ */ X("div", { className: "h-24 w-full rounded-md bg-muted animate-pulse" });
|
|
1035
1035
|
}
|
|
@@ -1042,9 +1042,10 @@ function un(e) {
|
|
|
1042
1042
|
//#endregion
|
|
1043
1043
|
//#region src/components/file-widgets/DocumentCard.tsx
|
|
1044
1044
|
function dn({ contentType: e }) {
|
|
1045
|
+
let t = e ? e.includes("pdf") ? "PDF" : e.includes("word") ? "DOC" : e.includes("sheet") || e.includes("excel") ? "XLS" : e.startsWith("image/") ? "IMG" : e.split("/")[1]?.slice(0, 4).toUpperCase() ?? "FILE" : "FILE";
|
|
1045
1046
|
return /* @__PURE__ */ X("div", {
|
|
1046
1047
|
className: "flex h-16 w-16 flex-none items-center justify-center rounded-md border border-border bg-surface-3 text-xs font-medium text-muted-foreground",
|
|
1047
|
-
children:
|
|
1048
|
+
children: t
|
|
1048
1049
|
});
|
|
1049
1050
|
}
|
|
1050
1051
|
function fn(e) {
|
|
@@ -1636,11 +1637,11 @@ function Dn(e, t, n) {
|
|
|
1636
1637
|
return i ? b(i, t, n) : t;
|
|
1637
1638
|
}
|
|
1638
1639
|
function On(e) {
|
|
1639
|
-
let { entity: t, entityCode: n, fieldName: r, record: i, mode: a, onChange: o, refs: s, disabled: c, surface: l, entities: u, screens: d, locale: f, fieldId: p, labelId: m } = e,
|
|
1640
|
-
if (
|
|
1641
|
-
let e =
|
|
1640
|
+
let { entity: t, entityCode: n, fieldName: r, record: i, mode: a, onChange: o, refs: s, disabled: c, surface: l, entities: u, screens: d, locale: f, fieldId: p, labelId: m, structure: h } = e, g = Cn(t, r);
|
|
1641
|
+
if (g) {
|
|
1642
|
+
let e = g.display?.widget ?? "", t = Ut(e);
|
|
1642
1643
|
return t ? /* @__PURE__ */ X(t, {
|
|
1643
|
-
field:
|
|
1644
|
+
field: g,
|
|
1644
1645
|
fieldName: r,
|
|
1645
1646
|
entityCode: n,
|
|
1646
1647
|
value: wn(i, r),
|
|
@@ -1653,9 +1654,12 @@ function On(e) {
|
|
|
1653
1654
|
children: e ? `Unknown file widget: ${e}` : "Missing file widget"
|
|
1654
1655
|
});
|
|
1655
1656
|
}
|
|
1656
|
-
let
|
|
1657
|
-
|
|
1658
|
-
|
|
1657
|
+
let _ = t.fields.get(r), v = h && a === "display" && _ ? {
|
|
1658
|
+
..._,
|
|
1659
|
+
structure: h
|
|
1660
|
+
} : _;
|
|
1661
|
+
return v ? z({
|
|
1662
|
+
field: v,
|
|
1659
1663
|
entityCode: n,
|
|
1660
1664
|
fieldName: r,
|
|
1661
1665
|
value: Tn(t, i, r),
|
|
@@ -1972,6 +1976,7 @@ function ir(e, t, n) {
|
|
|
1972
1976
|
//#endregion
|
|
1973
1977
|
//#region src/hooks/useAssociatedData.ts
|
|
1974
1978
|
function ar(e, t, n, r, i, a, o, s) {
|
|
1979
|
+
let l = s ? JSON.stringify(Object.entries(s).sort()) : void 0;
|
|
1975
1980
|
return Be({
|
|
1976
1981
|
queryKey: [
|
|
1977
1982
|
tr,
|
|
@@ -1981,7 +1986,7 @@ function ar(e, t, n, r, i, a, o, s) {
|
|
|
1981
1986
|
i,
|
|
1982
1987
|
a,
|
|
1983
1988
|
o,
|
|
1984
|
-
|
|
1989
|
+
l
|
|
1985
1990
|
],
|
|
1986
1991
|
queryFn: ({ pageParam: e }) => {
|
|
1987
1992
|
let l = new URLSearchParams(), u = [{
|
|
@@ -2008,21 +2013,21 @@ function or({ actionCode: n, action: i, entityCode: o, objectIds: s = [], row: c
|
|
|
2008
2013
|
if (!(!i.association || s.length === 0)) {
|
|
2009
2014
|
p(!0);
|
|
2010
2015
|
try {
|
|
2011
|
-
let e =
|
|
2012
|
-
if (!
|
|
2013
|
-
H.error(`No list screen found for ${
|
|
2016
|
+
let e = o ? `${o}.${i.association}` : i.association, t = await pe(e, s), n = a(_, t.target_entity);
|
|
2017
|
+
if (!n) {
|
|
2018
|
+
H.error(`No list screen found for ${t.target_entity}`);
|
|
2014
2019
|
return;
|
|
2015
2020
|
}
|
|
2016
|
-
let
|
|
2017
|
-
if (
|
|
2018
|
-
H.info(`No related ${
|
|
2021
|
+
let r = _?.entities[t.target_entity], c = C(i.display?.name) || t.target_entity;
|
|
2022
|
+
if (t.ids.length === 0) {
|
|
2023
|
+
H.info(`No related ${c} found`);
|
|
2019
2024
|
return;
|
|
2020
2025
|
}
|
|
2021
|
-
let
|
|
2022
|
-
|
|
2023
|
-
title:
|
|
2024
|
-
icon: i.display?.icon ||
|
|
2025
|
-
search:
|
|
2026
|
+
let l = r?.fields.names().find((e) => r.fields.get(e)?.primary) ?? "id", u = new URLSearchParams();
|
|
2027
|
+
u.set(`filter_${l}`, t.ids.join(",")), v(n.route, {
|
|
2028
|
+
title: c,
|
|
2029
|
+
icon: i.display?.icon || n.icon,
|
|
2030
|
+
search: u.toString()
|
|
2026
2031
|
}), d?.();
|
|
2027
2032
|
} catch (e) {
|
|
2028
2033
|
H.error(e instanceof Error ? e.message : "Failed to resolve association");
|
|
@@ -2065,8 +2070,8 @@ function or({ actionCode: n, action: i, entityCode: o, objectIds: s = [], row: c
|
|
|
2065
2070
|
return;
|
|
2066
2071
|
}
|
|
2067
2072
|
if (i.href && !i.handler && !i.association) {
|
|
2068
|
-
let e =
|
|
2069
|
-
o && (
|
|
2073
|
+
let e = o ? _?.entities[o] : void 0, t = h(c, e), r = i.href;
|
|
2074
|
+
o && (r = r.replaceAll("${entity}", o)), t && (r = r.replaceAll("${id}", encodeURIComponent(t))), v(r, {
|
|
2070
2075
|
title: C(i.display?.name) || n,
|
|
2071
2076
|
icon: i.display?.icon
|
|
2072
2077
|
}), d?.();
|
|
@@ -2181,7 +2186,8 @@ function pr(e, t, n) {
|
|
|
2181
2186
|
if (n && e in n) return n[e];
|
|
2182
2187
|
}
|
|
2183
2188
|
function mr(e, t, n) {
|
|
2184
|
-
|
|
2189
|
+
let r = pr(e, t, n);
|
|
2190
|
+
return C(r?.display?.name) || e;
|
|
2185
2191
|
}
|
|
2186
2192
|
function hr(e, t, n) {
|
|
2187
2193
|
return pr(e, t, n)?.display?.icon || void 0;
|
|
@@ -2624,7 +2630,8 @@ function kr({ layout: n, entityActions: r, globalActions: i, onRun: a, reservedR
|
|
|
2624
2630
|
tabIndex: -1,
|
|
2625
2631
|
children: o
|
|
2626
2632
|
}, a);
|
|
2627
|
-
}
|
|
2633
|
+
}
|
|
2634
|
+
{
|
|
2628
2635
|
let t = n.name ? C(n.name) : "Actions";
|
|
2629
2636
|
return /* @__PURE__ */ X(U, {
|
|
2630
2637
|
"data-node-key": a,
|
|
@@ -2787,71 +2794,230 @@ function jr({ layout: e, row: t, rowSelection: n, onRun: r, reservedRightWidth:
|
|
|
2787
2794
|
});
|
|
2788
2795
|
}
|
|
2789
2796
|
//#endregion
|
|
2797
|
+
//#region src/lib/filter-evaluator.ts
|
|
2798
|
+
var Mr = /* @__PURE__ */ new Set([
|
|
2799
|
+
"string",
|
|
2800
|
+
"text",
|
|
2801
|
+
"rich_text",
|
|
2802
|
+
"email",
|
|
2803
|
+
"url",
|
|
2804
|
+
"phone"
|
|
2805
|
+
]), Nr = /* @__PURE__ */ new Set([
|
|
2806
|
+
"int",
|
|
2807
|
+
"float",
|
|
2808
|
+
"decimal"
|
|
2809
|
+
]), Pr = /* @__PURE__ */ new Set([
|
|
2810
|
+
"date",
|
|
2811
|
+
"timestamp",
|
|
2812
|
+
"time"
|
|
2813
|
+
]), Fr = /^(?:eq|not_eq|contains|starts_with|is_empty|is_not_empty)$/, Ir = /^(?:eq|not_eq|in|not_in|is_empty|is_not_empty)$/, Lr = /^(?:eq|not_eq|gt|gte|lt|lte|between|is_empty|is_not_empty)$/, Rr = {
|
|
2814
|
+
string: Fr,
|
|
2815
|
+
text: Fr,
|
|
2816
|
+
rich_text: Fr,
|
|
2817
|
+
email: Fr,
|
|
2818
|
+
url: Fr,
|
|
2819
|
+
phone: Fr,
|
|
2820
|
+
enum: Ir,
|
|
2821
|
+
int: Lr,
|
|
2822
|
+
float: Lr,
|
|
2823
|
+
decimal: Lr,
|
|
2824
|
+
date: Lr,
|
|
2825
|
+
timestamp: Lr,
|
|
2826
|
+
time: Lr,
|
|
2827
|
+
bool: /^(?:eq|is_empty)$/,
|
|
2828
|
+
ref: /^(?:eq|not_eq|is_empty|is_not_empty)$/,
|
|
2829
|
+
uuid: /^(?:eq|not_eq|is_empty|is_not_empty)$/
|
|
2830
|
+
};
|
|
2831
|
+
function zr(e, t, n) {
|
|
2832
|
+
return e.every((e) => Br(e, t, n));
|
|
2833
|
+
}
|
|
2834
|
+
function Br(e, t, n) {
|
|
2835
|
+
if (e.and) return e.and.every((e) => Br(e, t, n));
|
|
2836
|
+
if (e.or) return e.or.some((e) => Br(e, t, n));
|
|
2837
|
+
if (!e.field || !e.op) return !1;
|
|
2838
|
+
let r = t[e.field];
|
|
2839
|
+
return !r || !Rr[r.type]?.test(e.op) ? !1 : Vr(e, r.type, n[e.field]);
|
|
2840
|
+
}
|
|
2841
|
+
function Vr(e, t, n) {
|
|
2842
|
+
let r = Hr(n);
|
|
2843
|
+
if (e.op === "is_empty") return r;
|
|
2844
|
+
if (e.op === "is_not_empty") return !r;
|
|
2845
|
+
if (r) return !1;
|
|
2846
|
+
let i = e.value;
|
|
2847
|
+
switch (e.op) {
|
|
2848
|
+
case "eq": return Ur(t, n, i);
|
|
2849
|
+
case "not_eq": return !Ur(t, n, i) && Wr(t, n, i);
|
|
2850
|
+
case "in": return Array.isArray(i) && i.some((e) => Ur(t, n, e));
|
|
2851
|
+
case "not_in": return Array.isArray(i) && i.every((e) => Wr(t, n, e) && !Ur(t, n, e));
|
|
2852
|
+
case "contains": return typeof n == "string" && typeof i == "string" && n.toLowerCase().includes(i.toLowerCase());
|
|
2853
|
+
case "starts_with": return typeof n == "string" && typeof i == "string" && n.toLowerCase().startsWith(i.toLowerCase());
|
|
2854
|
+
case "gt": return Gr(t, n, i, (e, t) => e > t);
|
|
2855
|
+
case "gte": return Gr(t, n, i, (e, t) => e >= t);
|
|
2856
|
+
case "lt": return Gr(t, n, i, (e, t) => e < t);
|
|
2857
|
+
case "lte": return Gr(t, n, i, (e, t) => e <= t);
|
|
2858
|
+
case "between": {
|
|
2859
|
+
if (!Array.isArray(i) || i.length !== 2) return !1;
|
|
2860
|
+
let e = Kr(t, n, i[0]), r = Kr(t, n, i[1]);
|
|
2861
|
+
return e === void 0 || r === void 0 ? !1 : e >= 0 && r <= 0;
|
|
2862
|
+
}
|
|
2863
|
+
default: return !1;
|
|
2864
|
+
}
|
|
2865
|
+
}
|
|
2866
|
+
function Hr(e) {
|
|
2867
|
+
return e == null || e === "" || Array.isArray(e) && e.length === 0;
|
|
2868
|
+
}
|
|
2869
|
+
function Ur(e, t, n) {
|
|
2870
|
+
return Wr(e, t, n) ? Pr.has(e) ? Kr(e, t, n) === 0 : t === n : !1;
|
|
2871
|
+
}
|
|
2872
|
+
function Wr(e, t, n) {
|
|
2873
|
+
return Kr(e, t, n) !== void 0;
|
|
2874
|
+
}
|
|
2875
|
+
function Gr(e, t, n, r) {
|
|
2876
|
+
let i = Kr(e, t, n);
|
|
2877
|
+
return i !== void 0 && r(i, 0);
|
|
2878
|
+
}
|
|
2879
|
+
function Kr(e, t, n) {
|
|
2880
|
+
if (Nr.has(e)) return typeof t != "number" || typeof n != "number" || !Number.isFinite(t) || !Number.isFinite(n) ? void 0 : t === n ? 0 : t < n ? -1 : 1;
|
|
2881
|
+
if (Pr.has(e)) return typeof t != "string" || typeof n != "string" || !qr(e, t) || !qr(e, n) ? void 0 : t === n ? 0 : t < n ? -1 : 1;
|
|
2882
|
+
if (Mr.has(e) || e === "enum" || e === "ref" || e === "uuid") return typeof t != "string" || typeof n != "string" ? void 0 : t === n ? 0 : t < n ? -1 : 1;
|
|
2883
|
+
if (e === "bool") return typeof t != "boolean" || typeof n != "boolean" ? void 0 : t === n ? 0 : t ? 1 : -1;
|
|
2884
|
+
}
|
|
2885
|
+
function qr(e, t) {
|
|
2886
|
+
switch (e) {
|
|
2887
|
+
case "date": return /^\d{4}-\d{2}-\d{2}$/.test(t);
|
|
2888
|
+
case "time": return /^\d{2}:\d{2}:\d{2}(?:\.\d+)?$/.test(t);
|
|
2889
|
+
case "timestamp": return /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/.test(t);
|
|
2890
|
+
default: return !1;
|
|
2891
|
+
}
|
|
2892
|
+
}
|
|
2893
|
+
//#endregion
|
|
2894
|
+
//#region src/lib/variants.ts
|
|
2895
|
+
function Jr(e, t) {
|
|
2896
|
+
let n = e.variants;
|
|
2897
|
+
if (!n || n.length === 0) return;
|
|
2898
|
+
let r = {};
|
|
2899
|
+
for (let [t, n] of e.fields) r[t] = n;
|
|
2900
|
+
for (let [e, i] of n) if (e !== "default" && i.when && zr(i.when, r, t)) return e;
|
|
2901
|
+
return n.has("default") ? "default" : void 0;
|
|
2902
|
+
}
|
|
2903
|
+
function Yr(e, t) {
|
|
2904
|
+
let n = e?.variants;
|
|
2905
|
+
if (!n || !n.items().some((e) => e.actions !== void 0)) return;
|
|
2906
|
+
let r = Jr(e, t), i = n.get("default"), a = (r ? n.get(r)?.actions : void 0) ?? i?.actions ?? [];
|
|
2907
|
+
return new Set(a);
|
|
2908
|
+
}
|
|
2909
|
+
function Xr(e, t) {
|
|
2910
|
+
if (t.length === 0) return;
|
|
2911
|
+
let n = t.map((t) => Yr(e, t));
|
|
2912
|
+
if (n.every((e) => e === void 0)) return;
|
|
2913
|
+
let r = n[0] ?? /* @__PURE__ */ new Set(), i = new Set(r);
|
|
2914
|
+
for (let e of n.slice(1)) {
|
|
2915
|
+
if (!e) {
|
|
2916
|
+
i.clear();
|
|
2917
|
+
break;
|
|
2918
|
+
}
|
|
2919
|
+
for (let t of i) e.has(t) || i.delete(t);
|
|
2920
|
+
}
|
|
2921
|
+
return i;
|
|
2922
|
+
}
|
|
2923
|
+
function Zr(e, t, n) {
|
|
2924
|
+
if (!t.variants || t.variants.length === 0) return;
|
|
2925
|
+
if (e.variants) {
|
|
2926
|
+
let r = Jr(e, n) ?? "default";
|
|
2927
|
+
return t.variants.has(r) ? r : "default";
|
|
2928
|
+
}
|
|
2929
|
+
let r = {};
|
|
2930
|
+
for (let [t, n] of e.fields) r[t] = n;
|
|
2931
|
+
for (let [e, i] of t.variants) if (e !== "default" && i.when && zr(i.when, r, n)) return e;
|
|
2932
|
+
return "default";
|
|
2933
|
+
}
|
|
2934
|
+
var Qr = [
|
|
2935
|
+
"items",
|
|
2936
|
+
"sidebar",
|
|
2937
|
+
"sidebar_width",
|
|
2938
|
+
"highlights",
|
|
2939
|
+
"audit",
|
|
2940
|
+
"actions",
|
|
2941
|
+
"row_actions",
|
|
2942
|
+
"action_layout",
|
|
2943
|
+
"card",
|
|
2944
|
+
"quick_peek"
|
|
2945
|
+
];
|
|
2946
|
+
function $r(e, t, n) {
|
|
2947
|
+
if (!e || !t?.variants) return t;
|
|
2948
|
+
let r = Zr(e, t, n), i = r ? t.variants.get(r) : void 0;
|
|
2949
|
+
if (!i) return t;
|
|
2950
|
+
let a = { ...t };
|
|
2951
|
+
for (let e of Qr) i[e] !== void 0 && (a[e] = i[e]);
|
|
2952
|
+
return a;
|
|
2953
|
+
}
|
|
2954
|
+
//#endregion
|
|
2790
2955
|
//#region src/components/shared/RowActionsKebab.tsx
|
|
2791
|
-
function
|
|
2792
|
-
let
|
|
2956
|
+
function ei({ actions: t, objectIds: n, row: r, entity: i, onSuccess: a, preMenu: o, divider: s, size: c = 22, align: l = "end" }) {
|
|
2957
|
+
let u = q(null), [d, f] = J(!1), [p, m] = J(null), { run: h } = te(), g = K(() => {
|
|
2793
2958
|
let e = {};
|
|
2794
2959
|
for (let { code: n, action: r } of t) e[n] = r;
|
|
2795
2960
|
return e;
|
|
2796
|
-
}, [t]),
|
|
2961
|
+
}, [t]), v = K(() => {
|
|
2797
2962
|
let e = t.map(({ code: e }) => ({
|
|
2798
2963
|
kind: "action",
|
|
2799
2964
|
code: e,
|
|
2800
2965
|
enabled: !0,
|
|
2801
2966
|
reason: null
|
|
2802
2967
|
}));
|
|
2803
|
-
return r ? j(e,
|
|
2968
|
+
return r ? j(e, g, void 0, r, [], Yr(i, r)) : e;
|
|
2804
2969
|
}, [
|
|
2805
2970
|
t,
|
|
2806
|
-
|
|
2807
|
-
r
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2971
|
+
g,
|
|
2972
|
+
r,
|
|
2973
|
+
i
|
|
2974
|
+
]), y = W((e, t) => {
|
|
2975
|
+
f(!1);
|
|
2976
|
+
let i = t.entity ? `${t.entity}.${e}` : e;
|
|
2977
|
+
return h({
|
|
2812
2978
|
action: t,
|
|
2813
2979
|
title: C(t.display?.name) || e,
|
|
2814
2980
|
row: r,
|
|
2815
2981
|
execute: async (e) => {
|
|
2816
|
-
let t = await F(
|
|
2817
|
-
return
|
|
2982
|
+
let t = await F(i, R(e, n));
|
|
2983
|
+
return a?.(), t;
|
|
2818
2984
|
}
|
|
2819
2985
|
});
|
|
2820
2986
|
}, [
|
|
2821
|
-
|
|
2987
|
+
h,
|
|
2822
2988
|
r,
|
|
2823
2989
|
n,
|
|
2824
|
-
|
|
2990
|
+
a
|
|
2825
2991
|
]);
|
|
2826
|
-
return !
|
|
2992
|
+
return !o && v.length === 0 ? null : /* @__PURE__ */ Z("div", {
|
|
2827
2993
|
className: "sl-row-actions",
|
|
2828
|
-
"data-open":
|
|
2994
|
+
"data-open": d ? "true" : void 0,
|
|
2829
2995
|
style: {
|
|
2830
2996
|
display: "flex",
|
|
2831
2997
|
alignItems: "center",
|
|
2832
2998
|
justifyContent: "flex-end"
|
|
2833
2999
|
},
|
|
2834
3000
|
children: [/* @__PURE__ */ X(B, {
|
|
2835
|
-
ref:
|
|
2836
|
-
size:
|
|
2837
|
-
icon: /* @__PURE__ */ X(e.more, { size: Math.round(
|
|
2838
|
-
onClick: () =>
|
|
3001
|
+
ref: u,
|
|
3002
|
+
size: c,
|
|
3003
|
+
icon: /* @__PURE__ */ X(e.more, { size: Math.round(c * .55) }),
|
|
3004
|
+
onClick: () => f((e) => !e),
|
|
2839
3005
|
title: "Actions"
|
|
2840
3006
|
}), /* @__PURE__ */ Z(V, {
|
|
2841
|
-
open:
|
|
2842
|
-
anchor:
|
|
2843
|
-
onClose: () =>
|
|
3007
|
+
open: d,
|
|
3008
|
+
anchor: u.current,
|
|
3009
|
+
onClose: () => f(!1),
|
|
2844
3010
|
width: 200,
|
|
2845
|
-
align:
|
|
3011
|
+
align: l,
|
|
2846
3012
|
children: [
|
|
2847
|
-
|
|
2848
|
-
|
|
3013
|
+
o,
|
|
3014
|
+
o && s && v.length > 0 && /* @__PURE__ */ X(_, { divider: !0 }),
|
|
2849
3015
|
/* @__PURE__ */ X(Cr, {
|
|
2850
|
-
layout:
|
|
2851
|
-
entityActions:
|
|
2852
|
-
onRun:
|
|
2853
|
-
loading:
|
|
2854
|
-
onLoadingChange:
|
|
3016
|
+
layout: v,
|
|
3017
|
+
entityActions: g,
|
|
3018
|
+
onRun: y,
|
|
3019
|
+
loading: p,
|
|
3020
|
+
onLoadingChange: m,
|
|
2855
3021
|
row: r
|
|
2856
3022
|
})
|
|
2857
3023
|
]
|
|
@@ -2860,7 +3026,7 @@ function Mr({ actions: t, objectIds: n, row: r, onSuccess: i, preMenu: a, divide
|
|
|
2860
3026
|
}
|
|
2861
3027
|
//#endregion
|
|
2862
3028
|
//#region src/components/detail-layout/AssociatedToolbar.tsx
|
|
2863
|
-
function
|
|
3029
|
+
function ti({ entity: t, searchable: n, filterFields: r, searchValue: i, onSearchChange: a, filters: o, onFilterChange: s, allEntities: c }) {
|
|
2864
3030
|
let l = n === !0, u = r && r.length > 0;
|
|
2865
3031
|
return !l && !u ? null : /* @__PURE__ */ Z("div", {
|
|
2866
3032
|
style: {
|
|
@@ -2884,30 +3050,33 @@ function Nr({ entity: t, searchable: n, filterFields: r, searchValue: i, onSearc
|
|
|
2884
3050
|
let n = t.fields.get(e);
|
|
2885
3051
|
if (!n) return null;
|
|
2886
3052
|
let r = o[e] ?? "__all__", i = b(n, e, c);
|
|
2887
|
-
|
|
3053
|
+
if (n.type === "ref" && n.ref?.entity) return /* @__PURE__ */ X(ni, {
|
|
2888
3054
|
field: n,
|
|
2889
3055
|
label: i,
|
|
2890
3056
|
value: r,
|
|
2891
3057
|
onChange: (t) => s(e, t)
|
|
2892
|
-
}, e)
|
|
3058
|
+
}, e);
|
|
3059
|
+
if (!n.values) return null;
|
|
3060
|
+
let a = [{
|
|
3061
|
+
value: "__all__",
|
|
3062
|
+
label: `All ${i}`
|
|
3063
|
+
}, ...n.values.map((e) => ({
|
|
3064
|
+
value: e.code,
|
|
3065
|
+
label: C(e.name) || e.code
|
|
3066
|
+
}))];
|
|
3067
|
+
return /* @__PURE__ */ X("div", {
|
|
2893
3068
|
style: { width: 160 },
|
|
2894
3069
|
children: /* @__PURE__ */ X(d, {
|
|
2895
3070
|
value: r,
|
|
2896
|
-
options:
|
|
2897
|
-
value: "__all__",
|
|
2898
|
-
label: `All ${i}`
|
|
2899
|
-
}, ...n.values.map((e) => ({
|
|
2900
|
-
value: e.code,
|
|
2901
|
-
label: C(e.name) || e.code
|
|
2902
|
-
}))],
|
|
3071
|
+
options: a,
|
|
2903
3072
|
onChange: (t) => s(e, t),
|
|
2904
3073
|
placeholder: i
|
|
2905
3074
|
})
|
|
2906
|
-
}, e)
|
|
3075
|
+
}, e);
|
|
2907
3076
|
})]
|
|
2908
3077
|
});
|
|
2909
3078
|
}
|
|
2910
|
-
function
|
|
3079
|
+
function ni({ field: e, label: t, value: n, onChange: r }) {
|
|
2911
3080
|
let i = u(e.ref?.entity), a = e.display?.ref_display_field ?? i?.display?.display_field, o = K(() => i ? [...i.fields].find(([, e]) => e.primary)?.[0] ?? "id" : "id", [i]), { data: s } = O(e.ref?.entity, {
|
|
2912
3081
|
per_page: 200,
|
|
2913
3082
|
sort: a ? `${a}:asc` : void 0
|
|
@@ -2918,21 +3087,21 @@ function Pr({ field: e, label: t, value: n, onChange: r }) {
|
|
|
2918
3087
|
return t == null ? "—" : p(t);
|
|
2919
3088
|
}
|
|
2920
3089
|
return p(e);
|
|
2921
|
-
}
|
|
3090
|
+
}, f = [{
|
|
3091
|
+
value: "__all__",
|
|
3092
|
+
label: `All ${t}`
|
|
3093
|
+
}, ...c.map((e) => {
|
|
3094
|
+
let t = String(e[o]), n = e[ie];
|
|
3095
|
+
return {
|
|
3096
|
+
value: t,
|
|
3097
|
+
label: typeof n == "string" && n !== "" ? n : a ? l(e[a] ?? t) : t
|
|
3098
|
+
};
|
|
3099
|
+
})];
|
|
2922
3100
|
return /* @__PURE__ */ X("div", {
|
|
2923
3101
|
style: { width: 160 },
|
|
2924
3102
|
children: /* @__PURE__ */ X(d, {
|
|
2925
3103
|
value: n,
|
|
2926
|
-
options:
|
|
2927
|
-
value: "__all__",
|
|
2928
|
-
label: `All ${t}`
|
|
2929
|
-
}, ...c.map((e) => {
|
|
2930
|
-
let t = String(e[o]), n = e[ie];
|
|
2931
|
-
return {
|
|
2932
|
-
value: t,
|
|
2933
|
-
label: typeof n == "string" && n !== "" ? n : a ? l(e[a] ?? t) : t
|
|
2934
|
-
};
|
|
2935
|
-
})],
|
|
3104
|
+
options: f,
|
|
2936
3105
|
onChange: r,
|
|
2937
3106
|
placeholder: t
|
|
2938
3107
|
})
|
|
@@ -2940,12 +3109,12 @@ function Pr({ field: e, label: t, value: n, onChange: r }) {
|
|
|
2940
3109
|
}
|
|
2941
3110
|
//#endregion
|
|
2942
3111
|
//#region src/lib/action-dispatch.ts
|
|
2943
|
-
function
|
|
3112
|
+
function ri(e, t, n, r) {
|
|
2944
3113
|
return L(t) ? (le(t.ui_steps, n), null) : t.entity ? `${t.entity}.${e}` : r ? `${r}.${e}` : e;
|
|
2945
3114
|
}
|
|
2946
3115
|
//#endregion
|
|
2947
3116
|
//#region src/components/detail-layout/AssociatedBlock.tsx
|
|
2948
|
-
function
|
|
3117
|
+
function ii(e) {
|
|
2949
3118
|
if (!e) return [];
|
|
2950
3119
|
let t = [];
|
|
2951
3120
|
for (let [n, r] of Object.entries(e)) (r.visibility ?? []).includes("list_row") && (r.association || s(n) || t.push({
|
|
@@ -2954,7 +3123,7 @@ function Ir(e) {
|
|
|
2954
3123
|
}));
|
|
2955
3124
|
return t;
|
|
2956
3125
|
}
|
|
2957
|
-
function
|
|
3126
|
+
function ai(e, t, n) {
|
|
2958
3127
|
if (!e) return [];
|
|
2959
3128
|
let r = [];
|
|
2960
3129
|
for (let [i, a] of Object.entries(e)) {
|
|
@@ -2980,7 +3149,7 @@ function Lr(e, t, n) {
|
|
|
2980
3149
|
}
|
|
2981
3150
|
return r;
|
|
2982
3151
|
}
|
|
2983
|
-
function
|
|
3152
|
+
function oi(e, t, n) {
|
|
2984
3153
|
let r = e[n];
|
|
2985
3154
|
if (!r) return null;
|
|
2986
3155
|
let i = e[t], a = i?.children?.find((e) => e.entity === n);
|
|
@@ -3002,7 +3171,7 @@ function Rr(e, t, n) {
|
|
|
3002
3171
|
}
|
|
3003
3172
|
return null;
|
|
3004
3173
|
}
|
|
3005
|
-
function
|
|
3174
|
+
function si(e, t, n) {
|
|
3006
3175
|
let r = new Set(fe(e));
|
|
3007
3176
|
return new Set(t.filter((t) => {
|
|
3008
3177
|
if (t === n || r.has(t)) return !1;
|
|
@@ -3010,14 +3179,14 @@ function zr(e, t, n) {
|
|
|
3010
3179
|
return !(!i || i.auto || i.primary || i.source);
|
|
3011
3180
|
}));
|
|
3012
3181
|
}
|
|
3013
|
-
function
|
|
3182
|
+
function ci(e, t, n) {
|
|
3014
3183
|
return new Set(t.filter((t) => {
|
|
3015
3184
|
if (t === n) return !1;
|
|
3016
3185
|
let r = e.fields.get(t);
|
|
3017
3186
|
return !(!r || r.auto);
|
|
3018
3187
|
}));
|
|
3019
3188
|
}
|
|
3020
|
-
function
|
|
3189
|
+
function li(e, t, n, r) {
|
|
3021
3190
|
let i = [];
|
|
3022
3191
|
for (let a of t) {
|
|
3023
3192
|
let t = n.fields.get(a);
|
|
@@ -3027,7 +3196,7 @@ function Vr(e, t, n, r) {
|
|
|
3027
3196
|
}
|
|
3028
3197
|
return i;
|
|
3029
3198
|
}
|
|
3030
|
-
function
|
|
3199
|
+
function ui({ node: e, ctx: t }) {
|
|
3031
3200
|
let n = e.associated;
|
|
3032
3201
|
if (!n || t.isNew) return null;
|
|
3033
3202
|
let r = t.schema.entities[n];
|
|
@@ -3039,8 +3208,8 @@ function Hr({ node: e, ctx: t }) {
|
|
|
3039
3208
|
},
|
|
3040
3209
|
children: ["Entity not found: ", n]
|
|
3041
3210
|
});
|
|
3042
|
-
let i =
|
|
3043
|
-
return i ? /* @__PURE__ */ X(
|
|
3211
|
+
let i = oi(t.schema.entities, t.entityCode, n);
|
|
3212
|
+
return i ? /* @__PURE__ */ X(di, {
|
|
3044
3213
|
node: e,
|
|
3045
3214
|
ctx: t,
|
|
3046
3215
|
assocCode: n,
|
|
@@ -3060,12 +3229,12 @@ function Hr({ node: e, ctx: t }) {
|
|
|
3060
3229
|
]
|
|
3061
3230
|
});
|
|
3062
3231
|
}
|
|
3063
|
-
function
|
|
3232
|
+
function di({ node: r, ctx: i, assocCode: a, assocEntity: o, fkField: s }) {
|
|
3064
3233
|
let c = r.columns && r.columns.length > 0 ? r.columns.filter((e) => e !== s && !!o.fields.get(e)) : o.fields.names().filter((e) => {
|
|
3065
3234
|
if (e === s) return !1;
|
|
3066
3235
|
let t = o.fields.get(e);
|
|
3067
3236
|
return !(!t || t.primary || t.display?.is_listable === !1);
|
|
3068
|
-
}), l = P(o, "update"), u = r.interaction ?? (l ? "navigate" : "readonly"), d = (u === "inline_edit" || u === "row_edit") && l && r.editable !== !1, f = C(o.display?.name_plural) || C(o.display?.name) || a, p = r.searchable === !0 || r.filters && r.filters.length > 0, m = K(() =>
|
|
3237
|
+
}), l = P(o, "update"), u = r.interaction ?? (l ? "navigate" : "readonly"), d = (u === "inline_edit" || u === "row_edit") && l && r.editable !== !1, f = C(o.display?.name_plural) || C(o.display?.name) || a, p = r.searchable === !0 || r.filters && r.filters.length > 0, m = K(() => ai(o.actions, s, i.recordId), [
|
|
3069
3238
|
o.actions,
|
|
3070
3239
|
s,
|
|
3071
3240
|
i.recordId
|
|
@@ -3073,7 +3242,10 @@ function Ur({ node: r, ctx: i, assocCode: a, assocEntity: o, fkField: s }) {
|
|
|
3073
3242
|
let e = {};
|
|
3074
3243
|
for (let { code: t, action: n } of m) e[t] = n;
|
|
3075
3244
|
return e;
|
|
3076
|
-
}, [m]), g = K(() =>
|
|
3245
|
+
}, [m]), g = K(() => {
|
|
3246
|
+
let e = o.action_layout ?? null;
|
|
3247
|
+
return j(e ?? ue(h, "list_toolbar"), h, void 0, {}, []);
|
|
3248
|
+
}, [o.action_layout, h]), { run: _ } = te(), v = Bt(), y = n(), b = K(() => ({
|
|
3077
3249
|
entity: o,
|
|
3078
3250
|
entityCode: a,
|
|
3079
3251
|
screenRoute: typeof window < "u" ? window.location.pathname : "",
|
|
@@ -3097,7 +3269,7 @@ function Ur({ node: r, ctx: i, assocCode: a, assocEntity: o, fkField: s }) {
|
|
|
3097
3269
|
return t[0] === "entity-children" && t[3] === a;
|
|
3098
3270
|
} });
|
|
3099
3271
|
}, [x, a]), w = W((e, t) => {
|
|
3100
|
-
let n =
|
|
3272
|
+
let n = ri(e, t, {}, a);
|
|
3101
3273
|
if (n !== null) return _({
|
|
3102
3274
|
action: t,
|
|
3103
3275
|
title: C(t.display?.name) || e,
|
|
@@ -3140,7 +3312,7 @@ function Ur({ node: r, ctx: i, assocCode: a, assocEntity: o, fkField: s }) {
|
|
|
3140
3312
|
onClick: () => E((e) => e + 1),
|
|
3141
3313
|
children: "Add row"
|
|
3142
3314
|
})]
|
|
3143
|
-
}), O = p ? /* @__PURE__ */ X(
|
|
3315
|
+
}), O = p ? /* @__PURE__ */ X(pi, {
|
|
3144
3316
|
entityCode: a,
|
|
3145
3317
|
entity: o,
|
|
3146
3318
|
parentEntity: i.entityCode,
|
|
@@ -3154,7 +3326,7 @@ function Ur({ node: r, ctx: i, assocCode: a, assocEntity: o, fkField: s }) {
|
|
|
3154
3326
|
filterFields: r.filters,
|
|
3155
3327
|
sort: r.sort,
|
|
3156
3328
|
startDraftSignal: T
|
|
3157
|
-
}) : /* @__PURE__ */ X(
|
|
3329
|
+
}) : /* @__PURE__ */ X(fi, {
|
|
3158
3330
|
entityCode: a,
|
|
3159
3331
|
entity: o,
|
|
3160
3332
|
parentEntity: i.entityCode,
|
|
@@ -3184,9 +3356,21 @@ function Ur({ node: r, ctx: i, assocCode: a, assocEntity: o, fkField: s }) {
|
|
|
3184
3356
|
children: O
|
|
3185
3357
|
});
|
|
3186
3358
|
}
|
|
3187
|
-
function
|
|
3188
|
-
let d = Ue(), { data: f, isLoading: p, isError: m } = nr(n, r, e, i, l), h = f?.data ?? [], g = f?.$refs
|
|
3189
|
-
|
|
3359
|
+
function fi({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey: i, columns: a, editable: o, interaction: s, ctx: c, sort: l, startDraftSignal: u }) {
|
|
3360
|
+
let d = Ue(), { data: f, isLoading: p, isError: m } = nr(n, r, e, i, l), h = f?.data ?? [], g = f?.$refs, _ = W(() => {
|
|
3361
|
+
d.invalidateQueries({ queryKey: [
|
|
3362
|
+
tr,
|
|
3363
|
+
n,
|
|
3364
|
+
r,
|
|
3365
|
+
e
|
|
3366
|
+
] });
|
|
3367
|
+
}, [
|
|
3368
|
+
d,
|
|
3369
|
+
n,
|
|
3370
|
+
r,
|
|
3371
|
+
e
|
|
3372
|
+
]);
|
|
3373
|
+
return /* @__PURE__ */ X(mi, {
|
|
3190
3374
|
entityCode: e,
|
|
3191
3375
|
entity: t,
|
|
3192
3376
|
parentId: r,
|
|
@@ -3199,23 +3383,11 @@ function Wr({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey
|
|
|
3199
3383
|
refs: g,
|
|
3200
3384
|
isLoading: p,
|
|
3201
3385
|
isError: m,
|
|
3202
|
-
invalidateQuery:
|
|
3203
|
-
d.invalidateQueries({ queryKey: [
|
|
3204
|
-
tr,
|
|
3205
|
-
n,
|
|
3206
|
-
r,
|
|
3207
|
-
e
|
|
3208
|
-
] });
|
|
3209
|
-
}, [
|
|
3210
|
-
d,
|
|
3211
|
-
n,
|
|
3212
|
-
r,
|
|
3213
|
-
e
|
|
3214
|
-
]),
|
|
3386
|
+
invalidateQuery: _,
|
|
3215
3387
|
startDraftSignal: u
|
|
3216
3388
|
});
|
|
3217
3389
|
}
|
|
3218
|
-
function
|
|
3390
|
+
function pi({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey: i, columns: a, editable: o, interaction: s, ctx: c, searchable: l, filterFields: u, sort: d, startDraftSignal: f }) {
|
|
3219
3391
|
let p = Ue(), [m, h] = J(""), [g, _] = J(""), [v, y] = J({}), b = q(void 0);
|
|
3220
3392
|
G(() => (b.current && clearTimeout(b.current), b.current = setTimeout(() => {
|
|
3221
3393
|
_(m);
|
|
@@ -3239,11 +3411,13 @@ function Gr({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey
|
|
|
3239
3411
|
refs: void 0
|
|
3240
3412
|
};
|
|
3241
3413
|
let e = [], t;
|
|
3242
|
-
for (let n of C.pages) if (e.push(...n.data), n.$refs)
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3414
|
+
for (let n of C.pages) if (e.push(...n.data), n.$refs) {
|
|
3415
|
+
if (!t) t = { ...n.$refs };
|
|
3416
|
+
else for (let [e, r] of Object.entries(n.$refs)) t[e] = {
|
|
3417
|
+
...t[e],
|
|
3418
|
+
...r
|
|
3419
|
+
};
|
|
3420
|
+
}
|
|
3247
3421
|
return {
|
|
3248
3422
|
rows: e,
|
|
3249
3423
|
refs: t
|
|
@@ -3255,7 +3429,7 @@ function Gr({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey
|
|
|
3255
3429
|
} });
|
|
3256
3430
|
}, [p, e]);
|
|
3257
3431
|
return /* @__PURE__ */ Z("div", { children: [
|
|
3258
|
-
/* @__PURE__ */ X(
|
|
3432
|
+
/* @__PURE__ */ X(ti, {
|
|
3259
3433
|
entity: t,
|
|
3260
3434
|
searchable: l,
|
|
3261
3435
|
filterFields: u,
|
|
@@ -3265,7 +3439,7 @@ function Gr({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey
|
|
|
3265
3439
|
onFilterChange: x,
|
|
3266
3440
|
allEntities: c.schema.entities
|
|
3267
3441
|
}),
|
|
3268
|
-
/* @__PURE__ */ X(
|
|
3442
|
+
/* @__PURE__ */ X(mi, {
|
|
3269
3443
|
entityCode: e,
|
|
3270
3444
|
entity: t,
|
|
3271
3445
|
parentId: r,
|
|
@@ -3294,17 +3468,17 @@ function Gr({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey
|
|
|
3294
3468
|
})
|
|
3295
3469
|
] });
|
|
3296
3470
|
}
|
|
3297
|
-
function
|
|
3471
|
+
function mi({ 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 }) {
|
|
3298
3472
|
let m = se(), h = m.isPhone && s.relatedRecordsPresentation === "table", g = i.find((e) => e !== r), _ = K(() => o === "navigate" ? ne(void 0, t, s.schema.screens) : null, [
|
|
3299
3473
|
o,
|
|
3300
3474
|
t,
|
|
3301
3475
|
s.schema.screens
|
|
3302
|
-
]), v = K(() => a ?
|
|
3476
|
+
]), v = K(() => a ? si(t, i, r) : /* @__PURE__ */ new Set(), [
|
|
3303
3477
|
i,
|
|
3304
3478
|
r,
|
|
3305
3479
|
t,
|
|
3306
3480
|
a
|
|
3307
|
-
]), y = K(() =>
|
|
3481
|
+
]), y = K(() => ci(t, i, r), [
|
|
3308
3482
|
i,
|
|
3309
3483
|
r,
|
|
3310
3484
|
t
|
|
@@ -3322,7 +3496,7 @@ function Kr({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
|
|
|
3322
3496
|
typeof r == "string" && r !== "" && e.set(he(me(t, n)), r);
|
|
3323
3497
|
}
|
|
3324
3498
|
return e;
|
|
3325
|
-
}, [c, t]), w = K(() =>
|
|
3499
|
+
}, [c, t]), w = K(() => ii(t.actions), [t.actions]), [T, E] = J(null), [D, O] = J(null), [k, A] = J([]), [j, N] = J({}), P = q(j);
|
|
3326
3500
|
P.current = j;
|
|
3327
3501
|
let F = q({});
|
|
3328
3502
|
G(() => {
|
|
@@ -3419,7 +3593,7 @@ function Kr({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
|
|
|
3419
3593
|
]);
|
|
3420
3594
|
let U = W(async () => {
|
|
3421
3595
|
if (!I) return;
|
|
3422
|
-
let n =
|
|
3596
|
+
let n = li(I, i, t, r);
|
|
3423
3597
|
if (n.length > 0) {
|
|
3424
3598
|
R(n);
|
|
3425
3599
|
return;
|
|
@@ -3448,7 +3622,7 @@ function Kr({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
|
|
|
3448
3622
|
O(null), A([]);
|
|
3449
3623
|
return;
|
|
3450
3624
|
}
|
|
3451
|
-
let o =
|
|
3625
|
+
let o = li({
|
|
3452
3626
|
...c.find((n) => he(me(t, n)) === e) ?? {},
|
|
3453
3627
|
...a
|
|
3454
3628
|
}, i, t, r);
|
|
@@ -3538,7 +3712,7 @@ function Kr({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
|
|
|
3538
3712
|
},
|
|
3539
3713
|
children: [c.map((n) => {
|
|
3540
3714
|
let r = he(me(t, n)), c = V.has(r), u = j[r], d = _ && r ? _.replace(/:\w+/, r) : void 0;
|
|
3541
|
-
return /* @__PURE__ */ X(
|
|
3715
|
+
return /* @__PURE__ */ X(hi, {
|
|
3542
3716
|
rowId: r,
|
|
3543
3717
|
row: n,
|
|
3544
3718
|
entity: t,
|
|
@@ -3566,7 +3740,7 @@ function Kr({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
|
|
|
3566
3740
|
entityCode: e,
|
|
3567
3741
|
onRowActionSuccess: f
|
|
3568
3742
|
}, r);
|
|
3569
|
-
}), I && /* @__PURE__ */ X(
|
|
3743
|
+
}), I && /* @__PURE__ */ X(bi, {
|
|
3570
3744
|
draftRow: I,
|
|
3571
3745
|
entity: t,
|
|
3572
3746
|
columns: i,
|
|
@@ -3613,7 +3787,7 @@ function Kr({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
|
|
|
3613
3787
|
} })
|
|
3614
3788
|
] }) }), /* @__PURE__ */ Z("tbody", { children: [c.map((n) => {
|
|
3615
3789
|
let r = he(me(t, n)), c = V.has(r), u = j[r], d = _ && r ? _.replace(/:\w+/, r) : void 0;
|
|
3616
|
-
return /* @__PURE__ */ X(
|
|
3790
|
+
return /* @__PURE__ */ X(gi, {
|
|
3617
3791
|
rowId: r,
|
|
3618
3792
|
row: n,
|
|
3619
3793
|
entity: t,
|
|
@@ -3641,7 +3815,7 @@ function Kr({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
|
|
|
3641
3815
|
entityCode: e,
|
|
3642
3816
|
onRowActionSuccess: f
|
|
3643
3817
|
}, r);
|
|
3644
|
-
}), I && /* @__PURE__ */ X(
|
|
3818
|
+
}), I && /* @__PURE__ */ X(yi, {
|
|
3645
3819
|
draftRow: I,
|
|
3646
3820
|
entity: t,
|
|
3647
3821
|
columns: i,
|
|
@@ -3662,23 +3836,27 @@ function Kr({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
|
|
|
3662
3836
|
})
|
|
3663
3837
|
})] });
|
|
3664
3838
|
}
|
|
3665
|
-
function
|
|
3839
|
+
function hi({ rowId: t, row: r, entity: i, entities: a, screens: o, columns: s, editableColumns: c, editable: l, interaction: u, isEditing: d, editErrors: f, isDeleting: m, rowState: h, onCellChange: g, onDeleteClick: _, onStartEdit: v, onConfirmEdit: y, onCancelEdit: x, refs: S, identityCol: C, href: w, rowActions: T, onRowActionSuccess: E }) {
|
|
3666
3840
|
let D = n(), O = Ie(), k = K(() => !h || Object.keys(h.buffer).length === 0 ? r : {
|
|
3667
3841
|
...r,
|
|
3668
3842
|
...h.buffer
|
|
3669
3843
|
}, [r, h]);
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
|
|
3675
|
-
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
|
|
3844
|
+
if (u === "row_edit" && d) {
|
|
3845
|
+
let e = h?.error ? [...f, `_error:${h.error}`] : f;
|
|
3846
|
+
return /* @__PURE__ */ X(vi, {
|
|
3847
|
+
values: k,
|
|
3848
|
+
entity: i,
|
|
3849
|
+
columns: s,
|
|
3850
|
+
editableColumns: c,
|
|
3851
|
+
errors: e,
|
|
3852
|
+
saving: h?.saving ?? !1,
|
|
3853
|
+
onChange: (e, n) => g(t, e, n),
|
|
3854
|
+
onConfirm: () => y(t),
|
|
3855
|
+
onCancel: () => x(t),
|
|
3856
|
+
refs: S
|
|
3857
|
+
});
|
|
3858
|
+
}
|
|
3859
|
+
return /* @__PURE__ */ Z("div", {
|
|
3682
3860
|
style: {
|
|
3683
3861
|
border: "1px solid var(--border)",
|
|
3684
3862
|
borderRadius: 8,
|
|
@@ -3776,7 +3954,8 @@ function qr({ rowId: t, row: r, entity: i, entities: a, screens: o, columns: s,
|
|
|
3776
3954
|
onClick: () => _(t),
|
|
3777
3955
|
title: "Delete row"
|
|
3778
3956
|
})
|
|
3779
|
-
] }), !l && T && T.length > 0 && /* @__PURE__ */ X(
|
|
3957
|
+
] }), !l && T && T.length > 0 && /* @__PURE__ */ X(ei, {
|
|
3958
|
+
entity: i,
|
|
3780
3959
|
actions: T,
|
|
3781
3960
|
objectIds: [t],
|
|
3782
3961
|
row: k,
|
|
@@ -3785,23 +3964,26 @@ function qr({ rowId: t, row: r, entity: i, entities: a, screens: o, columns: s,
|
|
|
3785
3964
|
})]
|
|
3786
3965
|
});
|
|
3787
3966
|
}
|
|
3788
|
-
function
|
|
3967
|
+
function gi({ rowId: t, row: r, entity: i, entities: a, screens: o, columns: s, editableColumns: c, editable: l, interaction: u, isEditing: d, editErrors: f, isDeleting: m, activeCell: h, setActiveCell: g, rowState: _, onCellChange: v, onDeleteClick: y, onStartEdit: b, onConfirmEdit: x, onCancelEdit: S, refs: C, identityCol: w, href: T, rowActions: E, onRowActionSuccess: D }) {
|
|
3789
3968
|
let O = n(), k = K(() => !_ || Object.keys(_.buffer).length === 0 ? r : {
|
|
3790
3969
|
...r,
|
|
3791
3970
|
..._.buffer
|
|
3792
3971
|
}, [r, _]);
|
|
3793
|
-
if (u === "row_edit" && d)
|
|
3794
|
-
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
|
|
3800
|
-
|
|
3801
|
-
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
|
|
3972
|
+
if (u === "row_edit" && d) {
|
|
3973
|
+
let e = _?.error ? [...f, `_error:${_.error}`] : f;
|
|
3974
|
+
return /* @__PURE__ */ X(_i, {
|
|
3975
|
+
values: k,
|
|
3976
|
+
entity: i,
|
|
3977
|
+
columns: s,
|
|
3978
|
+
editableColumns: c,
|
|
3979
|
+
errors: e,
|
|
3980
|
+
saving: _?.saving ?? !1,
|
|
3981
|
+
onChange: (e, n) => v(t, e, n),
|
|
3982
|
+
onConfirm: () => x(t),
|
|
3983
|
+
onCancel: () => S(t),
|
|
3984
|
+
refs: C
|
|
3985
|
+
});
|
|
3986
|
+
}
|
|
3805
3987
|
let j = Me, M = {
|
|
3806
3988
|
padding: "4px 4px",
|
|
3807
3989
|
borderBottom: "1px solid var(--divider)",
|
|
@@ -3903,7 +4085,8 @@ function Jr({ rowId: t, row: r, entity: i, entities: a, screens: o, columns: s,
|
|
|
3903
4085
|
borderBottom: "1px solid var(--divider)",
|
|
3904
4086
|
verticalAlign: "middle"
|
|
3905
4087
|
},
|
|
3906
|
-
children: /* @__PURE__ */ X(
|
|
4088
|
+
children: /* @__PURE__ */ X(ei, {
|
|
4089
|
+
entity: i,
|
|
3907
4090
|
actions: E,
|
|
3908
4091
|
objectIds: [t],
|
|
3909
4092
|
row: k,
|
|
@@ -3913,7 +4096,7 @@ function Jr({ rowId: t, row: r, entity: i, entities: a, screens: o, columns: s,
|
|
|
3913
4096
|
]
|
|
3914
4097
|
});
|
|
3915
4098
|
}
|
|
3916
|
-
function
|
|
4099
|
+
function _i({ values: t, entity: r, columns: i, editableColumns: a, errors: o, saving: s, onChange: c, onConfirm: l, onCancel: u, refs: d, accent: f }) {
|
|
3917
4100
|
let m = n(), h = o.find((e) => e.startsWith("_error:")), g = new Set(o.filter((e) => !e.startsWith("_error:"))), _ = {
|
|
3918
4101
|
padding: "6px 12px",
|
|
3919
4102
|
borderBottom: "1px solid var(--divider)",
|
|
@@ -3996,7 +4179,7 @@ function Yr({ values: t, entity: r, columns: i, editableColumns: a, errors: o, s
|
|
|
3996
4179
|
})]
|
|
3997
4180
|
});
|
|
3998
4181
|
}
|
|
3999
|
-
function
|
|
4182
|
+
function vi({ values: t, entity: r, columns: i, editableColumns: a, errors: o, saving: s, onChange: c, onConfirm: l, onCancel: u, refs: d, accent: f }) {
|
|
4000
4183
|
let m = n(), h = Ie(), g = o.find((e) => e.startsWith("_error:")), _ = new Set(o.filter((e) => !e.startsWith("_error:")));
|
|
4001
4184
|
return /* @__PURE__ */ Z("div", {
|
|
4002
4185
|
style: {
|
|
@@ -4097,15 +4280,16 @@ function Xr({ values: t, entity: r, columns: i, editableColumns: a, errors: o, s
|
|
|
4097
4280
|
})]
|
|
4098
4281
|
});
|
|
4099
4282
|
}
|
|
4100
|
-
function
|
|
4101
|
-
|
|
4283
|
+
function yi({ draftRow: e, entity: t, columns: n, editableColumns: r, foreignKey: i, draftErrors: a, draftSaving: o, onChange: s, onConfirm: c, onCancel: l, refs: u }) {
|
|
4284
|
+
let d = K(() => {
|
|
4285
|
+
let e = new Set(r);
|
|
4286
|
+
return e.delete(i), e;
|
|
4287
|
+
}, [r, i]);
|
|
4288
|
+
return /* @__PURE__ */ X(_i, {
|
|
4102
4289
|
values: e,
|
|
4103
4290
|
entity: t,
|
|
4104
4291
|
columns: n,
|
|
4105
|
-
editableColumns:
|
|
4106
|
-
let e = new Set(r);
|
|
4107
|
-
return e.delete(i), e;
|
|
4108
|
-
}, [r, i]),
|
|
4292
|
+
editableColumns: d,
|
|
4109
4293
|
errors: a,
|
|
4110
4294
|
saving: o,
|
|
4111
4295
|
onChange: s,
|
|
@@ -4115,15 +4299,16 @@ function Zr({ draftRow: e, entity: t, columns: n, editableColumns: r, foreignKey
|
|
|
4115
4299
|
accent: !0
|
|
4116
4300
|
});
|
|
4117
4301
|
}
|
|
4118
|
-
function
|
|
4119
|
-
|
|
4302
|
+
function bi({ draftRow: e, entity: t, columns: n, editableColumns: r, foreignKey: i, draftErrors: a, draftSaving: o, onChange: s, onConfirm: c, onCancel: l, refs: u }) {
|
|
4303
|
+
let d = K(() => {
|
|
4304
|
+
let e = new Set(r);
|
|
4305
|
+
return e.delete(i), e;
|
|
4306
|
+
}, [r, i]);
|
|
4307
|
+
return /* @__PURE__ */ X(vi, {
|
|
4120
4308
|
values: e,
|
|
4121
4309
|
entity: t,
|
|
4122
4310
|
columns: n,
|
|
4123
|
-
editableColumns:
|
|
4124
|
-
let e = new Set(r);
|
|
4125
|
-
return e.delete(i), e;
|
|
4126
|
-
}, [r, i]),
|
|
4311
|
+
editableColumns: d,
|
|
4127
4312
|
errors: a,
|
|
4128
4313
|
saving: o,
|
|
4129
4314
|
onChange: s,
|
|
@@ -4135,76 +4320,76 @@ function Qr({ draftRow: e, entity: t, columns: n, editableColumns: r, foreignKey
|
|
|
4135
4320
|
}
|
|
4136
4321
|
//#endregion
|
|
4137
4322
|
//#region src/hooks/useMutations.ts
|
|
4138
|
-
function
|
|
4323
|
+
function xi(e) {
|
|
4139
4324
|
H.error(e.message);
|
|
4140
4325
|
}
|
|
4141
|
-
function
|
|
4326
|
+
function Si(e, t, n = {}) {
|
|
4142
4327
|
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: [tr, t] }), n.objectMeta && (e.invalidateQueries({ queryKey: ["object-status", t] }), e.invalidateQueries({ queryKey: ["object-properties", t] }));
|
|
4143
4328
|
}
|
|
4144
|
-
function
|
|
4329
|
+
function Ci(e) {
|
|
4145
4330
|
let t = Ue();
|
|
4146
4331
|
return Ve({
|
|
4147
4332
|
mutationFn: (t) => M(e, t),
|
|
4148
4333
|
onSuccess: () => {
|
|
4149
|
-
|
|
4334
|
+
Si(t, e), H.success("Record created");
|
|
4150
4335
|
},
|
|
4151
|
-
onError:
|
|
4336
|
+
onError: xi
|
|
4152
4337
|
});
|
|
4153
4338
|
}
|
|
4154
|
-
function
|
|
4339
|
+
function wi(e) {
|
|
4155
4340
|
let t = Ue();
|
|
4156
4341
|
return Ve({
|
|
4157
4342
|
mutationFn: ({ pkValues: t, data: n }) => re(e, t, n),
|
|
4158
4343
|
onSuccess: () => {
|
|
4159
|
-
|
|
4344
|
+
Si(t, e, {
|
|
4160
4345
|
item: !0,
|
|
4161
4346
|
children: !0,
|
|
4162
4347
|
objectMeta: !0
|
|
4163
4348
|
}), H.success("Record updated");
|
|
4164
4349
|
},
|
|
4165
|
-
onError:
|
|
4350
|
+
onError: xi
|
|
4166
4351
|
});
|
|
4167
4352
|
}
|
|
4168
|
-
function
|
|
4353
|
+
function Ti(e) {
|
|
4169
4354
|
let t = Ue();
|
|
4170
4355
|
return Ve({
|
|
4171
4356
|
mutationFn: (t) => de(e, t),
|
|
4172
4357
|
onSuccess: () => {
|
|
4173
|
-
|
|
4358
|
+
Si(t, e, { item: !0 }), H.success("Record deleted");
|
|
4174
4359
|
},
|
|
4175
|
-
onError:
|
|
4360
|
+
onError: xi
|
|
4176
4361
|
});
|
|
4177
4362
|
}
|
|
4178
|
-
function
|
|
4363
|
+
function Ei(e) {
|
|
4179
4364
|
let t = Ue();
|
|
4180
4365
|
return Ve({
|
|
4181
4366
|
mutationFn: (t) => w(e, t),
|
|
4182
4367
|
onSuccess: () => {
|
|
4183
|
-
|
|
4368
|
+
Si(t, e, {
|
|
4184
4369
|
item: !0,
|
|
4185
4370
|
objectMeta: !0
|
|
4186
4371
|
}), H.success("Record restored");
|
|
4187
4372
|
},
|
|
4188
|
-
onError:
|
|
4373
|
+
onError: xi
|
|
4189
4374
|
});
|
|
4190
4375
|
}
|
|
4191
4376
|
//#endregion
|
|
4192
4377
|
//#region src/components/shared/LoadingSkeleton.tsx
|
|
4193
|
-
var
|
|
4378
|
+
var Di = {
|
|
4194
4379
|
display: "block",
|
|
4195
4380
|
background: "linear-gradient(90deg, var(--surface-3) 0%, var(--surface-2) 40%, var(--surface-3) 80%)",
|
|
4196
4381
|
backgroundSize: "200% 100%",
|
|
4197
4382
|
borderRadius: 6,
|
|
4198
4383
|
animation: "declarion-shimmer 1.2s ease-in-out infinite"
|
|
4199
4384
|
};
|
|
4200
|
-
function
|
|
4385
|
+
function Oi({ height: e, width: t }) {
|
|
4201
4386
|
return /* @__PURE__ */ Z(Y, { children: [/* @__PURE__ */ X("style", { children: "@keyframes declarion-shimmer{from{background-position:200% 0}to{background-position:-200% 0}}" }), /* @__PURE__ */ X("span", { style: {
|
|
4202
|
-
...
|
|
4387
|
+
...Di,
|
|
4203
4388
|
height: e,
|
|
4204
4389
|
width: t ?? "100%"
|
|
4205
4390
|
} })] });
|
|
4206
4391
|
}
|
|
4207
|
-
function
|
|
4392
|
+
function ki({ rows: e = 8, cols: t = 4 }) {
|
|
4208
4393
|
return /* @__PURE__ */ Z("div", {
|
|
4209
4394
|
style: {
|
|
4210
4395
|
padding: 16,
|
|
@@ -4219,7 +4404,7 @@ function si({ rows: e = 8, cols: t = 4 }) {
|
|
|
4219
4404
|
},
|
|
4220
4405
|
children: Array.from({ length: t }).map((e, t) => /* @__PURE__ */ X("div", {
|
|
4221
4406
|
style: { flex: 1 },
|
|
4222
|
-
children: /* @__PURE__ */ X(
|
|
4407
|
+
children: /* @__PURE__ */ X(Oi, { height: 14 })
|
|
4223
4408
|
}, t))
|
|
4224
4409
|
}), Array.from({ length: e }).map((e, n) => /* @__PURE__ */ X("div", {
|
|
4225
4410
|
style: {
|
|
@@ -4228,12 +4413,12 @@ function si({ rows: e = 8, cols: t = 4 }) {
|
|
|
4228
4413
|
},
|
|
4229
4414
|
children: Array.from({ length: t }).map((e, t) => /* @__PURE__ */ X("div", {
|
|
4230
4415
|
style: { flex: 1 },
|
|
4231
|
-
children: /* @__PURE__ */ X(
|
|
4416
|
+
children: /* @__PURE__ */ X(Oi, { height: 28 })
|
|
4232
4417
|
}, t))
|
|
4233
4418
|
}, n))]
|
|
4234
4419
|
});
|
|
4235
4420
|
}
|
|
4236
|
-
function
|
|
4421
|
+
function Ai() {
|
|
4237
4422
|
return /* @__PURE__ */ Z("div", {
|
|
4238
4423
|
style: {
|
|
4239
4424
|
padding: 20,
|
|
@@ -4242,7 +4427,7 @@ function ci() {
|
|
|
4242
4427
|
gap: 16
|
|
4243
4428
|
},
|
|
4244
4429
|
children: [
|
|
4245
|
-
/* @__PURE__ */ X(
|
|
4430
|
+
/* @__PURE__ */ X(Oi, {
|
|
4246
4431
|
height: 12,
|
|
4247
4432
|
width: 160
|
|
4248
4433
|
}),
|
|
@@ -4253,11 +4438,11 @@ function ci() {
|
|
|
4253
4438
|
gap: 12
|
|
4254
4439
|
},
|
|
4255
4440
|
children: [/* @__PURE__ */ X("span", { style: {
|
|
4256
|
-
...
|
|
4441
|
+
...Di,
|
|
4257
4442
|
width: 32,
|
|
4258
4443
|
height: 32,
|
|
4259
4444
|
borderRadius: 8
|
|
4260
|
-
} }), /* @__PURE__ */ X(
|
|
4445
|
+
} }), /* @__PURE__ */ X(Oi, {
|
|
4261
4446
|
height: 22,
|
|
4262
4447
|
width: 240
|
|
4263
4448
|
})]
|
|
@@ -4274,7 +4459,7 @@ function ci() {
|
|
|
4274
4459
|
padding: "11px 14px",
|
|
4275
4460
|
borderBottom: "1px solid var(--divider)"
|
|
4276
4461
|
},
|
|
4277
|
-
children: /* @__PURE__ */ X(
|
|
4462
|
+
children: /* @__PURE__ */ X(Oi, {
|
|
4278
4463
|
height: 13,
|
|
4279
4464
|
width: 150
|
|
4280
4465
|
})
|
|
@@ -4290,12 +4475,12 @@ function ci() {
|
|
|
4290
4475
|
display: "flex",
|
|
4291
4476
|
gap: 16
|
|
4292
4477
|
},
|
|
4293
|
-
children: [/* @__PURE__ */ X(
|
|
4478
|
+
children: [/* @__PURE__ */ X(Oi, {
|
|
4294
4479
|
height: 13,
|
|
4295
4480
|
width: 110
|
|
4296
4481
|
}), /* @__PURE__ */ X("div", {
|
|
4297
4482
|
style: { flex: 1 },
|
|
4298
|
-
children: /* @__PURE__ */ X(
|
|
4483
|
+
children: /* @__PURE__ */ X(Oi, { height: 13 })
|
|
4299
4484
|
})]
|
|
4300
4485
|
}, t))
|
|
4301
4486
|
})]
|
|
@@ -4305,11 +4490,11 @@ function ci() {
|
|
|
4305
4490
|
}
|
|
4306
4491
|
//#endregion
|
|
4307
4492
|
//#region src/lib/sort.ts
|
|
4308
|
-
var
|
|
4493
|
+
var ji = {
|
|
4309
4494
|
nulls_first: "first",
|
|
4310
4495
|
nulls_last: "last"
|
|
4311
4496
|
};
|
|
4312
|
-
function
|
|
4497
|
+
function Mi(e) {
|
|
4313
4498
|
if (!e) return [];
|
|
4314
4499
|
let t = [];
|
|
4315
4500
|
for (let n of e.split(",")) {
|
|
@@ -4322,14 +4507,14 @@ function ui(e) {
|
|
|
4322
4507
|
dir: r[1]?.trim().toLowerCase() === "desc" ? "desc" : "asc"
|
|
4323
4508
|
}, o = r[2]?.trim().toLowerCase();
|
|
4324
4509
|
if (o) {
|
|
4325
|
-
let e =
|
|
4510
|
+
let e = ji[o];
|
|
4326
4511
|
e && (a.nulls = e);
|
|
4327
4512
|
}
|
|
4328
4513
|
t.push(a);
|
|
4329
4514
|
}
|
|
4330
4515
|
return t;
|
|
4331
4516
|
}
|
|
4332
|
-
function
|
|
4517
|
+
function Ni(e) {
|
|
4333
4518
|
if (!e) return;
|
|
4334
4519
|
let t = [];
|
|
4335
4520
|
for (let n of e.split(",")) {
|
|
@@ -4340,30 +4525,30 @@ function di(e) {
|
|
|
4340
4525
|
}
|
|
4341
4526
|
return t.length > 0 ? t.join(",") : void 0;
|
|
4342
4527
|
}
|
|
4343
|
-
function
|
|
4528
|
+
function Pi(e) {
|
|
4344
4529
|
return e.map((e) => {
|
|
4345
4530
|
let t = `${e.field}:${e.dir}`;
|
|
4346
4531
|
return e.nulls === "first" ? `${t}:nulls_first` : e.nulls === "last" ? `${t}:nulls_last` : t;
|
|
4347
4532
|
}).join(",");
|
|
4348
4533
|
}
|
|
4349
|
-
function
|
|
4534
|
+
function Fi(e, t) {
|
|
4350
4535
|
let n = e.findIndex((e) => e.field === t);
|
|
4351
4536
|
return n >= 0 ? [...e.slice(0, n), ...e.slice(n + 1)] : e.length >= 5 ? e : [...e, {
|
|
4352
4537
|
field: t,
|
|
4353
4538
|
dir: "asc"
|
|
4354
4539
|
}];
|
|
4355
4540
|
}
|
|
4356
|
-
function
|
|
4541
|
+
function Ii(e, t) {
|
|
4357
4542
|
let n = e.filter((e) => e.field !== t.field);
|
|
4358
4543
|
return n.length >= 5 ? e : [...n, t];
|
|
4359
4544
|
}
|
|
4360
|
-
function
|
|
4545
|
+
function Li(e, t) {
|
|
4361
4546
|
let n = e.findIndex((e) => e.field === t);
|
|
4362
4547
|
return n < 0 ? e : [...e.slice(0, n), ...e.slice(n + 1)];
|
|
4363
4548
|
}
|
|
4364
4549
|
//#endregion
|
|
4365
4550
|
//#region src/hooks/useScreenBack.ts
|
|
4366
|
-
function
|
|
4551
|
+
function Ri(e) {
|
|
4367
4552
|
let t = ze(), n = oe(), i = ae(), a = At((e) => e.depth), { data: o } = r(), s = e?.fallback, c = kt((e) => {
|
|
4368
4553
|
let t = e.tabs.find((t) => t.id === e.activeTabId);
|
|
4369
4554
|
return t ? t.returnTo : void 0;
|
|
@@ -4411,40 +4596,40 @@ function gi(e) {
|
|
|
4411
4596
|
}
|
|
4412
4597
|
//#endregion
|
|
4413
4598
|
//#region src/lib/field-classification.ts
|
|
4414
|
-
function
|
|
4599
|
+
function zi(e, t) {
|
|
4415
4600
|
let n = e?.field_access?.[t];
|
|
4416
4601
|
return !n || n.read === "granted";
|
|
4417
4602
|
}
|
|
4418
|
-
function
|
|
4603
|
+
function Bi(e, t) {
|
|
4419
4604
|
let n = e?.field_access?.[t];
|
|
4420
4605
|
return !n || n.write === "granted";
|
|
4421
4606
|
}
|
|
4422
|
-
function
|
|
4607
|
+
function Vi(e, t) {
|
|
4423
4608
|
return e?.field_access?.[t]?.classification;
|
|
4424
4609
|
}
|
|
4425
|
-
function
|
|
4610
|
+
function Hi(e, t) {
|
|
4426
4611
|
return e?.field_access?.[t]?.required_permission;
|
|
4427
4612
|
}
|
|
4428
|
-
function
|
|
4429
|
-
let r =
|
|
4613
|
+
function Ui(e, t, n) {
|
|
4614
|
+
let r = Vi(t, n);
|
|
4430
4615
|
if (r) return e?.classifications?.[r];
|
|
4431
4616
|
}
|
|
4432
|
-
function
|
|
4433
|
-
return !!
|
|
4617
|
+
function Wi(e, t, n) {
|
|
4618
|
+
return !!Ui(e, t, n)?.sod_protected;
|
|
4434
4619
|
}
|
|
4435
|
-
function
|
|
4620
|
+
function Gi(e, t) {
|
|
4436
4621
|
return e?.field_access?.[t];
|
|
4437
4622
|
}
|
|
4438
4623
|
//#endregion
|
|
4439
4624
|
//#region src/components/pages/list/cardProjection.ts
|
|
4440
|
-
var
|
|
4625
|
+
var Ki = 4, qi = 2, Ji = 2, Yi = [
|
|
4441
4626
|
"screen_card",
|
|
4442
4627
|
"entity_card",
|
|
4443
4628
|
"saved_view_columns",
|
|
4444
4629
|
"screen_default_columns",
|
|
4445
4630
|
"screen_columns",
|
|
4446
4631
|
"entity_inference"
|
|
4447
|
-
],
|
|
4632
|
+
], Xi = /* @__PURE__ */ new Set(["_select", "_actions"]), Zi = /* @__PURE__ */ new Set([
|
|
4448
4633
|
"text",
|
|
4449
4634
|
"rich_text",
|
|
4450
4635
|
"multilang_text",
|
|
@@ -4453,11 +4638,11 @@ var wi = 4, Ti = 2, Ei = 2, Di = [
|
|
|
4453
4638
|
"secret",
|
|
4454
4639
|
"password",
|
|
4455
4640
|
"bytes"
|
|
4456
|
-
]),
|
|
4641
|
+
]), Qi = /* @__PURE__ */ new Set(["enum", "bool"]), $i = /* @__PURE__ */ new Set([
|
|
4457
4642
|
"date",
|
|
4458
4643
|
"time",
|
|
4459
4644
|
"timestamp"
|
|
4460
|
-
]),
|
|
4645
|
+
]), ea = /* @__PURE__ */ new Set([
|
|
4461
4646
|
"string",
|
|
4462
4647
|
"text",
|
|
4463
4648
|
"email",
|
|
@@ -4483,58 +4668,88 @@ var wi = 4, Ti = 2, Ei = 2, Di = [
|
|
|
4483
4668
|
"enum",
|
|
4484
4669
|
"status"
|
|
4485
4670
|
]);
|
|
4486
|
-
function
|
|
4671
|
+
function ta(e) {
|
|
4487
4672
|
let { entity: t, screen: n, savedViewColumns: r } = e, i = n?.card;
|
|
4488
|
-
if (i) return
|
|
4489
|
-
if (t?.card) return
|
|
4490
|
-
let a =
|
|
4491
|
-
return
|
|
4673
|
+
if (i) return oa(t, i, "screen_card");
|
|
4674
|
+
if (t?.card) return oa(t, t.card, "entity_card");
|
|
4675
|
+
let a = la(t, n, r);
|
|
4676
|
+
return sa(t, a.columns, a.source);
|
|
4492
4677
|
}
|
|
4493
|
-
function
|
|
4494
|
-
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
|
|
4495
|
-
for (let e of p) f.addField(e, "render"),
|
|
4496
|
-
let m
|
|
4678
|
+
function na(e) {
|
|
4679
|
+
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 Ra(), p = r === "cards" ? a.renderFields : da(t, i, { explicit: !0 }), m = r === "cards" ? ia(t, n) : [];
|
|
4680
|
+
for (let e of p) f.addField(e, "render"), Fa(t, e, f, "render");
|
|
4681
|
+
for (let e of m) p.includes(e) || (f.addField(e, "variant"), Fa(t, e, f, "variant"));
|
|
4682
|
+
let h = Sa(t, f), g = Da(t, [
|
|
4497
4683
|
o,
|
|
4498
4684
|
s,
|
|
4499
4685
|
c
|
|
4500
|
-
], f),
|
|
4501
|
-
if (u) for (let e of
|
|
4502
|
-
let
|
|
4503
|
-
for (let e of
|
|
4504
|
-
for (let e of
|
|
4505
|
-
for (let e of
|
|
4506
|
-
for (let e of
|
|
4507
|
-
let
|
|
4508
|
-
for (let e of
|
|
4509
|
-
|
|
4510
|
-
let
|
|
4686
|
+
], f), _ = ra(t, n, f), v = Oa(t, l, f), y = ka(t, n, d, f);
|
|
4687
|
+
if (u) for (let e of h) f.addField(e, "detail_handoff");
|
|
4688
|
+
let b = new $();
|
|
4689
|
+
for (let e of h) b.add(e);
|
|
4690
|
+
for (let e of g) b.add(e);
|
|
4691
|
+
for (let e of _) b.add(e);
|
|
4692
|
+
for (let e of m) b.add(e);
|
|
4693
|
+
for (let e of v) b.add(e);
|
|
4694
|
+
for (let e of y) b.add(e);
|
|
4695
|
+
let x = new $();
|
|
4696
|
+
for (let e of p) Pa(t, e, x, f);
|
|
4697
|
+
for (let e of b.values()) Pa(t, e, x, f);
|
|
4698
|
+
let S = x.values(), C = Ia(f);
|
|
4511
4699
|
return {
|
|
4512
4700
|
renderFields: p,
|
|
4513
|
-
dependencyFields:
|
|
4514
|
-
conditionFields:
|
|
4515
|
-
identityFields:
|
|
4516
|
-
sortFields:
|
|
4517
|
-
selectFields:
|
|
4518
|
-
expandFields:
|
|
4701
|
+
dependencyFields: b.values().filter((e) => !p.includes(e)),
|
|
4702
|
+
conditionFields: g,
|
|
4703
|
+
identityFields: h,
|
|
4704
|
+
sortFields: v,
|
|
4705
|
+
selectFields: S.length > 0 ? S : void 0,
|
|
4706
|
+
expandFields: C.length > 0 ? C : void 0,
|
|
4519
4707
|
reasons: f.snapshot()
|
|
4520
4708
|
};
|
|
4521
4709
|
}
|
|
4522
|
-
function
|
|
4710
|
+
function ra(e, t, n) {
|
|
4711
|
+
let r = new $(), i = (t) => {
|
|
4712
|
+
for (let n of t) n.and ? i(n.and) : n.or ? i(n.or) : n.field && e?.fields.has(n.field) && r.add(n.field);
|
|
4713
|
+
};
|
|
4714
|
+
for (let t of e?.variants?.items() ?? []) t.when && i(t.when);
|
|
4715
|
+
for (let e of t?.variants?.items() ?? []) e.when && i(e.when);
|
|
4716
|
+
for (let e of r.values()) n.addField(e, "variant");
|
|
4717
|
+
return r.values();
|
|
4718
|
+
}
|
|
4719
|
+
function ia(e, t, n) {
|
|
4720
|
+
let r = new $();
|
|
4721
|
+
for (let i of ta({
|
|
4722
|
+
entity: e,
|
|
4723
|
+
screen: t,
|
|
4724
|
+
savedViewColumns: n
|
|
4725
|
+
}).renderFields) r.add(i);
|
|
4726
|
+
for (let i of t?.variants?.items() ?? []) {
|
|
4727
|
+
let a = { ...t };
|
|
4728
|
+
i.card !== void 0 && (a.card = i.card);
|
|
4729
|
+
for (let t of ta({
|
|
4730
|
+
entity: e,
|
|
4731
|
+
screen: a,
|
|
4732
|
+
savedViewColumns: n
|
|
4733
|
+
}).renderFields) r.add(t);
|
|
4734
|
+
}
|
|
4735
|
+
return r.values();
|
|
4736
|
+
}
|
|
4737
|
+
function aa(e, t, n) {
|
|
4523
4738
|
if (!e || t?.on_row_click !== "peek" || t.quick_peek?.enabled === !1) return [];
|
|
4524
4739
|
let r = t.quick_peek?.fields;
|
|
4525
|
-
if (r && r.length > 0) return
|
|
4740
|
+
if (r && r.length > 0) return da(e, r, { explicit: !0 });
|
|
4526
4741
|
let i = t.quick_peek?.sections;
|
|
4527
4742
|
if (i && i.length > 0) {
|
|
4528
4743
|
let r = Object.values(n ?? {}).find((e) => e.type === "detail" && e.entity === t.entity), a = new $();
|
|
4529
|
-
|
|
4530
|
-
let o =
|
|
4744
|
+
Aa(r?.items, new Set(i.map(String)), a);
|
|
4745
|
+
let o = da(e, a.values(), { explicit: !0 });
|
|
4531
4746
|
if (o.length > 0) return o;
|
|
4532
4747
|
}
|
|
4533
|
-
return
|
|
4748
|
+
return Na(e);
|
|
4534
4749
|
}
|
|
4535
|
-
function
|
|
4536
|
-
let r = t.max_body_fields ??
|
|
4537
|
-
return
|
|
4750
|
+
function oa(e, t, n) {
|
|
4751
|
+
let r = t.max_body_fields ?? Ki, i = fa(e, t.title_field, { explicit: !0 }), a = fa(e, t.subtitle_field, { explicit: !0 }), o = da(e, t.badge_fields ?? [], { explicit: !0 }), s = da(e, t.fields ?? [], { explicit: !0 }), c = da(e, t.meta_fields ?? [], { explicit: !0 });
|
|
4752
|
+
return ca({
|
|
4538
4753
|
source: n,
|
|
4539
4754
|
explicit: !0,
|
|
4540
4755
|
titleField: i,
|
|
@@ -4547,28 +4762,28 @@ function Ii(e, t, n) {
|
|
|
4547
4762
|
maxBodyFields: r
|
|
4548
4763
|
});
|
|
4549
4764
|
}
|
|
4550
|
-
function
|
|
4551
|
-
let r =
|
|
4765
|
+
function sa(e, t, n) {
|
|
4766
|
+
let r = da(e, t, { explicit: !1 }), i = Ki, a = fa(e, e?.display?.display_field, { explicit: !1 }), o = a ?? pa(e, r, {
|
|
4552
4767
|
allowLong: !1,
|
|
4553
4768
|
allowAuto: !1
|
|
4554
|
-
}), s = a !== void 0, c = o ? /* @__PURE__ */ new Set([o]) : void 0, l = r.find((t) => !c?.has(t) &&
|
|
4769
|
+
}), s = a !== void 0, c = o ? /* @__PURE__ */ new Set([o]) : void 0, l = r.find((t) => !c?.has(t) && ha(e, t)), u = new Set([o, l].filter((e) => !!e)), d = _a(e, r).filter((e) => !u.has(e)).slice(0, qi);
|
|
4555
4770
|
for (let e of d) u.add(e);
|
|
4556
|
-
let f = r.filter((t) => !u.has(t) &&
|
|
4771
|
+
let f = r.filter((t) => !u.has(t) && va(e, t)).slice(0, Ji);
|
|
4557
4772
|
for (let e of f) u.add(e);
|
|
4558
|
-
return
|
|
4773
|
+
return ca({
|
|
4559
4774
|
source: n,
|
|
4560
4775
|
explicit: !1,
|
|
4561
4776
|
titleField: o,
|
|
4562
4777
|
titleUsesDisplay: s,
|
|
4563
4778
|
subtitleField: l,
|
|
4564
4779
|
badgeFields: d,
|
|
4565
|
-
bodyFields: r.filter((t) => !u.has(t) &&
|
|
4780
|
+
bodyFields: r.filter((t) => !u.has(t) && ma(e, t)).slice(0, i),
|
|
4566
4781
|
metaFields: f,
|
|
4567
4782
|
hideEmptyFields: !0,
|
|
4568
4783
|
maxBodyFields: i
|
|
4569
4784
|
});
|
|
4570
4785
|
}
|
|
4571
|
-
function
|
|
4786
|
+
function ca(e) {
|
|
4572
4787
|
let t = new $(), n = [], r = (r, i) => {
|
|
4573
4788
|
!r || t.has(r) || (t.add(r), n.push({
|
|
4574
4789
|
field: r,
|
|
@@ -4593,10 +4808,10 @@ function Ri(e) {
|
|
|
4593
4808
|
maxBodyFields: e.maxBodyFields,
|
|
4594
4809
|
renderFields: t.values(),
|
|
4595
4810
|
fields: n,
|
|
4596
|
-
sourcePrecedence:
|
|
4811
|
+
sourcePrecedence: Yi
|
|
4597
4812
|
};
|
|
4598
4813
|
}
|
|
4599
|
-
function
|
|
4814
|
+
function la(e, t, n) {
|
|
4600
4815
|
return n && n.length > 0 ? {
|
|
4601
4816
|
source: "saved_view_columns",
|
|
4602
4817
|
columns: n
|
|
@@ -4608,10 +4823,10 @@ function zi(e, t, n) {
|
|
|
4608
4823
|
columns: t.columns
|
|
4609
4824
|
} : {
|
|
4610
4825
|
source: "entity_inference",
|
|
4611
|
-
columns:
|
|
4826
|
+
columns: ua(e)
|
|
4612
4827
|
};
|
|
4613
4828
|
}
|
|
4614
|
-
function
|
|
4829
|
+
function ua(e) {
|
|
4615
4830
|
if (!e) return [];
|
|
4616
4831
|
let t = [];
|
|
4617
4832
|
e.display.display_field && t.push(e.display.display_field);
|
|
@@ -4621,16 +4836,16 @@ function Bi(e) {
|
|
|
4621
4836
|
if (e.evidence_covered && t.push("$evidence"), e.files) for (let [n] of e.files) t.push(n);
|
|
4622
4837
|
return t;
|
|
4623
4838
|
}
|
|
4624
|
-
function
|
|
4839
|
+
function da(e, t, n) {
|
|
4625
4840
|
let r = new $();
|
|
4626
4841
|
for (let i of t) {
|
|
4627
|
-
let t =
|
|
4842
|
+
let t = fa(e, i, n);
|
|
4628
4843
|
t && r.add(t);
|
|
4629
4844
|
}
|
|
4630
4845
|
return r.values();
|
|
4631
4846
|
}
|
|
4632
|
-
function
|
|
4633
|
-
if (!t ||
|
|
4847
|
+
function fa(e, t, n) {
|
|
4848
|
+
if (!t || Xi.has(t)) return;
|
|
4634
4849
|
if (!e) return t.startsWith("$") ? void 0 : t;
|
|
4635
4850
|
if (t.startsWith("$status.")) {
|
|
4636
4851
|
let n = t.slice(8);
|
|
@@ -4645,55 +4860,55 @@ function Hi(e, t, n) {
|
|
|
4645
4860
|
let r = e.fields.get(t), i = e.files?.get(t);
|
|
4646
4861
|
if (!(!r && !i) && (n.explicit || !(r && r.display?.is_listable === !1) && !(i && i.display?.is_listable === !1))) return t;
|
|
4647
4862
|
}
|
|
4648
|
-
function
|
|
4649
|
-
return t.find((t) => n.exclude?.has(t) || !n.allowAuto &&
|
|
4863
|
+
function pa(e, t, n) {
|
|
4864
|
+
return t.find((t) => n.exclude?.has(t) || !n.allowAuto && ba(e, t) || !n.allowLong && xa(e, t) ? !1 : ya(e, t));
|
|
4650
4865
|
}
|
|
4651
|
-
function
|
|
4652
|
-
return !(!
|
|
4866
|
+
function ma(e, t) {
|
|
4867
|
+
return !(!ya(e, t) || ba(e, t) || xa(e, t));
|
|
4653
4868
|
}
|
|
4654
|
-
function
|
|
4655
|
-
return !(!
|
|
4869
|
+
function ha(e, t) {
|
|
4870
|
+
return !(!ya(e, t) || ba(e, t) || xa(e, t) || va(e, t) || ga(e, t));
|
|
4656
4871
|
}
|
|
4657
|
-
function
|
|
4872
|
+
function ga(e, t) {
|
|
4658
4873
|
if (t.startsWith("$status.") || t.startsWith("$property.") || t === "$evidence") return !0;
|
|
4659
|
-
let n =
|
|
4660
|
-
return n.kind === "field" &&
|
|
4874
|
+
let n = La(e, t);
|
|
4875
|
+
return n.kind === "field" && Qi.has(n.field.type);
|
|
4661
4876
|
}
|
|
4662
|
-
function
|
|
4877
|
+
function _a(e, t) {
|
|
4663
4878
|
let n = new $();
|
|
4664
4879
|
for (let e of t) (e.startsWith("$status.") || e.startsWith("$property.") || e === "$evidence") && n.add(e);
|
|
4665
|
-
for (let r of t)
|
|
4880
|
+
for (let r of t) ga(e, r) && n.add(r);
|
|
4666
4881
|
return n.values();
|
|
4667
4882
|
}
|
|
4668
|
-
function
|
|
4669
|
-
if (
|
|
4670
|
-
let n =
|
|
4671
|
-
return n.kind === "field" &&
|
|
4883
|
+
function va(e, t) {
|
|
4884
|
+
if (ba(e, t)) return !1;
|
|
4885
|
+
let n = La(e, t);
|
|
4886
|
+
return n.kind === "field" && $i.has(n.field.type);
|
|
4672
4887
|
}
|
|
4673
|
-
function
|
|
4674
|
-
return
|
|
4888
|
+
function ya(e, t) {
|
|
4889
|
+
return La(e, t).kind !== "missing";
|
|
4675
4890
|
}
|
|
4676
|
-
function
|
|
4677
|
-
let n =
|
|
4891
|
+
function ba(e, t) {
|
|
4892
|
+
let n = La(e, t);
|
|
4678
4893
|
return n.kind === "field" && (n.field.primary === !0 || n.field.auto === !0);
|
|
4679
4894
|
}
|
|
4680
|
-
function
|
|
4681
|
-
let n =
|
|
4682
|
-
return n.kind === "file" ? n.file.mode !== "single" : n.kind === "field" &&
|
|
4895
|
+
function xa(e, t) {
|
|
4896
|
+
let n = La(e, t);
|
|
4897
|
+
return n.kind === "file" ? n.file.mode !== "single" : n.kind === "field" && Zi.has(n.field.type);
|
|
4683
4898
|
}
|
|
4684
|
-
function
|
|
4899
|
+
function Sa(e, t) {
|
|
4685
4900
|
if (!e) return [];
|
|
4686
4901
|
let n = new $();
|
|
4687
4902
|
for (let r of fe(e)) n.add(r), t.addField(r, "identity");
|
|
4688
|
-
let r =
|
|
4689
|
-
r && (n.add(r), t.addField(r, "display"),
|
|
4690
|
-
for (let r of
|
|
4691
|
-
let i =
|
|
4692
|
-
i && (n.add(i), t.addField(i, "display_template"),
|
|
4903
|
+
let r = fa(e, e.display.display_field, { explicit: !0 });
|
|
4904
|
+
r && (n.add(r), t.addField(r, "display"), Fa(e, r, t, "display"));
|
|
4905
|
+
for (let r of Ca(e.display.display_template)) {
|
|
4906
|
+
let i = fa(e, r, { explicit: !0 });
|
|
4907
|
+
i && (n.add(i), t.addField(i, "display_template"), Fa(e, i, t, "display_template"));
|
|
4693
4908
|
}
|
|
4694
4909
|
return n.values();
|
|
4695
4910
|
}
|
|
4696
|
-
function
|
|
4911
|
+
function Ca(e) {
|
|
4697
4912
|
if (!e) return [];
|
|
4698
4913
|
let t = new $(), n = 0;
|
|
4699
4914
|
for (; n < e.length;) {
|
|
@@ -4703,14 +4918,14 @@ function $i(e) {
|
|
|
4703
4918
|
n = r + 2;
|
|
4704
4919
|
continue;
|
|
4705
4920
|
}
|
|
4706
|
-
let i =
|
|
4921
|
+
let i = wa(e, r + 2);
|
|
4707
4922
|
if (i < 0) break;
|
|
4708
|
-
for (let n of
|
|
4923
|
+
for (let n of Ta(e.slice(r + 2, i))) t.add(n);
|
|
4709
4924
|
n = i + 1;
|
|
4710
4925
|
}
|
|
4711
4926
|
return t.values();
|
|
4712
4927
|
}
|
|
4713
|
-
function
|
|
4928
|
+
function wa(e, t) {
|
|
4714
4929
|
let n = 0;
|
|
4715
4930
|
for (let r = t; r < e.length; r += 1) {
|
|
4716
4931
|
let t = e[r];
|
|
@@ -4725,62 +4940,71 @@ function ea(e, t) {
|
|
|
4725
4940
|
}
|
|
4726
4941
|
return -1;
|
|
4727
4942
|
}
|
|
4728
|
-
function
|
|
4943
|
+
function Ta(e) {
|
|
4729
4944
|
let t = new $(), n = 0;
|
|
4730
4945
|
for (; n < e.length;) {
|
|
4731
4946
|
let r = e.indexOf("row.", n);
|
|
4732
4947
|
if (r < 0) break;
|
|
4733
|
-
if (r > 0 &&
|
|
4948
|
+
if (r > 0 && Ea(e.charCodeAt(r - 1))) {
|
|
4734
4949
|
n = r + 4;
|
|
4735
4950
|
continue;
|
|
4736
4951
|
}
|
|
4737
4952
|
let i = r + 4, a = i;
|
|
4738
|
-
for (; a < e.length &&
|
|
4953
|
+
for (; a < e.length && Ea(e.charCodeAt(a));) a += 1;
|
|
4739
4954
|
a > i && t.add(e.slice(i, a)), n = a;
|
|
4740
4955
|
}
|
|
4741
4956
|
return t.values();
|
|
4742
4957
|
}
|
|
4743
|
-
function
|
|
4958
|
+
function Ea(e) {
|
|
4744
4959
|
return e >= 48 && e <= 57 || e >= 65 && e <= 90 || e >= 97 && e <= 122 || e === 95;
|
|
4745
4960
|
}
|
|
4746
|
-
function
|
|
4961
|
+
function Da(e, t, n) {
|
|
4747
4962
|
let r = new $();
|
|
4748
4963
|
for (let i of t) for (let t of i ?? []) for (let i of [
|
|
4749
4964
|
...t.action.visible_if ?? [],
|
|
4750
4965
|
...t.action.enabled_if ?? [],
|
|
4751
4966
|
...t.action.conditions ?? []
|
|
4752
4967
|
]) {
|
|
4753
|
-
let t =
|
|
4754
|
-
t && (r.add(t), n.addField(t, "condition"),
|
|
4968
|
+
let t = fa(e, i.field, { explicit: !0 });
|
|
4969
|
+
t && (r.add(t), n.addField(t, "condition"), Fa(e, t, n, "condition"));
|
|
4755
4970
|
}
|
|
4756
4971
|
return r.values();
|
|
4757
4972
|
}
|
|
4758
|
-
function
|
|
4759
|
-
let r = typeof t == "string" ?
|
|
4973
|
+
function Oa(e, t, n) {
|
|
4974
|
+
let r = typeof t == "string" ? Mi(t) : t ?? [], i = new $();
|
|
4760
4975
|
for (let t of r) {
|
|
4761
|
-
let r =
|
|
4762
|
-
r && (i.add(r), n.addField(r, "sort"),
|
|
4976
|
+
let r = fa(e, t.field, { explicit: !0 });
|
|
4977
|
+
r && (i.add(r), n.addField(r, "sort"), Fa(e, r, n, "sort"));
|
|
4763
4978
|
}
|
|
4764
4979
|
return i.values();
|
|
4765
4980
|
}
|
|
4766
|
-
function
|
|
4767
|
-
let i =
|
|
4768
|
-
|
|
4769
|
-
|
|
4981
|
+
function ka(e, t, n, r) {
|
|
4982
|
+
let i = new $(), a = t?.variants?.items() ?? [];
|
|
4983
|
+
if (a.length === 0 || a.some((e) => e.quick_peek === void 0)) for (let r of aa(e, t, n)) i.add(r);
|
|
4984
|
+
for (let r of a) {
|
|
4985
|
+
if (r.quick_peek === void 0) continue;
|
|
4986
|
+
let a = {
|
|
4987
|
+
...t,
|
|
4988
|
+
quick_peek: r.quick_peek
|
|
4989
|
+
};
|
|
4990
|
+
for (let t of aa(e, a, n)) i.add(t);
|
|
4991
|
+
}
|
|
4992
|
+
for (let t of i.values()) r.addField(t, "quick_peek"), Fa(e, t, r, "quick_peek");
|
|
4993
|
+
return i.values();
|
|
4770
4994
|
}
|
|
4771
|
-
function
|
|
4995
|
+
function Aa(e, t, n) {
|
|
4772
4996
|
if (Array.isArray(e)) {
|
|
4773
4997
|
for (let r of e) if (!(!r || typeof r != "object")) {
|
|
4774
4998
|
if ("section" in r) {
|
|
4775
|
-
let e = r.section, i =
|
|
4776
|
-
i && t.has(i) &&
|
|
4999
|
+
let e = r.section, i = Ma(e?.name);
|
|
5000
|
+
i && t.has(i) && ja(e?.items, n);
|
|
4777
5001
|
continue;
|
|
4778
5002
|
}
|
|
4779
|
-
"fields" in r &&
|
|
5003
|
+
"fields" in r && ja([r], n);
|
|
4780
5004
|
}
|
|
4781
5005
|
}
|
|
4782
5006
|
}
|
|
4783
|
-
function
|
|
5007
|
+
function ja(e, t) {
|
|
4784
5008
|
if (Array.isArray(e)) {
|
|
4785
5009
|
for (let n of e) if (!(!n || typeof n != "object")) {
|
|
4786
5010
|
if ("fields" in n) {
|
|
@@ -4793,11 +5017,11 @@ function sa(e, t) {
|
|
|
4793
5017
|
}
|
|
4794
5018
|
}
|
|
4795
5019
|
}
|
|
4796
|
-
"section" in n &&
|
|
5020
|
+
"section" in n && ja(n.section?.items, t);
|
|
4797
5021
|
}
|
|
4798
5022
|
}
|
|
4799
5023
|
}
|
|
4800
|
-
function
|
|
5024
|
+
function Ma(e) {
|
|
4801
5025
|
if (typeof e == "string") return e;
|
|
4802
5026
|
if (e && typeof e == "object") {
|
|
4803
5027
|
let t = Object.values(e).find((e) => typeof e == "string");
|
|
@@ -4805,21 +5029,21 @@ function ca(e) {
|
|
|
4805
5029
|
}
|
|
4806
5030
|
return "";
|
|
4807
5031
|
}
|
|
4808
|
-
function
|
|
5032
|
+
function Na(e) {
|
|
4809
5033
|
let t = [];
|
|
4810
5034
|
for (let [n, r] of e.fields) {
|
|
4811
5035
|
if (r.primary || r.auto || r.ref || r.array || r.structure || r.display?.is_listable === !1) continue;
|
|
4812
5036
|
let e = (r.type || "").toLowerCase(), i = !!(r.enum || r.values);
|
|
4813
|
-
if (!(!
|
|
5037
|
+
if (!(!ea.has(e) && !i) && (t.push(n), t.length >= 8)) break;
|
|
4814
5038
|
}
|
|
4815
5039
|
return t;
|
|
4816
5040
|
}
|
|
4817
|
-
function
|
|
5041
|
+
function Pa(e, t, n, r) {
|
|
4818
5042
|
if (!t || t.startsWith("$")) return;
|
|
4819
|
-
let i =
|
|
5043
|
+
let i = La(e, t);
|
|
4820
5044
|
i.kind !== "missing" && (n.add(t), i.kind === "file" && r.addField(t, "file_metadata"));
|
|
4821
5045
|
}
|
|
4822
|
-
function
|
|
5046
|
+
function Fa(e, t, n, r) {
|
|
4823
5047
|
if (t.startsWith("$status.")) {
|
|
4824
5048
|
n.addExpand("statuses", "status_expand"), r !== "status_expand" && n.addExpand("statuses", r), r !== "status_expand" && n.addField(t, r);
|
|
4825
5049
|
return;
|
|
@@ -4834,14 +5058,14 @@ function da(e, t, n, r) {
|
|
|
4834
5058
|
n.addExpand("evidence", "evidence_expand"), r !== "evidence_expand" && n.addExpand("evidence", r), r !== "evidence_expand" && n.addField(t, r);
|
|
4835
5059
|
return;
|
|
4836
5060
|
}
|
|
4837
|
-
let i =
|
|
5061
|
+
let i = La(e, t);
|
|
4838
5062
|
i.kind === "field" && i.field.type === "ref" && (n.addExpand("refs", "ref_expand"), r !== "ref_expand" && n.addExpand("refs", r));
|
|
4839
5063
|
}
|
|
4840
|
-
function
|
|
5064
|
+
function Ia(e) {
|
|
4841
5065
|
let t = e.snapshot().expand, n = [];
|
|
4842
5066
|
return t.refs && n.push("refs"), t.statuses && n.push("statuses"), t.properties && n.push("properties"), t.evidence && n.push("evidence"), n;
|
|
4843
5067
|
}
|
|
4844
|
-
function
|
|
5068
|
+
function La(e, t) {
|
|
4845
5069
|
if (!e) return { kind: t.startsWith("$") ? "synthetic" : "missing" };
|
|
4846
5070
|
if (t.startsWith("$status.")) return e.status_groups?.[t.slice(8)] ? { kind: "synthetic" } : { kind: "missing" };
|
|
4847
5071
|
if (t.startsWith("$property.")) return e.properties?.[t.slice(10)] ? { kind: "synthetic" } : { kind: "missing" };
|
|
@@ -4869,7 +5093,7 @@ var $ = class {
|
|
|
4869
5093
|
values() {
|
|
4870
5094
|
return [...this.#e];
|
|
4871
5095
|
}
|
|
4872
|
-
},
|
|
5096
|
+
}, Ra = class {
|
|
4873
5097
|
#e = /* @__PURE__ */ new Map();
|
|
4874
5098
|
#t = /* @__PURE__ */ new Map();
|
|
4875
5099
|
addField(e, t) {
|
|
@@ -4892,7 +5116,7 @@ var $ = class {
|
|
|
4892
5116
|
}
|
|
4893
5117
|
r.includes(n) || r.push(n);
|
|
4894
5118
|
}
|
|
4895
|
-
},
|
|
5119
|
+
}, za = class extends Ne {
|
|
4896
5120
|
constructor(e) {
|
|
4897
5121
|
super(e), this.state = {
|
|
4898
5122
|
hasError: !1,
|
|
@@ -4960,15 +5184,15 @@ var $ = class {
|
|
|
4960
5184
|
};
|
|
4961
5185
|
//#endregion
|
|
4962
5186
|
//#region src/hooks/useObject.ts
|
|
4963
|
-
function
|
|
5187
|
+
function Ba(e, t) {
|
|
4964
5188
|
return [
|
|
4965
5189
|
"entity-item",
|
|
4966
5190
|
e,
|
|
4967
5191
|
t === void 0 || t === "new" ? void 0 : typeof t == "string" ? t : Object.keys(t).sort().map((e) => [e, t[e]])
|
|
4968
5192
|
];
|
|
4969
5193
|
}
|
|
4970
|
-
function
|
|
4971
|
-
let n =
|
|
5194
|
+
function Va(e, t) {
|
|
5195
|
+
let n = Ba(e, t), r = n[2];
|
|
4972
5196
|
return He({
|
|
4973
5197
|
queryKey: n,
|
|
4974
5198
|
queryFn: () => x(e, t),
|
|
@@ -4977,15 +5201,15 @@ function _a(e, t) {
|
|
|
4977
5201
|
}
|
|
4978
5202
|
//#endregion
|
|
4979
5203
|
//#region src/components/detail-layout/widgets/registry.ts
|
|
4980
|
-
var
|
|
4981
|
-
function
|
|
4982
|
-
|
|
5204
|
+
var Ha = /* @__PURE__ */ new Map();
|
|
5205
|
+
function Ua(e, t) {
|
|
5206
|
+
Ha.set(e, t);
|
|
4983
5207
|
}
|
|
4984
|
-
function
|
|
4985
|
-
return
|
|
5208
|
+
function Wa(e) {
|
|
5209
|
+
return Ha.get(e);
|
|
4986
5210
|
}
|
|
4987
|
-
function
|
|
4988
|
-
return
|
|
5211
|
+
function Ga(e) {
|
|
5212
|
+
return Ha.has(e);
|
|
4989
5213
|
}
|
|
4990
5214
|
//#endregion
|
|
4991
|
-
export {
|
|
5215
|
+
export { Tn as $, wi as A, Cr as B, Pi as C, Ci as D, ki as E, Jr as F, nr as G, ir as H, Zr as I, er as J, zn as K, Yr as L, ri as M, Xr as N, Ti as O, $r as P, Cn as Q, zr as R, Li as S, Ai as T, rr as U, or as V, tr as W, In as X, Yn as Y, Ln as Z, Bi as _, kt as _t, Va as a, an as at, Fi as b, Ye as bt, na as c, Ut as ct, Ui as d, Bt as dt, On as et, Gi as f, jt as ft, Wi as g, bt as gt, zi as h, Et as ht, Ba as i, on as it, ui as j, Ei as k, aa as l, Wt as lt, Hi as m, At as mt, Ga as n, En as nt, za as o, Jt as ot, Vi as p, Mt as pt, Zn as q, Ua as r, sn as rt, ta as s, qt as st, Wa as t, Dn as tt, ia as u, Ht as ut, Ri as v, ct as vt, Ni as w, Mi as x, Je as xt, Ii as y, ft as yt, jr as z };
|