@nivaro/react 0.3.10 → 0.3.11
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/useNivaroForm.js +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +34 -3
- package/dist/shared/components/CollectionBrowserView.js +1546 -1477
- package/dist/shared/components/ItemEditForm.js +4332 -4195
- package/dist/shared/components/PageRenderer.js +512 -465
- package/dist/shared/components/QueryStatStrip.js +74 -70
- package/dist/shared/components/ReportView.js +818 -827
- package/dist/shared/components/SheetHeaderBody.js +16 -14
- package/dist/shared/components/item-edit/CatalogPickerField.js +1029 -933
- package/dist/shared/components/item-edit/FieldRenderer.js +161 -156
- package/dist/shared/components/item-edit/FieldRow.js +20 -19
- package/dist/shared/components/item-edit/FilePickerField.js +52 -40
- package/dist/shared/components/item-edit/GroupSection.js +221 -221
- package/dist/shared/components/item-edit/InlineGridField.js +41 -41
- package/dist/shared/components/item-edit/InlineTableField.js +2249 -2238
- package/dist/shared/components/item-edit/M2MCombobox.js +46 -44
- package/dist/shared/components/item-edit/NestedRelationEditor.js +11 -11
- package/dist/shared/components/item-edit/QuickPicker.js +263 -216
- package/dist/shared/components/item-edit/RelationCombobox.js +285 -245
- package/dist/shared/components/item-edit/RichTextEditorImpl.js +42 -32
- package/dist/shared/components/item-edit/RowHistorySheet.js +130 -134
- package/dist/shared/components/item-edit/SummaryPanel.js +305 -279
- package/dist/shared/components/item-edit/helpers.js +133 -134
- package/dist/shared/components/item-edit/line-qty.js +57 -0
- package/dist/shared/components/item-edit/option-disambiguate.js +53 -0
- package/dist/shared/components/panels/AddendumLinesDiff.js +87 -90
- package/dist/shared/components/panels/CommentPanel.js +350 -315
- package/dist/shared/components/panels/ItemLockBanner.js +297 -230
- package/dist/shared/components/panels/PipelinePanel.js +719 -701
- package/dist/shared/components/queue/QueueQuickFilters.js +43 -41
- package/dist/shared/components/queue/QueueWorklist.js +1005 -935
- package/dist/shared/components/widgets/ReviewListWidget.js +99 -93
- package/dist/shared/lib/obligation-banner.js +14 -13
- package/dist/shared/lib/obligation-reason-text.js +13 -0
- package/dist/shared/lib/query-filter-seed.js +34 -11
- package/dist/shared/lib/sanitize-html.js +24 -15
- package/dist/shared/lib/sheet-def.js +38 -22
- package/dist/shared/lib/unique-options.js +10 -0
- package/dist/shared/lib/utils.js +57 -43
- package/dist/shared/lib/validation-rules.js +58 -34
- package/package.json +1 -1
|
@@ -7,9 +7,9 @@ import { parseAllowedCollections as Ie } from "../../lib/allowed-collections.js"
|
|
|
7
7
|
import { get as C } from "../../lib/commands.js";
|
|
8
8
|
import { useRecordReader as Ae } from "../../lib/record-loader.js";
|
|
9
9
|
import { useOnlineUsers as he } from "../../lib/use-online-users.js";
|
|
10
|
-
import { cn as Q, userOptionFilter as
|
|
11
|
-
import { UserAvatar as
|
|
12
|
-
import { Command as xe, CommandInput as
|
|
10
|
+
import { cn as Q, userOptionFilter as be } from "../../lib/utils.js";
|
|
11
|
+
import { UserAvatar as ye } from "../UserAvatar.js";
|
|
12
|
+
import { Command as xe, CommandInput as ve, CommandList as ge, CommandEmpty as ke, CommandGroup as we, CommandItem as Ne } from "../ui/command.js";
|
|
13
13
|
import { Popover as Se, PopoverTrigger as _e, PopoverContent as Ce } from "../ui/popover.js";
|
|
14
14
|
import { applyDisplayTemplate as qe } from "./helpers.js";
|
|
15
15
|
import { useM2MStaging as Le } from "./M2MStagingContext.js";
|
|
@@ -38,31 +38,31 @@ function tt({
|
|
|
38
38
|
parentId: o,
|
|
39
39
|
allRelations: N,
|
|
40
40
|
extraFilter: h,
|
|
41
|
-
optionSort:
|
|
41
|
+
optionSort: b,
|
|
42
42
|
requiredParent: K,
|
|
43
43
|
onCountChange: J,
|
|
44
44
|
drilldown: D
|
|
45
45
|
}) {
|
|
46
|
-
const
|
|
46
|
+
const y = fe(), W = $e(), t = Le(), [P, q] = ne(!1), [L, T] = ne(""), le = N.find(
|
|
47
47
|
(e) => e.many_collection === s.many_collection && e.many_field === s.junction_field && e.id !== s.id
|
|
48
|
-
), r = Te(le), x = s.junction_field ?? "",
|
|
48
|
+
), r = Te(le), x = s.junction_field ?? "", R = s.many_field ?? "", d = s.one_field ?? `${s.many_collection}.${x}`, { data: a } = w({
|
|
49
49
|
queryKey: ["col-meta", r],
|
|
50
|
-
queryFn: () =>
|
|
50
|
+
queryFn: () => y.request(C(`/collections/${r}`)).then((e) => e.data),
|
|
51
51
|
enabled: !!r,
|
|
52
52
|
staleTime: 3e5,
|
|
53
53
|
retry: !1
|
|
54
54
|
}), { data: X = [] } = w({
|
|
55
|
-
queryKey: ["m2m-items", s.many_collection,
|
|
56
|
-
queryFn: () =>
|
|
55
|
+
queryKey: ["m2m-items", s.many_collection, R, o],
|
|
56
|
+
queryFn: () => y.request(
|
|
57
57
|
C(`/items/${s.many_collection}`, {
|
|
58
|
-
filter: JSON.stringify({ [
|
|
58
|
+
filter: JSON.stringify({ [R]: { _eq: o } }),
|
|
59
59
|
limit: 200,
|
|
60
60
|
fields: `id,${x}`
|
|
61
61
|
})
|
|
62
62
|
).then((e) => e.data ?? []),
|
|
63
63
|
staleTime: 3e4,
|
|
64
64
|
enabled: !!o && o !== "new"
|
|
65
|
-
}), re = pe().isAdmin,
|
|
65
|
+
}), re = pe().isAdmin, z = r === "nivaro_users" ? be(re) : null, E = he(r === "nivaro_users"), H = h ? z ? { _and: [h, z] } : h : z, j = H ? JSON.stringify(H) : void 0, v = b && !/^-?label$/.test(b) ? b : void 0, S = (() => {
|
|
66
66
|
const e = a == null ? void 0 : a.display_template;
|
|
67
67
|
if (!e || !e.includes(".")) return null;
|
|
68
68
|
const i = [...e.matchAll(/\{\{([^}]+)\}\}/g)].map((u) => u[1].trim());
|
|
@@ -73,10 +73,10 @@ function tt({
|
|
|
73
73
|
r,
|
|
74
74
|
L,
|
|
75
75
|
j,
|
|
76
|
-
|
|
76
|
+
v ?? "",
|
|
77
77
|
S ?? ""
|
|
78
78
|
],
|
|
79
|
-
queryFn: () =>
|
|
79
|
+
queryFn: () => y.request(
|
|
80
80
|
C(`/items/${r}`, {
|
|
81
81
|
limit: 200,
|
|
82
82
|
search: L || void 0,
|
|
@@ -85,14 +85,14 @@ function tt({
|
|
|
85
85
|
// A dotted display template ({{core_category.name}}) needs the
|
|
86
86
|
// nested expansion — a bare row only carries the FK id.
|
|
87
87
|
...S ? { fields: S } : {},
|
|
88
|
-
...
|
|
88
|
+
...v ? { sort: v } : {}
|
|
89
89
|
})
|
|
90
90
|
).then((e) => e.data ?? []),
|
|
91
91
|
enabled: P && !!r,
|
|
92
92
|
staleTime: j ? 0 : 3e4
|
|
93
|
-
}), B = (t == null ? void 0 : t.getStagedLinks(d)) ?? [],
|
|
93
|
+
}), B = (t == null ? void 0 : t.getStagedLinks(d)) ?? [], g = (t == null ? void 0 : t.getStagedUnlinks(d)) ?? /* @__PURE__ */ new Set(), U = X.filter((e) => !g.has(e.id)), p = new Set(U.map((e) => String(e[x]))), _ = [...p], Y = JSON.stringify(h ? { _and: [{ id: { _in: _ } }, h] } : { id: { _in: _ } }), { data: m } = w({
|
|
94
94
|
queryKey: ["m2m-avail", r, _.join(","), j],
|
|
95
|
-
queryFn: () =>
|
|
95
|
+
queryFn: () => y.request(
|
|
96
96
|
C(`/items/${r}`, {
|
|
97
97
|
filter: Y,
|
|
98
98
|
picker: "1",
|
|
@@ -115,7 +115,7 @@ function tt({
|
|
|
115
115
|
}
|
|
116
116
|
const u = X.find((M) => String(M[x]) === i);
|
|
117
117
|
if (u) {
|
|
118
|
-
|
|
118
|
+
g.has(u.id) ? t == null || t.unstageUnlink(d, u.id) : t == null || t.stageUnlink(d, u.id);
|
|
119
119
|
return;
|
|
120
120
|
}
|
|
121
121
|
t == null || t.stageLink(d, e);
|
|
@@ -210,6 +210,7 @@ function tt({
|
|
|
210
210
|
"button",
|
|
211
211
|
{
|
|
212
212
|
type: "button",
|
|
213
|
+
"aria-label": "Remove",
|
|
213
214
|
onClick: () => t == null ? void 0 : t.stageUnlink(d, e.id),
|
|
214
215
|
className: "rounded-full p-0.5 text-slate-400 hover:text-red-500",
|
|
215
216
|
children: /* @__PURE__ */ n(oe, { className: "h-3 w-3" })
|
|
@@ -237,6 +238,7 @@ function tt({
|
|
|
237
238
|
"button",
|
|
238
239
|
{
|
|
239
240
|
type: "button",
|
|
241
|
+
"aria-label": "Remove",
|
|
240
242
|
onClick: () => t == null ? void 0 : t.unstageLink(d, e),
|
|
241
243
|
className: "rounded-full p-0.5 text-slate-400 hover:text-red-500",
|
|
242
244
|
children: /* @__PURE__ */ n(oe, { className: "h-3 w-3" })
|
|
@@ -255,7 +257,7 @@ function tt({
|
|
|
255
257
|
) }),
|
|
256
258
|
/* @__PURE__ */ n(Ce, { className: "w-[320px] p-0", align: "start", children: /* @__PURE__ */ c(xe, { shouldFilter: !1, children: [
|
|
257
259
|
/* @__PURE__ */ n(
|
|
258
|
-
|
|
260
|
+
ve,
|
|
259
261
|
{
|
|
260
262
|
placeholder: "Search…",
|
|
261
263
|
value: L,
|
|
@@ -263,10 +265,10 @@ function tt({
|
|
|
263
265
|
className: "h-9 text-[13px]"
|
|
264
266
|
}
|
|
265
267
|
),
|
|
266
|
-
/* @__PURE__ */ c(
|
|
268
|
+
/* @__PURE__ */ c(ge, { children: [
|
|
267
269
|
V ? /* @__PURE__ */ n("div", { className: "flex items-center justify-center py-4", children: /* @__PURE__ */ n(ae, { className: "h-4 w-4 animate-spin text-muted-foreground" }) }) : /* @__PURE__ */ n(ke, { className: "py-3 text-left text-[12px] text-muted-foreground px-3", children: "No results" }),
|
|
268
|
-
/* @__PURE__ */ n(we, { children: !V && (
|
|
269
|
-
(e, i) =>
|
|
270
|
+
/* @__PURE__ */ n(we, { children: !V && (v ? [...O] : [...O].sort(
|
|
271
|
+
(e, i) => b === "-label" ? k(i).localeCompare(k(e)) : k(e).localeCompare(k(i))
|
|
270
272
|
)).map((e) => {
|
|
271
273
|
const i = String(e.id), u = A.has(i);
|
|
272
274
|
return /* @__PURE__ */ c(
|
|
@@ -287,14 +289,14 @@ function tt({
|
|
|
287
289
|
}
|
|
288
290
|
),
|
|
289
291
|
r === "nivaro_users" && /* @__PURE__ */ n(
|
|
290
|
-
|
|
292
|
+
ye,
|
|
291
293
|
{
|
|
292
294
|
userId: i,
|
|
293
295
|
className: "h-4 w-4",
|
|
294
296
|
fallback: /* @__PURE__ */ n("span", { className: "flex h-4 w-4 shrink-0 items-center justify-center rounded-full bg-nvr-cyan/20 text-[8px] font-bold text-nvr-navy dark:text-nvr-cyan", children: je(k(e)) })
|
|
295
297
|
}
|
|
296
298
|
),
|
|
297
|
-
r === "nivaro_users" &&
|
|
299
|
+
r === "nivaro_users" && E.has(i.toUpperCase()) && /* @__PURE__ */ n(
|
|
298
300
|
"span",
|
|
299
301
|
{
|
|
300
302
|
className: "h-1.5 w-1.5 shrink-0 rounded-full bg-emerald-500",
|
|
@@ -318,31 +320,31 @@ function nt({
|
|
|
318
320
|
parentId: o,
|
|
319
321
|
allRelations: N,
|
|
320
322
|
extraFilter: h,
|
|
321
|
-
optionSort:
|
|
323
|
+
optionSort: b,
|
|
322
324
|
requiredParent: K,
|
|
323
325
|
onCountChange: J,
|
|
324
326
|
readOnly: D
|
|
325
327
|
}) {
|
|
326
|
-
const
|
|
328
|
+
const y = fe(), W = Ae(), t = Le(), [P, q] = ne(!1), [L, T] = ne(""), le = N.find(
|
|
327
329
|
(l) => l.many_collection === s.many_collection && l.many_field === s.junction_field && l.id !== s.id
|
|
328
|
-
), r = Te(le), x = s.junction_field ?? "",
|
|
330
|
+
), r = Te(le), x = s.junction_field ?? "", R = s.many_field ?? "", d = s.one_field ?? `${s.many_collection}.${x}`, { data: a } = w({
|
|
329
331
|
queryKey: ["col-meta", r],
|
|
330
|
-
queryFn: () =>
|
|
332
|
+
queryFn: () => y.request(C(`/collections/${r}`)).then((l) => l.data),
|
|
331
333
|
enabled: !!r,
|
|
332
334
|
staleTime: 3e5,
|
|
333
335
|
retry: !1
|
|
334
336
|
}), { data: X = [], isFetching: re } = w({
|
|
335
|
-
queryKey: ["m2m-items", s.many_collection,
|
|
336
|
-
queryFn: () =>
|
|
337
|
+
queryKey: ["m2m-items", s.many_collection, R, o],
|
|
338
|
+
queryFn: () => y.request(
|
|
337
339
|
C(`/items/${s.many_collection}`, {
|
|
338
|
-
filter: JSON.stringify({ [
|
|
340
|
+
filter: JSON.stringify({ [R]: { _eq: o } }),
|
|
339
341
|
limit: 1,
|
|
340
342
|
fields: `id,${x}`
|
|
341
343
|
})
|
|
342
344
|
).then((l) => l.data ?? []),
|
|
343
345
|
staleTime: 3e4,
|
|
344
346
|
enabled: !!o && o !== "new"
|
|
345
|
-
}),
|
|
347
|
+
}), z = pe().isAdmin, E = r === "nivaro_users" ? be(z) : null, H = he(r === "nivaro_users"), j = h ? E ? { _and: [h, E] } : h : E, v = j ? JSON.stringify(j) : void 0, S = b && !/^-?label$/.test(b) ? b : void 0, O = (() => {
|
|
346
348
|
const l = a == null ? void 0 : a.display_template;
|
|
347
349
|
if (!l || !l.includes(".")) return null;
|
|
348
350
|
const f = [...l.matchAll(/\{\{([^}]+)\}\}/g)].map((ee) => ee[1].trim());
|
|
@@ -352,15 +354,15 @@ function nt({
|
|
|
352
354
|
"m2m-options",
|
|
353
355
|
r,
|
|
354
356
|
L,
|
|
355
|
-
|
|
357
|
+
v,
|
|
356
358
|
S ?? "",
|
|
357
359
|
O ?? ""
|
|
358
360
|
],
|
|
359
|
-
queryFn: () =>
|
|
361
|
+
queryFn: () => y.request(
|
|
360
362
|
C(`/items/${r}`, {
|
|
361
363
|
limit: 200,
|
|
362
364
|
search: L || void 0,
|
|
363
|
-
filter:
|
|
365
|
+
filter: v,
|
|
364
366
|
picker: "1",
|
|
365
367
|
// A dotted display template ({{core_category.name}}) needs the
|
|
366
368
|
// nested expansion — a bare row only carries the FK id.
|
|
@@ -369,8 +371,8 @@ function nt({
|
|
|
369
371
|
})
|
|
370
372
|
).then((l) => l.data ?? []),
|
|
371
373
|
enabled: P && !!r,
|
|
372
|
-
staleTime:
|
|
373
|
-
}),
|
|
374
|
+
staleTime: v ? 0 : 3e4
|
|
375
|
+
}), g = (t == null ? void 0 : t.getStagedLinks(d)) ?? [], U = (t == null ? void 0 : t.getStagedUnlinks(d)) ?? /* @__PURE__ */ new Set(), p = X.find((l) => !U.has(l.id)) ?? null, _ = p ? p[x] : null, Y = g.length > 0 ? g[g.length - 1] : null, m = Y ?? _, Z = g.length > 0 || U.size > 0, $ = me(J);
|
|
374
376
|
$.current = J, ue(() => {
|
|
375
377
|
var l;
|
|
376
378
|
(l = $.current) == null || l.call($, m != null ? 1 : 0);
|
|
@@ -381,8 +383,8 @@ function nt({
|
|
|
381
383
|
enabled: !!r && m != null,
|
|
382
384
|
staleTime: 6e4
|
|
383
385
|
}), A = JSON.stringify(h ? { _and: [{ id: { _eq: m } }, h] } : { id: { _eq: m } }), { data: F } = w({
|
|
384
|
-
queryKey: ["relation-avail", r, String(m),
|
|
385
|
-
queryFn: () =>
|
|
386
|
+
queryKey: ["relation-avail", r, String(m), v],
|
|
387
|
+
queryFn: () => y.request(
|
|
386
388
|
C(`/items/${r}`, {
|
|
387
389
|
filter: A,
|
|
388
390
|
picker: "1",
|
|
@@ -400,11 +402,11 @@ function nt({
|
|
|
400
402
|
if (D)
|
|
401
403
|
return /* @__PURE__ */ n("span", { className: "block truncate text-[12px] text-slate-700 dark:text-slate-200", children: M ? "…" : se ?? "—" });
|
|
402
404
|
function Oe(l) {
|
|
403
|
-
for (const f of
|
|
405
|
+
for (const f of g) t == null || t.unstageLink(d, f);
|
|
404
406
|
p && !U.has(p.id) && (t == null || t.stageUnlink(d, p.id)), String(l) === String(_) && p ? t == null || t.unstageUnlink(d, p.id) : String(l) !== String(m) && (t == null || t.stageLink(d, l)), q(!1), T("");
|
|
405
407
|
}
|
|
406
408
|
function Ue() {
|
|
407
|
-
for (const l of
|
|
409
|
+
for (const l of g) t == null || t.unstageLink(d, l);
|
|
408
410
|
p && (t == null || t.stageUnlink(d, p.id)), q(!1);
|
|
409
411
|
}
|
|
410
412
|
return K ? /* @__PURE__ */ c(
|
|
@@ -459,7 +461,7 @@ function nt({
|
|
|
459
461
|
) }),
|
|
460
462
|
/* @__PURE__ */ n(Ce, { className: "w-[320px] p-0", align: "start", children: /* @__PURE__ */ c(xe, { shouldFilter: !1, children: [
|
|
461
463
|
/* @__PURE__ */ n(
|
|
462
|
-
|
|
464
|
+
ve,
|
|
463
465
|
{
|
|
464
466
|
placeholder: "Search…",
|
|
465
467
|
value: L,
|
|
@@ -481,10 +483,10 @@ function nt({
|
|
|
481
483
|
]
|
|
482
484
|
}
|
|
483
485
|
),
|
|
484
|
-
/* @__PURE__ */ c(
|
|
486
|
+
/* @__PURE__ */ c(ge, { children: [
|
|
485
487
|
B ? /* @__PURE__ */ n("div", { className: "flex items-center justify-center py-4", children: /* @__PURE__ */ n(ae, { className: "h-4 w-4 animate-spin text-muted-foreground" }) }) : /* @__PURE__ */ n(ke, { className: "py-3 text-left text-[12px] text-muted-foreground px-3", children: "No results" }),
|
|
486
488
|
!B && /* @__PURE__ */ n(we, { children: [...V].sort(
|
|
487
|
-
(l, f) => S ? 0 :
|
|
489
|
+
(l, f) => S ? 0 : b === "-label" ? i(f).localeCompare(i(l)) : i(l).localeCompare(i(f))
|
|
488
490
|
).map((l) => {
|
|
489
491
|
const f = String(l.id), ee = String(m) === f;
|
|
490
492
|
return /* @__PURE__ */ c(
|
|
@@ -505,7 +507,7 @@ function nt({
|
|
|
505
507
|
}
|
|
506
508
|
),
|
|
507
509
|
r === "nivaro_users" && /* @__PURE__ */ n(
|
|
508
|
-
|
|
510
|
+
ye,
|
|
509
511
|
{
|
|
510
512
|
userId: f,
|
|
511
513
|
className: "h-4 w-4",
|
|
@@ -4,10 +4,10 @@ import { Loader2 as Pe, Pencil as De, X as Ke } from "lucide-react";
|
|
|
4
4
|
import { useMemo as L, useRef as $e, useEffect as ke, useState as T, Fragment as je } from "react";
|
|
5
5
|
import { useNivaroClient as Le } from "../../context.js";
|
|
6
6
|
import { get as K, post as Te, patch as Fe, del as Ae } from "../../lib/commands.js";
|
|
7
|
-
import { titleCase as R, formatNumber as Je, cn as ue } from "../../lib/utils.js";
|
|
7
|
+
import { titleCase as R, formatNumber as Je, cn as ue, toLocalDateString as Ye } from "../../lib/utils.js";
|
|
8
8
|
import { FieldRenderer as fe } from "./FieldRenderer.js";
|
|
9
|
-
import { SENTINEL_FIELDS as
|
|
10
|
-
const
|
|
9
|
+
import { SENTINEL_FIELDS as Me, EMPTY_NESTED_OPS as O, applyDisplayTemplate as Se } from "./helpers.js";
|
|
10
|
+
const We = /* @__PURE__ */ new Set([
|
|
11
11
|
"alias",
|
|
12
12
|
"o2m",
|
|
13
13
|
"m2m",
|
|
@@ -15,8 +15,8 @@ const Se = /* @__PURE__ */ new Set([
|
|
|
15
15
|
"presentation",
|
|
16
16
|
"group",
|
|
17
17
|
"divider"
|
|
18
|
-
]),
|
|
19
|
-
function
|
|
18
|
+
]), ze = /* @__PURE__ */ new Set(["__apply_values__", "__create_with_defaults__"]);
|
|
19
|
+
function Ie(d, a) {
|
|
20
20
|
return d === a || d == null && a == null ? !0 : d == null || a == null ? !1 : typeof d == "string" && typeof a == "number" || typeof d == "number" && typeof a == "string" ? String(d) === String(a) : JSON.stringify(d) === JSON.stringify(a);
|
|
21
21
|
}
|
|
22
22
|
function me(d) {
|
|
@@ -28,7 +28,7 @@ function me(d) {
|
|
|
28
28
|
}
|
|
29
29
|
return a != null && a.message ? a.message : a != null && a.error ? a.error : d instanceof Error && d.message ? d.message : "Save failed";
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function Oe({
|
|
32
32
|
parentCollection: d,
|
|
33
33
|
relationField: a,
|
|
34
34
|
parentRowId: x,
|
|
@@ -73,7 +73,7 @@ function Re({
|
|
|
73
73
|
staleTime: 6e4
|
|
74
74
|
}), E = L(
|
|
75
75
|
() => te.filter(
|
|
76
|
-
(e) => !e.hidden && !
|
|
76
|
+
(e) => !e.hidden && !We.has(e.type) && e.field !== v && !(Y && e.field in Y) && e.field !== "id" && !Me.has(e.field) && !ze.has(e.group_key ?? "")
|
|
77
77
|
),
|
|
78
78
|
[te, v]
|
|
79
79
|
), re = m ? ["nested-rows", c, JSON.stringify(J ?? null)] : ["nested-rows", c, v, x], { data: W = [], isLoading: Q } = j({
|
|
@@ -137,7 +137,7 @@ function Re({
|
|
|
137
137
|
$[u] = l, f == null || f({ ...s, created: $ });
|
|
138
138
|
} else {
|
|
139
139
|
const u = W.find((k) => String(k.id) === o), $ = Object.fromEntries(
|
|
140
|
-
Object.entries(r).filter(([k, Ee]) => !
|
|
140
|
+
Object.entries(r).filter(([k, Ee]) => !Ie(Ee, u == null ? void 0 : u[k]))
|
|
141
141
|
), de = s.updated.filter((k) => k.id !== o);
|
|
142
142
|
Object.keys($).length > 0 && de.push({ id: o, changes: $ }), f == null || f({ ...s, updated: de });
|
|
143
143
|
}
|
|
@@ -237,7 +237,7 @@ function Re({
|
|
|
237
237
|
]);
|
|
238
238
|
e[t] = {};
|
|
239
239
|
for (const u of s.data ?? [])
|
|
240
|
-
e[t][String(u.id)] =
|
|
240
|
+
e[t][String(u.id)] = Se(
|
|
241
241
|
(l = i.data) == null ? void 0 : l.display_template,
|
|
242
242
|
u
|
|
243
243
|
);
|
|
@@ -260,7 +260,7 @@ function Re({
|
|
|
260
260
|
return /* @__PURE__ */ n("span", { className: t ? "text-emerald-600" : "text-slate-400", children: t ? "Yes" : "No" });
|
|
261
261
|
if (e.type === "datetime" || e.type === "date")
|
|
262
262
|
try {
|
|
263
|
-
return /* @__PURE__ */ n("span", { className: "block truncate", children:
|
|
263
|
+
return /* @__PURE__ */ n("span", { className: "block truncate", children: Ye(t) });
|
|
264
264
|
} catch {
|
|
265
265
|
}
|
|
266
266
|
return /* @__PURE__ */ n("span", { className: "block truncate", children: String(t) });
|
|
@@ -470,5 +470,5 @@ function Re({
|
|
|
470
470
|
] });
|
|
471
471
|
}
|
|
472
472
|
export {
|
|
473
|
-
|
|
473
|
+
Oe as NestedRelationEditor
|
|
474
474
|
};
|