@declarion/react 0.54.0 → 0.54.1
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-CPoUY99R.js → DraggableChildrenTable-Djc7QDzR.js} +32 -32
- package/dist-lib/{Grid--QAEby8k.js → Grid-Bd2r0_4J.js} +45 -45
- package/dist-lib/{LayoutRenderer-BxZ7Nd9b.js → LayoutRenderer-V6nf9aa_.js} +716 -714
- package/dist-lib/{ListCardsBody-BPV4GPrv.js → ListCardsBody-Cdsvu0Vs.js} +29 -29
- package/dist-lib/{MarkdownRenderer-CIKuh_0i.js → MarkdownRenderer-CZo5ZgM7.js} +1 -1
- package/dist-lib/{RefreshControl-DMLkZP3R.js → RefreshControl-CJm3vz9p.js} +40 -40
- package/dist-lib/{SmartDetailPage.impl-SnNu6Ug-.js → SmartDetailPage.impl-DoIjCzjQ.js} +492 -492
- package/dist-lib/{SmartListPage.impl-C73pR7Iw.js → SmartListPage.impl-DnM8e14t.js} +743 -742
- package/dist-lib/{SmartRecordListPage.impl-rJjQZe1V.js → SmartRecordListPage.impl-BmHGYbD9.js} +128 -128
- package/dist-lib/{SortHeaderMenu-DQ_KrkWk.js → SortHeaderMenu-CA53NerB.js} +1 -1
- package/dist-lib/{action-dispatch-DsuUS7ae.js → action-dispatch-JcUrLFaW.js} +177 -177
- package/dist-lib/api/events.d.ts +13 -4
- package/dist-lib/{cardProjection-BadzqyeQ.js → cardProjection-Q2kwqv8V.js} +19 -19
- package/dist-lib/components/pages/list/ListToolbar.d.ts +5 -3
- package/dist-lib/components/pages/list/useListQuery.d.ts +1 -5
- package/dist-lib/{field-classification-sMkkAEg9.js → field-classification-ssZvtr8J.js} +268 -397
- package/dist-lib/{format-count-B5SLlNOb.js → format-count-DHuivNT7.js} +236 -236
- package/dist-lib/hooks/useEntityData.d.ts +7 -0
- package/dist-lib/hooks/useRealtimeThresholds.d.ts +1 -0
- package/dist-lib/hooks/useSSE.d.ts +0 -1
- package/dist-lib/index.js +806 -806
- package/dist-lib/lib/realtime-query-keys.d.ts +22 -0
- package/dist-lib/lib/realtime-reconcile.d.ts +0 -9
- package/dist-lib/lib/realtime-resync.d.ts +23 -0
- package/dist-lib/{peekDraftStore-CbHFwz_F.js → peekDraftStore-lm9ViVLA.js} +17 -17
- package/dist-lib/{registry-D0RhCnEL.js → registry-DsQFhEAD.js} +511 -511
- package/dist-lib/stores/realtime.d.ts +86 -19
- package/dist-lib/testing.js +40 -40
- package/dist-lib/{useCurrentScreen-DVTXCj_K.js → useCurrentScreen-aHx9HH1m.js} +2472 -1963
- package/dist-lib/useListQuery-DZn2BAxY.js +96 -0
- package/dist-lib/{useProperties-BcIz-MyO.js → useProperties-CAqKmUKg.js} +25 -25
- package/dist-lib/{useTabSearchMirror-UYCsopxP.js → useTabSearchMirror-DYW9WoK7.js} +10 -10
- package/dist-lib/{value-CQzGOI0F.js → value-CzKQPJOp.js} +4 -4
- package/package.json +4 -4
- package/dist-lib/useListQuery-C2nq58YV.js +0 -90
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { s as e } from "./DynamicIcon-DW5krHuX.js";
|
|
2
|
-
import {
|
|
3
|
-
import { a as
|
|
4
|
-
import { t as
|
|
5
|
-
import { C as
|
|
6
|
-
import { a as
|
|
7
|
-
import { c as
|
|
8
|
-
import { a as
|
|
9
|
-
import { l as
|
|
10
|
-
import { a as
|
|
11
|
-
import { t as mt } from "./useListQuery-
|
|
2
|
+
import { $n as t, Bn as n, Br as r, Er as i, Et as a, G as o, H as s, Ht as c, J as l, K as u, Kn as d, Lr as f, Mr as p, Or as m, Qn as h, R as g, Rr as _, U as v, V as y, Vr as b, Vt as x, Xt as S, Yn as C, Zn as w, _ as T, _t as E, ar as D, at as O, b as ee, dn as te, en as ne, er as k, et as re, g as A, h as j, i as M, jt as ie, kr as N, lr as P, m as F, mr as I, nr as L, nt as ae, p as R, qn as oe, rn as se, rt as ce, tn as le, tr as ue, un as de, v as fe, z as pe, zr as me } from "./useCurrentScreen-aHx9HH1m.js";
|
|
3
|
+
import { a as he, i as ge, m as _e, s as ve, t as ye } from "./RefreshControl-CJm3vz9p.js";
|
|
4
|
+
import { t as be } from "./Check-DAfMbQIw.js";
|
|
5
|
+
import { C as xe, M as Se, O as Ce, P as we, T as Te, l as Ee, n as De, p as Oe, u as ke, x as Ae } from "./field-classification-ssZvtr8J.js";
|
|
6
|
+
import { a as je, c as Me, f as Ne, h as Pe, l as Fe, m as Ie, n as Le, o as Re, p as ze, r as Be, t as Ve } from "./action-dispatch-JcUrLFaW.js";
|
|
7
|
+
import { c as He, i as Ue, n as We, o as Ge, r as Ke, s as qe, t as Je } from "./cardProjection-Q2kwqv8V.js";
|
|
8
|
+
import { a as Ye, c as Xe, d as Ze, f as Qe, l as $e, o as et, p as tt, s as nt, t as rt, u as z } from "./format-count-DHuivNT7.js";
|
|
9
|
+
import { l as it, m as at, n as ot, t as st } from "./useTabSearchMirror-DYW9WoK7.js";
|
|
10
|
+
import { a as ct, c as lt, i as ut, n as dt, o as B, s as ft, t as pt } from "./peekDraftStore-lm9ViVLA.js";
|
|
11
|
+
import { t as mt } from "./useListQuery-DZn2BAxY.js";
|
|
12
12
|
import { Suspense as ht, createElement as V, lazy as gt, memo as H, useCallback as U, useEffect as W, useMemo as G, useRef as K, useState as q } from "react";
|
|
13
13
|
import { useSearchParams as _t } from "react-router";
|
|
14
14
|
import { useQueries as vt, useQueryClient as yt } from "@tanstack/react-query";
|
|
@@ -32,71 +32,71 @@ var kt = Et({
|
|
|
32
32
|
];
|
|
33
33
|
//#endregion
|
|
34
34
|
//#region src/components/pages/list/filter-meta.ts
|
|
35
|
-
function jt(e,
|
|
36
|
-
if (!e || !
|
|
37
|
-
let
|
|
38
|
-
for (let
|
|
39
|
-
let
|
|
40
|
-
if (!
|
|
41
|
-
if (
|
|
42
|
-
let e =
|
|
43
|
-
if (!
|
|
44
|
-
|
|
45
|
-
code:
|
|
46
|
-
label:
|
|
35
|
+
function jt(e, n, r) {
|
|
36
|
+
if (!e || !n) return [];
|
|
37
|
+
let i = e.filters ?? n.fields.names(), a = e.filter_operators ?? {}, o = [];
|
|
38
|
+
for (let s of i) {
|
|
39
|
+
let i = a[s];
|
|
40
|
+
if (!i || i.length === 0) continue;
|
|
41
|
+
if (s.startsWith("$status.")) {
|
|
42
|
+
let e = s.slice(8), t = n.status_groups?.[e];
|
|
43
|
+
if (!t) continue;
|
|
44
|
+
o.push({
|
|
45
|
+
code: s,
|
|
46
|
+
label: L(t.name) || e,
|
|
47
47
|
type: "status",
|
|
48
|
-
operators:
|
|
49
|
-
options:
|
|
48
|
+
operators: i,
|
|
49
|
+
options: t.statuses.map((e) => ({
|
|
50
50
|
value: e.code,
|
|
51
|
-
label:
|
|
51
|
+
label: L(e.name) || e.code,
|
|
52
52
|
color: e.color
|
|
53
53
|
}))
|
|
54
54
|
});
|
|
55
55
|
continue;
|
|
56
56
|
}
|
|
57
|
-
if (
|
|
58
|
-
let e =
|
|
59
|
-
if (!
|
|
60
|
-
|
|
61
|
-
code:
|
|
62
|
-
label:
|
|
57
|
+
if (s.startsWith("$property.")) {
|
|
58
|
+
let e = s.slice(10), t = n.properties?.[e];
|
|
59
|
+
if (!t) continue;
|
|
60
|
+
o.push({
|
|
61
|
+
code: s,
|
|
62
|
+
label: L(t.name) || e,
|
|
63
63
|
type: "property",
|
|
64
|
-
operators:
|
|
64
|
+
operators: i
|
|
65
65
|
});
|
|
66
66
|
continue;
|
|
67
67
|
}
|
|
68
|
-
let
|
|
69
|
-
if (!
|
|
70
|
-
let
|
|
68
|
+
let c = n.fields.get(s);
|
|
69
|
+
if (!c) continue;
|
|
70
|
+
let l = t(c, s, r), u = c.values?.map((e) => ({
|
|
71
71
|
value: e.code,
|
|
72
|
-
label:
|
|
72
|
+
label: L(e.name) || e.code,
|
|
73
73
|
color: e.color
|
|
74
|
-
})),
|
|
75
|
-
|
|
76
|
-
code:
|
|
77
|
-
label:
|
|
78
|
-
type:
|
|
79
|
-
operators:
|
|
80
|
-
options:
|
|
81
|
-
ref:
|
|
82
|
-
specialValues:
|
|
74
|
+
})), d = C(c.filter_special_values, e?.filter_special_values?.[s]);
|
|
75
|
+
o.push({
|
|
76
|
+
code: s,
|
|
77
|
+
label: l,
|
|
78
|
+
type: c.type,
|
|
79
|
+
operators: i,
|
|
80
|
+
options: u,
|
|
81
|
+
ref: c.ref,
|
|
82
|
+
specialValues: d.length > 0 ? d : void 0
|
|
83
83
|
});
|
|
84
84
|
}
|
|
85
|
-
return
|
|
85
|
+
return o;
|
|
86
86
|
}
|
|
87
87
|
//#endregion
|
|
88
88
|
//#region src/components/pages/list/useListSort.ts
|
|
89
89
|
function Mt({ searchParams: e, setSearchParams: t, screenSortDefault: n, commitScreenTabSearch: r }) {
|
|
90
|
-
let i = e.get("sort") ?? n ?? "", a = G(() =>
|
|
90
|
+
let i = e.get("sort") ?? n ?? "", a = G(() => j(i), [i]), o = G(() => {
|
|
91
91
|
let e = /* @__PURE__ */ new Map();
|
|
92
92
|
for (let t of a) t.nulls && e.set(t.field, t.nulls);
|
|
93
93
|
return e;
|
|
94
|
-
}, [a]), s = G(() =>
|
|
94
|
+
}, [a]), s = G(() => fe(i), [i]), c = G(() => a.map((e) => ({
|
|
95
95
|
id: e.field,
|
|
96
96
|
desc: e.dir === "desc"
|
|
97
97
|
})), [a]), l = U((n) => {
|
|
98
98
|
let i = n.slice(0, 5), a = new URLSearchParams(e);
|
|
99
|
-
i.length === 0 ? a.delete("sort") : a.set("sort",
|
|
99
|
+
i.length === 0 ? a.delete("sort") : a.set("sort", T(i)), a.set("page", "1"), r(a.toString()), t(a);
|
|
100
100
|
}, [
|
|
101
101
|
e,
|
|
102
102
|
r,
|
|
@@ -113,13 +113,13 @@ function Mt({ searchParams: e, setSearchParams: t, screenSortDefault: n, commitS
|
|
|
113
113
|
dir: t,
|
|
114
114
|
...n ? { nulls: n } : {}
|
|
115
115
|
}]), [l]),
|
|
116
|
-
shiftClickColumn: U((e) => l(
|
|
117
|
-
appendColumn: U((e, t, n) => l(
|
|
116
|
+
shiftClickColumn: U((e) => l(F(a, e)), [a, l]),
|
|
117
|
+
appendColumn: U((e, t, n) => l(R(a, {
|
|
118
118
|
field: e,
|
|
119
119
|
dir: t,
|
|
120
120
|
...n ? { nulls: n } : {}
|
|
121
121
|
})), [a, l]),
|
|
122
|
-
clearColumn: U((e) => l(
|
|
122
|
+
clearColumn: U((e) => l(A(a, e)), [a, l]),
|
|
123
123
|
clearAll: U(() => l([]), [l])
|
|
124
124
|
};
|
|
125
125
|
}
|
|
@@ -127,15 +127,15 @@ function Mt({ searchParams: e, setSearchParams: t, screenSortDefault: n, commitS
|
|
|
127
127
|
//#region src/components/pages/list/useListSelection.ts
|
|
128
128
|
var Nt = {};
|
|
129
129
|
function Pt(e, t) {
|
|
130
|
-
return
|
|
130
|
+
return D(e, h(e, t));
|
|
131
131
|
}
|
|
132
132
|
function Ft(e, t, n) {
|
|
133
133
|
if (!e || n.length === 0) return [];
|
|
134
134
|
let r = new Set(n);
|
|
135
|
-
return t.filter((t) => r.has(Pt(e, t))).map((t) =>
|
|
135
|
+
return t.filter((t) => r.has(Pt(e, t))).map((t) => h(e, t));
|
|
136
136
|
}
|
|
137
137
|
function It(e, t, n) {
|
|
138
|
-
let [r, i] =
|
|
138
|
+
let [r, i] = Ze("selection", Nt, { scope: "path" }), a = G(() => e?.fields.names().find((t) => e.fields.get(t)?.primary) ?? "id", [e]), o = U((t) => e ? Pt(e, t) : I(t[a]), [e, a]), s = G(() => Object.keys(r).filter((e) => r[e]), [r]), c = G(() => Ft(e, t, s), [
|
|
139
139
|
e,
|
|
140
140
|
t,
|
|
141
141
|
s
|
|
@@ -181,7 +181,7 @@ function Lt({ screenCode: e, screen: t, searchParams: n, setSearchParams: r }) {
|
|
|
181
181
|
n,
|
|
182
182
|
t?.default_columns,
|
|
183
183
|
t?.columns
|
|
184
|
-
]), { widths: a, prune: o, setWidths: s, resetWidths: c, resizeEduShown: l, markResizeEduShown: u } =
|
|
184
|
+
]), { widths: a, prune: o, setWidths: s, resetWidths: c, resizeEduShown: l, markResizeEduShown: u } = xe(e), [d, f] = q(() => a);
|
|
185
185
|
W(() => {
|
|
186
186
|
f(a);
|
|
187
187
|
}, [a]);
|
|
@@ -212,7 +212,7 @@ function Lt({ screenCode: e, screen: t, searchParams: n, setSearchParams: r }) {
|
|
|
212
212
|
[a[n], a[r]] = [a[r], a[n]], m(a);
|
|
213
213
|
}, [i, m]),
|
|
214
214
|
commitResize: U((e) => {
|
|
215
|
-
s(e), !l && (u(),
|
|
215
|
+
s(e), !l && (u(), ie.info("Column width saved on this device", "Widths are personal and never shared. Column order, sort and filters can be saved into a view."));
|
|
216
216
|
}, [
|
|
217
217
|
s,
|
|
218
218
|
l,
|
|
@@ -306,107 +306,107 @@ function Vt(e) {
|
|
|
306
306
|
}
|
|
307
307
|
//#endregion
|
|
308
308
|
//#region src/components/pages/list/useListRowInteraction.ts
|
|
309
|
-
function Ht({ entity: e, screen:
|
|
310
|
-
let [
|
|
309
|
+
function Ht({ entity: e, screen: n, screens: r, entities: i, searchParams: a, tabNavigate: o, commitScreenTabSearch: s, isPhone: c, canUpdate: l }) {
|
|
310
|
+
let [u, d] = q(null), [f, p] = q(null), m = K(null), g = K(null);
|
|
311
311
|
W(() => () => {
|
|
312
|
-
|
|
312
|
+
g.current && clearTimeout(g.current.timer);
|
|
313
313
|
}, []);
|
|
314
|
-
let
|
|
315
|
-
if (!e || !
|
|
316
|
-
let c =
|
|
317
|
-
if (!
|
|
318
|
-
if (
|
|
319
|
-
|
|
320
|
-
let [e, t] =
|
|
321
|
-
n.set("edit", "true"),
|
|
314
|
+
let _ = n?.on_row_click === "peek" && n.quick_peek?.enabled !== !1 && !c, v = U((t, i) => {
|
|
315
|
+
if (!e || !n) return;
|
|
316
|
+
let c = h(e, t), l = D(e, c), u = oe(n, e, r, c);
|
|
317
|
+
if (!u) return;
|
|
318
|
+
if (i?.draft) {
|
|
319
|
+
dt(l, i.draft);
|
|
320
|
+
let [e, t] = u.split("?", 2), n = new URLSearchParams(t ?? "");
|
|
321
|
+
n.set("edit", "true"), u = `${e}?${n.toString()}`;
|
|
322
322
|
}
|
|
323
|
-
let
|
|
324
|
-
|
|
325
|
-
title:
|
|
326
|
-
icon:
|
|
323
|
+
let d = k(t, e) ?? L(e.display.name), f = n.display?.icon || e.display.icon;
|
|
324
|
+
s(a.toString()), o(u, {
|
|
325
|
+
title: d,
|
|
326
|
+
icon: f
|
|
327
327
|
});
|
|
328
328
|
}, [
|
|
329
329
|
e,
|
|
330
|
-
t,
|
|
331
330
|
n,
|
|
332
|
-
|
|
331
|
+
r,
|
|
333
332
|
a,
|
|
334
|
-
o
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
t
|
|
333
|
+
o,
|
|
334
|
+
s
|
|
335
|
+
]), y = Vt(U((e) => {
|
|
336
|
+
let t = m.current;
|
|
337
|
+
t && p({
|
|
338
338
|
x: e.x,
|
|
339
339
|
y: e.y,
|
|
340
340
|
row: t
|
|
341
341
|
});
|
|
342
|
-
}, [])),
|
|
343
|
-
if (
|
|
344
|
-
if (!
|
|
345
|
-
|
|
342
|
+
}, [])), b = U((t, n) => {
|
|
343
|
+
if (y.consumePressFired() || zt(t.target)) return;
|
|
344
|
+
if (!_ || !e) {
|
|
345
|
+
v(n);
|
|
346
346
|
return;
|
|
347
347
|
}
|
|
348
348
|
let r = Pt(e, n);
|
|
349
|
-
if (Bt(
|
|
350
|
-
clearTimeout(
|
|
349
|
+
if (Bt(g.current, r) === "double") {
|
|
350
|
+
clearTimeout(g.current.timer), g.current = null, d(null), v(n);
|
|
351
351
|
return;
|
|
352
352
|
}
|
|
353
|
-
|
|
353
|
+
g.current && clearTimeout(g.current.timer);
|
|
354
354
|
let i = setTimeout(() => {
|
|
355
|
-
|
|
355
|
+
g.current = null, d(n);
|
|
356
356
|
}, 250);
|
|
357
|
-
|
|
357
|
+
g.current = {
|
|
358
358
|
rowId: r,
|
|
359
359
|
timer: i
|
|
360
360
|
};
|
|
361
361
|
}, [
|
|
362
362
|
e,
|
|
363
|
+
_,
|
|
363
364
|
v,
|
|
364
|
-
y
|
|
365
|
-
b
|
|
365
|
+
y
|
|
366
366
|
]);
|
|
367
367
|
return {
|
|
368
|
-
peekAllowed:
|
|
369
|
-
peekRow:
|
|
370
|
-
setPeekRow:
|
|
368
|
+
peekAllowed: _,
|
|
369
|
+
peekRow: u,
|
|
370
|
+
setPeekRow: d,
|
|
371
371
|
peekFields: G(() => {
|
|
372
|
-
if (!
|
|
373
|
-
let
|
|
374
|
-
return
|
|
375
|
-
if (e.files?.get(
|
|
376
|
-
key:
|
|
377
|
-
label:
|
|
372
|
+
if (!_ || !e || !u) return [];
|
|
373
|
+
let a = Be(e, n, u);
|
|
374
|
+
return Ke(e, a, r).map((n) => {
|
|
375
|
+
if (e.files?.get(n)) return {
|
|
376
|
+
key: n,
|
|
377
|
+
label: Ie(e, n, i),
|
|
378
378
|
kind: "file",
|
|
379
|
-
readOnly: !
|
|
379
|
+
readOnly: !l
|
|
380
380
|
};
|
|
381
|
-
let
|
|
381
|
+
let r = e.fields.get(n), a = l && !r.primary && !r.auto && !r.ref && r.files?.mode !== "rich_text_inline";
|
|
382
382
|
return {
|
|
383
|
-
key:
|
|
384
|
-
label:
|
|
383
|
+
key: n,
|
|
384
|
+
label: t(r, n, i),
|
|
385
385
|
kind: "field",
|
|
386
|
-
field:
|
|
387
|
-
readOnly: !
|
|
386
|
+
field: r,
|
|
387
|
+
readOnly: !a
|
|
388
388
|
};
|
|
389
389
|
});
|
|
390
390
|
}, [
|
|
391
|
-
|
|
392
|
-
|
|
391
|
+
_,
|
|
392
|
+
u,
|
|
393
393
|
e,
|
|
394
|
-
t,
|
|
395
|
-
r,
|
|
396
394
|
n,
|
|
397
|
-
|
|
395
|
+
i,
|
|
396
|
+
r,
|
|
397
|
+
l
|
|
398
398
|
]),
|
|
399
399
|
peekActions: G(() => e?.actions ?? {}, [e?.actions]),
|
|
400
400
|
peekExecute: U(async (t, n, r) => {
|
|
401
|
-
let i = e?.fields.names().find((t) => e.fields.get(t)?.primary), a = i &&
|
|
402
|
-
return
|
|
403
|
-
}, [e,
|
|
404
|
-
contextMenu:
|
|
405
|
-
setContextMenu:
|
|
406
|
-
pressedRow:
|
|
407
|
-
longPress:
|
|
408
|
-
onRowClick:
|
|
409
|
-
navigateToDetail:
|
|
401
|
+
let i = e?.fields.names().find((t) => e.fields.get(t)?.primary), a = i && u ? [I(u[i])] : void 0, o = n.entity ? `${n.entity}.${t}` : t;
|
|
402
|
+
return ne(o, S(r, a));
|
|
403
|
+
}, [e, u]),
|
|
404
|
+
contextMenu: f,
|
|
405
|
+
setContextMenu: p,
|
|
406
|
+
pressedRow: m,
|
|
407
|
+
longPress: y,
|
|
408
|
+
onRowClick: b,
|
|
409
|
+
navigateToDetail: v
|
|
410
410
|
};
|
|
411
411
|
}
|
|
412
412
|
//#endregion
|
|
@@ -443,7 +443,7 @@ function Jt(e, t) {
|
|
|
443
443
|
}
|
|
444
444
|
//#endregion
|
|
445
445
|
//#region src/components/pages/list/ListTable.tsx
|
|
446
|
-
var Yt = gt(() => import("./SortHeaderMenu-
|
|
446
|
+
var Yt = gt(() => import("./SortHeaderMenu-CA53NerB.js").then((e) => ({ default: e.SortHeaderMenu }))), Xt = H(function({ virtualItems: e, topPad: t, bottomPad: n, colSpan: r, rows: i, renderRow: a }) {
|
|
447
447
|
return /* @__PURE__ */ X("tbody", { children: [
|
|
448
448
|
e.length > 0 && /* @__PURE__ */ Y("tr", { children: /* @__PURE__ */ Y("td", {
|
|
449
449
|
style: { height: t },
|
|
@@ -683,52 +683,52 @@ function $t({ row: e, rowIndex: t, entity: n, hasSoftDelete: r, zebra: i, hasDet
|
|
|
683
683
|
//#endregion
|
|
684
684
|
//#region src/components/pages/list/ListNoRows.tsx
|
|
685
685
|
function en(e) {
|
|
686
|
-
if (e instanceof
|
|
686
|
+
if (e instanceof n) {
|
|
687
687
|
let t = e.ext("field"), n = e.ext("value");
|
|
688
688
|
return t && n !== void 0 ? `${e.message} ${t}: "${n}"` : t ? `${e.message} ${t}` : e.message;
|
|
689
689
|
}
|
|
690
690
|
return e instanceof Error && e.message ? e.message : "Something went wrong. Please try again.";
|
|
691
691
|
}
|
|
692
|
-
function tn({ isLoading: e, tableLoadingStale: t, isError: n, error: r, rowCount:
|
|
693
|
-
let
|
|
692
|
+
function tn({ isLoading: e, tableLoadingStale: t, isError: n, error: r, rowCount: i, entity: o, screen: s, screenName: c, screenIcon: l, isFiltered: u, canCreate: d, toolbarActions: f, onRetry: p }) {
|
|
693
|
+
let m = o.display;
|
|
694
694
|
return e && t ? /* @__PURE__ */ Y("div", {
|
|
695
695
|
style: { padding: "0 20px" },
|
|
696
|
-
children: /* @__PURE__ */ Y(
|
|
696
|
+
children: /* @__PURE__ */ Y(z, {
|
|
697
697
|
icon: "alert-circle",
|
|
698
698
|
title: "Still loading data",
|
|
699
699
|
description: "This table is taking longer than expected. Retry the request or check network and server health.",
|
|
700
|
-
action: /* @__PURE__ */ Y(
|
|
700
|
+
action: /* @__PURE__ */ Y(b, {
|
|
701
701
|
kind: "primary",
|
|
702
702
|
size: "sm",
|
|
703
|
-
onClick:
|
|
703
|
+
onClick: p,
|
|
704
704
|
children: "Retry"
|
|
705
705
|
})
|
|
706
706
|
})
|
|
707
|
-
}) : e ? /* @__PURE__ */ Y(
|
|
707
|
+
}) : e ? /* @__PURE__ */ Y(Ge, { cols: s.columns?.length ?? 4 }) : n ? /* @__PURE__ */ Y("div", {
|
|
708
708
|
style: { padding: "0 20px" },
|
|
709
|
-
children: /* @__PURE__ */ Y(
|
|
709
|
+
children: /* @__PURE__ */ Y(z, {
|
|
710
710
|
icon: "alert-circle",
|
|
711
711
|
title: "Failed to load data",
|
|
712
712
|
description: en(r),
|
|
713
|
-
action: /* @__PURE__ */ Y(
|
|
713
|
+
action: /* @__PURE__ */ Y(b, {
|
|
714
714
|
kind: "primary",
|
|
715
715
|
size: "sm",
|
|
716
|
-
onClick:
|
|
716
|
+
onClick: p,
|
|
717
717
|
children: "Retry"
|
|
718
718
|
})
|
|
719
719
|
})
|
|
720
|
-
}) :
|
|
720
|
+
}) : i === 0 ? /* @__PURE__ */ Y("div", {
|
|
721
721
|
style: { padding: "0 20px" },
|
|
722
722
|
children: (() => {
|
|
723
|
-
let e =
|
|
723
|
+
let e = m.empty_state, t = L(e?.title), n = L(e?.body), r = a(e?.learn_more_url), i = u ? "No results found" : t || `No ${L(m.name_plural).toLowerCase() || c.toLowerCase()} yet`, o = d && f.some(({ code: e }) => e === "__new" || e === "__create"), s;
|
|
724
724
|
return s = u ? "Try adjusting your search or filters" : n ? /* @__PURE__ */ X(J, { children: [n, r && /* @__PURE__ */ X(J, { children: [" ", /* @__PURE__ */ Y("a", {
|
|
725
725
|
href: r,
|
|
726
726
|
target: "_blank",
|
|
727
727
|
rel: "noopener noreferrer",
|
|
728
728
|
children: "Learn more"
|
|
729
|
-
})] })] }) : o ? `Create your first ${
|
|
729
|
+
})] })] }) : o ? `Create your first ${L(m.name).toLowerCase()} to get started` : void 0, /* @__PURE__ */ Y(z, {
|
|
730
730
|
icon: l,
|
|
731
|
-
title:
|
|
731
|
+
title: i,
|
|
732
732
|
description: s
|
|
733
733
|
});
|
|
734
734
|
})()
|
|
@@ -736,15 +736,15 @@ function tn({ isLoading: e, tableLoadingStale: t, isError: n, error: r, rowCount
|
|
|
736
736
|
}
|
|
737
737
|
//#endregion
|
|
738
738
|
//#region src/components/pages/list/ListFooter.tsx
|
|
739
|
-
function nn({ meta: t, isCursor:
|
|
740
|
-
let b =
|
|
741
|
-
return !t && !
|
|
739
|
+
function nn({ meta: t, isCursor: n, isPhone: i, rowsLoaded: a, selectedCount: o, countTotal: s, countStrategy: c, countLoading: l, countError: u, page: d, totalPages: f, goToPage: p, perPage: h, setPerPage: g, hasMorePages: _, fetchNextPage: v, isFetchingNextPage: y }) {
|
|
740
|
+
let b = ve("list");
|
|
741
|
+
return !t && !n ? null : /* @__PURE__ */ X("div", {
|
|
742
742
|
style: {
|
|
743
743
|
display: "flex",
|
|
744
744
|
alignItems: "center",
|
|
745
745
|
paddingTop: 8,
|
|
746
746
|
paddingBottom: 8,
|
|
747
|
-
...i ?
|
|
747
|
+
...i ? Te(12) : {
|
|
748
748
|
paddingLeft: 14,
|
|
749
749
|
paddingRight: 14
|
|
750
750
|
},
|
|
@@ -764,10 +764,10 @@ function nn({ meta: t, isCursor: r, isPhone: i, rowsLoaded: a, selectedCount: s,
|
|
|
764
764
|
alignItems: "center",
|
|
765
765
|
gap: 5
|
|
766
766
|
},
|
|
767
|
-
children:
|
|
767
|
+
children: s === void 0 ? l && !u ? /* @__PURE__ */ Y("span", {
|
|
768
768
|
"data-testid": "list-footer-count-pending",
|
|
769
769
|
style: { display: "inline-flex" },
|
|
770
|
-
children: /* @__PURE__ */ Y(
|
|
770
|
+
children: /* @__PURE__ */ Y(m, { size: 11 })
|
|
771
771
|
}) : /* @__PURE__ */ X(J, { children: [
|
|
772
772
|
a,
|
|
773
773
|
" ",
|
|
@@ -775,9 +775,9 @@ function nn({ meta: t, isCursor: r, isPhone: i, rowsLoaded: a, selectedCount: s,
|
|
|
775
775
|
] }) : /* @__PURE__ */ X(J, { children: [
|
|
776
776
|
a,
|
|
777
777
|
" of ",
|
|
778
|
-
|
|
778
|
+
rt(s, c ?? "exact"),
|
|
779
779
|
" ",
|
|
780
|
-
|
|
780
|
+
s === 1 ? "record" : "records"
|
|
781
781
|
] })
|
|
782
782
|
}), /* @__PURE__ */ Y("span", { children: "·" })] }),
|
|
783
783
|
/* @__PURE__ */ X("span", { children: [
|
|
@@ -789,7 +789,7 @@ function nn({ meta: t, isCursor: r, isPhone: i, rowsLoaded: a, selectedCount: s,
|
|
|
789
789
|
color: "var(--text-2)",
|
|
790
790
|
fontWeight: 500
|
|
791
791
|
},
|
|
792
|
-
children:
|
|
792
|
+
children: o
|
|
793
793
|
})
|
|
794
794
|
] }),
|
|
795
795
|
/* @__PURE__ */ Y("div", { style: { flex: i ? "1 1 100%" : 1 } }),
|
|
@@ -812,7 +812,7 @@ function nn({ meta: t, isCursor: r, isPhone: i, rowsLoaded: a, selectedCount: s,
|
|
|
812
812
|
children: e
|
|
813
813
|
}, e))
|
|
814
814
|
}),
|
|
815
|
-
|
|
815
|
+
n ? _ && /* @__PURE__ */ X("button", {
|
|
816
816
|
type: "button",
|
|
817
817
|
className: "num",
|
|
818
818
|
"data-testid": "list-footer-load-more",
|
|
@@ -829,34 +829,34 @@ function nn({ meta: t, isCursor: r, isPhone: i, rowsLoaded: a, selectedCount: s,
|
|
|
829
829
|
color: "var(--text-2)",
|
|
830
830
|
cursor: y ? "default" : "pointer"
|
|
831
831
|
},
|
|
832
|
-
children: [y ? /* @__PURE__ */ Y(
|
|
833
|
-
}) : (_ ||
|
|
832
|
+
children: [y ? /* @__PURE__ */ Y(m, { size: 11 }) : null, "Load more"]
|
|
833
|
+
}) : (_ || d > 1) && /* @__PURE__ */ X("div", {
|
|
834
834
|
style: {
|
|
835
835
|
display: "flex",
|
|
836
836
|
alignItems: "center",
|
|
837
837
|
gap: 4
|
|
838
838
|
},
|
|
839
839
|
children: [
|
|
840
|
-
/* @__PURE__ */ Y(
|
|
840
|
+
/* @__PURE__ */ Y(r, {
|
|
841
841
|
size: 22,
|
|
842
842
|
icon: /* @__PURE__ */ Y(e.left, { size: 12 }),
|
|
843
|
-
onClick: () =>
|
|
844
|
-
disabled:
|
|
843
|
+
onClick: () => p(d - 1),
|
|
844
|
+
disabled: d <= 1
|
|
845
845
|
}),
|
|
846
846
|
/* @__PURE__ */ X("span", {
|
|
847
847
|
className: "num",
|
|
848
848
|
style: { padding: "0 6px" },
|
|
849
849
|
children: [
|
|
850
850
|
"Page ",
|
|
851
|
-
|
|
852
|
-
|
|
851
|
+
d,
|
|
852
|
+
f === void 0 ? "" : ` of ${f}`
|
|
853
853
|
]
|
|
854
854
|
}),
|
|
855
|
-
/* @__PURE__ */ Y(
|
|
855
|
+
/* @__PURE__ */ Y(r, {
|
|
856
856
|
size: 22,
|
|
857
857
|
icon: /* @__PURE__ */ Y(e.right, { size: 12 }),
|
|
858
|
-
onClick: () =>
|
|
859
|
-
disabled:
|
|
858
|
+
onClick: () => p(d + 1),
|
|
859
|
+
disabled: f === void 0 ? !_ : d >= f
|
|
860
860
|
})
|
|
861
861
|
]
|
|
862
862
|
})
|
|
@@ -872,20 +872,20 @@ function an(e) {
|
|
|
872
872
|
return e == null ? "all matching rows" : `${e.toLocaleString()} ${e === 1 ? "row" : "rows"}`;
|
|
873
873
|
}
|
|
874
874
|
function on(t) {
|
|
875
|
-
let { isPhone:
|
|
875
|
+
let { isPhone: r } = p(), { entityCode: i, entity: a, screen: o, viewState: s, visibleColumns: c, selectedRowPKs: l, totalRows: u, pageSize: d, locale: m, align: h = "end", variant: g = "toolbar", onBeforeOpen: _ } = t, [v, y] = q(!1), [x, S] = q(!1), [C, w] = q(null), T = K(null), E = rn(a.export), D = rn(o?.export);
|
|
876
876
|
if (!E || !D) return null;
|
|
877
|
-
async function
|
|
877
|
+
async function O(e) {
|
|
878
878
|
w(null), S(!0);
|
|
879
879
|
try {
|
|
880
|
-
let t =
|
|
880
|
+
let t = lt(s, {
|
|
881
881
|
scope: e,
|
|
882
|
-
visibleColumns:
|
|
883
|
-
selectedRowPKs: e === "selected_rows" ?
|
|
882
|
+
visibleColumns: c,
|
|
883
|
+
selectedRowPKs: e === "selected_rows" ? l : void 0,
|
|
884
884
|
locale: m
|
|
885
|
-
}), { blob: n, filename: r } = await
|
|
886
|
-
cn(n, r || `${i}-${sn()}.csv`),
|
|
885
|
+
}), { blob: n, filename: r } = await le(i, t);
|
|
886
|
+
cn(n, r || `${i}-${sn()}.csv`), y(!1);
|
|
887
887
|
} catch (e) {
|
|
888
|
-
let t = e instanceof
|
|
888
|
+
let t = e instanceof n ? {
|
|
889
889
|
code: e.code,
|
|
890
890
|
message: e.message
|
|
891
891
|
} : {
|
|
@@ -897,58 +897,58 @@ function on(t) {
|
|
|
897
897
|
S(!1);
|
|
898
898
|
}
|
|
899
899
|
}
|
|
900
|
-
if (
|
|
901
|
-
let t = x ||
|
|
902
|
-
return /* @__PURE__ */ Y(
|
|
900
|
+
if (g === "selection-menu-item") {
|
|
901
|
+
let t = x || l.length === 0;
|
|
902
|
+
return /* @__PURE__ */ Y(N, {
|
|
903
903
|
icon: /* @__PURE__ */ Y(e.download, { size: 12 }),
|
|
904
904
|
"data-testid": "export-selection-menu-item",
|
|
905
905
|
onClick: t ? void 0 : () => {
|
|
906
|
-
|
|
906
|
+
_?.(), O("selected_rows");
|
|
907
907
|
},
|
|
908
908
|
children: x ? "Exporting…" : "Export selection (CSV)"
|
|
909
909
|
});
|
|
910
910
|
}
|
|
911
|
-
let
|
|
912
|
-
return /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y(
|
|
911
|
+
let ee = l.length > 0, te = a.list_pagination === "cursor";
|
|
912
|
+
return /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y(b, {
|
|
913
913
|
ref: T,
|
|
914
914
|
kind: "ghost",
|
|
915
915
|
size: "sm",
|
|
916
916
|
icon: /* @__PURE__ */ Y(e.download, { size: 12 }),
|
|
917
917
|
onClick: () => {
|
|
918
|
-
|
|
918
|
+
_?.(), y((e) => !e);
|
|
919
919
|
},
|
|
920
920
|
disabled: x,
|
|
921
921
|
"aria-label": "Export",
|
|
922
922
|
title: "Export",
|
|
923
|
-
children:
|
|
924
|
-
}), /* @__PURE__ */ X(
|
|
925
|
-
open:
|
|
923
|
+
children: r ? null : x ? "Exporting…" : "Export"
|
|
924
|
+
}), /* @__PURE__ */ X(f, {
|
|
925
|
+
open: v,
|
|
926
926
|
anchor: T.current,
|
|
927
|
-
onClose: () =>
|
|
928
|
-
align:
|
|
927
|
+
onClose: () => y(!1),
|
|
928
|
+
align: h,
|
|
929
929
|
width: 260,
|
|
930
930
|
children: [
|
|
931
|
-
/* @__PURE__ */ X(
|
|
931
|
+
/* @__PURE__ */ X(N, {
|
|
932
932
|
icon: /* @__PURE__ */ Y(e.download, { size: 12 }),
|
|
933
|
-
onClick: x ? void 0 : () => void
|
|
934
|
-
children: ["Current view (CSV) · ", an(
|
|
933
|
+
onClick: x ? void 0 : () => void O("current_view"),
|
|
934
|
+
children: ["Current view (CSV) · ", an(u)]
|
|
935
935
|
}),
|
|
936
|
-
|
|
936
|
+
ee && /* @__PURE__ */ X(N, {
|
|
937
937
|
icon: /* @__PURE__ */ Y(e.check, { size: 12 }),
|
|
938
|
-
onClick: x ? void 0 : () => void
|
|
939
|
-
children: ["Selected rows (CSV) · ",
|
|
938
|
+
onClick: x ? void 0 : () => void O("selected_rows"),
|
|
939
|
+
children: ["Selected rows (CSV) · ", l.length]
|
|
940
940
|
}),
|
|
941
|
-
|
|
941
|
+
te ? /* @__PURE__ */ Y(N, {
|
|
942
942
|
icon: /* @__PURE__ */ Y(e.columns, { size: 12 }),
|
|
943
943
|
"data-testid": "export-current-page-disabled",
|
|
944
944
|
disabled: !0,
|
|
945
945
|
children: "Current page · n/a (infinite scroll)"
|
|
946
|
-
}) : /* @__PURE__ */ X(
|
|
946
|
+
}) : /* @__PURE__ */ X(N, {
|
|
947
947
|
icon: /* @__PURE__ */ Y(e.columns, { size: 12 }),
|
|
948
|
-
onClick: x ? void 0 : () => void
|
|
949
|
-
children: ["Current page (CSV) · ",
|
|
948
|
+
onClick: x ? void 0 : () => void O("current_page"),
|
|
949
|
+
children: ["Current page (CSV) · ", d ? `${d} rows` : "page window"]
|
|
950
950
|
}),
|
|
951
|
-
/* @__PURE__ */ Y(
|
|
951
|
+
/* @__PURE__ */ Y(N, {
|
|
952
952
|
icon: /* @__PURE__ */ Y(e.grid, { size: 12 }),
|
|
953
953
|
children: "XLSX (coming soon)"
|
|
954
954
|
}),
|
|
@@ -976,52 +976,52 @@ function cn(e, t) {
|
|
|
976
976
|
}
|
|
977
977
|
//#endregion
|
|
978
978
|
//#region src/components/pages/list/ListToolbar.tsx
|
|
979
|
-
function ln({ screen: t, entity: n, entityCode:
|
|
980
|
-
let [
|
|
981
|
-
let e =
|
|
982
|
-
|
|
983
|
-
},
|
|
979
|
+
function ln({ screen: t, entity: n, entityCode: a, schema: o, screenCode: s, screenName: c, locale: l, isPhone: u, isCardsPresentation: d, sort: p, columns: m, views: h, query: g, selection: v, filters: y, searchValue: x, onSearchChange: S, onSaveView: C, page: w, perPage: T, includeDeleted: E, canViewDeleted: D, onToggleDeleted: O, realtime: ee, isLive: te }) {
|
|
980
|
+
let [ne, k] = q(!1), [re, A] = q(!1), [j, M] = q(!1), ie = K(null), P = K(null), F = we((e) => e.density), I = () => {
|
|
981
|
+
let e = F === "compact" ? "comfortable" : F === "comfortable" ? "cozy" : "compact";
|
|
982
|
+
we.getState().setMany({ density: e });
|
|
983
|
+
}, ae = !u || ne || x !== "", R = (e) => {
|
|
984
984
|
if (e.startsWith("$status.")) {
|
|
985
985
|
let t = e.slice(8), r = n.status_groups?.[t];
|
|
986
|
-
return r ?
|
|
986
|
+
return r ? L(r.name) || t : e;
|
|
987
987
|
}
|
|
988
988
|
if (e.startsWith("$property.")) {
|
|
989
989
|
let t = e.slice(10), r = n.properties?.[t];
|
|
990
|
-
return r ?
|
|
990
|
+
return r ? L(r.name) || t : e;
|
|
991
991
|
}
|
|
992
|
-
return
|
|
993
|
-
},
|
|
992
|
+
return Ie(n, e, o?.entities);
|
|
993
|
+
}, oe = (t.columns ?? []).filter((e) => Jt(e, n));
|
|
994
994
|
return /* @__PURE__ */ X("div", {
|
|
995
995
|
style: {
|
|
996
996
|
display: "flex",
|
|
997
997
|
alignItems: "center",
|
|
998
|
-
gap:
|
|
998
|
+
gap: u ? 6 : 8,
|
|
999
999
|
paddingTop: 0,
|
|
1000
1000
|
paddingBottom: 10,
|
|
1001
|
-
...
|
|
1001
|
+
...u ? Te(12) : {
|
|
1002
1002
|
paddingLeft: 20,
|
|
1003
1003
|
paddingRight: 20
|
|
1004
1004
|
},
|
|
1005
1005
|
flexWrap: "wrap"
|
|
1006
1006
|
},
|
|
1007
1007
|
children: [
|
|
1008
|
-
/* @__PURE__ */ Y(
|
|
1009
|
-
views:
|
|
1010
|
-
activeViewId:
|
|
1011
|
-
isDirty:
|
|
1012
|
-
onSelect:
|
|
1008
|
+
/* @__PURE__ */ Y(et, {
|
|
1009
|
+
views: h.all,
|
|
1010
|
+
activeViewId: h.activeId,
|
|
1011
|
+
isDirty: h.isDirty,
|
|
1012
|
+
onSelect: h.apply,
|
|
1013
1013
|
onSaveAs: C
|
|
1014
1014
|
}),
|
|
1015
|
-
|
|
1015
|
+
ae ? /* @__PURE__ */ X("div", {
|
|
1016
1016
|
style: {
|
|
1017
1017
|
position: "relative",
|
|
1018
|
-
width:
|
|
1019
|
-
order:
|
|
1018
|
+
width: u ? "100%" : 260,
|
|
1019
|
+
order: u ? -1 : 0
|
|
1020
1020
|
},
|
|
1021
|
-
children: [/* @__PURE__ */ Y(
|
|
1021
|
+
children: [/* @__PURE__ */ Y(i, {
|
|
1022
1022
|
value: x,
|
|
1023
1023
|
onChange: S,
|
|
1024
|
-
placeholder: `Search ${
|
|
1024
|
+
placeholder: `Search ${c.toLowerCase()}…`,
|
|
1025
1025
|
prefix: /* @__PURE__ */ Y(e.search, { size: 13 })
|
|
1026
1026
|
}), /* @__PURE__ */ Y("span", {
|
|
1027
1027
|
style: {
|
|
@@ -1033,37 +1033,37 @@ function ln({ screen: t, entity: n, entityCode: r, schema: i, screenCode: a, scr
|
|
|
1033
1033
|
},
|
|
1034
1034
|
children: /* @__PURE__ */ Y(_, { children: "/" })
|
|
1035
1035
|
})]
|
|
1036
|
-
}) : /* @__PURE__ */ Y(
|
|
1036
|
+
}) : /* @__PURE__ */ Y(r, {
|
|
1037
1037
|
icon: /* @__PURE__ */ Y(e.search, { size: 14 }),
|
|
1038
|
-
title: `Search ${
|
|
1039
|
-
onClick: () =>
|
|
1038
|
+
title: `Search ${c.toLowerCase()}`,
|
|
1039
|
+
onClick: () => k(!0)
|
|
1040
1040
|
}),
|
|
1041
|
-
/* @__PURE__ */ X(
|
|
1041
|
+
/* @__PURE__ */ X(b, {
|
|
1042
1042
|
icon: /* @__PURE__ */ Y(e.filter, { size: 13 }),
|
|
1043
|
-
onClick:
|
|
1044
|
-
active:
|
|
1045
|
-
children: ["Filters",
|
|
1043
|
+
onClick: y.onOpen,
|
|
1044
|
+
active: y.count > 0,
|
|
1045
|
+
children: ["Filters", y.count > 0 && /* @__PURE__ */ Y(me, {
|
|
1046
1046
|
tone: "violet",
|
|
1047
1047
|
size: "xs",
|
|
1048
1048
|
style: { marginLeft: 4 },
|
|
1049
|
-
children:
|
|
1049
|
+
children: y.count
|
|
1050
1050
|
})]
|
|
1051
1051
|
}),
|
|
1052
|
-
|
|
1052
|
+
d && /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ X(b, {
|
|
1053
1053
|
ref: ie,
|
|
1054
1054
|
icon: /* @__PURE__ */ Y(e.sort, { size: 13 }),
|
|
1055
|
-
onClick: () =>
|
|
1056
|
-
active:
|
|
1057
|
-
children: ["Sort",
|
|
1055
|
+
onClick: () => A((e) => !e),
|
|
1056
|
+
active: re || p.cols.length > 0,
|
|
1057
|
+
children: ["Sort", p.cols.length > 0 && /* @__PURE__ */ Y(me, {
|
|
1058
1058
|
tone: "slate",
|
|
1059
1059
|
size: "xs",
|
|
1060
1060
|
style: { marginLeft: 4 },
|
|
1061
|
-
children:
|
|
1061
|
+
children: p.cols.length
|
|
1062
1062
|
})]
|
|
1063
|
-
}), /* @__PURE__ */ X(
|
|
1064
|
-
open:
|
|
1063
|
+
}), /* @__PURE__ */ X(f, {
|
|
1064
|
+
open: re,
|
|
1065
1065
|
anchor: ie.current,
|
|
1066
|
-
onClose: () =>
|
|
1066
|
+
onClose: () => A(!1),
|
|
1067
1067
|
align: "start",
|
|
1068
1068
|
width: 280,
|
|
1069
1069
|
children: [
|
|
@@ -1078,63 +1078,63 @@ function ln({ screen: t, entity: n, entityCode: r, schema: i, screenCode: a, scr
|
|
|
1078
1078
|
},
|
|
1079
1079
|
children: "Sort by"
|
|
1080
1080
|
}),
|
|
1081
|
-
|
|
1082
|
-
let n =
|
|
1083
|
-
return /* @__PURE__ */ Y(
|
|
1081
|
+
oe.map((t) => {
|
|
1082
|
+
let n = p.cols.find((e) => e.field === t);
|
|
1083
|
+
return /* @__PURE__ */ Y(N, {
|
|
1084
1084
|
icon: n ? n.dir === "desc" ? /* @__PURE__ */ Y(e.arrowDown, { size: 12 }) : /* @__PURE__ */ Y(e.arrowUp, { size: 12 }) : /* @__PURE__ */ Y("span", { style: {
|
|
1085
1085
|
width: 12,
|
|
1086
1086
|
display: "inline-block"
|
|
1087
1087
|
} }),
|
|
1088
1088
|
active: !!n,
|
|
1089
1089
|
onClick: () => {
|
|
1090
|
-
|
|
1090
|
+
p.applyColumn(t, n?.dir === "asc" ? "desc" : "asc", void 0), A(!1);
|
|
1091
1091
|
},
|
|
1092
|
-
children:
|
|
1092
|
+
children: R(t)
|
|
1093
1093
|
}, t);
|
|
1094
1094
|
}),
|
|
1095
|
-
|
|
1095
|
+
p.cols.length > 0 && /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y(N, { divider: !0 }), /* @__PURE__ */ Y(N, {
|
|
1096
1096
|
icon: /* @__PURE__ */ Y(e.x, { size: 12 }),
|
|
1097
1097
|
onClick: () => {
|
|
1098
|
-
|
|
1098
|
+
p.clearAll(), A(!1);
|
|
1099
1099
|
},
|
|
1100
1100
|
children: "Clear sort"
|
|
1101
1101
|
})] })
|
|
1102
1102
|
]
|
|
1103
1103
|
})] }),
|
|
1104
|
-
!
|
|
1104
|
+
!d && /* @__PURE__ */ Y(nt, {
|
|
1105
1105
|
availableColumns: t.columns ?? [],
|
|
1106
|
-
visibleColumns:
|
|
1106
|
+
visibleColumns: m.visible,
|
|
1107
1107
|
onToggle: (e) => {
|
|
1108
|
-
let t =
|
|
1109
|
-
|
|
1108
|
+
let t = m.visible.includes(e) ? m.visible.filter((t) => t !== e) : [...m.visible, e];
|
|
1109
|
+
m.apply(t);
|
|
1110
1110
|
},
|
|
1111
|
-
onMove:
|
|
1112
|
-
onReset:
|
|
1113
|
-
onShowAll: () =>
|
|
1114
|
-
onResetWidths:
|
|
1115
|
-
columnLabel:
|
|
1111
|
+
onMove: m.move,
|
|
1112
|
+
onReset: m.clear,
|
|
1113
|
+
onShowAll: () => m.apply(t.columns ?? []),
|
|
1114
|
+
onResetWidths: m.resetWidths,
|
|
1115
|
+
columnLabel: R
|
|
1116
1116
|
}),
|
|
1117
|
-
!
|
|
1117
|
+
!u && /* @__PURE__ */ Y("span", { style: {
|
|
1118
1118
|
width: 1,
|
|
1119
1119
|
height: 20,
|
|
1120
1120
|
background: "var(--divider)"
|
|
1121
1121
|
} }),
|
|
1122
|
-
!
|
|
1122
|
+
!u && /* @__PURE__ */ Y(r, {
|
|
1123
1123
|
icon: /* @__PURE__ */ Y(e.grid, { size: 14 }),
|
|
1124
1124
|
title: "Density",
|
|
1125
|
-
active:
|
|
1126
|
-
onClick:
|
|
1125
|
+
active: F !== "compact",
|
|
1126
|
+
onClick: I
|
|
1127
1127
|
}),
|
|
1128
|
-
/* @__PURE__ */ Y(
|
|
1128
|
+
/* @__PURE__ */ Y(ye, {
|
|
1129
1129
|
liveObject: {
|
|
1130
1130
|
refetch: g.retry,
|
|
1131
1131
|
isLoading: g.isLoading,
|
|
1132
|
-
isLive:
|
|
1132
|
+
isLive: te
|
|
1133
1133
|
},
|
|
1134
|
-
realtime:
|
|
1134
|
+
realtime: ee
|
|
1135
1135
|
}),
|
|
1136
|
-
!
|
|
1137
|
-
!
|
|
1136
|
+
!u && /* @__PURE__ */ Y("div", { style: { flex: 1 } }),
|
|
1137
|
+
!u && D && /* @__PURE__ */ Y(b, {
|
|
1138
1138
|
kind: "ghost",
|
|
1139
1139
|
size: "sm",
|
|
1140
1140
|
icon: Y(E ? e.eyeOff : e.eye, { size: 12 }),
|
|
@@ -1142,25 +1142,25 @@ function ln({ screen: t, entity: n, entityCode: r, schema: i, screenCode: a, scr
|
|
|
1142
1142
|
active: E,
|
|
1143
1143
|
children: E ? "Hide deleted" : "Show deleted"
|
|
1144
1144
|
}),
|
|
1145
|
-
|
|
1146
|
-
ref:
|
|
1145
|
+
u && /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y(r, {
|
|
1146
|
+
ref: P,
|
|
1147
1147
|
icon: /* @__PURE__ */ Y(e.more, { size: 14 }),
|
|
1148
1148
|
title: "More",
|
|
1149
|
-
active:
|
|
1149
|
+
active: j,
|
|
1150
1150
|
onClick: () => M((e) => !e)
|
|
1151
|
-
}), /* @__PURE__ */ X(
|
|
1152
|
-
open:
|
|
1153
|
-
anchor:
|
|
1151
|
+
}), /* @__PURE__ */ X(f, {
|
|
1152
|
+
open: j,
|
|
1153
|
+
anchor: P.current,
|
|
1154
1154
|
onClose: () => M(!1),
|
|
1155
1155
|
align: "end",
|
|
1156
1156
|
width: 220,
|
|
1157
|
-
children: [/* @__PURE__ */ Y(
|
|
1157
|
+
children: [/* @__PURE__ */ Y(N, {
|
|
1158
1158
|
icon: /* @__PURE__ */ Y(e.grid, { size: 13 }),
|
|
1159
1159
|
onClick: () => {
|
|
1160
|
-
|
|
1160
|
+
I(), M(!1);
|
|
1161
1161
|
},
|
|
1162
1162
|
children: "Density"
|
|
1163
|
-
}), D && /* @__PURE__ */ Y(
|
|
1163
|
+
}), D && /* @__PURE__ */ Y(N, {
|
|
1164
1164
|
icon: Y(E ? e.eyeOff : e.eye, { size: 13 }),
|
|
1165
1165
|
onClick: () => {
|
|
1166
1166
|
O(), M(!1);
|
|
@@ -1168,41 +1168,41 @@ function ln({ screen: t, entity: n, entityCode: r, schema: i, screenCode: a, scr
|
|
|
1168
1168
|
children: E ? "Hide deleted" : "Show deleted"
|
|
1169
1169
|
})]
|
|
1170
1170
|
})] }),
|
|
1171
|
-
|
|
1172
|
-
entityCode:
|
|
1171
|
+
a && n && /* @__PURE__ */ Y(ft, {
|
|
1172
|
+
entityCode: a,
|
|
1173
1173
|
scope: "list",
|
|
1174
|
-
selectedIds:
|
|
1174
|
+
selectedIds: v.ids,
|
|
1175
1175
|
viewState: {
|
|
1176
|
-
screenCode:
|
|
1177
|
-
jsonFilters:
|
|
1178
|
-
search:
|
|
1179
|
-
sort:
|
|
1176
|
+
screenCode: s,
|
|
1177
|
+
jsonFilters: y.json,
|
|
1178
|
+
search: y.debouncedSearch,
|
|
1179
|
+
sort: p.forRequest,
|
|
1180
1180
|
includeDeleted: E || void 0,
|
|
1181
1181
|
page: w,
|
|
1182
1182
|
perPage: T
|
|
1183
1183
|
},
|
|
1184
|
-
locale:
|
|
1184
|
+
locale: l,
|
|
1185
1185
|
capability: n.documents,
|
|
1186
|
-
canManageTemplates: B(
|
|
1186
|
+
canManageTemplates: B(o)
|
|
1187
1187
|
}),
|
|
1188
|
-
|
|
1189
|
-
entityCode:
|
|
1188
|
+
a && n && /* @__PURE__ */ Y(on, {
|
|
1189
|
+
entityCode: a,
|
|
1190
1190
|
entity: n,
|
|
1191
1191
|
screen: t,
|
|
1192
1192
|
viewState: {
|
|
1193
|
-
screenCode:
|
|
1194
|
-
jsonFilters:
|
|
1195
|
-
search:
|
|
1196
|
-
sort:
|
|
1193
|
+
screenCode: s,
|
|
1194
|
+
jsonFilters: y.json,
|
|
1195
|
+
search: y.debouncedSearch,
|
|
1196
|
+
sort: p.forRequest,
|
|
1197
1197
|
includeDeleted: E || void 0,
|
|
1198
1198
|
page: w,
|
|
1199
1199
|
perPage: T
|
|
1200
1200
|
},
|
|
1201
|
-
visibleColumns:
|
|
1202
|
-
selectedRowPKs:
|
|
1201
|
+
visibleColumns: m.visible,
|
|
1202
|
+
selectedRowPKs: v.pkValues,
|
|
1203
1203
|
totalRows: g.countTotal,
|
|
1204
1204
|
pageSize: T,
|
|
1205
|
-
locale:
|
|
1205
|
+
locale: l
|
|
1206
1206
|
})
|
|
1207
1207
|
]
|
|
1208
1208
|
});
|
|
@@ -1212,39 +1212,39 @@ function ln({ screen: t, entity: n, entityCode: r, schema: i, screenCode: a, scr
|
|
|
1212
1212
|
function un(e) {
|
|
1213
1213
|
let t = new URLSearchParams(), n = e.get("search");
|
|
1214
1214
|
n && t.set("search", n);
|
|
1215
|
-
for (let n of
|
|
1215
|
+
for (let n of c) {
|
|
1216
1216
|
let r = e.get(n);
|
|
1217
1217
|
r !== null && t.set(n, r);
|
|
1218
1218
|
}
|
|
1219
1219
|
return t;
|
|
1220
1220
|
}
|
|
1221
1221
|
function dn(e, t) {
|
|
1222
|
-
let n =
|
|
1223
|
-
n && e.setQueriesData({ queryKey: ["entity-data", "view"] }, (e) => !e || e.data.some((e) =>
|
|
1222
|
+
let n = I(t.id);
|
|
1223
|
+
n && e.setQueriesData({ queryKey: ["entity-data", "view"] }, (e) => !e || e.data.some((e) => I(e.id) === n) ? e : {
|
|
1224
1224
|
...e,
|
|
1225
1225
|
data: [t, ...e.data]
|
|
1226
1226
|
});
|
|
1227
1227
|
}
|
|
1228
1228
|
function fn({ screenCode: e, screen: t, searchParams: n, setSearchParams: r, userId: i, tenantId: a, filterError: o, filters: s, visibleColumns: c, sort: l }) {
|
|
1229
|
-
let u = yt(), d =
|
|
1229
|
+
let u = yt(), d = Qe(e, i), f = n.get("view"), p = G(() => d.find((e) => e.id === f), [d, f]), m = ke("view"), h = Oe("view"), g = `dcl:smartlist:default-view-cleared:${e}`, _ = K(!1);
|
|
1230
1230
|
W(() => {
|
|
1231
|
-
if (
|
|
1231
|
+
if (_.current) return;
|
|
1232
1232
|
if (o) {
|
|
1233
|
-
|
|
1233
|
+
_.current = !0;
|
|
1234
1234
|
return;
|
|
1235
1235
|
}
|
|
1236
1236
|
if (!d || d.length === 0) return;
|
|
1237
1237
|
if (n.get("view")) {
|
|
1238
|
-
|
|
1238
|
+
_.current = !0;
|
|
1239
1239
|
return;
|
|
1240
1240
|
}
|
|
1241
|
-
if (typeof window < "u" && window.sessionStorage?.getItem(
|
|
1242
|
-
|
|
1241
|
+
if (typeof window < "u" && window.sessionStorage?.getItem(g)) {
|
|
1242
|
+
_.current = !0;
|
|
1243
1243
|
return;
|
|
1244
1244
|
}
|
|
1245
1245
|
let e = d.find((e) => e.source === "personal" && e.is_default) ?? (t?.default_view ? d.find((e) => e.source === "system" && e.id === t.default_view) : void 0);
|
|
1246
1246
|
if (!e || !e.id) return;
|
|
1247
|
-
|
|
1247
|
+
_.current = !0;
|
|
1248
1248
|
let i = un(n);
|
|
1249
1249
|
i.set("view", e.id), e.filters && Array.isArray(e.filters) && e.filters.length > 0 && i.set("filters", JSON.stringify(e.filters)), e.columns && e.columns.length > 0 && i.set("columns", e.columns.join(",")), e.sort && i.set("sort", e.sort), r(i, { replace: !0 });
|
|
1250
1250
|
}, [
|
|
@@ -1252,10 +1252,10 @@ function fn({ screenCode: e, screen: t, searchParams: n, setSearchParams: r, use
|
|
|
1252
1252
|
o,
|
|
1253
1253
|
n,
|
|
1254
1254
|
r,
|
|
1255
|
-
|
|
1255
|
+
g,
|
|
1256
1256
|
t?.default_view
|
|
1257
1257
|
]);
|
|
1258
|
-
let
|
|
1258
|
+
let v = G(() => {
|
|
1259
1259
|
if (!f || !p) return !1;
|
|
1260
1260
|
let e = p.filters ?? [], n = p.columns?.length ? p.columns : t?.default_columns ?? t?.columns ?? [], r = p.sort ?? t?.sort_default ?? "";
|
|
1261
1261
|
return JSON.stringify(s) !== JSON.stringify(e) || c.join(",") !== n.join(",") || (l ?? "") !== r;
|
|
@@ -1268,22 +1268,22 @@ function fn({ screenCode: e, screen: t, searchParams: n, setSearchParams: r, use
|
|
|
1268
1268
|
t?.default_columns,
|
|
1269
1269
|
t?.columns,
|
|
1270
1270
|
t?.sort_default
|
|
1271
|
-
]),
|
|
1271
|
+
]), y = U((e) => {
|
|
1272
1272
|
let i = new URLSearchParams(n), a = un(n);
|
|
1273
|
-
e.id ? (a.set("view", e.id), e.filters && Array.isArray(e.filters) && e.filters.length > 0 && a.set("filters", JSON.stringify(e.filters)), e.columns && e.columns.length > 0 && a.set("columns", e.columns.join(",")), e.sort && a.set("sort", e.sort), a.set("page", "1")) : typeof window < "u" && window.sessionStorage?.setItem(
|
|
1273
|
+
e.id ? (a.set("view", e.id), e.filters && Array.isArray(e.filters) && e.filters.length > 0 && a.set("filters", JSON.stringify(e.filters)), e.columns && e.columns.length > 0 && a.set("columns", e.columns.join(",")), e.sort && a.set("sort", e.sort), a.set("page", "1")) : typeof window < "u" && window.sessionStorage?.setItem(g, "1"), r(a);
|
|
1274
1274
|
let o = i.get("view"), s = o ? d.find((e) => e.id === o) : void 0, c = (s?.columns?.length ? s.columns : t?.default_columns ?? t?.columns ?? []).join(",");
|
|
1275
|
-
(i.get("columns") ?? c) !== c &&
|
|
1275
|
+
(i.get("columns") ?? c) !== c && ie.info("View applied", "Your unsaved column changes were replaced.", { action: {
|
|
1276
1276
|
label: "Undo",
|
|
1277
1277
|
onClick: () => r(i)
|
|
1278
1278
|
} });
|
|
1279
1279
|
}, [
|
|
1280
1280
|
n,
|
|
1281
1281
|
r,
|
|
1282
|
-
|
|
1282
|
+
g,
|
|
1283
1283
|
d,
|
|
1284
1284
|
t?.default_columns,
|
|
1285
1285
|
t?.columns
|
|
1286
|
-
]),
|
|
1286
|
+
]), b = U(async () => {
|
|
1287
1287
|
!p?.id || p.source !== "personal" || (await h.mutateAsync({
|
|
1288
1288
|
pkValues: p.id,
|
|
1289
1289
|
data: {
|
|
@@ -1304,8 +1304,8 @@ function fn({ screenCode: e, screen: t, searchParams: n, setSearchParams: r, use
|
|
|
1304
1304
|
all: d,
|
|
1305
1305
|
activeId: f,
|
|
1306
1306
|
active: p,
|
|
1307
|
-
isDirty:
|
|
1308
|
-
apply:
|
|
1307
|
+
isDirty: v,
|
|
1308
|
+
apply: y,
|
|
1309
1309
|
saveAsNew: U(async (t) => {
|
|
1310
1310
|
if (!i || !a) return;
|
|
1311
1311
|
let o = await m.mutateAsync({
|
|
@@ -1318,7 +1318,7 @@ function fn({ screenCode: e, screen: t, searchParams: n, setSearchParams: r, use
|
|
|
1318
1318
|
...l ? { sort: l } : {},
|
|
1319
1319
|
is_shared: !1,
|
|
1320
1320
|
is_default: !1
|
|
1321
|
-
}), d =
|
|
1321
|
+
}), d = I(o.data.id);
|
|
1322
1322
|
if (!d) return;
|
|
1323
1323
|
dn(u, o.data), await u.invalidateQueries({ queryKey: ["entity-data", "view"] });
|
|
1324
1324
|
let f = new URLSearchParams(n);
|
|
@@ -1335,12 +1335,12 @@ function fn({ screenCode: e, screen: t, searchParams: n, setSearchParams: r, use
|
|
|
1335
1335
|
n,
|
|
1336
1336
|
r
|
|
1337
1337
|
]),
|
|
1338
|
-
overwriteActive:
|
|
1338
|
+
overwriteActive: b,
|
|
1339
1339
|
isSaving: m.isPending || h.isPending
|
|
1340
1340
|
};
|
|
1341
1341
|
}
|
|
1342
1342
|
function pn(e) {
|
|
1343
|
-
return e && e.source === "personal" ?
|
|
1343
|
+
return e && e.source === "personal" ? L(e.name) : null;
|
|
1344
1344
|
}
|
|
1345
1345
|
//#endregion
|
|
1346
1346
|
//#region src/components/pages/list/use-filter-value-labels.ts
|
|
@@ -1362,7 +1362,7 @@ function mn(e, t, n, r) {
|
|
|
1362
1362
|
e.entity,
|
|
1363
1363
|
t
|
|
1364
1364
|
],
|
|
1365
|
-
queryFn: ({ signal: n }) =>
|
|
1365
|
+
queryFn: ({ signal: n }) => se(e.entity, t, { signal: n }),
|
|
1366
1366
|
staleTime: 6e4
|
|
1367
1367
|
};
|
|
1368
1368
|
}) }), s = {};
|
|
@@ -1375,14 +1375,14 @@ function mn(e, t, n, r) {
|
|
|
1375
1375
|
if (r) {
|
|
1376
1376
|
let e = s[n.entity] ??= {};
|
|
1377
1377
|
for (let t of r) {
|
|
1378
|
-
let r =
|
|
1378
|
+
let r = I(t[n.lookupField]);
|
|
1379
1379
|
r && (e[r] = t);
|
|
1380
1380
|
}
|
|
1381
1381
|
}
|
|
1382
1382
|
if (e.isLoading) for (let e of n.values) s[n.entity]?.[e] || c.add(`${n.entity}::${e}`);
|
|
1383
1383
|
}), {
|
|
1384
1384
|
labelFor: (e, t) => {
|
|
1385
|
-
let n =
|
|
1385
|
+
let n = I(t), a = i.get(e);
|
|
1386
1386
|
if (!a) return {
|
|
1387
1387
|
status: "plain",
|
|
1388
1388
|
raw: n
|
|
@@ -1390,7 +1390,7 @@ function mn(e, t, n, r) {
|
|
|
1390
1390
|
let o = a.specialValues?.find((e) => e.code === n);
|
|
1391
1391
|
if (o) return {
|
|
1392
1392
|
status: "special",
|
|
1393
|
-
label:
|
|
1393
|
+
label: L(o.label) || n,
|
|
1394
1394
|
raw: n
|
|
1395
1395
|
};
|
|
1396
1396
|
if (a.options) {
|
|
@@ -1429,13 +1429,13 @@ function mn(e, t, n, r) {
|
|
|
1429
1429
|
}
|
|
1430
1430
|
function hn(e, t, n, r) {
|
|
1431
1431
|
let i = /* @__PURE__ */ new Map();
|
|
1432
|
-
for (let a of
|
|
1432
|
+
for (let a of it(t)) {
|
|
1433
1433
|
if (!a.field) continue;
|
|
1434
1434
|
let t = e.get(a.field);
|
|
1435
1435
|
if (!t || t.type !== "ref" || !t.ref?.entity) continue;
|
|
1436
|
-
let o = t.ref.entity, s = r?.[o], c = t.ref.field || (s ?
|
|
1436
|
+
let o = t.ref.entity, s = r?.[o], c = t.ref.field || (s ? ue(s)[0] : "id") || "id", l = Array.isArray(a.value) ? a.value : [a.value];
|
|
1437
1437
|
for (let e of l) {
|
|
1438
|
-
let r =
|
|
1438
|
+
let r = I(e);
|
|
1439
1439
|
if (!r || t.specialValues?.some((e) => e.code === r) || n?.[o]?.[r]) continue;
|
|
1440
1440
|
let a = `${o}::${c}`, s = i.get(a);
|
|
1441
1441
|
s || (s = {
|
|
@@ -1452,12 +1452,12 @@ function hn(e, t, n, r) {
|
|
|
1452
1452
|
}
|
|
1453
1453
|
//#endregion
|
|
1454
1454
|
//#region src/components/pages/list/SaveViewDialog.tsx
|
|
1455
|
-
function gn({ open: e, pending: t, onClose: n, onSave: r, overwriteViewName:
|
|
1456
|
-
let [
|
|
1455
|
+
function gn({ open: e, pending: t, onClose: n, onSave: r, overwriteViewName: a, onOverwrite: o }) {
|
|
1456
|
+
let [s, c] = q(""), l = !!(a && o);
|
|
1457
1457
|
if (W(() => {
|
|
1458
|
-
e &&
|
|
1458
|
+
e && c("");
|
|
1459
1459
|
}, [e]), !e) return null;
|
|
1460
|
-
let
|
|
1460
|
+
let u = s.trim();
|
|
1461
1461
|
return /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y("div", {
|
|
1462
1462
|
onClick: n,
|
|
1463
1463
|
style: {
|
|
@@ -1516,14 +1516,14 @@ function gn({ open: e, pending: t, onClose: n, onSave: r, overwriteViewName: i,
|
|
|
1516
1516
|
fontWeight: 500
|
|
1517
1517
|
},
|
|
1518
1518
|
children: "Name"
|
|
1519
|
-
}), /* @__PURE__ */ Y(
|
|
1519
|
+
}), /* @__PURE__ */ Y(i, {
|
|
1520
1520
|
autoFocus: !0,
|
|
1521
1521
|
"aria-label": "View name",
|
|
1522
|
-
value:
|
|
1523
|
-
onChange:
|
|
1522
|
+
value: s,
|
|
1523
|
+
onChange: c,
|
|
1524
1524
|
placeholder: "My filtered view",
|
|
1525
1525
|
onKeyDown: (e) => {
|
|
1526
|
-
e.key === "Escape" && n(), e.key === "Enter" &&
|
|
1526
|
+
e.key === "Escape" && n(), e.key === "Enter" && u && !t && r(u);
|
|
1527
1527
|
}
|
|
1528
1528
|
})]
|
|
1529
1529
|
}),
|
|
@@ -1534,24 +1534,24 @@ function gn({ open: e, pending: t, onClose: n, onSave: r, overwriteViewName: i,
|
|
|
1534
1534
|
gap: 8
|
|
1535
1535
|
},
|
|
1536
1536
|
children: [
|
|
1537
|
-
/* @__PURE__ */ Y(
|
|
1537
|
+
/* @__PURE__ */ Y(b, {
|
|
1538
1538
|
onClick: n,
|
|
1539
1539
|
disabled: t,
|
|
1540
1540
|
children: "Cancel"
|
|
1541
1541
|
}),
|
|
1542
|
-
|
|
1543
|
-
onClick: () => void
|
|
1542
|
+
l && /* @__PURE__ */ X(b, {
|
|
1543
|
+
onClick: () => void o(),
|
|
1544
1544
|
disabled: t,
|
|
1545
1545
|
children: [
|
|
1546
1546
|
"Overwrite “",
|
|
1547
|
-
|
|
1547
|
+
a,
|
|
1548
1548
|
"”"
|
|
1549
1549
|
]
|
|
1550
1550
|
}),
|
|
1551
|
-
/* @__PURE__ */ Y(
|
|
1551
|
+
/* @__PURE__ */ Y(b, {
|
|
1552
1552
|
kind: "primary",
|
|
1553
|
-
onClick: () => void r(
|
|
1554
|
-
disabled: !
|
|
1553
|
+
onClick: () => void r(u),
|
|
1554
|
+
disabled: !u || t,
|
|
1555
1555
|
children: "Save as new"
|
|
1556
1556
|
})
|
|
1557
1557
|
]
|
|
@@ -1561,43 +1561,43 @@ function gn({ open: e, pending: t, onClose: n, onSave: r, overwriteViewName: i,
|
|
|
1561
1561
|
}
|
|
1562
1562
|
//#endregion
|
|
1563
1563
|
//#region src/components/pages/list/ListHeader.tsx
|
|
1564
|
-
function _n({ title: t, description: n, toolbarActions: i, screenActionLayout: a, entityActionLayout:
|
|
1565
|
-
let { run: h } =
|
|
1564
|
+
function _n({ title: t, description: n, toolbarActions: i, screenActionLayout: a, entityActionLayout: c, selectedIds: l, data: u, rowKey: d, onActionSuccess: f, widgetContext: m }) {
|
|
1565
|
+
let { run: h } = M(), { isPhone: g } = p(), _ = ve("list"), b = _.isVisible("show_title"), x = _.isVisible("show_actions"), C = Ee(), w = G(() => {
|
|
1566
1566
|
let e = {};
|
|
1567
1567
|
for (let { code: t, action: n } of i) e[t] = n;
|
|
1568
1568
|
return e;
|
|
1569
|
-
}, [i]), T = G(() =>
|
|
1569
|
+
}, [i]), T = G(() => o((a ?? c) || s(w, "list_toolbar"), w, void 0, "list_toolbar"), [
|
|
1570
1570
|
a,
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
]), E = G(() =>
|
|
1574
|
-
if (
|
|
1571
|
+
c,
|
|
1572
|
+
w
|
|
1573
|
+
]), E = G(() => v(T, w, void 0, pe, "Select one or more rows first"), [T, w]), D = G(() => {
|
|
1574
|
+
if (l.length === 0) return [];
|
|
1575
1575
|
let e = /* @__PURE__ */ new Map();
|
|
1576
|
-
for (let t of
|
|
1577
|
-
return
|
|
1576
|
+
for (let t of u) e.set(d(t), t);
|
|
1577
|
+
return l.map((t) => e.get(t)).filter((e) => e !== void 0);
|
|
1578
1578
|
}, [
|
|
1579
|
+
l,
|
|
1579
1580
|
u,
|
|
1580
|
-
d
|
|
1581
|
-
|
|
1582
|
-
]), O = G(() => b(T, C, void 0, {}, D), [
|
|
1581
|
+
d
|
|
1582
|
+
]), O = G(() => y(T, w, void 0, {}, D), [
|
|
1583
1583
|
T,
|
|
1584
|
-
|
|
1584
|
+
w,
|
|
1585
1585
|
D
|
|
1586
|
-
]),
|
|
1587
|
-
let n =
|
|
1586
|
+
]), ee = l.length > 0 ? O : E, te = (e, t) => {
|
|
1587
|
+
let n = Ve(e, t, {});
|
|
1588
1588
|
if (n === null) return;
|
|
1589
|
-
let r =
|
|
1589
|
+
let r = L(t.display?.name) || e;
|
|
1590
1590
|
return h({
|
|
1591
1591
|
action: t,
|
|
1592
1592
|
title: r,
|
|
1593
1593
|
bulkSelection: D.length > 0 ? D : void 0,
|
|
1594
1594
|
execute: async (e) => {
|
|
1595
|
-
let t =
|
|
1596
|
-
return t && t.length > 0 &&
|
|
1595
|
+
let t = l.length > 0 ? l : void 0, r = await ne(n, S(e, t));
|
|
1596
|
+
return t && t.length > 0 && f(), r;
|
|
1597
1597
|
}
|
|
1598
1598
|
});
|
|
1599
1599
|
};
|
|
1600
|
-
return !
|
|
1600
|
+
return !b && !x ? null : /* @__PURE__ */ X("div", {
|
|
1601
1601
|
style: {
|
|
1602
1602
|
display: "flex",
|
|
1603
1603
|
alignItems: "center",
|
|
@@ -1605,18 +1605,18 @@ function _n({ title: t, description: n, toolbarActions: i, screenActionLayout: a
|
|
|
1605
1605
|
flexWrap: g ? "wrap" : "nowrap",
|
|
1606
1606
|
paddingTop: g ? 12 : 16,
|
|
1607
1607
|
paddingBottom: 10,
|
|
1608
|
-
...g ?
|
|
1608
|
+
...g ? Te(12) : {
|
|
1609
1609
|
paddingLeft: 20,
|
|
1610
1610
|
paddingRight: 20
|
|
1611
1611
|
}
|
|
1612
1612
|
},
|
|
1613
1613
|
children: [
|
|
1614
|
-
|
|
1614
|
+
b && C.hasOriginBack && /* @__PURE__ */ Y(r, {
|
|
1615
1615
|
icon: /* @__PURE__ */ Y(e.back, { size: 14 }),
|
|
1616
1616
|
title: "Back",
|
|
1617
|
-
onClick:
|
|
1617
|
+
onClick: C.goBack
|
|
1618
1618
|
}),
|
|
1619
|
-
|
|
1619
|
+
b && /* @__PURE__ */ Y("div", {
|
|
1620
1620
|
style: {
|
|
1621
1621
|
flex: g ? "1 1 100%" : "1 1 auto",
|
|
1622
1622
|
minWidth: 0
|
|
@@ -1641,17 +1641,17 @@ function _n({ title: t, description: n, toolbarActions: i, screenActionLayout: a
|
|
|
1641
1641
|
color: "var(--text)"
|
|
1642
1642
|
},
|
|
1643
1643
|
children: t
|
|
1644
|
-
}), n && /* @__PURE__ */ Y(
|
|
1644
|
+
}), n && /* @__PURE__ */ Y(_e, {
|
|
1645
1645
|
label: n,
|
|
1646
1646
|
"data-testid": "list-description-info"
|
|
1647
1647
|
})]
|
|
1648
1648
|
})
|
|
1649
1649
|
}),
|
|
1650
|
-
|
|
1651
|
-
layout:
|
|
1650
|
+
x && ee.length > 0 && /* @__PURE__ */ Y(Me, {
|
|
1651
|
+
layout: ee,
|
|
1652
1652
|
kind: "toolbar",
|
|
1653
|
-
entityActions:
|
|
1654
|
-
onRun:
|
|
1653
|
+
entityActions: w,
|
|
1654
|
+
onRun: te,
|
|
1655
1655
|
widgetContext: m,
|
|
1656
1656
|
ariaLabel: "List toolbar actions"
|
|
1657
1657
|
})
|
|
@@ -1660,40 +1660,40 @@ function _n({ title: t, description: n, toolbarActions: i, screenActionLayout: a
|
|
|
1660
1660
|
}
|
|
1661
1661
|
//#endregion
|
|
1662
1662
|
//#region src/components/pages/list/ListFloatbar.tsx
|
|
1663
|
-
function vn({ selectedIds: t, floatbarActions: n, screenActionLayout: r, entityActionLayout: i, data: a, rowKey:
|
|
1664
|
-
let { run:
|
|
1663
|
+
function vn({ selectedIds: t, floatbarActions: n, screenActionLayout: r, entityActionLayout: i, data: a, rowKey: c, entityCode: l, entity: u, screen: d, onClear: f, onActionSuccess: p, widgetContext: m }) {
|
|
1664
|
+
let { run: h } = M(), g = G(() => {
|
|
1665
1665
|
let e = {};
|
|
1666
1666
|
for (let { code: t, action: r } of n) e[t] = r;
|
|
1667
1667
|
return e;
|
|
1668
|
-
}, [n]),
|
|
1668
|
+
}, [n]), _ = G(() => {
|
|
1669
1669
|
if (t.length === 0) return [];
|
|
1670
1670
|
let e = /* @__PURE__ */ new Map();
|
|
1671
|
-
for (let t of a) e.set(
|
|
1671
|
+
for (let t of a) e.set(c(t), t);
|
|
1672
1672
|
return t.map((t) => e.get(t)).filter((e) => e !== void 0);
|
|
1673
1673
|
}, [
|
|
1674
1674
|
t,
|
|
1675
1675
|
a,
|
|
1676
|
-
|
|
1677
|
-
]),
|
|
1678
|
-
if (!
|
|
1679
|
-
let e =
|
|
1680
|
-
return e.some((t) => t !== e[0]) ? r :
|
|
1676
|
+
c
|
|
1677
|
+
]), v = G(() => {
|
|
1678
|
+
if (!u || !d || _.length === 0) return r;
|
|
1679
|
+
let e = _.map((e) => je(u, d, e));
|
|
1680
|
+
return e.some((t) => t !== e[0]) ? r : Be(u, d, _[0])?.action_layout;
|
|
1681
1681
|
}, [
|
|
1682
|
-
l,
|
|
1683
1682
|
u,
|
|
1684
|
-
|
|
1685
|
-
r
|
|
1686
|
-
]), v = G(() => de((_ ?? i) || w(h, "list_floatbar"), h, void 0, "list_floatbar"), [
|
|
1683
|
+
d,
|
|
1687
1684
|
_,
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
]), y = G(() => b(v, h, void 0, {}, g, ze(l, g)), [
|
|
1685
|
+
r
|
|
1686
|
+
]), b = G(() => o((v ?? i) || s(g, "list_floatbar"), g, void 0, "list_floatbar"), [
|
|
1691
1687
|
v,
|
|
1692
|
-
|
|
1688
|
+
i,
|
|
1689
|
+
g
|
|
1690
|
+
]), x = G(() => y(b, g, void 0, {}, _, Le(u, _)), [
|
|
1691
|
+
b,
|
|
1693
1692
|
g,
|
|
1694
|
-
|
|
1693
|
+
_,
|
|
1694
|
+
u
|
|
1695
1695
|
]);
|
|
1696
|
-
return
|
|
1696
|
+
return x.length === 0 ? null : /* @__PURE__ */ X("div", {
|
|
1697
1697
|
style: {
|
|
1698
1698
|
position: "fixed",
|
|
1699
1699
|
left: "50%",
|
|
@@ -1732,30 +1732,30 @@ function vn({ selectedIds: t, floatbarActions: n, screenActionLayout: r, entityA
|
|
|
1732
1732
|
children: t.length
|
|
1733
1733
|
}), "selected"]
|
|
1734
1734
|
}),
|
|
1735
|
-
/* @__PURE__ */ Y(
|
|
1736
|
-
layout:
|
|
1735
|
+
/* @__PURE__ */ Y(Me, {
|
|
1736
|
+
layout: x,
|
|
1737
1737
|
kind: "toolbar",
|
|
1738
|
-
entityActions:
|
|
1739
|
-
rowSelection:
|
|
1738
|
+
entityActions: g,
|
|
1739
|
+
rowSelection: _,
|
|
1740
1740
|
onRun: (e, n) => {
|
|
1741
|
-
let r =
|
|
1742
|
-
if (r !== null) return
|
|
1741
|
+
let r = Ve(e, n, {}, l);
|
|
1742
|
+
if (r !== null) return h({
|
|
1743
1743
|
action: n,
|
|
1744
|
-
title:
|
|
1745
|
-
bulkSelection:
|
|
1746
|
-
entity:
|
|
1744
|
+
title: L(n.display?.name) || e,
|
|
1745
|
+
bulkSelection: _,
|
|
1746
|
+
entity: l,
|
|
1747
1747
|
execute: async (e) => {
|
|
1748
|
-
let n = await
|
|
1749
|
-
return
|
|
1748
|
+
let n = await ne(r, S(e, t));
|
|
1749
|
+
return p(), n;
|
|
1750
1750
|
}
|
|
1751
1751
|
});
|
|
1752
1752
|
},
|
|
1753
|
-
widgetContext:
|
|
1753
|
+
widgetContext: m,
|
|
1754
1754
|
ariaLabel: "Floating action bar",
|
|
1755
1755
|
constrain: !1
|
|
1756
1756
|
}),
|
|
1757
1757
|
/* @__PURE__ */ Y("button", {
|
|
1758
|
-
onClick:
|
|
1758
|
+
onClick: f,
|
|
1759
1759
|
style: {
|
|
1760
1760
|
background: "none",
|
|
1761
1761
|
border: "none",
|
|
@@ -1793,19 +1793,19 @@ function bn(e, t) {
|
|
|
1793
1793
|
} else if (bn(n.items, t)) return !0;
|
|
1794
1794
|
return !1;
|
|
1795
1795
|
}
|
|
1796
|
-
function xn({ row: e, rowId:
|
|
1797
|
-
let { run: m } =
|
|
1798
|
-
...
|
|
1799
|
-
detail_screen:
|
|
1800
|
-
} :
|
|
1801
|
-
let e = {}, t =
|
|
1802
|
-
for (let { code: n, action: r } of
|
|
1796
|
+
function xn({ row: e, rowId: t, screen: n, fullScreen: r, entity: i, entityCode: a, rowActions: c, tabNavigate: l, locale: u, peekAllowed: d, hasDetailTarget: f, onPeek: p }) {
|
|
1797
|
+
let { run: m } = M(), h = r.detail_screen === void 0 && n.detail_screen !== void 0 ? {
|
|
1798
|
+
...r,
|
|
1799
|
+
detail_screen: n.detail_screen
|
|
1800
|
+
} : r, _ = Be(i, h, e) ?? h, v = G(() => {
|
|
1801
|
+
let e = {}, t = _.row_actions === void 0 ? void 0 : new Set(_.row_actions);
|
|
1802
|
+
for (let { code: n, action: r } of c) (!t || t.has(n)) && (e[n] = r);
|
|
1803
1803
|
return e;
|
|
1804
|
-
}, [
|
|
1805
|
-
entity:
|
|
1806
|
-
entityCode:
|
|
1807
|
-
screen:
|
|
1808
|
-
screenRoute:
|
|
1804
|
+
}, [c, _.row_actions]), b = G(() => ({
|
|
1805
|
+
entity: i,
|
|
1806
|
+
entityCode: a ?? "",
|
|
1807
|
+
screen: _,
|
|
1808
|
+
screenRoute: _.route,
|
|
1809
1809
|
selectedRows: [],
|
|
1810
1810
|
selectedIds: [],
|
|
1811
1811
|
locale: u,
|
|
@@ -1814,63 +1814,63 @@ function xn({ row: e, rowId: n, screen: r, fullScreen: i, entity: a, entityCode:
|
|
|
1814
1814
|
icon: t?.icon,
|
|
1815
1815
|
search: t?.search
|
|
1816
1816
|
}),
|
|
1817
|
-
runActionApi: (e, t) =>
|
|
1817
|
+
runActionApi: (e, t) => ne(e, t),
|
|
1818
1818
|
openPeek: (t) => p(t ?? e)
|
|
1819
1819
|
}), [
|
|
1820
|
+
i,
|
|
1820
1821
|
a,
|
|
1821
|
-
|
|
1822
|
-
g,
|
|
1822
|
+
_,
|
|
1823
1823
|
u,
|
|
1824
1824
|
l,
|
|
1825
1825
|
p,
|
|
1826
1826
|
e
|
|
1827
|
-
]),
|
|
1828
|
-
let e =
|
|
1829
|
-
return
|
|
1827
|
+
]), x = G(() => {
|
|
1828
|
+
let e = _.action_layout ?? null, t = i.action_layout ?? null, n = e ?? t ?? s(v, "list_row");
|
|
1829
|
+
return o(n, v, void 0, "list_row");
|
|
1830
1830
|
}, [
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
]),
|
|
1831
|
+
_,
|
|
1832
|
+
i,
|
|
1833
|
+
v
|
|
1834
|
+
]), C = G(() => yn(y(x, v, void 0, e, [], Re(i, e)), {
|
|
1835
1835
|
peek: d,
|
|
1836
1836
|
open: f
|
|
1837
1837
|
}), [
|
|
1838
|
-
|
|
1839
|
-
|
|
1838
|
+
x,
|
|
1839
|
+
v,
|
|
1840
1840
|
e,
|
|
1841
|
-
|
|
1841
|
+
i,
|
|
1842
1842
|
d,
|
|
1843
1843
|
f
|
|
1844
1844
|
]);
|
|
1845
1845
|
return {
|
|
1846
|
-
layout:
|
|
1847
|
-
entityActions:
|
|
1848
|
-
runRowAction: U((
|
|
1849
|
-
let i =
|
|
1846
|
+
layout: C,
|
|
1847
|
+
entityActions: v,
|
|
1848
|
+
runRowAction: U((n, r) => {
|
|
1849
|
+
let i = Ve(n, r, { row: e });
|
|
1850
1850
|
if (i !== null) return m({
|
|
1851
1851
|
action: r,
|
|
1852
|
-
title:
|
|
1852
|
+
title: L(r.display?.name) || n,
|
|
1853
1853
|
row: e,
|
|
1854
|
-
execute: (e) =>
|
|
1854
|
+
execute: (e) => ne(i, S(e, [t]))
|
|
1855
1855
|
});
|
|
1856
1856
|
}, [
|
|
1857
1857
|
m,
|
|
1858
|
-
|
|
1858
|
+
t,
|
|
1859
1859
|
e
|
|
1860
1860
|
]),
|
|
1861
|
-
widgetContext:
|
|
1862
|
-
hasPeek: G(() => bn(
|
|
1861
|
+
widgetContext: b,
|
|
1862
|
+
hasPeek: G(() => bn(C, g), [C])
|
|
1863
1863
|
};
|
|
1864
1864
|
}
|
|
1865
1865
|
//#endregion
|
|
1866
1866
|
//#region src/components/pages/list/RowActionsCell.tsx
|
|
1867
|
-
function Sn({ row: t, rowId: n, screen:
|
|
1867
|
+
function Sn({ row: t, rowId: n, screen: i, fullScreen: a, entity: o, entityCode: s, rowActions: c, tabNavigate: l, peekAllowed: u, hasDetailTarget: d, onPeek: f, locale: p }) {
|
|
1868
1868
|
let { layout: m, entityActions: h, runRowAction: g, widgetContext: _, hasPeek: v } = xn({
|
|
1869
1869
|
row: t,
|
|
1870
1870
|
rowId: n,
|
|
1871
|
-
screen:
|
|
1872
|
-
fullScreen:
|
|
1873
|
-
entity:
|
|
1871
|
+
screen: i,
|
|
1872
|
+
fullScreen: a,
|
|
1873
|
+
entity: o,
|
|
1874
1874
|
entityCode: s,
|
|
1875
1875
|
rowActions: c,
|
|
1876
1876
|
tabNavigate: l,
|
|
@@ -1887,14 +1887,14 @@ function Sn({ row: t, rowId: n, screen: r, fullScreen: i, entity: a, entityCode:
|
|
|
1887
1887
|
gap: 2,
|
|
1888
1888
|
justifyContent: "flex-end"
|
|
1889
1889
|
},
|
|
1890
|
-
children: [v && /* @__PURE__ */ Y(
|
|
1890
|
+
children: [v && /* @__PURE__ */ Y(r, {
|
|
1891
1891
|
size: 22,
|
|
1892
1892
|
icon: /* @__PURE__ */ Y(e.eye, { size: 12 }),
|
|
1893
1893
|
onClick: (e) => {
|
|
1894
1894
|
e.stopPropagation(), f(t);
|
|
1895
1895
|
},
|
|
1896
1896
|
title: "Peek"
|
|
1897
|
-
}), m.length > 0 && /* @__PURE__ */ Y(
|
|
1897
|
+
}), m.length > 0 && /* @__PURE__ */ Y(Me, {
|
|
1898
1898
|
layout: m,
|
|
1899
1899
|
row: t,
|
|
1900
1900
|
kind: "row",
|
|
@@ -1908,7 +1908,7 @@ function Sn({ row: t, rowId: n, screen: r, fullScreen: i, entity: a, entityCode:
|
|
|
1908
1908
|
//#endregion
|
|
1909
1909
|
//#region src/components/pages/list/columns.ts
|
|
1910
1910
|
function Cn(t, n, r, i) {
|
|
1911
|
-
let a =
|
|
1911
|
+
let a = De(n, r);
|
|
1912
1912
|
if (!a || a.read !== "denied") return i ? V("span", { title: i }, t) : t;
|
|
1913
1913
|
let o = a.required_permission ? `Locked column: requires "${a.required_permission}"` : `Locked column: ${a.classification} classification`;
|
|
1914
1914
|
return V("span", {
|
|
@@ -1920,67 +1920,67 @@ function Cn(t, n, r, i) {
|
|
|
1920
1920
|
function Q(e) {
|
|
1921
1921
|
return {
|
|
1922
1922
|
minSize: Math.min(60, e),
|
|
1923
|
-
maxSize: Math.max(
|
|
1923
|
+
maxSize: Math.max(Ae, e)
|
|
1924
1924
|
};
|
|
1925
1925
|
}
|
|
1926
1926
|
function wn(e) {
|
|
1927
|
-
let { visibleCols:
|
|
1928
|
-
if (
|
|
1929
|
-
let
|
|
1930
|
-
|
|
1927
|
+
let { visibleCols: n, entity: r, screen: i, schema: a, entityCode: o, rowActions: s, hasBatchActions: c, hasExplicitRowActions: l, canUpdate: u, canDelete: d, peekEnabled: f, hasDetailTarget: p, userLocale: m, tabNavigate: h, refsRef: g, rowSelectionKey: _, setPeekRow: v } = e;
|
|
1928
|
+
if (n.length === 0 || !r) return [];
|
|
1929
|
+
let y = [];
|
|
1930
|
+
c && y.push({
|
|
1931
1931
|
id: "_select",
|
|
1932
1932
|
enableResizing: !1,
|
|
1933
|
-
header: ({ table: e }) => V(
|
|
1933
|
+
header: ({ table: e }) => V(be, {
|
|
1934
1934
|
checked: e.getIsAllRowsSelected(),
|
|
1935
1935
|
indeterminate: e.getIsSomeRowsSelected(),
|
|
1936
1936
|
onChange: () => e.toggleAllRowsSelected()
|
|
1937
1937
|
}),
|
|
1938
1938
|
size: 34,
|
|
1939
|
-
cell: ({ row: e }) => V("span", { "data-testid": "row-select-checkbox" }, V(
|
|
1939
|
+
cell: ({ row: e }) => V("span", { "data-testid": "row-select-checkbox" }, V(be, {
|
|
1940
1940
|
checked: e.getIsSelected(),
|
|
1941
1941
|
onChange: () => e.toggleSelected()
|
|
1942
1942
|
}))
|
|
1943
1943
|
});
|
|
1944
|
-
for (let e of
|
|
1944
|
+
for (let e of n) {
|
|
1945
1945
|
if (e.startsWith("$status.")) {
|
|
1946
|
-
let t = e.slice(8),
|
|
1947
|
-
if (!
|
|
1948
|
-
let i = new Map(
|
|
1949
|
-
|
|
1946
|
+
let t = e.slice(8), n = r.status_groups?.[t];
|
|
1947
|
+
if (!n) continue;
|
|
1948
|
+
let i = new Map(n.statuses.map((e) => [e.code, e]));
|
|
1949
|
+
y.push({
|
|
1950
1950
|
id: e,
|
|
1951
|
-
header:
|
|
1951
|
+
header: L(n.name) || t,
|
|
1952
1952
|
size: 140,
|
|
1953
1953
|
...Q(140),
|
|
1954
1954
|
cell: ({ row: e }) => {
|
|
1955
1955
|
let n = e.original.$statuses?.find((e) => e.group_code === t);
|
|
1956
1956
|
if (!n) return V("span", { className: "text-sm text-muted-foreground" }, "-");
|
|
1957
1957
|
let r = i.get(n.status_code);
|
|
1958
|
-
return V(
|
|
1958
|
+
return V(me, {
|
|
1959
1959
|
tone: r?.color ?? "slate",
|
|
1960
1960
|
size: "xs"
|
|
1961
|
-
},
|
|
1961
|
+
}, L(r?.name) || n.status_code);
|
|
1962
1962
|
}
|
|
1963
1963
|
});
|
|
1964
1964
|
continue;
|
|
1965
1965
|
}
|
|
1966
1966
|
if (e.startsWith("$property.")) {
|
|
1967
|
-
let t = e.slice(10),
|
|
1968
|
-
if (!
|
|
1969
|
-
|
|
1967
|
+
let t = e.slice(10), n = r.properties?.[t];
|
|
1968
|
+
if (!n) continue;
|
|
1969
|
+
y.push({
|
|
1970
1970
|
id: e,
|
|
1971
|
-
header: () => Cn(
|
|
1971
|
+
header: () => Cn(L(n.name) || t, r, t, L(n.description) || void 0),
|
|
1972
1972
|
size: 150,
|
|
1973
1973
|
...Q(150),
|
|
1974
1974
|
enableSorting: !1,
|
|
1975
1975
|
cell: ({ row: e }) => {
|
|
1976
1976
|
let n = e.original.$properties?.find((e) => e.property_code === t);
|
|
1977
|
-
return !n || n.value == null ? V("span", { className: "text-sm text-muted-foreground" }, "-") : V("span", { className: "text-sm" },
|
|
1977
|
+
return !n || n.value == null ? V("span", { className: "text-sm text-muted-foreground" }, "-") : V("span", { className: "text-sm" }, I(n.value));
|
|
1978
1978
|
}
|
|
1979
1979
|
});
|
|
1980
1980
|
continue;
|
|
1981
1981
|
}
|
|
1982
1982
|
if (e === "$evidence") {
|
|
1983
|
-
|
|
1983
|
+
y.push({
|
|
1984
1984
|
id: e,
|
|
1985
1985
|
header: "Evidence",
|
|
1986
1986
|
size: 140,
|
|
@@ -1988,25 +1988,25 @@ function wn(e) {
|
|
|
1988
1988
|
enableSorting: !1,
|
|
1989
1989
|
cell: ({ row: e }) => {
|
|
1990
1990
|
let t = e.original.$evidence?.verdict ?? "unverified";
|
|
1991
|
-
return V(
|
|
1992
|
-
tone:
|
|
1991
|
+
return V(me, {
|
|
1992
|
+
tone: ct(t),
|
|
1993
1993
|
size: "xs",
|
|
1994
1994
|
dot: !0
|
|
1995
|
-
},
|
|
1995
|
+
}, ut(t));
|
|
1996
1996
|
}
|
|
1997
1997
|
});
|
|
1998
1998
|
continue;
|
|
1999
1999
|
}
|
|
2000
|
-
if (
|
|
2001
|
-
|
|
2000
|
+
if (r.files?.get(e)) {
|
|
2001
|
+
y.push({
|
|
2002
2002
|
id: e,
|
|
2003
2003
|
accessorFn: (t) => t.$files?.[e] ?? null,
|
|
2004
|
-
header: () => Cn(
|
|
2004
|
+
header: () => Cn(Ie(r, e, a?.entities), r, e),
|
|
2005
2005
|
size: 150,
|
|
2006
2006
|
...Q(150),
|
|
2007
|
-
cell: ({ row: t }) =>
|
|
2008
|
-
entity:
|
|
2009
|
-
entityCode:
|
|
2007
|
+
cell: ({ row: t }) => ze({
|
|
2008
|
+
entity: r,
|
|
2009
|
+
entityCode: o,
|
|
2010
2010
|
fieldName: e,
|
|
2011
2011
|
record: t.original,
|
|
2012
2012
|
mode: "display",
|
|
@@ -2017,52 +2017,52 @@ function wn(e) {
|
|
|
2017
2017
|
});
|
|
2018
2018
|
continue;
|
|
2019
2019
|
}
|
|
2020
|
-
let
|
|
2021
|
-
if (!
|
|
2022
|
-
let
|
|
2023
|
-
field:
|
|
2020
|
+
let n = r.fields.get(e);
|
|
2021
|
+
if (!n) continue;
|
|
2022
|
+
let i = t(n, e, a?.entities), s = n.display?.width, c = ae({
|
|
2023
|
+
field: n,
|
|
2024
2024
|
fieldName: e,
|
|
2025
2025
|
surface: "list",
|
|
2026
|
-
entity:
|
|
2027
|
-
entities:
|
|
2028
|
-
screens:
|
|
2026
|
+
entity: r,
|
|
2027
|
+
entities: a?.entities,
|
|
2028
|
+
screens: a?.screens,
|
|
2029
2029
|
refs: () => g.current,
|
|
2030
2030
|
locale: m
|
|
2031
2031
|
});
|
|
2032
|
-
|
|
2032
|
+
y.push({
|
|
2033
2033
|
id: e,
|
|
2034
2034
|
accessorKey: e,
|
|
2035
|
-
header: () => Cn(
|
|
2036
|
-
enableSorting:
|
|
2037
|
-
size:
|
|
2038
|
-
...Q(
|
|
2039
|
-
cell: ({ getValue: e, row: t }) =>
|
|
2035
|
+
header: () => Cn(i, r, e, L(n.display?.description) || void 0),
|
|
2036
|
+
enableSorting: n.type !== "json",
|
|
2037
|
+
size: s ?? 150,
|
|
2038
|
+
...Q(s ?? 150),
|
|
2039
|
+
cell: ({ getValue: e, row: t }) => c(e(), t.original)
|
|
2040
2040
|
});
|
|
2041
2041
|
}
|
|
2042
|
-
return (!
|
|
2042
|
+
return (!l && u || !l && d || s.length > 0) && y.push({
|
|
2043
2043
|
id: "_actions",
|
|
2044
2044
|
enableResizing: !1,
|
|
2045
2045
|
header: "",
|
|
2046
2046
|
size: 40,
|
|
2047
2047
|
cell: ({ row: e }) => V(Sn, {
|
|
2048
2048
|
row: e.original,
|
|
2049
|
-
rowId: _(
|
|
2050
|
-
screen:
|
|
2051
|
-
fullScreen:
|
|
2052
|
-
entity:
|
|
2053
|
-
entityCode:
|
|
2054
|
-
rowActions:
|
|
2049
|
+
rowId: _(r, e.original),
|
|
2050
|
+
screen: i,
|
|
2051
|
+
fullScreen: i,
|
|
2052
|
+
entity: r,
|
|
2053
|
+
entityCode: o,
|
|
2054
|
+
rowActions: s,
|
|
2055
2055
|
tabNavigate: h,
|
|
2056
|
-
peekAllowed:
|
|
2057
|
-
hasDetailTarget:
|
|
2058
|
-
onPeek:
|
|
2056
|
+
peekAllowed: f,
|
|
2057
|
+
hasDetailTarget: p,
|
|
2058
|
+
onPeek: v,
|
|
2059
2059
|
locale: m
|
|
2060
2060
|
})
|
|
2061
|
-
}),
|
|
2061
|
+
}), y;
|
|
2062
2062
|
}
|
|
2063
2063
|
//#endregion
|
|
2064
2064
|
//#region src/components/pages/list/RowContextMenu.tsx
|
|
2065
|
-
function Tn({ x: e, y: t, row: n, rowId: r, screen: i, fullScreen: a, entity: o, entityCode: s, rowActions: c, tabNavigate: l, locale: u, peekAllowed: d, hasDetailTarget:
|
|
2065
|
+
function Tn({ x: e, y: t, row: n, rowId: r, screen: i, fullScreen: a, entity: o, entityCode: s, rowActions: c, tabNavigate: l, locale: u, peekAllowed: d, hasDetailTarget: p, onPeek: m, onClose: h }) {
|
|
2066
2066
|
let { layout: g, entityActions: _, runRowAction: v, widgetContext: y } = xn({
|
|
2067
2067
|
row: n,
|
|
2068
2068
|
rowId: r,
|
|
@@ -2074,31 +2074,31 @@ function Tn({ x: e, y: t, row: n, rowId: r, screen: i, fullScreen: a, entity: o,
|
|
|
2074
2074
|
tabNavigate: l,
|
|
2075
2075
|
locale: u,
|
|
2076
2076
|
peekAllowed: d,
|
|
2077
|
-
hasDetailTarget:
|
|
2078
|
-
onPeek:
|
|
2079
|
-
}), [b, x] = q(null), S = U((e, t) => (
|
|
2077
|
+
hasDetailTarget: p,
|
|
2078
|
+
onPeek: m
|
|
2079
|
+
}), [b, x] = q(null), S = U((e, t) => (h(), v(e, t)), [h, v]);
|
|
2080
2080
|
return g.length === 0 ? null : /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y("div", {
|
|
2081
|
-
onClick:
|
|
2081
|
+
onClick: h,
|
|
2082
2082
|
onContextMenu: (e) => {
|
|
2083
|
-
e.preventDefault(),
|
|
2083
|
+
e.preventDefault(), h();
|
|
2084
2084
|
},
|
|
2085
2085
|
style: {
|
|
2086
2086
|
position: "fixed",
|
|
2087
2087
|
inset: 0,
|
|
2088
2088
|
zIndex: 190
|
|
2089
2089
|
}
|
|
2090
|
-
}), /* @__PURE__ */ Y(
|
|
2090
|
+
}), /* @__PURE__ */ Y(f, {
|
|
2091
2091
|
open: !0,
|
|
2092
2092
|
anchor: null,
|
|
2093
2093
|
anchorPoint: {
|
|
2094
2094
|
x: e,
|
|
2095
2095
|
y: t
|
|
2096
2096
|
},
|
|
2097
|
-
onClose:
|
|
2097
|
+
onClose: h,
|
|
2098
2098
|
width: 220,
|
|
2099
2099
|
children: /* @__PURE__ */ Y("div", {
|
|
2100
|
-
onClick:
|
|
2101
|
-
children: /* @__PURE__ */ Y(
|
|
2100
|
+
onClick: h,
|
|
2101
|
+
children: /* @__PURE__ */ Y(Fe, {
|
|
2102
2102
|
layout: g,
|
|
2103
2103
|
entityActions: _,
|
|
2104
2104
|
onRun: S,
|
|
@@ -2203,143 +2203,143 @@ function On({ visibleCols: e, onReorder: t, scrollElRef: n, theadRef: r }) {
|
|
|
2203
2203
|
}
|
|
2204
2204
|
//#endregion
|
|
2205
2205
|
//#region src/components/pages/SmartListPage.impl.tsx
|
|
2206
|
-
var kn = gt(() => import("./ListCardsBody-
|
|
2206
|
+
var kn = gt(() => import("./ListCardsBody-Cdsvu0Vs.js").then((e) => ({ default: e.ListCardsBody })));
|
|
2207
2207
|
function An({ screenCode: e }) {
|
|
2208
|
-
return /* @__PURE__ */ Y(
|
|
2208
|
+
return /* @__PURE__ */ Y(ce, { children: /* @__PURE__ */ Y(jn, { screenCode: e }) });
|
|
2209
2209
|
}
|
|
2210
2210
|
function jn({ screenCode: e }) {
|
|
2211
|
-
let
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
]),
|
|
2211
|
+
let n = Ce(), [r, i] = _t(), { data: a } = de(), o = re(), [s, c] = q(!1), [f, m] = q(!1), { filters: h, filterError: g, activeCount: _, setFilters: v, clearFilters: y } = tt(), S = te((e) => e.user), C = te((e) => e.activeTenant), T = O(), k = a?.screens[e], A = k?.entity ? a?.entities[k.entity] : void 0, j = k?.entity, M = w(A, "create"), ie = w(A, "update"), N = w(A, "delete"), P = a?.actions, F = G(() => u(l(A?.actions, k?.actions, "list_toolbar", P), A), [
|
|
2212
|
+
A,
|
|
2213
|
+
k?.actions,
|
|
2214
|
+
P
|
|
2215
|
+
]), R = G(() => u(l(A?.actions, void 0, "list_floatbar", P), A), [A, P]), oe = G(() => {
|
|
2216
2216
|
let e = /* @__PURE__ */ new Map(), t = (t) => {
|
|
2217
|
-
for (let n of
|
|
2217
|
+
for (let n of l(A?.actions, t, "list_row", P)) e.set(n.code, n);
|
|
2218
2218
|
};
|
|
2219
|
-
t(
|
|
2220
|
-
for (let e of
|
|
2221
|
-
return
|
|
2219
|
+
t(k?.row_actions);
|
|
2220
|
+
for (let e of k?.variants?.items() ?? []) e.row_actions !== void 0 && t(e.row_actions);
|
|
2221
|
+
return u([...e.values()], A);
|
|
2222
2222
|
}, [
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
]), se =
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
]),
|
|
2231
|
-
|
|
2232
|
-
let
|
|
2233
|
-
if (!
|
|
2234
|
-
let t =
|
|
2223
|
+
A,
|
|
2224
|
+
k,
|
|
2225
|
+
P
|
|
2226
|
+
]), se = k?.row_actions !== void 0, ce = G(() => R.length > 0 || A?.export?.enabled !== !1 && k?.export?.enabled !== !1, [
|
|
2227
|
+
R,
|
|
2228
|
+
A?.export?.enabled,
|
|
2229
|
+
k?.export?.enabled
|
|
2230
|
+
]), le = !!A?.soft_delete, ue = le && (S?.permissions ?? []).some((e) => e === "feature:view_deleted" || e === "feature:*" || e === "*"), fe = ue && r.get("include_deleted") === "true", pe = x(), { openTab: me, updateTabSearch: _e, findTabByPathname: ve } = Se();
|
|
2231
|
+
ot(k, A, r.toString()), st(k?.route);
|
|
2232
|
+
let ye = U((e) => {
|
|
2233
|
+
if (!k?.route || !A || pe.enabled) return;
|
|
2234
|
+
let t = ve(k.route);
|
|
2235
2235
|
if (t) {
|
|
2236
|
-
|
|
2236
|
+
_e(t.id, e);
|
|
2237
2237
|
return;
|
|
2238
2238
|
}
|
|
2239
|
-
|
|
2240
|
-
pathname:
|
|
2239
|
+
me({
|
|
2240
|
+
pathname: k.route,
|
|
2241
2241
|
search: e,
|
|
2242
|
-
title:
|
|
2243
|
-
icon:
|
|
2242
|
+
title: L(k.display?.name) || L(A.display.name_plural),
|
|
2243
|
+
icon: k.display?.icon || A.display.icon,
|
|
2244
2244
|
closable: !0
|
|
2245
2245
|
});
|
|
2246
2246
|
}, [
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
]),
|
|
2254
|
-
let e = parseInt(
|
|
2247
|
+
k,
|
|
2248
|
+
A,
|
|
2249
|
+
pe.enabled,
|
|
2250
|
+
ve,
|
|
2251
|
+
_e,
|
|
2252
|
+
me
|
|
2253
|
+
]), be = parseInt(r.get("page") ?? "1", 10), xe = (() => {
|
|
2254
|
+
let e = parseInt(r.get("per_page") ?? "", 10);
|
|
2255
2255
|
return !Number.isFinite(e) || e <= 0 || e > 1e3 ? 200 : e;
|
|
2256
|
-
})(),
|
|
2257
|
-
searchParams:
|
|
2256
|
+
})(), Te = r.get("search") ?? "", Ee = Mt({
|
|
2257
|
+
searchParams: r,
|
|
2258
2258
|
setSearchParams: i,
|
|
2259
|
-
screenSortDefault:
|
|
2260
|
-
commitScreenTabSearch:
|
|
2261
|
-
}), { cols:
|
|
2262
|
-
|
|
2263
|
-
|
|
2259
|
+
screenSortDefault: k?.sort_default,
|
|
2260
|
+
commitScreenTabSearch: ye
|
|
2261
|
+
}), { cols: De, nullsByField: ke, forRequest: Ae, tableSorting: je, write: Me, applyColumn: Fe, shiftClickColumn: Ie, appendColumn: Le, clearColumn: Re, clearAll: ze } = Ee, Ve = G(() => jt(k, A, a?.entities), [
|
|
2262
|
+
k,
|
|
2263
|
+
A,
|
|
2264
2264
|
a?.entities
|
|
2265
|
-
]),
|
|
2265
|
+
]), Ge = Lt({
|
|
2266
2266
|
screenCode: e,
|
|
2267
|
-
screen:
|
|
2268
|
-
searchParams:
|
|
2267
|
+
screen: k,
|
|
2268
|
+
searchParams: r,
|
|
2269
2269
|
setSearchParams: i
|
|
2270
|
-
}), { visible:
|
|
2270
|
+
}), { visible: Ke, sizing: Ze, setSizing: Qe, apply: et, commitResize: nt } = Ge, rt = fn({
|
|
2271
2271
|
screenCode: e,
|
|
2272
|
-
screen:
|
|
2273
|
-
searchParams:
|
|
2272
|
+
screen: k,
|
|
2273
|
+
searchParams: r,
|
|
2274
2274
|
setSearchParams: i,
|
|
2275
|
-
userId:
|
|
2276
|
-
tenantId:
|
|
2277
|
-
filterError: !!
|
|
2278
|
-
filters:
|
|
2279
|
-
visibleColumns:
|
|
2280
|
-
sort:
|
|
2281
|
-
}), { active:
|
|
2282
|
-
let e =
|
|
2283
|
-
return e === "table" || e === "cards" ? e :
|
|
2284
|
-
}, [
|
|
2285
|
-
entity:
|
|
2286
|
-
screen:
|
|
2287
|
-
savedViewColumns:
|
|
2275
|
+
userId: S?.id,
|
|
2276
|
+
tenantId: C?.id,
|
|
2277
|
+
filterError: !!g,
|
|
2278
|
+
filters: h,
|
|
2279
|
+
visibleColumns: Ke,
|
|
2280
|
+
sort: Ae
|
|
2281
|
+
}), { active: z, saveAsNew: it, overwriteActive: ct, isSaving: lt } = rt, ut = E(Te, 300), dt = p(), B = G(() => {
|
|
2282
|
+
let e = k?.responsive?.[dt.category]?.presentation;
|
|
2283
|
+
return e === "table" || e === "cards" ? e : dt.category === "phone" ? "cards" : "table";
|
|
2284
|
+
}, [k?.responsive, dt.category]), ft = G(() => Je({
|
|
2285
|
+
entity: A,
|
|
2286
|
+
screen: k,
|
|
2287
|
+
savedViewColumns: z?.columns
|
|
2288
2288
|
}), [
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
]), V = G(() =>
|
|
2293
|
-
entity:
|
|
2294
|
-
screen:
|
|
2289
|
+
A,
|
|
2290
|
+
k,
|
|
2291
|
+
z?.columns
|
|
2292
|
+
]), V = G(() => We({
|
|
2293
|
+
entity: A,
|
|
2294
|
+
screen: k,
|
|
2295
2295
|
presentation: B,
|
|
2296
|
-
visibleColumns:
|
|
2296
|
+
visibleColumns: Ke,
|
|
2297
2297
|
card: ft,
|
|
2298
|
-
rowActions:
|
|
2299
|
-
toolbarActions:
|
|
2300
|
-
bulkActions:
|
|
2301
|
-
sort:
|
|
2298
|
+
rowActions: oe,
|
|
2299
|
+
toolbarActions: F,
|
|
2300
|
+
bulkActions: R,
|
|
2301
|
+
sort: De,
|
|
2302
2302
|
screens: a?.screens
|
|
2303
2303
|
}), [
|
|
2304
|
-
|
|
2305
|
-
|
|
2304
|
+
A,
|
|
2305
|
+
k,
|
|
2306
2306
|
B,
|
|
2307
|
-
|
|
2307
|
+
Ke,
|
|
2308
2308
|
ft,
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2309
|
+
oe,
|
|
2310
|
+
F,
|
|
2311
|
+
R,
|
|
2312
|
+
De,
|
|
2313
2313
|
a?.screens
|
|
2314
2314
|
]), gt = mt({
|
|
2315
|
-
entity:
|
|
2316
|
-
entityCode:
|
|
2317
|
-
screen:
|
|
2315
|
+
entity: A,
|
|
2316
|
+
entityCode: j,
|
|
2317
|
+
screen: k,
|
|
2318
2318
|
screenCode: e,
|
|
2319
|
-
page:
|
|
2320
|
-
perPage:
|
|
2321
|
-
sortForRequest:
|
|
2322
|
-
debouncedSearch:
|
|
2323
|
-
filters:
|
|
2324
|
-
filterError: !!
|
|
2325
|
-
includeDeleted:
|
|
2319
|
+
page: be,
|
|
2320
|
+
perPage: xe,
|
|
2321
|
+
sortForRequest: Ae,
|
|
2322
|
+
debouncedSearch: ut,
|
|
2323
|
+
filters: h,
|
|
2324
|
+
filterError: !!g,
|
|
2325
|
+
includeDeleted: fe,
|
|
2326
2326
|
expand: V.expandFields,
|
|
2327
2327
|
select: V.selectFields,
|
|
2328
2328
|
runCountQuery: !0,
|
|
2329
|
-
urlKey: `${
|
|
2330
|
-
}), { rows: H, meta: vt, refs: yt, isLoading: bt, isFetching: xt, isError: St, error: Ct, isLoadingStale: wt, retry: Tt, countTotal: Et, countStrategy: At, countLoading: Nt, countError: Ft, totalPages: Rt, hasMorePages: zt, isCursor: Bt, fetchNextPage: Vt, isFetchingNextPage: Ut } = gt, Wt = It(
|
|
2329
|
+
urlKey: `${j ?? ""}|${r.toString()}`
|
|
2330
|
+
}), { rows: H, meta: vt, refs: yt, isLoading: bt, isFetching: xt, isError: St, error: Ct, isLoadingStale: wt, retry: Tt, countTotal: Et, countStrategy: At, countLoading: Nt, countError: Ft, totalPages: Rt, hasMorePages: zt, isCursor: Bt, fetchNextPage: Vt, isFetchingNextPage: Ut } = gt, Wt = It(A, H, xt), { state: Gt, setState: qt, ids: Jt, pkValues: Yt, rows: Xt, keyOf: Qt } = Wt, en = ee(A?.realtime, j ?? ""), rn = Oe(j ?? ""), an = K(yt);
|
|
2331
2331
|
an.current = yt;
|
|
2332
2332
|
let on = G(() => {
|
|
2333
2333
|
let e = /* @__PURE__ */ new Map();
|
|
2334
|
-
if (!
|
|
2335
|
-
for (let t of
|
|
2336
|
-
if (t.startsWith("$") ||
|
|
2337
|
-
let n =
|
|
2334
|
+
if (!A) return e;
|
|
2335
|
+
for (let t of Ue(A, k, z?.columns)) {
|
|
2336
|
+
if (t.startsWith("$") || A.files?.get(t)) continue;
|
|
2337
|
+
let n = A.fields.get(t);
|
|
2338
2338
|
n && e.set(t, ae({
|
|
2339
2339
|
field: n,
|
|
2340
2340
|
fieldName: t,
|
|
2341
2341
|
surface: "list",
|
|
2342
|
-
entity:
|
|
2342
|
+
entity: A,
|
|
2343
2343
|
entities: a?.entities,
|
|
2344
2344
|
screens: a?.screens,
|
|
2345
2345
|
refs: () => an.current,
|
|
@@ -2348,60 +2348,60 @@ function jn({ screenCode: e }) {
|
|
|
2348
2348
|
}
|
|
2349
2349
|
return e;
|
|
2350
2350
|
}, [
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2351
|
+
A,
|
|
2352
|
+
k,
|
|
2353
|
+
z?.columns,
|
|
2354
2354
|
a?.entities,
|
|
2355
2355
|
a?.screens,
|
|
2356
2356
|
an,
|
|
2357
2357
|
o
|
|
2358
|
-
]), { labelFor: sn, refs: cn } = mn(
|
|
2359
|
-
entity:
|
|
2360
|
-
screen:
|
|
2358
|
+
]), { labelFor: sn, refs: cn } = mn(Ve, h, yt, a?.entities), un = Ht({
|
|
2359
|
+
entity: A,
|
|
2360
|
+
screen: k,
|
|
2361
2361
|
screens: a?.screens,
|
|
2362
2362
|
entities: a?.entities,
|
|
2363
|
-
searchParams:
|
|
2364
|
-
tabNavigate:
|
|
2365
|
-
commitScreenTabSearch:
|
|
2366
|
-
isPhone:
|
|
2367
|
-
canUpdate:
|
|
2368
|
-
}), { peekAllowed: dn, peekRow: Z, setPeekRow: hn, peekFields: yn, peekActions: bn, peekExecute: xn, contextMenu: Sn, setContextMenu: Cn } = un, Q = G(() => !
|
|
2369
|
-
|
|
2370
|
-
|
|
2363
|
+
searchParams: r,
|
|
2364
|
+
tabNavigate: n,
|
|
2365
|
+
commitScreenTabSearch: ye,
|
|
2366
|
+
isPhone: dt.category === "phone",
|
|
2367
|
+
canUpdate: ie
|
|
2368
|
+
}), { peekAllowed: dn, peekRow: Z, setPeekRow: hn, peekFields: yn, peekActions: bn, peekExecute: xn, contextMenu: Sn, setContextMenu: Cn } = un, Q = G(() => !k || !A ? !1 : d(k, "_", A, a?.screens) !== null, [
|
|
2369
|
+
k,
|
|
2370
|
+
A,
|
|
2371
2371
|
a?.screens
|
|
2372
2372
|
]), En = G(() => wn({
|
|
2373
|
-
visibleCols:
|
|
2374
|
-
entity:
|
|
2375
|
-
screen:
|
|
2373
|
+
visibleCols: Ke,
|
|
2374
|
+
entity: A,
|
|
2375
|
+
screen: k,
|
|
2376
2376
|
schema: a,
|
|
2377
|
-
entityCode:
|
|
2378
|
-
rowActions:
|
|
2379
|
-
hasBatchActions:
|
|
2377
|
+
entityCode: j,
|
|
2378
|
+
rowActions: oe,
|
|
2379
|
+
hasBatchActions: ce,
|
|
2380
2380
|
hasExplicitRowActions: se,
|
|
2381
|
-
canUpdate:
|
|
2382
|
-
canDelete:
|
|
2381
|
+
canUpdate: ie,
|
|
2382
|
+
canDelete: N,
|
|
2383
2383
|
peekEnabled: dn,
|
|
2384
2384
|
hasDetailTarget: Q,
|
|
2385
2385
|
userLocale: o,
|
|
2386
|
-
tabNavigate:
|
|
2386
|
+
tabNavigate: n,
|
|
2387
2387
|
refsRef: an,
|
|
2388
2388
|
rowSelectionKey: Pt,
|
|
2389
2389
|
setPeekRow: hn
|
|
2390
2390
|
}), [
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2391
|
+
k,
|
|
2392
|
+
A,
|
|
2393
|
+
Ke,
|
|
2394
|
+
n,
|
|
2395
|
+
ce,
|
|
2396
|
+
oe,
|
|
2397
2397
|
se,
|
|
2398
|
-
|
|
2398
|
+
j,
|
|
2399
2399
|
dn,
|
|
2400
2400
|
Q,
|
|
2401
2401
|
a,
|
|
2402
2402
|
o,
|
|
2403
|
-
|
|
2404
|
-
|
|
2403
|
+
ie,
|
|
2404
|
+
N,
|
|
2405
2405
|
an,
|
|
2406
2406
|
hn
|
|
2407
2407
|
]), $ = Dt({
|
|
@@ -2411,37 +2411,37 @@ function jn({ screenCode: e }) {
|
|
|
2411
2411
|
manualSorting: !0,
|
|
2412
2412
|
enableColumnResizing: !0,
|
|
2413
2413
|
columnResizeMode: "onChange",
|
|
2414
|
-
onColumnSizingChange:
|
|
2414
|
+
onColumnSizingChange: Qe,
|
|
2415
2415
|
state: {
|
|
2416
|
-
sorting:
|
|
2416
|
+
sorting: je,
|
|
2417
2417
|
rowSelection: Gt,
|
|
2418
|
-
columnSizing:
|
|
2418
|
+
columnSizing: Ze
|
|
2419
2419
|
},
|
|
2420
2420
|
onSortingChange: (e) => {
|
|
2421
|
-
let t = (typeof e == "function" ? e(
|
|
2421
|
+
let t = (typeof e == "function" ? e(je) : e).slice(0, 5);
|
|
2422
2422
|
if (t.length === 0) {
|
|
2423
|
-
|
|
2423
|
+
Me([]);
|
|
2424
2424
|
return;
|
|
2425
2425
|
}
|
|
2426
2426
|
let n = t.map((e) => {
|
|
2427
|
-
let t =
|
|
2427
|
+
let t = ke.get(e.id);
|
|
2428
2428
|
return {
|
|
2429
2429
|
field: e.id,
|
|
2430
2430
|
dir: e.desc ? "desc" : "asc",
|
|
2431
2431
|
...t ? { nulls: t } : {}
|
|
2432
2432
|
};
|
|
2433
2433
|
});
|
|
2434
|
-
|
|
2434
|
+
Me(n);
|
|
2435
2435
|
},
|
|
2436
2436
|
onRowSelectionChange: qt,
|
|
2437
2437
|
getRowId: Qt
|
|
2438
2438
|
}), Dn = $.state.columnResizing.isResizingColumn, An = K(!1);
|
|
2439
2439
|
W(() => {
|
|
2440
2440
|
let e = !!An.current && !Dn;
|
|
2441
|
-
An.current = Dn, e &&
|
|
2441
|
+
An.current = Dn, e && nt($.state.columnSizing);
|
|
2442
2442
|
}, [
|
|
2443
2443
|
Dn,
|
|
2444
|
-
|
|
2444
|
+
nt,
|
|
2445
2445
|
$
|
|
2446
2446
|
]);
|
|
2447
2447
|
let jn = Kt($), Mn = $.getTotalSize();
|
|
@@ -2457,18 +2457,18 @@ function jn({ screenCode: e }) {
|
|
|
2457
2457
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
2458
2458
|
}, []);
|
|
2459
2459
|
let Nn = K(null), { rows: Pn } = $.getRowModel(), Fn = K(null), In = On({
|
|
2460
|
-
visibleCols:
|
|
2461
|
-
onReorder:
|
|
2460
|
+
visibleCols: Ke,
|
|
2461
|
+
onReorder: et,
|
|
2462
2462
|
scrollElRef: Nn,
|
|
2463
2463
|
theadRef: Fn
|
|
2464
|
-
}), Ln =
|
|
2464
|
+
}), Ln = we((e) => e.density), Rn = we((e) => e.zebra), zn = ge(), Bn = Ot({
|
|
2465
2465
|
count: Pn.length,
|
|
2466
2466
|
getScrollElement: () => Nn.current,
|
|
2467
2467
|
estimateSize: () => B === "cards" ? 142 : 48,
|
|
2468
2468
|
overscan: 10,
|
|
2469
2469
|
initialOffset: zn
|
|
2470
2470
|
}), Vn = G(() => Pn.map((e) => e.id), [Pn]);
|
|
2471
|
-
|
|
2471
|
+
he({
|
|
2472
2472
|
virtualizer: Bn,
|
|
2473
2473
|
scrollElementRef: Nn,
|
|
2474
2474
|
rowKeys: Vn
|
|
@@ -2477,8 +2477,8 @@ function jn({ screenCode: e }) {
|
|
|
2477
2477
|
}, [Ln, Bn]), W(() => {
|
|
2478
2478
|
Bn.measure();
|
|
2479
2479
|
}, [
|
|
2480
|
-
|
|
2481
|
-
|
|
2480
|
+
dt.width,
|
|
2481
|
+
dt.height,
|
|
2482
2482
|
B,
|
|
2483
2483
|
Bn
|
|
2484
2484
|
]);
|
|
@@ -2499,10 +2499,10 @@ function jn({ screenCode: e }) {
|
|
|
2499
2499
|
});
|
|
2500
2500
|
}, [i]);
|
|
2501
2501
|
W(() => {
|
|
2502
|
-
Rt !== void 0 &&
|
|
2502
|
+
Rt !== void 0 && be > Rt && Wn(Rt);
|
|
2503
2503
|
}, [
|
|
2504
2504
|
Rt,
|
|
2505
|
-
|
|
2505
|
+
be,
|
|
2506
2506
|
Wn
|
|
2507
2507
|
]);
|
|
2508
2508
|
let Gn = U((e) => {
|
|
@@ -2511,21 +2511,21 @@ function jn({ screenCode: e }) {
|
|
|
2511
2511
|
return n.set("per_page", String(e)), n.set("page", "1"), n;
|
|
2512
2512
|
});
|
|
2513
2513
|
}, [i]);
|
|
2514
|
-
if (!
|
|
2515
|
-
let Kn =
|
|
2516
|
-
entity:
|
|
2517
|
-
entityCode:
|
|
2518
|
-
screen:
|
|
2519
|
-
screenRoute:
|
|
2514
|
+
if (!k || !A) return null;
|
|
2515
|
+
let Kn = A.display, qn = L(k.display?.name) || L(Kn.name), Jn = k.display?.icon || Kn.icon, Yn = L(k.display?.description) || L(Kn.description), Xn = dt.category === "phone", Zn = B === "cards", Qn = Yt.map((e) => D(A, e)), $n = {
|
|
2516
|
+
entity: A,
|
|
2517
|
+
entityCode: j ?? "",
|
|
2518
|
+
screen: k,
|
|
2519
|
+
screenRoute: k.route,
|
|
2520
2520
|
selectedRows: Xt,
|
|
2521
2521
|
selectedIds: Qn,
|
|
2522
2522
|
locale: o,
|
|
2523
|
-
tabNavigate: (e,
|
|
2524
|
-
title:
|
|
2525
|
-
icon:
|
|
2526
|
-
search:
|
|
2523
|
+
tabNavigate: (e, t) => n(e, {
|
|
2524
|
+
title: t?.title,
|
|
2525
|
+
icon: t?.icon,
|
|
2526
|
+
search: t?.search
|
|
2527
2527
|
}),
|
|
2528
|
-
runActionApi: (e, t) =>
|
|
2528
|
+
runActionApi: (e, t) => ne(e, t)
|
|
2529
2529
|
};
|
|
2530
2530
|
return /* @__PURE__ */ X("div", {
|
|
2531
2531
|
style: {
|
|
@@ -2539,9 +2539,9 @@ function jn({ screenCode: e }) {
|
|
|
2539
2539
|
/* @__PURE__ */ Y(_n, {
|
|
2540
2540
|
title: qn,
|
|
2541
2541
|
description: Yn,
|
|
2542
|
-
toolbarActions:
|
|
2543
|
-
screenActionLayout:
|
|
2544
|
-
entityActionLayout:
|
|
2542
|
+
toolbarActions: F,
|
|
2543
|
+
screenActionLayout: k.action_layout,
|
|
2544
|
+
entityActionLayout: A.action_layout,
|
|
2545
2545
|
selectedIds: Jt,
|
|
2546
2546
|
data: H,
|
|
2547
2547
|
rowKey: Qt,
|
|
@@ -2549,37 +2549,38 @@ function jn({ screenCode: e }) {
|
|
|
2549
2549
|
widgetContext: $n
|
|
2550
2550
|
}),
|
|
2551
2551
|
/* @__PURE__ */ Y(ln, {
|
|
2552
|
-
screen:
|
|
2553
|
-
entity:
|
|
2554
|
-
entityCode:
|
|
2552
|
+
screen: k,
|
|
2553
|
+
entity: A,
|
|
2554
|
+
entityCode: j,
|
|
2555
2555
|
schema: a,
|
|
2556
2556
|
screenCode: e,
|
|
2557
2557
|
screenName: qn,
|
|
2558
2558
|
locale: o,
|
|
2559
2559
|
isPhone: Xn,
|
|
2560
2560
|
isCardsPresentation: Zn,
|
|
2561
|
-
sort:
|
|
2562
|
-
columns:
|
|
2563
|
-
views:
|
|
2561
|
+
sort: Ee,
|
|
2562
|
+
columns: Ge,
|
|
2563
|
+
views: rt,
|
|
2564
2564
|
query: gt,
|
|
2565
2565
|
selection: Wt,
|
|
2566
2566
|
filters: {
|
|
2567
|
-
json:
|
|
2568
|
-
debouncedSearch:
|
|
2569
|
-
count:
|
|
2567
|
+
json: h,
|
|
2568
|
+
debouncedSearch: ut,
|
|
2569
|
+
count: _,
|
|
2570
2570
|
onOpen: () => c(!0)
|
|
2571
2571
|
},
|
|
2572
|
-
searchValue:
|
|
2572
|
+
searchValue: Te,
|
|
2573
2573
|
onSearchChange: Hn,
|
|
2574
|
-
onSaveView: () =>
|
|
2575
|
-
page:
|
|
2576
|
-
perPage:
|
|
2577
|
-
includeDeleted:
|
|
2578
|
-
canViewDeleted:
|
|
2574
|
+
onSaveView: () => m(!0),
|
|
2575
|
+
page: be,
|
|
2576
|
+
perPage: xe,
|
|
2577
|
+
includeDeleted: fe,
|
|
2578
|
+
canViewDeleted: ue,
|
|
2579
2579
|
onToggleDeleted: Un,
|
|
2580
|
+
realtime: A?.realtime === !0,
|
|
2580
2581
|
isLive: en
|
|
2581
2582
|
}),
|
|
2582
|
-
|
|
2583
|
+
g && /* @__PURE__ */ X("div", {
|
|
2583
2584
|
role: "alert",
|
|
2584
2585
|
"data-testid": "filter-url-error",
|
|
2585
2586
|
style: {
|
|
@@ -2593,32 +2594,32 @@ function jn({ screenCode: e }) {
|
|
|
2593
2594
|
alignItems: "center",
|
|
2594
2595
|
gap: 8
|
|
2595
2596
|
},
|
|
2596
|
-
children: [/* @__PURE__ */ X("span", { children: [
|
|
2597
|
+
children: [/* @__PURE__ */ X("span", { children: [g, " Showing this list without URL filters."] }), /* @__PURE__ */ Y(b, {
|
|
2597
2598
|
kind: "ghost",
|
|
2598
2599
|
size: "xs",
|
|
2599
|
-
onClick:
|
|
2600
|
+
onClick: y,
|
|
2600
2601
|
children: "Clear"
|
|
2601
2602
|
})]
|
|
2602
2603
|
}),
|
|
2603
|
-
|
|
2604
|
+
h.length > 0 && /* @__PURE__ */ Y("div", {
|
|
2604
2605
|
style: { padding: "0 20px 10px" },
|
|
2605
|
-
children: /* @__PURE__ */ Y(
|
|
2606
|
-
filters:
|
|
2606
|
+
children: /* @__PURE__ */ Y(Xe, {
|
|
2607
|
+
filters: h,
|
|
2607
2608
|
resolveValue: sn,
|
|
2608
|
-
onRemove: (e) =>
|
|
2609
|
-
onClearAll:
|
|
2609
|
+
onRemove: (e) => v(at(h, e)),
|
|
2610
|
+
onClearAll: y,
|
|
2610
2611
|
onChipClick: () => c(!0),
|
|
2611
2612
|
fieldLabel: (e) => {
|
|
2612
2613
|
if (e.startsWith("$status.")) {
|
|
2613
|
-
let t = e.slice(8), n =
|
|
2614
|
-
return n ?
|
|
2614
|
+
let t = e.slice(8), n = A.status_groups?.[t];
|
|
2615
|
+
return n ? L(n.name) || t : e;
|
|
2615
2616
|
}
|
|
2616
2617
|
if (e.startsWith("$property.")) {
|
|
2617
|
-
let t = e.slice(10), n =
|
|
2618
|
-
return n ?
|
|
2618
|
+
let t = e.slice(10), n = A.properties?.[t];
|
|
2619
|
+
return n ? L(n.name) || t : e;
|
|
2619
2620
|
}
|
|
2620
|
-
let
|
|
2621
|
-
return
|
|
2621
|
+
let n = A.fields.get(e);
|
|
2622
|
+
return n ? t(n, e, a?.entities) : e;
|
|
2622
2623
|
}
|
|
2623
2624
|
})
|
|
2624
2625
|
})
|
|
@@ -2629,13 +2630,13 @@ function jn({ screenCode: e }) {
|
|
|
2629
2630
|
isError: St,
|
|
2630
2631
|
error: Ct,
|
|
2631
2632
|
rowCount: H.length,
|
|
2632
|
-
entity:
|
|
2633
|
-
screen:
|
|
2633
|
+
entity: A,
|
|
2634
|
+
screen: k,
|
|
2634
2635
|
screenName: qn,
|
|
2635
2636
|
screenIcon: Jn,
|
|
2636
|
-
isFiltered: !!
|
|
2637
|
-
canCreate:
|
|
2638
|
-
toolbarActions:
|
|
2637
|
+
isFiltered: !!ut || _ > 0,
|
|
2638
|
+
canCreate: M,
|
|
2639
|
+
toolbarActions: F,
|
|
2639
2640
|
onRetry: Tt
|
|
2640
2641
|
}),
|
|
2641
2642
|
bt || St || H.length === 0 ? null : /* @__PURE__ */ Y("div", {
|
|
@@ -2672,20 +2673,20 @@ function jn({ screenCode: e }) {
|
|
|
2672
2673
|
children: /* @__PURE__ */ Y(kn, {
|
|
2673
2674
|
rows: Pn,
|
|
2674
2675
|
virtualizer: Bn,
|
|
2675
|
-
entity:
|
|
2676
|
-
screen:
|
|
2677
|
-
entityCode:
|
|
2676
|
+
entity: A,
|
|
2677
|
+
screen: k,
|
|
2678
|
+
entityCode: j,
|
|
2678
2679
|
entities: a?.entities,
|
|
2679
|
-
savedViewColumns:
|
|
2680
|
+
savedViewColumns: z?.columns,
|
|
2680
2681
|
refs: an.current,
|
|
2681
2682
|
locale: o,
|
|
2682
2683
|
renderers: on,
|
|
2683
|
-
rowActions:
|
|
2684
|
-
tabNavigate:
|
|
2684
|
+
rowActions: oe,
|
|
2685
|
+
tabNavigate: n,
|
|
2685
2686
|
interaction: un,
|
|
2686
|
-
hasSoftDelete:
|
|
2687
|
+
hasSoftDelete: le,
|
|
2687
2688
|
zebra: Rn,
|
|
2688
|
-
hasBatchActions:
|
|
2689
|
+
hasBatchActions: ce,
|
|
2689
2690
|
hasDetailTarget: Q,
|
|
2690
2691
|
rowKey: Qt
|
|
2691
2692
|
})
|
|
@@ -2693,25 +2694,25 @@ function jn({ screenCode: e }) {
|
|
|
2693
2694
|
table: $,
|
|
2694
2695
|
columns: En,
|
|
2695
2696
|
rows: Pn,
|
|
2696
|
-
entity:
|
|
2697
|
+
entity: A,
|
|
2697
2698
|
columnSizeVars: jn,
|
|
2698
2699
|
totalColumnsWidth: Mn,
|
|
2699
2700
|
theadRef: Fn,
|
|
2700
2701
|
virtualizer: Bn,
|
|
2701
|
-
visibleCols:
|
|
2702
|
+
visibleCols: Ke,
|
|
2702
2703
|
headerReorder: In,
|
|
2703
|
-
sortCols:
|
|
2704
|
-
sortNullsMap:
|
|
2705
|
-
shiftClickColumn:
|
|
2706
|
-
applyColumnSort:
|
|
2707
|
-
appendColumnSort:
|
|
2708
|
-
clearColumnSort:
|
|
2709
|
-
clearAllSorts:
|
|
2704
|
+
sortCols: De,
|
|
2705
|
+
sortNullsMap: ke,
|
|
2706
|
+
shiftClickColumn: Ie,
|
|
2707
|
+
applyColumnSort: Fe,
|
|
2708
|
+
appendColumnSort: Le,
|
|
2709
|
+
clearColumnSort: Re,
|
|
2710
|
+
clearAllSorts: ze,
|
|
2710
2711
|
renderRow: (e, t) => /* @__PURE__ */ Y($t, {
|
|
2711
2712
|
row: e,
|
|
2712
2713
|
rowIndex: t,
|
|
2713
|
-
entity:
|
|
2714
|
-
hasSoftDelete:
|
|
2714
|
+
entity: A,
|
|
2715
|
+
hasSoftDelete: le,
|
|
2715
2716
|
zebra: Rn,
|
|
2716
2717
|
hasDetailTarget: Q,
|
|
2717
2718
|
interaction: un,
|
|
@@ -2729,10 +2730,10 @@ function jn({ screenCode: e }) {
|
|
|
2729
2730
|
countStrategy: At,
|
|
2730
2731
|
countLoading: Nt,
|
|
2731
2732
|
countError: Ft,
|
|
2732
|
-
page:
|
|
2733
|
+
page: be,
|
|
2733
2734
|
totalPages: Rt,
|
|
2734
2735
|
goToPage: Wn,
|
|
2735
|
-
perPage:
|
|
2736
|
+
perPage: xe,
|
|
2736
2737
|
setPerPage: Gn,
|
|
2737
2738
|
hasMorePages: zt,
|
|
2738
2739
|
fetchNextPage: Vt,
|
|
@@ -2740,80 +2741,80 @@ function jn({ screenCode: e }) {
|
|
|
2740
2741
|
})]
|
|
2741
2742
|
})
|
|
2742
2743
|
}),
|
|
2743
|
-
/* @__PURE__ */ Y(
|
|
2744
|
+
/* @__PURE__ */ Y($e, {
|
|
2744
2745
|
open: s,
|
|
2745
2746
|
onClose: () => c(!1),
|
|
2746
|
-
filters:
|
|
2747
|
-
onApply:
|
|
2748
|
-
availableFields:
|
|
2749
|
-
defaultFilters:
|
|
2747
|
+
filters: h,
|
|
2748
|
+
onApply: v,
|
|
2749
|
+
availableFields: Ve,
|
|
2750
|
+
defaultFilters: k?.default_filters,
|
|
2750
2751
|
refs: cn
|
|
2751
2752
|
}),
|
|
2752
2753
|
/* @__PURE__ */ Y(gn, {
|
|
2753
|
-
open:
|
|
2754
|
-
pending:
|
|
2755
|
-
onClose: () =>
|
|
2756
|
-
overwriteViewName: pn(
|
|
2754
|
+
open: f,
|
|
2755
|
+
pending: lt,
|
|
2756
|
+
onClose: () => m(!1),
|
|
2757
|
+
overwriteViewName: pn(z),
|
|
2757
2758
|
onOverwrite: async () => {
|
|
2758
|
-
await
|
|
2759
|
+
await ct(), m(!1);
|
|
2759
2760
|
},
|
|
2760
2761
|
onSave: async (e) => {
|
|
2761
|
-
await
|
|
2762
|
+
await it(e), m(!1);
|
|
2762
2763
|
}
|
|
2763
2764
|
}),
|
|
2764
2765
|
Jt.length > 0 && /* @__PURE__ */ Y(vn, {
|
|
2765
2766
|
selectedIds: Jt,
|
|
2766
|
-
floatbarActions:
|
|
2767
|
-
screenActionLayout:
|
|
2768
|
-
entityActionLayout:
|
|
2767
|
+
floatbarActions: R,
|
|
2768
|
+
screenActionLayout: k.action_layout,
|
|
2769
|
+
entityActionLayout: A.action_layout,
|
|
2769
2770
|
data: H,
|
|
2770
2771
|
rowKey: Qt,
|
|
2771
|
-
entityCode:
|
|
2772
|
-
entity:
|
|
2773
|
-
screen:
|
|
2772
|
+
entityCode: j,
|
|
2773
|
+
entity: A,
|
|
2774
|
+
screen: k,
|
|
2774
2775
|
onClear: () => qt({}),
|
|
2775
2776
|
onActionSuccess: () => qt({}),
|
|
2776
2777
|
widgetContext: $n
|
|
2777
2778
|
}),
|
|
2778
|
-
Sn &&
|
|
2779
|
+
Sn && A && k && /* @__PURE__ */ Y(Tn, {
|
|
2779
2780
|
x: Sn.x,
|
|
2780
2781
|
y: Sn.y,
|
|
2781
2782
|
row: Sn.row,
|
|
2782
2783
|
rowId: Qt(Sn.row),
|
|
2783
|
-
screen:
|
|
2784
|
-
fullScreen:
|
|
2785
|
-
entity:
|
|
2786
|
-
entityCode:
|
|
2787
|
-
rowActions:
|
|
2788
|
-
tabNavigate:
|
|
2784
|
+
screen: k,
|
|
2785
|
+
fullScreen: k,
|
|
2786
|
+
entity: A,
|
|
2787
|
+
entityCode: j,
|
|
2788
|
+
rowActions: oe,
|
|
2789
|
+
tabNavigate: n,
|
|
2789
2790
|
locale: o,
|
|
2790
2791
|
peekAllowed: dn,
|
|
2791
2792
|
hasDetailTarget: Q,
|
|
2792
2793
|
onPeek: hn,
|
|
2793
2794
|
onClose: () => Cn(null)
|
|
2794
2795
|
}),
|
|
2795
|
-
dn && Z &&
|
|
2796
|
-
entity:
|
|
2797
|
-
entityCode:
|
|
2796
|
+
dn && Z && A && /* @__PURE__ */ Y(Ye, {
|
|
2797
|
+
entity: A,
|
|
2798
|
+
entityCode: j,
|
|
2798
2799
|
record: Z,
|
|
2799
2800
|
title: (() => {
|
|
2800
|
-
let e =
|
|
2801
|
-
return e ?
|
|
2801
|
+
let e = k.columns?.find((e) => !e.startsWith("$status.") && !e.startsWith("$property."));
|
|
2802
|
+
return e ? I(Z[e] ?? L(A.display.name)) : L(A.display.name);
|
|
2802
2803
|
})(),
|
|
2803
2804
|
recordId: (() => {
|
|
2804
|
-
let e =
|
|
2805
|
-
return e ?
|
|
2805
|
+
let e = A.fields.names()?.find((e) => A.fields.get(e)?.primary);
|
|
2806
|
+
return e ? I(Z[e]) : void 0;
|
|
2806
2807
|
})(),
|
|
2807
2808
|
fields: yn,
|
|
2808
|
-
screen:
|
|
2809
|
+
screen: Be(A, k, Z),
|
|
2809
2810
|
actions: bn,
|
|
2810
|
-
screenActionLayout:
|
|
2811
|
-
entityActionLayout:
|
|
2811
|
+
screenActionLayout: Be(A, k, Z)?.action_layout,
|
|
2812
|
+
entityActionLayout: A.action_layout,
|
|
2812
2813
|
executeAction: xn,
|
|
2813
2814
|
onClose: () => {
|
|
2814
|
-
if (
|
|
2815
|
-
let e =
|
|
2816
|
-
e && pt(
|
|
2815
|
+
if (A && Z) {
|
|
2816
|
+
let e = A.fields.names()?.find((e) => A.fields.get(e)?.primary);
|
|
2817
|
+
e && pt(I(Z[e]));
|
|
2817
2818
|
}
|
|
2818
2819
|
hn(null);
|
|
2819
2820
|
},
|
|
@@ -2823,26 +2824,26 @@ function jn({ screenCode: e }) {
|
|
|
2823
2824
|
},
|
|
2824
2825
|
onSave: (e) => {
|
|
2825
2826
|
hn(e);
|
|
2826
|
-
let t =
|
|
2827
|
+
let t = A.fields.names()?.find((e) => A.fields.get(e)?.primary);
|
|
2827
2828
|
if (!t) return;
|
|
2828
|
-
let n =
|
|
2829
|
-
for (let t of
|
|
2830
|
-
let n =
|
|
2829
|
+
let n = I(e[t]), r = {};
|
|
2830
|
+
for (let t of A.fields.names()) {
|
|
2831
|
+
let n = Ne(A, e, t), i = Ne(A, Z, t), a = Pe(A, t, n), o = Pe(A, t, i);
|
|
2831
2832
|
(a === "" ? null : a) !== (o === "" || o === void 0 ? null : o) && (r[t] = a);
|
|
2832
2833
|
}
|
|
2833
|
-
let i =
|
|
2834
|
-
entity:
|
|
2834
|
+
let i = qe({
|
|
2835
|
+
entity: A,
|
|
2835
2836
|
formData: e,
|
|
2836
2837
|
record: Z,
|
|
2837
2838
|
isNew: !1
|
|
2838
2839
|
});
|
|
2839
2840
|
if (Object.keys(i).length > 0 && (r.$files = i), Object.keys(r).length === 0) return;
|
|
2840
|
-
let a =
|
|
2841
|
+
let a = He(i);
|
|
2841
2842
|
rn.mutate({
|
|
2842
2843
|
pkValues: n,
|
|
2843
2844
|
data: r
|
|
2844
2845
|
}, { onSuccess: () => {
|
|
2845
|
-
a.forEach((e) =>
|
|
2846
|
+
a.forEach((e) => T.markCommitted(e));
|
|
2846
2847
|
} });
|
|
2847
2848
|
}
|
|
2848
2849
|
})
|