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