@nivaro/react 0.3.138 → 0.3.140
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/components/InlineGridField.js +95 -92
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +36 -2
- package/dist/shared/components/AudienceConfirmPanel.js +19 -19
- package/dist/shared/components/BroadcastView.js +213 -211
- package/dist/shared/components/CollectionBrowserView.js +2677 -2658
- package/dist/shared/components/ConfigHistory.js +45 -45
- package/dist/shared/components/ConformanceView.js +110 -110
- package/dist/shared/components/DataTable.js +51 -51
- package/dist/shared/components/FilePreviewLightbox.js +26 -25
- package/dist/shared/components/ItemEditForm.js +3038 -3027
- package/dist/shared/components/LiveCount.js +27 -23
- package/dist/shared/components/LiveTraceView.js +62 -61
- package/dist/shared/components/PageRenderer.js +422 -410
- package/dist/shared/components/ProfileView.js +199 -199
- package/dist/shared/components/QualityRulesView.js +70 -70
- package/dist/shared/components/QueryTable.js +131 -130
- package/dist/shared/components/RecordGraph.js +98 -98
- package/dist/shared/components/RecordReadView.js +287 -288
- package/dist/shared/components/ReportView.js +1279 -1259
- package/dist/shared/components/SlaRulesView.js +73 -74
- package/dist/shared/components/WidgetSlot.js +73 -73
- package/dist/shared/components/ai/AiChart.js +36 -32
- package/dist/shared/components/ai/AiMarkdown.js +136 -129
- package/dist/shared/components/ai/TaskDo.js +87 -87
- package/dist/shared/components/ai/answer-formats.js +37 -30
- package/dist/shared/components/ai/call-log/format.js +17 -16
- package/dist/shared/components/bulk/BulkActionButtons.js +66 -66
- package/dist/shared/components/bulk/BulkFieldUpdate.js +59 -59
- package/dist/shared/components/bulk/BulkSelectionNotices.js +34 -34
- package/dist/shared/components/bulk/MessageStakeholders.js +31 -29
- package/dist/shared/components/bulk/PushBulkButtons.js +83 -82
- package/dist/shared/components/bulk/bulk-field-options.js +10 -10
- package/dist/shared/components/cbv/column-totals.js +53 -51
- package/dist/shared/components/chat/ChatAnalyticsView.js +87 -87
- package/dist/shared/components/collections-directory/CollectionsToolbar.js +18 -18
- package/dist/shared/components/command-center/announce.js +7 -6
- package/dist/shared/components/command-center/panels/AttentionPanel.js +32 -31
- package/dist/shared/components/command-center/panels/FlowPanel.js +29 -28
- package/dist/shared/components/command-center/panels/PeoplePanel.js +39 -39
- package/dist/shared/components/delegation/DelegationConsoleView.js +27 -27
- package/dist/shared/components/imports/RunDetailSheet.js +1 -1
- package/dist/shared/components/integrations/IntegrationObligationsView.js +119 -119
- package/dist/shared/components/integrations/console/EventsView.js +35 -35
- package/dist/shared/components/integrations/console/FirefightView.js +15 -14
- package/dist/shared/components/integrations/console/PartnerDetail.js +78 -78
- package/dist/shared/components/integrations/console/ReadyToSendView.js +103 -103
- package/dist/shared/components/integrations/console/SignalCard.js +67 -67
- package/dist/shared/components/item-edit/CatalogPickerField.js +536 -527
- package/dist/shared/components/item-edit/ChangesTray.js +88 -74
- package/dist/shared/components/item-edit/FilePickerField.js +123 -123
- package/dist/shared/components/item-edit/GroupSection.js +301 -292
- package/dist/shared/components/item-edit/HeaderSummaryChip.js +54 -54
- package/dist/shared/components/item-edit/InlineGridField.js +45 -36
- package/dist/shared/components/item-edit/InlineTableField.js +1167 -1153
- package/dist/shared/components/item-edit/NestedRelationEditor.js +106 -99
- package/dist/shared/components/item-edit/RecordChatMentionsChip.js +11 -11
- package/dist/shared/components/layout-editor/ai-forms/SlimPanel.js +43 -44
- package/dist/shared/components/monitoring/ApiRequestLog.js +35 -35
- package/dist/shared/components/notifications/NotificationCenterView.js +268 -268
- package/dist/shared/components/ops-report/format.js +37 -36
- package/dist/shared/components/panels/ReferencedByPanel.js +21 -20
- package/dist/shared/components/panels/RevisionsPanel.js +306 -305
- package/dist/shared/components/pipeline/OwnerMatrixVersionsCard.js +12 -12
- package/dist/shared/components/pipeline/PipelineEditorView.js +483 -482
- package/dist/shared/components/pipeline/PipelineHealthCards.js +33 -32
- package/dist/shared/components/pipeline/TeamsView.js +189 -130
- package/dist/shared/components/profile/AgentsPanel.js +6 -6
- package/dist/shared/components/profile/DelegationCard.js +13 -12
- package/dist/shared/components/profile/PersonActivity.js +48 -48
- package/dist/shared/components/profile/PersonExtras.js +107 -107
- package/dist/shared/components/profile/PersonWeek.js +9 -9
- package/dist/shared/components/queue/QueueBulkBar.js +19 -18
- package/dist/shared/components/queue/QueueBulkMove.js +21 -20
- package/dist/shared/components/queue/QueueItemSheet.js +136 -131
- package/dist/shared/components/queue/QueueWorklist.js +671 -670
- package/dist/shared/components/queue/worklist-helpers.js +36 -21
- package/dist/shared/components/support/RequestList.js +121 -121
- package/dist/shared/components/support/SupportAnalytics.js +29 -29
- package/dist/shared/lib/activity-sentence.js +316 -278
- package/dist/shared/lib/format-value.js +5 -4
- package/dist/shared/lib/number-format.js +87 -0
- package/dist/shared/lib/number-kind.js +133 -0
- package/dist/shared/lib/utils.js +24 -20
- package/dist/shared/lib/watch-list.js +1 -1
- package/dist/shared/lib/widget-value-format.js +26 -12
- package/package.json +1 -1
|
@@ -1,34 +1,36 @@
|
|
|
1
1
|
import { jsx as e, jsxs as x, Fragment as Bt } from "react/jsx-runtime";
|
|
2
|
-
import { useQuery as
|
|
2
|
+
import { useQuery as me, useQueryClient as Ut } from "@tanstack/react-query";
|
|
3
3
|
import * as Pt from "lucide-react";
|
|
4
4
|
import { ChevronDown as Mt, Loader2 as Gt, User as It, Mail as Tt } from "lucide-react";
|
|
5
|
-
import ut, { useContext as Vt, useState as re, useRef as
|
|
6
|
-
import { RelationPathDataContext as Ct, useDrilldown as
|
|
5
|
+
import ut, { useContext as Vt, useState as re, useRef as pe, useEffect as Q, memo as Et } from "react";
|
|
6
|
+
import { RelationPathDataContext as Ct, useDrilldown as mt, fieldDrilldownConfig as Rt, useOptionalNivaroClient as fe, useNavigation as Jt } from "../../context.js";
|
|
7
7
|
import { OPEN_SECTION_EVENT as tt } from "../../lib/co-edit.js";
|
|
8
|
-
import { get as
|
|
9
|
-
import { useCountStep as
|
|
10
|
-
import { planFieldGrid as
|
|
8
|
+
import { get as pt, post as zt } from "../../lib/commands.js";
|
|
9
|
+
import { useCountStep as Kt, countLabel as je } from "../../lib/count-step.js";
|
|
10
|
+
import { planFieldGrid as Ht, isEmptyValue as Wt, isFolded as At, readGroupStructure as Yt } from "../../lib/form-structure.js";
|
|
11
11
|
import { reportSectionUse as ft } from "../../lib/form-usage-beacon.js";
|
|
12
|
+
import { formatFieldNumber as Qt } from "../../lib/number-format.js";
|
|
12
13
|
import { useRecordReader as ht } from "../../lib/record-loader.js";
|
|
13
|
-
import { useStartsOpen as
|
|
14
|
-
import { formatDate as ue, formatDateTime as bt, choiceLabel as
|
|
14
|
+
import { useStartsOpen as Zt } from "../../lib/use-starts-open.js";
|
|
15
|
+
import { formatDate as ue, formatDateTime as bt, choiceLabel as Xt, titleCase as xt, cn as W, toLocalDateString as Le, formatNumber as en } from "../../lib/utils.js";
|
|
15
16
|
import { LiveCount as yt } from "../LiveCount.js";
|
|
16
|
-
import { DesignDropZone as
|
|
17
|
-
import { useLayoutDesign as
|
|
17
|
+
import { DesignDropZone as tn, designWrap as nn } from "../layout-editor/DesignNode.js";
|
|
18
|
+
import { useLayoutDesign as rn, revealGroupKey as sn } from "../layout-editor/design-context.js";
|
|
18
19
|
import { GridGuides as Fe } from "../layout-editor/grid-guides.js";
|
|
19
|
-
import { UserAvatar as
|
|
20
|
-
import { DropdownMenu as
|
|
20
|
+
import { UserAvatar as ln } from "../UserAvatar.js";
|
|
21
|
+
import { DropdownMenu as an, DropdownMenuTrigger as on, DropdownMenuContent as cn, DropdownMenuItem as nt } from "../ui/dropdown-menu.js";
|
|
21
22
|
import { WidgetSlot as rt } from "../WidgetSlot.js";
|
|
22
23
|
import { FieldRow as Oe } from "./FieldRow.js";
|
|
23
|
-
import { useFormHelpVideos as
|
|
24
|
-
import { FoldArea as
|
|
25
|
-
import { applyDisplayTemplate as
|
|
26
|
-
import { SectionIntro as
|
|
27
|
-
import { invalidateM2MFor as
|
|
28
|
-
import { groupSectionPropsEqual as
|
|
29
|
-
import { SectionPresence as
|
|
30
|
-
import { UserChip as gt, OwnersInline as st, OwnersInlineCompact as
|
|
31
|
-
import { UserRosterCluster as
|
|
24
|
+
import { useFormHelpVideos as dn, FormHelpVideoButton as un } from "./FormHelpVideoButton.js";
|
|
25
|
+
import { FoldArea as mn, RowGroupCell as pn, rowMemberField as fn } from "./form-structure-ui.js";
|
|
26
|
+
import { applyDisplayTemplate as hn, useContainerWidth as bn, resolveColSpan as it } from "./helpers.js";
|
|
27
|
+
import { SectionIntro as xn } from "./LayoutContentBlock.js";
|
|
28
|
+
import { invalidateM2MFor as yn } from "./m2m-invalidate.js";
|
|
29
|
+
import { groupSectionPropsEqual as gn } from "./render-stability.js";
|
|
30
|
+
import { SectionPresence as Nn } from "./SectionPresence.js";
|
|
31
|
+
import { UserChip as gt, OwnersInline as st, OwnersInlineCompact as _n } from "./UserChip.js";
|
|
32
|
+
import { UserRosterCluster as ur } from "./UserChip.js";
|
|
33
|
+
import { numberKindOf as wn } from "../../lib/number-kind.js";
|
|
32
34
|
function lt(n) {
|
|
33
35
|
if (typeof n != "string") return n ?? [];
|
|
34
36
|
try {
|
|
@@ -37,81 +39,81 @@ function lt(n) {
|
|
|
37
39
|
return [];
|
|
38
40
|
}
|
|
39
41
|
}
|
|
40
|
-
function
|
|
42
|
+
function vn({
|
|
41
43
|
relCollection: n,
|
|
42
44
|
relId: t,
|
|
43
45
|
entries: i,
|
|
44
|
-
separator:
|
|
46
|
+
separator: a
|
|
45
47
|
}) {
|
|
46
|
-
const l = fe(), c = ht(), r = String(t), f = i.some((g) => g.field.includes(".")) ? ["id", ...i.map((g) => g.field)].join(",") : null, { data:
|
|
48
|
+
const l = fe(), c = ht(), r = String(t), f = i.some((g) => g.field.includes(".")) ? ["id", ...i.map((g) => g.field)].join(",") : null, { data: p } = me({
|
|
47
49
|
queryKey: ["inline-display", n, r, f],
|
|
48
50
|
queryFn: () => c(n, r, f),
|
|
49
51
|
enabled: !!l && !!r,
|
|
50
52
|
staleTime: 6e4
|
|
51
53
|
});
|
|
52
|
-
if (!
|
|
53
|
-
const
|
|
54
|
-
let h =
|
|
55
|
-
for (const
|
|
54
|
+
if (!p) return null;
|
|
55
|
+
const v = (g) => {
|
|
56
|
+
let h = p;
|
|
57
|
+
for (const k of g.split(".")) {
|
|
56
58
|
if (h == null || typeof h != "object") return;
|
|
57
|
-
h = h[
|
|
59
|
+
h = h[k];
|
|
58
60
|
}
|
|
59
61
|
return h;
|
|
60
62
|
};
|
|
61
|
-
if (
|
|
63
|
+
if (a != null) {
|
|
62
64
|
const g = (d) => {
|
|
63
|
-
const y =
|
|
65
|
+
const y = v(d.field);
|
|
64
66
|
if (y == null || y === "") return null;
|
|
65
|
-
const
|
|
66
|
-
if (
|
|
67
|
+
const S = d.format ?? "text";
|
|
68
|
+
if (S === "date" || S === "datetime")
|
|
67
69
|
try {
|
|
68
70
|
return Le(y);
|
|
69
71
|
} catch {
|
|
70
72
|
return String(y);
|
|
71
73
|
}
|
|
72
|
-
return
|
|
74
|
+
return S === "boolean" ? y ? "Yes" : "No" : String(y);
|
|
73
75
|
}, h = [];
|
|
74
|
-
let
|
|
76
|
+
let k = [];
|
|
75
77
|
for (const d of i)
|
|
76
|
-
d.line_break &&
|
|
77
|
-
|
|
78
|
+
d.line_break && k.length > 0 ? (h.push(k), k = [d]) : k.push(d);
|
|
79
|
+
k.length > 0 && h.push(k);
|
|
78
80
|
const j = h.map(
|
|
79
81
|
(d) => d.map((y) => {
|
|
80
|
-
const
|
|
81
|
-
return
|
|
82
|
+
const S = g(y);
|
|
83
|
+
return S ? { label: y.label ?? null, display: S } : null;
|
|
82
84
|
}).filter(Boolean)
|
|
83
85
|
).filter((d) => d.length > 0);
|
|
84
86
|
return j.length === 0 ? null : /* @__PURE__ */ e("div", { className: "mt-1", children: j.map((d, y) => (
|
|
85
87
|
// biome-ignore lint/suspicious/noArrayIndexKey: stable line order
|
|
86
|
-
/* @__PURE__ */ e("p", { className: "text-[12px] text-slate-500 dark:text-slate-400", children: d.map((
|
|
88
|
+
/* @__PURE__ */ e("p", { className: "text-[12px] text-slate-500 dark:text-slate-400", children: d.map((S, F) => (
|
|
87
89
|
// biome-ignore lint/suspicious/noArrayIndexKey: stable token order
|
|
88
90
|
/* @__PURE__ */ x(ut.Fragment, { children: [
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
91
|
+
F > 0 && a,
|
|
92
|
+
S.label && /* @__PURE__ */ x("span", { className: "font-semibold text-slate-600 dark:text-slate-300", children: [
|
|
93
|
+
S.label,
|
|
92
94
|
":"
|
|
93
95
|
] }),
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
] },
|
|
96
|
+
S.label ? " " : "",
|
|
97
|
+
S.display
|
|
98
|
+
] }, F)
|
|
97
99
|
)) }, y)
|
|
98
100
|
)) });
|
|
99
101
|
}
|
|
100
|
-
const
|
|
101
|
-
const h =
|
|
102
|
+
const D = i.map((g) => {
|
|
103
|
+
const h = v(g.field);
|
|
102
104
|
if (h == null || h === "") return null;
|
|
103
|
-
const
|
|
105
|
+
const k = g.format ?? "text";
|
|
104
106
|
let j;
|
|
105
|
-
if (
|
|
107
|
+
if (k === "date" || k === "datetime")
|
|
106
108
|
try {
|
|
107
109
|
j = Le(h);
|
|
108
110
|
} catch {
|
|
109
111
|
j = String(h);
|
|
110
112
|
}
|
|
111
|
-
else
|
|
113
|
+
else k === "boolean" ? j = h ? "Yes" : "No" : j = String(h);
|
|
112
114
|
return { label: g.label, display: j };
|
|
113
115
|
}).filter(Boolean);
|
|
114
|
-
return
|
|
116
|
+
return D.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: D.map((g, h) => (
|
|
115
117
|
// biome-ignore lint/suspicious/noArrayIndexKey: stable order from config
|
|
116
118
|
/* @__PURE__ */ x("div", { className: "flex items-baseline gap-2", children: [
|
|
117
119
|
g.label && /* @__PURE__ */ e("span", { className: "shrink-0 min-w-[56px] text-[10px] font-medium text-slate-400", children: g.label }),
|
|
@@ -119,9 +121,9 @@ function Nn({
|
|
|
119
121
|
] }, h)
|
|
120
122
|
)) });
|
|
121
123
|
}
|
|
122
|
-
function
|
|
124
|
+
function kn(n) {
|
|
123
125
|
if (!n) return null;
|
|
124
|
-
const t = n.replace(/(^|-)([a-z])/g, (
|
|
126
|
+
const t = n.replace(/(^|-)([a-z])/g, (a, l, c) => c.toUpperCase()), i = Pt[t];
|
|
125
127
|
return i || null;
|
|
126
128
|
}
|
|
127
129
|
function at(n) {
|
|
@@ -136,7 +138,7 @@ function at(n) {
|
|
|
136
138
|
function qe(n, t) {
|
|
137
139
|
if (n == null || n === "") return "—";
|
|
138
140
|
if (typeof n == "boolean") return n ? "Yes" : "No";
|
|
139
|
-
const i = (t == null ? void 0 : t.interface) ?? "",
|
|
141
|
+
const i = (t == null ? void 0 : t.interface) ?? "", a = (() => {
|
|
140
142
|
try {
|
|
141
143
|
const r = t != null && t.options ? JSON.parse(String(t.options)) : null;
|
|
142
144
|
return (r == null ? void 0 : r.display_format) ?? null;
|
|
@@ -144,17 +146,21 @@ function qe(n, t) {
|
|
|
144
146
|
return null;
|
|
145
147
|
}
|
|
146
148
|
})();
|
|
147
|
-
if (
|
|
149
|
+
if (a) {
|
|
148
150
|
const r = Number(n);
|
|
149
|
-
if (
|
|
151
|
+
if (a === "currency" && Number.isFinite(r))
|
|
150
152
|
return r.toLocaleString(void 0, { style: "currency", currency: "USD" });
|
|
151
|
-
if (
|
|
152
|
-
if (/^0\.0+$/.test(
|
|
153
|
-
|
|
153
|
+
if (a === "percent" && Number.isFinite(r)) return `${(r * 100).toFixed(1)}%`;
|
|
154
|
+
if (/^0\.0+$/.test(a) && Number.isFinite(r))
|
|
155
|
+
return r.toLocaleString(void 0, {
|
|
156
|
+
minimumFractionDigits: a.length - 2,
|
|
157
|
+
maximumFractionDigits: a.length - 2
|
|
158
|
+
});
|
|
159
|
+
if (a === "date" && typeof n == "string") {
|
|
154
160
|
const s = n.length === 10 ? /* @__PURE__ */ new Date(`${n}T00:00:00`) : new Date(n);
|
|
155
161
|
if (!Number.isNaN(s.getTime())) return ue(n);
|
|
156
162
|
}
|
|
157
|
-
if (
|
|
163
|
+
if (a === "datetime" && typeof n == "string") {
|
|
158
164
|
const s = new Date(n);
|
|
159
165
|
if (!Number.isNaN(s.getTime())) return s.toLocaleString();
|
|
160
166
|
}
|
|
@@ -204,24 +210,24 @@ function qe(n, t) {
|
|
|
204
210
|
if ((i === "select-dropdown" || i === "radio-buttons") && t) {
|
|
205
211
|
const s = at(t).choices;
|
|
206
212
|
if (Array.isArray(s)) {
|
|
207
|
-
const f = s.find((
|
|
208
|
-
if (f) return
|
|
213
|
+
const f = s.find((p) => String(p.value) === l);
|
|
214
|
+
if (f) return Xt(f.text);
|
|
209
215
|
}
|
|
210
216
|
}
|
|
211
217
|
const c = Number(l);
|
|
212
218
|
if (!Number.isNaN(c) && l !== "" && t) {
|
|
213
219
|
const r = at(t), s = r.format, f = typeof r.unit == "string" ? r.unit.trim() : "";
|
|
214
220
|
if (f && !s) {
|
|
215
|
-
const
|
|
221
|
+
const v = new Intl.NumberFormat(void 0, { maximumFractionDigits: 2 }).format(c);
|
|
216
222
|
if (f === "$")
|
|
217
223
|
try {
|
|
218
224
|
return new Intl.NumberFormat(void 0, { style: "currency", currency: "USD" }).format(
|
|
219
225
|
c
|
|
220
226
|
);
|
|
221
227
|
} catch {
|
|
222
|
-
return `$${
|
|
228
|
+
return `$${v}`;
|
|
223
229
|
}
|
|
224
|
-
return f === "%" ? `${
|
|
230
|
+
return f === "%" ? `${v}%` : `${v} ${f}`;
|
|
225
231
|
}
|
|
226
232
|
if (s === "currency")
|
|
227
233
|
try {
|
|
@@ -234,28 +240,31 @@ function qe(n, t) {
|
|
|
234
240
|
if (s === "int")
|
|
235
241
|
return new Intl.NumberFormat(void 0, { maximumFractionDigits: 0 }).format(c);
|
|
236
242
|
if (s === "decimal") {
|
|
237
|
-
const
|
|
243
|
+
const v = typeof r.precision == "number" ? r.precision : 2;
|
|
238
244
|
return new Intl.NumberFormat(void 0, {
|
|
239
|
-
minimumFractionDigits:
|
|
240
|
-
maximumFractionDigits:
|
|
245
|
+
minimumFractionDigits: v,
|
|
246
|
+
maximumFractionDigits: v
|
|
241
247
|
}).format(c);
|
|
242
248
|
}
|
|
249
|
+
const p = wn(t);
|
|
250
|
+
if (p && p !== "plain" || !p && typeof n == "number")
|
|
251
|
+
return Qt(n, t) || l;
|
|
243
252
|
}
|
|
244
253
|
return !l.includes(" ") && !l.includes("@") && !/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(l) && !/^\d+$/.test(l) && (l.includes("_") || l.includes("-") || /^[a-z]/.test(l)) ? xt(l) : l;
|
|
245
254
|
}
|
|
246
255
|
function ot({ userId: n }) {
|
|
247
|
-
const t = fe(), { navigate: i, userUrl:
|
|
256
|
+
const t = fe(), { navigate: i, userUrl: a } = Jt(), l = a ? a(n) : `/users/${n}`, { data: c } = me({
|
|
248
257
|
queryKey: ["user-chip", n],
|
|
249
258
|
queryFn: () => t.request(
|
|
250
|
-
|
|
259
|
+
pt(`/users/${n}`)
|
|
251
260
|
).then((f) => f.data ?? null),
|
|
252
261
|
enabled: !!t && !!n,
|
|
253
262
|
staleTime: 12e4
|
|
254
263
|
}), r = c ? [c.first_name, c.last_name].filter(Boolean).join(" ") || c.email : n, s = r.split(" ").map((f) => f[0]).filter(Boolean).slice(0, 2).join("").toUpperCase();
|
|
255
|
-
return /* @__PURE__ */ x(
|
|
256
|
-
/* @__PURE__ */ e(
|
|
264
|
+
return /* @__PURE__ */ x(an, { children: [
|
|
265
|
+
/* @__PURE__ */ e(on, { 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: [
|
|
257
266
|
/* @__PURE__ */ e(
|
|
258
|
-
|
|
267
|
+
ln,
|
|
259
268
|
{
|
|
260
269
|
userId: n,
|
|
261
270
|
className: "h-4 w-4",
|
|
@@ -264,7 +273,7 @@ function ot({ userId: n }) {
|
|
|
264
273
|
),
|
|
265
274
|
/* @__PURE__ */ e("span", { className: "text-[11px] text-slate-600", children: r })
|
|
266
275
|
] }) }),
|
|
267
|
-
/* @__PURE__ */ x(
|
|
276
|
+
/* @__PURE__ */ x(cn, { align: "start", className: "text-[12px]", children: [
|
|
268
277
|
l && /* @__PURE__ */ x(
|
|
269
278
|
nt,
|
|
270
279
|
{
|
|
@@ -292,39 +301,39 @@ function ot({ userId: n }) {
|
|
|
292
301
|
] })
|
|
293
302
|
] });
|
|
294
303
|
}
|
|
295
|
-
function
|
|
304
|
+
function Sn({
|
|
296
305
|
collection: n,
|
|
297
306
|
itemId: t,
|
|
298
307
|
layoutId: i,
|
|
299
|
-
attachField:
|
|
308
|
+
attachField: a,
|
|
300
309
|
filenameTemplate: l,
|
|
301
310
|
label: c
|
|
302
311
|
}) {
|
|
303
|
-
const r = fe(), s = Ut(), [f,
|
|
304
|
-
if (!(!r || f || !
|
|
305
|
-
|
|
312
|
+
const r = fe(), s = Ut(), [f, p] = re(!1), v = async () => {
|
|
313
|
+
if (!(!r || f || !a)) {
|
|
314
|
+
p(!0);
|
|
306
315
|
try {
|
|
307
316
|
await r.request(
|
|
308
317
|
zt(`/collection-layouts/${i}/generate-and-attach`, {
|
|
309
318
|
collection: n,
|
|
310
319
|
item_id: t,
|
|
311
|
-
attach_field:
|
|
320
|
+
attach_field: a,
|
|
312
321
|
filename_template: l ?? void 0
|
|
313
322
|
})
|
|
314
|
-
),
|
|
323
|
+
), yn(s, [t]), s.invalidateQueries({ queryKey: ["item", n, t] });
|
|
315
324
|
} catch {
|
|
316
325
|
} finally {
|
|
317
|
-
|
|
326
|
+
p(!1);
|
|
318
327
|
}
|
|
319
328
|
}
|
|
320
|
-
},
|
|
329
|
+
}, D = !a;
|
|
321
330
|
return /* @__PURE__ */ x(
|
|
322
331
|
"button",
|
|
323
332
|
{
|
|
324
333
|
type: "button",
|
|
325
|
-
onClick:
|
|
326
|
-
disabled: f ||
|
|
327
|
-
title:
|
|
334
|
+
onClick: v,
|
|
335
|
+
disabled: f || D,
|
|
336
|
+
title: D ? "Configure PDF field in Data Model → Layouts" : void 0,
|
|
328
337
|
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",
|
|
329
338
|
children: [
|
|
330
339
|
/* @__PURE__ */ x(
|
|
@@ -355,26 +364,26 @@ function ie({
|
|
|
355
364
|
className: i
|
|
356
365
|
}) {
|
|
357
366
|
var h;
|
|
358
|
-
const
|
|
367
|
+
const a = fe(), l = ht(), c = t != null && t !== "" ? String(t) : null, { data: r } = me({
|
|
359
368
|
queryKey: ["col-meta-dt", n],
|
|
360
|
-
queryFn: () =>
|
|
361
|
-
|
|
362
|
-
).then((
|
|
363
|
-
enabled: !!
|
|
369
|
+
queryFn: () => a.request(
|
|
370
|
+
pt(`/collections/${n}`)
|
|
371
|
+
).then((k) => k.data).catch(() => ({})),
|
|
372
|
+
enabled: !!a && !!c,
|
|
364
373
|
staleTime: 3e5
|
|
365
|
-
}), s = (((h = r == null ? void 0 : r.display_template) == null ? void 0 : h.match(/\{\{\s*[^}]+?\s*\}\}/g)) ?? []).map((
|
|
374
|
+
}), s = (((h = r == null ? void 0 : r.display_template) == null ? void 0 : h.match(/\{\{\s*[^}]+?\s*\}\}/g)) ?? []).map((k) => k.replace(/[{}\s]/g, "")).filter((k) => k.includes(".")), f = s.length ? ["id", ...s].join(",") : null, { data: p, isLoading: v } = me({
|
|
366
375
|
queryKey: ["rel-display", n, c, f],
|
|
367
376
|
queryFn: () => l(n, c, f),
|
|
368
|
-
enabled: !!
|
|
377
|
+
enabled: !!a && !!c && r !== void 0,
|
|
369
378
|
staleTime: 6e4
|
|
370
379
|
});
|
|
371
380
|
if (!c) return /* @__PURE__ */ e("span", { children: "—" });
|
|
372
|
-
if (
|
|
381
|
+
if (v || a && r === void 0)
|
|
373
382
|
return /* @__PURE__ */ e("span", { className: "animate-pulse h-3 w-20 rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))] inline-block" });
|
|
374
|
-
const
|
|
375
|
-
if (!
|
|
376
|
-
const g = r != null && r.display_template ?
|
|
377
|
-
return /* @__PURE__ */ e("span", { className:
|
|
383
|
+
const D = i ?? "text-[13px] text-slate-700";
|
|
384
|
+
if (!p) return /* @__PURE__ */ e("span", { className: D, children: c });
|
|
385
|
+
const g = r != null && r.display_template ? hn(r.display_template, p) : String(p.name ?? p.title ?? p.label ?? p.display_name ?? c);
|
|
386
|
+
return /* @__PURE__ */ e("span", { className: D, children: g });
|
|
378
387
|
}
|
|
379
388
|
function ct({ userId: n }) {
|
|
380
389
|
return /* @__PURE__ */ e(gt, { userId: n, size: "compact" });
|
|
@@ -384,13 +393,13 @@ function dt({
|
|
|
384
393
|
id: t,
|
|
385
394
|
drillConfig: i
|
|
386
395
|
}) {
|
|
387
|
-
const
|
|
388
|
-
return !
|
|
396
|
+
const a = mt(), l = /* @__PURE__ */ e(ie, { relCollection: n, id: t });
|
|
397
|
+
return !a || t == null || t === "" ? l : /* @__PURE__ */ e(
|
|
389
398
|
"button",
|
|
390
399
|
{
|
|
391
400
|
type: "button",
|
|
392
401
|
onClick: (r) => {
|
|
393
|
-
r.stopPropagation(),
|
|
402
|
+
r.stopPropagation(), a.open({
|
|
394
403
|
collection: n,
|
|
395
404
|
itemId: String(t),
|
|
396
405
|
layoutId: (i == null ? void 0 : i.layout_id) ?? null,
|
|
@@ -411,12 +420,12 @@ function dt({
|
|
|
411
420
|
}
|
|
412
421
|
);
|
|
413
422
|
}
|
|
414
|
-
function
|
|
415
|
-
const [t, i] = re(!1),
|
|
423
|
+
function $n(n) {
|
|
424
|
+
const [t, i] = re(!1), a = pe(!0), l = pe(JSON.stringify(n ?? null));
|
|
416
425
|
return Q(() => {
|
|
417
426
|
const c = JSON.stringify(n ?? null);
|
|
418
|
-
if (
|
|
419
|
-
|
|
427
|
+
if (a.current) {
|
|
428
|
+
a.current = !1, l.current = c;
|
|
420
429
|
return;
|
|
421
430
|
}
|
|
422
431
|
if (c === l.current) return;
|
|
@@ -427,34 +436,34 @@ function vn(n) {
|
|
|
427
436
|
};
|
|
428
437
|
}, [n]), t ? "nvr-value-pulse" : "";
|
|
429
438
|
}
|
|
430
|
-
function
|
|
439
|
+
function ar({
|
|
431
440
|
field: n,
|
|
432
441
|
val: t,
|
|
433
442
|
relations: i,
|
|
434
|
-
collection:
|
|
443
|
+
collection: a,
|
|
435
444
|
displayFormat: l,
|
|
436
445
|
textClassName: c
|
|
437
446
|
}) {
|
|
438
447
|
var j;
|
|
439
|
-
const r =
|
|
440
|
-
(d) => d.one_collection ===
|
|
448
|
+
const r = $n(t), s = (j = Vt(Ct)) == null ? void 0 : j[n.field], f = mt(), p = W(c ?? "text-[13px] text-slate-900 dark:text-slate-100", r), v = Rt(n) ?? { enabled: !0, layout_id: null, width: null }, D = i.find(
|
|
449
|
+
(d) => d.one_collection === a && d.one_field === n.field && d.junction_field
|
|
441
450
|
);
|
|
442
|
-
if (
|
|
451
|
+
if (D) {
|
|
443
452
|
const d = i.find(
|
|
444
|
-
(
|
|
445
|
-
), y = d == null ? void 0 : d.one_collection,
|
|
446
|
-
return !y ||
|
|
453
|
+
(F) => F.many_collection === D.many_collection && F.many_field === D.junction_field
|
|
454
|
+
), y = d == null ? void 0 : d.one_collection, S = Array.isArray(t) ? t : t != null && t !== "" ? [t] : [];
|
|
455
|
+
return !y || S.length === 0 ? /* @__PURE__ */ e("span", { className: "text-slate-300 dark:text-slate-600", children: "—" }) : y === "nivaro_users" ? /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1 gap-y-0.5", children: S.map((F) => /* @__PURE__ */ e(ct, { userId: String(F) }, String(F))) }) : /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1.5", children: S.map((F) => /* @__PURE__ */ e(
|
|
447
456
|
dt,
|
|
448
457
|
{
|
|
449
458
|
relCollection: y,
|
|
450
|
-
id:
|
|
451
|
-
drillConfig:
|
|
459
|
+
id: F,
|
|
460
|
+
drillConfig: v
|
|
452
461
|
},
|
|
453
|
-
String(
|
|
462
|
+
String(F)
|
|
454
463
|
)) });
|
|
455
464
|
}
|
|
456
465
|
const g = i.find(
|
|
457
|
-
(d) => d.many_collection ===
|
|
466
|
+
(d) => d.many_collection === a && d.many_field === n.field && !d.junction_field
|
|
458
467
|
);
|
|
459
468
|
if (g != null && g.one_collection) {
|
|
460
469
|
const d = Array.isArray(t) ? t : t != null && t !== "" ? [t] : [];
|
|
@@ -463,7 +472,7 @@ function nr({
|
|
|
463
472
|
{
|
|
464
473
|
relCollection: g.one_collection,
|
|
465
474
|
id: y,
|
|
466
|
-
drillConfig:
|
|
475
|
+
drillConfig: v
|
|
467
476
|
},
|
|
468
477
|
String(y)
|
|
469
478
|
)) });
|
|
@@ -473,32 +482,32 @@ function nr({
|
|
|
473
482
|
if (l && l !== "text") {
|
|
474
483
|
const d = Number(t);
|
|
475
484
|
if (l === "currency" && !isNaN(d))
|
|
476
|
-
return /* @__PURE__ */ e("span", { className: `font-semibold ${
|
|
485
|
+
return /* @__PURE__ */ e("span", { className: `font-semibold ${p}`, children: new Intl.NumberFormat(void 0, {
|
|
477
486
|
style: "currency",
|
|
478
487
|
currency: "USD",
|
|
479
488
|
minimumFractionDigits: 2
|
|
480
489
|
}).format(d) });
|
|
481
490
|
if (l === "integer" && !isNaN(d))
|
|
482
|
-
return /* @__PURE__ */ e("span", { className: `font-semibold ${
|
|
491
|
+
return /* @__PURE__ */ e("span", { className: `font-semibold ${p}`, children: new Intl.NumberFormat(void 0, { maximumFractionDigits: 0 }).format(Math.round(d)) });
|
|
483
492
|
if (l === "decimal" && !isNaN(d))
|
|
484
|
-
return /* @__PURE__ */ e("span", { className: `font-semibold ${
|
|
493
|
+
return /* @__PURE__ */ e("span", { className: `font-semibold ${p}`, children: new Intl.NumberFormat(void 0, { maximumFractionDigits: 2 }).format(d) });
|
|
485
494
|
if (l === "percent" && !isNaN(d))
|
|
486
|
-
return /* @__PURE__ */ e("span", { className: `font-semibold ${
|
|
495
|
+
return /* @__PURE__ */ e("span", { className: `font-semibold ${p}`, children: new Intl.NumberFormat(void 0, { style: "percent", maximumFractionDigits: 1 }).format(
|
|
487
496
|
d / 100
|
|
488
497
|
) });
|
|
489
498
|
if (l === "date")
|
|
490
499
|
try {
|
|
491
|
-
return /* @__PURE__ */ e("span", { className: `font-semibold ${
|
|
500
|
+
return /* @__PURE__ */ e("span", { className: `font-semibold ${p}`, children: ue(t) || Le(t) });
|
|
492
501
|
} catch {
|
|
493
502
|
}
|
|
494
503
|
if (l === "datetime")
|
|
495
504
|
try {
|
|
496
|
-
return /* @__PURE__ */ e("span", { className: `font-semibold ${
|
|
505
|
+
return /* @__PURE__ */ e("span", { className: `font-semibold ${p}`, children: bt(String(t)) });
|
|
497
506
|
} catch {
|
|
498
507
|
}
|
|
499
508
|
}
|
|
500
|
-
const h = /* @__PURE__ */ e("span", { className: `font-semibold ${
|
|
501
|
-
if (f &&
|
|
509
|
+
const h = /* @__PURE__ */ e("span", { className: `font-semibold ${p}`, children: qe(t, n) }), k = s == null ? void 0 : s.target_collection;
|
|
510
|
+
if (f && k && (s == null ? void 0 : s.ids.length) === 1) {
|
|
502
511
|
const d = s.ids[0];
|
|
503
512
|
return /* @__PURE__ */ e(
|
|
504
513
|
"button",
|
|
@@ -506,7 +515,7 @@ function nr({
|
|
|
506
515
|
type: "button",
|
|
507
516
|
"data-header-path-link": "",
|
|
508
517
|
onClick: (y) => {
|
|
509
|
-
y.stopPropagation(), f.open({ collection:
|
|
518
|
+
y.stopPropagation(), f.open({ collection: k, itemId: String(d), layoutId: null, width: "85%" });
|
|
510
519
|
},
|
|
511
520
|
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",
|
|
512
521
|
children: h
|
|
@@ -515,8 +524,8 @@ function nr({
|
|
|
515
524
|
}
|
|
516
525
|
return h;
|
|
517
526
|
}
|
|
518
|
-
function
|
|
519
|
-
const t =
|
|
527
|
+
function Dn({ value: n }) {
|
|
528
|
+
const t = Kt(n);
|
|
520
529
|
return /* @__PURE__ */ x(
|
|
521
530
|
"span",
|
|
522
531
|
{
|
|
@@ -541,38 +550,38 @@ function kn({ value: n }) {
|
|
|
541
550
|
}
|
|
542
551
|
);
|
|
543
552
|
}
|
|
544
|
-
function
|
|
553
|
+
function Fn({
|
|
545
554
|
summaryFields: n,
|
|
546
555
|
fields: t,
|
|
547
556
|
draft: i,
|
|
548
|
-
relations:
|
|
557
|
+
relations: a,
|
|
549
558
|
collection: l,
|
|
550
559
|
itemId: c,
|
|
551
560
|
ownersCollection: r,
|
|
552
561
|
ownersItemId: s,
|
|
553
562
|
ownersAssignment: f,
|
|
554
|
-
m2mCounts:
|
|
555
|
-
o2mCounts:
|
|
556
|
-
o2mAggValues:
|
|
563
|
+
m2mCounts: p,
|
|
564
|
+
o2mCounts: v,
|
|
565
|
+
o2mAggValues: D,
|
|
557
566
|
summaryAggConfigs: g,
|
|
558
567
|
o2mLoading: h,
|
|
559
|
-
hideEmpty:
|
|
568
|
+
hideEmpty: k
|
|
560
569
|
}) {
|
|
561
|
-
const j = n.map((N) => typeof N == "string" ? N : N.field), d =
|
|
562
|
-
if (N === "__owners__" || h != null && h.has(N) ||
|
|
563
|
-
if (
|
|
564
|
-
if (
|
|
570
|
+
const j = n.map((N) => typeof N == "string" ? N : N.field), d = k ? j.filter((N) => {
|
|
571
|
+
if (N === "__owners__" || h != null && h.has(N) || D && N in D) return !0;
|
|
572
|
+
if (p && N in p) return (p[N] ?? 0) > 0;
|
|
573
|
+
if (v && N in v) return (v[N] ?? 0) > 0;
|
|
565
574
|
const G = i[N];
|
|
566
575
|
return G != null && G !== "" && !(Array.isArray(G) && G.length === 0);
|
|
567
576
|
}) : j;
|
|
568
577
|
if (d.length === 0) return null;
|
|
569
|
-
const y = "text-[9px] font-semibold uppercase tracking-wider text-slate-400 dark:text-slate-500 shrink-0",
|
|
578
|
+
const y = "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", F = "text-[12px] text-slate-300 dark:text-slate-600", J = "flex items-baseline gap-1.5", z = (N) => {
|
|
570
579
|
if (N === "__owners__") {
|
|
571
580
|
const m = (f == null ? void 0 : f.label_override) || "Owners";
|
|
572
581
|
return /* @__PURE__ */ x("div", { className: "flex items-center gap-1.5", children: [
|
|
573
582
|
/* @__PURE__ */ e("span", { className: y, children: m }),
|
|
574
583
|
/* @__PURE__ */ e(
|
|
575
|
-
|
|
584
|
+
_n,
|
|
576
585
|
{
|
|
577
586
|
collection: r ?? l,
|
|
578
587
|
itemId: s ?? c
|
|
@@ -580,17 +589,17 @@ function Sn({
|
|
|
580
589
|
)
|
|
581
590
|
] });
|
|
582
591
|
}
|
|
583
|
-
const G = n.find((m) => (typeof m == "string" ? m : m.field) === N), he = G && typeof G != "string" ? G.label : void 0,
|
|
592
|
+
const G = n.find((m) => (typeof m == "string" ? m : m.field) === N), he = G && typeof G != "string" ? G.label : void 0, K = t.find((m) => m.field === N), V = he || (K == null ? void 0 : K.label) || N.replace(/_/g, " ").replace(/\b\w/g, (m) => m.toUpperCase());
|
|
584
593
|
if (h != null && h.has(N))
|
|
585
594
|
return /* @__PURE__ */ x("div", { className: "flex items-center gap-1.5", children: [
|
|
586
595
|
/* @__PURE__ */ e("span", { className: y, children: V }),
|
|
587
596
|
/* @__PURE__ */ e(Gt, { className: "h-3 w-3 animate-spin text-slate-300" })
|
|
588
597
|
] });
|
|
589
|
-
if (
|
|
590
|
-
const m = g == null ? void 0 : g[N], U = (m == null ? void 0 : m.label) || V, B =
|
|
598
|
+
if (D && N in D) {
|
|
599
|
+
const m = g == null ? void 0 : g[N], U = (m == null ? void 0 : m.label) || V, B = D[N];
|
|
591
600
|
let P;
|
|
592
601
|
if ((m == null ? void 0 : m.agg) === "count")
|
|
593
|
-
P =
|
|
602
|
+
P = en(B);
|
|
594
603
|
else {
|
|
595
604
|
const A = m != null && m.field_options ? (() => {
|
|
596
605
|
try {
|
|
@@ -621,48 +630,48 @@ function Sn({
|
|
|
621
630
|
}
|
|
622
631
|
return /* @__PURE__ */ x("div", { className: J, children: [
|
|
623
632
|
/* @__PURE__ */ e("span", { className: y, children: U }),
|
|
624
|
-
/* @__PURE__ */ e("span", { className:
|
|
633
|
+
/* @__PURE__ */ e("span", { className: S, children: P })
|
|
625
634
|
] });
|
|
626
635
|
}
|
|
627
|
-
if (
|
|
628
|
-
const m =
|
|
636
|
+
if (p && N in p) {
|
|
637
|
+
const m = p[N];
|
|
629
638
|
return /* @__PURE__ */ x("div", { className: J, children: [
|
|
630
639
|
/* @__PURE__ */ e("span", { className: y, children: V }),
|
|
631
|
-
/* @__PURE__ */ x("span", { className:
|
|
640
|
+
/* @__PURE__ */ x("span", { className: S, children: [
|
|
632
641
|
m,
|
|
633
642
|
" item",
|
|
634
643
|
m !== 1 ? "s" : ""
|
|
635
644
|
] })
|
|
636
645
|
] });
|
|
637
646
|
}
|
|
638
|
-
if (
|
|
639
|
-
const m =
|
|
647
|
+
if (v && N in v) {
|
|
648
|
+
const m = v[N];
|
|
640
649
|
return /* @__PURE__ */ x("div", { className: J, children: [
|
|
641
650
|
/* @__PURE__ */ e("span", { className: y, children: V }),
|
|
642
|
-
/* @__PURE__ */ x("span", { className:
|
|
651
|
+
/* @__PURE__ */ x("span", { className: S, children: [
|
|
643
652
|
/* @__PURE__ */ e(yt, { value: m, format: (U) => je(Number(U)) }),
|
|
644
653
|
" row",
|
|
645
654
|
m !== 1 ? "s" : ""
|
|
646
655
|
] })
|
|
647
656
|
] });
|
|
648
657
|
}
|
|
649
|
-
const q = i[N], I =
|
|
658
|
+
const q = i[N], I = a.find(
|
|
650
659
|
(m) => m.many_collection === l && m.many_field === N && !m.junction_field
|
|
651
660
|
);
|
|
652
661
|
if (I != null && I.one_collection) {
|
|
653
662
|
const m = Array.isArray(q) ? q : q != null && q !== "" ? [q] : [];
|
|
654
663
|
return /* @__PURE__ */ x("div", { className: J, children: [
|
|
655
664
|
/* @__PURE__ */ e("span", { className: y, children: V }),
|
|
656
|
-
m.length === 0 ? /* @__PURE__ */ e("span", { className:
|
|
665
|
+
m.length === 0 ? /* @__PURE__ */ e("span", { className: F, children: "—" }) : I.one_collection === "nivaro_users" ? /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1.5 gap-y-0.5", children: m.map((U) => /* @__PURE__ */ e(ot, { userId: String(U) }, String(U))) }) : /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1.5", children: m.map((U) => /* @__PURE__ */ e(ie, { relCollection: I.one_collection, id: U }, String(U))) })
|
|
657
666
|
] });
|
|
658
667
|
}
|
|
659
668
|
if (Array.isArray(q)) {
|
|
660
|
-
const m =
|
|
669
|
+
const m = a.find((B) => B.many_field === N && B.junction_field), U = m == null ? void 0 : m.one_collection;
|
|
661
670
|
return /* @__PURE__ */ x("div", { className: J, children: [
|
|
662
671
|
/* @__PURE__ */ e("span", { className: y, children: V }),
|
|
663
|
-
q.length === 0 ? /* @__PURE__ */ e("span", { className:
|
|
672
|
+
q.length === 0 ? /* @__PURE__ */ e("span", { className: F, children: "—" }) : U ? /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1.5 gap-y-0.5", children: q.map(
|
|
664
673
|
(B) => U === "nivaro_users" ? /* @__PURE__ */ e(ot, { userId: String(B) }, String(B)) : /* @__PURE__ */ e(ie, { relCollection: U, id: B }, String(B))
|
|
665
|
-
) }) : /* @__PURE__ */ x("span", { className:
|
|
674
|
+
) }) : /* @__PURE__ */ x("span", { className: S, children: [
|
|
666
675
|
q.length,
|
|
667
676
|
" item",
|
|
668
677
|
q.length !== 1 ? "s" : ""
|
|
@@ -671,7 +680,7 @@ function Sn({
|
|
|
671
680
|
}
|
|
672
681
|
return /* @__PURE__ */ x("div", { className: J, children: [
|
|
673
682
|
/* @__PURE__ */ e("span", { className: y, children: V }),
|
|
674
|
-
q == null || q === "" ? /* @__PURE__ */ e("span", { className:
|
|
683
|
+
q == null || q === "" ? /* @__PURE__ */ e("span", { className: F, children: "—" }) : /* @__PURE__ */ e("span", { className: S, children: qe(q, K) })
|
|
675
684
|
] });
|
|
676
685
|
};
|
|
677
686
|
return /* @__PURE__ */ e(
|
|
@@ -683,32 +692,32 @@ function Sn({
|
|
|
683
692
|
}
|
|
684
693
|
);
|
|
685
694
|
}
|
|
686
|
-
const
|
|
695
|
+
const or = Et(function({
|
|
687
696
|
group: t,
|
|
688
697
|
fields: i,
|
|
689
|
-
draft:
|
|
698
|
+
draft: a,
|
|
690
699
|
onChange: l,
|
|
691
700
|
relations: c,
|
|
692
701
|
collection: r,
|
|
693
702
|
itemId: s,
|
|
694
703
|
errors: f,
|
|
695
|
-
visibleFields:
|
|
696
|
-
lockedFields:
|
|
697
|
-
layoutAiEnabled:
|
|
704
|
+
visibleFields: p,
|
|
705
|
+
lockedFields: v,
|
|
706
|
+
layoutAiEnabled: D,
|
|
698
707
|
displayOnly: g,
|
|
699
708
|
renderField: h,
|
|
700
|
-
onCountChange:
|
|
709
|
+
onCountChange: k,
|
|
701
710
|
isNew: j,
|
|
702
711
|
fieldValues: d,
|
|
703
712
|
isOpen: y,
|
|
704
|
-
onToggle:
|
|
705
|
-
summaryFields:
|
|
713
|
+
onToggle: S,
|
|
714
|
+
summaryFields: F,
|
|
706
715
|
m2mCounts: J,
|
|
707
716
|
o2mCounts: z,
|
|
708
717
|
o2mAggValues: N,
|
|
709
718
|
summaryAggConfigs: G,
|
|
710
719
|
o2mLoading: he,
|
|
711
|
-
footerSlot:
|
|
720
|
+
footerSlot: K,
|
|
712
721
|
ownersCollection: V,
|
|
713
722
|
ownersItemId: q,
|
|
714
723
|
ownersAssignment: I,
|
|
@@ -729,44 +738,44 @@ const rr = Et(function({
|
|
|
729
738
|
onFirstOpen: le
|
|
730
739
|
}) {
|
|
731
740
|
var ze;
|
|
732
|
-
const [Nt, Pe] =
|
|
741
|
+
const [Nt, Pe] = Zt(
|
|
733
742
|
t.is_collapsed == null ? void 0 : !t.is_collapsed,
|
|
734
743
|
!0
|
|
735
|
-
), _t = !Nt, [wt, vt] = re(!1),
|
|
744
|
+
), _t = !Nt, [wt, vt] = re(!1), O = rn(), H = (u, _) => nn(O, u, _, { asChild: !0 }), ae = (u) => ({ kind: "slot", field: u, group_key: t.key }), Me = !!(O != null && O.showHidden), [Ge, Ie] = re({}), { data: ye } = dn(r), ee = (O == null ? void 0 : O.fold) ?? null, te = (O == null ? void 0 : O.reveal) ?? null, [ge, oe] = re(null);
|
|
736
745
|
Q(() => {
|
|
737
746
|
ee && oe(!ee.open);
|
|
738
747
|
}, [ee == null ? void 0 : ee.seq]), Q(() => {
|
|
739
|
-
te &&
|
|
748
|
+
te && sn(te.target) === t.key && oe(!1);
|
|
740
749
|
}, [te == null ? void 0 : te.seq]);
|
|
741
|
-
const Ne =
|
|
750
|
+
const Ne = S !== void 0, M = ge ?? (Ne ? !y : _t), Te = pe(() => {
|
|
742
751
|
});
|
|
743
752
|
Te.current = () => {
|
|
744
|
-
M && (ge !== null ? oe(!1) : Ne ?
|
|
753
|
+
M && (ge !== null ? oe(!1) : Ne ? S == null || S() : Pe(!0));
|
|
745
754
|
}, Q(() => {
|
|
746
755
|
if (typeof window > "u") return;
|
|
747
|
-
const
|
|
748
|
-
const
|
|
749
|
-
((
|
|
756
|
+
const u = (_) => {
|
|
757
|
+
const o = _.detail;
|
|
758
|
+
((o == null ? void 0 : o.key) === t.key || o != null && o.field && i.some((L) => L.field === o.field)) && Te.current();
|
|
750
759
|
};
|
|
751
|
-
return window.addEventListener(tt,
|
|
760
|
+
return window.addEventListener(tt, u), () => window.removeEventListener(tt, u);
|
|
752
761
|
}, [t.key, i]), Q(() => {
|
|
753
762
|
se && !M && (le == null || le(t.key));
|
|
754
763
|
}, [se, M, le, t.key]);
|
|
755
|
-
const _e = ge !== null ? () => oe((
|
|
764
|
+
const _e = ge !== null ? () => oe((u) => !u) : Ne ? S : () => Pe((u) => !u), Ve = !O && P != null, we = () => {
|
|
756
765
|
Ve && ft({ layoutId: Number(P), collection: r, kind: "opened", key: t.key });
|
|
757
766
|
}, kt = () => {
|
|
758
767
|
M && we(), _e == null || _e();
|
|
759
|
-
}, St = !g && i.some((
|
|
768
|
+
}, St = !g && i.some((u) => f[u.field]), Ee = O ? "always" : t.visibility_mode ?? "always";
|
|
760
769
|
if (Ee === "new_only" && !j || Ee === "existing_only" && j) return null;
|
|
761
|
-
const ne = Y ?? [], $t = !j && ne.some((
|
|
770
|
+
const ne = Y ?? [], $t = !j && ne.some((u) => u.widget_id != null && Ge[u.field] === void 0);
|
|
762
771
|
let ce = !1;
|
|
763
|
-
if (t.hide_when_empty && d && !
|
|
772
|
+
if (t.hide_when_empty && d && !O && (ce = d.every(
|
|
764
773
|
(_) => _ == null || _ === "" || Array.isArray(_) && _.length === 0
|
|
765
774
|
) && !$t && ne.every((_) => !Ge[_.field])), ce && ne.length === 0) return null;
|
|
766
|
-
const ve =
|
|
767
|
-
|
|
775
|
+
const ve = pe(null), ke = bn(ve), Ce = kn(t.icon), Dt = Me ? i : i.filter((u) => !u.hidden), Re = (ze = ye == null ? void 0 : ye.sections) == null ? void 0 : ze[t.key], Ft = Array.isArray(Re) && Re.length > 0, Ot = (u) => Ft ? /* @__PURE__ */ x("div", { className: "relative", children: [
|
|
776
|
+
u,
|
|
768
777
|
/* @__PURE__ */ e("span", { className: "absolute right-[52px] top-1/2 flex -translate-y-1/2", children: /* @__PURE__ */ e(
|
|
769
|
-
|
|
778
|
+
un,
|
|
770
779
|
{
|
|
771
780
|
collection: r,
|
|
772
781
|
kind: "section",
|
|
@@ -774,7 +783,7 @@ const rr = Et(function({
|
|
|
774
783
|
label: t.label || t.key
|
|
775
784
|
}
|
|
776
785
|
) })
|
|
777
|
-
] }) :
|
|
786
|
+
] }) : u, Je = z ? i.filter((u) => u.field in z) : [], Se = Je.length === 1 ? Je[0].field : null, $e = (u) => Me && (u.hidden || !(p.has(u.field) || !p.size));
|
|
778
787
|
return /* @__PURE__ */ x(
|
|
779
788
|
"div",
|
|
780
789
|
{
|
|
@@ -786,16 +795,16 @@ const rr = Et(function({
|
|
|
786
795
|
g && "bg-slate-50/60 dark:bg-slate-900/20",
|
|
787
796
|
ce && "hidden"
|
|
788
797
|
),
|
|
789
|
-
onPointerDownCapture: (
|
|
790
|
-
var _,
|
|
791
|
-
(
|
|
798
|
+
onPointerDownCapture: (u) => {
|
|
799
|
+
var _, o;
|
|
800
|
+
(o = (_ = u.target) == null ? void 0 : _.closest) != null && o.call(_, "[data-usage-header]") || we();
|
|
792
801
|
},
|
|
793
|
-
onFocusCapture: (
|
|
794
|
-
var _,
|
|
795
|
-
(
|
|
802
|
+
onFocusCapture: (u) => {
|
|
803
|
+
var _, o;
|
|
804
|
+
(o = (_ = u.target) == null ? void 0 : _.closest) != null && o.call(_, "[data-usage-header]") || we();
|
|
796
805
|
},
|
|
797
806
|
children: [
|
|
798
|
-
Ve && !ce && /* @__PURE__ */ e(
|
|
807
|
+
Ve && !ce && /* @__PURE__ */ e(On, { layoutId: Number(P), collection: r, sectionKey: t.key }),
|
|
799
808
|
Ot(
|
|
800
809
|
/* @__PURE__ */ x(
|
|
801
810
|
"button",
|
|
@@ -803,21 +812,21 @@ const rr = Et(function({
|
|
|
803
812
|
type: "button",
|
|
804
813
|
"data-usage-header": "",
|
|
805
814
|
onClick: kt,
|
|
806
|
-
"data-design-group-header":
|
|
815
|
+
"data-design-group-header": O ? "" : void 0,
|
|
807
816
|
className: W(
|
|
808
817
|
"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",
|
|
809
818
|
// Round the bottom only when nothing renders below the header — an
|
|
810
819
|
// expanded body (or collapsed summary strip) square-joins it, and a
|
|
811
820
|
// rounded hover overlay would leave see-through notches at the seam.
|
|
812
|
-
M && !(
|
|
821
|
+
M && !(F && F.length > 0) && "rounded-b-xl"
|
|
813
822
|
),
|
|
814
823
|
children: [
|
|
815
824
|
Ce && /* @__PURE__ */ e(Ce, { className: "h-3.5 w-3.5 shrink-0 text-slate-400 dark:text-slate-500" }),
|
|
816
825
|
/* @__PURE__ */ e("span", { className: "font-medium text-[13px] shrink-0 text-slate-800 dark:text-slate-200", children: t.label }),
|
|
817
|
-
M && Se && z && Se in z && /* @__PURE__ */ e(
|
|
826
|
+
M && Se && z && Se in z && /* @__PURE__ */ e(Dn, { value: z[Se] }),
|
|
818
827
|
/* @__PURE__ */ e("span", { className: "flex-1" }),
|
|
819
|
-
M && !
|
|
820
|
-
|
|
828
|
+
M && !O && s && s !== "new" && /* @__PURE__ */ e(
|
|
829
|
+
Nn,
|
|
821
830
|
{
|
|
822
831
|
collection: r,
|
|
823
832
|
itemId: s,
|
|
@@ -830,7 +839,7 @@ const rr = Et(function({
|
|
|
830
839
|
/* @__PURE__ */ e(
|
|
831
840
|
Mt,
|
|
832
841
|
{
|
|
833
|
-
"data-design-pass":
|
|
842
|
+
"data-design-pass": O ? "" : void 0,
|
|
834
843
|
className: W(
|
|
835
844
|
"h-4 w-4 text-slate-400 dark:text-slate-500 transition-transform duration-200",
|
|
836
845
|
M && "-rotate-90"
|
|
@@ -841,12 +850,12 @@ const rr = Et(function({
|
|
|
841
850
|
}
|
|
842
851
|
)
|
|
843
852
|
),
|
|
844
|
-
M &&
|
|
845
|
-
|
|
853
|
+
M && F && F.length > 0 && /* @__PURE__ */ e(
|
|
854
|
+
Fn,
|
|
846
855
|
{
|
|
847
|
-
summaryFields:
|
|
856
|
+
summaryFields: F,
|
|
848
857
|
fields: i,
|
|
849
|
-
draft:
|
|
858
|
+
draft: a,
|
|
850
859
|
relations: c,
|
|
851
860
|
collection: r,
|
|
852
861
|
itemId: s,
|
|
@@ -861,19 +870,19 @@ const rr = Et(function({
|
|
|
861
870
|
hideEmpty: !!t.summary_hide_empty || !!A
|
|
862
871
|
}
|
|
863
872
|
),
|
|
864
|
-
M && !se && t.hide_when_empty && ne.length > 0 && /* @__PURE__ */ e("div", { className: "hidden", children: ne.filter((
|
|
873
|
+
M && !se && t.hide_when_empty && ne.length > 0 && /* @__PURE__ */ e("div", { className: "hidden", children: ne.filter((u) => u.widget_id != null).map((u) => /* @__PURE__ */ e(
|
|
865
874
|
rt,
|
|
866
875
|
{
|
|
867
|
-
widgetId:
|
|
868
|
-
inputBindings: lt(
|
|
869
|
-
itemDraft:
|
|
876
|
+
widgetId: u.widget_id,
|
|
877
|
+
inputBindings: lt(u.input_bindings),
|
|
878
|
+
itemDraft: a,
|
|
870
879
|
frameless: !0,
|
|
871
880
|
apiBase: Z,
|
|
872
881
|
onContentChange: (_) => Ie(
|
|
873
|
-
(
|
|
882
|
+
(o) => o[u.field] === _ ? o : { ...o, [u.field]: _ }
|
|
874
883
|
)
|
|
875
884
|
},
|
|
876
|
-
|
|
885
|
+
u.field
|
|
877
886
|
)) }),
|
|
878
887
|
!M && /* @__PURE__ */ x(
|
|
879
888
|
"div",
|
|
@@ -881,21 +890,21 @@ const rr = Et(function({
|
|
|
881
890
|
"data-section-body": "",
|
|
882
891
|
className: "nvr-expand-in border-t border-slate-100 px-5 py-4 dark:border-border/60",
|
|
883
892
|
children: [
|
|
884
|
-
!g && /* @__PURE__ */ e(
|
|
893
|
+
!g && /* @__PURE__ */ e(xn, { group: t, className: "mb-3" }),
|
|
885
894
|
(() => {
|
|
886
|
-
const
|
|
895
|
+
const u = Ht(Dt, {
|
|
887
896
|
rows: g ? [] : Yt(t.swap_config).rows,
|
|
888
|
-
folded: (
|
|
889
|
-
keep: (
|
|
890
|
-
filled: (
|
|
891
|
-
}), _ =
|
|
892
|
-
(
|
|
893
|
-
_k: `row:${
|
|
894
|
-
sort:
|
|
897
|
+
folded: (o) => !g && At(o._overrides),
|
|
898
|
+
keep: (o) => !!o.required,
|
|
899
|
+
filled: (o) => !Wt(a[o.field]) || !!f[o.field]
|
|
900
|
+
}), _ = u.units.map(
|
|
901
|
+
(o) => o.kind === "row" ? {
|
|
902
|
+
_k: `row:${o.row.key}`,
|
|
903
|
+
sort: o.members[0].sort ?? 0,
|
|
895
904
|
_t: "row",
|
|
896
|
-
row:
|
|
897
|
-
members:
|
|
898
|
-
} : { _k:
|
|
905
|
+
row: o.row,
|
|
906
|
+
members: o.members
|
|
907
|
+
} : { _k: o.field.field, sort: o.field.sort ?? 0, _t: "field", f: o.field }
|
|
899
908
|
);
|
|
900
909
|
I && _.push({
|
|
901
910
|
_k: "__owners__",
|
|
@@ -908,32 +917,32 @@ const rr = Et(function({
|
|
|
908
917
|
_t: "pdf",
|
|
909
918
|
slot: m
|
|
910
919
|
});
|
|
911
|
-
for (const
|
|
912
|
-
_.push({ _k:
|
|
913
|
-
return _.sort((
|
|
920
|
+
for (const o of Y ?? [])
|
|
921
|
+
_.push({ _k: o.field, sort: o.sort, _t: "widget", slot: o });
|
|
922
|
+
return _.sort((o, L) => o.sort - L.sort), O && _.length === 0 && u.folded.length === 0 ? /* @__PURE__ */ e(tn, {}) : g ? /* @__PURE__ */ x(
|
|
914
923
|
"div",
|
|
915
924
|
{
|
|
916
925
|
ref: ve,
|
|
917
926
|
"data-section-grid": "",
|
|
918
|
-
className: W(
|
|
927
|
+
className: W(O && "relative", "grid grid-cols-12 gap-x-6 gap-y-3"),
|
|
919
928
|
children: [
|
|
920
929
|
/* @__PURE__ */ e(Fe, { gapClass: "gap-x-6" }),
|
|
921
|
-
_.map((
|
|
922
|
-
if (
|
|
923
|
-
const
|
|
924
|
-
return
|
|
930
|
+
_.map((o) => {
|
|
931
|
+
if (o._t === "owners") {
|
|
932
|
+
const $ = o.slot.col_span ?? 12;
|
|
933
|
+
return H(
|
|
925
934
|
ae("__owners__"),
|
|
926
935
|
/* @__PURE__ */ e(
|
|
927
936
|
"div",
|
|
928
937
|
{
|
|
929
938
|
className: "min-w-0",
|
|
930
|
-
style: { gridColumn: `span ${
|
|
939
|
+
style: { gridColumn: `span ${$}` },
|
|
931
940
|
children: /* @__PURE__ */ e(
|
|
932
941
|
st,
|
|
933
942
|
{
|
|
934
943
|
collection: r,
|
|
935
944
|
itemId: s,
|
|
936
|
-
label:
|
|
945
|
+
label: o.slot.label_override || "Owners"
|
|
937
946
|
}
|
|
938
947
|
)
|
|
939
948
|
},
|
|
@@ -941,11 +950,11 @@ const rr = Et(function({
|
|
|
941
950
|
)
|
|
942
951
|
);
|
|
943
952
|
}
|
|
944
|
-
if (
|
|
945
|
-
const L =
|
|
946
|
-
(
|
|
953
|
+
if (o._t === "pdf" || o._t === "widget" || o._t === "row") return null;
|
|
954
|
+
const L = o.f, b = c.find(
|
|
955
|
+
($) => $.many_collection === r && $.many_field === L.field && !$.junction_field
|
|
947
956
|
);
|
|
948
|
-
return
|
|
957
|
+
return H(
|
|
949
958
|
{ kind: "field", field: L.field, group_key: t.key },
|
|
950
959
|
/* @__PURE__ */ x(
|
|
951
960
|
"div",
|
|
@@ -955,9 +964,9 @@ const rr = Et(function({
|
|
|
955
964
|
children: [
|
|
956
965
|
/* @__PURE__ */ e("dt", { className: "text-[11px] font-medium text-slate-400 truncate", children: L.label || xt(L.field) }),
|
|
957
966
|
/* @__PURE__ */ e("dd", { className: "mt-0.5 break-words", children: (b == null ? void 0 : b.one_collection) === "nivaro_users" ? (() => {
|
|
958
|
-
const
|
|
967
|
+
const $ = a[L.field], C = Array.isArray($) ? $ : $ != null && $ !== "" ? [$] : [];
|
|
959
968
|
return C.length === 0 ? /* @__PURE__ */ e("span", { className: "text-[13px] text-slate-400", children: "—" }) : /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1.5", children: C.map((T) => /* @__PURE__ */ e(gt, { userId: String(T) }, String(T))) });
|
|
960
|
-
})() : b != null && b.one_collection ? /* @__PURE__ */ e(ie, { relCollection: b.one_collection, id:
|
|
969
|
+
})() : b != null && b.one_collection ? /* @__PURE__ */ e(ie, { relCollection: b.one_collection, id: a[L.field] }) : /* @__PURE__ */ e("span", { className: "text-[13px] text-slate-700", children: qe(a[L.field], L) }) })
|
|
961
970
|
]
|
|
962
971
|
},
|
|
963
972
|
L.field
|
|
@@ -967,34 +976,34 @@ const rr = Et(function({
|
|
|
967
976
|
]
|
|
968
977
|
}
|
|
969
978
|
) : (() => {
|
|
970
|
-
const
|
|
979
|
+
const o = (b) => {
|
|
971
980
|
var Ze, Xe;
|
|
972
981
|
if (b._t === "row")
|
|
973
982
|
return /* @__PURE__ */ e(
|
|
974
|
-
|
|
983
|
+
pn,
|
|
975
984
|
{
|
|
976
985
|
row: b.row,
|
|
977
986
|
members: b.members,
|
|
978
987
|
containerWidth: ke,
|
|
979
988
|
errors: f,
|
|
980
|
-
renderMember: (w) =>
|
|
989
|
+
renderMember: (w) => H(
|
|
981
990
|
{ kind: "field", field: w.field, group_key: t.key },
|
|
982
991
|
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
983
992
|
Oe,
|
|
984
993
|
{
|
|
985
|
-
field:
|
|
986
|
-
draft:
|
|
994
|
+
field: fn(w),
|
|
995
|
+
draft: a,
|
|
987
996
|
onChange: l,
|
|
988
997
|
relations: c,
|
|
989
998
|
collection: r,
|
|
990
999
|
itemId: s,
|
|
991
1000
|
error: f[w.field],
|
|
992
|
-
visible:
|
|
1001
|
+
visible: p.has(w.field) || !p.size,
|
|
993
1002
|
forceVisible: $e(w) || void 0,
|
|
994
|
-
locked:
|
|
995
|
-
layoutAiEnabled:
|
|
1003
|
+
locked: v.has(w.field),
|
|
1004
|
+
layoutAiEnabled: D,
|
|
996
1005
|
renderField: h,
|
|
997
|
-
onCountChange:
|
|
1006
|
+
onCountChange: k
|
|
998
1007
|
}
|
|
999
1008
|
) }, w.field)
|
|
1000
1009
|
)
|
|
@@ -1003,7 +1012,7 @@ const rr = Et(function({
|
|
|
1003
1012
|
);
|
|
1004
1013
|
if (b._t === "owners") {
|
|
1005
1014
|
const w = b.slot.col_span ?? 12;
|
|
1006
|
-
return
|
|
1015
|
+
return H(
|
|
1007
1016
|
ae("__owners__"),
|
|
1008
1017
|
/* @__PURE__ */ e("div", { style: { gridColumn: `span ${w}` }, children: /* @__PURE__ */ e(
|
|
1009
1018
|
st,
|
|
@@ -1018,10 +1027,10 @@ const rr = Et(function({
|
|
|
1018
1027
|
if (b._t === "pdf") {
|
|
1019
1028
|
if (!P) return null;
|
|
1020
1029
|
const w = b.slot.col_span ?? 12, R = ((Ze = b.slot.label_override) == null ? void 0 : Ze.trim()) || "Generate PDF";
|
|
1021
|
-
return
|
|
1030
|
+
return H(
|
|
1022
1031
|
ae("__pdf__"),
|
|
1023
1032
|
/* @__PURE__ */ e("div", { style: { gridColumn: `span ${w}` }, children: /* @__PURE__ */ e(
|
|
1024
|
-
|
|
1033
|
+
Sn,
|
|
1025
1034
|
{
|
|
1026
1035
|
collection: r,
|
|
1027
1036
|
itemId: s,
|
|
@@ -1036,14 +1045,14 @@ const rr = Et(function({
|
|
|
1036
1045
|
if (b._t === "widget") {
|
|
1037
1046
|
if (!b.slot.widget_id) return null;
|
|
1038
1047
|
const w = b.slot.col_span ?? 12, R = lt(b.slot.input_bindings);
|
|
1039
|
-
return
|
|
1048
|
+
return H(
|
|
1040
1049
|
ae(b.slot.field),
|
|
1041
1050
|
/* @__PURE__ */ e("div", { style: { gridColumn: `span ${w}` }, children: /* @__PURE__ */ e(
|
|
1042
1051
|
rt,
|
|
1043
1052
|
{
|
|
1044
1053
|
widgetId: b.slot.widget_id,
|
|
1045
1054
|
inputBindings: R,
|
|
1046
|
-
itemDraft:
|
|
1055
|
+
itemDraft: a,
|
|
1047
1056
|
label: b.slot.label_override ?? void 0,
|
|
1048
1057
|
defaultExpanded: b.slot.default_expanded ?? !0,
|
|
1049
1058
|
frameless: !0,
|
|
@@ -1055,13 +1064,13 @@ const rr = Et(function({
|
|
|
1055
1064
|
) }, b.slot.field)
|
|
1056
1065
|
);
|
|
1057
1066
|
}
|
|
1058
|
-
const
|
|
1059
|
-
(w) => w.many_collection === r && w.many_field ===
|
|
1060
|
-
)) == null ? void 0 : Xe.one_collection) ?? null : null, We = (E == null ? void 0 : E.enabled) &&
|
|
1061
|
-
const w =
|
|
1067
|
+
const $ = b.f, C = be == null ? void 0 : be[$.field], T = C == null ? void 0 : C.entries, jt = (C == null ? void 0 : C.separator) ?? null, de = a[$.field], Ke = de != null && de !== "", He = T != null && T.length && Ke ? ((Xe = c.find(
|
|
1068
|
+
(w) => w.many_collection === r && w.many_field === $.field && !w.junction_field
|
|
1069
|
+
)) == null ? void 0 : Xe.one_collection) ?? null : null, We = (E == null ? void 0 : E.enabled) && $.field === E.primary_field, Ae = (() => {
|
|
1070
|
+
const w = a[(E == null ? void 0 : E.primary_field) ?? ""];
|
|
1062
1071
|
return w != null && w !== "";
|
|
1063
1072
|
})(), Ye = (X ?? []).some((w) => {
|
|
1064
|
-
const R =
|
|
1073
|
+
const R = a[w.field];
|
|
1065
1074
|
return R != null && R !== "";
|
|
1066
1075
|
}), Lt = We && Ue ? /* @__PURE__ */ x("span", { className: "inline-flex items-center gap-1.5", children: [
|
|
1067
1076
|
/* @__PURE__ */ e(
|
|
@@ -1123,7 +1132,7 @@ const rr = Et(function({
|
|
|
1123
1132
|
Oe,
|
|
1124
1133
|
{
|
|
1125
1134
|
field: w,
|
|
1126
|
-
draft:
|
|
1135
|
+
draft: a,
|
|
1127
1136
|
onChange: l,
|
|
1128
1137
|
relations: c,
|
|
1129
1138
|
collection: r,
|
|
@@ -1131,44 +1140,44 @@ const rr = Et(function({
|
|
|
1131
1140
|
error: f[w.field],
|
|
1132
1141
|
visible: !0,
|
|
1133
1142
|
forceVisible: !0,
|
|
1134
|
-
locked:
|
|
1135
|
-
layoutAiEnabled:
|
|
1143
|
+
locked: v.has(w.field),
|
|
1144
|
+
layoutAiEnabled: D,
|
|
1136
1145
|
renderField: h,
|
|
1137
|
-
onCountChange:
|
|
1146
|
+
onCountChange: k
|
|
1138
1147
|
}
|
|
1139
1148
|
) }, w.field);
|
|
1140
1149
|
}) }) }) : void 0, Qe = /* @__PURE__ */ e(
|
|
1141
1150
|
Oe,
|
|
1142
1151
|
{
|
|
1143
|
-
field:
|
|
1144
|
-
draft:
|
|
1152
|
+
field: $,
|
|
1153
|
+
draft: a,
|
|
1145
1154
|
onChange: l,
|
|
1146
1155
|
relations: c,
|
|
1147
1156
|
collection: r,
|
|
1148
1157
|
itemId: s,
|
|
1149
|
-
error: f[
|
|
1150
|
-
visible:
|
|
1151
|
-
forceVisible: $e(
|
|
1152
|
-
locked:
|
|
1153
|
-
layoutAiEnabled:
|
|
1158
|
+
error: f[$.field],
|
|
1159
|
+
visible: p.has($.field) || !p.size,
|
|
1160
|
+
forceVisible: $e($) || void 0,
|
|
1161
|
+
locked: v.has($.field),
|
|
1162
|
+
layoutAiEnabled: D,
|
|
1154
1163
|
renderField: h,
|
|
1155
|
-
onCountChange:
|
|
1164
|
+
onCountChange: k,
|
|
1156
1165
|
swapButton: Lt,
|
|
1157
1166
|
swapContent: qt
|
|
1158
1167
|
}
|
|
1159
1168
|
);
|
|
1160
|
-
return
|
|
1161
|
-
{ kind: "field", field:
|
|
1169
|
+
return H(
|
|
1170
|
+
{ kind: "field", field: $.field, group_key: t.key },
|
|
1162
1171
|
/* @__PURE__ */ x(
|
|
1163
1172
|
"div",
|
|
1164
1173
|
{
|
|
1165
|
-
style: { gridColumn: `span ${it(
|
|
1174
|
+
style: { gridColumn: `span ${it($.options, ke)}` },
|
|
1166
1175
|
children: [
|
|
1167
|
-
$e(
|
|
1168
|
-
(T == null ? void 0 : T.length) &&
|
|
1169
|
-
|
|
1176
|
+
$e($) ? /* @__PURE__ */ e("div", { "data-design-hidden": "", className: "opacity-40", children: Qe }) : Qe,
|
|
1177
|
+
(T == null ? void 0 : T.length) && Ke && He && /* @__PURE__ */ e(
|
|
1178
|
+
vn,
|
|
1170
1179
|
{
|
|
1171
|
-
relCollection:
|
|
1180
|
+
relCollection: He,
|
|
1172
1181
|
relId: de,
|
|
1173
1182
|
entries: T,
|
|
1174
1183
|
separator: jt
|
|
@@ -1176,10 +1185,10 @@ const rr = Et(function({
|
|
|
1176
1185
|
)
|
|
1177
1186
|
]
|
|
1178
1187
|
},
|
|
1179
|
-
|
|
1188
|
+
$.field
|
|
1180
1189
|
)
|
|
1181
1190
|
);
|
|
1182
|
-
}, L =
|
|
1191
|
+
}, L = u.folded.map((b) => ({
|
|
1183
1192
|
_k: b.field,
|
|
1184
1193
|
sort: b.sort ?? 0,
|
|
1185
1194
|
_t: "field",
|
|
@@ -1191,29 +1200,29 @@ const rr = Et(function({
|
|
|
1191
1200
|
{
|
|
1192
1201
|
ref: ve,
|
|
1193
1202
|
"data-section-grid": "",
|
|
1194
|
-
className: W(
|
|
1203
|
+
className: W(O && "relative", "grid grid-cols-12 gap-4 items-start"),
|
|
1195
1204
|
children: [
|
|
1196
1205
|
/* @__PURE__ */ e(Fe, {}),
|
|
1197
|
-
_.map(
|
|
1206
|
+
_.map(o)
|
|
1198
1207
|
]
|
|
1199
1208
|
}
|
|
1200
1209
|
),
|
|
1201
1210
|
/* @__PURE__ */ e(
|
|
1202
|
-
|
|
1211
|
+
mn,
|
|
1203
1212
|
{
|
|
1204
1213
|
count: L.length,
|
|
1205
1214
|
open: wt,
|
|
1206
|
-
forcedOpen:
|
|
1207
|
-
design: !!
|
|
1215
|
+
forcedOpen: u.forcedOpen,
|
|
1216
|
+
design: !!O,
|
|
1208
1217
|
onToggle: () => vt((b) => !b),
|
|
1209
1218
|
children: /* @__PURE__ */ x(
|
|
1210
1219
|
"div",
|
|
1211
1220
|
{
|
|
1212
1221
|
"data-section-grid": "",
|
|
1213
|
-
className: W(
|
|
1222
|
+
className: W(O && "relative", "grid grid-cols-12 gap-4 items-start"),
|
|
1214
1223
|
children: [
|
|
1215
1224
|
/* @__PURE__ */ e(Fe, {}),
|
|
1216
|
-
L.map(
|
|
1225
|
+
L.map(o)
|
|
1217
1226
|
]
|
|
1218
1227
|
}
|
|
1219
1228
|
)
|
|
@@ -1222,15 +1231,15 @@ const rr = Et(function({
|
|
|
1222
1231
|
] });
|
|
1223
1232
|
})();
|
|
1224
1233
|
})(),
|
|
1225
|
-
|
|
1234
|
+
K && /* @__PURE__ */ e("div", { className: "mt-4", children: K })
|
|
1226
1235
|
]
|
|
1227
1236
|
}
|
|
1228
1237
|
)
|
|
1229
1238
|
]
|
|
1230
1239
|
}
|
|
1231
1240
|
);
|
|
1232
|
-
},
|
|
1233
|
-
function
|
|
1241
|
+
}, gn);
|
|
1242
|
+
function On({
|
|
1234
1243
|
layoutId: n,
|
|
1235
1244
|
collection: t,
|
|
1236
1245
|
sectionKey: i
|
|
@@ -1240,14 +1249,14 @@ function $n({
|
|
|
1240
1249
|
}, [n, t, i]), null;
|
|
1241
1250
|
}
|
|
1242
1251
|
export {
|
|
1243
|
-
|
|
1244
|
-
|
|
1252
|
+
or as GroupSection,
|
|
1253
|
+
vn as InlineDisplay,
|
|
1245
1254
|
st as OwnersInline,
|
|
1246
|
-
|
|
1255
|
+
_n as OwnersInlineCompact,
|
|
1247
1256
|
ie as RelationCell,
|
|
1248
|
-
|
|
1257
|
+
ar as StripFieldValue,
|
|
1249
1258
|
gt as UserChip,
|
|
1250
|
-
|
|
1259
|
+
ur as UserRosterCluster,
|
|
1251
1260
|
qe as formatDisplayValue,
|
|
1252
|
-
|
|
1261
|
+
$n as useChangePulse
|
|
1253
1262
|
};
|