@declarion/react 0.59.0 → 0.60.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/{AgentChatPanel.impl-DBH1Ff4G.js → AgentChatPanel.impl-BY-Ir7Sh.js} +39 -39
- package/dist-lib/{DetailAuditStrip-GNRA_eP5.js → DetailAuditStrip-B9p1XhjC.js} +26 -27
- package/dist-lib/{DraggableChildrenTable-4RZC351U.js → DraggableChildrenTable-CtL7rdT6.js} +34 -34
- package/dist-lib/{Grid-CQabaBLx.js → Grid-CYERLdXO.js} +1 -1
- package/dist-lib/{LayoutRenderer-DGKWZKpW.js → LayoutRenderer-B08IJKsZ.js} +465 -465
- package/dist-lib/{ListCardsBody-DfGmyNIu.js → ListCardsBody-Dje_rays.js} +26 -26
- package/dist-lib/{MarkdownRenderer-BDbzDv_y.js → MarkdownRenderer-N0IWjTH5.js} +1 -1
- package/dist-lib/{RefreshControl-Bhoib0ZA.js → RefreshControl-BEWSHtAC.js} +26 -26
- package/dist-lib/{SmartDetailPage.impl-Ds2RGg6K.js → SmartDetailPage.impl-CYiM-ITJ.js} +467 -467
- package/dist-lib/SmartListPage.impl-Db_Pv9Xc.js +3051 -0
- package/dist-lib/SmartRecordListPage.impl-hbbLglC1.js +780 -0
- package/dist-lib/{SortHeaderMenu-Cijxk4cX.js → SortHeaderMenu-DKKeCGTH.js} +1 -1
- package/dist-lib/{action-dispatch-DY0c8U81.js → action-dispatch-DbiOpvd6.js} +187 -187
- package/dist-lib/api/data.d.ts +5 -1
- package/dist-lib/{cardProjection-Bkl2SSYz.js → cardProjection-nveYLvHR.js} +1 -1
- package/dist-lib/components/chrome/headerActionZone.d.ts +27 -0
- package/dist-lib/components/pages/list/filter-meta.d.ts +1 -1
- package/dist-lib/components/pages/list/useActiveView.d.ts +9 -2
- package/dist-lib/components/pages/list/useListViews.d.ts +3 -2
- package/dist-lib/{failure-v-uGSpbX.js → failure-BT54OLHy.js} +5 -5
- package/dist-lib/{format-count-DA4wmmWR.js → format-count-DLFCdtME.js} +246 -246
- package/dist-lib/hooks/useObject.d.ts +3 -2
- package/dist-lib/index.js +1083 -1091
- package/dist-lib/lib/field-classification.d.ts +10 -1
- package/dist-lib/{peekDraftStore-D-cTbiIr.js → peekDraftStore-DSExeoAh.js} +6 -6
- package/dist-lib/{registry-Cb3W-czW.js → registry-CRPxNbkk.js} +444 -438
- package/dist-lib/testing.js +2 -2
- package/dist-lib/{useAgentConversation-D97IqE-J.js → useAgentConversation-BavrHfrU.js} +14 -14
- package/dist-lib/{useCurrentScreen-BL5NZFCw.js → useCurrentScreen-BPq7HMF1.js} +1083 -1017
- package/dist-lib/{useListQuery-BG1GyKtJ.js → useListQuery-CG1WM4cv.js} +5 -5
- package/dist-lib/{field-classification-C28XE-_P.js → useOwnRefresh-C18iWRgr.js} +132 -158
- package/dist-lib/{useProperties-4Lg3odrt.js → useProperties-C35JrjwQ.js} +2 -2
- package/dist-lib/{useTabSearchMirror-ZVLlINBX.js → useTabSearchMirror-DKktWWLB.js} +1 -1
- package/package.json +1 -1
- package/dist-lib/SmartListPage.impl-BrZLE_Gb.js +0 -3046
- package/dist-lib/SmartRecordListPage.impl-C1FJLr80.js +0 -780
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { s as e } from "./DynamicIcon-DW5krHuX.js";
|
|
2
|
-
import {
|
|
2
|
+
import { Jn as t, Lt as n, Vn as r, Zt as i, fn as a, jt as o, qn as s } from "./useCurrentScreen-BPq7HMF1.js";
|
|
3
3
|
import { d as c, f as l, t as u, u as d } from "./useText-BFDCTUSo.js";
|
|
4
|
-
import { t as f } from "./failure-
|
|
5
|
-
import { g as p, h as m, t as h } from "./useAgentConversation-
|
|
4
|
+
import { t as f } from "./failure-BT54OLHy.js";
|
|
5
|
+
import { g as p, h as m, t as h } from "./useAgentConversation-BavrHfrU.js";
|
|
6
6
|
import { useEffect as g, useRef as _, useState as v } from "react";
|
|
7
7
|
import { jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
8
8
|
import x from "react-textarea-autosize";
|
|
@@ -59,7 +59,7 @@ function D(e) {
|
|
|
59
59
|
//#endregion
|
|
60
60
|
//#region src/components/agents/AgentChatPanel.impl.tsx
|
|
61
61
|
var O = 80;
|
|
62
|
-
function k({ open: t, onClose:
|
|
62
|
+
function k({ open: t, onClose: n, context: r, title: i = "", askOnOpen: o }) {
|
|
63
63
|
let l = h(), d = u(), S = u("errors"), [w, T] = v(""), [E, D] = v(null), k = _(null), [A, P] = v(!1), I = _(null), L = _(null), R = _(!0), [B, V] = v(!1), H = () => {
|
|
64
64
|
let e = L.current;
|
|
65
65
|
if (!e) return;
|
|
@@ -77,9 +77,9 @@ function k({ open: t, onClose: r, context: i, title: a = "", askOnOpen: s }) {
|
|
|
77
77
|
}, [l.messages]), g(() => {
|
|
78
78
|
t && U("instant");
|
|
79
79
|
}, [t]), g(() => {
|
|
80
|
-
let e =
|
|
80
|
+
let e = o?.trim();
|
|
81
81
|
t && e && k.current !== e && (k.current = e, I.current?.(e));
|
|
82
|
-
}, [t,
|
|
82
|
+
}, [t, o]), !t) return null;
|
|
83
83
|
let W = async (e) => {
|
|
84
84
|
if (e.trim()) {
|
|
85
85
|
D(null), T("");
|
|
@@ -141,7 +141,7 @@ function k({ open: t, onClose: r, context: i, title: a = "", askOnOpen: s }) {
|
|
|
141
141
|
fontWeight: 600,
|
|
142
142
|
color: "var(--text)"
|
|
143
143
|
},
|
|
144
|
-
children:
|
|
144
|
+
children: i
|
|
145
145
|
}), /* @__PURE__ */ b("div", {
|
|
146
146
|
style: {
|
|
147
147
|
fontSize: 10.5,
|
|
@@ -157,17 +157,17 @@ function k({ open: t, onClose: r, context: i, title: a = "", askOnOpen: s }) {
|
|
|
157
157
|
borderRadius: 999
|
|
158
158
|
} }), c(d("agent.panel.context", "context: {context}"), { context: /* @__PURE__ */ y("span", {
|
|
159
159
|
className: "mono",
|
|
160
|
-
children:
|
|
160
|
+
children: r || d("agent.panel.context_platform", "Platform")
|
|
161
161
|
}) })]
|
|
162
162
|
})]
|
|
163
163
|
}),
|
|
164
|
-
l.messages.length > 0 && /* @__PURE__ */ y(
|
|
164
|
+
l.messages.length > 0 && /* @__PURE__ */ y(s, {
|
|
165
165
|
size: 24,
|
|
166
166
|
icon: /* @__PURE__ */ y(e.copy, { size: 12 }),
|
|
167
167
|
onClick: () => void ne(d, l.messages),
|
|
168
168
|
title: d("agent.panel.copy_all", "Copy entire conversation")
|
|
169
169
|
}),
|
|
170
|
-
/* @__PURE__ */ y(
|
|
170
|
+
/* @__PURE__ */ y(s, {
|
|
171
171
|
size: 24,
|
|
172
172
|
icon: /* @__PURE__ */ y(e.clock, { size: 12 }),
|
|
173
173
|
onClick: () => {
|
|
@@ -175,21 +175,21 @@ function k({ open: t, onClose: r, context: i, title: a = "", askOnOpen: s }) {
|
|
|
175
175
|
},
|
|
176
176
|
title: d("agent.panel.earlier", "Earlier conversations")
|
|
177
177
|
}),
|
|
178
|
-
l.conversationId && /* @__PURE__ */ y(
|
|
178
|
+
l.conversationId && /* @__PURE__ */ y(s, {
|
|
179
179
|
size: 24,
|
|
180
180
|
icon: /* @__PURE__ */ y(e.plus, { size: 12 }),
|
|
181
181
|
onClick: l.startNew,
|
|
182
182
|
title: d("agent.panel.new_conversation", "New conversation")
|
|
183
183
|
}),
|
|
184
|
-
/* @__PURE__ */ y(
|
|
184
|
+
/* @__PURE__ */ y(s, {
|
|
185
185
|
size: 24,
|
|
186
186
|
icon: /* @__PURE__ */ y(e.settings, { size: 12 }),
|
|
187
187
|
title: d("agent.panel.preferences", "Preferences")
|
|
188
188
|
}),
|
|
189
|
-
/* @__PURE__ */ y(
|
|
189
|
+
/* @__PURE__ */ y(s, {
|
|
190
190
|
size: 24,
|
|
191
191
|
icon: /* @__PURE__ */ y(e.x, { size: 13 }),
|
|
192
|
-
onClick:
|
|
192
|
+
onClick: n,
|
|
193
193
|
title: d("agent.panel.close", "Close")
|
|
194
194
|
})
|
|
195
195
|
]
|
|
@@ -242,7 +242,7 @@ function k({ open: t, onClose: r, context: i, title: a = "", askOnOpen: s }) {
|
|
|
242
242
|
color: "var(--text-3)",
|
|
243
243
|
fontSize: 11.5
|
|
244
244
|
},
|
|
245
|
-
children: [/* @__PURE__ */ y(
|
|
245
|
+
children: [/* @__PURE__ */ y(a, { size: 12 }), d("agent.panel.thinking", "Thinking…")]
|
|
246
246
|
}),
|
|
247
247
|
E && /* @__PURE__ */ y("div", {
|
|
248
248
|
style: {
|
|
@@ -316,7 +316,7 @@ function k({ open: t, onClose: r, context: i, title: a = "", askOnOpen: s }) {
|
|
|
316
316
|
fontFamily: "inherit"
|
|
317
317
|
}
|
|
318
318
|
}),
|
|
319
|
-
/* @__PURE__ */ y(
|
|
319
|
+
/* @__PURE__ */ y(s, {
|
|
320
320
|
size: 26,
|
|
321
321
|
icon: /* @__PURE__ */ y(e.paperclip, { size: 12 }),
|
|
322
322
|
title: d("agent.panel.attach_context", "Attach context")
|
|
@@ -422,7 +422,7 @@ function j({ children: t, dataMessageId: n, dataStreaming: r }) {
|
|
|
422
422
|
});
|
|
423
423
|
}
|
|
424
424
|
function M({ agentTurn: e }) {
|
|
425
|
-
let t = u(), n = u("errors"),
|
|
425
|
+
let t = u(), n = u("errors"), i = o("agent_turn")?.fields.get("status"), a = e.status === "failed" ? n(e.error_code ?? "", r(e.error_details) || n("agents.turn_failed", "The assistant could not finish this turn.")) : void 0;
|
|
426
426
|
return /* @__PURE__ */ b("div", {
|
|
427
427
|
"data-agent-turn": e.id,
|
|
428
428
|
"data-turn-status": e.status,
|
|
@@ -431,10 +431,10 @@ function M({ agentTurn: e }) {
|
|
|
431
431
|
color: "var(--text-3)"
|
|
432
432
|
},
|
|
433
433
|
children: [
|
|
434
|
-
e.status === "queued" && (t(
|
|
434
|
+
e.status === "queued" && (t(i?.values?.find((e) => e.code === "queued")?.name) || e.status),
|
|
435
435
|
e.status === "running" && t("agent.panel.turn_working", "Working…"),
|
|
436
436
|
e.status === "waiting" && t("agent.panel.turn_waiting", "Waiting for your response"),
|
|
437
|
-
e.status === "failed" && t("agent.panel.turn_unfinished", "The agent couldn't finish: {reason}", { reason:
|
|
437
|
+
e.status === "failed" && t("agent.panel.turn_unfinished", "The agent couldn't finish: {reason}", { reason: a ?? "" })
|
|
438
438
|
]
|
|
439
439
|
});
|
|
440
440
|
}
|
|
@@ -537,7 +537,7 @@ function I() {
|
|
|
537
537
|
};
|
|
538
538
|
}
|
|
539
539
|
function L({ call: e }) {
|
|
540
|
-
let [t, n] = v(!1), r = u(), i = B(e.name), a =
|
|
540
|
+
let [t, n] = v(!1), r = u(), i = B(e.name), a = o("agent_tool_invocation")?.fields.get("status"), s = e.status ?? "running", c = r(a?.values?.find((e) => e.code === s)?.name) || s, l = e.status === "outcome_unknown" ? "outcome_unknown" : e.isError ? "failed" : R(e.status) ? "ok" : "running";
|
|
541
541
|
return /* @__PURE__ */ b("div", {
|
|
542
542
|
"data-activity-call": e.name,
|
|
543
543
|
"data-call-state": l,
|
|
@@ -749,11 +749,11 @@ var U = {
|
|
|
749
749
|
}
|
|
750
750
|
};
|
|
751
751
|
function W({ block: e }) {
|
|
752
|
-
let
|
|
752
|
+
let t = u();
|
|
753
753
|
switch (e.type) {
|
|
754
754
|
case "text": return /* @__PURE__ */ y("div", {
|
|
755
755
|
className: "agent-md",
|
|
756
|
-
children: /* @__PURE__ */ y(
|
|
756
|
+
children: /* @__PURE__ */ y(n, {
|
|
757
757
|
content: e.text,
|
|
758
758
|
plugins: "gfm",
|
|
759
759
|
prose: !1,
|
|
@@ -762,23 +762,23 @@ function W({ block: e }) {
|
|
|
762
762
|
})
|
|
763
763
|
});
|
|
764
764
|
case "tool_use": {
|
|
765
|
-
let
|
|
765
|
+
let n = q(t, e.name, e.input);
|
|
766
766
|
return /* @__PURE__ */ y(G, {
|
|
767
767
|
kind: "call",
|
|
768
|
-
label:
|
|
769
|
-
sub:
|
|
768
|
+
label: n.label,
|
|
769
|
+
sub: n.sub,
|
|
770
770
|
body: e.input
|
|
771
771
|
});
|
|
772
772
|
}
|
|
773
773
|
case "tool_result": return /* @__PURE__ */ y(G, {
|
|
774
774
|
kind: "result",
|
|
775
|
-
label: J(
|
|
775
|
+
label: J(t, e),
|
|
776
776
|
body: e.output,
|
|
777
777
|
isError: !!e.is_error
|
|
778
778
|
});
|
|
779
779
|
case "elicit_response": return /* @__PURE__ */ y(G, {
|
|
780
780
|
kind: "result",
|
|
781
|
-
label:
|
|
781
|
+
label: t("agent.panel.chip.answer", "answer"),
|
|
782
782
|
body: e.data
|
|
783
783
|
});
|
|
784
784
|
case "decision": return /* @__PURE__ */ y(X, { block: e });
|
|
@@ -998,12 +998,12 @@ function Z(e, t) {
|
|
|
998
998
|
function Q(e, t) {
|
|
999
999
|
return e("agent.panel.proposal", "Run {code}.", { code: t });
|
|
1000
1000
|
}
|
|
1001
|
-
function re({ tool:
|
|
1002
|
-
let a = u(), o = u("errors"), s = JSON.stringify(
|
|
1001
|
+
function re({ tool: n, onApprove: r, onReject: i }) {
|
|
1002
|
+
let a = u(), o = u("errors"), s = JSON.stringify(n.params ?? {}, null, 2), [c, l] = v(!1), [d, p] = v(!1), [m, h] = v(""), [g, _] = v(null), [x, S] = v(!1), C = async (e) => {
|
|
1003
1003
|
if (!x) {
|
|
1004
1004
|
S(!0);
|
|
1005
1005
|
try {
|
|
1006
|
-
await
|
|
1006
|
+
await r(e);
|
|
1007
1007
|
} catch (e) {
|
|
1008
1008
|
_(f(o, e)), S(!1);
|
|
1009
1009
|
}
|
|
@@ -1017,7 +1017,7 @@ function re({ tool: t, onApprove: n, onReject: i }) {
|
|
|
1017
1017
|
_(f(o, e)), S(!1);
|
|
1018
1018
|
}
|
|
1019
1019
|
}
|
|
1020
|
-
}, T = typeof
|
|
1020
|
+
}, T = typeof n.confidence == "number" ? Math.round(Math.max(0, Math.min(1, n.confidence)) * 100) : null;
|
|
1021
1021
|
return /* @__PURE__ */ b("div", {
|
|
1022
1022
|
style: {
|
|
1023
1023
|
marginTop: 4,
|
|
@@ -1053,7 +1053,7 @@ function re({ tool: t, onApprove: n, onReject: i }) {
|
|
|
1053
1053
|
fontSize: 10.5,
|
|
1054
1054
|
color: "var(--text-3)"
|
|
1055
1055
|
},
|
|
1056
|
-
children:
|
|
1056
|
+
children: n.tool_code
|
|
1057
1057
|
}),
|
|
1058
1058
|
T !== null && /* @__PURE__ */ y("span", {
|
|
1059
1059
|
title: a("agent.panel.confidence_title", "LLM confidence {percent}%", { percent: T }),
|
|
@@ -1076,16 +1076,16 @@ function re({ tool: t, onApprove: n, onReject: i }) {
|
|
|
1076
1076
|
color: "var(--text)",
|
|
1077
1077
|
marginBottom: 8
|
|
1078
1078
|
},
|
|
1079
|
-
children:
|
|
1079
|
+
children: n.question?.message?.trim() || Q(a, n.tool_code)
|
|
1080
1080
|
}),
|
|
1081
|
-
|
|
1081
|
+
n.reason?.trim() && /* @__PURE__ */ y("div", {
|
|
1082
1082
|
style: {
|
|
1083
1083
|
fontSize: 11.5,
|
|
1084
1084
|
lineHeight: 1.45,
|
|
1085
1085
|
color: "var(--text-2)",
|
|
1086
1086
|
marginBottom: 8
|
|
1087
1087
|
},
|
|
1088
|
-
children:
|
|
1088
|
+
children: n.reason.trim()
|
|
1089
1089
|
}),
|
|
1090
1090
|
/* @__PURE__ */ b("button", {
|
|
1091
1091
|
type: "button",
|
|
@@ -1163,27 +1163,27 @@ function re({ tool: t, onApprove: n, onReject: i }) {
|
|
|
1163
1163
|
justifyContent: "flex-end"
|
|
1164
1164
|
},
|
|
1165
1165
|
children: [
|
|
1166
|
-
d ? /* @__PURE__ */ y(
|
|
1166
|
+
d ? /* @__PURE__ */ y(t, {
|
|
1167
1167
|
size: "xs",
|
|
1168
1168
|
kind: "ghost",
|
|
1169
1169
|
onClick: w,
|
|
1170
1170
|
disabled: x,
|
|
1171
1171
|
children: a("agent.panel.reject_send", "Send rejection")
|
|
1172
|
-
}) : /* @__PURE__ */ y(
|
|
1172
|
+
}) : /* @__PURE__ */ y(t, {
|
|
1173
1173
|
size: "xs",
|
|
1174
1174
|
kind: "ghost",
|
|
1175
1175
|
onClick: () => p(!0),
|
|
1176
1176
|
disabled: x,
|
|
1177
1177
|
children: a("agent.panel.reject", "Reject…")
|
|
1178
1178
|
}),
|
|
1179
|
-
|
|
1179
|
+
n.confirmation_mode !== "always" && /* @__PURE__ */ y(t, {
|
|
1180
1180
|
size: "xs",
|
|
1181
1181
|
kind: "ghost",
|
|
1182
1182
|
onClick: () => C("conversation"),
|
|
1183
1183
|
disabled: x,
|
|
1184
1184
|
children: a("agent.panel.approve_chat", "Approve for this chat")
|
|
1185
1185
|
}),
|
|
1186
|
-
/* @__PURE__ */ y(
|
|
1186
|
+
/* @__PURE__ */ y(t, {
|
|
1187
1187
|
size: "xs",
|
|
1188
1188
|
kind: "primary",
|
|
1189
1189
|
icon: /* @__PURE__ */ y(e.check, { size: 11 }),
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { s as e } from "./DynamicIcon-DW5krHuX.js";
|
|
2
|
-
import {
|
|
3
|
-
import { h as i } from "./RefreshControl-
|
|
2
|
+
import { Kn as t, gn as n, qn as r } from "./useCurrentScreen-BPq7HMF1.js";
|
|
3
|
+
import { h as i } from "./RefreshControl-BEWSHtAC.js";
|
|
4
4
|
import { t as a } from "./useText-BFDCTUSo.js";
|
|
5
|
-
import {
|
|
6
|
-
import { p as s } from "./action-dispatch-
|
|
5
|
+
import { C as o } from "./useOwnRefresh-C18iWRgr.js";
|
|
6
|
+
import { p as s } from "./action-dispatch-DbiOpvd6.js";
|
|
7
7
|
import { useCallback as c, useState as l } from "react";
|
|
8
8
|
import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
9
9
|
//#region src/components/primitives/RecordIdBadge.tsx
|
|
@@ -27,8 +27,8 @@ function h({ value: t }) {
|
|
|
27
27
|
}
|
|
28
28
|
//#endregion
|
|
29
29
|
//#region src/components/chrome/PageShell.tsx
|
|
30
|
-
function g({ header: e, children: t, scrollRef:
|
|
31
|
-
let i =
|
|
30
|
+
function g({ header: e, children: t, scrollRef: r }) {
|
|
31
|
+
let i = n(), a = i.isPhone ? o(12) : {
|
|
32
32
|
paddingLeft: "24px",
|
|
33
33
|
paddingRight: "24px"
|
|
34
34
|
};
|
|
@@ -41,6 +41,7 @@ function g({ header: e, children: t, scrollRef: n }) {
|
|
|
41
41
|
background: "var(--background)"
|
|
42
42
|
},
|
|
43
43
|
children: [/* @__PURE__ */ d("div", {
|
|
44
|
+
"data-testid": "page-shell-header",
|
|
44
45
|
style: {
|
|
45
46
|
flexShrink: 0,
|
|
46
47
|
paddingTop: i.isPhone ? 14 : 24,
|
|
@@ -49,7 +50,7 @@ function g({ header: e, children: t, scrollRef: n }) {
|
|
|
49
50
|
},
|
|
50
51
|
children: e
|
|
51
52
|
}), /* @__PURE__ */ d("div", {
|
|
52
|
-
ref:
|
|
53
|
+
ref: r,
|
|
53
54
|
style: {
|
|
54
55
|
flex: 1,
|
|
55
56
|
minHeight: 0,
|
|
@@ -67,10 +68,19 @@ function g({ header: e, children: t, scrollRef: n }) {
|
|
|
67
68
|
})]
|
|
68
69
|
});
|
|
69
70
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
var _ = {
|
|
72
|
+
display: "flex",
|
|
73
|
+
alignItems: "center",
|
|
74
|
+
gap: 6,
|
|
75
|
+
flexGrow: 1,
|
|
76
|
+
flexShrink: 1,
|
|
77
|
+
flexBasis: "auto",
|
|
78
|
+
marginLeft: "auto",
|
|
79
|
+
minWidth: 180,
|
|
80
|
+
flexWrap: "wrap",
|
|
81
|
+
justifyContent: "flex-end"
|
|
82
|
+
}, v = 160;
|
|
83
|
+
function y({ icon: n, title: o, recordId: s, description: c, highlights: l, mode: p, dirty: m = !1, showBack: g = !1, onBack: y, right: b, identityControls: x, showTitle: S = !0 }) {
|
|
74
84
|
let C = a();
|
|
75
85
|
return /* @__PURE__ */ f("div", {
|
|
76
86
|
style: {
|
|
@@ -86,14 +96,14 @@ function y({ icon: r, title: o, recordId: s, description: c, highlights: l, mode
|
|
|
86
96
|
paddingTop: 4,
|
|
87
97
|
flexShrink: 0
|
|
88
98
|
},
|
|
89
|
-
children: /* @__PURE__ */ d(
|
|
99
|
+
children: /* @__PURE__ */ d(r, {
|
|
90
100
|
size: 26,
|
|
91
101
|
icon: /* @__PURE__ */ d(e.back, { size: 14 }),
|
|
92
102
|
title: C("shell.back", "Back"),
|
|
93
103
|
onClick: y
|
|
94
104
|
})
|
|
95
105
|
}),
|
|
96
|
-
S &&
|
|
106
|
+
S && n && /* @__PURE__ */ d("div", {
|
|
97
107
|
style: {
|
|
98
108
|
flexShrink: 0,
|
|
99
109
|
paddingTop: 2
|
|
@@ -109,7 +119,7 @@ function y({ icon: r, title: o, recordId: s, description: c, highlights: l, mode
|
|
|
109
119
|
alignItems: "center",
|
|
110
120
|
justifyContent: "center"
|
|
111
121
|
},
|
|
112
|
-
children:
|
|
122
|
+
children: n
|
|
113
123
|
})
|
|
114
124
|
}),
|
|
115
125
|
S && /* @__PURE__ */ f(u, { children: [
|
|
@@ -164,18 +174,7 @@ function y({ icon: r, title: o, recordId: s, description: c, highlights: l, mode
|
|
|
164
174
|
b && /* @__PURE__ */ d("div", {
|
|
165
175
|
role: "toolbar",
|
|
166
176
|
"aria-label": C("shell.record.page_actions", "Page actions"),
|
|
167
|
-
style:
|
|
168
|
-
display: "flex",
|
|
169
|
-
alignItems: "center",
|
|
170
|
-
gap: 6,
|
|
171
|
-
flexGrow: 1,
|
|
172
|
-
flexShrink: 1,
|
|
173
|
-
flexBasis: "auto",
|
|
174
|
-
marginLeft: "auto",
|
|
175
|
-
minWidth: _,
|
|
176
|
-
flexWrap: "wrap",
|
|
177
|
-
justifyContent: "flex-end"
|
|
178
|
-
},
|
|
177
|
+
style: _,
|
|
179
178
|
children: b
|
|
180
179
|
}),
|
|
181
180
|
l && p === "display" && /* @__PURE__ */ d("div", {
|
|
@@ -286,4 +285,4 @@ function C({ screen: e, entity: t, entityCode: n, record: r, refs: i, schema: o
|
|
|
286
285
|
return /* @__PURE__ */ d(x, { lines: f });
|
|
287
286
|
}
|
|
288
287
|
//#endregion
|
|
289
|
-
export { h as i, y as n,
|
|
288
|
+
export { h as a, g as i, y as n, _ as r, C as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { s as e } from "./DynamicIcon-DW5krHuX.js";
|
|
2
|
-
import {
|
|
2
|
+
import { Dn as t, Jn as n, Vn as r, qn as i, rt as a } from "./useCurrentScreen-BPq7HMF1.js";
|
|
3
3
|
import { t as o } from "./useText-BFDCTUSo.js";
|
|
4
4
|
import { n as s, r as c, t as l } from "./dataTableStyles-vwD1mVOP.js";
|
|
5
5
|
import { useCallback as u, useMemo as d, useRef as f } from "react";
|
|
@@ -8,8 +8,8 @@ import { DndContext as h, PointerSensor as g, closestCenter as _, useSensor as v
|
|
|
8
8
|
import { SortableContext as b, useSortable as x, verticalListSortingStrategy as S } from "@dnd-kit/sortable";
|
|
9
9
|
import { CSS as C } from "@dnd-kit/utilities";
|
|
10
10
|
//#region src/components/detail-layout/DraggableChildrenTable.tsx
|
|
11
|
-
function w({ config:
|
|
12
|
-
let E = o(), D = f(null), O =
|
|
11
|
+
function w({ config: r, childEntity: i, schema: a, rows: l, onChange: x, validationErrors: C, refs: w }) {
|
|
12
|
+
let E = o(), D = f(null), O = r.position_field, k = r.columns, A = y(v(g, { activationConstraint: { distance: 5 } })), j = new Set(Array.isArray(r.foreign_key) ? r.foreign_key : [r.foreign_key]), M = k.filter((e) => {
|
|
13
13
|
if (j.has(e) || e === O) return !1;
|
|
14
14
|
let t = i.fields.get(e);
|
|
15
15
|
return !(!t || t.auto || t.primary || t.source);
|
|
@@ -27,22 +27,22 @@ function w({ config: t, childEntity: i, schema: a, rows: l, onChange: x, validat
|
|
|
27
27
|
let e = l.filter((e) => !e._deleted).reduce((e, t) => {
|
|
28
28
|
let n = typeof t[O] == "number" ? t[O] : -1;
|
|
29
29
|
return Math.max(e, n);
|
|
30
|
-
}, -1),
|
|
30
|
+
}, -1), t = {
|
|
31
31
|
_key: crypto.randomUUID(),
|
|
32
32
|
_dirty: !0,
|
|
33
33
|
[O]: e + 1
|
|
34
|
-
},
|
|
34
|
+
}, n = r.quick_add?.defaults ?? {};
|
|
35
35
|
for (let e of M) {
|
|
36
|
-
let
|
|
37
|
-
|
|
36
|
+
let r = i.fields.get(e);
|
|
37
|
+
r && (n[e] === void 0 ? r.default === void 0 ? r.type === "bool" && (t[e] = !1) : t[e] = r.default : t[e] = n[e]);
|
|
38
38
|
}
|
|
39
|
-
x([...l,
|
|
39
|
+
x([...l, t]);
|
|
40
40
|
}, [
|
|
41
41
|
l,
|
|
42
42
|
x,
|
|
43
43
|
M,
|
|
44
44
|
i,
|
|
45
|
-
|
|
45
|
+
r.quick_add?.defaults,
|
|
46
46
|
O
|
|
47
47
|
]), R = u((e) => {
|
|
48
48
|
x(l.map((t) => t._key === e ? {
|
|
@@ -119,10 +119,10 @@ function w({ config: t, childEntity: i, schema: a, rows: l, onChange: x, validat
|
|
|
119
119
|
padding: "0 4px"
|
|
120
120
|
} }),
|
|
121
121
|
P.map((e) => {
|
|
122
|
-
let
|
|
122
|
+
let n = i.fields.get(e);
|
|
123
123
|
return /* @__PURE__ */ p("th", {
|
|
124
124
|
style: H,
|
|
125
|
-
children:
|
|
125
|
+
children: n ? t(E, n, e, a.entities) : e
|
|
126
126
|
}, e);
|
|
127
127
|
}),
|
|
128
128
|
/* @__PURE__ */ p("th", { style: {
|
|
@@ -158,9 +158,9 @@ function w({ config: t, childEntity: i, schema: a, rows: l, onChange: x, validat
|
|
|
158
158
|
})
|
|
159
159
|
})] });
|
|
160
160
|
}
|
|
161
|
-
function T({ row:
|
|
162
|
-
let v = o(), y = !!
|
|
163
|
-
id:
|
|
161
|
+
function T({ row: t, columns: n, editableColumns: s, displayOnlyColumns: c, childEntity: u, validationErrors: d, refs: f, onCellChange: h, onDelete: g, onUndoDelete: _ }) {
|
|
162
|
+
let v = o(), y = !!t._deleted, b = d?.[t._key], { attributes: S, listeners: w, setNodeRef: T, transform: E, transition: D, isDragging: O } = x({
|
|
163
|
+
id: t._key,
|
|
164
164
|
disabled: y
|
|
165
165
|
}), k = {
|
|
166
166
|
transform: C.Translate.toString(E),
|
|
@@ -201,40 +201,40 @@ function T({ row: n, columns: r, editableColumns: s, displayOnlyColumns: c, chil
|
|
|
201
201
|
children: /* @__PURE__ */ p(e.grid, { size: 14 })
|
|
202
202
|
})
|
|
203
203
|
}),
|
|
204
|
-
|
|
205
|
-
let
|
|
204
|
+
n.map((e) => {
|
|
205
|
+
let n = u.fields.get(e), i = b?.includes(e), o = c.has(e), l = s.includes(e);
|
|
206
206
|
return y || o || !l ? /* @__PURE__ */ p("td", {
|
|
207
207
|
style: {
|
|
208
208
|
...A,
|
|
209
209
|
textDecoration: y ? "line-through" : "none"
|
|
210
210
|
},
|
|
211
|
-
children:
|
|
212
|
-
field:
|
|
211
|
+
children: n ? a({
|
|
212
|
+
field: n,
|
|
213
213
|
fieldName: e,
|
|
214
|
-
value:
|
|
214
|
+
value: t[e],
|
|
215
215
|
mode: "display",
|
|
216
|
-
record:
|
|
216
|
+
record: t,
|
|
217
217
|
refs: f,
|
|
218
218
|
t: v
|
|
219
|
-
}) :
|
|
219
|
+
}) : r(t[e])
|
|
220
220
|
}, e) : /* @__PURE__ */ p("td", {
|
|
221
221
|
style: {
|
|
222
222
|
...j,
|
|
223
|
-
outline:
|
|
223
|
+
outline: i ? "1px solid var(--danger)" : "none",
|
|
224
224
|
outlineOffset: -1,
|
|
225
|
-
borderRadius:
|
|
225
|
+
borderRadius: i ? 4 : 0
|
|
226
226
|
},
|
|
227
|
-
title:
|
|
228
|
-
children:
|
|
229
|
-
field:
|
|
227
|
+
title: i ? v("record.row.field_required", "{field} is required", { field: e }) : void 0,
|
|
228
|
+
children: n ? a({
|
|
229
|
+
field: n,
|
|
230
230
|
fieldName: e,
|
|
231
|
-
value:
|
|
231
|
+
value: t[e],
|
|
232
232
|
mode: "edit",
|
|
233
|
-
onChange: (
|
|
234
|
-
record:
|
|
233
|
+
onChange: (n) => h(t._key, e, n),
|
|
234
|
+
record: t,
|
|
235
235
|
refs: f,
|
|
236
236
|
t: v
|
|
237
|
-
}) :
|
|
237
|
+
}) : r(t[e])
|
|
238
238
|
}, e);
|
|
239
239
|
}),
|
|
240
240
|
/* @__PURE__ */ p("td", {
|
|
@@ -243,15 +243,15 @@ function T({ row: n, columns: r, editableColumns: s, displayOnlyColumns: c, chil
|
|
|
243
243
|
borderBottom: "1px solid var(--divider)",
|
|
244
244
|
verticalAlign: "middle"
|
|
245
245
|
},
|
|
246
|
-
children: y ? /* @__PURE__ */ p(
|
|
246
|
+
children: y ? /* @__PURE__ */ p(i, {
|
|
247
247
|
size: 24,
|
|
248
248
|
icon: /* @__PURE__ */ p(e.refresh, { size: 12 }),
|
|
249
|
-
onClick: () => _(
|
|
249
|
+
onClick: () => _(t._key),
|
|
250
250
|
title: v("record.row.undo_delete", "Undo delete")
|
|
251
|
-
}) : /* @__PURE__ */ p(
|
|
251
|
+
}) : /* @__PURE__ */ p(i, {
|
|
252
252
|
size: 24,
|
|
253
253
|
icon: /* @__PURE__ */ p(e.trash, { size: 12 }),
|
|
254
|
-
onClick: () => g(
|
|
254
|
+
onClick: () => g(t._key),
|
|
255
255
|
title: v("record.row.delete", "Delete row")
|
|
256
256
|
})
|
|
257
257
|
})
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { dt as e, ft as t, ht as n, lt as r, mt as i, pt as a, st as o, ut as s } from "./useCurrentScreen-
|
|
1
|
+
import { dt as e, ft as t, ht as n, lt as r, mt as i, pt as a, st as o, ut as s } from "./useCurrentScreen-BPq7HMF1.js";
|
|
2
2
|
import { t as c, u as l } from "./useText-BFDCTUSo.js";
|
|
3
3
|
import { c as u, i as d, l as f, m as p, t as m } from "./value-By1-WJ8J.js";
|
|
4
4
|
import { useCallback as h, useEffect as g, useMemo as _, useRef as v, useState as y } from "react";
|