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