@declarion/react 0.51.0 → 0.53.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-lib/{DraggableChildrenTable-CJCjc_cd.js → DraggableChildrenTable-BQZTvZaU.js} +35 -35
- package/dist-lib/{Grid-DUjbQg3r.js → Grid-B9Tiytbd.js} +28 -28
- package/dist-lib/{LayoutRenderer-DbdxC-Bq.js → LayoutRenderer-D_v9OD_A.js} +920 -922
- package/dist-lib/{ListCardsBody-C8ofksQb.js → ListCardsBody-dRnXsQ7A.js} +14 -14
- package/dist-lib/{MarkdownRenderer-B9_5fwuE.js → MarkdownRenderer-BCyrsLrd.js} +10 -10
- package/dist-lib/{record-documents-key-8fdm7C10.js → RecordIdBadge-CGxPR-8q.js} +1 -4
- package/dist-lib/{RefreshControl-C-8UCyau.js → RefreshControl-CV8nGACW.js} +120 -122
- package/dist-lib/{SmartDetailPage.impl-DWjNQ052.js → SmartDetailPage.impl-DWprVNMb.js} +376 -377
- package/dist-lib/{SmartListPage.impl-yKBK7a8b.js → SmartListPage.impl-BwWURGwa.js} +1098 -1099
- package/dist-lib/{SmartRecordListPage.impl-DRpU_DOC.js → SmartRecordListPage.impl-BKKBShAg.js} +183 -183
- package/dist-lib/{SortHeaderMenu-CbihbEGd.js → SortHeaderMenu-pgi4sxMs.js} +1 -1
- package/dist-lib/{action-dispatch-C28UhXXA.js → action-dispatch-DlHTYag7.js} +382 -382
- package/dist-lib/api/events.d.ts +27 -5
- package/dist-lib/{cardProjection-Bp_ZPLUE.js → cardProjection-C7Orz841.js} +146 -204
- package/dist-lib/components/pages/DocumentsMenu.d.ts +1 -1
- package/dist-lib/components/pages/RecordDocumentsPanel.d.ts +2 -2
- package/dist-lib/components/pages/list/useListQuery.d.ts +6 -1
- package/dist-lib/components/shared/RefreshControl.d.ts +7 -1
- package/dist-lib/components/shared/useOwnRefresh.d.ts +9 -0
- package/dist-lib/{field-classification-CeYJlsNq.js → field-classification-EY8CFF3P.js} +301 -320
- package/dist-lib/{format-count-C3N-WxEy.js → format-count-BHkaDr9V.js} +245 -245
- package/dist-lib/hooks/useMutations.d.ts +1 -1
- package/dist-lib/hooks/useSSE.d.ts +24 -4
- package/dist-lib/index.js +1541 -1832
- package/dist-lib/lib/document-templates.d.ts +1 -1
- package/dist-lib/lib/realtime-reconcile.d.ts +43 -0
- package/dist-lib/{peekDraftStore-D3sowXga.js → peekDraftStore-1pIajluX.js} +36 -36
- package/dist-lib/{registry-p6CejATt.js → registry-C5ug25M8.js} +507 -507
- package/dist-lib/stores/realtime.d.ts +20 -0
- package/dist-lib/testing.js +35 -35
- package/dist-lib/{useCurrentScreen-74x5yJNb.js → useCurrentScreen-BdnZq8vZ.js} +2504 -1557
- package/dist-lib/{useListQuery-D75bgLLz.js → useListQuery-BxgrPZIB.js} +13 -10
- package/dist-lib/{useProperties-C5fZp12D.js → useProperties-Bhi9Wn5O.js} +25 -25
- package/dist-lib/useTabSearchMirror-Dl5x0xKu.js +177 -0
- package/dist-lib/{value-DKekzcjz.js → value-Rp-5W3o8.js} +25 -25
- package/package.json +7 -7
- package/dist-lib/useTabSearchMirror-D_wzoYRz.js +0 -406
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import { s as e } from "./DynamicIcon-DW5krHuX.js";
|
|
2
|
-
import {
|
|
3
|
-
import { a as
|
|
4
|
-
import { t as
|
|
5
|
-
import {
|
|
6
|
-
import { a as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { a as
|
|
11
|
-
import { t as
|
|
12
|
-
import { Suspense as
|
|
13
|
-
import { useSearchParams as
|
|
14
|
-
import { useQueries as
|
|
15
|
-
import { Fragment as
|
|
16
|
-
import { columnResizingFeature as
|
|
17
|
-
import { useVirtualizer as
|
|
2
|
+
import { B as t, Cr as n, Dr as r, Dt as i, Fn as a, Fr as o, G as s, Gt as c, Hn as l, Ht as u, Ir as d, J as f, Jn as p, Kn as m, Mr as h, Mt as g, Nr as _, Pr as v, Qt as y, U as b, Ut as x, V as S, Vn as C, W as w, Wn as T, X as E, Xn as D, Xt as O, Yn as k, Yt as A, Zn as j, an as ee, at as te, d as ne, er as re, f as M, h as ie, i as N, ir as P, it as ae, l as oe, lr as F, m as se, nt as ce, on as le, p as ue, q as de, qn as fe, st as pe, u as me, wr as I, xr as he, yt as ge } from "./useCurrentScreen-BdnZq8vZ.js";
|
|
3
|
+
import { a as _e, i as ve, m as ye, s as be, t as xe } from "./RefreshControl-CV8nGACW.js";
|
|
4
|
+
import { t as Se } from "./Check-DAfMbQIw.js";
|
|
5
|
+
import { C as Ce, M as we, O as Te, P as Ee, T as De, l as Oe, n as ke, p as Ae, u as je, x as Me } from "./field-classification-EY8CFF3P.js";
|
|
6
|
+
import { a as Ne, c as Pe, f as Fe, h as Ie, l as Le, m as Re, n as ze, o as Be, p as Ve, r as He, t as Ue } from "./action-dispatch-DlHTYag7.js";
|
|
7
|
+
import { c as We, i as Ge, n as Ke, o as qe, r as L, s as Je, t as Ye } from "./cardProjection-C7Orz841.js";
|
|
8
|
+
import { a as Xe, c as Ze, d as Qe, f as $e, l as et, o as tt, p as nt, s as rt, t as it, u as R } from "./format-count-BHkaDr9V.js";
|
|
9
|
+
import { l as at, m as ot, n as st, t as ct } from "./useTabSearchMirror-Dl5x0xKu.js";
|
|
10
|
+
import { a as lt, c as ut, i as dt, n as z, o as B, s as ft, t as pt } from "./peekDraftStore-1pIajluX.js";
|
|
11
|
+
import { t as mt } from "./useListQuery-BxgrPZIB.js";
|
|
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
|
+
import { useSearchParams as _t } from "react-router";
|
|
14
|
+
import { useQueries as vt, useQueryClient as yt } from "@tanstack/react-query";
|
|
15
|
+
import { Fragment as J, jsx as Y, jsxs as X } from "react/jsx-runtime";
|
|
16
|
+
import { columnResizingFeature as bt, columnSizingFeature as xt, columnVisibilityFeature as St, flexRender as Ct, rowSelectionFeature as wt, rowSortingFeature as Tt, tableFeatures as Et, useTable as Dt } from "@tanstack/react-table";
|
|
17
|
+
import { useVirtualizer as Ot } from "@tanstack/react-virtual";
|
|
18
18
|
//#region src/components/pages/list/table-features.ts
|
|
19
|
-
var
|
|
20
|
-
rowSortingFeature:
|
|
21
|
-
rowSelectionFeature:
|
|
22
|
-
columnSizingFeature:
|
|
23
|
-
columnResizingFeature:
|
|
24
|
-
columnVisibilityFeature:
|
|
25
|
-
}),
|
|
19
|
+
var kt = Et({
|
|
20
|
+
rowSortingFeature: Tt,
|
|
21
|
+
rowSelectionFeature: wt,
|
|
22
|
+
columnSizingFeature: xt,
|
|
23
|
+
columnResizingFeature: bt,
|
|
24
|
+
columnVisibilityFeature: St
|
|
25
|
+
}), At = [
|
|
26
26
|
25,
|
|
27
27
|
50,
|
|
28
28
|
100,
|
|
@@ -32,7 +32,7 @@ var Mt = kt({
|
|
|
32
32
|
];
|
|
33
33
|
//#endregion
|
|
34
34
|
//#region src/components/pages/list/filter-meta.ts
|
|
35
|
-
function
|
|
35
|
+
function jt(e, t, n) {
|
|
36
36
|
if (!e || !t) return [];
|
|
37
37
|
let r = e.filters ?? t.fields.names(), i = e.filter_operators ?? {}, a = [];
|
|
38
38
|
for (let o of r) {
|
|
@@ -43,12 +43,12 @@ function Pt(e, t, n) {
|
|
|
43
43
|
if (!n) continue;
|
|
44
44
|
a.push({
|
|
45
45
|
code: o,
|
|
46
|
-
label:
|
|
46
|
+
label: j(n.name) || e,
|
|
47
47
|
type: "status",
|
|
48
48
|
operators: r,
|
|
49
49
|
options: n.statuses.map((e) => ({
|
|
50
50
|
value: e.code,
|
|
51
|
-
label:
|
|
51
|
+
label: j(e.name) || e.code,
|
|
52
52
|
color: e.color
|
|
53
53
|
}))
|
|
54
54
|
});
|
|
@@ -59,44 +59,44 @@ function Pt(e, t, n) {
|
|
|
59
59
|
if (!n) continue;
|
|
60
60
|
a.push({
|
|
61
61
|
code: o,
|
|
62
|
-
label:
|
|
62
|
+
label: j(n.name) || e,
|
|
63
63
|
type: "property",
|
|
64
64
|
operators: r
|
|
65
65
|
});
|
|
66
66
|
continue;
|
|
67
67
|
}
|
|
68
|
-
let
|
|
69
|
-
if (!
|
|
70
|
-
let
|
|
68
|
+
let s = t.fields.get(o);
|
|
69
|
+
if (!s) continue;
|
|
70
|
+
let c = p(s, o, n), l = s.values?.map((e) => ({
|
|
71
71
|
value: e.code,
|
|
72
|
-
label:
|
|
72
|
+
label: j(e.name) || e.code,
|
|
73
73
|
color: e.color
|
|
74
|
-
})),
|
|
74
|
+
})), u = T(s.filter_special_values, e?.filter_special_values?.[o]);
|
|
75
75
|
a.push({
|
|
76
76
|
code: o,
|
|
77
|
-
label:
|
|
78
|
-
type:
|
|
77
|
+
label: c,
|
|
78
|
+
type: s.type,
|
|
79
79
|
operators: r,
|
|
80
|
-
options:
|
|
81
|
-
ref:
|
|
82
|
-
specialValues:
|
|
80
|
+
options: l,
|
|
81
|
+
ref: s.ref,
|
|
82
|
+
specialValues: u.length > 0 ? u : void 0
|
|
83
83
|
});
|
|
84
84
|
}
|
|
85
85
|
return a;
|
|
86
86
|
}
|
|
87
87
|
//#endregion
|
|
88
88
|
//#region src/components/pages/list/useListSort.ts
|
|
89
|
-
function
|
|
90
|
-
let i = e.get("sort") ?? n ?? "", a =
|
|
89
|
+
function Mt({ searchParams: e, setSearchParams: t, screenSortDefault: n, commitScreenTabSearch: r }) {
|
|
90
|
+
let i = e.get("sort") ?? n ?? "", a = G(() => M(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 =
|
|
94
|
+
}, [a]), s = G(() => ie(i), [i]), c = G(() => a.map((e) => ({
|
|
95
95
|
id: e.field,
|
|
96
96
|
desc: e.dir === "desc"
|
|
97
|
-
})), [a]), l =
|
|
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", se(i)), a.set("page", "1"), r(a.toString()), t(a);
|
|
100
100
|
}, [
|
|
101
101
|
e,
|
|
102
102
|
r,
|
|
@@ -108,38 +108,38 @@ function Ft({ searchParams: e, setSearchParams: t, screenSortDefault: n, commitS
|
|
|
108
108
|
forRequest: s,
|
|
109
109
|
tableSorting: c,
|
|
110
110
|
write: l,
|
|
111
|
-
applyColumn:
|
|
111
|
+
applyColumn: U((e, t, n) => l([{
|
|
112
112
|
field: e,
|
|
113
113
|
dir: t,
|
|
114
114
|
...n ? { nulls: n } : {}
|
|
115
115
|
}]), [l]),
|
|
116
|
-
shiftClickColumn:
|
|
117
|
-
appendColumn:
|
|
116
|
+
shiftClickColumn: U((e) => l(ne(a, e)), [a, l]),
|
|
117
|
+
appendColumn: U((e, t, n) => l(me(a, {
|
|
118
118
|
field: e,
|
|
119
119
|
dir: t,
|
|
120
120
|
...n ? { nulls: n } : {}
|
|
121
121
|
})), [a, l]),
|
|
122
|
-
clearColumn:
|
|
123
|
-
clearAll:
|
|
122
|
+
clearColumn: U((e) => l(ue(a, e)), [a, l]),
|
|
123
|
+
clearAll: U(() => l([]), [l])
|
|
124
124
|
};
|
|
125
125
|
}
|
|
126
126
|
//#endregion
|
|
127
127
|
//#region src/components/pages/list/useListSelection.ts
|
|
128
|
-
var
|
|
129
|
-
function
|
|
130
|
-
return
|
|
128
|
+
var Nt = {};
|
|
129
|
+
function Pt(e, t) {
|
|
130
|
+
return re(e, fe(e, t));
|
|
131
131
|
}
|
|
132
|
-
function
|
|
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(
|
|
135
|
+
return t.filter((t) => r.has(Pt(e, t))).map((t) => fe(e, t));
|
|
136
136
|
}
|
|
137
|
-
function
|
|
138
|
-
let [r, i] =
|
|
137
|
+
function It(e, t, n) {
|
|
138
|
+
let [r, i] = Qe("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) : F(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
|
|
142
|
-
]), l =
|
|
142
|
+
]), l = G(() => {
|
|
143
143
|
if (s.length === 0) return [];
|
|
144
144
|
let e = /* @__PURE__ */ new Map();
|
|
145
145
|
for (let n of t) e.set(o(n), n);
|
|
@@ -149,7 +149,7 @@ function zt(e, t, n) {
|
|
|
149
149
|
t,
|
|
150
150
|
o
|
|
151
151
|
]);
|
|
152
|
-
return
|
|
152
|
+
return W(() => {
|
|
153
153
|
n || i((e) => {
|
|
154
154
|
let n = Object.keys(e);
|
|
155
155
|
if (n.length === 0) return e;
|
|
@@ -173,23 +173,23 @@ function zt(e, t, n) {
|
|
|
173
173
|
}
|
|
174
174
|
//#endregion
|
|
175
175
|
//#region src/components/pages/list/useListColumnLayout.ts
|
|
176
|
-
function
|
|
177
|
-
let i =
|
|
176
|
+
function Lt({ screenCode: e, screen: t, searchParams: n, setSearchParams: r }) {
|
|
177
|
+
let i = G(() => {
|
|
178
178
|
let e = n.get("columns");
|
|
179
179
|
return e ? e.split(",").filter(Boolean) : t?.default_columns ?? t?.columns ?? [];
|
|
180
180
|
}, [
|
|
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 } =
|
|
185
|
-
|
|
184
|
+
]), { widths: a, prune: o, setWidths: s, resetWidths: c, resizeEduShown: l, markResizeEduShown: u } = Ce(e), [d, f] = q(() => a);
|
|
185
|
+
W(() => {
|
|
186
186
|
f(a);
|
|
187
187
|
}, [a]);
|
|
188
|
-
let p =
|
|
189
|
-
|
|
188
|
+
let p = G(() => t?.columns ?? [], [t?.columns]);
|
|
189
|
+
W(() => {
|
|
190
190
|
p.length > 0 && o(p);
|
|
191
191
|
}, [p, o]);
|
|
192
|
-
let m =
|
|
192
|
+
let m = U((e) => {
|
|
193
193
|
if (e.length === 0) return;
|
|
194
194
|
let t = new URLSearchParams(n);
|
|
195
195
|
t.set("columns", e.join(",")), r(t);
|
|
@@ -199,11 +199,11 @@ function Bt({ screenCode: e, screen: t, searchParams: n, setSearchParams: r }) {
|
|
|
199
199
|
sizing: d,
|
|
200
200
|
setSizing: f,
|
|
201
201
|
apply: m,
|
|
202
|
-
clear:
|
|
202
|
+
clear: U(() => {
|
|
203
203
|
let e = new URLSearchParams(n);
|
|
204
204
|
e.delete("columns"), r(e);
|
|
205
205
|
}, [n, r]),
|
|
206
|
-
move:
|
|
206
|
+
move: U((e, t) => {
|
|
207
207
|
let n = i.indexOf(e);
|
|
208
208
|
if (n === -1) return;
|
|
209
209
|
let r = t === "up" ? n - 1 : n + 1;
|
|
@@ -211,8 +211,8 @@ function Bt({ screenCode: e, screen: t, searchParams: n, setSearchParams: r }) {
|
|
|
211
211
|
let a = [...i];
|
|
212
212
|
[a[n], a[r]] = [a[r], a[n]], m(a);
|
|
213
213
|
}, [i, m]),
|
|
214
|
-
commitResize:
|
|
215
|
-
s(e), !l && (u(),
|
|
214
|
+
commitResize: U((e) => {
|
|
215
|
+
s(e), !l && (u(), g.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,
|
|
@@ -221,7 +221,7 @@ function Bt({ screenCode: e, screen: t, searchParams: n, setSearchParams: r }) {
|
|
|
221
221
|
resetWidths: c
|
|
222
222
|
};
|
|
223
223
|
}
|
|
224
|
-
function
|
|
224
|
+
function Rt(e, t, n = 10) {
|
|
225
225
|
switch (t.type) {
|
|
226
226
|
case "down": return {
|
|
227
227
|
origin: {
|
|
@@ -253,27 +253,27 @@ function Vt(e, t, n = 10) {
|
|
|
253
253
|
};
|
|
254
254
|
}
|
|
255
255
|
}
|
|
256
|
-
function
|
|
256
|
+
function zt(e) {
|
|
257
257
|
return e instanceof Element && e.closest("a, button, input, select, [role='button'], [role='menuitem']") !== null;
|
|
258
258
|
}
|
|
259
|
-
function
|
|
259
|
+
function Bt(e, t) {
|
|
260
260
|
return e != null && e.rowId === t ? "double" : "single";
|
|
261
261
|
}
|
|
262
262
|
//#endregion
|
|
263
263
|
//#region src/hooks/useLongPress.ts
|
|
264
|
-
function
|
|
265
|
-
let t =
|
|
264
|
+
function Vt(e) {
|
|
265
|
+
let t = K(null), n = K(null), r = K(!1), i = U(() => {
|
|
266
266
|
n.current !== null && clearTimeout(n.current), n.current = null;
|
|
267
267
|
}, []);
|
|
268
|
-
|
|
269
|
-
let a =
|
|
270
|
-
let n =
|
|
268
|
+
W(() => i, [i]);
|
|
269
|
+
let a = U((e) => {
|
|
270
|
+
let n = Rt(t.current, e);
|
|
271
271
|
return t.current = n.origin, n.outcome !== "pending" && i(), n;
|
|
272
272
|
}, [i]);
|
|
273
273
|
return {
|
|
274
274
|
handlers: {
|
|
275
275
|
onPointerDown: (o) => {
|
|
276
|
-
if (o.pointerType === "mouse" ||
|
|
276
|
+
if (o.pointerType === "mouse" || zt(o.target)) return;
|
|
277
277
|
r.current = !1, i();
|
|
278
278
|
let s = {
|
|
279
279
|
x: o.clientX,
|
|
@@ -283,7 +283,7 @@ function Wt(e) {
|
|
|
283
283
|
type: "down",
|
|
284
284
|
...s
|
|
285
285
|
}), n.current = setTimeout(() => {
|
|
286
|
-
let i =
|
|
286
|
+
let i = Rt(t.current, { type: "held" });
|
|
287
287
|
t.current = i.origin, n.current = null, i.outcome === "fire" && (r.current = !0, e(s));
|
|
288
288
|
}, 500);
|
|
289
289
|
},
|
|
@@ -298,7 +298,7 @@ function Wt(e) {
|
|
|
298
298
|
onPointerCancel: () => void a({ type: "release" }),
|
|
299
299
|
onPointerLeave: () => void a({ type: "release" })
|
|
300
300
|
},
|
|
301
|
-
consumePressFired:
|
|
301
|
+
consumePressFired: U(() => {
|
|
302
302
|
let e = r.current;
|
|
303
303
|
return r.current = !1, e;
|
|
304
304
|
}, [])
|
|
@@ -306,128 +306,128 @@ function Wt(e) {
|
|
|
306
306
|
}
|
|
307
307
|
//#endregion
|
|
308
308
|
//#region src/components/pages/list/useListRowInteraction.ts
|
|
309
|
-
function
|
|
310
|
-
let [
|
|
311
|
-
|
|
312
|
-
|
|
309
|
+
function Ht({ entity: e, screen: t, screens: n, entities: r, searchParams: i, tabNavigate: a, commitScreenTabSearch: o, isPhone: s, canUpdate: u }) {
|
|
310
|
+
let [d, f] = q(null), [m, h] = q(null), g = K(null), _ = K(null);
|
|
311
|
+
W(() => () => {
|
|
312
|
+
_.current && clearTimeout(_.current.timer);
|
|
313
313
|
}, []);
|
|
314
|
-
let
|
|
314
|
+
let v = t?.on_row_click === "peek" && t.quick_peek?.enabled !== !1 && !s, y = U((r, s) => {
|
|
315
315
|
if (!e || !t) return;
|
|
316
|
-
let
|
|
317
|
-
if (!
|
|
318
|
-
if (
|
|
319
|
-
|
|
320
|
-
let [e, t] =
|
|
321
|
-
n.set("edit", "true"),
|
|
316
|
+
let c = fe(e, r), u = re(e, c), d = l(t, e, n, c);
|
|
317
|
+
if (!d) return;
|
|
318
|
+
if (s?.draft) {
|
|
319
|
+
z(u, s.draft);
|
|
320
|
+
let [e, t] = d.split("?", 2), n = new URLSearchParams(t ?? "");
|
|
321
|
+
n.set("edit", "true"), d = `${e}?${n.toString()}`;
|
|
322
322
|
}
|
|
323
|
-
let
|
|
324
|
-
|
|
325
|
-
title:
|
|
326
|
-
icon:
|
|
323
|
+
let f = k(r, e) ?? j(e.display.name), p = t.display?.icon || e.display.icon;
|
|
324
|
+
o(i.toString()), a(d, {
|
|
325
|
+
title: f,
|
|
326
|
+
icon: p
|
|
327
327
|
});
|
|
328
328
|
}, [
|
|
329
329
|
e,
|
|
330
330
|
t,
|
|
331
331
|
n,
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
]),
|
|
336
|
-
let t =
|
|
337
|
-
t &&
|
|
332
|
+
i,
|
|
333
|
+
a,
|
|
334
|
+
o
|
|
335
|
+
]), b = Vt(U((e) => {
|
|
336
|
+
let t = g.current;
|
|
337
|
+
t && h({
|
|
338
338
|
x: e.x,
|
|
339
339
|
y: e.y,
|
|
340
340
|
row: t
|
|
341
341
|
});
|
|
342
|
-
}, [])),
|
|
343
|
-
if (
|
|
344
|
-
if (!
|
|
345
|
-
|
|
342
|
+
}, [])), x = U((t, n) => {
|
|
343
|
+
if (b.consumePressFired() || zt(t.target)) return;
|
|
344
|
+
if (!v || !e) {
|
|
345
|
+
y(n);
|
|
346
346
|
return;
|
|
347
347
|
}
|
|
348
|
-
let r =
|
|
349
|
-
if (
|
|
350
|
-
clearTimeout(
|
|
348
|
+
let r = Pt(e, n);
|
|
349
|
+
if (Bt(_.current, r) === "double") {
|
|
350
|
+
clearTimeout(_.current.timer), _.current = null, f(null), y(n);
|
|
351
351
|
return;
|
|
352
352
|
}
|
|
353
|
-
|
|
353
|
+
_.current && clearTimeout(_.current.timer);
|
|
354
354
|
let i = setTimeout(() => {
|
|
355
|
-
|
|
355
|
+
_.current = null, f(n);
|
|
356
356
|
}, 250);
|
|
357
|
-
|
|
357
|
+
_.current = {
|
|
358
358
|
rowId: r,
|
|
359
359
|
timer: i
|
|
360
360
|
};
|
|
361
361
|
}, [
|
|
362
362
|
e,
|
|
363
|
+
v,
|
|
363
364
|
y,
|
|
364
|
-
|
|
365
|
-
S
|
|
365
|
+
b
|
|
366
366
|
]);
|
|
367
367
|
return {
|
|
368
|
-
peekAllowed:
|
|
369
|
-
peekRow:
|
|
370
|
-
setPeekRow:
|
|
371
|
-
peekFields:
|
|
372
|
-
if (!
|
|
373
|
-
let
|
|
374
|
-
return
|
|
368
|
+
peekAllowed: v,
|
|
369
|
+
peekRow: d,
|
|
370
|
+
setPeekRow: f,
|
|
371
|
+
peekFields: G(() => {
|
|
372
|
+
if (!v || !e || !d) return [];
|
|
373
|
+
let i = He(e, t, d);
|
|
374
|
+
return L(e, i, n).map((t) => {
|
|
375
375
|
if (e.files?.get(t)) return {
|
|
376
376
|
key: t,
|
|
377
|
-
label:
|
|
377
|
+
label: Re(e, t, r),
|
|
378
378
|
kind: "file",
|
|
379
|
-
readOnly: !
|
|
379
|
+
readOnly: !u
|
|
380
380
|
};
|
|
381
|
-
let n = e.fields.get(t),
|
|
381
|
+
let n = e.fields.get(t), i = u && !n.primary && !n.auto && !n.ref && n.files?.mode !== "rich_text_inline";
|
|
382
382
|
return {
|
|
383
383
|
key: t,
|
|
384
|
-
label:
|
|
384
|
+
label: p(n, t, r),
|
|
385
385
|
kind: "field",
|
|
386
386
|
field: n,
|
|
387
|
-
readOnly: !
|
|
387
|
+
readOnly: !i
|
|
388
388
|
};
|
|
389
389
|
});
|
|
390
390
|
}, [
|
|
391
|
-
|
|
392
|
-
|
|
391
|
+
v,
|
|
392
|
+
d,
|
|
393
393
|
e,
|
|
394
394
|
t,
|
|
395
|
-
|
|
395
|
+
r,
|
|
396
396
|
n,
|
|
397
|
-
|
|
397
|
+
u
|
|
398
398
|
]),
|
|
399
|
-
peekActions:
|
|
400
|
-
peekExecute:
|
|
401
|
-
let i = e?.fields.names().find((t) => e.fields.get(t)?.primary), a = i &&
|
|
402
|
-
return
|
|
403
|
-
}, [e,
|
|
399
|
+
peekActions: G(() => e?.actions ?? {}, [e?.actions]),
|
|
400
|
+
peekExecute: U(async (t, n, r) => {
|
|
401
|
+
let i = e?.fields.names().find((t) => e.fields.get(t)?.primary), a = i && d ? [F(d[i])] : void 0, o = n.entity ? `${n.entity}.${t}` : t;
|
|
402
|
+
return A(o, c(r, a));
|
|
403
|
+
}, [e, d]),
|
|
404
404
|
contextMenu: m,
|
|
405
|
-
setContextMenu:
|
|
406
|
-
pressedRow:
|
|
407
|
-
longPress:
|
|
408
|
-
onRowClick:
|
|
409
|
-
navigateToDetail:
|
|
405
|
+
setContextMenu: h,
|
|
406
|
+
pressedRow: g,
|
|
407
|
+
longPress: b,
|
|
408
|
+
onRowClick: x,
|
|
409
|
+
navigateToDetail: y
|
|
410
410
|
};
|
|
411
411
|
}
|
|
412
412
|
//#endregion
|
|
413
413
|
//#region src/components/pages/list/column-sizing.ts
|
|
414
|
-
function
|
|
414
|
+
function Ut(e) {
|
|
415
415
|
return `--header-${e}-size`;
|
|
416
416
|
}
|
|
417
|
-
function
|
|
417
|
+
function Wt(e) {
|
|
418
418
|
return `--col-${e}-size`;
|
|
419
419
|
}
|
|
420
|
-
function
|
|
420
|
+
function Gt(e) {
|
|
421
421
|
return `calc(var(${e}) * 1px)`;
|
|
422
422
|
}
|
|
423
|
-
function
|
|
423
|
+
function Kt(e) {
|
|
424
424
|
let t = e.getFlatHeaders(), n = {};
|
|
425
|
-
for (let e of t) n[
|
|
425
|
+
for (let e of t) n[Ut(e.id)] = e.getSize(), n[Wt(e.column.id)] = e.column.getSize();
|
|
426
426
|
return n;
|
|
427
427
|
}
|
|
428
428
|
//#endregion
|
|
429
429
|
//#region src/components/pages/list/sortable-header.ts
|
|
430
|
-
var
|
|
430
|
+
var qt = /* @__PURE__ */ new Set([
|
|
431
431
|
"secret",
|
|
432
432
|
"password",
|
|
433
433
|
"json",
|
|
@@ -435,29 +435,29 @@ var Xt = /* @__PURE__ */ new Set([
|
|
|
435
435
|
"int_array",
|
|
436
436
|
"uuid_array"
|
|
437
437
|
]);
|
|
438
|
-
function
|
|
438
|
+
function Jt(e, t) {
|
|
439
439
|
if (e === "_actions" || e === "_select" || e.startsWith("$property.") || e.startsWith("$refs.")) return !1;
|
|
440
440
|
if (e.startsWith("$status.")) return !0;
|
|
441
441
|
let n = t?.fields.get(e);
|
|
442
|
-
return !n || t?.list_pagination === "cursor" && n.cross_store_sortable === !1 ? !1 : !
|
|
442
|
+
return !n || t?.list_pagination === "cursor" && n.cross_store_sortable === !1 ? !1 : !qt.has(n.type);
|
|
443
443
|
}
|
|
444
444
|
//#endregion
|
|
445
445
|
//#region src/components/pages/list/ListTable.tsx
|
|
446
|
-
var
|
|
447
|
-
return /* @__PURE__ */
|
|
448
|
-
e.length > 0 && /* @__PURE__ */
|
|
446
|
+
var Yt = gt(() => import("./SortHeaderMenu-pgi4sxMs.js").then((e) => ({ default: e.SortHeaderMenu }))), Xt = H(function({ virtualItems: e, topPad: t, bottomPad: n, colSpan: r, rows: i, renderRow: a }) {
|
|
447
|
+
return /* @__PURE__ */ X("tbody", { children: [
|
|
448
|
+
e.length > 0 && /* @__PURE__ */ Y("tr", { children: /* @__PURE__ */ Y("td", {
|
|
449
449
|
style: { height: t },
|
|
450
450
|
colSpan: r
|
|
451
451
|
}) }),
|
|
452
452
|
e.map((e) => a(i[e.index], e.index)),
|
|
453
|
-
e.length > 0 && /* @__PURE__ */
|
|
453
|
+
e.length > 0 && /* @__PURE__ */ Y("tr", { children: /* @__PURE__ */ Y("td", {
|
|
454
454
|
style: { height: n },
|
|
455
455
|
colSpan: r
|
|
456
456
|
}) })
|
|
457
457
|
] });
|
|
458
458
|
}, (e, t) => t.isResizing);
|
|
459
|
-
function
|
|
460
|
-
return /* @__PURE__ */
|
|
459
|
+
function Zt({ table: t, columns: n, rows: r, entity: i, columnSizeVars: a, totalColumnsWidth: o, theadRef: s, virtualizer: c, visibleCols: l, headerReorder: u, sortCols: d, sortNullsMap: f, shiftClickColumn: p, applyColumnSort: m, appendColumnSort: h, clearColumnSort: g, clearAllSorts: _, renderRow: v, isResizingColumn: y }) {
|
|
460
|
+
return /* @__PURE__ */ X("table", {
|
|
461
461
|
"data-virtual-rows": "true",
|
|
462
462
|
style: {
|
|
463
463
|
...a,
|
|
@@ -469,22 +469,22 @@ function en({ table: t, columns: n, rows: r, entity: i, columnSizeVars: a, total
|
|
|
469
469
|
fontSize: 12.5,
|
|
470
470
|
color: "var(--text)"
|
|
471
471
|
},
|
|
472
|
-
children: [/* @__PURE__ */
|
|
472
|
+
children: [/* @__PURE__ */ Y("thead", {
|
|
473
473
|
ref: s,
|
|
474
|
-
children: t.getHeaderGroups().map((t) => /* @__PURE__ */
|
|
474
|
+
children: t.getHeaderGroups().map((t) => /* @__PURE__ */ X("tr", {
|
|
475
475
|
style: {
|
|
476
476
|
height: 32,
|
|
477
477
|
background: "var(--surface-2)"
|
|
478
478
|
},
|
|
479
479
|
children: [t.headers.map((t) => {
|
|
480
|
-
let n =
|
|
480
|
+
let n = Jt(t.id, i), r = t.column.getIsSorted(), a = t.id === "_select", o = t.id === "_actions", s = r ? d.findIndex((e) => e.field === t.id) + 1 : 0, c = d.length > 1 && s > 0, v = s > 0, y = d.length < 5, b = n ? t.column.getToggleSortingHandler() : void 0, x = n ? (e) => {
|
|
481
481
|
if (e.shiftKey) {
|
|
482
482
|
e.preventDefault(), p(t.id);
|
|
483
483
|
return;
|
|
484
484
|
}
|
|
485
485
|
b?.(e);
|
|
486
486
|
} : void 0, S = !a && !o, C = S ? l.indexOf(t.id) : -1, w = u.dragColId === t.id, T = u.isDragging && C !== -1 && u.dropIndex === C, E = u.isDragging && C !== -1 && C === l.length - 1 && u.dropIndex === l.length;
|
|
487
|
-
return /* @__PURE__ */
|
|
487
|
+
return /* @__PURE__ */ X("th", {
|
|
488
488
|
"data-col-id": S ? t.id : void 0,
|
|
489
489
|
onMouseDown: S ? (e) => u.onHeaderMouseDown(t.id, e) : void 0,
|
|
490
490
|
onClick: (e) => {
|
|
@@ -501,8 +501,8 @@ function en({ table: t, columns: n, rows: r, entity: i, columnSizeVars: a, total
|
|
|
501
501
|
cursor: n ? "pointer" : "default",
|
|
502
502
|
opacity: w ? .4 : 1,
|
|
503
503
|
boxShadow: T ? "inset 2px 0 0 0 var(--accent)" : E ? "inset -2px 0 0 0 var(--accent)" : void 0,
|
|
504
|
-
width:
|
|
505
|
-
minWidth:
|
|
504
|
+
width: Gt(Ut(t.id)),
|
|
505
|
+
minWidth: Gt(Ut(t.id)),
|
|
506
506
|
borderBottom: "1px solid var(--border)",
|
|
507
507
|
background: "var(--surface-2)",
|
|
508
508
|
position: "sticky",
|
|
@@ -510,7 +510,7 @@ function en({ table: t, columns: n, rows: r, entity: i, columnSizeVars: a, total
|
|
|
510
510
|
left: a ? 0 : "auto",
|
|
511
511
|
zIndex: a ? 3 : 2
|
|
512
512
|
},
|
|
513
|
-
children: [t.isPlaceholder ? null : n ? /* @__PURE__ */
|
|
513
|
+
children: [t.isPlaceholder ? null : n ? /* @__PURE__ */ X("span", {
|
|
514
514
|
style: {
|
|
515
515
|
display: "inline-flex",
|
|
516
516
|
alignItems: "center",
|
|
@@ -520,18 +520,18 @@ function en({ table: t, columns: n, rows: r, entity: i, columnSizeVars: a, total
|
|
|
520
520
|
letterSpacing: "0.04em"
|
|
521
521
|
},
|
|
522
522
|
children: [
|
|
523
|
-
|
|
524
|
-
/* @__PURE__ */
|
|
523
|
+
Ct(t.column.columnDef.header, t.getContext()),
|
|
524
|
+
/* @__PURE__ */ X("span", {
|
|
525
525
|
style: {
|
|
526
526
|
display: "inline-flex",
|
|
527
527
|
flexDirection: "column",
|
|
528
528
|
alignItems: "center",
|
|
529
529
|
lineHeight: 0
|
|
530
530
|
},
|
|
531
|
-
children: [r === "asc" ? /* @__PURE__ */
|
|
531
|
+
children: [r === "asc" ? /* @__PURE__ */ Y(e.arrowUp, { size: 11 }) : r === "desc" ? /* @__PURE__ */ Y(e.arrowDown, { size: 11 }) : /* @__PURE__ */ Y(e.sort, {
|
|
532
532
|
size: 11,
|
|
533
533
|
style: { opacity: .35 }
|
|
534
|
-
}), r && f.get(t.id) === "first" ? /* @__PURE__ */
|
|
534
|
+
}), r && f.get(t.id) === "first" ? /* @__PURE__ */ Y("span", {
|
|
535
535
|
"aria-hidden": "true",
|
|
536
536
|
style: {
|
|
537
537
|
width: 4,
|
|
@@ -542,7 +542,7 @@ function en({ table: t, columns: n, rows: r, entity: i, columnSizeVars: a, total
|
|
|
542
542
|
}
|
|
543
543
|
}) : null]
|
|
544
544
|
}),
|
|
545
|
-
c ? /* @__PURE__ */
|
|
545
|
+
c ? /* @__PURE__ */ Y("span", {
|
|
546
546
|
"aria-label": `Sort rank ${s}`,
|
|
547
547
|
style: {
|
|
548
548
|
fontSize: 10,
|
|
@@ -553,9 +553,9 @@ function en({ table: t, columns: n, rows: r, entity: i, columnSizeVars: a, total
|
|
|
553
553
|
},
|
|
554
554
|
children: s
|
|
555
555
|
}) : null,
|
|
556
|
-
/* @__PURE__ */
|
|
556
|
+
/* @__PURE__ */ Y(ht, {
|
|
557
557
|
fallback: null,
|
|
558
|
-
children: /* @__PURE__ */
|
|
558
|
+
children: /* @__PURE__ */ Y(Yt, {
|
|
559
559
|
field: t.id,
|
|
560
560
|
activeDir: r,
|
|
561
561
|
activeNulls: f.get(t.id),
|
|
@@ -568,7 +568,7 @@ function en({ table: t, columns: n, rows: r, entity: i, columnSizeVars: a, total
|
|
|
568
568
|
})
|
|
569
569
|
})
|
|
570
570
|
]
|
|
571
|
-
}) :
|
|
571
|
+
}) : Ct(t.column.columnDef.header, t.getContext()), t.column.getCanResize() && /* @__PURE__ */ Y("div", {
|
|
572
572
|
"data-testid": "col-resize-handle",
|
|
573
573
|
"aria-hidden": "true",
|
|
574
574
|
onMouseDown: (e) => {
|
|
@@ -591,7 +591,7 @@ function en({ table: t, columns: n, rows: r, entity: i, columnSizeVars: a, total
|
|
|
591
591
|
userSelect: "none",
|
|
592
592
|
zIndex: 3
|
|
593
593
|
},
|
|
594
|
-
children: /* @__PURE__ */
|
|
594
|
+
children: /* @__PURE__ */ Y("span", { style: {
|
|
595
595
|
width: 2,
|
|
596
596
|
height: "60%",
|
|
597
597
|
alignSelf: "center",
|
|
@@ -600,7 +600,7 @@ function en({ table: t, columns: n, rows: r, entity: i, columnSizeVars: a, total
|
|
|
600
600
|
} })
|
|
601
601
|
})]
|
|
602
602
|
}, t.id);
|
|
603
|
-
}), /* @__PURE__ */
|
|
603
|
+
}), /* @__PURE__ */ Y("th", {
|
|
604
604
|
"aria-hidden": "true",
|
|
605
605
|
style: {
|
|
606
606
|
borderBottom: "1px solid var(--border)",
|
|
@@ -611,7 +611,7 @@ function en({ table: t, columns: n, rows: r, entity: i, columnSizeVars: a, total
|
|
|
611
611
|
}
|
|
612
612
|
})]
|
|
613
613
|
}, t.id))
|
|
614
|
-
}), /* @__PURE__ */
|
|
614
|
+
}), /* @__PURE__ */ Y(Xt, {
|
|
615
615
|
virtualItems: c.getVirtualItems(),
|
|
616
616
|
topPad: c.getVirtualItems()[0]?.start ?? 0,
|
|
617
617
|
bottomPad: c.getTotalSize() - (c.getVirtualItems().at(-1)?.end ?? 0),
|
|
@@ -624,19 +624,19 @@ function en({ table: t, columns: n, rows: r, entity: i, columnSizeVars: a, total
|
|
|
624
624
|
}
|
|
625
625
|
//#endregion
|
|
626
626
|
//#region src/components/pages/list/DataCell.tsx
|
|
627
|
-
function
|
|
627
|
+
function Qt({ cell: e }) {
|
|
628
628
|
let t = e.column.id === "_select", n = e.column.id === "_actions", r = e.column.columnDef.cell, i = typeof r == "function" ? r(e.getContext()) : r;
|
|
629
|
-
return /* @__PURE__ */
|
|
629
|
+
return /* @__PURE__ */ Y("td", {
|
|
630
630
|
title: typeof i == "string" ? i : void 0,
|
|
631
631
|
style: {
|
|
632
632
|
padding: t ? "0 6px 0 12px" : n ? "0 6px" : "0 10px",
|
|
633
633
|
verticalAlign: "middle",
|
|
634
634
|
borderBottom: "1px solid var(--divider)",
|
|
635
|
-
width:
|
|
635
|
+
width: Gt(Wt(e.column.id)),
|
|
636
636
|
whiteSpace: "nowrap",
|
|
637
637
|
overflow: "hidden",
|
|
638
638
|
textOverflow: "ellipsis",
|
|
639
|
-
maxWidth:
|
|
639
|
+
maxWidth: Gt(Wt(e.column.id)),
|
|
640
640
|
color: "var(--text)",
|
|
641
641
|
position: t ? "sticky" : "static",
|
|
642
642
|
left: t ? 0 : "auto",
|
|
@@ -648,9 +648,9 @@ function tn({ cell: e }) {
|
|
|
648
648
|
}
|
|
649
649
|
//#endregion
|
|
650
650
|
//#region src/components/pages/list/ListTableRow.tsx
|
|
651
|
-
function
|
|
651
|
+
function $t({ row: e, rowIndex: t, entity: n, hasSoftDelete: r, zebra: i, hasDetailTarget: a, interaction: o, measureElement: s }) {
|
|
652
652
|
let c = e.original, l = r && c[n.soft_delete] != null, u = e.getIsSelected(), d = i && t % 2 == 1;
|
|
653
|
-
return /* @__PURE__ */
|
|
653
|
+
return /* @__PURE__ */ X("tr", {
|
|
654
654
|
"data-index": t,
|
|
655
655
|
"data-row-stripe": d ? "" : void 0,
|
|
656
656
|
"aria-selected": u,
|
|
@@ -674,7 +674,7 @@ function nn({ row: e, rowIndex: t, entity: n, hasSoftDelete: r, zebra: i, hasDet
|
|
|
674
674
|
onPointerDown: (e) => {
|
|
675
675
|
o.pressedRow.current = c, o.longPress.handlers.onPointerDown(e);
|
|
676
676
|
},
|
|
677
|
-
children: [e.getVisibleCells().map((e) => /* @__PURE__ */
|
|
677
|
+
children: [e.getVisibleCells().map((e) => /* @__PURE__ */ Y(Qt, { cell: e }, e.id)), /* @__PURE__ */ Y("td", {
|
|
678
678
|
"aria-hidden": "true",
|
|
679
679
|
style: { borderBottom: "1px solid var(--divider)" }
|
|
680
680
|
})]
|
|
@@ -682,69 +682,69 @@ function nn({ row: e, rowIndex: t, entity: n, hasSoftDelete: r, zebra: i, hasDet
|
|
|
682
682
|
}
|
|
683
683
|
//#endregion
|
|
684
684
|
//#region src/components/pages/list/ListNoRows.tsx
|
|
685
|
-
function
|
|
686
|
-
if (e instanceof
|
|
685
|
+
function en(e) {
|
|
686
|
+
if (e instanceof a) {
|
|
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
|
|
693
|
-
let
|
|
694
|
-
return e && t ? /* @__PURE__ */
|
|
692
|
+
function tn({ isLoading: e, tableLoadingStale: t, isError: n, error: r, rowCount: a, entity: o, screen: s, screenName: c, screenIcon: l, isFiltered: u, canCreate: f, toolbarActions: p, onRetry: m }) {
|
|
693
|
+
let h = o.display;
|
|
694
|
+
return e && t ? /* @__PURE__ */ Y("div", {
|
|
695
695
|
style: { padding: "0 20px" },
|
|
696
|
-
children: /* @__PURE__ */
|
|
696
|
+
children: /* @__PURE__ */ Y(R, {
|
|
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__ */
|
|
700
|
+
action: /* @__PURE__ */ Y(d, {
|
|
701
701
|
kind: "primary",
|
|
702
702
|
size: "sm",
|
|
703
|
-
onClick:
|
|
703
|
+
onClick: m,
|
|
704
704
|
children: "Retry"
|
|
705
705
|
})
|
|
706
706
|
})
|
|
707
|
-
}) : e ? /* @__PURE__ */
|
|
707
|
+
}) : e ? /* @__PURE__ */ Y(qe, { cols: s.columns?.length ?? 4 }) : n ? /* @__PURE__ */ Y("div", {
|
|
708
708
|
style: { padding: "0 20px" },
|
|
709
|
-
children: /* @__PURE__ */
|
|
709
|
+
children: /* @__PURE__ */ Y(R, {
|
|
710
710
|
icon: "alert-circle",
|
|
711
711
|
title: "Failed to load data",
|
|
712
|
-
description:
|
|
713
|
-
action: /* @__PURE__ */
|
|
712
|
+
description: en(r),
|
|
713
|
+
action: /* @__PURE__ */ Y(d, {
|
|
714
714
|
kind: "primary",
|
|
715
715
|
size: "sm",
|
|
716
|
-
onClick:
|
|
716
|
+
onClick: m,
|
|
717
717
|
children: "Retry"
|
|
718
718
|
})
|
|
719
719
|
})
|
|
720
|
-
}) :
|
|
720
|
+
}) : a === 0 ? /* @__PURE__ */ Y("div", {
|
|
721
721
|
style: { padding: "0 20px" },
|
|
722
722
|
children: (() => {
|
|
723
|
-
let e =
|
|
724
|
-
return
|
|
723
|
+
let e = h.empty_state, t = j(e?.title), n = j(e?.body), r = i(e?.learn_more_url), a = u ? "No results found" : t || `No ${j(h.name_plural).toLowerCase() || c.toLowerCase()} yet`, o = f && p.some(({ code: e }) => e === "__new" || e === "__create"), s;
|
|
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
|
-
})] })] }) :
|
|
729
|
+
})] })] }) : o ? `Create your first ${j(h.name).toLowerCase()} to get started` : void 0, /* @__PURE__ */ Y(R, {
|
|
730
730
|
icon: l,
|
|
731
|
-
title:
|
|
732
|
-
description:
|
|
731
|
+
title: a,
|
|
732
|
+
description: s
|
|
733
733
|
});
|
|
734
734
|
})()
|
|
735
735
|
}) : null;
|
|
736
736
|
}
|
|
737
737
|
//#endregion
|
|
738
738
|
//#region src/components/pages/list/ListFooter.tsx
|
|
739
|
-
function
|
|
740
|
-
let
|
|
741
|
-
return !
|
|
739
|
+
function nn({ meta: t, isCursor: r, isPhone: i, rowsLoaded: a, selectedCount: s, countTotal: c, countStrategy: l, countLoading: u, countError: d, page: f, totalPages: p, goToPage: m, perPage: h, setPerPage: g, hasMorePages: _, fetchNextPage: v, isFetchingNextPage: y }) {
|
|
740
|
+
let b = be("list");
|
|
741
|
+
return !t && !r ? 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 ? De(12) : {
|
|
748
748
|
paddingLeft: 14,
|
|
749
749
|
paddingRight: 14
|
|
750
750
|
},
|
|
@@ -756,7 +756,7 @@ function on({ meta: n, isCursor: r, isPhone: i, rowsLoaded: a, selectedCount: o,
|
|
|
756
756
|
flexWrap: "wrap"
|
|
757
757
|
},
|
|
758
758
|
children: [
|
|
759
|
-
|
|
759
|
+
b.isVisible("show_count") && /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y("span", {
|
|
760
760
|
className: "num",
|
|
761
761
|
"data-testid": "list-footer-count",
|
|
762
762
|
style: {
|
|
@@ -764,40 +764,40 @@ function on({ meta: n, isCursor: r, isPhone: i, rowsLoaded: a, selectedCount: o,
|
|
|
764
764
|
alignItems: "center",
|
|
765
765
|
gap: 5
|
|
766
766
|
},
|
|
767
|
-
children:
|
|
767
|
+
children: c === void 0 ? u && !d ? /* @__PURE__ */ Y("span", {
|
|
768
768
|
"data-testid": "list-footer-count-pending",
|
|
769
769
|
style: { display: "inline-flex" },
|
|
770
|
-
children: /* @__PURE__ */
|
|
771
|
-
}) : /* @__PURE__ */ J
|
|
770
|
+
children: /* @__PURE__ */ Y(n, { size: 11 })
|
|
771
|
+
}) : /* @__PURE__ */ X(J, { children: [
|
|
772
772
|
a,
|
|
773
773
|
" ",
|
|
774
774
|
a === 1 ? "record" : "records"
|
|
775
|
-
] }) : /* @__PURE__ */ J
|
|
775
|
+
] }) : /* @__PURE__ */ X(J, { children: [
|
|
776
776
|
a,
|
|
777
777
|
" of ",
|
|
778
|
-
|
|
778
|
+
it(c, l ?? "exact"),
|
|
779
779
|
" ",
|
|
780
|
-
|
|
780
|
+
c === 1 ? "record" : "records"
|
|
781
781
|
] })
|
|
782
|
-
}), /* @__PURE__ */
|
|
783
|
-
/* @__PURE__ */
|
|
782
|
+
}), /* @__PURE__ */ Y("span", { children: "·" })] }),
|
|
783
|
+
/* @__PURE__ */ X("span", { children: [
|
|
784
784
|
"Selected:",
|
|
785
785
|
" ",
|
|
786
|
-
/* @__PURE__ */
|
|
786
|
+
/* @__PURE__ */ Y("span", {
|
|
787
787
|
className: "num",
|
|
788
788
|
style: {
|
|
789
789
|
color: "var(--text-2)",
|
|
790
790
|
fontWeight: 500
|
|
791
791
|
},
|
|
792
|
-
children:
|
|
792
|
+
children: s
|
|
793
793
|
})
|
|
794
794
|
] }),
|
|
795
|
-
/* @__PURE__ */
|
|
796
|
-
!i && /* @__PURE__ */
|
|
797
|
-
/* @__PURE__ */
|
|
795
|
+
/* @__PURE__ */ Y("div", { style: { flex: i ? "1 1 100%" : 1 } }),
|
|
796
|
+
!i && /* @__PURE__ */ Y("span", { children: "Rows per page" }),
|
|
797
|
+
/* @__PURE__ */ Y("select", {
|
|
798
798
|
"aria-label": "Rows per page",
|
|
799
|
-
value:
|
|
800
|
-
onChange: (e) =>
|
|
799
|
+
value: h,
|
|
800
|
+
onChange: (e) => g(parseInt(e.target.value, 10)),
|
|
801
801
|
style: {
|
|
802
802
|
fontSize: 11.5,
|
|
803
803
|
padding: "2px 4px",
|
|
@@ -807,17 +807,17 @@ function on({ meta: n, isCursor: r, isPhone: i, rowsLoaded: a, selectedCount: o,
|
|
|
807
807
|
color: "var(--text-2)",
|
|
808
808
|
cursor: "pointer"
|
|
809
809
|
},
|
|
810
|
-
children:
|
|
810
|
+
children: At.map((e) => /* @__PURE__ */ Y("option", {
|
|
811
811
|
value: e,
|
|
812
812
|
children: e
|
|
813
813
|
}, e))
|
|
814
814
|
}),
|
|
815
|
-
r ?
|
|
815
|
+
r ? _ && /* @__PURE__ */ X("button", {
|
|
816
816
|
type: "button",
|
|
817
817
|
className: "num",
|
|
818
818
|
"data-testid": "list-footer-load-more",
|
|
819
|
-
onClick:
|
|
820
|
-
disabled:
|
|
819
|
+
onClick: v,
|
|
820
|
+
disabled: y,
|
|
821
821
|
style: {
|
|
822
822
|
display: "inline-flex",
|
|
823
823
|
alignItems: "center",
|
|
@@ -827,36 +827,36 @@ function on({ meta: n, isCursor: r, isPhone: i, rowsLoaded: a, selectedCount: o,
|
|
|
827
827
|
border: "1px solid var(--border)",
|
|
828
828
|
borderRadius: 4,
|
|
829
829
|
color: "var(--text-2)",
|
|
830
|
-
cursor:
|
|
830
|
+
cursor: y ? "default" : "pointer"
|
|
831
831
|
},
|
|
832
|
-
children: [
|
|
833
|
-
}) : (
|
|
832
|
+
children: [y ? /* @__PURE__ */ Y(n, { size: 11 }) : null, "Load more"]
|
|
833
|
+
}) : (_ || f > 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__ */
|
|
840
|
+
/* @__PURE__ */ Y(o, {
|
|
841
841
|
size: 22,
|
|
842
|
-
icon: /* @__PURE__ */
|
|
843
|
-
onClick: () =>
|
|
844
|
-
disabled:
|
|
842
|
+
icon: /* @__PURE__ */ Y(e.left, { size: 12 }),
|
|
843
|
+
onClick: () => m(f - 1),
|
|
844
|
+
disabled: f <= 1
|
|
845
845
|
}),
|
|
846
|
-
/* @__PURE__ */
|
|
846
|
+
/* @__PURE__ */ X("span", {
|
|
847
847
|
className: "num",
|
|
848
848
|
style: { padding: "0 6px" },
|
|
849
849
|
children: [
|
|
850
850
|
"Page ",
|
|
851
|
-
|
|
852
|
-
|
|
851
|
+
f,
|
|
852
|
+
p === void 0 ? "" : ` of ${p}`
|
|
853
853
|
]
|
|
854
854
|
}),
|
|
855
|
-
/* @__PURE__ */
|
|
855
|
+
/* @__PURE__ */ Y(o, {
|
|
856
856
|
size: 22,
|
|
857
|
-
icon: /* @__PURE__ */
|
|
858
|
-
onClick: () =>
|
|
859
|
-
disabled:
|
|
857
|
+
icon: /* @__PURE__ */ Y(e.right, { size: 12 }),
|
|
858
|
+
onClick: () => m(f + 1),
|
|
859
|
+
disabled: p === void 0 ? !_ : f >= p
|
|
860
860
|
})
|
|
861
861
|
]
|
|
862
862
|
})
|
|
@@ -865,94 +865,94 @@ function on({ meta: n, isCursor: r, isPhone: i, rowsLoaded: a, selectedCount: o,
|
|
|
865
865
|
}
|
|
866
866
|
//#endregion
|
|
867
867
|
//#region src/components/pages/ExportMenu.tsx
|
|
868
|
-
function
|
|
868
|
+
function rn(e) {
|
|
869
869
|
return !(e && e.enabled === !1);
|
|
870
870
|
}
|
|
871
|
-
function
|
|
871
|
+
function an(e) {
|
|
872
872
|
return e == null ? "all matching rows" : `${e.toLocaleString()} ${e === 1 ? "row" : "rows"}`;
|
|
873
873
|
}
|
|
874
|
-
function
|
|
875
|
-
let { isPhone: n } =
|
|
876
|
-
if (!
|
|
877
|
-
async function
|
|
878
|
-
|
|
874
|
+
function on(t) {
|
|
875
|
+
let { isPhone: n } = r(), { entityCode: i, entity: o, screen: s, viewState: c, visibleColumns: l, selectedRowPKs: u, totalRows: f, pageSize: p, locale: m, align: g = "end", variant: _ = "toolbar", onBeforeOpen: v } = t, [y, b] = q(!1), [x, S] = q(!1), [C, w] = q(null), T = K(null), E = rn(o.export), D = rn(s?.export);
|
|
876
|
+
if (!E || !D) return null;
|
|
877
|
+
async function k(e) {
|
|
878
|
+
w(null), S(!0);
|
|
879
879
|
try {
|
|
880
|
-
let t =
|
|
880
|
+
let t = ut(c, {
|
|
881
881
|
scope: e,
|
|
882
|
-
visibleColumns:
|
|
883
|
-
selectedRowPKs: e === "selected_rows" ?
|
|
884
|
-
locale:
|
|
885
|
-
}), { blob: n, filename:
|
|
886
|
-
|
|
882
|
+
visibleColumns: l,
|
|
883
|
+
selectedRowPKs: e === "selected_rows" ? u : void 0,
|
|
884
|
+
locale: m
|
|
885
|
+
}), { blob: n, filename: r } = await O(i, t);
|
|
886
|
+
cn(n, r || `${i}-${sn()}.csv`), b(!1);
|
|
887
887
|
} catch (e) {
|
|
888
|
-
let t = e instanceof
|
|
888
|
+
let t = e instanceof a ? {
|
|
889
889
|
code: e.code,
|
|
890
890
|
message: e.message
|
|
891
891
|
} : {
|
|
892
892
|
code: "",
|
|
893
893
|
message: String(e)
|
|
894
894
|
};
|
|
895
|
-
|
|
895
|
+
w(t);
|
|
896
896
|
} finally {
|
|
897
|
-
|
|
897
|
+
S(!1);
|
|
898
898
|
}
|
|
899
899
|
}
|
|
900
|
-
if (
|
|
901
|
-
let t =
|
|
902
|
-
return /* @__PURE__ */
|
|
903
|
-
icon: /* @__PURE__ */
|
|
900
|
+
if (_ === "selection-menu-item") {
|
|
901
|
+
let t = x || u.length === 0;
|
|
902
|
+
return /* @__PURE__ */ Y(I, {
|
|
903
|
+
icon: /* @__PURE__ */ Y(e.download, { size: 12 }),
|
|
904
904
|
"data-testid": "export-selection-menu-item",
|
|
905
905
|
onClick: t ? void 0 : () => {
|
|
906
|
-
|
|
906
|
+
v?.(), k("selected_rows");
|
|
907
907
|
},
|
|
908
|
-
children:
|
|
908
|
+
children: x ? "Exporting…" : "Export selection (CSV)"
|
|
909
909
|
});
|
|
910
910
|
}
|
|
911
|
-
let
|
|
912
|
-
return /* @__PURE__ */ J
|
|
913
|
-
ref:
|
|
911
|
+
let A = u.length > 0, j = o.list_pagination === "cursor";
|
|
912
|
+
return /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y(d, {
|
|
913
|
+
ref: T,
|
|
914
914
|
kind: "ghost",
|
|
915
915
|
size: "sm",
|
|
916
|
-
icon: /* @__PURE__ */
|
|
916
|
+
icon: /* @__PURE__ */ Y(e.download, { size: 12 }),
|
|
917
917
|
onClick: () => {
|
|
918
|
-
|
|
918
|
+
v?.(), b((e) => !e);
|
|
919
919
|
},
|
|
920
|
-
disabled:
|
|
920
|
+
disabled: x,
|
|
921
921
|
"aria-label": "Export",
|
|
922
922
|
title: "Export",
|
|
923
|
-
children: n ? null :
|
|
924
|
-
}), /* @__PURE__ */
|
|
925
|
-
open:
|
|
926
|
-
anchor:
|
|
927
|
-
onClose: () =>
|
|
928
|
-
align:
|
|
923
|
+
children: n ? null : x ? "Exporting…" : "Export"
|
|
924
|
+
}), /* @__PURE__ */ X(h, {
|
|
925
|
+
open: y,
|
|
926
|
+
anchor: T.current,
|
|
927
|
+
onClose: () => b(!1),
|
|
928
|
+
align: g,
|
|
929
929
|
width: 260,
|
|
930
930
|
children: [
|
|
931
|
-
/* @__PURE__ */
|
|
932
|
-
icon: /* @__PURE__ */
|
|
933
|
-
onClick:
|
|
934
|
-
children: ["Current view (CSV) · ",
|
|
931
|
+
/* @__PURE__ */ X(I, {
|
|
932
|
+
icon: /* @__PURE__ */ Y(e.download, { size: 12 }),
|
|
933
|
+
onClick: x ? void 0 : () => void k("current_view"),
|
|
934
|
+
children: ["Current view (CSV) · ", an(f)]
|
|
935
935
|
}),
|
|
936
|
-
|
|
937
|
-
icon: /* @__PURE__ */
|
|
938
|
-
onClick:
|
|
939
|
-
children: ["Selected rows (CSV) · ",
|
|
936
|
+
A && /* @__PURE__ */ X(I, {
|
|
937
|
+
icon: /* @__PURE__ */ Y(e.check, { size: 12 }),
|
|
938
|
+
onClick: x ? void 0 : () => void k("selected_rows"),
|
|
939
|
+
children: ["Selected rows (CSV) · ", u.length]
|
|
940
940
|
}),
|
|
941
|
-
|
|
942
|
-
icon: /* @__PURE__ */
|
|
941
|
+
j ? /* @__PURE__ */ Y(I, {
|
|
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__ */
|
|
947
|
-
icon: /* @__PURE__ */
|
|
948
|
-
onClick:
|
|
949
|
-
children: ["Current page (CSV) · ",
|
|
946
|
+
}) : /* @__PURE__ */ X(I, {
|
|
947
|
+
icon: /* @__PURE__ */ Y(e.columns, { size: 12 }),
|
|
948
|
+
onClick: x ? void 0 : () => void k("current_page"),
|
|
949
|
+
children: ["Current page (CSV) · ", p ? `${p} rows` : "page window"]
|
|
950
950
|
}),
|
|
951
|
-
/* @__PURE__ */
|
|
952
|
-
icon: /* @__PURE__ */
|
|
951
|
+
/* @__PURE__ */ Y(I, {
|
|
952
|
+
icon: /* @__PURE__ */ Y(e.grid, { size: 12 }),
|
|
953
953
|
children: "XLSX (coming soon)"
|
|
954
954
|
}),
|
|
955
|
-
|
|
955
|
+
C && /* @__PURE__ */ Y("div", {
|
|
956
956
|
role: "alert",
|
|
957
957
|
style: {
|
|
958
958
|
padding: "6px 10px",
|
|
@@ -961,69 +961,69 @@ function ln(t) {
|
|
|
961
961
|
color: "var(--destructive)",
|
|
962
962
|
borderTop: "1px solid var(--border)"
|
|
963
963
|
},
|
|
964
|
-
children:
|
|
964
|
+
children: C.message
|
|
965
965
|
})
|
|
966
966
|
]
|
|
967
967
|
})] });
|
|
968
968
|
}
|
|
969
|
-
function
|
|
969
|
+
function sn() {
|
|
970
970
|
let e = /* @__PURE__ */ new Date(), t = (e) => String(e).padStart(2, "0");
|
|
971
971
|
return `${e.getUTCFullYear()}${t(e.getUTCMonth() + 1)}${t(e.getUTCDate())}-${t(e.getUTCHours())}${t(e.getUTCMinutes())}`;
|
|
972
972
|
}
|
|
973
|
-
function
|
|
973
|
+
function cn(e, t) {
|
|
974
974
|
let n = URL.createObjectURL(e), r = document.createElement("a");
|
|
975
975
|
r.href = n, r.download = t, r.style.display = "none", document.body.appendChild(r), r.click(), document.body.removeChild(r), setTimeout(() => URL.revokeObjectURL(n), 0);
|
|
976
976
|
}
|
|
977
977
|
//#endregion
|
|
978
978
|
//#region src/components/pages/list/ListToolbar.tsx
|
|
979
|
-
function
|
|
980
|
-
let [
|
|
981
|
-
let e =
|
|
982
|
-
|
|
983
|
-
},
|
|
979
|
+
function ln({ screen: t, entity: n, entityCode: r, schema: i, screenCode: a, screenName: s, locale: c, isPhone: l, isCardsPresentation: u, sort: f, columns: p, views: m, query: g, selection: y, filters: b, searchValue: x, onSearchChange: S, onSaveView: C, page: w, perPage: T, includeDeleted: E, canViewDeleted: D, onToggleDeleted: O, isLive: k }) {
|
|
980
|
+
let [A, ee] = q(!1), [te, ne] = q(!1), [re, M] = q(!1), ie = K(null), N = K(null), P = Ee((e) => e.density), ae = () => {
|
|
981
|
+
let e = P === "compact" ? "comfortable" : P === "comfortable" ? "cozy" : "compact";
|
|
982
|
+
Ee.getState().setMany({ density: e });
|
|
983
|
+
}, oe = !l || A || x !== "", F = (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 ? j(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 ? j(r.name) || t : e;
|
|
991
991
|
}
|
|
992
|
-
return
|
|
993
|
-
},
|
|
994
|
-
return /* @__PURE__ */
|
|
992
|
+
return Re(n, e, i?.entities);
|
|
993
|
+
}, se = (t.columns ?? []).filter((e) => Jt(e, n));
|
|
994
|
+
return /* @__PURE__ */ X("div", {
|
|
995
995
|
style: {
|
|
996
996
|
display: "flex",
|
|
997
997
|
alignItems: "center",
|
|
998
998
|
gap: l ? 6 : 8,
|
|
999
999
|
paddingTop: 0,
|
|
1000
1000
|
paddingBottom: 10,
|
|
1001
|
-
...l ?
|
|
1001
|
+
...l ? De(12) : {
|
|
1002
1002
|
paddingLeft: 20,
|
|
1003
1003
|
paddingRight: 20
|
|
1004
1004
|
},
|
|
1005
1005
|
flexWrap: "wrap"
|
|
1006
1006
|
},
|
|
1007
1007
|
children: [
|
|
1008
|
-
/* @__PURE__ */
|
|
1009
|
-
views:
|
|
1010
|
-
activeViewId:
|
|
1011
|
-
isDirty:
|
|
1012
|
-
onSelect:
|
|
1013
|
-
onSaveAs:
|
|
1008
|
+
/* @__PURE__ */ Y(tt, {
|
|
1009
|
+
views: m.all,
|
|
1010
|
+
activeViewId: m.activeId,
|
|
1011
|
+
isDirty: m.isDirty,
|
|
1012
|
+
onSelect: m.apply,
|
|
1013
|
+
onSaveAs: C
|
|
1014
1014
|
}),
|
|
1015
|
-
|
|
1015
|
+
oe ? /* @__PURE__ */ X("div", {
|
|
1016
1016
|
style: {
|
|
1017
1017
|
position: "relative",
|
|
1018
1018
|
width: l ? "100%" : 260,
|
|
1019
1019
|
order: l ? -1 : 0
|
|
1020
1020
|
},
|
|
1021
|
-
children: [/* @__PURE__ */
|
|
1022
|
-
value:
|
|
1023
|
-
onChange:
|
|
1024
|
-
placeholder: `Search ${
|
|
1025
|
-
prefix: /* @__PURE__ */
|
|
1026
|
-
}), /* @__PURE__ */
|
|
1021
|
+
children: [/* @__PURE__ */ Y(he, {
|
|
1022
|
+
value: x,
|
|
1023
|
+
onChange: S,
|
|
1024
|
+
placeholder: `Search ${s.toLowerCase()}…`,
|
|
1025
|
+
prefix: /* @__PURE__ */ Y(e.search, { size: 13 })
|
|
1026
|
+
}), /* @__PURE__ */ Y("span", {
|
|
1027
1027
|
style: {
|
|
1028
1028
|
position: "absolute",
|
|
1029
1029
|
right: 6,
|
|
@@ -1031,43 +1031,43 @@ function fn({ screen: t, entity: n, entityCode: r, schema: i, screenCode: a, scr
|
|
|
1031
1031
|
transform: "translateY(-50%)",
|
|
1032
1032
|
pointerEvents: "none"
|
|
1033
1033
|
},
|
|
1034
|
-
children: /* @__PURE__ */
|
|
1034
|
+
children: /* @__PURE__ */ Y(_, { children: "/" })
|
|
1035
1035
|
})]
|
|
1036
|
-
}) : /* @__PURE__ */
|
|
1037
|
-
icon: /* @__PURE__ */
|
|
1038
|
-
title: `Search ${
|
|
1039
|
-
onClick: () =>
|
|
1036
|
+
}) : /* @__PURE__ */ Y(o, {
|
|
1037
|
+
icon: /* @__PURE__ */ Y(e.search, { size: 14 }),
|
|
1038
|
+
title: `Search ${s.toLowerCase()}`,
|
|
1039
|
+
onClick: () => ee(!0)
|
|
1040
1040
|
}),
|
|
1041
|
-
/* @__PURE__ */
|
|
1042
|
-
icon: /* @__PURE__ */
|
|
1043
|
-
onClick:
|
|
1044
|
-
active:
|
|
1045
|
-
children: ["Filters",
|
|
1041
|
+
/* @__PURE__ */ X(d, {
|
|
1042
|
+
icon: /* @__PURE__ */ Y(e.filter, { size: 13 }),
|
|
1043
|
+
onClick: b.onOpen,
|
|
1044
|
+
active: b.count > 0,
|
|
1045
|
+
children: ["Filters", b.count > 0 && /* @__PURE__ */ Y(v, {
|
|
1046
1046
|
tone: "violet",
|
|
1047
1047
|
size: "xs",
|
|
1048
1048
|
style: { marginLeft: 4 },
|
|
1049
|
-
children:
|
|
1049
|
+
children: b.count
|
|
1050
1050
|
})]
|
|
1051
1051
|
}),
|
|
1052
|
-
u && /* @__PURE__ */ J
|
|
1053
|
-
ref:
|
|
1054
|
-
icon: /* @__PURE__ */
|
|
1055
|
-
onClick: () =>
|
|
1056
|
-
active:
|
|
1057
|
-
children: ["Sort",
|
|
1052
|
+
u && /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ X(d, {
|
|
1053
|
+
ref: ie,
|
|
1054
|
+
icon: /* @__PURE__ */ Y(e.sort, { size: 13 }),
|
|
1055
|
+
onClick: () => ne((e) => !e),
|
|
1056
|
+
active: te || f.cols.length > 0,
|
|
1057
|
+
children: ["Sort", f.cols.length > 0 && /* @__PURE__ */ Y(v, {
|
|
1058
1058
|
tone: "slate",
|
|
1059
1059
|
size: "xs",
|
|
1060
1060
|
style: { marginLeft: 4 },
|
|
1061
|
-
children:
|
|
1061
|
+
children: f.cols.length
|
|
1062
1062
|
})]
|
|
1063
|
-
}), /* @__PURE__ */
|
|
1064
|
-
open:
|
|
1065
|
-
anchor:
|
|
1066
|
-
onClose: () =>
|
|
1063
|
+
}), /* @__PURE__ */ X(h, {
|
|
1064
|
+
open: te,
|
|
1065
|
+
anchor: ie.current,
|
|
1066
|
+
onClose: () => ne(!1),
|
|
1067
1067
|
align: "start",
|
|
1068
1068
|
width: 280,
|
|
1069
1069
|
children: [
|
|
1070
|
-
/* @__PURE__ */
|
|
1070
|
+
/* @__PURE__ */ Y("div", {
|
|
1071
1071
|
style: {
|
|
1072
1072
|
padding: "6px 8px 4px",
|
|
1073
1073
|
fontSize: 10,
|
|
@@ -1078,131 +1078,130 @@ function fn({ 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__ */
|
|
1084
|
-
icon: n ? n.dir === "desc" ? /* @__PURE__ */
|
|
1081
|
+
se.map((t) => {
|
|
1082
|
+
let n = f.cols.find((e) => e.field === t);
|
|
1083
|
+
return /* @__PURE__ */ Y(I, {
|
|
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
|
+
f.applyColumn(t, n?.dir === "asc" ? "desc" : "asc", void 0), ne(!1);
|
|
1091
1091
|
},
|
|
1092
|
-
children:
|
|
1092
|
+
children: F(t)
|
|
1093
1093
|
}, t);
|
|
1094
1094
|
}),
|
|
1095
|
-
|
|
1096
|
-
icon: /* @__PURE__ */
|
|
1095
|
+
f.cols.length > 0 && /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y(I, { divider: !0 }), /* @__PURE__ */ Y(I, {
|
|
1096
|
+
icon: /* @__PURE__ */ Y(e.x, { size: 12 }),
|
|
1097
1097
|
onClick: () => {
|
|
1098
|
-
|
|
1098
|
+
f.clearAll(), ne(!1);
|
|
1099
1099
|
},
|
|
1100
1100
|
children: "Clear sort"
|
|
1101
1101
|
})] })
|
|
1102
1102
|
]
|
|
1103
1103
|
})] }),
|
|
1104
|
-
!u && /* @__PURE__ */
|
|
1104
|
+
!u && /* @__PURE__ */ Y(rt, {
|
|
1105
1105
|
availableColumns: t.columns ?? [],
|
|
1106
|
-
visibleColumns:
|
|
1106
|
+
visibleColumns: p.visible,
|
|
1107
1107
|
onToggle: (e) => {
|
|
1108
|
-
let t =
|
|
1109
|
-
|
|
1108
|
+
let t = p.visible.includes(e) ? p.visible.filter((t) => t !== e) : [...p.visible, e];
|
|
1109
|
+
p.apply(t);
|
|
1110
1110
|
},
|
|
1111
|
-
onMove:
|
|
1112
|
-
onReset:
|
|
1113
|
-
onShowAll: () =>
|
|
1114
|
-
onResetWidths:
|
|
1115
|
-
columnLabel:
|
|
1111
|
+
onMove: p.move,
|
|
1112
|
+
onReset: p.clear,
|
|
1113
|
+
onShowAll: () => p.apply(t.columns ?? []),
|
|
1114
|
+
onResetWidths: p.resetWidths,
|
|
1115
|
+
columnLabel: F
|
|
1116
1116
|
}),
|
|
1117
|
-
!l && /* @__PURE__ */
|
|
1117
|
+
!l && /* @__PURE__ */ Y("span", { style: {
|
|
1118
1118
|
width: 1,
|
|
1119
1119
|
height: 20,
|
|
1120
1120
|
background: "var(--divider)"
|
|
1121
1121
|
} }),
|
|
1122
|
-
!l && /* @__PURE__ */
|
|
1123
|
-
icon: /* @__PURE__ */
|
|
1122
|
+
!l && /* @__PURE__ */ Y(o, {
|
|
1123
|
+
icon: /* @__PURE__ */ Y(e.grid, { size: 14 }),
|
|
1124
1124
|
title: "Density",
|
|
1125
|
-
active:
|
|
1126
|
-
onClick:
|
|
1125
|
+
active: P !== "compact",
|
|
1126
|
+
onClick: ae
|
|
1127
1127
|
}),
|
|
1128
|
-
/* @__PURE__ */
|
|
1128
|
+
/* @__PURE__ */ Y(xe, {
|
|
1129
1129
|
liveObject: {
|
|
1130
|
-
refetch:
|
|
1131
|
-
|
|
1132
|
-
isLoading: m.isLoading,
|
|
1130
|
+
refetch: g.retry,
|
|
1131
|
+
isLoading: g.isLoading,
|
|
1133
1132
|
isLive: k
|
|
1134
1133
|
},
|
|
1135
1134
|
realtime: k
|
|
1136
1135
|
}),
|
|
1137
|
-
!l && /* @__PURE__ */
|
|
1138
|
-
!l &&
|
|
1136
|
+
!l && /* @__PURE__ */ Y("div", { style: { flex: 1 } }),
|
|
1137
|
+
!l && D && /* @__PURE__ */ Y(d, {
|
|
1139
1138
|
kind: "ghost",
|
|
1140
1139
|
size: "sm",
|
|
1141
|
-
icon:
|
|
1140
|
+
icon: Y(E ? e.eyeOff : e.eye, { size: 12 }),
|
|
1142
1141
|
onClick: O,
|
|
1143
|
-
active:
|
|
1144
|
-
children:
|
|
1142
|
+
active: E,
|
|
1143
|
+
children: E ? "Hide deleted" : "Show deleted"
|
|
1145
1144
|
}),
|
|
1146
|
-
l && /* @__PURE__ */ J
|
|
1147
|
-
ref:
|
|
1148
|
-
icon: /* @__PURE__ */
|
|
1145
|
+
l && /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y(o, {
|
|
1146
|
+
ref: N,
|
|
1147
|
+
icon: /* @__PURE__ */ Y(e.more, { size: 14 }),
|
|
1149
1148
|
title: "More",
|
|
1150
|
-
active:
|
|
1151
|
-
onClick: () =>
|
|
1152
|
-
}), /* @__PURE__ */
|
|
1153
|
-
open:
|
|
1154
|
-
anchor:
|
|
1155
|
-
onClose: () =>
|
|
1149
|
+
active: re,
|
|
1150
|
+
onClick: () => M((e) => !e)
|
|
1151
|
+
}), /* @__PURE__ */ X(h, {
|
|
1152
|
+
open: re,
|
|
1153
|
+
anchor: N.current,
|
|
1154
|
+
onClose: () => M(!1),
|
|
1156
1155
|
align: "end",
|
|
1157
1156
|
width: 220,
|
|
1158
|
-
children: [/* @__PURE__ */
|
|
1159
|
-
icon: /* @__PURE__ */
|
|
1157
|
+
children: [/* @__PURE__ */ Y(I, {
|
|
1158
|
+
icon: /* @__PURE__ */ Y(e.grid, { size: 13 }),
|
|
1160
1159
|
onClick: () => {
|
|
1161
|
-
|
|
1160
|
+
ae(), M(!1);
|
|
1162
1161
|
},
|
|
1163
1162
|
children: "Density"
|
|
1164
|
-
}),
|
|
1165
|
-
icon:
|
|
1163
|
+
}), D && /* @__PURE__ */ Y(I, {
|
|
1164
|
+
icon: Y(E ? e.eyeOff : e.eye, { size: 13 }),
|
|
1166
1165
|
onClick: () => {
|
|
1167
|
-
O(),
|
|
1166
|
+
O(), M(!1);
|
|
1168
1167
|
},
|
|
1169
|
-
children:
|
|
1168
|
+
children: E ? "Hide deleted" : "Show deleted"
|
|
1170
1169
|
})]
|
|
1171
1170
|
})] }),
|
|
1172
|
-
r && n && /* @__PURE__ */
|
|
1171
|
+
r && n && /* @__PURE__ */ Y(ft, {
|
|
1173
1172
|
entityCode: r,
|
|
1174
1173
|
scope: "list",
|
|
1175
|
-
selectedIds:
|
|
1174
|
+
selectedIds: y.ids,
|
|
1176
1175
|
viewState: {
|
|
1177
1176
|
screenCode: a,
|
|
1178
|
-
jsonFilters:
|
|
1179
|
-
search:
|
|
1180
|
-
sort:
|
|
1181
|
-
includeDeleted:
|
|
1182
|
-
page:
|
|
1183
|
-
perPage:
|
|
1177
|
+
jsonFilters: b.json,
|
|
1178
|
+
search: b.debouncedSearch,
|
|
1179
|
+
sort: f.forRequest,
|
|
1180
|
+
includeDeleted: E || void 0,
|
|
1181
|
+
page: w,
|
|
1182
|
+
perPage: T
|
|
1184
1183
|
},
|
|
1185
1184
|
locale: c,
|
|
1186
1185
|
capability: n.documents,
|
|
1187
|
-
canManageTemplates:
|
|
1186
|
+
canManageTemplates: B(i)
|
|
1188
1187
|
}),
|
|
1189
|
-
r && n && /* @__PURE__ */
|
|
1188
|
+
r && n && /* @__PURE__ */ Y(on, {
|
|
1190
1189
|
entityCode: r,
|
|
1191
1190
|
entity: n,
|
|
1192
1191
|
screen: t,
|
|
1193
1192
|
viewState: {
|
|
1194
1193
|
screenCode: a,
|
|
1195
|
-
jsonFilters:
|
|
1196
|
-
search:
|
|
1197
|
-
sort:
|
|
1198
|
-
includeDeleted:
|
|
1199
|
-
page:
|
|
1200
|
-
perPage:
|
|
1194
|
+
jsonFilters: b.json,
|
|
1195
|
+
search: b.debouncedSearch,
|
|
1196
|
+
sort: f.forRequest,
|
|
1197
|
+
includeDeleted: E || void 0,
|
|
1198
|
+
page: w,
|
|
1199
|
+
perPage: T
|
|
1201
1200
|
},
|
|
1202
|
-
visibleColumns:
|
|
1203
|
-
selectedRowPKs:
|
|
1204
|
-
totalRows:
|
|
1205
|
-
pageSize:
|
|
1201
|
+
visibleColumns: p.visible,
|
|
1202
|
+
selectedRowPKs: y.pkValues,
|
|
1203
|
+
totalRows: g.countTotal,
|
|
1204
|
+
pageSize: T,
|
|
1206
1205
|
locale: c
|
|
1207
1206
|
})
|
|
1208
1207
|
]
|
|
@@ -1210,53 +1209,53 @@ function fn({ screen: t, entity: n, entityCode: r, schema: i, screenCode: a, scr
|
|
|
1210
1209
|
}
|
|
1211
1210
|
//#endregion
|
|
1212
1211
|
//#region src/components/pages/list/useListViews.ts
|
|
1213
|
-
function
|
|
1212
|
+
function un(e) {
|
|
1214
1213
|
let t = new URLSearchParams(), n = e.get("search");
|
|
1215
1214
|
n && t.set("search", n);
|
|
1216
|
-
for (let n of
|
|
1215
|
+
for (let n of x) {
|
|
1217
1216
|
let r = e.get(n);
|
|
1218
1217
|
r !== null && t.set(n, r);
|
|
1219
1218
|
}
|
|
1220
1219
|
return t;
|
|
1221
1220
|
}
|
|
1222
|
-
function
|
|
1221
|
+
function dn(e, t) {
|
|
1223
1222
|
let n = F(t.id);
|
|
1224
1223
|
n && e.setQueriesData({ queryKey: ["entity-data", "view"] }, (e) => !e || e.data.some((e) => F(e.id) === n) ? e : {
|
|
1225
1224
|
...e,
|
|
1226
1225
|
data: [t, ...e.data]
|
|
1227
1226
|
});
|
|
1228
1227
|
}
|
|
1229
|
-
function
|
|
1230
|
-
let u =
|
|
1231
|
-
|
|
1232
|
-
if (
|
|
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 = $e(e, i), f = n.get("view"), p = G(() => d.find((e) => e.id === f), [d, f]), m = je("view"), h = Ae("view"), _ = `dcl:smartlist:default-view-cleared:${e}`, v = K(!1);
|
|
1230
|
+
W(() => {
|
|
1231
|
+
if (v.current) return;
|
|
1233
1232
|
if (o) {
|
|
1234
|
-
|
|
1233
|
+
v.current = !0;
|
|
1235
1234
|
return;
|
|
1236
1235
|
}
|
|
1237
1236
|
if (!d || d.length === 0) return;
|
|
1238
1237
|
if (n.get("view")) {
|
|
1239
|
-
|
|
1238
|
+
v.current = !0;
|
|
1240
1239
|
return;
|
|
1241
1240
|
}
|
|
1242
|
-
if (typeof window < "u" && window.sessionStorage?.getItem(
|
|
1243
|
-
|
|
1241
|
+
if (typeof window < "u" && window.sessionStorage?.getItem(_)) {
|
|
1242
|
+
v.current = !0;
|
|
1244
1243
|
return;
|
|
1245
1244
|
}
|
|
1246
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);
|
|
1247
1246
|
if (!e || !e.id) return;
|
|
1248
|
-
|
|
1249
|
-
let i =
|
|
1247
|
+
v.current = !0;
|
|
1248
|
+
let i = un(n);
|
|
1250
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 });
|
|
1251
1250
|
}, [
|
|
1252
1251
|
d,
|
|
1253
1252
|
o,
|
|
1254
1253
|
n,
|
|
1255
1254
|
r,
|
|
1256
|
-
|
|
1255
|
+
_,
|
|
1257
1256
|
t?.default_view
|
|
1258
1257
|
]);
|
|
1259
|
-
let
|
|
1258
|
+
let y = G(() => {
|
|
1260
1259
|
if (!f || !p) return !1;
|
|
1261
1260
|
let e = p.filters ?? [], n = p.columns?.length ? p.columns : t?.default_columns ?? t?.columns ?? [], r = p.sort ?? t?.sort_default ?? "";
|
|
1262
1261
|
return JSON.stringify(s) !== JSON.stringify(e) || c.join(",") !== n.join(",") || (l ?? "") !== r;
|
|
@@ -1269,22 +1268,22 @@ function hn({ screenCode: e, screen: t, searchParams: n, setSearchParams: r, use
|
|
|
1269
1268
|
t?.default_columns,
|
|
1270
1269
|
t?.columns,
|
|
1271
1270
|
t?.sort_default
|
|
1272
|
-
]),
|
|
1273
|
-
let i = new URLSearchParams(n), a =
|
|
1274
|
-
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(
|
|
1271
|
+
]), b = U((e) => {
|
|
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(_, "1"), r(a);
|
|
1275
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(",");
|
|
1276
|
-
(i.get("columns") ?? c) !== c &&
|
|
1275
|
+
(i.get("columns") ?? c) !== c && g.info("View applied", "Your unsaved column changes were replaced.", { action: {
|
|
1277
1276
|
label: "Undo",
|
|
1278
1277
|
onClick: () => r(i)
|
|
1279
1278
|
} });
|
|
1280
1279
|
}, [
|
|
1281
1280
|
n,
|
|
1282
1281
|
r,
|
|
1283
|
-
|
|
1282
|
+
_,
|
|
1284
1283
|
d,
|
|
1285
1284
|
t?.default_columns,
|
|
1286
1285
|
t?.columns
|
|
1287
|
-
]),
|
|
1286
|
+
]), x = U(async () => {
|
|
1288
1287
|
!p?.id || p.source !== "personal" || (await h.mutateAsync({
|
|
1289
1288
|
pkValues: p.id,
|
|
1290
1289
|
data: {
|
|
@@ -1305,9 +1304,9 @@ function hn({ screenCode: e, screen: t, searchParams: n, setSearchParams: r, use
|
|
|
1305
1304
|
all: d,
|
|
1306
1305
|
activeId: f,
|
|
1307
1306
|
active: p,
|
|
1308
|
-
isDirty:
|
|
1309
|
-
apply:
|
|
1310
|
-
saveAsNew:
|
|
1307
|
+
isDirty: y,
|
|
1308
|
+
apply: b,
|
|
1309
|
+
saveAsNew: U(async (t) => {
|
|
1311
1310
|
if (!i || !a) return;
|
|
1312
1311
|
let o = await m.mutateAsync({
|
|
1313
1312
|
tenant_id: a,
|
|
@@ -1321,7 +1320,7 @@ function hn({ screenCode: e, screen: t, searchParams: n, setSearchParams: r, use
|
|
|
1321
1320
|
is_default: !1
|
|
1322
1321
|
}), d = F(o.data.id);
|
|
1323
1322
|
if (!d) return;
|
|
1324
|
-
|
|
1323
|
+
dn(u, o.data), await u.invalidateQueries({ queryKey: ["entity-data", "view"] });
|
|
1325
1324
|
let f = new URLSearchParams(n);
|
|
1326
1325
|
f.set("view", d), r(f);
|
|
1327
1326
|
}, [
|
|
@@ -1336,20 +1335,20 @@ function hn({ screenCode: e, screen: t, searchParams: n, setSearchParams: r, use
|
|
|
1336
1335
|
n,
|
|
1337
1336
|
r
|
|
1338
1337
|
]),
|
|
1339
|
-
overwriteActive:
|
|
1338
|
+
overwriteActive: x,
|
|
1340
1339
|
isSaving: m.isPending || h.isPending
|
|
1341
1340
|
};
|
|
1342
1341
|
}
|
|
1343
|
-
function
|
|
1344
|
-
return e && e.source === "personal" ?
|
|
1342
|
+
function pn(e) {
|
|
1343
|
+
return e && e.source === "personal" ? j(e.name) : null;
|
|
1345
1344
|
}
|
|
1346
1345
|
//#endregion
|
|
1347
1346
|
//#region src/components/pages/list/use-filter-value-labels.ts
|
|
1348
|
-
var
|
|
1349
|
-
function
|
|
1350
|
-
let i = new Map(e.map((e) => [e.code, e])), a =
|
|
1347
|
+
var Z = 200;
|
|
1348
|
+
function mn(e, t, n, r) {
|
|
1349
|
+
let i = new Map(e.map((e) => [e.code, e])), a = hn(i, t, n, r), o = vt({ queries: a.map((e) => {
|
|
1351
1350
|
let t = {
|
|
1352
|
-
per_page:
|
|
1351
|
+
per_page: Z,
|
|
1353
1352
|
filters: [{
|
|
1354
1353
|
field: e.lookupField,
|
|
1355
1354
|
op: "in",
|
|
@@ -1363,24 +1362,24 @@ function vn(e, t, n, r) {
|
|
|
1363
1362
|
e.entity,
|
|
1364
1363
|
t
|
|
1365
1364
|
],
|
|
1366
|
-
queryFn: ({ signal: n }) =>
|
|
1365
|
+
queryFn: ({ signal: n }) => y(e.entity, t, { signal: n }),
|
|
1367
1366
|
staleTime: 6e4
|
|
1368
1367
|
};
|
|
1369
|
-
}) }),
|
|
1370
|
-
if (n) for (let [e, t] of Object.entries(n))
|
|
1371
|
-
let
|
|
1372
|
-
return
|
|
1368
|
+
}) }), s = {};
|
|
1369
|
+
if (n) for (let [e, t] of Object.entries(n)) s[e] = { ...t };
|
|
1370
|
+
let c = /* @__PURE__ */ new Set();
|
|
1371
|
+
return o.forEach((e, t) => {
|
|
1373
1372
|
let n = a[t];
|
|
1374
1373
|
if (!n) return;
|
|
1375
1374
|
let r = e.data?.data;
|
|
1376
1375
|
if (r) {
|
|
1377
|
-
let e =
|
|
1376
|
+
let e = s[n.entity] ??= {};
|
|
1378
1377
|
for (let t of r) {
|
|
1379
1378
|
let r = F(t[n.lookupField]);
|
|
1380
1379
|
r && (e[r] = t);
|
|
1381
1380
|
}
|
|
1382
1381
|
}
|
|
1383
|
-
if (e.isLoading) for (let e of n.values)
|
|
1382
|
+
if (e.isLoading) for (let e of n.values) s[n.entity]?.[e] || c.add(`${n.entity}::${e}`);
|
|
1384
1383
|
}), {
|
|
1385
1384
|
labelFor: (e, t) => {
|
|
1386
1385
|
let n = F(t), a = i.get(e);
|
|
@@ -1391,7 +1390,7 @@ function vn(e, t, n, r) {
|
|
|
1391
1390
|
let o = a.specialValues?.find((e) => e.code === n);
|
|
1392
1391
|
if (o) return {
|
|
1393
1392
|
status: "special",
|
|
1394
|
-
label:
|
|
1393
|
+
label: j(o.label) || n,
|
|
1395
1394
|
raw: n
|
|
1396
1395
|
};
|
|
1397
1396
|
if (a.options) {
|
|
@@ -1403,16 +1402,16 @@ function vn(e, t, n, r) {
|
|
|
1403
1402
|
};
|
|
1404
1403
|
}
|
|
1405
1404
|
if (a.type === "ref" && a.ref?.entity) {
|
|
1406
|
-
let e = a.ref.entity, t =
|
|
1405
|
+
let e = a.ref.entity, t = s[e]?.[n];
|
|
1407
1406
|
if (t) {
|
|
1408
1407
|
let i = a.ref.display?.field ?? r?.[e]?.display?.display_field;
|
|
1409
1408
|
return {
|
|
1410
1409
|
status: "resolved",
|
|
1411
|
-
label:
|
|
1410
|
+
label: P(t, i, n),
|
|
1412
1411
|
raw: n
|
|
1413
1412
|
};
|
|
1414
1413
|
}
|
|
1415
|
-
return
|
|
1414
|
+
return c.has(`${e}::${n}`) ? {
|
|
1416
1415
|
status: "loading",
|
|
1417
1416
|
raw: n
|
|
1418
1417
|
} : {
|
|
@@ -1425,24 +1424,24 @@ function vn(e, t, n, r) {
|
|
|
1425
1424
|
raw: n
|
|
1426
1425
|
};
|
|
1427
1426
|
},
|
|
1428
|
-
refs:
|
|
1427
|
+
refs: s
|
|
1429
1428
|
};
|
|
1430
1429
|
}
|
|
1431
|
-
function
|
|
1430
|
+
function hn(e, t, n, r) {
|
|
1432
1431
|
let i = /* @__PURE__ */ new Map();
|
|
1433
|
-
for (let a of
|
|
1432
|
+
for (let a of at(t)) {
|
|
1434
1433
|
if (!a.field) continue;
|
|
1435
1434
|
let t = e.get(a.field);
|
|
1436
1435
|
if (!t || t.type !== "ref" || !t.ref?.entity) continue;
|
|
1437
|
-
let o = t.ref.entity, s = r?.[o],
|
|
1438
|
-
for (let e of
|
|
1436
|
+
let o = t.ref.entity, s = r?.[o], c = t.ref.field || (s ? D(s)[0] : "id") || "id", l = Array.isArray(a.value) ? a.value : [a.value];
|
|
1437
|
+
for (let e of l) {
|
|
1439
1438
|
let r = F(e);
|
|
1440
1439
|
if (!r || t.specialValues?.some((e) => e.code === r) || n?.[o]?.[r]) continue;
|
|
1441
|
-
let a = `${o}::${
|
|
1440
|
+
let a = `${o}::${c}`, s = i.get(a);
|
|
1442
1441
|
s || (s = {
|
|
1443
1442
|
key: a,
|
|
1444
1443
|
entity: o,
|
|
1445
|
-
lookupField:
|
|
1444
|
+
lookupField: c,
|
|
1446
1445
|
values: []
|
|
1447
1446
|
}, i.set(a, s)), s.values.includes(r) || s.values.push(r);
|
|
1448
1447
|
}
|
|
@@ -1453,13 +1452,13 @@ function Y(e, t, n, r) {
|
|
|
1453
1452
|
}
|
|
1454
1453
|
//#endregion
|
|
1455
1454
|
//#region src/components/pages/list/SaveViewDialog.tsx
|
|
1456
|
-
function
|
|
1457
|
-
let [o, s] =
|
|
1458
|
-
if (
|
|
1455
|
+
function gn({ open: e, pending: t, onClose: n, onSave: r, overwriteViewName: i, onOverwrite: a }) {
|
|
1456
|
+
let [o, s] = q(""), c = !!(i && a);
|
|
1457
|
+
if (W(() => {
|
|
1459
1458
|
e && s("");
|
|
1460
1459
|
}, [e]), !e) return null;
|
|
1461
1460
|
let l = o.trim();
|
|
1462
|
-
return /* @__PURE__ */ J
|
|
1461
|
+
return /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y("div", {
|
|
1463
1462
|
onClick: n,
|
|
1464
1463
|
style: {
|
|
1465
1464
|
position: "fixed",
|
|
@@ -1467,7 +1466,7 @@ function yn({ open: e, pending: t, onClose: n, onSave: r, overwriteViewName: i,
|
|
|
1467
1466
|
background: "var(--scrim)",
|
|
1468
1467
|
zIndex: 70
|
|
1469
1468
|
}
|
|
1470
|
-
}), /* @__PURE__ */
|
|
1469
|
+
}), /* @__PURE__ */ X("div", {
|
|
1471
1470
|
role: "dialog",
|
|
1472
1471
|
"aria-label": "Save view",
|
|
1473
1472
|
"aria-modal": "true",
|
|
@@ -1489,14 +1488,14 @@ function yn({ open: e, pending: t, onClose: n, onSave: r, overwriteViewName: i,
|
|
|
1489
1488
|
gap: 12
|
|
1490
1489
|
},
|
|
1491
1490
|
children: [
|
|
1492
|
-
/* @__PURE__ */
|
|
1491
|
+
/* @__PURE__ */ X("div", { children: [/* @__PURE__ */ Y("h3", {
|
|
1493
1492
|
style: {
|
|
1494
1493
|
margin: 0,
|
|
1495
1494
|
fontSize: 14,
|
|
1496
1495
|
color: "var(--text)"
|
|
1497
1496
|
},
|
|
1498
1497
|
children: "Save view"
|
|
1499
|
-
}), /* @__PURE__ */
|
|
1498
|
+
}), /* @__PURE__ */ Y("p", {
|
|
1500
1499
|
style: {
|
|
1501
1500
|
margin: "4px 0 0",
|
|
1502
1501
|
fontSize: 12,
|
|
@@ -1504,20 +1503,20 @@ function yn({ open: e, pending: t, onClose: n, onSave: r, overwriteViewName: i,
|
|
|
1504
1503
|
},
|
|
1505
1504
|
children: "Views save columns, order, filters, and sort. Widths stay personal to this device and are never part of a view."
|
|
1506
1505
|
})] }),
|
|
1507
|
-
/* @__PURE__ */
|
|
1506
|
+
/* @__PURE__ */ X("label", {
|
|
1508
1507
|
style: {
|
|
1509
1508
|
display: "flex",
|
|
1510
1509
|
flexDirection: "column",
|
|
1511
1510
|
gap: 4
|
|
1512
1511
|
},
|
|
1513
|
-
children: [/* @__PURE__ */
|
|
1512
|
+
children: [/* @__PURE__ */ Y("span", {
|
|
1514
1513
|
style: {
|
|
1515
1514
|
fontSize: 11.5,
|
|
1516
1515
|
color: "var(--text-3)",
|
|
1517
1516
|
fontWeight: 500
|
|
1518
1517
|
},
|
|
1519
1518
|
children: "Name"
|
|
1520
|
-
}), /* @__PURE__ */
|
|
1519
|
+
}), /* @__PURE__ */ Y(he, {
|
|
1521
1520
|
autoFocus: !0,
|
|
1522
1521
|
"aria-label": "View name",
|
|
1523
1522
|
value: o,
|
|
@@ -1528,19 +1527,19 @@ function yn({ open: e, pending: t, onClose: n, onSave: r, overwriteViewName: i,
|
|
|
1528
1527
|
}
|
|
1529
1528
|
})]
|
|
1530
1529
|
}),
|
|
1531
|
-
/* @__PURE__ */
|
|
1530
|
+
/* @__PURE__ */ X("div", {
|
|
1532
1531
|
style: {
|
|
1533
1532
|
display: "flex",
|
|
1534
1533
|
justifyContent: "flex-end",
|
|
1535
1534
|
gap: 8
|
|
1536
1535
|
},
|
|
1537
1536
|
children: [
|
|
1538
|
-
/* @__PURE__ */
|
|
1537
|
+
/* @__PURE__ */ Y(d, {
|
|
1539
1538
|
onClick: n,
|
|
1540
1539
|
disabled: t,
|
|
1541
1540
|
children: "Cancel"
|
|
1542
1541
|
}),
|
|
1543
|
-
c && /* @__PURE__ */
|
|
1542
|
+
c && /* @__PURE__ */ X(d, {
|
|
1544
1543
|
onClick: () => void a(),
|
|
1545
1544
|
disabled: t,
|
|
1546
1545
|
children: [
|
|
@@ -1549,7 +1548,7 @@ function yn({ open: e, pending: t, onClose: n, onSave: r, overwriteViewName: i,
|
|
|
1549
1548
|
"”"
|
|
1550
1549
|
]
|
|
1551
1550
|
}),
|
|
1552
|
-
/* @__PURE__ */
|
|
1551
|
+
/* @__PURE__ */ Y(d, {
|
|
1553
1552
|
kind: "primary",
|
|
1554
1553
|
onClick: () => void r(l),
|
|
1555
1554
|
disabled: !l || t,
|
|
@@ -1562,73 +1561,73 @@ function yn({ open: e, pending: t, onClose: n, onSave: r, overwriteViewName: i,
|
|
|
1562
1561
|
}
|
|
1563
1562
|
//#endregion
|
|
1564
1563
|
//#region src/components/pages/list/ListHeader.tsx
|
|
1565
|
-
function
|
|
1566
|
-
let { run:
|
|
1564
|
+
function _n({ title: t, description: n, toolbarActions: i, screenActionLayout: a, entityActionLayout: l, selectedIds: u, data: d, rowKey: f, onActionSuccess: p, widgetContext: m }) {
|
|
1565
|
+
let { run: h } = N(), { isPhone: g } = r(), _ = be("list"), v = _.isVisible("show_title"), y = _.isVisible("show_actions"), x = Oe(), C = G(() => {
|
|
1567
1566
|
let e = {};
|
|
1568
|
-
for (let { code: t, action: n } of
|
|
1567
|
+
for (let { code: t, action: n } of i) e[t] = n;
|
|
1569
1568
|
return e;
|
|
1570
|
-
}, [
|
|
1571
|
-
i,
|
|
1569
|
+
}, [i]), T = G(() => de((a ?? l) || w(C, "list_toolbar"), C, void 0, "list_toolbar"), [
|
|
1572
1570
|
a,
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1571
|
+
l,
|
|
1572
|
+
C
|
|
1573
|
+
]), E = G(() => s(T, C, void 0, S, "Select one or more rows first"), [T, C]), D = G(() => {
|
|
1574
|
+
if (u.length === 0) return [];
|
|
1576
1575
|
let e = /* @__PURE__ */ new Map();
|
|
1577
|
-
for (let t of
|
|
1578
|
-
return
|
|
1576
|
+
for (let t of d) e.set(f(t), t);
|
|
1577
|
+
return u.map((t) => e.get(t)).filter((e) => e !== void 0);
|
|
1579
1578
|
}, [
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
]),
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
]),
|
|
1588
|
-
let n =
|
|
1579
|
+
u,
|
|
1580
|
+
d,
|
|
1581
|
+
f
|
|
1582
|
+
]), O = G(() => b(T, C, void 0, {}, D), [
|
|
1583
|
+
T,
|
|
1584
|
+
C,
|
|
1585
|
+
D
|
|
1586
|
+
]), k = u.length > 0 ? O : E, ee = (e, t) => {
|
|
1587
|
+
let n = Ue(e, t, {});
|
|
1589
1588
|
if (n === null) return;
|
|
1590
|
-
let r =
|
|
1591
|
-
return
|
|
1589
|
+
let r = j(t.display?.name) || e;
|
|
1590
|
+
return h({
|
|
1592
1591
|
action: t,
|
|
1593
1592
|
title: r,
|
|
1594
|
-
bulkSelection:
|
|
1593
|
+
bulkSelection: D.length > 0 ? D : void 0,
|
|
1595
1594
|
execute: async (e) => {
|
|
1596
|
-
let t =
|
|
1597
|
-
return t && t.length > 0 &&
|
|
1595
|
+
let t = u.length > 0 ? u : void 0, r = await A(n, c(e, t));
|
|
1596
|
+
return t && t.length > 0 && p(), r;
|
|
1598
1597
|
}
|
|
1599
1598
|
});
|
|
1600
1599
|
};
|
|
1601
|
-
return !
|
|
1600
|
+
return !v && !y ? null : /* @__PURE__ */ X("div", {
|
|
1602
1601
|
style: {
|
|
1603
1602
|
display: "flex",
|
|
1604
1603
|
alignItems: "center",
|
|
1605
1604
|
gap: 8,
|
|
1606
|
-
flexWrap:
|
|
1607
|
-
paddingTop:
|
|
1605
|
+
flexWrap: g ? "wrap" : "nowrap",
|
|
1606
|
+
paddingTop: g ? 12 : 16,
|
|
1608
1607
|
paddingBottom: 10,
|
|
1609
|
-
...
|
|
1608
|
+
...g ? De(12) : {
|
|
1610
1609
|
paddingLeft: 20,
|
|
1611
1610
|
paddingRight: 20
|
|
1612
1611
|
}
|
|
1613
1612
|
},
|
|
1614
1613
|
children: [
|
|
1615
|
-
|
|
1616
|
-
icon: /* @__PURE__ */
|
|
1614
|
+
v && x.hasOriginBack && /* @__PURE__ */ Y(o, {
|
|
1615
|
+
icon: /* @__PURE__ */ Y(e.back, { size: 14 }),
|
|
1617
1616
|
title: "Back",
|
|
1618
|
-
onClick:
|
|
1617
|
+
onClick: x.goBack
|
|
1619
1618
|
}),
|
|
1620
|
-
|
|
1619
|
+
v && /* @__PURE__ */ Y("div", {
|
|
1621
1620
|
style: {
|
|
1622
|
-
flex:
|
|
1621
|
+
flex: g ? "1 1 100%" : "1 1 auto",
|
|
1623
1622
|
minWidth: 0
|
|
1624
1623
|
},
|
|
1625
|
-
children: /* @__PURE__ */
|
|
1624
|
+
children: /* @__PURE__ */ X("div", {
|
|
1626
1625
|
style: {
|
|
1627
1626
|
display: "flex",
|
|
1628
1627
|
alignItems: "baseline",
|
|
1629
1628
|
gap: 10
|
|
1630
1629
|
},
|
|
1631
|
-
children: [/* @__PURE__ */
|
|
1630
|
+
children: [/* @__PURE__ */ Y("h1", {
|
|
1632
1631
|
style: {
|
|
1633
1632
|
margin: 0,
|
|
1634
1633
|
minWidth: 0,
|
|
@@ -1642,18 +1641,18 @@ function bn({ title: t, description: n, toolbarActions: r, screenActionLayout: i
|
|
|
1642
1641
|
color: "var(--text)"
|
|
1643
1642
|
},
|
|
1644
1643
|
children: t
|
|
1645
|
-
}), n && /* @__PURE__ */
|
|
1644
|
+
}), n && /* @__PURE__ */ Y(ye, {
|
|
1646
1645
|
label: n,
|
|
1647
1646
|
"data-testid": "list-description-info"
|
|
1648
1647
|
})]
|
|
1649
1648
|
})
|
|
1650
1649
|
}),
|
|
1651
|
-
|
|
1652
|
-
layout:
|
|
1650
|
+
y && k.length > 0 && /* @__PURE__ */ Y(Pe, {
|
|
1651
|
+
layout: k,
|
|
1653
1652
|
kind: "toolbar",
|
|
1654
|
-
entityActions:
|
|
1655
|
-
onRun:
|
|
1656
|
-
widgetContext:
|
|
1653
|
+
entityActions: C,
|
|
1654
|
+
onRun: ee,
|
|
1655
|
+
widgetContext: m,
|
|
1657
1656
|
ariaLabel: "List toolbar actions"
|
|
1658
1657
|
})
|
|
1659
1658
|
]
|
|
@@ -1661,12 +1660,12 @@ function bn({ title: t, description: n, toolbarActions: r, screenActionLayout: i
|
|
|
1661
1660
|
}
|
|
1662
1661
|
//#endregion
|
|
1663
1662
|
//#region src/components/pages/list/ListFloatbar.tsx
|
|
1664
|
-
function
|
|
1665
|
-
let { run: m } =
|
|
1663
|
+
function vn({ selectedIds: t, floatbarActions: n, screenActionLayout: r, entityActionLayout: i, data: a, rowKey: o, entityCode: s, entity: l, screen: u, onClear: d, onActionSuccess: f, widgetContext: p }) {
|
|
1664
|
+
let { run: m } = N(), h = G(() => {
|
|
1666
1665
|
let e = {};
|
|
1667
1666
|
for (let { code: t, action: r } of n) e[t] = r;
|
|
1668
1667
|
return e;
|
|
1669
|
-
}, [n]), g =
|
|
1668
|
+
}, [n]), g = G(() => {
|
|
1670
1669
|
if (t.length === 0) return [];
|
|
1671
1670
|
let e = /* @__PURE__ */ new Map();
|
|
1672
1671
|
for (let t of a) e.set(o(t), t);
|
|
@@ -1675,26 +1674,26 @@ function xn({ selectedIds: t, floatbarActions: n, screenActionLayout: r, entityA
|
|
|
1675
1674
|
t,
|
|
1676
1675
|
a,
|
|
1677
1676
|
o
|
|
1678
|
-
]),
|
|
1677
|
+
]), _ = G(() => {
|
|
1679
1678
|
if (!l || !u || g.length === 0) return r;
|
|
1680
|
-
let e = g.map((e) =>
|
|
1681
|
-
return e.some((t) => t !== e[0]) ? r :
|
|
1679
|
+
let e = g.map((e) => Ne(l, u, e));
|
|
1680
|
+
return e.some((t) => t !== e[0]) ? r : He(l, u, g[0])?.action_layout;
|
|
1682
1681
|
}, [
|
|
1683
1682
|
l,
|
|
1684
1683
|
u,
|
|
1685
1684
|
g,
|
|
1686
1685
|
r
|
|
1687
|
-
]),
|
|
1688
|
-
|
|
1686
|
+
]), v = G(() => de((_ ?? i) || w(h, "list_floatbar"), h, void 0, "list_floatbar"), [
|
|
1687
|
+
_,
|
|
1689
1688
|
i,
|
|
1690
1689
|
h
|
|
1691
|
-
]),
|
|
1692
|
-
|
|
1690
|
+
]), y = G(() => b(v, h, void 0, {}, g, ze(l, g)), [
|
|
1691
|
+
v,
|
|
1693
1692
|
h,
|
|
1694
1693
|
g,
|
|
1695
1694
|
l
|
|
1696
1695
|
]);
|
|
1697
|
-
return
|
|
1696
|
+
return y.length === 0 ? null : /* @__PURE__ */ X("div", {
|
|
1698
1697
|
style: {
|
|
1699
1698
|
position: "fixed",
|
|
1700
1699
|
left: "50%",
|
|
@@ -1715,13 +1714,13 @@ function xn({ selectedIds: t, floatbarActions: n, screenActionLayout: r, entityA
|
|
|
1715
1714
|
animation: "floatbarIn .15s ease-out"
|
|
1716
1715
|
},
|
|
1717
1716
|
children: [
|
|
1718
|
-
/* @__PURE__ */
|
|
1719
|
-
/* @__PURE__ */
|
|
1717
|
+
/* @__PURE__ */ Y("style", { children: "@keyframes floatbarIn{from{transform:translateX(-50%) translateY(8px);opacity:0}to{transform:translateX(-50%) translateY(0);opacity:1}}" }),
|
|
1718
|
+
/* @__PURE__ */ X("span", {
|
|
1720
1719
|
style: {
|
|
1721
1720
|
fontSize: 12.5,
|
|
1722
1721
|
fontWeight: 600
|
|
1723
1722
|
},
|
|
1724
|
-
children: [/* @__PURE__ */
|
|
1723
|
+
children: [/* @__PURE__ */ Y("span", {
|
|
1725
1724
|
style: {
|
|
1726
1725
|
padding: "1px 7px",
|
|
1727
1726
|
borderRadius: 4,
|
|
@@ -1733,20 +1732,20 @@ function xn({ selectedIds: t, floatbarActions: n, screenActionLayout: r, entityA
|
|
|
1733
1732
|
children: t.length
|
|
1734
1733
|
}), "selected"]
|
|
1735
1734
|
}),
|
|
1736
|
-
/* @__PURE__ */
|
|
1737
|
-
layout:
|
|
1735
|
+
/* @__PURE__ */ Y(Pe, {
|
|
1736
|
+
layout: y,
|
|
1738
1737
|
kind: "toolbar",
|
|
1739
1738
|
entityActions: h,
|
|
1740
1739
|
rowSelection: g,
|
|
1741
1740
|
onRun: (e, n) => {
|
|
1742
|
-
let r =
|
|
1741
|
+
let r = Ue(e, n, {}, s);
|
|
1743
1742
|
if (r !== null) return m({
|
|
1744
1743
|
action: n,
|
|
1745
|
-
title:
|
|
1744
|
+
title: j(n.display?.name) || e,
|
|
1746
1745
|
bulkSelection: g,
|
|
1747
|
-
entity:
|
|
1746
|
+
entity: s,
|
|
1748
1747
|
execute: async (e) => {
|
|
1749
|
-
let n = await
|
|
1748
|
+
let n = await A(r, c(e, t));
|
|
1750
1749
|
return f(), n;
|
|
1751
1750
|
}
|
|
1752
1751
|
});
|
|
@@ -1755,7 +1754,7 @@ function xn({ selectedIds: t, floatbarActions: n, screenActionLayout: r, entityA
|
|
|
1755
1754
|
ariaLabel: "Floating action bar",
|
|
1756
1755
|
constrain: !1
|
|
1757
1756
|
}),
|
|
1758
|
-
/* @__PURE__ */
|
|
1757
|
+
/* @__PURE__ */ Y("button", {
|
|
1759
1758
|
onClick: d,
|
|
1760
1759
|
style: {
|
|
1761
1760
|
background: "none",
|
|
@@ -1767,20 +1766,20 @@ function xn({ selectedIds: t, floatbarActions: n, screenActionLayout: r, entityA
|
|
|
1767
1766
|
borderRadius: 6
|
|
1768
1767
|
},
|
|
1769
1768
|
title: "Clear selection",
|
|
1770
|
-
children: /* @__PURE__ */
|
|
1769
|
+
children: /* @__PURE__ */ Y(e.x, { size: 14 })
|
|
1771
1770
|
})
|
|
1772
1771
|
]
|
|
1773
1772
|
});
|
|
1774
1773
|
}
|
|
1775
1774
|
//#endregion
|
|
1776
1775
|
//#region src/components/pages/list/useRowMenu.ts
|
|
1777
|
-
function
|
|
1776
|
+
function yn(e, t) {
|
|
1778
1777
|
let n = (e) => e === "__peek" && !t.peek || e === "__open" && !t.open, r = [];
|
|
1779
1778
|
for (let i of e) if (i.kind === "action") {
|
|
1780
1779
|
if (n(i.code)) continue;
|
|
1781
1780
|
r.push(i);
|
|
1782
1781
|
} else {
|
|
1783
|
-
let e =
|
|
1782
|
+
let e = yn(i.items, t);
|
|
1784
1783
|
e.length > 0 && r.push({
|
|
1785
1784
|
...i,
|
|
1786
1785
|
items: e
|
|
@@ -1788,99 +1787,99 @@ function X(e, t) {
|
|
|
1788
1787
|
}
|
|
1789
1788
|
return r;
|
|
1790
1789
|
}
|
|
1791
|
-
function
|
|
1790
|
+
function bn(e, t) {
|
|
1792
1791
|
for (let n of e) if (n.kind === "action") {
|
|
1793
1792
|
if (n.code === t) return !0;
|
|
1794
|
-
} else if (
|
|
1793
|
+
} else if (bn(n.items, t)) return !0;
|
|
1795
1794
|
return !1;
|
|
1796
1795
|
}
|
|
1797
|
-
function
|
|
1798
|
-
let { run:
|
|
1799
|
-
...
|
|
1800
|
-
detail_screen:
|
|
1801
|
-
} :
|
|
1802
|
-
let e = {}, t =
|
|
1803
|
-
for (let { code: n, action: r } of
|
|
1796
|
+
function xn({ row: e, rowId: n, screen: r, fullScreen: i, entity: a, entityCode: o, rowActions: s, tabNavigate: l, locale: u, peekAllowed: d, hasDetailTarget: f, onPeek: p }) {
|
|
1797
|
+
let { run: m } = N(), h = i.detail_screen === void 0 && r.detail_screen !== void 0 ? {
|
|
1798
|
+
...i,
|
|
1799
|
+
detail_screen: r.detail_screen
|
|
1800
|
+
} : i, g = He(a, h, e) ?? h, _ = G(() => {
|
|
1801
|
+
let e = {}, t = g.row_actions === void 0 ? void 0 : new Set(g.row_actions);
|
|
1802
|
+
for (let { code: n, action: r } of s) (!t || t.has(n)) && (e[n] = r);
|
|
1804
1803
|
return e;
|
|
1805
|
-
}, [
|
|
1806
|
-
entity:
|
|
1807
|
-
entityCode:
|
|
1808
|
-
screen:
|
|
1809
|
-
screenRoute:
|
|
1804
|
+
}, [s, g.row_actions]), v = G(() => ({
|
|
1805
|
+
entity: a,
|
|
1806
|
+
entityCode: o ?? "",
|
|
1807
|
+
screen: g,
|
|
1808
|
+
screenRoute: g.route,
|
|
1810
1809
|
selectedRows: [],
|
|
1811
1810
|
selectedIds: [],
|
|
1812
|
-
locale:
|
|
1813
|
-
tabNavigate: (e, t) =>
|
|
1811
|
+
locale: u,
|
|
1812
|
+
tabNavigate: (e, t) => l(e, {
|
|
1814
1813
|
title: t?.title,
|
|
1815
1814
|
icon: t?.icon,
|
|
1816
1815
|
search: t?.search
|
|
1817
1816
|
}),
|
|
1818
|
-
runActionApi: (e, t) =>
|
|
1819
|
-
openPeek: (t) =>
|
|
1817
|
+
runActionApi: (e, t) => A(e, t),
|
|
1818
|
+
openPeek: (t) => p(t ?? e)
|
|
1820
1819
|
}), [
|
|
1821
|
-
i,
|
|
1822
1820
|
a,
|
|
1823
|
-
|
|
1821
|
+
o,
|
|
1822
|
+
g,
|
|
1823
|
+
u,
|
|
1824
1824
|
l,
|
|
1825
|
-
|
|
1826
|
-
f,
|
|
1825
|
+
p,
|
|
1827
1826
|
e
|
|
1828
|
-
]), y =
|
|
1829
|
-
let e =
|
|
1830
|
-
return
|
|
1827
|
+
]), y = G(() => {
|
|
1828
|
+
let e = g.action_layout ?? null, t = a.action_layout ?? null, n = e ?? t ?? w(_, "list_row");
|
|
1829
|
+
return de(n, _, void 0, "list_row");
|
|
1831
1830
|
}, [
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
]), x =
|
|
1836
|
-
peek:
|
|
1837
|
-
open:
|
|
1831
|
+
g,
|
|
1832
|
+
a,
|
|
1833
|
+
_
|
|
1834
|
+
]), x = G(() => yn(b(y, _, void 0, e, [], Be(a, e)), {
|
|
1835
|
+
peek: d,
|
|
1836
|
+
open: f
|
|
1838
1837
|
}), [
|
|
1839
1838
|
y,
|
|
1840
|
-
|
|
1839
|
+
_,
|
|
1841
1840
|
e,
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1841
|
+
a,
|
|
1842
|
+
d,
|
|
1843
|
+
f
|
|
1845
1844
|
]);
|
|
1846
1845
|
return {
|
|
1847
1846
|
layout: x,
|
|
1848
|
-
entityActions:
|
|
1849
|
-
runRowAction:
|
|
1850
|
-
let i =
|
|
1851
|
-
if (i !== null) return
|
|
1847
|
+
entityActions: _,
|
|
1848
|
+
runRowAction: U((t, r) => {
|
|
1849
|
+
let i = Ue(t, r, { row: e });
|
|
1850
|
+
if (i !== null) return m({
|
|
1852
1851
|
action: r,
|
|
1853
|
-
title:
|
|
1852
|
+
title: j(r.display?.name) || t,
|
|
1854
1853
|
row: e,
|
|
1855
|
-
execute: (e) =>
|
|
1854
|
+
execute: (e) => A(i, c(e, [n]))
|
|
1856
1855
|
});
|
|
1857
1856
|
}, [
|
|
1858
|
-
|
|
1859
|
-
|
|
1857
|
+
m,
|
|
1858
|
+
n,
|
|
1860
1859
|
e
|
|
1861
1860
|
]),
|
|
1862
1861
|
widgetContext: v,
|
|
1863
|
-
hasPeek:
|
|
1862
|
+
hasPeek: G(() => bn(x, t), [x])
|
|
1864
1863
|
};
|
|
1865
1864
|
}
|
|
1866
1865
|
//#endregion
|
|
1867
1866
|
//#region src/components/pages/list/RowActionsCell.tsx
|
|
1868
|
-
function
|
|
1869
|
-
let { layout:
|
|
1867
|
+
function Sn({ row: t, rowId: n, screen: r, fullScreen: i, entity: a, entityCode: s, rowActions: c, tabNavigate: l, peekAllowed: u, hasDetailTarget: d, onPeek: f, locale: p }) {
|
|
1868
|
+
let { layout: m, entityActions: h, runRowAction: g, widgetContext: _, hasPeek: v } = xn({
|
|
1870
1869
|
row: t,
|
|
1871
1870
|
rowId: n,
|
|
1872
1871
|
screen: r,
|
|
1873
1872
|
fullScreen: i,
|
|
1874
1873
|
entity: a,
|
|
1875
|
-
entityCode:
|
|
1876
|
-
rowActions:
|
|
1877
|
-
tabNavigate:
|
|
1878
|
-
locale:
|
|
1879
|
-
peekAllowed:
|
|
1880
|
-
hasDetailTarget:
|
|
1881
|
-
onPeek:
|
|
1874
|
+
entityCode: s,
|
|
1875
|
+
rowActions: c,
|
|
1876
|
+
tabNavigate: l,
|
|
1877
|
+
locale: p,
|
|
1878
|
+
peekAllowed: u,
|
|
1879
|
+
hasDetailTarget: d,
|
|
1880
|
+
onPeek: f
|
|
1882
1881
|
});
|
|
1883
|
-
return /* @__PURE__ */
|
|
1882
|
+
return /* @__PURE__ */ X("div", {
|
|
1884
1883
|
className: "sl-row-actions",
|
|
1885
1884
|
style: {
|
|
1886
1885
|
display: "flex",
|
|
@@ -1888,56 +1887,56 @@ function wn({ row: t, rowId: n, screen: r, fullScreen: i, entity: a, entityCode:
|
|
|
1888
1887
|
gap: 2,
|
|
1889
1888
|
justifyContent: "flex-end"
|
|
1890
1889
|
},
|
|
1891
|
-
children: [
|
|
1890
|
+
children: [v && /* @__PURE__ */ Y(o, {
|
|
1892
1891
|
size: 22,
|
|
1893
|
-
icon: /* @__PURE__ */
|
|
1892
|
+
icon: /* @__PURE__ */ Y(e.eye, { size: 12 }),
|
|
1894
1893
|
onClick: (e) => {
|
|
1895
|
-
e.stopPropagation(),
|
|
1894
|
+
e.stopPropagation(), f(t);
|
|
1896
1895
|
},
|
|
1897
1896
|
title: "Peek"
|
|
1898
|
-
}),
|
|
1899
|
-
layout:
|
|
1897
|
+
}), m.length > 0 && /* @__PURE__ */ Y(Pe, {
|
|
1898
|
+
layout: m,
|
|
1900
1899
|
row: t,
|
|
1901
1900
|
kind: "row",
|
|
1902
|
-
entityActions:
|
|
1903
|
-
onRun:
|
|
1904
|
-
widgetContext:
|
|
1901
|
+
entityActions: h,
|
|
1902
|
+
onRun: g,
|
|
1903
|
+
widgetContext: _,
|
|
1905
1904
|
ariaLabel: "Row actions"
|
|
1906
1905
|
})]
|
|
1907
1906
|
});
|
|
1908
1907
|
}
|
|
1909
1908
|
//#endregion
|
|
1910
1909
|
//#region src/components/pages/list/columns.ts
|
|
1911
|
-
function
|
|
1912
|
-
let a =
|
|
1913
|
-
if (!a || a.read !== "denied") return i ?
|
|
1910
|
+
function Cn(t, n, r, i) {
|
|
1911
|
+
let a = ke(n, r);
|
|
1912
|
+
if (!a || a.read !== "denied") return i ? V("span", { title: i }, t) : t;
|
|
1914
1913
|
let o = a.required_permission ? `Locked column: requires "${a.required_permission}"` : `Locked column: ${a.classification} classification`;
|
|
1915
|
-
return
|
|
1914
|
+
return V("span", {
|
|
1916
1915
|
title: o,
|
|
1917
1916
|
"aria-label": o,
|
|
1918
1917
|
className: "inline-flex items-center gap-1"
|
|
1919
|
-
},
|
|
1918
|
+
}, V(e.lock, { size: 12 }), t);
|
|
1920
1919
|
}
|
|
1921
|
-
function
|
|
1920
|
+
function Q(e) {
|
|
1922
1921
|
return {
|
|
1923
1922
|
minSize: Math.min(60, e),
|
|
1924
|
-
maxSize: Math.max(
|
|
1923
|
+
maxSize: Math.max(Me, e)
|
|
1925
1924
|
};
|
|
1926
1925
|
}
|
|
1927
|
-
function
|
|
1928
|
-
let { visibleCols: t, entity: n, screen: r, schema: i, entityCode: a, rowActions: o, hasBatchActions:
|
|
1926
|
+
function wn(e) {
|
|
1927
|
+
let { visibleCols: t, entity: n, screen: r, schema: i, entityCode: a, rowActions: o, hasBatchActions: s, hasExplicitRowActions: c, canUpdate: l, canDelete: u, peekEnabled: d, hasDetailTarget: f, userLocale: m, tabNavigate: h, refsRef: g, rowSelectionKey: _, setPeekRow: y } = e;
|
|
1929
1928
|
if (t.length === 0 || !n) return [];
|
|
1930
1929
|
let b = [];
|
|
1931
|
-
|
|
1930
|
+
s && b.push({
|
|
1932
1931
|
id: "_select",
|
|
1933
1932
|
enableResizing: !1,
|
|
1934
|
-
header: ({ table: e }) =>
|
|
1933
|
+
header: ({ table: e }) => V(Se, {
|
|
1935
1934
|
checked: e.getIsAllRowsSelected(),
|
|
1936
1935
|
indeterminate: e.getIsSomeRowsSelected(),
|
|
1937
1936
|
onChange: () => e.toggleAllRowsSelected()
|
|
1938
1937
|
}),
|
|
1939
1938
|
size: 34,
|
|
1940
|
-
cell: ({ row: e }) =>
|
|
1939
|
+
cell: ({ row: e }) => V("span", { "data-testid": "row-select-checkbox" }, V(Se, {
|
|
1941
1940
|
checked: e.getIsSelected(),
|
|
1942
1941
|
onChange: () => e.toggleSelected()
|
|
1943
1942
|
}))
|
|
@@ -1949,17 +1948,17 @@ function En(e) {
|
|
|
1949
1948
|
let i = new Map(r.statuses.map((e) => [e.code, e]));
|
|
1950
1949
|
b.push({
|
|
1951
1950
|
id: e,
|
|
1952
|
-
header:
|
|
1951
|
+
header: j(r.name) || t,
|
|
1953
1952
|
size: 140,
|
|
1954
|
-
...
|
|
1953
|
+
...Q(140),
|
|
1955
1954
|
cell: ({ row: e }) => {
|
|
1956
1955
|
let n = e.original.$statuses?.find((e) => e.group_code === t);
|
|
1957
|
-
if (!n) return
|
|
1956
|
+
if (!n) return V("span", { className: "text-sm text-muted-foreground" }, "-");
|
|
1958
1957
|
let r = i.get(n.status_code);
|
|
1959
|
-
return
|
|
1958
|
+
return V(v, {
|
|
1960
1959
|
tone: r?.color ?? "slate",
|
|
1961
1960
|
size: "xs"
|
|
1962
|
-
},
|
|
1961
|
+
}, j(r?.name) || n.status_code);
|
|
1963
1962
|
}
|
|
1964
1963
|
});
|
|
1965
1964
|
continue;
|
|
@@ -1969,13 +1968,13 @@ function En(e) {
|
|
|
1969
1968
|
if (!r) continue;
|
|
1970
1969
|
b.push({
|
|
1971
1970
|
id: e,
|
|
1972
|
-
header: () =>
|
|
1971
|
+
header: () => Cn(j(r.name) || t, n, t, j(r.description) || void 0),
|
|
1973
1972
|
size: 150,
|
|
1974
|
-
...
|
|
1973
|
+
...Q(150),
|
|
1975
1974
|
enableSorting: !1,
|
|
1976
1975
|
cell: ({ row: e }) => {
|
|
1977
1976
|
let n = e.original.$properties?.find((e) => e.property_code === t);
|
|
1978
|
-
return !n || n.value == null ?
|
|
1977
|
+
return !n || n.value == null ? V("span", { className: "text-sm text-muted-foreground" }, "-") : V("span", { className: "text-sm" }, F(n.value));
|
|
1979
1978
|
}
|
|
1980
1979
|
});
|
|
1981
1980
|
continue;
|
|
@@ -1985,15 +1984,15 @@ function En(e) {
|
|
|
1985
1984
|
id: e,
|
|
1986
1985
|
header: "Evidence",
|
|
1987
1986
|
size: 140,
|
|
1988
|
-
...
|
|
1987
|
+
...Q(140),
|
|
1989
1988
|
enableSorting: !1,
|
|
1990
1989
|
cell: ({ row: e }) => {
|
|
1991
1990
|
let t = e.original.$evidence?.verdict ?? "unverified";
|
|
1992
|
-
return
|
|
1993
|
-
tone:
|
|
1991
|
+
return V(v, {
|
|
1992
|
+
tone: lt(t),
|
|
1994
1993
|
size: "xs",
|
|
1995
1994
|
dot: !0
|
|
1996
|
-
},
|
|
1995
|
+
}, dt(t));
|
|
1997
1996
|
}
|
|
1998
1997
|
});
|
|
1999
1998
|
continue;
|
|
@@ -2002,69 +2001,69 @@ function En(e) {
|
|
|
2002
2001
|
b.push({
|
|
2003
2002
|
id: e,
|
|
2004
2003
|
accessorFn: (t) => t.$files?.[e] ?? null,
|
|
2005
|
-
header: () =>
|
|
2004
|
+
header: () => Cn(Re(n, e, i?.entities), n, e),
|
|
2006
2005
|
size: 150,
|
|
2007
|
-
...
|
|
2008
|
-
cell: ({ row: t }) =>
|
|
2006
|
+
...Q(150),
|
|
2007
|
+
cell: ({ row: t }) => Ve({
|
|
2009
2008
|
entity: n,
|
|
2010
2009
|
entityCode: a,
|
|
2011
2010
|
fieldName: e,
|
|
2012
2011
|
record: t.original,
|
|
2013
2012
|
mode: "display",
|
|
2014
2013
|
surface: "list",
|
|
2015
|
-
refs:
|
|
2016
|
-
locale:
|
|
2014
|
+
refs: g.current,
|
|
2015
|
+
locale: m
|
|
2017
2016
|
})
|
|
2018
2017
|
});
|
|
2019
2018
|
continue;
|
|
2020
2019
|
}
|
|
2021
2020
|
let t = n.fields.get(e);
|
|
2022
2021
|
if (!t) continue;
|
|
2023
|
-
let r =
|
|
2022
|
+
let r = p(t, e, i?.entities), o = t.display?.width, s = ae({
|
|
2024
2023
|
field: t,
|
|
2025
2024
|
fieldName: e,
|
|
2026
2025
|
surface: "list",
|
|
2027
2026
|
entity: n,
|
|
2028
2027
|
entities: i?.entities,
|
|
2029
2028
|
screens: i?.screens,
|
|
2030
|
-
refs: () =>
|
|
2031
|
-
locale:
|
|
2029
|
+
refs: () => g.current,
|
|
2030
|
+
locale: m
|
|
2032
2031
|
});
|
|
2033
2032
|
b.push({
|
|
2034
2033
|
id: e,
|
|
2035
2034
|
accessorKey: e,
|
|
2036
|
-
header: () =>
|
|
2035
|
+
header: () => Cn(r, n, e, j(t.display?.description) || void 0),
|
|
2037
2036
|
enableSorting: t.type !== "json",
|
|
2038
2037
|
size: o ?? 150,
|
|
2039
|
-
...
|
|
2040
|
-
cell: ({ getValue: e, row: t }) =>
|
|
2038
|
+
...Q(o ?? 150),
|
|
2039
|
+
cell: ({ getValue: e, row: t }) => s(e(), t.original)
|
|
2041
2040
|
});
|
|
2042
2041
|
}
|
|
2043
|
-
return (!
|
|
2042
|
+
return (!c && l || !c && u || o.length > 0) && b.push({
|
|
2044
2043
|
id: "_actions",
|
|
2045
2044
|
enableResizing: !1,
|
|
2046
2045
|
header: "",
|
|
2047
2046
|
size: 40,
|
|
2048
|
-
cell: ({ row: e }) =>
|
|
2047
|
+
cell: ({ row: e }) => V(Sn, {
|
|
2049
2048
|
row: e.original,
|
|
2050
|
-
rowId:
|
|
2049
|
+
rowId: _(n, e.original),
|
|
2051
2050
|
screen: r,
|
|
2052
2051
|
fullScreen: r,
|
|
2053
2052
|
entity: n,
|
|
2054
2053
|
entityCode: a,
|
|
2055
2054
|
rowActions: o,
|
|
2056
|
-
tabNavigate:
|
|
2057
|
-
peekAllowed:
|
|
2058
|
-
hasDetailTarget:
|
|
2055
|
+
tabNavigate: h,
|
|
2056
|
+
peekAllowed: d,
|
|
2057
|
+
hasDetailTarget: f,
|
|
2059
2058
|
onPeek: y,
|
|
2060
|
-
locale:
|
|
2059
|
+
locale: m
|
|
2061
2060
|
})
|
|
2062
2061
|
}), b;
|
|
2063
2062
|
}
|
|
2064
2063
|
//#endregion
|
|
2065
2064
|
//#region src/components/pages/list/RowContextMenu.tsx
|
|
2066
|
-
function
|
|
2067
|
-
let { layout:
|
|
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: f, onPeek: p, onClose: m }) {
|
|
2066
|
+
let { layout: g, entityActions: _, runRowAction: v, widgetContext: y } = xn({
|
|
2068
2067
|
row: n,
|
|
2069
2068
|
rowId: r,
|
|
2070
2069
|
screen: i,
|
|
@@ -2077,8 +2076,8 @@ function Dn({ x: e, y: t, row: n, rowId: r, screen: i, fullScreen: a, entity: o,
|
|
|
2077
2076
|
peekAllowed: d,
|
|
2078
2077
|
hasDetailTarget: f,
|
|
2079
2078
|
onPeek: p
|
|
2080
|
-
}), [
|
|
2081
|
-
return
|
|
2079
|
+
}), [b, x] = q(null), S = U((e, t) => (m(), v(e, t)), [m, v]);
|
|
2080
|
+
return g.length === 0 ? null : /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y("div", {
|
|
2082
2081
|
onClick: m,
|
|
2083
2082
|
onContextMenu: (e) => {
|
|
2084
2083
|
e.preventDefault(), m();
|
|
@@ -2088,7 +2087,7 @@ function Dn({ x: e, y: t, row: n, rowId: r, screen: i, fullScreen: a, entity: o,
|
|
|
2088
2087
|
inset: 0,
|
|
2089
2088
|
zIndex: 190
|
|
2090
2089
|
}
|
|
2091
|
-
}), /* @__PURE__ */
|
|
2090
|
+
}), /* @__PURE__ */ Y(h, {
|
|
2092
2091
|
open: !0,
|
|
2093
2092
|
anchor: null,
|
|
2094
2093
|
anchorPoint: {
|
|
@@ -2097,57 +2096,57 @@ function Dn({ x: e, y: t, row: n, rowId: r, screen: i, fullScreen: a, entity: o,
|
|
|
2097
2096
|
},
|
|
2098
2097
|
onClose: m,
|
|
2099
2098
|
width: 220,
|
|
2100
|
-
children: /* @__PURE__ */
|
|
2099
|
+
children: /* @__PURE__ */ Y("div", {
|
|
2101
2100
|
onClick: m,
|
|
2102
|
-
children: /* @__PURE__ */
|
|
2103
|
-
layout:
|
|
2104
|
-
entityActions:
|
|
2101
|
+
children: /* @__PURE__ */ Y(Le, {
|
|
2102
|
+
layout: g,
|
|
2103
|
+
entityActions: _,
|
|
2105
2104
|
onRun: S,
|
|
2106
|
-
loading:
|
|
2107
|
-
onLoadingChange:
|
|
2105
|
+
loading: b,
|
|
2106
|
+
onLoadingChange: x,
|
|
2108
2107
|
row: n,
|
|
2109
|
-
widgetContext:
|
|
2108
|
+
widgetContext: y
|
|
2110
2109
|
})
|
|
2111
2110
|
})
|
|
2112
2111
|
})] });
|
|
2113
2112
|
}
|
|
2114
2113
|
//#endregion
|
|
2115
2114
|
//#region src/components/pages/list/useHeaderReorder.ts
|
|
2116
|
-
var
|
|
2117
|
-
function
|
|
2118
|
-
let [i, a] =
|
|
2115
|
+
var En = 5, $ = 48, Dn = 18;
|
|
2116
|
+
function On({ visibleCols: e, onReorder: t, scrollElRef: n, theadRef: r }) {
|
|
2117
|
+
let [i, a] = q(null), [o, s] = q(null), [c, l] = q(!1), u = K(null), d = K(!1), f = K(!1), p = K([]), m = K(null), h = K(0), g = K(null), _ = K(0), v = U(() => {
|
|
2119
2118
|
g.current !== null && (cancelAnimationFrame(g.current), g.current = null);
|
|
2120
|
-
}, []), y =
|
|
2119
|
+
}, []), y = U(() => {
|
|
2121
2120
|
u.current = null, d.current = !1, p.current = [], m.current = null, v(), a(null), s(null), l(!1);
|
|
2122
|
-
}, [v]), b =
|
|
2121
|
+
}, [v]), b = U((e) => {
|
|
2123
2122
|
let t = p.current, r = e + ((n.current?.scrollLeft ?? 0) - _.current);
|
|
2124
2123
|
for (let e = 0; e < t.length; e++) if (r < (t[e].left + t[e].right) / 2) return e;
|
|
2125
2124
|
return t.length;
|
|
2126
|
-
}, [n]), x =
|
|
2125
|
+
}, [n]), x = U(() => {
|
|
2127
2126
|
let e = n.current;
|
|
2128
2127
|
if (!d.current || !e) {
|
|
2129
2128
|
g.current = null;
|
|
2130
2129
|
return;
|
|
2131
2130
|
}
|
|
2132
2131
|
let t = e.getBoundingClientRect(), r = h.current, i = 0;
|
|
2133
|
-
if (r < t.left +
|
|
2132
|
+
if (r < t.left + $ ? i = -Math.ceil((t.left + $ - r) / $ * Dn) : r > t.right - $ && (i = Math.ceil((r - (t.right - $)) / $ * Dn)), i !== 0) {
|
|
2134
2133
|
e.scrollLeft += i;
|
|
2135
2134
|
let t = b(h.current);
|
|
2136
2135
|
m.current = t, s(t);
|
|
2137
2136
|
}
|
|
2138
2137
|
g.current = requestAnimationFrame(x);
|
|
2139
|
-
}, [n, b]), S =
|
|
2138
|
+
}, [n, b]), S = U((e, t) => {
|
|
2140
2139
|
t.button === 0 && (u.current = {
|
|
2141
2140
|
colId: e,
|
|
2142
2141
|
x: t.clientX
|
|
2143
2142
|
}, d.current = !1, f.current = !1);
|
|
2144
|
-
}, []), C =
|
|
2145
|
-
return
|
|
2143
|
+
}, []), C = U(() => f.current ? (f.current = !1, !0) : !1, []);
|
|
2144
|
+
return W(() => {
|
|
2146
2145
|
let i = (t) => {
|
|
2147
2146
|
let i = u.current;
|
|
2148
2147
|
if (!i) return;
|
|
2149
2148
|
if (h.current = t.clientX, !d.current) {
|
|
2150
|
-
if (Math.abs(t.clientX - i.x) <
|
|
2149
|
+
if (Math.abs(t.clientX - i.x) < En) return;
|
|
2151
2150
|
let o = r.current, s = [];
|
|
2152
2151
|
if (o) for (let t of e) {
|
|
2153
2152
|
let e = o.querySelector(`[data-col-id="${CSS.escape(t)}"]`);
|
|
@@ -2194,7 +2193,7 @@ function kn({ visibleCols: e, onReorder: t, scrollElRef: n, theadRef: r }) {
|
|
|
2194
2193
|
b,
|
|
2195
2194
|
x,
|
|
2196
2195
|
y
|
|
2197
|
-
]),
|
|
2196
|
+
]), W(() => y, [y]), {
|
|
2198
2197
|
dragColId: i,
|
|
2199
2198
|
dropIndex: o,
|
|
2200
2199
|
isDragging: c,
|
|
@@ -2204,331 +2203,331 @@ function kn({ visibleCols: e, onReorder: t, scrollElRef: n, theadRef: r }) {
|
|
|
2204
2203
|
}
|
|
2205
2204
|
//#endregion
|
|
2206
2205
|
//#region src/components/pages/SmartListPage.impl.tsx
|
|
2207
|
-
var
|
|
2208
|
-
function
|
|
2209
|
-
return /* @__PURE__ */
|
|
2206
|
+
var kn = gt(() => import("./ListCardsBody-dRnXsQ7A.js").then((e) => ({ default: e.ListCardsBody })));
|
|
2207
|
+
function An({ screenCode: e }) {
|
|
2208
|
+
return /* @__PURE__ */ Y(te, { children: /* @__PURE__ */ Y(jn, { screenCode: e }) });
|
|
2210
2209
|
}
|
|
2211
|
-
function
|
|
2212
|
-
let t =
|
|
2213
|
-
|
|
2214
|
-
|
|
2210
|
+
function jn({ screenCode: e }) {
|
|
2211
|
+
let t = Te(), [n, i] = _t(), { data: a } = ee(), o = ce(), [s, c] = q(!1), [l, h] = q(!1), { filters: g, filterError: _, activeCount: v, setFilters: y, clearFilters: b } = nt(), x = le((e) => e.user), S = le((e) => e.activeTenant), w = pe(), T = a?.screens[e], D = T?.entity ? a?.entities[T.entity] : void 0, O = T?.entity, k = m(D, "create"), te = m(D, "update"), ne = m(D, "delete"), M = a?.actions, ie = G(() => f(E(D?.actions, T?.actions, "list_toolbar", M), D), [
|
|
2212
|
+
D,
|
|
2213
|
+
T?.actions,
|
|
2215
2214
|
M
|
|
2216
|
-
]), N =
|
|
2215
|
+
]), N = G(() => f(E(D?.actions, void 0, "list_floatbar", M), D), [D, M]), P = G(() => {
|
|
2217
2216
|
let e = /* @__PURE__ */ new Map(), t = (t) => {
|
|
2218
|
-
for (let n of
|
|
2217
|
+
for (let n of E(D?.actions, t, "list_row", M)) e.set(n.code, n);
|
|
2219
2218
|
};
|
|
2220
|
-
t(
|
|
2221
|
-
for (let e of
|
|
2222
|
-
return
|
|
2219
|
+
t(T?.row_actions);
|
|
2220
|
+
for (let e of T?.variants?.items() ?? []) e.row_actions !== void 0 && t(e.row_actions);
|
|
2221
|
+
return f([...e.values()], D);
|
|
2223
2222
|
}, [
|
|
2224
|
-
|
|
2225
|
-
|
|
2223
|
+
D,
|
|
2224
|
+
T,
|
|
2226
2225
|
M
|
|
2227
|
-
]),
|
|
2226
|
+
]), se = T?.row_actions !== void 0, ue = G(() => N.length > 0 || D?.export?.enabled !== !1 && T?.export?.enabled !== !1, [
|
|
2228
2227
|
N,
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
]),
|
|
2232
|
-
|
|
2233
|
-
let
|
|
2234
|
-
if (!
|
|
2235
|
-
let t =
|
|
2228
|
+
D?.export?.enabled,
|
|
2229
|
+
T?.export?.enabled
|
|
2230
|
+
]), de = !!D?.soft_delete, fe = de && (x?.permissions ?? []).some((e) => e === "feature:view_deleted" || e === "feature:*" || e === "*"), me = fe && n.get("include_deleted") === "true", I = u(), { openTab: he, updateTabSearch: ye, findTabByPathname: be } = we();
|
|
2231
|
+
st(T, D, n.toString()), ct(T?.route);
|
|
2232
|
+
let xe = U((e) => {
|
|
2233
|
+
if (!T?.route || !D || I.enabled) return;
|
|
2234
|
+
let t = be(T.route);
|
|
2236
2235
|
if (t) {
|
|
2237
|
-
|
|
2236
|
+
ye(t.id, e);
|
|
2238
2237
|
return;
|
|
2239
2238
|
}
|
|
2240
|
-
|
|
2241
|
-
pathname:
|
|
2239
|
+
he({
|
|
2240
|
+
pathname: T.route,
|
|
2242
2241
|
search: e,
|
|
2243
|
-
title:
|
|
2244
|
-
icon:
|
|
2242
|
+
title: j(T.display?.name) || j(D.display.name_plural),
|
|
2243
|
+
icon: T.display?.icon || D.display.icon,
|
|
2245
2244
|
closable: !0
|
|
2246
2245
|
});
|
|
2247
2246
|
}, [
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
]),
|
|
2255
|
-
let e = parseInt(
|
|
2247
|
+
T,
|
|
2248
|
+
D,
|
|
2249
|
+
I.enabled,
|
|
2250
|
+
be,
|
|
2251
|
+
ye,
|
|
2252
|
+
he
|
|
2253
|
+
]), Se = parseInt(n.get("page") ?? "1", 10), Ce = (() => {
|
|
2254
|
+
let e = parseInt(n.get("per_page") ?? "", 10);
|
|
2256
2255
|
return !Number.isFinite(e) || e <= 0 || e > 1e3 ? 200 : e;
|
|
2257
|
-
})(),
|
|
2258
|
-
searchParams:
|
|
2259
|
-
setSearchParams:
|
|
2260
|
-
screenSortDefault:
|
|
2261
|
-
commitScreenTabSearch:
|
|
2262
|
-
}), { cols:
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
]),
|
|
2256
|
+
})(), De = n.get("search") ?? "", Oe = Mt({
|
|
2257
|
+
searchParams: n,
|
|
2258
|
+
setSearchParams: i,
|
|
2259
|
+
screenSortDefault: T?.sort_default,
|
|
2260
|
+
commitScreenTabSearch: xe
|
|
2261
|
+
}), { cols: ke, nullsByField: je, forRequest: Me, tableSorting: Ne, write: Pe, applyColumn: Le, shiftClickColumn: Re, appendColumn: ze, clearColumn: Be, clearAll: Ve } = Oe, Ue = G(() => jt(T, D, a?.entities), [
|
|
2262
|
+
T,
|
|
2263
|
+
D,
|
|
2264
|
+
a?.entities
|
|
2265
|
+
]), qe = Lt({
|
|
2267
2266
|
screenCode: e,
|
|
2268
|
-
screen:
|
|
2269
|
-
searchParams:
|
|
2270
|
-
setSearchParams:
|
|
2271
|
-
}), { visible:
|
|
2267
|
+
screen: T,
|
|
2268
|
+
searchParams: n,
|
|
2269
|
+
setSearchParams: i
|
|
2270
|
+
}), { visible: L, sizing: Qe, setSizing: $e, apply: tt, commitResize: rt } = qe, it = fn({
|
|
2272
2271
|
screenCode: e,
|
|
2273
|
-
screen:
|
|
2274
|
-
searchParams:
|
|
2275
|
-
setSearchParams:
|
|
2276
|
-
userId:
|
|
2277
|
-
tenantId:
|
|
2278
|
-
filterError: !!
|
|
2279
|
-
filters:
|
|
2280
|
-
visibleColumns:
|
|
2281
|
-
sort:
|
|
2282
|
-
}), { active:
|
|
2283
|
-
let e =
|
|
2284
|
-
return e === "table" || e === "cards" ? e :
|
|
2285
|
-
}, [
|
|
2286
|
-
entity:
|
|
2287
|
-
screen:
|
|
2288
|
-
savedViewColumns:
|
|
2272
|
+
screen: T,
|
|
2273
|
+
searchParams: n,
|
|
2274
|
+
setSearchParams: i,
|
|
2275
|
+
userId: x?.id,
|
|
2276
|
+
tenantId: S?.id,
|
|
2277
|
+
filterError: !!_,
|
|
2278
|
+
filters: g,
|
|
2279
|
+
visibleColumns: L,
|
|
2280
|
+
sort: Me
|
|
2281
|
+
}), { active: R, saveAsNew: at, overwriteActive: lt, isSaving: ut } = it, dt = ge(De, 300), z = r(), B = G(() => {
|
|
2282
|
+
let e = T?.responsive?.[z.category]?.presentation;
|
|
2283
|
+
return e === "table" || e === "cards" ? e : z.category === "phone" ? "cards" : "table";
|
|
2284
|
+
}, [T?.responsive, z.category]), ft = G(() => Ye({
|
|
2285
|
+
entity: D,
|
|
2286
|
+
screen: T,
|
|
2287
|
+
savedViewColumns: R?.columns
|
|
2289
2288
|
}), [
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
]),
|
|
2294
|
-
entity:
|
|
2295
|
-
screen:
|
|
2296
|
-
presentation:
|
|
2297
|
-
visibleColumns:
|
|
2298
|
-
card:
|
|
2289
|
+
D,
|
|
2290
|
+
T,
|
|
2291
|
+
R?.columns
|
|
2292
|
+
]), V = G(() => Ke({
|
|
2293
|
+
entity: D,
|
|
2294
|
+
screen: T,
|
|
2295
|
+
presentation: B,
|
|
2296
|
+
visibleColumns: L,
|
|
2297
|
+
card: ft,
|
|
2299
2298
|
rowActions: P,
|
|
2300
|
-
toolbarActions:
|
|
2299
|
+
toolbarActions: ie,
|
|
2301
2300
|
bulkActions: N,
|
|
2302
|
-
sort:
|
|
2303
|
-
screens:
|
|
2301
|
+
sort: ke,
|
|
2302
|
+
screens: a?.screens
|
|
2304
2303
|
}), [
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2304
|
+
D,
|
|
2305
|
+
T,
|
|
2306
|
+
B,
|
|
2307
|
+
L,
|
|
2308
|
+
ft,
|
|
2310
2309
|
P,
|
|
2311
|
-
|
|
2310
|
+
ie,
|
|
2312
2311
|
N,
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
]),
|
|
2316
|
-
entity:
|
|
2317
|
-
entityCode:
|
|
2318
|
-
screen:
|
|
2312
|
+
ke,
|
|
2313
|
+
a?.screens
|
|
2314
|
+
]), gt = mt({
|
|
2315
|
+
entity: D,
|
|
2316
|
+
entityCode: O,
|
|
2317
|
+
screen: T,
|
|
2319
2318
|
screenCode: e,
|
|
2320
|
-
page:
|
|
2321
|
-
perPage:
|
|
2322
|
-
sortForRequest:
|
|
2323
|
-
debouncedSearch:
|
|
2324
|
-
filters:
|
|
2325
|
-
filterError: !!
|
|
2326
|
-
includeDeleted:
|
|
2327
|
-
expand:
|
|
2328
|
-
select:
|
|
2319
|
+
page: Se,
|
|
2320
|
+
perPage: Ce,
|
|
2321
|
+
sortForRequest: Me,
|
|
2322
|
+
debouncedSearch: dt,
|
|
2323
|
+
filters: g,
|
|
2324
|
+
filterError: !!_,
|
|
2325
|
+
includeDeleted: me,
|
|
2326
|
+
expand: V.expandFields,
|
|
2327
|
+
select: V.selectFields,
|
|
2329
2328
|
runCountQuery: !0,
|
|
2330
|
-
urlKey: `${
|
|
2331
|
-
}), { rows:
|
|
2332
|
-
|
|
2333
|
-
let
|
|
2329
|
+
urlKey: `${O ?? ""}|${n.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(D, H, xt), { state: Gt, setState: qt, ids: Jt, pkValues: Yt, rows: Xt, keyOf: Qt } = Wt, en = oe(D?.realtime, O ?? ""), rn = Ae(O ?? ""), an = K(yt);
|
|
2331
|
+
an.current = yt;
|
|
2332
|
+
let on = G(() => {
|
|
2334
2333
|
let e = /* @__PURE__ */ new Map();
|
|
2335
|
-
if (!
|
|
2336
|
-
for (let t of
|
|
2337
|
-
if (t.startsWith("$") ||
|
|
2338
|
-
let n =
|
|
2339
|
-
n && e.set(t,
|
|
2334
|
+
if (!D) return e;
|
|
2335
|
+
for (let t of Ge(D, T, R?.columns)) {
|
|
2336
|
+
if (t.startsWith("$") || D.files?.get(t)) continue;
|
|
2337
|
+
let n = D.fields.get(t);
|
|
2338
|
+
n && e.set(t, ae({
|
|
2340
2339
|
field: n,
|
|
2341
2340
|
fieldName: t,
|
|
2342
2341
|
surface: "list",
|
|
2343
|
-
entity:
|
|
2344
|
-
entities:
|
|
2345
|
-
screens:
|
|
2346
|
-
refs: () =>
|
|
2347
|
-
locale:
|
|
2342
|
+
entity: D,
|
|
2343
|
+
entities: a?.entities,
|
|
2344
|
+
screens: a?.screens,
|
|
2345
|
+
refs: () => an.current,
|
|
2346
|
+
locale: o
|
|
2348
2347
|
}));
|
|
2349
2348
|
}
|
|
2350
2349
|
return e;
|
|
2351
2350
|
}, [
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
]), { labelFor:
|
|
2360
|
-
entity:
|
|
2361
|
-
screen:
|
|
2362
|
-
screens:
|
|
2363
|
-
entities:
|
|
2364
|
-
searchParams:
|
|
2351
|
+
D,
|
|
2352
|
+
T,
|
|
2353
|
+
R?.columns,
|
|
2354
|
+
a?.entities,
|
|
2355
|
+
a?.screens,
|
|
2356
|
+
an,
|
|
2357
|
+
o
|
|
2358
|
+
]), { labelFor: sn, refs: cn } = mn(Ue, g, yt, a?.entities), un = Ht({
|
|
2359
|
+
entity: D,
|
|
2360
|
+
screen: T,
|
|
2361
|
+
screens: a?.screens,
|
|
2362
|
+
entities: a?.entities,
|
|
2363
|
+
searchParams: n,
|
|
2365
2364
|
tabNavigate: t,
|
|
2366
|
-
commitScreenTabSearch:
|
|
2367
|
-
isPhone:
|
|
2368
|
-
canUpdate:
|
|
2369
|
-
}), { peekAllowed:
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
]),
|
|
2374
|
-
visibleCols:
|
|
2375
|
-
entity:
|
|
2376
|
-
screen:
|
|
2377
|
-
schema:
|
|
2378
|
-
entityCode:
|
|
2365
|
+
commitScreenTabSearch: xe,
|
|
2366
|
+
isPhone: z.category === "phone",
|
|
2367
|
+
canUpdate: te
|
|
2368
|
+
}), { peekAllowed: dn, peekRow: Z, setPeekRow: hn, peekFields: yn, peekActions: bn, peekExecute: xn, contextMenu: Sn, setContextMenu: Cn } = un, Q = G(() => !T || !D ? !1 : C(T, "_", D, a?.screens) !== null, [
|
|
2369
|
+
T,
|
|
2370
|
+
D,
|
|
2371
|
+
a?.screens
|
|
2372
|
+
]), En = G(() => wn({
|
|
2373
|
+
visibleCols: L,
|
|
2374
|
+
entity: D,
|
|
2375
|
+
screen: T,
|
|
2376
|
+
schema: a,
|
|
2377
|
+
entityCode: O,
|
|
2379
2378
|
rowActions: P,
|
|
2380
|
-
hasBatchActions:
|
|
2381
|
-
hasExplicitRowActions:
|
|
2382
|
-
canUpdate:
|
|
2383
|
-
canDelete:
|
|
2384
|
-
peekEnabled:
|
|
2385
|
-
hasDetailTarget:
|
|
2386
|
-
userLocale:
|
|
2379
|
+
hasBatchActions: ue,
|
|
2380
|
+
hasExplicitRowActions: se,
|
|
2381
|
+
canUpdate: te,
|
|
2382
|
+
canDelete: ne,
|
|
2383
|
+
peekEnabled: dn,
|
|
2384
|
+
hasDetailTarget: Q,
|
|
2385
|
+
userLocale: o,
|
|
2387
2386
|
tabNavigate: t,
|
|
2388
|
-
refsRef:
|
|
2389
|
-
rowSelectionKey:
|
|
2390
|
-
setPeekRow:
|
|
2387
|
+
refsRef: an,
|
|
2388
|
+
rowSelectionKey: Pt,
|
|
2389
|
+
setPeekRow: hn
|
|
2391
2390
|
}), [
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2391
|
+
T,
|
|
2392
|
+
D,
|
|
2393
|
+
L,
|
|
2395
2394
|
t,
|
|
2396
|
-
pe,
|
|
2397
|
-
P,
|
|
2398
2395
|
ue,
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2396
|
+
P,
|
|
2397
|
+
se,
|
|
2398
|
+
O,
|
|
2399
|
+
dn,
|
|
2400
|
+
Q,
|
|
2401
|
+
a,
|
|
2402
|
+
o,
|
|
2403
|
+
te,
|
|
2404
|
+
ne,
|
|
2405
|
+
an,
|
|
2406
|
+
hn
|
|
2407
|
+
]), $ = Dt({
|
|
2408
|
+
features: kt,
|
|
2409
|
+
data: H,
|
|
2410
|
+
columns: En,
|
|
2412
2411
|
manualSorting: !0,
|
|
2413
2412
|
enableColumnResizing: !0,
|
|
2414
2413
|
columnResizeMode: "onChange",
|
|
2415
|
-
onColumnSizingChange:
|
|
2414
|
+
onColumnSizingChange: $e,
|
|
2416
2415
|
state: {
|
|
2417
|
-
sorting:
|
|
2418
|
-
rowSelection:
|
|
2416
|
+
sorting: Ne,
|
|
2417
|
+
rowSelection: Gt,
|
|
2419
2418
|
columnSizing: Qe
|
|
2420
2419
|
},
|
|
2421
2420
|
onSortingChange: (e) => {
|
|
2422
|
-
let t = (typeof e == "function" ? e(
|
|
2421
|
+
let t = (typeof e == "function" ? e(Ne) : e).slice(0, 5);
|
|
2423
2422
|
if (t.length === 0) {
|
|
2424
|
-
|
|
2423
|
+
Pe([]);
|
|
2425
2424
|
return;
|
|
2426
2425
|
}
|
|
2427
2426
|
let n = t.map((e) => {
|
|
2428
|
-
let t =
|
|
2427
|
+
let t = je.get(e.id);
|
|
2429
2428
|
return {
|
|
2430
2429
|
field: e.id,
|
|
2431
2430
|
dir: e.desc ? "desc" : "asc",
|
|
2432
2431
|
...t ? { nulls: t } : {}
|
|
2433
2432
|
};
|
|
2434
2433
|
});
|
|
2435
|
-
|
|
2434
|
+
Pe(n);
|
|
2436
2435
|
},
|
|
2437
|
-
onRowSelectionChange:
|
|
2438
|
-
getRowId:
|
|
2439
|
-
}),
|
|
2440
|
-
|
|
2441
|
-
let e = !!
|
|
2442
|
-
|
|
2436
|
+
onRowSelectionChange: qt,
|
|
2437
|
+
getRowId: Qt
|
|
2438
|
+
}), Dn = $.state.columnResizing.isResizingColumn, An = K(!1);
|
|
2439
|
+
W(() => {
|
|
2440
|
+
let e = !!An.current && !Dn;
|
|
2441
|
+
An.current = Dn, e && rt($.state.columnSizing);
|
|
2443
2442
|
}, [
|
|
2444
|
-
|
|
2445
|
-
|
|
2443
|
+
Dn,
|
|
2444
|
+
rt,
|
|
2446
2445
|
$
|
|
2447
2446
|
]);
|
|
2448
|
-
let
|
|
2449
|
-
|
|
2447
|
+
let jn = Kt($), Mn = $.getTotalSize();
|
|
2448
|
+
W(() => {
|
|
2450
2449
|
let e = (e) => {
|
|
2451
2450
|
let t = e.target?.tagName;
|
|
2452
2451
|
if (t === "INPUT" || t === "TEXTAREA" || t === "SELECT") {
|
|
2453
|
-
e.key === "Escape" && (e.target.blur(),
|
|
2452
|
+
e.key === "Escape" && (e.target.blur(), c(!1));
|
|
2454
2453
|
return;
|
|
2455
2454
|
}
|
|
2456
|
-
e.key === "/" && !e.metaKey && !e.ctrlKey && (e.preventDefault(), document.querySelector("[placeholder*=\"Search\"]")?.focus()), e.key === "f" && !e.metaKey && !e.ctrlKey && (e.preventDefault(),
|
|
2455
|
+
e.key === "/" && !e.metaKey && !e.ctrlKey && (e.preventDefault(), document.querySelector("[placeholder*=\"Search\"]")?.focus()), e.key === "f" && !e.metaKey && !e.ctrlKey && (e.preventDefault(), c((e) => !e)), e.key === "Escape" && c(!1);
|
|
2457
2456
|
};
|
|
2458
2457
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
2459
2458
|
}, []);
|
|
2460
|
-
let
|
|
2461
|
-
visibleCols:
|
|
2462
|
-
onReorder:
|
|
2463
|
-
scrollElRef:
|
|
2464
|
-
theadRef:
|
|
2465
|
-
}),
|
|
2466
|
-
count:
|
|
2467
|
-
getScrollElement: () =>
|
|
2468
|
-
estimateSize: () =>
|
|
2459
|
+
let Nn = K(null), { rows: Pn } = $.getRowModel(), Fn = K(null), In = On({
|
|
2460
|
+
visibleCols: L,
|
|
2461
|
+
onReorder: tt,
|
|
2462
|
+
scrollElRef: Nn,
|
|
2463
|
+
theadRef: Fn
|
|
2464
|
+
}), Ln = Ee((e) => e.density), Rn = Ee((e) => e.zebra), zn = ve(), Bn = Ot({
|
|
2465
|
+
count: Pn.length,
|
|
2466
|
+
getScrollElement: () => Nn.current,
|
|
2467
|
+
estimateSize: () => B === "cards" ? 142 : 48,
|
|
2469
2468
|
overscan: 10,
|
|
2470
|
-
initialOffset:
|
|
2471
|
-
}),
|
|
2472
|
-
|
|
2473
|
-
virtualizer:
|
|
2474
|
-
scrollElementRef:
|
|
2475
|
-
rowKeys:
|
|
2476
|
-
}),
|
|
2477
|
-
|
|
2478
|
-
}, [
|
|
2479
|
-
|
|
2469
|
+
initialOffset: zn
|
|
2470
|
+
}), Vn = G(() => Pn.map((e) => e.id), [Pn]);
|
|
2471
|
+
_e({
|
|
2472
|
+
virtualizer: Bn,
|
|
2473
|
+
scrollElementRef: Nn,
|
|
2474
|
+
rowKeys: Vn
|
|
2475
|
+
}), W(() => {
|
|
2476
|
+
Bn.measure();
|
|
2477
|
+
}, [Ln, Bn]), W(() => {
|
|
2478
|
+
Bn.measure();
|
|
2480
2479
|
}, [
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2480
|
+
z.width,
|
|
2481
|
+
z.height,
|
|
2482
|
+
B,
|
|
2483
|
+
Bn
|
|
2485
2484
|
]);
|
|
2486
|
-
let
|
|
2487
|
-
|
|
2485
|
+
let Hn = U((e) => {
|
|
2486
|
+
i((t) => {
|
|
2488
2487
|
let n = new URLSearchParams(t);
|
|
2489
2488
|
return e ? n.set("search", e) : n.delete("search"), n.set("page", "1"), n;
|
|
2490
2489
|
});
|
|
2491
|
-
}, [
|
|
2492
|
-
|
|
2490
|
+
}, [i]), Un = U(() => {
|
|
2491
|
+
i((e) => {
|
|
2493
2492
|
let t = new URLSearchParams(e);
|
|
2494
2493
|
return t.get("include_deleted") ? t.delete("include_deleted") : t.set("include_deleted", "true"), t.set("page", "1"), t;
|
|
2495
2494
|
});
|
|
2496
|
-
}, [
|
|
2497
|
-
|
|
2495
|
+
}, [i]), Wn = U((e) => {
|
|
2496
|
+
i((t) => {
|
|
2498
2497
|
let n = new URLSearchParams(t);
|
|
2499
2498
|
return n.set("page", String(e)), n;
|
|
2500
2499
|
});
|
|
2501
|
-
}, [
|
|
2502
|
-
|
|
2503
|
-
|
|
2500
|
+
}, [i]);
|
|
2501
|
+
W(() => {
|
|
2502
|
+
Rt !== void 0 && Se > Rt && Wn(Rt);
|
|
2504
2503
|
}, [
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2504
|
+
Rt,
|
|
2505
|
+
Se,
|
|
2506
|
+
Wn
|
|
2508
2507
|
]);
|
|
2509
|
-
let
|
|
2510
|
-
|
|
2508
|
+
let Gn = U((e) => {
|
|
2509
|
+
i((t) => {
|
|
2511
2510
|
let n = new URLSearchParams(t);
|
|
2512
2511
|
return n.set("per_page", String(e)), n.set("page", "1"), n;
|
|
2513
2512
|
});
|
|
2514
|
-
}, [
|
|
2515
|
-
if (!
|
|
2516
|
-
let
|
|
2517
|
-
entity:
|
|
2518
|
-
entityCode:
|
|
2519
|
-
screen:
|
|
2520
|
-
screenRoute:
|
|
2521
|
-
selectedRows:
|
|
2522
|
-
selectedIds:
|
|
2523
|
-
locale:
|
|
2513
|
+
}, [i]);
|
|
2514
|
+
if (!T || !D) return null;
|
|
2515
|
+
let Kn = D.display, qn = j(T.display?.name) || j(Kn.name), Jn = T.display?.icon || Kn.icon, Yn = j(T.display?.description) || j(Kn.description), Xn = z.category === "phone", Zn = B === "cards", Qn = Yt.map((e) => re(D, e)), $n = {
|
|
2516
|
+
entity: D,
|
|
2517
|
+
entityCode: O ?? "",
|
|
2518
|
+
screen: T,
|
|
2519
|
+
screenRoute: T.route,
|
|
2520
|
+
selectedRows: Xt,
|
|
2521
|
+
selectedIds: Qn,
|
|
2522
|
+
locale: o,
|
|
2524
2523
|
tabNavigate: (e, n) => t(e, {
|
|
2525
2524
|
title: n?.title,
|
|
2526
2525
|
icon: n?.icon,
|
|
2527
2526
|
search: n?.search
|
|
2528
2527
|
}),
|
|
2529
|
-
runActionApi: (e, t) =>
|
|
2528
|
+
runActionApi: (e, t) => A(e, t)
|
|
2530
2529
|
};
|
|
2531
|
-
return /* @__PURE__ */
|
|
2530
|
+
return /* @__PURE__ */ X("div", {
|
|
2532
2531
|
style: {
|
|
2533
2532
|
display: "flex",
|
|
2534
2533
|
flexDirection: "column",
|
|
@@ -2536,51 +2535,51 @@ function Mn({ screenCode: e }) {
|
|
|
2536
2535
|
background: "var(--background)"
|
|
2537
2536
|
},
|
|
2538
2537
|
children: [
|
|
2539
|
-
/* @__PURE__ */ J
|
|
2540
|
-
/* @__PURE__ */
|
|
2541
|
-
title:
|
|
2542
|
-
description:
|
|
2543
|
-
toolbarActions:
|
|
2544
|
-
screenActionLayout:
|
|
2545
|
-
entityActionLayout:
|
|
2546
|
-
selectedIds:
|
|
2547
|
-
data:
|
|
2548
|
-
rowKey:
|
|
2549
|
-
onActionSuccess: () =>
|
|
2550
|
-
widgetContext:
|
|
2538
|
+
/* @__PURE__ */ X(J, { children: [
|
|
2539
|
+
/* @__PURE__ */ Y(_n, {
|
|
2540
|
+
title: qn,
|
|
2541
|
+
description: Yn,
|
|
2542
|
+
toolbarActions: ie,
|
|
2543
|
+
screenActionLayout: T.action_layout,
|
|
2544
|
+
entityActionLayout: D.action_layout,
|
|
2545
|
+
selectedIds: Jt,
|
|
2546
|
+
data: H,
|
|
2547
|
+
rowKey: Qt,
|
|
2548
|
+
onActionSuccess: () => qt({}),
|
|
2549
|
+
widgetContext: $n
|
|
2551
2550
|
}),
|
|
2552
|
-
/* @__PURE__ */
|
|
2553
|
-
screen:
|
|
2554
|
-
entity:
|
|
2555
|
-
entityCode:
|
|
2556
|
-
schema:
|
|
2551
|
+
/* @__PURE__ */ Y(ln, {
|
|
2552
|
+
screen: T,
|
|
2553
|
+
entity: D,
|
|
2554
|
+
entityCode: O,
|
|
2555
|
+
schema: a,
|
|
2557
2556
|
screenCode: e,
|
|
2558
|
-
screenName:
|
|
2559
|
-
locale:
|
|
2560
|
-
isPhone:
|
|
2561
|
-
isCardsPresentation:
|
|
2562
|
-
sort:
|
|
2563
|
-
columns:
|
|
2564
|
-
views:
|
|
2565
|
-
query:
|
|
2566
|
-
selection:
|
|
2557
|
+
screenName: qn,
|
|
2558
|
+
locale: o,
|
|
2559
|
+
isPhone: Xn,
|
|
2560
|
+
isCardsPresentation: Zn,
|
|
2561
|
+
sort: Oe,
|
|
2562
|
+
columns: qe,
|
|
2563
|
+
views: it,
|
|
2564
|
+
query: gt,
|
|
2565
|
+
selection: Wt,
|
|
2567
2566
|
filters: {
|
|
2568
|
-
json:
|
|
2569
|
-
debouncedSearch:
|
|
2570
|
-
count:
|
|
2571
|
-
onOpen: () =>
|
|
2567
|
+
json: g,
|
|
2568
|
+
debouncedSearch: dt,
|
|
2569
|
+
count: v,
|
|
2570
|
+
onOpen: () => c(!0)
|
|
2572
2571
|
},
|
|
2573
|
-
searchValue:
|
|
2574
|
-
onSearchChange:
|
|
2575
|
-
onSaveView: () =>
|
|
2576
|
-
page:
|
|
2577
|
-
perPage:
|
|
2578
|
-
includeDeleted:
|
|
2579
|
-
canViewDeleted:
|
|
2580
|
-
onToggleDeleted:
|
|
2581
|
-
isLive:
|
|
2572
|
+
searchValue: De,
|
|
2573
|
+
onSearchChange: Hn,
|
|
2574
|
+
onSaveView: () => h(!0),
|
|
2575
|
+
page: Se,
|
|
2576
|
+
perPage: Ce,
|
|
2577
|
+
includeDeleted: me,
|
|
2578
|
+
canViewDeleted: fe,
|
|
2579
|
+
onToggleDeleted: Un,
|
|
2580
|
+
isLive: en
|
|
2582
2581
|
}),
|
|
2583
|
-
|
|
2582
|
+
_ && /* @__PURE__ */ X("div", {
|
|
2584
2583
|
role: "alert",
|
|
2585
2584
|
"data-testid": "filter-url-error",
|
|
2586
2585
|
style: {
|
|
@@ -2594,52 +2593,52 @@ function Mn({ screenCode: e }) {
|
|
|
2594
2593
|
alignItems: "center",
|
|
2595
2594
|
gap: 8
|
|
2596
2595
|
},
|
|
2597
|
-
children: [/* @__PURE__ */
|
|
2596
|
+
children: [/* @__PURE__ */ X("span", { children: [_, " Showing this list without URL filters."] }), /* @__PURE__ */ Y(d, {
|
|
2598
2597
|
kind: "ghost",
|
|
2599
2598
|
size: "xs",
|
|
2600
|
-
onClick:
|
|
2599
|
+
onClick: b,
|
|
2601
2600
|
children: "Clear"
|
|
2602
2601
|
})]
|
|
2603
2602
|
}),
|
|
2604
|
-
|
|
2603
|
+
g.length > 0 && /* @__PURE__ */ Y("div", {
|
|
2605
2604
|
style: { padding: "0 20px 10px" },
|
|
2606
|
-
children: /* @__PURE__ */
|
|
2607
|
-
filters:
|
|
2608
|
-
resolveValue:
|
|
2609
|
-
onRemove: (e) =>
|
|
2610
|
-
onClearAll:
|
|
2611
|
-
onChipClick: () =>
|
|
2605
|
+
children: /* @__PURE__ */ Y(Ze, {
|
|
2606
|
+
filters: g,
|
|
2607
|
+
resolveValue: sn,
|
|
2608
|
+
onRemove: (e) => y(ot(g, e)),
|
|
2609
|
+
onClearAll: b,
|
|
2610
|
+
onChipClick: () => c(!0),
|
|
2612
2611
|
fieldLabel: (e) => {
|
|
2613
2612
|
if (e.startsWith("$status.")) {
|
|
2614
|
-
let t = e.slice(8), n =
|
|
2615
|
-
return n ?
|
|
2613
|
+
let t = e.slice(8), n = D.status_groups?.[t];
|
|
2614
|
+
return n ? j(n.name) || t : e;
|
|
2616
2615
|
}
|
|
2617
2616
|
if (e.startsWith("$property.")) {
|
|
2618
|
-
let t = e.slice(10), n =
|
|
2619
|
-
return n ?
|
|
2617
|
+
let t = e.slice(10), n = D.properties?.[t];
|
|
2618
|
+
return n ? j(n.name) || t : e;
|
|
2620
2619
|
}
|
|
2621
|
-
let t =
|
|
2622
|
-
return t ?
|
|
2620
|
+
let t = D.fields.get(e);
|
|
2621
|
+
return t ? p(t, e, a?.entities) : e;
|
|
2623
2622
|
}
|
|
2624
2623
|
})
|
|
2625
2624
|
})
|
|
2626
2625
|
] }),
|
|
2627
|
-
/* @__PURE__ */
|
|
2628
|
-
isLoading:
|
|
2629
|
-
tableLoadingStale:
|
|
2630
|
-
isError:
|
|
2631
|
-
error:
|
|
2632
|
-
rowCount:
|
|
2633
|
-
entity:
|
|
2634
|
-
screen:
|
|
2635
|
-
screenName:
|
|
2636
|
-
screenIcon:
|
|
2637
|
-
isFiltered: !!
|
|
2638
|
-
canCreate:
|
|
2639
|
-
toolbarActions:
|
|
2640
|
-
onRetry:
|
|
2626
|
+
/* @__PURE__ */ Y(tn, {
|
|
2627
|
+
isLoading: bt,
|
|
2628
|
+
tableLoadingStale: wt,
|
|
2629
|
+
isError: St,
|
|
2630
|
+
error: Ct,
|
|
2631
|
+
rowCount: H.length,
|
|
2632
|
+
entity: D,
|
|
2633
|
+
screen: T,
|
|
2634
|
+
screenName: qn,
|
|
2635
|
+
screenIcon: Jn,
|
|
2636
|
+
isFiltered: !!dt || v > 0,
|
|
2637
|
+
canCreate: k,
|
|
2638
|
+
toolbarActions: ie,
|
|
2639
|
+
onRetry: Tt
|
|
2641
2640
|
}),
|
|
2642
|
-
|
|
2641
|
+
bt || St || H.length === 0 ? null : /* @__PURE__ */ Y("div", {
|
|
2643
2642
|
style: {
|
|
2644
2643
|
flex: 1,
|
|
2645
2644
|
minHeight: 0,
|
|
@@ -2647,7 +2646,7 @@ function Mn({ screenCode: e }) {
|
|
|
2647
2646
|
display: "flex",
|
|
2648
2647
|
flexDirection: "column"
|
|
2649
2648
|
},
|
|
2650
|
-
children: /* @__PURE__ */
|
|
2649
|
+
children: /* @__PURE__ */ X("div", {
|
|
2651
2650
|
style: {
|
|
2652
2651
|
background: "var(--surface)",
|
|
2653
2652
|
border: "1px solid var(--border)",
|
|
@@ -2659,191 +2658,191 @@ function Mn({ screenCode: e }) {
|
|
|
2659
2658
|
flex: 1,
|
|
2660
2659
|
minHeight: 0
|
|
2661
2660
|
},
|
|
2662
|
-
children: [/* @__PURE__ */
|
|
2663
|
-
ref:
|
|
2661
|
+
children: [/* @__PURE__ */ Y("div", {
|
|
2662
|
+
ref: Nn,
|
|
2664
2663
|
"data-testid": "list-scroll",
|
|
2665
|
-
"data-presentation":
|
|
2664
|
+
"data-presentation": B,
|
|
2666
2665
|
style: {
|
|
2667
2666
|
overflow: "auto",
|
|
2668
2667
|
flex: 1,
|
|
2669
2668
|
minHeight: 0
|
|
2670
2669
|
},
|
|
2671
|
-
children:
|
|
2670
|
+
children: B === "cards" ? /* @__PURE__ */ Y(ht, {
|
|
2672
2671
|
fallback: null,
|
|
2673
|
-
children: /* @__PURE__ */
|
|
2674
|
-
rows:
|
|
2675
|
-
virtualizer:
|
|
2676
|
-
entity:
|
|
2677
|
-
screen:
|
|
2678
|
-
entityCode:
|
|
2679
|
-
entities:
|
|
2680
|
-
savedViewColumns:
|
|
2681
|
-
refs:
|
|
2682
|
-
locale:
|
|
2683
|
-
renderers:
|
|
2672
|
+
children: /* @__PURE__ */ Y(kn, {
|
|
2673
|
+
rows: Pn,
|
|
2674
|
+
virtualizer: Bn,
|
|
2675
|
+
entity: D,
|
|
2676
|
+
screen: T,
|
|
2677
|
+
entityCode: O,
|
|
2678
|
+
entities: a?.entities,
|
|
2679
|
+
savedViewColumns: R?.columns,
|
|
2680
|
+
refs: an.current,
|
|
2681
|
+
locale: o,
|
|
2682
|
+
renderers: on,
|
|
2684
2683
|
rowActions: P,
|
|
2685
2684
|
tabNavigate: t,
|
|
2686
|
-
interaction:
|
|
2687
|
-
hasSoftDelete:
|
|
2688
|
-
zebra:
|
|
2689
|
-
hasBatchActions:
|
|
2690
|
-
hasDetailTarget:
|
|
2691
|
-
rowKey:
|
|
2685
|
+
interaction: un,
|
|
2686
|
+
hasSoftDelete: de,
|
|
2687
|
+
zebra: Rn,
|
|
2688
|
+
hasBatchActions: ue,
|
|
2689
|
+
hasDetailTarget: Q,
|
|
2690
|
+
rowKey: Qt
|
|
2692
2691
|
})
|
|
2693
|
-
}) : /* @__PURE__ */
|
|
2692
|
+
}) : /* @__PURE__ */ Y(Zt, {
|
|
2694
2693
|
table: $,
|
|
2695
|
-
columns:
|
|
2696
|
-
rows:
|
|
2697
|
-
entity:
|
|
2698
|
-
columnSizeVars:
|
|
2699
|
-
totalColumnsWidth:
|
|
2700
|
-
theadRef:
|
|
2701
|
-
virtualizer:
|
|
2702
|
-
visibleCols:
|
|
2703
|
-
headerReorder:
|
|
2704
|
-
sortCols:
|
|
2705
|
-
sortNullsMap:
|
|
2706
|
-
shiftClickColumn:
|
|
2707
|
-
applyColumnSort:
|
|
2708
|
-
appendColumnSort:
|
|
2709
|
-
clearColumnSort:
|
|
2710
|
-
clearAllSorts:
|
|
2711
|
-
renderRow: (e, t) => /* @__PURE__ */
|
|
2694
|
+
columns: En,
|
|
2695
|
+
rows: Pn,
|
|
2696
|
+
entity: D,
|
|
2697
|
+
columnSizeVars: jn,
|
|
2698
|
+
totalColumnsWidth: Mn,
|
|
2699
|
+
theadRef: Fn,
|
|
2700
|
+
virtualizer: Bn,
|
|
2701
|
+
visibleCols: L,
|
|
2702
|
+
headerReorder: In,
|
|
2703
|
+
sortCols: ke,
|
|
2704
|
+
sortNullsMap: je,
|
|
2705
|
+
shiftClickColumn: Re,
|
|
2706
|
+
applyColumnSort: Le,
|
|
2707
|
+
appendColumnSort: ze,
|
|
2708
|
+
clearColumnSort: Be,
|
|
2709
|
+
clearAllSorts: Ve,
|
|
2710
|
+
renderRow: (e, t) => /* @__PURE__ */ Y($t, {
|
|
2712
2711
|
row: e,
|
|
2713
2712
|
rowIndex: t,
|
|
2714
|
-
entity:
|
|
2715
|
-
hasSoftDelete:
|
|
2716
|
-
zebra:
|
|
2717
|
-
hasDetailTarget:
|
|
2718
|
-
interaction:
|
|
2719
|
-
measureElement:
|
|
2713
|
+
entity: D,
|
|
2714
|
+
hasSoftDelete: de,
|
|
2715
|
+
zebra: Rn,
|
|
2716
|
+
hasDetailTarget: Q,
|
|
2717
|
+
interaction: un,
|
|
2718
|
+
measureElement: Bn.measureElement
|
|
2720
2719
|
}, e.id),
|
|
2721
|
-
isResizingColumn:
|
|
2720
|
+
isResizingColumn: Dn
|
|
2722
2721
|
})
|
|
2723
|
-
}), /* @__PURE__ */
|
|
2724
|
-
meta:
|
|
2725
|
-
isCursor:
|
|
2726
|
-
isPhone:
|
|
2727
|
-
rowsLoaded:
|
|
2728
|
-
selectedCount:
|
|
2729
|
-
countTotal:
|
|
2730
|
-
countStrategy:
|
|
2731
|
-
countLoading:
|
|
2732
|
-
countError:
|
|
2733
|
-
page:
|
|
2734
|
-
totalPages:
|
|
2735
|
-
goToPage:
|
|
2736
|
-
perPage:
|
|
2737
|
-
setPerPage:
|
|
2738
|
-
hasMorePages:
|
|
2739
|
-
fetchNextPage:
|
|
2740
|
-
isFetchingNextPage:
|
|
2722
|
+
}), /* @__PURE__ */ Y(nn, {
|
|
2723
|
+
meta: vt,
|
|
2724
|
+
isCursor: Bt,
|
|
2725
|
+
isPhone: Xn,
|
|
2726
|
+
rowsLoaded: H.length,
|
|
2727
|
+
selectedCount: Jt.length,
|
|
2728
|
+
countTotal: Et,
|
|
2729
|
+
countStrategy: At,
|
|
2730
|
+
countLoading: Nt,
|
|
2731
|
+
countError: Ft,
|
|
2732
|
+
page: Se,
|
|
2733
|
+
totalPages: Rt,
|
|
2734
|
+
goToPage: Wn,
|
|
2735
|
+
perPage: Ce,
|
|
2736
|
+
setPerPage: Gn,
|
|
2737
|
+
hasMorePages: zt,
|
|
2738
|
+
fetchNextPage: Vt,
|
|
2739
|
+
isFetchingNextPage: Ut
|
|
2741
2740
|
})]
|
|
2742
2741
|
})
|
|
2743
2742
|
}),
|
|
2744
|
-
/* @__PURE__ */
|
|
2745
|
-
open:
|
|
2746
|
-
onClose: () =>
|
|
2747
|
-
filters:
|
|
2748
|
-
onApply:
|
|
2749
|
-
availableFields:
|
|
2750
|
-
defaultFilters:
|
|
2751
|
-
refs:
|
|
2743
|
+
/* @__PURE__ */ Y(et, {
|
|
2744
|
+
open: s,
|
|
2745
|
+
onClose: () => c(!1),
|
|
2746
|
+
filters: g,
|
|
2747
|
+
onApply: y,
|
|
2748
|
+
availableFields: Ue,
|
|
2749
|
+
defaultFilters: T?.default_filters,
|
|
2750
|
+
refs: cn
|
|
2752
2751
|
}),
|
|
2753
|
-
/* @__PURE__ */
|
|
2754
|
-
open:
|
|
2755
|
-
pending:
|
|
2756
|
-
onClose: () =>
|
|
2757
|
-
overwriteViewName:
|
|
2752
|
+
/* @__PURE__ */ Y(gn, {
|
|
2753
|
+
open: l,
|
|
2754
|
+
pending: ut,
|
|
2755
|
+
onClose: () => h(!1),
|
|
2756
|
+
overwriteViewName: pn(R),
|
|
2758
2757
|
onOverwrite: async () => {
|
|
2759
|
-
await
|
|
2758
|
+
await lt(), h(!1);
|
|
2760
2759
|
},
|
|
2761
2760
|
onSave: async (e) => {
|
|
2762
|
-
await
|
|
2761
|
+
await at(e), h(!1);
|
|
2763
2762
|
}
|
|
2764
2763
|
}),
|
|
2765
|
-
|
|
2766
|
-
selectedIds:
|
|
2764
|
+
Jt.length > 0 && /* @__PURE__ */ Y(vn, {
|
|
2765
|
+
selectedIds: Jt,
|
|
2767
2766
|
floatbarActions: N,
|
|
2768
|
-
screenActionLayout:
|
|
2769
|
-
entityActionLayout:
|
|
2770
|
-
data:
|
|
2771
|
-
rowKey:
|
|
2772
|
-
entityCode:
|
|
2773
|
-
entity:
|
|
2774
|
-
screen:
|
|
2775
|
-
onClear: () =>
|
|
2776
|
-
onActionSuccess: () =>
|
|
2777
|
-
widgetContext:
|
|
2767
|
+
screenActionLayout: T.action_layout,
|
|
2768
|
+
entityActionLayout: D.action_layout,
|
|
2769
|
+
data: H,
|
|
2770
|
+
rowKey: Qt,
|
|
2771
|
+
entityCode: O,
|
|
2772
|
+
entity: D,
|
|
2773
|
+
screen: T,
|
|
2774
|
+
onClear: () => qt({}),
|
|
2775
|
+
onActionSuccess: () => qt({}),
|
|
2776
|
+
widgetContext: $n
|
|
2778
2777
|
}),
|
|
2779
|
-
|
|
2780
|
-
x:
|
|
2781
|
-
y:
|
|
2782
|
-
row:
|
|
2783
|
-
rowId:
|
|
2784
|
-
screen:
|
|
2785
|
-
fullScreen:
|
|
2786
|
-
entity:
|
|
2787
|
-
entityCode:
|
|
2778
|
+
Sn && D && T && /* @__PURE__ */ Y(Tn, {
|
|
2779
|
+
x: Sn.x,
|
|
2780
|
+
y: Sn.y,
|
|
2781
|
+
row: Sn.row,
|
|
2782
|
+
rowId: Qt(Sn.row),
|
|
2783
|
+
screen: T,
|
|
2784
|
+
fullScreen: T,
|
|
2785
|
+
entity: D,
|
|
2786
|
+
entityCode: O,
|
|
2788
2787
|
rowActions: P,
|
|
2789
2788
|
tabNavigate: t,
|
|
2790
|
-
locale:
|
|
2791
|
-
peekAllowed:
|
|
2792
|
-
hasDetailTarget:
|
|
2793
|
-
onPeek:
|
|
2794
|
-
onClose: () =>
|
|
2789
|
+
locale: o,
|
|
2790
|
+
peekAllowed: dn,
|
|
2791
|
+
hasDetailTarget: Q,
|
|
2792
|
+
onPeek: hn,
|
|
2793
|
+
onClose: () => Cn(null)
|
|
2795
2794
|
}),
|
|
2796
|
-
|
|
2797
|
-
entity:
|
|
2798
|
-
entityCode:
|
|
2799
|
-
record:
|
|
2795
|
+
dn && Z && D && /* @__PURE__ */ Y(Xe, {
|
|
2796
|
+
entity: D,
|
|
2797
|
+
entityCode: O,
|
|
2798
|
+
record: Z,
|
|
2800
2799
|
title: (() => {
|
|
2801
|
-
let e =
|
|
2802
|
-
return e ? F(
|
|
2800
|
+
let e = T.columns?.find((e) => !e.startsWith("$status.") && !e.startsWith("$property."));
|
|
2801
|
+
return e ? F(Z[e] ?? j(D.display.name)) : j(D.display.name);
|
|
2803
2802
|
})(),
|
|
2804
2803
|
recordId: (() => {
|
|
2805
|
-
let e =
|
|
2806
|
-
return e ? F(
|
|
2804
|
+
let e = D.fields.names()?.find((e) => D.fields.get(e)?.primary);
|
|
2805
|
+
return e ? F(Z[e]) : void 0;
|
|
2807
2806
|
})(),
|
|
2808
|
-
fields:
|
|
2809
|
-
screen:
|
|
2810
|
-
actions:
|
|
2811
|
-
screenActionLayout:
|
|
2812
|
-
entityActionLayout:
|
|
2813
|
-
executeAction:
|
|
2807
|
+
fields: yn,
|
|
2808
|
+
screen: He(D, T, Z),
|
|
2809
|
+
actions: bn,
|
|
2810
|
+
screenActionLayout: He(D, T, Z)?.action_layout,
|
|
2811
|
+
entityActionLayout: D.action_layout,
|
|
2812
|
+
executeAction: xn,
|
|
2814
2813
|
onClose: () => {
|
|
2815
|
-
if (
|
|
2816
|
-
let e =
|
|
2817
|
-
e &&
|
|
2814
|
+
if (D && Z) {
|
|
2815
|
+
let e = D.fields.names()?.find((e) => D.fields.get(e)?.primary);
|
|
2816
|
+
e && pt(F(Z[e]));
|
|
2818
2817
|
}
|
|
2819
|
-
|
|
2818
|
+
hn(null);
|
|
2820
2819
|
},
|
|
2821
2820
|
onOpen: (e) => {
|
|
2822
|
-
let t =
|
|
2823
|
-
|
|
2821
|
+
let t = Z;
|
|
2822
|
+
hn(null), un.navigateToDetail(t, { draft: e });
|
|
2824
2823
|
},
|
|
2825
2824
|
onSave: (e) => {
|
|
2826
|
-
|
|
2827
|
-
let t =
|
|
2825
|
+
hn(e);
|
|
2826
|
+
let t = D.fields.names()?.find((e) => D.fields.get(e)?.primary);
|
|
2828
2827
|
if (!t) return;
|
|
2829
2828
|
let n = F(e[t]), r = {};
|
|
2830
|
-
for (let t of
|
|
2831
|
-
let n =
|
|
2829
|
+
for (let t of D.fields.names()) {
|
|
2830
|
+
let n = Fe(D, e, t), i = Fe(D, Z, t), a = Ie(D, t, n), o = Ie(D, t, i);
|
|
2832
2831
|
(a === "" ? null : a) !== (o === "" || o === void 0 ? null : o) && (r[t] = a);
|
|
2833
2832
|
}
|
|
2834
2833
|
let i = Je({
|
|
2835
|
-
entity:
|
|
2834
|
+
entity: D,
|
|
2836
2835
|
formData: e,
|
|
2837
|
-
record:
|
|
2836
|
+
record: Z,
|
|
2838
2837
|
isNew: !1
|
|
2839
2838
|
});
|
|
2840
2839
|
if (Object.keys(i).length > 0 && (r.$files = i), Object.keys(r).length === 0) return;
|
|
2841
|
-
let a =
|
|
2842
|
-
|
|
2840
|
+
let a = We(i);
|
|
2841
|
+
rn.mutate({
|
|
2843
2842
|
pkValues: n,
|
|
2844
2843
|
data: r
|
|
2845
2844
|
}, { onSuccess: () => {
|
|
2846
|
-
a.forEach((e) =>
|
|
2845
|
+
a.forEach((e) => w.markCommitted(e));
|
|
2847
2846
|
} });
|
|
2848
2847
|
}
|
|
2849
2848
|
})
|
|
@@ -2851,4 +2850,4 @@ function Mn({ screenCode: e }) {
|
|
|
2851
2850
|
});
|
|
2852
2851
|
}
|
|
2853
2852
|
//#endregion
|
|
2854
|
-
export {
|
|
2853
|
+
export { An as SmartListPage, Sn as t };
|