@declarion/react 0.56.0 → 0.59.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/README.md +0 -2
- package/dist-lib/AgentChatPanel.impl-DBH1Ff4G.js +1200 -0
- package/dist-lib/DetailAuditStrip-GNRA_eP5.js +289 -0
- package/dist-lib/{DraggableChildrenTable-BV5sb8Uo.js → DraggableChildrenTable-4RZC351U.js} +87 -86
- package/dist-lib/Grid-CQabaBLx.js +405 -0
- package/dist-lib/{LayoutRenderer-C9AH9cXf.js → LayoutRenderer-DGKWZKpW.js} +1000 -1114
- package/dist-lib/{ListCardsBody-DXcDg536.js → ListCardsBody-DfGmyNIu.js} +84 -84
- package/dist-lib/MarkdownRenderer-BDbzDv_y.js +87 -0
- package/dist-lib/{RefreshControl-CNtN8zSl.js → RefreshControl-Bhoib0ZA.js} +126 -155
- package/dist-lib/SmartDetailPage.impl-Ds2RGg6K.js +1565 -0
- package/dist-lib/SmartListPage.impl-BrZLE_Gb.js +3046 -0
- package/dist-lib/{SmartRecordListPage.impl-Bkl9aZJ8.js → SmartRecordListPage.impl-C1FJLr80.js} +281 -280
- package/dist-lib/SortHeaderMenu-Cijxk4cX.js +107 -0
- package/dist-lib/action-dispatch-DY0c8U81.js +1967 -0
- package/dist-lib/api/client.d.ts +5 -0
- package/dist-lib/api/data.d.ts +2 -4
- package/dist-lib/api/entities.d.ts +8 -15
- package/dist-lib/api/events.d.ts +3 -3
- package/dist-lib/cardProjection-Bkl2SSYz.js +499 -0
- package/dist-lib/components/actions/ResponsiveActionBar.d.ts +17 -16
- package/dist-lib/components/agents/AgentChatPanel.d.ts +3 -13
- package/dist-lib/components/agents/AgentChatPanel.impl.d.ts +14 -0
- package/dist-lib/components/agents/AgentPicker.d.ts +1 -2
- package/dist-lib/components/chrome/PageShell.d.ts +7 -0
- package/dist-lib/components/chrome/RecordHeader.d.ts +1 -2
- package/dist-lib/components/detail-layout/ChildrenBlock.d.ts +1 -1
- package/dist-lib/components/detail-layout/DetailAuditStrip.d.ts +1 -2
- package/dist-lib/components/detail-layout/DetailHighlights.d.ts +1 -2
- package/dist-lib/components/detail-layout/blockMeta.d.ts +2 -1
- package/dist-lib/components/fields/BoolField.d.ts +1 -1
- package/dist-lib/components/fields/EnumField.d.ts +1 -1
- package/dist-lib/components/fields/IntArrayField.d.ts +1 -1
- package/dist-lib/components/fields/MultilangArrayField.d.ts +2 -0
- package/dist-lib/components/fields/MultilangField.d.ts +1 -1
- package/dist-lib/components/fields/MultilangTextField.d.ts +1 -1
- package/dist-lib/components/fields/NumberField.d.ts +1 -1
- package/dist-lib/components/fields/PasswordField.d.ts +1 -1
- package/dist-lib/components/fields/RefCombobox.d.ts +1 -1
- package/dist-lib/components/fields/SecretField.d.ts +1 -1
- package/dist-lib/components/fields/StringArrayField.d.ts +1 -1
- package/dist-lib/components/fields/TimestampField.d.ts +1 -1
- package/dist-lib/components/fields/cells/registry.d.ts +2 -1
- package/dist-lib/components/fields/index.d.ts +2 -1
- package/dist-lib/components/fields/langMap.d.ts +2 -0
- package/dist-lib/components/fields/secretValue.d.ts +2 -0
- package/dist-lib/components/file-widgets/UnknownFileWidget.d.ts +3 -0
- package/dist-lib/components/file-widgets/UploadFailureText.d.ts +4 -0
- package/dist-lib/components/file-widgets/helpers.d.ts +1 -1
- package/dist-lib/components/file-widgets/host.d.ts +4 -3
- package/dist-lib/components/file-widgets/types.d.ts +1 -0
- package/dist-lib/components/file-widgets/upload.d.ts +18 -3
- package/dist-lib/components/filters/filter-op-label.d.ts +3 -0
- package/dist-lib/components/layout/ImpersonationBanner.d.ts +1 -1
- package/dist-lib/components/layout/ImpersonationFrame.d.ts +1 -1
- package/dist-lib/components/layout/Layout.d.ts +2 -1
- package/dist-lib/components/layout/Sidebar.d.ts +2 -1
- package/dist-lib/components/layout/TenantChip.d.ts +1 -1
- package/dist-lib/components/list/ViewSwitcher.d.ts +4 -2
- package/dist-lib/components/pages/DocumentsMenu.d.ts +1 -2
- package/dist-lib/components/pages/ExportMenu.d.ts +3 -5
- package/dist-lib/components/pages/RecordDocumentsPanel.d.ts +1 -2
- package/dist-lib/components/pages/auth/AuthShell.d.ts +4 -31
- package/dist-lib/components/pages/exportRequest.d.ts +4 -6
- package/dist-lib/components/pages/list/DeleteViewDialog.d.ts +8 -0
- package/dist-lib/components/pages/list/ListCardRow.d.ts +1 -2
- package/dist-lib/components/pages/list/ListCardsBody.d.ts +0 -1
- package/dist-lib/components/pages/list/ListFloatbar.d.ts +2 -2
- package/dist-lib/components/pages/list/ListHeader.d.ts +2 -2
- package/dist-lib/components/pages/list/ListNoRows.d.ts +4 -5
- package/dist-lib/components/pages/list/ListToolbar.d.ts +3 -2
- package/dist-lib/components/pages/list/ListUrlBanner.d.ts +10 -0
- package/dist-lib/components/pages/list/RowActionsCell.d.ts +2 -4
- package/dist-lib/components/pages/list/RowContextMenu.d.ts +1 -2
- package/dist-lib/components/pages/list/columns.d.ts +2 -1
- package/dist-lib/components/pages/list/filter-meta.d.ts +2 -1
- package/dist-lib/components/pages/list/useActiveView.d.ts +38 -0
- package/dist-lib/components/pages/list/useListColumnLayout.d.ts +6 -5
- package/dist-lib/components/pages/list/useListQuery.d.ts +4 -4
- package/dist-lib/components/pages/list/useListSort.d.ts +5 -4
- package/dist-lib/components/pages/list/useListViews.d.ts +18 -8
- package/dist-lib/components/pages/list/useRowMenu.d.ts +2 -3
- package/dist-lib/components/pages/profile/Profile.d.ts +3 -0
- package/dist-lib/components/params/ParamsBlock.d.ts +1 -13
- package/dist-lib/components/params/param-editors.d.ts +3 -11
- package/dist-lib/components/primitives/ClassifiedFieldLocked.d.ts +1 -2
- package/dist-lib/components/shared/DynamicIcon.d.ts +2 -2
- package/dist-lib/components/shared/ErrorBoundary.d.ts +1 -1
- package/dist-lib/components/shared/LoadingSkeleton.d.ts +1 -0
- package/dist-lib/components/shared/LucideIcon.d.ts +1 -1
- package/dist-lib/components/shared/useOwnRefresh.d.ts +1 -1
- package/dist-lib/declarion-react.css +1 -1
- package/dist-lib/embed/theme.d.ts +1 -1
- package/dist-lib/embed/useEmbedNavigate.d.ts +1 -1
- package/dist-lib/failure-v-uGSpbX.js +158 -0
- package/dist-lib/{field-classification-D6xQYn-h.js → field-classification-C28XE-_P.js} +514 -307
- package/dist-lib/format-count-DA4wmmWR.js +1771 -0
- package/dist-lib/hooks/useEntityData.d.ts +1 -1
- package/dist-lib/hooks/useFilters.d.ts +7 -5
- package/dist-lib/hooks/useLanguage.d.ts +4 -0
- package/dist-lib/hooks/useParams.d.ts +4 -51
- package/dist-lib/hooks/useRegisterScreenTab.d.ts +1 -1
- package/dist-lib/hooks/useSSE.d.ts +3 -3
- package/dist-lib/hooks/useTabTitle.d.ts +2 -0
- package/dist-lib/hooks/useText.d.ts +3 -3
- package/dist-lib/hooks/useVersionWatcher.d.ts +1 -1
- package/dist-lib/hooks/useViews.d.ts +20 -0
- package/dist-lib/index.d.ts +8 -7
- package/dist-lib/index.js +2716 -5795
- package/dist-lib/lib/action-dispatch.d.ts +2 -1
- package/dist-lib/lib/actions.d.ts +30 -42
- package/dist-lib/lib/anchor.d.ts +3 -4
- package/dist-lib/lib/decimal-text.d.ts +1 -0
- package/dist-lib/lib/document-templates.d.ts +1 -2
- package/dist-lib/lib/download.d.ts +2 -1
- package/dist-lib/lib/evidence-verdict.d.ts +2 -1
- package/dist-lib/lib/failure.d.ts +2 -0
- package/dist-lib/lib/field-classification.d.ts +3 -3
- package/dist-lib/lib/filters.d.ts +18 -2
- package/dist-lib/lib/format-count.d.ts +8 -7
- package/dist-lib/lib/language.d.ts +19 -0
- package/dist-lib/lib/mass-edit.d.ts +2 -1
- package/dist-lib/lib/realtime-query-keys.d.ts +1 -1
- package/dist-lib/lib/realtime-reconcile.d.ts +3 -4
- package/dist-lib/lib/screen-back.d.ts +4 -6
- package/dist-lib/lib/sort.d.ts +9 -9
- package/dist-lib/lib/timestamp.d.ts +5 -7
- package/dist-lib/lib/ui-actions.d.ts +2 -1
- package/dist-lib/peekDraftStore-D-cTbiIr.js +199 -0
- package/dist-lib/registry-Cb3W-czW.js +1950 -0
- package/dist-lib/safe-url-oSJw5pzO.js +34 -0
- package/dist-lib/stores/icon-registry.d.ts +2 -2
- package/dist-lib/stores/list-layout.d.ts +3 -4
- package/dist-lib/stores/realtime.d.ts +1 -1
- package/dist-lib/stores/tabs.d.ts +3 -2
- package/dist-lib/testing.d.ts +6 -0
- package/dist-lib/testing.js +98 -76
- package/dist-lib/types/api.d.ts +7 -8
- package/dist-lib/types/fieldType.d.ts +1 -1
- package/dist-lib/types/files.d.ts +4 -4
- package/dist-lib/types/schema.d.ts +44 -50
- package/dist-lib/useAgentConversation-D97IqE-J.js +623 -0
- package/dist-lib/{useCurrentScreen-CzwzQpoW.js → useCurrentScreen-BL5NZFCw.js} +2777 -3768
- package/dist-lib/useListQuery-BG1GyKtJ.js +103 -0
- package/dist-lib/useProperties-4Lg3odrt.js +83 -0
- package/dist-lib/{useTabSearchMirror-C39U85cg.js → useTabSearchMirror-ZVLlINBX.js} +49 -51
- package/dist-lib/useText-BFDCTUSo.js +952 -0
- package/dist-lib/{value-Bo8C8WMU.js → value-By1-WJ8J.js} +74 -76
- package/dist-lib/vite/fingerprint-plugin.d.ts +2 -3
- package/package.json +13 -12
- package/dist-lib/Grid-DWgUPuZ3.js +0 -404
- package/dist-lib/MarkdownRenderer-CcSFc2N3.js +0 -85
- package/dist-lib/RecordIdBadge-CGxPR-8q.js +0 -24
- package/dist-lib/SmartDetailPage.impl-lskCd-WG.js +0 -1846
- package/dist-lib/SmartListPage.impl-CrGbdzyK.js +0 -2854
- package/dist-lib/SortHeaderMenu-SYSAaqQJ.js +0 -106
- package/dist-lib/action-dispatch-CR4ajBtT.js +0 -1985
- package/dist-lib/cardProjection-CW5RIMko.js +0 -699
- package/dist-lib/components/pages/home/HomeStub.d.ts +0 -6
- package/dist-lib/components/pages/jobs/Jobs.d.ts +0 -1
- package/dist-lib/components/pages/pipeline/Pipeline.d.ts +0 -1
- package/dist-lib/format-count-Dobmi-Ji.js +0 -1551
- package/dist-lib/hooks/useUserLocale.d.ts +0 -1
- package/dist-lib/lib/messages.d.ts +0 -12
- package/dist-lib/peekDraftStore-5wQ7lq_V.js +0 -194
- package/dist-lib/registry-CjgUaF7C.js +0 -1768
- package/dist-lib/useListQuery-D7Hr5WM1.js +0 -96
- package/dist-lib/useProperties-CqtCzFCr.js +0 -81
package/dist-lib/{SmartRecordListPage.impl-Bkl9aZJ8.js → SmartRecordListPage.impl-C1FJLr80.js}
RENAMED
|
@@ -1,176 +1,178 @@
|
|
|
1
1
|
import { s as e } from "./DynamicIcon-DW5krHuX.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { n as
|
|
8
|
-
import { c as
|
|
9
|
-
import { t as
|
|
10
|
-
import { t as P } from "./
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
2
|
+
import { Ln as t, On as n, Rn as r, St as i, Zt as a, _n as o, ct as s, en as c, hn as l, jn as u, nn as d, on as f, ot as p, v as ee, vn as m } from "./useCurrentScreen-BL5NZFCw.js";
|
|
3
|
+
import { d as h, f as g, t as _ } from "./useText-BFDCTUSo.js";
|
|
4
|
+
import { c as v } from "./registry-Cb3W-czW.js";
|
|
5
|
+
import { A as te, O as y, g as b, h as ne, k as x, l as re } from "./field-classification-C28XE-_P.js";
|
|
6
|
+
import { f as S, h as C, p as w, u as ie } from "./action-dispatch-DY0c8U81.js";
|
|
7
|
+
import { n as T, r as E } from "./useProperties-4Lg3odrt.js";
|
|
8
|
+
import { c as ae, f as D, h as O, m as k, n as A, t as j } from "./useTabSearchMirror-ZVLlINBX.js";
|
|
9
|
+
import { t as M } from "./LayoutRenderer-DGKWZKpW.js";
|
|
10
|
+
import { n as N, t as P } from "./cardProjection-Bkl2SSYz.js";
|
|
11
|
+
import { t as F } from "./useListQuery-BG1GyKtJ.js";
|
|
12
|
+
import { useCallback as I, useEffect as L, useMemo as R, useRef as z, useState as oe } from "react";
|
|
13
|
+
import { useSearchParams as se } from "react-router";
|
|
13
14
|
import { Fragment as B, jsx as V, jsxs as H } from "react/jsx-runtime";
|
|
14
15
|
//#region src/components/pages/SmartRecordListPage.impl.tsx
|
|
15
|
-
var le =
|
|
16
|
-
function U({ screenCode:
|
|
17
|
-
let
|
|
18
|
-
|
|
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
|
-
}, [
|
|
26
|
-
entity:
|
|
27
|
-
screen:
|
|
28
|
-
}), [
|
|
29
|
-
entity:
|
|
30
|
-
screen:
|
|
31
|
-
presentation:
|
|
32
|
-
visibleColumns:
|
|
33
|
-
card:
|
|
34
|
-
sort:
|
|
16
|
+
var ce = 200, le = "items:";
|
|
17
|
+
function U({ screenCode: n }) {
|
|
18
|
+
let r = _(), s = _("errors"), [l, d] = se(), { data: p } = g(), m = f(), h = p?.screens[n], v = h?.entity ? p?.entities[h.entity] : void 0, y = h?.entity;
|
|
19
|
+
A(h, v, l.toString()), j(h?.route);
|
|
20
|
+
let ne = b(), x = l.get("selected") ?? null, re = l.get("search") ?? "", S = i(re, 300), C = l.get("sort") ?? h?.sort_default ?? "", w = R(() => D(l), [l]), ie = w.filters.length > 0 ? w.filters : void 0, T = R(() => h?.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) ?? [], [h?.columns, v]), E = R(() => {
|
|
21
|
+
let e = h?.responsive?.[m.category]?.presentation;
|
|
22
|
+
return m.category === "phone" ? "drilldown" : e === "split" || e === "drilldown" || e === "stacked" ? e : "split";
|
|
23
|
+
}, [h?.responsive, m.category]), M = R(() => {
|
|
24
|
+
let e = h?.responsive?.[m.category];
|
|
25
|
+
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";
|
|
26
|
+
}, [h?.responsive, m.category]), le = h?.responsive?.[m.category]?.layout?.related_records, U = R(() => P({
|
|
27
|
+
entity: v,
|
|
28
|
+
screen: h
|
|
29
|
+
}), [v, h]), W = R(() => N({
|
|
30
|
+
entity: v,
|
|
31
|
+
screen: h,
|
|
32
|
+
presentation: M,
|
|
33
|
+
visibleColumns: T,
|
|
34
|
+
card: U,
|
|
35
|
+
sort: C
|
|
35
36
|
}), [
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
]),
|
|
43
|
-
entity:
|
|
44
|
-
entityCode:
|
|
45
|
-
screen:
|
|
46
|
-
screenCode:
|
|
37
|
+
v,
|
|
38
|
+
h,
|
|
39
|
+
M,
|
|
40
|
+
T,
|
|
41
|
+
U,
|
|
42
|
+
C
|
|
43
|
+
]), G = F({
|
|
44
|
+
entity: v,
|
|
45
|
+
entityCode: y,
|
|
46
|
+
screen: h,
|
|
47
|
+
screenCode: n,
|
|
47
48
|
page: 1,
|
|
48
|
-
perPage:
|
|
49
|
-
sortForRequest:
|
|
50
|
-
debouncedSearch:
|
|
51
|
-
filters:
|
|
52
|
-
filterError: !!S.error,
|
|
49
|
+
perPage: ce,
|
|
50
|
+
sortForRequest: ee(C),
|
|
51
|
+
debouncedSearch: S,
|
|
52
|
+
filters: w.filters,
|
|
53
53
|
includeDeleted: !1,
|
|
54
|
-
expand:
|
|
55
|
-
select:
|
|
54
|
+
expand: W.expandFields,
|
|
55
|
+
select: W.selectFields,
|
|
56
|
+
isHeld: !1,
|
|
57
|
+
retryHeld: () => void 0,
|
|
56
58
|
runCountQuery: !1,
|
|
57
|
-
urlKey: `${
|
|
58
|
-
}),
|
|
59
|
-
|
|
59
|
+
urlKey: `${y ?? ""}|${l.toString()}`
|
|
60
|
+
}), K = G.rows, q = G.refs, J = G.isLoading, fe = R(() => v?.fields.names().find((e) => v.fields.get(e)?.primary) ?? "id", [v]), pe = I((e, t) => {
|
|
61
|
+
d((t) => {
|
|
60
62
|
let n = new URLSearchParams(t);
|
|
61
63
|
return e ? n.set("selected", e) : n.delete("selected"), n;
|
|
62
64
|
}, { replace: t?.replace ?? !0 });
|
|
63
|
-
}, [
|
|
64
|
-
|
|
65
|
+
}, [d]), me = I((e) => {
|
|
66
|
+
d((t) => {
|
|
65
67
|
let n = new URLSearchParams(t);
|
|
66
68
|
return e ? n.set("search", e) : n.delete("search"), n;
|
|
67
69
|
}, { replace: !0 });
|
|
68
|
-
}, [
|
|
69
|
-
|
|
70
|
-
let r = new URLSearchParams(n), i =
|
|
71
|
-
return a = t && t !== "__all__" ? [...
|
|
70
|
+
}, [d]), he = I((e, t) => {
|
|
71
|
+
d((n) => {
|
|
72
|
+
let r = new URLSearchParams(n), i = D(n).filters, a;
|
|
73
|
+
return a = t && t !== "__all__" ? [...k(i, e), ae(e, t)] : k(i, e), O(a, r), r;
|
|
72
74
|
}, { replace: !0 });
|
|
73
|
-
}, [
|
|
74
|
-
|
|
75
|
-
Y &&
|
|
75
|
+
}, [d]), Y = (h?.list_resizable ?? !1) && E === "split" && m.category !== "phone" && !m.touch, ge = z(null), [X, Z] = oe(null), _e = z(!1), Q = h?.list_width;
|
|
76
|
+
L(() => {
|
|
77
|
+
Y && Q?.endsWith("%") && Z(null);
|
|
76
78
|
}, [
|
|
77
79
|
Y,
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
]),
|
|
82
|
-
if (!Y ||
|
|
83
|
-
let e =
|
|
80
|
+
Q,
|
|
81
|
+
m.width,
|
|
82
|
+
m.height
|
|
83
|
+
]), L(() => {
|
|
84
|
+
if (!Y || X !== null) return;
|
|
85
|
+
let e = ge.current;
|
|
84
86
|
if (e) {
|
|
85
|
-
if (
|
|
86
|
-
let t = parseFloat(
|
|
87
|
-
|
|
88
|
-
} else Q
|
|
87
|
+
if (Q && Q.endsWith("%")) {
|
|
88
|
+
let t = parseFloat(Q) / 100;
|
|
89
|
+
Z(Math.round(e.getBoundingClientRect().width * t));
|
|
90
|
+
} else Z(Q && parseInt(Q, 10) || 320);
|
|
89
91
|
}
|
|
90
92
|
}, [
|
|
91
93
|
Y,
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
94
|
+
Q,
|
|
95
|
+
X,
|
|
96
|
+
v
|
|
95
97
|
]);
|
|
96
|
-
let
|
|
97
|
-
|
|
98
|
-
|
|
98
|
+
let $ = z(null);
|
|
99
|
+
L(() => () => {
|
|
100
|
+
$.current?.();
|
|
99
101
|
}, []);
|
|
100
|
-
let
|
|
101
|
-
e.preventDefault(),
|
|
102
|
-
let t = e.clientX, n =
|
|
103
|
-
if (!
|
|
104
|
-
let r = (
|
|
105
|
-
|
|
102
|
+
let ve = I((e) => {
|
|
103
|
+
e.preventDefault(), _e.current = !0;
|
|
104
|
+
let t = e.clientX, n = X ?? 320, r = (e) => {
|
|
105
|
+
if (!_e.current) return;
|
|
106
|
+
let r = (ge.current?.getBoundingClientRect().width ?? window.innerWidth) - 300, i = Math.max(200, Math.min(r, n + e.clientX - t));
|
|
107
|
+
Z(i);
|
|
106
108
|
}, i = () => {
|
|
107
|
-
|
|
109
|
+
_e.current = !1, document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", i), document.body.style.cursor = "", document.body.style.userSelect = "", $.current = null;
|
|
108
110
|
};
|
|
109
|
-
document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", document.addEventListener("mousemove", r), document.addEventListener("mouseup", i),
|
|
110
|
-
}, [
|
|
111
|
-
if (!
|
|
112
|
-
let
|
|
111
|
+
document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", document.addEventListener("mousemove", r), document.addEventListener("mouseup", i), $.current = i;
|
|
112
|
+
}, [X]);
|
|
113
|
+
if (!p || !h || !v) return null;
|
|
114
|
+
let ye = ie?.length ?? 0, be = E === "split" || E === "stacked" || !x, xe = E === "split" || E === "stacked" || !!x, Se = E !== "split" && x ? () => pe(null, { replace: !0 }) : void 0, Ce = E === "split" ? Y && X !== null ? X : h.list_width ?? "320px" : "100%";
|
|
113
115
|
return /* @__PURE__ */ H("div", {
|
|
114
|
-
ref:
|
|
115
|
-
"data-record-list-presentation":
|
|
116
|
+
ref: ge,
|
|
117
|
+
"data-record-list-presentation": E,
|
|
116
118
|
style: {
|
|
117
119
|
display: "flex",
|
|
118
|
-
flexDirection:
|
|
120
|
+
flexDirection: E === "stacked" ? "column" : "row",
|
|
119
121
|
height: "100%",
|
|
120
122
|
minWidth: 0,
|
|
121
123
|
overflow: "hidden"
|
|
122
124
|
},
|
|
123
125
|
children: [
|
|
124
|
-
|
|
126
|
+
be && /* @__PURE__ */ H("div", {
|
|
125
127
|
"data-testid": "record-list-panel",
|
|
126
128
|
style: {
|
|
127
|
-
flex:
|
|
129
|
+
flex: E === "split" ? "none" : "1 1 auto",
|
|
128
130
|
display: "flex",
|
|
129
131
|
flexDirection: "column",
|
|
130
132
|
overflow: "hidden",
|
|
131
|
-
borderRight:
|
|
132
|
-
borderBottom:
|
|
133
|
-
width:
|
|
133
|
+
borderRight: E === "split" && !Y ? "1px solid var(--divider)" : "none",
|
|
134
|
+
borderBottom: E === "stacked" ? "1px solid var(--divider)" : "none",
|
|
135
|
+
width: Ce,
|
|
134
136
|
minWidth: 0,
|
|
135
|
-
height:
|
|
137
|
+
height: E === "stacked" ? "50%" : "100%"
|
|
136
138
|
},
|
|
137
139
|
children: [/* @__PURE__ */ H("div", {
|
|
138
140
|
style: {
|
|
139
141
|
paddingTop: 12,
|
|
140
142
|
paddingBottom: 12,
|
|
141
|
-
...
|
|
143
|
+
...te(12),
|
|
142
144
|
display: "flex",
|
|
143
145
|
flexDirection: "column",
|
|
144
146
|
gap: 8,
|
|
145
147
|
borderBottom: "1px solid var(--divider)"
|
|
146
148
|
},
|
|
147
149
|
children: [
|
|
148
|
-
|
|
150
|
+
ne.hasOriginBack && /* @__PURE__ */ H("div", {
|
|
149
151
|
style: {
|
|
150
152
|
display: "flex",
|
|
151
153
|
alignItems: "center",
|
|
152
154
|
gap: 8
|
|
153
155
|
},
|
|
154
|
-
children: [/* @__PURE__ */ V(
|
|
156
|
+
children: [/* @__PURE__ */ V(t, {
|
|
155
157
|
icon: /* @__PURE__ */ V(e.back, { size: 14 }),
|
|
156
|
-
title: "Back",
|
|
157
|
-
onClick:
|
|
158
|
+
title: r("list.header.back", "Back"),
|
|
159
|
+
onClick: ne.goBack
|
|
158
160
|
}), /* @__PURE__ */ V("span", {
|
|
159
161
|
style: {
|
|
160
162
|
fontSize: 12.5,
|
|
161
163
|
fontWeight: 600,
|
|
162
164
|
color: "var(--text)"
|
|
163
165
|
},
|
|
164
|
-
children: h
|
|
166
|
+
children: r(h.display?.name) || r(v.display.name_plural)
|
|
165
167
|
})]
|
|
166
168
|
}),
|
|
167
|
-
/* @__PURE__ */ V(
|
|
168
|
-
value:
|
|
169
|
-
onChange:
|
|
170
|
-
placeholder:
|
|
169
|
+
/* @__PURE__ */ V(c, {
|
|
170
|
+
value: re,
|
|
171
|
+
onChange: me,
|
|
172
|
+
placeholder: r("list.toolbar.search_placeholder", "Search {name}…", { name: r(v.display.name_plural) }),
|
|
171
173
|
prefix: /* @__PURE__ */ V(e.search, { size: 13 })
|
|
172
174
|
}),
|
|
173
|
-
|
|
175
|
+
w.error && /* @__PURE__ */ H("div", {
|
|
174
176
|
role: "alert",
|
|
175
177
|
"data-testid": "record-list-filter-url-error",
|
|
176
178
|
style: {
|
|
@@ -180,31 +182,35 @@ function U({ screenCode: o }) {
|
|
|
180
182
|
color: "var(--danger)",
|
|
181
183
|
fontSize: 11.5
|
|
182
184
|
},
|
|
183
|
-
children: [
|
|
185
|
+
children: [
|
|
186
|
+
s(w.errorCode ?? "", w.error),
|
|
187
|
+
" ",
|
|
188
|
+
r("list.filters.invalid_suffix", "Showing this list without URL filters.")
|
|
189
|
+
]
|
|
184
190
|
}),
|
|
185
|
-
|
|
191
|
+
h.filters && h.filters.length > 0 && /* @__PURE__ */ V("div", {
|
|
186
192
|
style: {
|
|
187
193
|
display: "flex",
|
|
188
194
|
flexWrap: "wrap",
|
|
189
195
|
gap: 6
|
|
190
196
|
},
|
|
191
|
-
children:
|
|
192
|
-
let
|
|
193
|
-
if (!
|
|
194
|
-
let
|
|
197
|
+
children: h.filters.map((e) => {
|
|
198
|
+
let t = v.fields.get(e);
|
|
199
|
+
if (!t?.values) return null;
|
|
200
|
+
let n = ie?.find((t) => t.field === e && t.op === "eq")?.value ?? "__all__", i = o(r, t, e, p.entities), s = [{
|
|
195
201
|
value: "__all__",
|
|
196
|
-
label:
|
|
197
|
-
}, ...
|
|
202
|
+
label: r("list.filters.all_values", "All {field}", { field: i })
|
|
203
|
+
}, ...t.values.map((e) => ({
|
|
198
204
|
value: e.code,
|
|
199
|
-
label:
|
|
205
|
+
label: r(e.name) || e.code
|
|
200
206
|
}))];
|
|
201
207
|
return /* @__PURE__ */ V("div", {
|
|
202
208
|
style: { minWidth: 120 },
|
|
203
|
-
children: /* @__PURE__ */ V(
|
|
204
|
-
value:
|
|
205
|
-
options:
|
|
206
|
-
onChange: (t) =>
|
|
207
|
-
placeholder:
|
|
209
|
+
children: /* @__PURE__ */ V(a, {
|
|
210
|
+
value: n,
|
|
211
|
+
options: s,
|
|
212
|
+
onChange: (t) => he(e, t),
|
|
213
|
+
placeholder: i
|
|
208
214
|
})
|
|
209
215
|
}, e);
|
|
210
216
|
})
|
|
@@ -217,8 +223,11 @@ function U({ screenCode: o }) {
|
|
|
217
223
|
fontSize: 11,
|
|
218
224
|
color: "var(--text-3)"
|
|
219
225
|
},
|
|
220
|
-
children: [/* @__PURE__ */ V("span", { children:
|
|
221
|
-
|
|
226
|
+
children: [/* @__PURE__ */ V("span", { children: J ? r("list.records.loading", "Loading…") : r("list.records.count", "{count} {name}", {
|
|
227
|
+
count: K.length,
|
|
228
|
+
name: r(v.display.name_plural)
|
|
229
|
+
}) }), ye > 0 && /* @__PURE__ */ V("button", {
|
|
230
|
+
onClick: () => d((e) => {
|
|
222
231
|
let t = new URLSearchParams(e);
|
|
223
232
|
return t.delete("filters"), t;
|
|
224
233
|
}, { replace: !0 }),
|
|
@@ -231,7 +240,7 @@ function U({ screenCode: o }) {
|
|
|
231
240
|
textDecoration: "underline",
|
|
232
241
|
padding: 0
|
|
233
242
|
},
|
|
234
|
-
children: "Clear filters"
|
|
243
|
+
children: r("list.filters.clear", "Clear filters")
|
|
235
244
|
})]
|
|
236
245
|
})
|
|
237
246
|
]
|
|
@@ -239,12 +248,12 @@ function U({ screenCode: o }) {
|
|
|
239
248
|
style: {
|
|
240
249
|
flex: 1,
|
|
241
250
|
overflowY: "auto",
|
|
242
|
-
padding:
|
|
243
|
-
display:
|
|
251
|
+
padding: M === "cards" ? 10 : 0,
|
|
252
|
+
display: M === "cards" ? "flex" : "block",
|
|
244
253
|
flexDirection: "column",
|
|
245
|
-
gap:
|
|
254
|
+
gap: M === "cards" ? 10 : void 0
|
|
246
255
|
},
|
|
247
|
-
children:
|
|
256
|
+
children: J ? /* @__PURE__ */ V("div", {
|
|
248
257
|
style: {
|
|
249
258
|
padding: 12,
|
|
250
259
|
display: "flex",
|
|
@@ -256,31 +265,31 @@ function U({ screenCode: o }) {
|
|
|
256
265
|
borderRadius: 6,
|
|
257
266
|
background: "var(--surface-3)"
|
|
258
267
|
} }, t))
|
|
259
|
-
}) :
|
|
268
|
+
}) : K.length === 0 ? /* @__PURE__ */ V("div", {
|
|
260
269
|
style: {
|
|
261
270
|
padding: 28,
|
|
262
271
|
textAlign: "center",
|
|
263
272
|
fontSize: 12.5,
|
|
264
273
|
color: "var(--text-3)"
|
|
265
274
|
},
|
|
266
|
-
children: "No records found"
|
|
267
|
-
}) : /* @__PURE__ */ H(B, { children: [
|
|
268
|
-
let t =
|
|
275
|
+
children: r("list.records.none", "No records found")
|
|
276
|
+
}) : /* @__PURE__ */ H(B, { children: [K.map((e) => {
|
|
277
|
+
let t = u(e[fe]);
|
|
269
278
|
return /* @__PURE__ */ V(ue, {
|
|
270
279
|
record: e,
|
|
271
|
-
entity:
|
|
272
|
-
columns:
|
|
273
|
-
card:
|
|
274
|
-
presentation:
|
|
275
|
-
refs:
|
|
276
|
-
isSelected: t ===
|
|
277
|
-
onClick: () =>
|
|
280
|
+
entity: v,
|
|
281
|
+
columns: T,
|
|
282
|
+
card: U,
|
|
283
|
+
presentation: M,
|
|
284
|
+
refs: q,
|
|
285
|
+
isSelected: t === x,
|
|
286
|
+
onClick: () => pe(t, { replace: E === "split" })
|
|
278
287
|
}, t);
|
|
279
|
-
}),
|
|
288
|
+
}), G.isCursor && G.hasMorePages && /* @__PURE__ */ V("button", {
|
|
280
289
|
type: "button",
|
|
281
290
|
"data-testid": "record-list-load-more",
|
|
282
|
-
onClick:
|
|
283
|
-
disabled:
|
|
291
|
+
onClick: G.fetchNextPage,
|
|
292
|
+
disabled: G.isFetchingNextPage,
|
|
284
293
|
style: {
|
|
285
294
|
width: "100%",
|
|
286
295
|
padding: "8px 12px",
|
|
@@ -289,15 +298,15 @@ function U({ screenCode: o }) {
|
|
|
289
298
|
border: "none",
|
|
290
299
|
borderTop: "1px solid var(--divider)",
|
|
291
300
|
color: "var(--text-2)",
|
|
292
|
-
cursor:
|
|
301
|
+
cursor: G.isFetchingNextPage ? "default" : "pointer"
|
|
293
302
|
},
|
|
294
|
-
children:
|
|
303
|
+
children: G.isFetchingNextPage ? r("list.records.loading", "Loading…") : r("list.footer.load_more", "Load more")
|
|
295
304
|
})] })
|
|
296
305
|
})]
|
|
297
306
|
}),
|
|
298
307
|
Y && /* @__PURE__ */ V("div", {
|
|
299
308
|
"data-testid": "record-list-resize-handle",
|
|
300
|
-
onMouseDown:
|
|
309
|
+
onMouseDown: ve,
|
|
301
310
|
style: {
|
|
302
311
|
flex: "none",
|
|
303
312
|
width: 1,
|
|
@@ -308,23 +317,23 @@ function U({ screenCode: o }) {
|
|
|
308
317
|
onMouseEnter: (e) => e.currentTarget.style.background = "var(--border-strong)",
|
|
309
318
|
onMouseLeave: (e) => e.currentTarget.style.background = "var(--divider)"
|
|
310
319
|
}),
|
|
311
|
-
|
|
320
|
+
xe && /* @__PURE__ */ V("div", {
|
|
312
321
|
"data-testid": "record-detail-panel",
|
|
313
322
|
style: {
|
|
314
323
|
flex: 1,
|
|
315
324
|
minWidth: 0,
|
|
316
325
|
overflow: "hidden",
|
|
317
|
-
height:
|
|
326
|
+
height: E === "stacked" ? "50%" : "100%"
|
|
318
327
|
},
|
|
319
|
-
children:
|
|
320
|
-
entityCode:
|
|
321
|
-
recordId:
|
|
322
|
-
items:
|
|
323
|
-
schema:
|
|
324
|
-
entity:
|
|
325
|
-
onBackToList:
|
|
326
|
-
relatedRecordsPresentation:
|
|
327
|
-
},
|
|
328
|
+
children: x ? /* @__PURE__ */ V(de, {
|
|
329
|
+
entityCode: y,
|
|
330
|
+
recordId: x,
|
|
331
|
+
items: h.items,
|
|
332
|
+
schema: p,
|
|
333
|
+
entity: v,
|
|
334
|
+
onBackToList: Se,
|
|
335
|
+
relatedRecordsPresentation: le
|
|
336
|
+
}, x) : /* @__PURE__ */ V("div", {
|
|
328
337
|
style: {
|
|
329
338
|
display: "flex",
|
|
330
339
|
alignItems: "center",
|
|
@@ -332,13 +341,9 @@ function U({ screenCode: o }) {
|
|
|
332
341
|
height: "100%",
|
|
333
342
|
color: "var(--text-3)"
|
|
334
343
|
},
|
|
335
|
-
children: /* @__PURE__ */
|
|
344
|
+
children: /* @__PURE__ */ V("p", {
|
|
336
345
|
style: { fontSize: 12.5 },
|
|
337
|
-
children:
|
|
338
|
-
"Select a ",
|
|
339
|
-
h(p.display.name),
|
|
340
|
-
" to view details"
|
|
341
|
-
]
|
|
346
|
+
children: r("list.detail.select_prompt", "Select a {name} to view details", { name: r(v.display.name) })
|
|
342
347
|
})
|
|
343
348
|
})
|
|
344
349
|
})
|
|
@@ -346,7 +351,7 @@ function U({ screenCode: o }) {
|
|
|
346
351
|
});
|
|
347
352
|
}
|
|
348
353
|
function ue({ record: e, entity: t, columns: n, card: r, presentation: i, refs: a, isSelected: o, onClick: s }) {
|
|
349
|
-
let c =
|
|
354
|
+
let c = _();
|
|
350
355
|
if (i === "cards") {
|
|
351
356
|
let n = r.badgeFields.filter((n) => W(t, e, n)), i = r.bodyFields.filter((n) => W(t, e, n)), l = r.metaFields.filter((n) => W(t, e, n));
|
|
352
357
|
return /* @__PURE__ */ H("button", {
|
|
@@ -381,13 +386,13 @@ function ue({ record: e, entity: t, columns: n, card: r, presentation: i, refs:
|
|
|
381
386
|
color: "var(--text-3)",
|
|
382
387
|
overflowWrap: "anywhere"
|
|
383
388
|
},
|
|
384
|
-
children:
|
|
389
|
+
children: w({
|
|
385
390
|
entity: t,
|
|
386
391
|
fieldName: r.subtitleField,
|
|
387
392
|
record: e,
|
|
388
393
|
mode: "display",
|
|
389
394
|
refs: a,
|
|
390
|
-
|
|
395
|
+
t: c
|
|
391
396
|
})
|
|
392
397
|
}),
|
|
393
398
|
n.length > 0 && /* @__PURE__ */ V("div", {
|
|
@@ -406,13 +411,13 @@ function ue({ record: e, entity: t, columns: n, card: r, presentation: i, refs:
|
|
|
406
411
|
maxWidth: "100%",
|
|
407
412
|
overflowWrap: "anywhere"
|
|
408
413
|
},
|
|
409
|
-
children:
|
|
414
|
+
children: w({
|
|
410
415
|
entity: t,
|
|
411
416
|
fieldName: n,
|
|
412
417
|
record: e,
|
|
413
418
|
mode: "display",
|
|
414
419
|
refs: a,
|
|
415
|
-
|
|
420
|
+
t: c
|
|
416
421
|
})
|
|
417
422
|
}, n))
|
|
418
423
|
}),
|
|
@@ -427,8 +432,7 @@ function ue({ record: e, entity: t, columns: n, card: r, presentation: i, refs:
|
|
|
427
432
|
entity: t,
|
|
428
433
|
record: e,
|
|
429
434
|
fieldName: n,
|
|
430
|
-
refs: a
|
|
431
|
-
locale: c
|
|
435
|
+
refs: a
|
|
432
436
|
}, n))
|
|
433
437
|
}),
|
|
434
438
|
l.length > 0 && /* @__PURE__ */ V("div", {
|
|
@@ -444,13 +448,13 @@ function ue({ record: e, entity: t, columns: n, card: r, presentation: i, refs:
|
|
|
444
448
|
minWidth: 0,
|
|
445
449
|
overflowWrap: "anywhere"
|
|
446
450
|
},
|
|
447
|
-
children:
|
|
451
|
+
children: w({
|
|
448
452
|
entity: t,
|
|
449
453
|
fieldName: n,
|
|
450
454
|
record: e,
|
|
451
455
|
mode: "display",
|
|
452
456
|
refs: a,
|
|
453
|
-
|
|
457
|
+
t: c
|
|
454
458
|
})
|
|
455
459
|
}, n))
|
|
456
460
|
})
|
|
@@ -490,13 +494,13 @@ function ue({ record: e, entity: t, columns: n, card: r, presentation: i, refs:
|
|
|
490
494
|
whiteSpace: "nowrap",
|
|
491
495
|
color: "var(--text)"
|
|
492
496
|
},
|
|
493
|
-
children:
|
|
497
|
+
children: w({
|
|
494
498
|
entity: t,
|
|
495
499
|
fieldName: l,
|
|
496
500
|
record: e,
|
|
497
501
|
mode: "display",
|
|
498
502
|
refs: a,
|
|
499
|
-
|
|
503
|
+
t: c
|
|
500
504
|
})
|
|
501
505
|
}), /* @__PURE__ */ H("div", {
|
|
502
506
|
style: {
|
|
@@ -513,13 +517,13 @@ function ue({ record: e, entity: t, columns: n, card: r, presentation: i, refs:
|
|
|
513
517
|
textOverflow: "ellipsis",
|
|
514
518
|
whiteSpace: "nowrap"
|
|
515
519
|
},
|
|
516
|
-
children:
|
|
520
|
+
children: w({
|
|
517
521
|
entity: t,
|
|
518
522
|
fieldName: u,
|
|
519
523
|
record: e,
|
|
520
524
|
mode: "display",
|
|
521
525
|
refs: a,
|
|
522
|
-
|
|
526
|
+
t: c
|
|
523
527
|
})
|
|
524
528
|
}), /* @__PURE__ */ V("div", {
|
|
525
529
|
style: {
|
|
@@ -528,15 +532,15 @@ function ue({ record: e, entity: t, columns: n, card: r, presentation: i, refs:
|
|
|
528
532
|
gap: 4,
|
|
529
533
|
flexShrink: 0
|
|
530
534
|
},
|
|
531
|
-
children: d.map((n) =>
|
|
535
|
+
children: d.map((n) => S(t, e, n) == null ? null : /* @__PURE__ */ V("div", {
|
|
532
536
|
style: { fontSize: 11 },
|
|
533
|
-
children:
|
|
537
|
+
children: w({
|
|
534
538
|
entity: t,
|
|
535
539
|
fieldName: n,
|
|
536
540
|
record: e,
|
|
537
541
|
mode: "display",
|
|
538
542
|
refs: a,
|
|
539
|
-
|
|
543
|
+
t: c
|
|
540
544
|
})
|
|
541
545
|
}, n))
|
|
542
546
|
})]
|
|
@@ -544,17 +548,17 @@ function ue({ record: e, entity: t, columns: n, card: r, presentation: i, refs:
|
|
|
544
548
|
});
|
|
545
549
|
}
|
|
546
550
|
function W(e, t, n) {
|
|
547
|
-
let r =
|
|
551
|
+
let r = S(e, t, n);
|
|
548
552
|
return !(r == null || r === "" || Array.isArray(r) && r.length === 0);
|
|
549
553
|
}
|
|
550
554
|
function G({ entity: e, record: t, field: n, refs: r }) {
|
|
551
|
-
let i =
|
|
555
|
+
let i = _(), a = m(i, t, e), o = n ? w({
|
|
552
556
|
entity: e,
|
|
553
557
|
fieldName: n,
|
|
554
558
|
record: t,
|
|
555
559
|
mode: "display",
|
|
556
560
|
refs: r,
|
|
557
|
-
|
|
561
|
+
t: i
|
|
558
562
|
}) : a;
|
|
559
563
|
return /* @__PURE__ */ V("div", {
|
|
560
564
|
style: {
|
|
@@ -563,13 +567,13 @@ function G({ entity: e, record: t, field: n, refs: r }) {
|
|
|
563
567
|
color: "var(--text)",
|
|
564
568
|
overflowWrap: "anywhere"
|
|
565
569
|
},
|
|
566
|
-
children: o ||
|
|
570
|
+
children: o || i(e.display.name)
|
|
567
571
|
});
|
|
568
572
|
}
|
|
569
|
-
function K({ entity: e, record:
|
|
570
|
-
let
|
|
571
|
-
if (
|
|
572
|
-
let s = e.fields.get(
|
|
573
|
+
function K({ entity: e, record: t, fieldName: n, refs: r }) {
|
|
574
|
+
let i = _(), a = S(e, t, n);
|
|
575
|
+
if (a == null || a === "") return null;
|
|
576
|
+
let s = e.fields.get(n);
|
|
573
577
|
return s ? /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V("dt", {
|
|
574
578
|
style: {
|
|
575
579
|
color: "var(--text-3)",
|
|
@@ -577,7 +581,7 @@ function K({ entity: e, record: n, fieldName: r, refs: i, locale: a }) {
|
|
|
577
581
|
minWidth: 0,
|
|
578
582
|
overflowWrap: "anywhere"
|
|
579
583
|
},
|
|
580
|
-
children:
|
|
584
|
+
children: o(i, s, n)
|
|
581
585
|
}), /* @__PURE__ */ V("dd", {
|
|
582
586
|
style: {
|
|
583
587
|
margin: 0,
|
|
@@ -586,18 +590,18 @@ function K({ entity: e, record: n, fieldName: r, refs: i, locale: a }) {
|
|
|
586
590
|
minWidth: 0,
|
|
587
591
|
overflowWrap: "anywhere"
|
|
588
592
|
},
|
|
589
|
-
children:
|
|
593
|
+
children: w({
|
|
590
594
|
entity: e,
|
|
591
|
-
fieldName:
|
|
592
|
-
record:
|
|
595
|
+
fieldName: n,
|
|
596
|
+
record: t,
|
|
593
597
|
mode: "display",
|
|
594
|
-
refs:
|
|
595
|
-
|
|
598
|
+
refs: r,
|
|
599
|
+
t: i
|
|
596
600
|
})
|
|
597
601
|
})] }) : null;
|
|
598
602
|
}
|
|
599
603
|
function de({ entityCode: e, recordId: t, items: n, schema: r, entity: i, onBackToList: a, relatedRecordsPresentation: o }) {
|
|
600
|
-
return /* @__PURE__ */ V(
|
|
604
|
+
return /* @__PURE__ */ V(p, { children: /* @__PURE__ */ V(q, {
|
|
601
605
|
entityCode: e,
|
|
602
606
|
recordId: t,
|
|
603
607
|
items: n,
|
|
@@ -607,89 +611,86 @@ function de({ entityCode: e, recordId: t, items: n, schema: r, entity: i, onBack
|
|
|
607
611
|
relatedRecordsPresentation: o
|
|
608
612
|
}) });
|
|
609
613
|
}
|
|
610
|
-
function q({ entityCode:
|
|
611
|
-
let _ =
|
|
614
|
+
function q({ entityCode: i, recordId: a, items: o, schema: c, entity: f, onBackToList: p, relatedRecordsPresentation: ee }) {
|
|
615
|
+
let g = _(), b = l(f, "update"), w = R(() => a ? n(f, a) : void 0, [a, f]), { data: ae, isLoading: D } = v(i, w), O = ne(i), k = s(), [A, j] = oe(!1), [N, P] = oe({}), F = ae?.data, L = F?.$statuses, z = F?.$properties, se = E(i, a), ce = T(i, a), U = R(() => {
|
|
612
616
|
let e = /* @__PURE__ */ new Set();
|
|
613
|
-
for (let [t, n] of
|
|
614
|
-
for (let [t] of
|
|
617
|
+
for (let [t, n] of f.fields) !n.auto && !n.primary && e.add(t);
|
|
618
|
+
for (let [t] of f.files ?? []) e.add(t);
|
|
615
619
|
return e;
|
|
616
|
-
}, [
|
|
617
|
-
if (
|
|
620
|
+
}, [f]), ue = I(() => {
|
|
621
|
+
if (F) {
|
|
618
622
|
let e = {};
|
|
619
|
-
|
|
620
|
-
let n =
|
|
621
|
-
e[t] = ie(
|
|
622
|
-
}),
|
|
623
|
+
U.forEach((t) => {
|
|
624
|
+
let n = S(f, F, t);
|
|
625
|
+
e[t] = ie(f, t) ? n ?? null : n ?? "";
|
|
626
|
+
}), P(e);
|
|
623
627
|
}
|
|
624
|
-
|
|
628
|
+
j(!0);
|
|
625
629
|
}, [
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
]),
|
|
630
|
-
await
|
|
631
|
-
}, [
|
|
632
|
-
let e = {}, t =
|
|
633
|
-
entity:
|
|
634
|
-
formData:
|
|
635
|
-
record:
|
|
630
|
+
F,
|
|
631
|
+
U,
|
|
632
|
+
f
|
|
633
|
+
]), W = I(async () => {
|
|
634
|
+
await k.flushAllDrafts(), j(!1), P({});
|
|
635
|
+
}, [k]), G = I(() => {
|
|
636
|
+
let e = {}, t = y({
|
|
637
|
+
entity: f,
|
|
638
|
+
formData: N,
|
|
639
|
+
record: F,
|
|
636
640
|
isNew: !1
|
|
637
|
-
}), n =
|
|
638
|
-
for (let [t, n] of Object.entries(
|
|
641
|
+
}), n = x(t);
|
|
642
|
+
for (let [t, n] of Object.entries(N)) f.files?.has(t) || (e[t] = C(f, t, n));
|
|
639
643
|
if (Object.keys(t).length > 0 && (e.$files = t), Object.keys(e).length === 0) {
|
|
640
|
-
|
|
644
|
+
j(!1), P({});
|
|
641
645
|
return;
|
|
642
646
|
}
|
|
643
|
-
|
|
644
|
-
pkValues:
|
|
647
|
+
O.mutate({
|
|
648
|
+
pkValues: a,
|
|
645
649
|
data: e
|
|
646
|
-
}, {
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
},
|
|
650
|
-
onError: () => m.error("Failed to save")
|
|
651
|
-
});
|
|
650
|
+
}, { onSuccess: () => {
|
|
651
|
+
n.forEach((e) => k.markCommitted(e)), j(!1), P({});
|
|
652
|
+
} });
|
|
652
653
|
}, [
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
]),
|
|
660
|
-
|
|
654
|
+
k,
|
|
655
|
+
O,
|
|
656
|
+
a,
|
|
657
|
+
f,
|
|
658
|
+
N,
|
|
659
|
+
F
|
|
660
|
+
]), K = I((e, t) => {
|
|
661
|
+
P((n) => ({
|
|
661
662
|
...n,
|
|
662
663
|
[e]: t
|
|
663
664
|
}));
|
|
664
665
|
}, []);
|
|
665
|
-
if (
|
|
666
|
-
if (!
|
|
667
|
-
let
|
|
668
|
-
schema:
|
|
669
|
-
entity:
|
|
670
|
-
entityCode:
|
|
671
|
-
recordId:
|
|
672
|
-
record:
|
|
673
|
-
...
|
|
674
|
-
...
|
|
675
|
-
} :
|
|
666
|
+
if (D) return /* @__PURE__ */ V(re, {});
|
|
667
|
+
if (!F) return null;
|
|
668
|
+
let de = m(g, F, f), q = f.display?.display_field, J = de ? void 0 : q ? F[q] : F[f.fields.names()[0]], fe = de || (J != null && typeof J != "object" ? u(J) : g(f.display.name)), pe = F?.$refs, me = {
|
|
669
|
+
schema: c,
|
|
670
|
+
entity: f,
|
|
671
|
+
entityCode: i,
|
|
672
|
+
recordId: a,
|
|
673
|
+
record: A ? {
|
|
674
|
+
...F,
|
|
675
|
+
...N
|
|
676
|
+
} : F,
|
|
676
677
|
isNew: !1,
|
|
677
|
-
mode:
|
|
678
|
-
onFieldChange:
|
|
679
|
-
refs:
|
|
680
|
-
objectProperties:
|
|
681
|
-
onSetProperty:
|
|
678
|
+
mode: A ? "edit" : "display",
|
|
679
|
+
onFieldChange: A ? K : void 0,
|
|
680
|
+
refs: pe,
|
|
681
|
+
objectProperties: z ?? void 0,
|
|
682
|
+
onSetProperty: b ? (e, t) => ce.mutate({
|
|
682
683
|
propertyCode: e,
|
|
683
684
|
value: t
|
|
684
685
|
}) : void 0,
|
|
685
|
-
isPropertyPending:
|
|
686
|
-
objectStatuses:
|
|
687
|
-
onSetStatus:
|
|
686
|
+
isPropertyPending: ce.isPending,
|
|
687
|
+
objectStatuses: L ?? void 0,
|
|
688
|
+
onSetStatus: b ? (e, t) => se.mutate({
|
|
688
689
|
groupCode: e,
|
|
689
690
|
statusCode: t
|
|
690
691
|
}) : void 0,
|
|
691
|
-
isStatusPending:
|
|
692
|
-
relatedRecordsPresentation:
|
|
692
|
+
isStatusPending: se.isPending,
|
|
693
|
+
relatedRecordsPresentation: ee
|
|
693
694
|
};
|
|
694
695
|
return /* @__PURE__ */ H("div", {
|
|
695
696
|
style: {
|
|
@@ -702,7 +703,9 @@ function q({ entityCode: t, recordId: r, items: i, schema: a, entity: l, onBackT
|
|
|
702
703
|
display: "flex",
|
|
703
704
|
alignItems: "center",
|
|
704
705
|
justifyContent: "space-between",
|
|
705
|
-
|
|
706
|
+
paddingTop: 10,
|
|
707
|
+
paddingBottom: 10,
|
|
708
|
+
...te(16),
|
|
706
709
|
borderBottom: "1px solid var(--divider)",
|
|
707
710
|
position: "sticky",
|
|
708
711
|
top: 0,
|
|
@@ -719,58 +722,56 @@ function q({ entityCode: t, recordId: r, items: i, schema: a, entity: l, onBackT
|
|
|
719
722
|
whiteSpace: "nowrap",
|
|
720
723
|
color: "var(--text)"
|
|
721
724
|
},
|
|
722
|
-
children:
|
|
725
|
+
children: fe
|
|
723
726
|
}), /* @__PURE__ */ H("div", {
|
|
724
727
|
style: {
|
|
725
728
|
display: "flex",
|
|
726
729
|
alignItems: "center",
|
|
727
730
|
gap: 6
|
|
728
731
|
},
|
|
729
|
-
children: [p && /* @__PURE__ */ V(
|
|
732
|
+
children: [p && /* @__PURE__ */ V(t, {
|
|
730
733
|
icon: /* @__PURE__ */ V(e.back, { size: 14 }),
|
|
731
|
-
title: "Back to list",
|
|
734
|
+
title: g("list.detail.back_to_list", "Back to list"),
|
|
732
735
|
onClick: p
|
|
733
|
-
}),
|
|
736
|
+
}), b && (A ? /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V(r, {
|
|
734
737
|
size: "xs",
|
|
735
738
|
icon: /* @__PURE__ */ V(e.x, { size: 12 }),
|
|
736
|
-
onClick:
|
|
737
|
-
children: "Cancel"
|
|
738
|
-
}), /* @__PURE__ */ V(
|
|
739
|
+
onClick: W,
|
|
740
|
+
children: g("dialog.cancel", "Cancel")
|
|
741
|
+
}), /* @__PURE__ */ V(r, {
|
|
739
742
|
kind: "primary",
|
|
740
743
|
size: "xs",
|
|
741
|
-
icon:
|
|
742
|
-
onClick:
|
|
743
|
-
disabled:
|
|
744
|
-
children:
|
|
745
|
-
})] }) : /* @__PURE__ */ V(
|
|
744
|
+
icon: O.isPending ? /* @__PURE__ */ V(d, { size: 12 }) : /* @__PURE__ */ V(e.save, { size: 12 }),
|
|
745
|
+
onClick: G,
|
|
746
|
+
disabled: O.isPending,
|
|
747
|
+
children: O.isPending ? g("dialog.saving", "Saving…") : g("dialog.save", "Save")
|
|
748
|
+
})] }) : /* @__PURE__ */ V(r, {
|
|
746
749
|
size: "xs",
|
|
747
750
|
icon: /* @__PURE__ */ V(e.edit, { size: 12 }),
|
|
748
|
-
onClick:
|
|
749
|
-
children: "Edit"
|
|
751
|
+
onClick: ue,
|
|
752
|
+
children: g("list.record.edit", "Edit")
|
|
750
753
|
}))]
|
|
751
754
|
})]
|
|
752
755
|
}), /* @__PURE__ */ V("div", {
|
|
753
756
|
style: {
|
|
754
757
|
flex: 1,
|
|
755
758
|
overflowY: "auto",
|
|
756
|
-
|
|
759
|
+
paddingTop: 16,
|
|
760
|
+
paddingBottom: 16,
|
|
761
|
+
...te(16),
|
|
757
762
|
display: "flex",
|
|
758
763
|
flexDirection: "column",
|
|
759
764
|
gap: 12
|
|
760
765
|
},
|
|
761
|
-
children:
|
|
762
|
-
nodes:
|
|
763
|
-
ctx:
|
|
764
|
-
}) : /* @__PURE__ */
|
|
766
|
+
children: o && o.length > 0 ? /* @__PURE__ */ V(M, {
|
|
767
|
+
nodes: o,
|
|
768
|
+
ctx: me
|
|
769
|
+
}) : /* @__PURE__ */ V("p", {
|
|
765
770
|
style: {
|
|
766
771
|
fontSize: 12.5,
|
|
767
772
|
color: "var(--text-3)"
|
|
768
773
|
},
|
|
769
|
-
children:
|
|
770
|
-
"No layout configured. Add ",
|
|
771
|
-
/* @__PURE__ */ V("code", { children: "items:" }),
|
|
772
|
-
" to the screen definition."
|
|
773
|
-
]
|
|
774
|
+
children: h(g("list.detail.no_layout", "No layout configured. Add {key} to the screen definition."), { key: /* @__PURE__ */ V("code", { children: le }) })
|
|
774
775
|
})
|
|
775
776
|
})]
|
|
776
777
|
});
|