@declarion/react 0.45.0 → 0.47.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-BDnJK0AU.js → DraggableChildrenTable-B6KjWkwD.js} +2 -2
- package/dist-lib/{DynamicIcon-DeRpAaXm.js → DynamicIcon-Dc2j-rg_.js} +19 -17
- package/dist-lib/{Grid-CcCveEE7.js → Grid-OdquWJNX.js} +2 -2
- package/dist-lib/{LayoutRenderer-BReuhVdX.js → LayoutRenderer-CzAdhjNT.js} +525 -518
- package/dist-lib/{MarkdownRenderer-DPKDFR60.js → MarkdownRenderer-C6bhrAIe.js} +10 -10
- package/dist-lib/{RefreshControl-KddgOhUG.js → RefreshControl-F9Ib9asP.js} +18 -18
- package/dist-lib/{SmartDetailPage.impl-D_hMxiHy.js → SmartDetailPage.impl-DdSu3kmW.js} +305 -294
- package/dist-lib/{SmartRecordListPage.impl-GIo_mPIJ.js → SmartRecordListPage.impl-SkIp0_Rd.js} +165 -154
- package/dist-lib/api/agents.d.ts +39 -7
- package/dist-lib/components/agents/AgentChatPanel.d.ts +6 -1
- package/dist-lib/components/agents/transcript-runs.d.ts +29 -0
- package/dist-lib/components/file-widgets/host.d.ts +1 -0
- package/dist-lib/components/list/QuickPeek.d.ts +1 -1
- package/dist-lib/components/pages/list/ListFloatbar.d.ts +4 -2
- package/dist-lib/components/pages/list/cardProjection.d.ts +2 -1
- package/dist-lib/components/shared/RowActionsKebab.d.ts +3 -2
- package/dist-lib/components/views/ViewSwitcher.d.ts +2 -1
- package/dist-lib/hooks/useAgentConversation.d.ts +7 -19
- package/dist-lib/hooks/useFilters.d.ts +1 -0
- package/dist-lib/icons.js +1 -1
- package/dist-lib/index.d.ts +8 -1
- package/dist-lib/index.js +3031 -2674
- package/dist-lib/lib/actions.d.ts +1 -1
- package/dist-lib/lib/filter-evaluator.d.ts +16 -0
- package/dist-lib/lib/filters.d.ts +10 -4
- package/dist-lib/lib/messages.d.ts +1 -0
- package/dist-lib/lib/variants.d.ts +7 -0
- package/dist-lib/{registry-DJKp0yaV.js → registry-C2VD-5MD.js} +571 -347
- package/dist-lib/testing.js +1 -1
- package/dist-lib/types/schema.d.ts +26 -0
- package/dist-lib/{useCurrentScreen-A3xZDs7U.js → useCurrentScreen-ow4r-nWa.js} +721 -693
- package/dist-lib/{useProperties-TlltWwLv.js → useProperties-lEKfzm2X.js} +92 -61
- package/dist-lib/{value-CHY7LgZ-.js → value-CXohNH6a.js} +1 -1
- package/dist-lib/vite/index.js +23 -22
- package/package.json +12 -12
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { s as e, t } from "./DynamicIcon-
|
|
2
|
-
import { A as n, An as r, Dn as i, En as a, Gt as o, In as s, Kn as c, Ln as l, M as u, Sn as d, Tn as f, X as p, Z as m, Zn as h, _t as g, ar as _, bn as v, cr as y, f as b, j as x, jn as S, kt as C, lr as w, mn as T, rr as E, rt as D, ur as O, vt as k, wn as A, xn as j, yt as M } from "./useCurrentScreen-
|
|
3
|
-
import {
|
|
4
|
-
import { n as
|
|
5
|
-
import { Suspense as
|
|
6
|
-
import { useInfiniteQuery as
|
|
7
|
-
import { Fragment as
|
|
1
|
+
import { s as e, t } from "./DynamicIcon-Dc2j-rg_.js";
|
|
2
|
+
import { A as n, An as r, Dn as i, En as a, Gt as o, In as s, Kn as c, Ln as l, M as u, Sn as d, Tn as f, X as p, Z as m, Zn as h, _t as g, ar as _, bn as v, cr as y, f as b, j as x, jn as S, kt as C, lr as w, mn as T, rr as E, rt as D, ur as O, vt as k, wn as A, xn as j, yt as M } from "./useCurrentScreen-ow4r-nWa.js";
|
|
3
|
+
import { E as ee, G as N, H as P, J as F, K as I, U as L, V as R, W as te, bt as z, d as B, dt as V, et as ne, f as re, ft as ie, j as ae, o as oe, r as se, t as ce, tt as le, xt as ue } from "./registry-C2VD-5MD.js";
|
|
4
|
+
import { n as de, r as fe, t as pe } from "./dataTableStyles-vwD1mVOP.js";
|
|
5
|
+
import { Suspense as me, createContext as he, lazy as ge, useCallback as H, useContext as _e, useEffect as U, useId as ve, useLayoutEffect as ye, useMemo as W, useRef as G, useState as K } from "react";
|
|
6
|
+
import { useInfiniteQuery as be, useMutation as xe, useQueryClient as Se } from "@tanstack/react-query";
|
|
7
|
+
import { Fragment as q, jsx as J, jsxs as Y } from "react/jsx-runtime";
|
|
8
8
|
//#region src/lib/size-value.ts
|
|
9
|
-
var
|
|
10
|
-
function
|
|
9
|
+
var Ce = /^(\d+)px$/;
|
|
10
|
+
function we(e) {
|
|
11
11
|
if (e == null || e === "") return null;
|
|
12
12
|
if (e === "auto") return { kind: "auto" };
|
|
13
13
|
if (e === "fill") return { kind: "fill" };
|
|
14
|
-
let t =
|
|
14
|
+
let t = Ce.exec(e);
|
|
15
15
|
if (t) {
|
|
16
16
|
let e = parseInt(t[1], 10);
|
|
17
17
|
return e > 0 ? {
|
|
@@ -27,9 +27,9 @@ function Te(e) {
|
|
|
27
27
|
}
|
|
28
28
|
//#endregion
|
|
29
29
|
//#region src/components/detail-layout/LayoutRow.tsx
|
|
30
|
-
function
|
|
31
|
-
let { items: n, gap: r = 0, resizable: i = !1, stack_below: a } = e, o = a === "never" ? 0 : a ?? 768, [s, c] =
|
|
32
|
-
|
|
30
|
+
function Te({ config: e, ctx: t }) {
|
|
31
|
+
let { items: n, gap: r = 0, resizable: i = !1, stack_below: a } = e, o = a === "never" ? 0 : a ?? 768, [s, c] = K(!1), l = G(null);
|
|
32
|
+
U(() => {
|
|
33
33
|
if (o === 0) return;
|
|
34
34
|
let e = l.current;
|
|
35
35
|
if (!e) return;
|
|
@@ -38,10 +38,10 @@ function Ee({ config: e, ctx: t }) {
|
|
|
38
38
|
});
|
|
39
39
|
return t.observe(e), () => t.disconnect();
|
|
40
40
|
}, [o]);
|
|
41
|
-
let [u, d] =
|
|
42
|
-
let n =
|
|
41
|
+
let [u, d] = K(null), f = G(null), p = H(() => n.map((t) => {
|
|
42
|
+
let n = we(t.width ?? t.column?.width ?? t.row?.width ?? e.width);
|
|
43
43
|
return n && n.kind === "weight" ? n.value : 1;
|
|
44
|
-
}), [n, e.width]), m =
|
|
44
|
+
}), [n, e.width]), m = H((e, t) => {
|
|
45
45
|
t.preventDefault();
|
|
46
46
|
let n = u ?? p();
|
|
47
47
|
f.current = {
|
|
@@ -58,41 +58,41 @@ function Ee({ config: e, ctx: t }) {
|
|
|
58
58
|
f.current = null, document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", i);
|
|
59
59
|
};
|
|
60
60
|
document.addEventListener("mousemove", r), document.addEventListener("mouseup", i);
|
|
61
|
-
}, [u, p]), h = u ?? p(), g = e.height ?
|
|
62
|
-
return /* @__PURE__ */
|
|
61
|
+
}, [u, p]), h = u ?? p(), g = e.height ? De(e.height) : void 0;
|
|
62
|
+
return /* @__PURE__ */ J("div", {
|
|
63
63
|
ref: l,
|
|
64
|
-
className:
|
|
64
|
+
className: ie("flex", s && "flex-col"),
|
|
65
65
|
style: {
|
|
66
66
|
gap: r ? `${r}px` : void 0,
|
|
67
67
|
...g
|
|
68
68
|
},
|
|
69
|
-
children: n.map((r, a) => /* @__PURE__ */
|
|
70
|
-
className:
|
|
71
|
-
style: s ? void 0 :
|
|
72
|
-
children: [/* @__PURE__ */
|
|
73
|
-
className:
|
|
74
|
-
children: /* @__PURE__ */
|
|
69
|
+
children: n.map((r, a) => /* @__PURE__ */ Y("div", {
|
|
70
|
+
className: ie("min-w-0 flex items-stretch", s && "w-full"),
|
|
71
|
+
style: s ? void 0 : Ee(r.width ?? r.column?.width ?? r.row?.width ?? e.width, h[a], r.min_width, r.max_width),
|
|
72
|
+
children: [/* @__PURE__ */ J("div", {
|
|
73
|
+
className: ie("flex-1 min-w-0 flex flex-col", g && "overflow-y-auto overflow-x-hidden"),
|
|
74
|
+
children: /* @__PURE__ */ J($, {
|
|
75
75
|
node: r,
|
|
76
76
|
ctx: t
|
|
77
77
|
})
|
|
78
|
-
}), i && !s && a < n.length - 1 && /* @__PURE__ */
|
|
78
|
+
}), i && !s && a < n.length - 1 && /* @__PURE__ */ J("div", {
|
|
79
79
|
className: "detail-resize-handle",
|
|
80
80
|
onMouseDown: (e) => m(a, e)
|
|
81
81
|
})]
|
|
82
82
|
}, a))
|
|
83
83
|
});
|
|
84
84
|
}
|
|
85
|
-
function
|
|
86
|
-
let i =
|
|
85
|
+
function Ee(e, t, n, r) {
|
|
86
|
+
let i = we(e), a;
|
|
87
87
|
return a = !i || i.kind === "weight" ? `${t} 1 0%` : i.kind === "px" ? `0 0 ${i.value}px` : i.kind === "fill" ? "1 1 0%" : "0 0 auto", {
|
|
88
88
|
flex: a,
|
|
89
89
|
minWidth: n,
|
|
90
90
|
maxWidth: r
|
|
91
91
|
};
|
|
92
92
|
}
|
|
93
|
-
function
|
|
93
|
+
function De(e) {
|
|
94
94
|
if (!e) return;
|
|
95
|
-
let t =
|
|
95
|
+
let t = we(e);
|
|
96
96
|
if (t?.kind === "px") return {
|
|
97
97
|
height: `${t.value}px`,
|
|
98
98
|
overflow: "hidden"
|
|
@@ -104,12 +104,12 @@ function Oe(e) {
|
|
|
104
104
|
}
|
|
105
105
|
//#endregion
|
|
106
106
|
//#region src/components/detail-layout/LayoutColumn.tsx
|
|
107
|
-
function
|
|
107
|
+
function Oe({ config: e, ctx: t }) {
|
|
108
108
|
let { items: n, gap: r = 12 } = e;
|
|
109
|
-
return /* @__PURE__ */
|
|
109
|
+
return /* @__PURE__ */ J("div", {
|
|
110
110
|
className: "flex flex-col h-full",
|
|
111
111
|
style: { gap: r ? `${r}px` : void 0 },
|
|
112
|
-
children: n.map((e, n) => /* @__PURE__ */
|
|
112
|
+
children: n.map((e, n) => /* @__PURE__ */ J($, {
|
|
113
113
|
node: e,
|
|
114
114
|
ctx: t
|
|
115
115
|
}, n))
|
|
@@ -117,11 +117,11 @@ function ke({ config: e, ctx: t }) {
|
|
|
117
117
|
}
|
|
118
118
|
//#endregion
|
|
119
119
|
//#region src/components/detail-layout/blockMeta.ts
|
|
120
|
-
function
|
|
120
|
+
function ke(e) {
|
|
121
121
|
return e.children ?? e.associated;
|
|
122
122
|
}
|
|
123
|
-
function
|
|
124
|
-
let n =
|
|
123
|
+
function Ae(e, t) {
|
|
124
|
+
let n = ke(e);
|
|
125
125
|
if (n) {
|
|
126
126
|
if (e.label) return f(e.label);
|
|
127
127
|
let r = t.entity.children?.find((e) => e.entity === n);
|
|
@@ -131,9 +131,9 @@ function je(e, t) {
|
|
|
131
131
|
}
|
|
132
132
|
return e.section ? f(e.section.name) : "Tab";
|
|
133
133
|
}
|
|
134
|
-
function
|
|
134
|
+
function je(e, t) {
|
|
135
135
|
if (e.icon) return e.icon;
|
|
136
|
-
let n =
|
|
136
|
+
let n = ke(e);
|
|
137
137
|
if (n) {
|
|
138
138
|
let e = t.entity.children?.find((e) => e.entity === n);
|
|
139
139
|
if (e?.display?.icon) return e.display.icon;
|
|
@@ -144,18 +144,18 @@ function Y(e, t) {
|
|
|
144
144
|
//#endregion
|
|
145
145
|
//#region src/components/detail-layout/LayoutTabs.tsx
|
|
146
146
|
function Me({ config: e, ctx: n }) {
|
|
147
|
-
let { items: r } = e, [i, a] =
|
|
147
|
+
let { items: r } = e, [i, a] = K(0), o = E(), s = n.detailTabsPresentation ?? (o.isPhone ? "sections" : "scroll");
|
|
148
148
|
if (r.length === 0) return null;
|
|
149
149
|
if (s === "sections") {
|
|
150
150
|
let e = r.map((e, t) => `detail-tab-section-${t}`);
|
|
151
|
-
return /* @__PURE__ */
|
|
151
|
+
return /* @__PURE__ */ Y("div", {
|
|
152
152
|
style: {
|
|
153
153
|
display: "flex",
|
|
154
154
|
flexDirection: "column",
|
|
155
155
|
gap: 10,
|
|
156
156
|
minWidth: 0
|
|
157
157
|
},
|
|
158
|
-
children: [r.length > 1 && /* @__PURE__ */
|
|
158
|
+
children: [r.length > 1 && /* @__PURE__ */ J("nav", {
|
|
159
159
|
"aria-label": "Detail sections",
|
|
160
160
|
style: {
|
|
161
161
|
display: "flex",
|
|
@@ -165,8 +165,8 @@ function Me({ config: e, ctx: n }) {
|
|
|
165
165
|
WebkitOverflowScrolling: "touch"
|
|
166
166
|
},
|
|
167
167
|
children: r.map((r, i) => {
|
|
168
|
-
let a =
|
|
169
|
-
return /* @__PURE__ */
|
|
168
|
+
let a = Ae(r, n), o = je(r, n);
|
|
169
|
+
return /* @__PURE__ */ Y("button", {
|
|
170
170
|
type: "button",
|
|
171
171
|
onClick: () => document.getElementById(e[i])?.scrollIntoView({
|
|
172
172
|
block: "start",
|
|
@@ -188,10 +188,10 @@ function Me({ config: e, ctx: n }) {
|
|
|
188
188
|
whiteSpace: "nowrap",
|
|
189
189
|
cursor: "pointer"
|
|
190
190
|
},
|
|
191
|
-
children: [o && /* @__PURE__ */
|
|
191
|
+
children: [o && /* @__PURE__ */ J(t, {
|
|
192
192
|
name: o,
|
|
193
193
|
size: 13
|
|
194
|
-
}), /* @__PURE__ */
|
|
194
|
+
}), /* @__PURE__ */ J("span", {
|
|
195
195
|
style: {
|
|
196
196
|
overflow: "hidden",
|
|
197
197
|
textOverflow: "ellipsis"
|
|
@@ -201,8 +201,8 @@ function Me({ config: e, ctx: n }) {
|
|
|
201
201
|
}, i);
|
|
202
202
|
})
|
|
203
203
|
}), r.map((r, i) => {
|
|
204
|
-
let a =
|
|
205
|
-
return /* @__PURE__ */
|
|
204
|
+
let a = Ae(r, n), o = je(r, n);
|
|
205
|
+
return /* @__PURE__ */ Y("section", {
|
|
206
206
|
id: e[i],
|
|
207
207
|
style: {
|
|
208
208
|
background: "var(--surface)",
|
|
@@ -213,7 +213,7 @@ function Me({ config: e, ctx: n }) {
|
|
|
213
213
|
minWidth: 0,
|
|
214
214
|
scrollMarginTop: 12
|
|
215
215
|
},
|
|
216
|
-
children: [/* @__PURE__ */
|
|
216
|
+
children: [/* @__PURE__ */ Y("div", {
|
|
217
217
|
style: {
|
|
218
218
|
display: "flex",
|
|
219
219
|
alignItems: "center",
|
|
@@ -224,19 +224,19 @@ function Me({ config: e, ctx: n }) {
|
|
|
224
224
|
fontSize: 13,
|
|
225
225
|
fontWeight: 700
|
|
226
226
|
},
|
|
227
|
-
children: [o && /* @__PURE__ */
|
|
227
|
+
children: [o && /* @__PURE__ */ J(t, {
|
|
228
228
|
name: o,
|
|
229
229
|
size: 14
|
|
230
|
-
}), /* @__PURE__ */
|
|
230
|
+
}), /* @__PURE__ */ J("span", {
|
|
231
231
|
style: { overflowWrap: "anywhere" },
|
|
232
232
|
children: a
|
|
233
233
|
})]
|
|
234
|
-
}), /* @__PURE__ */
|
|
234
|
+
}), /* @__PURE__ */ J("div", {
|
|
235
235
|
style: {
|
|
236
236
|
padding: 14,
|
|
237
237
|
minWidth: 0
|
|
238
238
|
},
|
|
239
|
-
children: /* @__PURE__ */
|
|
239
|
+
children: /* @__PURE__ */ J($, {
|
|
240
240
|
node: r,
|
|
241
241
|
ctx: {
|
|
242
242
|
...n,
|
|
@@ -248,7 +248,7 @@ function Me({ config: e, ctx: n }) {
|
|
|
248
248
|
})]
|
|
249
249
|
});
|
|
250
250
|
}
|
|
251
|
-
return /* @__PURE__ */
|
|
251
|
+
return /* @__PURE__ */ Y("div", {
|
|
252
252
|
style: {
|
|
253
253
|
background: "var(--surface)",
|
|
254
254
|
border: "1px solid var(--border)",
|
|
@@ -257,7 +257,7 @@ function Me({ config: e, ctx: n }) {
|
|
|
257
257
|
boxShadow: "var(--shadow-xs)",
|
|
258
258
|
flexShrink: 0
|
|
259
259
|
},
|
|
260
|
-
children: [/* @__PURE__ */
|
|
260
|
+
children: [/* @__PURE__ */ J("div", {
|
|
261
261
|
role: "tablist",
|
|
262
262
|
style: {
|
|
263
263
|
display: "flex",
|
|
@@ -268,8 +268,8 @@ function Me({ config: e, ctx: n }) {
|
|
|
268
268
|
overflowX: "auto"
|
|
269
269
|
},
|
|
270
270
|
children: r.map((e, r) => {
|
|
271
|
-
let o =
|
|
272
|
-
return /* @__PURE__ */
|
|
271
|
+
let o = Ae(e, n), s = je(e, n), c = r === i;
|
|
272
|
+
return /* @__PURE__ */ Y("button", {
|
|
273
273
|
role: "tab",
|
|
274
274
|
"aria-selected": c,
|
|
275
275
|
onClick: (e) => {
|
|
@@ -298,12 +298,12 @@ function Me({ config: e, ctx: n }) {
|
|
|
298
298
|
c || (e.currentTarget.style.color = "var(--text-3)");
|
|
299
299
|
},
|
|
300
300
|
children: [
|
|
301
|
-
s && /* @__PURE__ */
|
|
301
|
+
s && /* @__PURE__ */ J(t, {
|
|
302
302
|
name: s,
|
|
303
303
|
size: 13
|
|
304
304
|
}),
|
|
305
305
|
o,
|
|
306
|
-
c && /* @__PURE__ */
|
|
306
|
+
c && /* @__PURE__ */ J("span", { style: {
|
|
307
307
|
position: "absolute",
|
|
308
308
|
left: 4,
|
|
309
309
|
right: 4,
|
|
@@ -315,10 +315,10 @@ function Me({ config: e, ctx: n }) {
|
|
|
315
315
|
]
|
|
316
316
|
}, r);
|
|
317
317
|
})
|
|
318
|
-
}), /* @__PURE__ */
|
|
318
|
+
}), /* @__PURE__ */ J("div", {
|
|
319
319
|
role: "tabpanel",
|
|
320
320
|
style: { padding: 14 },
|
|
321
|
-
children: /* @__PURE__ */
|
|
321
|
+
children: /* @__PURE__ */ J($, {
|
|
322
322
|
node: r[i],
|
|
323
323
|
ctx: {
|
|
324
324
|
...n,
|
|
@@ -335,7 +335,7 @@ function Ne({ config: e, ctx: n }) {
|
|
|
335
335
|
...n,
|
|
336
336
|
withinCard: !0,
|
|
337
337
|
...o ? { columns: o } : null
|
|
338
|
-
}, d = s ? /* @__PURE__ */
|
|
338
|
+
}, d = s ? /* @__PURE__ */ J(t, {
|
|
339
339
|
name: s,
|
|
340
340
|
size: 14
|
|
341
341
|
}) : void 0, p = c ? {
|
|
@@ -343,14 +343,14 @@ function Ne({ config: e, ctx: n }) {
|
|
|
343
343
|
tone: c.tone,
|
|
344
344
|
dot: c.dot
|
|
345
345
|
} : void 0;
|
|
346
|
-
return /* @__PURE__ */
|
|
346
|
+
return /* @__PURE__ */ J(ue, {
|
|
347
347
|
title: f(r),
|
|
348
348
|
defaultOpen: !a,
|
|
349
349
|
icon: d,
|
|
350
350
|
badge: p,
|
|
351
351
|
emphasis: l,
|
|
352
352
|
headingLevel: n.withinCard ? 3 : 2,
|
|
353
|
-
children: /* @__PURE__ */
|
|
353
|
+
children: /* @__PURE__ */ J(hn, {
|
|
354
354
|
nodes: i,
|
|
355
355
|
ctx: u
|
|
356
356
|
})
|
|
@@ -489,26 +489,26 @@ function Je(e, t) {
|
|
|
489
489
|
//#endregion
|
|
490
490
|
//#region src/components/detail-layout/useQuickAdd.ts
|
|
491
491
|
function Ye(e, t, n, r) {
|
|
492
|
-
let [i, o] =
|
|
492
|
+
let [i, o] = K(() => {
|
|
493
493
|
let t = e.quick_add, n = r.entities[e.entity], i = {};
|
|
494
494
|
if (t?.fields) for (let e of t.fields) t.defaults?.[e] == null ? n?.fields.get(e)?.type === "timestamp" && (i[e] = s()) : i[e] = t.defaults[e];
|
|
495
495
|
return i;
|
|
496
|
-
}), c =
|
|
496
|
+
}), c = Se(), { mutate: l, isPending: u, error: d, reset: f } = xe({
|
|
497
497
|
mutationFn: (t) => g(e.entity, t),
|
|
498
498
|
onMutate: async (r) => {
|
|
499
|
-
let i = [
|
|
500
|
-
|
|
499
|
+
let i = Array.isArray(n) ? a(n.map(String)) : n, o = [
|
|
500
|
+
te,
|
|
501
501
|
t,
|
|
502
|
-
|
|
502
|
+
i,
|
|
503
503
|
e.entity
|
|
504
504
|
];
|
|
505
|
-
await c.cancelQueries({ queryKey:
|
|
506
|
-
let
|
|
505
|
+
await c.cancelQueries({ queryKey: o });
|
|
506
|
+
let s = c.getQueriesData({ queryKey: o }), l = {
|
|
507
507
|
...r,
|
|
508
508
|
id: `__optimistic_${crypto.randomUUID()}`,
|
|
509
509
|
__optimistic: !0
|
|
510
510
|
};
|
|
511
|
-
return c.setQueriesData({ queryKey:
|
|
511
|
+
return c.setQueriesData({ queryKey: o }, (e) => {
|
|
512
512
|
if (!e || typeof e != "object") return e;
|
|
513
513
|
if ("pages" in e && Array.isArray(e.pages) && e.pages.length > 0) {
|
|
514
514
|
let t = e, [n, ...r] = t.pages;
|
|
@@ -516,25 +516,25 @@ function Ye(e, t, n, r) {
|
|
|
516
516
|
...t,
|
|
517
517
|
pages: [{
|
|
518
518
|
...n,
|
|
519
|
-
data: [
|
|
519
|
+
data: [l, ...n.data]
|
|
520
520
|
}, ...r]
|
|
521
521
|
};
|
|
522
522
|
}
|
|
523
523
|
return e;
|
|
524
|
-
}), { snapshots:
|
|
524
|
+
}), { snapshots: s };
|
|
525
525
|
},
|
|
526
526
|
onError: (e, t, n) => {
|
|
527
527
|
if (n?.snapshots) for (let [e, t] of n.snapshots) c.setQueryData(e, t);
|
|
528
528
|
},
|
|
529
529
|
onSuccess: () => {
|
|
530
530
|
let t = e.quick_add, n = r.entities[e.entity], i = {};
|
|
531
|
-
if (t?.fields) for (let e of t.fields) t?.defaults?.[e] == null ? n?.fields.get(e)?.type === "timestamp" ?
|
|
531
|
+
if (t?.fields) for (let e of t.fields) i[e] = t?.defaults?.[e] == null ? n?.fields.get(e)?.type === "timestamp" ? s() : "" : t.defaults[e];
|
|
532
532
|
o(i);
|
|
533
533
|
},
|
|
534
534
|
onSettled: () => {
|
|
535
535
|
let r = Array.isArray(n) ? a(n.map(String)) : n;
|
|
536
536
|
c.invalidateQueries({ queryKey: [
|
|
537
|
-
|
|
537
|
+
te,
|
|
538
538
|
t,
|
|
539
539
|
r,
|
|
540
540
|
e.entity
|
|
@@ -566,8 +566,8 @@ function Ye(e, t, n, r) {
|
|
|
566
566
|
//#endregion
|
|
567
567
|
//#region src/components/detail-layout/QuickAddForm.tsx
|
|
568
568
|
function Xe({ config: t, parentEntity: r, parentId: i, schema: a }) {
|
|
569
|
-
let { values: o, quickAdd: s, childEntity: c, isPending: l, error: u, isReady: f, handleSubmit: p, handleFieldChange: m } = Ye(t, r, i, a), h = n(), g = E(), _ =
|
|
570
|
-
return !s || s.fields.length === 0 || !c ? null : /* @__PURE__ */
|
|
569
|
+
let { values: o, quickAdd: s, childEntity: c, isPending: l, error: u, isReady: f, handleSubmit: p, handleFieldChange: m } = Ye(t, r, i, a), h = n(), g = E(), _ = ve();
|
|
570
|
+
return !s || s.fields.length === 0 || !c ? null : /* @__PURE__ */ Y("form", {
|
|
571
571
|
onSubmit: p,
|
|
572
572
|
style: {
|
|
573
573
|
display: "flex",
|
|
@@ -582,13 +582,13 @@ function Xe({ config: t, parentEntity: r, parentId: i, schema: a }) {
|
|
|
582
582
|
let n = c.fields.get(e);
|
|
583
583
|
if (!n) return null;
|
|
584
584
|
let r = `${_}-quick-add-${t.entity}-${e}`, i = `${r}-label`;
|
|
585
|
-
return /* @__PURE__ */
|
|
585
|
+
return /* @__PURE__ */ Y("div", {
|
|
586
586
|
style: {
|
|
587
587
|
flex: 1,
|
|
588
588
|
minWidth: 0,
|
|
589
589
|
width: g.isPhone ? "100%" : void 0
|
|
590
590
|
},
|
|
591
|
-
children: [/* @__PURE__ */
|
|
591
|
+
children: [/* @__PURE__ */ J("label", {
|
|
592
592
|
id: i,
|
|
593
593
|
htmlFor: r,
|
|
594
594
|
style: {
|
|
@@ -612,16 +612,16 @@ function Xe({ config: t, parentEntity: r, parentId: i, schema: a }) {
|
|
|
612
612
|
})]
|
|
613
613
|
}, e);
|
|
614
614
|
}),
|
|
615
|
-
/* @__PURE__ */
|
|
615
|
+
/* @__PURE__ */ J(O, {
|
|
616
616
|
type: "submit",
|
|
617
617
|
kind: "primary",
|
|
618
618
|
size: g.isPhone ? "md" : "sm",
|
|
619
|
-
icon: /* @__PURE__ */
|
|
619
|
+
icon: /* @__PURE__ */ J(e.plus, { size: 12 }),
|
|
620
620
|
disabled: l || !f,
|
|
621
621
|
style: g.isPhone ? { alignSelf: "flex-end" } : void 0,
|
|
622
622
|
children: "Add"
|
|
623
623
|
}),
|
|
624
|
-
u != null && /* @__PURE__ */
|
|
624
|
+
u != null && /* @__PURE__ */ J("span", {
|
|
625
625
|
style: {
|
|
626
626
|
fontSize: 11,
|
|
627
627
|
color: "var(--danger)",
|
|
@@ -639,11 +639,11 @@ function Ze(e, t, n) {
|
|
|
639
639
|
return `${e}::child::${t}.${n}`;
|
|
640
640
|
}
|
|
641
641
|
function Qe(e) {
|
|
642
|
-
return Math.min(
|
|
642
|
+
return Math.min(I, Math.max(60, Math.round(e)));
|
|
643
643
|
}
|
|
644
644
|
function $e(e) {
|
|
645
|
-
let { widths: t, setWidths: n, resetWidths: r } =
|
|
646
|
-
|
|
645
|
+
let { widths: t, setWidths: n, resetWidths: r } = F(e), [i, a] = K({}), o = G(null);
|
|
646
|
+
U(() => {
|
|
647
647
|
let e = (e) => {
|
|
648
648
|
let t = o.current;
|
|
649
649
|
if (!t) return;
|
|
@@ -657,7 +657,7 @@ function $e(e) {
|
|
|
657
657
|
window.removeEventListener("mousemove", e), window.removeEventListener("mouseup", t);
|
|
658
658
|
};
|
|
659
659
|
}, [n]);
|
|
660
|
-
let s =
|
|
660
|
+
let s = H((e, n) => {
|
|
661
661
|
n.preventDefault(), n.stopPropagation();
|
|
662
662
|
let r = n.currentTarget.closest("th")?.getBoundingClientRect().width, i = t[e] ?? (r && r > 0 ? r : 150);
|
|
663
663
|
o.current = {
|
|
@@ -668,7 +668,7 @@ function $e(e) {
|
|
|
668
668
|
};
|
|
669
669
|
}, [t]);
|
|
670
670
|
return {
|
|
671
|
-
headerStyle:
|
|
671
|
+
headerStyle: H((e, n) => {
|
|
672
672
|
let r = i[e] ?? t[e];
|
|
673
673
|
return r == null ? {
|
|
674
674
|
...n,
|
|
@@ -681,7 +681,7 @@ function $e(e) {
|
|
|
681
681
|
maxWidth: r
|
|
682
682
|
};
|
|
683
683
|
}, [i, t]),
|
|
684
|
-
cellStyle:
|
|
684
|
+
cellStyle: H((e, n) => {
|
|
685
685
|
let r = i[e] ?? t[e];
|
|
686
686
|
return r == null ? n : {
|
|
687
687
|
...n,
|
|
@@ -698,7 +698,7 @@ function $e(e) {
|
|
|
698
698
|
};
|
|
699
699
|
}
|
|
700
700
|
function et({ colId: e, onMouseDown: t }) {
|
|
701
|
-
return /* @__PURE__ */
|
|
701
|
+
return /* @__PURE__ */ J("span", {
|
|
702
702
|
"data-testid": "col-resize-handle",
|
|
703
703
|
"aria-hidden": "true",
|
|
704
704
|
onMouseDown: (n) => t(e, n),
|
|
@@ -714,7 +714,7 @@ function et({ colId: e, onMouseDown: t }) {
|
|
|
714
714
|
cursor: "col-resize",
|
|
715
715
|
userSelect: "none"
|
|
716
716
|
},
|
|
717
|
-
children: /* @__PURE__ */
|
|
717
|
+
children: /* @__PURE__ */ J("span", { style: {
|
|
718
718
|
width: 2,
|
|
719
719
|
height: "55%",
|
|
720
720
|
alignSelf: "center",
|
|
@@ -726,9 +726,9 @@ function et({ colId: e, onMouseDown: t }) {
|
|
|
726
726
|
//#endregion
|
|
727
727
|
//#region src/components/detail-layout/ChildrenTable.tsx
|
|
728
728
|
function tt({ config: t, parentEntity: r, parentId: i, schema: a }) {
|
|
729
|
-
let o = a.entities[t.entity], s = Array.isArray(t.foreign_key) ? t.foreign_key.join(",") : t.foreign_key, c = $e(Ze(r, t.entity, s)), f = n(), p =
|
|
729
|
+
let o = a.entities[t.entity], s = Array.isArray(t.foreign_key) ? t.foreign_key.join(",") : t.foreign_key, c = $e(Ze(r, t.entity, s)), f = n(), p = L((e) => e.degradedEntities), { data: m, isLoading: g, isError: _, isFetching: v, refetch: b } = N(r, i, t.entity, t.foreign_key, t.sort, t.limit), x = m?.data ?? [], C = m?.$refs, T = G(C);
|
|
730
730
|
T.current = C;
|
|
731
|
-
let E = t.columns, D = t.interaction === "navigate", O = E[0], k = D && o ? S(void 0, o, a.screens) : null, A = o ? Ge(o) : void 0, j =
|
|
731
|
+
let E = t.columns, D = t.interaction === "navigate", O = E[0], k = D && o ? S(void 0, o, a.screens) : null, A = o ? Ge(o) : void 0, j = W(() => {
|
|
732
732
|
let e = /* @__PURE__ */ new Map();
|
|
733
733
|
if (!o) return e;
|
|
734
734
|
for (let t of E) {
|
|
@@ -752,7 +752,7 @@ function tt({ config: t, parentEntity: r, parentId: i, schema: a }) {
|
|
|
752
752
|
a.screens,
|
|
753
753
|
f
|
|
754
754
|
]);
|
|
755
|
-
if (!o) return /* @__PURE__ */
|
|
755
|
+
if (!o) return /* @__PURE__ */ J("div", {
|
|
756
756
|
style: {
|
|
757
757
|
fontSize: 12.5,
|
|
758
758
|
color: "var(--text-3)",
|
|
@@ -760,12 +760,12 @@ function tt({ config: t, parentEntity: r, parentId: i, schema: a }) {
|
|
|
760
760
|
},
|
|
761
761
|
children: "Entity not found."
|
|
762
762
|
});
|
|
763
|
-
let M = /* @__PURE__ */
|
|
763
|
+
let M = /* @__PURE__ */ J(Xe, {
|
|
764
764
|
config: t,
|
|
765
765
|
parentEntity: r,
|
|
766
766
|
parentId: i,
|
|
767
767
|
schema: a
|
|
768
|
-
}), ee =
|
|
768
|
+
}), ee = P(o.realtime, p, t.entity), F = /* @__PURE__ */ Y("div", {
|
|
769
769
|
style: {
|
|
770
770
|
display: "flex",
|
|
771
771
|
alignItems: "center",
|
|
@@ -774,28 +774,28 @@ function tt({ config: t, parentEntity: r, parentId: i, schema: a }) {
|
|
|
774
774
|
justifyContent: "flex-end"
|
|
775
775
|
},
|
|
776
776
|
children: [
|
|
777
|
-
c.hasWidths && /* @__PURE__ */
|
|
778
|
-
icon: /* @__PURE__ */
|
|
777
|
+
c.hasWidths && /* @__PURE__ */ J(w, {
|
|
778
|
+
icon: /* @__PURE__ */ J(e.columns, { size: 13 }),
|
|
779
779
|
title: "Reset column widths (this device)",
|
|
780
780
|
size: 24,
|
|
781
781
|
onClick: c.resetWidths
|
|
782
782
|
}),
|
|
783
|
-
ee && /* @__PURE__ */
|
|
783
|
+
ee && /* @__PURE__ */ J("span", {
|
|
784
784
|
"data-testid": "children-live-indicator",
|
|
785
785
|
title: "This table updates automatically in realtime.",
|
|
786
|
-
children: /* @__PURE__ */
|
|
786
|
+
children: /* @__PURE__ */ J(y, {
|
|
787
787
|
tone: "emerald",
|
|
788
788
|
size: "xs",
|
|
789
789
|
dot: !0,
|
|
790
790
|
children: "Live"
|
|
791
791
|
})
|
|
792
792
|
}),
|
|
793
|
-
/* @__PURE__ */
|
|
794
|
-
icon: v ? /* @__PURE__ */
|
|
793
|
+
/* @__PURE__ */ J(w, {
|
|
794
|
+
icon: v ? /* @__PURE__ */ J("span", {
|
|
795
795
|
"data-testid": "children-refresh-spinner",
|
|
796
796
|
style: { display: "inline-flex" },
|
|
797
|
-
children: /* @__PURE__ */
|
|
798
|
-
}) : /* @__PURE__ */
|
|
797
|
+
children: /* @__PURE__ */ J(h, { size: 13 })
|
|
798
|
+
}) : /* @__PURE__ */ J(e.refresh, { size: 13 }),
|
|
799
799
|
title: "Refresh",
|
|
800
800
|
size: 24,
|
|
801
801
|
disabled: v,
|
|
@@ -805,10 +805,10 @@ function tt({ config: t, parentEntity: r, parentId: i, schema: a }) {
|
|
|
805
805
|
})
|
|
806
806
|
]
|
|
807
807
|
});
|
|
808
|
-
return _ ? /* @__PURE__ */
|
|
808
|
+
return _ ? /* @__PURE__ */ Y("div", { children: [
|
|
809
809
|
M,
|
|
810
|
-
|
|
811
|
-
/* @__PURE__ */
|
|
810
|
+
F,
|
|
811
|
+
/* @__PURE__ */ J("div", {
|
|
812
812
|
style: {
|
|
813
813
|
fontSize: 12.5,
|
|
814
814
|
color: "var(--danger)",
|
|
@@ -816,10 +816,10 @@ function tt({ config: t, parentEntity: r, parentId: i, schema: a }) {
|
|
|
816
816
|
},
|
|
817
817
|
children: "Failed to load. Try again."
|
|
818
818
|
})
|
|
819
|
-
] }) : g ? /* @__PURE__ */
|
|
819
|
+
] }) : g ? /* @__PURE__ */ Y("div", { children: [
|
|
820
820
|
M,
|
|
821
|
-
|
|
822
|
-
/* @__PURE__ */
|
|
821
|
+
F,
|
|
822
|
+
/* @__PURE__ */ J("div", {
|
|
823
823
|
style: {
|
|
824
824
|
display: "flex",
|
|
825
825
|
flexDirection: "column",
|
|
@@ -830,16 +830,16 @@ function tt({ config: t, parentEntity: r, parentId: i, schema: a }) {
|
|
|
830
830
|
0,
|
|
831
831
|
1,
|
|
832
832
|
2
|
|
833
|
-
].map((e) => /* @__PURE__ */
|
|
833
|
+
].map((e) => /* @__PURE__ */ J("div", { style: {
|
|
834
834
|
height: 32,
|
|
835
835
|
background: "var(--surface-3)",
|
|
836
836
|
borderRadius: 4
|
|
837
837
|
} }, e))
|
|
838
838
|
})
|
|
839
|
-
] }) : x.length === 0 ? /* @__PURE__ */
|
|
839
|
+
] }) : x.length === 0 ? /* @__PURE__ */ Y("div", { children: [
|
|
840
840
|
M,
|
|
841
|
-
|
|
842
|
-
/* @__PURE__ */
|
|
841
|
+
F,
|
|
842
|
+
/* @__PURE__ */ J("div", {
|
|
843
843
|
style: {
|
|
844
844
|
fontSize: 12.5,
|
|
845
845
|
color: "var(--text-3)",
|
|
@@ -847,30 +847,30 @@ function tt({ config: t, parentEntity: r, parentId: i, schema: a }) {
|
|
|
847
847
|
},
|
|
848
848
|
children: "No records yet."
|
|
849
849
|
})
|
|
850
|
-
] }) : /* @__PURE__ */
|
|
850
|
+
] }) : /* @__PURE__ */ Y("div", { children: [
|
|
851
851
|
M,
|
|
852
|
-
|
|
853
|
-
/* @__PURE__ */
|
|
852
|
+
F,
|
|
853
|
+
/* @__PURE__ */ J("div", {
|
|
854
854
|
style: { overflowX: "auto" },
|
|
855
|
-
children: /* @__PURE__ */
|
|
856
|
-
style:
|
|
857
|
-
children: [/* @__PURE__ */
|
|
855
|
+
children: /* @__PURE__ */ Y("table", {
|
|
856
|
+
style: fe,
|
|
857
|
+
children: [/* @__PURE__ */ J("thead", { children: /* @__PURE__ */ J("tr", { children: E.map((e) => {
|
|
858
858
|
let t = o.fields.get(e);
|
|
859
|
-
return /* @__PURE__ */
|
|
860
|
-
style: c.headerStyle(e,
|
|
861
|
-
children: [t ? d(t, e, a.entities) : e, /* @__PURE__ */
|
|
859
|
+
return /* @__PURE__ */ Y("th", {
|
|
860
|
+
style: c.headerStyle(e, de),
|
|
861
|
+
children: [t ? d(t, e, a.entities) : e, /* @__PURE__ */ J(et, {
|
|
862
862
|
colId: e,
|
|
863
863
|
onMouseDown: c.onHandleMouseDown
|
|
864
864
|
})]
|
|
865
865
|
}, e);
|
|
866
|
-
}) }) }), /* @__PURE__ */
|
|
866
|
+
}) }) }), /* @__PURE__ */ J("tbody", { children: x.map((e, t) => {
|
|
867
867
|
let n = A ? l(e[A]) : "", r = D && k && n ? k.replace(/:\w+/, n) : void 0;
|
|
868
|
-
return /* @__PURE__ */
|
|
868
|
+
return /* @__PURE__ */ J("tr", { children: E.map((t) => {
|
|
869
869
|
let n = t === O, i = j.get(t), a = i ? i(e[t], e) : l(e[t]);
|
|
870
|
-
return /* @__PURE__ */
|
|
870
|
+
return /* @__PURE__ */ J("td", {
|
|
871
871
|
title: typeof a == "string" ? a : void 0,
|
|
872
|
-
style: c.cellStyle(t,
|
|
873
|
-
children: n && r ? /* @__PURE__ */
|
|
872
|
+
style: c.cellStyle(t, pe),
|
|
873
|
+
children: n && r ? /* @__PURE__ */ J("a", {
|
|
874
874
|
href: r,
|
|
875
875
|
style: {
|
|
876
876
|
color: "var(--accent)",
|
|
@@ -891,8 +891,8 @@ function tt({ config: t, parentEntity: r, parentId: i, schema: a }) {
|
|
|
891
891
|
//#endregion
|
|
892
892
|
//#region src/components/detail-layout/ChildrenList.tsx
|
|
893
893
|
function nt({ config: e, parentEntity: t, parentId: r, schema: i }) {
|
|
894
|
-
let a = i.entities[e.entity], o = n(), { data: s, isLoading: c, isError: u } =
|
|
895
|
-
if (!a) return /* @__PURE__ */
|
|
894
|
+
let a = i.entities[e.entity], o = n(), { data: s, isLoading: c, isError: u } = N(t, r, e.entity, e.foreign_key, e.sort, e.limit), d = s?.data ?? [], f = s?.$refs, p = e.columns;
|
|
895
|
+
if (!a) return /* @__PURE__ */ J("div", {
|
|
896
896
|
style: {
|
|
897
897
|
fontSize: 12.5,
|
|
898
898
|
color: "var(--text-3)",
|
|
@@ -900,13 +900,13 @@ function nt({ config: e, parentEntity: t, parentId: r, schema: i }) {
|
|
|
900
900
|
},
|
|
901
901
|
children: "Entity not found."
|
|
902
902
|
});
|
|
903
|
-
let m = /* @__PURE__ */
|
|
903
|
+
let m = /* @__PURE__ */ J(Xe, {
|
|
904
904
|
config: e,
|
|
905
905
|
parentEntity: t,
|
|
906
906
|
parentId: r,
|
|
907
907
|
schema: i
|
|
908
908
|
});
|
|
909
|
-
if (u) return /* @__PURE__ */
|
|
909
|
+
if (u) return /* @__PURE__ */ Y("div", { children: [m, /* @__PURE__ */ J("div", {
|
|
910
910
|
style: {
|
|
911
911
|
fontSize: 12.5,
|
|
912
912
|
color: "var(--danger)",
|
|
@@ -914,7 +914,7 @@ function nt({ config: e, parentEntity: t, parentId: r, schema: i }) {
|
|
|
914
914
|
},
|
|
915
915
|
children: "Failed to load. Try again."
|
|
916
916
|
})] });
|
|
917
|
-
if (c) return /* @__PURE__ */
|
|
917
|
+
if (c) return /* @__PURE__ */ Y("div", { children: [m, /* @__PURE__ */ Y("div", {
|
|
918
918
|
style: {
|
|
919
919
|
display: "flex",
|
|
920
920
|
flexDirection: "column",
|
|
@@ -922,17 +922,17 @@ function nt({ config: e, parentEntity: t, parentId: r, schema: i }) {
|
|
|
922
922
|
padding: "8px 0"
|
|
923
923
|
},
|
|
924
924
|
children: [
|
|
925
|
-
/* @__PURE__ */
|
|
925
|
+
/* @__PURE__ */ J("div", { style: {
|
|
926
926
|
height: 22,
|
|
927
927
|
background: "var(--surface-3)",
|
|
928
928
|
borderRadius: 4
|
|
929
929
|
} }),
|
|
930
|
-
/* @__PURE__ */
|
|
930
|
+
/* @__PURE__ */ J("div", { style: {
|
|
931
931
|
height: 22,
|
|
932
932
|
background: "var(--surface-3)",
|
|
933
933
|
borderRadius: 4
|
|
934
934
|
} }),
|
|
935
|
-
/* @__PURE__ */
|
|
935
|
+
/* @__PURE__ */ J("div", { style: {
|
|
936
936
|
height: 22,
|
|
937
937
|
background: "var(--surface-3)",
|
|
938
938
|
borderRadius: 4,
|
|
@@ -940,7 +940,7 @@ function nt({ config: e, parentEntity: t, parentId: r, schema: i }) {
|
|
|
940
940
|
} })
|
|
941
941
|
]
|
|
942
942
|
})] });
|
|
943
|
-
if (d.length === 0) return /* @__PURE__ */
|
|
943
|
+
if (d.length === 0) return /* @__PURE__ */ Y("div", { children: [m, /* @__PURE__ */ J("div", {
|
|
944
944
|
style: {
|
|
945
945
|
fontSize: 12.5,
|
|
946
946
|
color: "var(--text-3)",
|
|
@@ -949,70 +949,73 @@ function nt({ config: e, parentEntity: t, parentId: r, schema: i }) {
|
|
|
949
949
|
children: "No records yet."
|
|
950
950
|
})] });
|
|
951
951
|
let h = p.length > 0 ? a.display.display_field ?? p[0] : a.display.display_field;
|
|
952
|
-
return /* @__PURE__ */
|
|
952
|
+
return /* @__PURE__ */ Y("div", { children: [m, /* @__PURE__ */ J("div", {
|
|
953
953
|
style: {
|
|
954
954
|
display: "flex",
|
|
955
955
|
flexDirection: "column"
|
|
956
956
|
},
|
|
957
|
-
children: d.map((e, t) =>
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
alignItems: "center",
|
|
961
|
-
gap: 12,
|
|
962
|
-
padding: "8px 4px",
|
|
963
|
-
borderBottom: "1px solid var(--divider)"
|
|
964
|
-
},
|
|
965
|
-
children: /* @__PURE__ */ J("div", {
|
|
957
|
+
children: d.map((e, t) => {
|
|
958
|
+
let n = typeof e.$display == "string" ? e[T] : "";
|
|
959
|
+
return /* @__PURE__ */ J("div", {
|
|
966
960
|
style: {
|
|
967
|
-
|
|
968
|
-
|
|
961
|
+
display: "flex",
|
|
962
|
+
alignItems: "center",
|
|
963
|
+
gap: 12,
|
|
964
|
+
padding: "8px 4px",
|
|
965
|
+
borderBottom: "1px solid var(--divider)"
|
|
969
966
|
},
|
|
970
|
-
children:
|
|
967
|
+
children: /* @__PURE__ */ Y("div", {
|
|
971
968
|
style: {
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
textOverflow: "ellipsis",
|
|
975
|
-
whiteSpace: "nowrap"
|
|
969
|
+
flex: 1,
|
|
970
|
+
minWidth: 0
|
|
976
971
|
},
|
|
977
|
-
children:
|
|
978
|
-
field: a.fields.get(h),
|
|
979
|
-
fieldName: h,
|
|
980
|
-
value: e[h],
|
|
981
|
-
mode: "display",
|
|
982
|
-
record: e,
|
|
983
|
-
refs: f,
|
|
984
|
-
locale: o
|
|
985
|
-
}) : h && e[h] != null ? l(e[h]) : null)
|
|
986
|
-
}), p.length > 1 && (() => {
|
|
987
|
-
let t = p.slice(1, 3).filter((t) => e[t] != null);
|
|
988
|
-
return t.length === 0 ? null : /* @__PURE__ */ q("div", {
|
|
972
|
+
children: [/* @__PURE__ */ J("div", {
|
|
989
973
|
style: {
|
|
990
|
-
fontSize:
|
|
991
|
-
color: "var(--text-3)",
|
|
974
|
+
fontSize: 12.5,
|
|
992
975
|
overflow: "hidden",
|
|
993
976
|
textOverflow: "ellipsis",
|
|
994
977
|
whiteSpace: "nowrap"
|
|
995
978
|
},
|
|
996
|
-
children:
|
|
997
|
-
field: a.fields.get(
|
|
998
|
-
fieldName:
|
|
999
|
-
value: e[
|
|
979
|
+
children: n || (h && a.fields.get(h) ? x({
|
|
980
|
+
field: a.fields.get(h),
|
|
981
|
+
fieldName: h,
|
|
982
|
+
value: e[h],
|
|
1000
983
|
mode: "display",
|
|
1001
984
|
record: e,
|
|
1002
985
|
refs: f,
|
|
1003
986
|
locale: o
|
|
1004
|
-
}) :
|
|
1005
|
-
})
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
987
|
+
}) : h && e[h] != null ? l(e[h]) : null)
|
|
988
|
+
}), p.length > 1 && (() => {
|
|
989
|
+
let t = p.slice(1, 3).filter((t) => e[t] != null);
|
|
990
|
+
return t.length === 0 ? null : /* @__PURE__ */ J("div", {
|
|
991
|
+
style: {
|
|
992
|
+
fontSize: 11.5,
|
|
993
|
+
color: "var(--text-3)",
|
|
994
|
+
overflow: "hidden",
|
|
995
|
+
textOverflow: "ellipsis",
|
|
996
|
+
whiteSpace: "nowrap"
|
|
997
|
+
},
|
|
998
|
+
children: t.map((t, n) => /* @__PURE__ */ Y("span", { children: [n > 0 && " · ", a.fields.get(t) ? x({
|
|
999
|
+
field: a.fields.get(t),
|
|
1000
|
+
fieldName: t,
|
|
1001
|
+
value: e[t],
|
|
1002
|
+
mode: "display",
|
|
1003
|
+
record: e,
|
|
1004
|
+
refs: f,
|
|
1005
|
+
locale: o
|
|
1006
|
+
}) : String(e[t])] }, t))
|
|
1007
|
+
});
|
|
1008
|
+
})()]
|
|
1009
|
+
})
|
|
1010
|
+
}, l(e.id ?? t));
|
|
1011
|
+
})
|
|
1009
1012
|
})] });
|
|
1010
1013
|
}
|
|
1011
1014
|
//#endregion
|
|
1012
1015
|
//#region src/components/detail-layout/ChildrenCards.tsx
|
|
1013
1016
|
function rt({ config: e, parentEntity: t, parentId: r, schema: i }) {
|
|
1014
|
-
let a = i.entities[e.entity], o = n(), { data: s, isLoading: c, isError: u } =
|
|
1015
|
-
if (!a) return /* @__PURE__ */
|
|
1017
|
+
let a = i.entities[e.entity], o = n(), { data: s, isLoading: c, isError: u } = N(t, r, e.entity, e.foreign_key, e.sort, e.limit), d = s?.data ?? [], f = s?.$refs, p = e.columns, m = e.cards, h = m?.header_field ?? p[0], g = m?.badge_field, _ = m?.columns_count ?? 3;
|
|
1018
|
+
if (!a) return /* @__PURE__ */ J("div", {
|
|
1016
1019
|
style: {
|
|
1017
1020
|
fontSize: 12.5,
|
|
1018
1021
|
color: "var(--text-3)",
|
|
@@ -1024,13 +1027,13 @@ function rt({ config: e, parentEntity: t, parentId: r, schema: i }) {
|
|
|
1024
1027
|
display: "grid",
|
|
1025
1028
|
gridTemplateColumns: `repeat(auto-fill, minmax(${_ >= 4 ? 180 : 240}px, 1fr))`,
|
|
1026
1029
|
gap: 12
|
|
1027
|
-
}, b = /* @__PURE__ */
|
|
1030
|
+
}, b = /* @__PURE__ */ J(Xe, {
|
|
1028
1031
|
config: e,
|
|
1029
1032
|
parentEntity: t,
|
|
1030
1033
|
parentId: r,
|
|
1031
1034
|
schema: i
|
|
1032
1035
|
});
|
|
1033
|
-
if (u) return /* @__PURE__ */
|
|
1036
|
+
if (u) return /* @__PURE__ */ Y("div", { children: [b, /* @__PURE__ */ J("div", {
|
|
1034
1037
|
style: {
|
|
1035
1038
|
fontSize: 12.5,
|
|
1036
1039
|
color: "var(--danger)",
|
|
@@ -1038,19 +1041,19 @@ function rt({ config: e, parentEntity: t, parentId: r, schema: i }) {
|
|
|
1038
1041
|
},
|
|
1039
1042
|
children: "Failed to load. Try again."
|
|
1040
1043
|
})] });
|
|
1041
|
-
if (c) return /* @__PURE__ */
|
|
1044
|
+
if (c) return /* @__PURE__ */ Y("div", { children: [b, /* @__PURE__ */ J("div", {
|
|
1042
1045
|
style: v,
|
|
1043
1046
|
children: [
|
|
1044
1047
|
0,
|
|
1045
1048
|
1,
|
|
1046
1049
|
2
|
|
1047
|
-
].map((e) => /* @__PURE__ */
|
|
1050
|
+
].map((e) => /* @__PURE__ */ J("div", { style: {
|
|
1048
1051
|
height: 96,
|
|
1049
1052
|
background: "var(--surface-3)",
|
|
1050
1053
|
borderRadius: 10
|
|
1051
1054
|
} }, e))
|
|
1052
1055
|
})] });
|
|
1053
|
-
if (d.length === 0) return /* @__PURE__ */
|
|
1056
|
+
if (d.length === 0) return /* @__PURE__ */ Y("div", { children: [b, /* @__PURE__ */ J("div", {
|
|
1054
1057
|
style: {
|
|
1055
1058
|
fontSize: 12.5,
|
|
1056
1059
|
color: "var(--text-3)",
|
|
@@ -1059,16 +1062,16 @@ function rt({ config: e, parentEntity: t, parentId: r, schema: i }) {
|
|
|
1059
1062
|
children: "No records yet."
|
|
1060
1063
|
})] });
|
|
1061
1064
|
let S = p.filter((e) => e !== h && e !== g);
|
|
1062
|
-
return /* @__PURE__ */
|
|
1065
|
+
return /* @__PURE__ */ Y("div", { children: [b, /* @__PURE__ */ J("div", {
|
|
1063
1066
|
style: v,
|
|
1064
|
-
children: d.map((t, n) => /* @__PURE__ */
|
|
1067
|
+
children: d.map((t, n) => /* @__PURE__ */ Y("div", {
|
|
1065
1068
|
style: {
|
|
1066
1069
|
background: "var(--surface)",
|
|
1067
1070
|
border: "1px solid var(--border)",
|
|
1068
1071
|
borderRadius: 10,
|
|
1069
1072
|
overflow: "hidden"
|
|
1070
1073
|
},
|
|
1071
|
-
children: [/* @__PURE__ */
|
|
1074
|
+
children: [/* @__PURE__ */ Y("div", {
|
|
1072
1075
|
style: {
|
|
1073
1076
|
padding: "10px 14px",
|
|
1074
1077
|
display: "flex",
|
|
@@ -1077,7 +1080,7 @@ function rt({ config: e, parentEntity: t, parentId: r, schema: i }) {
|
|
|
1077
1080
|
gap: 8,
|
|
1078
1081
|
borderBottom: S.length > 0 ? "1px solid var(--divider)" : "none"
|
|
1079
1082
|
},
|
|
1080
|
-
children: [/* @__PURE__ */
|
|
1083
|
+
children: [/* @__PURE__ */ J("div", {
|
|
1081
1084
|
style: {
|
|
1082
1085
|
fontSize: 12.5,
|
|
1083
1086
|
fontWeight: 600,
|
|
@@ -1094,7 +1097,7 @@ function rt({ config: e, parentEntity: t, parentId: r, schema: i }) {
|
|
|
1094
1097
|
refs: f,
|
|
1095
1098
|
locale: o
|
|
1096
1099
|
}) : `Record ${n + 1}`
|
|
1097
|
-
}), g && t[g] != null && /* @__PURE__ */
|
|
1100
|
+
}), g && t[g] != null && /* @__PURE__ */ J(y, {
|
|
1098
1101
|
tone: "slate",
|
|
1099
1102
|
size: "xs",
|
|
1100
1103
|
children: a.fields.get(g) ? x({
|
|
@@ -1107,7 +1110,7 @@ function rt({ config: e, parentEntity: t, parentId: r, schema: i }) {
|
|
|
1107
1110
|
locale: o
|
|
1108
1111
|
}) : l(t[g])
|
|
1109
1112
|
})]
|
|
1110
|
-
}), S.length > 0 && /* @__PURE__ */
|
|
1113
|
+
}), S.length > 0 && /* @__PURE__ */ J("div", {
|
|
1111
1114
|
style: {
|
|
1112
1115
|
padding: "10px 14px",
|
|
1113
1116
|
display: "flex",
|
|
@@ -1116,20 +1119,20 @@ function rt({ config: e, parentEntity: t, parentId: r, schema: i }) {
|
|
|
1116
1119
|
},
|
|
1117
1120
|
children: S.slice(0, 4).map((n) => {
|
|
1118
1121
|
let r = a.fields.get(n);
|
|
1119
|
-
return r ? /* @__PURE__ */
|
|
1122
|
+
return r ? /* @__PURE__ */ Y("div", {
|
|
1120
1123
|
style: {
|
|
1121
1124
|
display: "flex",
|
|
1122
1125
|
alignItems: "baseline",
|
|
1123
1126
|
gap: 8,
|
|
1124
1127
|
fontSize: 11.5
|
|
1125
1128
|
},
|
|
1126
|
-
children: [/* @__PURE__ */
|
|
1129
|
+
children: [/* @__PURE__ */ Y("span", {
|
|
1127
1130
|
style: {
|
|
1128
1131
|
color: "var(--text-3)",
|
|
1129
1132
|
flexShrink: 0
|
|
1130
1133
|
},
|
|
1131
1134
|
children: [i.entities[e.entity]?.fields.get(n)?.display?.name ? Object.values(i.entities[e.entity].fields.get(n).display.name)[0] : n, ":"]
|
|
1132
|
-
}), /* @__PURE__ */
|
|
1135
|
+
}), /* @__PURE__ */ J("span", {
|
|
1133
1136
|
style: {
|
|
1134
1137
|
overflow: "hidden",
|
|
1135
1138
|
textOverflow: "ellipsis",
|
|
@@ -1155,9 +1158,9 @@ function rt({ config: e, parentEntity: t, parentId: r, schema: i }) {
|
|
|
1155
1158
|
//#region src/hooks/useTimelineData.ts
|
|
1156
1159
|
var it = 50;
|
|
1157
1160
|
function at(e, t, n, r, a, s) {
|
|
1158
|
-
let c = Array.isArray(r) ? r : [r], l = Array.isArray(r) ? i(t, c.length) : [t], u = s ?? it, d =
|
|
1161
|
+
let c = Array.isArray(r) ? r : [r], l = Array.isArray(r) ? i(t, c.length) : [t], u = s ?? it, d = be({
|
|
1159
1162
|
queryKey: [
|
|
1160
|
-
|
|
1163
|
+
te,
|
|
1161
1164
|
e,
|
|
1162
1165
|
t,
|
|
1163
1166
|
n,
|
|
@@ -1180,7 +1183,7 @@ function at(e, t, n, r, a, s) {
|
|
|
1180
1183
|
enabled: !!e && !!t && !!n && !!r && l !== null
|
|
1181
1184
|
});
|
|
1182
1185
|
return {
|
|
1183
|
-
rows:
|
|
1186
|
+
rows: W(() => d.data?.pages.flatMap((e) => e.data) ?? [], [d.data?.pages]),
|
|
1184
1187
|
refs: d.data?.pages[0]?.$refs,
|
|
1185
1188
|
fetchNextPage: d.fetchNextPage,
|
|
1186
1189
|
hasOlder: !!d.hasNextPage,
|
|
@@ -1193,8 +1196,8 @@ function at(e, t, n, r, a, s) {
|
|
|
1193
1196
|
//#region src/components/detail-layout/TimelineComposer.tsx
|
|
1194
1197
|
var ot = "quick_entry", st = 100, ct = 240, lt = 800, ut = 80;
|
|
1195
1198
|
function dt({ config: t, parentEntity: r, parentId: i, schema: a }) {
|
|
1196
|
-
let { values: o, quickAdd: s, childEntity: c, isPending: l, error: u, isReady: d, handleSubmit: f, handleFieldChange: p } = Ye(t, r, i, a), m = n(), [h, g] =
|
|
1197
|
-
|
|
1199
|
+
let { values: o, quickAdd: s, childEntity: c, isPending: l, error: u, isReady: d, handleSubmit: f, handleFieldChange: p } = Ye(t, r, i, a), m = n(), [h, g] = K(ct), _ = G(null), v = G(null), [y, S] = K(lt);
|
|
1200
|
+
U(() => {
|
|
1198
1201
|
let e = v.current?.parentElement;
|
|
1199
1202
|
if (!e) return;
|
|
1200
1203
|
let t = () => {
|
|
@@ -1204,14 +1207,14 @@ function dt({ config: t, parentEntity: r, parentId: i, schema: a }) {
|
|
|
1204
1207
|
t();
|
|
1205
1208
|
let n = new ResizeObserver(t);
|
|
1206
1209
|
return n.observe(e), () => n.disconnect();
|
|
1207
|
-
}, []),
|
|
1210
|
+
}, []), U(() => {
|
|
1208
1211
|
g((e) => Math.min(e, y));
|
|
1209
1212
|
}, [y]);
|
|
1210
|
-
let C =
|
|
1213
|
+
let C = G(o);
|
|
1211
1214
|
C.current = o;
|
|
1212
|
-
let w =
|
|
1215
|
+
let w = G(p);
|
|
1213
1216
|
w.current = p;
|
|
1214
|
-
let T =
|
|
1217
|
+
let T = G({}), E = W(() => ({
|
|
1215
1218
|
getField: (e) => C.current[e],
|
|
1216
1219
|
setField: (e, t) => {
|
|
1217
1220
|
w.current(e, t);
|
|
@@ -1221,8 +1224,8 @@ function dt({ config: t, parentEntity: r, parentId: i, schema: a }) {
|
|
|
1221
1224
|
t && (t.querySelector("textarea, input, select, [contenteditable]") ?? t).focus();
|
|
1222
1225
|
}
|
|
1223
1226
|
}), []);
|
|
1224
|
-
|
|
1225
|
-
let D =
|
|
1227
|
+
U(() => b(ot, E), [E]);
|
|
1228
|
+
let D = H((e) => {
|
|
1226
1229
|
e.preventDefault(), _.current = {
|
|
1227
1230
|
startY: e.clientY,
|
|
1228
1231
|
startHeight: h
|
|
@@ -1248,7 +1251,7 @@ function dt({ config: t, parentEntity: r, parentId: i, schema: a }) {
|
|
|
1248
1251
|
}
|
|
1249
1252
|
let M = (e) => {
|
|
1250
1253
|
let t = c.fields.get(e);
|
|
1251
|
-
return t ? /* @__PURE__ */
|
|
1254
|
+
return t ? /* @__PURE__ */ J("div", {
|
|
1252
1255
|
ref: (t) => {
|
|
1253
1256
|
T.current[e] = t;
|
|
1254
1257
|
},
|
|
@@ -1263,7 +1266,7 @@ function dt({ config: t, parentEntity: r, parentId: i, schema: a }) {
|
|
|
1263
1266
|
})
|
|
1264
1267
|
}, e) : null;
|
|
1265
1268
|
};
|
|
1266
|
-
return /* @__PURE__ */
|
|
1269
|
+
return /* @__PURE__ */ Y("div", {
|
|
1267
1270
|
ref: v,
|
|
1268
1271
|
style: {
|
|
1269
1272
|
flexShrink: 0,
|
|
@@ -1273,7 +1276,7 @@ function dt({ config: t, parentEntity: r, parentId: i, schema: a }) {
|
|
|
1273
1276
|
flexDirection: "column",
|
|
1274
1277
|
height: `${h}px`
|
|
1275
1278
|
},
|
|
1276
|
-
children: [/* @__PURE__ */
|
|
1279
|
+
children: [/* @__PURE__ */ J("div", {
|
|
1277
1280
|
onMouseDown: D,
|
|
1278
1281
|
title: "Drag to resize",
|
|
1279
1282
|
style: {
|
|
@@ -1284,13 +1287,13 @@ function dt({ config: t, parentEntity: r, parentId: i, schema: a }) {
|
|
|
1284
1287
|
justifyContent: "center",
|
|
1285
1288
|
flexShrink: 0
|
|
1286
1289
|
},
|
|
1287
|
-
children: /* @__PURE__ */
|
|
1290
|
+
children: /* @__PURE__ */ J("div", { style: {
|
|
1288
1291
|
width: 56,
|
|
1289
1292
|
height: 3,
|
|
1290
1293
|
borderRadius: 999,
|
|
1291
1294
|
background: "var(--border)"
|
|
1292
1295
|
} })
|
|
1293
|
-
}), /* @__PURE__ */
|
|
1296
|
+
}), /* @__PURE__ */ Y("form", {
|
|
1294
1297
|
onSubmit: f,
|
|
1295
1298
|
onKeyDown: (e) => {
|
|
1296
1299
|
(e.metaKey || e.ctrlKey) && e.key === "Enter" && (e.preventDefault(), e.currentTarget.requestSubmit());
|
|
@@ -1304,7 +1307,7 @@ function dt({ config: t, parentEntity: r, parentId: i, schema: a }) {
|
|
|
1304
1307
|
padding: "0 12px 8px"
|
|
1305
1308
|
},
|
|
1306
1309
|
children: [
|
|
1307
|
-
A.length > 0 && /* @__PURE__ */
|
|
1310
|
+
A.length > 0 && /* @__PURE__ */ J("div", {
|
|
1308
1311
|
style: {
|
|
1309
1312
|
display: "flex",
|
|
1310
1313
|
flexWrap: "wrap",
|
|
@@ -1314,7 +1317,7 @@ function dt({ config: t, parentEntity: r, parentId: i, schema: a }) {
|
|
|
1314
1317
|
},
|
|
1315
1318
|
children: A.map(M)
|
|
1316
1319
|
}),
|
|
1317
|
-
k && c.fields.get(k) && /* @__PURE__ */
|
|
1320
|
+
k && c.fields.get(k) && /* @__PURE__ */ J("div", {
|
|
1318
1321
|
style: {
|
|
1319
1322
|
flex: 1,
|
|
1320
1323
|
minHeight: 0,
|
|
@@ -1334,7 +1337,7 @@ function dt({ config: t, parentEntity: r, parentId: i, schema: a }) {
|
|
|
1334
1337
|
locale: m
|
|
1335
1338
|
})
|
|
1336
1339
|
}),
|
|
1337
|
-
/* @__PURE__ */
|
|
1340
|
+
/* @__PURE__ */ Y("div", {
|
|
1338
1341
|
style: {
|
|
1339
1342
|
display: "flex",
|
|
1340
1343
|
flexWrap: "wrap",
|
|
@@ -1342,39 +1345,39 @@ function dt({ config: t, parentEntity: r, parentId: i, schema: a }) {
|
|
|
1342
1345
|
gap: 6,
|
|
1343
1346
|
flexShrink: 0
|
|
1344
1347
|
},
|
|
1345
|
-
children: [j.map(M), /* @__PURE__ */
|
|
1348
|
+
children: [j.map(M), /* @__PURE__ */ Y("div", {
|
|
1346
1349
|
style: {
|
|
1347
1350
|
marginLeft: "auto",
|
|
1348
1351
|
display: "flex",
|
|
1349
1352
|
alignItems: "center",
|
|
1350
1353
|
gap: 8
|
|
1351
1354
|
},
|
|
1352
|
-
children: [/* @__PURE__ */
|
|
1355
|
+
children: [/* @__PURE__ */ Y("span", {
|
|
1353
1356
|
style: {
|
|
1354
1357
|
fontSize: 10.5,
|
|
1355
1358
|
color: "var(--text-4)"
|
|
1356
1359
|
},
|
|
1357
1360
|
children: [
|
|
1358
|
-
/* @__PURE__ */
|
|
1361
|
+
/* @__PURE__ */ J("span", {
|
|
1359
1362
|
className: "mono",
|
|
1360
1363
|
children: "⌘"
|
|
1361
1364
|
}),
|
|
1362
|
-
/* @__PURE__ */
|
|
1365
|
+
/* @__PURE__ */ J("span", {
|
|
1363
1366
|
className: "mono",
|
|
1364
1367
|
children: "↵"
|
|
1365
1368
|
}),
|
|
1366
1369
|
" to add"
|
|
1367
1370
|
]
|
|
1368
|
-
}), /* @__PURE__ */
|
|
1371
|
+
}), /* @__PURE__ */ J(O, {
|
|
1369
1372
|
type: "submit",
|
|
1370
1373
|
kind: "primary",
|
|
1371
|
-
icon: /* @__PURE__ */
|
|
1374
|
+
icon: /* @__PURE__ */ J(e.plus, { size: 13 }),
|
|
1372
1375
|
disabled: l || !d,
|
|
1373
1376
|
children: "Add"
|
|
1374
1377
|
})]
|
|
1375
1378
|
})]
|
|
1376
1379
|
}),
|
|
1377
|
-
u != null && /* @__PURE__ */
|
|
1380
|
+
u != null && /* @__PURE__ */ J("p", {
|
|
1378
1381
|
style: {
|
|
1379
1382
|
fontSize: 11,
|
|
1380
1383
|
color: "var(--danger)",
|
|
@@ -1407,15 +1410,15 @@ function yt(e) {
|
|
|
1407
1410
|
return e.__optimistic === !0;
|
|
1408
1411
|
}
|
|
1409
1412
|
function bt({ config: e, parentEntity: t, parentId: n, schema: r }) {
|
|
1410
|
-
let i = r.entities[e.entity], { rows: a, refs: o, fetchNextPage: s, hasOlder: c, isFetchingOlder: l, isLoading: u, isError: d } = at(t, n, e.entity, e.foreign_key, e.timeline?.time_field, e.limit), p = e.timeline, m = p?.scroll ?? !1, g = (e.sort ?? "").endsWith(":asc"), _ =
|
|
1411
|
-
|
|
1413
|
+
let i = r.entities[e.entity], { rows: a, refs: o, fetchNextPage: s, hasOlder: c, isFetchingOlder: l, isLoading: u, isError: d } = at(t, n, e.entity, e.foreign_key, e.timeline?.time_field, e.limit), p = e.timeline, m = p?.scroll ?? !1, g = (e.sort ?? "").endsWith(":asc"), _ = W(() => g ? [...a].reverse() : a, [a, g]), v = p?.auto_scroll ?? "none", y = G(null), b = G(null), x = G(!1), S = G(0), C = G(null), w = G(null), T = G(!0), E = G(null);
|
|
1414
|
+
U(() => {
|
|
1412
1415
|
x.current = !1, S.current = 0, C.current = null, w.current = null, T.current = !0, E.current = null;
|
|
1413
|
-
}, [n]),
|
|
1416
|
+
}, [n]), ye(() => {
|
|
1414
1417
|
!l || !y.current || (E.current = {
|
|
1415
1418
|
scrollHeight: y.current.scrollHeight,
|
|
1416
1419
|
scrollTop: y.current.scrollTop
|
|
1417
1420
|
});
|
|
1418
|
-
}, [l]),
|
|
1421
|
+
}, [l]), ye(() => {
|
|
1419
1422
|
let e = y.current;
|
|
1420
1423
|
if (!e || _.length === 0 || !i) {
|
|
1421
1424
|
S.current = _.length;
|
|
@@ -1434,11 +1437,11 @@ function bt({ config: e, parentEntity: t, parentId: n, schema: r }) {
|
|
|
1434
1437
|
g,
|
|
1435
1438
|
i
|
|
1436
1439
|
]);
|
|
1437
|
-
let D =
|
|
1440
|
+
let D = H(() => {
|
|
1438
1441
|
let e = y.current;
|
|
1439
1442
|
e && (T.current = e.scrollHeight - e.scrollTop - e.clientHeight < ft);
|
|
1440
1443
|
}, []);
|
|
1441
|
-
|
|
1444
|
+
U(() => {
|
|
1442
1445
|
let e = b.current;
|
|
1443
1446
|
if (!e || typeof IntersectionObserver > "u") return;
|
|
1444
1447
|
let t = new IntersectionObserver((e) => {
|
|
@@ -1454,8 +1457,8 @@ function bt({ config: e, parentEntity: t, parentId: n, schema: r }) {
|
|
|
1454
1457
|
l,
|
|
1455
1458
|
s
|
|
1456
1459
|
]);
|
|
1457
|
-
let [k, A] =
|
|
1458
|
-
if (!i) return /* @__PURE__ */
|
|
1460
|
+
let [k, A] = K(null);
|
|
1461
|
+
if (!i) return /* @__PURE__ */ J("div", {
|
|
1459
1462
|
style: {
|
|
1460
1463
|
fontSize: 12.5,
|
|
1461
1464
|
color: "var(--text-3)",
|
|
@@ -1463,25 +1466,25 @@ function bt({ config: e, parentEntity: t, parentId: n, schema: r }) {
|
|
|
1463
1466
|
},
|
|
1464
1467
|
children: "Entity not found."
|
|
1465
1468
|
});
|
|
1466
|
-
let j = e.quick_add?.fields ?? [p?.content_field].filter(Boolean), M = f(i.display?.name_plural) || f(i.display?.name) || e.entity, ee = c ? /* @__PURE__ */
|
|
1469
|
+
let j = e.quick_add?.fields ?? [p?.content_field].filter(Boolean), M = f(i.display?.name_plural) || f(i.display?.name) || e.entity, ee = c ? /* @__PURE__ */ J("div", {
|
|
1467
1470
|
style: {
|
|
1468
1471
|
display: "flex",
|
|
1469
1472
|
justifyContent: "center",
|
|
1470
1473
|
padding: "6px 0"
|
|
1471
1474
|
},
|
|
1472
|
-
children: /* @__PURE__ */
|
|
1475
|
+
children: /* @__PURE__ */ J(O, {
|
|
1473
1476
|
size: "xs",
|
|
1474
1477
|
onClick: () => s(),
|
|
1475
1478
|
disabled: l,
|
|
1476
|
-
icon: l ? /* @__PURE__ */
|
|
1479
|
+
icon: l ? /* @__PURE__ */ J(h, { size: 11 }) : void 0,
|
|
1477
1480
|
children: l ? "Loading…" : "Load older"
|
|
1478
1481
|
})
|
|
1479
|
-
}) : null,
|
|
1482
|
+
}) : null, N = /* @__PURE__ */ J("div", {
|
|
1480
1483
|
ref: b,
|
|
1481
1484
|
"aria-hidden": "true",
|
|
1482
1485
|
style: { height: 1 }
|
|
1483
|
-
}),
|
|
1484
|
-
if (d)
|
|
1486
|
+
}), P;
|
|
1487
|
+
if (d) P = /* @__PURE__ */ J("div", {
|
|
1485
1488
|
style: {
|
|
1486
1489
|
fontSize: 12.5,
|
|
1487
1490
|
color: "var(--danger)",
|
|
@@ -1489,24 +1492,24 @@ function bt({ config: e, parentEntity: t, parentId: n, schema: r }) {
|
|
|
1489
1492
|
},
|
|
1490
1493
|
children: "Failed to load."
|
|
1491
1494
|
});
|
|
1492
|
-
else if (u)
|
|
1495
|
+
else if (u) P = /* @__PURE__ */ Y("div", {
|
|
1493
1496
|
style: {
|
|
1494
1497
|
display: "flex",
|
|
1495
1498
|
flexDirection: "column",
|
|
1496
1499
|
gap: 8,
|
|
1497
1500
|
padding: 12
|
|
1498
1501
|
},
|
|
1499
|
-
children: [/* @__PURE__ */
|
|
1502
|
+
children: [/* @__PURE__ */ J("div", { style: {
|
|
1500
1503
|
height: 64,
|
|
1501
1504
|
background: "var(--surface-3)",
|
|
1502
1505
|
borderRadius: 8
|
|
1503
|
-
} }), /* @__PURE__ */
|
|
1506
|
+
} }), /* @__PURE__ */ J("div", { style: {
|
|
1504
1507
|
height: 64,
|
|
1505
1508
|
background: "var(--surface-3)",
|
|
1506
1509
|
borderRadius: 8
|
|
1507
1510
|
} })]
|
|
1508
1511
|
});
|
|
1509
|
-
else if (_.length === 0)
|
|
1512
|
+
else if (_.length === 0) P = /* @__PURE__ */ Y(q, { children: [N, /* @__PURE__ */ J("div", {
|
|
1510
1513
|
style: {
|
|
1511
1514
|
fontSize: 12.5,
|
|
1512
1515
|
color: "var(--text-3)",
|
|
@@ -1517,7 +1520,7 @@ function bt({ config: e, parentEntity: t, parentId: n, schema: r }) {
|
|
|
1517
1520
|
else {
|
|
1518
1521
|
let a = (a, s) => {
|
|
1519
1522
|
let c = vt(i, a) || String(s);
|
|
1520
|
-
return /* @__PURE__ */
|
|
1523
|
+
return /* @__PURE__ */ J(xt, {
|
|
1521
1524
|
row: a,
|
|
1522
1525
|
rowId: c,
|
|
1523
1526
|
childEntity: i,
|
|
@@ -1550,25 +1553,25 @@ function bt({ config: e, parentEntity: t, parentId: n, schema: r }) {
|
|
|
1550
1553
|
row: t,
|
|
1551
1554
|
idx: n
|
|
1552
1555
|
});
|
|
1553
|
-
}), c = e.map((e) => /* @__PURE__ */
|
|
1556
|
+
}), c = e.map((e) => /* @__PURE__ */ Y("div", {
|
|
1554
1557
|
style: {
|
|
1555
1558
|
display: "flex",
|
|
1556
1559
|
flexDirection: "column",
|
|
1557
1560
|
gap: 8
|
|
1558
1561
|
},
|
|
1559
|
-
children: [/* @__PURE__ */
|
|
1562
|
+
children: [/* @__PURE__ */ J(Tt, {
|
|
1560
1563
|
label: e.label,
|
|
1561
1564
|
count: e.rows.length
|
|
1562
1565
|
}), e.rows.map(({ row: e, idx: t }) => a(e, t))]
|
|
1563
1566
|
}, `day-${e.key}`));
|
|
1564
1567
|
} else c = _.map((e, t) => a(e, t));
|
|
1565
|
-
|
|
1566
|
-
|
|
1568
|
+
P = /* @__PURE__ */ Y(q, { children: [
|
|
1569
|
+
N,
|
|
1567
1570
|
ee,
|
|
1568
1571
|
c
|
|
1569
1572
|
] });
|
|
1570
1573
|
}
|
|
1571
|
-
return m ? /* @__PURE__ */
|
|
1574
|
+
return m ? /* @__PURE__ */ Y("div", {
|
|
1572
1575
|
style: {
|
|
1573
1576
|
display: "flex",
|
|
1574
1577
|
flexDirection: "column",
|
|
@@ -1578,13 +1581,13 @@ function bt({ config: e, parentEntity: t, parentId: n, schema: r }) {
|
|
|
1578
1581
|
color: "var(--text)"
|
|
1579
1582
|
},
|
|
1580
1583
|
children: [
|
|
1581
|
-
/* @__PURE__ */
|
|
1584
|
+
/* @__PURE__ */ J("div", {
|
|
1582
1585
|
style: {
|
|
1583
1586
|
padding: "10px 16px",
|
|
1584
1587
|
borderBottom: "1px solid var(--divider)",
|
|
1585
1588
|
background: "var(--surface)"
|
|
1586
1589
|
},
|
|
1587
|
-
children: /* @__PURE__ */
|
|
1590
|
+
children: /* @__PURE__ */ J("h3", {
|
|
1588
1591
|
style: {
|
|
1589
1592
|
margin: 0,
|
|
1590
1593
|
fontSize: 12.5,
|
|
@@ -1593,7 +1596,7 @@ function bt({ config: e, parentEntity: t, parentId: n, schema: r }) {
|
|
|
1593
1596
|
children: M
|
|
1594
1597
|
})
|
|
1595
1598
|
}),
|
|
1596
|
-
/* @__PURE__ */
|
|
1599
|
+
/* @__PURE__ */ J("div", {
|
|
1597
1600
|
ref: y,
|
|
1598
1601
|
onScroll: D,
|
|
1599
1602
|
style: {
|
|
@@ -1604,23 +1607,23 @@ function bt({ config: e, parentEntity: t, parentId: n, schema: r }) {
|
|
|
1604
1607
|
flexDirection: "column",
|
|
1605
1608
|
gap: 8
|
|
1606
1609
|
},
|
|
1607
|
-
children:
|
|
1610
|
+
children: P
|
|
1608
1611
|
}),
|
|
1609
|
-
/* @__PURE__ */
|
|
1612
|
+
/* @__PURE__ */ J(dt, {
|
|
1610
1613
|
config: e,
|
|
1611
1614
|
parentEntity: t,
|
|
1612
1615
|
parentId: n,
|
|
1613
1616
|
schema: r
|
|
1614
1617
|
})
|
|
1615
1618
|
]
|
|
1616
|
-
}) : /* @__PURE__ */
|
|
1619
|
+
}) : /* @__PURE__ */ Y("div", { children: [/* @__PURE__ */ J("div", {
|
|
1617
1620
|
style: {
|
|
1618
1621
|
display: "flex",
|
|
1619
1622
|
flexDirection: "column",
|
|
1620
1623
|
gap: 8
|
|
1621
1624
|
},
|
|
1622
|
-
children:
|
|
1623
|
-
}), /* @__PURE__ */
|
|
1625
|
+
children: P
|
|
1626
|
+
}), /* @__PURE__ */ J(dt, {
|
|
1624
1627
|
config: e,
|
|
1625
1628
|
parentEntity: t,
|
|
1626
1629
|
parentId: n,
|
|
@@ -1628,9 +1631,9 @@ function bt({ config: e, parentEntity: t, parentId: n, schema: r }) {
|
|
|
1628
1631
|
})] });
|
|
1629
1632
|
}
|
|
1630
1633
|
function xt({ row: t, rowId: r, childEntity: i, entityCode: a, parentEntity: o, parentId: s, timeline: c, editableFields: u, refs: f, isEditing: p, onStartEdit: m, onCancelEdit: g, onSaved: _, schema: v, optimistic: b = !1 }) {
|
|
1631
|
-
let S =
|
|
1634
|
+
let S = Se(), T = n(), [E, A] = K({}), j = H(() => {
|
|
1632
1635
|
S.invalidateQueries({ queryKey: [
|
|
1633
|
-
|
|
1636
|
+
te,
|
|
1634
1637
|
o,
|
|
1635
1638
|
s,
|
|
1636
1639
|
a
|
|
@@ -1640,25 +1643,25 @@ function xt({ row: t, rowId: r, childEntity: i, entityCode: a, parentEntity: o,
|
|
|
1640
1643
|
o,
|
|
1641
1644
|
s,
|
|
1642
1645
|
a
|
|
1643
|
-
]), M =
|
|
1646
|
+
]), M = xe({
|
|
1644
1647
|
mutationFn: (e) => {
|
|
1645
|
-
let n = t.$row_version
|
|
1646
|
-
return C(a, r, typeof n == "string" && n !== "" ? {
|
|
1648
|
+
let n = t.$row_version, i = typeof n == "string" && n !== "" ? {
|
|
1647
1649
|
...e,
|
|
1648
1650
|
$row_version: n
|
|
1649
|
-
} : e
|
|
1651
|
+
} : e;
|
|
1652
|
+
return C(a, r, i);
|
|
1650
1653
|
},
|
|
1651
1654
|
onSuccess: () => {
|
|
1652
1655
|
j(), D.success("Updated"), _();
|
|
1653
1656
|
},
|
|
1654
1657
|
onError: (e) => D.error(e.message)
|
|
1655
|
-
}), ee =
|
|
1658
|
+
}), ee = xe({
|
|
1656
1659
|
mutationFn: () => k(a, r),
|
|
1657
1660
|
onSuccess: () => {
|
|
1658
1661
|
j(), D.success("Deleted");
|
|
1659
1662
|
},
|
|
1660
1663
|
onError: (e) => D.error(e.message)
|
|
1661
|
-
}),
|
|
1664
|
+
}), N = H(() => {
|
|
1662
1665
|
let e = {};
|
|
1663
1666
|
for (let n of u) e[n] = t[n] ?? "";
|
|
1664
1667
|
A(e), m();
|
|
@@ -1666,13 +1669,13 @@ function xt({ row: t, rowId: r, childEntity: i, entityCode: a, parentEntity: o,
|
|
|
1666
1669
|
t,
|
|
1667
1670
|
u,
|
|
1668
1671
|
m
|
|
1669
|
-
]),
|
|
1672
|
+
]), P = H((e, t) => {
|
|
1670
1673
|
A((n) => ({
|
|
1671
1674
|
...n,
|
|
1672
1675
|
[e]: t
|
|
1673
1676
|
}));
|
|
1674
|
-
}, []),
|
|
1675
|
-
return p ? /* @__PURE__ */
|
|
1677
|
+
}, []), F = c?.time_field, I = c?.type_field, L = c?.summary_field, R = c?.content_field, z = c?.author_field, B = c?.direction_field, V = c?.intent_field;
|
|
1678
|
+
return p ? /* @__PURE__ */ Y("div", {
|
|
1676
1679
|
style: {
|
|
1677
1680
|
borderRadius: 10,
|
|
1678
1681
|
border: "1px solid var(--accent)",
|
|
@@ -1684,7 +1687,7 @@ function xt({ row: t, rowId: r, childEntity: i, entityCode: a, parentEntity: o,
|
|
|
1684
1687
|
},
|
|
1685
1688
|
children: [u.map((e) => {
|
|
1686
1689
|
let t = i.fields.get(e);
|
|
1687
|
-
return t ? /* @__PURE__ */
|
|
1690
|
+
return t ? /* @__PURE__ */ Y("div", { children: [/* @__PURE__ */ J("label", {
|
|
1688
1691
|
style: {
|
|
1689
1692
|
fontSize: 11,
|
|
1690
1693
|
color: "var(--text-3)",
|
|
@@ -1697,27 +1700,27 @@ function xt({ row: t, rowId: r, childEntity: i, entityCode: a, parentEntity: o,
|
|
|
1697
1700
|
fieldName: e,
|
|
1698
1701
|
value: E[e] ?? "",
|
|
1699
1702
|
mode: "edit",
|
|
1700
|
-
onChange: (t) =>
|
|
1703
|
+
onChange: (t) => P(e, t),
|
|
1701
1704
|
record: E,
|
|
1702
1705
|
locale: T
|
|
1703
1706
|
})] }, e) : null;
|
|
1704
|
-
}), /* @__PURE__ */
|
|
1707
|
+
}), /* @__PURE__ */ Y("div", {
|
|
1705
1708
|
style: {
|
|
1706
1709
|
display: "flex",
|
|
1707
1710
|
alignItems: "center",
|
|
1708
1711
|
gap: 6,
|
|
1709
1712
|
paddingTop: 4
|
|
1710
1713
|
},
|
|
1711
|
-
children: [/* @__PURE__ */
|
|
1714
|
+
children: [/* @__PURE__ */ J(O, {
|
|
1712
1715
|
kind: "primary",
|
|
1713
1716
|
size: "xs",
|
|
1714
|
-
icon: M.isPending ? /* @__PURE__ */
|
|
1717
|
+
icon: M.isPending ? /* @__PURE__ */ J(h, { size: 12 }) : /* @__PURE__ */ J(e.check, { size: 12 }),
|
|
1715
1718
|
onClick: () => M.mutate(E),
|
|
1716
1719
|
disabled: M.isPending,
|
|
1717
1720
|
children: M.isPending ? "Saving…" : "Save"
|
|
1718
|
-
}), /* @__PURE__ */
|
|
1721
|
+
}), /* @__PURE__ */ J(O, {
|
|
1719
1722
|
size: "xs",
|
|
1720
|
-
icon: /* @__PURE__ */
|
|
1723
|
+
icon: /* @__PURE__ */ J(e.x, { size: 12 }),
|
|
1721
1724
|
onClick: () => {
|
|
1722
1725
|
A({}), g();
|
|
1723
1726
|
},
|
|
@@ -1725,7 +1728,7 @@ function xt({ row: t, rowId: r, childEntity: i, entityCode: a, parentEntity: o,
|
|
|
1725
1728
|
children: "Cancel"
|
|
1726
1729
|
})]
|
|
1727
1730
|
})]
|
|
1728
|
-
}) : /* @__PURE__ */
|
|
1731
|
+
}) : /* @__PURE__ */ Y("div", {
|
|
1729
1732
|
className: "group",
|
|
1730
1733
|
"data-optimistic": b || void 0,
|
|
1731
1734
|
style: {
|
|
@@ -1739,7 +1742,7 @@ function xt({ row: t, rowId: r, childEntity: i, entityCode: a, parentEntity: o,
|
|
|
1739
1742
|
onMouseEnter: (e) => e.currentTarget.style.borderColor = "var(--border-strong)",
|
|
1740
1743
|
onMouseLeave: (e) => e.currentTarget.style.borderColor = "var(--border)",
|
|
1741
1744
|
children: [
|
|
1742
|
-
/* @__PURE__ */
|
|
1745
|
+
/* @__PURE__ */ Y("div", {
|
|
1743
1746
|
style: {
|
|
1744
1747
|
display: "flex",
|
|
1745
1748
|
alignItems: "center",
|
|
@@ -1749,109 +1752,109 @@ function xt({ row: t, rowId: r, childEntity: i, entityCode: a, parentEntity: o,
|
|
|
1749
1752
|
color: "var(--text-3)"
|
|
1750
1753
|
},
|
|
1751
1754
|
children: [
|
|
1752
|
-
|
|
1755
|
+
F && t[F] != null && i.fields.get(F) && /* @__PURE__ */ J("span", {
|
|
1753
1756
|
style: { fontWeight: 500 },
|
|
1754
1757
|
children: x({
|
|
1755
|
-
field: i.fields.get(
|
|
1756
|
-
fieldName:
|
|
1757
|
-
value: t[
|
|
1758
|
+
field: i.fields.get(F),
|
|
1759
|
+
fieldName: F,
|
|
1760
|
+
value: t[F],
|
|
1758
1761
|
mode: "display",
|
|
1759
1762
|
record: t,
|
|
1760
1763
|
refs: f,
|
|
1761
1764
|
locale: T
|
|
1762
1765
|
})
|
|
1763
1766
|
}),
|
|
1764
|
-
|
|
1767
|
+
I && t[I] != null && i.fields.get(I) && /* @__PURE__ */ J(y, {
|
|
1765
1768
|
tone: "slate",
|
|
1766
1769
|
size: "xs",
|
|
1767
1770
|
children: x({
|
|
1768
|
-
field: i.fields.get(
|
|
1769
|
-
fieldName:
|
|
1770
|
-
value: t[
|
|
1771
|
+
field: i.fields.get(I),
|
|
1772
|
+
fieldName: I,
|
|
1773
|
+
value: t[I],
|
|
1771
1774
|
mode: "display",
|
|
1772
1775
|
record: t,
|
|
1773
1776
|
refs: f,
|
|
1774
1777
|
locale: T
|
|
1775
1778
|
})
|
|
1776
1779
|
}),
|
|
1777
|
-
|
|
1778
|
-
value: t[
|
|
1779
|
-
field: i.fields.get(
|
|
1780
|
+
B && t[B] != null && i.fields.get(B) && /* @__PURE__ */ J(Et, {
|
|
1781
|
+
value: t[B],
|
|
1782
|
+
field: i.fields.get(B)
|
|
1780
1783
|
}),
|
|
1781
|
-
|
|
1784
|
+
V && t[V] != null && i.fields.get(V) && /* @__PURE__ */ J(y, {
|
|
1782
1785
|
tone: "slate",
|
|
1783
1786
|
size: "xs",
|
|
1784
1787
|
children: x({
|
|
1785
|
-
field: i.fields.get(
|
|
1786
|
-
fieldName:
|
|
1787
|
-
value: t[
|
|
1788
|
+
field: i.fields.get(V),
|
|
1789
|
+
fieldName: V,
|
|
1790
|
+
value: t[V],
|
|
1788
1791
|
mode: "display",
|
|
1789
1792
|
record: t,
|
|
1790
1793
|
refs: f,
|
|
1791
1794
|
locale: T
|
|
1792
1795
|
})
|
|
1793
1796
|
}),
|
|
1794
|
-
|
|
1797
|
+
z && t[z] != null && i.fields.get(z) && /* @__PURE__ */ Y("span", { children: [
|
|
1795
1798
|
"by",
|
|
1796
1799
|
" ",
|
|
1797
1800
|
x({
|
|
1798
|
-
field: i.fields.get(
|
|
1799
|
-
fieldName:
|
|
1800
|
-
value: t[
|
|
1801
|
+
field: i.fields.get(z),
|
|
1802
|
+
fieldName: z,
|
|
1803
|
+
value: t[z],
|
|
1801
1804
|
mode: "display",
|
|
1802
1805
|
record: t,
|
|
1803
1806
|
refs: f,
|
|
1804
1807
|
locale: T
|
|
1805
1808
|
})
|
|
1806
1809
|
] }),
|
|
1807
|
-
!b && /* @__PURE__ */
|
|
1810
|
+
!b && /* @__PURE__ */ Y("div", {
|
|
1808
1811
|
style: {
|
|
1809
1812
|
marginLeft: "auto",
|
|
1810
1813
|
display: "flex",
|
|
1811
1814
|
alignItems: "center",
|
|
1812
1815
|
gap: 2
|
|
1813
1816
|
},
|
|
1814
|
-
children: [/* @__PURE__ */
|
|
1817
|
+
children: [/* @__PURE__ */ J(w, {
|
|
1815
1818
|
size: 22,
|
|
1816
|
-
icon: /* @__PURE__ */
|
|
1817
|
-
onClick:
|
|
1819
|
+
icon: /* @__PURE__ */ J(e.edit, { size: 11 }),
|
|
1820
|
+
onClick: N,
|
|
1818
1821
|
title: "Edit"
|
|
1819
|
-
}), /* @__PURE__ */
|
|
1822
|
+
}), /* @__PURE__ */ J(w, {
|
|
1820
1823
|
size: 22,
|
|
1821
|
-
icon: /* @__PURE__ */
|
|
1824
|
+
icon: /* @__PURE__ */ J(e.trash, { size: 11 }),
|
|
1822
1825
|
onClick: () => ee.mutate(),
|
|
1823
1826
|
title: "Delete"
|
|
1824
1827
|
})]
|
|
1825
1828
|
})
|
|
1826
1829
|
]
|
|
1827
1830
|
}),
|
|
1828
|
-
|
|
1831
|
+
L && t[L] != null && i.fields.get(L) && /* @__PURE__ */ J("div", {
|
|
1829
1832
|
style: {
|
|
1830
1833
|
fontSize: 12.5,
|
|
1831
1834
|
fontWeight: 500,
|
|
1832
1835
|
marginTop: 6
|
|
1833
1836
|
},
|
|
1834
1837
|
children: x({
|
|
1835
|
-
field: i.fields.get(
|
|
1836
|
-
fieldName:
|
|
1837
|
-
value: t[
|
|
1838
|
+
field: i.fields.get(L),
|
|
1839
|
+
fieldName: L,
|
|
1840
|
+
value: t[L],
|
|
1838
1841
|
mode: "display",
|
|
1839
1842
|
record: t,
|
|
1840
1843
|
refs: f,
|
|
1841
1844
|
locale: T
|
|
1842
1845
|
})
|
|
1843
1846
|
}),
|
|
1844
|
-
|
|
1847
|
+
R && t[R] != null && R !== L && i.fields.get(R) && /* @__PURE__ */ J(St, {
|
|
1845
1848
|
rendered: x({
|
|
1846
|
-
field: i.fields.get(
|
|
1847
|
-
fieldName:
|
|
1848
|
-
value: t[
|
|
1849
|
+
field: i.fields.get(R),
|
|
1850
|
+
fieldName: R,
|
|
1851
|
+
value: t[R],
|
|
1849
1852
|
mode: "display",
|
|
1850
1853
|
record: t,
|
|
1851
1854
|
refs: f,
|
|
1852
1855
|
locale: T
|
|
1853
1856
|
}),
|
|
1854
|
-
text: l(t[
|
|
1857
|
+
text: l(t[R])
|
|
1855
1858
|
})
|
|
1856
1859
|
]
|
|
1857
1860
|
});
|
|
@@ -1862,12 +1865,12 @@ function St({ rendered: e, text: t }) {
|
|
|
1862
1865
|
fontWeight: 400,
|
|
1863
1866
|
marginTop: 6
|
|
1864
1867
|
};
|
|
1865
|
-
if (!_t(t)) return /* @__PURE__ */
|
|
1868
|
+
if (!_t(t)) return /* @__PURE__ */ J("div", {
|
|
1866
1869
|
style: n,
|
|
1867
1870
|
children: e
|
|
1868
1871
|
});
|
|
1869
1872
|
let r = t.length > ht, i = r ? t.slice(0, ht) : t;
|
|
1870
|
-
return /* @__PURE__ */
|
|
1873
|
+
return /* @__PURE__ */ J("div", {
|
|
1871
1874
|
style: {
|
|
1872
1875
|
...n,
|
|
1873
1876
|
display: "-webkit-box",
|
|
@@ -1877,15 +1880,15 @@ function St({ rendered: e, text: t }) {
|
|
|
1877
1880
|
whiteSpace: "pre-wrap",
|
|
1878
1881
|
overflowWrap: "anywhere"
|
|
1879
1882
|
},
|
|
1880
|
-
children: /* @__PURE__ */
|
|
1883
|
+
children: /* @__PURE__ */ J(_, {
|
|
1881
1884
|
width: 380,
|
|
1882
|
-
content: /* @__PURE__ */
|
|
1885
|
+
content: /* @__PURE__ */ Y("div", {
|
|
1883
1886
|
style: {
|
|
1884
1887
|
fontSize: 12.5,
|
|
1885
1888
|
whiteSpace: "pre-wrap",
|
|
1886
1889
|
overflowWrap: "anywhere"
|
|
1887
1890
|
},
|
|
1888
|
-
children: [i, r && /* @__PURE__ */
|
|
1891
|
+
children: [i, r && /* @__PURE__ */ J("div", {
|
|
1889
1892
|
style: {
|
|
1890
1893
|
marginTop: 8,
|
|
1891
1894
|
fontSize: 11,
|
|
@@ -1917,7 +1920,7 @@ function wt(e) {
|
|
|
1917
1920
|
});
|
|
1918
1921
|
}
|
|
1919
1922
|
function Tt({ label: e, count: t }) {
|
|
1920
|
-
return /* @__PURE__ */
|
|
1923
|
+
return /* @__PURE__ */ Y("div", {
|
|
1921
1924
|
style: {
|
|
1922
1925
|
position: "sticky",
|
|
1923
1926
|
top: -4,
|
|
@@ -1929,7 +1932,7 @@ function Tt({ label: e, count: t }) {
|
|
|
1929
1932
|
background: "linear-gradient(180deg, var(--surface-2) 0%, var(--surface-2) 65%, transparent 100%)"
|
|
1930
1933
|
},
|
|
1931
1934
|
children: [
|
|
1932
|
-
/* @__PURE__ */
|
|
1935
|
+
/* @__PURE__ */ J("span", {
|
|
1933
1936
|
style: {
|
|
1934
1937
|
fontSize: 11,
|
|
1935
1938
|
fontWeight: 600,
|
|
@@ -1937,12 +1940,12 @@ function Tt({ label: e, count: t }) {
|
|
|
1937
1940
|
},
|
|
1938
1941
|
children: e
|
|
1939
1942
|
}),
|
|
1940
|
-
/* @__PURE__ */
|
|
1943
|
+
/* @__PURE__ */ J("span", { style: {
|
|
1941
1944
|
flex: 1,
|
|
1942
1945
|
height: 1,
|
|
1943
1946
|
background: "var(--divider)"
|
|
1944
1947
|
} }),
|
|
1945
|
-
/* @__PURE__ */
|
|
1948
|
+
/* @__PURE__ */ J("span", {
|
|
1946
1949
|
className: "num",
|
|
1947
1950
|
style: {
|
|
1948
1951
|
fontSize: 10.5,
|
|
@@ -1955,7 +1958,7 @@ function Tt({ label: e, count: t }) {
|
|
|
1955
1958
|
}
|
|
1956
1959
|
function Et({ value: t, field: n }) {
|
|
1957
1960
|
let r = Dt(t, n);
|
|
1958
|
-
return r === null ? null : /* @__PURE__ */
|
|
1961
|
+
return r === null ? null : /* @__PURE__ */ Y("span", {
|
|
1959
1962
|
style: {
|
|
1960
1963
|
display: "inline-flex",
|
|
1961
1964
|
alignItems: "center",
|
|
@@ -1967,7 +1970,7 @@ function Et({ value: t, field: n }) {
|
|
|
1967
1970
|
background: r ? "var(--accent-soft)" : "var(--info-soft)",
|
|
1968
1971
|
color: r ? "var(--accent)" : "var(--info)"
|
|
1969
1972
|
},
|
|
1970
|
-
children: [
|
|
1973
|
+
children: [J(r ? e.arrowUp : e.arrowDown, { size: 10 }), r ? "Out" : "In"]
|
|
1971
1974
|
});
|
|
1972
1975
|
}
|
|
1973
1976
|
function Dt(e, t) {
|
|
@@ -1982,7 +1985,7 @@ function Dt(e, t) {
|
|
|
1982
1985
|
//#endregion
|
|
1983
1986
|
//#region src/components/detail-layout/EditableChildrenTable.tsx
|
|
1984
1987
|
function Ot({ config: t, childEntity: r, schema: i, rows: a, onChange: o, validationErrors: s, refs: c, forceTablePresentation: u = !1 }) {
|
|
1985
|
-
let f = n(), p = E(), m =
|
|
1988
|
+
let f = n(), p = E(), m = G(null), h = t.columns, g = t.position_field, _ = new Set(Array.isArray(t.foreign_key) ? t.foreign_key : [t.foreign_key]), v = h.filter((e) => {
|
|
1986
1989
|
if (_.has(e) || t.position_field && e === t.position_field) return !1;
|
|
1987
1990
|
let n = r.fields.get(e);
|
|
1988
1991
|
return !(!n || n.auto || n.primary || n.source);
|
|
@@ -1990,21 +1993,24 @@ function Ot({ config: t, childEntity: r, schema: i, rows: a, onChange: o, valida
|
|
|
1990
1993
|
if (t.position_field && e === t.position_field) return !0;
|
|
1991
1994
|
let n = r.fields.get(e);
|
|
1992
1995
|
return n && (n.auto || n.primary || n.source);
|
|
1993
|
-
})), b =
|
|
1996
|
+
})), b = H((e, t, n) => {
|
|
1994
1997
|
o(a.map((r) => r._key === e ? {
|
|
1995
1998
|
...r,
|
|
1996
1999
|
[t]: n,
|
|
1997
2000
|
_dirty: !0
|
|
1998
2001
|
} : r));
|
|
1999
|
-
}, [a, o]), S =
|
|
2002
|
+
}, [a, o]), S = H(() => {
|
|
2000
2003
|
let e = {
|
|
2001
2004
|
_key: crypto.randomUUID(),
|
|
2002
2005
|
_dirty: !0
|
|
2003
2006
|
};
|
|
2004
|
-
|
|
2005
|
-
let
|
|
2006
|
-
|
|
2007
|
-
|
|
2007
|
+
if (g) {
|
|
2008
|
+
let t = a.filter((e) => !e._deleted).reduce((e, t) => {
|
|
2009
|
+
let n = typeof t[g] == "number" ? t[g] : -1;
|
|
2010
|
+
return Math.max(e, n);
|
|
2011
|
+
}, -1);
|
|
2012
|
+
e[g] = t + 1;
|
|
2013
|
+
}
|
|
2008
2014
|
let n = t.quick_add?.defaults ?? {};
|
|
2009
2015
|
for (let t of v) {
|
|
2010
2016
|
let i = r.fields.get(t);
|
|
@@ -2018,17 +2024,17 @@ function Ot({ config: t, childEntity: r, schema: i, rows: a, onChange: o, valida
|
|
|
2018
2024
|
r,
|
|
2019
2025
|
t.quick_add?.defaults,
|
|
2020
2026
|
g
|
|
2021
|
-
]), C =
|
|
2027
|
+
]), C = H((e) => {
|
|
2022
2028
|
o(a.map((t) => t._key === e ? {
|
|
2023
2029
|
...t,
|
|
2024
2030
|
_deleted: !0
|
|
2025
2031
|
} : t));
|
|
2026
|
-
}, [a, o]), T =
|
|
2032
|
+
}, [a, o]), T = H((e) => {
|
|
2027
2033
|
o(a.map((t) => t._key === e ? {
|
|
2028
2034
|
...t,
|
|
2029
2035
|
_deleted: !1
|
|
2030
2036
|
} : t));
|
|
2031
|
-
}, [a, o]), D =
|
|
2037
|
+
}, [a, o]), D = H((e, t) => {
|
|
2032
2038
|
if (!g) return;
|
|
2033
2039
|
let n = a.filter((e) => !e._deleted), r = a.filter((e) => e._deleted), i = n.findIndex((t) => t._key === e), s = i + t;
|
|
2034
2040
|
if (i < 0 || s < 0 || s >= n.length) return;
|
|
@@ -2042,7 +2048,7 @@ function Ot({ config: t, childEntity: r, schema: i, rows: a, onChange: o, valida
|
|
|
2042
2048
|
a,
|
|
2043
2049
|
o,
|
|
2044
2050
|
g
|
|
2045
|
-
]), k =
|
|
2051
|
+
]), k = H((e) => {
|
|
2046
2052
|
let t = e.target, n = t.closest("td");
|
|
2047
2053
|
if (!n) return;
|
|
2048
2054
|
let r = n.closest("tr");
|
|
@@ -2074,8 +2080,8 @@ function Ot({ config: t, childEntity: r, schema: i, rows: a, onChange: o, valida
|
|
|
2074
2080
|
}
|
|
2075
2081
|
});
|
|
2076
2082
|
} else e.key === "Escape" && t.blur?.();
|
|
2077
|
-
}, [S]), A =
|
|
2078
|
-
return p.isPhone && !u ? /* @__PURE__ */
|
|
2083
|
+
}, [S]), A = de;
|
|
2084
|
+
return p.isPhone && !u ? /* @__PURE__ */ Y("div", { children: [/* @__PURE__ */ J("div", {
|
|
2079
2085
|
style: {
|
|
2080
2086
|
display: "flex",
|
|
2081
2087
|
flexDirection: "column",
|
|
@@ -2083,7 +2089,7 @@ function Ot({ config: t, childEntity: r, schema: i, rows: a, onChange: o, valida
|
|
|
2083
2089
|
},
|
|
2084
2090
|
children: a.map((t, n) => {
|
|
2085
2091
|
let o = !!t._deleted, u = s?.[t._key], p = g ? a.filter((e) => !e._deleted) : [], m = g ? p.findIndex((e) => e._key === t._key) : -1;
|
|
2086
|
-
return /* @__PURE__ */
|
|
2092
|
+
return /* @__PURE__ */ Y("div", {
|
|
2087
2093
|
style: {
|
|
2088
2094
|
border: "1px solid var(--border)",
|
|
2089
2095
|
borderRadius: 8,
|
|
@@ -2091,7 +2097,7 @@ function Ot({ config: t, childEntity: r, schema: i, rows: a, onChange: o, valida
|
|
|
2091
2097
|
opacity: o ? .58 : 1,
|
|
2092
2098
|
overflow: "hidden"
|
|
2093
2099
|
},
|
|
2094
|
-
children: [/* @__PURE__ */
|
|
2100
|
+
children: [/* @__PURE__ */ Y("div", {
|
|
2095
2101
|
style: {
|
|
2096
2102
|
minHeight: 38,
|
|
2097
2103
|
padding: "8px 10px",
|
|
@@ -2101,44 +2107,44 @@ function Ot({ config: t, childEntity: r, schema: i, rows: a, onChange: o, valida
|
|
|
2101
2107
|
justifyContent: "space-between",
|
|
2102
2108
|
gap: 8
|
|
2103
2109
|
},
|
|
2104
|
-
children: [/* @__PURE__ */
|
|
2110
|
+
children: [/* @__PURE__ */ Y("div", {
|
|
2105
2111
|
style: {
|
|
2106
2112
|
fontSize: 12,
|
|
2107
2113
|
fontWeight: 600,
|
|
2108
2114
|
color: "var(--text-2)"
|
|
2109
2115
|
},
|
|
2110
2116
|
children: ["Row ", n + 1]
|
|
2111
|
-
}), /* @__PURE__ */
|
|
2117
|
+
}), /* @__PURE__ */ Y("div", {
|
|
2112
2118
|
style: {
|
|
2113
2119
|
display: "flex",
|
|
2114
2120
|
alignItems: "center",
|
|
2115
2121
|
gap: 4
|
|
2116
2122
|
},
|
|
2117
|
-
children: [g && !o && /* @__PURE__ */
|
|
2123
|
+
children: [g && !o && /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ J(w, {
|
|
2118
2124
|
size: 32,
|
|
2119
|
-
icon: /* @__PURE__ */
|
|
2125
|
+
icon: /* @__PURE__ */ J(e.up, { size: 14 }),
|
|
2120
2126
|
onClick: () => D(t._key, -1),
|
|
2121
2127
|
disabled: m <= 0,
|
|
2122
2128
|
title: "Move row up"
|
|
2123
|
-
}), /* @__PURE__ */
|
|
2129
|
+
}), /* @__PURE__ */ J(w, {
|
|
2124
2130
|
size: 32,
|
|
2125
|
-
icon: /* @__PURE__ */
|
|
2131
|
+
icon: /* @__PURE__ */ J(e.down, { size: 14 }),
|
|
2126
2132
|
onClick: () => D(t._key, 1),
|
|
2127
2133
|
disabled: m === -1 || m >= p.length - 1,
|
|
2128
2134
|
title: "Move row down"
|
|
2129
|
-
})] }), o ? /* @__PURE__ */
|
|
2135
|
+
})] }), o ? /* @__PURE__ */ J(w, {
|
|
2130
2136
|
size: 32,
|
|
2131
|
-
icon: /* @__PURE__ */
|
|
2137
|
+
icon: /* @__PURE__ */ J(e.refresh, { size: 14 }),
|
|
2132
2138
|
onClick: () => T(t._key),
|
|
2133
2139
|
title: "Undo delete"
|
|
2134
|
-
}) : /* @__PURE__ */
|
|
2140
|
+
}) : /* @__PURE__ */ J(w, {
|
|
2135
2141
|
size: 32,
|
|
2136
|
-
icon: /* @__PURE__ */
|
|
2142
|
+
icon: /* @__PURE__ */ J(e.trash, { size: 14 }),
|
|
2137
2143
|
onClick: () => C(t._key),
|
|
2138
2144
|
title: "Delete row"
|
|
2139
2145
|
})]
|
|
2140
2146
|
})]
|
|
2141
|
-
}), /* @__PURE__ */
|
|
2147
|
+
}), /* @__PURE__ */ J("div", {
|
|
2142
2148
|
style: {
|
|
2143
2149
|
padding: 10,
|
|
2144
2150
|
display: "flex",
|
|
@@ -2155,7 +2161,7 @@ function Ot({ config: t, childEntity: r, schema: i, rows: a, onChange: o, valida
|
|
|
2155
2161
|
fontWeight: 600,
|
|
2156
2162
|
color: "var(--text-3)"
|
|
2157
2163
|
}, v = !o && !s && !!n;
|
|
2158
|
-
return /* @__PURE__ */
|
|
2164
|
+
return /* @__PURE__ */ Y("div", {
|
|
2159
2165
|
style: {
|
|
2160
2166
|
display: "flex",
|
|
2161
2167
|
flexDirection: "column",
|
|
@@ -2164,16 +2170,16 @@ function Ot({ config: t, childEntity: r, schema: i, rows: a, onChange: o, valida
|
|
|
2164
2170
|
textDecoration: o ? "line-through" : "none"
|
|
2165
2171
|
},
|
|
2166
2172
|
title: a ? `${e} is required` : void 0,
|
|
2167
|
-
children: [v ? /* @__PURE__ */
|
|
2173
|
+
children: [v ? /* @__PURE__ */ J("label", {
|
|
2168
2174
|
id: h,
|
|
2169
2175
|
htmlFor: m,
|
|
2170
2176
|
style: _,
|
|
2171
2177
|
children: p
|
|
2172
|
-
}) : /* @__PURE__ */
|
|
2178
|
+
}) : /* @__PURE__ */ J("div", {
|
|
2173
2179
|
id: h,
|
|
2174
2180
|
style: _,
|
|
2175
2181
|
children: p
|
|
2176
|
-
}), /* @__PURE__ */
|
|
2182
|
+
}), /* @__PURE__ */ J("div", {
|
|
2177
2183
|
style: g,
|
|
2178
2184
|
children: o || s ? n ? x({
|
|
2179
2185
|
field: n,
|
|
@@ -2204,37 +2210,37 @@ function Ot({ config: t, childEntity: r, schema: i, rows: a, onChange: o, valida
|
|
|
2204
2210
|
})]
|
|
2205
2211
|
}, t._key);
|
|
2206
2212
|
})
|
|
2207
|
-
}), /* @__PURE__ */
|
|
2213
|
+
}), /* @__PURE__ */ J("div", {
|
|
2208
2214
|
style: { marginTop: 10 },
|
|
2209
|
-
children: /* @__PURE__ */
|
|
2215
|
+
children: /* @__PURE__ */ J(O, {
|
|
2210
2216
|
kind: "ghost",
|
|
2211
2217
|
size: "sm",
|
|
2212
|
-
icon: /* @__PURE__ */
|
|
2218
|
+
icon: /* @__PURE__ */ J(e.plus, { size: 14 }),
|
|
2213
2219
|
onClick: S,
|
|
2214
2220
|
children: "Add row"
|
|
2215
2221
|
})
|
|
2216
|
-
})] }) : /* @__PURE__ */
|
|
2222
|
+
})] }) : /* @__PURE__ */ Y("div", { children: [/* @__PURE__ */ J("div", {
|
|
2217
2223
|
style: { overflowX: "auto" },
|
|
2218
|
-
children: /* @__PURE__ */
|
|
2224
|
+
children: /* @__PURE__ */ Y("table", {
|
|
2219
2225
|
ref: m,
|
|
2220
|
-
style:
|
|
2226
|
+
style: fe,
|
|
2221
2227
|
onKeyDown: k,
|
|
2222
|
-
children: [/* @__PURE__ */
|
|
2228
|
+
children: [/* @__PURE__ */ J("thead", { children: /* @__PURE__ */ Y("tr", { children: [h.map((e) => {
|
|
2223
2229
|
let t = r.fields.get(e);
|
|
2224
|
-
return /* @__PURE__ */
|
|
2230
|
+
return /* @__PURE__ */ J("th", {
|
|
2225
2231
|
style: A,
|
|
2226
2232
|
children: t ? d(t, e, i.entities) : e
|
|
2227
2233
|
}, e);
|
|
2228
|
-
}), /* @__PURE__ */
|
|
2234
|
+
}), /* @__PURE__ */ J("th", { style: {
|
|
2229
2235
|
...A,
|
|
2230
2236
|
width: 40
|
|
2231
|
-
} })] }) }), /* @__PURE__ */
|
|
2237
|
+
} })] }) }), /* @__PURE__ */ J("tbody", { children: a.map((t) => {
|
|
2232
2238
|
let n = !!t._deleted, i = s?.[t._key];
|
|
2233
|
-
return /* @__PURE__ */
|
|
2239
|
+
return /* @__PURE__ */ Y("tr", {
|
|
2234
2240
|
style: { opacity: n ? .5 : 1 },
|
|
2235
2241
|
children: [h.map((e) => {
|
|
2236
2242
|
let a = r.fields.get(e), o = i?.includes(e), s = y.has(e);
|
|
2237
|
-
return n || s ? /* @__PURE__ */
|
|
2243
|
+
return n || s ? /* @__PURE__ */ J("td", {
|
|
2238
2244
|
style: {
|
|
2239
2245
|
padding: "6px 12px",
|
|
2240
2246
|
borderBottom: "1px solid var(--divider)",
|
|
@@ -2251,7 +2257,7 @@ function Ot({ config: t, childEntity: r, schema: i, rows: a, onChange: o, valida
|
|
|
2251
2257
|
refs: c,
|
|
2252
2258
|
locale: f
|
|
2253
2259
|
}) : l(t[e])
|
|
2254
|
-
}, e) : /* @__PURE__ */
|
|
2260
|
+
}, e) : /* @__PURE__ */ J("td", {
|
|
2255
2261
|
style: {
|
|
2256
2262
|
padding: "4px 4px",
|
|
2257
2263
|
borderBottom: "1px solid var(--divider)",
|
|
@@ -2273,20 +2279,20 @@ function Ot({ config: t, childEntity: r, schema: i, rows: a, onChange: o, valida
|
|
|
2273
2279
|
locale: f
|
|
2274
2280
|
}) : l(t[e])
|
|
2275
2281
|
}, e);
|
|
2276
|
-
}), /* @__PURE__ */
|
|
2282
|
+
}), /* @__PURE__ */ J("td", {
|
|
2277
2283
|
style: {
|
|
2278
2284
|
padding: "4px 8px",
|
|
2279
2285
|
borderBottom: "1px solid var(--divider)",
|
|
2280
2286
|
verticalAlign: "middle"
|
|
2281
2287
|
},
|
|
2282
|
-
children: n ? /* @__PURE__ */
|
|
2288
|
+
children: n ? /* @__PURE__ */ J(w, {
|
|
2283
2289
|
size: 24,
|
|
2284
|
-
icon: /* @__PURE__ */
|
|
2290
|
+
icon: /* @__PURE__ */ J(e.refresh, { size: 12 }),
|
|
2285
2291
|
onClick: () => T(t._key),
|
|
2286
2292
|
title: "Undo delete"
|
|
2287
|
-
}) : /* @__PURE__ */
|
|
2293
|
+
}) : /* @__PURE__ */ J(w, {
|
|
2288
2294
|
size: 24,
|
|
2289
|
-
icon: /* @__PURE__ */
|
|
2295
|
+
icon: /* @__PURE__ */ J(e.trash, { size: 12 }),
|
|
2290
2296
|
onClick: () => C(t._key),
|
|
2291
2297
|
title: "Delete row"
|
|
2292
2298
|
})
|
|
@@ -2294,12 +2300,12 @@ function Ot({ config: t, childEntity: r, schema: i, rows: a, onChange: o, valida
|
|
|
2294
2300
|
}, t._key);
|
|
2295
2301
|
}) })]
|
|
2296
2302
|
})
|
|
2297
|
-
}), /* @__PURE__ */
|
|
2303
|
+
}), /* @__PURE__ */ J("div", {
|
|
2298
2304
|
style: { marginTop: 8 },
|
|
2299
|
-
children: /* @__PURE__ */
|
|
2305
|
+
children: /* @__PURE__ */ J(O, {
|
|
2300
2306
|
kind: "ghost",
|
|
2301
2307
|
size: "xs",
|
|
2302
|
-
icon: /* @__PURE__ */
|
|
2308
|
+
icon: /* @__PURE__ */ J(e.plus, { size: 12 }),
|
|
2303
2309
|
onClick: S,
|
|
2304
2310
|
children: "Add row"
|
|
2305
2311
|
})
|
|
@@ -2307,25 +2313,25 @@ function Ot({ config: t, childEntity: r, schema: i, rows: a, onChange: o, valida
|
|
|
2307
2313
|
}
|
|
2308
2314
|
//#endregion
|
|
2309
2315
|
//#region src/components/detail-layout/ChildrenBlock.tsx
|
|
2310
|
-
var kt =
|
|
2316
|
+
var kt = ge(() => import("./DraggableChildrenTable-B6KjWkwD.js").then((e) => ({ default: e.DraggableChildrenTable })));
|
|
2311
2317
|
function At({ node: e, ctx: n }) {
|
|
2312
2318
|
let r = E(), i = e.children;
|
|
2313
2319
|
if (!i) return null;
|
|
2314
2320
|
let a = r.isPhone && n.relatedRecordsPresentation === "table";
|
|
2315
2321
|
if (n.isNew && n.mode !== "edit") return null;
|
|
2316
2322
|
let o = Ke(n.entity, i);
|
|
2317
|
-
if (!o) return /* @__PURE__ */
|
|
2323
|
+
if (!o) return /* @__PURE__ */ Y("div", {
|
|
2318
2324
|
className: "text-sm text-muted-foreground py-2",
|
|
2319
2325
|
children: ["Unknown child relation: ", i]
|
|
2320
2326
|
});
|
|
2321
2327
|
let s = n.schema.entities[o.entity];
|
|
2322
|
-
if (!s) return /* @__PURE__ */
|
|
2328
|
+
if (!s) return /* @__PURE__ */ Y("div", {
|
|
2323
2329
|
className: "text-sm text-muted-foreground py-2",
|
|
2324
2330
|
children: ["Entity not found: ", o.entity]
|
|
2325
2331
|
});
|
|
2326
|
-
let c = Pe(o, s, e), l =
|
|
2332
|
+
let c = Pe(o, s, e), l = Ae(e, n), u = je(e, n), d = (e) => c.mode === "timeline" || n.withinCard ? e : /* @__PURE__ */ J(ue, {
|
|
2327
2333
|
title: l,
|
|
2328
|
-
icon: u ? /* @__PURE__ */
|
|
2334
|
+
icon: u ? /* @__PURE__ */ J(t, {
|
|
2329
2335
|
name: u,
|
|
2330
2336
|
size: 14
|
|
2331
2337
|
}) : void 0,
|
|
@@ -2333,9 +2339,9 @@ function At({ node: e, ctx: n }) {
|
|
|
2333
2339
|
});
|
|
2334
2340
|
if (n.mode === "edit" && c.editable && c.interaction !== "navigate" && c.interaction !== "readonly" && v(s, "update") && c.mode === "table" && n.pendingChildren !== void 0 && n.onChildrenChange) {
|
|
2335
2341
|
let e = n.pendingChildren[i] ?? [], t = n.childValidationErrors?.[i], o = c.position_field ? r.isPhone && !a ? Ot : kt : Ot;
|
|
2336
|
-
return d(/* @__PURE__ */
|
|
2337
|
-
fallback: /* @__PURE__ */
|
|
2338
|
-
children: /* @__PURE__ */
|
|
2342
|
+
return d(/* @__PURE__ */ J(me, {
|
|
2343
|
+
fallback: /* @__PURE__ */ J(ee, {}),
|
|
2344
|
+
children: /* @__PURE__ */ J(o, {
|
|
2339
2345
|
config: c,
|
|
2340
2346
|
childEntity: s,
|
|
2341
2347
|
schema: n.schema,
|
|
@@ -2355,10 +2361,10 @@ function At({ node: e, ctx: n }) {
|
|
|
2355
2361
|
schema: n.schema
|
|
2356
2362
|
};
|
|
2357
2363
|
switch (c.mode) {
|
|
2358
|
-
case "list": return d(/* @__PURE__ */
|
|
2359
|
-
case "cards": return d(/* @__PURE__ */
|
|
2360
|
-
case "timeline": return d(/* @__PURE__ */
|
|
2361
|
-
default: return r.isPhone && !a ? d(/* @__PURE__ */
|
|
2364
|
+
case "list": return d(/* @__PURE__ */ J(nt, { ...f }));
|
|
2365
|
+
case "cards": return d(/* @__PURE__ */ J(rt, { ...f }));
|
|
2366
|
+
case "timeline": return d(/* @__PURE__ */ J(bt, { ...f }));
|
|
2367
|
+
default: return r.isPhone && !a ? d(/* @__PURE__ */ J(rt, { ...f })) : d(/* @__PURE__ */ J(tt, { ...f }));
|
|
2362
2368
|
}
|
|
2363
2369
|
}
|
|
2364
2370
|
//#endregion
|
|
@@ -2369,10 +2375,10 @@ var jt = 150, Mt = 560, Nt = "20px", Pt = 4, Ft = /* @__PURE__ */ new Set([
|
|
|
2369
2375
|
"json",
|
|
2370
2376
|
"structure",
|
|
2371
2377
|
"multilang_text"
|
|
2372
|
-
]), It =
|
|
2378
|
+
]), It = he({ columns: 2 });
|
|
2373
2379
|
function Lt({ columns: e = 2, children: t }) {
|
|
2374
|
-
let n =
|
|
2375
|
-
|
|
2380
|
+
let n = G(null), [r, i] = K(!1);
|
|
2381
|
+
U(() => {
|
|
2376
2382
|
let t = n.current;
|
|
2377
2383
|
if (!t || e === 1 || typeof ResizeObserver > "u") return;
|
|
2378
2384
|
let r = new ResizeObserver(([e]) => {
|
|
@@ -2381,9 +2387,9 @@ function Lt({ columns: e = 2, children: t }) {
|
|
|
2381
2387
|
return r.observe(t), () => r.disconnect();
|
|
2382
2388
|
}, [e]);
|
|
2383
2389
|
let a = e === 1 || r ? 1 : e;
|
|
2384
|
-
return /* @__PURE__ */
|
|
2390
|
+
return /* @__PURE__ */ J(It.Provider, {
|
|
2385
2391
|
value: { columns: a },
|
|
2386
|
-
children: /* @__PURE__ */
|
|
2392
|
+
children: /* @__PURE__ */ J("div", {
|
|
2387
2393
|
ref: n,
|
|
2388
2394
|
style: {
|
|
2389
2395
|
display: "grid",
|
|
@@ -2396,8 +2402,8 @@ function Lt({ columns: e = 2, children: t }) {
|
|
|
2396
2402
|
});
|
|
2397
2403
|
}
|
|
2398
2404
|
function Rt({ label: t, children: n, span: r = !1, required: i, error: a, hint: o, actions: s, copyValue: c, mode: l = "display", htmlFor: u, labelId: d, labelTitle: f, "data-testid": p }) {
|
|
2399
|
-
let h =
|
|
2400
|
-
return /* @__PURE__ */
|
|
2405
|
+
let h = _e(It), g = r || h.columns === 1, _ = !!a;
|
|
2406
|
+
return /* @__PURE__ */ Y("div", {
|
|
2401
2407
|
className: "detail-row",
|
|
2402
2408
|
"data-error": _ || void 0,
|
|
2403
2409
|
"data-testid": p,
|
|
@@ -2409,7 +2415,7 @@ function Rt({ label: t, children: n, span: r = !1, required: i, error: a, hint:
|
|
|
2409
2415
|
padding: "6px 0",
|
|
2410
2416
|
...r ? { gridColumn: "1 / -1" } : null
|
|
2411
2417
|
},
|
|
2412
|
-
children: [/* @__PURE__ */
|
|
2418
|
+
children: [/* @__PURE__ */ Y("div", {
|
|
2413
2419
|
style: {
|
|
2414
2420
|
width: g ? "auto" : jt,
|
|
2415
2421
|
flexShrink: 0,
|
|
@@ -2422,16 +2428,16 @@ function Rt({ label: t, children: n, span: r = !1, required: i, error: a, hint:
|
|
|
2422
2428
|
alignItems: "flex-start",
|
|
2423
2429
|
gap: 2
|
|
2424
2430
|
},
|
|
2425
|
-
children: [u ? /* @__PURE__ */
|
|
2431
|
+
children: [u ? /* @__PURE__ */ J("label", {
|
|
2426
2432
|
id: d,
|
|
2427
2433
|
htmlFor: u,
|
|
2428
2434
|
title: f || void 0,
|
|
2429
2435
|
children: t
|
|
2430
|
-
}) : /* @__PURE__ */
|
|
2436
|
+
}) : /* @__PURE__ */ J("span", {
|
|
2431
2437
|
id: d,
|
|
2432
2438
|
title: f || void 0,
|
|
2433
2439
|
children: t
|
|
2434
|
-
}), i && l === "edit" && /* @__PURE__ */
|
|
2440
|
+
}), i && l === "edit" && /* @__PURE__ */ J("span", {
|
|
2435
2441
|
"aria-hidden": "true",
|
|
2436
2442
|
style: {
|
|
2437
2443
|
color: "var(--danger)",
|
|
@@ -2439,7 +2445,7 @@ function Rt({ label: t, children: n, span: r = !1, required: i, error: a, hint:
|
|
|
2439
2445
|
},
|
|
2440
2446
|
children: "*"
|
|
2441
2447
|
})]
|
|
2442
|
-
}), /* @__PURE__ */
|
|
2448
|
+
}), /* @__PURE__ */ Y("div", {
|
|
2443
2449
|
style: {
|
|
2444
2450
|
flex: 1,
|
|
2445
2451
|
minWidth: 0,
|
|
@@ -2447,14 +2453,14 @@ function Rt({ label: t, children: n, span: r = !1, required: i, error: a, hint:
|
|
|
2447
2453
|
flexDirection: "column",
|
|
2448
2454
|
gap: 3
|
|
2449
2455
|
},
|
|
2450
|
-
children: [/* @__PURE__ */
|
|
2456
|
+
children: [/* @__PURE__ */ Y("div", {
|
|
2451
2457
|
style: {
|
|
2452
2458
|
display: "flex",
|
|
2453
2459
|
alignItems: "flex-start",
|
|
2454
2460
|
gap: 6,
|
|
2455
2461
|
minHeight: 24
|
|
2456
2462
|
},
|
|
2457
|
-
children: [/* @__PURE__ */
|
|
2463
|
+
children: [/* @__PURE__ */ J("div", {
|
|
2458
2464
|
style: {
|
|
2459
2465
|
flex: 1,
|
|
2460
2466
|
minWidth: 0,
|
|
@@ -2464,14 +2470,14 @@ function Rt({ label: t, children: n, span: r = !1, required: i, error: a, hint:
|
|
|
2464
2470
|
overflowWrap: "anywhere",
|
|
2465
2471
|
paddingTop: l === "display" && !g ? Pt : 0
|
|
2466
2472
|
},
|
|
2467
|
-
children: _ && l === "edit" ? /* @__PURE__ */
|
|
2473
|
+
children: _ && l === "edit" ? /* @__PURE__ */ J("div", {
|
|
2468
2474
|
style: {
|
|
2469
2475
|
borderRadius: 6,
|
|
2470
2476
|
boxShadow: "0 0 0 1.5px var(--danger)"
|
|
2471
2477
|
},
|
|
2472
2478
|
children: n
|
|
2473
2479
|
}) : n
|
|
2474
|
-
}), (c || s) && /* @__PURE__ */
|
|
2480
|
+
}), (c || s) && /* @__PURE__ */ Y("div", {
|
|
2475
2481
|
className: "detail-row-action",
|
|
2476
2482
|
style: {
|
|
2477
2483
|
display: "flex",
|
|
@@ -2479,13 +2485,13 @@ function Rt({ label: t, children: n, span: r = !1, required: i, error: a, hint:
|
|
|
2479
2485
|
flexShrink: 0,
|
|
2480
2486
|
marginTop: -2
|
|
2481
2487
|
},
|
|
2482
|
-
children: [c && /* @__PURE__ */
|
|
2488
|
+
children: [c && /* @__PURE__ */ J(m, {
|
|
2483
2489
|
value: c,
|
|
2484
2490
|
size: "sm",
|
|
2485
2491
|
title: "Copy value"
|
|
2486
2492
|
}), s]
|
|
2487
2493
|
})]
|
|
2488
|
-
}), (_ || o != null) && /* @__PURE__ */
|
|
2494
|
+
}), (_ || o != null) && /* @__PURE__ */ Y("div", {
|
|
2489
2495
|
style: {
|
|
2490
2496
|
fontSize: 11.5,
|
|
2491
2497
|
lineHeight: 1.4,
|
|
@@ -2494,7 +2500,7 @@ function Rt({ label: t, children: n, span: r = !1, required: i, error: a, hint:
|
|
|
2494
2500
|
alignItems: "center",
|
|
2495
2501
|
gap: 4
|
|
2496
2502
|
},
|
|
2497
|
-
children: [_ && /* @__PURE__ */
|
|
2503
|
+
children: [_ && /* @__PURE__ */ J(e.warning, { size: 11 }), /* @__PURE__ */ J("span", { children: _ ? a : o })]
|
|
2498
2504
|
})]
|
|
2499
2505
|
})]
|
|
2500
2506
|
});
|
|
@@ -2503,16 +2509,16 @@ function Rt({ label: t, children: n, span: r = !1, required: i, error: a, hint:
|
|
|
2503
2509
|
//#region src/components/detail-layout/FieldsBlock.tsx
|
|
2504
2510
|
function zt({ fields: e, ctx: t }) {
|
|
2505
2511
|
let { entity: r, entityCode: i, record: a, mode: o, onFieldChange: s, schema: c } = t, u = n(), d = t.columns ?? 2, p = d === 1 && e.length === 1;
|
|
2506
|
-
return /* @__PURE__ */
|
|
2512
|
+
return /* @__PURE__ */ J(Lt, {
|
|
2507
2513
|
columns: d,
|
|
2508
2514
|
children: e.map((e) => {
|
|
2509
|
-
let n = e.name, d = `${i ?? "field"}-${n}`, m = `${d}-label`, h = r.fields.get(n), g = !!(h?.auto || h?.readonly || h?.source), _ =
|
|
2515
|
+
let n = e.name, d = `${i ?? "field"}-${n}`, m = `${d}-label`, h = r.fields.get(n), g = !!(h?.auto || h?.readonly || h?.source), _ = re(r, n), v = _?.read === "denied", y = _?.write === "denied", b = o === "display" ? v : y || v, x = g || o === "edit" && y ? "display" : o, S = b ? /* @__PURE__ */ J(z, {
|
|
2510
2516
|
tier: _.classification,
|
|
2511
|
-
tierDef:
|
|
2517
|
+
tierDef: B(c, r, n),
|
|
2512
2518
|
requiredPermission: _?.required_permission,
|
|
2513
2519
|
locale: u,
|
|
2514
2520
|
variant: x === "edit" ? "input" : "value"
|
|
2515
|
-
}) :
|
|
2521
|
+
}) : ne({
|
|
2516
2522
|
entity: r,
|
|
2517
2523
|
entityCode: i,
|
|
2518
2524
|
fieldName: n,
|
|
@@ -2524,10 +2530,11 @@ function zt({ fields: e, ctx: t }) {
|
|
|
2524
2530
|
screens: c?.screens,
|
|
2525
2531
|
locale: u,
|
|
2526
2532
|
fieldId: d,
|
|
2527
|
-
labelId: m
|
|
2533
|
+
labelId: m,
|
|
2534
|
+
structure: e.structure
|
|
2528
2535
|
});
|
|
2529
2536
|
if (!S) return null;
|
|
2530
|
-
let C = o === "display" && e.actions && e.actions.length > 0 ? /* @__PURE__ */ q
|
|
2537
|
+
let C = o === "display" && e.actions && e.actions.length > 0 ? /* @__PURE__ */ J(q, { children: e.actions.map((e, t) => /* @__PURE__ */ J(R, {
|
|
2531
2538
|
actionCode: `${n}.action[${t}]`,
|
|
2532
2539
|
action: e,
|
|
2533
2540
|
entityCode: i,
|
|
@@ -2535,9 +2542,9 @@ function zt({ fields: e, ctx: t }) {
|
|
|
2535
2542
|
variant: "ghost",
|
|
2536
2543
|
size: "icon"
|
|
2537
2544
|
}, t)) }) : void 0, w = !!h && Ft.has(h.type), T = a?.[n], E = x === "display" && (h?.copyable || h?.type === "uuid") && T != null && T !== "" ? l(T) : void 0, D = f(h?.display?.description);
|
|
2538
|
-
return p ? /* @__PURE__ */
|
|
2545
|
+
return p ? /* @__PURE__ */ Y("div", {
|
|
2539
2546
|
style: { gridColumn: "1 / -1" },
|
|
2540
|
-
children: [S, x === "edit" && D && /* @__PURE__ */
|
|
2547
|
+
children: [S, x === "edit" && D && /* @__PURE__ */ J("div", {
|
|
2541
2548
|
style: {
|
|
2542
2549
|
fontSize: 11.5,
|
|
2543
2550
|
lineHeight: 1.4,
|
|
@@ -2546,9 +2553,9 @@ function zt({ fields: e, ctx: t }) {
|
|
|
2546
2553
|
},
|
|
2547
2554
|
children: D
|
|
2548
2555
|
})]
|
|
2549
|
-
}, n) : /* @__PURE__ */
|
|
2556
|
+
}, n) : /* @__PURE__ */ J(Rt, {
|
|
2550
2557
|
"data-testid": `field-${n}`,
|
|
2551
|
-
label:
|
|
2558
|
+
label: le(r, n, c.entities),
|
|
2552
2559
|
htmlFor: x === "edit" ? d : void 0,
|
|
2553
2560
|
labelId: m,
|
|
2554
2561
|
labelTitle: D || void 0,
|
|
@@ -2579,11 +2586,11 @@ function Ht({ node: e, ctx: t }) {
|
|
|
2579
2586
|
let { entity: n, objectProperties: i, onSetProperty: a, isNew: o, mode: s, refs: c } = t, l = n.properties ?? {};
|
|
2580
2587
|
if (o) return null;
|
|
2581
2588
|
let u = e.properties === !0 || e.properties, d = u === !0 ? Object.entries(l).sort(([e], [t]) => e.localeCompare(t)) : u.filter((e) => l[e] != null).map((e) => [e, l[e]]);
|
|
2582
|
-
return d.length === 0 ? null : /* @__PURE__ */
|
|
2589
|
+
return d.length === 0 ? null : /* @__PURE__ */ J(Lt, {
|
|
2583
2590
|
columns: 2,
|
|
2584
2591
|
children: d.map(([e, o]) => {
|
|
2585
2592
|
let l = i?.find((t) => t.property_code === e), u = r(o), d = o.readonly || !a ? "display" : s;
|
|
2586
|
-
return /* @__PURE__ */
|
|
2593
|
+
return /* @__PURE__ */ J(Ut, {
|
|
2587
2594
|
propCode: e,
|
|
2588
2595
|
prop: o,
|
|
2589
2596
|
field: u,
|
|
@@ -2598,24 +2605,24 @@ function Ht({ node: e, ctx: t }) {
|
|
|
2598
2605
|
});
|
|
2599
2606
|
}
|
|
2600
2607
|
function Ut({ propCode: e, prop: t, field: r, value: i, mode: a, onSetProperty: o, refs: s, entity: c, schema: l }) {
|
|
2601
|
-
let u = n(), d =
|
|
2602
|
-
|
|
2608
|
+
let u = n(), d = G(null);
|
|
2609
|
+
U(() => () => {
|
|
2603
2610
|
d.current && clearTimeout(d.current);
|
|
2604
2611
|
}, []);
|
|
2605
|
-
let p =
|
|
2612
|
+
let p = H((n) => {
|
|
2606
2613
|
o && (Bt.has(t.type) ? (d.current && clearTimeout(d.current), d.current = setTimeout(() => o(e, n), Vt)) : o(e, n));
|
|
2607
2614
|
}, [
|
|
2608
2615
|
e,
|
|
2609
2616
|
t.type,
|
|
2610
2617
|
o
|
|
2611
|
-
]), m =
|
|
2612
|
-
return /* @__PURE__ */
|
|
2618
|
+
]), m = re(c, e), h = m?.read === "denied", g = m?.write === "denied", _ = a === "display" ? h : g || h, v = a === "edit" && g ? "display" : a;
|
|
2619
|
+
return /* @__PURE__ */ J(Rt, {
|
|
2613
2620
|
label: f(t.display?.name ?? t.name),
|
|
2614
2621
|
mode: v,
|
|
2615
2622
|
span: Ft.has(t.type),
|
|
2616
|
-
children: _ ? /* @__PURE__ */
|
|
2623
|
+
children: _ ? /* @__PURE__ */ J(z, {
|
|
2617
2624
|
tier: m.classification,
|
|
2618
|
-
tierDef:
|
|
2625
|
+
tierDef: B(l, c, e),
|
|
2619
2626
|
requiredPermission: m?.required_permission,
|
|
2620
2627
|
locale: u,
|
|
2621
2628
|
variant: v === "edit" ? "input" : "value"
|
|
@@ -2634,7 +2641,7 @@ function Ut({ propCode: e, prop: t, field: r, value: i, mode: a, onSetProperty:
|
|
|
2634
2641
|
//#region src/components/shared/StatusStepper.tsx
|
|
2635
2642
|
function Wt({ stages: t, current: n, selectable: r, onSelect: i, compact: a = !1 }) {
|
|
2636
2643
|
let o = t.findIndex((e) => e.code === n);
|
|
2637
|
-
return /* @__PURE__ */
|
|
2644
|
+
return /* @__PURE__ */ J("div", {
|
|
2638
2645
|
role: "list",
|
|
2639
2646
|
style: {
|
|
2640
2647
|
display: "flex",
|
|
@@ -2646,7 +2653,7 @@ function Wt({ stages: t, current: n, selectable: r, onSelect: i, compact: a = !1
|
|
|
2646
2653
|
},
|
|
2647
2654
|
children: t.map((n, s) => {
|
|
2648
2655
|
let c = o >= 0 && s < o, l = s === o, u = o < 0 || s > o, d = !!i && (r?.has(n.code) ?? !1), f = s === 0, p = s === t.length - 1, m = l ? "var(--accent-soft)" : c ? "var(--success-soft)" : "transparent", h = l ? "var(--accent)" : c ? "var(--success)" : "var(--text-3)", g = f && p ? void 0 : f ? "polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%)" : p ? "polygon(0 0, 100% 0, 100% 100%, 0 100%, 10px 50%)" : "polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%, 10px 50%)";
|
|
2649
|
-
return /* @__PURE__ */
|
|
2656
|
+
return /* @__PURE__ */ Y("button", {
|
|
2650
2657
|
role: "listitem",
|
|
2651
2658
|
type: "button",
|
|
2652
2659
|
disabled: !d,
|
|
@@ -2670,7 +2677,7 @@ function Wt({ stages: t, current: n, selectable: r, onSelect: i, compact: a = !1
|
|
|
2670
2677
|
clipPath: g,
|
|
2671
2678
|
whiteSpace: "nowrap"
|
|
2672
2679
|
},
|
|
2673
|
-
children: [/* @__PURE__ */
|
|
2680
|
+
children: [/* @__PURE__ */ J("span", {
|
|
2674
2681
|
style: {
|
|
2675
2682
|
width: 16,
|
|
2676
2683
|
height: 16,
|
|
@@ -2685,8 +2692,8 @@ function Wt({ stages: t, current: n, selectable: r, onSelect: i, compact: a = !1
|
|
|
2685
2692
|
fontSize: 9.5,
|
|
2686
2693
|
fontWeight: 700
|
|
2687
2694
|
},
|
|
2688
|
-
children: c ? /* @__PURE__ */
|
|
2689
|
-
}), /* @__PURE__ */
|
|
2695
|
+
children: c ? /* @__PURE__ */ J(e.check, { size: 10 }) : s + 1
|
|
2696
|
+
}), /* @__PURE__ */ J("span", {
|
|
2690
2697
|
style: {
|
|
2691
2698
|
overflow: "hidden",
|
|
2692
2699
|
textOverflow: "ellipsis"
|
|
@@ -2700,7 +2707,7 @@ function Wt({ stages: t, current: n, selectable: r, onSelect: i, compact: a = !1
|
|
|
2700
2707
|
//#endregion
|
|
2701
2708
|
//#region src/components/shared/StatusGroupsDisplay.tsx
|
|
2702
2709
|
function Gt({ statusGroups: e, objectStatuses: t, onSetStatus: n, isPending: r, mode: i = "edit" }) {
|
|
2703
|
-
return /* @__PURE__ */
|
|
2710
|
+
return /* @__PURE__ */ J("div", {
|
|
2704
2711
|
style: {
|
|
2705
2712
|
display: "flex",
|
|
2706
2713
|
flexWrap: "wrap",
|
|
@@ -2711,27 +2718,27 @@ function Gt({ statusGroups: e, objectStatuses: t, onSetStatus: n, isPending: r,
|
|
|
2711
2718
|
let o = t?.find((t) => t.group_code === e)?.status_code, s = o ? a.statuses.find((e) => e.code === o) : void 0;
|
|
2712
2719
|
if (a.display_mode === "stepper") {
|
|
2713
2720
|
let t = i === "edit", s = t ? a.transitions && o ? /* @__PURE__ */ new Set([o, ...a.transitions[o] ?? []]) : new Set(a.statuses.map((e) => e.code)) : void 0;
|
|
2714
|
-
return /* @__PURE__ */
|
|
2721
|
+
return /* @__PURE__ */ Y("div", {
|
|
2715
2722
|
style: {
|
|
2716
2723
|
display: "flex",
|
|
2717
2724
|
alignItems: "center",
|
|
2718
2725
|
gap: 8,
|
|
2719
2726
|
minWidth: 0
|
|
2720
2727
|
},
|
|
2721
|
-
children: [/* @__PURE__ */
|
|
2728
|
+
children: [/* @__PURE__ */ Y("span", {
|
|
2722
2729
|
style: {
|
|
2723
2730
|
fontSize: 12,
|
|
2724
2731
|
color: "var(--text-3)",
|
|
2725
2732
|
flexShrink: 0
|
|
2726
2733
|
},
|
|
2727
2734
|
children: [f(a.name), ":"]
|
|
2728
|
-
}), /* @__PURE__ */
|
|
2735
|
+
}), /* @__PURE__ */ J("div", {
|
|
2729
2736
|
style: {
|
|
2730
2737
|
minWidth: 240,
|
|
2731
2738
|
opacity: r ? .6 : 1,
|
|
2732
2739
|
pointerEvents: r ? "none" : "auto"
|
|
2733
2740
|
},
|
|
2734
|
-
children: /* @__PURE__ */
|
|
2741
|
+
children: /* @__PURE__ */ J(Wt, {
|
|
2735
2742
|
stages: a.statuses.map((e) => ({
|
|
2736
2743
|
code: e.code,
|
|
2737
2744
|
label: f(e.name)
|
|
@@ -2744,23 +2751,23 @@ function Gt({ statusGroups: e, objectStatuses: t, onSetStatus: n, isPending: r,
|
|
|
2744
2751
|
})]
|
|
2745
2752
|
}, e);
|
|
2746
2753
|
}
|
|
2747
|
-
if (i === "display") return /* @__PURE__ */
|
|
2754
|
+
if (i === "display") return /* @__PURE__ */ Y("div", {
|
|
2748
2755
|
style: {
|
|
2749
2756
|
display: "flex",
|
|
2750
2757
|
alignItems: "center",
|
|
2751
2758
|
gap: 8
|
|
2752
2759
|
},
|
|
2753
|
-
children: [/* @__PURE__ */
|
|
2760
|
+
children: [/* @__PURE__ */ Y("span", {
|
|
2754
2761
|
style: {
|
|
2755
2762
|
fontSize: 12,
|
|
2756
2763
|
color: "var(--text-3)"
|
|
2757
2764
|
},
|
|
2758
2765
|
children: [f(a.name), ":"]
|
|
2759
|
-
}), s ? /* @__PURE__ */
|
|
2766
|
+
}), s ? /* @__PURE__ */ J(y, {
|
|
2760
2767
|
tone: s.color ?? "slate",
|
|
2761
2768
|
size: "xs",
|
|
2762
2769
|
children: f(s.name)
|
|
2763
|
-
}) : /* @__PURE__ */
|
|
2770
|
+
}) : /* @__PURE__ */ J("span", {
|
|
2764
2771
|
style: {
|
|
2765
2772
|
fontSize: 12.5,
|
|
2766
2773
|
color: "var(--text-4)"
|
|
@@ -2770,13 +2777,13 @@ function Gt({ statusGroups: e, objectStatuses: t, onSetStatus: n, isPending: r,
|
|
|
2770
2777
|
}, e);
|
|
2771
2778
|
let l = (a.transitions && o ? a.statuses.filter((e) => e.code === o || (a.transitions[o]?.includes(e.code) ?? !1)) : a.statuses).map((e) => ({
|
|
2772
2779
|
value: e.code,
|
|
2773
|
-
label: /* @__PURE__ */
|
|
2780
|
+
label: /* @__PURE__ */ Y("span", {
|
|
2774
2781
|
style: {
|
|
2775
2782
|
display: "inline-flex",
|
|
2776
2783
|
alignItems: "center",
|
|
2777
2784
|
gap: 6
|
|
2778
2785
|
},
|
|
2779
|
-
children: [e.color && /* @__PURE__ */
|
|
2786
|
+
children: [e.color && /* @__PURE__ */ J("span", { style: {
|
|
2780
2787
|
width: 8,
|
|
2781
2788
|
height: 8,
|
|
2782
2789
|
borderRadius: 999,
|
|
@@ -2785,25 +2792,25 @@ function Gt({ statusGroups: e, objectStatuses: t, onSetStatus: n, isPending: r,
|
|
|
2785
2792
|
} }), f(e.name)]
|
|
2786
2793
|
})
|
|
2787
2794
|
}));
|
|
2788
|
-
return /* @__PURE__ */
|
|
2795
|
+
return /* @__PURE__ */ Y("div", {
|
|
2789
2796
|
style: {
|
|
2790
2797
|
display: "flex",
|
|
2791
2798
|
alignItems: "center",
|
|
2792
2799
|
gap: 8
|
|
2793
2800
|
},
|
|
2794
|
-
children: [/* @__PURE__ */
|
|
2801
|
+
children: [/* @__PURE__ */ Y("span", {
|
|
2795
2802
|
style: {
|
|
2796
2803
|
fontSize: 12,
|
|
2797
2804
|
color: "var(--text-3)"
|
|
2798
2805
|
},
|
|
2799
2806
|
children: [f(a.name), ":"]
|
|
2800
|
-
}), /* @__PURE__ */
|
|
2807
|
+
}), /* @__PURE__ */ J("div", {
|
|
2801
2808
|
style: {
|
|
2802
2809
|
minWidth: 180,
|
|
2803
2810
|
opacity: r ? .6 : 1,
|
|
2804
2811
|
pointerEvents: r ? "none" : "auto"
|
|
2805
2812
|
},
|
|
2806
|
-
children: /* @__PURE__ */
|
|
2813
|
+
children: /* @__PURE__ */ J(c, {
|
|
2807
2814
|
value: o ?? "",
|
|
2808
2815
|
options: l,
|
|
2809
2816
|
onChange: (t) => n(e, t),
|
|
@@ -2821,7 +2828,7 @@ function qt({ node: e, ctx: t }) {
|
|
|
2821
2828
|
let { entity: n, objectStatuses: r, onSetStatus: i, isStatusPending: a, isNew: o } = t, s = n.status_groups ?? {};
|
|
2822
2829
|
if (o) return null;
|
|
2823
2830
|
let c = e.statuses === !0 || e.statuses, l = Object.fromEntries(Object.entries(s).filter(([e]) => c === !0 || c.includes(e)));
|
|
2824
|
-
return Object.keys(l).length === 0 ? null : /* @__PURE__ */
|
|
2831
|
+
return Object.keys(l).length === 0 ? null : /* @__PURE__ */ J(Gt, {
|
|
2825
2832
|
statusGroups: l,
|
|
2826
2833
|
objectStatuses: r,
|
|
2827
2834
|
onSetStatus: i ?? Kt,
|
|
@@ -2862,29 +2869,29 @@ function Xt(e) {
|
|
|
2862
2869
|
}
|
|
2863
2870
|
//#endregion
|
|
2864
2871
|
//#region src/components/detail-layout/widgets/JsonDiffWidget.tsx
|
|
2865
|
-
var Zt = "Audit change diff", Qt =
|
|
2872
|
+
var Zt = "Audit change diff", Qt = ge(() => import("./MonacoJson-BG3S3GHX.js").then((e) => ({ default: e.MonacoJsonDiff }))), $t = ge(() => import("./MonacoJson-BG3S3GHX.js").then((e) => ({ default: e.MonacoJsonSource }))), en = ge(() => import("./JsonEditor-DoNmyrYd.js").then((e) => ({ default: e.JsonEditor })));
|
|
2866
2873
|
function tn() {
|
|
2867
|
-
return /* @__PURE__ */
|
|
2874
|
+
return /* @__PURE__ */ J("div", {
|
|
2868
2875
|
className: "flex h-full w-full items-center justify-center text-sm text-muted-foreground",
|
|
2869
2876
|
children: "Loading editor…"
|
|
2870
2877
|
});
|
|
2871
2878
|
}
|
|
2872
2879
|
function nn({ before: e, after: t }) {
|
|
2873
|
-
return /* @__PURE__ */
|
|
2874
|
-
fallback: /* @__PURE__ */
|
|
2875
|
-
children: /* @__PURE__ */
|
|
2880
|
+
return /* @__PURE__ */ J(me, {
|
|
2881
|
+
fallback: /* @__PURE__ */ J(tn, {}),
|
|
2882
|
+
children: /* @__PURE__ */ Y("div", {
|
|
2876
2883
|
className: "flex h-full w-full gap-2",
|
|
2877
2884
|
role: "group",
|
|
2878
2885
|
"aria-label": Zt,
|
|
2879
|
-
children: [/* @__PURE__ */
|
|
2886
|
+
children: [/* @__PURE__ */ J("div", {
|
|
2880
2887
|
className: "min-w-0 flex-1",
|
|
2881
|
-
children: /* @__PURE__ */
|
|
2888
|
+
children: /* @__PURE__ */ J(en, {
|
|
2882
2889
|
value: e,
|
|
2883
2890
|
readOnly: !0
|
|
2884
2891
|
})
|
|
2885
|
-
}), /* @__PURE__ */
|
|
2892
|
+
}), /* @__PURE__ */ J("div", {
|
|
2886
2893
|
className: "min-w-0 flex-1",
|
|
2887
|
-
children: /* @__PURE__ */
|
|
2894
|
+
children: /* @__PURE__ */ J(en, {
|
|
2888
2895
|
value: t,
|
|
2889
2896
|
readOnly: !0
|
|
2890
2897
|
})
|
|
@@ -2893,17 +2900,17 @@ function nn({ before: e, after: t }) {
|
|
|
2893
2900
|
});
|
|
2894
2901
|
}
|
|
2895
2902
|
function rn({ mode: e, onChange: t }) {
|
|
2896
|
-
return /* @__PURE__ */
|
|
2903
|
+
return /* @__PURE__ */ Y("div", {
|
|
2897
2904
|
className: "inline-flex gap-1",
|
|
2898
2905
|
role: "group",
|
|
2899
2906
|
"aria-label": "Diff view mode",
|
|
2900
|
-
children: [/* @__PURE__ */
|
|
2907
|
+
children: [/* @__PURE__ */ J("button", {
|
|
2901
2908
|
type: "button",
|
|
2902
2909
|
"aria-pressed": e === "diff",
|
|
2903
2910
|
onClick: () => t("diff"),
|
|
2904
2911
|
className: `rounded px-2 py-0.5 text-xs ${e === "diff" ? "bg-accent text-accent-foreground" : "text-muted-foreground"}`,
|
|
2905
2912
|
children: "Diff"
|
|
2906
|
-
}), /* @__PURE__ */
|
|
2913
|
+
}), /* @__PURE__ */ J("button", {
|
|
2907
2914
|
type: "button",
|
|
2908
2915
|
"aria-pressed": e === "source",
|
|
2909
2916
|
onClick: () => t("source"),
|
|
@@ -2913,41 +2920,41 @@ function rn({ mode: e, onChange: t }) {
|
|
|
2913
2920
|
});
|
|
2914
2921
|
}
|
|
2915
2922
|
function an({ values: e, options: t }) {
|
|
2916
|
-
let n = e.before, r = e.after,
|
|
2917
|
-
return /* @__PURE__ */
|
|
2923
|
+
let n = e.before, r = e.after, i = t?.default_mode === "source" ? "source" : "diff", [a, o] = K(i), s = Xt(n), c = Xt(r);
|
|
2924
|
+
return /* @__PURE__ */ Y("div", {
|
|
2918
2925
|
className: "flex flex-col gap-2",
|
|
2919
|
-
children: [/* @__PURE__ */
|
|
2926
|
+
children: [/* @__PURE__ */ Y("div", {
|
|
2920
2927
|
className: "flex items-center justify-between",
|
|
2921
|
-
children: [/* @__PURE__ */
|
|
2922
|
-
mode:
|
|
2923
|
-
onChange:
|
|
2924
|
-
}),
|
|
2928
|
+
children: [/* @__PURE__ */ J(rn, {
|
|
2929
|
+
mode: a,
|
|
2930
|
+
onChange: o
|
|
2931
|
+
}), s === c && /* @__PURE__ */ J("span", {
|
|
2925
2932
|
className: "text-xs text-muted-foreground",
|
|
2926
2933
|
role: "status",
|
|
2927
2934
|
children: "No field changes"
|
|
2928
2935
|
})]
|
|
2929
|
-
}), /* @__PURE__ */
|
|
2936
|
+
}), /* @__PURE__ */ J("div", {
|
|
2930
2937
|
className: "h-[480px] w-full overflow-hidden rounded border",
|
|
2931
2938
|
role: "group",
|
|
2932
2939
|
"aria-label": Zt,
|
|
2933
|
-
children: /* @__PURE__ */
|
|
2934
|
-
fallback: /* @__PURE__ */
|
|
2940
|
+
children: /* @__PURE__ */ J(oe, {
|
|
2941
|
+
fallback: /* @__PURE__ */ J(nn, {
|
|
2935
2942
|
before: n,
|
|
2936
2943
|
after: r
|
|
2937
2944
|
}),
|
|
2938
|
-
children: /* @__PURE__ */
|
|
2939
|
-
fallback: /* @__PURE__ */
|
|
2940
|
-
children:
|
|
2941
|
-
before:
|
|
2942
|
-
after:
|
|
2943
|
-
}) : /* @__PURE__ */
|
|
2945
|
+
children: /* @__PURE__ */ J(me, {
|
|
2946
|
+
fallback: /* @__PURE__ */ J(tn, {}),
|
|
2947
|
+
children: a === "diff" ? /* @__PURE__ */ J(Qt, {
|
|
2948
|
+
before: s,
|
|
2949
|
+
after: c
|
|
2950
|
+
}) : /* @__PURE__ */ Y("div", {
|
|
2944
2951
|
className: "flex h-full w-full gap-2",
|
|
2945
|
-
children: [/* @__PURE__ */
|
|
2952
|
+
children: [/* @__PURE__ */ J("div", {
|
|
2946
2953
|
className: "min-w-0 flex-1",
|
|
2947
|
-
children: /* @__PURE__ */
|
|
2948
|
-
}), /* @__PURE__ */
|
|
2954
|
+
children: /* @__PURE__ */ J($t, { value: s })
|
|
2955
|
+
}), /* @__PURE__ */ J("div", {
|
|
2949
2956
|
className: "min-w-0 flex-1",
|
|
2950
|
-
children: /* @__PURE__ */
|
|
2957
|
+
children: /* @__PURE__ */ J($t, { value: c })
|
|
2951
2958
|
})]
|
|
2952
2959
|
})
|
|
2953
2960
|
})
|
|
@@ -3061,10 +3068,10 @@ function un(e, t) {
|
|
|
3061
3068
|
return !t || Object.entries(t).every(([t, n]) => e[t] === n);
|
|
3062
3069
|
}
|
|
3063
3070
|
function dn({ values: e, options: t }) {
|
|
3064
|
-
let r =
|
|
3065
|
-
|
|
3071
|
+
let r = W(() => sn(t), [t]), i = n(), a = V(), o = e.scope, s = r?.windows.some((e) => e.code === r.default_window) ? r.default_window : r?.windows[0]?.code ?? "", [c, l] = K(s), [u, d] = K("");
|
|
3072
|
+
U(() => {
|
|
3066
3073
|
l(s);
|
|
3067
|
-
}, [s]),
|
|
3074
|
+
}, [s]), U(() => {
|
|
3068
3075
|
d("");
|
|
3069
3076
|
}, [c]);
|
|
3070
3077
|
let m = r ? [{
|
|
@@ -3091,7 +3098,7 @@ function dn({ values: e, options: t }) {
|
|
|
3091
3098
|
sort: g?.sort,
|
|
3092
3099
|
filters: _
|
|
3093
3100
|
}, !!(g && o && c));
|
|
3094
|
-
if (!r || !o) return /* @__PURE__ */
|
|
3101
|
+
if (!r || !o) return /* @__PURE__ */ J("div", {
|
|
3095
3102
|
role: "alert",
|
|
3096
3103
|
className: "rounded border border-destructive p-3 text-sm text-destructive",
|
|
3097
3104
|
children: "Invalid entity_scorecard configuration."
|
|
@@ -3118,52 +3125,52 @@ function dn({ values: e, options: t }) {
|
|
|
3118
3125
|
value: e.drillthrough_value
|
|
3119
3126
|
}), a(t.route, { search: new URLSearchParams({ filters: JSON.stringify(n) }).toString() });
|
|
3120
3127
|
}, T = h.error ?? v.error;
|
|
3121
|
-
return /* @__PURE__ */
|
|
3128
|
+
return /* @__PURE__ */ Y("div", {
|
|
3122
3129
|
className: "flex min-w-0 flex-col gap-4",
|
|
3123
3130
|
"aria-label": f(r.title, i) || "Scorecard",
|
|
3124
3131
|
children: [
|
|
3125
|
-
/* @__PURE__ */
|
|
3132
|
+
/* @__PURE__ */ Y("div", {
|
|
3126
3133
|
className: "flex flex-wrap items-start justify-between gap-3",
|
|
3127
|
-
children: [/* @__PURE__ */
|
|
3134
|
+
children: [/* @__PURE__ */ Y("div", {
|
|
3128
3135
|
className: "min-w-0",
|
|
3129
3136
|
children: [
|
|
3130
|
-
r.title && /* @__PURE__ */
|
|
3137
|
+
r.title && /* @__PURE__ */ J("h3", {
|
|
3131
3138
|
className: "text-base font-semibold text-foreground",
|
|
3132
3139
|
children: f(r.title, i)
|
|
3133
3140
|
}),
|
|
3134
|
-
r.description && /* @__PURE__ */
|
|
3141
|
+
r.description && /* @__PURE__ */ J("p", {
|
|
3135
3142
|
className: "mt-1 text-sm text-muted-foreground",
|
|
3136
3143
|
children: f(r.description, i)
|
|
3137
3144
|
}),
|
|
3138
|
-
r.intended_note && /* @__PURE__ */
|
|
3145
|
+
r.intended_note && /* @__PURE__ */ J("p", {
|
|
3139
3146
|
className: "mt-1 text-xs text-muted-foreground",
|
|
3140
3147
|
children: f(r.intended_note, i)
|
|
3141
3148
|
})
|
|
3142
3149
|
]
|
|
3143
|
-
}), /* @__PURE__ */
|
|
3150
|
+
}), /* @__PURE__ */ Y("div", {
|
|
3144
3151
|
className: "flex flex-wrap items-center gap-2",
|
|
3145
|
-
children: [/* @__PURE__ */
|
|
3152
|
+
children: [/* @__PURE__ */ J("div", {
|
|
3146
3153
|
role: "group",
|
|
3147
3154
|
"aria-label": "Scorecard window",
|
|
3148
3155
|
className: "inline-flex rounded border border-border p-1",
|
|
3149
|
-
children: r.windows.map((e) => /* @__PURE__ */
|
|
3156
|
+
children: r.windows.map((e) => /* @__PURE__ */ J("button", {
|
|
3150
3157
|
type: "button",
|
|
3151
3158
|
"aria-pressed": c === e.code,
|
|
3152
3159
|
onClick: () => l(e.code),
|
|
3153
3160
|
className: `rounded px-3 py-1.5 text-xs font-medium ${c === e.code ? "bg-accent text-accent-foreground" : "text-muted-foreground"}`,
|
|
3154
3161
|
children: f(e.label, i) || e.code
|
|
3155
3162
|
}, e.code))
|
|
3156
|
-
}), g?.filter_field && /* @__PURE__ */
|
|
3163
|
+
}), g?.filter_field && /* @__PURE__ */ Y("label", {
|
|
3157
3164
|
className: "flex items-center gap-2 text-xs text-muted-foreground",
|
|
3158
|
-
children: [f(g.filter_label, i) || "Filter", /* @__PURE__ */
|
|
3165
|
+
children: [f(g.filter_label, i) || "Filter", /* @__PURE__ */ Y("select", {
|
|
3159
3166
|
"aria-label": f(g.filter_label, i) || "Filter",
|
|
3160
3167
|
value: u,
|
|
3161
3168
|
onChange: (e) => d(e.target.value),
|
|
3162
3169
|
className: "rounded border border-border bg-background px-2 py-1.5 text-foreground",
|
|
3163
|
-
children: [/* @__PURE__ */
|
|
3170
|
+
children: [/* @__PURE__ */ J("option", {
|
|
3164
3171
|
value: "",
|
|
3165
3172
|
children: f(g.all_label, i) || "All"
|
|
3166
|
-
}), x.map((e) => /* @__PURE__ */
|
|
3173
|
+
}), x.map((e) => /* @__PURE__ */ J("option", {
|
|
3167
3174
|
value: e,
|
|
3168
3175
|
children: e
|
|
3169
3176
|
}, e))]
|
|
@@ -3171,60 +3178,60 @@ function dn({ values: e, options: t }) {
|
|
|
3171
3178
|
})]
|
|
3172
3179
|
})]
|
|
3173
3180
|
}),
|
|
3174
|
-
T && /* @__PURE__ */
|
|
3181
|
+
T && /* @__PURE__ */ J("div", {
|
|
3175
3182
|
role: "alert",
|
|
3176
3183
|
className: "rounded border border-destructive p-3 text-sm text-destructive",
|
|
3177
3184
|
children: T instanceof Error ? T.message : "Scorecard data could not be loaded."
|
|
3178
3185
|
}),
|
|
3179
|
-
!T && !h.isLoading && !y && /* @__PURE__ */
|
|
3186
|
+
!T && !h.isLoading && !y && /* @__PURE__ */ J("div", {
|
|
3180
3187
|
className: "rounded border border-border p-6 text-center text-sm text-muted-foreground",
|
|
3181
3188
|
children: f(r.empty_label, i) || "No scorecard data."
|
|
3182
3189
|
}),
|
|
3183
|
-
y && /* @__PURE__ */
|
|
3190
|
+
y && /* @__PURE__ */ J("div", {
|
|
3184
3191
|
className: "grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-4",
|
|
3185
3192
|
children: r.metrics.map((e) => {
|
|
3186
|
-
let t = C(e), n = !!(r.drillthrough && e.drillthrough_value), a = /* @__PURE__ */
|
|
3187
|
-
/* @__PURE__ */
|
|
3193
|
+
let t = C(e), n = !!(r.drillthrough && e.drillthrough_value), a = /* @__PURE__ */ Y(q, { children: [
|
|
3194
|
+
/* @__PURE__ */ J("span", {
|
|
3188
3195
|
className: "text-xs font-medium text-muted-foreground",
|
|
3189
3196
|
children: f(e.label, i) || e.field
|
|
3190
3197
|
}),
|
|
3191
|
-
/* @__PURE__ */
|
|
3198
|
+
/* @__PURE__ */ J("strong", {
|
|
3192
3199
|
className: `mt-2 block text-2xl font-semibold ${e.attention && Number(t) > 0 ? "text-destructive" : "text-foreground"}`,
|
|
3193
3200
|
children: cn(t, e.format, i)
|
|
3194
3201
|
}),
|
|
3195
|
-
e.help && /* @__PURE__ */
|
|
3202
|
+
e.help && /* @__PURE__ */ J("span", {
|
|
3196
3203
|
className: "mt-1 block text-xs text-muted-foreground",
|
|
3197
3204
|
children: f(e.help, i)
|
|
3198
3205
|
})
|
|
3199
3206
|
] });
|
|
3200
|
-
return n ? /* @__PURE__ */
|
|
3207
|
+
return n ? /* @__PURE__ */ J("button", {
|
|
3201
3208
|
type: "button",
|
|
3202
3209
|
onClick: () => w(e),
|
|
3203
3210
|
className: "rounded border border-border bg-card p-3 text-left hover:bg-surface",
|
|
3204
3211
|
children: a
|
|
3205
|
-
}, e.field) : /* @__PURE__ */
|
|
3212
|
+
}, e.field) : /* @__PURE__ */ J("article", {
|
|
3206
3213
|
className: "rounded border border-border bg-card p-3",
|
|
3207
3214
|
children: a
|
|
3208
3215
|
}, e.field);
|
|
3209
3216
|
})
|
|
3210
3217
|
}),
|
|
3211
|
-
g && /* @__PURE__ */
|
|
3218
|
+
g && /* @__PURE__ */ J("div", {
|
|
3212
3219
|
className: "min-w-0 overflow-x-auto rounded border border-border",
|
|
3213
|
-
children: /* @__PURE__ */
|
|
3220
|
+
children: /* @__PURE__ */ Y("table", {
|
|
3214
3221
|
className: "w-full border-collapse text-sm",
|
|
3215
|
-
children: [/* @__PURE__ */
|
|
3222
|
+
children: [/* @__PURE__ */ J("thead", {
|
|
3216
3223
|
className: "bg-surface text-left text-xs text-muted-foreground",
|
|
3217
|
-
children: /* @__PURE__ */
|
|
3224
|
+
children: /* @__PURE__ */ J("tr", { children: g.columns.map((e) => /* @__PURE__ */ J("th", {
|
|
3218
3225
|
className: "border-b border-divider px-3 py-2 font-medium",
|
|
3219
3226
|
children: f(e.label, i) || e.field
|
|
3220
3227
|
}, e.field)) })
|
|
3221
|
-
}), /* @__PURE__ */
|
|
3228
|
+
}), /* @__PURE__ */ Y("tbody", { children: [S.map((e, t) => /* @__PURE__ */ J("tr", {
|
|
3222
3229
|
className: "border-b border-divider last:border-0",
|
|
3223
|
-
children: g.columns.map((t) => /* @__PURE__ */
|
|
3230
|
+
children: g.columns.map((t) => /* @__PURE__ */ J("td", {
|
|
3224
3231
|
className: "px-3 py-2 text-foreground",
|
|
3225
3232
|
children: cn(e[t.field], t.format, i)
|
|
3226
3233
|
}, t.field))
|
|
3227
|
-
}, ln(e, t))), !v.isLoading && S.length === 0 && /* @__PURE__ */
|
|
3234
|
+
}, ln(e, t))), !v.isLoading && S.length === 0 && /* @__PURE__ */ J("tr", { children: /* @__PURE__ */ J("td", {
|
|
3228
3235
|
colSpan: Math.max(1, g.columns.length),
|
|
3229
3236
|
className: "px-3 py-6 text-center text-muted-foreground",
|
|
3230
3237
|
children: f(g.empty_label, i) || "No breakdown rows."
|
|
@@ -3238,27 +3245,27 @@ function dn({ values: e, options: t }) {
|
|
|
3238
3245
|
//#region src/components/detail-layout/widgets/builtins.ts
|
|
3239
3246
|
var fn = !1;
|
|
3240
3247
|
function pn() {
|
|
3241
|
-
fn ||= (
|
|
3248
|
+
fn ||= (se("json_diff", an), se("entity_scorecard", dn), !0);
|
|
3242
3249
|
}
|
|
3243
3250
|
//#endregion
|
|
3244
3251
|
//#region src/components/detail-layout/widgets/WidgetHost.tsx
|
|
3245
3252
|
pn();
|
|
3246
3253
|
function mn({ config: e, ctx: t }) {
|
|
3247
|
-
let n =
|
|
3248
|
-
if (!n) return /* @__PURE__ */
|
|
3254
|
+
let n = ce(e.type);
|
|
3255
|
+
if (!n) return /* @__PURE__ */ J("span", {
|
|
3249
3256
|
className: "text-sm text-muted-foreground",
|
|
3250
3257
|
children: `unknown widget: ${e.type}`
|
|
3251
3258
|
});
|
|
3252
3259
|
let r = e.inputs ?? {}, i = t.record, a = {};
|
|
3253
3260
|
for (let [e, t] of Object.entries(r)) a[e] = i[t];
|
|
3254
|
-
return /* @__PURE__ */
|
|
3261
|
+
return /* @__PURE__ */ J("div", {
|
|
3255
3262
|
style: {
|
|
3256
3263
|
minWidth: 0,
|
|
3257
3264
|
maxWidth: "100%",
|
|
3258
3265
|
overflowX: "auto",
|
|
3259
3266
|
WebkitOverflowScrolling: "touch"
|
|
3260
3267
|
},
|
|
3261
|
-
children: /* @__PURE__ */
|
|
3268
|
+
children: /* @__PURE__ */ J(n, {
|
|
3262
3269
|
inputs: r,
|
|
3263
3270
|
values: a,
|
|
3264
3271
|
record: i,
|
|
@@ -3270,41 +3277,41 @@ function mn({ config: e, ctx: t }) {
|
|
|
3270
3277
|
//#endregion
|
|
3271
3278
|
//#region src/components/detail-layout/LayoutRenderer.tsx
|
|
3272
3279
|
function hn({ nodes: e, ctx: t }) {
|
|
3273
|
-
return /* @__PURE__ */ q
|
|
3280
|
+
return /* @__PURE__ */ J(q, { children: e.map((e, n) => /* @__PURE__ */ J($, {
|
|
3274
3281
|
node: e,
|
|
3275
3282
|
ctx: t
|
|
3276
3283
|
}, n)) });
|
|
3277
3284
|
}
|
|
3278
3285
|
function $({ node: e, ctx: t }) {
|
|
3279
|
-
return e.row ? /* @__PURE__ */
|
|
3286
|
+
return e.row ? /* @__PURE__ */ J(Te, {
|
|
3280
3287
|
config: e.row,
|
|
3281
3288
|
ctx: t
|
|
3282
|
-
}) : e.column ? /* @__PURE__ */
|
|
3289
|
+
}) : e.column ? /* @__PURE__ */ J(Oe, {
|
|
3283
3290
|
config: e.column,
|
|
3284
3291
|
node: e,
|
|
3285
3292
|
ctx: t
|
|
3286
|
-
}) : e.tabs ? /* @__PURE__ */
|
|
3293
|
+
}) : e.tabs ? /* @__PURE__ */ J(Me, {
|
|
3287
3294
|
config: e.tabs,
|
|
3288
3295
|
ctx: t
|
|
3289
|
-
}) : e.section ? /* @__PURE__ */
|
|
3296
|
+
}) : e.section ? /* @__PURE__ */ J(Ne, {
|
|
3290
3297
|
config: e.section,
|
|
3291
3298
|
ctx: t
|
|
3292
|
-
}) : e.children ? /* @__PURE__ */
|
|
3299
|
+
}) : e.children ? /* @__PURE__ */ J(At, {
|
|
3293
3300
|
node: e,
|
|
3294
3301
|
ctx: t
|
|
3295
|
-
}) : e.associated ? /* @__PURE__ */
|
|
3302
|
+
}) : e.associated ? /* @__PURE__ */ J(ae, {
|
|
3296
3303
|
node: e,
|
|
3297
3304
|
ctx: t
|
|
3298
|
-
}) : e.fields ? /* @__PURE__ */
|
|
3305
|
+
}) : e.fields ? /* @__PURE__ */ J(zt, {
|
|
3299
3306
|
fields: e.fields,
|
|
3300
3307
|
ctx: t
|
|
3301
|
-
}) : e.properties == null ? e.statuses == null ? e.widget ? /* @__PURE__ */
|
|
3308
|
+
}) : e.properties == null ? e.statuses == null ? e.widget ? /* @__PURE__ */ J(mn, {
|
|
3302
3309
|
config: e.widget,
|
|
3303
3310
|
ctx: t
|
|
3304
|
-
}) : null : /* @__PURE__ */
|
|
3311
|
+
}) : null : /* @__PURE__ */ J(qt, {
|
|
3305
3312
|
node: e,
|
|
3306
3313
|
ctx: t
|
|
3307
|
-
}) : /* @__PURE__ */
|
|
3314
|
+
}) : /* @__PURE__ */ J(Ht, {
|
|
3308
3315
|
node: e,
|
|
3309
3316
|
ctx: t
|
|
3310
3317
|
});
|