@nivaro/react 0.3.66 → 0.3.67
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/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +8 -1
- package/dist/shared/components/ActivityEntry.js +28 -28
- package/dist/shared/components/CollectionBrowserView.js +584 -585
- package/dist/shared/components/ItemEditForm.js +1758 -1758
- package/dist/shared/components/RecordCompare.js +149 -129
- package/dist/shared/components/bulk/BulkCompareButton.js +16 -16
- package/dist/shared/components/integrations/IntegrationObligationsView.js +199 -187
- package/dist/shared/components/integrations/console/EventsView.js +22 -24
- package/dist/shared/components/integrations/console/SubmissionRow.js +6 -13
- package/dist/shared/components/integrations/console/drill/SubmissionDrill.js +29 -28
- package/dist/shared/components/integrations/console/tone.js +22 -21
- package/dist/shared/components/item-edit/FieldRow.js +193 -193
- package/dist/shared/components/item-edit/GroupSection.js +209 -209
- package/dist/shared/components/item-edit/RecordInsights.js +46 -45
- package/dist/shared/components/panels/BranchLanes.js +7 -7
- package/dist/shared/components/panels/CommentPanel.js +72 -72
- package/dist/shared/components/panels/PipelinePanel.js +261 -261
- package/dist/shared/components/panels/RecordIntegrityBanner.js +78 -78
- package/dist/shared/components/panels/RevisionsPanel.js +220 -220
- package/dist/shared/components/panels/TaskPanel.js +75 -75
- package/dist/shared/components/queue/QueueWorklist.js +499 -498
- package/dist/shared/lib/compare-value.js +73 -0
- package/dist/shared/lib/format-value.js +19 -18
- package/dist/shared/lib/utils.js +59 -57
- package/package.json +1 -1
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { jsx as e, jsxs as y, Fragment as
|
|
1
|
+
import { jsx as e, jsxs as y, Fragment as $t } from "react/jsx-runtime";
|
|
2
2
|
import { useQuery as de, useQueryClient as Dt } from "@tanstack/react-query";
|
|
3
|
-
import * as
|
|
4
|
-
import { ChevronDown as
|
|
5
|
-
import st, { useContext as
|
|
6
|
-
import { RelationPathDataContext as It, useDrilldown as lt, fieldDrilldownConfig as Mt, useOptionalNivaroClient as ue, useNavigation as
|
|
7
|
-
import { get as at, post as
|
|
8
|
-
import { planFieldGrid as
|
|
3
|
+
import * as Ft from "lucide-react";
|
|
4
|
+
import { ChevronDown as jt, Loader2 as Ot, User as qt, Mail as Bt } from "lucide-react";
|
|
5
|
+
import st, { useContext as Ut, useState as Y, useRef as $e, useEffect as ne, memo as Tt } from "react";
|
|
6
|
+
import { RelationPathDataContext as It, useDrilldown as lt, fieldDrilldownConfig as Mt, useOptionalNivaroClient as ue, useNavigation as Pt } from "../../context.js";
|
|
7
|
+
import { get as at, post as Ct } from "../../lib/commands.js";
|
|
8
|
+
import { planFieldGrid as Gt, isEmptyValue as Lt, isFolded as Vt, readGroupStructure as Jt } from "../../lib/form-structure.js";
|
|
9
9
|
import { reportSectionUse as ot } from "../../lib/form-usage-beacon.js";
|
|
10
10
|
import { useRecordReader as ct } from "../../lib/record-loader.js";
|
|
11
|
-
import { formatDate as ce, choiceLabel as
|
|
12
|
-
import { DesignDropZone as
|
|
13
|
-
import { useLayoutDesign as
|
|
11
|
+
import { formatDate as ce, formatDateTime as dt, choiceLabel as Rt, titleCase as ut, cn as E, toLocalDateString as De } from "../../lib/utils.js";
|
|
12
|
+
import { DesignDropZone as zt, designWrap as Ht } from "../layout-editor/DesignNode.js";
|
|
13
|
+
import { useLayoutDesign as Kt, revealGroupKey as Et } from "../layout-editor/design-context.js";
|
|
14
14
|
import { GridGuides as ke } from "../layout-editor/grid-guides.js";
|
|
15
|
-
import { UserAvatar as
|
|
16
|
-
import { DropdownMenu as
|
|
15
|
+
import { UserAvatar as Wt } from "../UserAvatar.js";
|
|
16
|
+
import { DropdownMenu as At, DropdownMenuTrigger as Yt, DropdownMenuContent as Qt, DropdownMenuItem as Ye } from "../ui/dropdown-menu.js";
|
|
17
17
|
import { WidgetSlot as Qe } from "../WidgetSlot.js";
|
|
18
18
|
import { FieldRow as Se } from "./FieldRow.js";
|
|
19
|
-
import { useFormHelpVideos as
|
|
20
|
-
import { FoldArea as
|
|
21
|
-
import { applyDisplayTemplate as
|
|
22
|
-
import { SectionIntro as
|
|
23
|
-
import { invalidateM2MFor as
|
|
24
|
-
import { groupSectionPropsEqual as
|
|
25
|
-
import { UserChip as
|
|
26
|
-
import { UserRosterCluster as
|
|
19
|
+
import { useFormHelpVideos as Zt, FormHelpVideoButton as Xt } from "./FormHelpVideoButton.js";
|
|
20
|
+
import { FoldArea as en, RowGroupCell as tn, rowMemberField as nn } from "./form-structure-ui.js";
|
|
21
|
+
import { applyDisplayTemplate as rn, useContainerWidth as sn, resolveColSpan as Ze } from "./helpers.js";
|
|
22
|
+
import { SectionIntro as ln } from "./LayoutContentBlock.js";
|
|
23
|
+
import { invalidateM2MFor as an } from "./m2m-invalidate.js";
|
|
24
|
+
import { groupSectionPropsEqual as on } from "./render-stability.js";
|
|
25
|
+
import { UserChip as pt, OwnersInline as Xe, OwnersInlineCompact as cn } from "./UserChip.js";
|
|
26
|
+
import { UserRosterCluster as zn } from "./UserChip.js";
|
|
27
27
|
function et(n) {
|
|
28
28
|
if (typeof n != "string") return n ?? [];
|
|
29
29
|
try {
|
|
@@ -32,91 +32,91 @@ function et(n) {
|
|
|
32
32
|
return [];
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
function
|
|
35
|
+
function dn({
|
|
36
36
|
relCollection: n,
|
|
37
37
|
relId: t,
|
|
38
38
|
entries: i,
|
|
39
39
|
separator: a
|
|
40
40
|
}) {
|
|
41
|
-
const s = ue(), o = ct(), r = String(t), m = i.some((
|
|
41
|
+
const s = ue(), o = ct(), r = String(t), m = i.some((g) => g.field.includes(".")) ? ["id", ...i.map((g) => g.field)].join(",") : null, { data: d } = de({
|
|
42
42
|
queryKey: ["inline-display", n, r, m],
|
|
43
43
|
queryFn: () => o(n, r, m),
|
|
44
44
|
enabled: !!s && !!r,
|
|
45
45
|
staleTime: 6e4
|
|
46
46
|
});
|
|
47
47
|
if (!d) return null;
|
|
48
|
-
const F = (
|
|
48
|
+
const F = (g) => {
|
|
49
49
|
let h = d;
|
|
50
|
-
for (const v of
|
|
50
|
+
for (const v of g.split(".")) {
|
|
51
51
|
if (h == null || typeof h != "object") return;
|
|
52
52
|
h = h[v];
|
|
53
53
|
}
|
|
54
54
|
return h;
|
|
55
55
|
};
|
|
56
56
|
if (a != null) {
|
|
57
|
-
const
|
|
58
|
-
const
|
|
59
|
-
if (
|
|
57
|
+
const g = (c) => {
|
|
58
|
+
const x = F(c.field);
|
|
59
|
+
if (x == null || x === "") return null;
|
|
60
60
|
const S = c.format ?? "text";
|
|
61
61
|
if (S === "date" || S === "datetime")
|
|
62
62
|
try {
|
|
63
|
-
return
|
|
63
|
+
return De(x);
|
|
64
64
|
} catch {
|
|
65
|
-
return String(
|
|
65
|
+
return String(x);
|
|
66
66
|
}
|
|
67
|
-
return S === "boolean" ?
|
|
67
|
+
return S === "boolean" ? x ? "Yes" : "No" : String(x);
|
|
68
68
|
}, h = [];
|
|
69
69
|
let v = [];
|
|
70
70
|
for (const c of i)
|
|
71
71
|
c.line_break && v.length > 0 ? (h.push(v), v = [c]) : v.push(c);
|
|
72
72
|
v.length > 0 && h.push(v);
|
|
73
73
|
const O = h.map(
|
|
74
|
-
(c) => c.map((
|
|
75
|
-
const S = x
|
|
76
|
-
return S ? { label:
|
|
74
|
+
(c) => c.map((x) => {
|
|
75
|
+
const S = g(x);
|
|
76
|
+
return S ? { label: x.label ?? null, display: S } : null;
|
|
77
77
|
}).filter(Boolean)
|
|
78
78
|
).filter((c) => c.length > 0);
|
|
79
|
-
return O.length === 0 ? null : /* @__PURE__ */ e("div", { className: "mt-1", children: O.map((c,
|
|
79
|
+
return O.length === 0 ? null : /* @__PURE__ */ e("div", { className: "mt-1", children: O.map((c, x) => (
|
|
80
80
|
// biome-ignore lint/suspicious/noArrayIndexKey: stable line order
|
|
81
|
-
/* @__PURE__ */ e("p", { className: "text-[12px] text-slate-500 dark:text-slate-400", children: c.map((S,
|
|
81
|
+
/* @__PURE__ */ e("p", { className: "text-[12px] text-slate-500 dark:text-slate-400", children: c.map((S, D) => (
|
|
82
82
|
// biome-ignore lint/suspicious/noArrayIndexKey: stable token order
|
|
83
83
|
/* @__PURE__ */ y(st.Fragment, { children: [
|
|
84
|
-
|
|
84
|
+
D > 0 && a,
|
|
85
85
|
S.label && /* @__PURE__ */ y("span", { className: "font-semibold text-slate-600 dark:text-slate-300", children: [
|
|
86
86
|
S.label,
|
|
87
87
|
":"
|
|
88
88
|
] }),
|
|
89
89
|
S.label ? " " : "",
|
|
90
90
|
S.display
|
|
91
|
-
] },
|
|
92
|
-
)) },
|
|
91
|
+
] }, D)
|
|
92
|
+
)) }, x)
|
|
93
93
|
)) });
|
|
94
94
|
}
|
|
95
|
-
const
|
|
96
|
-
const h = F(
|
|
95
|
+
const $ = i.map((g) => {
|
|
96
|
+
const h = F(g.field);
|
|
97
97
|
if (h == null || h === "") return null;
|
|
98
|
-
const v =
|
|
98
|
+
const v = g.format ?? "text";
|
|
99
99
|
let O;
|
|
100
100
|
if (v === "date" || v === "datetime")
|
|
101
101
|
try {
|
|
102
|
-
O =
|
|
102
|
+
O = De(h);
|
|
103
103
|
} catch {
|
|
104
104
|
O = String(h);
|
|
105
105
|
}
|
|
106
106
|
else v === "boolean" ? O = h ? "Yes" : "No" : O = String(h);
|
|
107
|
-
return { label:
|
|
107
|
+
return { label: g.label, display: O };
|
|
108
108
|
}).filter(Boolean);
|
|
109
|
-
return
|
|
109
|
+
return $.length === 0 ? null : /* @__PURE__ */ e("div", { className: "mt-1 rounded border border-slate-200 bg-slate-50 dark:border-slate-700 dark:bg-slate-800/50 px-3 py-1.5 space-y-0.5", children: $.map((g, h) => (
|
|
110
110
|
// biome-ignore lint/suspicious/noArrayIndexKey: stable order from config
|
|
111
111
|
/* @__PURE__ */ y("div", { className: "flex items-baseline gap-2", children: [
|
|
112
|
-
|
|
113
|
-
/* @__PURE__ */ e("span", { className: "text-[12px] text-slate-700 dark:text-slate-300 truncate", children:
|
|
112
|
+
g.label && /* @__PURE__ */ e("span", { className: "shrink-0 min-w-[56px] text-[10px] font-medium text-slate-400", children: g.label }),
|
|
113
|
+
/* @__PURE__ */ e("span", { className: "text-[12px] text-slate-700 dark:text-slate-300 truncate", children: g.display })
|
|
114
114
|
] }, h)
|
|
115
115
|
)) });
|
|
116
116
|
}
|
|
117
|
-
function
|
|
117
|
+
function un(n) {
|
|
118
118
|
if (!n) return null;
|
|
119
|
-
const t = n.replace(/(^|-)([a-z])/g, (a, s, o) => o.toUpperCase()), i =
|
|
119
|
+
const t = n.replace(/(^|-)([a-z])/g, (a, s, o) => o.toUpperCase()), i = Ft[t];
|
|
120
120
|
return i || null;
|
|
121
121
|
}
|
|
122
122
|
function tt(n) {
|
|
@@ -193,14 +193,14 @@ function Fe(n, t) {
|
|
|
193
193
|
} catch {
|
|
194
194
|
}
|
|
195
195
|
const l = s.match(/^(\d{4})-(\d{2})-(\d{2})(?:T00:00:00(?:\.000)?Z)?$/);
|
|
196
|
-
return l ? ce(`${l[1]}-${l[2]}-${l[3]}`) : r ? ce(s) :
|
|
196
|
+
return l ? ce(`${l[1]}-${l[2]}-${l[3]}`) : r ? ce(s) : dt(s);
|
|
197
197
|
} catch {
|
|
198
198
|
}
|
|
199
199
|
if ((i === "select-dropdown" || i === "radio-buttons") && t) {
|
|
200
200
|
const l = tt(t).choices;
|
|
201
201
|
if (Array.isArray(l)) {
|
|
202
202
|
const m = l.find((d) => String(d.value) === s);
|
|
203
|
-
if (m) return
|
|
203
|
+
if (m) return Rt(m.text);
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
206
|
const o = Number(s);
|
|
@@ -236,10 +236,10 @@ function Fe(n, t) {
|
|
|
236
236
|
}).format(o);
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
|
-
return !s.includes(" ") && !s.includes("@") && !/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(s) && !/^\d+$/.test(s) && (s.includes("_") || s.includes("-") || /^[a-z]/.test(s)) ?
|
|
239
|
+
return !s.includes(" ") && !s.includes("@") && !/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(s) && !/^\d+$/.test(s) && (s.includes("_") || s.includes("-") || /^[a-z]/.test(s)) ? ut(s) : s;
|
|
240
240
|
}
|
|
241
241
|
function nt({ userId: n }) {
|
|
242
|
-
const t = ue(), { navigate: i, userUrl: a } =
|
|
242
|
+
const t = ue(), { navigate: i, userUrl: a } = Pt(), s = a ? a(n) : `/users/${n}`, { data: o } = de({
|
|
243
243
|
queryKey: ["user-chip", n],
|
|
244
244
|
queryFn: () => t.request(
|
|
245
245
|
at(`/users/${n}`)
|
|
@@ -247,10 +247,10 @@ function nt({ userId: n }) {
|
|
|
247
247
|
enabled: !!t && !!n,
|
|
248
248
|
staleTime: 12e4
|
|
249
249
|
}), r = o ? [o.first_name, o.last_name].filter(Boolean).join(" ") || o.email : n, l = r.split(" ").map((m) => m[0]).filter(Boolean).slice(0, 2).join("").toUpperCase();
|
|
250
|
-
return /* @__PURE__ */ y(
|
|
251
|
-
/* @__PURE__ */ e(
|
|
250
|
+
return /* @__PURE__ */ y(At, { children: [
|
|
251
|
+
/* @__PURE__ */ e(Yt, { asChild: !0, children: /* @__PURE__ */ y("span", { className: "inline-flex cursor-pointer items-center gap-1 rounded-full bg-slate-100 py-px pl-0.5 pr-2 hover:bg-slate-200 transition-colors", children: [
|
|
252
252
|
/* @__PURE__ */ e(
|
|
253
|
-
|
|
253
|
+
Wt,
|
|
254
254
|
{
|
|
255
255
|
userId: n,
|
|
256
256
|
className: "h-4 w-4",
|
|
@@ -259,14 +259,14 @@ function nt({ userId: n }) {
|
|
|
259
259
|
),
|
|
260
260
|
/* @__PURE__ */ e("span", { className: "text-[11px] text-slate-600", children: r })
|
|
261
261
|
] }) }),
|
|
262
|
-
/* @__PURE__ */ y(
|
|
262
|
+
/* @__PURE__ */ y(Qt, { align: "start", className: "text-[12px]", children: [
|
|
263
263
|
s && /* @__PURE__ */ y(
|
|
264
264
|
Ye,
|
|
265
265
|
{
|
|
266
266
|
className: "gap-2 text-[12px] cursor-pointer",
|
|
267
267
|
onSelect: () => i(s),
|
|
268
268
|
children: [
|
|
269
|
-
/* @__PURE__ */ e(
|
|
269
|
+
/* @__PURE__ */ e(qt, { className: "h-3.5 w-3.5" }),
|
|
270
270
|
" View profile"
|
|
271
271
|
]
|
|
272
272
|
}
|
|
@@ -279,7 +279,7 @@ function nt({ userId: n }) {
|
|
|
279
279
|
window.location.href = `mailto:${o.email}`;
|
|
280
280
|
},
|
|
281
281
|
children: [
|
|
282
|
-
/* @__PURE__ */ e(
|
|
282
|
+
/* @__PURE__ */ e(Bt, { className: "h-3.5 w-3.5" }),
|
|
283
283
|
" Send email"
|
|
284
284
|
]
|
|
285
285
|
}
|
|
@@ -287,7 +287,7 @@ function nt({ userId: n }) {
|
|
|
287
287
|
] })
|
|
288
288
|
] });
|
|
289
289
|
}
|
|
290
|
-
function
|
|
290
|
+
function pn({
|
|
291
291
|
collection: n,
|
|
292
292
|
itemId: t,
|
|
293
293
|
layoutId: i,
|
|
@@ -300,26 +300,26 @@ function un({
|
|
|
300
300
|
d(!0);
|
|
301
301
|
try {
|
|
302
302
|
await r.request(
|
|
303
|
-
|
|
303
|
+
Ct(`/collection-layouts/${i}/generate-and-attach`, {
|
|
304
304
|
collection: n,
|
|
305
305
|
item_id: t,
|
|
306
306
|
attach_field: a,
|
|
307
307
|
filename_template: s ?? void 0
|
|
308
308
|
})
|
|
309
|
-
),
|
|
309
|
+
), an(l, [t]), l.invalidateQueries({ queryKey: ["items", n, t] });
|
|
310
310
|
} catch {
|
|
311
311
|
} finally {
|
|
312
312
|
d(!1);
|
|
313
313
|
}
|
|
314
314
|
}
|
|
315
|
-
},
|
|
315
|
+
}, $ = !a;
|
|
316
316
|
return /* @__PURE__ */ y(
|
|
317
317
|
"button",
|
|
318
318
|
{
|
|
319
319
|
type: "button",
|
|
320
320
|
onClick: F,
|
|
321
|
-
disabled: m ||
|
|
322
|
-
title:
|
|
321
|
+
disabled: m || $,
|
|
322
|
+
title: $ ? "Configure PDF field in Data Model → Layouts" : void 0,
|
|
323
323
|
className: "inline-flex items-center gap-1.5 rounded-md border border-nvr-cyan/40 bg-nvr-cyan/10 px-3 py-1.5 text-[12px] font-medium text-nvr-navy hover:bg-nvr-cyan/20 disabled:cursor-not-allowed disabled:opacity-40 dark:text-nvr-cyan",
|
|
324
324
|
children: [
|
|
325
325
|
/* @__PURE__ */ y(
|
|
@@ -366,13 +366,13 @@ function re({
|
|
|
366
366
|
if (!o) return /* @__PURE__ */ e("span", { children: "—" });
|
|
367
367
|
if (F || a && r === void 0)
|
|
368
368
|
return /* @__PURE__ */ e("span", { className: "animate-pulse h-3 w-20 rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))] inline-block" });
|
|
369
|
-
const
|
|
370
|
-
if (!d) return /* @__PURE__ */ e("span", { className:
|
|
371
|
-
const
|
|
372
|
-
return /* @__PURE__ */ e("span", { className:
|
|
369
|
+
const $ = i ?? "text-[13px] text-slate-700";
|
|
370
|
+
if (!d) return /* @__PURE__ */ e("span", { className: $, children: o });
|
|
371
|
+
const g = r != null && r.display_template ? rn(r.display_template, d) : String(d.name ?? d.title ?? d.label ?? d.display_name ?? o);
|
|
372
|
+
return /* @__PURE__ */ e("span", { className: $, children: g });
|
|
373
373
|
}
|
|
374
374
|
function rt({ userId: n }) {
|
|
375
|
-
return /* @__PURE__ */ e(
|
|
375
|
+
return /* @__PURE__ */ e(pt, { userId: n, size: "compact" });
|
|
376
376
|
}
|
|
377
377
|
function it({
|
|
378
378
|
relCollection: n,
|
|
@@ -406,8 +406,8 @@ function it({
|
|
|
406
406
|
}
|
|
407
407
|
);
|
|
408
408
|
}
|
|
409
|
-
function
|
|
410
|
-
const [t, i] = Y(!1), a =
|
|
409
|
+
function mn(n) {
|
|
410
|
+
const [t, i] = Y(!1), a = $e(!0), s = $e(JSON.stringify(n ?? null));
|
|
411
411
|
return ne(() => {
|
|
412
412
|
const o = JSON.stringify(n ?? null);
|
|
413
413
|
if (a.current) {
|
|
@@ -422,7 +422,7 @@ function pn(n) {
|
|
|
422
422
|
};
|
|
423
423
|
}, [n]), t ? "nvr-value-pulse" : "";
|
|
424
424
|
}
|
|
425
|
-
function
|
|
425
|
+
function Ln({
|
|
426
426
|
field: n,
|
|
427
427
|
val: t,
|
|
428
428
|
relations: i,
|
|
@@ -431,36 +431,36 @@ function Cn({
|
|
|
431
431
|
textClassName: o
|
|
432
432
|
}) {
|
|
433
433
|
var O;
|
|
434
|
-
const r =
|
|
434
|
+
const r = mn(t), l = (O = Ut(It)) == null ? void 0 : O[n.field], m = lt(), d = E(o ?? "text-[13px] text-slate-900 dark:text-slate-100", r), F = Mt(n) ?? { enabled: !0, layout_id: null, width: null }, $ = i.find(
|
|
435
435
|
(c) => c.one_collection === a && c.one_field === n.field && c.junction_field
|
|
436
436
|
);
|
|
437
|
-
if (
|
|
437
|
+
if ($) {
|
|
438
438
|
const c = i.find(
|
|
439
|
-
(
|
|
440
|
-
),
|
|
441
|
-
return !
|
|
439
|
+
(D) => D.many_collection === $.many_collection && D.many_field === $.junction_field
|
|
440
|
+
), x = c == null ? void 0 : c.one_collection, S = Array.isArray(t) ? t : t != null && t !== "" ? [t] : [];
|
|
441
|
+
return !x || S.length === 0 ? /* @__PURE__ */ e("span", { className: "text-slate-300 dark:text-slate-600", children: "—" }) : x === "nivaro_users" ? /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1 gap-y-0.5", children: S.map((D) => /* @__PURE__ */ e(rt, { userId: String(D) }, String(D))) }) : /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1.5", children: S.map((D) => /* @__PURE__ */ e(
|
|
442
442
|
it,
|
|
443
443
|
{
|
|
444
|
-
relCollection:
|
|
445
|
-
id:
|
|
444
|
+
relCollection: x,
|
|
445
|
+
id: D,
|
|
446
446
|
drillConfig: F
|
|
447
447
|
},
|
|
448
|
-
String(
|
|
448
|
+
String(D)
|
|
449
449
|
)) });
|
|
450
450
|
}
|
|
451
|
-
const
|
|
451
|
+
const g = i.find(
|
|
452
452
|
(c) => c.many_collection === a && c.many_field === n.field && !c.junction_field
|
|
453
453
|
);
|
|
454
|
-
if (
|
|
454
|
+
if (g != null && g.one_collection) {
|
|
455
455
|
const c = Array.isArray(t) ? t : t != null && t !== "" ? [t] : [];
|
|
456
|
-
return c.length === 0 ? /* @__PURE__ */ e("span", { className: "text-slate-300 dark:text-slate-600", children: "—" }) :
|
|
456
|
+
return c.length === 0 ? /* @__PURE__ */ e("span", { className: "text-slate-300 dark:text-slate-600", children: "—" }) : g.one_collection === "nivaro_users" ? /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1 gap-y-0.5", children: c.map((x) => /* @__PURE__ */ e(rt, { userId: String(x) }, String(x))) }) : /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1.5", children: c.map((x) => /* @__PURE__ */ e(
|
|
457
457
|
it,
|
|
458
458
|
{
|
|
459
|
-
relCollection:
|
|
460
|
-
id:
|
|
459
|
+
relCollection: g.one_collection,
|
|
460
|
+
id: x,
|
|
461
461
|
drillConfig: F
|
|
462
462
|
},
|
|
463
|
-
String(
|
|
463
|
+
String(x)
|
|
464
464
|
)) });
|
|
465
465
|
}
|
|
466
466
|
if (t == null || t === "")
|
|
@@ -483,12 +483,12 @@ function Cn({
|
|
|
483
483
|
) });
|
|
484
484
|
if (s === "date")
|
|
485
485
|
try {
|
|
486
|
-
return /* @__PURE__ */ e("span", { className: `font-semibold ${d}`, children: ce(t) ||
|
|
486
|
+
return /* @__PURE__ */ e("span", { className: `font-semibold ${d}`, children: ce(t) || De(t) });
|
|
487
487
|
} catch {
|
|
488
488
|
}
|
|
489
489
|
if (s === "datetime")
|
|
490
490
|
try {
|
|
491
|
-
return /* @__PURE__ */ e("span", { className: `font-semibold ${d}`, children:
|
|
491
|
+
return /* @__PURE__ */ e("span", { className: `font-semibold ${d}`, children: dt(String(t)) });
|
|
492
492
|
} catch {
|
|
493
493
|
}
|
|
494
494
|
}
|
|
@@ -500,8 +500,8 @@ function Cn({
|
|
|
500
500
|
{
|
|
501
501
|
type: "button",
|
|
502
502
|
"data-header-path-link": "",
|
|
503
|
-
onClick: (
|
|
504
|
-
|
|
503
|
+
onClick: (x) => {
|
|
504
|
+
x.stopPropagation(), m.open({ collection: v, itemId: String(c), layoutId: null, width: "85%" });
|
|
505
505
|
},
|
|
506
506
|
className: "cursor-pointer text-left underline decoration-slate-300 underline-offset-[3px] hover:text-[#0284c7] hover:decoration-[#0284c7] dark:decoration-slate-600 dark:hover:text-sky-400",
|
|
507
507
|
children: h
|
|
@@ -510,7 +510,7 @@ function Cn({
|
|
|
510
510
|
}
|
|
511
511
|
return h;
|
|
512
512
|
}
|
|
513
|
-
function
|
|
513
|
+
function fn({
|
|
514
514
|
summaryFields: n,
|
|
515
515
|
fields: t,
|
|
516
516
|
draft: i,
|
|
@@ -522,26 +522,26 @@ function mn({
|
|
|
522
522
|
ownersAssignment: m,
|
|
523
523
|
m2mCounts: d,
|
|
524
524
|
o2mCounts: F,
|
|
525
|
-
o2mAggValues:
|
|
526
|
-
summaryAggConfigs:
|
|
525
|
+
o2mAggValues: $,
|
|
526
|
+
summaryAggConfigs: g,
|
|
527
527
|
o2mLoading: h,
|
|
528
528
|
hideEmpty: v
|
|
529
529
|
}) {
|
|
530
530
|
const O = n.map((_) => typeof _ == "string" ? _ : _.field), c = v ? O.filter((_) => {
|
|
531
|
-
if (_ === "__owners__" || h != null && h.has(_) ||
|
|
531
|
+
if (_ === "__owners__" || h != null && h.has(_) || $ && _ in $) return !0;
|
|
532
532
|
if (d && _ in d) return (d[_] ?? 0) > 0;
|
|
533
533
|
if (F && _ in F) return (F[_] ?? 0) > 0;
|
|
534
|
-
const
|
|
535
|
-
return
|
|
534
|
+
const M = i[_];
|
|
535
|
+
return M != null && M !== "" && !(Array.isArray(M) && M.length === 0);
|
|
536
536
|
}) : O;
|
|
537
537
|
if (c.length === 0) return null;
|
|
538
|
-
const
|
|
538
|
+
const x = "text-[9px] font-semibold uppercase tracking-wider text-slate-400 dark:text-slate-500 shrink-0", S = "text-[12px] font-semibold text-slate-700 dark:text-slate-300", D = "text-[12px] text-slate-300 dark:text-slate-600", R = "flex items-baseline gap-1.5", pe = (_) => {
|
|
539
539
|
if (_ === "__owners__") {
|
|
540
540
|
const u = (m == null ? void 0 : m.label_override) || "Owners";
|
|
541
541
|
return /* @__PURE__ */ y("div", { className: "flex items-center gap-1.5", children: [
|
|
542
|
-
/* @__PURE__ */ e("span", { className:
|
|
542
|
+
/* @__PURE__ */ e("span", { className: x, children: u }),
|
|
543
543
|
/* @__PURE__ */ e(
|
|
544
|
-
|
|
544
|
+
cn,
|
|
545
545
|
{
|
|
546
546
|
collection: r ?? s,
|
|
547
547
|
itemId: l ?? o
|
|
@@ -549,17 +549,17 @@ function mn({
|
|
|
549
549
|
)
|
|
550
550
|
] });
|
|
551
551
|
}
|
|
552
|
-
const
|
|
552
|
+
const M = n.find((u) => (typeof u == "string" ? u : u.field) === _), me = M && typeof M != "string" ? M.label : void 0, H = t.find((u) => u.field === _), G = me || (H == null ? void 0 : H.label) || _.replace(/_/g, " ").replace(/\b\w/g, (u) => u.toUpperCase());
|
|
553
553
|
if (h != null && h.has(_))
|
|
554
554
|
return /* @__PURE__ */ y("div", { className: "flex items-center gap-1.5", children: [
|
|
555
|
-
/* @__PURE__ */ e("span", { className:
|
|
556
|
-
/* @__PURE__ */ e(
|
|
555
|
+
/* @__PURE__ */ e("span", { className: x, children: G }),
|
|
556
|
+
/* @__PURE__ */ e(Ot, { className: "h-3 w-3 animate-spin text-slate-300" })
|
|
557
557
|
] });
|
|
558
|
-
if (
|
|
559
|
-
const u =
|
|
560
|
-
let
|
|
558
|
+
if ($ && _ in $) {
|
|
559
|
+
const u = g == null ? void 0 : g[_], T = (u == null ? void 0 : u.label) || G, B = $[_];
|
|
560
|
+
let I;
|
|
561
561
|
if ((u == null ? void 0 : u.agg) === "count")
|
|
562
|
-
|
|
562
|
+
I = String(B);
|
|
563
563
|
else {
|
|
564
564
|
const W = u != null && u.field_options ? (() => {
|
|
565
565
|
try {
|
|
@@ -570,33 +570,33 @@ function mn({
|
|
|
570
570
|
})() : {}, A = W.format;
|
|
571
571
|
if (A === "currency")
|
|
572
572
|
try {
|
|
573
|
-
|
|
573
|
+
I = new Intl.NumberFormat(void 0, {
|
|
574
574
|
style: "currency",
|
|
575
575
|
currency: W.currency || "USD"
|
|
576
576
|
}).format(B);
|
|
577
577
|
} catch {
|
|
578
|
-
|
|
578
|
+
I = B.toLocaleString(void 0, { maximumFractionDigits: 2 });
|
|
579
579
|
}
|
|
580
580
|
else if (A === "int")
|
|
581
|
-
|
|
581
|
+
I = new Intl.NumberFormat(void 0, { maximumFractionDigits: 0 }).format(B);
|
|
582
582
|
else if (A === "decimal") {
|
|
583
583
|
const Q = typeof W.precision == "number" ? W.precision : 2;
|
|
584
|
-
|
|
584
|
+
I = new Intl.NumberFormat(void 0, {
|
|
585
585
|
minimumFractionDigits: Q,
|
|
586
586
|
maximumFractionDigits: Q
|
|
587
587
|
}).format(B);
|
|
588
588
|
} else
|
|
589
|
-
|
|
589
|
+
I = B.toLocaleString(void 0, { maximumFractionDigits: 2 });
|
|
590
590
|
}
|
|
591
591
|
return /* @__PURE__ */ y("div", { className: R, children: [
|
|
592
|
-
/* @__PURE__ */ e("span", { className:
|
|
593
|
-
/* @__PURE__ */ e("span", { className: S, children:
|
|
592
|
+
/* @__PURE__ */ e("span", { className: x, children: T }),
|
|
593
|
+
/* @__PURE__ */ e("span", { className: S, children: I })
|
|
594
594
|
] });
|
|
595
595
|
}
|
|
596
596
|
if (d && _ in d) {
|
|
597
597
|
const u = d[_];
|
|
598
598
|
return /* @__PURE__ */ y("div", { className: R, children: [
|
|
599
|
-
/* @__PURE__ */ e("span", { className:
|
|
599
|
+
/* @__PURE__ */ e("span", { className: x, children: G }),
|
|
600
600
|
/* @__PURE__ */ y("span", { className: S, children: [
|
|
601
601
|
u,
|
|
602
602
|
" item",
|
|
@@ -607,7 +607,7 @@ function mn({
|
|
|
607
607
|
if (F && _ in F) {
|
|
608
608
|
const u = F[_];
|
|
609
609
|
return /* @__PURE__ */ y("div", { className: R, children: [
|
|
610
|
-
/* @__PURE__ */ e("span", { className:
|
|
610
|
+
/* @__PURE__ */ e("span", { className: x, children: G }),
|
|
611
611
|
/* @__PURE__ */ y("span", { className: S, children: [
|
|
612
612
|
u,
|
|
613
613
|
" row",
|
|
@@ -615,22 +615,22 @@ function mn({
|
|
|
615
615
|
] })
|
|
616
616
|
] });
|
|
617
617
|
}
|
|
618
|
-
const q = i[_],
|
|
618
|
+
const q = i[_], P = a.find(
|
|
619
619
|
(u) => u.many_collection === s && u.many_field === _ && !u.junction_field
|
|
620
620
|
);
|
|
621
|
-
if (
|
|
621
|
+
if (P != null && P.one_collection) {
|
|
622
622
|
const u = Array.isArray(q) ? q : q != null && q !== "" ? [q] : [];
|
|
623
623
|
return /* @__PURE__ */ y("div", { className: R, children: [
|
|
624
|
-
/* @__PURE__ */ e("span", { className:
|
|
625
|
-
u.length === 0 ? /* @__PURE__ */ e("span", { className:
|
|
624
|
+
/* @__PURE__ */ e("span", { className: x, children: G }),
|
|
625
|
+
u.length === 0 ? /* @__PURE__ */ e("span", { className: D, children: "—" }) : P.one_collection === "nivaro_users" ? /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1.5 gap-y-0.5", children: u.map((T) => /* @__PURE__ */ e(nt, { userId: String(T) }, String(T))) }) : /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1.5", children: u.map((T) => /* @__PURE__ */ e(re, { relCollection: P.one_collection, id: T }, String(T))) })
|
|
626
626
|
] });
|
|
627
627
|
}
|
|
628
628
|
if (Array.isArray(q)) {
|
|
629
|
-
const u = a.find((B) => B.many_field === _ && B.junction_field),
|
|
629
|
+
const u = a.find((B) => B.many_field === _ && B.junction_field), T = u == null ? void 0 : u.one_collection;
|
|
630
630
|
return /* @__PURE__ */ y("div", { className: R, children: [
|
|
631
|
-
/* @__PURE__ */ e("span", { className:
|
|
632
|
-
q.length === 0 ? /* @__PURE__ */ e("span", { className:
|
|
633
|
-
(B) =>
|
|
631
|
+
/* @__PURE__ */ e("span", { className: x, children: G }),
|
|
632
|
+
q.length === 0 ? /* @__PURE__ */ e("span", { className: D, children: "—" }) : T ? /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1.5 gap-y-0.5", children: q.map(
|
|
633
|
+
(B) => T === "nivaro_users" ? /* @__PURE__ */ e(nt, { userId: String(B) }, String(B)) : /* @__PURE__ */ e(re, { relCollection: T, id: B }, String(B))
|
|
634
634
|
) }) : /* @__PURE__ */ y("span", { className: S, children: [
|
|
635
635
|
q.length,
|
|
636
636
|
" item",
|
|
@@ -639,8 +639,8 @@ function mn({
|
|
|
639
639
|
] });
|
|
640
640
|
}
|
|
641
641
|
return /* @__PURE__ */ y("div", { className: R, children: [
|
|
642
|
-
/* @__PURE__ */ e("span", { className:
|
|
643
|
-
q == null || q === "" ? /* @__PURE__ */ e("span", { className:
|
|
642
|
+
/* @__PURE__ */ e("span", { className: x, children: G }),
|
|
643
|
+
q == null || q === "" ? /* @__PURE__ */ e("span", { className: D, children: "—" }) : /* @__PURE__ */ e("span", { className: S, children: Fe(q, H) })
|
|
644
644
|
] });
|
|
645
645
|
};
|
|
646
646
|
return /* @__PURE__ */ e(
|
|
@@ -652,7 +652,7 @@ function mn({
|
|
|
652
652
|
}
|
|
653
653
|
);
|
|
654
654
|
}
|
|
655
|
-
const
|
|
655
|
+
const Vn = Tt(function({
|
|
656
656
|
group: t,
|
|
657
657
|
fields: i,
|
|
658
658
|
draft: a,
|
|
@@ -663,33 +663,33 @@ const Gn = Ut(function({
|
|
|
663
663
|
errors: m,
|
|
664
664
|
visibleFields: d,
|
|
665
665
|
lockedFields: F,
|
|
666
|
-
layoutAiEnabled:
|
|
667
|
-
displayOnly:
|
|
666
|
+
layoutAiEnabled: $,
|
|
667
|
+
displayOnly: g,
|
|
668
668
|
renderField: h,
|
|
669
669
|
onCountChange: v,
|
|
670
670
|
isNew: O,
|
|
671
671
|
fieldValues: c,
|
|
672
|
-
isOpen:
|
|
672
|
+
isOpen: x,
|
|
673
673
|
onToggle: S,
|
|
674
|
-
summaryFields:
|
|
674
|
+
summaryFields: D,
|
|
675
675
|
m2mCounts: R,
|
|
676
676
|
o2mCounts: pe,
|
|
677
677
|
o2mAggValues: _,
|
|
678
|
-
summaryAggConfigs:
|
|
678
|
+
summaryAggConfigs: M,
|
|
679
679
|
o2mLoading: me,
|
|
680
680
|
footerSlot: H,
|
|
681
|
-
ownersCollection:
|
|
681
|
+
ownersCollection: G,
|
|
682
682
|
ownersItemId: q,
|
|
683
|
-
ownersAssignment:
|
|
683
|
+
ownersAssignment: P,
|
|
684
684
|
pdfAssignment: u,
|
|
685
|
-
pdfAttachField:
|
|
685
|
+
pdfAttachField: T,
|
|
686
686
|
pdfFilenameTemplate: B,
|
|
687
|
-
layoutId:
|
|
687
|
+
layoutId: I,
|
|
688
688
|
hideEmptySummary: W,
|
|
689
689
|
widgetAssignments: A,
|
|
690
690
|
widgetApiBase: Q,
|
|
691
691
|
fieldInlineDisplay: fe,
|
|
692
|
-
swapConfig:
|
|
692
|
+
swapConfig: L,
|
|
693
693
|
swapped: je,
|
|
694
694
|
onSwapToggle: Oe,
|
|
695
695
|
alternateFields: Z,
|
|
@@ -697,32 +697,32 @@ const Gn = Ut(function({
|
|
|
697
697
|
deferred: ie,
|
|
698
698
|
onFirstOpen: se
|
|
699
699
|
}) {
|
|
700
|
-
var
|
|
701
|
-
const [
|
|
700
|
+
var Le;
|
|
701
|
+
const [mt, ft] = Y(t.is_collapsed ?? !1), [ht, bt] = Y(!1), j = Kt(), K = (f, N) => Ht(j, f, N, { asChild: !0 }), le = (f) => ({ kind: "slot", field: f, group_key: t.key }), qe = !!(j != null && j.showHidden), [Be, Ue] = Y({}), { data: be } = Zt(r), X = (j == null ? void 0 : j.fold) ?? null, ee = (j == null ? void 0 : j.reveal) ?? null, [Te, xe] = Y(null);
|
|
702
702
|
ne(() => {
|
|
703
|
-
X &&
|
|
703
|
+
X && xe(!X.open);
|
|
704
704
|
}, [X == null ? void 0 : X.seq]), ne(() => {
|
|
705
|
-
ee &&
|
|
705
|
+
ee && Et(ee.target) === t.key && xe(!1);
|
|
706
706
|
}, [ee == null ? void 0 : ee.seq]);
|
|
707
|
-
const
|
|
707
|
+
const Ie = S !== void 0, z = Te ?? (Ie ? !x : mt);
|
|
708
708
|
ne(() => {
|
|
709
709
|
ie && !z && (se == null || se(t.key));
|
|
710
710
|
}, [ie, z, se, t.key]);
|
|
711
|
-
const
|
|
712
|
-
|
|
713
|
-
},
|
|
714
|
-
z && ye(),
|
|
715
|
-
}, gt = !
|
|
716
|
-
if (
|
|
717
|
-
const te = A ?? [],
|
|
711
|
+
const ge = Te !== null ? () => xe((f) => !f) : Ie ? S : () => ft((f) => !f), Me = !j && I != null, ye = () => {
|
|
712
|
+
Me && ot({ layoutId: Number(I), collection: r, kind: "opened", key: t.key });
|
|
713
|
+
}, xt = () => {
|
|
714
|
+
z && ye(), ge == null || ge();
|
|
715
|
+
}, gt = !g && i.some((f) => m[f.field]), Pe = j ? "always" : t.visibility_mode ?? "always";
|
|
716
|
+
if (Pe === "new_only" && !O || Pe === "existing_only" && O) return null;
|
|
717
|
+
const te = A ?? [], yt = !O && te.some((f) => f.widget_id != null && Be[f.field] === void 0);
|
|
718
718
|
let ae = !1;
|
|
719
719
|
if (t.hide_when_empty && c && !j && (ae = c.every(
|
|
720
720
|
(N) => N == null || N === "" || Array.isArray(N) && N.length === 0
|
|
721
|
-
) && !
|
|
722
|
-
const _e =
|
|
721
|
+
) && !yt && te.every((N) => !Be[N.field])), ae && te.length === 0) return null;
|
|
722
|
+
const _e = $e(null), Ne = sn(_e), Ce = un(t.icon), _t = qe ? i : i.filter((f) => !f.hidden), Ge = (Le = be == null ? void 0 : be.sections) == null ? void 0 : Le[t.key], Nt = Array.isArray(Ge) && Ge.length > 0, wt = (f) => Nt ? /* @__PURE__ */ y("div", { className: "relative", children: [
|
|
723
723
|
f,
|
|
724
724
|
/* @__PURE__ */ e("span", { className: "absolute right-[52px] top-1/2 flex -translate-y-1/2", children: /* @__PURE__ */ e(
|
|
725
|
-
|
|
725
|
+
Xt,
|
|
726
726
|
{
|
|
727
727
|
collection: r,
|
|
728
728
|
kind: "section",
|
|
@@ -738,7 +738,7 @@ const Gn = Ut(function({
|
|
|
738
738
|
"data-section-key": t.key,
|
|
739
739
|
className: E(
|
|
740
740
|
"nvr-section-enter rounded-xl border border-slate-200 bg-white dark:bg-card dark:border-border",
|
|
741
|
-
|
|
741
|
+
g && "bg-slate-50/60 dark:bg-slate-900/20",
|
|
742
742
|
ae && "hidden"
|
|
743
743
|
),
|
|
744
744
|
onPointerDownCapture: (f) => {
|
|
@@ -750,29 +750,29 @@ const Gn = Ut(function({
|
|
|
750
750
|
(p = (N = f.target) == null ? void 0 : N.closest) != null && p.call(N, "[data-usage-header]") || ye();
|
|
751
751
|
},
|
|
752
752
|
children: [
|
|
753
|
-
|
|
754
|
-
|
|
753
|
+
Me && !ae && /* @__PURE__ */ e(hn, { layoutId: Number(I), collection: r, sectionKey: t.key }),
|
|
754
|
+
wt(
|
|
755
755
|
/* @__PURE__ */ y(
|
|
756
756
|
"button",
|
|
757
757
|
{
|
|
758
758
|
type: "button",
|
|
759
759
|
"data-usage-header": "",
|
|
760
|
-
onClick:
|
|
760
|
+
onClick: xt,
|
|
761
761
|
"data-design-group-header": j ? "" : void 0,
|
|
762
762
|
className: E(
|
|
763
763
|
"flex w-full items-center gap-2 px-5 py-3 text-left hover:bg-slate-50/50 dark:hover:bg-white/[0.02] rounded-t-xl",
|
|
764
764
|
// Round the bottom only when nothing renders below the header — an
|
|
765
765
|
// expanded body (or collapsed summary strip) square-joins it, and a
|
|
766
766
|
// rounded hover overlay would leave see-through notches at the seam.
|
|
767
|
-
z && !(
|
|
767
|
+
z && !(D && D.length > 0) && "rounded-b-xl"
|
|
768
768
|
),
|
|
769
769
|
children: [
|
|
770
|
-
|
|
770
|
+
Ce && /* @__PURE__ */ e(Ce, { className: "h-3.5 w-3.5 shrink-0 text-slate-400 dark:text-slate-500" }),
|
|
771
771
|
/* @__PURE__ */ e("span", { className: "font-medium text-[13px] shrink-0 text-slate-800 dark:text-slate-200", children: t.label }),
|
|
772
772
|
/* @__PURE__ */ e("span", { className: "flex-1" }),
|
|
773
773
|
gt && /* @__PURE__ */ e("span", { className: "nvr-pop h-2 w-2 rounded-full bg-destructive shrink-0" }),
|
|
774
774
|
/* @__PURE__ */ e(
|
|
775
|
-
|
|
775
|
+
jt,
|
|
776
776
|
{
|
|
777
777
|
"data-design-pass": j ? "" : void 0,
|
|
778
778
|
className: E(
|
|
@@ -785,22 +785,22 @@ const Gn = Ut(function({
|
|
|
785
785
|
}
|
|
786
786
|
)
|
|
787
787
|
),
|
|
788
|
-
z &&
|
|
789
|
-
|
|
788
|
+
z && D && D.length > 0 && /* @__PURE__ */ e(
|
|
789
|
+
fn,
|
|
790
790
|
{
|
|
791
|
-
summaryFields:
|
|
791
|
+
summaryFields: D,
|
|
792
792
|
fields: i,
|
|
793
793
|
draft: a,
|
|
794
794
|
relations: o,
|
|
795
795
|
collection: r,
|
|
796
796
|
itemId: l,
|
|
797
|
-
ownersCollection:
|
|
797
|
+
ownersCollection: G,
|
|
798
798
|
ownersItemId: q,
|
|
799
|
-
ownersAssignment:
|
|
799
|
+
ownersAssignment: P,
|
|
800
800
|
m2mCounts: R,
|
|
801
801
|
o2mCounts: pe,
|
|
802
802
|
o2mAggValues: _,
|
|
803
|
-
summaryAggConfigs:
|
|
803
|
+
summaryAggConfigs: M,
|
|
804
804
|
o2mLoading: me,
|
|
805
805
|
hideEmpty: !!t.summary_hide_empty || !!W
|
|
806
806
|
}
|
|
@@ -825,13 +825,13 @@ const Gn = Ut(function({
|
|
|
825
825
|
"data-section-body": "",
|
|
826
826
|
className: "nvr-expand-in border-t border-slate-100 px-5 py-4 dark:border-border/60",
|
|
827
827
|
children: [
|
|
828
|
-
!
|
|
828
|
+
!g && /* @__PURE__ */ e(ln, { group: t, className: "mb-3" }),
|
|
829
829
|
(() => {
|
|
830
|
-
const f =
|
|
831
|
-
rows:
|
|
832
|
-
folded: (p) => !
|
|
830
|
+
const f = Gt(_t, {
|
|
831
|
+
rows: g ? [] : Jt(t.swap_config).rows,
|
|
832
|
+
folded: (p) => !g && Vt(p._overrides),
|
|
833
833
|
keep: (p) => !!p.required,
|
|
834
|
-
filled: (p) => !
|
|
834
|
+
filled: (p) => !Lt(a[p.field]) || !!m[p.field]
|
|
835
835
|
}), N = f.units.map(
|
|
836
836
|
(p) => p.kind === "row" ? {
|
|
837
837
|
_k: `row:${p.row.key}`,
|
|
@@ -841,11 +841,11 @@ const Gn = Ut(function({
|
|
|
841
841
|
members: p.members
|
|
842
842
|
} : { _k: p.field.field, sort: p.field.sort ?? 0, _t: "field", f: p.field }
|
|
843
843
|
);
|
|
844
|
-
|
|
844
|
+
P && N.push({
|
|
845
845
|
_k: "__owners__",
|
|
846
|
-
sort:
|
|
846
|
+
sort: P.sort,
|
|
847
847
|
_t: "owners",
|
|
848
|
-
slot:
|
|
848
|
+
slot: P
|
|
849
849
|
}), u && N.push({
|
|
850
850
|
_k: "__pdf__",
|
|
851
851
|
sort: u.sort,
|
|
@@ -854,7 +854,7 @@ const Gn = Ut(function({
|
|
|
854
854
|
});
|
|
855
855
|
for (const p of A ?? [])
|
|
856
856
|
N.push({ _k: p.field, sort: p.sort, _t: "widget", slot: p });
|
|
857
|
-
return N.sort((p, U) => p.sort - U.sort), j && N.length === 0 && f.folded.length === 0 ? /* @__PURE__ */ e(
|
|
857
|
+
return N.sort((p, U) => p.sort - U.sort), j && N.length === 0 && f.folded.length === 0 ? /* @__PURE__ */ e(zt, {}) : g ? /* @__PURE__ */ y(
|
|
858
858
|
"div",
|
|
859
859
|
{
|
|
860
860
|
ref: _e,
|
|
@@ -897,10 +897,10 @@ const Gn = Ut(function({
|
|
|
897
897
|
className: "min-w-0",
|
|
898
898
|
style: { gridColumn: `span ${Ze(U.options, Ne)}` },
|
|
899
899
|
children: [
|
|
900
|
-
/* @__PURE__ */ e("dt", { className: "text-[11px] font-medium text-slate-400 truncate", children: U.label ||
|
|
900
|
+
/* @__PURE__ */ e("dt", { className: "text-[11px] font-medium text-slate-400 truncate", children: U.label || ut(U.field) }),
|
|
901
901
|
/* @__PURE__ */ e("dd", { className: "mt-0.5 break-words", children: (b == null ? void 0 : b.one_collection) === "nivaro_users" ? (() => {
|
|
902
902
|
const k = a[U.field], V = Array.isArray(k) ? k : k != null && k !== "" ? [k] : [];
|
|
903
|
-
return V.length === 0 ? /* @__PURE__ */ e("span", { className: "text-[13px] text-slate-400", children: "—" }) : /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1.5", children: V.map((
|
|
903
|
+
return V.length === 0 ? /* @__PURE__ */ e("span", { className: "text-[13px] text-slate-400", children: "—" }) : /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1.5", children: V.map((C) => /* @__PURE__ */ e(pt, { userId: String(C) }, String(C))) });
|
|
904
904
|
})() : b != null && b.one_collection ? /* @__PURE__ */ e(re, { relCollection: b.one_collection, id: a[U.field] }) : /* @__PURE__ */ e("span", { className: "text-[13px] text-slate-700", children: Fe(a[U.field], U) }) })
|
|
905
905
|
]
|
|
906
906
|
},
|
|
@@ -915,7 +915,7 @@ const Gn = Ut(function({
|
|
|
915
915
|
var Ee, We;
|
|
916
916
|
if (b._t === "row")
|
|
917
917
|
return /* @__PURE__ */ e(
|
|
918
|
-
|
|
918
|
+
tn,
|
|
919
919
|
{
|
|
920
920
|
row: b.row,
|
|
921
921
|
members: b.members,
|
|
@@ -926,7 +926,7 @@ const Gn = Ut(function({
|
|
|
926
926
|
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
927
927
|
Se,
|
|
928
928
|
{
|
|
929
|
-
field:
|
|
929
|
+
field: nn(w),
|
|
930
930
|
draft: a,
|
|
931
931
|
onChange: s,
|
|
932
932
|
relations: o,
|
|
@@ -936,7 +936,7 @@ const Gn = Ut(function({
|
|
|
936
936
|
visible: d.has(w.field) || !d.size,
|
|
937
937
|
forceVisible: we(w) || void 0,
|
|
938
938
|
locked: F.has(w.field),
|
|
939
|
-
layoutAiEnabled:
|
|
939
|
+
layoutAiEnabled: $,
|
|
940
940
|
renderField: h,
|
|
941
941
|
onCountChange: v
|
|
942
942
|
}
|
|
@@ -960,17 +960,17 @@ const Gn = Ut(function({
|
|
|
960
960
|
);
|
|
961
961
|
}
|
|
962
962
|
if (b._t === "pdf") {
|
|
963
|
-
if (!
|
|
963
|
+
if (!I) return null;
|
|
964
964
|
const w = b.slot.col_span ?? 12, J = ((Ee = b.slot.label_override) == null ? void 0 : Ee.trim()) || "Generate PDF";
|
|
965
965
|
return K(
|
|
966
966
|
le("__pdf__"),
|
|
967
967
|
/* @__PURE__ */ e("div", { style: { gridColumn: `span ${w}` }, children: /* @__PURE__ */ e(
|
|
968
|
-
|
|
968
|
+
pn,
|
|
969
969
|
{
|
|
970
970
|
collection: r,
|
|
971
971
|
itemId: l,
|
|
972
|
-
layoutId:
|
|
973
|
-
attachField:
|
|
972
|
+
layoutId: I,
|
|
973
|
+
attachField: T ?? null,
|
|
974
974
|
filenameTemplate: B,
|
|
975
975
|
label: J
|
|
976
976
|
}
|
|
@@ -999,22 +999,22 @@ const Gn = Ut(function({
|
|
|
999
999
|
) }, b.slot.field)
|
|
1000
1000
|
);
|
|
1001
1001
|
}
|
|
1002
|
-
const k = b.f, V = fe == null ? void 0 : fe[k.field],
|
|
1002
|
+
const k = b.f, V = fe == null ? void 0 : fe[k.field], C = V == null ? void 0 : V.entries, vt = (V == null ? void 0 : V.separator) ?? null, oe = a[k.field], Ve = oe != null && oe !== "", Je = C != null && C.length && Ve ? ((We = o.find(
|
|
1003
1003
|
(w) => w.many_collection === r && w.many_field === k.field && !w.junction_field
|
|
1004
|
-
)) == null ? void 0 : We.one_collection) ?? null : null, Re = (
|
|
1005
|
-
const w = a[(
|
|
1004
|
+
)) == null ? void 0 : We.one_collection) ?? null : null, Re = (L == null ? void 0 : L.enabled) && k.field === L.primary_field, ze = (() => {
|
|
1005
|
+
const w = a[(L == null ? void 0 : L.primary_field) ?? ""];
|
|
1006
1006
|
return w != null && w !== "";
|
|
1007
1007
|
})(), He = (Z ?? []).some((w) => {
|
|
1008
1008
|
const J = a[w.field];
|
|
1009
1009
|
return J != null && J !== "";
|
|
1010
|
-
}),
|
|
1010
|
+
}), kt = Re && Oe ? /* @__PURE__ */ y("span", { className: "inline-flex items-center gap-1.5", children: [
|
|
1011
1011
|
/* @__PURE__ */ e(
|
|
1012
1012
|
"button",
|
|
1013
1013
|
{
|
|
1014
1014
|
type: "button",
|
|
1015
1015
|
onClick: Oe,
|
|
1016
1016
|
className: "inline-flex items-center rounded px-1.5 py-0.5 text-[10px] font-medium text-nvr-cyan hover:bg-nvr-cyan/10 transition-colors",
|
|
1017
|
-
children: je ?
|
|
1017
|
+
children: je ? L.back_label ?? "Back" : L.toggle_label ?? "Enter manually"
|
|
1018
1018
|
}
|
|
1019
1019
|
),
|
|
1020
1020
|
/* @__PURE__ */ y(
|
|
@@ -1061,7 +1061,7 @@ const Gn = Ut(function({
|
|
|
1061
1061
|
]
|
|
1062
1062
|
}
|
|
1063
1063
|
)
|
|
1064
|
-
] }) : void 0,
|
|
1064
|
+
] }) : void 0, St = Re && je && (Z != null && Z.length) ? /* @__PURE__ */ e("div", { className: "mt-2 rounded-lg border border-slate-200 bg-slate-50 dark:border-border dark:bg-slate-900/40 p-3", children: /* @__PURE__ */ e("div", { className: "grid grid-cols-2 gap-3", children: Z.map((w) => {
|
|
1065
1065
|
const J = (he == null ? void 0 : he[w.field]) ?? 2;
|
|
1066
1066
|
return /* @__PURE__ */ e("div", { style: { gridColumn: `span ${J}` }, children: /* @__PURE__ */ e(
|
|
1067
1067
|
Se,
|
|
@@ -1076,7 +1076,7 @@ const Gn = Ut(function({
|
|
|
1076
1076
|
visible: !0,
|
|
1077
1077
|
forceVisible: !0,
|
|
1078
1078
|
locked: F.has(w.field),
|
|
1079
|
-
layoutAiEnabled:
|
|
1079
|
+
layoutAiEnabled: $,
|
|
1080
1080
|
renderField: h,
|
|
1081
1081
|
onCountChange: v
|
|
1082
1082
|
}
|
|
@@ -1094,11 +1094,11 @@ const Gn = Ut(function({
|
|
|
1094
1094
|
visible: d.has(k.field) || !d.size,
|
|
1095
1095
|
forceVisible: we(k) || void 0,
|
|
1096
1096
|
locked: F.has(k.field),
|
|
1097
|
-
layoutAiEnabled:
|
|
1097
|
+
layoutAiEnabled: $,
|
|
1098
1098
|
renderField: h,
|
|
1099
1099
|
onCountChange: v,
|
|
1100
|
-
swapButton:
|
|
1101
|
-
swapContent:
|
|
1100
|
+
swapButton: kt,
|
|
1101
|
+
swapContent: St
|
|
1102
1102
|
}
|
|
1103
1103
|
);
|
|
1104
1104
|
return K(
|
|
@@ -1109,13 +1109,13 @@ const Gn = Ut(function({
|
|
|
1109
1109
|
style: { gridColumn: `span ${Ze(k.options, Ne)}` },
|
|
1110
1110
|
children: [
|
|
1111
1111
|
we(k) ? /* @__PURE__ */ e("div", { "data-design-hidden": "", className: "opacity-40", children: Ke }) : Ke,
|
|
1112
|
-
(
|
|
1113
|
-
|
|
1112
|
+
(C == null ? void 0 : C.length) && Ve && Je && /* @__PURE__ */ e(
|
|
1113
|
+
dn,
|
|
1114
1114
|
{
|
|
1115
1115
|
relCollection: Je,
|
|
1116
1116
|
relId: oe,
|
|
1117
|
-
entries:
|
|
1118
|
-
separator:
|
|
1117
|
+
entries: C,
|
|
1118
|
+
separator: vt
|
|
1119
1119
|
}
|
|
1120
1120
|
)
|
|
1121
1121
|
]
|
|
@@ -1129,7 +1129,7 @@ const Gn = Ut(function({
|
|
|
1129
1129
|
_t: "field",
|
|
1130
1130
|
f: b
|
|
1131
1131
|
}));
|
|
1132
|
-
return /* @__PURE__ */ y(
|
|
1132
|
+
return /* @__PURE__ */ y($t, { children: [
|
|
1133
1133
|
/* @__PURE__ */ y(
|
|
1134
1134
|
"div",
|
|
1135
1135
|
{
|
|
@@ -1143,13 +1143,13 @@ const Gn = Ut(function({
|
|
|
1143
1143
|
}
|
|
1144
1144
|
),
|
|
1145
1145
|
/* @__PURE__ */ e(
|
|
1146
|
-
|
|
1146
|
+
en,
|
|
1147
1147
|
{
|
|
1148
1148
|
count: U.length,
|
|
1149
|
-
open:
|
|
1149
|
+
open: ht,
|
|
1150
1150
|
forcedOpen: f.forcedOpen,
|
|
1151
1151
|
design: !!j,
|
|
1152
|
-
onToggle: () =>
|
|
1152
|
+
onToggle: () => bt((b) => !b),
|
|
1153
1153
|
children: /* @__PURE__ */ y(
|
|
1154
1154
|
"div",
|
|
1155
1155
|
{
|
|
@@ -1173,8 +1173,8 @@ const Gn = Ut(function({
|
|
|
1173
1173
|
]
|
|
1174
1174
|
}
|
|
1175
1175
|
);
|
|
1176
|
-
},
|
|
1177
|
-
function
|
|
1176
|
+
}, on);
|
|
1177
|
+
function hn({
|
|
1178
1178
|
layoutId: n,
|
|
1179
1179
|
collection: t,
|
|
1180
1180
|
sectionKey: i
|
|
@@ -1184,14 +1184,14 @@ function fn({
|
|
|
1184
1184
|
}, [n, t, i]), null;
|
|
1185
1185
|
}
|
|
1186
1186
|
export {
|
|
1187
|
-
|
|
1188
|
-
|
|
1187
|
+
Vn as GroupSection,
|
|
1188
|
+
dn as InlineDisplay,
|
|
1189
1189
|
Xe as OwnersInline,
|
|
1190
|
-
|
|
1190
|
+
cn as OwnersInlineCompact,
|
|
1191
1191
|
re as RelationCell,
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1192
|
+
Ln as StripFieldValue,
|
|
1193
|
+
pt as UserChip,
|
|
1194
|
+
zn as UserRosterCluster,
|
|
1195
1195
|
Fe as formatDisplayValue,
|
|
1196
|
-
|
|
1196
|
+
mn as useChangePulse
|
|
1197
1197
|
};
|