@declarion/react 0.53.0 → 0.54.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-lib/{DraggableChildrenTable-BQZTvZaU.js → DraggableChildrenTable-Djc7QDzR.js} +32 -32
- package/dist-lib/{Grid-B9Tiytbd.js → Grid-Bd2r0_4J.js} +45 -45
- package/dist-lib/{LayoutRenderer-D_v9OD_A.js → LayoutRenderer-V6nf9aa_.js} +716 -714
- package/dist-lib/{ListCardsBody-dRnXsQ7A.js → ListCardsBody-Cdsvu0Vs.js} +29 -29
- package/dist-lib/{MarkdownRenderer-BCyrsLrd.js → MarkdownRenderer-CZo5ZgM7.js} +1 -1
- package/dist-lib/{RefreshControl-CV8nGACW.js → RefreshControl-CJm3vz9p.js} +40 -40
- package/dist-lib/{SmartDetailPage.impl-DWprVNMb.js → SmartDetailPage.impl-DoIjCzjQ.js} +492 -492
- package/dist-lib/{SmartListPage.impl-BwWURGwa.js → SmartListPage.impl-DnM8e14t.js} +743 -742
- package/dist-lib/{SmartRecordListPage.impl-BKKBShAg.js → SmartRecordListPage.impl-BmHGYbD9.js} +128 -128
- package/dist-lib/{SortHeaderMenu-pgi4sxMs.js → SortHeaderMenu-CA53NerB.js} +1 -1
- package/dist-lib/{action-dispatch-DlHTYag7.js → action-dispatch-JcUrLFaW.js} +177 -177
- package/dist-lib/api/agents.d.ts +0 -1
- package/dist-lib/api/events.d.ts +13 -4
- package/dist-lib/{cardProjection-C7Orz841.js → cardProjection-Q2kwqv8V.js} +19 -19
- 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/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/ListToolbar.d.ts +5 -3
- 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 +1 -5
- 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/{field-classification-EY8CFF3P.js → field-classification-ssZvtr8J.js} +268 -397
- package/dist-lib/{format-count-BHkaDr9V.js → format-count-DHuivNT7.js} +236 -236
- package/dist-lib/hooks/useEntityData.d.ts +7 -0
- package/dist-lib/hooks/useRealtimeThresholds.d.ts +1 -0
- package/dist-lib/hooks/useSSE.d.ts +0 -1
- package/dist-lib/index.js +1039 -1020
- package/dist-lib/lib/action-dispatch.d.ts +1 -1
- package/dist-lib/lib/realtime-query-keys.d.ts +22 -0
- package/dist-lib/lib/realtime-reconcile.d.ts +0 -9
- package/dist-lib/lib/realtime-resync.d.ts +23 -0
- package/dist-lib/{peekDraftStore-1pIajluX.js → peekDraftStore-lm9ViVLA.js} +17 -17
- package/dist-lib/{registry-C5ug25M8.js → registry-DsQFhEAD.js} +511 -511
- package/dist-lib/stores/realtime.d.ts +86 -19
- package/dist-lib/testing.js +40 -40
- package/dist-lib/types/api.d.ts +8 -4
- package/dist-lib/types/schema.d.ts +6 -0
- package/dist-lib/{useCurrentScreen-BdnZq8vZ.js → useCurrentScreen-aHx9HH1m.js} +2473 -1960
- package/dist-lib/useListQuery-DZn2BAxY.js +96 -0
- package/dist-lib/{useProperties-Bhi9Wn5O.js → useProperties-CAqKmUKg.js} +25 -25
- package/dist-lib/{useTabSearchMirror-Dl5x0xKu.js → useTabSearchMirror-DYW9WoK7.js} +10 -10
- package/dist-lib/{value-Rp-5W3o8.js → value-CzKQPJOp.js} +4 -4
- package/package.json +10 -10
- package/dist-lib/useListQuery-BxgrPZIB.js +0 -90
package/dist-lib/{SmartRecordListPage.impl-BKKBShAg.js → SmartRecordListPage.impl-BmHGYbD9.js}
RENAMED
|
@@ -1,83 +1,83 @@
|
|
|
1
1
|
import { s as e } from "./DynamicIcon-DW5krHuX.js";
|
|
2
|
-
import {
|
|
3
|
-
import { a as
|
|
4
|
-
import { T as
|
|
5
|
-
import { f as
|
|
6
|
-
import { a as C, c as w, n as T, s as E, t as D } from "./cardProjection-
|
|
7
|
-
import { n as ae, r as O } from "./useProperties-
|
|
8
|
-
import { c as k, f as A, h as j, m as M, n as oe, t as se } from "./useTabSearchMirror-
|
|
9
|
-
import { t as N } from "./LayoutRenderer-
|
|
10
|
-
import { t as P } from "./useListQuery-
|
|
2
|
+
import { $n as t, Br as n, Cr as r, Er as i, Mr as a, Or as o, Vr as s, Zn as c, _t as l, at as u, dr as d, er as f, et as p, jt as m, mr as ee, nr as h, rt as g, un as _, v as te } from "./useCurrentScreen-aHx9HH1m.js";
|
|
3
|
+
import { a as v } from "./registry-DsQFhEAD.js";
|
|
4
|
+
import { T as ne, l as re, p as y } from "./field-classification-ssZvtr8J.js";
|
|
5
|
+
import { f as b, h as x, p as S, u as ie } from "./action-dispatch-JcUrLFaW.js";
|
|
6
|
+
import { a as C, c as w, n as T, s as E, t as D } from "./cardProjection-Q2kwqv8V.js";
|
|
7
|
+
import { n as ae, r as O } from "./useProperties-CAqKmUKg.js";
|
|
8
|
+
import { c as k, f as A, h as j, m as M, n as oe, t as se } from "./useTabSearchMirror-DYW9WoK7.js";
|
|
9
|
+
import { t as N } from "./LayoutRenderer-V6nf9aa_.js";
|
|
10
|
+
import { t as P } from "./useListQuery-DZn2BAxY.js";
|
|
11
11
|
import { useCallback as F, useEffect as I, useMemo as L, useRef as R, useState as z } from "react";
|
|
12
12
|
import { useSearchParams as ce } from "react-router";
|
|
13
13
|
import { Fragment as B, jsx as V, jsxs as H } from "react/jsx-runtime";
|
|
14
14
|
//#region src/components/pages/SmartRecordListPage.impl.tsx
|
|
15
15
|
var le = 200;
|
|
16
|
-
function U({ screenCode:
|
|
17
|
-
let [
|
|
18
|
-
oe(
|
|
19
|
-
let
|
|
20
|
-
let e =
|
|
21
|
-
return
|
|
22
|
-
}, [
|
|
23
|
-
let e =
|
|
24
|
-
return e?.list?.presentation === "table" || e?.list?.presentation === "cards" ? e.list.presentation : e?.presentation === "table" || e?.presentation === "cards" ? e.presentation :
|
|
25
|
-
}, [
|
|
16
|
+
function U({ screenCode: o }) {
|
|
17
|
+
let [s, c] = ce(), { data: u } = _(), d = a(), f = u?.screens[o], p = f?.entity ? u?.entities[f.entity] : void 0, m = f?.entity;
|
|
18
|
+
oe(f, p, s.toString()), se(f?.route);
|
|
19
|
+
let g = re(), v = s.get("selected") ?? null, y = s.get("search") ?? "", b = l(y, 300), x = s.get("sort") ?? f?.sort_default ?? "", S = L(() => A(s), [s]), ie = S.filters.length > 0 ? S.filters : void 0, C = L(() => f?.columns ?? p?.fields.names().filter((e) => !p.fields.get(e)?.primary && !p.fields.get(e)?.auto && p.fields.get(e)?.display?.is_listable !== !1).slice(0, 4) ?? [], [f?.columns, p]), w = L(() => {
|
|
20
|
+
let e = f?.responsive?.[d.category]?.presentation;
|
|
21
|
+
return d.category === "phone" ? "drilldown" : e === "split" || e === "drilldown" || e === "stacked" ? e : "split";
|
|
22
|
+
}, [f?.responsive, d.category]), E = L(() => {
|
|
23
|
+
let e = f?.responsive?.[d.category];
|
|
24
|
+
return e?.list?.presentation === "table" || e?.list?.presentation === "cards" ? e.list.presentation : e?.presentation === "table" || e?.presentation === "cards" ? e.presentation : d.category === "phone" ? "cards" : "table";
|
|
25
|
+
}, [f?.responsive, d.category]), ae = f?.responsive?.[d.category]?.layout?.related_records, O = L(() => D({
|
|
26
26
|
entity: p,
|
|
27
|
-
screen:
|
|
28
|
-
}), [p,
|
|
27
|
+
screen: f
|
|
28
|
+
}), [p, f]), N = L(() => T({
|
|
29
29
|
entity: p,
|
|
30
|
-
screen:
|
|
30
|
+
screen: f,
|
|
31
31
|
presentation: E,
|
|
32
32
|
visibleColumns: C,
|
|
33
33
|
card: O,
|
|
34
|
-
sort:
|
|
34
|
+
sort: x
|
|
35
35
|
}), [
|
|
36
36
|
p,
|
|
37
|
-
|
|
37
|
+
f,
|
|
38
38
|
E,
|
|
39
39
|
C,
|
|
40
40
|
O,
|
|
41
|
-
|
|
41
|
+
x
|
|
42
42
|
]), U = P({
|
|
43
43
|
entity: p,
|
|
44
44
|
entityCode: m,
|
|
45
|
-
screen:
|
|
46
|
-
screenCode:
|
|
45
|
+
screen: f,
|
|
46
|
+
screenCode: o,
|
|
47
47
|
page: 1,
|
|
48
48
|
perPage: le,
|
|
49
|
-
sortForRequest:
|
|
50
|
-
debouncedSearch:
|
|
51
|
-
filters:
|
|
52
|
-
filterError: !!
|
|
49
|
+
sortForRequest: te(x),
|
|
50
|
+
debouncedSearch: b,
|
|
51
|
+
filters: S.filters,
|
|
52
|
+
filterError: !!S.error,
|
|
53
53
|
includeDeleted: !1,
|
|
54
54
|
expand: N.expandFields,
|
|
55
55
|
select: N.selectFields,
|
|
56
56
|
runCountQuery: !1,
|
|
57
|
-
urlKey: `${m ?? ""}|${
|
|
57
|
+
urlKey: `${m ?? ""}|${s.toString()}`
|
|
58
58
|
}), W = U.rows, G = U.refs, K = U.isLoading, q = L(() => p?.fields.names().find((e) => p.fields.get(e)?.primary) ?? "id", [p]), J = F((e, t) => {
|
|
59
|
-
|
|
59
|
+
c((t) => {
|
|
60
60
|
let n = new URLSearchParams(t);
|
|
61
61
|
return e ? n.set("selected", e) : n.delete("selected"), n;
|
|
62
62
|
}, { replace: t?.replace ?? !0 });
|
|
63
|
-
}, [
|
|
64
|
-
|
|
63
|
+
}, [c]), fe = F((e) => {
|
|
64
|
+
c((t) => {
|
|
65
65
|
let n = new URLSearchParams(t);
|
|
66
66
|
return e ? n.set("search", e) : n.delete("search"), n;
|
|
67
67
|
}, { replace: !0 });
|
|
68
|
-
}, [
|
|
69
|
-
|
|
68
|
+
}, [c]), pe = F((e, t) => {
|
|
69
|
+
c((n) => {
|
|
70
70
|
let r = new URLSearchParams(n), i = A(n).filters, a;
|
|
71
71
|
return a = t && t !== "__all__" ? [...M(i, e), k(e, t)] : M(i, e), j(a, r), r;
|
|
72
72
|
}, { replace: !0 });
|
|
73
|
-
}, [
|
|
73
|
+
}, [c]), Y = (f?.list_resizable ?? !1) && w === "split" && d.category !== "phone" && !d.touch, X = R(null), [Z, Q] = z(null), me = R(!1), $ = f?.list_width;
|
|
74
74
|
I(() => {
|
|
75
75
|
!Y || !$?.endsWith("%") || Q(null);
|
|
76
76
|
}, [
|
|
77
77
|
Y,
|
|
78
78
|
$,
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
d.width,
|
|
80
|
+
d.height
|
|
81
81
|
]), I(() => {
|
|
82
82
|
if (!Y || Z !== null) return;
|
|
83
83
|
let e = X.current;
|
|
@@ -108,8 +108,8 @@ function U({ screenCode: t }) {
|
|
|
108
108
|
};
|
|
109
109
|
document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", document.addEventListener("mousemove", r), document.addEventListener("mouseup", i), he.current = i;
|
|
110
110
|
}, [Z]);
|
|
111
|
-
if (!
|
|
112
|
-
let _e =
|
|
111
|
+
if (!u || !f || !p) return null;
|
|
112
|
+
let _e = ie?.length ?? 0, ve = w === "split" || w === "stacked" || !v, ye = w === "split" || w === "stacked" || !!v, be = w !== "split" && v ? () => J(null, { replace: !0 }) : void 0, xe = w === "split" ? Y && Z !== null ? Z : f.list_width ?? "320px" : "100%";
|
|
113
113
|
return /* @__PURE__ */ H("div", {
|
|
114
114
|
ref: X,
|
|
115
115
|
"data-record-list-presentation": w,
|
|
@@ -138,39 +138,39 @@ function U({ screenCode: t }) {
|
|
|
138
138
|
style: {
|
|
139
139
|
paddingTop: 12,
|
|
140
140
|
paddingBottom: 12,
|
|
141
|
-
...
|
|
141
|
+
...ne(12),
|
|
142
142
|
display: "flex",
|
|
143
143
|
flexDirection: "column",
|
|
144
144
|
gap: 8,
|
|
145
145
|
borderBottom: "1px solid var(--divider)"
|
|
146
146
|
},
|
|
147
147
|
children: [
|
|
148
|
-
|
|
148
|
+
g.hasOriginBack && /* @__PURE__ */ H("div", {
|
|
149
149
|
style: {
|
|
150
150
|
display: "flex",
|
|
151
151
|
alignItems: "center",
|
|
152
152
|
gap: 8
|
|
153
153
|
},
|
|
154
|
-
children: [/* @__PURE__ */ V(
|
|
154
|
+
children: [/* @__PURE__ */ V(n, {
|
|
155
155
|
icon: /* @__PURE__ */ V(e.back, { size: 14 }),
|
|
156
156
|
title: "Back",
|
|
157
|
-
onClick:
|
|
157
|
+
onClick: g.goBack
|
|
158
158
|
}), /* @__PURE__ */ V("span", {
|
|
159
159
|
style: {
|
|
160
160
|
fontSize: 12.5,
|
|
161
161
|
fontWeight: 600,
|
|
162
162
|
color: "var(--text)"
|
|
163
163
|
},
|
|
164
|
-
children:
|
|
164
|
+
children: h(f.display?.name) || h(p.display.name_plural)
|
|
165
165
|
})]
|
|
166
166
|
}),
|
|
167
|
-
/* @__PURE__ */ V(
|
|
168
|
-
value:
|
|
167
|
+
/* @__PURE__ */ V(i, {
|
|
168
|
+
value: y,
|
|
169
169
|
onChange: fe,
|
|
170
|
-
placeholder: `Search ${
|
|
170
|
+
placeholder: `Search ${h(p.display.name_plural)}…`,
|
|
171
171
|
prefix: /* @__PURE__ */ V(e.search, { size: 13 })
|
|
172
172
|
}),
|
|
173
|
-
|
|
173
|
+
S.error && /* @__PURE__ */ H("div", {
|
|
174
174
|
role: "alert",
|
|
175
175
|
"data-testid": "record-list-filter-url-error",
|
|
176
176
|
style: {
|
|
@@ -180,31 +180,31 @@ function U({ screenCode: t }) {
|
|
|
180
180
|
color: "var(--danger)",
|
|
181
181
|
fontSize: 11.5
|
|
182
182
|
},
|
|
183
|
-
children: [
|
|
183
|
+
children: [S.error, " Showing this list without URL filters."]
|
|
184
184
|
}),
|
|
185
|
-
|
|
185
|
+
f.filters && f.filters.length > 0 && /* @__PURE__ */ V("div", {
|
|
186
186
|
style: {
|
|
187
187
|
display: "flex",
|
|
188
188
|
flexWrap: "wrap",
|
|
189
189
|
gap: 6
|
|
190
190
|
},
|
|
191
|
-
children:
|
|
192
|
-
let
|
|
193
|
-
if (!
|
|
194
|
-
let
|
|
191
|
+
children: f.filters.map((e) => {
|
|
192
|
+
let n = p.fields.get(e);
|
|
193
|
+
if (!n?.values) return null;
|
|
194
|
+
let i = ie?.find((t) => t.field === e && t.op === "eq")?.value ?? "__all__", a = t(n, e, u.entities), o = [{
|
|
195
195
|
value: "__all__",
|
|
196
|
-
label: `All ${
|
|
197
|
-
}, ...
|
|
196
|
+
label: `All ${a}`
|
|
197
|
+
}, ...n.values.map((e) => ({
|
|
198
198
|
value: e.code,
|
|
199
|
-
label:
|
|
199
|
+
label: h(e.name) || e.code
|
|
200
200
|
}))];
|
|
201
201
|
return /* @__PURE__ */ V("div", {
|
|
202
202
|
style: { minWidth: 120 },
|
|
203
|
-
children: /* @__PURE__ */ V(
|
|
204
|
-
value:
|
|
205
|
-
options:
|
|
203
|
+
children: /* @__PURE__ */ V(r, {
|
|
204
|
+
value: i,
|
|
205
|
+
options: o,
|
|
206
206
|
onChange: (t) => pe(e, t),
|
|
207
|
-
placeholder:
|
|
207
|
+
placeholder: a
|
|
208
208
|
})
|
|
209
209
|
}, e);
|
|
210
210
|
})
|
|
@@ -217,8 +217,8 @@ function U({ screenCode: t }) {
|
|
|
217
217
|
fontSize: 11,
|
|
218
218
|
color: "var(--text-3)"
|
|
219
219
|
},
|
|
220
|
-
children: [/* @__PURE__ */ V("span", { children: K ? "Loading…" : `${W.length} ${
|
|
221
|
-
onClick: () =>
|
|
220
|
+
children: [/* @__PURE__ */ V("span", { children: K ? "Loading…" : `${W.length} ${h(p.display.name_plural)}` }), _e > 0 && /* @__PURE__ */ V("button", {
|
|
221
|
+
onClick: () => c((e) => {
|
|
222
222
|
let t = new URLSearchParams(e);
|
|
223
223
|
return t.delete("filters"), t;
|
|
224
224
|
}, { replace: !0 }),
|
|
@@ -273,7 +273,7 @@ function U({ screenCode: t }) {
|
|
|
273
273
|
card: O,
|
|
274
274
|
presentation: E,
|
|
275
275
|
refs: G,
|
|
276
|
-
isSelected: t ===
|
|
276
|
+
isSelected: t === v,
|
|
277
277
|
onClick: () => J(t, { replace: w === "split" })
|
|
278
278
|
}, t);
|
|
279
279
|
}), U.isCursor && U.hasMorePages && /* @__PURE__ */ V("button", {
|
|
@@ -316,15 +316,15 @@ function U({ screenCode: t }) {
|
|
|
316
316
|
overflow: "hidden",
|
|
317
317
|
height: w === "stacked" ? "50%" : "100%"
|
|
318
318
|
},
|
|
319
|
-
children:
|
|
319
|
+
children: v ? /* @__PURE__ */ V(de, {
|
|
320
320
|
entityCode: m,
|
|
321
|
-
recordId:
|
|
322
|
-
items:
|
|
323
|
-
schema:
|
|
321
|
+
recordId: v,
|
|
322
|
+
items: f.items,
|
|
323
|
+
schema: u,
|
|
324
324
|
entity: p,
|
|
325
325
|
onBackToList: be,
|
|
326
326
|
relatedRecordsPresentation: ae
|
|
327
|
-
},
|
|
327
|
+
}, v) : /* @__PURE__ */ V("div", {
|
|
328
328
|
style: {
|
|
329
329
|
display: "flex",
|
|
330
330
|
alignItems: "center",
|
|
@@ -336,7 +336,7 @@ function U({ screenCode: t }) {
|
|
|
336
336
|
style: { fontSize: 12.5 },
|
|
337
337
|
children: [
|
|
338
338
|
"Select a ",
|
|
339
|
-
|
|
339
|
+
h(p.display.name),
|
|
340
340
|
" to view details"
|
|
341
341
|
]
|
|
342
342
|
})
|
|
@@ -381,7 +381,7 @@ function ue({ record: e, entity: t, columns: n, card: r, presentation: i, refs:
|
|
|
381
381
|
color: "var(--text-3)",
|
|
382
382
|
overflowWrap: "anywhere"
|
|
383
383
|
},
|
|
384
|
-
children:
|
|
384
|
+
children: S({
|
|
385
385
|
entity: t,
|
|
386
386
|
fieldName: r.subtitleField,
|
|
387
387
|
record: e,
|
|
@@ -406,7 +406,7 @@ function ue({ record: e, entity: t, columns: n, card: r, presentation: i, refs:
|
|
|
406
406
|
maxWidth: "100%",
|
|
407
407
|
overflowWrap: "anywhere"
|
|
408
408
|
},
|
|
409
|
-
children:
|
|
409
|
+
children: S({
|
|
410
410
|
entity: t,
|
|
411
411
|
fieldName: n,
|
|
412
412
|
record: e,
|
|
@@ -444,7 +444,7 @@ function ue({ record: e, entity: t, columns: n, card: r, presentation: i, refs:
|
|
|
444
444
|
minWidth: 0,
|
|
445
445
|
overflowWrap: "anywhere"
|
|
446
446
|
},
|
|
447
|
-
children:
|
|
447
|
+
children: S({
|
|
448
448
|
entity: t,
|
|
449
449
|
fieldName: n,
|
|
450
450
|
record: e,
|
|
@@ -490,7 +490,7 @@ function ue({ record: e, entity: t, columns: n, card: r, presentation: i, refs:
|
|
|
490
490
|
whiteSpace: "nowrap",
|
|
491
491
|
color: "var(--text)"
|
|
492
492
|
},
|
|
493
|
-
children:
|
|
493
|
+
children: S({
|
|
494
494
|
entity: t,
|
|
495
495
|
fieldName: l,
|
|
496
496
|
record: e,
|
|
@@ -513,7 +513,7 @@ function ue({ record: e, entity: t, columns: n, card: r, presentation: i, refs:
|
|
|
513
513
|
textOverflow: "ellipsis",
|
|
514
514
|
whiteSpace: "nowrap"
|
|
515
515
|
},
|
|
516
|
-
children:
|
|
516
|
+
children: S({
|
|
517
517
|
entity: t,
|
|
518
518
|
fieldName: u,
|
|
519
519
|
record: e,
|
|
@@ -528,9 +528,9 @@ function ue({ record: e, entity: t, columns: n, card: r, presentation: i, refs:
|
|
|
528
528
|
gap: 4,
|
|
529
529
|
flexShrink: 0
|
|
530
530
|
},
|
|
531
|
-
children: d.map((n) =>
|
|
531
|
+
children: d.map((n) => b(t, e, n) == null ? null : /* @__PURE__ */ V("div", {
|
|
532
532
|
style: { fontSize: 11 },
|
|
533
|
-
children:
|
|
533
|
+
children: S({
|
|
534
534
|
entity: t,
|
|
535
535
|
fieldName: n,
|
|
536
536
|
record: e,
|
|
@@ -544,11 +544,11 @@ function ue({ record: e, entity: t, columns: n, card: r, presentation: i, refs:
|
|
|
544
544
|
});
|
|
545
545
|
}
|
|
546
546
|
function W(e, t, n) {
|
|
547
|
-
let r =
|
|
547
|
+
let r = b(e, t, n);
|
|
548
548
|
return !(r == null || r === "" || Array.isArray(r) && r.length === 0);
|
|
549
549
|
}
|
|
550
550
|
function G({ entity: e, record: t, field: n, refs: r }) {
|
|
551
|
-
let i = p(), a =
|
|
551
|
+
let i = p(), a = f(t, e), o = n ? S({
|
|
552
552
|
entity: e,
|
|
553
553
|
fieldName: n,
|
|
554
554
|
record: t,
|
|
@@ -563,13 +563,13 @@ function G({ entity: e, record: t, field: n, refs: r }) {
|
|
|
563
563
|
color: "var(--text)",
|
|
564
564
|
overflowWrap: "anywhere"
|
|
565
565
|
},
|
|
566
|
-
children: o ||
|
|
566
|
+
children: o || h(e.display.name)
|
|
567
567
|
});
|
|
568
568
|
}
|
|
569
|
-
function K({ entity: e, record:
|
|
570
|
-
let o =
|
|
569
|
+
function K({ entity: e, record: n, fieldName: r, refs: i, locale: a }) {
|
|
570
|
+
let o = b(e, n, r);
|
|
571
571
|
if (o == null || o === "") return null;
|
|
572
|
-
let s = e.fields.get(
|
|
572
|
+
let s = e.fields.get(r);
|
|
573
573
|
return s ? /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V("dt", {
|
|
574
574
|
style: {
|
|
575
575
|
color: "var(--text-3)",
|
|
@@ -577,7 +577,7 @@ function K({ entity: e, record: t, fieldName: n, refs: r, locale: i }) {
|
|
|
577
577
|
minWidth: 0,
|
|
578
578
|
overflowWrap: "anywhere"
|
|
579
579
|
},
|
|
580
|
-
children:
|
|
580
|
+
children: t(s, r)
|
|
581
581
|
}), /* @__PURE__ */ V("dd", {
|
|
582
582
|
style: {
|
|
583
583
|
margin: 0,
|
|
@@ -586,18 +586,18 @@ function K({ entity: e, record: t, fieldName: n, refs: r, locale: i }) {
|
|
|
586
586
|
minWidth: 0,
|
|
587
587
|
overflowWrap: "anywhere"
|
|
588
588
|
},
|
|
589
|
-
children:
|
|
589
|
+
children: S({
|
|
590
590
|
entity: e,
|
|
591
|
-
fieldName:
|
|
592
|
-
record:
|
|
591
|
+
fieldName: r,
|
|
592
|
+
record: n,
|
|
593
593
|
mode: "display",
|
|
594
|
-
refs:
|
|
595
|
-
locale:
|
|
594
|
+
refs: i,
|
|
595
|
+
locale: a
|
|
596
596
|
})
|
|
597
597
|
})] }) : null;
|
|
598
598
|
}
|
|
599
599
|
function de({ entityCode: e, recordId: t, items: n, schema: r, entity: i, onBackToList: a, relatedRecordsPresentation: o }) {
|
|
600
|
-
return /* @__PURE__ */ V(
|
|
600
|
+
return /* @__PURE__ */ V(g, { children: /* @__PURE__ */ V(q, {
|
|
601
601
|
entityCode: e,
|
|
602
602
|
recordId: t,
|
|
603
603
|
items: n,
|
|
@@ -607,53 +607,53 @@ function de({ entityCode: e, recordId: t, items: n, schema: r, entity: i, onBack
|
|
|
607
607
|
relatedRecordsPresentation: o
|
|
608
608
|
}) });
|
|
609
609
|
}
|
|
610
|
-
function q({ entityCode:
|
|
611
|
-
let
|
|
610
|
+
function q({ entityCode: t, recordId: r, items: i, schema: a, entity: l, onBackToList: p, relatedRecordsPresentation: g }) {
|
|
611
|
+
let _ = c(l, "update"), te = L(() => r ? d(l, r) : void 0, [r, l]), { data: ne, isLoading: re } = v(t, te), S = y(t), T = u(), [D, k] = z(!1), [A, j] = z({}), M = ne?.data, oe = M?.$statuses, se = M?.$properties, P = O(t, r), I = ae(t, r), R = L(() => {
|
|
612
612
|
let e = /* @__PURE__ */ new Set();
|
|
613
|
-
for (let [t, n] of
|
|
614
|
-
for (let [t] of
|
|
613
|
+
for (let [t, n] of l.fields) !n.auto && !n.primary && e.add(t);
|
|
614
|
+
for (let [t] of l.files ?? []) e.add(t);
|
|
615
615
|
return e;
|
|
616
|
-
}, [
|
|
616
|
+
}, [l]), ce = F(() => {
|
|
617
617
|
if (M) {
|
|
618
618
|
let e = {};
|
|
619
619
|
R.forEach((t) => {
|
|
620
|
-
let n =
|
|
621
|
-
e[t] =
|
|
620
|
+
let n = b(l, M, t);
|
|
621
|
+
e[t] = ie(l, t) ? n ?? null : n ?? "";
|
|
622
622
|
}), j(e);
|
|
623
623
|
}
|
|
624
624
|
k(!0);
|
|
625
625
|
}, [
|
|
626
626
|
M,
|
|
627
627
|
R,
|
|
628
|
-
|
|
628
|
+
l
|
|
629
629
|
]), le = F(async () => {
|
|
630
630
|
await T.flushAllDrafts(), k(!1), j({});
|
|
631
631
|
}, [T]), U = F(() => {
|
|
632
632
|
let e = {}, t = E({
|
|
633
|
-
entity:
|
|
633
|
+
entity: l,
|
|
634
634
|
formData: A,
|
|
635
635
|
record: M,
|
|
636
636
|
isNew: !1
|
|
637
637
|
}), n = w(t);
|
|
638
|
-
for (let [t, n] of Object.entries(A))
|
|
638
|
+
for (let [t, n] of Object.entries(A)) l.files?.has(t) || (e[t] = x(l, t, n));
|
|
639
639
|
if (Object.keys(t).length > 0 && (e.$files = t), Object.keys(e).length === 0) {
|
|
640
640
|
k(!1), j({});
|
|
641
641
|
return;
|
|
642
642
|
}
|
|
643
|
-
|
|
644
|
-
pkValues:
|
|
643
|
+
S.mutate({
|
|
644
|
+
pkValues: r,
|
|
645
645
|
data: e
|
|
646
646
|
}, {
|
|
647
647
|
onSuccess: () => {
|
|
648
|
-
n.forEach((e) => T.markCommitted(e)), k(!1), j({}),
|
|
648
|
+
n.forEach((e) => T.markCommitted(e)), k(!1), j({}), m.success("Saved");
|
|
649
649
|
},
|
|
650
|
-
onError: () =>
|
|
650
|
+
onError: () => m.error("Failed to save")
|
|
651
651
|
});
|
|
652
652
|
}, [
|
|
653
653
|
T,
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
654
|
+
S,
|
|
655
|
+
r,
|
|
656
|
+
l,
|
|
657
657
|
A,
|
|
658
658
|
M
|
|
659
659
|
]), ue = F((e, t) => {
|
|
@@ -662,13 +662,13 @@ function q({ entityCode: n, recordId: a, items: u, schema: d, entity: f, onBackT
|
|
|
662
662
|
[e]: t
|
|
663
663
|
}));
|
|
664
664
|
}, []);
|
|
665
|
-
if (
|
|
665
|
+
if (re) return /* @__PURE__ */ V(C, {});
|
|
666
666
|
if (!M) return null;
|
|
667
|
-
let W =
|
|
668
|
-
schema:
|
|
669
|
-
entity:
|
|
670
|
-
entityCode:
|
|
671
|
-
recordId:
|
|
667
|
+
let W = f(M, l), G = l.display?.display_field, K = W ? void 0 : G ? M[G] : M[l.fields.names()[0]], de = W || (K != null && typeof K != "object" ? ee(K) : h(l.display.name)), q = M?.$refs, J = {
|
|
668
|
+
schema: a,
|
|
669
|
+
entity: l,
|
|
670
|
+
entityCode: t,
|
|
671
|
+
recordId: r,
|
|
672
672
|
record: D ? {
|
|
673
673
|
...M,
|
|
674
674
|
...A
|
|
@@ -678,18 +678,18 @@ function q({ entityCode: n, recordId: a, items: u, schema: d, entity: f, onBackT
|
|
|
678
678
|
onFieldChange: D ? ue : void 0,
|
|
679
679
|
refs: q,
|
|
680
680
|
objectProperties: se ?? void 0,
|
|
681
|
-
onSetProperty:
|
|
681
|
+
onSetProperty: _ ? (e, t) => I.mutate({
|
|
682
682
|
propertyCode: e,
|
|
683
683
|
value: t
|
|
684
684
|
}) : void 0,
|
|
685
685
|
isPropertyPending: I.isPending,
|
|
686
686
|
objectStatuses: oe ?? void 0,
|
|
687
|
-
onSetStatus:
|
|
687
|
+
onSetStatus: _ ? (e, t) => P.mutate({
|
|
688
688
|
groupCode: e,
|
|
689
689
|
statusCode: t
|
|
690
690
|
}) : void 0,
|
|
691
691
|
isStatusPending: P.isPending,
|
|
692
|
-
relatedRecordsPresentation:
|
|
692
|
+
relatedRecordsPresentation: g
|
|
693
693
|
};
|
|
694
694
|
return /* @__PURE__ */ H("div", {
|
|
695
695
|
style: {
|
|
@@ -726,23 +726,23 @@ function q({ entityCode: n, recordId: a, items: u, schema: d, entity: f, onBackT
|
|
|
726
726
|
alignItems: "center",
|
|
727
727
|
gap: 6
|
|
728
728
|
},
|
|
729
|
-
children: [p && /* @__PURE__ */ V(
|
|
729
|
+
children: [p && /* @__PURE__ */ V(n, {
|
|
730
730
|
icon: /* @__PURE__ */ V(e.back, { size: 14 }),
|
|
731
731
|
title: "Back to list",
|
|
732
732
|
onClick: p
|
|
733
|
-
}),
|
|
733
|
+
}), _ && (D ? /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V(s, {
|
|
734
734
|
size: "xs",
|
|
735
735
|
icon: /* @__PURE__ */ V(e.x, { size: 12 }),
|
|
736
736
|
onClick: le,
|
|
737
737
|
children: "Cancel"
|
|
738
|
-
}), /* @__PURE__ */ V(
|
|
738
|
+
}), /* @__PURE__ */ V(s, {
|
|
739
739
|
kind: "primary",
|
|
740
740
|
size: "xs",
|
|
741
|
-
icon:
|
|
741
|
+
icon: S.isPending ? /* @__PURE__ */ V(o, { size: 12 }) : /* @__PURE__ */ V(e.save, { size: 12 }),
|
|
742
742
|
onClick: U,
|
|
743
|
-
disabled:
|
|
744
|
-
children:
|
|
745
|
-
})] }) : /* @__PURE__ */ V(
|
|
743
|
+
disabled: S.isPending,
|
|
744
|
+
children: S.isPending ? "Saving…" : "Save"
|
|
745
|
+
})] }) : /* @__PURE__ */ V(s, {
|
|
746
746
|
size: "xs",
|
|
747
747
|
icon: /* @__PURE__ */ V(e.edit, { size: 12 }),
|
|
748
748
|
onClick: ce,
|
|
@@ -758,8 +758,8 @@ function q({ entityCode: n, recordId: a, items: u, schema: d, entity: f, onBackT
|
|
|
758
758
|
flexDirection: "column",
|
|
759
759
|
gap: 12
|
|
760
760
|
},
|
|
761
|
-
children:
|
|
762
|
-
nodes:
|
|
761
|
+
children: i && i.length > 0 ? /* @__PURE__ */ V(N, {
|
|
762
|
+
nodes: i,
|
|
763
763
|
ctx: J
|
|
764
764
|
}) : /* @__PURE__ */ H("p", {
|
|
765
765
|
style: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { s as e } from "./DynamicIcon-DW5krHuX.js";
|
|
2
|
-
import {
|
|
2
|
+
import { Lr as t, kr as n } from "./useCurrentScreen-aHx9HH1m.js";
|
|
3
3
|
import { useRef as r, useState as i } from "react";
|
|
4
4
|
import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
5
5
|
//#region src/components/pages/list/SortHeaderMenu.tsx
|