@nivaro/react 0.3.24 → 0.3.25
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/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +45 -26
- package/dist/shared/components/FilePreviewLightbox.js +56 -35
- package/dist/shared/components/ItemEditForm.js +4309 -4263
- package/dist/shared/components/PageRenderer.js +63 -62
- package/dist/shared/components/RecordReadView.js +229 -229
- package/dist/shared/components/ReportView.js +123 -120
- package/dist/shared/components/ai/AiMarkdown.js +168 -148
- package/dist/shared/components/chat/RoomParts.js +120 -119
- package/dist/shared/components/chat/chat-core.js +228 -224
- package/dist/shared/components/item-edit/FieldRenderer.js +333 -333
- package/dist/shared/components/item-edit/FieldRow.js +413 -394
- package/dist/shared/components/item-edit/GroupSection.js +637 -635
- package/dist/shared/components/item-edit/InlineGridField.js +89 -90
- package/dist/shared/components/item-edit/QuickPicker.js +9 -9
- package/dist/shared/components/item-edit/RawEditSheet.js +80 -79
- package/dist/shared/components/item-edit/RowMatchPanel.js +1 -1
- package/dist/shared/components/item-edit/m2m-invalidate.js +19 -0
- package/dist/shared/components/item-edit/record-lookups.js +15 -0
- package/dist/shared/components/item-edit/render-stability.js +147 -0
- package/dist/shared/components/layout-editor/FormMapButton.js +5 -4
- package/dist/shared/lib/safe-href.js +10 -0
- package/dist/shared/lib/socket-realtime.js +107 -78
- package/package.json +6 -6
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import { jsx as r, jsxs as m, Fragment as ge } from "react/jsx-runtime";
|
|
2
|
-
import { useQuery as V, useQueryClient as
|
|
3
|
-
import { Pencil as
|
|
4
|
-
import { useMemo as be, useRef as
|
|
5
|
-
import { DrilldownContext as
|
|
6
|
-
import { useDebounced as
|
|
7
|
-
import { parseAllowedCollections as
|
|
2
|
+
import { useQuery as V, useQueryClient as Rt } from "@tanstack/react-query";
|
|
3
|
+
import { Pencil as Ct, ChevronDown as Dt } from "lucide-react";
|
|
4
|
+
import { useMemo as be, useRef as Lt, useState as ee, useEffect as ye, useCallback as ct, Fragment as Et } from "react";
|
|
5
|
+
import { DrilldownContext as Pt, useNivaroClient as Oe, useApiFetchConfig as Kt, useDrilldown as ft } from "../context.js";
|
|
6
|
+
import { useDebounced as jt } from "../hooks/useDebounced.js";
|
|
7
|
+
import { parseAllowedCollections as It } from "../lib/allowed-collections.js";
|
|
8
8
|
import { get as G } from "../lib/commands.js";
|
|
9
|
-
import { readGroupStructure as
|
|
10
|
-
import { useLiveRecord as
|
|
11
|
-
import { isDisplayFormulaField as qe, resolvePlacementText as
|
|
12
|
-
import { useRecordReader as
|
|
13
|
-
import { sanitizeHtml as
|
|
14
|
-
import { titleCase as
|
|
15
|
-
import { matchesVisibleWhen as
|
|
16
|
-
import { InboundRequestPopover as
|
|
17
|
-
import { FileM2MField as
|
|
18
|
-
import { useFieldTouches as
|
|
19
|
-
import { richTextToPlain as
|
|
20
|
-
import { usePlacementTextContext as
|
|
21
|
-
import { UserChip as
|
|
22
|
-
import { DesignNode as
|
|
23
|
-
import { DesignCanvas as
|
|
24
|
-
import { revealGroupKey as
|
|
25
|
-
import { useRecordIntegrity as
|
|
26
|
-
import { SimpleSelectXs as
|
|
27
|
-
import { WidgetSlot as
|
|
9
|
+
import { readGroupStructure as Wt, isFolded as Mt, isEmptyValue as je, planFieldGrid as Vt } from "../lib/form-structure.js";
|
|
10
|
+
import { useLiveRecord as Ut } from "../lib/live.js";
|
|
11
|
+
import { isDisplayFormulaField as qe, resolvePlacementText as Bt, displayFormulaOf as Gt, formatDisplayValue as Jt } from "../lib/placement-behaviour.js";
|
|
12
|
+
import { useRecordReader as Ht } from "../lib/record-loader.js";
|
|
13
|
+
import { sanitizeHtml as Qt } from "../lib/sanitize-html.js";
|
|
14
|
+
import { titleCase as Qe, formatRelative as Te } from "../lib/utils.js";
|
|
15
|
+
import { matchesVisibleWhen as zt } from "../lib/visible-when.js";
|
|
16
|
+
import { InboundRequestPopover as Yt } from "./integrations/InboundRequest.js";
|
|
17
|
+
import { FileM2MField as Xt } from "./item-edit/FilePickerField.js";
|
|
18
|
+
import { useFieldTouches as Zt } from "./item-edit/HeaderFreshness.js";
|
|
19
|
+
import { richTextToPlain as el } from "./item-edit/helpers.js";
|
|
20
|
+
import { usePlacementTextContext as tl, evaluateDisplayFormula as ll } from "./item-edit/placement-behaviour.js";
|
|
21
|
+
import { UserChip as pt } from "./item-edit/UserChip.js";
|
|
22
|
+
import { DesignNode as rl } from "./layout-editor/DesignNode.js";
|
|
23
|
+
import { DesignCanvas as nl } from "./layout-editor/design-canvas.js";
|
|
24
|
+
import { revealGroupKey as al } from "./layout-editor/design-context.js";
|
|
25
|
+
import { useRecordIntegrity as il, integrityByField as sl } from "./panels/RecordIntegrityBanner.js";
|
|
26
|
+
import { SimpleSelectXs as ut } from "./ui/SimpleSelect.js";
|
|
27
|
+
import { WidgetSlot as dl } from "./WidgetSlot.js";
|
|
28
28
|
const he = (a) => {
|
|
29
29
|
if (!a) return {};
|
|
30
30
|
if (typeof a == "object") return a;
|
|
@@ -33,18 +33,18 @@ const he = (a) => {
|
|
|
33
33
|
} catch {
|
|
34
34
|
return {};
|
|
35
35
|
}
|
|
36
|
-
},
|
|
36
|
+
}, ht = (a) => {
|
|
37
37
|
const f = String(a).match(/^(\d{4})-(\d{2})-(\d{2})(?:[T ]00:00:00(?:\.0+)?(?:Z|[+-]00:?00)?)?$/);
|
|
38
38
|
if (f) return `${f[2]}/${f[3]}/${f[1]}`;
|
|
39
39
|
const y = new Date(String(a));
|
|
40
40
|
return Number.isNaN(y.getTime()) ? String(a) : `${String(y.getMonth() + 1).padStart(2, "0")}/${String(y.getDate()).padStart(2, "0")}/${y.getFullYear()}`;
|
|
41
|
-
},
|
|
41
|
+
}, ze = (a) => {
|
|
42
42
|
const f = Number(a);
|
|
43
43
|
return Number.isNaN(f) ? String(a) : `$${f.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`;
|
|
44
|
-
},
|
|
44
|
+
}, We = (a) => {
|
|
45
45
|
const f = Number(a);
|
|
46
46
|
return Number.isNaN(f) ? String(a) : f.toLocaleString("en-US");
|
|
47
|
-
},
|
|
47
|
+
}, Ie = "text-[11.5px] font-medium text-slate-500 dark:text-slate-400", te = () => /* @__PURE__ */ r("span", { className: "text-slate-300 dark:text-slate-600", children: "—" }), ol = `
|
|
48
48
|
[data-read-board]{grid-template-columns:minmax(0,1fr)}
|
|
49
49
|
[data-read-dl]{grid-template-columns:repeat(2,minmax(0,1fr))}
|
|
50
50
|
@media (min-width:640px){[data-read-dl="full"]{grid-template-columns:repeat(3,minmax(0,1fr))}}
|
|
@@ -59,7 +59,7 @@ const he = (a) => {
|
|
|
59
59
|
}
|
|
60
60
|
@media (min-width:1536px){[data-read-dl="full"]{grid-template-columns:repeat(6,minmax(0,1fr))}}
|
|
61
61
|
`;
|
|
62
|
-
function
|
|
62
|
+
function Me({
|
|
63
63
|
value: a,
|
|
64
64
|
trueTone: f = "positive"
|
|
65
65
|
}) {
|
|
@@ -72,8 +72,8 @@ function We({
|
|
|
72
72
|
}
|
|
73
73
|
);
|
|
74
74
|
}
|
|
75
|
-
function
|
|
76
|
-
const y = Oe(), c =
|
|
75
|
+
function cl({ collection: a, id: f }) {
|
|
76
|
+
const y = Oe(), c = Ht(), P = ft(), { data: S } = V({
|
|
77
77
|
queryKey: ["cbv-collection-meta", a],
|
|
78
78
|
queryFn: () => y.request(
|
|
79
79
|
G(`/collections/${a}`)
|
|
@@ -87,7 +87,7 @@ function dl({ collection: a, id: f }) {
|
|
|
87
87
|
staleTime: 6e4,
|
|
88
88
|
retry: !1
|
|
89
89
|
});
|
|
90
|
-
if (f == null) return /* @__PURE__ */ r(
|
|
90
|
+
if (f == null) return /* @__PURE__ */ r(te, {});
|
|
91
91
|
if (!$ && (W || !S))
|
|
92
92
|
return /* @__PURE__ */ r("span", { className: "inline-block h-3.5 w-20 animate-pulse rounded bg-slate-100 align-middle dark:bg-[hsl(var(--nvr-skeleton))]" });
|
|
93
93
|
if (!$) return /* @__PURE__ */ m("span", { className: "text-slate-400", children: [
|
|
@@ -125,8 +125,8 @@ function dl({ collection: a, id: f }) {
|
|
|
125
125
|
}
|
|
126
126
|
) : /* @__PURE__ */ r(ge, { children: _ });
|
|
127
127
|
}
|
|
128
|
-
function
|
|
129
|
-
const f = Oe(), { apiBase: y } =
|
|
128
|
+
function ul({ id: a }) {
|
|
129
|
+
const f = Oe(), { apiBase: y } = Kt(), { data: c, isPending: P } = V({
|
|
130
130
|
queryKey: ["rrv-file-meta", String(a)],
|
|
131
131
|
queryFn: () => f.request(
|
|
132
132
|
G(`/files/${a}/meta`)
|
|
@@ -135,7 +135,7 @@ function ol({ id: a }) {
|
|
|
135
135
|
staleTime: 5 * 6e4,
|
|
136
136
|
retry: !1
|
|
137
137
|
});
|
|
138
|
-
if (a == null) return /* @__PURE__ */ r(
|
|
138
|
+
if (a == null) return /* @__PURE__ */ r(te, {});
|
|
139
139
|
if (!c && P)
|
|
140
140
|
return /* @__PURE__ */ r("span", { className: "inline-block h-3.5 w-24 animate-pulse rounded bg-slate-100 align-middle dark:bg-[hsl(var(--nvr-skeleton))]" });
|
|
141
141
|
const S = (c == null ? void 0 : c.title) || (c == null ? void 0 : c.filename_download) || `#${String(a)}`;
|
|
@@ -150,8 +150,8 @@ function ol({ id: a }) {
|
|
|
150
150
|
}
|
|
151
151
|
);
|
|
152
152
|
}
|
|
153
|
-
const
|
|
154
|
-
function
|
|
153
|
+
const Ye = ({ collection: a, id: f }) => a === "nivaro_files" ? /* @__PURE__ */ r(ul, { id: f }) : /* @__PURE__ */ r(cl, { collection: a, id: f });
|
|
154
|
+
function ml({
|
|
155
155
|
junction: a,
|
|
156
156
|
parentFk: f,
|
|
157
157
|
junctionField: y,
|
|
@@ -168,7 +168,7 @@ function cl({
|
|
|
168
168
|
retry: !1
|
|
169
169
|
}), h = ((_ == null ? void 0 : _.relations) ?? []).find(
|
|
170
170
|
(v) => v.many_collection === a && v.many_field === y
|
|
171
|
-
), q =
|
|
171
|
+
), q = It(h == null ? void 0 : h.one_allowed_collections), K = !!h && !h.one_collection && (q.length > 0 || !!h.one_collection_field), M = (h == null ? void 0 : h.one_collection_field) ?? "collection", k = (v) => v ? v === "directus_users" ? "nivaro_users" : v : null, x = (h == null ? void 0 : h.one_collection) ?? (K ? q.some((v) => v === "directus_users" || v === "nivaro_users") ? "nivaro_users" : k(q[0]) : null), { data: b } = V({
|
|
172
172
|
// Under the edit form's ['m2m-items', junction, parentFk, parentId] prefix (a longer key,
|
|
173
173
|
// so never the same cache entry): every link write that refreshes the form's list —
|
|
174
174
|
// a file upload, a picker change, the save itself — refreshes Summary's too. Its own
|
|
@@ -206,8 +206,8 @@ function cl({
|
|
|
206
206
|
A !== void 0 && (P == null || P(A));
|
|
207
207
|
}, [A, P]), ye(() => {
|
|
208
208
|
N && (S == null || S(N));
|
|
209
|
-
}, [N, S]), _ && !N && (!K || b) ? /* @__PURE__ */ r(
|
|
210
|
-
|
|
209
|
+
}, [N, S]), _ && !N && (!K || b) ? /* @__PURE__ */ r(te, {}) : !O || !N ? /* @__PURE__ */ r("span", { className: "inline-block h-3.5 w-20 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }) : O.length === 0 ? /* @__PURE__ */ r(te, {}) : N === "nivaro_files" && $ ? /* @__PURE__ */ r("div", { className: "mt-1", children: /* @__PURE__ */ r(
|
|
210
|
+
Xt,
|
|
211
211
|
{
|
|
212
212
|
relation: $,
|
|
213
213
|
parentId: c,
|
|
@@ -219,14 +219,14 @@ function cl({
|
|
|
219
219
|
{
|
|
220
220
|
className: "inline-flex items-center whitespace-nowrap",
|
|
221
221
|
children: [
|
|
222
|
-
/* @__PURE__ */ r(
|
|
222
|
+
/* @__PURE__ */ r(Ye, { collection: w ?? N, id: v }),
|
|
223
223
|
F < O.length - 1 && /* @__PURE__ */ r("span", { className: "text-slate-300 dark:text-slate-600", children: "," })
|
|
224
224
|
]
|
|
225
225
|
},
|
|
226
226
|
`${w ?? N}:${v}`
|
|
227
227
|
)) });
|
|
228
228
|
}
|
|
229
|
-
function
|
|
229
|
+
function fl({
|
|
230
230
|
collection: a,
|
|
231
231
|
fkField: f,
|
|
232
232
|
parentId: y,
|
|
@@ -235,7 +235,7 @@ function ul({
|
|
|
235
235
|
defaultPreset: S,
|
|
236
236
|
onCount: $
|
|
237
237
|
}) {
|
|
238
|
-
const W = Oe(), _ =
|
|
238
|
+
const W = Oe(), _ = ft(), h = (P ?? []).filter((t) => t && Array.isArray(t.columns)), [q, K] = ee(
|
|
239
239
|
() => {
|
|
240
240
|
var t;
|
|
241
241
|
return h.length >= 2 ? ((t = h.find((i) => i.name === S)) == null ? void 0 : t.name) ?? h[0].name : "__all__";
|
|
@@ -278,20 +278,20 @@ function ul({
|
|
|
278
278
|
if (!N) return b;
|
|
279
279
|
const t = new Set(N.columns), i = b.filter((d) => t.has(d.field));
|
|
280
280
|
return i.length > 0 ? i : b;
|
|
281
|
-
}, [b, N]), [j, v] =
|
|
281
|
+
}, [b, N]), [j, v] = ee(""), [w, F] = ee(1), [ae, J] = ee({}), z = jt(ae, 350), Ae = be(() => {
|
|
282
282
|
const t = [
|
|
283
283
|
{ path: [f], op: "_eq", value: y }
|
|
284
284
|
];
|
|
285
|
-
for (const [i, d] of Object.entries(
|
|
285
|
+
for (const [i, d] of Object.entries(z)) {
|
|
286
286
|
if (!(d != null && d.value.trim())) continue;
|
|
287
287
|
const p = d.value.trim(), T = Number(p), D = d.op === "_contains" ? p : p === "true" || p === "false" ? p === "true" : Number.isNaN(T) ? p : T;
|
|
288
288
|
t.push({ path: [i], op: d.op, value: D });
|
|
289
289
|
}
|
|
290
290
|
return JSON.stringify(t);
|
|
291
|
-
}, [
|
|
291
|
+
}, [z, f, y]), u = 25, {
|
|
292
292
|
data: U,
|
|
293
|
-
isLoading:
|
|
294
|
-
isFetching:
|
|
293
|
+
isLoading: ce,
|
|
294
|
+
isFetching: Re
|
|
295
295
|
} = V({
|
|
296
296
|
queryKey: ["rrv-rows", a, f, y, j, O, w, Ae],
|
|
297
297
|
queryFn: () => W.request(
|
|
@@ -305,34 +305,34 @@ function ul({
|
|
|
305
305
|
placeholderData: (t) => t,
|
|
306
306
|
staleTime: 3e4,
|
|
307
307
|
retry: !1
|
|
308
|
-
}),
|
|
308
|
+
}), R = (U == null ? void 0 : U.data) ?? [], Y = (U == null ? void 0 : U.total) ?? R.length, H = Object.values(z).some((t) => !!(t != null && t.value.trim()));
|
|
309
309
|
ye(() => {
|
|
310
|
-
U && !H && ($ == null || $(
|
|
311
|
-
}, [U, H,
|
|
312
|
-
const
|
|
310
|
+
U && !H && ($ == null || $(Y));
|
|
311
|
+
}, [U, H, Y, $]);
|
|
312
|
+
const ue = A.filter((t) => t.field.includes(".")), me = R.map((t) => String(t.id)), { data: Q } = V({
|
|
313
313
|
queryKey: [
|
|
314
314
|
"rrv-resolve-paths",
|
|
315
315
|
a,
|
|
316
|
-
|
|
317
|
-
|
|
316
|
+
ue.map((t) => t.field).join(","),
|
|
317
|
+
me.join(",")
|
|
318
318
|
],
|
|
319
319
|
queryFn: () => W.request(
|
|
320
320
|
G(`/items/${a}/resolve-paths`, {
|
|
321
|
-
ids:
|
|
322
|
-
paths:
|
|
321
|
+
ids: me.join(","),
|
|
322
|
+
paths: ue.map((t) => t.field).join(",")
|
|
323
323
|
})
|
|
324
324
|
).then((t) => t.data ?? { rows: {}, targets: {} }).catch(() => ({ rows: {}, targets: {} })),
|
|
325
|
-
enabled:
|
|
325
|
+
enabled: ue.length > 0 && me.length > 0,
|
|
326
326
|
staleTime: 3e4
|
|
327
|
-
}),
|
|
327
|
+
}), C = O && R.some((t) => t.line_number != null), xe = Math.max(1, Math.ceil(Y / u)), ie = (t, i, d) => {
|
|
328
328
|
F(1), J((p) => {
|
|
329
329
|
const T = { ...p };
|
|
330
330
|
return d ? T[t] = { op: i, value: d } : delete T[t], T;
|
|
331
331
|
});
|
|
332
|
-
},
|
|
332
|
+
}, Ve = (t) => {
|
|
333
333
|
F(1), v((i) => i === t ? `-${t}` : i === `-${t}` ? "" : t);
|
|
334
334
|
};
|
|
335
|
-
if (
|
|
335
|
+
if (ce)
|
|
336
336
|
return /* @__PURE__ */ r("div", { className: "space-y-1.5 py-2", children: [0, 1, 2].map((t) => /* @__PURE__ */ r(
|
|
337
337
|
"div",
|
|
338
338
|
{
|
|
@@ -340,42 +340,42 @@ function ul({
|
|
|
340
340
|
},
|
|
341
341
|
t
|
|
342
342
|
)) });
|
|
343
|
-
if (
|
|
343
|
+
if (R.length === 0 && Object.keys(z).length === 0)
|
|
344
344
|
return /* @__PURE__ */ r("p", { className: "py-3 text-[12px] text-slate-400", children: "No records" });
|
|
345
|
-
const
|
|
346
|
-
var D,
|
|
345
|
+
const Ue = (t, i) => {
|
|
346
|
+
var D, le;
|
|
347
347
|
if (i.field.includes(".")) {
|
|
348
|
-
const
|
|
348
|
+
const re = (D = Q == null ? void 0 : Q.rows[String(t.id)]) == null ? void 0 : D[i.field];
|
|
349
349
|
if (!Q)
|
|
350
350
|
return /* @__PURE__ */ r("span", { className: "inline-block h-3 w-14 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" });
|
|
351
|
-
if (!
|
|
352
|
-
const Ee = Q.targets[i.field],
|
|
353
|
-
return _ && Ee &&
|
|
351
|
+
if (!re || re.value === "") return /* @__PURE__ */ r(te, {});
|
|
352
|
+
const Ee = Q.targets[i.field], fe = (le = re.ids) == null ? void 0 : le[0];
|
|
353
|
+
return _ && Ee && fe ? /* @__PURE__ */ r(
|
|
354
354
|
"button",
|
|
355
355
|
{
|
|
356
356
|
type: "button",
|
|
357
|
-
onClick: (
|
|
358
|
-
|
|
357
|
+
onClick: (pe) => {
|
|
358
|
+
pe.stopPropagation(), _.open({ collection: Ee, itemId: String(fe) });
|
|
359
359
|
},
|
|
360
360
|
className: "text-left underline decoration-slate-300 underline-offset-2 hover:text-[#007a99] dark:decoration-slate-600 dark:hover:text-nvr-cyan",
|
|
361
|
-
children:
|
|
361
|
+
children: re.value
|
|
362
362
|
}
|
|
363
|
-
) :
|
|
363
|
+
) : re.value;
|
|
364
364
|
}
|
|
365
365
|
const d = t[i.field];
|
|
366
|
-
if (i.type === "boolean" && d == null) return /* @__PURE__ */ r(
|
|
367
|
-
if (d == null || d === "") return /* @__PURE__ */ r(
|
|
366
|
+
if (i.type === "boolean" && d == null) return /* @__PURE__ */ r(Me, { value: !1 });
|
|
367
|
+
if (d == null || d === "") return /* @__PURE__ */ r(te, {});
|
|
368
368
|
const p = k(i.field);
|
|
369
369
|
if (p === "nivaro_users")
|
|
370
|
-
return /* @__PURE__ */ r("span", { className: "inline-block", children: /* @__PURE__ */ r(
|
|
371
|
-
if (p) return /* @__PURE__ */ r(
|
|
372
|
-
if (i.type === "boolean") return /* @__PURE__ */ r(
|
|
373
|
-
if (i.type === "decimal" || i.type === "float") return
|
|
374
|
-
if (i.type === "integer") return
|
|
375
|
-
if (i.type === "date" || i.type === "datetime" || i.type === "timestamp") return
|
|
370
|
+
return /* @__PURE__ */ r("span", { className: "inline-block", children: /* @__PURE__ */ r(pt, { userId: String(d), size: "compact" }) });
|
|
371
|
+
if (p) return /* @__PURE__ */ r(Ye, { collection: p, id: d });
|
|
372
|
+
if (i.type === "boolean") return /* @__PURE__ */ r(Me, { value: d });
|
|
373
|
+
if (i.type === "decimal" || i.type === "float") return ze(d);
|
|
374
|
+
if (i.type === "integer") return We(d);
|
|
375
|
+
if (i.type === "date" || i.type === "datetime" || i.type === "timestamp") return ht(d);
|
|
376
376
|
const T = String(d);
|
|
377
377
|
return T.length > 48 ? `${T.slice(0, 48)}…` : T;
|
|
378
|
-
}, se = (t) => ["decimal", "float", "integer"].includes(t.type ?? "") && !k(t.field) && !t.field.includes("."),
|
|
378
|
+
}, se = (t) => ["decimal", "float", "integer"].includes(t.type ?? "") && !k(t.field) && !t.field.includes("."), Ce = (t) => {
|
|
379
379
|
const i = t.options;
|
|
380
380
|
if (!i) return {};
|
|
381
381
|
if (typeof i == "string")
|
|
@@ -386,16 +386,16 @@ function ul({
|
|
|
386
386
|
}
|
|
387
387
|
return i;
|
|
388
388
|
}, ve = (t) => {
|
|
389
|
-
const i =
|
|
389
|
+
const i = Ce(t).aggregate;
|
|
390
390
|
return typeof i == "string" && ["sum", "avg", "min", "max", "count"].includes(i) ? i : null;
|
|
391
391
|
}, De = A.some((t) => ve(t)), _e = (t) => {
|
|
392
392
|
const i = ve(t);
|
|
393
393
|
if (!i) return null;
|
|
394
|
-
const d =
|
|
394
|
+
const d = R.map((D) => Number(D[t.field])).filter((D) => !Number.isNaN(D));
|
|
395
395
|
let p = null;
|
|
396
|
-
if (i === "count" ? p =
|
|
397
|
-
const T =
|
|
398
|
-
return i === "count" || T === "int" ?
|
|
396
|
+
if (i === "count" ? p = R.length : d.length > 0 && (i === "sum" ? p = d.reduce((D, le) => D + le, 0) : i === "avg" ? p = d.reduce((D, le) => D + le, 0) / d.length : i === "min" ? p = Math.min(...d) : i === "max" && (p = Math.max(...d))), p === null) return "—";
|
|
397
|
+
const T = Ce(t).format;
|
|
398
|
+
return i === "count" || T === "int" ? We(Math.round(p)) : T === "currency" || t.type === "decimal" || t.type === "float" ? ze(p) : i === "avg" ? p.toFixed(2) : We(p);
|
|
399
399
|
}, ke = (t) => !k(t.field) && !t.field.includes("."), Le = (t) => k(t.field) || t.field.includes(".") ? null : t.type === "boolean" ? "bool" : ["integer", "decimal", "float"].includes(t.type ?? "") ? "num" : ["string", "text"].includes(t.type ?? "") ? "text" : null, Ne = A.some((t) => Le(t) != null);
|
|
400
400
|
return /* @__PURE__ */ m("div", { children: [
|
|
401
401
|
h.length >= 2 && /* @__PURE__ */ r("div", { className: "mb-1.5 flex flex-wrap items-center gap-1", "data-read-presets": !0, children: [
|
|
@@ -415,20 +415,20 @@ function ul({
|
|
|
415
415
|
/* @__PURE__ */ r(
|
|
416
416
|
"div",
|
|
417
417
|
{
|
|
418
|
-
className: `overflow-x-auto rounded-md border border-slate-200 dark:border-slate-700 ${
|
|
418
|
+
className: `overflow-x-auto rounded-md border border-slate-200 dark:border-slate-700 ${Re && !ce ? "opacity-70" : ""}`,
|
|
419
419
|
children: /* @__PURE__ */ m("table", { className: "w-full", style: { fontVariantNumeric: "tabular-nums" }, children: [
|
|
420
420
|
/* @__PURE__ */ m("thead", { children: [
|
|
421
421
|
/* @__PURE__ */ m("tr", { className: "border-b border-slate-200 bg-slate-50 dark:border-slate-700 dark:bg-slate-800", children: [
|
|
422
|
-
|
|
422
|
+
C && /* @__PURE__ */ r("th", { className: "h-7 w-8 px-2 text-right text-[9.5px] font-bold uppercase tracking-wider text-slate-400", children: "#" }),
|
|
423
423
|
A.map((t) => {
|
|
424
424
|
const i = j === t.field || j === `-${t.field}`;
|
|
425
425
|
return /* @__PURE__ */ m(
|
|
426
426
|
"th",
|
|
427
427
|
{
|
|
428
|
-
onClick: () => ke(t) &&
|
|
428
|
+
onClick: () => ke(t) && Ve(t.field),
|
|
429
429
|
className: `h-7 select-none whitespace-nowrap px-2.5 text-[9.5px] font-bold uppercase tracking-wider text-slate-500 dark:text-slate-400 ${se(t) ? "text-right" : "text-left"} ${ke(t) ? "cursor-pointer hover:text-slate-700 dark:hover:text-slate-200" : ""}`,
|
|
430
430
|
children: [
|
|
431
|
-
t.label ||
|
|
431
|
+
t.label || Qe(t.field),
|
|
432
432
|
ke(t) && /* @__PURE__ */ r("span", { className: i ? "ml-0.5 text-[#00a5cc]" : "ml-0.5 text-slate-300", children: i ? j.startsWith("-") ? "▼" : "▲" : "⇅" })
|
|
433
433
|
]
|
|
434
434
|
},
|
|
@@ -437,7 +437,7 @@ function ul({
|
|
|
437
437
|
})
|
|
438
438
|
] }),
|
|
439
439
|
Ne && /* @__PURE__ */ m("tr", { className: "border-b border-slate-200 bg-slate-50 dark:border-slate-700 dark:bg-slate-800", children: [
|
|
440
|
-
|
|
440
|
+
C && /* @__PURE__ */ r("th", { className: "px-1.5 py-1" }),
|
|
441
441
|
A.map((t) => {
|
|
442
442
|
const i = Le(t), d = ae[t.field];
|
|
443
443
|
return /* @__PURE__ */ m("th", { className: "px-1.5 py-1 font-normal", children: [
|
|
@@ -453,7 +453,7 @@ function ul({
|
|
|
453
453
|
),
|
|
454
454
|
i === "num" && /* @__PURE__ */ m("span", { className: "flex items-center gap-0.5", children: [
|
|
455
455
|
/* @__PURE__ */ r(
|
|
456
|
-
|
|
456
|
+
ut,
|
|
457
457
|
{
|
|
458
458
|
value: (d == null ? void 0 : d.op) ?? "_eq",
|
|
459
459
|
onChange: (p) => ie(t.field, p, (d == null ? void 0 : d.value) ?? ""),
|
|
@@ -477,7 +477,7 @@ function ul({
|
|
|
477
477
|
)
|
|
478
478
|
] }),
|
|
479
479
|
i === "bool" && /* @__PURE__ */ r(
|
|
480
|
-
|
|
480
|
+
ut,
|
|
481
481
|
{
|
|
482
482
|
value: (d == null ? void 0 : d.value) ?? "",
|
|
483
483
|
onChange: (p) => ie(t.field, "_eq", p),
|
|
@@ -495,26 +495,26 @@ function ul({
|
|
|
495
495
|
] })
|
|
496
496
|
] }),
|
|
497
497
|
/* @__PURE__ */ m("tbody", { children: [
|
|
498
|
-
|
|
498
|
+
R.length === 0 && /* @__PURE__ */ r("tr", { children: /* @__PURE__ */ r(
|
|
499
499
|
"td",
|
|
500
500
|
{
|
|
501
|
-
colSpan: A.length + (
|
|
501
|
+
colSpan: A.length + (C ? 1 : 0),
|
|
502
502
|
className: "py-4 text-center text-[12px] text-slate-400",
|
|
503
503
|
children: "No matches — adjust filters"
|
|
504
504
|
}
|
|
505
505
|
) }),
|
|
506
|
-
|
|
506
|
+
R.map((t) => /* @__PURE__ */ m(
|
|
507
507
|
"tr",
|
|
508
508
|
{
|
|
509
509
|
onClick: _ ? () => _.open({ collection: a, itemId: String(t.id) }) : void 0,
|
|
510
510
|
className: `border-b border-slate-100 last:border-0 dark:border-slate-800 ${_ ? "cursor-pointer hover:bg-nvr-cyan/5 dark:hover:bg-nvr-cyan/10" : ""}`,
|
|
511
511
|
children: [
|
|
512
|
-
|
|
512
|
+
C && /* @__PURE__ */ r("td", { className: "px-2 py-1.5 text-right text-[11px] tabular-nums text-slate-400", children: t.line_number == null ? "" : String(t.line_number) }),
|
|
513
513
|
A.map((i) => /* @__PURE__ */ r(
|
|
514
514
|
"td",
|
|
515
515
|
{
|
|
516
516
|
className: `whitespace-nowrap px-2.5 py-1.5 text-[12px] text-slate-700 dark:text-slate-200 ${se(i) ? "text-right" : ""}`,
|
|
517
|
-
children:
|
|
517
|
+
children: Ue(t, i)
|
|
518
518
|
},
|
|
519
519
|
i.field
|
|
520
520
|
))
|
|
@@ -523,13 +523,13 @@ function ul({
|
|
|
523
523
|
String(t.id)
|
|
524
524
|
))
|
|
525
525
|
] }),
|
|
526
|
-
De &&
|
|
526
|
+
De && R.length > 0 && /* @__PURE__ */ r("tfoot", { children: /* @__PURE__ */ m(
|
|
527
527
|
"tr",
|
|
528
528
|
{
|
|
529
529
|
"data-read-grid-footer": !0,
|
|
530
530
|
className: "border-t border-slate-200 bg-slate-50 text-[11px] font-medium text-slate-600 dark:border-slate-700 dark:bg-slate-800/60 dark:text-slate-300",
|
|
531
531
|
children: [
|
|
532
|
-
|
|
532
|
+
C && /* @__PURE__ */ r("td", {}),
|
|
533
533
|
A.map((t) => {
|
|
534
534
|
const i = ve(t);
|
|
535
535
|
return /* @__PURE__ */ r(
|
|
@@ -550,14 +550,14 @@ function ul({
|
|
|
550
550
|
] })
|
|
551
551
|
}
|
|
552
552
|
),
|
|
553
|
-
|
|
553
|
+
Y > u && /* @__PURE__ */ m("div", { className: "mt-1.5 flex items-center justify-between", children: [
|
|
554
554
|
/* @__PURE__ */ m("p", { className: "text-[11px] tabular-nums text-slate-400", children: [
|
|
555
555
|
((w - 1) * u + 1).toLocaleString("en-US"),
|
|
556
556
|
"–",
|
|
557
|
-
Math.min(w * u,
|
|
557
|
+
Math.min(w * u, Y).toLocaleString("en-US"),
|
|
558
558
|
" of",
|
|
559
559
|
" ",
|
|
560
|
-
|
|
560
|
+
Y.toLocaleString("en-US")
|
|
561
561
|
] }),
|
|
562
562
|
/* @__PURE__ */ m("span", { className: "flex items-center gap-0.5", children: [
|
|
563
563
|
/* @__PURE__ */ r(
|
|
@@ -589,7 +589,7 @@ function ul({
|
|
|
589
589
|
] })
|
|
590
590
|
] });
|
|
591
591
|
}
|
|
592
|
-
function
|
|
592
|
+
function mt({
|
|
593
593
|
collection: a,
|
|
594
594
|
itemId: f,
|
|
595
595
|
layoutData: y,
|
|
@@ -601,8 +601,8 @@ function ut({
|
|
|
601
601
|
onEditSection: _,
|
|
602
602
|
gridCounts: h
|
|
603
603
|
}) {
|
|
604
|
-
var
|
|
605
|
-
const q = Oe(), K =
|
|
604
|
+
var rt;
|
|
605
|
+
const q = Oe(), K = tl(), M = c ? c.record ?? {} : null, k = !!(c != null && c.context.showHidden), x = c ? String(((rt = c.record) == null ? void 0 : rt.id) ?? "") : f ?? "", b = be(
|
|
606
606
|
() => c ? {
|
|
607
607
|
...c.layout,
|
|
608
608
|
layout: c.layout.layout ?? { id: 0, name: "" }
|
|
@@ -612,19 +612,19 @@ function ut({
|
|
|
612
612
|
kind: qe(e.field) ? "slot" : "field",
|
|
613
613
|
field: e.field,
|
|
614
614
|
group_key: e.group_key ?? null
|
|
615
|
-
}), N = (e, l, s = !1) => c ? /* @__PURE__ */ r(
|
|
615
|
+
}), N = (e, l, s = !1) => c ? /* @__PURE__ */ r(rl, { target: e, children: s ? /* @__PURE__ */ r("div", { "data-design-hidden": !0, className: "opacity-40", children: l }) : l }) : l, A = be(
|
|
616
616
|
() => [
|
|
617
617
|
...new Set(
|
|
618
618
|
(c ? [] : (b == null ? void 0 : b.assignments) ?? []).map((e) => e.field).filter((e) => e && !e.startsWith("__") && !e.includes("."))
|
|
619
619
|
)
|
|
620
620
|
].sort(),
|
|
621
621
|
[b, c]
|
|
622
|
-
), { data: j } =
|
|
622
|
+
), { data: j } = Zt(a, x, A), v = (e) => {
|
|
623
623
|
const l = j == null ? void 0 : j[e];
|
|
624
624
|
if (!l) return null;
|
|
625
625
|
const s = l.via !== "user";
|
|
626
626
|
return l.caller && l.activity_id ? /* @__PURE__ */ r(
|
|
627
|
-
|
|
627
|
+
Yt,
|
|
628
628
|
{
|
|
629
629
|
activityId: l.activity_id,
|
|
630
630
|
callerName: l.caller.name,
|
|
@@ -658,8 +658,8 @@ function ut({
|
|
|
658
658
|
className: `ml-1 inline-block h-1.5 w-1.5 rounded-full align-middle ${s ? "bg-amber-400" : "bg-slate-300 dark:bg-slate-600"}`
|
|
659
659
|
}
|
|
660
660
|
);
|
|
661
|
-
}, { data: w } =
|
|
662
|
-
() => $ && (w != null && w.enabled) ?
|
|
661
|
+
}, { data: w } = il(a, x, !!$ && !c), F = be(
|
|
662
|
+
() => $ && (w != null && w.enabled) ? sl(w.findings) : null,
|
|
663
663
|
[$, w]
|
|
664
664
|
), ae = ({ field: e }) => {
|
|
665
665
|
const l = F == null ? void 0 : F.get(e);
|
|
@@ -684,22 +684,22 @@ function ut({
|
|
|
684
684
|
).then((e) => e.data),
|
|
685
685
|
staleTime: 10 * 6e4,
|
|
686
686
|
retry: !1
|
|
687
|
-
}),
|
|
687
|
+
}), z = Rt(), { data: Ae } = V({
|
|
688
688
|
queryKey: ["rrv-record", a, x],
|
|
689
689
|
enabled: !c,
|
|
690
690
|
queryFn: () => q.request(G(`/items/${a}/${x}`)).then((e) => e.data),
|
|
691
|
-
initialData: () =>
|
|
691
|
+
initialData: () => z.getQueryData(["item", a, x]) ?? void 0,
|
|
692
692
|
initialDataUpdatedAt: () => {
|
|
693
693
|
var e;
|
|
694
|
-
return (e =
|
|
694
|
+
return (e = z.getQueryState(["item", a, x])) == null ? void 0 : e.dataUpdatedAt;
|
|
695
695
|
},
|
|
696
696
|
staleTime: 3e4,
|
|
697
697
|
retry: !1
|
|
698
698
|
}), u = M ?? Ae;
|
|
699
|
-
|
|
700
|
-
e.aspectsOnly || e.deleted || (
|
|
699
|
+
Ut(a, c ? null : x, (e) => {
|
|
700
|
+
e.aspectsOnly || e.deleted || (z.invalidateQueries({ queryKey: ["rrv-record", a, x] }), z.invalidateQueries({ queryKey: ["field-touch", a, x] }));
|
|
701
701
|
});
|
|
702
|
-
const U =
|
|
702
|
+
const U = Lt(null), [ce, Re] = ee(() => /* @__PURE__ */ new Set());
|
|
703
703
|
ye(() => {
|
|
704
704
|
const e = U.current;
|
|
705
705
|
if (U.current = u ?? null, c || !e || !u || e === u) return;
|
|
@@ -707,11 +707,11 @@ function ut({
|
|
|
707
707
|
(o) => !o.startsWith("__") && JSON.stringify(e[o]) !== JSON.stringify(u[o])
|
|
708
708
|
);
|
|
709
709
|
if (l.length === 0) return;
|
|
710
|
-
|
|
711
|
-
const s = setTimeout(() =>
|
|
710
|
+
Re(new Set(l));
|
|
711
|
+
const s = setTimeout(() => Re(/* @__PURE__ */ new Set()), 2400);
|
|
712
712
|
return () => clearTimeout(s);
|
|
713
713
|
}, [u, c]);
|
|
714
|
-
const
|
|
714
|
+
const R = (e) => ce.has(e) ? " nvr-value-pulse-bg rounded-sm" : "", { data: Y } = V({
|
|
715
715
|
queryKey: ["rrv-field-config", a, b.layout.id],
|
|
716
716
|
enabled: !c,
|
|
717
717
|
queryFn: () => q.request(
|
|
@@ -720,33 +720,33 @@ function ut({
|
|
|
720
720
|
staleTime: 5 * 6e4,
|
|
721
721
|
retry: !1
|
|
722
722
|
}), H = be(
|
|
723
|
-
() => new Map((
|
|
724
|
-
[
|
|
725
|
-
),
|
|
723
|
+
() => new Map((Y ?? (J == null ? void 0 : J.fields) ?? []).map((e) => [e.field, e])),
|
|
724
|
+
[Y, J]
|
|
725
|
+
), ue = (J == null ? void 0 : J.relations) ?? [], me = (e) => {
|
|
726
726
|
var l;
|
|
727
|
-
return ((l =
|
|
727
|
+
return ((l = ue.find(
|
|
728
728
|
(s) => s.many_collection === a && s.many_field === e && s.one_collection
|
|
729
729
|
)) == null ? void 0 : l.one_collection) ?? null;
|
|
730
|
-
}, Q = (e) =>
|
|
730
|
+
}, Q = (e) => ue.find(
|
|
731
731
|
(l) => l.one_collection === a && (l.one_field === e || l.many_collection === e)
|
|
732
|
-
) ?? null,
|
|
732
|
+
) ?? null, C = (e) => {
|
|
733
733
|
var l;
|
|
734
734
|
return !((e.is_visible === void 0 || e.is_visible) && he(e.overrides).hidden !== !0 && !((l = H.get(e.field)) != null && l.hidden));
|
|
735
735
|
}, xe = b.assignments.filter(
|
|
736
|
-
(e) => (!e.field.startsWith("__") || qe(e.field)) && (k || !
|
|
736
|
+
(e) => (!e.field.startsWith("__") || qe(e.field)) && (k || !C(e))
|
|
737
737
|
), ie = b.assignments.filter(
|
|
738
738
|
(e) => e.field.startsWith("__widget_") && e.widget_id != null && (k || e.is_visible === void 0 || !!e.is_visible)
|
|
739
|
-
),
|
|
739
|
+
), Ve = (e) => {
|
|
740
740
|
if (!e.input_bindings) return [];
|
|
741
741
|
try {
|
|
742
742
|
return JSON.parse(String(e.input_bindings));
|
|
743
743
|
} catch {
|
|
744
744
|
return [];
|
|
745
745
|
}
|
|
746
|
-
},
|
|
746
|
+
}, Ue = S || c ? b.assignments.filter(
|
|
747
747
|
(e) => e.field.startsWith("__") && !e.field.startsWith("__widget_") && !qe(e.field) && (k || e.is_visible === void 0 || !!e.is_visible)
|
|
748
|
-
).sort((e, l) => e.sort - l.sort) : [], se = ["__pipeline__", "__addendums__"],
|
|
749
|
-
(s) => e === null ? s.group_key == null && l === "leading" ===
|
|
748
|
+
).sort((e, l) => e.sort - l.sort) : [], se = ["__pipeline__", "__addendums__"], Ce = new Set(se), ve = (e) => (S == null ? void 0 : S(e.field, e)) ?? (c ? /* @__PURE__ */ r("div", { className: "rounded-xl border border-dashed border-slate-300 bg-white px-5 py-3 text-[12px] font-medium text-slate-500 dark:border-slate-600 dark:bg-slate-900/40 dark:text-slate-400", children: e.label_override || Qe(e.field.replace(/^_+|_+$/g, "")) }) : null), De = (e, l = "trailing") => S || c ? Ue.filter(
|
|
749
|
+
(s) => e === null ? s.group_key == null && l === "leading" === Ce.has(s.field) : s.group_key === e
|
|
750
750
|
).sort(
|
|
751
751
|
(s, o) => l === "leading" && e === null ? se.indexOf(s.field) - se.indexOf(o.field) : 0
|
|
752
752
|
).map((s) => ({ key: s.field, a: s, node: ve(s) })).filter((s) => s.node != null) : [], _e = (e, l = "trailing") => {
|
|
@@ -759,27 +759,27 @@ function ut({
|
|
|
759
759
|
children: s.map((o) => /* @__PURE__ */ r("div", { children: N(
|
|
760
760
|
{ kind: "slot", field: o.a.field, group_key: o.a.group_key ?? null },
|
|
761
761
|
o.node,
|
|
762
|
-
|
|
762
|
+
C(o.a)
|
|
763
763
|
) }, o.key))
|
|
764
764
|
}
|
|
765
765
|
);
|
|
766
|
-
}, [ke, Le] =
|
|
766
|
+
}, [ke, Le] = ee({}), Ne = (e) => k || ke[e] === !0, [t, i] = ee({}), d = ct(
|
|
767
767
|
(e) => (l) => i((s) => s[e] === l ? s : { ...s, [e]: l }),
|
|
768
768
|
[]
|
|
769
|
-
), [p, T] =
|
|
769
|
+
), [p, T] = ee({}), D = ct(
|
|
770
770
|
(e) => (l) => T((s) => s[e] === l ? s : { ...s, [e]: l }),
|
|
771
771
|
[]
|
|
772
|
-
),
|
|
772
|
+
), le = (e) => {
|
|
773
773
|
const l = ie.filter((o) => o.group_key === e).sort((o, g) => o.sort - g.sort);
|
|
774
774
|
if (l.length === 0) return null;
|
|
775
775
|
const s = l.some((o) => Ne(o.field));
|
|
776
776
|
return /* @__PURE__ */ r("div", { className: s ? "mt-3 space-y-4" : "hidden", "data-read-widgets": !0, children: l.map((o) => /* @__PURE__ */ r("div", { hidden: !Ne(o.field), children: N(
|
|
777
777
|
{ kind: "slot", field: o.field, group_key: o.group_key ?? null },
|
|
778
778
|
/* @__PURE__ */ r(
|
|
779
|
-
|
|
779
|
+
dl,
|
|
780
780
|
{
|
|
781
781
|
widgetId: o.widget_id,
|
|
782
|
-
inputBindings:
|
|
782
|
+
inputBindings: Ve(o),
|
|
783
783
|
itemDraft: u ?? {},
|
|
784
784
|
itemCollection: a,
|
|
785
785
|
ready: !!u,
|
|
@@ -790,31 +790,31 @@ function ut({
|
|
|
790
790
|
)
|
|
791
791
|
}
|
|
792
792
|
),
|
|
793
|
-
|
|
793
|
+
C(o)
|
|
794
794
|
) }, o.field)) });
|
|
795
|
-
},
|
|
795
|
+
}, re = [...b.groups].sort((e, l) => e.sort - l.sort).filter((e) => k || e.visibility_mode !== "new_only").filter((e) => k || !u || zt(e.visible_when, u)), [Ee, fe] = ee(() => /* @__PURE__ */ new Set()), pe = (e) => !e.is_collapsed || Ee.has(e.key), gt = (e) => fe((l) => {
|
|
796
796
|
const s = new Set(l);
|
|
797
797
|
return s.has(e) ? s.delete(e) : s.add(e), s;
|
|
798
798
|
}), we = (c == null ? void 0 : c.context.fold) ?? null, Se = (c == null ? void 0 : c.context.reveal) ?? null;
|
|
799
799
|
ye(() => {
|
|
800
|
-
we &&
|
|
800
|
+
we && fe(we.open ? new Set(b.groups.map((e) => e.key)) : /* @__PURE__ */ new Set());
|
|
801
801
|
}, [we == null ? void 0 : we.seq]), ye(() => {
|
|
802
|
-
const e = Se ?
|
|
803
|
-
e &&
|
|
802
|
+
const e = Se ? al(Se.target) : null;
|
|
803
|
+
e && fe((l) => l.has(e) ? l : new Set(l).add(e));
|
|
804
804
|
}, [Se == null ? void 0 : Se.seq]);
|
|
805
|
-
const
|
|
806
|
-
for (const e of
|
|
805
|
+
const Be = [];
|
|
806
|
+
for (const e of re) {
|
|
807
807
|
if (e.type === "container") {
|
|
808
|
-
for (const l of
|
|
809
|
-
|
|
808
|
+
for (const l of re.filter((s) => s.container_id != null && s.container_id === e.id))
|
|
809
|
+
Be.push(l);
|
|
810
810
|
continue;
|
|
811
811
|
}
|
|
812
|
-
e.container_id == null &&
|
|
812
|
+
e.container_id == null && Be.push(e);
|
|
813
813
|
}
|
|
814
|
-
const
|
|
814
|
+
const X = (e) => {
|
|
815
815
|
var l;
|
|
816
816
|
return !!((l = Q(e.field)) != null && l.junction_field);
|
|
817
|
-
},
|
|
817
|
+
}, Xe = (e) => {
|
|
818
818
|
var s;
|
|
819
819
|
const l = String(
|
|
820
820
|
he(e.overrides).interface ?? ((s = H.get(e.field)) == null ? void 0 : s.interface) ?? ""
|
|
@@ -823,14 +823,14 @@ function ut({
|
|
|
823
823
|
}, Pe = (e) => {
|
|
824
824
|
const l = H.get(e.field), s = he(e.overrides);
|
|
825
825
|
if (qe(e.field)) {
|
|
826
|
-
const L =
|
|
827
|
-
return /* @__PURE__ */ r("span", { "data-display-formula": e.field, className: "tabular-nums", children:
|
|
826
|
+
const L = Gt(s), oe = ll((L == null ? void 0 : L.expr) ?? "", u ?? {});
|
|
827
|
+
return /* @__PURE__ */ r("span", { "data-display-formula": e.field, className: "tabular-nums", children: oe.error ? "—" : Jt(oe.value, L ?? { format: "", currency: null }) });
|
|
828
828
|
}
|
|
829
829
|
const o = Q(e.field);
|
|
830
|
-
if (c && !x && (o != null && o.junction_field)) return /* @__PURE__ */ r(
|
|
830
|
+
if (c && !x && (o != null && o.junction_field)) return /* @__PURE__ */ r(te, {});
|
|
831
831
|
if (o != null && o.junction_field && o.many_collection && o.many_field)
|
|
832
832
|
return /* @__PURE__ */ r(
|
|
833
|
-
|
|
833
|
+
ml,
|
|
834
834
|
{
|
|
835
835
|
junction: o.many_collection,
|
|
836
836
|
parentFk: o.many_field,
|
|
@@ -841,46 +841,46 @@ function ut({
|
|
|
841
841
|
relation: o
|
|
842
842
|
}
|
|
843
843
|
);
|
|
844
|
-
const g = u == null ? void 0 : u[e.field], I =
|
|
844
|
+
const g = u == null ? void 0 : u[e.field], I = me(e.field);
|
|
845
845
|
if (I === "nivaro_users" && g != null)
|
|
846
|
-
return /* @__PURE__ */ r("span", { className: "inline-block", children: /* @__PURE__ */ r(
|
|
847
|
-
if (I) return /* @__PURE__ */ r(
|
|
848
|
-
if ((l == null ? void 0 : l.type) === "boolean" && (g == null || g === "")) return /* @__PURE__ */ r(
|
|
849
|
-
if (g == null || g === "") return /* @__PURE__ */ r(
|
|
846
|
+
return /* @__PURE__ */ r("span", { className: "inline-block", children: /* @__PURE__ */ r(pt, { userId: String(g), size: "compact" }) });
|
|
847
|
+
if (I) return /* @__PURE__ */ r(Ye, { collection: I, id: g });
|
|
848
|
+
if ((l == null ? void 0 : l.type) === "boolean" && (g == null || g === "")) return /* @__PURE__ */ r(Me, { value: !1 });
|
|
849
|
+
if (g == null || g === "") return /* @__PURE__ */ r(te, {});
|
|
850
850
|
if ((l == null ? void 0 : l.type) === "boolean")
|
|
851
851
|
return /* @__PURE__ */ r(
|
|
852
|
-
|
|
852
|
+
Me,
|
|
853
853
|
{
|
|
854
854
|
value: g,
|
|
855
855
|
trueTone: (s.options ?? {}).trueTone ?? "positive"
|
|
856
856
|
}
|
|
857
857
|
);
|
|
858
|
-
const
|
|
859
|
-
return
|
|
858
|
+
const Z = s.options ?? {};
|
|
859
|
+
return Xe(e) && typeof g == "string" ? /^\s*\{/.test(g) ? /* @__PURE__ */ r("div", { className: "min-w-0 whitespace-pre-wrap font-normal [overflow-wrap:anywhere]", children: el(g) }) : /* @__PURE__ */ r(
|
|
860
860
|
"div",
|
|
861
861
|
{
|
|
862
862
|
className: "rrv-prose min-w-0 font-normal leading-relaxed [overflow-wrap:anywhere] [&_a]:underline [&_h1]:text-[15px] [&_h1]:font-semibold [&_h2]:text-[14px] [&_h2]:font-semibold [&_h3]:font-semibold [&_li]:ml-4 [&_ol]:list-decimal [&_p]:my-1 [&_ul]:list-disc",
|
|
863
|
-
dangerouslySetInnerHTML: { __html:
|
|
863
|
+
dangerouslySetInnerHTML: { __html: Qt(g) }
|
|
864
864
|
}
|
|
865
|
-
) :
|
|
866
|
-
},
|
|
865
|
+
) : Z.format === "currency" ? /* @__PURE__ */ r("span", { className: "tabular-nums", children: ze(g) }) : (l == null ? void 0 : l.type) === "decimal" || (l == null ? void 0 : l.type) === "float" ? /* @__PURE__ */ r("span", { className: "tabular-nums", children: We(g) }) : (l == null ? void 0 : l.type) === "date" || (l == null ? void 0 : l.type) === "datetime" || (l == null ? void 0 : l.type) === "timestamp" ? ht(g) : String(g);
|
|
866
|
+
}, bt = (e) => {
|
|
867
867
|
const l = he(e.overrides), s = Q(e.field);
|
|
868
868
|
if (!(s != null && s.many_collection) || !s.many_field) return null;
|
|
869
869
|
if (c && !x) return /* @__PURE__ */ r("p", { className: "py-3 text-[12px] text-slate-400", children: "No records" });
|
|
870
870
|
const o = l.options ?? {}, g = (() => {
|
|
871
871
|
var L;
|
|
872
|
-
const
|
|
873
|
-
if (!
|
|
874
|
-
if (typeof
|
|
872
|
+
const Z = (L = H.get(e.field)) == null ? void 0 : L.options;
|
|
873
|
+
if (!Z) return {};
|
|
874
|
+
if (typeof Z == "string")
|
|
875
875
|
try {
|
|
876
|
-
return JSON.parse(
|
|
876
|
+
return JSON.parse(Z);
|
|
877
877
|
} catch {
|
|
878
878
|
return {};
|
|
879
879
|
}
|
|
880
|
-
return
|
|
880
|
+
return Z;
|
|
881
881
|
})(), I = o.layout_id ?? null;
|
|
882
882
|
return /* @__PURE__ */ r(
|
|
883
|
-
|
|
883
|
+
fl,
|
|
884
884
|
{
|
|
885
885
|
collection: s.many_collection,
|
|
886
886
|
fkField: s.many_field,
|
|
@@ -892,29 +892,29 @@ function ut({
|
|
|
892
892
|
},
|
|
893
893
|
e.field
|
|
894
894
|
);
|
|
895
|
-
},
|
|
896
|
-
if (!u ||
|
|
895
|
+
}, de = (e) => !!Q(e.field) && !X(e), yt = !!b.layout.hide_empty, Ze = Array.isArray(b.layout.header_fields) ? b.layout.header_fields.filter((e) => typeof e == "string") : [], xt = new Set(Ze), vt = (e) => {
|
|
896
|
+
if (!u || X(e)) return !1;
|
|
897
897
|
const l = u[e.field];
|
|
898
898
|
return l == null || l === "" || Array.isArray(l) && l.length === 0;
|
|
899
|
-
},
|
|
899
|
+
}, _t = (e) => xe.find((l) => l.field === e), $e = (e) => {
|
|
900
900
|
var o;
|
|
901
|
-
const l = he(e.overrides).label, s = K ?
|
|
902
|
-
return s !== void 0 ? s : qe(e.field) ? typeof l == "string" && l.trim() ? l : "Formula" : typeof l == "string" && l.trim() ? l : e.label_override || ((o = H.get(e.field)) == null ? void 0 : o.label) ||
|
|
903
|
-
},
|
|
904
|
-
const l =
|
|
901
|
+
const l = he(e.overrides).label, s = K ? Bt(e.overrides, K).label : void 0;
|
|
902
|
+
return s !== void 0 ? s : qe(e.field) ? typeof l == "string" && l.trim() ? l : "Formula" : typeof l == "string" && l.trim() ? l : e.label_override || ((o = H.get(e.field)) == null ? void 0 : o.label) || Qe(e.field);
|
|
903
|
+
}, kt = (e) => {
|
|
904
|
+
const l = Wt(e.swap_config), s = xe.filter((n) => n.group_key === e.key && !xt.has(n.field)).filter((n) => k || !u || !Mt(n.overrides) || !je(u[n.field])).sort((n, E) => n.sort - E.sort), o = ie.filter((n) => n.group_key === e.key), g = De(e.key), I = s.length === 0 && o.length === 0 && g.length === 0;
|
|
905
905
|
if (I && !c) return null;
|
|
906
|
-
const
|
|
907
|
-
var
|
|
908
|
-
const E =
|
|
906
|
+
const Z = (n) => yt && !k && (de(n) || X(n)) && ((h == null ? void 0 : h[n.field]) ?? t[n.field]) === 0, L = s.filter((n) => !de(n)), oe = s.filter(de), Ke = o.filter((n) => Ne(n.field)), wt = !e.hide_when_empty && g.length === 0 && Ke.length === 0 && s.length > 0 && s.some((n) => de(n) || X(n)) && s.every(Z), Ge = (n) => !wt && Z(n), St = s.filter((n) => !Ge(n)), $t = (n) => (h == null ? void 0 : h[n.field]) ?? t[n.field], Ft = !!e.hide_when_empty && !c && !k && !!u && g.length === 0 && Ke.length === 0 && s.every((n) => de(n) || X(n) ? $t(n) === 0 : je(u[n.field])) || !I && St.length === 0 && g.length === 0 && Ke.length === 0, qt = (n) => (h == null ? void 0 : h[n.field]) ?? t[n.field], Je = !!l.emptyText && !!u && !c && g.length === 0 && Ke.length === 0 && s.every((n) => de(n) || X(n) ? qt(n) === 0 : je(u[n.field])), Tt = Vt(L, { rows: l.rows }).units, nt = e.read_width === "full" || e.read_width === "half" || e.read_width === "third" ? e.read_width : oe.length > 0 || o.length > 0 || g.length > 0 || L.length > 4 ? "full" : "half", Ot = (n) => {
|
|
907
|
+
var st, dt, ot;
|
|
908
|
+
const E = Ge(n), B = !!(he(n.overrides).options ?? {}).emphasis, Fe = Xe(n) || !!((dt = (st = H.get(n.field)) == null ? void 0 : st.interface) != null && dt.includes("rich-text")), at = u == null ? void 0 : u[n.field], it = !Fe && !X(n) && !me(n.field) && (String(((ot = H.get(n.field)) == null ? void 0 : ot.interface) ?? "").includes("textarea") || typeof at == "string" && at.length > 36);
|
|
909
909
|
return /* @__PURE__ */ r(
|
|
910
910
|
"div",
|
|
911
911
|
{
|
|
912
912
|
hidden: E,
|
|
913
|
-
className: `min-w-0 ${Fe ||
|
|
913
|
+
className: `min-w-0 ${Fe || X(n) && (p[n.field] === "nivaro_files" || (t[n.field] ?? 0) > 3) ? "col-span-full" : B || it ? "col-span-2" : ""}`,
|
|
914
914
|
children: N(
|
|
915
915
|
O(n),
|
|
916
916
|
/* @__PURE__ */ m(ge, { children: [
|
|
917
|
-
/* @__PURE__ */ m("dt", { className:
|
|
917
|
+
/* @__PURE__ */ m("dt", { className: Ie, children: [
|
|
918
918
|
$e(n),
|
|
919
919
|
/* @__PURE__ */ r(ae, { field: n.field }),
|
|
920
920
|
v(n.field)
|
|
@@ -924,27 +924,27 @@ function ut({
|
|
|
924
924
|
{
|
|
925
925
|
"data-replay-field": n.field,
|
|
926
926
|
"data-field-collection": a,
|
|
927
|
-
"data-remote-changed":
|
|
928
|
-
className: `mt-1 min-w-0${
|
|
927
|
+
"data-remote-changed": ce.has(n.field) || void 0,
|
|
928
|
+
className: `mt-1 min-w-0${R(n.field)} ${B ? "text-[17px] font-semibold tracking-[-0.01em] text-slate-900 dark:text-white" : `${X(n) || Fe ? "" : it ? "line-clamp-3 break-words " : "truncate "}text-[13px] font-medium text-slate-800 dark:text-slate-100`}`,
|
|
929
929
|
children: u ? Pe(n) : /* @__PURE__ */ r("span", { className: "inline-block h-3.5 w-20 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" })
|
|
930
930
|
}
|
|
931
931
|
)
|
|
932
932
|
] }),
|
|
933
|
-
|
|
933
|
+
C(n)
|
|
934
934
|
)
|
|
935
935
|
},
|
|
936
936
|
n.field
|
|
937
937
|
);
|
|
938
|
-
},
|
|
939
|
-
const
|
|
938
|
+
}, At = (n, E) => {
|
|
939
|
+
const He = u && !c ? E.filter((B) => !je(u[B.field])) : E;
|
|
940
940
|
return /* @__PURE__ */ m(
|
|
941
941
|
"div",
|
|
942
942
|
{
|
|
943
943
|
"data-read-row": n.key,
|
|
944
944
|
className: `min-w-0 ${E.length > 2 ? "col-span-full" : "col-span-2"}`,
|
|
945
945
|
children: [
|
|
946
|
-
/* @__PURE__ */ r("dt", { className:
|
|
947
|
-
/* @__PURE__ */ r("dd", { className: "mt-1 flex min-w-0 flex-wrap items-baseline gap-x-1.5 text-[13px] font-medium text-slate-800 dark:text-slate-100", children: u ?
|
|
946
|
+
/* @__PURE__ */ r("dt", { className: Ie, children: n.label.trim() || E.map($e).join(" / ") }),
|
|
947
|
+
/* @__PURE__ */ r("dd", { className: "mt-1 flex min-w-0 flex-wrap items-baseline gap-x-1.5 text-[13px] font-medium text-slate-800 dark:text-slate-100", children: u ? He.length === 0 ? /* @__PURE__ */ r(te, {}) : He.map((B, Fe) => /* @__PURE__ */ m(Et, { children: [
|
|
948
948
|
Fe > 0 && /* @__PURE__ */ r("span", { "aria-hidden": !0, className: "text-slate-300 dark:text-slate-600", children: "·" }),
|
|
949
949
|
N(
|
|
950
950
|
O(B),
|
|
@@ -953,11 +953,11 @@ function ut({
|
|
|
953
953
|
{
|
|
954
954
|
"data-replay-field": B.field,
|
|
955
955
|
"data-field-collection": a,
|
|
956
|
-
className: `min-w-0 break-words${
|
|
956
|
+
className: `min-w-0 break-words${R(B.field)}`,
|
|
957
957
|
children: Pe(B)
|
|
958
958
|
}
|
|
959
959
|
),
|
|
960
|
-
|
|
960
|
+
C(B)
|
|
961
961
|
)
|
|
962
962
|
] }, B.field)) : /* @__PURE__ */ r("span", { className: "inline-block h-3.5 w-28 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }) })
|
|
963
963
|
]
|
|
@@ -968,9 +968,9 @@ function ut({
|
|
|
968
968
|
return /* @__PURE__ */ r(
|
|
969
969
|
"section",
|
|
970
970
|
{
|
|
971
|
-
hidden:
|
|
971
|
+
hidden: Ft,
|
|
972
972
|
"data-read-section": e.key,
|
|
973
|
-
"data-read-width":
|
|
973
|
+
"data-read-width": nt,
|
|
974
974
|
className: "min-w-0 rounded-xl border border-slate-200 bg-white dark:border-slate-700/60 dark:bg-slate-900/40",
|
|
975
975
|
children: N(
|
|
976
976
|
{ kind: "group", key: e.key },
|
|
@@ -978,45 +978,45 @@ function ut({
|
|
|
978
978
|
/* @__PURE__ */ m(
|
|
979
979
|
"h3",
|
|
980
980
|
{
|
|
981
|
-
className: `group/rs relative flex items-center justify-between gap-2 px-5 py-2.5 text-[12.5px] font-semibold text-slate-700 dark:text-slate-200 ${
|
|
981
|
+
className: `group/rs relative flex items-center justify-between gap-2 px-5 py-2.5 text-[12.5px] font-semibold text-slate-700 dark:text-slate-200 ${pe(e) ? "border-b border-slate-100 dark:border-slate-800" : ""}`,
|
|
982
982
|
children: [
|
|
983
983
|
e.is_collapsed ? /* @__PURE__ */ r(
|
|
984
984
|
"button",
|
|
985
985
|
{
|
|
986
986
|
type: "button",
|
|
987
|
-
onClick: () =>
|
|
988
|
-
"aria-expanded":
|
|
987
|
+
onClick: () => gt(e.key),
|
|
988
|
+
"aria-expanded": pe(e),
|
|
989
989
|
className: "min-w-0 flex-1 text-left after:absolute after:inset-0 group-hover/rs:text-slate-900 dark:group-hover/rs:text-white",
|
|
990
990
|
children: e.label
|
|
991
991
|
}
|
|
992
992
|
) : /* @__PURE__ */ r("span", { className: "min-w-0 flex-1", children: e.label }),
|
|
993
|
-
_ && (L.length > 0 ||
|
|
993
|
+
_ && (L.length > 0 || oe.length > 0) && /* @__PURE__ */ r(
|
|
994
994
|
"button",
|
|
995
995
|
{
|
|
996
996
|
type: "button",
|
|
997
997
|
"data-read-edit-section": e.key,
|
|
998
998
|
onClick: () => {
|
|
999
999
|
var n, E;
|
|
1000
|
-
return _(e.key, ((n = L[0]) == null ? void 0 : n.field) ?? ((E =
|
|
1000
|
+
return _(e.key, ((n = L[0]) == null ? void 0 : n.field) ?? ((E = oe[0]) == null ? void 0 : E.field) ?? null);
|
|
1001
1001
|
},
|
|
1002
1002
|
title: `Edit ${e.label}`,
|
|
1003
1003
|
"aria-label": `Edit ${e.label}`,
|
|
1004
1004
|
className: "relative -my-1 rounded p-1 text-slate-400 opacity-0 transition-opacity hover:bg-slate-100 hover:text-slate-700 focus-visible:opacity-100 group-hover/rs:opacity-100 dark:hover:bg-white/5 dark:hover:text-slate-200 motion-reduce:transition-none",
|
|
1005
|
-
children: /* @__PURE__ */ r(
|
|
1005
|
+
children: /* @__PURE__ */ r(Ct, { className: "h-3 w-3" })
|
|
1006
1006
|
}
|
|
1007
1007
|
),
|
|
1008
1008
|
e.is_collapsed && /* @__PURE__ */ r(
|
|
1009
|
-
|
|
1009
|
+
Dt,
|
|
1010
1010
|
{
|
|
1011
1011
|
"aria-hidden": "true",
|
|
1012
|
-
className: `pointer-events-none h-3.5 w-3.5 shrink-0 transition-transform group-hover/rs:text-slate-700 dark:group-hover/rs:text-slate-200 ${
|
|
1012
|
+
className: `pointer-events-none h-3.5 w-3.5 shrink-0 transition-transform group-hover/rs:text-slate-700 dark:group-hover/rs:text-slate-200 ${pe(e) ? "" : "-rotate-90"}`
|
|
1013
1013
|
}
|
|
1014
1014
|
)
|
|
1015
1015
|
]
|
|
1016
1016
|
}
|
|
1017
1017
|
),
|
|
1018
|
-
/* @__PURE__ */ m("div", { className: "px-5 pb-5 pt-4", hidden: !
|
|
1019
|
-
|
|
1018
|
+
/* @__PURE__ */ m("div", { className: "px-5 pb-5 pt-4", hidden: !pe(e), children: [
|
|
1019
|
+
Je && /* @__PURE__ */ r(
|
|
1020
1020
|
"p",
|
|
1021
1021
|
{
|
|
1022
1022
|
"data-read-empty": e.key,
|
|
@@ -1032,20 +1032,20 @@ function ut({
|
|
|
1032
1032
|
"dl",
|
|
1033
1033
|
{
|
|
1034
1034
|
className: "grid gap-x-6 gap-y-5",
|
|
1035
|
-
"data-read-dl":
|
|
1036
|
-
style:
|
|
1037
|
-
children:
|
|
1038
|
-
(n) => n.kind === "row" ?
|
|
1035
|
+
"data-read-dl": nt,
|
|
1036
|
+
style: Je ? { display: "none" } : void 0,
|
|
1037
|
+
children: Tt.map(
|
|
1038
|
+
(n) => n.kind === "row" ? At(n.row, n.members) : Ot(n.field)
|
|
1039
1039
|
)
|
|
1040
1040
|
}
|
|
1041
1041
|
),
|
|
1042
|
-
|
|
1042
|
+
oe.map((n) => {
|
|
1043
1043
|
var E;
|
|
1044
1044
|
return /* @__PURE__ */ r(
|
|
1045
1045
|
"div",
|
|
1046
1046
|
{
|
|
1047
1047
|
className: L.length > 0 ? "mt-3" : "",
|
|
1048
|
-
hidden:
|
|
1048
|
+
hidden: Ge(n) || Je,
|
|
1049
1049
|
children: N(
|
|
1050
1050
|
O(n),
|
|
1051
1051
|
/* @__PURE__ */ m(ge, { children: [
|
|
@@ -1060,15 +1060,15 @@ function ut({
|
|
|
1060
1060
|
"; switch to Edit to fix"
|
|
1061
1061
|
] })
|
|
1062
1062
|
] }) : null,
|
|
1063
|
-
(W ? W(n) : null) ??
|
|
1063
|
+
(W ? W(n) : null) ?? bt(n)
|
|
1064
1064
|
] }),
|
|
1065
|
-
|
|
1065
|
+
C(n)
|
|
1066
1066
|
)
|
|
1067
1067
|
},
|
|
1068
1068
|
n.field
|
|
1069
1069
|
);
|
|
1070
1070
|
}),
|
|
1071
|
-
|
|
1071
|
+
le(e.key),
|
|
1072
1072
|
_e(e.key),
|
|
1073
1073
|
I && c && /* @__PURE__ */ r(
|
|
1074
1074
|
"div",
|
|
@@ -1085,14 +1085,14 @@ function ut({
|
|
|
1085
1085
|
},
|
|
1086
1086
|
e.key
|
|
1087
1087
|
);
|
|
1088
|
-
},
|
|
1088
|
+
}, et = _e(null), Nt = _e(null, "leading"), tt = Ze.map((e) => _t(e)).filter((e) => !!e && !de(e)).filter((e) => k || !vt(e)), [ne, ...lt] = tt;
|
|
1089
1089
|
return /* @__PURE__ */ m(
|
|
1090
1090
|
"div",
|
|
1091
1091
|
{
|
|
1092
1092
|
className: P ? "min-h-0 flex-1" : "min-h-0 flex-1 overflow-y-auto bg-slate-50/60 px-5 py-4 dark:bg-transparent",
|
|
1093
1093
|
children: [
|
|
1094
|
-
|
|
1095
|
-
|
|
1094
|
+
Nt,
|
|
1095
|
+
tt.length > 0 && /* @__PURE__ */ m(
|
|
1096
1096
|
"div",
|
|
1097
1097
|
{
|
|
1098
1098
|
"data-read-header": !0,
|
|
@@ -1101,7 +1101,7 @@ function ut({
|
|
|
1101
1101
|
ne && N(
|
|
1102
1102
|
{ kind: "header", field: ne.field },
|
|
1103
1103
|
/* @__PURE__ */ m("div", { className: "min-w-0", children: [
|
|
1104
|
-
/* @__PURE__ */ m("p", { className:
|
|
1104
|
+
/* @__PURE__ */ m("p", { className: Ie, children: [
|
|
1105
1105
|
$e(ne),
|
|
1106
1106
|
/* @__PURE__ */ r(ae, { field: ne.field })
|
|
1107
1107
|
] }),
|
|
@@ -1110,17 +1110,17 @@ function ut({
|
|
|
1110
1110
|
{
|
|
1111
1111
|
"data-replay-field": ne.field,
|
|
1112
1112
|
"data-field-collection": a,
|
|
1113
|
-
className: `truncate text-[22px] font-semibold leading-tight tracking-[-0.015em] text-slate-900 dark:text-white${
|
|
1113
|
+
className: `truncate text-[22px] font-semibold leading-tight tracking-[-0.015em] text-slate-900 dark:text-white${R(ne.field)}`,
|
|
1114
1114
|
children: u ? Pe(ne) : "…"
|
|
1115
1115
|
}
|
|
1116
1116
|
)
|
|
1117
1117
|
] }),
|
|
1118
|
-
|
|
1118
|
+
C(ne)
|
|
1119
1119
|
),
|
|
1120
|
-
|
|
1120
|
+
lt.length > 0 && /* @__PURE__ */ r("dl", { className: "mt-3 flex flex-wrap gap-x-8 gap-y-2", children: lt.map((e) => /* @__PURE__ */ r("div", { className: "min-w-0", children: N(
|
|
1121
1121
|
{ kind: "header", field: e.field },
|
|
1122
1122
|
/* @__PURE__ */ m(ge, { children: [
|
|
1123
|
-
/* @__PURE__ */ m("dt", { className:
|
|
1123
|
+
/* @__PURE__ */ m("dt", { className: Ie, children: [
|
|
1124
1124
|
$e(e),
|
|
1125
1125
|
/* @__PURE__ */ r(ae, { field: e.field }),
|
|
1126
1126
|
v(e.field)
|
|
@@ -1130,31 +1130,31 @@ function ut({
|
|
|
1130
1130
|
{
|
|
1131
1131
|
"data-replay-field": e.field,
|
|
1132
1132
|
"data-field-collection": a,
|
|
1133
|
-
"data-remote-changed":
|
|
1134
|
-
className: `mt-0.5 truncate text-[13px] font-medium text-slate-800 dark:text-slate-100${
|
|
1133
|
+
"data-remote-changed": ce.has(e.field) || void 0,
|
|
1134
|
+
className: `mt-0.5 truncate text-[13px] font-medium text-slate-800 dark:text-slate-100${R(e.field)}`,
|
|
1135
1135
|
children: u ? Pe(e) : "…"
|
|
1136
1136
|
}
|
|
1137
1137
|
)
|
|
1138
1138
|
] }),
|
|
1139
|
-
|
|
1139
|
+
C(e)
|
|
1140
1140
|
) }, e.field)) })
|
|
1141
1141
|
]
|
|
1142
1142
|
}
|
|
1143
1143
|
),
|
|
1144
|
-
/* @__PURE__ */ r("style", { children:
|
|
1145
|
-
J ? /* @__PURE__ */ r("div", { className: "grid items-stretch gap-4", "data-read-board": !0, children:
|
|
1144
|
+
/* @__PURE__ */ r("style", { children: ol }),
|
|
1145
|
+
J ? /* @__PURE__ */ r("div", { className: "grid items-stretch gap-4", "data-read-board": !0, children: Be.map(kt) }) : /* @__PURE__ */ m("div", { className: "flex flex-col gap-4", "data-read-board-pending": !0, children: [
|
|
1146
1146
|
/* @__PURE__ */ r("div", { className: "h-32 animate-pulse rounded-xl bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }),
|
|
1147
1147
|
/* @__PURE__ */ r("div", { className: "h-32 animate-pulse rounded-xl bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }),
|
|
1148
1148
|
/* @__PURE__ */ r("div", { className: "h-56 animate-pulse rounded-xl bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" })
|
|
1149
1149
|
] }),
|
|
1150
|
-
|
|
1150
|
+
et && /* @__PURE__ */ r("div", { className: "mt-4", children: et })
|
|
1151
1151
|
]
|
|
1152
1152
|
}
|
|
1153
1153
|
);
|
|
1154
1154
|
}
|
|
1155
|
-
function
|
|
1156
|
-
return a.design ? /* @__PURE__ */ r(
|
|
1155
|
+
function Ul(a) {
|
|
1156
|
+
return a.design ? /* @__PURE__ */ r(nl, { design: a.design.context, onRefusedWrite: a.design.onRefusedWrite, children: /* @__PURE__ */ r(Pt.Provider, { value: null, children: /* @__PURE__ */ r(mt, { ...a }) }) }) : /* @__PURE__ */ r(mt, { ...a });
|
|
1157
1157
|
}
|
|
1158
1158
|
export {
|
|
1159
|
-
|
|
1159
|
+
Ul as RecordReadView
|
|
1160
1160
|
};
|