@declarion/react 0.104.0 → 0.109.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-lib/api/agents.js +8 -7
- package/dist-lib/api/client.js +48 -49
- package/dist-lib/components/agents/AgentChatPanel.impl.js +362 -301
- package/dist-lib/components/agents/ChatAttachments.js +144 -0
- package/dist-lib/components/agents/transcript-runs.js +1 -1
- package/dist-lib/components/chrome/AssociationTabs.js +89 -75
- package/dist-lib/components/detail-layout/AssociatedBlock.js +243 -235
- package/dist-lib/components/detail-layout/ChildrenCards.js +57 -55
- package/dist-lib/components/detail-layout/ChildrenList.js +45 -43
- package/dist-lib/components/detail-layout/ChildrenTable.js +93 -91
- package/dist-lib/components/detail-layout/ChildrenTimeline.js +160 -155
- package/dist-lib/components/detail-layout/widgets/EntityScorecardWidget.js +127 -121
- package/dist-lib/components/fields/RefCombobox.js +53 -48
- package/dist-lib/components/fields/index.js +1 -0
- package/dist-lib/components/file-widgets/useFileSelection.js +152 -0
- package/dist-lib/components/pages/SmartDetailPage.impl.js +506 -482
- package/dist-lib/components/pages/SmartRecordListPage.impl.js +335 -300
- package/dist-lib/components/pages/tenant-params/TenantParamsPage.impl.js +112 -109
- package/dist-lib/components/params/ParamsBlock.js +18 -15
- package/dist-lib/components/params/param-editors.js +60 -54
- package/dist-lib/components/primitives/RetryButton.js +14 -0
- package/dist-lib/components/primitives/StatTile.js +42 -34
- package/dist-lib/hooks/useAgentConversation.js +18 -13
- package/dist-lib/hooks/useParams.js +54 -52
- package/dist-lib/hooks/useSchema.js +5 -2
- package/dist-lib/hooks/useTimelineData.js +26 -24
- package/dist-lib/index.d.ts +89 -5
- package/dist-lib/index.js +95 -93
- package/dist-lib/lib/read-display-state.js +19 -0
- package/dist-lib/stores/auth.js +1 -0
- package/dist-lib/testing.d.ts +1 -1
- package/dist-lib/types/fieldType.js +1 -1
- package/dist-lib/{useResponsiveMode-ECv1AEhv.d.ts → useResponsiveMode-DODbtSrY.d.ts} +3 -0
- package/package.json +1 -1
|
@@ -10,73 +10,74 @@ import { IconBtn as d } from "../primitives/IconBtn.js";
|
|
|
10
10
|
import { Pill as f } from "../primitives/Pill.js";
|
|
11
11
|
import { HoverCard as p } from "../primitives/HoverCard.js";
|
|
12
12
|
import { useText as m } from "../../hooks/useText.js";
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
13
|
+
import { RetryButton as h } from "../primitives/RetryButton.js";
|
|
14
|
+
import { Spinner as g } from "../primitives/Spinner.js";
|
|
15
|
+
import { toast as _ } from "../../lib/toast.js";
|
|
16
|
+
import { ENTITY_CHILDREN_KEY as v } from "../../hooks/useChildrenData.js";
|
|
17
|
+
import { renderField as y } from "../fields/index.js";
|
|
18
|
+
import { useTimelineData as b } from "../../hooks/useTimelineData.js";
|
|
19
|
+
import { TimelineComposer as x } from "./TimelineComposer.js";
|
|
20
|
+
import { useCallback as S, useEffect as C, useLayoutEffect as w, useMemo as ee, useRef as T, useState as te } from "react";
|
|
21
|
+
import { useMutation as E, useQueryClient as D } from "@tanstack/react-query";
|
|
22
|
+
import { Fragment as O, jsx as k, jsxs as A } from "react/jsx-runtime";
|
|
22
23
|
//#region src/components/detail-layout/ChildrenTimeline.tsx
|
|
23
|
-
var
|
|
24
|
-
function
|
|
25
|
-
if (e.length >
|
|
24
|
+
var j = 80, M = 200, N = 6, P = 2e4, F = 280;
|
|
25
|
+
function I(e) {
|
|
26
|
+
if (e.length > F) return !0;
|
|
26
27
|
let t = 0;
|
|
27
|
-
for (let n of e) if (n === "\n" && ++t >=
|
|
28
|
+
for (let n of e) if (n === "\n" && ++t >= N) return !0;
|
|
28
29
|
return !1;
|
|
29
30
|
}
|
|
30
|
-
function
|
|
31
|
-
if (
|
|
31
|
+
function L(t, r) {
|
|
32
|
+
if (R(r)) {
|
|
32
33
|
let t = r.id;
|
|
33
34
|
return t == null ? "" : e(t);
|
|
34
35
|
}
|
|
35
36
|
return o(n(t, r));
|
|
36
37
|
}
|
|
37
|
-
function
|
|
38
|
+
function R(e) {
|
|
38
39
|
return e.__optimistic === !0;
|
|
39
40
|
}
|
|
40
|
-
function
|
|
41
|
-
let i = m(), a = m("errors"), o = r.entities[e.entity], { rows: s, refs: c, fetchNextPage: l, hasOlder: d, isFetchingOlder: f, isLoading: p, isError:
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}, [n]),
|
|
45
|
-
f &&
|
|
46
|
-
scrollHeight:
|
|
47
|
-
scrollTop:
|
|
41
|
+
function z({ config: e, parentEntity: t, parentId: n, schema: r }) {
|
|
42
|
+
let i = m(), a = m("errors"), o = r.entities[e.entity], { rows: s, refs: c, fetchNextPage: l, hasOlder: d, isFetchingOlder: f, isLoading: p, isError: _, retry: v } = b(t, n, e.entity, e.foreign_key, e.timeline?.time_field, e.limit), y = e.timeline, E = y?.scroll ?? !1, D = (e.sort ?? "").endsWith(":asc"), N = ee(() => D ? [...s].reverse() : s, [s, D]), P = y?.auto_scroll ?? "none", F = T(null), I = T(null), z = T(!1), V = T(0), G = T(null), K = T(null), q = T(!0), J = T(null);
|
|
43
|
+
C(() => {
|
|
44
|
+
z.current = !1, V.current = 0, G.current = null, K.current = null, q.current = !0, J.current = null;
|
|
45
|
+
}, [n]), w(() => {
|
|
46
|
+
f && F.current && (J.current = {
|
|
47
|
+
scrollHeight: F.current.scrollHeight,
|
|
48
|
+
scrollTop: F.current.scrollTop
|
|
48
49
|
});
|
|
49
|
-
}, [f]),
|
|
50
|
-
let e =
|
|
51
|
-
if (!e ||
|
|
52
|
-
|
|
50
|
+
}, [f]), w(() => {
|
|
51
|
+
let e = F.current;
|
|
52
|
+
if (!e || N.length === 0 || !o) {
|
|
53
|
+
V.current = N.length;
|
|
53
54
|
return;
|
|
54
55
|
}
|
|
55
|
-
let t =
|
|
56
|
-
if (r) D &&
|
|
57
|
-
else if (a &&
|
|
58
|
-
let t =
|
|
59
|
-
D && (e.scrollTop = t.scrollTop + (e.scrollHeight - t.scrollHeight)),
|
|
60
|
-
} else s && D &&
|
|
61
|
-
|
|
56
|
+
let t = L(o, N[0]), n = L(o, N[N.length - 1]), r = !z.current, i = N.length > V.current && V.current > 0, a = i && (D && t !== G.current && n === K.current || !D && n !== K.current && t === G.current), s = i && !a;
|
|
57
|
+
if (r) D && P === "bottom" && (e.scrollTop = e.scrollHeight), z.current = !0;
|
|
58
|
+
else if (a && J.current) {
|
|
59
|
+
let t = J.current;
|
|
60
|
+
D && (e.scrollTop = t.scrollTop + (e.scrollHeight - t.scrollHeight)), J.current = null;
|
|
61
|
+
} else s && D && q.current && (e.scrollTop = e.scrollHeight);
|
|
62
|
+
V.current = N.length, G.current = t, K.current = n;
|
|
62
63
|
}, [
|
|
63
|
-
|
|
64
|
-
|
|
64
|
+
N,
|
|
65
|
+
P,
|
|
65
66
|
D,
|
|
66
67
|
o
|
|
67
68
|
]);
|
|
68
|
-
let
|
|
69
|
-
let e =
|
|
70
|
-
e && (
|
|
69
|
+
let Y = S(() => {
|
|
70
|
+
let e = F.current;
|
|
71
|
+
e && (q.current = e.scrollHeight - e.scrollTop - e.clientHeight < j);
|
|
71
72
|
}, []);
|
|
72
|
-
|
|
73
|
-
let e =
|
|
73
|
+
C(() => {
|
|
74
|
+
let e = I.current;
|
|
74
75
|
if (!e || typeof IntersectionObserver > "u") return;
|
|
75
76
|
let t = new IntersectionObserver((e) => {
|
|
76
77
|
for (let t of e) t.isIntersecting && d && !f && l();
|
|
77
78
|
}, {
|
|
78
|
-
root:
|
|
79
|
-
rootMargin: `${
|
|
79
|
+
root: F.current ?? null,
|
|
80
|
+
rootMargin: `${M}px 0px 0px 0px`,
|
|
80
81
|
threshold: 0
|
|
81
82
|
});
|
|
82
83
|
return t.observe(e), () => t.disconnect();
|
|
@@ -85,52 +86,56 @@ function R({ config: e, parentEntity: t, parentId: n, schema: r }) {
|
|
|
85
86
|
f,
|
|
86
87
|
l
|
|
87
88
|
]);
|
|
88
|
-
let [
|
|
89
|
+
let [X, Z] = te(null);
|
|
89
90
|
if (!o) return null;
|
|
90
|
-
let
|
|
91
|
+
let Q = e.quick_add?.fields ?? [y?.content_field].filter(Boolean), ne = i(o.display?.name_plural) || i(o.display?.name) || e.entity, re = d ? /* @__PURE__ */ k("div", {
|
|
91
92
|
style: {
|
|
92
93
|
display: "flex",
|
|
93
94
|
justifyContent: "center",
|
|
94
95
|
padding: "6px 0"
|
|
95
96
|
},
|
|
96
|
-
children: /* @__PURE__ */
|
|
97
|
+
children: /* @__PURE__ */ k(u, {
|
|
97
98
|
size: "xs",
|
|
98
99
|
onClick: () => l(),
|
|
99
100
|
disabled: f,
|
|
100
|
-
icon: f ? /* @__PURE__ */
|
|
101
|
+
icon: f ? /* @__PURE__ */ k(g, { size: 11 }) : void 0,
|
|
101
102
|
children: f ? i("record.loading", "Loading…") : i("record.timeline.load_older", "Load older")
|
|
102
103
|
})
|
|
103
|
-
}) : null,
|
|
104
|
-
ref:
|
|
104
|
+
}) : null, ie = /* @__PURE__ */ k("div", {
|
|
105
|
+
ref: I,
|
|
105
106
|
"aria-hidden": "true",
|
|
106
107
|
style: { height: 1 }
|
|
107
108
|
}), $;
|
|
108
|
-
if (
|
|
109
|
+
if (_) $ = /* @__PURE__ */ A("div", {
|
|
109
110
|
style: {
|
|
110
111
|
fontSize: 12.5,
|
|
111
112
|
color: "var(--danger)",
|
|
112
113
|
padding: 12
|
|
113
114
|
},
|
|
114
|
-
children:
|
|
115
|
+
children: [
|
|
116
|
+
a("record.related_rows_unreadable", "The related records could not be loaded."),
|
|
117
|
+
" ",
|
|
118
|
+
/* @__PURE__ */ k(h, { onRetry: v })
|
|
119
|
+
]
|
|
115
120
|
});
|
|
116
|
-
else if (p) $ = /* @__PURE__ */
|
|
121
|
+
else if (p) $ = /* @__PURE__ */ A("div", {
|
|
117
122
|
style: {
|
|
118
123
|
display: "flex",
|
|
119
124
|
flexDirection: "column",
|
|
120
125
|
gap: 8,
|
|
121
126
|
padding: 12
|
|
122
127
|
},
|
|
123
|
-
children: [/* @__PURE__ */
|
|
128
|
+
children: [/* @__PURE__ */ k("div", { style: {
|
|
124
129
|
height: 64,
|
|
125
130
|
background: "var(--surface-3)",
|
|
126
131
|
borderRadius: "var(--radius-md)"
|
|
127
|
-
} }), /* @__PURE__ */
|
|
132
|
+
} }), /* @__PURE__ */ k("div", { style: {
|
|
128
133
|
height: 64,
|
|
129
134
|
background: "var(--surface-3)",
|
|
130
135
|
borderRadius: "var(--radius-md)"
|
|
131
136
|
} })]
|
|
132
137
|
});
|
|
133
|
-
else if (
|
|
138
|
+
else if (N.length === 0) $ = /* @__PURE__ */ A(O, { children: [ie, /* @__PURE__ */ k("div", {
|
|
134
139
|
style: {
|
|
135
140
|
fontSize: 12.5,
|
|
136
141
|
color: "var(--text-3)",
|
|
@@ -140,35 +145,35 @@ function R({ config: e, parentEntity: t, parentId: n, schema: r }) {
|
|
|
140
145
|
})] });
|
|
141
146
|
else {
|
|
142
147
|
let a = (i, a) => {
|
|
143
|
-
let s =
|
|
144
|
-
return /* @__PURE__ */
|
|
148
|
+
let s = L(o, i) || String(a);
|
|
149
|
+
return /* @__PURE__ */ k(B, {
|
|
145
150
|
row: i,
|
|
146
151
|
rowId: s,
|
|
147
152
|
childEntity: o,
|
|
148
153
|
entityCode: e.entity,
|
|
149
154
|
parentEntity: t,
|
|
150
155
|
parentId: n,
|
|
151
|
-
timeline:
|
|
152
|
-
editableFields:
|
|
156
|
+
timeline: y,
|
|
157
|
+
editableFields: Q,
|
|
153
158
|
refs: c,
|
|
154
|
-
isEditing:
|
|
155
|
-
onStartEdit: () =>
|
|
156
|
-
onCancelEdit: () =>
|
|
157
|
-
onSaved: () =>
|
|
159
|
+
isEditing: X === s,
|
|
160
|
+
onStartEdit: () => Z(s),
|
|
161
|
+
onCancelEdit: () => Z(null),
|
|
162
|
+
onSaved: () => Z(null),
|
|
158
163
|
schema: r,
|
|
159
|
-
optimistic:
|
|
164
|
+
optimistic: R(i)
|
|
160
165
|
}, s);
|
|
161
|
-
}, s =
|
|
166
|
+
}, s = y?.time_field, l;
|
|
162
167
|
if (s) {
|
|
163
168
|
let e = [], t = o?.fields?.get(s), n = {
|
|
164
169
|
zone: i.timeZone,
|
|
165
170
|
declared: !!(t?.timezone || o?.default_timezone)
|
|
166
171
|
};
|
|
167
|
-
|
|
168
|
-
let a = t[s], o =
|
|
172
|
+
N.forEach((t, r) => {
|
|
173
|
+
let a = t[s], o = H(a, n), c = e[e.length - 1];
|
|
169
174
|
!c || c.key !== o ? e.push({
|
|
170
175
|
key: o,
|
|
171
|
-
label:
|
|
176
|
+
label: U(i, a, n),
|
|
172
177
|
rows: [{
|
|
173
178
|
row: t,
|
|
174
179
|
idx: r
|
|
@@ -177,25 +182,25 @@ function R({ config: e, parentEntity: t, parentId: n, schema: r }) {
|
|
|
177
182
|
row: t,
|
|
178
183
|
idx: r
|
|
179
184
|
});
|
|
180
|
-
}), l = e.map((e) => /* @__PURE__ */
|
|
185
|
+
}), l = e.map((e) => /* @__PURE__ */ A("div", {
|
|
181
186
|
style: {
|
|
182
187
|
display: "flex",
|
|
183
188
|
flexDirection: "column",
|
|
184
189
|
gap: 8
|
|
185
190
|
},
|
|
186
|
-
children: [/* @__PURE__ */
|
|
191
|
+
children: [/* @__PURE__ */ k(W, {
|
|
187
192
|
label: e.label,
|
|
188
193
|
count: e.rows.length
|
|
189
194
|
}), e.rows.map(({ row: e, idx: t }) => a(e, t))]
|
|
190
195
|
}, `day-${e.key}`));
|
|
191
|
-
} else l =
|
|
192
|
-
$ = /* @__PURE__ */
|
|
193
|
-
|
|
194
|
-
|
|
196
|
+
} else l = N.map((e, t) => a(e, t));
|
|
197
|
+
$ = /* @__PURE__ */ A(O, { children: [
|
|
198
|
+
ie,
|
|
199
|
+
re,
|
|
195
200
|
l
|
|
196
201
|
] });
|
|
197
202
|
}
|
|
198
|
-
return
|
|
203
|
+
return E ? /* @__PURE__ */ A("div", {
|
|
199
204
|
style: {
|
|
200
205
|
display: "flex",
|
|
201
206
|
flexDirection: "column",
|
|
@@ -205,24 +210,24 @@ function R({ config: e, parentEntity: t, parentId: n, schema: r }) {
|
|
|
205
210
|
color: "var(--text)"
|
|
206
211
|
},
|
|
207
212
|
children: [
|
|
208
|
-
/* @__PURE__ */
|
|
213
|
+
/* @__PURE__ */ k("div", {
|
|
209
214
|
style: {
|
|
210
215
|
padding: "10px 16px",
|
|
211
216
|
borderBottom: "1px solid var(--divider)",
|
|
212
217
|
background: "var(--surface)"
|
|
213
218
|
},
|
|
214
|
-
children: /* @__PURE__ */
|
|
219
|
+
children: /* @__PURE__ */ k("h3", {
|
|
215
220
|
style: {
|
|
216
221
|
margin: 0,
|
|
217
222
|
fontSize: 12.5,
|
|
218
223
|
fontWeight: 600
|
|
219
224
|
},
|
|
220
|
-
children:
|
|
225
|
+
children: ne
|
|
221
226
|
})
|
|
222
227
|
}),
|
|
223
|
-
/* @__PURE__ */
|
|
224
|
-
ref:
|
|
225
|
-
onScroll:
|
|
228
|
+
/* @__PURE__ */ k("div", {
|
|
229
|
+
ref: F,
|
|
230
|
+
onScroll: Y,
|
|
226
231
|
style: {
|
|
227
232
|
flex: 1,
|
|
228
233
|
overflowY: "auto",
|
|
@@ -233,41 +238,41 @@ function R({ config: e, parentEntity: t, parentId: n, schema: r }) {
|
|
|
233
238
|
},
|
|
234
239
|
children: $
|
|
235
240
|
}),
|
|
236
|
-
/* @__PURE__ */
|
|
241
|
+
/* @__PURE__ */ k(x, {
|
|
237
242
|
config: e,
|
|
238
243
|
parentEntity: t,
|
|
239
244
|
parentId: n,
|
|
240
245
|
schema: r
|
|
241
246
|
})
|
|
242
247
|
]
|
|
243
|
-
}) : /* @__PURE__ */
|
|
248
|
+
}) : /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("div", {
|
|
244
249
|
style: {
|
|
245
250
|
display: "flex",
|
|
246
251
|
flexDirection: "column",
|
|
247
252
|
gap: 8
|
|
248
253
|
},
|
|
249
254
|
children: $
|
|
250
|
-
}), /* @__PURE__ */
|
|
255
|
+
}), /* @__PURE__ */ k(x, {
|
|
251
256
|
config: e,
|
|
252
257
|
parentEntity: t,
|
|
253
258
|
parentId: n,
|
|
254
259
|
schema: r
|
|
255
260
|
})] });
|
|
256
261
|
}
|
|
257
|
-
function
|
|
258
|
-
let P = m(), F = m("errors"), I =
|
|
262
|
+
function B({ row: t, rowId: n, childEntity: o, entityCode: p, parentEntity: h, parentId: b, timeline: x, editableFields: C, refs: w, isEditing: ee, onStartEdit: T, onCancelEdit: O, onSaved: j, schema: M, optimistic: N = !1 }) {
|
|
263
|
+
let P = m(), F = m("errors"), I = D(), [L, R] = te({}), z = S(() => {
|
|
259
264
|
I.invalidateQueries({ queryKey: [
|
|
260
|
-
|
|
261
|
-
|
|
265
|
+
v,
|
|
266
|
+
h,
|
|
262
267
|
b,
|
|
263
268
|
p
|
|
264
269
|
] });
|
|
265
270
|
}, [
|
|
266
271
|
I,
|
|
267
|
-
|
|
272
|
+
h,
|
|
268
273
|
b,
|
|
269
274
|
p
|
|
270
|
-
]),
|
|
275
|
+
]), B = E({
|
|
271
276
|
mutationFn: (e) => {
|
|
272
277
|
let r = t.$row_version, i = typeof r == "string" && r !== "" ? {
|
|
273
278
|
...e,
|
|
@@ -276,30 +281,30 @@ function z({ row: t, rowId: n, childEntity: o, entityCode: p, parentEntity: y, p
|
|
|
276
281
|
return s(p, n, i);
|
|
277
282
|
},
|
|
278
283
|
onSuccess: () => {
|
|
279
|
-
z(),
|
|
284
|
+
z(), _.success(P("record.timeline.updated", "Updated")), j();
|
|
280
285
|
},
|
|
281
|
-
onError: (e) =>
|
|
282
|
-
}), H =
|
|
286
|
+
onError: (e) => _.error(c(F, e))
|
|
287
|
+
}), H = E({
|
|
283
288
|
mutationFn: () => a(p, n),
|
|
284
289
|
onSuccess: () => {
|
|
285
|
-
z(),
|
|
290
|
+
z(), _.success(P("record.timeline.deleted", "Deleted"));
|
|
286
291
|
},
|
|
287
|
-
onError: (e) =>
|
|
288
|
-
}), U =
|
|
292
|
+
onError: (e) => _.error(c(F, e))
|
|
293
|
+
}), U = S(() => {
|
|
289
294
|
let e = {};
|
|
290
295
|
for (let n of C) e[n] = t[n] ?? "";
|
|
291
|
-
R(e),
|
|
296
|
+
R(e), T();
|
|
292
297
|
}, [
|
|
293
298
|
t,
|
|
294
299
|
C,
|
|
295
|
-
|
|
296
|
-
]),
|
|
300
|
+
T
|
|
301
|
+
]), W = S((e, t) => {
|
|
297
302
|
R((n) => ({
|
|
298
303
|
...n,
|
|
299
304
|
[e]: t
|
|
300
305
|
}));
|
|
301
|
-
}, []), K =
|
|
302
|
-
return
|
|
306
|
+
}, []), K = x?.time_field, q = x?.type_field, J = x?.summary_field, Y = x?.content_field, X = x?.author_field, Z = x?.direction_field, Q = x?.intent_field;
|
|
307
|
+
return ee ? /* @__PURE__ */ A("div", {
|
|
303
308
|
style: {
|
|
304
309
|
borderRadius: "var(--radius-lg)",
|
|
305
310
|
border: "1px solid var(--accent)",
|
|
@@ -311,7 +316,7 @@ function z({ row: t, rowId: n, childEntity: o, entityCode: p, parentEntity: y, p
|
|
|
311
316
|
},
|
|
312
317
|
children: [C.map((e) => {
|
|
313
318
|
let t = o.fields.get(e);
|
|
314
|
-
return t ? /* @__PURE__ */
|
|
319
|
+
return t ? /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("label", {
|
|
315
320
|
style: {
|
|
316
321
|
fontSize: 11,
|
|
317
322
|
color: "var(--text-3)",
|
|
@@ -319,40 +324,40 @@ function z({ row: t, rowId: n, childEntity: o, entityCode: p, parentEntity: y, p
|
|
|
319
324
|
display: "block"
|
|
320
325
|
},
|
|
321
326
|
children: r(P, t, e, M.entities)
|
|
322
|
-
}),
|
|
327
|
+
}), y({
|
|
323
328
|
field: t,
|
|
324
329
|
fieldName: e,
|
|
325
330
|
value: L[e] ?? "",
|
|
326
331
|
mode: "edit",
|
|
327
|
-
onChange: (t) =>
|
|
332
|
+
onChange: (t) => W(e, t),
|
|
328
333
|
record: L,
|
|
329
334
|
t: P
|
|
330
335
|
})] }, e) : null;
|
|
331
|
-
}), /* @__PURE__ */
|
|
336
|
+
}), /* @__PURE__ */ A("div", {
|
|
332
337
|
style: {
|
|
333
338
|
display: "flex",
|
|
334
339
|
alignItems: "center",
|
|
335
340
|
gap: 6,
|
|
336
341
|
paddingTop: 4
|
|
337
342
|
},
|
|
338
|
-
children: [/* @__PURE__ */
|
|
343
|
+
children: [/* @__PURE__ */ k(u, {
|
|
339
344
|
kind: "primary",
|
|
340
345
|
size: "xs",
|
|
341
|
-
icon:
|
|
342
|
-
onClick: () =>
|
|
343
|
-
disabled:
|
|
344
|
-
children:
|
|
345
|
-
}), /* @__PURE__ */
|
|
346
|
+
icon: B.isPending ? /* @__PURE__ */ k(g, { size: 12 }) : /* @__PURE__ */ k(l.check, { size: 12 }),
|
|
347
|
+
onClick: () => B.mutate(L),
|
|
348
|
+
disabled: B.isPending,
|
|
349
|
+
children: B.isPending ? P("dialog.saving", "Saving…") : P("dialog.save", "Save")
|
|
350
|
+
}), /* @__PURE__ */ k(u, {
|
|
346
351
|
size: "xs",
|
|
347
|
-
icon: /* @__PURE__ */
|
|
352
|
+
icon: /* @__PURE__ */ k(l.x, { size: 12 }),
|
|
348
353
|
onClick: () => {
|
|
349
|
-
R({}),
|
|
354
|
+
R({}), O();
|
|
350
355
|
},
|
|
351
|
-
disabled:
|
|
356
|
+
disabled: B.isPending,
|
|
352
357
|
children: P("dialog.cancel", "Cancel")
|
|
353
358
|
})]
|
|
354
359
|
})]
|
|
355
|
-
}) : /* @__PURE__ */
|
|
360
|
+
}) : /* @__PURE__ */ A("div", {
|
|
356
361
|
className: "group",
|
|
357
362
|
"data-optimistic": N || void 0,
|
|
358
363
|
style: {
|
|
@@ -366,7 +371,7 @@ function z({ row: t, rowId: n, childEntity: o, entityCode: p, parentEntity: y, p
|
|
|
366
371
|
onMouseEnter: (e) => e.currentTarget.style.borderColor = "var(--border-strong)",
|
|
367
372
|
onMouseLeave: (e) => e.currentTarget.style.borderColor = "var(--border)",
|
|
368
373
|
children: [
|
|
369
|
-
/* @__PURE__ */
|
|
374
|
+
/* @__PURE__ */ A("div", {
|
|
370
375
|
style: {
|
|
371
376
|
display: "flex",
|
|
372
377
|
alignItems: "center",
|
|
@@ -376,9 +381,9 @@ function z({ row: t, rowId: n, childEntity: o, entityCode: p, parentEntity: y, p
|
|
|
376
381
|
color: "var(--text-3)"
|
|
377
382
|
},
|
|
378
383
|
children: [
|
|
379
|
-
K && t[K] != null && o.fields.get(K) && /* @__PURE__ */
|
|
384
|
+
K && t[K] != null && o.fields.get(K) && /* @__PURE__ */ k("span", {
|
|
380
385
|
style: { fontWeight: 500 },
|
|
381
|
-
children:
|
|
386
|
+
children: y({
|
|
382
387
|
field: o.fields.get(K),
|
|
383
388
|
fieldName: K,
|
|
384
389
|
value: t[K],
|
|
@@ -388,10 +393,10 @@ function z({ row: t, rowId: n, childEntity: o, entityCode: p, parentEntity: y, p
|
|
|
388
393
|
t: P
|
|
389
394
|
})
|
|
390
395
|
}),
|
|
391
|
-
q && t[q] != null && o.fields.get(q) && /* @__PURE__ */
|
|
396
|
+
q && t[q] != null && o.fields.get(q) && /* @__PURE__ */ k(f, {
|
|
392
397
|
tone: "slate",
|
|
393
398
|
size: "xs",
|
|
394
|
-
children:
|
|
399
|
+
children: y({
|
|
395
400
|
field: o.fields.get(q),
|
|
396
401
|
fieldName: q,
|
|
397
402
|
value: t[q],
|
|
@@ -401,14 +406,14 @@ function z({ row: t, rowId: n, childEntity: o, entityCode: p, parentEntity: y, p
|
|
|
401
406
|
t: P
|
|
402
407
|
})
|
|
403
408
|
}),
|
|
404
|
-
Z && t[Z] != null && o.fields.get(Z) && /* @__PURE__ */
|
|
409
|
+
Z && t[Z] != null && o.fields.get(Z) && /* @__PURE__ */ k(G, {
|
|
405
410
|
value: t[Z],
|
|
406
411
|
field: o.fields.get(Z)
|
|
407
412
|
}),
|
|
408
|
-
Q && t[Q] != null && o.fields.get(Q) && /* @__PURE__ */
|
|
413
|
+
Q && t[Q] != null && o.fields.get(Q) && /* @__PURE__ */ k(f, {
|
|
409
414
|
tone: "slate",
|
|
410
415
|
size: "xs",
|
|
411
|
-
children:
|
|
416
|
+
children: y({
|
|
412
417
|
field: o.fields.get(Q),
|
|
413
418
|
fieldName: Q,
|
|
414
419
|
value: t[Q],
|
|
@@ -418,7 +423,7 @@ function z({ row: t, rowId: n, childEntity: o, entityCode: p, parentEntity: y, p
|
|
|
418
423
|
t: P
|
|
419
424
|
})
|
|
420
425
|
}),
|
|
421
|
-
X && t[X] != null && o.fields.get(X) && /* @__PURE__ */
|
|
426
|
+
X && t[X] != null && o.fields.get(X) && /* @__PURE__ */ k("span", { children: i(P("record.timeline.by_author", "by {author}"), { author: y({
|
|
422
427
|
field: o.fields.get(X),
|
|
423
428
|
fieldName: X,
|
|
424
429
|
value: t[X],
|
|
@@ -427,34 +432,34 @@ function z({ row: t, rowId: n, childEntity: o, entityCode: p, parentEntity: y, p
|
|
|
427
432
|
refs: w,
|
|
428
433
|
t: P
|
|
429
434
|
}) }) }),
|
|
430
|
-
!N && /* @__PURE__ */
|
|
435
|
+
!N && /* @__PURE__ */ A("div", {
|
|
431
436
|
style: {
|
|
432
437
|
marginLeft: "auto",
|
|
433
438
|
display: "flex",
|
|
434
439
|
alignItems: "center",
|
|
435
440
|
gap: 2
|
|
436
441
|
},
|
|
437
|
-
children: [/* @__PURE__ */
|
|
442
|
+
children: [/* @__PURE__ */ k(d, {
|
|
438
443
|
size: 22,
|
|
439
|
-
icon: /* @__PURE__ */
|
|
444
|
+
icon: /* @__PURE__ */ k(l.edit, { size: 11 }),
|
|
440
445
|
onClick: U,
|
|
441
446
|
title: P("record.action.edit", "Edit")
|
|
442
|
-
}), /* @__PURE__ */
|
|
447
|
+
}), /* @__PURE__ */ k(d, {
|
|
443
448
|
size: 22,
|
|
444
|
-
icon: /* @__PURE__ */
|
|
449
|
+
icon: /* @__PURE__ */ k(l.trash, { size: 11 }),
|
|
445
450
|
onClick: () => H.mutate(),
|
|
446
451
|
title: P("record.action.delete", "Delete")
|
|
447
452
|
})]
|
|
448
453
|
})
|
|
449
454
|
]
|
|
450
455
|
}),
|
|
451
|
-
J && t[J] != null && o.fields.get(J) && /* @__PURE__ */
|
|
456
|
+
J && t[J] != null && o.fields.get(J) && /* @__PURE__ */ k("div", {
|
|
452
457
|
style: {
|
|
453
458
|
fontSize: 12.5,
|
|
454
459
|
fontWeight: 500,
|
|
455
460
|
marginTop: 6
|
|
456
461
|
},
|
|
457
|
-
children:
|
|
462
|
+
children: y({
|
|
458
463
|
field: o.fields.get(J),
|
|
459
464
|
fieldName: J,
|
|
460
465
|
value: t[J],
|
|
@@ -464,8 +469,8 @@ function z({ row: t, rowId: n, childEntity: o, entityCode: p, parentEntity: y, p
|
|
|
464
469
|
t: P
|
|
465
470
|
})
|
|
466
471
|
}),
|
|
467
|
-
Y && t[Y] != null && Y !== J && o.fields.get(Y) && /* @__PURE__ */
|
|
468
|
-
rendered:
|
|
472
|
+
Y && t[Y] != null && Y !== J && o.fields.get(Y) && /* @__PURE__ */ k(V, {
|
|
473
|
+
rendered: y({
|
|
469
474
|
field: o.fields.get(Y),
|
|
470
475
|
fieldName: Y,
|
|
471
476
|
value: t[Y],
|
|
@@ -479,36 +484,36 @@ function z({ row: t, rowId: n, childEntity: o, entityCode: p, parentEntity: y, p
|
|
|
479
484
|
]
|
|
480
485
|
});
|
|
481
486
|
}
|
|
482
|
-
function
|
|
487
|
+
function V({ rendered: e, text: t }) {
|
|
483
488
|
let n = m(), r = {
|
|
484
489
|
fontSize: 12.5,
|
|
485
490
|
fontWeight: 400,
|
|
486
491
|
marginTop: 6
|
|
487
492
|
};
|
|
488
|
-
if (!
|
|
493
|
+
if (!I(t)) return /* @__PURE__ */ k("div", {
|
|
489
494
|
style: r,
|
|
490
495
|
children: e
|
|
491
496
|
});
|
|
492
|
-
let i = t.length >
|
|
493
|
-
return /* @__PURE__ */
|
|
497
|
+
let i = t.length > P, a = i ? t.slice(0, P) : t;
|
|
498
|
+
return /* @__PURE__ */ k("div", {
|
|
494
499
|
style: {
|
|
495
500
|
...r,
|
|
496
501
|
display: "-webkit-box",
|
|
497
502
|
WebkitBoxOrient: "vertical",
|
|
498
|
-
WebkitLineClamp:
|
|
503
|
+
WebkitLineClamp: N,
|
|
499
504
|
overflow: "hidden",
|
|
500
505
|
whiteSpace: "pre-wrap",
|
|
501
506
|
overflowWrap: "anywhere"
|
|
502
507
|
},
|
|
503
|
-
children: /* @__PURE__ */
|
|
508
|
+
children: /* @__PURE__ */ k(p, {
|
|
504
509
|
width: 380,
|
|
505
|
-
content: /* @__PURE__ */
|
|
510
|
+
content: /* @__PURE__ */ A("div", {
|
|
506
511
|
style: {
|
|
507
512
|
fontSize: 12.5,
|
|
508
513
|
whiteSpace: "pre-wrap",
|
|
509
514
|
overflowWrap: "anywhere"
|
|
510
515
|
},
|
|
511
|
-
children: [a, i && /* @__PURE__ */
|
|
516
|
+
children: [a, i && /* @__PURE__ */ k("div", {
|
|
512
517
|
style: {
|
|
513
518
|
marginTop: 8,
|
|
514
519
|
fontSize: 11,
|
|
@@ -521,10 +526,10 @@ function B({ rendered: e, text: t }) {
|
|
|
521
526
|
})
|
|
522
527
|
});
|
|
523
528
|
}
|
|
524
|
-
function
|
|
529
|
+
function H(n, r) {
|
|
525
530
|
return n == null ? "" : t(e(n), r) ?? "";
|
|
526
531
|
}
|
|
527
|
-
function
|
|
532
|
+
function U(n, r, i) {
|
|
528
533
|
let a = r == null ? null : t(e(r), i);
|
|
529
534
|
if (!a) return "—";
|
|
530
535
|
let o = Date.now();
|
|
@@ -535,8 +540,8 @@ function H(n, r, i) {
|
|
|
535
540
|
timeZone: "UTC"
|
|
536
541
|
});
|
|
537
542
|
}
|
|
538
|
-
function
|
|
539
|
-
return /* @__PURE__ */
|
|
543
|
+
function W({ label: e, count: t }) {
|
|
544
|
+
return /* @__PURE__ */ A("div", {
|
|
540
545
|
style: {
|
|
541
546
|
position: "sticky",
|
|
542
547
|
top: -4,
|
|
@@ -548,7 +553,7 @@ function U({ label: e, count: t }) {
|
|
|
548
553
|
background: "linear-gradient(180deg, var(--surface-2) 0%, var(--surface-2) 65%, transparent 100%)"
|
|
549
554
|
},
|
|
550
555
|
children: [
|
|
551
|
-
/* @__PURE__ */
|
|
556
|
+
/* @__PURE__ */ k("span", {
|
|
552
557
|
style: {
|
|
553
558
|
fontSize: 11,
|
|
554
559
|
fontWeight: 600,
|
|
@@ -556,12 +561,12 @@ function U({ label: e, count: t }) {
|
|
|
556
561
|
},
|
|
557
562
|
children: e
|
|
558
563
|
}),
|
|
559
|
-
/* @__PURE__ */
|
|
564
|
+
/* @__PURE__ */ k("span", { style: {
|
|
560
565
|
flex: 1,
|
|
561
566
|
height: 1,
|
|
562
567
|
background: "var(--divider)"
|
|
563
568
|
} }),
|
|
564
|
-
/* @__PURE__ */
|
|
569
|
+
/* @__PURE__ */ k("span", {
|
|
565
570
|
className: "num",
|
|
566
571
|
style: {
|
|
567
572
|
fontSize: 10.5,
|
|
@@ -572,9 +577,9 @@ function U({ label: e, count: t }) {
|
|
|
572
577
|
]
|
|
573
578
|
});
|
|
574
579
|
}
|
|
575
|
-
function
|
|
576
|
-
let n = m(), r =
|
|
577
|
-
return r === null ? null : /* @__PURE__ */
|
|
580
|
+
function G({ value: e, field: t }) {
|
|
581
|
+
let n = m(), r = K(e, t);
|
|
582
|
+
return r === null ? null : /* @__PURE__ */ A("span", {
|
|
578
583
|
style: {
|
|
579
584
|
display: "inline-flex",
|
|
580
585
|
alignItems: "center",
|
|
@@ -586,10 +591,10 @@ function W({ value: e, field: t }) {
|
|
|
586
591
|
background: r ? "var(--accent-soft)" : "var(--info-soft)",
|
|
587
592
|
color: r ? "var(--accent)" : "var(--info)"
|
|
588
593
|
},
|
|
589
|
-
children: [
|
|
594
|
+
children: [k(r ? l.arrowUp : l.arrowDown, { size: 10 }), r ? n("record.timeline.outbound", "Out") : n("record.timeline.inbound", "In")]
|
|
590
595
|
});
|
|
591
596
|
}
|
|
592
|
-
function
|
|
597
|
+
function K(e, t) {
|
|
593
598
|
if (t.type === "bool") return e === !0;
|
|
594
599
|
if (typeof e == "string") {
|
|
595
600
|
let t = e.toLowerCase();
|
|
@@ -599,4 +604,4 @@ function G(e, t) {
|
|
|
599
604
|
return null;
|
|
600
605
|
}
|
|
601
606
|
//#endregion
|
|
602
|
-
export {
|
|
607
|
+
export { z as ChildrenTimeline };
|