@nivaro/react 0.3.62 → 0.3.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +66 -0
- package/dist/index.js +239 -235
- package/dist/shared/components/CollectionBrowserView.js +368 -364
- package/dist/shared/components/QualityRulesView.js +212 -138
- package/dist/shared/components/alerts/AlertManagerView.js +341 -335
- package/dist/shared/components/help-videos/library/LearningPathsPanel.js +102 -98
- package/dist/shared/components/help-videos/library/PurgeVideoDialog.js +8 -8
- package/dist/shared/components/imports/CollectionImportPanel.js +273 -247
- package/dist/shared/components/pipeline/PipelineEditorView.js +636 -632
- package/dist/shared/components/pipeline/PipelineStateOwners.js +88 -87
- package/dist/shared/lib/batch-gets.js +68 -0
- package/dist/shared/lib/request-gate.js +284 -230
- package/package.json +1 -1
|
@@ -1,55 +1,54 @@
|
|
|
1
1
|
import { jsxs as c, jsx as n, Fragment as Be } from "react/jsx-runtime";
|
|
2
2
|
import { useQueryClient as ya, useMutation as yt, useQuery as le, useQueries as fa } from "@tanstack/react-query";
|
|
3
|
-
import { FileDiff as
|
|
4
|
-
import
|
|
3
|
+
import { FileDiff as ti, RotateCw as pr, Network as ni, Map as ai, Sparkles as mr, X as fr, Rows3 as as, ListChecks as ri, Rows2 as li, ChevronDown as Bn, Wand2 as rs, FileText as ls, Bell as si, BellOff as oi, Loader2 as ii, Check as di, Search as qs, Pin as ci } from "lucide-react";
|
|
4
|
+
import ui, { useState as k, useRef as me, useEffect as pe, useMemo as xe, useLayoutEffect as pi } from "react";
|
|
5
5
|
import { createPortal as Ts } from "react-dom";
|
|
6
6
|
import { toast as we } from "sonner";
|
|
7
|
-
import { useNivaroClient as ut, useItemNavigation as Ls, useOverlayState as
|
|
7
|
+
import { useNivaroClient as ut, useItemNavigation as Ls, useOverlayState as mi, useItemEditAuth as ga, useApiFetchConfig as fi } from "../context.js";
|
|
8
8
|
import { useDebounced as ss } from "../hooks/useDebounced.js";
|
|
9
|
-
import { useElapsedLoading as
|
|
10
|
-
import { useSlowReason as
|
|
11
|
-
import { useBulkProgressFeed as
|
|
12
|
-
import { warmPageLookups as
|
|
9
|
+
import { useElapsedLoading as bi } from "../hooks/useElapsedLoading.js";
|
|
10
|
+
import { useSlowReason as hi } from "../hooks/useSlowReason.js";
|
|
11
|
+
import { useBulkProgressFeed as gi, newBulkProgressId as xi, startBulkProgress as vi, endBulkProgress as ki } from "../lib/bulk-progress.js";
|
|
12
|
+
import { warmPageLookups as yi } from "../lib/cbv-page-warm.js";
|
|
13
13
|
import { post as _e, get as X, patch as pa, del as ba } from "../lib/commands.js";
|
|
14
|
-
import { parseDateFilter as xa, dateFilterBounds as
|
|
15
|
-
import { errorSentence as
|
|
16
|
-
import { toastError as
|
|
17
|
-
import { extractExpressionTokens as
|
|
18
|
-
import { clauseFromCondition as hr, clauseFromControlValue as
|
|
19
|
-
import { deliverLive as
|
|
20
|
-
import { formatValue as xn, formatMultiValue as is, countFromResolved as
|
|
21
|
-
import { createCursorBook as
|
|
22
|
-
import { normalizeInlineEdit as
|
|
23
|
-
import { sanitizeCbvLinkState as
|
|
24
|
-
import { rememberedListPage as
|
|
25
|
-
import { expandCoalesced as
|
|
26
|
-
import { useRowChanges as
|
|
27
|
-
import { loadErrorStatus as
|
|
28
|
-
import { OPEN_IN_TABS_CAP as
|
|
29
|
-
import { isOwnWrite as
|
|
30
|
-
import { useIdleNextPage as
|
|
31
|
-
import { useRowPresence as
|
|
32
|
-
import { cascadeFilter as
|
|
33
|
-
import { useOptionalRealtime as
|
|
34
|
-
import { rowMenuRef as yr, friendlyIdOf as ps, copyWhenReady as
|
|
35
|
-
import { rowHighlightDotClass as
|
|
14
|
+
import { parseDateFilter as xa, dateFilterBounds as wi, describeDateFilter as _i, DATE_FILTER_OPS as Ni, formatDateFilter as Si } from "../lib/date-filter.js";
|
|
15
|
+
import { errorSentence as Ci } from "../lib/error-message.js";
|
|
16
|
+
import { toastError as $i, errorToastOptions as br } from "../lib/error-toast.js";
|
|
17
|
+
import { extractExpressionTokens as qi, evaluateNumeric as os } from "../lib/expression.js";
|
|
18
|
+
import { clauseFromCondition as hr, clauseFromControlValue as Ti, filterSentence as Li } from "../lib/filter-sentence.js";
|
|
19
|
+
import { deliverLive as Fi, releaseLiveOwner as Ri } from "../lib/focus-mode.js";
|
|
20
|
+
import { formatValue as xn, formatMultiValue as is, countFromResolved as Ei } from "../lib/format-value.js";
|
|
21
|
+
import { createCursorBook as Pi, pageRequest as Di, noteNextCursor as Mi, isCursorRefusal as Oi, stopCursors as Ai } from "../lib/keyset-pager.js";
|
|
22
|
+
import { normalizeInlineEdit as Ii, inlineM2oTarget as Ki, inlineChoices as ji, inlineEditFor as Bi, nextInlineKey as zi } from "../lib/list-inline-edit.js";
|
|
23
|
+
import { sanitizeCbvLinkState as Qi, readListLinkFromLocation as Ui, dropListLinkParam as Wi } from "../lib/list-link.js";
|
|
24
|
+
import { rememberedListPage as Vi, pageWhileSettling as ds, rememberListPage as Hi, restoreWindowOutcome as Yi } from "../lib/list-page-memory.js";
|
|
25
|
+
import { expandCoalesced as Ji, LIVE_ASPECTS as vn } from "../lib/live.js";
|
|
26
|
+
import { useRowChanges as Gi, useRowLocks as Xi, lockLabel as Zi, viewerMatches as ed, conditionFields as td, mayAffectMatch as nd, writerOf as ad } from "../lib/live-list.js";
|
|
27
|
+
import { loadErrorStatus as rd, listLoadErrorText as ld } from "../lib/load-error.js";
|
|
28
|
+
import { OPEN_IN_TABS_CAP as sd, openInTabs as od, openInTabsMessage as cs } from "../lib/open-in-tabs.js";
|
|
29
|
+
import { isOwnWrite as id } from "../lib/own-writes.js";
|
|
30
|
+
import { useIdleNextPage as dd, intentProps as cd, prefetchRecord as ud } from "../lib/prefetch.js";
|
|
31
|
+
import { useRowPresence as pd, rowPresenceKey as us } from "../lib/presence-hooks.js";
|
|
32
|
+
import { cascadeFilter as md, fetchCascadeRelations as fd } from "../lib/quick-filter-cascade.js";
|
|
33
|
+
import { useOptionalRealtime as bd } from "../lib/realtime.js";
|
|
34
|
+
import { rowMenuRef as yr, friendlyIdOf as ps, copyWhenReady as hd, shareableRecordId as gd } from "../lib/record-ref.js";
|
|
35
|
+
import { rowHighlightDotClass as xd, rowHighlightClass as vd } from "../lib/row-highlight.js";
|
|
36
36
|
import { userErrorMessage as Wt } from "../lib/safe-error.js";
|
|
37
|
-
import { logSearch as
|
|
38
|
-
import { shapeForField as
|
|
39
|
-
import { knownTotalFrom as
|
|
40
|
-
import { useMyScopes as
|
|
41
|
-
import { useNewItemLayouts as
|
|
42
|
-
import { loadUserCard as
|
|
43
|
-
import { cn as Ut, humanHours as
|
|
44
|
-
import { usePublishAskContext as
|
|
45
|
-
import { useAvailableBulkActions as
|
|
46
|
-
import { BulkFieldUpdate as
|
|
47
|
-
import { BulkRowMark as
|
|
48
|
-
import { useRowPushActions as
|
|
49
|
-
import { CellCopyLayer as
|
|
50
|
-
import { CopyAsButton as
|
|
51
|
-
import { useTreeConfig as
|
|
52
|
-
import { relatedMissing as Ud } from "./item-edit/related-missing.js";
|
|
37
|
+
import { logSearch as kd, logSearchOpen as yd } from "../lib/search-log.js";
|
|
38
|
+
import { shapeForField as wd } from "../lib/skeleton-shapes.js";
|
|
39
|
+
import { knownTotalFrom as _d } from "../lib/slow-reason.js";
|
|
40
|
+
import { useMyScopes as Nd, matchScopeDimension as ms, effectiveScopeSeedIds as Sd, translateScopeValues as Cd } from "../lib/use-my-scopes.js";
|
|
41
|
+
import { useNewItemLayouts as $d } from "../lib/use-new-item-layouts.js";
|
|
42
|
+
import { loadUserCard as qd, userCardQuery as Td } from "../lib/user-cards.js";
|
|
43
|
+
import { cn as Ut, humanHours as Ld } from "../lib/utils.js";
|
|
44
|
+
import { usePublishAskContext as Fd, useAskRecordDrag as Rd } from "./ai/ask-context.js";
|
|
45
|
+
import { useAvailableBulkActions as Ed, mergeBulkActions as Pd, guardMatches as Dd, useBuiltinGate as Md, BulkActionButtons as Od } from "./bulk/BulkActionButtons.js";
|
|
46
|
+
import { BulkFieldUpdate as Ad } from "./bulk/BulkFieldUpdate.js";
|
|
47
|
+
import { BulkRowMark as Id } from "./bulk/BulkRowMark.js";
|
|
48
|
+
import { useRowPushActions as Kd, runRowPush as jd } from "./bulk/RowPushActions.js";
|
|
49
|
+
import { CellCopyLayer as Bd } from "./CellCopyLayer.js";
|
|
50
|
+
import { CopyAsButton as zd } from "./CopyAsButton.js";
|
|
51
|
+
import { useTreeConfig as Qd, CollectionTree as Ud } from "./cbv/CollectionTree.js";
|
|
53
52
|
import { readExportRows as Wd, stableSort as Vd, m2oLabelPaths as Hd, resolveAllPaths as Yd, userLabel as Jd, m2oLabel as Gd, localYmd as Xd } from "./cbv/export-rows.js";
|
|
54
53
|
import { FormulaColumnAdder as Zd } from "./cbv/FormulaColumnAdder.js";
|
|
55
54
|
import { useHierarchyScope as ec, HierarchyScopePicker as tc } from "./cbv/HierarchyScope.js";
|
|
@@ -67,24 +66,26 @@ import { INTEGRATIONS_FILTER_OPTIONS as gs, IntegrationDots as xc } from "./inte
|
|
|
67
66
|
import { useQuickPickerSteps as vc, QuickPickerDialog as kc } from "./item-edit/QuickPickerDialog.js";
|
|
68
67
|
import { usePickerExclusion as yc } from "./item-edit/RecordGrantTools.js";
|
|
69
68
|
import { invalidateRecordQueries as xs } from "./item-edit/RecordLiveSync.js";
|
|
69
|
+
import { relatedMissing as wc } from "./item-edit/related-missing.js";
|
|
70
70
|
import { UserRosterCluster as vs, UserChip as ks } from "./item-edit/UserChip.js";
|
|
71
|
-
import { LiveRowMark as
|
|
72
|
-
import { CopyListLinkButton as
|
|
73
|
-
import { useInlineEdit as
|
|
74
|
-
import { MapView as
|
|
75
|
-
import { usePickerExcludedRows as
|
|
76
|
-
import {
|
|
77
|
-
import {
|
|
78
|
-
import {
|
|
79
|
-
import {
|
|
80
|
-
import {
|
|
81
|
-
import {
|
|
82
|
-
import {
|
|
83
|
-
import {
|
|
71
|
+
import { LiveRowMark as _c } from "./LiveRowMark.js";
|
|
72
|
+
import { CopyListLinkButton as Nc } from "./list/CopyListLinkButton.js";
|
|
73
|
+
import { useInlineEdit as Sc, InlineEditCell as Cc } from "./list/InlineEdit.js";
|
|
74
|
+
import { MapView as $c } from "./MapView.js";
|
|
75
|
+
import { usePickerExcludedRows as qc, PICKER_EXCLUDED_ROW_CLASS as Tc, PICKER_EXCLUDED_TITLE as Lc } from "./PickerExcludedRows.js";
|
|
76
|
+
import { ConfirmButton as Fs } from "./profile/primitives.js";
|
|
77
|
+
import { RealtimeStaleMark as Fc } from "./RealtimeStatusBanner.js";
|
|
78
|
+
import { RecordCompareDialog as Rc } from "./RecordCompare.js";
|
|
79
|
+
import { RecordDrilldownSheet as Ec } from "./RecordDrilldownSheet.js";
|
|
80
|
+
import { RowHighlightLegend as Pc } from "./RowHighlightLegend.js";
|
|
81
|
+
import { RowPresence as Dc } from "./RowPresence.js";
|
|
82
|
+
import { TableSkeletonRows as Mc } from "./Skeletons.js";
|
|
83
|
+
import { SlowNoticeView as Oc } from "./SlowNotice.js";
|
|
84
|
+
import { TipLayer as Ac } from "./TipLayer.js";
|
|
84
85
|
import { UnseenDot as ys } from "./UnseenDot.js";
|
|
85
|
-
import { SimpleSelectXs as kn, SimpleSelect as
|
|
86
|
-
import { RevisionsPanel as
|
|
87
|
-
import { itemActionChoiceStep as
|
|
86
|
+
import { SimpleSelectXs as kn, SimpleSelect as Ic } from "./ui/SimpleSelect.js";
|
|
87
|
+
import { RevisionsPanel as Kc } from "./panels/RevisionsPanel.js";
|
|
88
|
+
import { itemActionChoiceStep as jc, ItemActionChoiceList as Bc } from "./panels/ItemActionChoices.js";
|
|
88
89
|
function zn(a, i, b) {
|
|
89
90
|
const d = a.find((v) => v.one_collection === i && v.one_field === b);
|
|
90
91
|
if (d != null && d.many_collection)
|
|
@@ -134,7 +135,7 @@ function ma(a, i) {
|
|
|
134
135
|
}
|
|
135
136
|
return null;
|
|
136
137
|
}
|
|
137
|
-
const
|
|
138
|
+
const zc = [
|
|
138
139
|
{ label: "None", cfg: null },
|
|
139
140
|
{ label: "Currency", cfg: { type: "number", decimals: 2, thousands: !0, prefix: "$" } },
|
|
140
141
|
{ label: "Number", cfg: { type: "number", thousands: !0 } },
|
|
@@ -168,7 +169,7 @@ function Nr(a, i, b) {
|
|
|
168
169
|
(d) => d.many_collection === i && d.many_field === b && d.junction_field === null && d.one_collection !== null
|
|
169
170
|
);
|
|
170
171
|
}
|
|
171
|
-
function
|
|
172
|
+
function Qc(a) {
|
|
172
173
|
const i = new Date(String(a));
|
|
173
174
|
if (Number.isNaN(i.getTime())) return String(a);
|
|
174
175
|
const b = Date.now() - i.getTime(), d = Math.floor(b / 6e4);
|
|
@@ -179,8 +180,8 @@ function zc(a) {
|
|
|
179
180
|
const _ = Math.floor(v / 24);
|
|
180
181
|
return _ < 7 ? `${_}d ago` : i.toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" });
|
|
181
182
|
}
|
|
182
|
-
const ct = (a) => a.toLocaleString("en-US"),
|
|
183
|
-
function
|
|
183
|
+
const ct = (a) => a.toLocaleString("en-US"), Rs = /* @__PURE__ */ new Set(["nivaro_users", "directus_users"]), Ct = (a) => a.startsWith("directus_") || a.startsWith("nivaro_"), gr = /* @__PURE__ */ new Map();
|
|
184
|
+
function Es(a, i, b) {
|
|
184
185
|
let d = gr.get(i);
|
|
185
186
|
d || (d = { ids: /* @__PURE__ */ new Set(), waiters: [], promise: null }, gr.set(i, d));
|
|
186
187
|
const v = d;
|
|
@@ -210,16 +211,16 @@ function Rs(a, i, b) {
|
|
|
210
211
|
}, 0);
|
|
211
212
|
})), v.promise.then((_) => _.get(b) ?? null);
|
|
212
213
|
}
|
|
213
|
-
const
|
|
214
|
+
const Uc = {
|
|
214
215
|
draft: "draft",
|
|
215
216
|
submitted: "submitted",
|
|
216
217
|
review: "in review",
|
|
217
218
|
approved: "approved",
|
|
218
219
|
rejected: "rejected"
|
|
219
220
|
};
|
|
220
|
-
function
|
|
221
|
+
function Wc({ summary: a }) {
|
|
221
222
|
if (!a || a.total === 0) return /* @__PURE__ */ n("span", { className: "text-[12px] text-slate-300", children: "—" });
|
|
222
|
-
const i = a.latest, b = a.active > 0, d = i ?
|
|
223
|
+
const i = a.latest, b = a.active > 0, d = i ? Uc[i.status] ?? i.status : "", v = i == null ? void 0 : i.cost_impact, _ = v != null && v !== 0 ? `${v > 0 ? "+" : "−"}$${Math.abs(v).toLocaleString(void 0, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}` : null, C = i ? `${i.title ?? "Addendum"} — ${d}${a.total > 1 ? ` (${a.total} total)` : ""}` : void 0;
|
|
223
224
|
return /* @__PURE__ */ c(
|
|
224
225
|
"span",
|
|
225
226
|
{
|
|
@@ -243,7 +244,7 @@ function Uc({ summary: a }) {
|
|
|
243
244
|
);
|
|
244
245
|
}
|
|
245
246
|
function Sr({ relatedCollection: a, id: i }) {
|
|
246
|
-
const b = ut(), d =
|
|
247
|
+
const b = ut(), d = Rs.has(a), v = i != null && i !== "", { data: _ } = le({
|
|
247
248
|
queryKey: ["cbv-collection-meta", a],
|
|
248
249
|
queryFn: () => b.request(X(`/collections/${a}`)).then((N) => N.data),
|
|
249
250
|
staleTime: 10 * 6e4,
|
|
@@ -251,7 +252,7 @@ function Sr({ relatedCollection: a, id: i }) {
|
|
|
251
252
|
retry: !1
|
|
252
253
|
}), { data: C, isLoading: $ } = le({
|
|
253
254
|
queryKey: ["cbv-relation-item", a, String(i)],
|
|
254
|
-
queryFn: () => d ? b.request(X(`/users/${i}`)).then((N) => N.data) :
|
|
255
|
+
queryFn: () => d ? b.request(X(`/users/${i}`)).then((N) => N.data) : Es(b, a, String(i)),
|
|
255
256
|
enabled: v && (d || !Ct(a)),
|
|
256
257
|
staleTime: 30 * 6e4,
|
|
257
258
|
retry: !1
|
|
@@ -260,7 +261,7 @@ function Sr({ relatedCollection: a, id: i }) {
|
|
|
260
261
|
if ($)
|
|
261
262
|
return /* @__PURE__ */ n("span", { className: "inline-block h-3.5 w-24 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" });
|
|
262
263
|
if (!C) {
|
|
263
|
-
const N =
|
|
264
|
+
const N = wc(null);
|
|
264
265
|
return /* @__PURE__ */ n(
|
|
265
266
|
"span",
|
|
266
267
|
{
|
|
@@ -276,10 +277,10 @@ function Sr({ relatedCollection: a, id: i }) {
|
|
|
276
277
|
) : va((_ == null ? void 0 : _.display_template) ?? null, C);
|
|
277
278
|
return /* @__PURE__ */ n("span", { className: "text-[12px] text-slate-700 dark:text-slate-200", children: S });
|
|
278
279
|
}
|
|
279
|
-
function
|
|
280
|
+
function Ps(a, i, b, d, v, _) {
|
|
280
281
|
const C = i.getQueryData(["cbv-collection-meta", b]);
|
|
281
|
-
return
|
|
282
|
-
|
|
282
|
+
return hd(
|
|
283
|
+
gd(a, b, C, d, v).then(
|
|
283
284
|
($) => window.location.origin + _({ collection: b, itemId: $ })
|
|
284
285
|
)
|
|
285
286
|
).catch(() => {
|
|
@@ -297,17 +298,17 @@ function ha(a, i) {
|
|
|
297
298
|
])
|
|
298
299
|
a.invalidateQueries({ queryKey: [b, i] });
|
|
299
300
|
}
|
|
300
|
-
function
|
|
301
|
+
function Vc(a, i) {
|
|
301
302
|
return a ? a.is_admin ? !0 : (a.collections ?? []).some(
|
|
302
303
|
(b) => (b.collection === i || b.collection === "*") && (b.actions.includes("update") || b.actions.includes("*"))
|
|
303
304
|
) : !1;
|
|
304
305
|
}
|
|
305
|
-
function
|
|
306
|
+
function Hc(a, i) {
|
|
306
307
|
return a ? a.is_admin ? !0 : (a.collections ?? []).some(
|
|
307
308
|
(b) => (b.collection === i || b.collection === "*") && (b.actions.includes("delete") || b.actions.includes("*"))
|
|
308
309
|
) : !1;
|
|
309
310
|
}
|
|
310
|
-
function
|
|
311
|
+
function Yc({
|
|
311
312
|
collection: a,
|
|
312
313
|
id: i,
|
|
313
314
|
hasPipeline: b,
|
|
@@ -338,7 +339,7 @@ function Hc({
|
|
|
338
339
|
queryFn: () => u.request(X("/security/my/permissions")).then((h) => h.data),
|
|
339
340
|
enabled: m && !W,
|
|
340
341
|
staleTime: 5 * 6e4
|
|
341
|
-
}), ve = W ||
|
|
342
|
+
}), ve = W || Hc(oe, a), J = yc(a, String(i), {
|
|
342
343
|
enabled: m && W,
|
|
343
344
|
onDone: () => L(!1)
|
|
344
345
|
}), [G, Me] = k(!1), Je = ic(m), ae = dc() && !!(Je != null && Je.some((h) => h.collection === a));
|
|
@@ -363,8 +364,8 @@ function Hc({
|
|
|
363
364
|
}), pt = xe(
|
|
364
365
|
() => ((se == null ? void 0 : se.available_transitions) ?? []).filter((h) => h.in_row_menu !== !1),
|
|
365
366
|
[se]
|
|
366
|
-
), { data: F } =
|
|
367
|
-
() => m ?
|
|
367
|
+
), { data: F } = Ed(m ? [a] : []), ee = xe(
|
|
368
|
+
() => m ? Pd(F, [a], K).filter(
|
|
368
369
|
// Transition-kind registry actions (Cancel / Uncancel) are the pipeline
|
|
369
370
|
// transitions already listed above — never the same move twice.
|
|
370
371
|
(h) => h.kind !== "builtin" && h.kind !== "transition"
|
|
@@ -391,8 +392,8 @@ function Hc({
|
|
|
391
392
|
return !((te = E.guard) != null && te.length);
|
|
392
393
|
});
|
|
393
394
|
const h = { ...ce ?? {}, ...N ?? {} };
|
|
394
|
-
return ee.filter((E) =>
|
|
395
|
-
}, [ee, fe, ce, N]), { pushActions: U, failedPartners: ie } =
|
|
395
|
+
return ee.filter((E) => Dd(E.guard, h) !== !1);
|
|
396
|
+
}, [ee, fe, ce, N]), { pushActions: U, failedPartners: ie } = Kd({
|
|
396
397
|
collection: a,
|
|
397
398
|
id: i,
|
|
398
399
|
open: m,
|
|
@@ -440,8 +441,8 @@ function Hc({
|
|
|
440
441
|
staleTime: 0
|
|
441
442
|
}), [Kt, sn] = k(null), wn = (Ke == null ? void 0 : Ke.id) ?? null;
|
|
442
443
|
pe(() => sn(null), [wn]);
|
|
443
|
-
const Xe = Vt.data ?
|
|
444
|
-
|
|
444
|
+
const Xe = Vt.data ? jc(Vt.data) : null, ft = Xe && !Xe.ask ? Xe.value : Kt, Pt = !!Ke && (!Xe || Xe.ask && Kt == null);
|
|
445
|
+
ui.useLayoutEffect(() => {
|
|
445
446
|
var Ve;
|
|
446
447
|
if (!m) return;
|
|
447
448
|
const h = Z.current;
|
|
@@ -490,7 +491,7 @@ function Hc({
|
|
|
490
491
|
we.error((E == null ? void 0 : E.error) ?? Wt(h, "Action failed"), br(h));
|
|
491
492
|
}
|
|
492
493
|
}), qt = yt({
|
|
493
|
-
mutationFn: ({ op: h, note: E, pick: te }) =>
|
|
494
|
+
mutationFn: ({ op: h, note: E, pick: te }) => jd(u, a, i, h, E, te).then((Se) => ({ op: h, outcome: Se })),
|
|
494
495
|
onSuccess: ({ op: h, outcome: E }) => {
|
|
495
496
|
L(!1);
|
|
496
497
|
const te = h.kind === "push" ? h.action.label : "Retry";
|
|
@@ -570,7 +571,7 @@ function Hc({
|
|
|
570
571
|
}
|
|
571
572
|
),
|
|
572
573
|
(Ke == null ? void 0 : Ke.choose) && (Vt.isError ? /* @__PURE__ */ n("p", { className: "mb-1.5 px-1 text-[11.5px] text-red-600 dark:text-red-400", children: "Could not load the options." }) : Vt.isLoading ? /* @__PURE__ */ n("p", { className: "mb-1.5 px-1 text-[11.5px] text-slate-500 dark:text-slate-400", children: "Loading…" }) : Xe != null && Xe.ask ? /* @__PURE__ */ n("div", { className: "mb-1.5 -mt-3 px-1", children: /* @__PURE__ */ n(
|
|
573
|
-
|
|
574
|
+
Bc,
|
|
574
575
|
{
|
|
575
576
|
choose: Ke.choose,
|
|
576
577
|
options: Vt.data ?? [],
|
|
@@ -754,7 +755,7 @@ function Hc({
|
|
|
754
755
|
L(!1), (h = navigator.clipboard) == null || h.writeText(R.copy ?? ""), we.success("ID copied");
|
|
755
756
|
}),
|
|
756
757
|
wt("Copy link", () => {
|
|
757
|
-
L(!1),
|
|
758
|
+
L(!1), Ps(u, w, a, N, i, C), we.success("Link copied");
|
|
758
759
|
}),
|
|
759
760
|
W && /* @__PURE__ */ c(Be, { children: [
|
|
760
761
|
Ze,
|
|
@@ -850,7 +851,7 @@ function Ns({
|
|
|
850
851
|
);
|
|
851
852
|
return /* @__PURE__ */ n("span", { className: "text-[12px] tabular-nums text-slate-400", children: $ });
|
|
852
853
|
}
|
|
853
|
-
return /* @__PURE__ */ n("span", { className: "text-[12px] tabular-nums text-slate-400", children:
|
|
854
|
+
return /* @__PURE__ */ n("span", { className: "text-[12px] tabular-nums text-slate-400", children: Qc(d) });
|
|
854
855
|
}
|
|
855
856
|
return typeof d == "string" ? /* @__PURE__ */ n(
|
|
856
857
|
"span",
|
|
@@ -980,7 +981,7 @@ function wa({
|
|
|
980
981
|
] })
|
|
981
982
|
] });
|
|
982
983
|
}
|
|
983
|
-
function
|
|
984
|
+
function Jc({
|
|
984
985
|
target: a,
|
|
985
986
|
label: i,
|
|
986
987
|
selected: b,
|
|
@@ -1051,7 +1052,7 @@ function Yc({
|
|
|
1051
1052
|
}
|
|
1052
1053
|
);
|
|
1053
1054
|
}
|
|
1054
|
-
function
|
|
1055
|
+
function Gc({
|
|
1055
1056
|
collection: a,
|
|
1056
1057
|
field: i,
|
|
1057
1058
|
selected: b,
|
|
@@ -1079,7 +1080,7 @@ function Jc({
|
|
|
1079
1080
|
}
|
|
1080
1081
|
);
|
|
1081
1082
|
}
|
|
1082
|
-
function
|
|
1083
|
+
function Xc({
|
|
1083
1084
|
value: a,
|
|
1084
1085
|
onChange: i
|
|
1085
1086
|
}) {
|
|
@@ -1101,7 +1102,7 @@ function Gc({
|
|
|
1101
1102
|
var w;
|
|
1102
1103
|
if (!a) return "All";
|
|
1103
1104
|
const u = xa(a);
|
|
1104
|
-
return u ?
|
|
1105
|
+
return u ? _i(u) : ((w = ka.find((W) => W.value === a)) == null ? void 0 : w.label) ?? a;
|
|
1105
1106
|
})(), [K, z] = k("between");
|
|
1106
1107
|
pe(() => {
|
|
1107
1108
|
var u;
|
|
@@ -1109,7 +1110,7 @@ function Gc({
|
|
|
1109
1110
|
}, [b, a]);
|
|
1110
1111
|
const P = () => {
|
|
1111
1112
|
const u = v || C;
|
|
1112
|
-
u && (i(
|
|
1113
|
+
u && (i(Si({ op: K, from: u, to: C || v || u })), d(!1));
|
|
1113
1114
|
};
|
|
1114
1115
|
return /* @__PURE__ */ c("div", { ref: S, className: "relative w-full", children: [
|
|
1115
1116
|
/* @__PURE__ */ c(
|
|
@@ -1154,7 +1155,7 @@ function Gc({
|
|
|
1154
1155
|
)) }),
|
|
1155
1156
|
/* @__PURE__ */ c("div", { className: "border-t border-slate-100 p-2 dark:border-slate-800", children: [
|
|
1156
1157
|
/* @__PURE__ */ n("p", { className: "pb-1 text-[10px] font-semibold uppercase tracking-wide text-slate-400", children: "Date or range" }),
|
|
1157
|
-
/* @__PURE__ */ n("div", { className: "grid grid-cols-3 gap-1 pb-1.5", children:
|
|
1158
|
+
/* @__PURE__ */ n("div", { className: "grid grid-cols-3 gap-1 pb-1.5", children: Ni.map((u) => /* @__PURE__ */ n(
|
|
1158
1159
|
"button",
|
|
1159
1160
|
{
|
|
1160
1161
|
type: "button",
|
|
@@ -1204,7 +1205,7 @@ function Gc({
|
|
|
1204
1205
|
] })
|
|
1205
1206
|
] });
|
|
1206
1207
|
}
|
|
1207
|
-
function
|
|
1208
|
+
function Zc({
|
|
1208
1209
|
def: a,
|
|
1209
1210
|
selected: i,
|
|
1210
1211
|
onChange: b,
|
|
@@ -1225,9 +1226,9 @@ function Xc({
|
|
|
1225
1226
|
i.map(String).sort().join(",")
|
|
1226
1227
|
],
|
|
1227
1228
|
queryFn: async () => {
|
|
1228
|
-
const R = z !== "[]" ?
|
|
1229
|
+
const R = z !== "[]" ? md(
|
|
1229
1230
|
a.collection,
|
|
1230
|
-
await
|
|
1231
|
+
await fd(C, $, a.collection),
|
|
1231
1232
|
_
|
|
1232
1233
|
) : null, m = (q, Z) => C.request(
|
|
1233
1234
|
X(`/items/${a.collection}`, {
|
|
@@ -1274,7 +1275,7 @@ function Xc({
|
|
|
1274
1275
|
}
|
|
1275
1276
|
);
|
|
1276
1277
|
}
|
|
1277
|
-
const
|
|
1278
|
+
const Ds = [
|
|
1278
1279
|
{ value: "_eq", label: "=" },
|
|
1279
1280
|
{ value: "_neq", label: "≠" },
|
|
1280
1281
|
{ value: "_gt", label: ">" },
|
|
@@ -1288,7 +1289,7 @@ const Ps = [
|
|
|
1288
1289
|
{ value: "30d", label: "30 days" },
|
|
1289
1290
|
{ value: "90d", label: "90 days" },
|
|
1290
1291
|
{ value: "year", label: "This year" }
|
|
1291
|
-
],
|
|
1292
|
+
], eu = {
|
|
1292
1293
|
_eq: "_neq",
|
|
1293
1294
|
_neq: "_eq",
|
|
1294
1295
|
_in: "_nin",
|
|
@@ -1302,7 +1303,7 @@ const Ps = [
|
|
|
1302
1303
|
_lt: "_gte",
|
|
1303
1304
|
_lte: "_gt"
|
|
1304
1305
|
};
|
|
1305
|
-
function
|
|
1306
|
+
function Ms(a) {
|
|
1306
1307
|
const i = /* @__PURE__ */ new Date(), b = (v) => v.toISOString().slice(0, 10), d = b(i);
|
|
1307
1308
|
if (a === "today") return { from: d, to: d };
|
|
1308
1309
|
if (a === "7d" || a === "30d" || a === "90d") {
|
|
@@ -1331,7 +1332,7 @@ function Ss(a) {
|
|
|
1331
1332
|
continue;
|
|
1332
1333
|
}
|
|
1333
1334
|
if (d.op === "_preset") {
|
|
1334
|
-
const $ =
|
|
1335
|
+
const $ = Ms(String(d.value));
|
|
1335
1336
|
$ && (d.not ? i.push({
|
|
1336
1337
|
or: [
|
|
1337
1338
|
{ path: d.path, op: "_lt", value: $.from },
|
|
@@ -1341,7 +1342,7 @@ function Ss(a) {
|
|
|
1341
1342
|
continue;
|
|
1342
1343
|
}
|
|
1343
1344
|
let _ = d.op.includes(":") ? d.op.split(":")[0] : d.op, C = d.op.includes(":") ? d.op.split(":")[1] : d.value || null;
|
|
1344
|
-
d.fieldType === "boolean" && (C === "true" || C === "false") && (C = C === "true"), d.not && (_ =
|
|
1345
|
+
d.fieldType === "boolean" && (C === "true" || C === "false") && (C = C === "true"), d.not && (_ = eu[_] ?? _), i.push({ path: d.path, op: _, value: C });
|
|
1345
1346
|
}
|
|
1346
1347
|
return i;
|
|
1347
1348
|
}
|
|
@@ -1369,7 +1370,7 @@ const Cs = [
|
|
|
1369
1370
|
{ label: "After", value: "_gt" },
|
|
1370
1371
|
{ label: "Is empty", value: "_null" },
|
|
1371
1372
|
{ label: "Is not empty", value: "_nnull" }
|
|
1372
|
-
],
|
|
1373
|
+
], tu = {
|
|
1373
1374
|
string: Cs,
|
|
1374
1375
|
text: Cs,
|
|
1375
1376
|
integer: vr,
|
|
@@ -1390,8 +1391,8 @@ const Cs = [
|
|
|
1390
1391
|
{ label: "Is not empty", value: "_nnull" }
|
|
1391
1392
|
]
|
|
1392
1393
|
};
|
|
1393
|
-
function
|
|
1394
|
-
for (const i of Object.values(
|
|
1394
|
+
function nu(a) {
|
|
1395
|
+
for (const i of Object.values(tu)) {
|
|
1395
1396
|
const b = i.find((d) => d.value === a);
|
|
1396
1397
|
if (b) return b.label;
|
|
1397
1398
|
}
|
|
@@ -1459,7 +1460,7 @@ function Cr({
|
|
|
1459
1460
|
}
|
|
1460
1461
|
),
|
|
1461
1462
|
w && R && /* @__PURE__ */ n(
|
|
1462
|
-
|
|
1463
|
+
Os,
|
|
1463
1464
|
{
|
|
1464
1465
|
aliasInfo: w,
|
|
1465
1466
|
depth: i + 1,
|
|
@@ -1472,7 +1473,7 @@ function Cr({
|
|
|
1472
1473
|
] }, P.field);
|
|
1473
1474
|
}) });
|
|
1474
1475
|
}
|
|
1475
|
-
function
|
|
1476
|
+
function Os({
|
|
1476
1477
|
aliasInfo: a,
|
|
1477
1478
|
depth: i,
|
|
1478
1479
|
path: b,
|
|
@@ -1513,7 +1514,7 @@ function $s(a, i, b) {
|
|
|
1513
1514
|
const d = a.type ?? "string";
|
|
1514
1515
|
return d === "integer" || d === "decimal" || d === "float" ? "number" : d === "datetime" || d === "timestamp" ? "date" : d;
|
|
1515
1516
|
}
|
|
1516
|
-
function
|
|
1517
|
+
function au({
|
|
1517
1518
|
collection: a,
|
|
1518
1519
|
path: i,
|
|
1519
1520
|
pathLabels: b,
|
|
@@ -1658,7 +1659,7 @@ function nu({
|
|
|
1658
1659
|
m.key
|
|
1659
1660
|
)) });
|
|
1660
1661
|
}
|
|
1661
|
-
function
|
|
1662
|
+
function ru({
|
|
1662
1663
|
target: a,
|
|
1663
1664
|
selected: i,
|
|
1664
1665
|
labels: b,
|
|
@@ -1729,7 +1730,7 @@ function au({
|
|
|
1729
1730
|
] })
|
|
1730
1731
|
] });
|
|
1731
1732
|
}
|
|
1732
|
-
function
|
|
1733
|
+
function lu(a) {
|
|
1733
1734
|
var b, d;
|
|
1734
1735
|
const i = a.pathLabels.join(" › ");
|
|
1735
1736
|
if (Array.isArray(a.value)) {
|
|
@@ -1748,9 +1749,9 @@ function ru(a) {
|
|
|
1748
1749
|
const v = ((b = ka.find((_) => _.value === a.value)) == null ? void 0 : b.label) ?? String(a.value);
|
|
1749
1750
|
return { field: i, op: "in the", value: `${v} (rolling)` };
|
|
1750
1751
|
}
|
|
1751
|
-
return (d = a.path[0]) != null && d.startsWith("$has_") || a.path[0] === "$missing_required" ? { field: i, op: "", value: "" } : { field: i, op:
|
|
1752
|
+
return (d = a.path[0]) != null && d.startsWith("$has_") || a.path[0] === "$missing_required" ? { field: i, op: "", value: "" } : { field: i, op: nu(a.op).toLowerCase(), value: String(a.value ?? "") };
|
|
1752
1753
|
}
|
|
1753
|
-
function
|
|
1754
|
+
function su({
|
|
1754
1755
|
collection: a,
|
|
1755
1756
|
meta: i,
|
|
1756
1757
|
search: b,
|
|
@@ -1822,7 +1823,7 @@ function lu({
|
|
|
1822
1823
|
if (P.relTarget !== void 0) return "relation";
|
|
1823
1824
|
const y = P.fieldType;
|
|
1824
1825
|
return y === "integer" || y === "decimal" || y === "float" ? "number" : y === "date" || y === "datetime" || y === "timestamp" ? "date" : y === "boolean" ? "boolean" : "string";
|
|
1825
|
-
})(), fe =
|
|
1826
|
+
})(), fe = Ds, ce = [
|
|
1826
1827
|
{ value: "_contains", label: "Contains" },
|
|
1827
1828
|
{ value: "_ncontains", label: "Doesn't contain" },
|
|
1828
1829
|
{ value: "_eq", label: "Equals" },
|
|
@@ -1924,7 +1925,7 @@ function lu({
|
|
|
1924
1925
|
y
|
|
1925
1926
|
)) }),
|
|
1926
1927
|
/* @__PURE__ */ n(
|
|
1927
|
-
|
|
1928
|
+
au,
|
|
1928
1929
|
{
|
|
1929
1930
|
collection: K.collection,
|
|
1930
1931
|
path: K.path,
|
|
@@ -1959,7 +1960,7 @@ function lu({
|
|
|
1959
1960
|
),
|
|
1960
1961
|
ee === "relation" && P.relTarget ? /* @__PURE__ */ c("div", { className: "pt-2", children: [
|
|
1961
1962
|
/* @__PURE__ */ n(
|
|
1962
|
-
|
|
1963
|
+
ru,
|
|
1963
1964
|
{
|
|
1964
1965
|
target: P.relTarget,
|
|
1965
1966
|
selected: O,
|
|
@@ -2128,7 +2129,7 @@ function lu({
|
|
|
2128
2129
|
] })
|
|
2129
2130
|
] }),
|
|
2130
2131
|
v.map((y) => {
|
|
2131
|
-
const U =
|
|
2132
|
+
const U = lu(y);
|
|
2132
2133
|
return /* @__PURE__ */ c(
|
|
2133
2134
|
"span",
|
|
2134
2135
|
{
|
|
@@ -2175,7 +2176,7 @@ function lu({
|
|
|
2175
2176
|
] })
|
|
2176
2177
|
);
|
|
2177
2178
|
}
|
|
2178
|
-
function
|
|
2179
|
+
function ou({
|
|
2179
2180
|
collection: a,
|
|
2180
2181
|
meta: i,
|
|
2181
2182
|
onPick: b
|
|
@@ -2216,7 +2217,7 @@ function su({
|
|
|
2216
2217
|
}
|
|
2217
2218
|
),
|
|
2218
2219
|
N && S && /* @__PURE__ */ n(
|
|
2219
|
-
|
|
2220
|
+
Os,
|
|
2220
2221
|
{
|
|
2221
2222
|
aliasInfo: S,
|
|
2222
2223
|
depth: 1,
|
|
@@ -2229,7 +2230,7 @@ function su({
|
|
|
2229
2230
|
] }, C.field);
|
|
2230
2231
|
}) });
|
|
2231
2232
|
}
|
|
2232
|
-
function
|
|
2233
|
+
function iu({
|
|
2233
2234
|
collection: a,
|
|
2234
2235
|
ids: i,
|
|
2235
2236
|
onDone: b,
|
|
@@ -2309,7 +2310,7 @@ function ou({
|
|
|
2309
2310
|
)
|
|
2310
2311
|
] });
|
|
2311
2312
|
}
|
|
2312
|
-
function
|
|
2313
|
+
function du({
|
|
2313
2314
|
collection: a,
|
|
2314
2315
|
selectedIds: i,
|
|
2315
2316
|
onDone: b,
|
|
@@ -2461,7 +2462,7 @@ function iu({
|
|
|
2461
2462
|
}
|
|
2462
2463
|
);
|
|
2463
2464
|
}
|
|
2464
|
-
function
|
|
2465
|
+
function cu({
|
|
2465
2466
|
collection: a,
|
|
2466
2467
|
selectedIds: i,
|
|
2467
2468
|
transitions: b,
|
|
@@ -2471,7 +2472,7 @@ function du({
|
|
|
2471
2472
|
onClear: C,
|
|
2472
2473
|
onSuccess: $
|
|
2473
2474
|
}) {
|
|
2474
|
-
const S = ga(), N = ut(), K = ya(), z = Ls(), [P, u] = k("actions"), w =
|
|
2475
|
+
const S = ga(), N = ut(), K = ya(), z = Ls(), [P, u] = k("actions"), w = Md([a], _), { data: W = [] } = le({
|
|
2475
2476
|
queryKey: ["bulk-recipes", a],
|
|
2476
2477
|
queryFn: () => N.request(X("/bulk-recipes", { collection: a })).then((F) => F.data ?? []).catch(() => []),
|
|
2477
2478
|
staleTime: 6e4
|
|
@@ -2523,15 +2524,15 @@ function du({
|
|
|
2523
2524
|
}
|
|
2524
2525
|
}, [Z, oe] = k(!1), [ve, J] = k(""), [G, Me] = k(!1), [Je, ae] = k(null), se = async (F) => {
|
|
2525
2526
|
Me(!0), ae(null);
|
|
2526
|
-
const ee =
|
|
2527
|
-
|
|
2527
|
+
const ee = xi();
|
|
2528
|
+
vi(ee, i);
|
|
2528
2529
|
try {
|
|
2529
2530
|
const fe = await F(ee);
|
|
2530
2531
|
ae(fe), $(), C(), u("actions");
|
|
2531
2532
|
} catch (fe) {
|
|
2532
|
-
ae(
|
|
2533
|
+
ae(Ci(fe, "Bulk action failed"));
|
|
2533
2534
|
} finally {
|
|
2534
|
-
|
|
2535
|
+
ki(ee), Me(!1);
|
|
2535
2536
|
}
|
|
2536
2537
|
}, pt = (F, ee) => void se(async (fe) => {
|
|
2537
2538
|
const ce = await N.request(
|
|
@@ -2570,12 +2571,12 @@ function du({
|
|
|
2570
2571
|
" selected"
|
|
2571
2572
|
] }),
|
|
2572
2573
|
Z && /* @__PURE__ */ n(
|
|
2573
|
-
|
|
2574
|
+
Rc,
|
|
2574
2575
|
{
|
|
2575
2576
|
collection: a,
|
|
2576
2577
|
ids: i.slice(0, 3),
|
|
2577
2578
|
fields: d,
|
|
2578
|
-
renderValue: (F, ee) =>
|
|
2579
|
+
renderValue: (F, ee) => pu(a, v, F, ee),
|
|
2579
2580
|
onClose: () => oe(!1)
|
|
2580
2581
|
}
|
|
2581
2582
|
),
|
|
@@ -2600,16 +2601,18 @@ function du({
|
|
|
2600
2601
|
}
|
|
2601
2602
|
),
|
|
2602
2603
|
F.mine && /* @__PURE__ */ n(
|
|
2603
|
-
|
|
2604
|
+
Fs,
|
|
2604
2605
|
{
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2606
|
+
title: `Delete recipe ${F.name}`,
|
|
2607
|
+
confirmLabel: "Delete?",
|
|
2608
|
+
confirmTitle: `Delete the recipe "${F.name}"?`,
|
|
2609
|
+
onConfirm: () => {
|
|
2610
|
+
N.request(ba(`/bulk-recipes/${F.id}`)).then(
|
|
2609
2611
|
() => K.invalidateQueries({ queryKey: ["bulk-recipes", a] })
|
|
2610
2612
|
);
|
|
2611
2613
|
},
|
|
2612
2614
|
className: "absolute -right-1.5 -top-1.5 hidden h-4 w-4 items-center justify-center rounded-full bg-slate-600 text-[9px] text-white dark:text-foreground hover:bg-red-600 group-hover/recipe:flex",
|
|
2615
|
+
armedClassName: "flex w-auto bg-red-600 px-1.5 font-semibold text-white dark:text-white",
|
|
2613
2616
|
children: "✕"
|
|
2614
2617
|
}
|
|
2615
2618
|
)
|
|
@@ -2620,13 +2623,13 @@ function du({
|
|
|
2620
2623
|
{
|
|
2621
2624
|
type: "button",
|
|
2622
2625
|
onClick: () => {
|
|
2623
|
-
const F =
|
|
2626
|
+
const F = od(
|
|
2624
2627
|
i.map((ee) => z.urlFor({ collection: a, itemId: String(ee) }))
|
|
2625
2628
|
);
|
|
2626
2629
|
F.blocked > 0 || F.capped > 0 ? we.warning(cs(F)) : we.success(cs(F));
|
|
2627
2630
|
},
|
|
2628
2631
|
"data-bulk-open-tabs": !0,
|
|
2629
|
-
title: `Open the selected records in new tabs (up to ${
|
|
2632
|
+
title: `Open the selected records in new tabs (up to ${sd})`,
|
|
2630
2633
|
className: "h-8 rounded-md border border-white/20 dark:border-border px-3 text-[12.5px] font-medium hover:bg-white/10 dark:hover:bg-muted",
|
|
2631
2634
|
children: "Open in tabs"
|
|
2632
2635
|
}
|
|
@@ -2651,7 +2654,7 @@ function du({
|
|
|
2651
2654
|
}
|
|
2652
2655
|
),
|
|
2653
2656
|
/* @__PURE__ */ n(
|
|
2654
|
-
|
|
2657
|
+
Od,
|
|
2655
2658
|
{
|
|
2656
2659
|
targets: i.map((F) => ({ collection: a, id: F })),
|
|
2657
2660
|
enabledKeys: _,
|
|
@@ -2663,7 +2666,7 @@ function du({
|
|
|
2663
2666
|
}
|
|
2664
2667
|
),
|
|
2665
2668
|
w("update-field") && /* @__PURE__ */ n(
|
|
2666
|
-
|
|
2669
|
+
Ad,
|
|
2667
2670
|
{
|
|
2668
2671
|
collection: a,
|
|
2669
2672
|
selectedIds: i,
|
|
@@ -2704,7 +2707,7 @@ function du({
|
|
|
2704
2707
|
)
|
|
2705
2708
|
] }),
|
|
2706
2709
|
P === "merge" && /* @__PURE__ */ n(
|
|
2707
|
-
|
|
2710
|
+
iu,
|
|
2708
2711
|
{
|
|
2709
2712
|
collection: a,
|
|
2710
2713
|
ids: i.slice(0, 2),
|
|
@@ -2715,7 +2718,7 @@ function du({
|
|
|
2715
2718
|
}
|
|
2716
2719
|
),
|
|
2717
2720
|
P === "message" && /* @__PURE__ */ n(
|
|
2718
|
-
|
|
2721
|
+
du,
|
|
2719
2722
|
{
|
|
2720
2723
|
collection: a,
|
|
2721
2724
|
selectedIds: i,
|
|
@@ -2742,7 +2745,7 @@ function du({
|
|
|
2742
2745
|
},
|
|
2743
2746
|
children: [
|
|
2744
2747
|
/* @__PURE__ */ n(
|
|
2745
|
-
|
|
2748
|
+
Ic,
|
|
2746
2749
|
{
|
|
2747
2750
|
value: ve,
|
|
2748
2751
|
onChange: J,
|
|
@@ -2863,7 +2866,7 @@ function du({
|
|
|
2863
2866
|
}
|
|
2864
2867
|
);
|
|
2865
2868
|
}
|
|
2866
|
-
const
|
|
2869
|
+
const uu = {
|
|
2867
2870
|
state: "badge",
|
|
2868
2871
|
entered: "date",
|
|
2869
2872
|
aging: "short",
|
|
@@ -2875,7 +2878,7 @@ const cu = {
|
|
|
2875
2878
|
tasks: "short",
|
|
2876
2879
|
addendums: "short"
|
|
2877
2880
|
};
|
|
2878
|
-
function
|
|
2881
|
+
function Vp({
|
|
2879
2882
|
collection: a,
|
|
2880
2883
|
quickFilters: i = [],
|
|
2881
2884
|
initialColumns: b,
|
|
@@ -2892,11 +2895,11 @@ function Up({
|
|
|
2892
2895
|
}) {
|
|
2893
2896
|
var Ul, Wl, Vl, Hl, Yl, Jl, Gl, Xl, Zl, es, ts;
|
|
2894
2897
|
const u = ut(), w = ya(), { open: W, urlFor: R } = Ls(), [m] = k(
|
|
2895
|
-
() =>
|
|
2898
|
+
() => Qi(Ui(`cbv:${a}`))
|
|
2896
2899
|
), [L] = k(
|
|
2897
2900
|
() => m ? fs(m.f ?? []) : null
|
|
2898
2901
|
), [D] = k(
|
|
2899
|
-
() => m ? null :
|
|
2902
|
+
() => m ? null : Vi(`cbv:${a}`)
|
|
2900
2903
|
), [O, q] = k((m == null ? void 0 : m.p) ?? D ?? 1), Z = me(D);
|
|
2901
2904
|
pe(() => {
|
|
2902
2905
|
const e = ds(Z.current, O);
|
|
@@ -2904,9 +2907,9 @@ function Up({
|
|
|
2904
2907
|
q(e);
|
|
2905
2908
|
return;
|
|
2906
2909
|
}
|
|
2907
|
-
|
|
2910
|
+
Hi(`cbv:${a}`, O);
|
|
2908
2911
|
}, [a, O]);
|
|
2909
|
-
const oe = me(
|
|
2912
|
+
const oe = me(Pi()), [ve, J] = k(m ? m.q ?? "" : _), G = ss(ve.trim(), 350), [Me, Je] = k(
|
|
2910
2913
|
L ? L.filters : C ?? []
|
|
2911
2914
|
), [ae, se] = k(m ? m.s ?? "" : d ?? ""), [pt, F] = k(b ?? null), [ee, fe] = k({}), [ce, y] = k({}), [U, ie] = k(null), [Ne, mt] = k({}), [rn, ln] = k({}), [It, Q] = k({}), [Ge, rt] = k({}), [yn, Ke] = k(null), [Vt, Kt] = k(!1), sn = me(null), [wn, Xe] = k(
|
|
2912
2915
|
() => (m == null ? void 0 : m.qf) ?? {}
|
|
@@ -2914,9 +2917,9 @@ function Up({
|
|
|
2914
2917
|
() => (m == null ? void 0 : m.qf) ?? {}
|
|
2915
2918
|
), [$t, on] = k(
|
|
2916
2919
|
m ? m.lc ?? [] : $ ?? []
|
|
2917
|
-
), { scopes: qt, ready: wt } =
|
|
2920
|
+
), { scopes: qt, ready: wt } = Nd(), [Ze, _n] = k(!1), [Nn, Qn] = k(/* @__PURE__ */ new Set()), [je, jt] = k(
|
|
2918
2921
|
() => (m == null ? void 0 : m.cf) ?? {}
|
|
2919
|
-
), bt =
|
|
2922
|
+
), bt = mi("drill.browser"), et = bt.value, [Sn, dn] = k(null), [cn, Ht] = k(!1), [Yt, Un] = k(() => {
|
|
2920
2923
|
try {
|
|
2921
2924
|
return localStorage.getItem("nvr_table_density") === "comfortable" ? "comfortable" : "compact";
|
|
2922
2925
|
} catch {
|
|
@@ -2957,7 +2960,7 @@ function Up({
|
|
|
2957
2960
|
const t = e.status, r = (l = e.response) == null ? void 0 : l.error;
|
|
2958
2961
|
t === 503 ? we.error("AI is not configured — add an Anthropic API key in Settings.") : we.error(r ?? "Could not answer that question");
|
|
2959
2962
|
}
|
|
2960
|
-
}),
|
|
2963
|
+
}), As = () => {
|
|
2961
2964
|
$r(null), Na("");
|
|
2962
2965
|
}, qr = me(!1);
|
|
2963
2966
|
pe(() => {
|
|
@@ -2972,8 +2975,8 @@ function Up({
|
|
|
2972
2975
|
};
|
|
2973
2976
|
}, [de]);
|
|
2974
2977
|
const [Jt, Gt] = k([]);
|
|
2975
|
-
|
|
2976
|
-
const [zt, Tn] = k(null), [
|
|
2978
|
+
gi();
|
|
2979
|
+
const [zt, Tn] = k(null), [Is, Sa] = k(!1), [Xt, Ca] = k(""), [$a, Lr] = k(!1), [Ks, Fr] = k(!1), [qa, pn] = k(!1), Rr = me(null);
|
|
2977
2980
|
pe(() => {
|
|
2978
2981
|
if (!qa) return;
|
|
2979
2982
|
const e = (t) => {
|
|
@@ -3009,30 +3012,30 @@ function Up({
|
|
|
3009
3012
|
pe(() => {
|
|
3010
3013
|
Or.current || !A || (Or.current = !0, !d && !ae && Le.default_sort && se(Le.default_sort));
|
|
3011
3014
|
}, [A]);
|
|
3012
|
-
const Lt = Le.checkbox_selection !== !1, Ar = Le.show_actions !== !1, [ht,
|
|
3013
|
-
ht && Gt([]),
|
|
3014
|
-
}, Hn = z && Le.allow_create !== !1, Ir = typeof Le.create_label == "string" && Le.create_label.trim().slice(0, 40) || "New item", Yn =
|
|
3015
|
+
const Lt = Le.checkbox_selection !== !1, Ar = Le.show_actions !== !1, [ht, js] = k(!1), Bs = () => {
|
|
3016
|
+
ht && Gt([]), js(!ht);
|
|
3017
|
+
}, Hn = z && Le.allow_create !== !1, Ir = typeof Le.create_label == "string" && Le.create_label.trim().slice(0, 40) || "New item", Yn = $d(Hn && !(A != null && A.singleton) ? a : null), [La, Ln] = k(!1), [Fa, Jn] = k(null), { steps: Ra } = vc(
|
|
3015
3018
|
Hn && !(A != null && A.singleton) ? a : null,
|
|
3016
3019
|
null
|
|
3017
3020
|
), Kr = (e) => {
|
|
3018
3021
|
e ? W({ collection: a, itemId: "new", layoutSlug: e }) : tn("new");
|
|
3019
|
-
}, Fn = hc(Hn && !(A != null && A.singleton) ? a : null),
|
|
3022
|
+
}, Fn = hc(Hn && !(A != null && A.singleton) ? a : null), zs = fi(), jr = me(null), [Qs, Us] = k(null), [Br, zr] = k(!1), Qr = (e) => {
|
|
3020
3023
|
var t;
|
|
3021
|
-
|
|
3022
|
-
},
|
|
3024
|
+
Us(e), (t = jr.current) == null || t.click();
|
|
3025
|
+
}, Ws = async (e) => {
|
|
3023
3026
|
const t = Array.from(e.target.files ?? []);
|
|
3024
3027
|
if (e.target.value = "", !!t.length) {
|
|
3025
3028
|
zr(!0);
|
|
3026
3029
|
try {
|
|
3027
|
-
const r = await gc(
|
|
3028
|
-
W({ collection: a, itemId: "new", layoutSlug:
|
|
3030
|
+
const r = await gc(zs, t, a);
|
|
3031
|
+
W({ collection: a, itemId: "new", layoutSlug: Qs, query: { autofill: r } });
|
|
3029
3032
|
} catch (r) {
|
|
3030
|
-
|
|
3033
|
+
$i(r, "The document could not be read", { action: "New from document" });
|
|
3031
3034
|
} finally {
|
|
3032
3035
|
zr(!1);
|
|
3033
3036
|
}
|
|
3034
3037
|
}
|
|
3035
|
-
},
|
|
3038
|
+
}, Vs = (e) => Array.isArray(e == null ? void 0 : e.quick_picker) ? e.quick_picker.filter((t) => typeof t == "string") : [], Ea = me(null), Ur = me(null);
|
|
3036
3039
|
pe(() => {
|
|
3037
3040
|
if (!La) return;
|
|
3038
3041
|
const e = (t) => {
|
|
@@ -3054,9 +3057,9 @@ function Up({
|
|
|
3054
3057
|
for (const l of Ft) {
|
|
3055
3058
|
const s = ms(e, { key: l.key, collection: l.collection });
|
|
3056
3059
|
if (!s) continue;
|
|
3057
|
-
const o =
|
|
3060
|
+
const o = Sd(e, s.name);
|
|
3058
3061
|
if (o.length === 0) continue;
|
|
3059
|
-
const f = await
|
|
3062
|
+
const f = await Cd(u, s, o, l.value_field).catch(
|
|
3060
3063
|
() => []
|
|
3061
3064
|
);
|
|
3062
3065
|
f.length > 0 && (r[l.key] = f);
|
|
@@ -3077,26 +3080,26 @@ function Up({
|
|
|
3077
3080
|
const Wr = (e) => {
|
|
3078
3081
|
const t = ms(qt, { key: e.key, collection: e.collection }), r = t ? (qt == null ? void 0 : qt.restricted[t.name]) ?? [] : [];
|
|
3079
3082
|
return r.length > 0 ? r : void 0;
|
|
3080
|
-
}, _t = xe(() => new Map(Tt.map((e) => [e.field, e])), [Tt]), Qe = (A == null ? void 0 : A.relations) ?? [], Vr = xe(() =>
|
|
3083
|
+
}, _t = xe(() => new Map(Tt.map((e) => [e.field, e])), [Tt]), Qe = (A == null ? void 0 : A.relations) ?? [], Vr = xe(() => Ii(Le.inline_edit), [Le.inline_edit]), { data: Hs } = le({
|
|
3081
3084
|
queryKey: ["my-permissions"],
|
|
3082
3085
|
queryFn: () => u.request(X("/security/my/permissions")).then((e) => e.data),
|
|
3083
3086
|
enabled: Vr.enabled && !Dt,
|
|
3084
3087
|
staleTime: 5 * 6e4
|
|
3085
|
-
}),
|
|
3088
|
+
}), Ys = Dt || Vc(Hs, a), Hr = xe(
|
|
3086
3089
|
() => new Map(((A == null ? void 0 : A.fields) ?? []).map((e) => [e.field, e])),
|
|
3087
3090
|
[A]
|
|
3088
|
-
), Yr =
|
|
3091
|
+
), Yr = Sc(), Jr = (e) => (
|
|
3089
3092
|
// Ask-the-table answers are a one-off overlay, not the list's own rows.
|
|
3090
|
-
Pe ? null :
|
|
3093
|
+
Pe ? null : Bi({
|
|
3091
3094
|
config: Vr,
|
|
3092
3095
|
key: e,
|
|
3093
3096
|
field: Hr.get(e),
|
|
3094
3097
|
collection: a,
|
|
3095
3098
|
relations: Qe,
|
|
3096
|
-
mayUpdate:
|
|
3099
|
+
mayUpdate: Ys
|
|
3097
3100
|
})
|
|
3098
|
-
),
|
|
3099
|
-
const o = e.id, f = s === 0 ? null :
|
|
3101
|
+
), Js = (e, t, r, l, s) => {
|
|
3102
|
+
const o = e.id, f = s === 0 ? null : zi(
|
|
3100
3103
|
be.filter((g) => !!Jr(g)),
|
|
3101
3104
|
t,
|
|
3102
3105
|
s
|
|
@@ -3125,21 +3128,21 @@ function Up({
|
|
|
3125
3128
|
// Rollups, computed columns and the row's position may follow the change.
|
|
3126
3129
|
onSaved: () => void w.invalidateQueries({ queryKey: ["cbv-items", a] })
|
|
3127
3130
|
});
|
|
3128
|
-
},
|
|
3131
|
+
}, Gs = (e, t, r, l) => {
|
|
3129
3132
|
const s = r ? null : Jr(t);
|
|
3130
3133
|
if (!s) return l;
|
|
3131
3134
|
const o = Hr.get(t);
|
|
3132
3135
|
return /* @__PURE__ */ n(
|
|
3133
|
-
|
|
3136
|
+
Cc,
|
|
3134
3137
|
{
|
|
3135
3138
|
controller: Yr,
|
|
3136
3139
|
cellKey: `${String(e.id)}|${t}`,
|
|
3137
3140
|
kind: s,
|
|
3138
3141
|
value: e[t],
|
|
3139
3142
|
label: nt(t),
|
|
3140
|
-
choices: o ?
|
|
3141
|
-
target: s === "m2o" ?
|
|
3142
|
-
onCommit: (f, g) =>
|
|
3143
|
+
choices: o ? ji(o) : void 0,
|
|
3144
|
+
target: s === "m2o" ? Ki(Qe, a, t) : null,
|
|
3145
|
+
onCommit: (f, g) => Js(e, t, s, f, g),
|
|
3143
3146
|
children: l
|
|
3144
3147
|
}
|
|
3145
3148
|
);
|
|
@@ -3148,17 +3151,17 @@ function Up({
|
|
|
3148
3151
|
), [pt, Tt, _t, ce]), [Pa, Gn] = k(null), Rn = xe(
|
|
3149
3152
|
() => Pa ?? (be[0] ? { [be[0]]: "left" } : {}),
|
|
3150
3153
|
[Pa, be]
|
|
3151
|
-
), Nt = (e) => Rn[e],
|
|
3154
|
+
), Nt = (e) => Rn[e], Xs = (e) => {
|
|
3152
3155
|
const t = { ...Rn }, r = t[e];
|
|
3153
3156
|
r ? r === "left" ? t[e] = "right" : delete t[e] : t[e] = "left", Gn(t);
|
|
3154
3157
|
}, nt = (e) => ee[e] ?? (e.startsWith("__f:") ? ce[e] ?? "Formula" : e.includes(".") ? e.split(".").map(De).join(" › ") : e === "id" ? "ID" : De(e)), Gr = (e, t) => {
|
|
3155
3158
|
var l, s, o;
|
|
3156
3159
|
const r = t.includes(".") ? (o = (s = (l = Ce == null ? void 0 : Ce.rows) == null ? void 0 : l[String(e.id)]) == null ? void 0 : s[t]) == null ? void 0 : o.value : e[t];
|
|
3157
3160
|
return typeof r == "string" && /^-?\d+(\.\d+)?$/.test(r.trim()) ? Number(r) : r;
|
|
3158
|
-
},
|
|
3161
|
+
}, Zs = (e, t) => {
|
|
3159
3162
|
const r = ce[t];
|
|
3160
3163
|
return r ? os(r, (l) => Gr(e, l)) : null;
|
|
3161
|
-
},
|
|
3164
|
+
}, eo = (e, t) => {
|
|
3162
3165
|
const r = ce[t];
|
|
3163
3166
|
if (r)
|
|
3164
3167
|
return r.replace(/\{\{\s*([^}]+?)\s*\}\}/g, (l, s) => {
|
|
@@ -3239,7 +3242,7 @@ function Up({
|
|
|
3239
3242
|
s != null && s.one_collection && (e[t.field] = { kind: "m2m", target: s.one_collection });
|
|
3240
3243
|
}
|
|
3241
3244
|
return e;
|
|
3242
|
-
}, [Qt, Zt]), Oa = ss(je, 350), [mn,
|
|
3245
|
+
}, [Qt, Zt]), Oa = ss(je, 350), [mn, to] = k((m == null ? void 0 : m.a) === !0), [nl, no] = k(null), En = ec(a, nl), [St, al] = k(null), { data: Pn } = Qd(a), [Rt, Xn] = k(() => (L == null ? void 0 : L.riskIds) ?? []), ke = xe(() => {
|
|
3243
3246
|
var t;
|
|
3244
3247
|
const e = Ss(Me);
|
|
3245
3248
|
for (const r of Ft) {
|
|
@@ -3278,7 +3281,7 @@ function Up({
|
|
|
3278
3281
|
e.push({ path: [r], op: l.op, value: Number(l.value) });
|
|
3279
3282
|
else if (l.kind === "bool") e.push({ path: [r], op: "_eq", value: l.value === "true" });
|
|
3280
3283
|
else if (l.kind === "date" && l.value) {
|
|
3281
|
-
const s = xa(l.value), f = (s ?
|
|
3284
|
+
const s = xa(l.value), f = (s ? wi(s) : null) ?? Ms(l.value);
|
|
3282
3285
|
f && (f.from && e.push({ path: [r], op: "_gte", value: f.from }), f.to && e.push({ path: [r], op: "_lte", value: `${f.to}T23:59:59` }));
|
|
3283
3286
|
}
|
|
3284
3287
|
}
|
|
@@ -3308,7 +3311,7 @@ function Up({
|
|
|
3308
3311
|
if (!t || !r) return null;
|
|
3309
3312
|
const l = e.find((s) => ["name", "title", "label", "short_name"].includes(s.toLowerCase())) ?? null;
|
|
3310
3313
|
return { latField: t, lngField: r, labelField: l };
|
|
3311
|
-
}, [A]), [Zn, rl] = k(!1), [ll,
|
|
3314
|
+
}, [A]), [Zn, rl] = k(!1), [ll, ao] = k(!1), sl = me(ke);
|
|
3312
3315
|
pe(() => {
|
|
3313
3316
|
sl.current !== ke && (sl.current = ke, q(ds(Z.current, 1)));
|
|
3314
3317
|
}, [ke]);
|
|
@@ -3340,7 +3343,7 @@ function Up({
|
|
|
3340
3343
|
ze,
|
|
3341
3344
|
ke,
|
|
3342
3345
|
Dn
|
|
3343
|
-
]), s = oe.current, o =
|
|
3346
|
+
]), s = oe.current, o = Di(s, l, e, ae);
|
|
3344
3347
|
if (o.after === void 0 && o.sort === ae) return r(e);
|
|
3345
3348
|
try {
|
|
3346
3349
|
const f = await u.request(
|
|
@@ -3350,17 +3353,17 @@ function Up({
|
|
|
3350
3353
|
...o.sort ? { sort: o.sort } : {}
|
|
3351
3354
|
})
|
|
3352
3355
|
);
|
|
3353
|
-
return o.after !== void 0 &&
|
|
3356
|
+
return o.after !== void 0 && Mi(s, l, e, f.next_cursor), f;
|
|
3354
3357
|
} catch (f) {
|
|
3355
|
-
if (!
|
|
3356
|
-
return
|
|
3358
|
+
if (!Oi(f)) throw f;
|
|
3359
|
+
return Ai(s, l), r(e);
|
|
3357
3360
|
}
|
|
3358
3361
|
}, {
|
|
3359
3362
|
data: he,
|
|
3360
3363
|
isLoading: ea,
|
|
3361
3364
|
isFetching: gt,
|
|
3362
3365
|
isPlaceholderData: Aa,
|
|
3363
|
-
dataUpdatedAt:
|
|
3366
|
+
dataUpdatedAt: ro,
|
|
3364
3367
|
refetch: Ia,
|
|
3365
3368
|
error: He
|
|
3366
3369
|
} = le({
|
|
@@ -3373,13 +3376,13 @@ function Up({
|
|
|
3373
3376
|
retry: !1
|
|
3374
3377
|
}), dl = me(() => {
|
|
3375
3378
|
});
|
|
3376
|
-
|
|
3379
|
+
dd({
|
|
3377
3380
|
qc: w,
|
|
3378
3381
|
enabled: !!a && Ze && !ue && !G && !gt && !!he && O * ze < (he.total ?? 0),
|
|
3379
3382
|
queryKey: ol(O + 1),
|
|
3380
3383
|
queryFn: () => il(O + 1).then((e) => (dl.current(e.data ?? []), e))
|
|
3381
3384
|
}), pe(() => {
|
|
3382
|
-
const e =
|
|
3385
|
+
const e = Yi({
|
|
3383
3386
|
pending: Z.current,
|
|
3384
3387
|
gateOpen: Ze,
|
|
3385
3388
|
fetching: gt,
|
|
@@ -3426,7 +3429,7 @@ function Up({
|
|
|
3426
3429
|
...Ba ? { conditions: Ba } : {}
|
|
3427
3430
|
})
|
|
3428
3431
|
).then((e) => Number(e.total ?? 0))
|
|
3429
|
-
}),
|
|
3432
|
+
}), lo = () => {
|
|
3430
3433
|
const e = Mn.map((r) => r.key), t = (r) => {
|
|
3431
3434
|
const l = { ...r };
|
|
3432
3435
|
for (const s of e) l[s] = [];
|
|
@@ -3442,7 +3445,7 @@ function Up({
|
|
|
3442
3445
|
const e = `${a}\0${G}`;
|
|
3443
3446
|
((t = aa.current) == null ? void 0 : t.key) !== e && (aa.current = {
|
|
3444
3447
|
key: e,
|
|
3445
|
-
id:
|
|
3448
|
+
id: kd(u, {
|
|
3446
3449
|
surface: "collection",
|
|
3447
3450
|
collection: a,
|
|
3448
3451
|
query: G,
|
|
@@ -3450,7 +3453,7 @@ function Up({
|
|
|
3450
3453
|
duration_ms: Date.now() - ul.current
|
|
3451
3454
|
})
|
|
3452
3455
|
});
|
|
3453
|
-
}, [u, a, G, he, gt, Pe]),
|
|
3456
|
+
}, [u, a, G, he, gt, Pe]), Fd(
|
|
3454
3457
|
a ? {
|
|
3455
3458
|
list: {
|
|
3456
3459
|
collection: a,
|
|
@@ -3467,18 +3470,18 @@ function Up({
|
|
|
3467
3470
|
}
|
|
3468
3471
|
} : null
|
|
3469
3472
|
);
|
|
3470
|
-
const
|
|
3473
|
+
const so = Rd(), pl = bi(gt), za = hi({
|
|
3471
3474
|
pending: gt,
|
|
3472
3475
|
request: a ? { method: "GET", url: `/items/${a}` } : null,
|
|
3473
3476
|
noun: ((A == null ? void 0 : A.display_name) ?? a ?? "").replace(/_/g, " ").toLowerCase() || null,
|
|
3474
3477
|
// Only a total this person has already been shown (never a raw table count).
|
|
3475
|
-
knownRows: gt ?
|
|
3476
|
-
}), Qa =
|
|
3478
|
+
knownRows: gt ? _d(w.getQueriesData({ queryKey: ["cbv-items", a] })) : null
|
|
3479
|
+
}), Qa = bd(), { userId: Ua } = ga(), Et = Gi(), Wa = me(/* @__PURE__ */ new Set());
|
|
3477
3480
|
Wa.current = new Set(ye.map((e) => String(e.id)));
|
|
3478
|
-
const
|
|
3481
|
+
const oo = xe(
|
|
3479
3482
|
() => ye.slice(0, 100).map((e) => ({ collection: a, item: String(e.id) })),
|
|
3480
3483
|
[ye, a]
|
|
3481
|
-
), ml =
|
|
3484
|
+
), ml = pd(oo), fl = me([]);
|
|
3482
3485
|
fl.current = [
|
|
3483
3486
|
"cbv-items",
|
|
3484
3487
|
a,
|
|
@@ -3501,14 +3504,14 @@ function Up({
|
|
|
3501
3504
|
page: O,
|
|
3502
3505
|
grouped: !!ue
|
|
3503
3506
|
};
|
|
3504
|
-
const Va = me({}).current, [
|
|
3507
|
+
const Va = me({}).current, [io, co] = k(0), [Ha, Ya] = k(0);
|
|
3505
3508
|
pe(() => {
|
|
3506
3509
|
if (!Qa || !a) return;
|
|
3507
3510
|
const e = (M = 1) => Ya((B) => B + M), t = /* @__PURE__ */ new Map();
|
|
3508
3511
|
let r = null;
|
|
3509
3512
|
const l = (M) => {
|
|
3510
3513
|
const B = (H) => t.set(JSON.stringify(H), H);
|
|
3511
|
-
M.includes(vn.tasks) && B(["cbv-task-counts", a]), M.includes(vn.addendums) && B(["cbv-addendum-summary", a]), M.includes(vn.integrations) && B(["cbv-integrations-summary", a]), M.includes(vn.comments) && B(["row-comment-counts", a]), M.includes(vn.state) && (B(["cbv-pipeline-instances", a]), B(["cbv-owners", a]), B(["cbv-view-count", a])), M.includes(vn.lock) &&
|
|
3514
|
+
M.includes(vn.tasks) && B(["cbv-task-counts", a]), M.includes(vn.addendums) && B(["cbv-addendum-summary", a]), M.includes(vn.integrations) && B(["cbv-integrations-summary", a]), M.includes(vn.comments) && B(["row-comment-counts", a]), M.includes(vn.state) && (B(["cbv-pipeline-instances", a]), B(["cbv-owners", a]), B(["cbv-view-count", a])), M.includes(vn.lock) && co((H) => H + 1), !r && (r = setTimeout(() => {
|
|
3512
3515
|
r = null;
|
|
3513
3516
|
for (const H of t.values()) w.invalidateQueries({ queryKey: H });
|
|
3514
3517
|
t.clear();
|
|
@@ -3541,8 +3544,8 @@ function Up({
|
|
|
3541
3544
|
});
|
|
3542
3545
|
}
|
|
3543
3546
|
H && e();
|
|
3544
|
-
const p = Wa.current, it = (V) =>
|
|
3545
|
-
const ge =
|
|
3547
|
+
const p = Wa.current, it = (V) => id(a, V.item), We = (V) => {
|
|
3548
|
+
const ge = ad(V);
|
|
3546
3549
|
return ge && Ua && ge.toUpperCase() === Ua.toUpperCase() ? "self" : ge;
|
|
3547
3550
|
}, vt = [];
|
|
3548
3551
|
for (const [V, ge] of B)
|
|
@@ -3558,7 +3561,7 @@ function Up({
|
|
|
3558
3561
|
const kt = bl.current;
|
|
3559
3562
|
let an;
|
|
3560
3563
|
try {
|
|
3561
|
-
an = await
|
|
3564
|
+
an = await ed(
|
|
3562
3565
|
u,
|
|
3563
3566
|
a,
|
|
3564
3567
|
[...B.keys()],
|
|
@@ -3582,10 +3585,10 @@ function Up({
|
|
|
3582
3585
|
return;
|
|
3583
3586
|
}
|
|
3584
3587
|
if (x) return;
|
|
3585
|
-
const Y =
|
|
3588
|
+
const Y = td(kt.conditions), ne = kt.page === 1 && !kt.grouped, Ee = /* @__PURE__ */ new Map(), T = [], Ye = [];
|
|
3586
3589
|
for (const [V, ge] of B) {
|
|
3587
3590
|
const re = an.get(V);
|
|
3588
|
-
p.has(V) ? re ? Ee.set(V, re) : T.push(V) : re && ((ge.action === "create" || !!kt.conditions &&
|
|
3591
|
+
p.has(V) ? re ? Ee.set(V, re) : T.push(V) : re && ((ge.action === "create" || !!kt.conditions && nd(ge, Y)) && ne ? Ye.push({ row: re, ev: ge }) : e());
|
|
3589
3592
|
}
|
|
3590
3593
|
if (Ee.size > 0 || T.length > 0 || Ye.length > 0) {
|
|
3591
3594
|
const V = new Set(T);
|
|
@@ -3610,7 +3613,7 @@ function Up({
|
|
|
3610
3613
|
We(V) !== "self" && Et.note([re], We(V), "create");
|
|
3611
3614
|
}
|
|
3612
3615
|
}, I = (M) => {
|
|
3613
|
-
for (const B of M.flatMap((H) =>
|
|
3616
|
+
for (const B of M.flatMap((H) => Ji(H))) {
|
|
3614
3617
|
const H = B.changed_fields;
|
|
3615
3618
|
if (!B.action && (H != null && H.length) && H.every((p) => p.startsWith("$"))) {
|
|
3616
3619
|
(String(B.item) === "*" || Wa.current.has(String(B.item))) && l(H);
|
|
@@ -3621,16 +3624,16 @@ function Up({
|
|
|
3621
3624
|
o.length > 0 && !f && (f = setTimeout(() => void j(), 300));
|
|
3622
3625
|
}, $e = Qa.subscribeCollections(
|
|
3623
3626
|
[a],
|
|
3624
|
-
(M) =>
|
|
3627
|
+
(M) => Fi(Va, [M], I)
|
|
3625
3628
|
);
|
|
3626
3629
|
return () => {
|
|
3627
|
-
x = !0, $e(),
|
|
3630
|
+
x = !0, $e(), Ri(Va), r && clearTimeout(r), f && clearTimeout(f), g && clearTimeout(g);
|
|
3628
3631
|
};
|
|
3629
3632
|
}, [Qa, a, w, u, Ua, Et, Va]);
|
|
3630
|
-
const
|
|
3633
|
+
const uo = Xi(
|
|
3631
3634
|
a,
|
|
3632
3635
|
ye.map((e) => String(e.id)),
|
|
3633
|
-
|
|
3636
|
+
io
|
|
3634
3637
|
), { data: ra = [] } = le({
|
|
3635
3638
|
queryKey: ["cbv-risk-rules", a],
|
|
3636
3639
|
queryFn: () => u.request(
|
|
@@ -3639,10 +3642,10 @@ function Up({
|
|
|
3639
3642
|
enabled: !!a,
|
|
3640
3643
|
staleTime: 6e4,
|
|
3641
3644
|
retry: !1
|
|
3642
|
-
}),
|
|
3643
|
-
data:
|
|
3645
|
+
}), po = ye.map((e) => String(e.id)).join(","), {
|
|
3646
|
+
data: mo = {}
|
|
3644
3647
|
} = le({
|
|
3645
|
-
queryKey: ["cbv-risk", a,
|
|
3648
|
+
queryKey: ["cbv-risk", a, po],
|
|
3646
3649
|
queryFn: () => u.request(
|
|
3647
3650
|
_e("/at-risk/evaluate", {
|
|
3648
3651
|
collection: a,
|
|
@@ -3652,10 +3655,10 @@ function Up({
|
|
|
3652
3655
|
enabled: !!a && ra.length > 0 && ye.length > 0,
|
|
3653
3656
|
staleTime: 3e4,
|
|
3654
3657
|
retry: !1
|
|
3655
|
-
}), Ae = ye.map((e) => String(e.id)).join(","),
|
|
3658
|
+
}), Ae = ye.map((e) => String(e.id)).join(","), fo = xe(
|
|
3656
3659
|
() => ye.map((e) => ({ collection: a, id: e.id })),
|
|
3657
3660
|
[ye, a]
|
|
3658
|
-
),
|
|
3661
|
+
), bo = qc(fo, Dt), Ja = !!(A != null && A.addendums_enabled), { data: Ga } = le({
|
|
3659
3662
|
queryKey: ["cbv-addendum-summary", a, Ae],
|
|
3660
3663
|
queryFn: () => u.request(
|
|
3661
3664
|
_e("/addendums/summary", { collection: a, ids: Ae.split(",") })
|
|
@@ -3688,12 +3691,12 @@ function Up({
|
|
|
3688
3691
|
placeholderData: (e) => e,
|
|
3689
3692
|
staleTime: 3e4,
|
|
3690
3693
|
retry: !1
|
|
3691
|
-
}), { data:
|
|
3694
|
+
}), { data: ho = [] } = le({
|
|
3692
3695
|
queryKey: ["cbv-integrations-collections"],
|
|
3693
3696
|
queryFn: () => u.request(X("/integration-obligations/collections")).then((e) => e.data ?? []).catch(() => []),
|
|
3694
3697
|
staleTime: 6e4,
|
|
3695
3698
|
retry: !1
|
|
3696
|
-
}), gl =
|
|
3699
|
+
}), gl = ho.includes(a), { data: er } = le({
|
|
3697
3700
|
queryKey: ["cbv-integrations-summary", a, Ae],
|
|
3698
3701
|
queryFn: () => u.request(
|
|
3699
3702
|
_e("/integration-obligations/summary", { collection: a, ids: Ae.split(",") })
|
|
@@ -3716,21 +3719,21 @@ function Up({
|
|
|
3716
3719
|
queryFn: () => u.request(X(Dt ? `/pipelines/${la}` : `/pipelines/${la}/outline`)).then((e) => e.data),
|
|
3717
3720
|
enabled: !!la,
|
|
3718
3721
|
retry: !1
|
|
3719
|
-
}),
|
|
3722
|
+
}), go = !!(Te != null && Te.binding), { data: tr } = le({
|
|
3720
3723
|
queryKey: ["cbv-owners", a, Ae],
|
|
3721
3724
|
queryFn: () => u.request(
|
|
3722
3725
|
_e(`/pipelines/instance/${a}/owners/batch`, {
|
|
3723
3726
|
ids: Ae.split(",").filter(Boolean)
|
|
3724
3727
|
})
|
|
3725
3728
|
).then((e) => e.data ?? {}),
|
|
3726
|
-
enabled:
|
|
3729
|
+
enabled: go && Ae.length > 0,
|
|
3727
3730
|
staleTime: 6e4,
|
|
3728
3731
|
retry: !1
|
|
3729
3732
|
}), xl = xe(
|
|
3730
3733
|
() => be.filter((e) => e.includes(".")),
|
|
3731
3734
|
[be]
|
|
3732
3735
|
), vl = xe(
|
|
3733
|
-
() => be.filter((e) => e.startsWith("__f:")).flatMap((e) =>
|
|
3736
|
+
() => be.filter((e) => e.startsWith("__f:")).flatMap((e) => qi(ce[e] ?? "")).filter((e) => e.includes(".")),
|
|
3734
3737
|
[be, ce]
|
|
3735
3738
|
), On = xe(
|
|
3736
3739
|
() => [.../* @__PURE__ */ new Set([...xl, ...Object.values(Ue), ...vl])].slice(
|
|
@@ -3759,14 +3762,14 @@ function Up({
|
|
|
3759
3762
|
var r;
|
|
3760
3763
|
const t = e.includes(".") ? e : Ue[e];
|
|
3761
3764
|
return t ? ((r = Ce == null ? void 0 : Ce.targets) == null ? void 0 : r[t]) ?? null : null;
|
|
3762
|
-
},
|
|
3765
|
+
}, xo = (e, t) => {
|
|
3763
3766
|
var o, f, g, x;
|
|
3764
3767
|
const r = t.includes(".") ? t : Ue[t];
|
|
3765
3768
|
if (!r) return null;
|
|
3766
3769
|
const l = (o = Ce == null ? void 0 : Ce.targets) == null ? void 0 : o[r], s = ((x = (g = (f = Ce == null ? void 0 : Ce.rows) == null ? void 0 : f[String(e)]) == null ? void 0 : g[r]) == null ? void 0 : x.ids) ?? [];
|
|
3767
3770
|
return !l || Ct(l) || s.length === 0 ? null : { target: l, id: String(s[0]) };
|
|
3768
3771
|
}, Ot = (e) => e.includes(".") || e in Ue;
|
|
3769
|
-
dl.current = (e) =>
|
|
3772
|
+
dl.current = (e) => yi({
|
|
3770
3773
|
qc: w,
|
|
3771
3774
|
collection: a,
|
|
3772
3775
|
rows: e,
|
|
@@ -3775,8 +3778,8 @@ function Up({
|
|
|
3775
3778
|
resolveList: On,
|
|
3776
3779
|
isResolvedCol: Ot,
|
|
3777
3780
|
fetchResolved: yl,
|
|
3778
|
-
fetchRelation: (t, r) =>
|
|
3779
|
-
userCardQuery: (t) =>
|
|
3781
|
+
fetchRelation: (t, r) => Es(u, t, r),
|
|
3782
|
+
userCardQuery: (t) => Td(u, t)
|
|
3780
3783
|
});
|
|
3781
3784
|
const bn = (e) => {
|
|
3782
3785
|
if (e.includes(".")) return { kind: "text", path: e.split(".") };
|
|
@@ -3794,7 +3797,7 @@ function Up({
|
|
|
3794
3797
|
}, Ie = (e, t) => jt((r) => {
|
|
3795
3798
|
const l = { ...r };
|
|
3796
3799
|
return t ? l[e] = t : delete l[e], l;
|
|
3797
|
-
}),
|
|
3800
|
+
}), vo = (e) => {
|
|
3798
3801
|
var f, g, x, j;
|
|
3799
3802
|
const { key: t, row: r, cellText: l } = e, s = r.id;
|
|
3800
3803
|
if (t === "__state__") {
|
|
@@ -3839,11 +3842,11 @@ function Up({
|
|
|
3839
3842
|
I && Ie(t, { kind: "date", value: `r:${I}..${I}` });
|
|
3840
3843
|
}
|
|
3841
3844
|
}
|
|
3842
|
-
},
|
|
3845
|
+
}, ko = (e, t) => {
|
|
3843
3846
|
if (e === "__state__") return !1;
|
|
3844
3847
|
const r = bn(e);
|
|
3845
3848
|
return r ? r.kind === "in" ? !!at(Qe, a, e) && t[e] != null : r.kind === "enum" || r.kind === "num" ? t[e] != null && t[e] !== "" : r.kind === "text" : !1;
|
|
3846
|
-
},
|
|
3849
|
+
}, yo = (e) => {
|
|
3847
3850
|
const { key: t, row: r, cellText: l } = e, s = r.id, o = bn(t);
|
|
3848
3851
|
if (!o) return;
|
|
3849
3852
|
let f = null;
|
|
@@ -3857,7 +3860,7 @@ function Up({
|
|
|
3857
3860
|
x && x !== "—" && (f = { id: g, path: o.path, op: "_ncontains", value: x, label: x, field: t });
|
|
3858
3861
|
}
|
|
3859
3862
|
f && Tr((x) => [...x, f]);
|
|
3860
|
-
},
|
|
3863
|
+
}, wo = (e) => {
|
|
3861
3864
|
var l, s, o;
|
|
3862
3865
|
const t = bn(e);
|
|
3863
3866
|
if (!t) return null;
|
|
@@ -3870,7 +3873,7 @@ function Up({
|
|
|
3870
3873
|
f.add(j);
|
|
3871
3874
|
else x[e] != null && x[e] !== "" && typeof x[e] != "object" && f.add(x[e]);
|
|
3872
3875
|
return /* @__PURE__ */ n(
|
|
3873
|
-
|
|
3876
|
+
Jc,
|
|
3874
3877
|
{
|
|
3875
3878
|
target: t.target,
|
|
3876
3879
|
selected: (r == null ? void 0 : r.kind) === "in" ? r.value : [],
|
|
@@ -3881,7 +3884,7 @@ function Up({
|
|
|
3881
3884
|
}
|
|
3882
3885
|
if (t.kind === "enum")
|
|
3883
3886
|
return /* @__PURE__ */ n(
|
|
3884
|
-
|
|
3887
|
+
Gc,
|
|
3885
3888
|
{
|
|
3886
3889
|
collection: a,
|
|
3887
3890
|
field: e,
|
|
@@ -3911,7 +3914,7 @@ function Up({
|
|
|
3911
3914
|
{
|
|
3912
3915
|
value: f,
|
|
3913
3916
|
onChange: (x) => Ie(e, { kind: "num", op: x, value: g }),
|
|
3914
|
-
options:
|
|
3917
|
+
options: Ds.map((x) => ({ value: x.value, label: x.label })),
|
|
3915
3918
|
ariaLabel: `Filter operator ${e}`
|
|
3916
3919
|
}
|
|
3917
3920
|
),
|
|
@@ -3941,13 +3944,13 @@ function Up({
|
|
|
3941
3944
|
className: "w-full"
|
|
3942
3945
|
}
|
|
3943
3946
|
) : t.kind === "date" ? /* @__PURE__ */ n(
|
|
3944
|
-
|
|
3947
|
+
Xc,
|
|
3945
3948
|
{
|
|
3946
3949
|
value: (r == null ? void 0 : r.kind) === "date" ? r.value : "",
|
|
3947
3950
|
onChange: (f) => Ie(e, f ? { kind: "date", value: f } : null)
|
|
3948
3951
|
}
|
|
3949
3952
|
) : null;
|
|
3950
|
-
},
|
|
3953
|
+
}, _o = be.some((e) => bn(e) != null), _l = (e) => {
|
|
3951
3954
|
var r, l;
|
|
3952
3955
|
if (((r = Ne[e]) == null ? void 0 : r.type) === "number") return !0;
|
|
3953
3956
|
if (e.includes(".") || e in Ue || at(Qe, a, e)) return !1;
|
|
@@ -3957,7 +3960,7 @@ function Up({
|
|
|
3957
3960
|
var s, o, f;
|
|
3958
3961
|
const l = Ne[t];
|
|
3959
3962
|
if ((l == null ? void 0 : l.type) === "count") {
|
|
3960
|
-
const g = t.includes(".") ? t : Ue[t], x = r != null && g ? (f = (o = (s = Ce == null ? void 0 : Ce.rows) == null ? void 0 : s[String(r)]) == null ? void 0 : o[g]) == null ? void 0 : f.ids : void 0, j =
|
|
3963
|
+
const g = t.includes(".") ? t : Ue[t], x = r != null && g ? (f = (o = (s = Ce == null ? void 0 : Ce.rows) == null ? void 0 : s[String(r)]) == null ? void 0 : o[g]) == null ? void 0 : f.ids : void 0, j = Ei(e === "—" ? "" : e, x);
|
|
3961
3964
|
return String(j);
|
|
3962
3965
|
}
|
|
3963
3966
|
return l && e && e !== "—" ? is(e, l) : e;
|
|
@@ -3968,7 +3971,7 @@ function Up({
|
|
|
3968
3971
|
queryKey: ["cbv-views", a],
|
|
3969
3972
|
queryFn: () => u.request(X("/saved-views", { collection: a })).then((e) => e.data ?? []),
|
|
3970
3973
|
staleTime: 3e4
|
|
3971
|
-
}), gn = () => w.invalidateQueries({ queryKey: ["cbv-views", a] }),
|
|
3974
|
+
}), gn = () => w.invalidateQueries({ queryKey: ["cbv-views", a] }), No = fa({
|
|
3972
3975
|
queries: lt.slice(0, 12).map((e) => {
|
|
3973
3976
|
const t = Ss(e.filters ?? []);
|
|
3974
3977
|
return {
|
|
@@ -3988,9 +3991,9 @@ function Up({
|
|
|
3988
3991
|
}), nr = /* @__PURE__ */ new Map();
|
|
3989
3992
|
lt.slice(0, 12).forEach((e, t) => {
|
|
3990
3993
|
var r;
|
|
3991
|
-
nr.set(e.id, ((r =
|
|
3994
|
+
nr.set(e.id, ((r = No[t]) == null ? void 0 : r.data) ?? null);
|
|
3992
3995
|
});
|
|
3993
|
-
const [Sl,
|
|
3996
|
+
const [Sl, So] = k(() => /* @__PURE__ */ new Set()), sa = (e) => {
|
|
3994
3997
|
var r, l;
|
|
3995
3998
|
Tn(e.id);
|
|
3996
3999
|
const t = fs(e.filters ?? []);
|
|
@@ -3998,7 +4001,7 @@ function Up({
|
|
|
3998
4001
|
const s = new Set(
|
|
3999
4002
|
e.columns.filter((p) => typeof p != "string" && p.admin_only).map(ws)
|
|
4000
4003
|
);
|
|
4001
|
-
|
|
4004
|
+
So(s);
|
|
4002
4005
|
const o = e.columns.map(ws).filter((p) => Dt || !s.has(p)), f = {};
|
|
4003
4006
|
for (const p of e.columns)
|
|
4004
4007
|
typeof p != "string" && p.formula && p.key.startsWith("__f:") && (f[p.key] = p.formula);
|
|
@@ -4079,10 +4082,10 @@ function Up({
|
|
|
4079
4082
|
is_shared: !0
|
|
4080
4083
|
})
|
|
4081
4084
|
), ql(""), w.invalidateQueries({ queryKey: ["cbv-export-presets", a] }));
|
|
4082
|
-
},
|
|
4085
|
+
}, Co = (e) => {
|
|
4083
4086
|
const t = new URLSearchParams();
|
|
4084
4087
|
G && t.set("search", G), ke && t.set("conditions", ke), ae && t.set("sort", ae), window.open(`/api/export-presets/${e}/run?${t.toString()}`, "_blank");
|
|
4085
|
-
},
|
|
4088
|
+
}, $o = (e, t) => {
|
|
4086
4089
|
u.request(
|
|
4087
4090
|
_e(`/export-presets/${e}/run-async`, {
|
|
4088
4091
|
...G ? { search: G } : {},
|
|
@@ -4100,9 +4103,9 @@ function Up({
|
|
|
4100
4103
|
columns: m.c
|
|
4101
4104
|
}), Tn(null), q(m.p ?? 1)));
|
|
4102
4105
|
}, [Tt]), pe(() => {
|
|
4103
|
-
m &&
|
|
4106
|
+
m && Wi();
|
|
4104
4107
|
}, []);
|
|
4105
|
-
const
|
|
4108
|
+
const qo = () => {
|
|
4106
4109
|
const e = An();
|
|
4107
4110
|
return {
|
|
4108
4111
|
q: G,
|
|
@@ -4134,10 +4137,10 @@ function Up({
|
|
|
4134
4137
|
we.success(r ? `Saved "${r}" with the current columns and filters` : "View saved");
|
|
4135
4138
|
},
|
|
4136
4139
|
onError: (e) => we.error(`Could not save the view: ${e.message}`)
|
|
4137
|
-
}),
|
|
4140
|
+
}), To = yt({
|
|
4138
4141
|
mutationFn: ({ id: e, on: t }) => u.request(pa(`/saved-views/${e}`, { is_default: t })),
|
|
4139
4142
|
onSuccess: gn
|
|
4140
|
-
}),
|
|
4143
|
+
}), Lo = yt({
|
|
4141
4144
|
mutationFn: ({ id: e, role: t }) => u.request(pa(`/saved-views/${e}`, { default_for_role: t })),
|
|
4142
4145
|
onSuccess: gn,
|
|
4143
4146
|
onError: (e) => we.error(`Could not set the role default: ${e.message}`)
|
|
@@ -4154,22 +4157,22 @@ function Up({
|
|
|
4154
4157
|
}), El = yt({
|
|
4155
4158
|
mutationFn: (e) => u.request(ba(`/items/${a}/${e}`)),
|
|
4156
4159
|
onSuccess: () => void w.invalidateQueries({ queryKey: ["cbv-items", a] })
|
|
4157
|
-
}),
|
|
4160
|
+
}), Fo = yt({
|
|
4158
4161
|
mutationFn: (e) => u.request(ba(`/saved-views/${e}`)),
|
|
4159
4162
|
onSuccess: (e, t) => {
|
|
4160
4163
|
zt === t && Cl(), gn();
|
|
4161
4164
|
}
|
|
4162
|
-
}), { data:
|
|
4165
|
+
}), { data: Ro = [] } = le({
|
|
4163
4166
|
queryKey: ["cbv-view-subs"],
|
|
4164
4167
|
queryFn: () => u.request(X("/view-subscriptions")).then((e) => e.data ?? []).catch(() => []),
|
|
4165
4168
|
staleTime: 6e4
|
|
4166
|
-
}), da = (e) =>
|
|
4169
|
+
}), da = (e) => Ro.find((t) => t.view_id === e), Eo = yt({
|
|
4167
4170
|
mutationFn: async (e) => {
|
|
4168
4171
|
const t = da(e);
|
|
4169
4172
|
return t ? u.request(ba(`/view-subscriptions/${t.id}`)) : u.request(_e("/view-subscriptions", { view_id: e, digest: "daily" }));
|
|
4170
4173
|
},
|
|
4171
4174
|
onSuccess: () => w.invalidateQueries({ queryKey: ["cbv-view-subs"] })
|
|
4172
|
-
}),
|
|
4175
|
+
}), Po = async () => {
|
|
4173
4176
|
var e, t;
|
|
4174
4177
|
if (!$a) {
|
|
4175
4178
|
Lr(!0);
|
|
@@ -4189,7 +4192,7 @@ function Up({
|
|
|
4189
4192
|
if (Y.includes(".") || Y.startsWith("__") || Y in Ue) continue;
|
|
4190
4193
|
const ne = (e = at(Qe, a, Y)) == null ? void 0 : e.one_collection;
|
|
4191
4194
|
if (!ne) continue;
|
|
4192
|
-
if (
|
|
4195
|
+
if (Rs.has(ne)) {
|
|
4193
4196
|
f.push(Y);
|
|
4194
4197
|
continue;
|
|
4195
4198
|
}
|
|
@@ -4225,7 +4228,7 @@ function Up({
|
|
|
4225
4228
|
].map(String), I = /* @__PURE__ */ new Map();
|
|
4226
4229
|
await Promise.all(
|
|
4227
4230
|
j.map(
|
|
4228
|
-
(Y) =>
|
|
4231
|
+
(Y) => qd(u, Y).then((ne) => I.set(Y.toUpperCase(), Jd(ne, Y))).catch(() => I.set(Y.toUpperCase(), Y))
|
|
4229
4232
|
)
|
|
4230
4233
|
);
|
|
4231
4234
|
const $e = new Map(o.map((Y) => [Y.column, Y])), M = new Set(f), B = (Y) => {
|
|
@@ -4280,17 +4283,17 @@ function Up({
|
|
|
4280
4283
|
Lr(!1);
|
|
4281
4284
|
}
|
|
4282
4285
|
}
|
|
4283
|
-
}, Po = (e) => {
|
|
4284
|
-
const t = `record:${a}:${String(e)}`;
|
|
4285
|
-
return dd(t, () => cd(w, u, a, String(e), { group: t }));
|
|
4286
4286
|
}, Do = (e) => {
|
|
4287
|
-
const t =
|
|
4287
|
+
const t = `record:${a}:${String(e)}`;
|
|
4288
|
+
return cd(t, () => ud(w, u, a, String(e), { group: t }));
|
|
4289
|
+
}, Mo = (e) => {
|
|
4290
|
+
const t = Do(e);
|
|
4288
4291
|
return {
|
|
4289
4292
|
...t,
|
|
4290
|
-
tabIndex: String(e) ===
|
|
4293
|
+
tabIndex: String(e) === Vo ? 0 : -1,
|
|
4291
4294
|
"data-row-open": "",
|
|
4292
4295
|
onFocus: (r) => {
|
|
4293
|
-
t.onFocus(), r.target === r.currentTarget &&
|
|
4296
|
+
t.onFocus(), r.target === r.currentTarget && Wo(String(e));
|
|
4294
4297
|
},
|
|
4295
4298
|
onClick: (r) => {
|
|
4296
4299
|
if (r.metaKey || r.ctrlKey) {
|
|
@@ -4321,12 +4324,12 @@ function Up({
|
|
|
4321
4324
|
};
|
|
4322
4325
|
}, tn = (e) => {
|
|
4323
4326
|
var t;
|
|
4324
|
-
((t = aa.current) == null ? void 0 : t.key) === `${a}\0${G}` &&
|
|
4327
|
+
((t = aa.current) == null ? void 0 : t.key) === `${a}\0${G}` && yd(u, aa.current.id, {
|
|
4325
4328
|
type: "record",
|
|
4326
4329
|
collection: a,
|
|
4327
4330
|
item: e === "new" ? null : e
|
|
4328
4331
|
}), S ? S(e) : W({ collection: a, itemId: String(e) });
|
|
4329
|
-
},
|
|
4332
|
+
}, Oo = (e) => {
|
|
4330
4333
|
const t = at(Qe, a, e), r = (l) => {
|
|
4331
4334
|
ae === l ? se(`-${l}`) : ae === `-${l}` ? se("") : se(l), q(1);
|
|
4332
4335
|
};
|
|
@@ -4346,9 +4349,9 @@ function Up({
|
|
|
4346
4349
|
return;
|
|
4347
4350
|
}
|
|
4348
4351
|
r(e);
|
|
4349
|
-
}, rr = ye.length > 0 && ye.every((e) => Jt.includes(e.id)),
|
|
4352
|
+
}, rr = ye.length > 0 && ye.every((e) => Jt.includes(e.id)), Ao = () => Gt(
|
|
4350
4353
|
rr ? Jt.filter((e) => !ye.some((t) => t.id === e)) : [.../* @__PURE__ */ new Set([...Jt, ...ye.map((e) => e.id)])]
|
|
4351
|
-
),
|
|
4354
|
+
), Io = (e) => Gt((t) => t.includes(e) ? t.filter((r) => r !== e) : [...t, e]), ca = 2e3, [Pl, Dl] = k(!1), Ko = async () => {
|
|
4352
4355
|
Dl(!0);
|
|
4353
4356
|
try {
|
|
4354
4357
|
const e = await u.request(
|
|
@@ -4363,7 +4366,7 @@ function Up({
|
|
|
4363
4366
|
} finally {
|
|
4364
4367
|
Dl(!1);
|
|
4365
4368
|
}
|
|
4366
|
-
},
|
|
4369
|
+
}, jo = Fe === 0 && !en ? 0 : (O - 1) * ze + 1, Bo = en ? (O - 1) * ze + ye.length : Math.min(O * ze, Fe), In = !!(Te != null && Te.instances), Ml = (Lt ? 1 : 0) + (In ? 2 : 0) + (Ar ? 1 : 0), lr = [
|
|
4367
4370
|
...be.map(
|
|
4368
4371
|
(e) => e.startsWith("__f:") ? { key: e, kind: "formula" } : { key: e, kind: "data" }
|
|
4369
4372
|
),
|
|
@@ -4384,16 +4387,16 @@ function Up({
|
|
|
4384
4387
|
...lr.filter((e) => Nt(e.key) === "left"),
|
|
4385
4388
|
...lr.filter((e) => !Nt(e.key)),
|
|
4386
4389
|
...lr.filter((e) => Nt(e.key) === "right")
|
|
4387
|
-
],
|
|
4390
|
+
], zo = nn.map((e) => {
|
|
4388
4391
|
if (e.kind === "data") {
|
|
4389
4392
|
const t = _t.get(e.key.split(".")[0]);
|
|
4390
|
-
return { key: e.key, shape:
|
|
4393
|
+
return { key: e.key, shape: wd(t == null ? void 0 : t.type, t == null ? void 0 : t.interface) };
|
|
4391
4394
|
}
|
|
4392
|
-
return { key: e.key, shape:
|
|
4395
|
+
return { key: e.key, shape: uu[e.kind] ?? "short" };
|
|
4393
4396
|
}), Ol = [
|
|
4394
4397
|
...In ? [{ key: "__state__", label: "State" }] : [],
|
|
4395
4398
|
...be.filter((e) => Ot(e) || !at(Qe, a, e)).map((e) => ({ key: e, label: nt(e) }))
|
|
4396
|
-
],
|
|
4399
|
+
], Qo = (e) => {
|
|
4397
4400
|
var l;
|
|
4398
4401
|
if (!ue) return "";
|
|
4399
4402
|
const t = e.id;
|
|
@@ -4408,7 +4411,7 @@ function Up({
|
|
|
4408
4411
|
if (!ue) return ye.map((l) => ({ kind: "row", row: l }));
|
|
4409
4412
|
const e = /* @__PURE__ */ new Map();
|
|
4410
4413
|
for (const l of ye) {
|
|
4411
|
-
const s =
|
|
4414
|
+
const s = Qo(l), o = e.get(s) ?? [];
|
|
4412
4415
|
o.push(l), e.set(s, o);
|
|
4413
4416
|
}
|
|
4414
4417
|
const t = [...e.keys()].sort((l, s) => l === "(empty)" ? 1 : s === "(empty)" ? -1 : l.localeCompare(s, void 0, { numeric: !0 })), r = [];
|
|
@@ -4417,21 +4420,21 @@ function Up({
|
|
|
4417
4420
|
if (r.push({ kind: "header", gkey: l, label: l, count: s.length }), !Se.has(l)) for (const o of s) r.push({ kind: "row", row: o });
|
|
4418
4421
|
}
|
|
4419
4422
|
return r;
|
|
4420
|
-
})(), [
|
|
4421
|
-
|
|
4423
|
+
})(), [Uo, Wo] = k(null), Vo = nc(Al, Uo), sr = nn.filter((e) => Nt(e.key) === "left").map((e) => e.key), Il = nn.filter((e) => Nt(e.key) === "right").map((e) => e.key), or = me(/* @__PURE__ */ new Map()), [Kn, Ho] = k({});
|
|
4424
|
+
pi(() => {
|
|
4422
4425
|
const e = {};
|
|
4423
4426
|
for (const [r, l] of or.current)
|
|
4424
4427
|
l != null && l.isConnected && (e[r] = l.getBoundingClientRect().width);
|
|
4425
4428
|
const t = /* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(Kn)]);
|
|
4426
4429
|
for (const r of t)
|
|
4427
4430
|
if (Math.abs((e[r] ?? -1) - (Kn[r] ?? -1)) > 0.5) {
|
|
4428
|
-
|
|
4431
|
+
Ho(e);
|
|
4429
4432
|
return;
|
|
4430
4433
|
}
|
|
4431
4434
|
});
|
|
4432
|
-
const
|
|
4435
|
+
const Yo = 52, Kl = (e) => {
|
|
4433
4436
|
if (Nt(e) === "left") {
|
|
4434
|
-
let l = Lt ? Kn.__checkbox__ ??
|
|
4437
|
+
let l = Lt ? Kn.__checkbox__ ?? Yo : 0;
|
|
4435
4438
|
for (const s of sr) {
|
|
4436
4439
|
if (s === e) break;
|
|
4437
4440
|
l += Kn[s] ?? 0;
|
|
@@ -4473,21 +4476,21 @@ function Up({
|
|
|
4473
4476
|
window.removeEventListener("pointermove", e), window.removeEventListener("pointerup", t);
|
|
4474
4477
|
};
|
|
4475
4478
|
}, []);
|
|
4476
|
-
const
|
|
4479
|
+
const Jo = (e) => {
|
|
4477
4480
|
let t = nt(e).length;
|
|
4478
4481
|
for (const r of ye) {
|
|
4479
4482
|
const l = Ot(e) ? xt(r.id, e) ?? "" : hn(String(r[e] ?? ""), e, r.id);
|
|
4480
4483
|
l.length > t && (t = Math.min(l.length, 90));
|
|
4481
4484
|
}
|
|
4482
4485
|
Q((r) => ({ ...r, [e]: Math.max(60, Math.round(t * 6.6) + 28) }));
|
|
4483
|
-
},
|
|
4486
|
+
}, Go = (e) => /* @__PURE__ */ n(
|
|
4484
4487
|
"span",
|
|
4485
4488
|
{
|
|
4486
4489
|
onPointerDown: (t) => {
|
|
4487
4490
|
t.preventDefault(), t.stopPropagation(), dr.current = { key: e, startX: t.clientX, startW: It[e] ?? 140 }, document.body.style.cursor = "col-resize";
|
|
4488
4491
|
},
|
|
4489
4492
|
onDoubleClick: (t) => {
|
|
4490
|
-
t.stopPropagation(),
|
|
4493
|
+
t.stopPropagation(), Jo(e);
|
|
4491
4494
|
},
|
|
4492
4495
|
onClick: (t) => t.stopPropagation(),
|
|
4493
4496
|
title: "Drag to resize · double-click to fit content",
|
|
@@ -4500,13 +4503,13 @@ function Up({
|
|
|
4500
4503
|
{
|
|
4501
4504
|
type: "button",
|
|
4502
4505
|
onClick: (r) => {
|
|
4503
|
-
r.stopPropagation(),
|
|
4506
|
+
r.stopPropagation(), Xs(e);
|
|
4504
4507
|
},
|
|
4505
4508
|
title: jl[t ?? "none"],
|
|
4506
4509
|
"aria-label": jl[t ?? "none"],
|
|
4507
4510
|
className: `ml-1 inline-flex align-middle transition-opacity ${t ? "text-[#00a5cc] opacity-100" : "text-slate-300 opacity-0 group-hover/hcell:opacity-100 dark:text-slate-600"}`,
|
|
4508
4511
|
children: /* @__PURE__ */ n(
|
|
4509
|
-
|
|
4512
|
+
ci,
|
|
4510
4513
|
{
|
|
4511
4514
|
className: "h-3 w-3",
|
|
4512
4515
|
style: t === "right" ? { transform: "scaleX(-1)" } : void 0
|
|
@@ -4514,20 +4517,20 @@ function Up({
|
|
|
4514
4517
|
)
|
|
4515
4518
|
}
|
|
4516
4519
|
);
|
|
4517
|
-
},
|
|
4520
|
+
}, Xo = !!(G || ke || zt != null), { data: Zo } = le({
|
|
4518
4521
|
queryKey: ["cbv-grand-total", a],
|
|
4519
4522
|
queryFn: () => u.request(
|
|
4520
4523
|
X(`/items/${a}`, { limit: 1, fields: "id", count: "approx" })
|
|
4521
4524
|
).then((e) => typeof e.total == "number" ? e.total : null),
|
|
4522
|
-
enabled: !!a && Ze && !Pe &&
|
|
4525
|
+
enabled: !!a && Ze && !Pe && Xo,
|
|
4523
4526
|
staleTime: 5 * 6e4,
|
|
4524
4527
|
retry: !1
|
|
4525
|
-
}), Ql = me(!1), [,
|
|
4528
|
+
}), Ql = me(!1), [, ei] = k(0);
|
|
4526
4529
|
pe(
|
|
4527
4530
|
() => w.getQueryCache().subscribe((e) => {
|
|
4528
4531
|
if (!Ql.current || e.type !== "updated" || e.action.type !== "success") return;
|
|
4529
4532
|
const t = String(e.query.queryKey[0] ?? "");
|
|
4530
|
-
(t === "cbv-quick-options" || t === "cbv-filter-options" || t === "cbv-filter-selected-labels") &&
|
|
4533
|
+
(t === "cbv-quick-options" || t === "cbv-filter-options" || t === "cbv-filter-selected-labels") && ei((r) => r + 1);
|
|
4531
4534
|
}),
|
|
4532
4535
|
[w]
|
|
4533
4536
|
);
|
|
@@ -4604,7 +4607,7 @@ function Up({
|
|
|
4604
4607
|
text: x.value === "none" ? "with no open tasks" : x.value === "overdue" ? "with overdue tasks" : "with open tasks"
|
|
4605
4608
|
});
|
|
4606
4609
|
else if (x.kind === "aging") {
|
|
4607
|
-
const M =
|
|
4610
|
+
const M = Ti({ field: j, type: "range", value: x.value, rangeUnit: "h" });
|
|
4608
4611
|
M && r.push(M);
|
|
4609
4612
|
} else if (x.kind === "text" && x.value.trim())
|
|
4610
4613
|
r.push({ kind: "text", field: j, text: x.value });
|
|
@@ -4642,13 +4645,13 @@ function Up({
|
|
|
4642
4645
|
}).filter((x) => !!x);
|
|
4643
4646
|
g.length > 0 && r.push({ kind: "phrase", text: `flagged ${g.join(" or ")}` });
|
|
4644
4647
|
}
|
|
4645
|
-
return Ql.current = e,
|
|
4648
|
+
return Ql.current = e, Li({
|
|
4646
4649
|
noun: (A == null ? void 0 : A.display_name) || De(a),
|
|
4647
4650
|
viewName: ((f = lt.find((g) => g.id === zt)) == null ? void 0 : f.name) ?? null,
|
|
4648
4651
|
search: G,
|
|
4649
4652
|
clauses: r,
|
|
4650
4653
|
shown: en ? null : Fe,
|
|
4651
|
-
of:
|
|
4654
|
+
of: Zo ?? null,
|
|
4652
4655
|
approx: Ka
|
|
4653
4656
|
});
|
|
4654
4657
|
})();
|
|
@@ -4717,8 +4720,8 @@ function Up({
|
|
|
4717
4720
|
[data-cbv] .cbv-overlay { animation: none; opacity: 1; }
|
|
4718
4721
|
}
|
|
4719
4722
|
` }),
|
|
4720
|
-
/* @__PURE__ */ n(
|
|
4721
|
-
/* @__PURE__ */ n(
|
|
4723
|
+
/* @__PURE__ */ n(Ac, {}),
|
|
4724
|
+
/* @__PURE__ */ n(Bd, {}),
|
|
4722
4725
|
de && Ts(
|
|
4723
4726
|
/* @__PURE__ */ c(
|
|
4724
4727
|
"div",
|
|
@@ -4737,7 +4740,7 @@ function Up({
|
|
|
4737
4740
|
{
|
|
4738
4741
|
type: "button",
|
|
4739
4742
|
onClick: () => {
|
|
4740
|
-
|
|
4743
|
+
vo(de), Bt(null);
|
|
4741
4744
|
},
|
|
4742
4745
|
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",
|
|
4743
4746
|
children: [
|
|
@@ -4746,12 +4749,12 @@ function Up({
|
|
|
4746
4749
|
]
|
|
4747
4750
|
}
|
|
4748
4751
|
),
|
|
4749
|
-
|
|
4752
|
+
ko(de.key, de.row) && de.cellText && de.cellText !== "—" && /* @__PURE__ */ c(
|
|
4750
4753
|
"button",
|
|
4751
4754
|
{
|
|
4752
4755
|
type: "button",
|
|
4753
4756
|
onClick: () => {
|
|
4754
|
-
|
|
4757
|
+
yo(de), Bt(null);
|
|
4755
4758
|
},
|
|
4756
4759
|
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",
|
|
4757
4760
|
children: [
|
|
@@ -4812,7 +4815,7 @@ function Up({
|
|
|
4812
4815
|
{
|
|
4813
4816
|
label: "Copy link",
|
|
4814
4817
|
run: () => {
|
|
4815
|
-
|
|
4818
|
+
Ps(
|
|
4816
4819
|
u,
|
|
4817
4820
|
w,
|
|
4818
4821
|
a,
|
|
@@ -4835,13 +4838,14 @@ function Up({
|
|
|
4835
4838
|
e.label
|
|
4836
4839
|
)),
|
|
4837
4840
|
/* @__PURE__ */ n(
|
|
4838
|
-
|
|
4841
|
+
Fs,
|
|
4839
4842
|
{
|
|
4840
|
-
|
|
4841
|
-
|
|
4842
|
-
|
|
4843
|
+
confirmLabel: "Delete this record? It moves to Trash for 30 days.",
|
|
4844
|
+
onConfirm: () => {
|
|
4845
|
+
El.mutate(de.row.id), Bt(null);
|
|
4843
4846
|
},
|
|
4844
4847
|
className: "block w-full truncate px-3 py-1.5 text-left text-[12px] text-red-600 hover:bg-red-50 dark:text-red-400 dark:hover:bg-red-900/20",
|
|
4848
|
+
armedClassName: "whitespace-normal bg-red-50 font-semibold dark:bg-red-900/20",
|
|
4845
4849
|
children: "Delete"
|
|
4846
4850
|
}
|
|
4847
4851
|
)
|
|
@@ -4853,7 +4857,7 @@ function Up({
|
|
|
4853
4857
|
),
|
|
4854
4858
|
/* @__PURE__ */ c("div", { className: "flex shrink-0 flex-wrap items-center gap-2 border-b border-slate-200 bg-white px-4 py-2.5 dark:border-slate-700 dark:bg-slate-900", children: [
|
|
4855
4859
|
/* @__PURE__ */ n(
|
|
4856
|
-
|
|
4860
|
+
su,
|
|
4857
4861
|
{
|
|
4858
4862
|
collection: a,
|
|
4859
4863
|
meta: A,
|
|
@@ -4871,12 +4875,12 @@ function Up({
|
|
|
4871
4875
|
"button",
|
|
4872
4876
|
{
|
|
4873
4877
|
type: "button",
|
|
4874
|
-
onClick: () =>
|
|
4878
|
+
onClick: () => to((e) => !e),
|
|
4875
4879
|
"aria-pressed": mn,
|
|
4876
4880
|
title: "Only records with an addendum still in review",
|
|
4877
4881
|
className: `flex h-8 items-center gap-1.5 rounded-full border px-2.5 text-[12px] font-medium transition-colors ${mn ? "border-amber-400 bg-amber-50 text-amber-800 dark:border-amber-500/60 dark:bg-amber-500/10 dark:text-amber-300" : "border-slate-200 bg-white text-slate-600 hover:border-slate-300 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-300"}`,
|
|
4878
4882
|
children: [
|
|
4879
|
-
/* @__PURE__ */ n(
|
|
4883
|
+
/* @__PURE__ */ n(ti, { className: "h-3.5 w-3.5" }),
|
|
4880
4884
|
"Active addendums"
|
|
4881
4885
|
]
|
|
4882
4886
|
}
|
|
@@ -4898,7 +4902,7 @@ function Up({
|
|
|
4898
4902
|
/* @__PURE__ */ n(
|
|
4899
4903
|
"span",
|
|
4900
4904
|
{
|
|
4901
|
-
className: `h-2 w-2 rounded-full ${
|
|
4905
|
+
className: `h-2 w-2 rounded-full ${xd(e.highlight_color ?? "red")}`
|
|
4902
4906
|
}
|
|
4903
4907
|
),
|
|
4904
4908
|
e.name
|
|
@@ -4907,7 +4911,7 @@ function Up({
|
|
|
4907
4911
|
e.id
|
|
4908
4912
|
);
|
|
4909
4913
|
}),
|
|
4910
|
-
/* @__PURE__ */ n(
|
|
4914
|
+
/* @__PURE__ */ n(Fc, { className: "h-8" }),
|
|
4911
4915
|
/* @__PURE__ */ n(pc, {}),
|
|
4912
4916
|
Ha > 0 && /* @__PURE__ */ c(
|
|
4913
4917
|
"button",
|
|
@@ -4938,9 +4942,9 @@ function Up({
|
|
|
4938
4942
|
children: /* @__PURE__ */ n(pr, { className: `h-4 w-4 ${gt ? "animate-spin" : ""}` })
|
|
4939
4943
|
}
|
|
4940
4944
|
),
|
|
4941
|
-
/* @__PURE__ */ n(
|
|
4945
|
+
/* @__PURE__ */ n(Nc, { listKey: `cbv:${a}`, getState: qo }),
|
|
4942
4946
|
Dt && Le.copy_as !== !1 && /* @__PURE__ */ n(
|
|
4943
|
-
|
|
4947
|
+
zd,
|
|
4944
4948
|
{
|
|
4945
4949
|
collection: a,
|
|
4946
4950
|
list: {
|
|
@@ -4959,12 +4963,12 @@ function Up({
|
|
|
4959
4963
|
parent: En.parent,
|
|
4960
4964
|
value: nl,
|
|
4961
4965
|
onChange: (e) => {
|
|
4962
|
-
|
|
4966
|
+
no(e), q(1);
|
|
4963
4967
|
}
|
|
4964
4968
|
}
|
|
4965
4969
|
),
|
|
4966
4970
|
[
|
|
4967
|
-
...Pn ? [{ key: "tree", label: "Tree", icon: /* @__PURE__ */ n(
|
|
4971
|
+
...Pn ? [{ key: "tree", label: "Tree", icon: /* @__PURE__ */ n(ni, { className: "h-3.5 w-3.5" }) }] : [],
|
|
4968
4972
|
...(K ?? []).map((e) => ({ key: e.key, label: e.label, icon: e.icon }))
|
|
4969
4973
|
].map((e) => /* @__PURE__ */ c(
|
|
4970
4974
|
"button",
|
|
@@ -4995,7 +4999,7 @@ function Up({
|
|
|
4995
4999
|
className: `flex h-8 items-center gap-1.5 rounded-md border px-2.5 text-[12px] font-medium ${Zn ? "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"}`,
|
|
4996
5000
|
"data-cbv-map-toggle": !0,
|
|
4997
5001
|
children: [
|
|
4998
|
-
/* @__PURE__ */ n(
|
|
5002
|
+
/* @__PURE__ */ n(ai, { className: "h-3.5 w-3.5" }),
|
|
4999
5003
|
"Map"
|
|
5000
5004
|
]
|
|
5001
5005
|
}
|
|
@@ -5077,7 +5081,7 @@ function Up({
|
|
|
5077
5081
|
"button",
|
|
5078
5082
|
{
|
|
5079
5083
|
type: "button",
|
|
5080
|
-
onClick:
|
|
5084
|
+
onClick: As,
|
|
5081
5085
|
"aria-label": "Clear AI result",
|
|
5082
5086
|
className: "rounded-full p-0.5 hover:bg-nvr-cyan/[0.16]",
|
|
5083
5087
|
children: /* @__PURE__ */ n(fr, { className: "h-3 w-3" })
|
|
@@ -5123,13 +5127,13 @@ function Up({
|
|
|
5123
5127
|
"button",
|
|
5124
5128
|
{
|
|
5125
5129
|
type: "button",
|
|
5126
|
-
onClick:
|
|
5130
|
+
onClick: Bs,
|
|
5127
5131
|
"aria-pressed": ht,
|
|
5128
5132
|
"data-cbv-bulk-mode": ht ? "on" : "off",
|
|
5129
5133
|
"data-tip": ht ? "Leave bulk mode — clears the selection and turns row actions back on" : "Select rows to act on several at once",
|
|
5130
5134
|
className: `flex h-8 items-center gap-1.5 rounded-md border px-2.5 text-[12px] font-medium ${ht ? "border-nvr-cyan bg-nvr-cyan/10 text-slate-800 dark:text-slate-100" : "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"}`,
|
|
5131
5135
|
children: [
|
|
5132
|
-
/* @__PURE__ */ n(
|
|
5136
|
+
/* @__PURE__ */ n(ri, { className: "h-3.5 w-3.5" }),
|
|
5133
5137
|
ht ? "Done" : "Bulk select"
|
|
5134
5138
|
]
|
|
5135
5139
|
}
|
|
@@ -5142,7 +5146,7 @@ function Up({
|
|
|
5142
5146
|
"aria-label": "Row density",
|
|
5143
5147
|
title: Yt === "compact" ? "Switch to comfortable rows" : "Switch to compact rows",
|
|
5144
5148
|
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",
|
|
5145
|
-
children: Yt === "compact" ? /* @__PURE__ */ n(as, { className: "h-4 w-4" }) : /* @__PURE__ */ n(
|
|
5149
|
+
children: Yt === "compact" ? /* @__PURE__ */ n(as, { className: "h-4 w-4" }) : /* @__PURE__ */ n(li, { className: "h-4 w-4" })
|
|
5146
5150
|
}
|
|
5147
5151
|
),
|
|
5148
5152
|
/* @__PURE__ */ c("div", { className: "relative", ref: Er, children: [
|
|
@@ -5254,7 +5258,7 @@ function Up({
|
|
|
5254
5258
|
}
|
|
5255
5259
|
),
|
|
5256
5260
|
yn === 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: [
|
|
5257
|
-
/* @__PURE__ */ n("div", { className: "flex flex-wrap gap-1", children:
|
|
5261
|
+
/* @__PURE__ */ n("div", { className: "flex flex-wrap gap-1", children: zc.map((l) => {
|
|
5258
5262
|
const s = JSON.stringify(Ne[e] ?? null) === JSON.stringify(l.cfg);
|
|
5259
5263
|
return /* @__PURE__ */ n(
|
|
5260
5264
|
"button",
|
|
@@ -5405,7 +5409,7 @@ function Up({
|
|
|
5405
5409
|
A && /* @__PURE__ */ c("div", { className: "mt-1 border-t border-slate-100 pt-1.5 dark:border-slate-800", children: [
|
|
5406
5410
|
/* @__PURE__ */ n("p", { className: "px-1.5 pb-1 text-[10.5px] font-semibold uppercase tracking-wide text-slate-400", children: "+ Related column" }),
|
|
5407
5411
|
/* @__PURE__ */ n(
|
|
5408
|
-
|
|
5412
|
+
ou,
|
|
5409
5413
|
{
|
|
5410
5414
|
collection: a,
|
|
5411
5415
|
meta: A,
|
|
@@ -5508,7 +5512,7 @@ function Up({
|
|
|
5508
5512
|
{
|
|
5509
5513
|
type: "button",
|
|
5510
5514
|
onClick: () => {
|
|
5511
|
-
pn(!1),
|
|
5515
|
+
pn(!1), Po();
|
|
5512
5516
|
},
|
|
5513
5517
|
className: "block w-full rounded-md px-2.5 py-1.5 text-left text-[12.5px] text-slate-700 hover:bg-muted dark:text-slate-200",
|
|
5514
5518
|
children: "CSV — visible columns"
|
|
@@ -5534,7 +5538,7 @@ ${r}`).then(() => {
|
|
|
5534
5538
|
});
|
|
5535
5539
|
},
|
|
5536
5540
|
className: "block w-full rounded-md px-2.5 py-1.5 text-left text-[12.5px] text-slate-700 hover:bg-muted dark:text-slate-200",
|
|
5537
|
-
children:
|
|
5541
|
+
children: Ks ? "Copied ✓" : "Copy table to clipboard"
|
|
5538
5542
|
}
|
|
5539
5543
|
),
|
|
5540
5544
|
$l.length > 0 && /* @__PURE__ */ n("p", { className: "border-t border-slate-100 px-2.5 pb-0.5 pt-1.5 text-[10px] font-semibold uppercase tracking-wide text-slate-400 dark:border-border/60", children: "Presets (server, current filters apply)" }),
|
|
@@ -5546,7 +5550,7 @@ ${r}`).then(() => {
|
|
|
5546
5550
|
{
|
|
5547
5551
|
type: "button",
|
|
5548
5552
|
onClick: () => {
|
|
5549
|
-
pn(!1),
|
|
5553
|
+
pn(!1), Co(e.id);
|
|
5550
5554
|
},
|
|
5551
5555
|
className: "block min-w-0 flex-1 rounded-md px-2.5 py-1.5 text-left text-[12.5px] text-slate-700 hover:bg-muted dark:text-slate-200",
|
|
5552
5556
|
children: [
|
|
@@ -5562,7 +5566,7 @@ ${r}`).then(() => {
|
|
|
5562
5566
|
"data-export-background": e.id,
|
|
5563
5567
|
"data-tip": "Run in the background — a download appears in the Jobs tray",
|
|
5564
5568
|
onClick: () => {
|
|
5565
|
-
pn(!1),
|
|
5569
|
+
pn(!1), $o(e.id, e.name);
|
|
5566
5570
|
},
|
|
5567
5571
|
className: "mr-1 shrink-0 rounded px-1.5 py-1 text-[10.5px] font-medium text-slate-500 hover:bg-muted hover:text-slate-800 dark:text-slate-400 dark:hover:text-slate-100",
|
|
5568
5572
|
children: "Background"
|
|
@@ -5624,7 +5628,7 @@ ${r}`).then(() => {
|
|
|
5624
5628
|
slug: e.slug,
|
|
5625
5629
|
label: e.create_label ?? e.name,
|
|
5626
5630
|
isDefault: !1,
|
|
5627
|
-
steps:
|
|
5631
|
+
steps: Vs(e)
|
|
5628
5632
|
}))
|
|
5629
5633
|
].map((e) => /* @__PURE__ */ c(
|
|
5630
5634
|
"div",
|
|
@@ -5740,7 +5744,7 @@ ${r}`).then(() => {
|
|
|
5740
5744
|
accept: (((es = Fn.data) == null ? void 0 : es.accept) ?? []).join(","),
|
|
5741
5745
|
multiple: !0,
|
|
5742
5746
|
className: "hidden",
|
|
5743
|
-
onChange:
|
|
5747
|
+
onChange: Ws,
|
|
5744
5748
|
"data-cbv-autofill-input": !0
|
|
5745
5749
|
}
|
|
5746
5750
|
)
|
|
@@ -5783,7 +5787,7 @@ ${r}`).then(() => {
|
|
|
5783
5787
|
] }),
|
|
5784
5788
|
Ft.length > 0 && /* @__PURE__ */ c("div", { className: "flex shrink-0 flex-wrap items-center gap-1.5 border-b border-slate-100 bg-white px-4 py-1.5 dark:border-slate-800 dark:bg-slate-900", children: [
|
|
5785
5789
|
Ft.map((e) => /* @__PURE__ */ n(
|
|
5786
|
-
|
|
5790
|
+
Zc,
|
|
5787
5791
|
{
|
|
5788
5792
|
def: e,
|
|
5789
5793
|
allowedIds: Wr(e),
|
|
@@ -5891,11 +5895,11 @@ ${r}`).then(() => {
|
|
|
5891
5895
|
"button",
|
|
5892
5896
|
{
|
|
5893
5897
|
type: "button",
|
|
5894
|
-
onClick: () =>
|
|
5898
|
+
onClick: () => Eo.mutate(e.id),
|
|
5895
5899
|
title: da(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",
|
|
5896
5900
|
"aria-label": `Toggle digest subscription for ${e.name}`,
|
|
5897
5901
|
className: da(e.id) ? "text-[#00a5cc]" : "text-slate-400 hover:text-[#00a5cc]",
|
|
5898
|
-
children: da(e.id) ? /* @__PURE__ */ n(
|
|
5902
|
+
children: da(e.id) ? /* @__PURE__ */ n(si, { className: "h-3 w-3", fill: "currentColor" }) : /* @__PURE__ */ n(oi, { className: "h-3 w-3" })
|
|
5899
5903
|
}
|
|
5900
5904
|
),
|
|
5901
5905
|
/* @__PURE__ */ n(
|
|
@@ -5909,8 +5913,8 @@ ${r}`).then(() => {
|
|
|
5909
5913
|
"data-view-update": e.id,
|
|
5910
5914
|
"data-view-update-state": At.isPending && At.variables === e.id ? "saving" : ar === e.id ? "saved" : "idle",
|
|
5911
5915
|
className: "inline-flex h-3.5 w-3.5 items-center justify-center",
|
|
5912
|
-
children: At.isPending && At.variables === e.id ? /* @__PURE__ */ n(
|
|
5913
|
-
|
|
5916
|
+
children: At.isPending && At.variables === e.id ? /* @__PURE__ */ n(ii, { className: "h-3 w-3 animate-spin" }) : ar === e.id ? /* @__PURE__ */ n(
|
|
5917
|
+
di,
|
|
5914
5918
|
{
|
|
5915
5919
|
className: "h-3 w-3 text-emerald-600 dark:text-emerald-400",
|
|
5916
5920
|
strokeWidth: 3
|
|
@@ -5924,15 +5928,15 @@ ${r}`).then(() => {
|
|
|
5924
5928
|
name: e.name,
|
|
5925
5929
|
isDefault: !!e.is_default,
|
|
5926
5930
|
roleId: e.default_for_role ?? null,
|
|
5927
|
-
onCollectionDefault: (t) =>
|
|
5928
|
-
onRoleDefault: (t) =>
|
|
5931
|
+
onCollectionDefault: (t) => To.mutate({ id: e.id, on: t }),
|
|
5932
|
+
onRoleDefault: (t) => Lo.mutate({ id: e.id, role: t })
|
|
5929
5933
|
}
|
|
5930
5934
|
),
|
|
5931
5935
|
/* @__PURE__ */ n(
|
|
5932
5936
|
"button",
|
|
5933
5937
|
{
|
|
5934
5938
|
type: "button",
|
|
5935
|
-
onClick: () =>
|
|
5939
|
+
onClick: () => Fo.mutate(e.id),
|
|
5936
5940
|
title: "Delete view",
|
|
5937
5941
|
"aria-label": `Delete ${e.name}`,
|
|
5938
5942
|
className: "hover:text-red-500",
|
|
@@ -5944,7 +5948,7 @@ ${r}`).then(() => {
|
|
|
5944
5948
|
},
|
|
5945
5949
|
e.id
|
|
5946
5950
|
)),
|
|
5947
|
-
|
|
5951
|
+
Is ? /* @__PURE__ */ c(
|
|
5948
5952
|
"form",
|
|
5949
5953
|
{
|
|
5950
5954
|
className: "flex items-center gap-1",
|
|
@@ -5994,13 +5998,13 @@ ${r}`).then(() => {
|
|
|
5994
5998
|
)
|
|
5995
5999
|
] }),
|
|
5996
6000
|
He != 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: [
|
|
5997
|
-
/* @__PURE__ */ n("span", { className: "min-w-0 flex-1", children:
|
|
6001
|
+
/* @__PURE__ */ n("span", { className: "min-w-0 flex-1", children: rd(He) === 503 ? ld(He) : Wt(He, "Failed to load records") }),
|
|
5998
6002
|
(He == null ? void 0 : He.status) === 403 && !lc(He) && /* @__PURE__ */ n(
|
|
5999
6003
|
"button",
|
|
6000
6004
|
{
|
|
6001
6005
|
type: "button",
|
|
6002
6006
|
disabled: ll,
|
|
6003
|
-
onClick: () => void u.request(_e("/access-requests", { collection: a })).then(() =>
|
|
6007
|
+
onClick: () => void u.request(_e("/access-requests", { collection: a })).then(() => ao(!0)).catch(() => {
|
|
6004
6008
|
}),
|
|
6005
6009
|
className: "h-7 shrink-0 rounded-md border border-red-300 px-2.5 text-[12px] font-medium hover:bg-red-100 disabled:opacity-60 dark:border-red-500/40 dark:hover:bg-red-900/20",
|
|
6006
6010
|
"data-request-access": !0,
|
|
@@ -6037,7 +6041,7 @@ ${r}`).then(() => {
|
|
|
6037
6041
|
)
|
|
6038
6042
|
] }),
|
|
6039
6043
|
St === "tree" && Pn ? /* @__PURE__ */ n("div", { className: "flex min-h-0 flex-1 flex-col p-4 pt-3", children: /* @__PURE__ */ n("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__ */ n(
|
|
6040
|
-
|
|
6044
|
+
Ud,
|
|
6041
6045
|
{
|
|
6042
6046
|
collection: a,
|
|
6043
6047
|
config: Pn,
|
|
@@ -6050,7 +6054,7 @@ ${r}`).then(() => {
|
|
|
6050
6054
|
}
|
|
6051
6055
|
) }) }) : St && (K != null && K.some((e) => e.key === St)) ? /* @__PURE__ */ n("div", { className: "flex min-h-0 flex-1 flex-col p-4 pt-3", "data-cbv-extra-view": St, children: (ts = K.find((e) => e.key === St)) == null ? void 0 : ts.render() }) : null,
|
|
6052
6056
|
Zn && fn ? /* @__PURE__ */ n("div", { className: "flex min-h-0 flex-1 flex-col p-4 pt-3", children: /* @__PURE__ */ n(
|
|
6053
|
-
|
|
6057
|
+
$c,
|
|
6054
6058
|
{
|
|
6055
6059
|
collection: a,
|
|
6056
6060
|
latField: fn.latField,
|
|
@@ -6087,7 +6091,7 @@ ${r}`).then(() => {
|
|
|
6087
6091
|
/* @__PURE__ */ n(pr, { "aria-hidden": !0, className: "h-3.5 w-3.5 animate-spin text-[#00a5cc]" }),
|
|
6088
6092
|
pl != null ? `${za.text ?? "Still working"} — ${pl}s` : "Loading…"
|
|
6089
6093
|
] }) }) }),
|
|
6090
|
-
ea && za.slow && /* @__PURE__ */ n("div", { className: "pointer-events-none absolute inset-x-0 top-12 z-[6] flex justify-center px-4", children: /* @__PURE__ */ n(
|
|
6094
|
+
ea && za.slow && /* @__PURE__ */ n("div", { className: "pointer-events-none absolute inset-x-0 top-12 z-[6] flex justify-center px-4", children: /* @__PURE__ */ n(Oc, { reason: za, variant: "pill" }) }),
|
|
6091
6095
|
/* @__PURE__ */ n(
|
|
6092
6096
|
"div",
|
|
6093
6097
|
{
|
|
@@ -6132,7 +6136,7 @@ ${r}`).then(() => {
|
|
|
6132
6136
|
{
|
|
6133
6137
|
type: "checkbox",
|
|
6134
6138
|
checked: rr,
|
|
6135
|
-
onChange:
|
|
6139
|
+
onChange: Ao,
|
|
6136
6140
|
"aria-label": "Select all"
|
|
6137
6141
|
}
|
|
6138
6142
|
)
|
|
@@ -6164,7 +6168,7 @@ ${r}`).then(() => {
|
|
|
6164
6168
|
ref: r ? ir(t) : void 0,
|
|
6165
6169
|
style: { ...Bl(t), ...Re(t) },
|
|
6166
6170
|
onClick: () => {
|
|
6167
|
-
g ||
|
|
6171
|
+
g || Oo(t);
|
|
6168
6172
|
},
|
|
6169
6173
|
className: `${l} relative ${_l(t) ? "text-right" : "text-left"} ${g ? "" : "cursor-pointer hover:text-slate-600"} ${s}`,
|
|
6170
6174
|
children: [
|
|
@@ -6186,14 +6190,14 @@ ${r}`).then(() => {
|
|
|
6186
6190
|
}
|
|
6187
6191
|
),
|
|
6188
6192
|
zl(t),
|
|
6189
|
-
|
|
6193
|
+
Go(t)
|
|
6190
6194
|
]
|
|
6191
6195
|
},
|
|
6192
6196
|
t
|
|
6193
6197
|
);
|
|
6194
6198
|
})
|
|
6195
6199
|
] }),
|
|
6196
|
-
(
|
|
6200
|
+
(_o || In) && /* @__PURE__ */ c("tr", { className: "border-b border-slate-200 dark:border-slate-700", children: [
|
|
6197
6201
|
Lt && /* @__PURE__ */ n("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" }),
|
|
6198
6202
|
nn.map((e) => {
|
|
6199
6203
|
var s;
|
|
@@ -6336,7 +6340,7 @@ ${r}`).then(() => {
|
|
|
6336
6340
|
className: `${l} ${e.kind === "actions" ? "w-20" : ""}`
|
|
6337
6341
|
},
|
|
6338
6342
|
t
|
|
6339
|
-
) : /* @__PURE__ */ n("th", { style: Re(t), className: l, children:
|
|
6343
|
+
) : /* @__PURE__ */ n("th", { style: Re(t), className: l, children: wo(t) }, t);
|
|
6340
6344
|
})
|
|
6341
6345
|
] })
|
|
6342
6346
|
] }),
|
|
@@ -6344,9 +6348,9 @@ ${r}`).then(() => {
|
|
|
6344
6348
|
// #3229 — one placeholder per real column, real row height (h-8, or the
|
|
6345
6349
|
// table's comfortable h-11), real pins/widths: nothing moves on arrival.
|
|
6346
6350
|
/* @__PURE__ */ n(
|
|
6347
|
-
|
|
6351
|
+
Mc,
|
|
6348
6352
|
{
|
|
6349
|
-
columns:
|
|
6353
|
+
columns: zo,
|
|
6350
6354
|
rows: Math.min(ze, 20),
|
|
6351
6355
|
rowClassName: "h-8",
|
|
6352
6356
|
cellClassName: "px-3 py-1.5",
|
|
@@ -6407,7 +6411,7 @@ ${r}`).then(() => {
|
|
|
6407
6411
|
"button",
|
|
6408
6412
|
{
|
|
6409
6413
|
type: "button",
|
|
6410
|
-
onClick:
|
|
6414
|
+
onClick: lo,
|
|
6411
6415
|
className: "font-medium text-[#0284a8] underline-offset-2 hover:underline dark:text-nvr-cyan",
|
|
6412
6416
|
children: "Show all"
|
|
6413
6417
|
}
|
|
@@ -6462,17 +6466,17 @@ ${r}`).then(() => {
|
|
|
6462
6466
|
},
|
|
6463
6467
|
`__group__${e.gkey}`
|
|
6464
6468
|
);
|
|
6465
|
-
const l = e.row, s = l.id, o = Jt.includes(s), f = (B = Te == null ? void 0 : Te.instances) == null ? void 0 : B[String(s)], g =
|
|
6469
|
+
const l = e.row, s = l.id, o = Jt.includes(s), f = (B = Te == null ? void 0 : Te.instances) == null ? void 0 : B[String(s)], g = mo[String(s)], x = Za == null ? void 0 : Za[String(s)], j = uo.get(String(s)) ?? null, I = bo(a, s), $e = !o && g ? vd(g.color) : void 0, M = o ? "bg-[#e6fafe] dark:bg-[#0c2a33]" : $e ?? "bg-white group-hover:bg-[#f2fcff] dark:bg-slate-900 dark:group-hover:bg-[#0e2d3a]";
|
|
6466
6470
|
return /* @__PURE__ */ c(
|
|
6467
6471
|
"tr",
|
|
6468
6472
|
{
|
|
6469
|
-
...
|
|
6470
|
-
...
|
|
6473
|
+
...so({ collection: a, id: String(s) }),
|
|
6474
|
+
...Mo(s),
|
|
6471
6475
|
"data-row-key": String(s),
|
|
6472
|
-
title: Et.titleFor(String(s)) ?? (j && !j.is_mine ?
|
|
6476
|
+
title: Et.titleFor(String(s)) ?? (j && !j.is_mine ? Zi(j) : void 0) ?? (g ? `At risk — ${g.rule}` : void 0) ?? (I ? Lc : void 0),
|
|
6473
6477
|
"data-picker-excluded": I ? "" : void 0,
|
|
6474
6478
|
style: r,
|
|
6475
|
-
className: `nvr-row-enter group h-8 cursor-pointer border-b border-slate-100 transition-colors duration-150 hover:bg-nvr-cyan/[0.04] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-nvr-cyan dark:border-slate-800 dark:hover:bg-nvr-cyan/[0.08] ${o ? "bg-nvr-cyan/[0.08]" : $e ?? ""} ${I ?
|
|
6479
|
+
className: `nvr-row-enter group h-8 cursor-pointer border-b border-slate-100 transition-colors duration-150 hover:bg-nvr-cyan/[0.04] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-nvr-cyan dark:border-slate-800 dark:hover:bg-nvr-cyan/[0.08] ${o ? "bg-nvr-cyan/[0.08]" : $e ?? ""} ${I ? Tc : ""}`,
|
|
6476
6480
|
children: [
|
|
6477
6481
|
Lt && /* @__PURE__ */ n(
|
|
6478
6482
|
"td",
|
|
@@ -6481,26 +6485,26 @@ ${r}`).then(() => {
|
|
|
6481
6485
|
onClick: (H) => H.stopPropagation(),
|
|
6482
6486
|
children: /* @__PURE__ */ c("span", { className: "flex items-center gap-1", children: [
|
|
6483
6487
|
j || Et.isNew(String(s)) ? /* @__PURE__ */ n(
|
|
6484
|
-
|
|
6488
|
+
_c,
|
|
6485
6489
|
{
|
|
6486
6490
|
lock: j,
|
|
6487
6491
|
isNew: Et.isNew(String(s)),
|
|
6488
6492
|
dataAttr: "data-cbv-live-mark"
|
|
6489
6493
|
}
|
|
6490
6494
|
) : ml[us(a, String(s))] ? /* @__PURE__ */ n(
|
|
6491
|
-
|
|
6495
|
+
Dc,
|
|
6492
6496
|
{
|
|
6493
6497
|
viewers: ml[us(a, String(s))],
|
|
6494
6498
|
dataAttr: "data-cbv-presence"
|
|
6495
6499
|
}
|
|
6496
6500
|
) : /* @__PURE__ */ n(ys, { change: x, dataAttr: "data-cbv-unseen" }),
|
|
6497
|
-
/* @__PURE__ */ n(
|
|
6501
|
+
/* @__PURE__ */ n(Id, { rowId: s }),
|
|
6498
6502
|
ht && /* @__PURE__ */ n(
|
|
6499
6503
|
"input",
|
|
6500
6504
|
{
|
|
6501
6505
|
type: "checkbox",
|
|
6502
6506
|
checked: o,
|
|
6503
|
-
onChange: () =>
|
|
6507
|
+
onChange: () => Io(s),
|
|
6504
6508
|
"aria-label": `Select ${s}`
|
|
6505
6509
|
}
|
|
6506
6510
|
)
|
|
@@ -6579,7 +6583,7 @@ ${r}`).then(() => {
|
|
|
6579
6583
|
style: Re(p),
|
|
6580
6584
|
"data-tip": V != null && (T != null && T.entered_at) ? `In ${T.state_label ?? "this state"} since ${new Date(T.entered_at).toLocaleString()}` : void 0,
|
|
6581
6585
|
className: `whitespace-nowrap px-3 py-1.5 text-[12px] tabular-nums text-slate-600 dark:text-slate-300 ${st(p, "z-[1]", M)}`,
|
|
6582
|
-
children: V == null ? /* @__PURE__ */ n("span", { className: "text-slate-300 dark:text-slate-600", children: "—" }) :
|
|
6586
|
+
children: V == null ? /* @__PURE__ */ n("span", { className: "text-slate-300 dark:text-slate-600", children: "—" }) : Ld(V)
|
|
6583
6587
|
},
|
|
6584
6588
|
p
|
|
6585
6589
|
);
|
|
@@ -6608,7 +6612,7 @@ ${r}`).then(() => {
|
|
|
6608
6612
|
{
|
|
6609
6613
|
style: Re(p),
|
|
6610
6614
|
className: `whitespace-nowrap px-3 py-1.5 ${st(p, "z-[1]", M)}`,
|
|
6611
|
-
children: /* @__PURE__ */ n(
|
|
6615
|
+
children: /* @__PURE__ */ n(Wc, { summary: T })
|
|
6612
6616
|
},
|
|
6613
6617
|
p
|
|
6614
6618
|
);
|
|
@@ -6669,13 +6673,13 @@ ${r}`).then(() => {
|
|
|
6669
6673
|
);
|
|
6670
6674
|
}
|
|
6671
6675
|
if (H.kind === "formula") {
|
|
6672
|
-
const T =
|
|
6676
|
+
const T = Zs(l, p);
|
|
6673
6677
|
return /* @__PURE__ */ n(
|
|
6674
6678
|
"td",
|
|
6675
6679
|
{
|
|
6676
6680
|
style: Re(p),
|
|
6677
6681
|
"data-cbv-formula-cell": p,
|
|
6678
|
-
"data-tip":
|
|
6682
|
+
"data-tip": eo(l, p),
|
|
6679
6683
|
className: `whitespace-nowrap px-3 py-1.5 text-right tabular-nums text-slate-700 dark:text-slate-200 ${st(p, "z-[1]", M)}`,
|
|
6680
6684
|
children: T == null ? /* @__PURE__ */ n("span", { className: "text-slate-300 dark:text-slate-600", children: "—" }) : Ne[p] ? xn(String(T), Ne[p]) : ct(Math.round(T * 100) / 100)
|
|
6681
6685
|
},
|
|
@@ -6690,7 +6694,7 @@ ${r}`).then(() => {
|
|
|
6690
6694
|
className: `w-20 whitespace-nowrap px-2 py-1 text-right ${st(p, "z-[1]", M)}`,
|
|
6691
6695
|
onClick: (T) => T.stopPropagation(),
|
|
6692
6696
|
children: /* @__PURE__ */ n(
|
|
6693
|
-
|
|
6697
|
+
Yc,
|
|
6694
6698
|
{
|
|
6695
6699
|
collection: a,
|
|
6696
6700
|
id: s,
|
|
@@ -6708,7 +6712,7 @@ ${r}`).then(() => {
|
|
|
6708
6712
|
},
|
|
6709
6713
|
p
|
|
6710
6714
|
);
|
|
6711
|
-
const it = Ot(p) ?
|
|
6715
|
+
const it = Ot(p) ? xo(s, p) : null, We = Ot(p) ? null : at(Qe, a, p);
|
|
6712
6716
|
return /* @__PURE__ */ n(
|
|
6713
6717
|
"td",
|
|
6714
6718
|
{
|
|
@@ -6723,7 +6727,7 @@ ${r}`).then(() => {
|
|
|
6723
6727
|
});
|
|
6724
6728
|
},
|
|
6725
6729
|
className: `whitespace-nowrap px-3 py-1.5 ${_l(p) ? "text-right" : ""} ${st(p, "z-[1]", M)}`,
|
|
6726
|
-
children:
|
|
6730
|
+
children: Gs(
|
|
6727
6731
|
l,
|
|
6728
6732
|
p,
|
|
6729
6733
|
!!j && !j.is_mine,
|
|
@@ -6846,7 +6850,7 @@ ${r}`).then(() => {
|
|
|
6846
6850
|
},
|
|
6847
6851
|
String(s)
|
|
6848
6852
|
);
|
|
6849
|
-
}) },
|
|
6853
|
+
}) }, ro),
|
|
6850
6854
|
ja && Object.keys(ja).length > 0 && !ue && /* @__PURE__ */ n("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: [
|
|
6851
6855
|
Lt && /* @__PURE__ */ n("td", { className: "sticky left-0 z-[3] w-11 bg-slate-50 py-1.5 pl-1.5 pr-3 dark:bg-slate-800" }),
|
|
6852
6856
|
nn.map((e, t) => {
|
|
@@ -6870,7 +6874,7 @@ ${r}`).then(() => {
|
|
|
6870
6874
|
),
|
|
6871
6875
|
/* @__PURE__ */ n(bc, { scrollerRef: Pr }),
|
|
6872
6876
|
/* @__PURE__ */ n(
|
|
6873
|
-
|
|
6877
|
+
Pc,
|
|
6874
6878
|
{
|
|
6875
6879
|
collections: a ? [a] : [],
|
|
6876
6880
|
selectedIds: Rt,
|
|
@@ -6892,9 +6896,9 @@ ${r}`).then(() => {
|
|
|
6892
6896
|
!ue && !Pe && (en ? O > 1 || ye.length >= ze : Fe > ze) && /* @__PURE__ */ c("div", { className: "flex shrink-0 items-center justify-between border-t border-slate-100 bg-white px-3 py-2 dark:border-slate-800 dark:bg-slate-900", children: [
|
|
6893
6897
|
/* @__PURE__ */ c("p", { className: "text-[12px] tabular-nums text-slate-500 dark:text-slate-400", children: [
|
|
6894
6898
|
/* @__PURE__ */ c("span", { className: "font-semibold text-slate-700 dark:text-slate-200", children: [
|
|
6895
|
-
ct(
|
|
6899
|
+
ct(jo),
|
|
6896
6900
|
"–",
|
|
6897
|
-
ct(
|
|
6901
|
+
ct(Bo)
|
|
6898
6902
|
] }),
|
|
6899
6903
|
" ",
|
|
6900
6904
|
"of",
|
|
@@ -6971,7 +6975,7 @@ ${r}`).then(() => {
|
|
|
6971
6975
|
}
|
|
6972
6976
|
),
|
|
6973
6977
|
et != null && et.length ? /* @__PURE__ */ n(
|
|
6974
|
-
|
|
6978
|
+
Ec,
|
|
6975
6979
|
{
|
|
6976
6980
|
collection: et[0].collection,
|
|
6977
6981
|
itemId: et[0].itemId,
|
|
@@ -6983,7 +6987,7 @@ ${r}`).then(() => {
|
|
|
6983
6987
|
}
|
|
6984
6988
|
) : null,
|
|
6985
6989
|
Sn && /* @__PURE__ */ n(
|
|
6986
|
-
|
|
6990
|
+
Kc,
|
|
6987
6991
|
{
|
|
6988
6992
|
collection: a,
|
|
6989
6993
|
item: Sn,
|
|
@@ -7005,14 +7009,14 @@ ${r}`).then(() => {
|
|
|
7005
7009
|
{
|
|
7006
7010
|
type: "button",
|
|
7007
7011
|
disabled: Pl,
|
|
7008
|
-
onClick: () => void
|
|
7012
|
+
onClick: () => void Ko(),
|
|
7009
7013
|
className: "font-semibold text-nvr-navy underline decoration-dotted hover:text-nvr-cyan dark:text-nvr-cyan",
|
|
7010
7014
|
children: Pl ? "Selecting…" : Fe > ca ? `Select the first ${ca.toLocaleString()} of ${Fe.toLocaleString()} matching` : `Select all ${Fe.toLocaleString()} matching rows`
|
|
7011
7015
|
}
|
|
7012
7016
|
)
|
|
7013
7017
|
] }),
|
|
7014
7018
|
Lt && ht && Jt.length > 0 && /* @__PURE__ */ n(
|
|
7015
|
-
|
|
7019
|
+
cu,
|
|
7016
7020
|
{
|
|
7017
7021
|
collection: a,
|
|
7018
7022
|
selectedIds: Jt,
|
|
@@ -7028,7 +7032,7 @@ ${r}`).then(() => {
|
|
|
7028
7032
|
}
|
|
7029
7033
|
);
|
|
7030
7034
|
}
|
|
7031
|
-
function
|
|
7035
|
+
function pu(a, i, b, d) {
|
|
7032
7036
|
const v = Nr(i, a, b);
|
|
7033
7037
|
if (v != null && v.one_collection) return /* @__PURE__ */ n(Sr, { relatedCollection: v.one_collection, id: d });
|
|
7034
7038
|
if (typeof d == "boolean") return d ? "Yes" : "No";
|
|
@@ -7037,12 +7041,12 @@ function uu(a, i, b, d) {
|
|
|
7037
7041
|
return /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}/.test(_) ? new Date(_).toLocaleString() : _.length > 160 ? `${_.slice(0, 160)}…` : _;
|
|
7038
7042
|
}
|
|
7039
7043
|
export {
|
|
7040
|
-
|
|
7044
|
+
Vp as CollectionBrowserView,
|
|
7041
7045
|
wa as MultiPick,
|
|
7042
|
-
|
|
7046
|
+
Yc as RowActionsMenu,
|
|
7043
7047
|
_s as TINT_TEXT,
|
|
7044
7048
|
ha as invalidateCbvRowQueries,
|
|
7045
|
-
|
|
7046
|
-
|
|
7049
|
+
Hc as roleMayDelete,
|
|
7050
|
+
Vc as roleMayUpdate,
|
|
7047
7051
|
ma as tintFor
|
|
7048
7052
|
};
|