@declarion/react 0.52.0 → 0.54.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-CPoUY99R.js} +35 -35
- package/dist-lib/{Grid-DUjbQg3r.js → Grid--QAEby8k.js} +28 -28
- package/dist-lib/{LayoutRenderer-DbdxC-Bq.js → LayoutRenderer-BxZ7Nd9b.js} +920 -922
- package/dist-lib/{ListCardsBody-C8ofksQb.js → ListCardsBody-BPV4GPrv.js} +14 -14
- package/dist-lib/{MarkdownRenderer-B9_5fwuE.js → MarkdownRenderer-CIKuh_0i.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-DMLkZP3R.js} +120 -122
- package/dist-lib/{SmartDetailPage.impl-DWjNQ052.js → SmartDetailPage.impl-SnNu6Ug-.js} +376 -377
- package/dist-lib/{SmartListPage.impl-yKBK7a8b.js → SmartListPage.impl-C73pR7Iw.js} +1098 -1099
- package/dist-lib/{SmartRecordListPage.impl-DRpU_DOC.js → SmartRecordListPage.impl-rJjQZe1V.js} +183 -183
- package/dist-lib/{SortHeaderMenu-CbihbEGd.js → SortHeaderMenu-DQ_KrkWk.js} +1 -1
- package/dist-lib/{action-dispatch-C28UhXXA.js → action-dispatch-DsuUS7ae.js} +382 -382
- package/dist-lib/api/agents.d.ts +0 -1
- package/dist-lib/api/events.d.ts +27 -5
- package/dist-lib/{cardProjection-Bp_ZPLUE.js → cardProjection-BadzqyeQ.js} +146 -204
- package/dist-lib/components/actions/ObjectActionBar.d.ts +1 -1
- package/dist-lib/components/chrome/Breadcrumbs.d.ts +1 -1
- package/dist-lib/components/detail-layout/DetailAuditStrip.d.ts +1 -1
- package/dist-lib/components/detail-layout/DetailHighlights.d.ts +1 -1
- package/dist-lib/components/detail-layout/DraggableChildrenTable.d.ts +1 -1
- package/dist-lib/components/detail-layout/EditableChildrenTable.d.ts +1 -1
- package/dist-lib/components/detail-layout/LayoutRenderer.d.ts +1 -1
- package/dist-lib/components/file-widgets/host.d.ts +1 -1
- package/dist-lib/components/layout/Layout.d.ts +1 -1
- package/dist-lib/components/layout/TopBar.d.ts +1 -1
- package/dist-lib/components/list/InlineEditCell.d.ts +1 -1
- package/dist-lib/components/list/PeekFieldCell.d.ts +1 -1
- package/dist-lib/components/list/QuickPeek.d.ts +1 -1
- 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/auth/AuthShell.d.ts +1 -1
- package/dist-lib/components/pages/list/ListCardRow.d.ts +1 -1
- package/dist-lib/components/pages/list/ListCardsBody.d.ts +1 -1
- package/dist-lib/components/pages/list/ListFloatbar.d.ts +1 -1
- package/dist-lib/components/pages/list/ListHeader.d.ts +1 -1
- package/dist-lib/components/pages/list/columns.d.ts +1 -1
- package/dist-lib/components/pages/list/filter-meta.d.ts +1 -1
- package/dist-lib/components/pages/list/use-filter-value-labels.d.ts +1 -1
- package/dist-lib/components/pages/list/useListQuery.d.ts +6 -1
- package/dist-lib/components/pages/list/useListRowInteraction.d.ts +1 -1
- package/dist-lib/components/pages/list/useListViews.d.ts +1 -1
- package/dist-lib/components/pages/list/useRowMenu.d.ts +1 -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-sMkkAEg9.js} +301 -320
- package/dist-lib/{format-count-C3N-WxEy.js → format-count-B5SLlNOb.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 +1586 -1858
- package/dist-lib/lib/action-dispatch.d.ts +1 -1
- 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-CbHFwz_F.js} +36 -36
- package/dist-lib/{registry-p6CejATt.js → registry-D0RhCnEL.js} +507 -507
- package/dist-lib/stores/realtime.d.ts +20 -0
- package/dist-lib/testing.js +35 -35
- package/dist-lib/types/api.d.ts +8 -4
- package/dist-lib/types/schema.d.ts +6 -0
- package/dist-lib/{useCurrentScreen-74x5yJNb.js → useCurrentScreen-DVTXCj_K.js} +2508 -1557
- package/dist-lib/{useListQuery-D75bgLLz.js → useListQuery-C2nq58YV.js} +13 -10
- package/dist-lib/{useProperties-C5fZp12D.js → useProperties-BcIz-MyO.js} +25 -25
- package/dist-lib/useTabSearchMirror-UYCsopxP.js +177 -0
- package/dist-lib/{value-DKekzcjz.js → value-CQzGOI0F.js} +25 -25
- package/package.json +14 -14
- package/dist-lib/useTabSearchMirror-D_wzoYRz.js +0 -406
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { s as e, t } from "./DynamicIcon-DW5krHuX.js";
|
|
2
|
-
import { $
|
|
3
|
-
import {
|
|
4
|
-
import { c as
|
|
5
|
-
import { n as
|
|
6
|
-
import { Component as
|
|
2
|
+
import { $t as n, A as r, Bn as i, Cr as a, Dr as o, Fr as s, Gt as c, I as l, Ir as u, Jn as d, Jt as f, K as p, Kn as m, Kt as h, L as g, Mr as _, Mt as v, Pr as y, Q as b, St as x, U as S, W as C, Xn as w, Y as T, Yt as E, Z as D, Zn as O, Zt as k, an as A, et as j, i as M, in as N, k as P, lr as F, nt as I, qn as L, qt as ee, rr as R, rt as z, ur as B, vr as V, vt as H, wr as U, xr as te, yn as W } from "./useCurrentScreen-DVTXCj_K.js";
|
|
3
|
+
import { O as ne } from "./field-classification-sMkkAEg9.js";
|
|
4
|
+
import { c as re, l as ie, o as ae, t as oe } from "./action-dispatch-DsuUS7ae.js";
|
|
5
|
+
import { n as se, r as ce, t as G } from "./dataTableStyles-vwD1mVOP.js";
|
|
6
|
+
import { Component as le, useCallback as K, useEffect as ue, useId as de, useMemo as q, useRef as J, useState as Y } from "react";
|
|
7
7
|
import { useInfiniteQuery as fe, useQuery as pe, useQueryClient as X } from "@tanstack/react-query";
|
|
8
8
|
import { Fragment as me, jsx as Z, jsxs as Q } from "react/jsx-runtime";
|
|
9
9
|
import { clsx as he } from "clsx";
|
|
@@ -19,16 +19,16 @@ var $ = {
|
|
|
19
19
|
shadow: "none"
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
|
-
function _e({ title: t, subtitle: n, right: r, badge: i, count: a, children: o, footer:
|
|
23
|
-
let [
|
|
22
|
+
function _e({ title: t, subtitle: n, right: r, badge: i, count: a, children: o, footer: c, collapsible: l = !0, defaultOpen: u = !0, icon: d, emphasis: f = "primary", headingLevel: p = 2, padding: m = "16px" }) {
|
|
23
|
+
let [h, g] = Y(u), _ = $[f] ?? $.primary;
|
|
24
24
|
return /* @__PURE__ */ Q("div", {
|
|
25
|
-
"data-emphasis":
|
|
25
|
+
"data-emphasis": f,
|
|
26
26
|
style: {
|
|
27
|
-
background:
|
|
27
|
+
background: _.surface,
|
|
28
28
|
border: "1px solid var(--border)",
|
|
29
29
|
borderRadius: 10,
|
|
30
30
|
overflow: "hidden",
|
|
31
|
-
boxShadow:
|
|
31
|
+
boxShadow: _.shadow,
|
|
32
32
|
flexShrink: 0
|
|
33
33
|
},
|
|
34
34
|
children: [
|
|
@@ -38,25 +38,25 @@ function _e({ title: t, subtitle: n, right: r, badge: i, count: a, children: o,
|
|
|
38
38
|
alignItems: "center",
|
|
39
39
|
gap: 10,
|
|
40
40
|
padding: "10px 14px",
|
|
41
|
-
borderBottom:
|
|
41
|
+
borderBottom: h ? "1px solid var(--divider)" : "none",
|
|
42
42
|
minHeight: 40
|
|
43
43
|
},
|
|
44
44
|
children: [
|
|
45
45
|
/* @__PURE__ */ Z("div", {
|
|
46
46
|
role: "heading",
|
|
47
|
-
"aria-level":
|
|
47
|
+
"aria-level": p,
|
|
48
48
|
style: {
|
|
49
49
|
display: "flex",
|
|
50
50
|
flex: 1,
|
|
51
51
|
minWidth: 0
|
|
52
52
|
},
|
|
53
53
|
children: /* @__PURE__ */ Q("div", {
|
|
54
|
-
role:
|
|
55
|
-
tabIndex:
|
|
56
|
-
"aria-expanded":
|
|
57
|
-
onClick:
|
|
58
|
-
onKeyDown:
|
|
59
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(),
|
|
54
|
+
role: l ? "button" : void 0,
|
|
55
|
+
tabIndex: l ? 0 : void 0,
|
|
56
|
+
"aria-expanded": l ? h : void 0,
|
|
57
|
+
onClick: l ? () => g((e) => !e) : void 0,
|
|
58
|
+
onKeyDown: l ? (e) => {
|
|
59
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), g((e) => !e));
|
|
60
60
|
} : void 0,
|
|
61
61
|
style: {
|
|
62
62
|
display: "flex",
|
|
@@ -64,17 +64,17 @@ function _e({ title: t, subtitle: n, right: r, badge: i, count: a, children: o,
|
|
|
64
64
|
gap: 8,
|
|
65
65
|
flex: 1,
|
|
66
66
|
minWidth: 0,
|
|
67
|
-
cursor:
|
|
67
|
+
cursor: l ? "pointer" : "default",
|
|
68
68
|
userSelect: "none"
|
|
69
69
|
},
|
|
70
70
|
children: [
|
|
71
|
-
|
|
71
|
+
d && /* @__PURE__ */ Z("span", {
|
|
72
72
|
style: {
|
|
73
73
|
color: "var(--text-3)",
|
|
74
74
|
display: "flex",
|
|
75
75
|
flexShrink: 0
|
|
76
76
|
},
|
|
77
|
-
children:
|
|
77
|
+
children: d
|
|
78
78
|
}),
|
|
79
79
|
/* @__PURE__ */ Z("div", {
|
|
80
80
|
style: {
|
|
@@ -118,26 +118,26 @@ function _e({ title: t, subtitle: n, right: r, badge: i, count: a, children: o,
|
|
|
118
118
|
]
|
|
119
119
|
})
|
|
120
120
|
}),
|
|
121
|
-
i && /* @__PURE__ */ Z(
|
|
121
|
+
i && /* @__PURE__ */ Z(y, {
|
|
122
122
|
tone: i.tone ?? "violet",
|
|
123
123
|
size: "xs",
|
|
124
124
|
dot: i.dot,
|
|
125
125
|
children: i.text
|
|
126
126
|
}),
|
|
127
127
|
r,
|
|
128
|
-
|
|
128
|
+
l && /* @__PURE__ */ Z(s, {
|
|
129
129
|
size: 24,
|
|
130
|
-
icon: Z(
|
|
131
|
-
onClick: () =>
|
|
132
|
-
title:
|
|
130
|
+
icon: Z(h ? e.up : e.down, { size: 14 }),
|
|
131
|
+
onClick: () => g((e) => !e),
|
|
132
|
+
title: h ? "Collapse" : "Expand"
|
|
133
133
|
})
|
|
134
134
|
]
|
|
135
135
|
}),
|
|
136
|
-
|
|
137
|
-
style: { padding:
|
|
136
|
+
h && /* @__PURE__ */ Z("div", {
|
|
137
|
+
style: { padding: m },
|
|
138
138
|
children: o
|
|
139
139
|
}),
|
|
140
|
-
|
|
140
|
+
c && h && /* @__PURE__ */ Z("div", {
|
|
141
141
|
style: {
|
|
142
142
|
padding: "8px 14px",
|
|
143
143
|
borderTop: "1px solid var(--divider)",
|
|
@@ -145,7 +145,7 @@ function _e({ title: t, subtitle: n, right: r, badge: i, count: a, children: o,
|
|
|
145
145
|
fontSize: 11.5,
|
|
146
146
|
color: "var(--text-3)"
|
|
147
147
|
},
|
|
148
|
-
children:
|
|
148
|
+
children: c
|
|
149
149
|
})
|
|
150
150
|
]
|
|
151
151
|
});
|
|
@@ -175,7 +175,7 @@ function xe(e, t, n, r, i, a, o, s) {
|
|
|
175
175
|
let c = s ? JSON.stringify(Object.entries(s).sort()) : void 0;
|
|
176
176
|
return fe({
|
|
177
177
|
queryKey: [
|
|
178
|
-
|
|
178
|
+
P,
|
|
179
179
|
e,
|
|
180
180
|
t,
|
|
181
181
|
n,
|
|
@@ -195,7 +195,7 @@ function xe(e, t, n, r, i, a, o, s) {
|
|
|
195
195
|
op: "eq",
|
|
196
196
|
value: t
|
|
197
197
|
});
|
|
198
|
-
return c.set("filters", JSON.stringify(l)), i && c.set("sort", i), a && c.set("limit", String(a)), o && c.set("search", o), e && c.set("after", e),
|
|
198
|
+
return c.set("filters", JSON.stringify(l)), i && c.set("sort", i), a && c.set("limit", String(a)), o && c.set("search", o), e && c.set("after", e), W(`/api/data/${n}?${c.toString()}`);
|
|
199
199
|
},
|
|
200
200
|
getNextPageParam: (e) => e.meta?.has_more ? e.meta.cursor : void 0,
|
|
201
201
|
initialPageParam: void 0,
|
|
@@ -204,174 +204,174 @@ function xe(e, t, n, r, i, a, o, s) {
|
|
|
204
204
|
}
|
|
205
205
|
//#endregion
|
|
206
206
|
//#region src/components/actions/ActionButton.tsx
|
|
207
|
-
function Se({ actionCode:
|
|
208
|
-
let [
|
|
209
|
-
if (!(!
|
|
210
|
-
|
|
207
|
+
function Se({ actionCode: r, action: i, entityCode: a, objectIds: o = [], row: d, variant: f = "outline", size: m = "default", onSuccess: h }) {
|
|
208
|
+
let [_, y] = Y(!1), [b, x] = Y(!1), { data: S } = A(), C = ne(), { run: w } = M(), k = D(i), N = !d || p(i.conditions, d), P = K(async () => {
|
|
209
|
+
if (!(!i.association || o.length === 0)) {
|
|
210
|
+
y(!0);
|
|
211
211
|
try {
|
|
212
|
-
let e = a ? `${a}.${
|
|
213
|
-
if (!
|
|
214
|
-
|
|
212
|
+
let e = a ? `${a}.${i.association}` : i.association, t = await n(e, o), r = T(S, t.target_entity);
|
|
213
|
+
if (!r) {
|
|
214
|
+
v.error(`No list screen found for ${t.target_entity}`);
|
|
215
215
|
return;
|
|
216
216
|
}
|
|
217
|
-
let
|
|
217
|
+
let s = S?.entities[t.target_entity], c = O(i.display?.name) || t.target_entity;
|
|
218
218
|
if (t.ids.length === 0) {
|
|
219
|
-
|
|
219
|
+
v.info(`No related ${c} found`);
|
|
220
220
|
return;
|
|
221
221
|
}
|
|
222
|
-
let
|
|
223
|
-
|
|
224
|
-
title:
|
|
225
|
-
icon:
|
|
226
|
-
search:
|
|
227
|
-
}),
|
|
222
|
+
let l = s?.fields.names().find((e) => s.fields.get(e)?.primary) ?? "id", u = new URLSearchParams();
|
|
223
|
+
u.set(`filter_${l}`, t.ids.join(",")), C(r.route, {
|
|
224
|
+
title: c,
|
|
225
|
+
icon: i.display?.icon || r.icon,
|
|
226
|
+
search: u.toString()
|
|
227
|
+
}), h?.();
|
|
228
228
|
} catch (e) {
|
|
229
|
-
|
|
229
|
+
v.error(e instanceof Error ? e.message : "Failed to resolve association");
|
|
230
230
|
} finally {
|
|
231
|
-
|
|
231
|
+
y(!1);
|
|
232
232
|
}
|
|
233
233
|
}
|
|
234
234
|
}, [
|
|
235
|
-
|
|
235
|
+
i,
|
|
236
236
|
a,
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
]),
|
|
242
|
-
|
|
243
|
-
action:
|
|
244
|
-
title:
|
|
245
|
-
row:
|
|
237
|
+
o,
|
|
238
|
+
S,
|
|
239
|
+
C,
|
|
240
|
+
h
|
|
241
|
+
]), F = i.entity ? `${i.entity}.${r}` : r, I = o.length > 0 ? o : void 0, L = K(() => {
|
|
242
|
+
x(!0), w({
|
|
243
|
+
action: i,
|
|
244
|
+
title: O(i.display?.name) || r,
|
|
245
|
+
row: d,
|
|
246
246
|
entity: a,
|
|
247
|
-
execute: (e) =>
|
|
248
|
-
onSuccess: () =>
|
|
249
|
-
}).finally(() =>
|
|
247
|
+
execute: (e) => E(F, c(e, I)),
|
|
248
|
+
onSuccess: () => h?.()
|
|
249
|
+
}).finally(() => x(!1));
|
|
250
250
|
}, [
|
|
251
|
-
|
|
251
|
+
w,
|
|
252
|
+
i,
|
|
252
253
|
r,
|
|
253
|
-
|
|
254
|
-
l,
|
|
254
|
+
d,
|
|
255
255
|
a,
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
]), ee =
|
|
260
|
-
if (
|
|
261
|
-
|
|
256
|
+
F,
|
|
257
|
+
I,
|
|
258
|
+
h
|
|
259
|
+
]), ee = K(() => {
|
|
260
|
+
if (g(i)) {
|
|
261
|
+
l(i.ui_steps, { row: d }).then(() => h?.());
|
|
262
262
|
return;
|
|
263
263
|
}
|
|
264
|
-
if (
|
|
265
|
-
|
|
264
|
+
if (k) {
|
|
265
|
+
P();
|
|
266
266
|
return;
|
|
267
267
|
}
|
|
268
|
-
if (
|
|
269
|
-
let e = a ?
|
|
270
|
-
a && (
|
|
271
|
-
title:
|
|
272
|
-
icon:
|
|
273
|
-
}),
|
|
268
|
+
if (i.href && !i.handler && !i.association) {
|
|
269
|
+
let e = a ? S?.entities[a] : void 0, t = j(d, e), n = i.href;
|
|
270
|
+
a && (n = n.replaceAll("${entity}", a)), t && (n = n.replaceAll("${id}", encodeURIComponent(t))), C(n, {
|
|
271
|
+
title: O(i.display?.name) || r,
|
|
272
|
+
icon: i.display?.icon
|
|
273
|
+
}), h?.();
|
|
274
274
|
return;
|
|
275
275
|
}
|
|
276
|
-
|
|
276
|
+
L();
|
|
277
277
|
}, [
|
|
278
|
-
|
|
279
|
-
|
|
278
|
+
i,
|
|
279
|
+
d,
|
|
280
280
|
a,
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
O,
|
|
281
|
+
S?.entities,
|
|
282
|
+
r,
|
|
283
|
+
C,
|
|
284
|
+
k,
|
|
286
285
|
P,
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
286
|
+
L,
|
|
287
|
+
h
|
|
288
|
+
]), R = O(i.display?.name), z = i.display?.icon, B = z && e[z], V = B ? /* @__PURE__ */ Z(B, { size: 13 }) : z ? /* @__PURE__ */ Z(t, {
|
|
289
|
+
name: z,
|
|
290
290
|
size: 13
|
|
291
|
-
}) : null,
|
|
292
|
-
return
|
|
293
|
-
icon:
|
|
291
|
+
}) : null, H = !N || b || _;
|
|
292
|
+
return m === "icon" ? /* @__PURE__ */ Z(s, {
|
|
293
|
+
icon: V ?? /* @__PURE__ */ Z(e.bolt, { size: 13 }),
|
|
294
294
|
onClick: ee,
|
|
295
|
-
title:
|
|
296
|
-
}) : /* @__PURE__ */ Z(
|
|
297
|
-
kind:
|
|
295
|
+
title: R
|
|
296
|
+
}) : /* @__PURE__ */ Z(u, {
|
|
297
|
+
kind: f === "default" ? "primary" : f === "ghost" ? "ghost" : "default",
|
|
298
298
|
size: "sm",
|
|
299
|
-
icon:
|
|
300
|
-
danger:
|
|
299
|
+
icon: V,
|
|
300
|
+
danger: i.destructive,
|
|
301
301
|
onClick: ee,
|
|
302
|
-
disabled:
|
|
303
|
-
title:
|
|
304
|
-
"aria-label":
|
|
305
|
-
children:
|
|
302
|
+
disabled: H,
|
|
303
|
+
title: R,
|
|
304
|
+
"aria-label": R,
|
|
305
|
+
children: R
|
|
306
306
|
});
|
|
307
307
|
}
|
|
308
308
|
//#endregion
|
|
309
309
|
//#region src/components/actions/RowActionsKebab.tsx
|
|
310
|
-
function Ce({ actions: t, objectIds: n, row: r, entity: i, onSuccess: a, preMenu: o, divider:
|
|
311
|
-
let
|
|
310
|
+
function Ce({ actions: t, objectIds: n, row: r, entity: i, onSuccess: a, preMenu: o, divider: l, size: u = 22, align: d = "end" }) {
|
|
311
|
+
let f = J(null), [p, m] = Y(!1), [h, g] = Y(null), { run: v } = M(), y = q(() => {
|
|
312
312
|
let e = {};
|
|
313
313
|
for (let { code: n, action: r } of t) e[n] = r;
|
|
314
314
|
return e;
|
|
315
|
-
}, [t]),
|
|
315
|
+
}, [t]), b = q(() => {
|
|
316
316
|
let e = t.map(({ code: e }) => ({
|
|
317
317
|
kind: "action",
|
|
318
318
|
code: e,
|
|
319
319
|
enabled: !0,
|
|
320
320
|
reason: null
|
|
321
321
|
}));
|
|
322
|
-
return r ?
|
|
322
|
+
return r ? S(e, y, void 0, r, [], ae(i, r)) : e;
|
|
323
323
|
}, [
|
|
324
324
|
t,
|
|
325
|
-
|
|
325
|
+
y,
|
|
326
326
|
r,
|
|
327
327
|
i
|
|
328
|
-
]),
|
|
329
|
-
|
|
328
|
+
]), x = K((e, t) => {
|
|
329
|
+
m(!1);
|
|
330
330
|
let i = t.entity ? `${t.entity}.${e}` : e;
|
|
331
|
-
return
|
|
331
|
+
return v({
|
|
332
332
|
action: t,
|
|
333
|
-
title:
|
|
333
|
+
title: O(t.display?.name) || e,
|
|
334
334
|
row: r,
|
|
335
335
|
execute: async (e) => {
|
|
336
|
-
let t = await
|
|
336
|
+
let t = await E(i, c(e, n));
|
|
337
337
|
return a?.(), t;
|
|
338
338
|
}
|
|
339
339
|
});
|
|
340
340
|
}, [
|
|
341
|
-
|
|
341
|
+
v,
|
|
342
342
|
r,
|
|
343
343
|
n,
|
|
344
344
|
a
|
|
345
345
|
]);
|
|
346
|
-
return !o &&
|
|
346
|
+
return !o && b.length === 0 ? null : /* @__PURE__ */ Q("div", {
|
|
347
347
|
className: "sl-row-actions",
|
|
348
|
-
"data-open":
|
|
348
|
+
"data-open": p ? "true" : void 0,
|
|
349
349
|
style: {
|
|
350
350
|
display: "flex",
|
|
351
351
|
alignItems: "center",
|
|
352
352
|
justifyContent: "flex-end"
|
|
353
353
|
},
|
|
354
|
-
children: [/* @__PURE__ */ Z(
|
|
355
|
-
ref:
|
|
356
|
-
size:
|
|
357
|
-
icon: /* @__PURE__ */ Z(e.more, { size: Math.round(
|
|
358
|
-
onClick: () =>
|
|
354
|
+
children: [/* @__PURE__ */ Z(s, {
|
|
355
|
+
ref: f,
|
|
356
|
+
size: u,
|
|
357
|
+
icon: /* @__PURE__ */ Z(e.more, { size: Math.round(u * .55) }),
|
|
358
|
+
onClick: () => m((e) => !e),
|
|
359
359
|
title: "Actions"
|
|
360
|
-
}), /* @__PURE__ */ Q(
|
|
361
|
-
open:
|
|
362
|
-
anchor:
|
|
363
|
-
onClose: () =>
|
|
360
|
+
}), /* @__PURE__ */ Q(_, {
|
|
361
|
+
open: p,
|
|
362
|
+
anchor: f.current,
|
|
363
|
+
onClose: () => m(!1),
|
|
364
364
|
width: 200,
|
|
365
|
-
align:
|
|
365
|
+
align: d,
|
|
366
366
|
children: [
|
|
367
367
|
o,
|
|
368
|
-
o &&
|
|
369
|
-
/* @__PURE__ */ Z(
|
|
370
|
-
layout:
|
|
371
|
-
entityActions:
|
|
372
|
-
onRun:
|
|
373
|
-
loading:
|
|
374
|
-
onLoadingChange:
|
|
368
|
+
o && l && b.length > 0 && /* @__PURE__ */ Z(U, { divider: !0 }),
|
|
369
|
+
/* @__PURE__ */ Z(ie, {
|
|
370
|
+
layout: b,
|
|
371
|
+
entityActions: y,
|
|
372
|
+
onRun: x,
|
|
373
|
+
loading: h,
|
|
374
|
+
onLoadingChange: g,
|
|
375
375
|
row: r
|
|
376
376
|
})
|
|
377
377
|
]
|
|
@@ -380,30 +380,30 @@ function Ce({ actions: t, objectIds: n, row: r, entity: i, onSuccess: a, preMenu
|
|
|
380
380
|
}
|
|
381
381
|
//#endregion
|
|
382
382
|
//#region src/components/detail-layout/AssociatedToolbar.tsx
|
|
383
|
-
function we({ entity: t, searchable: n, filterFields: r, searchValue: i, onSearchChange: a, filters: o, onFilterChange: s, allEntities:
|
|
384
|
-
let
|
|
385
|
-
return !
|
|
383
|
+
function we({ entity: t, searchable: n, filterFields: r, searchValue: i, onSearchChange: a, filters: o, onFilterChange: s, allEntities: c }) {
|
|
384
|
+
let l = n === !0, u = r && r.length > 0;
|
|
385
|
+
return !l && !u ? null : /* @__PURE__ */ Q("div", {
|
|
386
386
|
style: {
|
|
387
387
|
display: "flex",
|
|
388
388
|
alignItems: "center",
|
|
389
389
|
gap: 6,
|
|
390
390
|
marginBottom: 8
|
|
391
391
|
},
|
|
392
|
-
children: [
|
|
392
|
+
children: [l && /* @__PURE__ */ Z("div", {
|
|
393
393
|
style: {
|
|
394
394
|
flex: 1,
|
|
395
395
|
maxWidth: 220
|
|
396
396
|
},
|
|
397
|
-
children: /* @__PURE__ */ Z(
|
|
397
|
+
children: /* @__PURE__ */ Z(te, {
|
|
398
398
|
value: i,
|
|
399
399
|
onChange: a,
|
|
400
400
|
placeholder: "Search…",
|
|
401
401
|
prefix: /* @__PURE__ */ Z(e.search, { size: 12 })
|
|
402
402
|
})
|
|
403
|
-
}),
|
|
403
|
+
}), u && r.map((e) => {
|
|
404
404
|
let n = t.fields.get(e);
|
|
405
405
|
if (!n) return null;
|
|
406
|
-
let r = o[e] ?? "__all__", i =
|
|
406
|
+
let r = o[e] ?? "__all__", i = d(n, e, c);
|
|
407
407
|
if (n.type === "ref" && n.ref?.entity) return /* @__PURE__ */ Z(Te, {
|
|
408
408
|
field: n,
|
|
409
409
|
label: i,
|
|
@@ -416,11 +416,11 @@ function we({ entity: t, searchable: n, filterFields: r, searchValue: i, onSearc
|
|
|
416
416
|
label: `All ${i}`
|
|
417
417
|
}, ...n.values.map((e) => ({
|
|
418
418
|
value: e.code,
|
|
419
|
-
label:
|
|
419
|
+
label: O(e.name) || e.code
|
|
420
420
|
}))];
|
|
421
421
|
return /* @__PURE__ */ Z("div", {
|
|
422
422
|
style: { width: 160 },
|
|
423
|
-
children: /* @__PURE__ */ Z(
|
|
423
|
+
children: /* @__PURE__ */ Z(V, {
|
|
424
424
|
value: r,
|
|
425
425
|
options: a,
|
|
426
426
|
onChange: (t) => s(e, t),
|
|
@@ -431,31 +431,31 @@ function we({ entity: t, searchable: n, filterFields: r, searchValue: i, onSearc
|
|
|
431
431
|
});
|
|
432
432
|
}
|
|
433
433
|
function Te({ field: e, label: t, value: n, onChange: r }) {
|
|
434
|
-
let
|
|
434
|
+
let a = H(e.ref?.entity), o = e.display?.ref_display_field ?? a?.display?.display_field, s = q(() => a ? [...a.fields].find(([, e]) => e.primary)?.[0] ?? "id" : "id", [a]), { data: c } = x(e.ref?.entity, {
|
|
435
435
|
per_page: 200,
|
|
436
|
-
sort:
|
|
437
|
-
}),
|
|
436
|
+
sort: o ? `${o}:asc` : void 0
|
|
437
|
+
}), l = c?.data ?? [], u = (e) => {
|
|
438
438
|
if (e == null) return "—";
|
|
439
439
|
if (typeof e == "object" && !Array.isArray(e)) {
|
|
440
440
|
let t = Object.values(e)[0];
|
|
441
|
-
return t == null ? "—" :
|
|
441
|
+
return t == null ? "—" : F(t);
|
|
442
442
|
}
|
|
443
|
-
return
|
|
444
|
-
},
|
|
443
|
+
return F(e);
|
|
444
|
+
}, d = [{
|
|
445
445
|
value: "__all__",
|
|
446
446
|
label: `All ${t}`
|
|
447
|
-
}, ...
|
|
448
|
-
let t = String(e[
|
|
447
|
+
}, ...l.map((e) => {
|
|
448
|
+
let t = String(e[s]), n = e[i];
|
|
449
449
|
return {
|
|
450
450
|
value: t,
|
|
451
|
-
label: typeof n == "string" && n !== "" ? n :
|
|
451
|
+
label: typeof n == "string" && n !== "" ? n : o ? u(e[o] ?? t) : t
|
|
452
452
|
};
|
|
453
453
|
})];
|
|
454
454
|
return /* @__PURE__ */ Z("div", {
|
|
455
455
|
style: { width: 160 },
|
|
456
|
-
children: /* @__PURE__ */ Z(
|
|
456
|
+
children: /* @__PURE__ */ Z(V, {
|
|
457
457
|
value: n,
|
|
458
|
-
options:
|
|
458
|
+
options: d,
|
|
459
459
|
onChange: r,
|
|
460
460
|
placeholder: t
|
|
461
461
|
})
|
|
@@ -466,7 +466,7 @@ function Te({ field: e, label: t, value: n, onChange: r }) {
|
|
|
466
466
|
function Ee(e) {
|
|
467
467
|
if (!e) return [];
|
|
468
468
|
let t = [];
|
|
469
|
-
for (let [n, r] of Object.entries(e)) (r.visibility ?? []).includes("list_row") && (r.association ||
|
|
469
|
+
for (let [n, r] of Object.entries(e)) (r.visibility ?? []).includes("list_row") && (r.association || b(n) || t.push({
|
|
470
470
|
code: n,
|
|
471
471
|
action: r
|
|
472
472
|
}));
|
|
@@ -475,20 +475,20 @@ function Ee(e) {
|
|
|
475
475
|
function De(e, t, n) {
|
|
476
476
|
if (!e) return [];
|
|
477
477
|
let r = [];
|
|
478
|
-
for (let [i,
|
|
479
|
-
if (!(
|
|
478
|
+
for (let [i, a] of Object.entries(e)) {
|
|
479
|
+
if (!(a.visibility ?? []).includes("list_toolbar") || a.association || i.startsWith("__")) continue;
|
|
480
480
|
let e = {
|
|
481
|
-
...
|
|
481
|
+
...a,
|
|
482
482
|
resolved_hidden_defaults: {
|
|
483
|
-
...
|
|
483
|
+
...a.resolved_hidden_defaults ?? {},
|
|
484
484
|
[t]: n
|
|
485
485
|
}
|
|
486
486
|
};
|
|
487
|
-
if (
|
|
488
|
-
let n =
|
|
487
|
+
if (a.resolved_params?.has(t)) {
|
|
488
|
+
let n = a.resolved_params.items().filter((e) => e.name !== t);
|
|
489
489
|
e = {
|
|
490
490
|
...e,
|
|
491
|
-
resolved_params: new
|
|
491
|
+
resolved_params: new B(n)
|
|
492
492
|
};
|
|
493
493
|
}
|
|
494
494
|
r.push({
|
|
@@ -521,7 +521,7 @@ function Oe(e, t, n) {
|
|
|
521
521
|
return null;
|
|
522
522
|
}
|
|
523
523
|
function ke(e, t, n) {
|
|
524
|
-
let r = new Set(
|
|
524
|
+
let r = new Set(w(e));
|
|
525
525
|
return new Set(t.filter((t) => {
|
|
526
526
|
if (t === n || r.has(t)) return !1;
|
|
527
527
|
let i = e.fields.get(t);
|
|
@@ -578,60 +578,60 @@ function Me({ node: e, ctx: t }) {
|
|
|
578
578
|
]
|
|
579
579
|
});
|
|
580
580
|
}
|
|
581
|
-
function Ne({ node: n, ctx:
|
|
582
|
-
let
|
|
583
|
-
if (e ===
|
|
584
|
-
let t =
|
|
581
|
+
function Ne({ node: n, ctx: r, assocCode: i, assocEntity: a, fkField: o }) {
|
|
582
|
+
let s = n.columns && n.columns.length > 0 ? n.columns.filter((e) => e !== o && !!a.fields.get(e)) : a.fields.names().filter((e) => {
|
|
583
|
+
if (e === o) return !1;
|
|
584
|
+
let t = a.fields.get(e);
|
|
585
585
|
return !(!t || t.primary || t.display?.is_listable === !1);
|
|
586
|
-
}),
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
586
|
+
}), l = m(a, "update"), d = n.interaction ?? (l ? "navigate" : "readonly"), f = (d === "inline_edit" || d === "row_edit") && l && n.editable !== !1, p = O(a.display?.name_plural) || O(a.display?.name) || i, h = n.searchable === !0 || n.filters && n.filters.length > 0, g = q(() => De(a.actions, o, r.recordId), [
|
|
587
|
+
a.actions,
|
|
588
|
+
o,
|
|
589
|
+
r.recordId
|
|
590
590
|
]), _ = q(() => {
|
|
591
591
|
let e = {};
|
|
592
|
-
for (let { code: t, action: n } of
|
|
592
|
+
for (let { code: t, action: n } of g) e[t] = n;
|
|
593
593
|
return e;
|
|
594
|
-
}, [
|
|
595
|
-
let e =
|
|
596
|
-
return
|
|
597
|
-
}, [
|
|
598
|
-
entity:
|
|
599
|
-
entityCode:
|
|
594
|
+
}, [g]), v = q(() => {
|
|
595
|
+
let e = a.action_layout ?? null;
|
|
596
|
+
return S(e ?? C(_, "list_toolbar"), _, void 0, {}, []);
|
|
597
|
+
}, [a.action_layout, _]), { run: y } = M(), b = ne(), x = I(), w = q(() => ({
|
|
598
|
+
entity: a,
|
|
599
|
+
entityCode: i,
|
|
600
600
|
screenRoute: typeof window < "u" ? window.location.pathname : "",
|
|
601
601
|
selectedRows: [],
|
|
602
602
|
selectedIds: [],
|
|
603
|
-
locale:
|
|
603
|
+
locale: x,
|
|
604
604
|
tabNavigate: (e, t) => b(e, {
|
|
605
605
|
title: t?.title,
|
|
606
606
|
icon: t?.icon,
|
|
607
607
|
search: t?.search
|
|
608
608
|
}),
|
|
609
|
-
runActionApi: (e, t) =>
|
|
609
|
+
runActionApi: (e, t) => E(e, t)
|
|
610
610
|
}), [
|
|
611
|
-
o,
|
|
612
611
|
a,
|
|
613
|
-
|
|
612
|
+
i,
|
|
613
|
+
x,
|
|
614
614
|
b
|
|
615
|
-
]), T = X(),
|
|
615
|
+
]), T = X(), D = K(() => {
|
|
616
616
|
T.invalidateQueries({ predicate: (e) => {
|
|
617
617
|
let t = e.queryKey;
|
|
618
|
-
return t[0] === "entity-children" && t[3] ===
|
|
618
|
+
return t[0] === "entity-children" && t[3] === i;
|
|
619
619
|
} });
|
|
620
|
-
}, [T,
|
|
621
|
-
let n =
|
|
620
|
+
}, [T, i]), k = K((e, t) => {
|
|
621
|
+
let n = oe(e, t, {}, i);
|
|
622
622
|
if (n !== null) return y({
|
|
623
623
|
action: t,
|
|
624
|
-
title:
|
|
624
|
+
title: O(t.display?.name) || e,
|
|
625
625
|
execute: async (e) => {
|
|
626
|
-
let t = await
|
|
627
|
-
return
|
|
626
|
+
let t = await E(n, c(e, void 0));
|
|
627
|
+
return D(), t;
|
|
628
628
|
}
|
|
629
629
|
});
|
|
630
630
|
}, [
|
|
631
631
|
y,
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
]), [
|
|
632
|
+
i,
|
|
633
|
+
D
|
|
634
|
+
]), [A, j] = Y(0), N = /* @__PURE__ */ Q("div", {
|
|
635
635
|
style: {
|
|
636
636
|
display: "flex",
|
|
637
637
|
alignItems: "center",
|
|
@@ -640,55 +640,55 @@ function Ne({ node: n, ctx: i, assocCode: a, assocEntity: o, fkField: s }) {
|
|
|
640
640
|
minWidth: 0,
|
|
641
641
|
justifyContent: "flex-end"
|
|
642
642
|
},
|
|
643
|
-
children: [
|
|
643
|
+
children: [a.action_layout ? v.length > 0 && /* @__PURE__ */ Z(re, {
|
|
644
644
|
kind: "toolbar",
|
|
645
645
|
layout: v,
|
|
646
646
|
entityActions: _,
|
|
647
|
-
onRun:
|
|
648
|
-
widgetContext:
|
|
647
|
+
onRun: k,
|
|
648
|
+
widgetContext: w,
|
|
649
649
|
ariaLabel: `${p} toolbar actions`
|
|
650
|
-
}) :
|
|
650
|
+
}) : g.map(({ code: e, action: t }) => /* @__PURE__ */ Z(Se, {
|
|
651
651
|
actionCode: e,
|
|
652
652
|
action: t,
|
|
653
|
-
entityCode:
|
|
653
|
+
entityCode: i,
|
|
654
654
|
variant: "ghost",
|
|
655
655
|
size: "sm",
|
|
656
|
-
onSuccess:
|
|
657
|
-
}, e)), f && /* @__PURE__ */ Z(
|
|
656
|
+
onSuccess: D
|
|
657
|
+
}, e)), f && /* @__PURE__ */ Z(u, {
|
|
658
658
|
kind: "ghost",
|
|
659
659
|
size: "xs",
|
|
660
660
|
icon: /* @__PURE__ */ Z(e.plus, { size: 12 }),
|
|
661
|
-
onClick: () =>
|
|
661
|
+
onClick: () => j((e) => e + 1),
|
|
662
662
|
children: "Add row"
|
|
663
663
|
})]
|
|
664
|
-
}), P =
|
|
665
|
-
entityCode:
|
|
666
|
-
entity:
|
|
667
|
-
parentEntity:
|
|
668
|
-
parentId:
|
|
669
|
-
foreignKey:
|
|
670
|
-
columns:
|
|
664
|
+
}), P = h ? /* @__PURE__ */ Z(Fe, {
|
|
665
|
+
entityCode: i,
|
|
666
|
+
entity: a,
|
|
667
|
+
parentEntity: r.entityCode,
|
|
668
|
+
parentId: r.recordId,
|
|
669
|
+
foreignKey: o,
|
|
670
|
+
columns: s,
|
|
671
671
|
editable: f,
|
|
672
672
|
interaction: d,
|
|
673
|
-
ctx:
|
|
673
|
+
ctx: r,
|
|
674
674
|
searchable: n.searchable,
|
|
675
675
|
filterFields: n.filters,
|
|
676
676
|
sort: n.sort,
|
|
677
|
-
startDraftSignal:
|
|
677
|
+
startDraftSignal: A
|
|
678
678
|
}) : /* @__PURE__ */ Z(Pe, {
|
|
679
|
-
entityCode:
|
|
680
|
-
entity:
|
|
681
|
-
parentEntity:
|
|
682
|
-
parentId:
|
|
683
|
-
foreignKey:
|
|
684
|
-
columns:
|
|
679
|
+
entityCode: i,
|
|
680
|
+
entity: a,
|
|
681
|
+
parentEntity: r.entityCode,
|
|
682
|
+
parentId: r.recordId,
|
|
683
|
+
foreignKey: o,
|
|
684
|
+
columns: s,
|
|
685
685
|
editable: f,
|
|
686
686
|
interaction: d,
|
|
687
|
-
ctx:
|
|
687
|
+
ctx: r,
|
|
688
688
|
sort: n.sort,
|
|
689
|
-
startDraftSignal:
|
|
689
|
+
startDraftSignal: A
|
|
690
690
|
});
|
|
691
|
-
return
|
|
691
|
+
return r.withinCard ? /* @__PURE__ */ Q("div", { children: [/* @__PURE__ */ Z("div", {
|
|
692
692
|
style: {
|
|
693
693
|
display: "flex",
|
|
694
694
|
justifyContent: "flex-end",
|
|
@@ -697,54 +697,54 @@ function Ne({ node: n, ctx: i, assocCode: a, assocEntity: o, fkField: s }) {
|
|
|
697
697
|
children: N
|
|
698
698
|
}), P] }) : /* @__PURE__ */ Z(_e, {
|
|
699
699
|
title: p,
|
|
700
|
-
icon:
|
|
701
|
-
name:
|
|
700
|
+
icon: a.display?.icon ? /* @__PURE__ */ Z(t, {
|
|
701
|
+
name: a.display.icon,
|
|
702
702
|
size: 14
|
|
703
703
|
}) : void 0,
|
|
704
704
|
right: N,
|
|
705
705
|
children: P
|
|
706
706
|
});
|
|
707
707
|
}
|
|
708
|
-
function Pe({ entityCode: e, entity: t, parentEntity: n, parentId:
|
|
709
|
-
let
|
|
710
|
-
|
|
711
|
-
|
|
708
|
+
function Pe({ entityCode: e, entity: t, parentEntity: n, parentId: i, foreignKey: a, columns: o, editable: s, interaction: c, ctx: l, sort: u, startDraftSignal: d }) {
|
|
709
|
+
let f = X(), { data: p, isLoading: m, isError: h } = r(n, i, e, a, u), g = p?.data ?? [], _ = p?.$refs, v = K(() => {
|
|
710
|
+
f.invalidateQueries({ queryKey: [
|
|
711
|
+
P,
|
|
712
712
|
n,
|
|
713
|
-
|
|
713
|
+
i,
|
|
714
714
|
e
|
|
715
715
|
] });
|
|
716
716
|
}, [
|
|
717
|
-
|
|
717
|
+
f,
|
|
718
718
|
n,
|
|
719
|
-
|
|
719
|
+
i,
|
|
720
720
|
e
|
|
721
721
|
]);
|
|
722
722
|
return /* @__PURE__ */ Z(Ie, {
|
|
723
723
|
entityCode: e,
|
|
724
724
|
entity: t,
|
|
725
|
-
parentId:
|
|
726
|
-
foreignKey:
|
|
727
|
-
columns:
|
|
728
|
-
editable:
|
|
729
|
-
interaction:
|
|
730
|
-
ctx:
|
|
731
|
-
rows:
|
|
732
|
-
refs:
|
|
733
|
-
isLoading:
|
|
734
|
-
isError:
|
|
735
|
-
invalidateQuery:
|
|
736
|
-
startDraftSignal:
|
|
725
|
+
parentId: i,
|
|
726
|
+
foreignKey: a,
|
|
727
|
+
columns: o,
|
|
728
|
+
editable: s,
|
|
729
|
+
interaction: c,
|
|
730
|
+
ctx: l,
|
|
731
|
+
rows: g,
|
|
732
|
+
refs: _,
|
|
733
|
+
isLoading: m,
|
|
734
|
+
isError: h,
|
|
735
|
+
invalidateQuery: v,
|
|
736
|
+
startDraftSignal: d
|
|
737
737
|
});
|
|
738
738
|
}
|
|
739
|
-
function Fe({ entityCode: e, entity: t, parentEntity:
|
|
740
|
-
let
|
|
741
|
-
|
|
742
|
-
|
|
739
|
+
function Fe({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey: i, columns: o, editable: s, interaction: c, ctx: l, searchable: d, filterFields: f, sort: p, startDraftSignal: m }) {
|
|
740
|
+
let h = X(), [g, _] = Y(""), [v, y] = Y(""), [b, x] = Y({}), S = J(void 0);
|
|
741
|
+
ue(() => (S.current && clearTimeout(S.current), S.current = setTimeout(() => {
|
|
742
|
+
y(g);
|
|
743
743
|
}, 300), () => {
|
|
744
|
-
|
|
745
|
-
}), [
|
|
746
|
-
let
|
|
747
|
-
|
|
744
|
+
S.current && clearTimeout(S.current);
|
|
745
|
+
}), [g]);
|
|
746
|
+
let C = K((e, t) => {
|
|
747
|
+
x((n) => {
|
|
748
748
|
if (t === "__all__") {
|
|
749
749
|
let { [e]: t, ...r } = n;
|
|
750
750
|
return r;
|
|
@@ -754,13 +754,13 @@ function Fe({ entityCode: e, entity: t, parentEntity: r, parentId: i, foreignKey
|
|
|
754
754
|
[e]: t
|
|
755
755
|
};
|
|
756
756
|
});
|
|
757
|
-
}, []),
|
|
758
|
-
if (!
|
|
757
|
+
}, []), w = q(() => Object.keys(b).length > 0 ? b : void 0, [b]), { data: T, isLoading: E, isError: D, hasNextPage: O, fetchNextPage: k, isFetchingNextPage: A } = xe(n, r, e, i, p, void 0, v || void 0, w), { rows: j, refs: M } = q(() => {
|
|
758
|
+
if (!T?.pages) return {
|
|
759
759
|
rows: [],
|
|
760
760
|
refs: void 0
|
|
761
761
|
};
|
|
762
762
|
let e = [], t;
|
|
763
|
-
for (let n of
|
|
763
|
+
for (let n of T.pages) if (e.push(...n.data), n.$refs) {
|
|
764
764
|
if (!t) t = { ...n.$refs };
|
|
765
765
|
else for (let [e, r] of Object.entries(n.$refs)) t[e] = {
|
|
766
766
|
...t[e],
|
|
@@ -771,58 +771,58 @@ function Fe({ entityCode: e, entity: t, parentEntity: r, parentId: i, foreignKey
|
|
|
771
771
|
rows: e,
|
|
772
772
|
refs: t
|
|
773
773
|
};
|
|
774
|
-
}, [
|
|
775
|
-
|
|
774
|
+
}, [T]), N = K(() => {
|
|
775
|
+
h.invalidateQueries({ predicate: (t) => {
|
|
776
776
|
let n = t.queryKey;
|
|
777
777
|
return n[0] === "entity-children" && n[3] === e;
|
|
778
778
|
} });
|
|
779
|
-
}, [
|
|
779
|
+
}, [h, e]);
|
|
780
780
|
return /* @__PURE__ */ Q("div", { children: [
|
|
781
781
|
/* @__PURE__ */ Z(we, {
|
|
782
782
|
entity: t,
|
|
783
|
-
searchable:
|
|
784
|
-
filterFields:
|
|
785
|
-
searchValue:
|
|
786
|
-
onSearchChange:
|
|
787
|
-
filters:
|
|
788
|
-
onFilterChange:
|
|
783
|
+
searchable: d,
|
|
784
|
+
filterFields: f,
|
|
785
|
+
searchValue: g,
|
|
786
|
+
onSearchChange: _,
|
|
787
|
+
filters: b,
|
|
788
|
+
onFilterChange: C,
|
|
789
789
|
allEntities: l.schema.entities
|
|
790
790
|
}),
|
|
791
791
|
/* @__PURE__ */ Z(Ie, {
|
|
792
792
|
entityCode: e,
|
|
793
793
|
entity: t,
|
|
794
|
-
parentId:
|
|
795
|
-
foreignKey:
|
|
794
|
+
parentId: r,
|
|
795
|
+
foreignKey: i,
|
|
796
796
|
columns: o,
|
|
797
797
|
editable: s,
|
|
798
798
|
interaction: c,
|
|
799
799
|
ctx: l,
|
|
800
800
|
rows: j,
|
|
801
801
|
refs: M,
|
|
802
|
-
isLoading:
|
|
803
|
-
isError:
|
|
802
|
+
isLoading: E,
|
|
803
|
+
isError: D,
|
|
804
804
|
invalidateQuery: N,
|
|
805
|
-
startDraftSignal:
|
|
805
|
+
startDraftSignal: m
|
|
806
806
|
}),
|
|
807
|
-
|
|
807
|
+
O && /* @__PURE__ */ Z("div", {
|
|
808
808
|
style: { marginTop: 4 },
|
|
809
|
-
children: /* @__PURE__ */ Z(
|
|
809
|
+
children: /* @__PURE__ */ Z(u, {
|
|
810
810
|
kind: "ghost",
|
|
811
811
|
size: "xs",
|
|
812
|
-
icon: A ? /* @__PURE__ */ Z(
|
|
813
|
-
onClick: () =>
|
|
812
|
+
icon: A ? /* @__PURE__ */ Z(a, { size: 12 }) : void 0,
|
|
813
|
+
onClick: () => k(),
|
|
814
814
|
disabled: A,
|
|
815
815
|
children: "Load more"
|
|
816
816
|
})
|
|
817
817
|
})
|
|
818
818
|
] });
|
|
819
819
|
}
|
|
820
|
-
function Ie({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i, editable: a, interaction:
|
|
821
|
-
let
|
|
822
|
-
|
|
820
|
+
function Ie({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i, editable: a, interaction: s, ctx: c, rows: l, refs: u, isLoading: p, isError: m, invalidateQuery: g, startDraftSignal: _ }) {
|
|
821
|
+
let v = o(), y = v.isPhone && c.relatedRecordsPresentation === "table", b = i.find((e) => e !== r), x = q(() => s === "navigate" ? R(void 0, t, c.schema.screens) : null, [
|
|
822
|
+
s,
|
|
823
823
|
t,
|
|
824
|
-
|
|
825
|
-
]),
|
|
824
|
+
c.schema.screens
|
|
825
|
+
]), S = q(() => a ? ke(t, i, r) : /* @__PURE__ */ new Set(), [
|
|
826
826
|
i,
|
|
827
827
|
r,
|
|
828
828
|
t,
|
|
@@ -833,29 +833,29 @@ function Ie({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
|
|
|
833
833
|
t
|
|
834
834
|
]), w = q(() => {
|
|
835
835
|
let e = /* @__PURE__ */ new Map();
|
|
836
|
-
for (let n of
|
|
837
|
-
let r =
|
|
838
|
-
e.set(
|
|
836
|
+
for (let n of l) {
|
|
837
|
+
let r = L(t, n);
|
|
838
|
+
e.set(f(r), r);
|
|
839
839
|
}
|
|
840
840
|
return e;
|
|
841
|
-
}, [
|
|
841
|
+
}, [l, t]), T = q(() => {
|
|
842
842
|
let e = /* @__PURE__ */ new Map();
|
|
843
|
-
for (let n of
|
|
843
|
+
for (let n of l) {
|
|
844
844
|
let r = n.$row_version;
|
|
845
|
-
typeof r == "string" && r !== "" && e.set(
|
|
845
|
+
typeof r == "string" && r !== "" && e.set(f(L(t, n)), r);
|
|
846
846
|
}
|
|
847
847
|
return e;
|
|
848
|
-
}, [
|
|
849
|
-
|
|
850
|
-
let
|
|
851
|
-
|
|
852
|
-
let e =
|
|
848
|
+
}, [l, t]), E = q(() => Ee(t.actions), [t.actions]), [D, k] = Y(null), [A, j] = Y(null), [P, F] = Y([]), [I, z] = Y({}), B = J(I);
|
|
849
|
+
B.current = I;
|
|
850
|
+
let V = J({});
|
|
851
|
+
ue(() => {
|
|
852
|
+
let e = V.current;
|
|
853
853
|
return () => {
|
|
854
854
|
for (let t of Object.values(e)) clearTimeout(t);
|
|
855
855
|
};
|
|
856
856
|
}, []);
|
|
857
|
-
let [
|
|
858
|
-
|
|
857
|
+
let [H, U] = Y(null), [te, W] = Y([]), [ne, re] = Y(!1), { run: ie } = M(), [ae, oe] = Y(/* @__PURE__ */ new Set()), G = K(async (t, n, r) => {
|
|
858
|
+
z((e) => ({
|
|
859
859
|
...e,
|
|
860
860
|
[t]: {
|
|
861
861
|
...e[t],
|
|
@@ -868,7 +868,7 @@ function Ie({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
|
|
|
868
868
|
...n,
|
|
869
869
|
$row_version: i
|
|
870
870
|
} : n;
|
|
871
|
-
return await
|
|
871
|
+
return await N(e, w.get(t) ?? t, a), z((e) => {
|
|
872
872
|
let n = e[t];
|
|
873
873
|
if (!n) return e;
|
|
874
874
|
if (n.ver > r) return {
|
|
@@ -880,10 +880,10 @@ function Ie({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
|
|
|
880
880
|
};
|
|
881
881
|
let { [t]: i, ...a } = e;
|
|
882
882
|
return a;
|
|
883
|
-
}),
|
|
883
|
+
}), g(), !0;
|
|
884
884
|
} catch (e) {
|
|
885
885
|
let n = e instanceof Error ? e.message : "Save failed";
|
|
886
|
-
return
|
|
886
|
+
return z((e) => ({
|
|
887
887
|
...e,
|
|
888
888
|
[t]: {
|
|
889
889
|
...e[t],
|
|
@@ -894,11 +894,11 @@ function Ie({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
|
|
|
894
894
|
}
|
|
895
895
|
}, [
|
|
896
896
|
e,
|
|
897
|
-
|
|
897
|
+
g,
|
|
898
898
|
w,
|
|
899
899
|
T
|
|
900
|
-
]),
|
|
901
|
-
|
|
900
|
+
]), le = K((e, t, n) => {
|
|
901
|
+
z((r) => {
|
|
902
902
|
let i = r[e] ?? {
|
|
903
903
|
buffer: {},
|
|
904
904
|
ver: 0,
|
|
@@ -915,112 +915,112 @@ function Ie({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
|
|
|
915
915
|
ver: a
|
|
916
916
|
}
|
|
917
917
|
};
|
|
918
|
-
}),
|
|
919
|
-
let t =
|
|
920
|
-
t && Object.keys(t.buffer).length > 0 &&
|
|
918
|
+
}), s === "inline_edit" && (V.current[e] && clearTimeout(V.current[e]), V.current[e] = setTimeout(() => {
|
|
919
|
+
let t = B.current[e];
|
|
920
|
+
t && Object.keys(t.buffer).length > 0 && G(e, { ...t.buffer }, t.ver);
|
|
921
921
|
}, 500));
|
|
922
|
-
}, [
|
|
922
|
+
}, [G, s]), de = K(() => {
|
|
923
923
|
let e = {};
|
|
924
924
|
e[r] = n;
|
|
925
925
|
for (let n of i) {
|
|
926
926
|
let r = t.fields.get(n);
|
|
927
927
|
r && (r.default === void 0 ? r.type === "bool" && (e[n] = !1) : e[n] = r.default);
|
|
928
928
|
}
|
|
929
|
-
|
|
929
|
+
U(e), W([]);
|
|
930
930
|
}, [
|
|
931
931
|
r,
|
|
932
932
|
n,
|
|
933
933
|
i,
|
|
934
934
|
t.fields
|
|
935
|
-
]), fe = J(
|
|
936
|
-
|
|
937
|
-
|
|
935
|
+
]), fe = J(_);
|
|
936
|
+
ue(() => {
|
|
937
|
+
_ !== void 0 && _ !== fe.current && (fe.current = _, !H && de());
|
|
938
938
|
}, [
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
939
|
+
_,
|
|
940
|
+
H,
|
|
941
|
+
de
|
|
942
942
|
]);
|
|
943
|
-
let pe =
|
|
944
|
-
if (!
|
|
945
|
-
let n = je(
|
|
943
|
+
let pe = K(async () => {
|
|
944
|
+
if (!H) return;
|
|
945
|
+
let n = je(H, i, t, r);
|
|
946
946
|
if (n.length > 0) {
|
|
947
|
-
|
|
947
|
+
W(n);
|
|
948
948
|
return;
|
|
949
949
|
}
|
|
950
|
-
|
|
950
|
+
re(!0);
|
|
951
951
|
try {
|
|
952
|
-
await
|
|
952
|
+
await h(e, H), U(null), W([]), g();
|
|
953
953
|
} catch (e) {
|
|
954
954
|
let t = e instanceof Error ? e.message : "Create failed";
|
|
955
|
-
|
|
955
|
+
W([`_error:${t}`]);
|
|
956
956
|
} finally {
|
|
957
|
-
|
|
957
|
+
re(!1);
|
|
958
958
|
}
|
|
959
959
|
}, [
|
|
960
|
-
|
|
960
|
+
H,
|
|
961
961
|
i,
|
|
962
962
|
t,
|
|
963
963
|
r,
|
|
964
964
|
e,
|
|
965
|
-
|
|
966
|
-
]), X =
|
|
967
|
-
|
|
968
|
-
}, []), me =
|
|
969
|
-
let n =
|
|
965
|
+
g
|
|
966
|
+
]), X = K((e) => {
|
|
967
|
+
z({}), F([]), j(e);
|
|
968
|
+
}, []), me = K(async (e) => {
|
|
969
|
+
let n = B.current[e], a = n?.buffer ?? {};
|
|
970
970
|
if (Object.keys(a).length === 0) {
|
|
971
|
-
|
|
971
|
+
j(null), F([]);
|
|
972
972
|
return;
|
|
973
973
|
}
|
|
974
974
|
let o = je({
|
|
975
|
-
...
|
|
975
|
+
...l.find((n) => f(L(t, n)) === e) ?? {},
|
|
976
976
|
...a
|
|
977
977
|
}, i, t, r);
|
|
978
978
|
if (o.length > 0) {
|
|
979
|
-
|
|
979
|
+
F(o);
|
|
980
980
|
return;
|
|
981
981
|
}
|
|
982
|
-
await
|
|
982
|
+
await G(e, { ...a }, n?.ver ?? 0) && (j(null), F([]));
|
|
983
983
|
}, [
|
|
984
|
-
|
|
984
|
+
l,
|
|
985
985
|
t,
|
|
986
986
|
i,
|
|
987
987
|
r,
|
|
988
|
-
|
|
989
|
-
]), he =
|
|
990
|
-
|
|
988
|
+
G
|
|
989
|
+
]), he = K((e) => {
|
|
990
|
+
z((t) => {
|
|
991
991
|
if (!t[e]) return t;
|
|
992
992
|
let { [e]: n, ...r } = t;
|
|
993
993
|
return r;
|
|
994
|
-
}),
|
|
995
|
-
}, []), ge =
|
|
994
|
+
}), F([]), j(null);
|
|
995
|
+
}, []), ge = K((n, r) => {
|
|
996
996
|
let i = w.get(n) ?? n;
|
|
997
|
-
return
|
|
997
|
+
return ie({
|
|
998
998
|
action: t.actions?.__delete,
|
|
999
999
|
destructive: !0,
|
|
1000
|
-
title:
|
|
1000
|
+
title: O(t.display?.name) || "Delete",
|
|
1001
1001
|
row: r,
|
|
1002
1002
|
entity: e,
|
|
1003
1003
|
execute: async () => {
|
|
1004
|
-
|
|
1004
|
+
oe((e) => new Set(e).add(n));
|
|
1005
1005
|
try {
|
|
1006
|
-
return await
|
|
1006
|
+
return await ee(e, i);
|
|
1007
1007
|
} finally {
|
|
1008
|
-
|
|
1008
|
+
oe((e) => {
|
|
1009
1009
|
let t = new Set(e);
|
|
1010
1010
|
return t.delete(n), t;
|
|
1011
1011
|
});
|
|
1012
1012
|
}
|
|
1013
1013
|
},
|
|
1014
|
-
onSuccess: () =>
|
|
1014
|
+
onSuccess: () => g()
|
|
1015
1015
|
});
|
|
1016
1016
|
}, [
|
|
1017
|
-
|
|
1017
|
+
ie,
|
|
1018
1018
|
t,
|
|
1019
1019
|
e,
|
|
1020
|
-
|
|
1020
|
+
g,
|
|
1021
1021
|
w
|
|
1022
1022
|
]);
|
|
1023
|
-
if (
|
|
1023
|
+
if (m) return /* @__PURE__ */ Z("div", {
|
|
1024
1024
|
style: {
|
|
1025
1025
|
fontSize: 12.5,
|
|
1026
1026
|
color: "var(--danger)",
|
|
@@ -1028,7 +1028,7 @@ function Ie({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
|
|
|
1028
1028
|
},
|
|
1029
1029
|
children: "Failed to load."
|
|
1030
1030
|
});
|
|
1031
|
-
if (
|
|
1031
|
+
if (p) return /* @__PURE__ */ Q("div", {
|
|
1032
1032
|
style: {
|
|
1033
1033
|
display: "flex",
|
|
1034
1034
|
flexDirection: "column",
|
|
@@ -1045,8 +1045,8 @@ function Ie({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
|
|
|
1045
1045
|
borderRadius: 6
|
|
1046
1046
|
} })]
|
|
1047
1047
|
});
|
|
1048
|
-
let $ =
|
|
1049
|
-
return
|
|
1048
|
+
let $ = l.length === 0 && !H;
|
|
1049
|
+
return v.isPhone && !y ? /* @__PURE__ */ Q("div", { children: [$ && !a && /* @__PURE__ */ Z("div", {
|
|
1050
1050
|
style: {
|
|
1051
1051
|
fontSize: 12.5,
|
|
1052
1052
|
color: "var(--text-3)",
|
|
@@ -1059,53 +1059,53 @@ function Ie({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
|
|
|
1059
1059
|
flexDirection: "column",
|
|
1060
1060
|
gap: 10
|
|
1061
1061
|
},
|
|
1062
|
-
children: [
|
|
1063
|
-
let r =
|
|
1062
|
+
children: [l.map((n) => {
|
|
1063
|
+
let r = f(L(t, n)), o = ae.has(r), l = I[r], d = x && r ? x.replace(/:\w+/, r) : void 0;
|
|
1064
1064
|
return /* @__PURE__ */ Z(Le, {
|
|
1065
1065
|
rowId: r,
|
|
1066
1066
|
row: n,
|
|
1067
1067
|
entity: t,
|
|
1068
|
-
entities:
|
|
1069
|
-
screens:
|
|
1068
|
+
entities: c.schema.entities,
|
|
1069
|
+
screens: c.schema.screens,
|
|
1070
1070
|
columns: i,
|
|
1071
|
-
editableColumns:
|
|
1071
|
+
editableColumns: S,
|
|
1072
1072
|
editable: a,
|
|
1073
|
-
interaction:
|
|
1074
|
-
isEditing:
|
|
1075
|
-
editErrors:
|
|
1076
|
-
isDeleting:
|
|
1073
|
+
interaction: s,
|
|
1074
|
+
isEditing: A === r,
|
|
1075
|
+
editErrors: P,
|
|
1076
|
+
isDeleting: o,
|
|
1077
1077
|
activeCell: D,
|
|
1078
|
-
setActiveCell:
|
|
1079
|
-
rowState:
|
|
1080
|
-
onCellChange:
|
|
1078
|
+
setActiveCell: k,
|
|
1079
|
+
rowState: l,
|
|
1080
|
+
onCellChange: le,
|
|
1081
1081
|
onDeleteClick: (e) => void ge(e, n),
|
|
1082
1082
|
onStartEdit: X,
|
|
1083
1083
|
onConfirmEdit: me,
|
|
1084
1084
|
onCancelEdit: he,
|
|
1085
|
-
refs:
|
|
1086
|
-
identityCol:
|
|
1087
|
-
href:
|
|
1085
|
+
refs: u,
|
|
1086
|
+
identityCol: b,
|
|
1087
|
+
href: d,
|
|
1088
1088
|
rowActions: E,
|
|
1089
1089
|
entityCode: e,
|
|
1090
|
-
onRowActionSuccess:
|
|
1090
|
+
onRowActionSuccess: g
|
|
1091
1091
|
}, r);
|
|
1092
|
-
}),
|
|
1093
|
-
draftRow:
|
|
1092
|
+
}), H && /* @__PURE__ */ Z(He, {
|
|
1093
|
+
draftRow: H,
|
|
1094
1094
|
entity: t,
|
|
1095
1095
|
columns: i,
|
|
1096
1096
|
editableColumns: C,
|
|
1097
1097
|
foreignKey: r,
|
|
1098
|
-
draftErrors:
|
|
1099
|
-
draftSaving:
|
|
1100
|
-
onChange: (e, t) =>
|
|
1098
|
+
draftErrors: te,
|
|
1099
|
+
draftSaving: ne,
|
|
1100
|
+
onChange: (e, t) => U((n) => n && {
|
|
1101
1101
|
...n,
|
|
1102
1102
|
[e]: t
|
|
1103
1103
|
}),
|
|
1104
1104
|
onConfirm: pe,
|
|
1105
1105
|
onCancel: () => {
|
|
1106
|
-
|
|
1106
|
+
U(null), W([]);
|
|
1107
1107
|
},
|
|
1108
|
-
refs:
|
|
1108
|
+
refs: u
|
|
1109
1109
|
})]
|
|
1110
1110
|
})] }) : /* @__PURE__ */ Q("div", { children: [$ && !a && /* @__PURE__ */ Z("div", {
|
|
1111
1111
|
style: {
|
|
@@ -1117,13 +1117,13 @@ function Ie({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
|
|
|
1117
1117
|
}), (!$ || a) && /* @__PURE__ */ Z("div", {
|
|
1118
1118
|
style: { overflowX: "auto" },
|
|
1119
1119
|
children: /* @__PURE__ */ Q("table", {
|
|
1120
|
-
style:
|
|
1120
|
+
style: ce,
|
|
1121
1121
|
children: [/* @__PURE__ */ Z("thead", { children: /* @__PURE__ */ Q("tr", { children: [
|
|
1122
1122
|
i.map((e) => {
|
|
1123
1123
|
let n = t.fields.get(e);
|
|
1124
1124
|
return /* @__PURE__ */ Z("th", {
|
|
1125
|
-
style:
|
|
1126
|
-
children: n ?
|
|
1125
|
+
style: se,
|
|
1126
|
+
children: n ? d(n, e, c.schema.entities) : e
|
|
1127
1127
|
}, e);
|
|
1128
1128
|
}),
|
|
1129
1129
|
a && /* @__PURE__ */ Z("th", { style: {
|
|
@@ -1134,75 +1134,75 @@ function Ie({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
|
|
|
1134
1134
|
height: 30,
|
|
1135
1135
|
width: 40
|
|
1136
1136
|
} })
|
|
1137
|
-
] }) }), /* @__PURE__ */ Q("tbody", { children: [
|
|
1138
|
-
let r =
|
|
1137
|
+
] }) }), /* @__PURE__ */ Q("tbody", { children: [l.map((n) => {
|
|
1138
|
+
let r = f(L(t, n)), o = ae.has(r), l = I[r], d = x && r ? x.replace(/:\w+/, r) : void 0;
|
|
1139
1139
|
return /* @__PURE__ */ Z(Re, {
|
|
1140
1140
|
rowId: r,
|
|
1141
1141
|
row: n,
|
|
1142
1142
|
entity: t,
|
|
1143
|
-
entities:
|
|
1144
|
-
screens:
|
|
1143
|
+
entities: c.schema.entities,
|
|
1144
|
+
screens: c.schema.screens,
|
|
1145
1145
|
columns: i,
|
|
1146
|
-
editableColumns:
|
|
1146
|
+
editableColumns: S,
|
|
1147
1147
|
editable: a,
|
|
1148
|
-
interaction:
|
|
1149
|
-
isEditing:
|
|
1150
|
-
editErrors:
|
|
1151
|
-
isDeleting:
|
|
1148
|
+
interaction: s,
|
|
1149
|
+
isEditing: A === r,
|
|
1150
|
+
editErrors: P,
|
|
1151
|
+
isDeleting: o,
|
|
1152
1152
|
activeCell: D,
|
|
1153
|
-
setActiveCell:
|
|
1154
|
-
rowState:
|
|
1155
|
-
onCellChange:
|
|
1153
|
+
setActiveCell: k,
|
|
1154
|
+
rowState: l,
|
|
1155
|
+
onCellChange: le,
|
|
1156
1156
|
onDeleteClick: (e) => void ge(e, n),
|
|
1157
1157
|
onStartEdit: X,
|
|
1158
1158
|
onConfirmEdit: me,
|
|
1159
1159
|
onCancelEdit: he,
|
|
1160
|
-
refs:
|
|
1161
|
-
identityCol:
|
|
1162
|
-
href:
|
|
1160
|
+
refs: u,
|
|
1161
|
+
identityCol: b,
|
|
1162
|
+
href: d,
|
|
1163
1163
|
rowActions: E,
|
|
1164
1164
|
entityCode: e,
|
|
1165
|
-
onRowActionSuccess:
|
|
1165
|
+
onRowActionSuccess: g
|
|
1166
1166
|
}, r);
|
|
1167
|
-
}),
|
|
1168
|
-
draftRow:
|
|
1167
|
+
}), H && /* @__PURE__ */ Z(Ve, {
|
|
1168
|
+
draftRow: H,
|
|
1169
1169
|
entity: t,
|
|
1170
1170
|
columns: i,
|
|
1171
1171
|
editableColumns: C,
|
|
1172
1172
|
foreignKey: r,
|
|
1173
|
-
draftErrors:
|
|
1174
|
-
draftSaving:
|
|
1175
|
-
onChange: (e, t) =>
|
|
1173
|
+
draftErrors: te,
|
|
1174
|
+
draftSaving: ne,
|
|
1175
|
+
onChange: (e, t) => U((n) => n && {
|
|
1176
1176
|
...n,
|
|
1177
1177
|
[e]: t
|
|
1178
1178
|
}),
|
|
1179
1179
|
onConfirm: pe,
|
|
1180
1180
|
onCancel: () => {
|
|
1181
|
-
|
|
1181
|
+
U(null), W([]);
|
|
1182
1182
|
},
|
|
1183
|
-
refs:
|
|
1183
|
+
refs: u
|
|
1184
1184
|
})] })]
|
|
1185
1185
|
})
|
|
1186
1186
|
})] });
|
|
1187
1187
|
}
|
|
1188
|
-
function Le({ rowId: t, row:
|
|
1189
|
-
let
|
|
1190
|
-
...
|
|
1191
|
-
...
|
|
1192
|
-
}, [
|
|
1193
|
-
if (
|
|
1194
|
-
let e =
|
|
1188
|
+
function Le({ rowId: t, row: n, entity: r, entities: i, screens: o, columns: c, editableColumns: l, editable: u, interaction: f, isEditing: p, editErrors: m, isDeleting: h, rowState: g, onCellChange: _, onDeleteClick: v, onStartEdit: y, onConfirmEdit: b, onCancelEdit: x, refs: S, identityCol: C, href: w, rowActions: T, onRowActionSuccess: E }) {
|
|
1189
|
+
let D = I(), O = de(), k = q(() => !g || Object.keys(g.buffer).length === 0 ? n : {
|
|
1190
|
+
...n,
|
|
1191
|
+
...g.buffer
|
|
1192
|
+
}, [n, g]);
|
|
1193
|
+
if (f === "row_edit" && p) {
|
|
1194
|
+
let e = g?.error ? [...m, `_error:${g.error}`] : m;
|
|
1195
1195
|
return /* @__PURE__ */ Z(Be, {
|
|
1196
1196
|
values: k,
|
|
1197
|
-
entity:
|
|
1197
|
+
entity: r,
|
|
1198
1198
|
columns: c,
|
|
1199
1199
|
editableColumns: l,
|
|
1200
1200
|
errors: e,
|
|
1201
|
-
saving:
|
|
1202
|
-
onChange: (e, n) =>
|
|
1203
|
-
onConfirm: () =>
|
|
1204
|
-
onCancel: () =>
|
|
1205
|
-
refs:
|
|
1201
|
+
saving: g?.saving ?? !1,
|
|
1202
|
+
onChange: (e, n) => _(t, e, n),
|
|
1203
|
+
onConfirm: () => b(t),
|
|
1204
|
+
onCancel: () => x(t),
|
|
1205
|
+
refs: S
|
|
1206
1206
|
});
|
|
1207
1207
|
}
|
|
1208
1208
|
return /* @__PURE__ */ Q("div", {
|
|
@@ -1210,7 +1210,7 @@ function Le({ rowId: t, row: i, entity: a, entities: o, screens: s, columns: c,
|
|
|
1210
1210
|
border: "1px solid var(--border)",
|
|
1211
1211
|
borderRadius: 8,
|
|
1212
1212
|
background: "var(--surface)",
|
|
1213
|
-
opacity:
|
|
1213
|
+
opacity: h ? .58 : 1,
|
|
1214
1214
|
overflow: "hidden"
|
|
1215
1215
|
},
|
|
1216
1216
|
children: [/* @__PURE__ */ Z("div", {
|
|
@@ -1221,26 +1221,26 @@ function Le({ rowId: t, row: i, entity: a, entities: o, screens: s, columns: c,
|
|
|
1221
1221
|
gap: 12
|
|
1222
1222
|
},
|
|
1223
1223
|
children: c.map((e) => {
|
|
1224
|
-
let n =
|
|
1224
|
+
let n = r.fields.get(e), a = u && f === "inline_edit" && l.has(e), s = w && e === C, c = n ? d(n, e, i) : e, p = `${O}-${t}-${e}`, m = `${p}-label`, h = {
|
|
1225
1225
|
fontSize: 11.5,
|
|
1226
1226
|
fontWeight: 600,
|
|
1227
1227
|
color: "var(--text-3)"
|
|
1228
|
-
},
|
|
1228
|
+
}, g = n ? z({
|
|
1229
1229
|
field: n,
|
|
1230
1230
|
fieldName: e,
|
|
1231
1231
|
value: k[e],
|
|
1232
|
-
mode:
|
|
1233
|
-
onChange:
|
|
1232
|
+
mode: a ? "edit" : "display",
|
|
1233
|
+
onChange: a ? (n) => _(t, e, n) : void 0,
|
|
1234
1234
|
record: k,
|
|
1235
|
-
refs:
|
|
1236
|
-
compact:
|
|
1237
|
-
entity:
|
|
1238
|
-
entities:
|
|
1239
|
-
screens:
|
|
1240
|
-
fieldId:
|
|
1241
|
-
labelId:
|
|
1242
|
-
locale:
|
|
1243
|
-
}) :
|
|
1235
|
+
refs: S,
|
|
1236
|
+
compact: a,
|
|
1237
|
+
entity: r,
|
|
1238
|
+
entities: i,
|
|
1239
|
+
screens: s ? void 0 : o,
|
|
1240
|
+
fieldId: p,
|
|
1241
|
+
labelId: m,
|
|
1242
|
+
locale: D
|
|
1243
|
+
}) : F(k[e]);
|
|
1244
1244
|
return /* @__PURE__ */ Q("div", {
|
|
1245
1245
|
style: {
|
|
1246
1246
|
display: "flex",
|
|
@@ -1248,30 +1248,30 @@ function Le({ rowId: t, row: i, entity: a, entities: o, screens: s, columns: c,
|
|
|
1248
1248
|
gap: 5,
|
|
1249
1249
|
minWidth: 0
|
|
1250
1250
|
},
|
|
1251
|
-
children: [
|
|
1252
|
-
id:
|
|
1253
|
-
htmlFor:
|
|
1254
|
-
style:
|
|
1251
|
+
children: [a && n ? /* @__PURE__ */ Z("label", {
|
|
1252
|
+
id: m,
|
|
1253
|
+
htmlFor: p,
|
|
1254
|
+
style: h,
|
|
1255
1255
|
children: c
|
|
1256
1256
|
}) : /* @__PURE__ */ Z("div", {
|
|
1257
|
-
id:
|
|
1258
|
-
style:
|
|
1257
|
+
id: m,
|
|
1258
|
+
style: h,
|
|
1259
1259
|
children: c
|
|
1260
1260
|
}), /* @__PURE__ */ Z("div", {
|
|
1261
1261
|
style: { minWidth: 0 },
|
|
1262
|
-
children:
|
|
1263
|
-
href:
|
|
1262
|
+
children: s && !a ? /* @__PURE__ */ Z("a", {
|
|
1263
|
+
href: w,
|
|
1264
1264
|
style: {
|
|
1265
1265
|
color: "var(--accent)",
|
|
1266
1266
|
textDecoration: "none",
|
|
1267
1267
|
fontWeight: 500
|
|
1268
1268
|
},
|
|
1269
|
-
children:
|
|
1270
|
-
}) :
|
|
1269
|
+
children: g
|
|
1270
|
+
}) : g
|
|
1271
1271
|
})]
|
|
1272
1272
|
}, e);
|
|
1273
1273
|
})
|
|
1274
|
-
}), (u ||
|
|
1274
|
+
}), (u || T && T.length > 0) && /* @__PURE__ */ Q("div", {
|
|
1275
1275
|
style: {
|
|
1276
1276
|
minHeight: 42,
|
|
1277
1277
|
padding: "6px 8px",
|
|
@@ -1282,47 +1282,47 @@ function Le({ rowId: t, row: i, entity: a, entities: o, screens: s, columns: c,
|
|
|
1282
1282
|
gap: 6
|
|
1283
1283
|
},
|
|
1284
1284
|
children: [u && /* @__PURE__ */ Q(me, { children: [
|
|
1285
|
-
|
|
1286
|
-
|
|
1285
|
+
g?.saving && /* @__PURE__ */ Z(a, { size: 12 }),
|
|
1286
|
+
g?.error && /* @__PURE__ */ Z("span", {
|
|
1287
1287
|
style: {
|
|
1288
1288
|
fontSize: 11,
|
|
1289
1289
|
color: "var(--danger)"
|
|
1290
1290
|
},
|
|
1291
|
-
title:
|
|
1291
|
+
title: g.error,
|
|
1292
1292
|
children: "!"
|
|
1293
1293
|
}),
|
|
1294
|
-
|
|
1294
|
+
f === "row_edit" && /* @__PURE__ */ Z(s, {
|
|
1295
1295
|
size: 32,
|
|
1296
1296
|
icon: /* @__PURE__ */ Z(e.edit, { size: 14 }),
|
|
1297
|
-
onClick: () =>
|
|
1297
|
+
onClick: () => y(t),
|
|
1298
1298
|
title: "Edit row"
|
|
1299
1299
|
}),
|
|
1300
|
-
/* @__PURE__ */ Z(
|
|
1300
|
+
/* @__PURE__ */ Z(s, {
|
|
1301
1301
|
size: 32,
|
|
1302
1302
|
icon: /* @__PURE__ */ Z(e.trash, { size: 14 }),
|
|
1303
|
-
onClick: () =>
|
|
1303
|
+
onClick: () => v(t),
|
|
1304
1304
|
title: "Delete row"
|
|
1305
1305
|
})
|
|
1306
|
-
] }), !u &&
|
|
1307
|
-
entity:
|
|
1308
|
-
actions:
|
|
1306
|
+
] }), !u && T && T.length > 0 && /* @__PURE__ */ Z(Ce, {
|
|
1307
|
+
entity: r,
|
|
1308
|
+
actions: T,
|
|
1309
1309
|
objectIds: [t],
|
|
1310
1310
|
row: k,
|
|
1311
|
-
onSuccess:
|
|
1311
|
+
onSuccess: E
|
|
1312
1312
|
})]
|
|
1313
1313
|
})]
|
|
1314
1314
|
});
|
|
1315
1315
|
}
|
|
1316
|
-
function Re({ rowId: t, row:
|
|
1317
|
-
let
|
|
1318
|
-
...
|
|
1316
|
+
function Re({ rowId: t, row: n, entity: r, entities: i, screens: o, columns: c, editableColumns: l, editable: u, interaction: d, isEditing: f, editErrors: p, isDeleting: m, activeCell: h, setActiveCell: g, rowState: _, onCellChange: v, onDeleteClick: y, onStartEdit: b, onConfirmEdit: x, onCancelEdit: S, refs: C, identityCol: w, href: T, rowActions: E, onRowActionSuccess: D }) {
|
|
1317
|
+
let O = I(), k = q(() => !_ || Object.keys(_.buffer).length === 0 ? n : {
|
|
1318
|
+
...n,
|
|
1319
1319
|
..._.buffer
|
|
1320
|
-
}, [
|
|
1320
|
+
}, [n, _]);
|
|
1321
1321
|
if (d === "row_edit" && f) {
|
|
1322
1322
|
let e = _?.error ? [...p, `_error:${_.error}`] : p;
|
|
1323
1323
|
return /* @__PURE__ */ Z(ze, {
|
|
1324
|
-
values:
|
|
1325
|
-
entity:
|
|
1324
|
+
values: k,
|
|
1325
|
+
entity: r,
|
|
1326
1326
|
columns: c,
|
|
1327
1327
|
editableColumns: l,
|
|
1328
1328
|
errors: e,
|
|
@@ -1333,52 +1333,52 @@ function Re({ rowId: t, row: i, entity: a, entities: o, screens: s, columns: c,
|
|
|
1333
1333
|
refs: C
|
|
1334
1334
|
});
|
|
1335
1335
|
}
|
|
1336
|
-
let
|
|
1336
|
+
let A = G, j = {
|
|
1337
1337
|
padding: "4px 4px",
|
|
1338
1338
|
borderBottom: "1px solid var(--divider)",
|
|
1339
1339
|
verticalAlign: "middle"
|
|
1340
|
-
},
|
|
1340
|
+
}, M = d === "inline_edit";
|
|
1341
1341
|
return /* @__PURE__ */ Q("tr", {
|
|
1342
1342
|
style: { opacity: m ? .5 : 1 },
|
|
1343
1343
|
children: [
|
|
1344
1344
|
c.map((e) => {
|
|
1345
|
-
let n =
|
|
1346
|
-
if (
|
|
1347
|
-
style:
|
|
1348
|
-
children: n ?
|
|
1345
|
+
let n = r.fields.get(e), a = l.has(e);
|
|
1346
|
+
if (M && h?.rowId === t && h?.col === e && a) return /* @__PURE__ */ Z("td", {
|
|
1347
|
+
style: j,
|
|
1348
|
+
children: n ? z({
|
|
1349
1349
|
field: n,
|
|
1350
1350
|
fieldName: e,
|
|
1351
|
-
value:
|
|
1351
|
+
value: k[e],
|
|
1352
1352
|
mode: "edit",
|
|
1353
1353
|
onChange: (n) => v(t, e, n),
|
|
1354
|
-
record:
|
|
1354
|
+
record: k,
|
|
1355
1355
|
refs: C,
|
|
1356
1356
|
compact: !0,
|
|
1357
|
-
locale:
|
|
1358
|
-
}) :
|
|
1357
|
+
locale: O
|
|
1358
|
+
}) : F(k[e])
|
|
1359
1359
|
}, e);
|
|
1360
|
-
let
|
|
1360
|
+
let s = T && e === w, c = n ? z({
|
|
1361
1361
|
field: n,
|
|
1362
1362
|
fieldName: e,
|
|
1363
|
-
value:
|
|
1363
|
+
value: k[e],
|
|
1364
1364
|
mode: "display",
|
|
1365
|
-
record:
|
|
1365
|
+
record: k,
|
|
1366
1366
|
refs: C,
|
|
1367
|
-
entity:
|
|
1368
|
-
entities:
|
|
1369
|
-
screens:
|
|
1370
|
-
locale:
|
|
1371
|
-
}) :
|
|
1367
|
+
entity: r,
|
|
1368
|
+
entities: i,
|
|
1369
|
+
screens: s ? void 0 : o,
|
|
1370
|
+
locale: O
|
|
1371
|
+
}) : F(k[e]), u = M && a && !m;
|
|
1372
1372
|
return /* @__PURE__ */ Z("td", {
|
|
1373
1373
|
style: {
|
|
1374
|
-
...
|
|
1374
|
+
...A,
|
|
1375
1375
|
cursor: u ? "pointer" : "default"
|
|
1376
1376
|
},
|
|
1377
1377
|
onClick: u ? () => g({
|
|
1378
1378
|
rowId: t,
|
|
1379
1379
|
col: e
|
|
1380
1380
|
}) : void 0,
|
|
1381
|
-
children:
|
|
1381
|
+
children: s ? /* @__PURE__ */ Z("a", {
|
|
1382
1382
|
href: T,
|
|
1383
1383
|
style: {
|
|
1384
1384
|
color: "var(--accent)",
|
|
@@ -1404,7 +1404,7 @@ function Re({ rowId: t, row: i, entity: a, entities: o, screens: s, columns: c,
|
|
|
1404
1404
|
gap: 4
|
|
1405
1405
|
},
|
|
1406
1406
|
children: [
|
|
1407
|
-
_?.saving && /* @__PURE__ */ Z(
|
|
1407
|
+
_?.saving && /* @__PURE__ */ Z(a, { size: 12 }),
|
|
1408
1408
|
_?.error && /* @__PURE__ */ Z("span", {
|
|
1409
1409
|
style: {
|
|
1410
1410
|
fontSize: 11,
|
|
@@ -1413,13 +1413,13 @@ function Re({ rowId: t, row: i, entity: a, entities: o, screens: s, columns: c,
|
|
|
1413
1413
|
title: _.error,
|
|
1414
1414
|
children: "!"
|
|
1415
1415
|
}),
|
|
1416
|
-
d === "row_edit" && /* @__PURE__ */ Z(
|
|
1416
|
+
d === "row_edit" && /* @__PURE__ */ Z(s, {
|
|
1417
1417
|
size: 24,
|
|
1418
1418
|
icon: /* @__PURE__ */ Z(e.edit, { size: 12 }),
|
|
1419
1419
|
onClick: () => b(t),
|
|
1420
1420
|
title: "Edit row"
|
|
1421
1421
|
}),
|
|
1422
|
-
/* @__PURE__ */ Z(
|
|
1422
|
+
/* @__PURE__ */ Z(s, {
|
|
1423
1423
|
size: 24,
|
|
1424
1424
|
icon: /* @__PURE__ */ Z(e.trash, { size: 12 }),
|
|
1425
1425
|
onClick: () => y(t),
|
|
@@ -1435,18 +1435,18 @@ function Re({ rowId: t, row: i, entity: a, entities: o, screens: s, columns: c,
|
|
|
1435
1435
|
verticalAlign: "middle"
|
|
1436
1436
|
},
|
|
1437
1437
|
children: /* @__PURE__ */ Z(Ce, {
|
|
1438
|
-
entity:
|
|
1438
|
+
entity: r,
|
|
1439
1439
|
actions: E,
|
|
1440
1440
|
objectIds: [t],
|
|
1441
|
-
row:
|
|
1442
|
-
onSuccess:
|
|
1441
|
+
row: k,
|
|
1442
|
+
onSuccess: D
|
|
1443
1443
|
})
|
|
1444
1444
|
})
|
|
1445
1445
|
]
|
|
1446
1446
|
});
|
|
1447
1447
|
}
|
|
1448
|
-
function ze({ values: t, entity:
|
|
1449
|
-
let m =
|
|
1448
|
+
function ze({ values: t, entity: n, columns: r, editableColumns: i, errors: o, saving: c, onChange: l, onConfirm: u, onCancel: d, refs: f, accent: p }) {
|
|
1449
|
+
let m = I(), h = o.find((e) => e.startsWith("_error:")), g = new Set(o.filter((e) => !e.startsWith("_error:"))), _ = {
|
|
1450
1450
|
padding: "6px 12px",
|
|
1451
1451
|
borderBottom: "1px solid var(--divider)",
|
|
1452
1452
|
verticalAlign: "middle",
|
|
@@ -1463,19 +1463,19 @@ function ze({ values: t, entity: i, columns: a, editableColumns: o, errors: s, s
|
|
|
1463
1463
|
onKeyDown: (e) => {
|
|
1464
1464
|
e.key === "Enter" && !e.shiftKey ? (e.preventDefault(), u()) : e.key === "Escape" && (e.preventDefault(), d());
|
|
1465
1465
|
},
|
|
1466
|
-
children: [
|
|
1467
|
-
let
|
|
1468
|
-
return
|
|
1466
|
+
children: [r.map((e) => {
|
|
1467
|
+
let r = n.fields.get(e), a = i.has(e), o = g.has(e);
|
|
1468
|
+
return a ? /* @__PURE__ */ Z("td", {
|
|
1469
1469
|
style: {
|
|
1470
1470
|
..._,
|
|
1471
|
-
outline:
|
|
1471
|
+
outline: o ? "1px solid var(--danger)" : "none",
|
|
1472
1472
|
outlineOffset: -1
|
|
1473
1473
|
},
|
|
1474
|
-
title:
|
|
1474
|
+
title: o ? `${e} is required` : void 0,
|
|
1475
1475
|
children: /* @__PURE__ */ Z("div", {
|
|
1476
1476
|
style: v,
|
|
1477
|
-
children:
|
|
1478
|
-
field:
|
|
1477
|
+
children: r ? z({
|
|
1478
|
+
field: r,
|
|
1479
1479
|
fieldName: e,
|
|
1480
1480
|
value: t[e],
|
|
1481
1481
|
mode: "edit",
|
|
@@ -1484,14 +1484,14 @@ function ze({ values: t, entity: i, columns: a, editableColumns: o, errors: s, s
|
|
|
1484
1484
|
refs: f,
|
|
1485
1485
|
compact: !0,
|
|
1486
1486
|
locale: m
|
|
1487
|
-
}) :
|
|
1487
|
+
}) : F(t[e])
|
|
1488
1488
|
})
|
|
1489
1489
|
}, e) : /* @__PURE__ */ Z("td", {
|
|
1490
1490
|
style: {
|
|
1491
1491
|
..._,
|
|
1492
1492
|
color: "var(--text-3)"
|
|
1493
1493
|
},
|
|
1494
|
-
children:
|
|
1494
|
+
children: r?.auto ? "—" : F(t[e])
|
|
1495
1495
|
}, e);
|
|
1496
1496
|
}), /* @__PURE__ */ Z("td", {
|
|
1497
1497
|
style: _,
|
|
@@ -1511,13 +1511,13 @@ function ze({ values: t, entity: i, columns: a, editableColumns: o, errors: s, s
|
|
|
1511
1511
|
title: h.slice(7),
|
|
1512
1512
|
children: "!"
|
|
1513
1513
|
}),
|
|
1514
|
-
/* @__PURE__ */ Z(
|
|
1514
|
+
/* @__PURE__ */ Z(s, {
|
|
1515
1515
|
size: 24,
|
|
1516
|
-
icon: Z(c ?
|
|
1516
|
+
icon: Z(c ? a : e.check, { size: 12 }),
|
|
1517
1517
|
onClick: u,
|
|
1518
1518
|
title: "Confirm (Enter)"
|
|
1519
1519
|
}),
|
|
1520
|
-
/* @__PURE__ */ Z(
|
|
1520
|
+
/* @__PURE__ */ Z(s, {
|
|
1521
1521
|
size: 24,
|
|
1522
1522
|
icon: /* @__PURE__ */ Z(e.x, { size: 12 }),
|
|
1523
1523
|
onClick: d,
|
|
@@ -1528,18 +1528,18 @@ function ze({ values: t, entity: i, columns: a, editableColumns: o, errors: s, s
|
|
|
1528
1528
|
})]
|
|
1529
1529
|
});
|
|
1530
1530
|
}
|
|
1531
|
-
function Be({ values: t, entity:
|
|
1532
|
-
let
|
|
1531
|
+
function Be({ values: t, entity: n, columns: r, editableColumns: i, errors: o, saving: c, onChange: l, onConfirm: u, onCancel: f, refs: p, accent: m }) {
|
|
1532
|
+
let h = I(), g = de(), _ = o.find((e) => e.startsWith("_error:")), v = new Set(o.filter((e) => !e.startsWith("_error:")));
|
|
1533
1533
|
return /* @__PURE__ */ Q("div", {
|
|
1534
1534
|
style: {
|
|
1535
1535
|
border: "1px solid var(--border)",
|
|
1536
1536
|
borderRadius: 8,
|
|
1537
1537
|
background: "var(--surface)",
|
|
1538
1538
|
overflow: "hidden",
|
|
1539
|
-
boxShadow:
|
|
1539
|
+
boxShadow: m ? "inset 3px 0 0 var(--accent)" : void 0
|
|
1540
1540
|
},
|
|
1541
1541
|
onKeyDown: (e) => {
|
|
1542
|
-
e.key === "Enter" && !e.shiftKey ? (e.preventDefault(), u()) : e.key === "Escape" && (e.preventDefault(),
|
|
1542
|
+
e.key === "Enter" && !e.shiftKey ? (e.preventDefault(), u()) : e.key === "Escape" && (e.preventDefault(), f());
|
|
1543
1543
|
},
|
|
1544
1544
|
children: [/* @__PURE__ */ Z("div", {
|
|
1545
1545
|
style: {
|
|
@@ -1548,8 +1548,8 @@ function Be({ values: t, entity: i, columns: a, editableColumns: o, errors: s, s
|
|
|
1548
1548
|
flexDirection: "column",
|
|
1549
1549
|
gap: 12
|
|
1550
1550
|
},
|
|
1551
|
-
children:
|
|
1552
|
-
let
|
|
1551
|
+
children: r.map((e) => {
|
|
1552
|
+
let r = n.fields.get(e), a = i.has(e), o = v.has(e), s = r ? d(r, e) : e, c = `${g}-${e}`, u = `${c}-label`, f = {
|
|
1553
1553
|
fontSize: 11.5,
|
|
1554
1554
|
fontWeight: 600,
|
|
1555
1555
|
color: "var(--text-3)"
|
|
@@ -1561,36 +1561,36 @@ function Be({ values: t, entity: i, columns: a, editableColumns: o, errors: s, s
|
|
|
1561
1561
|
gap: 5,
|
|
1562
1562
|
minWidth: 0
|
|
1563
1563
|
},
|
|
1564
|
-
children: [
|
|
1564
|
+
children: [a && r ? /* @__PURE__ */ Z("label", {
|
|
1565
1565
|
id: u,
|
|
1566
1566
|
htmlFor: c,
|
|
1567
|
-
style:
|
|
1567
|
+
style: f,
|
|
1568
1568
|
children: s
|
|
1569
1569
|
}) : /* @__PURE__ */ Z("div", {
|
|
1570
1570
|
id: u,
|
|
1571
|
-
style:
|
|
1571
|
+
style: f,
|
|
1572
1572
|
children: s
|
|
1573
1573
|
}), /* @__PURE__ */ Z("div", {
|
|
1574
1574
|
style: {
|
|
1575
1575
|
minWidth: 0,
|
|
1576
|
-
outline:
|
|
1576
|
+
outline: o ? "1px solid var(--danger)" : "none",
|
|
1577
1577
|
outlineOffset: 3,
|
|
1578
|
-
borderRadius:
|
|
1578
|
+
borderRadius: o ? 5 : 0
|
|
1579
1579
|
},
|
|
1580
|
-
title:
|
|
1581
|
-
children:
|
|
1582
|
-
field:
|
|
1580
|
+
title: o ? `${e} is required` : void 0,
|
|
1581
|
+
children: a ? r ? z({
|
|
1582
|
+
field: r,
|
|
1583
1583
|
fieldName: e,
|
|
1584
1584
|
value: t[e],
|
|
1585
1585
|
mode: "edit",
|
|
1586
1586
|
onChange: (t) => l(e, t),
|
|
1587
1587
|
record: t,
|
|
1588
|
-
refs:
|
|
1588
|
+
refs: p,
|
|
1589
1589
|
compact: !0,
|
|
1590
1590
|
fieldId: c,
|
|
1591
1591
|
labelId: u,
|
|
1592
|
-
locale:
|
|
1593
|
-
}) :
|
|
1592
|
+
locale: h
|
|
1593
|
+
}) : F(t[e]) : r?.auto ? "—" : F(t[e])
|
|
1594
1594
|
})]
|
|
1595
1595
|
}, e);
|
|
1596
1596
|
})
|
|
@@ -1605,24 +1605,24 @@ function Be({ values: t, entity: i, columns: a, editableColumns: o, errors: s, s
|
|
|
1605
1605
|
gap: 6
|
|
1606
1606
|
},
|
|
1607
1607
|
children: [
|
|
1608
|
-
|
|
1608
|
+
_ && /* @__PURE__ */ Z("span", {
|
|
1609
1609
|
style: {
|
|
1610
1610
|
fontSize: 11,
|
|
1611
1611
|
color: "var(--danger)"
|
|
1612
1612
|
},
|
|
1613
|
-
title:
|
|
1613
|
+
title: _.slice(7),
|
|
1614
1614
|
children: "!"
|
|
1615
1615
|
}),
|
|
1616
|
-
/* @__PURE__ */ Z(
|
|
1616
|
+
/* @__PURE__ */ Z(s, {
|
|
1617
1617
|
size: 32,
|
|
1618
|
-
icon: Z(c ?
|
|
1618
|
+
icon: Z(c ? a : e.check, { size: 14 }),
|
|
1619
1619
|
onClick: u,
|
|
1620
1620
|
title: "Confirm (Enter)"
|
|
1621
1621
|
}),
|
|
1622
|
-
/* @__PURE__ */ Z(
|
|
1622
|
+
/* @__PURE__ */ Z(s, {
|
|
1623
1623
|
size: 32,
|
|
1624
1624
|
icon: /* @__PURE__ */ Z(e.x, { size: 14 }),
|
|
1625
|
-
onClick:
|
|
1625
|
+
onClick: f,
|
|
1626
1626
|
title: "Cancel (Esc)"
|
|
1627
1627
|
})
|
|
1628
1628
|
]
|
|
@@ -1669,7 +1669,7 @@ function He({ draftRow: e, entity: t, columns: n, editableColumns: r, foreignKey
|
|
|
1669
1669
|
}
|
|
1670
1670
|
//#endregion
|
|
1671
1671
|
//#region src/components/shared/ErrorBoundary.tsx
|
|
1672
|
-
var Ue = class extends
|
|
1672
|
+
var Ue = class extends le {
|
|
1673
1673
|
constructor(e) {
|
|
1674
1674
|
super(e), this.state = {
|
|
1675
1675
|
hasError: !1,
|
|
@@ -1726,7 +1726,7 @@ var Ue = class extends ue {
|
|
|
1726
1726
|
},
|
|
1727
1727
|
children: this.state.error?.message || "An unexpected error occurred."
|
|
1728
1728
|
}),
|
|
1729
|
-
/* @__PURE__ */ Z("div", { children: /* @__PURE__ */ Z(
|
|
1729
|
+
/* @__PURE__ */ Z("div", { children: /* @__PURE__ */ Z(u, {
|
|
1730
1730
|
onClick: this.handleRetry,
|
|
1731
1731
|
children: "Try again"
|
|
1732
1732
|
}) })
|
|
@@ -1748,7 +1748,7 @@ function Ge(e, t) {
|
|
|
1748
1748
|
let n = We(e, t), r = n[2];
|
|
1749
1749
|
return pe({
|
|
1750
1750
|
queryKey: n,
|
|
1751
|
-
queryFn: () =>
|
|
1751
|
+
queryFn: () => k(e, t),
|
|
1752
1752
|
enabled: !!e && !!t && t !== "new" && r !== void 0
|
|
1753
1753
|
});
|
|
1754
1754
|
}
|