@declarion/react 0.106.0 → 0.109.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/api/agents.js +8 -7
- package/dist-lib/api/client.js +48 -49
- package/dist-lib/components/agents/AgentChatPanel.impl.js +362 -301
- package/dist-lib/components/agents/ChatAttachments.js +144 -0
- package/dist-lib/components/agents/transcript-runs.js +1 -1
- package/dist-lib/components/chrome/AssociationTabs.js +89 -75
- package/dist-lib/components/detail-layout/AssociatedBlock.js +243 -235
- package/dist-lib/components/detail-layout/ChildrenCards.js +57 -55
- package/dist-lib/components/detail-layout/ChildrenList.js +45 -43
- package/dist-lib/components/detail-layout/ChildrenTable.js +93 -91
- package/dist-lib/components/detail-layout/ChildrenTimeline.js +160 -155
- package/dist-lib/components/detail-layout/widgets/EntityScorecardWidget.js +127 -121
- package/dist-lib/components/fields/RefCombobox.js +53 -48
- package/dist-lib/components/fields/index.js +1 -0
- package/dist-lib/components/file-widgets/useFileSelection.js +152 -0
- package/dist-lib/components/pages/SmartDetailPage.impl.js +506 -482
- package/dist-lib/components/pages/SmartRecordListPage.impl.js +335 -300
- package/dist-lib/components/pages/tenant-params/TenantParamsPage.impl.js +112 -109
- package/dist-lib/components/params/ParamsBlock.js +18 -15
- package/dist-lib/components/params/param-editors.js +60 -54
- package/dist-lib/components/primitives/RetryButton.js +14 -0
- package/dist-lib/components/primitives/StatTile.js +42 -34
- package/dist-lib/hooks/useAgentConversation.js +18 -13
- package/dist-lib/hooks/useParams.js +54 -52
- package/dist-lib/hooks/useSchema.js +5 -2
- package/dist-lib/hooks/useTimelineData.js +26 -24
- package/dist-lib/index.d.ts +89 -5
- package/dist-lib/index.js +95 -93
- package/dist-lib/lib/read-display-state.js +19 -0
- package/dist-lib/stores/auth.js +1 -0
- package/dist-lib/testing.d.ts +1 -1
- package/dist-lib/types/fieldType.js +1 -1
- package/dist-lib/{useResponsiveMode-ECv1AEhv.d.ts → useResponsiveMode-DODbtSrY.d.ts} +3 -0
- package/package.json +1 -1
|
@@ -3,207 +3,210 @@ import { fieldDisplayName as t, getDisplayValue as n, isUserEditableField as r,
|
|
|
3
3
|
import { useFirstScreenSettled as o } from "../../lib/capabilityPrefetch.js";
|
|
4
4
|
import { useSchema as s } from "../../hooks/useSchema.js";
|
|
5
5
|
import { textWithNodes as c } from "../../lib/language.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
6
|
+
import { failureTitle as l } from "../../lib/failure.js";
|
|
7
|
+
import { Icon as u } from "../primitives/Icons.js";
|
|
8
|
+
import { Btn as d } from "../primitives/Btn.js";
|
|
9
|
+
import { IconBtn as ee } from "../primitives/IconBtn.js";
|
|
9
10
|
import { useText as f } from "../../hooks/useText.js";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
11
|
+
import { RetryButton as p } from "../primitives/RetryButton.js";
|
|
12
|
+
import { useResponsiveMode as te } from "../../hooks/useResponsiveMode.js";
|
|
13
|
+
import { Spinner as ne } from "../primitives/Spinner.js";
|
|
14
|
+
import { TextInput as m } from "../primitives/Fields.js";
|
|
15
|
+
import { readDisplayState as h } from "../../lib/read-display-state.js";
|
|
16
|
+
import { pageInsetX as re } from "../../lib/page-inset.js";
|
|
17
|
+
import { readableSort as ie } from "../../lib/field-classification.js";
|
|
18
|
+
import { stripUnsupportedSortSegments as ae } from "../../lib/sort.js";
|
|
19
|
+
import { useObject as g } from "../../hooks/useObject.js";
|
|
20
|
+
import { useDebounce as oe } from "../../hooks/useDebounce.js";
|
|
21
|
+
import { FileDraftScope as _, useFileDraftScope as v } from "../file-widgets/draft-scope.js";
|
|
22
|
+
import { getEntityFileField as se, getSchemaFieldValue as y, renderSchemaField as b, schemaFieldHasValue as x, serializeSchemaFieldValue as S } from "../file-widgets/host.js";
|
|
23
|
+
import { buildFilesPayload as C, collectCommittedFileIds as ce } from "../file-widgets/payload.js";
|
|
24
|
+
import { useUpdateObject as le } from "../../hooks/useMutations.js";
|
|
25
|
+
import { useSetStatus as ue } from "../../hooks/useObjectStatus.js";
|
|
26
|
+
import { useSetProperty as de } from "../../hooks/useProperties.js";
|
|
27
|
+
import { countActiveFilters as fe, parseFilterURLState as pe, removeFilterAtPath as me, setFiltersInURL as w } from "../../lib/filters.js";
|
|
28
|
+
import { useScreenBack as T } from "../../hooks/useScreenBack.js";
|
|
29
|
+
import { useRegisterScreenTab as E } from "../../hooks/useRegisterScreenTab.js";
|
|
30
|
+
import { useTabSearchMirror as D } from "../../hooks/useTabSearchMirror.js";
|
|
31
|
+
import { DetailSkeleton as O } from "../shared/LoadingSkeleton.js";
|
|
32
|
+
import { FilterDrawer as k } from "../filters/FilterDrawer.js";
|
|
33
|
+
import { FilterChips as A } from "../filters/FilterChips.js";
|
|
34
|
+
import { useRowTenant as j } from "../../hooks/useRowTenant.js";
|
|
35
|
+
import { LayoutRenderer as M } from "../detail-layout/LayoutRenderer.js";
|
|
36
|
+
import { resolveCard as N, resolveListProjection as P } from "./list/cardProjection.js";
|
|
37
|
+
import { useListFilterPresentation as F } from "./list/useListFilterPresentation.js";
|
|
38
|
+
import { FilterOmittedNotice as he } from "../filters/FilterOmittedNotice.js";
|
|
39
|
+
import { useListQuery as ge } from "./list/useListQuery.js";
|
|
40
|
+
import { listLoadErrorDescription as _e } from "./list/ListNoRows.js";
|
|
41
|
+
import { useFilterValueLabels as ve } from "./list/use-filter-value-labels.js";
|
|
42
|
+
import { useCallback as I, useEffect as L, useMemo as R, useRef as z, useState as B } from "react";
|
|
43
|
+
import { Fragment as ye, jsx as V, jsxs as H } from "react/jsx-runtime";
|
|
44
|
+
import { useSearchParams as be } from "react-router";
|
|
42
45
|
//#region src/components/pages/SmartRecordListPage.impl.tsx
|
|
43
|
-
var
|
|
44
|
-
function
|
|
45
|
-
let n = f(), r = f("errors"), [i, a] =
|
|
46
|
-
|
|
47
|
-
let
|
|
46
|
+
var xe = 200, U = "items:";
|
|
47
|
+
function W({ screenCode: t }) {
|
|
48
|
+
let n = f(), r = f("errors"), [i, a] = be(), { data: c, refetch: l } = s(), p = te(), [ne, h] = B(!1), g = c?.screens[t], _ = g?.entity ? c?.entities[g.entity] : void 0, v = g?.entity;
|
|
49
|
+
E(g, _, i.toString()), D(g?.route);
|
|
50
|
+
let se = T(), y = i.get("selected") ?? null, b = i.get("search") ?? "", x = oe(b, 300), S = i.get("sort") ?? ie(_, g?.sort_default) ?? "", C = R(() => pe(i), [i]), { visibleFilterState: ce, filterFieldMeta: le, allFilterFieldMeta: ue, filterFieldName: de } = F(g, _, c?.entities, C.filters), O = ce.filters, j = I((e) => {
|
|
48
51
|
a((t) => {
|
|
49
52
|
let n = new URLSearchParams(t);
|
|
50
|
-
return
|
|
53
|
+
return w(e, n), n;
|
|
51
54
|
}, { replace: !0 });
|
|
52
|
-
}, [a]),
|
|
53
|
-
let e =
|
|
54
|
-
return
|
|
55
|
-
}, [
|
|
56
|
-
let e =
|
|
57
|
-
return e?.list?.presentation === "table" || e?.list?.presentation === "cards" ? e.list.presentation : e?.presentation === "table" || e?.presentation === "cards" ? e.presentation :
|
|
58
|
-
}, [
|
|
59
|
-
entity:
|
|
60
|
-
screen:
|
|
61
|
-
}), [
|
|
62
|
-
entity:
|
|
63
|
-
screen:
|
|
64
|
-
presentation:
|
|
65
|
-
visibleColumns:
|
|
66
|
-
card:
|
|
55
|
+
}, [a]), M = R(() => g?.columns ?? _?.fields.names().filter((e) => !_.fields.get(e)?.primary && !_.fields.get(e)?.auto && _.fields.get(e)?.display?.is_listable !== !1).slice(0, 4) ?? [], [g?.columns, _]), U = R(() => {
|
|
56
|
+
let e = g?.responsive?.[p.category]?.presentation;
|
|
57
|
+
return p.category === "phone" ? "drilldown" : e === "split" || e === "drilldown" || e === "stacked" ? e : "split";
|
|
58
|
+
}, [g?.responsive, p.category]), W = R(() => {
|
|
59
|
+
let e = g?.responsive?.[p.category];
|
|
60
|
+
return e?.list?.presentation === "table" || e?.list?.presentation === "cards" ? e.list.presentation : e?.presentation === "table" || e?.presentation === "cards" ? e.presentation : p.category === "phone" ? "cards" : "table";
|
|
61
|
+
}, [g?.responsive, p.category]), G = g?.responsive?.[p.category]?.layout?.related_records, K = R(() => N({
|
|
62
|
+
entity: _,
|
|
63
|
+
screen: g
|
|
64
|
+
}), [_, g]), q = R(() => P({
|
|
65
|
+
entity: _,
|
|
66
|
+
screen: g,
|
|
67
|
+
presentation: W,
|
|
68
|
+
visibleColumns: M,
|
|
69
|
+
card: K,
|
|
67
70
|
sort: S
|
|
68
71
|
}), [
|
|
69
|
-
v,
|
|
70
72
|
_,
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
73
|
+
g,
|
|
74
|
+
W,
|
|
75
|
+
M,
|
|
76
|
+
K,
|
|
74
77
|
S
|
|
75
|
-
]), J =
|
|
76
|
-
entity:
|
|
77
|
-
entityCode:
|
|
78
|
-
screen:
|
|
78
|
+
]), J = ge({
|
|
79
|
+
entity: _,
|
|
80
|
+
entityCode: v,
|
|
81
|
+
screen: g,
|
|
79
82
|
screenCode: t,
|
|
80
83
|
page: 1,
|
|
81
|
-
perPage:
|
|
82
|
-
sortForRequest:
|
|
83
|
-
debouncedSearch:
|
|
84
|
-
filters:
|
|
84
|
+
perPage: xe,
|
|
85
|
+
sortForRequest: ae(S),
|
|
86
|
+
debouncedSearch: x,
|
|
87
|
+
filters: O,
|
|
85
88
|
includeDeleted: !1,
|
|
86
|
-
expand:
|
|
87
|
-
select:
|
|
88
|
-
isHeld: !
|
|
89
|
+
expand: q.expandFields,
|
|
90
|
+
select: q.selectFields,
|
|
91
|
+
isHeld: !_,
|
|
89
92
|
retryHeld: () => {
|
|
90
|
-
|
|
93
|
+
l();
|
|
91
94
|
},
|
|
92
95
|
runCountQuery: !1,
|
|
93
|
-
urlKey: `${
|
|
94
|
-
}), we = J.rows, Te = J.refs,
|
|
95
|
-
o(!
|
|
96
|
-
let { labelFor:
|
|
96
|
+
urlKey: `${v ?? ""}|${i.toString()}`
|
|
97
|
+
}), we = J.rows, Te = J.refs, Y = J.isLoading;
|
|
98
|
+
o(!Y);
|
|
99
|
+
let { labelFor: Ee, refs: De } = ve(ue, O, Te, c?.entities), Oe = R(() => _?.fields.names().find((e) => _.fields.get(e)?.primary) ?? "id", [_]), ke = I((e, t) => {
|
|
97
100
|
a((t) => {
|
|
98
101
|
let n = new URLSearchParams(t);
|
|
99
102
|
return e ? n.set("selected", e) : n.delete("selected"), n;
|
|
100
103
|
}, { replace: t?.replace ?? !0 });
|
|
101
|
-
}, [a]),
|
|
104
|
+
}, [a]), Ae = I((e) => {
|
|
102
105
|
a((t) => {
|
|
103
106
|
let n = new URLSearchParams(t);
|
|
104
107
|
return e ? n.set("search", e) : n.delete("search"), n;
|
|
105
108
|
}, { replace: !0 });
|
|
106
|
-
}, [a]),
|
|
107
|
-
|
|
108
|
-
|
|
109
|
+
}, [a]), X = (g?.list_resizable ?? !1) && U === "split" && p.category !== "phone" && !p.touch, je = z(null), [Z, Q] = B(null), Me = z(!1), $ = g?.list_width;
|
|
110
|
+
L(() => {
|
|
111
|
+
X && $?.endsWith("%") && Q(null);
|
|
109
112
|
}, [
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
]),
|
|
115
|
-
if (!
|
|
116
|
-
let e =
|
|
113
|
+
X,
|
|
114
|
+
$,
|
|
115
|
+
p.width,
|
|
116
|
+
p.height
|
|
117
|
+
]), L(() => {
|
|
118
|
+
if (!X || Z !== null) return;
|
|
119
|
+
let e = je.current;
|
|
117
120
|
if (e) {
|
|
118
|
-
if (
|
|
119
|
-
let t = parseFloat(
|
|
120
|
-
|
|
121
|
-
} else
|
|
121
|
+
if ($ && $.endsWith("%")) {
|
|
122
|
+
let t = parseFloat($) / 100;
|
|
123
|
+
Q(Math.round(e.getBoundingClientRect().width * t));
|
|
124
|
+
} else Q($ && parseInt($, 10) || 320);
|
|
122
125
|
}
|
|
123
126
|
}, [
|
|
124
|
-
Y,
|
|
125
|
-
Q,
|
|
126
127
|
X,
|
|
127
|
-
|
|
128
|
+
$,
|
|
129
|
+
Z,
|
|
130
|
+
_
|
|
128
131
|
]);
|
|
129
|
-
let
|
|
130
|
-
|
|
131
|
-
|
|
132
|
+
let Ne = z(null);
|
|
133
|
+
L(() => () => {
|
|
134
|
+
Ne.current?.();
|
|
132
135
|
}, []);
|
|
133
|
-
let
|
|
134
|
-
e.preventDefault(),
|
|
135
|
-
let t = e.clientX, n =
|
|
136
|
-
if (!
|
|
137
|
-
let r = (
|
|
138
|
-
|
|
136
|
+
let Pe = I((e) => {
|
|
137
|
+
e.preventDefault(), Me.current = !0;
|
|
138
|
+
let t = e.clientX, n = Z ?? 320, r = (e) => {
|
|
139
|
+
if (!Me.current) return;
|
|
140
|
+
let r = (je.current?.getBoundingClientRect().width ?? window.innerWidth) - 300, i = Math.max(200, Math.min(r, n + e.clientX - t));
|
|
141
|
+
Q(i);
|
|
139
142
|
}, i = () => {
|
|
140
|
-
|
|
143
|
+
Me.current = !1, document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", i), document.body.style.cursor = "", document.body.style.userSelect = "", Ne.current = null;
|
|
141
144
|
};
|
|
142
|
-
document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", document.addEventListener("mousemove", r), document.addEventListener("mouseup", i),
|
|
143
|
-
}, [
|
|
144
|
-
if (!c || !
|
|
145
|
-
let
|
|
146
|
-
return /* @__PURE__ */
|
|
147
|
-
ref:
|
|
148
|
-
"data-record-list-presentation":
|
|
145
|
+
document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", document.addEventListener("mousemove", r), document.addEventListener("mouseup", i), Ne.current = i;
|
|
146
|
+
}, [Z]);
|
|
147
|
+
if (!c || !g || !_) return null;
|
|
148
|
+
let Fe = fe(O), Ie = U === "split" || U === "stacked" || !y, Le = U === "split" || U === "stacked" || !!y, Re = U !== "split" && y ? () => ke(null, { replace: !0 }) : void 0, ze = U === "split" ? X && Z !== null ? Z : g.list_width ?? "320px" : "100%";
|
|
149
|
+
return /* @__PURE__ */ H("div", {
|
|
150
|
+
ref: je,
|
|
151
|
+
"data-record-list-presentation": U,
|
|
149
152
|
style: {
|
|
150
153
|
display: "flex",
|
|
151
|
-
flexDirection:
|
|
154
|
+
flexDirection: U === "stacked" ? "column" : "row",
|
|
152
155
|
height: "100%",
|
|
153
156
|
minWidth: 0,
|
|
154
157
|
overflow: "hidden"
|
|
155
158
|
},
|
|
156
159
|
children: [
|
|
157
|
-
|
|
160
|
+
Ie && /* @__PURE__ */ H("div", {
|
|
158
161
|
"data-testid": "record-list-panel",
|
|
159
162
|
style: {
|
|
160
|
-
flex:
|
|
163
|
+
flex: U === "split" ? "none" : "1 1 auto",
|
|
161
164
|
display: "flex",
|
|
162
165
|
flexDirection: "column",
|
|
163
166
|
overflow: "hidden",
|
|
164
|
-
borderRight:
|
|
165
|
-
borderBottom:
|
|
167
|
+
borderRight: U === "split" && !X ? "1px solid var(--divider)" : "none",
|
|
168
|
+
borderBottom: U === "stacked" ? "1px solid var(--divider)" : "none",
|
|
166
169
|
width: ze,
|
|
167
170
|
minWidth: 0,
|
|
168
|
-
height:
|
|
171
|
+
height: U === "stacked" ? "50%" : "100%"
|
|
169
172
|
},
|
|
170
|
-
children: [/* @__PURE__ */
|
|
173
|
+
children: [/* @__PURE__ */ H("div", {
|
|
171
174
|
style: {
|
|
172
175
|
paddingTop: 12,
|
|
173
176
|
paddingBottom: 12,
|
|
174
|
-
...
|
|
177
|
+
...re(12),
|
|
175
178
|
display: "flex",
|
|
176
179
|
flexDirection: "column",
|
|
177
180
|
gap: 8,
|
|
178
181
|
borderBottom: "1px solid var(--divider)"
|
|
179
182
|
},
|
|
180
183
|
children: [
|
|
181
|
-
|
|
184
|
+
se.hasOriginBack && /* @__PURE__ */ H("div", {
|
|
182
185
|
style: {
|
|
183
186
|
display: "flex",
|
|
184
187
|
alignItems: "center",
|
|
185
188
|
gap: 8
|
|
186
189
|
},
|
|
187
|
-
children: [/* @__PURE__ */
|
|
188
|
-
icon: /* @__PURE__ */
|
|
190
|
+
children: [/* @__PURE__ */ V(ee, {
|
|
191
|
+
icon: /* @__PURE__ */ V(u.back, { size: 14 }),
|
|
189
192
|
title: n("list.header.back", "Back"),
|
|
190
|
-
onClick:
|
|
191
|
-
}), /* @__PURE__ */
|
|
193
|
+
onClick: se.goBack
|
|
194
|
+
}), /* @__PURE__ */ V("span", {
|
|
192
195
|
style: {
|
|
193
196
|
fontSize: 12.5,
|
|
194
197
|
fontWeight: 600,
|
|
195
198
|
color: "var(--text)"
|
|
196
199
|
},
|
|
197
|
-
children: n(
|
|
200
|
+
children: n(g.display?.name) || n(_.display.name_plural)
|
|
198
201
|
})]
|
|
199
202
|
}),
|
|
200
|
-
/* @__PURE__ */
|
|
201
|
-
value:
|
|
202
|
-
onChange:
|
|
203
|
-
placeholder: n("list.toolbar.search_placeholder", "Search {name}…", { name: n(
|
|
204
|
-
prefix: /* @__PURE__ */
|
|
203
|
+
/* @__PURE__ */ V(m, {
|
|
204
|
+
value: b,
|
|
205
|
+
onChange: Ae,
|
|
206
|
+
placeholder: n("list.toolbar.search_placeholder", "Search {name}…", { name: n(_.display.name_plural) }),
|
|
207
|
+
prefix: /* @__PURE__ */ V(u.search, { size: 13 })
|
|
205
208
|
}),
|
|
206
|
-
C.error && /* @__PURE__ */
|
|
209
|
+
C.error && /* @__PURE__ */ H("div", {
|
|
207
210
|
role: "alert",
|
|
208
211
|
"data-testid": "record-list-filter-url-error",
|
|
209
212
|
style: {
|
|
@@ -219,22 +222,22 @@ function U({ screenCode: t }) {
|
|
|
219
222
|
n("list.filters.invalid_suffix", "Showing this list without URL filters.")
|
|
220
223
|
]
|
|
221
224
|
}),
|
|
222
|
-
/* @__PURE__ */
|
|
225
|
+
/* @__PURE__ */ H(d, {
|
|
223
226
|
size: "xs",
|
|
224
|
-
icon: /* @__PURE__ */
|
|
225
|
-
onClick: () =>
|
|
226
|
-
children: [n("filter.drawer.title", "Filters"),
|
|
227
|
+
icon: /* @__PURE__ */ V(u.filter, { size: 12 }),
|
|
228
|
+
onClick: () => h(!0),
|
|
229
|
+
children: [n("filter.drawer.title", "Filters"), Fe > 0 ? ` (${Fe})` : ""]
|
|
227
230
|
}),
|
|
228
|
-
|
|
229
|
-
/* @__PURE__ */
|
|
230
|
-
filters:
|
|
231
|
-
resolveValue:
|
|
231
|
+
ce.omitted && /* @__PURE__ */ V(he, {}),
|
|
232
|
+
/* @__PURE__ */ V(A, {
|
|
233
|
+
filters: O,
|
|
234
|
+
resolveValue: Ee,
|
|
232
235
|
fieldLabel: de,
|
|
233
|
-
onRemoveAtPath: (e) =>
|
|
234
|
-
onClearAll: () =>
|
|
235
|
-
onChipClick: () =>
|
|
236
|
+
onRemoveAtPath: (e) => j(me(O, e)),
|
|
237
|
+
onClearAll: () => j([]),
|
|
238
|
+
onChipClick: () => h(!0)
|
|
236
239
|
}),
|
|
237
|
-
/* @__PURE__ */
|
|
240
|
+
/* @__PURE__ */ V("div", {
|
|
238
241
|
style: {
|
|
239
242
|
display: "flex",
|
|
240
243
|
alignItems: "center",
|
|
@@ -242,47 +245,64 @@ function U({ screenCode: t }) {
|
|
|
242
245
|
fontSize: 11,
|
|
243
246
|
color: "var(--text-3)"
|
|
244
247
|
},
|
|
245
|
-
children: /* @__PURE__ */
|
|
248
|
+
children: /* @__PURE__ */ V("span", { children: Y ? n("list.records.loading", "Loading…") : J.isError ? r("list.rows_unreadable", "The records could not be loaded.") : n("list.records.count", "{count} {name}", {
|
|
246
249
|
count: we.length,
|
|
247
|
-
name: n(
|
|
250
|
+
name: n(_.display.name_plural)
|
|
248
251
|
}) })
|
|
249
252
|
})
|
|
250
253
|
]
|
|
251
|
-
}), /* @__PURE__ */
|
|
254
|
+
}), /* @__PURE__ */ V("div", {
|
|
252
255
|
style: {
|
|
253
256
|
flex: 1,
|
|
254
257
|
overflowY: "auto",
|
|
255
|
-
padding:
|
|
256
|
-
display:
|
|
258
|
+
padding: W === "cards" ? 10 : 0,
|
|
259
|
+
display: W === "cards" ? "flex" : "block",
|
|
257
260
|
flexDirection: "column",
|
|
258
|
-
gap:
|
|
261
|
+
gap: W === "cards" ? 10 : void 0
|
|
259
262
|
},
|
|
260
|
-
children:
|
|
263
|
+
children: Y && J.isLoadingStale ? /* @__PURE__ */ H("div", {
|
|
264
|
+
role: "alert",
|
|
265
|
+
style: {
|
|
266
|
+
padding: 16,
|
|
267
|
+
color: "var(--text-2)"
|
|
268
|
+
},
|
|
269
|
+
children: [
|
|
270
|
+
n("list.rows.loading_slow_title", "Still loading data"),
|
|
271
|
+
" ",
|
|
272
|
+
/* @__PURE__ */ V(d, {
|
|
273
|
+
size: "xs",
|
|
274
|
+
onClick: () => {
|
|
275
|
+
J.retry();
|
|
276
|
+
},
|
|
277
|
+
children: n("list.rows.retry", "Retry")
|
|
278
|
+
})
|
|
279
|
+
]
|
|
280
|
+
}) : Y ? /* @__PURE__ */ V("div", {
|
|
261
281
|
style: {
|
|
262
282
|
padding: 12,
|
|
263
283
|
display: "flex",
|
|
264
284
|
flexDirection: "column",
|
|
265
285
|
gap: 6
|
|
266
286
|
},
|
|
267
|
-
children: Array.from({ length: 8 }).map((e, t) => /* @__PURE__ */
|
|
287
|
+
children: Array.from({ length: 8 }).map((e, t) => /* @__PURE__ */ V("div", { style: {
|
|
268
288
|
height: 48,
|
|
269
289
|
borderRadius: "var(--radius-md)",
|
|
270
290
|
background: "var(--surface-3)"
|
|
271
291
|
} }, t))
|
|
272
|
-
}) : J.isError ? /* @__PURE__ */
|
|
292
|
+
}) : J.isError ? /* @__PURE__ */ H("div", {
|
|
273
293
|
role: "alert",
|
|
274
294
|
style: {
|
|
275
295
|
padding: 16,
|
|
276
296
|
color: "var(--text-2)"
|
|
277
297
|
},
|
|
278
|
-
children: [
|
|
298
|
+
children: [_e(n, r, _, J.error), /* @__PURE__ */ V(d, {
|
|
279
299
|
size: "xs",
|
|
280
300
|
onClick: () => {
|
|
281
301
|
J.retry();
|
|
282
302
|
},
|
|
283
303
|
children: n("list.rows.retry", "Retry")
|
|
284
304
|
})]
|
|
285
|
-
}) : we.length === 0 ? /* @__PURE__ */
|
|
305
|
+
}) : we.length === 0 ? /* @__PURE__ */ V("div", {
|
|
286
306
|
style: {
|
|
287
307
|
padding: 28,
|
|
288
308
|
textAlign: "center",
|
|
@@ -290,19 +310,19 @@ function U({ screenCode: t }) {
|
|
|
290
310
|
color: "var(--text-3)"
|
|
291
311
|
},
|
|
292
312
|
children: n("list.records.none", "No records found")
|
|
293
|
-
}) : /* @__PURE__ */
|
|
294
|
-
let n = e(t[
|
|
295
|
-
return /* @__PURE__ */
|
|
313
|
+
}) : /* @__PURE__ */ H(ye, { children: [we.map((t) => {
|
|
314
|
+
let n = e(t[Oe]);
|
|
315
|
+
return /* @__PURE__ */ V(Se, {
|
|
296
316
|
record: t,
|
|
297
|
-
entity:
|
|
298
|
-
columns:
|
|
299
|
-
card:
|
|
300
|
-
presentation:
|
|
317
|
+
entity: _,
|
|
318
|
+
columns: M,
|
|
319
|
+
card: K,
|
|
320
|
+
presentation: W,
|
|
301
321
|
refs: Te,
|
|
302
|
-
isSelected: n ===
|
|
303
|
-
onClick: () =>
|
|
322
|
+
isSelected: n === y,
|
|
323
|
+
onClick: () => ke(n, { replace: U === "split" })
|
|
304
324
|
}, n);
|
|
305
|
-
}), J.isCursor && J.hasMorePages && /* @__PURE__ */
|
|
325
|
+
}), J.isCursor && J.hasMorePages && /* @__PURE__ */ V("button", {
|
|
306
326
|
type: "button",
|
|
307
327
|
"data-testid": "record-list-load-more",
|
|
308
328
|
onClick: J.fetchNextPage,
|
|
@@ -321,9 +341,9 @@ function U({ screenCode: t }) {
|
|
|
321
341
|
})] })
|
|
322
342
|
})]
|
|
323
343
|
}),
|
|
324
|
-
|
|
344
|
+
X && /* @__PURE__ */ V("div", {
|
|
325
345
|
"data-testid": "record-list-resize-handle",
|
|
326
|
-
onMouseDown:
|
|
346
|
+
onMouseDown: Pe,
|
|
327
347
|
style: {
|
|
328
348
|
flex: "none",
|
|
329
349
|
width: 1,
|
|
@@ -334,7 +354,7 @@ function U({ screenCode: t }) {
|
|
|
334
354
|
onMouseEnter: (e) => e.currentTarget.style.background = "var(--border-strong)",
|
|
335
355
|
onMouseLeave: (e) => e.currentTarget.style.background = "var(--divider)"
|
|
336
356
|
}),
|
|
337
|
-
Le && /* @__PURE__ */
|
|
357
|
+
Le && /* @__PURE__ */ H("div", {
|
|
338
358
|
"data-testid": "record-detail-panel",
|
|
339
359
|
style: {
|
|
340
360
|
flex: 1,
|
|
@@ -342,23 +362,23 @@ function U({ screenCode: t }) {
|
|
|
342
362
|
flexDirection: "column",
|
|
343
363
|
minWidth: 0,
|
|
344
364
|
overflow: "hidden",
|
|
345
|
-
height:
|
|
365
|
+
height: U === "stacked" ? "50%" : "100%"
|
|
346
366
|
},
|
|
347
|
-
children: [
|
|
367
|
+
children: [!Ie && ce.omitted && /* @__PURE__ */ V(he, { className: "p-4" }), /* @__PURE__ */ V("div", {
|
|
348
368
|
style: {
|
|
349
369
|
flex: 1,
|
|
350
370
|
minHeight: 0
|
|
351
371
|
},
|
|
352
|
-
children:
|
|
353
|
-
entityCode:
|
|
354
|
-
recordId:
|
|
355
|
-
items:
|
|
372
|
+
children: y ? /* @__PURE__ */ V(Ce, {
|
|
373
|
+
entityCode: v,
|
|
374
|
+
recordId: y,
|
|
375
|
+
items: g.items,
|
|
356
376
|
schema: c,
|
|
357
|
-
entity:
|
|
377
|
+
entity: _,
|
|
358
378
|
onBackToList: Re,
|
|
359
|
-
onOpenFilters:
|
|
360
|
-
relatedRecordsPresentation:
|
|
361
|
-
},
|
|
379
|
+
onOpenFilters: Ie ? void 0 : () => h(!0),
|
|
380
|
+
relatedRecordsPresentation: G
|
|
381
|
+
}, y) : /* @__PURE__ */ V("div", {
|
|
362
382
|
style: {
|
|
363
383
|
display: "flex",
|
|
364
384
|
alignItems: "center",
|
|
@@ -366,33 +386,33 @@ function U({ screenCode: t }) {
|
|
|
366
386
|
height: "100%",
|
|
367
387
|
color: "var(--text-3)"
|
|
368
388
|
},
|
|
369
|
-
children: /* @__PURE__ */
|
|
389
|
+
children: /* @__PURE__ */ V("p", {
|
|
370
390
|
style: { fontSize: 12.5 },
|
|
371
|
-
children: n("list.detail.select_prompt", "Select a {name} to view details", { name: n(
|
|
391
|
+
children: n("list.detail.select_prompt", "Select a {name} to view details", { name: n(_.display.name) })
|
|
372
392
|
})
|
|
373
393
|
})
|
|
374
394
|
})]
|
|
375
395
|
}),
|
|
376
|
-
/* @__PURE__ */
|
|
377
|
-
open:
|
|
378
|
-
onClose: () =>
|
|
379
|
-
filters:
|
|
380
|
-
onApply:
|
|
381
|
-
availableFields:
|
|
382
|
-
allFields:
|
|
396
|
+
/* @__PURE__ */ V(k, {
|
|
397
|
+
open: ne,
|
|
398
|
+
onClose: () => h(!1),
|
|
399
|
+
filters: O,
|
|
400
|
+
onApply: j,
|
|
401
|
+
availableFields: le,
|
|
402
|
+
allFields: ue,
|
|
383
403
|
fieldLabel: de,
|
|
384
|
-
resolveValue:
|
|
385
|
-
defaultFilters:
|
|
386
|
-
refs:
|
|
404
|
+
resolveValue: Ee,
|
|
405
|
+
defaultFilters: g.default_filters,
|
|
406
|
+
refs: De
|
|
387
407
|
})
|
|
388
408
|
]
|
|
389
409
|
});
|
|
390
410
|
}
|
|
391
|
-
function
|
|
411
|
+
function Se({ record: e, entity: t, columns: n, card: r, presentation: i, refs: a, isSelected: o, onClick: s }) {
|
|
392
412
|
let c = f();
|
|
393
413
|
if (i === "cards") {
|
|
394
|
-
let n = r.badgeFields.filter((n) =>
|
|
395
|
-
return /* @__PURE__ */
|
|
414
|
+
let n = r.badgeFields.filter((n) => x(t, e, n)), i = r.bodyFields.filter((n) => x(t, e, n)), l = r.metaFields.filter((n) => x(t, e, n));
|
|
415
|
+
return /* @__PURE__ */ H("button", {
|
|
396
416
|
type: "button",
|
|
397
417
|
"data-testid": "record-list-card",
|
|
398
418
|
"aria-current": o ? "true" : void 0,
|
|
@@ -412,19 +432,19 @@ function W({ record: e, entity: t, columns: n, card: r, presentation: i, refs: a
|
|
|
412
432
|
boxShadow: o ? "inset 3px 0 0 var(--accent)" : "none"
|
|
413
433
|
},
|
|
414
434
|
children: [
|
|
415
|
-
/* @__PURE__ */
|
|
435
|
+
/* @__PURE__ */ V(G, {
|
|
416
436
|
entity: t,
|
|
417
437
|
record: e,
|
|
418
438
|
field: r.titleField,
|
|
419
439
|
refs: a
|
|
420
440
|
}),
|
|
421
|
-
r.subtitleField && /* @__PURE__ */
|
|
441
|
+
r.subtitleField && /* @__PURE__ */ V("div", {
|
|
422
442
|
style: {
|
|
423
443
|
fontSize: 12,
|
|
424
444
|
color: "var(--text-3)",
|
|
425
445
|
overflowWrap: "anywhere"
|
|
426
446
|
},
|
|
427
|
-
children:
|
|
447
|
+
children: b({
|
|
428
448
|
entity: t,
|
|
429
449
|
fieldName: r.subtitleField,
|
|
430
450
|
record: e,
|
|
@@ -433,13 +453,13 @@ function W({ record: e, entity: t, columns: n, card: r, presentation: i, refs: a
|
|
|
433
453
|
t: c
|
|
434
454
|
})
|
|
435
455
|
}),
|
|
436
|
-
n.length > 0 && /* @__PURE__ */
|
|
456
|
+
n.length > 0 && /* @__PURE__ */ V("div", {
|
|
437
457
|
style: {
|
|
438
458
|
display: "flex",
|
|
439
459
|
flexWrap: "wrap",
|
|
440
460
|
gap: 6
|
|
441
461
|
},
|
|
442
|
-
children: n.map((n) => /* @__PURE__ */
|
|
462
|
+
children: n.map((n) => /* @__PURE__ */ V("span", {
|
|
443
463
|
style: {
|
|
444
464
|
border: "1px solid var(--border)",
|
|
445
465
|
borderRadius: 999,
|
|
@@ -449,7 +469,7 @@ function W({ record: e, entity: t, columns: n, card: r, presentation: i, refs: a
|
|
|
449
469
|
maxWidth: "100%",
|
|
450
470
|
overflowWrap: "anywhere"
|
|
451
471
|
},
|
|
452
|
-
children:
|
|
472
|
+
children: b({
|
|
453
473
|
entity: t,
|
|
454
474
|
fieldName: n,
|
|
455
475
|
record: e,
|
|
@@ -459,21 +479,21 @@ function W({ record: e, entity: t, columns: n, card: r, presentation: i, refs: a
|
|
|
459
479
|
})
|
|
460
480
|
}, n))
|
|
461
481
|
}),
|
|
462
|
-
i.length > 0 && /* @__PURE__ */
|
|
482
|
+
i.length > 0 && /* @__PURE__ */ V("dl", {
|
|
463
483
|
style: {
|
|
464
484
|
display: "grid",
|
|
465
485
|
gridTemplateColumns: "minmax(72px, max-content) minmax(0, 1fr)",
|
|
466
486
|
gap: "5px 10px",
|
|
467
487
|
margin: 0
|
|
468
488
|
},
|
|
469
|
-
children: i.map((n) => /* @__PURE__ */
|
|
489
|
+
children: i.map((n) => /* @__PURE__ */ V(K, {
|
|
470
490
|
entity: t,
|
|
471
491
|
record: e,
|
|
472
492
|
fieldName: n,
|
|
473
493
|
refs: a
|
|
474
494
|
}, n))
|
|
475
495
|
}),
|
|
476
|
-
l.length > 0 && /* @__PURE__ */
|
|
496
|
+
l.length > 0 && /* @__PURE__ */ V("div", {
|
|
477
497
|
style: {
|
|
478
498
|
display: "flex",
|
|
479
499
|
flexWrap: "wrap",
|
|
@@ -481,12 +501,12 @@ function W({ record: e, entity: t, columns: n, card: r, presentation: i, refs: a
|
|
|
481
501
|
fontSize: 11,
|
|
482
502
|
color: "var(--text-3)"
|
|
483
503
|
},
|
|
484
|
-
children: l.map((n) => /* @__PURE__ */
|
|
504
|
+
children: l.map((n) => /* @__PURE__ */ V("span", {
|
|
485
505
|
style: {
|
|
486
506
|
minWidth: 0,
|
|
487
507
|
overflowWrap: "anywhere"
|
|
488
508
|
},
|
|
489
|
-
children:
|
|
509
|
+
children: b({
|
|
490
510
|
entity: t,
|
|
491
511
|
fieldName: n,
|
|
492
512
|
record: e,
|
|
@@ -500,7 +520,7 @@ function W({ record: e, entity: t, columns: n, card: r, presentation: i, refs: a
|
|
|
500
520
|
});
|
|
501
521
|
}
|
|
502
522
|
let l = n[0], u = n[1], d = n.slice(2, 4);
|
|
503
|
-
return /* @__PURE__ */
|
|
523
|
+
return /* @__PURE__ */ H("button", {
|
|
504
524
|
onClick: s,
|
|
505
525
|
style: {
|
|
506
526
|
width: "100%",
|
|
@@ -523,7 +543,7 @@ function W({ record: e, entity: t, columns: n, card: r, presentation: i, refs: a
|
|
|
523
543
|
onMouseLeave: (e) => {
|
|
524
544
|
o || (e.currentTarget.style.background = "transparent");
|
|
525
545
|
},
|
|
526
|
-
children: [l && /* @__PURE__ */
|
|
546
|
+
children: [l && /* @__PURE__ */ V("div", {
|
|
527
547
|
style: {
|
|
528
548
|
fontSize: 12.5,
|
|
529
549
|
fontWeight: 500,
|
|
@@ -532,7 +552,7 @@ function W({ record: e, entity: t, columns: n, card: r, presentation: i, refs: a
|
|
|
532
552
|
whiteSpace: "nowrap",
|
|
533
553
|
color: "var(--text)"
|
|
534
554
|
},
|
|
535
|
-
children:
|
|
555
|
+
children: b({
|
|
536
556
|
entity: t,
|
|
537
557
|
fieldName: l,
|
|
538
558
|
record: e,
|
|
@@ -540,13 +560,13 @@ function W({ record: e, entity: t, columns: n, card: r, presentation: i, refs: a
|
|
|
540
560
|
refs: a,
|
|
541
561
|
t: c
|
|
542
562
|
})
|
|
543
|
-
}), /* @__PURE__ */
|
|
563
|
+
}), /* @__PURE__ */ H("div", {
|
|
544
564
|
style: {
|
|
545
565
|
display: "flex",
|
|
546
566
|
alignItems: "center",
|
|
547
567
|
gap: 6
|
|
548
568
|
},
|
|
549
|
-
children: [u && /* @__PURE__ */
|
|
569
|
+
children: [u && /* @__PURE__ */ V("div", {
|
|
550
570
|
style: {
|
|
551
571
|
fontSize: 11,
|
|
552
572
|
color: "var(--text-3)",
|
|
@@ -555,7 +575,7 @@ function W({ record: e, entity: t, columns: n, card: r, presentation: i, refs: a
|
|
|
555
575
|
textOverflow: "ellipsis",
|
|
556
576
|
whiteSpace: "nowrap"
|
|
557
577
|
},
|
|
558
|
-
children:
|
|
578
|
+
children: b({
|
|
559
579
|
entity: t,
|
|
560
580
|
fieldName: u,
|
|
561
581
|
record: e,
|
|
@@ -563,16 +583,16 @@ function W({ record: e, entity: t, columns: n, card: r, presentation: i, refs: a
|
|
|
563
583
|
refs: a,
|
|
564
584
|
t: c
|
|
565
585
|
})
|
|
566
|
-
}), /* @__PURE__ */
|
|
586
|
+
}), /* @__PURE__ */ V("div", {
|
|
567
587
|
style: {
|
|
568
588
|
display: "flex",
|
|
569
589
|
alignItems: "center",
|
|
570
590
|
gap: 4,
|
|
571
591
|
flexShrink: 0
|
|
572
592
|
},
|
|
573
|
-
children: d.map((n) =>
|
|
593
|
+
children: d.map((n) => y(t, e, n) == null ? null : /* @__PURE__ */ V("div", {
|
|
574
594
|
style: { fontSize: 11 },
|
|
575
|
-
children:
|
|
595
|
+
children: b({
|
|
576
596
|
entity: t,
|
|
577
597
|
fieldName: n,
|
|
578
598
|
record: e,
|
|
@@ -586,7 +606,7 @@ function W({ record: e, entity: t, columns: n, card: r, presentation: i, refs: a
|
|
|
586
606
|
});
|
|
587
607
|
}
|
|
588
608
|
function G({ entity: e, record: t, field: r, refs: i }) {
|
|
589
|
-
let a = f(), o = n(a, t, e), s = r ?
|
|
609
|
+
let a = f(), o = n(a, t, e), s = r ? b({
|
|
590
610
|
entity: e,
|
|
591
611
|
fieldName: r,
|
|
592
612
|
record: t,
|
|
@@ -594,7 +614,7 @@ function G({ entity: e, record: t, field: r, refs: i }) {
|
|
|
594
614
|
refs: i,
|
|
595
615
|
t: a
|
|
596
616
|
}) : o;
|
|
597
|
-
return /* @__PURE__ */
|
|
617
|
+
return /* @__PURE__ */ V("div", {
|
|
598
618
|
style: {
|
|
599
619
|
fontSize: 13.5,
|
|
600
620
|
fontWeight: 600,
|
|
@@ -605,10 +625,10 @@ function G({ entity: e, record: t, field: r, refs: i }) {
|
|
|
605
625
|
});
|
|
606
626
|
}
|
|
607
627
|
function K({ entity: e, record: n, fieldName: r, refs: i }) {
|
|
608
|
-
let a = f(), o =
|
|
628
|
+
let a = f(), o = y(e, n, r);
|
|
609
629
|
if (o == null || o === "") return null;
|
|
610
630
|
let s = e.fields.get(r);
|
|
611
|
-
return s ? /* @__PURE__ */
|
|
631
|
+
return s ? /* @__PURE__ */ H(ye, { children: [/* @__PURE__ */ V("dt", {
|
|
612
632
|
style: {
|
|
613
633
|
color: "var(--text-3)",
|
|
614
634
|
fontSize: 11.5,
|
|
@@ -616,7 +636,7 @@ function K({ entity: e, record: n, fieldName: r, refs: i }) {
|
|
|
616
636
|
overflowWrap: "anywhere"
|
|
617
637
|
},
|
|
618
638
|
children: t(a, s, r)
|
|
619
|
-
}), /* @__PURE__ */
|
|
639
|
+
}), /* @__PURE__ */ V("dd", {
|
|
620
640
|
style: {
|
|
621
641
|
margin: 0,
|
|
622
642
|
color: "var(--text)",
|
|
@@ -624,7 +644,7 @@ function K({ entity: e, record: n, fieldName: r, refs: i }) {
|
|
|
624
644
|
minWidth: 0,
|
|
625
645
|
overflowWrap: "anywhere"
|
|
626
646
|
},
|
|
627
|
-
children:
|
|
647
|
+
children: b({
|
|
628
648
|
entity: e,
|
|
629
649
|
fieldName: r,
|
|
630
650
|
record: n,
|
|
@@ -634,8 +654,8 @@ function K({ entity: e, record: n, fieldName: r, refs: i }) {
|
|
|
634
654
|
})
|
|
635
655
|
})] }) : null;
|
|
636
656
|
}
|
|
637
|
-
function
|
|
638
|
-
return /* @__PURE__ */
|
|
657
|
+
function Ce({ entityCode: e, recordId: t, items: n, schema: r, entity: i, onBackToList: a, onOpenFilters: o, relatedRecordsPresentation: s }) {
|
|
658
|
+
return /* @__PURE__ */ V(_, { children: /* @__PURE__ */ V(q, {
|
|
639
659
|
entityCode: e,
|
|
640
660
|
recordId: t,
|
|
641
661
|
items: n,
|
|
@@ -646,104 +666,119 @@ function be({ entityCode: e, recordId: t, items: n, schema: r, entity: i, onBack
|
|
|
646
666
|
relatedRecordsPresentation: s
|
|
647
667
|
}) });
|
|
648
668
|
}
|
|
649
|
-
function q({ entityCode: t, recordId: o, items: s, schema:
|
|
650
|
-
let
|
|
669
|
+
function q({ entityCode: t, recordId: o, items: s, schema: te, entity: m, onBackToList: ie, onOpenFilters: ae, relatedRecordsPresentation: oe }) {
|
|
670
|
+
let _ = f(), b = f("errors"), x = j(m), fe = R(() => o ? a(m, o) : void 0, [o, m]), pe = g(t, fe), me = pe.data, w = h(pe), T = le(t), E = v(), [D, k] = B(!1), [A, N] = B({}), P = me?.data, F = i(m, "update", P, x.tenantId), he = P?.$statuses, ge = P?.$properties, _e = ue(t, o), ve = de(t, o), L = R(() => {
|
|
651
671
|
let e = /* @__PURE__ */ new Set();
|
|
652
|
-
for (let [t, n] of
|
|
653
|
-
for (let [t] of
|
|
672
|
+
for (let [t, n] of m.fields) r(n) && e.add(t);
|
|
673
|
+
for (let [t] of m.files ?? []) e.add(t);
|
|
654
674
|
return e;
|
|
655
|
-
}, [
|
|
656
|
-
if (
|
|
675
|
+
}, [m]), z = I(() => {
|
|
676
|
+
if (P) {
|
|
657
677
|
let e = {};
|
|
658
|
-
|
|
659
|
-
let n =
|
|
660
|
-
e[t] =
|
|
661
|
-
}),
|
|
678
|
+
L.forEach((t) => {
|
|
679
|
+
let n = y(m, P, t);
|
|
680
|
+
e[t] = se(m, t) ? n ?? null : n ?? "";
|
|
681
|
+
}), N(e);
|
|
662
682
|
}
|
|
663
|
-
|
|
683
|
+
k(!0);
|
|
664
684
|
}, [
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
]),
|
|
669
|
-
await E.flushAllDrafts(),
|
|
670
|
-
}, [E]),
|
|
671
|
-
let e = {}, t =
|
|
672
|
-
entity:
|
|
673
|
-
formData:
|
|
674
|
-
record:
|
|
685
|
+
P,
|
|
686
|
+
L,
|
|
687
|
+
m
|
|
688
|
+
]), be = I(async () => {
|
|
689
|
+
await E.flushAllDrafts(), k(!1), N({});
|
|
690
|
+
}, [E]), xe = I(() => {
|
|
691
|
+
let e = {}, t = C({
|
|
692
|
+
entity: m,
|
|
693
|
+
formData: A,
|
|
694
|
+
record: P,
|
|
675
695
|
isNew: !1
|
|
676
|
-
}), n =
|
|
677
|
-
for (let [t, n] of Object.entries(
|
|
678
|
-
Object.keys(t).length > 0 && (e.$files = t), Object.keys(e).length === 0 ? (
|
|
696
|
+
}), n = ce(t);
|
|
697
|
+
for (let [t, n] of Object.entries(A)) m.files?.has(t) || (e[t] = S(m, t, n));
|
|
698
|
+
Object.keys(t).length > 0 && (e.$files = t), Object.keys(e).length === 0 ? (k(!1), N({})) : T.mutate({
|
|
679
699
|
pkValues: o,
|
|
680
700
|
data: e
|
|
681
701
|
}, { onSuccess: () => {
|
|
682
|
-
n.forEach((e) => E.markCommitted(e)),
|
|
702
|
+
n.forEach((e) => E.markCommitted(e)), k(!1), N({});
|
|
683
703
|
} });
|
|
684
704
|
}, [
|
|
685
705
|
E,
|
|
686
706
|
T,
|
|
687
707
|
o,
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
]),
|
|
692
|
-
|
|
708
|
+
m,
|
|
709
|
+
A,
|
|
710
|
+
P
|
|
711
|
+
]), W = I((e, t) => {
|
|
712
|
+
N((n) => ({
|
|
693
713
|
...n,
|
|
694
714
|
[e]: t
|
|
695
715
|
}));
|
|
696
716
|
}, []);
|
|
697
|
-
if (
|
|
698
|
-
if (!
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
717
|
+
if (w.loading) return /* @__PURE__ */ V(O, {});
|
|
718
|
+
if (!P && w.error !== null) return /* @__PURE__ */ H("p", {
|
|
719
|
+
role: "alert",
|
|
720
|
+
style: {
|
|
721
|
+
padding: 16,
|
|
722
|
+
color: "var(--danger)",
|
|
723
|
+
display: "flex",
|
|
724
|
+
alignItems: "center",
|
|
725
|
+
gap: 8
|
|
726
|
+
},
|
|
727
|
+
children: [
|
|
728
|
+
l(b, w.error),
|
|
729
|
+
" ",
|
|
730
|
+
/* @__PURE__ */ V(p, { onRetry: w.retry })
|
|
731
|
+
]
|
|
732
|
+
});
|
|
733
|
+
if (!P) return null;
|
|
734
|
+
let Se = n(_, P, m), G = m.display?.display_field, K = Se ? void 0 : G ? P[G] : P[m.fields.names()[0]], Ce = Se || (K != null && typeof K != "object" ? e(K) : _(m.display.name)), q = P?.$refs, J = {
|
|
735
|
+
schema: te,
|
|
736
|
+
entity: m,
|
|
702
737
|
entityCode: t,
|
|
703
738
|
recordId: o,
|
|
704
739
|
record: D ? {
|
|
705
|
-
...
|
|
706
|
-
...
|
|
707
|
-
} :
|
|
740
|
+
...P,
|
|
741
|
+
...A
|
|
742
|
+
} : P,
|
|
708
743
|
isNew: !1,
|
|
709
744
|
mode: D ? "edit" : "display",
|
|
710
|
-
onFieldChange: D ?
|
|
711
|
-
refs:
|
|
712
|
-
objectProperties:
|
|
713
|
-
onSetProperty:
|
|
745
|
+
onFieldChange: D ? W : void 0,
|
|
746
|
+
refs: q,
|
|
747
|
+
objectProperties: ge ?? void 0,
|
|
748
|
+
onSetProperty: F ? (e, t) => ve.mutate({
|
|
714
749
|
propertyCode: e,
|
|
715
750
|
value: t
|
|
716
751
|
}) : void 0,
|
|
717
|
-
isPropertyPending:
|
|
718
|
-
objectStatuses:
|
|
719
|
-
onSetStatus:
|
|
752
|
+
isPropertyPending: ve.isPending,
|
|
753
|
+
objectStatuses: he ?? void 0,
|
|
754
|
+
onSetStatus: F ? (e, t) => _e.mutate({
|
|
720
755
|
groupCode: e,
|
|
721
756
|
statusCode: t
|
|
722
757
|
}) : void 0,
|
|
723
|
-
isStatusPending:
|
|
724
|
-
relatedRecordsPresentation:
|
|
758
|
+
isStatusPending: _e.isPending,
|
|
759
|
+
relatedRecordsPresentation: oe
|
|
725
760
|
};
|
|
726
|
-
return /* @__PURE__ */
|
|
761
|
+
return /* @__PURE__ */ H("div", {
|
|
727
762
|
style: {
|
|
728
763
|
display: "flex",
|
|
729
764
|
flexDirection: "column",
|
|
730
765
|
height: "100%"
|
|
731
766
|
},
|
|
732
|
-
children: [/* @__PURE__ */
|
|
767
|
+
children: [/* @__PURE__ */ H("div", {
|
|
733
768
|
style: {
|
|
734
769
|
display: "flex",
|
|
735
770
|
alignItems: "center",
|
|
736
771
|
justifyContent: "space-between",
|
|
737
772
|
paddingTop: 10,
|
|
738
773
|
paddingBottom: 10,
|
|
739
|
-
...
|
|
774
|
+
...re(16),
|
|
740
775
|
borderBottom: "1px solid var(--divider)",
|
|
741
776
|
position: "sticky",
|
|
742
777
|
top: 0,
|
|
743
778
|
background: "var(--surface)",
|
|
744
779
|
zIndex: 10
|
|
745
780
|
},
|
|
746
|
-
children: [/* @__PURE__ */
|
|
781
|
+
children: [/* @__PURE__ */ V("h2", {
|
|
747
782
|
style: {
|
|
748
783
|
margin: 0,
|
|
749
784
|
fontSize: 13,
|
|
@@ -753,67 +788,67 @@ function q({ entityCode: t, recordId: o, items: s, schema: ee, entity: p, onBack
|
|
|
753
788
|
whiteSpace: "nowrap",
|
|
754
789
|
color: "var(--text)"
|
|
755
790
|
},
|
|
756
|
-
children:
|
|
757
|
-
}), /* @__PURE__ */
|
|
791
|
+
children: Ce
|
|
792
|
+
}), /* @__PURE__ */ H("div", {
|
|
758
793
|
style: {
|
|
759
794
|
display: "flex",
|
|
760
795
|
alignItems: "center",
|
|
761
796
|
gap: 6
|
|
762
797
|
},
|
|
763
798
|
children: [
|
|
764
|
-
|
|
765
|
-
icon: /* @__PURE__ */
|
|
766
|
-
title:
|
|
767
|
-
onClick: re
|
|
768
|
-
}),
|
|
769
|
-
ie && /* @__PURE__ */ B(d, {
|
|
770
|
-
icon: /* @__PURE__ */ B(l.filter, { size: 14 }),
|
|
771
|
-
title: h("filter.drawer.title", "Filters"),
|
|
799
|
+
ie && /* @__PURE__ */ V(ee, {
|
|
800
|
+
icon: /* @__PURE__ */ V(u.back, { size: 14 }),
|
|
801
|
+
title: _("list.detail.back_to_list", "Back to list"),
|
|
772
802
|
onClick: ie
|
|
773
803
|
}),
|
|
774
|
-
|
|
804
|
+
ae && /* @__PURE__ */ V(ee, {
|
|
805
|
+
icon: /* @__PURE__ */ V(u.filter, { size: 14 }),
|
|
806
|
+
title: _("filter.drawer.title", "Filters"),
|
|
807
|
+
onClick: ae
|
|
808
|
+
}),
|
|
809
|
+
F && (D ? /* @__PURE__ */ H(ye, { children: [/* @__PURE__ */ V(d, {
|
|
775
810
|
size: "xs",
|
|
776
|
-
icon: /* @__PURE__ */
|
|
777
|
-
onClick:
|
|
778
|
-
children:
|
|
779
|
-
}), /* @__PURE__ */
|
|
811
|
+
icon: /* @__PURE__ */ V(u.x, { size: 12 }),
|
|
812
|
+
onClick: be,
|
|
813
|
+
children: _("dialog.cancel", "Cancel")
|
|
814
|
+
}), /* @__PURE__ */ V(d, {
|
|
780
815
|
kind: "primary",
|
|
781
816
|
size: "xs",
|
|
782
|
-
icon: T.isPending ? /* @__PURE__ */
|
|
783
|
-
onClick:
|
|
817
|
+
icon: T.isPending ? /* @__PURE__ */ V(ne, { size: 12 }) : /* @__PURE__ */ V(u.save, { size: 12 }),
|
|
818
|
+
onClick: xe,
|
|
784
819
|
disabled: T.isPending,
|
|
785
|
-
children: T.isPending ?
|
|
786
|
-
})] }) : /* @__PURE__ */
|
|
820
|
+
children: T.isPending ? _("dialog.saving", "Saving…") : _("dialog.save", "Save")
|
|
821
|
+
})] }) : /* @__PURE__ */ V(d, {
|
|
787
822
|
size: "xs",
|
|
788
|
-
icon: /* @__PURE__ */
|
|
789
|
-
onClick:
|
|
790
|
-
children:
|
|
823
|
+
icon: /* @__PURE__ */ V(u.edit, { size: 12 }),
|
|
824
|
+
onClick: z,
|
|
825
|
+
children: _("list.record.edit", "Edit")
|
|
791
826
|
}))
|
|
792
827
|
]
|
|
793
828
|
})]
|
|
794
|
-
}), /* @__PURE__ */
|
|
829
|
+
}), /* @__PURE__ */ V("div", {
|
|
795
830
|
style: {
|
|
796
831
|
flex: 1,
|
|
797
832
|
overflowY: "auto",
|
|
798
833
|
paddingTop: 16,
|
|
799
834
|
paddingBottom: 16,
|
|
800
|
-
...
|
|
835
|
+
...re(16),
|
|
801
836
|
display: "flex",
|
|
802
837
|
flexDirection: "column",
|
|
803
838
|
gap: 12
|
|
804
839
|
},
|
|
805
|
-
children: s && s.length > 0 ? /* @__PURE__ */
|
|
840
|
+
children: s && s.length > 0 ? /* @__PURE__ */ V(M, {
|
|
806
841
|
nodes: s,
|
|
807
|
-
ctx:
|
|
808
|
-
}) : /* @__PURE__ */
|
|
842
|
+
ctx: J
|
|
843
|
+
}) : /* @__PURE__ */ V("p", {
|
|
809
844
|
style: {
|
|
810
845
|
fontSize: 12.5,
|
|
811
846
|
color: "var(--text-3)"
|
|
812
847
|
},
|
|
813
|
-
children: c(
|
|
848
|
+
children: c(_("list.detail.no_layout", "No layout configured. Add {key} to the screen definition."), { key: /* @__PURE__ */ V("code", { children: U }) })
|
|
814
849
|
})
|
|
815
850
|
})]
|
|
816
851
|
});
|
|
817
852
|
}
|
|
818
853
|
//#endregion
|
|
819
|
-
export {
|
|
854
|
+
export { W as SmartRecordListPage };
|