@nivaro/react 0.3.10 → 0.3.12
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/useNivaroForm.js +1 -1
- package/dist/hooks/useSessionRecorder.js +109 -102
- package/dist/index.d.ts +34 -3
- package/dist/shared/components/CollectionBrowserView.js +1546 -1477
- package/dist/shared/components/ItemEditForm.js +4332 -4195
- package/dist/shared/components/PageRenderer.js +512 -465
- package/dist/shared/components/ProfileView.js +115 -109
- package/dist/shared/components/QueryStatStrip.js +74 -70
- package/dist/shared/components/ReportView.js +818 -827
- package/dist/shared/components/SheetHeaderBody.js +16 -14
- package/dist/shared/components/chat/ChatPanel.js +492 -472
- package/dist/shared/components/item-edit/CatalogPickerField.js +1029 -933
- package/dist/shared/components/item-edit/FieldRenderer.js +161 -156
- package/dist/shared/components/item-edit/FieldRow.js +20 -19
- package/dist/shared/components/item-edit/FilePickerField.js +52 -40
- package/dist/shared/components/item-edit/GroupSection.js +221 -221
- package/dist/shared/components/item-edit/InlineGridField.js +41 -41
- package/dist/shared/components/item-edit/InlineTableField.js +2249 -2238
- package/dist/shared/components/item-edit/M2MCombobox.js +46 -44
- package/dist/shared/components/item-edit/NestedRelationEditor.js +11 -11
- package/dist/shared/components/item-edit/QuickPicker.js +263 -216
- package/dist/shared/components/item-edit/RelationCombobox.js +285 -245
- package/dist/shared/components/item-edit/RichTextEditorImpl.js +42 -32
- package/dist/shared/components/item-edit/RowHistorySheet.js +130 -134
- package/dist/shared/components/item-edit/SummaryPanel.js +305 -279
- package/dist/shared/components/item-edit/UserChip.js +301 -233
- package/dist/shared/components/item-edit/helpers.js +133 -134
- package/dist/shared/components/item-edit/line-qty.js +57 -0
- package/dist/shared/components/item-edit/option-disambiguate.js +53 -0
- package/dist/shared/components/panels/AddendumLinesDiff.js +87 -90
- package/dist/shared/components/panels/CommentPanel.js +350 -315
- package/dist/shared/components/panels/ItemLockBanner.js +297 -230
- package/dist/shared/components/panels/PipelinePanel.js +719 -701
- package/dist/shared/components/profile/PersonAdminTools.js +168 -144
- package/dist/shared/components/profile/PersonProfile.js +42 -41
- package/dist/shared/components/profile/session-actions.js +52 -0
- package/dist/shared/components/queue/QueueQuickFilters.js +43 -41
- package/dist/shared/components/queue/QueueWorklist.js +1005 -935
- package/dist/shared/components/widgets/ReviewListWidget.js +99 -93
- package/dist/shared/lib/obligation-banner.js +14 -13
- package/dist/shared/lib/obligation-reason-text.js +13 -0
- package/dist/shared/lib/query-filter-seed.js +34 -11
- package/dist/shared/lib/replay-checkout.js +20 -0
- package/dist/shared/lib/sanitize-html.js +24 -15
- package/dist/shared/lib/sheet-def.js +38 -22
- package/dist/shared/lib/unique-options.js +10 -0
- package/dist/shared/lib/utils.js +57 -43
- package/dist/shared/lib/validation-rules.js +58 -34
- package/package.json +1 -1
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { jsx as e, jsxs as x, Fragment as
|
|
2
|
-
import { useQuery as de, useQueryClient as
|
|
3
|
-
import * as
|
|
4
|
-
import { ChevronDown as St, Loader2 as
|
|
5
|
-
import
|
|
6
|
-
import { fieldDrilldownConfig as
|
|
7
|
-
import { get as
|
|
8
|
-
import { planFieldGrid as
|
|
9
|
-
import { reportSectionUse as
|
|
10
|
-
import { useRecordReader as
|
|
11
|
-
import { choiceLabel as
|
|
12
|
-
import { DesignDropZone as
|
|
13
|
-
import { useLayoutDesign as
|
|
1
|
+
import { jsx as e, jsxs as x, Fragment as wt } from "react/jsx-runtime";
|
|
2
|
+
import { useQuery as de, useQueryClient as vt } from "@tanstack/react-query";
|
|
3
|
+
import * as kt from "lucide-react";
|
|
4
|
+
import { ChevronDown as St, Loader2 as Dt, User as $t, Mail as Ft } from "lucide-react";
|
|
5
|
+
import rt, { useState as Q, useRef as ke, useEffect as ne } from "react";
|
|
6
|
+
import { fieldDrilldownConfig as jt, useDrilldown as Ot, useOptionalNivaroClient as ue, useNavigation as qt } from "../../context.js";
|
|
7
|
+
import { get as it, post as Bt } from "../../lib/commands.js";
|
|
8
|
+
import { planFieldGrid as Lt, isEmptyValue as Ut, isFolded as Tt, readGroupStructure as It } from "../../lib/form-structure.js";
|
|
9
|
+
import { reportSectionUse as st } from "../../lib/form-usage-beacon.js";
|
|
10
|
+
import { useRecordReader as lt } from "../../lib/record-loader.js";
|
|
11
|
+
import { choiceLabel as Mt, titleCase as at, cn as W, toLocalDateString as Se } from "../../lib/utils.js";
|
|
12
|
+
import { DesignDropZone as Gt, designWrap as Vt } from "../layout-editor/DesignNode.js";
|
|
13
|
+
import { useLayoutDesign as Pt, revealGroupKey as Ct } from "../layout-editor/design-context.js";
|
|
14
14
|
import { GridGuides as we } from "../layout-editor/grid-guides.js";
|
|
15
|
-
import { UserAvatar as
|
|
16
|
-
import { DropdownMenu as
|
|
17
|
-
import { WidgetSlot as
|
|
15
|
+
import { UserAvatar as Jt } from "../UserAvatar.js";
|
|
16
|
+
import { DropdownMenu as Rt, DropdownMenuTrigger as zt, DropdownMenuContent as Kt, DropdownMenuItem as Ae } from "../ui/dropdown-menu.js";
|
|
17
|
+
import { WidgetSlot as Ee } from "../WidgetSlot.js";
|
|
18
18
|
import { FieldRow as ve } from "./FieldRow.js";
|
|
19
|
-
import { FoldArea as
|
|
20
|
-
import { useFormHelpVideos as
|
|
21
|
-
import { applyDisplayTemplate as
|
|
22
|
-
import { SectionIntro as
|
|
23
|
-
import { UserChip as
|
|
24
|
-
import { UserRosterCluster as
|
|
25
|
-
function
|
|
19
|
+
import { FoldArea as Ht, RowGroupCell as Wt, rowMemberField as At } from "./form-structure-ui.js";
|
|
20
|
+
import { useFormHelpVideos as Et, FormHelpVideoButton as Yt } from "./FormHelpVideoButton.js";
|
|
21
|
+
import { applyDisplayTemplate as Qt, useContainerWidth as Zt, resolveColSpan as Ye } from "./helpers.js";
|
|
22
|
+
import { SectionIntro as Xt } from "./LayoutContentBlock.js";
|
|
23
|
+
import { UserChip as ot, OwnersInline as Qe, OwnersInlineCompact as en } from "./UserChip.js";
|
|
24
|
+
import { UserRosterCluster as Un } from "./UserChip.js";
|
|
25
|
+
function Ze(t) {
|
|
26
26
|
if (typeof t != "string") return t ?? [];
|
|
27
27
|
try {
|
|
28
28
|
return JSON.parse(t);
|
|
@@ -30,20 +30,20 @@ function Qe(t) {
|
|
|
30
30
|
return [];
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function tn({
|
|
34
34
|
relCollection: t,
|
|
35
35
|
relId: r,
|
|
36
36
|
entries: i,
|
|
37
37
|
separator: u
|
|
38
38
|
}) {
|
|
39
|
-
const s = ue(), l =
|
|
39
|
+
const s = ue(), l = lt(), n = String(r), m = i.some((g) => g.field.includes(".")) ? ["id", ...i.map((g) => g.field)].join(",") : null, { data: h } = de({
|
|
40
40
|
queryKey: ["inline-display", t, n, m],
|
|
41
41
|
queryFn: () => l(t, n, m),
|
|
42
42
|
enabled: !!s && !!n,
|
|
43
43
|
staleTime: 6e4
|
|
44
44
|
});
|
|
45
45
|
if (!h) return null;
|
|
46
|
-
const
|
|
46
|
+
const S = (g) => {
|
|
47
47
|
let f = h;
|
|
48
48
|
for (const y of g.split(".")) {
|
|
49
49
|
if (f == null || typeof f != "object") return;
|
|
@@ -52,33 +52,33 @@ function en({
|
|
|
52
52
|
return f;
|
|
53
53
|
};
|
|
54
54
|
if (u != null) {
|
|
55
|
-
const g = (
|
|
56
|
-
const
|
|
57
|
-
if (
|
|
58
|
-
const D =
|
|
55
|
+
const g = (O) => {
|
|
56
|
+
const k = S(O.field);
|
|
57
|
+
if (k == null || k === "") return null;
|
|
58
|
+
const D = O.format ?? "text";
|
|
59
59
|
if (D === "date" || D === "datetime")
|
|
60
60
|
try {
|
|
61
|
-
return
|
|
61
|
+
return Se(k);
|
|
62
62
|
} catch {
|
|
63
|
-
return String(
|
|
63
|
+
return String(k);
|
|
64
64
|
}
|
|
65
|
-
return D === "boolean" ?
|
|
65
|
+
return D === "boolean" ? k ? "Yes" : "No" : String(k);
|
|
66
66
|
}, f = [];
|
|
67
67
|
let y = [];
|
|
68
|
-
for (const
|
|
69
|
-
|
|
68
|
+
for (const O of i)
|
|
69
|
+
O.line_break && y.length > 0 ? (f.push(y), y = [O]) : y.push(O);
|
|
70
70
|
y.length > 0 && f.push(y);
|
|
71
|
-
const
|
|
72
|
-
(
|
|
73
|
-
const D = g(
|
|
74
|
-
return D ? { label:
|
|
71
|
+
const B = f.map(
|
|
72
|
+
(O) => O.map((k) => {
|
|
73
|
+
const D = g(k);
|
|
74
|
+
return D ? { label: k.label ?? null, display: D } : null;
|
|
75
75
|
}).filter(Boolean)
|
|
76
|
-
).filter((
|
|
77
|
-
return
|
|
76
|
+
).filter((O) => O.length > 0);
|
|
77
|
+
return B.length === 0 ? null : /* @__PURE__ */ e("div", { className: "mt-1", children: B.map((O, k) => (
|
|
78
78
|
// biome-ignore lint/suspicious/noArrayIndexKey: stable line order
|
|
79
|
-
/* @__PURE__ */ e("p", { className: "text-[12px] text-slate-500 dark:text-slate-400", children:
|
|
79
|
+
/* @__PURE__ */ e("p", { className: "text-[12px] text-slate-500 dark:text-slate-400", children: O.map((D, J) => (
|
|
80
80
|
// biome-ignore lint/suspicious/noArrayIndexKey: stable token order
|
|
81
|
-
/* @__PURE__ */ x(
|
|
81
|
+
/* @__PURE__ */ x(rt.Fragment, { children: [
|
|
82
82
|
J > 0 && u,
|
|
83
83
|
D.label && /* @__PURE__ */ x("span", { className: "font-semibold text-slate-600 dark:text-slate-300", children: [
|
|
84
84
|
D.label,
|
|
@@ -87,22 +87,22 @@ function en({
|
|
|
87
87
|
D.label ? " " : "",
|
|
88
88
|
D.display
|
|
89
89
|
] }, J)
|
|
90
|
-
)) },
|
|
90
|
+
)) }, k)
|
|
91
91
|
)) });
|
|
92
92
|
}
|
|
93
93
|
const o = i.map((g) => {
|
|
94
|
-
const f =
|
|
94
|
+
const f = S(g.field);
|
|
95
95
|
if (f == null || f === "") return null;
|
|
96
96
|
const y = g.format ?? "text";
|
|
97
|
-
let
|
|
97
|
+
let B;
|
|
98
98
|
if (y === "date" || y === "datetime")
|
|
99
99
|
try {
|
|
100
|
-
|
|
100
|
+
B = Se(f);
|
|
101
101
|
} catch {
|
|
102
|
-
|
|
102
|
+
B = String(f);
|
|
103
103
|
}
|
|
104
|
-
else y === "boolean" ?
|
|
105
|
-
return { label: g.label, display:
|
|
104
|
+
else y === "boolean" ? B = f ? "Yes" : "No" : B = String(f);
|
|
105
|
+
return { label: g.label, display: B };
|
|
106
106
|
}).filter(Boolean);
|
|
107
107
|
return o.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: o.map((g, f) => (
|
|
108
108
|
// biome-ignore lint/suspicious/noArrayIndexKey: stable order from config
|
|
@@ -112,12 +112,12 @@ function en({
|
|
|
112
112
|
] }, f)
|
|
113
113
|
)) });
|
|
114
114
|
}
|
|
115
|
-
function
|
|
115
|
+
function nn(t) {
|
|
116
116
|
if (!t) return null;
|
|
117
|
-
const r = t.replace(/(^|-)([a-z])/g, (u, s, l) => l.toUpperCase()), i =
|
|
117
|
+
const r = t.replace(/(^|-)([a-z])/g, (u, s, l) => l.toUpperCase()), i = kt[r];
|
|
118
118
|
return i || null;
|
|
119
119
|
}
|
|
120
|
-
function
|
|
120
|
+
function Xe(t) {
|
|
121
121
|
if (!t.options) return {};
|
|
122
122
|
if (typeof t.options == "object") return t.options;
|
|
123
123
|
try {
|
|
@@ -126,7 +126,7 @@ function Ze(t) {
|
|
|
126
126
|
return {};
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
|
-
function
|
|
129
|
+
function De(t, r) {
|
|
130
130
|
if (t == null || t === "") return "—";
|
|
131
131
|
if (typeof t == "boolean") return t ? "Yes" : "No";
|
|
132
132
|
const i = (r == null ? void 0 : r.interface) ?? "", u = (() => {
|
|
@@ -195,15 +195,15 @@ function ke(t, r) {
|
|
|
195
195
|
} catch {
|
|
196
196
|
}
|
|
197
197
|
if ((i === "select-dropdown" || i === "radio-buttons") && r) {
|
|
198
|
-
const a =
|
|
198
|
+
const a = Xe(r).choices;
|
|
199
199
|
if (Array.isArray(a)) {
|
|
200
200
|
const m = a.find((h) => String(h.value) === s);
|
|
201
|
-
if (m) return
|
|
201
|
+
if (m) return Mt(m.text);
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
204
|
const l = Number(s);
|
|
205
205
|
if (!Number.isNaN(l) && s !== "" && r) {
|
|
206
|
-
const n =
|
|
206
|
+
const n = Xe(r), a = n.format, m = typeof n.unit == "string" ? n.unit.trim() : "";
|
|
207
207
|
if (m && !a) {
|
|
208
208
|
const h = new Intl.NumberFormat(void 0, { maximumFractionDigits: 2 }).format(l);
|
|
209
209
|
if (m === "$")
|
|
@@ -234,21 +234,21 @@ function ke(t, r) {
|
|
|
234
234
|
}).format(l);
|
|
235
235
|
}
|
|
236
236
|
}
|
|
237
|
-
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)) ?
|
|
237
|
+
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)) ? at(s) : s;
|
|
238
238
|
}
|
|
239
|
-
function
|
|
240
|
-
const r = ue(), { navigate: i, userUrl: u } =
|
|
239
|
+
function et({ userId: t }) {
|
|
240
|
+
const r = ue(), { navigate: i, userUrl: u } = qt(), s = u ? u(t) : `/users/${t}`, { data: l } = de({
|
|
241
241
|
queryKey: ["user-chip", t],
|
|
242
242
|
queryFn: () => r.request(
|
|
243
|
-
|
|
243
|
+
it(`/users/${t}`)
|
|
244
244
|
).then((m) => m.data ?? null),
|
|
245
245
|
enabled: !!r && !!t,
|
|
246
246
|
staleTime: 12e4
|
|
247
247
|
}), n = l ? [l.first_name, l.last_name].filter(Boolean).join(" ") || l.email : t, a = n.split(" ").map((m) => m[0]).filter(Boolean).slice(0, 2).join("").toUpperCase();
|
|
248
|
-
return /* @__PURE__ */ x(
|
|
249
|
-
/* @__PURE__ */ e(
|
|
248
|
+
return /* @__PURE__ */ x(Rt, { children: [
|
|
249
|
+
/* @__PURE__ */ e(zt, { asChild: !0, children: /* @__PURE__ */ x("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: [
|
|
250
250
|
/* @__PURE__ */ e(
|
|
251
|
-
|
|
251
|
+
Jt,
|
|
252
252
|
{
|
|
253
253
|
userId: t,
|
|
254
254
|
className: "h-4 w-4",
|
|
@@ -257,27 +257,27 @@ function Xe({ userId: t }) {
|
|
|
257
257
|
),
|
|
258
258
|
/* @__PURE__ */ e("span", { className: "text-[11px] text-slate-600", children: n })
|
|
259
259
|
] }) }),
|
|
260
|
-
/* @__PURE__ */ x(
|
|
260
|
+
/* @__PURE__ */ x(Kt, { align: "start", className: "text-[12px]", children: [
|
|
261
261
|
s && /* @__PURE__ */ x(
|
|
262
|
-
|
|
262
|
+
Ae,
|
|
263
263
|
{
|
|
264
264
|
className: "gap-2 text-[12px] cursor-pointer",
|
|
265
265
|
onSelect: () => i(s),
|
|
266
266
|
children: [
|
|
267
|
-
/* @__PURE__ */ e(
|
|
267
|
+
/* @__PURE__ */ e($t, { className: "h-3.5 w-3.5" }),
|
|
268
268
|
" View profile"
|
|
269
269
|
]
|
|
270
270
|
}
|
|
271
271
|
),
|
|
272
272
|
(l == null ? void 0 : l.email) && /* @__PURE__ */ x(
|
|
273
|
-
|
|
273
|
+
Ae,
|
|
274
274
|
{
|
|
275
275
|
className: "gap-2 text-[12px] cursor-pointer",
|
|
276
276
|
onSelect: () => {
|
|
277
277
|
window.location.href = `mailto:${l.email}`;
|
|
278
278
|
},
|
|
279
279
|
children: [
|
|
280
|
-
/* @__PURE__ */ e(
|
|
280
|
+
/* @__PURE__ */ e(Ft, { className: "h-3.5 w-3.5" }),
|
|
281
281
|
" Send email"
|
|
282
282
|
]
|
|
283
283
|
}
|
|
@@ -285,7 +285,7 @@ function Xe({ userId: t }) {
|
|
|
285
285
|
] })
|
|
286
286
|
] });
|
|
287
287
|
}
|
|
288
|
-
function
|
|
288
|
+
function rn({
|
|
289
289
|
collection: t,
|
|
290
290
|
itemId: r,
|
|
291
291
|
layoutId: i,
|
|
@@ -293,12 +293,12 @@ function nn({
|
|
|
293
293
|
filenameTemplate: s,
|
|
294
294
|
label: l
|
|
295
295
|
}) {
|
|
296
|
-
const n = ue(), a =
|
|
296
|
+
const n = ue(), a = vt(), [m, h] = Q(!1), S = async () => {
|
|
297
297
|
if (!(!n || m || !u)) {
|
|
298
298
|
h(!0);
|
|
299
299
|
try {
|
|
300
300
|
await n.request(
|
|
301
|
-
|
|
301
|
+
Bt(`/collection-layouts/${i}/generate-and-attach`, {
|
|
302
302
|
collection: t,
|
|
303
303
|
item_id: r,
|
|
304
304
|
attach_field: u,
|
|
@@ -315,7 +315,7 @@ function nn({
|
|
|
315
315
|
"button",
|
|
316
316
|
{
|
|
317
317
|
type: "button",
|
|
318
|
-
onClick:
|
|
318
|
+
onClick: S,
|
|
319
319
|
disabled: m || o,
|
|
320
320
|
title: o ? "Configure PDF field in Data Model → Layouts" : void 0,
|
|
321
321
|
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",
|
|
@@ -348,36 +348,36 @@ function re({
|
|
|
348
348
|
className: i
|
|
349
349
|
}) {
|
|
350
350
|
var f;
|
|
351
|
-
const u = ue(), s =
|
|
351
|
+
const u = ue(), s = lt(), l = r != null && r !== "" ? String(r) : null, { data: n } = de({
|
|
352
352
|
queryKey: ["col-meta-dt", t],
|
|
353
353
|
queryFn: () => u.request(
|
|
354
|
-
|
|
354
|
+
it(`/collections/${t}`)
|
|
355
355
|
).then((y) => y.data).catch(() => ({})),
|
|
356
356
|
enabled: !!u && !!l,
|
|
357
357
|
staleTime: 3e5
|
|
358
|
-
}), a = (((f = n == null ? void 0 : n.display_template) == null ? void 0 : f.match(/\{\{\s*[^}]+?\s*\}\}/g)) ?? []).map((y) => y.replace(/[{}\s]/g, "")).filter((y) => y.includes(".")), m = a.length ? ["id", ...a].join(",") : null, { data: h, isLoading:
|
|
358
|
+
}), a = (((f = n == null ? void 0 : n.display_template) == null ? void 0 : f.match(/\{\{\s*[^}]+?\s*\}\}/g)) ?? []).map((y) => y.replace(/[{}\s]/g, "")).filter((y) => y.includes(".")), m = a.length ? ["id", ...a].join(",") : null, { data: h, isLoading: S } = de({
|
|
359
359
|
queryKey: ["rel-display", t, l, m],
|
|
360
360
|
queryFn: () => s(t, l, m),
|
|
361
361
|
enabled: !!u && !!l && n !== void 0,
|
|
362
362
|
staleTime: 6e4
|
|
363
363
|
});
|
|
364
364
|
if (!l) return /* @__PURE__ */ e("span", { children: "—" });
|
|
365
|
-
if (
|
|
365
|
+
if (S || u && n === void 0)
|
|
366
366
|
return /* @__PURE__ */ e("span", { className: "animate-pulse h-3 w-20 rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))] inline-block" });
|
|
367
367
|
const o = i ?? "text-[13px] text-slate-700";
|
|
368
368
|
if (!h) return /* @__PURE__ */ e("span", { className: o, children: l });
|
|
369
|
-
const g = n != null && n.display_template ?
|
|
369
|
+
const g = n != null && n.display_template ? Qt(n.display_template, h) : String(h.name ?? h.title ?? h.label ?? h.display_name ?? l);
|
|
370
370
|
return /* @__PURE__ */ e("span", { className: o, children: g });
|
|
371
371
|
}
|
|
372
|
-
function
|
|
373
|
-
return /* @__PURE__ */ e(
|
|
372
|
+
function tt({ userId: t }) {
|
|
373
|
+
return /* @__PURE__ */ e(ot, { userId: t, size: "compact" });
|
|
374
374
|
}
|
|
375
|
-
function
|
|
375
|
+
function nt({
|
|
376
376
|
relCollection: t,
|
|
377
377
|
id: r,
|
|
378
378
|
drillConfig: i
|
|
379
379
|
}) {
|
|
380
|
-
const u =
|
|
380
|
+
const u = Ot(), s = /* @__PURE__ */ e(re, { relCollection: t, id: r });
|
|
381
381
|
return !u || r == null || r === "" ? s : /* @__PURE__ */ e(
|
|
382
382
|
"button",
|
|
383
383
|
{
|
|
@@ -404,8 +404,8 @@ function tt({
|
|
|
404
404
|
}
|
|
405
405
|
);
|
|
406
406
|
}
|
|
407
|
-
function
|
|
408
|
-
const [r, i] = Q(!1), u =
|
|
407
|
+
function sn(t) {
|
|
408
|
+
const [r, i] = Q(!1), u = ke(!0), s = ke(JSON.stringify(t ?? null));
|
|
409
409
|
return ne(() => {
|
|
410
410
|
const l = JSON.stringify(t ?? null);
|
|
411
411
|
if (u.current) {
|
|
@@ -420,7 +420,7 @@ function rn(t) {
|
|
|
420
420
|
};
|
|
421
421
|
}, [t]), r ? "nvr-value-pulse" : "";
|
|
422
422
|
}
|
|
423
|
-
function
|
|
423
|
+
function On({
|
|
424
424
|
field: t,
|
|
425
425
|
val: r,
|
|
426
426
|
relations: i,
|
|
@@ -428,15 +428,15 @@ function jn({
|
|
|
428
428
|
displayFormat: s,
|
|
429
429
|
textClassName: l
|
|
430
430
|
}) {
|
|
431
|
-
const n =
|
|
431
|
+
const n = sn(r), a = W(l ?? "text-[13px] text-slate-900 dark:text-slate-100", n), m = jt(t) ?? { enabled: !0, layout_id: null, width: null }, h = i.find(
|
|
432
432
|
(o) => o.one_collection === u && o.one_field === t.field && o.junction_field
|
|
433
433
|
);
|
|
434
434
|
if (h) {
|
|
435
435
|
const o = i.find(
|
|
436
436
|
(y) => y.many_collection === h.many_collection && y.many_field === h.junction_field
|
|
437
437
|
), g = o == null ? void 0 : o.one_collection, f = Array.isArray(r) ? r : r != null && r !== "" ? [r] : [];
|
|
438
|
-
return !g || f.length === 0 ? /* @__PURE__ */ e("span", { className: "text-slate-300 dark:text-slate-600", children: "—" }) : g === "nivaro_users" ? /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1 gap-y-0.5", children: f.map((y) => /* @__PURE__ */ e(
|
|
439
|
-
|
|
438
|
+
return !g || f.length === 0 ? /* @__PURE__ */ e("span", { className: "text-slate-300 dark:text-slate-600", children: "—" }) : g === "nivaro_users" ? /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1 gap-y-0.5", children: f.map((y) => /* @__PURE__ */ e(tt, { userId: String(y) }, String(y))) }) : /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1.5", children: f.map((y) => /* @__PURE__ */ e(
|
|
439
|
+
nt,
|
|
440
440
|
{
|
|
441
441
|
relCollection: g,
|
|
442
442
|
id: y,
|
|
@@ -445,15 +445,15 @@ function jn({
|
|
|
445
445
|
String(y)
|
|
446
446
|
)) });
|
|
447
447
|
}
|
|
448
|
-
const
|
|
448
|
+
const S = i.find(
|
|
449
449
|
(o) => o.many_collection === u && o.many_field === t.field && !o.junction_field
|
|
450
450
|
);
|
|
451
|
-
if (
|
|
451
|
+
if (S != null && S.one_collection) {
|
|
452
452
|
const o = Array.isArray(r) ? r : r != null && r !== "" ? [r] : [];
|
|
453
|
-
return o.length === 0 ? /* @__PURE__ */ e("span", { className: "text-slate-300 dark:text-slate-600", children: "—" }) :
|
|
454
|
-
|
|
453
|
+
return o.length === 0 ? /* @__PURE__ */ e("span", { className: "text-slate-300 dark:text-slate-600", children: "—" }) : S.one_collection === "nivaro_users" ? /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1 gap-y-0.5", children: o.map((g) => /* @__PURE__ */ e(tt, { userId: String(g) }, String(g))) }) : /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1.5", children: o.map((g) => /* @__PURE__ */ e(
|
|
454
|
+
nt,
|
|
455
455
|
{
|
|
456
|
-
relCollection:
|
|
456
|
+
relCollection: S.one_collection,
|
|
457
457
|
id: g,
|
|
458
458
|
drillConfig: m
|
|
459
459
|
},
|
|
@@ -480,7 +480,7 @@ function jn({
|
|
|
480
480
|
) });
|
|
481
481
|
if (s === "date")
|
|
482
482
|
try {
|
|
483
|
-
return /* @__PURE__ */ e("span", { className: `font-semibold ${a}`, children:
|
|
483
|
+
return /* @__PURE__ */ e("span", { className: `font-semibold ${a}`, children: Se(r) });
|
|
484
484
|
} catch {
|
|
485
485
|
}
|
|
486
486
|
if (s === "datetime")
|
|
@@ -489,9 +489,9 @@ function jn({
|
|
|
489
489
|
} catch {
|
|
490
490
|
}
|
|
491
491
|
}
|
|
492
|
-
return /* @__PURE__ */ e("span", { className: `font-semibold ${a}`, children:
|
|
492
|
+
return /* @__PURE__ */ e("span", { className: `font-semibold ${a}`, children: De(r, t) });
|
|
493
493
|
}
|
|
494
|
-
function
|
|
494
|
+
function ln({
|
|
495
495
|
summaryFields: t,
|
|
496
496
|
fields: r,
|
|
497
497
|
draft: i,
|
|
@@ -502,27 +502,27 @@ function sn({
|
|
|
502
502
|
ownersItemId: a,
|
|
503
503
|
ownersAssignment: m,
|
|
504
504
|
m2mCounts: h,
|
|
505
|
-
o2mCounts:
|
|
505
|
+
o2mCounts: S,
|
|
506
506
|
o2mAggValues: o,
|
|
507
507
|
summaryAggConfigs: g,
|
|
508
508
|
o2mLoading: f,
|
|
509
509
|
hideEmpty: y
|
|
510
510
|
}) {
|
|
511
|
-
const
|
|
511
|
+
const B = t.map((N) => typeof N == "string" ? N : N.field), O = y ? B.filter((N) => {
|
|
512
512
|
if (N === "__owners__" || f != null && f.has(N) || o && N in o) return !0;
|
|
513
513
|
if (h && N in h) return (h[N] ?? 0) > 0;
|
|
514
|
-
if (
|
|
514
|
+
if (S && N in S) return (S[N] ?? 0) > 0;
|
|
515
515
|
const U = i[N];
|
|
516
516
|
return U != null && U !== "" && !(Array.isArray(U) && U.length === 0);
|
|
517
|
-
}) :
|
|
518
|
-
if (
|
|
519
|
-
const
|
|
517
|
+
}) : B;
|
|
518
|
+
if (O.length === 0) return null;
|
|
519
|
+
const k = "text-[9px] font-semibold uppercase tracking-wider text-slate-400 dark:text-slate-500 shrink-0", D = "text-[12px] font-semibold text-slate-700 dark:text-slate-300", J = "text-[12px] text-slate-300 dark:text-slate-600", R = "flex items-baseline gap-1.5", me = (N) => {
|
|
520
520
|
if (N === "__owners__") {
|
|
521
521
|
const d = (m == null ? void 0 : m.label_override) || "Owners";
|
|
522
522
|
return /* @__PURE__ */ x("div", { className: "flex items-center gap-1.5", children: [
|
|
523
|
-
/* @__PURE__ */ e("span", { className:
|
|
523
|
+
/* @__PURE__ */ e("span", { className: k, children: d }),
|
|
524
524
|
/* @__PURE__ */ e(
|
|
525
|
-
|
|
525
|
+
en,
|
|
526
526
|
{
|
|
527
527
|
collection: n ?? s,
|
|
528
528
|
itemId: a ?? l
|
|
@@ -533,11 +533,11 @@ function sn({
|
|
|
533
533
|
const U = t.find((d) => (typeof d == "string" ? d : d.field) === N), ie = U && typeof U != "string" ? U.label : void 0, A = r.find((d) => d.field === N), I = ie || (A == null ? void 0 : A.label) || N.replace(/_/g, " ").replace(/\b\w/g, (d) => d.toUpperCase());
|
|
534
534
|
if (f != null && f.has(N))
|
|
535
535
|
return /* @__PURE__ */ x("div", { className: "flex items-center gap-1.5", children: [
|
|
536
|
-
/* @__PURE__ */ e("span", { className:
|
|
537
|
-
/* @__PURE__ */ e(
|
|
536
|
+
/* @__PURE__ */ e("span", { className: k, children: I }),
|
|
537
|
+
/* @__PURE__ */ e(Dt, { className: "h-3 w-3 animate-spin text-slate-300" })
|
|
538
538
|
] });
|
|
539
539
|
if (o && N in o) {
|
|
540
|
-
const d = g == null ? void 0 : g[N],
|
|
540
|
+
const d = g == null ? void 0 : g[N], L = (d == null ? void 0 : d.label) || I, $ = o[N];
|
|
541
541
|
let G;
|
|
542
542
|
if ((d == null ? void 0 : d.agg) === "count")
|
|
543
543
|
G = String($);
|
|
@@ -570,14 +570,14 @@ function sn({
|
|
|
570
570
|
G = $.toLocaleString(void 0, { maximumFractionDigits: 2 });
|
|
571
571
|
}
|
|
572
572
|
return /* @__PURE__ */ x("div", { className: R, children: [
|
|
573
|
-
/* @__PURE__ */ e("span", { className:
|
|
573
|
+
/* @__PURE__ */ e("span", { className: k, children: L }),
|
|
574
574
|
/* @__PURE__ */ e("span", { className: D, children: G })
|
|
575
575
|
] });
|
|
576
576
|
}
|
|
577
577
|
if (h && N in h) {
|
|
578
578
|
const d = h[N];
|
|
579
579
|
return /* @__PURE__ */ x("div", { className: R, children: [
|
|
580
|
-
/* @__PURE__ */ e("span", { className:
|
|
580
|
+
/* @__PURE__ */ e("span", { className: k, children: I }),
|
|
581
581
|
/* @__PURE__ */ x("span", { className: D, children: [
|
|
582
582
|
d,
|
|
583
583
|
" item",
|
|
@@ -585,10 +585,10 @@ function sn({
|
|
|
585
585
|
] })
|
|
586
586
|
] });
|
|
587
587
|
}
|
|
588
|
-
if (
|
|
589
|
-
const d =
|
|
588
|
+
if (S && N in S) {
|
|
589
|
+
const d = S[N];
|
|
590
590
|
return /* @__PURE__ */ x("div", { className: R, children: [
|
|
591
|
-
/* @__PURE__ */ e("span", { className:
|
|
591
|
+
/* @__PURE__ */ e("span", { className: k, children: I }),
|
|
592
592
|
/* @__PURE__ */ x("span", { className: D, children: [
|
|
593
593
|
d,
|
|
594
594
|
" row",
|
|
@@ -602,16 +602,16 @@ function sn({
|
|
|
602
602
|
if (M != null && M.one_collection) {
|
|
603
603
|
const d = Array.isArray(j) ? j : j != null && j !== "" ? [j] : [];
|
|
604
604
|
return /* @__PURE__ */ x("div", { className: R, children: [
|
|
605
|
-
/* @__PURE__ */ e("span", { className:
|
|
606
|
-
d.length === 0 ? /* @__PURE__ */ e("span", { className: J, children: "—" }) : M.one_collection === "nivaro_users" ? /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1.5 gap-y-0.5", children: d.map((
|
|
605
|
+
/* @__PURE__ */ e("span", { className: k, children: I }),
|
|
606
|
+
d.length === 0 ? /* @__PURE__ */ e("span", { className: J, children: "—" }) : M.one_collection === "nivaro_users" ? /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1.5 gap-y-0.5", children: d.map((L) => /* @__PURE__ */ e(et, { userId: String(L) }, String(L))) }) : /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1.5", children: d.map((L) => /* @__PURE__ */ e(re, { relCollection: M.one_collection, id: L }, String(L))) })
|
|
607
607
|
] });
|
|
608
608
|
}
|
|
609
609
|
if (Array.isArray(j)) {
|
|
610
|
-
const d = u.find(($) => $.many_field === N && $.junction_field),
|
|
610
|
+
const d = u.find(($) => $.many_field === N && $.junction_field), L = d == null ? void 0 : d.one_collection;
|
|
611
611
|
return /* @__PURE__ */ x("div", { className: R, children: [
|
|
612
|
-
/* @__PURE__ */ e("span", { className:
|
|
613
|
-
j.length === 0 ? /* @__PURE__ */ e("span", { className: J, children: "—" }) :
|
|
614
|
-
($) =>
|
|
612
|
+
/* @__PURE__ */ e("span", { className: k, children: I }),
|
|
613
|
+
j.length === 0 ? /* @__PURE__ */ e("span", { className: J, children: "—" }) : L ? /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1.5 gap-y-0.5", children: j.map(
|
|
614
|
+
($) => L === "nivaro_users" ? /* @__PURE__ */ e(et, { userId: String($) }, String($)) : /* @__PURE__ */ e(re, { relCollection: L, id: $ }, String($))
|
|
615
615
|
) }) : /* @__PURE__ */ x("span", { className: D, children: [
|
|
616
616
|
j.length,
|
|
617
617
|
" item",
|
|
@@ -620,13 +620,13 @@ function sn({
|
|
|
620
620
|
] });
|
|
621
621
|
}
|
|
622
622
|
return /* @__PURE__ */ x("div", { className: R, children: [
|
|
623
|
-
/* @__PURE__ */ e("span", { className:
|
|
624
|
-
j == null || j === "" ? /* @__PURE__ */ e("span", { className: J, children: "—" }) : /* @__PURE__ */ e("span", { className: D, children:
|
|
623
|
+
/* @__PURE__ */ e("span", { className: k, children: I }),
|
|
624
|
+
j == null || j === "" ? /* @__PURE__ */ e("span", { className: J, children: "—" }) : /* @__PURE__ */ e("span", { className: D, children: De(j, A) })
|
|
625
625
|
] });
|
|
626
626
|
};
|
|
627
|
-
return /* @__PURE__ */ e("div", { className: "flex flex-wrap items-baseline gap-x-5 gap-y-1.5 border-t border-slate-100 dark:border-border/60 bg-slate-50/50 dark:bg-white/[0.015] px-5 py-2.5", children:
|
|
627
|
+
return /* @__PURE__ */ e("div", { className: "flex flex-wrap items-baseline gap-x-5 gap-y-1.5 border-t border-slate-100 dark:border-border/60 bg-slate-50/50 dark:bg-white/[0.015] px-5 py-2.5", children: O.map((N) => /* @__PURE__ */ e(rt.Fragment, { children: me(N) }, N)) });
|
|
628
628
|
}
|
|
629
|
-
function
|
|
629
|
+
function qn({
|
|
630
630
|
group: t,
|
|
631
631
|
fields: r,
|
|
632
632
|
draft: i,
|
|
@@ -637,14 +637,14 @@ function Ln({
|
|
|
637
637
|
errors: a,
|
|
638
638
|
visibleFields: m,
|
|
639
639
|
lockedFields: h,
|
|
640
|
-
layoutAiEnabled:
|
|
640
|
+
layoutAiEnabled: S,
|
|
641
641
|
displayOnly: o,
|
|
642
642
|
renderField: g,
|
|
643
643
|
onCountChange: f,
|
|
644
644
|
isNew: y,
|
|
645
|
-
fieldValues:
|
|
646
|
-
isOpen:
|
|
647
|
-
onToggle:
|
|
645
|
+
fieldValues: B,
|
|
646
|
+
isOpen: O,
|
|
647
|
+
onToggle: k,
|
|
648
648
|
summaryFields: D,
|
|
649
649
|
m2mCounts: J,
|
|
650
650
|
o2mCounts: R,
|
|
@@ -657,46 +657,46 @@ function Ln({
|
|
|
657
657
|
ownersAssignment: j,
|
|
658
658
|
pdfAssignment: M,
|
|
659
659
|
pdfAttachField: d,
|
|
660
|
-
pdfFilenameTemplate:
|
|
660
|
+
pdfFilenameTemplate: L,
|
|
661
661
|
layoutId: $,
|
|
662
662
|
hideEmptySummary: G,
|
|
663
663
|
widgetAssignments: K,
|
|
664
664
|
widgetApiBase: E,
|
|
665
665
|
fieldInlineDisplay: Y,
|
|
666
666
|
swapConfig: V,
|
|
667
|
-
swapped:
|
|
668
|
-
onSwapToggle:
|
|
667
|
+
swapped: $e,
|
|
668
|
+
onSwapToggle: Fe,
|
|
669
669
|
alternateFields: Z,
|
|
670
670
|
alternateWidths: pe,
|
|
671
671
|
deferred: se,
|
|
672
672
|
onFirstOpen: le
|
|
673
673
|
}) {
|
|
674
|
-
var
|
|
675
|
-
const [
|
|
674
|
+
var Ge;
|
|
675
|
+
const [ct, dt] = Q(t.is_collapsed ?? !1), [ut, mt] = Q(!1), F = Pt(), H = (p, _) => Vt(F, p, _, { asChild: !0 }), ae = (p) => ({ kind: "slot", field: p, group_key: t.key }), je = !!(F != null && F.showHidden), [Oe, qe] = Q({}), { data: fe } = Et(l), X = (F == null ? void 0 : F.fold) ?? null, ee = (F == null ? void 0 : F.reveal) ?? null, [Be, he] = Q(null);
|
|
676
676
|
ne(() => {
|
|
677
677
|
X && he(!X.open);
|
|
678
678
|
}, [X == null ? void 0 : X.seq]), ne(() => {
|
|
679
|
-
ee &&
|
|
679
|
+
ee && Ct(ee.target) === t.key && he(!1);
|
|
680
680
|
}, [ee == null ? void 0 : ee.seq]);
|
|
681
|
-
const
|
|
681
|
+
const Le = k !== void 0, z = Be ?? (Le ? !O : ct);
|
|
682
682
|
ne(() => {
|
|
683
683
|
se && !z && (le == null || le(t.key));
|
|
684
684
|
}, [se, z, le, t.key]);
|
|
685
|
-
const be =
|
|
686
|
-
|
|
687
|
-
},
|
|
685
|
+
const be = Be !== null ? () => he((p) => !p) : Le ? k : () => dt((p) => !p), Ue = !F && $ != null, ge = () => {
|
|
686
|
+
Ue && st({ layoutId: Number($), collection: l, kind: "opened", key: t.key });
|
|
687
|
+
}, pt = () => {
|
|
688
688
|
z && ge(), be == null || be();
|
|
689
|
-
},
|
|
690
|
-
if (
|
|
691
|
-
const te = K ?? [],
|
|
689
|
+
}, ft = !o && r.some((p) => a[p.field]), Te = F ? "always" : t.visibility_mode ?? "always";
|
|
690
|
+
if (Te === "new_only" && !y || Te === "existing_only" && y) return null;
|
|
691
|
+
const te = K ?? [], ht = !y && te.some((p) => p.widget_id != null && Oe[p.field] === void 0);
|
|
692
692
|
let oe = !1;
|
|
693
|
-
if (t.hide_when_empty &&
|
|
693
|
+
if (t.hide_when_empty && B && !F && (oe = B.every(
|
|
694
694
|
(_) => _ == null || _ === "" || Array.isArray(_) && _.length === 0
|
|
695
|
-
) && !
|
|
696
|
-
const xe =
|
|
695
|
+
) && !ht && te.every((_) => !Oe[_.field])), oe && te.length === 0) return null;
|
|
696
|
+
const xe = ke(null), ye = Zt(xe), Ie = nn(t.icon), bt = je ? r : r.filter((p) => !p.hidden), Me = (Ge = fe == null ? void 0 : fe.sections) == null ? void 0 : Ge[t.key], gt = Array.isArray(Me) && Me.length > 0, xt = (p) => gt ? /* @__PURE__ */ x("div", { className: "relative", children: [
|
|
697
697
|
p,
|
|
698
698
|
/* @__PURE__ */ e("span", { className: "absolute right-[52px] top-1/2 flex -translate-y-1/2", children: /* @__PURE__ */ e(
|
|
699
|
-
|
|
699
|
+
Yt,
|
|
700
700
|
{
|
|
701
701
|
collection: l,
|
|
702
702
|
kind: "section",
|
|
@@ -704,7 +704,7 @@ function Ln({
|
|
|
704
704
|
label: t.label || t.key
|
|
705
705
|
}
|
|
706
706
|
) })
|
|
707
|
-
] }) : p, Ne = (p) =>
|
|
707
|
+
] }) : p, Ne = (p) => je && (p.hidden || !(m.has(p.field) || !m.size));
|
|
708
708
|
return /* @__PURE__ */ x(
|
|
709
709
|
"div",
|
|
710
710
|
{
|
|
@@ -724,14 +724,14 @@ function Ln({
|
|
|
724
724
|
(c = (_ = p.target) == null ? void 0 : _.closest) != null && c.call(_, "[data-usage-header]") || ge();
|
|
725
725
|
},
|
|
726
726
|
children: [
|
|
727
|
-
|
|
728
|
-
|
|
727
|
+
Ue && !oe && /* @__PURE__ */ e(an, { layoutId: Number($), collection: l, sectionKey: t.key }),
|
|
728
|
+
xt(
|
|
729
729
|
/* @__PURE__ */ x(
|
|
730
730
|
"button",
|
|
731
731
|
{
|
|
732
732
|
type: "button",
|
|
733
733
|
"data-usage-header": "",
|
|
734
|
-
onClick:
|
|
734
|
+
onClick: pt,
|
|
735
735
|
"data-design-group-header": F ? "" : void 0,
|
|
736
736
|
className: W(
|
|
737
737
|
"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",
|
|
@@ -741,10 +741,10 @@ function Ln({
|
|
|
741
741
|
z && !(D && D.length > 0) && "rounded-b-xl"
|
|
742
742
|
),
|
|
743
743
|
children: [
|
|
744
|
-
|
|
744
|
+
Ie && /* @__PURE__ */ e(Ie, { className: "h-3.5 w-3.5 shrink-0 text-slate-400 dark:text-slate-500" }),
|
|
745
745
|
/* @__PURE__ */ e("span", { className: "font-medium text-[13px] shrink-0 text-slate-800 dark:text-slate-200", children: t.label }),
|
|
746
746
|
/* @__PURE__ */ e("span", { className: "flex-1" }),
|
|
747
|
-
|
|
747
|
+
ft && /* @__PURE__ */ e("span", { className: "nvr-pop h-2 w-2 rounded-full bg-destructive shrink-0" }),
|
|
748
748
|
/* @__PURE__ */ e(
|
|
749
749
|
St,
|
|
750
750
|
{
|
|
@@ -760,7 +760,7 @@ function Ln({
|
|
|
760
760
|
)
|
|
761
761
|
),
|
|
762
762
|
z && D && D.length > 0 && /* @__PURE__ */ e(
|
|
763
|
-
|
|
763
|
+
ln,
|
|
764
764
|
{
|
|
765
765
|
summaryFields: D,
|
|
766
766
|
fields: r,
|
|
@@ -780,27 +780,27 @@ function Ln({
|
|
|
780
780
|
}
|
|
781
781
|
),
|
|
782
782
|
z && !se && t.hide_when_empty && te.length > 0 && /* @__PURE__ */ e("div", { className: "hidden", children: te.filter((p) => p.widget_id != null).map((p) => /* @__PURE__ */ e(
|
|
783
|
-
|
|
783
|
+
Ee,
|
|
784
784
|
{
|
|
785
785
|
widgetId: p.widget_id,
|
|
786
|
-
inputBindings:
|
|
786
|
+
inputBindings: Ze(p.input_bindings),
|
|
787
787
|
itemDraft: i,
|
|
788
788
|
frameless: !0,
|
|
789
789
|
apiBase: E,
|
|
790
|
-
onContentChange: (_) =>
|
|
790
|
+
onContentChange: (_) => qe(
|
|
791
791
|
(c) => c[p.field] === _ ? c : { ...c, [p.field]: _ }
|
|
792
792
|
)
|
|
793
793
|
},
|
|
794
794
|
p.field
|
|
795
795
|
)) }),
|
|
796
796
|
!z && /* @__PURE__ */ x("div", { className: "nvr-expand-in border-t border-slate-100 px-5 py-4", children: [
|
|
797
|
-
!o && /* @__PURE__ */ e(
|
|
797
|
+
!o && /* @__PURE__ */ e(Xt, { group: t, className: "mb-3" }),
|
|
798
798
|
(() => {
|
|
799
|
-
const p =
|
|
800
|
-
rows: o ? [] :
|
|
801
|
-
folded: (c) => !o &&
|
|
799
|
+
const p = Lt(bt, {
|
|
800
|
+
rows: o ? [] : It(t.swap_config).rows,
|
|
801
|
+
folded: (c) => !o && Tt(c._overrides),
|
|
802
802
|
keep: (c) => !!c.required,
|
|
803
|
-
filled: (c) => !
|
|
803
|
+
filled: (c) => !Ut(i[c.field]) || !!a[c.field]
|
|
804
804
|
}), _ = p.units.map(
|
|
805
805
|
(c) => c.kind === "row" ? {
|
|
806
806
|
_k: `row:${c.row.key}`,
|
|
@@ -823,7 +823,7 @@ function Ln({
|
|
|
823
823
|
});
|
|
824
824
|
for (const c of K ?? [])
|
|
825
825
|
_.push({ _k: c.field, sort: c.sort, _t: "widget", slot: c });
|
|
826
|
-
return _.sort((c,
|
|
826
|
+
return _.sort((c, q) => c.sort - q.sort), F && _.length === 0 && p.folded.length === 0 ? /* @__PURE__ */ e(Gt, {}) : o ? /* @__PURE__ */ x(
|
|
827
827
|
"div",
|
|
828
828
|
{
|
|
829
829
|
ref: xe,
|
|
@@ -841,7 +841,7 @@ function Ln({
|
|
|
841
841
|
className: "min-w-0",
|
|
842
842
|
style: { gridColumn: `span ${v}` },
|
|
843
843
|
children: /* @__PURE__ */ e(
|
|
844
|
-
|
|
844
|
+
Qe,
|
|
845
845
|
{
|
|
846
846
|
collection: l,
|
|
847
847
|
itemId: n,
|
|
@@ -854,25 +854,25 @@ function Ln({
|
|
|
854
854
|
);
|
|
855
855
|
}
|
|
856
856
|
if (c._t === "pdf" || c._t === "widget" || c._t === "row") return null;
|
|
857
|
-
const
|
|
858
|
-
(v) => v.many_collection === l && v.many_field ===
|
|
857
|
+
const q = c.f, b = s.find(
|
|
858
|
+
(v) => v.many_collection === l && v.many_field === q.field && !v.junction_field
|
|
859
859
|
);
|
|
860
860
|
return H(
|
|
861
|
-
{ kind: "field", field:
|
|
861
|
+
{ kind: "field", field: q.field, group_key: t.key },
|
|
862
862
|
/* @__PURE__ */ x(
|
|
863
863
|
"div",
|
|
864
864
|
{
|
|
865
865
|
className: "min-w-0",
|
|
866
|
-
style: { gridColumn: `span ${
|
|
866
|
+
style: { gridColumn: `span ${Ye(q.options, ye)}` },
|
|
867
867
|
children: [
|
|
868
|
-
/* @__PURE__ */ e("dt", { className: "text-[11px] font-medium text-slate-400 truncate", children:
|
|
868
|
+
/* @__PURE__ */ e("dt", { className: "text-[11px] font-medium text-slate-400 truncate", children: q.label || at(q.field) }),
|
|
869
869
|
/* @__PURE__ */ e("dd", { className: "mt-0.5 break-words", children: (b == null ? void 0 : b.one_collection) === "nivaro_users" ? (() => {
|
|
870
|
-
const v = i[
|
|
871
|
-
return P.length === 0 ? /* @__PURE__ */ e("span", { className: "text-[13px] text-slate-400", children: "—" }) : /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1.5", children: P.map((T) => /* @__PURE__ */ e(
|
|
872
|
-
})() : b != null && b.one_collection ? /* @__PURE__ */ e(re, { relCollection: b.one_collection, id: i[
|
|
870
|
+
const v = i[q.field], P = Array.isArray(v) ? v : v != null && v !== "" ? [v] : [];
|
|
871
|
+
return P.length === 0 ? /* @__PURE__ */ e("span", { className: "text-[13px] text-slate-400", children: "—" }) : /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1.5", children: P.map((T) => /* @__PURE__ */ e(ot, { userId: String(T) }, String(T))) });
|
|
872
|
+
})() : b != null && b.one_collection ? /* @__PURE__ */ e(re, { relCollection: b.one_collection, id: i[q.field] }) : /* @__PURE__ */ e("span", { className: "text-[13px] text-slate-700", children: De(i[q.field], q) }) })
|
|
873
873
|
]
|
|
874
874
|
},
|
|
875
|
-
|
|
875
|
+
q.field
|
|
876
876
|
)
|
|
877
877
|
);
|
|
878
878
|
})
|
|
@@ -880,10 +880,10 @@ function Ln({
|
|
|
880
880
|
}
|
|
881
881
|
) : (() => {
|
|
882
882
|
const c = (b) => {
|
|
883
|
-
var
|
|
883
|
+
var Ke, He;
|
|
884
884
|
if (b._t === "row")
|
|
885
885
|
return /* @__PURE__ */ e(
|
|
886
|
-
|
|
886
|
+
Wt,
|
|
887
887
|
{
|
|
888
888
|
row: b.row,
|
|
889
889
|
members: b.members,
|
|
@@ -894,7 +894,7 @@ function Ln({
|
|
|
894
894
|
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
895
895
|
ve,
|
|
896
896
|
{
|
|
897
|
-
field:
|
|
897
|
+
field: At(w),
|
|
898
898
|
draft: i,
|
|
899
899
|
onChange: u,
|
|
900
900
|
relations: s,
|
|
@@ -904,7 +904,7 @@ function Ln({
|
|
|
904
904
|
visible: m.has(w.field) || !m.size,
|
|
905
905
|
forceVisible: Ne(w) || void 0,
|
|
906
906
|
locked: h.has(w.field),
|
|
907
|
-
layoutAiEnabled:
|
|
907
|
+
layoutAiEnabled: S,
|
|
908
908
|
renderField: g,
|
|
909
909
|
onCountChange: f
|
|
910
910
|
}
|
|
@@ -918,7 +918,7 @@ function Ln({
|
|
|
918
918
|
return H(
|
|
919
919
|
ae("__owners__"),
|
|
920
920
|
/* @__PURE__ */ e("div", { style: { gridColumn: `span ${w}` }, children: /* @__PURE__ */ e(
|
|
921
|
-
|
|
921
|
+
Qe,
|
|
922
922
|
{
|
|
923
923
|
collection: l,
|
|
924
924
|
itemId: n,
|
|
@@ -929,17 +929,17 @@ function Ln({
|
|
|
929
929
|
}
|
|
930
930
|
if (b._t === "pdf") {
|
|
931
931
|
if (!$) return null;
|
|
932
|
-
const w = b.slot.col_span ?? 12, C = ((
|
|
932
|
+
const w = b.slot.col_span ?? 12, C = ((Ke = b.slot.label_override) == null ? void 0 : Ke.trim()) || "Generate PDF";
|
|
933
933
|
return H(
|
|
934
934
|
ae("__pdf__"),
|
|
935
935
|
/* @__PURE__ */ e("div", { style: { gridColumn: `span ${w}` }, children: /* @__PURE__ */ e(
|
|
936
|
-
|
|
936
|
+
rn,
|
|
937
937
|
{
|
|
938
938
|
collection: l,
|
|
939
939
|
itemId: n,
|
|
940
940
|
layoutId: $,
|
|
941
941
|
attachField: d ?? null,
|
|
942
|
-
filenameTemplate:
|
|
942
|
+
filenameTemplate: L,
|
|
943
943
|
label: C
|
|
944
944
|
}
|
|
945
945
|
) }, "__pdf__")
|
|
@@ -947,11 +947,11 @@ function Ln({
|
|
|
947
947
|
}
|
|
948
948
|
if (b._t === "widget") {
|
|
949
949
|
if (!b.slot.widget_id) return null;
|
|
950
|
-
const w = b.slot.col_span ?? 12, C =
|
|
950
|
+
const w = b.slot.col_span ?? 12, C = Ze(b.slot.input_bindings);
|
|
951
951
|
return H(
|
|
952
952
|
ae(b.slot.field),
|
|
953
953
|
/* @__PURE__ */ e("div", { style: { gridColumn: `span ${w}` }, children: /* @__PURE__ */ e(
|
|
954
|
-
|
|
954
|
+
Ee,
|
|
955
955
|
{
|
|
956
956
|
widgetId: b.slot.widget_id,
|
|
957
957
|
inputBindings: C,
|
|
@@ -960,29 +960,29 @@ function Ln({
|
|
|
960
960
|
defaultExpanded: b.slot.default_expanded ?? !0,
|
|
961
961
|
frameless: !0,
|
|
962
962
|
apiBase: E,
|
|
963
|
-
onContentChange: (
|
|
964
|
-
(_e) => _e[b.slot.field] ===
|
|
963
|
+
onContentChange: (We) => qe(
|
|
964
|
+
(_e) => _e[b.slot.field] === We ? _e : { ..._e, [b.slot.field]: We }
|
|
965
965
|
)
|
|
966
966
|
}
|
|
967
967
|
) }, b.slot.field)
|
|
968
968
|
);
|
|
969
969
|
}
|
|
970
|
-
const v = b.f, P = Y == null ? void 0 : Y[v.field], T = P == null ? void 0 : P.entries,
|
|
970
|
+
const v = b.f, P = Y == null ? void 0 : Y[v.field], T = P == null ? void 0 : P.entries, yt = (P == null ? void 0 : P.separator) ?? null, ce = i[v.field], Ve = ce != null && ce !== "", Pe = T != null && T.length && Ve ? ((He = s.find(
|
|
971
971
|
(w) => w.many_collection === l && w.many_field === v.field && !w.junction_field
|
|
972
|
-
)) == null ? void 0 :
|
|
972
|
+
)) == null ? void 0 : He.one_collection) ?? null : null, Ce = (V == null ? void 0 : V.enabled) && v.field === V.primary_field, Je = (() => {
|
|
973
973
|
const w = i[(V == null ? void 0 : V.primary_field) ?? ""];
|
|
974
974
|
return w != null && w !== "";
|
|
975
|
-
})(),
|
|
975
|
+
})(), Re = (Z ?? []).some((w) => {
|
|
976
976
|
const C = i[w.field];
|
|
977
977
|
return C != null && C !== "";
|
|
978
|
-
}),
|
|
978
|
+
}), Nt = Ce && Fe ? /* @__PURE__ */ x("span", { className: "inline-flex items-center gap-1.5", children: [
|
|
979
979
|
/* @__PURE__ */ e(
|
|
980
980
|
"button",
|
|
981
981
|
{
|
|
982
982
|
type: "button",
|
|
983
|
-
onClick:
|
|
983
|
+
onClick: Fe,
|
|
984
984
|
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",
|
|
985
|
-
children:
|
|
985
|
+
children: $e ? V.back_label ?? "Back" : V.toggle_label ?? "Enter manually"
|
|
986
986
|
}
|
|
987
987
|
),
|
|
988
988
|
/* @__PURE__ */ x(
|
|
@@ -990,7 +990,7 @@ function Ln({
|
|
|
990
990
|
{
|
|
991
991
|
className: [
|
|
992
992
|
"inline-flex items-center gap-0.5 rounded px-1 py-0.5 text-[9px] font-medium",
|
|
993
|
-
|
|
993
|
+
Je ? "bg-emerald-50 text-emerald-600 dark:bg-emerald-900/30 dark:text-emerald-400" : "bg-slate-100 text-slate-400 dark:bg-slate-800 dark:text-slate-500"
|
|
994
994
|
].join(" "),
|
|
995
995
|
title: "Original field",
|
|
996
996
|
children: [
|
|
@@ -999,7 +999,7 @@ function Ln({
|
|
|
999
999
|
{
|
|
1000
1000
|
className: [
|
|
1001
1001
|
"h-1.5 w-1.5 rounded-full",
|
|
1002
|
-
|
|
1002
|
+
Je ? "bg-emerald-500" : "bg-slate-300 dark:bg-slate-600"
|
|
1003
1003
|
].join(" ")
|
|
1004
1004
|
}
|
|
1005
1005
|
),
|
|
@@ -1012,7 +1012,7 @@ function Ln({
|
|
|
1012
1012
|
{
|
|
1013
1013
|
className: [
|
|
1014
1014
|
"inline-flex items-center gap-0.5 rounded px-1 py-0.5 text-[9px] font-medium",
|
|
1015
|
-
|
|
1015
|
+
Re ? "bg-emerald-50 text-emerald-600 dark:bg-emerald-900/30 dark:text-emerald-400" : "bg-slate-100 text-slate-400 dark:bg-slate-800 dark:text-slate-500"
|
|
1016
1016
|
].join(" "),
|
|
1017
1017
|
title: "Manual fields",
|
|
1018
1018
|
children: [
|
|
@@ -1021,7 +1021,7 @@ function Ln({
|
|
|
1021
1021
|
{
|
|
1022
1022
|
className: [
|
|
1023
1023
|
"h-1.5 w-1.5 rounded-full",
|
|
1024
|
-
|
|
1024
|
+
Re ? "bg-emerald-500" : "bg-slate-300 dark:bg-slate-600"
|
|
1025
1025
|
].join(" ")
|
|
1026
1026
|
}
|
|
1027
1027
|
),
|
|
@@ -1029,7 +1029,7 @@ function Ln({
|
|
|
1029
1029
|
]
|
|
1030
1030
|
}
|
|
1031
1031
|
)
|
|
1032
|
-
] }) : void 0,
|
|
1032
|
+
] }) : void 0, _t = Ce && $e && (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) => {
|
|
1033
1033
|
const C = (pe == null ? void 0 : pe[w.field]) ?? 2;
|
|
1034
1034
|
return /* @__PURE__ */ e("div", { style: { gridColumn: `span ${C}` }, children: /* @__PURE__ */ e(
|
|
1035
1035
|
ve,
|
|
@@ -1044,12 +1044,12 @@ function Ln({
|
|
|
1044
1044
|
visible: !0,
|
|
1045
1045
|
forceVisible: !0,
|
|
1046
1046
|
locked: h.has(w.field),
|
|
1047
|
-
layoutAiEnabled:
|
|
1047
|
+
layoutAiEnabled: S,
|
|
1048
1048
|
renderField: g,
|
|
1049
1049
|
onCountChange: f
|
|
1050
1050
|
}
|
|
1051
1051
|
) }, w.field);
|
|
1052
|
-
}) }) }) : void 0,
|
|
1052
|
+
}) }) }) : void 0, ze = /* @__PURE__ */ e(
|
|
1053
1053
|
ve,
|
|
1054
1054
|
{
|
|
1055
1055
|
field: v,
|
|
@@ -1062,11 +1062,11 @@ function Ln({
|
|
|
1062
1062
|
visible: m.has(v.field) || !m.size,
|
|
1063
1063
|
forceVisible: Ne(v) || void 0,
|
|
1064
1064
|
locked: h.has(v.field),
|
|
1065
|
-
layoutAiEnabled:
|
|
1065
|
+
layoutAiEnabled: S,
|
|
1066
1066
|
renderField: g,
|
|
1067
1067
|
onCountChange: f,
|
|
1068
|
-
swapButton:
|
|
1069
|
-
swapContent:
|
|
1068
|
+
swapButton: Nt,
|
|
1069
|
+
swapContent: _t
|
|
1070
1070
|
}
|
|
1071
1071
|
);
|
|
1072
1072
|
return H(
|
|
@@ -1074,16 +1074,16 @@ function Ln({
|
|
|
1074
1074
|
/* @__PURE__ */ x(
|
|
1075
1075
|
"div",
|
|
1076
1076
|
{
|
|
1077
|
-
style: { gridColumn: `span ${
|
|
1077
|
+
style: { gridColumn: `span ${Ye(v.options, ye)}` },
|
|
1078
1078
|
children: [
|
|
1079
|
-
Ne(v) ? /* @__PURE__ */ e("div", { "data-design-hidden": "", className: "opacity-40", children:
|
|
1080
|
-
(T == null ? void 0 : T.length) &&
|
|
1081
|
-
|
|
1079
|
+
Ne(v) ? /* @__PURE__ */ e("div", { "data-design-hidden": "", className: "opacity-40", children: ze }) : ze,
|
|
1080
|
+
(T == null ? void 0 : T.length) && Ve && Pe && /* @__PURE__ */ e(
|
|
1081
|
+
tn,
|
|
1082
1082
|
{
|
|
1083
|
-
relCollection:
|
|
1083
|
+
relCollection: Pe,
|
|
1084
1084
|
relId: ce,
|
|
1085
1085
|
entries: T,
|
|
1086
|
-
separator:
|
|
1086
|
+
separator: yt
|
|
1087
1087
|
}
|
|
1088
1088
|
)
|
|
1089
1089
|
]
|
|
@@ -1091,13 +1091,13 @@ function Ln({
|
|
|
1091
1091
|
v.field
|
|
1092
1092
|
)
|
|
1093
1093
|
);
|
|
1094
|
-
},
|
|
1094
|
+
}, q = p.folded.map((b) => ({
|
|
1095
1095
|
_k: b.field,
|
|
1096
1096
|
sort: b.sort ?? 0,
|
|
1097
1097
|
_t: "field",
|
|
1098
1098
|
f: b
|
|
1099
1099
|
}));
|
|
1100
|
-
return /* @__PURE__ */ x(
|
|
1100
|
+
return /* @__PURE__ */ x(wt, { children: [
|
|
1101
1101
|
/* @__PURE__ */ x(
|
|
1102
1102
|
"div",
|
|
1103
1103
|
{
|
|
@@ -1110,20 +1110,20 @@ function Ln({
|
|
|
1110
1110
|
}
|
|
1111
1111
|
),
|
|
1112
1112
|
/* @__PURE__ */ e(
|
|
1113
|
-
|
|
1113
|
+
Ht,
|
|
1114
1114
|
{
|
|
1115
|
-
count:
|
|
1116
|
-
open:
|
|
1115
|
+
count: q.length,
|
|
1116
|
+
open: ut,
|
|
1117
1117
|
forcedOpen: p.forcedOpen,
|
|
1118
1118
|
design: !!F,
|
|
1119
|
-
onToggle: () =>
|
|
1119
|
+
onToggle: () => mt((b) => !b),
|
|
1120
1120
|
children: /* @__PURE__ */ x(
|
|
1121
1121
|
"div",
|
|
1122
1122
|
{
|
|
1123
1123
|
className: W(F && "relative", "grid grid-cols-12 gap-4 items-start"),
|
|
1124
1124
|
children: [
|
|
1125
1125
|
/* @__PURE__ */ e(we, {}),
|
|
1126
|
-
|
|
1126
|
+
q.map(c)
|
|
1127
1127
|
]
|
|
1128
1128
|
}
|
|
1129
1129
|
)
|
|
@@ -1138,24 +1138,24 @@ function Ln({
|
|
|
1138
1138
|
}
|
|
1139
1139
|
);
|
|
1140
1140
|
}
|
|
1141
|
-
function
|
|
1141
|
+
function an({
|
|
1142
1142
|
layoutId: t,
|
|
1143
1143
|
collection: r,
|
|
1144
1144
|
sectionKey: i
|
|
1145
1145
|
}) {
|
|
1146
1146
|
return ne(() => {
|
|
1147
|
-
|
|
1147
|
+
st({ layoutId: t, collection: r, kind: "shown", key: i });
|
|
1148
1148
|
}, [t, r, i]), null;
|
|
1149
1149
|
}
|
|
1150
1150
|
export {
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1151
|
+
qn as GroupSection,
|
|
1152
|
+
tn as InlineDisplay,
|
|
1153
|
+
Qe as OwnersInline,
|
|
1154
|
+
en as OwnersInlineCompact,
|
|
1155
1155
|
re as RelationCell,
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1156
|
+
On as StripFieldValue,
|
|
1157
|
+
ot as UserChip,
|
|
1158
|
+
Un as UserRosterCluster,
|
|
1159
|
+
De as formatDisplayValue,
|
|
1160
|
+
sn as useChangePulse
|
|
1161
1161
|
};
|