@nivaro/react 0.3.35 → 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 +13 -4
- 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 -572
- 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 +80 -63
- 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 +146 -131
- package/dist/shared/components/layout-editor/EditorCanvas.js +25 -17
- package/dist/shared/components/layout-editor/EditorTopBar.js +268 -206
- package/dist/shared/components/layout-editor/LayoutEditor.js +810 -731
- 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 +379 -185
- package/dist/shared/components/layout-editor/dnd/TrashZone.js +96 -0
- 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/rail-drop.js +4 -4
- package/dist/shared/components/layout-editor/dnd/sensors.js +23 -0
- package/dist/shared/components/layout-editor/dnd/trash-drop.js +58 -0
- 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/panel-frame.js +1 -1
- package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
- package/dist/shared/components/layout-editor/personal-default-marks.js +40 -0
- 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 +149 -118
- 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,31 +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
|
|
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
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
|
|
13
|
-
import { sanitizeHtml as
|
|
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 {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
|
|
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
|
+
import { sanitizeHtml as zt } from "../lib/sanitize-html.js";
|
|
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) => {
|
|
29
30
|
if (!a) return {};
|
|
30
31
|
if (typeof a == "object") return a;
|
|
31
32
|
try {
|
|
@@ -33,18 +34,40 @@ const he = (a) => {
|
|
|
33
34
|
} catch {
|
|
34
35
|
return {};
|
|
35
36
|
}
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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 = `
|
|
48
71
|
[data-read-board]{grid-template-columns:minmax(0,1fr)}
|
|
49
72
|
[data-read-dl]{grid-template-columns:repeat(2,minmax(0,1fr))}
|
|
50
73
|
@media (min-width:640px){[data-read-dl="full"]{grid-template-columns:repeat(3,minmax(0,1fr))}}
|
|
@@ -59,48 +82,48 @@ const he = (a) => {
|
|
|
59
82
|
}
|
|
60
83
|
@media (min-width:1536px){[data-read-dl="full"]{grid-template-columns:repeat(6,minmax(0,1fr))}}
|
|
61
84
|
`;
|
|
62
|
-
function
|
|
85
|
+
function Ve({
|
|
63
86
|
value: a,
|
|
64
|
-
trueTone:
|
|
87
|
+
trueTone: m = "positive"
|
|
65
88
|
}) {
|
|
66
|
-
const
|
|
67
|
-
return /* @__PURE__ */
|
|
89
|
+
const b = a === !0 || a === 1 || a === "1" || a === "true";
|
|
90
|
+
return /* @__PURE__ */ l(
|
|
68
91
|
"span",
|
|
69
92
|
{
|
|
70
|
-
className: `inline-flex h-[18px] items-center rounded-full px-1.5 text-[10.5px] font-semibold ${
|
|
71
|
-
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"
|
|
72
95
|
}
|
|
73
96
|
);
|
|
74
97
|
}
|
|
75
|
-
function
|
|
76
|
-
const
|
|
98
|
+
function pl({ collection: a, id: m }) {
|
|
99
|
+
const b = De(), d = Yt(), O = gt(), { data: S } = U({
|
|
77
100
|
queryKey: ["cbv-collection-meta", a],
|
|
78
|
-
queryFn: () =>
|
|
101
|
+
queryFn: () => b.request(
|
|
79
102
|
G(`/collections/${a}`)
|
|
80
|
-
).then((
|
|
103
|
+
).then((A) => A.data).catch(() => ({ display_template: null, fields: [] })),
|
|
81
104
|
staleTime: 10 * 6e4,
|
|
82
105
|
retry: !1
|
|
83
|
-
}), { data:
|
|
84
|
-
queryKey: ["rrv-related", a, String(
|
|
85
|
-
queryFn: () =>
|
|
86
|
-
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,
|
|
87
110
|
staleTime: 6e4,
|
|
88
111
|
retry: !1
|
|
89
112
|
});
|
|
90
|
-
if (
|
|
91
|
-
if (
|
|
92
|
-
return /* @__PURE__ */
|
|
93
|
-
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: [
|
|
94
117
|
"#",
|
|
95
|
-
String(
|
|
118
|
+
String(m)
|
|
96
119
|
] });
|
|
97
120
|
let _ = "";
|
|
98
121
|
const h = S == null ? void 0 : S.display_template;
|
|
99
|
-
if (h && (_ = h.replace(/\{\{\s*([^}]+?)\s*\}\}/g, (
|
|
100
|
-
const
|
|
101
|
-
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);
|
|
102
125
|
}).trim()), !_) {
|
|
103
|
-
for (const
|
|
126
|
+
for (const A of [
|
|
104
127
|
"name",
|
|
105
128
|
"title",
|
|
106
129
|
"label",
|
|
@@ -110,39 +133,39 @@ function cl({ collection: a, id: f }) {
|
|
|
110
133
|
"filename_download",
|
|
111
134
|
"filename"
|
|
112
135
|
])
|
|
113
|
-
if (
|
|
114
|
-
_ = String(
|
|
136
|
+
if (F[A]) {
|
|
137
|
+
_ = String(F[A]);
|
|
115
138
|
break;
|
|
116
139
|
}
|
|
117
140
|
}
|
|
118
|
-
return _ || (_ = `#${String(
|
|
141
|
+
return _ || (_ = `#${String(m)}`), O ? /* @__PURE__ */ l(
|
|
119
142
|
"button",
|
|
120
143
|
{
|
|
121
144
|
type: "button",
|
|
122
|
-
onClick: () =>
|
|
145
|
+
onClick: () => O.open({ collection: a, itemId: String(m) }),
|
|
123
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",
|
|
124
147
|
children: _
|
|
125
148
|
}
|
|
126
|
-
) : /* @__PURE__ */
|
|
149
|
+
) : /* @__PURE__ */ l(me, { children: _ });
|
|
127
150
|
}
|
|
128
|
-
function
|
|
129
|
-
const
|
|
151
|
+
function hl({ id: a }) {
|
|
152
|
+
const m = De(), { apiBase: b } = Kt(), { data: d, isPending: O } = U({
|
|
130
153
|
queryKey: ["rrv-file-meta", String(a)],
|
|
131
|
-
queryFn: () =>
|
|
154
|
+
queryFn: () => m.request(
|
|
132
155
|
G(`/files/${a}/meta`)
|
|
133
|
-
).then((
|
|
156
|
+
).then((F) => F.data).catch(() => null),
|
|
134
157
|
enabled: a != null,
|
|
135
158
|
staleTime: 5 * 6e4,
|
|
136
159
|
retry: !1
|
|
137
160
|
});
|
|
138
|
-
if (a == null) return /* @__PURE__ */
|
|
139
|
-
if (!
|
|
140
|
-
return /* @__PURE__ */
|
|
141
|
-
const S = (
|
|
142
|
-
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(
|
|
143
166
|
"a",
|
|
144
167
|
{
|
|
145
|
-
href: `${
|
|
168
|
+
href: `${b}/files/${a}`,
|
|
146
169
|
target: "_blank",
|
|
147
170
|
rel: "noreferrer",
|
|
148
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",
|
|
@@ -150,25 +173,25 @@ function ul({ id: a }) {
|
|
|
150
173
|
}
|
|
151
174
|
);
|
|
152
175
|
}
|
|
153
|
-
const
|
|
154
|
-
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({
|
|
155
178
|
junction: a,
|
|
156
|
-
parentFk:
|
|
157
|
-
junctionField:
|
|
158
|
-
parentId:
|
|
159
|
-
onCount:
|
|
179
|
+
parentFk: m,
|
|
180
|
+
junctionField: b,
|
|
181
|
+
parentId: d,
|
|
182
|
+
onCount: O,
|
|
160
183
|
onTarget: S,
|
|
161
|
-
relation:
|
|
184
|
+
relation: F
|
|
162
185
|
}) {
|
|
163
186
|
var j;
|
|
164
|
-
const W =
|
|
187
|
+
const W = De(), { data: _ } = U({
|
|
165
188
|
queryKey: ["cbv-collection-meta", a],
|
|
166
189
|
queryFn: () => W.request(G(`/collections/${a}`)).then((v) => v.data),
|
|
167
190
|
staleTime: 10 * 6e4,
|
|
168
191
|
retry: !1
|
|
169
192
|
}), h = ((_ == null ? void 0 : _.relations) ?? []).find(
|
|
170
|
-
(v) => v.many_collection === a && v.many_field ===
|
|
171
|
-
),
|
|
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({
|
|
172
195
|
// Under the edit form's ['m2m-items', junction, parentFk, parentId] prefix (a longer key,
|
|
173
196
|
// so never the same cache entry): every link write that refreshes the form's list —
|
|
174
197
|
// a file upload, a picker change, the save itself — refreshes Summary's too. Its own
|
|
@@ -176,24 +199,24 @@ function ml({
|
|
|
176
199
|
queryKey: [
|
|
177
200
|
"m2m-items",
|
|
178
201
|
a,
|
|
179
|
-
|
|
180
|
-
|
|
202
|
+
m,
|
|
203
|
+
d,
|
|
181
204
|
"rrv",
|
|
182
|
-
|
|
183
|
-
|
|
205
|
+
b,
|
|
206
|
+
M ? I : ""
|
|
184
207
|
],
|
|
185
208
|
queryFn: () => W.request(
|
|
186
209
|
G(`/items/${a}`, {
|
|
187
|
-
filter: JSON.stringify({ [
|
|
188
|
-
fields:
|
|
210
|
+
filter: JSON.stringify({ [m]: { _eq: d } }),
|
|
211
|
+
fields: M ? `id,${b},${I}` : `id,${b}`,
|
|
189
212
|
limit: 200
|
|
190
213
|
})
|
|
191
214
|
).then(
|
|
192
|
-
(v) => (v.data ?? []).filter((w) => w[
|
|
193
|
-
const
|
|
215
|
+
(v) => (v.data ?? []).filter((w) => w[b] != null).map((w) => {
|
|
216
|
+
const q = w[b];
|
|
194
217
|
return {
|
|
195
|
-
id: String(typeof
|
|
196
|
-
collection:
|
|
218
|
+
id: String(typeof q == "object" ? q.id : q),
|
|
219
|
+
collection: M ? k(w[I]) : null
|
|
197
220
|
};
|
|
198
221
|
})
|
|
199
222
|
).catch(() => []),
|
|
@@ -201,64 +224,64 @@ function ml({
|
|
|
201
224
|
enabled: !!_,
|
|
202
225
|
staleTime: 3e4,
|
|
203
226
|
retry: !1
|
|
204
|
-
}),
|
|
205
|
-
return
|
|
206
|
-
|
|
207
|
-
}, [
|
|
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(() => {
|
|
208
231
|
N && (S == null || S(N));
|
|
209
|
-
}, [N, S]), _ && !N && (!
|
|
210
|
-
|
|
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,
|
|
211
234
|
{
|
|
212
|
-
relation:
|
|
213
|
-
parentId:
|
|
235
|
+
relation: F,
|
|
236
|
+
parentId: d,
|
|
214
237
|
allRelations: [],
|
|
215
238
|
disabled: !0
|
|
216
239
|
}
|
|
217
|
-
) }) : /* @__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(
|
|
218
241
|
"span",
|
|
219
242
|
{
|
|
220
243
|
className: "inline-flex items-center whitespace-nowrap",
|
|
221
244
|
children: [
|
|
222
|
-
/* @__PURE__ */
|
|
223
|
-
|
|
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: "," })
|
|
224
247
|
]
|
|
225
248
|
},
|
|
226
249
|
`${w ?? N}:${v}`
|
|
227
250
|
)) });
|
|
228
251
|
}
|
|
229
|
-
function
|
|
252
|
+
function bl({
|
|
230
253
|
collection: a,
|
|
231
|
-
fkField:
|
|
232
|
-
parentId:
|
|
233
|
-
layoutId:
|
|
234
|
-
presets:
|
|
254
|
+
fkField: m,
|
|
255
|
+
parentId: b,
|
|
256
|
+
layoutId: d,
|
|
257
|
+
presets: O,
|
|
235
258
|
defaultPreset: S,
|
|
236
|
-
onCount:
|
|
259
|
+
onCount: F
|
|
237
260
|
}) {
|
|
238
|
-
const W =
|
|
261
|
+
const W = De(), _ = gt(), h = (O ?? []).filter((t) => t && Array.isArray(t.columns)), [A, M] = te(
|
|
239
262
|
() => {
|
|
240
263
|
var t;
|
|
241
264
|
return h.length >= 2 ? ((t = h.find((i) => i.name === S)) == null ? void 0 : t.name) ?? h[0].name : "__all__";
|
|
242
265
|
}
|
|
243
|
-
), { data:
|
|
266
|
+
), { data: I } = U({
|
|
244
267
|
queryKey: ["cbv-collection-meta", a],
|
|
245
268
|
queryFn: () => W.request(G(`/collections/${a}`)).then((t) => t.data),
|
|
246
269
|
staleTime: 10 * 6e4,
|
|
247
270
|
retry: !1
|
|
248
271
|
}), k = (t) => {
|
|
249
272
|
var i;
|
|
250
|
-
return ((i = ((
|
|
251
|
-
(
|
|
273
|
+
return ((i = ((I == null ? void 0 : I.relations) ?? []).find(
|
|
274
|
+
(o) => o.many_collection === a && o.many_field === t && o.one_collection
|
|
252
275
|
)) == null ? void 0 : i.one_collection) ?? null;
|
|
253
|
-
}, { data: x } =
|
|
254
|
-
queryKey: ["rrv-cols", a,
|
|
276
|
+
}, { data: x } = U({
|
|
277
|
+
queryKey: ["rrv-cols", a, d ?? null],
|
|
255
278
|
queryFn: () => W.request(
|
|
256
|
-
G(`/field-config/${a}`,
|
|
279
|
+
G(`/field-config/${a}`, d ? { layout_id: d } : {})
|
|
257
280
|
).then((t) => ({
|
|
258
281
|
// Lines carry their own number — sort by it and show it first.
|
|
259
282
|
lineNo: (t.data ?? []).some((i) => i.field === "line_number"),
|
|
260
283
|
cols: (t.data ?? []).filter(
|
|
261
|
-
(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" || [
|
|
262
285
|
"string",
|
|
263
286
|
"text",
|
|
264
287
|
"integer",
|
|
@@ -270,112 +293,112 @@ function fl({
|
|
|
270
293
|
"timestamp",
|
|
271
294
|
"uuid"
|
|
272
295
|
].includes(i.type ?? ""))
|
|
273
|
-
).filter((i,
|
|
296
|
+
).filter((i, o, p) => p.findIndex((T) => T.field === i.field) === o)
|
|
274
297
|
})),
|
|
275
298
|
staleTime: 5 * 6e4,
|
|
276
299
|
retry: !1
|
|
277
|
-
}),
|
|
278
|
-
if (!N) return
|
|
279
|
-
const t = new Set(N.columns), i =
|
|
280
|
-
return i.length > 0 ? i :
|
|
281
|
-
}, [
|
|
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(() => {
|
|
282
305
|
const t = [
|
|
283
|
-
{ path: [
|
|
306
|
+
{ path: [m], op: "_eq", value: b }
|
|
284
307
|
];
|
|
285
|
-
for (const [i,
|
|
286
|
-
if (!(
|
|
287
|
-
const p =
|
|
288
|
-
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 });
|
|
289
312
|
}
|
|
290
313
|
return JSON.stringify(t);
|
|
291
|
-
}, [
|
|
292
|
-
data:
|
|
293
|
-
isLoading:
|
|
294
|
-
isFetching:
|
|
295
|
-
} =
|
|
296
|
-
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],
|
|
297
320
|
queryFn: () => W.request(
|
|
298
321
|
G(`/items/${a}`, {
|
|
299
322
|
limit: u,
|
|
300
323
|
page: w,
|
|
301
|
-
...j ? { sort: j } :
|
|
302
|
-
conditions:
|
|
324
|
+
...j ? { sort: j } : R ? { sort: "line_number" } : {},
|
|
325
|
+
conditions: Le
|
|
303
326
|
})
|
|
304
327
|
),
|
|
305
328
|
placeholderData: (t) => t,
|
|
306
329
|
staleTime: 3e4,
|
|
307
330
|
retry: !1
|
|
308
|
-
}),
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
}, [
|
|
312
|
-
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({
|
|
313
336
|
queryKey: [
|
|
314
337
|
"rrv-resolve-paths",
|
|
315
338
|
a,
|
|
316
|
-
|
|
317
|
-
|
|
339
|
+
fe.map((t) => t.field).join(","),
|
|
340
|
+
pe.join(",")
|
|
318
341
|
],
|
|
319
342
|
queryFn: () => W.request(
|
|
320
343
|
G(`/items/${a}/resolve-paths`, {
|
|
321
|
-
ids:
|
|
322
|
-
paths:
|
|
344
|
+
ids: pe.join(","),
|
|
345
|
+
paths: fe.map((t) => t.field).join(",")
|
|
323
346
|
})
|
|
324
347
|
).then((t) => t.data ?? { rows: {}, targets: {} }).catch(() => ({ rows: {}, targets: {} })),
|
|
325
|
-
enabled:
|
|
348
|
+
enabled: fe.length > 0 && pe.length > 0,
|
|
326
349
|
staleTime: 3e4
|
|
327
|
-
}),
|
|
328
|
-
|
|
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) => {
|
|
329
352
|
const T = { ...p };
|
|
330
|
-
return
|
|
353
|
+
return o ? T[t] = { op: i, value: o } : delete T[t], T;
|
|
331
354
|
});
|
|
332
|
-
},
|
|
333
|
-
|
|
355
|
+
}, Be = (t) => {
|
|
356
|
+
q(1), v((i) => i === t ? `-${t}` : i === `-${t}` ? "" : t);
|
|
334
357
|
};
|
|
335
|
-
if (
|
|
336
|
-
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(
|
|
337
360
|
"div",
|
|
338
361
|
{
|
|
339
362
|
className: "h-6 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]"
|
|
340
363
|
},
|
|
341
364
|
t
|
|
342
365
|
)) });
|
|
343
|
-
if (
|
|
344
|
-
return /* @__PURE__ */
|
|
345
|
-
const
|
|
346
|
-
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;
|
|
347
370
|
if (i.field.includes(".")) {
|
|
348
|
-
const
|
|
349
|
-
if (!
|
|
350
|
-
return /* @__PURE__ */
|
|
351
|
-
if (!
|
|
352
|
-
const
|
|
353
|
-
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(
|
|
354
377
|
"button",
|
|
355
378
|
{
|
|
356
379
|
type: "button",
|
|
357
|
-
onClick: (
|
|
358
|
-
|
|
380
|
+
onClick: (ae) => {
|
|
381
|
+
ae.stopPropagation(), _.open({ collection: Ke, itemId: String(he) });
|
|
359
382
|
},
|
|
360
383
|
className: "text-left underline decoration-slate-300 underline-offset-2 hover:text-[#007a99] dark:decoration-slate-600 dark:hover:text-nvr-cyan",
|
|
361
|
-
children:
|
|
384
|
+
children: ne.value
|
|
362
385
|
}
|
|
363
|
-
) :
|
|
386
|
+
) : ne.value;
|
|
364
387
|
}
|
|
365
|
-
const
|
|
366
|
-
if (i.type === "boolean" &&
|
|
367
|
-
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, {});
|
|
368
391
|
const p = k(i.field);
|
|
369
392
|
if (p === "nivaro_users")
|
|
370
|
-
return /* @__PURE__ */
|
|
371
|
-
if (p) return /* @__PURE__ */
|
|
372
|
-
if (i.type === "boolean") return /* @__PURE__ */
|
|
373
|
-
if (i.type === "decimal" || i.type === "float") return
|
|
374
|
-
if (i.type === "integer") return
|
|
375
|
-
if (i.type === "date" || i.type === "datetime" || i.type === "timestamp") return
|
|
376
|
-
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);
|
|
377
400
|
return T.length > 48 ? `${T.slice(0, 48)}…` : T;
|
|
378
|
-
},
|
|
401
|
+
}, oe = (t) => ["decimal", "float", "integer"].includes(t.type ?? "") && !k(t.field) && !t.field.includes("."), Pe = (t) => {
|
|
379
402
|
const i = t.options;
|
|
380
403
|
if (!i) return {};
|
|
381
404
|
if (typeof i == "string")
|
|
@@ -385,78 +408,78 @@ function fl({
|
|
|
385
408
|
return {};
|
|
386
409
|
}
|
|
387
410
|
return i;
|
|
388
|
-
},
|
|
389
|
-
const i =
|
|
411
|
+
}, Ne = (t) => {
|
|
412
|
+
const i = Pe(t).aggregate;
|
|
390
413
|
return typeof i == "string" && ["sum", "avg", "min", "max", "count"].includes(i) ? i : null;
|
|
391
|
-
},
|
|
392
|
-
const i =
|
|
414
|
+
}, Me = C.some((t) => Ne(t)), we = (t) => {
|
|
415
|
+
const i = Ne(t);
|
|
393
416
|
if (!i) return null;
|
|
394
|
-
const
|
|
417
|
+
const o = D.map((E) => Number(E[t.field])).filter((E) => !Number.isNaN(E));
|
|
395
418
|
let p = null;
|
|
396
|
-
if (i === "count" ? p =
|
|
397
|
-
const T =
|
|
398
|
-
return i === "count" || T === "int" ?
|
|
399
|
-
},
|
|
400
|
-
return /* @__PURE__ */
|
|
401
|
-
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: [
|
|
402
425
|
{ name: "__all__", label: "All" },
|
|
403
426
|
...h.map((t) => ({ name: t.name, label: t.name }))
|
|
404
|
-
].map((t) => /* @__PURE__ */
|
|
427
|
+
].map((t) => /* @__PURE__ */ l(
|
|
405
428
|
"button",
|
|
406
429
|
{
|
|
407
430
|
type: "button",
|
|
408
|
-
onClick: () =>
|
|
409
|
-
"aria-pressed":
|
|
410
|
-
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"}`,
|
|
411
434
|
children: t.label
|
|
412
435
|
},
|
|
413
436
|
t.name
|
|
414
437
|
)) }),
|
|
415
|
-
/* @__PURE__ */
|
|
438
|
+
/* @__PURE__ */ l(
|
|
416
439
|
"div",
|
|
417
440
|
{
|
|
418
|
-
className: `overflow-x-auto rounded-md border border-slate-200 dark:border-slate-700 ${
|
|
419
|
-
children: /* @__PURE__ */
|
|
420
|
-
/* @__PURE__ */
|
|
421
|
-
/* @__PURE__ */
|
|
422
|
-
|
|
423
|
-
|
|
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) => {
|
|
424
447
|
const i = j === t.field || j === `-${t.field}`;
|
|
425
|
-
return /* @__PURE__ */
|
|
448
|
+
return /* @__PURE__ */ f(
|
|
426
449
|
"th",
|
|
427
450
|
{
|
|
428
|
-
onClick: () =>
|
|
429
|
-
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" : ""}`,
|
|
430
453
|
children: [
|
|
431
|
-
t.label ||
|
|
432
|
-
|
|
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("-") ? "▼" : "▲" : "⇅" })
|
|
433
456
|
]
|
|
434
457
|
},
|
|
435
458
|
t.field
|
|
436
459
|
);
|
|
437
460
|
})
|
|
438
461
|
] }),
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
const i =
|
|
443
|
-
return /* @__PURE__ */
|
|
444
|
-
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(
|
|
445
468
|
"input",
|
|
446
469
|
{
|
|
447
|
-
value: (
|
|
448
|
-
onChange: (p) =>
|
|
470
|
+
value: (o == null ? void 0 : o.value) ?? "",
|
|
471
|
+
onChange: (p) => de(t.field, "_contains", p.target.value),
|
|
449
472
|
placeholder: "Filter…",
|
|
450
473
|
"aria-label": `Filter ${t.field}`,
|
|
451
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"
|
|
452
475
|
}
|
|
453
476
|
),
|
|
454
|
-
i === "num" && /* @__PURE__ */
|
|
455
|
-
/* @__PURE__ */
|
|
456
|
-
|
|
477
|
+
i === "num" && /* @__PURE__ */ f("span", { className: "flex items-center gap-0.5", children: [
|
|
478
|
+
/* @__PURE__ */ l(
|
|
479
|
+
pt,
|
|
457
480
|
{
|
|
458
|
-
value: (
|
|
459
|
-
onChange: (p) =>
|
|
481
|
+
value: (o == null ? void 0 : o.op) ?? "_eq",
|
|
482
|
+
onChange: (p) => de(t.field, p, (o == null ? void 0 : o.value) ?? ""),
|
|
460
483
|
options: [
|
|
461
484
|
{ value: "_eq", label: "=" },
|
|
462
485
|
{ value: "_gte", label: "≥" },
|
|
@@ -465,22 +488,22 @@ function fl({
|
|
|
465
488
|
ariaLabel: `Filter op ${t.field}`
|
|
466
489
|
}
|
|
467
490
|
),
|
|
468
|
-
/* @__PURE__ */
|
|
491
|
+
/* @__PURE__ */ l(
|
|
469
492
|
"input",
|
|
470
493
|
{
|
|
471
494
|
type: "number",
|
|
472
|
-
value: (
|
|
473
|
-
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),
|
|
474
497
|
"aria-label": `Filter ${t.field}`,
|
|
475
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"
|
|
476
499
|
}
|
|
477
500
|
)
|
|
478
501
|
] }),
|
|
479
|
-
i === "bool" && /* @__PURE__ */
|
|
480
|
-
|
|
502
|
+
i === "bool" && /* @__PURE__ */ l(
|
|
503
|
+
pt,
|
|
481
504
|
{
|
|
482
|
-
value: (
|
|
483
|
-
onChange: (p) =>
|
|
505
|
+
value: (o == null ? void 0 : o.value) ?? "",
|
|
506
|
+
onChange: (p) => de(t.field, "_eq", p),
|
|
484
507
|
options: [
|
|
485
508
|
{ value: "", label: "All" },
|
|
486
509
|
{ value: "true", label: "Yes" },
|
|
@@ -494,27 +517,27 @@ function fl({
|
|
|
494
517
|
})
|
|
495
518
|
] })
|
|
496
519
|
] }),
|
|
497
|
-
/* @__PURE__ */
|
|
498
|
-
|
|
520
|
+
/* @__PURE__ */ f("tbody", { children: [
|
|
521
|
+
D.length === 0 && /* @__PURE__ */ l("tr", { children: /* @__PURE__ */ l(
|
|
499
522
|
"td",
|
|
500
523
|
{
|
|
501
|
-
colSpan:
|
|
524
|
+
colSpan: C.length + (L ? 1 : 0),
|
|
502
525
|
className: "py-4 text-center text-[12px] text-slate-400",
|
|
503
526
|
children: "No matches — adjust filters"
|
|
504
527
|
}
|
|
505
528
|
) }),
|
|
506
|
-
|
|
529
|
+
D.map((t) => /* @__PURE__ */ f(
|
|
507
530
|
"tr",
|
|
508
531
|
{
|
|
509
532
|
onClick: _ ? () => _.open({ collection: a, itemId: String(t.id) }) : void 0,
|
|
510
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" : ""}`,
|
|
511
534
|
children: [
|
|
512
|
-
|
|
513
|
-
|
|
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(
|
|
514
537
|
"td",
|
|
515
538
|
{
|
|
516
|
-
className: `whitespace-nowrap px-2.5 py-1.5 text-[12px] text-slate-700 dark:text-slate-200 ${
|
|
517
|
-
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)
|
|
518
541
|
},
|
|
519
542
|
i.field
|
|
520
543
|
))
|
|
@@ -523,22 +546,22 @@ function fl({
|
|
|
523
546
|
String(t.id)
|
|
524
547
|
))
|
|
525
548
|
] }),
|
|
526
|
-
|
|
549
|
+
Me && D.length > 0 && /* @__PURE__ */ l("tfoot", { children: /* @__PURE__ */ f(
|
|
527
550
|
"tr",
|
|
528
551
|
{
|
|
529
552
|
"data-read-grid-footer": !0,
|
|
530
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",
|
|
531
554
|
children: [
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
const i =
|
|
535
|
-
return /* @__PURE__ */
|
|
555
|
+
L && /* @__PURE__ */ l("td", {}),
|
|
556
|
+
C.map((t) => {
|
|
557
|
+
const i = Ne(t);
|
|
558
|
+
return /* @__PURE__ */ l(
|
|
536
559
|
"td",
|
|
537
560
|
{
|
|
538
|
-
className: `whitespace-nowrap px-2.5 py-1.5 ${
|
|
539
|
-
children: i && /* @__PURE__ */
|
|
540
|
-
/* @__PURE__ */
|
|
541
|
-
/* @__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) })
|
|
542
565
|
] })
|
|
543
566
|
},
|
|
544
567
|
t.field
|
|
@@ -550,37 +573,37 @@ function fl({
|
|
|
550
573
|
] })
|
|
551
574
|
}
|
|
552
575
|
),
|
|
553
|
-
|
|
554
|
-
/* @__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: [
|
|
555
578
|
((w - 1) * u + 1).toLocaleString("en-US"),
|
|
556
579
|
"–",
|
|
557
|
-
Math.min(w * u,
|
|
580
|
+
Math.min(w * u, Z).toLocaleString("en-US"),
|
|
558
581
|
" of",
|
|
559
582
|
" ",
|
|
560
|
-
|
|
583
|
+
Z.toLocaleString("en-US")
|
|
561
584
|
] }),
|
|
562
|
-
/* @__PURE__ */
|
|
563
|
-
/* @__PURE__ */
|
|
585
|
+
/* @__PURE__ */ f("span", { className: "flex items-center gap-0.5", children: [
|
|
586
|
+
/* @__PURE__ */ l(
|
|
564
587
|
"button",
|
|
565
588
|
{
|
|
566
589
|
type: "button",
|
|
567
590
|
disabled: w <= 1,
|
|
568
|
-
onClick: () =>
|
|
591
|
+
onClick: () => q((t) => Math.max(1, t - 1)),
|
|
569
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",
|
|
570
593
|
children: "← Prev"
|
|
571
594
|
}
|
|
572
595
|
),
|
|
573
|
-
/* @__PURE__ */
|
|
596
|
+
/* @__PURE__ */ f("span", { className: "min-w-[48px] text-center text-[11px] tabular-nums text-slate-500", children: [
|
|
574
597
|
w,
|
|
575
598
|
" / ",
|
|
576
|
-
|
|
599
|
+
ke.toLocaleString("en-US")
|
|
577
600
|
] }),
|
|
578
|
-
/* @__PURE__ */
|
|
601
|
+
/* @__PURE__ */ l(
|
|
579
602
|
"button",
|
|
580
603
|
{
|
|
581
604
|
type: "button",
|
|
582
|
-
disabled: w >=
|
|
583
|
-
onClick: () =>
|
|
605
|
+
disabled: w >= ke,
|
|
606
|
+
onClick: () => q((t) => t + 1),
|
|
584
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",
|
|
585
608
|
children: "Next →"
|
|
586
609
|
}
|
|
@@ -589,488 +612,510 @@ function fl({
|
|
|
589
612
|
] })
|
|
590
613
|
] });
|
|
591
614
|
}
|
|
592
|
-
function
|
|
615
|
+
function ht({
|
|
593
616
|
collection: a,
|
|
594
|
-
itemId:
|
|
595
|
-
layoutData:
|
|
596
|
-
design:
|
|
597
|
-
flush:
|
|
617
|
+
itemId: m,
|
|
618
|
+
layoutData: b,
|
|
619
|
+
design: d,
|
|
620
|
+
flush: O,
|
|
598
621
|
renderSlot: S,
|
|
599
|
-
integrityMarks:
|
|
622
|
+
integrityMarks: F,
|
|
600
623
|
renderGrid: W,
|
|
601
624
|
onEditSection: _,
|
|
602
625
|
gridCounts: h
|
|
603
626
|
}) {
|
|
604
|
-
var
|
|
605
|
-
const
|
|
606
|
-
() =>
|
|
607
|
-
...
|
|
608
|
-
layout:
|
|
609
|
-
} :
|
|
610
|
-
[
|
|
611
|
-
),
|
|
612
|
-
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",
|
|
613
636
|
field: e.field,
|
|
614
637
|
group_key: e.group_key ?? null
|
|
615
|
-
}), 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(
|
|
616
639
|
() => [
|
|
617
640
|
...new Set(
|
|
618
|
-
(
|
|
641
|
+
(d ? [] : (y == null ? void 0 : y.assignments) ?? []).map((e) => e.field).filter((e) => e && !e.startsWith("__") && !e.includes("."))
|
|
619
642
|
)
|
|
620
643
|
].sort(),
|
|
621
|
-
[
|
|
622
|
-
), { data: j } =
|
|
623
|
-
const
|
|
624
|
-
if (!
|
|
625
|
-
const s =
|
|
626
|
-
return
|
|
627
|
-
|
|
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,
|
|
628
651
|
{
|
|
629
|
-
activityId:
|
|
630
|
-
callerName:
|
|
652
|
+
activityId: r.activity_id,
|
|
653
|
+
callerName: r.caller.name,
|
|
631
654
|
collection: a,
|
|
632
655
|
itemId: x,
|
|
633
|
-
children: /* @__PURE__ */
|
|
656
|
+
children: /* @__PURE__ */ f(
|
|
634
657
|
"button",
|
|
635
658
|
{
|
|
636
659
|
type: "button",
|
|
637
660
|
"data-field-touch": e,
|
|
638
|
-
"data-field-touch-caller":
|
|
639
|
-
"data-tip": `Changed ${
|
|
640
|
-
"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`,
|
|
641
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",
|
|
642
665
|
children: [
|
|
643
|
-
/* @__PURE__ */
|
|
644
|
-
|
|
666
|
+
/* @__PURE__ */ l("span", { className: "h-1.5 w-1.5 rounded-full bg-amber-400", "aria-hidden": !0 }),
|
|
667
|
+
r.caller.name,
|
|
645
668
|
" · ",
|
|
646
|
-
|
|
669
|
+
Ce(r.at)
|
|
647
670
|
]
|
|
648
671
|
}
|
|
649
672
|
)
|
|
650
673
|
}
|
|
651
|
-
) : /* @__PURE__ */
|
|
674
|
+
) : /* @__PURE__ */ l(
|
|
652
675
|
"span",
|
|
653
676
|
{
|
|
654
677
|
"data-field-touch": e,
|
|
655
|
-
"data-tip": `Changed ${
|
|
678
|
+
"data-tip": `Changed ${Ce(r.at)} by ${r.who}${s ? ` · ${r.via}` : ""}`,
|
|
656
679
|
role: "img",
|
|
657
|
-
"aria-label": `Changed ${
|
|
680
|
+
"aria-label": `Changed ${Ce(r.at)} by ${r.who}`,
|
|
658
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"}`
|
|
659
682
|
}
|
|
660
683
|
);
|
|
661
|
-
}, { data: w } =
|
|
662
|
-
() =>
|
|
663
|
-
[
|
|
664
|
-
),
|
|
665
|
-
const
|
|
666
|
-
if (!
|
|
667
|
-
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(`
|
|
668
691
|
`);
|
|
669
|
-
return /* @__PURE__ */
|
|
692
|
+
return /* @__PURE__ */ l(
|
|
670
693
|
"span",
|
|
671
694
|
{
|
|
672
695
|
"data-integrity-mark": e,
|
|
673
696
|
"data-tip": s,
|
|
674
697
|
role: "img",
|
|
675
|
-
"aria-label": `${
|
|
698
|
+
"aria-label": `${r.length} data integrity issue${r.length === 1 ? "" : "s"}: ${s}`,
|
|
676
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",
|
|
677
|
-
children:
|
|
700
|
+
children: r.length > 1 ? r.length : "!"
|
|
678
701
|
}
|
|
679
702
|
);
|
|
680
|
-
}, { data:
|
|
703
|
+
}, { data: H } = U({
|
|
681
704
|
queryKey: ["cbv-collection-meta", a],
|
|
682
|
-
queryFn: () =>
|
|
705
|
+
queryFn: () => A.request(
|
|
683
706
|
G(`/collections/${a}`)
|
|
684
707
|
).then((e) => e.data),
|
|
685
708
|
staleTime: 10 * 6e4,
|
|
686
709
|
retry: !1
|
|
687
|
-
}),
|
|
710
|
+
}), X = Dt(), { data: Le } = U({
|
|
688
711
|
queryKey: ["rrv-record", a, x],
|
|
689
|
-
enabled: !
|
|
690
|
-
queryFn: () =>
|
|
691
|
-
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,
|
|
692
715
|
initialDataUpdatedAt: () => {
|
|
693
716
|
var e;
|
|
694
|
-
return (e =
|
|
717
|
+
return (e = X.getQueryState(["item", a, x])) == null ? void 0 : e.dataUpdatedAt;
|
|
695
718
|
},
|
|
696
719
|
staleTime: 3e4,
|
|
697
720
|
retry: !1
|
|
698
|
-
}), u =
|
|
699
|
-
|
|
700
|
-
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] }));
|
|
701
724
|
});
|
|
702
|
-
const
|
|
703
|
-
|
|
704
|
-
const e =
|
|
705
|
-
if (
|
|
706
|
-
const
|
|
707
|
-
(
|
|
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])
|
|
708
731
|
);
|
|
709
|
-
if (
|
|
710
|
-
|
|
711
|
-
const s = setTimeout(() =>
|
|
732
|
+
if (r.length === 0) return;
|
|
733
|
+
Ee(new Set(r));
|
|
734
|
+
const s = setTimeout(() => Ee(/* @__PURE__ */ new Set()), 2400);
|
|
712
735
|
return () => clearTimeout(s);
|
|
713
|
-
}, [u,
|
|
714
|
-
const
|
|
715
|
-
queryKey: ["rrv-field-config", a,
|
|
716
|
-
enabled: !
|
|
717
|
-
queryFn: () =>
|
|
718
|
-
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 })
|
|
719
742
|
).then((e) => e.data ?? []).catch(() => null),
|
|
720
743
|
staleTime: 5 * 6e4,
|
|
721
744
|
retry: !1
|
|
722
|
-
}),
|
|
723
|
-
() => new Map((
|
|
724
|
-
[
|
|
725
|
-
),
|
|
726
|
-
var
|
|
727
|
-
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(
|
|
728
751
|
(s) => s.many_collection === a && s.many_field === e && s.one_collection
|
|
729
|
-
)) == null ? void 0 :
|
|
730
|
-
},
|
|
731
|
-
(
|
|
732
|
-
) ?? null,
|
|
733
|
-
var
|
|
734
|
-
return !((e.is_visible === void 0 || e.is_visible) &&
|
|
735
|
-
},
|
|
736
|
-
(e) => (!e.field.startsWith("__") ||
|
|
737
|
-
),
|
|
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(
|
|
738
761
|
(e) => e.field.startsWith("__widget_") && e.widget_id != null && (k || e.is_visible === void 0 || !!e.is_visible)
|
|
739
|
-
),
|
|
762
|
+
), Be = (e) => {
|
|
740
763
|
if (!e.input_bindings) return [];
|
|
741
764
|
try {
|
|
742
765
|
return JSON.parse(String(e.input_bindings));
|
|
743
766
|
} catch {
|
|
744
767
|
return [];
|
|
745
768
|
}
|
|
746
|
-
},
|
|
747
|
-
(e) => e.field.startsWith("__") && !e.field.startsWith("__widget_") && !
|
|
748
|
-
).sort((e,
|
|
749
|
-
(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
|
|
750
773
|
).sort(
|
|
751
|
-
(s,
|
|
752
|
-
).map((s) => ({ key: s.field, a: s, node:
|
|
753
|
-
const s =
|
|
754
|
-
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(
|
|
755
778
|
"div",
|
|
756
779
|
{
|
|
757
|
-
className:
|
|
758
|
-
"data-read-live-slots":
|
|
759
|
-
children: s.map((
|
|
760
|
-
{ kind: "slot", field:
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
) },
|
|
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))
|
|
764
787
|
}
|
|
765
788
|
);
|
|
766
|
-
}, [
|
|
767
|
-
(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 }),
|
|
768
791
|
[]
|
|
769
|
-
), [p, T] =
|
|
770
|
-
(e) => (
|
|
792
|
+
), [p, T] = te({}), E = ut(
|
|
793
|
+
(e) => (r) => T((s) => s[e] === r ? s : { ...s, [e]: r }),
|
|
771
794
|
[]
|
|
772
|
-
),
|
|
773
|
-
const
|
|
774
|
-
if (
|
|
775
|
-
const s =
|
|
776
|
-
return /* @__PURE__ */
|
|
777
|
-
{ kind: "slot", field:
|
|
778
|
-
/* @__PURE__ */
|
|
779
|
-
|
|
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,
|
|
780
803
|
{
|
|
781
|
-
widgetId:
|
|
782
|
-
inputBindings:
|
|
804
|
+
widgetId: c.widget_id,
|
|
805
|
+
inputBindings: Be(c),
|
|
783
806
|
itemDraft: u ?? {},
|
|
784
807
|
itemCollection: a,
|
|
785
808
|
ready: !!u,
|
|
786
|
-
label:
|
|
787
|
-
defaultExpanded:
|
|
788
|
-
onContentChange: (g) =>
|
|
789
|
-
(
|
|
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 }
|
|
790
813
|
)
|
|
791
814
|
}
|
|
792
815
|
),
|
|
793
|
-
|
|
794
|
-
) },
|
|
795
|
-
},
|
|
796
|
-
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);
|
|
797
820
|
return s.has(e) ? s.delete(e) : s.add(e), s;
|
|
798
|
-
}),
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
}, [
|
|
802
|
-
const e =
|
|
803
|
-
e &&
|
|
804
|
-
}, [
|
|
805
|
-
const
|
|
806
|
-
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) {
|
|
807
830
|
if (e.type === "container") {
|
|
808
|
-
for (const
|
|
809
|
-
|
|
831
|
+
for (const r of ne.filter((s) => s.container_id != null && s.container_id === e.id))
|
|
832
|
+
Ge.push(r);
|
|
810
833
|
continue;
|
|
811
834
|
}
|
|
812
|
-
e.container_id == null &&
|
|
835
|
+
e.container_id == null && Ge.push(e);
|
|
813
836
|
}
|
|
814
|
-
const
|
|
815
|
-
var
|
|
816
|
-
return !!((
|
|
817
|
-
},
|
|
837
|
+
const B = (e) => {
|
|
838
|
+
var r;
|
|
839
|
+
return !!((r = Y(e.field)) != null && r.junction_field);
|
|
840
|
+
}, et = (e) => {
|
|
818
841
|
var s;
|
|
819
|
-
const
|
|
820
|
-
|
|
842
|
+
const r = String(
|
|
843
|
+
xe(e.overrides).interface ?? ((s = Q.get(e.field)) == null ? void 0 : s.interface) ?? ""
|
|
821
844
|
);
|
|
822
|
-
return /rich|wysiwyg|editorjs/i.test(
|
|
823
|
-
},
|
|
824
|
-
const
|
|
825
|
-
if (
|
|
826
|
-
const
|
|
827
|
-
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 }) });
|
|
828
851
|
}
|
|
829
|
-
const
|
|
830
|
-
if (
|
|
831
|
-
if (
|
|
832
|
-
return /* @__PURE__ */
|
|
833
|
-
|
|
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,
|
|
834
857
|
{
|
|
835
|
-
junction:
|
|
836
|
-
parentFk:
|
|
837
|
-
junctionField:
|
|
858
|
+
junction: c.many_collection,
|
|
859
|
+
parentFk: c.many_field,
|
|
860
|
+
junctionField: c.junction_field,
|
|
838
861
|
parentId: x,
|
|
839
|
-
onCount:
|
|
840
|
-
onTarget:
|
|
841
|
-
relation:
|
|
862
|
+
onCount: o(e.field),
|
|
863
|
+
onTarget: E(e.field),
|
|
864
|
+
relation: c
|
|
842
865
|
}
|
|
843
866
|
);
|
|
844
|
-
const g = u == null ? void 0 : u[e.field],
|
|
845
|
-
if (
|
|
846
|
-
return /* @__PURE__ */
|
|
847
|
-
if (
|
|
848
|
-
if ((
|
|
849
|
-
if (g == null || g === "") return /* @__PURE__ */
|
|
850
|
-
if ((
|
|
851
|
-
return /* @__PURE__ */
|
|
852
|
-
|
|
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,
|
|
853
876
|
{
|
|
854
877
|
value: g,
|
|
855
878
|
trueTone: (s.options ?? {}).trueTone ?? "positive"
|
|
856
879
|
}
|
|
857
880
|
);
|
|
858
|
-
const
|
|
859
|
-
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(
|
|
860
883
|
"div",
|
|
861
884
|
{
|
|
862
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",
|
|
863
|
-
dangerouslySetInnerHTML: { __html:
|
|
886
|
+
dangerouslySetInnerHTML: { __html: zt(g) }
|
|
864
887
|
}
|
|
865
|
-
) :
|
|
866
|
-
},
|
|
867
|
-
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);
|
|
868
891
|
if (!(s != null && s.many_collection) || !s.many_field) return null;
|
|
869
|
-
if (
|
|
870
|
-
const
|
|
871
|
-
var
|
|
872
|
-
const
|
|
873
|
-
if (!
|
|
874
|
-
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")
|
|
875
898
|
try {
|
|
876
|
-
return JSON.parse(
|
|
899
|
+
return JSON.parse(ee);
|
|
877
900
|
} catch {
|
|
878
901
|
return {};
|
|
879
902
|
}
|
|
880
|
-
return
|
|
881
|
-
})(),
|
|
882
|
-
return /* @__PURE__ */
|
|
883
|
-
|
|
903
|
+
return ee;
|
|
904
|
+
})(), K = c.layout_id ?? null;
|
|
905
|
+
return /* @__PURE__ */ l(
|
|
906
|
+
bl,
|
|
884
907
|
{
|
|
885
908
|
collection: s.many_collection,
|
|
886
909
|
fkField: s.many_field,
|
|
887
910
|
parentId: x,
|
|
888
|
-
layoutId:
|
|
889
|
-
presets:
|
|
890
|
-
defaultPreset:
|
|
891
|
-
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)
|
|
892
915
|
},
|
|
893
916
|
e.field
|
|
894
917
|
);
|
|
895
|
-
},
|
|
896
|
-
if (!u ||
|
|
897
|
-
const
|
|
898
|
-
return
|
|
899
|
-
},
|
|
900
|
-
var
|
|
901
|
-
const
|
|
902
|
-
return s !== void 0 ? s :
|
|
903
|
-
},
|
|
904
|
-
const
|
|
905
|
-
if (
|
|
906
|
-
const
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
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(
|
|
910
938
|
"div",
|
|
911
939
|
{
|
|
912
|
-
hidden:
|
|
913
|
-
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" : ""}`,
|
|
914
942
|
children: N(
|
|
915
|
-
|
|
916
|
-
/* @__PURE__ */
|
|
917
|
-
/* @__PURE__ */
|
|
918
|
-
|
|
919
|
-
/* @__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 }),
|
|
920
949
|
v(n.field)
|
|
921
950
|
] }),
|
|
922
|
-
/* @__PURE__ */
|
|
951
|
+
/* @__PURE__ */ l(
|
|
923
952
|
"dd",
|
|
924
953
|
{
|
|
925
954
|
"data-replay-field": n.field,
|
|
926
955
|
"data-field-collection": a,
|
|
927
|
-
"data-remote-changed":
|
|
928
|
-
className: `mt-1 min-w-0${
|
|
929
|
-
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))]" })
|
|
930
959
|
}
|
|
931
960
|
)
|
|
932
961
|
] }),
|
|
933
|
-
|
|
962
|
+
L(n)
|
|
934
963
|
)
|
|
935
964
|
},
|
|
936
965
|
n.field
|
|
937
966
|
);
|
|
938
|
-
},
|
|
939
|
-
const
|
|
940
|
-
return /* @__PURE__ */
|
|
967
|
+
}, Ct = (n, $) => {
|
|
968
|
+
const Oe = u && !d ? $.filter((J) => !ye(u[J.field])) : $;
|
|
969
|
+
return /* @__PURE__ */ f(
|
|
941
970
|
"div",
|
|
942
971
|
{
|
|
943
972
|
"data-read-row": n.key,
|
|
944
|
-
className: `min-w-0 ${
|
|
973
|
+
className: `min-w-0 ${$.length > 2 ? "col-span-full" : "col-span-2"}`,
|
|
945
974
|
children: [
|
|
946
|
-
/* @__PURE__ */
|
|
947
|
-
/* @__PURE__ */
|
|
948
|
-
|
|
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: "·" }),
|
|
949
978
|
N(
|
|
950
|
-
|
|
951
|
-
/* @__PURE__ */
|
|
979
|
+
R(J),
|
|
980
|
+
/* @__PURE__ */ l(
|
|
952
981
|
"span",
|
|
953
982
|
{
|
|
954
|
-
"data-replay-field":
|
|
983
|
+
"data-replay-field": J.field,
|
|
955
984
|
"data-field-collection": a,
|
|
956
|
-
className: `min-w-0 break-words${
|
|
957
|
-
children:
|
|
985
|
+
className: `min-w-0 break-words${D(J.field)}`,
|
|
986
|
+
children: Ae(J)
|
|
958
987
|
}
|
|
959
988
|
),
|
|
960
|
-
|
|
989
|
+
L(J)
|
|
961
990
|
)
|
|
962
|
-
] },
|
|
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))]" }) })
|
|
963
992
|
]
|
|
964
993
|
},
|
|
965
994
|
`row:${n.key}`
|
|
966
995
|
);
|
|
967
996
|
};
|
|
968
|
-
return /* @__PURE__ */
|
|
997
|
+
return /* @__PURE__ */ l(
|
|
969
998
|
"section",
|
|
970
999
|
{
|
|
971
|
-
hidden:
|
|
1000
|
+
hidden: At,
|
|
972
1001
|
"data-read-section": e.key,
|
|
973
|
-
"data-read-width":
|
|
1002
|
+
"data-read-width": it,
|
|
974
1003
|
className: "min-w-0 rounded-xl border border-slate-200 bg-white dark:border-slate-700/60 dark:bg-slate-900/40",
|
|
975
1004
|
children: N(
|
|
976
1005
|
{ kind: "group", key: e.key },
|
|
977
|
-
/* @__PURE__ */
|
|
978
|
-
/* @__PURE__ */
|
|
1006
|
+
/* @__PURE__ */ f(me, { children: [
|
|
1007
|
+
/* @__PURE__ */ f(
|
|
979
1008
|
"h3",
|
|
980
1009
|
{
|
|
981
|
-
|
|
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" : ""}`,
|
|
982
1012
|
children: [
|
|
983
|
-
e.is_collapsed ? /* @__PURE__ */
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
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(
|
|
994
1039
|
"button",
|
|
995
1040
|
{
|
|
996
1041
|
type: "button",
|
|
997
1042
|
"data-read-edit-section": e.key,
|
|
998
1043
|
onClick: () => {
|
|
999
|
-
var n,
|
|
1000
|
-
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);
|
|
1001
1046
|
},
|
|
1002
1047
|
title: `Edit ${e.label}`,
|
|
1003
1048
|
"aria-label": `Edit ${e.label}`,
|
|
1004
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",
|
|
1005
|
-
children: /* @__PURE__ */
|
|
1050
|
+
children: /* @__PURE__ */ l(Lt, { className: "h-3 w-3" })
|
|
1006
1051
|
}
|
|
1007
1052
|
),
|
|
1008
|
-
e.is_collapsed && /* @__PURE__ */
|
|
1009
|
-
|
|
1053
|
+
e.is_collapsed && /* @__PURE__ */ l(
|
|
1054
|
+
Et,
|
|
1010
1055
|
{
|
|
1011
1056
|
"aria-hidden": "true",
|
|
1012
|
-
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"}`
|
|
1013
1058
|
}
|
|
1014
1059
|
)
|
|
1015
1060
|
]
|
|
1016
1061
|
}
|
|
1017
1062
|
),
|
|
1018
|
-
/* @__PURE__ */
|
|
1019
|
-
|
|
1063
|
+
/* @__PURE__ */ f("div", { "data-read-body": "", className: "px-5 pb-5 pt-4", hidden: !ae(e), children: [
|
|
1064
|
+
Qe && /* @__PURE__ */ l(
|
|
1020
1065
|
"p",
|
|
1021
1066
|
{
|
|
1022
1067
|
"data-read-empty": e.key,
|
|
1023
1068
|
className: "text-[13px] text-slate-500 dark:text-slate-400",
|
|
1024
|
-
children:
|
|
1069
|
+
children: r.emptyText
|
|
1025
1070
|
}
|
|
1026
1071
|
),
|
|
1027
|
-
|
|
1072
|
+
P.length > 0 && // One column rhythm for the whole page: every section's facts sit
|
|
1028
1073
|
// on the same 2 / 3 / 4 / 6 tracks, so values line up card to
|
|
1029
1074
|
// card instead of each card auto-filling its own grid. Hidden, not
|
|
1030
1075
|
// unrendered, under the empty text: its link facts must keep reporting.
|
|
1031
|
-
/* @__PURE__ */
|
|
1076
|
+
/* @__PURE__ */ l(
|
|
1032
1077
|
"dl",
|
|
1033
1078
|
{
|
|
1034
1079
|
className: "grid gap-x-6 gap-y-5",
|
|
1035
|
-
"data-read-dl":
|
|
1036
|
-
style:
|
|
1080
|
+
"data-read-dl": it,
|
|
1081
|
+
style: Qe ? { display: "none" } : void 0,
|
|
1037
1082
|
children: Tt.map(
|
|
1038
|
-
(n) => n.kind === "row" ?
|
|
1083
|
+
(n) => n.kind === "row" ? Ct(n.row, n.members) : Rt(n.field)
|
|
1039
1084
|
)
|
|
1040
1085
|
}
|
|
1041
1086
|
),
|
|
1042
|
-
|
|
1043
|
-
var
|
|
1044
|
-
return /* @__PURE__ */
|
|
1087
|
+
ce.map((n) => {
|
|
1088
|
+
var $;
|
|
1089
|
+
return /* @__PURE__ */ l(
|
|
1045
1090
|
"div",
|
|
1046
1091
|
{
|
|
1047
|
-
className:
|
|
1048
|
-
hidden:
|
|
1092
|
+
className: P.length > 0 ? "mt-3" : "",
|
|
1093
|
+
hidden: He(n) || Qe,
|
|
1049
1094
|
children: N(
|
|
1050
|
-
|
|
1051
|
-
/* @__PURE__ */
|
|
1052
|
-
(
|
|
1053
|
-
/* @__PURE__ */
|
|
1054
|
-
/* @__PURE__ */
|
|
1055
|
-
/* @__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: [
|
|
1056
1101
|
"— ",
|
|
1057
|
-
|
|
1102
|
+
q.get(n.field).length,
|
|
1058
1103
|
" line issue",
|
|
1059
|
-
|
|
1104
|
+
q.get(n.field).length === 1 ? "" : "s",
|
|
1060
1105
|
"; switch to Edit to fix"
|
|
1061
1106
|
] })
|
|
1062
1107
|
] }) : null,
|
|
1063
|
-
(W ? W(n) : null) ??
|
|
1108
|
+
(W ? W(n) : null) ?? vt(n)
|
|
1064
1109
|
] }),
|
|
1065
|
-
|
|
1110
|
+
L(n)
|
|
1066
1111
|
)
|
|
1067
1112
|
},
|
|
1068
1113
|
n.field
|
|
1069
1114
|
);
|
|
1070
1115
|
}),
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1116
|
+
re(e.key),
|
|
1117
|
+
we(e.key),
|
|
1118
|
+
K && d && /* @__PURE__ */ l(
|
|
1074
1119
|
"div",
|
|
1075
1120
|
{
|
|
1076
1121
|
"data-design-drop": e.key,
|
|
@@ -1085,76 +1130,79 @@ function mt({
|
|
|
1085
1130
|
},
|
|
1086
1131
|
e.key
|
|
1087
1132
|
);
|
|
1088
|
-
},
|
|
1089
|
-
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(
|
|
1090
1135
|
"div",
|
|
1091
1136
|
{
|
|
1092
|
-
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",
|
|
1093
1138
|
children: [
|
|
1094
|
-
|
|
1095
|
-
|
|
1139
|
+
$t,
|
|
1140
|
+
rt.length > 0 && /* @__PURE__ */ f(
|
|
1096
1141
|
"div",
|
|
1097
1142
|
{
|
|
1098
1143
|
"data-read-header": !0,
|
|
1099
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",
|
|
1100
1145
|
children: [
|
|
1101
|
-
|
|
1102
|
-
{ kind: "header", field:
|
|
1103
|
-
/* @__PURE__ */
|
|
1104
|
-
/* @__PURE__ */
|
|
1105
|
-
|
|
1106
|
-
/* @__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 })
|
|
1107
1152
|
] }),
|
|
1108
|
-
/* @__PURE__ */
|
|
1153
|
+
/* @__PURE__ */ l(
|
|
1109
1154
|
"p",
|
|
1110
1155
|
{
|
|
1111
|
-
"data-replay-field":
|
|
1156
|
+
"data-replay-field": ie.field,
|
|
1112
1157
|
"data-field-collection": a,
|
|
1113
|
-
className: `truncate text-[22px] font-semibold leading-tight tracking-[-0.015em] text-slate-900 dark:text-white${
|
|
1114
|
-
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) : "…"
|
|
1115
1160
|
}
|
|
1116
1161
|
)
|
|
1117
1162
|
] }),
|
|
1118
|
-
|
|
1163
|
+
L(ie)
|
|
1119
1164
|
),
|
|
1120
|
-
|
|
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(
|
|
1121
1166
|
{ kind: "header", field: e.field },
|
|
1122
|
-
/* @__PURE__ */
|
|
1123
|
-
/* @__PURE__ */
|
|
1124
|
-
|
|
1125
|
-
/* @__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 }),
|
|
1126
1172
|
v(e.field)
|
|
1127
1173
|
] }),
|
|
1128
|
-
/* @__PURE__ */
|
|
1174
|
+
/* @__PURE__ */ l(
|
|
1129
1175
|
"dd",
|
|
1130
1176
|
{
|
|
1131
1177
|
"data-replay-field": e.field,
|
|
1132
1178
|
"data-field-collection": a,
|
|
1133
|
-
"data-remote-changed":
|
|
1134
|
-
className: `mt-0.5 truncate text-[13px] font-medium text-slate-800 dark:text-slate-100${
|
|
1135
|
-
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) : "…"
|
|
1136
1182
|
}
|
|
1137
1183
|
)
|
|
1138
1184
|
] }),
|
|
1139
|
-
|
|
1185
|
+
L(e)
|
|
1140
1186
|
) }, e.field)) })
|
|
1141
1187
|
]
|
|
1142
1188
|
}
|
|
1143
1189
|
),
|
|
1144
|
-
/* @__PURE__ */
|
|
1145
|
-
|
|
1146
|
-
/* @__PURE__ */
|
|
1147
|
-
/* @__PURE__ */
|
|
1148
|
-
/* @__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))]" })
|
|
1149
1195
|
] }),
|
|
1150
|
-
|
|
1196
|
+
lt && /* @__PURE__ */ l("div", { className: "mt-4", children: lt })
|
|
1151
1197
|
]
|
|
1152
1198
|
}
|
|
1153
1199
|
);
|
|
1154
1200
|
}
|
|
1155
|
-
function
|
|
1156
|
-
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 });
|
|
1157
1203
|
}
|
|
1158
1204
|
export {
|
|
1159
|
-
|
|
1205
|
+
ml as COLLAPSED_SUMMARY_MAX,
|
|
1206
|
+
Ql as RecordReadView,
|
|
1207
|
+
ul as collapsedSummaryEntries
|
|
1160
1208
|
};
|