@nivaro/react 0.3.8 → 0.3.9
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/replayUploadQueue.js +107 -93
- package/dist/hooks/useSessionRecorder.js +103 -101
- package/dist/index.d.ts +46 -1
- package/dist/index.js +300 -292
- package/dist/shared/components/CollectionBrowserView.js +318 -318
- package/dist/shared/components/DataTable.js +230 -223
- package/dist/shared/components/QueryTable.js +49 -49
- package/dist/shared/components/chat/ChatPanel.js +288 -287
- package/dist/shared/components/panels/CommentPanel.js +237 -236
- package/dist/shared/components/profile/usePersonPresence.js +42 -37
- package/dist/shared/lib/presence-live.js +54 -0
- package/dist/shared/lib/presence-state.js +39 -31
- package/dist/shared/lib/request-gate.js +120 -102
- package/dist/shared/lib/rum.js +45 -36
- package/dist/shared/lib/signed-out.js +114 -0
- package/dist/shared/lib/socket-realtime.js +19 -17
- package/dist/shared/lib/use-online-users.js +11 -10
- package/dist/shared/lib/worker-socket.js +89 -79
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as c, jsx as t, Fragment as ze } from "react/jsx-runtime";
|
|
2
|
-
import { useQueryClient as Vn, useMutation as lt, useQuery as te, useQueries as
|
|
3
|
-
import { FileDiff as Js, RotateCw as An, Network as Gs, Map as Xs, Sparkles as In, X as kl, Rows3 as yl, Rows2 as Zs, ChevronDown as
|
|
2
|
+
import { useQueryClient as Vn, useMutation as lt, useQuery as te, useQueries as Ba } from "@tanstack/react-query";
|
|
3
|
+
import { FileDiff as Js, RotateCw as An, Network as Gs, Map as Xs, Sparkles as In, X as kl, Rows3 as yl, Rows2 as Zs, ChevronDown as va, Wand2 as wl, FileText as _l, Bell as eo, BellOff as to, Loader2 as ao, Check as no, Search as Il, Pin as ro } from "lucide-react";
|
|
4
4
|
import lo, { useState as y, useRef as ie, useEffect as be, useMemo as ge, useLayoutEffect as so } from "react";
|
|
5
5
|
import { createPortal as jl } from "react-dom";
|
|
6
6
|
import { toast as pe } from "sonner";
|
|
@@ -8,13 +8,13 @@ import { useNivaroClient as Ge, useItemNavigation as Kl, useOverlayState as oo,
|
|
|
8
8
|
import { useDebounced as Nl } from "../hooks/useDebounced.js";
|
|
9
9
|
import { useElapsedLoading as co } from "../hooks/useElapsedLoading.js";
|
|
10
10
|
import { useBulkProgressFeed as uo, newBulkProgressId as po, startBulkProgress as mo, endBulkProgress as bo } from "../lib/bulk-progress.js";
|
|
11
|
-
import { post as de, get as G, patch as
|
|
11
|
+
import { post as de, get as G, patch as ja, del as za } from "../lib/commands.js";
|
|
12
12
|
import { parseDateFilter as Qn, dateFilterBounds as ho, describeDateFilter as fo, DATE_FILTER_OPS as go, formatDateFilter as xo } from "../lib/date-filter.js";
|
|
13
13
|
import { extractExpressionTokens as vo, evaluateNumeric as Sl } from "../lib/expression.js";
|
|
14
14
|
import { deliverLive as ko, releaseLiveOwner as yo } from "../lib/focus-mode.js";
|
|
15
|
-
import { formatValue as
|
|
15
|
+
import { formatValue as ta, formatMultiValue as Cl, countFromResolved as wo } from "../lib/format-value.js";
|
|
16
16
|
import { createCursorBook as _o, pageRequest as No, noteNextCursor as So, isCursorRefusal as Co, stopCursors as $o } from "../lib/keyset-pager.js";
|
|
17
|
-
import { expandCoalesced as qo, LIVE_ASPECTS as
|
|
17
|
+
import { expandCoalesced as qo, LIVE_ASPECTS as aa } from "../lib/live.js";
|
|
18
18
|
import { useRowChanges as To, useRowLocks as Lo, lockLabel as Fo, viewerMatches as Eo, conditionFields as Ro, mayAffectMatch as Po, writerOf as Mo } from "../lib/live-list.js";
|
|
19
19
|
import { OPEN_IN_TABS_CAP as Oo, openInTabs as Do, openInTabsMessage as $l } from "../lib/open-in-tabs.js";
|
|
20
20
|
import { isOwnWrite as Ao } from "../lib/own-writes.js";
|
|
@@ -55,15 +55,15 @@ import { RowHighlightLegend as Di } from "./RowHighlightLegend.js";
|
|
|
55
55
|
import { RowPresence as Ai } from "./RowPresence.js";
|
|
56
56
|
import { TipLayer as Ii } from "./TipLayer.js";
|
|
57
57
|
import { UnseenDot as El } from "./UnseenDot.js";
|
|
58
|
-
import { SimpleSelectXs as
|
|
58
|
+
import { SimpleSelectXs as na, SimpleSelect as ji } from "./ui/SimpleSelect.js";
|
|
59
59
|
import { RevisionsPanel as Ki } from "./panels/RevisionsPanel.js";
|
|
60
60
|
import { itemActionChoiceStep as Bi, ItemActionChoiceList as zi } from "./panels/ItemActionChoices.js";
|
|
61
|
-
function
|
|
61
|
+
function ka(n, i, f) {
|
|
62
62
|
const o = n.find((x) => x.one_collection === i && x.one_field === f);
|
|
63
63
|
if (o != null && o.many_collection)
|
|
64
64
|
return { kind: o.junction_field ? "m2m" : "o2m", relation: o };
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
function Qa(n) {
|
|
67
67
|
if (!n) return "id";
|
|
68
68
|
const i = new Set(n.fields.map((o) => o.field)), f = [...(n.display_template ?? "").matchAll(/\{\{(\w+)/g)].map((o) => o[1]);
|
|
69
69
|
for (const o of f) if (i.has(o)) return o;
|
|
@@ -76,7 +76,7 @@ const Rl = (n) => typeof n == "string" ? n : n.key, Pl = {
|
|
|
76
76
|
green: "text-emerald-600 dark:text-emerald-400 font-semibold",
|
|
77
77
|
blue: "text-sky-600 dark:text-sky-400 font-semibold"
|
|
78
78
|
};
|
|
79
|
-
function
|
|
79
|
+
function Ka(n, i) {
|
|
80
80
|
if (!i || i.length === 0) return null;
|
|
81
81
|
const f = n == null ? "" : String(n), o = Number(f);
|
|
82
82
|
for (const x of i) {
|
|
@@ -123,7 +123,7 @@ function Un(n, i) {
|
|
|
123
123
|
const f = [...n.matchAll(/\{\{([\w.]+)\}\}/g)].map((o) => o[1]);
|
|
124
124
|
return f.some((o) => o.includes(".")) ? null : [.../* @__PURE__ */ new Set(["id", i, ...f])].join(",");
|
|
125
125
|
}
|
|
126
|
-
function
|
|
126
|
+
function Ua(n, i) {
|
|
127
127
|
if (!n) {
|
|
128
128
|
for (const f of Yn) {
|
|
129
129
|
const o = i[f];
|
|
@@ -235,10 +235,10 @@ function Hn({ relatedCollection: n, id: i }) {
|
|
|
235
235
|
if (!_) return /* @__PURE__ */ t("span", { className: "font-mono text-[12px] text-slate-400", children: String(i) });
|
|
236
236
|
const S = o ? String(
|
|
237
237
|
[_.first_name, _.last_name].filter(Boolean).join(" ") || _.email || _.id || ""
|
|
238
|
-
) :
|
|
238
|
+
) : Ua((w == null ? void 0 : w.display_template) ?? null, _);
|
|
239
239
|
return /* @__PURE__ */ t("span", { className: "text-[12px] text-slate-700 dark:text-slate-200", children: S });
|
|
240
240
|
}
|
|
241
|
-
function
|
|
241
|
+
function Wa(n, i) {
|
|
242
242
|
for (const f of [
|
|
243
243
|
"cbv-items",
|
|
244
244
|
"cbv-pipeline-instances",
|
|
@@ -263,7 +263,7 @@ function Ji({
|
|
|
263
263
|
row: N,
|
|
264
264
|
bulkEnabledKeys: A
|
|
265
265
|
}) {
|
|
266
|
-
var _t, Et, Nt, Rt,
|
|
266
|
+
var _t, Et, Nt, Rt, la, bt, sa, St, oa, wa, _a, Oe, Pt, Ze;
|
|
267
267
|
const K = Ge(), q = Vn(), [p, v] = y(!1), [W, M] = y({ x: 0, y: 0 }), k = ie(null), $ = ie(null), R = gi(p), V = xi() && !!(R != null && R.some((b) => b.collection === n));
|
|
268
268
|
be(() => {
|
|
269
269
|
if (!p) return;
|
|
@@ -334,7 +334,7 @@ function Ji({
|
|
|
334
334
|
staleTime: 0
|
|
335
335
|
}), [X, Me] = y(null), xt = (h == null ? void 0 : h.id) ?? null;
|
|
336
336
|
be(() => Me(null), [xt]);
|
|
337
|
-
const je = z.data ? Bi(z.data) : null, vt = je && !je.ask ? je.value : X,
|
|
337
|
+
const je = z.data ? Bi(z.data) : null, vt = je && !je.ask ? je.value : X, ya = !!h && (!je || je.ask && X == null);
|
|
338
338
|
lo.useLayoutEffect(() => {
|
|
339
339
|
var Ce;
|
|
340
340
|
if (!p) return;
|
|
@@ -343,8 +343,8 @@ function Ji({
|
|
|
343
343
|
const F = b.getBoundingClientRect();
|
|
344
344
|
let { x: Z, y: se } = W;
|
|
345
345
|
if (F.right > window.innerWidth - 8 && (Z = Math.max(8, window.innerWidth - F.width - 8)), F.bottom > window.innerHeight - 8) {
|
|
346
|
-
const De = (Ce = k.current) == null ? void 0 : Ce.getBoundingClientRect(),
|
|
347
|
-
se =
|
|
346
|
+
const De = (Ce = k.current) == null ? void 0 : Ce.getBoundingClientRect(), Na = ((De == null ? void 0 : De.top) ?? se) - F.height - 4;
|
|
347
|
+
se = Na >= 8 ? Na : Math.max(8, window.innerHeight - F.height - 8);
|
|
348
348
|
}
|
|
349
349
|
(Z !== W.x || se !== W.y) && M({ x: Z, y: se });
|
|
350
350
|
}, [p, W, g, I.length]);
|
|
@@ -356,10 +356,10 @@ function Ji({
|
|
|
356
356
|
})
|
|
357
357
|
),
|
|
358
358
|
onSuccess: () => {
|
|
359
|
-
v(!1), pe.success("Transitioned"),
|
|
359
|
+
v(!1), pe.success("Transitioned"), Wa(q, n), S == null || S();
|
|
360
360
|
},
|
|
361
361
|
onError: (b) => pe.error(b instanceof Error ? b.message : "Transition failed")
|
|
362
|
-
}),
|
|
362
|
+
}), ra = lt({
|
|
363
363
|
mutationFn: async ({ action: b, comment: F }) => {
|
|
364
364
|
const Z = { collection: n, ids: [i], reason: (F == null ? void 0 : F.trim()) || null }, se = b.source === "db" ? await K.request(de("/bulk-actions/run", { ...Z, key: b.key })) : await K.request(de(`/bulk-actions/${b.key}/execute`, Z));
|
|
365
365
|
return { action: b, result: se.data ?? {} };
|
|
@@ -374,7 +374,7 @@ function Ji({
|
|
|
374
374
|
pe.info(`${b.label}: nothing to change`);
|
|
375
375
|
return;
|
|
376
376
|
}
|
|
377
|
-
pe.success(b.label),
|
|
377
|
+
pe.success(b.label), Wa(q, n), S == null || S();
|
|
378
378
|
},
|
|
379
379
|
onError: (b) => {
|
|
380
380
|
const F = b.response;
|
|
@@ -395,7 +395,7 @@ function Ji({
|
|
|
395
395
|
"item-actions"
|
|
396
396
|
])
|
|
397
397
|
q.invalidateQueries({ queryKey: [se] });
|
|
398
|
-
|
|
398
|
+
Wa(q, n), S == null || S();
|
|
399
399
|
},
|
|
400
400
|
onError: (b) => {
|
|
401
401
|
const F = b.response;
|
|
@@ -425,7 +425,7 @@ function Ji({
|
|
|
425
425
|
className: "inline-flex h-6 items-center gap-1 rounded border border-slate-200 bg-white px-2 text-[11px] font-medium text-slate-600 hover:border-slate-300 hover:text-slate-800 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-300 dark:hover:text-slate-100",
|
|
426
426
|
children: [
|
|
427
427
|
"Actions",
|
|
428
|
-
/* @__PURE__ */ t(
|
|
428
|
+
/* @__PURE__ */ t(va, { "aria-hidden": !0, className: "h-3 w-3 text-slate-400" })
|
|
429
429
|
]
|
|
430
430
|
}
|
|
431
431
|
),
|
|
@@ -492,7 +492,7 @@ function Ji({
|
|
|
492
492
|
{
|
|
493
493
|
value: ne,
|
|
494
494
|
onChange: (b) => H(b.target.value),
|
|
495
|
-
placeholder: ((Rt = g.push) == null ? void 0 : Rt.kind) === "push" ? ((bt = (
|
|
495
|
+
placeholder: ((Rt = g.push) == null ? void 0 : Rt.kind) === "push" ? ((bt = (la = g.push.action.confirm) == null ? void 0 : la.input) == null ? void 0 : bt.placeholder) ?? ((St = (sa = g.push.action.confirm) == null ? void 0 : sa.input) == null ? void 0 : St.label) ?? "" : (oa = g.action) != null && oa.require_reason ? "Reason (required — recorded on the record’s history)…" : "Reason (optional)…",
|
|
496
496
|
rows: 2,
|
|
497
497
|
className: "w-full resize-none rounded-md border border-slate-200 bg-white px-2 py-1.5 text-[12px] outline-none focus:border-nvr-cyan/50 dark:border-slate-700 dark:bg-slate-800 dark:text-slate-100"
|
|
498
498
|
}
|
|
@@ -502,13 +502,13 @@ function Ji({
|
|
|
502
502
|
"button",
|
|
503
503
|
{
|
|
504
504
|
type: "button",
|
|
505
|
-
disabled: g.push ? yt.isPending ||
|
|
505
|
+
disabled: g.push ? yt.isPending || ya || g.push.kind === "push" && !!((_a = (wa = g.push.action.confirm) == null ? void 0 : wa.input) != null && _a.required) && ne.trim().length === 0 : g.action ? ra.isPending || g.action.require_reason && ne.trim().length === 0 : !g.picked || kt.isPending,
|
|
506
506
|
onClick: () => {
|
|
507
|
-
g.push ? yt.mutate({ op: g.push, note: ne, pick: vt }) : g.action ?
|
|
507
|
+
g.push ? yt.mutate({ op: g.push, note: ne, pick: vt }) : g.action ? ra.mutate({ action: g.action, comment: ne }) : g.picked && kt.mutate({ transitionId: g.picked, comment: ne });
|
|
508
508
|
},
|
|
509
509
|
"data-row-action-confirm": !0,
|
|
510
510
|
className: `h-7 flex-1 rounded-md text-[12px] font-semibold text-white disabled:opacity-40 ${((Oe = g.action) == null ? void 0 : Oe.variant) === "danger" ? "bg-red-600" : "bg-nvr-cyan"}`,
|
|
511
|
-
children: kt.isPending ||
|
|
511
|
+
children: kt.isPending || ra.isPending || yt.isPending ? "Applying…" : ((Pt = g.push) == null ? void 0 : Pt.kind) === "push" ? ((Ze = g.push.action.confirm) == null ? void 0 : Ze.confirm_label) ?? "Send" : g.push ? "Retry" : "Confirm"
|
|
512
512
|
}
|
|
513
513
|
),
|
|
514
514
|
/* @__PURE__ */ t(
|
|
@@ -719,7 +719,7 @@ function Ml({
|
|
|
719
719
|
}
|
|
720
720
|
);
|
|
721
721
|
}
|
|
722
|
-
function
|
|
722
|
+
function Ya({
|
|
723
723
|
label: n,
|
|
724
724
|
options: i,
|
|
725
725
|
selected: f,
|
|
@@ -784,7 +784,7 @@ function Va({
|
|
|
784
784
|
children: "✕"
|
|
785
785
|
}
|
|
786
786
|
),
|
|
787
|
-
/* @__PURE__ */ t(
|
|
787
|
+
/* @__PURE__ */ t(va, { "aria-hidden": !0, className: "h-3 w-3 shrink-0 text-slate-400" })
|
|
788
788
|
]
|
|
789
789
|
}
|
|
790
790
|
),
|
|
@@ -836,7 +836,7 @@ function Gi({
|
|
|
836
836
|
staleTime: 10 * 6e4,
|
|
837
837
|
enabled: S,
|
|
838
838
|
retry: !1
|
|
839
|
-
}), p =
|
|
839
|
+
}), p = Qa(q), v = (q == null ? void 0 : q.display_template) ?? null, { data: W = [], isLoading: M } = te({
|
|
840
840
|
queryKey: ["cbv-filter-options", n, p, v ?? "", N, K],
|
|
841
841
|
queryFn: () => {
|
|
842
842
|
const P = Un(v, p), I = !!x && x.length > 0, U = {
|
|
@@ -847,7 +847,7 @@ function Gi({
|
|
|
847
847
|
return N ? U.search = N : I && (U.filter = JSON.stringify({ id: { _in: x.slice(0, 500) } })), w.request(G(`/items/${n}`, U)).then(
|
|
848
848
|
(he) => (he.data ?? []).map((j) => ({
|
|
849
849
|
value: j.id,
|
|
850
|
-
label: (v ?
|
|
850
|
+
label: (v ? Ua(v, j) : "") || String(j[p] ?? j.id ?? "")
|
|
851
851
|
})).filter((j) => j.value != null && j.label !== "")
|
|
852
852
|
);
|
|
853
853
|
},
|
|
@@ -867,7 +867,7 @@ function Gi({
|
|
|
867
867
|
).then(
|
|
868
868
|
(I) => (I.data ?? []).map((U) => ({
|
|
869
869
|
value: U.id,
|
|
870
|
-
label: (v ?
|
|
870
|
+
label: (v ? Ua(v, U) : "") || String(U[p] ?? U.id ?? "")
|
|
871
871
|
}))
|
|
872
872
|
);
|
|
873
873
|
},
|
|
@@ -879,7 +879,7 @@ function Gi({
|
|
|
879
879
|
...R.filter((P) => !W.some((I) => String(I.value) === String(P.value)))
|
|
880
880
|
] : W;
|
|
881
881
|
return /* @__PURE__ */ t(
|
|
882
|
-
|
|
882
|
+
Ya,
|
|
883
883
|
{
|
|
884
884
|
block: !0,
|
|
885
885
|
label: i ?? "All",
|
|
@@ -908,7 +908,7 @@ function Xi({
|
|
|
908
908
|
retry: !1
|
|
909
909
|
});
|
|
910
910
|
return /* @__PURE__ */ t(
|
|
911
|
-
|
|
911
|
+
Ya,
|
|
912
912
|
{
|
|
913
913
|
block: !0,
|
|
914
914
|
label: "All",
|
|
@@ -944,7 +944,7 @@ function Zi({
|
|
|
944
944
|
var v;
|
|
945
945
|
if (!n) return "All";
|
|
946
946
|
const p = Qn(n);
|
|
947
|
-
return p ? fo(p) : ((v =
|
|
947
|
+
return p ? fo(p) : ((v = Va.find((W) => W.value === n)) == null ? void 0 : v.label) ?? n;
|
|
948
948
|
})(), [A, K] = y("between");
|
|
949
949
|
be(() => {
|
|
950
950
|
var p;
|
|
@@ -978,12 +978,12 @@ function Zi({
|
|
|
978
978
|
children: "✕"
|
|
979
979
|
}
|
|
980
980
|
),
|
|
981
|
-
/* @__PURE__ */ t(
|
|
981
|
+
/* @__PURE__ */ t(va, { "aria-hidden": !0, className: "h-3 w-3 shrink-0 text-slate-400" })
|
|
982
982
|
]
|
|
983
983
|
}
|
|
984
984
|
),
|
|
985
985
|
f && /* @__PURE__ */ c("div", { className: "nvr-pop-in absolute left-0 top-full z-50 mt-1 w-56 overflow-hidden rounded-lg border border-slate-200 bg-white text-left shadow-lg dark:border-slate-700 dark:bg-slate-900", children: [
|
|
986
|
-
/* @__PURE__ */ t("div", { className: "p-1", children:
|
|
986
|
+
/* @__PURE__ */ t("div", { className: "p-1", children: Va.map((p) => /* @__PURE__ */ t(
|
|
987
987
|
"button",
|
|
988
988
|
{
|
|
989
989
|
type: "button",
|
|
@@ -1082,7 +1082,7 @@ function ed({
|
|
|
1082
1082
|
title: `Pre-selected from your default ${n.label} scope — adjust freely`
|
|
1083
1083
|
} : null;
|
|
1084
1084
|
return /* @__PURE__ */ t(
|
|
1085
|
-
|
|
1085
|
+
Ya,
|
|
1086
1086
|
{
|
|
1087
1087
|
label: n.label,
|
|
1088
1088
|
options: K,
|
|
@@ -1103,7 +1103,7 @@ const zl = [
|
|
|
1103
1103
|
{ value: "_gte", label: "≥" },
|
|
1104
1104
|
{ value: "_lt", label: "<" },
|
|
1105
1105
|
{ value: "_lte", label: "≤" }
|
|
1106
|
-
],
|
|
1106
|
+
], Va = [
|
|
1107
1107
|
{ value: "", label: "All" },
|
|
1108
1108
|
{ value: "today", label: "Today" },
|
|
1109
1109
|
{ value: "7d", label: "7 days" },
|
|
@@ -1243,7 +1243,7 @@ function Jn({
|
|
|
1243
1243
|
return /* @__PURE__ */ t("div", { className: "px-3 py-1.5", style: { paddingLeft: `${0.5 + i}rem` }, children: /* @__PURE__ */ t("span", { className: "inline-block h-3 w-20 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }) });
|
|
1244
1244
|
const K = i < 2;
|
|
1245
1245
|
return /* @__PURE__ */ t(ze, { children: S.fields.filter((q) => !q.hidden && (!x || q.field.includes(x))).map((q) => {
|
|
1246
|
-
const p = K ? Ue(S.relations, n, q.field) : void 0, v = K && w ?
|
|
1246
|
+
const p = K ? Ue(S.relations, n, q.field) : void 0, v = K && w ? ka(S.relations, n, q.field) : void 0, W = (p == null ? void 0 : p.one_collection) ?? null, M = N.has(q.field);
|
|
1247
1247
|
return /* @__PURE__ */ c("div", { children: [
|
|
1248
1248
|
/* @__PURE__ */ c(
|
|
1249
1249
|
"button",
|
|
@@ -1356,14 +1356,14 @@ function rd({
|
|
|
1356
1356
|
if ($.hidden) continue;
|
|
1357
1357
|
const R = Ue(S.relations, n, $.field);
|
|
1358
1358
|
R != null && R.one_collection && !mt(R.one_collection) && k.add(R.one_collection);
|
|
1359
|
-
const V =
|
|
1359
|
+
const V = ka(S.relations, n, $.field);
|
|
1360
1360
|
if (V) {
|
|
1361
1361
|
const P = V.relation.many_collection;
|
|
1362
1362
|
P && !mt(P) && k.add(P);
|
|
1363
1363
|
}
|
|
1364
1364
|
}
|
|
1365
1365
|
return [...k].slice(0, 12);
|
|
1366
|
-
}, [S, n]), A =
|
|
1366
|
+
}, [S, n]), A = Ba({
|
|
1367
1367
|
queries: N.map((k) => ({
|
|
1368
1368
|
queryKey: ["cbv-collection-meta", k],
|
|
1369
1369
|
queryFn: () => C.request(G(`/collections/${k}`)).then(($) => $.data),
|
|
@@ -1383,7 +1383,7 @@ function rd({
|
|
|
1383
1383
|
const q = o.trim().toLowerCase(), p = (k) => !q || k.toLowerCase().includes(q) || k.toLowerCase().replace(/ /g, "_").includes(q), v = [];
|
|
1384
1384
|
for (const k of S.fields) {
|
|
1385
1385
|
if (k.hidden) continue;
|
|
1386
|
-
const $ = Re(k.field), R = Ue(S.relations, n, k.field), V =
|
|
1386
|
+
const $ = Re(k.field), R = Ue(S.relations, n, k.field), V = ka(S.relations, n, k.field), P = [...i, k.field], I = [...f, $];
|
|
1387
1387
|
if (R != null && R.one_collection && !mt(R.one_collection))
|
|
1388
1388
|
p($) && v.push({
|
|
1389
1389
|
key: k.field,
|
|
@@ -1491,7 +1491,7 @@ function ld({
|
|
|
1491
1491
|
queryFn: () => x.request(G(`/collections/${n}`)).then((v) => v.data),
|
|
1492
1492
|
staleTime: 10 * 6e4,
|
|
1493
1493
|
retry: !1
|
|
1494
|
-
}), S =
|
|
1494
|
+
}), S = Qa(C), N = (C == null ? void 0 : C.display_template) ?? null, { data: A = [], isLoading: K } = te({
|
|
1495
1495
|
queryKey: ["cbv-filter-options", n, S, N ?? ""],
|
|
1496
1496
|
queryFn: () => {
|
|
1497
1497
|
const v = Un(N, S);
|
|
@@ -1500,7 +1500,7 @@ function ld({
|
|
|
1500
1500
|
).then(
|
|
1501
1501
|
(W) => (W.data ?? []).map((M) => ({
|
|
1502
1502
|
value: M.id,
|
|
1503
|
-
label: (N ?
|
|
1503
|
+
label: (N ? Ua(N, M) : "") || String(M[S] ?? M.id ?? "")
|
|
1504
1504
|
})).filter((M) => M.value != null && M.label !== "")
|
|
1505
1505
|
);
|
|
1506
1506
|
},
|
|
@@ -1562,7 +1562,7 @@ function sd(n) {
|
|
|
1562
1562
|
return { field: i, op: "between", value: `${x} – ${w}` };
|
|
1563
1563
|
}
|
|
1564
1564
|
if (n.op === "_preset") {
|
|
1565
|
-
const x = ((f =
|
|
1565
|
+
const x = ((f = Va.find((w) => w.value === n.value)) == null ? void 0 : f.label) ?? String(n.value);
|
|
1566
1566
|
return { field: i, op: "in the", value: `${x} (rolling)` };
|
|
1567
1567
|
}
|
|
1568
1568
|
return (o = n.path[0]) != null && o.startsWith("$has_") || n.path[0] === "$missing_required" ? { field: i, op: "", value: "" } : { field: i, op: nd(n.op).toLowerCase(), value: String(n.value ?? "") };
|
|
@@ -1856,7 +1856,7 @@ function od({
|
|
|
1856
1856
|
},
|
|
1857
1857
|
h.op
|
|
1858
1858
|
)) }) : Q === "date" ? /* @__PURE__ */ c("div", { className: "space-y-2 p-3", children: [
|
|
1859
|
-
/* @__PURE__ */ t("div", { className: "flex flex-wrap gap-1", children:
|
|
1859
|
+
/* @__PURE__ */ t("div", { className: "flex flex-wrap gap-1", children: Va.filter((h) => h.value).map((h) => /* @__PURE__ */ t(
|
|
1860
1860
|
"button",
|
|
1861
1861
|
{
|
|
1862
1862
|
type: "button",
|
|
@@ -1990,7 +1990,7 @@ function id({
|
|
|
1990
1990
|
}) {
|
|
1991
1991
|
const [o, x] = y(/* @__PURE__ */ new Set()), w = (_, C) => f(_, C);
|
|
1992
1992
|
return /* @__PURE__ */ t("div", { className: "max-h-56 overflow-y-auto", children: i.fields.filter((_) => !_.hidden).map((_) => {
|
|
1993
|
-
const C = Ue(i.relations, n, _.field), S =
|
|
1993
|
+
const C = Ue(i.relations, n, _.field), S = ka(i.relations, n, _.field);
|
|
1994
1994
|
if (!(C != null && C.one_collection) && !S) return null;
|
|
1995
1995
|
const N = o.has(_.field);
|
|
1996
1996
|
return /* @__PURE__ */ c("div", { children: [
|
|
@@ -2413,7 +2413,7 @@ function ud({
|
|
|
2413
2413
|
type: "button",
|
|
2414
2414
|
"aria-label": `Delete recipe ${g.name}`,
|
|
2415
2415
|
onClick: () => {
|
|
2416
|
-
window.confirm(`Delete the recipe "${g.name}"?`) && N.request(
|
|
2416
|
+
window.confirm(`Delete the recipe "${g.name}"?`) && N.request(za(`/bulk-recipes/${g.id}`)).then(
|
|
2417
2417
|
() => A.invalidateQueries({ queryKey: ["bulk-recipes", n] })
|
|
2418
2418
|
);
|
|
2419
2419
|
},
|
|
@@ -2687,7 +2687,7 @@ function vc({
|
|
|
2687
2687
|
className: q
|
|
2688
2688
|
}) {
|
|
2689
2689
|
var dl, cl, ul, pl, ml, bl, hl, fl, gl, xl, vl;
|
|
2690
|
-
const p = Ge(), v = Vn(), { open: W, urlFor: M } = Kl(), [k, $] = y(1), R = ie(_o()), [V, P] = y(w), I = Nl(V.trim(), 350), [U, he] = y(_ ?? []), [j, xe] = y(o ?? ""), [st, Te] = y(f ?? null), [_e, ve] = y({}), [Pe, g] = y({}), [Q, ne] = y(null), [H, h] = y({}), [z, X] = y({}), [Me, xt] = y({}), [je, vt] = y({}), [
|
|
2690
|
+
const p = Ge(), v = Vn(), { open: W, urlFor: M } = Kl(), [k, $] = y(1), R = ie(_o()), [V, P] = y(w), I = Nl(V.trim(), 350), [U, he] = y(_ ?? []), [j, xe] = y(o ?? ""), [st, Te] = y(f ?? null), [_e, ve] = y({}), [Pe, g] = y({}), [Q, ne] = y(null), [H, h] = y({}), [z, X] = y({}), [Me, xt] = y({}), [je, vt] = y({}), [ya, kt] = y(null), [ra, yt] = y(!1), Xe = ie(null), [wt, _t] = y({}), [Et, Nt] = y({}), [Rt, la] = y(C ?? []), { scopes: bt, ready: sa } = Vo(), [St, oa] = y(!1), [wa, _a] = y(/* @__PURE__ */ new Set()), [Oe, Pt] = y({}), Ze = oo("drill.browser"), b = Ze.value, [F, Z] = y(null), [se, Ce] = y(!1), [De, Na] = y(() => {
|
|
2691
2691
|
try {
|
|
2692
2692
|
return localStorage.getItem("nvr_table_density") === "comfortable" ? "comfortable" : "compact";
|
|
2693
2693
|
} catch {
|
|
@@ -2695,7 +2695,7 @@ function vc({
|
|
|
2695
2695
|
}
|
|
2696
2696
|
}), Ul = () => {
|
|
2697
2697
|
const e = De === "compact" ? "comfortable" : "compact";
|
|
2698
|
-
|
|
2698
|
+
Na(e);
|
|
2699
2699
|
try {
|
|
2700
2700
|
localStorage.setItem("nvr_table_density", e);
|
|
2701
2701
|
} catch {
|
|
@@ -2706,13 +2706,13 @@ function vc({
|
|
|
2706
2706
|
} catch {
|
|
2707
2707
|
return null;
|
|
2708
2708
|
}
|
|
2709
|
-
}), [
|
|
2710
|
-
Vl(e), Zn(/* @__PURE__ */ new Set()),
|
|
2709
|
+
}), [Ha, Ja] = y(!1), Gn = ie(null), [Xn, Zn] = y(/* @__PURE__ */ new Set()), Ga = (e) => {
|
|
2710
|
+
Vl(e), Zn(/* @__PURE__ */ new Set()), Ja(!1), $(1);
|
|
2711
2711
|
try {
|
|
2712
2712
|
e ? localStorage.setItem(`nvr_cbv_group_${n}`, e) : localStorage.removeItem(`nvr_cbv_group_${n}`);
|
|
2713
2713
|
} catch {
|
|
2714
2714
|
}
|
|
2715
|
-
}, [er,
|
|
2715
|
+
}, [er, Xa] = y(!1), [ia, Za] = y(""), [Ae, tr] = y(null), Kt = lt({
|
|
2716
2716
|
mutationFn: (e) => p.request(de("/ai/query", { collection: n, prompt: e, limit: 200 })),
|
|
2717
2717
|
onSuccess: (e) => {
|
|
2718
2718
|
var a;
|
|
@@ -2728,12 +2728,12 @@ function vc({
|
|
|
2728
2728
|
a === 503 ? pe.error("AI is not configured — add an Anthropic API key in Settings.") : pe.error(r ?? "Could not answer that question");
|
|
2729
2729
|
}
|
|
2730
2730
|
}), Yl = () => {
|
|
2731
|
-
tr(null),
|
|
2731
|
+
tr(null), Za("");
|
|
2732
2732
|
}, ar = ie(!1);
|
|
2733
2733
|
be(() => {
|
|
2734
|
-
!N || ar.current || (ar.current = !0,
|
|
2734
|
+
!N || ar.current || (ar.current = !0, Xa(!0), Za(N), Kt.mutate(N));
|
|
2735
2735
|
}, [N]);
|
|
2736
|
-
const [re, Ct] = y(null), [
|
|
2736
|
+
const [re, Ct] = y(null), [en, nr] = y([]);
|
|
2737
2737
|
be(() => {
|
|
2738
2738
|
if (!re) return;
|
|
2739
2739
|
const e = () => Ct(null);
|
|
@@ -2743,18 +2743,18 @@ function vc({
|
|
|
2743
2743
|
}, [re]);
|
|
2744
2744
|
const [Mt, Bt] = y([]);
|
|
2745
2745
|
uo();
|
|
2746
|
-
const [zt,
|
|
2746
|
+
const [zt, Sa] = y(null), [Hl, tn] = y(!1), [Ot, an] = y(""), [nn, rr] = y(!1), [Jl, lr] = y(!1), [rn, Wt] = y(!1), sr = ie(null);
|
|
2747
2747
|
be(() => {
|
|
2748
|
-
if (!
|
|
2748
|
+
if (!rn) return;
|
|
2749
2749
|
const e = (a) => {
|
|
2750
2750
|
var r;
|
|
2751
2751
|
(r = sr.current) != null && r.contains(a.target) || Wt(!1);
|
|
2752
2752
|
};
|
|
2753
2753
|
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
2754
|
-
}, [
|
|
2755
|
-
const or = ie(null), ir = ie(null),
|
|
2754
|
+
}, [rn]);
|
|
2755
|
+
const or = ie(null), ir = ie(null), ln = ie(!1), { isAdmin: Qt } = Wn(), dr = ie(n);
|
|
2756
2756
|
be(() => {
|
|
2757
|
-
dr.current !== n && (dr.current = n, $(1), P(w), he([]), xe(o ?? ""), Te(f ?? null), ve({}), g({}), h({}), X({}), Bt([]),
|
|
2757
|
+
dr.current !== n && (dr.current = n, $(1), P(w), he([]), xe(o ?? ""), Te(f ?? null), ve({}), g({}), h({}), X({}), Bt([]), Sa(null), _t({}), Nt({}), Pt({}), la([]), b != null && b.length && Ze.back(b.length), Z(null), ln.current = !1);
|
|
2758
2758
|
}, [n]), be(() => {
|
|
2759
2759
|
if (!se) return;
|
|
2760
2760
|
const e = (a) => {
|
|
@@ -2763,13 +2763,13 @@ function vc({
|
|
|
2763
2763
|
};
|
|
2764
2764
|
return window.addEventListener("mousedown", e), () => window.removeEventListener("mousedown", e);
|
|
2765
2765
|
}, [se]), be(() => {
|
|
2766
|
-
if (!
|
|
2766
|
+
if (!Ha) return;
|
|
2767
2767
|
const e = (a) => {
|
|
2768
2768
|
var r;
|
|
2769
|
-
(r = Gn.current) != null && r.contains(a.target) ||
|
|
2769
|
+
(r = Gn.current) != null && r.contains(a.target) || Ja(!1);
|
|
2770
2770
|
};
|
|
2771
2771
|
return window.addEventListener("mousedown", e), () => window.removeEventListener("mousedown", e);
|
|
2772
|
-
}, [
|
|
2772
|
+
}, [Ha]);
|
|
2773
2773
|
const { data: O } = te({
|
|
2774
2774
|
queryKey: ["cbv-collection-meta", n],
|
|
2775
2775
|
queryFn: () => p.request(G(`/collections/${n}`)).then((e) => e.data),
|
|
@@ -2779,12 +2779,12 @@ function vc({
|
|
|
2779
2779
|
be(() => {
|
|
2780
2780
|
cr.current || !O || (cr.current = !0, !o && !j && $e.default_sort && xe($e.default_sort));
|
|
2781
2781
|
}, [O]);
|
|
2782
|
-
const qt = $e.checkbox_selection !== !1, ur = $e.show_actions !== !1, Ca = K && $e.allow_create !== !1, $a = Jo(Ca && !(O != null && O.singleton) ? n : null), [
|
|
2782
|
+
const qt = $e.checkbox_selection !== !1, ur = $e.show_actions !== !1, Ca = K && $e.allow_create !== !1, $a = Jo(Ca && !(O != null && O.singleton) ? n : null), [sn, da] = y(!1), [on, qa] = y(null), { steps: dn } = Li(
|
|
2783
2783
|
Ca && !(O != null && O.singleton) ? n : null,
|
|
2784
2784
|
null
|
|
2785
2785
|
), pr = (e) => {
|
|
2786
|
-
e ? W({ collection: n, itemId: "new", layoutSlug: e }) :
|
|
2787
|
-
},
|
|
2786
|
+
e ? W({ collection: n, itemId: "new", layoutSlug: e }) : Zt("new");
|
|
2787
|
+
}, ca = Ci(Ca && !(O != null && O.singleton) ? n : null), Gl = io(), mr = ie(null), [Xl, Zl] = y(null), [br, hr] = y(!1), fr = (e) => {
|
|
2788
2788
|
var a;
|
|
2789
2789
|
Zl(e), (a = mr.current) == null || a.click();
|
|
2790
2790
|
}, es = async (e) => {
|
|
@@ -2800,21 +2800,21 @@ function vc({
|
|
|
2800
2800
|
hr(!1);
|
|
2801
2801
|
}
|
|
2802
2802
|
}
|
|
2803
|
-
}, ts = (e) => Array.isArray(e == null ? void 0 : e.quick_picker) ? e.quick_picker.filter((a) => typeof a == "string") : [],
|
|
2803
|
+
}, ts = (e) => Array.isArray(e == null ? void 0 : e.quick_picker) ? e.quick_picker.filter((a) => typeof a == "string") : [], cn = ie(null), gr = ie(null);
|
|
2804
2804
|
be(() => {
|
|
2805
|
-
if (!
|
|
2805
|
+
if (!sn) return;
|
|
2806
2806
|
const e = (a) => {
|
|
2807
2807
|
var r;
|
|
2808
|
-
(r =
|
|
2808
|
+
(r = cn.current) != null && r.contains(a.target) || da(!1);
|
|
2809
2809
|
};
|
|
2810
2810
|
return window.addEventListener("mousedown", e), () => window.removeEventListener("mousedown", e);
|
|
2811
|
-
}, [
|
|
2811
|
+
}, [sn]);
|
|
2812
2812
|
const dt = $e.page_size && $e.page_size > 0 ? Math.min($e.page_size, 200) : x, Dt = i.length > 0 ? i : $e.quick_filters ?? [];
|
|
2813
2813
|
be(() => {
|
|
2814
|
-
if (St || !
|
|
2814
|
+
if (St || !sa || i.length === 0 && !O) return;
|
|
2815
2815
|
const e = bt, a = Object.values((e == null ? void 0 : e.defaults) ?? {}).some((r) => r.length > 0) || Object.values((e == null ? void 0 : e.restricted) ?? {}).some((r) => r.length > 0);
|
|
2816
2816
|
if (!e || Dt.length === 0 || !a) {
|
|
2817
|
-
|
|
2817
|
+
oa(!0);
|
|
2818
2818
|
return;
|
|
2819
2819
|
}
|
|
2820
2820
|
(async () => {
|
|
@@ -2837,21 +2837,21 @@ function vc({
|
|
|
2837
2837
|
(((m = d[E]) == null ? void 0 : m.length) ?? 0) > 0 || (d[E] = D);
|
|
2838
2838
|
return d;
|
|
2839
2839
|
};
|
|
2840
|
-
_t(l), Nt(l),
|
|
2840
|
+
_t(l), Nt(l), _a(new Set(Object.keys(r)));
|
|
2841
2841
|
}
|
|
2842
|
-
|
|
2842
|
+
oa(!0);
|
|
2843
2843
|
})();
|
|
2844
|
-
}, [St,
|
|
2844
|
+
}, [St, sa, bt, O, Dt]);
|
|
2845
2845
|
const as = (e) => {
|
|
2846
2846
|
const a = Tl(bt, { key: e.key, collection: e.collection }), r = a ? (bt == null ? void 0 : bt.restricted[a.name]) ?? [] : [];
|
|
2847
2847
|
return r.length > 0 ? r : void 0;
|
|
2848
2848
|
}, ct = ge(() => new Map($t.map((e) => [e.field, e])), [$t]), et = (O == null ? void 0 : O.relations) ?? [], le = ge(() => (st ?? $t.slice(0, 7).map((a) => a.field)).filter(
|
|
2849
2849
|
(a) => a.includes(".") || ct.has(a) || a.startsWith("__f:") && !!Pe[a]
|
|
2850
|
-
), [st, $t, ct, Pe]), [
|
|
2851
|
-
() =>
|
|
2852
|
-
[
|
|
2853
|
-
), ot = (e) =>
|
|
2854
|
-
const a = { ...
|
|
2850
|
+
), [st, $t, ct, Pe]), [un, Ta] = y(null), ua = ge(
|
|
2851
|
+
() => un ?? (le[0] ? { [le[0]]: "left" } : {}),
|
|
2852
|
+
[un, le]
|
|
2853
|
+
), ot = (e) => ua[e], ns = (e) => {
|
|
2854
|
+
const a = { ...ua }, r = a[e];
|
|
2855
2855
|
r ? r === "left" ? a[e] = "right" : delete a[e] : a[e] = "left", Ta(a);
|
|
2856
2856
|
}, tt = (e) => _e[e] ?? (e.startsWith("__f:") ? Pe[e] ?? "Formula" : e.includes(".") ? e.split(".").map(Re).join(" › ") : e === "id" ? "ID" : Re(e)), xr = (e, a) => {
|
|
2857
2857
|
var l, s, d;
|
|
@@ -2868,17 +2868,17 @@ function vc({
|
|
|
2868
2868
|
return d == null || d === "" ? "—" : String(d);
|
|
2869
2869
|
});
|
|
2870
2870
|
}, Tt = ge(
|
|
2871
|
-
() => le.filter((e) => !e.includes(".")).map((e) => ({ field: e, info:
|
|
2871
|
+
() => le.filter((e) => !e.includes(".")).map((e) => ({ field: e, info: ka(et, n, e) })).filter(
|
|
2872
2872
|
(e) => !!e.info
|
|
2873
2873
|
),
|
|
2874
2874
|
[le, ct, et, n]
|
|
2875
|
-
),
|
|
2875
|
+
), pn = ge(
|
|
2876
2876
|
() => [
|
|
2877
2877
|
...new Set(Tt.map((e) => e.info.relation.many_collection ?? "").filter(Boolean))
|
|
2878
2878
|
],
|
|
2879
2879
|
[Tt]
|
|
2880
|
-
), vr =
|
|
2881
|
-
queries:
|
|
2880
|
+
), vr = Ba({
|
|
2881
|
+
queries: pn.map((e) => ({
|
|
2882
2882
|
queryKey: ["cbv-collection-meta", e],
|
|
2883
2883
|
queryFn: () => p.request(G(`/collections/${e}`)).then((a) => a.data),
|
|
2884
2884
|
staleTime: 10 * 6e4,
|
|
@@ -2886,11 +2886,11 @@ function vc({
|
|
|
2886
2886
|
}))
|
|
2887
2887
|
}), At = ge(() => {
|
|
2888
2888
|
const e = /* @__PURE__ */ new Map();
|
|
2889
|
-
return
|
|
2889
|
+
return pn.forEach((a, r) => {
|
|
2890
2890
|
var l;
|
|
2891
2891
|
return e.set(a, (l = vr[r]) == null ? void 0 : l.data);
|
|
2892
2892
|
}), e;
|
|
2893
|
-
}, [
|
|
2893
|
+
}, [pn, vr]), mn = ge(
|
|
2894
2894
|
() => [
|
|
2895
2895
|
...new Set(
|
|
2896
2896
|
Tt.filter((e) => e.info.kind === "m2m").map((e) => {
|
|
@@ -2902,8 +2902,8 @@ function vc({
|
|
|
2902
2902
|
)
|
|
2903
2903
|
],
|
|
2904
2904
|
[Tt, At]
|
|
2905
|
-
), kr =
|
|
2906
|
-
queries:
|
|
2905
|
+
), kr = Ba({
|
|
2906
|
+
queries: mn.map((e) => ({
|
|
2907
2907
|
queryKey: ["cbv-collection-meta", e],
|
|
2908
2908
|
queryFn: () => p.request(G(`/collections/${e}`)).then((a) => a.data),
|
|
2909
2909
|
staleTime: 10 * 6e4,
|
|
@@ -2911,21 +2911,21 @@ function vc({
|
|
|
2911
2911
|
}))
|
|
2912
2912
|
}), yr = ge(() => {
|
|
2913
2913
|
const e = /* @__PURE__ */ new Map();
|
|
2914
|
-
return
|
|
2914
|
+
return mn.forEach((a, r) => {
|
|
2915
2915
|
var l;
|
|
2916
2916
|
return e.set(a, (l = kr[r]) == null ? void 0 : l.data);
|
|
2917
2917
|
}), e;
|
|
2918
|
-
}, [
|
|
2918
|
+
}, [mn, kr]), Ie = ge(() => {
|
|
2919
2919
|
const e = {};
|
|
2920
2920
|
for (const a of Tt) {
|
|
2921
2921
|
const r = a.info.relation.many_collection ?? "";
|
|
2922
2922
|
if (a.info.kind === "o2m")
|
|
2923
|
-
e[a.field] = `${a.field}.${
|
|
2923
|
+
e[a.field] = `${a.field}.${Qa(At.get(r))}`;
|
|
2924
2924
|
else {
|
|
2925
2925
|
const l = At.get(r), s = l == null ? void 0 : l.relations.find(
|
|
2926
2926
|
(m) => m.many_collection === r && m.many_field === a.info.relation.junction_field
|
|
2927
2927
|
), d = (s == null ? void 0 : s.one_collection) ?? "";
|
|
2928
|
-
e[a.field] = `${a.field}.${
|
|
2928
|
+
e[a.field] = `${a.field}.${Qa(d ? yr.get(d) : void 0)}`;
|
|
2929
2929
|
}
|
|
2930
2930
|
}
|
|
2931
2931
|
return e;
|
|
@@ -2941,7 +2941,7 @@ function vc({
|
|
|
2941
2941
|
s != null && s.one_collection && (e[a.field] = { kind: "m2m", target: s.one_collection });
|
|
2942
2942
|
}
|
|
2943
2943
|
return e;
|
|
2944
|
-
}, [Tt, At]), wr = Nl(Oe, 350), [La, os] = y(!1), [_r, is] = y(null),
|
|
2944
|
+
}, [Tt, At]), wr = Nl(Oe, 350), [La, os] = y(!1), [_r, is] = y(null), pa = bi(n, _r), [it, Nr] = y(null), { data: ma } = ui(n), [It, Sr] = y([]), ke = ge(() => {
|
|
2945
2945
|
var a;
|
|
2946
2946
|
const e = Ol(U);
|
|
2947
2947
|
for (const r of Dt) {
|
|
@@ -2985,14 +2985,14 @@ function vc({
|
|
|
2985
2985
|
}
|
|
2986
2986
|
}
|
|
2987
2987
|
for (const r of Rt) e.push({ path: r.path, op: r.op, value: r.value });
|
|
2988
|
-
for (const r of
|
|
2988
|
+
for (const r of en)
|
|
2989
2989
|
e.push({
|
|
2990
2990
|
or: [
|
|
2991
2991
|
{ path: r.path, op: r.op, value: r.value },
|
|
2992
2992
|
{ path: r.path, op: "_null", value: !0 }
|
|
2993
2993
|
]
|
|
2994
2994
|
});
|
|
2995
|
-
return La && e.push({ path: ["$addendums"], op: "_eq", value: "active" }),
|
|
2995
|
+
return La && e.push({ path: ["$addendums"], op: "_eq", value: "active" }), pa.condition && e.push(pa.condition), It.length === 1 ? e.push({ path: ["$at_risk"], op: "_eq", value: It[0] }) : It.length > 1 && e.push({
|
|
2996
2996
|
or: It.map((r) => ({ path: ["$at_risk"], op: "_eq", value: r }))
|
|
2997
2997
|
}), e.length > 0 ? JSON.stringify(e) : void 0;
|
|
2998
2998
|
}, [
|
|
@@ -3001,11 +3001,11 @@ function vc({
|
|
|
3001
3001
|
Et,
|
|
3002
3002
|
wr,
|
|
3003
3003
|
Rt,
|
|
3004
|
-
|
|
3004
|
+
en,
|
|
3005
3005
|
La,
|
|
3006
|
-
|
|
3006
|
+
pa.condition,
|
|
3007
3007
|
It
|
|
3008
|
-
]),
|
|
3008
|
+
]), Ut = ge(() => {
|
|
3009
3009
|
const e = ((O == null ? void 0 : O.fields) ?? []).map((s) => s.field), a = e.find((s) => /^(latitude|lat)$/i.test(s)) ?? null, r = e.find((s) => /^(longitude|lng|long|lon)$/i.test(s)) ?? null;
|
|
3010
3010
|
if (!a || !r) return null;
|
|
3011
3011
|
const l = e.find((s) => ["name", "title", "label", "short_name"].includes(s.toLowerCase())) ?? null;
|
|
@@ -3014,7 +3014,7 @@ function vc({
|
|
|
3014
3014
|
be(() => {
|
|
3015
3015
|
qr.current !== ke && (qr.current = ke, $(1));
|
|
3016
3016
|
}, [ke]);
|
|
3017
|
-
const
|
|
3017
|
+
const ba = Object.keys(z).filter((e) => !e.includes(".") && !e.startsWith("__")).sort().join(","), Tr = (e) => [
|
|
3018
3018
|
"cbv-items",
|
|
3019
3019
|
n,
|
|
3020
3020
|
I,
|
|
@@ -3022,13 +3022,13 @@ function vc({
|
|
|
3022
3022
|
ce ? "grouped" : e,
|
|
3023
3023
|
ce ? 500 : dt,
|
|
3024
3024
|
ke,
|
|
3025
|
-
|
|
3025
|
+
ba
|
|
3026
3026
|
], Lr = async (e) => {
|
|
3027
3027
|
const a = {
|
|
3028
3028
|
limit: ce ? 500 : dt,
|
|
3029
3029
|
...I ? { search: I } : {},
|
|
3030
3030
|
...ke ? { conditions: ke } : {},
|
|
3031
|
-
...
|
|
3031
|
+
...ba ? { agg: ba } : {},
|
|
3032
3032
|
// #2443 — the total may be a few seconds old (shown as "about"); rows are always fresh.
|
|
3033
3033
|
count: "approx"
|
|
3034
3034
|
}, r = (m) => p.request(
|
|
@@ -3041,7 +3041,7 @@ function vc({
|
|
|
3041
3041
|
j,
|
|
3042
3042
|
dt,
|
|
3043
3043
|
ke,
|
|
3044
|
-
|
|
3044
|
+
ba
|
|
3045
3045
|
]), s = R.current, d = No(s, l, e, j);
|
|
3046
3046
|
if (d.after === void 0 && d.sort === j) return r(e);
|
|
3047
3047
|
try {
|
|
@@ -3060,10 +3060,10 @@ function vc({
|
|
|
3060
3060
|
}, {
|
|
3061
3061
|
data: qe,
|
|
3062
3062
|
isLoading: Fr,
|
|
3063
|
-
isFetching:
|
|
3063
|
+
isFetching: Vt,
|
|
3064
3064
|
dataUpdatedAt: cs,
|
|
3065
3065
|
refetch: Er,
|
|
3066
|
-
error:
|
|
3066
|
+
error: Yt
|
|
3067
3067
|
} = te({
|
|
3068
3068
|
queryKey: Tr(k),
|
|
3069
3069
|
queryFn: () => Lr(k),
|
|
@@ -3075,16 +3075,16 @@ function vc({
|
|
|
3075
3075
|
});
|
|
3076
3076
|
Io({
|
|
3077
3077
|
qc: v,
|
|
3078
|
-
enabled: !!n && St && !ce && !
|
|
3078
|
+
enabled: !!n && St && !ce && !Vt && !!qe && k * dt < (qe.total ?? 0),
|
|
3079
3079
|
queryKey: Tr(k + 1),
|
|
3080
3080
|
queryFn: () => Lr(k + 1)
|
|
3081
3081
|
});
|
|
3082
|
-
const ye = Ae ? Ae.rows : (qe == null ? void 0 : qe.data) ?? [], Le = Ae ? Ae.total : (qe == null ? void 0 : qe.total) ?? 0, Rr = !Ae && (qe == null ? void 0 : qe.total_approx) === !0,
|
|
3082
|
+
const ye = Ae ? Ae.rows : (qe == null ? void 0 : qe.data) ?? [], Le = Ae ? Ae.total : (qe == null ? void 0 : qe.total) ?? 0, Rr = !Ae && (qe == null ? void 0 : qe.total_approx) === !0, bn = qe == null ? void 0 : qe.aggregates, Ea = Math.max(1, Math.ceil(Le / dt)), Pr = ie(Date.now()), Ra = ie(null);
|
|
3083
3083
|
be(() => {
|
|
3084
3084
|
Pr.current = Date.now();
|
|
3085
3085
|
}, [n, I]), be(() => {
|
|
3086
3086
|
var a, r;
|
|
3087
|
-
if (!n || I.length < 2 || !qe ||
|
|
3087
|
+
if (!n || I.length < 2 || !qe || Vt || Ae) return;
|
|
3088
3088
|
const e = `${n}\0${I}`;
|
|
3089
3089
|
((a = Ra.current) == null ? void 0 : a.key) !== e && (Ra.current = {
|
|
3090
3090
|
key: e,
|
|
@@ -3096,7 +3096,7 @@ function vc({
|
|
|
3096
3096
|
duration_ms: Date.now() - Pr.current
|
|
3097
3097
|
})
|
|
3098
3098
|
});
|
|
3099
|
-
}, [p, n, I, qe,
|
|
3099
|
+
}, [p, n, I, qe, Vt, Ae]), Xo(
|
|
3100
3100
|
n ? {
|
|
3101
3101
|
list: {
|
|
3102
3102
|
collection: n,
|
|
@@ -3113,8 +3113,8 @@ function vc({
|
|
|
3113
3113
|
}
|
|
3114
3114
|
} : null
|
|
3115
3115
|
);
|
|
3116
|
-
const us = Zo(), Mr = co(
|
|
3117
|
-
|
|
3116
|
+
const us = Zo(), Mr = co(Vt), hn = Bo(), { userId: fn } = Wn(), ut = To(), gn = ie(/* @__PURE__ */ new Set());
|
|
3117
|
+
gn.current = new Set(ye.map((e) => String(e.id)));
|
|
3118
3118
|
const ps = ge(
|
|
3119
3119
|
() => ye.slice(0, 100).map((e) => ({ collection: n, item: String(e.id) })),
|
|
3120
3120
|
[ye, n]
|
|
@@ -3127,7 +3127,7 @@ function vc({
|
|
|
3127
3127
|
ce ? "grouped" : k,
|
|
3128
3128
|
ce ? 500 : dt,
|
|
3129
3129
|
ke,
|
|
3130
|
-
|
|
3130
|
+
ba
|
|
3131
3131
|
];
|
|
3132
3132
|
const Ar = ie({
|
|
3133
3133
|
conditions: ke,
|
|
@@ -3141,14 +3141,14 @@ function vc({
|
|
|
3141
3141
|
page: k,
|
|
3142
3142
|
grouped: !!ce
|
|
3143
3143
|
};
|
|
3144
|
-
const
|
|
3144
|
+
const xn = ie({}).current, [ms, bs] = y(0), [vn, kn] = y(0);
|
|
3145
3145
|
be(() => {
|
|
3146
|
-
if (!
|
|
3147
|
-
const e = (B = 1) =>
|
|
3146
|
+
if (!hn || !n) return;
|
|
3147
|
+
const e = (B = 1) => kn((L) => L + B), a = /* @__PURE__ */ new Map();
|
|
3148
3148
|
let r = null;
|
|
3149
3149
|
const l = (B) => {
|
|
3150
3150
|
const L = (u) => a.set(JSON.stringify(u), u);
|
|
3151
|
-
B.includes(
|
|
3151
|
+
B.includes(aa.tasks) && L(["cbv-task-counts", n]), B.includes(aa.addendums) && L(["cbv-addendum-summary", n]), B.includes(aa.integrations) && L(["cbv-integrations-summary", n]), B.includes(aa.comments) && L(["row-comment-counts", n]), B.includes(aa.state) && (L(["cbv-pipeline-instances", n]), L(["cbv-owners", n]), L(["cbv-view-count", n])), B.includes(aa.lock) && bs((u) => u + 1), !r && (r = setTimeout(() => {
|
|
3152
3152
|
r = null;
|
|
3153
3153
|
for (const u of a.values()) v.invalidateQueries({ queryKey: u });
|
|
3154
3154
|
a.clear();
|
|
@@ -3181,9 +3181,9 @@ function vc({
|
|
|
3181
3181
|
});
|
|
3182
3182
|
}
|
|
3183
3183
|
u && e();
|
|
3184
|
-
const Ye =
|
|
3184
|
+
const Ye = gn.current, Be = (Y) => Ao(n, Y.item), pt = (Y) => {
|
|
3185
3185
|
const oe = Mo(Y);
|
|
3186
|
-
return oe &&
|
|
3186
|
+
return oe && fn && oe.toUpperCase() === fn.toUpperCase() ? "self" : oe;
|
|
3187
3187
|
}, He = [];
|
|
3188
3188
|
for (const [Y, oe] of L)
|
|
3189
3189
|
oe.action === "delete" && (Ye.has(Y) ? He.push(Y) : e(), L.delete(Y));
|
|
@@ -3215,7 +3215,7 @@ function vc({
|
|
|
3215
3215
|
const Ee = ee == null ? void 0 : ee.data;
|
|
3216
3216
|
Ee && (s((nt) => ({
|
|
3217
3217
|
...nt,
|
|
3218
|
-
data: nt.data.map((
|
|
3218
|
+
data: nt.data.map((xa) => String(xa.id) === Y ? { ...xa, ...Ee } : xa)
|
|
3219
3219
|
})), Be(oe) || ut.note([Y], pt(Ee)));
|
|
3220
3220
|
}).catch(() => e());
|
|
3221
3221
|
}
|
|
@@ -3253,20 +3253,20 @@ function vc({
|
|
|
3253
3253
|
for (const L of B.flatMap((u) => qo(u))) {
|
|
3254
3254
|
const u = L.changed_fields;
|
|
3255
3255
|
if (!L.action && (u != null && u.length) && u.every((Ye) => Ye.startsWith("$"))) {
|
|
3256
|
-
(String(L.item) === "*" ||
|
|
3256
|
+
(String(L.item) === "*" || gn.current.has(String(L.item))) && l(u);
|
|
3257
3257
|
continue;
|
|
3258
3258
|
}
|
|
3259
3259
|
d.push(L);
|
|
3260
3260
|
}
|
|
3261
3261
|
d.length > 0 && !m && (m = setTimeout(() => void me(), 300));
|
|
3262
|
-
}, ae =
|
|
3262
|
+
}, ae = hn.subscribeCollections(
|
|
3263
3263
|
[n],
|
|
3264
|
-
(B) => ko(
|
|
3264
|
+
(B) => ko(xn, [B], J)
|
|
3265
3265
|
);
|
|
3266
3266
|
return () => {
|
|
3267
|
-
D = !0, ae(), yo(
|
|
3267
|
+
D = !0, ae(), yo(xn), r && clearTimeout(r), m && clearTimeout(m), E && clearTimeout(E);
|
|
3268
3268
|
};
|
|
3269
|
-
}, [
|
|
3269
|
+
}, [hn, n, v, p, fn, ut, xn]);
|
|
3270
3270
|
const hs = Lo(
|
|
3271
3271
|
n,
|
|
3272
3272
|
ye.map((e) => String(e.id)),
|
|
@@ -3292,12 +3292,12 @@ function vc({
|
|
|
3292
3292
|
enabled: !!n && Ir.length > 0 && ye.length > 0,
|
|
3293
3293
|
staleTime: 3e4,
|
|
3294
3294
|
retry: !1
|
|
3295
|
-
}), Ne = ye.map((e) => String(e.id)).join(","),
|
|
3295
|
+
}), Ne = ye.map((e) => String(e.id)).join(","), yn = !!(O != null && O.addendums_enabled), { data: wn } = te({
|
|
3296
3296
|
queryKey: ["cbv-addendum-summary", n, Ne],
|
|
3297
3297
|
queryFn: () => p.request(
|
|
3298
3298
|
de("/addendums/summary", { collection: n, ids: Ne.split(",") })
|
|
3299
3299
|
).then((e) => e.data ?? {}),
|
|
3300
|
-
enabled: !!n &&
|
|
3300
|
+
enabled: !!n && yn && Ne.length > 0,
|
|
3301
3301
|
placeholderData: (e) => e,
|
|
3302
3302
|
staleTime: 3e4,
|
|
3303
3303
|
retry: !1
|
|
@@ -3307,7 +3307,7 @@ function vc({
|
|
|
3307
3307
|
enabled: !!n && !n.startsWith("nivaro_"),
|
|
3308
3308
|
staleTime: 5 * 6e4,
|
|
3309
3309
|
retry: !1
|
|
3310
|
-
}), { data:
|
|
3310
|
+
}), { data: _n } = te({
|
|
3311
3311
|
queryKey: ["cbv-task-counts", n, Ne],
|
|
3312
3312
|
queryFn: () => p.request(
|
|
3313
3313
|
de("/tasks/counts", { collection: n, ids: Ne.split(",") })
|
|
@@ -3316,7 +3316,7 @@ function vc({
|
|
|
3316
3316
|
placeholderData: (e) => e,
|
|
3317
3317
|
staleTime: 3e4,
|
|
3318
3318
|
retry: !1
|
|
3319
|
-
}), { data:
|
|
3319
|
+
}), { data: Nn } = te({
|
|
3320
3320
|
queryKey: ["cbv-unseen", n, Ne],
|
|
3321
3321
|
queryFn: () => p.request(de("/record-views/unseen", { collection: n, ids: Ne.split(",") })).then((e) => e.data ?? {}).catch(
|
|
3322
3322
|
() => ({})
|
|
@@ -3330,7 +3330,7 @@ function vc({
|
|
|
3330
3330
|
queryFn: () => p.request(G("/integration-obligations/collections")).then((e) => e.data ?? []).catch(() => []),
|
|
3331
3331
|
staleTime: 6e4,
|
|
3332
3332
|
retry: !1
|
|
3333
|
-
}), Kr = xs.includes(n), { data:
|
|
3333
|
+
}), Kr = xs.includes(n), { data: Sn } = te({
|
|
3334
3334
|
queryKey: ["cbv-integrations-summary", n, Ne],
|
|
3335
3335
|
queryFn: () => p.request(
|
|
3336
3336
|
de("/integration-obligations/summary", { collection: n, ids: Ne.split(",") })
|
|
@@ -3348,10 +3348,10 @@ function vc({
|
|
|
3348
3348
|
placeholderData: (e) => e,
|
|
3349
3349
|
staleTime: 3e4,
|
|
3350
3350
|
retry: !1
|
|
3351
|
-
}),
|
|
3352
|
-
queryKey: ["cbv-pipeline-template",
|
|
3353
|
-
queryFn: () => p.request(G(`/pipelines/${
|
|
3354
|
-
enabled: !!
|
|
3351
|
+
}), Pa = (ul = fe == null ? void 0 : fe.binding) == null ? void 0 : ul.template, { data: Ht } = te({
|
|
3352
|
+
queryKey: ["cbv-pipeline-template", Pa, Qt ? "full" : "outline"],
|
|
3353
|
+
queryFn: () => p.request(G(Qt ? `/pipelines/${Pa}` : `/pipelines/${Pa}/outline`)).then((e) => e.data),
|
|
3354
|
+
enabled: !!Pa,
|
|
3355
3355
|
retry: !1
|
|
3356
3356
|
}), vs = !!(fe != null && fe.binding), { data: Cn } = te({
|
|
3357
3357
|
queryKey: ["cbv-owners", n, Ne],
|
|
@@ -3369,21 +3369,21 @@ function vc({
|
|
|
3369
3369
|
), zr = ge(
|
|
3370
3370
|
() => le.filter((e) => e.startsWith("__f:")).flatMap((e) => vo(Pe[e] ?? "")).filter((e) => e.includes(".")),
|
|
3371
3371
|
[le, Pe]
|
|
3372
|
-
),
|
|
3372
|
+
), ha = ge(
|
|
3373
3373
|
() => [.../* @__PURE__ */ new Set([...Br, ...Object.values(Ie), ...zr])].slice(
|
|
3374
3374
|
0,
|
|
3375
3375
|
20
|
|
3376
3376
|
),
|
|
3377
3377
|
[Br, Ie, zr]
|
|
3378
3378
|
), Wr = ye.map((e) => String(e.id)).join(","), { data: ue } = te({
|
|
3379
|
-
queryKey: ["cbv-resolved", n, Wr,
|
|
3379
|
+
queryKey: ["cbv-resolved", n, Wr, ha.join(",")],
|
|
3380
3380
|
queryFn: () => p.request(
|
|
3381
3381
|
G(`/items/${n}/resolve-paths`, {
|
|
3382
3382
|
ids: Wr,
|
|
3383
|
-
paths:
|
|
3383
|
+
paths: ha.join(",")
|
|
3384
3384
|
})
|
|
3385
3385
|
).then((e) => e.data ?? { rows: {}, targets: {} }),
|
|
3386
|
-
enabled: ye.length > 0 &&
|
|
3386
|
+
enabled: ye.length > 0 && ha.length > 0,
|
|
3387
3387
|
staleTime: 3e4,
|
|
3388
3388
|
retry: !1
|
|
3389
3389
|
}), at = (e, a) => {
|
|
@@ -3402,7 +3402,7 @@ function vc({
|
|
|
3402
3402
|
if (!r) return null;
|
|
3403
3403
|
const l = (d = ue == null ? void 0 : ue.targets) == null ? void 0 : d[r], s = ((D = (E = (m = ue == null ? void 0 : ue.rows) == null ? void 0 : m[String(e)]) == null ? void 0 : E[r]) == null ? void 0 : D.ids) ?? [];
|
|
3404
3404
|
return !l || mt(l) || s.length === 0 ? null : { target: l, id: String(s[0]) };
|
|
3405
|
-
}, Lt = (e) => e.includes(".") || e in Ie,
|
|
3405
|
+
}, Lt = (e) => e.includes(".") || e in Ie, Jt = (e) => {
|
|
3406
3406
|
if (e.includes(".")) return { kind: "text", path: e.split(".") };
|
|
3407
3407
|
const a = Ue(et, n, e);
|
|
3408
3408
|
if (a != null && a.one_collection)
|
|
@@ -3428,7 +3428,7 @@ function vc({
|
|
|
3428
3428
|
Se("__state__", { kind: "state", value: [.../* @__PURE__ */ new Set([...B, J.state_key])] });
|
|
3429
3429
|
return;
|
|
3430
3430
|
}
|
|
3431
|
-
const d =
|
|
3431
|
+
const d = Jt(a);
|
|
3432
3432
|
if (d) {
|
|
3433
3433
|
if (d.kind === "in") {
|
|
3434
3434
|
const ae = Ue(et, n, a) ? r[a] != null ? [r[a]] : [] : ((me = (D = (E = ue == null ? void 0 : ue.rows) == null ? void 0 : E[String(s)]) == null ? void 0 : D[Ie[a]]) == null ? void 0 : me.ids) ?? [];
|
|
@@ -3465,10 +3465,10 @@ function vc({
|
|
|
3465
3465
|
}
|
|
3466
3466
|
}, ws = (e, a) => {
|
|
3467
3467
|
if (e === "__state__") return !1;
|
|
3468
|
-
const r =
|
|
3468
|
+
const r = Jt(e);
|
|
3469
3469
|
return r ? r.kind === "in" ? !!Ue(et, n, e) && a[e] != null : r.kind === "enum" || r.kind === "num" ? a[e] != null && a[e] !== "" : r.kind === "text" : !1;
|
|
3470
3470
|
}, _s = (e) => {
|
|
3471
|
-
const { key: a, row: r, cellText: l } = e, s = r.id, d =
|
|
3471
|
+
const { key: a, row: r, cellText: l } = e, s = r.id, d = Jt(a);
|
|
3472
3472
|
if (!d) return;
|
|
3473
3473
|
let m = null;
|
|
3474
3474
|
const E = `${a}:${Date.now().toString(36)}`;
|
|
@@ -3483,7 +3483,7 @@ function vc({
|
|
|
3483
3483
|
m && nr((D) => [...D, m]);
|
|
3484
3484
|
}, Ns = (e) => {
|
|
3485
3485
|
var l, s, d;
|
|
3486
|
-
const a =
|
|
3486
|
+
const a = Jt(e);
|
|
3487
3487
|
if (!a) return null;
|
|
3488
3488
|
const r = Oe[e];
|
|
3489
3489
|
if (a.kind === "in") {
|
|
@@ -3531,7 +3531,7 @@ function vc({
|
|
|
3531
3531
|
const m = (r == null ? void 0 : r.kind) === "num" ? r.op : "_eq", E = (r == null ? void 0 : r.kind) === "num" ? r.value : "";
|
|
3532
3532
|
return /* @__PURE__ */ c("span", { className: "flex items-center gap-0.5", children: [
|
|
3533
3533
|
/* @__PURE__ */ t(
|
|
3534
|
-
|
|
3534
|
+
na,
|
|
3535
3535
|
{
|
|
3536
3536
|
value: m,
|
|
3537
3537
|
onChange: (D) => Se(e, { kind: "num", op: D, value: E }),
|
|
@@ -3552,7 +3552,7 @@ function vc({
|
|
|
3552
3552
|
] });
|
|
3553
3553
|
}
|
|
3554
3554
|
return a.kind === "bool" ? /* @__PURE__ */ t(
|
|
3555
|
-
|
|
3555
|
+
na,
|
|
3556
3556
|
{
|
|
3557
3557
|
value: (r == null ? void 0 : r.kind) === "bool" ? r.value : "",
|
|
3558
3558
|
onChange: (m) => Se(e, m ? { kind: "bool", value: m } : null),
|
|
@@ -3571,13 +3571,13 @@ function vc({
|
|
|
3571
3571
|
onChange: (m) => Se(e, m ? { kind: "date", value: m } : null)
|
|
3572
3572
|
}
|
|
3573
3573
|
) : null;
|
|
3574
|
-
}, Ss = le.some((e) =>
|
|
3574
|
+
}, Ss = le.some((e) => Jt(e) != null), Ur = (e) => {
|
|
3575
3575
|
var r, l;
|
|
3576
3576
|
if (((r = H[e]) == null ? void 0 : r.type) === "number") return !0;
|
|
3577
3577
|
if (e.includes(".") || e in Ie || Ue(et, n, e)) return !1;
|
|
3578
3578
|
const a = (l = ct.get(e)) == null ? void 0 : l.type;
|
|
3579
3579
|
return a === "integer" || a === "decimal" || a === "float";
|
|
3580
|
-
},
|
|
3580
|
+
}, Gt = (e, a, r) => {
|
|
3581
3581
|
var s, d, m;
|
|
3582
3582
|
const l = H[a];
|
|
3583
3583
|
if ((l == null ? void 0 : l.type) === "count") {
|
|
@@ -3592,7 +3592,7 @@ function vc({
|
|
|
3592
3592
|
queryKey: ["cbv-views", n],
|
|
3593
3593
|
queryFn: () => p.request(G("/saved-views", { collection: n })).then((e) => e.data ?? []),
|
|
3594
3594
|
staleTime: 3e4
|
|
3595
|
-
}),
|
|
3595
|
+
}), Xt = () => v.invalidateQueries({ queryKey: ["cbv-views", n] }), Cs = Ba({
|
|
3596
3596
|
queries: Ve.slice(0, 12).map((e) => {
|
|
3597
3597
|
const a = Ol(e.filters ?? []);
|
|
3598
3598
|
return {
|
|
@@ -3616,12 +3616,12 @@ function vc({
|
|
|
3616
3616
|
});
|
|
3617
3617
|
const [Yr, $s] = y(() => /* @__PURE__ */ new Set()), qn = (e) => {
|
|
3618
3618
|
var a, r;
|
|
3619
|
-
if (
|
|
3619
|
+
if (Sa(e.id), he(e.filters ?? []), xe(e.sort ?? ""), (a = e.columns) != null && a.length) {
|
|
3620
3620
|
const l = new Set(
|
|
3621
3621
|
e.columns.filter((u) => typeof u != "string" && u.admin_only).map(Rl)
|
|
3622
3622
|
);
|
|
3623
3623
|
$s(l);
|
|
3624
|
-
const s = e.columns.map(Rl).filter((u) =>
|
|
3624
|
+
const s = e.columns.map(Rl).filter((u) => Qt || !l.has(u)), d = {};
|
|
3625
3625
|
for (const u of e.columns)
|
|
3626
3626
|
typeof u != "string" && u.formula && u.key.startsWith("__f:") && (d[u.key] = u.formula);
|
|
3627
3627
|
g(d);
|
|
@@ -3642,13 +3642,13 @@ function vc({
|
|
|
3642
3642
|
qn(e);
|
|
3643
3643
|
return;
|
|
3644
3644
|
}
|
|
3645
|
-
|
|
3646
|
-
},
|
|
3645
|
+
Sa(null), he([]), xe(o ?? ""), Te(f ?? null), ve({}), g({}), h({}), X({}), Ta(null), $(1);
|
|
3646
|
+
}, Ma = () => ({
|
|
3647
3647
|
filters: U,
|
|
3648
3648
|
sort: j,
|
|
3649
3649
|
columns: [
|
|
3650
3650
|
...le.map((e, a) => {
|
|
3651
|
-
const r = _e[e], l = H[e], s =
|
|
3651
|
+
const r = _e[e], l = H[e], s = ua[e] ?? (a === 0 && un !== null ? "none" : void 0), d = je[e], m = Me[e], E = z[e], D = Pe[e];
|
|
3652
3652
|
return !r && !l && !s && !(d != null && d.length) && !m && !E && !D && !Yr.has(e) ? e : {
|
|
3653
3653
|
key: e,
|
|
3654
3654
|
...D ? { formula: D } : {},
|
|
@@ -3673,12 +3673,12 @@ function vc({
|
|
|
3673
3673
|
"__integrations__",
|
|
3674
3674
|
"__tasks__",
|
|
3675
3675
|
"__actions__"
|
|
3676
|
-
].filter((e) =>
|
|
3676
|
+
].filter((e) => ua[e]).map((e) => ({ key: e, pin: ua[e] }))
|
|
3677
3677
|
]
|
|
3678
3678
|
});
|
|
3679
3679
|
be(() => {
|
|
3680
|
-
if (
|
|
3681
|
-
|
|
3680
|
+
if (ln.current || Ve.length === 0 || $t.length === 0) return;
|
|
3681
|
+
ln.current = !0;
|
|
3682
3682
|
const e = Ve.find((a) => a.role_default) ?? Ve.find((a) => a.is_default);
|
|
3683
3683
|
e && zt == null && qn(e);
|
|
3684
3684
|
}, [Ve, $t]);
|
|
@@ -3688,11 +3688,11 @@ function vc({
|
|
|
3688
3688
|
G("/export-presets", { collection: n })
|
|
3689
3689
|
).then((e) => e.data ?? []),
|
|
3690
3690
|
staleTime: 6e4
|
|
3691
|
-
}), [
|
|
3692
|
-
|
|
3691
|
+
}), [Oa, Gr] = y(""), Xr = async () => {
|
|
3692
|
+
Oa.trim() && (await p.request(
|
|
3693
3693
|
de("/export-presets", {
|
|
3694
3694
|
collection: n,
|
|
3695
|
-
name:
|
|
3695
|
+
name: Oa.trim(),
|
|
3696
3696
|
config: {
|
|
3697
3697
|
format: "xlsx",
|
|
3698
3698
|
columns: le.map((e) => ({ key: e, label: tt(e) }))
|
|
@@ -3713,60 +3713,60 @@ function vc({
|
|
|
3713
3713
|
).then(() => pe.info(`Exporting “${a}” in the background — follow it in the Jobs tray`)).catch(
|
|
3714
3714
|
(r) => pe.error(r instanceof Error ? r.message : "Could not start the export")
|
|
3715
3715
|
);
|
|
3716
|
-
},
|
|
3716
|
+
}, Da = lt({
|
|
3717
3717
|
mutationFn: () => p.request(
|
|
3718
|
-
de("/saved-views", { collection: n, name: Ot.trim(), ...
|
|
3718
|
+
de("/saved-views", { collection: n, name: Ot.trim(), ...Ma() })
|
|
3719
3719
|
),
|
|
3720
3720
|
onSuccess: (e) => {
|
|
3721
|
-
|
|
3721
|
+
tn(!1), an(""), Sa(e.data.id), Xt();
|
|
3722
3722
|
}
|
|
3723
3723
|
}), [Tn, Zr] = y(null), ht = lt({
|
|
3724
|
-
mutationFn: (e) => p.request(
|
|
3724
|
+
mutationFn: (e) => p.request(ja(`/saved-views/${e}`, Ma())),
|
|
3725
3725
|
onSuccess: (e, a) => {
|
|
3726
3726
|
var l;
|
|
3727
|
-
|
|
3727
|
+
Xt(), Zr(a), setTimeout(() => Zr((s) => s === a ? null : s), 2e3);
|
|
3728
3728
|
const r = (l = Ve.find((s) => s.id === a)) == null ? void 0 : l.name;
|
|
3729
3729
|
pe.success(r ? `Saved "${r}" with the current columns and filters` : "View saved");
|
|
3730
3730
|
},
|
|
3731
3731
|
onError: (e) => pe.error(`Could not save the view: ${e.message}`)
|
|
3732
3732
|
}), Ls = lt({
|
|
3733
|
-
mutationFn: ({ id: e, on: a }) => p.request(
|
|
3734
|
-
onSuccess:
|
|
3733
|
+
mutationFn: ({ id: e, on: a }) => p.request(ja(`/saved-views/${e}`, { is_default: a })),
|
|
3734
|
+
onSuccess: Xt
|
|
3735
3735
|
}), Fs = lt({
|
|
3736
|
-
mutationFn: ({ id: e, role: a }) => p.request(
|
|
3737
|
-
onSuccess:
|
|
3736
|
+
mutationFn: ({ id: e, role: a }) => p.request(ja(`/saved-views/${e}`, { default_for_role: a })),
|
|
3737
|
+
onSuccess: Xt,
|
|
3738
3738
|
onError: (e) => pe.error(`Could not set the role default: ${e.message}`)
|
|
3739
3739
|
}), el = lt({
|
|
3740
3740
|
mutationFn: () => {
|
|
3741
3741
|
const e = Ve.find((a) => a.is_default);
|
|
3742
|
-
return e ? p.request(
|
|
3743
|
-
de("/saved-views", { collection: n, name: "Default", is_default: !0, ...
|
|
3742
|
+
return e ? p.request(ja(`/saved-views/${e.id}`, { ...Ma(), is_default: !0 })) : p.request(
|
|
3743
|
+
de("/saved-views", { collection: n, name: "Default", is_default: !0, ...Ma() })
|
|
3744
3744
|
);
|
|
3745
3745
|
},
|
|
3746
3746
|
onSuccess: () => {
|
|
3747
|
-
Ce(!1),
|
|
3747
|
+
Ce(!1), Xt();
|
|
3748
3748
|
}
|
|
3749
3749
|
}), tl = lt({
|
|
3750
|
-
mutationFn: (e) => p.request(
|
|
3750
|
+
mutationFn: (e) => p.request(za(`/items/${n}/${e}`)),
|
|
3751
3751
|
onSuccess: () => void v.invalidateQueries({ queryKey: ["cbv-items", n] })
|
|
3752
3752
|
}), Es = lt({
|
|
3753
|
-
mutationFn: (e) => p.request(
|
|
3753
|
+
mutationFn: (e) => p.request(za(`/saved-views/${e}`)),
|
|
3754
3754
|
onSuccess: (e, a) => {
|
|
3755
|
-
zt === a && Hr(),
|
|
3755
|
+
zt === a && Hr(), Xt();
|
|
3756
3756
|
}
|
|
3757
3757
|
}), { data: Rs = [] } = te({
|
|
3758
3758
|
queryKey: ["cbv-view-subs"],
|
|
3759
3759
|
queryFn: () => p.request(G("/view-subscriptions")).then((e) => e.data ?? []).catch(() => []),
|
|
3760
3760
|
staleTime: 6e4
|
|
3761
|
-
}),
|
|
3761
|
+
}), Aa = (e) => Rs.find((a) => a.view_id === e), Ps = lt({
|
|
3762
3762
|
mutationFn: async (e) => {
|
|
3763
|
-
const a =
|
|
3764
|
-
return a ? p.request(
|
|
3763
|
+
const a = Aa(e);
|
|
3764
|
+
return a ? p.request(za(`/view-subscriptions/${a.id}`)) : p.request(de("/view-subscriptions", { view_id: e, digest: "daily" }));
|
|
3765
3765
|
},
|
|
3766
3766
|
onSuccess: () => v.invalidateQueries({ queryKey: ["cbv-view-subs"] })
|
|
3767
3767
|
}), Ms = async () => {
|
|
3768
3768
|
var e;
|
|
3769
|
-
if (!
|
|
3769
|
+
if (!nn) {
|
|
3770
3770
|
rr(!0);
|
|
3771
3771
|
try {
|
|
3772
3772
|
const a = await p.request(
|
|
@@ -3778,12 +3778,12 @@ function vc({
|
|
|
3778
3778
|
})
|
|
3779
3779
|
).then((B) => B.data ?? []), r = le;
|
|
3780
3780
|
let l = {};
|
|
3781
|
-
if (
|
|
3781
|
+
if (ha.length > 0)
|
|
3782
3782
|
try {
|
|
3783
3783
|
l = await p.request(
|
|
3784
3784
|
G(`/items/${n}/resolve-paths`, {
|
|
3785
3785
|
ids: a.slice(0, 500).map((B) => String(B.id)).join(","),
|
|
3786
|
-
paths:
|
|
3786
|
+
paths: ha.join(",")
|
|
3787
3787
|
})
|
|
3788
3788
|
).then((B) => {
|
|
3789
3789
|
var L;
|
|
@@ -3804,14 +3804,14 @@ function vc({
|
|
|
3804
3804
|
const gt = ft.includes(".") ? (T = (jt = l[String(B.id)]) == null ? void 0 : jt[ft]) == null ? void 0 : T.value : B[ft];
|
|
3805
3805
|
return typeof gt == "string" && /^-?\d+(\.\d+)?$/.test(gt.trim()) ? Number(gt) : gt;
|
|
3806
3806
|
}) : null;
|
|
3807
|
-
return Fe == null ? "" : u ?
|
|
3807
|
+
return Fe == null ? "" : u ? ta(String(Fe), u) : Math.round(Fe * 100) / 100;
|
|
3808
3808
|
}
|
|
3809
3809
|
if (L.includes(".") || L in Ie) {
|
|
3810
3810
|
const He = L.includes(".") ? L : Ie[L], Fe = ((pt = (Be = l[String(B.id)]) == null ? void 0 : Be[He]) == null ? void 0 : pt.value) ?? "";
|
|
3811
3811
|
return u && Fe ? Cl(Fe, u) : Fe;
|
|
3812
3812
|
}
|
|
3813
3813
|
const Ye = B[L];
|
|
3814
|
-
return u && Ye != null ?
|
|
3814
|
+
return u && Ye != null ? ta(String(Ye), u) : Ye;
|
|
3815
3815
|
}, m = [
|
|
3816
3816
|
["id", ...r.map((B) => tt(B))].map(s).join(","),
|
|
3817
3817
|
...a.map((B) => [B.id, ...r.map((L) => d(B, L))].map(s).join(","))
|
|
@@ -3840,7 +3840,7 @@ function vc({
|
|
|
3840
3840
|
Ln.current && clearTimeout(Ln.current), Ln.current = setTimeout(() => {
|
|
3841
3841
|
jo(v, p, n, String(e));
|
|
3842
3842
|
}, 250);
|
|
3843
|
-
},
|
|
3843
|
+
}, Zt = (e) => {
|
|
3844
3844
|
var a;
|
|
3845
3845
|
((a = Ra.current) == null ? void 0 : a.key) === `${n}\0${I}` && Uo(p, Ra.current.id, {
|
|
3846
3846
|
type: "record",
|
|
@@ -3869,12 +3869,12 @@ function vc({
|
|
|
3869
3869
|
r(e);
|
|
3870
3870
|
}, Fn = ye.length > 0 && ye.every((e) => Mt.includes(e.id)), As = () => Bt(
|
|
3871
3871
|
Fn ? Mt.filter((e) => !ye.some((a) => a.id === e)) : [.../* @__PURE__ */ new Set([...Mt, ...ye.map((e) => e.id)])]
|
|
3872
|
-
), Is = (e) => Bt((a) => a.includes(e) ? a.filter((r) => r !== e) : [...a, e]),
|
|
3872
|
+
), Is = (e) => Bt((a) => a.includes(e) ? a.filter((r) => r !== e) : [...a, e]), Ia = 2e3, [al, nl] = y(!1), js = async () => {
|
|
3873
3873
|
nl(!0);
|
|
3874
3874
|
try {
|
|
3875
3875
|
const e = await p.request(
|
|
3876
3876
|
G(`/items/${n}`, {
|
|
3877
|
-
limit:
|
|
3877
|
+
limit: Ia,
|
|
3878
3878
|
fields: "id",
|
|
3879
3879
|
...I ? { search: I } : {},
|
|
3880
3880
|
...ke ? { conditions: ke } : {}
|
|
@@ -3884,11 +3884,11 @@ function vc({
|
|
|
3884
3884
|
} finally {
|
|
3885
3885
|
nl(!1);
|
|
3886
3886
|
}
|
|
3887
|
-
}, Ks = Le === 0 ? 0 : (k - 1) * dt + 1, Bs = Math.min(k * dt, Le),
|
|
3887
|
+
}, Ks = Le === 0 ? 0 : (k - 1) * dt + 1, Bs = Math.min(k * dt, Le), fa = !!(fe != null && fe.instances), En = (qt ? 1 : 0) + (fa ? 2 : 0) + (ur ? 1 : 0), Rn = [
|
|
3888
3888
|
...le.map(
|
|
3889
3889
|
(e) => e.startsWith("__f:") ? { key: e, kind: "formula" } : { key: e, kind: "data" }
|
|
3890
3890
|
),
|
|
3891
|
-
...
|
|
3891
|
+
...fa ? [
|
|
3892
3892
|
{ key: "__state__", kind: "state" },
|
|
3893
3893
|
// When the record entered its current state, and how long it has
|
|
3894
3894
|
// sat there (the queue's Last State Change and Aging).
|
|
@@ -3896,17 +3896,17 @@ function vc({
|
|
|
3896
3896
|
{ key: "__aging__", kind: "aging" },
|
|
3897
3897
|
{ key: "__owners__", kind: "owners" }
|
|
3898
3898
|
] : [],
|
|
3899
|
-
...
|
|
3899
|
+
...yn ? [{ key: "__addendums__", kind: "addendums" }] : [],
|
|
3900
3900
|
...Ke ? [{ key: "__fulfilment__", kind: "fulfilment" }] : [],
|
|
3901
3901
|
...Kr ? [{ key: "__integrations__", kind: "integrations" }] : [],
|
|
3902
3902
|
...jr ? [{ key: "__tasks__", kind: "tasks" }] : [],
|
|
3903
3903
|
...ur ? [{ key: "__actions__", kind: "actions" }] : []
|
|
3904
|
-
],
|
|
3904
|
+
], ea = [
|
|
3905
3905
|
...Rn.filter((e) => ot(e.key) === "left"),
|
|
3906
3906
|
...Rn.filter((e) => !ot(e.key)),
|
|
3907
3907
|
...Rn.filter((e) => ot(e.key) === "right")
|
|
3908
3908
|
], rl = [
|
|
3909
|
-
...
|
|
3909
|
+
...fa ? [{ key: "__state__", label: "State" }] : [],
|
|
3910
3910
|
...le.filter((e) => Lt(e) || !Ue(et, n, e)).map((e) => ({ key: e, label: tt(e) }))
|
|
3911
3911
|
], zs = (e) => {
|
|
3912
3912
|
var l;
|
|
@@ -3918,7 +3918,7 @@ function vc({
|
|
|
3918
3918
|
}
|
|
3919
3919
|
if (Lt(ce)) return at(a, ce) || "(empty)";
|
|
3920
3920
|
const r = e[ce];
|
|
3921
|
-
return r == null || r === "" ? "(empty)" : typeof r == "boolean" ? r ? "Yes" : "No" :
|
|
3921
|
+
return r == null || r === "" ? "(empty)" : typeof r == "boolean" ? r ? "Yes" : "No" : Gt(String(r), ce) || String(r);
|
|
3922
3922
|
}, Ws = (() => {
|
|
3923
3923
|
if (!ce) return ye.map((l) => ({ kind: "row", row: l }));
|
|
3924
3924
|
const e = /* @__PURE__ */ new Map();
|
|
@@ -3932,31 +3932,31 @@ function vc({
|
|
|
3932
3932
|
if (r.push({ kind: "header", gkey: l, label: l, count: s.length }), !Xn.has(l)) for (const d of s) r.push({ kind: "row", row: d });
|
|
3933
3933
|
}
|
|
3934
3934
|
return r;
|
|
3935
|
-
})(), Pn =
|
|
3935
|
+
})(), Pn = ea.filter((e) => ot(e.key) === "left").map((e) => e.key), ll = ea.filter((e) => ot(e.key) === "right").map((e) => e.key), Mn = ie(/* @__PURE__ */ new Map()), [ga, Qs] = y({});
|
|
3936
3936
|
so(() => {
|
|
3937
3937
|
const e = {};
|
|
3938
3938
|
for (const [r, l] of Mn.current)
|
|
3939
3939
|
l != null && l.isConnected && (e[r] = l.getBoundingClientRect().width);
|
|
3940
|
-
const a = /* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(
|
|
3940
|
+
const a = /* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(ga)]);
|
|
3941
3941
|
for (const r of a)
|
|
3942
|
-
if (Math.abs((e[r] ?? -1) - (
|
|
3942
|
+
if (Math.abs((e[r] ?? -1) - (ga[r] ?? -1)) > 0.5) {
|
|
3943
3943
|
Qs(e);
|
|
3944
3944
|
return;
|
|
3945
3945
|
}
|
|
3946
3946
|
});
|
|
3947
3947
|
const Us = 52, sl = (e) => {
|
|
3948
3948
|
if (ot(e) === "left") {
|
|
3949
|
-
let l = qt ?
|
|
3949
|
+
let l = qt ? ga.__checkbox__ ?? Us : 0;
|
|
3950
3950
|
for (const s of Pn) {
|
|
3951
3951
|
if (s === e) break;
|
|
3952
|
-
l +=
|
|
3952
|
+
l += ga[s] ?? 0;
|
|
3953
3953
|
}
|
|
3954
3954
|
return Math.floor(l);
|
|
3955
3955
|
}
|
|
3956
3956
|
let r = 0;
|
|
3957
3957
|
for (const l of [...ll].reverse()) {
|
|
3958
3958
|
if (l === e) break;
|
|
3959
|
-
r +=
|
|
3959
|
+
r += ga[l] ?? 0;
|
|
3960
3960
|
}
|
|
3961
3961
|
return Math.floor(r);
|
|
3962
3962
|
}, We = (e, a, r) => {
|
|
@@ -3991,7 +3991,7 @@ function vc({
|
|
|
3991
3991
|
const Vs = (e) => {
|
|
3992
3992
|
let a = tt(e).length;
|
|
3993
3993
|
for (const r of ye) {
|
|
3994
|
-
const l = Lt(e) ? at(r.id, e) ?? "" :
|
|
3994
|
+
const l = Lt(e) ? at(r.id, e) ?? "" : Gt(String(r[e] ?? ""), e, r.id);
|
|
3995
3995
|
l.length > a && (a = Math.min(l.length, 90));
|
|
3996
3996
|
}
|
|
3997
3997
|
xt((r) => ({ ...r, [e]: Math.max(60, Math.round(a * 6.6) + 28) }));
|
|
@@ -4110,7 +4110,7 @@ function vc({
|
|
|
4110
4110
|
className: "nvr-pop-in w-56 overflow-hidden rounded-lg border border-slate-200 bg-white py-1 shadow-xl dark:border-slate-700 dark:bg-slate-900",
|
|
4111
4111
|
onMouseDown: (e) => e.stopPropagation(),
|
|
4112
4112
|
children: [
|
|
4113
|
-
(re.key === "__state__" ||
|
|
4113
|
+
(re.key === "__state__" || Jt(re.key)) && re.cellText && re.cellText !== "—" && /* @__PURE__ */ c(
|
|
4114
4114
|
"button",
|
|
4115
4115
|
{
|
|
4116
4116
|
type: "button",
|
|
@@ -4143,7 +4143,7 @@ function vc({
|
|
|
4143
4143
|
{
|
|
4144
4144
|
type: "button",
|
|
4145
4145
|
onClick: () => {
|
|
4146
|
-
|
|
4146
|
+
Ga(re.key), Ct(null);
|
|
4147
4147
|
},
|
|
4148
4148
|
className: "block w-full truncate px-3 py-1.5 text-left text-[12px] text-slate-700 hover:bg-slate-50 dark:text-slate-200 dark:hover:bg-slate-800",
|
|
4149
4149
|
children: [
|
|
@@ -4157,7 +4157,7 @@ function vc({
|
|
|
4157
4157
|
[
|
|
4158
4158
|
{
|
|
4159
4159
|
label: "Open",
|
|
4160
|
-
run: () =>
|
|
4160
|
+
run: () => Zt(re.row.id)
|
|
4161
4161
|
},
|
|
4162
4162
|
{
|
|
4163
4163
|
label: "Open in new tab",
|
|
@@ -4245,7 +4245,7 @@ function vc({
|
|
|
4245
4245
|
}
|
|
4246
4246
|
}
|
|
4247
4247
|
),
|
|
4248
|
-
|
|
4248
|
+
yn && /* @__PURE__ */ c(
|
|
4249
4249
|
"button",
|
|
4250
4250
|
{
|
|
4251
4251
|
type: "button",
|
|
@@ -4287,18 +4287,18 @@ function vc({
|
|
|
4287
4287
|
}),
|
|
4288
4288
|
/* @__PURE__ */ t(Pi, { className: "h-8" }),
|
|
4289
4289
|
/* @__PURE__ */ t(yi, {}),
|
|
4290
|
-
|
|
4290
|
+
vn > 0 && /* @__PURE__ */ c(
|
|
4291
4291
|
"button",
|
|
4292
4292
|
{
|
|
4293
4293
|
type: "button",
|
|
4294
4294
|
onClick: () => {
|
|
4295
|
-
|
|
4295
|
+
kn(0), Er();
|
|
4296
4296
|
},
|
|
4297
4297
|
className: "flex h-8 items-center gap-1 rounded-full border border-nvr-cyan/40 bg-nvr-cyan/[0.08] px-2.5 text-[12px] font-medium text-[#007a99] dark:text-nvr-cyan",
|
|
4298
4298
|
children: [
|
|
4299
|
-
|
|
4299
|
+
vn,
|
|
4300
4300
|
" update",
|
|
4301
|
-
|
|
4301
|
+
vn === 1 ? "" : "s",
|
|
4302
4302
|
" · Refresh"
|
|
4303
4303
|
]
|
|
4304
4304
|
}
|
|
@@ -4308,15 +4308,15 @@ function vc({
|
|
|
4308
4308
|
{
|
|
4309
4309
|
type: "button",
|
|
4310
4310
|
onClick: () => {
|
|
4311
|
-
|
|
4311
|
+
kn(0), Er();
|
|
4312
4312
|
},
|
|
4313
4313
|
"aria-label": "Refresh",
|
|
4314
4314
|
title: "Refresh",
|
|
4315
4315
|
className: "flex h-8 w-8 items-center justify-center rounded-md border border-slate-200 text-slate-500 hover:bg-slate-100 hover:text-slate-700 dark:border-slate-700 dark:text-slate-400 dark:hover:bg-slate-800",
|
|
4316
|
-
children: /* @__PURE__ */ t(An, { className: `h-4 w-4 ${
|
|
4316
|
+
children: /* @__PURE__ */ t(An, { className: `h-4 w-4 ${Vt ? "animate-spin" : ""}` })
|
|
4317
4317
|
}
|
|
4318
4318
|
),
|
|
4319
|
-
|
|
4319
|
+
Qt && $e.copy_as !== !1 && /* @__PURE__ */ t(
|
|
4320
4320
|
ci,
|
|
4321
4321
|
{
|
|
4322
4322
|
collection: n,
|
|
@@ -4330,10 +4330,10 @@ function vc({
|
|
|
4330
4330
|
fields: le
|
|
4331
4331
|
}
|
|
4332
4332
|
),
|
|
4333
|
-
|
|
4333
|
+
pa.parent && /* @__PURE__ */ t(
|
|
4334
4334
|
hi,
|
|
4335
4335
|
{
|
|
4336
|
-
parent:
|
|
4336
|
+
parent: pa.parent,
|
|
4337
4337
|
value: _r,
|
|
4338
4338
|
onChange: (e) => {
|
|
4339
4339
|
is(e), $(1);
|
|
@@ -4341,7 +4341,7 @@ function vc({
|
|
|
4341
4341
|
}
|
|
4342
4342
|
),
|
|
4343
4343
|
[
|
|
4344
|
-
...
|
|
4344
|
+
...ma ? [{ key: "tree", label: "Tree", icon: /* @__PURE__ */ t(Gs, { className: "h-3.5 w-3.5" }) }] : [],
|
|
4345
4345
|
...(A ?? []).map((e) => ({ key: e.key, label: e.label, icon: e.icon }))
|
|
4346
4346
|
].map((e) => /* @__PURE__ */ c(
|
|
4347
4347
|
"button",
|
|
@@ -4361,7 +4361,7 @@ function vc({
|
|
|
4361
4361
|
},
|
|
4362
4362
|
e.key
|
|
4363
4363
|
)),
|
|
4364
|
-
|
|
4364
|
+
Ut && /* @__PURE__ */ c(
|
|
4365
4365
|
"button",
|
|
4366
4366
|
{
|
|
4367
4367
|
type: "button",
|
|
@@ -4381,7 +4381,7 @@ function vc({
|
|
|
4381
4381
|
"button",
|
|
4382
4382
|
{
|
|
4383
4383
|
type: "button",
|
|
4384
|
-
onClick: () =>
|
|
4384
|
+
onClick: () => Xa((e) => !e),
|
|
4385
4385
|
title: "Ask the table a question",
|
|
4386
4386
|
className: `flex h-8 items-center gap-1.5 rounded-md border px-2.5 text-[12px] font-medium ${er || Ae ? "border-nvr-cyan/40 bg-nvr-cyan/[0.08] text-[#007a99] dark:text-nvr-cyan" : "border-slate-200 text-slate-500 hover:text-slate-700 dark:border-slate-700 dark:text-slate-400"}`,
|
|
4387
4387
|
children: [
|
|
@@ -4396,10 +4396,10 @@ function vc({
|
|
|
4396
4396
|
"input",
|
|
4397
4397
|
{
|
|
4398
4398
|
autoFocus: !0,
|
|
4399
|
-
value:
|
|
4400
|
-
onChange: (e) =>
|
|
4399
|
+
value: ia,
|
|
4400
|
+
onChange: (e) => Za(e.target.value),
|
|
4401
4401
|
onKeyDown: (e) => {
|
|
4402
|
-
e.key === "Enter" &&
|
|
4402
|
+
e.key === "Enter" && ia.trim() && !Kt.isPending && Kt.mutate(ia.trim()), e.key === "Escape" && Xa(!1);
|
|
4403
4403
|
},
|
|
4404
4404
|
placeholder: 'Ask in plain language — "over 50k in Zone 1 still waiting on approval"',
|
|
4405
4405
|
className: "h-8 flex-1 rounded-md border border-slate-200 bg-white px-3 text-[12.5px] outline-none focus:border-nvr-cyan/50 focus:ring-2 focus:ring-nvr-cyan/30 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-100"
|
|
@@ -4409,14 +4409,14 @@ function vc({
|
|
|
4409
4409
|
"button",
|
|
4410
4410
|
{
|
|
4411
4411
|
type: "button",
|
|
4412
|
-
disabled: !
|
|
4413
|
-
onClick: () => Kt.mutate(
|
|
4412
|
+
disabled: !ia.trim() || Kt.isPending,
|
|
4413
|
+
onClick: () => Kt.mutate(ia.trim()),
|
|
4414
4414
|
className: "flex h-8 items-center gap-1.5 rounded-md bg-nvr-cyan px-3 text-[12px] font-semibold text-white hover:brightness-110 disabled:opacity-40",
|
|
4415
4415
|
children: Kt.isPending ? /* @__PURE__ */ t(An, { className: "h-3.5 w-3.5 animate-spin" }) : "Ask"
|
|
4416
4416
|
}
|
|
4417
4417
|
)
|
|
4418
4418
|
] }),
|
|
4419
|
-
|
|
4419
|
+
en.map((e) => /* @__PURE__ */ c(
|
|
4420
4420
|
"span",
|
|
4421
4421
|
{
|
|
4422
4422
|
className: "order-last inline-flex max-w-full items-center gap-1.5 rounded-full border border-red-200 bg-red-50 py-1 pl-2.5 pr-1.5 text-[12px] text-red-700 dark:border-red-500/40 dark:bg-red-500/10 dark:text-red-300",
|
|
@@ -4466,7 +4466,7 @@ function vc({
|
|
|
4466
4466
|
"button",
|
|
4467
4467
|
{
|
|
4468
4468
|
type: "button",
|
|
4469
|
-
onClick: () =>
|
|
4469
|
+
onClick: () => Ja((e) => !e),
|
|
4470
4470
|
className: `flex h-8 items-center gap-1 rounded-md border px-2.5 text-[12px] font-medium ${ce ? "border-nvr-cyan/40 bg-nvr-cyan/[0.08] text-[#007a99] dark:text-nvr-cyan" : "border-slate-200 text-slate-500 hover:text-slate-700 dark:border-slate-700 dark:text-slate-400"}`,
|
|
4471
4471
|
children: [
|
|
4472
4472
|
/* @__PURE__ */ t(yl, { className: "h-3.5 w-3.5" }),
|
|
@@ -4474,12 +4474,12 @@ function vc({
|
|
|
4474
4474
|
]
|
|
4475
4475
|
}
|
|
4476
4476
|
),
|
|
4477
|
-
|
|
4477
|
+
Ha && /* @__PURE__ */ c("div", { className: "nvr-pop-in absolute right-0 top-full z-50 mt-1 max-h-[360px] w-56 overflow-y-auto rounded-xl border border-slate-200 bg-white p-1.5 shadow-lg dark:border-slate-700 dark:bg-slate-900", children: [
|
|
4478
4478
|
/* @__PURE__ */ t(
|
|
4479
4479
|
"button",
|
|
4480
4480
|
{
|
|
4481
4481
|
type: "button",
|
|
4482
|
-
onClick: () =>
|
|
4482
|
+
onClick: () => Ga(null),
|
|
4483
4483
|
className: `block w-full rounded px-2 py-1.5 text-left text-[12px] ${ce === null ? "bg-nvr-cyan/[0.08] font-semibold text-slate-800 dark:text-slate-100" : "text-slate-600 hover:bg-slate-50 dark:text-slate-300 dark:hover:bg-slate-800"}`,
|
|
4484
4484
|
children: "No grouping"
|
|
4485
4485
|
}
|
|
@@ -4488,7 +4488,7 @@ function vc({
|
|
|
4488
4488
|
"button",
|
|
4489
4489
|
{
|
|
4490
4490
|
type: "button",
|
|
4491
|
-
onClick: () =>
|
|
4491
|
+
onClick: () => Ga(e.key),
|
|
4492
4492
|
className: `block w-full truncate rounded px-2 py-1.5 text-left text-[12px] ${ce === e.key ? "bg-nvr-cyan/[0.08] font-semibold text-slate-800 dark:text-slate-100" : "text-slate-600 hover:bg-slate-50 dark:text-slate-300 dark:hover:bg-slate-800"}`,
|
|
4493
4493
|
children: e.label
|
|
4494
4494
|
},
|
|
@@ -4580,7 +4580,7 @@ function vc({
|
|
|
4580
4580
|
"button",
|
|
4581
4581
|
{
|
|
4582
4582
|
type: "button",
|
|
4583
|
-
onClick: () => kt(
|
|
4583
|
+
onClick: () => kt(ya === e ? null : e),
|
|
4584
4584
|
title: "Format column",
|
|
4585
4585
|
"aria-label": `Format ${e}`,
|
|
4586
4586
|
className: H[e] ? "text-[11px] font-bold text-[#00a5cc]" : "text-[11px] text-slate-300 opacity-0 hover:text-slate-500 group-hover:opacity-100",
|
|
@@ -4615,7 +4615,7 @@ function vc({
|
|
|
4615
4615
|
]
|
|
4616
4616
|
}
|
|
4617
4617
|
),
|
|
4618
|
-
|
|
4618
|
+
ya === e && /* @__PURE__ */ c("div", { className: "mb-1 ml-5 mr-1 rounded-md border border-slate-100 bg-slate-50 p-1.5 dark:border-slate-800 dark:bg-slate-800/60", children: [
|
|
4619
4619
|
/* @__PURE__ */ t("div", { className: "flex flex-wrap gap-1", children: Wi.map((l) => {
|
|
4620
4620
|
const s = JSON.stringify(H[e] ?? null) === JSON.stringify(l.cfg);
|
|
4621
4621
|
return /* @__PURE__ */ t(
|
|
@@ -4660,7 +4660,7 @@ function vc({
|
|
|
4660
4660
|
className: "mb-1 flex items-center gap-1",
|
|
4661
4661
|
children: [
|
|
4662
4662
|
/* @__PURE__ */ t(
|
|
4663
|
-
|
|
4663
|
+
na,
|
|
4664
4664
|
{
|
|
4665
4665
|
ariaLabel: "Rule operator",
|
|
4666
4666
|
value: l.op,
|
|
@@ -4796,16 +4796,16 @@ function vc({
|
|
|
4796
4796
|
] }),
|
|
4797
4797
|
/* @__PURE__ */ c("div", { className: "shrink-0 border-t border-slate-100 p-1.5 dark:border-slate-800", children: [
|
|
4798
4798
|
/* @__PURE__ */ t("p", { className: "px-1.5 pb-1 text-[10.5px] font-semibold uppercase tracking-wide text-slate-400", children: "Presets" }),
|
|
4799
|
-
|
|
4799
|
+
ra ? /* @__PURE__ */ c("div", { className: "flex items-center gap-1.5 px-1.5 pb-0.5", children: [
|
|
4800
4800
|
/* @__PURE__ */ t(
|
|
4801
4801
|
"input",
|
|
4802
4802
|
{
|
|
4803
4803
|
autoFocus: !0,
|
|
4804
4804
|
value: Ot,
|
|
4805
4805
|
placeholder: "Preset name…",
|
|
4806
|
-
onChange: (e) =>
|
|
4806
|
+
onChange: (e) => an(e.target.value),
|
|
4807
4807
|
onKeyDown: (e) => {
|
|
4808
|
-
e.key === "Enter" && Ot.trim() && (
|
|
4808
|
+
e.key === "Enter" && Ot.trim() && (Da.mutate(), yt(!1)), e.key === "Escape" && yt(!1);
|
|
4809
4809
|
},
|
|
4810
4810
|
className: "h-6 w-full min-w-0 flex-1 rounded border border-slate-200 bg-slate-50 px-1.5 text-[11.5px] outline-none focus:border-nvr-cyan/50 dark:border-slate-700 dark:bg-slate-800 dark:text-slate-100"
|
|
4811
4811
|
}
|
|
@@ -4814,9 +4814,9 @@ function vc({
|
|
|
4814
4814
|
"button",
|
|
4815
4815
|
{
|
|
4816
4816
|
type: "button",
|
|
4817
|
-
disabled: !Ot.trim() ||
|
|
4817
|
+
disabled: !Ot.trim() || Da.isPending,
|
|
4818
4818
|
onClick: () => {
|
|
4819
|
-
|
|
4819
|
+
Da.mutate(), yt(!1);
|
|
4820
4820
|
},
|
|
4821
4821
|
className: "text-[11.5px] font-medium text-[#00a5cc] disabled:opacity-40",
|
|
4822
4822
|
children: "Save"
|
|
@@ -4835,7 +4835,7 @@ function vc({
|
|
|
4835
4835
|
]
|
|
4836
4836
|
}
|
|
4837
4837
|
),
|
|
4838
|
-
|
|
4838
|
+
Qt && /* @__PURE__ */ c(
|
|
4839
4839
|
"button",
|
|
4840
4840
|
{
|
|
4841
4841
|
type: "button",
|
|
@@ -4859,12 +4859,12 @@ function vc({
|
|
|
4859
4859
|
{
|
|
4860
4860
|
type: "button",
|
|
4861
4861
|
onClick: () => Wt((e) => !e),
|
|
4862
|
-
disabled:
|
|
4862
|
+
disabled: nn,
|
|
4863
4863
|
className: "h-8 rounded-md border border-slate-200 px-2.5 text-[12px] font-medium text-slate-500 hover:text-slate-700 disabled:opacity-50 dark:border-slate-700 dark:text-slate-400",
|
|
4864
|
-
children:
|
|
4864
|
+
children: nn ? "Exporting…" : "Export"
|
|
4865
4865
|
}
|
|
4866
4866
|
),
|
|
4867
|
-
|
|
4867
|
+
rn && /* @__PURE__ */ c("div", { className: "nvr-pop-in absolute right-0 top-full z-[60] mt-1 w-[240px] rounded-lg border border-slate-200 bg-white p-1 shadow-xl dark:border-border dark:bg-card", children: [
|
|
4868
4868
|
/* @__PURE__ */ t(
|
|
4869
4869
|
"button",
|
|
4870
4870
|
{
|
|
@@ -4885,7 +4885,7 @@ function vc({
|
|
|
4885
4885
|
Wt(!1);
|
|
4886
4886
|
const e = le, a = e.map((s) => tt(s)).join(" "), r = ye.map(
|
|
4887
4887
|
(s) => e.map((d) => {
|
|
4888
|
-
const m = Lt(d) ?
|
|
4888
|
+
const m = Lt(d) ? Gt(at(s.id, d) ?? "", d, s.id) : Gt(String(s[d] ?? ""), d, s.id);
|
|
4889
4889
|
return String(m ?? "").replace(/[\t\n]/g, " ");
|
|
4890
4890
|
}).join(" ")
|
|
4891
4891
|
).join(`
|
|
@@ -4936,7 +4936,7 @@ ${r}`).then(() => {
|
|
|
4936
4936
|
/* @__PURE__ */ t(
|
|
4937
4937
|
"input",
|
|
4938
4938
|
{
|
|
4939
|
-
value:
|
|
4939
|
+
value: Oa,
|
|
4940
4940
|
onChange: (e) => Gr(e.target.value),
|
|
4941
4941
|
onKeyDown: (e) => {
|
|
4942
4942
|
e.key === "Enter" && Xr();
|
|
@@ -4949,7 +4949,7 @@ ${r}`).then(() => {
|
|
|
4949
4949
|
"button",
|
|
4950
4950
|
{
|
|
4951
4951
|
type: "button",
|
|
4952
|
-
disabled: !
|
|
4952
|
+
disabled: !Oa.trim(),
|
|
4953
4953
|
onClick: () => void Xr(),
|
|
4954
4954
|
className: "h-6 shrink-0 rounded bg-nvr-cyan px-2 text-[11px] font-semibold text-white disabled:opacity-40",
|
|
4955
4955
|
children: "Save"
|
|
@@ -4958,27 +4958,27 @@ ${r}`).then(() => {
|
|
|
4958
4958
|
] })
|
|
4959
4959
|
] })
|
|
4960
4960
|
] }),
|
|
4961
|
-
Ca && !(O != null && O.singleton) && ($a ? /* @__PURE__ */ c("div", { className: "relative", "data-cbv-newitem-menu": !0, ref:
|
|
4961
|
+
Ca && !(O != null && O.singleton) && ($a ? /* @__PURE__ */ c("div", { className: "relative", "data-cbv-newitem-menu": !0, ref: cn, children: [
|
|
4962
4962
|
/* @__PURE__ */ c(
|
|
4963
4963
|
"button",
|
|
4964
4964
|
{
|
|
4965
4965
|
type: "button",
|
|
4966
|
-
onClick: () =>
|
|
4966
|
+
onClick: () => da((e) => !e),
|
|
4967
4967
|
className: "flex h-8 items-center gap-1 rounded-md bg-nvr-cyan px-3 text-[12.5px] font-semibold text-white hover:brightness-105",
|
|
4968
4968
|
children: [
|
|
4969
4969
|
"+ New item",
|
|
4970
|
-
/* @__PURE__ */ t(
|
|
4970
|
+
/* @__PURE__ */ t(va, { className: "h-3.5 w-3.5" })
|
|
4971
4971
|
]
|
|
4972
4972
|
}
|
|
4973
4973
|
),
|
|
4974
|
-
|
|
4974
|
+
sn && /* @__PURE__ */ c("div", { className: "nvr-pop-in absolute right-0 top-9 z-[60] w-64 rounded-md border border-slate-200 bg-white p-1 shadow-lg dark:border-border dark:bg-card", children: [
|
|
4975
4975
|
[
|
|
4976
4976
|
{
|
|
4977
4977
|
key: "default",
|
|
4978
4978
|
slug: null,
|
|
4979
4979
|
label: ((pl = $a.active) == null ? void 0 : pl.create_label) ?? ((ml = $a.active) == null ? void 0 : ml.name) ?? "Default layout",
|
|
4980
4980
|
isDefault: !0,
|
|
4981
|
-
steps:
|
|
4981
|
+
steps: dn
|
|
4982
4982
|
},
|
|
4983
4983
|
...$a.options.map((e) => ({
|
|
4984
4984
|
key: String(e.id),
|
|
@@ -4997,7 +4997,7 @@ ${r}`).then(() => {
|
|
|
4997
4997
|
{
|
|
4998
4998
|
type: "button",
|
|
4999
4999
|
onClick: () => {
|
|
5000
|
-
|
|
5000
|
+
da(!1), pr(e.slug);
|
|
5001
5001
|
},
|
|
5002
5002
|
className: "flex min-w-0 flex-1 items-center px-2 py-1.5 text-left text-[12px] text-slate-700 dark:text-slate-200",
|
|
5003
5003
|
children: [
|
|
@@ -5013,7 +5013,7 @@ ${r}`).then(() => {
|
|
|
5013
5013
|
"data-cbv-quick-pick": e.slug ?? "default",
|
|
5014
5014
|
title: "Quick pick — choose the related fields step by step, then open the form prefilled",
|
|
5015
5015
|
onClick: () => {
|
|
5016
|
-
|
|
5016
|
+
da(!1), qa({ slug: e.slug });
|
|
5017
5017
|
},
|
|
5018
5018
|
className: "mr-1 flex h-6 shrink-0 items-center gap-1 rounded px-1.5 text-[11px] font-medium text-slate-400 hover:bg-nvr-cyan/10 hover:text-nvr-navy dark:hover:text-nvr-cyan",
|
|
5019
5019
|
children: [
|
|
@@ -5026,7 +5026,7 @@ ${r}`).then(() => {
|
|
|
5026
5026
|
},
|
|
5027
5027
|
e.key
|
|
5028
5028
|
)),
|
|
5029
|
-
((bl =
|
|
5029
|
+
((bl = ca.data) == null ? void 0 : bl.enabled) && /* @__PURE__ */ c(ze, { children: [
|
|
5030
5030
|
/* @__PURE__ */ t("div", { className: "my-1 border-t border-slate-100 dark:border-border" }),
|
|
5031
5031
|
/* @__PURE__ */ c(
|
|
5032
5032
|
"button",
|
|
@@ -5035,7 +5035,7 @@ ${r}`).then(() => {
|
|
|
5035
5035
|
"data-cbv-new-from-document": !0,
|
|
5036
5036
|
disabled: br,
|
|
5037
5037
|
onClick: () => {
|
|
5038
|
-
|
|
5038
|
+
da(!1), fr(null);
|
|
5039
5039
|
},
|
|
5040
5040
|
className: "flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-[12px] text-slate-700 hover:bg-slate-100 disabled:opacity-60 dark:text-slate-200 dark:hover:bg-muted",
|
|
5041
5041
|
title: "Upload a SOW, quote or spreadsheet — the new record opens with what it says proposed",
|
|
@@ -5056,12 +5056,12 @@ ${r}`).then(() => {
|
|
|
5056
5056
|
onClick: () => pr(null),
|
|
5057
5057
|
className: Ft(
|
|
5058
5058
|
"h-8 bg-nvr-cyan px-3 text-[12.5px] font-semibold text-white hover:brightness-105",
|
|
5059
|
-
|
|
5059
|
+
dn.length > 0 || (hl = ca.data) != null && hl.enabled ? "rounded-l-md" : "rounded-md"
|
|
5060
5060
|
),
|
|
5061
5061
|
children: "+ New item"
|
|
5062
5062
|
}
|
|
5063
5063
|
),
|
|
5064
|
-
|
|
5064
|
+
dn.length > 0 && /* @__PURE__ */ t(
|
|
5065
5065
|
"button",
|
|
5066
5066
|
{
|
|
5067
5067
|
type: "button",
|
|
@@ -5071,12 +5071,12 @@ ${r}`).then(() => {
|
|
|
5071
5071
|
onClick: () => qa({ slug: null }),
|
|
5072
5072
|
className: Ft(
|
|
5073
5073
|
"flex h-8 items-center border-l border-white/30 bg-nvr-cyan px-2 text-white hover:brightness-105",
|
|
5074
|
-
!((fl =
|
|
5074
|
+
!((fl = ca.data) != null && fl.enabled) && "rounded-r-md"
|
|
5075
5075
|
),
|
|
5076
5076
|
children: /* @__PURE__ */ t(wl, { className: "h-3.5 w-3.5" })
|
|
5077
5077
|
}
|
|
5078
5078
|
),
|
|
5079
|
-
((gl =
|
|
5079
|
+
((gl = ca.data) == null ? void 0 : gl.enabled) && /* @__PURE__ */ t(
|
|
5080
5080
|
"button",
|
|
5081
5081
|
{
|
|
5082
5082
|
type: "button",
|
|
@@ -5095,7 +5095,7 @@ ${r}`).then(() => {
|
|
|
5095
5095
|
{
|
|
5096
5096
|
ref: mr,
|
|
5097
5097
|
type: "file",
|
|
5098
|
-
accept: (((xl =
|
|
5098
|
+
accept: (((xl = ca.data) == null ? void 0 : xl.accept) ?? []).join(","),
|
|
5099
5099
|
multiple: !0,
|
|
5100
5100
|
className: "hidden",
|
|
5101
5101
|
onChange: es,
|
|
@@ -5103,19 +5103,19 @@ ${r}`).then(() => {
|
|
|
5103
5103
|
}
|
|
5104
5104
|
)
|
|
5105
5105
|
] }),
|
|
5106
|
-
|
|
5106
|
+
on && /* @__PURE__ */ t(
|
|
5107
5107
|
Fi,
|
|
5108
5108
|
{
|
|
5109
5109
|
collection: n,
|
|
5110
|
-
layoutSlug:
|
|
5110
|
+
layoutSlug: on.slug,
|
|
5111
5111
|
open: !0,
|
|
5112
5112
|
onOpenChange: (e) => {
|
|
5113
5113
|
e || qa(null);
|
|
5114
5114
|
},
|
|
5115
5115
|
noun: (O == null ? void 0 : O.singular) ?? "record",
|
|
5116
|
-
anchorEl:
|
|
5116
|
+
anchorEl: cn.current ?? gr.current,
|
|
5117
5117
|
onDone: (e) => {
|
|
5118
|
-
qa(null), W({ collection: n, itemId: "new", layoutSlug:
|
|
5118
|
+
qa(null), W({ collection: n, itemId: "new", layoutSlug: on.slug, prefill: e });
|
|
5119
5119
|
}
|
|
5120
5120
|
}
|
|
5121
5121
|
),
|
|
@@ -5133,7 +5133,7 @@ ${r}`).then(() => {
|
|
|
5133
5133
|
"button",
|
|
5134
5134
|
{
|
|
5135
5135
|
type: "button",
|
|
5136
|
-
onClick: () =>
|
|
5136
|
+
onClick: () => la([]),
|
|
5137
5137
|
className: "ml-1 text-[11px] text-slate-500 underline-offset-2 hover:text-slate-700 hover:underline dark:text-slate-400 dark:hover:text-slate-200",
|
|
5138
5138
|
children: "Show all"
|
|
5139
5139
|
}
|
|
@@ -5145,7 +5145,7 @@ ${r}`).then(() => {
|
|
|
5145
5145
|
{
|
|
5146
5146
|
def: e,
|
|
5147
5147
|
allowedIds: as(e),
|
|
5148
|
-
scopeDefault:
|
|
5148
|
+
scopeDefault: wa.has(e.key),
|
|
5149
5149
|
selected: wt[e.key] ?? [],
|
|
5150
5150
|
onChange: (a) => _t((r) => ({ ...r, [e.key]: a }))
|
|
5151
5151
|
},
|
|
@@ -5242,10 +5242,10 @@ ${r}`).then(() => {
|
|
|
5242
5242
|
{
|
|
5243
5243
|
type: "button",
|
|
5244
5244
|
onClick: () => Ps.mutate(e.id),
|
|
5245
|
-
title:
|
|
5245
|
+
title: Aa(e.id) ? "Subscribed — a daily digest reports records that enter this view. Click to unsubscribe." : "Subscribe — get a daily digest of records that enter this view",
|
|
5246
5246
|
"aria-label": `Toggle digest subscription for ${e.name}`,
|
|
5247
|
-
className:
|
|
5248
|
-
children:
|
|
5247
|
+
className: Aa(e.id) ? "text-[#00a5cc]" : "text-slate-400 hover:text-[#00a5cc]",
|
|
5248
|
+
children: Aa(e.id) ? /* @__PURE__ */ t(eo, { className: "h-3 w-3", fill: "currentColor" }) : /* @__PURE__ */ t(to, { className: "h-3 w-3" })
|
|
5249
5249
|
}
|
|
5250
5250
|
),
|
|
5251
5251
|
/* @__PURE__ */ t(
|
|
@@ -5268,7 +5268,7 @@ ${r}`).then(() => {
|
|
|
5268
5268
|
) : "↺"
|
|
5269
5269
|
}
|
|
5270
5270
|
),
|
|
5271
|
-
|
|
5271
|
+
Qt && /* @__PURE__ */ t(
|
|
5272
5272
|
fi,
|
|
5273
5273
|
{
|
|
5274
5274
|
name: e.name,
|
|
@@ -5299,7 +5299,7 @@ ${r}`).then(() => {
|
|
|
5299
5299
|
{
|
|
5300
5300
|
className: "flex items-center gap-1",
|
|
5301
5301
|
onSubmit: (e) => {
|
|
5302
|
-
e.preventDefault(), Ot.trim() &&
|
|
5302
|
+
e.preventDefault(), Ot.trim() && Da.mutate();
|
|
5303
5303
|
},
|
|
5304
5304
|
children: [
|
|
5305
5305
|
/* @__PURE__ */ t(
|
|
@@ -5307,7 +5307,7 @@ ${r}`).then(() => {
|
|
|
5307
5307
|
{
|
|
5308
5308
|
autoFocus: !0,
|
|
5309
5309
|
value: Ot,
|
|
5310
|
-
onChange: (e) =>
|
|
5310
|
+
onChange: (e) => an(e.target.value),
|
|
5311
5311
|
placeholder: "View name…",
|
|
5312
5312
|
className: "h-6 w-32 rounded border border-slate-200 bg-slate-50 px-1.5 text-[11.5px] outline-none focus:border-nvr-cyan/50 dark:border-slate-700 dark:bg-slate-800 dark:text-slate-100"
|
|
5313
5313
|
}
|
|
@@ -5325,7 +5325,7 @@ ${r}`).then(() => {
|
|
|
5325
5325
|
"button",
|
|
5326
5326
|
{
|
|
5327
5327
|
type: "button",
|
|
5328
|
-
onClick: () =>
|
|
5328
|
+
onClick: () => tn(!1),
|
|
5329
5329
|
"aria-label": "Cancel",
|
|
5330
5330
|
className: "text-slate-400",
|
|
5331
5331
|
children: "✕"
|
|
@@ -5337,15 +5337,15 @@ ${r}`).then(() => {
|
|
|
5337
5337
|
"button",
|
|
5338
5338
|
{
|
|
5339
5339
|
type: "button",
|
|
5340
|
-
onClick: () =>
|
|
5340
|
+
onClick: () => tn(!0),
|
|
5341
5341
|
className: "text-[12px] font-medium text-slate-400 hover:text-[#00a5cc]",
|
|
5342
5342
|
children: "☆ Save view"
|
|
5343
5343
|
}
|
|
5344
5344
|
)
|
|
5345
5345
|
] }),
|
|
5346
|
-
|
|
5347
|
-
/* @__PURE__ */ t("span", { className: "min-w-0 flex-1", children:
|
|
5348
|
-
(
|
|
5346
|
+
Yt != null && /* @__PURE__ */ c("div", { className: "mx-4 mt-3 flex flex-wrap items-center gap-3 rounded-md border border-red-200 bg-red-50 px-4 py-2.5 text-[13px] text-red-700 dark:border-red-900/40 dark:bg-red-900/10 dark:text-red-400", children: [
|
|
5347
|
+
/* @__PURE__ */ t("span", { className: "min-w-0 flex-1", children: Yt instanceof Error ? Yt.message : "Failed to load records" }),
|
|
5348
|
+
(Yt == null ? void 0 : Yt.status) === 403 && /* @__PURE__ */ t(
|
|
5349
5349
|
"button",
|
|
5350
5350
|
{
|
|
5351
5351
|
type: "button",
|
|
@@ -5358,42 +5358,42 @@ ${r}`).then(() => {
|
|
|
5358
5358
|
}
|
|
5359
5359
|
)
|
|
5360
5360
|
] }),
|
|
5361
|
-
it === "tree" &&
|
|
5361
|
+
it === "tree" && ma ? /* @__PURE__ */ t("div", { className: "flex min-h-0 flex-1 flex-col p-4 pt-3", children: /* @__PURE__ */ t("div", { className: "flex min-h-0 flex-1 flex-col overflow-hidden rounded-lg border border-slate-200 bg-white dark:border-slate-700 dark:bg-slate-900", children: /* @__PURE__ */ t(
|
|
5362
5362
|
pi,
|
|
5363
5363
|
{
|
|
5364
5364
|
collection: n,
|
|
5365
|
-
config:
|
|
5366
|
-
onOpen: (e) =>
|
|
5365
|
+
config: ma,
|
|
5366
|
+
onOpen: (e) => Zt(e),
|
|
5367
5367
|
onAddChild: K && $e.allow_create !== !1 ? (e) => W({
|
|
5368
5368
|
collection: n,
|
|
5369
5369
|
itemId: "new",
|
|
5370
|
-
prefill: { [
|
|
5370
|
+
prefill: { [ma.parent_field]: e }
|
|
5371
5371
|
}) : void 0
|
|
5372
5372
|
}
|
|
5373
5373
|
) }) }) : it && (A != null && A.some((e) => e.key === it)) ? /* @__PURE__ */ t("div", { className: "flex min-h-0 flex-1 flex-col p-4 pt-3", "data-cbv-extra-view": it, children: (vl = A.find((e) => e.key === it)) == null ? void 0 : vl.render() }) : null,
|
|
5374
|
-
Fa &&
|
|
5374
|
+
Fa && Ut ? /* @__PURE__ */ t("div", { className: "flex min-h-0 flex-1 flex-col p-4 pt-3", children: /* @__PURE__ */ t(
|
|
5375
5375
|
Ri,
|
|
5376
5376
|
{
|
|
5377
5377
|
collection: n,
|
|
5378
|
-
latField:
|
|
5379
|
-
lngField:
|
|
5380
|
-
labelField:
|
|
5378
|
+
latField: Ut.latField,
|
|
5379
|
+
lngField: Ut.lngField,
|
|
5380
|
+
labelField: Ut.labelField,
|
|
5381
5381
|
conditions: ke ?? null,
|
|
5382
5382
|
search: I,
|
|
5383
|
-
onOpen: (e) =>
|
|
5383
|
+
onOpen: (e) => Zt(e)
|
|
5384
5384
|
}
|
|
5385
5385
|
) }) : null,
|
|
5386
5386
|
/* @__PURE__ */ t(
|
|
5387
5387
|
"div",
|
|
5388
5388
|
{
|
|
5389
|
-
className: Fa &&
|
|
5389
|
+
className: Fa && Ut || it === "tree" && ma || it && (A != null && A.some((e) => e.key === it)) ? "hidden" : "flex min-h-0 flex-1 flex-col p-4 pt-3",
|
|
5390
5390
|
children: /* @__PURE__ */ c(
|
|
5391
5391
|
"div",
|
|
5392
5392
|
{
|
|
5393
5393
|
ref: ut.rootRef,
|
|
5394
5394
|
className: "nvr-fade-in relative flex min-h-0 flex-1 flex-col overflow-hidden rounded-lg border border-slate-200 bg-white dark:border-slate-700 dark:bg-slate-900",
|
|
5395
5395
|
children: [
|
|
5396
|
-
|
|
5396
|
+
Vt && !Fr && /* @__PURE__ */ c(ze, { children: [
|
|
5397
5397
|
/* @__PURE__ */ t("div", { className: "cbv-progress pointer-events-none absolute inset-x-0 top-0 z-[6] h-[3px] overflow-hidden" }),
|
|
5398
5398
|
/* @__PURE__ */ t("div", { className: "cbv-overlay nvr-fade-in pointer-events-none absolute inset-0 z-[5] flex items-start justify-center bg-white/40 pt-24 dark:bg-slate-950/35", children: /* @__PURE__ */ c("span", { className: "nvr-pop-in flex items-center gap-2 rounded-full border border-slate-200 bg-white px-3 py-1.5 text-[12px] font-medium text-slate-600 shadow-lg dark:border-slate-700 dark:bg-slate-900 dark:text-slate-300", children: [
|
|
5399
5399
|
/* @__PURE__ */ t(An, { "aria-hidden": !0, className: "h-3.5 w-3.5 animate-spin text-[#00a5cc]" }),
|
|
@@ -5427,7 +5427,7 @@ ${r}`).then(() => {
|
|
|
5427
5427
|
"table",
|
|
5428
5428
|
{
|
|
5429
5429
|
"data-copy-cells": "",
|
|
5430
|
-
className: `w-full ${De === "comfortable" ? "[&_tbody_td]:py-2.5 [&_tbody_tr]:h-11 [&_tbody]:text-[12.5px]" : ""}`,
|
|
5430
|
+
className: `w-full border-separate border-spacing-0 [&>thead>tr.border-b>th]:border-b [&>thead>tr.border-b>th]:[border-bottom-color:inherit] [&>tbody>tr.border-b>td]:border-b [&>tbody>tr.border-b>td]:[border-bottom-color:inherit] [&>tbody:has(+tfoot)>tr:last-child>td]:border-b-0 [&>tfoot>tr>td]:border-t-2 [&>tfoot>tr>td]:[border-top-color:inherit] ${De === "comfortable" ? "[&_tbody_td]:py-2.5 [&_tbody_tr]:h-11 [&_tbody]:text-[12.5px]" : ""}`,
|
|
5431
5431
|
style: { fontVariantNumeric: "tabular-nums" },
|
|
5432
5432
|
children: [
|
|
5433
5433
|
/* @__PURE__ */ c("thead", { children: [
|
|
@@ -5451,7 +5451,7 @@ ${r}`).then(() => {
|
|
|
5451
5451
|
] })
|
|
5452
5452
|
}
|
|
5453
5453
|
),
|
|
5454
|
-
|
|
5454
|
+
ea.map((e) => {
|
|
5455
5455
|
const a = e.key, r = !!ot(a), l = `group/hcell sticky top-0 h-8 select-none whitespace-nowrap bg-slate-50 px-3 py-0 text-[10px] font-bold uppercase tracking-wider text-slate-500 dark:bg-slate-800 dark:text-slate-400 ${r ? "z-[4]" : "z-[2]"}`, s = We(a, "", "");
|
|
5456
5456
|
if (e.kind !== "data") {
|
|
5457
5457
|
const B = e.kind === "state" ? "State" : e.kind === "entered" ? "Last State Change" : e.kind === "aging" ? "Aging" : e.kind === "owners" ? "Owners" : e.kind === "addendums" ? "Addendums" : e.kind === "fulfilment" ? Ke != null && Ke.label ? `${Ke.label} shipped` : "Shipped" : e.kind === "integrations" ? "Integrations" : e.kind === "tasks" ? "Tasks" : e.kind === "formula" ? tt(a) : "";
|
|
@@ -5505,18 +5505,18 @@ ${r}`).then(() => {
|
|
|
5505
5505
|
);
|
|
5506
5506
|
})
|
|
5507
5507
|
] }),
|
|
5508
|
-
(Ss ||
|
|
5508
|
+
(Ss || fa) && /* @__PURE__ */ c("tr", { className: "border-b border-slate-200 dark:border-slate-700", children: [
|
|
5509
5509
|
qt && /* @__PURE__ */ t("th", { className: "sticky left-0 top-8 z-[4] w-11 bg-slate-50 py-1 pl-1.5 pr-3 dark:bg-slate-800" }),
|
|
5510
|
-
|
|
5510
|
+
ea.map((e) => {
|
|
5511
5511
|
var s;
|
|
5512
5512
|
const a = e.key, l = `sticky top-8 bg-slate-50 px-2 py-1 text-left font-normal dark:bg-slate-800 ${!!ot(a) ? "z-[4]" : "z-[2]"} ${We(a, "", "")}`;
|
|
5513
5513
|
if (e.kind === "state")
|
|
5514
5514
|
return /* @__PURE__ */ t("th", { style: we(a), className: l, children: /* @__PURE__ */ t(
|
|
5515
|
-
|
|
5515
|
+
Ya,
|
|
5516
5516
|
{
|
|
5517
5517
|
block: !0,
|
|
5518
5518
|
label: "All",
|
|
5519
|
-
options: ((
|
|
5519
|
+
options: ((Ht == null ? void 0 : Ht.states) ?? []).map((d) => ({
|
|
5520
5520
|
value: d.key,
|
|
5521
5521
|
label: d.label ?? d.key
|
|
5522
5522
|
})),
|
|
@@ -5530,7 +5530,7 @@ ${r}`).then(() => {
|
|
|
5530
5530
|
if (e.kind === "fulfilment") {
|
|
5531
5531
|
const d = Oe.__fulfilment__;
|
|
5532
5532
|
return /* @__PURE__ */ t("th", { style: we(a), className: l, children: /* @__PURE__ */ t(
|
|
5533
|
-
|
|
5533
|
+
na,
|
|
5534
5534
|
{
|
|
5535
5535
|
ariaLabel: "Shipped filter",
|
|
5536
5536
|
value: (d == null ? void 0 : d.kind) === "fulfilment" ? d.value : "",
|
|
@@ -5591,7 +5591,7 @@ ${r}`).then(() => {
|
|
|
5591
5591
|
className: l,
|
|
5592
5592
|
"data-integration-filter": m,
|
|
5593
5593
|
children: /* @__PURE__ */ t(
|
|
5594
|
-
|
|
5594
|
+
na,
|
|
5595
5595
|
{
|
|
5596
5596
|
ariaLabel: "Integrations filter",
|
|
5597
5597
|
value: m,
|
|
@@ -5621,7 +5621,7 @@ ${r}`).then(() => {
|
|
|
5621
5621
|
className: l,
|
|
5622
5622
|
"data-cbv-tasks-filter": m,
|
|
5623
5623
|
children: /* @__PURE__ */ t(
|
|
5624
|
-
|
|
5624
|
+
na,
|
|
5625
5625
|
{
|
|
5626
5626
|
ariaLabel: "Tasks filter",
|
|
5627
5627
|
value: m,
|
|
@@ -5726,7 +5726,7 @@ ${r}`).then(() => {
|
|
|
5726
5726
|
colSpan: le.length + En,
|
|
5727
5727
|
children: /* @__PURE__ */ c("span", { className: "flex items-center gap-1.5 text-[12px] font-medium text-slate-600 dark:text-slate-200", children: [
|
|
5728
5728
|
/* @__PURE__ */ t(
|
|
5729
|
-
|
|
5729
|
+
va,
|
|
5730
5730
|
{
|
|
5731
5731
|
className: `h-3.5 w-3.5 text-slate-400 transition-transform duration-200 ${Xn.has(e.gkey) ? "-rotate-90" : ""}`
|
|
5732
5732
|
}
|
|
@@ -5739,12 +5739,12 @@ ${r}`).then(() => {
|
|
|
5739
5739
|
},
|
|
5740
5740
|
`__group__${e.gkey}`
|
|
5741
5741
|
);
|
|
5742
|
-
const l = e.row, s = l.id, d = Mt.includes(s), m = (B = fe == null ? void 0 : fe.instances) == null ? void 0 : B[String(s)], E = gs[String(s)], D =
|
|
5742
|
+
const l = e.row, s = l.id, d = Mt.includes(s), m = (B = fe == null ? void 0 : fe.instances) == null ? void 0 : B[String(s)], E = gs[String(s)], D = Nn == null ? void 0 : Nn[String(s)], me = hs.get(String(s)) ?? null, J = !d && E ? Wo(E.color) : void 0, ae = d ? "bg-[#e6fafe] dark:bg-[#0c2a33]" : J ?? "bg-white group-hover:bg-[#f2fcff] dark:bg-slate-900 dark:group-hover:bg-[#0e2d3a]";
|
|
5743
5743
|
return /* @__PURE__ */ c(
|
|
5744
5744
|
"tr",
|
|
5745
5745
|
{
|
|
5746
5746
|
...us({ collection: n, id: String(s) }),
|
|
5747
|
-
onClick: () =>
|
|
5747
|
+
onClick: () => Zt(s),
|
|
5748
5748
|
onMouseEnter: () => Os(s),
|
|
5749
5749
|
"data-row-key": String(s),
|
|
5750
5750
|
title: ut.titleFor(String(s)) ?? (me && !me.is_mine ? Fo(me) : void 0) ?? (E ? `At risk — ${E.rule}` : void 0),
|
|
@@ -5784,7 +5784,7 @@ ${r}`).then(() => {
|
|
|
5784
5784
|
] })
|
|
5785
5785
|
}
|
|
5786
5786
|
),
|
|
5787
|
-
|
|
5787
|
+
ea.map((L) => {
|
|
5788
5788
|
var pt, He, Fe, ft, gt, jt;
|
|
5789
5789
|
const u = L.key;
|
|
5790
5790
|
if (L.kind === "state")
|
|
@@ -5840,7 +5840,7 @@ ${r}`).then(() => {
|
|
|
5840
5840
|
{
|
|
5841
5841
|
style: we(u),
|
|
5842
5842
|
className: `whitespace-nowrap px-3 py-1.5 text-[12px] tabular-nums text-slate-600 dark:text-slate-300 ${We(u, "z-[1]", ae)}`,
|
|
5843
|
-
children: T != null && T.entered_at ?
|
|
5843
|
+
children: T != null && T.entered_at ? ta(T.entered_at, {
|
|
5844
5844
|
type: "datetime",
|
|
5845
5845
|
template: "MM/DD/YYYY - h:mmA"
|
|
5846
5846
|
}) : /* @__PURE__ */ t("span", { className: "text-slate-300 dark:text-slate-600", children: "—" })
|
|
@@ -5879,7 +5879,7 @@ ${r}`).then(() => {
|
|
|
5879
5879
|
u
|
|
5880
5880
|
);
|
|
5881
5881
|
if (L.kind === "addendums") {
|
|
5882
|
-
const T =
|
|
5882
|
+
const T = wn == null ? void 0 : wn[String(s)];
|
|
5883
5883
|
return /* @__PURE__ */ t(
|
|
5884
5884
|
"td",
|
|
5885
5885
|
{
|
|
@@ -5918,12 +5918,12 @@ ${r}`).then(() => {
|
|
|
5918
5918
|
{
|
|
5919
5919
|
style: we(u),
|
|
5920
5920
|
className: `whitespace-nowrap px-3 py-1.5 ${We(u, "z-[1]", ae)}`,
|
|
5921
|
-
children: /* @__PURE__ */ t(Ti, { rows:
|
|
5921
|
+
children: /* @__PURE__ */ t(Ti, { rows: Sn == null ? void 0 : Sn[String(s)] })
|
|
5922
5922
|
},
|
|
5923
5923
|
u
|
|
5924
5924
|
);
|
|
5925
5925
|
if (L.kind === "tasks") {
|
|
5926
|
-
const T =
|
|
5926
|
+
const T = _n == null ? void 0 : _n[String(s)];
|
|
5927
5927
|
return /* @__PURE__ */ t(
|
|
5928
5928
|
"td",
|
|
5929
5929
|
{
|
|
@@ -5954,7 +5954,7 @@ ${r}`).then(() => {
|
|
|
5954
5954
|
"data-cbv-formula-cell": u,
|
|
5955
5955
|
"data-tip": ls(l, u),
|
|
5956
5956
|
className: `whitespace-nowrap px-3 py-1.5 text-right tabular-nums text-slate-700 dark:text-slate-200 ${We(u, "z-[1]", ae)}`,
|
|
5957
|
-
children: T == null ? /* @__PURE__ */ t("span", { className: "text-slate-300 dark:text-slate-600", children: "—" }) : H[u] ?
|
|
5957
|
+
children: T == null ? /* @__PURE__ */ t("span", { className: "text-slate-300 dark:text-slate-600", children: "—" }) : H[u] ? ta(String(T), H[u]) : rt(Math.round(T * 100) / 100)
|
|
5958
5958
|
},
|
|
5959
5959
|
u
|
|
5960
5960
|
);
|
|
@@ -5971,8 +5971,8 @@ ${r}`).then(() => {
|
|
|
5971
5971
|
{
|
|
5972
5972
|
collection: n,
|
|
5973
5973
|
id: s,
|
|
5974
|
-
hasPipeline:
|
|
5975
|
-
onOpen: () =>
|
|
5974
|
+
hasPipeline: fa,
|
|
5975
|
+
onOpen: () => Zt(s),
|
|
5976
5976
|
onPeek: () => Ze.push([{ collection: n, itemId: String(s) }]),
|
|
5977
5977
|
onAudit: () => Z(String(s)),
|
|
5978
5978
|
urlFor: M,
|
|
@@ -6010,9 +6010,9 @@ ${r}`).then(() => {
|
|
|
6010
6010
|
return /* @__PURE__ */ t(
|
|
6011
6011
|
Ll,
|
|
6012
6012
|
{
|
|
6013
|
-
users: Qe.map((nt,
|
|
6013
|
+
users: Qe.map((nt, xa) => ({
|
|
6014
6014
|
id: String(nt),
|
|
6015
|
-
name: Y[
|
|
6015
|
+
name: Y[xa] ?? String(nt)
|
|
6016
6016
|
})),
|
|
6017
6017
|
showSingleName: !1
|
|
6018
6018
|
}
|
|
@@ -6030,7 +6030,7 @@ ${r}`).then(() => {
|
|
|
6030
6030
|
className: "block max-w-[260px] truncate text-left text-[12px] font-medium text-slate-700 underline decoration-slate-300 underline-offset-2 transition-colors hover:text-[#0284c7] hover:decoration-[#0284c7] dark:text-slate-200 dark:decoration-slate-600 dark:hover:text-[#38bdf8]",
|
|
6031
6031
|
children: [
|
|
6032
6032
|
((Fe = H[u]) == null ? void 0 : Fe.type) === "count" && Vr(u) ? "📎 " : "",
|
|
6033
|
-
|
|
6033
|
+
Gt(at(s, u) ?? "", u, s)
|
|
6034
6034
|
]
|
|
6035
6035
|
}
|
|
6036
6036
|
) : /* @__PURE__ */ t(
|
|
@@ -6038,7 +6038,7 @@ ${r}`).then(() => {
|
|
|
6038
6038
|
{
|
|
6039
6039
|
className: "block max-w-[260px] truncate text-[12px] text-slate-700 dark:text-slate-200",
|
|
6040
6040
|
"data-tip": at(s, u) ?? void 0,
|
|
6041
|
-
children: at(s, u) != null ? `${((ft = H[u]) == null ? void 0 : ft.type) === "count" && Vr(u) ? "📎 " : ""}${
|
|
6041
|
+
children: at(s, u) != null ? `${((ft = H[u]) == null ? void 0 : ft.type) === "count" && Vr(u) ? "📎 " : ""}${Gt(at(s, u) ?? "", u, s)}` : /* @__PURE__ */ t("span", { className: "inline-block h-3.5 w-16 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" })
|
|
6042
6042
|
}
|
|
6043
6043
|
) : (Be == null ? void 0 : Be.one_collection) === "nivaro_users" && l[u] != null ? /* @__PURE__ */ t("span", { onClick: (T) => T.stopPropagation(), children: /* @__PURE__ */ t(Fl, { userId: String(l[u]), size: "compact" }) }) : Be != null && Be.one_collection && l[u] != null && !mt(Be.one_collection) ? /* @__PURE__ */ t(
|
|
6044
6044
|
"button",
|
|
@@ -6066,16 +6066,16 @@ ${r}`).then(() => {
|
|
|
6066
6066
|
{
|
|
6067
6067
|
className: Ft(
|
|
6068
6068
|
"text-[12px] tabular-nums text-slate-700 dark:text-slate-200",
|
|
6069
|
-
|
|
6069
|
+
Ka(l[u], je[u]) && Pl[Ka(l[u], je[u])]
|
|
6070
6070
|
),
|
|
6071
|
-
children:
|
|
6071
|
+
children: ta(String(l[u]), H[u])
|
|
6072
6072
|
}
|
|
6073
|
-
) :
|
|
6073
|
+
) : Ka(l[u], je[u]) ? /* @__PURE__ */ t(
|
|
6074
6074
|
"span",
|
|
6075
6075
|
{
|
|
6076
6076
|
className: Ft(
|
|
6077
6077
|
"text-[12px]",
|
|
6078
|
-
Pl[
|
|
6078
|
+
Pl[Ka(l[u], je[u])]
|
|
6079
6079
|
),
|
|
6080
6080
|
children: /* @__PURE__ */ t(
|
|
6081
6081
|
Ml,
|
|
@@ -6107,17 +6107,17 @@ ${r}`).then(() => {
|
|
|
6107
6107
|
String(s)
|
|
6108
6108
|
);
|
|
6109
6109
|
}) }, cs),
|
|
6110
|
-
|
|
6110
|
+
bn && Object.keys(bn).length > 0 && !ce && /* @__PURE__ */ t("tfoot", { className: "text-[12px] tabular-nums", children: /* @__PURE__ */ c("tr", { className: "sticky bottom-0 z-[2] border-t-2 border-slate-200 bg-slate-50 font-medium dark:border-slate-700 dark:bg-slate-800", children: [
|
|
6111
6111
|
qt && /* @__PURE__ */ t("td", { className: "sticky left-0 z-[3] w-11 bg-slate-50 py-1.5 pl-1.5 pr-3 dark:bg-slate-800" }),
|
|
6112
|
-
|
|
6113
|
-
const r = e.key, l =
|
|
6112
|
+
ea.map((e, a) => {
|
|
6113
|
+
const r = e.key, l = bn[r];
|
|
6114
6114
|
return /* @__PURE__ */ t(
|
|
6115
6115
|
"td",
|
|
6116
6116
|
{
|
|
6117
6117
|
className: `whitespace-nowrap px-3 py-1.5 ${We(r, "z-[3]", "bg-slate-50 dark:bg-slate-800")}`,
|
|
6118
6118
|
style: we(r),
|
|
6119
6119
|
"data-tip": l != null ? `Sum of ${tt(r)} across all ${rt(Le)} matching records` : void 0,
|
|
6120
|
-
children: l != null ? /* @__PURE__ */ t("span", { className: "text-slate-700 dark:text-slate-200", children: H[r] ?
|
|
6120
|
+
children: l != null ? /* @__PURE__ */ t("span", { className: "text-slate-700 dark:text-slate-200", children: H[r] ? ta(String(l), H[r]) : rt(Math.round(l * 100) / 100) }) : a === 0 ? /* @__PURE__ */ t("span", { className: "text-[10.5px] font-semibold uppercase tracking-wide text-slate-400", children: "Σ totals" }) : null
|
|
6121
6121
|
},
|
|
6122
6122
|
r
|
|
6123
6123
|
);
|
|
@@ -6252,7 +6252,7 @@ ${r}`).then(() => {
|
|
|
6252
6252
|
}
|
|
6253
6253
|
}
|
|
6254
6254
|
),
|
|
6255
|
-
qt && Fn && !ce && Le > ye.length && Mt.length < Math.min(Le,
|
|
6255
|
+
qt && Fn && !ce && Le > ye.length && Mt.length < Math.min(Le, Ia) && /* @__PURE__ */ c("div", { className: "nvr-slide-up-centered fixed bottom-16 left-1/2 z-40 -translate-x-1/2 rounded-full border border-slate-200 bg-white px-4 py-2 text-[12.5px] shadow-lg dark:border-border dark:bg-card", children: [
|
|
6256
6256
|
/* @__PURE__ */ c("span", { className: "text-slate-600 dark:text-muted-foreground", children: [
|
|
6257
6257
|
"All ",
|
|
6258
6258
|
ye.length,
|
|
@@ -6266,7 +6266,7 @@ ${r}`).then(() => {
|
|
|
6266
6266
|
disabled: al,
|
|
6267
6267
|
onClick: () => void js(),
|
|
6268
6268
|
className: "font-semibold text-nvr-navy underline decoration-dotted hover:text-nvr-cyan dark:text-nvr-cyan",
|
|
6269
|
-
children: al ? "Selecting…" : Le >
|
|
6269
|
+
children: al ? "Selecting…" : Le > Ia ? `Select the first ${Ia.toLocaleString()} of ${Le.toLocaleString()} matching` : `Select all ${Le.toLocaleString()} matching rows`
|
|
6270
6270
|
}
|
|
6271
6271
|
)
|
|
6272
6272
|
] }),
|
|
@@ -6275,12 +6275,12 @@ ${r}`).then(() => {
|
|
|
6275
6275
|
{
|
|
6276
6276
|
collection: n,
|
|
6277
6277
|
selectedIds: Mt,
|
|
6278
|
-
transitions: (
|
|
6278
|
+
transitions: (Ht == null ? void 0 : Ht.transitions) ?? [],
|
|
6279
6279
|
fields: (O == null ? void 0 : O.fields) ?? [],
|
|
6280
6280
|
relations: (O == null ? void 0 : O.relations) ?? [],
|
|
6281
6281
|
registryKeys: $e.bulk_actions ?? null,
|
|
6282
6282
|
onClear: () => Bt([]),
|
|
6283
|
-
onSuccess: () =>
|
|
6283
|
+
onSuccess: () => Wa(v, n)
|
|
6284
6284
|
}
|
|
6285
6285
|
)
|
|
6286
6286
|
]
|
|
@@ -6297,9 +6297,9 @@ function pd(n, i, f, o) {
|
|
|
6297
6297
|
}
|
|
6298
6298
|
export {
|
|
6299
6299
|
vc as CollectionBrowserView,
|
|
6300
|
-
|
|
6300
|
+
Ya as MultiPick,
|
|
6301
6301
|
Ji as RowActionsMenu,
|
|
6302
6302
|
Pl as TINT_TEXT,
|
|
6303
|
-
|
|
6304
|
-
|
|
6303
|
+
Wa as invalidateCbvRowQueries,
|
|
6304
|
+
Ka as tintFor
|
|
6305
6305
|
};
|