@nivaro/react 0.3.36 → 0.3.37
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/slots/CommentsSlot.js +44 -36
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +9 -1
- package/dist/shared/components/AgentBadge.js +26 -0
- package/dist/shared/components/AgentQuestionsCard.js +198 -0
- package/dist/shared/components/ItemEditForm.js +3329 -3263
- package/dist/shared/components/McpConnectionScope.js +480 -0
- package/dist/shared/components/MyWorkView.js +223 -208
- package/dist/shared/components/RecordReadView.js +620 -575
- package/dist/shared/components/chat/ChatPanel.js +683 -671
- package/dist/shared/components/imports/DownloadSampleButton.js +69 -0
- package/dist/shared/components/imports/ImportConsole.js +106 -104
- package/dist/shared/components/imports/RunDetailSheet.js +11 -10
- package/dist/shared/components/item-edit/FieldAffordances.js +32 -32
- package/dist/shared/components/item-edit/FormTour.js +279 -0
- package/dist/shared/components/item-edit/GroupSection.js +377 -360
- package/dist/shared/components/item-edit/PersonalDefaultControl.js +28 -28
- package/dist/shared/components/item-edit/entry/EntryStrip.js +30 -26
- package/dist/shared/components/item-edit/form-density.js +36 -0
- package/dist/shared/components/item-edit/useFormUsageBeacon.js +59 -46
- package/dist/shared/components/item-edit/usePersonalDefaults.js +312 -296
- package/dist/shared/components/layout-editor/AddPanel.js +349 -192
- package/dist/shared/components/layout-editor/DesignNode.js +126 -112
- package/dist/shared/components/layout-editor/EditorTopBar.js +123 -103
- package/dist/shared/components/layout-editor/LayoutEditor.js +829 -751
- package/dist/shared/components/layout-editor/PlaceTools.js +334 -0
- package/dist/shared/components/layout-editor/SlashInsert.js +252 -0
- package/dist/shared/components/layout-editor/StructureMenu.js +285 -242
- package/dist/shared/components/layout-editor/add-target.js +54 -43
- package/dist/shared/components/layout-editor/ai-forms/AiComposer.js +238 -155
- package/dist/shared/components/layout-editor/ai-forms/AiFormsButton.js +1 -1
- package/dist/shared/components/layout-editor/ai-forms/ai-forms-api.js +15 -12
- package/dist/shared/components/layout-editor/dnd/LayoutDndProvider.js +347 -189
- package/dist/shared/components/layout-editor/dnd/TrashZone.js +60 -32
- package/dist/shared/components/layout-editor/dnd/UndoChip.js +76 -0
- package/dist/shared/components/layout-editor/dnd/merge-drop.js +33 -0
- package/dist/shared/components/layout-editor/dnd/multi-drop.js +87 -0
- package/dist/shared/components/layout-editor/dnd/node.js +115 -105
- package/dist/shared/components/layout-editor/dnd/sensors.js +23 -0
- package/dist/shared/components/layout-editor/dnd/trash-drop.js +34 -28
- package/dist/shared/components/layout-editor/dnd/trash-links.js +97 -0
- package/dist/shared/components/layout-editor/even-row.js +86 -0
- package/dist/shared/components/layout-editor/field-list.js +99 -0
- package/dist/shared/components/layout-editor/format-painter.js +102 -0
- package/dist/shared/components/layout-editor/grid-guides.js +15 -13
- package/dist/shared/components/layout-editor/inspector/BehaviourSettings.js +150 -132
- package/dist/shared/components/layout-editor/inspector/BulkInspector.js +57 -53
- package/dist/shared/components/layout-editor/inspector/EvenRowAction.js +31 -0
- package/dist/shared/components/layout-editor/inspector/GroupInspector.js +154 -141
- package/dist/shared/components/layout-editor/inspector/Inspector.js +209 -178
- package/dist/shared/components/layout-editor/inspector/LookTab.js +106 -98
- package/dist/shared/components/layout-editor/inspector/RulesTab.js +38 -37
- package/dist/shared/components/layout-editor/inspector/kit.js +280 -223
- package/dist/shared/components/layout-editor/keyboard-move.js +15 -15
- package/dist/shared/components/layout-editor/lint/LabelStyle.js +201 -0
- package/dist/shared/components/layout-editor/lint/LintPanel.js +132 -84
- package/dist/shared/components/layout-editor/lint/lint-api.js +65 -28
- package/dist/shared/components/layout-editor/nav/NavTools.js +14 -12
- package/dist/shared/components/layout-editor/nav/ZoomControls.js +145 -0
- package/dist/shared/components/layout-editor/nav/useEditorNav.js +34 -32
- package/dist/shared/components/layout-editor/nav/view-prefs.js +100 -15
- package/dist/shared/components/layout-editor/outputs/LayoutFile.js +89 -0
- package/dist/shared/components/layout-editor/outputs/OutputsButton.js +272 -195
- package/dist/shared/components/layout-editor/outputs/layout-file-plan.js +176 -0
- package/dist/shared/components/layout-editor/outputs/output-api.js +71 -37
- package/dist/shared/components/layout-editor/overview/describe-conditions.js +16 -11
- package/dist/shared/components/layout-editor/overview/purpose.js +5 -5
- package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
- package/dist/shared/components/layout-editor/pin.js +37 -19
- package/dist/shared/components/layout-editor/place-clip.js +257 -0
- package/dist/shared/components/layout-editor/preview/PreviewModes.js +27 -26
- package/dist/shared/components/layout-editor/preview/PreviewPanes.js +148 -117
- package/dist/shared/components/layout-editor/preview/SampleRecord.js +113 -0
- package/dist/shared/components/layout-editor/preview/preview-model.js +79 -60
- package/dist/shared/components/layout-editor/preview/sample-record.js +105 -0
- package/dist/shared/components/layout-editor/removed-log.js +151 -0
- package/dist/shared/components/layout-editor/reuse/LibraryRows.js +109 -78
- package/dist/shared/components/layout-editor/reuse/linked-sections.js +373 -0
- package/dist/shared/components/layout-editor/revert-element.js +140 -0
- package/dist/shared/components/layout-editor/section-structure.js +193 -170
- package/dist/shared/components/layout-editor/settings/EntrySection.js +63 -45
- package/dist/shared/components/layout-editor/settings/LayoutSection.js +63 -32
- package/dist/shared/components/layout-editor/settings/ResolveSettings.js +179 -137
- package/dist/shared/components/layout-editor/settings/WhoSection.js +18 -17
- package/dist/shared/components/layout-editor/settings/settings-registry.js +24 -0
- package/dist/shared/components/layout-editor/shortcuts.js +21 -16
- package/dist/shared/components/layout-editor/structure-ops.js +221 -195
- package/dist/shared/components/layout-editor/usage/UsagePanel.js +133 -85
- package/dist/shared/components/layout-editor/usage/refusal-lens.js +130 -0
- package/dist/shared/components/layout-editor/usage/usage-api.js +12 -11
- package/dist/shared/components/panels/CommentPanel.js +47 -45
- package/dist/shared/components/panels/RevisionsPanel.js +66 -64
- package/dist/shared/components/panels/TaskPanel.js +395 -332
- package/dist/shared/components/profile/AgentsPanel.js +196 -147
- package/dist/shared/components/profile/ConnectionRollback.js +329 -0
- package/dist/shared/components/profile/MyDefaultsCard.js +526 -520
- package/dist/shared/lib/entry-config.js +22 -22
- package/dist/shared/lib/form-usage-beacon.js +91 -55
- package/dist/shared/lib/layout-lint.js +530 -284
- package/dist/shared/lib/layout-resolve.js +58 -44
- package/package.json +1 -1
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useQuery as
|
|
3
|
-
import { Pencil as
|
|
4
|
-
import { useMemo as
|
|
5
|
-
import { DrilldownContext as
|
|
6
|
-
import { useDebounced as
|
|
7
|
-
import { parseAllowedCollections as
|
|
1
|
+
import { jsx as l, jsxs as f, Fragment as me } from "react/jsx-runtime";
|
|
2
|
+
import { useQuery as U, useQueryClient as Dt } from "@tanstack/react-query";
|
|
3
|
+
import { Pencil as Lt, ChevronDown as Et } from "lucide-react";
|
|
4
|
+
import { useMemo as ve, useRef as Pt, useState as te, useEffect as _e, useCallback as ut, Fragment as Mt } from "react";
|
|
5
|
+
import { DrilldownContext as jt, useNivaroClient as De, useApiFetchConfig as Kt, useDrilldown as gt } from "../context.js";
|
|
6
|
+
import { useDebounced as Wt } from "../hooks/useDebounced.js";
|
|
7
|
+
import { parseAllowedCollections as It } from "../lib/allowed-collections.js";
|
|
8
8
|
import { get as G } from "../lib/commands.js";
|
|
9
|
-
import { readGroupStructure as
|
|
10
|
-
import { useLiveRecord as
|
|
11
|
-
import { isDisplayFormulaField as
|
|
12
|
-
import { useRecordReader as
|
|
9
|
+
import { readGroupStructure as Ut, isFolded as Vt, isEmptyValue as ye, planFieldGrid as Bt } from "../lib/form-structure.js";
|
|
10
|
+
import { useLiveRecord as Jt } from "../lib/live.js";
|
|
11
|
+
import { isDisplayFormulaField as Re, resolvePlacementText as Gt, displayFormulaOf as Ht, formatDisplayValue as Qt } from "../lib/placement-behaviour.js";
|
|
12
|
+
import { useRecordReader as Yt } from "../lib/record-loader.js";
|
|
13
13
|
import { sanitizeHtml as zt } from "../lib/sanitize-html.js";
|
|
14
|
-
import { titleCase as
|
|
15
|
-
import { matchesVisibleWhen as
|
|
16
|
-
import { InboundRequestPopover as
|
|
17
|
-
import { FileM2MField as
|
|
18
|
-
import { useFieldTouches as
|
|
19
|
-
import { richTextToPlain as
|
|
20
|
-
import { PersonalDefaultMark as
|
|
21
|
-
import { usePlacementTextContext as
|
|
22
|
-
import { UserChip as
|
|
23
|
-
import { DesignNode as
|
|
24
|
-
import { DesignCanvas as
|
|
25
|
-
import { revealGroupKey as
|
|
26
|
-
import { useRecordIntegrity as
|
|
27
|
-
import { SimpleSelectXs as
|
|
28
|
-
import { WidgetSlot as
|
|
29
|
-
const
|
|
14
|
+
import { titleCase as ze, formatRelative as Ce } from "../lib/utils.js";
|
|
15
|
+
import { matchesVisibleWhen as Xt } from "../lib/visible-when.js";
|
|
16
|
+
import { InboundRequestPopover as Zt } from "./integrations/InboundRequest.js";
|
|
17
|
+
import { FileM2MField as el } from "./item-edit/FilePickerField.js";
|
|
18
|
+
import { useFieldTouches as tl } from "./item-edit/HeaderFreshness.js";
|
|
19
|
+
import { richTextToPlain as ll } from "./item-edit/helpers.js";
|
|
20
|
+
import { PersonalDefaultMark as ft } from "./item-edit/PersonalDefaultControl.js";
|
|
21
|
+
import { usePlacementTextContext as rl, evaluateDisplayFormula as nl } from "./item-edit/placement-behaviour.js";
|
|
22
|
+
import { UserChip as bt } from "./item-edit/UserChip.js";
|
|
23
|
+
import { DesignNode as al } from "./layout-editor/DesignNode.js";
|
|
24
|
+
import { DesignCanvas as il } from "./layout-editor/design-canvas.js";
|
|
25
|
+
import { revealGroupKey as sl } from "./layout-editor/design-context.js";
|
|
26
|
+
import { useRecordIntegrity as dl, integrityByField as ol } from "./panels/RecordIntegrityBanner.js";
|
|
27
|
+
import { SimpleSelectXs as pt } from "./ui/SimpleSelect.js";
|
|
28
|
+
import { WidgetSlot as cl } from "./WidgetSlot.js";
|
|
29
|
+
const xe = (a) => {
|
|
30
30
|
if (!a) return {};
|
|
31
31
|
if (typeof a == "object") return a;
|
|
32
32
|
try {
|
|
@@ -34,18 +34,40 @@ const he = (a) => {
|
|
|
34
34
|
} catch {
|
|
35
35
|
return {};
|
|
36
36
|
}
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
37
|
+
}, ml = 3;
|
|
38
|
+
function ul(a) {
|
|
39
|
+
let m = a;
|
|
40
|
+
if (typeof m == "string")
|
|
41
|
+
try {
|
|
42
|
+
m = JSON.parse(m);
|
|
43
|
+
} catch {
|
|
44
|
+
m = m ? m.split(",").map((d) => d.trim()) : [];
|
|
45
|
+
}
|
|
46
|
+
if (!Array.isArray(m)) return [];
|
|
47
|
+
const b = [];
|
|
48
|
+
for (const d of m)
|
|
49
|
+
if (typeof d == "string" && d) b.push({ field: d, label: null });
|
|
50
|
+
else if (d && typeof d == "object" && typeof d.field == "string") {
|
|
51
|
+
const O = d.label;
|
|
52
|
+
b.push({
|
|
53
|
+
field: d.field,
|
|
54
|
+
label: typeof O == "string" && O.trim() ? O.trim() : null
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
return b.filter((d) => !d.field.startsWith("__"));
|
|
58
|
+
}
|
|
59
|
+
const yt = (a) => {
|
|
60
|
+
const m = String(a).match(/^(\d{4})-(\d{2})-(\d{2})(?:[T ]00:00:00(?:\.0+)?(?:Z|[+-]00:?00)?)?$/);
|
|
61
|
+
if (m) return `${m[2]}/${m[3]}/${m[1]}`;
|
|
62
|
+
const b = new Date(String(a));
|
|
63
|
+
return Number.isNaN(b.getTime()) ? String(a) : `${String(b.getMonth() + 1).padStart(2, "0")}/${String(b.getDate()).padStart(2, "0")}/${b.getFullYear()}`;
|
|
64
|
+
}, Xe = (a) => {
|
|
65
|
+
const m = Number(a);
|
|
66
|
+
return Number.isNaN(m) ? String(a) : `$${m.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`;
|
|
67
|
+
}, Ue = (a) => {
|
|
68
|
+
const m = Number(a);
|
|
69
|
+
return Number.isNaN(m) ? String(a) : m.toLocaleString("en-US");
|
|
70
|
+
}, Ie = "text-[11.5px] font-medium text-slate-500 dark:text-slate-400", le = () => /* @__PURE__ */ l("span", { className: "text-slate-300 dark:text-slate-600", children: "—" }), fl = `
|
|
49
71
|
[data-read-board]{grid-template-columns:minmax(0,1fr)}
|
|
50
72
|
[data-read-dl]{grid-template-columns:repeat(2,minmax(0,1fr))}
|
|
51
73
|
@media (min-width:640px){[data-read-dl="full"]{grid-template-columns:repeat(3,minmax(0,1fr))}}
|
|
@@ -60,48 +82,48 @@ const he = (a) => {
|
|
|
60
82
|
}
|
|
61
83
|
@media (min-width:1536px){[data-read-dl="full"]{grid-template-columns:repeat(6,minmax(0,1fr))}}
|
|
62
84
|
`;
|
|
63
|
-
function
|
|
85
|
+
function Ve({
|
|
64
86
|
value: a,
|
|
65
|
-
trueTone:
|
|
87
|
+
trueTone: m = "positive"
|
|
66
88
|
}) {
|
|
67
|
-
const
|
|
68
|
-
return /* @__PURE__ */
|
|
89
|
+
const b = a === !0 || a === 1 || a === "1" || a === "true";
|
|
90
|
+
return /* @__PURE__ */ l(
|
|
69
91
|
"span",
|
|
70
92
|
{
|
|
71
|
-
className: `inline-flex h-[18px] items-center rounded-full px-1.5 text-[10.5px] font-semibold ${
|
|
72
|
-
children:
|
|
93
|
+
className: `inline-flex h-[18px] items-center rounded-full px-1.5 text-[10.5px] font-semibold ${b ? m === "danger" ? "bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-400" : "bg-emerald-100 text-emerald-700 dark:bg-emerald-900/40 dark:text-emerald-400" : "bg-slate-100 text-slate-500 dark:bg-slate-800 dark:text-slate-400"}`,
|
|
94
|
+
children: b ? "Yes" : "No"
|
|
73
95
|
}
|
|
74
96
|
);
|
|
75
97
|
}
|
|
76
|
-
function
|
|
77
|
-
const
|
|
98
|
+
function pl({ collection: a, id: m }) {
|
|
99
|
+
const b = De(), d = Yt(), O = gt(), { data: S } = U({
|
|
78
100
|
queryKey: ["cbv-collection-meta", a],
|
|
79
|
-
queryFn: () =>
|
|
101
|
+
queryFn: () => b.request(
|
|
80
102
|
G(`/collections/${a}`)
|
|
81
|
-
).then((
|
|
103
|
+
).then((A) => A.data).catch(() => ({ display_template: null, fields: [] })),
|
|
82
104
|
staleTime: 10 * 6e4,
|
|
83
105
|
retry: !1
|
|
84
|
-
}), { data:
|
|
85
|
-
queryKey: ["rrv-related", a, String(
|
|
86
|
-
queryFn: () =>
|
|
87
|
-
enabled:
|
|
106
|
+
}), { data: F, isPending: W } = U({
|
|
107
|
+
queryKey: ["rrv-related", a, String(m)],
|
|
108
|
+
queryFn: () => d(a, m).catch(() => null),
|
|
109
|
+
enabled: m != null && !!S,
|
|
88
110
|
staleTime: 6e4,
|
|
89
111
|
retry: !1
|
|
90
112
|
});
|
|
91
|
-
if (
|
|
92
|
-
if (
|
|
93
|
-
return /* @__PURE__ */
|
|
94
|
-
if (
|
|
113
|
+
if (m == null) return /* @__PURE__ */ l(le, {});
|
|
114
|
+
if (!F && (W || !S))
|
|
115
|
+
return /* @__PURE__ */ l("span", { className: "inline-block h-3.5 w-20 animate-pulse rounded bg-slate-100 align-middle dark:bg-[hsl(var(--nvr-skeleton))]" });
|
|
116
|
+
if (!F) return /* @__PURE__ */ f("span", { className: "text-slate-400", children: [
|
|
95
117
|
"#",
|
|
96
|
-
String(
|
|
118
|
+
String(m)
|
|
97
119
|
] });
|
|
98
120
|
let _ = "";
|
|
99
121
|
const h = S == null ? void 0 : S.display_template;
|
|
100
|
-
if (h && (_ = h.replace(/\{\{\s*([^}]+?)\s*\}\}/g, (
|
|
101
|
-
const
|
|
102
|
-
return
|
|
122
|
+
if (h && (_ = h.replace(/\{\{\s*([^}]+?)\s*\}\}/g, (A, M) => {
|
|
123
|
+
const I = M.split(".").reduce((k, x) => k == null ? void 0 : k[x], F);
|
|
124
|
+
return I == null ? "" : String(I);
|
|
103
125
|
}).trim()), !_) {
|
|
104
|
-
for (const
|
|
126
|
+
for (const A of [
|
|
105
127
|
"name",
|
|
106
128
|
"title",
|
|
107
129
|
"label",
|
|
@@ -111,39 +133,39 @@ function ul({ collection: a, id: f }) {
|
|
|
111
133
|
"filename_download",
|
|
112
134
|
"filename"
|
|
113
135
|
])
|
|
114
|
-
if (
|
|
115
|
-
_ = String(
|
|
136
|
+
if (F[A]) {
|
|
137
|
+
_ = String(F[A]);
|
|
116
138
|
break;
|
|
117
139
|
}
|
|
118
140
|
}
|
|
119
|
-
return _ || (_ = `#${String(
|
|
141
|
+
return _ || (_ = `#${String(m)}`), O ? /* @__PURE__ */ l(
|
|
120
142
|
"button",
|
|
121
143
|
{
|
|
122
144
|
type: "button",
|
|
123
|
-
onClick: () =>
|
|
145
|
+
onClick: () => O.open({ collection: a, itemId: String(m) }),
|
|
124
146
|
className: "text-left underline decoration-slate-300 underline-offset-2 transition-colors hover:text-[#007a99] hover:decoration-[#007a99] dark:decoration-slate-600 dark:hover:text-nvr-cyan dark:hover:decoration-nvr-cyan",
|
|
125
147
|
children: _
|
|
126
148
|
}
|
|
127
|
-
) : /* @__PURE__ */
|
|
149
|
+
) : /* @__PURE__ */ l(me, { children: _ });
|
|
128
150
|
}
|
|
129
|
-
function
|
|
130
|
-
const
|
|
151
|
+
function hl({ id: a }) {
|
|
152
|
+
const m = De(), { apiBase: b } = Kt(), { data: d, isPending: O } = U({
|
|
131
153
|
queryKey: ["rrv-file-meta", String(a)],
|
|
132
|
-
queryFn: () =>
|
|
154
|
+
queryFn: () => m.request(
|
|
133
155
|
G(`/files/${a}/meta`)
|
|
134
|
-
).then((
|
|
156
|
+
).then((F) => F.data).catch(() => null),
|
|
135
157
|
enabled: a != null,
|
|
136
158
|
staleTime: 5 * 6e4,
|
|
137
159
|
retry: !1
|
|
138
160
|
});
|
|
139
|
-
if (a == null) return /* @__PURE__ */
|
|
140
|
-
if (!
|
|
141
|
-
return /* @__PURE__ */
|
|
142
|
-
const S = (
|
|
143
|
-
return /* @__PURE__ */
|
|
161
|
+
if (a == null) return /* @__PURE__ */ l(le, {});
|
|
162
|
+
if (!d && O)
|
|
163
|
+
return /* @__PURE__ */ l("span", { className: "inline-block h-3.5 w-24 animate-pulse rounded bg-slate-100 align-middle dark:bg-[hsl(var(--nvr-skeleton))]" });
|
|
164
|
+
const S = (d == null ? void 0 : d.title) || (d == null ? void 0 : d.filename_download) || `#${String(a)}`;
|
|
165
|
+
return /* @__PURE__ */ l(
|
|
144
166
|
"a",
|
|
145
167
|
{
|
|
146
|
-
href: `${
|
|
168
|
+
href: `${b}/files/${a}`,
|
|
147
169
|
target: "_blank",
|
|
148
170
|
rel: "noreferrer",
|
|
149
171
|
className: "underline decoration-slate-300 underline-offset-2 transition-colors hover:text-[#007a99] hover:decoration-[#007a99] dark:decoration-slate-600 dark:hover:text-nvr-cyan dark:hover:decoration-nvr-cyan",
|
|
@@ -151,25 +173,25 @@ function ml({ id: a }) {
|
|
|
151
173
|
}
|
|
152
174
|
);
|
|
153
175
|
}
|
|
154
|
-
const
|
|
155
|
-
function
|
|
176
|
+
const Ze = ({ collection: a, id: m }) => a === "nivaro_files" ? /* @__PURE__ */ l(hl, { id: m }) : /* @__PURE__ */ l(pl, { collection: a, id: m });
|
|
177
|
+
function gl({
|
|
156
178
|
junction: a,
|
|
157
|
-
parentFk:
|
|
158
|
-
junctionField:
|
|
159
|
-
parentId:
|
|
160
|
-
onCount:
|
|
179
|
+
parentFk: m,
|
|
180
|
+
junctionField: b,
|
|
181
|
+
parentId: d,
|
|
182
|
+
onCount: O,
|
|
161
183
|
onTarget: S,
|
|
162
|
-
relation:
|
|
184
|
+
relation: F
|
|
163
185
|
}) {
|
|
164
186
|
var j;
|
|
165
|
-
const W =
|
|
187
|
+
const W = De(), { data: _ } = U({
|
|
166
188
|
queryKey: ["cbv-collection-meta", a],
|
|
167
189
|
queryFn: () => W.request(G(`/collections/${a}`)).then((v) => v.data),
|
|
168
190
|
staleTime: 10 * 6e4,
|
|
169
191
|
retry: !1
|
|
170
192
|
}), h = ((_ == null ? void 0 : _.relations) ?? []).find(
|
|
171
|
-
(v) => v.many_collection === a && v.many_field ===
|
|
172
|
-
),
|
|
193
|
+
(v) => v.many_collection === a && v.many_field === b
|
|
194
|
+
), A = It(h == null ? void 0 : h.one_allowed_collections), M = !!h && !h.one_collection && (A.length > 0 || !!h.one_collection_field), I = (h == null ? void 0 : h.one_collection_field) ?? "collection", k = (v) => v ? v === "directus_users" ? "nivaro_users" : v : null, x = (h == null ? void 0 : h.one_collection) ?? (M ? A.some((v) => v === "directus_users" || v === "nivaro_users") ? "nivaro_users" : k(A[0]) : null), { data: y } = U({
|
|
173
195
|
// Under the edit form's ['m2m-items', junction, parentFk, parentId] prefix (a longer key,
|
|
174
196
|
// so never the same cache entry): every link write that refreshes the form's list —
|
|
175
197
|
// a file upload, a picker change, the save itself — refreshes Summary's too. Its own
|
|
@@ -177,24 +199,24 @@ function fl({
|
|
|
177
199
|
queryKey: [
|
|
178
200
|
"m2m-items",
|
|
179
201
|
a,
|
|
180
|
-
|
|
181
|
-
|
|
202
|
+
m,
|
|
203
|
+
d,
|
|
182
204
|
"rrv",
|
|
183
|
-
|
|
184
|
-
|
|
205
|
+
b,
|
|
206
|
+
M ? I : ""
|
|
185
207
|
],
|
|
186
208
|
queryFn: () => W.request(
|
|
187
209
|
G(`/items/${a}`, {
|
|
188
|
-
filter: JSON.stringify({ [
|
|
189
|
-
fields:
|
|
210
|
+
filter: JSON.stringify({ [m]: { _eq: d } }),
|
|
211
|
+
fields: M ? `id,${b},${I}` : `id,${b}`,
|
|
190
212
|
limit: 200
|
|
191
213
|
})
|
|
192
214
|
).then(
|
|
193
|
-
(v) => (v.data ?? []).filter((w) => w[
|
|
194
|
-
const
|
|
215
|
+
(v) => (v.data ?? []).filter((w) => w[b] != null).map((w) => {
|
|
216
|
+
const q = w[b];
|
|
195
217
|
return {
|
|
196
|
-
id: String(typeof
|
|
197
|
-
collection:
|
|
218
|
+
id: String(typeof q == "object" ? q.id : q),
|
|
219
|
+
collection: M ? k(w[I]) : null
|
|
198
220
|
};
|
|
199
221
|
})
|
|
200
222
|
).catch(() => []),
|
|
@@ -202,64 +224,64 @@ function fl({
|
|
|
202
224
|
enabled: !!_,
|
|
203
225
|
staleTime: 3e4,
|
|
204
226
|
retry: !1
|
|
205
|
-
}),
|
|
206
|
-
return
|
|
207
|
-
|
|
208
|
-
}, [
|
|
227
|
+
}), R = y == null ? void 0 : y.map((v) => v.id), N = x ?? (M ? ((j = y == null ? void 0 : y.find((v) => v.collection)) == null ? void 0 : j.collection) ?? null : null), C = R == null ? void 0 : R.length;
|
|
228
|
+
return _e(() => {
|
|
229
|
+
C !== void 0 && (O == null || O(C));
|
|
230
|
+
}, [C, O]), _e(() => {
|
|
209
231
|
N && (S == null || S(N));
|
|
210
|
-
}, [N, S]), _ && !N && (!
|
|
211
|
-
|
|
232
|
+
}, [N, S]), _ && !N && (!M || y) ? /* @__PURE__ */ l(le, {}) : !R || !N ? /* @__PURE__ */ l("span", { className: "inline-block h-3.5 w-20 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }) : R.length === 0 ? /* @__PURE__ */ l(le, {}) : N === "nivaro_files" && F ? /* @__PURE__ */ l("div", { className: "mt-1", children: /* @__PURE__ */ l(
|
|
233
|
+
el,
|
|
212
234
|
{
|
|
213
|
-
relation:
|
|
214
|
-
parentId:
|
|
235
|
+
relation: F,
|
|
236
|
+
parentId: d,
|
|
215
237
|
allRelations: [],
|
|
216
238
|
disabled: !0
|
|
217
239
|
}
|
|
218
|
-
) }) : /* @__PURE__ */
|
|
240
|
+
) }) : /* @__PURE__ */ l("span", { className: "flex flex-wrap gap-x-1.5 gap-y-0.5", children: (y ?? []).map(({ id: v, collection: w }, q) => /* @__PURE__ */ f(
|
|
219
241
|
"span",
|
|
220
242
|
{
|
|
221
243
|
className: "inline-flex items-center whitespace-nowrap",
|
|
222
244
|
children: [
|
|
223
|
-
/* @__PURE__ */
|
|
224
|
-
|
|
245
|
+
/* @__PURE__ */ l(Ze, { collection: w ?? N, id: v }),
|
|
246
|
+
q < R.length - 1 && /* @__PURE__ */ l("span", { className: "text-slate-300 dark:text-slate-600", children: "," })
|
|
225
247
|
]
|
|
226
248
|
},
|
|
227
249
|
`${w ?? N}:${v}`
|
|
228
250
|
)) });
|
|
229
251
|
}
|
|
230
|
-
function
|
|
252
|
+
function bl({
|
|
231
253
|
collection: a,
|
|
232
|
-
fkField:
|
|
233
|
-
parentId:
|
|
234
|
-
layoutId:
|
|
235
|
-
presets:
|
|
254
|
+
fkField: m,
|
|
255
|
+
parentId: b,
|
|
256
|
+
layoutId: d,
|
|
257
|
+
presets: O,
|
|
236
258
|
defaultPreset: S,
|
|
237
|
-
onCount:
|
|
259
|
+
onCount: F
|
|
238
260
|
}) {
|
|
239
|
-
const W =
|
|
261
|
+
const W = De(), _ = gt(), h = (O ?? []).filter((t) => t && Array.isArray(t.columns)), [A, M] = te(
|
|
240
262
|
() => {
|
|
241
263
|
var t;
|
|
242
264
|
return h.length >= 2 ? ((t = h.find((i) => i.name === S)) == null ? void 0 : t.name) ?? h[0].name : "__all__";
|
|
243
265
|
}
|
|
244
|
-
), { data:
|
|
266
|
+
), { data: I } = U({
|
|
245
267
|
queryKey: ["cbv-collection-meta", a],
|
|
246
268
|
queryFn: () => W.request(G(`/collections/${a}`)).then((t) => t.data),
|
|
247
269
|
staleTime: 10 * 6e4,
|
|
248
270
|
retry: !1
|
|
249
271
|
}), k = (t) => {
|
|
250
272
|
var i;
|
|
251
|
-
return ((i = ((
|
|
252
|
-
(
|
|
273
|
+
return ((i = ((I == null ? void 0 : I.relations) ?? []).find(
|
|
274
|
+
(o) => o.many_collection === a && o.many_field === t && o.one_collection
|
|
253
275
|
)) == null ? void 0 : i.one_collection) ?? null;
|
|
254
|
-
}, { data: x } =
|
|
255
|
-
queryKey: ["rrv-cols", a,
|
|
276
|
+
}, { data: x } = U({
|
|
277
|
+
queryKey: ["rrv-cols", a, d ?? null],
|
|
256
278
|
queryFn: () => W.request(
|
|
257
|
-
G(`/field-config/${a}`,
|
|
279
|
+
G(`/field-config/${a}`, d ? { layout_id: d } : {})
|
|
258
280
|
).then((t) => ({
|
|
259
281
|
// Lines carry their own number — sort by it and show it first.
|
|
260
282
|
lineNo: (t.data ?? []).some((i) => i.field === "line_number"),
|
|
261
283
|
cols: (t.data ?? []).filter(
|
|
262
|
-
(i) => !i.hidden && !i.field.startsWith("__") && (!i.field.includes(".") || i.interface === "relation-path") && i.field !==
|
|
284
|
+
(i) => !i.hidden && !i.field.startsWith("__") && (!i.field.includes(".") || i.interface === "relation-path") && i.field !== m && ((d ? i.layout_assigned : !0) ?? !0) && (i.interface === "relation-path" || [
|
|
263
285
|
"string",
|
|
264
286
|
"text",
|
|
265
287
|
"integer",
|
|
@@ -271,112 +293,112 @@ function pl({
|
|
|
271
293
|
"timestamp",
|
|
272
294
|
"uuid"
|
|
273
295
|
].includes(i.type ?? ""))
|
|
274
|
-
).filter((i,
|
|
296
|
+
).filter((i, o, p) => p.findIndex((T) => T.field === i.field) === o)
|
|
275
297
|
})),
|
|
276
298
|
staleTime: 5 * 6e4,
|
|
277
299
|
retry: !1
|
|
278
|
-
}),
|
|
279
|
-
if (!N) return
|
|
280
|
-
const t = new Set(N.columns), i =
|
|
281
|
-
return i.length > 0 ? i :
|
|
282
|
-
}, [
|
|
300
|
+
}), y = (x == null ? void 0 : x.cols) ?? [], R = !!(x != null && x.lineNo), N = A !== "__all__" ? h.find((t) => t.name === A) : null, C = ve(() => {
|
|
301
|
+
if (!N) return y;
|
|
302
|
+
const t = new Set(N.columns), i = y.filter((o) => t.has(o.field));
|
|
303
|
+
return i.length > 0 ? i : y;
|
|
304
|
+
}, [y, N]), [j, v] = te(""), [w, q] = te(1), [se, H] = te({}), X = Wt(se, 350), Le = ve(() => {
|
|
283
305
|
const t = [
|
|
284
|
-
{ path: [
|
|
306
|
+
{ path: [m], op: "_eq", value: b }
|
|
285
307
|
];
|
|
286
|
-
for (const [i,
|
|
287
|
-
if (!(
|
|
288
|
-
const p =
|
|
289
|
-
t.push({ path: [i], op:
|
|
308
|
+
for (const [i, o] of Object.entries(X)) {
|
|
309
|
+
if (!(o != null && o.value.trim())) continue;
|
|
310
|
+
const p = o.value.trim(), T = Number(p), E = o.op === "_contains" ? p : p === "true" || p === "false" ? p === "true" : Number.isNaN(T) ? p : T;
|
|
311
|
+
t.push({ path: [i], op: o.op, value: E });
|
|
290
312
|
}
|
|
291
313
|
return JSON.stringify(t);
|
|
292
|
-
}, [
|
|
293
|
-
data:
|
|
294
|
-
isLoading:
|
|
295
|
-
isFetching:
|
|
296
|
-
} =
|
|
297
|
-
queryKey: ["rrv-rows", a,
|
|
314
|
+
}, [X, m, b]), u = 25, {
|
|
315
|
+
data: V,
|
|
316
|
+
isLoading: ue,
|
|
317
|
+
isFetching: Ee
|
|
318
|
+
} = U({
|
|
319
|
+
queryKey: ["rrv-rows", a, m, b, j, R, w, Le],
|
|
298
320
|
queryFn: () => W.request(
|
|
299
321
|
G(`/items/${a}`, {
|
|
300
322
|
limit: u,
|
|
301
323
|
page: w,
|
|
302
|
-
...j ? { sort: j } :
|
|
303
|
-
conditions:
|
|
324
|
+
...j ? { sort: j } : R ? { sort: "line_number" } : {},
|
|
325
|
+
conditions: Le
|
|
304
326
|
})
|
|
305
327
|
),
|
|
306
328
|
placeholderData: (t) => t,
|
|
307
329
|
staleTime: 3e4,
|
|
308
330
|
retry: !1
|
|
309
|
-
}),
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
}, [
|
|
313
|
-
const
|
|
331
|
+
}), D = (V == null ? void 0 : V.data) ?? [], Z = (V == null ? void 0 : V.total) ?? D.length, Q = Object.values(X).some((t) => !!(t != null && t.value.trim()));
|
|
332
|
+
_e(() => {
|
|
333
|
+
V && !Q && (F == null || F(Z));
|
|
334
|
+
}, [V, Q, Z, F]);
|
|
335
|
+
const fe = C.filter((t) => t.field.includes(".")), pe = D.map((t) => String(t.id)), { data: Y } = U({
|
|
314
336
|
queryKey: [
|
|
315
337
|
"rrv-resolve-paths",
|
|
316
338
|
a,
|
|
317
|
-
|
|
318
|
-
|
|
339
|
+
fe.map((t) => t.field).join(","),
|
|
340
|
+
pe.join(",")
|
|
319
341
|
],
|
|
320
342
|
queryFn: () => W.request(
|
|
321
343
|
G(`/items/${a}/resolve-paths`, {
|
|
322
|
-
ids:
|
|
323
|
-
paths:
|
|
344
|
+
ids: pe.join(","),
|
|
345
|
+
paths: fe.map((t) => t.field).join(",")
|
|
324
346
|
})
|
|
325
347
|
).then((t) => t.data ?? { rows: {}, targets: {} }).catch(() => ({ rows: {}, targets: {} })),
|
|
326
|
-
enabled:
|
|
348
|
+
enabled: fe.length > 0 && pe.length > 0,
|
|
327
349
|
staleTime: 3e4
|
|
328
|
-
}),
|
|
329
|
-
|
|
350
|
+
}), L = R && D.some((t) => t.line_number != null), ke = Math.max(1, Math.ceil(Z / u)), de = (t, i, o) => {
|
|
351
|
+
q(1), H((p) => {
|
|
330
352
|
const T = { ...p };
|
|
331
|
-
return
|
|
353
|
+
return o ? T[t] = { op: i, value: o } : delete T[t], T;
|
|
332
354
|
});
|
|
333
|
-
},
|
|
334
|
-
|
|
355
|
+
}, Be = (t) => {
|
|
356
|
+
q(1), v((i) => i === t ? `-${t}` : i === `-${t}` ? "" : t);
|
|
335
357
|
};
|
|
336
|
-
if (
|
|
337
|
-
return /* @__PURE__ */
|
|
358
|
+
if (ue)
|
|
359
|
+
return /* @__PURE__ */ l("div", { className: "space-y-1.5 py-2", children: [0, 1, 2].map((t) => /* @__PURE__ */ l(
|
|
338
360
|
"div",
|
|
339
361
|
{
|
|
340
362
|
className: "h-6 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]"
|
|
341
363
|
},
|
|
342
364
|
t
|
|
343
365
|
)) });
|
|
344
|
-
if (
|
|
345
|
-
return /* @__PURE__ */
|
|
346
|
-
const
|
|
347
|
-
var
|
|
366
|
+
if (D.length === 0 && Object.keys(X).length === 0)
|
|
367
|
+
return /* @__PURE__ */ l("p", { className: "py-3 text-[12px] text-slate-400", children: "No records" });
|
|
368
|
+
const Je = (t, i) => {
|
|
369
|
+
var E, re;
|
|
348
370
|
if (i.field.includes(".")) {
|
|
349
|
-
const
|
|
350
|
-
if (!
|
|
351
|
-
return /* @__PURE__ */
|
|
352
|
-
if (!
|
|
353
|
-
const
|
|
354
|
-
return _ &&
|
|
371
|
+
const ne = (E = Y == null ? void 0 : Y.rows[String(t.id)]) == null ? void 0 : E[i.field];
|
|
372
|
+
if (!Y)
|
|
373
|
+
return /* @__PURE__ */ l("span", { className: "inline-block h-3 w-14 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" });
|
|
374
|
+
if (!ne || ne.value === "") return /* @__PURE__ */ l(le, {});
|
|
375
|
+
const Ke = Y.targets[i.field], he = (re = ne.ids) == null ? void 0 : re[0];
|
|
376
|
+
return _ && Ke && he ? /* @__PURE__ */ l(
|
|
355
377
|
"button",
|
|
356
378
|
{
|
|
357
379
|
type: "button",
|
|
358
|
-
onClick: (
|
|
359
|
-
|
|
380
|
+
onClick: (ae) => {
|
|
381
|
+
ae.stopPropagation(), _.open({ collection: Ke, itemId: String(he) });
|
|
360
382
|
},
|
|
361
383
|
className: "text-left underline decoration-slate-300 underline-offset-2 hover:text-[#007a99] dark:decoration-slate-600 dark:hover:text-nvr-cyan",
|
|
362
|
-
children:
|
|
384
|
+
children: ne.value
|
|
363
385
|
}
|
|
364
|
-
) :
|
|
386
|
+
) : ne.value;
|
|
365
387
|
}
|
|
366
|
-
const
|
|
367
|
-
if (i.type === "boolean" &&
|
|
368
|
-
if (
|
|
388
|
+
const o = t[i.field];
|
|
389
|
+
if (i.type === "boolean" && o == null) return /* @__PURE__ */ l(Ve, { value: !1 });
|
|
390
|
+
if (o == null || o === "") return /* @__PURE__ */ l(le, {});
|
|
369
391
|
const p = k(i.field);
|
|
370
392
|
if (p === "nivaro_users")
|
|
371
|
-
return /* @__PURE__ */
|
|
372
|
-
if (p) return /* @__PURE__ */
|
|
373
|
-
if (i.type === "boolean") return /* @__PURE__ */
|
|
374
|
-
if (i.type === "decimal" || i.type === "float") return
|
|
375
|
-
if (i.type === "integer") return
|
|
376
|
-
if (i.type === "date" || i.type === "datetime" || i.type === "timestamp") return
|
|
377
|
-
const T = String(
|
|
393
|
+
return /* @__PURE__ */ l("span", { className: "inline-block", children: /* @__PURE__ */ l(bt, { userId: String(o), size: "compact" }) });
|
|
394
|
+
if (p) return /* @__PURE__ */ l(Ze, { collection: p, id: o });
|
|
395
|
+
if (i.type === "boolean") return /* @__PURE__ */ l(Ve, { value: o });
|
|
396
|
+
if (i.type === "decimal" || i.type === "float") return Xe(o);
|
|
397
|
+
if (i.type === "integer") return Ue(o);
|
|
398
|
+
if (i.type === "date" || i.type === "datetime" || i.type === "timestamp") return yt(o);
|
|
399
|
+
const T = String(o);
|
|
378
400
|
return T.length > 48 ? `${T.slice(0, 48)}…` : T;
|
|
379
|
-
},
|
|
401
|
+
}, oe = (t) => ["decimal", "float", "integer"].includes(t.type ?? "") && !k(t.field) && !t.field.includes("."), Pe = (t) => {
|
|
380
402
|
const i = t.options;
|
|
381
403
|
if (!i) return {};
|
|
382
404
|
if (typeof i == "string")
|
|
@@ -386,78 +408,78 @@ function pl({
|
|
|
386
408
|
return {};
|
|
387
409
|
}
|
|
388
410
|
return i;
|
|
389
|
-
},
|
|
390
|
-
const i =
|
|
411
|
+
}, Ne = (t) => {
|
|
412
|
+
const i = Pe(t).aggregate;
|
|
391
413
|
return typeof i == "string" && ["sum", "avg", "min", "max", "count"].includes(i) ? i : null;
|
|
392
|
-
},
|
|
393
|
-
const i =
|
|
414
|
+
}, Me = C.some((t) => Ne(t)), we = (t) => {
|
|
415
|
+
const i = Ne(t);
|
|
394
416
|
if (!i) return null;
|
|
395
|
-
const
|
|
417
|
+
const o = D.map((E) => Number(E[t.field])).filter((E) => !Number.isNaN(E));
|
|
396
418
|
let p = null;
|
|
397
|
-
if (i === "count" ? p =
|
|
398
|
-
const T =
|
|
399
|
-
return i === "count" || T === "int" ?
|
|
400
|
-
},
|
|
401
|
-
return /* @__PURE__ */
|
|
402
|
-
h.length >= 2 && /* @__PURE__ */
|
|
419
|
+
if (i === "count" ? p = D.length : o.length > 0 && (i === "sum" ? p = o.reduce((E, re) => E + re, 0) : i === "avg" ? p = o.reduce((E, re) => E + re, 0) / o.length : i === "min" ? p = Math.min(...o) : i === "max" && (p = Math.max(...o))), p === null) return "—";
|
|
420
|
+
const T = Pe(t).format;
|
|
421
|
+
return i === "count" || T === "int" ? Ue(Math.round(p)) : T === "currency" || t.type === "decimal" || t.type === "float" ? Xe(p) : i === "avg" ? p.toFixed(2) : Ue(p);
|
|
422
|
+
}, Se = (t) => !k(t.field) && !t.field.includes("."), je = (t) => k(t.field) || t.field.includes(".") ? null : t.type === "boolean" ? "bool" : ["integer", "decimal", "float"].includes(t.type ?? "") ? "num" : ["string", "text"].includes(t.type ?? "") ? "text" : null, $e = C.some((t) => je(t) != null);
|
|
423
|
+
return /* @__PURE__ */ f("div", { children: [
|
|
424
|
+
h.length >= 2 && /* @__PURE__ */ l("div", { className: "mb-1.5 flex flex-wrap items-center gap-1", "data-read-presets": !0, children: [
|
|
403
425
|
{ name: "__all__", label: "All" },
|
|
404
426
|
...h.map((t) => ({ name: t.name, label: t.name }))
|
|
405
|
-
].map((t) => /* @__PURE__ */
|
|
427
|
+
].map((t) => /* @__PURE__ */ l(
|
|
406
428
|
"button",
|
|
407
429
|
{
|
|
408
430
|
type: "button",
|
|
409
|
-
onClick: () =>
|
|
410
|
-
"aria-pressed":
|
|
411
|
-
className: `rounded-full border px-2 py-0.5 text-[10.5px] font-medium transition-colors ${
|
|
431
|
+
onClick: () => M(t.name),
|
|
432
|
+
"aria-pressed": A === t.name,
|
|
433
|
+
className: `rounded-full border px-2 py-0.5 text-[10.5px] font-medium transition-colors ${A === t.name ? "border-nvr-cyan bg-nvr-cyan/10 text-[#007a99] dark:text-nvr-cyan" : "border-slate-200 text-slate-500 hover:bg-slate-50 dark:border-slate-700 dark:text-slate-400 dark:hover:bg-slate-800"}`,
|
|
412
434
|
children: t.label
|
|
413
435
|
},
|
|
414
436
|
t.name
|
|
415
437
|
)) }),
|
|
416
|
-
/* @__PURE__ */
|
|
438
|
+
/* @__PURE__ */ l(
|
|
417
439
|
"div",
|
|
418
440
|
{
|
|
419
|
-
className: `overflow-x-auto rounded-md border border-slate-200 dark:border-slate-700 ${
|
|
420
|
-
children: /* @__PURE__ */
|
|
421
|
-
/* @__PURE__ */
|
|
422
|
-
/* @__PURE__ */
|
|
423
|
-
|
|
424
|
-
|
|
441
|
+
className: `overflow-x-auto rounded-md border border-slate-200 dark:border-slate-700 ${Ee && !ue ? "opacity-70" : ""}`,
|
|
442
|
+
children: /* @__PURE__ */ f("table", { className: "w-full", style: { fontVariantNumeric: "tabular-nums" }, children: [
|
|
443
|
+
/* @__PURE__ */ f("thead", { children: [
|
|
444
|
+
/* @__PURE__ */ f("tr", { className: "border-b border-slate-200 bg-slate-50 dark:border-slate-700 dark:bg-slate-800", children: [
|
|
445
|
+
L && /* @__PURE__ */ l("th", { className: "h-7 w-8 px-2 text-right text-[9.5px] font-bold uppercase tracking-wider text-slate-400", children: "#" }),
|
|
446
|
+
C.map((t) => {
|
|
425
447
|
const i = j === t.field || j === `-${t.field}`;
|
|
426
|
-
return /* @__PURE__ */
|
|
448
|
+
return /* @__PURE__ */ f(
|
|
427
449
|
"th",
|
|
428
450
|
{
|
|
429
|
-
onClick: () =>
|
|
430
|
-
className: `h-7 select-none whitespace-nowrap px-2.5 text-[9.5px] font-bold uppercase tracking-wider text-slate-500 dark:text-slate-400 ${
|
|
451
|
+
onClick: () => Se(t) && Be(t.field),
|
|
452
|
+
className: `h-7 select-none whitespace-nowrap px-2.5 text-[9.5px] font-bold uppercase tracking-wider text-slate-500 dark:text-slate-400 ${oe(t) ? "text-right" : "text-left"} ${Se(t) ? "cursor-pointer hover:text-slate-700 dark:hover:text-slate-200" : ""}`,
|
|
431
453
|
children: [
|
|
432
|
-
t.label ||
|
|
433
|
-
|
|
454
|
+
t.label || ze(t.field),
|
|
455
|
+
Se(t) && /* @__PURE__ */ l("span", { className: i ? "ml-0.5 text-[#00a5cc]" : "ml-0.5 text-slate-300", children: i ? j.startsWith("-") ? "▼" : "▲" : "⇅" })
|
|
434
456
|
]
|
|
435
457
|
},
|
|
436
458
|
t.field
|
|
437
459
|
);
|
|
438
460
|
})
|
|
439
461
|
] }),
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
const i =
|
|
444
|
-
return /* @__PURE__ */
|
|
445
|
-
i === "text" && /* @__PURE__ */
|
|
462
|
+
$e && /* @__PURE__ */ f("tr", { className: "border-b border-slate-200 bg-slate-50 dark:border-slate-700 dark:bg-slate-800", children: [
|
|
463
|
+
L && /* @__PURE__ */ l("th", { className: "px-1.5 py-1" }),
|
|
464
|
+
C.map((t) => {
|
|
465
|
+
const i = je(t), o = se[t.field];
|
|
466
|
+
return /* @__PURE__ */ f("th", { className: "px-1.5 py-1 font-normal", children: [
|
|
467
|
+
i === "text" && /* @__PURE__ */ l(
|
|
446
468
|
"input",
|
|
447
469
|
{
|
|
448
|
-
value: (
|
|
449
|
-
onChange: (p) =>
|
|
470
|
+
value: (o == null ? void 0 : o.value) ?? "",
|
|
471
|
+
onChange: (p) => de(t.field, "_contains", p.target.value),
|
|
450
472
|
placeholder: "Filter…",
|
|
451
473
|
"aria-label": `Filter ${t.field}`,
|
|
452
474
|
className: "h-6 w-full min-w-[56px] rounded border border-slate-200 bg-white px-1.5 text-[10.5px] font-normal normal-case tracking-normal outline-none focus:border-nvr-cyan/50 dark:border-slate-600 dark:bg-slate-900 dark:text-slate-100"
|
|
453
475
|
}
|
|
454
476
|
),
|
|
455
|
-
i === "num" && /* @__PURE__ */
|
|
456
|
-
/* @__PURE__ */
|
|
457
|
-
|
|
477
|
+
i === "num" && /* @__PURE__ */ f("span", { className: "flex items-center gap-0.5", children: [
|
|
478
|
+
/* @__PURE__ */ l(
|
|
479
|
+
pt,
|
|
458
480
|
{
|
|
459
|
-
value: (
|
|
460
|
-
onChange: (p) =>
|
|
481
|
+
value: (o == null ? void 0 : o.op) ?? "_eq",
|
|
482
|
+
onChange: (p) => de(t.field, p, (o == null ? void 0 : o.value) ?? ""),
|
|
461
483
|
options: [
|
|
462
484
|
{ value: "_eq", label: "=" },
|
|
463
485
|
{ value: "_gte", label: "≥" },
|
|
@@ -466,22 +488,22 @@ function pl({
|
|
|
466
488
|
ariaLabel: `Filter op ${t.field}`
|
|
467
489
|
}
|
|
468
490
|
),
|
|
469
|
-
/* @__PURE__ */
|
|
491
|
+
/* @__PURE__ */ l(
|
|
470
492
|
"input",
|
|
471
493
|
{
|
|
472
494
|
type: "number",
|
|
473
|
-
value: (
|
|
474
|
-
onChange: (p) =>
|
|
495
|
+
value: (o == null ? void 0 : o.value) ?? "",
|
|
496
|
+
onChange: (p) => de(t.field, (o == null ? void 0 : o.op) ?? "_eq", p.target.value),
|
|
475
497
|
"aria-label": `Filter ${t.field}`,
|
|
476
498
|
className: "h-6 w-full min-w-[48px] rounded border border-slate-200 bg-white px-1 text-[10.5px] font-normal outline-none focus:border-nvr-cyan/50 dark:border-slate-600 dark:bg-slate-900 dark:text-slate-100"
|
|
477
499
|
}
|
|
478
500
|
)
|
|
479
501
|
] }),
|
|
480
|
-
i === "bool" && /* @__PURE__ */
|
|
481
|
-
|
|
502
|
+
i === "bool" && /* @__PURE__ */ l(
|
|
503
|
+
pt,
|
|
482
504
|
{
|
|
483
|
-
value: (
|
|
484
|
-
onChange: (p) =>
|
|
505
|
+
value: (o == null ? void 0 : o.value) ?? "",
|
|
506
|
+
onChange: (p) => de(t.field, "_eq", p),
|
|
485
507
|
options: [
|
|
486
508
|
{ value: "", label: "All" },
|
|
487
509
|
{ value: "true", label: "Yes" },
|
|
@@ -495,27 +517,27 @@ function pl({
|
|
|
495
517
|
})
|
|
496
518
|
] })
|
|
497
519
|
] }),
|
|
498
|
-
/* @__PURE__ */
|
|
499
|
-
|
|
520
|
+
/* @__PURE__ */ f("tbody", { children: [
|
|
521
|
+
D.length === 0 && /* @__PURE__ */ l("tr", { children: /* @__PURE__ */ l(
|
|
500
522
|
"td",
|
|
501
523
|
{
|
|
502
|
-
colSpan:
|
|
524
|
+
colSpan: C.length + (L ? 1 : 0),
|
|
503
525
|
className: "py-4 text-center text-[12px] text-slate-400",
|
|
504
526
|
children: "No matches — adjust filters"
|
|
505
527
|
}
|
|
506
528
|
) }),
|
|
507
|
-
|
|
529
|
+
D.map((t) => /* @__PURE__ */ f(
|
|
508
530
|
"tr",
|
|
509
531
|
{
|
|
510
532
|
onClick: _ ? () => _.open({ collection: a, itemId: String(t.id) }) : void 0,
|
|
511
533
|
className: `border-b border-slate-100 last:border-0 dark:border-slate-800 ${_ ? "cursor-pointer hover:bg-nvr-cyan/5 dark:hover:bg-nvr-cyan/10" : ""}`,
|
|
512
534
|
children: [
|
|
513
|
-
|
|
514
|
-
|
|
535
|
+
L && /* @__PURE__ */ l("td", { className: "px-2 py-1.5 text-right text-[11px] tabular-nums text-slate-400", children: t.line_number == null ? "" : String(t.line_number) }),
|
|
536
|
+
C.map((i) => /* @__PURE__ */ l(
|
|
515
537
|
"td",
|
|
516
538
|
{
|
|
517
|
-
className: `whitespace-nowrap px-2.5 py-1.5 text-[12px] text-slate-700 dark:text-slate-200 ${
|
|
518
|
-
children:
|
|
539
|
+
className: `whitespace-nowrap px-2.5 py-1.5 text-[12px] text-slate-700 dark:text-slate-200 ${oe(i) ? "text-right" : ""}`,
|
|
540
|
+
children: Je(t, i)
|
|
519
541
|
},
|
|
520
542
|
i.field
|
|
521
543
|
))
|
|
@@ -524,22 +546,22 @@ function pl({
|
|
|
524
546
|
String(t.id)
|
|
525
547
|
))
|
|
526
548
|
] }),
|
|
527
|
-
|
|
549
|
+
Me && D.length > 0 && /* @__PURE__ */ l("tfoot", { children: /* @__PURE__ */ f(
|
|
528
550
|
"tr",
|
|
529
551
|
{
|
|
530
552
|
"data-read-grid-footer": !0,
|
|
531
553
|
className: "border-t border-slate-200 bg-slate-50 text-[11px] font-medium text-slate-600 dark:border-slate-700 dark:bg-slate-800/60 dark:text-slate-300",
|
|
532
554
|
children: [
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
const i =
|
|
536
|
-
return /* @__PURE__ */
|
|
555
|
+
L && /* @__PURE__ */ l("td", {}),
|
|
556
|
+
C.map((t) => {
|
|
557
|
+
const i = Ne(t);
|
|
558
|
+
return /* @__PURE__ */ l(
|
|
537
559
|
"td",
|
|
538
560
|
{
|
|
539
|
-
className: `whitespace-nowrap px-2.5 py-1.5 ${
|
|
540
|
-
children: i && /* @__PURE__ */
|
|
541
|
-
/* @__PURE__ */
|
|
542
|
-
/* @__PURE__ */
|
|
561
|
+
className: `whitespace-nowrap px-2.5 py-1.5 ${oe(t) ? "text-right" : ""}`,
|
|
562
|
+
children: i && /* @__PURE__ */ f(me, { children: [
|
|
563
|
+
/* @__PURE__ */ l("span", { className: "mr-1 font-mono text-[10px] text-slate-400", children: i.toUpperCase() }),
|
|
564
|
+
/* @__PURE__ */ l("span", { className: "tabular-nums", children: we(t) })
|
|
543
565
|
] })
|
|
544
566
|
},
|
|
545
567
|
t.field
|
|
@@ -551,37 +573,37 @@ function pl({
|
|
|
551
573
|
] })
|
|
552
574
|
}
|
|
553
575
|
),
|
|
554
|
-
|
|
555
|
-
/* @__PURE__ */
|
|
576
|
+
Z > u && /* @__PURE__ */ f("div", { className: "mt-1.5 flex items-center justify-between", children: [
|
|
577
|
+
/* @__PURE__ */ f("p", { className: "text-[11px] tabular-nums text-slate-400", children: [
|
|
556
578
|
((w - 1) * u + 1).toLocaleString("en-US"),
|
|
557
579
|
"–",
|
|
558
|
-
Math.min(w * u,
|
|
580
|
+
Math.min(w * u, Z).toLocaleString("en-US"),
|
|
559
581
|
" of",
|
|
560
582
|
" ",
|
|
561
|
-
|
|
583
|
+
Z.toLocaleString("en-US")
|
|
562
584
|
] }),
|
|
563
|
-
/* @__PURE__ */
|
|
564
|
-
/* @__PURE__ */
|
|
585
|
+
/* @__PURE__ */ f("span", { className: "flex items-center gap-0.5", children: [
|
|
586
|
+
/* @__PURE__ */ l(
|
|
565
587
|
"button",
|
|
566
588
|
{
|
|
567
589
|
type: "button",
|
|
568
590
|
disabled: w <= 1,
|
|
569
|
-
onClick: () =>
|
|
591
|
+
onClick: () => q((t) => Math.max(1, t - 1)),
|
|
570
592
|
className: "h-6 rounded px-2 text-[11px] text-slate-600 hover:bg-slate-100 disabled:opacity-30 dark:text-slate-300 dark:hover:bg-slate-800",
|
|
571
593
|
children: "← Prev"
|
|
572
594
|
}
|
|
573
595
|
),
|
|
574
|
-
/* @__PURE__ */
|
|
596
|
+
/* @__PURE__ */ f("span", { className: "min-w-[48px] text-center text-[11px] tabular-nums text-slate-500", children: [
|
|
575
597
|
w,
|
|
576
598
|
" / ",
|
|
577
|
-
|
|
599
|
+
ke.toLocaleString("en-US")
|
|
578
600
|
] }),
|
|
579
|
-
/* @__PURE__ */
|
|
601
|
+
/* @__PURE__ */ l(
|
|
580
602
|
"button",
|
|
581
603
|
{
|
|
582
604
|
type: "button",
|
|
583
|
-
disabled: w >=
|
|
584
|
-
onClick: () =>
|
|
605
|
+
disabled: w >= ke,
|
|
606
|
+
onClick: () => q((t) => t + 1),
|
|
585
607
|
className: "h-6 rounded px-2 text-[11px] text-slate-600 hover:bg-slate-100 disabled:opacity-30 dark:text-slate-300 dark:hover:bg-slate-800",
|
|
586
608
|
children: "Next →"
|
|
587
609
|
}
|
|
@@ -590,489 +612,510 @@ function pl({
|
|
|
590
612
|
] })
|
|
591
613
|
] });
|
|
592
614
|
}
|
|
593
|
-
function
|
|
615
|
+
function ht({
|
|
594
616
|
collection: a,
|
|
595
|
-
itemId:
|
|
596
|
-
layoutData:
|
|
597
|
-
design:
|
|
598
|
-
flush:
|
|
617
|
+
itemId: m,
|
|
618
|
+
layoutData: b,
|
|
619
|
+
design: d,
|
|
620
|
+
flush: O,
|
|
599
621
|
renderSlot: S,
|
|
600
|
-
integrityMarks:
|
|
622
|
+
integrityMarks: F,
|
|
601
623
|
renderGrid: W,
|
|
602
624
|
onEditSection: _,
|
|
603
625
|
gridCounts: h
|
|
604
626
|
}) {
|
|
605
|
-
var
|
|
606
|
-
const
|
|
607
|
-
() =>
|
|
608
|
-
...
|
|
609
|
-
layout:
|
|
610
|
-
} :
|
|
611
|
-
[
|
|
612
|
-
),
|
|
613
|
-
kind:
|
|
627
|
+
var at;
|
|
628
|
+
const A = De(), M = rl(), I = d ? d.record ?? {} : null, k = !!(d != null && d.context.showHidden), x = d ? String(((at = d.record) == null ? void 0 : at.id) ?? "") : m ?? "", y = ve(
|
|
629
|
+
() => d ? {
|
|
630
|
+
...d.layout,
|
|
631
|
+
layout: d.layout.layout ?? { id: 0, name: "" }
|
|
632
|
+
} : b,
|
|
633
|
+
[d, b]
|
|
634
|
+
), R = (e) => ({
|
|
635
|
+
kind: Re(e.field) ? "slot" : "field",
|
|
614
636
|
field: e.field,
|
|
615
637
|
group_key: e.group_key ?? null
|
|
616
|
-
}), N = (e,
|
|
638
|
+
}), N = (e, r, s = !1) => d ? /* @__PURE__ */ l(al, { target: e, children: s ? /* @__PURE__ */ l("div", { "data-design-hidden": !0, className: "opacity-40", children: r }) : r }) : r, C = ve(
|
|
617
639
|
() => [
|
|
618
640
|
...new Set(
|
|
619
|
-
(
|
|
641
|
+
(d ? [] : (y == null ? void 0 : y.assignments) ?? []).map((e) => e.field).filter((e) => e && !e.startsWith("__") && !e.includes("."))
|
|
620
642
|
)
|
|
621
643
|
].sort(),
|
|
622
|
-
[
|
|
623
|
-
), { data: j } =
|
|
624
|
-
const
|
|
625
|
-
if (!
|
|
626
|
-
const s =
|
|
627
|
-
return
|
|
628
|
-
|
|
644
|
+
[y, d]
|
|
645
|
+
), { data: j } = tl(a, x, C), v = (e) => {
|
|
646
|
+
const r = j == null ? void 0 : j[e];
|
|
647
|
+
if (!r) return null;
|
|
648
|
+
const s = r.via !== "user";
|
|
649
|
+
return r.caller && r.activity_id ? /* @__PURE__ */ l(
|
|
650
|
+
Zt,
|
|
629
651
|
{
|
|
630
|
-
activityId:
|
|
631
|
-
callerName:
|
|
652
|
+
activityId: r.activity_id,
|
|
653
|
+
callerName: r.caller.name,
|
|
632
654
|
collection: a,
|
|
633
655
|
itemId: x,
|
|
634
|
-
children: /* @__PURE__ */
|
|
656
|
+
children: /* @__PURE__ */ f(
|
|
635
657
|
"button",
|
|
636
658
|
{
|
|
637
659
|
type: "button",
|
|
638
660
|
"data-field-touch": e,
|
|
639
|
-
"data-field-touch-caller":
|
|
640
|
-
"data-tip": `Changed ${
|
|
641
|
-
"aria-label": `Changed ${
|
|
661
|
+
"data-field-touch-caller": r.caller.key,
|
|
662
|
+
"data-tip": `Changed ${Ce(r.at)} by ${r.caller.name} (through the API) — click for the request`,
|
|
663
|
+
"aria-label": `Changed ${Ce(r.at)} by ${r.caller.name} through the API`,
|
|
642
664
|
className: "ml-1 inline-flex items-center gap-1 rounded-full bg-amber-50 px-1.5 align-middle text-[9.5px] font-medium leading-4 text-amber-800 hover:bg-amber-100 dark:bg-amber-400/10 dark:text-amber-300 dark:hover:bg-amber-400/20",
|
|
643
665
|
children: [
|
|
644
|
-
/* @__PURE__ */
|
|
645
|
-
|
|
666
|
+
/* @__PURE__ */ l("span", { className: "h-1.5 w-1.5 rounded-full bg-amber-400", "aria-hidden": !0 }),
|
|
667
|
+
r.caller.name,
|
|
646
668
|
" · ",
|
|
647
|
-
|
|
669
|
+
Ce(r.at)
|
|
648
670
|
]
|
|
649
671
|
}
|
|
650
672
|
)
|
|
651
673
|
}
|
|
652
|
-
) : /* @__PURE__ */
|
|
674
|
+
) : /* @__PURE__ */ l(
|
|
653
675
|
"span",
|
|
654
676
|
{
|
|
655
677
|
"data-field-touch": e,
|
|
656
|
-
"data-tip": `Changed ${
|
|
678
|
+
"data-tip": `Changed ${Ce(r.at)} by ${r.who}${s ? ` · ${r.via}` : ""}`,
|
|
657
679
|
role: "img",
|
|
658
|
-
"aria-label": `Changed ${
|
|
680
|
+
"aria-label": `Changed ${Ce(r.at)} by ${r.who}`,
|
|
659
681
|
className: `ml-1 inline-block h-1.5 w-1.5 rounded-full align-middle ${s ? "bg-amber-400" : "bg-slate-300 dark:bg-slate-600"}`
|
|
660
682
|
}
|
|
661
683
|
);
|
|
662
|
-
}, { data: w } =
|
|
663
|
-
() =>
|
|
664
|
-
[
|
|
665
|
-
),
|
|
666
|
-
const
|
|
667
|
-
if (!
|
|
668
|
-
const s =
|
|
684
|
+
}, { data: w } = dl(a, x, !!F && !d), q = ve(
|
|
685
|
+
() => F && (w != null && w.enabled) ? ol(w.findings) : null,
|
|
686
|
+
[F, w]
|
|
687
|
+
), se = ({ field: e }) => {
|
|
688
|
+
const r = q == null ? void 0 : q.get(e);
|
|
689
|
+
if (!r || r.length === 0) return null;
|
|
690
|
+
const s = r.map((c) => c.message || c.rule).join(`
|
|
669
691
|
`);
|
|
670
|
-
return /* @__PURE__ */
|
|
692
|
+
return /* @__PURE__ */ l(
|
|
671
693
|
"span",
|
|
672
694
|
{
|
|
673
695
|
"data-integrity-mark": e,
|
|
674
696
|
"data-tip": s,
|
|
675
697
|
role: "img",
|
|
676
|
-
"aria-label": `${
|
|
698
|
+
"aria-label": `${r.length} data integrity issue${r.length === 1 ? "" : "s"}: ${s}`,
|
|
677
699
|
className: "ml-1.5 inline-flex h-[14px] min-w-[14px] items-center justify-center rounded-full bg-amber-400/90 px-1 align-middle text-[9px] font-bold leading-none text-amber-950 dark:bg-amber-400 dark:text-amber-950",
|
|
678
|
-
children:
|
|
700
|
+
children: r.length > 1 ? r.length : "!"
|
|
679
701
|
}
|
|
680
702
|
);
|
|
681
|
-
}, { data:
|
|
703
|
+
}, { data: H } = U({
|
|
682
704
|
queryKey: ["cbv-collection-meta", a],
|
|
683
|
-
queryFn: () =>
|
|
705
|
+
queryFn: () => A.request(
|
|
684
706
|
G(`/collections/${a}`)
|
|
685
707
|
).then((e) => e.data),
|
|
686
708
|
staleTime: 10 * 6e4,
|
|
687
709
|
retry: !1
|
|
688
|
-
}),
|
|
710
|
+
}), X = Dt(), { data: Le } = U({
|
|
689
711
|
queryKey: ["rrv-record", a, x],
|
|
690
|
-
enabled: !
|
|
691
|
-
queryFn: () =>
|
|
692
|
-
initialData: () =>
|
|
712
|
+
enabled: !d,
|
|
713
|
+
queryFn: () => A.request(G(`/items/${a}/${x}`)).then((e) => e.data),
|
|
714
|
+
initialData: () => X.getQueryData(["item", a, x]) ?? void 0,
|
|
693
715
|
initialDataUpdatedAt: () => {
|
|
694
716
|
var e;
|
|
695
|
-
return (e =
|
|
717
|
+
return (e = X.getQueryState(["item", a, x])) == null ? void 0 : e.dataUpdatedAt;
|
|
696
718
|
},
|
|
697
719
|
staleTime: 3e4,
|
|
698
720
|
retry: !1
|
|
699
|
-
}), u =
|
|
700
|
-
|
|
701
|
-
e.aspectsOnly || e.deleted || (
|
|
721
|
+
}), u = I ?? Le;
|
|
722
|
+
Jt(a, d ? null : x, (e) => {
|
|
723
|
+
e.aspectsOnly || e.deleted || (X.invalidateQueries({ queryKey: ["rrv-record", a, x] }), X.invalidateQueries({ queryKey: ["field-touch", a, x] }));
|
|
702
724
|
});
|
|
703
|
-
const
|
|
704
|
-
|
|
705
|
-
const e =
|
|
706
|
-
if (
|
|
707
|
-
const
|
|
708
|
-
(
|
|
725
|
+
const V = Pt(null), [ue, Ee] = te(() => /* @__PURE__ */ new Set());
|
|
726
|
+
_e(() => {
|
|
727
|
+
const e = V.current;
|
|
728
|
+
if (V.current = u ?? null, d || !e || !u || e === u) return;
|
|
729
|
+
const r = Object.keys(u).filter(
|
|
730
|
+
(c) => !c.startsWith("__") && JSON.stringify(e[c]) !== JSON.stringify(u[c])
|
|
709
731
|
);
|
|
710
|
-
if (
|
|
711
|
-
|
|
712
|
-
const s = setTimeout(() =>
|
|
732
|
+
if (r.length === 0) return;
|
|
733
|
+
Ee(new Set(r));
|
|
734
|
+
const s = setTimeout(() => Ee(/* @__PURE__ */ new Set()), 2400);
|
|
713
735
|
return () => clearTimeout(s);
|
|
714
|
-
}, [u,
|
|
715
|
-
const
|
|
716
|
-
queryKey: ["rrv-field-config", a,
|
|
717
|
-
enabled: !
|
|
718
|
-
queryFn: () =>
|
|
719
|
-
G(`/field-config/${a}`, { layout_id:
|
|
736
|
+
}, [u, d]);
|
|
737
|
+
const D = (e) => ue.has(e) ? " nvr-value-pulse-bg rounded-sm" : "", { data: Z } = U({
|
|
738
|
+
queryKey: ["rrv-field-config", a, y.layout.id],
|
|
739
|
+
enabled: !d,
|
|
740
|
+
queryFn: () => A.request(
|
|
741
|
+
G(`/field-config/${a}`, { layout_id: y.layout.id })
|
|
720
742
|
).then((e) => e.data ?? []).catch(() => null),
|
|
721
743
|
staleTime: 5 * 6e4,
|
|
722
744
|
retry: !1
|
|
723
|
-
}),
|
|
724
|
-
() => new Map((
|
|
725
|
-
[
|
|
726
|
-
),
|
|
727
|
-
var
|
|
728
|
-
return ((
|
|
745
|
+
}), Q = ve(
|
|
746
|
+
() => new Map((Z ?? (H == null ? void 0 : H.fields) ?? []).map((e) => [e.field, e])),
|
|
747
|
+
[Z, H]
|
|
748
|
+
), fe = (H == null ? void 0 : H.relations) ?? [], pe = (e) => {
|
|
749
|
+
var r;
|
|
750
|
+
return ((r = fe.find(
|
|
729
751
|
(s) => s.many_collection === a && s.many_field === e && s.one_collection
|
|
730
|
-
)) == null ? void 0 :
|
|
731
|
-
},
|
|
732
|
-
(
|
|
733
|
-
) ?? null,
|
|
734
|
-
var
|
|
735
|
-
return !((e.is_visible === void 0 || e.is_visible) &&
|
|
736
|
-
},
|
|
737
|
-
(e) => (!e.field.startsWith("__") ||
|
|
738
|
-
),
|
|
752
|
+
)) == null ? void 0 : r.one_collection) ?? null;
|
|
753
|
+
}, Y = (e) => fe.find(
|
|
754
|
+
(r) => r.one_collection === a && (r.one_field === e || r.many_collection === e)
|
|
755
|
+
) ?? null, L = (e) => {
|
|
756
|
+
var r;
|
|
757
|
+
return !((e.is_visible === void 0 || e.is_visible) && xe(e.overrides).hidden !== !0 && !((r = Q.get(e.field)) != null && r.hidden));
|
|
758
|
+
}, ke = y.assignments.filter(
|
|
759
|
+
(e) => (!e.field.startsWith("__") || Re(e.field)) && (k || !L(e))
|
|
760
|
+
), de = y.assignments.filter(
|
|
739
761
|
(e) => e.field.startsWith("__widget_") && e.widget_id != null && (k || e.is_visible === void 0 || !!e.is_visible)
|
|
740
|
-
),
|
|
762
|
+
), Be = (e) => {
|
|
741
763
|
if (!e.input_bindings) return [];
|
|
742
764
|
try {
|
|
743
765
|
return JSON.parse(String(e.input_bindings));
|
|
744
766
|
} catch {
|
|
745
767
|
return [];
|
|
746
768
|
}
|
|
747
|
-
},
|
|
748
|
-
(e) => e.field.startsWith("__") && !e.field.startsWith("__widget_") && !
|
|
749
|
-
).sort((e,
|
|
750
|
-
(s) => e === null ? s.group_key == null &&
|
|
769
|
+
}, Je = S || d ? y.assignments.filter(
|
|
770
|
+
(e) => e.field.startsWith("__") && !e.field.startsWith("__widget_") && !Re(e.field) && (k || e.is_visible === void 0 || !!e.is_visible)
|
|
771
|
+
).sort((e, r) => e.sort - r.sort) : [], oe = ["__pipeline__", "__addendums__"], Pe = new Set(oe), Ne = (e) => (S == null ? void 0 : S(e.field, e)) ?? (d ? /* @__PURE__ */ l("div", { className: "rounded-xl border border-dashed border-slate-300 bg-white px-5 py-3 text-[12px] font-medium text-slate-500 dark:border-slate-600 dark:bg-slate-900/40 dark:text-slate-400", children: e.label_override || ze(e.field.replace(/^_+|_+$/g, "")) }) : null), Me = (e, r = "trailing") => S || d ? Je.filter(
|
|
772
|
+
(s) => e === null ? s.group_key == null && r === "leading" === Pe.has(s.field) : s.group_key === e
|
|
751
773
|
).sort(
|
|
752
|
-
(s,
|
|
753
|
-
).map((s) => ({ key: s.field, a: s, node:
|
|
754
|
-
const s =
|
|
755
|
-
return s.length === 0 ? null : /* @__PURE__ */
|
|
774
|
+
(s, c) => r === "leading" && e === null ? oe.indexOf(s.field) - oe.indexOf(c.field) : 0
|
|
775
|
+
).map((s) => ({ key: s.field, a: s, node: Ne(s) })).filter((s) => s.node != null) : [], we = (e, r = "trailing") => {
|
|
776
|
+
const s = Me(e, r);
|
|
777
|
+
return s.length === 0 ? null : /* @__PURE__ */ l(
|
|
756
778
|
"div",
|
|
757
779
|
{
|
|
758
|
-
className:
|
|
759
|
-
"data-read-live-slots":
|
|
760
|
-
children: s.map((
|
|
761
|
-
{ kind: "slot", field:
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
) },
|
|
780
|
+
className: r === "leading" ? "mb-4 space-y-4" : "mt-3 space-y-4",
|
|
781
|
+
"data-read-live-slots": r,
|
|
782
|
+
children: s.map((c) => /* @__PURE__ */ l("div", { children: N(
|
|
783
|
+
{ kind: "slot", field: c.a.field, group_key: c.a.group_key ?? null },
|
|
784
|
+
c.node,
|
|
785
|
+
L(c.a)
|
|
786
|
+
) }, c.key))
|
|
765
787
|
}
|
|
766
788
|
);
|
|
767
|
-
}, [
|
|
768
|
-
(e) => (
|
|
789
|
+
}, [Se, je] = te({}), $e = (e) => k || Se[e] === !0, [t, i] = te({}), o = ut(
|
|
790
|
+
(e) => (r) => i((s) => s[e] === r ? s : { ...s, [e]: r }),
|
|
769
791
|
[]
|
|
770
|
-
), [p, T] =
|
|
771
|
-
(e) => (
|
|
792
|
+
), [p, T] = te({}), E = ut(
|
|
793
|
+
(e) => (r) => T((s) => s[e] === r ? s : { ...s, [e]: r }),
|
|
772
794
|
[]
|
|
773
|
-
),
|
|
774
|
-
const
|
|
775
|
-
if (
|
|
776
|
-
const s =
|
|
777
|
-
return /* @__PURE__ */
|
|
778
|
-
{ kind: "slot", field:
|
|
779
|
-
/* @__PURE__ */
|
|
780
|
-
|
|
795
|
+
), re = (e) => {
|
|
796
|
+
const r = de.filter((c) => c.group_key === e).sort((c, g) => c.sort - g.sort);
|
|
797
|
+
if (r.length === 0) return null;
|
|
798
|
+
const s = r.some((c) => $e(c.field));
|
|
799
|
+
return /* @__PURE__ */ l("div", { className: s ? "mt-3 space-y-4" : "hidden", "data-read-widgets": !0, children: r.map((c) => /* @__PURE__ */ l("div", { hidden: !$e(c.field), children: N(
|
|
800
|
+
{ kind: "slot", field: c.field, group_key: c.group_key ?? null },
|
|
801
|
+
/* @__PURE__ */ l(
|
|
802
|
+
cl,
|
|
781
803
|
{
|
|
782
|
-
widgetId:
|
|
783
|
-
inputBindings:
|
|
804
|
+
widgetId: c.widget_id,
|
|
805
|
+
inputBindings: Be(c),
|
|
784
806
|
itemDraft: u ?? {},
|
|
785
807
|
itemCollection: a,
|
|
786
808
|
ready: !!u,
|
|
787
|
-
label:
|
|
788
|
-
defaultExpanded:
|
|
789
|
-
onContentChange: (g) =>
|
|
790
|
-
(
|
|
809
|
+
label: c.label_override ?? void 0,
|
|
810
|
+
defaultExpanded: c.default_expanded == null ? !0 : !!c.default_expanded,
|
|
811
|
+
onContentChange: (g) => je(
|
|
812
|
+
(K) => K[c.field] === g ? K : { ...K, [c.field]: g }
|
|
791
813
|
)
|
|
792
814
|
}
|
|
793
815
|
),
|
|
794
|
-
|
|
795
|
-
) },
|
|
796
|
-
},
|
|
797
|
-
const s = new Set(
|
|
816
|
+
L(c)
|
|
817
|
+
) }, c.field)) });
|
|
818
|
+
}, ne = [...y.groups].sort((e, r) => e.sort - r.sort).filter((e) => k || e.visibility_mode !== "new_only").filter((e) => k || !u || Xt(e.visible_when, u)), [Ke, he] = te(() => /* @__PURE__ */ new Set()), ae = (e) => !e.is_collapsed || Ke.has(e.key), xt = (e) => he((r) => {
|
|
819
|
+
const s = new Set(r);
|
|
798
820
|
return s.has(e) ? s.delete(e) : s.add(e), s;
|
|
799
|
-
}),
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
}, [
|
|
803
|
-
const e =
|
|
804
|
-
e &&
|
|
805
|
-
}, [
|
|
806
|
-
const
|
|
807
|
-
for (const e of
|
|
821
|
+
}), Fe = (d == null ? void 0 : d.context.fold) ?? null, qe = (d == null ? void 0 : d.context.reveal) ?? null;
|
|
822
|
+
_e(() => {
|
|
823
|
+
Fe && he(Fe.open ? new Set(y.groups.map((e) => e.key)) : /* @__PURE__ */ new Set());
|
|
824
|
+
}, [Fe == null ? void 0 : Fe.seq]), _e(() => {
|
|
825
|
+
const e = qe ? sl(qe.target) : null;
|
|
826
|
+
e && he((r) => r.has(e) ? r : new Set(r).add(e));
|
|
827
|
+
}, [qe == null ? void 0 : qe.seq]);
|
|
828
|
+
const Ge = [];
|
|
829
|
+
for (const e of ne) {
|
|
808
830
|
if (e.type === "container") {
|
|
809
|
-
for (const
|
|
810
|
-
|
|
831
|
+
for (const r of ne.filter((s) => s.container_id != null && s.container_id === e.id))
|
|
832
|
+
Ge.push(r);
|
|
811
833
|
continue;
|
|
812
834
|
}
|
|
813
|
-
e.container_id == null &&
|
|
835
|
+
e.container_id == null && Ge.push(e);
|
|
814
836
|
}
|
|
815
|
-
const
|
|
816
|
-
var
|
|
817
|
-
return !!((
|
|
818
|
-
},
|
|
837
|
+
const B = (e) => {
|
|
838
|
+
var r;
|
|
839
|
+
return !!((r = Y(e.field)) != null && r.junction_field);
|
|
840
|
+
}, et = (e) => {
|
|
819
841
|
var s;
|
|
820
|
-
const
|
|
821
|
-
|
|
842
|
+
const r = String(
|
|
843
|
+
xe(e.overrides).interface ?? ((s = Q.get(e.field)) == null ? void 0 : s.interface) ?? ""
|
|
822
844
|
);
|
|
823
|
-
return /rich|wysiwyg|editorjs/i.test(
|
|
824
|
-
},
|
|
825
|
-
const
|
|
826
|
-
if (
|
|
827
|
-
const
|
|
828
|
-
return /* @__PURE__ */
|
|
845
|
+
return /rich|wysiwyg|editorjs/i.test(r);
|
|
846
|
+
}, Ae = (e) => {
|
|
847
|
+
const r = Q.get(e.field), s = xe(e.overrides);
|
|
848
|
+
if (Re(e.field)) {
|
|
849
|
+
const P = Ht(s), ce = nl((P == null ? void 0 : P.expr) ?? "", u ?? {});
|
|
850
|
+
return /* @__PURE__ */ l("span", { "data-display-formula": e.field, className: "tabular-nums", children: ce.error ? "—" : Qt(ce.value, P ?? { format: "", currency: null }) });
|
|
829
851
|
}
|
|
830
|
-
const
|
|
831
|
-
if (
|
|
832
|
-
if (
|
|
833
|
-
return /* @__PURE__ */
|
|
834
|
-
|
|
852
|
+
const c = Y(e.field);
|
|
853
|
+
if (d && !x && (c != null && c.junction_field)) return /* @__PURE__ */ l(le, {});
|
|
854
|
+
if (c != null && c.junction_field && c.many_collection && c.many_field)
|
|
855
|
+
return /* @__PURE__ */ l(
|
|
856
|
+
gl,
|
|
835
857
|
{
|
|
836
|
-
junction:
|
|
837
|
-
parentFk:
|
|
838
|
-
junctionField:
|
|
858
|
+
junction: c.many_collection,
|
|
859
|
+
parentFk: c.many_field,
|
|
860
|
+
junctionField: c.junction_field,
|
|
839
861
|
parentId: x,
|
|
840
|
-
onCount:
|
|
841
|
-
onTarget:
|
|
842
|
-
relation:
|
|
862
|
+
onCount: o(e.field),
|
|
863
|
+
onTarget: E(e.field),
|
|
864
|
+
relation: c
|
|
843
865
|
}
|
|
844
866
|
);
|
|
845
|
-
const g = u == null ? void 0 : u[e.field],
|
|
846
|
-
if (
|
|
847
|
-
return /* @__PURE__ */
|
|
848
|
-
if (
|
|
849
|
-
if ((
|
|
850
|
-
if (g == null || g === "") return /* @__PURE__ */
|
|
851
|
-
if ((
|
|
852
|
-
return /* @__PURE__ */
|
|
853
|
-
|
|
867
|
+
const g = u == null ? void 0 : u[e.field], K = pe(e.field);
|
|
868
|
+
if (K === "nivaro_users" && g != null)
|
|
869
|
+
return /* @__PURE__ */ l("span", { className: "inline-block", children: /* @__PURE__ */ l(bt, { userId: String(g), size: "compact" }) });
|
|
870
|
+
if (K) return /* @__PURE__ */ l(Ze, { collection: K, id: g });
|
|
871
|
+
if ((r == null ? void 0 : r.type) === "boolean" && (g == null || g === "")) return /* @__PURE__ */ l(Ve, { value: !1 });
|
|
872
|
+
if (g == null || g === "") return /* @__PURE__ */ l(le, {});
|
|
873
|
+
if ((r == null ? void 0 : r.type) === "boolean")
|
|
874
|
+
return /* @__PURE__ */ l(
|
|
875
|
+
Ve,
|
|
854
876
|
{
|
|
855
877
|
value: g,
|
|
856
878
|
trueTone: (s.options ?? {}).trueTone ?? "positive"
|
|
857
879
|
}
|
|
858
880
|
);
|
|
859
|
-
const
|
|
860
|
-
return
|
|
881
|
+
const ee = s.options ?? {};
|
|
882
|
+
return et(e) && typeof g == "string" ? /^\s*\{/.test(g) ? /* @__PURE__ */ l("div", { className: "min-w-0 whitespace-pre-wrap font-normal [overflow-wrap:anywhere]", children: ll(g) }) : /* @__PURE__ */ l(
|
|
861
883
|
"div",
|
|
862
884
|
{
|
|
863
885
|
className: "rrv-prose min-w-0 font-normal leading-relaxed [overflow-wrap:anywhere] [&_a]:underline [&_h1]:text-[15px] [&_h1]:font-semibold [&_h2]:text-[14px] [&_h2]:font-semibold [&_h3]:font-semibold [&_li]:ml-4 [&_ol]:list-decimal [&_p]:my-1 [&_ul]:list-disc",
|
|
864
886
|
dangerouslySetInnerHTML: { __html: zt(g) }
|
|
865
887
|
}
|
|
866
|
-
) :
|
|
867
|
-
},
|
|
868
|
-
const
|
|
888
|
+
) : ee.format === "currency" ? /* @__PURE__ */ l("span", { className: "tabular-nums", children: Xe(g) }) : (r == null ? void 0 : r.type) === "decimal" || (r == null ? void 0 : r.type) === "float" ? /* @__PURE__ */ l("span", { className: "tabular-nums", children: Ue(g) }) : (r == null ? void 0 : r.type) === "date" || (r == null ? void 0 : r.type) === "datetime" || (r == null ? void 0 : r.type) === "timestamp" ? yt(g) : String(g);
|
|
889
|
+
}, vt = (e) => {
|
|
890
|
+
const r = xe(e.overrides), s = Y(e.field);
|
|
869
891
|
if (!(s != null && s.many_collection) || !s.many_field) return null;
|
|
870
|
-
if (
|
|
871
|
-
const
|
|
872
|
-
var
|
|
873
|
-
const
|
|
874
|
-
if (!
|
|
875
|
-
if (typeof
|
|
892
|
+
if (d && !x) return /* @__PURE__ */ l("p", { className: "py-3 text-[12px] text-slate-400", children: "No records" });
|
|
893
|
+
const c = r.options ?? {}, g = (() => {
|
|
894
|
+
var P;
|
|
895
|
+
const ee = (P = Q.get(e.field)) == null ? void 0 : P.options;
|
|
896
|
+
if (!ee) return {};
|
|
897
|
+
if (typeof ee == "string")
|
|
876
898
|
try {
|
|
877
|
-
return JSON.parse(
|
|
899
|
+
return JSON.parse(ee);
|
|
878
900
|
} catch {
|
|
879
901
|
return {};
|
|
880
902
|
}
|
|
881
|
-
return
|
|
882
|
-
})(),
|
|
883
|
-
return /* @__PURE__ */
|
|
884
|
-
|
|
903
|
+
return ee;
|
|
904
|
+
})(), K = c.layout_id ?? null;
|
|
905
|
+
return /* @__PURE__ */ l(
|
|
906
|
+
bl,
|
|
885
907
|
{
|
|
886
908
|
collection: s.many_collection,
|
|
887
909
|
fkField: s.many_field,
|
|
888
910
|
parentId: x,
|
|
889
|
-
layoutId:
|
|
890
|
-
presets:
|
|
891
|
-
defaultPreset:
|
|
892
|
-
onCount:
|
|
911
|
+
layoutId: K,
|
|
912
|
+
presets: c.column_presets ?? g.column_presets,
|
|
913
|
+
defaultPreset: c.default_preset ?? g.default_preset ?? null,
|
|
914
|
+
onCount: o(e.field)
|
|
893
915
|
},
|
|
894
916
|
e.field
|
|
895
917
|
);
|
|
896
|
-
},
|
|
897
|
-
if (!u ||
|
|
898
|
-
const
|
|
899
|
-
return
|
|
900
|
-
},
|
|
901
|
-
var
|
|
902
|
-
const
|
|
903
|
-
return s !== void 0 ? s :
|
|
904
|
-
},
|
|
905
|
-
const
|
|
906
|
-
if (
|
|
907
|
-
const
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
918
|
+
}, z = (e) => !!Y(e.field) && !B(e), _t = !!y.layout.hide_empty, tt = Array.isArray(y.layout.header_fields) ? y.layout.header_fields.filter((e) => typeof e == "string") : [], kt = new Set(tt), Nt = (e) => {
|
|
919
|
+
if (!u || B(e)) return !1;
|
|
920
|
+
const r = u[e.field];
|
|
921
|
+
return r == null || r === "" || Array.isArray(r) && r.length === 0;
|
|
922
|
+
}, wt = (e) => ke.find((r) => r.field === e), ge = (e) => {
|
|
923
|
+
var c;
|
|
924
|
+
const r = xe(e.overrides).label, s = M ? Gt(e.overrides, M).label : void 0;
|
|
925
|
+
return s !== void 0 ? s : Re(e.field) ? typeof r == "string" && r.trim() ? r : "Formula" : typeof r == "string" && r.trim() ? r : e.label_override || ((c = Q.get(e.field)) == null ? void 0 : c.label) || ze(e.field);
|
|
926
|
+
}, St = (e) => {
|
|
927
|
+
const r = Ut(e.swap_config), s = ke.filter((n) => n.group_key === e.key && !kt.has(n.field)).filter((n) => k || !u || !Vt(n.overrides) || !ye(u[n.field])).sort((n, $) => n.sort - $.sort), c = de.filter((n) => n.group_key === e.key), g = Me(e.key), K = s.length === 0 && c.length === 0 && g.length === 0;
|
|
928
|
+
if (K && !d) return null;
|
|
929
|
+
const ee = (n) => _t && !k && (z(n) || B(n)) && ((h == null ? void 0 : h[n.field]) ?? t[n.field]) === 0, P = s.filter((n) => !z(n)), ce = s.filter(z), We = c.filter((n) => $e(n.field)), Ft = !e.hide_when_empty && g.length === 0 && We.length === 0 && s.length > 0 && s.some((n) => z(n) || B(n)) && s.every(ee), He = (n) => !Ft && ee(n), qt = s.filter((n) => !He(n)), be = (n) => (h == null ? void 0 : h[n.field]) ?? t[n.field], At = !!e.hide_when_empty && !d && !k && !!u && g.length === 0 && We.length === 0 && s.every((n) => z(n) || B(n) ? be(n) === 0 : ye(u[n.field])) || !K && qt.length === 0 && g.length === 0 && We.length === 0, Ot = (n) => (h == null ? void 0 : h[n.field]) ?? t[n.field], Qe = !!r.emptyText && !!u && !d && g.length === 0 && We.length === 0 && s.every((n) => z(n) || B(n) ? Ot(n) === 0 : ye(u[n.field])), Tt = Bt(P, { rows: r.rows }).units, Ye = e.is_collapsed ? ul(e.summary_fields).map((n) => {
|
|
930
|
+
const $ = s.find((Oe) => Oe.field === n.field);
|
|
931
|
+
return $ ? { a: $, label: n.label || ge($) } : null;
|
|
932
|
+
}).filter((n) => !!n).filter(
|
|
933
|
+
({ a: n }) => !e.summary_hide_empty || !u || (z(n) || B(n) ? be(n) !== 0 : !ye(u[n.field]))
|
|
934
|
+
).slice(0, ml) : [], it = e.read_width === "full" || e.read_width === "half" || e.read_width === "third" ? e.read_width : ce.length > 0 || c.length > 0 || g.length > 0 || P.length > 4 ? "full" : "half", Rt = (n) => {
|
|
935
|
+
var ot, ct, mt;
|
|
936
|
+
const $ = He(n), J = !!(xe(n.overrides).options ?? {}).emphasis, Te = et(n) || !!((ct = (ot = Q.get(n.field)) == null ? void 0 : ot.interface) != null && ct.includes("rich-text")), st = u == null ? void 0 : u[n.field], dt = !Te && !B(n) && !pe(n.field) && (String(((mt = Q.get(n.field)) == null ? void 0 : mt.interface) ?? "").includes("textarea") || typeof st == "string" && st.length > 36);
|
|
937
|
+
return /* @__PURE__ */ l(
|
|
911
938
|
"div",
|
|
912
939
|
{
|
|
913
|
-
hidden:
|
|
914
|
-
className: `min-w-0 ${
|
|
940
|
+
hidden: $,
|
|
941
|
+
className: `min-w-0 ${Te || B(n) && (p[n.field] === "nivaro_files" || (t[n.field] ?? 0) > 3) ? "col-span-full" : J || dt ? "col-span-2" : ""}`,
|
|
915
942
|
children: N(
|
|
916
|
-
|
|
917
|
-
/* @__PURE__ */
|
|
918
|
-
/* @__PURE__ */
|
|
919
|
-
|
|
920
|
-
/* @__PURE__ */
|
|
921
|
-
/* @__PURE__ */
|
|
943
|
+
R(n),
|
|
944
|
+
/* @__PURE__ */ f(me, { children: [
|
|
945
|
+
/* @__PURE__ */ f("dt", { className: Ie, children: [
|
|
946
|
+
ge(n),
|
|
947
|
+
/* @__PURE__ */ l(se, { field: n.field }),
|
|
948
|
+
/* @__PURE__ */ l(ft, { field: n.field }),
|
|
922
949
|
v(n.field)
|
|
923
950
|
] }),
|
|
924
|
-
/* @__PURE__ */
|
|
951
|
+
/* @__PURE__ */ l(
|
|
925
952
|
"dd",
|
|
926
953
|
{
|
|
927
954
|
"data-replay-field": n.field,
|
|
928
955
|
"data-field-collection": a,
|
|
929
|
-
"data-remote-changed":
|
|
930
|
-
className: `mt-1 min-w-0${
|
|
931
|
-
children: u ?
|
|
956
|
+
"data-remote-changed": ue.has(n.field) || void 0,
|
|
957
|
+
className: `mt-1 min-w-0${D(n.field)} ${J ? "text-[17px] font-semibold tracking-[-0.01em] text-slate-900 dark:text-white" : `${B(n) || Te ? "" : dt ? "line-clamp-3 break-words " : "truncate "}text-[13px] font-medium text-slate-800 dark:text-slate-100`}`,
|
|
958
|
+
children: u ? Ae(n) : /* @__PURE__ */ l("span", { className: "inline-block h-3.5 w-20 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" })
|
|
932
959
|
}
|
|
933
960
|
)
|
|
934
961
|
] }),
|
|
935
|
-
|
|
962
|
+
L(n)
|
|
936
963
|
)
|
|
937
964
|
},
|
|
938
965
|
n.field
|
|
939
966
|
);
|
|
940
|
-
},
|
|
941
|
-
const
|
|
942
|
-
return /* @__PURE__ */
|
|
967
|
+
}, Ct = (n, $) => {
|
|
968
|
+
const Oe = u && !d ? $.filter((J) => !ye(u[J.field])) : $;
|
|
969
|
+
return /* @__PURE__ */ f(
|
|
943
970
|
"div",
|
|
944
971
|
{
|
|
945
972
|
"data-read-row": n.key,
|
|
946
|
-
className: `min-w-0 ${
|
|
973
|
+
className: `min-w-0 ${$.length > 2 ? "col-span-full" : "col-span-2"}`,
|
|
947
974
|
children: [
|
|
948
|
-
/* @__PURE__ */
|
|
949
|
-
/* @__PURE__ */
|
|
950
|
-
|
|
975
|
+
/* @__PURE__ */ l("dt", { className: Ie, children: n.label.trim() || $.map(ge).join(" / ") }),
|
|
976
|
+
/* @__PURE__ */ l("dd", { className: "mt-1 flex min-w-0 flex-wrap items-baseline gap-x-1.5 text-[13px] font-medium text-slate-800 dark:text-slate-100", children: u ? Oe.length === 0 ? /* @__PURE__ */ l(le, {}) : Oe.map((J, Te) => /* @__PURE__ */ f(Mt, { children: [
|
|
977
|
+
Te > 0 && /* @__PURE__ */ l("span", { "aria-hidden": !0, className: "text-slate-300 dark:text-slate-600", children: "·" }),
|
|
951
978
|
N(
|
|
952
|
-
|
|
953
|
-
/* @__PURE__ */
|
|
979
|
+
R(J),
|
|
980
|
+
/* @__PURE__ */ l(
|
|
954
981
|
"span",
|
|
955
982
|
{
|
|
956
|
-
"data-replay-field":
|
|
983
|
+
"data-replay-field": J.field,
|
|
957
984
|
"data-field-collection": a,
|
|
958
|
-
className: `min-w-0 break-words${
|
|
959
|
-
children:
|
|
985
|
+
className: `min-w-0 break-words${D(J.field)}`,
|
|
986
|
+
children: Ae(J)
|
|
960
987
|
}
|
|
961
988
|
),
|
|
962
|
-
|
|
989
|
+
L(J)
|
|
963
990
|
)
|
|
964
|
-
] },
|
|
991
|
+
] }, J.field)) : /* @__PURE__ */ l("span", { className: "inline-block h-3.5 w-28 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }) })
|
|
965
992
|
]
|
|
966
993
|
},
|
|
967
994
|
`row:${n.key}`
|
|
968
995
|
);
|
|
969
996
|
};
|
|
970
|
-
return /* @__PURE__ */
|
|
997
|
+
return /* @__PURE__ */ l(
|
|
971
998
|
"section",
|
|
972
999
|
{
|
|
973
|
-
hidden:
|
|
1000
|
+
hidden: At,
|
|
974
1001
|
"data-read-section": e.key,
|
|
975
|
-
"data-read-width":
|
|
1002
|
+
"data-read-width": it,
|
|
976
1003
|
className: "min-w-0 rounded-xl border border-slate-200 bg-white dark:border-slate-700/60 dark:bg-slate-900/40",
|
|
977
1004
|
children: N(
|
|
978
1005
|
{ kind: "group", key: e.key },
|
|
979
|
-
/* @__PURE__ */
|
|
980
|
-
/* @__PURE__ */
|
|
1006
|
+
/* @__PURE__ */ f(me, { children: [
|
|
1007
|
+
/* @__PURE__ */ f(
|
|
981
1008
|
"h3",
|
|
982
1009
|
{
|
|
983
|
-
|
|
1010
|
+
"data-read-head": "",
|
|
1011
|
+
className: `group/rs relative flex items-center justify-between gap-2 px-5 py-2.5 text-[12.5px] font-semibold text-slate-700 dark:text-slate-200 ${ae(e) ? "border-b border-slate-100 dark:border-slate-800" : ""}`,
|
|
984
1012
|
children: [
|
|
985
|
-
e.is_collapsed ? /* @__PURE__ */
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
1013
|
+
e.is_collapsed ? /* @__PURE__ */ f(me, { children: [
|
|
1014
|
+
/* @__PURE__ */ l(
|
|
1015
|
+
"button",
|
|
1016
|
+
{
|
|
1017
|
+
type: "button",
|
|
1018
|
+
onClick: () => xt(e.key),
|
|
1019
|
+
"aria-expanded": ae(e),
|
|
1020
|
+
className: `min-w-0 text-left after:absolute after:inset-0 group-hover/rs:text-slate-900 dark:group-hover/rs:text-white ${Ye.length > 0 && !ae(e) ? "shrink-0" : "flex-1"}`,
|
|
1021
|
+
children: e.label
|
|
1022
|
+
}
|
|
1023
|
+
),
|
|
1024
|
+
!ae(e) && Ye.length > 0 && // #3195: two or three values while the section is closed. Not
|
|
1025
|
+
// interactive: the heading's toggle covers the whole row.
|
|
1026
|
+
/* @__PURE__ */ l(
|
|
1027
|
+
"span",
|
|
1028
|
+
{
|
|
1029
|
+
"data-read-collapsed-summary": e.key,
|
|
1030
|
+
className: "pointer-events-none flex min-w-0 flex-1 items-baseline gap-x-3 overflow-hidden whitespace-nowrap text-[12px] font-normal",
|
|
1031
|
+
children: Ye.map(({ a: n, label: $ }) => /* @__PURE__ */ f("span", { className: "flex min-w-0 shrink items-baseline gap-1", children: [
|
|
1032
|
+
/* @__PURE__ */ l("span", { className: "shrink-0 text-[10px] font-semibold uppercase tracking-wider text-slate-400 dark:text-slate-500", children: $ }),
|
|
1033
|
+
/* @__PURE__ */ l("span", { className: "min-w-0 truncate font-medium text-slate-700 dark:text-slate-300", children: u ? z(n) || B(n) ? be(n) == null ? "…" : `${be(n)} ${z(n) ? be(n) === 1 ? "row" : "rows" : be(n) === 1 ? "item" : "items"}` : ye(u[n.field]) ? /* @__PURE__ */ l("span", { className: "text-slate-300 dark:text-slate-600", children: "—" }) : Ae(n) : "…" })
|
|
1034
|
+
] }, n.field))
|
|
1035
|
+
}
|
|
1036
|
+
)
|
|
1037
|
+
] }) : /* @__PURE__ */ l("span", { className: "min-w-0 flex-1", children: e.label }),
|
|
1038
|
+
_ && (P.length > 0 || ce.length > 0) && /* @__PURE__ */ l(
|
|
996
1039
|
"button",
|
|
997
1040
|
{
|
|
998
1041
|
type: "button",
|
|
999
1042
|
"data-read-edit-section": e.key,
|
|
1000
1043
|
onClick: () => {
|
|
1001
|
-
var n,
|
|
1002
|
-
return _(e.key, ((n =
|
|
1044
|
+
var n, $;
|
|
1045
|
+
return _(e.key, ((n = P[0]) == null ? void 0 : n.field) ?? (($ = ce[0]) == null ? void 0 : $.field) ?? null);
|
|
1003
1046
|
},
|
|
1004
1047
|
title: `Edit ${e.label}`,
|
|
1005
1048
|
"aria-label": `Edit ${e.label}`,
|
|
1006
1049
|
className: "relative -my-1 rounded p-1 text-slate-400 opacity-0 transition-opacity hover:bg-slate-100 hover:text-slate-700 focus-visible:opacity-100 group-hover/rs:opacity-100 dark:hover:bg-white/5 dark:hover:text-slate-200 motion-reduce:transition-none",
|
|
1007
|
-
children: /* @__PURE__ */
|
|
1050
|
+
children: /* @__PURE__ */ l(Lt, { className: "h-3 w-3" })
|
|
1008
1051
|
}
|
|
1009
1052
|
),
|
|
1010
|
-
e.is_collapsed && /* @__PURE__ */
|
|
1011
|
-
|
|
1053
|
+
e.is_collapsed && /* @__PURE__ */ l(
|
|
1054
|
+
Et,
|
|
1012
1055
|
{
|
|
1013
1056
|
"aria-hidden": "true",
|
|
1014
|
-
className: `pointer-events-none h-3.5 w-3.5 shrink-0 transition-transform group-hover/rs:text-slate-700 dark:group-hover/rs:text-slate-200 ${
|
|
1057
|
+
className: `pointer-events-none h-3.5 w-3.5 shrink-0 transition-transform group-hover/rs:text-slate-700 dark:group-hover/rs:text-slate-200 ${ae(e) ? "" : "-rotate-90"}`
|
|
1015
1058
|
}
|
|
1016
1059
|
)
|
|
1017
1060
|
]
|
|
1018
1061
|
}
|
|
1019
1062
|
),
|
|
1020
|
-
/* @__PURE__ */
|
|
1021
|
-
|
|
1063
|
+
/* @__PURE__ */ f("div", { "data-read-body": "", className: "px-5 pb-5 pt-4", hidden: !ae(e), children: [
|
|
1064
|
+
Qe && /* @__PURE__ */ l(
|
|
1022
1065
|
"p",
|
|
1023
1066
|
{
|
|
1024
1067
|
"data-read-empty": e.key,
|
|
1025
1068
|
className: "text-[13px] text-slate-500 dark:text-slate-400",
|
|
1026
|
-
children:
|
|
1069
|
+
children: r.emptyText
|
|
1027
1070
|
}
|
|
1028
1071
|
),
|
|
1029
|
-
|
|
1072
|
+
P.length > 0 && // One column rhythm for the whole page: every section's facts sit
|
|
1030
1073
|
// on the same 2 / 3 / 4 / 6 tracks, so values line up card to
|
|
1031
1074
|
// card instead of each card auto-filling its own grid. Hidden, not
|
|
1032
1075
|
// unrendered, under the empty text: its link facts must keep reporting.
|
|
1033
|
-
/* @__PURE__ */
|
|
1076
|
+
/* @__PURE__ */ l(
|
|
1034
1077
|
"dl",
|
|
1035
1078
|
{
|
|
1036
1079
|
className: "grid gap-x-6 gap-y-5",
|
|
1037
|
-
"data-read-dl":
|
|
1038
|
-
style:
|
|
1039
|
-
children:
|
|
1040
|
-
(n) => n.kind === "row" ?
|
|
1080
|
+
"data-read-dl": it,
|
|
1081
|
+
style: Qe ? { display: "none" } : void 0,
|
|
1082
|
+
children: Tt.map(
|
|
1083
|
+
(n) => n.kind === "row" ? Ct(n.row, n.members) : Rt(n.field)
|
|
1041
1084
|
)
|
|
1042
1085
|
}
|
|
1043
1086
|
),
|
|
1044
|
-
|
|
1045
|
-
var
|
|
1046
|
-
return /* @__PURE__ */
|
|
1087
|
+
ce.map((n) => {
|
|
1088
|
+
var $;
|
|
1089
|
+
return /* @__PURE__ */ l(
|
|
1047
1090
|
"div",
|
|
1048
1091
|
{
|
|
1049
|
-
className:
|
|
1050
|
-
hidden:
|
|
1092
|
+
className: P.length > 0 ? "mt-3" : "",
|
|
1093
|
+
hidden: He(n) || Qe,
|
|
1051
1094
|
children: N(
|
|
1052
|
-
|
|
1053
|
-
/* @__PURE__ */
|
|
1054
|
-
(
|
|
1055
|
-
/* @__PURE__ */
|
|
1056
|
-
/* @__PURE__ */
|
|
1057
|
-
/* @__PURE__ */
|
|
1095
|
+
R(n),
|
|
1096
|
+
/* @__PURE__ */ f(me, { children: [
|
|
1097
|
+
($ = q == null ? void 0 : q.get(n.field)) != null && $.length ? /* @__PURE__ */ f("div", { className: "mb-1.5 flex items-center gap-1.5 text-[11px] font-medium text-amber-700 dark:text-amber-300", children: [
|
|
1098
|
+
/* @__PURE__ */ l("span", { children: ge(n) }),
|
|
1099
|
+
/* @__PURE__ */ l(se, { field: n.field }),
|
|
1100
|
+
/* @__PURE__ */ f("span", { className: "font-normal text-amber-700/80 dark:text-amber-300/80", children: [
|
|
1058
1101
|
"— ",
|
|
1059
|
-
|
|
1102
|
+
q.get(n.field).length,
|
|
1060
1103
|
" line issue",
|
|
1061
|
-
|
|
1104
|
+
q.get(n.field).length === 1 ? "" : "s",
|
|
1062
1105
|
"; switch to Edit to fix"
|
|
1063
1106
|
] })
|
|
1064
1107
|
] }) : null,
|
|
1065
|
-
(W ? W(n) : null) ??
|
|
1108
|
+
(W ? W(n) : null) ?? vt(n)
|
|
1066
1109
|
] }),
|
|
1067
|
-
|
|
1110
|
+
L(n)
|
|
1068
1111
|
)
|
|
1069
1112
|
},
|
|
1070
1113
|
n.field
|
|
1071
1114
|
);
|
|
1072
1115
|
}),
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1116
|
+
re(e.key),
|
|
1117
|
+
we(e.key),
|
|
1118
|
+
K && d && /* @__PURE__ */ l(
|
|
1076
1119
|
"div",
|
|
1077
1120
|
{
|
|
1078
1121
|
"data-design-drop": e.key,
|
|
@@ -1087,77 +1130,79 @@ function ft({
|
|
|
1087
1130
|
},
|
|
1088
1131
|
e.key
|
|
1089
1132
|
);
|
|
1090
|
-
},
|
|
1091
|
-
return /* @__PURE__ */
|
|
1133
|
+
}, lt = we(null), $t = we(null, "leading"), rt = tt.map((e) => wt(e)).filter((e) => !!e && !z(e)).filter((e) => k || !Nt(e)), [ie, ...nt] = rt;
|
|
1134
|
+
return /* @__PURE__ */ f(
|
|
1092
1135
|
"div",
|
|
1093
1136
|
{
|
|
1094
|
-
className:
|
|
1137
|
+
className: O ? "min-h-0 flex-1" : "min-h-0 flex-1 overflow-y-auto bg-slate-50/60 px-5 py-4 dark:bg-transparent",
|
|
1095
1138
|
children: [
|
|
1096
|
-
|
|
1097
|
-
|
|
1139
|
+
$t,
|
|
1140
|
+
rt.length > 0 && /* @__PURE__ */ f(
|
|
1098
1141
|
"div",
|
|
1099
1142
|
{
|
|
1100
1143
|
"data-read-header": !0,
|
|
1101
1144
|
className: "mb-4 rounded-xl border border-slate-200 bg-white px-5 py-4 dark:border-slate-700/60 dark:bg-slate-900/40",
|
|
1102
1145
|
children: [
|
|
1103
|
-
|
|
1104
|
-
{ kind: "header", field:
|
|
1105
|
-
/* @__PURE__ */
|
|
1106
|
-
/* @__PURE__ */
|
|
1107
|
-
|
|
1108
|
-
/* @__PURE__ */
|
|
1146
|
+
ie && N(
|
|
1147
|
+
{ kind: "header", field: ie.field },
|
|
1148
|
+
/* @__PURE__ */ f("div", { className: "min-w-0", children: [
|
|
1149
|
+
/* @__PURE__ */ f("p", { className: Ie, children: [
|
|
1150
|
+
ge(ie),
|
|
1151
|
+
/* @__PURE__ */ l(se, { field: ie.field })
|
|
1109
1152
|
] }),
|
|
1110
|
-
/* @__PURE__ */
|
|
1153
|
+
/* @__PURE__ */ l(
|
|
1111
1154
|
"p",
|
|
1112
1155
|
{
|
|
1113
|
-
"data-replay-field":
|
|
1156
|
+
"data-replay-field": ie.field,
|
|
1114
1157
|
"data-field-collection": a,
|
|
1115
|
-
className: `truncate text-[22px] font-semibold leading-tight tracking-[-0.015em] text-slate-900 dark:text-white${
|
|
1116
|
-
children: u ?
|
|
1158
|
+
className: `truncate text-[22px] font-semibold leading-tight tracking-[-0.015em] text-slate-900 dark:text-white${D(ie.field)}`,
|
|
1159
|
+
children: u ? Ae(ie) : "…"
|
|
1117
1160
|
}
|
|
1118
1161
|
)
|
|
1119
1162
|
] }),
|
|
1120
|
-
|
|
1163
|
+
L(ie)
|
|
1121
1164
|
),
|
|
1122
|
-
|
|
1165
|
+
nt.length > 0 && /* @__PURE__ */ l("dl", { className: "mt-3 flex flex-wrap gap-x-8 gap-y-2", children: nt.map((e) => /* @__PURE__ */ l("div", { className: "min-w-0", children: N(
|
|
1123
1166
|
{ kind: "header", field: e.field },
|
|
1124
|
-
/* @__PURE__ */
|
|
1125
|
-
/* @__PURE__ */
|
|
1126
|
-
|
|
1127
|
-
/* @__PURE__ */
|
|
1128
|
-
/* @__PURE__ */
|
|
1167
|
+
/* @__PURE__ */ f(me, { children: [
|
|
1168
|
+
/* @__PURE__ */ f("dt", { className: Ie, children: [
|
|
1169
|
+
ge(e),
|
|
1170
|
+
/* @__PURE__ */ l(se, { field: e.field }),
|
|
1171
|
+
/* @__PURE__ */ l(ft, { field: e.field }),
|
|
1129
1172
|
v(e.field)
|
|
1130
1173
|
] }),
|
|
1131
|
-
/* @__PURE__ */
|
|
1174
|
+
/* @__PURE__ */ l(
|
|
1132
1175
|
"dd",
|
|
1133
1176
|
{
|
|
1134
1177
|
"data-replay-field": e.field,
|
|
1135
1178
|
"data-field-collection": a,
|
|
1136
|
-
"data-remote-changed":
|
|
1137
|
-
className: `mt-0.5 truncate text-[13px] font-medium text-slate-800 dark:text-slate-100${
|
|
1138
|
-
children: u ?
|
|
1179
|
+
"data-remote-changed": ue.has(e.field) || void 0,
|
|
1180
|
+
className: `mt-0.5 truncate text-[13px] font-medium text-slate-800 dark:text-slate-100${D(e.field)}`,
|
|
1181
|
+
children: u ? Ae(e) : "…"
|
|
1139
1182
|
}
|
|
1140
1183
|
)
|
|
1141
1184
|
] }),
|
|
1142
|
-
|
|
1185
|
+
L(e)
|
|
1143
1186
|
) }, e.field)) })
|
|
1144
1187
|
]
|
|
1145
1188
|
}
|
|
1146
1189
|
),
|
|
1147
|
-
/* @__PURE__ */
|
|
1148
|
-
|
|
1149
|
-
/* @__PURE__ */
|
|
1150
|
-
/* @__PURE__ */
|
|
1151
|
-
/* @__PURE__ */
|
|
1190
|
+
/* @__PURE__ */ l("style", { children: fl }),
|
|
1191
|
+
H ? /* @__PURE__ */ l("div", { className: "grid items-stretch gap-4", "data-read-board": !0, children: Ge.map(St) }) : /* @__PURE__ */ f("div", { className: "flex flex-col gap-4", "data-read-board-pending": !0, children: [
|
|
1192
|
+
/* @__PURE__ */ l("div", { className: "h-32 animate-pulse rounded-xl bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }),
|
|
1193
|
+
/* @__PURE__ */ l("div", { className: "h-32 animate-pulse rounded-xl bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }),
|
|
1194
|
+
/* @__PURE__ */ l("div", { className: "h-56 animate-pulse rounded-xl bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" })
|
|
1152
1195
|
] }),
|
|
1153
|
-
|
|
1196
|
+
lt && /* @__PURE__ */ l("div", { className: "mt-4", children: lt })
|
|
1154
1197
|
]
|
|
1155
1198
|
}
|
|
1156
1199
|
);
|
|
1157
1200
|
}
|
|
1158
|
-
function
|
|
1159
|
-
return a.design ? /* @__PURE__ */
|
|
1201
|
+
function Ql(a) {
|
|
1202
|
+
return a.design ? /* @__PURE__ */ l(il, { design: a.design.context, onRefusedWrite: a.design.onRefusedWrite, children: /* @__PURE__ */ l(jt.Provider, { value: null, children: /* @__PURE__ */ l(ht, { ...a }) }) }) : /* @__PURE__ */ l(ht, { ...a });
|
|
1160
1203
|
}
|
|
1161
1204
|
export {
|
|
1162
|
-
|
|
1205
|
+
ml as COLLAPSED_SUMMARY_MAX,
|
|
1206
|
+
Ql as RecordReadView,
|
|
1207
|
+
ul as collapsedSummaryEntries
|
|
1163
1208
|
};
|