@nivaro/react 0.3.66 → 0.3.67
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 +8 -1
- package/dist/shared/components/ActivityEntry.js +28 -28
- package/dist/shared/components/CollectionBrowserView.js +584 -585
- package/dist/shared/components/ItemEditForm.js +1758 -1758
- package/dist/shared/components/RecordCompare.js +149 -129
- package/dist/shared/components/bulk/BulkCompareButton.js +16 -16
- package/dist/shared/components/integrations/IntegrationObligationsView.js +199 -187
- package/dist/shared/components/integrations/console/EventsView.js +22 -24
- package/dist/shared/components/integrations/console/SubmissionRow.js +6 -13
- package/dist/shared/components/integrations/console/drill/SubmissionDrill.js +29 -28
- package/dist/shared/components/integrations/console/tone.js +22 -21
- package/dist/shared/components/item-edit/FieldRow.js +193 -193
- package/dist/shared/components/item-edit/GroupSection.js +209 -209
- package/dist/shared/components/item-edit/RecordInsights.js +46 -45
- package/dist/shared/components/panels/BranchLanes.js +7 -7
- package/dist/shared/components/panels/CommentPanel.js +72 -72
- package/dist/shared/components/panels/PipelinePanel.js +261 -261
- package/dist/shared/components/panels/RecordIntegrityBanner.js +78 -78
- package/dist/shared/components/panels/RevisionsPanel.js +220 -220
- package/dist/shared/components/panels/TaskPanel.js +75 -75
- package/dist/shared/components/queue/QueueWorklist.js +499 -498
- package/dist/shared/lib/compare-value.js +73 -0
- package/dist/shared/lib/format-value.js +19 -18
- package/dist/shared/lib/utils.js +59 -57
- package/package.json +1 -1
|
@@ -13,94 +13,95 @@ import { useBulkProgressFeed as $i, newBulkProgressId as qi, startBulkProgress a
|
|
|
13
13
|
import { csvNumber as Fi, csvDateTime as Ri, readExportExtras as Ei, VIRTUAL_HEADERS as Di, virtualExportCell as Pi } from "../lib/cbv-export.js";
|
|
14
14
|
import { warmPageLookups as Mi } from "../lib/cbv-page-warm.js";
|
|
15
15
|
import { post as ye, get as G, patch as xa, del as ya } from "../lib/commands.js";
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
16
|
+
import { compareValueText as Oi } from "../lib/compare-value.js";
|
|
17
|
+
import { parseDateFilter as Sa, dateFilterBounds as Ai, describeDateFilter as Ii, DATE_FILTER_OPS as Ki, formatDateFilter as ji } from "../lib/date-filter.js";
|
|
18
|
+
import { rowDeleteOffered as Bi } from "../lib/delete-offer.js";
|
|
19
|
+
import { errorSentence as zi } from "../lib/error-message.js";
|
|
20
|
+
import { errorToastOptions as wa, toastError as Qi } from "../lib/error-toast.js";
|
|
21
|
+
import { extractExpressionTokens as Ui, evaluateNumeric as gs } from "../lib/expression.js";
|
|
22
|
+
import { clauseFromCondition as wr, clauseFromControlValue as Wi, filterSentence as Vi } from "../lib/filter-sentence.js";
|
|
23
|
+
import { deliverLive as Hi, releaseLiveOwner as Yi } from "../lib/focus-mode.js";
|
|
24
|
+
import { formatValue as Un, formatMultiValue as xs, countFromResolved as Ji } from "../lib/format-value.js";
|
|
25
|
+
import { createCursorBook as Gi, pageRequest as Xi, noteNextCursor as Zi, isCursorRefusal as ed, stopCursors as td } from "../lib/keyset-pager.js";
|
|
26
|
+
import { normalizeInlineEdit as nd, inlineM2oTarget as ad, inlineChoices as rd, inlineEditFor as ld, nextInlineKey as sd } from "../lib/list-inline-edit.js";
|
|
27
|
+
import { sanitizeCbvLinkState as od, readListLinkFromLocation as id, dropListLinkParam as dd } from "../lib/list-link.js";
|
|
28
|
+
import { rememberedListPage as cd, pageWhileSettling as vs, rememberListPage as ud, restoreWindowOutcome as pd } from "../lib/list-page-memory.js";
|
|
29
|
+
import { expandCoalesced as md, LIVE_ASPECTS as wn } from "../lib/live.js";
|
|
30
|
+
import { useRowChanges as fd, useRowLocks as bd, lockLabel as hd, viewerMatches as gd, conditionFields as xd, mayAffectMatch as vd, writerOf as kd } from "../lib/live-list.js";
|
|
31
|
+
import { loadErrorStatus as yd, listLoadErrorText as wd } from "../lib/load-error.js";
|
|
32
|
+
import { OPEN_IN_TABS_CAP as _d, openInTabs as Nd, openInTabsMessage as ks } from "../lib/open-in-tabs.js";
|
|
33
|
+
import { isOwnWrite as Sd } from "../lib/own-writes.js";
|
|
34
|
+
import { useIdleNextPage as Cd, intentProps as $d, prefetchRecord as qd } from "../lib/prefetch.js";
|
|
35
|
+
import { useRowPresence as Td, rowPresenceKey as ys } from "../lib/presence-hooks.js";
|
|
36
|
+
import { cascadeFilter as Ld, fetchCascadeRelations as Fd } from "../lib/quick-filter-cascade.js";
|
|
37
|
+
import { useOptionalRealtime as Rd } from "../lib/realtime.js";
|
|
38
|
+
import { rowMenuRef as qr, recordRefLabel as Ed, friendlyIdOf as _r, copyWhenReady as Dd, shareableRecordId as Pd, friendlyIdFieldOf as Md } from "../lib/record-ref.js";
|
|
39
|
+
import { rowHighlightDotClass as Od, rowHighlightClass as Ad } from "../lib/row-highlight.js";
|
|
39
40
|
import { userErrorMessage as Vt } from "../lib/safe-error.js";
|
|
40
|
-
import { logSearch as
|
|
41
|
-
import { shapeForField as
|
|
42
|
-
import { knownTotalFrom as
|
|
43
|
-
import { nextSortValue as
|
|
44
|
-
import { useMyScopes as
|
|
45
|
-
import { useNewItemLayouts as
|
|
46
|
-
import { loadUserCard as
|
|
47
|
-
import { cn as Wt, humanHours as
|
|
48
|
-
import { usePublishAskContext as
|
|
49
|
-
import { useAvailableBulkActions as
|
|
50
|
-
import { BulkCompareButton as
|
|
51
|
-
import { BulkFieldUpdate as
|
|
52
|
-
import { BulkRowMark as
|
|
53
|
-
import { MessageStakeholdersForm as
|
|
54
|
-
import { useRowPushActions as
|
|
55
|
-
import { CellCopyLayer as
|
|
56
|
-
import { CopyAsButton as
|
|
57
|
-
import { useTreeConfig as
|
|
58
|
-
import { readExportRows as
|
|
59
|
-
import { FormulaColumnAdder as
|
|
60
|
-
import { useHierarchyScope as
|
|
61
|
-
import { tabStopRowKey as
|
|
62
|
-
import { splitRiskFilter as _s, riskFilterEntry as
|
|
63
|
-
import { isFilterRefusal as
|
|
64
|
-
import { ViewDefaultMenu as
|
|
65
|
-
import { useRecordRoomTypes as
|
|
66
|
-
import { FilterControl as
|
|
67
|
-
import { FocusModeToggle as
|
|
68
|
-
import { FULFILMENT_FILTER_OPTIONS as Ss, FulfilmentPill as
|
|
69
|
-
import { HScrollProxy as
|
|
70
|
-
import { useDocumentAutofillConfig as
|
|
71
|
-
import { INTEGRATIONS_FILTER_OPTIONS as Cs, IntegrationDots as
|
|
72
|
-
import { useQuickPickerSteps as
|
|
73
|
-
import { usePickerExclusion as
|
|
41
|
+
import { logSearch as Id, logSearchOpen as Kd } from "../lib/search-log.js";
|
|
42
|
+
import { shapeForField as jd } from "../lib/skeleton-shapes.js";
|
|
43
|
+
import { knownTotalFrom as Bd } from "../lib/slow-reason.js";
|
|
44
|
+
import { nextSortValue as zd } from "../lib/sort-cycle.js";
|
|
45
|
+
import { useMyScopes as Qd, matchScopeDimension as ws, effectiveScopeSeedIds as Ud, translateScopeValues as Wd } from "../lib/use-my-scopes.js";
|
|
46
|
+
import { useNewItemLayouts as Vd } from "../lib/use-new-item-layouts.js";
|
|
47
|
+
import { loadUserCard as Hd, userCardQuery as Yd } from "../lib/user-cards.js";
|
|
48
|
+
import { cn as Wt, humanHours as Jd, formatDateTime as Gd } from "../lib/utils.js";
|
|
49
|
+
import { usePublishAskContext as Xd, useAskRecordDrag as Zd } from "./ai/ask-context.js";
|
|
50
|
+
import { useAvailableBulkActions as ec, bulkActionEnabled as tc, mergeBulkActions as nc, guardMatches as ac, useBuiltinGate as rc, BulkActionButtons as lc } from "./bulk/BulkActionButtons.js";
|
|
51
|
+
import { BulkCompareButton as sc } from "./bulk/BulkCompareButton.js";
|
|
52
|
+
import { BulkFieldUpdate as oc } from "./bulk/BulkFieldUpdate.js";
|
|
53
|
+
import { BulkRowMark as ic } from "./bulk/BulkRowMark.js";
|
|
54
|
+
import { MessageStakeholdersForm as dc } from "./bulk/MessageStakeholders.js";
|
|
55
|
+
import { useRowPushActions as cc, runRowPush as uc } from "./bulk/RowPushActions.js";
|
|
56
|
+
import { CellCopyLayer as pc } from "./CellCopyLayer.js";
|
|
57
|
+
import { CopyAsButton as mc } from "./CopyAsButton.js";
|
|
58
|
+
import { useTreeConfig as fc, CollectionTree as bc } from "./cbv/CollectionTree.js";
|
|
59
|
+
import { readExportRows as hc, stableSort as gc, m2oLabelPaths as xc, resolveAllPaths as vc, userLabel as kc, m2oLabel as yc, localYmd as wc } from "./cbv/export-rows.js";
|
|
60
|
+
import { FormulaColumnAdder as _c } from "./cbv/FormulaColumnAdder.js";
|
|
61
|
+
import { useHierarchyScope as Nc, HierarchyScopePicker as Sc } from "./cbv/HierarchyScope.js";
|
|
62
|
+
import { tabStopRowKey as Cc, rowFocusTarget as $c } from "./cbv/row-focus.js";
|
|
63
|
+
import { splitRiskFilter as _s, riskFilterEntry as qc } from "./cbv/saved-view-risk.js";
|
|
64
|
+
import { isFilterRefusal as Tc, unknownFieldsOf as Ns, dropUnknownField as Lc } from "./cbv/unknown-fields.js";
|
|
65
|
+
import { ViewDefaultMenu as Fc } from "./cbv/ViewDefaultMenu.js";
|
|
66
|
+
import { useRecordRoomTypes as Rc, canOpenChatRoom as Ec, discussRecord as Dc } from "./chat/chat-core.js";
|
|
67
|
+
import { FilterControl as Pc } from "./DataTable.js";
|
|
68
|
+
import { FocusModeToggle as Mc } from "./FocusModeToggle.js";
|
|
69
|
+
import { FULFILMENT_FILTER_OPTIONS as Ss, FulfilmentPill as Oc, fulfilmentFigures as Ac } from "./FulfilmentPill.js";
|
|
70
|
+
import { HScrollProxy as Ic } from "./HScrollProxy.js";
|
|
71
|
+
import { useDocumentAutofillConfig as Kc, startDocumentExtraction as jc } from "./import/DocumentAutofillButton.js";
|
|
72
|
+
import { INTEGRATIONS_FILTER_OPTIONS as Cs, IntegrationDots as Bc } from "./integrations/IntegrationDots.js";
|
|
73
|
+
import { useQuickPickerSteps as zc, QuickPickerDialog as Qc } from "./item-edit/QuickPickerDialog.js";
|
|
74
|
+
import { usePickerExclusion as Uc } from "./item-edit/RecordGrantTools.js";
|
|
74
75
|
import { invalidateRecordQueries as $s } from "./item-edit/RecordLiveSync.js";
|
|
75
|
-
import { relatedMissing as
|
|
76
|
+
import { relatedMissing as Wc } from "./item-edit/related-missing.js";
|
|
76
77
|
import { UserRosterCluster as qs, UserChip as Ts } from "./item-edit/UserChip.js";
|
|
77
|
-
import { LiveRowMark as
|
|
78
|
-
import { CopyListLinkButton as
|
|
79
|
-
import { useInlineEdit as
|
|
80
|
-
import { MapView as
|
|
81
|
-
import { usePickerExcludedRows as
|
|
78
|
+
import { LiveRowMark as Vc } from "./LiveRowMark.js";
|
|
79
|
+
import { CopyListLinkButton as Hc } from "./list/CopyListLinkButton.js";
|
|
80
|
+
import { useInlineEdit as Yc, InlineEditCell as Jc } from "./list/InlineEdit.js";
|
|
81
|
+
import { MapView as Gc } from "./MapView.js";
|
|
82
|
+
import { usePickerExcludedRows as Xc, PICKER_EXCLUDED_ROW_CLASS as Zc, PICKER_EXCLUDED_TITLE as eu } from "./PickerExcludedRows.js";
|
|
82
83
|
import { ConfirmButton as Ks } from "./profile/primitives.js";
|
|
83
|
-
import { RealtimeStaleMark as
|
|
84
|
-
import { RecordDrilldownSheet as
|
|
85
|
-
import { RowHighlightLegend as
|
|
86
|
-
import { RowPresence as
|
|
87
|
-
import { TableSkeletonRows as
|
|
88
|
-
import { SlowNoticeView as
|
|
89
|
-
import { TipLayer as
|
|
84
|
+
import { RealtimeStaleMark as tu } from "./RealtimeStatusBanner.js";
|
|
85
|
+
import { RecordDrilldownSheet as nu } from "./RecordDrilldownSheet.js";
|
|
86
|
+
import { RowHighlightLegend as au } from "./RowHighlightLegend.js";
|
|
87
|
+
import { RowPresence as ru } from "./RowPresence.js";
|
|
88
|
+
import { TableSkeletonRows as lu } from "./Skeletons.js";
|
|
89
|
+
import { SlowNoticeView as su } from "./SlowNotice.js";
|
|
90
|
+
import { TipLayer as ou } from "./TipLayer.js";
|
|
90
91
|
import { UnseenDot as Ls } from "./UnseenDot.js";
|
|
91
|
-
import { SimpleSelectXs as _n, SimpleSelect as
|
|
92
|
-
import { RevisionsPanel as
|
|
93
|
-
import { itemActionChoiceStep as
|
|
94
|
-
function Hn(n,
|
|
95
|
-
const
|
|
96
|
-
if (
|
|
97
|
-
return { kind:
|
|
92
|
+
import { SimpleSelectXs as _n, SimpleSelect as iu } from "./ui/SimpleSelect.js";
|
|
93
|
+
import { RevisionsPanel as du } from "./panels/RevisionsPanel.js";
|
|
94
|
+
import { itemActionChoiceStep as cu, ItemActionChoiceList as uu } from "./panels/ItemActionChoices.js";
|
|
95
|
+
function Hn(n, i, h) {
|
|
96
|
+
const d = n.find((v) => v.one_collection === i && v.one_field === h);
|
|
97
|
+
if (d != null && d.many_collection)
|
|
98
|
+
return { kind: d.junction_field ? "m2m" : "o2m", relation: d };
|
|
98
99
|
}
|
|
99
100
|
function Wn(n) {
|
|
100
101
|
if (!n) return "id";
|
|
101
|
-
const
|
|
102
|
-
for (const
|
|
103
|
-
for (const
|
|
102
|
+
const i = new Set(n.fields.map((d) => d.field)), h = [...(n.display_template ?? "").matchAll(/\{\{(\w+)/g)].map((d) => d[1]);
|
|
103
|
+
for (const d of h) if (i.has(d)) return d;
|
|
104
|
+
for (const d of Lr) if (i.has(d)) return d;
|
|
104
105
|
return "id";
|
|
105
106
|
}
|
|
106
107
|
const Fs = (n) => typeof n == "string" ? n : n.key, Rs = {
|
|
@@ -109,17 +110,17 @@ const Fs = (n) => typeof n == "string" ? n : n.key, Rs = {
|
|
|
109
110
|
green: "text-emerald-600 dark:text-emerald-400 font-semibold",
|
|
110
111
|
blue: "text-sky-600 dark:text-sky-400 font-semibold"
|
|
111
112
|
};
|
|
112
|
-
function va(n,
|
|
113
|
-
if (!
|
|
114
|
-
const h = n == null ? "" : String(n),
|
|
115
|
-
for (const v of
|
|
116
|
-
const _ = Number(v.value), $ = Number.isFinite(
|
|
113
|
+
function va(n, i) {
|
|
114
|
+
if (!i || i.length === 0) return null;
|
|
115
|
+
const h = n == null ? "" : String(n), d = Number(h);
|
|
116
|
+
for (const v of i) {
|
|
117
|
+
const _ = Number(v.value), $ = Number.isFinite(d) && Number.isFinite(_);
|
|
117
118
|
switch (v.op) {
|
|
118
119
|
case "gt":
|
|
119
|
-
if ($ &&
|
|
120
|
+
if ($ && d > _) return v.color;
|
|
120
121
|
break;
|
|
121
122
|
case "lt":
|
|
122
|
-
if ($ &&
|
|
123
|
+
if ($ && d < _) return v.color;
|
|
123
124
|
break;
|
|
124
125
|
case "eq":
|
|
125
126
|
if (h.toLowerCase() === String(v.value ?? "").toLowerCase()) return v.color;
|
|
@@ -140,7 +141,7 @@ function va(n, d) {
|
|
|
140
141
|
}
|
|
141
142
|
return null;
|
|
142
143
|
}
|
|
143
|
-
const
|
|
144
|
+
const pu = [
|
|
144
145
|
{ label: "None", cfg: null },
|
|
145
146
|
{ label: "Currency", cfg: { type: "number", decimals: 2, thousands: !0, prefix: "$" } },
|
|
146
147
|
{ label: "Number", cfg: { type: "number", thousands: !0 } },
|
|
@@ -150,55 +151,57 @@ const cu = [
|
|
|
150
151
|
{ label: "Relative time", cfg: { type: "datetime", template: "relative" } },
|
|
151
152
|
{ label: "Yes / No", cfg: { type: "boolean", true_label: "Yes", false_label: "No" } },
|
|
152
153
|
{ label: "Count (related)", cfg: { type: "count" } }
|
|
153
|
-
], Ae = (n) => n.replace(/_/g, " ").replace(/\b\w/g, (
|
|
154
|
-
function Tr(n,
|
|
155
|
-
if (!n) return ["id",
|
|
156
|
-
const h = [...n.matchAll(/\{\{([\w.]+)\}\}/g)].map((
|
|
157
|
-
return h.some((
|
|
154
|
+
], Ae = (n) => n.replace(/_/g, " ").replace(/\b\w/g, (i) => i.toUpperCase()), Lr = ["name", "title", "label", "display_name", "subject", "email", "slug"];
|
|
155
|
+
function Tr(n, i) {
|
|
156
|
+
if (!n) return ["id", i, ...Lr].join(",");
|
|
157
|
+
const h = [...n.matchAll(/\{\{([\w.]+)\}\}/g)].map((d) => d[1]);
|
|
158
|
+
return h.some((d) => d.includes(".")) ? null : [.../* @__PURE__ */ new Set(["id", i, ...h])].join(",");
|
|
158
159
|
}
|
|
159
|
-
function Ca(n,
|
|
160
|
+
function Ca(n, i) {
|
|
160
161
|
if (!n) {
|
|
161
162
|
for (const h of Lr) {
|
|
162
|
-
const
|
|
163
|
-
if (
|
|
163
|
+
const d = i[h];
|
|
164
|
+
if (d != null && d !== "") return String(d);
|
|
164
165
|
}
|
|
165
|
-
return String(
|
|
166
|
+
return String(i.id ?? "");
|
|
166
167
|
}
|
|
167
|
-
return n.replace(/\{\{([\w.]+)\}\}/g, (h,
|
|
168
|
-
const v =
|
|
168
|
+
return n.replace(/\{\{([\w.]+)\}\}/g, (h, d) => {
|
|
169
|
+
const v = d.split(".").reduce((_, $) => _ == null ? void 0 : _[$], i);
|
|
169
170
|
return v == null ? "" : String(v);
|
|
170
171
|
});
|
|
171
172
|
}
|
|
172
|
-
function Fr(n,
|
|
173
|
+
function Fr(n, i, h) {
|
|
173
174
|
return n.find(
|
|
174
|
-
(
|
|
175
|
+
(d) => d.many_collection === i && d.many_field === h && // Loose: a relation list may omit junction_field rather than send null
|
|
176
|
+
// (record compare showed a raw "124133", army 11 staging check).
|
|
177
|
+
!d.junction_field && !!d.one_collection
|
|
175
178
|
);
|
|
176
179
|
}
|
|
177
|
-
function
|
|
178
|
-
const
|
|
179
|
-
if (Number.isNaN(
|
|
180
|
-
const h = Date.now() -
|
|
181
|
-
if (
|
|
182
|
-
if (
|
|
183
|
-
const v = Math.floor(
|
|
180
|
+
function mu(n) {
|
|
181
|
+
const i = new Date(String(n));
|
|
182
|
+
if (Number.isNaN(i.getTime())) return String(n);
|
|
183
|
+
const h = Date.now() - i.getTime(), d = Math.floor(h / 6e4);
|
|
184
|
+
if (d < 1) return "just now";
|
|
185
|
+
if (d < 60) return `${d}m ago`;
|
|
186
|
+
const v = Math.floor(d / 60);
|
|
184
187
|
if (v < 24) return `${v}h ago`;
|
|
185
188
|
const _ = Math.floor(v / 24);
|
|
186
|
-
return _ < 7 ? `${_}d ago` :
|
|
189
|
+
return _ < 7 ? `${_}d ago` : i.toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" });
|
|
187
190
|
}
|
|
188
191
|
const ct = (n) => n.toLocaleString("en-US"), js = /* @__PURE__ */ new Set(["nivaro_users", "directus_users"]), wt = (n) => n.startsWith("directus_") || n.startsWith("nivaro_"), Nr = /* @__PURE__ */ new Map();
|
|
189
|
-
function Bs(n,
|
|
190
|
-
let
|
|
191
|
-
|
|
192
|
-
const v =
|
|
192
|
+
function Bs(n, i, h) {
|
|
193
|
+
let d = Nr.get(i);
|
|
194
|
+
d || (d = { ids: /* @__PURE__ */ new Set(), waiters: [], promise: null }, Nr.set(i, d));
|
|
195
|
+
const v = d;
|
|
193
196
|
return v.ids.add(h), v.promise || (v.promise = new Promise((_) => {
|
|
194
197
|
setTimeout(() => {
|
|
195
|
-
Nr.delete(
|
|
198
|
+
Nr.delete(i);
|
|
196
199
|
const $ = [...v.ids], T = [];
|
|
197
200
|
for (let N = 0; N < $.length; N += 200) T.push($.slice(N, N + 200));
|
|
198
201
|
Promise.all(
|
|
199
202
|
T.map(
|
|
200
203
|
(N) => n.request(
|
|
201
|
-
G(`/items/${
|
|
204
|
+
G(`/items/${i}`, {
|
|
202
205
|
filter: JSON.stringify({ id: { _in: N } }),
|
|
203
206
|
limit: N.length,
|
|
204
207
|
fields: "*",
|
|
@@ -216,16 +219,16 @@ function Bs(n, d, h) {
|
|
|
216
219
|
}, 0);
|
|
217
220
|
})), v.promise.then((_) => _.get(h) ?? null);
|
|
218
221
|
}
|
|
219
|
-
const
|
|
222
|
+
const fu = {
|
|
220
223
|
draft: "draft",
|
|
221
224
|
submitted: "submitted",
|
|
222
225
|
review: "in review",
|
|
223
226
|
approved: "approved",
|
|
224
227
|
rejected: "rejected"
|
|
225
228
|
};
|
|
226
|
-
function
|
|
229
|
+
function bu({ summary: n }) {
|
|
227
230
|
if (!n || n.total === 0) return /* @__PURE__ */ a("span", { className: "text-[12px] text-slate-300", children: "—" });
|
|
228
|
-
const
|
|
231
|
+
const i = n.latest, h = n.active > 0, d = i ? fu[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, $ = i ? `${i.title ?? "Addendum"} — ${d}${n.total > 1 ? ` (${n.total} total)` : ""}` : void 0;
|
|
229
232
|
return /* @__PURE__ */ c(
|
|
230
233
|
"span",
|
|
231
234
|
{
|
|
@@ -239,7 +242,7 @@ function mu({ summary: n }) {
|
|
|
239
242
|
className: `h-1.5 w-1.5 shrink-0 rounded-full ${h ? "bg-amber-500" : "bg-slate-400"}`
|
|
240
243
|
}
|
|
241
244
|
),
|
|
242
|
-
h ? `${n.active} ${n.active === 1 ? "addendum" : "addendums"} ${
|
|
245
|
+
h ? `${n.active} ${n.active === 1 ? "addendum" : "addendums"} ${d || "active"}` : `${n.total} ${d}`,
|
|
243
246
|
_ && /* @__PURE__ */ c("span", { className: "tabular-nums opacity-80", children: [
|
|
244
247
|
"· ",
|
|
245
248
|
_
|
|
@@ -248,17 +251,17 @@ function mu({ summary: n }) {
|
|
|
248
251
|
}
|
|
249
252
|
);
|
|
250
253
|
}
|
|
251
|
-
function Rr({ relatedCollection: n, id:
|
|
252
|
-
const h = vt(),
|
|
254
|
+
function Rr({ relatedCollection: n, id: i }) {
|
|
255
|
+
const h = vt(), d = js.has(n), v = i != null && i !== "", { data: _ } = te({
|
|
253
256
|
queryKey: ["cbv-collection-meta", n],
|
|
254
257
|
queryFn: () => h.request(G(`/collections/${n}`)).then((C) => C.data),
|
|
255
258
|
staleTime: 10 * 6e4,
|
|
256
259
|
enabled: !wt(n),
|
|
257
260
|
retry: !1
|
|
258
261
|
}), { data: $, isLoading: T } = te({
|
|
259
|
-
queryKey: ["cbv-relation-item", n, String(
|
|
260
|
-
queryFn: () =>
|
|
261
|
-
enabled: v && (
|
|
262
|
+
queryKey: ["cbv-relation-item", n, String(i)],
|
|
263
|
+
queryFn: () => d ? h.request(G(`/users/${i}`)).then((C) => C.data) : Bs(h, n, String(i)),
|
|
264
|
+
enabled: v && (d || !wt(n)),
|
|
262
265
|
staleTime: 30 * 6e4,
|
|
263
266
|
retry: !1
|
|
264
267
|
});
|
|
@@ -266,7 +269,7 @@ function Rr({ relatedCollection: n, id: d }) {
|
|
|
266
269
|
if (T)
|
|
267
270
|
return /* @__PURE__ */ a("span", { className: "inline-block h-3.5 w-24 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" });
|
|
268
271
|
if (!$) {
|
|
269
|
-
const C =
|
|
272
|
+
const C = Wc(null);
|
|
270
273
|
return /* @__PURE__ */ a(
|
|
271
274
|
"span",
|
|
272
275
|
{
|
|
@@ -277,21 +280,21 @@ function Rr({ relatedCollection: n, id: d }) {
|
|
|
277
280
|
}
|
|
278
281
|
);
|
|
279
282
|
}
|
|
280
|
-
const N =
|
|
283
|
+
const N = d ? String(
|
|
281
284
|
[$.first_name, $.last_name].filter(Boolean).join(" ") || $.email || $.id || ""
|
|
282
285
|
) : Ca((_ == null ? void 0 : _.display_template) ?? null, $);
|
|
283
286
|
return /* @__PURE__ */ a("span", { className: "text-[12px] text-slate-700 dark:text-slate-200", children: N });
|
|
284
287
|
}
|
|
285
|
-
function zs(n,
|
|
286
|
-
const $ =
|
|
287
|
-
return
|
|
288
|
-
|
|
288
|
+
function zs(n, i, h, d, v, _) {
|
|
289
|
+
const $ = i.getQueryData(["cbv-collection-meta", h]);
|
|
290
|
+
return Dd(
|
|
291
|
+
Pd(n, h, $, d, v).then(
|
|
289
292
|
(T) => window.location.origin + _({ collection: h, itemId: T })
|
|
290
293
|
)
|
|
291
294
|
).catch(() => {
|
|
292
295
|
});
|
|
293
296
|
}
|
|
294
|
-
function _a(n,
|
|
297
|
+
function _a(n, i) {
|
|
295
298
|
for (const h of [
|
|
296
299
|
"cbv-items",
|
|
297
300
|
"cbv-pipeline-instances",
|
|
@@ -301,23 +304,23 @@ function _a(n, d) {
|
|
|
301
304
|
"cbv-resolved",
|
|
302
305
|
"cbv-row-instance"
|
|
303
306
|
])
|
|
304
|
-
n.invalidateQueries({ queryKey: [h,
|
|
307
|
+
n.invalidateQueries({ queryKey: [h, i] });
|
|
305
308
|
}
|
|
306
|
-
function
|
|
309
|
+
function hu(n, i) {
|
|
307
310
|
return n ? n.is_admin ? !0 : (n.collections ?? []).some(
|
|
308
|
-
(h) => (h.collection ===
|
|
311
|
+
(h) => (h.collection === i || h.collection === "*") && (h.actions.includes("update") || h.actions.includes("*"))
|
|
309
312
|
) : !1;
|
|
310
313
|
}
|
|
311
|
-
function
|
|
314
|
+
function gu(n, i) {
|
|
312
315
|
return n ? n.is_admin ? !0 : (n.collections ?? []).some(
|
|
313
|
-
(h) => (h.collection ===
|
|
316
|
+
(h) => (h.collection === i || h.collection === "*") && (h.actions.includes("delete") || h.actions.includes("*"))
|
|
314
317
|
) : !1;
|
|
315
318
|
}
|
|
316
|
-
function
|
|
319
|
+
function xu({
|
|
317
320
|
collection: n,
|
|
318
|
-
id:
|
|
321
|
+
id: i,
|
|
319
322
|
hasPipeline: h,
|
|
320
|
-
onOpen:
|
|
323
|
+
onOpen: d,
|
|
321
324
|
onPeek: v,
|
|
322
325
|
onAudit: _,
|
|
323
326
|
urlFor: $,
|
|
@@ -333,7 +336,7 @@ function hu({
|
|
|
333
336
|
label: M,
|
|
334
337
|
meta: k.getQueryData(["cbv-collection-meta", n]),
|
|
335
338
|
row: C,
|
|
336
|
-
id:
|
|
339
|
+
id: i,
|
|
337
340
|
collection: n
|
|
338
341
|
}), [m, E] = y(!1), [A, I] = y({ x: 0, y: 0 }), F = he(null), ee = he(null);
|
|
339
342
|
me(() => {
|
|
@@ -344,10 +347,10 @@ function hu({
|
|
|
344
347
|
queryFn: () => u.request(G("/security/my/permissions")).then((b) => b.data),
|
|
345
348
|
enabled: m && !Y,
|
|
346
349
|
staleTime: 5 * 6e4
|
|
347
|
-
}), ce =
|
|
350
|
+
}), ce = Uc(n, String(i), {
|
|
348
351
|
enabled: m && Y,
|
|
349
352
|
onDone: () => E(!1)
|
|
350
|
-
}), [Ie, X] = y(!1), qe =
|
|
353
|
+
}), [Ie, X] = y(!1), qe = Rc(m), Ye = Ec() && !!(qe != null && qe.some((b) => b.collection === n));
|
|
351
354
|
me(() => {
|
|
352
355
|
if (!m) return;
|
|
353
356
|
const b = (J) => {
|
|
@@ -362,53 +365,53 @@ function hu({
|
|
|
362
365
|
};
|
|
363
366
|
}, [m]);
|
|
364
367
|
const { data: Z } = te({
|
|
365
|
-
queryKey: ["cbv-row-instance", n, String(
|
|
366
|
-
queryFn: () => u.request(G(`/pipelines/instance/${n}/${
|
|
368
|
+
queryKey: ["cbv-row-instance", n, String(i)],
|
|
369
|
+
queryFn: () => u.request(G(`/pipelines/instance/${n}/${i}`)).then((b) => b.data).catch(() => null),
|
|
367
370
|
enabled: m && h,
|
|
368
371
|
staleTime: 15e3
|
|
369
372
|
}), q = ke(
|
|
370
373
|
() => ((Z == null ? void 0 : Z.available_transitions) ?? []).filter((b) => b.in_row_menu !== !1),
|
|
371
374
|
[Z]
|
|
372
|
-
), { data:
|
|
375
|
+
), { data: oe } = ec(m ? [n] : []), fe = Bi({
|
|
373
376
|
isAdmin: Y,
|
|
374
|
-
roleMayDelete:
|
|
375
|
-
builtinOpen:
|
|
377
|
+
roleMayDelete: gu(de, n),
|
|
378
|
+
builtinOpen: oe ? (oe[n] ?? []).some((b) => b.source === "builtin" && b.key === "delete") && tc(B, n, "delete") : void 0,
|
|
376
379
|
hasPipeline: h,
|
|
377
380
|
run: h ? Z === void 0 ? void 0 : Z : null
|
|
378
|
-
}),
|
|
379
|
-
() => m ?
|
|
381
|
+
}), ae = ke(
|
|
382
|
+
() => m ? nc(oe, [n], B).filter(
|
|
380
383
|
// Transition-kind registry actions (Cancel / Uncancel) are the pipeline
|
|
381
384
|
// transitions already listed above — never the same move twice.
|
|
382
385
|
(b) => b.kind !== "builtin" && b.kind !== "transition"
|
|
383
386
|
) : [],
|
|
384
|
-
[m,
|
|
387
|
+
[m, oe, n, B]
|
|
385
388
|
), Me = ke(() => {
|
|
386
389
|
const b = /* @__PURE__ */ new Set();
|
|
387
|
-
for (const R of
|
|
390
|
+
for (const R of ae)
|
|
388
391
|
for (const J of R.guard ?? [])
|
|
389
392
|
J && typeof J.field == "string" && !(C && J.field in C) && b.add(J.field);
|
|
390
393
|
return [...b].sort();
|
|
391
|
-
}, [
|
|
392
|
-
queryKey: ["row-action-guard", n, String(
|
|
394
|
+
}, [ae, C]), { data: ie } = te({
|
|
395
|
+
queryKey: ["row-action-guard", n, String(i), Me.join(",")],
|
|
393
396
|
queryFn: () => u.request(
|
|
394
|
-
G(`/items/${encodeURIComponent(n)}/${encodeURIComponent(String(
|
|
397
|
+
G(`/items/${encodeURIComponent(n)}/${encodeURIComponent(String(i))}`, {
|
|
395
398
|
fields: Me.join(",")
|
|
396
399
|
})
|
|
397
400
|
).then((b) => b.data ?? {}).catch(() => ({})),
|
|
398
401
|
enabled: m && Me.length > 0,
|
|
399
402
|
staleTime: 0
|
|
400
403
|
}), w = ke(() => {
|
|
401
|
-
if (Me.length > 0 && !ie) return
|
|
404
|
+
if (Me.length > 0 && !ie) return ae.filter((R) => {
|
|
402
405
|
var J;
|
|
403
406
|
return !((J = R.guard) != null && J.length);
|
|
404
407
|
});
|
|
405
408
|
const b = { ...ie ?? {}, ...C ?? {} };
|
|
406
|
-
return
|
|
407
|
-
}, [
|
|
409
|
+
return ae.filter((R) => ac(R.guard, b) !== !1);
|
|
410
|
+
}, [ae, Me, ie, C]), { pushActions: be, failedPartners: re } = cc({
|
|
408
411
|
collection: n,
|
|
409
|
-
id:
|
|
412
|
+
id: i,
|
|
410
413
|
open: m,
|
|
411
|
-
bulkData:
|
|
414
|
+
bulkData: oe,
|
|
412
415
|
bulkEnabledKeys: B
|
|
413
416
|
}), Ce = ke(
|
|
414
417
|
() => new Map(((Z == null ? void 0 : Z.states) ?? []).map((b) => [b.id, b])),
|
|
@@ -444,15 +447,15 @@ function hu({
|
|
|
444
447
|
m || (et(null), Nn(""), X(!1));
|
|
445
448
|
}, [m]);
|
|
446
449
|
const Be = (($n = Q == null ? void 0 : Q.push) == null ? void 0 : $n.kind) === "push" && Q.push.action.choose ? Q.push.action : null, Yt = te({
|
|
447
|
-
queryKey: ["item-action-choices", (Be == null ? void 0 : Be.id) ?? null, n, String(
|
|
450
|
+
queryKey: ["item-action-choices", (Be == null ? void 0 : Be.id) ?? null, n, String(i)],
|
|
448
451
|
queryFn: () => u.request(
|
|
449
|
-
G(`/item-actions/${Be.id}/choices`, { collection: n, item: String(
|
|
452
|
+
G(`/item-actions/${Be.id}/choices`, { collection: n, item: String(i) })
|
|
450
453
|
).then((b) => b.data ?? []),
|
|
451
454
|
enabled: !!Be,
|
|
452
455
|
staleTime: 0
|
|
453
456
|
}), [At, sn] = y(null), Sn = (Be == null ? void 0 : Be.id) ?? null;
|
|
454
457
|
me(() => sn(null), [Sn]);
|
|
455
|
-
const nt = Yt.data ?
|
|
458
|
+
const nt = Yt.data ? cu(Yt.data) : null, pt = nt && !nt.ask ? nt.value : At, Ft = !!Be && (!nt || nt.ask && At == null);
|
|
456
459
|
ki.useLayoutEffect(() => {
|
|
457
460
|
var Oe;
|
|
458
461
|
if (!m) return;
|
|
@@ -468,7 +471,7 @@ function hu({
|
|
|
468
471
|
}, [m, A, Q, q.length]);
|
|
469
472
|
const _t = xt({
|
|
470
473
|
mutationFn: ({ transitionId: b, comment: R }) => u.request(
|
|
471
|
-
ye(`/pipelines/instance/${n}/${
|
|
474
|
+
ye(`/pipelines/instance/${n}/${i}/transition`, {
|
|
472
475
|
transition_id: b,
|
|
473
476
|
...R != null && R.trim() ? { comment: R.trim() } : {}
|
|
474
477
|
})
|
|
@@ -476,7 +479,7 @@ function hu({
|
|
|
476
479
|
onSuccess: (b, R) => {
|
|
477
480
|
E(!1);
|
|
478
481
|
const J = q.find((pe) => pe.id === R.transitionId);
|
|
479
|
-
we.success(J ? `${L.name} moved to ${Ht(J)}` : `${L.name} moved`), _a(k, n), $s(k, n, [
|
|
482
|
+
we.success(J ? `${L.name} moved to ${Ht(J)}` : `${L.name} moved`), _a(k, n), $s(k, n, [i]), N == null || N();
|
|
480
483
|
},
|
|
481
484
|
onError: (b) => we.error(
|
|
482
485
|
Vt(b, "Transition failed"),
|
|
@@ -484,7 +487,7 @@ function hu({
|
|
|
484
487
|
)
|
|
485
488
|
}), on = xt({
|
|
486
489
|
mutationFn: async ({ action: b, comment: R }) => {
|
|
487
|
-
const J = { collection: n, ids: [
|
|
490
|
+
const J = { collection: n, ids: [i], reason: (R == null ? void 0 : R.trim()) || null }, pe = b.source === "db" ? await u.request(ye("/bulk-actions/run", { ...J, key: b.key })) : await u.request(ye(`/bulk-actions/${b.key}/execute`, J));
|
|
488
491
|
return { action: b, result: pe.data ?? {} };
|
|
489
492
|
},
|
|
490
493
|
onSuccess: ({ action: b, result: R }) => {
|
|
@@ -500,14 +503,14 @@ function hu({
|
|
|
500
503
|
we.info(`${L.name}: ${Xt ?? "nothing to change"}`);
|
|
501
504
|
return;
|
|
502
505
|
}
|
|
503
|
-
we.success(`${b.label} — done on ${L.name}`), _a(k, n), $s(k, n, [
|
|
506
|
+
we.success(`${b.label} — done on ${L.name}`), _a(k, n), $s(k, n, [i]), N == null || N();
|
|
504
507
|
},
|
|
505
508
|
onError: (b) => {
|
|
506
509
|
const R = b.response;
|
|
507
510
|
we.error((R == null ? void 0 : R.error) ?? Vt(b, "Action failed"), wa(b));
|
|
508
511
|
}
|
|
509
512
|
}), Nt = xt({
|
|
510
|
-
mutationFn: ({ op: b, note: R, pick: J }) =>
|
|
513
|
+
mutationFn: ({ op: b, note: R, pick: J }) => uc(u, n, i, b, R, J).then((pe) => ({ op: b, outcome: pe })),
|
|
511
514
|
onSuccess: ({ op: b, outcome: R }) => {
|
|
512
515
|
E(!1);
|
|
513
516
|
const J = b.kind === "push" ? b.action.label : "Retry";
|
|
@@ -594,7 +597,7 @@ function hu({
|
|
|
594
597
|
}
|
|
595
598
|
),
|
|
596
599
|
(Be == null ? void 0 : Be.choose) && (Yt.isError ? /* @__PURE__ */ a("p", { className: "mb-1.5 px-1 text-[11.5px] text-red-600 dark:text-red-400", children: "Could not load the options." }) : Yt.isLoading ? /* @__PURE__ */ a("p", { className: "mb-1.5 px-1 text-[11.5px] text-slate-500 dark:text-slate-400", children: "Loading…" }) : nt != null && nt.ask ? /* @__PURE__ */ a("div", { className: "mb-1.5 -mt-3 px-1", children: /* @__PURE__ */ a(
|
|
597
|
-
|
|
600
|
+
uu,
|
|
598
601
|
{
|
|
599
602
|
choose: Be.choose,
|
|
600
603
|
options: Yt.data ?? [],
|
|
@@ -630,14 +633,14 @@ function hu({
|
|
|
630
633
|
placeholder: ((mt = Q.push) == null ? void 0 : mt.kind) === "push" ? ((qn = (at = Q.push.action.confirm) == null ? void 0 : at.input) == null ? void 0 : qn.placeholder) ?? ((cn = (dn = Q.push.action.confirm) == null ? void 0 : dn.input) == null ? void 0 : cn.label) ?? "" : (Jt = Q.action) != null && Jt.require_reason || ((Gt = q.find((b) => b.id === Q.picked)) == null ? void 0 : Gt.comment_mode) === "required" ? "Reason (required — recorded on the record’s history)…" : "Reason (optional)…",
|
|
631
634
|
rows: 2,
|
|
632
635
|
"aria-label": ((Jn = Q.push) == null ? void 0 : Jn.kind) === "push" ? ((ue = (Gn = Q.push.action.confirm) == null ? void 0 : Gn.input) == null ? void 0 : ue.label) ?? "Note" : "Reason",
|
|
633
|
-
"aria-describedby": Cn ? `row-reason-hint-${String(
|
|
636
|
+
"aria-describedby": Cn ? `row-reason-hint-${String(i)}` : void 0,
|
|
634
637
|
className: "w-full resize-none rounded-md border border-slate-200 bg-white px-2 py-1.5 text-[12px] outline-none focus:border-nvr-cyan/50 dark:border-slate-700 dark:bg-slate-800 dark:text-slate-100"
|
|
635
638
|
}
|
|
636
639
|
),
|
|
637
640
|
Cn && /* @__PURE__ */ a(
|
|
638
641
|
"p",
|
|
639
642
|
{
|
|
640
|
-
id: `row-reason-hint-${String(
|
|
643
|
+
id: `row-reason-hint-${String(i)}`,
|
|
641
644
|
className: "mt-1 px-1 text-[11px] text-slate-500 dark:text-slate-400",
|
|
642
645
|
"data-row-reason-hint": !0,
|
|
643
646
|
children: "Add a reason to continue."
|
|
@@ -669,16 +672,16 @@ function hu({
|
|
|
669
672
|
] })
|
|
670
673
|
] }) : /* @__PURE__ */ c(Ue, { children: [
|
|
671
674
|
We("Open", () => {
|
|
672
|
-
E(!1),
|
|
675
|
+
E(!1), d();
|
|
673
676
|
}),
|
|
674
677
|
We("Open in new tab", () => {
|
|
675
|
-
E(!1), window.open($({ collection: n, itemId: String(
|
|
678
|
+
E(!1), window.open($({ collection: n, itemId: String(i) }), "_blank");
|
|
676
679
|
}),
|
|
677
680
|
v && We("Peek details", () => {
|
|
678
681
|
E(!1), v();
|
|
679
682
|
}),
|
|
680
683
|
Ye && We("Discuss in chat", () => {
|
|
681
|
-
E(!1),
|
|
684
|
+
E(!1), Dc(u, n, String(i)).then((b) => {
|
|
682
685
|
b || we.error("This record has no chat room you can open");
|
|
683
686
|
}).catch(() => we.error("Could not open the chat room"));
|
|
684
687
|
}),
|
|
@@ -736,7 +739,7 @@ function hu({
|
|
|
736
739
|
`${b.source}:${b.key}`
|
|
737
740
|
))
|
|
738
741
|
] }),
|
|
739
|
-
(be.length > 0 ||
|
|
742
|
+
(be.length > 0 || re.length > 0) && /* @__PURE__ */ c(Ue, { children: [
|
|
740
743
|
Rt,
|
|
741
744
|
/* @__PURE__ */ a("p", { className: "px-3 pb-0.5 pt-1 text-[9.5px] font-bold uppercase tracking-wider text-slate-400", children: "Integrations" }),
|
|
742
745
|
be.map((b) => /* @__PURE__ */ a(
|
|
@@ -757,17 +760,17 @@ function hu({
|
|
|
757
760
|
},
|
|
758
761
|
b.id
|
|
759
762
|
)),
|
|
760
|
-
|
|
763
|
+
re.length > 0 && /* @__PURE__ */ c(
|
|
761
764
|
"button",
|
|
762
765
|
{
|
|
763
766
|
type: "button",
|
|
764
|
-
"data-row-retry-push":
|
|
765
|
-
title: `Latest push failed: ${
|
|
767
|
+
"data-row-retry-push": re.join(","),
|
|
768
|
+
title: `Latest push failed: ${re.join(", ")}`,
|
|
766
769
|
onClick: () => et({
|
|
767
770
|
label: "Retry last failed push",
|
|
768
771
|
options: [],
|
|
769
772
|
picked: null,
|
|
770
|
-
push: { kind: "retry", partners:
|
|
773
|
+
push: { kind: "retry", partners: re }
|
|
771
774
|
}),
|
|
772
775
|
className: "flex w-full items-center gap-2 px-3 py-1.5 text-left text-[12px] text-red-700 hover:bg-red-50 dark:text-red-300 dark:hover:bg-red-950",
|
|
773
776
|
children: [
|
|
@@ -789,7 +792,7 @@ function hu({
|
|
|
789
792
|
E(!1), (b = navigator.clipboard) == null || b.writeText(L.copy ?? ""), we.success("ID copied");
|
|
790
793
|
}),
|
|
791
794
|
We("Copy link", () => {
|
|
792
|
-
E(!1), zs(u, k, n, C,
|
|
795
|
+
E(!1), zs(u, k, n, C, i, $), we.success("Link copied");
|
|
793
796
|
}),
|
|
794
797
|
Y && /* @__PURE__ */ c(Ue, { children: [
|
|
795
798
|
Rt,
|
|
@@ -859,25 +862,25 @@ function Sr(n) {
|
|
|
859
862
|
}
|
|
860
863
|
function Es({
|
|
861
864
|
collection: n,
|
|
862
|
-
field:
|
|
865
|
+
field: i,
|
|
863
866
|
fieldType: h,
|
|
864
|
-
value:
|
|
867
|
+
value: d,
|
|
865
868
|
relations: v
|
|
866
869
|
}) {
|
|
867
|
-
const _ = Fr(v, n,
|
|
870
|
+
const _ = Fr(v, n, i);
|
|
868
871
|
if (_ != null && _.one_collection)
|
|
869
|
-
return /* @__PURE__ */ a(Rr, { relatedCollection: _.one_collection, id:
|
|
870
|
-
if (
|
|
872
|
+
return /* @__PURE__ */ a(Rr, { relatedCollection: _.one_collection, id: d });
|
|
873
|
+
if (d == null) return /* @__PURE__ */ a("span", { className: "text-[12px] text-slate-300", children: "—" });
|
|
871
874
|
if (h === "boolean")
|
|
872
875
|
return /* @__PURE__ */ a(
|
|
873
876
|
"span",
|
|
874
877
|
{
|
|
875
|
-
className: `inline-flex h-4 items-center rounded-full px-1.5 text-[10px] font-medium ${
|
|
876
|
-
children:
|
|
878
|
+
className: `inline-flex h-4 items-center rounded-full px-1.5 text-[10px] font-medium ${d ? "bg-emerald-100 text-emerald-700" : "bg-slate-100 text-slate-500 dark:bg-slate-800 dark:text-slate-400"}`,
|
|
879
|
+
children: d ? "Yes" : "No"
|
|
877
880
|
}
|
|
878
881
|
);
|
|
879
882
|
if (h === "timestamp" || h === "datetime" || h === "date") {
|
|
880
|
-
const $ = String(
|
|
883
|
+
const $ = String(d).match(/^(\d{4})-(\d{2})-(\d{2})(?:T00:00:00(?:\.000)?Z)?$/);
|
|
881
884
|
if ($) {
|
|
882
885
|
const T = new Date(Number($[1]), Number($[2]) - 1, Number($[3])).toLocaleDateString(
|
|
883
886
|
"en-US",
|
|
@@ -885,37 +888,37 @@ function Es({
|
|
|
885
888
|
);
|
|
886
889
|
return /* @__PURE__ */ a("span", { className: "text-[12px] tabular-nums text-slate-400", children: T });
|
|
887
890
|
}
|
|
888
|
-
return /* @__PURE__ */ a("span", { className: "text-[12px] tabular-nums text-slate-400", children:
|
|
891
|
+
return /* @__PURE__ */ a("span", { className: "text-[12px] tabular-nums text-slate-400", children: mu(d) });
|
|
889
892
|
}
|
|
890
|
-
return typeof
|
|
893
|
+
return typeof d == "string" ? /* @__PURE__ */ a(
|
|
891
894
|
"span",
|
|
892
895
|
{
|
|
893
896
|
className: Wt(
|
|
894
897
|
"block max-w-[240px] truncate text-[12px] text-slate-700 dark:text-slate-200",
|
|
895
|
-
Sr(
|
|
898
|
+
Sr(i) && "font-mono",
|
|
896
899
|
// An id cell opens the record. Underline it so that is legible
|
|
897
900
|
// before you click rather than after.
|
|
898
|
-
Sr(
|
|
901
|
+
Sr(i) && "underline decoration-slate-300 decoration-dotted underline-offset-2 group-hover:decoration-nvr-cyan dark:decoration-slate-600"
|
|
899
902
|
),
|
|
900
|
-
"data-tip":
|
|
901
|
-
children:
|
|
903
|
+
"data-tip": d.length > 28 ? d : void 0,
|
|
904
|
+
children: d
|
|
902
905
|
}
|
|
903
|
-
) : typeof
|
|
906
|
+
) : typeof d == "object" ? /* @__PURE__ */ a("span", { className: "font-mono text-[12px] text-slate-400", children: JSON.stringify(d).slice(0, 40) }) : /* @__PURE__ */ a(
|
|
904
907
|
"span",
|
|
905
908
|
{
|
|
906
909
|
className: Wt(
|
|
907
910
|
"text-[12px] tabular-nums text-slate-700 dark:text-slate-200",
|
|
908
|
-
Sr(
|
|
911
|
+
Sr(i) && "font-mono"
|
|
909
912
|
),
|
|
910
|
-
children: String(
|
|
913
|
+
children: String(d)
|
|
911
914
|
}
|
|
912
915
|
);
|
|
913
916
|
}
|
|
914
917
|
function Ta({
|
|
915
918
|
label: n,
|
|
916
|
-
options:
|
|
919
|
+
options: i,
|
|
917
920
|
selected: h,
|
|
918
|
-
onChange:
|
|
921
|
+
onChange: d,
|
|
919
922
|
loading: v,
|
|
920
923
|
block: _,
|
|
921
924
|
onOpenChange: $,
|
|
@@ -942,7 +945,7 @@ function Ta({
|
|
|
942
945
|
};
|
|
943
946
|
return window.addEventListener("mousedown", A), () => window.removeEventListener("mousedown", A);
|
|
944
947
|
}, [C]);
|
|
945
|
-
const k = V && !N ?
|
|
948
|
+
const k = V && !N ? i.filter((A) => A.label.toLowerCase().includes(V.toLowerCase())) : i, Y = new Set(h.map(String)), L = ((E = i.find((A) => String(A.value) === String(h[0]))) == null ? void 0 : E.label) ?? String(h[0] ?? ""), m = h.length === 0 ? n : h.length === 1 ? L : `${L} +${h.length - 1}`;
|
|
946
949
|
return /* @__PURE__ */ c("div", { ref: u, className: _ ? "relative w-full" : "relative", children: [
|
|
947
950
|
/* @__PURE__ */ c(
|
|
948
951
|
"button",
|
|
@@ -969,7 +972,7 @@ function Ta({
|
|
|
969
972
|
role: "button",
|
|
970
973
|
tabIndex: -1,
|
|
971
974
|
onClick: (A) => {
|
|
972
|
-
A.stopPropagation(),
|
|
975
|
+
A.stopPropagation(), d([]);
|
|
973
976
|
},
|
|
974
977
|
"aria-label": `Clear ${n}`,
|
|
975
978
|
className: "text-slate-400 hover:text-slate-600",
|
|
@@ -1001,7 +1004,7 @@ function Ta({
|
|
|
1001
1004
|
{
|
|
1002
1005
|
type: "checkbox",
|
|
1003
1006
|
checked: Y.has(String(A.value)),
|
|
1004
|
-
onChange: () =>
|
|
1007
|
+
onChange: () => d(
|
|
1005
1008
|
Y.has(String(A.value)) ? h.filter((I) => String(I) !== String(A.value)) : [...h, A.value]
|
|
1006
1009
|
)
|
|
1007
1010
|
}
|
|
@@ -1015,11 +1018,11 @@ function Ta({
|
|
|
1015
1018
|
] })
|
|
1016
1019
|
] });
|
|
1017
1020
|
}
|
|
1018
|
-
function
|
|
1021
|
+
function vu({
|
|
1019
1022
|
target: n,
|
|
1020
|
-
label:
|
|
1023
|
+
label: i,
|
|
1021
1024
|
selected: h,
|
|
1022
|
-
onChange:
|
|
1025
|
+
onChange: d,
|
|
1023
1026
|
preferIds: v
|
|
1024
1027
|
}) {
|
|
1025
1028
|
const _ = vt(), [$, T] = y(!1), N = $ || h.length > 0, [C, B] = y(""), V = (v ?? []).map(String).sort().join(","), { data: M } = te({
|
|
@@ -1074,10 +1077,10 @@ function gu({
|
|
|
1074
1077
|
Ta,
|
|
1075
1078
|
{
|
|
1076
1079
|
block: !0,
|
|
1077
|
-
label:
|
|
1080
|
+
label: i ?? "All",
|
|
1078
1081
|
options: I,
|
|
1079
1082
|
selected: h,
|
|
1080
|
-
onChange:
|
|
1083
|
+
onChange: d,
|
|
1081
1084
|
loading: L,
|
|
1082
1085
|
onSearch: B,
|
|
1083
1086
|
onOpenChange: (F) => {
|
|
@@ -1086,15 +1089,15 @@ function gu({
|
|
|
1086
1089
|
}
|
|
1087
1090
|
);
|
|
1088
1091
|
}
|
|
1089
|
-
function
|
|
1092
|
+
function ku({
|
|
1090
1093
|
collection: n,
|
|
1091
|
-
field:
|
|
1094
|
+
field: i,
|
|
1092
1095
|
selected: h,
|
|
1093
|
-
onChange:
|
|
1096
|
+
onChange: d
|
|
1094
1097
|
}) {
|
|
1095
1098
|
const v = vt(), [_, $] = y(!1), { data: T = [], isLoading: N } = te({
|
|
1096
|
-
queryKey: ["cbv-distinct", n,
|
|
1097
|
-
queryFn: () => v.request(G(`/items/${n}/distinct`, { field:
|
|
1099
|
+
queryKey: ["cbv-distinct", n, i],
|
|
1100
|
+
queryFn: () => v.request(G(`/items/${n}/distinct`, { field: i })).then((C) => C.data ?? []),
|
|
1098
1101
|
staleTime: 5 * 6e4,
|
|
1099
1102
|
enabled: _,
|
|
1100
1103
|
retry: !1
|
|
@@ -1106,7 +1109,7 @@ function xu({
|
|
|
1106
1109
|
label: "All",
|
|
1107
1110
|
options: T.map((C) => ({ value: String(C), label: Ae(String(C)) })),
|
|
1108
1111
|
selected: h,
|
|
1109
|
-
onChange:
|
|
1112
|
+
onChange: d,
|
|
1110
1113
|
loading: N,
|
|
1111
1114
|
onOpenChange: (C) => {
|
|
1112
1115
|
C && $(!0);
|
|
@@ -1114,16 +1117,16 @@ function xu({
|
|
|
1114
1117
|
}
|
|
1115
1118
|
);
|
|
1116
1119
|
}
|
|
1117
|
-
function
|
|
1120
|
+
function yu({
|
|
1118
1121
|
value: n,
|
|
1119
|
-
onChange:
|
|
1122
|
+
onChange: i
|
|
1120
1123
|
}) {
|
|
1121
|
-
const [h,
|
|
1124
|
+
const [h, d] = y(!1), [v, _] = y(""), [$, T] = y(""), N = he(null);
|
|
1122
1125
|
me(() => {
|
|
1123
1126
|
if (!h) return;
|
|
1124
1127
|
const u = (k) => {
|
|
1125
1128
|
var Y;
|
|
1126
|
-
(Y = N.current) != null && Y.contains(k.target) ||
|
|
1129
|
+
(Y = N.current) != null && Y.contains(k.target) || d(!1);
|
|
1127
1130
|
};
|
|
1128
1131
|
return window.addEventListener("mousedown", u), () => window.removeEventListener("mousedown", u);
|
|
1129
1132
|
}, [h]), me(() => {
|
|
@@ -1136,7 +1139,7 @@ function vu({
|
|
|
1136
1139
|
var k;
|
|
1137
1140
|
if (!n) return "All";
|
|
1138
1141
|
const u = Sa(n);
|
|
1139
|
-
return u ?
|
|
1142
|
+
return u ? Ii(u) : ((k = $a.find((Y) => Y.value === n)) == null ? void 0 : k.label) ?? n;
|
|
1140
1143
|
})(), [B, V] = y("between");
|
|
1141
1144
|
me(() => {
|
|
1142
1145
|
var u;
|
|
@@ -1144,7 +1147,7 @@ function vu({
|
|
|
1144
1147
|
}, [h, n]);
|
|
1145
1148
|
const M = () => {
|
|
1146
1149
|
const u = v || $;
|
|
1147
|
-
u && (
|
|
1150
|
+
u && (i(ji({ op: B, from: u, to: $ || v || u })), d(!1));
|
|
1148
1151
|
};
|
|
1149
1152
|
return /* @__PURE__ */ c("div", { ref: N, className: "relative w-full", children: [
|
|
1150
1153
|
/* @__PURE__ */ c(
|
|
@@ -1152,7 +1155,7 @@ function vu({
|
|
|
1152
1155
|
{
|
|
1153
1156
|
type: "button",
|
|
1154
1157
|
onClick: (u) => {
|
|
1155
|
-
u.stopPropagation(),
|
|
1158
|
+
u.stopPropagation(), d((k) => !k);
|
|
1156
1159
|
},
|
|
1157
1160
|
className: `inline-flex h-6 w-full min-w-[64px] items-center gap-1 rounded border px-1.5 text-[11px] font-normal normal-case tracking-normal ${n ? "border-nvr-cyan/40 bg-nvr-cyan/[0.08] text-slate-800 dark:text-slate-100" : "border-slate-200 bg-white text-slate-500 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-400"}`,
|
|
1158
1161
|
children: [
|
|
@@ -1163,7 +1166,7 @@ function vu({
|
|
|
1163
1166
|
role: "button",
|
|
1164
1167
|
tabIndex: -1,
|
|
1165
1168
|
onClick: (u) => {
|
|
1166
|
-
u.stopPropagation(),
|
|
1169
|
+
u.stopPropagation(), i(null);
|
|
1167
1170
|
},
|
|
1168
1171
|
"aria-label": "Clear date filter",
|
|
1169
1172
|
className: "text-slate-400 hover:text-slate-600",
|
|
@@ -1180,7 +1183,7 @@ function vu({
|
|
|
1180
1183
|
{
|
|
1181
1184
|
type: "button",
|
|
1182
1185
|
onClick: () => {
|
|
1183
|
-
|
|
1186
|
+
i(u.value || null), d(!1);
|
|
1184
1187
|
},
|
|
1185
1188
|
className: `block w-full rounded px-2 py-1 text-left text-[11.5px] font-normal normal-case tracking-normal ${n === u.value || !n && !u.value ? "bg-nvr-cyan/[0.08] font-medium text-slate-800 dark:text-slate-100" : "text-slate-600 hover:bg-slate-50 dark:text-slate-300 dark:hover:bg-slate-800"}`,
|
|
1186
1189
|
children: u.label
|
|
@@ -1189,7 +1192,7 @@ function vu({
|
|
|
1189
1192
|
)) }),
|
|
1190
1193
|
/* @__PURE__ */ c("div", { className: "border-t border-slate-100 p-2 dark:border-slate-800", children: [
|
|
1191
1194
|
/* @__PURE__ */ a("p", { className: "pb-1 text-[10px] font-semibold uppercase tracking-wide text-slate-400", children: "Date or range" }),
|
|
1192
|
-
/* @__PURE__ */ a("div", { className: "grid grid-cols-3 gap-1 pb-1.5", children:
|
|
1195
|
+
/* @__PURE__ */ a("div", { className: "grid grid-cols-3 gap-1 pb-1.5", children: Ki.map((u) => /* @__PURE__ */ a(
|
|
1193
1196
|
"button",
|
|
1194
1197
|
{
|
|
1195
1198
|
type: "button",
|
|
@@ -1239,11 +1242,11 @@ function vu({
|
|
|
1239
1242
|
] })
|
|
1240
1243
|
] });
|
|
1241
1244
|
}
|
|
1242
|
-
function
|
|
1245
|
+
function wu({
|
|
1243
1246
|
def: n,
|
|
1244
|
-
selected:
|
|
1247
|
+
selected: i,
|
|
1245
1248
|
onChange: h,
|
|
1246
|
-
allowedIds:
|
|
1249
|
+
allowedIds: d,
|
|
1247
1250
|
scopeDefault: v,
|
|
1248
1251
|
narrowBy: _ = []
|
|
1249
1252
|
}) {
|
|
@@ -1257,12 +1260,12 @@ function ku({
|
|
|
1257
1260
|
n.label_field,
|
|
1258
1261
|
n.sort ?? "",
|
|
1259
1262
|
V,
|
|
1260
|
-
|
|
1263
|
+
i.map(String).sort().join(",")
|
|
1261
1264
|
],
|
|
1262
1265
|
queryFn: async () => {
|
|
1263
|
-
const L = V !== "[]" ?
|
|
1266
|
+
const L = V !== "[]" ? Ld(
|
|
1264
1267
|
n.collection,
|
|
1265
|
-
await
|
|
1268
|
+
await Fd($, T, n.collection),
|
|
1266
1269
|
_
|
|
1267
1270
|
) : null, m = (F, ee) => $.request(
|
|
1268
1271
|
G(`/items/${n.collection}`, {
|
|
@@ -1279,17 +1282,17 @@ function ku({
|
|
|
1279
1282
|
label: String(ce[n.label_field] ?? ce[N] ?? ""),
|
|
1280
1283
|
id: ce.id
|
|
1281
1284
|
})).filter((ce) => ce.value != null && ce.label !== "")
|
|
1282
|
-
), E = await m(L, !0), A = new Set(E.map((F) => String(F.value))), I =
|
|
1285
|
+
), E = await m(L, !0), A = new Set(E.map((F) => String(F.value))), I = i.filter((F) => !A.has(String(F)));
|
|
1283
1286
|
return I.length === 0 ? E : [...E, ...await m({ [N]: { _in: I } }, !1)];
|
|
1284
1287
|
},
|
|
1285
1288
|
staleTime: 10 * 6e4,
|
|
1286
|
-
enabled: C ||
|
|
1289
|
+
enabled: C || i.length > 0,
|
|
1287
1290
|
retry: !1
|
|
1288
|
-
}), k =
|
|
1291
|
+
}), k = d != null && d.length ? M.filter((L) => d.some((m) => String(m) === String(L.id))) : M, Y = d != null && d.length ? {
|
|
1289
1292
|
label: "restricted",
|
|
1290
1293
|
cls: "bg-amber-500/15 text-amber-700 dark:text-amber-300",
|
|
1291
1294
|
title: `Options limited to your restricted ${n.label} scope${v ? "; selection seeded from your defaults" : ""}`
|
|
1292
|
-
} : v &&
|
|
1295
|
+
} : v && i.length > 0 ? {
|
|
1293
1296
|
label: "your default",
|
|
1294
1297
|
cls: "bg-nvr-cyan/[0.12] text-[#0284a8] dark:text-nvr-cyan",
|
|
1295
1298
|
title: `Pre-selected from your default ${n.label} filter (Profile → Default filters) — adjust freely`
|
|
@@ -1299,7 +1302,7 @@ function ku({
|
|
|
1299
1302
|
{
|
|
1300
1303
|
label: n.label,
|
|
1301
1304
|
options: k,
|
|
1302
|
-
selected:
|
|
1305
|
+
selected: i,
|
|
1303
1306
|
onChange: h,
|
|
1304
1307
|
loading: u,
|
|
1305
1308
|
badge: Y,
|
|
@@ -1323,7 +1326,7 @@ const Qs = [
|
|
|
1323
1326
|
{ value: "30d", label: "30 days" },
|
|
1324
1327
|
{ value: "90d", label: "90 days" },
|
|
1325
1328
|
{ value: "year", label: "This year" }
|
|
1326
|
-
],
|
|
1329
|
+
], _u = {
|
|
1327
1330
|
_eq: "_neq",
|
|
1328
1331
|
_neq: "_eq",
|
|
1329
1332
|
_in: "_nin",
|
|
@@ -1338,47 +1341,47 @@ const Qs = [
|
|
|
1338
1341
|
_lte: "_gt"
|
|
1339
1342
|
};
|
|
1340
1343
|
function Us(n) {
|
|
1341
|
-
const
|
|
1342
|
-
if (n === "today") return { from:
|
|
1344
|
+
const i = /* @__PURE__ */ new Date(), h = (v) => v.toISOString().slice(0, 10), d = h(i);
|
|
1345
|
+
if (n === "today") return { from: d, to: d };
|
|
1343
1346
|
if (n === "7d" || n === "30d" || n === "90d") {
|
|
1344
1347
|
const v = Number(n.slice(0, -1));
|
|
1345
|
-
return { from: h(new Date(
|
|
1348
|
+
return { from: h(new Date(i.getTime() - v * 864e5)), to: d };
|
|
1346
1349
|
}
|
|
1347
|
-
return n === "year" ? { from: `${
|
|
1350
|
+
return n === "year" ? { from: `${i.getFullYear()}-01-01`, to: d } : null;
|
|
1348
1351
|
}
|
|
1349
1352
|
function Ds(n) {
|
|
1350
1353
|
var h;
|
|
1351
|
-
const
|
|
1352
|
-
for (const
|
|
1353
|
-
const v =
|
|
1354
|
-
if (
|
|
1355
|
-
const [T, N] = String(
|
|
1356
|
-
if (
|
|
1354
|
+
const i = [];
|
|
1355
|
+
for (const d of n) {
|
|
1356
|
+
const v = d.fieldType === "date" || d.fieldType === "datetime" || d.fieldType === "timestamp";
|
|
1357
|
+
if (d.op === "_between") {
|
|
1358
|
+
const [T, N] = String(d.value).split("..");
|
|
1359
|
+
if (d.not) {
|
|
1357
1360
|
const C = [];
|
|
1358
|
-
T && C.push({ path:
|
|
1361
|
+
T && C.push({ path: d.path, op: "_lt", value: T }), N && C.push({ path: d.path, op: "_gt", value: v ? `${N}T23:59:59` : N }), C.length && i.push({ or: C });
|
|
1359
1362
|
continue;
|
|
1360
1363
|
}
|
|
1361
|
-
T &&
|
|
1364
|
+
T && i.push({ path: d.path, op: "_gte", value: T }), N && i.push({ path: d.path, op: "_lte", value: v ? `${N}T23:59:59` : N });
|
|
1362
1365
|
continue;
|
|
1363
1366
|
}
|
|
1364
|
-
if ((h =
|
|
1365
|
-
|
|
1367
|
+
if ((h = d.path[0]) != null && h.startsWith("$has_") || d.path[0] === "$missing_required" || d.path[0] === "$unseen") {
|
|
1368
|
+
i.push({ path: d.path, op: "_eq", value: !d.not });
|
|
1366
1369
|
continue;
|
|
1367
1370
|
}
|
|
1368
|
-
if (
|
|
1369
|
-
const T = Us(String(
|
|
1370
|
-
T && (
|
|
1371
|
+
if (d.op === "_preset") {
|
|
1372
|
+
const T = Us(String(d.value));
|
|
1373
|
+
T && (d.not ? i.push({
|
|
1371
1374
|
or: [
|
|
1372
|
-
{ path:
|
|
1373
|
-
{ path:
|
|
1375
|
+
{ path: d.path, op: "_lt", value: T.from },
|
|
1376
|
+
{ path: d.path, op: "_gt", value: `${T.to}T23:59:59` }
|
|
1374
1377
|
]
|
|
1375
|
-
}) : (
|
|
1378
|
+
}) : (i.push({ path: d.path, op: "_gte", value: T.from }), i.push({ path: d.path, op: "_lte", value: `${T.to}T23:59:59` })));
|
|
1376
1379
|
continue;
|
|
1377
1380
|
}
|
|
1378
|
-
let _ =
|
|
1379
|
-
|
|
1381
|
+
let _ = d.op.includes(":") ? d.op.split(":")[0] : d.op, $ = d.op.includes(":") ? d.op.split(":")[1] : d.value || null;
|
|
1382
|
+
d.fieldType === "boolean" && ($ === "true" || $ === "false") && ($ = $ === "true"), d.not && (_ = _u[_] ?? _), i.push({ path: d.path, op: _, value: $ });
|
|
1380
1383
|
}
|
|
1381
|
-
return
|
|
1384
|
+
return i;
|
|
1382
1385
|
}
|
|
1383
1386
|
const Ps = [
|
|
1384
1387
|
{ label: "Contains", value: "_contains" },
|
|
@@ -1404,7 +1407,7 @@ const Ps = [
|
|
|
1404
1407
|
{ label: "After", value: "_gt" },
|
|
1405
1408
|
{ label: "Is empty", value: "_null" },
|
|
1406
1409
|
{ label: "Is not empty", value: "_nnull" }
|
|
1407
|
-
],
|
|
1410
|
+
], Nu = {
|
|
1408
1411
|
string: Ps,
|
|
1409
1412
|
text: Ps,
|
|
1410
1413
|
integer: Cr,
|
|
@@ -1425,23 +1428,23 @@ const Ps = [
|
|
|
1425
1428
|
{ label: "Is not empty", value: "_nnull" }
|
|
1426
1429
|
]
|
|
1427
1430
|
};
|
|
1428
|
-
function
|
|
1429
|
-
for (const
|
|
1430
|
-
const h =
|
|
1431
|
+
function Su(n) {
|
|
1432
|
+
for (const i of Object.values(Nu)) {
|
|
1433
|
+
const h = i.find((d) => d.value === n);
|
|
1431
1434
|
if (h) return h.label;
|
|
1432
1435
|
}
|
|
1433
1436
|
return n;
|
|
1434
1437
|
}
|
|
1435
|
-
function rt(n,
|
|
1438
|
+
function rt(n, i, h) {
|
|
1436
1439
|
return n.find(
|
|
1437
|
-
(
|
|
1440
|
+
(d) => d.many_collection === i && d.many_field === h && d.one_collection
|
|
1438
1441
|
);
|
|
1439
1442
|
}
|
|
1440
1443
|
function Er({
|
|
1441
1444
|
relatedCollection: n,
|
|
1442
|
-
depth:
|
|
1445
|
+
depth: i,
|
|
1443
1446
|
path: h,
|
|
1444
|
-
pathLabels:
|
|
1447
|
+
pathLabels: d,
|
|
1445
1448
|
filterText: v,
|
|
1446
1449
|
includeAliases: _ = !1,
|
|
1447
1450
|
onPick: $
|
|
@@ -1453,8 +1456,8 @@ function Er({
|
|
|
1453
1456
|
retry: !1
|
|
1454
1457
|
}), [C, B] = y(/* @__PURE__ */ new Set());
|
|
1455
1458
|
if (!N)
|
|
1456
|
-
return /* @__PURE__ */ a("div", { className: "px-3 py-1.5", style: { paddingLeft: `${0.5 +
|
|
1457
|
-
const V =
|
|
1459
|
+
return /* @__PURE__ */ a("div", { className: "px-3 py-1.5", style: { paddingLeft: `${0.5 + i}rem` }, children: /* @__PURE__ */ a("span", { className: "inline-block h-3 w-20 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }) });
|
|
1460
|
+
const V = i < 2;
|
|
1458
1461
|
return /* @__PURE__ */ a(Ue, { children: N.fields.filter((M) => !M.hidden && (!v || M.field.includes(v))).map((M) => {
|
|
1459
1462
|
const u = V ? rt(N.relations, n, M.field) : void 0, k = V && _ ? Hn(N.relations, n, M.field) : void 0, Y = (u == null ? void 0 : u.one_collection) ?? null, L = C.has(M.field);
|
|
1460
1463
|
return /* @__PURE__ */ c("div", { children: [
|
|
@@ -1468,12 +1471,12 @@ function Er({
|
|
|
1468
1471
|
return E.has(M.field) ? E.delete(M.field) : E.add(M.field), E;
|
|
1469
1472
|
}) : $(
|
|
1470
1473
|
[...h, M.field],
|
|
1471
|
-
[...
|
|
1474
|
+
[...d, Ae(M.field)],
|
|
1472
1475
|
M.type ?? "string"
|
|
1473
1476
|
);
|
|
1474
1477
|
},
|
|
1475
1478
|
className: "flex w-full items-center gap-1.5 px-3 py-1.5 text-left text-[12.5px] text-slate-700 hover:bg-slate-50 dark:text-slate-200 dark:hover:bg-slate-800",
|
|
1476
|
-
style: { paddingLeft: `${0.5 +
|
|
1479
|
+
style: { paddingLeft: `${0.5 + i}rem` },
|
|
1477
1480
|
children: [
|
|
1478
1481
|
Y || k ? L ? "▾ " : "▸ " : "",
|
|
1479
1482
|
Ae(M.field),
|
|
@@ -1485,9 +1488,9 @@ function Er({
|
|
|
1485
1488
|
Er,
|
|
1486
1489
|
{
|
|
1487
1490
|
relatedCollection: Y,
|
|
1488
|
-
depth:
|
|
1491
|
+
depth: i + 1,
|
|
1489
1492
|
path: [...h, M.field],
|
|
1490
|
-
pathLabels: [...
|
|
1493
|
+
pathLabels: [...d, Ae(M.field)],
|
|
1491
1494
|
filterText: "",
|
|
1492
1495
|
includeAliases: _,
|
|
1493
1496
|
onPick: $
|
|
@@ -1497,9 +1500,9 @@ function Er({
|
|
|
1497
1500
|
Ws,
|
|
1498
1501
|
{
|
|
1499
1502
|
aliasInfo: k,
|
|
1500
|
-
depth:
|
|
1503
|
+
depth: i + 1,
|
|
1501
1504
|
path: [...h, M.field],
|
|
1502
|
-
pathLabels: [...
|
|
1505
|
+
pathLabels: [...d, Ae(M.field)],
|
|
1503
1506
|
includeAliases: _,
|
|
1504
1507
|
onPick: $
|
|
1505
1508
|
}
|
|
@@ -1509,9 +1512,9 @@ function Er({
|
|
|
1509
1512
|
}
|
|
1510
1513
|
function Ws({
|
|
1511
1514
|
aliasInfo: n,
|
|
1512
|
-
depth:
|
|
1515
|
+
depth: i,
|
|
1513
1516
|
path: h,
|
|
1514
|
-
pathLabels:
|
|
1517
|
+
pathLabels: d,
|
|
1515
1518
|
includeAliases: v,
|
|
1516
1519
|
onPick: _
|
|
1517
1520
|
}) {
|
|
@@ -1534,25 +1537,25 @@ function Ws({
|
|
|
1534
1537
|
Er,
|
|
1535
1538
|
{
|
|
1536
1539
|
relatedCollection: C,
|
|
1537
|
-
depth:
|
|
1540
|
+
depth: i,
|
|
1538
1541
|
path: h,
|
|
1539
|
-
pathLabels:
|
|
1542
|
+
pathLabels: d,
|
|
1540
1543
|
filterText: "",
|
|
1541
1544
|
includeAliases: v,
|
|
1542
1545
|
onPick: _
|
|
1543
1546
|
}
|
|
1544
|
-
) : /* @__PURE__ */ a("div", { className: "px-3 py-1.5", style: { paddingLeft: `${0.5 +
|
|
1547
|
+
) : /* @__PURE__ */ a("div", { className: "px-3 py-1.5", style: { paddingLeft: `${0.5 + i}rem` }, children: /* @__PURE__ */ a("span", { className: "inline-block h-3 w-20 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }) });
|
|
1545
1548
|
}
|
|
1546
|
-
function Ms(n,
|
|
1547
|
-
if (
|
|
1548
|
-
const
|
|
1549
|
-
return
|
|
1549
|
+
function Ms(n, i, h) {
|
|
1550
|
+
if (i) return "relation";
|
|
1551
|
+
const d = n.type ?? "string";
|
|
1552
|
+
return d === "integer" || d === "decimal" || d === "float" ? "number" : d === "datetime" || d === "timestamp" ? "date" : d;
|
|
1550
1553
|
}
|
|
1551
|
-
function
|
|
1554
|
+
function Cu({
|
|
1552
1555
|
collection: n,
|
|
1553
|
-
path:
|
|
1556
|
+
path: i,
|
|
1554
1557
|
pathLabels: h,
|
|
1555
|
-
search:
|
|
1558
|
+
search: d,
|
|
1556
1559
|
depth: v,
|
|
1557
1560
|
onDrill: _,
|
|
1558
1561
|
onPick: $
|
|
@@ -1582,7 +1585,7 @@ function Nu({
|
|
|
1582
1585
|
queryFn: () => T.request(G(`/collections/${m}`)).then((E) => E.data),
|
|
1583
1586
|
staleTime: 10 * 6e4,
|
|
1584
1587
|
retry: !1,
|
|
1585
|
-
enabled: !!
|
|
1588
|
+
enabled: !!d
|
|
1586
1589
|
}))
|
|
1587
1590
|
}), V = ke(() => {
|
|
1588
1591
|
const m = /* @__PURE__ */ new Map();
|
|
@@ -1593,10 +1596,10 @@ function Nu({
|
|
|
1593
1596
|
}, [C, B]);
|
|
1594
1597
|
if (!N)
|
|
1595
1598
|
return /* @__PURE__ */ a("div", { className: "px-3 py-2", children: /* @__PURE__ */ a("span", { className: "inline-block h-3 w-24 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }) });
|
|
1596
|
-
const M =
|
|
1599
|
+
const M = d.trim().toLowerCase(), u = (m) => !M || m.toLowerCase().includes(M) || m.toLowerCase().replace(/ /g, "_").includes(M), k = [];
|
|
1597
1600
|
for (const m of N.fields) {
|
|
1598
1601
|
if (m.hidden) continue;
|
|
1599
|
-
const E = Ae(m.field), A = rt(N.relations, n, m.field), I = Hn(N.relations, n, m.field), F = [...
|
|
1602
|
+
const E = Ae(m.field), A = rt(N.relations, n, m.field), I = Hn(N.relations, n, m.field), F = [...i, m.field], ee = [...h, E];
|
|
1600
1603
|
if (A != null && A.one_collection && !wt(A.one_collection))
|
|
1601
1604
|
u(E) && k.push({
|
|
1602
1605
|
key: m.field,
|
|
@@ -1646,7 +1649,7 @@ function Nu({
|
|
|
1646
1649
|
breadcrumb: I,
|
|
1647
1650
|
hint: Ms(F, de ?? void 0),
|
|
1648
1651
|
leaf: {
|
|
1649
|
-
path: [...
|
|
1652
|
+
path: [...i, m.field, F.field],
|
|
1650
1653
|
pathLabels: [...h, I, ee],
|
|
1651
1654
|
fieldType: de != null && de.one_collection ? "relation" : F.type ?? "string",
|
|
1652
1655
|
relTarget: (de == null ? void 0 : de.one_collection) ?? void 0
|
|
@@ -1693,11 +1696,11 @@ function Nu({
|
|
|
1693
1696
|
m.key
|
|
1694
1697
|
)) });
|
|
1695
1698
|
}
|
|
1696
|
-
function
|
|
1699
|
+
function $u({
|
|
1697
1700
|
target: n,
|
|
1698
|
-
selected:
|
|
1701
|
+
selected: i,
|
|
1699
1702
|
labels: h,
|
|
1700
|
-
onToggle:
|
|
1703
|
+
onToggle: d
|
|
1701
1704
|
}) {
|
|
1702
1705
|
const v = vt(), [_, $] = y(""), { data: T } = te({
|
|
1703
1706
|
queryKey: ["cbv-collection-meta", n],
|
|
@@ -1725,7 +1728,7 @@ function Su({
|
|
|
1725
1728
|
staleTime: 10 * 6e4,
|
|
1726
1729
|
enabled: !!T,
|
|
1727
1730
|
retry: !1
|
|
1728
|
-
}), M = new Set(
|
|
1731
|
+
}), M = new Set(i.map(String)), u = _ ? B.filter((k) => k.label.toLowerCase().includes(_.toLowerCase())) : B;
|
|
1729
1732
|
return /* @__PURE__ */ c("div", { className: "flex max-h-64 flex-col", children: [
|
|
1730
1733
|
/* @__PURE__ */ a(
|
|
1731
1734
|
"input",
|
|
@@ -1747,7 +1750,7 @@ function Su({
|
|
|
1747
1750
|
{
|
|
1748
1751
|
type: "checkbox",
|
|
1749
1752
|
checked: M.has(String(k.value)),
|
|
1750
|
-
onChange: () =>
|
|
1753
|
+
onChange: () => d(k.value, k.label)
|
|
1751
1754
|
}
|
|
1752
1755
|
),
|
|
1753
1756
|
/* @__PURE__ */ a("span", { className: "truncate", children: k.label })
|
|
@@ -1755,41 +1758,41 @@ function Su({
|
|
|
1755
1758
|
},
|
|
1756
1759
|
String(k.value)
|
|
1757
1760
|
)) }),
|
|
1758
|
-
|
|
1759
|
-
|
|
1761
|
+
i.length > 0 && /* @__PURE__ */ c("p", { className: "shrink-0 border-t border-slate-100 px-3 py-1 text-[11px] text-slate-400 dark:border-slate-800", children: [
|
|
1762
|
+
i.length,
|
|
1760
1763
|
" selected ·",
|
|
1761
1764
|
" ",
|
|
1762
|
-
|
|
1763
|
-
|
|
1765
|
+
i.map((k) => h[String(k)] ?? k).slice(0, 3).join(", "),
|
|
1766
|
+
i.length > 3 ? "…" : ""
|
|
1764
1767
|
] })
|
|
1765
1768
|
] });
|
|
1766
1769
|
}
|
|
1767
|
-
function
|
|
1768
|
-
var h,
|
|
1769
|
-
const
|
|
1770
|
+
function qu(n) {
|
|
1771
|
+
var h, d;
|
|
1772
|
+
const i = n.pathLabels.join(" › ");
|
|
1770
1773
|
if (Array.isArray(n.value)) {
|
|
1771
1774
|
const v = n.valueLabels ?? n.value.map(String);
|
|
1772
1775
|
return {
|
|
1773
|
-
field:
|
|
1776
|
+
field: i,
|
|
1774
1777
|
op: "any of",
|
|
1775
1778
|
value: v.length <= 2 ? v.join(", ") : `${v[0]} +${v.length - 1}`
|
|
1776
1779
|
};
|
|
1777
1780
|
}
|
|
1778
1781
|
if (n.op === "_between") {
|
|
1779
1782
|
const [v, _] = String(n.value).split("..");
|
|
1780
|
-
return { field:
|
|
1783
|
+
return { field: i, op: "between", value: `${v} – ${_}` };
|
|
1781
1784
|
}
|
|
1782
1785
|
if (n.op === "_preset") {
|
|
1783
1786
|
const v = ((h = $a.find((_) => _.value === n.value)) == null ? void 0 : h.label) ?? String(n.value);
|
|
1784
|
-
return { field:
|
|
1787
|
+
return { field: i, op: "in the", value: `${v} (rolling)` };
|
|
1785
1788
|
}
|
|
1786
|
-
return (
|
|
1789
|
+
return (d = n.path[0]) != null && d.startsWith("$has_") || n.path[0] === "$missing_required" ? { field: i, op: "", value: "" } : { field: i, op: Su(n.op).toLowerCase(), value: String(n.value ?? "") };
|
|
1787
1790
|
}
|
|
1788
|
-
function
|
|
1791
|
+
function Tu({
|
|
1789
1792
|
collection: n,
|
|
1790
|
-
meta:
|
|
1793
|
+
meta: i,
|
|
1791
1794
|
search: h,
|
|
1792
|
-
onSearch:
|
|
1795
|
+
onSearch: d,
|
|
1793
1796
|
filters: v,
|
|
1794
1797
|
onFiltersChange: _
|
|
1795
1798
|
}) {
|
|
@@ -1800,11 +1803,11 @@ function $u({
|
|
|
1800
1803
|
}), [M, u] = y(null), [k, Y] = y("_contains"), [L, m] = y(""), [E, A] = y(""), [I, F] = y([]), [ee, de] = y({}), [ce, Ie] = y(null), X = he(null);
|
|
1801
1804
|
me(() => {
|
|
1802
1805
|
if (!$) return;
|
|
1803
|
-
const w = (
|
|
1806
|
+
const w = (re) => {
|
|
1804
1807
|
var Ce;
|
|
1805
|
-
(Ce = X.current) != null && Ce.contains(
|
|
1806
|
-
}, be = (
|
|
1807
|
-
|
|
1808
|
+
(Ce = X.current) != null && Ce.contains(re.target) || T(!1);
|
|
1809
|
+
}, be = (re) => {
|
|
1810
|
+
re.key === "Escape" && T(!1);
|
|
1808
1811
|
};
|
|
1809
1812
|
return window.addEventListener("mousedown", w), window.addEventListener("keydown", be), () => {
|
|
1810
1813
|
window.removeEventListener("mousedown", w), window.removeEventListener("keydown", be);
|
|
@@ -1824,7 +1827,7 @@ function $u({
|
|
|
1824
1827
|
op: w,
|
|
1825
1828
|
value: be
|
|
1826
1829
|
});
|
|
1827
|
-
},
|
|
1830
|
+
}, oe = () => {
|
|
1828
1831
|
!M || I.length === 0 || Z({
|
|
1829
1832
|
path: M.path,
|
|
1830
1833
|
pathLabels: M.pathLabels,
|
|
@@ -1843,16 +1846,16 @@ function $u({
|
|
|
1843
1846
|
relTarget: w.relTarget
|
|
1844
1847
|
}), F(w.value);
|
|
1845
1848
|
const be = {};
|
|
1846
|
-
w.value.forEach((
|
|
1849
|
+
w.value.forEach((re, Ce) => {
|
|
1847
1850
|
var ut;
|
|
1848
|
-
be[String(
|
|
1851
|
+
be[String(re)] = ((ut = w.valueLabels) == null ? void 0 : ut[Ce]) ?? String(re);
|
|
1849
1852
|
}), de(be);
|
|
1850
1853
|
} else if (u({ path: w.path, pathLabels: w.pathLabels, fieldType: w.fieldType }), Y(w.op), w.op === "_between") {
|
|
1851
|
-
const [be,
|
|
1852
|
-
m(be ?? ""), A(
|
|
1854
|
+
const [be, re] = String(w.value).split("..");
|
|
1855
|
+
m(be ?? ""), A(re ?? "");
|
|
1853
1856
|
} else
|
|
1854
1857
|
m(String(w.value ?? ""));
|
|
1855
|
-
},
|
|
1858
|
+
}, ae = (() => {
|
|
1856
1859
|
if (!M) return null;
|
|
1857
1860
|
if (M.relTarget !== void 0) return "relation";
|
|
1858
1861
|
const w = M.fieldType;
|
|
@@ -1885,7 +1888,7 @@ function $u({
|
|
|
1885
1888
|
"input",
|
|
1886
1889
|
{
|
|
1887
1890
|
value: h,
|
|
1888
|
-
onChange: (w) =>
|
|
1891
|
+
onChange: (w) => d(w.target.value),
|
|
1889
1892
|
placeholder: "Search…",
|
|
1890
1893
|
"aria-label": `Search ${n}`,
|
|
1891
1894
|
className: "h-8 w-full rounded-md border border-slate-200 bg-white pl-8 pr-3 text-[13px] outline-none focus:border-nvr-cyan/50 focus:ring-2 focus:ring-nvr-cyan/30 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-100"
|
|
@@ -1939,7 +1942,7 @@ function $u({
|
|
|
1939
1942
|
type: "button",
|
|
1940
1943
|
onClick: () => {
|
|
1941
1944
|
_([
|
|
1942
|
-
...v.filter((
|
|
1945
|
+
...v.filter((re) => re.path[0] !== w),
|
|
1943
1946
|
{
|
|
1944
1947
|
id: `${w}-${Date.now()}`,
|
|
1945
1948
|
path: [w],
|
|
@@ -1959,15 +1962,15 @@ function $u({
|
|
|
1959
1962
|
w
|
|
1960
1963
|
)) }),
|
|
1961
1964
|
/* @__PURE__ */ a(
|
|
1962
|
-
|
|
1965
|
+
Cu,
|
|
1963
1966
|
{
|
|
1964
1967
|
collection: B.collection,
|
|
1965
1968
|
path: B.path,
|
|
1966
1969
|
pathLabels: B.pathLabels,
|
|
1967
1970
|
search: N,
|
|
1968
1971
|
depth: B.path.length,
|
|
1969
|
-
onDrill: (w, be,
|
|
1970
|
-
V({ collection: w, path: be, pathLabels:
|
|
1972
|
+
onDrill: (w, be, re) => {
|
|
1973
|
+
V({ collection: w, path: be, pathLabels: re }), C("");
|
|
1971
1974
|
},
|
|
1972
1975
|
onPick: (w) => {
|
|
1973
1976
|
u(w), Y(
|
|
@@ -1992,17 +1995,17 @@ function $u({
|
|
|
1992
1995
|
]
|
|
1993
1996
|
}
|
|
1994
1997
|
),
|
|
1995
|
-
|
|
1998
|
+
ae === "relation" && M.relTarget ? /* @__PURE__ */ c("div", { className: "pt-2", children: [
|
|
1996
1999
|
/* @__PURE__ */ a(
|
|
1997
|
-
|
|
2000
|
+
$u,
|
|
1998
2001
|
{
|
|
1999
2002
|
target: M.relTarget,
|
|
2000
2003
|
selected: I,
|
|
2001
2004
|
labels: ee,
|
|
2002
2005
|
onToggle: (w, be) => {
|
|
2003
2006
|
F(
|
|
2004
|
-
(
|
|
2005
|
-
), de((
|
|
2007
|
+
(re) => re.map(String).includes(String(w)) ? re.filter((Ce) => String(Ce) !== String(w)) : [...re, w]
|
|
2008
|
+
), de((re) => ({ ...re, [String(w)]: be }));
|
|
2006
2009
|
}
|
|
2007
2010
|
}
|
|
2008
2011
|
),
|
|
@@ -2011,7 +2014,7 @@ function $u({
|
|
|
2011
2014
|
{
|
|
2012
2015
|
type: "button",
|
|
2013
2016
|
disabled: I.length === 0,
|
|
2014
|
-
onClick:
|
|
2017
|
+
onClick: oe,
|
|
2015
2018
|
className: "h-8 w-full rounded-md bg-nvr-cyan text-[13px] font-medium text-white disabled:opacity-40",
|
|
2016
2019
|
children: [
|
|
2017
2020
|
"Apply",
|
|
@@ -2019,7 +2022,7 @@ function $u({
|
|
|
2019
2022
|
]
|
|
2020
2023
|
}
|
|
2021
2024
|
) })
|
|
2022
|
-
] }) :
|
|
2025
|
+
] }) : ae === "boolean" ? /* @__PURE__ */ a("div", { className: "flex gap-1.5 p-3", children: [
|
|
2023
2026
|
{ label: "Yes", op: "_eq:true" },
|
|
2024
2027
|
{ label: "No", op: "_eq:false" },
|
|
2025
2028
|
{ label: "Empty", op: "_null" }
|
|
@@ -2035,7 +2038,7 @@ function $u({
|
|
|
2035
2038
|
children: w.label
|
|
2036
2039
|
},
|
|
2037
2040
|
w.op
|
|
2038
|
-
)) }) :
|
|
2041
|
+
)) }) : ae === "date" ? /* @__PURE__ */ c("div", { className: "space-y-2 p-3", children: [
|
|
2039
2042
|
/* @__PURE__ */ a("div", { className: "flex flex-wrap gap-1", children: $a.filter((w) => w.value).map((w) => /* @__PURE__ */ a(
|
|
2040
2043
|
"button",
|
|
2041
2044
|
{
|
|
@@ -2088,11 +2091,11 @@ function $u({
|
|
|
2088
2091
|
{
|
|
2089
2092
|
className: "space-y-2 p-3",
|
|
2090
2093
|
onSubmit: (w) => {
|
|
2091
|
-
w.preventDefault(),
|
|
2094
|
+
w.preventDefault(), ae === "number" && k === "_between" ? L !== "" && E !== "" && q("_between", `${L}..${E}`) : L.trim() && q(k, L.trim());
|
|
2092
2095
|
},
|
|
2093
2096
|
children: [
|
|
2094
2097
|
/* @__PURE__ */ c("div", { className: "flex flex-wrap gap-1", children: [
|
|
2095
|
-
(
|
|
2098
|
+
(ae === "number" ? [...Me, { value: "_between", label: "Between" }] : ie).map((w) => /* @__PURE__ */ a(
|
|
2096
2099
|
"button",
|
|
2097
2100
|
{
|
|
2098
2101
|
type: "button",
|
|
@@ -2126,14 +2129,14 @@ function $u({
|
|
|
2126
2129
|
"input",
|
|
2127
2130
|
{
|
|
2128
2131
|
autoFocus: !0,
|
|
2129
|
-
type:
|
|
2132
|
+
type: ae === "number" ? "number" : "text",
|
|
2130
2133
|
value: L,
|
|
2131
2134
|
onChange: (w) => m(w.target.value),
|
|
2132
2135
|
placeholder: "Value…",
|
|
2133
2136
|
className: "h-8 min-w-0 flex-1 rounded-md border border-slate-200 bg-white px-2.5 text-[13px] outline-none focus:border-nvr-cyan/50 dark:border-slate-700 dark:bg-slate-800 dark:text-slate-100"
|
|
2134
2137
|
}
|
|
2135
2138
|
),
|
|
2136
|
-
|
|
2139
|
+
ae === "number" && k === "_between" && /* @__PURE__ */ c(Ue, { children: [
|
|
2137
2140
|
/* @__PURE__ */ a("span", { className: "text-[11px] text-slate-400", children: "to" }),
|
|
2138
2141
|
/* @__PURE__ */ a(
|
|
2139
2142
|
"input",
|
|
@@ -2163,7 +2166,7 @@ function $u({
|
|
|
2163
2166
|
] })
|
|
2164
2167
|
] }),
|
|
2165
2168
|
v.map((w) => {
|
|
2166
|
-
const be =
|
|
2169
|
+
const be = qu(w);
|
|
2167
2170
|
return /* @__PURE__ */ c(
|
|
2168
2171
|
"span",
|
|
2169
2172
|
{
|
|
@@ -2173,7 +2176,7 @@ function $u({
|
|
|
2173
2176
|
"button",
|
|
2174
2177
|
{
|
|
2175
2178
|
type: "button",
|
|
2176
|
-
onClick: () => _(v.map((
|
|
2179
|
+
onClick: () => _(v.map((re) => re.id === w.id ? { ...re, not: !re.not } : re)),
|
|
2177
2180
|
"data-tip": w.not ? "Negated — click to restore" : "Click to negate (NOT)",
|
|
2178
2181
|
className: w.not ? "rounded bg-amber-100 px-1 text-[10.5px] font-bold text-amber-700 dark:bg-amber-400/15 dark:text-amber-400" : "rounded px-1 text-[10.5px] font-bold text-slate-300 hover:text-slate-500",
|
|
2179
2182
|
children: "NOT"
|
|
@@ -2196,7 +2199,7 @@ function $u({
|
|
|
2196
2199
|
"button",
|
|
2197
2200
|
{
|
|
2198
2201
|
type: "button",
|
|
2199
|
-
onClick: () => _(v.filter((
|
|
2202
|
+
onClick: () => _(v.filter((re) => re.id !== w.id)),
|
|
2200
2203
|
"aria-label": "Remove filter",
|
|
2201
2204
|
className: "text-slate-400 hover:text-red-500",
|
|
2202
2205
|
children: "✕"
|
|
@@ -2210,16 +2213,16 @@ function $u({
|
|
|
2210
2213
|
] })
|
|
2211
2214
|
);
|
|
2212
2215
|
}
|
|
2213
|
-
function
|
|
2216
|
+
function Lu({
|
|
2214
2217
|
collection: n,
|
|
2215
|
-
meta:
|
|
2218
|
+
meta: i,
|
|
2216
2219
|
onPick: h
|
|
2217
2220
|
}) {
|
|
2218
|
-
const [
|
|
2219
|
-
return /* @__PURE__ */ a("div", { className: "max-h-56 overflow-y-auto", children:
|
|
2220
|
-
const T = rt(
|
|
2221
|
+
const [d, v] = y(/* @__PURE__ */ new Set()), _ = ($, T) => h($, T);
|
|
2222
|
+
return /* @__PURE__ */ a("div", { className: "max-h-56 overflow-y-auto", children: i.fields.filter(($) => !$.hidden).map(($) => {
|
|
2223
|
+
const T = rt(i.relations, n, $.field), N = Hn(i.relations, n, $.field);
|
|
2221
2224
|
if (!(T != null && T.one_collection) && !N) return null;
|
|
2222
|
-
const C =
|
|
2225
|
+
const C = d.has($.field);
|
|
2223
2226
|
return /* @__PURE__ */ c("div", { children: [
|
|
2224
2227
|
/* @__PURE__ */ c(
|
|
2225
2228
|
"button",
|
|
@@ -2264,13 +2267,13 @@ function qu({
|
|
|
2264
2267
|
] }, $.field);
|
|
2265
2268
|
}) });
|
|
2266
2269
|
}
|
|
2267
|
-
function
|
|
2270
|
+
function Fu({
|
|
2268
2271
|
collection: n,
|
|
2269
|
-
ids:
|
|
2272
|
+
ids: i,
|
|
2270
2273
|
onDone: h,
|
|
2271
|
-
onCancel:
|
|
2274
|
+
onCancel: d
|
|
2272
2275
|
}) {
|
|
2273
|
-
const v = vt(), [_, $] = y(
|
|
2276
|
+
const v = vt(), [_, $] = y(i[0]), [T, N] = y(!1), [C, B] = y(null), [V, M] = y(null), u = i.find((L) => String(L) !== String(_));
|
|
2274
2277
|
me(() => {
|
|
2275
2278
|
M(null);
|
|
2276
2279
|
let L = !0;
|
|
@@ -2308,7 +2311,7 @@ function Tu({
|
|
|
2308
2311
|
};
|
|
2309
2312
|
return /* @__PURE__ */ c("span", { className: "flex flex-wrap items-center gap-2", children: [
|
|
2310
2313
|
/* @__PURE__ */ a("span", { className: "text-[12px] text-slate-300 dark:text-muted-foreground", children: "Keep" }),
|
|
2311
|
-
|
|
2314
|
+
i.map((L) => /* @__PURE__ */ a(
|
|
2312
2315
|
"button",
|
|
2313
2316
|
{
|
|
2314
2317
|
type: "button",
|
|
@@ -2337,24 +2340,24 @@ function Tu({
|
|
|
2337
2340
|
"button",
|
|
2338
2341
|
{
|
|
2339
2342
|
type: "button",
|
|
2340
|
-
onClick:
|
|
2343
|
+
onClick: d,
|
|
2341
2344
|
className: "h-8 px-2 text-[12.5px] text-slate-300 dark:text-muted-foreground hover:text-white dark:hover:text-foreground",
|
|
2342
2345
|
children: "Cancel"
|
|
2343
2346
|
}
|
|
2344
2347
|
)
|
|
2345
2348
|
] });
|
|
2346
2349
|
}
|
|
2347
|
-
function
|
|
2350
|
+
function Ru({
|
|
2348
2351
|
collection: n,
|
|
2349
|
-
selectedIds:
|
|
2352
|
+
selectedIds: i,
|
|
2350
2353
|
transitions: h,
|
|
2351
|
-
fields:
|
|
2354
|
+
fields: d,
|
|
2352
2355
|
relations: v,
|
|
2353
2356
|
registryKeys: _,
|
|
2354
2357
|
onClear: $,
|
|
2355
2358
|
onSuccess: T
|
|
2356
2359
|
}) {
|
|
2357
|
-
const N = Na(), C = vt(), B = qa(), V = Is(), [M, u] = y("actions"), k =
|
|
2360
|
+
const N = Na(), C = vt(), B = qa(), V = Is(), [M, u] = y("actions"), k = rc([n], _), { data: Y = [] } = te({
|
|
2358
2361
|
queryKey: ["bulk-recipes", n],
|
|
2359
2362
|
queryFn: () => C.request(G("/bulk-recipes", { collection: n })).then((q) => q.data ?? []).catch(() => []),
|
|
2360
2363
|
staleTime: 6e4
|
|
@@ -2373,32 +2376,32 @@ function Lu({
|
|
|
2373
2376
|
qe("Failed to save recipe");
|
|
2374
2377
|
}
|
|
2375
2378
|
}, F = (q) => {
|
|
2376
|
-
var
|
|
2377
|
-
if (q.action_type === "update" && ((
|
|
2378
|
-
const
|
|
2379
|
+
var oe, fe;
|
|
2380
|
+
if (q.action_type === "update" && ((oe = q.config) != null && oe.field)) {
|
|
2381
|
+
const ae = q.config;
|
|
2379
2382
|
Ye(async (Me) => {
|
|
2380
2383
|
const ie = await C.request(
|
|
2381
2384
|
ye(`/items/${n}/bulk-update?progress=${Me}`, {
|
|
2382
|
-
ids:
|
|
2383
|
-
data: { [String(
|
|
2385
|
+
ids: i,
|
|
2386
|
+
data: { [String(ae.field)]: ae.value ?? "" }
|
|
2384
2387
|
})
|
|
2385
2388
|
);
|
|
2386
2389
|
return `${q.name}: updated ${ie.updated} items${ie.skipped ? ` · ${ie.skipped} already there` : ""}${ie.refused ? ` · ${ie.refused} locked on their form` : ""}`;
|
|
2387
2390
|
});
|
|
2388
2391
|
} else if (q.action_type === "transition" && ((fe = q.config) != null && fe.transition_label)) {
|
|
2389
|
-
const
|
|
2392
|
+
const ae = h.find((Me) => {
|
|
2390
2393
|
var ie;
|
|
2391
2394
|
return Me.label === ((ie = q.config) == null ? void 0 : ie.transition_label);
|
|
2392
2395
|
});
|
|
2393
|
-
if (!
|
|
2396
|
+
if (!ae) {
|
|
2394
2397
|
qe(`"${q.config.transition_label}" is not an available transition here`);
|
|
2395
2398
|
return;
|
|
2396
2399
|
}
|
|
2397
2400
|
Ye(async (Me) => {
|
|
2398
2401
|
const ie = await C.request(
|
|
2399
2402
|
ye(`/items/${n}/bulk-transition?progress=${Me}`, {
|
|
2400
|
-
ids:
|
|
2401
|
-
transition_id:
|
|
2403
|
+
ids: i,
|
|
2404
|
+
transition_id: ae.id
|
|
2402
2405
|
})
|
|
2403
2406
|
);
|
|
2404
2407
|
return ie.failed > 0 ? `${q.name}: ${ie.succeeded} done, ${ie.failed} failed` : `${q.name}: transitioned ${ie.succeeded} items`;
|
|
@@ -2406,28 +2409,28 @@ function Lu({
|
|
|
2406
2409
|
}
|
|
2407
2410
|
}, [ee, de] = y(""), [ce, Ie] = y(!1), [X, qe] = y(null), Ye = async (q) => {
|
|
2408
2411
|
Ie(!0), qe(null);
|
|
2409
|
-
const
|
|
2410
|
-
Ti(
|
|
2412
|
+
const oe = qi();
|
|
2413
|
+
Ti(oe, i);
|
|
2411
2414
|
try {
|
|
2412
|
-
const fe = await q(
|
|
2415
|
+
const fe = await q(oe);
|
|
2413
2416
|
qe(fe), T(), $(), u("actions");
|
|
2414
2417
|
} catch (fe) {
|
|
2415
|
-
qe(
|
|
2418
|
+
qe(zi(fe, "Bulk action failed"));
|
|
2416
2419
|
} finally {
|
|
2417
|
-
Li(
|
|
2420
|
+
Li(oe), Ie(!1);
|
|
2418
2421
|
}
|
|
2419
|
-
}, Z = (q,
|
|
2420
|
-
const
|
|
2422
|
+
}, Z = (q, oe) => void Ye(async (fe) => {
|
|
2423
|
+
const ae = await C.request(
|
|
2421
2424
|
ye(`/items/${n}/bulk-update?progress=${fe}`, {
|
|
2422
|
-
ids:
|
|
2423
|
-
data: { [q]:
|
|
2425
|
+
ids: i,
|
|
2426
|
+
data: { [q]: oe ?? null },
|
|
2424
2427
|
by_form: !0
|
|
2425
2428
|
})
|
|
2426
2429
|
);
|
|
2427
2430
|
return [
|
|
2428
|
-
`Updated ${
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
+
`Updated ${ae.updated} items`,
|
|
2432
|
+
ae.skipped ? `${ae.skipped} already there` : "",
|
|
2433
|
+
ae.refused ? `${ae.refused} refused — ${ae.refused_reason ?? "locked on its form"}` : ""
|
|
2431
2434
|
].filter(Boolean).join(" · ");
|
|
2432
2435
|
});
|
|
2433
2436
|
return /* @__PURE__ */ c(
|
|
@@ -2447,16 +2450,16 @@ function Lu({
|
|
|
2447
2450
|
}
|
|
2448
2451
|
),
|
|
2449
2452
|
/* @__PURE__ */ c("span", { className: "text-[13px] font-medium text-nvr-cyan dark:text-nvr-cyan", children: [
|
|
2450
|
-
|
|
2453
|
+
i.length,
|
|
2451
2454
|
" item",
|
|
2452
|
-
|
|
2455
|
+
i.length === 1 ? "" : "s",
|
|
2453
2456
|
" selected"
|
|
2454
2457
|
] }),
|
|
2455
2458
|
X && /* @__PURE__ */ a("span", { className: "text-[12px] text-slate-300 dark:text-muted-foreground", children: X }),
|
|
2456
2459
|
/* @__PURE__ */ a("span", { className: "flex-1" }),
|
|
2457
2460
|
M === "actions" && /* @__PURE__ */ c("span", { className: "flex flex-wrap items-center gap-1.5", children: [
|
|
2458
2461
|
k("recipes") && Y.map((q) => {
|
|
2459
|
-
var
|
|
2462
|
+
var oe, fe, ae;
|
|
2460
2463
|
return /* @__PURE__ */ c("span", { className: "group/recipe relative inline-flex", children: [
|
|
2461
2464
|
/* @__PURE__ */ a(
|
|
2462
2465
|
"button",
|
|
@@ -2467,7 +2470,7 @@ function Lu({
|
|
|
2467
2470
|
return Me.label === ((ie = q.config) == null ? void 0 : ie.transition_label);
|
|
2468
2471
|
}),
|
|
2469
2472
|
onClick: () => F(q),
|
|
2470
|
-
title: q.action_type === "update" ? `Set ${(
|
|
2473
|
+
title: q.action_type === "update" ? `Set ${(oe = q.config) == null ? void 0 : oe.field} = ${(fe = q.config) == null ? void 0 : fe.value}` : `Transition: ${(ae = q.config) == null ? void 0 : ae.transition_label}`,
|
|
2471
2474
|
className: "h-8 rounded-md border border-nvr-cyan/[0.33] bg-nvr-cyan/[0.08] px-3 text-[12.5px] font-medium text-[#7fe7ff] hover:bg-nvr-cyan/[0.13] disabled:opacity-40",
|
|
2472
2475
|
children: q.name
|
|
2473
2476
|
}
|
|
@@ -2490,33 +2493,33 @@ function Lu({
|
|
|
2490
2493
|
)
|
|
2491
2494
|
] }, q.id);
|
|
2492
2495
|
}),
|
|
2493
|
-
|
|
2496
|
+
i.length >= 2 && /* @__PURE__ */ a(
|
|
2494
2497
|
"button",
|
|
2495
2498
|
{
|
|
2496
2499
|
type: "button",
|
|
2497
2500
|
onClick: () => {
|
|
2498
|
-
const q =
|
|
2499
|
-
|
|
2501
|
+
const q = Nd(
|
|
2502
|
+
i.map((oe) => V.urlFor({ collection: n, itemId: String(oe) }))
|
|
2500
2503
|
);
|
|
2501
2504
|
q.blocked > 0 || q.capped > 0 ? we.warning(ks(q)) : we.success(ks(q));
|
|
2502
2505
|
},
|
|
2503
2506
|
"data-bulk-open-tabs": !0,
|
|
2504
|
-
title: `Open the selected records in new tabs (up to ${
|
|
2507
|
+
title: `Open the selected records in new tabs (up to ${_d})`,
|
|
2505
2508
|
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",
|
|
2506
2509
|
children: "Open in tabs"
|
|
2507
2510
|
}
|
|
2508
2511
|
),
|
|
2509
2512
|
k("compare") && /* @__PURE__ */ a(
|
|
2510
|
-
|
|
2513
|
+
sc,
|
|
2511
2514
|
{
|
|
2512
|
-
targets:
|
|
2513
|
-
fields:
|
|
2515
|
+
targets: i.map((q) => ({ collection: n, id: q })),
|
|
2516
|
+
fields: d,
|
|
2514
2517
|
relations: v,
|
|
2515
|
-
renderValue: (q,
|
|
2518
|
+
renderValue: (q, oe, fe, ae) => Du(n, q, oe, fe, ae),
|
|
2516
2519
|
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"
|
|
2517
2520
|
}
|
|
2518
2521
|
),
|
|
2519
|
-
k("merge") &&
|
|
2522
|
+
k("merge") && i.length === 2 && N.isAdmin && /* @__PURE__ */ a(
|
|
2520
2523
|
"button",
|
|
2521
2524
|
{
|
|
2522
2525
|
type: "button",
|
|
@@ -2527,9 +2530,9 @@ function Lu({
|
|
|
2527
2530
|
}
|
|
2528
2531
|
),
|
|
2529
2532
|
/* @__PURE__ */ a(
|
|
2530
|
-
|
|
2533
|
+
lc,
|
|
2531
2534
|
{
|
|
2532
|
-
targets:
|
|
2535
|
+
targets: i.map((q) => ({ collection: n, id: q })),
|
|
2533
2536
|
enabledKeys: _,
|
|
2534
2537
|
tone: "dark",
|
|
2535
2538
|
disabled: ce,
|
|
@@ -2539,14 +2542,14 @@ function Lu({
|
|
|
2539
2542
|
}
|
|
2540
2543
|
),
|
|
2541
2544
|
k("update-field") && /* @__PURE__ */ a(
|
|
2542
|
-
|
|
2545
|
+
oc,
|
|
2543
2546
|
{
|
|
2544
2547
|
collection: n,
|
|
2545
|
-
selectedIds:
|
|
2548
|
+
selectedIds: i,
|
|
2546
2549
|
disabled: ce,
|
|
2547
2550
|
onApply: Z,
|
|
2548
|
-
onSaveRecipe: (q,
|
|
2549
|
-
A(""), m({ action_type: "update", config: { field: q, value:
|
|
2551
|
+
onSaveRecipe: (q, oe) => {
|
|
2552
|
+
A(""), m({ action_type: "update", config: { field: q, value: oe } });
|
|
2550
2553
|
},
|
|
2551
2554
|
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 disabled:opacity-40"
|
|
2552
2555
|
}
|
|
@@ -2580,10 +2583,10 @@ function Lu({
|
|
|
2580
2583
|
)
|
|
2581
2584
|
] }),
|
|
2582
2585
|
M === "merge" && /* @__PURE__ */ a(
|
|
2583
|
-
|
|
2586
|
+
Fu,
|
|
2584
2587
|
{
|
|
2585
2588
|
collection: n,
|
|
2586
|
-
ids:
|
|
2589
|
+
ids: i.slice(0, 2),
|
|
2587
2590
|
onDone: (q) => {
|
|
2588
2591
|
qe(q), T(), $(), u("actions");
|
|
2589
2592
|
},
|
|
@@ -2591,10 +2594,10 @@ function Lu({
|
|
|
2591
2594
|
}
|
|
2592
2595
|
),
|
|
2593
2596
|
M === "message" && /* @__PURE__ */ a(
|
|
2594
|
-
|
|
2597
|
+
dc,
|
|
2595
2598
|
{
|
|
2596
2599
|
collection: n,
|
|
2597
|
-
selectedIds:
|
|
2600
|
+
selectedIds: i,
|
|
2598
2601
|
onDone: (q) => {
|
|
2599
2602
|
qe(q), u("actions");
|
|
2600
2603
|
},
|
|
@@ -2606,10 +2609,10 @@ function Lu({
|
|
|
2606
2609
|
{
|
|
2607
2610
|
className: "flex items-center gap-1.5",
|
|
2608
2611
|
onSubmit: (q) => {
|
|
2609
|
-
q.preventDefault(), ee && Ye(async (
|
|
2612
|
+
q.preventDefault(), ee && Ye(async (oe) => {
|
|
2610
2613
|
const fe = await C.request(
|
|
2611
|
-
ye(`/items/${n}/bulk-transition?progress=${
|
|
2612
|
-
ids:
|
|
2614
|
+
ye(`/items/${n}/bulk-transition?progress=${oe}`, {
|
|
2615
|
+
ids: i,
|
|
2613
2616
|
transition_id: ee
|
|
2614
2617
|
})
|
|
2615
2618
|
);
|
|
@@ -2618,7 +2621,7 @@ function Lu({
|
|
|
2618
2621
|
},
|
|
2619
2622
|
children: [
|
|
2620
2623
|
/* @__PURE__ */ a(
|
|
2621
|
-
|
|
2624
|
+
iu,
|
|
2622
2625
|
{
|
|
2623
2626
|
value: ee,
|
|
2624
2627
|
onChange: de,
|
|
@@ -2645,7 +2648,7 @@ function Lu({
|
|
|
2645
2648
|
type: "button",
|
|
2646
2649
|
disabled: !ee,
|
|
2647
2650
|
onClick: () => {
|
|
2648
|
-
const q = h.find((
|
|
2651
|
+
const q = h.find((oe) => oe.id === ee);
|
|
2649
2652
|
q && (A(""), m({ action_type: "transition", config: { transition_label: q.label } }));
|
|
2650
2653
|
},
|
|
2651
2654
|
title: "Save this transition as a reusable recipe",
|
|
@@ -2708,9 +2711,9 @@ function Lu({
|
|
|
2708
2711
|
M === "confirm-delete" && /* @__PURE__ */ c("span", { className: "flex items-center gap-2", children: [
|
|
2709
2712
|
/* @__PURE__ */ c("span", { className: "text-[12.5px] text-slate-300 dark:text-muted-foreground", children: [
|
|
2710
2713
|
"Delete ",
|
|
2711
|
-
|
|
2714
|
+
i.length,
|
|
2712
2715
|
" item",
|
|
2713
|
-
|
|
2716
|
+
i.length === 1 ? "" : "s",
|
|
2714
2717
|
"? Deleted records move to Trash for 30 days."
|
|
2715
2718
|
] }),
|
|
2716
2719
|
/* @__PURE__ */ a(
|
|
@@ -2719,7 +2722,7 @@ function Lu({
|
|
|
2719
2722
|
type: "button",
|
|
2720
2723
|
disabled: ce,
|
|
2721
2724
|
onClick: () => void Ye(async (q) => `Deleted ${(await C.request(
|
|
2722
|
-
ye(`/items/${n}/bulk-delete?progress=${q}`, { ids:
|
|
2725
|
+
ye(`/items/${n}/bulk-delete?progress=${q}`, { ids: i })
|
|
2723
2726
|
)).deleted} items`),
|
|
2724
2727
|
className: "h-8 rounded-md bg-red-600 px-3 text-[12.5px] font-medium hover:bg-red-700 disabled:opacity-50",
|
|
2725
2728
|
children: ce ? "Deleting…" : "Delete"
|
|
@@ -2739,7 +2742,7 @@ function Lu({
|
|
|
2739
2742
|
}
|
|
2740
2743
|
);
|
|
2741
2744
|
}
|
|
2742
|
-
const
|
|
2745
|
+
const Eu = {
|
|
2743
2746
|
state: "badge",
|
|
2744
2747
|
entered: "date",
|
|
2745
2748
|
aging: "short",
|
|
@@ -2751,11 +2754,11 @@ const Fu = {
|
|
|
2751
2754
|
tasks: "short",
|
|
2752
2755
|
addendums: "short"
|
|
2753
2756
|
};
|
|
2754
|
-
function
|
|
2757
|
+
function y0({
|
|
2755
2758
|
collection: n,
|
|
2756
|
-
quickFilters:
|
|
2759
|
+
quickFilters: i = [],
|
|
2757
2760
|
initialColumns: h,
|
|
2758
|
-
initialSort:
|
|
2761
|
+
initialSort: d,
|
|
2759
2762
|
pageSize: v = 25,
|
|
2760
2763
|
initialSearch: _ = "",
|
|
2761
2764
|
initialFilters: $,
|
|
@@ -2768,11 +2771,11 @@ function x0({
|
|
|
2768
2771
|
}) {
|
|
2769
2772
|
var Gl, Xl, Zl, es, ts, ns, as, rs, ls, ss, os;
|
|
2770
2773
|
const u = vt(), k = qa(), { open: Y, urlFor: L } = Is(), [m] = y(
|
|
2771
|
-
() =>
|
|
2774
|
+
() => od(id(`cbv:${n}`))
|
|
2772
2775
|
), [E] = y(
|
|
2773
2776
|
() => m ? _s(m.f ?? []) : null
|
|
2774
2777
|
), [A] = y(
|
|
2775
|
-
() => m ? null :
|
|
2778
|
+
() => m ? null : cd(`cbv:${n}`)
|
|
2776
2779
|
), [I, F] = y((m == null ? void 0 : m.p) ?? A ?? 1), ee = he(A);
|
|
2777
2780
|
me(() => {
|
|
2778
2781
|
const e = vs(ee.current, I);
|
|
@@ -2780,17 +2783,17 @@ function x0({
|
|
|
2780
2783
|
F(e);
|
|
2781
2784
|
return;
|
|
2782
2785
|
}
|
|
2783
|
-
|
|
2786
|
+
ud(`cbv:${n}`, I);
|
|
2784
2787
|
}, [n, I]);
|
|
2785
|
-
const de = he(
|
|
2788
|
+
const de = he(Gi()), [ce, Ie] = y(m ? m.q ?? "" : _), X = hs(ce.trim(), 350), [qe, Ye] = y(
|
|
2786
2789
|
E ? E.filters : $ ?? []
|
|
2787
|
-
), [Z, q] = y(m ? m.s ?? "" :
|
|
2790
|
+
), [Z, q] = y(m ? m.s ?? "" : d ?? ""), [oe, fe] = y(h ?? null), [ae, Me] = y({}), [ie, w] = y({}), [be, re] = y(null), [Ce, ut] = y({}), [ln, Ht] = y({}), [Ot, Q] = y({}), [et, tt] = y({}), [Nn, Be] = y(null), [Yt, At] = y(!1), sn = he(null), [Sn, nt] = y(
|
|
2788
2791
|
() => (m == null ? void 0 : m.qf) ?? {}
|
|
2789
2792
|
), [pt, Ft] = y(
|
|
2790
2793
|
() => (m == null ? void 0 : m.qf) ?? {}
|
|
2791
2794
|
), [_t, on] = y(
|
|
2792
2795
|
m ? m.lc ?? [] : T ?? []
|
|
2793
|
-
), { scopes: Nt, ready: Cn } =
|
|
2796
|
+
), { scopes: Nt, ready: Cn } = Qd(), [We, Rt] = y(!1), [$n, Yn] = y(/* @__PURE__ */ new Set()), [ze, It] = y(
|
|
2794
2797
|
() => (m == null ? void 0 : m.cf) ?? {}
|
|
2795
2798
|
), mt = wi("drill.browser"), at = mt.value, [qn, dn] = y(null), [cn, Jt] = y(!1), [Gt, Jn] = y(() => {
|
|
2796
2799
|
try {
|
|
@@ -2839,14 +2842,14 @@ function x0({
|
|
|
2839
2842
|
me(() => {
|
|
2840
2843
|
!C || Dr.current || (Dr.current = !0, J(!0), Oe(C), Kt.mutate(C));
|
|
2841
2844
|
}, [C]);
|
|
2842
|
-
const [
|
|
2845
|
+
const [se, jt] = y(null), [Rn, Pr] = y(() => (m == null ? void 0 : m.ex) ?? []);
|
|
2843
2846
|
me(() => {
|
|
2844
|
-
if (!
|
|
2847
|
+
if (!se) return;
|
|
2845
2848
|
const e = () => jt(null);
|
|
2846
2849
|
return window.addEventListener("mousedown", e), window.addEventListener("scroll", e, !0), window.addEventListener("keydown", e), () => {
|
|
2847
2850
|
window.removeEventListener("mousedown", e), window.removeEventListener("scroll", e, !0), window.removeEventListener("keydown", e);
|
|
2848
2851
|
};
|
|
2849
|
-
}, [
|
|
2852
|
+
}, [se]);
|
|
2850
2853
|
const [Zt, en] = y([]);
|
|
2851
2854
|
$i();
|
|
2852
2855
|
const [Bt, En] = y(null), [Hs, La] = y(!1), [tn, Fa] = y(""), [Ra, Mr] = y(!1), [Ys, Or] = y(!1), [Ea, mn] = y(!1), Ar = he(null);
|
|
@@ -2860,7 +2863,7 @@ function x0({
|
|
|
2860
2863
|
}, [Ea]);
|
|
2861
2864
|
const Ir = he(null), Kr = he(null), jr = !m && ((T == null ? void 0 : T.length) ?? 0) > 0, Da = he(!!m || jr), { isAdmin: Et } = Na(), Br = he(n);
|
|
2862
2865
|
me(() => {
|
|
2863
|
-
Br.current !== n && (Br.current = n, F(1), Ie(_), Ye([]), q(
|
|
2866
|
+
Br.current !== n && (Br.current = n, F(1), Ie(_), Ye([]), q(d ?? ""), fe(h ?? null), Me({}), w({}), ut({}), Ht({}), en([]), En(null), nt({}), Ft({}), It({}), on([]), at != null && at.length && mt.back(at.length), dn(null), Da.current = !1);
|
|
2864
2867
|
}, [n]), me(() => {
|
|
2865
2868
|
if (!cn) return;
|
|
2866
2869
|
const e = (t) => {
|
|
@@ -2883,16 +2886,16 @@ function x0({
|
|
|
2883
2886
|
retry: !1
|
|
2884
2887
|
}), St = ke(() => ((O == null ? void 0 : O.fields) ?? []).filter((e) => !e.hidden), [O]), Ee = (O == null ? void 0 : O.browser_config) ?? {}, Le = (Gl = Ee.fulfilment) != null && Gl.shipped_field && ((Xl = Ee.fulfilment) != null && Xl.requested_field) ? Ee.fulfilment : null, zr = he(!!m);
|
|
2885
2888
|
me(() => {
|
|
2886
|
-
zr.current || !O || (zr.current = !0, !
|
|
2889
|
+
zr.current || !O || (zr.current = !0, !d && !Z && Ee.default_sort && q(Ee.default_sort));
|
|
2887
2890
|
}, [O]);
|
|
2888
2891
|
const Ct = Ee.checkbox_selection !== !1, Qr = Ee.show_actions !== !1, [ft, Js] = y(!1), Gs = () => {
|
|
2889
2892
|
ft && en([]), Js(!ft);
|
|
2890
|
-
}, Zn = V && Ee.allow_create !== !1, Ur = typeof Ee.create_label == "string" && Ee.create_label.trim().slice(0, 40) || "New item", ea =
|
|
2893
|
+
}, Zn = V && Ee.allow_create !== !1, Ur = typeof Ee.create_label == "string" && Ee.create_label.trim().slice(0, 40) || "New item", ea = Vd(Zn && !(O != null && O.singleton) ? n : null), [Pa, Dn] = y(!1), [Ma, ta] = y(null), { steps: Oa } = zc(
|
|
2891
2894
|
Zn && !(O != null && O.singleton) ? n : null,
|
|
2892
2895
|
null
|
|
2893
2896
|
), Wr = (e) => {
|
|
2894
2897
|
e ? Y({ collection: n, itemId: "new", layoutSlug: e }) : rn("new");
|
|
2895
|
-
}, Pn =
|
|
2898
|
+
}, Pn = Kc(Zn && !(O != null && O.singleton) ? n : null), Xs = _i(), Vr = he(null), [Zs, eo] = y(null), [Hr, Yr] = y(!1), Jr = (e) => {
|
|
2896
2899
|
var t;
|
|
2897
2900
|
eo(e), (t = Vr.current) == null || t.click();
|
|
2898
2901
|
}, to = async (e) => {
|
|
@@ -2900,10 +2903,10 @@ function x0({
|
|
|
2900
2903
|
if (e.target.value = "", !!t.length) {
|
|
2901
2904
|
Yr(!0);
|
|
2902
2905
|
try {
|
|
2903
|
-
const r = await
|
|
2906
|
+
const r = await jc(Xs, t, n);
|
|
2904
2907
|
Y({ collection: n, itemId: "new", layoutSlug: Zs, query: { autofill: r } });
|
|
2905
2908
|
} catch (r) {
|
|
2906
|
-
|
|
2909
|
+
Qi(r, "The document could not be read", { action: "New from document" });
|
|
2907
2910
|
} finally {
|
|
2908
2911
|
Yr(!1);
|
|
2909
2912
|
}
|
|
@@ -2917,9 +2920,9 @@ function x0({
|
|
|
2917
2920
|
};
|
|
2918
2921
|
return window.addEventListener("mousedown", e), () => window.removeEventListener("mousedown", e);
|
|
2919
2922
|
}, [Pa]);
|
|
2920
|
-
const Ve = m != null && m.ps ? m.ps : Ee.page_size && Ee.page_size > 0 ? Math.min(Ee.page_size, 200) : v, $t =
|
|
2923
|
+
const Ve = m != null && m.ps ? m.ps : Ee.page_size && Ee.page_size > 0 ? Math.min(Ee.page_size, 200) : v, $t = i.length > 0 ? i : Ee.quick_filters ?? [];
|
|
2921
2924
|
me(() => {
|
|
2922
|
-
if (We || !Cn ||
|
|
2925
|
+
if (We || !Cn || i.length === 0 && !O) return;
|
|
2923
2926
|
const e = Nt, t = Object.values((e == null ? void 0 : e.defaults) ?? {}).some((r) => r.length > 0) || Object.values((e == null ? void 0 : e.restricted) ?? {}).some((r) => r.length > 0);
|
|
2924
2927
|
if (!e || $t.length === 0 || !t || m || jr) {
|
|
2925
2928
|
Rt(!0);
|
|
@@ -2930,9 +2933,9 @@ function x0({
|
|
|
2930
2933
|
for (const l of $t) {
|
|
2931
2934
|
const s = ws(e, { key: l.key, collection: l.collection });
|
|
2932
2935
|
if (!s) continue;
|
|
2933
|
-
const o =
|
|
2936
|
+
const o = Ud(e, s.name);
|
|
2934
2937
|
if (o.length === 0) continue;
|
|
2935
|
-
const f = await
|
|
2938
|
+
const f = await Wd(u, s, o, l.value_field).catch(
|
|
2936
2939
|
() => []
|
|
2937
2940
|
);
|
|
2938
2941
|
f.length > 0 && (r[l.key] = f);
|
|
@@ -2953,17 +2956,17 @@ function x0({
|
|
|
2953
2956
|
const Xr = (e) => {
|
|
2954
2957
|
const t = ws(Nt, { key: e.key, collection: e.collection }), r = t ? (Nt == null ? void 0 : Nt.restricted[t.name]) ?? [] : [];
|
|
2955
2958
|
return r.length > 0 ? r : void 0;
|
|
2956
|
-
}, bt = ke(() => new Map(St.map((e) => [e.field, e])), [St]), He = (O == null ? void 0 : O.relations) ?? [], Zr = ke(() =>
|
|
2959
|
+
}, bt = ke(() => new Map(St.map((e) => [e.field, e])), [St]), He = (O == null ? void 0 : O.relations) ?? [], Zr = ke(() => nd(Ee.inline_edit), [Ee.inline_edit]), { data: ao } = te({
|
|
2957
2960
|
queryKey: ["my-permissions"],
|
|
2958
2961
|
queryFn: () => u.request(G("/security/my/permissions")).then((e) => e.data),
|
|
2959
2962
|
enabled: Zr.enabled && !Et,
|
|
2960
2963
|
staleTime: 5 * 6e4
|
|
2961
|
-
}), ro = Et ||
|
|
2964
|
+
}), ro = Et || hu(ao, n), el = ke(
|
|
2962
2965
|
() => new Map(((O == null ? void 0 : O.fields) ?? []).map((e) => [e.field, e])),
|
|
2963
2966
|
[O]
|
|
2964
|
-
), tl =
|
|
2967
|
+
), tl = Yc(), nl = (e) => (
|
|
2965
2968
|
// Ask-the-table answers are a one-off overlay, not the list's own rows.
|
|
2966
|
-
ne ? null :
|
|
2969
|
+
ne ? null : ld({
|
|
2967
2970
|
config: Zr,
|
|
2968
2971
|
key: e,
|
|
2969
2972
|
field: el.get(e),
|
|
@@ -2972,7 +2975,7 @@ function x0({
|
|
|
2972
2975
|
mayUpdate: ro
|
|
2973
2976
|
})
|
|
2974
2977
|
), lo = (e, t, r, l, s) => {
|
|
2975
|
-
const o = e.id, f = s === 0 ? null :
|
|
2978
|
+
const o = e.id, f = s === 0 ? null : sd(
|
|
2976
2979
|
ge.filter((g) => !!nl(g)),
|
|
2977
2980
|
t,
|
|
2978
2981
|
s
|
|
@@ -3006,28 +3009,28 @@ function x0({
|
|
|
3006
3009
|
if (!s) return l;
|
|
3007
3010
|
const o = el.get(t);
|
|
3008
3011
|
return /* @__PURE__ */ a(
|
|
3009
|
-
|
|
3012
|
+
Jc,
|
|
3010
3013
|
{
|
|
3011
3014
|
controller: tl,
|
|
3012
3015
|
cellKey: `${String(e.id)}|${t}`,
|
|
3013
3016
|
kind: s,
|
|
3014
3017
|
value: e[t],
|
|
3015
3018
|
label: Je(t),
|
|
3016
|
-
choices: o ?
|
|
3017
|
-
target: s === "m2o" ?
|
|
3019
|
+
choices: o ? rd(o) : void 0,
|
|
3020
|
+
target: s === "m2o" ? ad(He, n, t) : null,
|
|
3018
3021
|
onCommit: (f, g) => lo(e, t, s, f, g),
|
|
3019
3022
|
children: l
|
|
3020
3023
|
}
|
|
3021
3024
|
);
|
|
3022
|
-
}, ge = ke(() => (
|
|
3025
|
+
}, ge = ke(() => (oe ?? St.slice(0, 7).map((t) => t.field)).filter(
|
|
3023
3026
|
(t) => t.includes(".") || bt.has(t) || t.startsWith("__f:") && !!ie[t]
|
|
3024
|
-
), [
|
|
3027
|
+
), [oe, St, bt, ie]), [Ia, na] = y(null), Mn = ke(
|
|
3025
3028
|
() => Ia ?? (ge[0] ? { [ge[0]]: "left" } : {}),
|
|
3026
3029
|
[Ia, ge]
|
|
3027
3030
|
), kt = (e) => Mn[e], oo = (e) => {
|
|
3028
3031
|
const t = { ...Mn }, r = t[e];
|
|
3029
3032
|
r ? r === "left" ? t[e] = "right" : delete t[e] : t[e] = "left", na(t);
|
|
3030
|
-
}, Je = (e) =>
|
|
3033
|
+
}, Je = (e) => ae[e] ?? (e.startsWith("__f:") ? ie[e] ?? "Formula" : e.includes(".") ? e.split(".").map(Ae).join(" › ") : e === "id" ? "ID" : Ae(e)), al = (e, t) => {
|
|
3031
3034
|
var l, s, o;
|
|
3032
3035
|
const r = t.includes(".") ? (o = (s = (l = $e == null ? void 0 : $e.rows) == null ? void 0 : l[String(e.id)]) == null ? void 0 : s[t]) == null ? void 0 : o.value : e[t];
|
|
3033
3036
|
return typeof r == "string" && /^-?\d+(\.\d+)?$/.test(r.trim()) ? Number(r) : r;
|
|
@@ -3115,7 +3118,7 @@ function x0({
|
|
|
3115
3118
|
s != null && s.one_collection && (e[t.field] = { kind: "m2m", target: s.one_collection });
|
|
3116
3119
|
}
|
|
3117
3120
|
return e;
|
|
3118
|
-
}, [zt, nn]), Ba = hs(ze, 350), [fn, uo] = y((m == null ? void 0 : m.a) === !0), [il, po] = y(null), On =
|
|
3121
|
+
}, [zt, nn]), Ba = hs(ze, 350), [fn, uo] = y((m == null ? void 0 : m.a) === !0), [il, po] = y(null), On = Nc(n, il), [yt, dl] = y(null), { data: An } = fc(n), [qt, aa] = y(() => (E == null ? void 0 : E.riskIds) ?? []), Ne = ke(() => {
|
|
3119
3122
|
var t;
|
|
3120
3123
|
const e = Ds(qe);
|
|
3121
3124
|
for (const r of $t) {
|
|
@@ -3154,7 +3157,7 @@ function x0({
|
|
|
3154
3157
|
e.push({ path: [r], op: l.op, value: Number(l.value) });
|
|
3155
3158
|
else if (l.kind === "bool") e.push({ path: [r], op: "_eq", value: l.value === "true" });
|
|
3156
3159
|
else if (l.kind === "date" && l.value) {
|
|
3157
|
-
const s = Sa(l.value), f = (s ?
|
|
3160
|
+
const s = Sa(l.value), f = (s ? Ai(s) : null) ?? Us(l.value);
|
|
3158
3161
|
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` }));
|
|
3159
3162
|
}
|
|
3160
3163
|
}
|
|
@@ -3216,7 +3219,7 @@ function x0({
|
|
|
3216
3219
|
Ve,
|
|
3217
3220
|
Ne,
|
|
3218
3221
|
In
|
|
3219
|
-
]), s = de.current, o =
|
|
3222
|
+
]), s = de.current, o = Xi(s, l, e, Z);
|
|
3220
3223
|
if (o.after === void 0 && o.sort === Z) return r(e);
|
|
3221
3224
|
try {
|
|
3222
3225
|
const f = await u.request(
|
|
@@ -3226,10 +3229,10 @@ function x0({
|
|
|
3226
3229
|
...o.sort ? { sort: o.sort } : {}
|
|
3227
3230
|
})
|
|
3228
3231
|
);
|
|
3229
|
-
return o.after !== void 0 &&
|
|
3232
|
+
return o.after !== void 0 && Zi(s, l, e, f.next_cursor), f;
|
|
3230
3233
|
} catch (f) {
|
|
3231
|
-
if (!
|
|
3232
|
-
return
|
|
3234
|
+
if (!ed(f)) throw f;
|
|
3235
|
+
return td(s, l), r(e);
|
|
3233
3236
|
}
|
|
3234
3237
|
}, {
|
|
3235
3238
|
data: xe,
|
|
@@ -3249,13 +3252,13 @@ function x0({
|
|
|
3249
3252
|
retry: !1
|
|
3250
3253
|
}), bl = he(() => {
|
|
3251
3254
|
});
|
|
3252
|
-
|
|
3255
|
+
Cd({
|
|
3253
3256
|
qc: k,
|
|
3254
3257
|
enabled: !!n && We && !ue && !X && !ht && !!xe && I * Ve < (xe.total ?? 0),
|
|
3255
3258
|
queryKey: ml(I + 1),
|
|
3256
3259
|
queryFn: () => fl(I + 1).then((e) => (bl.current(e.data ?? []), e))
|
|
3257
3260
|
}), me(() => {
|
|
3258
|
-
const e =
|
|
3261
|
+
const e = pd({
|
|
3259
3262
|
pending: ee.current,
|
|
3260
3263
|
gateOpen: We,
|
|
3261
3264
|
fetching: ht,
|
|
@@ -3318,7 +3321,7 @@ function x0({
|
|
|
3318
3321
|
const e = `${n}\0${X}`;
|
|
3319
3322
|
((t = ia.current) == null ? void 0 : t.key) !== e && (ia.current = {
|
|
3320
3323
|
key: e,
|
|
3321
|
-
id:
|
|
3324
|
+
id: Id(u, {
|
|
3322
3325
|
surface: "collection",
|
|
3323
3326
|
collection: n,
|
|
3324
3327
|
query: X,
|
|
@@ -3326,7 +3329,7 @@ function x0({
|
|
|
3326
3329
|
duration_ms: Date.now() - gl.current
|
|
3327
3330
|
})
|
|
3328
3331
|
});
|
|
3329
|
-
}, [u, n, X, xe, ht, ne]),
|
|
3332
|
+
}, [u, n, X, xe, ht, ne]), Xd(
|
|
3330
3333
|
n ? {
|
|
3331
3334
|
list: {
|
|
3332
3335
|
collection: n,
|
|
@@ -3343,18 +3346,18 @@ function x0({
|
|
|
3343
3346
|
}
|
|
3344
3347
|
} : null
|
|
3345
3348
|
);
|
|
3346
|
-
const ho =
|
|
3349
|
+
const ho = Zd(), xl = Ni(ht), Ha = Si({
|
|
3347
3350
|
pending: ht,
|
|
3348
3351
|
request: n ? { method: "GET", url: `/items/${n}` } : null,
|
|
3349
3352
|
noun: ((O == null ? void 0 : O.display_name) ?? n ?? "").replace(/_/g, " ").toLowerCase() || null,
|
|
3350
3353
|
// Only a total this person has already been shown (never a raw table count).
|
|
3351
|
-
knownRows: ht ?
|
|
3352
|
-
}), Ya =
|
|
3354
|
+
knownRows: ht ? Bd(k.getQueriesData({ queryKey: ["cbv-items", n] })) : null
|
|
3355
|
+
}), Ya = Rd(), { userId: Ja } = Na(), Tt = fd(), Ga = he(/* @__PURE__ */ new Set());
|
|
3353
3356
|
Ga.current = new Set(Se.map((e) => String(e.id)));
|
|
3354
3357
|
const go = ke(
|
|
3355
3358
|
() => Se.slice(0, 100).map((e) => ({ collection: n, item: String(e.id) })),
|
|
3356
3359
|
[Se, n]
|
|
3357
|
-
), vl =
|
|
3360
|
+
), vl = Td(go), kl = he([]);
|
|
3358
3361
|
kl.current = [
|
|
3359
3362
|
"cbv-items",
|
|
3360
3363
|
n,
|
|
@@ -3409,16 +3412,16 @@ function x0({
|
|
|
3409
3412
|
H = !0;
|
|
3410
3413
|
continue;
|
|
3411
3414
|
}
|
|
3412
|
-
const
|
|
3415
|
+
const le = U.get(ve), S = (le == null ? void 0 : le.action) === "delete" || W.action === "delete" ? "delete" : (le == null ? void 0 : le.action) === "create" ? "create" : W.action, j = /* @__PURE__ */ new Set([...(le == null ? void 0 : le.changed_fields) ?? [], ...W.changed_fields ?? []]);
|
|
3413
3416
|
U.set(ve, {
|
|
3414
3417
|
...W,
|
|
3415
3418
|
action: S,
|
|
3416
|
-
changed_fields: W.changed_fields ||
|
|
3419
|
+
changed_fields: W.changed_fields || le != null && le.changed_fields ? [...j] : void 0
|
|
3417
3420
|
});
|
|
3418
3421
|
}
|
|
3419
3422
|
H && e();
|
|
3420
|
-
const p = Ga.current, dt = (W) =>
|
|
3421
|
-
const ve =
|
|
3423
|
+
const p = Ga.current, dt = (W) => Sd(n, W.item), Xe = (W) => {
|
|
3424
|
+
const ve = kd(W);
|
|
3422
3425
|
return ve && Ja && ve.toUpperCase() === Ja.toUpperCase() ? "self" : ve;
|
|
3423
3426
|
}, Lt = [];
|
|
3424
3427
|
for (const [W, ve] of U)
|
|
@@ -3426,7 +3429,7 @@ function x0({
|
|
|
3426
3429
|
if (Lt.length > 0) {
|
|
3427
3430
|
const W = new Set(Lt);
|
|
3428
3431
|
s((ve) => ({
|
|
3429
|
-
data: ve.data.filter((
|
|
3432
|
+
data: ve.data.filter((le) => !W.has(String(le.id))),
|
|
3430
3433
|
total: Math.max(0, ve.total - Lt.length)
|
|
3431
3434
|
})), Tt.forget(Lt);
|
|
3432
3435
|
}
|
|
@@ -3434,7 +3437,7 @@ function x0({
|
|
|
3434
3437
|
const ot = yl.current;
|
|
3435
3438
|
let Ut;
|
|
3436
3439
|
try {
|
|
3437
|
-
Ut = await
|
|
3440
|
+
Ut = await gd(
|
|
3438
3441
|
u,
|
|
3439
3442
|
n,
|
|
3440
3443
|
[...U.keys()],
|
|
@@ -3447,8 +3450,8 @@ function x0({
|
|
|
3447
3450
|
e();
|
|
3448
3451
|
continue;
|
|
3449
3452
|
}
|
|
3450
|
-
u.request(G(`/items/${n}/${W}`)).then((
|
|
3451
|
-
const S =
|
|
3453
|
+
u.request(G(`/items/${n}/${W}`)).then((le) => {
|
|
3454
|
+
const S = le == null ? void 0 : le.data;
|
|
3452
3455
|
S && (s((j) => ({
|
|
3453
3456
|
...j,
|
|
3454
3457
|
data: j.data.map((_e) => String(_e.id) === W ? { ..._e, ...S } : _e)
|
|
@@ -3458,35 +3461,35 @@ function x0({
|
|
|
3458
3461
|
return;
|
|
3459
3462
|
}
|
|
3460
3463
|
if (x) return;
|
|
3461
|
-
const vn =
|
|
3464
|
+
const vn = xd(ot.conditions), kn = ot.page === 1 && !ot.grouped, it = /* @__PURE__ */ new Map(), P = [], Ze = [];
|
|
3462
3465
|
for (const [W, ve] of U) {
|
|
3463
|
-
const
|
|
3464
|
-
p.has(W) ?
|
|
3466
|
+
const le = Ut.get(W);
|
|
3467
|
+
p.has(W) ? le ? it.set(W, le) : P.push(W) : le && ((ve.action === "create" || !!ot.conditions && vd(ve, vn)) && kn ? Ze.push({ row: le, ev: ve }) : e());
|
|
3465
3468
|
}
|
|
3466
3469
|
if (it.size > 0 || P.length > 0 || Ze.length > 0) {
|
|
3467
3470
|
const W = new Set(P);
|
|
3468
3471
|
s((ve) => {
|
|
3469
|
-
const
|
|
3472
|
+
const le = ve.data.filter((S) => !W.has(String(S.id))).map((S) => {
|
|
3470
3473
|
const j = it.get(String(S.id));
|
|
3471
3474
|
return j ? { ...S, ...j } : S;
|
|
3472
3475
|
});
|
|
3473
3476
|
return {
|
|
3474
|
-
data: [...Ze.map((S) => S.row), ...
|
|
3477
|
+
data: [...Ze.map((S) => S.row), ...le],
|
|
3475
3478
|
total: Math.max(0, ve.total - P.length + Ze.length)
|
|
3476
3479
|
};
|
|
3477
3480
|
});
|
|
3478
3481
|
}
|
|
3479
3482
|
P.length > 0 && Tt.forget(P);
|
|
3480
3483
|
for (const [W] of it) {
|
|
3481
|
-
const ve = U.get(W),
|
|
3482
|
-
ve && !dt(ve) &&
|
|
3484
|
+
const ve = U.get(W), le = Xe(it.get(W));
|
|
3485
|
+
ve && !dt(ve) && le !== "self" && Tt.note([W], le);
|
|
3483
3486
|
}
|
|
3484
3487
|
for (const { row: W, ev: ve } of Ze) {
|
|
3485
|
-
const
|
|
3486
|
-
Xe(W) !== "self" && Tt.note([
|
|
3488
|
+
const le = String(W.id);
|
|
3489
|
+
Xe(W) !== "self" && Tt.note([le], Xe(W), "create");
|
|
3487
3490
|
}
|
|
3488
3491
|
}, K = (D) => {
|
|
3489
|
-
for (const U of D.flatMap((H) =>
|
|
3492
|
+
for (const U of D.flatMap((H) => md(H))) {
|
|
3490
3493
|
const H = U.changed_fields;
|
|
3491
3494
|
if (!U.action && (H != null && H.length) && H.every((p) => p.startsWith("$"))) {
|
|
3492
3495
|
(String(U.item) === "*" || Ga.current.has(String(U.item))) && l(H);
|
|
@@ -3497,13 +3500,13 @@ function x0({
|
|
|
3497
3500
|
o.length > 0 && !f && (f = setTimeout(() => void z(), 300));
|
|
3498
3501
|
}, Te = Ya.subscribeCollections(
|
|
3499
3502
|
[n],
|
|
3500
|
-
(D) =>
|
|
3503
|
+
(D) => Hi(Xa, [D], K)
|
|
3501
3504
|
);
|
|
3502
3505
|
return () => {
|
|
3503
|
-
x = !0, Te(),
|
|
3506
|
+
x = !0, Te(), Yi(Xa), r && clearTimeout(r), f && clearTimeout(f), g && clearTimeout(g);
|
|
3504
3507
|
};
|
|
3505
3508
|
}, [Ya, n, k, u, Ja, Tt, Xa]);
|
|
3506
|
-
const ko =
|
|
3509
|
+
const ko = bd(
|
|
3507
3510
|
n,
|
|
3508
3511
|
Se.map((e) => String(e.id)),
|
|
3509
3512
|
xo
|
|
@@ -3531,7 +3534,7 @@ function x0({
|
|
|
3531
3534
|
}), Ke = Se.map((e) => String(e.id)).join(","), _o = ke(
|
|
3532
3535
|
() => Se.map((e) => ({ collection: n, id: e.id })),
|
|
3533
3536
|
[Se, n]
|
|
3534
|
-
), No =
|
|
3537
|
+
), No = Xc(_o, Et), tr = !!(O != null && O.addendums_enabled), { data: nr } = te({
|
|
3535
3538
|
queryKey: ["cbv-addendum-summary", n, Ke],
|
|
3536
3539
|
queryFn: () => u.request(
|
|
3537
3540
|
ye("/addendums/summary", { collection: n, ids: Ke.split(",") })
|
|
@@ -3606,7 +3609,7 @@ function x0({
|
|
|
3606
3609
|
() => ge.filter((e) => e.includes(".")),
|
|
3607
3610
|
[ge]
|
|
3608
3611
|
), Sl = ke(
|
|
3609
|
-
() => ge.filter((e) => e.startsWith("__f:")).flatMap((e) =>
|
|
3612
|
+
() => ge.filter((e) => e.startsWith("__f:")).flatMap((e) => Ui(ie[e] ?? "")).filter((e) => e.includes(".")),
|
|
3610
3613
|
[ge, ie]
|
|
3611
3614
|
), jn = ke(
|
|
3612
3615
|
() => [.../* @__PURE__ */ new Set([...Nl, ...Object.values(Qe), ...Sl])].slice(
|
|
@@ -3652,7 +3655,7 @@ function x0({
|
|
|
3652
3655
|
isResolvedCol: Pt,
|
|
3653
3656
|
fetchResolved: $l,
|
|
3654
3657
|
fetchRelation: (t, r) => Bs(u, t, r),
|
|
3655
|
-
userCardQuery: (t) =>
|
|
3658
|
+
userCardQuery: (t) => Yd(u, t)
|
|
3656
3659
|
});
|
|
3657
3660
|
const hn = (e) => {
|
|
3658
3661
|
if (e.includes(".")) return { kind: "text", path: e.split(".") };
|
|
@@ -3746,7 +3749,7 @@ function x0({
|
|
|
3746
3749
|
f.add(z);
|
|
3747
3750
|
else x[e] != null && x[e] !== "" && typeof x[e] != "object" && f.add(x[e]);
|
|
3748
3751
|
return /* @__PURE__ */ a(
|
|
3749
|
-
|
|
3752
|
+
vu,
|
|
3750
3753
|
{
|
|
3751
3754
|
target: t.target,
|
|
3752
3755
|
selected: (r == null ? void 0 : r.kind) === "in" ? r.value : [],
|
|
@@ -3757,7 +3760,7 @@ function x0({
|
|
|
3757
3760
|
}
|
|
3758
3761
|
if (t.kind === "enum")
|
|
3759
3762
|
return /* @__PURE__ */ a(
|
|
3760
|
-
|
|
3763
|
+
ku,
|
|
3761
3764
|
{
|
|
3762
3765
|
collection: n,
|
|
3763
3766
|
field: e,
|
|
@@ -3817,7 +3820,7 @@ function x0({
|
|
|
3817
3820
|
className: "w-full"
|
|
3818
3821
|
}
|
|
3819
3822
|
) : t.kind === "date" ? /* @__PURE__ */ a(
|
|
3820
|
-
|
|
3823
|
+
yu,
|
|
3821
3824
|
{
|
|
3822
3825
|
value: (r == null ? void 0 : r.kind) === "date" ? r.value : "",
|
|
3823
3826
|
onChange: (f) => je(e, f ? { kind: "date", value: f } : null)
|
|
@@ -3838,7 +3841,7 @@ function x0({
|
|
|
3838
3841
|
var s, o, f;
|
|
3839
3842
|
const l = Ce[t];
|
|
3840
3843
|
if ((l == null ? void 0 : l.type) === "count") {
|
|
3841
|
-
const g = t.includes(".") ? t : Qe[t], x = r != null && g ? (f = (o = (s = $e == null ? void 0 : $e.rows) == null ? void 0 : s[String(r)]) == null ? void 0 : o[g]) == null ? void 0 : f.ids : void 0, z =
|
|
3844
|
+
const g = t.includes(".") ? t : Qe[t], x = r != null && g ? (f = (o = (s = $e == null ? void 0 : $e.rows) == null ? void 0 : s[String(r)]) == null ? void 0 : o[g]) == null ? void 0 : f.ids : void 0, z = Ji(e === "—" ? "" : e, x);
|
|
3842
3845
|
return String(z);
|
|
3843
3846
|
}
|
|
3844
3847
|
return l && e && e !== "—" ? xs(e, l) : e;
|
|
@@ -3901,14 +3904,14 @@ function x0({
|
|
|
3901
3904
|
ua(e);
|
|
3902
3905
|
return;
|
|
3903
3906
|
}
|
|
3904
|
-
En(null), Ye([]), aa([]), q(
|
|
3907
|
+
En(null), Ye([]), aa([]), q(d ?? ""), fe(h ?? null), Me({}), w({}), ut({}), Ht({}), na(null), F(1);
|
|
3905
3908
|
}, Bn = () => ({
|
|
3906
3909
|
// The pressed highlight pills ride along as one `$at_risk` filter entry.
|
|
3907
|
-
filters: [...qe, ...[
|
|
3910
|
+
filters: [...qe, ...[qc(qt, da)].filter((e) => e !== null)],
|
|
3908
3911
|
sort: Z,
|
|
3909
3912
|
columns: [
|
|
3910
3913
|
...ge.map((e, t) => {
|
|
3911
|
-
const r =
|
|
3914
|
+
const r = ae[e], l = Ce[e], s = Mn[e] ?? (t === 0 && Ia !== null ? "none" : void 0), o = et[e], f = Ot[e], g = ln[e], x = ie[e];
|
|
3912
3915
|
return !r && !l && !s && !(o != null && o.length) && !f && !g && !x && !Ll.has(e) ? e : {
|
|
3913
3916
|
key: e,
|
|
3914
3917
|
...x ? { formula: x } : {},
|
|
@@ -3981,7 +3984,7 @@ function x0({
|
|
|
3981
3984
|
columns: m.c
|
|
3982
3985
|
}), En(null), F(m.p ?? 1)));
|
|
3983
3986
|
}, [St]), me(() => {
|
|
3984
|
-
m &&
|
|
3987
|
+
m && dd();
|
|
3985
3988
|
}, []);
|
|
3986
3989
|
const Ao = () => {
|
|
3987
3990
|
const e = Bn();
|
|
@@ -4062,13 +4065,13 @@ function x0({
|
|
|
4062
4065
|
if (!Ra) {
|
|
4063
4066
|
Mr(!0);
|
|
4064
4067
|
try {
|
|
4065
|
-
const { rows: r, truncated: l } = await
|
|
4068
|
+
const { rows: r, truncated: l } = await hc(
|
|
4066
4069
|
(S, j) => u.request(
|
|
4067
4070
|
G(`/items/${n}`, {
|
|
4068
4071
|
limit: j,
|
|
4069
4072
|
offset: S,
|
|
4070
4073
|
...X ? { search: X } : {},
|
|
4071
|
-
sort:
|
|
4074
|
+
sort: gc(Z),
|
|
4072
4075
|
...Ne ? { conditions: Ne } : {}
|
|
4073
4076
|
})
|
|
4074
4077
|
)
|
|
@@ -4094,7 +4097,7 @@ function x0({
|
|
|
4094
4097
|
labelField: Wn(_e)
|
|
4095
4098
|
});
|
|
4096
4099
|
}
|
|
4097
|
-
const g = [.../* @__PURE__ */ new Set([...jn, ...o.flatMap(
|
|
4100
|
+
const g = [.../* @__PURE__ */ new Set([...jn, ...o.flatMap(xc)])], x = await vc(
|
|
4098
4101
|
r.map((S) => String(S.id)),
|
|
4099
4102
|
g,
|
|
4100
4103
|
(S, j) => u.request(
|
|
@@ -4113,7 +4116,7 @@ function x0({
|
|
|
4113
4116
|
].map(String), K = /* @__PURE__ */ new Map();
|
|
4114
4117
|
await Promise.all(
|
|
4115
4118
|
z.map(
|
|
4116
|
-
(S) =>
|
|
4119
|
+
(S) => Hd(u, S).then((j) => K.set(S.toUpperCase(), kc(j, S))).catch(() => K.set(S.toUpperCase(), S))
|
|
4117
4120
|
)
|
|
4118
4121
|
);
|
|
4119
4122
|
const Te = new Map(o.map((S) => [S.column, S])), D = new Set(f), U = (S) => {
|
|
@@ -4135,7 +4138,7 @@ function x0({
|
|
|
4135
4138
|
return _e && yn ? xs(yn, _e) : yn;
|
|
4136
4139
|
}
|
|
4137
4140
|
const Re = S[j], is = Te.get(j);
|
|
4138
|
-
return is && Re != null && Re !== "" ?
|
|
4141
|
+
return is && Re != null && Re !== "" ? yc(is, x[String(S.id)]) || Re : D.has(j) && Re != null && Re !== "" ? K.get(String(Re).toUpperCase()) ?? Re : Re != null && Re !== "" && ((_e == null ? void 0 : _e.type) === "number" || or(j)) ? Fi(Re) : Re != null && Re !== "" && ((_e == null ? void 0 : _e.type) === "datetime" || Eo(j)) ? Ri(Re) : j === "id" ? _r(O, S) ?? Re : _e && Re != null ? Un(String(Re), _e) : Re;
|
|
4139
4142
|
}, p = Qt.filter((S) => S.kind !== "actions"), dt = new Set(
|
|
4140
4143
|
p.filter((S) => S.kind !== "data" && S.kind !== "formula").map((S) => S.kind)
|
|
4141
4144
|
), Xe = r.map((S) => String(S.id)), Lt = await Ei(Xe, dt, {
|
|
@@ -4157,7 +4160,7 @@ function x0({
|
|
|
4157
4160
|
tasks: (S) => u.request(
|
|
4158
4161
|
ye("/tasks/counts", { collection: n, ids: S })
|
|
4159
4162
|
).then((j) => j.data ?? {})
|
|
4160
|
-
}), ot =
|
|
4163
|
+
}), ot = Md(O), Ut = ot ? s.includes(ot) || s.includes("id") ? [] : [{ header: Je(ot), cell: (S) => S[ot] }] : s.includes("id") ? [] : [{ header: "ID", cell: (S) => S.id }], vn = (S) => S.kind === "data" || S.kind === "formula" ? Je(S.key) : S.kind === "fulfilment" && (Le != null && Le.label) ? `${Le.label} shipped` : Di[S.kind], kn = Date.now(), it = [
|
|
4161
4164
|
[...Ut.map((S) => S.header), ...p.map(vn)].map(U).join(","),
|
|
4162
4165
|
...r.map(
|
|
4163
4166
|
(S) => [
|
|
@@ -4189,8 +4192,8 @@ function x0({
|
|
|
4189
4192
|
const P = new Blob([it.join(`
|
|
4190
4193
|
`)], { type: "text/csv;charset=utf-8" }), Ze = URL.createObjectURL(P), W = document.createElement("a");
|
|
4191
4194
|
W.href = Ze;
|
|
4192
|
-
const ve = Ee.export_filename,
|
|
4193
|
-
W.download = ve ? `${ve.replace(/\{\{\s*collection\s*\}\}/g, n).replace(/\{\{\s*view\s*\}\}/g,
|
|
4195
|
+
const ve = Ee.export_filename, le = ((t = lt.find((S) => S.id === Bt)) == null ? void 0 : t.name) ?? "all";
|
|
4196
|
+
W.download = ve ? `${ve.replace(/\{\{\s*collection\s*\}\}/g, n).replace(/\{\{\s*view\s*\}\}/g, le).replace(/\{\{\s*date\s*\}\}/g, wc()).replace(/[^A-Za-z0-9 ._-]/g, "")}.csv` : `${n}.csv`, W.click(), setTimeout(() => URL.revokeObjectURL(Ze), 1e4), l && we.warning(`Exported the first ${r.length.toLocaleString()} rows`, {
|
|
4194
4197
|
description: `${De.toLocaleString()} match — narrow the filter to export the rest.`
|
|
4195
4198
|
});
|
|
4196
4199
|
} catch (r) {
|
|
@@ -4201,7 +4204,7 @@ function x0({
|
|
|
4201
4204
|
}
|
|
4202
4205
|
}, Uo = (e) => {
|
|
4203
4206
|
const t = `record:${n}:${String(e)}`;
|
|
4204
|
-
return
|
|
4207
|
+
return $d(t, () => qd(k, u, n, String(e), { group: t }));
|
|
4205
4208
|
}, Wo = (e) => {
|
|
4206
4209
|
const t = Uo(e);
|
|
4207
4210
|
return {
|
|
@@ -4234,20 +4237,20 @@ function x0({
|
|
|
4234
4237
|
...((f = r.currentTarget.parentElement) == null ? void 0 : f.querySelectorAll(
|
|
4235
4238
|
":scope > [data-row-open]"
|
|
4236
4239
|
)) ?? []
|
|
4237
|
-
], s =
|
|
4240
|
+
], s = $c(l.length, l.indexOf(r.currentTarget), r.key), o = s === null ? null : l[s];
|
|
4238
4241
|
o && (o.focus(), (g = o.scrollIntoView) == null || g.call(o, { block: "nearest" }));
|
|
4239
4242
|
}
|
|
4240
4243
|
};
|
|
4241
4244
|
}, rn = (e) => {
|
|
4242
4245
|
var t;
|
|
4243
|
-
((t = ia.current) == null ? void 0 : t.key) === `${n}\0${X}` &&
|
|
4246
|
+
((t = ia.current) == null ? void 0 : t.key) === `${n}\0${X}` && Kd(u, ia.current.id, {
|
|
4244
4247
|
type: "record",
|
|
4245
4248
|
collection: n,
|
|
4246
4249
|
item: e === "new" ? null : e
|
|
4247
4250
|
}), N ? N(e) : Y({ collection: n, itemId: String(e) });
|
|
4248
4251
|
}, Il = (e) => {
|
|
4249
4252
|
const t = rt(He, n, e), r = (l) => {
|
|
4250
|
-
q(
|
|
4253
|
+
q(zd(Z, l, Ee.default_sort ?? "")), F(1);
|
|
4251
4254
|
};
|
|
4252
4255
|
if (t != null && t.one_collection && !wt(t.one_collection)) {
|
|
4253
4256
|
const l = t.one_collection;
|
|
@@ -4306,9 +4309,9 @@ function x0({
|
|
|
4306
4309
|
], Xo = Qt.map((e) => {
|
|
4307
4310
|
if (e.kind === "data") {
|
|
4308
4311
|
const t = bt.get(e.key.split(".")[0]);
|
|
4309
|
-
return { key: e.key, shape:
|
|
4312
|
+
return { key: e.key, shape: jd(t == null ? void 0 : t.type, t == null ? void 0 : t.interface) };
|
|
4310
4313
|
}
|
|
4311
|
-
return { key: e.key, shape:
|
|
4314
|
+
return { key: e.key, shape: Eu[e.kind] ?? "short" };
|
|
4312
4315
|
}), zl = [
|
|
4313
4316
|
...zn ? [{ key: "__state__", label: "State" }] : [],
|
|
4314
4317
|
...ge.filter((e) => Pt(e) || !rt(He, n, e)).map((e) => ({ key: e, label: Je(e) }))
|
|
@@ -4336,7 +4339,7 @@ function x0({
|
|
|
4336
4339
|
if (r.push({ kind: "header", gkey: l, label: l, count: s.length }), !Ln.has(l)) for (const o of s) r.push({ kind: "row", row: o });
|
|
4337
4340
|
}
|
|
4338
4341
|
return r;
|
|
4339
|
-
})(), [ei, ti] = y(null), ni =
|
|
4342
|
+
})(), [ei, ti] = y(null), ni = Cc(Ql, ei), pr = Qt.filter((e) => kt(e.key) === "left").map((e) => e.key), Ul = Qt.filter((e) => kt(e.key) === "right").map((e) => e.key), mr = he(/* @__PURE__ */ new Map()), [Qn, ai] = y({});
|
|
4340
4343
|
yi(() => {
|
|
4341
4344
|
const e = {};
|
|
4342
4345
|
for (const [r, l] of mr.current)
|
|
@@ -4523,7 +4526,7 @@ function x0({
|
|
|
4523
4526
|
text: x.value === "none" ? "with no open tasks" : x.value === "overdue" ? "with overdue tasks" : "with open tasks"
|
|
4524
4527
|
});
|
|
4525
4528
|
else if (x.kind === "aging") {
|
|
4526
|
-
const D =
|
|
4529
|
+
const D = Wi({ field: z, type: "range", value: x.value, rangeUnit: "h" });
|
|
4527
4530
|
D && r.push(D);
|
|
4528
4531
|
} else if (x.kind === "text" && x.value.trim())
|
|
4529
4532
|
r.push({ kind: "text", field: z, text: x.value });
|
|
@@ -4561,7 +4564,7 @@ function x0({
|
|
|
4561
4564
|
}).filter((x) => !!x);
|
|
4562
4565
|
g.length > 0 && r.push({ kind: "phrase", text: `flagged ${g.join(" or ")}` });
|
|
4563
4566
|
}
|
|
4564
|
-
return Jl.current = e,
|
|
4567
|
+
return Jl.current = e, Vi({
|
|
4565
4568
|
noun: (O == null ? void 0 : O.display_name) || Ae(n),
|
|
4566
4569
|
viewName: ((f = lt.find((g) => g.id === Bt)) == null ? void 0 : f.name) ?? null,
|
|
4567
4570
|
search: X,
|
|
@@ -4636,83 +4639,83 @@ function x0({
|
|
|
4636
4639
|
[data-cbv] .cbv-overlay { animation: none; opacity: 1; }
|
|
4637
4640
|
}
|
|
4638
4641
|
` }),
|
|
4639
|
-
/* @__PURE__ */ a(
|
|
4640
|
-
/* @__PURE__ */ a(
|
|
4641
|
-
|
|
4642
|
+
/* @__PURE__ */ a(ou, {}),
|
|
4643
|
+
/* @__PURE__ */ a(pc, {}),
|
|
4644
|
+
se && As(
|
|
4642
4645
|
/* @__PURE__ */ c(
|
|
4643
4646
|
"div",
|
|
4644
4647
|
{
|
|
4645
4648
|
style: {
|
|
4646
4649
|
position: "fixed",
|
|
4647
|
-
left: Math.min(
|
|
4648
|
-
top: Math.min(
|
|
4650
|
+
left: Math.min(se.x, window.innerWidth - 236),
|
|
4651
|
+
top: Math.min(se.y, window.innerHeight - 380),
|
|
4649
4652
|
zIndex: 125
|
|
4650
4653
|
},
|
|
4651
4654
|
className: "nvr-pop-in w-56 overflow-hidden rounded-lg border border-slate-200 bg-white py-1 shadow-xl dark:border-slate-700 dark:bg-slate-900",
|
|
4652
4655
|
onMouseDown: (e) => e.stopPropagation(),
|
|
4653
4656
|
children: [
|
|
4654
|
-
(
|
|
4657
|
+
(se.key === "__state__" || hn(se.key)) && se.cellText && se.cellText !== "—" && /* @__PURE__ */ c(
|
|
4655
4658
|
"button",
|
|
4656
4659
|
{
|
|
4657
4660
|
type: "button",
|
|
4658
4661
|
onClick: () => {
|
|
4659
|
-
qo(
|
|
4662
|
+
qo(se), jt(null);
|
|
4660
4663
|
},
|
|
4661
4664
|
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",
|
|
4662
4665
|
children: [
|
|
4663
4666
|
"Filter: ",
|
|
4664
|
-
/* @__PURE__ */ a("span", { className: "font-medium", children:
|
|
4667
|
+
/* @__PURE__ */ a("span", { className: "font-medium", children: se.cellText.slice(0, 40) })
|
|
4665
4668
|
]
|
|
4666
4669
|
}
|
|
4667
4670
|
),
|
|
4668
|
-
To(
|
|
4671
|
+
To(se.key, se.row) && se.cellText && se.cellText !== "—" && /* @__PURE__ */ c(
|
|
4669
4672
|
"button",
|
|
4670
4673
|
{
|
|
4671
4674
|
type: "button",
|
|
4672
4675
|
onClick: () => {
|
|
4673
|
-
Lo(
|
|
4676
|
+
Lo(se), jt(null);
|
|
4674
4677
|
},
|
|
4675
4678
|
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",
|
|
4676
4679
|
children: [
|
|
4677
4680
|
"Exclude: ",
|
|
4678
|
-
/* @__PURE__ */ a("span", { className: "font-medium", children:
|
|
4681
|
+
/* @__PURE__ */ a("span", { className: "font-medium", children: se.cellText.slice(0, 40) })
|
|
4679
4682
|
]
|
|
4680
4683
|
}
|
|
4681
4684
|
),
|
|
4682
|
-
(
|
|
4685
|
+
(se.key === "__state__" || zl.some((e) => e.key === se.key)) && ue !== se.key && /* @__PURE__ */ c(
|
|
4683
4686
|
"button",
|
|
4684
4687
|
{
|
|
4685
4688
|
type: "button",
|
|
4686
4689
|
onClick: () => {
|
|
4687
|
-
b(
|
|
4690
|
+
b(se.key), jt(null);
|
|
4688
4691
|
},
|
|
4689
4692
|
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",
|
|
4690
4693
|
children: [
|
|
4691
4694
|
"Group by ",
|
|
4692
|
-
|
|
4695
|
+
se.key === "__state__" ? "State" : Je(se.key)
|
|
4693
4696
|
]
|
|
4694
4697
|
}
|
|
4695
4698
|
),
|
|
4696
|
-
|
|
4699
|
+
se.row.id != null && /* @__PURE__ */ c(Ue, { children: [
|
|
4697
4700
|
/* @__PURE__ */ a("div", { className: "my-1 border-t border-slate-100 dark:border-slate-700" }),
|
|
4698
4701
|
[
|
|
4699
4702
|
{
|
|
4700
4703
|
label: "Open",
|
|
4701
|
-
run: () => rn(
|
|
4704
|
+
run: () => rn(se.row.id)
|
|
4702
4705
|
},
|
|
4703
4706
|
{
|
|
4704
4707
|
label: "Open in new tab",
|
|
4705
|
-
run: () => window.open(L({ collection: n, itemId: String(
|
|
4708
|
+
run: () => window.open(L({ collection: n, itemId: String(se.row.id) }), "_blank")
|
|
4706
4709
|
},
|
|
4707
4710
|
{
|
|
4708
4711
|
label: "Peek",
|
|
4709
|
-
run: () => mt.push([{ collection: n, itemId: String(
|
|
4712
|
+
run: () => mt.push([{ collection: n, itemId: String(se.row.id) }])
|
|
4710
4713
|
},
|
|
4711
4714
|
// The friendly id, never the row id (army 7 N7); none = nothing to copy.
|
|
4712
4715
|
...qr({
|
|
4713
4716
|
meta: O,
|
|
4714
|
-
row:
|
|
4715
|
-
id:
|
|
4717
|
+
row: se.row,
|
|
4718
|
+
id: se.row.id
|
|
4716
4719
|
}).copy != null ? [
|
|
4717
4720
|
{
|
|
4718
4721
|
label: "Copy ID",
|
|
@@ -4721,8 +4724,8 @@ function x0({
|
|
|
4721
4724
|
(e = navigator.clipboard) == null || e.writeText(
|
|
4722
4725
|
qr({
|
|
4723
4726
|
meta: O,
|
|
4724
|
-
row:
|
|
4725
|
-
id:
|
|
4727
|
+
row: se.row,
|
|
4728
|
+
id: se.row.id
|
|
4726
4729
|
}).copy ?? ""
|
|
4727
4730
|
), we.success("ID copied");
|
|
4728
4731
|
}
|
|
@@ -4735,8 +4738,8 @@ function x0({
|
|
|
4735
4738
|
u,
|
|
4736
4739
|
k,
|
|
4737
4740
|
n,
|
|
4738
|
-
|
|
4739
|
-
String(
|
|
4741
|
+
se.row,
|
|
4742
|
+
String(se.row.id),
|
|
4740
4743
|
L
|
|
4741
4744
|
), we.success("Link copied");
|
|
4742
4745
|
}
|
|
@@ -4758,7 +4761,7 @@ function x0({
|
|
|
4758
4761
|
{
|
|
4759
4762
|
confirmLabel: "Delete this record? It moves to Trash for 30 days.",
|
|
4760
4763
|
onConfirm: () => {
|
|
4761
|
-
Al.mutate(
|
|
4764
|
+
Al.mutate(se.row.id), jt(null);
|
|
4762
4765
|
},
|
|
4763
4766
|
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",
|
|
4764
4767
|
armedClassName: "whitespace-normal bg-red-50 font-semibold dark:bg-red-900/20",
|
|
@@ -4773,7 +4776,7 @@ function x0({
|
|
|
4773
4776
|
),
|
|
4774
4777
|
/* @__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: [
|
|
4775
4778
|
/* @__PURE__ */ a(
|
|
4776
|
-
|
|
4779
|
+
Tu,
|
|
4777
4780
|
{
|
|
4778
4781
|
collection: n,
|
|
4779
4782
|
meta: O,
|
|
@@ -4818,7 +4821,7 @@ function x0({
|
|
|
4818
4821
|
/* @__PURE__ */ a(
|
|
4819
4822
|
"span",
|
|
4820
4823
|
{
|
|
4821
|
-
className: `h-2 w-2 rounded-full ${
|
|
4824
|
+
className: `h-2 w-2 rounded-full ${Od(e.highlight_color ?? "red")}`
|
|
4822
4825
|
}
|
|
4823
4826
|
),
|
|
4824
4827
|
e.name
|
|
@@ -4827,8 +4830,8 @@ function x0({
|
|
|
4827
4830
|
e.id
|
|
4828
4831
|
);
|
|
4829
4832
|
}),
|
|
4830
|
-
/* @__PURE__ */ a(
|
|
4831
|
-
/* @__PURE__ */ a(
|
|
4833
|
+
/* @__PURE__ */ a(tu, { className: "h-8" }),
|
|
4834
|
+
/* @__PURE__ */ a(Mc, {}),
|
|
4832
4835
|
Za > 0 && /* @__PURE__ */ c(
|
|
4833
4836
|
"button",
|
|
4834
4837
|
{
|
|
@@ -4858,9 +4861,9 @@ function x0({
|
|
|
4858
4861
|
children: /* @__PURE__ */ a(vr, { className: `h-4 w-4 ${ht ? "animate-spin" : ""}` })
|
|
4859
4862
|
}
|
|
4860
4863
|
),
|
|
4861
|
-
/* @__PURE__ */ a(
|
|
4864
|
+
/* @__PURE__ */ a(Hc, { listKey: `cbv:${n}`, getState: Ao }),
|
|
4862
4865
|
Et && Ee.copy_as !== !1 && /* @__PURE__ */ a(
|
|
4863
|
-
|
|
4866
|
+
mc,
|
|
4864
4867
|
{
|
|
4865
4868
|
collection: n,
|
|
4866
4869
|
list: {
|
|
@@ -4874,7 +4877,7 @@ function x0({
|
|
|
4874
4877
|
}
|
|
4875
4878
|
),
|
|
4876
4879
|
On.parent && /* @__PURE__ */ a(
|
|
4877
|
-
|
|
4880
|
+
Sc,
|
|
4878
4881
|
{
|
|
4879
4882
|
parent: On.parent,
|
|
4880
4883
|
value: il,
|
|
@@ -5110,16 +5113,16 @@ function x0({
|
|
|
5110
5113
|
"input",
|
|
5111
5114
|
{
|
|
5112
5115
|
autoFocus: !0,
|
|
5113
|
-
value:
|
|
5116
|
+
value: ae[e] ?? "",
|
|
5114
5117
|
placeholder: e.includes(".") ? e.split(".").map(Ae).join(" › ") : Ae(e),
|
|
5115
5118
|
onChange: (l) => Me((s) => {
|
|
5116
5119
|
const o = { ...s };
|
|
5117
5120
|
return l.target.value ? o[e] = l.target.value : delete o[e], o;
|
|
5118
5121
|
}),
|
|
5119
5122
|
onKeyDown: (l) => {
|
|
5120
|
-
(l.key === "Enter" || l.key === "Escape") &&
|
|
5123
|
+
(l.key === "Enter" || l.key === "Escape") && re(null);
|
|
5121
5124
|
},
|
|
5122
|
-
onBlur: () =>
|
|
5125
|
+
onBlur: () => re(null),
|
|
5123
5126
|
className: "h-5 w-full min-w-0 flex-1 rounded border border-slate-200 bg-slate-50 px-1 text-[11.5px] outline-none focus:border-nvr-cyan/50 dark:border-slate-700 dark:bg-slate-800 dark:text-slate-100"
|
|
5124
5127
|
}
|
|
5125
5128
|
) : /* @__PURE__ */ a("span", { className: "min-w-0 flex-1 truncate text-[12px] text-slate-700 dark:text-slate-200", children: Je(e) }),
|
|
@@ -5127,7 +5130,7 @@ function x0({
|
|
|
5127
5130
|
"button",
|
|
5128
5131
|
{
|
|
5129
5132
|
type: "button",
|
|
5130
|
-
onClick: () =>
|
|
5133
|
+
onClick: () => re(e),
|
|
5131
5134
|
title: "Rename column",
|
|
5132
5135
|
"aria-label": `Rename ${e}`,
|
|
5133
5136
|
className: "text-slate-300 opacity-0 hover:text-slate-500 group-hover:opacity-100",
|
|
@@ -5174,7 +5177,7 @@ function x0({
|
|
|
5174
5177
|
}
|
|
5175
5178
|
),
|
|
5176
5179
|
Nn === 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: [
|
|
5177
|
-
/* @__PURE__ */ a("div", { className: "flex flex-wrap gap-1", children:
|
|
5180
|
+
/* @__PURE__ */ a("div", { className: "flex flex-wrap gap-1", children: pu.map((l) => {
|
|
5178
5181
|
const s = JSON.stringify(Ce[e] ?? null) === JSON.stringify(l.cfg);
|
|
5179
5182
|
return /* @__PURE__ */ a(
|
|
5180
5183
|
"button",
|
|
@@ -5325,7 +5328,7 @@ function x0({
|
|
|
5325
5328
|
O && /* @__PURE__ */ c("div", { className: "mt-1 border-t border-slate-100 pt-1.5 dark:border-slate-800", children: [
|
|
5326
5329
|
/* @__PURE__ */ a("p", { className: "px-1.5 pb-1 text-[10.5px] font-semibold uppercase tracking-wide text-slate-400", children: "+ Related column" }),
|
|
5327
5330
|
/* @__PURE__ */ a(
|
|
5328
|
-
|
|
5331
|
+
Lu,
|
|
5329
5332
|
{
|
|
5330
5333
|
collection: n,
|
|
5331
5334
|
meta: O,
|
|
@@ -5339,7 +5342,7 @@ function x0({
|
|
|
5339
5342
|
/* @__PURE__ */ c("div", { className: "mt-1 border-t border-slate-100 pt-1.5 dark:border-slate-800", children: [
|
|
5340
5343
|
/* @__PURE__ */ a("p", { className: "px-1.5 pb-1 text-[10.5px] font-semibold uppercase tracking-wide text-slate-400", children: "+ Formula column" }),
|
|
5341
5344
|
/* @__PURE__ */ a(
|
|
5342
|
-
|
|
5345
|
+
_c,
|
|
5343
5346
|
{
|
|
5344
5347
|
fields: St.map((e) => e.field),
|
|
5345
5348
|
onAdd: (e, t) => {
|
|
@@ -5666,7 +5669,7 @@ ${r}`).then(() => {
|
|
|
5666
5669
|
)
|
|
5667
5670
|
] }),
|
|
5668
5671
|
Ma && /* @__PURE__ */ a(
|
|
5669
|
-
|
|
5672
|
+
Qc,
|
|
5670
5673
|
{
|
|
5671
5674
|
collection: n,
|
|
5672
5675
|
layoutSlug: Ma.slug,
|
|
@@ -5703,7 +5706,7 @@ ${r}`).then(() => {
|
|
|
5703
5706
|
] }),
|
|
5704
5707
|
$t.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: [
|
|
5705
5708
|
$t.map((e) => /* @__PURE__ */ a(
|
|
5706
|
-
|
|
5709
|
+
wu,
|
|
5707
5710
|
{
|
|
5708
5711
|
def: e,
|
|
5709
5712
|
allowedIds: Xr(e),
|
|
@@ -5839,7 +5842,7 @@ ${r}`).then(() => {
|
|
|
5839
5842
|
}
|
|
5840
5843
|
),
|
|
5841
5844
|
Et && /* @__PURE__ */ a(
|
|
5842
|
-
|
|
5845
|
+
Fc,
|
|
5843
5846
|
{
|
|
5844
5847
|
name: e.name,
|
|
5845
5848
|
isDefault: !!e.is_default,
|
|
@@ -5914,8 +5917,8 @@ ${r}`).then(() => {
|
|
|
5914
5917
|
)
|
|
5915
5918
|
] }),
|
|
5916
5919
|
Ge != 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: [
|
|
5917
|
-
/* @__PURE__ */ a("span", { className: "min-w-0 flex-1", children:
|
|
5918
|
-
(Ge == null ? void 0 : Ge.status) === 403 &&
|
|
5920
|
+
/* @__PURE__ */ a("span", { className: "min-w-0 flex-1", children: yd(Ge) === 503 ? wd(Ge) : Vt(Ge, "Failed to load records") }),
|
|
5921
|
+
(Ge == null ? void 0 : Ge.status) === 403 && !Tc(Ge) && /* @__PURE__ */ a(
|
|
5919
5922
|
"button",
|
|
5920
5923
|
{
|
|
5921
5924
|
type: "button",
|
|
@@ -5932,7 +5935,7 @@ ${r}`).then(() => {
|
|
|
5932
5935
|
{
|
|
5933
5936
|
type: "button",
|
|
5934
5937
|
onClick: () => {
|
|
5935
|
-
const t =
|
|
5938
|
+
const t = Lc(e, { filters: qe, sort: Z, colFilters: ze });
|
|
5936
5939
|
Ye(t.filters), q(t.sort), It(t.colFilters), F(1);
|
|
5937
5940
|
},
|
|
5938
5941
|
title: `Remove the filter or sort on "${e}" — this list cannot filter on it`,
|
|
@@ -5957,7 +5960,7 @@ ${r}`).then(() => {
|
|
|
5957
5960
|
)
|
|
5958
5961
|
] }),
|
|
5959
5962
|
yt === "tree" && An ? /* @__PURE__ */ a("div", { className: "flex min-h-0 flex-1 flex-col p-4 pt-3", children: /* @__PURE__ */ a("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__ */ a(
|
|
5960
|
-
|
|
5963
|
+
bc,
|
|
5961
5964
|
{
|
|
5962
5965
|
collection: n,
|
|
5963
5966
|
config: An,
|
|
@@ -5970,7 +5973,7 @@ ${r}`).then(() => {
|
|
|
5970
5973
|
}
|
|
5971
5974
|
) }) }) : yt && (B != null && B.some((e) => e.key === yt)) ? /* @__PURE__ */ a("div", { className: "flex min-h-0 flex-1 flex-col p-4 pt-3", "data-cbv-extra-view": yt, children: (os = B.find((e) => e.key === yt)) == null ? void 0 : os.render() }) : null,
|
|
5972
5975
|
ra && bn ? /* @__PURE__ */ a("div", { className: "flex min-h-0 flex-1 flex-col p-4 pt-3", children: /* @__PURE__ */ a(
|
|
5973
|
-
|
|
5976
|
+
Gc,
|
|
5974
5977
|
{
|
|
5975
5978
|
collection: n,
|
|
5976
5979
|
latField: bn.latField,
|
|
@@ -6007,7 +6010,7 @@ ${r}`).then(() => {
|
|
|
6007
6010
|
/* @__PURE__ */ a(vr, { "aria-hidden": !0, className: "h-3.5 w-3.5 animate-spin text-[#00a5cc]" }),
|
|
6008
6011
|
xl != null ? `${Ha.text ?? "Still working"} — ${xl}s` : "Loading…"
|
|
6009
6012
|
] }) }) }),
|
|
6010
|
-
la && Ha.slow && /* @__PURE__ */ a("div", { className: "pointer-events-none absolute inset-x-0 top-12 z-[6] flex justify-center px-4", children: /* @__PURE__ */ a(
|
|
6013
|
+
la && Ha.slow && /* @__PURE__ */ a("div", { className: "pointer-events-none absolute inset-x-0 top-12 z-[6] flex justify-center px-4", children: /* @__PURE__ */ a(su, { reason: Ha, variant: "pill" }) }),
|
|
6011
6014
|
/* @__PURE__ */ a(
|
|
6012
6015
|
"div",
|
|
6013
6016
|
{
|
|
@@ -6173,7 +6176,7 @@ ${r}`).then(() => {
|
|
|
6173
6176
|
className: l,
|
|
6174
6177
|
"data-aging-filter": !0,
|
|
6175
6178
|
children: /* @__PURE__ */ a(
|
|
6176
|
-
|
|
6179
|
+
Pc,
|
|
6177
6180
|
{
|
|
6178
6181
|
layout: "cell",
|
|
6179
6182
|
def: {
|
|
@@ -6270,7 +6273,7 @@ ${r}`).then(() => {
|
|
|
6270
6273
|
// #3229 — one placeholder per real column, real row height (h-8, or the
|
|
6271
6274
|
// table's comfortable h-11), real pins/widths: nothing moves on arrival.
|
|
6272
6275
|
/* @__PURE__ */ a(
|
|
6273
|
-
|
|
6276
|
+
lu,
|
|
6274
6277
|
{
|
|
6275
6278
|
columns: Xo,
|
|
6276
6279
|
rows: Math.min(Ve, 20),
|
|
@@ -6388,17 +6391,17 @@ ${r}`).then(() => {
|
|
|
6388
6391
|
},
|
|
6389
6392
|
`__group__${e.gkey}`
|
|
6390
6393
|
);
|
|
6391
|
-
const l = e.row, s = l.id, o = Zt.includes(s), f = (U = Fe == null ? void 0 : Fe.instances) == null ? void 0 : U[String(s)], g = wo[String(s)], x = rr == null ? void 0 : rr[String(s)], z = ko.get(String(s)) ?? null, K = No(n, s), Te = !o && g ?
|
|
6394
|
+
const l = e.row, s = l.id, o = Zt.includes(s), f = (U = Fe == null ? void 0 : Fe.instances) == null ? void 0 : U[String(s)], g = wo[String(s)], x = rr == null ? void 0 : rr[String(s)], z = ko.get(String(s)) ?? null, K = No(n, s), Te = !o && g ? Ad(g.color) : void 0, D = o ? "bg-[#e6fafe] dark:bg-[#0c2a33]" : Te ?? "bg-white group-hover:bg-[#f2fcff] dark:bg-slate-900 dark:group-hover:bg-[#0e2d3a]";
|
|
6392
6395
|
return /* @__PURE__ */ c(
|
|
6393
6396
|
"tr",
|
|
6394
6397
|
{
|
|
6395
6398
|
...ho({ collection: n, id: String(s) }),
|
|
6396
6399
|
...Wo(s),
|
|
6397
6400
|
"data-row-key": String(s),
|
|
6398
|
-
title: Tt.titleFor(String(s)) ?? (z && !z.is_mine ?
|
|
6401
|
+
title: Tt.titleFor(String(s)) ?? (z && !z.is_mine ? hd(z) : void 0) ?? (g ? `At risk — ${g.rule}` : void 0) ?? (K ? eu : void 0),
|
|
6399
6402
|
"data-picker-excluded": K ? "" : void 0,
|
|
6400
6403
|
style: r,
|
|
6401
|
-
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]" : Te ?? ""} ${K ?
|
|
6404
|
+
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]" : Te ?? ""} ${K ? Zc : ""}`,
|
|
6402
6405
|
children: [
|
|
6403
6406
|
Ct && /* @__PURE__ */ a(
|
|
6404
6407
|
"td",
|
|
@@ -6407,27 +6410,27 @@ ${r}`).then(() => {
|
|
|
6407
6410
|
onClick: (H) => H.stopPropagation(),
|
|
6408
6411
|
children: /* @__PURE__ */ c("span", { className: "flex items-center gap-1", children: [
|
|
6409
6412
|
z || Tt.isNew(String(s)) ? /* @__PURE__ */ a(
|
|
6410
|
-
|
|
6413
|
+
Vc,
|
|
6411
6414
|
{
|
|
6412
6415
|
lock: z,
|
|
6413
6416
|
isNew: Tt.isNew(String(s)),
|
|
6414
6417
|
dataAttr: "data-cbv-live-mark"
|
|
6415
6418
|
}
|
|
6416
6419
|
) : vl[ys(n, String(s))] ? /* @__PURE__ */ a(
|
|
6417
|
-
|
|
6420
|
+
ru,
|
|
6418
6421
|
{
|
|
6419
6422
|
viewers: vl[ys(n, String(s))],
|
|
6420
6423
|
dataAttr: "data-cbv-presence"
|
|
6421
6424
|
}
|
|
6422
6425
|
) : /* @__PURE__ */ a(Ls, { change: x, dataAttr: "data-cbv-unseen" }),
|
|
6423
|
-
/* @__PURE__ */ a(
|
|
6426
|
+
/* @__PURE__ */ a(ic, { rowId: s }),
|
|
6424
6427
|
ft && /* @__PURE__ */ a(
|
|
6425
6428
|
"input",
|
|
6426
6429
|
{
|
|
6427
6430
|
type: "checkbox",
|
|
6428
6431
|
checked: o,
|
|
6429
6432
|
onChange: () => Ho(s),
|
|
6430
|
-
"aria-label": `Select ${
|
|
6433
|
+
"aria-label": `Select ${Ed(O, l, s, n) || "this record"}`
|
|
6431
6434
|
}
|
|
6432
6435
|
)
|
|
6433
6436
|
] })
|
|
@@ -6503,9 +6506,9 @@ ${r}`).then(() => {
|
|
|
6503
6506
|
"td",
|
|
6504
6507
|
{
|
|
6505
6508
|
style: Pe(p),
|
|
6506
|
-
"data-tip": W != null && (P != null && P.entered_at) ? `In ${P.state_label ?? "this state"} since ${
|
|
6509
|
+
"data-tip": W != null && (P != null && P.entered_at) ? `In ${P.state_label ?? "this state"} since ${Gd(P.entered_at)}` : void 0,
|
|
6507
6510
|
className: `whitespace-nowrap px-3 py-1.5 text-[12px] tabular-nums text-slate-600 dark:text-slate-300 ${st(p, "z-[1]", D)}`,
|
|
6508
|
-
children: W == null ? /* @__PURE__ */ a("span", { className: "text-slate-300 dark:text-slate-600", children: "—" }) :
|
|
6511
|
+
children: W == null ? /* @__PURE__ */ a("span", { className: "text-slate-300 dark:text-slate-600", children: "—" }) : Jd(W)
|
|
6509
6512
|
},
|
|
6510
6513
|
p
|
|
6511
6514
|
);
|
|
@@ -6534,7 +6537,7 @@ ${r}`).then(() => {
|
|
|
6534
6537
|
{
|
|
6535
6538
|
style: Pe(p),
|
|
6536
6539
|
className: `whitespace-nowrap px-3 py-1.5 ${st(p, "z-[1]", D)}`,
|
|
6537
|
-
children: /* @__PURE__ */ a(
|
|
6540
|
+
children: /* @__PURE__ */ a(bu, { summary: P })
|
|
6538
6541
|
},
|
|
6539
6542
|
p
|
|
6540
6543
|
);
|
|
@@ -6547,11 +6550,11 @@ ${r}`).then(() => {
|
|
|
6547
6550
|
className: `whitespace-nowrap px-3 py-1.5 ${st(p, "z-[1]", D)}`,
|
|
6548
6551
|
onClick: (P) => P.stopPropagation(),
|
|
6549
6552
|
children: /* @__PURE__ */ a(
|
|
6550
|
-
|
|
6553
|
+
Oc,
|
|
6551
6554
|
{
|
|
6552
6555
|
collection: n,
|
|
6553
6556
|
itemId: String(s),
|
|
6554
|
-
figures:
|
|
6557
|
+
figures: Ac(
|
|
6555
6558
|
l[Le.shipped_field],
|
|
6556
6559
|
l[Le.requested_field]
|
|
6557
6560
|
),
|
|
@@ -6567,7 +6570,7 @@ ${r}`).then(() => {
|
|
|
6567
6570
|
{
|
|
6568
6571
|
style: Pe(p),
|
|
6569
6572
|
className: `whitespace-nowrap px-3 py-1.5 ${st(p, "z-[1]", D)}`,
|
|
6570
|
-
children: /* @__PURE__ */ a(
|
|
6573
|
+
children: /* @__PURE__ */ a(Bc, { rows: lr == null ? void 0 : lr[String(s)] })
|
|
6571
6574
|
},
|
|
6572
6575
|
p
|
|
6573
6576
|
);
|
|
@@ -6616,7 +6619,7 @@ ${r}`).then(() => {
|
|
|
6616
6619
|
className: `w-20 whitespace-nowrap px-2 py-1 text-right ${st(p, "z-[1]", D)}`,
|
|
6617
6620
|
onClick: (P) => P.stopPropagation(),
|
|
6618
6621
|
children: /* @__PURE__ */ a(
|
|
6619
|
-
|
|
6622
|
+
xu,
|
|
6620
6623
|
{
|
|
6621
6624
|
collection: n,
|
|
6622
6625
|
id: s,
|
|
@@ -6654,8 +6657,8 @@ ${r}`).then(() => {
|
|
|
6654
6657
|
p,
|
|
6655
6658
|
!!z && !z.is_mine,
|
|
6656
6659
|
Pt(p) ? ql(p) === "nivaro_users" ? (() => {
|
|
6657
|
-
var
|
|
6658
|
-
const P = p.includes(".") ? p : Qe[p], Ze = ((j = (S = (
|
|
6660
|
+
var le, S, j;
|
|
6661
|
+
const P = p.includes(".") ? p : Qe[p], Ze = ((j = (S = (le = $e == null ? void 0 : $e.rows) == null ? void 0 : le[String(s)]) == null ? void 0 : S[P]) == null ? void 0 : j.ids) ?? [], W = gt(s, p) ?? "";
|
|
6659
6662
|
if (Ze.length === 0 || !W || W === "—")
|
|
6660
6663
|
return /* @__PURE__ */ a("span", { className: "text-[12px] text-slate-300", children: "—" });
|
|
6661
6664
|
if (Ze.length === 1)
|
|
@@ -6794,9 +6797,9 @@ ${r}`).then(() => {
|
|
|
6794
6797
|
)
|
|
6795
6798
|
}
|
|
6796
6799
|
),
|
|
6797
|
-
/* @__PURE__ */ a(
|
|
6800
|
+
/* @__PURE__ */ a(Ic, { scrollerRef: Kr }),
|
|
6798
6801
|
/* @__PURE__ */ a(
|
|
6799
|
-
|
|
6802
|
+
au,
|
|
6800
6803
|
{
|
|
6801
6804
|
collections: n ? [n] : [],
|
|
6802
6805
|
selectedIds: qt,
|
|
@@ -6897,7 +6900,7 @@ ${r}`).then(() => {
|
|
|
6897
6900
|
}
|
|
6898
6901
|
),
|
|
6899
6902
|
at != null && at.length ? /* @__PURE__ */ a(
|
|
6900
|
-
|
|
6903
|
+
nu,
|
|
6901
6904
|
{
|
|
6902
6905
|
collection: at[0].collection,
|
|
6903
6906
|
itemId: at[0].itemId,
|
|
@@ -6909,7 +6912,7 @@ ${r}`).then(() => {
|
|
|
6909
6912
|
}
|
|
6910
6913
|
) : null,
|
|
6911
6914
|
qn && /* @__PURE__ */ a(
|
|
6912
|
-
|
|
6915
|
+
du,
|
|
6913
6916
|
{
|
|
6914
6917
|
collection: n,
|
|
6915
6918
|
item: qn,
|
|
@@ -6938,7 +6941,7 @@ ${r}`).then(() => {
|
|
|
6938
6941
|
)
|
|
6939
6942
|
] }),
|
|
6940
6943
|
Ct && ft && Zt.length > 0 && /* @__PURE__ */ a(
|
|
6941
|
-
|
|
6944
|
+
Ru,
|
|
6942
6945
|
{
|
|
6943
6946
|
collection: n,
|
|
6944
6947
|
selectedIds: Zt,
|
|
@@ -6954,22 +6957,18 @@ ${r}`).then(() => {
|
|
|
6954
6957
|
}
|
|
6955
6958
|
);
|
|
6956
6959
|
}
|
|
6957
|
-
function
|
|
6958
|
-
const
|
|
6959
|
-
|
|
6960
|
-
if (typeof i == "boolean") return i ? "Yes" : "No";
|
|
6961
|
-
if (typeof i == "object") return JSON.stringify(i).slice(0, 80);
|
|
6962
|
-
const _ = String(i);
|
|
6963
|
-
return /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}/.test(_) ? new Date(_).toLocaleString() : _.length > 160 ? `${_.slice(0, 160)}…` : _;
|
|
6960
|
+
function Du(n, i, h, d, v) {
|
|
6961
|
+
const _ = Fr(i, n, h);
|
|
6962
|
+
return _ != null && _.one_collection ? /* @__PURE__ */ a(Rr, { relatedCollection: _.one_collection, id: d }) : Oi(d, v);
|
|
6964
6963
|
}
|
|
6965
6964
|
export {
|
|
6966
|
-
|
|
6965
|
+
y0 as CollectionBrowserView,
|
|
6967
6966
|
Ta as MultiPick,
|
|
6968
|
-
|
|
6967
|
+
xu as RowActionsMenu,
|
|
6969
6968
|
Rs as TINT_TEXT,
|
|
6970
|
-
|
|
6969
|
+
Du as compareCell,
|
|
6971
6970
|
_a as invalidateCbvRowQueries,
|
|
6972
|
-
|
|
6973
|
-
|
|
6971
|
+
gu as roleMayDelete,
|
|
6972
|
+
hu as roleMayUpdate,
|
|
6974
6973
|
va as tintFor
|
|
6975
6974
|
};
|