@declarion/react 0.43.0 → 0.45.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/{DraggableChildrenTable-G4Sw1XAD.js → DraggableChildrenTable-BDnJK0AU.js} +38 -38
- package/dist-lib/{Grid-CXn-IK3H.js → Grid-CcCveEE7.js} +2 -2
- package/dist-lib/{LayoutRenderer-DX8pFS5A.js → LayoutRenderer-BReuhVdX.js} +377 -377
- package/dist-lib/{MarkdownRenderer-CreI9x2m.js → MarkdownRenderer-DPKDFR60.js} +1 -1
- package/dist-lib/{RefreshControl-DFh0-gCb.js → RefreshControl-KddgOhUG.js} +166 -166
- package/dist-lib/{SmartDetailPage.impl-K6Jj1-9z.js → SmartDetailPage.impl-D_hMxiHy.js} +589 -562
- package/dist-lib/{SmartRecordListPage.impl-DQW_uVfL.js → SmartRecordListPage.impl-GIo_mPIJ.js} +182 -182
- package/dist-lib/api/agents.d.ts +3 -2
- package/dist-lib/components/pages/exportRequest.d.ts +3 -3
- package/dist-lib/components/pages/list/filter-meta.d.ts +22 -8
- package/dist-lib/hooks/useCursorEntityData.d.ts +3 -2
- package/dist-lib/index.js +1436 -1528
- package/dist-lib/lib/anchor.d.ts +37 -0
- package/dist-lib/{registry-r4hiflwC.js → registry-DJKp0yaV.js} +564 -564
- package/dist-lib/testing.js +10 -10
- package/dist-lib/types/api.d.ts +3 -10
- package/dist-lib/types/schema.d.ts +25 -13
- package/dist-lib/{useCurrentScreen-CpQjVmrT.js → useCurrentScreen-A3xZDs7U.js} +1255 -1207
- package/dist-lib/{useProperties-CULxrNT4.js → useProperties-TlltWwLv.js} +33 -33
- package/dist-lib/{value-fUHxMV4r.js → value-CHY7LgZ-.js} +1 -1
- package/package.json +1 -1
package/dist-lib/{SmartRecordListPage.impl-DQW_uVfL.js → SmartRecordListPage.impl-GIo_mPIJ.js}
RENAMED
|
@@ -1,84 +1,84 @@
|
|
|
1
1
|
import { s as e } from "./DynamicIcon-DeRpAaXm.js";
|
|
2
|
-
import { A as t, At as n,
|
|
3
|
-
import { G as v, K as y, U as
|
|
4
|
-
import { _ as
|
|
5
|
-
import { t as
|
|
6
|
-
import { useCallback as
|
|
7
|
-
import { useSearchParams as
|
|
8
|
-
import { Fragment as
|
|
2
|
+
import { A as t, At as n, Cn as r, F as i, Kn as a, Ln as o, N as s, Pn as c, Sn as l, Tn as u, X as d, Yn as f, Zn as p, bn as m, lr as ee, q as h, rr as te, rt as g, ur as _ } from "./useCurrentScreen-A3xZDs7U.js";
|
|
3
|
+
import { G as v, K as y, U as b, W as x, Y as S, _ as ne, a as C, c as w, k as T, q as E, s as D, w as re } from "./registry-DJKp0yaV.js";
|
|
4
|
+
import { _ as O, c as k, f as A, h as j, m as ie, n as M, p as N, r as P, x as F } from "./useProperties-TlltWwLv.js";
|
|
5
|
+
import { t as I } from "./LayoutRenderer-BReuhVdX.js";
|
|
6
|
+
import { useCallback as L, useEffect as R, useMemo as z, useRef as B, useState as ae } from "react";
|
|
7
|
+
import { useSearchParams as oe } from "react-router";
|
|
8
|
+
import { Fragment as se, jsx as V, jsxs as H } from "react/jsx-runtime";
|
|
9
9
|
//#region src/components/pages/SmartRecordListPage.impl.tsx
|
|
10
10
|
function U({ screenCode: t }) {
|
|
11
|
-
let [r,
|
|
12
|
-
|
|
13
|
-
let _ =
|
|
14
|
-
let e =
|
|
11
|
+
let [r, i] = oe(), { data: s } = n(), c = te(), p = s?.screens[t], m = p?.entity ? s?.entities[p.entity] : void 0, g = p?.entity;
|
|
12
|
+
j(p, m, r.toString()), O(p?.route);
|
|
13
|
+
let _ = ne(), v = r.get("selected") ?? null, y = r.get("search") ?? "", b = h(y, 300), x = r.get("sort") ?? p?.sort_default ?? "", S = z(() => {
|
|
14
|
+
let e = A(r);
|
|
15
15
|
return e.length > 0 ? e : void 0;
|
|
16
|
-
}, [r]),
|
|
17
|
-
let e =
|
|
18
|
-
return
|
|
19
|
-
}, [
|
|
20
|
-
let e =
|
|
21
|
-
return e?.list?.presentation === "table" || e?.list?.presentation === "cards" ? e.list.presentation : e?.presentation === "table" || e?.presentation === "cards" ? e.presentation :
|
|
22
|
-
}, [
|
|
23
|
-
entity:
|
|
24
|
-
screen:
|
|
25
|
-
}), [
|
|
26
|
-
entity:
|
|
27
|
-
screen:
|
|
28
|
-
presentation:
|
|
29
|
-
visibleColumns:
|
|
30
|
-
card:
|
|
31
|
-
sort:
|
|
16
|
+
}, [r]), C = z(() => p?.columns ?? m?.fields.names().filter((e) => !m.fields.get(e)?.primary && !m.fields.get(e)?.auto && m.fields.get(e)?.display?.is_listable !== !1).slice(0, 4) ?? [], [p?.columns, m]), T = z(() => {
|
|
17
|
+
let e = p?.responsive?.[c.category]?.presentation;
|
|
18
|
+
return c.category === "phone" ? "drilldown" : e === "split" || e === "drilldown" || e === "stacked" ? e : "split";
|
|
19
|
+
}, [p?.responsive, c.category]), E = z(() => {
|
|
20
|
+
let e = p?.responsive?.[c.category];
|
|
21
|
+
return e?.list?.presentation === "table" || e?.list?.presentation === "cards" ? e.list.presentation : e?.presentation === "table" || e?.presentation === "cards" ? e.presentation : c.category === "phone" ? "cards" : "table";
|
|
22
|
+
}, [p?.responsive, c.category]), re = p?.responsive?.[c.category]?.layout?.related_records, M = z(() => D({
|
|
23
|
+
entity: m,
|
|
24
|
+
screen: p
|
|
25
|
+
}), [m, p]), P = z(() => w({
|
|
26
|
+
entity: m,
|
|
27
|
+
screen: p,
|
|
28
|
+
presentation: E,
|
|
29
|
+
visibleColumns: C,
|
|
30
|
+
card: M,
|
|
31
|
+
sort: x
|
|
32
32
|
}), [
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
]),
|
|
33
|
+
m,
|
|
34
|
+
p,
|
|
35
|
+
E,
|
|
36
|
+
C,
|
|
37
|
+
M,
|
|
38
|
+
x
|
|
39
|
+
]), I = m?.list_pagination === "cursor", { data: U, isLoading: W } = d(g, {
|
|
40
40
|
page: 1,
|
|
41
41
|
per_page: 200,
|
|
42
|
-
sort:
|
|
43
|
-
search:
|
|
44
|
-
filters:
|
|
45
|
-
select:
|
|
46
|
-
expand:
|
|
42
|
+
sort: x || void 0,
|
|
43
|
+
search: b || void 0,
|
|
44
|
+
filters: S,
|
|
45
|
+
select: P.selectFields,
|
|
46
|
+
expand: P.expandFields,
|
|
47
47
|
preview: !0,
|
|
48
|
-
screen:
|
|
49
|
-
}, !
|
|
50
|
-
sort:
|
|
51
|
-
search:
|
|
52
|
-
filters:
|
|
53
|
-
select:
|
|
54
|
-
expand:
|
|
48
|
+
screen: p?.fixed_filters ? t : void 0
|
|
49
|
+
}, !I), G = F(g, {
|
|
50
|
+
sort: x || void 0,
|
|
51
|
+
search: b || void 0,
|
|
52
|
+
filters: S,
|
|
53
|
+
select: P.selectFields,
|
|
54
|
+
expand: P.expandFields,
|
|
55
55
|
preview: !0,
|
|
56
|
-
screen:
|
|
56
|
+
screen: p?.fixed_filters ? t : void 0,
|
|
57
57
|
limit: 200
|
|
58
|
-
},
|
|
59
|
-
|
|
58
|
+
}, I), K = I ? G.rows : U?.data ?? [], J = I ? G.refs : U?.$refs, le = I ? G.isLoading : W, ue = z(() => m?.fields.names().find((e) => m.fields.get(e)?.primary) ?? "id", [m]), de = L((e, t) => {
|
|
59
|
+
i((t) => {
|
|
60
60
|
let n = new URLSearchParams(t);
|
|
61
61
|
return e ? n.set("selected", e) : n.delete("selected"), n;
|
|
62
62
|
}, { replace: t?.replace ?? !0 });
|
|
63
|
-
}, [
|
|
64
|
-
|
|
63
|
+
}, [i]), fe = L((e) => {
|
|
64
|
+
i((t) => {
|
|
65
65
|
let n = new URLSearchParams(t);
|
|
66
66
|
return e ? n.set("search", e) : n.delete("search"), n;
|
|
67
67
|
}, { replace: !0 });
|
|
68
|
-
}, [
|
|
69
|
-
|
|
70
|
-
let r = new URLSearchParams(n), i =
|
|
71
|
-
return a = t && t !== "__all__" ? [...
|
|
68
|
+
}, [i]), pe = L((e, t) => {
|
|
69
|
+
i((n) => {
|
|
70
|
+
let r = new URLSearchParams(n), i = A(n), a;
|
|
71
|
+
return a = t && t !== "__all__" ? [...N(i, e), k(e, t)] : N(i, e), ie(a, r), r;
|
|
72
72
|
}, { replace: !0 });
|
|
73
|
-
}, [
|
|
74
|
-
|
|
73
|
+
}, [i]), Y = (p?.list_resizable ?? !1) && T === "split" && c.category !== "phone" && !c.touch, me = B(null), [X, Z] = ae(null), Q = B(!1), $ = p?.list_width;
|
|
74
|
+
R(() => {
|
|
75
75
|
!Y || !$?.endsWith("%") || Z(null);
|
|
76
76
|
}, [
|
|
77
77
|
Y,
|
|
78
78
|
$,
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
]),
|
|
79
|
+
c.width,
|
|
80
|
+
c.height
|
|
81
|
+
]), R(() => {
|
|
82
82
|
if (!Y || X !== null) return;
|
|
83
83
|
let e = me.current;
|
|
84
84
|
if (e) if ($ && $.endsWith("%")) {
|
|
@@ -89,13 +89,13 @@ function U({ screenCode: t }) {
|
|
|
89
89
|
Y,
|
|
90
90
|
$,
|
|
91
91
|
X,
|
|
92
|
-
|
|
92
|
+
m
|
|
93
93
|
]);
|
|
94
|
-
let he =
|
|
95
|
-
|
|
94
|
+
let he = B(null);
|
|
95
|
+
R(() => () => {
|
|
96
96
|
he.current?.();
|
|
97
97
|
}, []);
|
|
98
|
-
let ge =
|
|
98
|
+
let ge = L((e) => {
|
|
99
99
|
e.preventDefault(), Q.current = !0;
|
|
100
100
|
let t = e.clientX, n = X ?? 320, r = (e) => {
|
|
101
101
|
if (!Q.current) return;
|
|
@@ -106,14 +106,14 @@ function U({ screenCode: t }) {
|
|
|
106
106
|
};
|
|
107
107
|
document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", document.addEventListener("mousemove", r), document.addEventListener("mouseup", i), he.current = i;
|
|
108
108
|
}, [X]);
|
|
109
|
-
if (!
|
|
110
|
-
let _e =
|
|
109
|
+
if (!s || !p || !m) return null;
|
|
110
|
+
let _e = S?.length ?? 0, ve = T === "split" || T === "stacked" || !v, ye = T === "split" || T === "stacked" || !!v, be = T !== "split" && v ? () => de(null, { replace: !0 }) : void 0, xe = T === "split" ? Y && X !== null ? X : p.list_width ?? "320px" : "100%";
|
|
111
111
|
return /* @__PURE__ */ H("div", {
|
|
112
112
|
ref: me,
|
|
113
|
-
"data-record-list-presentation":
|
|
113
|
+
"data-record-list-presentation": T,
|
|
114
114
|
style: {
|
|
115
115
|
display: "flex",
|
|
116
|
-
flexDirection:
|
|
116
|
+
flexDirection: T === "stacked" ? "column" : "row",
|
|
117
117
|
height: "100%",
|
|
118
118
|
minWidth: 0,
|
|
119
119
|
overflow: "hidden"
|
|
@@ -122,15 +122,15 @@ function U({ screenCode: t }) {
|
|
|
122
122
|
ve && /* @__PURE__ */ H("div", {
|
|
123
123
|
"data-testid": "record-list-panel",
|
|
124
124
|
style: {
|
|
125
|
-
flex:
|
|
125
|
+
flex: T === "split" ? "none" : "1 1 auto",
|
|
126
126
|
display: "flex",
|
|
127
127
|
flexDirection: "column",
|
|
128
128
|
overflow: "hidden",
|
|
129
|
-
borderRight:
|
|
130
|
-
borderBottom:
|
|
129
|
+
borderRight: T === "split" && !Y ? "1px solid var(--divider)" : "none",
|
|
130
|
+
borderBottom: T === "stacked" ? "1px solid var(--divider)" : "none",
|
|
131
131
|
width: xe,
|
|
132
132
|
minWidth: 0,
|
|
133
|
-
height:
|
|
133
|
+
height: T === "stacked" ? "50%" : "100%"
|
|
134
134
|
},
|
|
135
135
|
children: [/* @__PURE__ */ H("div", {
|
|
136
136
|
style: {
|
|
@@ -157,35 +157,35 @@ function U({ screenCode: t }) {
|
|
|
157
157
|
fontWeight: 600,
|
|
158
158
|
color: "var(--text)"
|
|
159
159
|
},
|
|
160
|
-
children:
|
|
160
|
+
children: u(p.display?.name) || u(m.display.name_plural)
|
|
161
161
|
})]
|
|
162
162
|
}),
|
|
163
|
-
/* @__PURE__ */ V(
|
|
163
|
+
/* @__PURE__ */ V(f, {
|
|
164
164
|
value: y,
|
|
165
165
|
onChange: fe,
|
|
166
|
-
placeholder: `Search ${
|
|
166
|
+
placeholder: `Search ${u(m.display.name_plural)}…`,
|
|
167
167
|
prefix: /* @__PURE__ */ V(e.search, { size: 13 })
|
|
168
168
|
}),
|
|
169
|
-
|
|
169
|
+
p.filters && p.filters.length > 0 && /* @__PURE__ */ V("div", {
|
|
170
170
|
style: {
|
|
171
171
|
display: "flex",
|
|
172
172
|
flexWrap: "wrap",
|
|
173
173
|
gap: 6
|
|
174
174
|
},
|
|
175
|
-
children:
|
|
176
|
-
let t =
|
|
175
|
+
children: p.filters.map((e) => {
|
|
176
|
+
let t = m.fields.get(e);
|
|
177
177
|
if (!t?.values) return null;
|
|
178
|
-
let n =
|
|
178
|
+
let n = S?.find((t) => t.field === e && t.op === "eq")?.value ?? "__all__", r = l(t, e, s.entities);
|
|
179
179
|
return /* @__PURE__ */ V("div", {
|
|
180
180
|
style: { minWidth: 120 },
|
|
181
|
-
children: /* @__PURE__ */ V(
|
|
181
|
+
children: /* @__PURE__ */ V(a, {
|
|
182
182
|
value: n,
|
|
183
183
|
options: [{
|
|
184
184
|
value: "__all__",
|
|
185
185
|
label: `All ${r}`
|
|
186
186
|
}, ...t.values.map((e) => ({
|
|
187
187
|
value: e.code,
|
|
188
|
-
label:
|
|
188
|
+
label: u(e.name) || e.code
|
|
189
189
|
}))],
|
|
190
190
|
onChange: (t) => pe(e, t),
|
|
191
191
|
placeholder: r
|
|
@@ -201,8 +201,8 @@ function U({ screenCode: t }) {
|
|
|
201
201
|
fontSize: 11,
|
|
202
202
|
color: "var(--text-3)"
|
|
203
203
|
},
|
|
204
|
-
children: [/* @__PURE__ */ V("span", { children: le ? "Loading…" : `${K.length} ${
|
|
205
|
-
onClick: () =>
|
|
204
|
+
children: [/* @__PURE__ */ V("span", { children: le ? "Loading…" : `${K.length} ${u(m.display.name_plural)}` }), _e > 0 && /* @__PURE__ */ V("button", {
|
|
205
|
+
onClick: () => i((e) => {
|
|
206
206
|
let t = new URLSearchParams(e);
|
|
207
207
|
return t.delete("filters"), t;
|
|
208
208
|
}, { replace: !0 }),
|
|
@@ -223,10 +223,10 @@ function U({ screenCode: t }) {
|
|
|
223
223
|
style: {
|
|
224
224
|
flex: 1,
|
|
225
225
|
overflowY: "auto",
|
|
226
|
-
padding:
|
|
227
|
-
display:
|
|
226
|
+
padding: E === "cards" ? 10 : 0,
|
|
227
|
+
display: E === "cards" ? "flex" : "block",
|
|
228
228
|
flexDirection: "column",
|
|
229
|
-
gap:
|
|
229
|
+
gap: E === "cards" ? 10 : void 0
|
|
230
230
|
},
|
|
231
231
|
children: le ? /* @__PURE__ */ V("div", {
|
|
232
232
|
style: {
|
|
@@ -248,19 +248,19 @@ function U({ screenCode: t }) {
|
|
|
248
248
|
color: "var(--text-3)"
|
|
249
249
|
},
|
|
250
250
|
children: "No records found"
|
|
251
|
-
}) : /* @__PURE__ */ H(
|
|
252
|
-
let t =
|
|
251
|
+
}) : /* @__PURE__ */ H(se, { children: [K.map((e) => {
|
|
252
|
+
let t = o(e[ue]);
|
|
253
253
|
return /* @__PURE__ */ V(ce, {
|
|
254
254
|
record: e,
|
|
255
|
-
entity:
|
|
256
|
-
columns:
|
|
257
|
-
card:
|
|
258
|
-
presentation:
|
|
255
|
+
entity: m,
|
|
256
|
+
columns: C,
|
|
257
|
+
card: M,
|
|
258
|
+
presentation: E,
|
|
259
259
|
refs: J,
|
|
260
260
|
isSelected: t === v,
|
|
261
|
-
onClick: () => de(t, { replace:
|
|
261
|
+
onClick: () => de(t, { replace: T === "split" })
|
|
262
262
|
}, t);
|
|
263
|
-
}),
|
|
263
|
+
}), I && G.hasMore && /* @__PURE__ */ V("button", {
|
|
264
264
|
type: "button",
|
|
265
265
|
"data-testid": "record-list-load-more",
|
|
266
266
|
onClick: () => void G.fetchNextPage(),
|
|
@@ -298,16 +298,16 @@ function U({ screenCode: t }) {
|
|
|
298
298
|
flex: 1,
|
|
299
299
|
minWidth: 0,
|
|
300
300
|
overflow: "hidden",
|
|
301
|
-
height:
|
|
301
|
+
height: T === "stacked" ? "50%" : "100%"
|
|
302
302
|
},
|
|
303
303
|
children: v ? /* @__PURE__ */ V(q, {
|
|
304
|
-
entityCode:
|
|
304
|
+
entityCode: g,
|
|
305
305
|
recordId: v,
|
|
306
|
-
items:
|
|
307
|
-
schema:
|
|
308
|
-
entity:
|
|
306
|
+
items: p.items,
|
|
307
|
+
schema: s,
|
|
308
|
+
entity: m,
|
|
309
309
|
onBackToList: be,
|
|
310
|
-
relatedRecordsPresentation:
|
|
310
|
+
relatedRecordsPresentation: re
|
|
311
311
|
}, v) : /* @__PURE__ */ V("div", {
|
|
312
312
|
style: {
|
|
313
313
|
display: "flex",
|
|
@@ -320,7 +320,7 @@ function U({ screenCode: t }) {
|
|
|
320
320
|
style: { fontSize: 12.5 },
|
|
321
321
|
children: [
|
|
322
322
|
"Select a ",
|
|
323
|
-
|
|
323
|
+
u(m.display.name),
|
|
324
324
|
" to view details"
|
|
325
325
|
]
|
|
326
326
|
})
|
|
@@ -365,7 +365,7 @@ function ce({ record: e, entity: n, columns: r, card: i, presentation: a, refs:
|
|
|
365
365
|
color: "var(--text-3)",
|
|
366
366
|
overflowWrap: "anywhere"
|
|
367
367
|
},
|
|
368
|
-
children:
|
|
368
|
+
children: E({
|
|
369
369
|
entity: n,
|
|
370
370
|
fieldName: i.subtitleField,
|
|
371
371
|
record: e,
|
|
@@ -390,7 +390,7 @@ function ce({ record: e, entity: n, columns: r, card: i, presentation: a, refs:
|
|
|
390
390
|
maxWidth: "100%",
|
|
391
391
|
overflowWrap: "anywhere"
|
|
392
392
|
},
|
|
393
|
-
children:
|
|
393
|
+
children: E({
|
|
394
394
|
entity: n,
|
|
395
395
|
fieldName: t,
|
|
396
396
|
record: e,
|
|
@@ -428,7 +428,7 @@ function ce({ record: e, entity: n, columns: r, card: i, presentation: a, refs:
|
|
|
428
428
|
minWidth: 0,
|
|
429
429
|
overflowWrap: "anywhere"
|
|
430
430
|
},
|
|
431
|
-
children:
|
|
431
|
+
children: E({
|
|
432
432
|
entity: n,
|
|
433
433
|
fieldName: t,
|
|
434
434
|
record: e,
|
|
@@ -441,7 +441,7 @@ function ce({ record: e, entity: n, columns: r, card: i, presentation: a, refs:
|
|
|
441
441
|
]
|
|
442
442
|
});
|
|
443
443
|
}
|
|
444
|
-
let u = r[0], d = r[1],
|
|
444
|
+
let u = r[0], d = r[1], f = r.slice(2, 4);
|
|
445
445
|
return /* @__PURE__ */ H("button", {
|
|
446
446
|
onClick: c,
|
|
447
447
|
style: {
|
|
@@ -474,7 +474,7 @@ function ce({ record: e, entity: n, columns: r, card: i, presentation: a, refs:
|
|
|
474
474
|
whiteSpace: "nowrap",
|
|
475
475
|
color: "var(--text)"
|
|
476
476
|
},
|
|
477
|
-
children:
|
|
477
|
+
children: E({
|
|
478
478
|
entity: n,
|
|
479
479
|
fieldName: u,
|
|
480
480
|
record: e,
|
|
@@ -497,7 +497,7 @@ function ce({ record: e, entity: n, columns: r, card: i, presentation: a, refs:
|
|
|
497
497
|
textOverflow: "ellipsis",
|
|
498
498
|
whiteSpace: "nowrap"
|
|
499
499
|
},
|
|
500
|
-
children:
|
|
500
|
+
children: E({
|
|
501
501
|
entity: n,
|
|
502
502
|
fieldName: d,
|
|
503
503
|
record: e,
|
|
@@ -512,9 +512,9 @@ function ce({ record: e, entity: n, columns: r, card: i, presentation: a, refs:
|
|
|
512
512
|
gap: 4,
|
|
513
513
|
flexShrink: 0
|
|
514
514
|
},
|
|
515
|
-
children:
|
|
515
|
+
children: f.map((t) => y(n, e, t) == null ? null : /* @__PURE__ */ V("div", {
|
|
516
516
|
style: { fontSize: 11 },
|
|
517
|
-
children:
|
|
517
|
+
children: E({
|
|
518
518
|
entity: n,
|
|
519
519
|
fieldName: t,
|
|
520
520
|
record: e,
|
|
@@ -531,8 +531,8 @@ function W(e, t, n) {
|
|
|
531
531
|
let r = y(e, t, n);
|
|
532
532
|
return !(r == null || r === "" || Array.isArray(r) && r.length === 0);
|
|
533
533
|
}
|
|
534
|
-
function G({ entity: e, record: n, field:
|
|
535
|
-
let
|
|
534
|
+
function G({ entity: e, record: n, field: i, refs: a }) {
|
|
535
|
+
let o = t(), s = r(n, e);
|
|
536
536
|
return /* @__PURE__ */ V("div", {
|
|
537
537
|
style: {
|
|
538
538
|
fontSize: 13.5,
|
|
@@ -540,28 +540,28 @@ function G({ entity: e, record: n, field: r, refs: i }) {
|
|
|
540
540
|
color: "var(--text)",
|
|
541
541
|
overflowWrap: "anywhere"
|
|
542
542
|
},
|
|
543
|
-
children: (
|
|
543
|
+
children: (i ? E({
|
|
544
544
|
entity: e,
|
|
545
|
-
fieldName:
|
|
545
|
+
fieldName: i,
|
|
546
546
|
record: n,
|
|
547
547
|
mode: "display",
|
|
548
|
-
refs:
|
|
549
|
-
locale:
|
|
550
|
-
}) :
|
|
548
|
+
refs: a,
|
|
549
|
+
locale: o
|
|
550
|
+
}) : s) || u(e.display.name)
|
|
551
551
|
});
|
|
552
552
|
}
|
|
553
553
|
function K({ entity: e, record: t, fieldName: n, refs: r, locale: i }) {
|
|
554
554
|
let a = y(e, t, n);
|
|
555
555
|
if (a == null || a === "") return null;
|
|
556
556
|
let o = e.fields.get(n);
|
|
557
|
-
return o ? /* @__PURE__ */ H(
|
|
557
|
+
return o ? /* @__PURE__ */ H(se, { children: [/* @__PURE__ */ V("dt", {
|
|
558
558
|
style: {
|
|
559
559
|
color: "var(--text-3)",
|
|
560
560
|
fontSize: 11.5,
|
|
561
561
|
minWidth: 0,
|
|
562
562
|
overflowWrap: "anywhere"
|
|
563
563
|
},
|
|
564
|
-
children:
|
|
564
|
+
children: l(o, n)
|
|
565
565
|
}), /* @__PURE__ */ V("dd", {
|
|
566
566
|
style: {
|
|
567
567
|
margin: 0,
|
|
@@ -570,7 +570,7 @@ function K({ entity: e, record: t, fieldName: n, refs: r, locale: i }) {
|
|
|
570
570
|
minWidth: 0,
|
|
571
571
|
overflowWrap: "anywhere"
|
|
572
572
|
},
|
|
573
|
-
children:
|
|
573
|
+
children: E({
|
|
574
574
|
entity: e,
|
|
575
575
|
fieldName: n,
|
|
576
576
|
record: t,
|
|
@@ -591,89 +591,89 @@ function q({ entityCode: e, recordId: t, items: n, schema: r, entity: i, onBackT
|
|
|
591
591
|
relatedRecordsPresentation: o
|
|
592
592
|
}) });
|
|
593
593
|
}
|
|
594
|
-
function J({ entityCode: t, recordId: n, items:
|
|
595
|
-
let
|
|
594
|
+
function J({ entityCode: t, recordId: n, items: a, schema: s, entity: l, onBackToList: d, relatedRecordsPresentation: f }) {
|
|
595
|
+
let h = m(l, "update"), { data: te, isLoading: ne } = C(t, z(() => n ? c(l, n) : void 0, [n, l])), w = T(t), E = i(), [D, O] = ae(!1), [k, A] = ae({}), j = te?.data, ie = j?.$statuses, N = j?.$properties, F = P(t, n), R = M(t, n), B = z(() => {
|
|
596
596
|
let e = /* @__PURE__ */ new Set();
|
|
597
|
-
for (let [t, n] of
|
|
598
|
-
for (let [t] of
|
|
597
|
+
for (let [t, n] of l.fields) !n.auto && !n.primary && e.add(t);
|
|
598
|
+
for (let [t] of l.files ?? []) e.add(t);
|
|
599
599
|
return e;
|
|
600
|
-
}, [
|
|
601
|
-
if (
|
|
600
|
+
}, [l]), oe = L(() => {
|
|
601
|
+
if (j) {
|
|
602
602
|
let e = {};
|
|
603
|
-
|
|
604
|
-
let n = y(
|
|
605
|
-
e[t] = v(
|
|
606
|
-
}),
|
|
603
|
+
B.forEach((t) => {
|
|
604
|
+
let n = y(l, j, t);
|
|
605
|
+
e[t] = v(l, t) ? n ?? null : n ?? "";
|
|
606
|
+
}), A(e);
|
|
607
607
|
}
|
|
608
|
-
|
|
608
|
+
O(!0);
|
|
609
609
|
}, [
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
]), U =
|
|
614
|
-
await
|
|
615
|
-
}, [
|
|
616
|
-
let e = {}, t =
|
|
617
|
-
entity:
|
|
618
|
-
formData:
|
|
619
|
-
record:
|
|
610
|
+
j,
|
|
611
|
+
B,
|
|
612
|
+
l
|
|
613
|
+
]), U = L(async () => {
|
|
614
|
+
await E.flushAllDrafts(), O(!1), A({});
|
|
615
|
+
}, [E]), ce = L(() => {
|
|
616
|
+
let e = {}, t = b({
|
|
617
|
+
entity: l,
|
|
618
|
+
formData: k,
|
|
619
|
+
record: j,
|
|
620
620
|
isNew: !1
|
|
621
|
-
}), r =
|
|
622
|
-
for (let [t, n] of Object.entries(
|
|
621
|
+
}), r = x(t);
|
|
622
|
+
for (let [t, n] of Object.entries(k)) l.files?.has(t) || (e[t] = S(l, t, n));
|
|
623
623
|
if (Object.keys(t).length > 0 && (e.$files = t), Object.keys(e).length === 0) {
|
|
624
|
-
|
|
624
|
+
O(!1), A({});
|
|
625
625
|
return;
|
|
626
626
|
}
|
|
627
|
-
|
|
627
|
+
w.mutate({
|
|
628
628
|
pkValues: n,
|
|
629
629
|
data: e
|
|
630
630
|
}, {
|
|
631
631
|
onSuccess: () => {
|
|
632
|
-
r.forEach((e) =>
|
|
632
|
+
r.forEach((e) => E.markCommitted(e)), O(!1), A({}), g.success("Saved");
|
|
633
633
|
},
|
|
634
|
-
onError: () =>
|
|
634
|
+
onError: () => g.error("Failed to save")
|
|
635
635
|
});
|
|
636
636
|
}, [
|
|
637
|
-
|
|
638
|
-
|
|
637
|
+
E,
|
|
638
|
+
w,
|
|
639
639
|
n,
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
]), W =
|
|
644
|
-
|
|
640
|
+
l,
|
|
641
|
+
k,
|
|
642
|
+
j
|
|
643
|
+
]), W = L((e, t) => {
|
|
644
|
+
A((n) => ({
|
|
645
645
|
...n,
|
|
646
646
|
[e]: t
|
|
647
647
|
}));
|
|
648
648
|
}, []);
|
|
649
|
-
if (
|
|
650
|
-
if (!
|
|
651
|
-
let G =
|
|
652
|
-
schema:
|
|
653
|
-
entity:
|
|
649
|
+
if (ne) return /* @__PURE__ */ V(re, {});
|
|
650
|
+
if (!j) return null;
|
|
651
|
+
let G = r(j, l), K = l.display?.display_field, q = G ? void 0 : K ? j[K] : j[l.fields.names()[0]], J = G || (q != null && typeof q != "object" ? o(q) : u(l.display.name)), le = j?.$refs, ue = {
|
|
652
|
+
schema: s,
|
|
653
|
+
entity: l,
|
|
654
654
|
entityCode: t,
|
|
655
655
|
recordId: n,
|
|
656
|
-
record:
|
|
657
|
-
...
|
|
658
|
-
...
|
|
659
|
-
} :
|
|
656
|
+
record: D ? {
|
|
657
|
+
...j,
|
|
658
|
+
...k
|
|
659
|
+
} : j,
|
|
660
660
|
isNew: !1,
|
|
661
|
-
mode:
|
|
662
|
-
onFieldChange:
|
|
661
|
+
mode: D ? "edit" : "display",
|
|
662
|
+
onFieldChange: D ? W : void 0,
|
|
663
663
|
refs: le,
|
|
664
|
-
objectProperties:
|
|
665
|
-
onSetProperty:
|
|
664
|
+
objectProperties: N ?? void 0,
|
|
665
|
+
onSetProperty: h ? (e, t) => R.mutate({
|
|
666
666
|
propertyCode: e,
|
|
667
667
|
value: t
|
|
668
668
|
}) : void 0,
|
|
669
|
-
isPropertyPending:
|
|
670
|
-
objectStatuses:
|
|
671
|
-
onSetStatus:
|
|
669
|
+
isPropertyPending: R.isPending,
|
|
670
|
+
objectStatuses: ie ?? void 0,
|
|
671
|
+
onSetStatus: h ? (e, t) => F.mutate({
|
|
672
672
|
groupCode: e,
|
|
673
673
|
statusCode: t
|
|
674
674
|
}) : void 0,
|
|
675
|
-
isStatusPending:
|
|
676
|
-
relatedRecordsPresentation:
|
|
675
|
+
isStatusPending: F.isPending,
|
|
676
|
+
relatedRecordsPresentation: f
|
|
677
677
|
};
|
|
678
678
|
return /* @__PURE__ */ H("div", {
|
|
679
679
|
style: {
|
|
@@ -710,26 +710,26 @@ function J({ entityCode: t, recordId: n, items: i, schema: o, entity: s, onBackT
|
|
|
710
710
|
alignItems: "center",
|
|
711
711
|
gap: 6
|
|
712
712
|
},
|
|
713
|
-
children: [
|
|
713
|
+
children: [d && /* @__PURE__ */ V(ee, {
|
|
714
714
|
icon: /* @__PURE__ */ V(e.back, { size: 14 }),
|
|
715
715
|
title: "Back to list",
|
|
716
|
-
onClick:
|
|
717
|
-
}),
|
|
716
|
+
onClick: d
|
|
717
|
+
}), h && (D ? /* @__PURE__ */ H(se, { children: [/* @__PURE__ */ V(_, {
|
|
718
718
|
size: "xs",
|
|
719
719
|
icon: /* @__PURE__ */ V(e.x, { size: 12 }),
|
|
720
720
|
onClick: U,
|
|
721
721
|
children: "Cancel"
|
|
722
|
-
}), /* @__PURE__ */ V(
|
|
722
|
+
}), /* @__PURE__ */ V(_, {
|
|
723
723
|
kind: "primary",
|
|
724
724
|
size: "xs",
|
|
725
|
-
icon:
|
|
725
|
+
icon: w.isPending ? /* @__PURE__ */ V(p, { size: 12 }) : /* @__PURE__ */ V(e.save, { size: 12 }),
|
|
726
726
|
onClick: ce,
|
|
727
|
-
disabled:
|
|
728
|
-
children:
|
|
729
|
-
})] }) : /* @__PURE__ */ V(
|
|
727
|
+
disabled: w.isPending,
|
|
728
|
+
children: w.isPending ? "Saving…" : "Save"
|
|
729
|
+
})] }) : /* @__PURE__ */ V(_, {
|
|
730
730
|
size: "xs",
|
|
731
731
|
icon: /* @__PURE__ */ V(e.edit, { size: 12 }),
|
|
732
|
-
onClick:
|
|
732
|
+
onClick: oe,
|
|
733
733
|
children: "Edit"
|
|
734
734
|
}))]
|
|
735
735
|
})]
|
|
@@ -742,8 +742,8 @@ function J({ entityCode: t, recordId: n, items: i, schema: o, entity: s, onBackT
|
|
|
742
742
|
flexDirection: "column",
|
|
743
743
|
gap: 12
|
|
744
744
|
},
|
|
745
|
-
children:
|
|
746
|
-
nodes:
|
|
745
|
+
children: a && a.length > 0 ? /* @__PURE__ */ V(I, {
|
|
746
|
+
nodes: a,
|
|
747
747
|
ctx: ue
|
|
748
748
|
}) : /* @__PURE__ */ H("p", {
|
|
749
749
|
style: {
|
package/dist-lib/api/agents.d.ts
CHANGED
|
@@ -81,7 +81,8 @@ export interface AgentConversation {
|
|
|
81
81
|
id: string;
|
|
82
82
|
tenant_id: string;
|
|
83
83
|
created_by?: string;
|
|
84
|
-
|
|
84
|
+
agent_id?: string;
|
|
85
|
+
agent?: string;
|
|
85
86
|
agent_version?: string;
|
|
86
87
|
title?: string;
|
|
87
88
|
context?: Record<string, unknown>;
|
|
@@ -97,7 +98,7 @@ export interface AgentConversation {
|
|
|
97
98
|
active_instance?: string;
|
|
98
99
|
}
|
|
99
100
|
export declare function createConversation(input: {
|
|
100
|
-
|
|
101
|
+
agent_id?: string;
|
|
101
102
|
context?: Record<string, unknown>;
|
|
102
103
|
}): Promise<AgentConversation>;
|
|
103
104
|
export declare function sendMessage(text: string, conversationId: string, _seq?: number): Promise<AgentMessage>;
|