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