@nivaro/react 0.3.113 → 0.3.115
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/components/ScreenShareHost.js +24 -0
- package/dist/full.css +50 -2
- package/dist/hooks/useSessionRecorder.js +61 -60
- package/dist/index.d.ts +1727 -19
- package/dist/index.js +1091 -950
- package/dist/shared/components/ActivityEntry.js +209 -97
- package/dist/shared/components/AgentPresenceChip.js +51 -0
- package/dist/shared/components/AnnouncementBanner.js +56 -41
- package/dist/shared/components/AutolinkedText.js +98 -85
- package/dist/shared/components/BroadcastView.js +149 -141
- package/dist/shared/components/CacheStamp.js +78 -30
- package/dist/shared/components/CollectionBrowserView.js +4088 -3592
- package/dist/shared/components/ConfigChangeStrip.js +63 -0
- package/dist/shared/components/ConfigReachNote.js +107 -0
- package/dist/shared/components/ConformanceView.js +389 -319
- package/dist/shared/components/DataTable.js +544 -504
- package/dist/shared/components/DelegateCoverLine.js +164 -0
- package/dist/shared/components/EnvironmentNotice.js +56 -65
- package/dist/shared/components/FilePreviewLightbox.js +89 -43
- package/dist/shared/components/FindingFixedMark.js +23 -0
- package/dist/shared/components/GridPresenceLine.js +100 -0
- package/dist/shared/components/IdleReloadWatcher.js +82 -43
- package/dist/shared/components/InStep.js +46 -0
- package/dist/shared/components/ItemEditForm.js +5504 -4889
- package/dist/shared/components/LiveAnnouncer.js +62 -0
- package/dist/shared/components/LiveCount.js +54 -0
- package/dist/shared/components/LiveFigure.js +28 -0
- package/dist/shared/components/LiveListControls.js +114 -0
- package/dist/shared/components/LiveNewMatchesPill.js +25 -0
- package/dist/shared/components/LiveOffNote.js +44 -0
- package/dist/shared/components/LivePreferenceHost.js +42 -0
- package/dist/shared/components/LiveRowMark.js +25 -20
- package/dist/shared/components/LiveTraceView.js +257 -0
- package/dist/shared/components/MapView.js +30 -29
- package/dist/shared/components/MatrixEditor.js +497 -462
- package/dist/shared/components/MyWorkView.js +346 -272
- package/dist/shared/components/NotificationBell.js +215 -201
- package/dist/shared/components/PageRenderer.js +636 -599
- package/dist/shared/components/PresenceDot.js +21 -0
- package/dist/shared/components/ProfileView.js +656 -536
- package/dist/shared/components/RealtimeStatusBanner.js +25 -25
- package/dist/shared/components/RecentRecordsRail.js +51 -48
- package/dist/shared/components/RecordCompare.js +241 -150
- package/dist/shared/components/RecordDrilldownSheet.js +66 -64
- package/dist/shared/components/RecordGridEditor.js +350 -311
- package/dist/shared/components/RecordHoverCard.js +147 -0
- package/dist/shared/components/RecordPeekHost.js +111 -0
- package/dist/shared/components/RecordReadView.js +414 -412
- package/dist/shared/components/RelativeTime.js +16 -0
- package/dist/shared/components/ReportView.js +1396 -1304
- package/dist/shared/components/ScreenRefreshButton.js +77 -0
- package/dist/shared/components/TabCountHost.js +10 -0
- package/dist/shared/components/TickerNumber.js +19 -18
- package/dist/shared/components/TipLayer.js +70 -58
- package/dist/shared/components/WidgetImageMenu.js +59 -0
- package/dist/shared/components/WidgetSlot.js +571 -524
- package/dist/shared/components/activity/RecordActivityStream.js +317 -0
- package/dist/shared/components/bulk/BulkSelectionNotices.js +220 -0
- package/dist/shared/components/cbv/approval-changed.js +20 -0
- package/dist/shared/components/cbv/changed-by-others.js +251 -0
- package/dist/shared/components/cbv/column-totals.js +75 -67
- package/dist/shared/components/change-proposals/ChangeProposalsPanel.js +320 -0
- package/dist/shared/components/change-proposals/ProposalValue.js +28 -0
- package/dist/shared/components/change-proposals/ProposeChangeButton.js +44 -0
- package/dist/shared/components/change-proposals/ProposeChangeDialog.js +359 -0
- package/dist/shared/components/change-proposals/types.js +4 -0
- package/dist/shared/components/chat/ChatPanel.js +1571 -1528
- package/dist/shared/components/chat/Composer.js +276 -298
- package/dist/shared/components/chat/room-due.js +13 -0
- package/dist/shared/components/collections-directory/CollectionRow.js +76 -75
- package/dist/shared/components/collections-directory/CollectionsDirectory.js +415 -395
- package/dist/shared/components/collections-directory/directory-data.js +75 -63
- package/dist/shared/components/imports/ImportConsole.js +159 -155
- package/dist/shared/components/imports/ImportDuplicatesNotice.js +46 -31
- package/dist/shared/components/integrations/SendStatus.js +202 -0
- package/dist/shared/components/integrations/console/IntegrationsConsole.js +45 -36
- package/dist/shared/components/integrations/console/ReadyToSendView.js +453 -0
- package/dist/shared/components/integrations/console/api.js +161 -117
- package/dist/shared/components/integrations/console/tone.js +15 -12
- package/dist/shared/components/item-edit/CatalogPickerField.js +1353 -1245
- package/dist/shared/components/item-edit/ChangedAfterApprovalBadge.js +162 -0
- package/dist/shared/components/item-edit/CloneDialog.js +208 -206
- package/dist/shared/components/item-edit/DerivedCauseNote.js +57 -0
- package/dist/shared/components/item-edit/DraftRecoveryBanner.js +81 -70
- package/dist/shared/components/item-edit/DuplicateNotice.js +169 -101
- package/dist/shared/components/item-edit/FieldAffordances.js +294 -385
- package/dist/shared/components/item-edit/FieldComments.js +159 -116
- package/dist/shared/components/item-edit/FieldPointer.js +132 -0
- package/dist/shared/components/item-edit/FieldRenderer.js +277 -273
- package/dist/shared/components/item-edit/FieldRow.js +519 -439
- package/dist/shared/components/item-edit/FieldSourceBadge.js +88 -0
- package/dist/shared/components/item-edit/FilePickerField.js +454 -369
- package/dist/shared/components/item-edit/GroupSection.js +618 -567
- package/dist/shared/components/item-edit/HeldEditsChip.js +113 -0
- package/dist/shared/components/item-edit/InlineTableField.js +2891 -2723
- package/dist/shared/components/item-edit/ListNeighborNav.js +79 -0
- package/dist/shared/components/item-edit/LiveTraceSheet.js +26 -0
- package/dist/shared/components/item-edit/M2MCombobox.js +284 -273
- package/dist/shared/components/item-edit/OutboxReviewTray.js +313 -0
- package/dist/shared/components/item-edit/PickerBadges.js +52 -0
- package/dist/shared/components/item-edit/PlanGrid.js +434 -439
- package/dist/shared/components/item-edit/RecalcValue.js +55 -0
- package/dist/shared/components/item-edit/RecordChatActions.js +76 -64
- package/dist/shared/components/item-edit/RecordChatMentionsChip.js +103 -0
- package/dist/shared/components/item-edit/RecordGrantTools.js +87 -86
- package/dist/shared/components/item-edit/RecordHelpChip.js +70 -0
- package/dist/shared/components/item-edit/RecordLiveSync.js +230 -217
- package/dist/shared/components/item-edit/RecordOutbox.js +53 -52
- package/dist/shared/components/item-edit/RecordRecapStrip.js +109 -36
- package/dist/shared/components/item-edit/RelationCombobox.js +229 -217
- package/dist/shared/components/item-edit/RelationGroupedCombobox.js +105 -100
- package/dist/shared/components/item-edit/RemoteChangeUi.js +454 -0
- package/dist/shared/components/item-edit/RemoteUploads.js +55 -0
- package/dist/shared/components/item-edit/RemovedLineNote.js +92 -0
- package/dist/shared/components/item-edit/RichTextEditorImpl.js +298 -223
- package/dist/shared/components/item-edit/ScheduledChangeChip.js +244 -0
- package/dist/shared/components/item-edit/SectionPresence.js +78 -0
- package/dist/shared/components/item-edit/SplitLinesButton.js +166 -0
- package/dist/shared/components/item-edit/catalog-line-watch.js +94 -0
- package/dist/shared/components/item-edit/coedit/collab.js +84 -0
- package/dist/shared/components/item-edit/coedit/context.js +24 -0
- package/dist/shared/components/item-edit/coedit/cursors.js +103 -0
- package/dist/shared/components/item-edit/coedit/safe-link.js +15 -0
- package/dist/shared/components/item-edit/coedit/session.js +382 -0
- package/dist/shared/components/item-edit/coedit/useCoedit.js +49 -0
- package/dist/shared/components/item-edit/file-live.js +77 -0
- package/dist/shared/components/item-edit/file-processing.js +87 -0
- package/dist/shared/components/item-edit/layout-switch.js +148 -0
- package/dist/shared/components/item-edit/live-related.js +23 -0
- package/dist/shared/components/item-edit/live-title.js +66 -0
- package/dist/shared/components/item-edit/partner-needs.js +142 -0
- package/dist/shared/components/item-edit/removed-line.js +58 -0
- package/dist/shared/components/item-edit/render-stability.js +70 -59
- package/dist/shared/components/layout-editor/ChangeNote.js +36 -34
- package/dist/shared/components/layout-editor/CollabParts.js +72 -70
- package/dist/shared/components/layout-editor/LayoutEditor.js +306 -303
- package/dist/shared/components/list/InlineEdit.js +504 -208
- package/dist/shared/components/list/ListViewers.js +81 -0
- package/dist/shared/components/merge/MergeRecordsDialog.js +1227 -0
- package/dist/shared/components/merge/MergeWithFlow.js +290 -0
- package/dist/shared/components/merge/merge-values.js +110 -0
- package/dist/shared/components/monitoring/InactiveUserLinksView.js +285 -258
- package/dist/shared/components/notifications/NotificationCenterView.js +388 -321
- package/dist/shared/components/notifications/NotificationDetailBits.js +205 -130
- package/dist/shared/components/notifications/NotificationRulesEditor.js +72 -52
- package/dist/shared/components/notifications/bundles.js +21 -19
- package/dist/shared/components/notifications/resolved-line.js +25 -0
- package/dist/shared/components/ops/OpsTasksView.js +45 -44
- package/dist/shared/components/panels/AccessGrantedNote.js +85 -0
- package/dist/shared/components/panels/AlertBanners.js +132 -0
- package/dist/shared/components/panels/AsyncUserPicker.js +54 -45
- package/dist/shared/components/panels/BranchLanes.js +82 -54
- package/dist/shared/components/panels/CommentAwareness.js +332 -0
- package/dist/shared/components/panels/CommentImages.js +219 -0
- package/dist/shared/components/panels/CommentPanel.js +649 -530
- package/dist/shared/components/panels/ExternalRequestsChip.js +98 -80
- package/dist/shared/components/panels/NewSinceChip.js +16 -0
- package/dist/shared/components/panels/OwnerOpenedLine.js +85 -0
- package/dist/shared/components/panels/PipelinePanel.js +1644 -1494
- package/dist/shared/components/panels/ResubmissionDiff.js +293 -0
- package/dist/shared/components/panels/SlaBreachBanner.js +30 -29
- package/dist/shared/components/panels/SlaClock.js +130 -99
- package/dist/shared/components/panels/TaskPanel.js +308 -287
- package/dist/shared/components/panels/unseen-move-check.js +101 -0
- package/dist/shared/components/pipeline/OwnerMatrix.js +80 -71
- package/dist/shared/components/pipeline/OwnerMatrixSheet.js +495 -0
- package/dist/shared/components/pipeline/PipelineEditorView.js +1855 -1771
- package/dist/shared/components/profile/AgentNameField.js +141 -0
- package/dist/shared/components/profile/AgentsPanel.js +55 -46
- package/dist/shared/components/profile/PersonAccess.js +398 -330
- package/dist/shared/components/profile/PersonAdminTools.js +127 -113
- package/dist/shared/components/profile/PersonProfile.js +81 -73
- package/dist/shared/components/profile/SignInTroubleshooter.js +361 -0
- package/dist/shared/components/queue/QueueBulkBar.js +101 -84
- package/dist/shared/components/queue/QueueItemSheet.js +66 -66
- package/dist/shared/components/queue/QueueTeamStrip.js +279 -0
- package/dist/shared/components/queue/QueueWorklist.js +2076 -1686
- package/dist/shared/components/queue/queue-totals.js +92 -0
- package/dist/shared/components/queue/worklist-helpers.js +18 -14
- package/dist/shared/components/send-view/SendViewButton.js +136 -0
- package/dist/shared/components/send-view/SentViewCards.js +147 -0
- package/dist/shared/components/support/ReportProblem.js +1 -0
- package/dist/shared/components/support/ScreenShare.js +554 -0
- package/dist/shared/components/support/SupportView.js +160 -129
- package/dist/shared/components/support/TicketDetailSheet.js +101 -89
- package/dist/shared/components/watch-list/WatchDock.js +1044 -0
- package/dist/shared/components/watch-list/WatchExtras.js +723 -0
- package/dist/shared/components/watch-list/WatchListButton.js +46 -0
- package/dist/shared/components/watch-list/WatchPinButton.js +67 -0
- package/dist/shared/components/watch-list/WatchRows.js +348 -0
- package/dist/shared/lib/activity-sentence.js +87 -75
- package/dist/shared/lib/agent-presence.js +46 -0
- package/dist/shared/lib/approval-progress.js +49 -0
- package/dist/shared/lib/attention-prefs.js +27 -0
- package/dist/shared/lib/cell-locks.js +56 -0
- package/dist/shared/lib/co-edit.js +166 -0
- package/dist/shared/lib/coedit-registry.js +44 -0
- package/dist/shared/lib/comment-awareness.js +124 -0
- package/dist/shared/lib/comment-images.js +45 -0
- package/dist/shared/lib/config-watch.js +94 -0
- package/dist/shared/lib/copy-rules.js +65 -0
- package/dist/shared/lib/count-step.js +30 -0
- package/dist/shared/lib/deadline-ticker.js +68 -0
- package/dist/shared/lib/derived-causes.js +115 -0
- package/dist/shared/lib/draft-store.js +114 -85
- package/dist/shared/lib/error-hints.js +1 -0
- package/dist/shared/lib/field-merge.js +126 -0
- package/dist/shared/lib/filter-sentence.js +10 -10
- package/dist/shared/lib/focus-mode.js +16 -12
- package/dist/shared/lib/grid-cursors.js +77 -0
- package/dist/shared/lib/grid-presence.js +182 -0
- package/dist/shared/lib/idle-reload.js +100 -73
- package/dist/shared/lib/in-step.js +45 -0
- package/dist/shared/lib/integration-chip.js +19 -18
- package/dist/shared/lib/line-locks.js +141 -0
- package/dist/shared/lib/line-split.js +41 -0
- package/dist/shared/lib/linked-changes.js +150 -0
- package/dist/shared/lib/list-link.js +56 -50
- package/dist/shared/lib/list-return.js +231 -0
- package/dist/shared/lib/list-viewers.js +52 -0
- package/dist/shared/lib/live-announcer.js +86 -0
- package/dist/shared/lib/live-counts.js +85 -0
- package/dist/shared/lib/live-data-changed.js +108 -0
- package/dist/shared/lib/live-deltas.js +81 -0
- package/dist/shared/lib/live-findings.js +113 -0
- package/dist/shared/lib/live-groups.js +122 -0
- package/dist/shared/lib/live-link-labels.js +162 -0
- package/dist/shared/lib/live-list-flow.js +334 -0
- package/dist/shared/lib/live-list.js +143 -129
- package/dist/shared/lib/live-moves.js +51 -0
- package/dist/shared/lib/live-ops.js +26 -26
- package/dist/shared/lib/live-pickers.js +7 -0
- package/dist/shared/lib/live-preference.js +184 -0
- package/dist/shared/lib/live-queries.js +226 -181
- package/dist/shared/lib/live-screen.js +333 -0
- package/dist/shared/lib/live-search.js +108 -0
- package/dist/shared/lib/live-seen.js +35 -0
- package/dist/shared/lib/live-views.js +100 -0
- package/dist/shared/lib/live.js +159 -133
- package/dist/shared/lib/missed-updates.js +198 -0
- package/dist/shared/lib/newer-file.js +56 -0
- package/dist/shared/lib/notification-sound.js +42 -20
- package/dist/shared/lib/own-writes.js +59 -41
- package/dist/shared/lib/picker-badges.js +94 -0
- package/dist/shared/lib/presence-signals.js +131 -84
- package/dist/shared/lib/realtime.js +49 -24
- package/dist/shared/lib/record-gaps.js +85 -0
- package/dist/shared/lib/record-outbox.js +369 -222
- package/dist/shared/lib/record-peek.js +75 -0
- package/dist/shared/lib/record-tabs.js +92 -72
- package/dist/shared/lib/relative-ticker.js +42 -0
- package/dist/shared/lib/request-gate.js +119 -119
- package/dist/shared/lib/rollup-recalc.js +107 -0
- package/dist/shared/lib/room-gaps.js +40 -36
- package/dist/shared/lib/rum.js +137 -87
- package/dist/shared/lib/save-progress.js +20 -0
- package/dist/shared/lib/scheduled-countdown.js +67 -0
- package/dist/shared/lib/screen-refresh.js +160 -0
- package/dist/shared/lib/screen-share.js +234 -0
- package/dist/shared/lib/seen-since.js +74 -0
- package/dist/shared/lib/selection-watch.js +205 -0
- package/dist/shared/lib/send-status.js +132 -0
- package/dist/shared/lib/send-view.js +23 -0
- package/dist/shared/lib/socket-liveness.js +155 -0
- package/dist/shared/lib/socket-realtime.js +168 -140
- package/dist/shared/lib/state-census.js +53 -0
- package/dist/shared/lib/summary-mode.js +61 -39
- package/dist/shared/lib/tab-attention.js +143 -32
- package/dist/shared/lib/table-density.js +64 -0
- package/dist/shared/lib/track-travel.js +40 -0
- package/dist/shared/lib/unseen-changes.js +68 -0
- package/dist/shared/lib/upload-file.js +33 -0
- package/dist/shared/lib/upload-presence.js +127 -0
- package/dist/shared/lib/urgent-chime.js +65 -0
- package/dist/shared/lib/use-online-users.js +32 -11
- package/dist/shared/lib/user-sync.js +155 -39
- package/dist/shared/lib/waiting-count.js +44 -0
- package/dist/shared/lib/watch-desktop.js +83 -0
- package/dist/shared/lib/watch-list.js +447 -0
- package/dist/shared/lib/widget-image-render.js +64 -0
- package/dist/shared/lib/widget-image.js +111 -0
- package/dist/shared/lib/worker-socket.js +130 -104
- package/dist/shared/lib/write-to-screen.js +133 -0
- package/package.json +1 -1
- package/styles.css +49 -1
|
@@ -1,34 +1,37 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as f, jsx as s, Fragment as mt } from "react/jsx-runtime";
|
|
2
2
|
import { useQuery as I } from "@tanstack/react-query";
|
|
3
|
-
import { ChevronDown as
|
|
3
|
+
import { ChevronDown as ft, Loader2 as ye, AlertTriangle as Ot, Search as Mt, X as Tt, Check as pt } from "lucide-react";
|
|
4
4
|
import { useState as F, useRef as D, useEffect as w, useId as gt, useLayoutEffect as ht, useMemo as A } from "react";
|
|
5
|
-
import { createPortal as
|
|
6
|
-
import { useNivaroClient as
|
|
7
|
-
import { get as
|
|
8
|
-
import { compareByMatch as
|
|
9
|
-
import { useRecordReader as
|
|
10
|
-
import { useOnlineUsers as
|
|
11
|
-
import { SearchHighlight as
|
|
12
|
-
import { UserAvatar as
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
5
|
+
import { createPortal as vt } from "react-dom";
|
|
6
|
+
import { useNivaroClient as Me, useItemEditAuth as jt, useStaleFieldReporter as Pt } from "../../context.js";
|
|
7
|
+
import { get as V, post as Ut } from "../../lib/commands.js";
|
|
8
|
+
import { compareByMatch as Ht } from "../../lib/picker-rank.js";
|
|
9
|
+
import { useRecordReader as wt } from "../../lib/record-loader.js";
|
|
10
|
+
import { useOnlineUsers as Jt } from "../../lib/use-online-users.js";
|
|
11
|
+
import { SearchHighlight as zt } from "../SearchHighlight.js";
|
|
12
|
+
import { UserAvatar as Yt } from "../UserAvatar.js";
|
|
13
|
+
import { pickerOptionsMeta as bt } from "../../lib/live-pickers.js";
|
|
14
|
+
import { useOptionBadges as Wt } from "../../lib/picker-badges.js";
|
|
15
|
+
import { queryKeys as Gt } from "../../lib/query-keys.js";
|
|
16
|
+
import { userOptionFilter as Vt, matchesAllTokens as Xt, cn as H } from "../../lib/utils.js";
|
|
15
17
|
import { applyDisplayTemplate as k } from "./helpers.js";
|
|
16
|
-
import { collidingIds as
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
|
|
18
|
+
import { collidingIds as Zt, disambiguators as Qt, isNamelessLabel as ne, NAMELESS_LABEL as le } from "./option-disambiguate.js";
|
|
19
|
+
import { RecordPickerBadges as Bt, PickerBadgeList as en } from "./PickerBadges.js";
|
|
20
|
+
import { usePickerMissReport as tn } from "./picker-miss.js";
|
|
21
|
+
import { useLatestSearch as nn, onlyCloseMatches as yt, labelOnlyMatches as rn, narrowLocally as on, PICKER_PAGE as sn } from "./picker-search.js";
|
|
22
|
+
import { retryRelatedRead as kt, useRelatedMissing as Nt, RelatedMissingLabel as St } from "./related-missing.js";
|
|
23
|
+
function an(o) {
|
|
21
24
|
return o.replace(/\(.*$/, "").trim().split(/\s+/).map((r) => r[0]).filter(Boolean).slice(0, 2).join("").toUpperCase() || "?";
|
|
22
25
|
}
|
|
23
|
-
function
|
|
26
|
+
function ln(o) {
|
|
24
27
|
const [r, h] = F(null), g = {
|
|
25
|
-
onMouseEnter: (
|
|
28
|
+
onMouseEnter: (R) => {
|
|
26
29
|
if (!o) return;
|
|
27
|
-
const x =
|
|
30
|
+
const x = R.currentTarget.getBoundingClientRect(), N = window.innerHeight - x.bottom < 80;
|
|
28
31
|
h({ x: x.left, y: N ? x.top - 58 : x.bottom + 4 });
|
|
29
32
|
},
|
|
30
33
|
onMouseLeave: () => h(null)
|
|
31
|
-
}, O = o && r ?
|
|
34
|
+
}, O = o && r ? vt(
|
|
32
35
|
/* @__PURE__ */ s(
|
|
33
36
|
"div",
|
|
34
37
|
{
|
|
@@ -41,36 +44,36 @@ function nn(o) {
|
|
|
41
44
|
) : null;
|
|
42
45
|
return { bind: g, tip: O };
|
|
43
46
|
}
|
|
44
|
-
function
|
|
47
|
+
function xt(o, r) {
|
|
45
48
|
return o == null || o === "" || r == null || r === "" ? !1 : String(o) === String(r);
|
|
46
49
|
}
|
|
47
|
-
function
|
|
50
|
+
function cn({
|
|
48
51
|
collection: o,
|
|
49
52
|
value: r,
|
|
50
53
|
onChange: h,
|
|
51
54
|
disabled: g,
|
|
52
55
|
placeholder: O,
|
|
53
|
-
extraFilter:
|
|
56
|
+
extraFilter: R,
|
|
54
57
|
autoSelectSingle: x,
|
|
55
58
|
optionSort: N,
|
|
56
|
-
requiredParent:
|
|
59
|
+
requiredParent: q,
|
|
57
60
|
facets: l,
|
|
58
|
-
fieldKey:
|
|
61
|
+
fieldKey: M,
|
|
59
62
|
narrowedBy: d,
|
|
60
|
-
pinned:
|
|
63
|
+
pinned: m,
|
|
61
64
|
missPlacement: y,
|
|
62
65
|
defaultOpen: xe,
|
|
63
|
-
onClose:
|
|
64
|
-
displayTemplate:
|
|
66
|
+
onClose: Te,
|
|
67
|
+
displayTemplate: Lt
|
|
65
68
|
}) {
|
|
66
|
-
const
|
|
67
|
-
de.current =
|
|
69
|
+
const X = Me(), je = wt(), [i, $] = F(xe ?? !1), [c, ce] = F(""), de = D(Te);
|
|
70
|
+
de.current = Te;
|
|
68
71
|
const Pe = D(i);
|
|
69
72
|
w(() => {
|
|
70
73
|
var e;
|
|
71
74
|
Pe.current && !i && ((e = de.current) == null || e.call(de)), Pe.current = i;
|
|
72
75
|
}, [i]);
|
|
73
|
-
const [
|
|
76
|
+
const [_t, Et] = F(!1), T = nn(c, _t), Ue = D(null), Z = D(null), ve = D(null), J = D(null), we = gt(), He = gt(), [Je, z] = F(-1), j = D(null), re = () => {
|
|
74
77
|
var t;
|
|
75
78
|
const e = Ue.current;
|
|
76
79
|
if (!e || document.activeElement === e) return;
|
|
@@ -79,25 +82,25 @@ function rn({
|
|
|
79
82
|
(t = e.setSelectionRange) == null || t.call(e, n, n);
|
|
80
83
|
};
|
|
81
84
|
w(() => {
|
|
82
|
-
i ? setTimeout(
|
|
85
|
+
i ? setTimeout(re, 30) : (ce(""), j.current = null);
|
|
83
86
|
}, [i]);
|
|
84
87
|
const ke = D(!1), Ne = () => {
|
|
85
88
|
var e;
|
|
86
|
-
$(!1), (e =
|
|
89
|
+
$(!1), (e = J.current) == null || e.focus(), ke.current = !0;
|
|
87
90
|
};
|
|
88
91
|
w(() => {
|
|
89
92
|
var n;
|
|
90
93
|
if (!ke.current) return;
|
|
91
94
|
ke.current = !1;
|
|
92
95
|
const e = document.activeElement;
|
|
93
|
-
(!e || e === document.body) && ((n =
|
|
96
|
+
(!e || e === document.body) && ((n = J.current) == null || n.focus());
|
|
94
97
|
}), w(() => {
|
|
95
98
|
if (!i) return;
|
|
96
99
|
const e = (n) => {
|
|
97
|
-
var E,
|
|
100
|
+
var E, C, ae;
|
|
98
101
|
if (n.key !== "Escape") return;
|
|
99
102
|
const t = document.activeElement;
|
|
100
|
-
(t === document.body || t && ((E = ve.current) != null && E.contains(t) || (
|
|
103
|
+
(t === document.body || t && ((E = ve.current) != null && E.contains(t) || (C = Z.current) != null && C.contains(t))) && (n.preventDefault(), n.stopPropagation(), $(!1), (ae = J.current) == null || ae.focus());
|
|
101
104
|
};
|
|
102
105
|
return window.addEventListener("keydown", e, !0), () => window.removeEventListener("keydown", e, !0);
|
|
103
106
|
}, [i]), w(() => {
|
|
@@ -105,7 +108,7 @@ function rn({
|
|
|
105
108
|
const e = (n) => {
|
|
106
109
|
var a, E;
|
|
107
110
|
const t = n.target;
|
|
108
|
-
!t || t === document.body || (a = t.closest) != null && a.call(t, "[data-nvr-combobox-panel]") || (E =
|
|
111
|
+
!t || t === document.body || (a = t.closest) != null && a.call(t, "[data-nvr-combobox-panel]") || (E = Z.current) != null && E.contains(t) || $(!1);
|
|
109
112
|
};
|
|
110
113
|
return document.addEventListener("focusin", e), () => document.removeEventListener("focusin", e);
|
|
111
114
|
}, [i]), w(() => {
|
|
@@ -113,31 +116,31 @@ function rn({
|
|
|
113
116
|
const e = (n) => {
|
|
114
117
|
var a;
|
|
115
118
|
const t = n.target;
|
|
116
|
-
(a = t == null ? void 0 : t.closest) != null && a.call(t, "[data-nvr-combobox-panel]") ||
|
|
119
|
+
(a = t == null ? void 0 : t.closest) != null && a.call(t, "[data-nvr-combobox-panel]") || Z.current && !Z.current.contains(n.target) && $(!1);
|
|
117
120
|
};
|
|
118
121
|
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
119
122
|
}, [i]);
|
|
120
|
-
const [Se, Le] = F(null), [_e,
|
|
123
|
+
const [Se, Le] = F(null), [_e, Rt] = F(null);
|
|
121
124
|
ht(() => {
|
|
122
125
|
if (!i) {
|
|
123
126
|
Le(null);
|
|
124
127
|
return;
|
|
125
128
|
}
|
|
126
129
|
const e = () => {
|
|
127
|
-
const n =
|
|
130
|
+
const n = Z.current;
|
|
128
131
|
if (!n) return;
|
|
129
132
|
const t = n.getBoundingClientRect(), a = n.closest('[role="dialog"]') ?? document.body;
|
|
130
|
-
|
|
131
|
-
const E = window.innerHeight - t.bottom < 340 && t.top > window.innerHeight - t.bottom,
|
|
133
|
+
Rt(a);
|
|
134
|
+
const E = window.innerHeight - t.bottom < 340 && t.top > window.innerHeight - t.bottom, C = t.left, ae = E ? t.top - 4 : t.bottom + 4, dt = {
|
|
132
135
|
minWidth: t.width,
|
|
133
136
|
zIndex: 120,
|
|
134
137
|
...E ? { transform: "translateY(-100%)" } : {}
|
|
135
138
|
};
|
|
136
139
|
if (a === document.body)
|
|
137
|
-
Le({ position: "fixed", left:
|
|
140
|
+
Le({ position: "fixed", left: C, top: ae, ...dt });
|
|
138
141
|
else {
|
|
139
142
|
const ut = a.getBoundingClientRect();
|
|
140
|
-
Le({ position: "absolute", left:
|
|
143
|
+
Le({ position: "absolute", left: C - ut.left, top: ae - ut.top, ...dt });
|
|
141
144
|
}
|
|
142
145
|
};
|
|
143
146
|
return e(), window.addEventListener("scroll", e, !0), window.addEventListener("resize", e), () => {
|
|
@@ -146,17 +149,17 @@ function rn({
|
|
|
146
149
|
}, [i]);
|
|
147
150
|
const ze = i && !!Se && !!_e;
|
|
148
151
|
ht(() => {
|
|
149
|
-
ze && document.activeElement ===
|
|
152
|
+
ze && document.activeElement === J.current && re();
|
|
150
153
|
}, [ze]);
|
|
151
154
|
const { data: Ee, isPending: Ye } = I({
|
|
152
155
|
queryKey: ["col-meta", o],
|
|
153
|
-
queryFn: () =>
|
|
156
|
+
queryFn: () => X.request(V(`/collections/${o}`)).then((e) => e.data),
|
|
154
157
|
staleTime: 3e5,
|
|
155
158
|
retry: !1
|
|
156
|
-
}), [
|
|
157
|
-
queryKey:
|
|
158
|
-
queryFn: () =>
|
|
159
|
-
|
|
159
|
+
}), [Re, qt] = F({}), { data: We = [] } = I({
|
|
160
|
+
queryKey: Gt.collectionRelations(o),
|
|
161
|
+
queryFn: () => X.request(
|
|
162
|
+
V(`/collections/${o}`)
|
|
160
163
|
).then(
|
|
161
164
|
(e) => {
|
|
162
165
|
var n;
|
|
@@ -174,46 +177,48 @@ function rn({
|
|
|
174
177
|
t != null && t.one_collection && (e[n.field] = t.one_collection);
|
|
175
178
|
}
|
|
176
179
|
return e;
|
|
177
|
-
}, [l, We, o]),
|
|
180
|
+
}, [l, We, o]), P = o === "nivaro_users", $t = Jt(P), Ge = jt().isAdmin, qe = A(() => {
|
|
178
181
|
const e = [];
|
|
179
|
-
|
|
180
|
-
for (const [n, t] of Object.entries(
|
|
182
|
+
P && e.push(Vt(Ge)), R && e.push(R);
|
|
183
|
+
for (const [n, t] of Object.entries(Re))
|
|
181
184
|
t != null && t !== "" && e.push({ [n]: { _eq: t } });
|
|
182
185
|
if (e.length !== 0)
|
|
183
186
|
return e.length === 1 ? e[0] : { _and: e };
|
|
184
|
-
}, [
|
|
187
|
+
}, [R, Re, Ge]), Q = Lt || (Ee == null ? void 0 : Ee.display_template) || (P ? "{{first_name}} {{last_name}} ({{email}})" : null), v = A(() => {
|
|
185
188
|
if (!Q) return;
|
|
186
189
|
const e = [...Q.matchAll(/\{\{([\w.]+)\}\}/g)].map((n) => n[1]);
|
|
187
190
|
if (e.length)
|
|
188
191
|
return [.../* @__PURE__ */ new Set(["id", ...e])].join(",");
|
|
189
|
-
}, [Q]), S =
|
|
190
|
-
|
|
191
|
-
limit:
|
|
192
|
+
}, [Q]), S = qe ? JSON.stringify(qe) : void 0, Y = N && !/^-?label$/.test(N) ? N : void 0, Ve = (e) => X.request(
|
|
193
|
+
V(`/items/${o}`, {
|
|
194
|
+
limit: sn,
|
|
192
195
|
picker: "1",
|
|
193
196
|
// Typo pass (fix11-search): only when the exact search finds nothing,
|
|
194
197
|
// the server answers close matches, each marked `fuzzy`.
|
|
195
198
|
...e.trim() ? { search: e.trim(), typo: "1" } : {},
|
|
196
199
|
...S ? { filter: S } : {},
|
|
197
200
|
...v ? { fields: v } : {},
|
|
198
|
-
...
|
|
201
|
+
...Y ? { sort: Y } : {}
|
|
199
202
|
})
|
|
200
203
|
).then((n) => n.data ?? []), {
|
|
201
204
|
data: u,
|
|
202
|
-
isFetching:
|
|
203
|
-
isPlaceholderData:
|
|
205
|
+
isFetching: W,
|
|
206
|
+
isPlaceholderData: Ce
|
|
204
207
|
} = I({
|
|
205
208
|
queryKey: [
|
|
206
209
|
"relation-opts",
|
|
207
210
|
o,
|
|
208
|
-
|
|
211
|
+
T,
|
|
209
212
|
S,
|
|
210
213
|
v,
|
|
211
|
-
|
|
214
|
+
Y ?? ""
|
|
212
215
|
],
|
|
213
|
-
queryFn: () => Ve(
|
|
216
|
+
queryFn: () => Ve(T),
|
|
214
217
|
// Wait for the display template: it decides `fields`, and starting before
|
|
215
218
|
// it lands sent the whole first page twice.
|
|
216
219
|
enabled: i && !Ye,
|
|
220
|
+
// Someone else's new / changed / removed record: re-read on the next open (live-pickers.ts).
|
|
221
|
+
meta: bt(o),
|
|
217
222
|
staleTime: S ? 0 : 3e4,
|
|
218
223
|
// A new SEARCH keeps the previous answer on screen (narrowed locally below)
|
|
219
224
|
// instead of blanking the list behind a spinner. A changed filter, sort or
|
|
@@ -221,57 +226,58 @@ function rn({
|
|
|
221
226
|
placeholderData: (e, n) => {
|
|
222
227
|
const t = n == null ? void 0 : n.queryKey;
|
|
223
228
|
if (!(!e || !t))
|
|
224
|
-
return t[1] === o && t[3] === S && t[4] === v && t[5] === (
|
|
229
|
+
return t[1] === o && t[3] === S && t[4] === v && t[5] === (Y ?? "") ? e : void 0;
|
|
225
230
|
}
|
|
226
231
|
});
|
|
227
|
-
w(() =>
|
|
228
|
-
const ue = !!
|
|
229
|
-
queryKey: ["relation-opts", o, "", S, v,
|
|
232
|
+
w(() => Et(W), [W]);
|
|
233
|
+
const ue = !!T.trim() && c === T && !Ce && !W && u !== void 0 && (u.length === 0 || yt(u)), { data: me } = I({
|
|
234
|
+
queryKey: ["relation-opts", o, "", S, v, Y ?? ""],
|
|
230
235
|
queryFn: () => Ve(""),
|
|
231
236
|
enabled: i && !Ye && ue,
|
|
237
|
+
meta: bt(o),
|
|
232
238
|
staleTime: S ? 0 : 3e4
|
|
233
239
|
}), K = A(
|
|
234
|
-
() => ue &&
|
|
235
|
-
|
|
240
|
+
() => ue && me ? rn(
|
|
241
|
+
me,
|
|
236
242
|
(e) => k(Q, e) || "",
|
|
237
243
|
c
|
|
238
244
|
) : null,
|
|
239
|
-
[ue,
|
|
240
|
-
), Xe = ue &&
|
|
241
|
-
|
|
245
|
+
[ue, me, Q, c]
|
|
246
|
+
), Xe = ue && me === void 0, oe = !!u && yt(u) && !(K && K.length > 0);
|
|
247
|
+
tn({
|
|
242
248
|
placement: y,
|
|
243
249
|
open: i,
|
|
244
|
-
search:
|
|
245
|
-
settled: !
|
|
250
|
+
search: T,
|
|
251
|
+
settled: !W && !Ce && u !== void 0 && !Xe,
|
|
246
252
|
count: (K == null ? void 0 : K.length) ?? (u == null ? void 0 : u.length) ?? 0
|
|
247
253
|
});
|
|
248
254
|
const {
|
|
249
|
-
data:
|
|
255
|
+
data: B,
|
|
250
256
|
isLoading: Ze,
|
|
251
257
|
error: Qe,
|
|
252
|
-
isFetched:
|
|
258
|
+
isFetched: Dt
|
|
253
259
|
} = I({
|
|
254
260
|
queryKey: ["relation-single", o, String(r), v],
|
|
255
|
-
queryFn: () =>
|
|
261
|
+
queryFn: () => je(o, r, v),
|
|
256
262
|
enabled: !!r,
|
|
257
263
|
staleTime: 6e4,
|
|
258
|
-
retry:
|
|
259
|
-
}), Be = !!r && !Ze &&
|
|
264
|
+
retry: kt
|
|
265
|
+
}), Be = !!r && !Ze && Dt && !B, { settling: et } = Nt(
|
|
260
266
|
Qe,
|
|
261
267
|
Be ? o : null,
|
|
262
268
|
r
|
|
263
|
-
), L = (
|
|
269
|
+
), L = (m == null ? void 0 : m.id) != null && m.id !== "" ? String(m.id) : null, { data: U } = I({
|
|
264
270
|
queryKey: ["relation-single", o, L ?? "", v],
|
|
265
|
-
queryFn: () =>
|
|
271
|
+
queryFn: () => je(o, L, v).catch(
|
|
266
272
|
() => null
|
|
267
273
|
),
|
|
268
274
|
enabled: !!L && i,
|
|
269
275
|
staleTime: 6e4
|
|
270
|
-
}),
|
|
276
|
+
}), It = JSON.stringify(R ? { _and: [{ id: { _eq: r } }, R] } : { id: { _eq: r } }), { data: fe } = I({
|
|
271
277
|
queryKey: ["relation-avail", o, String(r), S],
|
|
272
|
-
queryFn: () =>
|
|
273
|
-
|
|
274
|
-
filter:
|
|
278
|
+
queryFn: () => X.request(
|
|
279
|
+
V(`/items/${o}`, {
|
|
280
|
+
filter: It,
|
|
275
281
|
picker: "1",
|
|
276
282
|
limit: 1,
|
|
277
283
|
fields: "id"
|
|
@@ -280,9 +286,9 @@ function rn({
|
|
|
280
286
|
// The pinned option is offered OUTSIDE the option filter (a type's generic
|
|
281
287
|
// item is excluded from the general list on purpose), so a value that IS
|
|
282
288
|
// the pin is available by construction — never probe it, never flag it.
|
|
283
|
-
enabled: !!r && !!
|
|
289
|
+
enabled: !!r && !!B && String(r) !== L,
|
|
284
290
|
staleTime: 3e4
|
|
285
|
-
}),
|
|
291
|
+
}), se = !!r && String(r) !== L && fe !== void 0 && fe.length === 0, pe = D(null), $e = D(!1), tt = `${o}|${S ?? ""}`, Kt = () => {
|
|
286
292
|
$e.current = !0, pe.current = tt, h(null);
|
|
287
293
|
}, ge = r == null || r === "";
|
|
288
294
|
w(() => {
|
|
@@ -290,8 +296,8 @@ function rn({
|
|
|
290
296
|
}, [ge]), w(() => {
|
|
291
297
|
if (!x || g || !ge || $e.current) return;
|
|
292
298
|
const e = tt;
|
|
293
|
-
pe.current !== e && (pe.current = e,
|
|
294
|
-
|
|
299
|
+
pe.current !== e && (pe.current = e, X.request(
|
|
300
|
+
V(`/items/${o}`, {
|
|
295
301
|
limit: 2,
|
|
296
302
|
picker: "1",
|
|
297
303
|
fields: "id",
|
|
@@ -305,77 +311,81 @@ function rn({
|
|
|
305
311
|
pe.current = null;
|
|
306
312
|
}));
|
|
307
313
|
}, [x, g, ge, o, S]);
|
|
308
|
-
const b = Q, De = r &&
|
|
309
|
-
() => (K && (K.length > 0 || !(u != null && u.length)) ? K : null) ??
|
|
314
|
+
const b = Q, De = r && B ? k(b, B) : null, Ie = De === null ? null : ne(De) ? le : De, G = !Ce && c === T && !Xe, Ke = A(
|
|
315
|
+
() => (K && (K.length > 0 || !(u != null && u.length)) ? K : null) ?? on(
|
|
310
316
|
u ?? [],
|
|
311
317
|
(e) => k(b, e) || `#${e.id}`,
|
|
312
318
|
// The server also reads a joined code by its parts ("2026-NNO-POWER"
|
|
313
319
|
// finds 2026-WEST-NNO-HE-POWERING, services/search-synonyms.ts), so
|
|
314
320
|
// the list narrowed while that search is out does too.
|
|
315
321
|
c.replace(/[-_/]+/g, " "),
|
|
316
|
-
|
|
322
|
+
G
|
|
317
323
|
),
|
|
318
|
-
[u, b, c,
|
|
324
|
+
[u, b, c, G, K]
|
|
319
325
|
), he = A(
|
|
320
|
-
() =>
|
|
326
|
+
() => Zt(u ?? [], (e) => k(b, e) || `#${e.id}`),
|
|
321
327
|
[u, b]
|
|
322
|
-
), { data:
|
|
328
|
+
), { data: ie } = I({
|
|
323
329
|
queryKey: ["relation-opts-dups", o, he.join(",")],
|
|
324
|
-
queryFn: () =>
|
|
325
|
-
|
|
330
|
+
queryFn: () => X.request(
|
|
331
|
+
V(`/items/${o}`, {
|
|
326
332
|
limit: he.length,
|
|
327
333
|
picker: "1",
|
|
328
334
|
filter: JSON.stringify({ id: { _in: he } }),
|
|
329
335
|
fields: "*"
|
|
330
336
|
})
|
|
331
337
|
).then((e) => e.data ?? []),
|
|
332
|
-
enabled: i && he.length > 0 && !
|
|
338
|
+
enabled: i && he.length > 0 && !P,
|
|
333
339
|
staleTime: 6e4
|
|
334
340
|
}), nt = A(() => {
|
|
335
|
-
if (!(
|
|
341
|
+
if (!(ie != null && ie.length)) return /* @__PURE__ */ new Map();
|
|
336
342
|
const e = new Map(
|
|
337
343
|
(u ?? []).map((t) => [
|
|
338
344
|
String(t.id),
|
|
339
345
|
(k(b, t) || `#${t.id}`).trim().toLowerCase()
|
|
340
346
|
])
|
|
341
347
|
), n = /* @__PURE__ */ new Map();
|
|
342
|
-
for (const t of
|
|
348
|
+
for (const t of ie) {
|
|
343
349
|
const a = e.get(String(t.id));
|
|
344
350
|
a !== void 0 && n.set(a, [...n.get(a) ?? [], t]);
|
|
345
351
|
}
|
|
346
|
-
return
|
|
352
|
+
return Qt(
|
|
347
353
|
[...n.values()],
|
|
348
354
|
((v == null ? void 0 : v.split(",")) ?? []).map((t) => t.split(".")[0])
|
|
349
355
|
);
|
|
350
|
-
}, [
|
|
351
|
-
() => (u ?? []).some((e) => !
|
|
356
|
+
}, [ie, u, b, v]), At = !!r && Ze && !B || et, rt = ln(se), ot = A(
|
|
357
|
+
() => (u ?? []).some((e) => !ne(k(b, e))),
|
|
352
358
|
[u, b]
|
|
353
|
-
),
|
|
354
|
-
() => (
|
|
355
|
-
(e, n) =>
|
|
359
|
+
), ee = A(
|
|
360
|
+
() => (Y ? [...Ke] : [...Ke].sort(
|
|
361
|
+
(e, n) => Ht(
|
|
356
362
|
k(b, e),
|
|
357
363
|
k(b, n),
|
|
358
364
|
c,
|
|
359
365
|
N === "-label"
|
|
360
366
|
)
|
|
361
367
|
)).filter((e) => !L || String(e.id) !== L).filter(
|
|
362
|
-
(e) => !ot || String(e.id) === String(r) || !
|
|
368
|
+
(e) => !ot || String(e.id) === String(r) || !ne(k(b, e))
|
|
363
369
|
),
|
|
364
|
-
[Ke,
|
|
365
|
-
),
|
|
366
|
-
|
|
370
|
+
[Ke, Y, b, c, N, L, r, ot]
|
|
371
|
+
), Ft = Wt(
|
|
372
|
+
o,
|
|
373
|
+
ee.map((e) => e.id),
|
|
374
|
+
i && !P
|
|
375
|
+
), st = U && !ne(k(b, U)) ? k(b, U) : le, Ae = !!L && (!c.trim() || Xt(
|
|
376
|
+
`${U ? st : ""} ${(m == null ? void 0 : m.tag) ?? "Default"}`,
|
|
367
377
|
c.replace(/[-_/]+/g, " ")
|
|
368
|
-
)),
|
|
378
|
+
)), te = Ae ? 1 : 0, _ = te + ee.length, p = Je >= _ ? _ - 1 : Je;
|
|
369
379
|
w(() => {
|
|
370
|
-
|
|
371
|
-
}, [i, c,
|
|
380
|
+
z(i && c.trim() && !oe ? te : -1);
|
|
381
|
+
}, [i, c, te, oe]);
|
|
372
382
|
const Fe = (e) => `${we}-opt-${e}`, it = () => {
|
|
373
|
-
const e = (
|
|
374
|
-
|
|
383
|
+
const e = (U == null ? void 0 : U.id) ?? (m == null ? void 0 : m.id);
|
|
384
|
+
xt(r, e) || h(e), Ne();
|
|
375
385
|
}, at = (e) => {
|
|
376
|
-
|
|
386
|
+
xt(r, e.id) || h(e.id), Ne();
|
|
377
387
|
}, be = (e) => {
|
|
378
|
-
e < 0 || e >= _ || (e <
|
|
388
|
+
e < 0 || e >= _ || (e < te ? it() : at(ee[e - te]));
|
|
379
389
|
};
|
|
380
390
|
w(() => {
|
|
381
391
|
var n, t;
|
|
@@ -383,18 +393,18 @@ function rn({
|
|
|
383
393
|
const e = (n = ve.current) == null ? void 0 : n.querySelector(`[data-nav-index="${p}"]`);
|
|
384
394
|
(t = e == null ? void 0 : e.scrollIntoView) == null || t.call(e, { block: "nearest" });
|
|
385
395
|
}, [i, p]), w(() => {
|
|
386
|
-
const e =
|
|
396
|
+
const e = j.current;
|
|
387
397
|
if (e !== null) {
|
|
388
398
|
if (!i || e !== c) {
|
|
389
|
-
|
|
399
|
+
j.current = null;
|
|
390
400
|
return;
|
|
391
401
|
}
|
|
392
|
-
|
|
402
|
+
G && (j.current = null, p >= 0 ? be(p) : _ === 1 && u !== void 0 && !oe && be(0));
|
|
393
403
|
}
|
|
394
|
-
}, [i, c,
|
|
404
|
+
}, [i, c, G, p, _]);
|
|
395
405
|
const lt = (e) => {
|
|
396
406
|
var n;
|
|
397
|
-
e.key === "ArrowDown" ? (e.preventDefault(), _ > 0 &&
|
|
407
|
+
e.key === "ArrowDown" ? (e.preventDefault(), _ > 0 && z(p < 0 ? 0 : Math.min(p + 1, _ - 1))) : e.key === "ArrowUp" ? (e.preventDefault(), _ > 0 && z(p <= 0 ? 0 : p - 1)) : e.key === "Home" && _ > 0 && !c ? (e.preventDefault(), z(0)) : e.key === "End" && _ > 0 && !c ? (e.preventDefault(), z(_ - 1)) : e.key === "Enter" ? (e.preventDefault(), c.trim() && !G ? j.current = c : p >= 0 ? be(p) : _ === 1 && G && u !== void 0 && !oe && be(0)) : e.key === "Tab" && ($(!1), (n = J.current) == null || n.focus());
|
|
398
408
|
}, ct = (e) => {
|
|
399
409
|
if (g) return;
|
|
400
410
|
const n = e.key.length === 1 && !e.ctrlKey && !e.metaKey && !e.altKey && (i || e.key !== " ");
|
|
@@ -403,30 +413,30 @@ function rn({
|
|
|
403
413
|
else if (n) {
|
|
404
414
|
e.preventDefault();
|
|
405
415
|
const t = e.key;
|
|
406
|
-
|
|
407
|
-
} else i && e.key === "Backspace" ? (e.preventDefault(),
|
|
408
|
-
}, Oe =
|
|
416
|
+
j.current = null, ce((a) => t === " " && (a === "" || a.endsWith(" ")) ? a : a + t), i ? re() : $(!0);
|
|
417
|
+
} else i && e.key === "Backspace" ? (e.preventDefault(), j.current = null, ce((t) => t.slice(0, -1)), re()) : i && (e.key === "Enter" || e.key === "ArrowDown" || e.key === "ArrowUp" || e.key === "Home" || e.key === "End") && (lt(e), re());
|
|
418
|
+
}, Oe = Pt();
|
|
409
419
|
return w(() => {
|
|
410
|
-
!Oe || !
|
|
411
|
-
}, [Oe,
|
|
420
|
+
!Oe || !M || fe === void 0 || Oe(M, se);
|
|
421
|
+
}, [Oe, M, se, fe]), q ? /* @__PURE__ */ f(
|
|
412
422
|
"button",
|
|
413
423
|
{
|
|
414
424
|
type: "button",
|
|
415
425
|
disabled: !0,
|
|
416
426
|
className: "flex h-9 w-full items-center justify-between gap-2 rounded-md border border-input bg-background px-3 text-sm text-left opacity-50 cursor-not-allowed",
|
|
417
427
|
children: [
|
|
418
|
-
/* @__PURE__ */
|
|
428
|
+
/* @__PURE__ */ f("span", { className: "truncate text-muted-foreground", children: [
|
|
419
429
|
"Select ",
|
|
420
|
-
|
|
430
|
+
q,
|
|
421
431
|
" first"
|
|
422
432
|
] }),
|
|
423
|
-
/* @__PURE__ */ s(
|
|
433
|
+
/* @__PURE__ */ s(ft, { className: "h-4 w-4 shrink-0 opacity-50" })
|
|
424
434
|
]
|
|
425
435
|
}
|
|
426
436
|
) : (
|
|
427
437
|
// Stale tooltip binds on the WRAPPER: a disabled trigger button swallows
|
|
428
438
|
// mouse events, so a locked-but-stale field would never show the hint.
|
|
429
|
-
/* @__PURE__ */
|
|
439
|
+
/* @__PURE__ */ f("div", { ref: Z, className: "relative", ...rt.bind, children: [
|
|
430
440
|
Be && !et ? (
|
|
431
441
|
// A value the reader cannot open is words, not a button: the field
|
|
432
442
|
// says the value is hidden from them (or gone) and, when it may be
|
|
@@ -436,20 +446,20 @@ function rn({
|
|
|
436
446
|
// 2026-11-12); locked, that button was dead as well.
|
|
437
447
|
// biome-ignore lint/a11y/noStaticElementInteractions: a pointer shortcut only; "Change" inside is the control a keyboard and a screen reader reach
|
|
438
448
|
// biome-ignore lint/a11y/useKeyWithClickEvents: as above — the keys are handled on "Change"
|
|
439
|
-
/* @__PURE__ */
|
|
449
|
+
/* @__PURE__ */ f(
|
|
440
450
|
"div",
|
|
441
451
|
{
|
|
442
452
|
"data-related-unavailable-field": "",
|
|
443
453
|
onClick: g ? void 0 : (e) => {
|
|
444
454
|
e.target.closest("button") || $((n) => !n);
|
|
445
455
|
},
|
|
446
|
-
className:
|
|
456
|
+
className: H(
|
|
447
457
|
"flex h-9 w-full items-center gap-2 rounded-md border border-slate-200 bg-slate-50 px-3 text-sm dark:border-border dark:bg-muted/40",
|
|
448
458
|
!g && "cursor-pointer"
|
|
449
459
|
),
|
|
450
460
|
children: [
|
|
451
461
|
/* @__PURE__ */ s("span", { className: "min-w-0 flex-1 truncate", children: /* @__PURE__ */ s(
|
|
452
|
-
|
|
462
|
+
St,
|
|
453
463
|
{
|
|
454
464
|
error: Qe,
|
|
455
465
|
collection: o,
|
|
@@ -460,7 +470,7 @@ function rn({
|
|
|
460
470
|
!g && /* @__PURE__ */ s(
|
|
461
471
|
"button",
|
|
462
472
|
{
|
|
463
|
-
ref:
|
|
473
|
+
ref: J,
|
|
464
474
|
type: "button",
|
|
465
475
|
"aria-haspopup": "listbox",
|
|
466
476
|
"aria-expanded": i,
|
|
@@ -474,32 +484,32 @@ function rn({
|
|
|
474
484
|
]
|
|
475
485
|
}
|
|
476
486
|
)
|
|
477
|
-
) : /* @__PURE__ */
|
|
487
|
+
) : /* @__PURE__ */ f(
|
|
478
488
|
"button",
|
|
479
489
|
{
|
|
480
|
-
ref:
|
|
490
|
+
ref: J,
|
|
481
491
|
type: "button",
|
|
482
492
|
disabled: g,
|
|
483
493
|
"aria-haspopup": "listbox",
|
|
484
494
|
"aria-expanded": i,
|
|
485
495
|
onClick: () => $((e) => !e),
|
|
486
496
|
onKeyDown: ct,
|
|
487
|
-
className:
|
|
497
|
+
className: H(
|
|
488
498
|
"flex h-9 w-full items-center justify-between gap-2 rounded-md border bg-background px-3 text-sm text-left hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/60 disabled:pointer-events-none disabled:opacity-50",
|
|
489
|
-
|
|
499
|
+
se ? "border-amber-300 dark:border-amber-600" : "border-input"
|
|
490
500
|
),
|
|
491
501
|
children: [
|
|
492
|
-
|
|
502
|
+
At ? /* @__PURE__ */ s(ye, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground" }) : /* @__PURE__ */ f(
|
|
493
503
|
"span",
|
|
494
504
|
{
|
|
495
|
-
className:
|
|
505
|
+
className: H(
|
|
496
506
|
"flex items-center gap-1.5 truncate min-w-0",
|
|
497
507
|
(!Ie || Ie === le) && "text-muted-foreground"
|
|
498
508
|
),
|
|
499
509
|
children: [
|
|
500
|
-
|
|
510
|
+
se && /* @__PURE__ */ f(mt, { children: [
|
|
501
511
|
/* @__PURE__ */ s(
|
|
502
|
-
|
|
512
|
+
Ot,
|
|
503
513
|
{
|
|
504
514
|
"aria-hidden": "true",
|
|
505
515
|
className: "h-3.5 w-3.5 shrink-0 text-amber-500"
|
|
@@ -507,36 +517,37 @@ function rn({
|
|
|
507
517
|
),
|
|
508
518
|
/* @__PURE__ */ s("span", { className: "sr-only", children: "Not an available option: " })
|
|
509
519
|
] }),
|
|
510
|
-
/* @__PURE__ */ s("span", { className: "truncate", children: Ie ?? O ?? "Select…" })
|
|
520
|
+
/* @__PURE__ */ s("span", { className: "truncate", children: Ie ?? O ?? "Select…" }),
|
|
521
|
+
!!r && !!B && !P && /* @__PURE__ */ s(Bt, { collection: o, id: r })
|
|
511
522
|
]
|
|
512
523
|
}
|
|
513
524
|
),
|
|
514
|
-
/* @__PURE__ */ s(
|
|
525
|
+
/* @__PURE__ */ s(ft, { className: "h-4 w-4 shrink-0 opacity-50" })
|
|
515
526
|
]
|
|
516
527
|
}
|
|
517
528
|
),
|
|
518
529
|
rt.tip,
|
|
519
|
-
i && Se && _e &&
|
|
520
|
-
/* @__PURE__ */
|
|
530
|
+
i && Se && _e && vt(
|
|
531
|
+
/* @__PURE__ */ f(
|
|
521
532
|
"div",
|
|
522
533
|
{
|
|
523
534
|
ref: ve,
|
|
524
535
|
"data-nvr-combobox-panel": "",
|
|
525
536
|
style: Se,
|
|
526
|
-
className:
|
|
537
|
+
className: H(
|
|
527
538
|
"nvr-pop-in rounded-md border border-border bg-popover shadow-md",
|
|
528
539
|
l != null && l.length ? "w-[560px] max-w-[92vw]" : "min-w-[240px] w-max max-w-[360px]"
|
|
529
540
|
),
|
|
530
541
|
children: [
|
|
531
542
|
!!(l != null && l.length) && /* @__PURE__ */ s("div", { className: "grid grid-cols-2 gap-2 border-b border-border bg-slate-50/60 p-2 dark:bg-muted/40", children: l.map((e) => {
|
|
532
543
|
const n = Ct[e.field];
|
|
533
|
-
return n ? /* @__PURE__ */
|
|
544
|
+
return n ? /* @__PURE__ */ f("div", { children: [
|
|
534
545
|
/* @__PURE__ */ s("p", { className: "mb-0.5 text-[10px] font-medium uppercase tracking-wide text-slate-400", children: e.label ?? e.field }),
|
|
535
546
|
/* @__PURE__ */ s(
|
|
536
|
-
|
|
547
|
+
cn,
|
|
537
548
|
{
|
|
538
549
|
collection: n,
|
|
539
|
-
value:
|
|
550
|
+
value: Re[e.field] ?? null,
|
|
540
551
|
onChange: (t) => qt((a) => ({ ...a, [e.field]: t })),
|
|
541
552
|
placeholder: "Any",
|
|
542
553
|
optionSort: e.sort,
|
|
@@ -545,15 +556,15 @@ function rn({
|
|
|
545
556
|
)
|
|
546
557
|
] }, e.field) : null;
|
|
547
558
|
}) }),
|
|
548
|
-
/* @__PURE__ */
|
|
549
|
-
/* @__PURE__ */ s(
|
|
559
|
+
/* @__PURE__ */ f("div", { className: "flex items-center border-b px-3", children: [
|
|
560
|
+
/* @__PURE__ */ s(Mt, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
|
|
550
561
|
/* @__PURE__ */ s(
|
|
551
562
|
"input",
|
|
552
563
|
{
|
|
553
564
|
ref: Ue,
|
|
554
565
|
value: c,
|
|
555
566
|
onChange: (e) => {
|
|
556
|
-
|
|
567
|
+
j.current = null, ce(e.target.value);
|
|
557
568
|
},
|
|
558
569
|
onKeyDown: lt,
|
|
559
570
|
role: "combobox",
|
|
@@ -565,7 +576,7 @@ function rn({
|
|
|
565
576
|
className: "flex h-9 w-full bg-transparent py-3 text-[13px] outline-none placeholder:text-muted-foreground"
|
|
566
577
|
}
|
|
567
578
|
),
|
|
568
|
-
|
|
579
|
+
W && u !== void 0 && /* @__PURE__ */ s(
|
|
569
580
|
ye,
|
|
570
581
|
{
|
|
571
582
|
"data-picker-searching": !0,
|
|
@@ -573,23 +584,23 @@ function rn({
|
|
|
573
584
|
}
|
|
574
585
|
)
|
|
575
586
|
] }),
|
|
576
|
-
/* @__PURE__ */
|
|
577
|
-
!!r && !g && /* @__PURE__ */
|
|
587
|
+
/* @__PURE__ */ f("div", { id: `${we}-list`, role: "listbox", className: "max-h-52 overflow-y-auto py-1", children: [
|
|
588
|
+
!!r && !g && /* @__PURE__ */ f(
|
|
578
589
|
"button",
|
|
579
590
|
{
|
|
580
591
|
type: "button",
|
|
581
592
|
tabIndex: -1,
|
|
582
593
|
onClick: () => {
|
|
583
|
-
|
|
594
|
+
Kt(), Ne();
|
|
584
595
|
},
|
|
585
596
|
className: "flex w-full items-center gap-2 px-3 py-1.5 text-[13px] text-slate-500 hover:bg-muted border-b border-slate-100 dark:text-slate-400 dark:border-border",
|
|
586
597
|
children: [
|
|
587
|
-
/* @__PURE__ */ s(
|
|
598
|
+
/* @__PURE__ */ s(Tt, { className: "h-3.5 w-3.5 text-slate-400" }),
|
|
588
599
|
"Clear selection"
|
|
589
600
|
]
|
|
590
601
|
}
|
|
591
602
|
),
|
|
592
|
-
Ae && /* @__PURE__ */
|
|
603
|
+
Ae && /* @__PURE__ */ f(
|
|
593
604
|
"button",
|
|
594
605
|
{
|
|
595
606
|
type: "button",
|
|
@@ -600,8 +611,8 @@ function rn({
|
|
|
600
611
|
"data-nav-index": 0,
|
|
601
612
|
"data-nvr-pinned-option": !0,
|
|
602
613
|
onClick: it,
|
|
603
|
-
onMouseMove: () => p !== 0 &&
|
|
604
|
-
className:
|
|
614
|
+
onMouseMove: () => p !== 0 && z(0),
|
|
615
|
+
className: H(
|
|
605
616
|
"flex w-full items-center gap-2 border-b border-slate-100 px-3 py-1.5 text-left text-[13px] hover:bg-nvr-cyan/10 dark:border-border",
|
|
606
617
|
p === 0 ? "bg-nvr-cyan/10" : "bg-nvr-cyan/5"
|
|
607
618
|
),
|
|
@@ -609,27 +620,27 @@ function rn({
|
|
|
609
620
|
/* @__PURE__ */ s(
|
|
610
621
|
"div",
|
|
611
622
|
{
|
|
612
|
-
className:
|
|
623
|
+
className: H(
|
|
613
624
|
"flex h-4 w-4 shrink-0 items-center justify-center rounded-full border transition-colors",
|
|
614
625
|
String(r) === L ? "border-nvr-cyan bg-nvr-cyan" : "border-slate-300"
|
|
615
626
|
),
|
|
616
627
|
children: String(r) === L && /* @__PURE__ */ s(pt, { className: "h-2.5 w-2.5 text-white" })
|
|
617
628
|
}
|
|
618
629
|
),
|
|
619
|
-
/* @__PURE__ */ s("span", { className: "min-w-0 flex-1 truncate", children:
|
|
620
|
-
/* @__PURE__ */ s("span", { className: "shrink-0 rounded bg-nvr-cyan/15 px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-slate-700 dark:text-foreground", children: (
|
|
630
|
+
/* @__PURE__ */ s("span", { className: "min-w-0 flex-1 truncate", children: U === void 0 ? "Loading…" : st }),
|
|
631
|
+
/* @__PURE__ */ s("span", { className: "shrink-0 rounded bg-nvr-cyan/15 px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-slate-700 dark:text-foreground", children: (m == null ? void 0 : m.tag) ?? "Default" })
|
|
621
632
|
]
|
|
622
633
|
}
|
|
623
634
|
),
|
|
624
|
-
u === void 0 &&
|
|
625
|
-
/* @__PURE__ */
|
|
635
|
+
u === void 0 && W ? /* @__PURE__ */ s("div", { className: "flex items-center justify-center py-4", children: /* @__PURE__ */ s(ye, { className: "h-4 w-4 animate-spin text-muted-foreground" }) }) : ee.length === 0 && !G ? /* @__PURE__ */ s("p", { className: "px-3 py-2 text-[13px] text-muted-foreground", children: "Searching…" }) : ee.length === 0 ? Ae && c.trim() ? null : d && d.labels.length > 0 && !c.trim() ? /* @__PURE__ */ f("div", { className: "px-3 py-2 text-[12px] leading-5 text-muted-foreground", children: [
|
|
636
|
+
/* @__PURE__ */ f("p", { children: [
|
|
626
637
|
"No options for",
|
|
627
638
|
" ",
|
|
628
639
|
/* @__PURE__ */ s("span", { className: "font-medium text-foreground", children: d.labels.join(" · ") }),
|
|
629
640
|
d.onClear ? " — clear one to widen the list:" : ". Change it, or ask an administrator to add options for it."
|
|
630
641
|
] }),
|
|
631
642
|
d.onClear && /* @__PURE__ */ s("div", { className: "mt-1.5 flex flex-wrap gap-1.5", children: d.keys.map(
|
|
632
|
-
(e, n) => d.clearable && !d.clearable.includes(e) ? null : /* @__PURE__ */
|
|
643
|
+
(e, n) => d.clearable && !d.clearable.includes(e) ? null : /* @__PURE__ */ f(
|
|
633
644
|
"button",
|
|
634
645
|
{
|
|
635
646
|
type: "button",
|
|
@@ -646,8 +657,8 @@ function rn({
|
|
|
646
657
|
e
|
|
647
658
|
)
|
|
648
659
|
) })
|
|
649
|
-
] }) : /* @__PURE__ */ s("p", { className: "px-3 py-2 text-[13px] text-muted-foreground", children: c.trim() ? `No results for “${c.trim()}”` : "No results" }) : /* @__PURE__ */
|
|
650
|
-
|
|
660
|
+
] }) : /* @__PURE__ */ s("p", { className: "px-3 py-2 text-[13px] text-muted-foreground", children: c.trim() ? `No results for “${c.trim()}”` : "No results" }) : /* @__PURE__ */ f(mt, { children: [
|
|
661
|
+
oe && /* @__PURE__ */ f(
|
|
651
662
|
"p",
|
|
652
663
|
{
|
|
653
664
|
"data-picker-close-matches": !0,
|
|
@@ -659,50 +670,51 @@ function rn({
|
|
|
659
670
|
]
|
|
660
671
|
}
|
|
661
672
|
),
|
|
662
|
-
|
|
663
|
-
const t = k(b, e), a =
|
|
664
|
-
return /* @__PURE__ */
|
|
673
|
+
ee.map((e, n) => {
|
|
674
|
+
const t = k(b, e), a = ne(t) ? le : t, E = String(e.id) === String(r), C = n + te;
|
|
675
|
+
return /* @__PURE__ */ f(
|
|
665
676
|
"button",
|
|
666
677
|
{
|
|
667
678
|
type: "button",
|
|
668
679
|
tabIndex: -1,
|
|
669
|
-
id: Fe(
|
|
680
|
+
id: Fe(C),
|
|
670
681
|
role: "option",
|
|
671
682
|
"aria-selected": E,
|
|
672
|
-
"data-nav-index":
|
|
683
|
+
"data-nav-index": C,
|
|
673
684
|
onClick: () => at(e),
|
|
674
|
-
onMouseMove: () => p !==
|
|
675
|
-
className:
|
|
685
|
+
onMouseMove: () => p !== C && z(C),
|
|
686
|
+
className: H(
|
|
676
687
|
"flex w-full items-center gap-2 px-3 py-1.5 text-[13px] text-left hover:bg-muted",
|
|
677
|
-
p ===
|
|
688
|
+
p === C && "bg-muted"
|
|
678
689
|
),
|
|
679
690
|
children: [
|
|
680
691
|
/* @__PURE__ */ s(
|
|
681
692
|
"div",
|
|
682
693
|
{
|
|
683
|
-
className:
|
|
694
|
+
className: H(
|
|
684
695
|
"flex h-4 w-4 shrink-0 items-center justify-center rounded-full border transition-colors",
|
|
685
696
|
E ? "border-nvr-cyan bg-nvr-cyan" : "border-slate-300"
|
|
686
697
|
),
|
|
687
698
|
children: E && /* @__PURE__ */ s(pt, { className: "h-2.5 w-2.5 text-white" })
|
|
688
699
|
}
|
|
689
700
|
),
|
|
690
|
-
|
|
691
|
-
|
|
701
|
+
P && /* @__PURE__ */ s(
|
|
702
|
+
Yt,
|
|
692
703
|
{
|
|
693
704
|
userId: e.id,
|
|
694
705
|
className: "h-4 w-4",
|
|
695
|
-
fallback: /* @__PURE__ */ s("span", { className: "flex h-4 w-4 shrink-0 items-center justify-center rounded-full bg-nvr-cyan/20 text-[8px] font-bold text-nvr-navy dark:text-nvr-cyan", children:
|
|
706
|
+
fallback: /* @__PURE__ */ s("span", { className: "flex h-4 w-4 shrink-0 items-center justify-center rounded-full bg-nvr-cyan/20 text-[8px] font-bold text-nvr-navy dark:text-nvr-cyan", children: an(a) })
|
|
696
707
|
}
|
|
697
708
|
),
|
|
698
|
-
|
|
709
|
+
P && $t.has(String(e.id).toUpperCase()) && /* @__PURE__ */ s(
|
|
699
710
|
"span",
|
|
700
711
|
{
|
|
701
712
|
className: "h-1.5 w-1.5 shrink-0 rounded-full bg-emerald-500",
|
|
702
713
|
"data-tip": "Online now"
|
|
703
714
|
}
|
|
704
715
|
),
|
|
705
|
-
/* @__PURE__ */ s(
|
|
716
|
+
/* @__PURE__ */ s(zt, { text: a, query: c }),
|
|
717
|
+
/* @__PURE__ */ s(en, { badges: Ft[String(e.id)] }),
|
|
706
718
|
nt.has(String(e.id)) && /* @__PURE__ */ s(
|
|
707
719
|
"span",
|
|
708
720
|
{
|
|
@@ -718,14 +730,14 @@ function rn({
|
|
|
718
730
|
})
|
|
719
731
|
] })
|
|
720
732
|
] }),
|
|
721
|
-
!
|
|
722
|
-
|
|
733
|
+
!W && /* @__PURE__ */ s(
|
|
734
|
+
dn,
|
|
723
735
|
{
|
|
724
736
|
collection: o,
|
|
725
|
-
search:
|
|
726
|
-
filter:
|
|
737
|
+
search: T,
|
|
738
|
+
filter: qe,
|
|
727
739
|
narrowedLabels: (d == null ? void 0 : d.labels) ?? [],
|
|
728
|
-
auto: (u ?? []).length === 0 && !!
|
|
740
|
+
auto: (u ?? []).length === 0 && !!T
|
|
729
741
|
}
|
|
730
742
|
)
|
|
731
743
|
]
|
|
@@ -736,17 +748,17 @@ function rn({
|
|
|
736
748
|
] })
|
|
737
749
|
);
|
|
738
750
|
}
|
|
739
|
-
function
|
|
751
|
+
function dn({
|
|
740
752
|
collection: o,
|
|
741
753
|
search: r,
|
|
742
754
|
filter: h,
|
|
743
755
|
narrowedLabels: g,
|
|
744
756
|
auto: O
|
|
745
757
|
}) {
|
|
746
|
-
const
|
|
747
|
-
queryKey: ["picker-narrowing", o, r,
|
|
748
|
-
queryFn: () =>
|
|
749
|
-
|
|
758
|
+
const R = Me(), [x, N] = F(!1), q = h ? JSON.stringify(h) : "", { data: l, isFetching: M } = I({
|
|
759
|
+
queryKey: ["picker-narrowing", o, r, q],
|
|
760
|
+
queryFn: () => R.request(
|
|
761
|
+
Ut("/picker-narrowing", { collection: o, search: r, filter: h ?? null })
|
|
750
762
|
).then((y) => y.data),
|
|
751
763
|
enabled: x || O,
|
|
752
764
|
staleTime: 3e4,
|
|
@@ -765,12 +777,12 @@ function on({
|
|
|
765
777
|
children: "Missing something?"
|
|
766
778
|
}
|
|
767
779
|
);
|
|
768
|
-
if (
|
|
780
|
+
if (M && !l)
|
|
769
781
|
return /* @__PURE__ */ s("p", { className: "border-t border-border px-3 py-1.5 text-[11px] text-muted-foreground", children: "Checking what narrows this list…" });
|
|
770
782
|
if (!l) return null;
|
|
771
|
-
const d = [],
|
|
783
|
+
const d = [], m = r ? `match “${r}”` : "exist";
|
|
772
784
|
return l.by_field_filter > 0 && d.push(
|
|
773
|
-
`${l.by_field_filter.toLocaleString()} more ${
|
|
785
|
+
`${l.by_field_filter.toLocaleString()} more ${m} but this field only offers ${g.length ? `records that fit ${g.join(" · ")}` : "records its filter allows"}.`
|
|
774
786
|
), l.by_exclusions > 0 && d.push(
|
|
775
787
|
`${l.by_exclusions.toLocaleString()} ${l.by_exclusions === 1 ? "is" : "are"} hidden from pickers by an admin.`
|
|
776
788
|
), l.scopes.length > 0 && d.push(`Your ${l.scopes.join(", ")} access narrows what you can pick here.`), l.row_filter && d.push("Your role only sees some of these records."), d.length === 0 && d.push(
|
|
@@ -786,54 +798,54 @@ function on({
|
|
|
786
798
|
}
|
|
787
799
|
);
|
|
788
800
|
}
|
|
789
|
-
function
|
|
801
|
+
function In({
|
|
790
802
|
collection: o,
|
|
791
803
|
id: r,
|
|
792
804
|
displayTemplate: h,
|
|
793
805
|
explainMissing: g
|
|
794
806
|
}) {
|
|
795
|
-
const O =
|
|
807
|
+
const O = Me(), R = wt(), x = o === "nivaro_files" || o === "directus_files", N = (() => {
|
|
796
808
|
if (!h || !h.includes(".")) return null;
|
|
797
809
|
const y = [...h.matchAll(/\{\{([^}]+)\}\}/g)].map((xe) => xe[1].trim());
|
|
798
810
|
return y.length > 0 ? ["id", ...y].join(",") : null;
|
|
799
|
-
})(), { data:
|
|
811
|
+
})(), { data: q, isLoading: l, error: M } = I({
|
|
800
812
|
queryKey: ["relation-single", o, String(r), N ?? ""],
|
|
801
813
|
queryFn: () => x ? (
|
|
802
814
|
// The file's row, not its bytes: GET /files/:id downloads the whole
|
|
803
815
|
// file (twice with the retry, 404 when storage lost it) only to read
|
|
804
816
|
// its name, and a missing object left the raw id as the label.
|
|
805
817
|
O.request(
|
|
806
|
-
|
|
818
|
+
V(`/files/${encodeURIComponent(String(r))}/meta`)
|
|
807
819
|
).then((y) => y.data)
|
|
808
|
-
) :
|
|
820
|
+
) : R(o, r, N),
|
|
809
821
|
enabled: !!r && !!o,
|
|
810
822
|
staleTime: 6e4,
|
|
811
|
-
retry:
|
|
812
|
-
}), { settling: d } =
|
|
813
|
-
|
|
814
|
-
g && !l && !
|
|
823
|
+
retry: kt
|
|
824
|
+
}), { settling: d } = Nt(
|
|
825
|
+
M,
|
|
826
|
+
g && !l && !q ? o : null,
|
|
815
827
|
r
|
|
816
828
|
);
|
|
817
829
|
if (l || d) return /* @__PURE__ */ s(ye, { className: "h-3 w-3 animate-spin text-slate-400" });
|
|
818
|
-
if (!
|
|
830
|
+
if (!q)
|
|
819
831
|
return r == null || r === "" ? null : /* @__PURE__ */ s(
|
|
820
|
-
|
|
832
|
+
St,
|
|
821
833
|
{
|
|
822
|
-
error:
|
|
834
|
+
error: M,
|
|
823
835
|
collection: g ? o : null,
|
|
824
836
|
id: g ? r : null
|
|
825
837
|
}
|
|
826
838
|
);
|
|
827
839
|
if (x) {
|
|
828
|
-
const y =
|
|
840
|
+
const y = q.title || q.filename_download || q.filename_disk || String(r);
|
|
829
841
|
return /* @__PURE__ */ s("span", { children: y });
|
|
830
842
|
}
|
|
831
|
-
const
|
|
832
|
-
return
|
|
843
|
+
const m = k(h, q);
|
|
844
|
+
return ne(m) ? /* @__PURE__ */ s("span", { className: "italic text-muted-foreground", children: le }) : /* @__PURE__ */ s("span", { children: m });
|
|
833
845
|
}
|
|
834
846
|
export {
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
847
|
+
In as RelatedItemLabel,
|
|
848
|
+
cn as RelationCombobox,
|
|
849
|
+
xt as isSamePick,
|
|
850
|
+
ln as useStaleTip
|
|
839
851
|
};
|