@nivaro/react 0.2.54 → 0.2.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +99 -98
- package/dist/index.d.ts +367 -2
- package/dist/index.js +645 -616
- package/dist/layout-editor.d.ts +4 -0
- package/dist/shared/components/BackgroundRunOffer.js +117 -0
- package/dist/shared/components/BroadcastView.js +214 -213
- package/dist/shared/components/CollectionBrowserView.js +2592 -2695
- package/dist/shared/components/ItemEditForm.js +4066 -3832
- package/dist/shared/components/JobsTray.js +100 -55
- package/dist/shared/components/MyWorkView.js +91 -89
- package/dist/shared/components/NotificationBell.js +80 -79
- package/dist/shared/components/ProfileView.js +568 -520
- package/dist/shared/components/RecordCompare.js +254 -0
- package/dist/shared/components/RecordReadView.js +599 -552
- package/dist/shared/components/ReportView.js +578 -543
- package/dist/shared/components/RowPresence.js +91 -0
- package/dist/shared/components/WidgetSlot.js +474 -458
- package/dist/shared/components/ai/AiAnalyticsView.js +16 -6
- package/dist/shared/components/ai/AskPanel.js +139 -119
- package/dist/shared/components/ai/FirstWeekCard.js +126 -0
- package/dist/shared/components/bulk/BulkFieldUpdate.js +289 -0
- package/dist/shared/components/bulk/bulk-field-options.js +45 -0
- package/dist/shared/components/charts/CumulativeFlowChart.js +176 -0
- package/dist/shared/components/chat/ChannelArchive.js +326 -0
- package/dist/shared/components/chat/ChannelExtras.js +141 -121
- package/dist/shared/components/chat/ChatAnalyticsView.js +112 -110
- package/dist/shared/components/chat/ChatPanel.js +1695 -1733
- package/dist/shared/components/chat/Composer.js +357 -303
- package/dist/shared/components/chat/MessageActions.js +92 -0
- package/dist/shared/components/chat/MessageFormat.js +290 -264
- package/dist/shared/components/chat/OutboxBubbles.js +146 -0
- package/dist/shared/components/chat/RequestIdCard.js +135 -0
- package/dist/shared/components/chat/RoomHeaderMenu.js +202 -0
- package/dist/shared/components/chat/RoomParts.js +213 -274
- package/dist/shared/components/chat/ScreenClip.js +184 -0
- package/dist/shared/components/chat/chat-core.js +402 -483
- package/dist/shared/components/chat/chat-drafts.js +59 -0
- package/dist/shared/components/chat/chat-emoji.js +348 -0
- package/dist/shared/components/chat/chat-local-time.js +41 -0
- package/dist/shared/components/chat/chat-outbox.js +303 -0
- package/dist/shared/components/chat/chat-window.js +163 -0
- package/dist/shared/components/chat/huddle/HuddleControls.js +143 -0
- package/dist/shared/components/chat/huddle/HuddleStage.js +164 -0
- package/dist/shared/components/chat/huddle/huddle-store.js +342 -0
- package/dist/shared/components/chat/huddle/useHuddle.js +58 -0
- package/dist/shared/components/help-videos/api.js +76 -73
- package/dist/shared/components/item-edit/CatalogPickerField.js +113 -112
- package/dist/shared/components/item-edit/ChangeReasonDialog.js +13 -13
- package/dist/shared/components/item-edit/FieldAffordances.js +2 -2
- package/dist/shared/components/item-edit/FieldRenderer.js +248 -245
- package/dist/shared/components/item-edit/FieldRow.js +292 -279
- package/dist/shared/components/item-edit/GroupSection.js +698 -574
- package/dist/shared/components/item-edit/InlineTableField.js +3 -1
- package/dist/shared/components/item-edit/RelationCombobox.js +186 -176
- package/dist/shared/components/item-edit/entry/EntryStrip.js +54 -0
- package/dist/shared/components/item-edit/entry/entry-keys.js +27 -0
- package/dist/shared/components/item-edit/entry/useEntryKeyboard.js +70 -0
- package/dist/shared/components/item-edit/entry/useEntryMode.js +59 -0
- package/dist/shared/components/item-edit/form-structure-ui.js +105 -0
- package/dist/shared/components/item-edit/lazy-sections.js +36 -0
- package/dist/shared/components/item-edit/lock-why.js +39 -32
- package/dist/shared/components/item-edit/picker-miss.js +26 -0
- package/dist/shared/components/item-edit/placement-behaviour.js +196 -0
- package/dist/shared/components/item-edit/useFormUsageBeacon.js +51 -45
- package/dist/shared/components/layout-editor/AddPanel.js +134 -117
- package/dist/shared/components/layout-editor/ChangeNote.js +25 -24
- package/dist/shared/components/layout-editor/CollabParts.js +80 -75
- package/dist/shared/components/layout-editor/DesignNode.js +126 -120
- package/dist/shared/components/layout-editor/EditorCanvas.js +30 -27
- package/dist/shared/components/layout-editor/EditorTopBar.js +203 -192
- package/dist/shared/components/layout-editor/HistoryPanel.js +120 -104
- package/dist/shared/components/layout-editor/LayoutEditor.js +768 -671
- package/dist/shared/components/layout-editor/RestorePiece.js +143 -0
- package/dist/shared/components/layout-editor/StagedChip.js +22 -0
- package/dist/shared/components/layout-editor/StructureMenu.js +237 -186
- package/dist/shared/components/layout-editor/collab/FormFollowShare.js +149 -103
- package/dist/shared/components/layout-editor/collab/collab-api.js +29 -26
- package/dist/shared/components/layout-editor/dnd/LayoutDndProvider.js +81 -80
- package/dist/shared/components/layout-editor/dnd/node.js +69 -57
- package/dist/shared/components/layout-editor/draft-recovery.js +113 -43
- package/dist/shared/components/layout-editor/entry/PlacementPresets.js +149 -0
- package/dist/shared/components/layout-editor/entry/entry-editor-context.js +10 -0
- package/dist/shared/components/layout-editor/entry/presets.js +71 -0
- package/dist/shared/components/layout-editor/entry/tab-order.js +110 -0
- package/dist/shared/components/layout-editor/entry/theme-preview.js +37 -0
- package/dist/shared/components/layout-editor/grid-guides.js +142 -0
- package/dist/shared/components/layout-editor/inspector/BehaviourSettings.js +402 -0
- package/dist/shared/components/layout-editor/inspector/BulkInspector.js +61 -57
- package/dist/shared/components/layout-editor/inspector/GroupInspector.js +247 -151
- package/dist/shared/components/layout-editor/inspector/Inspector.js +176 -155
- package/dist/shared/components/layout-editor/inspector/LookTab.js +167 -116
- package/dist/shared/components/layout-editor/inspector/PickerMisses.js +129 -0
- package/dist/shared/components/layout-editor/inspector/PickerTab.js +84 -82
- package/dist/shared/components/layout-editor/inspector/RulesTab.js +66 -62
- package/dist/shared/components/layout-editor/inspector/kit.js +69 -68
- package/dist/shared/components/layout-editor/outputs/OutputsButton.js +254 -0
- package/dist/shared/components/layout-editor/outputs/help-sheet.js +154 -0
- package/dist/shared/components/layout-editor/outputs/output-api.js +61 -0
- package/dist/shared/components/layout-editor/overview/describe-conditions.js +6 -0
- package/dist/shared/components/layout-editor/overview/purpose.js +15 -13
- package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
- package/dist/shared/components/layout-editor/restore-piece.js +192 -0
- package/dist/shared/components/layout-editor/section-structure.js +241 -0
- package/dist/shared/components/layout-editor/settings/EntrySection.js +296 -0
- package/dist/shared/components/layout-editor/settings/FormSettings.js +41 -39
- package/dist/shared/components/layout-editor/settings/ResolveSettings.js +255 -0
- package/dist/shared/components/layout-editor/settings/ToolsSection.js +147 -111
- package/dist/shared/components/layout-editor/settings/WhoSection.js +29 -26
- package/dist/shared/components/layout-editor/settings/settings-registry.js +114 -17
- package/dist/shared/components/layout-editor/staged-api.js +64 -0
- package/dist/shared/components/layout-editor/structure-ops.js +81 -77
- package/dist/shared/components/layout-editor/testing/TestingPanels.js +65 -60
- package/dist/shared/components/layout-editor/testing/testing-model.js +198 -185
- package/dist/shared/components/layout-editor/toolbar-kit.js +11 -11
- package/dist/shared/components/layout-editor/usage/AbTestSection.js +355 -0
- package/dist/shared/components/layout-editor/usage/UsagePanel.js +144 -70
- package/dist/shared/components/layout-editor/usage/ab-api.js +86 -0
- package/dist/shared/components/layout-editor/usage/suggest-collapse.js +32 -0
- package/dist/shared/components/layout-editor/useLayoutDraft.js +25 -24
- package/dist/shared/components/notifications/NotificationAnalyticsView.js +148 -77
- package/dist/shared/components/panels/ErpFailureBanner.js +18 -17
- package/dist/shared/components/panels/ExternalRequestsChip.js +63 -62
- package/dist/shared/components/pipeline/PipelineEditorView.js +106 -104
- package/dist/shared/components/profile/AgentsPanel.js +479 -0
- package/dist/shared/components/queue/QueueWorklist.js +1026 -1040
- package/dist/shared/components/support/SupportAnalytics.js +171 -0
- package/dist/shared/components/support/SupportView.js +75 -73
- package/dist/shared/lib/background-runs.js +150 -0
- package/dist/shared/lib/delivery-ack.js +9 -0
- package/dist/shared/lib/entry-badge-style.js +13 -0
- package/dist/shared/lib/entry-config.js +71 -0
- package/dist/shared/lib/form-sections.js +64 -0
- package/dist/shared/lib/form-structure.js +99 -0
- package/dist/shared/lib/form-usage-beacon.js +101 -52
- package/dist/shared/lib/jobs-tray.js +25 -23
- package/dist/shared/lib/keyset-pager.js +37 -0
- package/dist/shared/lib/layout-ops.js +84 -82
- package/dist/shared/lib/layout-resolve.js +113 -0
- package/dist/shared/lib/placement-behaviour.js +144 -0
- package/dist/shared/lib/prefetch.js +149 -0
- package/dist/shared/lib/presence-hooks.js +199 -0
- package/dist/shared/lib/record-outbox.js +82 -81
- package/dist/shared/lib/replay-socket.js +93 -0
- package/dist/shared/lib/request-gate.js +51 -50
- package/dist/shared/lib/room-gaps.js +96 -0
- package/dist/shared/lib/search-log.js +27 -0
- package/dist/shared/lib/socket-realtime.js +101 -80
- package/dist/shared/lib/stale-chunk.js +60 -0
- package/dist/shared/lib/worker-socket.js +200 -0
- package/package.json +1 -1
|
@@ -1,24 +1,28 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { useQuery as
|
|
3
|
-
import * as
|
|
4
|
-
import { ChevronDown as
|
|
5
|
-
import
|
|
6
|
-
import { fieldDrilldownConfig as
|
|
7
|
-
import { get as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
|
|
1
|
+
import { jsx as e, jsxs as x, Fragment as _t } from "react/jsx-runtime";
|
|
2
|
+
import { useQuery as de, useQueryClient as wt } from "@tanstack/react-query";
|
|
3
|
+
import * as vt from "lucide-react";
|
|
4
|
+
import { ChevronDown as St, Loader2 as kt, User as Dt, Mail as $t } from "lucide-react";
|
|
5
|
+
import nt, { useState as Q, useRef as Se, useEffect as ne } from "react";
|
|
6
|
+
import { fieldDrilldownConfig as Ft, useDrilldown as jt, useOptionalNivaroClient as ue, useNavigation as Lt } from "../../context.js";
|
|
7
|
+
import { get as rt, post as Ot } from "../../lib/commands.js";
|
|
8
|
+
import { planFieldGrid as qt, isEmptyValue as Bt, isFolded as Ut, readGroupStructure as Tt } from "../../lib/form-structure.js";
|
|
9
|
+
import { reportSectionUse as it } from "../../lib/form-usage-beacon.js";
|
|
10
|
+
import { useRecordReader as st } from "../../lib/record-loader.js";
|
|
11
|
+
import { choiceLabel as It, titleCase as lt, cn as W } from "../../lib/utils.js";
|
|
12
|
+
import { DesignDropZone as Mt, designWrap as Gt } from "../layout-editor/DesignNode.js";
|
|
13
|
+
import { useLayoutDesign as Vt, revealGroupKey as Pt } from "../layout-editor/design-context.js";
|
|
14
|
+
import { GridGuides as we } from "../layout-editor/grid-guides.js";
|
|
15
|
+
import { UserAvatar as Ct } from "../UserAvatar.js";
|
|
16
|
+
import { DropdownMenu as Jt, DropdownMenuTrigger as Rt, DropdownMenuContent as zt, DropdownMenuItem as We } from "../ui/dropdown-menu.js";
|
|
17
|
+
import { WidgetSlot as Ae } from "../WidgetSlot.js";
|
|
18
|
+
import { FieldRow as ve } from "./FieldRow.js";
|
|
19
|
+
import { FoldArea as Kt, RowGroupCell as Ht, rowMemberField as Wt } from "./form-structure-ui.js";
|
|
20
|
+
import { useFormHelpVideos as At, FormHelpVideoButton as Et } from "./FormHelpVideoButton.js";
|
|
21
|
+
import { applyDisplayTemplate as Yt, useContainerWidth as Qt, resolveColSpan as Ee } from "./helpers.js";
|
|
22
|
+
import { SectionIntro as Zt } from "./LayoutContentBlock.js";
|
|
23
|
+
import { UserChip as at, OwnersInline as Ye, OwnersInlineCompact as Xt } from "./UserChip.js";
|
|
24
|
+
import { UserRosterCluster as Bn } from "./UserChip.js";
|
|
25
|
+
function Qe(t) {
|
|
22
26
|
if (typeof t != "string") return t ?? [];
|
|
23
27
|
try {
|
|
24
28
|
return JSON.parse(t);
|
|
@@ -26,94 +30,94 @@ function Re(t) {
|
|
|
26
30
|
return [];
|
|
27
31
|
}
|
|
28
32
|
}
|
|
29
|
-
function
|
|
33
|
+
function en({
|
|
30
34
|
relCollection: t,
|
|
31
35
|
relId: r,
|
|
32
36
|
entries: i,
|
|
33
37
|
separator: u
|
|
34
38
|
}) {
|
|
35
|
-
const s =
|
|
36
|
-
queryKey: ["inline-display", t, n,
|
|
37
|
-
queryFn: () => l(t, n,
|
|
39
|
+
const s = ue(), l = st(), n = String(r), m = i.some((g) => g.field.includes(".")) ? ["id", ...i.map((g) => g.field)].join(",") : null, { data: h } = de({
|
|
40
|
+
queryKey: ["inline-display", t, n, m],
|
|
41
|
+
queryFn: () => l(t, n, m),
|
|
38
42
|
enabled: !!s && !!n,
|
|
39
43
|
staleTime: 6e4
|
|
40
44
|
});
|
|
41
45
|
if (!h) return null;
|
|
42
|
-
const
|
|
46
|
+
const k = (g) => {
|
|
43
47
|
let f = h;
|
|
44
|
-
for (const
|
|
48
|
+
for (const y of g.split(".")) {
|
|
45
49
|
if (f == null || typeof f != "object") return;
|
|
46
|
-
f = f[
|
|
50
|
+
f = f[y];
|
|
47
51
|
}
|
|
48
52
|
return f;
|
|
49
53
|
};
|
|
50
54
|
if (u != null) {
|
|
51
|
-
const
|
|
52
|
-
const
|
|
53
|
-
if (
|
|
54
|
-
const
|
|
55
|
-
if (
|
|
55
|
+
const g = (L) => {
|
|
56
|
+
const S = k(L.field);
|
|
57
|
+
if (S == null || S === "") return null;
|
|
58
|
+
const D = L.format ?? "text";
|
|
59
|
+
if (D === "date" || D === "datetime")
|
|
56
60
|
try {
|
|
57
|
-
return new Date(String(
|
|
61
|
+
return new Date(String(S)).toLocaleDateString();
|
|
58
62
|
} catch {
|
|
59
|
-
return String(
|
|
63
|
+
return String(S);
|
|
60
64
|
}
|
|
61
|
-
return
|
|
65
|
+
return D === "boolean" ? S ? "Yes" : "No" : String(S);
|
|
62
66
|
}, f = [];
|
|
63
|
-
let
|
|
64
|
-
for (const
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
const
|
|
68
|
-
(
|
|
69
|
-
const
|
|
70
|
-
return
|
|
67
|
+
let y = [];
|
|
68
|
+
for (const L of i)
|
|
69
|
+
L.line_break && y.length > 0 ? (f.push(y), y = [L]) : y.push(L);
|
|
70
|
+
y.length > 0 && f.push(y);
|
|
71
|
+
const q = f.map(
|
|
72
|
+
(L) => L.map((S) => {
|
|
73
|
+
const D = g(S);
|
|
74
|
+
return D ? { label: S.label ?? null, display: D } : null;
|
|
71
75
|
}).filter(Boolean)
|
|
72
|
-
).filter((
|
|
73
|
-
return
|
|
76
|
+
).filter((L) => L.length > 0);
|
|
77
|
+
return q.length === 0 ? null : /* @__PURE__ */ e("div", { className: "mt-1", children: q.map((L, S) => (
|
|
74
78
|
// biome-ignore lint/suspicious/noArrayIndexKey: stable line order
|
|
75
|
-
/* @__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: L.map((D, J) => (
|
|
76
80
|
// biome-ignore lint/suspicious/noArrayIndexKey: stable token order
|
|
77
|
-
/* @__PURE__ */
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
+
/* @__PURE__ */ x(nt.Fragment, { children: [
|
|
82
|
+
J > 0 && u,
|
|
83
|
+
D.label && /* @__PURE__ */ x("span", { className: "font-semibold text-slate-600 dark:text-slate-300", children: [
|
|
84
|
+
D.label,
|
|
81
85
|
":"
|
|
82
86
|
] }),
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
] },
|
|
86
|
-
)) },
|
|
87
|
+
D.label ? " " : "",
|
|
88
|
+
D.display
|
|
89
|
+
] }, J)
|
|
90
|
+
)) }, S)
|
|
87
91
|
)) });
|
|
88
92
|
}
|
|
89
|
-
const
|
|
90
|
-
const f =
|
|
93
|
+
const o = i.map((g) => {
|
|
94
|
+
const f = k(g.field);
|
|
91
95
|
if (f == null || f === "") return null;
|
|
92
|
-
const
|
|
93
|
-
let
|
|
94
|
-
if (
|
|
96
|
+
const y = g.format ?? "text";
|
|
97
|
+
let q;
|
|
98
|
+
if (y === "date" || y === "datetime")
|
|
95
99
|
try {
|
|
96
|
-
|
|
100
|
+
q = new Date(String(f)).toLocaleDateString();
|
|
97
101
|
} catch {
|
|
98
|
-
|
|
102
|
+
q = String(f);
|
|
99
103
|
}
|
|
100
|
-
else
|
|
101
|
-
return { label:
|
|
104
|
+
else y === "boolean" ? q = f ? "Yes" : "No" : q = String(f);
|
|
105
|
+
return { label: g.label, display: q };
|
|
102
106
|
}).filter(Boolean);
|
|
103
|
-
return
|
|
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) => (
|
|
104
108
|
// biome-ignore lint/suspicious/noArrayIndexKey: stable order from config
|
|
105
|
-
/* @__PURE__ */
|
|
106
|
-
|
|
107
|
-
/* @__PURE__ */ e("span", { className: "text-[12px] text-slate-700 dark:text-slate-300 truncate", children:
|
|
109
|
+
/* @__PURE__ */ x("div", { className: "flex items-baseline gap-2", children: [
|
|
110
|
+
g.label && /* @__PURE__ */ e("span", { className: "shrink-0 min-w-[56px] text-[10px] font-medium text-slate-400", children: g.label }),
|
|
111
|
+
/* @__PURE__ */ e("span", { className: "text-[12px] text-slate-700 dark:text-slate-300 truncate", children: g.display })
|
|
108
112
|
] }, f)
|
|
109
113
|
)) });
|
|
110
114
|
}
|
|
111
|
-
function
|
|
115
|
+
function tn(t) {
|
|
112
116
|
if (!t) return null;
|
|
113
|
-
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 = vt[r];
|
|
114
118
|
return i || null;
|
|
115
119
|
}
|
|
116
|
-
function
|
|
120
|
+
function Ze(t) {
|
|
117
121
|
if (!t.options) return {};
|
|
118
122
|
if (typeof t.options == "object") return t.options;
|
|
119
123
|
try {
|
|
@@ -122,7 +126,7 @@ function ze(t) {
|
|
|
122
126
|
return {};
|
|
123
127
|
}
|
|
124
128
|
}
|
|
125
|
-
function
|
|
129
|
+
function ke(t, r) {
|
|
126
130
|
if (t == null || t === "") return "—";
|
|
127
131
|
if (typeof t == "boolean") return t ? "Yes" : "No";
|
|
128
132
|
const i = (r == null ? void 0 : r.interface) ?? "", u = (() => {
|
|
@@ -140,12 +144,12 @@ function he(t, r) {
|
|
|
140
144
|
if (u === "percent" && Number.isFinite(n)) return `${(n * 100).toFixed(1)}%`;
|
|
141
145
|
if (/^0\.0+$/.test(u) && Number.isFinite(n)) return n.toFixed(u.length - 2);
|
|
142
146
|
if (u === "date" && typeof t == "string") {
|
|
143
|
-
const
|
|
144
|
-
if (!Number.isNaN(
|
|
147
|
+
const a = t.length === 10 ? /* @__PURE__ */ new Date(`${t}T00:00:00`) : new Date(t);
|
|
148
|
+
if (!Number.isNaN(a.getTime())) return a.toLocaleDateString();
|
|
145
149
|
}
|
|
146
150
|
if (u === "datetime" && typeof t == "string") {
|
|
147
|
-
const
|
|
148
|
-
if (!Number.isNaN(
|
|
151
|
+
const a = new Date(t);
|
|
152
|
+
if (!Number.isNaN(a.getTime())) return a.toLocaleString();
|
|
149
153
|
}
|
|
150
154
|
}
|
|
151
155
|
if (i === "duration" && Number.isFinite(Number(t))) {
|
|
@@ -157,7 +161,7 @@ function he(t, r) {
|
|
|
157
161
|
if (i === "checklist" && typeof t == "string")
|
|
158
162
|
try {
|
|
159
163
|
const n = JSON.parse(t);
|
|
160
|
-
if (Array.isArray(n)) return `${n.filter((
|
|
164
|
+
if (Array.isArray(n)) return `${n.filter((a) => a == null ? void 0 : a.done).length}/${n.length} done`;
|
|
161
165
|
} catch {
|
|
162
166
|
}
|
|
163
167
|
if (i === "address" && typeof t == "string" && t.trim().startsWith("{"))
|
|
@@ -182,27 +186,27 @@ function he(t, r) {
|
|
|
182
186
|
let n = /^\d{4}-\d{2}-\d{2}$/.test(s) || i === "date";
|
|
183
187
|
if (!n && (r != null && r.options))
|
|
184
188
|
try {
|
|
185
|
-
const
|
|
186
|
-
|
|
189
|
+
const m = typeof r.options == "string" ? JSON.parse(r.options) : r.options;
|
|
190
|
+
m && m.date_mode === "date" && (n = !0);
|
|
187
191
|
} catch {
|
|
188
192
|
}
|
|
189
|
-
const
|
|
190
|
-
return
|
|
193
|
+
const a = s.match(/^(\d{4})-(\d{2})-(\d{2})(?:T00:00:00(?:\.000)?Z)?$/);
|
|
194
|
+
return a ? new Date(Number(a[1]), Number(a[2]) - 1, Number(a[3])).toLocaleDateString() : n ? new Date(s).toLocaleDateString() : new Date(s).toLocaleString();
|
|
191
195
|
} catch {
|
|
192
196
|
}
|
|
193
197
|
if ((i === "select-dropdown" || i === "radio-buttons") && r) {
|
|
194
|
-
const
|
|
195
|
-
if (Array.isArray(
|
|
196
|
-
const
|
|
197
|
-
if (
|
|
198
|
+
const a = Ze(r).choices;
|
|
199
|
+
if (Array.isArray(a)) {
|
|
200
|
+
const m = a.find((h) => String(h.value) === s);
|
|
201
|
+
if (m) return It(m.text);
|
|
198
202
|
}
|
|
199
203
|
}
|
|
200
204
|
const l = Number(s);
|
|
201
205
|
if (!Number.isNaN(l) && s !== "" && r) {
|
|
202
|
-
const n =
|
|
203
|
-
if (
|
|
206
|
+
const n = Ze(r), a = n.format, m = typeof n.unit == "string" ? n.unit.trim() : "";
|
|
207
|
+
if (m && !a) {
|
|
204
208
|
const h = new Intl.NumberFormat(void 0, { maximumFractionDigits: 2 }).format(l);
|
|
205
|
-
if (
|
|
209
|
+
if (m === "$")
|
|
206
210
|
try {
|
|
207
211
|
return new Intl.NumberFormat(void 0, { style: "currency", currency: "USD" }).format(
|
|
208
212
|
l
|
|
@@ -210,9 +214,9 @@ function he(t, r) {
|
|
|
210
214
|
} catch {
|
|
211
215
|
return `$${h}`;
|
|
212
216
|
}
|
|
213
|
-
return
|
|
217
|
+
return m === "%" ? `${h}%` : `${h} ${m}`;
|
|
214
218
|
}
|
|
215
|
-
if (
|
|
219
|
+
if (a === "currency")
|
|
216
220
|
try {
|
|
217
221
|
return new Intl.NumberFormat(void 0, {
|
|
218
222
|
style: "currency",
|
|
@@ -220,9 +224,9 @@ function he(t, r) {
|
|
|
220
224
|
}).format(l);
|
|
221
225
|
} catch {
|
|
222
226
|
}
|
|
223
|
-
if (
|
|
227
|
+
if (a === "int")
|
|
224
228
|
return new Intl.NumberFormat(void 0, { maximumFractionDigits: 0 }).format(l);
|
|
225
|
-
if (
|
|
229
|
+
if (a === "decimal") {
|
|
226
230
|
const h = typeof n.precision == "number" ? n.precision : 2;
|
|
227
231
|
return new Intl.NumberFormat(void 0, {
|
|
228
232
|
minimumFractionDigits: h,
|
|
@@ -230,50 +234,50 @@ function he(t, r) {
|
|
|
230
234
|
}).format(l);
|
|
231
235
|
}
|
|
232
236
|
}
|
|
233
|
-
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)) ? lt(s) : s;
|
|
234
238
|
}
|
|
235
|
-
function
|
|
236
|
-
const r =
|
|
239
|
+
function Xe({ userId: t }) {
|
|
240
|
+
const r = ue(), { navigate: i, userUrl: u } = Lt(), s = u ? u(t) : `/users/${t}`, { data: l } = de({
|
|
237
241
|
queryKey: ["user-chip", t],
|
|
238
242
|
queryFn: () => r.request(
|
|
239
|
-
|
|
240
|
-
).then((
|
|
243
|
+
rt(`/users/${t}`)
|
|
244
|
+
).then((m) => m.data ?? null),
|
|
241
245
|
enabled: !!r && !!t,
|
|
242
246
|
staleTime: 12e4
|
|
243
|
-
}), n = l ? [l.first_name, l.last_name].filter(Boolean).join(" ") || l.email : t,
|
|
244
|
-
return /* @__PURE__ */
|
|
245
|
-
/* @__PURE__ */ e(
|
|
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(Jt, { children: [
|
|
249
|
+
/* @__PURE__ */ e(Rt, { 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: [
|
|
246
250
|
/* @__PURE__ */ e(
|
|
247
|
-
|
|
251
|
+
Ct,
|
|
248
252
|
{
|
|
249
253
|
userId: t,
|
|
250
254
|
className: "h-4 w-4",
|
|
251
|
-
fallback: /* @__PURE__ */ e("span", { className: "flex h-4 w-4 shrink-0 items-center justify-center rounded-full bg-nvr-cyan/20 text-[9px] font-bold text-nvr-navy dark:text-nvr-cyan", children:
|
|
255
|
+
fallback: /* @__PURE__ */ e("span", { className: "flex h-4 w-4 shrink-0 items-center justify-center rounded-full bg-nvr-cyan/20 text-[9px] font-bold text-nvr-navy dark:text-nvr-cyan", children: a })
|
|
252
256
|
}
|
|
253
257
|
),
|
|
254
258
|
/* @__PURE__ */ e("span", { className: "text-[11px] text-slate-600", children: n })
|
|
255
259
|
] }) }),
|
|
256
|
-
/* @__PURE__ */
|
|
257
|
-
s && /* @__PURE__ */
|
|
258
|
-
|
|
260
|
+
/* @__PURE__ */ x(zt, { align: "start", className: "text-[12px]", children: [
|
|
261
|
+
s && /* @__PURE__ */ x(
|
|
262
|
+
We,
|
|
259
263
|
{
|
|
260
264
|
className: "gap-2 text-[12px] cursor-pointer",
|
|
261
265
|
onSelect: () => i(s),
|
|
262
266
|
children: [
|
|
263
|
-
/* @__PURE__ */ e(
|
|
267
|
+
/* @__PURE__ */ e(Dt, { className: "h-3.5 w-3.5" }),
|
|
264
268
|
" View profile"
|
|
265
269
|
]
|
|
266
270
|
}
|
|
267
271
|
),
|
|
268
|
-
(l == null ? void 0 : l.email) && /* @__PURE__ */
|
|
269
|
-
|
|
272
|
+
(l == null ? void 0 : l.email) && /* @__PURE__ */ x(
|
|
273
|
+
We,
|
|
270
274
|
{
|
|
271
275
|
className: "gap-2 text-[12px] cursor-pointer",
|
|
272
276
|
onSelect: () => {
|
|
273
277
|
window.location.href = `mailto:${l.email}`;
|
|
274
278
|
},
|
|
275
279
|
children: [
|
|
276
|
-
/* @__PURE__ */ e(
|
|
280
|
+
/* @__PURE__ */ e($t, { className: "h-3.5 w-3.5" }),
|
|
277
281
|
" Send email"
|
|
278
282
|
]
|
|
279
283
|
}
|
|
@@ -281,7 +285,7 @@ function Ge({ userId: t }) {
|
|
|
281
285
|
] })
|
|
282
286
|
] });
|
|
283
287
|
}
|
|
284
|
-
function
|
|
288
|
+
function nn({
|
|
285
289
|
collection: t,
|
|
286
290
|
itemId: r,
|
|
287
291
|
layoutId: i,
|
|
@@ -289,34 +293,34 @@ function Tt({
|
|
|
289
293
|
filenameTemplate: s,
|
|
290
294
|
label: l
|
|
291
295
|
}) {
|
|
292
|
-
const n =
|
|
293
|
-
if (!(!n ||
|
|
296
|
+
const n = ue(), a = wt(), [m, h] = Q(!1), k = async () => {
|
|
297
|
+
if (!(!n || m || !u)) {
|
|
294
298
|
h(!0);
|
|
295
299
|
try {
|
|
296
300
|
await n.request(
|
|
297
|
-
|
|
301
|
+
Ot(`/collection-layouts/${i}/generate-and-attach`, {
|
|
298
302
|
collection: t,
|
|
299
303
|
item_id: r,
|
|
300
304
|
attach_field: u,
|
|
301
305
|
filename_template: s ?? void 0
|
|
302
306
|
})
|
|
303
|
-
),
|
|
307
|
+
), a.invalidateQueries({ queryKey: ["m2m-items"] }), a.invalidateQueries({ queryKey: ["items", t, r] });
|
|
304
308
|
} catch {
|
|
305
309
|
} finally {
|
|
306
310
|
h(!1);
|
|
307
311
|
}
|
|
308
312
|
}
|
|
309
|
-
},
|
|
310
|
-
return /* @__PURE__ */
|
|
313
|
+
}, o = !u;
|
|
314
|
+
return /* @__PURE__ */ x(
|
|
311
315
|
"button",
|
|
312
316
|
{
|
|
313
317
|
type: "button",
|
|
314
|
-
onClick:
|
|
315
|
-
disabled:
|
|
316
|
-
title:
|
|
318
|
+
onClick: k,
|
|
319
|
+
disabled: m || o,
|
|
320
|
+
title: o ? "Configure PDF field in Data Model → Layouts" : void 0,
|
|
317
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",
|
|
318
322
|
children: [
|
|
319
|
-
/* @__PURE__ */
|
|
323
|
+
/* @__PURE__ */ x(
|
|
320
324
|
"svg",
|
|
321
325
|
{
|
|
322
326
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -333,47 +337,47 @@ function Tt({
|
|
|
333
337
|
]
|
|
334
338
|
}
|
|
335
339
|
),
|
|
336
|
-
|
|
340
|
+
m ? "Generating…" : l
|
|
337
341
|
]
|
|
338
342
|
}
|
|
339
343
|
);
|
|
340
344
|
}
|
|
341
|
-
function
|
|
345
|
+
function re({
|
|
342
346
|
relCollection: t,
|
|
343
347
|
id: r,
|
|
344
348
|
className: i
|
|
345
349
|
}) {
|
|
346
350
|
var f;
|
|
347
|
-
const u =
|
|
351
|
+
const u = ue(), s = st(), l = r != null && r !== "" ? String(r) : null, { data: n } = de({
|
|
348
352
|
queryKey: ["col-meta-dt", t],
|
|
349
353
|
queryFn: () => u.request(
|
|
350
|
-
|
|
351
|
-
).then((
|
|
354
|
+
rt(`/collections/${t}`)
|
|
355
|
+
).then((y) => y.data).catch(() => ({})),
|
|
352
356
|
enabled: !!u && !!l,
|
|
353
357
|
staleTime: 3e5
|
|
354
|
-
}),
|
|
355
|
-
queryKey: ["rel-display", t, l,
|
|
356
|
-
queryFn: () => s(t, l,
|
|
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: k } = de({
|
|
359
|
+
queryKey: ["rel-display", t, l, m],
|
|
360
|
+
queryFn: () => s(t, l, m),
|
|
357
361
|
enabled: !!u && !!l && n !== void 0,
|
|
358
362
|
staleTime: 6e4
|
|
359
363
|
});
|
|
360
364
|
if (!l) return /* @__PURE__ */ e("span", { children: "—" });
|
|
361
|
-
if (
|
|
365
|
+
if (k || u && n === void 0)
|
|
362
366
|
return /* @__PURE__ */ e("span", { className: "animate-pulse h-3 w-20 rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))] inline-block" });
|
|
363
|
-
const
|
|
364
|
-
if (!h) return /* @__PURE__ */ e("span", { className:
|
|
365
|
-
const
|
|
366
|
-
return /* @__PURE__ */ e("span", { className:
|
|
367
|
+
const o = i ?? "text-[13px] text-slate-700";
|
|
368
|
+
if (!h) return /* @__PURE__ */ e("span", { className: o, children: l });
|
|
369
|
+
const g = n != null && n.display_template ? Yt(n.display_template, h) : String(h.name ?? h.title ?? h.label ?? h.display_name ?? l);
|
|
370
|
+
return /* @__PURE__ */ e("span", { className: o, children: g });
|
|
367
371
|
}
|
|
368
|
-
function
|
|
369
|
-
return /* @__PURE__ */ e(
|
|
372
|
+
function et({ userId: t }) {
|
|
373
|
+
return /* @__PURE__ */ e(at, { userId: t, size: "compact" });
|
|
370
374
|
}
|
|
371
|
-
function
|
|
375
|
+
function tt({
|
|
372
376
|
relCollection: t,
|
|
373
377
|
id: r,
|
|
374
378
|
drillConfig: i
|
|
375
379
|
}) {
|
|
376
|
-
const u =
|
|
380
|
+
const u = jt(), s = /* @__PURE__ */ e(re, { relCollection: t, id: r });
|
|
377
381
|
return !u || r == null || r === "" ? s : /* @__PURE__ */ e(
|
|
378
382
|
"button",
|
|
379
383
|
{
|
|
@@ -390,7 +394,7 @@ function We({
|
|
|
390
394
|
},
|
|
391
395
|
className: "group/drill cursor-pointer text-left transition-colors",
|
|
392
396
|
children: /* @__PURE__ */ e(
|
|
393
|
-
|
|
397
|
+
re,
|
|
394
398
|
{
|
|
395
399
|
relCollection: t,
|
|
396
400
|
id: r,
|
|
@@ -400,9 +404,9 @@ function We({
|
|
|
400
404
|
}
|
|
401
405
|
);
|
|
402
406
|
}
|
|
403
|
-
function
|
|
404
|
-
const [r, i] =
|
|
405
|
-
return
|
|
407
|
+
function rn(t) {
|
|
408
|
+
const [r, i] = Q(!1), u = Se(!0), s = Se(JSON.stringify(t ?? null));
|
|
409
|
+
return ne(() => {
|
|
406
410
|
const l = JSON.stringify(t ?? null);
|
|
407
411
|
if (u.current) {
|
|
408
412
|
u.current = !1, s.current = l;
|
|
@@ -410,13 +414,13 @@ function Mt(t) {
|
|
|
410
414
|
}
|
|
411
415
|
if (l === s.current) return;
|
|
412
416
|
s.current = l, i(!1);
|
|
413
|
-
const n = window.setTimeout(() => i(!0), 0),
|
|
417
|
+
const n = window.setTimeout(() => i(!0), 0), a = window.setTimeout(() => i(!1), 1200);
|
|
414
418
|
return () => {
|
|
415
|
-
window.clearTimeout(n), window.clearTimeout(
|
|
419
|
+
window.clearTimeout(n), window.clearTimeout(a);
|
|
416
420
|
};
|
|
417
421
|
}, [t]), r ? "nvr-value-pulse" : "";
|
|
418
422
|
}
|
|
419
|
-
function
|
|
423
|
+
function jn({
|
|
420
424
|
field: t,
|
|
421
425
|
val: r,
|
|
422
426
|
relations: i,
|
|
@@ -424,70 +428,70 @@ function rn({
|
|
|
424
428
|
displayFormat: s,
|
|
425
429
|
textClassName: l
|
|
426
430
|
}) {
|
|
427
|
-
const n =
|
|
428
|
-
(
|
|
431
|
+
const n = rn(r), a = W(l ?? "text-[13px] text-slate-900 dark:text-slate-100", n), m = Ft(t) ?? { enabled: !0, layout_id: null, width: null }, h = i.find(
|
|
432
|
+
(o) => o.one_collection === u && o.one_field === t.field && o.junction_field
|
|
429
433
|
);
|
|
430
434
|
if (h) {
|
|
431
|
-
const
|
|
432
|
-
(
|
|
433
|
-
),
|
|
434
|
-
return !
|
|
435
|
-
|
|
435
|
+
const o = i.find(
|
|
436
|
+
(y) => y.many_collection === h.many_collection && y.many_field === h.junction_field
|
|
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(et, { userId: String(y) }, String(y))) }) : /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1.5", children: f.map((y) => /* @__PURE__ */ e(
|
|
439
|
+
tt,
|
|
436
440
|
{
|
|
437
|
-
relCollection:
|
|
438
|
-
id:
|
|
439
|
-
drillConfig:
|
|
441
|
+
relCollection: g,
|
|
442
|
+
id: y,
|
|
443
|
+
drillConfig: m
|
|
440
444
|
},
|
|
441
|
-
String(
|
|
445
|
+
String(y)
|
|
442
446
|
)) });
|
|
443
447
|
}
|
|
444
|
-
const
|
|
445
|
-
(
|
|
448
|
+
const k = i.find(
|
|
449
|
+
(o) => o.many_collection === u && o.many_field === t.field && !o.junction_field
|
|
446
450
|
);
|
|
447
|
-
if (
|
|
448
|
-
const
|
|
449
|
-
return
|
|
450
|
-
|
|
451
|
+
if (k != null && k.one_collection) {
|
|
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: "—" }) : k.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(et, { userId: String(g) }, String(g))) }) : /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1.5", children: o.map((g) => /* @__PURE__ */ e(
|
|
454
|
+
tt,
|
|
451
455
|
{
|
|
452
|
-
relCollection:
|
|
453
|
-
id:
|
|
454
|
-
drillConfig:
|
|
456
|
+
relCollection: k.one_collection,
|
|
457
|
+
id: g,
|
|
458
|
+
drillConfig: m
|
|
455
459
|
},
|
|
456
|
-
String(
|
|
460
|
+
String(g)
|
|
457
461
|
)) });
|
|
458
462
|
}
|
|
459
463
|
if (r == null || r === "")
|
|
460
464
|
return /* @__PURE__ */ e("span", { className: "text-slate-300 dark:text-slate-600", children: "—" });
|
|
461
465
|
if (s && s !== "text") {
|
|
462
|
-
const
|
|
463
|
-
if (s === "currency" && !isNaN(
|
|
464
|
-
return /* @__PURE__ */ e("span", { className: `font-semibold ${
|
|
466
|
+
const o = Number(r);
|
|
467
|
+
if (s === "currency" && !isNaN(o))
|
|
468
|
+
return /* @__PURE__ */ e("span", { className: `font-semibold ${a}`, children: new Intl.NumberFormat(void 0, {
|
|
465
469
|
style: "currency",
|
|
466
470
|
currency: "USD",
|
|
467
471
|
minimumFractionDigits: 2
|
|
468
|
-
}).format(
|
|
469
|
-
if (s === "integer" && !isNaN(
|
|
470
|
-
return /* @__PURE__ */ e("span", { className: `font-semibold ${
|
|
471
|
-
if (s === "decimal" && !isNaN(
|
|
472
|
-
return /* @__PURE__ */ e("span", { className: `font-semibold ${
|
|
473
|
-
if (s === "percent" && !isNaN(
|
|
474
|
-
return /* @__PURE__ */ e("span", { className: `font-semibold ${
|
|
475
|
-
|
|
472
|
+
}).format(o) });
|
|
473
|
+
if (s === "integer" && !isNaN(o))
|
|
474
|
+
return /* @__PURE__ */ e("span", { className: `font-semibold ${a}`, children: new Intl.NumberFormat(void 0, { maximumFractionDigits: 0 }).format(Math.round(o)) });
|
|
475
|
+
if (s === "decimal" && !isNaN(o))
|
|
476
|
+
return /* @__PURE__ */ e("span", { className: `font-semibold ${a}`, children: new Intl.NumberFormat(void 0, { maximumFractionDigits: 2 }).format(o) });
|
|
477
|
+
if (s === "percent" && !isNaN(o))
|
|
478
|
+
return /* @__PURE__ */ e("span", { className: `font-semibold ${a}`, children: new Intl.NumberFormat(void 0, { style: "percent", maximumFractionDigits: 1 }).format(
|
|
479
|
+
o / 100
|
|
476
480
|
) });
|
|
477
481
|
if (s === "date")
|
|
478
482
|
try {
|
|
479
|
-
return /* @__PURE__ */ e("span", { className: `font-semibold ${
|
|
483
|
+
return /* @__PURE__ */ e("span", { className: `font-semibold ${a}`, children: new Date(String(r)).toLocaleDateString() });
|
|
480
484
|
} catch {
|
|
481
485
|
}
|
|
482
486
|
if (s === "datetime")
|
|
483
487
|
try {
|
|
484
|
-
return /* @__PURE__ */ e("span", { className: `font-semibold ${
|
|
488
|
+
return /* @__PURE__ */ e("span", { className: `font-semibold ${a}`, children: new Date(String(r)).toLocaleString() });
|
|
485
489
|
} catch {
|
|
486
490
|
}
|
|
487
491
|
}
|
|
488
|
-
return /* @__PURE__ */ e("span", { className: `font-semibold ${
|
|
492
|
+
return /* @__PURE__ */ e("span", { className: `font-semibold ${a}`, children: ke(r, t) });
|
|
489
493
|
}
|
|
490
|
-
function
|
|
494
|
+
function sn({
|
|
491
495
|
summaryFields: t,
|
|
492
496
|
fields: r,
|
|
493
497
|
draft: i,
|
|
@@ -495,134 +499,134 @@ function Jt({
|
|
|
495
499
|
collection: s,
|
|
496
500
|
itemId: l,
|
|
497
501
|
ownersCollection: n,
|
|
498
|
-
ownersItemId:
|
|
499
|
-
ownersAssignment:
|
|
502
|
+
ownersItemId: a,
|
|
503
|
+
ownersAssignment: m,
|
|
500
504
|
m2mCounts: h,
|
|
501
|
-
o2mCounts:
|
|
502
|
-
o2mAggValues:
|
|
503
|
-
summaryAggConfigs:
|
|
505
|
+
o2mCounts: k,
|
|
506
|
+
o2mAggValues: o,
|
|
507
|
+
summaryAggConfigs: g,
|
|
504
508
|
o2mLoading: f,
|
|
505
|
-
hideEmpty:
|
|
509
|
+
hideEmpty: y
|
|
506
510
|
}) {
|
|
507
|
-
const
|
|
508
|
-
if (
|
|
509
|
-
if (h &&
|
|
510
|
-
if (
|
|
511
|
-
const
|
|
512
|
-
return
|
|
513
|
-
}) :
|
|
514
|
-
if (
|
|
515
|
-
const
|
|
516
|
-
if (
|
|
517
|
-
const d = (
|
|
518
|
-
return /* @__PURE__ */
|
|
519
|
-
/* @__PURE__ */ e("span", { className:
|
|
511
|
+
const q = t.map((N) => typeof N == "string" ? N : N.field), L = y ? q.filter((N) => {
|
|
512
|
+
if (N === "__owners__" || f != null && f.has(N) || o && N in o) return !0;
|
|
513
|
+
if (h && N in h) return (h[N] ?? 0) > 0;
|
|
514
|
+
if (k && N in k) return (k[N] ?? 0) > 0;
|
|
515
|
+
const U = i[N];
|
|
516
|
+
return U != null && U !== "" && !(Array.isArray(U) && U.length === 0);
|
|
517
|
+
}) : q;
|
|
518
|
+
if (L.length === 0) return null;
|
|
519
|
+
const S = "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
|
+
if (N === "__owners__") {
|
|
521
|
+
const d = (m == null ? void 0 : m.label_override) || "Owners";
|
|
522
|
+
return /* @__PURE__ */ x("div", { className: "flex items-center gap-1.5", children: [
|
|
523
|
+
/* @__PURE__ */ e("span", { className: S, children: d }),
|
|
520
524
|
/* @__PURE__ */ e(
|
|
521
|
-
|
|
525
|
+
Xt,
|
|
522
526
|
{
|
|
523
527
|
collection: n ?? s,
|
|
524
|
-
itemId:
|
|
528
|
+
itemId: a ?? l
|
|
525
529
|
}
|
|
526
530
|
)
|
|
527
531
|
] });
|
|
528
532
|
}
|
|
529
|
-
const
|
|
530
|
-
if (f != null && f.has(
|
|
531
|
-
return /* @__PURE__ */
|
|
532
|
-
/* @__PURE__ */ e("span", { className:
|
|
533
|
-
/* @__PURE__ */ e(
|
|
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
|
+
if (f != null && f.has(N))
|
|
535
|
+
return /* @__PURE__ */ x("div", { className: "flex items-center gap-1.5", children: [
|
|
536
|
+
/* @__PURE__ */ e("span", { className: S, children: I }),
|
|
537
|
+
/* @__PURE__ */ e(kt, { className: "h-3 w-3 animate-spin text-slate-300" })
|
|
534
538
|
] });
|
|
535
|
-
if (
|
|
536
|
-
const d =
|
|
537
|
-
let
|
|
539
|
+
if (o && N in o) {
|
|
540
|
+
const d = g == null ? void 0 : g[N], B = (d == null ? void 0 : d.label) || I, $ = o[N];
|
|
541
|
+
let G;
|
|
538
542
|
if ((d == null ? void 0 : d.agg) === "count")
|
|
539
|
-
|
|
543
|
+
G = String($);
|
|
540
544
|
else {
|
|
541
|
-
const
|
|
545
|
+
const K = d != null && d.field_options ? (() => {
|
|
542
546
|
try {
|
|
543
547
|
return JSON.parse(d.field_options);
|
|
544
548
|
} catch {
|
|
545
549
|
return {};
|
|
546
550
|
}
|
|
547
|
-
})() : {},
|
|
548
|
-
if (
|
|
551
|
+
})() : {}, E = K.format;
|
|
552
|
+
if (E === "currency")
|
|
549
553
|
try {
|
|
550
|
-
|
|
554
|
+
G = new Intl.NumberFormat(void 0, {
|
|
551
555
|
style: "currency",
|
|
552
|
-
currency:
|
|
553
|
-
}).format(
|
|
556
|
+
currency: K.currency || "USD"
|
|
557
|
+
}).format($);
|
|
554
558
|
} catch {
|
|
555
|
-
|
|
559
|
+
G = $.toLocaleString(void 0, { maximumFractionDigits: 2 });
|
|
556
560
|
}
|
|
557
|
-
else if (
|
|
558
|
-
|
|
559
|
-
else if (
|
|
560
|
-
const
|
|
561
|
-
|
|
562
|
-
minimumFractionDigits:
|
|
563
|
-
maximumFractionDigits:
|
|
564
|
-
}).format(
|
|
561
|
+
else if (E === "int")
|
|
562
|
+
G = new Intl.NumberFormat(void 0, { maximumFractionDigits: 0 }).format($);
|
|
563
|
+
else if (E === "decimal") {
|
|
564
|
+
const Y = typeof K.precision == "number" ? K.precision : 2;
|
|
565
|
+
G = new Intl.NumberFormat(void 0, {
|
|
566
|
+
minimumFractionDigits: Y,
|
|
567
|
+
maximumFractionDigits: Y
|
|
568
|
+
}).format($);
|
|
565
569
|
} else
|
|
566
|
-
|
|
570
|
+
G = $.toLocaleString(void 0, { maximumFractionDigits: 2 });
|
|
567
571
|
}
|
|
568
|
-
return /* @__PURE__ */
|
|
569
|
-
/* @__PURE__ */ e("span", { className:
|
|
570
|
-
/* @__PURE__ */ e("span", { className:
|
|
572
|
+
return /* @__PURE__ */ x("div", { className: R, children: [
|
|
573
|
+
/* @__PURE__ */ e("span", { className: S, children: B }),
|
|
574
|
+
/* @__PURE__ */ e("span", { className: D, children: G })
|
|
571
575
|
] });
|
|
572
576
|
}
|
|
573
|
-
if (h &&
|
|
574
|
-
const d = h[
|
|
575
|
-
return /* @__PURE__ */
|
|
576
|
-
/* @__PURE__ */ e("span", { className:
|
|
577
|
-
/* @__PURE__ */
|
|
577
|
+
if (h && N in h) {
|
|
578
|
+
const d = h[N];
|
|
579
|
+
return /* @__PURE__ */ x("div", { className: R, children: [
|
|
580
|
+
/* @__PURE__ */ e("span", { className: S, children: I }),
|
|
581
|
+
/* @__PURE__ */ x("span", { className: D, children: [
|
|
578
582
|
d,
|
|
579
583
|
" item",
|
|
580
584
|
d !== 1 ? "s" : ""
|
|
581
585
|
] })
|
|
582
586
|
] });
|
|
583
587
|
}
|
|
584
|
-
if (
|
|
585
|
-
const d =
|
|
586
|
-
return /* @__PURE__ */
|
|
587
|
-
/* @__PURE__ */ e("span", { className:
|
|
588
|
-
/* @__PURE__ */
|
|
588
|
+
if (k && N in k) {
|
|
589
|
+
const d = k[N];
|
|
590
|
+
return /* @__PURE__ */ x("div", { className: R, children: [
|
|
591
|
+
/* @__PURE__ */ e("span", { className: S, children: I }),
|
|
592
|
+
/* @__PURE__ */ x("span", { className: D, children: [
|
|
589
593
|
d,
|
|
590
594
|
" row",
|
|
591
595
|
d !== 1 ? "s" : ""
|
|
592
596
|
] })
|
|
593
597
|
] });
|
|
594
598
|
}
|
|
595
|
-
const
|
|
596
|
-
(d) => d.many_collection === s && d.many_field ===
|
|
599
|
+
const j = i[N], M = u.find(
|
|
600
|
+
(d) => d.many_collection === s && d.many_field === N && !d.junction_field
|
|
597
601
|
);
|
|
598
|
-
if (
|
|
599
|
-
const d = Array.isArray(
|
|
600
|
-
return /* @__PURE__ */
|
|
601
|
-
/* @__PURE__ */ e("span", { className:
|
|
602
|
-
d.length === 0 ? /* @__PURE__ */ e("span", { className:
|
|
602
|
+
if (M != null && M.one_collection) {
|
|
603
|
+
const d = Array.isArray(j) ? j : j != null && j !== "" ? [j] : [];
|
|
604
|
+
return /* @__PURE__ */ x("div", { className: R, children: [
|
|
605
|
+
/* @__PURE__ */ e("span", { className: S, 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((B) => /* @__PURE__ */ e(Xe, { userId: String(B) }, String(B))) }) : /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1.5", children: d.map((B) => /* @__PURE__ */ e(re, { relCollection: M.one_collection, id: B }, String(B))) })
|
|
603
607
|
] });
|
|
604
608
|
}
|
|
605
|
-
if (Array.isArray(
|
|
606
|
-
const d = u.find((
|
|
607
|
-
return /* @__PURE__ */
|
|
608
|
-
/* @__PURE__ */ e("span", { className:
|
|
609
|
-
|
|
610
|
-
(
|
|
611
|
-
) }) : /* @__PURE__ */
|
|
612
|
-
|
|
609
|
+
if (Array.isArray(j)) {
|
|
610
|
+
const d = u.find(($) => $.many_field === N && $.junction_field), B = d == null ? void 0 : d.one_collection;
|
|
611
|
+
return /* @__PURE__ */ x("div", { className: R, children: [
|
|
612
|
+
/* @__PURE__ */ e("span", { className: S, children: I }),
|
|
613
|
+
j.length === 0 ? /* @__PURE__ */ e("span", { className: J, children: "—" }) : B ? /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1.5 gap-y-0.5", children: j.map(
|
|
614
|
+
($) => B === "nivaro_users" ? /* @__PURE__ */ e(Xe, { userId: String($) }, String($)) : /* @__PURE__ */ e(re, { relCollection: B, id: $ }, String($))
|
|
615
|
+
) }) : /* @__PURE__ */ x("span", { className: D, children: [
|
|
616
|
+
j.length,
|
|
613
617
|
" item",
|
|
614
|
-
|
|
618
|
+
j.length !== 1 ? "s" : ""
|
|
615
619
|
] })
|
|
616
620
|
] });
|
|
617
621
|
}
|
|
618
|
-
return /* @__PURE__ */
|
|
619
|
-
/* @__PURE__ */ e("span", { className:
|
|
620
|
-
|
|
622
|
+
return /* @__PURE__ */ x("div", { className: R, children: [
|
|
623
|
+
/* @__PURE__ */ e("span", { className: S, children: I }),
|
|
624
|
+
j == null || j === "" ? /* @__PURE__ */ e("span", { className: J, children: "—" }) : /* @__PURE__ */ e("span", { className: D, children: ke(j, A) })
|
|
621
625
|
] });
|
|
622
626
|
};
|
|
623
|
-
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: L.map((N) => /* @__PURE__ */ e(nt.Fragment, { children: me(N) }, N)) });
|
|
624
628
|
}
|
|
625
|
-
function
|
|
629
|
+
function Ln({
|
|
626
630
|
group: t,
|
|
627
631
|
fields: r,
|
|
628
632
|
draft: i,
|
|
@@ -630,59 +634,69 @@ function sn({
|
|
|
630
634
|
relations: s,
|
|
631
635
|
collection: l,
|
|
632
636
|
itemId: n,
|
|
633
|
-
errors:
|
|
634
|
-
visibleFields:
|
|
637
|
+
errors: a,
|
|
638
|
+
visibleFields: m,
|
|
635
639
|
lockedFields: h,
|
|
636
|
-
layoutAiEnabled:
|
|
637
|
-
displayOnly:
|
|
638
|
-
renderField:
|
|
640
|
+
layoutAiEnabled: k,
|
|
641
|
+
displayOnly: o,
|
|
642
|
+
renderField: g,
|
|
639
643
|
onCountChange: f,
|
|
640
|
-
isNew:
|
|
641
|
-
fieldValues:
|
|
642
|
-
isOpen:
|
|
643
|
-
onToggle:
|
|
644
|
-
summaryFields:
|
|
645
|
-
m2mCounts:
|
|
646
|
-
o2mCounts:
|
|
647
|
-
o2mAggValues:
|
|
648
|
-
summaryAggConfigs:
|
|
649
|
-
o2mLoading:
|
|
650
|
-
footerSlot:
|
|
651
|
-
ownersCollection:
|
|
644
|
+
isNew: y,
|
|
645
|
+
fieldValues: q,
|
|
646
|
+
isOpen: L,
|
|
647
|
+
onToggle: S,
|
|
648
|
+
summaryFields: D,
|
|
649
|
+
m2mCounts: J,
|
|
650
|
+
o2mCounts: R,
|
|
651
|
+
o2mAggValues: me,
|
|
652
|
+
summaryAggConfigs: N,
|
|
653
|
+
o2mLoading: U,
|
|
654
|
+
footerSlot: ie,
|
|
655
|
+
ownersCollection: A,
|
|
652
656
|
ownersItemId: I,
|
|
653
|
-
ownersAssignment:
|
|
654
|
-
pdfAssignment:
|
|
657
|
+
ownersAssignment: j,
|
|
658
|
+
pdfAssignment: M,
|
|
655
659
|
pdfAttachField: d,
|
|
656
660
|
pdfFilenameTemplate: B,
|
|
657
|
-
layoutId:
|
|
658
|
-
hideEmptySummary:
|
|
659
|
-
widgetAssignments:
|
|
660
|
-
widgetApiBase:
|
|
661
|
-
fieldInlineDisplay:
|
|
662
|
-
swapConfig:
|
|
663
|
-
swapped:
|
|
664
|
-
onSwapToggle:
|
|
665
|
-
alternateFields:
|
|
666
|
-
alternateWidths:
|
|
661
|
+
layoutId: $,
|
|
662
|
+
hideEmptySummary: G,
|
|
663
|
+
widgetAssignments: K,
|
|
664
|
+
widgetApiBase: E,
|
|
665
|
+
fieldInlineDisplay: Y,
|
|
666
|
+
swapConfig: V,
|
|
667
|
+
swapped: De,
|
|
668
|
+
onSwapToggle: $e,
|
|
669
|
+
alternateFields: Z,
|
|
670
|
+
alternateWidths: pe,
|
|
671
|
+
deferred: se,
|
|
672
|
+
onFirstOpen: le
|
|
667
673
|
}) {
|
|
668
|
-
var
|
|
669
|
-
const [
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
}, [
|
|
673
|
-
|
|
674
|
-
}, [
|
|
675
|
-
const
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
674
|
+
var Me;
|
|
675
|
+
const [ot, ct] = Q(t.is_collapsed ?? !1), [dt, ut] = Q(!1), F = Vt(), H = (p, _) => Gt(F, p, _, { asChild: !0 }), ae = (p) => ({ kind: "slot", field: p, group_key: t.key }), Fe = !!(F != null && F.showHidden), [je, Le] = Q({}), { data: fe } = At(l), X = (F == null ? void 0 : F.fold) ?? null, ee = (F == null ? void 0 : F.reveal) ?? null, [Oe, he] = Q(null);
|
|
676
|
+
ne(() => {
|
|
677
|
+
X && he(!X.open);
|
|
678
|
+
}, [X == null ? void 0 : X.seq]), ne(() => {
|
|
679
|
+
ee && Pt(ee.target) === t.key && he(!1);
|
|
680
|
+
}, [ee == null ? void 0 : ee.seq]);
|
|
681
|
+
const qe = S !== void 0, z = Oe ?? (qe ? !L : ot);
|
|
682
|
+
ne(() => {
|
|
683
|
+
se && !z && (le == null || le(t.key));
|
|
684
|
+
}, [se, z, le, t.key]);
|
|
685
|
+
const be = Oe !== null ? () => he((p) => !p) : qe ? S : () => ct((p) => !p), Be = !F && $ != null, ge = () => {
|
|
686
|
+
Be && it({ layoutId: Number($), collection: l, kind: "opened", key: t.key });
|
|
687
|
+
}, mt = () => {
|
|
688
|
+
z && ge(), be == null || be();
|
|
689
|
+
}, pt = !o && r.some((p) => a[p.field]), Ue = F ? "always" : t.visibility_mode ?? "always";
|
|
690
|
+
if (Ue === "new_only" && !y || Ue === "existing_only" && y) return null;
|
|
691
|
+
const te = K ?? [], ft = !y && te.some((p) => p.widget_id != null && je[p.field] === void 0);
|
|
692
|
+
let oe = !1;
|
|
693
|
+
if (t.hide_when_empty && q && !F && (oe = q.every(
|
|
694
|
+
(_) => _ == null || _ === "" || Array.isArray(_) && _.length === 0
|
|
695
|
+
) && !ft && te.every((_) => !je[_.field])), oe && te.length === 0) return null;
|
|
696
|
+
const xe = Se(null), ye = Qt(xe), Te = tn(t.icon), ht = Fe ? r : r.filter((p) => !p.hidden), Ie = (Me = fe == null ? void 0 : fe.sections) == null ? void 0 : Me[t.key], bt = Array.isArray(Ie) && Ie.length > 0, gt = (p) => bt ? /* @__PURE__ */ x("div", { className: "relative", children: [
|
|
697
|
+
p,
|
|
684
698
|
/* @__PURE__ */ e("span", { className: "absolute right-[52px] top-1/2 flex -translate-y-1/2", children: /* @__PURE__ */ e(
|
|
685
|
-
|
|
699
|
+
Et,
|
|
686
700
|
{
|
|
687
701
|
collection: l,
|
|
688
702
|
kind: "section",
|
|
@@ -690,42 +704,53 @@ function sn({
|
|
|
690
704
|
label: t.label || t.key
|
|
691
705
|
}
|
|
692
706
|
) })
|
|
693
|
-
] }) :
|
|
694
|
-
return /* @__PURE__ */
|
|
707
|
+
] }) : p, Ne = (p) => Fe && (p.hidden || !(m.has(p.field) || !m.size));
|
|
708
|
+
return /* @__PURE__ */ x(
|
|
695
709
|
"div",
|
|
696
710
|
{
|
|
697
|
-
|
|
711
|
+
"data-loads-on-open": se ? "" : void 0,
|
|
712
|
+
className: W(
|
|
698
713
|
"nvr-section-enter rounded-xl border border-slate-200 bg-white dark:bg-card dark:border-border",
|
|
699
|
-
|
|
700
|
-
|
|
714
|
+
o && "bg-slate-50/60 dark:bg-slate-900/20",
|
|
715
|
+
oe && "hidden"
|
|
701
716
|
),
|
|
717
|
+
onPointerDownCapture: (p) => {
|
|
718
|
+
var _, c;
|
|
719
|
+
(c = (_ = p.target) == null ? void 0 : _.closest) != null && c.call(_, "[data-usage-header]") || ge();
|
|
720
|
+
},
|
|
721
|
+
onFocusCapture: (p) => {
|
|
722
|
+
var _, c;
|
|
723
|
+
(c = (_ = p.target) == null ? void 0 : _.closest) != null && c.call(_, "[data-usage-header]") || ge();
|
|
724
|
+
},
|
|
702
725
|
children: [
|
|
703
|
-
|
|
704
|
-
|
|
726
|
+
Be && !oe && /* @__PURE__ */ e(ln, { layoutId: Number($), collection: l, sectionKey: t.key }),
|
|
727
|
+
gt(
|
|
728
|
+
/* @__PURE__ */ x(
|
|
705
729
|
"button",
|
|
706
730
|
{
|
|
707
731
|
type: "button",
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
732
|
+
"data-usage-header": "",
|
|
733
|
+
onClick: mt,
|
|
734
|
+
"data-design-group-header": F ? "" : void 0,
|
|
735
|
+
className: W(
|
|
711
736
|
"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",
|
|
712
737
|
// Round the bottom only when nothing renders below the header — an
|
|
713
738
|
// expanded body (or collapsed summary strip) square-joins it, and a
|
|
714
739
|
// rounded hover overlay would leave see-through notches at the seam.
|
|
715
|
-
|
|
740
|
+
z && !(D && D.length > 0) && "rounded-b-xl"
|
|
716
741
|
),
|
|
717
742
|
children: [
|
|
718
|
-
|
|
743
|
+
Te && /* @__PURE__ */ e(Te, { className: "h-3.5 w-3.5 shrink-0 text-slate-400 dark:text-slate-500" }),
|
|
719
744
|
/* @__PURE__ */ e("span", { className: "font-medium text-[13px] shrink-0 text-slate-800 dark:text-slate-200", children: t.label }),
|
|
720
745
|
/* @__PURE__ */ e("span", { className: "flex-1" }),
|
|
721
|
-
|
|
746
|
+
pt && /* @__PURE__ */ e("span", { className: "nvr-pop h-2 w-2 rounded-full bg-destructive shrink-0" }),
|
|
722
747
|
/* @__PURE__ */ e(
|
|
723
|
-
|
|
748
|
+
St,
|
|
724
749
|
{
|
|
725
|
-
"data-design-pass":
|
|
726
|
-
className:
|
|
750
|
+
"data-design-pass": F ? "" : void 0,
|
|
751
|
+
className: W(
|
|
727
752
|
"h-4 w-4 text-slate-400 dark:text-slate-500 transition-transform duration-200",
|
|
728
|
-
|
|
753
|
+
z && "-rotate-90"
|
|
729
754
|
)
|
|
730
755
|
}
|
|
731
756
|
)
|
|
@@ -733,304 +758,403 @@ function sn({
|
|
|
733
758
|
}
|
|
734
759
|
)
|
|
735
760
|
),
|
|
736
|
-
|
|
737
|
-
|
|
761
|
+
z && D && D.length > 0 && /* @__PURE__ */ e(
|
|
762
|
+
sn,
|
|
738
763
|
{
|
|
739
|
-
summaryFields:
|
|
764
|
+
summaryFields: D,
|
|
740
765
|
fields: r,
|
|
741
766
|
draft: i,
|
|
742
767
|
relations: s,
|
|
743
768
|
collection: l,
|
|
744
769
|
itemId: n,
|
|
745
|
-
ownersCollection:
|
|
770
|
+
ownersCollection: A,
|
|
746
771
|
ownersItemId: I,
|
|
747
|
-
ownersAssignment:
|
|
748
|
-
m2mCounts:
|
|
749
|
-
o2mCounts:
|
|
750
|
-
o2mAggValues:
|
|
751
|
-
summaryAggConfigs:
|
|
752
|
-
o2mLoading:
|
|
753
|
-
hideEmpty: !!t.summary_hide_empty || !!
|
|
772
|
+
ownersAssignment: j,
|
|
773
|
+
m2mCounts: J,
|
|
774
|
+
o2mCounts: R,
|
|
775
|
+
o2mAggValues: me,
|
|
776
|
+
summaryAggConfigs: N,
|
|
777
|
+
o2mLoading: U,
|
|
778
|
+
hideEmpty: !!t.summary_hide_empty || !!G
|
|
754
779
|
}
|
|
755
780
|
),
|
|
756
|
-
|
|
757
|
-
|
|
781
|
+
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(
|
|
782
|
+
Ae,
|
|
758
783
|
{
|
|
759
|
-
widgetId:
|
|
760
|
-
inputBindings:
|
|
784
|
+
widgetId: p.widget_id,
|
|
785
|
+
inputBindings: Qe(p.input_bindings),
|
|
761
786
|
itemDraft: i,
|
|
762
787
|
frameless: !0,
|
|
763
|
-
apiBase:
|
|
764
|
-
onContentChange: (
|
|
765
|
-
(
|
|
788
|
+
apiBase: E,
|
|
789
|
+
onContentChange: (_) => Le(
|
|
790
|
+
(c) => c[p.field] === _ ? c : { ...c, [p.field]: _ }
|
|
766
791
|
)
|
|
767
792
|
},
|
|
768
|
-
|
|
793
|
+
p.field
|
|
769
794
|
)) }),
|
|
770
|
-
!
|
|
771
|
-
!
|
|
795
|
+
!z && /* @__PURE__ */ x("div", { className: "nvr-expand-in border-t border-slate-100 px-5 py-4", children: [
|
|
796
|
+
!o && /* @__PURE__ */ e(Zt, { group: t, className: "mb-3" }),
|
|
772
797
|
(() => {
|
|
773
|
-
const
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
})
|
|
779
|
-
|
|
798
|
+
const p = qt(ht, {
|
|
799
|
+
rows: o ? [] : Tt(t.swap_config).rows,
|
|
800
|
+
folded: (c) => !o && Ut(c._overrides),
|
|
801
|
+
keep: (c) => !!c.required,
|
|
802
|
+
filled: (c) => !Bt(i[c.field]) || !!a[c.field]
|
|
803
|
+
}), _ = p.units.map(
|
|
804
|
+
(c) => c.kind === "row" ? {
|
|
805
|
+
_k: `row:${c.row.key}`,
|
|
806
|
+
sort: c.members[0].sort ?? 0,
|
|
807
|
+
_t: "row",
|
|
808
|
+
row: c.row,
|
|
809
|
+
members: c.members
|
|
810
|
+
} : { _k: c.field.field, sort: c.field.sort ?? 0, _t: "field", f: c.field }
|
|
811
|
+
);
|
|
812
|
+
j && _.push({
|
|
780
813
|
_k: "__owners__",
|
|
781
|
-
sort:
|
|
814
|
+
sort: j.sort,
|
|
782
815
|
_t: "owners",
|
|
783
|
-
slot:
|
|
784
|
-
}),
|
|
816
|
+
slot: j
|
|
817
|
+
}), M && _.push({
|
|
785
818
|
_k: "__pdf__",
|
|
786
|
-
sort:
|
|
819
|
+
sort: M.sort,
|
|
787
820
|
_t: "pdf",
|
|
788
|
-
slot:
|
|
821
|
+
slot: M
|
|
789
822
|
});
|
|
790
|
-
for (const
|
|
791
|
-
|
|
792
|
-
return
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
823
|
+
for (const c of K ?? [])
|
|
824
|
+
_.push({ _k: c.field, sort: c.sort, _t: "widget", slot: c });
|
|
825
|
+
return _.sort((c, O) => c.sort - O.sort), F && _.length === 0 && p.folded.length === 0 ? /* @__PURE__ */ e(Mt, {}) : o ? /* @__PURE__ */ x(
|
|
826
|
+
"div",
|
|
827
|
+
{
|
|
828
|
+
ref: xe,
|
|
829
|
+
className: W(F && "relative", "grid grid-cols-12 gap-x-6 gap-y-3"),
|
|
830
|
+
children: [
|
|
831
|
+
/* @__PURE__ */ e(we, { gapClass: "gap-x-6" }),
|
|
832
|
+
_.map((c) => {
|
|
833
|
+
if (c._t === "owners") {
|
|
834
|
+
const v = c.slot.col_span ?? 12;
|
|
835
|
+
return H(
|
|
836
|
+
ae("__owners__"),
|
|
837
|
+
/* @__PURE__ */ e(
|
|
838
|
+
"div",
|
|
839
|
+
{
|
|
840
|
+
className: "min-w-0",
|
|
841
|
+
style: { gridColumn: `span ${v}` },
|
|
842
|
+
children: /* @__PURE__ */ e(
|
|
843
|
+
Ye,
|
|
844
|
+
{
|
|
845
|
+
collection: l,
|
|
846
|
+
itemId: n,
|
|
847
|
+
label: c.slot.label_override || "Owners"
|
|
848
|
+
}
|
|
849
|
+
)
|
|
850
|
+
},
|
|
851
|
+
"__owners__"
|
|
852
|
+
)
|
|
853
|
+
);
|
|
854
|
+
}
|
|
855
|
+
if (c._t === "pdf" || c._t === "widget" || c._t === "row") return null;
|
|
856
|
+
const O = c.f, b = s.find(
|
|
857
|
+
(v) => v.many_collection === l && v.many_field === O.field && !v.junction_field
|
|
858
|
+
);
|
|
859
|
+
return H(
|
|
860
|
+
{ kind: "field", field: O.field, group_key: t.key },
|
|
861
|
+
/* @__PURE__ */ x(
|
|
862
|
+
"div",
|
|
804
863
|
{
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
864
|
+
className: "min-w-0",
|
|
865
|
+
style: { gridColumn: `span ${Ee(O.options, ye)}` },
|
|
866
|
+
children: [
|
|
867
|
+
/* @__PURE__ */ e("dt", { className: "text-[11px] font-medium text-slate-400 truncate", children: O.label || lt(O.field) }),
|
|
868
|
+
/* @__PURE__ */ e("dd", { className: "mt-0.5 break-words", children: (b == null ? void 0 : b.one_collection) === "nivaro_users" ? (() => {
|
|
869
|
+
const v = i[O.field], P = Array.isArray(v) ? v : v != null && v !== "" ? [v] : [];
|
|
870
|
+
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(at, { userId: String(T) }, String(T))) });
|
|
871
|
+
})() : b != null && b.one_collection ? /* @__PURE__ */ e(re, { relCollection: b.one_collection, id: i[O.field] }) : /* @__PURE__ */ e("span", { className: "text-[13px] text-slate-700", children: ke(i[O.field], O) }) })
|
|
872
|
+
]
|
|
873
|
+
},
|
|
874
|
+
O.field
|
|
809
875
|
)
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
);
|
|
876
|
+
);
|
|
877
|
+
})
|
|
878
|
+
]
|
|
814
879
|
}
|
|
815
|
-
|
|
816
|
-
const
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
/* @__PURE__ */ N(
|
|
822
|
-
"div",
|
|
823
|
-
{
|
|
824
|
-
className: "min-w-0",
|
|
825
|
-
style: { gridColumn: `span ${Ce(y.options, Se)}` },
|
|
826
|
-
children: [
|
|
827
|
-
/* @__PURE__ */ e("dt", { className: "text-[11px] font-medium text-slate-400 truncate", children: y.label || Qe(y.field) }),
|
|
828
|
-
/* @__PURE__ */ e("dd", { className: "mt-0.5 break-words", children: (L == null ? void 0 : L.one_collection) === "nivaro_users" ? (() => {
|
|
829
|
-
const D = i[y.field], ne = Array.isArray(D) ? D : D != null && D !== "" ? [D] : [];
|
|
830
|
-
return ne.length === 0 ? /* @__PURE__ */ e("span", { className: "text-[13px] text-slate-400", children: "—" }) : /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1.5", children: ne.map((K) => /* @__PURE__ */ e(Ze, { userId: String(K) }, String(K))) });
|
|
831
|
-
})() : L != null && L.one_collection ? /* @__PURE__ */ e(X, { relCollection: L.one_collection, id: i[y.field] }) : /* @__PURE__ */ e("span", { className: "text-[13px] text-slate-700", children: he(i[y.field], y) }) })
|
|
832
|
-
]
|
|
833
|
-
},
|
|
834
|
-
y.field
|
|
835
|
-
)
|
|
836
|
-
);
|
|
837
|
-
}) }) : /* @__PURE__ */ e("div", { ref: ue, className: "grid grid-cols-12 gap-4 items-start", children: m.map((a) => {
|
|
838
|
-
var Ue, Te;
|
|
839
|
-
if (a._t === "owners") {
|
|
840
|
-
const S = a.slot.col_span ?? 12;
|
|
841
|
-
return H(
|
|
842
|
-
te("__owners__"),
|
|
843
|
-
/* @__PURE__ */ e("div", { style: { gridColumn: `span ${S}` }, children: /* @__PURE__ */ e(
|
|
844
|
-
Ke,
|
|
880
|
+
) : (() => {
|
|
881
|
+
const c = (b) => {
|
|
882
|
+
var ze, Ke;
|
|
883
|
+
if (b._t === "row")
|
|
884
|
+
return /* @__PURE__ */ e(
|
|
885
|
+
Ht,
|
|
845
886
|
{
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
887
|
+
row: b.row,
|
|
888
|
+
members: b.members,
|
|
889
|
+
containerWidth: ye,
|
|
890
|
+
errors: a,
|
|
891
|
+
renderMember: (w) => H(
|
|
892
|
+
{ kind: "field", field: w.field, group_key: t.key },
|
|
893
|
+
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
894
|
+
ve,
|
|
895
|
+
{
|
|
896
|
+
field: Wt(w),
|
|
897
|
+
draft: i,
|
|
898
|
+
onChange: u,
|
|
899
|
+
relations: s,
|
|
900
|
+
collection: l,
|
|
901
|
+
itemId: n,
|
|
902
|
+
error: a[w.field],
|
|
903
|
+
visible: m.has(w.field) || !m.size,
|
|
904
|
+
forceVisible: Ne(w) || void 0,
|
|
905
|
+
locked: h.has(w.field),
|
|
906
|
+
layoutAiEnabled: k,
|
|
907
|
+
renderField: g,
|
|
908
|
+
onCountChange: f
|
|
909
|
+
}
|
|
910
|
+
) }, w.field)
|
|
911
|
+
)
|
|
912
|
+
},
|
|
913
|
+
b._k
|
|
914
|
+
);
|
|
915
|
+
if (b._t === "owners") {
|
|
916
|
+
const w = b.slot.col_span ?? 12;
|
|
917
|
+
return H(
|
|
918
|
+
ae("__owners__"),
|
|
919
|
+
/* @__PURE__ */ e("div", { style: { gridColumn: `span ${w}` }, children: /* @__PURE__ */ e(
|
|
920
|
+
Ye,
|
|
921
|
+
{
|
|
922
|
+
collection: l,
|
|
923
|
+
itemId: n,
|
|
924
|
+
label: b.slot.label_override || "Owners"
|
|
925
|
+
}
|
|
926
|
+
) }, "__owners__")
|
|
927
|
+
);
|
|
928
|
+
}
|
|
929
|
+
if (b._t === "pdf") {
|
|
930
|
+
if (!$) return null;
|
|
931
|
+
const w = b.slot.col_span ?? 12, C = ((ze = b.slot.label_override) == null ? void 0 : ze.trim()) || "Generate PDF";
|
|
932
|
+
return H(
|
|
933
|
+
ae("__pdf__"),
|
|
934
|
+
/* @__PURE__ */ e("div", { style: { gridColumn: `span ${w}` }, children: /* @__PURE__ */ e(
|
|
935
|
+
nn,
|
|
936
|
+
{
|
|
937
|
+
collection: l,
|
|
938
|
+
itemId: n,
|
|
939
|
+
layoutId: $,
|
|
940
|
+
attachField: d ?? null,
|
|
941
|
+
filenameTemplate: B,
|
|
942
|
+
label: C
|
|
943
|
+
}
|
|
944
|
+
) }, "__pdf__")
|
|
945
|
+
);
|
|
946
|
+
}
|
|
947
|
+
if (b._t === "widget") {
|
|
948
|
+
if (!b.slot.widget_id) return null;
|
|
949
|
+
const w = b.slot.col_span ?? 12, C = Qe(b.slot.input_bindings);
|
|
950
|
+
return H(
|
|
951
|
+
ae(b.slot.field),
|
|
952
|
+
/* @__PURE__ */ e("div", { style: { gridColumn: `span ${w}` }, children: /* @__PURE__ */ e(
|
|
953
|
+
Ae,
|
|
954
|
+
{
|
|
955
|
+
widgetId: b.slot.widget_id,
|
|
956
|
+
inputBindings: C,
|
|
957
|
+
itemDraft: i,
|
|
958
|
+
label: b.slot.label_override ?? void 0,
|
|
959
|
+
defaultExpanded: b.slot.default_expanded ?? !0,
|
|
960
|
+
frameless: !0,
|
|
961
|
+
apiBase: E,
|
|
962
|
+
onContentChange: (He) => Le(
|
|
963
|
+
(_e) => _e[b.slot.field] === He ? _e : { ..._e, [b.slot.field]: He }
|
|
964
|
+
)
|
|
965
|
+
}
|
|
966
|
+
) }, b.slot.field)
|
|
967
|
+
);
|
|
968
|
+
}
|
|
969
|
+
const v = b.f, P = Y == null ? void 0 : Y[v.field], T = P == null ? void 0 : P.entries, xt = (P == null ? void 0 : P.separator) ?? null, ce = i[v.field], Ge = ce != null && ce !== "", Ve = T != null && T.length && Ge ? ((Ke = s.find(
|
|
970
|
+
(w) => w.many_collection === l && w.many_field === v.field && !w.junction_field
|
|
971
|
+
)) == null ? void 0 : Ke.one_collection) ?? null : null, Pe = (V == null ? void 0 : V.enabled) && v.field === V.primary_field, Ce = (() => {
|
|
972
|
+
const w = i[(V == null ? void 0 : V.primary_field) ?? ""];
|
|
973
|
+
return w != null && w !== "";
|
|
974
|
+
})(), Je = (Z ?? []).some((w) => {
|
|
975
|
+
const C = i[w.field];
|
|
976
|
+
return C != null && C !== "";
|
|
977
|
+
}), yt = Pe && $e ? /* @__PURE__ */ x("span", { className: "inline-flex items-center gap-1.5", children: [
|
|
978
|
+
/* @__PURE__ */ e(
|
|
979
|
+
"button",
|
|
980
|
+
{
|
|
981
|
+
type: "button",
|
|
982
|
+
onClick: $e,
|
|
983
|
+
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",
|
|
984
|
+
children: De ? V.back_label ?? "Back" : V.toggle_label ?? "Enter manually"
|
|
849
985
|
}
|
|
850
|
-
)
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
if (a._t === "pdf") {
|
|
854
|
-
if (!F) return null;
|
|
855
|
-
const S = a.slot.col_span ?? 12, J = ((Ue = a.slot.label_override) == null ? void 0 : Ue.trim()) || "Generate PDF";
|
|
856
|
-
return H(
|
|
857
|
-
te("__pdf__"),
|
|
858
|
-
/* @__PURE__ */ e("div", { style: { gridColumn: `span ${S}` }, children: /* @__PURE__ */ e(
|
|
859
|
-
Tt,
|
|
986
|
+
),
|
|
987
|
+
/* @__PURE__ */ x(
|
|
988
|
+
"span",
|
|
860
989
|
{
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
990
|
+
className: [
|
|
991
|
+
"inline-flex items-center gap-0.5 rounded px-1 py-0.5 text-[9px] font-medium",
|
|
992
|
+
Ce ? "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"
|
|
993
|
+
].join(" "),
|
|
994
|
+
title: "Original field",
|
|
995
|
+
children: [
|
|
996
|
+
/* @__PURE__ */ e(
|
|
997
|
+
"span",
|
|
998
|
+
{
|
|
999
|
+
className: [
|
|
1000
|
+
"h-1.5 w-1.5 rounded-full",
|
|
1001
|
+
Ce ? "bg-emerald-500" : "bg-slate-300 dark:bg-slate-600"
|
|
1002
|
+
].join(" ")
|
|
1003
|
+
}
|
|
1004
|
+
),
|
|
1005
|
+
"Original"
|
|
1006
|
+
]
|
|
867
1007
|
}
|
|
868
|
-
)
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
if (a._t === "widget") {
|
|
872
|
-
if (!a.slot.widget_id) return null;
|
|
873
|
-
const S = a.slot.col_span ?? 12, J = Re(a.slot.input_bindings);
|
|
874
|
-
return H(
|
|
875
|
-
te(a.slot.field),
|
|
876
|
-
/* @__PURE__ */ e("div", { style: { gridColumn: `span ${S}` }, children: /* @__PURE__ */ e(
|
|
877
|
-
Pe,
|
|
1008
|
+
),
|
|
1009
|
+
/* @__PURE__ */ x(
|
|
1010
|
+
"span",
|
|
878
1011
|
{
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
1012
|
+
className: [
|
|
1013
|
+
"inline-flex items-center gap-0.5 rounded px-1 py-0.5 text-[9px] font-medium",
|
|
1014
|
+
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"
|
|
1015
|
+
].join(" "),
|
|
1016
|
+
title: "Manual fields",
|
|
1017
|
+
children: [
|
|
1018
|
+
/* @__PURE__ */ e(
|
|
1019
|
+
"span",
|
|
1020
|
+
{
|
|
1021
|
+
className: [
|
|
1022
|
+
"h-1.5 w-1.5 rounded-full",
|
|
1023
|
+
Je ? "bg-emerald-500" : "bg-slate-300 dark:bg-slate-600"
|
|
1024
|
+
].join(" ")
|
|
1025
|
+
}
|
|
1026
|
+
),
|
|
1027
|
+
"Manual"
|
|
1028
|
+
]
|
|
889
1029
|
}
|
|
890
|
-
)
|
|
891
|
-
)
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
/* @__PURE__ */
|
|
912
|
-
|
|
913
|
-
{
|
|
914
|
-
className: [
|
|
915
|
-
"inline-flex items-center gap-0.5 rounded px-1 py-0.5 text-[9px] font-medium",
|
|
916
|
-
Be ? "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"
|
|
917
|
-
].join(" "),
|
|
918
|
-
title: "Original field",
|
|
919
|
-
children: [
|
|
920
|
-
/* @__PURE__ */ e(
|
|
921
|
-
"span",
|
|
922
|
-
{
|
|
923
|
-
className: [
|
|
924
|
-
"h-1.5 w-1.5 rounded-full",
|
|
925
|
-
Be ? "bg-emerald-500" : "bg-slate-300 dark:bg-slate-600"
|
|
926
|
-
].join(" ")
|
|
927
|
-
}
|
|
928
|
-
),
|
|
929
|
-
"Original"
|
|
930
|
-
]
|
|
931
|
-
}
|
|
932
|
-
),
|
|
933
|
-
/* @__PURE__ */ N(
|
|
934
|
-
"span",
|
|
935
|
-
{
|
|
936
|
-
className: [
|
|
937
|
-
"inline-flex items-center gap-0.5 rounded px-1 py-0.5 text-[9px] font-medium",
|
|
938
|
-
qe ? "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"
|
|
939
|
-
].join(" "),
|
|
940
|
-
title: "Manual fields",
|
|
941
|
-
children: [
|
|
942
|
-
/* @__PURE__ */ e(
|
|
943
|
-
"span",
|
|
944
|
-
{
|
|
945
|
-
className: [
|
|
946
|
-
"h-1.5 w-1.5 rounded-full",
|
|
947
|
-
qe ? "bg-emerald-500" : "bg-slate-300 dark:bg-slate-600"
|
|
948
|
-
].join(" ")
|
|
949
|
-
}
|
|
950
|
-
),
|
|
951
|
-
"Manual"
|
|
952
|
-
]
|
|
953
|
-
}
|
|
954
|
-
)
|
|
955
|
-
] }) : void 0, ot = Le && be && (W != null && W.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: W.map((S) => {
|
|
956
|
-
const J = (ae == null ? void 0 : ae[S.field]) ?? 2;
|
|
957
|
-
return /* @__PURE__ */ e("div", { style: { gridColumn: `span ${J}` }, children: /* @__PURE__ */ e(
|
|
958
|
-
Ve,
|
|
1030
|
+
)
|
|
1031
|
+
] }) : void 0, Nt = Pe && De && (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) => {
|
|
1032
|
+
const C = (pe == null ? void 0 : pe[w.field]) ?? 2;
|
|
1033
|
+
return /* @__PURE__ */ e("div", { style: { gridColumn: `span ${C}` }, children: /* @__PURE__ */ e(
|
|
1034
|
+
ve,
|
|
1035
|
+
{
|
|
1036
|
+
field: w,
|
|
1037
|
+
draft: i,
|
|
1038
|
+
onChange: u,
|
|
1039
|
+
relations: s,
|
|
1040
|
+
collection: l,
|
|
1041
|
+
itemId: n,
|
|
1042
|
+
error: a[w.field],
|
|
1043
|
+
visible: !0,
|
|
1044
|
+
forceVisible: !0,
|
|
1045
|
+
locked: h.has(w.field),
|
|
1046
|
+
layoutAiEnabled: k,
|
|
1047
|
+
renderField: g,
|
|
1048
|
+
onCountChange: f
|
|
1049
|
+
}
|
|
1050
|
+
) }, w.field);
|
|
1051
|
+
}) }) }) : void 0, Re = /* @__PURE__ */ e(
|
|
1052
|
+
ve,
|
|
959
1053
|
{
|
|
960
|
-
field:
|
|
1054
|
+
field: v,
|
|
961
1055
|
draft: i,
|
|
962
1056
|
onChange: u,
|
|
963
1057
|
relations: s,
|
|
964
1058
|
collection: l,
|
|
965
1059
|
itemId: n,
|
|
966
|
-
error:
|
|
967
|
-
visible: !
|
|
968
|
-
forceVisible:
|
|
969
|
-
locked: h.has(
|
|
970
|
-
layoutAiEnabled:
|
|
971
|
-
renderField:
|
|
972
|
-
onCountChange: f
|
|
1060
|
+
error: a[v.field],
|
|
1061
|
+
visible: m.has(v.field) || !m.size,
|
|
1062
|
+
forceVisible: Ne(v) || void 0,
|
|
1063
|
+
locked: h.has(v.field),
|
|
1064
|
+
layoutAiEnabled: k,
|
|
1065
|
+
renderField: g,
|
|
1066
|
+
onCountChange: f,
|
|
1067
|
+
swapButton: yt,
|
|
1068
|
+
swapContent: Nt
|
|
973
1069
|
}
|
|
974
|
-
)
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
1070
|
+
);
|
|
1071
|
+
return H(
|
|
1072
|
+
{ kind: "field", field: v.field, group_key: t.key },
|
|
1073
|
+
/* @__PURE__ */ x(
|
|
1074
|
+
"div",
|
|
1075
|
+
{
|
|
1076
|
+
style: { gridColumn: `span ${Ee(v.options, ye)}` },
|
|
1077
|
+
children: [
|
|
1078
|
+
Ne(v) ? /* @__PURE__ */ e("div", { "data-design-hidden": "", className: "opacity-40", children: Re }) : Re,
|
|
1079
|
+
(T == null ? void 0 : T.length) && Ge && Ve && /* @__PURE__ */ e(
|
|
1080
|
+
en,
|
|
1081
|
+
{
|
|
1082
|
+
relCollection: Ve,
|
|
1083
|
+
relId: ce,
|
|
1084
|
+
entries: T,
|
|
1085
|
+
separator: xt
|
|
1086
|
+
}
|
|
1087
|
+
)
|
|
1088
|
+
]
|
|
1089
|
+
},
|
|
1090
|
+
v.field
|
|
1091
|
+
)
|
|
1092
|
+
);
|
|
1093
|
+
}, O = p.folded.map((b) => ({
|
|
1094
|
+
_k: b.field,
|
|
1095
|
+
sort: b.sort ?? 0,
|
|
1096
|
+
_t: "field",
|
|
1097
|
+
f: b
|
|
1098
|
+
}));
|
|
1099
|
+
return /* @__PURE__ */ x(_t, { children: [
|
|
1100
|
+
/* @__PURE__ */ x(
|
|
998
1101
|
"div",
|
|
999
1102
|
{
|
|
1000
|
-
|
|
1103
|
+
ref: xe,
|
|
1104
|
+
className: W(F && "relative", "grid grid-cols-12 gap-4 items-start"),
|
|
1001
1105
|
children: [
|
|
1002
|
-
|
|
1003
|
-
(
|
|
1004
|
-
It,
|
|
1005
|
-
{
|
|
1006
|
-
relCollection: Oe,
|
|
1007
|
-
relId: K,
|
|
1008
|
-
entries: D,
|
|
1009
|
-
separator: ne
|
|
1010
|
-
}
|
|
1011
|
-
)
|
|
1106
|
+
/* @__PURE__ */ e(we, {}),
|
|
1107
|
+
_.map(c)
|
|
1012
1108
|
]
|
|
1013
|
-
}
|
|
1014
|
-
|
|
1109
|
+
}
|
|
1110
|
+
),
|
|
1111
|
+
/* @__PURE__ */ e(
|
|
1112
|
+
Kt,
|
|
1113
|
+
{
|
|
1114
|
+
count: O.length,
|
|
1115
|
+
open: dt,
|
|
1116
|
+
forcedOpen: p.forcedOpen,
|
|
1117
|
+
design: !!F,
|
|
1118
|
+
onToggle: () => ut((b) => !b),
|
|
1119
|
+
children: /* @__PURE__ */ x(
|
|
1120
|
+
"div",
|
|
1121
|
+
{
|
|
1122
|
+
className: W(F && "relative", "grid grid-cols-12 gap-4 items-start"),
|
|
1123
|
+
children: [
|
|
1124
|
+
/* @__PURE__ */ e(we, {}),
|
|
1125
|
+
O.map(c)
|
|
1126
|
+
]
|
|
1127
|
+
}
|
|
1128
|
+
)
|
|
1129
|
+
}
|
|
1015
1130
|
)
|
|
1016
|
-
);
|
|
1017
|
-
})
|
|
1131
|
+
] });
|
|
1132
|
+
})();
|
|
1018
1133
|
})(),
|
|
1019
|
-
|
|
1134
|
+
ie && /* @__PURE__ */ e("div", { className: "mt-4", children: ie })
|
|
1020
1135
|
] })
|
|
1021
1136
|
]
|
|
1022
1137
|
}
|
|
1023
1138
|
);
|
|
1024
1139
|
}
|
|
1140
|
+
function ln({
|
|
1141
|
+
layoutId: t,
|
|
1142
|
+
collection: r,
|
|
1143
|
+
sectionKey: i
|
|
1144
|
+
}) {
|
|
1145
|
+
return ne(() => {
|
|
1146
|
+
it({ layoutId: t, collection: r, kind: "shown", key: i });
|
|
1147
|
+
}, [t, r, i]), null;
|
|
1148
|
+
}
|
|
1025
1149
|
export {
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1150
|
+
Ln as GroupSection,
|
|
1151
|
+
en as InlineDisplay,
|
|
1152
|
+
Ye as OwnersInline,
|
|
1153
|
+
Xt as OwnersInlineCompact,
|
|
1154
|
+
re as RelationCell,
|
|
1155
|
+
jn as StripFieldValue,
|
|
1156
|
+
at as UserChip,
|
|
1157
|
+
Bn as UserRosterCluster,
|
|
1158
|
+
ke as formatDisplayValue,
|
|
1159
|
+
rn as useChangePulse
|
|
1036
1160
|
};
|