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