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