@nivaro/react 0.3.15 → 0.3.17
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 +127 -6
- package/dist/index.js +736 -734
- package/dist/shared/components/CollectionBrowserView.js +2344 -2309
- package/dist/shared/components/ItemEditForm.js +3773 -3604
- package/dist/shared/components/RecordGridEditor.js +319 -282
- package/dist/shared/components/RecordReadView.js +202 -200
- package/dist/shared/components/cbv/unknown-fields.js +18 -8
- package/dist/shared/components/chat/ChatAnalyticsView.js +2 -2
- package/dist/shared/components/import/DocumentAutofillButton.js +148 -142
- package/dist/shared/components/item-edit/CatalogPickerField.js +264 -276
- package/dist/shared/components/item-edit/FieldRenderer.js +136 -133
- package/dist/shared/components/item-edit/FieldRow.js +198 -184
- package/dist/shared/components/item-edit/HeaderTools.js +107 -99
- package/dist/shared/components/item-edit/InlineTableField.js +138 -136
- package/dist/shared/components/item-edit/RecordLiveSync.js +1 -0
- package/dist/shared/components/item-edit/RelationCombobox.js +30 -23
- package/dist/shared/components/item-edit/SummaryPanel.js +334 -294
- package/dist/shared/components/item-edit/column-length.js +12 -0
- package/dist/shared/components/panels/AccessDeniedPanel.js +47 -37
- package/dist/shared/components/panels/ItemLockBanner.js +307 -285
- package/dist/shared/components/panels/PipelinePanel.js +486 -465
- package/dist/shared/components/panels/RevisionsPanel.js +210 -204
- package/dist/shared/components/pipeline/PipelineEditorView.js +1672 -1568
- package/dist/shared/components/profile/DelegationCard.js +178 -121
- package/dist/shared/components/profile/PersonActivity.js +152 -139
- package/dist/shared/components/queue/QueueWorklist.js +668 -659
- package/dist/shared/components/queue/transition-note.js +90 -0
- package/dist/shared/components/support/SupportRequestDialog.js +100 -89
- package/dist/shared/components/support/TicketDetailSheet.js +104 -91
- package/dist/shared/lib/autofill-runs.js +33 -26
- package/dist/shared/lib/draft-store.js +40 -24
- package/dist/shared/lib/live-queries.js +10 -9
- package/dist/shared/lib/request-gate.js +140 -127
- package/dist/shared/lib/restore-skipped.js +10 -0
- package/package.json +1 -1
|
@@ -1,293 +1,333 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as n, jsxs as p } from "react/jsx-runtime";
|
|
2
2
|
import { useQuery as D } from "@tanstack/react-query";
|
|
3
|
-
import { Check as
|
|
4
|
-
import { useState as
|
|
5
|
-
import { useNivaroClient as
|
|
6
|
-
import { get as
|
|
3
|
+
import { Check as de, Copy as me, ChevronRight as ue, Loader2 as fe } from "lucide-react";
|
|
4
|
+
import { useState as Q, useRef as pe, createContext as ye, useContext as he } from "react";
|
|
5
|
+
import { useNivaroClient as U } from "../../context.js";
|
|
6
|
+
import { get as K } from "../../lib/commands.js";
|
|
7
7
|
import { useRecordReader as be } from "../../lib/record-loader.js";
|
|
8
|
-
import { cn as
|
|
9
|
-
import { useChangePulse as
|
|
10
|
-
import { SYSTEM_FIELDS as
|
|
11
|
-
import { RelatedItemLabel as
|
|
12
|
-
const
|
|
13
|
-
function
|
|
8
|
+
import { cn as M, titleCase as z, toLocalDateString as xe } from "../../lib/utils.js";
|
|
9
|
+
import { useChangePulse as ge } from "./GroupSection.js";
|
|
10
|
+
import { SYSTEM_FIELDS as _e, SENTINEL_FIELDS as ke, applyDisplayTemplate as te, parseJson as Ne, richTextToPlain as Se } from "./helpers.js";
|
|
11
|
+
import { RelatedItemLabel as ne } from "./RelationCombobox.js";
|
|
12
|
+
const le = ye({});
|
|
13
|
+
function we(e, t) {
|
|
14
14
|
return t ? Object.entries(t).every(
|
|
15
|
-
([
|
|
15
|
+
([a, r]) => r !== null && typeof r == "object" || String(e[a] ?? "") === String(r ?? "")
|
|
16
16
|
) : !0;
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function qe({
|
|
19
19
|
relation: e,
|
|
20
20
|
parentId: t,
|
|
21
|
-
allRelations:
|
|
21
|
+
allRelations: a,
|
|
22
22
|
staging: r,
|
|
23
|
-
maxValues:
|
|
23
|
+
maxValues: g
|
|
24
24
|
}) {
|
|
25
|
-
var
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
(
|
|
25
|
+
var b, w, J;
|
|
26
|
+
const y = U(), d = e.many_field ?? "", u = e.junction_field ?? (() => {
|
|
27
|
+
const l = a.find(
|
|
28
|
+
($) => $.many_collection === e.many_collection && $.id !== e.id
|
|
29
29
|
);
|
|
30
|
-
return (
|
|
31
|
-
})(),
|
|
32
|
-
(
|
|
33
|
-
)) == null ? void 0 :
|
|
30
|
+
return (l == null ? void 0 : l.many_field) ?? "";
|
|
31
|
+
})(), h = e.one_field ?? `${e.many_collection}.${u}`, _ = ((b = a.find(
|
|
32
|
+
(l) => l.many_collection === e.many_collection && l.many_field === u && l.id !== e.id
|
|
33
|
+
)) == null ? void 0 : b.one_collection) ?? null, { data: i } = D({
|
|
34
34
|
queryKey: ["summary-junction-relations", e.many_collection],
|
|
35
|
-
queryFn: () =>
|
|
36
|
-
|
|
37
|
-
).then((
|
|
38
|
-
enabled: !
|
|
35
|
+
queryFn: () => y.request(
|
|
36
|
+
K(`/data-model/relations/for/${e.many_collection}`)
|
|
37
|
+
).then((l) => l.data ?? []).catch(() => []),
|
|
38
|
+
enabled: !_ && !!e.many_collection && !!u,
|
|
39
39
|
staleTime: 10 * 6e4
|
|
40
|
-
}),
|
|
41
|
-
(
|
|
42
|
-
)) == null ? void 0 :
|
|
40
|
+
}), o = _ ?? ((w = i == null ? void 0 : i.find(
|
|
41
|
+
(l) => l.many_collection === e.many_collection && l.many_field === u && !!l.one_collection
|
|
42
|
+
)) == null ? void 0 : w.one_collection) ?? null, { data: c = [] } = D({
|
|
43
43
|
queryKey: ["m2m-items", e.many_collection, d, t],
|
|
44
|
-
queryFn: () =>
|
|
45
|
-
|
|
44
|
+
queryFn: () => y.request(
|
|
45
|
+
K(`/items/${e.many_collection}`, {
|
|
46
46
|
filter: JSON.stringify({ [d]: { _eq: t } }),
|
|
47
47
|
limit: 200,
|
|
48
48
|
fields: `id,${u}`
|
|
49
49
|
})
|
|
50
|
-
).then((
|
|
50
|
+
).then((l) => l.data ?? []),
|
|
51
51
|
staleTime: 3e4,
|
|
52
52
|
enabled: !!t && t !== "new"
|
|
53
|
-
}),
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
}), x = o ? null : ((J = [...a, ...i ?? []].find(
|
|
54
|
+
(l) => l.many_collection === e.many_collection && l.many_field === u && !!l.one_collection_field
|
|
55
|
+
)) == null ? void 0 : J.one_collection_field) ?? null, { data: k = [] } = D({
|
|
56
|
+
queryKey: ["summary-m2a-items", e.many_collection, d, t, x],
|
|
57
|
+
queryFn: () => y.request(
|
|
58
|
+
K(`/items/${e.many_collection}`, {
|
|
59
|
+
filter: JSON.stringify({ [d]: { _eq: t } }),
|
|
60
|
+
limit: 200,
|
|
61
|
+
fields: `id,${u},${x}`
|
|
62
|
+
})
|
|
63
|
+
).then((l) => l.data ?? []),
|
|
64
|
+
staleTime: 3e4,
|
|
65
|
+
enabled: !!x && !!t && t !== "new"
|
|
66
|
+
}), E = o === "nivaro_files" || o === "directus_files", { data: N } = D({
|
|
67
|
+
queryKey: ["col-meta", o],
|
|
68
|
+
queryFn: () => y.request(K(`/collections/${o}`)).then((l) => l.data),
|
|
69
|
+
enabled: !!o && !E,
|
|
57
70
|
staleTime: 3e5
|
|
58
|
-
}),
|
|
59
|
-
...
|
|
60
|
-
...
|
|
71
|
+
}), C = (r == null ? void 0 : r.getStagedLinks(h)) ?? [], L = (r == null ? void 0 : r.getStagedUnlinks(h)) ?? /* @__PURE__ */ new Set(), R = c.filter((l) => !L.has(l.id)), S = [
|
|
72
|
+
...C,
|
|
73
|
+
...R.map((l) => l[u]).filter((l) => l != null)
|
|
61
74
|
];
|
|
62
|
-
if (
|
|
63
|
-
return /* @__PURE__ */
|
|
64
|
-
if (
|
|
65
|
-
const
|
|
66
|
-
return /* @__PURE__ */
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
/* @__PURE__ */
|
|
70
|
-
|
|
75
|
+
if (S.length === 0)
|
|
76
|
+
return /* @__PURE__ */ n("span", { className: "text-slate-400 dark:text-slate-500", children: "—" });
|
|
77
|
+
if (o) {
|
|
78
|
+
const $ = S.slice(0, 5), j = S.length - 5;
|
|
79
|
+
return /* @__PURE__ */ p("span", { className: "text-[12px] text-slate-700 dark:text-slate-200", children: [
|
|
80
|
+
$.map((s, T) => /* @__PURE__ */ p("span", { children: [
|
|
81
|
+
T > 0 && ", ",
|
|
82
|
+
/* @__PURE__ */ n(
|
|
83
|
+
ne,
|
|
71
84
|
{
|
|
72
|
-
collection:
|
|
73
|
-
id:
|
|
74
|
-
displayTemplate:
|
|
85
|
+
collection: o,
|
|
86
|
+
id: s,
|
|
87
|
+
displayTemplate: N == null ? void 0 : N.display_template
|
|
75
88
|
}
|
|
76
89
|
)
|
|
77
|
-
] }, String(
|
|
78
|
-
|
|
90
|
+
] }, String(s))),
|
|
91
|
+
j > 0 && /* @__PURE__ */ p("span", { className: "text-slate-400 dark:text-slate-500", children: [
|
|
79
92
|
" +",
|
|
80
|
-
|
|
93
|
+
j,
|
|
81
94
|
" more"
|
|
82
95
|
] })
|
|
83
96
|
] });
|
|
84
97
|
}
|
|
85
|
-
|
|
86
|
-
|
|
98
|
+
const m = x ? k.filter((l) => !L.has(l.id) && l[u] != null && l[x]).slice(0, 5) : [];
|
|
99
|
+
if (m.length > 0 && C.length === 0) {
|
|
100
|
+
const l = S.length - m.length;
|
|
101
|
+
return /* @__PURE__ */ p("span", { className: "text-[12px] text-slate-700 dark:text-slate-200", children: [
|
|
102
|
+
m.map(($, j) => /* @__PURE__ */ p("span", { children: [
|
|
103
|
+
j > 0 && ", ",
|
|
104
|
+
/* @__PURE__ */ n(
|
|
105
|
+
re,
|
|
106
|
+
{
|
|
107
|
+
collection: ve(String($[x])),
|
|
108
|
+
id: $[u]
|
|
109
|
+
}
|
|
110
|
+
)
|
|
111
|
+
] }, String($.id))),
|
|
112
|
+
l > 0 && /* @__PURE__ */ p("span", { className: "text-slate-400 dark:text-slate-500", children: [
|
|
113
|
+
" +",
|
|
114
|
+
l,
|
|
115
|
+
" more"
|
|
116
|
+
] })
|
|
117
|
+
] });
|
|
118
|
+
}
|
|
119
|
+
return /* @__PURE__ */ p("span", { className: "text-slate-700 dark:text-slate-200", children: [
|
|
120
|
+
S.length,
|
|
87
121
|
" item",
|
|
88
|
-
|
|
122
|
+
S.length !== 1 ? "s" : ""
|
|
89
123
|
] });
|
|
90
124
|
}
|
|
125
|
+
function ve(e) {
|
|
126
|
+
return e === "directus_users" ? "nivaro_users" : e;
|
|
127
|
+
}
|
|
91
128
|
function ae(e) {
|
|
92
|
-
const t =
|
|
129
|
+
const t = U();
|
|
93
130
|
return D({
|
|
94
131
|
queryKey: ["summary-display-template", e],
|
|
95
|
-
queryFn: () => t.request(
|
|
132
|
+
queryFn: () => t.request(K(`/collections/${e}`)).then((a) => {
|
|
96
133
|
var r;
|
|
97
|
-
return ((r =
|
|
134
|
+
return ((r = a.data) == null ? void 0 : r.display_template) ?? null;
|
|
98
135
|
}).catch(() => null),
|
|
99
136
|
enabled: !!e,
|
|
100
137
|
staleTime: 10 * 6e4
|
|
101
138
|
}).data;
|
|
102
139
|
}
|
|
103
|
-
function
|
|
104
|
-
const
|
|
105
|
-
return /* @__PURE__ */
|
|
140
|
+
function re({ collection: e, id: t }) {
|
|
141
|
+
const a = ae(e);
|
|
142
|
+
return /* @__PURE__ */ n(ne, { collection: e, id: t, displayTemplate: a ?? void 0 });
|
|
106
143
|
}
|
|
107
|
-
const
|
|
108
|
-
function
|
|
144
|
+
const $e = ["name", "title", "label", "subject", "description", "line_number"], Te = ["amount", "total", "cost", "price", "quantity"], V = 4, G = 200;
|
|
145
|
+
function Ce(e, t) {
|
|
109
146
|
if (t) {
|
|
110
|
-
const
|
|
111
|
-
if (
|
|
147
|
+
const a = te(t, e).replace(/\s*[·|\-–—/]\s*(?=[·|\-–—/]|$)/g, "").replace(/^\s*[·|\-–—/]\s*/, "").trim();
|
|
148
|
+
if (a !== "") return a;
|
|
112
149
|
}
|
|
113
|
-
for (const
|
|
114
|
-
const r = e[
|
|
150
|
+
for (const a of $e) {
|
|
151
|
+
const r = e[a];
|
|
115
152
|
if (r != null && String(r).trim() !== "") return String(r).trim();
|
|
116
153
|
}
|
|
117
154
|
return `#${String(e.id ?? "")}`;
|
|
118
155
|
}
|
|
119
|
-
function
|
|
156
|
+
function se({
|
|
120
157
|
relatedCollection: e,
|
|
121
158
|
manyField: t,
|
|
122
|
-
parentId:
|
|
159
|
+
parentId: a,
|
|
123
160
|
rowFilter: r,
|
|
124
|
-
expanded:
|
|
161
|
+
expanded: g
|
|
125
162
|
}) {
|
|
126
|
-
var
|
|
127
|
-
const
|
|
163
|
+
var R, S;
|
|
164
|
+
const y = U(), d = he(le), u = r && Object.keys(r).length > 0 ? {
|
|
128
165
|
_and: [
|
|
129
|
-
{ [t]: { _eq:
|
|
166
|
+
{ [t]: { _eq: a } },
|
|
130
167
|
Object.fromEntries(
|
|
131
|
-
Object.entries(r).map(([
|
|
132
|
-
|
|
133
|
-
|
|
168
|
+
Object.entries(r).map(([m, b]) => [
|
|
169
|
+
m,
|
|
170
|
+
b !== null && typeof b == "object" ? b : { _eq: b }
|
|
134
171
|
])
|
|
135
172
|
)
|
|
136
173
|
]
|
|
137
|
-
} : { [t]: { _eq:
|
|
174
|
+
} : { [t]: { _eq: a } }, { data: h, isLoading: _ } = D({
|
|
138
175
|
queryKey: [
|
|
139
176
|
"o2m-rows",
|
|
140
177
|
e,
|
|
141
178
|
t,
|
|
142
|
-
|
|
179
|
+
a,
|
|
143
180
|
r ? JSON.stringify(r) : ""
|
|
144
181
|
],
|
|
145
|
-
queryFn: () =>
|
|
146
|
-
|
|
182
|
+
queryFn: () => y.request(
|
|
183
|
+
K(`/items/${e}`, {
|
|
147
184
|
filter: JSON.stringify(u),
|
|
148
|
-
limit:
|
|
185
|
+
limit: G
|
|
149
186
|
})
|
|
150
|
-
).then((
|
|
151
|
-
enabled: !!
|
|
187
|
+
).then((m) => m.data ?? []),
|
|
188
|
+
enabled: !!a && a !== "new",
|
|
152
189
|
staleTime: 3e4
|
|
153
|
-
}),
|
|
154
|
-
(
|
|
155
|
-
),
|
|
156
|
-
...(
|
|
157
|
-
...
|
|
190
|
+
}), i = ae(e), o = `${e}.${t}`, c = (R = d.deletes) == null ? void 0 : R.get(o), x = (((S = d.rows) == null ? void 0 : S.get(o)) ?? []).filter(
|
|
191
|
+
(m) => we(m, r)
|
|
192
|
+
), k = [
|
|
193
|
+
...(h ?? []).filter((m) => !(c != null && c.has(String(m.id)))),
|
|
194
|
+
...x
|
|
158
195
|
];
|
|
159
|
-
if (
|
|
160
|
-
return /* @__PURE__ */
|
|
161
|
-
if (
|
|
162
|
-
return /* @__PURE__ */
|
|
163
|
-
const
|
|
164
|
-
(
|
|
165
|
-
(
|
|
196
|
+
if (_ && x.length === 0)
|
|
197
|
+
return /* @__PURE__ */ n(fe, { className: "h-3 w-3 animate-spin text-slate-400 dark:text-slate-500" });
|
|
198
|
+
if (k.length === 0)
|
|
199
|
+
return /* @__PURE__ */ n("span", { className: "italic text-[11px] text-slate-400 dark:text-slate-500", children: "None yet" });
|
|
200
|
+
const E = ((h == null ? void 0 : h.length) ?? 0) >= G, N = Te.find(
|
|
201
|
+
(m) => k.some(
|
|
202
|
+
(b) => typeof b[m] == "number" || typeof b[m] == "string" && b[m] !== "" && !Number.isNaN(Number(b[m]))
|
|
166
203
|
)
|
|
167
|
-
),
|
|
168
|
-
const
|
|
169
|
-
return
|
|
170
|
-
}, 0) : null,
|
|
171
|
-
return /* @__PURE__ */
|
|
172
|
-
/* @__PURE__ */
|
|
173
|
-
/* @__PURE__ */
|
|
174
|
-
|
|
204
|
+
), C = N && !E ? k.reduce((m, b) => {
|
|
205
|
+
const w = Number(b[N]);
|
|
206
|
+
return m + (Number.isFinite(w) ? w : 0);
|
|
207
|
+
}, 0) : null, L = N ? N !== "quantity" : !1;
|
|
208
|
+
return /* @__PURE__ */ p("span", { className: "block", children: [
|
|
209
|
+
/* @__PURE__ */ p("span", { className: "flex items-baseline gap-2", children: [
|
|
210
|
+
/* @__PURE__ */ p("span", { className: "text-slate-700 dark:text-slate-200", children: [
|
|
211
|
+
E ? `${G}+` : k.length,
|
|
175
212
|
" row",
|
|
176
|
-
|
|
213
|
+
k.length !== 1 ? "s" : ""
|
|
177
214
|
] }),
|
|
178
|
-
|
|
215
|
+
C !== null && /* @__PURE__ */ n("span", { className: "tabular-nums text-[11px] text-slate-500 dark:text-slate-400", children: L ? C.toLocaleString(void 0, {
|
|
179
216
|
style: "currency",
|
|
180
217
|
currency: "USD",
|
|
181
|
-
maximumFractionDigits:
|
|
182
|
-
}) :
|
|
218
|
+
maximumFractionDigits: C % 1 === 0 ? 0 : 2
|
|
219
|
+
}) : C.toLocaleString() })
|
|
183
220
|
] }),
|
|
184
|
-
/* @__PURE__ */
|
|
185
|
-
(
|
|
221
|
+
/* @__PURE__ */ p("span", { className: "mt-1 block space-y-0.5", children: [
|
|
222
|
+
(g ? k : k.slice(0, V)).map((m, b) => /* @__PURE__ */ p(
|
|
186
223
|
"span",
|
|
187
224
|
{
|
|
188
225
|
className: "flex items-baseline justify-between gap-2 text-[11px] text-slate-500 dark:text-slate-400",
|
|
189
226
|
children: [
|
|
190
|
-
/* @__PURE__ */
|
|
191
|
-
|
|
192
|
-
const
|
|
193
|
-
return Number.isFinite(
|
|
227
|
+
/* @__PURE__ */ n("span", { className: "truncate", children: Ce(m, i ?? null) }),
|
|
228
|
+
N && m[N] !== null && m[N] !== void 0 && /* @__PURE__ */ n("span", { className: "shrink-0 tabular-nums", children: (() => {
|
|
229
|
+
const w = Number(m[N]);
|
|
230
|
+
return Number.isFinite(w) ? L ? w.toLocaleString(void 0, {
|
|
194
231
|
style: "currency",
|
|
195
232
|
currency: "USD",
|
|
196
|
-
maximumFractionDigits:
|
|
197
|
-
}) :
|
|
233
|
+
maximumFractionDigits: w % 1 === 0 ? 0 : 2
|
|
234
|
+
}) : w.toLocaleString() : String(m[N]);
|
|
198
235
|
})() })
|
|
199
236
|
]
|
|
200
237
|
},
|
|
201
|
-
String(
|
|
238
|
+
String(m.id ?? b)
|
|
202
239
|
)),
|
|
203
|
-
!
|
|
240
|
+
!g && k.length > V && /* @__PURE__ */ p("span", { className: "block text-[11px] italic text-slate-400 dark:text-slate-500", children: [
|
|
204
241
|
"+",
|
|
205
|
-
|
|
242
|
+
E ? `${k.length - V}+` : k.length - V,
|
|
206
243
|
" more"
|
|
207
244
|
] })
|
|
208
245
|
] })
|
|
209
246
|
] });
|
|
210
247
|
}
|
|
211
248
|
function je(e) {
|
|
212
|
-
const t =
|
|
213
|
-
return /* @__PURE__ */
|
|
249
|
+
const t = ge(e.val);
|
|
250
|
+
return /* @__PURE__ */ n("span", { className: M("inline-block max-w-full rounded-sm", t && "nvr-value-pulse-bg"), children: /* @__PURE__ */ n(Le, { ...e }) });
|
|
214
251
|
}
|
|
215
|
-
function
|
|
252
|
+
function Le({
|
|
216
253
|
field: e,
|
|
217
254
|
val: t,
|
|
218
|
-
relations:
|
|
255
|
+
relations: a,
|
|
219
256
|
collection: r,
|
|
220
|
-
itemId:
|
|
221
|
-
staging:
|
|
257
|
+
itemId: g,
|
|
258
|
+
staging: y
|
|
222
259
|
}) {
|
|
223
260
|
const d = e.interface ?? "", u = /* @__PURE__ */ new Set(["select-multiple-m2m", "files-m2m", "files", "relation-grouped"]);
|
|
224
|
-
if (!u.has(d) &&
|
|
225
|
-
const
|
|
226
|
-
(
|
|
261
|
+
if (!u.has(d) && g) {
|
|
262
|
+
const i = a.find(
|
|
263
|
+
(o) => !o.junction_field && (o.one_field === e.field || o.many_collection === e.field) && (o.one_collection === r || o.one_collection == null)
|
|
227
264
|
);
|
|
228
|
-
if (
|
|
229
|
-
const
|
|
265
|
+
if (i != null && i.many_collection && i.many_field) {
|
|
266
|
+
const o = (() => {
|
|
230
267
|
try {
|
|
231
268
|
return typeof e.options == "string" ? JSON.parse(e.options) : e.options ?? {};
|
|
232
269
|
} catch {
|
|
233
270
|
return {};
|
|
234
271
|
}
|
|
235
272
|
})();
|
|
236
|
-
return /* @__PURE__ */
|
|
237
|
-
|
|
273
|
+
return /* @__PURE__ */ n(
|
|
274
|
+
se,
|
|
238
275
|
{
|
|
239
|
-
relatedCollection:
|
|
240
|
-
manyField:
|
|
241
|
-
parentId:
|
|
242
|
-
rowFilter:
|
|
276
|
+
relatedCollection: i.many_collection,
|
|
277
|
+
manyField: i.many_field,
|
|
278
|
+
parentId: g,
|
|
279
|
+
rowFilter: o.row_filter && typeof o.row_filter == "object" ? o.row_filter : void 0
|
|
243
280
|
}
|
|
244
281
|
);
|
|
245
282
|
}
|
|
246
283
|
}
|
|
247
|
-
if (u.has(d) &&
|
|
248
|
-
const
|
|
249
|
-
(
|
|
250
|
-
),
|
|
251
|
-
const
|
|
252
|
-
(
|
|
284
|
+
if (u.has(d) && g) {
|
|
285
|
+
const i = a.find(
|
|
286
|
+
(c) => c.one_collection === r && (c.one_field === e.field || c.junction_field != null && c.many_collection === e.field)
|
|
287
|
+
), o = i ? i.junction_field ? i : (() => {
|
|
288
|
+
const c = a.find(
|
|
289
|
+
(x) => x.many_collection === i.many_collection && x.id !== i.id
|
|
253
290
|
);
|
|
254
|
-
return
|
|
291
|
+
return c ? { ...i, junction_field: c.many_field } : null;
|
|
255
292
|
})() : null;
|
|
256
|
-
if (
|
|
257
|
-
const
|
|
258
|
-
return /* @__PURE__ */
|
|
259
|
-
|
|
293
|
+
if (o) {
|
|
294
|
+
const c = Ne(e.options);
|
|
295
|
+
return /* @__PURE__ */ n(
|
|
296
|
+
qe,
|
|
260
297
|
{
|
|
261
|
-
relation:
|
|
262
|
-
parentId:
|
|
263
|
-
allRelations:
|
|
264
|
-
staging:
|
|
265
|
-
maxValues:
|
|
298
|
+
relation: o,
|
|
299
|
+
parentId: g,
|
|
300
|
+
allRelations: a,
|
|
301
|
+
staging: y,
|
|
302
|
+
maxValues: c == null ? void 0 : c.max_values
|
|
266
303
|
}
|
|
267
304
|
);
|
|
268
305
|
}
|
|
269
306
|
}
|
|
270
|
-
|
|
307
|
+
const h = t == null || t === "";
|
|
308
|
+
if (h && e.type === "boolean")
|
|
309
|
+
return /* @__PURE__ */ n("span", { className: "text-slate-700 dark:text-slate-200", children: "No" });
|
|
310
|
+
if (h) return /* @__PURE__ */ n("span", { className: "text-slate-400 dark:text-slate-500", children: "—" });
|
|
271
311
|
if (d === "extension-editorjs" || d === "input-rich-text-html" || d === "rich_text" || d === "wysiwyg" || typeof t == "string") {
|
|
272
|
-
const
|
|
273
|
-
if (
|
|
274
|
-
return /* @__PURE__ */
|
|
312
|
+
const i = Se(t);
|
|
313
|
+
if (i !== null)
|
|
314
|
+
return /* @__PURE__ */ n("span", { className: "truncate text-slate-700 dark:text-slate-200", title: i, children: i || "—" });
|
|
275
315
|
}
|
|
276
316
|
if (typeof t == "boolean")
|
|
277
|
-
return /* @__PURE__ */
|
|
278
|
-
const
|
|
279
|
-
(
|
|
317
|
+
return /* @__PURE__ */ n("span", { className: "text-slate-700 dark:text-slate-200", children: t ? "Yes" : "No" });
|
|
318
|
+
const _ = a.find(
|
|
319
|
+
(i) => i.many_collection === r && i.many_field === e.field && !i.junction_field
|
|
280
320
|
);
|
|
281
|
-
if (
|
|
282
|
-
return /* @__PURE__ */
|
|
321
|
+
if (_ != null && _.one_collection)
|
|
322
|
+
return /* @__PURE__ */ n(re, { collection: _.one_collection, id: t });
|
|
283
323
|
if (e.type === "datetime" || e.type === "date")
|
|
284
324
|
try {
|
|
285
|
-
return /* @__PURE__ */
|
|
325
|
+
return /* @__PURE__ */ n("span", { className: "text-slate-700 dark:text-slate-200", children: xe(t) });
|
|
286
326
|
} catch {
|
|
287
327
|
}
|
|
288
|
-
return /* @__PURE__ */
|
|
328
|
+
return /* @__PURE__ */ n("span", { className: "truncate text-slate-700 dark:text-slate-200", children: String(t) });
|
|
289
329
|
}
|
|
290
|
-
function
|
|
330
|
+
function Oe(e) {
|
|
291
331
|
if (e == null || e === "") return "—";
|
|
292
332
|
if (typeof e == "boolean") return e ? "Yes" : "No";
|
|
293
333
|
const t = String(e);
|
|
@@ -298,166 +338,166 @@ function Le(e) {
|
|
|
298
338
|
}
|
|
299
339
|
return t;
|
|
300
340
|
}
|
|
301
|
-
const
|
|
341
|
+
const Z = (e) => {
|
|
302
342
|
if (e == null || e === "") return "empty";
|
|
303
343
|
if (typeof e == "boolean") return e ? "Yes" : "No";
|
|
304
344
|
if (typeof e == "object") {
|
|
305
|
-
const
|
|
306
|
-
return
|
|
345
|
+
const a = e.id;
|
|
346
|
+
return a != null ? `#${String(a)}` : Array.isArray(e) ? `${e.length} items` : "a value";
|
|
307
347
|
}
|
|
308
348
|
const t = String(e).replace(/<[^>]+>/g, "").trim();
|
|
309
349
|
return t.length > 48 ? `${t.slice(0, 48)}…` : t;
|
|
310
350
|
};
|
|
311
|
-
function
|
|
312
|
-
const
|
|
351
|
+
function ee(e, t) {
|
|
352
|
+
const a = U(), r = be(), g = !!e && t != null && t !== "", { data: y } = D({
|
|
313
353
|
queryKey: ["cbv-collection-meta", e],
|
|
314
|
-
queryFn: () =>
|
|
315
|
-
enabled:
|
|
354
|
+
queryFn: () => a.request(K(`/collections/${e}`)).then((h) => h.data),
|
|
355
|
+
enabled: g,
|
|
316
356
|
staleTime: 10 * 6e4,
|
|
317
357
|
retry: !1
|
|
318
358
|
}), { data: d } = D({
|
|
319
359
|
queryKey: ["rrv-related", e, String(t)],
|
|
320
360
|
queryFn: () => r(e, t).catch(() => null),
|
|
321
|
-
enabled:
|
|
361
|
+
enabled: g && !!y,
|
|
322
362
|
staleTime: 6e4,
|
|
323
363
|
retry: !1
|
|
324
364
|
});
|
|
325
|
-
if (!
|
|
365
|
+
if (!g) return null;
|
|
326
366
|
if (!d) return `#${String(t)}`;
|
|
327
|
-
const u =
|
|
367
|
+
const u = te(y == null ? void 0 : y.display_template, d).trim();
|
|
328
368
|
if (u) return u;
|
|
329
|
-
for (const
|
|
369
|
+
for (const h of ["name", "title", "label", "number", "email"]) if (d[h]) return String(d[h]);
|
|
330
370
|
return `#${String(t)}`;
|
|
331
371
|
}
|
|
332
|
-
function
|
|
372
|
+
function Me({
|
|
333
373
|
field: e,
|
|
334
374
|
from: t,
|
|
335
|
-
to:
|
|
375
|
+
to: a,
|
|
336
376
|
detail: r,
|
|
337
|
-
relations:
|
|
338
|
-
collection:
|
|
377
|
+
relations: g,
|
|
378
|
+
collection: y,
|
|
339
379
|
onRevert: d
|
|
340
380
|
}) {
|
|
341
|
-
var
|
|
342
|
-
const u = ((
|
|
343
|
-
(
|
|
344
|
-
)) == null ? void 0 :
|
|
381
|
+
var o;
|
|
382
|
+
const u = ((o = g.find(
|
|
383
|
+
(c) => c.many_collection === y && c.many_field === e.field && !!c.one_collection
|
|
384
|
+
)) == null ? void 0 : o.one_collection) ?? null, h = ee(u, t), _ = ee(u, a), i = r ? `Unsaved — ${r}` : `Unsaved — was ${h ?? Z(t)} → now ${_ ?? Z(a)}`;
|
|
345
385
|
return d ? (
|
|
346
386
|
// biome-ignore lint/a11y/useSemanticElements: nested inside the row's <button> — a real <button> is invalid there
|
|
347
|
-
/* @__PURE__ */
|
|
387
|
+
/* @__PURE__ */ n(
|
|
348
388
|
"span",
|
|
349
389
|
{
|
|
350
390
|
role: "button",
|
|
351
391
|
tabIndex: 0,
|
|
352
392
|
"data-summary-changed": !0,
|
|
353
|
-
"data-tip": `${
|
|
393
|
+
"data-tip": `${i} · click to revert`,
|
|
354
394
|
"aria-label": "Revert this change",
|
|
355
|
-
onClick: (
|
|
356
|
-
|
|
395
|
+
onClick: (c) => {
|
|
396
|
+
c.stopPropagation(), d();
|
|
357
397
|
},
|
|
358
|
-
onKeyDown: (
|
|
359
|
-
(
|
|
398
|
+
onKeyDown: (c) => {
|
|
399
|
+
(c.key === "Enter" || c.key === " ") && (c.preventDefault(), c.stopPropagation(), d());
|
|
360
400
|
},
|
|
361
401
|
className: "group/dot inline-flex h-4 w-4 shrink-0 cursor-pointer items-center justify-center rounded-full hover:bg-amber-100 dark:hover:bg-amber-500/20",
|
|
362
|
-
children: /* @__PURE__ */
|
|
402
|
+
children: /* @__PURE__ */ n("span", { className: "h-1.5 w-1.5 rounded-full bg-amber-400 ring-2 ring-amber-100 group-hover/dot:ring-amber-200 dark:ring-amber-500/30" })
|
|
363
403
|
}
|
|
364
404
|
)
|
|
365
|
-
) : /* @__PURE__ */
|
|
405
|
+
) : /* @__PURE__ */ n(
|
|
366
406
|
"span",
|
|
367
407
|
{
|
|
368
408
|
"data-summary-changed": !0,
|
|
369
|
-
"data-tip":
|
|
409
|
+
"data-tip": i,
|
|
370
410
|
className: "h-1.5 w-1.5 shrink-0 rounded-full bg-amber-400 ring-2 ring-amber-100 dark:ring-amber-500/30"
|
|
371
411
|
}
|
|
372
412
|
);
|
|
373
413
|
}
|
|
374
|
-
function
|
|
414
|
+
function We({
|
|
375
415
|
allSteps: e,
|
|
376
416
|
groupedMap: t,
|
|
377
|
-
ungroupedFields:
|
|
417
|
+
ungroupedFields: a,
|
|
378
418
|
sectionGroups: r,
|
|
379
|
-
draft:
|
|
380
|
-
relations:
|
|
419
|
+
draft: g,
|
|
420
|
+
relations: y,
|
|
381
421
|
collection: d,
|
|
382
422
|
itemId: u,
|
|
383
|
-
staging:
|
|
384
|
-
errors:
|
|
385
|
-
staleFields:
|
|
386
|
-
aliasEmptiness:
|
|
387
|
-
layoutFields:
|
|
388
|
-
changedFields:
|
|
389
|
-
onRevertChange:
|
|
390
|
-
onFieldClick:
|
|
391
|
-
stagedO2MRows:
|
|
392
|
-
stagedO2MDeletes:
|
|
423
|
+
staging: h,
|
|
424
|
+
errors: _,
|
|
425
|
+
staleFields: i,
|
|
426
|
+
aliasEmptiness: o,
|
|
427
|
+
layoutFields: c,
|
|
428
|
+
changedFields: x,
|
|
429
|
+
onRevertChange: k,
|
|
430
|
+
onFieldClick: E,
|
|
431
|
+
stagedO2MRows: N,
|
|
432
|
+
stagedO2MDeletes: C
|
|
393
433
|
}) {
|
|
394
|
-
const [
|
|
395
|
-
...!e.some((
|
|
434
|
+
const [L, R] = Q(null), [S, m] = Q(null), b = pe(/* @__PURE__ */ new Map()), l = [
|
|
435
|
+
...!e.some((s) => s.key === "__general__") && a.length > 0 ? [{ key: "__general__", label: "General" }] : [],
|
|
396
436
|
...e
|
|
397
|
-
].map((
|
|
398
|
-
const
|
|
399
|
-
return { step:
|
|
400
|
-
}).filter((
|
|
401
|
-
(
|
|
402
|
-
(!
|
|
437
|
+
].map((s) => {
|
|
438
|
+
const T = (s.key === "__general__" ? [...a, ...r.flatMap((q) => t[q.key] ?? [])] : t[s.key] ?? []).filter((q) => !q.hidden && !_e.has(q.field) && !ke.has(q.field));
|
|
439
|
+
return { step: s, fields: T };
|
|
440
|
+
}).filter((s) => s.fields.length > 0), $ = new Set(l.flatMap((s) => s.fields.map((T) => T.field))), j = u && u !== "new" ? y.filter(
|
|
441
|
+
(s) => !s.junction_field && s.many_field && s.many_collection && (s.one_collection === d || s.one_collection == null) && s.one_field != null && !$.has(s.one_field) && // Off-layout aliases stay out — the sidebar summarizes THIS layout.
|
|
442
|
+
(!c || c.has(s.one_field))
|
|
403
443
|
) : [];
|
|
404
|
-
return
|
|
405
|
-
/* @__PURE__ */
|
|
406
|
-
|
|
407
|
-
/* @__PURE__ */
|
|
444
|
+
return l.length === 0 && j.length === 0 ? null : /* @__PURE__ */ n(le.Provider, { value: { rows: N, deletes: C }, children: /* @__PURE__ */ p("div", { className: "overflow-hidden bg-white dark:bg-card", children: [
|
|
445
|
+
/* @__PURE__ */ n("div", { className: "bg-slate-200 border-b border-slate-300 px-4 py-2.5 dark:bg-white/[0.1] dark:border-border", children: /* @__PURE__ */ n("span", { className: "text-[12px] font-semibold text-slate-700 dark:text-slate-200", children: "Summary" }) }),
|
|
446
|
+
l.map(({ step: s, fields: T }, q) => /* @__PURE__ */ p("div", { children: [
|
|
447
|
+
/* @__PURE__ */ n(
|
|
408
448
|
"div",
|
|
409
449
|
{
|
|
410
|
-
className:
|
|
450
|
+
className: M(
|
|
411
451
|
"bg-slate-100 px-4 py-2 border-b border-slate-200 dark:bg-white/[0.06] dark:border-border/80",
|
|
412
|
-
|
|
452
|
+
q > 0 && "border-t border-slate-200 dark:border-border/80"
|
|
413
453
|
),
|
|
414
|
-
children: /* @__PURE__ */
|
|
454
|
+
children: /* @__PURE__ */ n("span", { className: "text-[11px] font-semibold text-slate-600 dark:text-slate-300", children: s.label })
|
|
415
455
|
}
|
|
416
456
|
),
|
|
417
|
-
|
|
418
|
-
const v =
|
|
419
|
-
return /* @__PURE__ */
|
|
457
|
+
T.map((f, P) => {
|
|
458
|
+
const v = g[f.field], O = f.label ?? z(f.field), A = !!(_ != null && _[f.field]), F = o == null ? void 0 : o[f.field], ie = F !== void 0 ? F === !0 : v == null || typeof v == "string" && v.trim() === "" || Array.isArray(v) && v.length === 0, oe = F === null, H = !!f.required && ie && !A && !oe, W = (i == null ? void 0 : i.has(f.field)) ?? !1;
|
|
459
|
+
return /* @__PURE__ */ p(
|
|
420
460
|
"div",
|
|
421
461
|
{
|
|
422
|
-
className:
|
|
462
|
+
className: M(
|
|
423
463
|
"group/row flex items-stretch",
|
|
424
|
-
|
|
425
|
-
|
|
464
|
+
P < T.length - 1 && "border-b border-slate-100 dark:border-border/60",
|
|
465
|
+
A ? "bg-red-50 dark:bg-red-900/10" : H || W ? "bg-amber-50/70 dark:bg-amber-900/10" : ""
|
|
426
466
|
),
|
|
427
467
|
children: [
|
|
428
|
-
/* @__PURE__ */
|
|
468
|
+
/* @__PURE__ */ p(
|
|
429
469
|
"button",
|
|
430
470
|
{
|
|
431
471
|
type: "button",
|
|
432
|
-
onClick: () =>
|
|
433
|
-
className:
|
|
472
|
+
onClick: () => E(s.key, f.field),
|
|
473
|
+
className: M(
|
|
434
474
|
"flex flex-1 flex-col px-4 py-2 text-left transition-colors duration-150 min-w-0",
|
|
435
|
-
|
|
475
|
+
A ? "hover:bg-red-50 dark:hover:bg-red-900/15" : "hover:bg-slate-50 dark:hover:bg-white/[0.03]"
|
|
436
476
|
),
|
|
437
477
|
children: [
|
|
438
|
-
/* @__PURE__ */
|
|
478
|
+
/* @__PURE__ */ p(
|
|
439
479
|
"span",
|
|
440
480
|
{
|
|
441
|
-
className:
|
|
481
|
+
className: M(
|
|
442
482
|
"flex items-center gap-1 text-[10px] font-medium truncate",
|
|
443
|
-
|
|
483
|
+
A ? "text-red-500 dark:text-red-400" : H || W ? "text-amber-700 dark:text-amber-400" : "text-slate-400 dark:text-slate-500"
|
|
444
484
|
),
|
|
445
485
|
children: [
|
|
446
|
-
/* @__PURE__ */
|
|
447
|
-
(
|
|
448
|
-
|
|
486
|
+
/* @__PURE__ */ n("span", { className: "truncate", children: O }),
|
|
487
|
+
(x == null ? void 0 : x[f.field]) && /* @__PURE__ */ n(
|
|
488
|
+
Me,
|
|
449
489
|
{
|
|
450
|
-
field:
|
|
451
|
-
from:
|
|
452
|
-
detail:
|
|
490
|
+
field: f,
|
|
491
|
+
from: x[f.field].from,
|
|
492
|
+
detail: x[f.field].detail,
|
|
453
493
|
to: v,
|
|
454
|
-
relations:
|
|
494
|
+
relations: y,
|
|
455
495
|
collection: d,
|
|
456
|
-
onRevert:
|
|
496
|
+
onRevert: k ? () => k(f.field) : void 0
|
|
457
497
|
}
|
|
458
498
|
),
|
|
459
|
-
|
|
460
|
-
|
|
499
|
+
H && /* @__PURE__ */ n("span", { className: "shrink-0 rounded bg-amber-100 px-1 text-[9px] font-semibold uppercase tracking-wide text-amber-700 dark:bg-amber-900/30 dark:text-amber-400", children: "required" }),
|
|
500
|
+
W && /* @__PURE__ */ n(
|
|
461
501
|
"span",
|
|
462
502
|
{
|
|
463
503
|
title: "This value is no longer one of the available options",
|
|
@@ -468,22 +508,22 @@ function Je({
|
|
|
468
508
|
]
|
|
469
509
|
}
|
|
470
510
|
),
|
|
471
|
-
/* @__PURE__ */
|
|
511
|
+
/* @__PURE__ */ n(
|
|
472
512
|
"span",
|
|
473
513
|
{
|
|
474
|
-
ref: (
|
|
475
|
-
|
|
514
|
+
ref: (Y) => {
|
|
515
|
+
b.current.set(f.field, Y);
|
|
476
516
|
},
|
|
477
517
|
className: "mt-0.5 w-full text-[12px] min-w-0 overflow-hidden",
|
|
478
|
-
children: /* @__PURE__ */
|
|
518
|
+
children: /* @__PURE__ */ n(
|
|
479
519
|
je,
|
|
480
520
|
{
|
|
481
|
-
field:
|
|
521
|
+
field: f,
|
|
482
522
|
val: v,
|
|
483
|
-
relations:
|
|
523
|
+
relations: y,
|
|
484
524
|
collection: d,
|
|
485
525
|
itemId: u,
|
|
486
|
-
staging:
|
|
526
|
+
staging: h
|
|
487
527
|
}
|
|
488
528
|
)
|
|
489
529
|
}
|
|
@@ -491,58 +531,58 @@ function Je({
|
|
|
491
531
|
]
|
|
492
532
|
}
|
|
493
533
|
),
|
|
494
|
-
/* @__PURE__ */
|
|
534
|
+
/* @__PURE__ */ n(
|
|
495
535
|
"button",
|
|
496
536
|
{
|
|
497
537
|
type: "button",
|
|
498
538
|
title: "Copy value",
|
|
499
|
-
onClick: (
|
|
500
|
-
var
|
|
501
|
-
|
|
502
|
-
const
|
|
503
|
-
navigator.clipboard.writeText(
|
|
504
|
-
}),
|
|
505
|
-
() =>
|
|
539
|
+
onClick: (Y) => {
|
|
540
|
+
var I, X;
|
|
541
|
+
Y.stopPropagation();
|
|
542
|
+
const ce = ((X = (I = b.current.get(f.field)) == null ? void 0 : I.textContent) == null ? void 0 : X.trim()) ?? Oe(v);
|
|
543
|
+
navigator.clipboard.writeText(ce).catch(() => {
|
|
544
|
+
}), R(f.field), setTimeout(
|
|
545
|
+
() => R((B) => B === f.field ? null : B),
|
|
506
546
|
1500
|
|
507
547
|
);
|
|
508
548
|
},
|
|
509
|
-
className:
|
|
549
|
+
className: M(
|
|
510
550
|
"flex items-center px-2 opacity-0 group-hover/row:opacity-100 transition-all duration-150",
|
|
511
|
-
|
|
551
|
+
L === f.field ? "text-emerald-500" : "text-slate-400 hover:text-slate-600 dark:text-slate-500 dark:hover:text-slate-300"
|
|
512
552
|
),
|
|
513
|
-
children:
|
|
553
|
+
children: L === f.field ? /* @__PURE__ */ n(de, { className: "h-3 w-3" }) : /* @__PURE__ */ n(me, { className: "h-3 w-3" })
|
|
514
554
|
}
|
|
515
555
|
)
|
|
516
556
|
]
|
|
517
557
|
},
|
|
518
|
-
|
|
558
|
+
f.field
|
|
519
559
|
);
|
|
520
560
|
})
|
|
521
|
-
] },
|
|
522
|
-
|
|
523
|
-
/* @__PURE__ */
|
|
524
|
-
|
|
525
|
-
const
|
|
526
|
-
return /* @__PURE__ */
|
|
561
|
+
] }, s.key)),
|
|
562
|
+
j.length > 0 && /* @__PURE__ */ p("div", { children: [
|
|
563
|
+
/* @__PURE__ */ n("div", { className: "bg-slate-100 px-4 py-2 border-y border-slate-200 dark:bg-white/[0.06] dark:border-border/80", children: /* @__PURE__ */ n("span", { className: "text-[11px] font-semibold text-slate-600 dark:text-slate-300", children: "Related" }) }),
|
|
564
|
+
j.map((s, T) => {
|
|
565
|
+
const q = s.one_field ?? s.many_collection ?? "", f = S === q;
|
|
566
|
+
return /* @__PURE__ */ n(
|
|
527
567
|
"div",
|
|
528
568
|
{
|
|
529
|
-
className:
|
|
569
|
+
className: M(
|
|
530
570
|
"flex items-stretch",
|
|
531
|
-
|
|
571
|
+
T < j.length - 1 && "border-b border-slate-100 dark:border-border/60"
|
|
532
572
|
),
|
|
533
|
-
children: /* @__PURE__ */
|
|
573
|
+
children: /* @__PURE__ */ p(
|
|
534
574
|
"button",
|
|
535
575
|
{
|
|
536
576
|
type: "button",
|
|
537
577
|
onClick: () => {
|
|
538
|
-
var
|
|
539
|
-
const
|
|
540
|
-
if (!
|
|
541
|
-
|
|
578
|
+
var A;
|
|
579
|
+
const P = s.many_collection ?? "", v = /(^|_)(notes?|comments?)$/i.test(P), O = document.querySelector(`[data-o2m-collection="${P}"]`) ?? (v ? document.querySelector('[data-panel="notes"]') : null);
|
|
580
|
+
if (!O) {
|
|
581
|
+
m((F) => F === q ? null : q);
|
|
542
582
|
return;
|
|
543
583
|
}
|
|
544
|
-
|
|
545
|
-
() =>
|
|
584
|
+
O.getAttribute("data-panel-expanded") === "false" && ((A = O.querySelector("[data-panel-toggle]")) == null || A.click()), O.scrollIntoView({ behavior: "smooth", block: "center" }), O.classList.add("ring-2", "ring-nvr-cyan", "ring-offset-2", "rounded-md"), setTimeout(
|
|
585
|
+
() => O.classList.remove(
|
|
546
586
|
"ring-2",
|
|
547
587
|
"ring-nvr-cyan",
|
|
548
588
|
"ring-offset-2",
|
|
@@ -553,39 +593,39 @@ function Je({
|
|
|
553
593
|
},
|
|
554
594
|
className: "flex flex-1 flex-col px-4 py-2 min-w-0 text-left transition-colors hover:bg-nvr-cyan/5",
|
|
555
595
|
children: [
|
|
556
|
-
/* @__PURE__ */
|
|
557
|
-
/* @__PURE__ */
|
|
558
|
-
|
|
596
|
+
/* @__PURE__ */ p("span", { className: "flex items-center gap-1 text-[10px] font-medium truncate text-slate-400 dark:text-slate-500", children: [
|
|
597
|
+
/* @__PURE__ */ n(
|
|
598
|
+
ue,
|
|
559
599
|
{
|
|
560
|
-
className:
|
|
600
|
+
className: M(
|
|
561
601
|
"h-3 w-3 shrink-0 transition-transform",
|
|
562
|
-
|
|
602
|
+
f && "rotate-90"
|
|
563
603
|
)
|
|
564
604
|
}
|
|
565
605
|
),
|
|
566
|
-
|
|
606
|
+
z(s.one_field ?? s.many_collection ?? "")
|
|
567
607
|
] }),
|
|
568
|
-
/* @__PURE__ */
|
|
569
|
-
|
|
608
|
+
/* @__PURE__ */ n("span", { className: "mt-0.5 text-[12px]", children: /* @__PURE__ */ n(
|
|
609
|
+
se,
|
|
570
610
|
{
|
|
571
|
-
relatedCollection:
|
|
572
|
-
manyField:
|
|
611
|
+
relatedCollection: s.many_collection ?? "",
|
|
612
|
+
manyField: s.many_field,
|
|
573
613
|
parentId: u,
|
|
574
|
-
expanded:
|
|
614
|
+
expanded: f
|
|
575
615
|
}
|
|
576
616
|
) })
|
|
577
617
|
]
|
|
578
618
|
}
|
|
579
619
|
)
|
|
580
620
|
},
|
|
581
|
-
|
|
621
|
+
s.id ?? `${s.many_collection}.${s.many_field}`
|
|
582
622
|
);
|
|
583
623
|
})
|
|
584
624
|
] })
|
|
585
625
|
] }) });
|
|
586
626
|
}
|
|
587
627
|
export {
|
|
588
|
-
|
|
628
|
+
re as M2OSummaryValue,
|
|
589
629
|
je as SummaryFieldValue,
|
|
590
|
-
|
|
630
|
+
We as SummaryPanel
|
|
591
631
|
};
|